diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000000000..ca97ab47dfea49 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,39 @@ +root = true + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true + +[vcbuild.bat] +end_of_line = crlf + +[*.{md,markdown}] +trim_trailing_whitespace = false + +[{lib,src,test}/**.js] +indent_style = space +indent_size = 2 + +[src/**.{h,cc}] +indent_style = space +indent_size = 2 + +[test/*.py] +indent_style = space +indent_size = 2 + +[configure] +indent_style = space +indent_size = 2 + +[Makefile] +indent_style = tab +indent_size = 8 + +[{deps,tools}/**] +indent_style = ignore +indent_size = ignore +end_of_line = ignore +trim_trailing_whitespace = ignore +charset = ignore diff --git a/.eslintignore b/.eslintignore index 6f1caaa873f19f..9b5c5fccb643e4 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,6 +1,8 @@ +lib/internal/v8_prof_polyfill.js lib/punycode.js -test/addons/doc-*/ +test/addons/??_*/ test/fixtures test/**/node_modules test/disabled test/tmp*/ +tools/doc/node_modules diff --git a/.eslintrc b/.eslintrc index cf1f7682cdcf91..af0e6ddc15670f 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,87 +1,93 @@ env: node: true - -# enable ECMAScript features -ecmaFeatures: - arrowFunctions: true - binaryLiterals: true - blockBindings: true - classes: true - forOf: true - generators: true - objectLiteralShorthandMethods: true - objectLiteralShorthandProperties: true - octalLiterals: true - templateStrings: true + es6: true rules: # Possible Errors - # list: https://github.com/eslint/eslint/tree/master/docs/rules#possible-errors - ## check debugger sentence + # http://eslint.org/docs/rules/#possible-errors + comma-dangle: [2, "only-multiline"] + no-control-regex: 2 no-debugger: 2 - ## check duplicate arguments no-dupe-args: 2 - ## check duplicate object keys no-dupe-keys: 2 - ## check duplicate switch-case no-duplicate-case: 2 - ## disallow assignment of exceptional params + no-empty-character-class: 2 no-ex-assign: 2 - ## disallow use of reserved words as keys like enum, class - no-reserved-keys: 2 - ## disallow unreachable code + no-extra-boolean-cast: 2 + no-extra-parens: [2, "functions"] + no-extra-semi: 2 + no-func-assign: 2 + no-invalid-regexp: 2 + no-irregular-whitespace: 2 + no-negated-in-lhs: 2 + no-obj-calls: 2 + no-proto: 2 + no-unexpected-multiline: 2 no-unreachable: 2 - ## require valid typeof compared string like typeof foo === 'strnig' + use-isnan: 2 valid-typeof: 2 # Best Practices - # list: https://github.com/eslint/eslint/tree/master/docs/rules#best-practices - ## require falls through comment on switch-case + # http://eslint.org/docs/rules/#best-practices no-fallthrough: 2 + no-octal: 2 + no-redeclare: 2 + no-self-assign: 2 + no-unused-labels: 2 + + # Strict Mode + # http://eslint.org/docs/rules/#strict-mode + strict: [2, "global"] + + # Variables + # http://eslint.org/docs/rules/#variables + no-delete-var: 2 + no-undef: 2 + no-unused-vars: [2, {"args": "none"}] + + # Node.js and CommonJS + # http://eslint.org/docs/rules/#nodejs-and-commonjs + no-mixed-requires: 2 + no-new-require: 2 + no-path-concat: 2 + no-restricted-modules: [2, "sys", "_linklist"] # Stylistic Issues - # list: https://github.com/eslint/eslint/tree/master/docs/rules#stylistic-issues - ## use single quote, we can use double quote when escape chars - quotes: [2, "single", "avoid-escape"] - ## 2 space indentation - indent: [2, 2] - ## add space after comma + # http://eslint.org/docs/rules/#stylistic-issues comma-spacing: 2 - ## put semi-colon - semi: 2 - ## require spaces operator like var sum = 1 + 1; - space-infix-ops: 2 - ## require spaces return, throw, case - space-return-throw-case: 2 - ## no space before function, eg. 'function()' - space-before-function-paren: [2, "never"] - ## require space before blocks, eg 'function() {' - space-before-blocks: [2, "always"] - ## require parens for Constructor - new-parens: 2 - ## max 80 length + eol-last: 2 + indent: [2, 2, {SwitchCase: 1}] + keyword-spacing: 2 max-len: [2, 80, 2] - ## max 2 consecutive empty lines + new-parens: 2 + no-mixed-spaces-and-tabs: 2 no-multiple-empty-lines: [2, {max: 2}] - ## require newline at end of files - eol-last: 2 - ## no trailing spaces no-trailing-spaces: 2 - # require space after keywords, eg 'for (..)' - space-after-keywords: 2 - - # Strict Mode - # list: https://github.com/eslint/eslint/tree/master/docs/rules#strict-mode - ## 'use strict' on top - strict: [2, "global"] + quotes: [2, "single", "avoid-escape"] + semi: 2 + space-before-blocks: [2, "always"] + space-before-function-paren: [2, "never"] + space-in-parens: [2, "never"] + space-infix-ops: 2 + space-unary-ops: 2 - # Variables - # list: https://github.com/eslint/eslint/tree/master/docs/rules#variables - ## disallow use of undefined variables (globals) - no-undef: 2 + # ECMAScript 6 + # http://eslint.org/docs/rules/#ecmascript-6 + arrow-parens: [2, "always"] + arrow-spacing: [2, {"before": true, "after": true}] + constructor-super: 2 + no-class-assign: 2 + no-confusing-arrow: 2 + no-const-assign: 2 + no-dupe-class-members: 2 + no-new-symbol: 2 + no-this-before-super: 2 + prefer-const: 2 # Custom rules in tools/eslint-rules - require-buffer: 2 + assert-fail-single-argument: 2 + new-with-error: [2, "Error", "RangeError", "TypeError", "SyntaxError", "ReferenceError"] + align-multiline-assignment: 2 # Global scoped method and vars globals: @@ -103,5 +109,3 @@ globals: DTRACE_NET_SERVER_CONNECTION : false LTTNG_NET_SERVER_CONNECTION : false COUNTER_NET_SERVER_CONNECTION : false - escape : false - unescape : false diff --git a/.gitignore b/.gitignore index 18240c442e00cf..c7361af80c79dc 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,7 @@ icu_config.gypi # various stuff that VC++ produces/uses Debug/ -!node_modules/debug/ +!**/node_modules/debug/ !deps/v8/src/debug/ Release/ !doc/blog/** @@ -41,16 +41,20 @@ _UpgradeReport_Files/ ipch/ *.sdf *.opensdf +*.VC.opendb +.vs/ /config.mk /config.gypi +/config_fips.gypi *-nodegyp* /gyp-mac-tool /dist-osx /npm.wxs /tools/msvs/npm.wixobj +/tools/msvs/genfiles/ /tools/osx-pkg.pmdoc/index.xml -/test/addons/doc-*/ +/test/addons/??_*/ email.md deps/v8-* deps/icu diff --git a/.mailmap b/.mailmap index 8400b36a6c90d6..78da54872c0f9c 100644 --- a/.mailmap +++ b/.mailmap @@ -6,6 +6,7 @@ Alexey Kupershtokh Alexis Campailla Alexis Sellier Alexis Sellier +Andy Bettisworth Aria Stewart Arlo Breault Artem Zaytsev @@ -19,15 +20,20 @@ Bert Belder Brandon Benvie Brian White Brian White +Caleb Boyd +Charles Chew Choon Keat Charles Rudolph +Claudio Rodriguez Colin Ihrig Christopher Lenz +Dan Kaplun Daniel Berger Daniel Chcouri <333222@gmail.com> Daniel Gröber Daniel Gröber Daniel Pihlström +Danny Nemer Dave Pacheco David Siegel Domenic Denicola @@ -37,6 +43,8 @@ Einar Otto Stangvik Elliott Cable EungJun Yi Evan Larkin +Evan Lucas +Evan Lucas Farid Neshat Fedor Indutny Felix Böhm @@ -48,23 +56,29 @@ Gabriel de Perthuis Gil Pedersen Henry Chin Herbert Vojčík +Icer Liang Igor Soarez Igor Zinkovsky Isaac Z. Schlueter Isaac Z. Schlueter Jake Verbaten James Hartig +Jan Krems Jered Schmidt Jeremiah Senkpiel +Jerry Chin Joe Shaw Johan Bergström Johan Dahlberg Johann Hofmann Jonas Pfenniger Jonathan Ong +Jonathan Persson Jonathan Rentzsch Josh Erickson Joshua S. Weinstein +Junliang Yan +Junliang Yan Jérémy Lal Jérémy Lal Kai Sasaki Lewuathe @@ -81,6 +95,8 @@ Malte-Thorben Bruns Malte-Thorben Bruns Marcin Cieślak Marcin Cieślak +Marti Martz +Martial James Jefferson Mathias Pettersson Matthew Lye Michael Bernstein @@ -95,16 +111,20 @@ Nicholas Kinsey Nikolai Vavilov Onne Gorter Paul Querna +Peter Flannery +Phillip Johnsen Ray Morgan Ray Solomon Raymond Feng Rick Olson Roman Klauke Roman Reiss +Ron Korving Ryan Dahl Ryan Emery Sakthipriyan Vairamani Sam Mikes +Sam P Gallagher-Bishop Sam Shull Sam Shull Sambasiva Suda diff --git a/AUTHORS b/AUTHORS index 3e80bf26e550ca..5ab61aebf20966 100644 --- a/AUTHORS +++ b/AUTHORS @@ -517,7 +517,7 @@ Cam Swords Paul Loyd Benjamin Waters Lev Gimelfarb -pflannery +Peter Flannery Tuğrul Topuz Lorenz Leutgeb ayanamist @@ -565,7 +565,7 @@ Feross Aboukhadijeh Refael Ackermann Taojie Greg Sabia Tucker -Dan Kaplun +Dan Kaplun Colin Ihrig Greg Sabia Tucker Mark Stosberg @@ -580,7 +580,7 @@ Roman Klauke Xavi Magrinyà Euan Ed Morley -Charles +Charles Jan Krems Fred K. Schott Chris Dickinson @@ -648,7 +648,7 @@ Bryce Kahle The Gitter Badger Brendan Ashworth Jose Luis Rivas -Evan Lucas +Evan Lucas Vincent Weevers Tyler Kellen Evan Torrie @@ -669,7 +669,6 @@ Calvin Metcalf Eric Mill pkcs James M Snell -Evan Lucas Cydox Steven Rockarts Vladimir Guguiev @@ -690,7 +689,7 @@ Glen Keane Xiaowei Li <446240525@qq.com> toastynerd Todd Kennedy -Icer Liang +Icer Liang Stephen Belanger Jeremiah Senkpiel Brendan Ashworth @@ -794,7 +793,7 @@ Oleksandr Chekhovskyi Tristian Flanagan Mike Tunnicliffe Ionică Bizău -Danny Nemer +Danny Nemer Sven Slootweg Dmitry Vasilyev Malcolm Ahoy @@ -810,5 +809,64 @@ Michał Gołębiowski Johann Hofmann Charles Rudolph Dave Eddy +Justin Chase +Jeremy Whitlock +Rod Machen +Martial James Jefferson +Doug Shamoo +Junliang Yan +Dave Hodder +Jason Karns +Balázs Galambosi +David Boivin +Liang-Chi Hsieh +Timothy Gu +Fábio Santos +Myles Borins +Jonas Dohse +Коренберг Марк +Caleb Boyd +Yuval Brik +Claudio Rodriguez +Ido Ben-Yair +Kyle Smith +Marti Martz +Stefan Budeanu +Emily Aviva Kapor-Mater +Sam P Gallagher-Bishop +David Woods +Ashok Suthar +Ömer Fadıl Usta +Jerry Chin +Hemanth.HM +Hugues Malphettes +Tyler Henkel +Zheng Chaoping +Ashley Williams +Bryan English +Devin Nakamura +Vladimir Varankin +Manuel B +Jesse McCarthy +Craig Cavalier +Michael Cornacchia +Markus Tzoe +Martin Forsberg +Carl Lei +Lewis Cowper +Bryon Leung +Chunyang Dai +Jonathan Persson +Dave +Luigi Pinca +Peter A. Bigot +Zirak +Scott Buchanan +Rebecca Turner +Bryce Baril +Super Zheng +Rafał Pocztarski +Michael Ruddy +Andy Bettisworth # Generated by tools/update-authors.sh diff --git a/BUILDING.md b/BUILDING.md new file mode 100644 index 00000000000000..a4aa0808237c54 --- /dev/null +++ b/BUILDING.md @@ -0,0 +1,253 @@ +## Building Node.js + +Depending on what platform or features you require the build process may +differ slightly. After you've successfully built a binary, running the +test suite to validate that the binary works as intended is a good next step. + +If you consistently can reproduce a test failure, search for it in the +[Node.js issue tracker](https://github.com/nodejs/node/issues) or +file a new issue. + + +### Unix / Macintosh + +Prerequisites: + +* `gcc` and `g++` 4.8 or newer, or +* `clang` and `clang++` 3.4 or newer +* Python 2.6 or 2.7 +* GNU Make 3.81 or newer +* libexecinfo (FreeBSD and OpenBSD only) + +```text +$ ./configure +$ make +$ [sudo] make install +``` + +If your Python binary is in a non-standard location or has a +non-standard name, run the following instead: + +```text +$ export PYTHON=/path/to/python +$ $PYTHON ./configure +$ make +$ [sudo] make install +``` + +To run the tests: + +```text +$ make test +``` + +To build the documentation: + +```text +$ make doc +``` + +To read the documentation: + +```text +$ man doc/node.1 +``` + +To test if Node.js was built correctly: + +``` +$ node -e "console.log('Hello from Node.js ' + process.version)" +``` + + +### Windows + +Prerequisites: + +* [Python 2.6 or 2.7](https://www.python.org/downloads/) +* Visual Studio 2013 / 2015, all editions including the Community edition, or +* Visual Studio Express 2013 / 2015 for Desktop +* Basic Unix tools required for some tests, + [Git for Windows](http://git-scm.com/download/win) includes Git Bash + and tools which can be included in the global `PATH`. + +```text +> vcbuild nosign +``` + +To run the tests: + +```text +> vcbuild test +``` + +To test if Node.js was built correctly: + +``` +$ node -e "console.log('Hello from Node.js ' + process.version)" +``` + +### 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. + +Be sure you have downloaded and extracted [Android NDK] +(https://developer.android.com/tools/sdk/ndk/index.html) +before in a folder. Then run: + +``` +$ ./android-configure /path/to/your/android-ndk +$ make +``` + + +### `Intl` (ECMA-402) support: + +[Intl](https://github.com/nodejs/node/wiki/Intl) support is not +enabled by default. + + +#### "small" (English only) support + +This option will build with "small" (English only) support, but +the full `Intl` (ECMA-402) APIs. With `--download=all` it will +download the ICU library as needed. + +##### Unix / Macintosh: + +```text +$ ./configure --with-intl=small-icu --download=all +``` + +##### Windows: + +```text +> vcbuild small-icu download-all +``` + +The `small-icu` mode builds with English-only data. You can add full +data at runtime. + +*Note:* more docs are on +[the node wiki](https://github.com/nodejs/node/wiki/Intl). + +#### Build with full ICU support (all locales supported by ICU): + +With the `--download=all`, this may download ICU if you don't have an +ICU in `deps/icu`. + +##### Unix / Macintosh: + +```text +$ ./configure --with-intl=full-icu --download=all +``` + +##### Windows: + +```text +> vcbuild full-icu download-all +``` + +#### Building without Intl support + +The `Intl` object will not be available. This is the default at +present, so this option is not normally needed. + +##### Unix / Macintosh: + +```text +$ ./configure --with-intl=none +``` + +##### Windows: + +```text +> vcbuild intl-none +``` + +#### Use existing installed ICU (Unix / Macintosh only): + +```text +$ 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 +that works for both your host and target environments. + +#### Build with a specific ICU: + +You can find other ICU releases at +[the ICU homepage](http://icu-project.org/download). +Download the file named something like `icu4c-**##.#**-src.tgz` (or +`.zip`). + +##### Unix / Macintosh + +```text +# from an already-unpacked ICU: +$ ./configure --with-intl=[small-icu,full-icu] --with-icu-source=/path/to/icu + +# from a local ICU tarball +$ ./configure --with-intl=[small-icu,full-icu] --with-icu-source=/path/to/icu.tgz + +# from a tarball URL +$ ./configure --with-intl=full-icu --with-icu-source=http://url/to/icu.tgz +``` + +##### Windows + +First unpack latest ICU to `deps/icu` +[icu4c-**##.#**-src.tgz](http://icu-project.org/download) (or `.zip`) +as `deps/icu` (You'll have: `deps/icu/source/...`) + +```text +> vcbuild full-icu +``` + +## Building Node.js with FIPS-compliant OpenSSL + +NOTE: Windows is not yet supported + +It is possible to build Node.js with +[OpenSSL FIPS module](https://www.openssl.org/docs/fips/fipsnotes.html). + +**Note**: building in this way does **not** allow you to claim that the +runtime is FIPS 140-2 validated. Instead you can indicate that the runtime +uses a validated module. See the [security policy](http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1747.pdf) +page 60 for more details. In addition, the validation for the underlying module +is only valid if it is deployed in accordance with its [security policy](http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1747.pdf). +If you need FIPS validated cryptography it is recommended that you read both +the [security policy](http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1747.pdf) +and [user guide](https://openssl.org/docs/fips/UserGuide-2.0.pdf). + +### Instructions + +1. Obtain a copy of openssl-fips-x.x.x.tar.gz. + To comply with the security policy you must ensure the path + through which you get the file complies with the requirements + for a "secure installation" as described in section 6.6 in + the [user guide](https://openssl.org/docs/fips/UserGuide-2.0.pdf). + For evaluation/experimentation you can simply download and verify + `openssl-fips-x.x.x.tar.gz` from https://www.openssl.org/source/ +2. Extract source to `openssl-fips` folder and `cd openssl-fips` +3. `./config` +4. `make` +5. `make install` + (NOTE: to comply with the security policy you must use the exact + commands in steps 3-5 without any additional options as per + Appendix A in the [security policy](http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1747.pdf). + The only exception is that `./config no-asm` can be + used in place of `./config`, and the FIPSDIR environment variable + may be used to specify a non-standard install folder for the + validated module, as per User Guide sections 4.2.1, 4.2.2, and 4.2.3. +6. Get into Node.js checkout folder +7. `./configure --openssl-fips=/path/to/openssl-fips/installdir` + For example on ubuntu 12 the installation directory was + /usr/local/ssl/fips-2.0 +8. Build Node.js with `make -j` +9. Verify with `node -p "process.versions.openssl"` (`1.0.2a-fips`) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1a164265cdec6..454e0c04ca004e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,1719 @@ - # Node.js ChangeLog +## 2016-04-20, Version 5.11.0 (Stable), @thealphanerd + +## Notable Changes + +* **Buffer**: + * `Buffer.prototype.compare` can now compare sub-ranges of two Buffers. (James M Snell) [#5880](https://github.com/nodejs/node/pull/5880) +* **deps**: + * update to http-parser 2.7.0 (Fedor Indutny) [#6279](https://github.com/nodejs/node/pull/6279) + * update ESLint to 2.7.0 (silverwind) [#6132](https://github.com/nodejs/node/pull/6132) +* **net**: + * adds support for passing DNS lookup hints to `createConnection()` (Colin Ihrig) [#6000](https://github.com/nodejs/node/pull/6000) +* **node**: + * Make the builtin libraries available for the `--eval` and `--print` CLI options (Anna Henningsen) [#6207](https://github.com/nodejs/node/pull/6207) +* **npm**: + * upgrade npm to 3.8.6 (Kat Marchán) [#6153](https://github.com/nodejs/node/pull/6153) +* **repl**: + * Pressing enter in the repl will repeat the last command by default if no input has been received. This behaviour was in node previously and was not removed intentionally. (Rich Trott) [#6090](https://github.com/nodejs/node/pull/6090) +* **src**: + * add SIGINFO to supported signals (James Reggio) [#6093](https://github.com/nodejs/node/pull/6093) +* **streams**: + * Fix a regression that caused by net streams requesting multiple chunks synchronously when combined with cork/uncork (Matteo Collina) [#6164](https://github.com/nodejs/node/pull/6164) +* **zlib**: + * The flushing flag is now configurable allowing for decompression of partial data (Anna Henningsen) [#6069](https://github.com/nodejs/node/pull/6069) + +### Commits + +* [[`14fcb1dded`](https://github.com/nodejs/node/commit/14fcb1dded)] - **assert**: respect assert.doesNotThrow message. (Ilya Shaisultanov) [#2407](https://github.com/nodejs/node/pull/2407) +* [[`332f7382bb`](https://github.com/nodejs/node/commit/332f7382bb)] - **benchmark**: add module loader benchmark parameter (Brian White) [#5172](https://github.com/nodejs/node/pull/5172) +* [[`473f086a94`](https://github.com/nodejs/node/commit/473f086a94)] - **(SEMVER-MINOR)** **buffer**: add Buffer.prototype.compare by offset (James M Snell) [#5880](https://github.com/nodejs/node/pull/5880) +* [[`d44540f5af`](https://github.com/nodejs/node/commit/d44540f5af)] - **buffer**: standardize array index check (Trevor Norris) [#6084](https://github.com/nodejs/node/pull/6084) +* [[`bd12d72e0c`](https://github.com/nodejs/node/commit/bd12d72e0c)] - **build**: fix make tar-headers for Linux (Gibson Fahnestock) [#5978](https://github.com/nodejs/node/pull/5978) +* [[`3c8d404a82`](https://github.com/nodejs/node/commit/3c8d404a82)] - **build**: allow test-ci to run tests in parallel (Johan Bergström) [#6208](https://github.com/nodejs/node/pull/6208) +* [[`a5f8d0c6ef`](https://github.com/nodejs/node/commit/a5f8d0c6ef)] - **build**: remove -f{data,function}-sections flags (Ben Noordhuis) [#6077](https://github.com/nodejs/node/pull/6077) +* [[`adfb1a4bb0`](https://github.com/nodejs/node/commit/adfb1a4bb0)] - **child_process**: add nullptr checks after allocs (Anna Henningsen) [#6256](https://github.com/nodejs/node/pull/6256) +* [[`1fb40524ee`](https://github.com/nodejs/node/commit/1fb40524ee)] - **(SEMVER-MINOR)** **debugger**: run last command on presssing enter (Rich Trott) [#6090](https://github.com/nodejs/node/pull/6090) +* [[`5305831184`](https://github.com/nodejs/node/commit/5305831184)] - **deps**: update to http-parser 2.7.0 (Fedor Indutny) [#6279](https://github.com/nodejs/node/pull/6279) +* [[`8ae200c768`](https://github.com/nodejs/node/commit/8ae200c768)] - **deps**: floating fix for npm's test-node script (Kat Marchán) [#6153](https://github.com/nodejs/node/pull/6153) +* [[`e3e544eb96`](https://github.com/nodejs/node/commit/e3e544eb96)] - **deps**: upgrade npm to 3.8.6 (Kat Marchán) [#6153](https://github.com/nodejs/node/pull/6153) +* [[`a7104e4516`](https://github.com/nodejs/node/commit/a7104e4516)] - **deps**: cherry-pick 1383d00 from v8 upstream (Fedor Indutny) [#6179](https://github.com/nodejs/node/pull/6179) +* [[`632e6b9617`](https://github.com/nodejs/node/commit/632e6b9617)] - **deps**: backport 125ac66 from v8 upstream (Myles Borins) [#6086](https://github.com/nodejs/node/pull/6086) +* [[`4b8376986a`](https://github.com/nodejs/node/commit/4b8376986a)] - **doc**: git mv to .md (Robert Jefe Lindstaedt) [#4747](https://github.com/nodejs/node/pull/4747) +* [[`e6f4a175d4`](https://github.com/nodejs/node/commit/e6f4a175d4)] - **doc**: add full example for zlib.flush() (Anna Henningsen) [#6172](https://github.com/nodejs/node/pull/6172) +* [[`50f3f10ce6`](https://github.com/nodejs/node/commit/50f3f10ce6)] - **doc**: note that zlib.flush acts after pending writes (Anna Henningsen) [#6172](https://github.com/nodejs/node/pull/6172) +* [[`985685d170`](https://github.com/nodejs/node/commit/985685d170)] - **doc**: fix broken references (Alexander Gromnitsky) [#6100](https://github.com/nodejs/node/pull/6100) +* [[`d66d883a85`](https://github.com/nodejs/node/commit/d66d883a85)] - **doc**: path.format provide more examples (John Eversole) [#5838](https://github.com/nodejs/node/pull/5838) +* [[`dc1552e321`](https://github.com/nodejs/node/commit/dc1552e321)] - **doc**: replace functions with arrow functions (abouthiroppy) [#6203](https://github.com/nodejs/node/pull/6203) +* [[`fa04dfc307`](https://github.com/nodejs/node/commit/fa04dfc307)] - **doc**: DCO anchor that doesn't change (William Kapke) [#6257](https://github.com/nodejs/node/pull/6257) +* [[`b49a5b33b5`](https://github.com/nodejs/node/commit/b49a5b33b5)] - **doc**: fix http response event, Agent#getName (Matthew Douglass) [#5993](https://github.com/nodejs/node/pull/5993) +* [[`3b00d7a5b1`](https://github.com/nodejs/node/commit/3b00d7a5b1)] - **doc**: document intention and dangers of fs module Buffer API (Nikolai Vavilov) [#6020](https://github.com/nodejs/node/pull/6020) +* [[`3bc31526bb`](https://github.com/nodejs/node/commit/3bc31526bb)] - **doc**: explain differences in console.assert between node and browsers (James M Snell) [#6169](https://github.com/nodejs/node/pull/6169) +* [[`3f73502662`](https://github.com/nodejs/node/commit/3f73502662)] - **doc**: native module reloading is not supported (Bryan English) [#6168](https://github.com/nodejs/node/pull/6168) +* [[`5f9c8297f1`](https://github.com/nodejs/node/commit/5f9c8297f1)] - **doc**: clarify fs.watch() and inodes on linux, os x (Joran Dirk Greef) [#6099](https://github.com/nodejs/node/pull/6099) +* [[`f3c0b78ae4`](https://github.com/nodejs/node/commit/f3c0b78ae4)] - **doc**: add domain postmortem (Trevor Norris) [#6159](https://github.com/nodejs/node/pull/6159) +* [[`a91834e743`](https://github.com/nodejs/node/commit/a91834e743)] - **doc**: add stefanmb to collaborators (Stefan Budeanu) [#6227](https://github.com/nodejs/node/pull/6227) +* [[`117348d082`](https://github.com/nodejs/node/commit/117348d082)] - **doc**: add iWuzHere to collaborators (Imran Iqbal) [#6226](https://github.com/nodejs/node/pull/6226) +* [[`a1c46b63e8`](https://github.com/nodejs/node/commit/a1c46b63e8)] - **doc**: add santigimeno to collaborators (Santiago Gimeno) [#6225](https://github.com/nodejs/node/pull/6225) +* [[`976e4bb3da`](https://github.com/nodejs/node/commit/976e4bb3da)] - **doc**: add addaleax to collaborators (Anna Henningsen) [#6224](https://github.com/nodejs/node/pull/6224) +* [[`4fa949ef75`](https://github.com/nodejs/node/commit/4fa949ef75)] - **doc**: fix incorrect references in buffer docs (Amery) [#6194](https://github.com/nodejs/node/pull/6194) +* [[`b26fea1595`](https://github.com/nodejs/node/commit/b26fea1595)] - **doc**: add copy about how to curl SHA256.txt (Myles Borins) [#6120](https://github.com/nodejs/node/pull/6120) +* [[`daaad47099`](https://github.com/nodejs/node/commit/daaad47099)] - **doc**: clarification for maxBuffer and Unicode output (James M Snell) [#6030](https://github.com/nodejs/node/pull/6030) +* [[`5e6915f374`](https://github.com/nodejs/node/commit/5e6915f374)] - **doc**: describe child.kill() pitfalls on linux (Robert Jefe Lindstaedt) [#2098](https://github.com/nodejs/node/issues/2098) +* [[`a40d0e8f9d`](https://github.com/nodejs/node/commit/a40d0e8f9d)] - **doc**: fix scrolling on iOS devices (Luigi Pinca) [#5878](https://github.com/nodejs/node/pull/5878) +* [[`a81fca4f99`](https://github.com/nodejs/node/commit/a81fca4f99)] - **doc**: add topic - event loop, timers, `nextTick()` (Jeff Harris) [#4936](https://github.com/nodejs/node/pull/4936) +* [[`440d1172fd`](https://github.com/nodejs/node/commit/440d1172fd)] - **doc**: add example using algorithms not directly exposed (Brad Hill) [#6108](https://github.com/nodejs/node/pull/6108) +* [[`96ad5c5303`](https://github.com/nodejs/node/commit/96ad5c5303)] - **doc**: update openssl LICENSE using license-builder.sh (Steven R. Loomis) [#6065](https://github.com/nodejs/node/pull/6065) +* [[`07829b0bc9`](https://github.com/nodejs/node/commit/07829b0bc9)] - **doc**: simple doc typo fix (Brendon Pierson) [#6041](https://github.com/nodejs/node/pull/6041) +* [[`bc0ee06226`](https://github.com/nodejs/node/commit/bc0ee06226)] - **doc**: note about Android support (Rich Trott) [#6040](https://github.com/nodejs/node/pull/6040) +* [[`60a73a2ed2`](https://github.com/nodejs/node/commit/60a73a2ed2)] - **doc**: fix a typo in 5.10.1's changelog (Vladimir Varankin) [#6076](https://github.com/nodejs/node/pull/6076) +* [[`b57be92c1b`](https://github.com/nodejs/node/commit/b57be92c1b)] - **gitignore**: adding .vs/ directory to .gitignore (Mike Kaufman) [#6070](https://github.com/nodejs/node/pull/6070) +* [[`6e891c7ad4`](https://github.com/nodejs/node/commit/6e891c7ad4)] - **gitignore**: ignore VS 2015 *.VC.opendb files (Mike Kaufman) [#6070](https://github.com/nodejs/node/pull/6070) +* [[`abd101be1a`](https://github.com/nodejs/node/commit/abd101be1a)] - **http**: disallow sending obviously invalid status codes (Brian White) [#6291](https://github.com/nodejs/node/pull/6291) +* [[`16b23b2c28`](https://github.com/nodejs/node/commit/16b23b2c28)] - **http**: skip body and next message of CONNECT res (Fedor Indutny) [#6279](https://github.com/nodejs/node/pull/6279) +* [[`a259ee4018`](https://github.com/nodejs/node/commit/a259ee4018)] - **http**: unref socket timer on parser execute (Fedor Indutny) [#6286](https://github.com/nodejs/node/pull/6286) +* [[`d4abca5b27`](https://github.com/nodejs/node/commit/d4abca5b27)] - **lib**: remove bootstrap global context indirection (Jeremiah Senkpiel) [#5881](https://github.com/nodejs/node/pull/5881) +* [[`c8783aff21`](https://github.com/nodejs/node/commit/c8783aff21)] - **lib,test,tools**: alignment on variable assignments (Rich Trott) [#6242](https://github.com/nodejs/node/pull/6242) +* [[`d5d4f194f1`](https://github.com/nodejs/node/commit/d5d4f194f1)] - **net**: replace __defineGetter__ with defineProperty (Fedor Indutny) [#6284](https://github.com/nodejs/node/pull/6284) +* [[`6d9c0c9aa7`](https://github.com/nodejs/node/commit/6d9c0c9aa7)] - **(SEMVER-MINOR)** **net**: support DNS hints in createConnection() (Colin Ihrig) [#6000](https://github.com/nodejs/node/pull/6000) +* [[`457f24f19c`](https://github.com/nodejs/node/commit/457f24f19c)] - **(SEMVER-MINOR)** **node**: make builtin libs available for `--eval` (Anna Henningsen) [#6207](https://github.com/nodejs/node/pull/6207) +* [[`fc89d17656`](https://github.com/nodejs/node/commit/fc89d17656)] - **path**: fixing a test that breaks on some machines. (Mike Kaufman) [#6067](https://github.com/nodejs/node/pull/6067) +* [[`1d408099b7`](https://github.com/nodejs/node/commit/1d408099b7)] - **process**: fix incorrect usage of assert.fail() (Rich Trott) [#6211](https://github.com/nodejs/node/pull/6211) +* [[`07c9f981d6`](https://github.com/nodejs/node/commit/07c9f981d6)] - **(SEMVER-MINOR)** **repl**: keep the built-in modules non-enumerable (Anna Henningsen) [#6207](https://github.com/nodejs/node/pull/6207) +* [[`5382deaa18`](https://github.com/nodejs/node/commit/5382deaa18)] - **repl**: don’t complete non-simple expressions (Anna Henningsen) [#6192](https://github.com/nodejs/node/pull/6192) +* [[`2254f1a175`](https://github.com/nodejs/node/commit/2254f1a175)] - **repl**: refactor repl.js (Rich Trott) [#6071](https://github.com/nodejs/node/pull/6071) +* [[`7d54d85269`](https://github.com/nodejs/node/commit/7d54d85269)] - **(SEMVER-MINOR)** **src**: add SIGINFO to supported signals (James Reggio) [#6093](https://github.com/nodejs/node/pull/6093) +* [[`fbc99ba4f1`](https://github.com/nodejs/node/commit/fbc99ba4f1)] - **src**: add missing 'inline' keywords (Ben Noordhuis) [#6056](https://github.com/nodejs/node/pull/6056) +* [[`20bb92f5c8`](https://github.com/nodejs/node/commit/20bb92f5c8)] - **src**: use size_t for http parser array size fields (Ben Noordhuis) [#5969](https://github.com/nodejs/node/pull/5969) +* [[`2fd8be2dbe`](https://github.com/nodejs/node/commit/2fd8be2dbe)] - **src**: replace ARRAY_SIZE with typesafe arraysize (Ben Noordhuis) [#5969](https://github.com/nodejs/node/pull/5969) +* [[`4392b4aee0`](https://github.com/nodejs/node/commit/4392b4aee0)] - **stream**: Fix readableState.awaitDrain mechanism (Anna Henningsen) [#6023](https://github.com/nodejs/node/pull/6023) +* [[`20dcdd365b`](https://github.com/nodejs/node/commit/20dcdd365b)] - **stream_base**: expose `bytesRead` getter (Fedor Indutny) [#6284](https://github.com/nodejs/node/pull/6284) +* [[`f69416c06e`](https://github.com/nodejs/node/commit/f69416c06e)] - **streams**: support unlimited synchronous cork/uncork cycles (Matteo Collina) [#6164](https://github.com/nodejs/node/pull/6164) +* [[`4bfed26d1a`](https://github.com/nodejs/node/commit/4bfed26d1a)] - **test**: add zlib close-after-error regression test (Anna Henningsen) [#6270](https://github.com/nodejs/node/pull/6270) +* [[`99d0a61441`](https://github.com/nodejs/node/commit/99d0a61441)] - **test**: move more tests from sequential to parallel (Santiago Gimeno) [#6187](https://github.com/nodejs/node/pull/6187) +* [[`96be986a77`](https://github.com/nodejs/node/commit/96be986a77)] - **test**: assert - fixed error messages to match the tests (surya panikkal) [#6241](https://github.com/nodejs/node/pull/6241) +* [[`4e4efb756e`](https://github.com/nodejs/node/commit/4e4efb756e)] - **test**: add test for responses to HTTP CONNECT req (Josh Leder) [#6279](https://github.com/nodejs/node/pull/6279) +* [[`5b42ef5dfe`](https://github.com/nodejs/node/commit/5b42ef5dfe)] - **test**: move debugger tests to sequential (Rich Trott) [#6205](https://github.com/nodejs/node/pull/6205) +* [[`9856b804e9`](https://github.com/nodejs/node/commit/9856b804e9)] - **test**: move some test from sequential to parallel (Santiago Gimeno) [#6087](https://github.com/nodejs/node/pull/6087) +* [[`1d130d0203`](https://github.com/nodejs/node/commit/1d130d0203)] - **test**: move the debugger tests back to parallel (Santiago Gimeno) [#6246](https://github.com/nodejs/node/pull/6246) +* [[`c0e9c94868`](https://github.com/nodejs/node/commit/c0e9c94868)] - **test**: fix issues for ESLint 2.7.0 (silverwind) [#6132](https://github.com/nodejs/node/pull/6132) +* [[`056a258173`](https://github.com/nodejs/node/commit/056a258173)] - **test**: fix flaky test-http-set-timeout-server (Santiago Gimeno) [#6248](https://github.com/nodejs/node/pull/6248) +* [[`be993fcf6c`](https://github.com/nodejs/node/commit/be993fcf6c)] - **test**: fix test-net-settimeout flakiness (Santiago Gimeno) [#6166](https://github.com/nodejs/node/pull/6166) +* [[`a38b614ae9`](https://github.com/nodejs/node/commit/a38b614ae9)] - **test**: fix flaky test-child-process-fork-net (Rich Trott) [#6138](https://github.com/nodejs/node/pull/6138) +* [[`476535cc0e`](https://github.com/nodejs/node/commit/476535cc0e)] - **test**: fix flaky test-http-client-abort (Rich Trott) [#6124](https://github.com/nodejs/node/pull/6124) +* [[`6bb7999bd6`](https://github.com/nodejs/node/commit/6bb7999bd6)] - **test**: refactor test-file-write-stream3 (Rich Trott) [#6050](https://github.com/nodejs/node/pull/6050) +* [[`a27e95231e`](https://github.com/nodejs/node/commit/a27e95231e)] - **test**: enforce strict mode for test-domain-crypto (Rich Trott) [#6047](https://github.com/nodejs/node/pull/6047) +* [[`8da4bad1c9`](https://github.com/nodejs/node/commit/8da4bad1c9)] - **test**: fix pummel test failures (Rich Trott) [#6012](https://github.com/nodejs/node/pull/6012) +* [[`edd8a15508`](https://github.com/nodejs/node/commit/edd8a15508)] - **test,repl**: use deepStrictEqual for false-y values (Jeremiah Senkpiel) [#6196](https://github.com/nodejs/node/pull/6196) +* [[`48ecc0b6b5`](https://github.com/nodejs/node/commit/48ecc0b6b5)] - **test,tools**: enable linting for undefined vars (Rich Trott) [#6255](https://github.com/nodejs/node/pull/6255) +* [[`d809c84bf8`](https://github.com/nodejs/node/commit/d809c84bf8)] - **test,vm**: enable strict mode for vm tests (Rich Trott) [#6209](https://github.com/nodejs/node/pull/6209) +* [[`4a1dfdcc0f`](https://github.com/nodejs/node/commit/4a1dfdcc0f)] - **tools**: lint rule for assert.fail() (Rich Trott) [#6261](https://github.com/nodejs/node/pull/6261) +* [[`fff6a84da5`](https://github.com/nodejs/node/commit/fff6a84da5)] - **tools**: enable linting for v8_prof_processor.js (Rich Trott) [#6262](https://github.com/nodejs/node/pull/6262) +* [[`a2ca347803`](https://github.com/nodejs/node/commit/a2ca347803)] - **tools**: move message listener to worker objects (Brian White) [#6212](https://github.com/nodejs/node/pull/6212) +* [[`f201b01bf7`](https://github.com/nodejs/node/commit/f201b01bf7)] - **tools**: improve js linter (Brian White) [#5638](https://github.com/nodejs/node/pull/5638) +* [[`be070d775f`](https://github.com/nodejs/node/commit/be070d775f)] - **tools**: lint for alignment of variable assignments (Rich Trott) [#6242](https://github.com/nodejs/node/pull/6242) +* [[`d9b8758f47`](https://github.com/nodejs/node/commit/d9b8758f47)] - **tools**: update ESLint to 2.7.0 (silverwind) [#6132](https://github.com/nodejs/node/pull/6132) +* [[`a6056c453e`](https://github.com/nodejs/node/commit/a6056c453e)] - **tools**: fix license-builder.sh again for ICU (Steven R. Loomis) [#6068](https://github.com/nodejs/node/pull/6068) +* [[`fabc33a075`](https://github.com/nodejs/node/commit/fabc33a075)] - **tools**: remove simplejson dependency (Sakthipriyan Vairamani) [#6101](https://github.com/nodejs/node/pull/6101) +* [[`d516412cd5`](https://github.com/nodejs/node/commit/d516412cd5)] - **tools,doc**: parse types in braces everywhere (Alexander Makarenko) [#5329](https://github.com/nodejs/node/pull/5329) +* [[`69eb4a6834`](https://github.com/nodejs/node/commit/69eb4a6834)] - **tools,doc**: fix json for grouped optional params (firedfox) [#5977](https://github.com/nodejs/node/pull/5977) +* [[`a2dd848764`](https://github.com/nodejs/node/commit/a2dd848764)] - **tools,doc**: fix incomplete json produced by doctool (firedfox) [#5966](https://github.com/nodejs/node/pull/5966) +* [[`bad006f2e1`](https://github.com/nodejs/node/commit/bad006f2e1)] - **zlib**: fix use after null when calling .close (James Lal) [#5982](https://github.com/nodejs/node/pull/5982) +* [[`83bc0a2ac9`](https://github.com/nodejs/node/commit/83bc0a2ac9)] - **(SEMVER-MINOR)** **zlib**: Make the finish flush flag configurable (Anna Henningsen) [#6069](https://github.com/nodejs/node/pull/6069) +* [[`2c23e14d5d`](https://github.com/nodejs/node/commit/2c23e14d5d)] - **(SEMVER-MINOR)** **zlib**: detect gzip files when using unzip* (Anna Henningsen) [#5884](https://github.com/nodejs/node/pull/5884) +* [[`61167c3e23`](https://github.com/nodejs/node/commit/61167c3e23)] - **zlib**: fix gzip member head/buffer boundary issue (Anna Henningsen) [#5973](https://github.com/nodejs/node/pull/5973) + +## 2016-04-05, Version 5.10.1 (Stable), @thealphanerd + +### Notable changes + +**http**: + * Enclose IPv6 Host header in square brackets. This will enable proper separation of the host adress from any port reference (Mihai Potra) [#5314](https://github.com/nodejs/node/pull/5314) + +**path**: + * Make win32.isAbsolute more consistent (Brian White) [#6028](https://github.com/nodejs/node/pull/6028) + +### Commits + +* [[`0f5a51ae4b`](https://github.com/nodejs/node/commit/0f5a51ae4b)] - **assert**: Check typed array view type in deepEqual (Anna Henningsen) [#5910](https://github.com/nodejs/node/pull/5910) +* [[`e966d1f5db`](https://github.com/nodejs/node/commit/e966d1f5db)] - **buffer**: don't set `kNoZeroFill` flag in allocUnsafe (Vladimir Kurchatkin) [#6007](https://github.com/nodejs/node/pull/6007) +* [[`3f75751c2e`](https://github.com/nodejs/node/commit/3f75751c2e)] - **build**: introduce ci targets for lint/benchmark (Johan Bergström) [#5921](https://github.com/nodejs/node/pull/5921) +* [[`781290b61d`](https://github.com/nodejs/node/commit/781290b61d)] - **doc**: refine child_process detach behaviour (Robert Jefe Lindstaedt) [#5330](https://github.com/nodejs/node/pull/5330) +* [[`aa9fb03202`](https://github.com/nodejs/node/commit/aa9fb03202)] - **doc**: use HTTPS for links where possible (Rich Trott) [#6019](https://github.com/nodejs/node/pull/6019) +* [[`dd25984838`](https://github.com/nodejs/node/commit/dd25984838)] - **doc**: note assert.throws() pitfall (Rich Trott) [#6029](https://github.com/nodejs/node/pull/6029) +* [[`f879f5e68a`](https://github.com/nodejs/node/commit/f879f5e68a)] - **doc**: document unspecified behavior for buf.write* methods (James M Snell) [#5925](https://github.com/nodejs/node/pull/5925) +* [[`f12c3861e0`](https://github.com/nodejs/node/commit/f12c3861e0)] - **doc**: clarify stdout/stderr arguments to callback (James M Snell) [#6015](https://github.com/nodejs/node/pull/6015) +* [[`ce173716be`](https://github.com/nodejs/node/commit/ce173716be)] - **doc**: add 'Command Line Options' to 'View on single page' (firedfox) [#6011](https://github.com/nodejs/node/pull/6011) +* [[`7337ef6422`](https://github.com/nodejs/node/commit/7337ef6422)] - **doc**: minor argument formatting in stream.markdown (James M Snell) [#6016](https://github.com/nodejs/node/pull/6016) +* [[`0ae5d027c6`](https://github.com/nodejs/node/commit/0ae5d027c6)] - **doc**: clarify that __dirname is module local (James M Snell) [#6018](https://github.com/nodejs/node/pull/6018) +* [[`8bec8aa41f`](https://github.com/nodejs/node/commit/8bec8aa41f)] - **doc**: consolidate timers docs in timers.markdown (Bryan English) [#5837](https://github.com/nodejs/node/pull/5837) +* [[`0a13099c42`](https://github.com/nodejs/node/commit/0a13099c42)] - **etw**: add event messages (João Reis) [#5936](https://github.com/nodejs/node/pull/5936) +* [[`c6ac6f2ea1`](https://github.com/nodejs/node/commit/c6ac6f2ea1)] - **http**: Corrects IPv6 address in Host header (Mihai Potra) [#5314](https://github.com/nodejs/node/pull/5314) +* [[`8317778925`](https://github.com/nodejs/node/commit/8317778925)] - **meta**: add "joining a wg" section to WORKING_GROUPS.md (Matteo Collina) [#5488](https://github.com/nodejs/node/pull/5488) +* [[`f3f19ee5e2`](https://github.com/nodejs/node/commit/f3f19ee5e2)] - **net**: refactor self=this to arrow functions (Benjamin Gruenbaum) [#5857](https://github.com/nodejs/node/pull/5857) +* [[`1c4007927d`](https://github.com/nodejs/node/commit/1c4007927d)] - **path**: fix win32.isAbsolute() inconsistency (Brian White) [#6028](https://github.com/nodejs/node/pull/6028) +* [[`059b607a4f`](https://github.com/nodejs/node/commit/059b607a4f)] - **test**: make use of globals explicit (Rich Trott) [#6014](https://github.com/nodejs/node/pull/6014) +* [[`cc8fcc5a07`](https://github.com/nodejs/node/commit/cc8fcc5a07)] - **test**: be explicit about polluting of `global` (Rich Trott) [#6017](https://github.com/nodejs/node/pull/6017) +* [[`7db7a820b9`](https://github.com/nodejs/node/commit/7db7a820b9)] - **test**: make arch available in status files (Santiago Gimeno) [#5997](https://github.com/nodejs/node/pull/5997) +* [[`02f2ebd9b4`](https://github.com/nodejs/node/commit/02f2ebd9b4)] - **test**: explicitly set global in test-repl (Rich Trott) [#6026](https://github.com/nodejs/node/pull/6026) +* [[`2ab1237137`](https://github.com/nodejs/node/commit/2ab1237137)] - **test**: fix flaky test-net-socket-timeout-unref (Rich Trott) [#6003](https://github.com/nodejs/node/pull/6003) +* [[`0127c2bd39`](https://github.com/nodejs/node/commit/0127c2bd39)] - **test**: fix test-dns.js flakiness (Rich Trott) [#5996](https://github.com/nodejs/node/pull/5996) +* [[`6052ced37f`](https://github.com/nodejs/node/commit/6052ced37f)] - **test**: fix error message checks in test-module-loading (James M Snell) [#5986](https://github.com/nodejs/node/pull/5986) +* [[`a40b0cb673`](https://github.com/nodejs/node/commit/a40b0cb673)] - **test**: refactor http-end-throw-socket-handling (Santiago Gimeno) [#5676](https://github.com/nodejs/node/pull/5676) +* [[`96bb315262`](https://github.com/nodejs/node/commit/96bb315262)] - **test**: ensure _handle property existence (Rich Trott) [#5916](https://github.com/nodejs/node/pull/5916) +* [[`4f1fa2adeb`](https://github.com/nodejs/node/commit/4f1fa2adeb)] - **test**: fix offending max-len linter error (Sakthipriyan Vairamani) [#5980](https://github.com/nodejs/node/pull/5980) +* [[`f14d71ccea`](https://github.com/nodejs/node/commit/f14d71ccea)] - **test**: stdin is not always a net.Socket (Jeremiah Senkpiel) [#5935](https://github.com/nodejs/node/pull/5935) +* [[`50a062e691`](https://github.com/nodejs/node/commit/50a062e691)] - **tools**: remove obsolete lint config file (Rich Trott) [#5959](https://github.com/nodejs/node/pull/5959) +* [[`7491fdcfe9`](https://github.com/nodejs/node/commit/7491fdcfe9)] - **tools**: remove disabling of already-disabled rule (Rich Trott) [#6013](https://github.com/nodejs/node/pull/6013) + +## 2016-03-31, Version 5.10.0 (Stable), @evanlucas + +### Notable changes + +* **buffer**: + * make byteLength work with ArrayBuffer & DataView (Jackson Tian) [#5255](https://github.com/nodejs/node/pull/5255) + * backport --zero-fill-buffers command line option (James M Snell) [#5744](https://github.com/nodejs/node/pull/5744) + * backport new buffer constructor APIs (James M Snell) [#5763](https://github.com/nodejs/node/pull/5763) + * add swap16() and swap32() methods (James M Snell) [#5724](https://github.com/nodejs/node/pull/5724) +* **fs**: add the fs.mkdtemp() function. (Florian MARGAINE) [#5333](https://github.com/nodejs/node/pull/5333) +* **net**: emit host in lookup event (HUANG Wei) [#5598](https://github.com/nodejs/node/pull/5598) +* **node**: --no-browser-globals configure flag (Fedor Indutny) [#5853](https://github.com/nodejs/node/pull/5853) +* **npm**: Upgrade to v3.8.3. Fixes a security flaw in the use of authentication tokens in HTTP requests that + would allow an attacker to set up a server that could collect tokens from users of the command-line interface. + Authentication tokens have previously been sent with every request made by the CLI for logged-in users, + regardless of the destination of the request. This update fixes this by only including those tokens for requests + made against the registry or registries used for the current install. (Forrest L Norvell) [npm/node#6](https://github.com/npm/node/pull/6) +* **repl**: support standalone blocks (Prince J Wesley) [#5581](https://github.com/nodejs/node/pull/5581) +* **src**: override v8 thread defaults using cli options (Tom Gallacher) [#4344](https://github.com/nodejs/node/pull/4344) + +### Commits + +* [[`2cbbaafca9`](https://github.com/nodejs/node/commit/2cbbaafca9)] - **async_wrap**: don't abort on callback exception (Trevor Norris) [#5756](https://github.com/nodejs/node/pull/5756) +* [[`6f16882733`](https://github.com/nodejs/node/commit/6f16882733)] - **async_wrap**: notify post if intercepted exception (Trevor Norris) [#5756](https://github.com/nodejs/node/pull/5756) +* [[`a4856122d3`](https://github.com/nodejs/node/commit/a4856122d3)] - **async_wrap**: setupHooks now accepts object (Trevor Norris) [#5756](https://github.com/nodejs/node/pull/5756) +* [[`ee83c956c5`](https://github.com/nodejs/node/commit/ee83c956c5)] - **(SEMVER-MINOR)** **buffer**: make byteLength work with ArrayBuffer & DataView (Jackson Tian) [#5255](https://github.com/nodejs/node/pull/5255) +* [[`1f8e4b54ce`](https://github.com/nodejs/node/commit/1f8e4b54ce)] - **(SEMVER-MINOR)** **buffer**: add swap16() and swap32() methods (James M Snell) [#5724](https://github.com/nodejs/node/pull/5724) +* [[`bdf933bece`](https://github.com/nodejs/node/commit/bdf933bece)] - **buffer**: changing let in for loops back to var (Gareth Ellis) [#5819](https://github.com/nodejs/node/pull/5819) +* [[`c1534e7eaf`](https://github.com/nodejs/node/commit/c1534e7eaf)] - **(SEMVER-MINOR)** **buffer**: backport new buffer constructor APIs (James M Snell) [#5763](https://github.com/nodejs/node/pull/5763) +* [[`3c02727055`](https://github.com/nodejs/node/commit/3c02727055)] - **(SEMVER-MINOR)** **buffer**: backport --zero-fill-buffers command line option (James M Snell) [#5744](https://github.com/nodejs/node/pull/5744) +* [[`58b5c1e19f`](https://github.com/nodejs/node/commit/58b5c1e19f)] - **build**: add suport for x86 architecture (Robert Chiras) [#5544](https://github.com/nodejs/node/pull/5544) +* [[`389f5a85e6`](https://github.com/nodejs/node/commit/389f5a85e6)] - **build**: add script to create Android .mk files (Robert Chiras) [#5544](https://github.com/nodejs/node/pull/5544) +* [[`5ee5fa292f`](https://github.com/nodejs/node/commit/5ee5fa292f)] - **build**: add missing `openssl_fips%` to common.gypi (Fedor Indutny) [#5919](https://github.com/nodejs/node/pull/5919) +* [[`5681ffecf7`](https://github.com/nodejs/node/commit/5681ffecf7)] - **build**: enable compilation for linuxOne (Michael Dawson) [#5941](https://github.com/nodejs/node/pull/5941) +* [[`660ec9f889`](https://github.com/nodejs/node/commit/660ec9f889)] - **child_process**: refactor self=this in socket_list (Benjamin Gruenbaum) [#5860](https://github.com/nodejs/node/pull/5860) +* [[`e1a012f277`](https://github.com/nodejs/node/commit/e1a012f277)] - **deps**: upgrade npm to 3.8.3 (Forrest L Norvell) +* [[`ec1813199d`](https://github.com/nodejs/node/commit/ec1813199d)] - **deps**: backport 8d00c2c from v8 upstream (Ben Noordhuis) [#5577](https://github.com/nodejs/node/pull/5577) +* [[`2a5c6d7006`](https://github.com/nodejs/node/commit/2a5c6d7006)] - **dns**: Refactor forEach to map (Benjamin Gruenbaum) [#5803](https://github.com/nodejs/node/pull/5803) +* [[`6a6112a2f3`](https://github.com/nodejs/node/commit/6a6112a2f3)] - **dns**: Use object without protoype for map (Benjamin Gruenbaum) [#5843](https://github.com/nodejs/node/pull/5843) +* [[`8fa0b5c1da`](https://github.com/nodejs/node/commit/8fa0b5c1da)] - **doc**: Add @mhdawson back to the CTC (James M Snell) [#5633](https://github.com/nodejs/node/pull/5633) +* [[`858a524325`](https://github.com/nodejs/node/commit/858a524325)] - **doc**: typo: interal->internal. (Corey Kosak) [#5849](https://github.com/nodejs/node/pull/5849) +* [[`5676a35bd9`](https://github.com/nodejs/node/commit/5676a35bd9)] - **doc**: explain path.format expected properties (John Eversole) [#5801](https://github.com/nodejs/node/pull/5801) +* [[`29778393a0`](https://github.com/nodejs/node/commit/29778393a0)] - **doc**: use consistent event name parameter (Benjamin Gruenbaum) [#5850](https://github.com/nodejs/node/pull/5850) +* [[`949b17ff6d`](https://github.com/nodejs/node/commit/949b17ff6d)] - **doc**: fix order of end tags of list after heading (firedfox) [#5874](https://github.com/nodejs/node/pull/5874) +* [[`8e790b7a0c`](https://github.com/nodejs/node/commit/8e790b7a0c)] - **doc**: add instructions to only sign a release (Jeremiah Senkpiel) [#5876](https://github.com/nodejs/node/pull/5876) +* [[`f1f9aff855`](https://github.com/nodejs/node/commit/f1f9aff855)] - **doc**: fix doc for Buffer.readInt32LE() (ghaiklor) [#5890](https://github.com/nodejs/node/pull/5890) +* [[`731f7b8055`](https://github.com/nodejs/node/commit/731f7b8055)] - **etw**: fix descriptors of events 9 and 23 (João Reis) [#5742](https://github.com/nodejs/node/pull/5742) +* [[`aac9ead379`](https://github.com/nodejs/node/commit/aac9ead379)] - **etw,build**: always generate .rc and .h files (João Reis) [#5657](https://github.com/nodejs/node/pull/5657) +* [[`80155d398c`](https://github.com/nodejs/node/commit/80155d398c)] - **(SEMVER-MINOR)** **fs**: add the fs.mkdtemp() function. (Florian MARGAINE) [#5333](https://github.com/nodejs/node/pull/5333) +* [[`ae15d68ad1`](https://github.com/nodejs/node/commit/ae15d68ad1)] - **governance**: remove target size for CTC (Rich Trott) [#5879](https://github.com/nodejs/node/pull/5879) +* [[`63c601bc15`](https://github.com/nodejs/node/commit/63c601bc15)] - **http**: speed up checkIsHttpToken (Jackson Tian) [#4790](https://github.com/nodejs/node/pull/4790) +* [[`40847b0b8b`](https://github.com/nodejs/node/commit/40847b0b8b)] - **lib**: rename /node.js to /bootstrap_node.js (Jeremiah Senkpiel) [#5103](https://github.com/nodejs/node/pull/5103) +* [[`e644eb3d69`](https://github.com/nodejs/node/commit/e644eb3d69)] - **lib**: refactor code with startsWith/endsWith (Jackson Tian) [#5753](https://github.com/nodejs/node/pull/5753) +* [[`a757e0583c`](https://github.com/nodejs/node/commit/a757e0583c)] - **lib,src**: move src/node.js to lib/internal/node.js (Jeremiah Senkpiel) [#5103](https://github.com/nodejs/node/pull/5103) +* [[`e3c7b46326`](https://github.com/nodejs/node/commit/e3c7b46326)] - **lib,src**: refactor src/node.js into internal files (Jeremiah Senkpiel) [#5103](https://github.com/nodejs/node/pull/5103) +* [[`b07bc5d996`](https://github.com/nodejs/node/commit/b07bc5d996)] - **(SEMVER-MINOR)** **net**: emit host in lookup event (HUANG Wei) [#5598](https://github.com/nodejs/node/pull/5598) +* [[`2fa959be15`](https://github.com/nodejs/node/commit/2fa959be15)] - **(SEMVER-MINOR)** **node**: --no-browser-globals configure flag (Fedor Indutny) [#5853](https://github.com/nodejs/node/pull/5853) +* [[`a2ad21645f`](https://github.com/nodejs/node/commit/a2ad21645f)] - **querystring**: don't stringify bad surrogate pair (Brian White) [#5858](https://github.com/nodejs/node/pull/5858) +* [[`427173204e`](https://github.com/nodejs/node/commit/427173204e)] - **(SEMVER-MINOR)** **repl**: support standalone blocks (Prince J Wesley) [#5581](https://github.com/nodejs/node/pull/5581) +* [[`d044898495`](https://github.com/nodejs/node/commit/d044898495)] - **src**: Add missing `using v8::MaybeLocal` (Anna Henningsen) [#5974](https://github.com/nodejs/node/pull/5974) +* [[`0d0c57ff5e`](https://github.com/nodejs/node/commit/0d0c57ff5e)] - **(SEMVER-MINOR)** **src**: override v8 thread defaults using cli options (Tom Gallacher) [#4344](https://github.com/nodejs/node/pull/4344) +* [[`f9d0166291`](https://github.com/nodejs/node/commit/f9d0166291)] - **src**: reword command and add ternary (Trevor Norris) [#5756](https://github.com/nodejs/node/pull/5756) +* [[`f1488bb24c`](https://github.com/nodejs/node/commit/f1488bb24c)] - **src,http_parser**: remove KickNextTick call (Trevor Norris) [#5756](https://github.com/nodejs/node/pull/5756) +* [[`8e8768ecbb`](https://github.com/nodejs/node/commit/8e8768ecbb)] - **test**: add known_issues test for GH-2148 (Rich Trott) [#5920](https://github.com/nodejs/node/pull/5920) +* [[`bf94b5a1b9`](https://github.com/nodejs/node/commit/bf94b5a1b9)] - **test**: mitigate flaky test-https-agent (Rich Trott) [#5939](https://github.com/nodejs/node/pull/5939) +* [[`2192528326`](https://github.com/nodejs/node/commit/2192528326)] - **test**: fix flaky test-repl (Brian White) [#5914](https://github.com/nodejs/node/pull/5914) +* [[`aebe6245b7`](https://github.com/nodejs/node/commit/aebe6245b7)] - **test**: add test for piping large input from stdin (Anna Henningsen) [#5949](https://github.com/nodejs/node/pull/5949) +* [[`a19de97d2f`](https://github.com/nodejs/node/commit/a19de97d2f)] - **test**: remove the use of curl in the test suite (Santiago Gimeno) [#5750](https://github.com/nodejs/node/pull/5750) +* [[`6928a17aa3`](https://github.com/nodejs/node/commit/6928a17aa3)] - **test**: exclude new fs watch test for AIX (Michael Dawson) [#5937](https://github.com/nodejs/node/pull/5937) +* [[`3238bff3b3`](https://github.com/nodejs/node/commit/3238bff3b3)] - **test**: confirm globals not used internally (Rich Trott) [#5882](https://github.com/nodejs/node/pull/5882) +* [[`a41fd93f68`](https://github.com/nodejs/node/commit/a41fd93f68)] - **test**: fix flaky test-net-socket-timeout (Brian White) [#5902](https://github.com/nodejs/node/pull/5902) +* [[`82a50d3def`](https://github.com/nodejs/node/commit/82a50d3def)] - **test**: move dns test to test/internet (Ben Noordhuis) [#5905](https://github.com/nodejs/node/pull/5905) +* [[`fb0c5bcac2`](https://github.com/nodejs/node/commit/fb0c5bcac2)] - **test**: fix flaky test-http-set-timeout (Rich Trott) [#5856](https://github.com/nodejs/node/pull/5856) +* [[`8344a522a8`](https://github.com/nodejs/node/commit/8344a522a8)] - **test**: fix test-debugger-client.js (Rich Trott) [#5851](https://github.com/nodejs/node/pull/5851) +* [[`7ec5397954`](https://github.com/nodejs/node/commit/7ec5397954)] - **timers**: fixing API refs to use safe internal refs (Kyle Simpson) [#5882](https://github.com/nodejs/node/pull/5882) +* [[`cb676cf3e7`](https://github.com/nodejs/node/commit/cb676cf3e7)] - **tools**: fix json doc generation (firedfox) [#5943](https://github.com/nodejs/node/pull/5943) +* [[`77bed269ad`](https://github.com/nodejs/node/commit/77bed269ad)] - **win,build**: build and test add-ons on test-ci (Bogdan Lobor) [#5886](https://github.com/nodejs/node/pull/5886) +* [[`afcd276ecc`](https://github.com/nodejs/node/commit/afcd276ecc)] - **zlib**: Fix handling of gzip magic bytes mid-file (Anna Henningsen) [#5863](https://github.com/nodejs/node/pull/5863) + +## 2016-03-23, Version 5.9.1 (Stable), @Fishrock123 + +### Notable changes + +* **buffer**: Now properly throws `RangeError`s on out-of-bounds writes (Matt Loring) [#5605](https://github.com/nodejs/node/pull/5605). + - This effects `write{Float|Double}` when the `noAssert` option is not used. +* **timers**: + - Returned timeout objects now have a `Timeout` constructor name (Jeremiah Senkpiel) [#5793](https://github.com/nodejs/node/pull/5793). + - Performance of `Immediate` processing is now ~20-40% faster (Brian White) [#4169](https://github.com/nodejs/node/pull/4169). +* **vm**: Fixed a contextify regression introduced in v5.9.0 (Ali Ijaz Sheikh) [#5800](https://github.com/nodejs/node/pull/5800). + +### Commits + +* [[`341b3d01c8`](https://github.com/nodejs/node/commit/341b3d01c8)] - **benchmark**: fix linting errors (Rich Trott) [#5840](https://github.com/nodejs/node/pull/5840) +* [[`72fb796bed`](https://github.com/nodejs/node/commit/72fb796bed)] - **buffer**: throw range error before truncating write (Matt Loring) [#5605](https://github.com/nodejs/node/pull/5605) +* [[`c5d83695e1`](https://github.com/nodejs/node/commit/c5d83695e1)] - **contextify**: tie lifetimes of context & sandbox (Ali Ijaz Sheikh) [#5800](https://github.com/nodejs/node/pull/5800) +* [[`ae24d05451`](https://github.com/nodejs/node/commit/ae24d05451)] - **deps**: remove unused openssl files (Ben Noordhuis) [#5619](https://github.com/nodejs/node/pull/5619) +* [[`54abbe7e6f`](https://github.com/nodejs/node/commit/54abbe7e6f)] - **dns**: use template literals (Benjamin Gruenbaum) [#5809](https://github.com/nodejs/node/pull/5809) +* [[`3fef69bf15`](https://github.com/nodejs/node/commit/3fef69bf15)] - **dns**: use isIp consistently (Benjamin Gruenbaum) [#5804](https://github.com/nodejs/node/pull/5804) +* [[`d2d0fe9d34`](https://github.com/nodejs/node/commit/d2d0fe9d34)] - **doc**: update crypto docs to use good defaults (Bill Automata) [#5505](https://github.com/nodejs/node/pull/5505) +* [[`1631f06477`](https://github.com/nodejs/node/commit/1631f06477)] - **doc**: add CTC meeting minutes 2016-02-10 (Rod Vagg) [#5273](https://github.com/nodejs/node/pull/5273) +* [[`7ab597d646`](https://github.com/nodejs/node/commit/7ab597d646)] - **doc**: add CTC meeting minutes 2016-02-03 (Rod Vagg) [#5272](https://github.com/nodejs/node/pull/5272) +* [[`e20d0b8802`](https://github.com/nodejs/node/commit/e20d0b8802)] - **doc**: explain error message on missing main file (Wolfgang Steiner) [#5812](https://github.com/nodejs/node/pull/5812) +* [[`e99082e32d`](https://github.com/nodejs/node/commit/e99082e32d)] - **doc**: add a cli options doc page (Jeremiah Senkpiel) [#5787](https://github.com/nodejs/node/pull/5787) +* [[`0ffd794b27`](https://github.com/nodejs/node/commit/0ffd794b27)] - **doc**: Add windows example for Path.format (Mithun Patel) [#5700](https://github.com/nodejs/node/pull/5700) +* [[`f53cc37578`](https://github.com/nodejs/node/commit/f53cc37578)] - **doc**: grammar, clarity and links in timers doc (Bryan English) [#5792](https://github.com/nodejs/node/pull/5792) +* [[`3ada8cc09a`](https://github.com/nodejs/node/commit/3ada8cc09a)] - **doc**: align doc/api/tls.markdown with style guide (Stefano Vozza) [#5706](https://github.com/nodejs/node/pull/5706) +* [[`5d28ce3942`](https://github.com/nodejs/node/commit/5d28ce3942)] - **doc**: topic blocking vs non-blocking (Jarrett Widman) [#5326](https://github.com/nodejs/node/pull/5326) +* [[`d9b4e15f75`](https://github.com/nodejs/node/commit/d9b4e15f75)] - **doc**: fix typo in synchronous randomBytes example (Andrea Giammarchi) [#5781](https://github.com/nodejs/node/pull/5781) +* [[`d8318c2226`](https://github.com/nodejs/node/commit/d8318c2226)] - **doc**: fix crypto update() signatures (Brian White) [#5500](https://github.com/nodejs/node/pull/5500) +* [[`15c5662959`](https://github.com/nodejs/node/commit/15c5662959)] - **doc**: fix multiline return comments in querystring (Claudio Rodriguez) [#5705](https://github.com/nodejs/node/pull/5705) +* [[`75f723c0aa`](https://github.com/nodejs/node/commit/75f723c0aa)] - **doc**: fix invalid path doc comments (Rich Trott) [#5670](https://github.com/nodejs/node/pull/5670) +* [[`724b87d75c`](https://github.com/nodejs/node/commit/724b87d75c)] - **doc**: explain path.format() algorithm (Rich Trott) [#5688](https://github.com/nodejs/node/pull/5688) +* [[`89df17ed0b`](https://github.com/nodejs/node/commit/89df17ed0b)] - **doc**: fix return value of write methods (Felix Böhm) [#5736](https://github.com/nodejs/node/pull/5736) +* [[`5ab51ee151`](https://github.com/nodejs/node/commit/5ab51ee151)] - **doc**: reformat & improve node.1 manual page (Jeremiah Senkpiel) [#5497](https://github.com/nodejs/node/pull/5497) +* [[`f34a00cee2`](https://github.com/nodejs/node/commit/f34a00cee2)] - **docs**: fix man pages link if tok type is code (Mithun Patel) [#5721](https://github.com/nodejs/node/pull/5721) +* [[`3bff3111f4`](https://github.com/nodejs/node/commit/3bff3111f4)] - **https**: fix ssl socket leak when keepalive is used (Alexander Penev) [#5713](https://github.com/nodejs/node/pull/5713) +* [[`7b21c09b73`](https://github.com/nodejs/node/commit/7b21c09b73)] - **lib**: simplify code with String.prototype.repeat() (Jackson Tian) [#5359](https://github.com/nodejs/node/pull/5359) +* [[`c75f97f43b`](https://github.com/nodejs/node/commit/c75f97f43b)] - **lib**: reduce usage of `self = this` (Jackson Tian) [#5231](https://github.com/nodejs/node/pull/5231) +* [[`1ccf9b4a56`](https://github.com/nodejs/node/commit/1ccf9b4a56)] - **net**: remove unused `var self = this` from old code (Benjamin Gruenbaum) [#5224](https://github.com/nodejs/node/pull/5224) +* [[`6e5835b8cd`](https://github.com/nodejs/node/commit/6e5835b8cd)] - **path**: refactor path.format() repeated code (Rich Trott) [#5673](https://github.com/nodejs/node/pull/5673) +* [[`15c7b3a127`](https://github.com/nodejs/node/commit/15c7b3a127)] - **src,tools**: use template literals (Rich Trott) [#5778](https://github.com/nodejs/node/pull/5778) +* [[`ca971b0d77`](https://github.com/nodejs/node/commit/ca971b0d77)] - **test**: smaller chunk size for smaller person.jpg (Jérémy Lal) [#5813](https://github.com/nodejs/node/pull/5813) +* [[`f95fc175eb`](https://github.com/nodejs/node/commit/f95fc175eb)] - **test**: strip non-free icc profile from person.jpg (Jérémy Lal) [#5813](https://github.com/nodejs/node/pull/5813) +* [[`7c2c7b0577`](https://github.com/nodejs/node/commit/7c2c7b0577)] - **test**: remove timer from test-http-1.0 (Santiago Gimeno) [#5129](https://github.com/nodejs/node/pull/5129) +* [[`70512e51a4`](https://github.com/nodejs/node/commit/70512e51a4)] - **test**: repl tab completion test (Santiago Gimeno) [#5534](https://github.com/nodejs/node/pull/5534) +* [[`89f091d621`](https://github.com/nodejs/node/commit/89f091d621)] - **test**: make test-net-connect-options-ipv6.js better (Michael Dawson) [#5791](https://github.com/nodejs/node/pull/5791) +* [[`d2fa64490f`](https://github.com/nodejs/node/commit/d2fa64490f)] - **test**: fix `test-cluster-worker-kill` (Santiago Gimeno) [#5814](https://github.com/nodejs/node/pull/5814) +* [[`f0d885a0a9`](https://github.com/nodejs/node/commit/f0d885a0a9)] - **test**: fix flaky test-cluster-shared-leak (Claudio Rodriguez) [#5802](https://github.com/nodejs/node/pull/5802) +* [[`b352cc7db4`](https://github.com/nodejs/node/commit/b352cc7db4)] - **test**: minimize test-http-get-pipeline-problem (Rich Trott) [#5728](https://github.com/nodejs/node/pull/5728) +* [[`21770c3806`](https://github.com/nodejs/node/commit/21770c3806)] - **test**: reduce brittleness of tab complete test (Matt Loring) [#5772](https://github.com/nodejs/node/pull/5772) +* [[`46f0e02620`](https://github.com/nodejs/node/commit/46f0e02620)] - **timers**: fix lint from 4fe02e2 (Jeremiah Senkpiel) [#5825](https://github.com/nodejs/node/pull/5825) +* [[`20a68e9eef`](https://github.com/nodejs/node/commit/20a68e9eef)] - **timers**: give Timeouts a constructor name (Jeremiah Senkpiel) [#5793](https://github.com/nodejs/node/pull/5793) +* [[`d3654d80f3`](https://github.com/nodejs/node/commit/d3654d80f3)] - **timers**: improve setImmediate() performance (Brian White) [#4169](https://github.com/nodejs/node/pull/4169) +* [[`b1a4870200`](https://github.com/nodejs/node/commit/b1a4870200)] - **tools**: remove unused imports (Sakthipriyan Vairamani) [#5765](https://github.com/nodejs/node/pull/5765) + +## 2016-03-16, Version 5.9.0 (Stable), @evanlucas + +### Notable changes + +* **contextify**: Fixed a memory consumption issue related to heavy use of `vm.createContext` and `vm.runInNewContext`. (Ali Ijaz Sheikh) +https://github.com/nodejs/node/pull/5392 +* **governance**: The following members have been added as collaborators: + - Andreas Madsen (@AndreasMadsen) + - Benjamin Gruenbaum (@benjamingr) + - Claudio Rodriguez (@claudiorodriguez) + - Glen Keane (@thekemkid) + - Jeremy Whitlock (@whitlockjc) + - Matt Loring (@matthewloring) + - Phillip Johnsen (@phillipj) +* **lib**: copy arguments object instead of leaking it (Nathan Woltman) +https://github.com/nodejs/node/pull/4361 +* **src**: allow both -i and -e flags to be used at the same time (Rich Trott) +https://github.com/nodejs/node/pull/5655 +* **timers**: Internal Node.js timeouts now use the same logic path as those created with `setTimeout()` (Jeremiah Senkpiel) [#4007](https://github.com/nodejs/node/pull/4007) + * This may cause a slightly different performance profile in some situations. So far, it has shown to be positive in most cases. +* **v8**: backport fb4ccae from v8 upstream (Vladimir Krivosheev) #4231 + - breakout events from v8 to offer better support for external debuggers +* **zlib**: add support for concatenated members (Kári Tristan Helgason) +https://github.com/nodejs/node/pull/5120 + * Previously, if multiple members were in the same archive, only the first would be read. The others are no longer thrown away. + +### Commits + +* [[`03b99bf8b9`](https://github.com/nodejs/node/commit/03b99bf8b9)] - **build**: don't install github templates (Johan Bergström) [#5612](https://github.com/nodejs/node/pull/5612) +* [[`a7819da15a`](https://github.com/nodejs/node/commit/a7819da15a)] - ***Revert*** "**build**: run lint before tests" (Rich Trott) [#5602](https://github.com/nodejs/node/pull/5602) +* [[`5e9cac4333`](https://github.com/nodejs/node/commit/5e9cac4333)] - **console**: check that stderr is writable (Rich Trott) [#5635](https://github.com/nodejs/node/pull/5635) +* [[`0662fcf209`](https://github.com/nodejs/node/commit/0662fcf209)] - **contextify**: cache sandbox and context in locals (Ali Ijaz Sheikh) [#5392](https://github.com/nodejs/node/pull/5392) +* [[`4f2c839d46`](https://github.com/nodejs/node/commit/4f2c839d46)] - **contextify**: replace deprecated SetWeak usage (Ali Ijaz Sheikh) [#5392](https://github.com/nodejs/node/pull/5392) +* [[`bfff07b4dd`](https://github.com/nodejs/node/commit/bfff07b4dd)] - **contextify**: cleanup weak ref for sandbox (Ali Ijaz Sheikh) [#5392](https://github.com/nodejs/node/pull/5392) +* [[`93f60cdc54`](https://github.com/nodejs/node/commit/93f60cdc54)] - **contextify**: cleanup weak ref for global proxy (Ali Ijaz Sheikh) [#5392](https://github.com/nodejs/node/pull/5392) +* [[`b6c355de0d`](https://github.com/nodejs/node/commit/b6c355de0d)] - **(SEMVER-MINOR)** **deps**: backport fb4ccae from v8 upstream (develar) [#4231](https://github.com/nodejs/node/pull/4231) +* [[`29510aa4fd`](https://github.com/nodejs/node/commit/29510aa4fd)] - **deps**: update openssl config (Shigeki Ohtsu) [#5630](https://github.com/nodejs/node/pull/5630) +* [[`532d1bf9ce`](https://github.com/nodejs/node/commit/532d1bf9ce)] - **deps**: sync deps/http_parser with nodejs/http_parser (James M Snell) [#5600](https://github.com/nodejs/node/pull/5600) +* [[`d5d64c327b`](https://github.com/nodejs/node/commit/d5d64c327b)] - **doc**: clarify commit message rules (Wyatt Preul) [#5661](https://github.com/nodejs/node/pull/5661) +* [[`8c4c84fe5b`](https://github.com/nodejs/node/commit/8c4c84fe5b)] - **doc**: add Testing WG (Rich Trott) [#5461](https://github.com/nodejs/node/pull/5461) +* [[`434af03825`](https://github.com/nodejs/node/commit/434af03825)] - **doc**: Add note about use of JSON.stringify() (Mithun Patel) [#5723](https://github.com/nodejs/node/pull/5723) +* [[`62926d85bd`](https://github.com/nodejs/node/commit/62926d85bd)] - **doc**: clarify type of first argument in zlib (Kirill Fomichev) [#5685](https://github.com/nodejs/node/pull/5685) +* [[`eb73574349`](https://github.com/nodejs/node/commit/eb73574349)] - **doc**: clarify when writable.write callback is called (Kevin Locke) [#4810](https://github.com/nodejs/node/pull/4810) +* [[`c579507034`](https://github.com/nodejs/node/commit/c579507034)] - **doc**: fix typo in api/addons (Daijiro Wachi) [#5678](https://github.com/nodejs/node/pull/5678) +* [[`8e45c9d9ea`](https://github.com/nodejs/node/commit/8e45c9d9ea)] - **doc**: fix typo in api/dgram (Daijiro Wachi) [#5678](https://github.com/nodejs/node/pull/5678) +* [[`44a9b100c5`](https://github.com/nodejs/node/commit/44a9b100c5)] - **doc**: fix typo in api/fs (Daijiro Wachi) [#5678](https://github.com/nodejs/node/pull/5678) +* [[`b667573bcb`](https://github.com/nodejs/node/commit/b667573bcb)] - **doc**: update fansworld-claudio username on README (Claudio Rodriguez) [#5680](https://github.com/nodejs/node/pull/5680) +* [[`9794abb5d1`](https://github.com/nodejs/node/commit/9794abb5d1)] - **doc**: add onboarding resources (Jeremiah Senkpiel) [#3726](https://github.com/nodejs/node/pull/3726) +* [[`31e39fbd7a`](https://github.com/nodejs/node/commit/31e39fbd7a)] - **doc**: remove non-standard use of hyphens (Stefano Vozza) +* [[`f3e9daa825`](https://github.com/nodejs/node/commit/f3e9daa825)] - **doc**: add clarification on birthtime in fs stat (Kári Tristan Helgason) [#5479](https://github.com/nodejs/node/pull/5479) +* [[`c379ec6522`](https://github.com/nodejs/node/commit/c379ec6522)] - **doc**: move build instructions to a new document (Johan Bergström) [#5634](https://github.com/nodejs/node/pull/5634) +* [[`2a442b3dfc`](https://github.com/nodejs/node/commit/2a442b3dfc)] - **doc**: update removeListener behaviour (Vaibhav) [#5201](https://github.com/nodejs/node/pull/5201) +* [[`f6ee0996e0`](https://github.com/nodejs/node/commit/f6ee0996e0)] - **doc**: fix typo in child_process docs (Benjamin Gruenbaum) [#5681](https://github.com/nodejs/node/pull/5681) +* [[`dd12661173`](https://github.com/nodejs/node/commit/dd12661173)] - **doc**: include typo in 'unhandledRejection' example (Robert C Jensen) [#5654](https://github.com/nodejs/node/pull/5654) +* [[`f7aecd6e94`](https://github.com/nodejs/node/commit/f7aecd6e94)] - **doc**: add thekemkid to collaborators (Glen Keane) [#5667](https://github.com/nodejs/node/pull/5667) +* [[`b81711acfb`](https://github.com/nodejs/node/commit/b81711acfb)] - **doc**: add phillipj to collaborators (Phillip Johnsen) [#5663](https://github.com/nodejs/node/pull/5663) +* [[`a33f2486f0`](https://github.com/nodejs/node/commit/a33f2486f0)] - **doc**: add fansworld-claudio to collaborators (Claudio Rodriguez) [#5668](https://github.com/nodejs/node/pull/5668) +* [[`285d5e7ba6`](https://github.com/nodejs/node/commit/285d5e7ba6)] - **doc**: add AndreasMadsen to collaborators (Andreas Madsen) [#5666](https://github.com/nodejs/node/pull/5666) +* [[`8e1f6706e3`](https://github.com/nodejs/node/commit/8e1f6706e3)] - **doc**: add benjamingr to collaborator list (Benjamin Gruenbaum) [#5664](https://github.com/nodejs/node/pull/5664) +* [[`f7842cbb24`](https://github.com/nodejs/node/commit/f7842cbb24)] - **doc**: add whitlockjc to collaborators (Jeremy Whitlock) [#5665](https://github.com/nodejs/node/pull/5665) +* [[`dd6f4ec2e4`](https://github.com/nodejs/node/commit/dd6f4ec2e4)] - **doc**: add mattloring to collaborators (Matt Loring) [#5662](https://github.com/nodejs/node/pull/5662) +* [[`9ebd559a55`](https://github.com/nodejs/node/commit/9ebd559a55)] - **doc**: fix markdown links (Steve Mao) [#5641](https://github.com/nodejs/node/pull/5641) +* [[`62d267e1ff`](https://github.com/nodejs/node/commit/62d267e1ff)] - **doc**: fix dns.resolveCname description typo (axvm) [#5622](https://github.com/nodejs/node/pull/5622) +* [[`9f8e2e2979`](https://github.com/nodejs/node/commit/9f8e2e2979)] - **doc**: update release tweet template (Jeremiah Senkpiel) [#5628](https://github.com/nodejs/node/pull/5628) +* [[`4d6fe300fe`](https://github.com/nodejs/node/commit/4d6fe300fe)] - **doc**: fix v5.8.0 changelog heading (Jeremiah Senkpiel) [#5559](https://github.com/nodejs/node/pull/5559) +* [[`4c1fdaeb2a`](https://github.com/nodejs/node/commit/4c1fdaeb2a)] - **docs**: update link to iojs+release ci job (Myles Borins) [#5632](https://github.com/nodejs/node/pull/5632) +* [[`205bed0bec`](https://github.com/nodejs/node/commit/205bed0bec)] - **lib**: copy arguments object instead of leaking it (Nathan Woltman) [#4361](https://github.com/nodejs/node/pull/4361) +* [[`b16f67a0b9`](https://github.com/nodejs/node/commit/b16f67a0b9)] - **net**: make `isIPv4` and `isIPv6` more efficient (Vladimir Kurchatkin) [#5478](https://github.com/nodejs/node/pull/5478) +* [[`4ecd996baa`](https://github.com/nodejs/node/commit/4ecd996baa)] - **(SEMVER-MINOR)** **src**: allow combination of -i and -e cli flags (Rich Trott) [#5655](https://github.com/nodejs/node/pull/5655) +* [[`f225459496`](https://github.com/nodejs/node/commit/f225459496)] - **test**: improve test-npm-install (Santiago Gimeno) [#5613](https://github.com/nodejs/node/pull/5613) +* [[`cceae5ae78`](https://github.com/nodejs/node/commit/cceae5ae78)] - **test**: eval a strict function (Kári Tristan Helgason) [#5250](https://github.com/nodejs/node/pull/5250) +* [[`9a44c8c337`](https://github.com/nodejs/node/commit/9a44c8c337)] - **test**: add batch of known issue tests (cjihrig) [#5653](https://github.com/nodejs/node/pull/5653) +* [[`1b7b1ed2c9`](https://github.com/nodejs/node/commit/1b7b1ed2c9)] - **timers**: greatly improve code comments (Jeremiah Senkpiel) [#4007](https://github.com/nodejs/node/pull/4007) +* [[`769254b0ba`](https://github.com/nodejs/node/commit/769254b0ba)] - **timers**: refactor timers (Jeremiah Senkpiel) [#4007](https://github.com/nodejs/node/pull/4007) +* [[`0b545fb3f8`](https://github.com/nodejs/node/commit/0b545fb3f8)] - **win,build**: support Visual C++ Build Tools 2015 (João Reis) [#5627](https://github.com/nodejs/node/pull/5627) +* [[`ef774ff9a8`](https://github.com/nodejs/node/commit/ef774ff9a8)] - **(SEMVER-MINOR)** **zlib**: add support for concatenated members (Kári Tristan Helgason) [#5120](https://github.com/nodejs/node/pull/5120) + +## 2016-03-08, Version 5.8.0 (Stable), @Fishrock123 + +### Notable changes + +* **child_process**: `send()` now accepts an options parameter (cjihrig) [#5283](https://github.com/nodejs/node/pull/5283). + - Currently the only option is `keepOpen`, which keeps the underlying socket open after the message is sent. +* **constants**: `ENGINE_METHOD_RSA` is now correctly exposed (Sam Roberts) [#5463](https://github.com/nodejs/node/pull/5463). +* Fixed two regressions which originated in v5.7.0: + - **http**: Errors inside of http client callbacks now propagate correctly (Trevor Norris) [#5591](https://github.com/nodejs/node/pull/5591). + - **path**: Fixed normalization of absolute paths (Evan Lucas) [#5589](https://github.com/nodejs/node/pull/5589). +* **repl**: `start()` no longer requires an options parameter (cjihrig) [#5388](https://github.com/nodejs/node/pull/5388). +* **util**: Improved `format()` performance 50-300% (Evan Lucas) [#5360](https://github.com/nodejs/node/pull/5360). + +### Commits + +* [[`12ca84fc7f`](https://github.com/nodejs/node/commit/12ca84fc7f)] - **benchmark**: add util.format benchmark (Evan Lucas) [#5360](https://github.com/nodejs/node/pull/5360) +* [[`b955d02266`](https://github.com/nodejs/node/commit/b955d02266)] - **benchmark**: fix lint errors (Rich Trott) [#5517](https://github.com/nodejs/node/pull/5517) +* [[`2abf866b6e`](https://github.com/nodejs/node/commit/2abf866b6e)] - **build**: update Node.js logo on Win installer (Robert Jefe Lindstaedt) [#5531](https://github.com/nodejs/node/pull/5531) +* [[`86900f8f2b`](https://github.com/nodejs/node/commit/86900f8f2b)] - **build**: correctly detect clang version (Stefan Budeanu) [#5553](https://github.com/nodejs/node/pull/5553) +* [[`a3017992e4`](https://github.com/nodejs/node/commit/a3017992e4)] - **(SEMVER-MINOR)** **child_process**: add keepOpen option to send() (cjihrig) [#5283](https://github.com/nodejs/node/pull/5283) +* [[`6d4887ccc2`](https://github.com/nodejs/node/commit/6d4887ccc2)] - **(SEMVER-MINOR)** **child_process**: support options in send() (cjihrig) [#5283](https://github.com/nodejs/node/pull/5283) +* [[`9db827c7aa`](https://github.com/nodejs/node/commit/9db827c7aa)] - **(SEMVER-MINOR)** **constants**: define ENGINE_METHOD_RSA (Sam Roberts) [#5463](https://github.com/nodejs/node/pull/5463) +* [[`85013456cd`](https://github.com/nodejs/node/commit/85013456cd)] - **deps**: upgrade to npm 3.7.3 (Kat Marchán) [#5369](https://github.com/nodejs/node/pull/5369) +* [[`67e9f65958`](https://github.com/nodejs/node/commit/67e9f65958)] - **dgram**: default send address to 127.0.0.1 or ::1 (Matteo Collina) [#5493](https://github.com/nodejs/node/pull/5493) +* [[`3c92352c8c`](https://github.com/nodejs/node/commit/3c92352c8c)] - **doc**: document directories in test directory (Michael Barrett) [#5557](https://github.com/nodejs/node/pull/5557) +* [[`7be726f86a`](https://github.com/nodejs/node/commit/7be726f86a)] - **doc**: add info to docs on how to submit docs patch (Sequoia McDowell) [#4591](https://github.com/nodejs/node/pull/4591) +* [[`eb5a95e04a`](https://github.com/nodejs/node/commit/eb5a95e04a)] - **doc**: fix typo in fs.symlink (Michaël Zasso) [#5560](https://github.com/nodejs/node/pull/5560) +* [[`9ad901ef44`](https://github.com/nodejs/node/commit/9ad901ef44)] - **doc**: improve unhandledException doc copy (James M Snell) [#5287](https://github.com/nodejs/node/pull/5287) +* [[`3bd96fdb0f`](https://github.com/nodejs/node/commit/3bd96fdb0f)] - **doc**: update link green to match homepage (silverwind) [#5548](https://github.com/nodejs/node/pull/5548) +* [[`cb7e4fbac9`](https://github.com/nodejs/node/commit/cb7e4fbac9)] - **doc**: update V8 URL (Craig Akimoto) [#5530](https://github.com/nodejs/node/pull/5530) +* [[`b54a26fa61`](https://github.com/nodejs/node/commit/b54a26fa61)] - **(SEMVER-MINOR)** **doc**: correct name of engine methods (Sam Roberts) [#5463](https://github.com/nodejs/node/pull/5463) +* [[`f3971f5817`](https://github.com/nodejs/node/commit/f3971f5817)] - **path**: fix normalize for absolutes (Evan Lucas) [#5589](https://github.com/nodejs/node/pull/5589) +* [[`e572e421b4`](https://github.com/nodejs/node/commit/e572e421b4)] - **(SEMVER-MINOR)** **repl**: accept no arguments to start() (cjihrig) [#5388](https://github.com/nodejs/node/pull/5388) +* [[`5e6d706758`](https://github.com/nodejs/node/commit/5e6d706758)] - **src,http**: fix uncaughtException miss in http (Trevor Norris) [#5591](https://github.com/nodejs/node/pull/5591) +* [[`9dc94d7b09`](https://github.com/nodejs/node/commit/9dc94d7b09)] - **test**: add test-npm-install to parallel tests suite (Myles Borins) [#5166](https://github.com/nodejs/node/pull/5166) +* [[`4f20f31b3e`](https://github.com/nodejs/node/commit/4f20f31b3e)] - **test**: remove broken debugger scenarios (Rich Trott) [#5532](https://github.com/nodejs/node/pull/5532) +* [[`29e26b38c5`](https://github.com/nodejs/node/commit/29e26b38c5)] - **test**: bug repro for vm function redefinition (cjihrig) [#5528](https://github.com/nodejs/node/pull/5528) +* [[`e6210d5f50`](https://github.com/nodejs/node/commit/e6210d5f50)] - **test**: prevent flakey test on pi2 (Trevor Norris) [#5537](https://github.com/nodejs/node/pull/5537) +* [[`40b36baa2f`](https://github.com/nodejs/node/commit/40b36baa2f)] - **test**: check memoryUsage properties (Wyatt Preul) [#5546](https://github.com/nodejs/node/pull/5546) +* [[`048c0f4738`](https://github.com/nodejs/node/commit/048c0f4738)] - **tools**: reduce verbosity of cpplint (Sakthipriyan Vairamani) [#5578](https://github.com/nodejs/node/pull/5578) +* [[`7965c897e0`](https://github.com/nodejs/node/commit/7965c897e0)] - **tools**: enable no-self-assign ESLint rule (Rich Trott) [#5552](https://github.com/nodejs/node/pull/5552) +* [[`5aa17dc136`](https://github.com/nodejs/node/commit/5aa17dc136)] - **tools**: support testing known issues (cjihrig) [#5528](https://github.com/nodejs/node/pull/5528) +* [[`9a3e87e9a8`](https://github.com/nodejs/node/commit/9a3e87e9a8)] - **tools**: enable linting for benchmarks (Rich Trott) [#5517](https://github.com/nodejs/node/pull/5517) +* [[`c4fa2a6715`](https://github.com/nodejs/node/commit/c4fa2a6715)] - **tools**: enable no-extra-parens in ESLint (Rich Trott) [#5512](https://github.com/nodejs/node/pull/5512) +* [[`971edde0cb`](https://github.com/nodejs/node/commit/971edde0cb)] - **util**: improve format() performance further (Brian White) [#5360](https://github.com/nodejs/node/pull/5360) +* [[`c32d460747`](https://github.com/nodejs/node/commit/c32d460747)] - **util**: improve util.format performance (Evan Lucas) [#5360](https://github.com/nodejs/node/pull/5360) + +## 2016-03-02, Version 5.7.1 (Stable), @Fishrock123 + +### Notable changes + +* **governance**: The Core Technical Committee (CTC) added four new members to help guide Node.js core development: Evan Lucas, Rich Trott, Ali Ijaz Sheikh and Сковорода Никита Андреевич (Nikita Skovoroda). +* **openssl**: Upgrade from 1.0.2f to 1.0.2g (Ben Noordhuis) [#5507](https://github.com/nodejs/node/pull/5507). + - Fix a double-free defect in parsing malformed DSA keys that may potentially be used for DoS or memory corruption attacks. It is likely to be very difficult to use this defect for a practical attack and is therefore considered low severity for Node.js users. More info is available at [CVE-2016-0705](https://www.openssl.org/news/vulnerabilities.html#2016-0705). + - Fix a defect that can cause memory corruption in certain very rare cases relating to the internal `BN_hex2bn()` and `BN_dec2bn()` functions. It is believed that Node.js is not invoking the code paths that use these functions so practical attacks via Node.js using this defect are _unlikely_ to be possible. More info is available at [CVE-2016-0797](https://www.openssl.org/news/vulnerabilities.html#2016-0797). + - Fix a defect that makes the _[CacheBleed Attack](https://ssrg.nicta.com.au/projects/TS/cachebleed/)_ possible. This defect enables attackers to execute side-channel attacks leading to the potential recovery of entire RSA private keys. It only affects the Intel Sandy Bridge (and possibly older) microarchitecture when using hyper-threading. Newer microarchitectures, including Haswell, are unaffected. More info is available at [CVE-2016-0702](https://www.openssl.org/news/vulnerabilities.html#2016-0702). +* Fixed several regressions that appeared in v5.7.0: + - **`path.relative()`**: + - Output is no longer unnecessarily verbose (Brian White) [#5389](https://github.com/nodejs/node/pull/5389). + - Resolving UNC paths on Windows now works correctly (Owen Smith) [#5456](https://github.com/nodejs/node/pull/5456). + - Resolving paths with prefixes now works correctly from the root directory (Owen Smith) [#5490](https://github.com/nodejs/node/pull/5490). + - **url**: Fixed an off-by-one error with `parse()` (Brian White) [#5394](https://github.com/nodejs/node/pull/5394). + - **dgram**: Now correctly handles a default address case when offset and length are specified (Matteo Collina) [#5407](https://github.com/nodejs/node/pull/5407). + +### Commits + +* [[`7cae774d9b`](https://github.com/nodejs/node/commit/7cae774d9b)] - **benchmark**: refactor to eliminate redeclared vars (Rich Trott) [#5468](https://github.com/nodejs/node/pull/5468) +* [[`6aebe16669`](https://github.com/nodejs/node/commit/6aebe16669)] - **benchmark**: add benchmark for buf.compare() (Rich Trott) [#5441](https://github.com/nodejs/node/pull/5441) +* [[`00660f55c8`](https://github.com/nodejs/node/commit/00660f55c8)] - **benchmark**: move string-decoder to its own category (Andreas Madsen) [#5177](https://github.com/nodejs/node/pull/5177) +* [[`4650cb3818`](https://github.com/nodejs/node/commit/4650cb3818)] - **benchmark**: fix configuation parameters (Andreas Madsen) [#5177](https://github.com/nodejs/node/pull/5177) +* [[`3ccb275139`](https://github.com/nodejs/node/commit/3ccb275139)] - **benchmark**: merge url.js with url-resolve.js (Andreas Madsen) [#5177](https://github.com/nodejs/node/pull/5177) +* [[`c1e7dbffaa`](https://github.com/nodejs/node/commit/c1e7dbffaa)] - **benchmark**: move misc to categorized directories (Andreas Madsen) [#5177](https://github.com/nodejs/node/pull/5177) +* [[`2f9fee6e8e`](https://github.com/nodejs/node/commit/2f9fee6e8e)] - **benchmark**: use strict mode (Rich Trott) [#5336](https://github.com/nodejs/node/pull/5336) +* [[`4c09e7f359`](https://github.com/nodejs/node/commit/4c09e7f359)] - **build**: remove --quiet from eslint invocation (firedfox) [#5519](https://github.com/nodejs/node/pull/5519) +* [[`2c619f2012`](https://github.com/nodejs/node/commit/2c619f2012)] - **build**: run lint before tests (Rich Trott) [#5470](https://github.com/nodejs/node/pull/5470) +* [[`f349a9a2cf`](https://github.com/nodejs/node/commit/f349a9a2cf)] - **build**: update Node.js logo on OSX installer (Rod Vagg) [#5401](https://github.com/nodejs/node/pull/5401) +* [[`88f393588a`](https://github.com/nodejs/node/commit/88f393588a)] - **crypto**: PBKDF2 works with `int` not `ssize_t` (Fedor Indutny) [#5397](https://github.com/nodejs/node/pull/5397) +* [[`1e86804503`](https://github.com/nodejs/node/commit/1e86804503)] - **deps**: upgrade openssl to 1.0.2g (Ben Noordhuis) [#5507](https://github.com/nodejs/node/pull/5507) +* [[`d3f9b84be8`](https://github.com/nodejs/node/commit/d3f9b84be8)] - **dgram**: handle default address case when offset and length are specified (Matteo Collina) +* [[`f1f3832934`](https://github.com/nodejs/node/commit/f1f3832934)] - **doc**: update NAN urls in ROADMAP.md and doc/releases.md (ronkorving) [#5472](https://github.com/nodejs/node/pull/5472) +* [[`51bc062dab`](https://github.com/nodejs/node/commit/51bc062dab)] - **doc**: add CTC meeting minutes 2016-02-17 (Rod Vagg) [#5410](https://github.com/nodejs/node/pull/5410) +* [[`795c85ba1c`](https://github.com/nodejs/node/commit/795c85ba1c)] - **doc**: fix typo in child_process documentation (Evan Lucas) [#5474](https://github.com/nodejs/node/pull/5474) +* [[`0a56e9690b`](https://github.com/nodejs/node/commit/0a56e9690b)] - **doc**: add note for binary safe string reading (Anton Andesen) [#5155](https://github.com/nodejs/node/pull/5155) +* [[`ea8331e15f`](https://github.com/nodejs/node/commit/ea8331e15f)] - **doc**: improvements to crypto.markdown copy (Alexander Makarenko) [#5230](https://github.com/nodejs/node/pull/5230) +* [[`378a772034`](https://github.com/nodejs/node/commit/378a772034)] - **doc**: `require` behavior on case-insensitive systems (Hugo Wood) +* [[`06b7eb6636`](https://github.com/nodejs/node/commit/06b7eb6636)] - **doc**: document base64url encoding support (Tristan Slominski) [#5243](https://github.com/nodejs/node/pull/5243) +* [[`8ec3d904cb`](https://github.com/nodejs/node/commit/8ec3d904cb)] - **doc**: improve httpVersionMajor / httpVersionMajor (Jackson Tian) [#5296](https://github.com/nodejs/node/pull/5296) +* [[`534e88f56c`](https://github.com/nodejs/node/commit/534e88f56c)] - **doc**: fix relative links in net docs (Evan Lucas) [#5358](https://github.com/nodejs/node/pull/5358) +* [[`7b98a30976`](https://github.com/nodejs/node/commit/7b98a30976)] - **doc**: fix crypto function indentation level (Brian White) [#5460](https://github.com/nodejs/node/pull/5460) +* [[`c0fd802cc2`](https://github.com/nodejs/node/commit/c0fd802cc2)] - **doc**: link to man pages (dcposch@dcpos.ch) [#5073](https://github.com/nodejs/node/pull/5073) +* [[`f8c6701e22`](https://github.com/nodejs/node/commit/f8c6701e22)] - **doc**: add missing property in cluster example (Rafael Cepeda) [#5305](https://github.com/nodejs/node/pull/5305) +* [[`3bfe0483f0`](https://github.com/nodejs/node/commit/3bfe0483f0)] - **doc**: corrected name of argument in socket.send (Chris Dew) [#5449](https://github.com/nodejs/node/pull/5449) +* [[`c8725f5e95`](https://github.com/nodejs/node/commit/c8725f5e95)] - **doc**: fix links in tls, cluster docs (Alexander Makarenko) [#5364](https://github.com/nodejs/node/pull/5364) +* [[`7f2cf9af5c`](https://github.com/nodejs/node/commit/7f2cf9af5c)] - **doc**: explicit about VS 2015 support in readme (Phillip Johnsen) [#5406](https://github.com/nodejs/node/pull/5406) +* [[`12d3cdbfea`](https://github.com/nodejs/node/commit/12d3cdbfea)] - **doc**: remove out-of-date matter from internal docs (Rich Trott) [#5421](https://github.com/nodejs/node/pull/5421) +* [[`43853679f7`](https://github.com/nodejs/node/commit/43853679f7)] - **doc**: copyedit util doc (Rich Trott) [#5399](https://github.com/nodejs/node/pull/5399) +* [[`903e8d09e1`](https://github.com/nodejs/node/commit/903e8d09e1)] - **doc**: fix typo in pbkdf2Sync code sample (Marc Cuva) [#5306](https://github.com/nodejs/node/pull/5306) +* [[`79b1c22c9f`](https://github.com/nodejs/node/commit/79b1c22c9f)] - **doc**: fix buf.readInt16LE output (Chinedu Francis Nwafili) [#5282](https://github.com/nodejs/node/pull/5282) +* [[`e46915f2f3`](https://github.com/nodejs/node/commit/e46915f2f3)] - **doc**: note util.isError() @@toStringTag limitations (cjihrig) [#5414](https://github.com/nodejs/node/pull/5414) +* [[`935fd21fff`](https://github.com/nodejs/node/commit/935fd21fff)] - **doc**: clarify error handling in net.createServer (Dirceu Pereira Tiegs) [#5353](https://github.com/nodejs/node/pull/5353) +* [[`93dce6d4fe`](https://github.com/nodejs/node/commit/93dce6d4fe)] - **doc**: document fs.datasync(Sync) (Ron Korving) [#5402](https://github.com/nodejs/node/pull/5402) +* [[`96daf51358`](https://github.com/nodejs/node/commit/96daf51358)] - **doc**: add Evan Lucas to the CTC (Rod Vagg) [#5275](https://github.com/nodejs/node/pull/5275) +* [[`31b405d0cf`](https://github.com/nodejs/node/commit/31b405d0cf)] - **doc**: add Rich Trott to the CTC (Rod Vagg) [#5276](https://github.com/nodejs/node/pull/5276) +* [[`bcd154e402`](https://github.com/nodejs/node/commit/bcd154e402)] - **doc**: add Ali Ijaz Sheikh to the CTC (Rod Vagg) [#5277](https://github.com/nodejs/node/pull/5277) +* [[`9d0330c804`](https://github.com/nodejs/node/commit/9d0330c804)] - **doc**: add Сковорода Никита Андреевич to the CTC (Rod Vagg) [#5278](https://github.com/nodejs/node/pull/5278) +* [[`365cc63783`](https://github.com/nodejs/node/commit/365cc63783)] - **doc**: add "building node with ninja" guide (Jeremiah Senkpiel) [#4767](https://github.com/nodejs/node/pull/4767) +* [[`2b00c315e1`](https://github.com/nodejs/node/commit/2b00c315e1)] - **doc**: mention prototype check in deepStrictEqual() (cjihrig) [#5367](https://github.com/nodejs/node/pull/5367) +* [[`ff988b3ee6`](https://github.com/nodejs/node/commit/ff988b3ee6)] - **doc,tools,test**: lint doc-based addon tests (Rich Trott) [#5427](https://github.com/nodejs/node/pull/5427) +* [[`d77c3bf204`](https://github.com/nodejs/node/commit/d77c3bf204)] - **http_parser**: use `MakeCallback` (Trevor Norris) [#5419](https://github.com/nodejs/node/pull/5419) +* [[`e3421ac296`](https://github.com/nodejs/node/commit/e3421ac296)] - **lib**: freelist: use .pop() for allocation (Anton Khlynovskiy) [#2174](https://github.com/nodejs/node/pull/2174) +* [[`91d218d096`](https://github.com/nodejs/node/commit/91d218d096)] - **path**: fix path.relative() for prefixes at root (Owen Smith) [#5490](https://github.com/nodejs/node/pull/5490) +* [[`ef7a088906`](https://github.com/nodejs/node/commit/ef7a088906)] - **path**: fix win32 parse() (Zheng Chaoping) [#5484](https://github.com/nodejs/node/pull/5484) +* [[`871396ce8f`](https://github.com/nodejs/node/commit/871396ce8f)] - **path**: fix win32 relative() for UNC paths (Owen Smith) [#5456](https://github.com/nodejs/node/pull/5456) +* [[`91782f1888`](https://github.com/nodejs/node/commit/91782f1888)] - **path**: fix win32 relative() when "to" is a prefix (Owen Smith) [#5456](https://github.com/nodejs/node/pull/5456) +* [[`30cec18eeb`](https://github.com/nodejs/node/commit/30cec18eeb)] - **path**: fix verbose relative() output (Brian White) [#5389](https://github.com/nodejs/node/pull/5389) +* [[`2b88523836`](https://github.com/nodejs/node/commit/2b88523836)] - **repl**: fix stack trace column number in strict mode (Prince J Wesley) [#5416](https://github.com/nodejs/node/pull/5416) +* [[`51db48f741`](https://github.com/nodejs/node/commit/51db48f741)] - **src,tools**: remove null sentinel from source array (Ben Noordhuis) [#5418](https://github.com/nodejs/node/pull/5418) +* [[`03a5daba55`](https://github.com/nodejs/node/commit/03a5daba55)] - **src,tools**: drop nul byte from built-in source code (Ben Noordhuis) [#5418](https://github.com/nodejs/node/pull/5418) +* [[`17d14f3346`](https://github.com/nodejs/node/commit/17d14f3346)] - **src,tools**: allow utf-8 in built-in js source code (Ben Noordhuis) [#5418](https://github.com/nodejs/node/pull/5418) +* [[`12ae6abc69`](https://github.com/nodejs/node/commit/12ae6abc69)] - **test**: increase timeout for test-tls-fast-writing (Rich Trott) [#5466](https://github.com/nodejs/node/pull/5466) +* [[`81348e8855`](https://github.com/nodejs/node/commit/81348e8855)] - **test**: apply Linux workaround to Linux only (Rich Trott) [#5471](https://github.com/nodejs/node/pull/5471) +* [[`c4d9cdb7d0`](https://github.com/nodejs/node/commit/c4d9cdb7d0)] - **test**: allow options for v8 testing (Michael Dawson) [#5502](https://github.com/nodejs/node/pull/5502) +* [[`d1a82c6824`](https://github.com/nodejs/node/commit/d1a82c6824)] - **test**: retry on known SmartOS bug (Rich Trott) [#5454](https://github.com/nodejs/node/pull/5454) +* [[`c7f8a13043`](https://github.com/nodejs/node/commit/c7f8a13043)] - **test**: remove unneeded bind() and related comments (Aayush Naik) [#5023](https://github.com/nodejs/node/pull/5023) +* [[`cc4cbb10df`](https://github.com/nodejs/node/commit/cc4cbb10df)] - **test**: fix flaky child-process-fork-regr-gh-2847 (Santiago Gimeno) [#5422](https://github.com/nodejs/node/pull/5422) +* [[`0ebbf6cd53`](https://github.com/nodejs/node/commit/0ebbf6cd53)] - **test**: remove flaky designation from fixed tests (Rich Trott) [#5459](https://github.com/nodejs/node/pull/5459) +* [[`c83725c604`](https://github.com/nodejs/node/commit/c83725c604)] - **test**: add test-cases for posix path.relative() (Owen Smith) [#5456](https://github.com/nodejs/node/pull/5456) +* [[`22bb7c9d27`](https://github.com/nodejs/node/commit/22bb7c9d27)] - **test**: fix test runner arg regression (Stefan Budeanu) [#5446](https://github.com/nodejs/node/pull/5446) +* [[`8c67b94b11`](https://github.com/nodejs/node/commit/8c67b94b11)] - **test**: refactor test-dgram-send-callback-recursive (Santiago Gimeno) [#5079](https://github.com/nodejs/node/pull/5079) +* [[`2c21d34a2f`](https://github.com/nodejs/node/commit/2c21d34a2f)] - **test**: refactor test-dgram-udp4 (Santiago Gimeno) [#5339](https://github.com/nodejs/node/pull/5339) +* [[`479a43c876`](https://github.com/nodejs/node/commit/479a43c876)] - **test**: allow passing args to executable (Stefan Budeanu) [#5376](https://github.com/nodejs/node/pull/5376) +* [[`ff75023812`](https://github.com/nodejs/node/commit/ff75023812)] - **test**: fix test-timers.reliability on OS X (Rich Trott) [#5379](https://github.com/nodejs/node/pull/5379) +* [[`991f82b4bd`](https://github.com/nodejs/node/commit/991f82b4bd)] - **test**: mitigate flaky test-http-agent (Rich Trott) [#5346](https://github.com/nodejs/node/pull/5346) +* [[`0f54553a99`](https://github.com/nodejs/node/commit/0f54553a99)] - **test**: increase timeouts on some unref timers tests (Jeremiah Senkpiel) [#5352](https://github.com/nodejs/node/pull/5352) +* [[`25c01cd779`](https://github.com/nodejs/node/commit/25c01cd779)] - **tls**: fix assert in context.\_external accessor (Ben Noordhuis) [#5521](https://github.com/nodejs/node/pull/5521) +* [[`5ffd7430d1`](https://github.com/nodejs/node/commit/5ffd7430d1)] - **tools**: apply custom buffer lint rule to /lib only (Rich Trott) [#5371](https://github.com/nodejs/node/pull/5371) +* [[`fa5d28f246`](https://github.com/nodejs/node/commit/fa5d28f246)] - **tools**: enable additional lint rules (Rich Trott) [#5357](https://github.com/nodejs/node/pull/5357) +* [[`b44b701e5b`](https://github.com/nodejs/node/commit/b44b701e5b)] - **tools,benchmark**: increase lint compliance (Rich Trott) [#5429](https://github.com/nodejs/node/pull/5429) +* [[`9424fa5732`](https://github.com/nodejs/node/commit/9424fa5732)] - **url**: group slashed protocols by protocol name (nettofarah) [#5380](https://github.com/nodejs/node/pull/5380) +* [[`dfe45f13e7`](https://github.com/nodejs/node/commit/dfe45f13e7)] - **url**: fix off-by-one error with parse() (Brian White) [#5394](https://github.com/nodejs/node/pull/5394) + +## 2016-02-23, Version 5.7.0 (Stable), @rvagg + +### Notable changes + +* **buffer**: + - You can now supply an `encoding` argument when filling a Buffer `Buffer#fill(string[, start[, end]][, encoding])`, supplying an existing Buffer will also work with `Buffer#fill(buffer[, start[, end]])`. See the [API documentation](https://nodejs.org/api/buffer.html#buffer_buf_fill_value_offset_end_encoding) for details on how this works. (Trevor Norris) [#4935](https://github.com/nodejs/node/pull/4935) + - `Buffer#indexOf()` no longer requires a `byteOffset` argument if you also wish to specify an `encoding`: `Buffer#indexOf(val[, byteOffset][, encoding])`. (Trevor Norris) [#4803](https://github.com/nodejs/node/pull/4803) +* **child_process**: `spawn()` and `spawnSync()` now support a `'shell'` option to allow for optional execution of the given command inside a shell. If set to `true`, `cmd.exe` will be used on Windows and `/bin/sh` elsewhere. A path to a custom shell can also be passed to override these defaults. On Windows, this option allows `.bat.` and `.cmd` files to be executed with `spawn()` and `spawnSync()`. (Colin Ihrig) [#4598](https://github.com/nodejs/node/pull/4598) +* **http_parser**: Update to http-parser 2.6.2 to fix an unintentionally strict limitation of allowable header characters (James M Snell) [#5237](https://github.com/nodejs/node/pull/5237) +* **dgram**: `socket.send()` now supports accepts an array of Buffers or Strings as the first argument. See the [API docs](https://nodejs.org/download/nightly/v6.0.0-nightly201602102848f84332/docs/api/dgram.html#dgram_socket_send_msg_offset_length_port_address_callback) for details on how this works. (Matteo Collina) [#4374](https://github.com/nodejs/node/pull/4374) +* **http**: Fix a bug where handling headers will mistakenly trigger an `'upgrade'` event where the server is just advertising its protocols. This bug can prevent HTTP clients from communicating with HTTP/2 enabled servers. (Fedor Indutny) [#4337](https://github.com/nodejs/node/pull/4337) +* **net**: Added a `listening` Boolean property to `net` and `http` servers to indicate whether the server is listening for connections. (José Moreira) [#4743](https://github.com/nodejs/node/pull/4743) +* **node**: The C++ `node::MakeCallback()` API is now reentrant and calling it from inside another `MakeCallback()` call no longer causes the `nextTick` queue or Promises microtask queue to be processed out of order. (Trevor Norris) [#4507](https://github.com/nodejs/node/pull/4507) +* **tls**: Add a new `tlsSocket.getProtocol()` method to get the negotiated TLS protocol version of the current connection. (Brian White) [#4995](https://github.com/nodejs/node/pull/4995) +* **vm**: Introduce new `'produceCachedData'` and `'cachedData'` options to `new vm.Script()` to interact with V8's code cache. When a new `vm.Script` object is created with the `'produceCachedData'` set to `true` a `Buffer` with V8's code cache data will be produced and stored in `cachedData` property of the returned object. This data in turn may be supplied back to another `vm.Script()` object with a `'cachedData'` option if the supplied source is the same. Successfully executing a script from cached data can speed up instantiation time. See the [API docs](https://nodejs.org/api/vm.html#vm_new_vm_script_code_options) for details. (Fedor Indutny) [#4777](https://github.com/nodejs/node/pull/4777) +* **performance**: Improvements in: + - `process.nextTick()` (Ruben Bridgewater) [#5092](https://github.com/nodejs/node/pull/5092) + - `path` module (Brian White) [#5123](https://github.com/nodejs/node/pull/5123) + - `querystring` module (Brian White) [#5012](https://github.com/nodejs/node/pull/5012) + - `streams` module when processing small chunks (Matteo Collina) [#4354](https://github.com/nodejs/node/pull/4354) + +### Commits + +* [[`3a96fa0030`](https://github.com/nodejs/node/commit/3a96fa0030)] - **async_wrap**: add parent uid to init hook (Andreas Madsen) [#4600](https://github.com/nodejs/node/pull/4600) +* [[`4ef04c7c4c`](https://github.com/nodejs/node/commit/4ef04c7c4c)] - **async_wrap**: make uid the first argument in init (Andreas Madsen) [#4600](https://github.com/nodejs/node/pull/4600) +* [[`4afe801f90`](https://github.com/nodejs/node/commit/4afe801f90)] - **async_wrap**: add uid to all asyncWrap hooks (Andreas Madsen) [#4600](https://github.com/nodejs/node/pull/4600) +* [[`edf8f8a7da`](https://github.com/nodejs/node/commit/edf8f8a7da)] - **benchmark**: split path benchmarks (Brian White) [#5123](https://github.com/nodejs/node/pull/5123) +* [[`8d713d8d51`](https://github.com/nodejs/node/commit/8d713d8d51)] - **benchmark**: allow empty parameters (Brian White) [#5123](https://github.com/nodejs/node/pull/5123) +* [[`eb6d07327a`](https://github.com/nodejs/node/commit/eb6d07327a)] - **(SEMVER-MINOR)** **buffer**: add encoding parameter to fill() (Trevor Norris) [#4935](https://github.com/nodejs/node/pull/4935) +* [[`60d2048b6c`](https://github.com/nodejs/node/commit/60d2048b6c)] - **(SEMVER-MINOR)** **buffer**: properly retrieve binary length of needle (Trevor Norris) [#4803](https://github.com/nodejs/node/pull/4803) +* [[`4c67d74607`](https://github.com/nodejs/node/commit/4c67d74607)] - **(SEMVER-MINOR)** **buffer**: allow encoding param to collapse (Trevor Norris) [#4803](https://github.com/nodejs/node/pull/4803) +* [[`5fa4117bfc`](https://github.com/nodejs/node/commit/5fa4117bfc)] - **build**: add a help message and removed a TODO. (Ojas Shirekar) [#5080](https://github.com/nodejs/node/pull/5080) +* [[`09bfb865af`](https://github.com/nodejs/node/commit/09bfb865af)] - **build**: remove redundant TODO in configure (Ojas Shirekar) [#5080](https://github.com/nodejs/node/pull/5080) +* [[`3dfc11c516`](https://github.com/nodejs/node/commit/3dfc11c516)] - **build**: remove Makefile.build (Ojas Shirekar) [#5080](https://github.com/nodejs/node/pull/5080) +* [[`fc78d3d6a7`](https://github.com/nodejs/node/commit/fc78d3d6a7)] - **build**: skip msi build if WiX is not found (Tsarevich Dmitry) [#5220](https://github.com/nodejs/node/pull/5220) +* [[`356acb39d7`](https://github.com/nodejs/node/commit/356acb39d7)] - **build**: treat aarch64 as arm64 (Johan Bergström) [#5191](https://github.com/nodejs/node/pull/5191) +* [[`3b83d42b4a`](https://github.com/nodejs/node/commit/3b83d42b4a)] - **build**: fix build when python path contains spaces (Felix Becker) [#4841](https://github.com/nodejs/node/pull/4841) +* [[`9e6ad2d8ff`](https://github.com/nodejs/node/commit/9e6ad2d8ff)] - **child_process**: fix data loss with readable event (Brian White) [#5036](https://github.com/nodejs/node/pull/5036) +* [[`ecc797600f`](https://github.com/nodejs/node/commit/ecc797600f)] - **(SEMVER-MINOR)** **child_process**: add shell option to spawn() (cjihrig) [#4598](https://github.com/nodejs/node/pull/4598) +* [[`efd6f68dce`](https://github.com/nodejs/node/commit/efd6f68dce)] - **cluster**: dont rely on `this` in `fork` (Igor Klopov) [#5216](https://github.com/nodejs/node/pull/5216) +* [[`df93d60caf`](https://github.com/nodejs/node/commit/df93d60caf)] - **console**: apply null as `this` for util.format (Jackson Tian) [#5222](https://github.com/nodejs/node/pull/5222) +* [[`c397ba8fa3`](https://github.com/nodejs/node/commit/c397ba8fa3)] - **contextify**: use offset/length from Uint8Array (Fedor Indutny) [#4947](https://github.com/nodejs/node/pull/4947) +* [[`3048ac0b57`](https://github.com/nodejs/node/commit/3048ac0b57)] - **crypto**: have fixed NodeBIOs return EOF (Adam Langley) [#5105](https://github.com/nodejs/node/pull/5105) +* [[`af074846f5`](https://github.com/nodejs/node/commit/af074846f5)] - **debugger**: remove unneeded callback check (Rich Trott) [#5319](https://github.com/nodejs/node/pull/5319) +* [[`7bac743f36`](https://github.com/nodejs/node/commit/7bac743f36)] - **debugger**: assert test before accessing this.binding (Prince J Wesley) [#5145](https://github.com/nodejs/node/pull/5145) +* [[`18c94e5a8d`](https://github.com/nodejs/node/commit/18c94e5a8d)] - **deps**: remove unnecessary files (Brian White) [#5212](https://github.com/nodejs/node/pull/5212) +* [[`967cf97bf0`](https://github.com/nodejs/node/commit/967cf97bf0)] - **deps**: cherry-pick 2e4da65 from v8's 4.8 upstream (Michael Dawson) [#5293](https://github.com/nodejs/node/pull/5293) +* [[`bbdf2684d5`](https://github.com/nodejs/node/commit/bbdf2684d5)] - **deps**: update to http-parser 2.6.2 (James M Snell) [#5237](https://github.com/nodejs/node/pull/5237) +* [[`127dd6275a`](https://github.com/nodejs/node/commit/127dd6275a)] - ***Revert*** "**deps**: sync with upstream c-ares/c-ares@4ef6817" (Ben Noordhuis) [#5199](https://github.com/nodejs/node/pull/5199) +* [[`35c3832994`](https://github.com/nodejs/node/commit/35c3832994)] - **deps**: sync with upstream c-ares/c-ares@4ef6817 (Fedor Indutny) [#5199](https://github.com/nodejs/node/pull/5199) +* [[`b4db31822f`](https://github.com/nodejs/node/commit/b4db31822f)] - **dgram**: scope redeclared variables (Rich Trott) [#4940](https://github.com/nodejs/node/pull/4940) +* [[`368c1d1098`](https://github.com/nodejs/node/commit/368c1d1098)] - **(SEMVER-MINOR)** **dgram**: support dgram.send with multiple buffers (Matteo Collina) [#4374](https://github.com/nodejs/node/pull/4374) +* [[`a8862f59eb`](https://github.com/nodejs/node/commit/a8862f59eb)] - **doc**: update repo docs to use 'CTC' (Alexis Campailla) [#5304](https://github.com/nodejs/node/pull/5304) +* [[`6cf8ec5bd1`](https://github.com/nodejs/node/commit/6cf8ec5bd1)] - **doc**: s/http/https in Myles Borins' GitHub link (Rod Vagg) [#5356](https://github.com/nodejs/node/pull/5356) +* [[`0389e3803c`](https://github.com/nodejs/node/commit/0389e3803c)] - **doc**: clarify child_process.execFile{,Sync} file arg (Kevin Locke) [#5310](https://github.com/nodejs/node/pull/5310) +* [[`c48290d9b7`](https://github.com/nodejs/node/commit/c48290d9b7)] - **doc**: fix buf.length slice example (Chinedu Francis Nwafili) [#5259](https://github.com/nodejs/node/pull/5259) +* [[`a6e437c619`](https://github.com/nodejs/node/commit/a6e437c619)] - **doc**: fix buffer\[index\] example (Chinedu Francis Nwafili) [#5253](https://github.com/nodejs/node/pull/5253) +* [[`73ef1bd423`](https://github.com/nodejs/node/commit/73ef1bd423)] - **doc**: fix template string (Rafael Cepeda) [#5240](https://github.com/nodejs/node/pull/5240) +* [[`fa04daa384`](https://github.com/nodejs/node/commit/fa04daa384)] - **doc**: clarify exceptions during uncaughtException (Noah Rose) [#5180](https://github.com/nodejs/node/pull/5180) +* [[`22f132e61d`](https://github.com/nodejs/node/commit/22f132e61d)] - **doc**: improvements to console.markdown copy (Alexander Makarenko) [#5225](https://github.com/nodejs/node/pull/5225) +* [[`48fa6f6063`](https://github.com/nodejs/node/commit/48fa6f6063)] - **doc**: update process.send() signature (cjihrig) [#5284](https://github.com/nodejs/node/pull/5284) +* [[`35d89d4662`](https://github.com/nodejs/node/commit/35d89d4662)] - **doc**: fix net.createConnection() example (Brian White) [#5219](https://github.com/nodejs/node/pull/5219) +* [[`149007c9f0`](https://github.com/nodejs/node/commit/149007c9f0)] - **doc**: replace node-forward link in CONTRIBUTING.md (Ben Noordhuis) [#5227](https://github.com/nodejs/node/pull/5227) +* [[`a6aaf2caab`](https://github.com/nodejs/node/commit/a6aaf2caab)] - **doc**: improve scrolling, various CSS tweaks (Roman Reiss) [#5198](https://github.com/nodejs/node/pull/5198) +* [[`18b00deeac`](https://github.com/nodejs/node/commit/18b00deeac)] - **doc**: update DCO to v1.1 (Mikeal Rogers) [#5170](https://github.com/nodejs/node/pull/5170) +* [[`3955bc4cd0`](https://github.com/nodejs/node/commit/3955bc4cd0)] - **doc**: fix minor inconsistencies in repl doc (Rich Trott) [#5193](https://github.com/nodejs/node/pull/5193) +* [[`287bce7b48`](https://github.com/nodejs/node/commit/287bce7b48)] - **doc**: merging behavior of writeHead vs setHeader (Alejandro Oviedo) [#5081](https://github.com/nodejs/node/pull/5081) +* [[`529e749d88`](https://github.com/nodejs/node/commit/529e749d88)] - **doc**: fix type references for link gen, link css (Claudio Rodriguez) [#4741](https://github.com/nodejs/node/pull/4741) +* [[`275f6dbcbb`](https://github.com/nodejs/node/commit/275f6dbcbb)] - **(SEMVER-MINOR)** **doc**: correct tlsSocket.getCipher() description (Brian White) [#4995](https://github.com/nodejs/node/pull/4995) +* [[`b706b0c2c5`](https://github.com/nodejs/node/commit/b706b0c2c5)] - **http**: remove old, confusing comment (Brian White) [#5233](https://github.com/nodejs/node/pull/5233) +* [[`ed36235248`](https://github.com/nodejs/node/commit/ed36235248)] - **http**: remove unnecessary check (Brian White) [#5233](https://github.com/nodejs/node/pull/5233) +* [[`7e82a566b3`](https://github.com/nodejs/node/commit/7e82a566b3)] - **(SEMVER-MINOR)** **http**: allow async createConnection() (Brian White) [#4638](https://github.com/nodejs/node/pull/4638) +* [[`411d813323`](https://github.com/nodejs/node/commit/411d813323)] - **http**: do not emit `upgrade` on advertisement (Fedor Indutny) [#4337](https://github.com/nodejs/node/pull/4337) +* [[`bbc786b50f`](https://github.com/nodejs/node/commit/bbc786b50f)] - **http,util**: fix typos in comments (Alexander Makarenko) [#5279](https://github.com/nodejs/node/pull/5279) +* [[`a2d198c702`](https://github.com/nodejs/node/commit/a2d198c702)] - **net**: use `_server` for internal book-keeping (Fedor Indutny) [#5262](https://github.com/nodejs/node/pull/5262) +* [[`18d24e60c5`](https://github.com/nodejs/node/commit/18d24e60c5)] - **(SEMVER-MINOR)** **net**: add net.listening boolean property over a getter (José Moreira) [#4743](https://github.com/nodejs/node/pull/4743) +* [[`9cee86e3e9`](https://github.com/nodejs/node/commit/9cee86e3e9)] - **node**: set process._eventsCount to 0 on startup (Evan Lucas) [#5208](https://github.com/nodejs/node/pull/5208) +* [[`f2e4f621c5`](https://github.com/nodejs/node/commit/f2e4f621c5)] - **node**: improve process.nextTick performance (Ruben Bridgewater) [#5092](https://github.com/nodejs/node/pull/5092) +* [[`1c6f927bd1`](https://github.com/nodejs/node/commit/1c6f927bd1)] - **path**: fix input type checking regression (Brian White) [#5244](https://github.com/nodejs/node/pull/5244) +* [[`4dae8caf7a`](https://github.com/nodejs/node/commit/4dae8caf7a)] - **path**: performance improvements on all platforms (Brian White) [#5123](https://github.com/nodejs/node/pull/5123) +* [[`46be1f4d0c`](https://github.com/nodejs/node/commit/46be1f4d0c)] - **querystring**: improve escape() performance (Brian White) [#5012](https://github.com/nodejs/node/pull/5012) +* [[`27e323e8c1`](https://github.com/nodejs/node/commit/27e323e8c1)] - **querystring**: improve unescapeBuffer() performance (Brian White) [#5012](https://github.com/nodejs/node/pull/5012) +* [[`301023b2b4`](https://github.com/nodejs/node/commit/301023b2b4)] - **querystring**: improve parse() performance (Brian White) [#5012](https://github.com/nodejs/node/pull/5012) +* [[`98907c716b`](https://github.com/nodejs/node/commit/98907c716b)] - **(SEMVER-MINOR)** **repl**: allow multiline function call (Zirak) [#3823](https://github.com/nodejs/node/pull/3823) +* [[`c551da8cb4`](https://github.com/nodejs/node/commit/c551da8cb4)] - **repl**: handle quotes within regexp literal (Prince J Wesley) [#5117](https://github.com/nodejs/node/pull/5117) +* [[`15091ccca2`](https://github.com/nodejs/node/commit/15091ccca2)] - **src**: remove unnecessary check (Brian White) [#5233](https://github.com/nodejs/node/pull/5233) +* [[`830bb04d90`](https://github.com/nodejs/node/commit/830bb04d90)] - **src**: remove TryCatch in MakeCallback (Trevor Norris) [#4507](https://github.com/nodejs/node/pull/4507) +* [[`7f22c8c8a6`](https://github.com/nodejs/node/commit/7f22c8c8a6)] - **src**: remove unused TickInfo::in_tick() (Trevor Norris) [#4507](https://github.com/nodejs/node/pull/4507) +* [[`406eb1f516`](https://github.com/nodejs/node/commit/406eb1f516)] - **src**: remove unused of TickInfo::last_threw() (Trevor Norris) [#4507](https://github.com/nodejs/node/pull/4507) +* [[`bcec2fecbd`](https://github.com/nodejs/node/commit/bcec2fecbd)] - **src**: add AsyncCallbackScope (Trevor Norris) [#4507](https://github.com/nodejs/node/pull/4507) +* [[`2cb1594279`](https://github.com/nodejs/node/commit/2cb1594279)] - **src**: fix MakeCallback error handling (Trevor Norris) [#4507](https://github.com/nodejs/node/pull/4507) +* [[`8d6e679a90`](https://github.com/nodejs/node/commit/8d6e679a90)] - **src,test,tools**: modify for more stringent linting (Rich Trott) [#5214](https://github.com/nodejs/node/pull/5214) +* [[`7684b0fcdf`](https://github.com/nodejs/node/commit/7684b0fcdf)] - **stream**: fix no data on partial decode (Brian White) [#5226](https://github.com/nodejs/node/pull/5226) +* [[`f706cb0189`](https://github.com/nodejs/node/commit/f706cb0189)] - **streams**: 5% throughput gain when sending small chunks (Matteo Collina) [#4354](https://github.com/nodejs/node/pull/4354) +* [[`25513a473a`](https://github.com/nodejs/node/commit/25513a473a)] - **string_decoder**: fix performance regression (Brian White) [#5134](https://github.com/nodejs/node/pull/5134) +* [[`0e85530d8c`](https://github.com/nodejs/node/commit/0e85530d8c)] - **test**: use String.prototype.repeat() for clarity (Rich Trott) [#5311](https://github.com/nodejs/node/pull/5311) +* [[`5683efb90a`](https://github.com/nodejs/node/commit/5683efb90a)] - **test**: remove flaky mark for test-debug-no-context (Rich Trott) [#5317](https://github.com/nodejs/node/pull/5317) +* [[`c55bb79ace`](https://github.com/nodejs/node/commit/c55bb79ace)] - **test**: add test for https server close event (Braydon Fuller) [#5106](https://github.com/nodejs/node/pull/5106) +* [[`138ee983b0`](https://github.com/nodejs/node/commit/138ee983b0)] - **test**: refactor test-http-destroyed-socket-write2 (Santiago Gimeno) [#4970](https://github.com/nodejs/node/pull/4970) +* [[`df7d91f36b`](https://github.com/nodejs/node/commit/df7d91f36b)] - **test**: mitigate flaky test-debug-no-context (Rich Trott) [#5269](https://github.com/nodejs/node/pull/5269) +* [[`d9177e7c26`](https://github.com/nodejs/node/commit/d9177e7c26)] - **test**: test-process-getactivehandles is flaky (Alexis Campailla) [#5303](https://github.com/nodejs/node/pull/5303) +* [[`f5cc04732f`](https://github.com/nodejs/node/commit/f5cc04732f)] - **test**: mark test-http-regr-gh-2928 flaky (Rich Trott) [#5280](https://github.com/nodejs/node/pull/5280) +* [[`78b349d5d1`](https://github.com/nodejs/node/commit/78b349d5d1)] - **test**: disable fs watch tests for AIX (Michael Dawson) [#5187](https://github.com/nodejs/node/pull/5187) +* [[`82ee5e94df`](https://github.com/nodejs/node/commit/82ee5e94df)] - **test**: mark test-http-agent flaky (Rich Trott) [#5209](https://github.com/nodejs/node/pull/5209) +* [[`1494d6f213`](https://github.com/nodejs/node/commit/1494d6f213)] - **test**: minimal repl eval option test (Rich Trott) [#5192](https://github.com/nodejs/node/pull/5192) +* [[`e7bf951136`](https://github.com/nodejs/node/commit/e7bf951136)] - **test**: add addons test for MakeCallback (Trevor Norris) [#4507](https://github.com/nodejs/node/pull/4507) +* [[`98596a94fa`](https://github.com/nodejs/node/commit/98596a94fa)] - **(SEMVER-MINOR)** **test**: run v8 tests from node tree (Bryon Leung) [#4704](https://github.com/nodejs/node/pull/4704) +* [[`69c544f245`](https://github.com/nodejs/node/commit/69c544f245)] - **test**: fix flaky test-http-regr-gh-2928 (Rich Trott) [#5154](https://github.com/nodejs/node/pull/5154) +* [[`7c88410507`](https://github.com/nodejs/node/commit/7c88410507)] - **test**: fix child-process-fork-regr-gh-2847 again (Santiago Gimeno) [#5179](https://github.com/nodejs/node/pull/5179) +* [[`2c2cb6700d`](https://github.com/nodejs/node/commit/2c2cb6700d)] - **test**: remove unneeded common.indirectInstanceOf() (Rich Trott) [#5149](https://github.com/nodejs/node/pull/5149) +* [[`6340974f21`](https://github.com/nodejs/node/commit/6340974f21)] - **test**: don't run test-tick-processor.js on Aix (Michael Dawson) [#5093](https://github.com/nodejs/node/pull/5093) +* [[`a8f4db236c`](https://github.com/nodejs/node/commit/a8f4db236c)] - **test**: improve path tests (Brian White) [#5123](https://github.com/nodejs/node/pull/5123) +* [[`8301773c1e`](https://github.com/nodejs/node/commit/8301773c1e)] - **test**: fix child-process-fork-regr-gh-2847 (Santiago Gimeno) [#5121](https://github.com/nodejs/node/pull/5121) +* [[`f2bd86775b`](https://github.com/nodejs/node/commit/f2bd86775b)] - **test**: update arrow function style (cjihrig) [#4813](https://github.com/nodejs/node/pull/4813) +* [[`aed04b85c2`](https://github.com/nodejs/node/commit/aed04b85c2)] - **tls**: nullify `.ssl` on handle close (Fedor Indutny) [#5168](https://github.com/nodejs/node/pull/5168) +* [[`c3f8aab652`](https://github.com/nodejs/node/commit/c3f8aab652)] - **(SEMVER-MINOR)** **tls**: add getProtocol() to TLS sockets (Brian White) [#4995](https://github.com/nodejs/node/pull/4995) +* [[`7fc2e3161f`](https://github.com/nodejs/node/commit/7fc2e3161f)] - **tools**: add Node.js-specific ESLint rules (Rich Trott) [#5320](https://github.com/nodejs/node/pull/5320) +* [[`983325cb0c`](https://github.com/nodejs/node/commit/983325cb0c)] - **tools**: replace obsolete ESLint rules (Rich Trott) [#5214](https://github.com/nodejs/node/pull/5214) +* [[`f601d040b5`](https://github.com/nodejs/node/commit/f601d040b5)] - **tools**: update ESLint to version 2.1.0 (Rich Trott) [#5214](https://github.com/nodejs/node/pull/5214) +* [[`13af565759`](https://github.com/nodejs/node/commit/13af565759)] - **tools**: remove obsolete lint rules (Rich Trott) [#5214](https://github.com/nodejs/node/pull/5214) +* [[`c566f44f1b`](https://github.com/nodejs/node/commit/c566f44f1b)] - **tools**: add recommended ES6 lint rules (Rich Trott) [#5210](https://github.com/nodejs/node/pull/5210) +* [[`b611caa0ba`](https://github.com/nodejs/node/commit/b611caa0ba)] - **tools**: add recommended linting rules (Rich Trott) [#5188](https://github.com/nodejs/node/pull/5188) +* [[`b1a16d1202`](https://github.com/nodejs/node/commit/b1a16d1202)] - **tools**: remove excessive comments from .eslintrc (Rich Trott) [#5151](https://github.com/nodejs/node/pull/5151) +* [[`c4ed5ece4d`](https://github.com/nodejs/node/commit/c4ed5ece4d)] - **tools**: enable no-proto rule for linter (Jackson Tian) [#5140](https://github.com/nodejs/node/pull/5140) +* [[`86f8477b56`](https://github.com/nodejs/node/commit/86f8477b56)] - **tools**: disallow mixed spaces and tabs for indents (Rich Trott) [#5135](https://github.com/nodejs/node/pull/5135) +* [[`21fd1496a9`](https://github.com/nodejs/node/commit/21fd1496a9)] - **tools**: alphabetize eslint stylistic issues section (Rich Trott) +* [[`22c8d50a1f`](https://github.com/nodejs/node/commit/22c8d50a1f)] - **tools**: parse types into links in doc html gen (Claudio Rodriguez) [#4741](https://github.com/nodejs/node/pull/4741) +* [[`5c54d4987d`](https://github.com/nodejs/node/commit/5c54d4987d)] - **tools**: enable no-redeclare rule for linter (Rich Trott) [#5047](https://github.com/nodejs/node/pull/5047) +* [[`a3a0cf603a`](https://github.com/nodejs/node/commit/a3a0cf603a)] - **tools**: add arrow function rules to eslint (cjihrig) [#4813](https://github.com/nodejs/node/pull/4813) +* [[`bcc26f747f`](https://github.com/nodejs/node/commit/bcc26f747f)] - **tools,doc**: fix linting errors (Rich Trott) [#5161](https://github.com/nodejs/node/pull/5161) +* [[`47274704aa`](https://github.com/nodejs/node/commit/47274704aa)] - **url**: fix lint and deopt issues (Brian White) [#5300](https://github.com/nodejs/node/pull/5300) +* [[`729ad75860`](https://github.com/nodejs/node/commit/729ad75860)] - **url**: improve url.parse() performance (Brian White) [#4892](https://github.com/nodejs/node/pull/4892) +* [[`6c8378b15b`](https://github.com/nodejs/node/commit/6c8378b15b)] - **vm**: fix `produceCachedData` (Jiho Choi) [#5343](https://github.com/nodejs/node/pull/5343) +* [[`d1cacb814f`](https://github.com/nodejs/node/commit/d1cacb814f)] - **(SEMVER-MINOR)** **vm**: introduce `cachedData`/`produceCachedData` (Fedor Indutny) [#4777](https://github.com/nodejs/node/pull/4777) + +## 2016-02-09, Version 5.6.0 (Stable), @jasnell + +This is an important security release. All Node.js users should consult the security release summary at nodejs.org for details on patched vulnerabilities. + +### Notable changes + +* **http**: fix defects in HTTP header parsing for requests and responses that can allow request smuggling (CVE-2016-2086) or response splitting (CVE-2016-2216). HTTP header parsing now aligns more closely with the HTTP spec including restricting the acceptable characters. +* **http-parser**: upgrade from 2.6.0 to 2.6.1 +* **npm**: upgrade npm from 3.3.12 to 3.6.0 (Rebecca Turner) [#4958](https://github.com/nodejs/node/pull/4958) +* **openssl**: upgrade from 1.0.2e to 1.0.2f. To mitigate against the Logjam attack, TLS clients now reject Diffie-Hellman handshakes with parameters shorter than 1024-bits, up from the previous limit of 768-bits. + +### Commits + +* [[`3b6283c163`](https://github.com/nodejs/node/commit/3b6283c163)] - **benchmark**: add a constant declaration for `net` (Minwoo Jung) [#3950](https://github.com/nodejs/node/pull/3950) +* [[`3175f7450e`](https://github.com/nodejs/node/commit/3175f7450e)] - **buffer**: remove duplicated code in fromObject (HUANG Wei) [#4948](https://github.com/nodejs/node/pull/4948) +* [[`58d67e26a2`](https://github.com/nodejs/node/commit/58d67e26a2)] - **buffer**: validate list elements in Buffer.concat (Michaël Zasso) [#4951](https://github.com/nodejs/node/pull/4951) +* [[`bafc86f00e`](https://github.com/nodejs/node/commit/bafc86f00e)] - **buffer**: refactor redeclared variables (Rich Trott) [#4886](https://github.com/nodejs/node/pull/4886) +* [[`0fa4d90b94`](https://github.com/nodejs/node/commit/0fa4d90b94)] - **build**: Add VARIATION variable to binary target (Stefan Budeanu) [#4631](https://github.com/nodejs/node/pull/4631) +* [[`ec62789152`](https://github.com/nodejs/node/commit/ec62789152)] - **crypto**: fix memory leak in LoadPKCS12 (Fedor Indutny) [#5109](https://github.com/nodejs/node/pull/5109) +* [[`d9e934c71f`](https://github.com/nodejs/node/commit/d9e934c71f)] - **crypto**: add `pfx` certs as CA certs too (Fedor Indutny) [#5109](https://github.com/nodejs/node/pull/5109) +* [[`0d4b538175`](https://github.com/nodejs/node/commit/0d4b538175)] - **crypto**: use SSL_CTX_clear_extra_chain_certs. (Adam Langley) [#4919](https://github.com/nodejs/node/pull/4919) +* [[`abb0f6cd53`](https://github.com/nodejs/node/commit/abb0f6cd53)] - **crypto**: fix build when OCSP-stapling not provided (Adam Langley) [#4914](https://github.com/nodejs/node/pull/4914) +* [[`755619c554`](https://github.com/nodejs/node/commit/755619c554)] - **crypto**: use a const SSL_CIPHER (Adam Langley) [#4913](https://github.com/nodejs/node/pull/4913) +* [[`d5d2f86f89`](https://github.com/nodejs/node/commit/d5d2f86f89)] - **(SEMVER-MINOR)** **deps**: update http-parser to version 2.6.1 (James M Snell) +* [[`f0bd176d6d`](https://github.com/nodejs/node/commit/f0bd176d6d)] - **deps**: reapply c-ares floating patch (Ben Noordhuis) [#5090](https://github.com/nodejs/node/pull/5090) +* [[`f1a0827417`](https://github.com/nodejs/node/commit/f1a0827417)] - **deps**: sync with upstream bagder/c-ares@2bae2d5 (Fedor Indutny) [#5090](https://github.com/nodejs/node/pull/5090) +* [[`cbf36de8f1`](https://github.com/nodejs/node/commit/cbf36de8f1)] - **deps**: upgrade npm to 3.6.0 (Rebecca Turner) [#4958](https://github.com/nodejs/node/pull/4958) +* [[`dd97d07a0d`](https://github.com/nodejs/node/commit/dd97d07a0d)] - **deps**: backport 8d00c2c from v8 upstream (Gibson Fahnestock) [#5024](https://github.com/nodejs/node/pull/5024) +* [[`b75263094b`](https://github.com/nodejs/node/commit/b75263094b)] - **deps**: add -no_rand_screen to openssl s_client (Shigeki Ohtsu) [#1836](https://github.com/nodejs/node/pull/1836) +* [[`b312b7914f`](https://github.com/nodejs/node/commit/b312b7914f)] - **deps**: upgrade openssl sources to 1.0.2f (Myles Borins) [#4961](https://github.com/nodejs/node/pull/4961) +* [[`fa0457ed04`](https://github.com/nodejs/node/commit/fa0457ed04)] - **dns**: throw a TypeError in lookupService with invalid port (Evan Lucas) [#4839](https://github.com/nodejs/node/pull/4839) +* [[`c4c8b3bf2e`](https://github.com/nodejs/node/commit/c4c8b3bf2e)] - **doc**: fix dgram doc indentation (Rich Trott) [#5118](https://github.com/nodejs/node/pull/5118) +* [[`027cd2719f`](https://github.com/nodejs/node/commit/027cd2719f)] - **doc**: clarify code of conduct reporting (Julie Pagano) [#5107](https://github.com/nodejs/node/pull/5107) +* [[`9f7aa6f868`](https://github.com/nodejs/node/commit/9f7aa6f868)] - **doc**: clarify dgram socket.send() multi-buffer support (Matteo Collina) [#5130](https://github.com/nodejs/node/pull/5130) +* [[`a96ae2cb37`](https://github.com/nodejs/node/commit/a96ae2cb37)] - **doc**: console is asynchronous unless it's a file (Ben Noordhuis) [#5133](https://github.com/nodejs/node/pull/5133) +* [[`4c54c8f309`](https://github.com/nodejs/node/commit/4c54c8f309)] - **doc**: fix typo in dgram doc (Rich Trott) [#5114](https://github.com/nodejs/node/pull/5114) +* [[`9c93ea3d51`](https://github.com/nodejs/node/commit/9c93ea3d51)] - **doc**: fix links order in Buffer doc (Alexander Makarenko) [#5076](https://github.com/nodejs/node/pull/5076) +* [[`a0ba378880`](https://github.com/nodejs/node/commit/a0ba378880)] - **doc**: minor improvement in OS docs (Alexander Makarenko) [#5006](https://github.com/nodejs/node/pull/5006) +* [[`1e2108a6b7`](https://github.com/nodejs/node/commit/1e2108a6b7)] - **doc**: fix links in Addons docs (Alexander Makarenko) [#5072](https://github.com/nodejs/node/pull/5072) +* [[`e5134b1701`](https://github.com/nodejs/node/commit/e5134b1701)] - **doc**: fix inconsistent styling (Brian White) [#4996](https://github.com/nodejs/node/pull/4996) +* [[`dde160378e`](https://github.com/nodejs/node/commit/dde160378e)] - **doc**: fix link in cluster documentation (Timothy Gu) [#5068](https://github.com/nodejs/node/pull/5068) +* [[`e5254c12f4`](https://github.com/nodejs/node/commit/e5254c12f4)] - **doc**: fix reference to API `hash.final` (Minwoo Jung) [#5050](https://github.com/nodejs/node/pull/5050) +* [[`87fd9968a8`](https://github.com/nodejs/node/commit/87fd9968a8)] - **doc**: clarify optional arguments of Buffer methods (Michaël Zasso) [#5008](https://github.com/nodejs/node/pull/5008) +* [[`9908eced24`](https://github.com/nodejs/node/commit/9908eced24)] - **doc**: uppercase 'RSA-SHA256' in crypto.markdown (Rainer Oviir) [#5044](https://github.com/nodejs/node/pull/5044) +* [[`bf0383bbea`](https://github.com/nodejs/node/commit/bf0383bbea)] - **doc**: apply consistent styling for functions (Rich Trott) [#4974](https://github.com/nodejs/node/pull/4974) +* [[`8c7f4bab2d`](https://github.com/nodejs/node/commit/8c7f4bab2d)] - **doc**: multiple improvements in Stream docs (Alexander Makarenko) [#5009](https://github.com/nodejs/node/pull/5009) +* [[`ee013715b9`](https://github.com/nodejs/node/commit/ee013715b9)] - **doc**: improve styling consistency in VM docs (Alexander Makarenko) [#5005](https://github.com/nodejs/node/pull/5005) +* [[`9824b0d132`](https://github.com/nodejs/node/commit/9824b0d132)] - **doc**: fix anchor links from stream to http and events (piepmatz) [#5007](https://github.com/nodejs/node/pull/5007) +* [[`2c85f79569`](https://github.com/nodejs/node/commit/2c85f79569)] - **doc**: minor improvement to HTTPS doc (Alexander Makarenko) [#5002](https://github.com/nodejs/node/pull/5002) +* [[`9cf1370017`](https://github.com/nodejs/node/commit/9cf1370017)] - **doc**: improve styling consistency in Buffer docs (Alexander Makarenko) [#5001](https://github.com/nodejs/node/pull/5001) +* [[`2750cb0613`](https://github.com/nodejs/node/commit/2750cb0613)] - **doc**: consistent styling for functions in TLS docs (Alexander Makarenko) [#5000](https://github.com/nodejs/node/pull/5000) +* [[`4758bf13a5`](https://github.com/nodejs/node/commit/4758bf13a5)] - **doc**: update npm LICENSE using license-builder.sh (Rebecca Turner) [#4958](https://github.com/nodejs/node/pull/4958) +* [[`3b08b5d22c`](https://github.com/nodejs/node/commit/3b08b5d22c)] - **doc**: fix minor typo in process doc (Prayag Verma) [#5018](https://github.com/nodejs/node/pull/5018) +* [[`129977c9c7`](https://github.com/nodejs/node/commit/129977c9c7)] - **doc**: fix typo in Readme.md (Prayag Verma) [#5017](https://github.com/nodejs/node/pull/5017) +* [[`5de3dc557f`](https://github.com/nodejs/node/commit/5de3dc557f)] - **doc**: fix `notDeepEqual` API (Minwoo Jung) [#4971](https://github.com/nodejs/node/pull/4971) +* [[`d47dadcc1f`](https://github.com/nodejs/node/commit/d47dadcc1f)] - **doc**: make buffer methods styles consistent (Timothy Gu) [#4873](https://github.com/nodejs/node/pull/4873) +* [[`17888b122c`](https://github.com/nodejs/node/commit/17888b122c)] - **doc**: fix JSON generation for aliased methods (Timothy Gu) [#4871](https://github.com/nodejs/node/pull/4871) +* [[`396e4b9199`](https://github.com/nodejs/node/commit/396e4b9199)] - **doc**: add more details to process.env (Evan Lucas) [#4924](https://github.com/nodejs/node/pull/4924) +* [[`bc11bf4659`](https://github.com/nodejs/node/commit/bc11bf4659)] - **doc**: don't use "interface" as a variable name (ChALkeR) [#4900](https://github.com/nodejs/node/pull/4900) +* [[`bcf55d2f44`](https://github.com/nodejs/node/commit/bcf55d2f44)] - **doc**: spell writable consistently (Peter Lyons) [#4954](https://github.com/nodejs/node/pull/4954) +* [[`4a6d0ac436`](https://github.com/nodejs/node/commit/4a6d0ac436)] - **doc**: update eol handling in readline (Kári Tristan Helgason) [#4927](https://github.com/nodejs/node/pull/4927) +* [[`e65d3638c0`](https://github.com/nodejs/node/commit/e65d3638c0)] - **doc**: replace function expressions with arrows (Benjamin Gruenbaum) [#4832](https://github.com/nodejs/node/pull/4832) +* [[`423a58d66f`](https://github.com/nodejs/node/commit/423a58d66f)] - **doc**: show links consistently in deprecations (Sakthipriyan Vairamani) [#4907](https://github.com/nodejs/node/pull/4907) +* [[`fd87659139`](https://github.com/nodejs/node/commit/fd87659139)] - **doc**: add docs working group (Bryan English) [#4244](https://github.com/nodejs/node/pull/4244) +* [[`19ed619cff`](https://github.com/nodejs/node/commit/19ed619cff)] - **doc**: remove unnecessary bind(this) (Dmitriy Lazarev) [#4797](https://github.com/nodejs/node/pull/4797) +* [[`5129930786`](https://github.com/nodejs/node/commit/5129930786)] - **doc**: keep the names in sorted order (Sakthipriyan Vairamani) [#4876](https://github.com/nodejs/node/pull/4876) +* [[`3c46c10d54`](https://github.com/nodejs/node/commit/3c46c10d54)] - **doc**: fix nonsensical grammar in Buffer::write (Jimb Esser) [#4863](https://github.com/nodejs/node/pull/4863) +* [[`a1af6fc1a7`](https://github.com/nodejs/node/commit/a1af6fc1a7)] - **doc**: add `servername` parameter docs (Alexander Makarenko) [#4729](https://github.com/nodejs/node/pull/4729) +* [[`f4eeba8467`](https://github.com/nodejs/node/commit/f4eeba8467)] - **doc**: fix code type of markdowns (Jackson Tian) [#4858](https://github.com/nodejs/node/pull/4858) +* [[`fa1d453359`](https://github.com/nodejs/node/commit/fa1d453359)] - **doc**: check for errors in 'listen' event (Benjamin Gruenbaum) [#4834](https://github.com/nodejs/node/pull/4834) +* [[`f462320f74`](https://github.com/nodejs/node/commit/f462320f74)] - **doc**: undo move http.IncomingMessage.statusMessage (Jeff Harris) [#4822](https://github.com/nodejs/node/pull/4822) +* [[`711245e5ac`](https://github.com/nodejs/node/commit/711245e5ac)] - **doc**: style fixes for the TOC (Roman Reiss) [#4748](https://github.com/nodejs/node/pull/4748) +* [[`611c2f6fdf`](https://github.com/nodejs/node/commit/611c2f6fdf)] - **doc**: proper markdown escaping -> \_\_, \*, \_ (Robert Jefe Lindstaedt) [#4805](https://github.com/nodejs/node/pull/4805) +* [[`5a860d9cb7`](https://github.com/nodejs/node/commit/5a860d9cb7)] - **doc**: Examples work when data exceeds buffer size (Glen Arrowsmith) [#4811](https://github.com/nodejs/node/pull/4811) +* [[`71ba14de86`](https://github.com/nodejs/node/commit/71ba14de86)] - **doc**: update list of personal traits in CoC (Kat Marchán) [#4801](https://github.com/nodejs/node/pull/4801) +* [[`97eedfc57a`](https://github.com/nodejs/node/commit/97eedfc57a)] - **doc**: harmonize $ node command line notation (Robert Jefe Lindstaedt) [#4806](https://github.com/nodejs/node/pull/4806) +* [[`2dde0f08c9`](https://github.com/nodejs/node/commit/2dde0f08c9)] - **doc**: add buf.indexOf encoding param with example (Karl Skomski) [#3373](https://github.com/nodejs/node/pull/3373) +* [[`66c74548de`](https://github.com/nodejs/node/commit/66c74548de)] - **doc**: fenced all code blocks, typo fixes (Robert Jefe Lindstaedt) [#4733](https://github.com/nodejs/node/pull/4733) +* [[`54e8845b5e`](https://github.com/nodejs/node/commit/54e8845b5e)] - **fs**: refactor redeclared variables (Rich Trott) [#4959](https://github.com/nodejs/node/pull/4959) +* [[`fa940cf9bc`](https://github.com/nodejs/node/commit/fa940cf9bc)] - **fs**: remove unused branches (Benjamin Gruenbaum) [#4795](https://github.com/nodejs/node/pull/4795) +* [[`a3b84a4c93`](https://github.com/nodejs/node/commit/a3b84a4c93)] - **(SEMVER-MINOR)** **http**: strictly forbid invalid characters from headers (James M Snell) +* [[`9b03af254a`](https://github.com/nodejs/node/commit/9b03af254a)] - **http**: remove reference to onParserExecute (Tom Atkinson) [#4773](https://github.com/nodejs/node/pull/4773) +* [[`101de9de3f`](https://github.com/nodejs/node/commit/101de9de3f)] - **https**: evict cached sessions on error (Fedor Indutny) [#4982](https://github.com/nodejs/node/pull/4982) +* [[`b2c8b7f6d3`](https://github.com/nodejs/node/commit/b2c8b7f6d3)] - **internal/child_process**: call postSend on error (Fedor Indutny) [#4752](https://github.com/nodejs/node/pull/4752) +* [[`55030922e5`](https://github.com/nodejs/node/commit/55030922e5)] - **lib**: scope loop variables (Rich Trott) [#4965](https://github.com/nodejs/node/pull/4965) +* [[`725ad5b1ce`](https://github.com/nodejs/node/commit/725ad5b1ce)] - **lib**: remove string_decoder.js var redeclarations (Rich Trott) [#4978](https://github.com/nodejs/node/pull/4978) +* [[`c09eb44a59`](https://github.com/nodejs/node/commit/c09eb44a59)] - **module**: refactor redeclared variable (Rich Trott) [#4962](https://github.com/nodejs/node/pull/4962) +* [[`612ce66c78`](https://github.com/nodejs/node/commit/612ce66c78)] - **net**: refactor redeclared variables (Rich Trott) [#4963](https://github.com/nodejs/node/pull/4963) +* [[`c9b05dafe0`](https://github.com/nodejs/node/commit/c9b05dafe0)] - **net**: move isLegalPort to internal/net (Evan Lucas) [#4882](https://github.com/nodejs/node/pull/4882) +* [[`7003a4e3d8`](https://github.com/nodejs/node/commit/7003a4e3d8)] - **node_contextify**: do not incept debug context (Myles Borins) [#4815](https://github.com/nodejs/node/issues/4815) +* [[`5a77c095a6`](https://github.com/nodejs/node/commit/5a77c095a6)] - **process**: support symbol events (cjihrig) [#4798](https://github.com/nodejs/node/pull/4798) +* [[`85743c0e92`](https://github.com/nodejs/node/commit/85743c0e92)] - **querystring**: check that maxKeys is finite (Myles Borins) [#5066](https://github.com/nodejs/node/pull/5066) +* [[`5a10fe932c`](https://github.com/nodejs/node/commit/5a10fe932c)] - **querystring**: use String.prototype.split's limit (Manuel Valls) [#2288](https://github.com/nodejs/node/pull/2288) +* [[`2844cc03dc`](https://github.com/nodejs/node/commit/2844cc03dc)] - **repl**: remove variable redeclaration (Rich Trott) [#4977](https://github.com/nodejs/node/pull/4977) +* [[`ac6627a0fe`](https://github.com/nodejs/node/commit/ac6627a0fe)] - **src**: avoid compiler warning in node_revert.cc (James M Snell) +* [[`459c5844c8`](https://github.com/nodejs/node/commit/459c5844c8)] - **(SEMVER-MINOR)** **src**: add --security-revert command line flag (James M Snell) +* [[`95615196de`](https://github.com/nodejs/node/commit/95615196de)] - **src**: clean up usage of __proto__ (Jackson Tian) [#5069](https://github.com/nodejs/node/pull/5069) +* [[`e93b024214`](https://github.com/nodejs/node/commit/e93b024214)] - **src**: remove no longer relevant comments (Chris911) [#4843](https://github.com/nodejs/node/pull/4843) +* [[`a2c257a3ef`](https://github.com/nodejs/node/commit/a2c257a3ef)] - **src**: fix negative values in process.hrtime() (Ben Noordhuis) [#4757](https://github.com/nodejs/node/pull/4757) +* [[`b46f3b84d4`](https://github.com/nodejs/node/commit/b46f3b84d4)] - **src,deps**: replace LoadLibrary by LoadLibraryW (Cheng Zhao) [iojs/io.js#226](https://github.com/iojs/io.js/pull/226) +* [[`ee8d4bb075`](https://github.com/nodejs/node/commit/ee8d4bb075)] - **stream**: prevent object map change in TransformState (Evan Lucas) [#5032](https://github.com/nodejs/node/pull/5032) +* [[`c8b6de244e`](https://github.com/nodejs/node/commit/c8b6de244e)] - **stream**: refactor redeclared variables (Rich Trott) [#4816](https://github.com/nodejs/node/pull/4816) +* [[`9dcc45e9c5`](https://github.com/nodejs/node/commit/9dcc45e9c5)] - **test**: enable to work pkcs12 test in FIPS mode (Shigeki Ohtsu) [#5150](https://github.com/nodejs/node/pull/5150) +* [[`e4390664ae`](https://github.com/nodejs/node/commit/e4390664ae)] - **test**: disable gh-5100 test when in FIPS mode (Fedor Indutny) [#5144](https://github.com/nodejs/node/pull/5144) +* [[`cf3aa911ec`](https://github.com/nodejs/node/commit/cf3aa911ec)] - **test**: fix flaky test-dgram-pingpong (Rich Trott) [#5125](https://github.com/nodejs/node/pull/5125) +* [[`63884f57dd`](https://github.com/nodejs/node/commit/63884f57dd)] - **test**: mark flaky tests on Raspberry Pi (Rich Trott) [#5082](https://github.com/nodejs/node/pull/5082) +* [[`09917c99d8`](https://github.com/nodejs/node/commit/09917c99d8)] - **test**: fix `net-socket-timeout-unref` flakiness (Santiago Gimeno) [#4772](https://github.com/nodejs/node/pull/4772) +* [[`83da19aa48`](https://github.com/nodejs/node/commit/83da19aa48)] - **test**: fix redeclared test-event-emitter-* vars (Rich Trott) [#4985](https://github.com/nodejs/node/pull/4985) +* [[`87b27c913d`](https://github.com/nodejs/node/commit/87b27c913d)] - **test**: fix redeclared test-intl var (Rich Trott) [#4988](https://github.com/nodejs/node/pull/4988) +* [[`e98772d68e`](https://github.com/nodejs/node/commit/e98772d68e)] - **test**: remove redeclared var in test-domain (Rich Trott) [#4984](https://github.com/nodejs/node/pull/4984) +* [[`443d0463ca`](https://github.com/nodejs/node/commit/443d0463ca)] - **test**: add common.platformTimeout() to dgram test (Rich Trott) [#4938](https://github.com/nodejs/node/pull/4938) +* [[`90219c3398`](https://github.com/nodejs/node/commit/90219c3398)] - **test**: fix flaky cluster test on Windows 10 (Rich Trott) [#4934](https://github.com/nodejs/node/pull/4934) +* [[`3488fa81b5`](https://github.com/nodejs/node/commit/3488fa81b5)] - **test**: fix variable redeclarations (Rich Trott) [#4992](https://github.com/nodejs/node/pull/4992) +* [[`7dc0905d4d`](https://github.com/nodejs/node/commit/7dc0905d4d)] - **test**: fix redeclared test-util-* vars (Rich Trott) [#4994](https://github.com/nodejs/node/pull/4994) +* [[`53e7d605c9`](https://github.com/nodejs/node/commit/53e7d605c9)] - **test**: fix redeclared vars in sequential tests (Rich Trott) [#4999](https://github.com/nodejs/node/pull/4999) +* [[`a62ace9f7e`](https://github.com/nodejs/node/commit/a62ace9f7e)] - **test**: fix tls-no-rsa-key flakiness (Santiago Gimeno) [#4043](https://github.com/nodejs/node/pull/4043) +* [[`9b8f025816`](https://github.com/nodejs/node/commit/9b8f025816)] - **test**: fix redeclared vars in test-url (Rich Trott) [#4993](https://github.com/nodejs/node/pull/4993) +* [[`51fb8845d5`](https://github.com/nodejs/node/commit/51fb8845d5)] - **test**: fix redeclared test-path vars (Rich Trott) [#4991](https://github.com/nodejs/node/pull/4991) +* [[`b16b360ae8`](https://github.com/nodejs/node/commit/b16b360ae8)] - **test**: fix var redeclarations in test-os (Rich Trott) [#4990](https://github.com/nodejs/node/pull/4990) +* [[`d6199773e8`](https://github.com/nodejs/node/commit/d6199773e8)] - **test**: fix test-net-* variable redeclarations (Rich Trott) [#4989](https://github.com/nodejs/node/pull/4989) +* [[`9dd5b3e01b`](https://github.com/nodejs/node/commit/9dd5b3e01b)] - **test**: fix redeclared test-http-* vars (Rich Trott) [#4987](https://github.com/nodejs/node/pull/4987) +* [[`835bf13c1d`](https://github.com/nodejs/node/commit/835bf13c1d)] - **test**: fix var redeclarations in test-fs-* (Rich Trott) [#4986](https://github.com/nodejs/node/pull/4986) +* [[`71d7a4457d`](https://github.com/nodejs/node/commit/71d7a4457d)] - **test**: fix redeclared vars in test-vm-* (Rich Trott) [#4997](https://github.com/nodejs/node/pull/4997) +* [[`38459402a5`](https://github.com/nodejs/node/commit/38459402a5)] - **test**: fix inconsistent styling in test-url (Brian White) [#5014](https://github.com/nodejs/node/pull/5014) +* [[`4934798c0d`](https://github.com/nodejs/node/commit/4934798c0d)] - **test**: pummel test fixes (Rich Trott) [#4998](https://github.com/nodejs/node/pull/4998) +* [[`3970504298`](https://github.com/nodejs/node/commit/3970504298)] - **test**: remove var redeclarations in test-crypto-* (Rich Trott) [#4981](https://github.com/nodejs/node/pull/4981) +* [[`a2881e2187`](https://github.com/nodejs/node/commit/a2881e2187)] - **test**: remove test-cluster-* var redeclarations (Rich Trott) [#4980](https://github.com/nodejs/node/pull/4980) +* [[`c3d93299c2`](https://github.com/nodejs/node/commit/c3d93299c2)] - **test**: fix test-http-extra-response flakiness (Santiago Gimeno) [#4979](https://github.com/nodejs/node/pull/4979) +* [[`0384a43885`](https://github.com/nodejs/node/commit/0384a43885)] - **test**: Add assertion for TLS peer certificate fingerprint (Alan Cohen) [#4923](https://github.com/nodejs/node/pull/4923) +* [[`48a353fe41`](https://github.com/nodejs/node/commit/48a353fe41)] - **test**: scope redeclared vars in test-child-process* (Rich Trott) [#4944](https://github.com/nodejs/node/pull/4944) +* [[`89d1149467`](https://github.com/nodejs/node/commit/89d1149467)] - **test**: fix test-tls-zero-clear-in flakiness (Santiago Gimeno) [#4888](https://github.com/nodejs/node/pull/4888) +* [[`f7ed47341a`](https://github.com/nodejs/node/commit/f7ed47341a)] - **test**: remove Object.observe from tests (Vladimir Kurchatkin) [#4769](https://github.com/nodejs/node/pull/4769) +* [[`d95e53dc3b`](https://github.com/nodejs/node/commit/d95e53dc3b)] - **test**: refactor switch (Rich Trott) [#4870](https://github.com/nodejs/node/pull/4870) +* [[`7f1e3e929a`](https://github.com/nodejs/node/commit/7f1e3e929a)] - **test**: remove race condition in http flood test (Rich Trott) [#4793](https://github.com/nodejs/node/pull/4793) +* [[`6539c64e67`](https://github.com/nodejs/node/commit/6539c64e67)] - **test**: scope redeclared variable (Rich Trott) [#4854](https://github.com/nodejs/node/pull/4854) +* [[`62fb941557`](https://github.com/nodejs/node/commit/62fb941557)] - **test**: fix irregular whitespace issue (Roman Reiss) [#4864](https://github.com/nodejs/node/pull/4864) +* [[`3b225209f0`](https://github.com/nodejs/node/commit/3b225209f0)] - **test**: fs.link() test runs on same device (Drew Folta) [#4861](https://github.com/nodejs/node/pull/4861) +* [[`1860eae110`](https://github.com/nodejs/node/commit/1860eae110)] - **test**: refactor test-net-settimeout (Rich Trott) [#4799](https://github.com/nodejs/node/pull/4799) +* [[`ae9a8cd053`](https://github.com/nodejs/node/commit/ae9a8cd053)] - **test**: mark test-tick-processor flaky (Rich Trott) [#4809](https://github.com/nodejs/node/pull/4809) +* [[`57cea9e421`](https://github.com/nodejs/node/commit/57cea9e421)] - **test**: remove test-http-exit-delay (Rich Trott) [#4786](https://github.com/nodejs/node/pull/4786) +* [[`2119c76d5a`](https://github.com/nodejs/node/commit/2119c76d5a)] - **test**: refactor test-fs-watch (Rich Trott) [#4776](https://github.com/nodejs/node/pull/4776) +* [[`e487b72459`](https://github.com/nodejs/node/commit/e487b72459)] - **test**: move cluster tests to parallel (Rich Trott) [#4774](https://github.com/nodejs/node/pull/4774) +* [[`8c694a658c`](https://github.com/nodejs/node/commit/8c694a658c)] - **test**: improve test-cluster-disconnect-suicide-race (Rich Trott) [#4739](https://github.com/nodejs/node/pull/4739) +* [[`14f5bb7a99`](https://github.com/nodejs/node/commit/14f5bb7a99)] - **test,buffer**: refactor redeclarations (Rich Trott) [#4893](https://github.com/nodejs/node/pull/4893) +* [[`62479e3406`](https://github.com/nodejs/node/commit/62479e3406)] - **tls**: scope loop vars with let (Rich Trott) [#4853](https://github.com/nodejs/node/pull/4853) +* [[`d6fbd81a7a`](https://github.com/nodejs/node/commit/d6fbd81a7a)] - **tls_wrap**: reach error reporting for UV_EPROTO (Fedor Indutny) [#4885](https://github.com/nodejs/node/pull/4885) +* [[`f75d06bf10`](https://github.com/nodejs/node/commit/f75d06bf10)] - **tools**: lint for empty character classes in regex (Rich Trott) [#5115](https://github.com/nodejs/node/pull/5115) +* [[`53cbd0564f`](https://github.com/nodejs/node/commit/53cbd0564f)] - **tools**: lint for spacing around unary operators (Rich Trott) [#5063](https://github.com/nodejs/node/pull/5063) +* [[`7fa5959c59`](https://github.com/nodejs/node/commit/7fa5959c59)] - **tools**: fix redeclared vars in doc/json.js (Rich Trott) [#5047](https://github.com/nodejs/node/pull/5047) +* [[`e95fd6ae70`](https://github.com/nodejs/node/commit/e95fd6ae70)] - **tools**: apply linting to doc tools (Rich Trott) [#4973](https://github.com/nodejs/node/pull/4973) +* [[`777ed82162`](https://github.com/nodejs/node/commit/777ed82162)] - **tools**: fix detecting constructor for JSON doc (Timothy Gu) [#4966](https://github.com/nodejs/node/pull/4966) +* [[`5d55f59c85`](https://github.com/nodejs/node/commit/5d55f59c85)] - **tools**: add property types in JSON documentation (Timothy Gu) [#4884](https://github.com/nodejs/node/pull/4884) +* [[`fd5c56698e`](https://github.com/nodejs/node/commit/fd5c56698e)] - **tools**: add support for subkeys in release tools (Myles Borins) [#4807](https://github.com/nodejs/node/pull/4807) +* [[`34df6a5c0c`](https://github.com/nodejs/node/commit/34df6a5c0c)] - **tools**: enable assorted ESLint error rules (Roman Reiss) [#4864](https://github.com/nodejs/node/pull/4864) +* [[`386ad7e0b5`](https://github.com/nodejs/node/commit/386ad7e0b5)] - **tools**: fix setting path containing an ampersand (Brian White) [#4804](https://github.com/nodejs/node/pull/4804) +* [[`e415eb27e5`](https://github.com/nodejs/node/commit/e415eb27e5)] - **url**: change scoping of variables with let (Kári Tristan Helgason) [#4867](https://github.com/nodejs/node/pull/4867) + +## 2016-01-20, Version 5.5.0 (Stable), @evanlucas + +### Notable Changes + +- **events**: make sure console functions exist (Dave) [#4479](https://github.com/nodejs/node/pull/4479) +- **fs**: add autoClose option to fs.createWriteStream (Saquib) [#3679](https://github.com/nodejs/node/pull/3679) +- **http**: improves expect header handling (Daniel Sellers) [#4501](https://github.com/nodejs/node/pull/4501) +- **node**: allow preload modules with -i (Evan Lucas) [#4696](https://github.com/nodejs/node/pull/4696) +- **v8,src**: expose statistics about heap spaces (`v8.getHeapSpaceStatistics()`) (Ben Ripkens) [#4463](https://github.com/nodejs/node/pull/4463) +* Minor performance improvements: + - **lib**: Use arrow functions instead of bind where possible (Minwoo Jung) [#3622](https://github.com/nodejs/node/pull/3622). + - (Mistakenly missing from v5.4.0) + - **module**: cache stat() results more aggressively (Ben Noordhuis) [#4575](https://github.com/nodejs/node/pull/4575) + - **querystring**: improve parse() performance (Brian White) [#4675](https://github.com/nodejs/node/pull/4675) + +### Known issues + +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). +* Unicode characters in filesystem paths are not handled consistently across platforms or Node.js APIs. See [#2088](https://github.com/nodejs/node/issues/2088), [#3401](https://github.com/nodejs/node/issues/3401) and [#3519](https://github.com/nodejs/node/issues/3519). + +### Commits + +* [[`8d0ca10752`](https://github.com/nodejs/node/commit/8d0ca10752)] - **buffer**: make byteLength work with Buffer correctly (Jackson Tian) [#4738](https://github.com/nodejs/node/pull/4738) +* [[`83d2b7707e`](https://github.com/nodejs/node/commit/83d2b7707e)] - **buffer**: remove unnecessary TODO comments (Peter Geiss) [#4719](https://github.com/nodejs/node/pull/4719) +* [[`8182ec094d`](https://github.com/nodejs/node/commit/8182ec094d)] - **build**: add option to select VS version (julien.waechter) [#4645](https://github.com/nodejs/node/pull/4645) +* [[`4383acd9f4`](https://github.com/nodejs/node/commit/4383acd9f4)] - **build**: fix and refactor VTune config in vcbuild.bat (Rod Vagg) [#4192](https://github.com/nodejs/node/pull/4192) +* [[`be0b0b8cb9`](https://github.com/nodejs/node/commit/be0b0b8cb9)] - **build**: minor corrections in VTune configure text (Rod Vagg) [#4192](https://github.com/nodejs/node/pull/4192) +* [[`9571be12f6`](https://github.com/nodejs/node/commit/9571be12f6)] - **cluster**: fix race condition setting suicide prop (Santiago Gimeno) [#4349](https://github.com/nodejs/node/pull/4349) +* [[`ebd9addcd1`](https://github.com/nodejs/node/commit/ebd9addcd1)] - **crypto**: clear error stack in ECDH::Initialize (Fedor Indutny) [#4689](https://github.com/nodejs/node/pull/4689) +* [[`66b9c0d8bd`](https://github.com/nodejs/node/commit/66b9c0d8bd)] - **debugger**: remove variable redeclarations (Rich Trott) [#4633](https://github.com/nodejs/node/pull/4633) +* [[`88b2889679`](https://github.com/nodejs/node/commit/88b2889679)] - **dgram**: prevent disabled optimization of bind() (Brian White) [#4613](https://github.com/nodejs/node/pull/4613) +* [[`d56e3f8b67`](https://github.com/nodejs/node/commit/d56e3f8b67)] - **doc**: restore ICU third-party software licenses (Richard Lau) [#4762](https://github.com/nodejs/node/pull/4762) +* [[`212a44df03`](https://github.com/nodejs/node/commit/212a44df03)] - **doc**: clarify protocol default in http.request() (cjihrig) [#4714](https://github.com/nodejs/node/pull/4714) +* [[`3297036345`](https://github.com/nodejs/node/commit/3297036345)] - **doc**: update branch-diff arguments in release doc (Rod Vagg) [#4691](https://github.com/nodejs/node/pull/4691) +* [[`666c089e68`](https://github.com/nodejs/node/commit/666c089e68)] - **doc**: fix named anchors in addons.markdown and http.markdown (Michael Theriot) [#4708](https://github.com/nodejs/node/pull/4708) +* [[`310530b7ec`](https://github.com/nodejs/node/commit/310530b7ec)] - **doc**: add path property to Write/ReadStream in fs.markdown (Claudio Rodriguez) [#4368](https://github.com/nodejs/node/pull/4368) +* [[`3470574cb6`](https://github.com/nodejs/node/commit/3470574cb6)] - **doc**: clarify explanation of first stream section (Vitor Cortez) [#4234](https://github.com/nodejs/node/pull/4234) +* [[`d91646b9c7`](https://github.com/nodejs/node/commit/d91646b9c7)] - **doc**: rebuild LICENSE using tools/license-builder.sh (Rod Vagg) [#4194](https://github.com/nodejs/node/pull/4194) +* [[`265e2f557b`](https://github.com/nodejs/node/commit/265e2f557b)] - **doc**: fix typo in doc/node.1 (Jérémy Lal) [#4680](https://github.com/nodejs/node/pull/4680) +* [[`4c132fe61e`](https://github.com/nodejs/node/commit/4c132fe61e)] - **doc**: make references clickable (Roman Klauke) [#4654](https://github.com/nodejs/node/pull/4654) +* [[`d139704ff7`](https://github.com/nodejs/node/commit/d139704ff7)] - **doc**: improve child_process.execFile() code example (Ryan Sobol) [#4504](https://github.com/nodejs/node/pull/4504) +* [[`eeb6fdcd0f`](https://github.com/nodejs/node/commit/eeb6fdcd0f)] - **doc**: add docs for more stream options (zoubin) [#4639](https://github.com/nodejs/node/pull/4639) +* [[`b6ab6d2de5`](https://github.com/nodejs/node/commit/b6ab6d2de5)] - **doc**: add branch-diff example to releases.md (Myles Borins) [#4636](https://github.com/nodejs/node/pull/4636) +* [[`287325c5e8`](https://github.com/nodejs/node/commit/287325c5e8)] - **docs**: update gpg key for Myles Borins (Myles Borins) [#4657](https://github.com/nodejs/node/pull/4657) +* [[`65825b79aa`](https://github.com/nodejs/node/commit/65825b79aa)] - **docs**: fix npm command in releases.md (Myles Borins) [#4656](https://github.com/nodejs/node/pull/4656) +* [[`f9a59c1d3b`](https://github.com/nodejs/node/commit/f9a59c1d3b)] - **(SEMVER-MINOR)** **events**: make sure console functions exist (Dave) [#4479](https://github.com/nodejs/node/pull/4479) +* [[`6039a7c1b5`](https://github.com/nodejs/node/commit/6039a7c1b5)] - **(SEMVER-MINOR)** **fs**: add autoClose option to fs.createWriteStream (Saquib) [#3679](https://github.com/nodejs/node/pull/3679) +* [[`ed55169834`](https://github.com/nodejs/node/commit/ed55169834)] - **gitignore**: never ignore debug module (Michaël Zasso) [#2286](https://github.com/nodejs/node/pull/2286) +* [[`d755432fa9`](https://github.com/nodejs/node/commit/d755432fa9)] - **(SEMVER-MINOR)** **http**: improves expect header handling (Daniel Sellers) [#4501](https://github.com/nodejs/node/pull/4501) +* [[`7ce0e04f44`](https://github.com/nodejs/node/commit/7ce0e04f44)] - **lib**: fix style issues after eslint update (Michaël Zasso) [nodejs/io.js#2286](https://github.com/nodejs/io.js/pull/2286) +* [[`ae5bcf9528`](https://github.com/nodejs/node/commit/ae5bcf9528)] - **lib**: use arrow functions instead of bind (Minwoo Jung) [#3622](https://github.com/nodejs/node/pull/3622) +* [[`0ec093cd41`](https://github.com/nodejs/node/commit/0ec093cd41)] - **lib,test**: remove extra semicolons (Michaël Zasso) [#2205](https://github.com/nodejs/node/pull/2205) +* [[`d8f5bd4fe1`](https://github.com/nodejs/node/commit/d8f5bd4fe1)] - **module**: avoid ArgumentsAdaptorTrampoline frame (Ben Noordhuis) [#4575](https://github.com/nodejs/node/pull/4575) +* [[`83f8d98806`](https://github.com/nodejs/node/commit/83f8d98806)] - **module**: cache stat() results more aggressively (Ben Noordhuis) [#4575](https://github.com/nodejs/node/pull/4575) +* [[`ff64a4c395`](https://github.com/nodejs/node/commit/ff64a4c395)] - **(SEMVER-MINOR)** **node**: allow preload modules with -i (Evan Lucas) [#4696](https://github.com/nodejs/node/pull/4696) +* [[`4bc1a47761`](https://github.com/nodejs/node/commit/4bc1a47761)] - **querystring**: improve parse() performance (Brian White) [#4675](https://github.com/nodejs/node/pull/4675) +* [[`ad63d350d4`](https://github.com/nodejs/node/commit/ad63d350d4)] - **readline**: Remove XXX and output debuglog (Kohei TAKATA) [#4690](https://github.com/nodejs/node/pull/4690) +* [[`da550aa063`](https://github.com/nodejs/node/commit/da550aa063)] - **repl**: make sure historyPath is trimmed (Evan Lucas) [#4539](https://github.com/nodejs/node/pull/4539) +* [[`1a6e7d1b52`](https://github.com/nodejs/node/commit/1a6e7d1b52)] - **src**: fix negative values in process.hrtime() (Ben Noordhuis) [#4757](https://github.com/nodejs/node/pull/4757) +* [[`8bad51977a`](https://github.com/nodejs/node/commit/8bad51977a)] - **src**: return UV_EAI_NODATA on empty lookup (cjihrig) [#4715](https://github.com/nodejs/node/pull/4715) +* [[`761cf2bf6a`](https://github.com/nodejs/node/commit/761cf2bf6a)] - **src**: don't check failure with ERR_peek_error() (Ben Noordhuis) [#4731](https://github.com/nodejs/node/pull/4731) +* [[`953f4a3999`](https://github.com/nodejs/node/commit/953f4a3999)] - **stream**: prevent object map change in ReadableState (Evan Lucas) [#4761](https://github.com/nodejs/node/pull/4761) +* [[`e65f1f7954`](https://github.com/nodejs/node/commit/e65f1f7954)] - **test**: fix tls-multi-key race condition (Santiago Gimeno) [#3966](https://github.com/nodejs/node/pull/3966) +* [[`3727ae0d7d`](https://github.com/nodejs/node/commit/3727ae0d7d)] - **test**: use addon.md block headings as test dir names (Rod Vagg) [#4412](https://github.com/nodejs/node/pull/4412) +* [[`47960a07c0`](https://github.com/nodejs/node/commit/47960a07c0)] - **test**: make test-cluster-disconnect-leak reliable (Rich Trott) [#4736](https://github.com/nodejs/node/pull/4736) +* [[`9926b5a25f`](https://github.com/nodejs/node/commit/9926b5a25f)] - **test**: fix issues for space-in-parens ESLint rule (Roman Reiss) [#4753](https://github.com/nodejs/node/pull/4753) +* [[`d1aabd6264`](https://github.com/nodejs/node/commit/d1aabd6264)] - **test**: fix style issues after eslint update (Michaël Zasso) [nodejs/io.js#2286](https://github.com/nodejs/io.js/pull/2286) +* [[`e98bcfa2cb`](https://github.com/nodejs/node/commit/e98bcfa2cb)] - **test**: remove 1 second delay from test (Rich Trott) [#4616](https://github.com/nodejs/node/pull/4616) +* [[`6cfd0b5a32`](https://github.com/nodejs/node/commit/6cfd0b5a32)] - **test**: fix flaky test-net-socket-local-address (cjihrig) [#4650](https://github.com/nodejs/node/pull/4650) +* [[`e22cc6c2eb`](https://github.com/nodejs/node/commit/e22cc6c2eb)] - **test**: fix race in test-net-server-pause-on-connect (Rich Trott) [#4637](https://github.com/nodejs/node/pull/4637) +* [[`9164c00bdb`](https://github.com/nodejs/node/commit/9164c00bdb)] - **test**: move resource intensive tests to sequential (Rich Trott) [#4615](https://github.com/nodejs/node/pull/4615) +* [[`d8ba2c0de4`](https://github.com/nodejs/node/commit/d8ba2c0de4)] - **test**: fix `http-upgrade-client` flakiness (Santiago Gimeno) [#4602](https://github.com/nodejs/node/pull/4602) +* [[`6018fa1f57`](https://github.com/nodejs/node/commit/6018fa1f57)] - **test**: fix `http-upgrade-agent` flakiness (Santiago Gimeno) [#4520](https://github.com/nodejs/node/pull/4520) +* [[`c33f6a87d0`](https://github.com/nodejs/node/commit/c33f6a87d0)] - **tools**: enable space-in-parens ESLint rule (Roman Reiss) [#4753](https://github.com/nodejs/node/pull/4753) +* [[`162e16afdb`](https://github.com/nodejs/node/commit/162e16afdb)] - **tools**: enable no-extra-semi rule in eslint (Michaël Zasso) [#2205](https://github.com/nodejs/node/pull/2205) +* [[`031b87d42d`](https://github.com/nodejs/node/commit/031b87d42d)] - **tools**: add license-builder.sh to construct LICENSE (Rod Vagg) [#4194](https://github.com/nodejs/node/pull/4194) +* [[`ec8e0ae697`](https://github.com/nodejs/node/commit/ec8e0ae697)] - **tools**: fix style issue after eslint update (Michaël Zasso) [nodejs/io.js#2286](https://github.com/nodejs/io.js/pull/2286) +* [[`4d5ee7a512`](https://github.com/nodejs/node/commit/4d5ee7a512)] - **tools**: update eslint config (Michaël Zasso) [nodejs/io.js#2286](https://github.com/nodejs/io.js/pull/2286) +* [[`2d441493a4`](https://github.com/nodejs/node/commit/2d441493a4)] - **tools**: update eslint to v1.10.3 (Michaël Zasso) [nodejs/io.js#2286](https://github.com/nodejs/io.js/pull/2286) +* [[`aba3cc834e`](https://github.com/nodejs/node/commit/aba3cc834e)] - **tools**: fix license-builder.sh for ICU (Richard Lau) [#4762](https://github.com/nodejs/node/pull/4762) +* [[`5f57005ec9`](https://github.com/nodejs/node/commit/5f57005ec9)] - **(SEMVER-MINOR)** **v8,src**: expose statistics about heap spaces (Ben Ripkens) [#4463](https://github.com/nodejs/node/pull/4463) + +## 2016-01-12, Version 5.4.1 (Stable), @TheAlphaNerd + +### Notable Changes + +* Minor performance improvements: + - **module**: move unnecessary work for early return (Andres Suarez) [#3579](https://github.com/nodejs/node/pull/3579) +* Various bug fixes +* Various doc fixes +* Various test improvements + +### Known issues + +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). +* Unicode characters in filesystem paths are not handled consistently across platforms or Node.js APIs. See [#2088](https://github.com/nodejs/node/issues/2088), [#3401](https://github.com/nodejs/node/issues/3401) and [#3519](https://github.com/nodejs/node/issues/3519). + +### commits + +* [[`ff539c5bb5`](https://github.com/nodejs/node/commit/ff539c5bb5)] - **cluster**: ignore queryServer msgs on disconnection (Santiago Gimeno) [#4465](https://github.com/nodejs/node/pull/4465) +* [[`00148b3de1`](https://github.com/nodejs/node/commit/00148b3de1)] - **deps**: backport 066747e from upstream V8 (Ali Ijaz Sheikh) [#4625](https://github.com/nodejs/node/pull/4625) +* [[`3912b5cbda`](https://github.com/nodejs/node/commit/3912b5cbda)] - **doc**: adds usage of readline line-by-line parsing (Robert Jefe Lindstaedt) [#4609](https://github.com/nodejs/node/pull/4609) +* [[`102fb7d3a1`](https://github.com/nodejs/node/commit/102fb7d3a1)] - **doc**: remove "above" and "below" references (Richard Sun) [#4499](https://github.com/nodejs/node/pull/4499) +* [[`df87176ae0`](https://github.com/nodejs/node/commit/df87176ae0)] - **doc**: update stylesheet to match frontpage (Roman Reiss) [#4621](https://github.com/nodejs/node/pull/4621) +* [[`ede98d1f98`](https://github.com/nodejs/node/commit/ede98d1f98)] - **doc**: stronger suggestion for userland assert (Wyatt Preul) [#4535](https://github.com/nodejs/node/pull/4535) +* [[`fdfc72c977`](https://github.com/nodejs/node/commit/fdfc72c977)] - **doc**: label http.IncomingMessage as a Class (Sequoia McDowell) [#4589](https://github.com/nodejs/node/pull/4589) +* [[`b181e26975`](https://github.com/nodejs/node/commit/b181e26975)] - **doc**: document http's server.listen return value (Sequoia McDowell) [#4590](https://github.com/nodejs/node/pull/4590) +* [[`97aaeb8519`](https://github.com/nodejs/node/commit/97aaeb8519)] - **doc**: fix description about the latest-codename (Minwoo Jung) [#4583](https://github.com/nodejs/node/pull/4583) +* [[`0126615d1e`](https://github.com/nodejs/node/commit/0126615d1e)] - **doc**: add Evan Lucas to Release Team (Evan Lucas) [#4579](https://github.com/nodejs/node/pull/4579) +* [[`ec73c69412`](https://github.com/nodejs/node/commit/ec73c69412)] - **doc**: add Myles Borins to Release Team (Myles Borins) [#4578](https://github.com/nodejs/node/pull/4578) +* [[`e703c9a4e2`](https://github.com/nodejs/node/commit/e703c9a4e2)] - **doc**: bring releases.md up to date (cjihrig) [#4540](https://github.com/nodejs/node/pull/4540) +* [[`ac1108d5e7`](https://github.com/nodejs/node/commit/ac1108d5e7)] - **doc**: add missing backtick for readline (Brian White) [#4549](https://github.com/nodejs/node/pull/4549) +* [[`09bc0c6a05`](https://github.com/nodejs/node/commit/09bc0c6a05)] - **doc**: improvements to crypto.markdown copy (James M Snell) [#4435](https://github.com/nodejs/node/pull/4435) +* [[`787c5d96bd`](https://github.com/nodejs/node/commit/787c5d96bd)] - **http**: remove variable redeclaration (Rich Trott) [#4612](https://github.com/nodejs/node/pull/4612) +* [[`145b66820f`](https://github.com/nodejs/node/commit/145b66820f)] - **module**: move unnecessary work for early return (Andres Suarez) [#3579](https://github.com/nodejs/node/pull/3579) +* [[`ffb7deb443`](https://github.com/nodejs/node/commit/ffb7deb443)] - **net**: remove hot path comment from connect (Evan Lucas) [#4648](https://github.com/nodejs/node/pull/4648) +* [[`799aa74d90`](https://github.com/nodejs/node/commit/799aa74d90)] - **net**: fix dns lookup for android (Josh Dague) [#4580](https://github.com/nodejs/node/pull/4580) +* [[`9accebe087`](https://github.com/nodejs/node/commit/9accebe087)] - **net, doc**: fix line wrapping lint in net.js (James M Snell) [#4588](https://github.com/nodejs/node/pull/4588) +* [[`37a546b490`](https://github.com/nodejs/node/commit/37a546b490)] - **src**: remove redeclarations of variables (Rich Trott) [#4605](https://github.com/nodejs/node/pull/4605) +* [[`b515ccc2a1`](https://github.com/nodejs/node/commit/b515ccc2a1)] - **stream**: remove useless if test in transform (zoubin) [#4617](https://github.com/nodejs/node/pull/4617) +* [[`ea6e26d904`](https://github.com/nodejs/node/commit/ea6e26d904)] - **test**: remove duplicate fork module import (Rich Trott) [#4634](https://github.com/nodejs/node/pull/4634) +* [[`b14b2aec5e`](https://github.com/nodejs/node/commit/b14b2aec5e)] - **test**: require common module only once (Rich Trott) [#4611](https://github.com/nodejs/node/pull/4611) +* [[`f28a640505`](https://github.com/nodejs/node/commit/f28a640505)] - **test**: only include http module once (Rich Trott) [#4606](https://github.com/nodejs/node/pull/4606) +* [[`6f9a96f497`](https://github.com/nodejs/node/commit/6f9a96f497)] - **test**: fix flaky unrefed timers test (Rich Trott) [#4599](https://github.com/nodejs/node/pull/4599) +* [[`b70eec8f7b`](https://github.com/nodejs/node/commit/b70eec8f7b)] - **tls_legacy**: do not read on OpenSSL's stack (Fedor Indutny) [#4624](https://github.com/nodejs/node/pull/4624) + +## 2016-01-06, Version 5.4.0 (Stable), @Fishrock123 + +### Notable changes + +* **http**: + - A new status code was added: 451 - "Unavailable For Legal Reasons" (Max Barinov) [#4377](https://github.com/nodejs/node/pull/4377). + - Idle sockets that have been kept alive now handle errors (José F. Romaniello) [#4482](https://github.com/nodejs/node/pull/4482). +* This release also includes several minor performance improvements: + - **assert**: deepEqual is now speedier when comparing TypedArrays (Claudio Rodriguez) [#4330](https://github.com/nodejs/node/pull/4330). + - **lib**: Use arrow functions instead of bind where possible (Minwoo Jung) [node#3622](https://github.com/nodejs/node/pull/3622). + - **node**: Improved accessor perf of `process.env` (Trevor Norris) [#3780](https://github.com/nodejs/node/pull/3780). + - **node**: Improved performance of `process.hrtime()` (Trevor Norris) [#3780](https://github.com/nodejs/node/pull/3780), (Evan Lucas) [#4484](https://github.com/nodejs/node/pull/4484). + - **node**: Improved GetActiveHandles performance (Trevor Norris) [#3780](https://github.com/nodejs/node/pull/3780). + - **util**: Use faster iteration in `util.format()` (Jackson Tian) [#3964](https://github.com/nodejs/node/pull/3964). + +### Known issues + +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). +* Unicode characters in filesystem paths are not handled consistently across platforms or Node.js APIs. See [#2088](https://github.com/nodejs/node/issues/2088), [#3401](https://github.com/nodejs/node/issues/3401) and [#3519](https://github.com/nodejs/node/issues/3519). + +### Commits + +* [[`d265fc821a`](https://github.com/nodejs/node/commit/d265fc821a)] - **assert**: typed array deepequal performance fix (Claudio Rodriguez) [#4330](https://github.com/nodejs/node/pull/4330) +* [[`6d8053ab56`](https://github.com/nodejs/node/commit/6d8053ab56)] - **buffer**: faster case for create Buffer from new Buffer(0) (Jackson Tian) [#4326](https://github.com/nodejs/node/pull/4326) +* [[`8781c59878`](https://github.com/nodejs/node/commit/8781c59878)] - **buffer**: refactor create buffer (Jackson Tian) [#4340](https://github.com/nodejs/node/pull/4340) +* [[`252628294b`](https://github.com/nodejs/node/commit/252628294b)] - **child_process**: guard against race condition (Rich Trott) [#4418](https://github.com/nodejs/node/pull/4418) +* [[`fcf632bc6a`](https://github.com/nodejs/node/commit/fcf632bc6a)] - **crypto**: load PFX chain the same way as regular one (Fedor Indutny) [#4165](https://github.com/nodejs/node/pull/4165) +* [[`a5094a35a0`](https://github.com/nodejs/node/commit/a5094a35a0)] - **debugger**: guard against call from non-node context (Ben Noordhuis) [#4328](https://github.com/nodejs/node/pull/4328) +* [[`b4c51c5b76`](https://github.com/nodejs/node/commit/b4c51c5b76)] - **deps**: backport 200315c from V8 upstream (Vladimir Kurchatkin) [#4128](https://github.com/nodejs/node/pull/4128) +* [[`334e73942e`](https://github.com/nodejs/node/commit/334e73942e)] - **doc**: fix heading level error in Buffer doc (Shigeki Ohtsu) [#4537](https://github.com/nodejs/node/pull/4537) +* [[`5be0259181`](https://github.com/nodejs/node/commit/5be0259181)] - **doc**: close backtick in process.title description (Dave) [#4534](https://github.com/nodejs/node/pull/4534) +* [[`35aec4c14d`](https://github.com/nodejs/node/commit/35aec4c14d)] - **doc**: fix numbering in stream.markdown (Richard Sun) [#4538](https://github.com/nodejs/node/pull/4538) +* [[`982f3227a5`](https://github.com/nodejs/node/commit/982f3227a5)] - **doc**: improvements to dgram.markdown copy (James M Snell) [#4437](https://github.com/nodejs/node/pull/4437) +* [[`6cdfa38d23`](https://github.com/nodejs/node/commit/6cdfa38d23)] - **doc**: improvements to errors.markdown copy (James M Snell) [#4454](https://github.com/nodejs/node/pull/4454) +* [[`6c7bcd5007`](https://github.com/nodejs/node/commit/6c7bcd5007)] - **doc**: fix website wg mislink (jona) [#4357](https://github.com/nodejs/node/pull/4357) +* [[`eee50821dc`](https://github.com/nodejs/node/commit/eee50821dc)] - **doc**: mention that http.Server inherits from net.Server (Ryan Sobol) [#4455](https://github.com/nodejs/node/pull/4455) +* [[`c745b4d5f8`](https://github.com/nodejs/node/commit/c745b4d5f8)] - **doc**: explain ClientRequest#setTimeout time unit (Ben Ripkens) [#4458](https://github.com/nodejs/node/pull/4458) +* [[`40076bf7f8`](https://github.com/nodejs/node/commit/40076bf7f8)] - **doc**: fix spelling error in lib/url.js comment (Nik Nyby) [#4390](https://github.com/nodejs/node/pull/4390) +* [[`5a223d64e3`](https://github.com/nodejs/node/commit/5a223d64e3)] - **doc**: add anchors for _transform _flush _writev in stream.markdown (iamchenxin) [#4448](https://github.com/nodejs/node/pull/4448) +* [[`e8bbeecc4c`](https://github.com/nodejs/node/commit/e8bbeecc4c)] - **doc**: improvements to debugger.markdown copy (James M Snell) [#4436](https://github.com/nodejs/node/pull/4436) +* [[`ccd75fe3fb`](https://github.com/nodejs/node/commit/ccd75fe3fb)] - **doc**: improvements to events.markdown copy (James M Snell) [#4468](https://github.com/nodejs/node/pull/4468) +* [[`ed15962777`](https://github.com/nodejs/node/commit/ed15962777)] - **doc**: improvements to dns.markdown copy (James M Snell) [#4449](https://github.com/nodejs/node/pull/4449) +* [[`e177cc9fdf`](https://github.com/nodejs/node/commit/e177cc9fdf)] - **doc**: improvements to console.markdown copy (James M Snell) [#4428](https://github.com/nodejs/node/pull/4428) +* [[`c1bc9a1023`](https://github.com/nodejs/node/commit/c1bc9a1023)] - **doc**: improve child_process.markdown copy (James M Snell) [#4383](https://github.com/nodejs/node/pull/4383) +* [[`150f62847c`](https://github.com/nodejs/node/commit/150f62847c)] - **doc**: copyedit setTimeout() documentation (Rich Trott) [#4434](https://github.com/nodejs/node/pull/4434) +* [[`9e667354be`](https://github.com/nodejs/node/commit/9e667354be)] - **doc**: fix formatting in process.markdown (Rich Trott) [#4433](https://github.com/nodejs/node/pull/4433) +* [[`bc1c0dc3fb`](https://github.com/nodejs/node/commit/bc1c0dc3fb)] - **doc**: catch the WORKING_GROUPS.md bootstrap docs up to date (James M Snell) [#4367](https://github.com/nodejs/node/pull/4367) +* [[`c835ba3601`](https://github.com/nodejs/node/commit/c835ba3601)] - **doc**: improve assert.markdown copy (James M Snell) [#4360](https://github.com/nodejs/node/pull/4360) +* [[`e79eda74c0`](https://github.com/nodejs/node/commit/e79eda74c0)] - **doc**: copyedit releases.md (Rich Trott) [#4384](https://github.com/nodejs/node/pull/4384) +* [[`6450d8667f`](https://github.com/nodejs/node/commit/6450d8667f)] - **doc**: improve grammar in tls docs (Adri Van Houdt) [#4315](https://github.com/nodejs/node/pull/4315) +* [[`474a0f081a`](https://github.com/nodejs/node/commit/474a0f081a)] - **doc**: improvements to buffer.markdown copy (James M Snell) [#4370](https://github.com/nodejs/node/pull/4370) +* [[`57684d650e`](https://github.com/nodejs/node/commit/57684d650e)] - **doc**: improve addons.markdown copy (James M Snell) [#4320](https://github.com/nodejs/node/pull/4320) +* [[`04dd861221`](https://github.com/nodejs/node/commit/04dd861221)] - **doc**: fix, modernize examples in docs (James M Snell) [#4282](https://github.com/nodejs/node/pull/4282) +* [[`5ce6e99474`](https://github.com/nodejs/node/commit/5ce6e99474)] - **doc**: Typo in buffer.markdown referencing buf.write() (chrisjohn404) [#4324](https://github.com/nodejs/node/pull/4324) +* [[`699bf2c464`](https://github.com/nodejs/node/commit/699bf2c464)] - **doc**: fix link in addons.markdown (Nicholas Young) [#4331](https://github.com/nodejs/node/pull/4331) +* [[`e742422757`](https://github.com/nodejs/node/commit/e742422757)] - **fs**: use pushValueToArray for readdir(Sync) (Trevor Norris) [#3780](https://github.com/nodejs/node/pull/3780) +* [[`1dd2d015d2`](https://github.com/nodejs/node/commit/1dd2d015d2)] - **(SEMVER-MINOR)** **http**: handle errors on idle sockets (José F. Romaniello) [#4482](https://github.com/nodejs/node/pull/4482) +* [[`083ae166bb`](https://github.com/nodejs/node/commit/083ae166bb)] - **http**: use `self.keepAlive` instead of `self.options.keepAlive` (Damian Schenkelman) [#4407](https://github.com/nodejs/node/pull/4407) +* [[`ffb4a6e0e4`](https://github.com/nodejs/node/commit/ffb4a6e0e4)] - **http**: fix non-string header value concatenation (Brian White) [#4460](https://github.com/nodejs/node/pull/4460) +* [[`c77fd6829a`](https://github.com/nodejs/node/commit/c77fd6829a)] - **(SEMVER-MINOR)** **http**: 451 status code "Unavailable For Legal Reasons" (Max Barinov) [#4377](https://github.com/nodejs/node/pull/4377) +* [[`8f7af9a489`](https://github.com/nodejs/node/commit/8f7af9a489)] - **http**: remove excess calls to removeSocket (Dave) [#4172](https://github.com/nodejs/node/pull/4172) +* [[`b841967103`](https://github.com/nodejs/node/commit/b841967103)] - **http**: Remove an unnecessary assignment (Bo Borgerson) [#4323](https://github.com/nodejs/node/pull/4323) +* [[`b8366e76dd`](https://github.com/nodejs/node/commit/b8366e76dd)] - **http_parser**: use pushValueToArray for headers (Trevor Norris) [#3780](https://github.com/nodejs/node/pull/3780) +* [[`ca97e7276e`](https://github.com/nodejs/node/commit/ca97e7276e)] - **https**: use `servername` in agent key (Fedor Indutny) [#4389](https://github.com/nodejs/node/pull/4389) +* [[`b5aaccc6af`](https://github.com/nodejs/node/commit/b5aaccc6af)] - **lib**: remove unused modules (Rich Trott) [#4396](https://github.com/nodejs/node/pull/4396) +* [[`921fb540c1`](https://github.com/nodejs/node/commit/921fb540c1)] - **node**: improve performance of process.hrtime() (Evan Lucas) [#4484](https://github.com/nodejs/node/pull/4484) +* [[`ecef817a28`](https://github.com/nodejs/node/commit/ecef817a28)] - **node**: improve accessor perf of process.env (Trevor Norris) [#3780](https://github.com/nodejs/node/pull/3780) +* [[`89f056bdf3`](https://github.com/nodejs/node/commit/89f056bdf3)] - **node**: improve performance of hrtime() (Trevor Norris) [#3780](https://github.com/nodejs/node/pull/3780) +* [[`c8fc217dc7`](https://github.com/nodejs/node/commit/c8fc217dc7)] - **node**: improve GetActiveHandles performance (Trevor Norris) [#3780](https://github.com/nodejs/node/pull/3780) +* [[`8464667071`](https://github.com/nodejs/node/commit/8464667071)] - **node**: fix erroneously named function call (Trevor Norris) [#3780](https://github.com/nodejs/node/pull/3780) +* [[`e57fd51a5e`](https://github.com/nodejs/node/commit/e57fd51a5e)] - **os**: fix crash in GetInterfaceAddresses (Martin Bark) [#4272](https://github.com/nodejs/node/pull/4272) +* [[`65c40d753f`](https://github.com/nodejs/node/commit/65c40d753f)] - **repl**: remove unused function (Rich Trott) +* [[`3d41a44dba`](https://github.com/nodejs/node/commit/3d41a44dba)] - **repl**: Fixed node repl history edge case. (Mudit Ameta) [#4108](https://github.com/nodejs/node/pull/4108) +* [[`d11930d604`](https://github.com/nodejs/node/commit/d11930d604)] - **repl**: use String#repeat instead of Array#join (Evan Lucas) [#3900](https://github.com/nodejs/node/pull/3900) +* [[`4220d25626`](https://github.com/nodejs/node/commit/4220d25626)] - **test**: fix linting for the v5.x branch (Jeremiah Senkpiel) [#4547](https://github.com/nodejs/node/pull/4547) +* [[`4b14f1c983`](https://github.com/nodejs/node/commit/4b14f1c983)] - **test**: remove unused vars (Rich Trott) [#4536](https://github.com/nodejs/node/pull/4536) +* [[`2a69ab32ec`](https://github.com/nodejs/node/commit/2a69ab32ec)] - **test**: add test-domain-exit-dispose-again back (Julien Gilli) [#4256](https://github.com/nodejs/node/pull/4256) +* [[`ae0246641c`](https://github.com/nodejs/node/commit/ae0246641c)] - **test**: remove unused vars from parallel tests (Rich Trott) [#4511](https://github.com/nodejs/node/pull/4511) +* [[`984db93e7c`](https://github.com/nodejs/node/commit/984db93e7c)] - **test**: fix flaky test-cluster-shared-leak (Rich Trott) [#4510](https://github.com/nodejs/node/pull/4510) +* [[`30b0d7583a`](https://github.com/nodejs/node/commit/30b0d7583a)] - **test**: fix flaky streams test (Rich Trott) [#4516](https://github.com/nodejs/node/pull/4516) +* [[`46fefbc1b5`](https://github.com/nodejs/node/commit/46fefbc1b5)] - **test**: fix flaky test-http-agent-keepalive (Rich Trott) [#4524](https://github.com/nodejs/node/pull/4524) +* [[`e04a8401d9`](https://github.com/nodejs/node/commit/e04a8401d9)] - **test**: remove flaky designations for tests (Rich Trott) [#4519](https://github.com/nodejs/node/pull/4519) +* [[`a703b1bf73`](https://github.com/nodejs/node/commit/a703b1bf73)] - **test**: remove time check (Rich Trott) [#4494](https://github.com/nodejs/node/pull/4494) +* [[`02b3a5be52`](https://github.com/nodejs/node/commit/02b3a5be52)] - **test**: refactor test-fs-empty-readStream (Rich Trott) [#4490](https://github.com/nodejs/node/pull/4490) +* [[`ab3e5c1417`](https://github.com/nodejs/node/commit/ab3e5c1417)] - **test**: write to tmp dir rather than fixture dir (Rich Trott) [#4489](https://github.com/nodejs/node/pull/4489) +* [[`06043fdfa3`](https://github.com/nodejs/node/commit/06043fdfa3)] - **test**: remove unused modules (Rich Trott) [#4475](https://github.com/nodejs/node/pull/4475) +* [[`f1a66bc249`](https://github.com/nodejs/node/commit/f1a66bc249)] - **test**: clarify role of domains in test (Rich Trott) [#4474](https://github.com/nodejs/node/pull/4474) +* [[`08a3490dd6`](https://github.com/nodejs/node/commit/08a3490dd6)] - **test**: inherit JOBS from environment (Johan Bergström) [#4495](https://github.com/nodejs/node/pull/4495) +* [[`3bfc18763a`](https://github.com/nodejs/node/commit/3bfc18763a)] - **test**: improve assert message (Rich Trott) [#4461](https://github.com/nodejs/node/pull/4461) +* [[`d46d850461`](https://github.com/nodejs/node/commit/d46d850461)] - **test**: shorten path for bogus socket (Rich Trott) [#4478](https://github.com/nodejs/node/pull/4478) +* [[`f68f86cd0a`](https://github.com/nodejs/node/commit/f68f86cd0a)] - **test**: fix race condition in test-http-client-onerror (Devin Nakamura) [#4346](https://github.com/nodejs/node/pull/4346) +* [[`ec0b6362cf`](https://github.com/nodejs/node/commit/ec0b6362cf)] - **test**: remove unused assert module imports (Rich Trott) [#4438](https://github.com/nodejs/node/pull/4438) +* [[`ba2445046c`](https://github.com/nodejs/node/commit/ba2445046c)] - **test**: don't use cwd for relative path (Johan Bergström) [#4477](https://github.com/nodejs/node/pull/4477) +* [[`5110e4deed`](https://github.com/nodejs/node/commit/5110e4deed)] - **test**: don't assume a certain folder structure (Johan Bergström) [#3325](https://github.com/nodejs/node/pull/3325) +* [[`55c6946400`](https://github.com/nodejs/node/commit/55c6946400)] - **test**: make temp path customizable (Johan Bergström) [#3325](https://github.com/nodejs/node/pull/3325) +* [[`b19d19efaa`](https://github.com/nodejs/node/commit/b19d19efaa)] - **test**: extend timeout in Debug mode (Rich Trott) [#4431](https://github.com/nodejs/node/pull/4431) +* [[`c6a99ddd37`](https://github.com/nodejs/node/commit/c6a99ddd37)] - **test**: remove unused variables from net tests (Rich Trott) [#4430](https://github.com/nodejs/node/pull/4430) +* [[`54004f0e26`](https://github.com/nodejs/node/commit/54004f0e26)] - **test**: remove unused vars in ChildProcess tests (Rich Trott) [#4425](https://github.com/nodejs/node/pull/4425) +* [[`e72112f90e`](https://github.com/nodejs/node/commit/e72112f90e)] - **test**: fix flaky cluster-disconnect-race (Brian White) [#4457](https://github.com/nodejs/node/pull/4457) +* [[`715afc9bbd`](https://github.com/nodejs/node/commit/715afc9bbd)] - **test**: fix flaky cluster-net-send (Brian White) [#4444](https://github.com/nodejs/node/pull/4444) +* [[`03c4bc704f`](https://github.com/nodejs/node/commit/03c4bc704f)] - **test**: fix flaky child-process-fork-regr-gh-2847 (Brian White) [#4442](https://github.com/nodejs/node/pull/4442) +* [[`684eb32072`](https://github.com/nodejs/node/commit/684eb32072)] - **test**: remove unused variables from HTTPS tests (Rich Trott) [#4426](https://github.com/nodejs/node/pull/4426) +* [[`585c01f674`](https://github.com/nodejs/node/commit/585c01f674)] - **test**: remove unused variables from TLS tests (Rich Trott) [#4424](https://github.com/nodejs/node/pull/4424) +* [[`c36ca37e2a`](https://github.com/nodejs/node/commit/c36ca37e2a)] - **test**: remove unused variables form http tests (Rich Trott) [#4422](https://github.com/nodejs/node/pull/4422) +* [[`c639d0f1fe`](https://github.com/nodejs/node/commit/c639d0f1fe)] - **test**: mark test-debug-no-context is flaky (Rich Trott) [#4421](https://github.com/nodejs/node/pull/4421) +* [[`cd79ec268d`](https://github.com/nodejs/node/commit/cd79ec268d)] - **test**: remove unnecessary assignments (Rich Trott) [#4408](https://github.com/nodejs/node/pull/4408) +* [[`0799a9abaf`](https://github.com/nodejs/node/commit/0799a9abaf)] - **test**: remove unused var from test-assert.js (Rich Trott) [#4405](https://github.com/nodejs/node/pull/4405) +* [[`3710028a85`](https://github.com/nodejs/node/commit/3710028a85)] - **test**: remove unused `util` imports (Rich Trott) [#4397](https://github.com/nodejs/node/pull/4397) +* [[`8c9d0c1f6f`](https://github.com/nodejs/node/commit/8c9d0c1f6f)] - **test**: refactor test-net-connect-options-ipv6 (Rich Trott) [#4395](https://github.com/nodejs/node/pull/4395) +* [[`874209022f`](https://github.com/nodejs/node/commit/874209022f)] - **test**: fix http-response-multiheaders (Santiago Gimeno) [#3958](https://github.com/nodejs/node/pull/3958) +* [[`71b79bcf54`](https://github.com/nodejs/node/commit/71b79bcf54)] - **test**: test each block in addon.md contains js & cc (Rod Vagg) [#4411](https://github.com/nodejs/node/pull/4411) +* [[`00b37de243`](https://github.com/nodejs/node/commit/00b37de243)] - **test**: fix domain-top-level-error-handler-throw (Santiago Gimeno) [#4364](https://github.com/nodejs/node/pull/4364) +* [[`6d14b6520f`](https://github.com/nodejs/node/commit/6d14b6520f)] - **test**: use platformTimeout() in more places (Brian White) [#4387](https://github.com/nodejs/node/pull/4387) +* [[`82f74caa56`](https://github.com/nodejs/node/commit/82f74caa56)] - **test**: fix flaky test-net-error-twice (Brian White) [#4342](https://github.com/nodejs/node/pull/4342) +* [[`96501e55be`](https://github.com/nodejs/node/commit/96501e55be)] - **test**: try other ipv6 localhost alternatives (Brian White) [#4325](https://github.com/nodejs/node/pull/4325) +* [[`69343d6d2e`](https://github.com/nodejs/node/commit/69343d6d2e)] - **tls_wrap**: clear errors on return (Fedor Indutny) [#4515](https://github.com/nodejs/node/pull/4515) +* [[`ca9812cf4d`](https://github.com/nodejs/node/commit/ca9812cf4d)] - **tools**: fix warning in doc parsing (Shigeki Ohtsu) [#4537](https://github.com/nodejs/node/pull/4537) +* [[`386030b524`](https://github.com/nodejs/node/commit/386030b524)] - **tools**: implement no-unused-vars for eslint (Rich Trott) [#4536](https://github.com/nodejs/node/pull/4536) +* [[`14a947fc70`](https://github.com/nodejs/node/commit/14a947fc70)] - **tools**: run tick processor without forking (Matt Loring) [#4224](https://github.com/nodejs/node/pull/4224) +* [[`8039ca06eb`](https://github.com/nodejs/node/commit/8039ca06eb)] - **util**: faster arrayToHash (Jackson Tian) [#3964](https://github.com/nodejs/node/pull/3964) + +## 2015-12-16, Version 5.3.0 (Stable), @cjihrig + +### Notable changes + +* **buffer**: + - `Buffer.prototype.includes()` has been added to keep parity with TypedArrays. (Alexander Martin) [#3567](https://github.com/nodejs/node/pull/3567). +* **domains**: + - Fix handling of uncaught exceptions. (Julien Gilli) [#3654](https://github.com/nodejs/node/pull/3654). +* **https**: + - Added support for disabling session caching. (Fedor Indutny) [#4252](https://github.com/nodejs/node/pull/4252). +* **repl**: + - Allow third party modules to be imported using `require()`. This corrects a regression from 5.2.0. (Ben Noordhuis) [#4215](https://github.com/nodejs/node/pull/4215). +* **deps**: + - Upgrade libuv to 1.8.0. (Saúl Ibarra Corretgé) [#4276](https://github.com/nodejs/node/pull/4276). + + +### Known issues + +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). +* Unicode characters in filesystem paths are not handled consistently across platforms or Node.js APIs. See [#2088](https://github.com/nodejs/node/issues/2088), [#3401](https://github.com/nodejs/node/issues/3401) and [#3519](https://github.com/nodejs/node/issues/3519). + +### Commits + +* [[`6ca5ea3860`](https://github.com/nodejs/node/commit/6ca5ea3860)] - 2015-12-09, Version 5.2.0 (Stable) (Rod Vagg) [#4181](https://github.com/nodejs/node/pull/4181) +* [[`da5cdc2207`](https://github.com/nodejs/node/commit/da5cdc2207)] - **assert**: accommodate ES6 classes that extend Error (Rich Trott) [#4166](https://github.com/nodejs/node/pull/4166) +* [[`67e181986a`](https://github.com/nodejs/node/commit/67e181986a)] - **(SEMVER-MINOR)** **buffer**: add includes() for parity with TypedArray (Alexander Martin) [#3567](https://github.com/nodejs/node/pull/3567) +* [[`84dea1bd0c`](https://github.com/nodejs/node/commit/84dea1bd0c)] - **configure**: fix arm vfpv2 (Jörg Krause) [#4203](https://github.com/nodejs/node/pull/4203) +* [[`a7f5dfd14c`](https://github.com/nodejs/node/commit/a7f5dfd14c)] - **configure**: use \_\_ARM\_ARCH to determine arm version (João Reis) [#4123](https://github.com/nodejs/node/pull/4123) +* [[`0e3912be0b`](https://github.com/nodejs/node/commit/0e3912be0b)] - **configure**: respect CC\_host in host arch detection (João Reis) [#4117](https://github.com/nodejs/node/pull/4117) +* [[`69b94ec55c`](https://github.com/nodejs/node/commit/69b94ec55c)] - **deps**: upgrade libuv to 1.8.0 (Saúl Ibarra Corretgé) [#4276](https://github.com/nodejs/node/pull/4276) +* [[`a8854e5b59`](https://github.com/nodejs/node/commit/a8854e5b59)] - **doc**: document the cache parameter for fs.realpathSync (Jackson Tian) [#4285](https://github.com/nodejs/node/pull/4285) +* [[`9e1b7aa874`](https://github.com/nodejs/node/commit/9e1b7aa874)] - **doc**: document backlog for server.listen() variants (Jan Schär) [#4025](https://github.com/nodejs/node/pull/4025) +* [[`435d571f22`](https://github.com/nodejs/node/commit/435d571f22)] - **doc**: update AUTHORS list (Rod Vagg) [#4183](https://github.com/nodejs/node/pull/4183) +* [[`3b3061365a`](https://github.com/nodejs/node/commit/3b3061365a)] - **doc**: update irc channels: #node.js and #node-dev (Nelson Pecora) [#2743](https://github.com/nodejs/node/pull/2743) +* [[`9538fd02e5`](https://github.com/nodejs/node/commit/9538fd02e5)] - **doc**: clarify error events in HTTP module documentation (Lenny Markus) [#4275](https://github.com/nodejs/node/pull/4275) +* [[`c6efd535e4`](https://github.com/nodejs/node/commit/c6efd535e4)] - **doc**: fix improper http.get sample code (Hideki Yamamura) [#4263](https://github.com/nodejs/node/pull/4263) +* [[`498c9adb08`](https://github.com/nodejs/node/commit/498c9adb08)] - **doc**: add CTC meeting minutes 2015-10-28 (Rod Vagg) [#3661](https://github.com/nodejs/node/pull/3661) +* [[`671347cf13`](https://github.com/nodejs/node/commit/671347cf13)] - **doc**: fixup socket.remoteAddress (Arthur Gautier) [#4198](https://github.com/nodejs/node/pull/4198) +* [[`f050cab3d8`](https://github.com/nodejs/node/commit/f050cab3d8)] - **doc**: copyedit console doc (Rich Trott) [#4225](https://github.com/nodejs/node/pull/4225) +* [[`1a21a5368b`](https://github.com/nodejs/node/commit/1a21a5368b)] - **doc**: move description of 'equals' method to right place (janriemer) [#4227](https://github.com/nodejs/node/pull/4227) +* [[`9a9c5259bf`](https://github.com/nodejs/node/commit/9a9c5259bf)] - **doc**: Fixing broken links to the v8 wiki (Tom Gallacher) [#4241](https://github.com/nodejs/node/pull/4241) +* [[`37ed05b8c1`](https://github.com/nodejs/node/commit/37ed05b8c1)] - **doc**: copyedit child_process doc (Rich Trott) [#4188](https://github.com/nodejs/node/pull/4188) +* [[`e47ae5808b`](https://github.com/nodejs/node/commit/e47ae5808b)] - **doc**: copyedit buffer doc (Rich Trott) [#4187](https://github.com/nodejs/node/pull/4187) +* [[`70fb06a90b`](https://github.com/nodejs/node/commit/70fb06a90b)] - **doc**: clarify assert.fail doc (Rich Trott) [#4186](https://github.com/nodejs/node/pull/4186) +* [[`e3187cc81e`](https://github.com/nodejs/node/commit/e3187cc81e)] - **doc**: copyedit addons doc (Rich Trott) [#4185](https://github.com/nodejs/node/pull/4185) +* [[`931ab967ff`](https://github.com/nodejs/node/commit/931ab967ff)] - **doc**: add calvinmetcalf to collaborators (Calvin Metcalf) [#4218](https://github.com/nodejs/node/pull/4218) +* [[`01ce23148b`](https://github.com/nodejs/node/commit/01ce23148b)] - **doc**: add mcollina to collaborators (Matteo Collina) [#4220](https://github.com/nodejs/node/pull/4220) +* [[`bd8753aabf`](https://github.com/nodejs/node/commit/bd8753aabf)] - **doc**: add rmg to collaborators (Ryan Graham) [#4219](https://github.com/nodejs/node/pull/4219) +* [[`73a9a6fc92`](https://github.com/nodejs/node/commit/73a9a6fc92)] - **doc**: harmonize description of `ca` argument (Ben Noordhuis) [#4213](https://github.com/nodejs/node/pull/4213) +* [[`dfc8bedbc5`](https://github.com/nodejs/node/commit/dfc8bedbc5)] - **doc**: change references from node to Node.js (Roman Klauke) [#4177](https://github.com/nodejs/node/pull/4177) +* [[`7a518788e9`](https://github.com/nodejs/node/commit/7a518788e9)] - **doc, test**: symbols as event names (Bryan English) [#4151](https://github.com/nodejs/node/pull/4151) +* [[`425a3545d2`](https://github.com/nodejs/node/commit/425a3545d2)] - **(SEMVER-MINOR)** **domains**: fix handling of uncaught exceptions (Julien Gilli) [#3654](https://github.com/nodejs/node/pull/3654) +* [[`acef181fde`](https://github.com/nodejs/node/commit/acef181fde)] - **(SEMVER-MINOR)** **https**: support disabling session caching (Fedor Indutny) [#4252](https://github.com/nodejs/node/pull/4252) +* [[`2a60e2ad71`](https://github.com/nodejs/node/commit/2a60e2ad71)] - **module,src**: do not wrap modules with -1 lineOffset (cjihrig) [#4298](https://github.com/nodejs/node/pull/4298) +* [[`d3c498b1b7`](https://github.com/nodejs/node/commit/d3c498b1b7)] - **node**: remove unused variables in AppendExceptionLine (Yazhong Liu) [#4264](https://github.com/nodejs/node/pull/4264) +* [[`aad6b9f0eb`](https://github.com/nodejs/node/commit/aad6b9f0eb)] - **repl**: display error message when loading directory (Prince J Wesley) [#4170](https://github.com/nodejs/node/pull/4170) +* [[`213ede6cee`](https://github.com/nodejs/node/commit/213ede6cee)] - **repl**: fix require('3rdparty') regression (Ben Noordhuis) [#4215](https://github.com/nodejs/node/pull/4215) +* [[`f176b31e74`](https://github.com/nodejs/node/commit/f176b31e74)] - **src**: remove \_\_builtin\_bswap16 call (Ben Noordhuis) [#4290](https://github.com/nodejs/node/pull/4290) +* [[`ce2471673f`](https://github.com/nodejs/node/commit/ce2471673f)] - **src**: remove unused BITS_PER_LONG macro (Ben Noordhuis) [#4290](https://github.com/nodejs/node/pull/4290) +* [[`b799a74709`](https://github.com/nodejs/node/commit/b799a74709)] - **src**: fix line numbers on core errors (cjihrig) [#4254](https://github.com/nodejs/node/pull/4254) +* [[`c311b61430`](https://github.com/nodejs/node/commit/c311b61430)] - **src**: fix deprecation message for ErrnoException (Martin von Gagern) [#4269](https://github.com/nodejs/node/pull/4269) +* [[`2859f9ef92`](https://github.com/nodejs/node/commit/2859f9ef92)] - **test**: fix debug-port-cluster flakiness (Ben Noordhuis) [#4310](https://github.com/nodejs/node/pull/4310) +* [[`cb0b4a6bc0`](https://github.com/nodejs/node/commit/cb0b4a6bc0)] - **test**: add test for debugging one line files (cjihrig) [#4298](https://github.com/nodejs/node/pull/4298) +* [[`0b9c3a30d6`](https://github.com/nodejs/node/commit/0b9c3a30d6)] - **test**: add test for tls.parseCertString (Evan Lucas) [#4283](https://github.com/nodejs/node/pull/4283) +* [[`7598ed6cc0`](https://github.com/nodejs/node/commit/7598ed6cc0)] - **test**: parallelize test-repl-persistent-history (Jeremiah Senkpiel) [#4247](https://github.com/nodejs/node/pull/4247) +* [[`668449ad14`](https://github.com/nodejs/node/commit/668449ad14)] - **test**: use regular timeout times for ARMv8 (Jeremiah Senkpiel) [#4248](https://github.com/nodejs/node/pull/4248) +* [[`23e7703c85`](https://github.com/nodejs/node/commit/23e7703c85)] - **test**: fix http-many-ended-pipelines flakiness (Santiago Gimeno) [#4041](https://github.com/nodejs/node/pull/4041) +* [[`3b94991bda`](https://github.com/nodejs/node/commit/3b94991bda)] - **test**: fix tls-inception flakiness (Santiago Gimeno) [#4195](https://github.com/nodejs/node/pull/4195) +* [[`86a3bd09b0`](https://github.com/nodejs/node/commit/86a3bd09b0)] - **test**: fix tls-inception (Santiago Gimeno) [#4195](https://github.com/nodejs/node/pull/4195) +* [[`1e89830a11`](https://github.com/nodejs/node/commit/1e89830a11)] - **test**: don't assume openssl s\_client supports -ssl3 (Ben Noordhuis) [#4204](https://github.com/nodejs/node/pull/4204) +* [[`c5b4f6bc99`](https://github.com/nodejs/node/commit/c5b4f6bc99)] - **(SEMVER-MINOR)** **tls**: introduce `secureContext` for `tls.connect` (Fedor Indutny) [#4246](https://github.com/nodejs/node/pull/4246) +* [[`e0bb118a1d`](https://github.com/nodejs/node/commit/e0bb118a1d)] - **tls_wrap**: inherit from the `AsyncWrap` first (Fedor Indutny) [#4268](https://github.com/nodejs/node/pull/4268) +* [[`d63cceeb10`](https://github.com/nodejs/node/commit/d63cceeb10)] - **tools**: add .editorconfig (ronkorving) [#2993](https://github.com/nodejs/node/pull/2993) +* [[`4b267df93e`](https://github.com/nodejs/node/commit/4b267df93e)] - **udp**: remove a needless instanceof Buffer check (ronkorving) [#4301](https://github.com/nodejs/node/pull/4301) + +## 2015-12-09, Version 5.2.0 (Stable), @rvagg + +### Notable changes + +* **build**: + - Add support for Intel's VTune JIT profiling when compiled with `--enable-vtune-profiling`. For more information about VTune, see . (Chunyang Dai) [#3785](https://github.com/nodejs/node/pull/3785). + - Properly enable V8 snapshots by default. Due to a configuration error, snapshots have been kept off by default when the intention is for the feature to be enabled. (Fedor Indutny) [#3962](https://github.com/nodejs/node/pull/3962). +* **crypto**: + - Simplify use of ECDH (Elliptic Curve Diffie-Hellman) objects (created via `crypto.createECDH(curve_name)`) with private keys that are not dynamically generated via `generateKeys()`. The public key is now computed when explicitly setting a private key. Added validity checks to reduce the possibility of computing weak or invalid shared secrets. Also, deprecated the `setPublicKey()` method for ECDH objects as its usage is unnecessary and can lead to inconsistent state. (Michael Ruddy) [#3511](https://github.com/nodejs/node/pull/3511). + - Update root certificates from the current list stored maintained by Mozilla NSS. (Ben Noordhuis) [#3951](https://github.com/nodejs/node/pull/3951). + - Multiple CA certificates can now be passed with the `ca` option to TLS methods as an array of strings or in a single new-line separated string. (Ben Noordhuis) [#4099](https://github.com/nodejs/node/pull/4099) +* **tools**: Include a tick processor in core, exposed via the `--prof-process` command-line argument which can be used to process V8 profiling output files generated when using the `--prof` command-line argument. (Matt Loring) [#4021](https://github.com/nodejs/node/pull/4021). + + +### Known issues + +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). +* Unicode characters in filesystem paths are not handled consistently across platforms or Node.js APIs. See [#2088](https://github.com/nodejs/node/issues/2088), [#3401](https://github.com/nodejs/node/issues/3401) and [#3519](https://github.com/nodejs/node/issues/3519). + +### Commits + +* [[`08a3f29fd4`](https://github.com/nodejs/node/commit/08a3f29fd4)] - **buffer**: fix range checking for slowToString (Matt Loring) [#4019](https://github.com/nodejs/node/pull/4019) +* [[`e3a8e8bba4`](https://github.com/nodejs/node/commit/e3a8e8bba4)] - **buffer**: Prevent Buffer constructor deopt (Bryce Baril) [#4158](https://github.com/nodejs/node/pull/4158) +* [[`0e18e68324`](https://github.com/nodejs/node/commit/0e18e68324)] - **buffer**: fix writeInt{B,L}E for some neg values (Peter A. Bigot) [#3994](https://github.com/nodejs/node/pull/3994) +* [[`ab5b529dd2`](https://github.com/nodejs/node/commit/ab5b529dd2)] - **buffer**: default to UTF8 in byteLength() (Tom Gallacher) [#4010](https://github.com/nodejs/node/pull/4010) +* [[`fcf0e8ebdf`](https://github.com/nodejs/node/commit/fcf0e8ebdf)] - **buffer**: move checkFloat from lib into src (Matt Loring) [#3763](https://github.com/nodejs/node/pull/3763) +* [[`12649f4496`](https://github.com/nodejs/node/commit/12649f4496)] - **build**: add "--partly-static" build options (Super Zheng) [#4152](https://github.com/nodejs/node/pull/4152) +* [[`a76d788119`](https://github.com/nodejs/node/commit/a76d788119)] - **build**: update signtool description, add url (Rod Vagg) [#4011](https://github.com/nodejs/node/pull/4011) +* [[`ed255abdc1`](https://github.com/nodejs/node/commit/ed255abdc1)] - **(SEMVER-MINOR)** **build,src**: add Intel Vtune profiling support (Chunyang Dai) [#3785](https://github.com/nodejs/node/pull/3785) +* [[`7793c364fc`](https://github.com/nodejs/node/commit/7793c364fc)] - **child_process**: flush consuming streams (Dave) [#4071](https://github.com/nodejs/node/pull/4071) +* [[`f29c5d6e70`](https://github.com/nodejs/node/commit/f29c5d6e70)] - **configure**: `v8_use_snapshot` should be `true` (Fedor Indutny) [#3962](https://github.com/nodejs/node/pull/3962) +* [[`da5ac55c83`](https://github.com/nodejs/node/commit/da5ac55c83)] - **(SEMVER-MINOR)** **crypto**: simplify using pre-existing keys with ECDH (Michael Ruddy) [#3511](https://github.com/nodejs/node/pull/3511) +* [[`cfc97641ee`](https://github.com/nodejs/node/commit/cfc97641ee)] - **crypto**: fix native module compilation with FIPS (Stefan Budeanu) [#4023](https://github.com/nodejs/node/pull/4023) +* [[`b81b45dabd`](https://github.com/nodejs/node/commit/b81b45dabd)] - **crypto**: update root certificates (Ben Noordhuis) [#3951](https://github.com/nodejs/node/pull/3951) +* [[`def681a07e`](https://github.com/nodejs/node/commit/def681a07e)] - **crypto**: disable crypto.createCipher in FIPS mode (Stefan Budeanu) [#3754](https://github.com/nodejs/node/pull/3754) +* [[`ce423f3624`](https://github.com/nodejs/node/commit/ce423f3624)] - **debugger**: introduce exec method for debugger (Jackson Tian) +* [[`99fd1ec28d`](https://github.com/nodejs/node/commit/99fd1ec28d)] - **deps**: backport 819b40a from V8 upstream (Michaël Zasso) [#3937](https://github.com/nodejs/node/pull/3937) +* [[`82252b2a17`](https://github.com/nodejs/node/commit/82252b2a17)] - **doc**: add brief Node.js overview to README (wurde) [#4174](https://github.com/nodejs/node/pull/4174) +* [[`634c5f1f81`](https://github.com/nodejs/node/commit/634c5f1f81)] - **doc**: url.format - true slash postfix behaviour (fansworld-claudio) [#4119](https://github.com/nodejs/node/pull/4119) +* [[`6f957a70d8`](https://github.com/nodejs/node/commit/6f957a70d8)] - **doc**: s/node.js/Node.js in readme (Rod Vagg) [#3998](https://github.com/nodejs/node/pull/3998) +* [[`0cd4a52392`](https://github.com/nodejs/node/commit/0cd4a52392)] - **doc**: improve child_process.markdown wording (yorkie) [#4138](https://github.com/nodejs/node/pull/4138) +* [[`fd5ed6888d`](https://github.com/nodejs/node/commit/fd5ed6888d)] - **doc**: add JungMinu to collaborators (Minwoo Jung) [#4143](https://github.com/nodejs/node/pull/4143) +* [[`fa0cdf75d9`](https://github.com/nodejs/node/commit/fa0cdf75d9)] - **doc**: add iarna to collaborators (Rebecca Turner) [#4144](https://github.com/nodejs/node/pull/4144) +* [[`424eb962b1`](https://github.com/nodejs/node/commit/424eb962b1)] - **doc**: add zkat to collaborators (Kat Marchán) [#4142](https://github.com/nodejs/node/pull/4142) +* [[`85b601224b`](https://github.com/nodejs/node/commit/85b601224b)] - **doc**: add HTTP working group (James M Snell) [#3919](https://github.com/nodejs/node/pull/3919) +* [[`f4164bd8df`](https://github.com/nodejs/node/commit/f4164bd8df)] - **doc**: update links to use https where possible (jpersson) [#4054](https://github.com/nodejs/node/pull/4054) +* [[`3169eed1e3`](https://github.com/nodejs/node/commit/3169eed1e3)] - **doc**: add links and backticks around names (jpersson) [#4054](https://github.com/nodejs/node/pull/4054) +* [[`f3417e2574`](https://github.com/nodejs/node/commit/f3417e2574)] - **doc**: standardize references to node.js in docs (Scott Buchanan) [#4136](https://github.com/nodejs/node/pull/4136) +* [[`95dd60c657`](https://github.com/nodejs/node/commit/95dd60c657)] - **doc**: reword https.Agent example text (Jan Krems) [#4075](https://github.com/nodejs/node/pull/4075) +* [[`c61237d3ea`](https://github.com/nodejs/node/commit/c61237d3ea)] - **doc**: fix internal link to child.send() (Luigi Pinca) [#4089](https://github.com/nodejs/node/pull/4089) +* [[`aaeced915e`](https://github.com/nodejs/node/commit/aaeced915e)] - **doc**: fix the exception description (yorkie) [#3658](https://github.com/nodejs/node/pull/3658) +* [[`a2b7596ac0`](https://github.com/nodejs/node/commit/a2b7596ac0)] - **doc**: fix color of linked code blocks (jpersson) [#4068](https://github.com/nodejs/node/pull/4068) +* [[`f3c50f5fb5`](https://github.com/nodejs/node/commit/f3c50f5fb5)] - **doc**: fix rare case of misaligned columns (Roman Reiss) [#3948](https://github.com/nodejs/node/pull/3948) +* [[`f0a2e2cdec`](https://github.com/nodejs/node/commit/f0a2e2cdec)] - **doc**: message.header duplication correction (Bryan English) [#3997](https://github.com/nodejs/node/pull/3997) +* [[`b1dfa8bebb`](https://github.com/nodejs/node/commit/b1dfa8bebb)] - **doc**: fix typo in README (Rich Trott) [#4000](https://github.com/nodejs/node/pull/4000) +* [[`4602e01221`](https://github.com/nodejs/node/commit/4602e01221)] - **doc**: replace sane with reasonable (Lewis Cowper) [#3980](https://github.com/nodejs/node/pull/3980) +* [[`4849a54386`](https://github.com/nodejs/node/commit/4849a54386)] - **doc**: Adding best practises for crypto.pbkdf2 (Tom Gallacher) [#3290](https://github.com/nodejs/node/pull/3290) +* [[`77251d99de`](https://github.com/nodejs/node/commit/77251d99de)] - **doc**: numeric flags to fs.open (Carl Lei) [#3641](https://github.com/nodejs/node/pull/3641) +* [[`f4ca007b42`](https://github.com/nodejs/node/commit/f4ca007b42)] - **doc**: clarify that fs streams expect blocking fd (Carl Lei) [#3641](https://github.com/nodejs/node/pull/3641) +* [[`26eeae8016`](https://github.com/nodejs/node/commit/26eeae8016)] - **doc**: fix broken references (Alexander Gromnitsky) [#3944](https://github.com/nodejs/node/pull/3944) +* [[`f90227b0e8`](https://github.com/nodejs/node/commit/f90227b0e8)] - **doc**: move fs.existsSync() deprecation message (Martin Forsberg) [#3942](https://github.com/nodejs/node/pull/3942) +* [[`bbcb2a2e65`](https://github.com/nodejs/node/commit/bbcb2a2e65)] - **doc**: clarify module loading behavior (cjihrig) [#3920](https://github.com/nodejs/node/pull/3920) +* [[`0997178037`](https://github.com/nodejs/node/commit/0997178037)] - **doc**: add reference for buffer.inspect() (cjihrig) [#3921](https://github.com/nodejs/node/pull/3921) +* [[`6c16c40283`](https://github.com/nodejs/node/commit/6c16c40283)] - **doc**: clarify v5.1.1 notable items (Rod Vagg) [#4156](https://github.com/nodejs/node/pull/4156) +* [[`4c8800c2de`](https://github.com/nodejs/node/commit/4c8800c2de)] - **fs,doc**: use `target` instead of `destination` (yorkie) [#3912](https://github.com/nodejs/node/pull/3912) +* [[`1f0e8dca8e`](https://github.com/nodejs/node/commit/1f0e8dca8e)] - **installer**: install the tick processor (Matt Loring) [#3032](https://github.com/nodejs/node/pull/3032) +* [[`e8e4e0718b`](https://github.com/nodejs/node/commit/e8e4e0718b)] - **meta**: remove use of profanity in source (Myles Borins) [#4122](https://github.com/nodejs/node/pull/4122) +* [[`13834caa28`](https://github.com/nodejs/node/commit/13834caa28)] - **module**: fix column offsets in errors (Tristian Flanagan) [#2867](https://github.com/nodejs/node/pull/2867) +* [[`8988e1e117`](https://github.com/nodejs/node/commit/8988e1e117)] - **module,repl**: remove repl require() hack (Ben Noordhuis) [#4026](https://github.com/nodejs/node/pull/4026) +* [[`baac81d95f`](https://github.com/nodejs/node/commit/baac81d95f)] - **net**: add local address/port for better errors (Jan Schär) [#3946](https://github.com/nodejs/node/pull/3946) +* [[`12754c5dc3`](https://github.com/nodejs/node/commit/12754c5dc3)] - **net**: small code cleanup (Jan Schär) [#3943](https://github.com/nodejs/node/pull/3943) +* [[`8a5e4345fd`](https://github.com/nodejs/node/commit/8a5e4345fd)] - **node**: s/doNTCallbackX/nextTickCallbackWithXArgs/ (Rod Vagg) [#4167](https://github.com/nodejs/node/pull/4167) +* [[`0869ef3c55`](https://github.com/nodejs/node/commit/0869ef3c55)] - **(SEMVER-MINOR)** **repl**: allow leading period in multiline input (Zirak) [#3835](https://github.com/nodejs/node/pull/3835) +* [[`aaab108dfe`](https://github.com/nodejs/node/commit/aaab108dfe)] - **repl**: attach location info to syntax errors (cjihrig) [#4013](https://github.com/nodejs/node/pull/4013) +* [[`b08126dc9d`](https://github.com/nodejs/node/commit/b08126dc9d)] - **src**: refactor vcbuild configure args creation (Rod Vagg) [#3399](https://github.com/nodejs/node/pull/3399) +* [[`da3137d0c5`](https://github.com/nodejs/node/commit/da3137d0c5)] - **src**: don't print garbage errors (cjihrig) [#4112](https://github.com/nodejs/node/pull/4112) +* [[`9e9346fa32`](https://github.com/nodejs/node/commit/9e9346fa32)] - **src**: use GetCurrentProcessId() for process.pid (Ben Noordhuis) [#4163](https://github.com/nodejs/node/pull/4163) +* [[`d969c0965c`](https://github.com/nodejs/node/commit/d969c0965c)] - **src**: define Is* util functions with macros (cjihrig) [#4118](https://github.com/nodejs/node/pull/4118) +* [[`458facdf66`](https://github.com/nodejs/node/commit/458facdf66)] - **src**: define getpid() based on OS (cjihrig) [#4146](https://github.com/nodejs/node/pull/4146) +* [[`7e18f2ec62`](https://github.com/nodejs/node/commit/7e18f2ec62)] - **(SEMVER-MINOR)** **src**: add BE support to StringBytes::Encode() (Bryon Leung) [#3410](https://github.com/nodejs/node/pull/3410) +* [[`756ab9caad`](https://github.com/nodejs/node/commit/756ab9caad)] - **stream**: be less eager with readable flag (Brian White) [#4141](https://github.com/nodejs/node/pull/4141) +* [[`8f845ba28a`](https://github.com/nodejs/node/commit/8f845ba28a)] - **stream_wrap**: error if stream has StringDecoder (Fedor Indutny) [#4031](https://github.com/nodejs/node/pull/4031) +* [[`1c1af81ea0`](https://github.com/nodejs/node/commit/1c1af81ea0)] - **streams**: update .readable/.writable to false (Brian White) [#4083](https://github.com/nodejs/node/pull/4083) +* [[`1d50819c85`](https://github.com/nodejs/node/commit/1d50819c85)] - **test**: check range fix for slowToString (Sakthipriyan Vairamani) [#4019](https://github.com/nodejs/node/pull/4019) +* [[`0c2a0dc859`](https://github.com/nodejs/node/commit/0c2a0dc859)] - **test**: skip long path tests on non-Windows (Rafał Pocztarski) [#4116](https://github.com/nodejs/node/pull/4116) +* [[`8a60aa1303`](https://github.com/nodejs/node/commit/8a60aa1303)] - **test**: don't check the # of chunks in test-http-1.0 (Santiago Gimeno) [#3961](https://github.com/nodejs/node/pull/3961) +* [[`e84aeec883`](https://github.com/nodejs/node/commit/e84aeec883)] - **test**: mark test-cluster-shared-leak flaky (Rich Trott) [#4162](https://github.com/nodejs/node/pull/4162) +* [[`b3f3b2e157`](https://github.com/nodejs/node/commit/b3f3b2e157)] - **test**: fix cluster-worker-isdead (Santiago Gimeno) [#3954](https://github.com/nodejs/node/pull/3954) +* [[`da6be4d31a`](https://github.com/nodejs/node/commit/da6be4d31a)] - **test**: fix time resolution constraint (Gireesh Punathil) [#3981](https://github.com/nodejs/node/pull/3981) +* [[`9d16729b20`](https://github.com/nodejs/node/commit/9d16729b20)] - **test**: skip instead of fail when mem constrained (Michael Cornacchia) [#3697](https://github.com/nodejs/node/pull/3697) +* [[`be41eb751b`](https://github.com/nodejs/node/commit/be41eb751b)] - **test**: refactor test-http-exit-delay (Rich Trott) [#4055](https://github.com/nodejs/node/pull/4055) +* [[`4b43bf0385`](https://github.com/nodejs/node/commit/4b43bf0385)] - **test**: fix flaky test-net-socket-local-address (Rich Trott) [#4109](https://github.com/nodejs/node/pull/4109) +* [[`cb55c67a00`](https://github.com/nodejs/node/commit/cb55c67a00)] - **test**: improve cluster-disconnect-handles test (Brian White) [#4084](https://github.com/nodejs/node/pull/4084) +* [[`2b5b127e14`](https://github.com/nodejs/node/commit/2b5b127e14)] - **test**: fix cluster-disconnect-handles flakiness (Santiago Gimeno) [#4009](https://github.com/nodejs/node/pull/4009) +* [[`430264817b`](https://github.com/nodejs/node/commit/430264817b)] - **test**: add test for repl.defineCommand() (Bryan English) [#3908](https://github.com/nodejs/node/pull/3908) +* [[`22b0971222`](https://github.com/nodejs/node/commit/22b0971222)] - **test**: eliminate multicast test FreeBSD flakiness (Rich Trott) [#4042](https://github.com/nodejs/node/pull/4042) +* [[`c50003746b`](https://github.com/nodejs/node/commit/c50003746b)] - **test**: mark test flaky on FreeBSD (Rich Trott) [#4016](https://github.com/nodejs/node/pull/4016) +* [[`69c95bbdb7`](https://github.com/nodejs/node/commit/69c95bbdb7)] - **test**: move ArrayStream to common (cjihrig) [#4027](https://github.com/nodejs/node/pull/4027) +* [[`d94a70ec51`](https://github.com/nodejs/node/commit/d94a70ec51)] - **test**: fix test-domain-exit-dispose-again (Julien Gilli) [#3990](https://github.com/nodejs/node/pull/3990) +* [[`00b839a2b8`](https://github.com/nodejs/node/commit/00b839a2b8)] - **test**: use platform-based timeout for reliability (Rich Trott) [#4015](https://github.com/nodejs/node/pull/4015) +* [[`054a216b6f`](https://github.com/nodejs/node/commit/054a216b6f)] - **test**: mark cluster-net-send test flaky on windows (Rich Trott) [#4006](https://github.com/nodejs/node/pull/4006) +* [[`d0621c5649`](https://github.com/nodejs/node/commit/d0621c5649)] - **test**: mark fork regression test flaky on windows (Rich Trott) [#4005](https://github.com/nodejs/node/pull/4005) +* [[`19ed33df80`](https://github.com/nodejs/node/commit/19ed33df80)] - **test**: skip test if in FreeBSD jail (Rich Trott) [#3995](https://github.com/nodejs/node/pull/3995) +* [[`a863e8d667`](https://github.com/nodejs/node/commit/a863e8d667)] - **test**: remove flaky status for cluster test (Rich Trott) [#3975](https://github.com/nodejs/node/pull/3975) +* [[`dd0d15fc47`](https://github.com/nodejs/node/commit/dd0d15fc47)] - **test**: add TAP diagnostic message for retried tests (Rich Trott) [#3960](https://github.com/nodejs/node/pull/3960) +* [[`1fe4d30efc`](https://github.com/nodejs/node/commit/1fe4d30efc)] - **test**: retry on smartos if ECONNREFUSED (Rich Trott) [#3941](https://github.com/nodejs/node/pull/3941) +* [[`665a35d45e`](https://github.com/nodejs/node/commit/665a35d45e)] - **test**: address flaky test-http-client-timeout-event (Rich Trott) [#3968](https://github.com/nodejs/node/pull/3968) +* [[`f9fe0aee53`](https://github.com/nodejs/node/commit/f9fe0aee53)] - **test**: numeric flags to fs.open (Carl Lei) [#3641](https://github.com/nodejs/node/pull/3641) +* [[`54aafa17af`](https://github.com/nodejs/node/commit/54aafa17af)] - **test**: http complete list of non-concat headers (Bryan English) [#3930](https://github.com/nodejs/node/pull/3930) +* [[`788541b40c`](https://github.com/nodejs/node/commit/788541b40c)] - **test**: fix race condition in unrefd interval test (Michael Cornacchia) [#3550](https://github.com/nodejs/node/pull/3550) +* [[`e129d83996`](https://github.com/nodejs/node/commit/e129d83996)] - **test**: skip/replace weak crypto tests in FIPS mode (Stefan Budeanu) [#3757](https://github.com/nodejs/node/pull/3757) +* [[`bc27379453`](https://github.com/nodejs/node/commit/bc27379453)] - **test**: avoid test timeouts on rpi (Stefan Budeanu) [#3902](https://github.com/nodejs/node/pull/3902) +* [[`272732e76b`](https://github.com/nodejs/node/commit/272732e76b)] - **test**: fix flaky test-child-process-spawnsync-input (Rich Trott) [#3889](https://github.com/nodejs/node/pull/3889) +* [[`781f8c0d1e`](https://github.com/nodejs/node/commit/781f8c0d1e)] - **test**: add OS X to module loading error test (Evan Lucas) [#3901](https://github.com/nodejs/node/pull/3901) +* [[`f99c6363de`](https://github.com/nodejs/node/commit/f99c6363de)] - **test**: module loading error fix solaris #3798 (fansworld-claudio) [#3855](https://github.com/nodejs/node/pull/3855) +* [[`1279adc756`](https://github.com/nodejs/node/commit/1279adc756)] - **timers**: optimize callback call: bind -> arrow (Andrei Sedoi) [#4038](https://github.com/nodejs/node/pull/4038) +* [[`80f7f65464`](https://github.com/nodejs/node/commit/80f7f65464)] - **(SEMVER-MINOR)** **tls**: support reading multiple cas from one input (Ben Noordhuis) [#4099](https://github.com/nodejs/node/pull/4099) +* [[`939f305d56`](https://github.com/nodejs/node/commit/939f305d56)] - **tls_wrap**: slice buffer properly in `ClearOut` (Fedor Indutny) [#4184](https://github.com/nodejs/node/pull/4184) +* [[`6d4a03d3d2`](https://github.com/nodejs/node/commit/6d4a03d3d2)] - **(SEMVER-MINOR)** **tools**: list missing whitespace/if-one-line cpplint (Ben Noordhuis) [#4099](https://github.com/nodejs/node/pull/4099) +* [[`1c1c1a0f2b`](https://github.com/nodejs/node/commit/1c1c1a0f2b)] - **(SEMVER-MINOR)** **tools**: add --prof-process flag to node binary (Matt Loring) [#4021](https://github.com/nodejs/node/pull/4021) +* [[`d7a7d3e6f7`](https://github.com/nodejs/node/commit/d7a7d3e6f7)] - **tools**: update certdata.txt (Ben Noordhuis) [#3951](https://github.com/nodejs/node/pull/3951) +* [[`1b434e0654`](https://github.com/nodejs/node/commit/1b434e0654)] - **util**: determine object types in C++ (cjihrig) [#4100](https://github.com/nodejs/node/pull/4100) +* [[`c93e2678f0`](https://github.com/nodejs/node/commit/c93e2678f0)] - **util**: fix constructor/instanceof checks (Brian White) [#3385](https://github.com/nodejs/node/pull/3385) +* [[`098a3113e1`](https://github.com/nodejs/node/commit/098a3113e1)] - **util**: move .decorateErrorStack to internal/util (Ben Noordhuis) [#4026](https://github.com/nodejs/node/pull/4026) +* [[`e68ea16c32`](https://github.com/nodejs/node/commit/e68ea16c32)] - **util**: add decorateErrorStack() (cjihrig) [#4013](https://github.com/nodejs/node/pull/4013) +* [[`c584c3e08f`](https://github.com/nodejs/node/commit/c584c3e08f)] - **util,src**: allow lookup of hidden values (cjihrig) [#3988](https://github.com/nodejs/node/pull/3988) + +## 2015-12-04, Version 5.1.1 (Stable), @rvagg + +### Notable changes + +* **http**: Fix CVE-2015-8027, a bug whereby an HTTP socket may no longer have a parser associated with it but a pipelined request attempts to trigger a pause or resume on the non-existent parser, a potential denial-of-service vulnerability. (Fedor Indutny) +* **openssl**: Upgrade to 1.0.2e, containing fixes for: + - CVE-2015-3193 "BN_mod_exp may produce incorrect results on x86_64", an attack may be possible against a Node.js TLS server using DHE key exchange. Details are available at . + - CVE-2015-3194 "Certificate verify crash with missing PSS parameter", a potential denial-of-service vector for Node.js TLS servers using client certificate authentication; TLS clients are also impacted. Details are available at . + (Shigeki Ohtsu) [#4134](https://github.com/nodejs/node/pull/4134) +* **v8**: Backport fix for CVE-2015-6764, a bug in `JSON.stringify()` that can result in out-of-bounds reads for arrays. (Ben Noordhuis) + +### Known issues + +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). +* Unicode characters in filesystem paths are not handled consistently across platforms or Node.js APIs. See [#2088](https://github.com/nodejs/node/issues/2088), [#3401](https://github.com/nodejs/node/issues/3401) and [#3519](https://github.com/nodejs/node/issues/3519). + +### Commits + +* [[`678398f250`](https://github.com/nodejs/node/commit/678398f250)] - **deps**: backport a7e50a5 from upstream v8 (Ben Noordhuis) +* [[`76a552c938`](https://github.com/nodejs/node/commit/76a552c938)] - **deps**: backport 6df9a1d from upstream v8 (Ben Noordhuis) +* [[`533881f889`](https://github.com/nodejs/node/commit/533881f889)] - **deps**: upgrade openssl sources to 1.0.2e (Shigeki Ohtsu) [#4134](https://github.com/nodejs/node/pull/4134) +* [[`12e70fafd3`](https://github.com/nodejs/node/commit/12e70fafd3)] - **http**: fix pipeline regression (Fedor Indutny) + +## 2015-11-17, Version 5.1.0 (Stable), @Fishrock123 + +### Notable changes + +* **buffer**: The `noAssert` option for many buffer functions will now silently drop invalid write values rather than crashing (P.S.V.R) [#3767](https://github.com/nodejs/node/pull/3767). + - This makes the behavior match what the docs suggest. +* **child_process**: `child.send()` now properly returns a boolean like the docs suggest (Rich Trott) [#3577](https://github.com/nodejs/node/pull/3577). +* **doc**: All of the API docs have been re-ordered so as to read in alphabetical order (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662). +* **http_parser**: update http-parser to 2.6.0 from 2.5.0 (James M Snell) [#3569](https://github.com/nodejs/node/pull/3569). + - Now supports the following HTTP methods: `LINK`, `UNLINK`, `BIND`, `REBIND`, `UNBIND`. + - Also added ACL and IPv6 Zone ID support. +* **npm**: upgrade npm to 3.3.12 from v3.3.6 (Rebecca Turner) [#3685](https://github.com/nodejs/node/pull/3685). + - See the release notes for [v3.3.7](https://github.com/npm/npm/releases/tag/v3.3.7), [v3.3.8](https://github.com/npm/npm/releases/tag/v3.3.8), [v3.3.9](https://github.com/npm/npm/releases/tag/v3.3.9), [v3.3.10](https://github.com/npm/npm/releases/tag/v3.3.10), [v3.3.11](https://github.com/npm/npm/releases/tag/v3.3.11), and [v3.3.12](https://github.com/npm/npm/releases/tag/v3.3.12) for more details. +* **repl**: The REPL no longer crashes if the [persistent history](https://nodejs.org/api/repl.html#repl_persistent_history) file cannot be opened (Evan Lucas) [#3630](https://github.com/nodejs/node/pull/3630). +* **tls**: The default `sessionIdContext` now uses SHA1 in FIPS mode rather than MD5 (Stefan Budeanu) [#3755](https://github.com/nodejs/node/pull/3755). +* **v8**: Added some more useful post-mortem data (Fedor Indutny) [#3779](https://github.com/nodejs/node/pull/3779). + +### Known issues + +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). +* Unicode characters in filesystem paths are not handled consistently across platforms or Node.js APIs. See [#2088](https://github.com/nodejs/node/issues/2088), [#3401](https://github.com/nodejs/node/issues/3401) and [#3519](https://github.com/nodejs/node/issues/3519). + +### Commits + +* [[`b663d2bbb5`](https://github.com/nodejs/node/commit/b663d2bbb5)] - **async_wrap**: call callback in destructor (Trevor Norris) [#3461](https://github.com/nodejs/node/pull/3461) +* [[`eccbec99ea`](https://github.com/nodejs/node/commit/eccbec99ea)] - **async_wrap**: new instances get uid (Trevor Norris) [#3461](https://github.com/nodejs/node/pull/3461) +* [[`5d34c81a5c`](https://github.com/nodejs/node/commit/5d34c81a5c)] - **async_wrap**: allow some hooks to be optional (Trevor Norris) [#3461](https://github.com/nodejs/node/pull/3461) +* [[`7bff0138e2`](https://github.com/nodejs/node/commit/7bff0138e2)] - **buffer**: let WriteFloatGeneric silently drop values (P.S.V.R) [#3767](https://github.com/nodejs/node/pull/3767) +* [[`56673693cd`](https://github.com/nodejs/node/commit/56673693cd)] - **buffer**: neuter external `nullptr` buffers (Fedor Indutny) [#3624](https://github.com/nodejs/node/pull/3624) +* [[`2d0ca0293a`](https://github.com/nodejs/node/commit/2d0ca0293a)] - **build**: fix configuring with prebuilt libraries (Markus Tzoe) [#3135](https://github.com/nodejs/node/pull/3135) +* [[`2a69b6820f`](https://github.com/nodejs/node/commit/2a69b6820f)] - **build**: fix --with-intl=system-icu for x-compile (Steven R. Loomis) [#3808](https://github.com/nodejs/node/pull/3808) +* [[`8f5a2550a7`](https://github.com/nodejs/node/commit/8f5a2550a7)] - **build**: omit -gline-tables-only for --enable-asan (Ben Noordhuis) [#3680](https://github.com/nodejs/node/pull/3680) +* [[`84bb74547d`](https://github.com/nodejs/node/commit/84bb74547d)] - **child_process**: add safety checks on stdio access (cjihrig) [#3799](https://github.com/nodejs/node/pull/3799) +* [[`e888471a11`](https://github.com/nodejs/node/commit/e888471a11)] - **child_process**: don't fork bomb ourselves from -e (Ben Noordhuis) [#3575](https://github.com/nodejs/node/pull/3575) +* [[`47f3735e88`](https://github.com/nodejs/node/commit/47f3735e88)] - **cluster**: send suicide message on disconnect (cjihrig) [#3720](https://github.com/nodejs/node/pull/3720) +* [[`d64a56cba5`](https://github.com/nodejs/node/commit/d64a56cba5)] - **cluster**: remove handles when disconnecting worker (Ben Noordhuis) [#3677](https://github.com/nodejs/node/pull/3677) +* [[`5ed30da5a0`](https://github.com/nodejs/node/commit/5ed30da5a0)] - **console**: use 'label' argument for time and timeEnd (Roman Reiss) [#3590](https://github.com/nodejs/node/pull/3590) +* [[`7a290abea6`](https://github.com/nodejs/node/commit/7a290abea6)] - **crypto**: DSA parameter validation in FIPS mode (Stefan Budeanu) [#3756](https://github.com/nodejs/node/pull/3756) +* [[`2c9fb147be`](https://github.com/nodejs/node/commit/2c9fb147be)] - **crypto**: Improve error checking and reporting (Stefan Budeanu) [#3753](https://github.com/nodejs/node/pull/3753) +* [[`66dccaf0cd`](https://github.com/nodejs/node/commit/66dccaf0cd)] - **debugger**: also exit when the repl emits 'exit' (Felix Böhm) [#2369](https://github.com/nodejs/node/pull/2369) +* [[`fd0253be4d`](https://github.com/nodejs/node/commit/fd0253be4d)] - **deps**: backport bc2e393 from v8 upstream (evan.lucas) [#3792](https://github.com/nodejs/node/pull/3792) +* [[`59077acc3d`](https://github.com/nodejs/node/commit/59077acc3d)] - **deps**: cherry-pick 68e89fb from v8's upstream (Fedor Indutny) [#3779](https://github.com/nodejs/node/pull/3779) +* [[`9ef81ff5d3`](https://github.com/nodejs/node/commit/9ef81ff5d3)] - **deps**: update V8 to 4.6.85.31 (Michaël Zasso) [#3698](https://github.com/nodejs/node/pull/3698) +* [[`b48dbf9fce`](https://github.com/nodejs/node/commit/b48dbf9fce)] - **deps**: upgrade npm to 3.3.12 (Rebecca Turner) [#3685](https://github.com/nodejs/node/pull/3685) +* [[`7caeb14e11`](https://github.com/nodejs/node/commit/7caeb14e11)] - **(SEMVER-MINOR)** **deps**: update http-parser to 2.6.0 (James M Snell) [#3569](https://github.com/nodejs/node/pull/3569) +* [[`08e0de59fa`](https://github.com/nodejs/node/commit/08e0de59fa)] - **deps**: upgrade npm to 3.3.10 (Rebecca Turner) [#3599](https://github.com/nodejs/node/pull/3599) +* [[`ac9e4ffe8e`](https://github.com/nodejs/node/commit/ac9e4ffe8e)] - **dns**: prevent undefined values in results (Junliang Yan) [#3696](https://github.com/nodejs/node/pull/3696) +* [[`ea67d870f4`](https://github.com/nodejs/node/commit/ea67d870f4)] - **doc**: document release types in readme (Rod Vagg) [#3482](https://github.com/nodejs/node/pull/3482) +* [[`60d3daa65c`](https://github.com/nodejs/node/commit/60d3daa65c)] - **doc**: replace head of readme with updated text (Rod Vagg) [#3482](https://github.com/nodejs/node/pull/3482) +* [[`df1fdba2ae`](https://github.com/nodejs/node/commit/df1fdba2ae)] - **doc**: sort repl alphabetically (Tristian Flanagan) [#3859](https://github.com/nodejs/node/pull/3859) +* [[`7ecd5422c8`](https://github.com/nodejs/node/commit/7ecd5422c8)] - **doc**: address use of profanity in code of conduct (James M Snell) [#3827](https://github.com/nodejs/node/pull/3827) +* [[`c2393d1f2a`](https://github.com/nodejs/node/commit/c2393d1f2a)] - **doc**: consistent reference-style links (Bryan English) [#3845](https://github.com/nodejs/node/pull/3845) +* [[`96f53c6b02`](https://github.com/nodejs/node/commit/96f53c6b02)] - **doc**: add link to \[customizing util.inspect colors\]. (Jesse McCarthy) [#3749](https://github.com/nodejs/node/pull/3749) +* [[`132297d3f6`](https://github.com/nodejs/node/commit/132297d3f6)] - **doc**: Updated streams simplified constructor API (Tom Gallacher) [#3602](https://github.com/nodejs/node/pull/3602) +* [[`d137f0fd28`](https://github.com/nodejs/node/commit/d137f0fd28)] - **doc**: add warning about Windows process groups (Roman Klauke) [#3681](https://github.com/nodejs/node/pull/3681) +* [[`45ff31cf94`](https://github.com/nodejs/node/commit/45ff31cf94)] - **doc**: added what buf.copy returns (Manuel B) [#3555](https://github.com/nodejs/node/pull/3555) +* [[`5d1faa28cb`](https://github.com/nodejs/node/commit/5d1faa28cb)] - **doc**: reword message.headers to indicate they are not read-only (Tristian Flanagan) [#3814](https://github.com/nodejs/node/pull/3814) +* [[`25c3807051`](https://github.com/nodejs/node/commit/25c3807051)] - **doc**: clarify duplicate header handling (Bryan English) [#3810](https://github.com/nodejs/node/pull/3810) +* [[`ae2d1ee302`](https://github.com/nodejs/node/commit/ae2d1ee302)] - **doc**: repl: add defineComand and displayPrompt (Bryan English) [#3765](https://github.com/nodejs/node/pull/3765) +* [[`09e524d013`](https://github.com/nodejs/node/commit/09e524d013)] - **doc**: sort tls alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`7e60b81c81`](https://github.com/nodejs/node/commit/7e60b81c81)] - **doc**: sort stream alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`cd931a8a13`](https://github.com/nodejs/node/commit/cd931a8a13)] - **doc**: sort net alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`cfa8198af8`](https://github.com/nodejs/node/commit/cfa8198af8)] - **doc**: sort process alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`e1a512607a`](https://github.com/nodejs/node/commit/e1a512607a)] - **doc**: sort zlib alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`0996b97240`](https://github.com/nodejs/node/commit/0996b97240)] - **doc**: sort util alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`df07072b66`](https://github.com/nodejs/node/commit/df07072b66)] - **doc**: sort https alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`6e9d01c7d8`](https://github.com/nodejs/node/commit/6e9d01c7d8)] - **doc**: sort http alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`18da02fa0f`](https://github.com/nodejs/node/commit/18da02fa0f)] - **doc**: sort modules alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`29054ffc0c`](https://github.com/nodejs/node/commit/29054ffc0c)] - **doc**: sort readline alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`389ead37ef`](https://github.com/nodejs/node/commit/389ead37ef)] - **doc**: sort repl alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`d383d624de`](https://github.com/nodejs/node/commit/d383d624de)] - **doc**: sort string_decoder alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`0d2262887c`](https://github.com/nodejs/node/commit/0d2262887c)] - **doc**: sort timers alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`14b5a95d03`](https://github.com/nodejs/node/commit/14b5a95d03)] - **doc**: sort tty alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`d4dda77e4a`](https://github.com/nodejs/node/commit/d4dda77e4a)] - **doc**: sort url alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`39b8259bd5`](https://github.com/nodejs/node/commit/39b8259bd5)] - **doc**: sort vm alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`d357b3090e`](https://github.com/nodejs/node/commit/d357b3090e)] - **doc**: sort querystring alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`1f56abaa98`](https://github.com/nodejs/node/commit/1f56abaa98)] - **doc**: sort punycode alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`bc63667456`](https://github.com/nodejs/node/commit/bc63667456)] - **doc**: sort path alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`22961e011c`](https://github.com/nodejs/node/commit/22961e011c)] - **doc**: sort os alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`4ba18489d3`](https://github.com/nodejs/node/commit/4ba18489d3)] - **doc**: sort globals alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`c3f5ea704f`](https://github.com/nodejs/node/commit/c3f5ea704f)] - **doc**: sort fs alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`ce3ac8dd1e`](https://github.com/nodejs/node/commit/ce3ac8dd1e)] - **doc**: sort events alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`63a78749b8`](https://github.com/nodejs/node/commit/63a78749b8)] - **doc**: sort errors alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`488326da8d`](https://github.com/nodejs/node/commit/488326da8d)] - **doc**: sort dgram alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`e1c357e881`](https://github.com/nodejs/node/commit/e1c357e881)] - **doc**: sort crypto alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`4118fd5794`](https://github.com/nodejs/node/commit/4118fd5794)] - **doc**: sort dns alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`3e046acc50`](https://github.com/nodejs/node/commit/3e046acc50)] - **doc**: sort console alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`05f1af7124`](https://github.com/nodejs/node/commit/05f1af7124)] - **doc**: sort cluster alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`5c30e5dada`](https://github.com/nodejs/node/commit/5c30e5dada)] - **doc**: sort child_process alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`fb6a09cd0e`](https://github.com/nodejs/node/commit/fb6a09cd0e)] - **doc**: sort buffer alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`c7c05d8f02`](https://github.com/nodejs/node/commit/c7c05d8f02)] - **doc**: sort assert alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`f2c2e53321`](https://github.com/nodejs/node/commit/f2c2e53321)] - **doc**: add note to util.isBuffer (Evan Lucas) [#3790](https://github.com/nodejs/node/pull/3790) +* [[`35fb9f91eb`](https://github.com/nodejs/node/commit/35fb9f91eb)] - **doc**: Describe FIPSDIR environment variable (Stefan Budeanu) [#3752](https://github.com/nodejs/node/pull/3752) +* [[`da911f158b`](https://github.com/nodejs/node/commit/da911f158b)] - **doc**: update lts description in the collaborator guide (James M Snell) [#3668](https://github.com/nodejs/node/pull/3668) +* [[`597f8751d1`](https://github.com/nodejs/node/commit/597f8751d1)] - **doc**: add note on tls connection meta data methods (Tyler Henkel) [#3746](https://github.com/nodejs/node/pull/3746) +* [[`a32d9e31dc`](https://github.com/nodejs/node/commit/a32d9e31dc)] - **doc**: add romankl to collaborators (Roman Klauke) [#3725](https://github.com/nodejs/node/pull/3725) +* [[`e5b9109d12`](https://github.com/nodejs/node/commit/e5b9109d12)] - **doc**: add thealphanerd to collaborators (Myles Borins) [#3723](https://github.com/nodejs/node/pull/3723) +* [[`a05a0b47e3`](https://github.com/nodejs/node/commit/a05a0b47e3)] - **doc**: add saghul as a collaborator (Saúl Ibarra Corretgé) [#3724](https://github.com/nodejs/node/pull/3724) +* [[`b14d9c5f16`](https://github.com/nodejs/node/commit/b14d9c5f16)] - **doc**: add method links in events.markdown (Alejandro Oviedo) [#3187](https://github.com/nodejs/node/pull/3187) +* [[`44f779b112`](https://github.com/nodejs/node/commit/44f779b112)] - **doc**: add caveats of algs and key size in crypto (Shigeki Ohtsu) [#3479](https://github.com/nodejs/node/pull/3479) +* [[`a0db5fb355`](https://github.com/nodejs/node/commit/a0db5fb355)] - **doc**: stdout/stderr can block when directed to file (Ben Noordhuis) [#3170](https://github.com/nodejs/node/pull/3170) +* [[`409f29972e`](https://github.com/nodejs/node/commit/409f29972e)] - **doc**: rename iojs-* groups to nodejs-* (Steven R. Loomis) [#3634](https://github.com/nodejs/node/pull/3634) +* [[`801866280e`](https://github.com/nodejs/node/commit/801866280e)] - **doc**: fix wrong date and known issue in changelog.md (James M Snell) [#3650](https://github.com/nodejs/node/pull/3650) +* [[`325c4c7af5`](https://github.com/nodejs/node/commit/325c4c7af5)] - **doc**: fix function param order in assert doc (David Woods) [#3533](https://github.com/nodejs/node/pull/3533) +* [[`045e04e531`](https://github.com/nodejs/node/commit/045e04e531)] - **doc**: typo fix in readme.md (Sam P Gallagher-Bishop) [#3649](https://github.com/nodejs/node/pull/3649) +* [[`7fd8f1371e`](https://github.com/nodejs/node/commit/7fd8f1371e)] - **doc**: add note about timeout delay > TIMEOUT_MAX (Guilherme Souza) [#3512](https://github.com/nodejs/node/pull/3512) +* [[`7d0b589644`](https://github.com/nodejs/node/commit/7d0b589644)] - **doc**: fix crypto spkac function descriptions (Jason Gerfen) [#3614](https://github.com/nodejs/node/pull/3614) +* [[`efa19bdcb5`](https://github.com/nodejs/node/commit/efa19bdcb5)] - **doc**: add final full stop in CONTRIBUTING.md (Emily Aviva Kapor-Mater) [#3576](https://github.com/nodejs/node/pull/3576) +* [[`90723afe32`](https://github.com/nodejs/node/commit/90723afe32)] - **doc**: made code spans more visible in the API docs (phijohns) [#3573](https://github.com/nodejs/node/pull/3573) +* [[`530bb9144f`](https://github.com/nodejs/node/commit/530bb9144f)] - **docs**: improve discoverability of Code of Conduct (Ashley Williams) [#3774](https://github.com/nodejs/node/pull/3774) +* [[`73e40f0327`](https://github.com/nodejs/node/commit/73e40f0327)] - **docs**: fs - change links to buffer encoding to Buffer class anchor (fansworld-claudio) [#2796](https://github.com/nodejs/node/pull/2796) +* [[`7a84fa6c60`](https://github.com/nodejs/node/commit/7a84fa6c60)] - **docs**: fs - remove encoding list and link to buffer (fansworld-claudio) [#2796](https://github.com/nodejs/node/pull/2796) +* [[`2aa6a6d998`](https://github.com/nodejs/node/commit/2aa6a6d998)] - **fs**: return null error on readFile() success (Zheng Chaoping) [#3740](https://github.com/nodejs/node/pull/3740) +* [[`c96400c572`](https://github.com/nodejs/node/commit/c96400c572)] - **gitignore**: don't ignore 'debug' in deps/npm (Rebecca Turner) [#3599](https://github.com/nodejs/node/pull/3599) +* [[`a7f28a098e`](https://github.com/nodejs/node/commit/a7f28a098e)] - **http**: remove unneeded cb check from setTimeout() (Ashok Suthar) [#3631](https://github.com/nodejs/node/pull/3631) +* [[`d2b5dcb2de`](https://github.com/nodejs/node/commit/d2b5dcb2de)] - **lib**: return boolean from child.send() (Rich Trott) [#3577](https://github.com/nodejs/node/pull/3577) +* [[`5c54fa0095`](https://github.com/nodejs/node/commit/5c54fa0095)] - **module**: cache regular expressions (Evan Lucas) [#3869](https://github.com/nodejs/node/pull/3869) +* [[`89285db128`](https://github.com/nodejs/node/commit/89285db128)] - **module**: remove unnecessary JSON.stringify (Andres Suarez) [#3578](https://github.com/nodejs/node/pull/3578) +* [[`fd3f0d8e6e`](https://github.com/nodejs/node/commit/fd3f0d8e6e)] - **querystring**: Parse multiple separator characters (Yosuke Furukawa) [#3807](https://github.com/nodejs/node/pull/3807) +* [[`75dbafc3f8`](https://github.com/nodejs/node/commit/75dbafc3f8)] - **repl**: To exit, press ^C again or type .exit. (Hemanth.HM) [#3368](https://github.com/nodejs/node/pull/3368) +* [[`5073da0481`](https://github.com/nodejs/node/commit/5073da0481)] - **repl**: don't crash if cannot open history file (Evan Lucas) [#3630](https://github.com/nodejs/node/pull/3630) +* [[`59cd28114d`](https://github.com/nodejs/node/commit/59cd28114d)] - **src**: Add missing va_end before return (Ömer Fadıl Usta) [#3565](https://github.com/nodejs/node/pull/3565) +* [[`02e012e984`](https://github.com/nodejs/node/commit/02e012e984)] - **src**: force line buffering for stderr (Rich Trott) [#3701](https://github.com/nodejs/node/pull/3701) +* [[`2498e29344`](https://github.com/nodejs/node/commit/2498e29344)] - **src**: Revert "nix stdin _readableState.reading" (Roman Reiss) [#3490](https://github.com/nodejs/node/pull/3490) +* [[`65cd03cda6`](https://github.com/nodejs/node/commit/65cd03cda6)] - **src**: wrap source before doing syntax check (Evan Lucas) [#3587](https://github.com/nodejs/node/pull/3587) +* [[`d72bb1e96a`](https://github.com/nodejs/node/commit/d72bb1e96a)] - ***Revert*** "**src**: fix stuck debugger process" (Ben Noordhuis) [#3585](https://github.com/nodejs/node/pull/3585) +* [[`047abbd6eb`](https://github.com/nodejs/node/commit/047abbd6eb)] - **test**: move test-specific function out of common (Rich Trott) [#3871](https://github.com/nodejs/node/pull/3871) +* [[`19a36ff355`](https://github.com/nodejs/node/commit/19a36ff355)] - **test**: fix flaky SmartOS test (Rich Trott) [#3830](https://github.com/nodejs/node/pull/3830) +* [[`4bb27baf8d`](https://github.com/nodejs/node/commit/4bb27baf8d)] - **test**: skip test if FreeBSD jail will break it (Rich Trott) [#3839](https://github.com/nodejs/node/pull/3839) +* [[`1c1e70864b`](https://github.com/nodejs/node/commit/1c1e70864b)] - **test**: fix path to module for repl test on Windows (Michael Cornacchia) [#3608](https://github.com/nodejs/node/pull/3608) +* [[`413ca53107`](https://github.com/nodejs/node/commit/413ca53107)] - **test**: increase crypto strength for FIPS standard (Stefan Budeanu) [#3758](https://github.com/nodejs/node/pull/3758) +* [[`2ec5e17d16`](https://github.com/nodejs/node/commit/2ec5e17d16)] - **test**: add test-zlib-flush-drain (Myles Borins) [#3534](https://github.com/nodejs/node/pull/3534) +* [[`de707f0876`](https://github.com/nodejs/node/commit/de707f0876)] - **test**: add hasFipsCrypto to test/common.js (Stefan Budeanu) [#3756](https://github.com/nodejs/node/pull/3756) +* [[`828b786e48`](https://github.com/nodejs/node/commit/828b786e48)] - **test**: add test for invalid DSA key size (Stefan Budeanu) [#3756](https://github.com/nodejs/node/pull/3756) +* [[`252e810059`](https://github.com/nodejs/node/commit/252e810059)] - **test**: Fix test-cluster-worker-exit.js for AIX (Imran Iqbal) [#3666](https://github.com/nodejs/node/pull/3666) +* [[`91248b1094`](https://github.com/nodejs/node/commit/91248b1094)] - **test**: run pipeline flood test in parallel (Rich Trott) [#3811](https://github.com/nodejs/node/pull/3811) +* [[`583f58e5d6`](https://github.com/nodejs/node/commit/583f58e5d6)] - **test**: stronger crypto in test fixtures (Stefan Budeanu) [#3759](https://github.com/nodejs/node/pull/3759) +* [[`2e67db3104`](https://github.com/nodejs/node/commit/2e67db3104)] - **test**: refactor test-http-pipeline-flood (Rich Trott) [#3636](https://github.com/nodejs/node/pull/3636) +* [[`1ab59ab9b3`](https://github.com/nodejs/node/commit/1ab59ab9b3)] - **test**: fix flaky test test-http-pipeline-flood (Devin Nakamura) [#3636](https://github.com/nodejs/node/pull/3636) +* [[`1c8a7c6351`](https://github.com/nodejs/node/commit/1c8a7c6351)] - **test**: enhance fs-watch-recursive test (Sakthipriyan Vairamani) [#2599](https://github.com/nodejs/node/pull/2599) +* [[`81997840f2`](https://github.com/nodejs/node/commit/81997840f2)] - **test**: fix test-module-loading-error for musl (Hugues Malphettes) [#3657](https://github.com/nodejs/node/pull/3657) +* [[`9cdceac782`](https://github.com/nodejs/node/commit/9cdceac782)] - **test**: use really invalid hostname (Sakthipriyan Vairamani) [#3711](https://github.com/nodejs/node/pull/3711) +* [[`f3594e77b2`](https://github.com/nodejs/node/commit/f3594e77b2)] - **test**: fix test-net-persistent-keepalive for AIX (Imran Iqbal) [#3646](https://github.com/nodejs/node/pull/3646) +* [[`81522480f1`](https://github.com/nodejs/node/commit/81522480f1)] - **test**: more regression tests for minDHSize option (Ben Noordhuis) [#3629](https://github.com/nodejs/node/pull/3629) +* [[`935b97769e`](https://github.com/nodejs/node/commit/935b97769e)] - **test**: add regression test for 512 bits DH key (Ben Noordhuis) [#3629](https://github.com/nodejs/node/pull/3629) +* [[`e302c33bb0`](https://github.com/nodejs/node/commit/e302c33bb0)] - **test**: mark http-pipeline-flood flaky (Rich Trott) [#3616](https://github.com/nodejs/node/pull/3616) +* [[`5977963bce`](https://github.com/nodejs/node/commit/5977963bce)] - **test**: remove flaky designation from ls-no-sslv3 (Rich Trott) [#3620](https://github.com/nodejs/node/pull/3620) +* [[`1e98d90db8`](https://github.com/nodejs/node/commit/1e98d90db8)] - **test**: add regression test for --debug-brk -e 0 (Ben Noordhuis) [#3585](https://github.com/nodejs/node/pull/3585) +* [[`2f16be2b70`](https://github.com/nodejs/node/commit/2f16be2b70)] - **tls**: Use SHA1 for sessionIdContext in FIPS mode (Stefan Budeanu) [#3755](https://github.com/nodejs/node/pull/3755) +* [[`05f0549b50`](https://github.com/nodejs/node/commit/05f0549b50)] - **tls**: copy client CAs and cert store on CertCb (Fedor Indutny) [#3537](https://github.com/nodejs/node/pull/3537) +* [[`bea35424a2`](https://github.com/nodejs/node/commit/bea35424a2)] - **tools**: add tap output to cpplint (Johan Bergström) [#3448](https://github.com/nodejs/node/pull/3448) +* [[`d036b35349`](https://github.com/nodejs/node/commit/d036b35349)] - **tools**: enforce `throw new Error()` with lint rule (Rich Trott) [#3714](https://github.com/nodejs/node/pull/3714) +* [[`38bb0d864e`](https://github.com/nodejs/node/commit/38bb0d864e)] - **tools**: Use `throw new Error()` consistently (Rich Trott) [#3714](https://github.com/nodejs/node/pull/3714) +* [[`e40d28283a`](https://github.com/nodejs/node/commit/e40d28283a)] - **tools**: update npm test tooling for 3.3.10+ (Rebecca Turner) [#3599](https://github.com/nodejs/node/pull/3599) +* [[`cbd358ce33`](https://github.com/nodejs/node/commit/cbd358ce33)] - **tools**: fix gyp to work on MacOSX without XCode (Shigeki Ohtsu) [iojs/io.js#1325](https://github.com/iojs/io.js/pull/1325) +* [[`3137e46cb8`](https://github.com/nodejs/node/commit/3137e46cb8)] - **tools**: update gyp to b3cef02 (Imran Iqbal) [#3487](https://github.com/nodejs/node/pull/3487) +* [[`d61cb90ee3`](https://github.com/nodejs/node/commit/d61cb90ee3)] - **util**: use Object.create(null) for dictionary object (Minwoo Jung) [#3831](https://github.com/nodejs/node/pull/3831) +* [[`9a45c21e6c`](https://github.com/nodejs/node/commit/9a45c21e6c)] - **util**: use regexp instead of str.replace().join() (qinjia) [#3689](https://github.com/nodejs/node/pull/3689) +* [[`33ffc62670`](https://github.com/nodejs/node/commit/33ffc62670)] - **zlib**: only apply drain listener if given callback (Craig Cavalier) [#3534](https://github.com/nodejs/node/pull/3534) +* [[`d70deabf90`](https://github.com/nodejs/node/commit/d70deabf90)] - **zlib**: pass kind to recursive calls to flush (Myles Borins) [#3534](https://github.com/nodejs/node/pull/3534) + +## 2015-11-03, Version 4.2.2 'Argon' (LTS), @jasnell + +### Notable changes + +This is an LTS maintenance release that addresses a number of issues: + +* [[`1d0f2cbf87`](https://github.com/nodejs/node/commit/1d0f2cbf87)] - **buffer**: fix value check for writeUInt{B,L}E (Trevor Norris) [#3500](https://github.com/nodejs/node/pull/3500) +* [[`2a45b72b4a`](https://github.com/nodejs/node/commit/2a45b72b4a)] - **buffer**: don't CHECK on zero-sized realloc (Ben Noordhuis) [#3499](https://github.com/nodejs/node/pull/3499) +* [[`a6469e901a`](https://github.com/nodejs/node/commit/a6469e901a)] - **deps**: backport 010897c from V8 upstream (Ali Ijaz Sheikh) [#3520](https://github.com/nodejs/node/pull/3520) +* [[`cadee67c25`](https://github.com/nodejs/node/commit/cadee67c25)] - **deps**: backport 8d6a228 from the v8's upstream (Fedor Indutny) [#3549](https://github.com/nodejs/node/pull/3549) +* [[`46c8c94055`](https://github.com/nodejs/node/commit/46c8c94055)] - **fs**: reduced duplicate code in fs.write() (ronkorving) [#2947](https://github.com/nodejs/node/pull/2947) +* [[`0427cdf094`](https://github.com/nodejs/node/commit/0427cdf094)] - **http**: fix stalled pipeline bug (Fedor Indutny) [#3342](https://github.com/nodejs/node/pull/3342) +* [[`2109708186`](https://github.com/nodejs/node/commit/2109708186)] - **lib**: fix cluster handle leak (Rich Trott) [#3510](https://github.com/nodejs/node/pull/3510) +* [[`f49c7c6955`](https://github.com/nodejs/node/commit/f49c7c6955)] - **lib**: avoid REPL exit on completion error (Rich Trott) [#3358](https://github.com/nodejs/node/pull/3358) +* [[`8a2c4aeeaa`](https://github.com/nodejs/node/commit/8a2c4aeeaa)] - **repl**: handle comments properly (Sakthipriyan Vairamani) [#3515](https://github.com/nodejs/node/pull/3515) +* [[`a04408acce`](https://github.com/nodejs/node/commit/a04408acce)] - **repl**: limit persistent history correctly on load (Jeremiah Senkpiel) [#2356](https://github.com/nodejs/node/pull/2356) +* [[`3bafe1a59b`](https://github.com/nodejs/node/commit/3bafe1a59b)] - **src**: fix race condition in debug signal on exit (Ben Noordhuis) [#3528](https://github.com/nodejs/node/pull/3528) +* [[`fe01d0df7a`](https://github.com/nodejs/node/commit/fe01d0df7a)] - **src**: fix exception message encoding on Windows (Brian White) [#3288](https://github.com/nodejs/node/pull/3288) +* [[`4bac5d9ddf`](https://github.com/nodejs/node/commit/4bac5d9ddf)] - **stream**: avoid unnecessary concat of a single buffer. (Calvin Metcalf) [#3300](https://github.com/nodejs/node/pull/3300) +* [[`8d78d687d5`](https://github.com/nodejs/node/commit/8d78d687d5)] - **timers**: reuse timer in `setTimeout().unref()` (Fedor Indutny) [#3407](https://github.com/nodejs/node/pull/3407) +* [[`e69c869399`](https://github.com/nodejs/node/commit/e69c869399)] - **tls**: TLSSocket options default isServer false (Yuval Brik) [#2614](https://github.com/nodejs/node/pull/2614) + +### Known issues + +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). + +### Commits + +* [[`1d0f2cbf87`](https://github.com/nodejs/node/commit/1d0f2cbf87)] - **buffer**: fix value check for writeUInt{B,L}E (Trevor Norris) [#3500](https://github.com/nodejs/node/pull/3500) +* [[`2a45b72b4a`](https://github.com/nodejs/node/commit/2a45b72b4a)] - **buffer**: don't CHECK on zero-sized realloc (Ben Noordhuis) [#3499](https://github.com/nodejs/node/pull/3499) +* [[`dc655e1dd2`](https://github.com/nodejs/node/commit/dc655e1dd2)] - **build**: rectify --link-module help text (P.S.V.R) [#3379](https://github.com/nodejs/node/pull/3379) +* [[`a6469e901a`](https://github.com/nodejs/node/commit/a6469e901a)] - **deps**: backport 010897c from V8 upstream (Ali Ijaz Sheikh) [#3520](https://github.com/nodejs/node/pull/3520) +* [[`cadee67c25`](https://github.com/nodejs/node/commit/cadee67c25)] - **deps**: backport 8d6a228 from the v8's upstream (Fedor Indutny) [#3549](https://github.com/nodejs/node/pull/3549) +* [[`1ebd35550b`](https://github.com/nodejs/node/commit/1ebd35550b)] - **doc**: fix typos in changelog (reggi) [#3291](https://github.com/nodejs/node/pull/3291) +* [[`fbd93d4c1c`](https://github.com/nodejs/node/commit/fbd93d4c1c)] - **doc**: more use-cases for promise events (Domenic Denicola) [#3438](https://github.com/nodejs/node/pull/3438) +* [[`6ceb9af407`](https://github.com/nodejs/node/commit/6ceb9af407)] - **doc**: remove old note, 'cluster' is marked stable (Balázs Galambosi) [#3314](https://github.com/nodejs/node/pull/3314) +* [[`a5f0d64ddc`](https://github.com/nodejs/node/commit/a5f0d64ddc)] - **doc**: createServer's key option can be an array (Sakthipriyan Vairamani) [#3123](https://github.com/nodejs/node/pull/3123) +* [[`317e0ec6b3`](https://github.com/nodejs/node/commit/317e0ec6b3)] - **doc**: binary encoding is not deprecated (Trevor Norris) [#3441](https://github.com/nodejs/node/pull/3441) +* [[`b422f6ee1a`](https://github.com/nodejs/node/commit/b422f6ee1a)] - **doc**: mention the behaviour if URL is invalid (Sakthipriyan Vairamani) [#2966](https://github.com/nodejs/node/pull/2966) +* [[`bc29aad22b`](https://github.com/nodejs/node/commit/bc29aad22b)] - **doc**: fix indent in tls resumption example (Roman Reiss) [#3372](https://github.com/nodejs/node/pull/3372) +* [[`313877bd8f`](https://github.com/nodejs/node/commit/313877bd8f)] - **doc**: fix typo in changelog (Timothy Gu) [#3353](https://github.com/nodejs/node/pull/3353) +* [[`4be432862a`](https://github.com/nodejs/node/commit/4be432862a)] - **doc**: show keylen in pbkdf2 as a byte length (calebboyd) [#3334](https://github.com/nodejs/node/pull/3334) +* [[`23a1140ddb`](https://github.com/nodejs/node/commit/23a1140ddb)] - **doc**: add information about Assert behavior and maintenance (Rich Trott) [#3330](https://github.com/nodejs/node/pull/3330) +* [[`e04cb1e1fc`](https://github.com/nodejs/node/commit/e04cb1e1fc)] - **doc**: clarify API buffer.concat (Martii) [#3255](https://github.com/nodejs/node/pull/3255) +* [[`eae714c370`](https://github.com/nodejs/node/commit/eae714c370)] - **doc**: clarify the use of `option.detached` (Kyle Smith) [#3250](https://github.com/nodejs/node/pull/3250) +* [[`b884899e67`](https://github.com/nodejs/node/commit/b884899e67)] - **doc**: label v4.2.1 as LTS in changelog heading (Phillip Johnsen) [#3360](https://github.com/nodejs/node/pull/3360) +* [[`9120a04981`](https://github.com/nodejs/node/commit/9120a04981)] - **docs**: add missing shell option to execSync (fansworld-claudio) [#3440](https://github.com/nodejs/node/pull/3440) +* [[`46c8c94055`](https://github.com/nodejs/node/commit/46c8c94055)] - **fs**: reduced duplicate code in fs.write() (ronkorving) [#2947](https://github.com/nodejs/node/pull/2947) +* [[`0427cdf094`](https://github.com/nodejs/node/commit/0427cdf094)] - **http**: fix stalled pipeline bug (Fedor Indutny) [#3342](https://github.com/nodejs/node/pull/3342) +* [[`2109708186`](https://github.com/nodejs/node/commit/2109708186)] - **lib**: fix cluster handle leak (Rich Trott) [#3510](https://github.com/nodejs/node/pull/3510) +* [[`f49c7c6955`](https://github.com/nodejs/node/commit/f49c7c6955)] - **lib**: avoid REPL exit on completion error (Rich Trott) [#3358](https://github.com/nodejs/node/pull/3358) +* [[`8a2c4aeeaa`](https://github.com/nodejs/node/commit/8a2c4aeeaa)] - **repl**: handle comments properly (Sakthipriyan Vairamani) [#3515](https://github.com/nodejs/node/pull/3515) +* [[`a04408acce`](https://github.com/nodejs/node/commit/a04408acce)] - **repl**: limit persistent history correctly on load (Jeremiah Senkpiel) [#2356](https://github.com/nodejs/node/pull/2356) +* [[`5d1f1c5fa8`](https://github.com/nodejs/node/commit/5d1f1c5fa8)] - **src**: wrap source before doing syntax check (Evan Lucas) [#3587](https://github.com/nodejs/node/pull/3587) +* [[`3bafe1a59b`](https://github.com/nodejs/node/commit/3bafe1a59b)] - **src**: fix race condition in debug signal on exit (Ben Noordhuis) [#3528](https://github.com/nodejs/node/pull/3528) +* [[`fe01d0df7a`](https://github.com/nodejs/node/commit/fe01d0df7a)] - **src**: fix exception message encoding on Windows (Brian White) [#3288](https://github.com/nodejs/node/pull/3288) +* [[`4bac5d9ddf`](https://github.com/nodejs/node/commit/4bac5d9ddf)] - **stream**: avoid unnecessary concat of a single buffer. (Calvin Metcalf) [#3300](https://github.com/nodejs/node/pull/3300) +* [[`117fb47a16`](https://github.com/nodejs/node/commit/117fb47a16)] - **stream**: fix signature of _write() in a comment (Fábio Santos) [#3248](https://github.com/nodejs/node/pull/3248) +* [[`c563a34427`](https://github.com/nodejs/node/commit/c563a34427)] - **test**: split independent tests into separate files (Rich Trott) [#3548](https://github.com/nodejs/node/pull/3548) +* [[`3f62952d42`](https://github.com/nodejs/node/commit/3f62952d42)] - **test**: add node::MakeCallback() test coverage (Ben Noordhuis) [#3478](https://github.com/nodejs/node/pull/3478) +* [[`6b75f10d8a`](https://github.com/nodejs/node/commit/6b75f10d8a)] - **test**: use port number from env in tls socket test (Stefan Budeanu) [#3557](https://github.com/nodejs/node/pull/3557) +* [[`39ff44e94f`](https://github.com/nodejs/node/commit/39ff44e94f)] - **test**: fix heap-profiler link error LNK1194 on win (Junliang Yan) [#3572](https://github.com/nodejs/node/pull/3572) +* [[`a2786dd408`](https://github.com/nodejs/node/commit/a2786dd408)] - **test**: fix missing unistd.h on windows (Junliang Yan) [#3532](https://github.com/nodejs/node/pull/3532) +* [[`5e6f7c9a23`](https://github.com/nodejs/node/commit/5e6f7c9a23)] - **test**: add regression test for --debug-brk -e 0 (Ben Noordhuis) [#3585](https://github.com/nodejs/node/pull/3585) +* [[`7cad182cb6`](https://github.com/nodejs/node/commit/7cad182cb6)] - **test**: port domains regression test from v0.10 (Jonas Dohse) [#3356](https://github.com/nodejs/node/pull/3356) +* [[`78d854c6ce`](https://github.com/nodejs/node/commit/78d854c6ce)] - **test**: remove util from common (Rich Trott) [#3324](https://github.com/nodejs/node/pull/3324) +* [[`c566c8b8c0`](https://github.com/nodejs/node/commit/c566c8b8c0)] - **test**: remove util properties from common (Rich Trott) [#3304](https://github.com/nodejs/node/pull/3304) +* [[`eb7c3fb2f4`](https://github.com/nodejs/node/commit/eb7c3fb2f4)] - **test**: split up buffer tests for reliability (Rich Trott) [#3323](https://github.com/nodejs/node/pull/3323) +* [[`b398a85e19`](https://github.com/nodejs/node/commit/b398a85e19)] - **test**: parallelize long-running test (Rich Trott) [#3287](https://github.com/nodejs/node/pull/3287) +* [[`b5f3b4956b`](https://github.com/nodejs/node/commit/b5f3b4956b)] - **test**: change call to deprecated util.isError() (Rich Trott) [#3084](https://github.com/nodejs/node/pull/3084) +* [[`32149cacb5`](https://github.com/nodejs/node/commit/32149cacb5)] - **test**: improve tests for util.inherits (Michaël Zasso) [#3507](https://github.com/nodejs/node/pull/3507) +* [[`5be686fab8`](https://github.com/nodejs/node/commit/5be686fab8)] - **test**: print helpful err msg on test-dns-ipv6.js (Junliang Yan) [#3501](https://github.com/nodejs/node/pull/3501) +* [[`0429131e32`](https://github.com/nodejs/node/commit/0429131e32)] - **test**: fix domain with abort-on-uncaught on PPC (Julien Gilli) [#3354](https://github.com/nodejs/node/pull/3354) +* [[`788106eee9`](https://github.com/nodejs/node/commit/788106eee9)] - **test**: cleanup, improve repl-persistent-history (Jeremiah Senkpiel) [#2356](https://github.com/nodejs/node/pull/2356) +* [[`ea58fa0bac`](https://github.com/nodejs/node/commit/ea58fa0bac)] - **test**: add Symbol test for assert.deepEqual() (Rich Trott) [#3327](https://github.com/nodejs/node/pull/3327) +* [[`d409ac473b`](https://github.com/nodejs/node/commit/d409ac473b)] - **test**: disable test-tick-processor - aix and be ppc (Michael Dawson) [#3491](https://github.com/nodejs/node/pull/3491) +* [[`c1623039dd`](https://github.com/nodejs/node/commit/c1623039dd)] - **test**: harden test-child-process-fork-regr-gh-2847 (Michael Dawson) [#3459](https://github.com/nodejs/node/pull/3459) +* [[`3bb4437abb`](https://github.com/nodejs/node/commit/3bb4437abb)] - **test**: fix test-net-keepalive for AIX (Imran Iqbal) [#3458](https://github.com/nodejs/node/pull/3458) +* [[`af55641a69`](https://github.com/nodejs/node/commit/af55641a69)] - **test**: wrap assert.fail when passed to callback (Myles Borins) [#3453](https://github.com/nodejs/node/pull/3453) +* [[`7c7ef01e65`](https://github.com/nodejs/node/commit/7c7ef01e65)] - **test**: skip test-dns-ipv6.js if ipv6 is unavailable (Junliang Yan) [#3444](https://github.com/nodejs/node/pull/3444) +* [[`a4d1510ba4`](https://github.com/nodejs/node/commit/a4d1510ba4)] - **test**: repl-persistent-history is no longer flaky (Jeremiah Senkpiel) [#3437](https://github.com/nodejs/node/pull/3437) +* [[`a5d968b8a2`](https://github.com/nodejs/node/commit/a5d968b8a2)] - **test**: fix flaky test-child-process-emfile (Rich Trott) [#3430](https://github.com/nodejs/node/pull/3430) +* [[`eac2acca76`](https://github.com/nodejs/node/commit/eac2acca76)] - **test**: remove flaky status from eval_messages test (Rich Trott) [#3420](https://github.com/nodejs/node/pull/3420) +* [[`155c778584`](https://github.com/nodejs/node/commit/155c778584)] - **test**: fix flaky test for symlinks (Rich Trott) [#3418](https://github.com/nodejs/node/pull/3418) +* [[`74eb632483`](https://github.com/nodejs/node/commit/74eb632483)] - **test**: apply correct assert.fail() arguments (Rich Trott) [#3378](https://github.com/nodejs/node/pull/3378) +* [[`0a4323dd82`](https://github.com/nodejs/node/commit/0a4323dd82)] - **test**: replace util with backtick strings (Myles Borins) [#3359](https://github.com/nodejs/node/pull/3359) +* [[`93847694ec`](https://github.com/nodejs/node/commit/93847694ec)] - **test**: add test-child-process-emfile fail message (Rich Trott) [#3335](https://github.com/nodejs/node/pull/3335) +* [[`8d78d687d5`](https://github.com/nodejs/node/commit/8d78d687d5)] - **timers**: reuse timer in `setTimeout().unref()` (Fedor Indutny) [#3407](https://github.com/nodejs/node/pull/3407) +* [[`e69c869399`](https://github.com/nodejs/node/commit/e69c869399)] - **tls**: TLSSocket options default isServer false (Yuval Brik) [#2614](https://github.com/nodejs/node/pull/2614) +* [[`0b32bbbf69`](https://github.com/nodejs/node/commit/0b32bbbf69)] - **v8**: pull fix for builtin code size on PPC (Michael Dawson) [#3474](https://github.com/nodejs/node/pull/3474) + +## 2015-10-29, Version 5.0.0 (Stable), @rvagg + +### Notable Changes + +* **buffer**: _(Breaking)_ Removed both `'raw'` and `'raws'` encoding types from `Buffer`, these have been deprecated for a long time (Sakthipriyan Vairamani) [#2859](https://github.com/nodejs/node/pull/2859). +* **console**: _(Breaking)_ Values reported by `console.time()` now have 3 decimals of accuracy added (Michaël Zasso) [#3166](https://github.com/nodejs/node/pull/3166). +* **fs**: + - `fs.readFile*()`, `fs.writeFile*()`, and `fs.appendFile*()` now also accept a file descriptor as their first argument (Johannes Wüller) [#3163](https://github.com/nodejs/node/pull/3163). + - _(Breaking)_ In `fs.readFile()`, if an encoding is specified and the internal `toString()` fails the error is no longer _thrown_ but is passed to the callback (Evan Lucas) [#3485](https://github.com/nodejs/node/pull/3485). + - _(Breaking)_ In `fs.read()` (using the `fs.read(fd, length, position, encoding, callback)` form), if the internal `toString()` fails the error is no longer _thrown_ but is passed to the callback (Evan Lucas) [#3503](https://github.com/nodejs/node/pull/3503). +* **http**: + - Fixed a bug where pipelined http requests would stall (Fedor Indutny) [#3342](https://github.com/nodejs/node/pull/3342). + - _(Breaking)_ When parsing HTTP, don't add duplicates of the following headers: `Retry-After`, `ETag`, `Last-Modified`, `Server`, `Age`, `Expires`. This is in addition to the following headers which already block duplicates: `Content-Type`, `Content-Length`, `User-Agent`, `Referer`, `Host`, `Authorization`, `Proxy-Authorization`, `If-Modified-Since`, `If-Unmodified-Since`, `From`, `Location`, `Max-Forwards` (James M Snell) [#3090](https://github.com/nodejs/node/pull/3090). + - _(Breaking)_ The `callback` argument to `OutgoingMessage#setTimeout()` must be a function or a `TypeError` is thrown (James M Snell) [#3090](https://github.com/nodejs/node/pull/3090). + - _(Breaking)_ HTTP methods and header names must now conform to the RFC 2616 "token" rule, a list of allowed characters that excludes control characters and a number of _separator_ characters. Specifically, methods and header names must now match ```/^[a-zA-Z0-9_!#$%&'*+.^`|~-]+$/``` or a `TypeError` will be thrown (James M Snell) [#2526](https://github.com/nodejs/node/pull/2526). +* **node**: + - _(Breaking)_ Deprecated the `_linklist` module (Rich Trott) [#3078](https://github.com/nodejs/node/pull/3078). + - _(Breaking)_ Removed `require.paths` and `require.registerExtension()`, both had been previously set to throw `Error` when accessed (Sakthipriyan Vairamani) [#2922](https://github.com/nodejs/node/pull/2922). +* **npm**: Upgraded to version 3.3.6 from 2.14.7, see https://github.com/npm/npm/releases/tag/v3.3.6 for more details. This is a major version bump for npm and it has seen a significant amount of change. Please see the original [npm v3.0.0 release notes](https://github.com/npm/npm/blob/master/CHANGELOG.md#v300-2015-06-25) for a list of major changes (Rebecca Turner) [#3310](https://github.com/nodejs/node/pull/3310). +* **src**: _(Breaking)_ Bumped `NODE_MODULE_VERSION` to `47` from `46`, this is necessary due to the V8 upgrade. Native add-ons will need to be recompiled (Rod Vagg) [#3400](https://github.com/nodejs/node/pull/3400). +* **timers**: Attempt to reuse the timer handle for `setTimeout().unref()`. This fixes a long-standing known issue where unrefed timers would perviously hold `beforeExit` open (Fedor Indutny) [#3407](https://github.com/nodejs/node/pull/3407). +* **tls**: + - Added ALPN Support (Shigeki Ohtsu) [#2564](https://github.com/nodejs/node/pull/2564). + - TLS options can now be passed in an object to `createSecurePair()` (Коренберг Марк) [#2441](https://github.com/nodejs/node/pull/2441). + - _(Breaking)_ The default minimum DH key size for `tls.connect()` is now 1024 bits and a warning is shown when DH key size is less than 2048 bits. This a security consideration to prevent "logjam" attacks. A new `minDHSize` TLS option can be used to override the default. (Shigeki Ohtsu) [#1831](https://github.com/nodejs/node/pull/1831). +* **util**: + - _(Breaking)_ `util.p()` was deprecated for years, and has now been removed (Wyatt Preul) [#3432](https://github.com/nodejs/node/pull/3432). + - _(Breaking)_ `util.inherits()` can now work with ES6 classes. This is considered a breaking change because of potential subtle side-effects caused by a change from directly reassigning the prototype of the constructor using `ctor.prototype = Object.create(superCtor.prototype, { constructor: { ... } })` to using `Object.setPrototypeOf(ctor.prototype, superCtor.prototype)` (Michaël Zasso) [#3455](https://github.com/nodejs/node/pull/3455). +* **v8**: _(Breaking)_ Upgraded to 4.6.85.25 from 4.5.103.35 (Ali Ijaz Sheikh) [#3351](https://github.com/nodejs/node/pull/3351). + - Implements the spread operator, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator for further information. + - Implements `new.target`, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new.target for further information. +* **zlib**: Decompression now throws on truncated input (e.g. unexpected end of file) (Yuval Brik) [#2595](https://github.com/nodejs/node/pull/2595). + +### Known issues + +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). +* Unicode characters in filesystem paths are not handled consistently across platforms or Node.js APIs. See [#2088](https://github.com/nodejs/node/issues/2088), [#3401](https://github.com/nodejs/node/issues/3401) and [#3519](https://github.com/nodejs/node/issues/3519). + + +### Commits + +* [[`6a04cc0a43`](https://github.com/nodejs/node/commit/6a04cc0a43)] - **buffer**: fix value check for writeUInt{B,L}E (Trevor Norris) [#3500](https://github.com/nodejs/node/pull/3500) +* [[`1a41feb559`](https://github.com/nodejs/node/commit/1a41feb559)] - **buffer**: don't CHECK on zero-sized realloc (Ben Noordhuis) [#3499](https://github.com/nodejs/node/pull/3499) +* [[`5f6579d366`](https://github.com/nodejs/node/commit/5f6579d366)] - **(SEMVER-MAJOR)** **buffer**: remove raw & raws encoding (Sakthipriyan Vairamani) [#2859](https://github.com/nodejs/node/pull/2859) +* [[`70fca2a81e`](https://github.com/nodejs/node/commit/70fca2a81e)] - **build**: Updates for AIX npm support - part 1 (Michael Dawson) [#3114](https://github.com/nodejs/node/pull/3114) +* [[`b36b4f385a`](https://github.com/nodejs/node/commit/b36b4f385a)] - **build**: rectify --link-module help text (P.S.V.R) [#3379](https://github.com/nodejs/node/pull/3379) +* [[`a89eeca590`](https://github.com/nodejs/node/commit/a89eeca590)] - **console**: rename argument of time and timeEnd (Michaël Zasso) [#3166](https://github.com/nodejs/node/pull/3166) +* [[`870108aaa8`](https://github.com/nodejs/node/commit/870108aaa8)] - **(SEMVER-MAJOR)** **console**: sub-millisecond accuracy for console.time (Michaël Zasso) [#3166](https://github.com/nodejs/node/pull/3166) +* [[`0a43697ce8`](https://github.com/nodejs/node/commit/0a43697ce8)] - **deps**: backport 010897c from V8 upstream (Ali Ijaz Sheikh) [#3520](https://github.com/nodejs/node/pull/3520) +* [[`8c0318ce8d`](https://github.com/nodejs/node/commit/8c0318ce8d)] - **deps**: backport 8d6a228 from the v8's upstream (Fedor Indutny) [#3549](https://github.com/nodejs/node/pull/3549) +* [[`2974debc6e`](https://github.com/nodejs/node/commit/2974debc6e)] - **deps**: update V8 to 4.6.85.28 (Michaël Zasso) [#3484](https://github.com/nodejs/node/pull/3484) +* [[`f76af49b13`](https://github.com/nodejs/node/commit/f76af49b13)] - **deps**: fix upgrade to npm 3.3.6 (Rebecca Turner) [#3494](https://github.com/nodejs/node/pull/3494) +* [[`32b51c97ec`](https://github.com/nodejs/node/commit/32b51c97ec)] - **deps**: upgrade npm to 3.3.6 (Rebecca Turner) [#3310](https://github.com/nodejs/node/pull/3310) +* [[`770cd229f9`](https://github.com/nodejs/node/commit/770cd229f9)] - **deps**: upgrade V8 to 4.6.85.25 (Ali Ijaz Sheikh) [#3351](https://github.com/nodejs/node/pull/3351) +* [[`972a0c8515`](https://github.com/nodejs/node/commit/972a0c8515)] - **deps**: backport 0d01728 from v8's upstream (Fedor Indutny) [#3351](https://github.com/nodejs/node/pull/3351) +* [[`1fdec65203`](https://github.com/nodejs/node/commit/1fdec65203)] - **deps**: improve ArrayBuffer performance in v8 (Fedor Indutny) [#3351](https://github.com/nodejs/node/pull/3351) +* [[`5cd1fd836a`](https://github.com/nodejs/node/commit/5cd1fd836a)] - **deps**: backport 56a0a79 from V8 upstream (Julien Gilli) [#3351](https://github.com/nodejs/node/pull/3351) +* [[`7fb128d8df`](https://github.com/nodejs/node/commit/7fb128d8df)] - **deps**: cherry-pick backports to V8 (Michaël Zasso) [#3351](https://github.com/nodejs/node/pull/3351) +* [[`d8011d1683`](https://github.com/nodejs/node/commit/d8011d1683)] - **(SEMVER-MAJOR)** **deps**: upgrade V8 to 4.6.85.23 (Michaël Zasso) [#3351](https://github.com/nodejs/node/pull/3351) +* [[`a334ddc467`](https://github.com/nodejs/node/commit/a334ddc467)] - ***Revert*** "**deps**: backport 03ef3cd from V8 upstream" (Ali Ijaz Sheikh) [#3237](https://github.com/nodejs/node/pull/3237) +* [[`6fff47ffac`](https://github.com/nodejs/node/commit/6fff47ffac)] - **deps**: backport 03ef3cd from V8 upstream (Ali Ijaz Sheikh) [#3165](https://github.com/nodejs/node/pull/3165) +* [[`680dda8023`](https://github.com/nodejs/node/commit/680dda8023)] - **dns**: remove nonexistant exports.ADNAME (Roman Reiss) [#3051](https://github.com/nodejs/node/pull/3051) +* [[`239ad899a3`](https://github.com/nodejs/node/commit/239ad899a3)] - **doc**: add LTS info to COLLABORATOR_GUIDE.md (Myles Borins) [#3442](https://github.com/nodejs/node/pull/3442) +* [[`5e76587fdf`](https://github.com/nodejs/node/commit/5e76587fdf)] - **doc**: createServer's key option can be an array (Sakthipriyan Vairamani) [#3123](https://github.com/nodejs/node/pull/3123) +* [[`0317c880da`](https://github.com/nodejs/node/commit/0317c880da)] - **doc**: add TSC meeting minutes 2015-10-21 (Rod Vagg) [#3480](https://github.com/nodejs/node/pull/3480) +* [[`cd245b12e0`](https://github.com/nodejs/node/commit/cd245b12e0)] - **doc**: clarify API buffer.concat (Martii) [#3255](https://github.com/nodejs/node/pull/3255) +* [[`ff9ef893fd`](https://github.com/nodejs/node/commit/ff9ef893fd)] - **doc**: add TSC meeting minutes 2015-10-14 (Rod Vagg) [#3463](https://github.com/nodejs/node/pull/3463) +* [[`605c5a7754`](https://github.com/nodejs/node/commit/605c5a7754)] - **doc**: clarify the use of `option.detached` (Kyle Smith) [#3250](https://github.com/nodejs/node/pull/3250) +* [[`cf75a175e5`](https://github.com/nodejs/node/commit/cf75a175e5)] - **doc**: more use-cases for promise events (Domenic Denicola) [#3438](https://github.com/nodejs/node/pull/3438) +* [[`1b75d4bda3`](https://github.com/nodejs/node/commit/1b75d4bda3)] - **doc**: update WORKING_GROUPS.md - add missing groups (Michael Dawson) [#3450](https://github.com/nodejs/node/pull/3450) +* [[`c658de2f99`](https://github.com/nodejs/node/commit/c658de2f99)] - **doc**: add TSC meeting minutes 2015-09-30 (Rod Vagg) [#3235](https://github.com/nodejs/node/pull/3235) +* [[`d0b8c5d3a4`](https://github.com/nodejs/node/commit/d0b8c5d3a4)] - **doc**: add TSC meeting minutes 2015-10-07 (Rod Vagg) [#3364](https://github.com/nodejs/node/pull/3364) +* [[`b483afcb20`](https://github.com/nodejs/node/commit/b483afcb20)] - **doc**: binary encoding is not deprecated (Trevor Norris) [#3441](https://github.com/nodejs/node/pull/3441) +* [[`b607366a1c`](https://github.com/nodejs/node/commit/b607366a1c)] - **doc**: add information about Assert behavior and maintenance (Rich Trott) [#3330](https://github.com/nodejs/node/pull/3330) +* [[`086103b32e`](https://github.com/nodejs/node/commit/086103b32e)] - **doc**: show keylen in pbkdf2 as a byte length (calebboyd) [#3334](https://github.com/nodejs/node/pull/3334) +* [[`f6ebc8277b`](https://github.com/nodejs/node/commit/f6ebc8277b)] - **doc**: reword description of console.time (Michaël Zasso) [#3166](https://github.com/nodejs/node/pull/3166) +* [[`503f279527`](https://github.com/nodejs/node/commit/503f279527)] - **doc**: fix indent in tls resumption example (Roman Reiss) [#3372](https://github.com/nodejs/node/pull/3372) +* [[`dae9fae0fe`](https://github.com/nodejs/node/commit/dae9fae0fe)] - **doc**: label v4.2.1 as LTS in changelog heading (Phillip Johnsen) [#3360](https://github.com/nodejs/node/pull/3360) +* [[`4fc638804c`](https://github.com/nodejs/node/commit/4fc638804c)] - **doc**: update V8 options in man page (Michaël Zasso) [#3351](https://github.com/nodejs/node/pull/3351) +* [[`a441aa6e1d`](https://github.com/nodejs/node/commit/a441aa6e1d)] - **doc**: update WORKING_GROUPS.md to include Intl (Steven R. Loomis) [#3251](https://github.com/nodejs/node/pull/3251) +* [[`81503e597b`](https://github.com/nodejs/node/commit/81503e597b)] - **doc**: fix typo in changelog (Timothy Gu) [#3353](https://github.com/nodejs/node/pull/3353) +* [[`3ef2e4acf3`](https://github.com/nodejs/node/commit/3ef2e4acf3)] - **doc**: fix typos in changelog (reggi) [#3291](https://github.com/nodejs/node/pull/3291) +* [[`b9279aa193`](https://github.com/nodejs/node/commit/b9279aa193)] - **doc**: remove old note, 'cluster' is marked stable (Balázs Galambosi) [#3314](https://github.com/nodejs/node/pull/3314) +* [[`cdfa271164`](https://github.com/nodejs/node/commit/cdfa271164)] - **doc**: update AUTHORS list (Rod Vagg) +* [[`47b06f6bb1`](https://github.com/nodejs/node/commit/47b06f6bb1)] - **docs**: add missing shell option to execSync (fansworld-claudio) [#3440](https://github.com/nodejs/node/pull/3440) +* [[`4c9abbd1bb`](https://github.com/nodejs/node/commit/4c9abbd1bb)] - **fs**: reduced duplicate code in fs.write() (ronkorving) [#2947](https://github.com/nodejs/node/pull/2947) +* [[`2bb147535e`](https://github.com/nodejs/node/commit/2bb147535e)] - **(SEMVER-MAJOR)** **fs**: don't throw in read if buffer too big (Evan Lucas) [#3503](https://github.com/nodejs/node/pull/3503) +* [[`7added3b39`](https://github.com/nodejs/node/commit/7added3b39)] - **(SEMVER-MAJOR)** **fs**: pass err to callback if buffer is too big (Evan Lucas) [#3485](https://github.com/nodejs/node/pull/3485) +* [[`5e0759f6fd`](https://github.com/nodejs/node/commit/5e0759f6fd)] - **(SEMVER-MINOR)** **fs**: add file descriptor support to *File() funcs (Johannes Wüller) [#3163](https://github.com/nodejs/node/pull/3163) +* [[`d1a2e5357e`](https://github.com/nodejs/node/commit/d1a2e5357e)] - **gitignore**: don't ignore debug source directory in V8 (Michaël Zasso) [#3351](https://github.com/nodejs/node/pull/3351) +* [[`ab03635fb1`](https://github.com/nodejs/node/commit/ab03635fb1)] - **http**: fix stalled pipeline bug (Fedor Indutny) [#3342](https://github.com/nodejs/node/pull/3342) +* [[`e655a437b3`](https://github.com/nodejs/node/commit/e655a437b3)] - **(SEMVER-MAJOR)** **http**: do not allow multiple instances of certain response headers (James M Snell) [#3090](https://github.com/nodejs/node/pull/3090) +* [[`0094a8dad7`](https://github.com/nodejs/node/commit/0094a8dad7)] - **(SEMVER-MAJOR)** **http**: add callback is function check (James M Snell) [#3090](https://github.com/nodejs/node/pull/3090) +* [[`6192c9892f`](https://github.com/nodejs/node/commit/6192c9892f)] - **(SEMVER-MAJOR)** **http**: add checkIsHttpToken check for header fields (James M Snell) [#2526](https://github.com/nodejs/node/pull/2526) +* [[`c9786bb680`](https://github.com/nodejs/node/commit/c9786bb680)] - **(SEMVER-MAJOR)** http{s}: don't connect to localhost on invalid URL (Sakthipriyan Vairamani) [#2967](https://github.com/nodejs/node/pull/2967) +* [[`1929d5be73`](https://github.com/nodejs/node/commit/1929d5be73)] - **lib**: fix cluster handle leak (Rich Trott) [#3510](https://github.com/nodejs/node/pull/3510) +* [[`97d081709e`](https://github.com/nodejs/node/commit/97d081709e)] - **lib**: avoid REPL exit on completion error (Rich Trott) [#3358](https://github.com/nodejs/node/pull/3358) +* [[`f236b3a904`](https://github.com/nodejs/node/commit/f236b3a904)] - **(SEMVER-MINOR)** **lib,doc**: return boolean from child.send() (Rich Trott) [#3516](https://github.com/nodejs/node/pull/3516) +* [[`6e887cc630`](https://github.com/nodejs/node/commit/6e887cc630)] - **lib,test**: update let to const where applicable (Sakthipriyan Vairamani) [#3152](https://github.com/nodejs/node/pull/3152) +* [[`47befffc53`](https://github.com/nodejs/node/commit/47befffc53)] - **(SEMVER-MAJOR)** **lib,test**: deprecate _linklist (Rich Trott) [#3078](https://github.com/nodejs/node/pull/3078) +* [[`d5ce53458e`](https://github.com/nodejs/node/commit/d5ce53458e)] - **lttng**: update flags for gc tracing (Glen Keane) [#3388](https://github.com/nodejs/node/pull/3388) +* [[`6ad458b752`](https://github.com/nodejs/node/commit/6ad458b752)] - **(SEMVER-MAJOR)** **module**: remove unnecessary property and method (Sakthipriyan Vairamani) [#2922](https://github.com/nodejs/node/pull/2922) +* [[`ae196175f4`](https://github.com/nodejs/node/commit/ae196175f4)] - **node**: improve GetActiveRequests performance (Trevor Norris) [#3375](https://github.com/nodejs/node/pull/3375) +* [[`bd4311bc9c`](https://github.com/nodejs/node/commit/bd4311bc9c)] - **repl**: handle comments properly (Sakthipriyan Vairamani) [#3515](https://github.com/nodejs/node/pull/3515) +* [[`ce391ed849`](https://github.com/nodejs/node/commit/ce391ed849)] - **(SEMVER-MAJOR)** **repl**: event ordering: delay 'close' until 'flushHistory' (Jeremiah Senkpiel) [#3435](https://github.com/nodejs/node/pull/3435) +* [[`4c80c02ac7`](https://github.com/nodejs/node/commit/4c80c02ac7)] - **repl**: limit persistent history correctly on load (Jeremiah Senkpiel) [#2356](https://github.com/nodejs/node/pull/2356) +* [[`134a60c785`](https://github.com/nodejs/node/commit/134a60c785)] - **src**: fix race condition in debug signal on exit (Ben Noordhuis) [#3528](https://github.com/nodejs/node/pull/3528) +* [[`bf7c3dabb4`](https://github.com/nodejs/node/commit/bf7c3dabb4)] - **(SEMVER-MAJOR)** **src**: bump NODE_MODULE_VERSION To 47 (Rod Vagg) [#3400](https://github.com/nodejs/node/pull/3400) +* [[`2d3560767e`](https://github.com/nodejs/node/commit/2d3560767e)] - **src**: fix exception message encoding on Windows (Brian White) [#3288](https://github.com/nodejs/node/pull/3288) +* [[`ff877e93e1`](https://github.com/nodejs/node/commit/ff877e93e1)] - **src**: fix stuck debugger process (Liang-Chi Hsieh) [#2778](https://github.com/nodejs/node/pull/2778) +* [[`8854183fe5`](https://github.com/nodejs/node/commit/8854183fe5)] - **stream**: avoid unnecessary concat of a single buffer. (Calvin Metcalf) [#3300](https://github.com/nodejs/node/pull/3300) +* [[`85b74de9de`](https://github.com/nodejs/node/commit/85b74de9de)] - **stream**: fix signature of _write() in a comment (Fábio Santos) [#3248](https://github.com/nodejs/node/pull/3248) +* [[`b8cea49c88`](https://github.com/nodejs/node/commit/b8cea49c88)] - **test**: fix heap-profiler link error LNK1194 on win (Junliang Yan) [#3572](https://github.com/nodejs/node/pull/3572) +* [[`4a5dbeab43`](https://github.com/nodejs/node/commit/4a5dbeab43)] - **test**: fix missing unistd.h on windows (Junliang Yan) [#3532](https://github.com/nodejs/node/pull/3532) +* [[`74e2328b3a`](https://github.com/nodejs/node/commit/74e2328b3a)] - **test**: split independent tests into separate files (Rich Trott) [#3548](https://github.com/nodejs/node/pull/3548) +* [[`8c6c0f915a`](https://github.com/nodejs/node/commit/8c6c0f915a)] - **test**: use port number from env in tls socket test (Stefan Budeanu) [#3557](https://github.com/nodejs/node/pull/3557) +* [[`1a968e67a5`](https://github.com/nodejs/node/commit/1a968e67a5)] - **test**: improve tests for util.inherits (Michaël Zasso) [#3507](https://github.com/nodejs/node/pull/3507) +* [[`9d8d752456`](https://github.com/nodejs/node/commit/9d8d752456)] - **test**: print helpful err msg on test-dns-ipv6.js (Junliang Yan) [#3501](https://github.com/nodejs/node/pull/3501) +* [[`60de9f8d7b`](https://github.com/nodejs/node/commit/60de9f8d7b)] - **test**: wrap assert.fail when passed to callback (Myles Borins) [#3453](https://github.com/nodejs/node/pull/3453) +* [[`cd83f7ed7f`](https://github.com/nodejs/node/commit/cd83f7ed7f)] - **test**: add node::MakeCallback() test coverage (Ben Noordhuis) [#3478](https://github.com/nodejs/node/pull/3478) +* [[`08da5c2a06`](https://github.com/nodejs/node/commit/08da5c2a06)] - **test**: disable test-tick-processor - aix and be ppc (Michael Dawson) [#3491](https://github.com/nodejs/node/pull/3491) +* [[`7c35fbcb14`](https://github.com/nodejs/node/commit/7c35fbcb14)] - **test**: harden test-child-process-fork-regr-gh-2847 (Michael Dawson) [#3459](https://github.com/nodejs/node/pull/3459) +* [[`ad2b272417`](https://github.com/nodejs/node/commit/ad2b272417)] - **test**: fix test-net-keepalive for AIX (Imran Iqbal) [#3458](https://github.com/nodejs/node/pull/3458) +* [[`04fb14cc35`](https://github.com/nodejs/node/commit/04fb14cc35)] - **test**: fix flaky test-child-process-emfile (Rich Trott) [#3430](https://github.com/nodejs/node/pull/3430) +* [[`eef0f0cd63`](https://github.com/nodejs/node/commit/eef0f0cd63)] - **test**: remove flaky status from eval_messages test (Rich Trott) [#3420](https://github.com/nodejs/node/pull/3420) +* [[`bbbd81eab2`](https://github.com/nodejs/node/commit/bbbd81eab2)] - **test**: skip test-dns-ipv6.js if ipv6 is unavailable (Junliang Yan) [#3444](https://github.com/nodejs/node/pull/3444) +* [[`f78c8e7426`](https://github.com/nodejs/node/commit/f78c8e7426)] - **test**: fix flaky test for symlinks (Rich Trott) [#3418](https://github.com/nodejs/node/pull/3418) +* [[`28e9a4f41b`](https://github.com/nodejs/node/commit/28e9a4f41b)] - **test**: repl-persistent-history is no longer flaky (Jeremiah Senkpiel) [#3437](https://github.com/nodejs/node/pull/3437) +* [[`9e981556e5`](https://github.com/nodejs/node/commit/9e981556e5)] - **test**: cleanup, improve repl-persistent-history (Jeremiah Senkpiel) [#2356](https://github.com/nodejs/node/pull/2356) +* [[`ee2e641e0a`](https://github.com/nodejs/node/commit/ee2e641e0a)] - **test**: add Symbol test for assert.deepEqual() (Rich Trott) [#3327](https://github.com/nodejs/node/pull/3327) +* [[`e2b8393ee8`](https://github.com/nodejs/node/commit/e2b8393ee8)] - **test**: port domains regression test from v0.10 (Jonas Dohse) [#3356](https://github.com/nodejs/node/pull/3356) +* [[`676e61872f`](https://github.com/nodejs/node/commit/676e61872f)] - **test**: apply correct assert.fail() arguments (Rich Trott) [#3378](https://github.com/nodejs/node/pull/3378) +* [[`bbdbef9274`](https://github.com/nodejs/node/commit/bbdbef9274)] - **test**: fix tests after V8 upgrade (Michaël Zasso) [#3351](https://github.com/nodejs/node/pull/3351) +* [[`6c032a8333`](https://github.com/nodejs/node/commit/6c032a8333)] - **test**: replace util with backtick strings (Myles Borins) [#3359](https://github.com/nodejs/node/pull/3359) +* [[`f45c315763`](https://github.com/nodejs/node/commit/f45c315763)] - **test**: fix domain with abort-on-uncaught on PPC (Julien Gilli) [#3354](https://github.com/nodejs/node/pull/3354) +* [[`e3d9d25083`](https://github.com/nodejs/node/commit/e3d9d25083)] - **test**: add test-child-process-emfile fail message (Rich Trott) [#3335](https://github.com/nodejs/node/pull/3335) +* [[`6f14b3a7db`](https://github.com/nodejs/node/commit/6f14b3a7db)] - **test**: remove util from common (Rich Trott) [#3324](https://github.com/nodejs/node/pull/3324) +* [[`7d94611ac9`](https://github.com/nodejs/node/commit/7d94611ac9)] - **test**: split up buffer tests for reliability (Rich Trott) [#3323](https://github.com/nodejs/node/pull/3323) +* [[`3202456baa`](https://github.com/nodejs/node/commit/3202456baa)] - **test**: remove util properties from common (Rich Trott) [#3304](https://github.com/nodejs/node/pull/3304) +* [[`31c971d641`](https://github.com/nodejs/node/commit/31c971d641)] - **test**: parallelize long-running test (Rich Trott) [#3287](https://github.com/nodejs/node/pull/3287) +* [[`5bbc6df7de`](https://github.com/nodejs/node/commit/5bbc6df7de)] - **test**: change call to deprecated util.isError() (Rich Trott) [#3084](https://github.com/nodejs/node/pull/3084) +* [[`522e3d3cd3`](https://github.com/nodejs/node/commit/522e3d3cd3)] - **timers**: reuse timer in `setTimeout().unref()` (Fedor Indutny) [#3407](https://github.com/nodejs/node/pull/3407) +* [[`b64ce5960f`](https://github.com/nodejs/node/commit/b64ce5960f)] - **tls**: remove util and calls to util.format (Myles Borins) [#3456](https://github.com/nodejs/node/pull/3456) +* [[`c64af7d99e`](https://github.com/nodejs/node/commit/c64af7d99e)] - **tls**: TLSSocket options default isServer false (Yuval Brik) [#2614](https://github.com/nodejs/node/pull/2614) +* [[`2296a4fc0f`](https://github.com/nodejs/node/commit/2296a4fc0f)] - **(SEMVER-MINOR)** **tls**: add `options` argument to createSecurePair (Коренберг Марк) [#2441](https://github.com/nodejs/node/pull/2441) +* [[`0140e1b5e3`](https://github.com/nodejs/node/commit/0140e1b5e3)] - **tls**: output warning of setDHParam to console.trace (Shigeki Ohtsu) [#1831](https://github.com/nodejs/node/pull/1831) +* [[`f72e178a78`](https://github.com/nodejs/node/commit/f72e178a78)] - **(SEMVER-MAJOR)** **tls**: add minDHSize option to tls.connect() (Shigeki Ohtsu) [#1831](https://github.com/nodejs/node/pull/1831) +* [[`6d92ebac11`](https://github.com/nodejs/node/commit/6d92ebac11)] - **tls**: add TLSSocket.getEphemeralKeyInfo() (Shigeki Ohtsu) [#1831](https://github.com/nodejs/node/pull/1831) +* [[`62ad1d0113`](https://github.com/nodejs/node/commit/62ad1d0113)] - **(SEMVER-MINOR)** **tls, crypto**: add ALPN Support (Shigeki Ohtsu) [#2564](https://github.com/nodejs/node/pull/2564) +* [[`5029f41b2f`](https://github.com/nodejs/node/commit/5029f41b2f)] - **(SEMVER-MINOR)** **tls,crypto**: move NPN protcol data to hidden value (Shigeki Ohtsu) [#2564](https://github.com/nodejs/node/pull/2564) +* [[`701e38c25f`](https://github.com/nodejs/node/commit/701e38c25f)] - **tools**: enable prefer-const eslint rule (Sakthipriyan Vairamani) [#3152](https://github.com/nodejs/node/pull/3152) +* [[`6e78382605`](https://github.com/nodejs/node/commit/6e78382605)] - **tools**: ensure npm always uses the local node (Jeremiah Senkpiel) [#3489](https://github.com/nodejs/node/pull/3489) +* [[`3c3435d017`](https://github.com/nodejs/node/commit/3c3435d017)] - **tools**: update test-npm to work with npm 3 (Rebecca Turner) [#3489](https://github.com/nodejs/node/pull/3489) +* [[`b4f4c24539`](https://github.com/nodejs/node/commit/b4f4c24539)] - **tools**: use absolute paths in test-npm (Rebecca Turner) [#3309](https://github.com/nodejs/node/pull/3309) +* [[`80573153b8`](https://github.com/nodejs/node/commit/80573153b8)] - **(SEMVER-MAJOR)** **util**: make inherits work with classes (Michaël Zasso) [#3455](https://github.com/nodejs/node/pull/3455) +* [[`412252ca04`](https://github.com/nodejs/node/commit/412252ca04)] - **(SEMVER-MAJOR)** **util**: Remove p, has been deprecated for years (Wyatt Preul) [#3432](https://github.com/nodejs/node/pull/3432) +* [[`718c304a4f`](https://github.com/nodejs/node/commit/718c304a4f)] - **v8**: pull fix for builtin code size on PPC (Michael Dawson) [#3474](https://github.com/nodejs/node/pull/3474) +* [[`6936468de2`](https://github.com/nodejs/node/commit/6936468de2)] - **vm**: remove Watchdog dependency on Environment (Ido Ben-Yair) [#3274](https://github.com/nodejs/node/pull/3274) +* [[`80169b1f0a`](https://github.com/nodejs/node/commit/80169b1f0a)] - **(SEMVER-MAJOR)** **zlib**: decompression throw on truncated input (Yuval Brik) [#2595](https://github.com/nodejs/node/pull/2595) + ## 2015-10-13, Version 4.2.1 'Argon' (LTS), @jasnell ### Notable changes diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000000..3d0f14d7201279 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,55 @@ +## Code of Conduct + +### Conduct + +* We are committed to providing a friendly, safe and welcoming + environment for all, regardless of level of experience, gender + identity and expression, sexual orientation, disability, + personal appearance, body size, race, ethnicity, age, religion, + nationality, or other similar characteristic. +* Please avoid using overtly sexual nicknames or other nicknames that + might detract from a friendly, safe and welcoming environment for + all. +* Please be kind and courteous. There's no need to be mean or rude. +* Respect that some individuals and cultures consider the casual use of + profanity offensive and off-putting. +* Respect that people have differences of opinion and that every + design or implementation choice carries a trade-off and numerous + costs. There is seldom a right answer. +* Please keep unstructured critique to a minimum. If you have solid + ideas you want to experiment with, make a fork and see how it works. +* We will exclude you from interaction if you insult, demean or harass + anyone. That is not welcome behavior. We interpret the term + "harassment" as including the definition in the [Citizen Code of + Conduct](http://citizencodeofconduct.org/); if you have any lack of + clarity about what might be included in that concept, please read + their definition. In particular, we don't tolerate behavior that + excludes people in socially marginalized groups. +* Private harassment is also unacceptable. No matter who you are, if + you feel you have been or are being harassed or made uncomfortable + by a community member, please contact one of the channel ops or any + of the TSC members immediately with a capture (log, photo, email) of + the harassment if possible. Whether you're a regular contributor or + a newcomer, we care about making this community a safe place for you + and we've got your back. +* Likewise any spamming, trolling, flaming, baiting or other + attention-stealing behavior is not welcome. +* Avoid the use of personal pronouns in code comments or + documentation. There is no need to address persons when explaining + code (e.g. "When the developer"). + +### Contact +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by: + +* Emailing [report@nodejs.org](mailto:report@nodejs.org) (this will email all TSC members) +* Contacting [individual TSC members](https://nodejs.org/en/foundation/tsc/#current-members-of-the-technical-steering-committee). + +### Moderation +See the TSC's [moderation policy](https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md) for details about moderation. + +### Attribution + +This Code of Conduct is adapted from [Rust's wonderful +CoC](http://www.rust-lang.org/conduct.html) as well as the +[Contributor Covenant v1.3.0](http://contributor-covenant.org/version/1/3/0/). diff --git a/COLLABORATOR_GUIDE.md b/COLLABORATOR_GUIDE.md index c5a13a5c9f2f09..90d73e80e9679b 100644 --- a/COLLABORATOR_GUIDE.md +++ b/COLLABORATOR_GUIDE.md @@ -4,10 +4,11 @@ * [Issues and Pull Requests](#issues-and-pull-requests) * [Accepting Modifications](#accepting-modifications) - - [Involving the TC](#involving-the-tc) + - [Involving the CTC](#involving-the-ctc) * [Landing Pull Requests](#landing-pull-requests) - [Technical HOWTO](#technical-howto) - [I Just Made a Mistake](#i-just-made-a-mistake) + - [Long Term Support](#long-term-support) This document contains information for Collaborators of the Node.js project regarding maintaining the code, documentation and issues. @@ -25,7 +26,7 @@ pull requests to the Node.js project. Collaborators should feel free to take full responsibility for managing issues and pull requests they feel qualified to handle, as long as this is done while being mindful of these guidelines, the -opinions of other Collaborators and guidance of the TC. +opinions of other Collaborators and guidance of the CTC. Collaborators may **close** any issue or pull request they believe is not relevant for the future of the Node.js project. Where this is @@ -39,7 +40,7 @@ necessary. All modifications to the Node.js code and documentation should be performed via GitHub pull requests, including modifications by -Collaborators and TC members. +Collaborators and CTC members. All pull requests must be reviewed and accepted by a Collaborator with sufficient expertise who is able to take full responsibility for the @@ -63,7 +64,7 @@ Where there is no disagreement amongst Collaborators, a pull request may be landed given appropriate review. 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 -TC for resolution (see below). +CTC for resolution (see below). All bugfixes require a test case which demonstrates the defect. The test should *fail* before the change, and *pass* after the change. @@ -72,10 +73,10 @@ All pull requests that modify executable code should be subjected to continuous integration tests on the [project CI server](https://ci.nodejs.org/). -### Involving the TC +### Involving the CTC -Collaborators may opt to elevate pull requests or issues to the TC for -discussion by assigning the ***tc-agenda*** tag. This should be done +Collaborators may opt to elevate pull requests or issues to the CTC for +discussion by assigning the ***ctc-agenda*** tag. This should be done where a pull request: - has a significant impact on the codebase, @@ -83,7 +84,7 @@ where a pull request: - has failed to reach consensus amongst the Collaborators who are actively participating in the discussion. -The TC should serve as the final arbiter where required. +The CTC should serve as the final arbiter where required. ## Landing Pull Requests @@ -92,14 +93,17 @@ information regarding the change process: - A `Reviewed-By: Name ` line for yourself and any other Collaborators who have reviewed the change. -- A `PR-URL:` line that references the full GitHub URL of the original +- A `PR-URL:` line that references the *full* GitHub URL of the original pull request being merged so it's easy to trace a commit back to the conversation that led up to that change. -- A `Fixes: X` line, where _X_ is either includes the full GitHub URL +- A `Fixes: X` line, where _X_ either includes the *full* GitHub URL for an issue, and/or the hash and commit message if the commit fixes a bug in a previous commit. Multiple `Fixes:` lines may be added if appropriate. +Review the commit message to ensure that it adheres to the guidelines +outlined in the [contributing](https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#step-3-commit) guide. + 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. @@ -227,3 +231,93 @@ messages. However, you are only allowed to force push to any Node.js branch within 10 minutes from your original push. If someone else pushes to the branch or the 10 minute period passes, consider the commit final. + +### Long Term Support + +#### What is LTS? + +Long Term Support (often referred to as *LTS*) guarantees application developers +a 30 month support cycle with specific versions of Node.js. + +You can find more information [in the full LTS plan](https://github.com/nodejs/lts#lts-plan). + +#### How does LTS work? + +Once a stable branch enters LTS, changes in that branch are limited to bug +fixes, security updates, possible npm updates, documentation updates, and +certain performance improvements that can be demonstrated to not break existing +applications. Semver-minor changes are only permitted if required for bug fixes +and then only on a case-by-case basis with LTS WG and possibly Core Technical +Committee (CTC) review. Semver-major changes are permitted only if required for +security related fixes. + +Once a stable branch moves into Maintenance mode, only **critical** bugs, +**critical** security fixes, and documentation updates will be permitted. + +#### Landing semver-minor commits in LTS + +The default policy is to not land semver-minor or higher commits in any LTS +branch. However, the LTS WG or CTC can evaluate any individual semver-minor +commit and decide whether a special exception ought to be made. It is +expected that such exceptions would be evaluated, in part, on the scope +and impact of the changes on the code, the risk to ecosystem stability +incurred by accepting the change, and the expected benefit that landing the +commit will have for the ecosystem. + +Any collaborator who feels a semver-minor commit should be landed in an LTS +branch should attach the `lts-agenda` label to the pull request. The LTS WG +will discuss the issue and, if necessary, will escalate the issue up to the +CTC for further discussion. + +#### How are LTS Branches Managed? + +There are currently three LTS branches: `v4.x`, `v0.10`, and `v0.12`. Each +of these is paired with a "staging" branch: `v4.x-staging`, `v0.10-staging`, +and `v0.12-staging`. + +As commits land in `master`, they are cherry-picked back to each staging +branch as appropriate. If the commit applies only to the LTS branch, the +PR must be opened against the *staging* branch. Commits are selectively +pulled from the staging branch into the LTS branch only when a release is +being prepared and may be pulled into the LTS branch in a different order +than they were landed in staging. + +Any collaborator may land commits into a staging branch, but only the release +team should land commits into the LTS branch while preparing a new +LTS release. + +#### How can I help? + +When you send your pull request, consider including information about +whether your change is breaking. If you think your patch can be backported, +please feel free to include that information in the PR thread. + +Several LTS related issue and PR labels have been provided: + +* `lts-watch-v4.x` - tells the LTS WG that the issue/PR needs to be considered + for landing in the `v4.x-staging` branch. +* `lts-watch-v0.10` - tells the LTS WG that the issue/PR needs to be considered + for landing in the `v0.10-staging` branch. +* `lts-watch-v0.12` - tells the LTS WG that the issue/PR needs to be considered + for landing in the `v0.12-staging` branch. +* `land-on-v4.x` - tells the release team that the commit should be landed + in a future v4.x release +* `land-on-v0.10` - tells the release team that the commit should be landed + in a future v0.10 release +* `land-on-v0.12` - tells the release team that the commit should be landed + in a future v0.12 release + +Any collaborator can attach these labels to any PR/issue. As commits are +landed into the staging branches, the `lts-watch-` label will be removed. +Likewise, as commits are landed in a LTS release, the `land-on-` label will +be removed. + +Collaborators are encouraged to help the LTS WG by attaching the appropriate +`lts-watch-` label to any PR that may impact an LTS release. + +#### How is an LTS release cut? + +When the LTS working group determines that a new LTS release is required, +selected commits will be picked from the staging branch to be included in the +release. This process of making a release will be a collaboration between the +LTS working group and the Release team. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3b3bf08b538707..bce91a3603cbed 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,11 @@ # Contributing to Node.js +## Code of Conduct + +The Code of Conduct explains the *bare minimum* behavior +expectations the Node Foundation requires of its contributors. +[Please read it before participating.](./CODE_OF_CONDUCT.md) + ## Issue Contributions When opening new issues or commenting on existing issues on this repository @@ -11,7 +17,7 @@ For general help using Node.js, please file an issue at the Discussion of non-technical topics including subjects like intellectual property, trademark and high level project questions should move to the -[node-forward discussions repository](https://github.com/node-forward/discussions) +[Technical Steering Committee (TSC)](https://github.com/nodejs/TSC/issues) instead. ## Code Contributions @@ -43,25 +49,27 @@ and built upon. #### Respect the stability index The rules for the master branch are less strict; consult the -[stability index](./doc/api/documentation.markdown#stability-index) for details. +[stability index](./doc/api/documentation..md#stability-index) for details. -In a nutshell, modules are at varying levels of API stability. Bug fixes are +In a nutshell, modules are at varying levels of API stability. Bug fixes are always welcome but API or behavioral changes to modules at stability level 3 (Locked) are off-limits. #### Dependencies Node.js has several bundled dependencies in the *deps/* and the *tools/* -directories that are not part of the project proper. Any changes to files +directories that are not part of the project proper. Any changes to files in those directories or its subdirectories should be sent to their respective -projects. Do not send your patch to us, we cannot accept it. +projects. Do not send your patch to us, we cannot accept it. In case of doubt, open an issue in the [issue tracker](https://github.com/nodejs/node/issues/) or contact one of the [project Collaborators](https://github.com/nodejs/node/#current-project-team-members). -([IRC](http://webchat.freenode.net/?channels=io.js) is often the best medium.) Especially do so if you plan to work on something big. Nothing is more +Especially do so if you plan to work on something big. Nothing is more frustrating than seeing your hard work go to waste because your vision -does not align with the project team. +does not align with the project team. Node.js has two IRC channels, +[#Node.js](http://webchat.freenode.net/?channels=node.js) for general help and questions, and +[#Node-dev](http://webchat.freenode.net/?channels=node-dev) for development of node core specifically. ### Step 2: Branch @@ -81,8 +89,8 @@ $ git config --global user.name "J. Random User" $ git config --global user.email "j.random.user@example.com" ``` -Writing good commit logs is important. A commit log should describe what -changed and why. Follow these guidelines when writing one: +Writing good commit logs is important. A commit log should describe what +changed and why. Follow these guidelines when writing one: 1. The first line should be 50 characters or less and contain a short description of the change prefixed with the name of the changed @@ -124,15 +132,15 @@ $ git rebase upstream/master ### Step 5: Test -Bug fixes and features **should come with tests**. Add your tests in the -test/parallel/ directory. Look at other tests to see how they should be +Bug fixes and features **should come with tests**. Add your tests in the +test/parallel/ directory. Look at other tests to see how they should be structured (license boilerplate, common includes, etc.). ```text $ ./configure && make -j8 test ``` -Make sure the linter is happy and that all tests pass. Please, do not submit +Make sure the linter is happy and that all tests pass. Please, do not submit patches that fail either check. If you are updating tests and just want to run a single test to check it, you @@ -160,62 +168,34 @@ $ git push origin my-feature-branch Go to https://github.com/yourusername/node and select your feature branch. Click the 'Pull Request' button and fill out the form. -Pull requests are usually reviewed within a few days. If there are comments +Pull requests are usually reviewed within a few days. If there are comments to address, apply your changes in a separate commit and push that to your -feature branch. Post a comment in the pull request afterwards; GitHub does +feature branch. Post a comment in the pull request afterwards; GitHub does not send out notifications when you add commits. - -## Developer's Certificate of Origin 1.0 + +## Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: * (a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license indicated - in the file; or -* (b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source license - and I have the right under that license to submit that work with - modifications, whether created in whole or in part by me, under the - same open source license (unless I am permitted to submit under a - different license), as indicated in the file; or -* (c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified it. - + have the right to submit it under the open source license + indicated in the file; or -## Code of Conduct +* (b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or -This Code of Conduct is adapted from [Rust's wonderful -CoC](http://www.rust-lang.org/conduct.html). - -* We are committed to providing a friendly, safe and welcoming - environment for all, regardless of gender, sexual orientation, - disability, ethnicity, religion, or similar personal characteristic. -* Please avoid using overtly sexual nicknames or other nicknames that - might detract from a friendly, safe and welcoming environment for - all. -* Please be kind and courteous. There's no need to be mean or rude. -* Respect that people have differences of opinion and that every - design or implementation choice carries a trade-off and numerous - costs. There is seldom a right answer. -* Please keep unstructured critique to a minimum. If you have solid - ideas you want to experiment with, make a fork and see how it works. -* We will exclude you from interaction if you insult, demean or harass - anyone. That is not welcome behavior. We interpret the term - "harassment" as including the definition in the [Citizen Code of - Conduct](http://citizencodeofconduct.org/); if you have any lack of - clarity about what might be included in that concept, please read - their definition. In particular, we don't tolerate behavior that - excludes people in socially marginalized groups. -* Private harassment is also unacceptable. No matter who you are, if - you feel you have been or are being harassed or made uncomfortable - by a community member, please contact one of the channel ops or any - of the TC members immediately with a capture (log, photo, email) of - the harassment if possible. Whether you're a regular contributor or - a newcomer, we care about making this community a safe place for you - and we've got your back. -* Likewise any spamming, trolling, flaming, baiting or other - attention-stealing behavior is not welcome. -* Avoid the use of personal pronouns in code comments or - documentation. There is no need to address persons when explaining - code (e.g. "When the developer") +* (c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +* (d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. diff --git a/GOVERNANCE.md b/GOVERNANCE.md index 3a7237215bad2a..2337353cb7b4f7 100644 --- a/GOVERNANCE.md +++ b/GOVERNANCE.md @@ -1,11 +1,11 @@ # Node.js Project Governance -## Technical Committee +## Core Technical Committee -The Node.js project is jointly governed by a Technical Steering Committee (TSC) +The Node.js project is jointly governed by a Core Technical Committee (CTC) which is responsible for high-level guidance of the project. -The TSC has final authority over this project including: +The CTC has final authority over this project including: * Technical direction * Project governance and process (including this policy) @@ -14,28 +14,28 @@ The TSC has final authority over this project including: * Conduct guidelines * Maintaining the list of additional Collaborators -Initial membership invitations to the TSC were given to individuals who +Initial membership invitations to the CTC were given to individuals who had been active contributors to Node.js, and who have significant experience with the management of the Node.js project. Membership is expected to evolve over time according to the needs of the project. -For the current list of TSC members, see the project +For the current list of CTC members, see the project [README.md](./README.md#current-project-team-members). ## Collaborators The [nodejs/node](https://github.com/nodejs/node) GitHub repository is -maintained by the TC and additional Collaborators who are added by the -TC on an ongoing basis. +maintained by the CTC and additional Collaborators who are added by the +CTC on an ongoing basis. Individuals making significant and valuable contributions are made Collaborators and given commit-access to the project. These -individuals are identified by the TC and their addition as -Collaborators is discussed during the weekly TC meeting. +individuals are identified by the CTC and their addition as +Collaborators is discussed during the weekly CTC meeting. _Note:_ If you make a significant contribution and are not considered -for commit-access, log an issue or contact a TC member directly and it -will be brought up in the next TC meeting. +for commit-access, log an issue or contact a CTC member directly and it +will be brought up in the next CTC meeting. Modifications of the contents of the nodejs/node repository are made on a collaborative basis. Anybody with a GitHub account may propose a @@ -51,8 +51,8 @@ on the consensus model used for governance. Collaborators may opt to elevate significant or controversial modifications, or modifications that have not found consensus to the -TC for discussion by assigning the ***tc-agenda*** tag to a pull -request or issue. The TC should serve as the final arbiter where +CTC for discussion by assigning the ***ctc-agenda*** tag to a pull +request or issue. The CTC should serve as the final arbiter where required. For the current list of Collaborators, see the project @@ -61,39 +61,38 @@ For the current list of Collaborators, see the project A guide for Collaborators is maintained in [COLLABORATOR_GUIDE.md](./COLLABORATOR_GUIDE.md). -## TC Membership +## CTC Membership -TC seats are not time-limited. There is no fixed size of the TC. -However, the expected target is between 6 and 12, to ensure adequate -coverage of important areas of expertise, balanced with the ability to -make decisions efficiently. +CTC seats are not time-limited. There is no fixed size of the CTC. The CTC +should be of such a size as to ensure adequate coverage of important areas of +expertise balanced with the ability to make decisions efficiently. -There is no specific set of requirements or qualifications for TC +There is no specific set of requirements or qualifications for CTC membership beyond these rules. -The TC may add additional members to the TC by a standard TC motion. +The CTC may add additional members to the CTC by a standard CTC motion. -A TC member may be removed from the TC by voluntary resignation, or by -a standard TC motion. +A CTC member may be removed from the CTC by voluntary resignation, or by +a standard CTC motion. -Changes to TC membership should be posted in the agenda, and may be -suggested as any other agenda item (see "TC Meetings" below). +Changes to CTC membership should be posted in the agenda, and may be +suggested as any other agenda item (see "CTC Meetings" below). -No more than 1/3 of the TC members may be affiliated with the same -employer. If removal or resignation of a TC member, or a change of -employment by a TC member, creates a situation where more than 1/3 of -the TC membership shares an employer, then the situation must be -immediately remedied by the resignation or removal of one or more TC +No more than 1/3 of the CTC members may be affiliated with the same +employer. If removal or resignation of a CTC member, or a change of +employment by a CTC member, creates a situation where more than 1/3 of +the CTC membership shares an employer, then the situation must be +immediately remedied by the resignation or removal of one or more CTC members affiliated with the over-represented employer(s). -## TC Meetings +## CTC Meetings -The TC meets weekly on a Google Hangout On Air. The meeting is run by -a designated moderator approved by the TC. Each meeting should be +The CTC meets weekly on a Google Hangout On Air. The meeting is run by +a designated moderator approved by the CTC. Each meeting should be published to YouTube. -Items are added to the TC agenda which are considered contentious or -are modifications of governance, contribution policy, TC membership, +Items are added to the CTC agenda which are considered contentious or +are modifications of governance, contribution policy, CTC membership, or release process. The intention of the agenda is not to approve or review all patches. @@ -102,26 +101,23 @@ group of Collaborators. Any community member or contributor can ask that something be added to the next meeting's agenda by logging a GitHub Issue. Any Collaborator, -TC member or the moderator can add the item to the agenda by adding -the ***tc-agenda*** tag to the issue. +CTC member or the moderator can add the item to the agenda by adding +the ***ctc-agenda*** tag to the issue. -Prior to each TC meeting, the moderator will share the Agenda with -members of the TC. TC members can add any items they like to the -agenda at the beginning of each meeting. The moderator and the TC +Prior to each CTC meeting, the moderator will share the Agenda with +members of the CTC. CTC members can add any items they like to the +agenda at the beginning of each meeting. The moderator and the CTC cannot veto or remove items. -The TC may invite persons or representatives from certain projects to -participate in a non-voting capacity. These invitees currently are: - -* A representative from [build](https://github.com/node-forward/build) - chosen by that project. +The CTC may invite persons or representatives from certain projects to +participate in a non-voting capacity. The moderator is responsible for summarizing the discussion of each agenda item and sending it as a pull request after the meeting. ## Consensus Seeking Process -The TC follows a +The CTC follows a [Consensus Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) decision making model. @@ -129,7 +125,7 @@ When an agenda item has appeared to reach a consensus, the moderator will ask "Does anyone object?" as a final call for dissent from the consensus. -If an agenda item cannot reach a consensus, a TC member can call for +If an agenda item cannot reach a consensus, a CTC member can call for either a closing vote or a vote to table the issue to the next -meeting. The call for a vote must be approved by a majority of the TC +meeting. The call for a vote must be approved by a majority of the CTC or else the discussion will continue. Simple majority wins. diff --git a/LICENSE b/LICENSE index 7920cbbaabcbfc..d0d07f7d429145 100644 --- a/LICENSE +++ b/LICENSE @@ -51,142 +51,25 @@ maintained libraries. The externally maintained libraries used by Node.js are: -- V8, located at deps/v8. V8's license follows: +- c-ares, located at deps/cares, is licensed as follows: """ - This license applies to all parts of V8 that are not externally - maintained libraries. The externally maintained libraries used by V8 - are: - - - PCRE test suite, located in - test/mjsunit/third_party/regexp-pcre.js. This is based on the - test suite from PCRE-7.3, which is copyrighted by the University - of Cambridge and Google, Inc. The copyright notice and license - are embedded in regexp-pcre.js. - - - Layout tests, located in test/mjsunit/third_party. These are - based on layout tests from webkit.org which are copyrighted by - Apple Computer, Inc. and released under a 3-clause BSD license. - - - Strongtalk assembler, the basis of the files assembler-arm-inl.h, - assembler-arm.cc, assembler-arm.h, assembler-ia32-inl.h, - assembler-ia32.cc, assembler-ia32.h, assembler-x64-inl.h, - assembler-x64.cc, assembler-x64.h, assembler-mips-inl.h, - assembler-mips.cc, assembler-mips.h, assembler.cc and assembler.h. - This code is copyrighted by Sun Microsystems Inc. and released - under a 3-clause BSD license. - - - Valgrind client API header, located at third_party/valgrind/valgrind.h - This is release under the BSD license. - - These libraries have their own licenses; we recommend you read them, - as their terms may differ from the terms below. - - Copyright 2006-2012, the V8 project authors. All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Copyright 1998 by the Massachusetts Institute of Technology. + Copyright (C) 2007-2013 by Daniel Stenberg + + 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. """ -- C-Ares, an asynchronous DNS client, located at deps/cares. C-Ares license - follows: - """ - /* Copyright 1998 by the Massachusetts Institute of Technology. - * - * 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. - """ - -- OpenSSL located at deps/openssl. OpenSSL is cryptographic software written - by Eric Young (eay@cryptsoft.com) to provide SSL/TLS encryption. OpenSSL's - license follows: - """ - /* ==================================================================== - * Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - """ - -- HTTP Parser, located at deps/http_parser. HTTP Parser's license follows: +- HTTP Parser, located at deps/http_parser, is licensed as follows: """ http_parser.c is based on src/http/ngx_http_parse.c from NGINX copyright Igor Sysoev. @@ -213,16 +96,415 @@ The externally maintained libraries used by Node.js are: IN THE SOFTWARE. """ -- ESLint is located at tools/eslint. ESLint's license follows: +- ICU, located at deps/icu, is licensed as follows: """ - ESLint - Copyright (c) 2013 Nicholas C. Zakas. All rights reserved. + ICU License - ICU 1.8.1 and later + + COPYRIGHT AND PERMISSION NOTICE + + Copyright (c) 1995-2016 International Business Machines Corporation and others + + All rights reserved. + + 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, and/or sell copies of the Software, and to permit persons + to whom the Software is furnished to do so, provided that the above + copyright notice(s) and this permission notice appear in all copies of + the Software and that both the above copyright notice(s) and this + permission notice appear in supporting documentation. + + 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 + OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY + SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER + RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF + CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + Except as contained in this notice, the name of a copyright holder + shall not be used in advertising or otherwise to promote the sale, use + or other dealings in this Software without prior written authorization + of the copyright holder. + + All trademarks and registered trademarks mentioned herein are the + property of their respective owners. + + --------------------- + + Third-Party Software Licenses + + This section contains third-party software notices and/or additional + terms for licensed third-party software components included within ICU + libraries. + + 1. Unicode Data Files and Software + + COPYRIGHT AND PERMISSION NOTICE + + Copyright © 1991-2016 Unicode, Inc. All rights reserved. + Distributed under the Terms of Use in + http://www.unicode.org/copyright.html. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of the Unicode data files and any associated documentation + (the "Data Files") or Unicode software and any associated documentation + (the "Software") to deal in the Data Files or Software + without restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, and/or sell copies of + the Data Files or Software, and to permit persons to whom the Data Files + or Software are furnished to do so, provided that + (a) this copyright and permission notice appear with all copies + of the Data Files or Software, + (b) this copyright and permission notice appear in associated + documentation, and + (c) there is clear notice in each modified Data File or in the Software + as well as in the documentation associated with the Data File(s) or + Software that the data or software has been modified. + + THE DATA FILES AND SOFTWARE ARE 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 OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS + NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL + DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THE DATA FILES OR SOFTWARE. + + Except as contained in this notice, the name of a copyright holder + shall not be used in advertising or otherwise to promote the sale, + use or other dealings in these Data Files or Software without prior + written authorization of the copyright holder. + + 2. Chinese/Japanese Word Break Dictionary Data (cjdict.txt) + + # The Google Chrome software developed by Google is licensed under + # the BSD license. Other software included in this distribution is + # provided under other licenses, as set forth below. + # + # The BSD License + # http://opensource.org/licenses/bsd-license.php + # Copyright (C) 2006-2008, Google Inc. + # + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions are met: + # + # Redistributions of source code must retain the above copyright notice, + # this list of conditions and the following disclaimer. + # Redistributions in binary form must reproduce the above + # copyright notice, this list of conditions and the following + # disclaimer in the documentation and/or other materials provided with + # the distribution. + # Neither the name of Google Inc. nor the names of its + # contributors may be used to endorse or promote products derived from + # this software without specific prior written permission. + # + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + # + # + # The word list in cjdict.txt are generated by combining three word lists + # listed below with further processing for compound word breaking. The + # frequency is generated with an iterative training against Google web + # corpora. + # + # * Libtabe (Chinese) + # - https://sourceforge.net/project/?group_id=1519 + # - Its license terms and conditions are shown below. + # + # * IPADIC (Japanese) + # - http://chasen.aist-nara.ac.jp/chasen/distribution.html + # - Its license terms and conditions are shown below. + # + # ---------COPYING.libtabe ---- BEGIN-------------------- + # + # /* + # * Copyrighy (c) 1999 TaBE Project. + # * Copyright (c) 1999 Pai-Hsiang Hsiao. + # * All rights reserved. + # * + # * Redistribution and use in source and binary forms, with or without + # * modification, are permitted provided that the following conditions + # * are met: + # * + # * . Redistributions of source code must retain the above copyright + # * notice, this list of conditions and the following disclaimer. + # * . Redistributions in binary form must reproduce the above copyright + # * notice, this list of conditions and the following disclaimer in + # * the documentation and/or other materials provided with the + # * distribution. + # * . Neither the name of the TaBE Project nor the names of its + # * contributors may be used to endorse or promote products derived + # * from this software without specific prior written permission. + # * + # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + # * OF THE POSSIBILITY OF SUCH DAMAGE. + # */ + # + # /* + # * Copyright (c) 1999 Computer Systems and Communication Lab, + # * Institute of Information Science, Academia + # * Sinica. All rights reserved. + # * + # * Redistribution and use in source and binary forms, with or without + # * modification, are permitted provided that the following conditions + # * are met: + # * + # * . Redistributions of source code must retain the above copyright + # * notice, this list of conditions and the following disclaimer. + # * . Redistributions in binary form must reproduce the above copyright + # * notice, this list of conditions and the following disclaimer in + # * the documentation and/or other materials provided with the + # * distribution. + # * . Neither the name of the Computer Systems and Communication Lab + # * nor the names of its contributors may be used to endorse or + # * promote products derived from this software without specific + # * prior written permission. + # * + # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + # * OF THE POSSIBILITY OF SUCH DAMAGE. + # */ + # + # Copyright 1996 Chih-Hao Tsai @ Beckman Institute, + # University of Illinois + # c-tsai4@uiuc.edu http://casper.beckman.uiuc.edu/~c-tsai4 + # + # ---------------COPYING.libtabe-----END-------------------------------- + # + # + # ---------------COPYING.ipadic-----BEGIN------------------------------- + # + # Copyright 2000, 2001, 2002, 2003 Nara Institute of Science + # and Technology. All Rights Reserved. + # + # Use, reproduction, and distribution of this software is permitted. + # Any copy of this software, whether in its original form or modified, + # must include both the above copyright notice and the following + # paragraphs. + # + # Nara Institute of Science and Technology (NAIST), + # the copyright holders, disclaims all warranties with regard to this + # software, including all implied warranties of merchantability and + # fitness, in no event shall NAIST be liable for + # any special, indirect or consequential damages or any damages + # whatsoever resulting from loss of use, data or profits, whether in an + # action of contract, negligence or other tortuous action, arising out + # of or in connection with the use or performance of this software. + # + # A large portion of the dictionary entries + # originate from ICOT Free Software. The following conditions for ICOT + # Free Software applies to the current dictionary as well. + # + # Each User may also freely distribute the Program, whether in its + # original form or modified, to any third party or parties, PROVIDED + # that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear + # on, or be attached to, the Program, which is distributed substantially + # in the same form as set out herein and that such intended + # distribution, if actually made, will neither violate or otherwise + # contravene any of the laws and regulations of the countries having + # jurisdiction over the User or the intended distribution itself. + # + # NO WARRANTY + # + # The program was produced on an experimental basis in the course of the + # research and development conducted during the project and is provided + # to users as so produced on an experimental basis. Accordingly, the + # program is provided without any warranty whatsoever, whether express, + # implied, statutory or otherwise. The term "warranty" used herein + # includes, but is not limited to, any warranty of the quality, + # performance, merchantability and fitness for a particular purpose of + # the program and the nonexistence of any infringement or violation of + # any right of any third party. + # + # Each user of the program will agree and understand, and be deemed to + # have agreed and understood, that there is no warranty whatsoever for + # the program and, accordingly, the entire risk arising from or + # otherwise connected with the program is assumed by the user. + # + # Therefore, neither ICOT, the copyright holder, or any other + # organization that participated in or was otherwise related to the + # development of the program and their respective officials, directors, + # officers and other employees shall be held liable for any and all + # damages, including, without limitation, general, special, incidental + # and consequential damages, arising out of or otherwise in connection + # with the use or inability to use the program or any product, material + # or result produced or otherwise obtained by using the program, + # regardless of whether they have been advised of, or otherwise had + # knowledge of, the possibility of such damages at any time during the + # project or thereafter. Each user will be deemed to have agreed to the + # foregoing by his or her commencement of use of the program. The term + # "use" as used herein includes, but is not limited to, the use, + # modification, copying and distribution of the program and the + # production of secondary products from the program. + # + # In the case where the program, whether in its original form or + # modified, was distributed or delivered to or received by a user from + # any person, organization or entity other than ICOT, unless it makes or + # grants independently of ICOT any specific warranty to the user in + # writing, such person, organization or entity, will also be exempted + # from and not be held liable to the user for any such damages as noted + # above as far as the program is concerned. + # + # ---------------COPYING.ipadic-----END---------------------------------- + + 3. Lao Word Break Dictionary Data (laodict.txt) + + # Copyright (c) 2013 International Business Machines Corporation + # and others. All Rights Reserved. + # + # Project: http://code.google.com/p/lao-dictionary/ + # Dictionary: http://lao-dictionary.googlecode.com/git/Lao-Dictionary.txt + # License: http://lao-dictionary.googlecode.com/git/Lao-Dictionary-LICENSE.txt + # (copied below) + # + # This file is derived from the above dictionary, with slight + # modifications. + # ---------------------------------------------------------------------- + # Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell. + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, + # are permitted provided that the following conditions are met: + # + # + # Redistributions of source code must retain the above copyright notice, this + # list of conditions and the following disclaimer. Redistributions in + # binary form must reproduce the above copyright notice, this list of + # conditions and the following disclaimer in the documentation and/or + # other materials provided with the distribution. + # + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + # OF THE POSSIBILITY OF SUCH DAMAGE. + # -------------------------------------------------------------------------- + + 4. Burmese Word Break Dictionary Data (burmesedict.txt) + + # Copyright (c) 2014 International Business Machines Corporation + # and others. All Rights Reserved. + # + # This list is part of a project hosted at: + # github.com/kanyawtech/myanmar-karen-word-lists + # + # -------------------------------------------------------------------------- + # Copyright (c) 2013, LeRoy Benjamin Sharon + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions + # are met: Redistributions of source code must retain the above + # copyright notice, this list of conditions and the following + # disclaimer. Redistributions in binary form must reproduce the + # above copyright notice, this list of conditions and the following + # disclaimer in the documentation and/or other materials provided + # with the distribution. + # + # Neither the name Myanmar Karen Word Lists, nor the names of its + # contributors may be used to endorse or promote products derived + # from this software without specific prior written permission. + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS + # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + # TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + # SUCH DAMAGE. + # -------------------------------------------------------------------------- + 5. Time Zone Database + + ICU uses the public domain data and code derived from Time Zone + Database for its time zone support. The ownership of the TZ database + is explained in BCP 175: Procedure for Maintaining the Time Zone + Database section 7. + + # 7. Database Ownership + # + # The TZ database itself is not an IETF Contribution or an IETF + # document. Rather it is a pre-existing and regularly updated work + # that is in the public domain, and is intended to remain in the + # public domain. Therefore, BCPs 78 [RFC5378] and 79 [RFC3979] do + # not apply to the TZ Database or contributions that individuals make + # to it. Should any claims be made and substantiated against the TZ + # Database, the organization that is providing the IANA + # Considerations defined in this RFC, under the memorandum of + # understanding with the IETF, currently ICANN, may act in accordance + # with all competent court orders. No ownership claims will be made + # by ICANN or the IETF Trust on the database or the code. Any person + # making a contribution to the database or code waives all rights to + # future claims in that contribution or in the TZ Database. + """ + +- libuv, located at deps/uv, is licensed as follows: + """ + libuv is part of the Node project: http://nodejs.org/ + libuv may be distributed alone under Node's license: + + ==== + + Copyright Joyent, Inc. and other Node contributors. All rights reserved. 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 + 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 @@ -232,67 +514,159 @@ The externally maintained libraries used by Node.js are: 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. + 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. + + ==== + + This license applies to all parts of libuv that are not externally + maintained libraries. + + The externally maintained libraries used by libuv are: + + - tree.h (from FreeBSD), copyright Niels Provos. Two clause BSD license. + + - inet_pton and inet_ntop implementations, contained in src/inet.c, are + copyright the Internet Systems Consortium, Inc., and licensed under the ISC + license. + + - stdint-msvc2008.h (from msinttypes), copyright Alexander Chemeris. Three + clause BSD license. + + - pthread-fixes.h, pthread-fixes.c, copyright Google Inc. and Sony Mobile + Communications AB. Three clause BSD license. + + - android-ifaddrs.h, android-ifaddrs.c, copyright Berkeley Software Design + Inc, Kenneth MacKay and Emergya (Cloud4all, FP7/2007-2013, grant agreement + n° 289016). Three clause BSD license. """ -- tools/cpplint.py is a C++ linter. Its license follows: +- OpenSSL, located at deps/openssl, is licensed as follows: """ - # Copyright (c) 2009 Google Inc. All rights reserved. - # - # Redistribution and use in source and binary forms, with or without - # modification, are permitted provided that the following conditions are - # met: - # - # * Redistributions of source code must retain the above copyright - # notice, this list of conditions and the following disclaimer. - # * Redistributions in binary form must reproduce the above - # copyright notice, this list of conditions and the following disclaimer - # in the documentation and/or other materials provided with the - # distribution. - # * Neither the name of Google Inc. nor the names of its - # contributors may be used to endorse or promote products derived from - # this software without specific prior written permission. - # - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Copyright (c) 1998-2016 The OpenSSL Project. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + 3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + + 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + + 5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + + 6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + + THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + ==================================================================== + + This product includes cryptographic software written by Eric Young + (eay@cryptsoft.com). This product includes software written by Tim + Hudson (tjh@cryptsoft.com). """ -- lib/punycode.js is copyright 2011 Mathias Bynens - and released under the MIT license. +- Punycode.js, located at lib/punycode.js, is licensed as follows: """ - * Punycode.js - * Copyright 2011 Mathias Bynens - * Available under MIT license + Copyright Mathias Bynens + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ -- tools/gyp. GYP is a meta-build system. GYP's license follows: +- V8, located at deps/v8, is licensed as follows: """ - Copyright (c) 2009 Google Inc. All rights reserved. + This license applies to all parts of V8 that are not externally + maintained libraries. The externally maintained libraries used by V8 + are: + + - PCRE test suite, located in + test/mjsunit/third_party/regexp-pcre/regexp-pcre.js. This is based on the + test suite from PCRE-7.3, which is copyrighted by the University + of Cambridge and Google, Inc. The copyright notice and license + are embedded in regexp-pcre.js. + + - Layout tests, located in test/mjsunit/third_party/object-keys. These are + based on layout tests from webkit.org which are copyrighted by + Apple Computer, Inc. and released under a 3-clause BSD license. + + - Strongtalk assembler, the basis of the files assembler-arm-inl.h, + assembler-arm.cc, assembler-arm.h, assembler-ia32-inl.h, + assembler-ia32.cc, assembler-ia32.h, assembler-x64-inl.h, + assembler-x64.cc, assembler-x64.h, assembler-mips-inl.h, + assembler-mips.cc, assembler-mips.h, assembler.cc and assembler.h. + This code is copyrighted by Sun Microsystems Inc. and released + under a 3-clause BSD license. + + - Valgrind client API header, located at third_party/valgrind/valgrind.h + This is release under the BSD license. + + These libraries have their own licenses; we recommend you read them, + as their terms may differ from the terms below. + Further license information can be found in LICENSE files located in + sub-directories. + + Copyright 2014, the V8 project authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT @@ -307,46 +681,63 @@ The externally maintained libraries used by Node.js are: OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ -- Zlib at deps/zlib. zlib's license follows: +- zlib, located at deps/zlib, is licensed as follows: """ - /* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.8, April 28th, 2013 - - Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - */ + zlib.h -- interface of the 'zlib' general purpose compression library + version 1.2.8, April 28th, 2013 + + Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu """ -- npm is a package manager program located at deps/npm. - npm's license follows: +- npm, located at deps/npm, is licensed as follows: """ - Copyright (c) Isaac Z. Schlueter - All rights reserved. + The npm application + Copyright (c) npm, Inc. and Contributors + Licensed on the terms of The Artistic License 2.0 - npm is released under the Artistic 2.0 License. - The text of the License follows: + Node package dependencies of the npm application + Copyright (c) their respective copyright owners + Licensed on their respective license terms + The npm public registry at https://registry.npmjs.org + and the npm website at https://www.npmjs.com + Operated by npm, Inc. + Use governed by terms published on https://www.npmjs.com - -------- + "Node.js" + Trademark Joyent, Inc., https://joyent.com + Neither npm nor npm, Inc. are affiliated with Joyent, Inc. + The Node.js application + Project of Node Foundation, https://nodejs.org + + The npm Logo + Copyright (c) Mathias Pettersson and Brian Hammond + + "Gubblebum Blocky" typeface + Copyright (c) Tjarda Koster, https://jelloween.deviantart.com + Used with permission + + -------- The Artistic License 2.0 @@ -413,14 +804,12 @@ The externally maintained libraries used by Node.js are: or any other form resulting from mechanical transformation or translation of the Source form. - Permission for Use and Modification Without Distribution (1) You are permitted to use the Standard Version and create and use Modified Versions for any purpose without restriction, provided that you do not Distribute the Modified Version. - Permissions for Redistribution of the Standard Version (2) You may Distribute verbatim copies of the Source form of the @@ -435,7 +824,6 @@ The externally maintained libraries used by Node.js are: Package will still be considered the Standard Version, and as such will be subject to the Original License. - Distribution of Modified Versions of the Package as Source (4) You may Distribute your Modified Version as Source (either gratis @@ -469,7 +857,6 @@ The externally maintained libraries used by Node.js are: available in that license fees are prohibited but Distributor Fees are allowed. - Distribution of Compiled Forms of the Standard Version or Modified Versions without the Source @@ -487,7 +874,6 @@ The externally maintained libraries used by Node.js are: the Source, provided that you comply with Section 4 with respect to the Source of the Modified Version. - Aggregating or Linking the Package (7) You may aggregate the Package (either the Standard Version or @@ -504,7 +890,6 @@ The externally maintained libraries used by Node.js are: include the Package, and Distribute the result without restriction, provided the result does not expose a direct interface to the Package. - Items That are Not Considered Part of a Modified Version (9) Works (including, but not limited to, modules and scripts) that @@ -513,7 +898,6 @@ The externally maintained libraries used by Node.js are: considered parts of the Package itself, and are not subject to the terms of this license. - General Provisions (10) Any use, modification, and distribution of the Standard or @@ -550,33 +934,41 @@ The externally maintained libraries used by Node.js are: DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -------- + """ +- GYP, located at tools/gyp, is licensed as follows: + """ + Copyright (c) 2009 Google Inc. All rights reserved. - "Node.js" and "node" trademark Joyent, Inc. npm is not officially - part of the Node.js project, and is neither owned by nor - officially affiliated with Joyent, Inc. - - Packages published in the npm registry (other than the Software and - its included dependencies) are not part of npm itself, are the sole - property of their respective maintainers, and are not covered by - this license. - - "npm Logo" created by Mathias Pettersson and Brian Hammond, - used with permission. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: - "Gubblebum Blocky" font - Copyright (c) by Tjarda Koster, http://jelloween.deviantart.com - included for use in the npm website and documentation, - used with permission. + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. - This program uses several Node.js modules contained in the node_modules/ - subdirectory, according to the terms of their respective licenses. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ -- tools/doc/node_modules/marked. Marked is a Markdown parser. Marked's - license follows: +- marked, located at tools/doc/node_modules/marked, is licensed as follows: """ Copyright (c) 2011-2012, Christopher Jeffrey (https://github.com/chjj/) @@ -599,405 +991,106 @@ The externally maintained libraries used by Node.js are: THE SOFTWARE. """ -- test/gc/node_modules/weak. Node-weak is a node.js addon that provides garbage - collector notifications. Node-weak's license follows: +- cpplint.py, located at tools/cpplint.py, is licensed as follows: """ - Copyright (c) 2011, Ben Noordhuis + Copyright (c) 2009 Google Inc. All rights reserved. - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - """ + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. -- ICU's license follows: - From http://source.icu-project.org/repos/icu/icu/trunk/license.html + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ - ICU License - ICU 1.8.1 and later - - COPYRIGHT AND PERMISSION NOTICE - - Copyright (c) 1995-2014 International Business Machines Corporation and others - - All rights reserved. - - 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, and/or sell copies of the - Software, and to permit persons to whom the Software is furnished - to do so, provided that the above copyright notice(s) and this - permission notice appear in all copies of the Software and that - both the above copyright notice(s) and this permission notice - appear in supporting documentation. - 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 OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE - COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR - ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR - ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. - - Except as contained in this notice, the name of a copyright holder - shall not be used in advertising or otherwise to promote the sale, - use or other dealings in this Software without prior written - authorization of the copyright holder. +- ESLint, located at tools/eslint, is licensed as follows: + """ + ESLint + Copyright (c) 2013 Nicholas C. Zakas. All rights reserved. - All trademarks and registered trademarks mentioned herein are the - property of their respective owners. + 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: - Third-Party Software Licenses + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. - This section contains third-party software notices and/or - additional terms for licensed third-party software components - included within ICU libraries. + 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. + """ - 1. Unicode Data Files and Software - COPYRIGHT AND PERMISSION NOTICE +- gtest, located at deps/gtest, is licensed as follows: + """ + Copyright 2008, Google Inc. + All rights reserved. - Copyright © 1991-2014 Unicode, Inc. All rights reserved. - Distributed under the Terms of Use in - http://www.unicode.org/copyright.html. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: - Permission is hereby granted, free of charge, to any person obtaining - a copy of the Unicode data files and any associated documentation - (the "Data Files") or Unicode software and any associated documentation - (the "Software") to deal in the Data Files or Software - without restriction, including without limitation the rights to use, - copy, modify, merge, publish, distribute, and/or sell copies of - the Data Files or Software, and to permit persons to whom the Data Files - or Software are furnished to do so, provided that - (a) this copyright and permission notice appear with all copies - of the Data Files or Software, - (b) this copyright and permission notice appear in associated - documentation, and - (c) there is clear notice in each modified Data File or in the Software - as well as in the documentation associated with the Data File(s) or - Software that the data or software has been modified. + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. - THE DATA FILES AND SOFTWARE ARE 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 OF THIRD PARTY RIGHTS. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS - NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL - DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THE DATA FILES OR SOFTWARE. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + """ - Except as contained in this notice, the name of a copyright holder - shall not be used in advertising or otherwise to promote the sale, - use or other dealings in these Data Files or Software without prior - written authorization of the copyright holder. +- node-weak, located at test/gc/node_modules/weak, is licensed as follows: + """ + Copyright (c) 2011, Ben Noordhuis - 2. Chinese/Japanese Word Break Dictionary Data (cjdict.txt) - # The Google Chrome software developed by Google is licensed - # under the BSD license. Other software included in this distribution - # is provided under other licenses, as set forth below. - # - # The BSD License - # http://opensource.org/licenses/bsd-license.php - # Copyright (C) 2006-2008, Google Inc. - # - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or - # without modification, are permitted provided that the following - # conditions are met: - # - # Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - # Redistributions in binary form must reproduce the above - # copyright notice, this list of conditions and the following - # disclaimer in the documentation and/or other materials provided with - # the distribution. - # Neither the name of Google Inc. nor the names of its - # contributors may be used to endorse or promote products derived from - # this software without specific prior written permission. - # - # - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - # - # - # The word list in cjdict.txt are generated by combining three - word lists listed - # below with further processing for compound word breaking. The - frequency is generated - # with an iterative training against Google web corpora. - # - # * Libtabe (Chinese) - # - https://sourceforge.net/project/?group_id=1519 - # - Its license terms and conditions are shown below. - # - # * IPADIC (Japanese) - # - http://chasen.aist-nara.ac.jp/chasen/distribution.html - # - Its license terms and conditions are shown below. - # - # ---------COPYING.libtabe ---- BEGIN-------------------- - # - # /* - # * Copyrighy (c) 1999 TaBE Project. - # * Copyright (c) 1999 Pai-Hsiang Hsiao. - # * All rights reserved. - # * - # * Redistribution and use in source and binary forms, with or without - # * modification, are permitted provided that the following conditions - # * are met: - # * - # * . Redistributions of source code must retain the above copyright - # * notice, this list of conditions and the following disclaimer. - # * . Redistributions in binary form must reproduce the above copyright - # * notice, this list of conditions and the following disclaimer in - # * the documentation and/or other materials provided with the - # * distribution. - # * . Neither the name of the TaBE Project nor the names of its - # * contributors may be used to endorse or promote products derived - # * from this software without specific prior written permission. - # * - # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - # * OF THE POSSIBILITY OF SUCH DAMAGE. - # */ - # - # /* - # * Copyright (c) 1999 Computer Systems and Communication Lab, - # * Institute of Information Science, Academia Sinica. - # * All rights reserved. - # * - # * Redistribution and use in source and binary forms, with or without - # * modification, are permitted provided that the following conditions - # * are met: - # * - # * . Redistributions of source code must retain the above copyright - # * notice, this list of conditions and the following disclaimer. - # * . Redistributions in binary form must reproduce the above copyright - # * notice, this list of conditions and the following disclaimer in - # * the documentation and/or other materials provided with the - # * distribution. - # * . Neither the name of the Computer Systems and Communication Lab - # * nor the names of its contributors may be used to endorse or - # * promote products derived from this software without specific - # * prior written permission. - # * - # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - # * OF THE POSSIBILITY OF SUCH DAMAGE. - # */ - # - # Copyright 1996 Chih-Hao Tsai @ Beckman Institute, University of Illinois - # c-tsai4@uiuc.edu http://casper.beckman.uiuc.edu/~c-tsai4 - # - # ---------------COPYING.libtabe-----END------------------------------------ - # - # - # ---------------COPYING.ipadic-----BEGIN------------------------------------ - # - # Copyright 2000, 2001, 2002, 2003 Nara Institute of Science - # and Technology. All Rights Reserved. - # - # Use, reproduction, and distribution of this software is permitted. - # Any copy of this software, whether in its original form or modified, - # must include both the above copyright notice and the following - # paragraphs. - # - # Nara Institute of Science and Technology (NAIST), - # the copyright holders, disclaims all warranties with regard to this - # software, including all implied warranties of merchantability and - # fitness, in no event shall NAIST be liable for - # any special, indirect or consequential damages or any damages - # whatsoever resulting from loss of use, data or profits, whether in an - # action of contract, negligence or other tortuous action, arising out - # of or in connection with the use or performance of this software. - # - # A large portion of the dictionary entries - # originate from ICOT Free Software. The following conditions for ICOT - # Free Software applies to the current dictionary as well. - # - # Each User may also freely distribute the Program, whether in its - # original form or modified, to any third party or parties, PROVIDED - # that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear - # on, or be attached to, the Program, which is distributed substantially - # in the same form as set out herein and that such intended - # distribution, if actually made, will neither violate or otherwise - # contravene any of the laws and regulations of the countries having - # jurisdiction over the User or the intended distribution itself. - # - # NO WARRANTY - # - # The program was produced on an experimental basis in the course of the - # research and development conducted during the project and is provided - # to users as so produced on an experimental basis. Accordingly, the - # program is provided without any warranty whatsoever, whether express, - # implied, statutory or otherwise. The term "warranty" used herein - # includes, but is not limited to, any warranty of the quality, - # performance, merchantability and fitness for a particular purpose of - # the program and the nonexistence of any infringement or violation of - # any right of any third party. - # - # Each user of the program will agree and understand, and be deemed to - # have agreed and understood, that there is no warranty whatsoever for - # the program and, accordingly, the entire risk arising from or - # otherwise connected with the program is assumed by the user. - # - # Therefore, neither ICOT, the copyright holder, or any other - # organization that participated in or was otherwise related to the - # development of the program and their respective officials, directors, - # officers and other employees shall be held liable for any and all - # damages, including, without limitation, general, special, incidental - # and consequential damages, arising out of or otherwise in connection - # with the use or inability to use the program or any product, material - # or result produced or otherwise obtained by using the program, - # regardless of whether they have been advised of, or otherwise had - # knowledge of, the possibility of such damages at any time during the - # project or thereafter. Each user will be deemed to have agreed to the - # foregoing by his or her commencement of use of the program. The term - # "use" as used herein includes, but is not limited to, the use, - # modification, copying and distribution of the program and the - # production of secondary products from the program. - # - # In the case where the program, whether in its original form or - # modified, was distributed or delivered to or received by a user from - # any person, organization or entity other than ICOT, unless it makes or - # grants independently of ICOT any specific warranty to the user in - # writing, such person, organization or entity, will also be exempted - # from and not be held liable to the user for any such damages as noted - # above as far as the program is concerned. - # - # ---------------COPYING.ipadic-----END------------------------------------ - - 3. Lao Word Break Dictionary Data (laodict.txt) - # Copyright (c) 2013 International Business Machines Corporation - # and others. All Rights Reserved. - # - # Project: http://code.google.com/p/lao-dictionary/ - # Dictionary: http://lao-dictionary.googlecode.com/git/Lao-Dictionary.txt - # License: http://lao-dictionary.googlecode.com/git/Lao-Dictionary-LICENSE.txt - # (copied below) - # - # This file is derived from the above dictionary, with slight modifications. - # -------------------------------------------------------------------------------- - # Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell. - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or without modification, - # are permitted provided that the following conditions are met: - # - # Redistributions of source code must retain the above copyright notice, this - # list of conditions and the following disclaimer. Redistributions in binary - # form must reproduce the above copyright notice, this list of conditions and - # the following disclaimer in the documentation and/or other materials - # provided with the distribution. - # - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR - # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - # -------------------------------------------------------------------------------- - - 4. Burmese Word Break Dictionary Data (burmesedict.txt) - # Copyright (c) 2014 International Business Machines Corporation - # and others. All Rights Reserved. - # - # This list is part of a project hosted at: - # github.com/kanyawtech/myanmar-karen-word-lists - # - # -------------------------------------------------------------------------------- - # Copyright (c) 2013, LeRoy Benjamin Sharon - # All rights reserved. - # - # Redistribution and use in source and binary forms, with or without modification, - # are permitted provided that the following conditions are met: - # - # Redistributions of source code must retain the above copyright notice, this - # list of conditions and the following disclaimer. - # - # Redistributions in binary form must reproduce the above copyright notice, this - # list of conditions and the following disclaimer in the documentation and/or - # other materials provided with the distribution. - # - # Neither the name Myanmar Karen Word Lists, nor the names of its - # contributors may be used to endorse or promote products derived from - # this software without specific prior written permission. - # - # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR - # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - # -------------------------------------------------------------------------------- + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. - 5. Time Zone Database - ICU uses the public domain data and code derived from Time Zone - Database for its time zone support. The ownership of the TZ - database is explained in BCP 175: Procedure for Maintaining the - Time Zone Database section 7. - - 7. Database Ownership - - The TZ database itself is not an IETF Contribution or an IETF - document. Rather it is a pre-existing and regularly updated work - that is in the public domain, and is intended to remain in the public - domain. Therefore, BCPs 78 [RFC5378] and 79 [RFC3979] do not apply - to the TZ Database or contributions that individuals make to it. - Should any claims be made and substantiated against the TZ Database, - the organization that is providing the IANA Considerations defined in - this RFC, under the memorandum of understanding with the IETF, - currently ICANN, may act in accordance with all competent court - orders. No ownership claims will be made by ICANN or the IETF Trust - on the database or the code. Any person making a contribution to the - database or code waives all rights to future claims in that - contribution or in the TZ Database. + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. """ diff --git a/Makefile b/Makefile index 02619fac98ddd7..c01b10f14a8a23 100644 --- a/Makefile +++ b/Makefile @@ -8,9 +8,30 @@ PREFIX ?= /usr/local FLAKY_TESTS ?= run TEST_CI_ARGS ?= STAGINGSERVER ?= node-www - OSTYPE := $(shell uname -s | tr '[A-Z]' '[a-z]') +ifdef JOBS + PARALLEL_ARGS = -j $(JOBS) +endif + +ifdef QUICKCHECK + QUICKCHECK_ARG := --quickcheck +endif + +ifdef ENABLE_V8_TAP + TAP_V8 := --junitout v8-tap.xml + TAP_V8_INTL := --junitout v8-intl-tap.xml + TAP_V8_BENCHMARKS := --junitout v8-benchmarks-tap.xml +endif + +V8_TEST_OPTIONS = $(V8_EXTRA_TEST_OPTIONS) +ifdef DISABLE_V8_I18N + V8_TEST_OPTIONS += --noi18n + V8_BUILD_OPTIONS += i18nsupport=off +endif + +BUILDTYPE_LOWER := $(shell echo $(BUILDTYPE) | tr '[A-Z]' '[a-z]') + # Determine EXEEXT EXEEXT := $(shell $(PYTHON) -c \ "import sys; print('.exe' if sys.platform == 'win32' else '')") @@ -74,19 +95,25 @@ clean: distclean: -rm -rf out - -rm -f config.gypi icu_config.gypi + -rm -f config.gypi icu_config.gypi config_fips.gypi -rm -f config.mk -rm -rf $(NODE_EXE) $(NODE_G_EXE) -rm -rf node_modules -rm -rf deps/icu -rm -rf deps/icu4c*.tgz deps/icu4c*.zip deps/icu-tmp -rm -f $(BINARYTAR).* $(TARBALL).* + -rm -rf deps/v8/testing/gmock + -rm -rf deps/v8/testing/gtest check: test cctest: all @out/$(BUILDTYPE)/$@ +v8: + tools/make-v8.sh v8 + $(MAKE) -C deps/v8 $(V8_ARCH) $(V8_BUILD_OPTIONS) + test: | cctest # Depends on 'all'. $(PYTHON) tools/test.py --mode=release message parallel sequential -J $(MAKE) jslint @@ -104,13 +131,13 @@ test/gc/node_modules/weak/build/Release/weakref.node: $(NODE_EXE) --nodedir="$(shell pwd)" # Implicitly depends on $(NODE_EXE), see the build-addons rule for rationale. -test/addons/.docbuildstamp: doc/api/addons.markdown - $(RM) -r test/addons/doc-*/ +test/addons/.docbuildstamp: doc/api/addons.md + $(RM) -r test/addons/??_*/ $(NODE) tools/doc/addon-verify.js touch $@ ADDONS_BINDING_GYPS := \ - $(filter-out test/addons/doc-*/binding.gyp, \ + $(filter-out test/addons/??_*/binding.gyp, \ $(wildcard test/addons/*/binding.gyp)) # Implicitly depends on $(NODE_EXE), see the build-addons rule for rationale. @@ -144,7 +171,8 @@ test-all-valgrind: test-build $(PYTHON) tools/test.py --mode=debug,release --valgrind test-ci: | build-addons - $(PYTHON) tools/test.py -p tap --logfile test.tap --mode=release --flaky-tests=$(FLAKY_TESTS) \ + $(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \ + --mode=release --flaky-tests=$(FLAKY_TESTS) \ $(TEST_CI_ARGS) addons message parallel sequential test-release: test-build @@ -168,6 +196,9 @@ test-internet: all test-debugger: all $(PYTHON) tools/test.py debugger +test-known-issues: all + $(PYTHON) tools/test.py known_issues --expect-fail + test-npm: $(NODE_EXE) NODE=$(NODE) tools/test-npm.sh @@ -184,9 +215,33 @@ test-timers: test-timers-clean: $(MAKE) --directory=tools clean -apidoc_sources = $(wildcard doc/api/*.markdown) -apidocs = $(addprefix out/,$(apidoc_sources:.markdown=.html)) \ - $(addprefix out/,$(apidoc_sources:.markdown=.json)) +test-v8: + # note: performs full test unless QUICKCHECK is specified + deps/v8/tools/run-tests.py --arch=$(V8_ARCH) \ + --mode=$(BUILDTYPE_LOWER) $(V8_TEST_OPTIONS) $(QUICKCHECK_ARG) \ + --no-presubmit \ + --shell-dir=$(PWD)/deps/v8/out/$(V8_ARCH).$(BUILDTYPE_LOWER) \ + $(TAP_V8) + +test-v8-intl: + # note: performs full test unless QUICKCHECK is specified + deps/v8/tools/run-tests.py --arch=$(V8_ARCH) \ + --mode=$(BUILDTYPE_LOWER) --no-presubmit $(QUICKCHECK_ARG) \ + --shell-dir=deps/v8/out/$(V8_ARCH).$(BUILDTYPE_LOWER) intl \ + $(TAP_V8_INTL) + +test-v8-benchmarks: + deps/v8/tools/run-tests.py --arch=$(V8_ARCH) --mode=$(BUILDTYPE_LOWER) \ + --download-data $(QUICKCHECK_ARG) --no-presubmit \ + --shell-dir=deps/v8/out/$(V8_ARCH).$(BUILDTYPE_LOWER) benchmarks \ + $(TAP_V8_BENCHMARKS) + +test-v8-all: test-v8 test-v8-intl test-v8-benchmarks + # runs all v8 tests + +apidoc_sources = $(wildcard doc/api/*.md) +apidocs = $(addprefix out/,$(apidoc_sources:.md=.html)) \ + $(addprefix out/,$(apidoc_sources:.md=.json)) apidoc_dirs = out/doc out/doc/api/ out/doc/api/assets @@ -203,10 +258,10 @@ out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets/ out/doc/%: doc/% cp -r $< $@ -out/doc/api/%.json: doc/api/%.markdown $(NODE_EXE) +out/doc/api/%.json: doc/api/%.md $(NODE_EXE) $(NODE) tools/doc/generate.js --format=json $< > $@ -out/doc/api/%.html: doc/api/%.markdown $(NODE_EXE) +out/doc/api/%.html: doc/api/%.md $(NODE_EXE) $(NODE) tools/doc/generate.js --format=html --template=doc/template.html $< > $@ docopen: out/doc/api/all.html @@ -272,16 +327,37 @@ else ifeq ($(DESTCPU),arm) ARCH=arm else +ifeq ($(DESTCPU),aarch64) +ARCH=arm64 +else ifeq ($(DESTCPU),ppc64) ARCH=ppc64 else ifeq ($(DESTCPU),ppc) ARCH=ppc else +ifeq ($(DESTCPU),s390) +ARCH=s390 +else +ifeq ($(DESTCPU),s390x) +ARCH=s390x +else ARCH=x86 endif endif endif +endif +endif +endif +endif + +# node and v8 use different arch names (e.g. node 'x86' vs v8 'ia32'). +# pass the proper v8 arch name to $V8_ARCH based on user-specified $DESTCPU. +ifeq ($(DESTCPU),x86) +V8_ARCH=ia32 +else +V8_ARCH ?= $(DESTCPU) + endif # enforce "x86" over "ia32" as the generally accepted way of referring to 32-bit intel @@ -294,7 +370,12 @@ endif TARNAME=node-$(FULLVERSION) TARBALL=$(TARNAME).tar +# Custom user-specified variation, use it directly +ifdef VARIATION +BINARYNAME=$(TARNAME)-$(PLATFORM)-$(ARCH)-$(VARIATION) +else BINARYNAME=$(TARNAME)-$(PLATFORM)-$(ARCH) +endif BINARYTAR=$(BINARYNAME).tar # OSX doesn't have xz installed by default, http://macpkg.sourceforge.net/ XZ=$(shell which xz > /dev/null 2>&1; echo $$?) @@ -363,6 +444,7 @@ $(TARBALL): release-only $(NODE_EXE) doc rm -rf $(TARNAME)/deps/uv/{docs,samples,test} rm -rf $(TARNAME)/deps/openssl/{doc,demos,test} rm -rf $(TARNAME)/deps/zlib/contrib # too big, unused + rm -rf $(TARNAME)/.github # github issue templates find $(TARNAME)/ -type l | xargs rm # annoying on windows tar -cf $(TARNAME).tar $(TARNAME) rm -rf $(TARNAME) @@ -391,7 +473,7 @@ doc-upload: tar scp -pr out/doc/ $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/docs/ ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/docs.done" -$(TARBALL)-headers: config.gypi release-only +$(TARBALL)-headers: release-only $(PYTHON) ./configure \ --prefix=/ \ --dest-cpu=$(DESTCPU) \ @@ -399,7 +481,7 @@ $(TARBALL)-headers: config.gypi release-only --release-urlbase=$(RELEASE_URLBASE) \ $(CONFIG_FLAGS) $(BUILD_RELEASE_FLAGS) HEADERS_ONLY=1 $(PYTHON) tools/install.py install '$(TARNAME)' '/' - find $(TARNAME)/ -type l | xargs rm # annoying on windows + find $(TARNAME)/ -type l | xargs rm -f tar -cf $(TARNAME)-headers.tar $(TARNAME) rm -rf $(TARNAME) gzip -c -f -9 $(TARNAME)-headers.tar > $(TARNAME)-headers.tar.gz @@ -493,10 +575,18 @@ bench-url: all bench-events: all @$(NODE) benchmark/common.js events -bench-all: bench bench-misc bench-array bench-buffer bench-url bench-events +bench-util: all + @$(NODE) benchmark/common.js util + +bench-dgram: all + @$(NODE) benchmark/common.js dgram + +bench-all: bench bench-misc bench-array bench-buffer bench-url bench-events bench-dgram bench-util bench: bench-net bench-http bench-fs bench-tls +bench-ci: bench + bench-http-simple: benchmark/http_simple_bench.sh @@ -506,8 +596,13 @@ bench-idle: $(NODE) benchmark/idle_clients.js & jslint: - $(NODE) tools/eslint/bin/eslint.js src lib test tools/eslint-rules \ - --rulesdir tools/eslint-rules --reset --quiet + $(NODE) tools/jslint.js -J benchmark lib src test tools/doc \ + tools/eslint-rules tools/jslint.js + +jslint-ci: + $(NODE) tools/jslint.js $(PARALLEL_ARGS) -f tap -o test-eslint.tap \ + benchmark lib src test tools/doc \ + tools/eslint-rules tools/jslint.js CPPLINT_EXCLUDE ?= CPPLINT_EXCLUDE += src/node_lttng.cc @@ -517,7 +612,7 @@ CPPLINT_EXCLUDE += src/node_win32_perfctr_provider.cc CPPLINT_EXCLUDE += src/queue.h CPPLINT_EXCLUDE += src/tree.h CPPLINT_EXCLUDE += src/v8abbr.h -CPPLINT_EXCLUDE += $(wildcard test/addons/doc-*/*.cc test/addons/doc-*/*.h) +CPPLINT_EXCLUDE += $(wildcard test/addons/??_*/*.cc test/addons/??_*/*.h) CPPLINT_FILES = $(filter-out $(CPPLINT_EXCLUDE), $(wildcard \ deps/debugger-agent/include/* \ @@ -535,10 +630,13 @@ cpplint: @$(PYTHON) tools/cpplint.py $(CPPLINT_FILES) lint: jslint cpplint +lint-ci: jslint-ci cpplint .PHONY: lint cpplint jslint bench clean docopen docclean doc dist distclean \ check uninstall install install-includes install-bin all staticlib \ dynamiclib test test-all test-addons build-addons website-upload pkg \ blog blogclean tar binary release-only bench-http-simple bench-idle \ bench-all bench bench-misc bench-array bench-buffer bench-net \ - bench-http bench-fs bench-tls cctest run-ci + bench-http bench-fs bench-tls cctest run-ci test-v8 test-v8-intl \ + test-v8-benchmarks test-v8-all v8 lint-ci bench-ci jslint-ci \ + $(TARBALL)-headers diff --git a/Makefile.build b/Makefile.build deleted file mode 100644 index dad86cb517a9e6..00000000000000 --- a/Makefile.build +++ /dev/null @@ -1,499 +0,0 @@ -# Copyright 2012 the V8 project authors. All rights reserved. -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -# Variable default definitions. Override them by exporting them in your shell. -CXX ?= g++ -LINK ?= g++ -OUTDIR ?= out -TESTJOBS ?= -# TODO(bnoordhuis) Make i18n support configurable. -GYPFLAGS ?= -Dv8_enable_i18n_support=0 -TESTFLAGS ?= -ANDROID_NDK_ROOT ?= -ANDROID_NDK_HOST_ARCH ?= -ANDROID_TOOLCHAIN ?= -ANDROID_V8 ?= /data/local/tmp/v8 -NACL_SDK_ROOT ?= - -# Special build flags. Use them like this: "make library=shared" - -# library=shared || component=shared_library -ifeq ($(library), shared) - GYPFLAGS += -Dcomponent=shared_library -endif -ifdef component - GYPFLAGS += -Dcomponent=$(component) -endif -# console=readline -ifdef console - GYPFLAGS += -Dconsole=$(console) -endif -# disassembler=on -ifeq ($(disassembler), on) - GYPFLAGS += -Dv8_enable_disassembler=1 -endif -# objectprint=on -ifeq ($(objectprint), on) - GYPFLAGS += -Dv8_object_print=1 -endif -# verifyheap=on -ifeq ($(verifyheap), on) - GYPFLAGS += -Dv8_enable_verify_heap=1 -endif -# backtrace=off -ifeq ($(backtrace), off) - GYPFLAGS += -Dv8_enable_backtrace=0 -else - GYPFLAGS += -Dv8_enable_backtrace=1 -endif -# verifypredictable=on -ifeq ($(verifypredictable), on) - GYPFLAGS += -Dv8_enable_verify_predictable=1 -endif -# snapshot=off -ifeq ($(snapshot), off) - GYPFLAGS += -Dv8_use_snapshot='false' -endif -# extrachecks=on/off -ifeq ($(extrachecks), on) - GYPFLAGS += -Dv8_enable_extra_checks=1 -Dv8_enable_handle_zapping=1 -endif -ifeq ($(extrachecks), off) - GYPFLAGS += -Dv8_enable_extra_checks=0 -Dv8_enable_handle_zapping=0 -endif -# gdbjit=on/off -ifeq ($(gdbjit), on) - GYPFLAGS += -Dv8_enable_gdbjit=1 -endif -ifeq ($(gdbjit), off) - GYPFLAGS += -Dv8_enable_gdbjit=0 -endif -# vtunejit=on -ifeq ($(vtunejit), on) - GYPFLAGS += -Dv8_enable_vtunejit=1 -endif -# optdebug=on -ifeq ($(optdebug), on) - GYPFLAGS += -Dv8_optimized_debug=2 -endif -# unalignedaccess=on -ifeq ($(unalignedaccess), on) - GYPFLAGS += -Dv8_can_use_unaligned_accesses=true -endif -# randomseed=12345, disable random seed via randomseed=0 -ifdef randomseed - GYPFLAGS += -Dv8_random_seed=$(randomseed) -endif -# soname_version=1.2.3 -ifdef soname_version - GYPFLAGS += -Dsoname_version=$(soname_version) -endif -# werror=no -ifeq ($(werror), no) - GYPFLAGS += -Dwerror='' -endif -# presubmit=no -ifeq ($(presubmit), no) - TESTFLAGS += --no-presubmit -endif -# strictaliasing=off (workaround for GCC-4.5) -ifeq ($(strictaliasing), off) - GYPFLAGS += -Dv8_no_strict_aliasing=1 -endif -# regexp=interpreted -ifeq ($(regexp), interpreted) - GYPFLAGS += -Dv8_interpreted_regexp=1 -endif -# i18nsupport=off -ifeq ($(i18nsupport), off) - GYPFLAGS += -Dv8_enable_i18n_support=0 - TESTFLAGS += --noi18n -endif -# deprecation_warnings=on -ifeq ($(deprecationwarnings), on) - GYPFLAGS += -Dv8_deprecation_warnings=1 -endif -# asan=/path/to/clang++ -ifneq ($(strip $(asan)),) - GYPFLAGS += -Dasan=1 - export CXX=$(asan) - export CXX_host=$(asan) - export LINK=$(asan) - export ASAN_SYMBOLIZER_PATH="$(dir $(asan))llvm-symbolizer" -endif - -# arm specific flags. -# arm_version= -ifneq ($(strip $(arm_version)),) - GYPFLAGS += -Darm_version=$(arm_version) -else -# Deprecated (use arm_version instead): armv7=false/true -ifeq ($(armv7), false) - GYPFLAGS += -Darm_version=6 -else -ifeq ($(armv7), true) - GYPFLAGS += -Darm_version=7 -endif -endif -endif -# hardfp=on/off. Deprecated, use armfloatabi -ifeq ($(hardfp),on) - GYPFLAGS += -Darm_float_abi=hard -else -ifeq ($(hardfp),off) - GYPFLAGS += -Darm_float_abi=softfp -endif -endif -# fpu: armfpu=xxx -# xxx: vfp, vfpv3-d16, vfpv3, neon. -ifeq ($(armfpu),) - GYPFLAGS += -Darm_fpu=default -else - GYPFLAGS += -Darm_fpu=$(armfpu) -endif -# float abi: armfloatabi=softfp/hard -ifeq ($(armfloatabi),) -ifeq ($(hardfp),) - GYPFLAGS += -Darm_float_abi=default -endif -else - GYPFLAGS += -Darm_float_abi=$(armfloatabi) -endif -# armthumb=on/off -ifeq ($(armthumb), off) - GYPFLAGS += -Darm_thumb=0 -else -ifeq ($(armthumb), on) - GYPFLAGS += -Darm_thumb=1 -endif -endif -# arm_test_noprobe=on -# With this flag set, by default v8 will only use features implied -# by the compiler (no probe). This is done by modifying the default -# values of enable_armv7, enable_vfp3, enable_32dregs and enable_neon. -# Modifying these flags when launching v8 will enable the probing for -# the specified values. -ifeq ($(arm_test_noprobe), on) - GYPFLAGS += -Darm_test_noprobe=on -endif - -# ----------------- available targets: -------------------- -# - "builddeps": pulls in external dependencies for building -# - "dependencies": pulls in all external dependencies -# - "grokdump": rebuilds heap constants lists used by grokdump -# - any arch listed in ARCHES (see below) -# - any mode listed in MODES -# - every combination ., e.g. "ia32.release" -# - "native": current host's architecture, release mode -# - any of the above with .check appended, e.g. "ia32.release.check" -# - "android": cross-compile for Android/ARM -# - "nacl" : cross-compile for Native Client (ia32 and x64) -# - default (no target specified): build all DEFAULT_ARCHES and MODES -# - "check": build all targets and run all tests -# - ".clean" for any in ARCHES -# - "clean": clean all ARCHES - -# ----------------- internal stuff ------------------------ - -# Architectures and modes to be compiled. Consider these to be internal -# variables, don't override them (use the targets instead). -ARCHES = ia32 x64 x32 arm arm64 mips mipsel mips64el x87 -DEFAULT_ARCHES = ia32 x64 arm -MODES = release debug optdebug -DEFAULT_MODES = release debug -ANDROID_ARCHES = android_ia32 android_arm android_arm64 android_mipsel android_x87 -NACL_ARCHES = nacl_ia32 nacl_x64 - -# List of files that trigger Makefile regeneration: -GYPFILES = \ - common.gypi \ - deps/cares/cares.gyp \ - deps/http_parser/http_parser.gyp \ - deps/openssl/openssl.gyp \ - deps/uv/uv.gyp \ - deps/v8/tools/gyp/v8.gyp \ - deps/zlib/zlib.gyp \ - node.gyp \ - -# If vtunejit=on, the v8vtune.gyp will be appended. -ifeq ($(vtunejit), on) - GYPFILES += src/third_party/vtune/v8vtune.gyp -endif -# Generates all combinations of ARCHES and MODES, e.g. "ia32.release". -BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES))) -ANDROID_BUILDS = $(foreach mode,$(MODES), \ - $(addsuffix .$(mode),$(ANDROID_ARCHES))) -NACL_BUILDS = $(foreach mode,$(MODES), \ - $(addsuffix .$(mode),$(NACL_ARCHES))) -# Generates corresponding test targets, e.g. "ia32.release.check". -CHECKS = $(addsuffix .check,$(BUILDS)) -QUICKCHECKS = $(addsuffix .quickcheck,$(BUILDS)) -ANDROID_CHECKS = $(addsuffix .check,$(ANDROID_BUILDS)) -NACL_CHECKS = $(addsuffix .check,$(NACL_BUILDS)) -# File where previously used GYPFLAGS are stored. -ENVFILE = $(OUTDIR)/environment - -.PHONY: all check clean builddeps dependencies $(ENVFILE).new native \ - qc quickcheck $(QUICKCHECKS) \ - $(addsuffix .quickcheck,$(MODES)) $(addsuffix .quickcheck,$(ARCHES)) \ - $(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \ - $(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES)) \ - $(ANDROID_ARCHES) $(ANDROID_BUILDS) $(ANDROID_CHECKS) \ - must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN \ - $(NACL_ARCHES) $(NACL_BUILDS) $(NACL_CHECKS) \ - must-set-NACL_SDK_ROOT - -# Target definitions. "all" is the default. -all: $(DEFAULT_MODES) - -# Special target for the buildbots to use. Depends on $(OUTDIR)/Makefile -# having been created before. -buildbot: - $(MAKE) -C "$(OUTDIR)" BUILDTYPE=$(BUILDTYPE) \ - builddir="$(abspath $(OUTDIR))/$(BUILDTYPE)" - -# Compile targets. MODES and ARCHES are convenience targets. -.SECONDEXPANSION: -$(MODES): $(addsuffix .$$@,$(DEFAULT_ARCHES)) - -$(ARCHES): $(addprefix $$@.,$(DEFAULT_MODES)) - -# Defines how to build a particular target (e.g. ia32.release). -$(BUILDS): $(OUTDIR)/Makefile.$$@ - @$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \ - CXX="$(CXX)" LINK="$(LINK)" \ - BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ - python -c "print \ - raw_input().replace('opt', '').capitalize()") \ - builddir="$(shell pwd)/$(OUTDIR)/$@" - -native: $(OUTDIR)/Makefile.native - @$(MAKE) -C "$(OUTDIR)" -f Makefile.native \ - CXX="$(CXX)" LINK="$(LINK)" BUILDTYPE=Release \ - builddir="$(shell pwd)/$(OUTDIR)/$@" - -$(ANDROID_ARCHES): $(addprefix $$@.,$(MODES)) - -$(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) build/android.gypi \ - must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN Makefile.android - @$(MAKE) -f Makefile.android $@ \ - ARCH="$(basename $@)" \ - MODE="$(subst .,,$(suffix $@))" \ - OUTDIR="$(OUTDIR)" \ - GYPFLAGS="$(GYPFLAGS)" - -$(NACL_ARCHES): $(addprefix $$@.,$(MODES)) - -$(NACL_BUILDS): $(GYPFILES) $(ENVFILE) \ - Makefile.nacl must-set-NACL_SDK_ROOT - @$(MAKE) -f Makefile.nacl $@ \ - ARCH="$(basename $@)" \ - MODE="$(subst .,,$(suffix $@))" \ - OUTDIR="$(OUTDIR)" \ - GYPFLAGS="$(GYPFLAGS)" - -# Test targets. -check: all - @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ - --arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \ - $(TESTFLAGS) - -$(addsuffix .check,$(MODES)): $$(basename $$@) - @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ - --mode=$(basename $@) $(TESTFLAGS) - -$(addsuffix .check,$(ARCHES)): $$(basename $$@) - @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ - --arch=$(basename $@) $(TESTFLAGS) - -$(CHECKS): $$(basename $$@) - @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ - --arch-and-mode=$(basename $@) $(TESTFLAGS) - -$(addsuffix .quickcheck,$(MODES)): $$(basename $$@) - @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ - --mode=$(basename $@) $(TESTFLAGS) --quickcheck - -$(addsuffix .quickcheck,$(ARCHES)): $$(basename $$@) - @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ - --arch=$(basename $@) $(TESTFLAGS) --quickcheck - -$(QUICKCHECKS): $$(basename $$@) - @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ - --arch-and-mode=$(basename $@) $(TESTFLAGS) --quickcheck - -$(addsuffix .sync, $(ANDROID_BUILDS)): $$(basename $$@) - @tools/android-sync.sh $(basename $@) $(OUTDIR) \ - $(shell pwd) $(ANDROID_V8) - -$(addsuffix .check, $(ANDROID_BUILDS)): $$(basename $$@).sync - @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ - --arch-and-mode=$(basename $@) \ - --timeout=600 \ - --command-prefix="tools/android-run.py" $(TESTFLAGS) - -$(addsuffix .check, $(ANDROID_ARCHES)): \ - $(addprefix $$(basename $$@).,$(MODES)).check - -$(addsuffix .check, $(NACL_BUILDS)): $$(basename $$@) - @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ - --arch-and-mode=$(basename $@) \ - --timeout=600 --nopresubmit --noi18n \ - --command-prefix="tools/nacl-run.py" - -$(addsuffix .check, $(NACL_ARCHES)): \ - $(addprefix $$(basename $$@).,$(MODES)).check - -native.check: native - @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR)/native \ - --arch-and-mode=. $(TESTFLAGS) - -SUPERFASTTESTMODES = ia32.release -FASTTESTMODES = $(SUPERFASTTESTMODES),x64.release,ia32.optdebug,x64.optdebug,arm.optdebug,arm64.release -FASTCOMPILEMODES = $(FASTTESTMODES),arm64.optdebug - -COMMA = , -EMPTY = -SPACE = $(EMPTY) $(EMPTY) -quickcheck: $(subst $(COMMA),$(SPACE),$(FASTCOMPILEMODES)) - tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ - --arch-and-mode=$(SUPERFASTTESTMODES) $(TESTFLAGS) --quickcheck \ - --download-data mozilla webkit - tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ - --arch-and-mode=$(FASTTESTMODES) $(TESTFLAGS) --quickcheck -qc: quickcheck - -# Clean targets. You can clean each architecture individually, or everything. -$(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES) $(NACL_ARCHES)): - rm -f $(OUTDIR)/Makefile.$(basename $@)* - rm -rf $(OUTDIR)/$(basename $@).release - rm -rf $(OUTDIR)/$(basename $@).debug - rm -rf $(OUTDIR)/$(basename $@).optdebug - find $(OUTDIR) -regex '.*\(host\|target\)\.$(basename $@).*\.mk' -delete - -native.clean: - rm -f $(OUTDIR)/Makefile.native - rm -rf $(OUTDIR)/native - find $(OUTDIR) -regex '.*\(host\|target\)\.native\.mk' -delete - -clean: $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES) $(NACL_ARCHES)) native.clean gtags.clean - -# GYP file generation targets. -OUT_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(BUILDS)) -$(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE) - $(eval CXX_TARGET_ARCH:=$(shell $(CXX) -v 2>&1 | grep ^Target: | \ - cut -f 2 -d " " | cut -f 1 -d "-" )) - $(eval CXX_TARGET_ARCH:=$(subst aarch64,arm64,$(CXX_TARGET_ARCH))) - $(eval V8_TARGET_ARCH:=$(subst .,,$(suffix $(basename $@)))) - GYP_GENERATORS=make \ - tools/gyp/gyp --generator-output="$(OUTDIR)" node.gyp \ - -Icommon.gypi --depth=. \ - -Dtarget_arch=$(V8_TARGET_ARCH) \ - -Dv8_target_arch=$(V8_TARGET_ARCH) \ - $(if $(findstring $(CXX_TARGET_ARCH),$(V8_TARGET_ARCH)), \ - -Dtarget_arch=$(V8_TARGET_ARCH),) \ - $(if $(findstring optdebug,$@),-Dv8_optimized_debug=2,) \ - -S$(suffix $(basename $@))$(suffix $@) $(GYPFLAGS) - -$(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE) - GYP_GENERATORS=make \ - tools/gyp/gyp --generator-output="$(OUTDIR)" node.gyp \ - -Icommon.gypi --depth=. -S.native $(GYPFLAGS) - -must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN: -ifndef ANDROID_NDK_ROOT -ifndef ANDROID_TOOLCHAIN - $(error ANDROID_NDK_ROOT or ANDROID_TOOLCHAIN must be set)) -endif -endif - -# Note that NACL_SDK_ROOT must be set to point to an appropriate -# Native Client SDK before using this makefile. You can download -# an SDK here: -# https://developers.google.com/native-client/sdk/download -# The path indicated by NACL_SDK_ROOT will typically end with -# a folder for a pepper version such as "pepper_25" that should -# have "tools" and "toolchain" subdirectories. -must-set-NACL_SDK_ROOT: -ifndef NACL_SDK_ROOT - $(error NACL_SDK_ROOT must be set) -endif - -# Replaces the old with the new environment file if they're different, which -# will trigger GYP to regenerate Makefiles. -$(ENVFILE): $(ENVFILE).new - @if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) > /dev/null; \ - then rm $(ENVFILE).new; \ - else mv $(ENVFILE).new $(ENVFILE); fi - -# Stores current GYPFLAGS in a file. -$(ENVFILE).new: - @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; \ - echo "CXX=$(CXX)" >> $(ENVFILE).new - -# Heap constants for grokdump. -DUMP_FILE = tools/v8heapconst.py -grokdump: ia32.release - @cat $(DUMP_FILE).tmpl > $(DUMP_FILE) - @$(OUTDIR)/ia32.release/d8 --dump-heap-constants >> $(DUMP_FILE) - -# Support for the GNU GLOBAL Source Code Tag System. -gtags.files: $(GYPFILES) $(ENVFILE) - @find include src test -name '*.h' -o -name '*.cc' -o -name '*.c' > $@ - -# We need to manually set the stack limit here, to work around bugs in -# gmake-3.81 and global-5.7.1 on recent 64-bit Linux systems. -GPATH GRTAGS GSYMS GTAGS: gtags.files $(shell cat gtags.files 2> /dev/null) - @bash -c 'ulimit -s 10240 && GTAGSFORCECPP=yes gtags -i -q -f $<' - -gtags.clean: - rm -f gtags.files GPATH GRTAGS GSYMS GTAGS - -# Dependencies. "builddeps" are dependencies required solely for building, -# "dependencies" includes also dependencies required for development. -# Remember to keep these in sync with the DEPS file. -builddeps: - svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \ - --revision 1831 - if svn info third_party/icu 2>&1 | grep -q icu46 ; then \ - svn switch --force \ - https://src.chromium.org/chrome/trunk/deps/third_party/icu52 \ - third_party/icu --revision 277999 ; \ - else \ - svn checkout --force \ - https://src.chromium.org/chrome/trunk/deps/third_party/icu52 \ - third_party/icu --revision 277999 ; \ - fi - svn checkout --force http://googletest.googlecode.com/svn/trunk \ - testing/gtest --revision 692 - svn checkout --force http://googlemock.googlecode.com/svn/trunk \ - testing/gmock --revision 485 - -dependencies: builddeps - # The spec is a copy of the hooks in v8's DEPS file. - gclient sync -r fb782d4369d5ae04f17a2fceef7de5a63e50f07b --spec="solutions = [{u'managed': False, u'name': u'buildtools', u'url': u'https://chromium.googlesource.com/chromium/buildtools.git', u'custom_deps': {}, u'custom_hooks': [{u'name': u'clang_format_win',u'pattern': u'.',u'action': [u'download_from_google_storage',u'--no_resume',u'--platform=win32',u'--no_auth',u'--bucket',u'chromium-clang-format',u'-s',u'buildtools/win/clang-format.exe.sha1']},{u'name': u'clang_format_mac',u'pattern': u'.',u'action': [u'download_from_google_storage',u'--no_resume',u'--platform=darwin',u'--no_auth',u'--bucket',u'chromium-clang-format',u'-s',u'buildtools/mac/clang-format.sha1']},{u'name': u'clang_format_linux',u'pattern': u'.',u'action': [u'download_from_google_storage',u'--no_resume',u'--platform=linux*',u'--no_auth',u'--bucket',u'chromium-clang-format',u'-s',u'buildtools/linux64/clang-format.sha1']}],u'deps_file': u'.DEPS.git', u'safesync_url': u''}]" diff --git a/README.md b/README.md index 7e7b17470f4513..99113d55e8755c 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,61 @@ - Node.js -===== +======= [![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/nodejs/node?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -This repository began as a GitHub fork of -[joyent/node](https://github.com/joyent/node). - -Node.js contributions, releases, and contributorship are under an -[open governance model](./GOVERNANCE.md). -We intend to land, with increasing regularity, releases which are -compatible with the npm ecosystem that has been built to date for -Node.js. +Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js +uses an event-driven, non-blocking I/O model that makes it lightweight and +efficient. The Node.js package ecosystem, npm, is the largest ecosystem of open +source libraries in the world. + +The Node.js project is supported by the +[Node.js Foundation](https://nodejs.org/en/foundation/). Contributions, +policies and releases are managed under an +[open governance model](./GOVERNANCE.md). We are also bound by a +[Code of Conduct](./CODE_OF_CONDUCT.md). + +If you need help using or installing Node.js, please use the +[nodejs/help](https://github.com/nodejs/help) issue tracker. + +## Release Types + +The Node.js project maintains multiple types of releases: + +* **Stable**: Released from active development branches of this repository, + versioned by [SemVer](http://semver.org/) and signed by a member of the + [Release Team](#release-team). + Code for Stable releases is organized in this repository by major version + number, For example: [v4.x](https://github.com/nodejs/node/tree/v4.x). + The major version number of Stable releases will increment every 6 months + allowing for breaking changes to be introduced. This happens in April and + October every year. Stable release lines beginning in October each year have + a maximum support life of 8 months. Stable release lines beginning in April + each year will convert to LTS (see below) after 6 months and receive further + support for 30 months. +* **LTS**: Releases that receive Long-term Support, with a focus on stability + and security. Every second Stable release line (major version) will become an + LTS line and receive 18 months of _Active LTS_ support and a further 12 + months of _Maintenance_. LTS release lines are given alphabetically + ordered codenames, beginning with v4 Argon. LTS releases are less frequent + and will attempt to maintain consistent major and minor version numbers, + only incrementing patch version numbers. There are no breaking changes or + feature additions, except in some special circumstances. More information + can be found in the [LTS README](https://github.com/nodejs/LTS/). +* **Nightly**: Versions of code in this repository on the current Stable + branch, automatically built every 24-hours where changes exist. Use with + caution. ## Download Binaries, installers, and source tarballs are available at . -**Releases** are available at , listed under -their version string. The symlink -will point to the latest release directory. +**Stable** and **LTS** releases are available at +, listed under their version strings. +The [latest](https://nodejs.org/download/release/latest/) directory is an +alias for the latest Stable release. The latest LTS release from an LTS +line is available in the form: latest-_codename_. For example: + **Nightly** builds are available at , listed under their version @@ -28,13 +63,22 @@ string which includes their date (in UTC time) and the commit SHA at the HEAD of the release. **API documentation** is available in each release and nightly -directory under _docs_. points to the latest version. +directory under _docs_. points to the API +documentation of the latest stable version. ### Verifying Binaries -Release and nightly download directories all contain a *SHASUM256.txt* +Stable, LTS and Nightly download directories all contain a *SHASUM256.txt* file that lists the SHA checksums for each file available for -download. To check that a downloaded file matches the checksum, run +download. + +The *SHASUM256.txt* can be downloaded using curl. + +``` +$ curl -O https://nodejs.org/dist/vx.y.z/SHASUMS256.txt +``` + +To check that a downloaded file matches the checksum, run it through `sha256sum` with a command such as: ``` @@ -44,9 +88,9 @@ $ grep node-vx.y.z.tar.gz SHASUMS256.txt | sha256sum -c - _(Where "node-vx.y.z.tar.gz" is the name of the file you have downloaded)_ -Additionally, releases (not nightlies) have GPG signed copies of -SHASUM256.txt files available as SHASUM256.txt.asc. You can use `gpg` -to verify that the file has not been tampered with. +Additionally, Stable and LTS releases (not Nightlies) have GPG signed +copies of SHASUM256.txt files available as SHASUM256.txt.asc. You can use +`gpg` to verify that the file has not been tampered with. To verify a SHASUM256.txt.asc, you will first need to import all of the GPG keys of individuals authorized to create releases. They are @@ -67,256 +111,27 @@ file has been signed by an authorized member of the Node.js team. Once verified, use the SHASUMS256.txt.asc file to get the checksum for the binary verification command above. -## Build - -### Unix / Macintosh - -Prerequisites: - -* `gcc` and `g++` 4.8 or newer, or -* `clang` and `clang++` 3.4 or newer -* Python 2.6 or 2.7 -* GNU Make 3.81 or newer -* libexecinfo (FreeBSD and OpenBSD only) - -```text -$ ./configure -$ make -$ [sudo] make install -``` - -If your Python binary is in a non-standard location or has a -non-standard name, run the following instead: - -```text -$ export PYTHON=/path/to/python -$ $PYTHON ./configure -$ make -$ [sudo] make install -``` - -To run the tests: - -```text -$ make test -``` - -To build the documentation: - -```text -$ make doc -``` - -To read the documentation: - -```text -$ man doc/node.1 -``` - -To test if Node.js was built correctly: - -``` -$ node -e "console.log('Hello from node.js ' + process.version)" -``` - -### Windows - -Prerequisites: - -* [Python 2.6 or 2.7](https://www.python.org/downloads/) -* Visual Studio 2013 for Windows Desktop, or -* Visual Studio Express 2013 for Windows Desktop -* Basic Unix tools required for some tests, - [Git for Windows](http://git-scm.com/download/win) includes Git Bash - and tools which can be included in the global `PATH`. - -```text -> vcbuild nosign -``` - -To run the tests: - -```text -> vcbuild test -``` - -To test if Node.js was built correctly: - -``` -$ node -e "console.log('Hello from node.js ' + process.version)" -``` - -### Android / Android based devices, aka. Firefox OS - -Be sure you have downloaded and extracted [Android NDK] -(https://developer.android.com/tools/sdk/ndk/index.html) -before in a folder. Then run: - -``` -$ ./android-configure /path/to/your/android-ndk -$ make -``` - -### `Intl` (ECMA-402) support: - -[Intl](https://github.com/nodejs/node/wiki/Intl) support is not -enabled by default. - -#### "small" (English only) support - -This option will build with "small" (English only) support, but -the full `Intl` (ECMA-402) APIs. With `--download=all` it will -download the ICU library as needed. - -Unix / Macintosh: +## Building Node.js -```text -$ ./configure --with-intl=small-icu --download=all -``` - -Windows: - -```text -> vcbuild small-icu download-all -``` - -The `small-icu` mode builds with English-only data. You can add full -data at runtime. - -*Note:* more docs are on -[the node wiki](https://github.com/nodejs/node/wiki/Intl). - -#### Build with full ICU support (all locales supported by ICU): - -With the `--download=all`, this may download ICU if you don't have an -ICU in `deps/icu`. - -Unix / Macintosh: - -```text -$ ./configure --with-intl=full-icu --download=all -``` - -Windows: - -```text -> vcbuild full-icu download-all -``` - -#### Build with no Intl support `:-(` - -The `Intl` object will not be available. This is the default at -present, so this option is not normally needed. - -Unix / Macintosh: - -```text -$ ./configure --with-intl=none -``` - -Windows: - -```text -> vcbuild intl-none -``` - -#### Use existing installed ICU (Unix / Macintosh only): - -```text -$ pkg-config --modversion icu-i18n && ./configure --with-intl=system-icu -``` +See [BUILDING.md](BUILDING.md) for instructions on how to build +Node.js from source. -#### Build with a specific ICU: - -You can find other ICU releases at -[the ICU homepage](http://icu-project.org/download). -Download the file named something like `icu4c-**##.#**-src.tgz` (or -`.zip`). - -Unix / Macintosh - -```text -# from an already-unpacked ICU: -$ ./configure --with-intl=[small-icu,full-icu] --with-icu-source=/path/to/icu - -# from a local ICU tarball -$ ./configure --with-intl=[small-icu,full-icu] --with-icu-source=/path/to/icu.tgz - -# from a tarball URL -$ ./configure --with-intl=full-icu --with-icu-source=http://url/to/icu.tgz -``` - -Windows - -First unpack latest ICU to `deps/icu` -[icu4c-**##.#**-src.tgz](http://icu-project.org/download) (or `.zip`) -as `deps/icu` (You'll have: `deps/icu/source/...`) - -```text -> vcbuild full-icu -``` - -# Building Node.js with FIPS-compliant OpenSSL - -NOTE: Windows is not yet supported - -It is possible to build Node.js with -[OpenSSL FIPS module](https://www.openssl.org/docs/fips/fipsnotes.html). - -**Note** that building in this way does **not** allow you to -claim that the runtime is FIPS 140-2 validated. Instead you -can indicate that the runtime uses a validated module. See -the [security policy] -(http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1747.pdf) -page 60 for more details. In addition, the validation for -the underlying module is only valid if it is deployed in -accordance with its [security policy] -(http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1747.pdf). -If you need FIPS validated cryptography it is recommended that you -read both the [security policy] -(http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1747.pdf) -and [user guide] (https://openssl.org/docs/fips/UserGuide-2.0.pdf). - -Instructions: - -1. Obtain a copy of openssl-fips-x.x.x.tar.gz. - To comply with the security policy you must ensure the path - through which you get the file complies with the requirements - for a "secure installation" as described in section 6.6 in - the [user guide] (https://openssl.org/docs/fips/UserGuide-2.0.pdf). - For evaluation/experimentation you can simply download and verify - `openssl-fips-x.x.x.tar.gz` from https://www.openssl.org/source/ -2. Extract source to `openssl-fips` folder and `cd openssl-fips` -3. `./config` -4. `make` -5. `make install` - (NOTE: to comply with the security policy you must use the exact - commands in steps 3-5 without any additional options as per - Appendix A in the [security policy] - (http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1747.pdf). - The only exception is that `./config no-asm` can be - used in place of `./config` ) -6. Get into Node.js checkout folder -7. `./configure --openssl-fips=/path/to/openssl-fips/installdir` - For example on ubuntu 12 the installation directory was - /usr/local/ssl/fips-2.0 -8. Build Node.js with `make -j` -9. Verify with `node -p "process.versions.openssl"` (`1.0.2a-fips`) ## Resources for Newcomers +* [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) * [CONTRIBUTING.md](./CONTRIBUTING.md) * [GOVERNANCE.md](./GOVERNANCE.md) -* IRC: - [#io.js on Freenode.net](http://webchat.freenode.net?channels=io.js&uio=d4) +* IRC (general questions): [#node.js on Freenode.net](https://webchat.freenode.net?channels=node.js&uio=d4) +* IRC (node core development): [#node-dev on Freenode.net](https://webchat.freenode.net?channels=node-dev&uio=d4) * [nodejs/node on Gitter](https://gitter.im/nodejs/node) ## Security -All security bugs in node.js are taken seriously and should be reported by +All security bugs in Node.js are taken seriously and should be reported by emailing security@nodejs.org. This will be delivered to a subset of the project team who handle security issues. Please don't disclose security bugs -public until they have been handled by the security team. +publicly until they have been handled by the security team. Your email will be acknowledged within 24 hours, and you’ll receive a more detailed response to your email within 48 hours indicating the next steps in @@ -325,74 +140,96 @@ handling your 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 +that forms the _Core Technical Committee_ (CTC) which governs the project. For more information about the governance of the Node.js project, see [GOVERNANCE.md](./GOVERNANCE.md). -### TSC (Technical Steering Committee) +### CTC (Core Technical Committee) * [bnoordhuis](https://github.com/bnoordhuis) - **Ben Noordhuis** <info@bnoordhuis.nl> +* [ChALkeR](https://github.com/ChALkeR) - **Сковорода Никита Андреевич** <chalkerx@gmail.com> * [chrisdickinson](https://github.com/chrisdickinson) - **Chris Dickinson** <christopher.s.dickinson@gmail.com> * [cjihrig](https://github.com/cjihrig) - **Colin Ihrig** <cjihrig@gmail.com> +* [evanlucas](https://github.com/evanlucas) - **Evan Lucas** <evanlucas@me.com> * [fishrock123](https://github.com/fishrock123) - **Jeremiah Senkpiel** <fishrock123@rocketmail.com> * [indutny](https://github.com/indutny) - **Fedor Indutny** <fedor.indutny@gmail.com> * [jasnell](https://github.com/jasnell) - **James M Snell** <jasnell@gmail.com> +* [mhdawson](https://github.com/mhdawson) - **Michael Dawson** <michael_dawson@ca.ibm.com> * [misterdjules](https://github.com/misterdjules) - **Julien Gilli** <jgilli@nodejs.org> * [mscdex](https://github.com/mscdex) - **Brian White** <mscdex@mscdex.net> +* [ofrobots](https://github.com/ofrobots) - **Ali Ijaz Sheikh** <ofrobots@google.com> * [orangemocha](https://github.com/orangemocha) - **Alexis Campailla** <orangemocha@nodejs.org> * [piscisaureus](https://github.com/piscisaureus) - **Bert Belder** <bertbelder@gmail.com> * [rvagg](https://github.com/rvagg) - **Rod Vagg** <rod@vagg.org> * [shigeki](https://github.com/shigeki) - **Shigeki Ohtsu** <ohtsu@iij.ad.jp> * [trevnorris](https://github.com/trevnorris) - **Trevor Norris** <trev.norris@gmail.com> +* [Trott](https://github.com/Trott) - **Rich Trott** <rtrott@gmail.com> ### Collaborators +* [addaleax](https://github.com/addaleax) - **Anna Henningsen** <anna@addaleax.net> +* [AndreasMadsen](https://github.com/AndreasMadsen) - **Andreas Madsen** <amwebdk@gmail.com> +* [benjamingr](https://github.com/benjamingr) - **Benjamin Gruenbaum** <benjamingr@gmail.com> * [brendanashworth](https://github.com/brendanashworth) - **Brendan Ashworth** <brendan.ashworth@me.com> -* [ChALkeR](https://github.com/ChALkeR) - **Сковорода Никита Андреевич** <chalkerx@gmail.com> +* [calvinmetcalf](https://github.com/calvinmetcalf) - **Calvin Metcalf** <calvin.metcalf@gmail.com> +* [claudiorodriguez](https://github.com/claudiorodriguez) - **Claudio Rodriguez** <cjrodr@yahoo.com> * [domenic](https://github.com/domenic) - **Domenic Denicola** <d@domenic.me> -* [evanlucas](https://github.com/evanlucas) - **Evan Lucas** <evanlucas@me.com> * [geek](https://github.com/geek) - **Wyatt Preul** <wpreul@gmail.com> +* [iarna](https://github.com/iarna) - **Rebecca Turner** <me@re-becca.org> * [isaacs](https://github.com/isaacs) - **Isaac Z. Schlueter** <i@izs.me> +* [iWuzHere](https://github.com/iWuzHere) - **Imran Iqbal** <imran@imraniqbal.org> * [jbergstroem](https://github.com/jbergstroem) - **Johan Bergström** <bugs@bergstroem.nu> * [joaocgreis](https://github.com/joaocgreis) - **João Reis** <reis@janeasystems.com> * [julianduque](https://github.com/julianduque) - **Julian Duque** <julianduquej@gmail.com> +* [JungMinu](https://github.com/JungMinu) - **Minwoo Jung** <jmwsoft@gmail.com> * [lxe](https://github.com/lxe) - **Aleksey Smolenchuk** <lxe@lxe.co> -* [mhdawson](https://github.com/mhdawson) - **Michael Dawson** <michael_dawson@ca.ibm.com> +* [matthewloring](https://github.com/matthewloring) - **Matthew Loring** <mattloring@google.com> +* [mcollina](https://github.com/mcollina) - **Matteo Collina** <matteo.collina@gmail.com> * [micnic](https://github.com/micnic) - **Nicu Micleușanu** <micnic90@gmail.com> * [mikeal](https://github.com/mikeal) - **Mikeal Rogers** <mikeal.rogers@gmail.com> * [monsanto](https://github.com/monsanto) - **Christopher Monsanto** <chris@monsan.to> -* [ofrobots](https://github.com/ofrobots) - **Ali Ijaz Sheikh** <ofrobots@google.com> * [Olegas](https://github.com/Olegas) - **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> * [qard](https://github.com/qard) - **Stephen Belanger** <admin@stephenbelanger.com> * [rlidwka](https://github.com/rlidwka) - **Alex Kocharin** <alex@kocharin.ru> +* [rmg](https://github.com/rmg) - **Ryan Graham** <r.m.graham@gmail.com> * [robertkowalski](https://github.com/robertkowalski) - **Robert Kowalski** <rok@kowalski.gd> +* [romankl](https://github.com/romankl) - **Roman Klauke** <romaaan.git@gmail.com> +* [saghul](https://github.com/saghul) - **Saúl Ibarra Corretgé** <saghul@gmail.com> * [sam-github](https://github.com/sam-github) - **Sam Roberts** <vieuxtech@gmail.com> +* [santigimeno](https://github.com/santigimeno) - **Santiago Gimeno** <santiago.gimeno@gmail.com> * [seishun](https://github.com/seishun) - **Nikolai Vavilov** <vvnicholas@gmail.com> * [silverwind](https://github.com/silverwind) - **Roman Reiss** <me@silverwind.io> * [srl295](https://github.com/srl295) - **Steven R Loomis** <srloomis@us.ibm.com> +* [stefanmb](https://github.com/stefanmb) - **Stefan Budeanu** <stefan@budeanu.com> * [targos](https://github.com/targos) - **Michaël Zasso** <mic.besace@gmail.com> * [tellnes](https://github.com/tellnes) - **Christian Tellnes** <christian@tellnes.no> +* [thealphanerd](https://github.com/thealphanerd) - **Myles Borins** <myles.borins@gmail.com> * [thefourtheye](https://github.com/thefourtheye) - **Sakthipriyan Vairamani** <thechargingvolcano@gmail.com> +* [thekemkid](https://github.com/thekemkid) - **Glen Keane** <glenkeane.94@gmail.com> * [thlorenz](https://github.com/thlorenz) - **Thorsten Lorenz** <thlorenz@gmx.de> -* [Trott](https://github.com/Trott) - **Rich Trott** <rtrott@gmail.com> * [tunniclm](https://github.com/tunniclm) - **Mike Tunnicliffe** <m.j.tunnicliffe@gmail.com> * [vkurchatkin](https://github.com/vkurchatkin) - **Vladimir Kurchatkin** <vladimir.kurchatkin@gmail.com> +* [whitlockjc](https://github.com/whitlockjc) - **Jeremy Whitlock** <jwhitlock@apache.org> * [yosuke-furukawa](https://github.com/yosuke-furukawa) - **Yosuke Furukawa** <yosuke.furukawa@gmail.com> +* [zkat](https://github.com/zkat) - **Kat Marchán** <kzm@sykosomatic.org> -Collaborators & TSC members follow the [COLLABORATOR_GUIDE.md](./COLLABORATOR_GUIDE.md) in +Collaborators & CTC members follow the [COLLABORATOR_GUIDE.md](./COLLABORATOR_GUIDE.md) in maintaining the Node.js project. ### Release Team Releases of Node.js and io.js will be signed with one of the following GPG keys: -* **Chris Dickinson** <christopher.s.dickinson@gmail.com>: `9554F04D7259F04124DE6B476D5A82AC7E37093B` +* **Chris Dickinson** <christopher.s.dickinson@gmail.com> `9554F04D7259F04124DE6B476D5A82AC7E37093B` * **Colin Ihrig** <cjihrig@gmail.com> `94AE36675C464D64BAFA68DD7434390BDBE9B9C5` -* **Sam Roberts** <octetcloud@keybase.io> `0034A06D9D9B0064CE8ADF6BF1747F4AD2306D93` -* **Jeremiah Senkpiel** <fishrock@keybase.io> `FD3A5288F042B6850C66B31F09FE44734EB7990E` +* **Evan Lucas** <evanlucas@me.com> `B9AE9905FFD7803F25714661B63B535A4C206CA9` * **James M Snell** <jasnell@keybase.io> `71DCFD284A79C3B38668286BC97EC7A07EDE3FC1` +* **Jeremiah Senkpiel** <fishrock@keybase.io> `FD3A5288F042B6850C66B31F09FE44734EB7990E` +* **Myles Borins** <myles.borins@gmail.com> `C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8` * **Rod Vagg** <rod@vagg.org> `DD8F2338BAE7501E3DD5AC78C273792F7D83545D` +* **Sam Roberts** <octetcloud@keybase.io> `0034A06D9D9B0064CE8ADF6BF1747F4AD2306D93` The full set of trusted release keys can be imported by running: @@ -403,6 +240,8 @@ gpg --keyserver pool.sks-keyservers.net --recv-keys 0034A06D9D9B0064CE8ADF6BF174 gpg --keyserver pool.sks-keyservers.net --recv-keys FD3A5288F042B6850C66B31F09FE44734EB7990E gpg --keyserver pool.sks-keyservers.net --recv-keys 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 gpg --keyserver pool.sks-keyservers.net --recv-keys DD8F2338BAE7501E3DD5AC78C273792F7D83545D +gpg --keyserver pool.sks-keyservers.net --recv-keys C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 +gpg --keyserver pool.sks-keyservers.net --recv-keys B9AE9905FFD7803F25714661B63B535A4C206CA9 ``` See the section above on [Verifying Binaries](#verifying-binaries) for @@ -411,6 +250,6 @@ details on what to do with these keys to verify that a downloaded file is offici Previous releases of Node.js have been signed with one of the following GPG keys: -* Julien Gilli <jgilli@fastmail.fm> `114F43EE0176B71C7BC219DD50A3051F888C628D` -* Timothy J Fontaine <tjfontaine@gmail.com> `7937DFD2AB06298B2293C3187D33FF9D0246406D` -* Isaac Z. Schlueter <i@izs.me> `93C7E9E91B49E432C2F75674B0A78B0A6C481CF6` +* **Isaac Z. Schlueter** <i@izs.me> `93C7E9E91B49E432C2F75674B0A78B0A6C481CF6` +* **Julien Gilli** <jgilli@fastmail.fm> `114F43EE0176B71C7BC219DD50A3051F888C628D` +* **Timothy J Fontaine** <tjfontaine@gmail.com> `7937DFD2AB06298B2293C3187D33FF9D0246406D` diff --git a/ROADMAP.md b/ROADMAP.md index 51b87ae624cadf..ceb69f0473ad11 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -11,9 +11,9 @@ Node.js does not remove stdlib JS API. Shipping with current and well supported dependencies is the best way to ensure long term stability of the platform. When those dependencies are no longer maintained Node.js will take on their continued maintenance as part of our [Long Term Support policy](#long-term-support). Node.js will continue to adopt new V8 releases. -* When V8 ships a breaking change to their C++ API that can be handled by [`nan`](https://github.com/rvagg/nan) +* When V8 ships a breaking change to their C++ API that can be handled by [`nan`](https://github.com/nodejs/nan) the *minor* version of Node.js will be increased. -* When V8 ships a breaking change to their C++ API that can NOT be handled by [`nan`](https://github.com/rvagg/nan) +* When V8 ships a breaking change to their C++ API that can NOT be handled by [`nan`](https://github.com/nodejs/nan) the *major* version of Node.js will be increased. * When new features in the JavaScript language are introduced by V8 the *minor* version number will be increased. TC39 has stated clearly that no diff --git a/WORKING_GROUPS.md b/WORKING_GROUPS.md index f3cdc84ba765d9..79632c4fd8a4fb 100644 --- a/WORKING_GROUPS.md +++ b/WORKING_GROUPS.md @@ -1,11 +1,11 @@ -# Node.js Working Groups +# Node.js Core Working Groups -Node.js Working Groups are autonomous projects created by the -[Technical Steering Committee (TSC)](https://github.com/nodejs/node/blob/master/GOVERNANCE.md#technical-committee). +Node.js Core Working Groups are autonomous projects created by the +[Core Technical Committee (CTC)](https://github.com/nodejs/node/blob/master/GOVERNANCE.md#core-technical-committee). -Working Groups can be formed at any time but must be ratified by the TSC. +Working Groups can be formed at any time but must be ratified by the CTC. Once formed the work defined in the Working Group charter is the -responsibility of the WG rather than the TSC. +responsibility of the WG rather than the CTC. It is important that Working Groups are not formed pre-maturely. Working Groups are not formed to *begin* a set of tasks but instead are formed @@ -14,7 +14,7 @@ think it would benefit from being done as an autonomous project. If the work defined in a Working Group charter is completed the Working Group should be dissolved and the responsibility for governance absorbed -back in to the TSC. +back in to the CTC. ## Current Working Groups @@ -27,11 +27,19 @@ back in to the TSC. * [Roadmap](#roadmap) * [Docker](#docker) * [Addon API](#addon-api) +* [Benchmarking](#benchmarking) +* [Post-mortem](#post-mortem) +* [Intl](#intl) +* [HTTP](#http) +* [Documentation](#documentation) +* [Testing](#testing) + +#### Process: + * [Starting a Working Group](#starting-a-wg) * [Bootstrap Governance](#bootstrap-governance) -* [Intl](#Intl) -### [Website](https://github.com/nodejs/website) +### [Website](https://github.com/nodejs/nodejs.org) The website working group's purpose is to build and maintain a public website for the `Node.js` project. @@ -108,40 +116,40 @@ Note that the i18n working groups are distinct from the [Intl](#Intl) working gr Each language community maintains its own membership. -* [iojs-ar - Arabic (اللغة العربية)](https://github.com/nodejs/iojs-ar) -* [iojs-bg - Bulgarian (български език)](https://github.com/nodejs/iojs-bg) -* [iojs-bn - Bengali (বাংলা)](https://github.com/nodejs/iojs-bn) -* [iojs-cn - Chinese (中文)](https://github.com/nodejs/iojs-cn) -* [iojs-cs - Czech (Český Jazyk)](https://github.com/nodejs/iojs-cs) -* [iojs-da - Danish (Dansk)](https://github.com/nodejs/iojs-da) -* [iojs-de - German (Deutsch)](https://github.com/nodejs/iojs-de) -* [iojs-el - Greek (Ελληνικά)](https://github.com/nodejs/iojs-el) -* [iojs-es - Spanish (Español)](https://github.com/nodejs/iojs-es) -* [iojs-fa - Persian (فارسی)](https://github.com/nodejs/iojs-fa) -* [iojs-fi - Finnish (Suomi)](https://github.com/nodejs/iojs-fi) -* [iojs-fr - French (Français)](https://github.com/nodejs/iojs-fr) -* [iojs-he - Hebrew (עברית)](https://github.com/nodejs/iojs-he) -* [iojs-hi - Hindi (फिजी बात)](https://github.com/nodejs/iojs-hi) -* [iojs-hu - Hungarian (Magyar)](https://github.com/nodejs/iojs-hu) -* [iojs-id - Indonesian (Bahasa Indonesia)](https://github.com/nodejs/iojs-id) -* [iojs-it - Italian (Italiano)](https://github.com/nodejs/iojs-it) -* [iojs-ja - Japanese (日本語)](https://github.com/nodejs/iojs-ja) -* [iojs-ka - Georgian (ქართული)](https://github.com/nodejs/iojs-ka) -* [iojs-ko - Korean (조선말)](https://github.com/nodejs/iojs-ko) -* [iojs-mk - Macedonian (Mакедонски)](https://github.com/nodejs/iojs-mk) -* [iojs-ms - Malay (بهاس ملايو)](https://github.com/nodejs/iojs-ms) -* [iojs-nl - Dutch (Nederlands)](https://github.com/nodejs/iojs-nl) -* [iojs-no - Norwegian (Norsk)](https://github.com/nodejs/iojs-no) -* [iojs-pl - Polish (Język Polski)](https://github.com/nodejs/iojs-pl) -* [iojs-pt - Portuguese (Português)](https://github.com/nodejs/iojs-pt) -* [iojs-ro - Romanian (Română)](https://github.com/nodejs/iojs-ro) -* [iojs-ru - Russian (Русский)](https://github.com/nodejs/iojs-ru) -* [iojs-sv - Swedish (Svenska)](https://github.com/nodejs/iojs-sv) -* [iojs-ta - Tamil (தமிழ்)](https://github.com/nodejs/iojs-ta) -* [iojs-tr - Turkish (Türkçe)](https://github.com/nodejs/iojs-tr) -* [iojs-tw - Taiwanese (Hō-ló)](https://github.com/nodejs/iojs-tw) -* [iojs-uk - Ukrainian (Українська)](https://github.com/nodejs/iojs-uk) -* [iojs-vi - Vietnamese (Tiếng Việtnam)](https://github.com/nodejs/iojs-vi) +* [nodejs-ar - Arabic (اللغة العربية)](https://github.com/nodejs/nodejs-ar) +* [nodejs-bg - Bulgarian (български език)](https://github.com/nodejs/nodejs-bg) +* [nodejs-bn - Bengali (বাংলা)](https://github.com/nodejs/nodejs-bn) +* [nodejs-zh-CN - Chinese (中文)](https://github.com/nodejs/nodejs-zh-CN) +* [nodejs-cs - Czech (Český Jazyk)](https://github.com/nodejs/nodejs-cs) +* [nodejs-da - Danish (Dansk)](https://github.com/nodejs/nodejs-da) +* [nodejs-de - German (Deutsch)](https://github.com/nodejs/nodejs-de) +* [nodejs-el - Greek (Ελληνικά)](https://github.com/nodejs/nodejs-el) +* [nodejs-es - Spanish (Español)](https://github.com/nodejs/nodejs-es) +* [nodejs-fa - Persian (فارسی)](https://github.com/nodejs/nodejs-fa) +* [nodejs-fi - Finnish (Suomi)](https://github.com/nodejs/nodejs-fi) +* [nodejs-fr - French (Français)](https://github.com/nodejs/nodejs-fr) +* [nodejs-he - Hebrew (עברית)](https://github.com/nodejs/nodejs-he) +* [nodejs-hi - Hindi (फिजी बात)](https://github.com/nodejs/nodejs-hi) +* [nodejs-hu - Hungarian (Magyar)](https://github.com/nodejs/nodejs-hu) +* [nodejs-id - Indonesian (Bahasa Indonesia)](https://github.com/nodejs/nodejs-id) +* [nodejs-it - Italian (Italiano)](https://github.com/nodejs/nodejs-it) +* [nodejs-ja - Japanese (日本語)](https://github.com/nodejs/nodejs-ja) +* [nodejs-ka - Georgian (ქართული)](https://github.com/nodejs/nodejs-ka) +* [nodejs-ko - Korean (조선말)](https://github.com/nodejs/nodejs-ko) +* [nodejs-mk - Macedonian (Mакедонски)](https://github.com/nodejs/nodejs-mk) +* [nodejs-ms - Malay (بهاس ملايو)](https://github.com/nodejs/nodejs-ms) +* [nodejs-nl - Dutch (Nederlands)](https://github.com/nodejs/nodejs-nl) +* [nodejs-no - Norwegian (Norsk)](https://github.com/nodejs/nodejs-no) +* [nodejs-pl - Polish (Język Polski)](https://github.com/nodejs/nodejs-pl) +* [nodejs-pt - Portuguese (Português)](https://github.com/nodejs/nodejs-pt) +* [nodejs-ro - Romanian (Română)](https://github.com/nodejs/nodejs-ro) +* [nodejs-ru - Russian (Русский)](https://github.com/nodejs/nodejs-ru) +* [nodejs-sv - Swedish (Svenska)](https://github.com/nodejs/nodejs-sv) +* [nodejs-ta - Tamil (தமிழ்)](https://github.com/nodejs/nodejs-ta) +* [nodejs-tr - Turkish (Türkçe)](https://github.com/nodejs/nodejs-tr) +* [nodejs-zh-TW - Taiwanese (Hō-ló)](https://github.com/nodejs/nodejs-zh-TW) +* [nodejs-uk - Ukrainian (Українська)](https://github.com/nodejs/nodejs-uk) +* [nodejs-vi - Vietnamese (Tiếng Việtnam)](https://github.com/nodejs/nodejs-vi) ### [Intl](https://github.com/nodejs/Intl) @@ -168,6 +176,19 @@ Their responsibilities are: * Publishing regular update summaries and other promotional content. +### [HTTP](https://github.com/nodejs/http) + +The HTTP working group is chartered for the support and improvement of the +HTTP implementation in Node. It's responsibilities are: + +* Addressing HTTP issues on the Node.js issue tracker. +* Authoring and editing HTTP documentation within the Node.js project. +* Reviewing changes to HTTP functionality within the Node.js project. +* Working with the ecosystem of HTTP related module developers to evolve the + HTTP implementation and APIs in core. +* Advising the CTC on all HTTP related issues and discussions. +* Messaging about the future of HTTP to give the community advance notice of + changes. ### [Roadmap](https://github.com/nodejs/roadmap) @@ -209,9 +230,9 @@ Their responsibilities are: * Maintaining the [addon-examples](https://github.com/nodejs/node-addon-examples) GitHub repository, including code, issues and documentation. * Maintaining the C++ Addon API within the Node.js project, in subordination to - the Node.js TSC. + the Node.js CTC. * Maintaining the Addon documentation within the Node.js project, in - subordination to the Node.js TSC. + subordination to the Node.js CTC. * Maintaining the _nan_ package in npm, releasing new versions as appropriate. * Messaging about the future of the Node.js and NAN interface to give the community advance notice of changes. @@ -219,6 +240,71 @@ Their responsibilities are: The current members can be found in their [README](https://github.com/nodejs/nan#collaborators). +### [Benchmarking](https://github.com/nodejs/benchmarking) + +The purpose of the Benchmark working group is to gain consensus +for an agreed set of benchmarks that can be used to: + ++ track and evangelize performance gains made between Node releases ++ avoid performance regressions between releases + +Its responsibilities are: + ++ Identify 1 or more benchmarks that reflect customer usage. + Likely need more than one to cover typical Node use cases + including low-latency and high concurrency ++ Work to get community consensus on the list chosen ++ Add regular execution of chosen benchmarks to Node builds ++ Track/publicize performance between builds/releases + +### [Post-mortem](https://github.com/nodejs/post-mortem) + +The Post-mortem Diagnostics working group is dedicated to the support +and improvement of postmortem debugging for Node.js. It seeks to +elevate the role of postmortem debugging for Node, to assist in the +development of techniques and tools, and to make techniques and tools +known and available to Node.js users. + +Its responsibilities are: + ++ Defining and adding interfaces/APIs in order to allow dumps + to be generated when needed ++ Defining and adding common structures to the dumps generated + in order to support tools that want to introspect those dumps + +### [Documentation](https://github.com/nodejs/docs) + +The Documentation working group exists to support the improvement of Node.js +documentation, both in the core API documentation, and elsewhere, such as the +Node.js website. Its intent is to work closely with Evangelism, Website, and +Intl working groups to make excellent documentation available and accessible +to all. + +Its responsibilities are: + +* Defining and maintaining documentation style and content standards. +* Producing documentation in a format acceptable for the Website WG to consume. +* Ensuring that Node's documentation addresses a wide variety of audiences. +* Creating and operating a process for documentation review that produces + quality documentation and avoids impeding the progress of Core work. + +### [Testing](https://github.com/nodejs/testing) + +The Node.js Testing Working Group's purpose is to extend and improve testing of +the Node.js source code. + +It's responsibilities are: + +* Coordinating an overall strategy for improving testing. +* Documenting guidelines around tests. +* Working with the Build Working Group to improve continuous integration. +* Improving tooling for testing. + +## Joining a WG + +To find out how to join a working group, consult the GOVERNANCE.md in +the working group's repository, or simply open an issue there. + ## Starting a WG A Working Group is established by first defining a charter that can be @@ -401,40 +487,13 @@ By making a contribution to this project, I certify that: * (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. +### Moderation Policy + +The [Node.js Moderation Policy] applies to this WG. ### Code of Conduct -This Code of Conduct is adapted from [Rust's wonderful -CoC](https://github.com/rust-lang/rust/wiki/Note-development-policy#conduct). - -* We are committed to providing a friendly, safe and welcoming - environment for all, regardless of gender, sexual orientation, - disability, ethnicity, religion, or similar personal characteristic. -* Please avoid using overtly sexual nicknames or other nicknames that - might detract from a friendly, safe and welcoming environment for - all. -* Please be kind and courteous. There's no need to be mean or rude. -* Respect that people have differences of opinion and that every - design or implementation choice carries a trade-off and numerous - costs. There is seldom a right answer. -* Please keep unstructured critique to a minimum. If you have solid - ideas you want to experiment with, make a fork and see how it works. -* We will exclude you from interaction if you insult, demean or harass - anyone. That is not welcome behaviour. We interpret the term - "harassment" as including the definition in the [Citizen Code of - Conduct](http://citizencodeofconduct.org/); if you have any lack of - clarity about what might be included in that concept, please read - their definition. In particular, we don't tolerate behavior that - excludes people in socially marginalized groups. -* Private harassment is also unacceptable. No matter who you are, if - you feel you have been or are being harassed or made uncomfortable - by a community member, please contact one of the channel ops or any - of the TC members immediately with a capture (log, photo, email) of - the harassment if possible. Whether you're a regular contributor or - a newcomer, we care about making this community a safe place for you - and we've got your back. -* Likewise any spamming, trolling, flaming, baiting or other - attention-stealing behaviour is not welcome. -* Avoid the use of personal pronouns in code comments or - documentation. There is no need to address persons when explaining - code (e.g. "When the developer") +The [Node.js Code of Conduct][] applies to this WG. + +[Node.js Code of Conduct]: https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md +[Node.js Moderation Policy]: https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md diff --git a/android-configure b/android-configure index 5cdfa70bbafba7..cbf137f47174c7 100755 --- a/android-configure +++ b/android-configure @@ -1,18 +1,49 @@ #!/bin/bash +if [ -z "$2" ]; then + ARCH=arm +else + ARCH="$2" +fi + +CC_VER="4.9" +case $ARCH in + arm) + DEST_CPU="$ARCH" + SUFFIX="$ARCH-linux-androideabi" + TOOLCHAIN_NAME="$SUFFIX" + ;; + x86) + DEST_CPU="ia32" + SUFFIX="i686-linux-android" + TOOLCHAIN_NAME="$ARCH" + ;; + x86_64) + DEST_CPU="ia32" + SUFFIX="$ARCH-linux-android" + TOOLCHAIN_NAME="$ARCH" + ;; + *) + echo "Unsupported architecture provided: $ARCH" + exit 1 + ;; +esac + export TOOLCHAIN=$PWD/android-toolchain mkdir -p $TOOLCHAIN $1/build/tools/make-standalone-toolchain.sh \ - --toolchain=arm-linux-androideabi-4.9 \ - --arch=arm \ + --toolchain=$TOOLCHAIN_NAME-$CC_VER \ + --arch=$ARCH \ --install-dir=$TOOLCHAIN \ --platform=android-21 export PATH=$TOOLCHAIN/bin:$PATH -export AR=$TOOLCHAIN/bin/arm-linux-androideabi-ar -export CC=$TOOLCHAIN/bin/arm-linux-androideabi-gcc -export CXX=$TOOLCHAIN/bin/arm-linux-androideabi-g++ -export LINK=$TOOLCHAIN/bin/arm-linux-androideabi-g++ +export AR=$TOOLCHAIN/bin/$SUFFIX-ar +export CC=$TOOLCHAIN/bin/$SUFFIX-gcc +export CXX=$TOOLCHAIN/bin/$SUFFIX-g++ +export LINK=$TOOLCHAIN/bin/$SUFFIX-g++ ./configure \ - --dest-cpu=arm \ - --dest-os=android + --dest-cpu=$DEST_CPU \ + --dest-os=android \ + --without-snapshot \ + --openssl-no-asm diff --git a/benchmark/arrays/var-int.js b/benchmark/arrays/var-int.js index 47a7e62dc7681b..74a73c9515fffa 100644 --- a/benchmark/arrays/var-int.js +++ b/benchmark/arrays/var-int.js @@ -1,6 +1,9 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { - type: 'Array Buffer Int8Array Uint8Array Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array'.split(' '), + type: ['Array', 'Buffer', 'Int8Array', 'Uint8Array', 'Int16Array', + 'Uint16Array', 'Int32Array', 'Uint32Array', 'Float32Array', + 'Float64Array'], n: [25] }); diff --git a/benchmark/arrays/zero-float.js b/benchmark/arrays/zero-float.js index a6624205bffdea..e2569eed5c4e75 100644 --- a/benchmark/arrays/zero-float.js +++ b/benchmark/arrays/zero-float.js @@ -1,6 +1,9 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { - type: 'Array Buffer Int8Array Uint8Array Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array'.split(' '), + type: ['Array', 'Buffer', 'Int8Array', 'Uint8Array', 'Int16Array', + 'Uint16Array', 'Int32Array', 'Uint32Array', 'Float32Array', + 'Float64Array'], n: [25] }); diff --git a/benchmark/arrays/zero-int.js b/benchmark/arrays/zero-int.js index 29a2d58b665cbe..8be70c1e87113a 100644 --- a/benchmark/arrays/zero-int.js +++ b/benchmark/arrays/zero-int.js @@ -1,6 +1,9 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { - type: 'Array Buffer Int8Array Uint8Array Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array'.split(' '), + type: ['Array', 'Buffer', 'Int8Array', 'Uint8Array', 'Int16Array', + 'Uint16Array', 'Int32Array', 'Uint32Array', 'Float32Array', + 'Float64Array'], n: [25] }); diff --git a/benchmark/assert/deepequal-prims-and-objs-big-array.js b/benchmark/assert/deepequal-prims-and-objs-big-array.js new file mode 100644 index 00000000000000..dc18d959bbce2b --- /dev/null +++ b/benchmark/assert/deepequal-prims-and-objs-big-array.js @@ -0,0 +1,40 @@ +'use strict'; +var common = require('../common.js'); +var assert = require('assert'); + +const primValues = { + 'null': null, + 'undefined': undefined, + 'string': 'a', + 'number': 1, + 'boolean': true, + 'object': { 0: 'a' }, + 'array': [1, 2, 3], + 'new-array': new Array([1, 2, 3]) +}; + +var bench = common.createBenchmark(main, { + prim: Object.keys(primValues), + n: [25] +}); + +function main(conf) { + var prim = primValues[conf.prim]; + var n = +conf.n; + var primArray; + var primArrayCompare; + var x; + + primArray = new Array(); + primArrayCompare = new Array(); + for (x = 0; x < (1e5); x++) { + primArray.push(prim); + primArrayCompare.push(prim); + } + + bench.start(); + for (x = 0; x < n; x++) { + assert.deepEqual(primArray, primArrayCompare); + } + bench.end(n); +} diff --git a/benchmark/assert/deepequal-prims-and-objs-big-loop.js b/benchmark/assert/deepequal-prims-and-objs-big-loop.js new file mode 100644 index 00000000000000..3c76a586f7d5fb --- /dev/null +++ b/benchmark/assert/deepequal-prims-and-objs-big-loop.js @@ -0,0 +1,33 @@ +'use strict'; +var common = require('../common.js'); +var assert = require('assert'); + +const primValues = { + 'null': null, + 'undefined': undefined, + 'string': 'a', + 'number': 1, + 'boolean': true, + 'object': { 0: 'a' }, + 'array': [1, 2, 3], + 'new-array': new Array([1, 2, 3]) +}; + +var bench = common.createBenchmark(main, { + prim: Object.keys(primValues), + n: [1e5] +}); + +function main(conf) { + var prim = primValues[conf.prim]; + var n = +conf.n; + var x; + + bench.start(); + + for (x = 0; x < n; x++) { + assert.deepEqual(new Array([prim]), new Array([prim])); + } + + bench.end(n); +} diff --git a/benchmark/assert/deepequal-typedarrays.js b/benchmark/assert/deepequal-typedarrays.js new file mode 100644 index 00000000000000..99c13206d7560a --- /dev/null +++ b/benchmark/assert/deepequal-typedarrays.js @@ -0,0 +1,22 @@ +'use strict'; +var common = require('../common.js'); +var assert = require('assert'); +var bench = common.createBenchmark(main, { + type: ('Int8Array Uint8Array Int16Array Uint16Array Int32Array Uint32Array ' + + 'Float32Array Float64Array Uint8ClampedArray').split(' '), + n: [1] +}); + +function main(conf) { + var type = conf.type; + var clazz = global[type]; + var n = +conf.n; + + bench.start(); + var actual = new clazz(n * 1e6); + var expected = new clazz(n * 1e6); + + assert.deepEqual(actual, expected); + + bench.end(n); +} diff --git a/benchmark/buffers/buffer-base64-decode.js b/benchmark/buffers/buffer-base64-decode.js index 76850c1231eda0..36094f632d4eec 100644 --- a/benchmark/buffers/buffer-base64-decode.js +++ b/benchmark/buffers/buffer-base64-decode.js @@ -1,13 +1,14 @@ -var assert = require('assert'); -var common = require('../common.js'); +'use strict'; +const assert = require('assert'); +const common = require('../common.js'); -var bench = common.createBenchmark(main, {}); +const bench = common.createBenchmark(main, {}); function main(conf) { - for (var s = 'abcd'; s.length < 32 << 20; s += s); + const s = 'abcd'.repeat(8 << 20); s.match(/./); // Flatten string. assert.equal(s.length % 4, 0); - var b = Buffer(s.length / 4 * 3); + const b = Buffer(s.length / 4 * 3); b.write(s, 0, s.length, 'base64'); bench.start(); for (var i = 0; i < 32; i += 1) b.base64Write(s, 0, s.length); diff --git a/benchmark/buffers/buffer-base64-encode.js b/benchmark/buffers/buffer-base64-encode.js index cb520be2a621eb..8e2eec3cf5bb37 100644 --- a/benchmark/buffers/buffer-base64-encode.js +++ b/benchmark/buffers/buffer-base64-encode.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, {}); @@ -6,9 +7,10 @@ function main(conf) { var N = 64 * 1024 * 1024; var b = Buffer(N); var s = ''; - for (var i = 0; i < 256; ++i) s += String.fromCharCode(i); - for (var i = 0; i < N; i += 256) b.write(s, i, 256, 'ascii'); + var i; + for (i = 0; i < 256; ++i) s += String.fromCharCode(i); + for (i = 0; i < N; i += 256) b.write(s, i, 256, 'ascii'); bench.start(); - for (var i = 0; i < 32; ++i) b.toString('base64'); + for (i = 0; i < 32; ++i) b.toString('base64'); bench.end(64); } diff --git a/benchmark/buffers/buffer-bytelength.js b/benchmark/buffers/buffer-bytelength.js index 6a7afe6921aea1..50f420f412d30b 100644 --- a/benchmark/buffers/buffer-bytelength.js +++ b/benchmark/buffers/buffer-bytelength.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common'); var bench = common.createBenchmark(main, { @@ -43,7 +44,7 @@ function main(conf) { var r = Buffer.byteLength(strings[index], encoding); if (r !== results[index]) - throw Error('incorrect return value'); + throw new Error('incorrect return value'); } bench.end(n); } diff --git a/benchmark/buffers/buffer-compare-instance-method.js b/benchmark/buffers/buffer-compare-instance-method.js new file mode 100644 index 00000000000000..0becbeee23a7d7 --- /dev/null +++ b/benchmark/buffers/buffer-compare-instance-method.js @@ -0,0 +1,29 @@ +'use strict'; +const common = require('../common.js'); +const v8 = require('v8'); + +const bench = common.createBenchmark(main, { + size: [16, 512, 1024, 4096, 16386], + millions: [1] +}); + +function main(conf) { + const iter = (conf.millions >>> 0) * 1e6; + const size = (conf.size >>> 0); + const b0 = new Buffer(size).fill('a'); + const b1 = new Buffer(size).fill('a'); + + b1[size - 1] = 'b'.charCodeAt(0); + + // Force optimization before starting the benchmark + b0.compare(b1); + v8.setFlagsFromString('--allow_natives_syntax'); + eval('%OptimizeFunctionOnNextCall(b0.compare)'); + b0.compare(b1); + + bench.start(); + for (var i = 0; i < iter; i++) { + b0.compare(b1); + } + bench.end(iter / 1e6); +} diff --git a/benchmark/buffers/buffer-compare-offset.js b/benchmark/buffers/buffer-compare-offset.js new file mode 100644 index 00000000000000..17b36f82883426 --- /dev/null +++ b/benchmark/buffers/buffer-compare-offset.js @@ -0,0 +1,58 @@ +'use strict'; +const common = require('../common.js'); +const v8 = require('v8'); + +const bench = common.createBenchmark(main, { + method: ['offset', 'slice'], + size: [16, 512, 1024, 4096, 16386], + millions: [1] +}); + +function compareUsingSlice(b0, b1, len, iter) { + + // Force optimization before starting the benchmark + Buffer.compare(b0.slice(1, len), b1.slice(1, len)); + v8.setFlagsFromString('--allow_natives_syntax'); + eval('%OptimizeFunctionOnNextCall(Buffer.compare)'); + eval('%OptimizeFunctionOnNextCall(b0.slice)'); + eval('%OptimizeFunctionOnNextCall(b1.slice)'); + Buffer.compare(b0.slice(1, len), b1.slice(1, len)); + doCompareUsingSlice(b0, b1, len, iter); +} + +function doCompareUsingSlice(b0, b1, len, iter) { + var i; + bench.start(); + for (i = 0; i < iter; i++) + Buffer.compare(b0.slice(1, len), b1.slice(1, len)); + bench.end(iter / 1e6); +} + +function compareUsingOffset(b0, b1, len, iter) { + len = len + 1; + // Force optimization before starting the benchmark + b0.compare(b1, 1, len, 1, len); + v8.setFlagsFromString('--allow_natives_syntax'); + eval('%OptimizeFunctionOnNextCall(b0.compare)'); + b0.compare(b1, 1, len, 1, len); + doCompareUsingOffset(b0, b1, len, iter); +} + +function doCompareUsingOffset(b0, b1, len, iter) { + var i; + bench.start(); + for (i = 0; i < iter; i++) + b0.compare(b1, 1, len, 1, len); + bench.end(iter / 1e6); +} + +function main(conf) { + const iter = (conf.millions >>> 0) * 1e6; + const size = (conf.size >>> 0); + const method = conf.method === 'slice' ? + compareUsingSlice : compareUsingOffset; + method(Buffer.alloc(size, 'a'), + Buffer.alloc(size, 'b'), + size >> 1, + iter); +} diff --git a/benchmark/buffers/buffer-compare.js b/benchmark/buffers/buffer-compare.js index b02e8a74030042..c83bb67fa24ad8 100644 --- a/benchmark/buffers/buffer-compare.js +++ b/benchmark/buffers/buffer-compare.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { diff --git a/benchmark/buffers/buffer-creation.js b/benchmark/buffers/buffer-creation.js index bc0c55711858de..dfb68467cc54b9 100644 --- a/benchmark/buffers/buffer-creation.js +++ b/benchmark/buffers/buffer-creation.js @@ -1,4 +1,5 @@ -SlowBuffer = require('buffer').SlowBuffer; +'use strict'; +const SlowBuffer = require('buffer').SlowBuffer; var common = require('../common.js'); var bench = common.createBenchmark(main, { @@ -13,7 +14,7 @@ function main(conf) { var clazz = conf.type === 'fast' ? Buffer : SlowBuffer; bench.start(); for (var i = 0; i < n * 1024; i++) { - b = new clazz(len); + new clazz(len); } bench.end(n); } diff --git a/benchmark/buffers/buffer-indexof.js b/benchmark/buffers/buffer-indexof.js index c575f54b6a638c..6f10033020bc74 100644 --- a/benchmark/buffers/buffer-indexof.js +++ b/benchmark/buffers/buffer-indexof.js @@ -1,5 +1,7 @@ +'use strict'; var common = require('../common.js'); var fs = require('fs'); +const path = require('path'); var bench = common.createBenchmark(main, { search: ['@', 'SQ', '10x', '--l', 'Alice', 'Gryphon', 'Panther', @@ -14,7 +16,9 @@ var bench = common.createBenchmark(main, { function main(conf) { var iter = (conf.iter) * 100000; - var aliceBuffer = fs.readFileSync(__dirname + '/../fixtures/alice.html'); + var aliceBuffer = fs.readFileSync( + path.resolve(__dirname, '../fixtures/alice.html') + ); var search = conf.search; var encoding = conf.encoding; diff --git a/benchmark/buffers/buffer-iterate.js b/benchmark/buffers/buffer-iterate.js index 77a0b59b8ac081..fb8abc1aee1c63 100644 --- a/benchmark/buffers/buffer-iterate.js +++ b/benchmark/buffers/buffer-iterate.js @@ -1,3 +1,4 @@ +'use strict'; var SlowBuffer = require('buffer').SlowBuffer; var common = require('../common.js'); var assert = require('assert'); diff --git a/benchmark/buffers/buffer-read.js b/benchmark/buffers/buffer-read.js index 92138bccef99d6..1cdc4bc4697067 100644 --- a/benchmark/buffers/buffer-read.js +++ b/benchmark/buffers/buffer-read.js @@ -1,7 +1,8 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { - noAssert: [false, true], + noAssert: ['false', 'true'], buffer: ['fast', 'slow'], type: ['UInt8', 'UInt16LE', 'UInt16BE', 'UInt32LE', 'UInt32BE', @@ -21,10 +22,10 @@ function main(conf) { buff.writeDoubleLE(0, 0, noAssert); var testFunction = new Function('buff', [ - "for (var i = 0; i !== " + len + "; i++) {", - " buff." + fn + "(0, " + JSON.stringify(noAssert) + ");", - "}" - ].join("\n")); + 'for (var i = 0; i !== ' + len + '; i++) {', + ' buff.' + fn + '(0, ' + JSON.stringify(noAssert) + ');', + '}' + ].join('\n')); bench.start(); testFunction(buff); bench.end(len / 1e6); diff --git a/benchmark/buffers/buffer-slice.js b/benchmark/buffers/buffer-slice.js index f632fa64adff11..70cf3a705c0d8b 100644 --- a/benchmark/buffers/buffer-slice.js +++ b/benchmark/buffers/buffer-slice.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var SlowBuffer = require('buffer').SlowBuffer; diff --git a/benchmark/buffers/buffer-swap.js b/benchmark/buffers/buffer-swap.js new file mode 100644 index 00000000000000..4ff9a23d418f4d --- /dev/null +++ b/benchmark/buffers/buffer-swap.js @@ -0,0 +1,61 @@ +'use strict'; + +const common = require('../common.js'); + +const bench = common.createBenchmark(main, { + method: ['swap16', 'swap32', 'htons', 'htonl'], + len: [4, 64, 512, 768, 1024, 1536, 2056, 4096, 8192], + n: [1e6] +}); + +// The htons and htonl methods below are used to benchmark the +// performance difference between doing the byteswap in pure +// javascript regardless of Buffer size as opposed to dropping +// down to the native layer for larger Buffer sizes. + +Buffer.prototype.htons = function htons() { + if (this.length % 2 !== 0) + throw new RangeError(); + for (var i = 0, n = 0; i < this.length; i += 2) { + n = this[i]; + this[i] = this[i + 1]; + this[i + 1] = n; + } + return this; +}; + +Buffer.prototype.htonl = function htonl() { + if (this.length % 2 !== 0) + throw new RangeError(); + for (var i = 0, n = 0; i < this.length; i += 4) { + n = this[i]; + this[i] = this[i + 3]; + this[i + 3] = n; + n = this[i + 1]; + this[i + 1] = this[i + 2]; + this[i + 2] = n; + } + return this; +}; + +function createBuffer(len) { + const buf = Buffer.allocUnsafe(len); + for (var i = 1; i <= len; i++) + buf[i - 1] = i; + return buf; +} + +function bufferSwap(n, buf, method) { + for (var i = 1; i <= n; i++) + buf[method](); +} + +function main(conf) { + const method = conf.method; + const len = conf.len | 0; + const n = conf.n | 0; + const buf = createBuffer(len); + bench.start(); + bufferSwap(n, buf, method); + bench.end(n); +} diff --git a/benchmark/buffers/buffer-tostring.js b/benchmark/buffers/buffer-tostring.js index 948052042d677b..937a84b267ed19 100644 --- a/benchmark/buffers/buffer-tostring.js +++ b/benchmark/buffers/buffer-tostring.js @@ -3,23 +3,24 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - arg: [true, false], + arg: ['true', 'false'], len: [0, 1, 64, 1024], n: [1e7] }); function main(conf) { - const arg = conf.arg; + const arg = conf.arg === 'true'; const len = conf.len | 0; const n = conf.n | 0; const buf = Buffer(len).fill(42); + var i; bench.start(); if (arg) { - for (var i = 0; i < n; i += 1) + for (i = 0; i < n; i += 1) buf.toString('utf8'); } else { - for (var i = 0; i < n; i += 1) + for (i = 0; i < n; i += 1) buf.toString(); } bench.end(n); diff --git a/benchmark/buffers/buffer-write.js b/benchmark/buffers/buffer-write.js index 2a2a0e37e3adda..51f8cd505ec6d9 100644 --- a/benchmark/buffers/buffer-write.js +++ b/benchmark/buffers/buffer-write.js @@ -1,7 +1,7 @@ - +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { - noAssert: [false, true], + noAssert: ['false', 'true'], buffer: ['fast', 'slow'], type: ['UInt8', 'UInt16LE', 'UInt16BE', 'UInt32LE', 'UInt32BE', @@ -48,10 +48,10 @@ function main(conf) { function benchInt(buff, fn, len, noAssert) { var m = mod[fn]; var testFunction = new Function('buff', [ - "for (var i = 0; i !== " + len + "; i++) {", - " buff." + fn + "(i & " + m + ", 0, " + JSON.stringify(noAssert) + ");", - "}" - ].join("\n")); + 'for (var i = 0; i !== ' + len + '; i++) {', + ' buff.' + fn + '(i & ' + m + ', 0, ' + JSON.stringify(noAssert) + ');', + '}' + ].join('\n')); bench.start(); testFunction(buff); bench.end(len / 1e6); @@ -59,10 +59,10 @@ function benchInt(buff, fn, len, noAssert) { function benchFloat(buff, fn, len, noAssert) { var testFunction = new Function('buff', [ - "for (var i = 0; i !== " + len + "; i++) {", - " buff." + fn + "(i, 0, " + JSON.stringify(noAssert) + ");", - "}" - ].join("\n")); + 'for (var i = 0; i !== ' + len + '; i++) {', + ' buff.' + fn + '(i, 0, ' + JSON.stringify(noAssert) + ');', + '}' + ].join('\n')); bench.start(); testFunction(buff); bench.end(len / 1e6); diff --git a/benchmark/buffers/buffer_zero.js b/benchmark/buffers/buffer_zero.js new file mode 100644 index 00000000000000..461378758b5951 --- /dev/null +++ b/benchmark/buffers/buffer_zero.js @@ -0,0 +1,18 @@ +'use strict'; + +const common = require('../common.js'); + +const bench = common.createBenchmark(main, { + n: [1024] +}); + +const zero = new Buffer(0); + +function main(conf) { + var n = +conf.n; + bench.start(); + for (let i = 0; i < n * 1024; i++) { + new Buffer(zero); + } + bench.end(n); +} diff --git a/benchmark/buffers/dataview-set.js b/benchmark/buffers/dataview-set.js index ce0064edb6e0cd..ab9c1d1d23b736 100644 --- a/benchmark/buffers/dataview-set.js +++ b/benchmark/buffers/dataview-set.js @@ -1,4 +1,4 @@ - +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { type: ['Uint8', 'Uint16LE', 'Uint16BE', diff --git a/benchmark/misc/child-process-read.js b/benchmark/child_process/child-process-read.js similarity index 97% rename from benchmark/misc/child-process-read.js rename to benchmark/child_process/child-process-read.js index 894dd55d301249..c1a7474aae32c1 100644 --- a/benchmark/misc/child-process-read.js +++ b/benchmark/child_process/child-process-read.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { len: [64, 256, 1024, 4096, 32768], diff --git a/benchmark/misc/spawn-echo.js b/benchmark/child_process/spawn-echo.js similarity index 97% rename from benchmark/misc/spawn-echo.js rename to benchmark/child_process/spawn-echo.js index 2b1b989e679b96..7c9e851aacb641 100644 --- a/benchmark/misc/spawn-echo.js +++ b/benchmark/child_process/spawn-echo.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { thousands: [1] diff --git a/benchmark/common.js b/benchmark/common.js index 511ae384f418bf..d1bc985f092ac7 100644 --- a/benchmark/common.js +++ b/benchmark/common.js @@ -1,3 +1,4 @@ +'use strict'; var assert = require('assert'); var fs = require('fs'); var path = require('path'); @@ -27,7 +28,7 @@ if (module === require.main) { var tests = fs.readdirSync(dir); if (testFilter) { - var filteredTests = tests.filter(function(item){ + var filteredTests = tests.filter(function(item) { if (item.lastIndexOf(testFilter) >= 0) { return item; } @@ -48,7 +49,7 @@ function hasWrk() { if (result.error && result.error.code === 'ENOENT') { console.error('Couldn\'t locate `wrk` which is needed for running ' + 'benchmarks. Check benchmark/README.md for further instructions.'); - process.exit(-1); + process.exit(-1); } } @@ -86,7 +87,7 @@ function Benchmark(fn, options) { this.options = options; this.config = parseOpts(options); this._name = require.main.filename.split(/benchmark[\/\\]/).pop(); - this._start = [0,0]; + this._start = [0, 0]; this._started = false; var self = this; @@ -120,7 +121,7 @@ Benchmark.prototype.http = function(p, args, cb) { if (code) { console.error('wrk failed with ' + code); - process.exit(code) + process.exit(code); } var match = out.match(regexp); var qps = match && +match[1]; @@ -140,8 +141,6 @@ Benchmark.prototype._run = function() { // some options weren't set. // run with all combinations var main = require.main.filename; - var settings = []; - var queueLen = 1; var options = this.options; var queue = Object.keys(options).reduce(function(set, key) { @@ -153,6 +152,10 @@ Benchmark.prototype._run = function() { var j = 0; set.forEach(function(s) { vals.forEach(function(val) { + if (typeof val !== 'number' && typeof val !== 'string') { + throw new TypeError(`configuration "${key}" had type ${typeof val}`); + } + newSet[j++] = s.concat(key + '=' + val); }); }); @@ -188,11 +191,13 @@ function parseOpts(options) { var num = keys.length; var conf = {}; for (var i = 2; i < process.argv.length; i++) { - var match = process.argv[i].match(/^(.+)=(.+)$/); - if (!match || !match[1] || !match[2] || !options[match[1]]) { + var match = process.argv[i].match(/^(.+)=(.*)$/); + if (!match || !match[1] || !options[match[1]]) { return null; } else { - conf[match[1]] = isFinite(match[2]) ? +match[2] : match[2] + conf[match[1]] = (match[2].length && isFinite(match[2]) + ? +match[2] + : match[2]); num--; } } @@ -203,7 +208,7 @@ function parseOpts(options) { }); } return num === 0 ? conf : null; -}; +} Benchmark.prototype.start = function() { if (this._started) @@ -221,8 +226,8 @@ Benchmark.prototype.end = function(operations) { if (typeof operations !== 'number') throw new Error('called end() without specifying operation count'); - var time = elapsed[0] + elapsed[1]/1e9; - var rate = operations/time; + var time = elapsed[0] + elapsed[1] / 1e9; + var rate = operations / time; this.report(rate); }; diff --git a/benchmark/compare.js b/benchmark/compare.js index edb116d0c64baa..21d4b2b6a4f438 100644 --- a/benchmark/compare.js +++ b/benchmark/compare.js @@ -1,3 +1,4 @@ +'use strict'; var usage = 'node benchmark/compare.js ' + ' ' + '[--html] [--red|-r] [--green|-g] ' + @@ -36,18 +37,19 @@ for (var i = 2; i < process.argv.length; i++) { } } +var start, green, red, reset, end; if (!html) { - var start = ''; - var green = '\033[1;32m'; - var red = '\033[1;31m'; - var reset = '\033[m'; - var end = ''; + start = ''; + green = '\u001b[1;32m'; + red = '\u001b[1;31m'; + reset = '\u001b[m'; + end = ''; } else { - var start = '
';
-  var green = '';
-  var red = '';
-  var reset = '';
-  var end = '
'; + start = '
';
+  green = '';
+  red = '';
+  reset = '';
+  end = '
'; } var runBench = process.env.NODE_BENCH || 'bench'; @@ -75,10 +77,15 @@ function run() { var out = ''; var child; - if (Array.isArray(benchmarks) && benchmarks.length) - child = spawn(node, ['benchmark/common.js'].concat(benchmarks), { env: env }); - else + if (Array.isArray(benchmarks) && benchmarks.length) { + child = spawn( + node, + ['benchmark/common.js'].concat(benchmarks), + { env: env } + ); + } else { child = spawn('make', [runBench], { env: env }); + } child.stdout.setEncoding('utf8'); child.stdout.on('data', function(c) { out += c; @@ -134,9 +141,19 @@ function compare() { if (show === 'green' && !g || show === 'red' && !r) return; - var r0 = util.format('%s%s: %d%s', g, nodes[0], n0.toPrecision(5), g ? reset : ''); - var r1 = util.format('%s%s: %d%s', r, nodes[1], n1.toPrecision(5), r ? reset : ''); - var pct = c + pct + '%' + reset; + var r0 = util.format( + '%s%s: %d%s', + g, + nodes[0], + n0.toPrecision(5), g ? reset : '' + ); + var r1 = util.format( + '%s%s: %d%s', + r, + nodes[1], + n1.toPrecision(5), r ? reset : '' + ); + pct = c + pct + '%' + reset; var l = util.format('%s: %s %s', bench, r0, r1); maxLen = Math.max(l.length + pct.length, maxLen); return [l, pct]; diff --git a/benchmark/crypto/aes-gcm-throughput.js b/benchmark/crypto/aes-gcm-throughput.js index 65e1713f0eb1c6..fc379b21b748bf 100644 --- a/benchmark/crypto/aes-gcm-throughput.js +++ b/benchmark/crypto/aes-gcm-throughput.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var crypto = require('crypto'); var keylen = {'aes-128-gcm': 16, 'aes-192-gcm': 24, 'aes-256-gcm': 32}; @@ -30,7 +31,7 @@ function AEAD_Bench(cipher, message, associate_data, key, iv, n, len) { var bob = crypto.createDecipheriv(cipher, key, iv); bob.setAuthTag(tag); bob.setAAD(associate_data); - var clear = bob.update(enc); + bob.update(enc); bob.final(); } diff --git a/benchmark/crypto/cipher-stream.js b/benchmark/crypto/cipher-stream.js index 4e8198931729f4..5da6f2481ecbc3 100644 --- a/benchmark/crypto/cipher-stream.js +++ b/benchmark/crypto/cipher-stream.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { @@ -85,17 +86,17 @@ function streamWrite(alice, bob, message, encoding, writes) { function legacyWrite(alice, bob, message, encoding, writes) { var written = 0; + var enc, dec; for (var i = 0; i < writes; i++) { - var enc = alice.update(message, encoding); - var dec = bob.update(enc); + enc = alice.update(message, encoding); + dec = bob.update(enc); written += dec.length; } - var enc = alice.final(); - var dec = bob.update(enc); + enc = alice.final(); + dec = bob.update(enc); written += dec.length; dec = bob.final(); written += dec.length; - var bits = written * 8; var gbits = written / (1024 * 1024 * 1024); bench.end(gbits); } diff --git a/benchmark/crypto/hash-stream-creation.js b/benchmark/crypto/hash-stream-creation.js index a14aa220120e4e..4bcd37f00aaae8 100644 --- a/benchmark/crypto/hash-stream-creation.js +++ b/benchmark/crypto/hash-stream-creation.js @@ -1,5 +1,6 @@ // throughput benchmark // creates a single hasher, then pushes a bunch of data through it +'use strict'; var common = require('../common.js'); var crypto = require('crypto'); @@ -20,9 +21,6 @@ function main(conf) { api = 'legacy'; } - var crypto = require('crypto'); - var assert = require('assert'); - var message; var encoding; switch (conf.type) { diff --git a/benchmark/crypto/hash-stream-throughput.js b/benchmark/crypto/hash-stream-throughput.js index 2e987f03f5a1cf..050bbeb1ae54d3 100644 --- a/benchmark/crypto/hash-stream-throughput.js +++ b/benchmark/crypto/hash-stream-throughput.js @@ -1,5 +1,6 @@ // throughput benchmark // creates a single hasher, then pushes a bunch of data through it +'use strict'; var common = require('../common.js'); var crypto = require('crypto'); @@ -19,9 +20,6 @@ function main(conf) { api = 'legacy'; } - var crypto = require('crypto'); - var assert = require('assert'); - var message; var encoding; switch (conf.type) { diff --git a/benchmark/crypto/rsa-encrypt-decrypt-throughput.js b/benchmark/crypto/rsa-encrypt-decrypt-throughput.js index 1cd7a5e632910b..cf0579134cfb62 100644 --- a/benchmark/crypto/rsa-encrypt-decrypt-throughput.js +++ b/benchmark/crypto/rsa-encrypt-decrypt-throughput.js @@ -1,3 +1,4 @@ +'use strict'; // throughput benchmark in signing and verifying var common = require('../common.js'); var crypto = require('crypto'); @@ -22,7 +23,6 @@ var bench = common.createBenchmark(main, { }); function main(conf) { - var crypto = require('crypto'); var message = (new Buffer(conf.len)).fill('b'); bench.start(); @@ -38,7 +38,7 @@ function StreamWrite(algo, keylen, message, n, len) { var publicKey = RSA_PublicPem[keylen]; for (var i = 0; i < n; i++) { var enc = crypto.privateEncrypt(privateKey, message); - var clear = crypto.publicDecrypt(publicKey, enc); + crypto.publicDecrypt(publicKey, enc); } bench.end(kbits); diff --git a/benchmark/crypto/rsa-sign-verify-throughput.js b/benchmark/crypto/rsa-sign-verify-throughput.js index fd4260417b2221..779cc8bca1c6a8 100644 --- a/benchmark/crypto/rsa-sign-verify-throughput.js +++ b/benchmark/crypto/rsa-sign-verify-throughput.js @@ -1,3 +1,4 @@ +'use strict'; // throughput benchmark in signing and verifying var common = require('../common.js'); var crypto = require('crypto'); @@ -23,7 +24,6 @@ var bench = common.createBenchmark(main, { }); function main(conf) { - var crypto = require('crypto'); var message = (new Buffer(conf.len)).fill('b'); bench.start(); @@ -36,7 +36,6 @@ function StreamWrite(algo, keylen, message, writes, len) { var kbits = bits / (1024); var privateKey = RSA_PrivatePem[keylen]; - var publicKey = RSA_PublicPem[keylen]; var s = crypto.createSign(algo); var v = crypto.createVerify(algo); @@ -45,7 +44,7 @@ function StreamWrite(algo, keylen, message, writes, len) { v.update(message); } - var sign = s.sign(privateKey, 'binary'); + s.sign(privateKey, 'binary'); s.end(); v.end(); diff --git a/benchmark/dgram/array-vs-concat.js b/benchmark/dgram/array-vs-concat.js new file mode 100644 index 00000000000000..ee74ff66b92b4e --- /dev/null +++ b/benchmark/dgram/array-vs-concat.js @@ -0,0 +1,79 @@ +// test UDP send throughput with the multi buffer API against Buffer.concat +'use strict'; + +const common = require('../common.js'); +const PORT = common.PORT; + +// `num` is the number of send requests to queue up each time. +// Keep it reasonably high (>10) otherwise you're benchmarking the speed of +// event loop cycles more than anything else. +var bench = common.createBenchmark(main, { + len: [64, 256, 512, 1024], + num: [100], + chunks: [1, 2, 4, 8], + type: ['concat', 'multi'], + dur: [5] +}); + +var dur; +var len; +var num; +var type; +var chunk; +var chunks; + +function main(conf) { + dur = +conf.dur; + len = +conf.len; + num = +conf.num; + type = conf.type; + chunks = +conf.chunks; + + chunk = []; + for (var i = 0; i < chunks; i++) { + chunk.push(new Buffer(Math.round(len / chunks))); + } + + server(); +} + +var dgram = require('dgram'); + +function server() { + var sent = 0; + var received = 0; + var socket = dgram.createSocket('udp4'); + + var onsend = type === 'concat' ? onsendConcat : onsendMulti; + + function onsendConcat() { + if (sent++ % num == 0) + for (var i = 0; i < num; i++) { + socket.send(Buffer.concat(chunk), PORT, '127.0.0.1', onsend); + } + } + + function onsendMulti() { + if (sent++ % num == 0) + for (var i = 0; i < num; i++) { + socket.send(chunk, PORT, '127.0.0.1', onsend); + } + } + + socket.on('listening', function() { + bench.start(); + onsend(); + + setTimeout(function() { + var bytes = sent * len; + var gbits = (bytes * 8) / (1024 * 1024 * 1024); + bench.end(gbits); + }, dur * 1000); + }); + + socket.on('message', function(buf, rinfo) { + received++; + }); + + socket.bind(PORT); +} diff --git a/benchmark/dgram/multi-buffer.js b/benchmark/dgram/multi-buffer.js new file mode 100644 index 00000000000000..22c30594196711 --- /dev/null +++ b/benchmark/dgram/multi-buffer.js @@ -0,0 +1,69 @@ +// test UDP send/recv throughput with the multi buffer API +'use strict'; + +const common = require('../common.js'); +const PORT = common.PORT; + +// `num` is the number of send requests to queue up each time. +// Keep it reasonably high (>10) otherwise you're benchmarking the speed of +// event loop cycles more than anything else. +var bench = common.createBenchmark(main, { + len: [64, 256, 1024], + num: [100], + chunks: [1, 2, 4, 8], + type: ['send', 'recv'], + dur: [5] +}); + +var dur; +var len; +var num; +var type; +var chunk; +var chunks; + +function main(conf) { + dur = +conf.dur; + len = +conf.len; + num = +conf.num; + type = conf.type; + chunks = +conf.chunks; + + chunk = []; + for (var i = 0; i < chunks; i++) { + chunk.push(new Buffer(Math.round(len / chunks))); + } + + server(); +} + +var dgram = require('dgram'); + +function server() { + var sent = 0; + var received = 0; + var socket = dgram.createSocket('udp4'); + + function onsend() { + if (sent++ % num == 0) + for (var i = 0; i < num; i++) + socket.send(chunk, PORT, '127.0.0.1', onsend); + } + + socket.on('listening', function() { + bench.start(); + onsend(); + + setTimeout(function() { + var bytes = (type === 'send' ? sent : received) * len; + var gbits = (bytes * 8) / (1024 * 1024 * 1024); + bench.end(gbits); + }, dur * 1000); + }); + + socket.on('message', function(buf, rinfo) { + received++; + }); + + socket.bind(PORT); +} diff --git a/benchmark/dgram/offset-length.js b/benchmark/dgram/offset-length.js new file mode 100644 index 00000000000000..c11c465f5cf82b --- /dev/null +++ b/benchmark/dgram/offset-length.js @@ -0,0 +1,61 @@ +// test UDP send/recv throughput with the "old" offset/length API +'use strict'; + +const common = require('../common.js'); +const PORT = common.PORT; + +// `num` is the number of send requests to queue up each time. +// Keep it reasonably high (>10) otherwise you're benchmarking the speed of +// event loop cycles more than anything else. +var bench = common.createBenchmark(main, { + len: [1, 64, 256, 1024], + num: [100], + type: ['send', 'recv'], + dur: [5] +}); + +var dur; +var len; +var num; +var type; +var chunk; + +function main(conf) { + dur = +conf.dur; + len = +conf.len; + num = +conf.num; + type = conf.type; + chunk = new Buffer(len); + server(); +} + +var dgram = require('dgram'); + +function server() { + var sent = 0; + var received = 0; + var socket = dgram.createSocket('udp4'); + + function onsend() { + if (sent++ % num == 0) + for (var i = 0; i < num; i++) + socket.send(chunk, 0, chunk.length, PORT, '127.0.0.1', onsend); + } + + socket.on('listening', function() { + bench.start(); + onsend(); + + setTimeout(function() { + var bytes = (type === 'send' ? sent : received) * chunk.length; + var gbits = (bytes * 8) / (1024 * 1024 * 1024); + bench.end(gbits); + }, dur * 1000); + }); + + socket.on('message', function(buf, rinfo) { + received++; + }); + + socket.bind(PORT); +} diff --git a/benchmark/dgram/single-buffer.js b/benchmark/dgram/single-buffer.js new file mode 100644 index 00000000000000..765311a72f3903 --- /dev/null +++ b/benchmark/dgram/single-buffer.js @@ -0,0 +1,61 @@ +// test UDP send/recv throughput with the new single Buffer API +'use strict'; + +const common = require('../common.js'); +const PORT = common.PORT; + +// `num` is the number of send requests to queue up each time. +// Keep it reasonably high (>10) otherwise you're benchmarking the speed of +// event loop cycles more than anything else. +var bench = common.createBenchmark(main, { + len: [1, 64, 256, 1024], + num: [100], + type: ['send', 'recv'], + dur: [5] +}); + +var dur; +var len; +var num; +var type; +var chunk; + +function main(conf) { + dur = +conf.dur; + len = +conf.len; + num = +conf.num; + type = conf.type; + chunk = new Buffer(len); + server(); +} + +var dgram = require('dgram'); + +function server() { + var sent = 0; + var received = 0; + var socket = dgram.createSocket('udp4'); + + function onsend() { + if (sent++ % num == 0) + for (var i = 0; i < num; i++) + socket.send(chunk, PORT, '127.0.0.1', onsend); + } + + socket.on('listening', function() { + bench.start(); + onsend(); + + setTimeout(function() { + var bytes = (type === 'send' ? sent : received) * chunk.length; + var gbits = (bytes * 8) / (1024 * 1024 * 1024); + bench.end(gbits); + }, dur * 1000); + }); + + socket.on('message', function(buf, rinfo) { + received++; + }); + + socket.bind(PORT); +} diff --git a/benchmark/domain/domain-fn-args.js b/benchmark/domain/domain-fn-args.js new file mode 100644 index 00000000000000..e9b24811c81689 --- /dev/null +++ b/benchmark/domain/domain-fn-args.js @@ -0,0 +1,44 @@ +'use strict'; +var common = require('../common.js'); +var domain = require('domain'); + +var bench = common.createBenchmark(main, { + arguments: [0, 1, 2, 3], + n: [10] +}); + +var bdomain = domain.create(); +var gargs = [1, 2, 3]; + +function main(conf) { + + var args, n = +conf.n; + var myArguments = gargs.slice(0, conf.arguments); + bench.start(); + + bdomain.enter(); + for (var i = 0; i < n; i++) { + if (myArguments.length >= 2) { + args = Array.prototype.slice.call(myArguments, 1); + fn.apply(this, args); + } else { + fn.call(this); + } + } + bdomain.exit(); + + bench.end(n); +} + +function fn(a, b, c) { + if (!a) + a = 1; + + if (!b) + b = 2; + + if (!c) + c = 3; + + return a + b + c; +} diff --git a/benchmark/events/ee-add-remove.js b/benchmark/events/ee-add-remove.js index cd9fe3cb7de057..99d85367cb8d6f 100644 --- a/benchmark/events/ee-add-remove.js +++ b/benchmark/events/ee-add-remove.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var events = require('events'); @@ -9,14 +10,15 @@ function main(conf) { var ee = new events.EventEmitter(); var listeners = []; - for (var k = 0; k < 10; k += 1) + var k; + for (k = 0; k < 10; k += 1) listeners.push(function() {}); bench.start(); for (var i = 0; i < n; i += 1) { - for (var k = listeners.length; --k >= 0; /* empty */) + for (k = listeners.length; --k >= 0; /* empty */) ee.on('dummy', listeners[k]); - for (var k = listeners.length; --k >= 0; /* empty */) + for (k = listeners.length; --k >= 0; /* empty */) ee.removeListener('dummy', listeners[k]); } bench.end(n); diff --git a/benchmark/events/ee-emit-multi-args.js b/benchmark/events/ee-emit-multi-args.js index 78a892d457095d..b423c216b1ed73 100644 --- a/benchmark/events/ee-emit-multi-args.js +++ b/benchmark/events/ee-emit-multi-args.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var EventEmitter = require('events').EventEmitter; @@ -7,7 +8,6 @@ function main(conf) { var n = conf.n | 0; var ee = new EventEmitter(); - var listeners = []; for (var k = 0; k < 10; k += 1) ee.on('dummy', function() {}); diff --git a/benchmark/events/ee-emit.js b/benchmark/events/ee-emit.js index 4c45bd9b719665..87772222f0a467 100644 --- a/benchmark/events/ee-emit.js +++ b/benchmark/events/ee-emit.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var EventEmitter = require('events').EventEmitter; diff --git a/benchmark/events/ee-listener-count-on-prototype.js b/benchmark/events/ee-listener-count-on-prototype.js index 8d536edd62739b..dfe7e27cd09144 100644 --- a/benchmark/events/ee-listener-count-on-prototype.js +++ b/benchmark/events/ee-listener-count-on-prototype.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var EventEmitter = require('events').EventEmitter; @@ -13,7 +14,7 @@ function main(conf) { bench.start(); for (var i = 0; i < n; i += 1) { - var r = ee.listenerCount('dummy'); + ee.listenerCount('dummy'); } bench.end(n); } diff --git a/benchmark/events/ee-listeners-many.js b/benchmark/events/ee-listeners-many.js index 32721b32e56527..063732e1facb4b 100644 --- a/benchmark/events/ee-listeners-many.js +++ b/benchmark/events/ee-listeners-many.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var EventEmitter = require('events').EventEmitter; @@ -14,7 +15,7 @@ function main(conf) { bench.start(); for (var i = 0; i < n; i += 1) { - var r = ee.listeners('dummy'); + ee.listeners('dummy'); } bench.end(n); } diff --git a/benchmark/events/ee-listeners.js b/benchmark/events/ee-listeners.js index 68339bc3eca77a..e91ca5078f5f98 100644 --- a/benchmark/events/ee-listeners.js +++ b/benchmark/events/ee-listeners.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var EventEmitter = require('events').EventEmitter; @@ -13,7 +14,7 @@ function main(conf) { bench.start(); for (var i = 0; i < n; i += 1) { - var r = ee.listeners('dummy'); + ee.listeners('dummy'); } bench.end(n); } diff --git a/benchmark/fs-write-stream-throughput.js b/benchmark/fs-write-stream-throughput.js index b131d5b736fd38..4c767cf666e579 100644 --- a/benchmark/fs-write-stream-throughput.js +++ b/benchmark/fs-write-stream-throughput.js @@ -1,5 +1,5 @@ - // If there are no args, then this is the root. Run all the benchmarks! +'use strict'; if (!process.argv[2]) parent(); else @@ -39,24 +39,24 @@ function parent() { function runTest(dur, size, type) { if (type !== 'string') type = 'buffer'; + var chunk; switch (type) { case 'string': - var chunk = new Array(size + 1).join('a'); + chunk = new Array(size + 1).join('a'); break; case 'buffer': - var chunk = new Buffer(size); + chunk = new Buffer(size); chunk.fill('a'); break; } - var writes = 0; var fs = require('fs'); try { fs.unlinkSync('write_stream_throughput'); } catch (e) {} - var start + var start; var end; function done() { - var time = end[0] + end[1]/1E9; + var time = end[0] + end[1] / 1E9; var written = fs.statSync('write_stream_throughput').size / 1024; var rate = (written / time).toFixed(2); console.log('fs_write_stream_dur_%d_size_%d_type_%s: %d', diff --git a/benchmark/fs/bench-readdir.js b/benchmark/fs/bench-readdir.js new file mode 100644 index 00000000000000..565b92d14954ca --- /dev/null +++ b/benchmark/fs/bench-readdir.js @@ -0,0 +1,23 @@ +'use strict'; + +const common = require('../common'); +const fs = require('fs'); +const path = require('path'); + +const bench = common.createBenchmark(main, { + n: [1e4], +}); + + +function main(conf) { + const n = conf.n >>> 0; + + bench.start(); + (function r(cntr) { + if (--cntr <= 0) + return bench.end(n); + fs.readdir(path.resolve(__dirname, '../../lib/'), function() { + r(cntr); + }); + }(n)); +} diff --git a/benchmark/fs/bench-readdirSync.js b/benchmark/fs/bench-readdirSync.js new file mode 100644 index 00000000000000..8ba2a6ec4976c1 --- /dev/null +++ b/benchmark/fs/bench-readdirSync.js @@ -0,0 +1,20 @@ +'use strict'; + +const common = require('../common'); +const fs = require('fs'); +const path = require('path'); + +const bench = common.createBenchmark(main, { + n: [1e4], +}); + + +function main(conf) { + const n = conf.n >>> 0; + + bench.start(); + for (var i = 0; i < n; i++) { + fs.readdirSync(path.resolve(__dirname, '../../lib/')); + } + bench.end(n); +} diff --git a/benchmark/fs/read-stream-throughput.js b/benchmark/fs/read-stream-throughput.js index a181a2df60291c..c305485cd5f8dc 100644 --- a/benchmark/fs/read-stream-throughput.js +++ b/benchmark/fs/read-stream-throughput.js @@ -1,4 +1,5 @@ // test the throughput of the fs.WriteStream class. +'use strict'; var path = require('path'); var common = require('../common.js'); @@ -11,7 +12,7 @@ var type, encoding, size; var bench = common.createBenchmark(main, { type: ['buf', 'asc', 'utf'], - size: [1024, 4096, 65535, 1024*1024] + size: [1024, 4096, 65535, 1024 * 1024] }); function main(conf) { diff --git a/benchmark/fs/readfile.js b/benchmark/fs/readfile.js index ac3241901b931e..0f39f64f57c418 100644 --- a/benchmark/fs/readfile.js +++ b/benchmark/fs/readfile.js @@ -1,6 +1,7 @@ // Call fs.readFile over and over again really fast. // Then see how many times it got called. // Yes, this is a silly benchmark. Most benchmarks are silly. +'use strict'; var path = require('path'); var common = require('../common.js'); diff --git a/benchmark/fs/write-stream-throughput.js b/benchmark/fs/write-stream-throughput.js index 9ff58389c7959d..4f41d2b4bb4af3 100644 --- a/benchmark/fs/write-stream-throughput.js +++ b/benchmark/fs/write-stream-throughput.js @@ -1,4 +1,5 @@ // test the throughput of the fs.WriteStream class. +'use strict'; var path = require('path'); var common = require('../common.js'); @@ -28,7 +29,7 @@ function main(conf) { encoding = 'ascii'; break; case 'utf': - chunk = new Array(Math.ceil(size/2) + 1).join('ü'); + chunk = new Array(Math.ceil(size / 2) + 1).join('ü'); encoding = 'utf8'; break; default: diff --git a/benchmark/http/_chunky_http_client.js b/benchmark/http/_chunky_http_client.js index 24e14ca2bc9b0e..158be5a0eb6424 100644 --- a/benchmark/http/_chunky_http_client.js +++ b/benchmark/http/_chunky_http_client.js @@ -15,7 +15,6 @@ var bench = common.createBenchmark(main, { function main(conf) { var len = +conf.len; var num = +conf.num; - var type = conf.type; var todo = []; var headers = []; // Chose 7 because 9 showed "Connection error" / "Connection closed" @@ -24,7 +23,7 @@ function main(conf) { headers.push(Array(i + 1).join('o')); function WriteHTTPHeaders(channel, has_keep_alive, extra_header_count) { - todo = [] + todo = []; todo.push('GET / HTTP/1.1'); todo.push('Host: localhost'); todo.push('Connection: keep-alive'); @@ -63,7 +62,7 @@ function main(conf) { var socket = net.connect(PIPE, function() { bench.start(); WriteHTTPHeaders(socket, 1, len); - socket.setEncoding('utf8') + socket.setEncoding('utf8'); socket.on('data', function(d) { var did = false; var pattern = 'HTTP/1.1 200 OK\r\n'; @@ -73,7 +72,7 @@ function main(conf) { success += 1; did = true; } else { - pattern = 'HTTP/1.1 ' + pattern = 'HTTP/1.1 '; if ((d.length === pattern.length && d === pattern) || (d.length > pattern.length && d.slice(0, pattern.length) === pattern)) { diff --git a/benchmark/http/bench-parser.js b/benchmark/http/bench-parser.js new file mode 100644 index 00000000000000..989d9a994fa04e --- /dev/null +++ b/benchmark/http/bench-parser.js @@ -0,0 +1,55 @@ +'use strict'; + +const common = require('../common'); +const HTTPParser = process.binding('http_parser').HTTPParser; +const REQUEST = HTTPParser.REQUEST; +const kOnHeaders = HTTPParser.kOnHeaders | 0; +const kOnHeadersComplete = HTTPParser.kOnHeadersComplete | 0; +const kOnBody = HTTPParser.kOnBody | 0; +const kOnMessageComplete = HTTPParser.kOnMessageComplete | 0; +const CRLF = '\r\n'; + +const bench = common.createBenchmark(main, { + fields: [4, 8, 16, 32], + n: [1e5], +}); + + +function main(conf) { + const fields = conf.fields >>> 0; + const n = conf.n >>> 0; + var header = `GET /hello HTTP/1.1${CRLF}Content-Type: text/plain${CRLF}`; + + for (var i = 0; i < fields; i++) { + header += `X-Filler${i}: ${Math.random().toString(36).substr(2)}${CRLF}`; + } + header += CRLF; + + processHeader(new Buffer(header), n); +} + + +function processHeader(header, n) { + const parser = newParser(REQUEST); + + bench.start(); + for (var i = 0; i < n; i++) { + parser.execute(header, 0, header.length); + parser.reinitialize(REQUEST); + } + bench.end(n); +} + + +function newParser(type) { + const parser = new HTTPParser(type); + + parser.headers = []; + + parser[kOnHeaders] = function() { }; + parser[kOnHeadersComplete] = function() { }; + parser[kOnBody] = function() { }; + parser[kOnMessageComplete] = function() { }; + + return parser; +} diff --git a/benchmark/http/check_is_http_token.js b/benchmark/http/check_is_http_token.js new file mode 100644 index 00000000000000..9e0b8279b58ed0 --- /dev/null +++ b/benchmark/http/check_is_http_token.js @@ -0,0 +1,52 @@ +'use strict'; + +const common = require('../common.js'); +const _checkIsHttpToken = require('_http_common')._checkIsHttpToken; + +const bench = common.createBenchmark(main, { + key: [ + 'TCN', + 'ETag', + 'date', + 'Vary', + 'server', + 'Server', + 'status', + 'version', + 'Expires', + 'alt-svc', + 'location', + 'Connection', + 'Keep-Alive', + 'content-type', + 'Content-Type', + 'Cache-Control', + 'Last-Modified', + 'Accept-Ranges', + 'content-length', + 'x-frame-options', + 'x-xss-protection', + 'Content-Encoding', + 'Content-Location', + 'Transfer-Encoding', + 'alternate-protocol', + ':', // invalid input + '@@', + '中文呢', // unicode + '((((())))', // invalid + ':alternate-protocol', // fast bailout + 'alternate-protocol:' // slow bailout + ], + n: [1e6], +}); + +function main(conf) { + var n = +conf.n; + var key = conf.key; + + bench.start(); + for (var i = 0; i < n; i++) { + _checkIsHttpToken(key); + } + bench.end(n); +} diff --git a/benchmark/http/chunked.js b/benchmark/http/chunked.js index 0589ff3166f04d..642f2962cdce78 100644 --- a/benchmark/http/chunked.js +++ b/benchmark/http/chunked.js @@ -6,9 +6,9 @@ // always as hot as it could be. // // Verify that our assumptions are valid. +'use strict'; var common = require('../common.js'); -var PORT = common.PORT; var bench = common.createBenchmark(main, { num: [1, 4, 8, 16], @@ -17,7 +17,7 @@ var bench = common.createBenchmark(main, { }); function main(conf) { - http = require('http'); + const http = require('http'); var chunk = new Buffer(conf.size); chunk.fill('8'); diff --git a/benchmark/http/client-request-body.js b/benchmark/http/client-request-body.js index 1c27dea2a2066e..befa3811ddd1c3 100644 --- a/benchmark/http/client-request-body.js +++ b/benchmark/http/client-request-body.js @@ -1,4 +1,5 @@ // Measure the time it takes for the HTTP client to send a request body. +'use strict'; var common = require('../common.js'); var http = require('http'); diff --git a/benchmark/http/cluster.js b/benchmark/http/cluster.js index 6391704ff7836b..9934883f7c3fa4 100644 --- a/benchmark/http/cluster.js +++ b/benchmark/http/cluster.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var PORT = common.PORT; diff --git a/benchmark/http/end-vs-write-end.js b/benchmark/http/end-vs-write-end.js index c17e2ffb45fa02..4e12e543f0bd92 100644 --- a/benchmark/http/end-vs-write-end.js +++ b/benchmark/http/end-vs-write-end.js @@ -6,9 +6,9 @@ // always as hot as it could be. // // Verify that our assumptions are valid. +'use strict'; var common = require('../common.js'); -var PORT = common.PORT; var bench = common.createBenchmark(main, { type: ['asc', 'utf', 'buf'], @@ -18,7 +18,7 @@ var bench = common.createBenchmark(main, { }); function main(conf) { - http = require('http'); + const http = require('http'); var chunk; var len = conf.kb * 1024; switch (conf.type) { @@ -27,7 +27,6 @@ function main(conf) { chunk.fill('x'); break; case 'utf': - encoding = 'utf8'; chunk = new Array(len / 2 + 1).join('ü'); break; case 'asc': diff --git a/benchmark/http/http_server_for_chunky_client.js b/benchmark/http/http_server_for_chunky_client.js index dede7daa7cdc75..d85e15bcbed4e9 100644 --- a/benchmark/http/http_server_for_chunky_client.js +++ b/benchmark/http/http_server_for_chunky_client.js @@ -4,8 +4,8 @@ var path = require('path'); var http = require('http'); var fs = require('fs'); var spawn = require('child_process').spawn; -var common = require('../common.js') -var test = require('../../test/common.js') +require('../common.js'); +var test = require('../../test/common.js'); var pep = path.dirname(process.argv[1]) + '/_chunky_http_client.js'; var PIPE = test.PIPE; @@ -38,17 +38,17 @@ try { child = spawn(process.execPath, [pep], { }); child.on('error', function(err) { - throw new Error('spawn error: ' + err ); + throw new Error('spawn error: ' + err); }); child.stdout.pipe(process.stdout); child.stderr.pipe(process.stderr); - child.on('close', function (exitCode) { + child.on('close', function(exitCode) { server.close(); }); -} catch(e) { - throw new Error('error: ' + e ); +} catch (e) { + throw new Error('error: ' + e); } diff --git a/benchmark/http/simple.js b/benchmark/http/simple.js index 5bff9283cb51a1..5449c49be97614 100644 --- a/benchmark/http/simple.js +++ b/benchmark/http/simple.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var PORT = common.PORT; @@ -11,7 +12,6 @@ var bench = common.createBenchmark(main, { function main(conf) { process.env.PORT = PORT; - var spawn = require('child_process').spawn; var server = require('../http_simple.js'); setTimeout(function() { var path = '/' + conf.type + '/' + conf.length + '/' + conf.chunks; diff --git a/benchmark/http_bench.js b/benchmark/http_bench.js index a8f99e2f0e7978..354993a2706a95 100644 --- a/benchmark/http_bench.js +++ b/benchmark/http_bench.js @@ -1,3 +1,4 @@ +'use strict'; var spawn = require('child_process').spawn; var cluster = require('cluster'); var http = require('http'); @@ -20,10 +21,10 @@ for (var i = 2; i < process.argv.length; ++i) { } switch (options.mode) { -case 'master': startMaster(); break; -case 'server': startServer(); break; -case 'client': startClient(); break; -default: throw new Error('Bad mode: ' + options.mode); + case 'master': startMaster(); break; + case 'server': startServer(); break; + case 'client': startClient(); break; + default: throw new Error('Bad mode: ' + options.mode); } process.title = 'http_bench[' + options.mode + ']'; @@ -47,7 +48,7 @@ function startMaster() { var forkCount = 0; - cluster.on('online', function () { + cluster.on('online', function() { forkCount = forkCount + 1; if (forkCount === ~~options.servers) { var args = [ diff --git a/benchmark/http_server_lag.js b/benchmark/http_server_lag.js index ca923d5b34afde..a3c18628ec68ba 100644 --- a/benchmark/http_server_lag.js +++ b/benchmark/http_server_lag.js @@ -1,3 +1,5 @@ +'use strict'; + var http = require('http'); var port = parseInt(process.env.PORT, 10) || 8000; var defaultLag = parseInt(process.argv[2], 10) || 100; @@ -6,7 +8,7 @@ http.createServer(function(req, res) { res.writeHead(200, { 'content-type': 'text/plain', 'content-length': '2' }); - var lag = parseInt(req.url.split("/").pop(), 10) || defaultLag; + var lag = parseInt(req.url.split('/').pop(), 10) || defaultLag; setTimeout(function() { res.end('ok'); }, lag); diff --git a/benchmark/http_simple.js b/benchmark/http_simple.js index 36800f2c9dba5a..9a580de2c0f665 100644 --- a/benchmark/http_simple.js +++ b/benchmark/http_simple.js @@ -1,13 +1,13 @@ -var path = require('path'), - exec = require('child_process').exec, - http = require('http'); +'use strict'; + +var http = require('http'); var port = parseInt(process.env.PORT || 8000); -var fixed = makeString(20 * 1024, 'C'), - storedBytes = {}, - storedBuffer = {}, - storedUnicode = {}; +var fixed = 'C'.repeat(20 * 1024), + storedBytes = {}, + storedBuffer = {}, + storedUnicode = {}; var useDomains = process.env.NODE_USE_DOMAINS; @@ -22,7 +22,7 @@ if (useDomains) { gdom.enter(); } -var server = module.exports = http.createServer(function (req, res) { +var server = module.exports = http.createServer(function(req, res) { if (useDomains) { var dom = domain.create(); dom.add(req); @@ -36,33 +36,34 @@ var server = module.exports = http.createServer(function (req, res) { var n_chunks = parseInt(commands[3], 10); var status = 200; + var n, i; if (command == 'bytes') { - var n = ~~arg; + n = ~~arg; if (n <= 0) - throw new Error('bytes called with n <= 0') + throw new Error('bytes called with n <= 0'); if (storedBytes[n] === undefined) { - storedBytes[n] = makeString(n, 'C'); + storedBytes[n] = 'C'.repeat(n); } body = storedBytes[n]; } else if (command == 'buffer') { - var n = ~~arg; + n = ~~arg; if (n <= 0) throw new Error('buffer called with n <= 0'); if (storedBuffer[n] === undefined) { storedBuffer[n] = new Buffer(n); - for (var i = 0; i < n; i++) { + for (i = 0; i < n; i++) { storedBuffer[n][i] = 'C'.charCodeAt(0); } } body = storedBuffer[n]; } else if (command == 'unicode') { - var n = ~~arg; + n = ~~arg; if (n <= 0) throw new Error('unicode called with n <= 0'); if (storedUnicode[n] === undefined) { - storedUnicode[n] = makeString(n, '\u263A'); + storedUnicode[n] = '\u263A'.repeat(n); } body = storedUnicode[n]; @@ -93,7 +94,7 @@ var server = module.exports = http.createServer(function (req, res) { var len = body.length; var step = Math.floor(len / n_chunks) || 1; - for (var i = 0, n = (n_chunks - 1); i < n; ++i) { + for (i = 0, n = (n_chunks - 1); i < n; ++i) { res.write(body.slice(i * step, i * step + step)); } res.end(body.slice((n_chunks - 1) * step)); @@ -106,15 +107,7 @@ var server = module.exports = http.createServer(function (req, res) { } }); -function makeString(size, c) { - var s = ''; - while (s.length < size) { - s += c; - } - return s; -} - -server.listen(port, function () { +server.listen(port, function() { if (module === require.main) - console.error('Listening at http://127.0.0.1:'+port+'/'); + console.error('Listening at http://127.0.0.1:' + port + '/'); }); diff --git a/benchmark/http_simple_auto.js b/benchmark/http_simple_auto.js index f72cc01e60aa46..8ac878a07646ed 100644 --- a/benchmark/http_simple_auto.js +++ b/benchmark/http_simple_auto.js @@ -6,94 +6,90 @@ // Arguments to pass to `ab`. // Target to benchmark, e.g. `bytes/1024` or `buffer/8192`. // +'use strict'; -var path = require("path"); -var http = require("http"); -var spawn = require("child_process").spawn; +var http = require('http'); +var spawn = require('child_process').spawn; var port = parseInt(process.env.PORT || 8000); -var fixed = "" -for (var i = 0; i < 20*1024; i++) { - fixed += "C"; -} +var fixed = 'C'.repeat(20 * 1024); var stored = {}; var storedBuffer = {}; -var server = http.createServer(function (req, res) { - var commands = req.url.split("/"); +var server = http.createServer(function(req, res) { + var commands = req.url.split('/'); var command = commands[1]; - var body = ""; + var body = ''; var arg = commands[2]; var n_chunks = parseInt(commands[3], 10); var status = 200; + var n; + var i; - if (command == "bytes") { - var n = parseInt(arg, 10) + if (command == 'bytes') { + n = parseInt(arg, 10); if (n <= 0) - throw "bytes called with n <= 0" + throw new Error('bytes called with n <= 0'); if (stored[n] === undefined) { - stored[n] = ""; - for (var i = 0; i < n; i++) { - stored[n] += "C" - } + stored[n] = 'C'.repeat(n); } body = stored[n]; - } else if (command == "buffer") { - var n = parseInt(arg, 10) - if (n <= 0) throw new Error("bytes called with n <= 0"); + } else if (command == 'buffer') { + n = parseInt(arg, 10); + if (n <= 0) throw new Error('bytes called with n <= 0'); if (storedBuffer[n] === undefined) { storedBuffer[n] = new Buffer(n); - for (var i = 0; i < n; i++) { - storedBuffer[n][i] = "C".charCodeAt(0); + for (i = 0; i < n; i++) { + storedBuffer[n][i] = 'C'.charCodeAt(0); } } body = storedBuffer[n]; - } else if (command == "quit") { + } else if (command == 'quit') { res.connection.server.close(); - body = "quitting"; + body = 'quitting'; - } else if (command == "fixed") { + } else if (command == 'fixed') { body = fixed; - } else if (command == "echo") { - res.writeHead(200, { "Content-Type": "text/plain", - "Transfer-Encoding": "chunked" }); + } else if (command == 'echo') { + res.writeHead(200, { 'Content-Type': 'text/plain', + 'Transfer-Encoding': 'chunked' }); req.pipe(res); return; } else { status = 404; - body = "not found\n"; + body = 'not found\n'; } // example: http://localhost:port/bytes/512/4 // sends a 512 byte body in 4 chunks of 128 bytes if (n_chunks > 0) { - res.writeHead(status, { "Content-Type": "text/plain", - "Transfer-Encoding": "chunked" }); + res.writeHead(status, { 'Content-Type': 'text/plain', + 'Transfer-Encoding': 'chunked' }); // send body in chunks var len = body.length; var step = Math.floor(len / n_chunks) || 1; - for (var i = 0, n = (n_chunks - 1); i < n; ++i) { + for (i = 0, n = (n_chunks - 1); i < n; ++i) { res.write(body.slice(i * step, i * step + step)); } res.end(body.slice((n_chunks - 1) * step)); } else { var content_length = body.length.toString(); - res.writeHead(status, { "Content-Type": "text/plain", - "Content-Length": content_length }); + res.writeHead(status, { 'Content-Type': 'text/plain', + 'Content-Length': content_length }); res.end(body); } }); -server.listen(port, function () { +server.listen(port, function() { var url = 'http://127.0.0.1:' + port + '/'; var n = process.argv.length - 1; @@ -109,10 +105,10 @@ server.listen(port, function () { }); function dump_mm_stats() { - if (typeof gc != 'function') return; + if (typeof global.gc != 'function') return; var before = process.memoryUsage(); - for (var i = 0; i < 10; ++i) gc(); + for (var i = 0; i < 10; ++i) global.gc(); var after = process.memoryUsage(); setTimeout(print_stats, 250); // give GC time to settle diff --git a/benchmark/http_simple_bench.sh b/benchmark/http_simple_bench.sh index 30bd050b6486b8..ade6a8d10eb0ff 100755 --- a/benchmark/http_simple_bench.sh +++ b/benchmark/http_simple_bench.sh @@ -42,7 +42,7 @@ ab_hello_world() { data_fn="$dir/$date.data" echo "Bench $name starts in 3 seconds..." - # let shit calm down + # let things calm down sleep 3 # hammer that as hard as it can for 10 seconds. diff --git a/benchmark/http_simple_cluster.js b/benchmark/http_simple_cluster.js index 9a886f2ee75dab..f48a2a2599a78f 100644 --- a/benchmark/http_simple_cluster.js +++ b/benchmark/http_simple_cluster.js @@ -1,9 +1,11 @@ -var cluster = require('cluster'); -var os = require('os'); +'use strict'; +const cluster = require('cluster'); +const os = require('os'); +const path = require('path'); if (cluster.isMaster) { console.log('master running on pid %d', process.pid); for (var i = 0, n = os.cpus().length; i < n; ++i) cluster.fork(); } else { - require(__dirname + '/http_simple.js'); + require(path.join(__dirname, 'http_simple.js')); } diff --git a/benchmark/idle_clients.js b/benchmark/idle_clients.js index da96b8ac654db4..d294e685224d8b 100644 --- a/benchmark/idle_clients.js +++ b/benchmark/idle_clients.js @@ -1,27 +1,25 @@ -net = require('net'); +'use strict'; +const net = require('net'); var errors = 0, connections = 0; -var lastClose = 0; - -function connect () { - process.nextTick(function () { +function connect() { + process.nextTick(function() { var s = net.Stream(); var gotConnected = false; s.connect(9000); - s.on('connect', function () { + s.on('connect', function() { gotConnected = true; connections++; connect(); }); - s.on('close', function () { + s.on('close', function() { if (gotConnected) connections--; - lastClose = new Date(); }); - s.on('error', function () { + s.on('error', function() { errors++; }); }); @@ -35,15 +33,15 @@ var oldConnections, oldErrors; // Try to start new connections every so often setInterval(connect, 5000); -setInterval(function () { +setInterval(function() { if (oldConnections != connections) { oldConnections = connections; - console.log("CLIENT %d connections: %d", process.pid, connections); + console.log('CLIENT %d connections: %d', process.pid, connections); } if (oldErrors != errors) { oldErrors = errors; - console.log("CLIENT %d errors: %d", process.pid, errors); + console.log('CLIENT %d errors: %d', process.pid, errors); } }, 1000); diff --git a/benchmark/idle_server.js b/benchmark/idle_server.js index a4c70d76d36ffe..78e496690d1d4e 100644 --- a/benchmark/idle_server.js +++ b/benchmark/idle_server.js @@ -1,12 +1,12 @@ -net = require('net'); -connections = 0; +'use strict'; +const net = require('net'); var errors = 0; -server = net.Server(function (socket) { +var server = net.Server(function(socket) { - socket.on('error', function () { - errors++; + socket.on('error', function() { + errors++; }); }); @@ -17,15 +17,14 @@ server.listen(9000); var oldConnections, oldErrors; -setInterval(function () { +setInterval(function() { if (oldConnections != server.connections) { oldConnections = server.connections; - console.log("SERVER %d connections: %d", process.pid, server.connections); + console.log('SERVER %d connections: %d', process.pid, server.connections); } if (oldErrors != errors) { oldErrors = errors; - console.log("SERVER %d errors: %d", process.pid, errors); + console.log('SERVER %d errors: %d', process.pid, errors); } }, 1000); - diff --git a/benchmark/misc/domain-fn-args.js b/benchmark/misc/domain-fn-args.js deleted file mode 100644 index 36e9e900299bb2..00000000000000 --- a/benchmark/misc/domain-fn-args.js +++ /dev/null @@ -1,43 +0,0 @@ -var common = require('../common.js'); -var domain = require('domain'); - -var bench = common.createBenchmark(main, { - arguments: [0, 1, 2, 3], - n: [10] -}); - -var bdomain = domain.create(); -var gargs = [1, 2, 3]; - -function main(conf) { - - var args, ret, n = +conf.n; - var arguments = gargs.slice(0, conf.arguments); - bench.start(); - - bdomain.enter(); - for (var i = 0; i < n; i++) { - if (arguments.length >= 2) { - args = Array.prototype.slice.call(arguments, 1); - ret = fn.apply(this, args); - } else { - ret = fn.call(this); - } - } - bdomain.exit(); - - bench.end(n); -} - -function fn(a, b, c) { - if (!a) - a = 1; - - if (!b) - b = 2; - - if (!c) - c = 3; - - return a + b + c; -} \ No newline at end of file diff --git a/benchmark/misc/freelist.js b/benchmark/misc/freelist.js new file mode 100644 index 00000000000000..7956dc3d6b18c0 --- /dev/null +++ b/benchmark/misc/freelist.js @@ -0,0 +1,38 @@ +'use strict'; + +var common = require('../common.js'); +var FreeList = require('internal/freelist').FreeList; + +var bench = common.createBenchmark(main, { + n: [100000] +}); + +function main(conf) { + var n = conf.n; + var poolSize = 1000; + var list = new FreeList('test', poolSize, Object); + var i; + var j; + var used = []; + + // First, alloc `poolSize` items + for (j = 0; j < poolSize; j++) { + used.push(list.alloc()); + } + + bench.start(); + + for (i = 0; i < n; i++) { + // Return all the items to the pool + for (j = 0; j < poolSize; j++) { + list.free(used[j]); + } + + // Re-alloc from pool + for (j = 0; j < poolSize; j++) { + list.alloc(); + } + } + + bench.end(n); +} diff --git a/benchmark/misc/function_call/index.js b/benchmark/misc/function_call/index.js index fc8542a068ccd6..04f5627093893e 100644 --- a/benchmark/misc/function_call/index.js +++ b/benchmark/misc/function_call/index.js @@ -2,6 +2,7 @@ // relative to a comparable C++ function. // Reports millions of calls per second. // Note that JS speed goes up, while cxx speed stays about the same. +'use strict'; var assert = require('assert'); var common = require('../../common.js'); @@ -27,7 +28,7 @@ assert(js() === cxx()); var bench = common.createBenchmark(main, { type: ['js', 'cxx'], - millions: [1,10,50] + millions: [1, 10, 50] }); function main(conf) { diff --git a/benchmark/misc/module-loader.js b/benchmark/misc/module-loader.js deleted file mode 100644 index e53bc4d801164b..00000000000000 --- a/benchmark/misc/module-loader.js +++ /dev/null @@ -1,52 +0,0 @@ -var fs = require('fs'); -var path = require('path'); -var common = require('../common.js'); -var packageJson = '{"main": "index.js"}'; - -var tmpDirectory = path.join(__dirname, '..', 'tmp'); -var benchmarkDirectory = path.join(tmpDirectory, 'nodejs-benchmark-module'); - -var bench = common.createBenchmark(main, { - thousands: [50] -}); - -function main(conf) { - rmrf(tmpDirectory); - try { fs.mkdirSync(tmpDirectory); } catch (e) {} - try { fs.mkdirSync(benchmarkDirectory); } catch (e) {} - - var n = +conf.thousands * 1e3; - for (var i = 0; i <= n; i++) { - fs.mkdirSync(benchmarkDirectory + i); - fs.writeFileSync(benchmarkDirectory + i + '/package.json', '{"main": "index.js"}'); - fs.writeFileSync(benchmarkDirectory + i + '/index.js', 'module.exports = "";'); - } - - measure(n); -} - -function measure(n) { - bench.start(); - for (var i = 0; i <= n; i++) { - require(benchmarkDirectory + i); - } - bench.end(n / 1e3); -} - -function rmrf(location) { - try { - var things = fs.readdirSync(location); - things.forEach(function(thing) { - var cur = path.join(location, thing), - isDirectory = fs.statSync(cur).isDirectory(); - if (isDirectory) { - rmrf(cur); - return; - } - fs.unlinkSync(cur); - }); - fs.rmdirSync(location); - } catch (err) { - // Ignore error - } -} diff --git a/benchmark/misc/set-immediate-breadth-args.js b/benchmark/misc/set-immediate-breadth-args.js new file mode 100644 index 00000000000000..6a904e2675d110 --- /dev/null +++ b/benchmark/misc/set-immediate-breadth-args.js @@ -0,0 +1,28 @@ +'use strict'; + +const common = require('../common.js'); +const bench = common.createBenchmark(main, { + millions: [5] +}); + +function main(conf) { + const N = +conf.millions * 1e6; + + process.on('exit', function() { + bench.end(N / 1e6); + }); + + function cb1(arg1) {} + function cb2(arg1, arg2) {} + function cb3(arg1, arg2, arg3) {} + + bench.start(); + for (let i = 0; i < N; i++) { + if (i % 3 === 0) + setImmediate(cb3, 512, true, null); + else if (i % 2 === 0) + setImmediate(cb2, false, 5.1); + else + setImmediate(cb1, 0); + } +} diff --git a/benchmark/misc/set-immediate-breadth.js b/benchmark/misc/set-immediate-breadth.js new file mode 100644 index 00000000000000..3d8b038342634d --- /dev/null +++ b/benchmark/misc/set-immediate-breadth.js @@ -0,0 +1,21 @@ +'use strict'; + +const common = require('../common.js'); +const bench = common.createBenchmark(main, { + millions: [10] +}); + +function main(conf) { + const N = +conf.millions * 1e6; + + process.on('exit', function() { + bench.end(N / 1e6); + }); + + function cb() {} + + bench.start(); + for (let i = 0; i < N; i++) { + setImmediate(cb); + } +} diff --git a/benchmark/misc/set-immediate-depth-args.js b/benchmark/misc/set-immediate-depth-args.js new file mode 100644 index 00000000000000..1f12ae6ec73fc0 --- /dev/null +++ b/benchmark/misc/set-immediate-depth-args.js @@ -0,0 +1,47 @@ +'use strict'; + +const common = require('../common.js'); +const bench = common.createBenchmark(main, { + millions: [10] +}); + +function main(conf) { + const N = +conf.millions * 1e6; + + process.on('exit', function() { + bench.end(N / 1e6); + }); + + function cb3(n, arg2, arg3) { + if (--n) { + if (n % 3 === 0) + setImmediate(cb3, n, true, null); + else if (n % 2 === 0) + setImmediate(cb2, n, 5.1); + else + setImmediate(cb1, n); + } + } + function cb2(n, arg2) { + if (--n) { + if (n % 3 === 0) + setImmediate(cb3, n, true, null); + else if (n % 2 === 0) + setImmediate(cb2, n, 5.1); + else + setImmediate(cb1, n); + } + } + function cb1(n) { + if (--n) { + if (n % 3 === 0) + setImmediate(cb3, n, true, null); + else if (n % 2 === 0) + setImmediate(cb2, n, 5.1); + else + setImmediate(cb1, n); + } + } + bench.start(); + setImmediate(cb1, N); +} diff --git a/benchmark/misc/set-immediate-depth.js b/benchmark/misc/set-immediate-depth.js new file mode 100644 index 00000000000000..12b9cdc7e6fd65 --- /dev/null +++ b/benchmark/misc/set-immediate-depth.js @@ -0,0 +1,22 @@ +'use strict'; + +const common = require('../common.js'); +const bench = common.createBenchmark(main, { + millions: [10] +}); + +function main(conf) { + const N = +conf.millions * 1e6; + let n = N; + + process.on('exit', function() { + bench.end(N / 1e6); + }); + + bench.start(); + setImmediate(onNextTick); + function onNextTick() { + if (--n) + setImmediate(onNextTick); + } +} diff --git a/benchmark/misc/startup.js b/benchmark/misc/startup.js index aa5b4420f65903..34604911d250f3 100644 --- a/benchmark/misc/startup.js +++ b/benchmark/misc/startup.js @@ -1,10 +1,8 @@ +'use strict'; var common = require('../common.js'); var spawn = require('child_process').spawn; var path = require('path'); var emptyJsFile = path.resolve(__dirname, '../../test/fixtures/semicolon.js'); -var starts = 100; -var i = 0; -var start; var bench = common.createBenchmark(startNode, { dur: [1] @@ -14,7 +12,6 @@ function startNode(conf) { var dur = +conf.dur; var go = true; var starts = 0; - var open = 0; setTimeout(function() { go = false; diff --git a/benchmark/misc/string-creation.js b/benchmark/misc/string-creation.js index 74dabd66c02501..59fb1b52b4ec12 100644 --- a/benchmark/misc/string-creation.js +++ b/benchmark/misc/string-creation.js @@ -1,8 +1,9 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { millions: [100] -}) +}); function main(conf) { var n = +conf.millions * 1e6; @@ -10,7 +11,7 @@ function main(conf) { var s; for (var i = 0; i < n; i++) { s = '01234567890'; - s[1] = "a"; + s[1] = 'a'; } bench.end(n / 1e6); } diff --git a/benchmark/misc/timers.js b/benchmark/misc/timers.js deleted file mode 100644 index 23f571bb4528a1..00000000000000 --- a/benchmark/misc/timers.js +++ /dev/null @@ -1,40 +0,0 @@ -var common = require('../common.js'); - -var bench = common.createBenchmark(main, { - thousands: [500], - type: ['depth', 'breadth'] -}); - -function main(conf) { - var n = +conf.thousands * 1e3; - if (conf.type === 'breadth') - breadth(n); - else - depth(n); -} - -function depth(N) { - var n = 0; - bench.start(); - setTimeout(cb); - function cb() { - n++; - if (n === N) - bench.end(N / 1e3); - else - setTimeout(cb); - } -} - -function breadth(N) { - var n = 0; - bench.start(); - function cb() { - n++; - if (n === N) - bench.end(N / 1e3); - } - for (var i = 0; i < N; i++) { - setTimeout(cb); - } -} diff --git a/benchmark/misc/url.js b/benchmark/misc/url.js deleted file mode 100644 index 6c2799b6cb92b2..00000000000000 --- a/benchmark/misc/url.js +++ /dev/null @@ -1,40 +0,0 @@ -var url = require('url') -var n = 25 * 100; - -var urls = [ - 'http://nodejs.org/docs/latest/api/url.html#url_url_format_urlobj', - 'http://blog.nodejs.org/', - 'https://encrypted.google.com/search?q=url&q=site:npmjs.org&hl=en', - 'javascript:alert("node is awesome");', - 'some.ran/dom/url.thing?oh=yes#whoo' -]; - -var paths = [ - '../foo/bar?baz=boom', - 'foo/bar', - 'http://nodejs.org', - './foo/bar?baz' -]; - -benchmark('parse()', url.parse); -benchmark('format()', url.format); -paths.forEach(function(p) { - benchmark('resolve("' + p + '")', function(u) { - url.resolve(u, p) - }); -}); - -function benchmark(name, fun) { - var timestamp = process.hrtime(); - for (var i = 0; i < n; ++i) { - for (var j = 0, k = urls.length; j < k; ++j) fun(urls[j]); - } - timestamp = process.hrtime(timestamp); - - var seconds = timestamp[0]; - var nanos = timestamp[1]; - var time = seconds + nanos / 1e9; - var rate = n / time; - - console.log('misc/url.js %s: %s', name, rate.toPrecision(5)); -} diff --git a/benchmark/misc/v8-bench.js b/benchmark/misc/v8-bench.js index 0eb95aa9e2b2bc..0b9a5139ba23cf 100644 --- a/benchmark/misc/v8-bench.js +++ b/benchmark/misc/v8-bench.js @@ -1,4 +1,5 @@ // compare with "google-chrome deps/v8/benchmarks/run.html" +'use strict'; var fs = require('fs'); var path = require('path'); var vm = require('vm'); @@ -19,4 +20,4 @@ global.load = function(filename) { global.RegExp = $RegExp; }; -load('run.js'); +global.load('run.js'); diff --git a/benchmark/module/module-loader.js b/benchmark/module/module-loader.js new file mode 100644 index 00000000000000..a175533c7bbc6e --- /dev/null +++ b/benchmark/module/module-loader.js @@ -0,0 +1,71 @@ +'use strict'; +var fs = require('fs'); +var path = require('path'); +var common = require('../common.js'); + +var tmpDirectory = path.join(__dirname, '..', 'tmp'); +var benchmarkDirectory = path.join(tmpDirectory, 'nodejs-benchmark-module'); + +var bench = common.createBenchmark(main, { + thousands: [50], + fullPath: ['true', 'false'] +}); + +function main(conf) { + var n = +conf.thousands * 1e3; + + rmrf(tmpDirectory); + try { fs.mkdirSync(tmpDirectory); } catch (e) {} + try { fs.mkdirSync(benchmarkDirectory); } catch (e) {} + + for (var i = 0; i <= n; i++) { + fs.mkdirSync(benchmarkDirectory + i); + fs.writeFileSync( + benchmarkDirectory + i + '/package.json', + '{"main": "index.js"}' + ); + fs.writeFileSync( + benchmarkDirectory + i + '/index.js', + 'module.exports = "";' + ); + } + + if (conf.fullPath === 'true') + measureFull(n); + else + measureDir(n); +} + +function measureFull(n) { + bench.start(); + for (var i = 0; i <= n; i++) { + require(benchmarkDirectory + i + '/index.js'); + } + bench.end(n / 1e3); +} + +function measureDir(n) { + bench.start(); + for (var i = 0; i <= n; i++) { + require(benchmarkDirectory + i); + } + bench.end(n / 1e3); +} + +function rmrf(location) { + try { + var things = fs.readdirSync(location); + things.forEach(function(thing) { + var cur = path.join(location, thing), + isDirectory = fs.statSync(cur).isDirectory(); + if (isDirectory) { + rmrf(cur); + return; + } + fs.unlinkSync(cur); + }); + fs.rmdirSync(location); + } catch (err) { + // Ignore error + } +} diff --git a/benchmark/net/dgram.js b/benchmark/net/dgram.js deleted file mode 100644 index 6a0c5501c62c8e..00000000000000 --- a/benchmark/net/dgram.js +++ /dev/null @@ -1,61 +0,0 @@ -// test UDP send/recv throughput - -var common = require('../common.js'); -var PORT = common.PORT; - -// `num` is the number of send requests to queue up each time. -// Keep it reasonably high (>10) otherwise you're benchmarking the speed of -// event loop cycles more than anything else. -var bench = common.createBenchmark(main, { - len: [1, 64, 256, 1024], - num: [100], - type: ['send', 'recv'], - dur: [5] -}); - -var dur; -var len; -var num; -var type; -var chunk; -var encoding; - -function main(conf) { - dur = +conf.dur; - len = +conf.len; - num = +conf.num; - type = conf.type; - chunk = new Buffer(len); - server(); -} - -var dgram = require('dgram'); - -function server() { - var sent = 0; - var received = 0; - var socket = dgram.createSocket('udp4'); - - function onsend() { - if (sent++ % num == 0) - for (var i = 0; i < num; i++) - socket.send(chunk, 0, chunk.length, PORT, '127.0.0.1', onsend); - } - - socket.on('listening', function() { - bench.start(); - onsend(); - - setTimeout(function() { - var bytes = (type === 'send' ? sent : received) * chunk.length; - var gbits = (bytes * 8) / (1024 * 1024 * 1024); - bench.end(gbits); - }, dur * 1000); - }); - - socket.on('message', function(buf, rinfo) { - received++; - }); - - socket.bind(PORT); -} diff --git a/benchmark/net/net-c2s-cork.js b/benchmark/net/net-c2s-cork.js new file mode 100644 index 00000000000000..5d1c8a7495ead9 --- /dev/null +++ b/benchmark/net/net-c2s-cork.js @@ -0,0 +1,96 @@ +// test the speed of .pipe() with sockets +'use strict'; + +var common = require('../common.js'); +var PORT = common.PORT; + +var bench = common.createBenchmark(main, { + len: [4, 8, 16, 32, 64, 128, 512, 1024], + type: ['buf'], + dur: [5], +}); + +var dur; +var len; +var type; +var chunk; +var encoding; + +function main(conf) { + dur = +conf.dur; + len = +conf.len; + type = conf.type; + + switch (type) { + case 'buf': + chunk = new Buffer(len); + chunk.fill('x'); + break; + case 'utf': + encoding = 'utf8'; + chunk = new Array(len / 2 + 1).join('ü'); + break; + case 'asc': + encoding = 'ascii'; + chunk = new Array(len + 1).join('x'); + break; + default: + throw new Error('invalid type: ' + type); + } + + server(); +} + +var net = require('net'); + +function Writer() { + this.received = 0; + this.writable = true; +} + +Writer.prototype.write = function(chunk, encoding, cb) { + this.received += chunk.length; + + if (typeof encoding === 'function') + encoding(); + else if (typeof cb === 'function') + cb(); + + return true; +}; + +// doesn't matter, never emits anything. +Writer.prototype.on = function() {}; +Writer.prototype.once = function() {}; +Writer.prototype.emit = function() {}; + +function server() { + var writer = new Writer(); + + // the actual benchmark. + var server = net.createServer(function(socket) { + socket.pipe(writer); + }); + + server.listen(PORT, function() { + var socket = net.connect(PORT); + socket.on('connect', function() { + bench.start(); + + socket.on('drain', send); + send(); + + setTimeout(function() { + var bytes = writer.received; + var gbits = (bytes * 8) / (1024 * 1024 * 1024); + bench.end(gbits); + }, dur * 1000); + + function send() { + socket.cork(); + while (socket.write(chunk, encoding)) {} + socket.uncork(); + } + }); + }); +} diff --git a/benchmark/net/net-c2s.js b/benchmark/net/net-c2s.js index 49de7c77c9265c..370ff4f138cafd 100644 --- a/benchmark/net/net-c2s.js +++ b/benchmark/net/net-c2s.js @@ -1,4 +1,5 @@ // test the speed of .pipe() with sockets +'use strict'; var common = require('../common.js'); var PORT = common.PORT; @@ -35,7 +36,6 @@ function main(conf) { break; default: throw new Error('invalid type: ' + type); - break; } server(); diff --git a/benchmark/net/net-pipe.js b/benchmark/net/net-pipe.js index 2a5ed8e483659e..ea8af249a35b50 100644 --- a/benchmark/net/net-pipe.js +++ b/benchmark/net/net-pipe.js @@ -1,4 +1,5 @@ // test the speed of .pipe() with sockets +'use strict'; var common = require('../common.js'); var PORT = common.PORT; @@ -35,7 +36,6 @@ function main(conf) { break; default: throw new Error('invalid type: ' + type); - break; } server(); diff --git a/benchmark/net/net-s2c.js b/benchmark/net/net-s2c.js index 79e22494a7b8ed..af40d8d58d8852 100644 --- a/benchmark/net/net-s2c.js +++ b/benchmark/net/net-s2c.js @@ -1,4 +1,5 @@ // test the speed of .pipe() with sockets +'use strict'; var common = require('../common.js'); var PORT = common.PORT; @@ -35,7 +36,6 @@ function main(conf) { break; default: throw new Error('invalid type: ' + type); - break; } server(); diff --git a/benchmark/net/tcp-raw-c2s.js b/benchmark/net/tcp-raw-c2s.js index 0039313f5235ad..e13af85c6774dd 100644 --- a/benchmark/net/tcp-raw-c2s.js +++ b/benchmark/net/tcp-raw-c2s.js @@ -1,5 +1,6 @@ // In this benchmark, we connect a client to the server, and write // as many bytes as we can in the specified time (default = 10s) +'use strict'; var common = require('../common.js'); var util = require('util'); @@ -89,7 +90,6 @@ function client() { break; default: throw new Error('invalid type: ' + type); - break; } var clientHandle = new TCP(); diff --git a/benchmark/net/tcp-raw-pipe.js b/benchmark/net/tcp-raw-pipe.js index 1504d11db5fa53..c05c816855e7a6 100644 --- a/benchmark/net/tcp-raw-pipe.js +++ b/benchmark/net/tcp-raw-pipe.js @@ -1,5 +1,6 @@ // In this benchmark, we connect a client to the server, and write // as many bytes as we can in the specified time (default = 10s) +'use strict'; var common = require('../common.js'); var util = require('util'); @@ -87,7 +88,6 @@ function client() { break; default: throw new Error('invalid type: ' + type); - break; } var clientHandle = new TCP(); diff --git a/benchmark/net/tcp-raw-s2c.js b/benchmark/net/tcp-raw-s2c.js index 502586c2a05e29..822a74c679db12 100644 --- a/benchmark/net/tcp-raw-s2c.js +++ b/benchmark/net/tcp-raw-s2c.js @@ -1,5 +1,6 @@ // In this benchmark, we connect a client to the server, and write // as many bytes as we can in the specified time (default = 10s) +'use strict'; var common = require('../common.js'); var util = require('util'); @@ -61,7 +62,6 @@ function server() { break; default: throw new Error('invalid type: ' + type); - break; } clientHandle.readStart(); diff --git a/benchmark/path/basename-posix.js b/benchmark/path/basename-posix.js new file mode 100644 index 00000000000000..64da9017793440 --- /dev/null +++ b/benchmark/path/basename-posix.js @@ -0,0 +1,44 @@ +'use strict'; +var common = require('../common.js'); +var path = require('path'); +var v8 = require('v8'); + +var bench = common.createBenchmark(main, { + pathext: [ + '', + '/', + '/foo', + '/foo/.bar.baz', + ['/foo/.bar.baz', '.baz'].join('|'), + 'foo', + 'foo/bar.', + ['foo/bar.', '.'].join('|'), + '/foo/bar/baz/asdf/quux.html', + ['/foo/bar/baz/asdf/quux.html', '.html'].join('|') + ], + n: [1e6] +}); + +function main(conf) { + var n = +conf.n; + var p = path.posix; + var input = '' + conf.pathext; + var ext; + var extIdx = input.indexOf('|'); + if (extIdx !== -1) { + ext = input.slice(extIdx + 1); + input = input.slice(0, extIdx); + } + + // Force optimization before starting the benchmark + p.basename(input, ext); + v8.setFlagsFromString('--allow_natives_syntax'); + eval('%OptimizeFunctionOnNextCall(p.basename)'); + p.basename(input, ext); + + bench.start(); + for (var i = 0; i < n; i++) { + p.basename(input, ext); + } + bench.end(n); +} diff --git a/benchmark/path/basename-win32.js b/benchmark/path/basename-win32.js new file mode 100644 index 00000000000000..a6214598790033 --- /dev/null +++ b/benchmark/path/basename-win32.js @@ -0,0 +1,44 @@ +'use strict'; +var common = require('../common.js'); +var path = require('path'); +var v8 = require('v8'); + +var bench = common.createBenchmark(main, { + pathext: [ + '', + 'C:\\', + 'C:\\foo', + 'D:\\foo\\.bar.baz', + ['E:\\foo\\.bar.baz', '.baz'].join('|'), + 'foo', + 'foo\\bar.', + ['foo\\bar.', '.'].join('|'), + '\\foo\\bar\\baz\\asdf\\quux.html', + ['\\foo\\bar\\baz\\asdf\\quux.html', '.html'].join('|') + ], + n: [1e6] +}); + +function main(conf) { + var n = +conf.n; + var p = path.win32; + var input = '' + conf.pathext; + var ext; + var extIdx = input.indexOf('|'); + if (extIdx !== -1) { + ext = input.slice(extIdx + 1); + input = input.slice(0, extIdx); + } + + // Force optimization before starting the benchmark + p.basename(input, ext); + v8.setFlagsFromString('--allow_natives_syntax'); + eval('%OptimizeFunctionOnNextCall(p.basename)'); + p.basename(input, ext); + + bench.start(); + for (var i = 0; i < n; i++) { + p.basename(input, ext); + } + bench.end(n); +} diff --git a/benchmark/path/basename.js b/benchmark/path/basename.js deleted file mode 100644 index 57d9492746b32c..00000000000000 --- a/benchmark/path/basename.js +++ /dev/null @@ -1,26 +0,0 @@ -var common = require('../common.js'); -var path = require('path'); -var v8 = require('v8'); - -var bench = common.createBenchmark(main, { - type: ['win32', 'posix'], - n: [1e6], -}); - -function main(conf) { - var n = +conf.n; - var p = path[conf.type]; - - // Force optimization before starting the benchmark - p.basename('/foo/bar/baz/asdf/quux.html'); - v8.setFlagsFromString('--allow_natives_syntax'); - eval('%OptimizeFunctionOnNextCall(p.basename)'); - p.basename('/foo/bar/baz/asdf/quux.html'); - - bench.start(); - for (var i = 0; i < n; i++) { - p.basename('/foo/bar/baz/asdf/quux.html'); - p.basename('/foo/bar/baz/asdf/quux.html', '.html'); - } - bench.end(n); -} diff --git a/benchmark/path/dirname-posix.js b/benchmark/path/dirname-posix.js new file mode 100644 index 00000000000000..e7ea80ffa313c8 --- /dev/null +++ b/benchmark/path/dirname-posix.js @@ -0,0 +1,35 @@ +'use strict'; +var common = require('../common.js'); +var path = require('path'); +var v8 = require('v8'); + +var bench = common.createBenchmark(main, { + path: [ + '', + '/', + '/foo', + '/foo/bar', + 'foo', + 'foo/bar', + '/foo/bar/baz/asdf/quux' + ], + n: [1e6] +}); + +function main(conf) { + var n = +conf.n; + var p = path.posix; + var input = '' + conf.path; + + // Force optimization before starting the benchmark + p.dirname(input); + v8.setFlagsFromString('--allow_natives_syntax'); + eval('%OptimizeFunctionOnNextCall(p.dirname)'); + p.dirname(input); + + bench.start(); + for (var i = 0; i < n; i++) { + p.dirname(input); + } + bench.end(n); +} diff --git a/benchmark/path/dirname-win32.js b/benchmark/path/dirname-win32.js new file mode 100644 index 00000000000000..5cb0829437c2ed --- /dev/null +++ b/benchmark/path/dirname-win32.js @@ -0,0 +1,35 @@ +'use strict'; +var common = require('../common.js'); +var path = require('path'); +var v8 = require('v8'); + +var bench = common.createBenchmark(main, { + path: [ + '', + '\\', + '\\foo', + 'C:\\foo\\bar', + 'foo', + 'foo\\bar', + 'D:\\foo\\bar\\baz\\asdf\\quux' + ], + n: [1e6] +}); + +function main(conf) { + var n = +conf.n; + var p = path.win32; + var input = '' + conf.path; + + // Force optimization before starting the benchmark + p.dirname(input); + v8.setFlagsFromString('--allow_natives_syntax'); + eval('%OptimizeFunctionOnNextCall(p.dirname)'); + p.dirname(input); + + bench.start(); + for (var i = 0; i < n; i++) { + p.dirname(input); + } + bench.end(n); +} diff --git a/benchmark/path/dirname.js b/benchmark/path/dirname.js deleted file mode 100644 index e95adf28811a4e..00000000000000 --- a/benchmark/path/dirname.js +++ /dev/null @@ -1,25 +0,0 @@ -var common = require('../common.js'); -var path = require('path'); -var v8 = require('v8'); - -var bench = common.createBenchmark(main, { - type: ['win32', 'posix'], - n: [1e6], -}); - -function main(conf) { - var n = +conf.n; - var p = path[conf.type]; - - // Force optimization before starting the benchmark - p.dirname('/foo/bar/baz/asdf/quux'); - v8.setFlagsFromString('--allow_natives_syntax'); - eval('%OptimizeFunctionOnNextCall(p.dirname)'); - p.dirname('/foo/bar/baz/asdf/quux'); - - bench.start(); - for (var i = 0; i < n; i++) { - p.dirname('/foo/bar/baz/asdf/quux'); - } - bench.end(n); -} diff --git a/benchmark/path/extname-posix.js b/benchmark/path/extname-posix.js new file mode 100644 index 00000000000000..61a1073158f8d3 --- /dev/null +++ b/benchmark/path/extname-posix.js @@ -0,0 +1,38 @@ +'use strict'; +var common = require('../common.js'); +var path = require('path'); +var v8 = require('v8'); + +var bench = common.createBenchmark(main, { + path: [ + '', + '/', + '/foo', + 'foo/.bar.baz', + 'index.html', + 'index', + 'foo/bar/..baz.quux', + 'foo/bar/...baz.quux', + '/foo/bar/baz/asdf/quux', + '/foo/bar/baz/asdf/quux.foobarbazasdfquux' + ], + n: [1e6] +}); + +function main(conf) { + var n = +conf.n; + var p = path.posix; + var input = '' + conf.path; + + // Force optimization before starting the benchmark + p.extname(input); + v8.setFlagsFromString('--allow_natives_syntax'); + eval('%OptimizeFunctionOnNextCall(p.extname)'); + p.extname(input); + + bench.start(); + for (var i = 0; i < n; i++) { + p.extname(input); + } + bench.end(n); +} diff --git a/benchmark/path/extname-win32.js b/benchmark/path/extname-win32.js new file mode 100644 index 00000000000000..67e53eab85817f --- /dev/null +++ b/benchmark/path/extname-win32.js @@ -0,0 +1,38 @@ +'use strict'; +var common = require('../common.js'); +var path = require('path'); +var v8 = require('v8'); + +var bench = common.createBenchmark(main, { + path: [ + '', + '\\', + 'C:\\foo', + 'foo\\.bar.baz', + 'index.html', + 'index', + 'foo\\bar\\..baz.quux', + 'foo\\bar\\...baz.quux', + 'D:\\foo\\bar\\baz\\asdf\\quux', + '\\foo\\bar\\baz\\asdf\\quux.foobarbazasdfquux' + ], + n: [1e6] +}); + +function main(conf) { + var n = +conf.n; + var p = path.win32; + var input = '' + conf.path; + + // Force optimization before starting the benchmark + p.extname(input); + v8.setFlagsFromString('--allow_natives_syntax'); + eval('%OptimizeFunctionOnNextCall(p.extname)'); + p.extname(input); + + bench.start(); + for (var i = 0; i < n; i++) { + p.extname(input); + } + bench.end(n); +} diff --git a/benchmark/path/extname.js b/benchmark/path/extname.js deleted file mode 100644 index c655ee7e3e160a..00000000000000 --- a/benchmark/path/extname.js +++ /dev/null @@ -1,26 +0,0 @@ -var common = require('../common.js'); -var path = require('path'); -var v8 = require('v8'); - -var bench = common.createBenchmark(main, { - type: ['win32', 'posix'], - n: [1e6], -}); - -function main(conf) { - var n = +conf.n; - var p = path[conf.type]; - - // Force optimization before starting the benchmark - p.extname('index.html'); - v8.setFlagsFromString('--allow_natives_syntax'); - eval('%OptimizeFunctionOnNextCall(p.extname)'); - p.extname('index.html'); - - bench.start(); - for (var i = 0; i < n; i++) { - p.extname('index.html'); - p.extname('index'); - } - bench.end(n); -} diff --git a/benchmark/path/format-posix.js b/benchmark/path/format-posix.js new file mode 100644 index 00000000000000..b30b58be4118f0 --- /dev/null +++ b/benchmark/path/format-posix.js @@ -0,0 +1,36 @@ +'use strict'; +var common = require('../common.js'); +var path = require('path'); +var v8 = require('v8'); + +var bench = common.createBenchmark(main, { + props: [ + ['/', '/home/user/dir', 'index.html', '.html', 'index'].join('|') + ], + n: [1e7] +}); + +function main(conf) { + var n = +conf.n; + var p = path.posix; + var props = ('' + conf.props).split('|'); + var obj = { + root: props[0] || '', + dir: props[1] || '', + base: props[2] || '', + ext: props[3] || '', + name: props[4] || '', + }; + + // Force optimization before starting the benchmark + p.format(obj); + v8.setFlagsFromString('--allow_natives_syntax'); + eval('%OptimizeFunctionOnNextCall(p.format)'); + p.format(obj); + + bench.start(); + for (var i = 0; i < n; i++) { + p.format(obj); + } + bench.end(n); +} diff --git a/benchmark/path/format-win32.js b/benchmark/path/format-win32.js new file mode 100644 index 00000000000000..7404f2e93e6868 --- /dev/null +++ b/benchmark/path/format-win32.js @@ -0,0 +1,36 @@ +'use strict'; +var common = require('../common.js'); +var path = require('path'); +var v8 = require('v8'); + +var bench = common.createBenchmark(main, { + props: [ + ['C:\\', 'C:\\path\\dir', 'index.html', '.html', 'index'].join('|') + ], + n: [1e7] +}); + +function main(conf) { + var n = +conf.n; + var p = path.win32; + var props = ('' + conf.props).split('|'); + var obj = { + root: props[0] || '', + dir: props[1] || '', + base: props[2] || '', + ext: props[3] || '', + name: props[4] || '', + }; + + // Force optimization before starting the benchmark + p.format(obj); + v8.setFlagsFromString('--allow_natives_syntax'); + eval('%OptimizeFunctionOnNextCall(p.format)'); + p.format(obj); + + bench.start(); + for (var i = 0; i < n; i++) { + p.format(obj); + } + bench.end(n); +} diff --git a/benchmark/path/format.js b/benchmark/path/format.js deleted file mode 100644 index bc77f888116963..00000000000000 --- a/benchmark/path/format.js +++ /dev/null @@ -1,38 +0,0 @@ -var common = require('../common.js'); -var path = require('path'); -var v8 = require('v8'); - -var bench = common.createBenchmark(main, { - type: ['win32', 'posix'], - n: [1e7], -}); - -function main(conf) { - var n = +conf.n; - var p = path[conf.type]; - var test = conf.type === 'win32' ? { - root: 'C:\\', - dir: 'C:\\path\\dir', - base: 'index.html', - ext: '.html', - name: 'index' - } : { - root : '/', - dir : '/home/user/dir', - base : 'index.html', - ext : '.html', - name : 'index' - }; - - // Force optimization before starting the benchmark - p.format(test); - v8.setFlagsFromString('--allow_natives_syntax'); - eval('%OptimizeFunctionOnNextCall(p.format)'); - p.format(test); - - bench.start(); - for (var i = 0; i < n; i++) { - p.format(test); - } - bench.end(n); -} diff --git a/benchmark/path/isAbsolute-posix.js b/benchmark/path/isAbsolute-posix.js new file mode 100644 index 00000000000000..fb8956c073b9db --- /dev/null +++ b/benchmark/path/isAbsolute-posix.js @@ -0,0 +1,33 @@ +'use strict'; +var common = require('../common.js'); +var path = require('path'); +var v8 = require('v8'); + +var bench = common.createBenchmark(main, { + path: [ + '', + '.', + '/foo/bar', + '/baz/..', + 'bar/baz' + ], + n: [1e6] +}); + +function main(conf) { + var n = +conf.n; + var p = path.posix; + var input = '' + conf.path; + + // Force optimization before starting the benchmark + p.isAbsolute(input); + v8.setFlagsFromString('--allow_natives_syntax'); + eval('%OptimizeFunctionOnNextCall(p.isAbsolute)'); + p.isAbsolute(input); + + bench.start(); + for (var i = 0; i < n; i++) { + p.isAbsolute(input); + } + bench.end(n); +} diff --git a/benchmark/path/isAbsolute-win32.js b/benchmark/path/isAbsolute-win32.js new file mode 100644 index 00000000000000..57fb8b8999e838 --- /dev/null +++ b/benchmark/path/isAbsolute-win32.js @@ -0,0 +1,34 @@ +'use strict'; +var common = require('../common.js'); +var path = require('path'); +var v8 = require('v8'); + +var bench = common.createBenchmark(main, { + path: [ + '', + '.', + '//server', + 'C:\\baz\\..', + 'C:baz\\..', + 'bar\\baz' + ], + n: [1e6] +}); + +function main(conf) { + var n = +conf.n; + var p = path.win32; + var input = '' + conf.path; + + // Force optimization before starting the benchmark + p.isAbsolute(input); + v8.setFlagsFromString('--allow_natives_syntax'); + eval('%OptimizeFunctionOnNextCall(p.isAbsolute)'); + p.isAbsolute(input); + + bench.start(); + for (var i = 0; i < n; i++) { + p.isAbsolute(input); + } + bench.end(n); +} diff --git a/benchmark/path/isAbsolute.js b/benchmark/path/isAbsolute.js deleted file mode 100644 index d4c79b99cdbeb7..00000000000000 --- a/benchmark/path/isAbsolute.js +++ /dev/null @@ -1,34 +0,0 @@ -var common = require('../common.js'); -var path = require('path'); -var v8 = require('v8'); - -var bench = common.createBenchmark(main, { - type: ['win32', 'posix'], - n: [1e6], -}); - -function main(conf) { - var n = +conf.n; - var p = path[conf.type]; - var tests = conf.type === 'win32' - ? ['//server', 'C:\\baz\\..', 'bar\\baz', '.'] - : ['/foo/bar', '/baz/..', 'bar/baz', '.']; - - // Force optimization before starting the benchmark - p.isAbsolute(tests[0]); - v8.setFlagsFromString('--allow_natives_syntax'); - eval('%OptimizeFunctionOnNextCall(p.isAbsolute)'); - p.isAbsolute(tests[0]); - - bench.start(); - for (var i = 0; i < n; i++) { - runTests(p, tests); - } - bench.end(n); -} - -function runTests(p, tests) { - for (var i = 0; i < tests.length; i++) { - p.isAbsolute(tests[i]); - } -} diff --git a/benchmark/path/join-posix.js b/benchmark/path/join-posix.js new file mode 100644 index 00000000000000..1222f4050aa6ab --- /dev/null +++ b/benchmark/path/join-posix.js @@ -0,0 +1,29 @@ +'use strict'; +var common = require('../common.js'); +var path = require('path'); +var v8 = require('v8'); + +var bench = common.createBenchmark(main, { + paths: [ + ['/foo', 'bar', '', 'baz/asdf', 'quux', '..'].join('|') + ], + n: [1e6] +}); + +function main(conf) { + var n = +conf.n; + var p = path.posix; + var args = ('' + conf.paths).split('|'); + + // Force optimization before starting the benchmark + p.join.apply(null, args); + v8.setFlagsFromString('--allow_natives_syntax'); + eval('%OptimizeFunctionOnNextCall(p.join)'); + p.join.apply(null, args); + + bench.start(); + for (var i = 0; i < n; i++) { + p.join.apply(null, args); + } + bench.end(n); +} diff --git a/benchmark/path/join-win32.js b/benchmark/path/join-win32.js new file mode 100644 index 00000000000000..86801859d56c3b --- /dev/null +++ b/benchmark/path/join-win32.js @@ -0,0 +1,29 @@ +'use strict'; +var common = require('../common.js'); +var path = require('path'); +var v8 = require('v8'); + +var bench = common.createBenchmark(main, { + paths: [ + ['C:\\foo', 'bar', '', 'baz\\asdf', 'quux', '..'].join('|') + ], + n: [1e6] +}); + +function main(conf) { + var n = +conf.n; + var p = path.win32; + var args = ('' + conf.paths).split('|'); + + // Force optimization before starting the benchmark + p.join.apply(null, args); + v8.setFlagsFromString('--allow_natives_syntax'); + eval('%OptimizeFunctionOnNextCall(p.join)'); + p.join.apply(null, args); + + bench.start(); + for (var i = 0; i < n; i++) { + p.join.apply(null, args); + } + bench.end(n); +} diff --git a/benchmark/path/join.js b/benchmark/path/join.js deleted file mode 100644 index 58f4dc3e1e9e44..00000000000000 --- a/benchmark/path/join.js +++ /dev/null @@ -1,25 +0,0 @@ -var common = require('../common.js'); -var path = require('path'); -var v8 = require('v8'); - -var bench = common.createBenchmark(main, { - type: ['win32', 'posix'], - n: [1e6], -}); - -function main(conf) { - var n = +conf.n; - var p = path[conf.type]; - - // Force optimization before starting the benchmark - p.join('/foo', 'bar', '', 'baz/asdf', 'quux', '..'); - v8.setFlagsFromString('--allow_natives_syntax'); - eval('%OptimizeFunctionOnNextCall(p.join)'); - p.join('/foo', 'bar', '', 'baz/asdf', 'quux', '..'); - - bench.start(); - for (var i = 0; i < n; i++) { - p.join('/foo', 'bar', '', 'baz/asdf', 'quux', '..'); - } - bench.end(n); -} diff --git a/benchmark/path/makeLong-win32.js b/benchmark/path/makeLong-win32.js new file mode 100644 index 00000000000000..d4b29d7e709b3e --- /dev/null +++ b/benchmark/path/makeLong-win32.js @@ -0,0 +1,32 @@ +'use strict'; +var common = require('../common.js'); +var path = require('path'); +var v8 = require('v8'); + +var bench = common.createBenchmark(main, { + path: [ + 'foo\\bar', + 'C:\\foo', + '\\\\foo\\bar', + '\\\\?\\foo' + ], + n: [1e6] +}); + +function main(conf) { + var n = +conf.n; + var p = path.win32; + var input = '' + conf.path; + + // Force optimization before starting the benchmark + p._makeLong(input); + v8.setFlagsFromString('--allow_natives_syntax'); + eval('%OptimizeFunctionOnNextCall(p._makeLong)'); + p._makeLong(input); + + bench.start(); + for (var i = 0; i < n; i++) { + p._makeLong(input); + } + bench.end(n); +} diff --git a/benchmark/path/normalize-posix.js b/benchmark/path/normalize-posix.js new file mode 100644 index 00000000000000..19d6461ca51dcf --- /dev/null +++ b/benchmark/path/normalize-posix.js @@ -0,0 +1,34 @@ +'use strict'; +var common = require('../common.js'); +var path = require('path'); +var v8 = require('v8'); + +var bench = common.createBenchmark(main, { + path: [ + '', + '.', + '/../', + '/foo', + '/foo/bar', + '/foo/bar//baz/asdf/quux/..' + ], + n: [1e6] +}); + +function main(conf) { + var n = +conf.n; + var p = path.posix; + var input = '' + conf.path; + + // Force optimization before starting the benchmark + p.normalize(input); + v8.setFlagsFromString('--allow_natives_syntax'); + eval('%OptimizeFunctionOnNextCall(p.normalize)'); + p.normalize(input); + + bench.start(); + for (var i = 0; i < n; i++) { + p.normalize(input); + } + bench.end(n); +} diff --git a/benchmark/path/normalize-win32.js b/benchmark/path/normalize-win32.js new file mode 100644 index 00000000000000..119f9797681113 --- /dev/null +++ b/benchmark/path/normalize-win32.js @@ -0,0 +1,34 @@ +'use strict'; +var common = require('../common.js'); +var path = require('path'); +var v8 = require('v8'); + +var bench = common.createBenchmark(main, { + path: [ + '', + '.', + 'C:\\..\\', + 'C:\\foo', + 'C:\\foo\\bar', + 'C:\\foo\\bar\\\\baz\\asdf\\quux\\..' + ], + n: [1e6] +}); + +function main(conf) { + var n = +conf.n; + var p = path.win32; + var input = '' + conf.path; + + // Force optimization before starting the benchmark + p.normalize(input); + v8.setFlagsFromString('--allow_natives_syntax'); + eval('%OptimizeFunctionOnNextCall(p.normalize)'); + p.normalize(input); + + bench.start(); + for (var i = 0; i < n; i++) { + p.normalize(input); + } + bench.end(n); +} diff --git a/benchmark/path/normalize.js b/benchmark/path/normalize.js deleted file mode 100644 index 6f7f05e4f9e1c8..00000000000000 --- a/benchmark/path/normalize.js +++ /dev/null @@ -1,25 +0,0 @@ -var common = require('../common.js'); -var path = require('path'); -var v8 = require('v8'); - -var bench = common.createBenchmark(main, { - type: ['win32', 'posix'], - n: [1e6], -}); - -function main(conf) { - var n = +conf.n; - var p = path[conf.type]; - - // Force optimization before starting the benchmark - p.normalize('/foo/bar//baz/asdf/quux/..'); - v8.setFlagsFromString('--allow_natives_syntax'); - eval('%OptimizeFunctionOnNextCall(p.normalize)'); - p.normalize('/foo/bar//baz/asdf/quux/..'); - - bench.start(); - for (var i = 0; i < n; i++) { - p.normalize('/foo/bar//baz/asdf/quux/..'); - } - bench.end(n); -} diff --git a/benchmark/path/parse-posix.js b/benchmark/path/parse-posix.js new file mode 100644 index 00000000000000..ee4306fcd27496 --- /dev/null +++ b/benchmark/path/parse-posix.js @@ -0,0 +1,35 @@ +'use strict'; +var common = require('../common.js'); +var path = require('path'); +var v8 = require('v8'); + +var bench = common.createBenchmark(main, { + path: [ + '', + '/', + '/foo', + '/foo/bar.baz', + 'foo/.bar.baz', + 'foo/bar', + '/foo/bar/baz/asdf/.quux' + ], + n: [1e6] +}); + +function main(conf) { + var n = +conf.n; + var p = path.posix; + var input = '' + conf.path; + + // Force optimization before starting the benchmark + p.parse(input); + v8.setFlagsFromString('--allow_natives_syntax'); + eval('%OptimizeFunctionOnNextCall(p.parse)'); + p.parse(input); + + bench.start(); + for (var i = 0; i < n; i++) { + p.parse(input); + } + bench.end(n); +} diff --git a/benchmark/path/parse-win32.js b/benchmark/path/parse-win32.js new file mode 100644 index 00000000000000..5a7b80f0ddb3da --- /dev/null +++ b/benchmark/path/parse-win32.js @@ -0,0 +1,36 @@ +'use strict'; +var common = require('../common.js'); +var path = require('path'); +var v8 = require('v8'); + +var bench = common.createBenchmark(main, { + path: [ + '', + 'C:\\', + 'C:\\foo', + '\\foo', + 'E:\\foo\\bar.baz', + 'foo\\.bar.baz', + 'foo\\bar', + '\\foo\\bar\\baz\\asdf\\.quux' + ], + n: [1e6] +}); + +function main(conf) { + var n = +conf.n; + var p = path.win32; + var input = '' + conf.path; + + // Force optimization before starting the benchmark + p.parse(input); + v8.setFlagsFromString('--allow_natives_syntax'); + eval('%OptimizeFunctionOnNextCall(p.parse)'); + p.parse(input); + + bench.start(); + for (var i = 0; i < n; i++) { + p.parse(input); + } + bench.end(n); +} diff --git a/benchmark/path/parse.js b/benchmark/path/parse.js deleted file mode 100644 index f3fbb2a1f5c98f..00000000000000 --- a/benchmark/path/parse.js +++ /dev/null @@ -1,28 +0,0 @@ -var common = require('../common.js'); -var path = require('path'); -var v8 = require('v8'); - -var bench = common.createBenchmark(main, { - type: ['win32', 'posix'], - n: [1e6], -}); - -function main(conf) { - var n = +conf.n; - var p = path[conf.type]; - var test = conf.type === 'win32' - ? 'C:\\path\\dir\\index.html' - : '/home/user/dir/index.html'; - - // Force optimization before starting the benchmark - p.parse(test); - v8.setFlagsFromString('--allow_natives_syntax'); - eval('%OptimizeFunctionOnNextCall(p.parse)'); - p.parse(test); - - bench.start(); - for (var i = 0; i < n; i++) { - p.parse(test); - } - bench.end(n); -} diff --git a/benchmark/path/relative-posix.js b/benchmark/path/relative-posix.js new file mode 100644 index 00000000000000..7544fb2dc67e7d --- /dev/null +++ b/benchmark/path/relative-posix.js @@ -0,0 +1,41 @@ +'use strict'; +var common = require('../common.js'); +var path = require('path'); +var v8 = require('v8'); + +var bench = common.createBenchmark(main, { + paths: [ + ['/data/orandea/test/aaa', '/data/orandea/impl/bbb'].join('|'), + ['/', '/var'].join('|'), + ['/', '/'].join('|'), + ['/var', '/bin'].join('|'), + ['/foo/bar/baz/quux', '/'].join('|'), + ['/foo/bar/baz/quux', '/foo/bar/baz/quux'].join('|'), + ['/foo/bar/baz/quux', '/var/log'].join('|') + ], + n: [1e6] +}); + +function main(conf) { + var n = +conf.n; + var p = path.posix; + var from = '' + conf.paths; + var to = ''; + var delimIdx = from.indexOf('|'); + if (delimIdx > -1) { + to = from.slice(delimIdx + 1); + from = from.slice(0, delimIdx); + } + + // Force optimization before starting the benchmark + p.relative(from, to); + v8.setFlagsFromString('--allow_natives_syntax'); + eval('%OptimizeFunctionOnNextCall(p.relative)'); + p.relative(from, to); + + bench.start(); + for (var i = 0; i < n; i++) { + p.relative(from, to); + } + bench.end(n); +} diff --git a/benchmark/path/relative-win32.js b/benchmark/path/relative-win32.js new file mode 100644 index 00000000000000..92531959c1c3aa --- /dev/null +++ b/benchmark/path/relative-win32.js @@ -0,0 +1,39 @@ +'use strict'; +var common = require('../common.js'); +var path = require('path'); +var v8 = require('v8'); + +var bench = common.createBenchmark(main, { + paths: [ + ['C:\\orandea\\test\\aaa', 'C:\\orandea\\impl\\bbb'].join('|'), + ['C:\\', 'D:\\'].join('|'), + ['C:\\foo\\bar\\baz', 'C:\\foo\\bar\\baz'].join('|'), + ['C:\\foo\\BAR\\BAZ', 'C:\\foo\\bar\\baz'].join('|'), + ['C:\\foo\\bar\\baz\\quux', 'C:\\'].join('|') + ], + n: [1e6] +}); + +function main(conf) { + var n = +conf.n; + var p = path.win32; + var from = '' + conf.paths; + var to = ''; + var delimIdx = from.indexOf('|'); + if (delimIdx > -1) { + to = from.slice(delimIdx + 1); + from = from.slice(0, delimIdx); + } + + // Force optimization before starting the benchmark + p.relative(from, to); + v8.setFlagsFromString('--allow_natives_syntax'); + eval('%OptimizeFunctionOnNextCall(p.relative)'); + p.relative(from, to); + + bench.start(); + for (var i = 0; i < n; i++) { + p.relative(from, to); + } + bench.end(n); +} diff --git a/benchmark/path/relative.js b/benchmark/path/relative.js deleted file mode 100644 index d61c3961a62d8b..00000000000000 --- a/benchmark/path/relative.js +++ /dev/null @@ -1,33 +0,0 @@ -var common = require('../common.js'); -var path = require('path'); -var v8 = require('v8'); - -var bench = common.createBenchmark(main, { - type: ['win32', 'posix'], - n: [1e5], -}); - -function main(conf) { - var n = +conf.n; - var runTest = conf.type === 'win32' ? runWin32Test : runPosixTest; - - // Force optimization before starting the benchmark - runTest(); - v8.setFlagsFromString('--allow_natives_syntax'); - eval('%OptimizeFunctionOnNextCall(path[conf.type].relative)'); - runTest(); - - bench.start(); - for (var i = 0; i < n; i++) { - runTest(); - } - bench.end(n); -} - -function runWin32Test() { - path.win32.relative('C:\\orandea\\test\\aaa', 'C:\\orandea\\impl\\bbb'); -} - -function runPosixTest() { - path.posix.relative('/data/orandea/test/aaa', '/data/orandea/impl/bbb'); -} diff --git a/benchmark/path/resolve-posix.js b/benchmark/path/resolve-posix.js new file mode 100644 index 00000000000000..93e5b82191a23a --- /dev/null +++ b/benchmark/path/resolve-posix.js @@ -0,0 +1,32 @@ +'use strict'; +var common = require('../common.js'); +var path = require('path'); +var v8 = require('v8'); + +var bench = common.createBenchmark(main, { + paths: [ + '', + ['', ''].join('|'), + ['foo/bar', '/tmp/file/', '..', 'a/../subfile'].join('|'), + ['a/b/c/', '../../..'].join('|') + ], + n: [1e6] +}); + +function main(conf) { + var n = +conf.n; + var p = path.posix; + var args = ('' + conf.paths).split('|'); + + // Force optimization before starting the benchmark + p.resolve.apply(null, args); + v8.setFlagsFromString('--allow_natives_syntax'); + eval('%OptimizeFunctionOnNextCall(p.resolve)'); + p.resolve.apply(null, args); + + bench.start(); + for (var i = 0; i < n; i++) { + p.resolve.apply(null, args); + } + bench.end(n); +} diff --git a/benchmark/path/resolve-win32.js b/benchmark/path/resolve-win32.js new file mode 100644 index 00000000000000..dc0eb30e930049 --- /dev/null +++ b/benchmark/path/resolve-win32.js @@ -0,0 +1,32 @@ +'use strict'; +var common = require('../common.js'); +var path = require('path'); +var v8 = require('v8'); + +var bench = common.createBenchmark(main, { + paths: [ + '', + ['', ''].join('|'), + ['c:/ignore', 'd:\\a/b\\c/d', '\\e.exe'].join('|'), + ['c:/blah\\blah', 'd:/games', 'c:../a'].join('|') + ], + n: [1e6] +}); + +function main(conf) { + var n = +conf.n; + var p = path.win32; + var args = ('' + conf.paths).split('|'); + + // Force optimization before starting the benchmark + p.resolve.apply(null, args); + v8.setFlagsFromString('--allow_natives_syntax'); + eval('%OptimizeFunctionOnNextCall(p.resolve)'); + p.resolve.apply(null, args); + + bench.start(); + for (var i = 0; i < n; i++) { + p.resolve.apply(null, args); + } + bench.end(n); +} diff --git a/benchmark/path/resolve.js b/benchmark/path/resolve.js deleted file mode 100644 index 375e8b134ba0ea..00000000000000 --- a/benchmark/path/resolve.js +++ /dev/null @@ -1,25 +0,0 @@ -var common = require('../common.js'); -var path = require('path'); -var v8 = require('v8'); - -var bench = common.createBenchmark(main, { - type: ['win32', 'posix'], - n: [1e6], -}); - -function main(conf) { - var n = +conf.n; - var p = path[conf.type]; - - // Force optimization before starting the benchmark - p.resolve('foo/bar', '/tmp/file/', '..', 'a/../subfile'); - v8.setFlagsFromString('--allow_natives_syntax'); - eval('%OptimizeFunctionOnNextCall(p.resolve)'); - p.resolve('foo/bar', '/tmp/file/', '..', 'a/../subfile'); - - bench.start(); - for (var i = 0; i < n; i++) { - p.resolve('foo/bar', '/tmp/file/', '..', 'a/../subfile'); - } - bench.end(n); -} diff --git a/benchmark/process/bench-env.js b/benchmark/process/bench-env.js new file mode 100644 index 00000000000000..66f966f587bb7f --- /dev/null +++ b/benchmark/process/bench-env.js @@ -0,0 +1,18 @@ +'use strict'; + +const common = require('../common'); + +const bench = common.createBenchmark(main, { + n: [1e5], +}); + + +function main(conf) { + const n = conf.n >>> 0; + bench.start(); + for (var i = 0; i < n; i++) { + // Access every item in object to process values. + Object.keys(process.env); + } + bench.end(n); +} diff --git a/benchmark/process/bench-hrtime.js b/benchmark/process/bench-hrtime.js new file mode 100644 index 00000000000000..661dff43b0103c --- /dev/null +++ b/benchmark/process/bench-hrtime.js @@ -0,0 +1,18 @@ +'use strict'; + +const common = require('../common'); + +const bench = common.createBenchmark(main, { + n: [1e6] +}); + + +function main(conf) { + const n = conf.n >>> 0; + + bench.start(); + for (var i = 0; i < n; i++) { + process.hrtime(); + } + bench.end(n); +} diff --git a/benchmark/misc/next-tick-breadth-args.js b/benchmark/process/next-tick-breadth-args.js similarity index 100% rename from benchmark/misc/next-tick-breadth-args.js rename to benchmark/process/next-tick-breadth-args.js diff --git a/benchmark/misc/next-tick-breadth.js b/benchmark/process/next-tick-breadth.js similarity index 95% rename from benchmark/misc/next-tick-breadth.js rename to benchmark/process/next-tick-breadth.js index 652408144373f6..87d130f3a7e102 100644 --- a/benchmark/misc/next-tick-breadth.js +++ b/benchmark/process/next-tick-breadth.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { diff --git a/benchmark/misc/next-tick-depth-args.js b/benchmark/process/next-tick-depth-args.js similarity index 100% rename from benchmark/misc/next-tick-depth-args.js rename to benchmark/process/next-tick-depth-args.js diff --git a/benchmark/misc/next-tick-depth.js b/benchmark/process/next-tick-depth.js similarity index 96% rename from benchmark/misc/next-tick-depth.js rename to benchmark/process/next-tick-depth.js index 8a2c8e0a6ae148..bc513d338d6d8c 100644 --- a/benchmark/misc/next-tick-depth.js +++ b/benchmark/process/next-tick-depth.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { millions: [2] diff --git a/benchmark/querystring/querystring-parse.js b/benchmark/querystring/querystring-parse.js index 3d88bed07d63da..590b89f307c697 100644 --- a/benchmark/querystring/querystring-parse.js +++ b/benchmark/querystring/querystring-parse.js @@ -1,9 +1,16 @@ +'use strict'; var common = require('../common.js'); var querystring = require('querystring'); var v8 = require('v8'); var bench = common.createBenchmark(main, { - type: ['noencode', 'encodemany', 'encodelast'], + type: ['noencode', + 'multicharsep', + 'encodemany', + 'encodelast', + 'multivalue', + 'multivaluemany', + 'manypairs'], n: [1e6], }); @@ -13,21 +20,39 @@ function main(conf) { var inputs = { noencode: 'foo=bar&baz=quux&xyzzy=thud', + multicharsep: 'foo=bar&&&&&&&&&&baz=quux&&&&&&&&&&xyzzy=thud', encodemany: '%66%6F%6F=bar&%62%61%7A=quux&xyzzy=%74h%75d', - encodelast: 'foo=bar&baz=quux&xyzzy=thu%64' + encodelast: 'foo=bar&baz=quux&xyzzy=thu%64', + multivalue: 'foo=bar&foo=baz&foo=quux&quuy=quuz', + multivaluemany: 'foo=bar&foo=baz&foo=quux&quuy=quuz&foo=abc&foo=def&' + + 'foo=ghi&foo=jkl&foo=mno&foo=pqr&foo=stu&foo=vwxyz', + manypairs: 'a&b&c&d&e&f&g&h&i&j&k&l&m&n&o&p&q&r&s&t&u&v&w&x&y&z' }; var input = inputs[type]; // Force-optimize querystring.parse() so that the benchmark doesn't get // disrupted by the optimizer kicking in halfway through. - for (var name in inputs) - querystring.parse(inputs[name]); - v8.setFlagsFromString('--allow_natives_syntax'); - eval('%OptimizeFunctionOnNextCall(querystring.parse)'); - - bench.start(); - for (var i = 0; i < n; i += 1) + if (type !== 'multicharsep') { querystring.parse(input); - bench.end(n); + eval('%OptimizeFunctionOnNextCall(querystring.parse)'); + querystring.parse(input); + } else { + querystring.parse(input, '&&&&&&&&&&'); + eval('%OptimizeFunctionOnNextCall(querystring.parse)'); + querystring.parse(input, '&&&&&&&&&&'); + } + + var i; + if (type !== 'multicharsep') { + bench.start(); + for (i = 0; i < n; i += 1) + querystring.parse(input); + bench.end(n); + } else { + bench.start(); + for (i = 0; i < n; i += 1) + querystring.parse(input, '&&&&&&&&&&'); + bench.end(n); + } } diff --git a/benchmark/querystring/querystring-stringify.js b/benchmark/querystring/querystring-stringify.js index d4bb95c21e5af4..5870a690555a0a 100644 --- a/benchmark/querystring/querystring-stringify.js +++ b/benchmark/querystring/querystring-stringify.js @@ -1,10 +1,11 @@ +'use strict'; var common = require('../common.js'); var querystring = require('querystring'); var v8 = require('v8'); var bench = common.createBenchmark(main, { type: ['noencode', 'encodemany', 'encodelast'], - n: [1e6], + n: [1e7], }); function main(conf) { @@ -37,6 +38,7 @@ function main(conf) { v8.setFlagsFromString('--allow_natives_syntax'); eval('%OptimizeFunctionOnNextCall(querystring.stringify)'); + querystring.stringify(input); bench.start(); for (var i = 0; i < n; i += 1) diff --git a/benchmark/report-startup-memory.js b/benchmark/report-startup-memory.js index 14e56231ec2ddd..6d796307f4f437 100644 --- a/benchmark/report-startup-memory.js +++ b/benchmark/report-startup-memory.js @@ -1 +1,2 @@ +'use strict'; console.log(process.memoryUsage().rss); diff --git a/benchmark/static_http_server.js b/benchmark/static_http_server.js index b3a83785e3792f..43c493675933e7 100644 --- a/benchmark/static_http_server.js +++ b/benchmark/static_http_server.js @@ -1,17 +1,15 @@ +'use strict'; var http = require('http'); var concurrency = 30; var port = 12346; var n = 700; -var bytes = 1024*5; +var bytes = 1024 * 5; var requests = 0; var responses = 0; -var body = ''; -for (var i = 0; i < bytes; i++) { - body += 'C'; -} +var body = 'C'.repeat(bytes); var server = http.createServer(function(req, res) { res.writeHead(200, { @@ -19,7 +17,7 @@ var server = http.createServer(function(req, res) { 'Content-Length': body.length }); res.end(body); -}) +}); server.listen(port, function() { var agent = new http.Agent(); diff --git a/benchmark/misc/string-decoder.js b/benchmark/string_decoder/string-decoder.js similarity index 94% rename from benchmark/misc/string-decoder.js rename to benchmark/string_decoder/string-decoder.js index 14563cee0d7754..b10b0a6e9cbd48 100644 --- a/benchmark/misc/string-decoder.js +++ b/benchmark/string_decoder/string-decoder.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var StringDecoder = require('string_decoder').StringDecoder; @@ -21,6 +22,7 @@ function main(conf) { var chunks = []; var str = ''; var isBase64 = (encoding === 'base64-ascii' || encoding === 'base64-utf8'); + var i; if (encoding === 'ascii' || encoding === 'base64-ascii') alpha = ASC_ALPHA; @@ -31,7 +33,7 @@ function main(conf) { var sd = new StringDecoder(isBase64 ? 'base64' : encoding); - for (var i = 0; i < inLen; ++i) { + for (i = 0; i < inLen; ++i) { if (i > 0 && (i % chunkLen) === 0 && !isBase64) { chunks.push(new Buffer(str, encoding)); str = ''; @@ -52,7 +54,7 @@ function main(conf) { var nChunks = chunks.length; bench.start(); - for (var i = 0; i < n; ++i) { + for (i = 0; i < n; ++i) { for (var j = 0; j < nChunks; ++j) sd.write(chunks[j]); } diff --git a/benchmark/timers/timers.js b/benchmark/timers/timers.js new file mode 100644 index 00000000000000..13b18fffc5ead7 --- /dev/null +++ b/benchmark/timers/timers.js @@ -0,0 +1,41 @@ +'use strict'; +var common = require('../common.js'); + +var bench = common.createBenchmark(main, { + thousands: [500], + type: ['depth', 'breadth'] +}); + +function main(conf) { + var n = +conf.thousands * 1e3; + if (conf.type === 'breadth') + breadth(n); + else + depth(n); +} + +function depth(N) { + var n = 0; + bench.start(); + setTimeout(cb); + function cb() { + n++; + if (n === N) + bench.end(N / 1e3); + else + setTimeout(cb); + } +} + +function breadth(N) { + var n = 0; + bench.start(); + function cb() { + n++; + if (n === N) + bench.end(N / 1e3); + } + for (var i = 0; i < N; i++) { + setTimeout(cb); + } +} diff --git a/benchmark/tls/throughput.js b/benchmark/tls/throughput.js index 442eba338ed643..7b545267ace7fe 100644 --- a/benchmark/tls/throughput.js +++ b/benchmark/tls/throughput.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var bench = common.createBenchmark(main, { dur: [5], @@ -30,7 +31,7 @@ function main(conf) { encoding = 'ascii'; break; case 'utf': - chunk = new Array(size/2 + 1).join('ü'); + chunk = new Array(size / 2 + 1).join('ü'); encoding = 'utf8'; break; default: @@ -44,16 +45,16 @@ function main(conf) { server = tls.createServer(options, onConnection); setTimeout(done, dur * 1000); + var conn; server.listen(common.PORT, function() { var opt = { port: common.PORT, rejectUnauthorized: false }; - var conn = tls.connect(opt, function() { + conn = tls.connect(opt, function() { bench.start(); conn.on('drain', write); write(); }); function write() { - var i = 0; while (false !== conn.write(chunk, encoding)); } }); @@ -68,7 +69,8 @@ function main(conf) { function done() { var mbits = (received * 8) / (1024 * 1024); bench.end(mbits); - conn.destroy(); + if (conn) + conn.destroy(); server.close(); } } diff --git a/benchmark/tls/tls-connect.js b/benchmark/tls/tls-connect.js index 96c9c5ab275f9d..a265989e04db24 100644 --- a/benchmark/tls/tls-connect.js +++ b/benchmark/tls/tls-connect.js @@ -1,7 +1,7 @@ -var assert = require('assert'), - fs = require('fs'), - path = require('path'), - tls = require('tls'); +'use strict'; +var fs = require('fs'), + path = require('path'), + tls = require('tls'); var common = require('../common.js'); var bench = common.createBenchmark(main, { @@ -21,10 +21,10 @@ function main(conf) { concurrency = +conf.concurrency; var cert_dir = path.resolve(__dirname, '../../test/fixtures'), - options = { key: fs.readFileSync(cert_dir + '/test_key.pem'), - cert: fs.readFileSync(cert_dir + '/test_cert.pem'), - ca: [ fs.readFileSync(cert_dir + '/test_ca.pem') ], - ciphers: 'AES256-GCM-SHA384' }; + options = { key: fs.readFileSync(cert_dir + '/test_key.pem'), + cert: fs.readFileSync(cert_dir + '/test_cert.pem'), + ca: [ fs.readFileSync(cert_dir + '/test_ca.pem') ], + ciphers: 'AES256-GCM-SHA384' }; server = tls.createServer(options, onConnection); server.listen(common.PORT, onListening); diff --git a/benchmark/url/url-parse.js b/benchmark/url/url-parse.js index ffa47c4ccd6105..89679548b8f193 100644 --- a/benchmark/url/url-parse.js +++ b/benchmark/url/url-parse.js @@ -1,3 +1,4 @@ +'use strict'; var common = require('../common.js'); var url = require('url'); var v8 = require('v8'); diff --git a/benchmark/url/url-resolve.js b/benchmark/url/url-resolve.js index 5f6c1f7600ce4e..8372132e4d269e 100644 --- a/benchmark/url/url-resolve.js +++ b/benchmark/url/url-resolve.js @@ -1,31 +1,45 @@ +'use strict'; var common = require('../common.js'); var url = require('url'); var v8 = require('v8'); +var hrefs = [ + 'http://example.com/', + 'http://nodejs.org/docs/latest/api/url.html#url_url_format_urlobj', + 'http://blog.nodejs.org/', + 'https://encrypted.google.com/search?q=url&q=site:npmjs.org&hl=en', + 'javascript:alert("node is awesome");', + 'some.ran/dom/url.thing?oh=yes#whoo' +]; + + +var paths = [ + '../../../../../etc/passwd', + '../foo/bar?baz=boom', + 'foo/bar', + 'http://nodejs.org', + './foo/bar?baz' +]; + var bench = common.createBenchmark(main, { - type: ['one'], - n: [1e5], + href: Object.keys(hrefs), + path: Object.keys(paths), + n: [1e5] }); function main(conf) { - var type = conf.type; var n = conf.n | 0; - - var inputs = { - one: ['http://example.com/', '../../../../../etc/passwd'], - }; - var input = inputs[type] || []; + var href = hrefs[conf.href]; + var path = paths[conf.path]; // Force-optimize url.resolve() so that the benchmark doesn't get // disrupted by the optimizer kicking in halfway through. - for (var name in inputs) - url.resolve(inputs[name][0], inputs[name][1]); - + url.resolve(href, path); v8.setFlagsFromString('--allow_natives_syntax'); eval('%OptimizeFunctionOnNextCall(url.resolve)'); bench.start(); for (var i = 0; i < n; i += 1) - url.resolve(input[0], input[1]); + url.resolve(href, path); bench.end(n); } diff --git a/benchmark/util/format.js b/benchmark/util/format.js new file mode 100644 index 00000000000000..6a0b6c63dc1087 --- /dev/null +++ b/benchmark/util/format.js @@ -0,0 +1,40 @@ +'use strict'; + +const util = require('util'); +const common = require('../common'); +const v8 = require('v8'); +const bench = common.createBenchmark(main, { + n: [1e6] +, type: ['string', + 'number', + 'object', + 'unknown', + 'no-replace'] +}); + +const inputs = { + 'string': ['Hello, my name is %s', 'fred'], + 'number': ['Hi, I was born in %d', 1942], + 'object': ['An error occurred %j', {msg: 'This is an error', code: 'ERR'}], + 'unknown': ['hello %a', 'test'], + 'no-replace': [1, 2] +}; + +function main(conf) { + const n = conf.n | 0; + const type = conf.type; + + const input = inputs[type]; + + v8.setFlagsFromString('--allow_natives_syntax'); + + util.format(input[0], input[1]); + eval('%OptimizeFunctionOnNextCall(util.format)'); + util.format(input[0], input[1]); + + bench.start(); + for (var i = 0; i < n; i++) { + util.format(input[0], input[1]); + } + bench.end(n); +} diff --git a/benchmark/util/inspect.js b/benchmark/util/inspect.js new file mode 100644 index 00000000000000..3312bd683ba81b --- /dev/null +++ b/benchmark/util/inspect.js @@ -0,0 +1,16 @@ +'use strict'; +var util = require('util'); + +var common = require('../common.js'); + +var bench = common.createBenchmark(main, {n: [5e6]}); + +function main(conf) { + var n = conf.n | 0; + + bench.start(); + for (var i = 0; i < n; i += 1) { + util.inspect({a: 'a', b: 'b', c: 'c', d: 'd'}); + } + bench.end(n); +} diff --git a/common.gypi b/common.gypi index dc7f9b67577d03..ac06e55b181e67 100644 --- a/common.gypi +++ b/common.gypi @@ -14,6 +14,8 @@ 'node_tag%': '', 'uv_library%': 'static_library', + 'openssl_fips%': '', + # Default to -O0 for debug builds. 'v8_optimized_debug%': 0, @@ -68,6 +70,10 @@ 'cflags': [ '-gxcoff' ], 'ldflags': [ '-Wl,-bbigtoc' ], }], + ['OS == "android"', { + 'cflags': [ '-fPIE' ], + 'ldflags': [ '-fPIE', '-pie' ] + }] ], 'msvs_settings': { 'VCCLCompilerTool': { @@ -89,7 +95,7 @@ 'variables': { 'v8_enable_handle_zapping': 0, }, - 'cflags': [ '-O3', '-ffunction-sections', '-fdata-sections' ], + 'cflags': [ '-O3' ], 'conditions': [ ['target_arch=="x64"', { 'msvs_configuration_platform': 'x64', @@ -101,6 +107,10 @@ ['OS!="mac" and OS!="win"', { 'cflags': [ '-fno-omit-frame-pointer' ], }], + ['OS == "android"', { + 'cflags': [ '-fPIE' ], + 'ldflags': [ '-fPIE', '-pie' ] + }] ], 'msvs_settings': { 'VCCLCompilerTool': { @@ -183,7 +193,6 @@ '-fsanitize=address', '-DLEAK_SANITIZER' ], - 'cflags_cc+': [ '-gline-tables-only' ], 'cflags!': [ '-fomit-frame-pointer' ], 'ldflags': [ '-fsanitize=address' ], }], @@ -255,6 +264,14 @@ 'cflags': [ '-m64', '-mminimal-toc' ], 'ldflags': [ '-m64' ], }], + [ 'target_arch=="s390"', { + 'cflags': [ '-m31' ], + 'ldflags': [ '-m31' ], + }], + [ 'target_arch=="s390x"', { + 'cflags': [ '-m64' ], + 'ldflags': [ '-m64' ], + }], [ 'OS=="solaris"', { 'cflags': [ '-pthreads' ], 'ldflags': [ '-pthreads' ], diff --git a/configure b/configure index b4936f148a2b9c..e30fce5e21598b 100755 --- a/configure +++ b/configure @@ -28,9 +28,9 @@ parser = optparse.OptionParser() valid_os = ('win', 'mac', 'solaris', 'freebsd', 'openbsd', 'linux', 'android', 'aix') valid_arch = ('arm', 'arm64', 'ia32', 'mips', 'mipsel', 'ppc', 'ppc64', 'x32', - 'x64', 'x86') + 'x64', 'x86', 's390', 's390x') valid_arm_float_abi = ('soft', 'softfp', 'hard') -valid_arm_fpu = ('vfp', 'vfpv2', 'vfpv3', 'vfpv3-d16', 'neon') +valid_arm_fpu = ('vfp', 'vfpv3', 'vfpv3-d16', 'neon') valid_mips_arch = ('loongson', 'r1', 'r2', 'r6', 'rx') valid_mips_fpu = ('fp32', 'fp64', 'fpxx') valid_mips_float_abi = ('soft', 'hard') @@ -84,13 +84,28 @@ parser.add_option("--fully-static", action="store_true", dest="fully_static", help="Generate an executable without external dynamic libraries. This " - "will not work on OSX when using default compilation environment") + "will not work on OSX when using the default compilation environment") + +parser.add_option("--partly-static", + action="store_true", + dest="partly_static", + help="Generate an executable with libgcc and libstdc++ libraries. This " + "will not work on OSX when using the default compilation environment") + +parser.add_option("--enable-vtune-profiling", + action="store_true", + dest="enable_vtune_profiling", + help="Enable profiling support for Intel VTune profiler to profile" + "JavaScript code executed in nodejs. This feature is only available " + "for x32, x86 and x64 architectures.") + parser.add_option("--link-module", action="append", dest="linked_module", help="Path to a JS file to be bundled in the binary as a builtin." - "This module will be referenced by basename without extension." + "This module will be referenced by path without extension." + "e.g. /root/x/y.js will be referenced via require('root/x/y')." "Can be used multiple times") parser.add_option("--openssl-no-asm", @@ -189,12 +204,10 @@ shared_optgroup.add_option('--shared-zlib-libpath', parser.add_option_group(shared_optgroup) -# TODO document when we've decided on what the tracing API and its options will -# look like parser.add_option('--systemtap-includes', action='store', dest='systemtap_includes', - help=optparse.SUPPRESS_HELP) + help='directory containing systemtap header files') parser.add_option('--tag', action='store', @@ -360,6 +373,12 @@ parser.add_option('--enable-static', dest='enable_static', help='build as static library') +parser.add_option('--no-browser-globals', + action='store_true', + dest='no_browser_globals', + help='do not export browser globals like setTimeout, console, etc. ' + + '(This mode is not officially supported for regular applications)') + (options, args) = parser.parse_args() # Expand ~ in the install prefix now, it gets written to multiple files. @@ -428,7 +447,7 @@ def try_check_compiler(cc, lang): # Commands and regular expressions to obtain its version number are taken from # https://github.com/openssl/openssl/blob/OpenSSL_1_0_2-stable/crypto/sha/asm/sha512-x86_64.pl#L112-L129 # -def get_llvm_version(cc): +def get_version_helper(cc, regexp): try: proc = subprocess.Popen(shlex.split(cc) + ['-v'], stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE) @@ -441,14 +460,20 @@ def get_llvm_version(cc): ''' sys.exit() - match = re.search(r"(^clang version|based on LLVM) ([3-9]\.[0-9]+)", - proc.communicate()[1]) + match = re.search(regexp, proc.communicate()[1]) if match: return match.group(2) else: return 0 +def get_llvm_version(cc): + return get_version_helper( + cc, r"(^clang version|based on LLVM) ([3-9]\.[0-9]+)") + +def get_xcode_version(cc): + return get_version_helper( + cc, r"(^Apple LLVM version) ([5-9]\.[0-9]+)") def get_gas_version(cc): try: @@ -503,6 +528,8 @@ def check_compiler(o): if is_clang: o['variables']['llvm_version'] = get_llvm_version(CC) + if sys.platform == 'darwin': + o['variables']['xcode_version'] = get_xcode_version(CC) else: o['variables']['gas_version'] = get_gas_version(CC) @@ -542,18 +569,13 @@ def cc_macros(cc=None): def is_arch_armv7(): """Check for ARMv7 instructions""" cc_macros_cache = cc_macros() - return ('__ARM_ARCH_7__' in cc_macros_cache or - '__ARM_ARCH_7A__' in cc_macros_cache or - '__ARM_ARCH_7R__' in cc_macros_cache or - '__ARM_ARCH_7M__' in cc_macros_cache or - '__ARM_ARCH_7S__' in cc_macros_cache) + return cc_macros_cache.get('__ARM_ARCH') == '7' def is_arch_armv6(): """Check for ARMv6 instructions""" cc_macros_cache = cc_macros() - return ('__ARM_ARCH_6__' in cc_macros_cache or - '__ARM_ARCH_6M__' in cc_macros_cache) + return cc_macros_cache.get('__ARM_ARCH') == '6' def is_arm_hard_float_abi(): @@ -574,7 +596,7 @@ def host_arch_cc(): # would be xlc so hard code gcc k = cc_macros('gcc') else: - k = cc_macros() + k = cc_macros(os.environ.get('CC_host')) matchup = { '__aarch64__' : 'arm64', @@ -585,6 +607,8 @@ def host_arch_cc(): '__PPC64__' : 'ppc64', '__PPC__' : 'ppc', '__x86_64__' : 'x64', + '__s390__' : 's390', + '__s390x__' : 's390x', } rtn = 'ia32' # default @@ -592,7 +616,8 @@ def host_arch_cc(): for i in matchup: if i in k and k[i] != '0': rtn = matchup[i] - break + if rtn != 's390': + break return rtn @@ -621,7 +646,7 @@ def configure_arm(o): else: arm_float_abi = 'default' - arm_fpu = 'vfpv2' + arm_fpu = 'vfp' if is_arch_armv7(): arm_fpu = 'vfpv3' @@ -674,6 +699,19 @@ def configure_node(o): elif target_arch in ('mips', 'mipsel'): configure_mips(o) + if flavor == 'aix': + o['variables']['node_core_target_name'] = 'node_base' + o['variables']['node_target_type'] = 'static_library' + + if target_arch in ('x86', 'x64', 'ia32', 'x32'): + o['variables']['node_enable_v8_vtunejit'] = b(options.enable_vtune_profiling) + elif options.enable_vtune_profiling: + raise Exception( + 'The VTune profiler for JavaScript is only supported on x32, x86 and x64 ' + 'architectures.') + else: + o['variables']['node_enable_v8_vtunejit'] = 'false' + if flavor in ('solaris', 'mac', 'linux', 'freebsd'): use_dtrace = not options.without_dtrace # Don't enable by default on linux and freebsd @@ -733,6 +771,8 @@ def configure_node(o): if options.enable_static: o['variables']['node_target_type'] = 'static_library' + o['variables']['node_no_browser_globals'] = b(options.no_browser_globals) + if options.linked_module: o['variables']['library_files'] = options.linked_module @@ -748,11 +788,15 @@ def configure_library(lib, output): if pkg_cflags: output['include_dirs'] += ( filter(None, map(str.strip, pkg_cflags.split('-I')))) + elif options.__dict__[shared_lib + '_includes']: + output['include_dirs'] += [options.__dict__[shared_lib + '_includes']] # libpath needs to be provided ahead libraries if pkg_libpath: - output['libraries'] += ( - filter(None, map(str.strip, pkg_cflags.split('-L')))) + output['libraries'] += [pkg_libpath] + elif options.__dict__[shared_lib + '_libpath']: + output['libraries'] += [ + '-L%s' % options.__dict__[shared_lib + '_libpath']] default_libs = getattr(options, shared_lib + '_libname') default_libs = map('-l{0}'.format, default_libs.split(',')) @@ -768,7 +812,7 @@ def configure_v8(o): 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_random_seed'] = 0 # Use a random seed for hash tables. - o['variables']['v8_use_snapshot'] = 0 if options.without_snapshot else 1 + o['variables']['v8_use_snapshot'] = 'false' if options.without_snapshot else 'true' def configure_openssl(o): o['variables']['node_use_openssl'] = b(not options.without_ssl) @@ -778,7 +822,7 @@ def configure_openssl(o): o['variables']['openssl_fips'] = options.openssl_fips fips_dir = os.path.join(root_dir, 'deps', 'openssl', 'fips') fips_ld = os.path.abspath(os.path.join(fips_dir, 'fipsld')) - o['make_global_settings'] = [ + o['make_fips_settings'] = [ ['LINK', fips_ld + ' <(openssl_fips)/bin/fipsld'], ] else: @@ -790,28 +834,20 @@ def configure_openssl(o): configure_library('openssl', o) -def configure_fullystatic(o): - if options.fully_static: - o['libraries'] += ['-static'] +def configure_static(o): + if options.fully_static or options.partly_static: if flavor == 'mac': print("Generation of static executable will not work on OSX " - "when using default compilation environment") + "when using the default compilation environment") + return + if options.fully_static: + o['libraries'] += ['-static'] + elif options.partly_static: + o['libraries'] += ['-static-libgcc', '-static-libstdc++'] + if options.enable_asan: + o['libraries'] += ['-static-libasan'] -def configure_winsdk(o): - if flavor != 'win': - return - - winsdk_dir = os.environ.get('WindowsSdkDir') - - if winsdk_dir and os.path.isfile(winsdk_dir + '\\bin\\ctrpp.exe'): - print('Found ctrpp in WinSDK--will build generated files ' - 'into tools/msvs/genfiles.') - o['variables']['node_has_winsdk'] = 'true' - return - - print('ctrpp not found in WinSDK path--using pre-gen files ' - 'from tools/msvs/genfiles.') def write(filename, data): filename = os.path.join(root_dir, filename) @@ -1016,7 +1052,7 @@ def configure_intl(o): if not icu_ver_major: print ' Could not read U_ICU_VERSION_SHORT version from %s' % uvernum_h sys.exit(1) - icu_endianness = sys.byteorder[0]; # TODO(srl295): EBCDIC should be 'e' + icu_endianness = sys.byteorder[0]; o['variables']['icu_ver_major'] = icu_ver_major o['variables']['icu_endianness'] = icu_endianness icu_data_file_l = 'icudt%s%s.dat' % (icu_ver_major, 'l') @@ -1068,7 +1104,7 @@ def configure_intl(o): return # end of configure_intl output = { - 'variables': { 'python': sys.executable }, + 'variables': {}, 'include_dirs': [], 'libraries': [], 'defines': [], @@ -1091,15 +1127,23 @@ configure_library('http_parser', output) configure_library('libuv', output) configure_v8(output) configure_openssl(output) -configure_winsdk(output) configure_intl(output) -configure_fullystatic(output) +configure_static(output) # variables should be a root level element, # move everything else to target_defaults variables = output['variables'] del output['variables'] +# make_global_settings for special FIPS linking +# should not be used to compile modules in node-gyp +config_fips = { 'make_global_settings' : [] } +if 'make_fips_settings' in output: + config_fips['make_global_settings'] = output['make_fips_settings'] + del output['make_fips_settings'] + write('config_fips.gypi', do_not_edit + + pprint.pformat(config_fips, indent=2) + '\n') + # make_global_settings should be a root level element too if 'make_global_settings' in output: make_global_settings = output['make_global_settings'] diff --git a/deps/cares/include/ares.h b/deps/cares/include/ares.h index f9abe854d5846a..fcbcecfc49371b 100644 --- a/deps/cares/include/ares.h +++ b/deps/cares/include/ares.h @@ -19,6 +19,8 @@ #define ARES__H #include "ares_version.h" /* c-ares version defines */ +#include "ares_build.h" /* c-ares build definitions */ +#include "ares_rules.h" /* c-ares rules enforcement */ /* * Define WIN32 when build target is Win32 API @@ -29,9 +31,6 @@ # define WIN32 #endif -/* Data type definition of ares_socklen_t. */ -typedef unsigned ares_socklen_t; - #include /* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish @@ -297,6 +296,13 @@ typedef int (*ares_sock_create_callback)(ares_socket_t socket_fd, CARES_EXTERN int ares_library_init(int flags); +CARES_EXTERN int ares_library_init_mem(int flags, + void *(*amalloc)(size_t size), + void (*afree)(void *ptr), + void *(*arealloc)(void *ptr, size_t size)); + +CARES_EXTERN int ares_library_initialized(void); + CARES_EXTERN void ares_library_cleanup(void); CARES_EXTERN const char *ares_version(int *version); @@ -338,6 +344,9 @@ CARES_EXTERN void ares_set_socket_callback(ares_channel channel, ares_sock_create_callback callback, void *user_data); +CARES_EXTERN int ares_set_sortlist(ares_channel channel, + const char *sortstr); + CARES_EXTERN void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen, @@ -473,8 +482,17 @@ struct ares_txt_reply { struct ares_txt_reply *next; unsigned char *txt; size_t length; /* length excludes null termination */ - unsigned char record_start; /* 1 - if start of new record - * 0 - if a chunk in the same record */ +}; + +/* NOTE: This structure is a superset of ares_txt_reply + */ +struct ares_txt_ext { + struct ares_txt_ext *next; + unsigned char *txt; + size_t length; + /* 1 - if start of new record + * 0 - if a chunk in the same record */ + unsigned char record_start; }; struct ares_naptr_reply { @@ -540,6 +558,10 @@ CARES_EXTERN int ares_parse_txt_reply(const unsigned char* abuf, int alen, struct ares_txt_reply** txt_out); +CARES_EXTERN int ares_parse_txt_reply_ext(const unsigned char* abuf, + int alen, + struct ares_txt_ext** txt_out); + CARES_EXTERN int ares_parse_naptr_reply(const unsigned char* abuf, int alen, struct ares_naptr_reply** naptr_out); @@ -556,7 +578,6 @@ CARES_EXTERN void ares_free_data(void *dataptr); CARES_EXTERN const char *ares_strerror(int code); -/* TODO: Hold port here as well. */ struct ares_addr_node { struct ares_addr_node *next; int family; @@ -566,15 +587,32 @@ struct ares_addr_node { } addr; }; +struct ares_addr_port_node { + struct ares_addr_port_node *next; + int family; + union { + struct in_addr addr4; + struct ares_in6_addr addr6; + } addr; + int udp_port; + int tcp_port; +}; + CARES_EXTERN int ares_set_servers(ares_channel channel, struct ares_addr_node *servers); +CARES_EXTERN int ares_set_servers_ports(ares_channel channel, + struct ares_addr_port_node *servers); /* Incomming string format: host[:port][,host[:port]]... */ CARES_EXTERN int ares_set_servers_csv(ares_channel channel, const char* servers); +CARES_EXTERN int ares_set_servers_ports_csv(ares_channel channel, + const char* servers); CARES_EXTERN int ares_get_servers(ares_channel channel, struct ares_addr_node **servers); +CARES_EXTERN int ares_get_servers_ports(ares_channel channel, + struct ares_addr_port_node **servers); CARES_EXTERN const char *ares_inet_ntop(int af, const void *src, char *dst, ares_socklen_t size); diff --git a/deps/cares/include/ares_build.h b/deps/cares/include/ares_build.h new file mode 100644 index 00000000000000..199eae8b8e9978 --- /dev/null +++ b/deps/cares/include/ares_build.h @@ -0,0 +1,117 @@ +/* ares_build.h. Generated from ares_build.h.in by configure. */ +#ifndef __CARES_BUILD_H +#define __CARES_BUILD_H + + +/* Copyright (C) 2009 by Daniel Stenberg et al + * + * 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. + */ + +/* ================================================================ */ +/* NOTES FOR CONFIGURE CAPABLE SYSTEMS */ +/* ================================================================ */ + +/* + * NOTE 1: + * ------- + * + * Nothing in this file is intended to be modified or adjusted by the + * c-ares library user nor by the c-ares library builder. + * + * If you think that something actually needs to be changed, adjusted + * or fixed in this file, then, report it on the c-ares development + * mailing list: http://cool.haxx.se/mailman/listinfo/c-ares/ + * + * This header file shall only export symbols which are 'cares' or 'CARES' + * prefixed, otherwise public name space would be polluted. + * + * NOTE 2: + * ------- + * + * Right now you might be staring at file ares_build.h.in or ares_build.h, + * this is due to the following reason: + * + * On systems capable of running the configure script, the configure process + * will overwrite the distributed ares_build.h file with one that is suitable + * and specific to the library being configured and built, which is generated + * from the ares_build.h.in template file. + * + */ + +/* ================================================================ */ +/* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */ +/* ================================================================ */ + +#ifdef CARES_SIZEOF_LONG +# error "CARES_SIZEOF_LONG shall not be defined except in ares_build.h" + Error Compilation_aborted_CARES_SIZEOF_LONG_already_defined +#endif + +#ifdef CARES_TYPEOF_ARES_SOCKLEN_T +# error "CARES_TYPEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h" + Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_already_defined +#endif + +#ifdef CARES_SIZEOF_ARES_SOCKLEN_T +# error "CARES_SIZEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h" + Error Compilation_aborted_CARES_SIZEOF_ARES_SOCKLEN_T_already_defined +#endif + +/* ================================================================ */ +/* EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY */ +/* ================================================================ */ + +/* Configure process defines this to 1 when it finds out that system */ +/* header file ws2tcpip.h must be included by the external interface. */ + +#ifdef WIN32 +# define CARES_PULL_WS2TCPIP_H 1 +#else +# define CARES_PULL_SYS_TYPES_H 1 +# define CARES_PULL_SYS_SOCKET_H 1 +#endif + +/* #undef CARES_PULL_WS2TCPIP_H */ +#ifdef CARES_PULL_WS2TCPIP_H +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif +# include +# include +# include +#endif + +/* Configure process defines this to 1 when it finds out that system */ +/* header file sys/types.h must be included by the external interface. */ +#ifdef CARES_PULL_SYS_TYPES_H +# include +#endif + +/* Configure process defines this to 1 when it finds out that system */ +/* header file sys/socket.h must be included by the external interface. */ +#ifdef CARES_PULL_SYS_SOCKET_H +# include +#endif + +/* The size of `long', as computed by sizeof. */ +/* #undef CARES_SIZEOF_LONG */ + +/* Integral data type used for ares_socklen_t. */ +#define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t + +/* The size of `ares_socklen_t', as computed by sizeof. */ +#define CARES_SIZEOF_ARES_SOCKLEN_T 4 + +/* Data type definition of ares_socklen_t. */ +typedef CARES_TYPEOF_ARES_SOCKLEN_T ares_socklen_t; + +#endif /* __CARES_BUILD_H */ diff --git a/deps/cares/src/ares_rules.h b/deps/cares/include/ares_rules.h similarity index 100% rename from deps/cares/src/ares_rules.h rename to deps/cares/include/ares_rules.h diff --git a/deps/cares/src/ares__close_sockets.c b/deps/cares/src/ares__close_sockets.c index d3d85ff183c7d1..6c66483b03579a 100644 --- a/deps/cares/src/ares__close_sockets.c +++ b/deps/cares/src/ares__close_sockets.c @@ -30,14 +30,14 @@ void ares__close_sockets(ares_channel channel, struct server_state *server) sendreq = server->qhead; server->qhead = sendreq->next; if (sendreq->data_storage != NULL) - free(sendreq->data_storage); - free(sendreq); + ares_free(sendreq->data_storage); + ares_free(sendreq); } server->qtail = NULL; /* Reset any existing input buffer. */ if (server->tcp_buffer) - free(server->tcp_buffer); + ares_free(server->tcp_buffer); server->tcp_buffer = NULL; server->tcp_lenbuf_pos = 0; diff --git a/deps/cares/src/ares__get_hostent.c b/deps/cares/src/ares__get_hostent.c index 4497d60d0d9f0a..d2f95034934708 100644 --- a/deps/cares/src/ares__get_hostent.c +++ b/deps/cares/src/ares__get_hostent.c @@ -94,7 +94,7 @@ int ares__get_hostent(FILE *fp, int family, struct hostent **host) p++; if (!*p) /* Ignore line if reached end of line. */ - continue; + continue; /* LCOV_EXCL_LINE: trailing whitespace already stripped */ /* Pointer to start of host name. */ txthost = p; @@ -164,7 +164,7 @@ int ares__get_hostent(FILE *fp, int family, struct hostent **host) */ /* Allocate memory for the hostent structure. */ - hostent = malloc(sizeof(struct hostent)); + hostent = ares_malloc(sizeof(struct hostent)); if (!hostent) break; @@ -173,16 +173,16 @@ int ares__get_hostent(FILE *fp, int family, struct hostent **host) hostent->h_addr_list = NULL; /* Copy official host name. */ - hostent->h_name = strdup(txthost); + hostent->h_name = ares_strdup(txthost); if (!hostent->h_name) break; /* Copy network address. */ - hostent->h_addr_list = malloc(2 * sizeof(char *)); + hostent->h_addr_list = ares_malloc(2 * sizeof(char *)); if (!hostent->h_addr_list) break; hostent->h_addr_list[1] = NULL; - hostent->h_addr_list[0] = malloc(addrlen); + hostent->h_addr_list[0] = ares_malloc(addrlen); if (!hostent->h_addr_list[0]) break; if (addr.family == AF_INET) @@ -191,7 +191,7 @@ int ares__get_hostent(FILE *fp, int family, struct hostent **host) memcpy(hostent->h_addr_list[0], &addr.addrV6, sizeof(addr.addrV6)); /* Copy aliases. */ - hostent->h_aliases = malloc((naliases + 1) * sizeof(char *)); + hostent->h_aliases = ares_malloc((naliases + 1) * sizeof(char *)); if (!hostent->h_aliases) break; alias = hostent->h_aliases; @@ -207,7 +207,7 @@ int ares__get_hostent(FILE *fp, int family, struct hostent **host) while (*q && ISSPACE(*q)) q++; *p = '\0'; - if ((*alias = strdup(txtalias)) == NULL) + if ((*alias = ares_strdup(txtalias)) == NULL) break; alias++; txtalias = *q ? q : NULL; @@ -221,7 +221,7 @@ int ares__get_hostent(FILE *fp, int family, struct hostent **host) hostent->h_length = aresx_uztoss(addrlen); /* Free line buffer. */ - free(line); + ares_free(line); /* Return hostent successfully */ *host = hostent; @@ -231,7 +231,7 @@ int ares__get_hostent(FILE *fp, int family, struct hostent **host) /* If allocated, free line buffer. */ if (line) - free(line); + ares_free(line); if (status == ARES_SUCCESS) { @@ -239,20 +239,20 @@ int ares__get_hostent(FILE *fp, int family, struct hostent **host) if (hostent) { if (hostent->h_name) - free((char *) hostent->h_name); + ares_free((char *) hostent->h_name); if (hostent->h_aliases) { for (alias = hostent->h_aliases; *alias; alias++) - free(*alias); - free(hostent->h_aliases); + ares_free(*alias); + ares_free(hostent->h_aliases); } if (hostent->h_addr_list) { if (hostent->h_addr_list[0]) - free(hostent->h_addr_list[0]); - free(hostent->h_addr_list); + ares_free(hostent->h_addr_list[0]); + ares_free(hostent->h_addr_list); } - free(hostent); + ares_free(hostent); } return ARES_ENOMEM; } diff --git a/deps/cares/src/ares__read_line.c b/deps/cares/src/ares__read_line.c index 6ebd42fe6efb34..c62ad2a2b41f2c 100644 --- a/deps/cares/src/ares__read_line.c +++ b/deps/cares/src/ares__read_line.c @@ -36,7 +36,7 @@ int ares__read_line(FILE *fp, char **buf, size_t *bufsize) if (*buf == NULL) { - *buf = malloc(128); + *buf = ares_malloc(128); if (!*buf) return ARES_ENOMEM; *bufsize = 128; @@ -59,10 +59,11 @@ int ares__read_line(FILE *fp, char **buf, size_t *bufsize) continue; /* Allocate more space. */ - newbuf = realloc(*buf, *bufsize * 2); + newbuf = ares_realloc(*buf, *bufsize * 2); if (!newbuf) { - free(*buf); + ares_free(*buf); + *buf = NULL; return ARES_ENOMEM; } *buf = newbuf; diff --git a/deps/cares/src/ares__timeval.c b/deps/cares/src/ares__timeval.c index f7aa7883f93572..94efb7db1e92ae 100644 --- a/deps/cares/src/ares__timeval.c +++ b/deps/cares/src/ares__timeval.c @@ -56,7 +56,7 @@ struct timeval ares__tvnow(void) */ #ifdef HAVE_GETTIMEOFDAY else - (void)gettimeofday(&now, NULL); + (void)gettimeofday(&now, NULL); /* LCOV_EXCL_LINE */ #else else { now.tv_sec = (long)time(NULL); diff --git a/deps/cares/src/ares_create_query.c b/deps/cares/src/ares_create_query.c index 8624e2f589bbb3..a34dda7de6de6d 100644 --- a/deps/cares/src/ares_create_query.c +++ b/deps/cares/src/ares_create_query.c @@ -130,7 +130,7 @@ int ares_create_query(const char *name, int dnsclass, int type, return ARES_EBADNAME; *buflen = len + HFIXEDSZ + QFIXEDSZ + (max_udp_size ? EDNSFIXEDSZ : 0); - *buf = malloc(*buflen); + *buf = ares_malloc(*buflen); if (!*buf) return ARES_ENOMEM; diff --git a/deps/cares/src/ares_data.c b/deps/cares/src/ares_data.c index b86ca90c2b7064..f89111381511a0 100644 --- a/deps/cares/src/ares_data.c +++ b/deps/cares/src/ares_data.c @@ -67,7 +67,7 @@ void ares_free_data(void *dataptr) if (ptr->data.mx_reply.next) ares_free_data(ptr->data.mx_reply.next); if (ptr->data.mx_reply.host) - free(ptr->data.mx_reply.host); + ares_free(ptr->data.mx_reply.host); break; case ARES_DATATYPE_SRV_REPLY: @@ -75,15 +75,16 @@ void ares_free_data(void *dataptr) if (ptr->data.srv_reply.next) ares_free_data(ptr->data.srv_reply.next); if (ptr->data.srv_reply.host) - free(ptr->data.srv_reply.host); + ares_free(ptr->data.srv_reply.host); break; case ARES_DATATYPE_TXT_REPLY: + case ARES_DATATYPE_TXT_EXT: if (ptr->data.txt_reply.next) ares_free_data(ptr->data.txt_reply.next); if (ptr->data.txt_reply.txt) - free(ptr->data.txt_reply.txt); + ares_free(ptr->data.txt_reply.txt); break; case ARES_DATATYPE_ADDR_NODE: @@ -92,32 +93,38 @@ void ares_free_data(void *dataptr) ares_free_data(ptr->data.addr_node.next); break; + case ARES_DATATYPE_ADDR_PORT_NODE: + + if (ptr->data.addr_port_node.next) + ares_free_data(ptr->data.addr_port_node.next); + break; + case ARES_DATATYPE_NAPTR_REPLY: if (ptr->data.naptr_reply.next) ares_free_data(ptr->data.naptr_reply.next); if (ptr->data.naptr_reply.flags) - free(ptr->data.naptr_reply.flags); + ares_free(ptr->data.naptr_reply.flags); if (ptr->data.naptr_reply.service) - free(ptr->data.naptr_reply.service); + ares_free(ptr->data.naptr_reply.service); if (ptr->data.naptr_reply.regexp) - free(ptr->data.naptr_reply.regexp); + ares_free(ptr->data.naptr_reply.regexp); if (ptr->data.naptr_reply.replacement) - free(ptr->data.naptr_reply.replacement); + ares_free(ptr->data.naptr_reply.replacement); break; case ARES_DATATYPE_SOA_REPLY: if (ptr->data.soa_reply.nsname) - free(ptr->data.soa_reply.nsname); + ares_free(ptr->data.soa_reply.nsname); if (ptr->data.soa_reply.hostmaster) - free(ptr->data.soa_reply.hostmaster); + ares_free(ptr->data.soa_reply.hostmaster); break; default: return; } - free(ptr); + ares_free(ptr); } @@ -136,7 +143,7 @@ void *ares_malloc_data(ares_datatype type) { struct ares_data *ptr; - ptr = malloc(sizeof(struct ares_data)); + ptr = ares_malloc(sizeof(struct ares_data)); if (!ptr) return NULL; @@ -156,6 +163,10 @@ void *ares_malloc_data(ares_datatype type) ptr->data.srv_reply.port = 0; break; + case ARES_DATATYPE_TXT_EXT: + ptr->data.txt_ext.record_start = 0; + /* FALLTHROUGH */ + case ARES_DATATYPE_TXT_REPLY: ptr->data.txt_reply.next = NULL; ptr->data.txt_reply.txt = NULL; @@ -169,6 +180,15 @@ void *ares_malloc_data(ares_datatype type) sizeof(ptr->data.addr_node.addrV6)); break; + case ARES_DATATYPE_ADDR_PORT_NODE: + ptr->data.addr_port_node.next = NULL; + ptr->data.addr_port_node.family = 0; + ptr->data.addr_port_node.udp_port = 0; + ptr->data.addr_port_node.tcp_port = 0; + memset(&ptr->data.addr_port_node.addrV6, 0, + sizeof(ptr->data.addr_port_node.addrV6)); + break; + case ARES_DATATYPE_NAPTR_REPLY: ptr->data.naptr_reply.next = NULL; ptr->data.naptr_reply.flags = NULL; @@ -190,7 +210,7 @@ void *ares_malloc_data(ares_datatype type) break; default: - free(ptr); + ares_free(ptr); return NULL; } diff --git a/deps/cares/src/ares_data.h b/deps/cares/src/ares_data.h index 12e3b672df3c09..ffee2be6baab8a 100644 --- a/deps/cares/src/ares_data.h +++ b/deps/cares/src/ares_data.h @@ -18,6 +18,7 @@ typedef enum { ARES_DATATYPE_UNKNOWN = 1, /* unknown data type - introduced in 1.7.0 */ ARES_DATATYPE_SRV_REPLY, /* struct ares_srv_reply - introduced in 1.7.0 */ ARES_DATATYPE_TXT_REPLY, /* struct ares_txt_reply - introduced in 1.7.0 */ + ARES_DATATYPE_TXT_EXT, /* struct ares_txt_ext - introduced in 1.11.0 */ ARES_DATATYPE_ADDR_NODE, /* struct ares_addr_node - introduced in 1.7.1 */ ARES_DATATYPE_MX_REPLY, /* struct ares_mx_reply - introduced in 1.7.2 */ ARES_DATATYPE_NAPTR_REPLY,/* struct ares_naptr_reply - introduced in 1.7.6 */ @@ -28,6 +29,7 @@ typedef enum { ARES_DATATYPE_HOSTENT, /* struct hostent */ ARES_DATATYPE_OPTIONS, /* struct ares_options */ #endif + ARES_DATATYPE_ADDR_PORT_NODE, /* struct ares_addr_port_node - introduced in 1.11.0 */ ARES_DATATYPE_LAST /* not used - introduced in 1.7.0 */ } ares_datatype; @@ -55,12 +57,14 @@ struct ares_data { ares_datatype type; /* Actual data type identifier. */ unsigned int mark; /* Private ares_data signature. */ union { - struct ares_txt_reply txt_reply; - struct ares_srv_reply srv_reply; - struct ares_addr_node addr_node; - struct ares_mx_reply mx_reply; - struct ares_naptr_reply naptr_reply; - struct ares_soa_reply soa_reply; + struct ares_txt_reply txt_reply; + struct ares_txt_ext txt_ext; + struct ares_srv_reply srv_reply; + struct ares_addr_node addr_node; + struct ares_addr_port_node addr_port_node; + struct ares_mx_reply mx_reply; + struct ares_naptr_reply naptr_reply; + struct ares_soa_reply soa_reply; } data; }; diff --git a/deps/cares/src/ares_destroy.c b/deps/cares/src/ares_destroy.c index 6c1f32442ea90f..8aa42236aecffe 100644 --- a/deps/cares/src/ares_destroy.c +++ b/deps/cares/src/ares_destroy.c @@ -27,15 +27,15 @@ void ares_destroy_options(struct ares_options *options) int i; if(options->servers) - free(options->servers); + ares_free(options->servers); for (i = 0; i < options->ndomains; i++) - free(options->domains[i]); + ares_free(options->domains[i]); if(options->domains) - free(options->domains); + ares_free(options->domains); if(options->sortlist) - free(options->sortlist); + ares_free(options->sortlist); if(options->lookups) - free(options->lookups); + ares_free(options->lookups); } void ares_destroy(ares_channel channel) @@ -75,17 +75,17 @@ void ares_destroy(ares_channel channel) if (channel->domains) { for (i = 0; i < channel->ndomains; i++) - free(channel->domains[i]); - free(channel->domains); + ares_free(channel->domains[i]); + ares_free(channel->domains); } if(channel->sortlist) - free(channel->sortlist); + ares_free(channel->sortlist); if (channel->lookups) - free(channel->lookups); + ares_free(channel->lookups); - free(channel); + ares_free(channel); } void ares__destroy_servers_state(ares_channel channel) @@ -101,7 +101,7 @@ void ares__destroy_servers_state(ares_channel channel) ares__close_sockets(channel, server); assert(ares__is_list_empty(&server->queries_to_server)); } - free(channel->servers); + ares_free(channel->servers); channel->servers = NULL; } channel->nservers = -1; diff --git a/deps/cares/src/ares_expand_name.c b/deps/cares/src/ares_expand_name.c index 2aa12bc0efbb2b..738be8dccb96bc 100644 --- a/deps/cares/src/ares_expand_name.c +++ b/deps/cares/src/ares_expand_name.c @@ -74,7 +74,7 @@ int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf, if (nlen.sig < 0) return ARES_EBADNAME; - *s = malloc(nlen.uns + 1); + *s = ares_malloc(nlen.uns + 1); if (!*s) return ARES_ENOMEM; q = *s; @@ -129,7 +129,7 @@ int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf, if (q > *s) *(q - 1) = 0; else - *q = 0; /* zero terminate */ + *q = 0; /* zero terminate; LCOV_EXCL_LINE: empty names exit above */ return ARES_SUCCESS; } @@ -140,7 +140,7 @@ int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf, static int name_length(const unsigned char *encoded, const unsigned char *abuf, int alen) { - int n = 0, offset, indir = 0; + int n = 0, offset, indir = 0, top; /* Allow the caller to pass us abuf + alen and have us check for it. */ if (encoded >= abuf + alen) @@ -148,7 +148,8 @@ static int name_length(const unsigned char *encoded, const unsigned char *abuf, while (*encoded) { - if ((*encoded & INDIR_MASK) == INDIR_MASK) + top = (*encoded & INDIR_MASK); + if (top == INDIR_MASK) { /* Check the offset and go there. */ if (encoded + 1 >= abuf + alen) @@ -164,7 +165,7 @@ static int name_length(const unsigned char *encoded, const unsigned char *abuf, if (++indir > alen) return -1; } - else + else if (top == 0x00) { offset = *encoded; if (encoded + offset + 1 >= abuf + alen) @@ -177,6 +178,13 @@ static int name_length(const unsigned char *encoded, const unsigned char *abuf, } n++; } + else + { + /* RFC 1035 4.1.4 says other options (01, 10) for top 2 + * bits are reserved. + */ + return -1; + } } /* If there were any labels at all, then the number of dots is one diff --git a/deps/cares/src/ares_expand_string.c b/deps/cares/src/ares_expand_string.c index 96d1be34b38c60..ed5476b91d866d 100644 --- a/deps/cares/src/ares_expand_string.c +++ b/deps/cares/src/ares_expand_string.c @@ -54,7 +54,7 @@ int ares_expand_string(const unsigned char *encoded, encoded++; - *s = malloc(elen.uns+1); + *s = ares_malloc(elen.uns+1); if (*s == NULL) return ARES_ENOMEM; q = *s; diff --git a/deps/cares/src/ares_free_hostent.c b/deps/cares/src/ares_free_hostent.c index 7f448828c8dad6..cfc5f81feb822c 100644 --- a/deps/cares/src/ares_free_hostent.c +++ b/deps/cares/src/ares_free_hostent.c @@ -30,12 +30,12 @@ void ares_free_hostent(struct hostent *host) if (!host) return; - free((char *)(host->h_name)); + ares_free((char *)(host->h_name)); for (p = host->h_aliases; *p; p++) - free(*p); - free(host->h_aliases); - free(host->h_addr_list[0]); /* no matter if there is one or many entries, + ares_free(*p); + ares_free(host->h_aliases); + ares_free(host->h_addr_list[0]); /* no matter if there is one or many entries, there is only one malloc for all of them */ - free(host->h_addr_list); - free(host); + ares_free(host->h_addr_list); + ares_free(host); } diff --git a/deps/cares/src/ares_free_string.c b/deps/cares/src/ares_free_string.c index 9441089087e155..024992e1c208ce 100644 --- a/deps/cares/src/ares_free_string.c +++ b/deps/cares/src/ares_free_string.c @@ -21,5 +21,5 @@ void ares_free_string(void *str) { - free(str); + ares_free(str); } diff --git a/deps/cares/src/ares_gethostbyaddr.c b/deps/cares/src/ares_gethostbyaddr.c index 85862e2f854205..9258919a385699 100644 --- a/deps/cares/src/ares_gethostbyaddr.c +++ b/deps/cares/src/ares_gethostbyaddr.c @@ -79,7 +79,7 @@ void ares_gethostbyaddr(ares_channel channel, const void *addr, int addrlen, return; } - aquery = malloc(sizeof(struct addr_query)); + aquery = ares_malloc(sizeof(struct addr_query)); if (!aquery) { callback(arg, ARES_ENOMEM, 0, NULL); @@ -169,7 +169,7 @@ static void end_aquery(struct addr_query *aquery, int status, aquery->callback(aquery->arg, status, aquery->timeouts, host); if (host) ares_free_hostent(host); - free(aquery); + ares_free(aquery); } static int file_lookup(struct ares_addr *addr, struct hostent **host) diff --git a/deps/cares/src/ares_gethostbyname.c b/deps/cares/src/ares_gethostbyname.c index ba6b0f0f0c5661..caab6ae49566d6 100644 --- a/deps/cares/src/ares_gethostbyname.c +++ b/deps/cares/src/ares_gethostbyname.c @@ -99,18 +99,18 @@ void ares_gethostbyname(ares_channel channel, const char *name, int family, return; /* Allocate and fill in the host query structure. */ - hquery = malloc(sizeof(struct host_query)); + hquery = ares_malloc(sizeof(struct host_query)); if (!hquery) { callback(arg, ARES_ENOMEM, 0, NULL); return; } hquery->channel = channel; - hquery->name = strdup(name); + hquery->name = ares_strdup(name); hquery->want_family = family; hquery->sent_family = -1; /* nothing is sent yet */ if (!hquery->name) { - free(hquery); + ares_free(hquery); callback(arg, ARES_ENOMEM, 0, NULL); return; } @@ -194,6 +194,8 @@ static void host_callback(void *arg, int status, int timeouts, /* The query returned something but either there were no AAAA records (e.g. just CNAME) or the response was malformed. Try looking up A instead. */ + if (host) + ares_free_hostent(host); hquery->sent_family = AF_INET; ares_search(hquery->channel, hquery->name, C_IN, T_A, host_callback, hquery); @@ -225,8 +227,8 @@ static void end_hquery(struct host_query *hquery, int status, hquery->callback(hquery->arg, status, hquery->timeouts, host); if (host) ares_free_hostent(host); - free(hquery->name); - free(hquery); + ares_free(hquery->name); + ares_free(hquery); } /* If the name looks like an IP address, fake up a host entry, end the @@ -285,7 +287,7 @@ static int fake_hostent(const char *name, int family, addrs[0] = (char *)&in6; } /* Duplicate the name, to avoid a constness violation. */ - hostent.h_name = strdup(name); + hostent.h_name = ares_strdup(name); if (!hostent.h_name) { callback(arg, ARES_ENOMEM, 0, NULL); @@ -299,7 +301,7 @@ static int fake_hostent(const char *name, int family, hostent.h_addr_list = addrs; callback(arg, ARES_SUCCESS, 0, &hostent); - free((char *)(hostent.h_name)); + ares_free((char *)(hostent.h_name)); return 1; } diff --git a/deps/cares/src/ares_getnameinfo.c b/deps/cares/src/ares_getnameinfo.c index b0bc6da868cdda..d5571a7fd2d2a8 100644 --- a/deps/cares/src/ares_getnameinfo.c +++ b/deps/cares/src/ares_getnameinfo.c @@ -77,7 +77,7 @@ static char *lookup_service(unsigned short port, int flags, static void append_scopeid(struct sockaddr_in6 *addr6, unsigned int scopeid, char *buf, size_t buflen); #endif -static char *ares_striendstr(const char *s1, const char *s2); +STATIC_TESTABLE char *ares_striendstr(const char *s1, const char *s2); void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, ares_socklen_t salen, @@ -163,7 +163,7 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, /* This is where a DNS lookup becomes necessary */ else { - niquery = malloc(sizeof(struct nameinfo_query)); + niquery = ares_malloc(sizeof(struct nameinfo_query)); if (!niquery) { callback(arg, ARES_ENOMEM, 0, NULL, NULL); @@ -234,7 +234,7 @@ static void nameinfo_callback(void *arg, int status, int timeouts, niquery->callback(niquery->arg, ARES_SUCCESS, niquery->timeouts, (char *)(host->h_name), service); - free(niquery); + ares_free(niquery); return; } /* We couldn't find the host, but it's OK, we can use the IP */ @@ -265,11 +265,11 @@ static void nameinfo_callback(void *arg, int status, int timeouts, } niquery->callback(niquery->arg, ARES_SUCCESS, niquery->timeouts, ipbuf, service); - free(niquery); + ares_free(niquery); return; } niquery->callback(niquery->arg, status, niquery->timeouts, NULL, NULL); - free(niquery); + ares_free(niquery); } static char *lookup_service(unsigned short port, int flags, @@ -304,7 +304,7 @@ static char *lookup_service(unsigned short port, int flags, #if GETSERVBYPORT_R_ARGS == 6 if (getservbyport_r(port, proto, &se, (void *)tmpbuf, sizeof(tmpbuf), &sep) != 0) - sep = NULL; + sep = NULL; /* LCOV_EXCL_LINE: buffer large so this never fails */ #elif GETSERVBYPORT_R_ARGS == 5 sep = getservbyport_r(port, proto, &se, (void *)tmpbuf, sizeof(tmpbuf)); @@ -341,7 +341,7 @@ static char *lookup_service(unsigned short port, int flags, memcpy(buf, name, name_len + 1); else /* avoid reusing previous one */ - buf[0] = '\0'; + buf[0] = '\0'; /* LCOV_EXCL_LINE: no real service names are too big */ return buf; } buf[0] = '\0'; @@ -391,7 +391,7 @@ static void append_scopeid(struct sockaddr_in6 *addr6, unsigned int flags, #endif /* Determines if s1 ends with the string in s2 (case-insensitive) */ -static char *ares_striendstr(const char *s1, const char *s2) +STATIC_TESTABLE char *ares_striendstr(const char *s1, const char *s2) { const char *c1, *c2, *c1_begin; int lo1, lo2; @@ -417,7 +417,5 @@ static char *ares_striendstr(const char *s1, const char *s2) c2++; } } - if (c2 == c1 && c2 == NULL) - return (char *)c1_begin; - return NULL; + return (char *)c1_begin; } diff --git a/deps/cares/src/ares_init.c b/deps/cares/src/ares_init.c index bd3336e5d63e46..c872a0e18959f6 100644 --- a/deps/cares/src/ares_init.c +++ b/deps/cares/src/ares_init.c @@ -49,6 +49,10 @@ #define MAX_DNS_PROPERTIES 8 #endif +#if defined(CARES_USE_LIBRESOLV) +#include +#endif + #include "ares.h" #include "ares_inet_net_pton.h" #include "ares_library_init.h" @@ -76,17 +80,17 @@ static int set_options(ares_channel channel, const char *str); static const char *try_option(const char *p, const char *q, const char *opt); static int init_id_key(rc4_key* key,int key_data_len); -#if !defined(WIN32) && !defined(WATT32) && \ - !defined(ANDROID) && !defined(__ANDROID__) +static int config_sortlist(struct apattern **sortlist, int *nsort, + const char *str); static int sortlist_alloc(struct apattern **sortlist, int *nsort, struct apattern *pat); static int ip_addr(const char *s, ssize_t len, struct in_addr *addr); static void natural_mask(struct apattern *pat); +#if !defined(WIN32) && !defined(WATT32) && \ + !defined(ANDROID) && !defined(__ANDROID__) && !defined(CARES_USE_LIBRESOLV) static int config_domain(ares_channel channel, char *str); static int config_lookup(ares_channel channel, const char *str, const char *bindch, const char *filech); -static int config_sortlist(struct apattern **sortlist, int *nsort, - const char *str); static char *try_config(char *s, const char *opt, char scc); #endif @@ -107,6 +111,7 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options, ares_channel channel; int i; int status = ARES_SUCCESS; + int status2; struct timeval now; #ifdef CURLDEBUG @@ -124,9 +129,9 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options, #endif if (ares_library_initialized() != ARES_SUCCESS) - return ARES_ENOTINITIALIZED; + return ARES_ENOTINITIALIZED; /* LCOV_EXCL_LINE: n/a on non-WinSock */ - channel = malloc(sizeof(struct ares_channeldata)); + channel = ares_malloc(sizeof(struct ares_channeldata)); if (!channel) { *channelptr = NULL; return ARES_ENOMEM; @@ -205,10 +210,13 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options, * No matter what failed or succeeded, seed defaults to provide * useful behavior for things that we missed. */ - status = init_by_defaults(channel); - if (status != ARES_SUCCESS) + status2 = init_by_defaults(channel); + if (status2 != ARES_SUCCESS) { DEBUGF(fprintf(stderr, "Error: init_by_defaults failed: %s\n", ares_strerror(status))); + if (status == ARES_SUCCESS) + status = status2; + } /* Generate random key */ @@ -225,18 +233,18 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options, { /* Something failed; clean up memory we may have allocated. */ if (channel->servers) - free(channel->servers); + ares_free(channel->servers); if (channel->domains) { for (i = 0; i < channel->ndomains; i++) - free(channel->domains[i]); - free(channel->domains); + ares_free(channel->domains[i]); + ares_free(channel->domains); } if (channel->sortlist) - free(channel->sortlist); + ares_free(channel->sortlist); if(channel->lookups) - free(channel->lookups); - free(channel); + ares_free(channel->lookups); + ares_free(channel); return status; } @@ -255,8 +263,8 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options, int ares_dup(ares_channel *dest, ares_channel src) { struct ares_options opts; - struct ares_addr_node *servers; - int ipv6_nservers = 0; + struct ares_addr_port_node *servers; + int non_v4_default_port = 0; int i, rc; int optmask; @@ -289,22 +297,30 @@ int ares_dup(ares_channel *dest, ares_channel src) (*dest)->local_ip4 = src->local_ip4; memcpy((*dest)->local_ip6, src->local_ip6, sizeof(src->local_ip6)); - /* Full name server cloning required when not all are IPv4 */ + /* Full name server cloning required if there is a non-IPv4, or non-default port, nameserver */ for (i = 0; i < src->nservers; i++) { - if (src->servers[i].addr.family != AF_INET) { - ipv6_nservers++; + if ((src->servers[i].addr.family != AF_INET) || + (src->servers[i].addr.udp_port != 0) || + (src->servers[i].addr.tcp_port != 0)) { + non_v4_default_port++; break; } } - if (ipv6_nservers) { - rc = ares_get_servers(src, &servers); - if (rc != ARES_SUCCESS) + if (non_v4_default_port) { + rc = ares_get_servers_ports(src, &servers); + if (rc != ARES_SUCCESS) { + ares_destroy(*dest); + *dest = NULL; return rc; - rc = ares_set_servers(*dest, servers); + } + rc = ares_set_servers_ports(*dest, servers); ares_free_data(servers); - if (rc != ARES_SUCCESS) + if (rc != ARES_SUCCESS) { + ares_destroy(*dest); + *dest = NULL; return rc; + } } return ARES_SUCCESS; /* everything went fine */ @@ -345,20 +361,24 @@ int ares_save_options(ares_channel channel, struct ares_options *options, options->sock_state_cb = channel->sock_state_cb; options->sock_state_cb_data = channel->sock_state_cb_data; - /* Copy IPv4 servers */ + /* Copy IPv4 servers that use the default port */ if (channel->nservers) { for (i = 0; i < channel->nservers; i++) { - if (channel->servers[i].addr.family == AF_INET) + if ((channel->servers[i].addr.family == AF_INET) && + (channel->servers[i].addr.udp_port == 0) && + (channel->servers[i].addr.tcp_port == 0)) ipv4_nservers++; } if (ipv4_nservers) { - options->servers = malloc(ipv4_nservers * sizeof(struct in_addr)); + options->servers = ares_malloc(ipv4_nservers * sizeof(struct in_addr)); if (!options->servers) return ARES_ENOMEM; for (i = j = 0; i < channel->nservers; i++) { - if (channel->servers[i].addr.family == AF_INET) + if ((channel->servers[i].addr.family == AF_INET) && + (channel->servers[i].addr.udp_port == 0) && + (channel->servers[i].addr.tcp_port == 0)) memcpy(&options->servers[j++], &channel->servers[i].addr.addrV4, sizeof(channel->servers[i].addr.addrV4)); @@ -369,14 +389,14 @@ int ares_save_options(ares_channel channel, struct ares_options *options, /* copy domains */ if (channel->ndomains) { - options->domains = malloc(channel->ndomains * sizeof(char *)); + options->domains = ares_malloc(channel->ndomains * sizeof(char *)); if (!options->domains) return ARES_ENOMEM; for (i = 0; i < channel->ndomains; i++) { options->ndomains = i; - options->domains[i] = strdup(channel->domains[i]); + options->domains[i] = ares_strdup(channel->domains[i]); if (!options->domains[i]) return ARES_ENOMEM; } @@ -385,14 +405,14 @@ int ares_save_options(ares_channel channel, struct ares_options *options, /* copy lookups */ if (channel->lookups) { - options->lookups = strdup(channel->lookups); + options->lookups = ares_strdup(channel->lookups); if (!options->lookups && channel->lookups) return ARES_ENOMEM; } /* copy sortlist */ if (channel->nsort) { - options->sortlist = malloc(channel->nsort * sizeof(struct apattern)); + options->sortlist = ares_malloc(channel->nsort * sizeof(struct apattern)); if (!options->sortlist) return ARES_ENOMEM; for (i = 0; i < channel->nsort; i++) @@ -448,12 +468,14 @@ static int init_by_options(ares_channel channel, if (options->nservers > 0) { channel->servers = - malloc(options->nservers * sizeof(struct server_state)); + ares_malloc(options->nservers * sizeof(struct server_state)); if (!channel->servers) return ARES_ENOMEM; for (i = 0; i < options->nservers; i++) { channel->servers[i].addr.family = AF_INET; + channel->servers[i].addr.udp_port = 0; + channel->servers[i].addr.tcp_port = 0; memcpy(&channel->servers[i].addr.addrV4, &options->servers[i], sizeof(channel->servers[i].addr.addrV4)); @@ -470,13 +492,13 @@ static int init_by_options(ares_channel channel, /* Avoid zero size allocations at any cost */ if (options->ndomains > 0) { - channel->domains = malloc(options->ndomains * sizeof(char *)); + channel->domains = ares_malloc(options->ndomains * sizeof(char *)); if (!channel->domains) return ARES_ENOMEM; for (i = 0; i < options->ndomains; i++) { channel->ndomains = i; - channel->domains[i] = strdup(options->domains[i]); + channel->domains[i] = ares_strdup(options->domains[i]); if (!channel->domains[i]) return ARES_ENOMEM; } @@ -487,7 +509,7 @@ static int init_by_options(ares_channel channel, /* Set lookups, if given. */ if ((optmask & ARES_OPT_LOOKUPS) && !channel->lookups) { - channel->lookups = strdup(options->lookups); + channel->lookups = ares_strdup(options->lookups); if (!channel->lookups) return ARES_ENOMEM; } @@ -495,7 +517,7 @@ static int init_by_options(ares_channel channel, /* copy sortlist */ if ((optmask & ARES_OPT_SORTLIST) && (channel->nsort == -1) && (options->nsort>0)) { - channel->sortlist = malloc(options->nsort * sizeof(struct apattern)); + channel->sortlist = ares_malloc(options->nsort * sizeof(struct apattern)); if (!channel->sortlist) return ARES_ENOMEM; for (i = 0; i < options->nsort; i++) @@ -526,7 +548,7 @@ static int init_by_environment(ares_channel channel) { status = set_options(channel, res_options); if (status != ARES_SUCCESS) - return status; + return status; /* LCOV_EXCL_LINE: set_options() never fails */ } return ARES_SUCCESS; @@ -561,7 +583,7 @@ static int get_REG_SZ(HKEY hKey, const char *leafKeyName, char **outptr) /* Allocate buffer of indicated size plus one given that string might have been stored without null termination */ - *outptr = malloc(size+1); + *outptr = ares_malloc(size+1); if (!*outptr) return 0; @@ -570,7 +592,7 @@ static int get_REG_SZ(HKEY hKey, const char *leafKeyName, char **outptr) (unsigned char *)*outptr, &size); if ((res != ERROR_SUCCESS) || (size == 1)) { - free(*outptr); + ares_free(*outptr); *outptr = NULL; return 0; } @@ -603,7 +625,7 @@ static int get_REG_SZ_9X(HKEY hKey, const char *leafKeyName, char **outptr) /* Allocate buffer of indicated size plus one given that string might have been stored without null termination */ - *outptr = malloc(size+1); + *outptr = ares_malloc(size+1); if (!*outptr) return 0; @@ -612,7 +634,7 @@ static int get_REG_SZ_9X(HKEY hKey, const char *leafKeyName, char **outptr) (unsigned char *)*outptr, &size); if ((res != ERROR_SUCCESS) || (size == 1)) { - free(*outptr); + ares_free(*outptr); *outptr = NULL; return 0; } @@ -813,16 +835,16 @@ static void commajoin(char **dst, const char *src) if (*dst) { - tmp = malloc(strlen(*dst) + strlen(src) + 2); + tmp = ares_malloc(strlen(*dst) + strlen(src) + 2); if (!tmp) return; sprintf(tmp, "%s,%s", *dst, src); - free(*dst); + ares_free(*dst); *dst = tmp; } else { - *dst = malloc(strlen(src) + 1); + *dst = ares_malloc(strlen(src) + 1); if (!*dst) return; strcpy(*dst, src); @@ -860,7 +882,7 @@ static int get_DNS_NetworkParams(char **outptr) if (ares_fpGetNetworkParams == ZERO_NULL) return 0; - fi = malloc(size); + fi = ares_malloc(size); if (!fi) return 0; @@ -868,7 +890,7 @@ static int get_DNS_NetworkParams(char **outptr) if ((res != ERROR_BUFFER_OVERFLOW) && (res != ERROR_SUCCESS)) goto done; - newfi = realloc(fi, size); + newfi = ares_realloc(fi, size); if (!newfi) goto done; @@ -905,7 +927,7 @@ static int get_DNS_NetworkParams(char **outptr) done: if (fi) - free(fi); + ares_free(fi); if (!*outptr) return 0; @@ -953,7 +975,7 @@ static int get_DNS_AdaptersAddresses(char **outptr) if (ares_fpGetAdaptersAddresses == ZERO_NULL) return 0; - ipaa = malloc(Bufsz); + ipaa = ares_malloc(Bufsz); if (!ipaa) return 0; @@ -967,7 +989,7 @@ static int get_DNS_AdaptersAddresses(char **outptr) { if (Bufsz < ReqBufsz) { - newipaa = realloc(ipaa, ReqBufsz); + newipaa = ares_realloc(ipaa, ReqBufsz); if (!newipaa) goto done; Bufsz = ReqBufsz; @@ -983,6 +1005,9 @@ static int get_DNS_AdaptersAddresses(char **outptr) for (ipaaEntry = ipaa; ipaaEntry; ipaaEntry = ipaaEntry->Next) { + if(ipaaEntry->OperStatus != IfOperStatusUp) + continue; + for (ipaDNSAddr = ipaaEntry->FirstDnsServerAddress; ipaDNSAddr; ipaDNSAddr = ipaDNSAddr->Next) @@ -1024,7 +1049,7 @@ static int get_DNS_AdaptersAddresses(char **outptr) done: if (ipaa) - free(ipaa); + ares_free(ipaa); if (!*outptr) return 0; @@ -1048,14 +1073,20 @@ static int get_DNS_AdaptersAddresses(char **outptr) */ static int get_DNS_Windows(char **outptr) { - /* Try using IP helper API GetAdaptersAddresses() */ - if (get_DNS_AdaptersAddresses(outptr)) - return 1; - + /* + Use GetNetworkParams First in case of + multiple adapter is enabled on this machine. + GetAdaptersAddresses will retrive dummy dns servers. + That will slowing DNS lookup. + */ /* Try using IP helper API GetNetworkParams() */ if (get_DNS_NetworkParams(outptr)) return 1; + /* Try using IP helper API GetAdaptersAddresses() */ + if (get_DNS_AdaptersAddresses(outptr)) + return 1; + /* Fall-back to registry information */ return get_DNS_Registry(outptr); } @@ -1063,7 +1094,8 @@ static int get_DNS_Windows(char **outptr) static int init_by_resolv_conf(ares_channel channel) { -#if !defined(ANDROID) && !defined(__ANDROID__) && !defined(WATT32) +#if !defined(ANDROID) && !defined(__ANDROID__) && !defined(WATT32) && \ + !defined(CARES_USE_LIBRESOLV) char *line = NULL; #endif int status = -1, nservers = 0, nsort = 0; @@ -1078,7 +1110,7 @@ static int init_by_resolv_conf(ares_channel channel) if (get_DNS_Windows(&line)) { status = config_nameserver(&servers, &nservers, line); - free(line); + ares_free(line); } if (status == ARES_SUCCESS) @@ -1096,7 +1128,7 @@ static int init_by_resolv_conf(ares_channel channel) line = getenv("Inet$Resolvers"); status = ARES_EOF; if (line) { - char *resolvers = strdup(line), *pos, *space; + char *resolvers = ares_strdup(line), *pos, *space; if (!resolvers) return ARES_ENOMEM; @@ -1115,7 +1147,7 @@ static int init_by_resolv_conf(ares_channel channel) if (status == ARES_SUCCESS) status = ARES_EOF; - free(resolvers); + ares_free(resolvers); } #elif defined(WATT32) @@ -1128,14 +1160,17 @@ static int init_by_resolv_conf(ares_channel channel) return ARES_SUCCESS; /* use localhost DNS server */ nservers = i; - servers = calloc(i, sizeof(struct server_state)); + servers = ares_malloc(sizeof(struct server_state)); if (!servers) return ARES_ENOMEM; + memset(servers, 0, sizeof(struct server_state)); for (i = 0; def_nameservers[i]; i++) { servers[i].addr.addrV4.s_addr = htonl(def_nameservers[i]); servers[i].addr.family = AF_INET; + servers[i].addr.udp_port = 0; + servers[i].addr.tcp_port = 0; } status = ARES_EOF; @@ -1155,6 +1190,63 @@ static int init_by_resolv_conf(ares_channel channel) break; status = ARES_EOF; } +#elif defined(CARES_USE_LIBRESOLV) + struct __res_state res; + memset(&res, 0, sizeof(res)); + int result = res_ninit(&res); + if (result == 0 && (res.options & RES_INIT)) { + status = ARES_EOF; + + if (channel->nservers == -1) { + union res_sockaddr_union addr[MAXNS]; + int nscount = res_getservers(&res, addr, MAXNS); + for (int i = 0; i < nscount; ++i) { + char str[INET6_ADDRSTRLEN]; + int config_status; + sa_family_t family = addr[i].sin.sin_family; + if (family == AF_INET) { + ares_inet_ntop(family, &addr[i].sin.sin_addr, str, sizeof(str)); + } else if (family == AF_INET6) { + ares_inet_ntop(family, &addr[i].sin6.sin6_addr, str, sizeof(str)); + } else { + continue; + } + + config_status = config_nameserver(&servers, &nservers, str); + if (config_status != ARES_SUCCESS) { + status = config_status; + break; + } + } + } + if (channel->ndomains == -1) { + int entries = 0; + while ((entries < MAXDNSRCH) && res.dnsrch[entries]) + entries++; + + channel->domains = ares_malloc(entries * sizeof(char *)); + if (!channel->domains) { + status = ARES_ENOMEM; + } else { + channel->ndomains = entries; + for (int i = 0; i < channel->ndomains; ++i) { + channel->domains[i] = ares_strdup(res.dnsrch[i]); + if (!channel->domains[i]) + status = ARES_ENOMEM; + } + } + } + if (channel->ndots == -1) + channel->ndots = res.ndots; + if (channel->tries == -1) + channel->tries = res.retry; + if (channel->rotate == -1) + channel->rotate = res.options & RES_ROTATE; + if (channel->timeout == -1) + channel->timeout = res.retrans * 1000; + + res_ndestroy(&res); + } #else { char *p; @@ -1300,7 +1392,7 @@ static int init_by_resolv_conf(ares_channel channel) } if(line) - free(line); + ares_free(line); } #endif @@ -1309,9 +1401,9 @@ static int init_by_resolv_conf(ares_channel channel) if (status != ARES_EOF) { if (servers != NULL) - free(servers); + ares_free(servers); if (sortlist != NULL) - free(sortlist); + ares_free(sortlist); return status; } @@ -1360,13 +1452,15 @@ static int init_by_defaults(ares_channel channel) if (channel->nservers == -1) { /* If nobody specified servers, try a local named. */ - channel->servers = malloc(sizeof(struct server_state)); + channel->servers = ares_malloc(sizeof(struct server_state)); if (!channel->servers) { rc = ARES_ENOMEM; goto error; } channel->servers[0].addr.family = AF_INET; channel->servers[0].addr.addrV4.s_addr = htonl(INADDR_LOOPBACK); + channel->servers[0].addr.udp_port = 0; + channel->servers[0].addr.tcp_port = 0; channel->nservers = 1; } @@ -1391,7 +1485,7 @@ static int init_by_defaults(ares_channel channel) int res; channel->ndomains = 0; /* default to none */ - hostname = malloc(len); + hostname = ares_malloc(len); if(!hostname) { rc = ARES_ENOMEM; goto error; @@ -1404,7 +1498,7 @@ static int init_by_defaults(ares_channel channel) char *p; len *= 2; lenv *= 2; - p = realloc(hostname, len); + p = ares_realloc(hostname, len); if(!p) { rc = ARES_ENOMEM; goto error; @@ -1422,12 +1516,12 @@ static int init_by_defaults(ares_channel channel) dot = strchr(hostname, '.'); if (dot) { /* a dot was found */ - channel->domains = malloc(sizeof(char *)); + channel->domains = ares_malloc(sizeof(char *)); if (!channel->domains) { rc = ARES_ENOMEM; goto error; } - channel->domains[0] = strdup(dot + 1); + channel->domains[0] = ares_strdup(dot + 1); if (!channel->domains[0]) { rc = ARES_ENOMEM; goto error; @@ -1443,7 +1537,7 @@ static int init_by_defaults(ares_channel channel) } if (!channel->lookups) { - channel->lookups = strdup("fb"); + channel->lookups = ares_strdup("fb"); if (!channel->lookups) rc = ARES_ENOMEM; } @@ -1451,31 +1545,31 @@ static int init_by_defaults(ares_channel channel) error: if(rc) { if(channel->servers) { - free(channel->servers); + ares_free(channel->servers); channel->servers = NULL; } if(channel->domains && channel->domains[0]) - free(channel->domains[0]); + ares_free(channel->domains[0]); if(channel->domains) { - free(channel->domains); + ares_free(channel->domains); channel->domains = NULL; } if(channel->lookups) { - free(channel->lookups); + ares_free(channel->lookups); channel->lookups = NULL; } } if(hostname) - free(hostname); + ares_free(hostname); return rc; } #if !defined(WIN32) && !defined(WATT32) && \ - !defined(ANDROID) && !defined(__ANDROID__) + !defined(ANDROID) && !defined(__ANDROID__) && !defined(CARES_USE_LIBRESOLV) static int config_domain(ares_channel channel, char *str) { char *q; @@ -1520,7 +1614,7 @@ static int config_lookup(ares_channel channel, const char *str, p++; } *l = '\0'; - channel->lookups = strdup(lookups); + channel->lookups = ares_strdup(lookups); return (channel->lookups) ? ARES_SUCCESS : ARES_ENOMEM; } #endif /* !WIN32 & !WATT32 & !ANDROID & !__ANDROID__ */ @@ -1566,13 +1660,15 @@ static int config_nameserver(struct server_state **servers, int *nservers, continue; /* Resize servers state array. */ - newserv = realloc(*servers, (*nservers + 1) * - sizeof(struct server_state)); + newserv = ares_realloc(*servers, (*nservers + 1) * + sizeof(struct server_state)); if (!newserv) return ARES_ENOMEM; /* Store address data. */ newserv[*nservers].addr.family = host.family; + newserv[*nservers].addr.udp_port = 0; + newserv[*nservers].addr.tcp_port = 0; if (host.family == AF_INET) memcpy(&newserv[*nservers].addr.addrV4, &host.addrV4, sizeof(host.addrV4)); @@ -1587,8 +1683,8 @@ static int config_nameserver(struct server_state **servers, int *nservers, return ARES_SUCCESS; } +#endif /* !WATT32 */ -#if !defined(WIN32) && !defined(ANDROID) && !defined(__ANDROID__) static int config_sortlist(struct apattern **sortlist, int *nsort, const char *str) { @@ -1627,8 +1723,11 @@ static int config_sortlist(struct apattern **sortlist, int *nsort, pat.type = PATTERN_CIDR; pat.mask.bits = (unsigned short)bits; pat.family = AF_INET6; - if (!sortlist_alloc(sortlist, nsort, &pat)) + if (!sortlist_alloc(sortlist, nsort, &pat)) { + ares_free(*sortlist); + *sortlist = NULL; return ARES_ENOMEM; + } } else if (ipbufpfx[0] && (bits = ares_inet_net_pton(AF_INET, ipbufpfx, &pat.addrV4, @@ -1637,8 +1736,11 @@ static int config_sortlist(struct apattern **sortlist, int *nsort, pat.type = PATTERN_CIDR; pat.mask.bits = (unsigned short)bits; pat.family = AF_INET; - if (!sortlist_alloc(sortlist, nsort, &pat)) + if (!sortlist_alloc(sortlist, nsort, &pat)) { + ares_free(*sortlist); + *sortlist = NULL; return ARES_ENOMEM; + } } /* See if it is just a regular IP */ else if (ip_addr(ipbuf, q-str, &pat.addrV4) == 0) @@ -1654,8 +1756,11 @@ static int config_sortlist(struct apattern **sortlist, int *nsort, natural_mask(&pat); pat.family = AF_INET; pat.type = PATTERN_MASK; - if (!sortlist_alloc(sortlist, nsort, &pat)) + if (!sortlist_alloc(sortlist, nsort, &pat)) { + ares_free(*sortlist); + *sortlist = NULL; return ARES_ENOMEM; + } } else { @@ -1669,8 +1774,6 @@ static int config_sortlist(struct apattern **sortlist, int *nsort, return ARES_SUCCESS; } -#endif /* !WIN32 & !ANDROID & !__ANDROID__ */ -#endif /* !WATT32 */ static int set_search(ares_channel channel, const char *str) { @@ -1678,13 +1781,14 @@ static int set_search(ares_channel channel, const char *str) const char *p, *q; if(channel->ndomains != -1) { + /* LCOV_EXCL_START: all callers check ndomains == -1 */ /* if we already have some domains present, free them first */ for(n=0; n < channel->ndomains; n++) - free(channel->domains[n]); - free(channel->domains); + ares_free(channel->domains[n]); + ares_free(channel->domains); channel->domains = NULL; channel->ndomains = -1; - } + } /* LCOV_EXCL_STOP */ /* Count the domains given. */ n = 0; @@ -1704,7 +1808,7 @@ static int set_search(ares_channel channel, const char *str) return ARES_SUCCESS; } - channel->domains = malloc(n * sizeof(char *)); + channel->domains = ares_malloc(n * sizeof(char *)); if (!channel->domains) return ARES_ENOMEM; @@ -1717,7 +1821,7 @@ static int set_search(ares_channel channel, const char *str) q = p; while (*q && !ISSPACE(*q)) q++; - channel->domains[n] = malloc(q - p + 1); + channel->domains[n] = ares_malloc(q - p + 1); if (!channel->domains[n]) return ARES_ENOMEM; memcpy(channel->domains[n], p, q - p); @@ -1769,7 +1873,7 @@ static const char *try_option(const char *p, const char *q, const char *opt) } #if !defined(WIN32) && !defined(WATT32) && \ - !defined(ANDROID) && !defined(__ANDROID__) + !defined(ANDROID) && !defined(__ANDROID__) && !defined(CARES_USE_LIBRESOLV) static char *try_config(char *s, const char *opt, char scc) { size_t len; @@ -1778,7 +1882,7 @@ static char *try_config(char *s, const char *opt, char scc) if (!s || !opt) /* no line or no option */ - return NULL; + return NULL; /* LCOV_EXCL_LINE */ /* Hash '#' character is always used as primary comment char, additionally a not-NUL secondary comment char will be considered when specified. */ @@ -1810,7 +1914,7 @@ static char *try_config(char *s, const char *opt, char scc) if ((len = strlen(opt)) == 0) /* empty option */ - return NULL; + return NULL; /* LCOV_EXCL_LINE */ if (strncmp(p, opt, len) != 0) /* line and option do not match */ @@ -1821,7 +1925,7 @@ static char *try_config(char *s, const char *opt, char scc) if (!*p) /* no option value */ - return NULL; + return NULL; /* LCOV_EXCL_LINE */ if ((opt[len-1] != ':') && (opt[len-1] != '=') && !ISSPACE(*p)) /* whitespace between option name and value is mandatory @@ -1839,19 +1943,7 @@ static char *try_config(char *s, const char *opt, char scc) /* return pointer to option value */ return p; } - -static int sortlist_alloc(struct apattern **sortlist, int *nsort, - struct apattern *pat) -{ - struct apattern *newsort; - newsort = realloc(*sortlist, (*nsort + 1) * sizeof(struct apattern)); - if (!newsort) - return 0; - newsort[*nsort] = *pat; - *sortlist = newsort; - (*nsort)++; - return 1; -} +#endif /* !WIN32 & !WATT32 & !ANDROID & !__ANDROID__ */ static int ip_addr(const char *ipbuf, ssize_t len, struct in_addr *addr) { @@ -1885,7 +1977,19 @@ static void natural_mask(struct apattern *pat) else pat->mask.addr4.s_addr = htonl(IN_CLASSC_NET); } -#endif /* !WIN32 & !WATT32 & !ANDROID & !__ANDROID__ */ + +static int sortlist_alloc(struct apattern **sortlist, int *nsort, + struct apattern *pat) +{ + struct apattern *newsort; + newsort = ares_realloc(*sortlist, (*nsort + 1) * sizeof(struct apattern)); + if (!newsort) + return 0; + newsort[*nsort] = *pat; + *sortlist = newsort; + (*nsort)++; + return 1; +} /* initialize an rc4 key. If possible a cryptographically secure random key is generated using a suitable function (for example win32's RtlGenRandom as @@ -1918,7 +2022,7 @@ static void randomize_key(unsigned char* key,int key_data_len) if (!randomized) { for (;counterstate[0]; for(counter = 0; counter < 256; counter++) @@ -1951,7 +2056,7 @@ static int init_id_key(rc4_key* key,int key_data_len) index1 = (unsigned char)((index1 + 1) % key_data_len); } - free(key_data_ptr); + ares_free(key_data_ptr); return ARES_SUCCESS; } @@ -1985,6 +2090,25 @@ void ares_set_socket_callback(ares_channel channel, channel->sock_create_cb_data = data; } +int ares_set_sortlist(ares_channel channel, const char *sortstr) +{ + int nsort = 0; + struct apattern *sortlist = NULL; + int status; + + if (!channel) + return ARES_ENODATA; + + status = config_sortlist(&sortlist, &nsort, sortstr); + if (status == ARES_SUCCESS && sortlist) { + if (channel->sortlist) + ares_free(channel->sortlist); + channel->sortlist = sortlist; + channel->nsort = nsort; + } + return status; +} + void ares__init_servers_state(ares_channel channel) { struct server_state *server; diff --git a/deps/cares/src/ares_library_init.c b/deps/cares/src/ares_library_init.c index 9114f62614b9b1..c2bfb093e2203b 100644 --- a/deps/cares/src/ares_library_init.c +++ b/deps/cares/src/ares_library_init.c @@ -34,6 +34,11 @@ fpGetAdaptersAddresses_t ares_fpGetAdaptersAddresses = ZERO_NULL; static unsigned int ares_initialized; static int ares_init_flags; +/* library-private global vars with visibility across the whole library */ +void *(*ares_malloc)(size_t size) = malloc; +void *(*ares_realloc)(void *ptr, size_t size) = realloc; +void (*ares_free)(void *ptr) = free; + #ifdef USE_WINSOCK static HMODULE hnd_iphlpapi; static HMODULE hnd_advapi32; @@ -111,7 +116,7 @@ int ares_library_init(int flags) { res = ares_win32_init(); if (res != ARES_SUCCESS) - return res; + return res; /* LCOV_EXCL_LINE: can't test Win32 init failure */ } ares_init_flags = flags; @@ -119,6 +124,20 @@ int ares_library_init(int flags) return ARES_SUCCESS; } +int ares_library_init_mem(int flags, + void *(*amalloc)(size_t size), + void (*afree)(void *ptr), + void *(*arealloc)(void *ptr, size_t size)) +{ + if (amalloc) + ares_malloc = amalloc; + if (arealloc) + ares_realloc = arealloc; + if (afree) + ares_free = afree; + return ares_library_init(flags); +} + void ares_library_cleanup(void) { @@ -132,6 +151,8 @@ void ares_library_cleanup(void) ares_win32_cleanup(); ares_init_flags = ARES_LIB_INIT_NONE; + ares_malloc = malloc; + ares_free = free; } diff --git a/deps/cares/src/ares_options.c b/deps/cares/src/ares_options.c index cf88433a1b5ae4..c3cbd1df707566 100644 --- a/deps/cares/src/ares_options.c +++ b/deps/cares/src/ares_options.c @@ -83,6 +83,62 @@ int ares_get_servers(ares_channel channel, return status; } +int ares_get_servers_ports(ares_channel channel, + struct ares_addr_port_node **servers) +{ + struct ares_addr_port_node *srvr_head = NULL; + struct ares_addr_port_node *srvr_last = NULL; + struct ares_addr_port_node *srvr_curr; + int status = ARES_SUCCESS; + int i; + + if (!channel) + return ARES_ENODATA; + + for (i = 0; i < channel->nservers; i++) + { + /* Allocate storage for this server node appending it to the list */ + srvr_curr = ares_malloc_data(ARES_DATATYPE_ADDR_PORT_NODE); + if (!srvr_curr) + { + status = ARES_ENOMEM; + break; + } + if (srvr_last) + { + srvr_last->next = srvr_curr; + } + else + { + srvr_head = srvr_curr; + } + srvr_last = srvr_curr; + + /* Fill this server node data */ + srvr_curr->family = channel->servers[i].addr.family; + srvr_curr->udp_port = ntohs((unsigned short)channel->servers[i].addr.udp_port); + srvr_curr->tcp_port = ntohs((unsigned short)channel->servers[i].addr.tcp_port); + if (srvr_curr->family == AF_INET) + memcpy(&srvr_curr->addrV4, &channel->servers[i].addr.addrV4, + sizeof(srvr_curr->addrV4)); + else + memcpy(&srvr_curr->addrV6, &channel->servers[i].addr.addrV6, + sizeof(srvr_curr->addrV6)); + } + + if (status != ARES_SUCCESS) + { + if (srvr_head) + { + ares_free_data(srvr_head); + srvr_head = NULL; + } + } + + *servers = srvr_head; + + return status; +} int ares_set_servers(ares_channel channel, struct ares_addr_node *servers) @@ -92,7 +148,56 @@ int ares_set_servers(ares_channel channel, int i; if (ares_library_initialized() != ARES_SUCCESS) - return ARES_ENOTINITIALIZED; + return ARES_ENOTINITIALIZED; /* LCOV_EXCL_LINE: n/a on non-WinSock */ + + if (!channel) + return ARES_ENODATA; + + ares__destroy_servers_state(channel); + + for (srvr = servers; srvr; srvr = srvr->next) + { + num_srvrs++; + } + + if (num_srvrs > 0) + { + /* Allocate storage for servers state */ + channel->servers = ares_malloc(num_srvrs * sizeof(struct server_state)); + if (!channel->servers) + { + return ARES_ENOMEM; + } + channel->nservers = num_srvrs; + /* Fill servers state address data */ + for (i = 0, srvr = servers; srvr; i++, srvr = srvr->next) + { + channel->servers[i].addr.family = srvr->family; + channel->servers[i].addr.udp_port = 0; + channel->servers[i].addr.tcp_port = 0; + if (srvr->family == AF_INET) + memcpy(&channel->servers[i].addr.addrV4, &srvr->addrV4, + sizeof(srvr->addrV4)); + else + memcpy(&channel->servers[i].addr.addrV6, &srvr->addrV6, + sizeof(srvr->addrV6)); + } + /* Initialize servers state remaining data */ + ares__init_servers_state(channel); + } + + return ARES_SUCCESS; +} + +int ares_set_servers_ports(ares_channel channel, + struct ares_addr_port_node *servers) +{ + struct ares_addr_port_node *srvr; + int num_srvrs = 0; + int i; + + if (ares_library_initialized() != ARES_SUCCESS) + return ARES_ENOTINITIALIZED; /* LCOV_EXCL_LINE: n/a on non-WinSock */ if (!channel) return ARES_ENODATA; @@ -107,7 +212,7 @@ int ares_set_servers(ares_channel channel, if (num_srvrs > 0) { /* Allocate storage for servers state */ - channel->servers = malloc(num_srvrs * sizeof(struct server_state)); + channel->servers = ares_malloc(num_srvrs * sizeof(struct server_state)); if (!channel->servers) { return ARES_ENOMEM; @@ -117,6 +222,8 @@ int ares_set_servers(ares_channel channel, for (i = 0, srvr = servers; srvr; i++, srvr = srvr->next) { channel->servers[i].addr.family = srvr->family; + channel->servers[i].addr.udp_port = htons((unsigned short)srvr->udp_port); + channel->servers[i].addr.tcp_port = htons((unsigned short)srvr->tcp_port); if (srvr->family == AF_INET) memcpy(&channel->servers[i].addr.addrV4, &srvr->addrV4, sizeof(srvr->addrV4)); @@ -133,8 +240,8 @@ int ares_set_servers(ares_channel channel, /* Incomming string format: host[:port][,host[:port]]... */ /* IPv6 addresses with ports require square brackets [fe80::1%lo0]:53 */ -int ares_set_servers_csv(ares_channel channel, - const char* _csv) +static int set_servers_csv(ares_channel channel, + const char* _csv, int use_port) { size_t i; char* csv = NULL; @@ -142,11 +249,11 @@ int ares_set_servers_csv(ares_channel channel, char* start_host; int cc = 0; int rv = ARES_SUCCESS; - struct ares_addr_node *servers = NULL; - struct ares_addr_node *last = NULL; + struct ares_addr_port_node *servers = NULL; + struct ares_addr_port_node *last = NULL; if (ares_library_initialized() != ARES_SUCCESS) - return ARES_ENOTINITIALIZED; + return ARES_ENOTINITIALIZED; /* LCOV_EXCL_LINE: n/a on non-WinSock */ if (!channel) return ARES_ENODATA; @@ -157,7 +264,7 @@ int ares_set_servers_csv(ares_channel channel, if (i == 0) return ARES_SUCCESS; /* blank all servers */ - csv = malloc(i + 2); + csv = ares_malloc(i + 2); if (!csv) return ARES_ENOMEM; @@ -182,9 +289,10 @@ int ares_set_servers_csv(ares_channel channel, else if (*ptr == ',') { char* pp = ptr - 1; char* p = ptr; + int port = 0; struct in_addr in4; struct ares_in6_addr in6; - struct ares_addr_node *s = NULL; + struct ares_addr_port_node *s = NULL; *ptr = 0; /* null terminate host:port string */ /* Got an entry..see if the port was specified. */ @@ -213,7 +321,7 @@ int ares_set_servers_csv(ares_channel channel, if (*pp == ']') p++; /* move p before ':' */ /* p will point to the start of the port */ - (void)strtol(p, NULL, 10); + port = (int)strtol(p, NULL, 10); *pp = 0; /* null terminate host */ } } @@ -227,7 +335,7 @@ int ares_set_servers_csv(ares_channel channel, goto out; } /* was ipv6, add new server */ - s = malloc(sizeof(*s)); + s = ares_malloc(sizeof(*s)); if (!s) { rv = ARES_ENOMEM; goto out; @@ -237,7 +345,7 @@ int ares_set_servers_csv(ares_channel channel, } else { /* was ipv4, add new server */ - s = malloc(sizeof(*s)); + s = ares_malloc(sizeof(*s)); if (!s) { rv = ARES_ENOMEM; goto out; @@ -246,8 +354,8 @@ int ares_set_servers_csv(ares_channel channel, memcpy(&s->addr, &in4, sizeof(struct in_addr)); } if (s) { - /* TODO: Add port to ares_addr_node and assign it here. */ - + s->udp_port = use_port ? port: 0; + s->tcp_port = s->udp_port; s->next = NULL; if (last) { last->next = s; @@ -266,16 +374,29 @@ int ares_set_servers_csv(ares_channel channel, } } - rv = ares_set_servers(channel, servers); + rv = ares_set_servers_ports(channel, servers); out: if (csv) - free(csv); + ares_free(csv); while (servers) { - struct ares_addr_node *s = servers; + struct ares_addr_port_node *s = servers; servers = servers->next; - free(s); + ares_free(s); } return rv; } + +int ares_set_servers_csv(ares_channel channel, + const char* _csv) +{ + return set_servers_csv(channel, _csv, FALSE); +} + +int ares_set_servers_ports_csv(ares_channel channel, + const char* _csv) +{ + return set_servers_csv(channel, _csv, TRUE); +} + diff --git a/deps/cares/src/ares_parse_a_reply.c b/deps/cares/src/ares_parse_a_reply.c index a3ed69e1e9ef84..0422bd3828a765 100644 --- a/deps/cares/src/ares_parse_a_reply.c +++ b/deps/cares/src/ares_parse_a_reply.c @@ -85,7 +85,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen, return status; if (aptr + len + QFIXEDSZ > abuf + alen) { - free(hostname); + ares_free(hostname); return ARES_EBADRESP; } aptr += len + QFIXEDSZ; @@ -94,17 +94,17 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen, { /* Allocate addresses and aliases; ancount gives an upper bound for both. */ - addrs = malloc(ancount * sizeof(struct in_addr)); + addrs = ares_malloc(ancount * sizeof(struct in_addr)); if (!addrs) { - free(hostname); + ares_free(hostname); return ARES_ENOMEM; } - aliases = malloc((ancount + 1) * sizeof(char *)); + aliases = ares_malloc((ancount + 1) * sizeof(char *)); if (!aliases) { - free(hostname); - free(addrs); + ares_free(hostname); + ares_free(addrs); return ARES_ENOMEM; } } @@ -127,7 +127,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen, aptr += len; if (aptr + RRFIXEDSZ > abuf + alen) { - free(rr_name); + ares_free(rr_name); status = ARES_EBADRESP; break; } @@ -138,7 +138,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen, aptr += RRFIXEDSZ; if (aptr + rr_len > abuf + alen) { - free(rr_name); + ares_free(rr_name); status = ARES_EBADRESP; break; } @@ -150,22 +150,22 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen, if (addrs) { if (aptr + sizeof(struct in_addr) > abuf + alen) - { - free(rr_name); + { /* LCOV_EXCL_START: already checked above */ + ares_free(rr_name); status = ARES_EBADRESP; break; - } + } /* LCOV_EXCL_STOP */ memcpy(&addrs[naddrs], aptr, sizeof(struct in_addr)); } if (naddrs < max_addr_ttls) { struct ares_addrttl * const at = &addrttls[naddrs]; if (aptr + sizeof(struct in_addr) > abuf + alen) - { - free(rr_name); + { /* LCOV_EXCL_START: already checked above */ + ares_free(rr_name); status = ARES_EBADRESP; break; - } + } /* LCOV_EXCL_STOP */ memcpy(&at->ipaddr, aptr, sizeof(struct in_addr)); at->ttl = rr_ttl; } @@ -179,7 +179,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen, if (aliases) aliases[naliases] = rr_name; else - free(rr_name); + ares_free(rr_name); naliases++; /* Decode the RR data and replace the hostname with it. */ @@ -187,7 +187,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen, &len); if (status != ARES_SUCCESS) break; - free(hostname); + ares_free(hostname); hostname = rr_data; /* Take the min of the TTLs we see in the CNAME chain. */ @@ -195,14 +195,14 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen, cname_ttl = rr_ttl; } else - free(rr_name); + ares_free(rr_name); aptr += rr_len; if (aptr > abuf + alen) - { + { /* LCOV_EXCL_START: already checked above */ status = ARES_EBADRESP; break; - } + } /* LCOV_EXCL_STOP */ } if (status == ARES_SUCCESS && naddrs == 0 && naliases == 0) @@ -228,10 +228,10 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen, if (host) { /* Allocate memory to build the host entry. */ - hostent = malloc(sizeof(struct hostent)); + hostent = ares_malloc(sizeof(struct hostent)); if (hostent) { - hostent->h_addr_list = malloc((naddrs + 1) * sizeof(char *)); + hostent->h_addr_list = ares_malloc((naddrs + 1) * sizeof(char *)); if (hostent->h_addr_list) { /* Fill in the hostent and return successfully. */ @@ -243,11 +243,11 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen, hostent->h_addr_list[i] = (char *) &addrs[i]; hostent->h_addr_list[naddrs] = NULL; if (!naddrs && addrs) - free(addrs); + ares_free(addrs); *host = hostent; return ARES_SUCCESS; } - free(hostent); + ares_free(hostent); } status = ARES_ENOMEM; } @@ -255,10 +255,10 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen, if (aliases) { for (i = 0; i < naliases; i++) - free(aliases[i]); - free(aliases); + ares_free(aliases[i]); + ares_free(aliases); } - free(addrs); - free(hostname); + ares_free(addrs); + ares_free(hostname); return status; } diff --git a/deps/cares/src/ares_parse_aaaa_reply.c b/deps/cares/src/ares_parse_aaaa_reply.c index 31e4a8c37502ea..5b38bb571e1d65 100644 --- a/deps/cares/src/ares_parse_aaaa_reply.c +++ b/deps/cares/src/ares_parse_aaaa_reply.c @@ -87,7 +87,7 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, return status; if (aptr + len + QFIXEDSZ > abuf + alen) { - free(hostname); + ares_free(hostname); return ARES_EBADRESP; } aptr += len + QFIXEDSZ; @@ -95,17 +95,17 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, /* Allocate addresses and aliases; ancount gives an upper bound for both. */ if (host) { - addrs = malloc(ancount * sizeof(struct ares_in6_addr)); + addrs = ares_malloc(ancount * sizeof(struct ares_in6_addr)); if (!addrs) { - free(hostname); + ares_free(hostname); return ARES_ENOMEM; } - aliases = malloc((ancount + 1) * sizeof(char *)); + aliases = ares_malloc((ancount + 1) * sizeof(char *)); if (!aliases) { - free(hostname); - free(addrs); + ares_free(hostname); + ares_free(addrs); return ARES_ENOMEM; } } @@ -127,7 +127,7 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, aptr += len; if (aptr + RRFIXEDSZ > abuf + alen) { - free(rr_name); + ares_free(rr_name); status = ARES_EBADRESP; break; } @@ -138,7 +138,7 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, aptr += RRFIXEDSZ; if (aptr + rr_len > abuf + alen) { - free(rr_name); + ares_free(rr_name); status = ARES_EBADRESP; break; } @@ -150,22 +150,22 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, if (addrs) { if (aptr + sizeof(struct ares_in6_addr) > abuf + alen) - { - free(rr_name); + { /* LCOV_EXCL_START: already checked above */ + ares_free(rr_name); status = ARES_EBADRESP; break; - } + } /* LCOV_EXCL_STOP */ memcpy(&addrs[naddrs], aptr, sizeof(struct ares_in6_addr)); } if (naddrs < max_addr_ttls) { struct ares_addr6ttl * const at = &addrttls[naddrs]; if (aptr + sizeof(struct ares_in6_addr) > abuf + alen) - { - free(rr_name); + { /* LCOV_EXCL_START: already checked above */ + ares_free(rr_name); status = ARES_EBADRESP; break; - } + } /* LCOV_EXCL_STOP */ memcpy(&at->ip6addr, aptr, sizeof(struct ares_in6_addr)); at->ttl = rr_ttl; } @@ -179,7 +179,7 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, if (aliases) aliases[naliases] = rr_name; else - free(rr_name); + ares_free(rr_name); naliases++; /* Decode the RR data and replace the hostname with it. */ @@ -187,7 +187,7 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, &len); if (status != ARES_SUCCESS) break; - free(hostname); + ares_free(hostname); hostname = rr_data; /* Take the min of the TTLs we see in the CNAME chain. */ @@ -195,14 +195,14 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, cname_ttl = rr_ttl; } else - free(rr_name); + ares_free(rr_name); aptr += rr_len; if (aptr > abuf + alen) - { + { /* LCOV_EXCL_START: already checked above */ status = ARES_EBADRESP; break; - } + } /* LCOV_EXCL_STOP */ } /* the check for naliases to be zero is to make sure CNAME responses @@ -228,10 +228,10 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, if (host) { /* Allocate memory to build the host entry. */ - hostent = malloc(sizeof(struct hostent)); + hostent = ares_malloc(sizeof(struct hostent)); if (hostent) { - hostent->h_addr_list = malloc((naddrs + 1) * sizeof(char *)); + hostent->h_addr_list = ares_malloc((naddrs + 1) * sizeof(char *)); if (hostent->h_addr_list) { /* Fill in the hostent and return successfully. */ @@ -243,11 +243,11 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, hostent->h_addr_list[i] = (char *) &addrs[i]; hostent->h_addr_list[naddrs] = NULL; if (!naddrs && addrs) - free(addrs); + ares_free(addrs); *host = hostent; return ARES_SUCCESS; } - free(hostent); + ares_free(hostent); } status = ARES_ENOMEM; } @@ -255,10 +255,10 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, if (aliases) { for (i = 0; i < naliases; i++) - free(aliases[i]); - free(aliases); + ares_free(aliases[i]); + ares_free(aliases); } - free(addrs); - free(hostname); + ares_free(addrs); + ares_free(hostname); return status; } diff --git a/deps/cares/src/ares_parse_mx_reply.c b/deps/cares/src/ares_parse_mx_reply.c index 95400dd317412e..e6336473e0ad79 100644 --- a/deps/cares/src/ares_parse_mx_reply.c +++ b/deps/cares/src/ares_parse_mx_reply.c @@ -76,7 +76,7 @@ ares_parse_mx_reply (const unsigned char *abuf, int alen, if (aptr + len + QFIXEDSZ > abuf + alen) { - free (hostname); + ares_free (hostname); return ARES_EBADRESP; } aptr += len + QFIXEDSZ; @@ -143,7 +143,7 @@ ares_parse_mx_reply (const unsigned char *abuf, int alen, } /* Don't lose memory in the next iteration */ - free (rr_name); + ares_free (rr_name); rr_name = NULL; /* Move on to the next record */ @@ -151,9 +151,9 @@ ares_parse_mx_reply (const unsigned char *abuf, int alen, } if (hostname) - free (hostname); + ares_free (hostname); if (rr_name) - free (rr_name); + ares_free (rr_name); /* clean up on error */ if (status != ARES_SUCCESS) diff --git a/deps/cares/src/ares_parse_naptr_reply.c b/deps/cares/src/ares_parse_naptr_reply.c index 4935366478fa2d..11634df9847cc9 100644 --- a/deps/cares/src/ares_parse_naptr_reply.c +++ b/deps/cares/src/ares_parse_naptr_reply.c @@ -81,7 +81,7 @@ ares_parse_naptr_reply (const unsigned char *abuf, int alen, if (aptr + len + QFIXEDSZ > abuf + alen) { - free (hostname); + ares_free (hostname); return ARES_EBADRESP; } aptr += len + QFIXEDSZ; @@ -160,7 +160,7 @@ ares_parse_naptr_reply (const unsigned char *abuf, int alen, } /* Don't lose memory in the next iteration */ - free (rr_name); + ares_free (rr_name); rr_name = NULL; /* Move on to the next record */ @@ -168,9 +168,9 @@ ares_parse_naptr_reply (const unsigned char *abuf, int alen, } if (hostname) - free (hostname); + ares_free (hostname); if (rr_name) - free (rr_name); + ares_free (rr_name); /* clean up on error */ if (status != ARES_SUCCESS) diff --git a/deps/cares/src/ares_parse_ns_reply.c b/deps/cares/src/ares_parse_ns_reply.c index d331e67d5ff868..7bb51429db0049 100644 --- a/deps/cares/src/ares_parse_ns_reply.c +++ b/deps/cares/src/ares_parse_ns_reply.c @@ -73,16 +73,16 @@ int ares_parse_ns_reply( const unsigned char* abuf, int alen, return status; if ( aptr + len + QFIXEDSZ > abuf + alen ) { - free( hostname ); + ares_free( hostname ); return ARES_EBADRESP; } aptr += len + QFIXEDSZ; /* Allocate nameservers array; ancount gives an upper bound */ - nameservers = malloc( ( ancount + 1 ) * sizeof( char * ) ); + nameservers = ares_malloc( ( ancount + 1 ) * sizeof( char * ) ); if ( !nameservers ) { - free( hostname ); + ares_free( hostname ); return ARES_ENOMEM; } nameservers_num = 0; @@ -98,7 +98,7 @@ int ares_parse_ns_reply( const unsigned char* abuf, int alen, if ( aptr + RRFIXEDSZ > abuf + alen ) { status = ARES_EBADRESP; - free(rr_name); + ares_free(rr_name); break; } rr_type = DNS_RR_TYPE( aptr ); @@ -107,7 +107,7 @@ int ares_parse_ns_reply( const unsigned char* abuf, int alen, aptr += RRFIXEDSZ; if (aptr + rr_len > abuf + alen) { - free(rr_name); + ares_free(rr_name); status = ARES_EBADRESP; break; } @@ -119,33 +119,33 @@ int ares_parse_ns_reply( const unsigned char* abuf, int alen, &len); if ( status != ARES_SUCCESS ) { - free(rr_name); + ares_free(rr_name); break; } - nameservers[nameservers_num] = malloc(strlen(rr_data)+1); + nameservers[nameservers_num] = ares_malloc(strlen(rr_data)+1); if (nameservers[nameservers_num]==NULL) { - free(rr_name); - free(rr_data); + ares_free(rr_name); + ares_free(rr_data); status=ARES_ENOMEM; break; } strcpy(nameservers[nameservers_num],rr_data); - free(rr_data); + ares_free(rr_data); nameservers_num++; } - free( rr_name ); + ares_free( rr_name ); aptr += rr_len; if ( aptr > abuf + alen ) - { + { /* LCOV_EXCL_START: already checked above */ status = ARES_EBADRESP; break; - } + } /* LCOV_EXCL_STOP */ } if ( status == ARES_SUCCESS && nameservers_num == 0 ) @@ -156,10 +156,10 @@ int ares_parse_ns_reply( const unsigned char* abuf, int alen, { /* We got our answer. Allocate memory to build the host entry. */ nameservers[nameservers_num] = NULL; - hostent = malloc( sizeof( struct hostent ) ); + hostent = ares_malloc( sizeof( struct hostent ) ); if ( hostent ) { - hostent->h_addr_list = malloc( 1 * sizeof( char * ) ); + hostent->h_addr_list = ares_malloc( 1 * sizeof( char * ) ); if ( hostent->h_addr_list ) { /* Fill in the hostent and return successfully. */ @@ -171,13 +171,13 @@ int ares_parse_ns_reply( const unsigned char* abuf, int alen, *host = hostent; return ARES_SUCCESS; } - free( hostent ); + ares_free( hostent ); } status = ARES_ENOMEM; } for ( i = 0; i < nameservers_num; i++ ) - free( nameservers[i] ); - free( nameservers ); - free( hostname ); + ares_free( nameservers[i] ); + ares_free( nameservers ); + ares_free( hostname ); return status; } diff --git a/deps/cares/src/ares_parse_ptr_reply.c b/deps/cares/src/ares_parse_ptr_reply.c index df21e40dc1c83d..976a5311a24d79 100644 --- a/deps/cares/src/ares_parse_ptr_reply.c +++ b/deps/cares/src/ares_parse_ptr_reply.c @@ -73,17 +73,17 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr, return status; if (aptr + len + QFIXEDSZ > abuf + alen) { - free(ptrname); + ares_free(ptrname); return ARES_EBADRESP; } aptr += len + QFIXEDSZ; /* Examine each answer resource record (RR) in turn. */ hostname = NULL; - aliases = malloc(alias_alloc * sizeof(char *)); + aliases = ares_malloc(alias_alloc * sizeof(char *)); if (!aliases) { - free(ptrname); + ares_free(ptrname); return ARES_ENOMEM; } for (i = 0; i < (int)ancount; i++) @@ -95,7 +95,7 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr, aptr += len; if (aptr + RRFIXEDSZ > abuf + alen) { - free(rr_name); + ares_free(rr_name); status = ARES_EBADRESP; break; } @@ -105,7 +105,7 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr, aptr += RRFIXEDSZ; if (aptr + rr_len > abuf + alen) { - free(rr_name); + ares_free(rr_name); status = ARES_EBADRESP; break; } @@ -118,16 +118,16 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr, &len); if (status != ARES_SUCCESS) { - free(rr_name); + ares_free(rr_name); break; } if (hostname) - free(hostname); + ares_free(hostname); hostname = rr_data; - aliases[aliascnt] = malloc((strlen(rr_data)+1) * sizeof(char)); + aliases[aliascnt] = ares_malloc((strlen(rr_data)+1) * sizeof(char)); if (!aliases[aliascnt]) { - free(rr_name); + ares_free(rr_name); status = ARES_ENOMEM; break; } @@ -136,9 +136,9 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr, if (aliascnt >= alias_alloc) { char **ptr; alias_alloc *= 2; - ptr = realloc(aliases, alias_alloc * sizeof(char *)); + ptr = ares_realloc(aliases, alias_alloc * sizeof(char *)); if(!ptr) { - free(rr_name); + ares_free(rr_name); status = ARES_ENOMEM; break; } @@ -153,20 +153,20 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr, &len); if (status != ARES_SUCCESS) { - free(rr_name); + ares_free(rr_name); break; } - free(ptrname); + ares_free(ptrname); ptrname = rr_data; } - free(rr_name); + ares_free(rr_name); aptr += rr_len; if (aptr > abuf + alen) - { + { /* LCOV_EXCL_START: already checked above */ status = ARES_EBADRESP; break; - } + } /* LCOV_EXCL_STOP */ } if (status == ARES_SUCCESS && !hostname) @@ -174,16 +174,16 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr, if (status == ARES_SUCCESS) { /* We got our answer. Allocate memory to build the host entry. */ - hostent = malloc(sizeof(struct hostent)); + hostent = ares_malloc(sizeof(struct hostent)); if (hostent) { - hostent->h_addr_list = malloc(2 * sizeof(char *)); + hostent->h_addr_list = ares_malloc(2 * sizeof(char *)); if (hostent->h_addr_list) { - hostent->h_addr_list[0] = malloc(addrlen); + hostent->h_addr_list[0] = ares_malloc(addrlen); if (hostent->h_addr_list[0]) { - hostent->h_aliases = malloc((aliascnt+1) * sizeof (char *)); + hostent->h_aliases = ares_malloc((aliascnt+1) * sizeof (char *)); if (hostent->h_aliases) { /* Fill in the hostent and return successfully. */ @@ -196,24 +196,24 @@ int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr, memcpy(hostent->h_addr_list[0], addr, addrlen); hostent->h_addr_list[1] = NULL; *host = hostent; - free(aliases); - free(ptrname); + ares_free(aliases); + ares_free(ptrname); return ARES_SUCCESS; } - free(hostent->h_addr_list[0]); + ares_free(hostent->h_addr_list[0]); } - free(hostent->h_addr_list); + ares_free(hostent->h_addr_list); } - free(hostent); + ares_free(hostent); } status = ARES_ENOMEM; } for (i=0 ; iexpire = DNS__32BIT(aptr + 3 * 4); soa->minttl = DNS__32BIT(aptr + 4 * 4); - free(qname); - free(rr_name); + ares_free(qname); + ares_free(rr_name); *soa_out = soa; @@ -125,9 +125,9 @@ ares_parse_soa_reply(const unsigned char *abuf, int alen, failed_stat: ares_free_data(soa); if (qname) - free(qname); + ares_free(qname); if (rr_name) - free(rr_name); + ares_free(rr_name); return status; } diff --git a/deps/cares/src/ares_parse_srv_reply.c b/deps/cares/src/ares_parse_srv_reply.c index 0739c276847b5f..824ff3aedf04d6 100644 --- a/deps/cares/src/ares_parse_srv_reply.c +++ b/deps/cares/src/ares_parse_srv_reply.c @@ -81,7 +81,7 @@ ares_parse_srv_reply (const unsigned char *abuf, int alen, if (aptr + len + QFIXEDSZ > abuf + alen) { - free (hostname); + ares_free (hostname); return ARES_EBADRESP; } aptr += len + QFIXEDSZ; @@ -152,7 +152,7 @@ ares_parse_srv_reply (const unsigned char *abuf, int alen, } /* Don't lose memory in the next iteration */ - free (rr_name); + ares_free (rr_name); rr_name = NULL; /* Move on to the next record */ @@ -160,9 +160,9 @@ ares_parse_srv_reply (const unsigned char *abuf, int alen, } if (hostname) - free (hostname); + ares_free (hostname); if (rr_name) - free (rr_name); + ares_free (rr_name); /* clean up on error */ if (status != ARES_SUCCESS) diff --git a/deps/cares/src/ares_parse_txt_reply.c b/deps/cares/src/ares_parse_txt_reply.c index dabf73cd3f7998..4856b4cea31f9f 100644 --- a/deps/cares/src/ares_parse_txt_reply.c +++ b/deps/cares/src/ares_parse_txt_reply.c @@ -44,9 +44,9 @@ #include "ares_data.h" #include "ares_private.h" -int -ares_parse_txt_reply (const unsigned char *abuf, int alen, - struct ares_txt_reply **txt_out) +static int +ares__parse_txt_reply (const unsigned char *abuf, int alen, + int ex, void **txt_out) { size_t substr_len; unsigned int qdcount, ancount, i; @@ -55,9 +55,9 @@ ares_parse_txt_reply (const unsigned char *abuf, int alen, int status, rr_type, rr_class, rr_len; long len; char *hostname = NULL, *rr_name = NULL; - struct ares_txt_reply *txt_head = NULL; - struct ares_txt_reply *txt_last = NULL; - struct ares_txt_reply *txt_curr; + struct ares_txt_ext *txt_head = NULL; + struct ares_txt_ext *txt_last = NULL; + struct ares_txt_ext *txt_curr; /* Set *txt_out to NULL for all failure cases. */ *txt_out = NULL; @@ -82,7 +82,7 @@ ares_parse_txt_reply (const unsigned char *abuf, int alen, if (aptr + len + QFIXEDSZ > abuf + alen) { - free (hostname); + ares_free (hostname); return ARES_EBADRESP; } aptr += len + QFIXEDSZ; @@ -134,7 +134,8 @@ ares_parse_txt_reply (const unsigned char *abuf, int alen, } /* Allocate storage for this TXT answer appending it to the list */ - txt_curr = ares_malloc_data(ARES_DATATYPE_TXT_REPLY); + txt_curr = ares_malloc_data(ex ? ARES_DATATYPE_TXT_EXT : + ARES_DATATYPE_TXT_REPLY); if (!txt_curr) { status = ARES_ENOMEM; @@ -150,9 +151,10 @@ ares_parse_txt_reply (const unsigned char *abuf, int alen, } txt_last = txt_curr; - txt_curr->record_start = strptr == aptr; + if (ex) + txt_curr->record_start = (strptr == aptr); txt_curr->length = substr_len; - txt_curr->txt = malloc (substr_len + 1/* Including null byte */); + txt_curr->txt = ares_malloc (substr_len + 1/* Including null byte */); if (txt_curr->txt == NULL) { status = ARES_ENOMEM; @@ -169,8 +171,14 @@ ares_parse_txt_reply (const unsigned char *abuf, int alen, } } + /* Propagate any failures */ + if (status != ARES_SUCCESS) + { + break; + } + /* Don't lose memory in the next iteration */ - free (rr_name); + ares_free (rr_name); rr_name = NULL; /* Move on to the next record */ @@ -178,9 +186,9 @@ ares_parse_txt_reply (const unsigned char *abuf, int alen, } if (hostname) - free (hostname); + ares_free (hostname); if (rr_name) - free (rr_name); + ares_free (rr_name); /* clean up on error */ if (status != ARES_SUCCESS) @@ -195,3 +203,18 @@ ares_parse_txt_reply (const unsigned char *abuf, int alen, return ARES_SUCCESS; } + +int +ares_parse_txt_reply (const unsigned char *abuf, int alen, + struct ares_txt_reply **txt_out) +{ + return ares__parse_txt_reply(abuf, alen, 0, (void **) txt_out); +} + + +int +ares_parse_txt_reply_ext (const unsigned char *abuf, int alen, + struct ares_txt_ext **txt_out) +{ + return ares__parse_txt_reply(abuf, alen, 1, (void **) txt_out); +} diff --git a/deps/cares/src/ares_private.h b/deps/cares/src/ares_private.h index 8f486a449a8ae2..45f34ab72da971 100644 --- a/deps/cares/src/ares_private.h +++ b/deps/cares/src/ares_private.h @@ -43,6 +43,13 @@ #define INADDR_NONE 0xffffffff #endif +#ifdef CARES_EXPOSE_STATICS +/* Make some internal functions visible for testing */ +#define STATIC_TESTABLE +#else +#define STATIC_TESTABLE static +#endif + #if defined(WIN32) && !defined(WATT32) #define WIN_NS_9X "System\\CurrentControlSet\\Services\\VxD\\MSTCP" @@ -86,10 +93,7 @@ # define getenv(ptr) ares_getenv(ptr) #endif -#ifndef HAVE_STRDUP -# include "ares_strdup.h" -# define strdup(ptr) ares_strdup(ptr) -#endif +#include "ares_strdup.h" #ifndef HAVE_STRCASECMP # include "ares_strcasecmp.h" @@ -119,6 +123,8 @@ struct ares_addr { struct in_addr addr4; struct ares_in6_addr addr6; } addr; + int udp_port; /* stored in network order */ + int tcp_port; /* stored in network order */ }; #define addrV4 addr.addr4 #define addrV6 addr.addr6 @@ -251,8 +257,8 @@ struct ares_channeldata { int tries; int ndots; int rotate; /* if true, all servers specified are used */ - int udp_port; - int tcp_port; + int udp_port; /* stored in network order */ + int tcp_port; /* stored in network order */ int socket_send_buffer_size; int socket_receive_buffer_size; char **domains; @@ -307,12 +313,15 @@ struct ares_channeldata { void *sock_create_cb_data; }; +/* Memory management functions */ +extern void *(*ares_malloc)(size_t size); +extern void *(*ares_realloc)(void *ptr, size_t size); +extern void (*ares_free)(void *ptr); + /* return true if now is exactly check time or later */ int ares__timedout(struct timeval *now, struct timeval *check); -/* returns ARES_SUCCESS if library has been initialized */ -int ares_library_initialized(void); void ares__send_query(ares_channel channel, struct query *query, struct timeval *now); void ares__close_sockets(ares_channel channel, struct server_state *server); diff --git a/deps/cares/src/ares_process.c b/deps/cares/src/ares_process.c index 020a1319e55ea4..c3ac77b00e376f 100644 --- a/deps/cares/src/ares_process.c +++ b/deps/cares/src/ares_process.c @@ -1,6 +1,6 @@ /* Copyright 1998 by the Massachusetts Institute of Technology. - * Copyright (C) 2004-2013 by Daniel Stenberg + * Copyright (C) 2004-2016 by Daniel Stenberg * * Permission to use, copy, modify, and distribute this * software and its documentation for any purpose and without @@ -227,7 +227,7 @@ static void write_tcp_data(ares_channel channel, n++; /* Allocate iovecs so we can send all our data at once. */ - vec = malloc(n * sizeof(struct iovec)); + vec = ares_malloc(n * sizeof(struct iovec)); if (vec) { /* Fill in the iovecs and send. */ @@ -239,7 +239,7 @@ static void write_tcp_data(ares_channel channel, n++; } wcount = (ssize_t)writev(server->tcp_socket, vec, (int)n); - free(vec); + ares_free(vec); if (wcount < 0) { if (!try_again(SOCKERRNO)) @@ -281,8 +281,8 @@ static void advance_tcp_send_queue(ares_channel channel, int whichserver, num_bytes -= sendreq->len; server->qhead = sendreq->next; if (sendreq->data_storage) - free(sendreq->data_storage); - free(sendreq); + ares_free(sendreq->data_storage); + ares_free(sendreq); if (server->qhead == NULL) { SOCK_STATE_CALLBACK(channel, server->tcp_socket, 1, 0); server->qtail = NULL; @@ -361,9 +361,12 @@ static void read_tcp_data(ares_channel channel, fd_set *read_fds, */ server->tcp_length = server->tcp_lenbuf[0] << 8 | server->tcp_lenbuf[1]; - server->tcp_buffer = malloc(server->tcp_length); - if (!server->tcp_buffer) + server->tcp_buffer = ares_malloc(server->tcp_length); + if (!server->tcp_buffer) { handle_error(channel, i, now); + return; /* bail out on malloc failure. TODO: make this + function return error codes */ + } server->tcp_buffer_pos = 0; } } @@ -388,8 +391,8 @@ static void read_tcp_data(ares_channel channel, fd_set *read_fds, */ process_answer(channel, server->tcp_buffer, server->tcp_length, i, 1, now); - if (server->tcp_buffer) - free(server->tcp_buffer); + if (server->tcp_buffer) + ares_free(server->tcp_buffer); server->tcp_buffer = NULL; server->tcp_lenbuf_pos = 0; server->tcp_buffer_pos = 0; @@ -563,14 +566,15 @@ static void process_answer(ares_channel channel, unsigned char *abuf, packetsz = channel->ednspsz; if (rcode == NOTIMP || rcode == FORMERR || rcode == SERVFAIL) { - int qlen = alen - EDNSFIXEDSZ; + int qlen = (query->tcplen - 2) - EDNSFIXEDSZ; channel->flags ^= ARES_FLAG_EDNS; query->tcplen -= EDNSFIXEDSZ; query->qlen -= EDNSFIXEDSZ; query->tcpbuf[0] = (unsigned char)((qlen >> 8) & 0xff); query->tcpbuf[1] = (unsigned char)(qlen & 0xff); DNS_HEADER_SET_ARCOUNT(query->tcpbuf + 2, 0); - query->tcpbuf = realloc(query->tcpbuf, query->tcplen); + query->tcpbuf = ares_realloc(query->tcpbuf, query->tcplen); + query->qbuf = query->tcpbuf + 2; ares__send_query(channel, query, now); return; } @@ -769,12 +773,13 @@ void ares__send_query(ares_channel channel, struct query *query, return; } } - sendreq = calloc(1, sizeof(struct send_request)); + sendreq = ares_malloc(sizeof(struct send_request)); if (!sendreq) { end_query(channel, query, ARES_ENOMEM, NULL, 0); return; } + memset(sendreq, 0, sizeof(struct send_request)); /* To make the common case fast, we avoid copies by using the query's * tcpbuf for as long as the query is alive. In the rare case where the * query ends while it's queued for transmission, then we give the @@ -843,7 +848,7 @@ void ares__send_query(ares_channel channel, struct query *query, * portable. */ static int setsocknonblock(ares_socket_t sockfd, /* operate on this */ - int nonblock /* TRUE or FALSE */) + int nonblock /* TRUE or FALSE */) { #if defined(USE_BLOCKING_SOCKETS) @@ -857,7 +862,7 @@ static int setsocknonblock(ares_socket_t sockfd, /* operate on this */ if (FALSE != nonblock) return fcntl(sockfd, F_SETFL, flags | O_NONBLOCK); else - return fcntl(sockfd, F_SETFL, flags & (~O_NONBLOCK)); + return fcntl(sockfd, F_SETFL, flags & (~O_NONBLOCK)); /* LCOV_EXCL_LINE */ #elif defined(HAVE_IOCTL_FIONBIO) @@ -900,12 +905,12 @@ static int configure_socket(ares_socket_t s, int family, ares_channel channel) struct sockaddr_in6 sa6; } local; - setsocknonblock(s, TRUE); + (void)setsocknonblock(s, TRUE); #if defined(FD_CLOEXEC) && !defined(MSDOS) /* Configure the socket fd as close-on-exec. */ if (fcntl(s, F_SETFD, FD_CLOEXEC) == -1) - return -1; + return -1; /* LCOV_EXCL_LINE */ #endif /* Set the socket's send and receive buffer sizes. */ @@ -973,7 +978,11 @@ static int open_tcp_socket(ares_channel channel, struct server_state *server) salen = sizeof(saddr.sa4); memset(sa, 0, salen); saddr.sa4.sin_family = AF_INET; - saddr.sa4.sin_port = aresx_sitous(channel->tcp_port); + if (server->addr.tcp_port) { + saddr.sa4.sin_port = aresx_sitous(server->addr.tcp_port); + } else { + saddr.sa4.sin_port = aresx_sitous(channel->tcp_port); + } memcpy(&saddr.sa4.sin_addr, &server->addr.addrV4, sizeof(server->addr.addrV4)); break; @@ -982,12 +991,16 @@ static int open_tcp_socket(ares_channel channel, struct server_state *server) salen = sizeof(saddr.sa6); memset(sa, 0, salen); saddr.sa6.sin6_family = AF_INET6; - saddr.sa6.sin6_port = aresx_sitous(channel->tcp_port); + if (server->addr.tcp_port) { + saddr.sa6.sin6_port = aresx_sitous(server->addr.tcp_port); + } else { + saddr.sa6.sin6_port = aresx_sitous(channel->tcp_port); + } memcpy(&saddr.sa6.sin6_addr, &server->addr.addrV6, sizeof(server->addr.addrV6)); break; default: - return -1; + return -1; /* LCOV_EXCL_LINE */ } /* Acquire a socket. */ @@ -1065,7 +1078,11 @@ static int open_udp_socket(ares_channel channel, struct server_state *server) salen = sizeof(saddr.sa4); memset(sa, 0, salen); saddr.sa4.sin_family = AF_INET; - saddr.sa4.sin_port = aresx_sitous(channel->udp_port); + if (server->addr.udp_port) { + saddr.sa4.sin_port = aresx_sitous(server->addr.udp_port); + } else { + saddr.sa4.sin_port = aresx_sitous(channel->udp_port); + } memcpy(&saddr.sa4.sin_addr, &server->addr.addrV4, sizeof(server->addr.addrV4)); break; @@ -1074,12 +1091,16 @@ static int open_udp_socket(ares_channel channel, struct server_state *server) salen = sizeof(saddr.sa6); memset(sa, 0, salen); saddr.sa6.sin6_family = AF_INET6; - saddr.sa6.sin6_port = aresx_sitous(channel->udp_port); + if (server->addr.udp_port) { + saddr.sa6.sin6_port = aresx_sitous(server->addr.udp_port); + } else { + saddr.sa6.sin6_port = aresx_sitous(channel->udp_port); + } memcpy(&saddr.sa6.sin6_addr, &server->addr.addrV6, sizeof(server->addr.addrV6)); break; default: - return -1; + return -1; /* LCOV_EXCL_LINE */ } /* Acquire a socket. */ @@ -1156,7 +1177,7 @@ static int same_questions(const unsigned char *qbuf, int qlen, q.p += q.namelen; if (q.p + QFIXEDSZ > qbuf + qlen) { - free(q.name); + ares_free(q.name); return 0; } q.type = DNS_QUESTION_TYPE(q.p); @@ -1171,14 +1192,14 @@ static int same_questions(const unsigned char *qbuf, int qlen, if (ares_expand_name(a.p, abuf, alen, &a.name, &a.namelen) != ARES_SUCCESS) { - free(q.name); + ares_free(q.name); return 0; } a.p += a.namelen; if (a.p + QFIXEDSZ > abuf + alen) { - free(q.name); - free(a.name); + ares_free(q.name); + ares_free(a.name); return 0; } a.type = DNS_QUESTION_TYPE(a.p); @@ -1189,13 +1210,13 @@ static int same_questions(const unsigned char *qbuf, int qlen, if (strcasecmp(q.name, a.name) == 0 && q.type == a.type && q.dnsclass == a.dnsclass) { - free(a.name); + ares_free(a.name); break; } - free(a.name); + ares_free(a.name); } - free(q.name); + ares_free(q.name); if (j == a.qdcount) return 0; } @@ -1224,7 +1245,7 @@ static int same_address(struct sockaddr *sa, struct ares_addr *aa) return 1; /* match */ break; default: - break; + break; /* LCOV_EXCL_LINE */ } } return 0; /* different */ @@ -1261,7 +1282,7 @@ static void end_query (ares_channel channel, struct query *query, int status, * to the query's tcpbuf and handle these cases, we just give * such sendreqs their own copy of the query packet. */ - sendreq->data_storage = malloc(sendreq->len); + sendreq->data_storage = ares_malloc(sendreq->len); if (sendreq->data_storage != NULL) { memcpy(sendreq->data_storage, sendreq->data, sendreq->len); @@ -1311,7 +1332,7 @@ void ares__free_query(struct query *query) query->callback = NULL; query->arg = NULL; /* Deallocate the memory associated with the query */ - free(query->tcpbuf); - free(query->server_info); - free(query); + ares_free(query->tcpbuf); + ares_free(query->server_info); + ares_free(query); } diff --git a/deps/cares/src/ares_query.c b/deps/cares/src/ares_query.c index 4bc9c2560f0ce4..b38b8a6c22c4db 100644 --- a/deps/cares/src/ares_query.c +++ b/deps/cares/src/ares_query.c @@ -121,7 +121,7 @@ void ares_query(ares_channel channel, const char *name, int dnsclass, &qlen, (channel->flags & ARES_FLAG_EDNS) ? channel->ednspsz : 0); if (status != ARES_SUCCESS) { - if (qbuf != NULL) free(qbuf); + if (qbuf != NULL) ares_free(qbuf); callback(arg, status, 0, NULL, 0); return; } @@ -129,7 +129,7 @@ void ares_query(ares_channel channel, const char *name, int dnsclass, channel->next_id = generate_unique_id(channel); /* Allocate and fill in the query structure. */ - qquery = malloc(sizeof(struct qquery)); + qquery = ares_malloc(sizeof(struct qquery)); if (!qquery) { ares_free_string(qbuf); @@ -182,5 +182,5 @@ static void qcallback(void *arg, int status, int timeouts, unsigned char *abuf, } qquery->callback(qquery->arg, status, timeouts, abuf, alen); } - free(qquery); + ares_free(qquery); } diff --git a/deps/cares/src/ares_search.c b/deps/cares/src/ares_search.c index f9558a9a50f463..68e852574f0909 100644 --- a/deps/cares/src/ares_search.c +++ b/deps/cares/src/ares_search.c @@ -44,7 +44,7 @@ static void search_callback(void *arg, int status, int timeouts, static void end_squery(struct search_query *squery, int status, unsigned char *abuf, int alen); static int cat_domain(const char *name, const char *domain, char **s); -static int single_domain(ares_channel channel, const char *name, char **s); +STATIC_TESTABLE int single_domain(ares_channel channel, const char *name, char **s); void ares_search(ares_channel channel, const char *name, int dnsclass, int type, ares_callback callback, void *arg) @@ -66,24 +66,24 @@ void ares_search(ares_channel channel, const char *name, int dnsclass, if (s) { ares_query(channel, s, dnsclass, type, callback, arg); - free(s); + ares_free(s); return; } /* Allocate a search_query structure to hold the state necessary for * doing multiple lookups. */ - squery = malloc(sizeof(struct search_query)); + squery = ares_malloc(sizeof(struct search_query)); if (!squery) { callback(arg, ARES_ENOMEM, 0, NULL, 0); return; } squery->channel = channel; - squery->name = strdup(name); + squery->name = ares_strdup(name); if (!squery->name) { - free(squery); + ares_free(squery); callback(arg, ARES_ENOMEM, 0, NULL, 0); return; } @@ -123,13 +123,13 @@ void ares_search(ares_channel channel, const char *name, int dnsclass, if (status == ARES_SUCCESS) { ares_query(channel, s, dnsclass, type, search_callback, squery); - free(s); + ares_free(s); } else { /* failed, free the malloc()ed memory */ - free(squery->name); - free(squery); + ares_free(squery->name); + ares_free(squery); callback(arg, status, 0, NULL, 0); } } @@ -177,7 +177,7 @@ static void search_callback(void *arg, int status, int timeouts, squery->next_domain++; ares_query(channel, s, squery->dnsclass, squery->type, search_callback, squery); - free(s); + ares_free(s); } } else if (squery->status_as_is == -1) @@ -201,8 +201,8 @@ static void end_squery(struct search_query *squery, int status, unsigned char *abuf, int alen) { squery->callback(squery->arg, status, squery->timeouts, abuf, alen); - free(squery->name); - free(squery); + ares_free(squery->name); + ares_free(squery); } /* Concatenate two domains. */ @@ -211,7 +211,7 @@ static int cat_domain(const char *name, const char *domain, char **s) size_t nlen = strlen(name); size_t dlen = strlen(domain); - *s = malloc(nlen + 1 + dlen + 1); + *s = ares_malloc(nlen + 1 + dlen + 1); if (!*s) return ARES_ENOMEM; memcpy(*s, name, nlen); @@ -225,7 +225,7 @@ static int cat_domain(const char *name, const char *domain, char **s) * the string we should query, in an allocated buffer. If not, set *s * to NULL. */ -static int single_domain(ares_channel channel, const char *name, char **s) +STATIC_TESTABLE int single_domain(ares_channel channel, const char *name, char **s) { size_t len = strlen(name); const char *hostaliases; @@ -241,7 +241,7 @@ static int single_domain(ares_channel channel, const char *name, char **s) */ if ((len > 0) && (name[len - 1] == '.')) { - *s = strdup(name); + *s = ares_strdup(name); return (*s) ? ARES_SUCCESS : ARES_ENOMEM; } @@ -268,18 +268,18 @@ static int single_domain(ares_channel channel, const char *name, char **s) q = p + 1; while (*q && !ISSPACE(*q)) q++; - *s = malloc(q - p + 1); + *s = ares_malloc(q - p + 1); if (*s) { memcpy(*s, p, q - p); (*s)[q - p] = 0; } - free(line); + ares_free(line); fclose(fp); return (*s) ? ARES_SUCCESS : ARES_ENOMEM; } } - free(line); + ares_free(line); fclose(fp); if (status != ARES_SUCCESS && status != ARES_EOF) return status; @@ -307,7 +307,7 @@ static int single_domain(ares_channel channel, const char *name, char **s) if (channel->flags & ARES_FLAG_NOSEARCH || channel->ndomains == 0) { /* No domain search to do; just try the name as-is. */ - *s = strdup(name); + *s = ares_strdup(name); return (*s) ? ARES_SUCCESS : ARES_ENOMEM; } diff --git a/deps/cares/src/ares_send.c b/deps/cares/src/ares_send.c index 1a450b1e6d85ce..88c0035520c504 100644 --- a/deps/cares/src/ares_send.c +++ b/deps/cares/src/ares_send.c @@ -47,25 +47,25 @@ void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen, } /* Allocate space for query and allocated fields. */ - query = malloc(sizeof(struct query)); + query = ares_malloc(sizeof(struct query)); if (!query) { callback(arg, ARES_ENOMEM, 0, NULL, 0); return; } - query->tcpbuf = malloc(qlen + 2); + query->tcpbuf = ares_malloc(qlen + 2); if (!query->tcpbuf) { - free(query); + ares_free(query); callback(arg, ARES_ENOMEM, 0, NULL, 0); return; } - query->server_info = malloc(channel->nservers * - sizeof(query->server_info[0])); + query->server_info = ares_malloc(channel->nservers * + sizeof(query->server_info[0])); if (!query->server_info) { - free(query->tcpbuf); - free(query); + ares_free(query->tcpbuf); + ares_free(query); callback(arg, ARES_ENOMEM, 0, NULL, 0); return; } diff --git a/deps/cares/src/ares_strdup.c b/deps/cares/src/ares_strdup.c index 18043274e9925d..0c3dcffc30d6e6 100644 --- a/deps/cares/src/ares_strdup.c +++ b/deps/cares/src/ares_strdup.c @@ -17,26 +17,33 @@ #include "ares_setup.h" #include "ares_strdup.h" +#include "ares.h" +#include "ares_private.h" -#ifndef HAVE_STRDUP char *ares_strdup(const char *s1) { - size_t sz; - char * s2; +#ifdef HAVE_STRDUP + if (ares_malloc == malloc) + return strdup(s1); + else +#endif + { + size_t sz; + char * s2; - if(s1) { - sz = strlen(s1); - if(sz < (size_t)-1) { - sz++; - if(sz < ((size_t)-1) / sizeof(char)) { - s2 = malloc(sz * sizeof(char)); - if(s2) { - memcpy(s2, s1, sz * sizeof(char)); - return s2; + if(s1) { + sz = strlen(s1); + if(sz < (size_t)-1) { + sz++; + if(sz < ((size_t)-1) / sizeof(char)) { + s2 = ares_malloc(sz * sizeof(char)); + if(s2) { + memcpy(s2, s1, sz * sizeof(char)); + return s2; + } } } } + return (char *)NULL; } - return (char *)NULL; } -#endif diff --git a/deps/cares/src/ares_strdup.h b/deps/cares/src/ares_strdup.h index c413a941c51795..67f2a74f5f1506 100644 --- a/deps/cares/src/ares_strdup.h +++ b/deps/cares/src/ares_strdup.h @@ -19,8 +19,6 @@ #include "ares_setup.h" -#ifndef HAVE_STRDUP extern char *ares_strdup(const char *s1); -#endif #endif /* HEADER_CARES_STRDUP_H */ diff --git a/deps/cares/src/ares_writev.c b/deps/cares/src/ares_writev.c index 9e8e2d65741e2e..008efddc57377d 100644 --- a/deps/cares/src/ares_writev.c +++ b/deps/cares/src/ares_writev.c @@ -54,7 +54,7 @@ ssize_t ares_writev(ares_socket_t s, const struct iovec *iov, int iovcnt) return (0); /* Allocate a temporary buffer to hold the data */ - buffer = malloc(bytes); + buffer = ares_malloc(bytes); if (!buffer) { SET_ERRNO(ENOMEM); @@ -71,7 +71,7 @@ ssize_t ares_writev(ares_socket_t s, const struct iovec *iov, int iovcnt) /* Send buffer contents */ result = swrite(s, buffer, bytes); - free(buffer); + ares_free(buffer); return (result); } diff --git a/deps/cares/src/bitncmp.c b/deps/cares/src/bitncmp.c index faedff9afd02bc..1468d4923a5762 100644 --- a/deps/cares/src/bitncmp.c +++ b/deps/cares/src/bitncmp.c @@ -26,7 +26,7 @@ * bitncmp(l, r, n) * compare bit masks l and r, for n bits. * return: - * -1, 1, or 0 in the libc tradition. + * <0, >0, or 0 in the libc tradition. * note: * network byte order assumed. this means 192.5.5.240/28 has * 0x11110000 in its fourth octet. diff --git a/deps/cares/src/inet_net_pton.c b/deps/cares/src/inet_net_pton.c index 71c07c59ca3835..b64fc5b1d17072 100644 --- a/deps/cares/src/inet_net_pton.c +++ b/deps/cares/src/inet_net_pton.c @@ -151,7 +151,7 @@ inet_net_pton_ipv4(const char *src, unsigned char *dst, size_t size) /* If nothing was written to the destination, we found no address. */ if (dst == odst) - goto enoent; + goto enoent; /* LCOV_EXCL_LINE: all valid paths above increment dst */ /* If no CIDR spec was given, infer width from net class. */ if (bits == -1) { if (*odst >= 240) /* Class E */ diff --git a/deps/http_parser/AUTHORS b/deps/http_parser/AUTHORS index 8e2df1d06e6f69..5323b685caefb9 100644 --- a/deps/http_parser/AUTHORS +++ b/deps/http_parser/AUTHORS @@ -65,3 +65,4 @@ Romain Giraud Jay Satiro Arne Steen Kjell Schubert +Olivier Mengué diff --git a/deps/http_parser/Makefile b/deps/http_parser/Makefile index 373709c6672e31..5f4eb2252f241b 100644 --- a/deps/http_parser/Makefile +++ b/deps/http_parser/Makefile @@ -19,7 +19,19 @@ # IN THE SOFTWARE. PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"') -SONAME ?= libhttp_parser.so.2.5.0 +HELPER ?= +BINEXT ?= +ifeq (darwin,$(PLATFORM)) +SONAME ?= libhttp_parser.2.7.0.dylib +SOEXT ?= dylib +else ifeq (wine,$(PLATFORM)) +CC = winegcc +BINEXT = .exe.so +HELPER = wine +else +SONAME ?= libhttp_parser.so.2.7.0 +SOEXT ?= so +endif CC?=gcc AR?=ar @@ -53,8 +65,8 @@ LDFLAGS_LIB += -Wl,-soname=$(SONAME) endif test: test_g test_fast - ./test_g - ./test_fast + $(HELPER) ./test_g$(BINEXT) + $(HELPER) ./test_fast$(BINEXT) test_g: http_parser_g.o test_g.o $(CC) $(CFLAGS_DEBUG) $(LDFLAGS) http_parser_g.o test_g.o -o $@ @@ -81,7 +93,7 @@ http_parser.o: http_parser.c http_parser.h Makefile $(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) -c http_parser.c test-run-timed: test_fast - while(true) do time ./test_fast > /dev/null; done + while(true) do time $(HELPER) ./test_fast$(BINEXT) > /dev/null; done test-valgrind: test_g valgrind ./test_g @@ -102,10 +114,10 @@ url_parser_g: http_parser_g.o contrib/url_parser.c $(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) $^ -o $@ parsertrace: http_parser.o contrib/parsertrace.c - $(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) $^ -o parsertrace + $(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) $^ -o parsertrace$(BINEXT) parsertrace_g: http_parser_g.o contrib/parsertrace.c - $(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) $^ -o parsertrace_g + $(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) $^ -o parsertrace_g$(BINEXT) tags: http_parser.c http_parser.h test.c ctags $^ @@ -113,12 +125,12 @@ tags: http_parser.c http_parser.h test.c install: library $(INSTALL) -D http_parser.h $(INCLUDEDIR)/http_parser.h $(INSTALL) -D $(SONAME) $(LIBDIR)/$(SONAME) - ln -s $(LIBDIR)/$(SONAME) $(LIBDIR)/libhttp_parser.so + ln -s $(LIBDIR)/$(SONAME) $(LIBDIR)/libhttp_parser.$(SOEXT) install-strip: library $(INSTALL) -D http_parser.h $(INCLUDEDIR)/http_parser.h $(INSTALL) -D -s $(SONAME) $(LIBDIR)/$(SONAME) - ln -s $(LIBDIR)/$(SONAME) $(LIBDIR)/libhttp_parser.so + ln -s $(LIBDIR)/$(SONAME) $(LIBDIR)/libhttp_parser.$(SOEXT) uninstall: rm $(INCLUDEDIR)/http_parser.h @@ -128,7 +140,8 @@ uninstall: clean: rm -f *.o *.a tags test test_fast test_g \ http_parser.tar libhttp_parser.so.* \ - url_parser url_parser_g parsertrace parsertrace_g + url_parser url_parser_g parsertrace parsertrace_g \ + *.exe *.exe.so contrib/url_parser.c: http_parser.h contrib/parsertrace.c: http_parser.h diff --git a/deps/http_parser/README.md b/deps/http_parser/README.md index 7c54dd42d087c3..eedd7f8c9a4d0f 100644 --- a/deps/http_parser/README.md +++ b/deps/http_parser/README.md @@ -1,7 +1,7 @@ HTTP Parser =========== -[![Build Status](https://travis-ci.org/joyent/http-parser.png?branch=master)](https://travis-ci.org/joyent/http-parser) +[![Build Status](https://api.travis-ci.org/nodejs/http-parser.svg?branch=master)](https://travis-ci.org/nodejs/http-parser) This is a parser for HTTP messages written in C. It parses both requests and responses. The parser is designed to be used in performance HTTP @@ -94,7 +94,7 @@ The Special Problem of Upgrade ------------------------------ HTTP supports upgrading the connection to a different protocol. An -increasingly common example of this is the Web Socket protocol which sends +increasingly common example of this is the WebSocket protocol which sends a request like GET /demo HTTP/1.1 @@ -106,8 +106,8 @@ a request like followed by non-HTTP data. -(See http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-75 for more -information the Web Socket protocol.) +(See [RFC6455](https://tools.ietf.org/html/rfc6455) for more information the +WebSocket protocol.) To support this, the parser will treat this as a normal HTTP message without a body, issuing both on_headers_complete and on_message_complete callbacks. However @@ -137,6 +137,69 @@ There are two types of callbacks: Callbacks must return 0 on success. Returning a non-zero value indicates error to the parser, making it exit immediately. +For cases where it is necessary to pass local information to/from a callback, +the `http_parser` object's `data` field can be used. +An example of such a case is when using threads to handle a socket connection, +parse a request, and then give a response over that socket. By instantiation +of a thread-local struct containing relevant data (e.g. accepted socket, +allocated memory for callbacks to write into, etc), a parser's callbacks are +able to communicate data between the scope of the thread and the scope of the +callback in a threadsafe manner. This allows http-parser to be used in +multi-threaded contexts. + +Example: +``` + typedef struct { + socket_t sock; + void* buffer; + int buf_len; + } custom_data_t; + + +int my_url_callback(http_parser* parser, const char *at, size_t length) { + /* access to thread local custom_data_t struct. + Use this access save parsed data for later use into thread local + buffer, or communicate over socket + */ + parser->data; + ... + return 0; +} + +... + +void http_parser_thread(socket_t sock) { + int nparsed = 0; + /* allocate memory for user data */ + custom_data_t *my_data = malloc(sizeof(custom_data_t)); + + /* some information for use by callbacks. + * achieves thread -> callback information flow */ + my_data->sock = sock; + + /* instantiate a thread-local parser */ + http_parser *parser = malloc(sizeof(http_parser)); + http_parser_init(parser, HTTP_REQUEST); /* initialise parser */ + /* this custom data reference is accessible through the reference to the + parser supplied to callback functions */ + parser->data = my_data; + + http_parser_settings settings; / * set up callbacks */ + settings.on_url = my_url_callback; + + /* execute parser */ + nparsed = http_parser_execute(parser, &settings, buf, recved); + + ... + /* parsed information copied from callback. + can now perform action on data copied into thread-local memory from callbacks. + achieves callback -> thread information flow */ + my_data->buffer; + ... +} + +``` + In case you parse HTTP message in chunks (i.e. `read()` request line from socket, parse, read half headers, parse, etc) your data callbacks may be called more than once. Http-parser guarantees that data pointer is only diff --git a/deps/http_parser/contrib/url_parser.c b/deps/http_parser/contrib/url_parser.c index 6650b414af9065..f235bed9e483dc 100644 --- a/deps/http_parser/contrib/url_parser.c +++ b/deps/http_parser/contrib/url_parser.c @@ -35,6 +35,7 @@ int main(int argc, char ** argv) { connect = strcmp("connect", argv[1]) == 0 ? 1 : 0; printf("Parsing %s, connect %d\n", argv[2], connect); + http_parser_url_init(&u); result = http_parser_parse_url(argv[2], len, connect, &u); if (result != 0) { printf("Parse error : %d\n", result); @@ -43,4 +44,4 @@ int main(int argc, char ** argv) { printf("Parse ok, result : \n"); dump_url(argv[2], &u); return 0; -} \ No newline at end of file +} diff --git a/deps/http_parser/http_parser.c b/deps/http_parser/http_parser.c index 0fa1c362729c4f..719617549d0cb1 100644 --- a/deps/http_parser/http_parser.c +++ b/deps/http_parser/http_parser.c @@ -123,7 +123,7 @@ do { \ FOR##_mark = NULL; \ } \ } while (0) - + /* Run the data callback FOR and consume the current byte */ #define CALLBACK_DATA(FOR) \ CALLBACK_DATA_(FOR, p - FOR##_mark, p - data + 1) @@ -400,6 +400,8 @@ enum http_host_state , s_http_host , s_http_host_v6 , s_http_host_v6_end + , s_http_host_v6_zone_start + , s_http_host_v6_zone , s_http_host_port_start , s_http_host_port }; @@ -433,6 +435,12 @@ enum http_host_state (IS_ALPHANUM(c) || (c) == '.' || (c) == '-' || (c) == '_') #endif +/** + * Verify that a char is a valid visible (printable) US-ASCII + * character or %x80-FF + **/ +#define IS_HEADER_CHAR(ch) \ + (ch == CR || ch == LF || ch == 9 || ((unsigned char)ch > 31 && ch != 127)) #define start_state (parser->type == HTTP_REQUEST ? s_start_req : s_start_res) @@ -637,6 +645,7 @@ size_t http_parser_execute (http_parser *parser, const char *body_mark = 0; const char *status_mark = 0; enum state p_state = (enum state) parser->state; + const unsigned int lenient = parser->lenient_http_headers; /* We're in an error state. Don't bother doing anything. */ if (HTTP_PARSER_ERRNO(parser) != HPE_OK) { @@ -957,21 +966,23 @@ size_t http_parser_execute (http_parser *parser, parser->method = (enum http_method) 0; parser->index = 1; switch (ch) { + case 'A': parser->method = HTTP_ACL; break; + case 'B': parser->method = HTTP_BIND; break; case 'C': parser->method = HTTP_CONNECT; /* or COPY, CHECKOUT */ break; case 'D': parser->method = HTTP_DELETE; break; case 'G': parser->method = HTTP_GET; break; case 'H': parser->method = HTTP_HEAD; break; - case 'L': parser->method = HTTP_LOCK; break; + case 'L': parser->method = HTTP_LOCK; /* or LINK */ break; case 'M': parser->method = HTTP_MKCOL; /* or MOVE, MKACTIVITY, MERGE, M-SEARCH, MKCALENDAR */ break; case 'N': parser->method = HTTP_NOTIFY; break; case 'O': parser->method = HTTP_OPTIONS; break; case 'P': parser->method = HTTP_POST; /* or PROPFIND|PROPPATCH|PUT|PATCH|PURGE */ break; - case 'R': parser->method = HTTP_REPORT; break; + case 'R': parser->method = HTTP_REPORT; /* or REBIND */ break; case 'S': parser->method = HTTP_SUBSCRIBE; /* or SEARCH */ break; case 'T': parser->method = HTTP_TRACE; break; - case 'U': parser->method = HTTP_UNLOCK; /* or UNSUBSCRIBE */ break; + case 'U': parser->method = HTTP_UNLOCK; /* or UNSUBSCRIBE, UNBIND, UNLINK */ break; default: SET_ERRNO(HPE_INVALID_METHOD); goto error; @@ -996,69 +1007,40 @@ size_t http_parser_execute (http_parser *parser, UPDATE_STATE(s_req_spaces_before_url); } else if (ch == matcher[parser->index]) { ; /* nada */ - } else if (parser->method == HTTP_CONNECT) { - if (parser->index == 1 && ch == 'H') { - parser->method = HTTP_CHECKOUT; - } else if (parser->index == 2 && ch == 'P') { - parser->method = HTTP_COPY; - } else { - SET_ERRNO(HPE_INVALID_METHOD); - goto error; - } - } else if (parser->method == HTTP_MKCOL) { - if (parser->index == 1 && ch == 'O') { - parser->method = HTTP_MOVE; - } else if (parser->index == 1 && ch == 'E') { - parser->method = HTTP_MERGE; - } else if (parser->index == 1 && ch == '-') { - parser->method = HTTP_MSEARCH; - } else if (parser->index == 2 && ch == 'A') { - parser->method = HTTP_MKACTIVITY; - } else if (parser->index == 3 && ch == 'A') { - parser->method = HTTP_MKCALENDAR; - } else { - SET_ERRNO(HPE_INVALID_METHOD); - goto error; - } - } else if (parser->method == HTTP_SUBSCRIBE) { - if (parser->index == 1 && ch == 'E') { - parser->method = HTTP_SEARCH; - } else { - SET_ERRNO(HPE_INVALID_METHOD); - goto error; - } - } else if (parser->index == 1 && parser->method == HTTP_POST) { - if (ch == 'R') { - parser->method = HTTP_PROPFIND; /* or HTTP_PROPPATCH */ - } else if (ch == 'U') { - parser->method = HTTP_PUT; /* or HTTP_PURGE */ - } else if (ch == 'A') { - parser->method = HTTP_PATCH; - } else { - SET_ERRNO(HPE_INVALID_METHOD); - goto error; - } - } else if (parser->index == 2) { - if (parser->method == HTTP_PUT) { - if (ch == 'R') { - parser->method = HTTP_PURGE; - } else { - SET_ERRNO(HPE_INVALID_METHOD); - goto error; - } - } else if (parser->method == HTTP_UNLOCK) { - if (ch == 'S') { - parser->method = HTTP_UNSUBSCRIBE; - } else { + } else if (IS_ALPHA(ch)) { + + switch (parser->method << 16 | parser->index << 8 | ch) { +#define XX(meth, pos, ch, new_meth) \ + case (HTTP_##meth << 16 | pos << 8 | ch): \ + parser->method = HTTP_##new_meth; break; + + XX(POST, 1, 'U', PUT) + XX(POST, 1, 'A', PATCH) + XX(CONNECT, 1, 'H', CHECKOUT) + XX(CONNECT, 2, 'P', COPY) + XX(MKCOL, 1, 'O', MOVE) + XX(MKCOL, 1, 'E', MERGE) + XX(MKCOL, 2, 'A', MKACTIVITY) + XX(MKCOL, 3, 'A', MKCALENDAR) + XX(SUBSCRIBE, 1, 'E', SEARCH) + XX(REPORT, 2, 'B', REBIND) + XX(POST, 1, 'R', PROPFIND) + XX(PROPFIND, 4, 'P', PROPPATCH) + XX(PUT, 2, 'R', PURGE) + XX(LOCK, 1, 'I', LINK) + XX(UNLOCK, 2, 'S', UNSUBSCRIBE) + XX(UNLOCK, 2, 'B', UNBIND) + XX(UNLOCK, 3, 'I', UNLINK) +#undef XX + + default: SET_ERRNO(HPE_INVALID_METHOD); goto error; - } - } else { - SET_ERRNO(HPE_INVALID_METHOD); - goto error; } - } else if (parser->index == 4 && parser->method == HTTP_PROPFIND && ch == 'P') { - parser->method = HTTP_PROPPATCH; + } else if (ch == '-' && + parser->index == 1 && + parser->method == HTTP_MKCOL) { + parser->method = HTTP_MSEARCH; } else { SET_ERRNO(HPE_INVALID_METHOD); goto error; @@ -1384,7 +1366,12 @@ size_t http_parser_execute (http_parser *parser, || c != CONTENT_LENGTH[parser->index]) { parser->header_state = h_general; } else if (parser->index == sizeof(CONTENT_LENGTH)-2) { + if (parser->flags & F_CONTENTLENGTH) { + SET_ERRNO(HPE_UNEXPECTED_CONTENT_LENGTH); + goto error; + } parser->header_state = h_content_length; + parser->flags |= F_CONTENTLENGTH; } break; @@ -1536,6 +1523,11 @@ size_t http_parser_execute (http_parser *parser, REEXECUTE(); } + if (!lenient && !IS_HEADER_CHAR(ch)) { + SET_ERRNO(HPE_INVALID_HEADER_TOKEN); + goto error; + } + c = LOWER(ch); switch (h_state) { @@ -1703,7 +1695,10 @@ size_t http_parser_execute (http_parser *parser, case s_header_almost_done: { - STRICT_CHECK(ch != LF); + if (UNLIKELY(ch != LF)) { + SET_ERRNO(HPE_LF_EXPECTED); + goto error; + } UPDATE_STATE(s_header_value_lws); break; @@ -1787,6 +1782,14 @@ size_t http_parser_execute (http_parser *parser, REEXECUTE(); } + /* Cannot use chunked encoding and a content-length header together + per the HTTP specification. */ + if ((parser->flags & F_CHUNKED) && + (parser->flags & F_CONTENTLENGTH)) { + SET_ERRNO(HPE_UNEXPECTED_CONTENT_LENGTH); + goto error; + } + UPDATE_STATE(s_headers_done); /* Set this here so that on_headers_complete() callbacks can see it */ @@ -1809,6 +1812,9 @@ size_t http_parser_execute (http_parser *parser, case 0: break; + case 2: + parser->upgrade = 1; + case 1: parser->flags |= F_SKIPBODY; break; @@ -1828,11 +1834,12 @@ size_t http_parser_execute (http_parser *parser, case s_headers_done: { + int hasBody; STRICT_CHECK(ch != LF); parser->nread = 0; - int hasBody = parser->flags & F_CHUNKED || + hasBody = parser->flags & F_CHUNKED || (parser->content_length > 0 && parser->content_length != ULLONG_MAX); if (parser->upgrade && (parser->method == HTTP_CONNECT || (parser->flags & F_SKIPBODY) || !hasBody)) { @@ -1857,8 +1864,7 @@ size_t http_parser_execute (http_parser *parser, /* Content-Length header given and non-zero */ UPDATE_STATE(s_body_identity); } else { - if (parser->type == HTTP_REQUEST || - !http_message_needs_eof(parser)) { + if (!http_message_needs_eof(parser)) { /* Assume content-length 0 - read the next */ UPDATE_STATE(NEW_MESSAGE()); CALLBACK_NOTIFY(message_complete); @@ -2153,15 +2159,13 @@ http_parser_settings_init(http_parser_settings *settings) const char * http_errno_name(enum http_errno err) { - assert(((size_t) err) < - (sizeof(http_strerror_tab) / sizeof(http_strerror_tab[0]))); + assert(((size_t) err) < ARRAY_SIZE(http_strerror_tab)); return http_strerror_tab[err].name; } const char * http_errno_description(enum http_errno err) { - assert(((size_t) err) < - (sizeof(http_strerror_tab) / sizeof(http_strerror_tab[0]))); + assert(((size_t) err) < ARRAY_SIZE(http_strerror_tab)); return http_strerror_tab[err].description; } @@ -2214,6 +2218,23 @@ http_parse_host_char(enum http_host_state s, const char ch) { return s_http_host_v6; } + if (s == s_http_host_v6 && ch == '%') { + return s_http_host_v6_zone_start; + } + break; + + case s_http_host_v6_zone: + if (ch == ']') { + return s_http_host_v6_end; + } + + /* FALLTHROUGH */ + case s_http_host_v6_zone_start: + /* RFC 6874 Zone ID consists of 1*( unreserved / pct-encoded) */ + if (IS_ALPHANUM(ch) || ch == '%' || ch == '.' || ch == '-' || ch == '_' || + ch == '~') { + return s_http_host_v6_zone; + } break; case s_http_host_port: @@ -2232,6 +2253,7 @@ http_parse_host_char(enum http_host_state s, const char ch) { static int http_parse_host(const char * buf, struct http_parser_url *u, int found_at) { + assert(u->field_set & (1 << UF_HOST)); enum http_host_state s; const char *p; @@ -2263,6 +2285,11 @@ http_parse_host(const char * buf, struct http_parser_url *u, int found_at) { u->field_data[UF_HOST].len++; break; + case s_http_host_v6_zone_start: + case s_http_host_v6_zone: + u->field_data[UF_HOST].len++; + break; + case s_http_host_port: if (s != s_http_host_port) { u->field_data[UF_PORT].off = p - buf; @@ -2292,6 +2319,8 @@ http_parse_host(const char * buf, struct http_parser_url *u, int found_at) { case s_http_host_start: case s_http_host_v6_start: case s_http_host_v6: + case s_http_host_v6_zone_start: + case s_http_host_v6_zone: case s_http_host_port_start: case s_http_userinfo: case s_http_userinfo_start: @@ -2303,6 +2332,11 @@ http_parse_host(const char * buf, struct http_parser_url *u, int found_at) { return 0; } +void +http_parser_url_init(struct http_parser_url *u) { + memset(u, 0, sizeof(*u)); +} + int http_parser_parse_url(const char *buf, size_t buflen, int is_connect, struct http_parser_url *u) @@ -2376,7 +2410,12 @@ http_parser_parse_url(const char *buf, size_t buflen, int is_connect, /* host must be present if there is a schema */ /* parsing http:///toto will fail */ - if ((u->field_set & ((1 << UF_SCHEMA) | (1 << UF_HOST))) != 0) { + if ((u->field_set & (1 << UF_SCHEMA)) && + (u->field_set & (1 << UF_HOST)) == 0) { + return 1; + } + + if (u->field_set & (1 << UF_HOST)) { if (http_parse_host(buf, u, found_at) != 0) { return 1; } diff --git a/deps/http_parser/http_parser.h b/deps/http_parser/http_parser.h index eb71bf99219315..105ae510a8ab57 100644 --- a/deps/http_parser/http_parser.h +++ b/deps/http_parser/http_parser.h @@ -26,11 +26,12 @@ extern "C" { /* Also update SONAME in the Makefile whenever you change these. */ #define HTTP_PARSER_VERSION_MAJOR 2 -#define HTTP_PARSER_VERSION_MINOR 5 +#define HTTP_PARSER_VERSION_MINOR 7 #define HTTP_PARSER_VERSION_PATCH 0 #include -#if defined(_WIN32) && !defined(__MINGW32__) && (!defined(_MSC_VER) || _MSC_VER<1600) +#if defined(_WIN32) && !defined(__MINGW32__) && \ + (!defined(_MSC_VER) || _MSC_VER<1600) && !defined(__WINE__) #include #include typedef __int8 int8_t; @@ -76,6 +77,11 @@ typedef struct http_parser_settings http_parser_settings; * HEAD request which may contain 'Content-Length' or 'Transfer-Encoding: * chunked' headers that indicate the presence of a body. * + * Returning `2` from on_headers_complete will tell parser that it should not + * expect neither a body nor any futher responses on this connection. This is + * useful for handling responses to a CONNECT request which may not contain + * `Upgrade` or `Connection: upgrade` headers. + * * http_data_cb does not return data chunks. It will be called arbitrarily * many times for each string. E.G. you might get 10 callbacks for "on_url" * each providing just a few characters more data. @@ -95,7 +101,7 @@ typedef int (*http_cb) (http_parser*); XX(5, CONNECT, CONNECT) \ XX(6, OPTIONS, OPTIONS) \ XX(7, TRACE, TRACE) \ - /* webdav */ \ + /* WebDAV */ \ XX(8, COPY, COPY) \ XX(9, LOCK, LOCK) \ XX(10, MKCOL, MKCOL) \ @@ -104,21 +110,28 @@ typedef int (*http_cb) (http_parser*); XX(13, PROPPATCH, PROPPATCH) \ XX(14, SEARCH, SEARCH) \ XX(15, UNLOCK, UNLOCK) \ + XX(16, BIND, BIND) \ + XX(17, REBIND, REBIND) \ + XX(18, UNBIND, UNBIND) \ + XX(19, ACL, ACL) \ /* subversion */ \ - XX(16, REPORT, REPORT) \ - XX(17, MKACTIVITY, MKACTIVITY) \ - XX(18, CHECKOUT, CHECKOUT) \ - XX(19, MERGE, MERGE) \ + XX(20, REPORT, REPORT) \ + XX(21, MKACTIVITY, MKACTIVITY) \ + XX(22, CHECKOUT, CHECKOUT) \ + XX(23, MERGE, MERGE) \ /* upnp */ \ - XX(20, MSEARCH, M-SEARCH) \ - XX(21, NOTIFY, NOTIFY) \ - XX(22, SUBSCRIBE, SUBSCRIBE) \ - XX(23, UNSUBSCRIBE, UNSUBSCRIBE) \ + XX(24, MSEARCH, M-SEARCH) \ + XX(25, NOTIFY, NOTIFY) \ + XX(26, SUBSCRIBE, SUBSCRIBE) \ + XX(27, UNSUBSCRIBE, UNSUBSCRIBE) \ /* RFC-5789 */ \ - XX(24, PATCH, PATCH) \ - XX(25, PURGE, PURGE) \ + XX(28, PATCH, PATCH) \ + XX(29, PURGE, PURGE) \ /* CalDAV */ \ - XX(26, MKCALENDAR, MKCALENDAR) \ + XX(30, MKCALENDAR, MKCALENDAR) \ + /* RFC-2068, section 19.6.1.2 */ \ + XX(31, LINK, LINK) \ + XX(32, UNLINK, UNLINK) \ enum http_method { @@ -140,11 +153,12 @@ enum flags , F_TRAILING = 1 << 4 , F_UPGRADE = 1 << 5 , F_SKIPBODY = 1 << 6 + , F_CONTENTLENGTH = 1 << 7 }; /* Map for errno-related constants - * + * * The provided argument should be a macro that takes 2 arguments. */ #define HTTP_ERRNO_MAP(XX) \ @@ -182,6 +196,8 @@ enum flags XX(INVALID_HEADER_TOKEN, "invalid character in header") \ XX(INVALID_CONTENT_LENGTH, \ "invalid character in content-length header") \ + XX(UNEXPECTED_CONTENT_LENGTH, \ + "unexpected content-length header") \ XX(INVALID_CHUNK_SIZE, \ "invalid character in chunk size header") \ XX(INVALID_CONSTANT, "invalid constant string") \ @@ -206,10 +222,11 @@ enum http_errno { struct http_parser { /** PRIVATE **/ unsigned int type : 2; /* enum http_parser_type */ - unsigned int flags : 7; /* F_* values from 'flags' enum; semi-public */ + unsigned int flags : 8; /* F_* values from 'flags' enum; semi-public */ unsigned int state : 7; /* enum state from http_parser.c */ - unsigned int header_state : 8; /* enum header_state from http_parser.c */ - unsigned int index : 8; /* index into current matcher */ + unsigned int header_state : 7; /* enum header_state from http_parser.c */ + unsigned int index : 7; /* index into current matcher */ + unsigned int lenient_http_headers : 1; uint32_t nread; /* # bytes read in various scenarios */ uint64_t content_length; /* # bytes in body (0 if no Content-Length header) */ @@ -325,6 +342,9 @@ const char *http_errno_name(enum http_errno err); /* Return a string description of the given error */ const char *http_errno_description(enum http_errno err); +/* Initialize all http_parser_url members to 0 */ +void http_parser_url_init(struct http_parser_url *u); + /* Parse a URL; return nonzero on failure */ int http_parser_parse_url(const char *buf, size_t buflen, int is_connect, diff --git a/deps/http_parser/test.c b/deps/http_parser/test.c index 4c00571eba60bc..456a78add05e68 100644 --- a/deps/http_parser/test.c +++ b/deps/http_parser/test.c @@ -1101,6 +1101,58 @@ const struct message requests[] = ,.body= "" } +/* Examples from the Internet draft for LINK/UNLINK methods: + * https://tools.ietf.org/id/draft-snell-link-method-01.html#rfc.section.5 + */ + +#define LINK_REQUEST 40 +, {.name = "link request" + ,.type= HTTP_REQUEST + ,.raw= "LINK /images/my_dog.jpg HTTP/1.1\r\n" + "Host: example.com\r\n" + "Link: ; rel=\"tag\"\r\n" + "Link: ; rel=\"tag\"\r\n" + "\r\n" + ,.should_keep_alive= TRUE + ,.message_complete_on_eof= FALSE + ,.http_major= 1 + ,.http_minor= 1 + ,.method= HTTP_LINK + ,.request_path= "/images/my_dog.jpg" + ,.request_url= "/images/my_dog.jpg" + ,.query_string= "" + ,.fragment= "" + ,.num_headers= 3 + ,.headers= { { "Host", "example.com" } + , { "Link", "; rel=\"tag\"" } + , { "Link", "; rel=\"tag\"" } + } + ,.body= "" + } + +#define UNLINK_REQUEST 41 +, {.name = "link request" + ,.type= HTTP_REQUEST + ,.raw= "UNLINK /images/my_dog.jpg HTTP/1.1\r\n" + "Host: example.com\r\n" + "Link: ; rel=\"tag\"\r\n" + "\r\n" + ,.should_keep_alive= TRUE + ,.message_complete_on_eof= FALSE + ,.http_major= 1 + ,.http_minor= 1 + ,.method= HTTP_UNLINK + ,.request_path= "/images/my_dog.jpg" + ,.request_url= "/images/my_dog.jpg" + ,.query_string= "" + ,.fragment= "" + ,.num_headers= 2 + ,.headers= { { "Host", "example.com" } + , { "Link", "; rel=\"tag\"" } + } + ,.body= "" + } + , {.name= NULL } /* sentinel */ }; @@ -2121,6 +2173,20 @@ pause_chunk_complete_cb (http_parser *p) return chunk_complete_cb(p); } +int +connect_headers_complete_cb (http_parser *p) +{ + headers_complete_cb(p); + return 1; +} + +int +connect_message_complete_cb (http_parser *p) +{ + messages[num_messages].should_keep_alive = http_should_keep_alive(parser); + return message_complete_cb(p); +} + static http_parser_settings settings_pause = {.on_message_begin = pause_message_begin_cb ,.on_header_field = pause_header_field_cb @@ -2160,6 +2226,19 @@ static http_parser_settings settings_count_body = ,.on_chunk_complete = chunk_complete_cb }; +static http_parser_settings settings_connect = + {.on_message_begin = message_begin_cb + ,.on_header_field = header_field_cb + ,.on_header_value = header_value_cb + ,.on_url = request_url_cb + ,.on_status = response_status_cb + ,.on_body = dontcall_body_cb + ,.on_headers_complete = connect_headers_complete_cb + ,.on_message_complete = connect_message_complete_cb + ,.on_chunk_header = chunk_header_cb + ,.on_chunk_complete = chunk_complete_cb + }; + static http_parser_settings settings_null = {.on_message_begin = 0 ,.on_header_field = 0 @@ -2223,6 +2302,14 @@ size_t parse_pause (const char *buf, size_t len) return nparsed; } +size_t parse_connect (const char *buf, size_t len) +{ + size_t nparsed; + currently_parsing_eof = (len == 0); + nparsed = http_parser_execute(parser, &settings_connect, buf, len); + return nparsed; +} + static inline int check_str_eq (const struct message *m, const char *prop, @@ -2279,7 +2366,7 @@ do { \ } while(0) int -message_eq (int index, const struct message *expected) +message_eq (int index, int connect, const struct message *expected) { int i; struct message *m = &messages[index]; @@ -2294,8 +2381,10 @@ message_eq (int index, const struct message *expected) MESSAGE_CHECK_STR_EQ(expected, m, response_status); } - MESSAGE_CHECK_NUM_EQ(expected, m, should_keep_alive); - MESSAGE_CHECK_NUM_EQ(expected, m, message_complete_on_eof); + if (!connect) { + MESSAGE_CHECK_NUM_EQ(expected, m, should_keep_alive); + MESSAGE_CHECK_NUM_EQ(expected, m, message_complete_on_eof); + } assert(m->message_begin_cb_called); assert(m->headers_complete_cb_called); @@ -2333,16 +2422,22 @@ message_eq (int index, const struct message *expected) MESSAGE_CHECK_NUM_EQ(expected, m, port); } - if (expected->body_size) { + if (connect) { + check_num_eq(m, "body_size", 0, m->body_size); + } else if (expected->body_size) { MESSAGE_CHECK_NUM_EQ(expected, m, body_size); } else { MESSAGE_CHECK_STR_EQ(expected, m, body); } - assert(m->num_chunks == m->num_chunks_complete); - MESSAGE_CHECK_NUM_EQ(expected, m, num_chunks_complete); - for (i = 0; i < m->num_chunks && i < MAX_CHUNKS; i++) { - MESSAGE_CHECK_NUM_EQ(expected, m, chunk_lengths[i]); + if (connect) { + check_num_eq(m, "num_chunks_complete", 0, m->num_chunks_complete); + } else { + assert(m->num_chunks == m->num_chunks_complete); + MESSAGE_CHECK_NUM_EQ(expected, m, num_chunks_complete); + for (i = 0; i < m->num_chunks && i < MAX_CHUNKS; i++) { + MESSAGE_CHECK_NUM_EQ(expected, m, chunk_lengths[i]); + } } MESSAGE_CHECK_NUM_EQ(expected, m, num_headers); @@ -2392,7 +2487,7 @@ upgrade_message_fix(char *body, const size_t nread, const size_t nmsgs, ...) { va_list ap; size_t i; size_t off = 0; - + va_start(ap, nmsgs); for (i = 0; i < nmsgs; i++) { @@ -2918,6 +3013,59 @@ const struct url_test url_tests[] = ,.rv=1 /* s_dead */ } +, {.name="ipv6 address with Zone ID" + ,.url="http://[fe80::a%25eth0]/" + ,.is_connect=0 + ,.u= + {.field_set= (1< 1 && !message_eq(1, r2)) abort(); - if (message_count > 2 && !message_eq(2, r3)) abort(); + if (!message_eq(0, 0, r1)) abort(); + if (message_count > 1 && !message_eq(1, 0, r2)) abort(); + if (message_count > 2 && !message_eq(2, 0, r3)) abort(); parser_free(); } @@ -3433,17 +3730,17 @@ test_scan (const struct message *r1, const struct message *r2, const struct mess goto error; } - if (!message_eq(0, r1)) { + if (!message_eq(0, 0, r1)) { fprintf(stderr, "\n\nError matching messages[0] in test_scan.\n"); goto error; } - if (message_count > 1 && !message_eq(1, r2)) { + if (message_count > 1 && !message_eq(1, 0, r2)) { fprintf(stderr, "\n\nError matching messages[1] in test_scan.\n"); goto error; } - if (message_count > 2 && !message_eq(2, r3)) { + if (message_count > 2 && !message_eq(2, 0, r3)) { fprintf(stderr, "\n\nError matching messages[2] in test_scan.\n"); goto error; } @@ -3542,7 +3839,29 @@ test_message_pause (const struct message *msg) abort(); } - if(!message_eq(0, msg)) abort(); + if(!message_eq(0, 0, msg)) abort(); + + parser_free(); +} + +/* Verify that body and next message won't be parsed in responses to CONNECT */ +void +test_message_connect (const struct message *msg) +{ + char *buf = (char*) msg->raw; + size_t buflen = strlen(msg->raw); + size_t nread; + + parser_init(msg->type); + + nread = parse_connect(buf, buflen); + + if (num_messages != 1) { + printf("\n*** num_messages != 1 after testing '%s' ***\n\n", msg->name); + abort(); + } + + if(!message_eq(0, 1, msg)) abort(); parser_free(); } @@ -3591,6 +3910,18 @@ main (void) test_header_content_length_overflow_error(); test_chunk_content_length_overflow_error(); + //// HEADER FIELD CONDITIONS + test_double_content_length_error(HTTP_REQUEST); + test_chunked_content_length_error(HTTP_REQUEST); + test_header_cr_no_lf_error(HTTP_REQUEST); + test_invalid_header_field_token_error(HTTP_REQUEST); + test_invalid_header_field_content_error(HTTP_REQUEST); + test_double_content_length_error(HTTP_RESPONSE); + test_chunked_content_length_error(HTTP_RESPONSE); + test_header_cr_no_lf_error(HTTP_RESPONSE); + test_invalid_header_field_token_error(HTTP_RESPONSE); + test_invalid_header_field_content_error(HTTP_RESPONSE); + //// RESPONSES for (i = 0; i < response_count; i++) { @@ -3601,6 +3932,10 @@ main (void) test_message_pause(&responses[i]); } + for (i = 0; i < response_count; i++) { + test_message_connect(&responses[i]); + } + for (i = 0; i < response_count; i++) { if (!responses[i].should_keep_alive) continue; for (j = 0; j < response_count; j++) { @@ -3667,6 +4002,11 @@ main (void) test_simple("GET / HTP/1.1\r\n\r\n", HPE_INVALID_VERSION); + // Extended characters - see nodejs/test/parallel/test-http-headers-obstext.js + test_simple("GET / HTTP/1.1\r\n" + "Test: Düsseldorf\r\n", + HPE_OK); + // Well-formed but incomplete test_simple("GET / HTTP/1.1\r\n" "Content-Type: text/plain\r\n" @@ -3690,7 +4030,12 @@ main (void) "MOVE", "PROPFIND", "PROPPATCH", + "SEARCH", "UNLOCK", + "BIND", + "REBIND", + "UNBIND", + "ACL", "REPORT", "MKACTIVITY", "CHECKOUT", @@ -3700,6 +4045,10 @@ main (void) "SUBSCRIBE", "UNSUBSCRIBE", "PATCH", + "PURGE", + "MKCALENDAR", + "LINK", + "UNLINK", 0 }; const char **this_method; for (this_method = all_methods; *this_method; this_method++) { diff --git a/deps/npm/.mailmap b/deps/npm/.mailmap index 84886514da4666..06eb16cff3ee50 100644 --- a/deps/npm/.mailmap +++ b/deps/npm/.mailmap @@ -2,6 +2,8 @@ Alex K. Wolfe Andrew Bradley Andrew Lunny Arlo Breault +Ashley Williams +Ashley Williams Benjamin Coe Benjamin Coe Brian White @@ -9,6 +11,7 @@ Cedric Nelson Charlie Robbins Dalmais Maxence Danila Gerasimov +Dave Galbraith David Beitey Domenic Denicola Einar Otto Stangvik @@ -20,17 +23,21 @@ Forbes Lindesay Forrest L Norvell Gabriel Barros Geoff Flarity +Ifeanyi Oraelosi Isaac Z. Schlueter Isaac Z. Schlueter isaacs Jake Verbaten James Sanders +James Treworgy Jason Smith Jonas Weber Julien Meddah +Kevin Lorenz Kris Windham Lin Clark Luke Arduini Maciej Małecki +Martin Ek Max Goodman Maxim Bogushevich Maximilian Antoni @@ -42,7 +49,9 @@ Rebecca Turner Rebecca Turner Ryan Emery Sam Mikes +Stephanie Snopek Takaya Kobayashi +Thomas Reggi Timo Weiß Tony Trent Mick @@ -51,3 +60,4 @@ Will Elwood Wout Mertens Yeonghoon Park Zeke Sikelianos +Zoujie Wzj diff --git a/deps/npm/.npmignore b/deps/npm/.npmignore index a128c9b604b34d..6f97b5dc0dcb48 100644 --- a/deps/npm/.npmignore +++ b/deps/npm/.npmignore @@ -7,6 +7,7 @@ npm-debug.log /test/packages/npm-test-depends-on-spark/which-spark.log /test/packages/test-package/random-data.txt /test/root +/test/npm_cache node_modules/marked node_modules/ronn node_modules/tap diff --git a/deps/npm/.travis.yml b/deps/npm/.travis.yml index d555682984faf5..02765e737b8d44 100644 --- a/deps/npm/.travis.yml +++ b/deps/npm/.travis.yml @@ -1,5 +1,7 @@ language: node_js node_js: + - "5" + - "4" - iojs - "0.12" - "0.10" @@ -8,8 +10,9 @@ env: - DEPLOY_VERSION=testing before_install: - "npm config set spin false" - - "npm install -g npm/npm#2.x" - - "sudo mkdir -p /var/run/couchdb" -script: "npm run-script test-all" + - "node . install -g ." + - "mkdir -p /var/run/couchdb" +sudo: false +script: "npm test" notifications: slack: npm-inc:kRqQjto7YbINqHPb1X6nS3g8 diff --git a/deps/npm/AUTHORS b/deps/npm/AUTHORS index 9b03dc4d363c9f..9d8bbe956198ca 100644 --- a/deps/npm/AUTHORS +++ b/deps/npm/AUTHORS @@ -291,11 +291,12 @@ Eduardo Pinho Rachel Hutchison Ryan Temple Eugene Sharygin -Nick Heiner James Talmage jane arc Joseph Dykstra +Andrew Crites Joshua Egan +Carlos Alberto Thomas Cort Thaddee Tyl Steve Klabnik @@ -308,7 +309,83 @@ murgatroid99 Marcin Cieslak João Reis Matthew Hasbach -Anna Henningsen Jon Hall +Anna Henningsen +James Treworgy James Hartig -snopeks +Stephanie Snopek +Kent C. Dodds +Aaron Krause +Daniel K O'Leary +fscherwi +Thomas Reggi +Thomas Michael McTiernan +Jason Kurian +Sebastiaan Deckers +lady3bean +Tomi Carr +Juan Caicedo +Ashley Williams +Andrew Marcinkevičius +Jorrit Schippers +Alex Lukin +Aria Stewart +Tiago Rodrigues +Tim +Nick Williams +Louis Larry +Ben Gotow +Jakub Gieryluk +Kevin Lorenz +Martin von Gagern +Eymen Gunay +Martin Ek +Rafał Pocztarski +Mark Reeder +Chris Rebert +Scott Addie +Jeff McMahan +Tim Krins +Hal Henke +Julian Simioni +Jimb Esser +Alexis Campailla +Chris Chua +Beau Gunderson +Dave Galbraith +s100 +Sergey Simonchik +Vanja Radovanović +Jonathan Persson +Vedat Mahir YILMAZ +Samuel Reed +Rafał Legiędź +Jan Schär +Xcat Liu +harryh +Prayag Verma +Neil Kistner +Zoujie Wzj +Ryan Hendrickson +Arturo Coronel +Hutson Betts +Lewis Cowper +Adam Byrne +Ifeanyi Oraelosi +Robert Ludwig +Chris Warren +Scott Plumlee +Daniel Pedersen +rhgb +doug.wade +Zac +GriffinSchneider +Andres Kalle +thefourtheye +Yael +Yann Odeyer +James Monger +Thomas Hallock +Paul Irish +Paul O'Leary McCann +Francis Gulotta diff --git a/deps/npm/CHANGELOG.md b/deps/npm/CHANGELOG.md index 8a8dbbca445cd5..698942905ed5c1 100644 --- a/deps/npm/CHANGELOG.md +++ b/deps/npm/CHANGELOG.md @@ -1,4353 +1,3400 @@ -### v2.14.7 (2015-10-01): - -#### MORE RELEASE STAGGERING?! - -Hi all, and greetings from [Open Source & Feelings](http://osfeels.com)! - -So we're switching gears a little with how we handle our weekly releases: from -now on, we're going to stagger release weeks between dependency bumps and -regular patches. So, this week, aside from a doc change, we'll be doing only -version bumps. Expect actual patches next week! +### v3.8.6 (2016-03-31) + +Heeeeeey y'all. + +Kat here! Rebecca's been schmoozing with folks at [Microsoft +Build](https://build.microsoft.com/), so I'm doing the `npm@3` release this +week. + +Speaking of Build, it looks like Microsoft is doing some bash thing. This might +be really good news for our Windows users once it rolls around. We're keeping an +eye out and feeling hopeful. 🙆 + +As far as the release goes: We're really happy to be getting more and more +community contributions! Keep it up! We really appreciate folks trying to help +us, and we'll do our best to help point you in the right direction. Even things +like documentation are a huge help. And remember -- you get socks for it, too! + +#### FIXES + +* [`f8fb4d8`](https://github.com/npm/npm/commit/f8fb4d83923810eb78d075bd200a9376c64c3e3a) + [#12079](https://github.com/npm/npm/pull/12079) + Back in `npm@3.2.2` we included [a patch that made it so `npm install pkg` was + basically `npm install pkg@latest` instead of + `pkg@*`](https://github.com/npm/npm/pull/9170) + This is probably what most users expected, but it also ended up [breaking `npm + deprecate`](https://github.com/npm/npm/pull/9170) when no version was provided + for a package. In that case, we were using `*` to mean "deprecate all + versions" and relying on the `pkg` -> `pkg@*` conversion. + This patch fixes `npm deprecate pkg` to work as it used to by special casing + that particular command's behavior. + ([@polm](https://github.com/polm)) +* [`458f773`](https://github.com/npm/npm/commit/458f7734f3376aba0b6ff16d34a25892f7717e40) + [#12146](https://github.com/npm/npm/pull/12146) + Adds `make doc-clean` to `prepublish` script, to clear out previously built + docs before publishing a new npm version + ([@watilde](https://github.com/watilde)) +* [`f0d1521`](https://github.com/npm/npm/commit/f0d1521038e956b2197673f36c464684293ce99d) + [#12146](https://github.com/npm/npm/pull/12146) + Adds `doc-clean` phony target to `make publish`. + ([@watilde](https://github.com/watilde)) -#### TOTALLY FOLLOWING THE RULES ALREADY +#### DOC UPDATES -So I snuck this in, because it's our own [@snopeks](https://github.com/snopeks)' -first contribution to the main `npm` repo. She's been helping with building -support documents for Orgs, and contributed her general intro guide to the new -feature so you can read it with `npm help orgs` right in your terminal! +* [`ea92ffc`](https://github.com/npm/npm/commit/ea92ffc9dd2a063896353fc52c104e85ec061360) + [#12147](https://github.com/npm/npm/pull/12147) + Document that the current behavior of `engines` is just to warn if the node + platform is incompatible. + ([@reconbot](https://github.com/reconbot)) +* [`cd1ba44`](https://github.com/npm/npm/commit/cd1ba4423b3ca889c741141b95b0d9472b9f71ea) + [#12143](https://github.com/npm/npm/pull/12143) + Remove `npm faq` command, since the [FAQ was + removed](https://github.com/npm/npm/pull/10547). + ([@watilde](https://github.com/watilde)) +* [`50a12cb`](https://github.com/npm/npm/commit/50a12cb1f5f158af78d6962ad20ff0a98bc18f18) + [#12143](https://github.com/npm/npm/pull/12143) + Remove references to the FAQ from the docs, since [it was + removed](https://github.com/npm/npm/pull/10547). + ([@watilde](https://github.com/watilde)) +* [`60051c2`](https://github.com/npm/npm/commit/60051c25e2ab80c667137dfcd04b242eea25980e) + [#12093](https://github.com/npm/npm/pull/12093) + Update `bugs` url in `package.json` to use the `https` URL for Github. + ([@watilde](https://github.com/watilde)) +* [`af30c37`](https://github.com/npm/npm/commit/af30c374ef22ed1a1c71b14fced7c4b8350e4e82) + [#12075](https://github.com/npm/npm/pull/12075) + Add the `--ignore-scripts` flag to the `npm install` docs. + ([@paulirish](https://github.com/paulirish)) +* [`632b214`](https://github.com/npm/npm/commit/632b214b2f2450e844410792e5947e46844612ff) + [#12063](https://github.com/npm/npm/pull/12063) + Various minor fixes to the html docs homepage. + ([@watilde](https://github.com/watilde)) -* [`8324ea0`](https://github.com/npm/npm/commit/8324ea023ace4e08b6b8959ad199e2457af9f9cf) - [#9761](https://github.com/npm/npm/pull/9761) Added general user guide for - Orgs. - ([@snopeks](https://github.com/snopeks)) +#### DEP BUMPS + +* [`3da0171`](https://github.com/npm/npm/commit/3da01716a0e41d6b5adee2b4fc70fcaf08c0eb24) + `lodash.without@4.1.2` + ([@jdalton](https://github.com/jdalton)) +* [`69ccf6d`](https://github.com/npm/npm/commit/69ccf6dd4caf95cd0628054307487cae1885acd0) + `lodash.uniq@4.2.1` + ([@jdalton](https://github.com/jdalton)) +* [`b50c41a`](https://github.com/npm/npm/commit/b50c41a9930dc5353a23c5ae2ff87bb99e11d482) + `lodash.union@4.2.1` + ([@jdalton](https://github.com/jdalton)) +* [`59c1ad7`](https://github.com/npm/npm/commit/59c1ad7b6f243d07618ed5703bd11d787732fc57) + `lodash.clonedeep@4.3.2` + ([@jdalton](https://github.com/jdalton)) +* [`2b4f797`](https://github.com/npm/npm/commit/2b4f797dba8e7a1376c8335b7223e82d02cd8243) + `lodash._baseuniq@4.5.1` + ([@jdalton](https://github.com/jdalton)) + +### v3.8.5 (2016-03-24) + +Like my esteemed colleague [@zkat](https://github.com/zkat) said in this +week's [LTS release notes](https://github.com/npm/npm/releases/tag/v2.15.2), +this week is another small release but we are continuing to work on our +[Windows efforts](https://github.com/npm/npm/pull/11444). + +You may also be interested in reading the [LTS process and +policy](https://github.com/npm/npm/wiki/LTS) that +[@othiym23](https://github.com/othiym23) put together recently. If you have any +feedback, we would love to hear. + +#### DOCTOR IT HURTS WHEN LINK TO MY LINK + +Well then, don't do that. + +* [`0d4a0b1`](https://github.com/npm/npm/commit/0d4a0b1) + [#11442](https://github.com/npm/npm/pull/11442) + Fail if the user asks us to make a link from a module back on to itself. + ([@antialias](https://github.com/antialias)) + +#### ERR MODULE LIST TOO LONG + +* [`b271ed2`](https://github.com/npm/npm/commit/b271ed2) + [#11983](https://github.com/npm/npm/issues/11983) + Exit early if no arguments were provided to search instead of trying to display all the modules, + running out of memory, and then crashing. + ([@SimenB](https://github.com/SimenB)) -#### JUST. ONE. MORE. +#### ELIMINATE UNUSED MODULE -* [`9a502ca`](https://github.com/npm/npm/commit/9a502ca96e2d43ec75a8f684c9ca33af7e910f0a) - Use unique package name in tests to work around weird test-state-based - failures. - ([@iarna](https://github.com/iarna)) +* [`b8c7cd7`](https://github.com/npm/npm/commit/b8c7cd7) + [#12000](https://github.com/npm/npm/pull/12000) + Stop depending on [`async-some`](https://npmjs.com/package/async-some) as it's no + longer used in npm. + ([@watilde](https://github.com/watilde)) -#### OKAY ACTUALLY THE THING I WAS SUPPOSED TO DO +#### DOCUMENTATION IMPROVEMENTS -Anyway -- here's your version bump! :) +* [`fdd6b28`](https://github.com/npm/npm/commit/fdd6b28) + [#11884](https://github.com/npm/npm/pull/11884) + Include `node_modules` in the list of files and directories that npm won't + include in packages ordinarily. (Modules listed in `bundledDependencies` and things + that those modules rely on, ARE included of course.) + ([@Jameskmonger](https://github.com/Jameskmonger)) +* [`aac15eb`](https://github.com/npm/npm/commit/aac15eb) + [#12006](https://github.com/npm/npm/pull/12006) + Fix typo in npm-orgs documentation, where teams docs went to access docs and vice versa. + ([@yaelz](https://github.com/yaelz)) -* [`4aeb94c`](https://github.com/npm/npm/commit/4aeb94c9f0df3f41802cf2e0397a998f3b527c25) - `request@2.64.0`: No longer defaulting to `application/json` for `json` - requests. Also some minor doc and packaging patches. - ([@simov](https://github.com/simov)) - `minimatch@3.0.0`: No longer packaging browser modules. - ([@isaacs](https://github.com/isaacs)) -* [`a18b213`](https://github.com/npm/npm/commit/a18b213e6945a8f5faf882927829ac95f844e2aa) - `glob@5.0.15`: Upgraded `minimatch` dependency. - ([@isaacs](https://github.com/isaacs)) -* [`9eb64d4`](https://github.com/npm/npm/commit/9eb64e44509519ca9d788502edb2eba4cea5c86b) - `nock@2.13.0` - ([@pgte](https://github.com/pgte)) +#### FEWER NETWORK TESTS -### v2.14.6 (2015-09-24): +* [`3e41360`](https://github.com/npm/npm/commit/3e41360) + [#11987](https://github.com/npm/npm/pull/11987) + Fix test that was inappropriately hitting the network + ([@yodeyer](https://github.com/yodeyer)) -#### `¯\_(ツ)_/¯` +### v3.8.4 (2016-03-24) -Since `2.x` is LTS now, you can expect a slowdown in overall release sizes. On -top of that, we had our all-company-npm-internal-conf thing on Monday and -Tuesday so there wasn't really time to do much at all. +Was erroneously released with just a changelog typo correction and was +otherwise the same as 3.8.3. -Still, we're bringing you a couple of tiny little changes this week! +### v3.8.3 (2016-03-17): -* [`7b7da13`](https://github.com/npm/npm/commit/7b7da13c6cdf5eae53c20d5c69afc4c16e6f715d) - [#9471](https://github.com/npm/npm/pull/9471) When the port for a tarball is - different than the registry it's in, but the hostname is the same, the - protocol is now allowed to change, too. - ([@fastest963](https://github.com/fastest963)) -* [`6643ada`](https://github.com/npm/npm/commit/6643adaf9f37f08893e3ad28b797c55a36b2a152) - `request@2.63.0`: Use `application/json` as the default content type when - making `json` requests. - ([@simov](https://github.com/simov)) +#### SECURITY ADVISORY: BEARER TOKEN DISCLOSURE -### v2.14.5 (2015-09-17): +This release includes [the fix for a +vulnerability](https://github.com/npm/npm/commit/f67ecad59e99a03e5aad8e93cd1a086ae087cb29) +that could cause the unintentional leakage of bearer tokens. -#### NPM IS DEAD. LONG LIVE NPM +Here are details on this vulnerability and how it affects you. -That's right folks. As of this week, `npm@latest` is `npm@3`! There's some -really great shiny new things over there, and you should really take a look. +##### DETAILS -Many kudos to [@iarna](https://github.com/iarna) for her hard work on `npm@3`! +Since 2014, npm’s registry has used HTTP bearer tokens to authenticate requests +from the npm’s command-line interface. A design flaw meant that the CLI was +sending these bearer tokens with _every_ request made by logged-in users, +regardless of the destination of their request. (The bearers only should have +been included for requests made against a registry or registries used for the +current install.) -Don't worry, we'll keep `2.x` around for a while (as LTS), but you won't see -many, if any, new features on this end. From now on, we're going to use -`latest-2` and `next-2` as the dist tags for the `npm@2` branch. +An attacker could exploit this flaw by setting up an HTTP server that could +collect authentication information, then use this authentication information to +impersonate the users whose tokens they collected. This impersonation would +allow them to do anything the compromised users could do, including publishing +new versions of packages. -#### OKAY THAT'S FINE CAN I DEPRECATE THINGS NOW? +With the fixes we’ve released, the CLI will only send bearer tokens with +requests made against a registry. -Yes! Specially if you're using scoped packages. Apparently, deprecating them -never worked, but that should be better now. :) +##### THINK YOU'RE AT RISK? REGENERATE YOUR TOKENS -* [`eca7b24`](https://github.com/npm/npm/commit/eca7b24de9a0090da02a93a69726f5e70ab80543) - [#9558](https://github.com/npm/npm/issues/9558) Add tests for npm deprecate. - ([@zkat](https://github.com/zkat)) -* [`648fe16`](https://github.com/npm/npm/commit/648fe16157ef0db22395ae056d1dd4b4c1605bf4) - [#9558](https://github.com/npm/npm/issues/9558) `npm-registry-client@7.0.7`: - Fixes `npm deprecate` so you can actually deprecate scoped modules now (it - never worked). - ([@zkat](https://github.com/zkat)) +If you believe that your bearer token may have been leaked, [invalidate your +current npm bearer tokens](https://www.npmjs.com/settings/tokens) and rerun +`npm login` to generate new tokens. Keep in mind that this may cause continuous +integration builds in services like Travis to break, in which case you’ll need +to update the tokens in your CI server’s configuration. -#### WTF IS `node-waf` +##### WILL THIS BREAK MY CURRENT SETUP? -idk. Some old thing. We don't talk about it anymore. +Maybe. -* [`cf1b39f`](https://github.com/npm/npm/commit/cf1b39fc95a9ffad7fba4c2fee705c53b19d1d16) - [#9584](https://github.com/npm/npm/issues/9584) Fix ancient references to - `node-waf` in the docs to refer to the `node-gyp` version of things. - ([@KenanY](https://github.com/KenanY)) +npm’s CLI team believes that the fix won’t break any existing registry setups. +Due to the large number of registry software suites out in the wild, though, +it’s possible our change will be breaking in some cases. -#### THE `graceful-fs` AND `node-gyp` SAGA CONTINUES +If so, please [file an issue](https://github.com/npm/npm/issues/new) describing +the software you’re using and how it broke. Our team will work with you to +mitigate the breakage. -Last week had some sweeping `graceful-fs` upgrades, and this takes care of one -of the stragglers, as well as bumping `node-gyp`. `node@4` users might be -excited about this, or even `node@<4` users who previously had to cherry-pick a -bunch of patches to get the latest npm working. +##### CREDIT & THANKS -* [`e07354f`](https://github.com/npm/npm/commit/e07354f3ff3a6be568fe950f1f825897f72912d8) - `sha@2.0.1`: Upgraded graceful-fs! - ([@ForbesLindesay](https://github.com/ForbesLindesay)) -* [`83cb6ee`](https://github.com/npm/npm/commit/83cb6ee4045b85e565e9678ca1878877e1dc75bd) - `node-gyp@3.0.3` - ([@rvagg](https://github.com/rvagg)) +Thanks to Mitar, Will White & the team at Mapbox, Max Motovilov, and James +Taylor for reporting this vulnerability to npm. -#### DEPS! DEPS! MORE DEPS! OK STOP DEPS +#### PERFORMANCE IMPROVEMENTS -* [`0d60888`](https://github.com/npm/npm/commit/0d608889615a1cb63f5f852337e955053f201aeb) - `normalize-package-data@2.3.4`: Use an external package to check for built-in - node modules. - ([@sindresorhus](https://github.com/sindresorhus)) -* [`79b4dac`](https://github.com/npm/npm/commit/79b4dac11f1c2d8ad5489fc3104734e1c10d4793) - `retry@0.8.0` - ([@tim-kos](https://github.com/tim-kos)) -* [`c164941`](https://github.com/npm/npm/commit/c164941d3c792904d5b126a4fd36eefbe0699f52) - `request@2.62.0`: node 4 added to build targets. Option initialization issues - fixed. - ([@simov](https://github.com/simov)) -* [`0fd878a`](https://github.com/npm/npm/commit/0fd878a44d5ae303325808d1f00df4dce7549d50) - `lru-cache@2.7.0`: Cache serialization support and fixes a cache length bug. - ([@isaacs](https://github.com/isaacs)) -* [`6a7a114`](https://github.com/npm/npm/commit/6a7a114a45b4699995d6e09164fdfd0fa1274591) - `nock@2.12.0` - ([@pgte](https://github.com/pgte)) -* [`6b25e6d`](https://github.com/npm/npm/commit/6b25e6d2235c11f4444104db4545cb42a0267666) - `semver@5.0.3`: Removed uglify-js dead code. - ([@isaacs](https://github.com/isaacs)) +The updated [`are-we-there-yet`](https://npmjs.com/package/are-we-there-yet) +changes how it tracks how complete things are to be much more efficient. +The summary is that `are-we-there-yet` was refactored to remove an expensive +tree walk. -### v2.14.4 (2015-09-10): +The result for you should be faster installs when working with very large trees. -#### THE GREAT NODEv4 SAGA +Previously `are-we-there-yet` computed this when you asked by passing the request down +its tree of progress indicators, totaling up the results. In doing so, it had to walk the +entire tree of progress indicators. -So [Node 4 is out now](https://nodejs.org/en/blog/release/v4.0.0/) and that's -going to involve a number of things over in npm land. Most importantly, it's the -last major release that will include the `2.x` branch of npm. That also means -that `2.x` is going to go into LTS mode in the coming weeks -- once `npm@3` -becomes our official `latest` release. You can most likely expect Node 5 to -include `npm@3` by default, whenever that happens. We'll go into more detail -about LTS at that point, as well, so keep your eyes peeled for announcements! +By contrast, `are-we-there-yet` now updates a running total when a change +is made, bubbling that up the tree from whatever branch made progress. This +bubbling was already going on so there was nearly no cost associated with taking advantage of it. -#### NODE IS DEAD. LONG LIVE NODE! +* [`32f2bd0`](https://github.com/npm/npm/commit/32f2bd0e26116db253e619d67c4feae1de3ad2c2) + `npmlog@2.0.3`: + Bring in substantial performance improvements from `are-we-there-yet`. + ([@iarna](https://github.com/iarna)) -Node 4 being released means that a few things that used to be floating patches -are finally making it right into npm proper. This week, we've got two such -updates, both to dependencies: +#### DUCT TAPE FOR BUGS -* [`505d9e4`](https://github.com/npm/npm/commit/505d9e40c13b8b0bb3f70ee9886f7b73ba569407) - `node-gyp@3.0.1`: Support for node nightlies and compilation for both node and - io.js without extra patching - ([@rvagg](https://github.com/rvagg)) +* [`473d324`](https://github.com/npm/npm/commit/473d3244a8ddfd6b260d0aa0d395b119d595bf97) + [#11947](https://github.com/npm/npm/pull/11947) + Guard against bugs that could cause the installer to crash with errors like: -[@thefourtheye](https://github.com/thefourtheye) was kind enough to submit a -*bunch* of PRs to npm's dependencies updating them to `graceful-fs@4.1.2`, which -mainly makes it so we're no longer monkey-patching `fs`. The following are all -updates related to this: + ``` + TypeError: Cannot read property 'target' of null + ``` -* [`10cb189`](https://github.com/npm/npm/commit/10cb189c773fef804214018d57509cc7a943184b) - `write-file-atomic@1.1.3` - ([@thefourtheye](https://github.com/thefourtheye)) -* [`edfb80b`](https://github.com/npm/npm/commit/edfb80b39f8cfce9a993f139eb98248001198e09) - `tar@2.2.1` - ([@thefourtheye](https://github.com/thefourtheye)) -* [`aa6e1ee`](https://github.com/npm/npm/commit/aa6e1eede7d71fa69d7256afdfbaa3406bc39a5b) - `read-package-json@2.0.1` - ([@thefourtheye](https://github.com/thefourtheye)) -* [`18971a3`](https://github.com/npm/npm/commit/18971a361635ed3958ecd39b63930ae1e56f8612) - `read-installed@4.0.3` - ([@thefourtheye](https://github.com/thefourtheye)) -* [`a4cba71`](https://github.com/npm/npm/commit/a4cba71bd2532236fda7385bf55e8790cafd4f0a) - `fstream@1.0.8` - ([@thefourtheye](https://github.com/thefourtheye)) -* [`70a38e2`](https://github.com/npm/npm/commit/70a38e29418951ac61ab6cf269d188074fe8ac3a) - `fs-write-stream-atomic@1.0.4` - ([@thefourtheye](https://github.com/thefourtheye)) -* [`9cbd20f`](https://github.com/npm/npm/commit/9cbd20f691e37960e4ba12d401abd1069657cb47) - `fs-vacuum@1.2.7` + This doesn't fix the bugs, but it does at least make the installer less + likely to explode. ([@thefourtheye](https://github.com/thefourtheye)) -#### OTHER PATCHES +#### DOC FIXES -* [`c4dd521`](https://github.com/npm/npm/commit/c4dd5213b2f3283ea0392845e5f78cac4573529e) - [#9506](https://github.com/npm/npm/issues/9506) Make `npm link` work on - Windows when using node pre-release/RC releases. - ([@jon-hall](https://github.com/jon-hall)) -* [`b6bc29c`](https://github.com/npm/npm/commit/b6bc29c1401b3d6b570c09cbef1866bdb0436b59) - [#9544](https://github.com/npm/npm/issues/9549) `process.binding` is being - deprecated, so our only direct usage has been removed. - ([@ChALkeR](https://github.com/ChALkeR)) - -#### MORE DEPENDENCIES! +* [`ffa428a`](https://github.com/npm/npm/commit/ffa428a4eee482aa620819bc8df994a76fad7b0c) + [#11880](https://github.com/npm/npm/pull/11880) + Fix typo in `npm install` documentation. + ([@watilde](https://github.com/watilde)) -* [`d940594`](https://github.com/npm/npm/commit/d940594e479a7f012b6dd6952e8ef985ba2a6216) - `tap@1.4.1` - ([@isaacs](https://github.com/isaacs)) -* [`ee38486`](https://github.com/npm/npm/commit/ee3848669331fd98879a3175789d963543f67ce3) - `which@1.1.2`: Added tests for Windows-related dead code that was previously - helping a silent failure happen. Travis stuff, too. - ([@isaacs](https://github.com/isaacs)) +#### DEPENDENCY UPDATES -#### DOC UPDATES +* [`7537fe1`](https://github.com/npm/npm/commit/7537fe1748c27e6f1144b279b256cd3376d5c41c) + `sorted-object@2.0.0`: + Create objects with `{}` instead of `Object.create(null)` to make the results + strictly equal to what, say, parsed JSON would provide. + ([@domenic](https://github.com/domenic)) +* [`8defb0f`](https://github.com/npm/npm/commit/8defb0f7b3ebdbe15c9ef5036052c10eda7e3161) + `readable-stream@2.0.6`: + Fix sync write issue on 0.10. + ([@calvinmetcalf](https://github.com/calvinmetcalf)) + +#### TEST FIXES FOR THE SELF TESTS + +* [`c3edeab`](https://github.com/npm/npm/commit/c3edeabece4400308264e7cf4bc4448bd2729f55) + [#11912](https://github.com/npm/npm/pull/11912) + Change the self installation test to do its work in `/tmp`. + Previously this was installing into a temp subdir in `test/tap`, which + wouldn't catch the case where a module was installed in the local + `node_modules` folder but not in dependencies, as node would look up + the tree and use the copy from the version of npm being tested. + ([@iarna](https://github.com/iarna)) -* [`475daf5`](https://github.com/npm/npm/commit/475daf54ad07777938d1d7ee1a3e576961e84510) - [#9492](https://github.com/npm/npm/issues/9492) Clarify how `.npmignore` and - `.gitignore` are found and used by npm. - ([@addaleax](https://github.com/addaleax)) -* [`b2c391d`](https://github.com/npm/npm/commit/b2c391d7833249626a6d7650363a83bcc778717a) - `nopt@3.0.4`: Minor clarifications to docs about how array and errors work. - ([@zkat](https://github.com/zkat)) +### v3.8.2 (2016-03-10): -### v2.14.3 (2015-09-03): +#### HAVING TROUBLE INSTALLING C MODULES ON ANDROID? -#### TEAMS AND ORGS STILL BETA. CLI CODE STILL SOLID. +This release includes an updated `node-gyp` with fixes for Android. -Our closed beta for Teens and Orcs is happening! The web team is hard at work -making sure everything looks pretty and usable and such. Once we fix things -stemming from that beta, you can expect the feature to be available publicly. -Some time after that, it'll even be available for free for FOSS orgs. It'll Be -Done When It's Done™. +* [`634ecba`](https://github.com/npm/npm/commit/634ecba320fb5a3287e8b7debfd8b931827b9e19) + `node-gyp@3.3.1`: + Fix bug in builds for Android. + ([@bnoordhuis](https://github.com/bnoordhuis)) -#### OH GOOD, I CAN ACTUALLY UPSTREAM NOW +#### NPM LOGOUT CLEANS UP BETTER -Looks like last week's release foiled our own test suite when trying to upstream -it to Node! Just a friendly reminder that no, `.npmrc` is no longer included -then you pack/release a package! [@othiym23](https://github.com/othiym23) and -[@isaacs](https://github.com/isaacs) managed to suss the really strange test -failures resulting from that, and we've patched it in this release. +* [`460ed21`](https://github.com/npm/npm/commit/460ed217876ac78d21477c288f1c06563fb770b4) + [#10529](https://github.com/npm/npm/issues/10529) + If you ran `npm logout` with a scope, while we did invalidate your auth + token, we weren't removing the auth token from your config file. This patch causes + the auth token to be removed. + ([@wyze](https://github.com/wyze)) -* [`01a3428`](https://github.com/npm/npm/commit/01a3428534b754dca89a56fd1e49f55cb22f6f25) - [#9476](https://github.com/npm/npm/issues/9476) test: Recreate missing - `.npmrc` files when missing so downstream packagers can run tests on packed - npm. - ([@othiym23](https://github.com/othiym23)) +#### HELP MORE HELPFUL -#### TALKING ABOUT THE CHANGELOG IN THE CHANGELOG IS LIKE, POMO OR SOMETHING +* [`d1d0233`](https://github.com/npm/npm/commit/d1d02335d297da2734b538de44d8967bdcd354cf) + [#11003](https://github.com/npm/npm/issues/11003) + Update help to only show command names and their shortcuts. Previously + some typo corrections were shown, along with various alternate + spellings. + ([@watilde](https://github.com/watilde)) +* [`47928cd`](https://github.com/npm/npm/commit/47928cd6264e1d6d0ef67435b71c66d01bea664a) + [#11003](https://github.com/npm/npm/issues/11003) + Remove "verison" typo from the help listing. + ([@doug-wade](https://github.com/doug-wade)) -* [`c1e7a83`](https://github.com/npm/npm/commit/c1e7a83c0ae7aadf01aecc57cf8a0ae2009d4da8) - [#9431](https://github.com/npm/npm/issues/9431) CHANGELOG: clarify - windows-related nature of patch - ([@saper](https://github.com/saper)) +#### MORE COMPLETE CONFIG LISTINGS -#### devDependencies UPDATED +* [`cf5fd40`](https://github.com/npm/npm/commit/cf5fd401494d96325d74a8bb8c326aa0045a714c) + [#11472](https://github.com/npm/npm/issues/11472) + Make `npm config list` include the per-project `.npmrc` in the output. + ([@mjomble](https://github.com/mjomble)) -No actual dep updates this week, but we're bumping a couple of devDeps: +#### DEPTH LIMITED PARSEABLE DEP LISTINGS -* [`8454835`](https://github.com/npm/npm/commit/84548351bfd63e3e305d195abbcad24c6b7c3e8e) - `tap@1.4.0`: Add `t.contains()` as alias to `t.match()` - ([@isaacs](https://github.com/isaacs)) -* [`13d2216`](https://github.com/npm/npm/commit/13d22161bcdeb6e1ed095d5ba2f77e6abfffa5eb) - `deep-equal@1.0.1`: Make `null == undefined` in non-strict mode - ([@isaacs](https://github.com/isaacs)) +* [`611070f`](https://github.com/npm/npm/commit/611070f0f7a1e185c75cadae46179194084b398f) + [#11495](https://github.com/npm/npm/issues/11495) + Made `npm ls --parseable` honor the `--depth=#` option. + ([@zacdoe](https://github.com/zacdoe)) -### v2.14.2 (2015-08-27): - -#### GETTING THAT PESKY `preferGlobal` WARNING RIGHT - -So apparently the `preferGlobal` option hasn't quite been warning correctly for -some time. But now it should be all better! tl;dr: if you try and install a -dependency with `preferGlobal: true`, and it's _not already_ in your -`package.json`, you'll get a warning that the author would really rather you -install it with `--global`. This should prevent Windows PowerShell from thinking -npm has failed just because of a benign warning. - -* [`bbb25f3`](https://github.com/npm/npm/commit/bbb25f30d582f8979168c79233a9f8f840974f90) - [#8841](https://github.com/npm/npm/issues/8841) - [#9409](https://github.com/npm/npm/issues/9409) The `preferGlobal` - warning shouldn't happen if the dependency being installed is listed in - `devDependencies`. ([@saper](https://github.com/saper)) -* [`222fcec`](https://github.com/npm/npm/commit/222fcec85ccd30d35899e5037079fb14625af4e2) - [#9409](https://github.com/npm/npm/issues/9409) `preferGlobal` now prints a - warning when there are no dependencies for the current package. - ([@zkat](https://github.com/zkat)) -* [`5cfed6d`](https://github.com/npm/npm/commit/5cfed6d7a1a5f2731688cfc8293b5e43a6355393) - [#9409](https://github.com/npm/npm/issues/9409) Verify that - `preferGlobal` is warning as expected (when a `preferGlobal` dependency is - installed, but isn't listed in either `dependencies` or `devDependencies`). - ([@zkat](https://github.com/zkat)) +#### PROGRESS FOR THE (NON) UNICODE REVOLUTION -#### BUMP +1 +* [`ff90382`](https://github.com/npm/npm/commit/ff9038227a1976b5e936442716d9877f43c6c9b4) + [#11781](https://github.com/npm/npm/issues/11781) + Make the progress bars honor the unicode option. + ([@watilde](https://github.com/watilde)) -* [`eeafce2`](https://github.com/npm/npm/commit/eeafce2d06883c0f51bf403415b6bc5f2647eba3) - `validate-npm-package-license@3.0.1`: Include additional metadata in parsed license object, - useful for license checkers. ([@kemitchell](https://github.com/kemitchell)) -* [`1502a28`](https://github.com/npm/npm/commit/1502a285f84aa548806b3eafc8889e6288e810f3) - `normalise-package-data@2.3.2`: Updated to use `validate-npm-package-license@3.0.1`. - ([@othiym23](https://github.com/othiym23)) -* [`cbde823`](https://github.com/npm/npm/commit/cbde8233436bf0ea62a4740869b4990322c20659) - `init-package-json@1.9.1`: Add a `silent` option to suppress output on writing the - generated `package.json`. Also, updated to use `validate-npm-package-license@3.0.1`. - ([@zkat](https://github.com/zkat)) -* [`08fda46`](https://github.com/npm/npm/commit/08fda465452b4d77f1ced8050ee3a35a77fc30a5) - `tar@2.2.0`: Minor improvements. ([@othiym23](https://github.com/othiym23)) -* [`dc2f20b`](https://github.com/npm/npm/commit/dc2f20b53fff77203139c863b48da0e959df2ac9) - `rimraf@2.4.3`: `EPERM` now triggers a delay / retry loop (since Windows throws - this when things still hold a handle). ([@isaacs](https://github.com/isaacs)) -* [`e8acb27`](https://github.com/npm/npm/commit/e8acb273aa67ee0394d0431650e1b2a7d09c8554) - `read@1.0.7`: Fix licensing ambiguity. ([@isaacs](https://github.com/isaacs)) - -#### OTHER STUFF THAT'S RELEVANT - -* [`73a1ee0`](https://github.com/npm/npm/commit/73a1ee0be90fa1928521b63f28bef83b8ffab61d) - [#9386](https://github.com/npm/npm/issues/9386) Include additional unignorable files in - documentation. - ([@mjhasbach](https://github.com/mjhasbach)) -* [`0313e40`](https://github.com/npm/npm/commit/0313e40ee0f757fce8861be590ad668c23d7be53) - [#9396](https://github.com/npm/npm/issues/9396) Improve the `EISDIR` error - message returned by npm's error-handling code to give users a better hint of - what's most likely going on. Usually, error reports with this error code are - about people trying to install things without a `package.json`. - ([@KenanY](https://github.com/KenanY)) -* [`2677457`](https://github.com/npm/npm/commit/26774579c739c5951351e58263cf4d6ea3d66ec8) - [#9360](https://github.com/npm/npm/issues/9360) Make it easier to run - only _some_ of npm tests with lifecycle scripts via `npm tap test/tap/testname.js`. +#### `npm view --json`, NOW ACTUALLY JSON + +* [`24ab70a`](https://github.com/npm/npm/commit/24ab70a4ccfeaa005b80252da313bb589510668e) + [#11808](https://github.com/npm/npm/issues/11808) + Make `npm view` produce valid JSON when requested with `--json`. + Previously `npm view` produced some sort of weird hybrid output, with multiple + JSON docs. + ([@doug-wade](https://github.com/doug-wade)) + +#### DOCUMENTATION CHANGES + +* [`6fb0499`](https://github.com/npm/npm/commit/6fb0499bea868fdc637656d210c94f051481ecd4) + [#11726](https://github.com/npm/npm/issues/11726) + Previously we patched the `npm update` docs to suggest using `--depth + Infinity` instead of `--depth 9999`, but that was a mistake. We forgot + that `npm outdated` (on which `npm update` is built) has a special + case where it treats `Infinity` as `0`. This reverts that patch. + ([@GriffinSchneider](https://github.com/GriffinSchneider)) +* [`f0bf684`](https://github.com/npm/npm/commit/f0bf684a87ea5eea03432a17f38678fed4960d43) + [#11748](https://github.com/npm/npm/pull/11748) + Document all of the various aliases for commands in the documentation + for those commands. + ([@watilde](https://github.com/watilde)) +* [`fe04443`](https://github.com/npm/npm/commit/fe04443d8988e2e41bd4047078e06a26d05d380d) + [#10968](https://github.com/npm/npm/issues/10968) + The `npm-scope` document notes that scopes have been available on the + public registry for a while. This adds that you'll need `npm@2` or later + to use them. + ([@doug-wade](https://github.com/doug-wade)) +* [`3db37a5`](https://github.com/npm/npm/commit/3db37a52b2b2e3193ef250ad2cf96dfd2def2777) + [#11820](https://github.com/npm/npm/pull/11820) + The command `npm link` should be linking package from local folder to + global, and `npm link package-name` should be from global to local. The + description in the documentation was reversed and this fixes that. + ([@rhgb](https://github.com/rhgb)) + +#### GLOB FOR THE GLOB THRONE + +* [`be55882`](https://github.com/npm/npm/commit/be55882dc4ee5ce0777b4badc9141dab5bf5be4d) + `glob@7.0.3`: + Fix a race condition and some windows edge cases. + ([@isaacs](https://github.com/isaacs)) + +### v3.8.1 (2016-03-03): + +This week the install summary got better, killing your npm process now +also kills the scripts it was running and a rarely used search flag got +documented. + +Our improvements on the test suite on Windows are beginning to pick up +steam, you can follow along by +[watching the PR](https://github.com/npm/npm/pull/11444). + +#### BETTER INSTALL SUMMARIES + +* [`e40d457`](https://github.com/npm/npm/commit/e40d4572cc98db06757df5b8bb6b7dbd0546d3d7) + [#11699](https://github.com/npm/npm/issues/11699) + Ensure that flags like `--production` passed to install don't result in + the summary at the end being incorrectly filtered. That summary is + produced by the same code as `npm ls` and therefore responds to flags + the same way it does. This is undesirable when it's an install summary, + however, as we don't want it to filter anything. + + This fixes an issue where `npm install --production ` would + result in npm exiting with an error code. The `--production` flag would + make `npm ls` filter out `` as it wasn't saved to the + `package.json` and thus wasn't a production dependency. The install + report is limited to show just the modules installed, so with that + filtered out nothing is available. With nothing available `npm ls` + would set `npm` to exit with an error code. + ([@ixalon](https://github.com/ixalon)) +* [`99337b4`](https://github.com/npm/npm/commit/99337b469163a4b211b9c6ff1aa9712ae0d601d2) + [#11600](https://github.com/npm/npm/pull/11600) + Make the report of installed modules really only show those modules + that were installed. Previously it selected which modules from your + tree to display based on `name@version` which worked great when your + tree was deduped but would list things it hadn't touched when there + were duplicates. ([@iarna](https://github.com/iarna)) -### v2.14.1 (2015-08-20): - -#### SECURITY FIX - -There are patches for two information leaks of moderate severity in `npm@2.14.1`: - -1. In some cases, npm was leaking sensitive credential information into the - child environment when running package and lifecycle scripts. This could - lead to packages being published with files (most notably `config.gypi`, a - file created by `node-gyp` that is a cache of environmental information - regenerated on every run) containing the bearer tokens used to authenticate - users to the registry. Users with affected packages have been notified (and - the affected tokens invalidated), and now npm has been modified to not - upload files that could contain this information, as well as scrubbing the - sensitive information out of the environment passed to child scripts. -2. Per-package `.npmrc` files are used by some maintainers as a way to scope - those packages to a specific registry and its credentials. This is a - reasonable use case, but by default `.npmrc` was packed into packages, - leaking those credentials. npm will no longer include `.npmrc` when packing - tarballs. - -If you maintain packages and believe you may be affected by either -of the above scenarios (especially if you've received a security -notification from npm recently), please upgrade to `npm@2.14.1` as -soon as possible. If you believe you may have inadvertently leaked -your credentials, upgrade to `npm@2.14.1` on the affected machine, -and run `npm logout` and then `npm login`. Your access tokens will be -invalidated, which will eliminate any risk posed by tokens inadvertently -included in published packages. We apologize for the inconvenience this -causes, as well as the oversight that led to the existence of this issue -in the first place. - -Huge thanks to [@ChALkeR](https://github.com/ChALkeR) for bringing these -issues to our attention, and for helping us identify affected packages -and maintainers. Thanks also to the Node.js security working group for -their coördination with the team in our response to this issue. We -appreciate everybody's patience and understanding tremendously. - -* [`b9474a8`](https://github.com/npm/npm/commit/b9474a843ca55b7c5fac6da33989e8eb39aff8b1) - `fstream-npm@1.0.5`: Stop publishing build cruft (`config.gypi`) and per-project - `.npmrc` files to keep local configuration out of published packages. - ([@othiym23](https://github.com/othiym23)) -* [`13c286d`](https://github.com/npm/npm/commit/13c286dbdc3fa8fec4cb79fc4d1ee505c8a41b2e) - [#9348](https://github.com/npm/npm/issues/9348) Filter "private" - (underscore-prefixed, even when scoped to a registry) configuration values - out of child environments. ([@othiym23](https://github.com/othiym23)) - -#### BETTER WINDOWS INTEGRATION, ONE STEP AT A TIME - -* [`e40e71f`](https://github.com/npm/npm/commit/e40e71f2f838a8a42392f44e3eeec04e323ab743) - [#6412](https://github.com/npm/npm/issues/6412) Improve the search strategy - used by the npm shims for Windows to prioritize your own local npm installs. - npm has really needed this tweak for a long time, so hammer on it and let us - know if you run into issues, but with luck it will Just Work. - ([@joaocgreis](https://github.com/joaocgreis)) -* [`204ebbb`](https://github.com/npm/npm/commit/204ebbb3e0cab696a429a878ceeb4a7e78ec2b94) - [#8751](https://github.com/npm/npm/issues/8751) - [#7333](https://github.com/npm/npm/issues/7333) Keep [autorun - scripts](https://technet.microsoft.com/en-us/sysinternals/bb963902.aspx) from - interfering with npm package and lifecycle script execution on Windows by - adding `/d` and `/s` when invoking `cmd.exe`. - ([@saper](https://github.com/saper)) +#### SCRIPTS BETTER FOLLOW THE LEADER -#### IT SEEMED LIKE AN IDEA AT THE TIME +* [`5454347`](https://github.com/npm/npm/commit/545434766eb3681d3f40b745f9f3187ed63f310a) + [#10868](https://github.com/npm/npm/pull/10868) + When running a lifecycle script, say through `npm start`, killing npm + wouldn't forward that on to the children. It does now. + ([@daniel-pedersen](https://github.com/daniel-pedersen)) -* [`286f3d9`](https://github.com/npm/npm/commit/286f3d97103812f0fd84b70352addbe899e258f9) - [#9201](https://github.com/npm/npm/pull/9201) For a while npm was building - HTML partials for use on [`docs.npmjs.com`](https://docs.npmjs.com), but we - weren't actually using them. Stop building them, which makes running the full - test suite and installation process around a third faster. - ([@isaacs](https://github.com/isaacs)) +#### SEARCHING SPECIFIC REGISTRIES -#### A SINGLE LONELY DEPENDENCY UPGRADE +* [`6020447`](https://github.com/npm/npm/commit/60204479f76458a9864aa530cda2b3333f95c2b0) + [#11490](https://github.com/npm/npm/pull/11490) + Add docs for using the `--registry` flag with search. + ([@plumlee](https://github.com/plumlee)) -* [`b343b95`](https://github.com/npm/npm/commit/b343b956ef777e321e4251ddc96ec6d80827d9e2) - `request@2.61.0`: Bug fixes and keep-alive tweaks. - ([@simov](https://github.com/simov)) +#### LODASH UPDATES -### v2.14.0 (2015-08-13): +* [`bb14204`](https://github.com/npm/npm/commit/bb14204183dad620a6650452a26cdc64111f8136) + `lodash.without@4.1.1` + ([@jdalton](https://github.com/jdalton)) +* [`0089059`](https://github.com/npm/npm/commit/0089059c562aee9ad0398e55d2c12c68a6150e79) + `lodash.keys@4.0.5` + ([@jdalton](https://github.com/jdalton)) +* [`6ee1de4`](https://github.com/npm/npm/commit/6ee1de4474d9683a1f7023067d440780eeb10311) + `lodash.clonedeep@4.3.1` + ([@jdalton](https://github.com/jdalton)) -#### IT'S HERE! KINDA! +### v3.8.0 (2016-02-25): -This release adds support for teens and orcs (err, teams and organizations) to -the npm CLI! Note that the web site and registry-side features of this are -still not ready for public consumption. +This week brings a quality of life improvement for some Windows users, and +an important knob to be tuned for folks experiencing network problems. -A beta should be starting in the next couple of weeks, and the features -themselves will become public once all that's done. Keep an eye out for more -news! +#### LIMIT CONCURRENT REQUESTS -All of these changes were done under [`#9011`](https://github.com/npm/npm/pull/9011): +We've long known that `npm`'s tendency to try to request all your +dependencies simultaneously upset some network hardware (particular, +consumer grade routers & proxies of all sorts). One of the reasons that we're +planning to write our own npm specific version of `request` is to be able to +more easily control this sort of thing. -* [`6424170`](https://github.com/npm/npm/commit/6424170fc17c666a6efc090370ec691e0cab1792) - Added new `npm team` command and subcommands. - ([@zkat](https://github.com/zkat)) -* [`52220d1`](https://github.com/npm/npm/commit/52220d146d474ec29b683bd99c06f75cbd46a9f4) - Added documentation for new `npm team` command. - ([@zkat](https://github.com/zkat)) -* [`4e66830`](https://github.com/npm/npm/commit/4e668304850d02df8eb27a779fda76fe5de645e7) - Updated `npm access` to support teams and organizations. - ([@zkat](https://github.com/zkat)) -* [`ea3eb87`](https://github.com/npm/npm/commit/ea3eb8733d9fa09ce34106b1b19fb1a8f95844a5) - Gussied up docs for `npm access` with new commands. - ([@zkat](https://github.com/zkat)) -* [`6e0b431`](https://github.com/npm/npm/commit/6e0b431c1de5e329c86e57d097aa88ebfedea864) - Fix up `npm whoami` to make the underlying API usable elsewhere. - ([@zkat](https://github.com/zkat)) -* [`f29c931`](https://github.com/npm/npm/commit/f29c931012ce5ccd69c29d83548f27e443bf7e62) - `npm-registry-client@7.0.1`: Upgrade `npm-registry-client` API to support - `team` and `access` calls against the registry. - ([@zkat](https://github.com/zkat)) +But fortunately, you don't have to wait for that. +[@misterbyrne](https://github.com/misterbyrne) took a look at our existing +code and realized it could be added painlessly TODAY. The new default +maximum is `50`, instead of `Infinity`. If you're having network issues you +can try setting that value down to something lower (if you do, please let us +know... the default is subject to tuning). -#### A FEW EXTRA VERSION BUMPS +* [`910f9ac`](https://github.com/npm/npm/commit/910f9accf398466b8497952bee9f566ab50ade8c) + [`f7be667`](https://github.com/npm/npm/commit/f7be667548a132ec190ac9d60a31885a7b4fe2b3) + Add a new config option, `maxsockets` and `npm-registry-client@7.1.0` to + take advantage of it. + ([@misterbyrne](https://github.com/misterbyrne)) -* [`c977e12`](https://github.com/npm/npm/commit/c977e12cbfa50c2f52fc807f5cc19ba1cc1b39bf) - `init-package-json@1.8.0`: Checks for some `npm@3` metadata. - ([@iarna](https://github.com/iarna)) -* [`5c8c9e5`](https://github.com/npm/npm/commit/5c8c9e5ae177ba7d0d298cfa42f3fc7f0271e4ec) - `columnify@1.5.2`: Updated some dependencies. - ([@timoxley](https://github.com/timoxley)) -* [`5d56742`](https://github.com/npm/npm/commit/5d567425768b75aeab402c817a53d8b2bc60d8de) - `chownr@1.0.1`: Tests, docs, and minor style nits. - ([@isaacs](https://github.com/isaacs)) +#### WINDOWS GIT BASH -#### ALSO A DOC FIX +We think it's pretty keen too, we were making it really hard to actually +upgrade if you were using it. NO MORE! -* [`846fcc7`](https://github.com/npm/npm/commit/846fcc79b86984b109a97366b0422f995a45f8bf) - [`#9200`](https://github.com/npm/npm/pull/9200) Remove single quotes - around semver range, thus making it valid semver. - ([@KenanY](https://github.com/KenanY)) +* [`d60351c`](https://github.com/npm/npm/commit/d60351ccae87d71a5f5eac73e3085c6290b52a69) + [#11524](https://github.com/npm/npm/issues/11524) + Prefer locally installed npm in Git Bash -- previous behavior was to use + the global one. This was done previously for other shells, but not for Git + Bash. + ([@destroyerofbuilds](https://github.com/destroyerofbuilds)) -### v2.13.5 (2015-08-07): +#### DOCUMENTATION IMPROVEMENTS -This is another quiet week for the `npm@2` release. -[@zkat](https://github.com/zkat) has been working hard on polishing the CLI -bits of the registry's new feature to support direct management of teams and -organizations, and [@iarna](https://github.com/iarna) continues to work through -the list of issues blocking the general release of `npm@3`, which is looking -more and more solid all the time. +* [`b63de3c`](https://github.com/npm/npm/commit/b63de3c97c4c27078944249a4d5bbe1c502c23bc) + [#11636](https://github.com/npm/npm/issues/11636) + Document `--save-bundle` option in main install page. + ([@datyayu](https://github.com/datyayu)) +* [`3d26453`](https://github.com/npm/npm/commit/3d264532d6d9df60420e985334aebb53c668d32b) + [#11644](https://github.com/npm/npm/pull/11644) + Add `directories.test` to the `package.json` documentation. + ([@lewiscowper](https://github.com/lewiscowper)) +* [`b64d124`](https://github.com/npm/npm/commit/b64d12432fdad344199b678d700306340d3607eb) + [#11441](https://github.com/npm/npm/pull/11441) + Add a link in documentation to the contribution guidelines. + ([@watilde](https://github.com/watilde)) +* [`82fc548`](https://github.com/npm/npm/commit/82fc548b0e2abbdc4f7968c20b118c30cca79a24) + [#11441](https://github.com/npm/npm/pull/11441/commits) + Remove mentions of the long defunct Google group. + ([@watilde](https://github.com/watilde)) +* [`c6ad091`](https://github.com/npm/npm/commit/c6ad09131af2e2766d6034257a8fcaa294184121) + [#11474](https://github.com/npm/npm/pull/11474) + Correct invalid JSON in npm-update docs. + ([@robludwig](https://github.com/robludwig)) +* [`4906c90`](https://github.com/npm/npm/commit/4906c90ed2668adf59ebee759c7ebb811aa46e57) + Expand on the documentation for `bundlededDependencies`, explaining what they are + and when you might want to use them. + ([@gnerkus](https://github.com/gnerkus)) -[@othiym23](https://github.com/othiym23) and [@zkat](https://github.com/zkat) -have also been at this week's Node.js / io.js [collaborator -summit](https://github.com/nodejs/summit/tree/master), both as facilitators and -participants. This is a valuable opportunity to get some face time with other -contributors and to work through a bunch of important discussions, but it does -leave us feeling kind of sleepy. Running meetings is hard! +#### DEPENDENCY UPDATES -What does that leave for this release? A few of the more tricky bug fixes that -have been sitting around for a little while now, and a couple dependency -upgrades. Nothing too fancy, but most of these were contributed by developers -like _you_, which we think is swell. Thanks! +* [`93cdc25`](https://github.com/npm/npm/commit/93cdc25432b71cbc9c25c54ae316770e18f4b01e) + `strip-ansi@3.0.1`: + Non-user visible tests & maintainer doc updates. + ([@jbnicolai](https://github.com/jbnicolai)) +* [`3b2ccef`](https://github.com/npm/npm/commit/3b2ccef30dc2038b99ba93cd1404a1d01dac8790) + `lodash.keys@4.0.4` + ([@jdalton](https://github.com/jdalton)) +* [`30e9eb9`](https://github.com/npm/npm/commit/30e9eb97397a8f85081d328ea9aa54c2a7852613) + `lodash._baseuniq@4.5.0` + ([@jdalton](https://github.com/jdalton)) -#### BUG FIXES -* [`d7271b8`](https://github.com/npm/npm/commit/d7271b8226712479cdd339bf85faf7e394923e0d) - [#4530](https://github.com/npm/npm/issues/4530) The bash completion script - for npm no longer alters global completion behavior around word breaks. - ([@whitty](https://github.com/whitty)) -* [`c9ce294`](https://github.com/npm/npm/commit/c9ce29415a0a8fc610690b6e9d91b64d6e36cfcc) - [#7198](https://github.com/npm/npm/issues/7198) When setting up dependencies - to be shared via `npm link `, only run the lifecycle scripts during - the original link, not when running `npm link ` or `npm install - --link` against them. ([@murgatroid99](https://github.com/murgatroid99)) -* [`422da66`](https://github.com/npm/npm/commit/422da664bd3ce71313da447f170507faf5aac46a) - [#9108](https://github.com/npm/npm/issues/9108) Clear up minor confusion - around wording in `bundledDependencies` section of `package.json` docs. - ([@derekpeterson](https://github.com/derekpeterson)) -* [`6b42d99`](https://github.com/npm/npm/commit/6b42d99460885e715772d3487b1c548d2bc8a738) - [#9146](https://github.com/npm/npm/issues/9146) Include scripts that run for - `preversion`, `version`, and `postversion` in the section for lifecycle - scripts rather than the generic `npm run-script` output. - ([@othiym23](https://github.com/othiym23)) +### v3.7.5 (2016-02-22): -#### NOPE, NOT DONE WITH DEPENDENCY UPDATES +A quick fixup release because when I updated glob, I missed the subdep copies of itself +that it installed deeper in the tree. =/ -* [`91a48bb`](https://github.com/npm/npm/commit/91a48bb5ef5a990781c86f8b69b8a32cf4fac2d9) - `chmodr@1.0.1`: Ignore symbolic links when recursively changing mode, just - like the Unix command. ([@isaacs](https://github.com/isaacs)) -* [`4bbc86e`](https://github.com/npm/npm/commit/4bbc86e3825e2eee9a8758ba26bdea0cb6a2581e) - `nock@2.10.0` ([@pgte](https://github.com/pgte)) +This only effected people trying to update to `3.7.4` from `npm@2` or `npm@1`. Updates from +`npm@3` worked fine (as it fixes up the missing subdeps during installation). -### v2.13.4 (2015-07-30): +#### OH MY GLOB -#### JULY ENDS ON A FAIRLY QUIET NOTE +* [`63fa704`](https://github.com/npm/npm/commit/63fa7044569127e6e29510dc499a865189806076) + [#11633](https://github.com/npm/npm/issues/11633) + When updating the top level `npm` to `glob@7`, the subdeps that + still depended on `glob@6` got new versions installed but they + weren't added to the commit. This adds them back in. + ([@iarna](https://github.com/iarna)) -Hey everyone! I hope you've had a great week. We're having a fairly small -release this week while we wrap up Teams and Orgs (or, as we've taken to calling -it internally, _Teens and Orcs_). +### v3.7.4 (2016-02-18): + +I'm ([@iarna](https://github.com/iarna)) back from vacation in the frozen +wastes of Maine! This release sees a couple of bug fixes, some +documentation updates, a bunch of dependency updates and improvements to our +test suite. + +#### FIXES FOR `update`, FIXES FOR `ls` + +* [`53cdb96`](https://github.com/npm/npm/commit/53cdb96634fc329378b4ea4e767ba9987986a76e) + [#11362](https://github.com/npm/npm/issues/11362) + Make `npm update` stop trying to update linked packages. + ([@rhendric](https://github.com/rhendric)) +* [`8d90d25`](https://github.com/npm/npm/commit/8d90d25b3da086843ce43911329c9572bd109078) + [#11559](https://github.com/npm/npm/issues/11559) + Only list runtime dependencies when doing `npm ls --production`. + ([@yibn2008](https://github.com/yibn2008)) + +#### @wyze, DOCUMENTATION HERO OF THE PEOPLE, GETS THEIR OWN HEADER + +* [`b78b301`](https://github.com/npm/npm/commit/b78b30171038ab737eff0b070281277e35af25b4) + [#11416](https://github.com/npm/npm/pull/11416) + Logout docs were using a section copy-pasted from the adduser docs. + ([@wyze](https://github.com/wyze)) +* [`649e28f`](https://github.com/npm/npm/commit/649e28f50aa323e75202eeedb824434535a0a4a0) + [#11414](https://github.com/npm/npm/pull/11414) + Add colon for consistency. + ([@wyze](https://github.com/wyze)) + +#### WHITTLING AWAY AT PATH LENGTHS + +So for all of you who don't know -- Node.js does, in fact, support long Windows +paths. Unfortunately, depending on the tool and the Windows version, a lot of +external tooling does not. This means, for example, that some (all?) versions of +Windows Explorer *can literally never delete npm from their system entirely +because of deeply-nested npm dependencies*. Which is pretty gnarly. + +Incidentally, if you run into that in particularly, you can use +[rimraf](npm.im/rimraf) to remove such files 💁. + +The latest victim of this issue was the Node.js CI setup for testing on Windows, +which uses some tooling or another that croaks on the usual path length limit +for that OS: 255 characters. + +This isn't ordinarily an issue with `npm@3` as it produces mostly flat +trees, but you may be surprised to learn that `npm`'s own distribution isn't +flat, due to needing to be compatible with `npm@1.2`, which ships with +`node@0.8`! + +We've taken another baby step towards alleviating this in this release by +updating a couple of dependencies that were preventing `npmlog` from deduping, +and then doing a dedupe on that and `gauge`. Hopefully it helps. + +* [`f3c32bc`](https://github.com/npm/npm/commit/f3c32bc3127301741d2fa3a26be6f5f127a35908) + [#11528](https://github.com/npm/npm/pull/11528) + `node-gyp@3.3.0`: + Update to a more recent version that uses a version of npmlog compatible + with npm itself. Also adds: AIX support, new `gyp`, `--cafile` command + line option, and allows configuration of Node.js and io.js mirrors. + ([@rvagg](https://github.com/rvagg)) -In other exciting news, a bunch of us are gonna be at the [Node.js Collaborator -Summit](https://github.com/nodejs/summit/issues/1), and you can also find us at -[wafflejs](https://wafflejs.com/) on Wednesday. Hopefully we'll be seeing some -of you there. :) +#### INTERNAL TEST IMPROVEMENTS -#### THE PATCH!!! +The `npm` core team's time recently has been sunk into `npm`'s many years of +tech debt. Specifically, we've been working on improving the test suite. +This isn't user visible, but in future should mean a more stable, easier to +contribute to `npm`. Ordinarily we don't report these kinds of changes in +the change log, but I thought I might share this week as this chunk is +bigger than usual. -So here it is. The patch. Hope it helps. (Thanks, -[@ktarplee](https://github.com/ktarplee)!) +* [`07f020a`](https://github.com/npm/npm/commit/07f020a09e94ae393c67526985444e128ef6f83c) + [#11292](https://github.com/npm/npm/pull/11292) + `tacks@1.0.9`: + Add a package that provides a tool to generate fixtures from folders and, relatedly, + a module that an create and tear down filesystem fixtures easily. + ([@iarna](https://github.com/iarna)) +* [`0837346`](https://github.com/npm/npm/commit/083734631f9b11b17c08bca8ba8cb736a7b1e3fb) + [#11292](https://github.com/npm/npm/pull/11292) + Remove all the relatively cryptic legacy tests and creates new tap tests + that check the same functionality. The *legacy* tests were tests that + were originally a shell script that was ported to javascript early in + `npm`'s history. + ([@iarna](https://github.com/iarna)) + ([@zkat](https://github.com/zkat)) +* [`5a701e7`](https://github.com/npm/npm/commit/5a701e71a0130787fb98450f9de92117b4ef88e1) + [#11292](https://github.com/npm/npm/pull/11292) + Test that we don't leak auth info into the environment. + ([@zkat](https://github.com/zkat)) +* [`502d7d0`](https://github.com/npm/npm/commit/502d7d0628f08b09d8d13538ebccc63de8b3edf5) + [#11292](https://github.com/npm/npm/pull/11292) + Test that env vars properly passed into scripts. + ([@zkat](https://github.com/zkat)) +* [`420f267`](https://github.com/npm/npm/commit/420f2672ee8c909f18bee10b1fc7d4ad91cf328b) + [#11292](https://github.com/npm/npm/pull/11292) + Test that npm's distribution binary is complete and can be installed and used. + ([@iarna](https://github.com/iarna)) +* [`b7e99be`](https://github.com/npm/npm/commit/b7e99be1b1086f2d6098c653c1e20791269c9177) + [#11292](https://github.com/npm/npm/pull/11292) + Test that the `package.json` `files` section and `.npmignore` do what + they're supposed to. + ([@zkat](https://github.com/zkat)) -* [`2e58c48`](https://github.com/npm/npm/commit/2e58c4819e3cafe4ae23ab7f4a520fe09258cfd7) - [#9033](https://github.com/npm/npm/pull/9033) `npm version` now works on git - submodules - ([@ktarplee](https://github.com/ktarplee)) +#### DEPENDENCY UPDATES -#### OH AND THERE'S A DEV DEPENDENCIES UPDATE +* [`4611098`](https://github.com/npm/npm/commit/4611098fd8c65d61a0645deb05bf38c81300ffca) + `rimraf@2.5.2`: + Use `glob@7.0.0`. + ([@isaacs](https://github.com/isaacs)) +* [`41b2772`](https://github.com/npm/npm/commit/41b2772cb83627f3b5b926cf81e150e7148cb124) + `glob@7.0.0`: + Raise error if `options.cwd` is specified, and not a directory. + ([@isaacs](https://github.com/isaacs)) +* [`c14e74a`](https://github.com/npm/npm/commit/c14e74ab5d17c764f3aa37123a9632fa965f8760) + `gauge@1.2.7`: Update to newer lodash versions, for a smaller tree. + ([@iarna](https://github.com/iarna)) +* [`d629363`](https://github.com/npm/npm/commit/d6293630ddc25bfa26d19b6be4fd2685976d7358) + `lodash.without@4.1.0` + ([@jdalton](https://github.com/jdalton)) +* [`3ea4c80`](https://github.com/npm/npm/commit/3ea4c8049ca8df9f64426b1db8a29b9579950134) + `lodash.uniq@4.2.0` + ([@jdalton](https://github.com/jdalton)) +* [`8ddcc8d`](https://github.com/npm/npm/commit/8ddcc8deb554660a3f7f474fae9758c967d94552) + `lodash.union@4.2.0` + ([@jdalton](https://github.com/jdalton)) +* [`2b656a6`](https://github.com/npm/npm/commit/2b656a672d351f32ee2af24dcee528356dcd64f4) + `lodash.keys@4.0.3` + ([@jdalton](https://github.com/jdalton)) +* [`ac171f8`](https://github.com/npm/npm/commit/ac171f8f0318a7dd3c515f3b83502dfa9e87adb8) + `lodash.isarguments@3.0.7` + ([@jdalton](https://github.com/jdalton)) +* [`bcccd90`](https://github.com/npm/npm/commit/bcccd9057b75d800c799ab15f00924f700415d3e) + `lodash.clonedeep@4.3.0` + ([@jdalton](https://github.com/jdalton)) +* [`8165bca`](https://github.com/npm/npm/commit/8165bca537d86305a3d08f080f86223a26615aa8) + `lodash._baseuniq@4.4.0` + ([@jdalton](https://github.com/jdalton)) + +### v3.7.3 (2016-02-11): + +Hey all! We've got a pretty small release this week -- just documentation +updates and a couple of dependencies. This release also includes a particular +dependency upgrade that makes it so we're exclusively using the latest version +of `graceful-fs`, which'll make it so things keep working with future Node.js +releases. + +A certain internal Node.js API was deprecated and slated for future removal from +Node Core. This API was critical for versions of `graceful-fs@<4`, before a +different approach was used to achieve similar ends. By upgrading this library, +and making sure all our dependencies are also updated, we've ensured npm will +continue to work once the API is finally removed. Older versions of npm, on the +other hand, will simply not work on future versions of Node.js. + +#### DEPENDENCY UPGRADES + +* [`29536f4`](https://github.com/npm/npm/commit/29536f42da6c06091c9acbc8952f72daa8a9412c) + `cmd-shim@2.0.2`: + Final straggler using `graceful-fs@<4`. + ([@ForbesLindesay](https://github.com/ForbesLindesay)) +* [`5f59e74`](https://github.com/npm/npm/commit/5f59e748ef4c066756bb204a452cecd0543c7a2f) + `lodash.uniq@4.1.0` + ([@jdalton](https://github.com/jdalton)) +* [`987cabe`](https://github.com/npm/npm/commit/987cabe8a18abcb5a685685958bf74c7258a979c) + `lodash.union@4.1.0` + ([@jdalton](https://github.com/jdalton)) +* [`5c641f0`](https://github.com/npm/npm/commit/5c641f05fdc153c6bb06a89c46fe2a345ce413db) + `lodash.clonedeep@4.1.0` + ([@jdalton](https://github.com/jdalton)) + +#### EVERYONE GETTING SOCKS LIKE IT'S OPRAH'S SHOW + +* [`9ea5658`](https://github.com/npm/npm/commit/9ea56582ca4d0991dbed44f992c88f08a643cb4b) + [#11410](https://github.com/npm/npm/pull/11410) + Fixed a small spelling error in `npm-config.md`. + ([@pra85](https://github.com/pra85)) +* [`2a11e56`](https://github.com/npm/npm/commit/2a11e562a14bce18b6ddca6c20d17f97b6a8ec2f) + [#11403](https://github.com/npm/npm/pull/11403) + Removes `--depth Infinity` warning from documentation -- this operation should + actually be totally safe as of `npm@3`. (The warning remains for `npm@2`.) + ([@Aourin](https://github.com/Aourin)) +* [`42a4727`](https://github.com/npm/npm/commit/42a4727bfb1e21c890b8e2babda55e06ac2bda29) + [#11391](https://github.com/npm/npm/pull/11391) + Fixed versions of `shrinkwrap.json` in examples in documentation for `npm + shrinkwrap`, which did not quite match up. + ([@xcatliu](https://github.com/xcatliu)) + +### v3.7.2 (2016-02-04): + +This week, the CLI team has been busy working on rewriting tests to support +getting coverage reports going and running all of our tests on Windows. +Meanwhile, we've got a bunch of dependency updates and one or two other +things. + +#### TESTS WENT INTO HIDING + +Last week we took a patch from [@substack](https://github.com/substack) to +stop the installer from reordering arrays in an installed module's +`package.json`... but somehow I dropped the test when I was rebasing. + +* [`21b9271`](https://github.com/npm/npm/commit/21b927182514a0ff6d9f34480bfc39f72e3e9f8c) + [#10063](https://github.com/npm/npm/issues/10063) + Restore test that verifies that we don't re-order arrays in a module's + `package.json` on install. + ([@substack](https://github.com/substack)) -Hooray. +#### DOCUMENTATION FIXES -* [`d204683`](https://github.com/npm/npm/commit/d2046839d471322e61e3ceb0f00e78e5c481f967) - nock@2.9.1 - ([@pgte](https://github.com/pgte)) +* [`c67521d`](https://github.com/npm/npm/commit/c67521dc6c1e41d39d02c74105e41442851d23bb) + [#11348](https://github.com/npm/npm/pull/11348) + Improve the documentation around which files are ALWAYS included in published packages + and which are ALWAYS excluded. + ([@jscissr](https://github.com/jscissr)) +* [`7ef6793`](https://github.com/npm/npm/commit/7ef6793cd191cc8d88340f7e1ce9c9e3d6f0b2f4) + [#11348](https://github.com/npm/npm/pull/11348) + The release date on the 3.7.0 changelog entry was wrong. I honestly don't + know how I keep doing this. =D + ([@rafek](https://github.com/rafek)) -### v2.13.3 (2015-07-23): +#### DEPENDENCY UPDATES -#### I'M SAVING THE GOOD JOKES FOR MORE INTERESTING RELEASES +* [`8a3c80c`](https://github.com/npm/npm/commit/8a3c80c4fd3d82fe937f30bc7cbd3dee51a8a893) + `graceful-fs@4.1.3`: + Fix a bug where close wasn't getting made graceful. + ([@isaacs](https://github.com/isaacs)) + +`lodash` saw updates across most of its modules this week with browser +campatibility fixes that don't really impact us. + +* [`2df342b`](https://github.com/npm/npm/commit/2df342bf30efa99b98016acc8a5dc03e00b58b9c) + `lodash.without@4.0.2` + ([@jdalton](https://github.com/jdalton)) +* [`86aa91d`](https://github.com/npm/npm/commit/86aa91dce60f6b6a92bb3ba2bf6e6be1f6afc750) + `lodash.uniq@4.0.2` + ([@jdalton](https://github.com/jdalton)) +* [`0a94bf6`](https://github.com/npm/npm/commit/0a94bf6af0ebd38d080f92257e0cd9bae40b31ff) + `lodash.union@4.0.2` + ([@jdalton](https://github.com/jdalton)) +* [`b4c9582`](https://github.com/npm/npm/commit/b4c9582b4ef5991f3d155e0c6142ed1c631860af) + `lodash.isarguments@3.0.6` + ([@jdalton](https://github.com/jdalton)) +* [`efe766c`](https://github.com/npm/npm/commit/efe766c63c0948a4ae4c0d12f2b834629ab86e92) + `lodash.keys@4.0.2`: Minor code cleanup and the above. + ([@jdalton](https://github.com/jdalton)) +* [`36abb24`](https://github.com/npm/npm/commit/36abb24ef31017adbf325e7f833d5d4b0f03f5d4) + `lodash.clonedeep@4.0.4`: + Add support for cloning prototype objects and the above. + ([@jdalton](https://github.com/jdalton)) + +### v3.7.1 (2016-02-01): + +Super quick Monday patch on last week's release. + +If you ever wondered why we release things to the `npm@next` tag for a week +before promoting them to `npm@latest`, this is it! + +#### RELEASE TRAIN VINDICATED (again) + +* [`adcaf04`](adcaf047811dcc475ab1984fc93fe34540fc03d7) + [#11349](https://github.com/npm/npm/issues/11349) + Revert last weeks change to use JSON clone instead of `lodash.cloneDeep`. + ([@iarna](https://github.com/iarna)) -It's pretty hard to outdo last week's release buuuuut~ I promise I'll have a -treat when we release our shiny new **Teams and Organizations** feature! :D -(Coming Soon™). It'll be a real *gem*. +### v3.7.0 (2016-01-29): + +Hi all! This week brings us some important performance improvements, +support for git submodules(!) and a bunch of bug fixes. + +#### PERFORMANCE + +`gauge`, the module responsible for drawing `npm`'s progress bars, had an +embarrassing bug in its debounce implementation that resulted in it, on many +systems, actually being _slower_ than if it hadn't been debouncing. This was +due to it destroying and then creating a timer object any time it got an +update while waiting on its minimum update period to elapse. This only was +a measurable slowdown when sending thousands of updates a second, but +unfortunately parts of `npm`'s logging do exactly that. This has been patched +to eliminate that churn, and our testing shows the progress bar as being +eliminated as a source of slow down. + +Meanwhile, `are-we-there-yet` is the module that tracks just how complete +our big asynchronous install process is. [@STRML](https://github.com/STRML) +spent some time auditing its source and made a few smaller performance +improvements to it. Most impactful was eliminating a bizarre bit of code +that was both binding to AND closing over the current object. I don't have +any explanation for how that crept in. =D + +* [`c680fa9`](https://github.com/npm/npm/commit/c680fa9f8135759eb5512f4b86e47fa265733f79) + `npmlog@2.0.2`: New `are-we-there-yet` with performance patches from + [@STRML](https://github.com/STRML). New `gauge` with timer churn + performance patch. + ([@iarna](https://github.com/iarna)) -That means it's a pretty low-key release this week. We got some nice -documentation tweaks, a few bugfixes, and other such things, though! +We were also using `lodash`'s `cloneDeep` on `package.json` data which is +definitely overkill, seeing as `package.json` data has all the restrictions +of being `json`. The fix for this is just swapping that out for something +that does a pair of `JSON.stringify`/`JSON.parse`, which is distinctly more +speedy. + +* [`1d1ea7e`](https://github.com/npm/npm/commit/1d1ea7eeb958034878eb6573149aeecc686888d3) + [#11306](https://github.com/npm/npm/pull/11306) + Use JSON clone instead of `lodash.cloneDeep`. + ([@STRML](https://github.com/STRML)) + +#### NEW FEATURE: GIT SUBMODULE SUPPORT + +Long, long requested– the referenced issue is from 2011– we're finally +getting rudimentary git submodule support. + +* [`39dea9c`](https://github.com/npm/npm/commit/39dea9ca4216c6ea628f5ca47d2b34a4b251a1ed) + [#1876](https://github.com/npm/npm/issues/1876) + Add support for git submodules in git remotes. This is a fairly simple + approach, which does not leverage the git caching mechanism to cache + submodules. It also doesn't provide a means to disable automatic + initialization, e.g. via a setting in the `.gitmodules` file. + ([@gagern](https://github.com/gagern)) + +#### ROBUSTNESS + +* [`5dec02a`](https://github.com/npm/npm/commit/5dec02a3d0e82202c021e27aff9d006283fdc25a) + [#10347](https://github.com/npm/npm/issues/10347) + There is an obscure feature that lets you monkey-patch npm when it starts + up. If the module being required with this feature failed, it would + previously just make `npm` error out– this reduces that to a warning. + ([@evanlucas](https://github.com/evanlucas)) -Oh, and a _bunch of version bumps_. Thanks, `semver`! +#### BUG FIXES -#### IT'S THE LITTLE THINGS THAT MATTER +* [`9ab8b8d`](https://github.com/npm/npm/commit/9ab8b8d047792612ae7f9a6079745d51d5283a53) + [#10820](https://github.com/npm/npm/issues/10820) + Fix a bug with `npm ls` where if you asked for ONLY production dependencies in output + it would exclude dependencies that were BOTH production AND development dependencies. + ([@davidvgalbraith](https://github.com/davidvgalbraith)) +* [`6803fed`](https://github.com/npm/npm/commit/6803fedadb8f9b36cd85f7338ecf75d1d183c833) + [#8982](https://github.com/npm/npm/issues/8982) + Fix a bug where, under some circumstances, if you had a path that + contained the name of a package being installed somewhere in it, `npm` + would incorrectly refuse to run lifecycle scripts. + ([@elvanja](https://github.com/elvanja)) +* [`3eae40b`](https://github.com/npm/npm/commit/3eae40b7a681aa067dfe4fea8c9a76da5b508b48) + [#9253](https://github.com/npm/npm/issues/9253) + Fix a bug where, when running lifecycle scripts, if the Node.js binary you ran + `npm` with wasn't in your `PATH`, `npm` wouldn't use it to run your scripts. + ([@segrey](https://github.com/segrey)) +* [`61daa6a`](https://github.com/npm/npm/commit/61daa6ae8cbc041d3a0d8a6f8f268b47dd8176eb) + [#11014](https://github.com/npm/npm/issues/11014) + Fix a bug where running `rimraf node_modules/` followed by `npm + rm --save ` would fail. `npm` now correctly removes the module + from your `package.json` even though it doesn't exist on disk. + ([@davidvgalbraith](https://github.com/davidvgalbraith)) +* [`a605586`](https://github.com/npm/npm/commit/a605586df134ee97c95f89c4b4bd6bc73f7aa439) + [#9679](https://github.com/npm/npm/issues/9679) + Fix a bug where `npm install --save git+https://…` would save a `https://` + url to your `package.json` which was a problem because `npm` wouldn't then + know that it was a git repo. + ([@gagern](https://github.com/gagern)) +* [`bbdc700`](https://github.com/npm/npm/commit/bbdc70024467c365cc4e06b8410947c04b6f145b) + [#10063](https://github.com/npm/npm/issues/10063) + Fix a bug where `npm` would change the order of array properties in the + `package.json` files of dependencies. `npm` adds a bunch of stuff to + `package.json` files in your `node_modules` folder for debugging and + bookkeeping purposes. As a part of this process it sorts the object to + reduce file churn when it does updates. This fixes a bug where the arrays + in the object were also getting sorted. This wasn't a problem for + properties that `npm` itself maintains, but _is_ a problem for properties + used by other packages. + ([@substack](https://github.com/substack)) + +#### DOCS IMPROVEMENTS + +* [`2609a29`](https://github.com/npm/npm/commit/2609a2950704f577ac888668e81ba514568fab44) + [#11273](https://github.com/npm/npm/pull/11273) + Include an example of viewing package version history in the `npm view` documentation. + ([@vedatmahir](https://github.com/vedatmahir)) +* [`719ea9c`](https://github.com/npm/npm/commit/719ea9c45a5c3233f3afde043b89824aad2df0a7) + [#11272](https://github.com/npm/npm/pull/11272) + Fix typographical issue in `npm update` documentation. + ([@jonathanp](https://github.com/jonathanp)) +* [`cb9df5a`](https://github.com/npm/npm/commit/cb9df5a37091e06071d8704b629e7ebaa41c37fe) + [#11215](https://github.com/npm/npm/pull/11215) + Do not call `SEE LICENSE IN ` an _SPDX expression_, as it's not. + ([@kemitchell](https://github.com/kemitchell)) +* [`f427934`](https://github.com/npm/npm/commit/f4279346c368da4bca09385f773e8eed1d389e5e) + [#11196](https://github.com/npm/npm/pull/11196) + Correct the `package.json` examples in the `npm update` documentation to actually be + valid JSON and not just JavaScript object literals. + ([@s100](https://github.com/s100)) -* [`2fac6ae`](https://github.com/npm/npm/commit/2fac6aeffefba2934c3db395b525d931599c34d8) - [#9012](https://github.com/npm/npm/issues/9012) A convenience for releases -- - using the globally-installed npm before now was causing minor annoyances, so - we just use the exact same npm we're releasing to build the new release. - ([@zkat](https://github.com/zkat)) +#### DEPENDENCY UPDATES -#### WHAT DOES THIS BUTTON DO? +* [`a7b2407`](https://github.com/npm/npm/commit/a7b24074cb59a1ab17c0d8eff1498047e6a123e5) + `retry@0.9.0`: New features and interface agnostic refactoring. + ([@tim-kos](https://github.com/tim-kos)) +* [`220fc77`](https://github.com/npm/npm/commit/220fc7702ae3e5d601dfefd3e95c14e9b32327de) + `request@2.69.0`: + A bunch of small bug fixes and module updates. + ([@simov](https://github.com/simov)) +* [`9e5c84f`](https://github.com/npm/npm/commit/9e5c84f1903748897e54f8ff099729ff744eab0f) + `which@1.2.4`: + Update `isexe` and fix bug in `pathExt`, in which files without extensions + would sometimes be preferred to files with extensions on Windows, even though + those without extensions aren't executable. + `pathExt` is a list of extensions that are considered executable (exe, cmd, + bat, com on Windows). + ([@isaacs](https://github.com/isaacs)) +* [`375b9c4`](https://github.com/npm/npm/commit/375b9c42fe0c6de47ac2f92527354b2ea79b7968) + `rimraf@2.5.1`: Minor doc formatting fixes. + ([@isaacs](https://github.com/isaacs)) +* [`ef1971e`](https://github.com/npm/npm/commit/ef1971e6270c2bc72e6392b51a8b84f52708f7e7) + `lodash.clonedeep@4.0.2`: + Misc minor code cleanup. No functional changes. + ([@jdalton](https://github.com/jdalton)) + +### v3.6.0 (2016-01-20): + +Hi all! This is a bigger release, in part 'cause we didn't have one last +week. The most important thing you need to know is that when `npm@3.6.0` replaces +`npm@3.5.4` as `next`, `npm@3.5.4` WILL NOT be moved on to `latest`. This is due to +a packaging error that tickles bugs in some earlier releases and makes upgrades to it +from those versions break the install. + +#### NEW FEATURES‼ + +* [`ff504d4`](https://github.com/npm/npm/commit/ff504d449ea1fa996cbb02c8078964643c51e5f6) + [#8752](https://github.com/npm/npm/issues/8752) + In `npm outdated`, report symlinked packages as having a wanted & latest + version of `linked`. + ([@halhenke](https://github.com/halhenke)) +* [`f44d8c9`](https://github.com/npm/npm/commit/f44d8c9a3940f7041f8136f8754a54b13f1f9d60) + [#10775](https://github.com/npm/npm/issues/10775) + Add a success message to `adduser` / `login`. + ([@ekmartin](https://github.com/ekmartin)) +* [`3109303`](https://github.com/npm/npm/commit/310930395c9bf1577cf085b9742210bfc71bb019) + [#10043](https://github.com/npm/npm/pull/10043) + Warn if you try to use `npm run x` if you don't have a `node_modules` folder, since + whatever you're trying to do _probably_ won't work. + ([@timkrins](https://github.com/timkrins)) + +* [`9ed2849`](https://github.com/npm/npm/commit/9ed2849cd7e8cc97111dca42a940905284afe55d) + [`e9f1ad8`](https://github.com/npm/npm/commit/e9f1ad88ce58ecd111811e11afa52ac19fc8696e) + [`f10d300`](https://github.com/npm/npm/commit/f10d300e5effa7a5756c8d461eef284c283a41d1) + [`8b593d8`](https://github.com/npm/npm/commit/8b593d8d187d6ac85d2a59cbe647afb5516c1b94) + [#10717](https://github.com/npm/npm/pull/10717) + `npm version` can now take a `from-git` argument, which instructs `npm` to read the + version from git and update your `package.json` to what it finds. This is in contrast + to its normal use where `npm` _tells_ git about your new version. + ([@ekmartin](https://github.com/ekmartin)) + +#### 3.5.4 WAS NOT SO GREAT + +The `npm@3.5.4` package was missing some dependencies. Specifically, `glob` +and `has-unicode` had major release updates which meant that subdeps that +relied on older major versions couldn't use the npm supplied versions any +more, and so they needed their own copies. + +This went undetected because the actions necessary to run the tests (which +check for this sort of thing) resolved the missing modules. + +Further, it didn't have symptoms when upgrading from _most_ versions of npm. +Unfortunately, some versions had bugs that were tickled by this and resulted +in broken upgrades, most notably, `npm@3.3.12`, the version that's been in +Node.js 5. + +* [`1d3325c`](https://github.com/npm/npm/commit/1d3325c040621a4792db80fb232f4994b9d5c5f2) + [`02611c6`](https://github.com/npm/npm/commit/02611c673a4d2bbe8fcef8d48407768da31c90d2) + [`39d5fea`](https://github.com/npm/npm/commit/39d5feadefdde38d75a18f23343bc6ec37153638) + [`7d0e830`](https://github.com/npm/npm/commit/7d0e830f26c73b9d9277b29949227ba9cca27fd9) + [#11129](https://github.com/npm/npm/pull/11129) + Update the underlying dependencies to allow use for the new versions of + `glob` and `has-unicode`. + ([@iarna](https://github.com/iarna)) -There's a couple of doc updates! The last one might be interesting. +#### WHEN MISSING PATHS ARE OK + +* [`bb638fa`](https://github.com/npm/npm/commit/bb638fa4f48d24d2c9935861d5d751c5621eea49) + [#11212](https://github.com/npm/npm/pull/11212) + When trying to determine if a file was controlled by npm before going to + remove it, we check to see if it is inside any of a list of paths that npm + considers to be under its control. Not all of those paths always exist + (and that's ok!) Previously we were calling it a failure to match if ANY + of them didn't exist. We now only do so if NONE of them exist. If some + do, then we do our usual checks on them. + + This showed up as an error where you would see something like: + ``` + npm warn gentlyRm not removing /path/to/thing as it wasn't installed by /path/to/other/thing + ``` + But it totally was installed by it. + ([@iarna](https://github.com/iarna)) -* [`4cd3205`](https://github.com/npm/npm/commit/4cd32050c0f89b7f1ae486354fa2c35eea302ba5) - [#9002](https://github.com/npm/npm/issues/9002) Updated docs to list the - various files that npm automatically includes and excludes, regardless of - settings. - ([@SimenB](https://github.com/SimenB)) -* [`cf09e75`](https://github.com/npm/npm/commit/cf09e754931739af32647d667b671e72a4c79081) - [#9022](https://github.com/npm/npm/issues/9022) Document the `"access"` field - in `"publishConfig"`. Did you know you don't need to use `--access=public` - when publishing scoped packages?! Just put it in your `package.json`! - Go refresh yourself on scopes packages by [checking our docs](https://docs.npmjs.com/getting-started/scoped-packages) on them. - ([@boennemann](https://github.com/boennemann)) -* [`bfd73da`](https://github.com/npm/npm/commit/bfd73da33349cc2afb8278953b2ae16ea95023de) - [#9013](https://github.com/npm/npm/issues/9013) fixed typo in changelog - ([@radarhere](https://github.com/radarhere)) - -#### THE SEMVER MAJOR VERSION APOCALYPSE IS UPON US - -Basically, `semver` is up to `@5`, and that meant we needed to go in an update a -bunch of our dependencies manually. `node-gyp` is still pending update, since -it's not ours, though! - -* [`9232e58`](https://github.com/npm/npm/commit/9232e58d54c032c23716ef976023d36a42bfdcc9) - [#8972](https://github.com/npm/npm/issues/8972) `init-package-json@1.7.1` - ([@othiym23](https://github.com/othiym23)) -* [`ba44f6b`](https://github.com/npm/npm/commit/ba44f6b4201a4faee025341b123e372d8f45b6d9) - [#8972](https://github.com/npm/npm/issues/8972) `normalize-package-data@2.3.1` - ([@othiym23](https://github.com/othiym23)) -* [`3901d3c`](https://github.com/npm/npm/commit/3901d3cf191880bb4420b1d6b8aedbcd8fc26cdf) - [#8972](https://github.com/npm/npm/issues/8972) `npm-install-checks@1.0.6` - ([@othiym23](https://github.com/othiym23)) -* [`ffcc7dd`](https://github.com/npm/npm/commit/ffcc7dd12f8bb94ff0f64c465c57e460b3f24a24) - [#8972](https://github.com/npm/npm/issues/8972) `npm-package-arg@4.0.2` - ([@othiym23](https://github.com/othiym23)) -* [`7128f9e`](https://github.com/npm/npm/commit/7128f9ec10c0c8482087511b716dbddb54249626) - [#8972](https://github.com/npm/npm/issues/8972) `npm-registry-client@6.5.1` - ([@othiym23](https://github.com/othiym23)) -* [`af28911`](https://github.com/npm/npm/commit/af28911ecd54a844f848c6ae41887097d6aa2f3b) - [#8972](https://github.com/npm/npm/issues/8972) `read-installed@4.0.2` - ([@othiym23](https://github.com/othiym23)) -* [`3cc817a`](https://github.com/npm/npm/commit/3cc817a0f34f698b580ff6ff02308700efc54f7c) - [#8972](https://github.com/npm/npm/issues/8972) node-gyp needs its own version - of semver - ([@othiym23](https://github.com/othiym23)) -* [`f98eccc`](https://github.com/npm/npm/commit/f98eccc6e3a6699ca0aa9ecbad93a3b995583871) - [#8972](https://github.com/npm/npm/issues/8972) `semver@5.0.1`: Stop including - browser builds. - ([@isaacs](https://github.com/isaacs)) +#### BETTER NODE PRE-RELEASE SUPPORT -#### \*BUMP\* +Historically, if you used a pre-release version of Node.js, you would get +dozens and dozens of warnings when EVERY engine check failed across all of +your modules, because `>= 0.10.0` doesn't match prereleases. -And some other version bumps for good measure. +You might find this stream of redundent warnings undesirable. I do. -* [`254ecfb`](https://github.com/npm/npm/commit/254ecfb04f026c2fd16427db01a53600c1892c8b) - [#8990](https://github.com/npm/npm/issues/8990) `marked-man@0.1.5`: Fixes an - issue with documentation rendering where backticks in 2nd-level headers would - break rendering (?!?!) - ([@steveklabnik](https://github.com/steveklabnik)) -* [`79efd79`](https://github.com/npm/npm/commit/79efd79ac216da8cee8636fb2ed926b0196a4eb6) - `minimatch@2.0.10`: A pattern like `'*.!(x).!(y)'` should not match a name - like `'a.xyz.yab'`. - ([@isaacs](https://github.com/isaacs)) -* [`39c7dc9`](https://github.com/npm/npm/commit/39c7dc9a4e17cd35a5ed882ba671821c9a900f9e) - `request@2.60.0`: A few bug fixes and doc updates. - ([@simov](https://github.com/simov)) -* [`72d3c3a`](https://github.com/npm/npm/commit/72d3c3a9e1e461608aa21b14c01a650333330da9) - `rimraf@2.4.2`: Minor doc and dep updates - ([@isaacs](https://github.com/isaacs)) -* [`7513035`](https://github.com/npm/npm/commit/75130356a06f5f4fbec3786aac9f9f0b36dfe010) - `nock@2.9.1` - ([@pgte](https://github.com/pgte)) -* [`3d9aa82`](https://github.com/npm/npm/commit/3d9aa82260f0643a32c13d0c1ed16f644b6fd4ab) - Fixes this thing where Kat decided to save `nock` as a regular dependency ;) - ([@othiym23](https://github.com/othiym23)) +We've moved this into a SINGLE warning you'll get about using a pre-release +version of Node.js and now suppress those other warnings. -### v2.13.2 (2015-07-16): +* [`6952f79`](https://github.com/npm/npm/commit/6952f7981e451a2d599a4f513573af208bdfe103) + [#11212](https://github.com/npm/npm/pull/11212) + Engine check warnings are now issued along with any other warnings about + your tree, instead of emitting in the middle of your install (and then + disappearing behind the giant tree of stuff installed). + ([@iarna](https://github.com/iarna)) +* [`ee2ebe9`](https://github.com/npm/npm/commit/ee2ebe96fb3d105787835b72085bbd2eee66a629) + [#11212](https://github.com/npm/npm/pull/11212) + Suppress engine verification warnings about pre-release versions of Node.js. + ([@iarna](https://github.com/iarna)) +* [`135b7e0`](https://github.com/npm/npm/commit/135b7e078311e8b4e2c8e2b662eed9ba6c2e2537) + [#11212](https://github.com/npm/npm/pull/11212) + Explicitly warn, in only one place, if you are using a pre-release version + of Node.js. + ([@iarna](https://github.com/iarna)) -#### HOLD ON TO YOUR TENTACLES... IT'S NPM RELEASE TIME! +#### BUG FIXES -Kat: Hooray! Full team again, and we've got a pretty small patch release this -week, about everyone's favorite recurring issue: git URLs! +* [`ea331c8`](https://github.com/npm/npm/commit/ea331c82157c65f7643cd4b49fd24031c84bf601) + [#10938](https://github.com/npm/npm/issues/10938) + When removing a package, sometimes the `node_modules/.bin` wouldn't be + cleaned up entirely. This would result in package folders that contained + only a `node_modules/.bin` directory. In turn, this would result in `npm + ls` and other tools complaining about these broken directories. + To fix this, the `unbuild` step now explicitly deletes the + `node_modules/.bin` folder as its final step. + ([@chrisirhc](https://github.com/chrisirhc)) +* [`00720db`](https://github.com/npm/npm/commit/00720db2c326cf8f968c662444a4575ae8c3020a) + [#11158](https://github.com/npm/npm/pull/11158) + On Windows, the `node-gyp` wrapper would fail if your path to `node-gyp` + contained spaces. This fixes that problem by quoting use of that path. + ([@orangemocha](https://github.com/orangemocha)) +* [`69ac933`](https://github.com/npm/npm/commit/69ac9333506752bf2e5af70b3b3e03c6181de3e7) + [#11142](https://github.com/npm/npm/pull/11142) + Fix a race condition when making directories in the cache, which could + lead to `ENOENT` failures. + ([@Jimbly](https://github.com/Jimbly)) +* [`e982858`](https://github.com/npm/npm/commit/e982858d9bed65cede9cbb12df9216a4bb9e6fc9) + [#9696](https://github.com/npm/npm/issues/9696) + When replacing the `package.json` in the cache you sometimes see `EPERM` errors on + Windows that you wouldn't on Unix-like operating systems. This ignores those errors + and allows Windows to continue. Longer term, we'll be adding something to retry + these errors, but ultimately fail if there really is an ongoing permissions issue. + ([@orangemocha](https://github.com/orangemocha)) + +#### DOC CHANGES + +* [`3666081`](https://github.com/npm/npm/commit/3666081abd02184ba97a7cdb6ae238085d640b4b) + [#11188](https://github.com/npm/npm/pull/11188) + Add brief description to publish documentation of what's included in + published tarballs. + ([@beaugunderson](https://github.com/beaugunderson)) +* [`b463e34`](https://github.com/npm/npm/commit/b463e3424b296cfc4bd384fc8bfe0e2329649164) + [#11150](https://github.com/npm/npm/pull/11150) + In npm update docs, advise use of `--depth Infinity` instead of `--depth + 9999`. + ([@halhenke](https://github.com/halhenke)) +* [`382e71a`](https://github.com/npm/npm/commit/382e71a7ee5d1ca3dba55c1e753d529eb8ae6895) + [#11128](https://github.com/npm/npm/pull/11128) + In the `package.json` docs, make the reference to the "Local Paths" section + a link to it as well. + ([@orangejulius](https://github.com/orangejulius)) +* [`5277e7f`](https://github.com/npm/npm/commit/5277e7f236e8cb40d7f4a1054506f2d3d159716e) + [#11090](https://github.com/npm/npm/pull/11090) + Fix the 3.5.4 release date in CHANGELOG.md. + ([@ashleygwilliams](https://github.com/ashleygwilliams)) +* [`e6d238a`](https://github.com/npm/npm/commit/e6d238a3d90beeb0af23fa75a9b5e50671d6e4c5) + [#11130](https://github.com/npm/npm/pull/11130) + Eliminate the "using npm programmatically" section from the README. The + documentation for this was removed a while ago and is unsupported. + ([@ljharb](https://github.com/ljharb)) -Rebecca: No Way! Again? +#### DEPENDENCY UPDATES -Kat: The ride never ends! In the meantime, there's some fun, exciting work in -the background to get orgs and teams out the door. Keep an eye out for news. :) +* [`b0dde5c`](https://github.com/npm/npm/commit/b0dde5c3407b58d78969d3da01af2629fcba1c73) + `config-chain@1.1.10`: Update tests for most recent version of `ini`. + ([@dominictarr](https://github.com/dominictarr)) +* [`c62f414`](https://github.com/npm/npm/commit/c62f414534971761a48ce3cbc3e25214fb09e494) + `glob@6.0.4`: Eliminated use of `util._extend`. + ([@isaacs](https://github.com/isaacs)) +* [`98a6779`](https://github.com/npm/npm/commit/98a67797978ed7ce534e16b705d3a2a9ca0e6cc1) + `lodash.clonedeep@4.0.1`: Bug fixes, including the non-linear performance + that was biting npm a while back. + ([@jdalton](https://github.com/jdalton)) +* [`0e8c4ce`](https://github.com/npm/npm/commit/0e8c4cebddaefbf5eca0abaad512db266c6722c9) + `lodash.without@4.0.1` + ([@jdalton](https://github.com/jdalton)) +* [`1fd19f5`](https://github.com/npm/npm/commit/1fd19f57a3551d7d30a6b8a9ce967ef50e0ff0ba) + `lodash.uniq@4.0.1` + ([@jdalton](https://github.com/jdalton)) +* [`b7486c5`](https://github.com/npm/npm/commit/b7486c550f3391f733d1e1907652be95fddf4368) + `lodash.union@4.0.1` + ([@jdalton](https://github.com/jdalton)) +* [`54bb591`](https://github.com/npm/npm/commit/54bb5911e18f8fb86eb94159f34b13f0c0aa2e30) + `lodash.keys@4.0.0` + ([@jdalton](https://github.com/jdalton)) +* [`26f7a7a`](https://github.com/npm/npm/commit/26f7a7aaae0575a85deba2241ee69b433dd1ba98) + `lodash.isarray@4.0.0` + ([@jdalton](https://github.com/jdalton)) +* [`ed38bd3`](https://github.com/npm/npm/commit/ed38bd3baf544dfc0630fd321d279f137700bd4d) + `lodash.isarguments@3.0.5` + ([@jdalton](https://github.com/jdalton)) + +### v3.5.4 (2016-01-07): + +I hope you all had fantastic winter holidays, if it's winter where you are +and if there are holidays‼ We went a few weeks without releases because +staff was taking time away from work here and there. A new year has come +and we're back now, and refreshed and ready to dig in! + +This week brings us a bunch of documentation improvements and some module +updates. The core team's focus continues to be on improving tests, +particularly with Windows, so there's not too much to call out here. -Rebecca: And make sure to keep an eye out for patches for the super-fresh -`npm@3`! +#### DOCUMENTATION IMPROVEMENTS -#### LET'S GIT INKY +* [`6b0031e`](https://github.com/npm/npm/commit/6b0031e28c0b10fb2622fdadde41f5cd294348e8) + [#11044](https://github.com/npm/npm/pull/11044) + Correct documentation regarding the defaults for the `color` config option. + ([@scottaddie](https://github.com/scottaddie)) +* [`c6ce69e`](https://github.com/npm/npm/commit/c6ce69eaed7f17b5f1876ac13ecfae3d14a72f24) + [#10990](https://github.com/npm/npm/pull/10990) + Drop mentions in documentation of `process.installPrefix`, as it hasn't + been a thing since Node.js 0.6 and we don't support that. + ([@jeffmcmahan](https://github.com/jeffmcmahan)) +* [`dee92d1`](https://github.com/npm/npm/commit/dee92d1f78608a10becf57aae86d5d495f2272bd) + [#11037](https://github.com/npm/npm/pull/11037) + Clarify the documentation on the max length of the `name` property in + `package.json` files. + ([@scottaddie](https://github.com/scottaddie)) +* [`4b9d7bb`](https://github.com/npm/npm/commit/4b9d7bb1a4fc3f1edcf563379abfd2273af10881) + [#10787](https://github.com/npm/npm/pull/10787) + Make the formatting in the documentation for `npm dist-tag` more + consistent with other docs. + ([@cvrebert](https://github.com/cvrebert)) +* [`7f77a80`](https://github.com/npm/npm/commit/7f77a80d561ee4b2b8c0aba1226fe89dfe339bcd) + [#10787](https://github.com/npm/npm/pull/10787) + Add documentation to the `npm dist-tag` docs that explains in greater + detail how `latest` is different than other tags. Further, improve the + documentation with better examples. Add a discussion of common practice + for using dist tags to manage alpha's and beta's. + ([@cvrebert](https://github.com/cvrebert)) +* [`6db58dd`](https://github.com/npm/npm/commit/6db58dd0d7719c4675a239d43164edc066842b14) + [`2ee6371`](https://github.com/npm/npm/commit/2ee6371911bd3a4d566c5d7bc8734facc60cb27c) + [#10788](https://github.com/npm/npm/pull/10788) + [#10789](https://github.com/npm/npm/pull/10789) + Improve documentation cross referencing. + ([@cvrebert](https://github.com/cvrebert)) +* [`7ba629a`](https://github.com/npm/npm/commit/7ba629a2ad3eaf736529e053b533cabe3a0d7123) + [#10790](https://github.com/npm/npm/pull/10790) + Document more clearly that `npm install foo` means `npm install + foo@latest`. + ([@cvrebert](https://github.com/cvrebert)) + +#### A FEW MODULE UPDATES + +* [`fc2e8d5`](https://github.com/npm/npm/commit/fc2e8d58a91728cb06936eea686efaa4fdec3f06) + `glob@6.0.3`: Remove deprecated features and fix a bunch of bugs. + ([@isaacs](https://github.com/isaacs)) +* [`5b820c4`](https://github.com/npm/npm/commit/5b820c4e17c907fa8c23771c0cd8e74dd5fdaa51) + `has-unicode@2.0.0`: Change the default on Windows to be false, as + international Windows installs often install to non-unicode codepages and + there's no way to detect this short of a system call or a call to a + command line program. + ([@iarna](https://github.com/iarna)) +* [`238fe84`](https://github.com/npm/npm/commit/238fe84ac61297f1d71701d80368afaa40463305) + `which@1.2.1`: Fixed bugs with uid/gid checks and with quoted Windows PATH + parts. + ([@isaacs](https://github.com/isaacs)) +* [`5e510e1`](https://github.com/npm/npm/commit/5e510e13d022a22d58742b126482d3b38a14cc83) + `rimraf@2.5.0`: Add ability to disable glob support / pass in options. + ([@isaacs](https://github.com/isaacs)) +* [`7558215`](https://github.com/npm/npm/commit/755821569466b7be0883f4b0573eeb83c24109eb) + `readable-stream@2.0.5`: Minor performance improvements. + ([@calvinmetcalf](https://github.com/calvinmetcalf)) +* [`64e8499`](https://github.com/npm/npm/commit/64e84992c812a73d590be443c09a6977d0ae9040) + `fs-write-stream-atomic@1.0.8`: Rewrite to use modern streams even on 0.8 + plus a bunch of tests. + ([@iarna](https://github.com/iarna)) +* [`74d92a0`](https://github.com/npm/npm/commit/74d92a08d72ce3603244de4bb3e3706d2b928cef) + `columnify@1.5.4`: Some bug fixes around large inputs. + ([@timoxley](https://github.com/timoxley)) -Rebecca: So what's this about another git URL issue? +#### FIX NPM'S TESTS ON 0.8 -Kat: Welp, I apparently broke backwards-compatibility on what are actually -invalid `git+https` URLs! So I'm making it work, but we're gonna deprecate URLs -that look like `git+https://user@host:path/is/here`. +This doesn't impact you as a user of npm, and ordinarily that means we +wouldn't call it out here, but if you've ever wanted to contribute, having +that green travis badge makes it a lot easier to do so with confidence! -Rebecca: What should we use instead?! +* [`b14cdbb`](https://github.com/npm/npm/commit/b14cdbb6002b04bfbefaff70cc45810c20d5a366) + [#10872](https://github.com/npm/npm/pull/10872) + Rewrite tests using nock to use other alternatives. + ([@zkat](https://github.com/zkat)) +* [`59ed01a`](https://github.com/npm/npm/commit/59ed01a8ea7960b1467aed52164fc36a03c77770) + [#10872](https://github.com/npm/npm/pull/10872) + Work around Node.js 0.8 http back-pressure bug. + + 0.8 http streams have a bug, where if they're paused with data in their + buffers when the socket closes, they call `end` before emptying those + buffers, which results in the entire pipeline ending and thus the point + that applied backpressure never being able to trigger a `resume`. + + We work around this by piping into a pass through stream that has + unlimited buffering. The pass through stream is from readable-stream and + is thus a current streams3 implementation that is free of these bugs even + on 0.8. + ([@iarna](https://github.com/iarna)) -Kat: Just do me a solid and use `git+ssh://user@host:path/here` or -`git+https://user@host/absolute/https/path` instead! +### v3.5.3 (2015-12-10): + +Did you know that Bob Ross reached the rank of master sergeant in the US Air +Force before becoming perhaps the most soothing painter of all time? + +#### TWO HAPPY LITTLE BUG FIXES + +* [`71c9590`](https://github.com/npm/npm/commit/71c9590be61b6a7b7fa8b6dc19baa588cda26a27) + [#10505](https://github.com/npm/npm/issues/10505) `npm ls --json --depth=0` + now respects the depth parameter, when it is zero and when it is not zero. + ([@MarkReeder](https://github.com/MarkReeder)) +* [`954fa67`](https://github.com/npm/npm/commit/954fa67f1ca3739992abd244e217a0aaf8465660) + [#9099](https://github.com/npm/npm/issues/9099) I had always thought you + could run `npm version` from subdirectories in your project, which is great, + because now you can. I guess I was just ahead of my time. + ([@ekmartin](https://github.com/ekmartin)) + +#### NOW PAINT IN SOME NICE DOCS CHANGES + +* [`b88c37c`](https://github.com/npm/npm/commit/b88c37c1cced40e9e41402cc54a5efc3c33cd13e) + [#10546](https://github.com/npm/npm/issues/10546) Goodbye, FAQ! You were + cheeky and fun until you weren't! Don't worry: npm still loves everyone, + especially you! ([@ashleygwilliams](https://github.com/ashleygwilliams)) +* [`2d3afe9`](https://github.com/npm/npm/commit/2d3afe9644ba69681a36721e79c45d27def71939) + [#10570](https://github.com/npm/npm/issues/10570) Update documentation URLs + to be HTTPS everywhere sensible. No HTTP shall be spared! + ([@rsp](https://github.com/rsp)) +* [`6abd0e0`](https://github.com/npm/npm/commit/6abd0e0626d0f642ce0dae0e128ced80433f15a1) + [#10650](https://github.com/npm/npm/issues/10650) Correctly note that there + are two lifecycle scripts run by an install phase in an example, instead of + three. ([@eymengunay](https://github.com/eymengunay)) +* [`a5e8df5`](https://github.com/npm/npm/commit/a5e8df53b8d6d75398cb6a55a44dcf374b0f1661) + [#10687](https://github.com/npm/npm/issues/10687) `npm outdated`'s output can + be a little puzzling sometimes. I've attempted to make it clearer, with some + examples, of what's going on with "wanted" and "latest" in more cases. + ([@othiym23](https://github.com/othiym23)) +* [`8f52833`](https://github.com/npm/npm/commit/8f52833f5d15c4f94467234607d40e75198af1aa) + [#10700](https://github.com/npm/npm/issues/10700) Hey, do you remember when + `search.npmjs.org` was a thing? I think I do? The last time I used it was in + like 2012, and it's gone now, so remove it from the docs. + ([@gagern](https://github.com/gagern)) +* [`b6a53b8`](https://github.com/npm/npm/commit/b6a53b889c948053dcbf6d7aab9ad1cd4226dc32) + [npm/docs#477](https://github.com/npm/docs/issues/477) Continue to airbrush + the CLI API docs out of history. ([@verpixelt](https://github.com/verpixelt)) +* [`b835b72`](https://github.com/npm/npm/commit/b835b72d1dd23b0a17321a85d8d395322d18005d) + `semver@5.1.0`: Include BNF for SemVer expression grammar (which is also now + included in `npm help semver`). ([@isaacs](https://github.com/isaacs)) + +#### LAND YOUR DEPENDENCY UPGRADES IN PAIRS SO EVERYONE HAS A FRIEND + +* [`95e99fa`](https://github.com/npm/npm/commit/95e99faadcdc85a16210dd79c0e7d83add1b9f3e) + `request@2.67.0` ([@simov](https://github.com/simov)) +* [`b49199a`](https://github.com/npm/npm/commit/b49199ac96dfb1afe5719286621a318576dd69ae) + [isaacs/rimraf#89](https://github.com/isaacs/rimraf/pull/89) `rimraf@2.4.4` + ([@zerok](https://github.com/zerok)) +* [`6632418`](https://github.com/npm/npm/commit/66324189a734a1665e1b78a06ba44089d9c3a11c) + [npm/nopt#51](https://github.com/npm/nopt/pull/51) `nopt@3.0.6` + ([@wbecker](https://github.com/wbecker)) +* [`f0a3b3e`](https://github.com/npm/npm/commit/f0a3b3e0dbbdaf11ec55dccd59cc21bfa05f9240) + [isaacs/once#7](https://github.com/isaacs/once/pull/7) `once@1.3.3` + ([@floatdrop](https://github.com/floatdrop)) + +### v3.5.2 (2015-12-03): + +Weeeelcome to another npm release! The short version is that we fixed +some `ENOENT` and some modules that resulted in modules going missing. We +also eliminated the use of MD5 in our code base to help folks using +Node.js in FIPS mode. And we fixed a bad URL in our license file. + +#### FIX URL IN LICENSE + +The license incorrectly identified the registry URL as +`registry.npmjs.com` and this has been corrected to `registry.npmjs.org`. + +* [`cb6d81b`](https://github.com/npm/npm/commit/cb6d81bd611f68c6126a90127a9dfe5604d46c8c) + [#10685](https://github.com/npm/npm/pull/10685) + Fix npm public registry URL in notices. + ([@kemitchell](https://github.com/kemitchell)) -* [`769f06e`](https://github.com/npm/npm/commit/769f06e5455d7a9fc738379de2e05868df0dab6f) - Updated tests for `getResolved` so the URLs are run through - `normalize-git-url`. - ([@zkat](https://github.com/zkat)) -* [`edbae68`](https://github.com/npm/npm/commit/edbae685bf48971e878ced373d6825fc1891ee47) - [#8881](https://github.com/npm/npm/issues/8881) Added tests to verify that `git+https:` URLs are handled compatibly. - ([@zkat](https://github.com/zkat)) +#### ENOENT? MORE LIKE ENOMOREBUGS -#### NEWS FLASH! DOCUMENTATION IMPROVEMENTS! +The headliner this week was uncovered by the fixes to bundled dependency +handling over the past few releases. What had been a frustratingly +intermittent and hard to reproduce bug became something that happened +every time in Travis. This fixes another whole bunch of errors where you +would, while running an install have it crash with an `ENOENT` on +`rename`, or the install would finish but some modules would be +mysteriously missing and you'd have to install a second time. -* [`bad4e014`](https://github.com/npm/npm/commit/bad4e0143cc95754a682f1da543b2b4e196e924b) - [#8924](https://github.com/npm/npm/pull/8924) Make sure documented default - values in `lib/cache.js` properly correspond to current code. - ([@watilde](https://github.com/watilde)) -* [`e7a11fd`](https://github.com/npm/npm/commit/e7a11fdf70e333cdfe3dac94a1a30907adb76d59) - [#8036](https://github.com/npm/npm/issues/8036) Clarify the documentation for - `.npmrc` to clarify that it's not read at the project level when doing global - installs. - ([@espadrine](https://github.com/espadrine)) +What's going on was a bit involved, so bear with me: -#### STAY FRESH~ +`npm@3` generates a list of actions to take against the tree on disk. +With the exception of lifecycle scripts, it expects these all to be able +to act independently without interfering with each other. -Kat: That's it for npm core changes! +This means, for instance, that one should be able to upgrade `b` in +`a→b→c` without having npm reinstall `c`. -Rebecca: Great! Let's look at the fresh new dependencies, then! +That works fine by the way. -Kat: See you all next week! +But it also means that the move action should be able to move `b` in +`a→b→c@1.0.1` to `a→d→b→c@1.0.2` without moving or removing `c@1.0.1` and +while leaving `c@1.0.2` in place if it was already installed. -Both: Stay Freeesh~ +That is, the `move` action moves an individual node, replacing itself +with an empty spot if it had children. This is not, as it might first +appear, something where you move an entire branch to another location on +the tree. -(some cat form of Forrest can be seen snoring in the corner) +When moving `b` we already took care to leave `c@1.0.1` in place so that +other moves (or removes) could handle it, but we were stomping on the +destination and so `c@1.0.2` was being removed. -* [`bfa1f45`](https://github.com/npm/npm/bfa1f45ee760d05039557d2245b7e3df9fda8def) - `normalize-git-url@3.0.1`: Fixes url normalization such that `git+https:` - accepts scp syntax, but get converted into absolute-path `https:` URLs. Also - fixes scp syntax so you can have absolute paths after the `:` - (`git@myhost.org:/some/absolute/place.git`) - ([@zkat](https://github.com/zkat)) -* [`6f757d2`](https://github.com/npm/npm/6f757d22b53f91da0bebec6b5d16c1f4dbe130b4) - `glob@5.0.15`: Better handling of ENOTSUP - ([@isaacs](https://github.com/isaacs)) -* [`0920819`](https://github.com/npm/npm/09208197fb8b0c6d5dbf6bd7f59970cf366de989) - `node-gyp@2.0.2`: Fixes an issue with long paths on Win32 - ([@TooTallNate](https://github.com/TooTallNate)) +* [`f4385d8`](https://github.com/npm/npm/commit/f4385d8e7678349e75c80fae8a1f8f366f197937) + [#10655](https://github.com/npm/npm/pull/10655) + Preserve destination `node_modules` when moving. + ([@iarna](https://github.com/iarna)) -### v2.13.1 (2015-07-09): +There was also a bug with `remove` where it was pruning the entire tree +at the remove point, prior to running moves and adds. -#### KAUAI WAS NICE. I MISS IT. +This was fine most of the time, but if we were moving one of the deps out +from inside it, kaboom. -But Forrest's still kinda on vacation, and not just mentally, because he's -hanging out with the fine meatbags at CascadiaFest. Enjoy this small bug -release. +* [`19c626d`](https://github.com/npm/npm/commit/19c626d69888f0cdc6e960254b3fdf523ec4b52c) + [#10655](https://github.com/npm/npm/pull/10655) + Get rid of the remove commit phase– we could have it prune _just_ the + module being removed, but that isn't gaining us anything. + ([@iarna](https://github.com/iarna)) -#### MAKE OURSELVES HAPPY +After all that, we shouldn't be upgrading the `add` of a bundled package +to a `move`. Moves save us from having to extract the package, but with a +bundled dependency it's included in another package already so that +doesn't gain us anything. -* [`40981f2`](https://github.com/npm/npm/commit/40981f2e0c9c12bb003ccf188169afd1d201f5af) - [#8862](https://github.com/npm/npm/issues/8862) Make the lifecycle's safety - check work with scoped packages. ([@tcort](https://github.com/tcort)) -* [`5125856`](https://github.com/npm/npm/commit/512585622481dbbda9a0306932468d59efaff658) - [#8855](https://github.com/npm/npm/issues/8855) Make dependency versions of - `"*"` match `"latest"` when all versions are prerelease. +* [`641a93b`](https://github.com/npm/npm/commit/641a93bd66a6aa4edf2d6167344b50d1a2afb593) + [#10655](https://github.com/npm/npm/pull/10655) + Don't convert adds to moves with bundled deps. ([@iarna](https://github.com/iarna)) -* [`22fdc1d`](https://github.com/npm/npm/commit/22fdc1d52602ba7098af978c75fca8f7d1060141) - Visually emphasize the correct way to write lifecycle scripts. - ([@josh-egan](https://github.com/josh-egan)) -#### MAKE TRAVIS HAPPY +While I was in there, I also took some time to improve diagnostics to +make this sort of thing easier to track down in the future: -* [`413c3ac`](https://github.com/npm/npm/commit/413c3ac2ab2437f3011c6ca0d1630109ec14e604) - Use npm's `2.x` branch for testing its `2.x` branch. +* [`a04ec04`](https://github.com/npm/npm/commit/a04ec04804e562b511cd31afe89c8ba94aa37ff2) + [#10655](https://github.com/npm/ npm/pull/10655) + Wrap rename so errors have stack traces. ([@iarna](https://github.com/iarna)) -* [`7602f64`](https://github.com/npm/npm/commit/7602f64826f7a465d9f3a20bd87a376d992607e6) - Don't prompt for GnuPG passphrase in version lifecycle tests. - ([@othiym23](https://github.com/othiym23)) +* [`8ea142f`](https://github.com/npm/npm/commit/8ea142f896a2764290ca5472442b27b047ab7a1a) + [#10655](https://github.com/npm/npm/pull/10655) + Add silly logging so function is debuggable + ([@iarna](https://github.com/iarna)) + +#### NO MORE MD5 -#### MAKE `npm outdated` HAPPY +We updated modules that had been using MD5 for non-security purposes. +While this is perfectly safe, if you compile Node in FIPS-compliance mode +it will explode if you try to use MD5. We've replaced MD5 with Murmur, +which conveys our intent better and is faster to boot. -* [`d338668`](https://github.com/npm/npm/commit/d338668601d1ebe5247a26237106e80ea8cd7f48) - [#8796](https://github.com/npm/npm/issues/8796) `fstream-npm@1.0.4`: When packing the - package tarball, npm no longer crashes for packages with certain combinations of - `.npmignore` entries, `.gitignore` entries, and lifecycle scripts. +* [`f068b26`](https://github.com/npm/npm/commit/f068b2661a8d0269c184867e003cd08cb6c56cf2) + [#10629](https://github.com/npm/npm/issues/10629) + `unique-filename@1.1.0` ([@iarna](https://github.com/iarna)) -* [`dbe7c9c`](https://github.com/npm/npm/commit/dbe7c9c74734be870d16dd61b9e7f746123011f6) - `nock@2.7.0`: Add matching based on query strings. +* [`dba1b24`](https://github.com/npm/npm/commit/dba1b2402aaa2beceec798d3bd22d00650e01069) + [#10629](https://github.com/npm/npm/issues/10629) + `write-file-atomic@1.1.4` ([@othiym23](https://github.com/othiym23)) +* [`8347a30`](https://github.com/npm/npm/commit/8347a308ef0d2cf0f58f96bba3635af642ec611f) + [#10629](https://github.com/npm/npm/issues/10629) + `fs-write-stream-atomic@1.0.5` + ([@othiym23](https://github.com/othiym23)) + +#### DEPENDENCY UPDATES + +* [`9e2a2bb`](https://github.com/npm/npm/commit/9e2a2bb5bc71a0ab3b3637e8eec212aa22d5c99f) + [nodejs/node-gyp#831](https://github.com/nodejs/node-gyp/pull/831) + `node-gyp@3.2.1`: + Improved \*BSD support. + ([@bnoordhuis](https://github.com/bnoordhuis)) + +### v3.5.1 (2015-11-25): + +#### THE npm CLI !== THE npm REGISTRY !== npm, INC. + +npm-the-CLI is licensed under the terms of the [Artistic License +2.0](https://github.com/npm/npm/blob/8d79c1a39dae908f27eaa37ff6b23515d505ef29/LICENSE), +which is a liberal open-source license that allows you to take this code and do +pretty much whatever you like with it (that is, of course, not legal language, +and if you're doing anything with npm that leaves you in doubt about your legal +rights, please seek the review of qualified counsel, which is to say, not +members of the CLI team, none of whom have passed the bar, to my knowledge). At +the same time the primary registry the CLI uses when looking up and downloading +packages is a commercial service run by npm, Inc., and it has its own [Terms of +Use](https://www.npmjs.com/policies/terms). + +Aside from clarifying the terms of use (and trying to make sure they're more +widely known), the only recent changes to npm's licenses have been making the +split between the CLI and registry clearer. You are still free to do whatever +you like with the CLI's source, and you are free to view, download, and publish +packages to and from `registry.npmjs.org`, but now the existing terms under +which you can do so are more clearly documented. Aside from the two commits +below, see also [the release notes for +`npm@3.4.1`](https://github.com/npm/npm/releases/tag/v3.4.1), which is where +the split between the CLI's code and the terms of use for the registry was +first made more clear. + +* [`35a5dd5`](https://github.com/npm/npm/commit/35a5dd5abbfeec4f98a2b4534ec4ef5d16760581) + [#10532](https://github.com/npm/npm/issues/10532) Clarify that + `registry.npmjs.org` is the default, but that you're free to use the npm CLI + with whatever registry you wish. ([@kemitchell](https://github.com/kemitchell)) +* [`fa6b013`](https://github.com/npm/npm/commit/fa6b0136a0e4a19d8979b2013622e5ff3f0446f8) + [#10532](https://github.com/npm/npm/issues/10532) Having semi-duplicate + release information in `README.md` was confusing and potentially inaccurate, + so remove it. ([@kemitchell](https://github.com/kemitchell)) + +#### EASE UP ON WINDOWS BASH USERS + +It turns out that a fair number of us use bash on Windows (through MINGW or +bundled with Git, plz – Cygwin is still a bridge too far, for both npm and +Node.js). [@jakub-g](https://github.com/jakub-g) did us all a favor and relaxed +the check for npm completion to support MINGW bash. Thanks, Jakub! + +* [`09498e4`](https://github.com/npm/npm/commit/09498e45c5c9e683f092ab1372670f81db4762b6) + [#10156](https://github.com/npm/npm/issues/10156) completion: enable on + Windows in git bash ([@jakub-g](https://github.com/jakub-g)) + +#### THE ONGOING SAGA OF BUNDLED DEPENDENCIES + +`npm@3.5.0` fixed up a serious issue with how `npm@3.4.1` (and potentially +`npm@3.4.0` and `npm@3.3.12`) handled the case in which dependencies bundled +into a package tarball are handled improperly when one or more of their own +dependencies are older than what's latest on the registry. Unfortunately, in +fixing that (quite severe) regression (see [`npm@3.5.0`'s release notes' for +details](https://github.com/npm/npm/releases/tag/v3.5.0)), we introduced a new +(small, and fortunately cosmetic) issue where npm superfluously warns you about +bundled dependencies being stale. We have now fixed that, and hope that we +haven't introduced any _other_ regressions in the process. :D + +* [`20824a7`](https://github.com/npm/npm/commit/20824a75bf7639fb0951a588e3c017a370ae6ec2) + [#10501](https://github.com/npm/npm/issues/10501) Only warn about replacing + bundled dependencies when actually doing so. ([@iarna](https://github.com/iarna)) + +#### MAKE NODE-GYP A LITTLE BLUER + +* [`1d14d88`](https://github.com/npm/npm/commit/1d14d882c3b5af0a7fee46e8e0e343d07e4c38cb) + `node-gyp@3.2.0`: Support AIX, use `which` to find Python, updated to a newer + version of `gyp`, and more! ([@bnoordhuis](https://github.com/bnoordhuis)) + +#### A BOUNTEOUS THANKSGIVING CORNUCOPIA OF DOC TWEAKS + +These are great! Keep them coming! Sorry for letting them pile up so deep, +everybody. Also, a belated Thanksgiving to our Canadian friends, and a happy +Thanksgiving to all our friends in the USA. + +* [`4659f1c`](https://github.com/npm/npm/commit/4659f1c5ad617c46a5e89b48abf0b1c4e6f04307) + [#10244](https://github.com/npm/npm/issues/10244) In `npm@3`, `npm dedupe` + doesn't take any arguments, so update documentation to reflect that. + ([@bengotow](https://github.com/bengotow)) +* [`625a7ee`](https://github.com/npm/npm/commit/625a7ee6b4391e90cb28a95f20a73fd794e1eebe) + [#10250](https://github.com/npm/npm/issues/10250) Correct order of `org:team` + in `npm team` documentation. ([@louislarry](https://github.com/louislarry)) +* [`bea7f87`](https://github.com/npm/npm/commit/bea7f87399d784e3a6d3393afcca658a61a40d77) + [#10371](https://github.com/npm/npm/issues/10371) Remove broken / duplicate + link to tag. ([@WickyNilliams](https://github.com/WickyNilliams)) +* [`0a25e29`](https://github.com/npm/npm/commit/0a25e2956e9ddd4065d6bd929559321afc512fde) + [#10419](https://github.com/npm/npm/issues/10419) Remove references to + nonexistent `npm-rm(1)` documentation. ([@KenanY](https://github.com/KenanY)) +* [`19b94e1`](https://github.com/npm/npm/commit/19b94e1e6781fe2f98ada0a3f49a1bda25e3e32d) + [#10474](https://github.com/npm/npm/issues/10474) Clarify that install finds + dependencies in `package.json`. ([@sleekweasel](https://github.com/sleekweasel)) +* [`b25efc8`](https://github.com/npm/npm/commit/b25efc88067c843ffdda86ea0f50f95d136a638e) + [#9948](https://github.com/npm/npm/issues/9948) Encourage users to file an + issue, rather than emailing authors. ([@trodrigues](https://github.com/trodrigues)) +* [`24f4ced`](https://github.com/npm/npm/commit/24f4cedc83b10061f26362bf2f005ab935e0cbfe) + [#10497](https://github.com/npm/npm/issues/10497) Clarify what a package is + slightly. ([@aredridel](https://github.com/aredridel)) +* [`e8168d4`](https://github.com/npm/npm/commit/e8168d40caae00b2914ea09dbe4bd1b09ba3dcd5) + [#10539](https://github.com/npm/npm/issues/10539) Remove an extra, spuriously + capitalized letter. ([@alexlukin-softgrad](https://github.com/alexlukin-softgrad)) + +### v3.5.0 (2015-11-19): + +#### TEEN ORCS AT THE GATES + +This week heralds the general release of the primary npm registry's [new +support for private packages for +organizations](http://blog.npmjs.org/post/133542170540/private-packages-for-organizations). +For many potential users, it's the missing piece needed to make it easy for you +to move your organization's private work onto npm. And now it's here! The +functionality to support it has been in place in the CLI for a while now, +thanks to [@zkat](https://github.com/zkat)'s hard work. + +During our final testing before the release, our ace support team member +[@snopeks](https://github.com/snopeks) noticed that there had been some drift +between the CLI team's implementation and what npm was actually preparing to +ship. In the interests of everyone having a smooth experience with this +_extremely useful_ new feature, we quickly made a few changes to square up the +CLI and the web site experiences. + +* [`d7fb92d`](https://github.com/npm/npm/commit/d7fb92d1c53ba5196ad6dd2101a06792a4c0412b) + [#9327](https://github.com/npm/npm/issues/9327) `npm access` no longer has + problems when run in a directory that doesn't contain a `package.json`. + ([@othiym23](https://github.com/othiym23)) +* [`17df3b5`](https://github.com/npm/npm/commit/17df3b5d5dffb2e9c223b9cfa2d5fd78c39492a4) + [npm/npm-registry-client#126](https://github.com/npm/npm-registry-client/issues/126) + `npm-registry-client@7.0.8`: Allow the CLI to grant, revoke, and list + permissions on unscoped (public) packages on the primary registry. + ([@othiym23](https://github.com/othiym23)) + +#### NON-OPTIONAL INSTALLS, DEFINITELY NON-OPTIONAL + +* [`180263b`](https://github.com/npm/npm/commit/180263b) + [#10465](https://github.com/npm/npm/pull/10465) + When a non-optional dep fails, we check to see if it's only required by + ONLY optional dependencies. If it is, we make it fail all the deps in + that chain (and roll them back). If it isn't then we give an error. + + We do this by walking up through all of our ancestors until we either hit an + optional dependency or the top of the tree. If we hit the top, we know to + give the error. + + If you installed a module by hand but didn't `--save` it, your module + won't have the top of the tree as an anscestor and so this code was + failing to abort the install with an error + + This updates the logic so that hitting the top OR a module that was + requested by the user will trigger the error message. + ([@iarna](https://github.com/iarna)) -There are new versions of `strip-ansi` and `ansi-regex`, but npm only uses them -indirectly, so we pushed them down into their dependencies where they can get -updated at their own pace. +* [`b726a0e`](https://github.com/npm/npm/commit/b726a0e) + [#9204](https://github.com/npm/npm/issues/9204) + Ideally we would like warnings about your install to come AFTER the + output from your compile steps or the giant tree of installed modules. -* [`06b6ca5`](https://github.com/npm/npm/commit/06b6ca5b5333025f10c8d901628859bd4678e027) - undeduplicate `ansi-regex` ([@othiym23](https://github.com/othiym23)) -* [`b168e33`](https://github.com/npm/npm/commit/b168e33ad46faf47020a45f72ba8cec8c644bdb9) - undeduplicate `strip-ansi` ([@othiym23](https://github.com/othiym23)) + To that end, we've moved warnings about failed optional deps to the show + after your install completes. + ([@iarna](https://github.com/iarna)) -### v2.13.0 (2015-07-02): +#### OVERRIDING BUNDLING -#### FORREST IS OUT! LET'S SNEAK IN ALL THE THINGS! +* [`aed71fb`](https://github.com/npm/npm/commit/aed71fb) + [#10482](https://github.com/npm/npm/issues/10482) + We've been in our bundled modules code a lot lately, and our last go at + this introduced a new bug, where if you had a module `a` that bundled + a module `b`, which in turn required `c`, and the version of `c` that + got bundled wasn't compatible with `b`'s `package.json`, we would then + install a compatible version of `c`, but also erase `b` at the same time. -Well, not _everything_. Just a couple of goodies, like the new `npm ping` -command, and the ability to add files to the commits created by `npm version` -with the new version hooks. There's also a couple of bugfixes in `npm` itself -and some of its dependencies. Here we go! + This fixes that. It also reworks our bundled module support to be much + closer to being in line with how we handle non-bundled modules and we're + hopeful this will reduce any future errors around them. The new structure + is hopefully much easier to reason about anyway. + ([@iarna](https://github.com/iarna)) -#### YES HELLO THIS IS NPM REGISTRY SORRY NO DOG HERE +#### A BRIEF NOTE ON NPM'S BACKWARDS COMPATIBILITY + +We don't often have much to say about the changes we make to our internal +testing and tooling, but I'm going to take this opportunity to reiterate that +npm tries hard to maintain compatibility with a wide variety of Node versions. +As this change shows, we want to ensure that npm works the same across: + +* Node.js 0.8 +* Node.js 0.10 +* Node.js 0.12 +* the latest io.js release +* Node.js 4 LTS +* Node.js 5 + +Contributors who send us pull requests often notice that it's very rare that +our tests pass across all of those versions (ironically, almost entirely due to +the packages we use for testing instead of any issues within npm itself). We're +currently beginning an effort, lasting the rest of 2015, to clean up our test +suite, and not only get it passing on all of the above versions of Node.js, but +working solidly on Windows as well. This is a compounding form of technical +debt that we're finally paying down, and our hope is that cleaning up the tests +will produce a more robust CLI that's a lot easier to write patches for. + +* [`791ec6b`](https://github.com/npm/npm/commit/791ec6b1bac0d1df59f5ebb4ccd16a29a5dc73f0) + [#10233](https://github.com/npm/npm/issues/10233) Update Node.js versions + that Travis uses to test npm. ([@iarna](https://github.com/iarna)) + +#### 0.8 + npm <1.4 COMPATIBLE? SURE WHY NOT + +Hey, you found the feature we added! + +* [`231c58a`](https://github.com/npm/npm/commit/231c58a) + [#10337](https://github.com/npm/npm/pull/10337) + Add two new flags, first `--legacy-bundling` which installs your + dependencies such that if you bundle those dependencies, npm versions + prior to `1.4` can still install them. This eliminates all automatic + deduping. + + Second, `--global-style` which will install modules in your `node_modules` + folder with the same layout as global modules. Only your direct + dependencies will show in `node_modules` and everything they depend on + will be flattened in their `node_modules` folders. This obviously will + elminate some deduping. + ([@iarna](https://github.com/iarna)) -Yes, that's right! We now have a dedicated `npm ping` command. It's super simple -and super easy. You ping. We tell you whether you pinged right by saying hello -right back. This should help out folks dealing with things like proxy issues or -other registry-access debugging issues. Give it a shot! +#### TYPOS IN THE LICENSE, OH MY -This addresses [#5750](https://github.com/npm/npm/issues/5750), and will help -with the `npm doctor` stuff described in -[#6756](https://github.com/npm/npm/issues/6756). +* [`8d79c1a`](https://github.com/npm/npm/commit/8d79c1a39dae908f27eaa37ff6b23515d505ef29) + [#10478](https://github.com/npm/npm/issues/10478) Correct two typos in npm's + LICENSE. ([@jorrit](https://github.com/jorrit)) -* [`f1f7a85`](https://github.com/npm/npm/commit/f1f7a85) - Add ping command to CLI - ([@michaelnisi](https://github.com/michaelnisi)) -* [`8cec629`](https://github.com/npm/npm/commit/8cec629) - Add ping command to npm-registry-client - ([@michaelnisi](https://github.com/michaelnisi)) -* [`0c0c92d`](https://github.com/npm/npm/0c0c92d) - Fixed ping command issues (added docs, tests, fixed minor bugs, etc) - ([@zkat](https://github.com/zkat)) +### v3.4.1 (2015-11-12): -#### I'VE WANTED THIS FOR `version` SINCE LIKE LITERALLY FOREVER AND A DAY +#### ASK FOR NOTHING, GET LATEST -Seriously! This patch lets you add files to the `version` commit before it's -made, So you can add additional metadata files, more automated changes to -`package.json`, or even generate `CHANGELOG.md` automatically pre-commit if -you're into that sort of thing. I'm so happy this is there I can't even. Do you -have other fun usecases for this? Tell -[npmbot (@npmjs)](http://twitter.com/npmjs) about it! +When you run `npm install foo`, you probably expect that you'll get the +`latest` version of `foo`, whatever that is. And good news! That's what +this change makes it do. -* [`582f170`](https://github.com/npm/npm/commit/582f170) - [#8620](https://github.com/npm/npm/issues/8620) version: Allow scripts to add - files to the commit. - ([@jamestalmage](https://github.com/jamestalmage)) +We _think_ this is what everyone wants, but if this causes problems for +you, we want to know! If it proves problematic for people we will consider +reverting it (preferrably before this becomes `npm@latest`). -#### ALL YOUR FILE DESCRIPTORS ARE BELONG TO US +Previously, when you ran `npm install foo` we would act as if you typed +`npm install foo@*`. Now, like any range-type specifier, in addition to +matching the range, it would also have to be `<=` the value of the +`latest` dist-tag. Further, it would exclude prerelease versions from the +list of versions considered for a match. -We've had problems in the past with things like `EMFILE` errors popping up when -trying to install packages with a bunch of dependencies. Isaac patched up -[`graceful-fs`](https://github.com/isaacs/node-graceful-fs) to handle this case -better, so we should be seeing fewer of those. +This worked as expected most of the time, unless your `latest` was a +prerelease version, in which case that version wouldn't be used, to +everyone's surprise. Worse, if all your versions were prerelease versions +it would just refuse to install anything. (We fixed that in +[`npm@3.2.2`](https://github.com/npm/npm/releases/tag/v3.2.2) with +[`e4a38080`](https://github.com/npm/npm/commit/e4a38080).) -* [`022691a`](https://github.com/npm/npm/commit/022691a) - `graceful-fs@4.1.2`: Updated so we can monkey patch globally. - ([@isaacs](https://github.com/isaacs)) -* [`c9fb0fd`](https://github.com/npm/npm/commit/c9fb0fd) - Globally monkey-patch graceful-fs. This should fix some errors when installing - packages with lots of dependencies. - ([@isaacs](https://github.com/isaacs)) +* [`1e834c2`](https://github.com/npm/npm/commit/1e834c2) + [#10189](https://github.com/npm/npm/issues/10189) + `npm-package-arg@4.1.0` Change the default version from `*` to `latest`. + ([@zkat](https://github.com/zkat)) -#### READ THE FINE DOCS. THEY'VE IMPROVED +#### BUGS -* [`5587d0d`](https://github.com/npm/npm/commit/5587d0d) - Nice clarification for `directories.bin` - ([@ujane](https://github.com/ujane)) -* [`20673c7`](https://github.com/npm/npm/commit/20673c7) - Hey, Windows folks! Check out - [`nvm-windows`](https://github.com/coreybutler/nvm-windows) - ([@ArtskydJ](https://github.com/ArtskydJ)) +* [`bec4a84`](https://github.com/npm/npm/commit/bec4a84) + [#10338](https://github.com/npm/npm/pull/10338) + Failed installs could result in more rollback (removal of just installed + packages) than we intended. This bug was first introduced by + [`83975520`](https://github.com/npm/npm/commit/83975520). + ([@iarna](https://github.com/iarna)) +* [`06c732f`](https://github.com/npm/npm/commit/06c732f) + [#10338](https://github.com/npm/npm/pull/10338) + Updating a module could result in the module stealing some of its + dependencies from the top level, potentially breaking other modules or + resulting in many redundent installations. This bug was first introduced + by [`971fd47a`](https://github.com/npm/npm/commit/971fd47a). + ([@iarna](https://github.com/iarna)) +* [`5653366`](https://github.com/npm/npm/commit/5653366) + [#9980](https://github.com/npm/npm/issues/9980) + npm, when removing a module, would refuse to remove the symlinked + binaries if the module itself was symlinked as well. npm goes to some + effort to ensure that it doesn't remove things that aren't is, and this + code was being too conservative. This code has been rewritten to be + easier to follow and to be unit-testable. + ([@iarna](https://github.com/iarna)) -#### MORE NUMBERS! MORE VALUE! +#### LICENSE CLARIFICATION -* [`5afa2d5`](https://github.com/npm/npm/commit/5afa2d5) - `validate-npm-package-name@2.2.2`: Documented package name rules in README - ([@zeusdeux](https://github.com/zeusdeux)) -* [`021f4d9`](https://github.com/npm/npm/commit/021f4d9) - `rimraf@2.4.1`: [#74](https://github.com/isaacs/rimraf/issues/74) Use async - function for bin (to better handle Window's `EBUSY`) - ([@isaacs](https://github.com/isaacs)) -* [`5223432`](https://github.com/npm/npm/commit/5223432) - `osenv@0.1.3`: Use `os.homedir()` polyfill for more reliable output. io.js - added the function and the polyfill does a better job than the prior solution. - ([@sindresorhus](https://github.com/sindresorhus)) -* [`8ebbc90`](https://github.com/npm/npm/commit/8ebbc90) - `npm-cache-filename@1.0.2`: Make sure different git references get different - cache folders. This should prevent `foo/bar#v1.0` and `foo/bar#master` from - sharing the same cache folder. - ([@tomekwi](https://github.com/tomekwi)) -* [`367b854`](https://github.com/npm/npm/commit/367b854) - `lru-cache@2.6.5`: Minor test/typo changes - ([@isaacs](https://github.com/isaacs)) -* [`9fcae61`](https://github.com/npm/npm/commit/9fcae61) - `glob@5.0.13`: Tiny doc change + stop firing 'match' events for ignored items. - ([@isaacs](https://github.com/isaacs)) +* [`80acf20`](https://github.com/npm/npm/commit/80acf20) + [#10326](https://github.com/npm/npm/pull/10326) + Update npm's licensing to more completely cover all of the various + things that are npm. + ([@kemitchell](https://github.com/kemitchell)) -#### OH AND ONE MORE THING +#### CLOSER TO GREEN TRAVIS -* [`7827249`](https://github.com/npm/npm/commit/7827249) - `PeerDependencies` errors now include the package version. - ([@NickHeiner](https://github.com/NickHeiner)) +* [`fc12da9`](https://github.com/npm/npm/commit/fc12da9) + [#10232](https://github.com/npm/npm/pull/10232) + `nock@1.9.0` + Downgrade nock to a version that doesn't depend on streams2 in core so + that more of our tests can pass in 0.8. + ([@iarna](https://github.com/iarna)) -### v2.12.1 (2015-06-25): +### v3.4.0 (2015-11-05): -#### HEY WHERE DID EVERYBODY GO +#### A NEW FEATURE -I keep [hearing some commotion](https://github.com/npm/npm/releases/tag/v3.0.0). -Is there something going on? Like, a party or something? Anyway, here's a small -release with at least two significant bug fixes, at least one of which some of -you have been waiting for for quite a while. +This was a group effort, with [@isaacs](https://github.com/isaacs) +dropping the implementation in back in August. Then, a few days ago, +[@ashleygwilliams](https://github.com/ashleygwilliams) wrote up docs and +just today [@othiym23](https://github.com/othiym23) wrote a test. -#### REMEMBER WHEN I SAID "REMEMBER WHEN I SAID THAT THING ABOUT PERMISSIONS?"? +It's a handy shortcut to update a dependency and then make sure tests +still pass. -`npm@2.12.0` has a change that introduces a fix for a permissions problem -whereby the `_locks` directory in the cache directory can up being owned by -root. The fix in 2.12.0 takes care of that problem, but introduces a new -problem for Windows users where npm tries to call `process.getuid()`, which -doesn't exist on Windows. It was easy enough to fix (but more or less -impossible to test, thanks to all the external dependencies involved with -permissions and platforms and whatnot), but as a result, Windows users might -want to skip `npm@2.12.0` and go straight to `npm@2.12.1`. Sorry about that! +This new command: -* [`7e5da23`](https://github.com/npm/npm/commit/7e5da238ee869201fdb9027c27b79b0f76b440a8) - When using the new, "fixed" cache directory creator, be extra-careful to not - call `process.getuid()` on platforms that lack it. - ([@othiym23](https://github.com/othiym23)) +``` +npm install-test x +``` -#### WHEW! ALL DONE FIXING GIT FOREVER! - -New npm CLI team hero [@zkat](https://github.com/zkat) has finally (FINALLY) -fixed the regression somebody (hi!) introduced a couple months ago whereby git -URLs of the format `git+ssh://user@githost.com:org/repo.git` suddenly stopped -working, and also started being saved (and cached) incorrectly. I am 100% sure -there are absolutely no more bugs in the git caching code at all ever. Mm hm. -Yep. Pretty sure. Maybe. Hmm... I hope. - -*Sighs audibly.* - -[Let us know](http://github.com/npm/npm/issues/new) if we broke something else -with this fix. - -* [`94ca4a7`](https://github.com/npm/npm/commit/94ca4a711619ba8e40ce3d20bc42b13cdb7611b7) - [#8031](https://github.com/npm/npm/issues/8031) Even though - `git+ssh://user@githost.com:org/repo.git` isn't a URL, treat it like one for - the purposes of npm. ([@zkat](https://github.com/zkat)) -* [`e7f56e5`](https://github.com/npm/npm/commit/e7f56e5a97fcf1c52d5c5bee71303b0126129815) - [#8031](https://github.com/npm/npm/issues/8031) `normalize-git-url@2.0.0`: - Handle git URLs (and URL-like remote refs) in a manner consistent with npm's - docs. ([@zkat](https://github.com/zkat)) - -#### YEP, THERE ARE STILL DEPENDENCY UPGRADES - -* [`679bf47`](https://github.com/npm/npm/commit/679bf4745ac2cfbb01c9ce273e189807fd04fa33) - [#40](http://github.com/npm/read-installed/issues/40) `read-installed@4.0.1`: - Handle prerelease versions in top-level dependencies not in `package.json` - without marking those packages as invalid. - ([@benjamn](https://github.com/benjamn)) -* [`3a67410`](https://github.com/npm/npm/commit/3a6741068c9119174c920496778aeee870ebdac0) - `tap@1.3.1` ([@isaacs](https://github.com/isaacs)) -* [`151904a`](https://github.com/npm/npm/commit/151904af39dc24567f8c98529a2a64a4dbcc960a) - `nopt@3.0.3` ([@isaacs](https://github.com/isaacs)) - -### v2.12.0 (2015-06-18): - -#### REMEMBER WHEN I SAID THAT THING ABOUT PERMISSIONS? - -About [a million people](https://github.com/npm/npm/issues?utf8=%E2%9C%93&q=is%3Aissue+EACCES+_locks) -have filed issues related to having a tough time using npm after they've run -npm once or twice with sudo. "Don't worry about it!" I said. "We've fixed all -those permissions problems ages ago! Use this one weird trick and you'll never -have to deal with this again!" - -Well, uh, if you run npm with root the first time you run npm on a machine, it -turns out that the directory npm uses to store lockfiles ends up being owned by -the wrong user (almost always root), and that can, well, it can cause problems -sometimes. By which I mean every time you run npm without being root it'll barf -with `EACCES` errors. Whoops! - -This is an obnoxious regression, and to prevent it from recurring, we've made -it so that the cache, cached git remotes, and the lockfile directories are all -created and maintained using the same utilty module, which not only creates the -relevant paths with the correct permissions, but will fix the permissions on -those directories (if it can) when it notices that they're broken. An `npm -install` run as root ought to be sufficient to fix things up (and if that -doesn't work, first tell us about it, and then run `sudo chown -R $(whoami) -$HOME/.npm`) - -Also, I apologize for inadvertently gaslighting any of you by claiming this bug -wasn't actually a bug. I do think we've got this permanently dealt with now, -but I'll be paying extra-close attention to permissions issues related to the -cache for a while. - -* [`85d1a53`](https://github.com/npm/npm/commit/85d1a53d7b5e0fc04823187e522ae3711ede61fa) - Set permissions on lock directory to the owner of the process. - ([@othiym23](https://github.com/othiym23)) +is the equivalent of running: -#### I WENT TO NODECONF AND ALL I GOT WAS THIS LOUSY SPDX T-SHIRT - -That's not literally true. We spent very little time discussing SPDX, -[@kemitchell](https://github.com/kemitchell) is a champ, and I had a lot of fun -playing drum & bass to a mostly empty Boogie Barn and only ended up with one -moderately severe cold for my pains. Another winner of a NodeConf! (I would -probably wear a SPDX T-shirt if somebody gave me one, though.) - -A bunch of us did have a spirited discussion of the basics of open-source -intellectual property, and the convergence of me, -[@kemitchell](https://github.com/kemitchell), and -[@jandrieu](https://github.com/jandrieu) in one place allowed us to hammmer out -a small but significant issue that had been bedeviling early adopters of the -new SPDX expression syntax in `package.json` license fields: how to deal with -packages that are left without a license on purpose. - -Refer to [the docs](https://github.com/npm/npm/blob/16a3dd545b10f8a2464e2037506ce39124739b41/doc/files/package.json.md#license) -for the specifics, but the short version is that instead of using -`LicenseRef-LICENSE` for proprietary licenses, you can now use either -`UNLICENSED` if you want to make it clear that you don't _want_ your software -to be licensed (and want npm to stop warning you about this), or `SEE LICENSE -IN ` if there's a license with custom text you want to use. At some -point in the near term, we'll be updating npm to verify that the mentioned -file actually exists, but for now you're all on the honor system. - -* [`4827fc7`](https://github.com/npm/npm/commit/4827fc784117c17f35dd9b51b21d1eff6094f661) - [#8557](https://github.com/npm/npm/issues/8557) - `normalize-package-data@2.2.1`: Allow `UNLICENSED` and `SEE LICENSE IN - ` in "license" field of `package.json`. - ([@kemitchell](https://github.com/kemitchell)) -* [`16a3dd5`](https://github.com/npm/npm/commit/16a3dd545b10f8a2464e2037506ce39124739b41) - [#8557](https://github.com/npm/npm/issues/8557) Document the new accepted - values for the "license" field. - ([@kemitchell](https://github.com/kemitchell)) -* [`8155311`](https://github.com/npm/npm/commit/81553119350deaf199e79e38e35b52a5c8ad206c) - [#8557](https://github.com/npm/npm/issues/8557) `init-package-json@1.7.0`: - Support new "license" field values at init time. - ([@kemitchell](https://github.com/kemitchell)) +``` +npm install x && npm test +``` -#### SMALLISH BUG FIXES - -* [`9d8cac9`](https://github.com/npm/npm/commit/9d8cac94a258db648a2b1069b1c8c6529c79d013) - [#8548](https://github.com/npm/npm/issues/8548) Remove extraneous newline - from `npm view` output, making it easier to use in shell scripts. - ([@eush77](https://github.com/eush77)) -* [`765fd4b`](https://github.com/npm/npm/commit/765fd4bfca8ea3e2a4a399765b17eec40a3d893d) - [#8521](https://github.com/npm/npm/issues/8521) When checking for outdated - packages, or updating packages, raise an error when the registry is - unreachable instead of silently "succeeding". - ([@ryantemple](https://github.com/ryantemple)) - -#### SMALLERISH DOCUMENTATION TWEAKS - -* [`5018335`](https://github.com/npm/npm/commit/5018335ce1754a9f771954ecbc1a93acde9b8c0a) - [#8365](https://github.com/npm/npm/issues/8365) Add details about which git - environment variables are whitelisted by npm. - ([@nmalaguti](https://github.com/nmalaguti)) -* [`bed9edd`](https://github.com/npm/npm/commit/bed9edddfdcc6d22a80feab33b53e4ef9172ec72) - [#8554](https://github.com/npm/npm/issues/8554) Fix typo in version docs. - ([@rainyday](https://github.com/rainyday)) - -#### WELL, I GUESS THERE ARE MORE DEPENDENCY UPGRADES - -* [`7ce2f06`](https://github.com/npm/npm/commit/7ce2f06f6f34d469b1d2e248084d4f3fef10c05e) - `request@2.58.0`: Refactor tunneling logic, and use `extend` instead of - abusing `util._extend`. ([@simov](https://github.com/simov)) -* [`e6c6195`](https://github.com/npm/npm/commit/e6c61954aad42e20eec49745615c7640b2026a6c) - `nock@2.6.0`: Refined interception behavior. - ([@pgte](https://github.com/pgte)) -* [`9583cc3`](https://github.com/npm/npm/commit/9583cc3cb192c2fced006927cfba7cd37b588605) - `fstream-npm@1.0.3`: Ensure that `main` entry in `package.json` is always - included in the bundled package tarball. - ([@coderhaoxin](https://github.com/coderhaoxin)) -* [`df89493`](https://github.com/npm/npm/commit/df894930f2716adac28740b29b2e863170919990) - `fstream@1.0.7` ([@isaacs](https://github.com/isaacs)) -* [`9744049`](https://github.com/npm/npm/commit/974404934758124aa8ae5b54f7d5257c3bd6b588) - `dezalgo@1.0.3`: `dezalgo` should be usable in the browser, and can be now - that `asap` has been upgraded to be browserifiable. - ([@mvayngrib](https://github.com/mvayngrib)) - -### v2.11.3 (2015-06-11): - -This was a very quiet week. This release was done by -[@iarna](https://github.com/iarna), while the rest of the team hangs out at -NodeConf Adventure! - -#### TESTS IN 0.8 FAIL LESS - -* [`5b3b3c2`](https://github.com/npm/npm/commit/5b3b3c2) - [#8491](//github.com/npm/npm/pull/8491) - Updates a test to use only 0.8 compatible features - ([@watilde](https://github.com/watilde)) +* [`1ac3e08`](https://github.com/npm/npm/commit/1ac3e08) + [`bcb04f6`](https://github.com/npm/npm/commit/bcb04f6) + [`b6c17dd`](https://github.com/npm/npm/commit/b6c17dd) + [#9443](https://github.com/npm/npm/pull/9443) + Add `npm install-test` command, alias `npm it`. + ([@isaacs](https://github.com/isaacs), + [@ashleygwilliams](https://github.com/ashleygwilliams), + [@othiym23](https://github.com/othiym23)) -#### THE TREADMILL OF UPDATES NEVER CEASES +#### BUG FIXES VIA DEPENDENCY UPDATES -* [`9f439da`](https://github.com/npm/npm/commit/9f439da) - `spdx@0.4.1`: License range updates - ([@kemitchell](https://github.com/kemitchell)) -* [`2dd055b`](https://github.com/npm/npm/commit/2dd055b) - `normalize-package-data@2.2.1`: Fixes a crashing bug when the package.json - `scripts` property is not an object. - ([@iarna](https://github.com/iarna)) -* [`e02e85d`](https://github.com/npm/npm/commit/e02e85d) - `osenv@0.1.2`: Switches to using the `os-tmpdir` module instead of - `os.tmpdir()` for greate consistency in behavior between node versions. +* [`31c0080`](https://github.com/npm/npm/commit/31c0080) + [#8640](https://github.com/npm/npm/issues/8640) + [npm/normalize-package-data#69](https://github.com/npm/normalize-package-data/pull/69) + `normalize-package-data@2.3.5`: + Fix a bug where if you didn't specify the name of a scoped module's + binary, it would install it such that it was impossible to call it. ([@iarna](https://github.com/iarna)) -* [`a6f0265`](https://github.com/npm/npm/commit/a6f0265) - `ini@1.3.4` ([@isaacs](https://github.com/isaacs)) -* [`7395977`](https://github.com/npm/npm/commit/7395977) - `rimraf@2.4.0` ([@isaacs](https://github.com/isaacs)) +* [`02b37bc`](https://github.com/npm/npm/commit/02b37bc) + [npm/fstream-npm#14](https://github.com/npm/fstream-npm/pull/14) + `fstream-npm@1.0.7`: + Only filter `config.gypi` when it's in the build directory. + ([@mscdex](https://github.com/mscdex)) +* [`accb9d2`](https://github.com/npm/npm/commit/accb9d2) + [npm/fstream-npm#15](https://github.com/npm/fstream-npm/pull/15) + `fstream-npm@1.0.6`: + Stop including directories that happened to have names matching whitelisted + npm files in npm module tarballs. The most common cause was that if you had + a README directory then everything in it would be included if wanted it + or not. + ([@taion](https://github.com/taion)) -### v2.11.2 (2015-06-04): +#### DOCUMENTATION FIXES -Another small release this week, brought to you by the latest addition to the -CLI team, [@zkat](https://github.com/zkat) (Hi, all!) +* [`7cf6366`](https://github.com/npm/npm/commit/7cf6366) + [#10036](https://github.com/npm/npm/pull/10036) + Fix typo / over-abbreviation. + ([@ifdattic](https://github.com/ifdattic)) +* [`d0ad8f4`](https://github.com/npm/npm/commit/d0ad8f4) + [#10176](https://github.com/npm/npm/pull/10176) + Fix broken link, scopes => scope. + ([@ashleygwilliams](https://github.com/ashleygwilliams)) +* [`d623783`](https://github.com/npm/npm/commit/d623783) + [#9460](https://github.com/npm/npm/issue/9460) + Specifying the default command run by "npm start" and the + fact that you can pass it arguments. + ([@JuanCaicedo](https://github.com/JuanCaicedo)) + +#### DEPENDENCY UPDATES FOR THEIR OWN SAKE + +* [`0a4c29e`](https://github.com/npm/npm/commit/0a4c29e) + [npm/npmlog#19](https://github.com/npm/npmlog/pull/19) + `npmlog@2.0.0`: Make it possible to emit log messages with `error` as the + prefix. + ([@bengl](https://github.com/bengl)) +* [`9463ce9`](https://github.com/npm/npm/commit/9463ce9) + `read-package-json@2.0.2`: + Minor cleanups. + ([@KenanY](https://github.com/KenanY)) -Mostly small documentation tweaks and version updates. Oh! And `npm outdated` -is actually sorted now. Rejoice! +### v3.3.12 (2015-11-02): -It's gonna be a while before we get another palindromic version number. Enjoy it -while it lasts. :3 +Hi, a little hot-fix release for a bug introduced in 3.3.11. The ENOENT fix +last week ([`f0e2088`](https://github.com/npm/npm/commit/f0e2088)) broke +upgrades of modules that have bundled dependencies (like `npm`, augh!) -#### QUALITY OF LIFE HAS NEVER BEEN BETTER +* [`aedf7cf`](https://github.com/npm/npm/commit/aedf7cf) + [#10192](//github.com/npm/npm/pull/10192) + If a bundled module is going to be replacing a module that's currently on + disk (for instance, when you upgrade a module that includes bundled + dependencies) we want to select the version from the bundle in preference + over the one that was there previously. + ([@iarna](https://github.com/iarna)) -* [`31aada4`](https://github.com/npm/npm/commit/31aada4ccc369c0903ff7f233f464955d12c6fe2) - [#8401](https://github.com/npm/npm/issues/8401) `npm outdated` output is just - that much nicer to consume now, due to sorting by name. - ([@watilde](https://github.com/watilde)) -* [`458a919`](https://github.com/npm/npm/commit/458a91925d8b20c5e672ba71a86745aad654abaf) - [#8469](https://github.com/npm/npm/pull/8469) Explicitly set `cwd` for - `preversion`, `version`, and `postversion` scripts. This makes the scripts - findable relative to the root dir. - ([@alexkwolfe](https://github.com/alexkwolfe)) -* [`55d6d71`](https://github.com/npm/npm/commit/55d6d71562e979e745c9db88861cc39f99b9f3ec) - Ensure package name and version are included in display during `npm version` - lifecycle execution. Gets rid of those little `undefined`s in the console. - ([@othiym23](https://github.com/othiym23)) +### v3.3.11 (2015-10-29): -#### WORDS HAVE NEVER BEEN QUITE THIS READABLE - -* [`3901e49`](https://github.com/npm/npm/commit/3901e4974c800e7f9fba4a5b2ff88da1126d5ef8) - [#8462](https://github.com/npm/npm/pull/8462) English apparently requires - correspondence between indefinite articles and attached nouns. - ([@Enet4](https://github.com/Enet4)) -* [`5a744e4`](https://github.com/npm/npm/commit/5a744e4b143ef7b2f50c80a1d96fdae4204d452b) - [#8421](https://github.com/npm/npm/pull/8421) The effect of `npm prune`'s - `--production` flag and how to use it have been documented a bit better. - ([@foiseworth](https://github.com/foiseworth)) -* [`eada625`](https://github.com/npm/npm/commit/eada625993485f0a2c5324b06f02bfa0a95ce4bc) - We've updated our `.mailmap` and `AUTHORS` files to make sure credit is given - where credit is due. ([@othiym23](https://github.com/othiym23)) - -#### VERSION NUMBERS HAVE NEVER BEEN BIGGER - -* [`c929fd1`](https://github.com/npm/npm/commit/c929fd1d0604b5878ed05706447e078d3e41f5b3) - `readable-stream@1.1.13`: Manually deduped `v1.1.13` (streams3) to make - deduping more reliable on `npm@<3`. ([@othiym23](https://github.com/othiym23)) -* [`a9b4b78`](https://github.com/npm/npm/commit/a9b4b78dcc85571fd1cdd737903f7f37a5e6a755) - `request@2.57.0`: Replace dependency on IncomingMessage's `.client` with - `.socket` as the former was deprecated in io.js 2.2.0. - ([@othiym23](https://github.com/othiym23)) -* [`4b5e557`](https://github.com/npm/npm/commit/4b5e557a23cdefd521ad154111e3d4dcc81f1cdb) - `abbrev@1.0.7`: Better testing, with coverage. - ([@othiym23](https://github.com/othiym23)) -* [`561affe`](https://github.com/npm/npm/commit/561affee21df9bbea5a47298f2452f533be8f359) - `semver@4.3.6`: .npmignore added for less cruft, and better testing, with coverage. - ([@othiym23](https://github.com/othiym23)) -* [`60aef3c`](https://github.com/npm/npm/commit/60aef3cf5d84d757752db3eb8ede2cb385469e7b) - `graceful-fs@3.0.8`: io.js fixes. - ([@zkat](https://github.com/zkat)) -* [`f8bd453`](https://github.com/npm/npm/commit/f8bd453b1a1c46ba7666cb166595e8a011eae443) - `config-chain@1.1.9`: Added MIT license to package.json - ([@zkat](https://github.com/zkat)) +This is a dependency update week, so that means no PRs from our lovely +users. Look for those next week. As it happens, the dependencies updated +were just devdeps, so nothing for you all to worry about. -### v2.11.1 (2015-05-28): - -This release brought to you from poolside at the Omni Amelia Island Resort and -JSConf 2015, which is why it's so tiny. - -#### CONFERENCE WIFI CAN'T STOP THESE BUG FIXES - -* [`cf109a6`](https://github.com/npm/npm/commit/cf109a682f38a059a994da953d5c1b4aaece5e2f) - [#8381](https://github.com/npm/npm/issues/8381) Documented a subtle gotcha - with `.npmrc`, which is that it needs to have its permissions set such that - only the owner can read or write the file. - ([@colakong](https://github.com/colakong)) -* [`180da67`](https://github.com/npm/npm/commit/180da67c9fa53103d625e2f031626c2453c7ebcd) - [#8365](https://github.com/npm/npm/issues/8365) Git 2.3 adds support for - `GIT_SSH_COMMAND`, which allows you to pass an explicit git command (with, - for example, a specific identity passed in on the command line). - ([@nmalaguti](https://github.com/nmalaguti)) - -#### MY (VIRGIN) PINA COLADA IS GETTING LOW, BETTER UPGRADE THESE DEPENDENCIES - -* [`b72de41`](https://github.com/npm/npm/commit/b72de41c5cc9f0c46d3fa8f062c75bd273641474) - `node-gyp@2.0.0`: Use a newer version of `gyp`, and generally improve support - for Visual Studios and Windows. - ([@TooTallNate](https://github.com/TooTallNate)) -* [`8edbe21`](https://github.com/npm/npm/commit/8edbe210af41e8f248f5bb92c72de92f54fda3b1) - `node-gyp@2.0.1`: Don't crash when Python's version doesn't parse as valid - semver. ([@TooTallNate](https://github.com/TooTallNate)) -* [`ba0e0a8`](https://github.com/npm/npm/commit/ba0e0a845a4f29717aba566b416a27d1a22f5d08) - `glob@5.0.10`: Add coverage to tests. ([@isaacs](https://github.com/isaacs)) -* [`7333701`](https://github.com/npm/npm/commit/7333701b5d4f01673f37d64992c63c4e15864d6d) - `request@2.56.0`: Bug fixes and dependency upgrades. - ([@simov](https://github.com/simov)) +But the bug fixes, oh geez, I tracked down some really long standing stuff +this week!! The headliner is those intermittent `ENOENT` errors that no one +could reproduce consistently? I think they're nailed! But also pretty +important, the bug where `hapi` would install w/ a dep missing? Squashed! -### v2.11.0 (2015-05-21): - -For the first time in a very long time, we've added new events to the life -cycle used by `npm run-script`. Since running `npm version (major|minor|patch)` -is typically the last thing many developers do before publishing their updated -packages, it makes sense to add life cycle hooks to run tests or otherwise -preflight the package before doing a full publish. Thanks, as always, to the -indefatigable [@watilde](https://github.com/watilde) for yet another great -usability improvement for npm! - -#### FEATURELETS - -* [`b07f7c7`](https://github.com/npm/npm/commit/b07f7c7c1e5021730b3c320f1b3a46e70f8a21ff) - [#7906](https://github.com/npm/npm/issues/7906) - Add new [`scripts`](https://github.com/npm/npm/blob/master/doc/misc/npm-scripts.md) to - allow you to run scripts before and after - the [`npm version`](https://github.com/npm/npm/blob/master/doc/cli/npm-version.md) - command has run. This makes it easy to, for instance, require that your - test suite passes before bumping the version by just adding `"preversion": - "npm test"` to the scripts section of your `package.json`. - ([@watilde](https://github.com/watilde)) -* [`8a46136`](https://github.com/npm/npm/commit/8a46136f42e416cbadb533bcf89d73d681ed421d) - [#8185](https://github.com/npm/npm/issues/8185) - When we get a "not found" error from the registry, we'll now check to see - if the package name you specified is invalid and if so, give you a better - error message. ([@thefourtheye](https://github.com/thefourtheye)) +#### EEEEEEENOENT -#### BUG FIXES +* [`f0e2088`](https://github.com/npm/npm/commit/f0e2088) + [#10026](https://github.com/npm/npm/issues/10026) + Eliminate some, if not many, of the `ENOENT` errors `npm@3` has seen over + the past few months. This was happening when npm would, in its own mind, + correct a bundled dependency, due to a `package.json` specifying an + incompatible version. Then, when npm extracted the bundled version, what + was on disk didn't match its mind and… well, when it tried to act on what + was in its mind, we got an `ENOENT` because it didn't actually exist on + disk. + ([@iarna](https://github.com/iarna)) -* [`9bcf573`](https://github.com/npm/npm/commit/9bcf5730bd0316f210dafea898afe9103849cea9) - [#8324](https://github.com/npm/npm/pull/8324) On Windows, when you've configured a - custom `node-gyp`, run it with node itself instead of using the default open action (which - is almost never what you want). ([@bangbang93](https://github.com/bangbang93)) -* [`1da9b04`](https://github.com/npm/npm/commit/1da9b0411d3416c7fca17d08cbbcfca7ae86e92d) - [#7195](https://github.com/npm/npm/issues/7195) - [#7260](https://github.com/npm/npm/issues/7260) `npm-registry-client@6.4.0`: - (Re-)allow publication of existing mixed-case packages (part 1). - ([@smikes](https://github.com/smikes)) -* [`e926783`](https://github.com/npm/npm/commit/e9267830ab261c751f12723e84d2458ae9238646) - [#7195](https://github.com/npm/npm/issues/7195) - [#7260](https://github.com/npm/npm/issues/7260) - `normalize-package-data@2.2.0`: (Re-)allow publication of existing mixed-case - packages (part 2). ([@smikes](https://github.com/smikes)) +#### PARTIAL SHRINKWRAPS, NO LONGER A BAD DAY -#### DOCUMENTATION IMPROVEMENTS +* [`712fd9c`](https://github.com/npm/npm/commit/712fd9c) + [#10153](https://github.com/npm/npm/pull/10153) + Imagine that you have a module, let's call it `fun-time`, and it depends + on two dependencies, `need-fun@1` and `need-time`. Further, `need-time` + requires `need-fun@2`. So after install the logical tree will look like + this: -* [`f62ee05`](https://github.com/npm/npm/commit/f62ee05333b141539a8e851c620dd2e82ff06860) - [#8314](https://github.com/npm/npm/issues/8314) Update the README to warn - folks away from using the CLI's internal API. For the love of glob, just use a - child process to run the CLI! ([@claycarpenter](https://github.com/claycarpenter)) -* [`1093921`](https://github.com/npm/npm/commit/1093921c04db41ab46db24a170a634a4b2acd8d9) - [#8279](https://github.com/npm/npm/pull/8279) - Update the documentation to note that, yes, you can publish scoped packages to the - public registry now! ([@mantoni](https://github.com/mantoni)) -* [`f87cde5`](https://github.com/npm/npm/commit/f87cde5234a760d3e515ffdaacaed6f5b71dbf44) - [#8292](https://github.com/npm/npm/pull/8292) - Fix typo in an example and grammar in the description in - the [shrinkwrap documentation](https://github.com/npm/npm/blob/master/doc/cli/npm-shrinkwrap.md). - ([@vshih](https://github.com/vshih)) -* [`d3526ce`](https://github.com/npm/npm/commit/d3526ceb09a0c29fdb7d4124536ae09057d033e7) - Improve the formatting in - the [shrinkwrap documentation](https://github.com/npm/npm/blob/master/doc/cli/npm-shrinkwrap.md). - ([@othiym23](https://github.com/othiym23)) -* [`19fe6d2`](https://github.com/npm/npm/commit/19fe6d20883e28956ff916fe4dae42d73ee6195b) - [#8311](https://github.com/npm/npm/pull/8311) - Update [README.md](https://github.com/npm/npm#readme) to use syntax highlighting in - its code samples and bits of shell scripts. ([@SimenB](https://github.com/SimenB)) - -#### DEPENDENCY UPDATES! ALWAYS AND FOREVER! - -* [`fc52160`](https://github.com/npm/npm/commit/fc52160d0223226fffe4166f42fdfd3b899b3c1e) - [#4700](https://github.com/npm/npm/issues/4700) [#5044](https://github.com/npm/npm/issues/5044) - `init-package-json@1.6.0`: Make entering an invalid version while running `npm init` give - you an immediate error and prompt you to correct it. ([@watilde](https://github.com/watilde)) -* [`738853e`](https://github.com/npm/npm/commit/738853eb1f55636476a2a410c2c04732eec9d51e) - [#7763](https://github.com/npm/npm/issues/7763) `fs-write-stream-atomic@1.0.3`: Fix a bug - where errors would not propagate, making error messages unhelpful. - ([@iarna](https://github.com/iarna)) -* [`6d74a2d`](https://github.com/npm/npm/commit/6d74a2d2ac7f92750cf6a2cfafae1af23b569098) - `npm-package-arg@4.0.1`: Fix tests on windows ([@Bacra](https://github.com)) and with - more recent `hosted-git-info`. ([@iarna](https://github.com/iarna)) -* [`50f7178`](https://github.com/npm/npm/commit/50f717852fbf713ef6cbc4e0a9ab42657decbbbd) - `hosted-git-info@2.1.4`: Correct spelling in its documentation. - ([@iarna](https://github.com/iarna)) -* [`d7956ca`](https://github.com/npm/npm/commit/d7956ca17c057d5383ff0d3fc5cf6ac2940b034d) - `glob@5.0.7`: Fix a bug where unusual error conditions could make - further use of the module fail. ([@isaacs](https://github.com/isaacs)) -* [`44f7d74`](https://github.com/npm/npm/commit/44f7d74c5d3181d37da7ea7949c86b344153f8d9) - `tap@1.1.0`: Update to the most recent tap to get a whole host of bug - fixes and integration with [coveralls](https://coveralls.io/). - ([@isaacs](https://github.com/isaacs)) -* [`c21e8a8`](https://github.com/npm/npm/commit/c21e8a8d94bcf0ad79dc583ddc53f8366d4813b3) - `nock@2.2.0` ([@othiym23](https://github.com/othiym23)) - -#### LICENSE FILES FOR THE LICENSE GOD - -* Add missing ISC license file to package ([@kasicka](https://github.com/kasicka)): - * [`aa9908c`](https://github.com/npm/npm/commit/aa9908c20017729673b9d410b77f9a16b7aae8a4) `realize-package-specifier@3.0.1` - * [`23a3b1a`](https://github.com/npm/npm/commit/23a3b1a726b9176c70ce0ccf3cd9d25c54429bdf) `fs-vacuum@1.2.6` - * [`8e04bba`](https://github.com/npm/npm/commit/8e04bba830d4353d84751d21803cd127c96153a7) `dezalgo@1.0.2` - * [`50f7178`](https://github.com/npm/npm/commit/50f717852fbf713ef6cbc4e0a9ab42657decbbbd) `hosted-git-info@2.1.4` - * [`6a54917`](https://github.com/npm/npm/commit/6a54917fbd4df995495a95d4b548defd44b77c93) `write-file-atomic@1.1.2` - * [`971f92c`](https://github.com/npm/npm/commit/971f92c4a4e5514217d1e4db45d1ccf71a60ff19) `async-some@1.0.2` - * [`67b50b7`](https://github.com/npm/npm/commit/67b50b7667a42bb3340a660eb2e617e1a554d2d4) `normalize-git-url@1.0.1` - -#### SPDX LICENSE UPDATES - -* Switch license to - [BSD-2-Clause](http://spdx.org/licenses/BSD-2-Clause.html#licenseText) from - plain "BSD" ([@isaacs](https://github.com/isaacs)): - * [`efdb733`](https://github.com/npm/npm/commit/efdb73332eeedcad4c609796929070b62abb37ab) `npm-user-validate@0.1.2` - * [`e926783`](https://github.com/npm/npm/commit/e9267830ab261c751f12723e84d2458ae9238646) `normalize-package-data@2.2.0` -* Switch license to [ISC](http://spdx.org/licenses/ISC.html#licenseText) from - [BSD](http://spdx.org/licenses/BSD-2-Clause.html#licenseText) - ([@isaacs](https://github.com/isaacs)): - * [`c300956`](https://github.com/npm/npm/commit/c3009565a964f0ead4ac4ab234b1a458e2365f17) `block-stream@0.0.8` - * [`1de1253`](https://github.com/npm/npm/commit/1de125355765fecd31e682ed0ff9d2edbeac0bb0) `lockfile@1.0.1` - * [`0d5698a`](https://github.com/npm/npm/commit/0d5698ab132e376c7aec93ae357c274932116220) `osenv@0.1.1` - * [`2e84921`](https://github.com/npm/npm/commit/2e84921474e1ffb18de9fce4616e73171fa8046d) `abbrev@1.0.6` - * [`872fac9`](https://github.com/npm/npm/commit/872fac9d10c11607e4d0348c08a683b84e64d30b) `chmodr@0.1.1` - * [`01eb7f6`](https://github.com/npm/npm/commit/01eb7f60acba584346ad8aae846657899f3b6887) `chownr@0.0.2` - * [`294336f`](https://github.com/npm/npm/commit/294336f0f31c7b9fe31a50075ed750db6db134d1) `read@1.0.6` - * [`ebdf6a1`](https://github.com/npm/npm/commit/ebdf6a14d17962cdb7128402c53b452f91d44ca7) `graceful-fs@3.0.7` -* Switch license to [ISC](http://spdx.org/licenses/ISC.html#licenseText) from - [MIT](http://spdx.org/licenses/MIT.html#licenseText) - ([@isaacs](https://github.com/isaacs)): - * [`e5d237f`](https://github.com/npm/npm/commit/e5d237fc0f436dd2a89437ebf8a9632a2e35ccbe) `nopt@3.0.2` - * [`79fef14`](https://github.com/npm/npm/commit/79fef1421b78f044980f0d1bf0e97039b6992710) `rimraf@2.3.4` - * [`22527da`](https://github.com/npm/npm/commit/22527da4816e7c2746cdc0317c5fb4a85152d554) `minimatch@2.0.8` - * [`882ac87`](https://github.com/npm/npm/commit/882ac87a6c4123ca985d7ad4394ea5085e5b0ef5) `lru-cache@2.6.4` - * [`9d9d015`](https://github.com/npm/npm/commit/9d9d015a2e972f68664dda54fbb204db28b21ede) `npmlog@1.2.1` - -### v2.10.1 (2015-05-14): - -#### BUG FIXES & DOCUMENTATION TWEAKS - -* [`dc77520`](https://github.com/npm/npm/commit/dc7752013ffce13a3d3f13e518a0052c22fc1158) - When getting back a 404 from a request to a private registry that uses a - registry path that extends past the root - (`http://registry.enterprise.co/path/to/registry`), display the name of the - nonexistent package, rather than the first element in the registry API path. - Sorry, Artifactory users! ([@hayes](https://github.com/hayes)) -* [`f70dea9`](https://github.com/npm/npm/commit/f70dea9b4766f6eaa55012c3e8087e9cb04fd4ce) - Make clearer that `--registry` can be used on a per-publish basis to push a - package to a non-default registry. ([@mischkl](https://github.com/mischkl)) -* [`a3e26f5`](https://github.com/npm/npm/commit/a3e26f5b4465991a941a325468ab7725670d2a94) - Did you know that GitHub shortcuts can have commit-ishes included - (`org/repo#branch`)? They can! ([@iarna](https://github.com/iarna)) -* [`0e2c091`](https://github.com/npm/npm/commit/0e2c091a539b61fdc60423b6bbaaf30c24e4b1b8) - Some errors from `readPackage` were being swallowed, potentially leading to - invalid package trees on disk. ([@smikes](https://github.com/smikes)) - -#### DEPENDENCY UPDATES! STILL! MORE! AGAIN! - -* [`0b901ad`](https://github.com/npm/npm/commit/0b901ad0811d84dda6ca0755a9adc8d47825edd0) - `lru-cache@2.6.3`: Removed some cruft from the published package. - ([@isaacs](https://github.com/isaacs)) -* [`d713e0b`](https://github.com/npm/npm/commit/d713e0b14930c563e3fdb6ac6323bae2a8924652) - `mkdirp@0.5.1`: Made compliant with `standard`, dropped support for Node 0.6, - added (Travis) support for Node 0.12 and io.js. - ([@isaacs](https://github.com/isaacs)) -* [`a2d6578`](https://github.com/npm/npm/commit/a2d6578b6554c5c9d48fe2006751759f4da57520) - `glob@1.0.3`: Updated to use `tap@1`. ([@isaacs](https://github.com/isaacs)) -* [`64cd1a5`](https://github.com/npm/npm/commit/64cd1a570aaa5f24ccba190948ec9456297c97f5) - `fstream@ 1.0.6`: Made compliant with [`standard`](http://npm.im/standard) - (done by [@othiym23](https://github.com/othiym23), and then debugged and - fixed by [@iarna](https://github.com/iarna)), and license changed to ISC. - ([@othiym23](https://github.com/othiym23) / - [@iarna](https://github.com/iarna)) -* [`b527a7c`](https://github.com/npm/npm/commit/b527a7c2ba3c4002f443dd2c536ff4ff41a38b86) - `which@1.1.1`: Callers can pass in their own `PATH` instead of relying on - `process.env`. ([@isaacs](https://github.com/isaacs)) - -### v2.10.0 (2015-05-8): - -#### THE IMPLICATIONS ARE MORE PROFOUND THAN THEY APPEAR - -If you've done much development in The Enterprise®™, you know that keeping -track of software licenses is far more important than one might expect / hope / -fear. Tracking licenses is a hassle, and while many (if not most) of us have -(reluctantly) gotten around to setting a license to use by default with all our -new projects (even if it's just WTFPL), that's about as far as most of us think -about it. In big enterprise shops, ensuring that projects don't inadvertently -use software with unacceptably encumbered licenses is serious business, and -developers spend a surprising (and appalling) amount of time ensuring that -licensing is covered by writing automated checkers and other license auditing -tools. - -The Linux Foundation has been working on a machine-parseable syntax for license -expressions in the form of [SPDX](https://spdx.org/), an appropriately -enterprisey acronym. IP attorney and JavaScript culture hero [Kyle -Mitchell](http://kemitchell.com/) has put a considerable amount of effort into -bringing SPDX to JavaScript and Node. He's written -[`spdx.js`](https://github.com/kemitchell/spdx.js), a JavaScript SPDX -expression parser, and has integrated it into npm in a few different ways. - -For you as a user of npm, this means: - -* npm now has proper support for dual licensing in `package.json`, due to - SPDX's compound expression syntax. Run `npm help package.json` for details. -* npm will warn you if the `package.json` for your project is either missing a - `"license"` field, or if the value of that field isn't a valid SPDX - expression (pro tip: `"BSD"` becomes `"BSD-2-Clause"` in SPDX (unless you - really want one of its variants); `"MIT"` and `"ISC"` are fine as-is; the - [full list](https://github.com/shinnn/spdx-license-ids/blob/master/spdx-license-ids.json) - is its own package). -* `npm init` now demands that you use a valid SPDX expression when using it - interactively (pro tip: I mostly use `npm init -y`, having previously run - `npm config set init.license=MIT` / `npm config set init.author.email=foo` / - `npm config set init.author.name=me`). -* The documentation for `package.json` has been updated to tell you how to use - the `"license"` field properly with SPDX. - -In general, this shouldn't be a big deal for anybody other than people trying -to run their own automated license validators, but in the long run, if -everybody switches to this format, many people's lives will be made much -simpler. I think this is an important improvement for npm and am very thankful -to Kyle for taking the lead on this. Also, even if you think all of this is -completely stupid, just [choose a license](http://en.wikipedia.org/wiki/License-free_software) -anyway. Future you will thank past you someday, unless you are -[djb](http://cr.yp.to/), in which case you are djb, and more power to you. - -* [`8669f7d`](https://github.com/npm/npm/commit/8669f7d88c472ccdd60e140106ac43cca636a648) - [#8179](https://github.com/npm/npm/issues/8179) Document how to use SPDX in - `license` stanzas in `package.json`, including how to migrate from old busted - license declaration arrays to fancy new compound-license clauses. - ([@kemitchell](https://github.com/kemitchell)) -* [`98ad98c`](https://github.com/npm/npm/commit/98ad98cb11f3d3ba29a488ef1ab050b066d9c7f6) - [#8197](https://github.com/npm/npm/issues/8197) `init-package-json@1.5.0` - Ensure that packages bootstrapped with `npm init` use an SPDX-compliant - license expression. ([@kemitchell](https://github.com/kemitchell)) -* [`2ad3905`](https://github.com/npm/npm/commit/2ad3905e9139b0be2b22accf707b814469de813e) - [#8197](https://github.com/npm/npm/issues/8197) - `normalize-package-data@2.1.0`: Warn when a package is missing a license - declaration, or using a license expression that isn't valid SPDX. - ([@kemitchell](https://github.com/kemitchell)) -* [`127bb73`](https://github.com/npm/npm/commit/127bb73ccccc59a1267851c702d8ebd3f3a97e81) - [#8197](https://github.com/npm/npm/issues/8197) `tar@2.1.1`: Switch from - `BSD` to `ISC` for license, where the latter is valid SPDX. - ([@othiym23](https://github.com/othiym23)) -* [`e9a933a`](https://github.com/npm/npm/commit/e9a933a9148180d9d799f99f4154f5110ff2cace) - [#8197](https://github.com/npm/npm/issues/8197) `once@1.3.2`: Switch from - `BSD` to `ISC` for license, where the latter is valid SPDX. - ([@othiym23](https://github.com/othiym23)) -* [`412401f`](https://github.com/npm/npm/commit/412401fb6a19b18f3e02d97a24d4dafed650c186) - [#8197](https://github.com/npm/npm/issues/8197) `semver@4.3.4`: Switch from - `BSD` to `ISC` for license, where the latter is valid SPDX. - ([@othiym23](https://github.com/othiym23)) + ``` + fun-time + ├── need-fun@1 + └── need-time + └── need-fun@2 + ``` -As a corollary to the previous changes, I've put some work into making `npm -install` spew out fewer pointless warnings about missing values in transitive -dependencies. From now on, npm will only warn you about missing READMEs, -license fields, and the like for top-level projects (including packages you -directly install into your application, but we may relax that eventually). - -Practically _nobody_ liked having those warnings displayed for child -dependencies, for the simple reason that there was very little that anybody -could _do_ about those warnings, unless they happened to be the maintainers of -those dependencies themselves. Since many, many projects don't have -SPDX-compliant licenses, the number of warnings reached a level where they ran -the risk of turning into a block of visual noise that developers (read: me, and -probably you) would ignore forever. - -So I fixed it. If you still want to see the messages about child dependencies, -they're still there, but have been pushed down a logging level to `info`. You -can display them by running `npm install -d` or `npm install --loglevel=info`. - -* [`eb18245`](https://github.com/npm/npm/commit/eb18245f55fb4cd62a36867744bcd1b7be0a33e2) - Only warn on normalization errors for top-level dependencies. Transitive - dependency validation warnings are logged at `info` level. - ([@othiym23](https://github.com/othiym23)) + Now, the `fun-time` author also distributes a shrinkwrap, but it only includes + the `need-fun@1` in it. -#### BUG FIXES + Resolving dependencies would look something like this: -* [`e40e809`](https://github.com/npm/npm/commit/e40e8095d2bc9fa4eb8f01aa22067e0068fa8a54) - `tap@1.0.1`: TAP: The Next Generation. Fix up many tests to they work - properly with the new major version of `node-tap`. Look at all the colors! - ([@isaacs](https://github.com/isaacs)) -* [`f9314e9`](https://github.com/npm/npm/commit/f9314e97d26532c0ef2b03e98f3ed300b7cd5026) - `nock@1.9.0`: Minor tweaks and bug fixes. ([@pgte](https://github.com/pgte)) -* [`45c2b1a`](https://github.com/npm/npm/commit/45c2b1aaa051733fa352074994ae6e569fd51e8b) - [#8187](https://github.com/npm/npm/issues/8187) `npm ls` wasn't properly - recognizing dependencies installed from GitHub repositories as git - dependencies, and so wasn't displaying them as such. - ([@zornme](https://github.com/zornme)) -* [`1ab57c3`](https://github.com/npm/npm/commit/1ab57c38116c0403965c92bf60121f0f251433e4) - In some cases, `npm help` was using something that looked like a regular - expression where a glob pattern should be used, and vice versa. - ([@isaacs](https://github.com/isaacs)) + 1. Require `need-fun@1`: Use version from shrinkwrap (ignoring version) + 2. Require `need-time`: User version in package.json + 1. Require `need-fun@2`: Use version from shrinkwrap, which oh hey, is + already installed at the top level, so no further action is needed. -### v2.9.1 (2015-04-30): - -#### WOW! MORE GIT FIXES! YOU LOVE THOSE! - -The first item below is actually a pretty big deal, as it fixes (with a -one-word change and a much, much longer test case (thanks again, -[@iarna](https://github.com/iarna))) a regression that's been around for months -now. If you're depending on multiple branches of a single git dependency in a -single project, you probably want to check out `npm@2.9.1` and verify that -things (again?) work correctly in your project. - -* [`178a6ad`](https://github.com/npm/npm/commit/178a6ad540215820d16217465a5f220d8c95a313) - [#7202](https://github.com/npm/npm/issues/7202) When caching git - dependencies, do so by the whole URL, including the branch name, so that if a - single application depends on multiple branches from the same repository (in - practice, multiple version tags), every install is of the correct version, - instead of reusing whichever branch the caching process happened to check out - first. ([@iarna](https://github.com/iarna)) -* [`63b79cc`](https://github.com/npm/npm/commit/63b79ccde092a9cb3b1f34abe43e1d2ba69c0dbf) - [#8084](https://github.com/npm/npm/issues/8084) Ensure that Bitbucket, - GitHub, and Gitlab dependencies are installed the same way as non-hosted git - dependencies, fixing `npm install --link`. - ([@laiso](https://github.com/laiso)) - -#### DOCUMENTATION FIXES AND TWEAKS - -These changes may seem simple and small (except Lin's fix to the package name -restrictions, which was more an egregious oversight on our part), but cleaner -documentation makes npm significantly more pleasant to use. I really appreciate -all the typo fixes, clarifications, and formatting tweaks people send us, and -am delighted that we get so many of these pull requests. Thanks, everybody! - -* [`ca478dc`](https://github.com/npm/npm/commit/ca478dcaa29b8f07cd6fe515a3c4518166819291) - [#8137](https://github.com/npm/npm/issues/8137) Somehow, we had failed to - clearly document the full restrictions on package names. - [@linclark](https://github.com/linclark) has now fixed that, although we will - take with us to our graves the reasons why the maximum package name length is 214 - characters (well, OK, it was that that was the longest name in the registry - when we decided to put a cap on the name length). - ([@linclark](https://github.com/linclark)) -* [`b574076`](https://github.com/npm/npm/commit/b5740767c320c1eff3576a8d63952534a0fbb936) - [#8079](https://github.com/npm/npm/issues/8079) Make the `npm shrinkwrap` - documentation use code formatting for examples consistently. It would be - great to do this for more commands HINT HINT. - ([@RichardLitt](https://github.com/RichardLitt)) -* [`1ff636e`](https://github.com/npm/npm/commit/1ff636e2db3852a53e38c866fed7eafdacd307fc) - [#8105](https://github.com/npm/npm/issues/8105) Document that the global - `npmrc` goes in `$PREFIX/etc/npmrc`, instead of `$PREFIX/npmrc`. - ([@anttti](https://github.com/anttti)) -* [`c3f2f7c`](https://github.com/npm/npm/commit/c3f2f7c299342e1c1eccc55a976a63c607f51621) - [#8127](https://github.com/npm/npm/issues/8127) Document how to use `npm run - build` directly (hint: it's different from `npm build`!). - ([@mikemaccana](https://github.com/mikemaccana)) -* [`873e467`](https://github.com/npm/npm/commit/873e46757e1986761b15353f94580a071adcb383) - [#8069](https://github.com/npm/npm/issues/8069) Take the old, dead npm - mailing list address out of `package.json`. It seems that people don't have - much trouble figuring out how to report errors to npm. - ([@robertkowalski](https://github.com/robertkowalski)) - -#### ENROBUSTIFICATIONMENT - -* [`5abfc9c`](https://github.com/npm/npm/commit/5abfc9c9017da714e47a3aece750836b4f9af6a9) - [#7973](https://github.com/npm/npm/issues/7973) `npm run-script` completion - will only suggest run scripts, instead of including dependencies. If for some - reason you still wanted it to suggest dependencies, let us know. - ([@mantoni](https://github.com/mantoni)) -* [`4b564f0`](https://github.com/npm/npm/commit/4b564f0ce979dc74c09604f4d46fd25a2ee63804) - [#8081](https://github.com/npm/npm/issues/8081) Use `osenv` to parse the - environment's `PATH` in a platform-neutral way. - ([@watilde](https://github.com/watilde)) -* [`a4b6238`](https://github.com/npm/npm/commit/a4b62387b41848818973eeed056fd5c6570274f3) - [#8094](https://github.com/npm/npm/issues/8094) When we refactored the - configuration code to split out checking for IPv4 local addresses, we - inadvertently completely broke it by failing to return the values. In - addition, just the call to `os.getInterfaces()` could throw on systems where - querying the network configuration requires elevated privileges (e.g. Amazon - Lambda). Add the return, and trap errors so they don't cause npm to explode. - Thanks to [@mhart](https://github.com/mhart) for bringing this to our - attention! ([@othiym23](https://github.com/othiym23)) - -#### DEPENDENCY UPDATES WAIT FOR NO SOPHONT - -* [`000cd8b`](https://github.com/npm/npm/commit/000cd8b52104942ac3404f0ad0651d82f573da37) - `rimraf@2.3.3`: More informative assertions on argument validation failure. - ([@isaacs](https://github.com/isaacs)) -* [`530a2e3`](https://github.com/npm/npm/commit/530a2e369128270f3e098f0e9be061533003b0eb) - `lru-cache@2.6.2`: Revert to old key access-time behavior, as it was correct - all along. ([@isaacs](https://github.com/isaacs)) -* [`d88958c`](https://github.com/npm/npm/commit/d88958ca02ce81b027b9919aec539d0145875a59) - `minimatch@2.0.7`: Feature detection and test improvements. - ([@isaacs](https://github.com/isaacs)) -* [`3fa39e4`](https://github.com/npm/npm/commit/3fa39e4d492609d5d045033896dcd99f7b875329) - `nock@1.7.1` ([@pgte](https://github.com/pgte)) - -### v2.9.0 (2015-04-23): - -This week was kind of a breather to concentrate on fixing up the tests on the -`multi-stage` branch, and not mess with git issues for a little while. -Unfortunately, There are now enough severe git issues that we'll probably have -to spend another couple weeks tackling them. In the meantime, enjoy these two -small features. They're just enough to qualify for a semver-minor bump: - -#### NANOFEATURES - -* [`2799322`](https://github.com/npm/npm/commit/279932298ce5b589c5eea9439ac40b88b99c6a4a) - [#7426](https://github.com/npm/npm/issues/7426) Include local modules in `npm - outdated` and `npm update`. ([@ArnaudRinquin](https://github.com/ArnaudRinquin)) -* [`2114862`](https://github.com/npm/npm/commit/21148620fa03a582f4ec436bb16bd472664f2737) - [#8014](https://github.com/npm/npm/issues/8014) The prefix used before the - version on version tags is now configurable via `tag-version-prefix`. Be - careful with this one and read the docs before using it. - ([@kkragenbrink](https://github.com/kkragenbrink)) - -#### OTHER MINOR TWEAKS - -* [`18ce0ec`](https://github.com/npm/npm/commit/18ce0ecd2d94ad3af01e997f1396515892dd363c) - [#3032](https://github.com/npm/npm/issues/3032) `npm unpublish` will now use - the registry set in `package.json`, just like `npm publish`. This only - applies, for now, when unpublishing the entire package, as unpublishing a - single version requires the name be included on the command line and - therefore doesn't read from `package.json`. ([@watilde](https://github.com/watilde)) -* [`9ad2100`](https://github.com/npm/npm/commit/9ad210042242e51d52b2a8b633d8e59248f5faa4) - [#8008](https://github.com/npm/npm/issues/8008) Once again, when considering - what to install on `npm install`, include `devDependencies`. - ([@smikes](https://github.com/smikes)) -* [`5466260`](https://github.com/npm/npm/commit/546626059909dca1906454e820ca4e315c1795bd) - [#8003](https://github.com/npm/npm/issues/8003) Clarify the documentation - around scopes to make it easier to understand how they support private - packages. ([@smikes](https://github.com/smikes)) - -#### DEPENDENCIES WILL NOT STOP UNTIL YOU ARE VERY SLEEPY - -* [`faf65a7`](https://github.com/npm/npm/commit/faf65a7bbb2fad13216f64ed8f1243bafe743f97) - `init-package-json@1.4.2`: If there are multiple validation errors and - warnings, ensure they all get displayed (includes a rad new way of testing - `init-package-json` contributed by - [@michaelnisi](https://github.com/michaelnisi)). - ([@MisumiRize](https://github.com/MisumiRize)) -* [`7f10f38`](https://github.com/npm/npm/commit/7f10f38d29a8423d7cde8103fa7b64ac728da1e0) - `editor@1.0.0`: `1.0.0` is literally more than `0.1.0` (no change aside from - version number). ([@substack](https://github.com/substack)) -* [`4979af3`](https://github.com/npm/npm/commit/4979af3fcae5a3962383b7fdad3162381e62eefe) - [#6805](https://github.com/npm/npm/issues/6805) `npm-registry-client@6.3.3`: - Decode scoped package names sent by the registry so they look nicer. - ([@mmalecki](https://github.com/mmalecki)) - -### v2.8.4 (2015-04-16): - -This is the fourth release of npm this week, so it's mostly just landing a few -small outstanding PRs on dependencies and some tiny documentation tweaks. -`npm@2.8.3` is where the real action is. - -* [`ee2bd77`](https://github.com/npm/npm/commit/ee2bd77f3c64d38735d1d31028224a5c40422a9b) - [#7983](https://github.com/npm/npm/issues/7983) `tar@2.1.0`: Better error - reporting in corrupted tar files, and add support for the `fromBase` flag - (rescued from the dustbin of history by - [@deanmarano](https://github.com/deanmarano)). - ([@othiym23](https://github.com/othiym23)) -* [`d8eee6c`](https://github.com/npm/npm/commit/d8eee6cf9d2ff7aca68dfaed2de76824a3e0d9af) - `init-package-json@1.4.1`: Add support for a default author, and only add - scope to a package name once. ([@othiym23](https://github.com/othiym23)) -* [`4fc5d98`](https://github.com/npm/npm/commit/4fc5d98b785f601c60d4dc0a2c8674f0cccf6262) - `lru-cache@2.6.1`: Small tweaks to cache value aging and entry counting that - are irrelevant to npm. ([@isaacs](https://github.com/isaacs)) -* [`1fe5840`](https://github.com/npm/npm/commit/1fe584089f5bef133de5518aa26eaf6064be2bf7) - [#7946](https://github.com/npm/npm/issues/7946) Make `npm init` text - friendlier. ([@sandfox](https://github.com/sandfox)) - -### v2.8.3 (2015-04-15): - -#### TWO SMALL GIT TWEAKS - -This is the last of a set of releases intended to ensure npm's git support is -robust enough that we can stop working on it for a while. These fixes are -small, but prevent a common crasher and clear up one of the more confusing -error messages coming out of npm when working with repositories hosted on git. - -* [`387f889`](https://github.com/npm/npm/commit/387f889c0e8fb617d9cc9a42ed0a3ec49424ab5d) - [#7961](https://github.com/npm/npm/issues/7961) Ensure that hosted git SSH - URLs always have a valid protocol when stored in `resolved` fields in - `npm-shrinkwrap.json`. ([@othiym23](https://github.com/othiym23)) -* [`394c2f5`](https://github.com/npm/npm/commit/394c2f5a1227232c0baf42fbba1402aafe0d6ffb) - Switch the order in which hosted Git providers are checked to `git:`, - `git+https:`, then `git+ssh:` (from `git:`, `git+ssh:`, then `git+https:`) in - an effort to go from most to least likely to succeed, to make for less - confusing error message. ([@othiym23](https://github.com/othiym23)) - -### v2.8.2 (2015-04-14): - -#### PEACE IN OUR TIME - -npm has been having an issue with CouchDB's web server since the release -of io.js and Node.js 0.12.0 that has consumed a huge amount of my time -to little visible effect. Sam Mikes picked up the thread from me, and -after a [_lot_ of effort](https://github.com/npm/npm/issues/7699#issuecomment-93091111) -figured out that ultimately there are probably a couple problems with -the new HTTP Agent keep-alive handling in new versions of Node. In -addition, `npm-registry-client` was gratuitously sending a body along -with a GET request which was triggering the bugs. Sam removed about 10 bytes from -one file in `npm-registry-client`, and this problem, which has been bugging us for months, -completely went away. - -In conclusion, Sam Mikes is great, and anybody using a private registry -hosted on CouchDB should thank him for his hard work. Also, thanks to -the community at large for pitching in on this bug, which has been -around for months now. - -* [`431c3bf`](https://github.com/npm/npm/commit/431c3bf6cdec50f9f0c735f478cb2f3f337d3313) - [#7699](https://github.com/npm/npm/issues/7699) `npm-registry-client@6.3.2`: - Don't send body with HTTP GET requests when logging in. - ([@smikes](https://github.com/smikes)) - -### v2.8.1 (2015-04-12): - -#### CORRECTION: NPM'S GIT INTEGRATION IS DOING OKAY - -A [helpful bug report](https://github.com/npm/npm/issues/7872#issuecomment-91809553) -led to another round of changes to -[`hosted-git-info`](https://github.com/npm/hosted-git-info/commit/827163c74531b69985d1ede7abced4861e7b0cd4), -some additional test-writing, and a bunch of hands-on testing against actual -private repositories. While the complexity of npm's git dependency handling is -nearly fractal (because npm is very complex, and git is even more complex), -it's feeling way more solid than it has for a while. We think this is a -substantial improvement over what we had before, so give `npm@2.8.1` a shot if -you have particularly complex git use cases and -[let us know](https://github.com/npm/npm/issues/new) how it goes. - -(NOTE: These changes mostly affect cloning and saving references to packages -hosted in git repositories, and don't address some known issues with things -like lifecycle scripts not being run on npm dependencies. Work continues on -other issues that affect parity between git and npm registry packages.) - -* [`66377c6`](https://github.com/npm/npm/commit/66377c6ece2cf4d53d9a618b7d9824e1452bc293) - [#7872](https://github.com/npm/npm/issues/7872) `hosted-git-info@2.1.2`: Pass - through credentials embedded in SSH and HTTPs git URLs. - ([@othiym23](https://github.com/othiym23)) -* [`15efe12`](https://github.com/npm/npm/commit/15efe124753257728a0ddc64074fa5a4b9c2eb30) - [#7872](https://github.com/npm/npm/issues/7872) Use the new version of - `hosted-git-info` to pass along credentials embedded in git URLs. Test it. - Test it a lot. ([@othiym23](https://github.com/othiym23)) - -#### SCOPED DEPENDENCIES AND PEER DEPENDENCIES: NOT QUITE REESE'S - -Big thanks to [@ewie](https://github.com/ewie) for identifying an issue with -how npm was handling `peerDependencies` that were implicitly installed from the -`package.json` files of scoped dependencies. This -[will be a moot point](https://github.com/npm/npm/issues/6565#issuecomment-74971689) -with the release of `npm@3`, but until then, it's important that -`peerDependency` auto-installation work as expected. - -* [`b027319`](https://github.com/npm/npm/commit/b0273190c71eba14395ddfdd1d9f7ba625297523) - [#7920](https://github.com/npm/npm/issues/7920) Scoped packages with - `peerDependencies` were installing the `peerDependencies` into the wrong - directory. ([@ewie](https://github.com/ewie)) -* [`649e31a`](https://github.com/npm/npm/commit/649e31ae4fd02568bae5dc6b4ea783431ce3d63e) - [#7920](https://github.com/npm/npm/issues/7920) Test `peerDependency` - installs involving scoped packages using `npm-package-arg` instead of simple - path tests, for consistency. ([@othiym23](https://github.com/othiym23)) - -#### MAKING IT EASIER TO WRITE NPM TESTS, VERSION 0.0.1 - -[@iarna](https://github.com/iarna) and I -([@othiym23](https://github.com/othiym23)) have been discussing a -[candidate plan](https://github.com/npm/npm/wiki/rewriting-npm's-tests:-a-plan-maybe) -for improving npm's test suite, with the goal of making it easier for new -contributors to get involved with npm by reducing the learning curve -necessary to be able to write good tests for proposed changes. This is the -first substantial piece of that effort. Here's what the commit message for -[`ed7e249`](https://github.com/npm/npm/commit/ed7e249d50444312cd266942ce3b89e1ca049bdf) -had to say about this work: - -> It's too difficult for npm contributors to figure out what the conventional -> style is for tests. Part of the problem is that the documentation in -> CONTRIBUTING.md is inadequate, but another important factor is that the tests -> themselves are written in a variety of styles. One of the most notable -> examples of this is the fact that many tests use fixture directories to store -> precooked test scenarios and package.json files. -> -> This had some negative consequences: -> -> * tests weren't idempotent -> * subtle dependencies between tests existed -> * new tests get written in this deprecated style because it's not -> obvious that the style is out of favor -> * it's hard to figure out why a lot of those directories existed, -> because they served a variety of purposes, so it was difficult to -> tell when it was safe to remove them -> -> All in all, the fixture directories were a major source of technical debt, and -> cleaning them up, while time-consuming, makes the whole test suite much more -> approachable, and makes it more likely that new tests written by outside -> contributors will follow a conventional style. To support that, all of the -> tests touched by this changed were cleaned up to pass the `standard` style -> checker. - -And here's a little extra context from a comment I left on [#7929](https://github.com/npm/npm/issues/7929): - -> One of the other things that encouraged me was looking at this -> [presentation on technical debt](http://www.slideshare.net/nnja/pycon-2015-technical-debt-the-monster-in-your-closet) -> from Pycon 2015, especially slide 53, which I interpreted in terms of -> difficulty getting new contributors to submit patches to an OSS project like -> npm. npm has a long ways to go, but I feel good about this change. - -* [`ed7e249`](https://github.com/npm/npm/commit/ed7e249d50444312cd266942ce3b89e1ca049bdf) - [#7929](https://github.com/npm/npm/issues/7929) Eliminate fixture directories - from `test/tap`, leaving each test self-contained. - ([@othiym23](https://github.com/othiym23)) -* [`4928d30`](https://github.com/npm/npm/commit/4928d30140821c63e03fffed73f8d88ebdc43710) - [#7929](https://github.com/npm/npm/issues/7929) Move fixture files from - `test/tap/*` to `test/fixtures`. ([@othiym23](https://github.com/othiym23)) -* [`e925deb`](https://github.com/npm/npm/commit/e925debca91092a814c1a00933babc3a8cf975be) - [#7929](https://github.com/npm/npm/issues/7929) Tweak the run scripts to stop - slaughtering the CPU on doc rebuild. - ([@othiym23](https://github.com/othiym23)) -* [`65bf7cf`](https://github.com/npm/npm/commit/65bf7cffaf91c426b676c47529eee796f8b8b75c) - [#7923](https://github.com/npm/npm/issues/7923) Use an alias of scripts and - run-scripts in `npm run test-all` ([@watilde](https://github.com/watilde)) -* [`756a3fb`](https://github.com/npm/npm/commit/756a3fbb852a2469afe706635ed88d22c37743e5) - [#7923](https://github.com/npm/npm/issues/7923) Sync timeout time of `npm - run-script test-all` to be the same as `test` and `tap` scripts. - ([@watilde](https://github.com/watilde)) -* [`8299b5f`](https://github.com/npm/npm/commit/8299b5fb6373354a7fbaab6f333863758812ae90) - Set a timeout for tap tests for `npm run-script test-all`. - ([@othiym23](https://github.com/othiym23)) + Which results in this tree: -#### THE EVER-BEATING DRUM OF DEPENDENCY UPDATES - -* [`d90d0b9`](https://github.com/npm/npm/commit/d90d0b992acbf62fd5d68debf9d1dbd6cfa20804) - [#7924](https://github.com/npm/npm/issues/7924) Remove `child-process-close`, - as it was included for Node 0.6 compatibility, and npm no longer supports - 0.6. ([@robertkowalski](https://github.com/robertkowalski)) -* [`16427c1`](https://github.com/npm/npm/commit/16427c1f3ea3d71ee753c62eb4c2663c7b32b84f) - `lru-cache@2.5.2`: More accurate updating of expiry times when `maxAge` is - set. ([@isaacs](https://github.com/isaacs)) -* [`03cce83`](https://github.com/npm/npm/commit/03cce83b64344a9e0fe036dce214f4d68cfcc9e7) - `nock@1.6.0`: Mocked network error handling. - ([@pgte](https://github.com/pgte)) -* [`f93b1f0`](https://github.com/npm/npm/commit/f93b1f0b7eb5d1b8a7967e837bbd756db1091d00) - `glob@5.0.5`: Use `path-is-absolute` polyfill, allowing newer Node.js and - io.js versions to use `path.isAbsolute()`. - ([@sindresorhus](https://github.com/sindresorhus)) -* [`a70d694`](https://github.com/npm/npm/commit/a70d69495a6e96997e64855d9e749d943ee6d64f) - `request@2.55.0`: Bug fixes and simplification. - ([@simov](https://github.com/simov)) -* [`2aecc6f`](https://github.com/npm/npm/commit/2aecc6f4083526feeb14615b4e5484edc66175b5) - `columnify@1.5.1`: Switch to using babel from 6to5. - ([@timoxley](https://github.com/timoxley)) + ``` + fun-time + ├── need-fun@1 + └── need-time + ``` + + We're ignoring the version check on things specified in the shrinkwrap + so that you can override the version that will be installed. This is + because you may want to use a different version than is specified + by your dependencies' dependencies' `package.json` files. + + To fix this, we now only allow overrides of a dependency version when + that dependency is a child (in the tree) of the thing that requires it. + This means that when we're looking for `need-fun@2` we'll see `need-fun@1` + and reject it because, although it's from a shrinkwrap, it's parent is + `fun-time` and the package doing the requiring is `need-time`. -### v2.8.0 (2015-04-09): - -#### WE WILL NEVER BE DONE FIXING NPM'S GIT SUPPORT - -If you look at [the last release's release -notes](https://github.com/npm/npm/blob/master/CHANGELOG.md#git-mean-git-tuff-git-all-the-way-away-from-my-stuff), -you will note that they confidently assert that it's perfectly OK to force all -GitHub URLs through the same `git:` -> `git+ssh:` fallback flow for cloning. It -turns out that many users depend on `git+https:` URLs in their build -environments because they use GitHub auth tokens instead of SSH keys. Also, in -some cases you just want to be able to explicitly say how a given dependency -should be cloned from GitHub. - -Because of the way we resolved the inconsistency in GitHub shorthand handling -[before](https://github.com/npm/npm/blob/master/CHANGELOG.md#bug-fixes-1), this -turned out to be difficult to work around. So instead of hacking around it, we -completely redid how git is handled within npm and its attendant packages. -Again. This time, we changed things so that `normalize-package-data` and -`read-package-json` leave more of the git logic to npm itself, which makes -handling shorthand syntax consistently much easier, and also allows users to -resume using explicit, fully-qualified git URLs without npm messing with them. - -Here's a summary of what's changed: - -* Instead of converting the GitHub shorthand syntax to a `git+ssh:`, `git:`, or - `git+https:` URL and saving that, save the shorthand itself to - `package.json`. -* If presented with shortcuts, try cloning via the git protocol, SSH, and HTTPS - (in that order). -* No longer prompt for credentials -- it didn't work right with the spinner, - and wasn't guaranteed to work anyway. We may experiment with doing this a - better way in the future. Users can override this by setting `GIT_ASKPASS` in - their environment if they want to experiment with interactive cloning, but - should also set `--no-spin` on the npm command line (or run `npm config set - spin=false`). -* **EXPERIMENTAL FEATURE**: Add support for `github:`, `gist:`, `bitbucket:`, - and `gitlab:` shorthand prefixes. GitHub shortcuts will continue to be - normalized to `org/repo` instead of being saved as `github:org/repo`, but - `gitlab:`, `gist:`, and `bitbucket:` prefixes will be used on the command - line and from `package.json`. BE CAREFUL WITH THIS. `package.json` files - published with the new shorthand syntax can _only_ be read by `npm@2.8.0` and - later, and this feature is mostly meant for playing around with it. If you - want to save git dependencies in a form that older versions of npm can read, - use `--save-exact`, which will save the git URL and resolved commit hash of - the head of the branch in a manner similar to the way that `--save-exact` - pins versions for registry dependencies. This is documented (so check `npm - help install` for details), but we're not going to make a lot of noise about - it until it has a chance to bake in a little more. - -It is [@othiym23](https://github.com/othiym23)'s sincere hope that this will -resolve all of the inconsistencies users were seeing with GitHub and git-hosted -packages, but given the level of change here, that may just be a fond wish. -Extra testing of this change is requested. - -* [`6b0f588`](https://github.com/npm/npm/commit/6b0f58877f37df9904490ffbaaad33862bd36dce) - [#7867](https://github.com/npm/npm/issues/7867) Use git shorthand and git - URLs as presented by user. Support new `hosted-git-info` shortcut syntax. - Save shorthand in `package.json`. Try cloning via `git:`, `git+ssh:`, and - `git+https:`, in that order, when supported by the underlying hosting - provider. ([@othiym23](https://github.com/othiym23)) -* [`75d4267`](https://github.com/npm/npm/commit/75d426787869d54ca7400408f562f971b34649ef) - [#7867](https://github.com/npm/npm/issues/7867) Document new GitHub, GitHub - gist, Bitbucket, and GitLab shorthand syntax. - ([@othiym23](https://github.com/othiym23)) -* [`7d92c75`](https://github.com/npm/npm/commit/7d92c7592998d90ec883fa989ca74f04ec1b93de) - [#7867](https://github.com/npm/npm/issues/7867) When `--save-exact` is used - with git shorthand or URLs, save the fully-resolved URL, with branch name - resolved to the exact hash for the commit checked out. - ([@othiym23](https://github.com/othiym23)) -* [`9220e59`](https://github.com/npm/npm/commit/9220e59f8def8c82c6d331a39ba29ad4c44e3a9b) - [#7867](https://github.com/npm/npm/issues/7867) Ensure that non-prefixed and - non-normalized GitHub shortcuts are saved to `package.json`. - ([@othiym23](https://github.com/othiym23)) -* [`dd398e9`](https://github.com/npm/npm/commit/dd398e98a8eba27eeba84378200da3d078fdf980) - [#7867](https://github.com/npm/npm/issues/7867) `hosted-git-info@2.1.1`: - Ensure that `gist:` shorthand survives being round-tripped through - `package.json`. ([@othiym23](https://github.com/othiym23)) -* [`33d1420`](https://github.com/npm/npm/commit/33d1420bf2f629332fceb2ac7e174e63ac48f96a) - [#7867](https://github.com/npm/npm/issues/7867) `hosted-git-info@2.1.0`: Add - support for auth embedded directly in git URLs. - ([@othiym23](https://github.com/othiym23)) -* [`23a1d5a`](https://github.com/npm/npm/commit/23a1d5a540e8db27f5cd0245de7c3694e2bddad1) - [#7867](https://github.com/npm/npm/issues/7867) `hosted-git-info@2.0.2`: Make - it possible to determine in which form a hosted git URL was passed. - ([@iarna](https://github.com/iarna)) -* [`eaf75ac`](https://github.com/npm/npm/commit/eaf75acb718611ad5cfb360084ec86938d9c66c5) - [#7867](https://github.com/npm/npm/issues/7867) - `normalize-package-data@2.0.0`: Normalize GitHub specifiers so they pass - through shortcut syntax and preserve explicit URLs. - ([@iarna](https://github.com/iarna)) -* [`95e0535`](https://github.com/npm/npm/commit/95e0535e365e0aca49c634dd2061a0369b0475f1) - [#7867](https://github.com/npm/npm/issues/7867) `npm-package-arg@4.0.0`: Add - git URL and shortcut to hosted git spec and use `hosted-git-info@2.0.2`. ([@iarna](https://github.com/iarna)) -* [`a808926`](https://github.com/npm/npm/commit/a8089268d5f3d57f42dbaba02ff6437da5121191) - [#7867](https://github.com/npm/npm/issues/7867) - `realize-package-specifier@3.0.0`: Use `npm-package-arg@4.0.0` and test - shortcut specifier behavior. ([@iarna](https://github.com/iarna)) -* [`6dd1e03`](https://github.com/npm/npm/commit/6dd1e039bddf8cf5383343f91d84bc5d78acd083) - [#7867](https://github.com/npm/npm/issues/7867) `init-package-json@1.4.0`: - Allow dependency on `read-package-json@2.0.0`. + +#### STRING `package.bin` AND NON-NPMJS REGISTRIES + +* [`3de1463`](https://github.com/npm/npm/commit/3de1463) + [#9187](https://github.com/npm/npm/issues/9187) + If you were using a module with the `bin` field in your `package.json` set + to a string on a non-npmjs registry then npm would crash, due to the our + expectation that the `bin` field would be an object. We now pass all + `package.json` data through a routine that normalizes the format, + including the `bin` field. (This is the same routine that your + `package.json` is passed through when read off of disk or sent to the + registry for publication.) Doing this also ensures that older modules on + npm's own registry will be treated exactly the same as new ones. (In the + past we weren't always super careful about scrubbing `package.json` data + on publish. And even when we were, those rules have subtly changed over + time.) ([@iarna](https://github.com/iarna)) -* [`63254bb`](https://github.com/npm/npm/commit/63254bb6358f66752aca6aa1a275271b3ae03f7c) - [#7867](https://github.com/npm/npm/issues/7867) `read-installed@4.0.0`: Use - `read-package-json@2.0.0`. ([@iarna](https://github.com/iarna)) -* [`254b887`](https://github.com/npm/npm/commit/254b8871f5a173bb464cc5b0ace460c7878b8097) - [#7867](https://github.com/npm/npm/issues/7867) `read-package-json@2.0.0`: - Use `normalize-package-data@2.0.0`. ([@iarna](https://github.com/iarna)) -* [`0b9f8be`](https://github.com/npm/npm/commit/0b9f8be62fe5252abe54d49e36a696f4816c2eca) - [#7867](https://github.com/npm/npm/issues/7867) `npm-registry-client@6.3.0`: - Mark compatibility with `normalize-package-data@2.0.0` and - `npm-package-arg@4.0.0`. ([@iarna](https://github.com/iarna)) -* [`f40ecaa`](https://github.com/npm/npm/commit/f40ecaad68f77abc50eb6f5b224e31dec3d250fc) - [#7867](https://github.com/npm/npm/issues/7867) Extract a common method to - use when cloning git repos for testing. - ([@othiym23](https://github.com/othiym23)) -#### TEST FIXES FOR NODE 0.8 - -npm continues to [get closer](https://github.com/npm/npm/issues/7842) to being -completely green on Travis for Node 0.8. - -* [`26d36e9`](https://github.com/npm/npm/commit/26d36e9cf0eca69fe1863d2ea536c28555b9e8de) - [#7842](https://github.com/npm/npm/issues/7842) When spawning child - processes, map exit code 127 to ENOENT so Node 0.8 handles child process - failures the same as later versions. - ([@SonicHedgehog](https://github.com/SonicHedgehog)) -* [`54cd895`](https://github.com/npm/npm/commit/54cd8956ea783f96749e46597d8c2cb9397c5d5f) - [#7842](https://github.com/npm/npm/issues/7842) Node 0.8 requires -e with -p - when evaluating snippets; fix test. - ([@SonicHedgehog](https://github.com/SonicHedgehog)) - -#### SMALL FIX AND DOC TWEAK - -* [`20e9003`](https://github.com/npm/npm/commit/20e90031b847e9f7c7168f3dad8b1e526f9a2586) - `tar@2.0.1`: Fix regression where relative symbolic links within an - extraction root that pointed within an extraction root would get normalized - to absolute symbolic links. ([@isaacs](https://github.com/isaacs)) -* [`2ef8898`](https://github.com/npm/npm/commit/2ef88989c41bee1578570bb2172c90ede129dbd1) - [#7879](https://github.com/npm/npm/issues/7879) Better document that `npm - publish --tag=foo` will not set `latest` to that version. - ([@linclark](https://github.com/linclark)) - -### v2.7.6 (2015-04-02): - -#### GIT MEAN, GIT TUFF, GIT ALL THE WAY AWAY FROM MY STUFF - -Part of the reason that we're reluctant to take patches to how npm deals with -git dependencies is that every time we touch the git support, something breaks. -The last few releases are a case in point. `npm@2.7.4` completely broke -installing private modules from GitHub, and `npm@2.7.5` fixed them at the cost -of logging a misleading error message that caused many people to believe that -their dependencies hadn't been successfully installed when they actually had -been. - -This all started from a desire to ensure that GitHub shortcut syntax is being -handled correctly. The correct behavior is for npm to try to clone all -dependencies on GitHub (whether they're specified with the GitHub -`organization/repository` shortcut syntax or not) via the plain `git:` protocol -first, and to fall back to using `git+ssh:` if `git:` doesn't work. Previously, -sometimes npm would use `git:` and `git+ssh:` in some cases (most notably when -using GitHub shortcut syntax on the command line), and use `git+https:` in -others (when the GitHub shortcut syntax was present in `package.json`). This -led to subtle and hard-to-understand inconsistencies, and we're glad that as of -`npm@2.7.6`, we've finally gotten things to where they were before we started, -only slightly more consistent overall. - -We are now going to go back to our policy of being extremely reluctant to touch -the code that handles Git dependencies. - -* [`b747593`](https://github.com/npm/npm/commit/b7475936f473f029e6a027ba1b16277523747d0b) - [#7630](https://github.com/npm/npm/issues/7630) Don't automatically log all - git failures as errors. `maybeGithub` needs to be able to fail without - logging to support its fallback logic. - ([@othiym23](https://github.com/othiym23)) -* [`cd67a0d`](https://github.com/npm/npm/commit/cd67a0db07891d20871822696c26692c8a84866a) - [#7829](https://github.com/npm/npm/issues/7829) When fetching a git remote - URL, handle failures gracefully (without assuming standard output exists). - ([@othiym23](https://github.com/othiym23)) -* [`637c7d1`](https://github.com/npm/npm/commit/637c7d1411fe07f409cf91f2e65fd70685cb253c) - [#7829](https://github.com/npm/npm/issues/7829) When fetching a git remote - URL, handle failures gracefully (without assuming standard _error_ exists). - ([@othiym23](https://github.com/othiym23)) +### v3.3.10 (2015-10-22): -#### OTHER SIGNIFICANT FIXES +Hey you all! Welcome to a busy bug fix and PR week. We've got changes +to how `npm install` replaces dependencies during updates, improvements +to shrinkwrap behavior, and all sorts of doc updates. -* [`78005eb`](https://github.com/npm/npm/commit/78005ebb6f4103c20f077669c3929b7ea46a4c0d) - [#7743](https://github.com/npm/npm/issues/7743) Always quote arguments passed - to `npm run-script`. This allows build systems and the like to safely escape - glob patterns passed as arguments to `run-scripts` with `npm run-script - - - -
- -

npm-bin

Display npm bin folder

-

SYNOPSIS

-
npm.commands.bin(args, cb)
-

DESCRIPTION

-

Print the folder where npm will install executables.

-

This function should not be used programmatically. Instead, just refer -to the npm.bin property.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-bugs.html b/deps/npm/html/doc/api/npm-bugs.html deleted file mode 100644 index 787057361e1f7b..00000000000000 --- a/deps/npm/html/doc/api/npm-bugs.html +++ /dev/null @@ -1,37 +0,0 @@ - - - npm-bugs - - - - - - -
- -

npm-bugs

Bugs for a package in a web browser maybe

-

SYNOPSIS

-
npm.commands.bugs(package, callback)
-

DESCRIPTION

-

This command tries to guess at the likely location of a package's -bug tracker URL, and then tries to open it using the --browser -config param.

-

Like other commands, the first parameter is an array. This command only -uses the first element, which is expected to be a package name with an -optional version number.

-

This command will launch a browser, so this command may not be the most -friendly for programmatic use.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-cache.html b/deps/npm/html/doc/api/npm-cache.html deleted file mode 100644 index 95640498f86008..00000000000000 --- a/deps/npm/html/doc/api/npm-cache.html +++ /dev/null @@ -1,46 +0,0 @@ - - - npm-cache - - - - - - -
- -

npm-cache

manage the npm cache programmatically

-

SYNOPSIS

-
npm.commands.cache([args], callback)
-
-// helpers
-npm.commands.cache.clean([args], callback)
-npm.commands.cache.add([args], callback)
-npm.commands.cache.read(name, version, forceBypass, callback)
-

DESCRIPTION

-

This acts much the same ways as the npm-cache(1) command line -functionality.

-

The callback is called with the package.json data of the thing that is -eventually added to or read from the cache.

-

The top level npm.commands.cache(...) functionality is a public -interface, and like all commands on the npm.commands object, it will -match the command line behavior exactly.

-

However, the cache folder structure and the cache helper functions are -considered internal API surface, and as such, may change in future -releases of npm, potentially without warning or significant version -incrementation.

-

Use at your own risk.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-commands.html b/deps/npm/html/doc/api/npm-commands.html deleted file mode 100644 index 3b0dc843e25248..00000000000000 --- a/deps/npm/html/doc/api/npm-commands.html +++ /dev/null @@ -1,40 +0,0 @@ - - - npm-commands - - - - - - -
- -

npm-commands

npm commands

-

SYNOPSIS

-
npm.commands[<command>](args, callback)
-

DESCRIPTION

-

npm comes with a full set of commands, and each of the commands takes a -similar set of arguments.

-

In general, all commands on the command object take an array of positional -argument strings. The last argument to any function is a callback. Some -commands are special and take other optional arguments.

-

All commands have their own man page. See man npm-<command> for command-line -usage, or man 3 npm-<command> for programmatic usage.

-

SEE ALSO

- - -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-config.html b/deps/npm/html/doc/api/npm-config.html deleted file mode 100644 index e2f2519246c105..00000000000000 --- a/deps/npm/html/doc/api/npm-config.html +++ /dev/null @@ -1,61 +0,0 @@ - - - npm-config - - - - - - -
- -

npm-config

Manage the npm configuration files

-

SYNOPSIS

-
npm.commands.config(args, callback)
-var val = npm.config.get(key)
-npm.config.set(key, val)
-

DESCRIPTION

-

This function acts much the same way as the command-line version. The first -element in the array tells config what to do. Possible values are:

-
    -
  • set

    -

    Sets a config parameter. The second element in args is interpreted as the - key, and the third element is interpreted as the value.

    -
  • -
  • get

    -

    Gets the value of a config parameter. The second element in args is the - key to get the value of.

    -
  • -
  • delete (rm or del)

    -

    Deletes a parameter from the config. The second element in args is the - key to delete.

    -
  • -
  • list (ls)

    -

    Show all configs that aren't secret. No parameters necessary.

    -
  • -
  • edit:

    -

    Opens the config file in the default editor. This command isn't very useful - programmatically, but it is made available.

    -
  • -
-

To programmatically access npm configuration settings, or set them for -the duration of a program, use the npm.config.set and npm.config.get -functions instead.

-

SEE ALSO

- - -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-deprecate.html b/deps/npm/html/doc/api/npm-deprecate.html deleted file mode 100644 index 5f35253d0ca4e7..00000000000000 --- a/deps/npm/html/doc/api/npm-deprecate.html +++ /dev/null @@ -1,51 +0,0 @@ - - - npm-deprecate - - - - - - -
- -

npm-deprecate

Deprecate a version of a package

-

SYNOPSIS

-
npm.commands.deprecate(args, callback)
-

DESCRIPTION

-

This command will update the npm registry entry for a package, providing -a deprecation warning to all who attempt to install it.

-

The 'args' parameter must have exactly two elements:

-
    -
  • package[@version]

    -

    The version portion is optional, and may be either a range, or a - specific version, or a tag.

    -
  • -
  • message

    -

    The warning message that will be printed whenever a user attempts to - install the package.

    -
  • -
-

Note that you must be the package owner to deprecate something. See the -owner and adduser help topics.

-

To un-deprecate a package, specify an empty string ("") for the message argument.

-

SEE ALSO

- - -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-docs.html b/deps/npm/html/doc/api/npm-docs.html deleted file mode 100644 index 908533f162dffb..00000000000000 --- a/deps/npm/html/doc/api/npm-docs.html +++ /dev/null @@ -1,37 +0,0 @@ - - - npm-docs - - - - - - -
- -

npm-docs

Docs for a package in a web browser maybe

-

SYNOPSIS

-
npm.commands.docs(package, callback)
-

DESCRIPTION

-

This command tries to guess at the likely location of a package's -documentation URL, and then tries to open it using the --browser -config param.

-

Like other commands, the first parameter is an array. This command only -uses the first element, which is expected to be a package name with an -optional version number.

-

This command will launch a browser, so this command may not be the most -friendly for programmatic use.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-edit.html b/deps/npm/html/doc/api/npm-edit.html deleted file mode 100644 index 6acabac5542f00..00000000000000 --- a/deps/npm/html/doc/api/npm-edit.html +++ /dev/null @@ -1,40 +0,0 @@ - - - npm-edit - - - - - - -
- -

npm-edit

Edit an installed package

-

SYNOPSIS

-
npm.commands.edit(package, callback)
-

DESCRIPTION

-

Opens the package folder in the default editor (or whatever you've -configured as the npm editor config -- see npm help config.)

-

After it has been edited, the package is rebuilt so as to pick up any -changes in compiled packages.

-

For instance, you can do npm install connect to install connect -into your package, and then npm.commands.edit(["connect"], callback) -to make a few changes to your locally installed copy.

-

The first parameter is a string array with a single element, the package -to open. The package can optionally have a version number attached.

-

Since this command opens an editor in a new process, be careful about where -and how this is used.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-explore.html b/deps/npm/html/doc/api/npm-explore.html deleted file mode 100644 index 587ebfd0365c74..00000000000000 --- a/deps/npm/html/doc/api/npm-explore.html +++ /dev/null @@ -1,35 +0,0 @@ - - - npm-explore - - - - - - -
- -

npm-explore

Browse an installed package

-

SYNOPSIS

-
npm.commands.explore(args, callback)
-

DESCRIPTION

-

Spawn a subshell in the directory of the installed package specified.

-

If a command is specified, then it is run in the subshell, which then -immediately terminates.

-

Note that the package is not automatically rebuilt afterwards, so be -sure to use npm rebuild <pkg> if you make any changes.

-

The first element in the 'args' parameter must be a package name. After that is the optional command, which can be any number of strings. All of the strings will be combined into one, space-delimited command.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-help-search.html b/deps/npm/html/doc/api/npm-help-search.html deleted file mode 100644 index 0732f3f66f0cd2..00000000000000 --- a/deps/npm/html/doc/api/npm-help-search.html +++ /dev/null @@ -1,48 +0,0 @@ - - - npm-help-search - - - - - - -
- -

npm-help-search

Search the help pages

-

SYNOPSIS

-
npm.commands.helpSearch(args, [silent,] callback)
-

DESCRIPTION

-

This command is rarely useful, but it exists in the rare case that it is.

-

This command takes an array of search terms and returns the help pages that -match in order of best match.

-

If there is only one match, then npm displays that help section. If there -are multiple results, the results are printed to the screen formatted and the -array of results is returned. Each result is an object with these properties:

-
    -
  • hits: -A map of args to number of hits on that arg. For example, {"npm": 3}
  • -
  • found: -Total number of unique args that matched.
  • -
  • totalHits: -Total number of hits.
  • -
  • lines: -An array of all matching lines (and some adjacent lines).
  • -
  • file: -Name of the file that matched
  • -
-

The silent parameter is not necessary not used, but it may in the future.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-init.html b/deps/npm/html/doc/api/npm-init.html deleted file mode 100644 index 6beeaf6e2b71d3..00000000000000 --- a/deps/npm/html/doc/api/npm-init.html +++ /dev/null @@ -1,43 +0,0 @@ - - - npm-init - - - - - - -
- -

npm init

Interactively create a package.json file

-

SYNOPSIS

-
npm.commands.init(args, callback)
-

DESCRIPTION

-

This will ask you a bunch of questions, and then write a package.json for you.

-

It attempts to make reasonable guesses about what you want things to be set to, -and then writes a package.json file with the options you've selected.

-

If you already have a package.json file, it'll read that first, and default to -the options in there.

-

It is strictly additive, so it does not delete options from your package.json -without a really good reason to do so.

-

Since this function expects to be run on the command-line, it doesn't work very -well as a programmatically. The best option is to roll your own, and since -JavaScript makes it stupid simple to output formatted JSON, that is the -preferred method. If you're sure you want to handle command-line prompting, -then go ahead and use this programmatically.

-

SEE ALSO

-

package.json(5)

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-install.html b/deps/npm/html/doc/api/npm-install.html deleted file mode 100644 index e697b8176f9b92..00000000000000 --- a/deps/npm/html/doc/api/npm-install.html +++ /dev/null @@ -1,36 +0,0 @@ - - - npm-install - - - - - - -
- -

npm-install

install a package programmatically

-

SYNOPSIS

-
npm.commands.install([where,] packages, callback)
-

DESCRIPTION

-

This acts much the same ways as installing on the command-line.

-

The 'where' parameter is optional and only used internally, and it specifies -where the packages should be installed to.

-

The 'packages' parameter is an array of strings. Each element in the array is -the name of a package to be installed.

-

Finally, 'callback' is a function that will be called when all packages have been -installed or when an error has been encountered.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-link.html b/deps/npm/html/doc/api/npm-link.html deleted file mode 100644 index 4137329992f801..00000000000000 --- a/deps/npm/html/doc/api/npm-link.html +++ /dev/null @@ -1,46 +0,0 @@ - - - npm-link - - - - - - -
- -

npm-link

Symlink a package folder

-

SYNOPSIS

-
npm.commands.link(callback)
-npm.commands.link(packages, callback)
-

DESCRIPTION

-

Package linking is a two-step process.

-

Without parameters, link will create a globally-installed -symbolic link from prefix/package-name to the current folder.

-

With a parameters, link will create a symlink from the local node_modules -folder to the global symlink.

-

When creating tarballs for npm publish, the linked packages are -"snapshotted" to their current state by resolving the symbolic links.

-

This is -handy for installing your own stuff, so that you can work on it and test it -iteratively without having to continually rebuild.

-

For example:

-
npm.commands.link(cb)           # creates global link from the cwd
-                                # (say redis package)
-npm.commands.link('redis', cb)  # link-install the package
-

Now, any changes to the redis package will be reflected in -the package in the current working directory

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-load.html b/deps/npm/html/doc/api/npm-load.html deleted file mode 100644 index 2af4720ac40b39..00000000000000 --- a/deps/npm/html/doc/api/npm-load.html +++ /dev/null @@ -1,41 +0,0 @@ - - - npm-load - - - - - - -
- -

npm-load

Load config settings

-

SYNOPSIS

-
npm.load(conf, cb)
-

DESCRIPTION

-

npm.load() must be called before any other function call. Both parameters are -optional, but the second is recommended.

-

The first parameter is an object containing command-line config params, and the -second parameter is a callback that will be called when npm is loaded and ready -to serve.

-

The first parameter should follow a similar structure as the package.json -config object.

-

For example, to emulate the --dev flag, pass an object that looks like this:

-
{
-  "dev": true
-}
-

For a list of all the available command-line configs, see npm help config

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-ls.html b/deps/npm/html/doc/api/npm-ls.html deleted file mode 100644 index b0d31e2515fc8b..00000000000000 --- a/deps/npm/html/doc/api/npm-ls.html +++ /dev/null @@ -1,67 +0,0 @@ - - - npm-ls - - - - - - -
- -

npm-ls

List installed packages

-

SYNOPSIS

-
npm.commands.ls(args, [silent,] callback)
-

DESCRIPTION

-

This command will print to stdout all the versions of packages that are -installed, as well as their dependencies, in a tree-structure. It will also -return that data using the callback.

-

This command does not take any arguments, but args must be defined. -Beyond that, if any arguments are passed in, npm will politely warn that it -does not take positional arguments, though you may set config flags -like with any other command, such as global to list global packages.

-

It will print out extraneous, missing, and invalid packages.

-

If the silent parameter is set to true, nothing will be output to the screen, -but the data will still be returned.

-

Callback is provided an error if one occurred, the full data about which -packages are installed and which dependencies they will receive, and a -"lite" data object which just shows which versions are installed where. -Note that the full data object is a circular structure, so care must be -taken if it is serialized to JSON.

-

CONFIGURATION

-

long

-
    -
  • Default: false
  • -
  • Type: Boolean
  • -
-

Show extended information.

-

parseable

-
    -
  • Default: false
  • -
  • Type: Boolean
  • -
-

Show parseable output instead of tree view.

-

global

-
    -
  • Default: false
  • -
  • Type: Boolean
  • -
-

List packages in the global install prefix instead of in the current -project.

-

Note, if parseable is set or long isn't set, then duplicates will be trimmed. -This means that if a submodule has the same dependency as a parent module, then the -dependency will only be output once.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-outdated.html b/deps/npm/html/doc/api/npm-outdated.html deleted file mode 100644 index 5c564a6eea8188..00000000000000 --- a/deps/npm/html/doc/api/npm-outdated.html +++ /dev/null @@ -1,32 +0,0 @@ - - - npm-outdated - - - - - - -
- -

npm-outdated

Check for outdated packages

-

SYNOPSIS

-
npm.commands.outdated([packages,] callback)
-

DESCRIPTION

-

This command will check the registry to see if the specified packages are -currently outdated.

-

If the 'packages' parameter is left out, npm will check all packages.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-owner.html b/deps/npm/html/doc/api/npm-owner.html deleted file mode 100644 index 32c0e6feac02f4..00000000000000 --- a/deps/npm/html/doc/api/npm-owner.html +++ /dev/null @@ -1,51 +0,0 @@ - - - npm-owner - - - - - - -
- -

npm-owner

Manage package owners

-

SYNOPSIS

-
npm.commands.owner(args, callback)
-

DESCRIPTION

-

The first element of the 'args' parameter defines what to do, and the subsequent -elements depend on the action. Possible values for the action are (order of -parameters are given in parenthesis):

-
    -
  • ls (package): -List all the users who have access to modify a package and push new versions. -Handy when you need to know who to bug for help.
  • -
  • add (user, package): -Add a new user as a maintainer of a package. This user is enabled to modify -metadata, publish new versions, and add other owners.
  • -
  • rm (user, package): -Remove a user from the package owner list. This immediately revokes their -privileges.
  • -
-

Note that there is only one level of access. Either you can modify a package, -or you can't. Future versions may contain more fine-grained access levels, but -that is not implemented at this time.

-

SEE ALSO

- - -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-pack.html b/deps/npm/html/doc/api/npm-pack.html deleted file mode 100644 index da0a19993cbb30..00000000000000 --- a/deps/npm/html/doc/api/npm-pack.html +++ /dev/null @@ -1,37 +0,0 @@ - - - npm-pack - - - - - - -
- -

npm-pack

Create a tarball from a package

-

SYNOPSIS

-
npm.commands.pack([packages,] callback)
-

DESCRIPTION

-

For anything that's installable (that is, a package folder, tarball, -tarball url, name@tag, name@version, or name), this command will fetch -it to the cache, and then copy the tarball to the current working -directory as <name>-<version>.tgz, and then write the filenames out to -stdout.

-

If the same package is specified multiple times, then the file will be -overwritten the second time.

-

If no arguments are supplied, then npm packs the current package folder.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-ping.html b/deps/npm/html/doc/api/npm-ping.html deleted file mode 100644 index b768c73d4538c5..00000000000000 --- a/deps/npm/html/doc/api/npm-ping.html +++ /dev/null @@ -1,32 +0,0 @@ - - - npm-ping - - - - - - -
- -

npm-ping

Ping npm registry

-

SYNOPSIS

-
npm.registry.ping(registry, options, function (er, pong))
-

DESCRIPTION

-

Attempts to connect to the given registry, returning a pong -object with various metadata if it succeeds.

-

This function is primarily useful for debugging connection issues -to npm registries.

- -
- - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-prefix.html b/deps/npm/html/doc/api/npm-prefix.html deleted file mode 100644 index 6f9dcff7917a4e..00000000000000 --- a/deps/npm/html/doc/api/npm-prefix.html +++ /dev/null @@ -1,33 +0,0 @@ - - - npm-prefix - - - - - - -
- -

npm-prefix

Display prefix

-

SYNOPSIS

-
npm.commands.prefix(args, callback)
-

DESCRIPTION

-

Print the prefix to standard out.

-

'args' is never used and callback is never called with data. -'args' must be present or things will break.

-

This function is not useful programmatically

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-prune.html b/deps/npm/html/doc/api/npm-prune.html deleted file mode 100644 index 44f67558217df0..00000000000000 --- a/deps/npm/html/doc/api/npm-prune.html +++ /dev/null @@ -1,34 +0,0 @@ - - - npm-prune - - - - - - -
- -

npm-prune

Remove extraneous packages

-

SYNOPSIS

-
npm.commands.prune([packages,] callback)
-

DESCRIPTION

-

This command removes "extraneous" packages.

-

The first parameter is optional, and it specifies packages to be removed.

-

No packages are specified, then all packages will be checked.

-

Extraneous packages are packages that are not listed on the parent -package's dependencies list.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-publish.html b/deps/npm/html/doc/api/npm-publish.html deleted file mode 100644 index 9aec5e56509bb5..00000000000000 --- a/deps/npm/html/doc/api/npm-publish.html +++ /dev/null @@ -1,50 +0,0 @@ - - - npm-publish - - - - - - -
- -

npm-publish

Publish a package

-

SYNOPSIS

-
npm.commands.publish([packages,] callback)
-

DESCRIPTION

-

Publishes a package to the registry so that it can be installed by name. -Possible values in the 'packages' array are:

-
    -
  • <folder>: -A folder containing a package.json file

    -
  • -
  • <tarball>: -A url or file path to a gzipped tar archive containing a single folder -with a package.json file inside.

    -
  • -
-

If the package array is empty, npm will try to publish something in the -current working directory.

-

This command could fails if one of the packages specified already exists in -the registry. Overwrites when the "force" environment variable is set.

-

SEE ALSO

- - -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-rebuild.html b/deps/npm/html/doc/api/npm-rebuild.html deleted file mode 100644 index f65c948f25b689..00000000000000 --- a/deps/npm/html/doc/api/npm-rebuild.html +++ /dev/null @@ -1,34 +0,0 @@ - - - npm-rebuild - - - - - - -
- -

npm-rebuild

Rebuild a package

-

SYNOPSIS

-
npm.commands.rebuild([packages,] callback)
-

DESCRIPTION

-

This command runs the npm build command on each of the matched packages. This is useful -when you install a new version of node, and must recompile all your C++ addons with -the new binary. If no 'packages' parameter is specify, every package will be rebuilt.

-

CONFIGURATION

-

See npm help build

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-repo.html b/deps/npm/html/doc/api/npm-repo.html deleted file mode 100644 index c0f95fa2c6d181..00000000000000 --- a/deps/npm/html/doc/api/npm-repo.html +++ /dev/null @@ -1,37 +0,0 @@ - - - npm-repo - - - - - - -
- -

npm-repo

Open package repository page in the browser

-

SYNOPSIS

-
npm.commands.repo(package, callback)
-

DESCRIPTION

-

This command tries to guess at the likely location of a package's -repository URL, and then tries to open it using the --browser -config param.

-

Like other commands, the first parameter is an array. This command only -uses the first element, which is expected to be a package name with an -optional version number.

-

This command will launch a browser, so this command may not be the most -friendly for programmatic use.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-restart.html b/deps/npm/html/doc/api/npm-restart.html deleted file mode 100644 index 7390b50d270187..00000000000000 --- a/deps/npm/html/doc/api/npm-restart.html +++ /dev/null @@ -1,56 +0,0 @@ - - - npm-restart - - - - - - -
- -

npm-restart

Restart a package

-

SYNOPSIS

-
npm.commands.restart(packages, callback)
-

DESCRIPTION

-

This restarts a package (or multiple packages).

-

This runs a package's "stop", "restart", and "start" scripts, and associated -pre- and post- scripts, in the order given below:

-
    -
  1. prerestart
  2. -
  3. prestop
  4. -
  5. stop
  6. -
  7. poststop
  8. -
  9. restart
  10. -
  11. prestart
  12. -
  13. start
  14. -
  15. poststart
  16. -
  17. postrestart
  18. -
-

If no version is specified, then it restarts the "active" version.

-

npm can restart multiple packages. Just specify multiple packages in -the packages parameter.

-

NOTE

-

Note that the "restart" script is run in addition to the "stop" -and "start" scripts, not instead of them.

-

This is the behavior as of npm major version 2. A change in this -behavior will be accompanied by an increase in major version number

-

SEE ALSO

- - -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-root.html b/deps/npm/html/doc/api/npm-root.html deleted file mode 100644 index 706518ad20e9ba..00000000000000 --- a/deps/npm/html/doc/api/npm-root.html +++ /dev/null @@ -1,33 +0,0 @@ - - - npm-root - - - - - - -
- -

npm-root

Display npm root

-

SYNOPSIS

-
npm.commands.root(args, callback)
-

DESCRIPTION

-

Print the effective node_modules folder to standard out.

-

'args' is never used and callback is never called with data. -'args' must be present or things will break.

-

This function is not useful programmatically.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-run-script.html b/deps/npm/html/doc/api/npm-run-script.html deleted file mode 100644 index 196ea26143afa0..00000000000000 --- a/deps/npm/html/doc/api/npm-run-script.html +++ /dev/null @@ -1,45 +0,0 @@ - - - npm-run-script - - - - - - -
- -

npm-run-script

Run arbitrary package scripts

-

SYNOPSIS

-
npm.commands.run-script(args, callback)
-

DESCRIPTION

-

This runs an arbitrary command from a package's "scripts" object.

-

It is used by the test, start, restart, and stop commands, but can be -called directly, as well.

-

The 'args' parameter is an array of strings. Behavior depends on the number -of elements. If there is only one element, npm assumes that the element -represents a command to be run on the local repository. If there is more than -one element, then the first is assumed to be the package and the second is -assumed to be the command to run. All other elements are ignored.

-

SEE ALSO

- - -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-search.html b/deps/npm/html/doc/api/npm-search.html deleted file mode 100644 index 3c83b1a6c22bee..00000000000000 --- a/deps/npm/html/doc/api/npm-search.html +++ /dev/null @@ -1,57 +0,0 @@ - - - npm-search - - - - - - -
- -

npm-search

Search for packages

-

SYNOPSIS

-
npm.commands.search(searchTerms, [silent,] [staleness,] callback)
-

DESCRIPTION

-

Search the registry for packages matching the search terms. The available parameters are:

-
    -
  • searchTerms: -Array of search terms. These terms are case-insensitive.
  • -
  • silent: -If true, npm will not log anything to the console.
  • -
  • staleness: -This is the threshold for stale packages. "Fresh" packages are not refreshed -from the registry. This value is measured in seconds.
  • -
  • callback: -Returns an object where each key is the name of a package, and the value -is information about that package along with a 'words' property, which is -a space-delimited string of all of the interesting words in that package. -The only properties included are those that are searched, which generally include:

    -
      -
    • name
    • -
    • description
    • -
    • maintainers
    • -
    • url
    • -
    • keywords
    • -
    -
  • -
-

A search on the registry excludes any result that does not match all of the -search terms. It also removes any items from the results that contain an -excluded term (the "searchexclude" config). The search is case insensitive -and doesn't try to read your mind (it doesn't do any verb tense matching or the -like).

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-shrinkwrap.html b/deps/npm/html/doc/api/npm-shrinkwrap.html deleted file mode 100644 index f9c37187ac2425..00000000000000 --- a/deps/npm/html/doc/api/npm-shrinkwrap.html +++ /dev/null @@ -1,37 +0,0 @@ - - - npm-shrinkwrap - - - - - - -
- -

npm-shrinkwrap

programmatically generate package shrinkwrap file

-

SYNOPSIS

-
npm.commands.shrinkwrap(args, [silent,] callback)
-

DESCRIPTION

-

This acts much the same ways as shrinkwrapping on the command-line.

-

This command does not take any arguments, but 'args' must be defined. -Beyond that, if any arguments are passed in, npm will politely warn that it -does not take positional arguments.

-

If the 'silent' parameter is set to true, nothing will be output to the screen, -but the shrinkwrap file will still be written.

-

Finally, 'callback' is a function that will be called when the shrinkwrap has -been saved.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-start.html b/deps/npm/html/doc/api/npm-start.html deleted file mode 100644 index 2e02140363285e..00000000000000 --- a/deps/npm/html/doc/api/npm-start.html +++ /dev/null @@ -1,32 +0,0 @@ - - - npm-start - - - - - - -
- -

npm-start

Start a package

-

SYNOPSIS

-
npm.commands.start(packages, callback)
-

DESCRIPTION

-

This runs a package's "start" script, if one was provided.

-

npm can start multiple packages. Just specify multiple packages in the -packages parameter.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-stop.html b/deps/npm/html/doc/api/npm-stop.html deleted file mode 100644 index 7a83de6a08c001..00000000000000 --- a/deps/npm/html/doc/api/npm-stop.html +++ /dev/null @@ -1,32 +0,0 @@ - - - npm-stop - - - - - - -
- -

npm-stop

Stop a package

-

SYNOPSIS

-
npm.commands.stop(packages, callback)
-

DESCRIPTION

-

This runs a package's "stop" script, if one was provided.

-

npm can run stop on multiple packages. Just specify multiple packages -in the packages parameter.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-tag.html b/deps/npm/html/doc/api/npm-tag.html deleted file mode 100644 index 6569e063275d6d..00000000000000 --- a/deps/npm/html/doc/api/npm-tag.html +++ /dev/null @@ -1,40 +0,0 @@ - - - npm-tag - - - - - - -
- -

npm-tag

Tag a published version

-

SYNOPSIS

-
npm.commands.tag(package@version, tag, callback)
-

DESCRIPTION

-

Tags the specified version of the package with the specified tag, or the ---tag config if not specified.

-

The 'package@version' is an array of strings, but only the first two elements are -currently used.

-

The first element must be in the form package@version, where package -is the package name and version is the version number (much like installing a -specific version).

-

The second element is the name of the tag to tag this version with. If this -parameter is missing or falsey (empty), the default from the config will be -used. For more information about how to set this config, check -man 3 npm-config for programmatic usage or man npm-config for cli usage.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-test.html b/deps/npm/html/doc/api/npm-test.html deleted file mode 100644 index c556185e38f3bb..00000000000000 --- a/deps/npm/html/doc/api/npm-test.html +++ /dev/null @@ -1,34 +0,0 @@ - - - npm-test - - - - - - -
- -

npm-test

Test a package

-

SYNOPSIS

-
  npm.commands.test(packages, callback)
-

DESCRIPTION

-

This runs a package's "test" script, if one was provided.

-

To run tests as a condition of installation, set the npat config to -true.

-

npm can run tests on multiple packages. Just specify multiple packages -in the packages parameter.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-uninstall.html b/deps/npm/html/doc/api/npm-uninstall.html deleted file mode 100644 index 33c7016ee7fe7d..00000000000000 --- a/deps/npm/html/doc/api/npm-uninstall.html +++ /dev/null @@ -1,34 +0,0 @@ - - - npm-uninstall - - - - - - -
- -

npm-uninstall

uninstall a package programmatically

-

SYNOPSIS

-
npm.commands.uninstall(packages, callback)
-

DESCRIPTION

-

This acts much the same ways as uninstalling on the command-line.

-

The 'packages' parameter is an array of strings. Each element in the array is -the name of a package to be uninstalled.

-

Finally, 'callback' is a function that will be called when all packages have been -uninstalled or when an error has been encountered.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-unpublish.html b/deps/npm/html/doc/api/npm-unpublish.html deleted file mode 100644 index 03e4d93ee8ea17..00000000000000 --- a/deps/npm/html/doc/api/npm-unpublish.html +++ /dev/null @@ -1,37 +0,0 @@ - - - npm-unpublish - - - - - - -
- -

npm-unpublish

Remove a package from the registry

-

SYNOPSIS

-
npm.commands.unpublish(package, callback)
-

DESCRIPTION

-

This removes a package version from the registry, deleting its -entry and removing the tarball.

-

The package parameter must be defined.

-

Only the first element in the package parameter is used. If there is no first -element, then npm assumes that the package at the current working directory -is what is meant.

-

If no version is specified, or if all versions are removed then -the root package entry is removed from the registry entirely.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-update.html b/deps/npm/html/doc/api/npm-update.html deleted file mode 100644 index fc42422829be8b..00000000000000 --- a/deps/npm/html/doc/api/npm-update.html +++ /dev/null @@ -1,37 +0,0 @@ - - - npm-update - - - - - - -
- -

npm-update

Update a package

-

SYNOPSIS

-
npm.commands.update(packages, callback)
-

DESCRIPTION

-

Updates a package, upgrading it to the latest version. It also installs any -missing packages.

-

The packages argument is an array of packages to update. The callback -parameter will be called when done or when an error occurs.

-

SEE ALSO

- - -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-version.html b/deps/npm/html/doc/api/npm-version.html deleted file mode 100644 index d584335baed1fe..00000000000000 --- a/deps/npm/html/doc/api/npm-version.html +++ /dev/null @@ -1,36 +0,0 @@ - - - npm-version - - - - - - -
- -

npm-version

Bump a package version

-

SYNOPSIS

-
npm.commands.version(newversion, callback)
-

DESCRIPTION

-

Run this in a package directory to bump the version and write the new -data back to the package.json file.

-

If run in a git repo, it will also create a version commit and tag, and -fail if the repo is not clean.

-

Like all other commands, this function takes a string array as its first -parameter. The difference, however, is this function will fail if it does -not have exactly one element. The only element should be a version number.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-view.html b/deps/npm/html/doc/api/npm-view.html deleted file mode 100644 index 110f222c02ad60..00000000000000 --- a/deps/npm/html/doc/api/npm-view.html +++ /dev/null @@ -1,85 +0,0 @@ - - - npm-view - - - - - - -
- -

npm-view

View registry info

-

SYNOPSIS

-
npm.commands.view(args, [silent,] callback)
-

DESCRIPTION

-

This command shows data about a package and prints it to the stream -referenced by the outfd config, which defaults to stdout.

-

The "args" parameter is an ordered list that closely resembles the command-line -usage. The elements should be ordered such that the first element is -the package and version (package@version). The version is optional. After that, -the rest of the parameters are fields with optional subfields ("field.subfield") -which can be used to get only the information desired from the registry.

-

The callback will be passed all of the data returned by the query.

-

For example, to get the package registry entry for the connect package, -you can do this:

-
npm.commands.view(["connect"], callback)
-

If no version is specified, "latest" is assumed.

-

Field names can be specified after the package descriptor. -For example, to show the dependencies of the ronn package at version -0.3.5, you could do the following:

-
npm.commands.view(["ronn@0.3.5", "dependencies"], callback)
-

You can view child field by separating them with a period. -To view the git repository URL for the latest version of npm, you could -do this:

-
npm.commands.view(["npm", "repository.url"], callback)
-

For fields that are arrays, requesting a non-numeric field will return -all of the values from the objects in the list. For example, to get all -the contributor names for the "express" project, you can do this:

-
npm.commands.view(["express", "contributors.email"], callback)
-

You may also use numeric indices in square braces to specifically select -an item in an array field. To just get the email address of the first -contributor in the list, you can do this:

-
npm.commands.view(["express", "contributors[0].email"], callback)
-

Multiple fields may be specified, and will be printed one after another. -For exampls, to get all the contributor names and email addresses, you -can do this:

-
npm.commands.view(["express", "contributors.name", "contributors.email"], callback)
-

"Person" fields are shown as a string if they would be shown as an -object. So, for example, this will show the list of npm contributors in -the shortened string format. (See npm help json for more on this.)

-
npm.commands.view(["npm", "contributors"], callback)
-

If a version range is provided, then data will be printed for every -matching version of the package. This will show which version of jsdom -was required by each matching version of yui3:

-
npm.commands.view(["yui3@>0.5.4", "dependencies.jsdom"], callback)
-

OUTPUT

-

If only a single string field for a single version is output, then it -will not be colorized or quoted, so as to enable piping the output to -another command.

-

If the version range matches multiple versions, than each printed value -will be prefixed with the version it applies to.

-

If multiple fields are requested, than each of them are prefixed with -the field name.

-

Console output can be disabled by setting the 'silent' parameter to true.

-

RETURN VALUE

-

The data returned will be an object in this formation:

-
{ <version>:
-  { <field>: <value>
-  , ... }
-, ... }
-

corresponding to the list of fields selected.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-whoami.html b/deps/npm/html/doc/api/npm-whoami.html deleted file mode 100644 index 30cd99f8a9a52e..00000000000000 --- a/deps/npm/html/doc/api/npm-whoami.html +++ /dev/null @@ -1,33 +0,0 @@ - - - npm-whoami - - - - - - -
- -

npm-whoami

Display npm username

-

SYNOPSIS

-
npm.commands.whoami(args, callback)
-

DESCRIPTION

-

Print the username config to standard output.

-

'args' is never used and callback is never called with data. -'args' must be present or things will break.

-

This function is not useful programmatically

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm.html b/deps/npm/html/doc/api/npm.html deleted file mode 100644 index b1e961cb88605f..00000000000000 --- a/deps/npm/html/doc/api/npm.html +++ /dev/null @@ -1,113 +0,0 @@ - - - npm - - - - - - -
- -

npm

javascript package manager

-

SYNOPSIS

-
var npm = require("npm")
-npm.load([configObject, ]function (er, npm) {
-  // use the npm object, now that it's loaded.
-
-  npm.config.set(key, val)
-  val = npm.config.get(key)
-
-  console.log("prefix = %s", npm.prefix)
-
-  npm.commands.install(["package"], cb)
-})
-

VERSION

-

2.14.7

-

DESCRIPTION

-

This is the API documentation for npm. -To find documentation of the command line -client, see npm(1).

-

Prior to using npm's commands, npm.load() must be called. If you provide -configObject as an object map of top-level configs, they override the values -stored in the various config locations. In the npm command line client, this -set of configs is parsed from the command line options. Additional -configuration params are loaded from two configuration files. See -npm-config(1), npm-config(7), and npmrc(5) for more information.

-

After that, each of the functions are accessible in the -commands object: npm.commands.<cmd>. See npm-index(7) for a list of -all possible commands.

-

All commands on the command object take an array of positional argument -strings. The last argument to any function is a callback. Some -commands take other optional arguments.

-

Configs cannot currently be set on a per function basis, as each call to -npm.config.set will change the value for all npm commands in that process.

-

To find API documentation for a specific command, run the npm apihelp -command.

-

METHODS AND PROPERTIES

-
    -
  • npm.load(configs, cb)

    -

    Load the configuration params, and call the cb function once the - globalconfig and userconfig files have been loaded as well, or on - nextTick if they've already been loaded.

    -
  • -
  • npm.config

    -

    An object for accessing npm configuration parameters.

    -
      -
    • npm.config.get(key)
    • -
    • npm.config.set(key, val)
    • -
    • npm.config.del(key)
    • -
    -
  • -
  • npm.dir or npm.root

    -

    The node_modules directory where npm will operate.

    -
  • -
  • npm.prefix

    -

    The prefix where npm is operating. (Most often the current working - directory.)

    -
  • -
  • npm.cache

    -

    The place where npm keeps JSON and tarballs it fetches from the - registry (or uploads to the registry).

    -
  • -
  • npm.tmp

    -

    npm's temporary working directory.

    -
  • -
  • npm.deref

    -

    Get the "real" name for a command that has either an alias or - abbreviation.

    -
  • -
-

MAGIC

-

For each of the methods in the npm.commands object, a method is added to the -npm object, which takes a set of positional string arguments rather than an -array and a callback.

-

If the last argument is a callback, then it will use the supplied -callback. However, if no callback is provided, then it will print out -the error or results.

-

For example, this would work in a node repl:

-
> npm = require("npm")
-> npm.load()  // wait a sec...
-> npm.install("dnode", "express")
-

Note that that won't work in a node program, since the install -method will get called before the configuration load is completed.

-

ABBREVS

-

In order to support npm ins foo instead of npm install foo, the -npm.commands object has a set of abbreviations as well as the full -method names. Use the npm.deref method to find the real name.

-

For example:

-
var cmd = npm.deref("unp") // cmd === "unpublish"
-
-
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/cli/npm-access.html b/deps/npm/html/doc/cli/npm-access.html index 761aea5e5250ab..9344c58dbbc245 100644 --- a/deps/npm/html/doc/cli/npm-access.html +++ b/deps/npm/html/doc/cli/npm-access.html @@ -84,5 +84,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-adduser.html b/deps/npm/html/doc/cli/npm-adduser.html index a331bfbbf543c4..44fbcecee5510c 100644 --- a/deps/npm/html/doc/cli/npm-adduser.html +++ b/deps/npm/html/doc/cli/npm-adduser.html @@ -12,6 +12,8 @@

npm-adduser

Add a registry user account

SYNOPSIS

npm adduser [--registry=url] [--scope=@orgname] [--always-auth]
+
+aliases: login, add-user
 

DESCRIPTION

Create or verify a user named <username> in the specified registry, and save the credentials to the .npmrc file. If no registry is specified, @@ -26,7 +28,7 @@

SYNOPSIS

npm login is an alias to adduser and behaves exactly the same way.

CONFIGURATION

registry

-

Default: http://registry.npmjs.org/

+

Default: https://registry.npmjs.org/

The base URL of the npm package registry. If scope is also specified, this registry will only be used for packages with that scope. See npm-scope(7).

scope

@@ -44,9 +46,11 @@

always-auth

registries. Can be used with --registry and / or --scope, e.g.

npm adduser --registry=http://private-registry.example.com --always-auth
 

This will ensure that all requests to that registry (including for tarballs) -include an authorization header. See always-auth in npm-config(7) for more -details on always-auth. Registry-specific configuration of always-auth takes -precedence over any global configuration.

+include an authorization header. This setting may be necessary for use with +private registries where metadata and package tarballs are stored on hosts with +different hostnames. See always-auth in npm-config(7) for more details on +always-auth. Registry-specific configuration of always-auth takes precedence +over any global configuration.

SEE ALSO

  • npm-registry(7)
  • @@ -68,5 +72,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-bin.html b/deps/npm/html/doc/cli/npm-bin.html index 12c598c62ffc5b..9796b852fac0ac 100644 --- a/deps/npm/html/doc/cli/npm-bin.html +++ b/deps/npm/html/doc/cli/npm-bin.html @@ -11,7 +11,7 @@

    npm-bin

    Display npm bin folder

    SYNOPSIS

    -
    npm bin
    +
    npm bin [-g|--global]
     

    DESCRIPTION

    Print the folder where npm will install executables.

    SEE ALSO

    @@ -35,5 +35,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-bugs.html b/deps/npm/html/doc/cli/npm-bugs.html index fcd2b88da1c46f..bbb7654f9344bf 100644 --- a/deps/npm/html/doc/cli/npm-bugs.html +++ b/deps/npm/html/doc/cli/npm-bugs.html @@ -11,8 +11,9 @@

    npm-bugs

    Bugs for a package in a web browser maybe

    SYNOPSIS

    -
    npm bugs <pkgname>
    -npm bugs (with no args in a package dir)
    +
    npm bugs [<pkgname>]
    +
    +aliases: issues
     

    DESCRIPTION

    This command tries to guess at the likely location of a package's bug tracker URL, and then tries to open it using the --browser @@ -54,5 +55,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-build.html b/deps/npm/html/doc/cli/npm-build.html index 9bc91614328b52..6196a369c0896a 100644 --- a/deps/npm/html/doc/cli/npm-build.html +++ b/deps/npm/html/doc/cli/npm-build.html @@ -11,7 +11,7 @@

    npm-build

    Build a package

    SYNOPSIS

    -
    npm build <package-folder>
    +
    npm build [<package-folder>]
     
    • <package-folder>: A folder containing a package.json file in its root.
    • @@ -40,5 +40,5 @@

      DESCRIPTION

             - + diff --git a/deps/npm/html/doc/cli/npm-bundle.html b/deps/npm/html/doc/cli/npm-bundle.html index 81a65c16921498..0d24e621a790bc 100644 --- a/deps/npm/html/doc/cli/npm-bundle.html +++ b/deps/npm/html/doc/cli/npm-bundle.html @@ -31,5 +31,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-cache.html b/deps/npm/html/doc/cli/npm-cache.html index 85179374751b82..056613a4175740 100644 --- a/deps/npm/html/doc/cli/npm-cache.html +++ b/deps/npm/html/doc/cli/npm-cache.html @@ -81,5 +81,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-completion.html b/deps/npm/html/doc/cli/npm-completion.html index 15f71fb290f1bb..414ef4ac245c69 100644 --- a/deps/npm/html/doc/cli/npm-completion.html +++ b/deps/npm/html/doc/cli/npm-completion.html @@ -11,14 +11,16 @@

      npm-completion

      Tab Completion for npm

      SYNOPSIS

      -
      . <(npm completion)
      +
      source <(npm completion)
       

      DESCRIPTION

      Enables tab-completion in all npm commands.

      The synopsis above loads the completions into your current shell. Adding it to your ~/.bashrc or ~/.zshrc will make the completions available -everywhere.

      -

      You may of course also pipe the output of npm completion to a file +everywhere:

      +
      npm completion >> ~/.bashrc
      +npm completion >> ~/.zshrc
      +

      You may of course also pipe the output of npm completion to a file such as /usr/local/etc/bash_completion.d/npm if you have a system that will read that file for you.

      When COMP_CWORD, COMP_LINE, and COMP_POINT are defined in the @@ -27,7 +29,6 @@

      SYNOPSIS

      SEE ALSO

      @@ -42,5 +43,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-config.html b/deps/npm/html/doc/cli/npm-config.html index d73762fe026dd0..4e103974ed6ee1 100644 --- a/deps/npm/html/doc/cli/npm-config.html +++ b/deps/npm/html/doc/cli/npm-config.html @@ -11,14 +11,15 @@

      npm-config

      Manage the npm configuration files

      SYNOPSIS

      -
      npm config set <key> <value> [--global]
      +
      npm config set <key> <value> [-g|--global]
       npm config get <key>
       npm config delete <key>
       npm config list
       npm config edit
      -npm c [set|get|delete|list]
       npm get <key>
      -npm set <key> <value> [--global]
      +npm set <key> <value> [-g|--global]
      +
      +aliases: c
       

      DESCRIPTION

      npm gets its config settings from the command line, environment variables, npmrc files, and in some cases, the package.json file.

      @@ -66,5 +67,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-dedupe.html b/deps/npm/html/doc/cli/npm-dedupe.html index b8bab0074dd91f..dbf60ea4969650 100644 --- a/deps/npm/html/doc/cli/npm-dedupe.html +++ b/deps/npm/html/doc/cli/npm-dedupe.html @@ -11,8 +11,10 @@

      npm-dedupe

      Reduce duplication

      SYNOPSIS

      -
      npm dedupe [package names...]
      -npm ddp [package names...]
      +
      npm dedupe
      +npm ddp
      +
      +aliases: find-dupes, ddp
       

      DESCRIPTION

      Searches the local package tree and attempts to simplify the overall structure by moving dependencies further up the tree, where they can @@ -31,20 +33,16 @@

      SYNOPSIS

      Because of the hierarchical nature of node's module lookup, b and d will both get their dependency met by the single c package at the root level of the tree.

      +

      The deduplication algorithm walks the tree, moving each dependency as far +up in the tree as possible, even if duplicates are not found. This will +result in both a flat and deduplicated tree.

      If a suitable version exists at the target location in the tree already, then it will be left untouched, but the other duplicates will be deleted.

      -

      If no suitable version can be found, then a warning is printed, and -nothing is done.

      -

      If any arguments are supplied, then they are filters, and only the -named packages will be touched.

      -

      Note that this operation transforms the dependency tree, and may -result in packages getting updated versions, perhaps from the npm -registry.

      -

      This feature is experimental, and may change in future versions.

      -

      The --tag argument will apply to all of the affected dependencies. If a -tag with the given name exists, the tagged version is preferred over newer -versions.

      +

      Arguments are ignored. Dedupe always acts on the entire tree.

      +

      Modules

      +

      Note that this operation transforms the dependency tree, but will never +result in new modules being installed.

      SEE ALSO

      • npm-ls(1)
      • @@ -63,5 +61,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-deprecate.html b/deps/npm/html/doc/cli/npm-deprecate.html index 9549631b692012..b39d96d196e2e2 100644 --- a/deps/npm/html/doc/cli/npm-deprecate.html +++ b/deps/npm/html/doc/cli/npm-deprecate.html @@ -11,7 +11,7 @@

        npm-deprecate

        Deprecate a version of a package

        SYNOPSIS

        -
        npm deprecate <name>[@<version>] <message>
        +
        npm deprecate <pkg>[@<version>] <message>
         

        DESCRIPTION

        This command will update the npm registry entry for a package, providing a deprecation warning to all who attempt to install it.

        @@ -38,5 +38,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-dist-tag.html b/deps/npm/html/doc/cli/npm-dist-tag.html index 2a683e71065c43..20b9ef6f38b4dd 100644 --- a/deps/npm/html/doc/cli/npm-dist-tag.html +++ b/deps/npm/html/doc/cli/npm-dist-tag.html @@ -14,6 +14,8 @@

        SYNOPSIS

        npm dist-tag add <pkg>@<version> [<tag>]
         npm dist-tag rm <pkg> <tag>
         npm dist-tag ls [<pkg>]
        +
        +aliases: dist-tags
         

        DESCRIPTION

        Add, remove, and enumerate distribution tags on a package:

          @@ -35,14 +37,23 @@

          SYNOPSIS

        When installing dependencies, a preferred tagged version may be specified:

        npm install --tag <tag>
         

        This also applies to npm dedupe.

        -

        Publishing a package sets the "latest" tag to the published version unless the +

        Publishing a package sets the latest tag to the published version unless the --tag option is used. For example, npm publish --tag=beta.

        +

        By default, npm install <pkg> (without any @<version> or @<tag> +specifier) installs the latest tag.

        PURPOSE

        -

        Tags can be used to provide an alias instead of version numbers. For -example, npm currently uses the tag "next" to identify the upcoming -version, and the tag "latest" to identify the current version.

        -

        A project might choose to have multiple streams of development, e.g., -"stable", "canary".

        +

        Tags can be used to provide an alias instead of version numbers.

        +

        For example, a project might choose to have multiple streams of development +and use a different tag for each stream, +e.g., stable, beta, dev, canary.

        +

        By default, the latest tag is used by npm to identify the current version of +a package, and npm install <pkg> (without any @<version> or @<tag> +specifier) installs the latest tag. Typically, projects only use the latest +tag for stable release versions, and use other tags for unstable versions such +as prereleases.

        +

        The next tag is used by some projects to identify the upcoming version.

        +

        By default, other than latest, no tag has any special significance to npm +itself.

        CAVEATS

        This command used to be known as npm tag, which only created new tags, and so had a different syntax.

        @@ -62,7 +73,6 @@

        SEE ALSO

      • npm-registry(7)
      • npm-config(1)
      • npm-config(7)
      • -
      • npm-tag(3)
      • npmrc(5)
      @@ -77,5 +87,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-docs.html b/deps/npm/html/doc/cli/npm-docs.html index 0e17c157fc6abc..608a88c1bdbca7 100644 --- a/deps/npm/html/doc/cli/npm-docs.html +++ b/deps/npm/html/doc/cli/npm-docs.html @@ -12,9 +12,9 @@

      npm-docs

      Docs for a package in a web browser maybe

      SYNOPSIS

      npm docs [<pkgname> [<pkgname> ...]]
      -npm docs (with no args in a package dir)
      +npm docs .
       npm home [<pkgname> [<pkgname> ...]]
      -npm home (with no args in a package dir)
      +npm home .
       

      DESCRIPTION

      This command tries to guess at the likely location of a package's documentation URL, and then tries to open it using the --browser @@ -56,5 +56,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-edit.html b/deps/npm/html/doc/cli/npm-edit.html index 79c150019e1023..489a31fd3dc863 100644 --- a/deps/npm/html/doc/cli/npm-edit.html +++ b/deps/npm/html/doc/cli/npm-edit.html @@ -11,7 +11,7 @@

      npm-edit

      Edit an installed package

      SYNOPSIS

      -
      npm edit <name>[@<version>]
      +
      npm edit <pkg>[@<version>]
       

      DESCRIPTION

      Opens the package folder in the default editor (or whatever you've configured as the npm editor config -- see npm-config(7).)

      @@ -49,5 +49,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-explore.html b/deps/npm/html/doc/cli/npm-explore.html index 29364ad4f3921c..70bfc6d34a7f2d 100644 --- a/deps/npm/html/doc/cli/npm-explore.html +++ b/deps/npm/html/doc/cli/npm-explore.html @@ -11,7 +11,7 @@

      npm-explore

      Browse an installed package

      SYNOPSIS

      -
      npm explore <name> [ -- <cmd>]
      +
      npm explore <pkg> [ -- <cmd>]
       

      DESCRIPTION

      Spawn a subshell in the directory of the installed package specified.

      If a command is specified, then it is run in the subshell, which then @@ -49,5 +49,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-help-search.html b/deps/npm/html/doc/cli/npm-help-search.html index 2ff4a11ac69943..2be22217231234 100644 --- a/deps/npm/html/doc/cli/npm-help-search.html +++ b/deps/npm/html/doc/cli/npm-help-search.html @@ -11,7 +11,7 @@

      npm-help-search

      Search npm help documentation

      SYNOPSIS

      -
      npm help-search some search terms
      +
      npm help-search <text>
       

      DESCRIPTION

      This command will search the npm markdown documentation files for the terms provided, and then list the results, sorted by relevance.

      @@ -23,7 +23,7 @@

      CONFIGURATION

      long

      • Type: Boolean
      • -
      • Default false
      • +
      • Default: false

      If true, the "long" flag will cause help-search to output context around where the terms were found in the documentation.

      @@ -31,7 +31,6 @@

      long

      SEE ALSO

      @@ -46,5 +45,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-help.html b/deps/npm/html/doc/cli/npm-help.html index 13b670b596e7c4..d34aef1164d7e7 100644 --- a/deps/npm/html/doc/cli/npm-help.html +++ b/deps/npm/html/doc/cli/npm-help.html @@ -11,8 +11,7 @@

      npm-help

      Get help on npm

      SYNOPSIS

      -
      npm help <topic>
      -npm help some search terms
      +
      npm help <term> [<terms..>]
       

      DESCRIPTION

      If supplied a topic, then show the appropriate documentation page.

      If the topic does not exist, or if multiple terms are provided, then run @@ -31,7 +30,6 @@

      SEE ALSO

      • npm(1)
      • README
      • -
      • npm-faq(7)
      • npm-folders(5)
      • npm-config(1)
      • npm-config(7)
      • @@ -52,5 +50,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-init.html b/deps/npm/html/doc/cli/npm-init.html index d9c3d05247d764..c92b5d7e25aaaa 100644 --- a/deps/npm/html/doc/cli/npm-init.html +++ b/deps/npm/html/doc/cli/npm-init.html @@ -48,5 +48,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-install-test.html b/deps/npm/html/doc/cli/npm-install-test.html new file mode 100644 index 00000000000000..296866d2ad5821 --- /dev/null +++ b/deps/npm/html/doc/cli/npm-install-test.html @@ -0,0 +1,45 @@ + + + npm-install-test + + + + + + +
        + +

        npm install-test

        Install package(s) and run tests

        +

        SYNOPSIS

        +
        npm install-test (with no args, in package dir)
        +npm install-test [<@scope>/]<name>
        +npm install-test [<@scope>/]<name>@<tag>
        +npm install-test [<@scope>/]<name>@<version>
        +npm install-test [<@scope>/]<name>@<version range>
        +npm install-test <tarball file>
        +npm install-test <tarball url>
        +npm install-test <folder>
        +
        +alias: npm it
        +common options: [--save|--save-dev|--save-optional] [--save-exact] [--dry-run]
        +

        DESCRIPTION

        +

        This command runs an npm install followed immediately by an npm test. It +takes exactly the same arguments as npm install.

        +

        SEE ALSO

        + + +
        + + + + + + + + + + + diff --git a/deps/npm/html/doc/cli/npm-install.html b/deps/npm/html/doc/cli/npm-install.html index ab3e03f9ba6ffd..46a24c5f48a240 100644 --- a/deps/npm/html/doc/cli/npm-install.html +++ b/deps/npm/html/doc/cli/npm-install.html @@ -11,28 +11,30 @@

        npm-install

        Install a package

        SYNOPSIS

        -
        npm install (with no args in a package dir)
        +
        npm install (with no args, in package dir)
        +npm install [<@scope>/]<name>
        +npm install [<@scope>/]<name>@<tag>
        +npm install [<@scope>/]<name>@<version>
        +npm install [<@scope>/]<name>@<version range>
         npm install <tarball file>
         npm install <tarball url>
         npm install <folder>
        -npm install [@<scope>/]<name> [--save|--save-dev|--save-optional] [--save-exact]
        -npm install [@<scope>/]<name>@<tag>
        -npm install [@<scope>/]<name>@<version>
        -npm install [@<scope>/]<name>@<version range>
        -npm i (with any of the previous argument usage)
        +
        +alias: npm i
        +common options: [-S|--save|-D|--save-dev|-O|--save-optional] [-E|--save-exact] [-B|--save-bundle] [--dry-run]
         

        DESCRIPTION

        This command installs a package, and any packages that it depends on. If the package has a shrinkwrap file, the installation of dependencies will be driven by that. See npm-shrinkwrap(1).

        A package is:

          -
        • a) a folder containing a program described by a package.json file
        • +
        • a) a folder containing a program described by a package.json(5) file
        • b) a gzipped tarball containing (a)
        • c) a url that resolves to (b)
        • d) a <name>@<version> that is published on the registry (see npm-registry(7)) with (c)
        • -
        • e) a <name>@<tag> that points to (d)
        • +
        • e) a <name>@<tag> (see npm-dist-tag(1)) that points to (d)
        • f) a <name> that has a "latest" tag satisfying (e)
        • -
        • g) a <git remote url> that resolves to (b)
        • +
        • g) a <git remote url> that resolves to (a)

        Even if you never publish your package, you can still get a lot of benefits of using npm if you just want to write a node program (a), and @@ -44,8 +46,9 @@

        SYNOPSIS

        In global mode (ie, with -g or --global appended to the command), it installs the current package context (ie, the current working directory) as a global package.

        -

        By default, npm install will install all modules listed as dependencies. - With the --production flag (or when the NODE_ENV environment variable +

        By default, npm install will install all modules listed as dependencies + in package.json(5).

        +

        With the --production flag (or when the NODE_ENV environment variable is set to production), npm will not install modules listed in devDependencies.

        @@ -65,9 +68,9 @@

        SYNOPSIS

        Example:

            npm install https://github.com/indexzero/forever/tarball/v0.5.6
         
        -
      • npm install [@<scope>/]<name> [--save|--save-dev|--save-optional]:

        +
      • npm install [<@scope>/]<name> [-S|--save|-D|--save-dev|-O|--save-optional]:

        Do a <name>@<tag> install, where <tag> is the "tag" config. (See - npm-config(7).)

        + npm-config(7). The config's default value is latest.)

        In most cases, this will install the latest version of the module published on npm.

        Example:

        @@ -75,17 +78,21 @@

        SYNOPSIS

      • npm install takes 3 exclusive, optional flags which save or update the package version in your main package.json:

          -
        • --save: Package will appear in your dependencies.

          +
        • -S, --save: Package will appear in your dependencies.

        • -
        • --save-dev: Package will appear in your devDependencies.

          +
        • -D, --save-dev: Package will appear in your devDependencies.

        • -
        • --save-optional: Package will appear in your optionalDependencies.

          +
        • -O, --save-optional: Package will appear in your optionalDependencies.

          When using any of the above options to save dependencies to your -package.json, there is an additional, optional flag:

          +package.json, there are two additional, optional flags:

        • -
        • --save-exact: Saved dependencies will be configured with an +

        • -E, --save-exact: Saved dependencies will be configured with an exact version rather than using npm's default semver range operator.

          +
        • +
        • -B, --save-bundle: Saved dependencies will also be added to your bundleDependencies list.

          +

          Further, if you have an npm-shrinkwrap.json then it will be updated as +well.

          <scope> is optional. The package will be downloaded from the registry associated with the specified scope. If no registry is associated with the given scope the default registry is assumed. See npm-scope(7).

          @@ -99,6 +106,7 @@

          SYNOPSIS

          npm install node-tap --save-dev npm install dtrace-provider --save-optional npm install readable-stream --save --save-exact +npm install ansi-regex --save --save-bundle
    @@ -107,7 +115,7 @@

    SYNOPSIS

    working directory, then it will try to install that, and only try to fetch the package by name if it is not valid.
      -
    • npm install [@<scope>/]<name>@<tag>:

      +
    • npm install [<@scope>/]<name>@<tag>:

      Install the version of the package that is referenced by the specified tag. If the tag does not exist in the registry data for that package, then this will fail.

      @@ -115,14 +123,14 @@

      SYNOPSIS

          npm install sax@latest
           npm install @myorg/mypackage@latest
       
    • -
    • npm install [@<scope>/]<name>@<version>:

      +
    • npm install [<@scope>/]<name>@<version>:

      Install the specified version of the package. This will fail if the version has not been published to the registry.

      Example:

          npm install sax@0.1.1
           npm install @myorg/privatepackage@1.5.0
       
    • -
    • npm install [@<scope>/]<name>@<version range>:

      +
    • npm install [<@scope>/]<name>@<version range>:

      Install a version of the package matching the specified version range. This will follow the same rules for resolving dependencies described in package.json(5).

      Note that most version ranges must be put in quotes so that your shell will @@ -132,12 +140,14 @@

      SYNOPSIS

      npm install @myorg/privatepackage@">=0.1.0 <0.2.0"
  • npm install <git remote url>:

    -

    Install a package by cloning a git remote url. The format of the git - url is:

    -
        <protocol>://[<user>[:<password>]@]<hostname>[:<port>][:/]<path>[#<commit-ish>]
    -

    <protocol> is one of git, git+ssh, git+http, or - git+https. If no <commit-ish> is specified, then master is - used.

    +

    Installs the package from the hosted git provider, cloning it with + git. First it tries via the https (git with github) and if that fails, via ssh.

    +
        <protocol>://[<user>[:<password>]@]<hostname>[:<port>][:][/]<path>[#<commit-ish>]
    +

    <protocol> is one of git, git+ssh, git+http, git+https, + or git+file. + If no <commit-ish> is specified, then master is used.

    +

    If the repository makes use of submodules, those submodules will + be cloned as well.

    The following git environment variables are recognized by npm and will be added to the environment when running git:

      @@ -169,7 +179,7 @@

      SYNOPSIS

    • npm install gist:[<githubname>/]<gistID>[#<commit-ish>]:

      Install the package at https://gist.github.com/gistID by attempting to clone it using git. The GitHub username associated with the gist is - optional and will not be saved in package.json if --save is used.

      + optional and will not be saved in package.json if -S or --save is used.

      If you don't specify a commit-ish then master will be used.

      Example:

          npm install gist:101a11beef
      @@ -195,11 +205,23 @@ 

      SYNOPSIS

      The --tag argument will apply to all of the specified install targets. If a tag with the given name exists, the tagged version is preferred over newer versions.

      -

      The --force argument will force npm to fetch remote resources even if a +

      The --dry-run argument will report in the usual way what the install would +have done without actually installing anything.

      +

      The -f or --force argument will force npm to fetch remote resources even if a local copy exists on disk.

      npm install sax --force
      -

      The --global argument will cause npm to install the package globally +

  • The -g or --global argument will cause npm to install the package globally rather than locally. See npm-folders(5).

    +

    The --global-style argument will cause npm to install the package into +your local node_modules folder with the same layout it uses with the +global node_modules folder. Only your direct dependencies will show in +node_modules and everything they depend on will be flattened in their +node_modules folders. This obviously will eliminate some deduping.

    +

    The --ignore-scripts argument will cause npm to not execute any +scripts defined in the package.json. See npm-scripts(7).

    +

    The --legacy-bundling argument will cause npm to install the package such +that versions of npm prior to 1.4, such as the one included with node 0.8, +can install the package. This eliminates all automatic deduping.

    The --link argument will cause npm to link global installs into the local space in some cases.

    The --no-bin-links argument will prevent npm from creating symlinks for @@ -210,27 +232,39 @@

    SYNOPSIS

    shrinkwrap file and use the package.json instead.

    The --nodedir=/path/to/node/source argument will allow npm to find the node source code so that npm can compile native modules.

    +

    The --only={prod[uction]|dev[elopment]} argument will cause either only +devDependencies or only non-devDependencies to be installed regardless of the NODE_ENV.

    See npm-config(7). Many of the configuration params have some effect on installation, since that's most of what npm does.

    ALGORITHM

    To install a package, npm uses the following algorithm:

    -
    install(where, what, family, ancestors)
    -fetch what, unpack to <where>/node_modules/<what>
    -for each dep in what.dependencies
    -  resolve dep to precise version
    -for each dep@version in what.dependencies
    -    not in <where>/node_modules/<what>/node_modules/*
    -    and not in <family>
    -  add precise version deps to <family>
    -  install(<where>/node_modules/<what>, dep, family)
    +
    load the existing node_modules tree from disk
    +clone the tree
    +fetch the package.json and assorted metadata and add it to the clone
    +walk the clone and add any missing dependencies
    +  dependencies will be added as close to the top as is possible
    +  without breaking any other modules
    +compare the original tree with the cloned tree and make a list of
    +actions to take to convert one to the other
    +execute all of the actions, deepest first
    +  kinds of actions are install, update, remove and move
     

    For this package{dep} structure: A{B,C}, B{C}, C{D}, this algorithm produces:

    A
     +-- B
    -`-- C
    -    `-- D
    ++-- C
    ++-- D
     

    That is, the dependency from B to C is satisfied by the fact that A -already caused C to be installed at a higher level.

    +already caused C to be installed at a higher level. D is still installed +at the top level because nothing conflicts with it.

    +

    For A{B,C}, B{C,D@1}, C{D@2}, this algorithm produces:

    +
    A
    ++-- B
    ++-- C
    +   `-- D@2
    ++-- D@1
    +

    Because B's D@1 will be installed in the top level, C now has to install D@2 +privately for itself.

    See npm-folders(5) for a more detailed description of the specific folder structures that npm creates.

    Limitations of npm's Install Algorithm

    @@ -262,8 +296,9 @@

    SEE ALSO

  • npmrc(5)
  • npm-registry(7)
  • npm-tag(1)
  • -
  • npm-rm(1)
  • +
  • npm-uninstall(1)
  • npm-shrinkwrap(1)
  • +
  • package.json(5)
@@ -277,5 +312,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-link.html b/deps/npm/html/doc/cli/npm-link.html index 322d02d46918af..cc7d4b8f7de5ea 100644 --- a/deps/npm/html/doc/cli/npm-link.html +++ b/deps/npm/html/doc/cli/npm-link.html @@ -11,16 +11,18 @@

npm-link

Symlink a package folder

SYNOPSIS

-
npm link (in package folder)
-npm link [@<scope>/]<pkgname>
-npm ln (with any of the previous argument usage)
+
npm link (in package dir)
+npm link [<@scope>/]<pkg>[@<version>]
+
+alias: npm ln
 

DESCRIPTION

Package linking is a two-step process.

-

First, npm link in a package folder will create a globally-installed -symbolic link from prefix/package-name to the current folder (see -npm-config(7) for the value of prefix).

+

First, npm link in a package folder will create a symlink in the global folder +{prefix}/lib/node_modules/<package> that links to the package where the npm +link command was executed. (see npm-config(7) for the value of prefix).

Next, in some other location, npm link package-name will create a -symlink from the local node_modules folder to the global symlink.

+symbolic link from globally-installed package-name to node_modules/ +of the current folder.

Note that package-name is taken from package.json, not from directory name.

The package name can be optionally prefixed with a scope. See npm-scope(7). @@ -36,7 +38,7 @@

SYNOPSIS

npm link redis # link-install the package

Now, any changes to ~/projects/node-redis will be reflected in ~/projects/node-bloggy/node_modules/node-redis/. Note that the link should -be to the package name, not the directory name for that package.

+be to the package name, not the directory name for that package.

You may also shortcut the two steps in one. For example, to do the above use-case in a shorter way:

cd ~/projects/node-bloggy  # go into the dir of your main project
@@ -52,7 +54,6 @@ 

SYNOPSIS

SEE ALSO

  • npm-developers(7)
  • -
  • npm-faq(7)
  • package.json(5)
  • npm-install(1)
  • npm-folders(5)
  • @@ -72,5 +73,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/cli/npm-logout.html b/deps/npm/html/doc/cli/npm-logout.html index 16b97daae388bd..0430fcf35dba78 100644 --- a/deps/npm/html/doc/cli/npm-logout.html +++ b/deps/npm/html/doc/cli/npm-logout.html @@ -11,7 +11,7 @@

    npm-logout

    Log out of the registry

    SYNOPSIS

    -
    npm logout [--registry=url] [--scope=@orgname]
    +
    npm logout [--registry=<url>] [--scope=<@scope>]
     

    DESCRIPTION

    When logged into a registry that supports token-based authentication, tell the server to end this token's session. This will invalidate the token everywhere @@ -23,18 +23,14 @@

    SYNOPSIS

    connected to that scope, if set.

    CONFIGURATION

    registry

    -

    Default: http://registry.npmjs.org/

    +

    Default: https://registry.npmjs.org/

    The base URL of the npm package registry. If scope is also specified, it takes precedence.

    scope

    Default: none

    -

    If specified, the user and login credentials given will be associated -with the specified scope. See npm-scope(7). You can use both at the same time, -e.g.

    -
    npm adduser --registry=http://myregistry.example.com --scope=@myco
    -

    This will set a registry for the given scope and login or create a user for -that registry at the same time.

    -

    SEE ALSO

    +

    If specified, you will be logged out of the specified scope. See npm-scope(7).

    +
    npm logout --scope=@myco
    +

    SEE ALSO

    • npm-adduser(1)
    • npm-registry(7)
    • @@ -55,5 +51,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-ls.html b/deps/npm/html/doc/cli/npm-ls.html index f36d7952cf10cb..feaf5c02720b4a 100644 --- a/deps/npm/html/doc/cli/npm-ls.html +++ b/deps/npm/html/doc/cli/npm-ls.html @@ -11,10 +11,9 @@

      npm-ls

      List installed packages

      SYNOPSIS

      -
      npm list [[@<scope>/]<pkg> ...]
      -npm ls [[@<scope>/]<pkg> ...]
      -npm la [[@<scope>/]<pkg> ...]
      -npm ll [[@<scope>/]<pkg> ...]
      +
      npm ls [[<@scope>/]<pkg> ...]
      +
      +aliases: list, la, ll
       

      DESCRIPTION

      This command will print to stdout all the versions of packages that are installed, as well as their dependencies, in a tree-structure.

      @@ -22,13 +21,15 @@

      SYNOPSIS

      limit the results to only the paths to the packages named. Note that nested packages will also show the paths to the specified packages. For example, running npm ls promzard in npm's source tree will show:

      -
      npm@2.14.7 /path/to/npm
      +
      npm@3.8.6 /path/to/npm
       └─┬ init-package-json@0.0.4
         └── promzard@0.1.5
       

      It will print out extraneous, missing, and invalid packages.

      If a project specifies git urls for dependencies these are shown in parentheses after the name@version to make it easier for users to recognize potential forks of a project.

      +

      The tree shown is the logical dependency tree, based on package +dependencies, not the physical layout of your node_modules folder.

      When run as ll or la, it shows extended information by default.

      CONFIGURATION

      json

      @@ -73,6 +74,12 @@

      dev

    • Default: false

    Display only the dependency tree for packages in devDependencies.

    +

    only

    +
      +
    • Type: String
    • +
    +

    When "dev" or "development", is an alias to dev.

    +

    When "prod" or "production", is an alias to production.`

    SEE ALSO

    • npm-config(1)
    • @@ -97,5 +104,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-outdated.html b/deps/npm/html/doc/cli/npm-outdated.html index 29728e96ae7784..02d947c5a68a23 100644 --- a/deps/npm/html/doc/cli/npm-outdated.html +++ b/deps/npm/html/doc/cli/npm-outdated.html @@ -11,13 +11,60 @@

      npm-outdated

      Check for outdated packages

      SYNOPSIS

      -
      npm outdated [<name> [<name> ...]]
      +
      npm outdated [[<@scope>/]<pkg> ...]
       

      DESCRIPTION

      This command will check the registry to see if any (or, specific) installed packages are currently outdated.

      -

      The resulting field 'wanted' shows the latest version according to the -version specified in the package.json, the field 'latest' the very latest -version of the package.

      +

      In the output:

      +
        +
      • wanted is the maximum version of the package that satisfies the semver +range specified in package.json. If there's no available semver range (i.e. +you're running npm outdated --global, or the package isn't included in +package.json), then wanted shows the currently-installed version.
      • +
      • latest is the version of the package tagged as latest in the registry. +Running npm publish with no special configuration will publish the package +with a dist-tag of latest. This may or may not be the maximum version of +the package, or the most-recently published version of the package, depending +on how the package's developer manages the latest dist-tag(1).
      • +
      • location is where in the dependency tree the package is located. Note that +npm outdated defaults to a depth of 0, so unless you override that, you'll +always be seeing only top-level dependencies that are outdated.
      • +
      • package type (when using --long / -l) tells you whether this package is +a dependency or a devDependency. Packages not included in package.json +are always marked dependencies.
      • +
      +

      An example

      +
      $ npm outdated
      +Package      Current   Wanted   Latest  Location
      +glob          5.0.15   5.0.15    6.0.1  test-outdated-output
      +nothingness    0.0.3      git      git  test-outdated-output
      +npm            3.5.1    3.5.2    3.5.1  test-outdated-output
      +local-dev      0.0.3   linked   linked  test-outdated-output
      +once           1.3.2    1.3.3    1.3.3  test-outdated-output
      +

      With these dependencies:

      +
      {
      +  "glob": "^5.0.15",
      +  "nothingness": "github:othiym23/nothingness#master",
      +  "npm": "^3.5.1",
      +  "once": "^1.3.1"
      +}
      +
      +

      A few things to note:

      +
        +
      • glob requires ^5, which prevents npm from installing glob@6, which is +outside the semver range.
      • +
      • Git dependencies will always be reinstalled, because of how they're specified. +The installed committish might satisfy the dependency specifier (if it's +something immutable, like a commit SHA), or it might not, so npm outdated and +npm update have to fetch Git repos to check. This is why currently doing a +reinstall of a Git dependency always forces a new clone and install.
      • +
      • npm@3.5.2 is marked as "wanted", but "latest" is npm@3.5.1 because npm +uses dist-tags to manage its latest and next release channels. npm update +will install the newest version, but npm install npm (with no semver range) +will install whatever's tagged as latest.
      • +
      • once is just plain out of date. Reinstalling node_modules from scratch or +running npm update will bring it up to spec.
      • +

      CONFIGURATION

      json

        @@ -46,12 +93,14 @@

        global

        project.

        depth

          +
        • Default: 0
        • Type: Int

        Max depth for checking dependency tree.

        SEE ALSO

        @@ -67,5 +116,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-owner.html b/deps/npm/html/doc/cli/npm-owner.html index 603043dc6e19e3..c862feb12d7521 100644 --- a/deps/npm/html/doc/cli/npm-owner.html +++ b/deps/npm/html/doc/cli/npm-owner.html @@ -11,9 +11,11 @@

        npm-owner

        Manage package owners

        SYNOPSIS

        -
        npm owner ls <package name>
        -npm owner add <user> <package name>
        -npm owner rm <user> <package name>
        +
        npm owner add <user> [<@scope>/]<pkg>
        +npm owner rm <user> [<@scope>/]<pkg>
        +npm owner ls [<@scope>/]<pkg>
        +
        +aliases: author
         

        DESCRIPTION

        Manage ownership of published packages.

          @@ -49,5 +51,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/cli/npm-pack.html b/deps/npm/html/doc/cli/npm-pack.html index 77bf5578bbe6a6..1e2d1fa63fa34e 100644 --- a/deps/npm/html/doc/cli/npm-pack.html +++ b/deps/npm/html/doc/cli/npm-pack.html @@ -11,13 +11,13 @@

          npm-pack

          Create a tarball from a package

          SYNOPSIS

          -
          npm pack [<pkg> [<pkg> ...]]
          +
          npm pack [[<@scope>/]<pkg>...]
           

          DESCRIPTION

          For anything that's installable (that is, a package folder, tarball, -tarball url, name@tag, name@version, or name), this command will fetch -it to the cache, and then copy the tarball to the current working -directory as <name>-<version>.tgz, and then write the filenames out to -stdout.

          +tarball url, name@tag, name@version, name, or scoped name), this +command will fetch it to the cache, and then copy the tarball to the +current working directory as <name>-<version>.tgz, and then write +the filenames out to stdout.

          If the same package is specified multiple times, then the file will be overwritten the second time.

          If no arguments are supplied, then npm packs the current package folder.

          @@ -41,5 +41,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/cli/npm-ping.html b/deps/npm/html/doc/cli/npm-ping.html index e10095ec5a50ae..d435090b41572f 100644 --- a/deps/npm/html/doc/cli/npm-ping.html +++ b/deps/npm/html/doc/cli/npm-ping.html @@ -32,4 +32,4 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/cli/npm-prefix.html b/deps/npm/html/doc/cli/npm-prefix.html index 96d63d75070f5e..c5db17a3abdc61 100644 --- a/deps/npm/html/doc/cli/npm-prefix.html +++ b/deps/npm/html/doc/cli/npm-prefix.html @@ -38,5 +38,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/cli/npm-prune.html b/deps/npm/html/doc/cli/npm-prune.html index d90b0fb25a57b9..a7fc7c7f734ab4 100644 --- a/deps/npm/html/doc/cli/npm-prune.html +++ b/deps/npm/html/doc/cli/npm-prune.html @@ -11,8 +11,7 @@

          npm-prune

          Remove extraneous packages

          SYNOPSIS

          -
          npm prune [<name> [<name ...]]
          -npm prune [<name> [<name ...]] [--production]
          +
          npm prune [[<@scope>/]<pkg>...] [--production]
           

          DESCRIPTION

          This command removes "extraneous" packages. If a package name is provided, then only packages matching one of the supplied names are @@ -25,7 +24,7 @@

          SYNOPSIS

          negate NODE_ENV being set to production.

          SEE ALSO

          @@ -41,5 +40,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/cli/npm-publish.html b/deps/npm/html/doc/cli/npm-publish.html index b6372b26446a7a..f75ed7444018c1 100644 --- a/deps/npm/html/doc/cli/npm-publish.html +++ b/deps/npm/html/doc/cli/npm-publish.html @@ -11,12 +11,17 @@

          npm-publish

          Publish a package

          SYNOPSIS

          -
          npm publish <tarball> [--tag <tag>] [--access <public|restricted>]
          -npm publish <folder> [--tag <tag>] [--access <public|restricted>]
          +
          npm publish [<tarball>|<folder>] [--tag <tag>] [--access <public|restricted>]
          +
          +Publishes '.' if no argument supplied
          +Sets tag 'latest' if no --tag specified
           

          DESCRIPTION

          -

          Publishes a package to the registry so that it can be installed by name. See -npm-developers(7) for details on what's included in the published package, as -well as details on how the package is built.

          +

          Publishes a package to the registry so that it can be installed by name. All +files in the package directory are included if no local .gitignore or +.npmignore file exists. If both files exist and a file is ignored by +.gitignore but not by .npmignore then it will be included. See +npm-developers(7) for full details on what's included in the published +package, as well as details on how the package is built.

          By default npm will publish to the public registry. This can be overridden by specifying a different default registry or using a npm-scope(7) in the name (see package.json(5)).

          @@ -31,7 +36,8 @@

          SYNOPSIS

        • [--tag <tag>] Registers the published package with the given tag, such that npm install <name>@<tag> will install this version. By default, npm publish updates -and npm install installs the latest tag.

          +and npm install installs the latest tag. See npm-dist-tag(1) for +details about tags.

        • [--access <public|restricted>] Tells the registry whether this package should be published as public or @@ -66,5 +72,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/cli/npm-rebuild.html b/deps/npm/html/doc/cli/npm-rebuild.html index 4fb2d48108246b..4b2140aac3f754 100644 --- a/deps/npm/html/doc/cli/npm-rebuild.html +++ b/deps/npm/html/doc/cli/npm-rebuild.html @@ -11,13 +11,10 @@

          npm-rebuild

          Rebuild a package

          SYNOPSIS

          -
          npm rebuild [<name> [<name> ...]]
          -npm rb [<name> [<name> ...]]
          -
            -
          • <name>: -The package to rebuild
          • -
          -

          DESCRIPTION

          +
          npm rebuild [[<@scope>/<name>]...]
          +
          +alias: npm rb
          +

          DESCRIPTION

          This command runs the npm build command on the matched folders. This is useful when you install a new version of node, and must recompile all your C++ addons with the new binary.

          @@ -38,5 +35,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/cli/npm-repo.html b/deps/npm/html/doc/cli/npm-repo.html index d66da6ab92f39f..5f9ea1872f0744 100644 --- a/deps/npm/html/doc/cli/npm-repo.html +++ b/deps/npm/html/doc/cli/npm-repo.html @@ -11,8 +11,7 @@

          npm-repo

          Open package repository page in the browser

          SYNOPSIS

          -
          npm repo <pkgname>
          -npm repo (with no args in a package dir)
          +
          npm repo [<pkg>]
           

          DESCRIPTION

          This command tries to guess at the likely location of a package's repository URL, and then tries to open it using the --browser @@ -42,5 +41,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/cli/npm-restart.html b/deps/npm/html/doc/cli/npm-restart.html index 7d9fe7b9641efe..5644b01f07a055 100644 --- a/deps/npm/html/doc/cli/npm-restart.html +++ b/deps/npm/html/doc/cli/npm-restart.html @@ -53,5 +53,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/cli/npm-rm.html b/deps/npm/html/doc/cli/npm-rm.html deleted file mode 100644 index 1714fe27df61f0..00000000000000 --- a/deps/npm/html/doc/cli/npm-rm.html +++ /dev/null @@ -1,43 +0,0 @@ - - - npm-rm - - - - - - -
          - -

          npm-rm

          Remove a package

          -

          SYNOPSIS

          -
          npm rm <name>
          -npm r <name>
          -npm uninstall <name>
          -npm un <name>
          -

          DESCRIPTION

          -

          This uninstalls a package, completely removing everything npm installed -on its behalf.

          -

          SEE ALSO

          - - -
          - - - - - - - - - - - - diff --git a/deps/npm/html/doc/cli/npm-root.html b/deps/npm/html/doc/cli/npm-root.html index e29dacdbea6204..069f5ccba92396 100644 --- a/deps/npm/html/doc/cli/npm-root.html +++ b/deps/npm/html/doc/cli/npm-root.html @@ -11,7 +11,7 @@

          npm-root

          Display npm root

          SYNOPSIS

          -
          npm root
          +
          npm root [-g]
           

          DESCRIPTION

          Print the effective node_modules folder to standard out.

          SEE ALSO

          @@ -35,5 +35,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/cli/npm-run-script.html b/deps/npm/html/doc/cli/npm-run-script.html index 47f437d6257a15..b090a308ab461e 100644 --- a/deps/npm/html/doc/cli/npm-run-script.html +++ b/deps/npm/html/doc/cli/npm-run-script.html @@ -11,8 +11,9 @@

          npm-run-script

          Run arbitrary package scripts

          SYNOPSIS

          -
          npm run-script [command] [-- <args>]
          -npm run [command] [-- <args>]
          +
          npm run-script <command> [-- <args>...]
          +
          +alias: npm run
           

          DESCRIPTION

          This runs an arbitrary command from a package's "scripts" object. If no "command" is provided, it will list the available scripts. run[-script] is @@ -37,6 +38,8 @@

          SYNOPSIS

          you should write:

          "scripts": {"test": "tap test/\*.js"}
           

          instead of "scripts": {"test": "node_modules/.bin/tap test/\*.js"} to run your tests.

          +

          If you try to run a script without having a node_modules directory and it fails, +you will be given a warning to run npm install, just in case you've forgotten.

          SEE ALSO

          • npm-scripts(7)
          • @@ -57,5 +60,5 @@

            SEE ALSO

                   - + diff --git a/deps/npm/html/doc/cli/npm-search.html b/deps/npm/html/doc/cli/npm-search.html index 049a5faa187897..a2dfaf42348c03 100644 --- a/deps/npm/html/doc/cli/npm-search.html +++ b/deps/npm/html/doc/cli/npm-search.html @@ -11,9 +11,9 @@

            npm-search

            Search for packages

            SYNOPSIS

            -
            npm search [--long] [search terms ...]
            -npm s [search terms ...]
            -npm se [search terms ...]
            +
            npm search [-l|--long] [search terms ...]
            +
            +aliases: s, se, find
             

            DESCRIPTION

            Search the registry for packages matching the search terms.

            If a term starts with /, then it's interpreted as a regular expression. @@ -29,6 +29,14 @@

            long

            lines. When disabled (default) search results are truncated to fit neatly on a single line. Modules with extremely long names will fall on multiple lines.

            +

            registry

            + +

            Search the specified registry for modules. If you have configured npm to point to a different default registry, +such as your internal private module repository, npm search will default to that registry when searching. +Pass a different registry url such as the default above in order to override this setting.

            SEE ALSO

            • npm-registry(7)
            • @@ -49,5 +57,5 @@

              SEE ALSO

                     - + diff --git a/deps/npm/html/doc/cli/npm-shrinkwrap.html b/deps/npm/html/doc/cli/npm-shrinkwrap.html index 3d11d8e0e4d817..cd6e038e1ab7a6 100644 --- a/deps/npm/html/doc/cli/npm-shrinkwrap.html +++ b/deps/npm/html/doc/cli/npm-shrinkwrap.html @@ -76,23 +76,29 @@

              SYNOPSIS

              "dependencies": { "B": { "version": "0.0.1", + "from": "B@^0.0.1", + "resolved": "https://registry.npmjs.org/B/-/B-0.0.1.tgz", "dependencies": { "C": { - "version": "0.0.1" + "version": "0.0.1", + "from": "org/C#v0.0.1", + "resolved": "git://github.com/org/C.git#5c380ae319fc4efe9e7f2d9c78b0faa588fd99b4" } } } } } -

            The shrinkwrap command has locked down the dependencies based on -what's currently installed in node_modules. When npm install -installs a package with an npm-shrinkwrap.json in the package -root, the shrinkwrap file (rather than package.json files) completely -drives the installation of that package and all of its dependencies -(recursively). So now the author publishes A@0.1.0, and subsequent -installs of this package will use B@0.0.1 and C@0.0.1, regardless the -dependencies and versions listed in A's, B's, and C's package.json -files.

            +

          The shrinkwrap command has locked down the dependencies based on what's +currently installed in node_modules. The installation behavior is changed to:

          +
            +
          1. The module tree described by the shrinkwrap is reproduced. This means +reproducing the structure described in the file, using the specific files +referenced in "resolved" if available, falling back to normal package +resolution using "version" if one isn't.

            +
          2. +
          3. The tree is walked and any missing dependencies are installed in the usual fashion.

            +
          4. +

          Using shrinkwrapped packages

          Using a shrinkwrapped package is no different than using any other package: you can npm install it by hand, or add a dependency to your @@ -110,15 +116,14 @@

          Building shrinkwrapped packages

          1. Run npm install in the package root to install the current versions of all dependencies.
          2. -
          3. Add or update dependencies. npm install each new or updated -package individually and then update package.json. Note that they -must be explicitly named in order to be installed: running npm -install with no arguments will merely reproduce the existing +
          4. Add or update dependencies. npm install --save each new or updated +package individually to update the package.json and the shrinkwrap. +Note that they must be explicitly named in order to be installed: running +npm install with no arguments will merely reproduce the existing shrinkwrap.
          5. Validate that the package works as expected with the new dependencies.
          6. -
          7. Run npm shrinkwrap, commit the new npm-shrinkwrap.json, and -publish your package.
          8. +
          9. Commit the new npm-shrinkwrap.json, and publish your package.

          You can use npm-outdated(1) to view dependencies with newer versions available.

          @@ -164,5 +169,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/cli/npm-star.html b/deps/npm/html/doc/cli/npm-star.html index 6a33768b779697..ca1c5f684ba953 100644 --- a/deps/npm/html/doc/cli/npm-star.html +++ b/deps/npm/html/doc/cli/npm-star.html @@ -11,8 +11,8 @@

          npm-star

          Mark your favorite packages

          SYNOPSIS

          -
          npm star <pkgname> [<pkg>, ...]
          -npm unstar <pkgname> [<pkg>, ...]
          +
          npm star [<pkg>...]
          +npm unstar [<pkg>...]
           

          DESCRIPTION

          "Starring" a package means that you have some interest in it. It's a vaguely positive way to show that you care.

          @@ -36,5 +36,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/cli/npm-stars.html b/deps/npm/html/doc/cli/npm-stars.html index 89b23b0a8872c2..2016c0af3bb212 100644 --- a/deps/npm/html/doc/cli/npm-stars.html +++ b/deps/npm/html/doc/cli/npm-stars.html @@ -11,8 +11,7 @@

          npm-stars

          View packages marked as favorites

          SYNOPSIS

          -
          npm stars
          -npm stars [username]
          +
          npm stars [<user>]
           

          DESCRIPTION

          If you have starred a lot of neat things and want to find them again quickly this command lets you do just that.

          @@ -37,5 +36,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/cli/npm-start.html b/deps/npm/html/doc/cli/npm-start.html index 718160b63eb421..3a4dd2d4d28bc1 100644 --- a/deps/npm/html/doc/cli/npm-start.html +++ b/deps/npm/html/doc/cli/npm-start.html @@ -13,7 +13,12 @@

          npm-start

          Start a package

          SYNOPSIS

          npm start [-- <args>]
           

          DESCRIPTION

          -

          This runs a package's "start" script, if one was provided.

          +

          This runs an arbitrary command specified in the package's "start" property of +its "scripts" object. If no "start" property is specified on the +"scripts" object, it will run node server.js.

          +

          As of npm@2.0.0, you can +use custom arguments when executing scripts. Refer to npm-run-script(1) for +more details.

          SEE ALSO

          • npm-run-script(1)
          • @@ -34,5 +39,5 @@

            SEE ALSO

                   - + diff --git a/deps/npm/html/doc/cli/npm-stop.html b/deps/npm/html/doc/cli/npm-stop.html index 2047d8e85417b2..95a978ea0a7284 100644 --- a/deps/npm/html/doc/cli/npm-stop.html +++ b/deps/npm/html/doc/cli/npm-stop.html @@ -34,5 +34,5 @@

            SEE ALSO

                   - + diff --git a/deps/npm/html/doc/cli/npm-tag.html b/deps/npm/html/doc/cli/npm-tag.html index af7b2f746f6e9c..45202c99a3c7e0 100644 --- a/deps/npm/html/doc/cli/npm-tag.html +++ b/deps/npm/html/doc/cli/npm-tag.html @@ -11,7 +11,8 @@

            npm-tag

            Tag a published version

            SYNOPSIS

            -
            npm tag <name>@<version> [<tag>]
            +
            [DEPRECATED] npm tag <name>@<version> [<tag>]
            +See `dist-tag`
             

            DESCRIPTION

            THIS COMMAND IS DEPRECATED. See npm-dist-tag(1) for details.

            Tags the specified version of the package with the specified tag, or the @@ -62,5 +63,5 @@

            SEE ALSO

                   - + diff --git a/deps/npm/html/doc/cli/npm-team.html b/deps/npm/html/doc/cli/npm-team.html index cc23b76d82e007..fb140ee9fa919d 100644 --- a/deps/npm/html/doc/cli/npm-team.html +++ b/deps/npm/html/doc/cli/npm-team.html @@ -23,10 +23,10 @@

            SYNOPSIS

            DESCRIPTION

            Used to manage teams in organizations, and change team memberships. Does not handle permissions for packages.

            -

            Teams must always be fully qualified with the organization/scope they belond to +

            Teams must always be fully qualified with the organization/scope they belong to when operating on them, separated by a colon (:). That is, if you have a developers team on a foo organization, you must always refer to that team as -developers:foo in these commands.

            +foo:developers in these commands.

            • create / destroy: Create a new team, or destroy an existing one.

              @@ -53,7 +53,7 @@

              DETAILS

              SEE ALSO

              @@ -67,4 +67,4 @@

              SEE ALSO

                     - + diff --git a/deps/npm/html/doc/cli/npm-test.html b/deps/npm/html/doc/cli/npm-test.html index bcd729a7487a56..31e6a40cfb2b9f 100644 --- a/deps/npm/html/doc/cli/npm-test.html +++ b/deps/npm/html/doc/cli/npm-test.html @@ -12,7 +12,8 @@

              npm-test

              Test a package

              SYNOPSIS

                npm test [-- <args>]
              -  npm tst [-- <args>]
              +
              +  aliases: t, tst
               

              DESCRIPTION

              This runs a package's "test" script, if one was provided.

              To run tests as a condition of installation, set the npat config to @@ -37,5 +38,5 @@

              SEE ALSO

                     - + diff --git a/deps/npm/html/doc/cli/npm-uninstall.html b/deps/npm/html/doc/cli/npm-uninstall.html index 8763c40adb2922..356ce459740273 100644 --- a/deps/npm/html/doc/cli/npm-uninstall.html +++ b/deps/npm/html/doc/cli/npm-uninstall.html @@ -9,10 +9,11 @@
              -

              npm-rm

              Remove a package

              +

              npm-uninstall

              Remove a package

              SYNOPSIS

              -
              npm uninstall [@<scope>/]<package> [--save|--save-dev|--save-optional]
              -npm rm (with any of the previous argument usage)
              +
              npm uninstall [<@scope>/]<pkg>[@<version>]... [-S|--save|-D|--save-dev|-O|--save-optional]
              +
              +aliases: remove, rm, r, un, unlink
               

              DESCRIPTION

              This uninstalls a package, completely removing everything npm installed on its behalf.

              @@ -23,13 +24,15 @@

              SYNOPSIS

              npm uninstall takes 3 exclusive, optional flags which save or update the package version in your main package.json:

                -
              • --save: Package will be removed from your dependencies.

                +
              • -S, --save: Package will be removed from your dependencies.

              • -
              • --save-dev: Package will be removed from your devDependencies.

                +
              • -D, --save-dev: Package will be removed from your devDependencies.

              • -
              • --save-optional: Package will be removed from your optionalDependencies.

                +
              • -O, --save-optional: Package will be removed from your optionalDependencies.

              +

              Further, if you have an npm-shrinkwrap.json then it will be updated as +well.

              Scope is optional and follows the usual rules for npm-scope(7).

              Examples:

              npm uninstall sax --save
              @@ -57,5 +60,5 @@ 

              SYNOPSIS

                     - + diff --git a/deps/npm/html/doc/cli/npm-unpublish.html b/deps/npm/html/doc/cli/npm-unpublish.html index 667802cd4ccc65..99dd3f3f46b81b 100644 --- a/deps/npm/html/doc/cli/npm-unpublish.html +++ b/deps/npm/html/doc/cli/npm-unpublish.html @@ -11,7 +11,7 @@

              npm-unpublish

              Remove a package from the registry

              SYNOPSIS

              -
              npm unpublish [@<scope>/]<name>[@<version>]
              +
              npm unpublish [<@scope>/]<pkg>[@<version>]
               

              WARNING

              It is generally considered bad behavior to remove versions of a library that others are depending on!

              @@ -47,5 +47,5 @@

              SEE ALSO

                     - + diff --git a/deps/npm/html/doc/cli/npm-update.html b/deps/npm/html/doc/cli/npm-update.html index e08a2c115044b6..e65100ae4db7ab 100644 --- a/deps/npm/html/doc/cli/npm-update.html +++ b/deps/npm/html/doc/cli/npm-update.html @@ -11,7 +11,9 @@

              npm-update

              Update a package

              SYNOPSIS

              -
              npm update [-g] [<name> [<name> ...]]
              +
              npm update [-g] [<pkg>...]
              +
              +aliases: up, upgrade
               

              DESCRIPTION

              This command will update all the packages listed to the latest version (specified by the tag config), respecting semver.

              @@ -24,42 +26,38 @@

              SYNOPSIS

              or local) will be updated.

              As of npm@2.6.1, the npm update will only inspect top-level packages. Prior versions of npm would also recursively inspect all dependencies. -To get the old behavior, use npm --depth 9999 update, but be warned that -simultaneous asynchronous update of all packages, including npm itself -and packages that npm depends on, often causes problems up to and including -the uninstallation of npm itself.

              -

              To restore a missing npm, use the command:

              -
              curl -L https://npmjs.com/install.sh | sh
              -

              EXAMPLES

              +To get the old behavior, use npm --depth 9999 update.

              +

              EXAMPLES

              IMPORTANT VERSION NOTE: these examples assume npm@2.6.1 or later. For older versions of npm, you must specify --depth 0 to get the behavior described below.

              For the examples below, assume that the current package is app and it depends on dependencies, dep1 (dep2, .. etc.). The published versions of dep1 are:

              {
              -  dist-tags: { latest: "1.2.2" },
              -  versions: { "1.2.2",
              -              "1.2.1",
              -              "1.2.0",
              -              "1.1.2",
              -              "1.1.1",
              -              "1.0.0",
              -              "0.4.1",
              -              "0.4.0",
              -              "0.2.0"
              -  }
              +  "dist-tags": { "latest": "1.2.2" },
              +  "versions": [
              +    "1.2.2",
              +    "1.2.1",
              +    "1.2.0",
              +    "1.1.2",
              +    "1.1.1",
              +    "1.0.0",
              +    "0.4.1",
              +    "0.4.0",
              +    "0.2.0"
              +  ]
               }
               

              Caret Dependencies

              If app's package.json contains:

              -
              dependencies: {
              -  dep1: "^1.1.1"
              +
              "dependencies": {
              +  "dep1": "^1.1.1"
               }
               

              Then npm update will install dep1@1.2.2, because 1.2.2 is latest and 1.2.2 satisfies ^1.1.1.

              Tilde Dependencies

              However, if app's package.json contains:

              -
              dependencies: {
              -  dep1: "~1.1.1"
              +
              "dependencies": {
              +  "dep1": "~1.1.1"
               }
               

              In this case, running npm update will install dep1@1.1.2. Even though the latest tag points to 1.2.2, this version does not satisfy ~1.1.1, which is equivalent @@ -67,33 +65,34 @@

              Tilde Dependencies

              which is 1.1.2.

              Caret Dependencies below 1.0.0

              Suppose app has a caret dependency on a version below 1.0.0, for example:

              -
              dependencies: {
              -  dep1: "^0.2.0"
              +
              "dependencies": {
              +  "dep1": "^0.2.0"
               }
               

              npm update will install dep1@0.2.0, because there are no other versions which satisfy ^0.2.0.

              If the dependence were on ^0.4.0:

              -
              dependencies: {
              -  dep1: "^0.4.0"
              +
              "dependencies": {
              +  "dep1": "^0.4.0"
               }
               

              Then npm update will install dep1@0.4.1, because that is the highest-sorting version that satisfies ^0.4.0 (>= 0.4.0 <0.5.0)

              Recording Updates with --save

              When you want to update a package and save the new version as the minimum required dependency in package.json, you can use -npm update --save. For example if package.json contains

              -
              dependencies: {
              -  dep1: "^1.1.1"
              +npm update -S or npm update --save.  For example if
              +package.json contains:

              +
              "dependencies": {
              +  "dep1": "^1.1.1"
               }
               

              Then npm update --save will install dep1@1.2.2 (i.e., latest), and package.json will be modified:

              -
              dependencies: {
              -  dep1: "^1.2.2"
              +
              "dependencies": {
              +  "dep1": "^1.2.2"
               }
               

              Note that npm will only write an updated version to package.json if it installs a new package.

              Updating Globally-Installed Packages

              -

              npm update -g will apply the update action to each globally- installed +

              npm update -g will apply the update action to each globally installed package that is outdated -- that is, has a version that is different from latest.

              NOTE: If a package has been upgraded to a version newer than latest, it will @@ -119,5 +118,5 @@

              SEE ALSO

                     - + diff --git a/deps/npm/html/doc/cli/npm-version.html b/deps/npm/html/doc/cli/npm-version.html index 34bb9c956bb89a..cb507e606e1acd 100644 --- a/deps/npm/html/doc/cli/npm-version.html +++ b/deps/npm/html/doc/cli/npm-version.html @@ -11,20 +11,25 @@

              npm-version

              Bump a package version

              SYNOPSIS

              -
              npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease]
              +
              npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git]
              +
              +'npm [-v | --version]' to print npm version
              +'npm view <pkg> version' to view a package's published version
              +'npm ls' to inspect current package/dependency versions
               

              DESCRIPTION

              Run this in a package directory to bump the version and write the new data back to package.json and, if present, npm-shrinkwrap.json.

              -

              The newversion argument should be a valid semver string, or a -valid second argument to semver.inc (one of patch, minor, major, -prepatch, preminor, premajor, prerelease). In the second case, -the existing version will be incremented by 1 in the specified field.

              +

              The newversion argument should be a valid semver string, a +valid second argument to semver.inc (one of patch, minor, major, +prepatch, preminor, premajor, prerelease), or from-git. In the second case, +the existing version will be incremented by 1 in the specified field. +from-git will try to read the latest git tag, and use that as the new npm version.

              If run in a git repo, it will also create a version commit and tag. This behavior is controlled by git-tag-version (see below), and can be disabled on the command line by running npm --no-git-tag-version version. -It will fail if the working directory is not clean, unless the --force -flag is set.

              -

              If supplied with --message (shorthand: -m) config option, npm will +It will fail if the working directory is not clean, unless the -f or +--force flag is set.

              +

              If supplied with -m or --message config option, npm will use it as a commit message when creating a version commit. If the message config contains %s then that will be replaced with the resulting version number. For example:

              @@ -50,7 +55,7 @@

              SYNOPSIS

            • Run the preversion script. These scripts have access to the old version in package.json. A typical use would be running your full test suite before deploying. Any files you want added to the commit should be explicitly added using git add.
            • -
            • Bump version in package.json as requested (patch, minor, major, etc).
            • +
            • Bump version in package.json as requested (patch, minor, major, etc).
            • Run the version script. These scripts have access to the new version in package.json (so they can incorporate it into file headers in generated files for example). Again, scripts should explicitly add generated files to the commit using git add.
            • @@ -95,5 +100,5 @@

              SEE ALSO

                     - + diff --git a/deps/npm/html/doc/cli/npm-view.html b/deps/npm/html/doc/cli/npm-view.html index 930a299af6e1ea..971bfceec72d95 100644 --- a/deps/npm/html/doc/cli/npm-view.html +++ b/deps/npm/html/doc/cli/npm-view.html @@ -11,8 +11,9 @@

              npm-view

              View registry info

              SYNOPSIS

              -
              npm view [@<scope>/]<name>[@<version>] [<field>[.<subfield>]...]
              -npm v [@<scope>/]<name>[@<version>] [<field>[.<subfield>]...]
              +
              npm view [<@scope>/]<name>[@<version>] [<field>[.<subfield>]...]
              +
              +aliases: info, show, v
               

              DESCRIPTION

              This command shows data about a package and prints it to the stream referenced by the outfd config, which defaults to stdout.

              @@ -41,7 +42,7 @@

              SYNOPSIS

              contributor in the list, you can do this:

              npm view express contributors[0].email
               

              Multiple fields may be specified, and will be printed one after another. -For exampls, to get all the contributor names and email addresses, you +For example, to get all the contributor names and email addresses, you can do this:

              npm view express contributors.name contributors.email
               

              "Person" fields are shown as a string if they would be shown as an @@ -52,6 +53,9 @@

              SYNOPSIS

              matching version of the package. This will show which version of jsdom was required by each matching version of yui3:

              npm view yui3@'>0.5.4' dependencies.jsdom
              +

              To show the connect package version history, you can do +this:

              +
              npm view connect versions
               

              OUTPUT

              If only a single string field for a single version is output, then it will not be colorized or quoted, so as to enable piping the output to @@ -82,5 +86,5 @@

              SEE ALSO

                     - + diff --git a/deps/npm/html/doc/cli/npm-whoami.html b/deps/npm/html/doc/cli/npm-whoami.html index 1f25215aeb5a46..93c9802e08ec5e 100644 --- a/deps/npm/html/doc/cli/npm-whoami.html +++ b/deps/npm/html/doc/cli/npm-whoami.html @@ -11,7 +11,7 @@

              npm-whoami

              Display npm username

              SYNOPSIS

              -
              npm whoami
              +
              npm whoami [--registry <registry>]
               

              DESCRIPTION

              Print the username config to standard output.

              SEE ALSO

              @@ -33,5 +33,5 @@

              SEE ALSO

                     - + diff --git a/deps/npm/html/doc/cli/npm.html b/deps/npm/html/doc/cli/npm.html index 9fd4df9b2d30c4..d8cc90c8371b1e 100644 --- a/deps/npm/html/doc/cli/npm.html +++ b/deps/npm/html/doc/cli/npm.html @@ -13,7 +13,7 @@

              npm

              javascript package manager

              SYNOPSIS

              npm <command> [args]
               

              VERSION

              -

              2.14.7

              +

              3.8.6

              DESCRIPTION

              npm is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and manages dependency @@ -51,7 +51,7 @@

              DIRECTORIES

              defaults to the current working directory. Packages are installed to ./node_modules, and bins are installed to ./node_modules/.bin.
            -

            Local mode is the default. Use --global or -g on any command to +

            Local mode is the default. Use -g or --global on any command to operate in global mode instead.

            DEVELOPER USAGE

            If you're using npm to develop and publish your code, check out the @@ -106,19 +106,17 @@

            CONTRIBUTIONS

          Contributors are listed in npm's package.json file. You can view them easily by doing npm view npm contributors.

          -

          If you would like to contribute, but don't know what to work on, check -the issues list or ask on the mailing list.

          +

          If you would like to contribute, but don't know what to work on, read +the contributing guidelines and check the issues list.

          BUGS

          When you find issues, please report them:

          Be sure to include all of the output from the npm command that didn't work as expected. The npm-debug.log file is also helpful to provide.

          @@ -128,11 +126,10 @@

          AUTHOR

          Isaac Z. Schlueter :: isaacs :: @izs :: -i@izs.me

          +i@izs.me

          SEE ALSO

          @@ -154,5 +150,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/files/npm-folders.html b/deps/npm/html/doc/files/npm-folders.html index 71ac40170d7b67..6bb853addc7f8d 100644 --- a/deps/npm/html/doc/files/npm-folders.html +++ b/deps/npm/html/doc/files/npm-folders.html @@ -25,11 +25,10 @@

          tl;dr

        prefix Configuration

        The prefix config defaults to the location where node is installed. -On most systems, this is /usr/local, and most of the time is the same -as node's process.installPrefix.

        -

        On windows, this is the exact location of the node.exe binary. On Unix -systems, it's one level up, since node is typically installed at -{prefix}/bin/node rather than {prefix}/node.exe.

        +On most systems, this is /usr/local. On windows, this is the exact +location of the node.exe binary. On Unix systems, it's one level up, +since node is typically installed at {prefix}/bin/node rather than +{prefix}/node.exe.

        When the global flag is set, npm installs things into this prefix. When it is not set, it uses the root of the current package, or the current working directory if not in a package already.

        @@ -44,7 +43,7 @@

        Node Modules

        Scoped packages are installed the same way, except they are grouped together in a sub-folder of the relevant node_modules folder with the name of that scope prefix by the @ symbol, e.g. npm install @myorg/package would place -the package in {prefix}/node_modules/@myorg/package. See scopes(7) for +the package in {prefix}/node_modules/@myorg/package. See scope(7) for more details.

        If you wish to require() a package, then install it locally.

        Executables

        @@ -162,7 +161,6 @@

        Publishing

        cannot be found elsewhere. See package.json(5) for more information.

        SEE ALSO

          -
        • npm-faq(7)
        • package.json(5)
        • npm-install(1)
        • npm-pack(1)
        • @@ -184,5 +182,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/files/npm-global.html b/deps/npm/html/doc/files/npm-global.html index 71ac40170d7b67..6bb853addc7f8d 100644 --- a/deps/npm/html/doc/files/npm-global.html +++ b/deps/npm/html/doc/files/npm-global.html @@ -25,11 +25,10 @@

          tl;dr

        prefix Configuration

        The prefix config defaults to the location where node is installed. -On most systems, this is /usr/local, and most of the time is the same -as node's process.installPrefix.

        -

        On windows, this is the exact location of the node.exe binary. On Unix -systems, it's one level up, since node is typically installed at -{prefix}/bin/node rather than {prefix}/node.exe.

        +On most systems, this is /usr/local. On windows, this is the exact +location of the node.exe binary. On Unix systems, it's one level up, +since node is typically installed at {prefix}/bin/node rather than +{prefix}/node.exe.

        When the global flag is set, npm installs things into this prefix. When it is not set, it uses the root of the current package, or the current working directory if not in a package already.

        @@ -44,7 +43,7 @@

        Node Modules

        Scoped packages are installed the same way, except they are grouped together in a sub-folder of the relevant node_modules folder with the name of that scope prefix by the @ symbol, e.g. npm install @myorg/package would place -the package in {prefix}/node_modules/@myorg/package. See scopes(7) for +the package in {prefix}/node_modules/@myorg/package. See scope(7) for more details.

        If you wish to require() a package, then install it locally.

        Executables

        @@ -162,7 +161,6 @@

        Publishing

        cannot be found elsewhere. See package.json(5) for more information.

        SEE ALSO

          -
        • npm-faq(7)
        • package.json(5)
        • npm-install(1)
        • npm-pack(1)
        • @@ -184,5 +182,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/files/npm-json.html b/deps/npm/html/doc/files/npm-json.html index 9fecd63fa7865d..d9b6382b8d12c2 100644 --- a/deps/npm/html/doc/files/npm-json.html +++ b/deps/npm/html/doc/files/npm-json.html @@ -24,7 +24,7 @@

          name

          The name is what your thing is called.

          Some rules:

            -
          • The name must be shorter than 214 characters. This includes the scope for +
          • The name must be less than or equal to 214 characters. This includes the scope for scoped packages.
          • The name can't start with a dot or an underscore.
          • New packages must not have uppercase letters in the name.
          • @@ -85,12 +85,12 @@

            license

            { "license" : "BSD-3-Clause" }
             

            You can check the full list of SPDX license IDs. Ideally you should pick one that is -OSI approved.

            -

            If your package is licensed under multiple common licenses, use an SPDX license +OSI approved.

            +

            If your package is licensed under multiple common licenses, use an SPDX license expression syntax version 2.0 string, like this:

            { "license" : "(ISC OR GPL-3.0)" }
             

            If you are using a license that hasn't been assigned an SPDX identifier, or if -you are using a custom license, use the following valid SPDX expression:

            +you are using a custom license, use a string value like this one:

            { "license" : "SEE LICENSE IN <filename>" }
             

            Then include a file named <filename> at the top level of the package.

            Some old packages used license objects or a "licenses" property containing an @@ -143,10 +143,12 @@

            files

            Certain files are always included, regardless of settings:

            • package.json
            • -
            • README (and its variants)
            • -
            • CHANGELOG (and its variants)
            • +
            • README
            • +
            • CHANGES / CHANGELOG / HISTORY
            • LICENSE / LICENCE
            • +
            • The file in the "main" field
            +

            README, CHANGES & LICENSE can have any case and extension.

            Conversely, some files are always ignored:

            • .git
            • @@ -155,10 +157,12 @@

              files

            • .hg
            • .lock-wscript
            • .wafpickle-N
            • -
            • *.swp
            • +
            • .*.swp
            • .DS_Store
            • ._*
            • npm-debug.log
            • +
            • .npmrc
            • +
            • node_modules

            main

            The main field is a module ID that is the primary entry point to your program. @@ -242,6 +246,9 @@

            directories.doc

            maybe, someday.

            directories.example

            Put example scripts in here. Someday, it might be exposed in some clever way.

            +

            directories.test

            +

            Put your tests in here. It is currently not exposed, but it might be in the +future.

            repository

            Specify the place where your code lives. This is helpful for people who want to contribute. If the git repo is on GitHub, then the npm docs @@ -309,7 +316,7 @@

            dependencies

          • git... See 'Git URLs as Dependencies' below
          • user/repo See 'GitHub URLs' below
          • tag A specific version tagged and published as tag See npm-tag(1)
          • -
          • path/path/path See Local Paths below
          • +
          • path/path/path See Local Paths below

          For example, these are all valid:

          { "dependencies" :
          @@ -354,8 +361,8 @@ 

          GitHub URLs

          }

          Local Paths

          As of version 2.0.0 you can provide a path to a local directory that contains a -package. Local paths can be saved using npm install --save, using any of -these forms:

          +package. Local paths can be saved using npm install -S or +npm install --save, using any of these forms:

          ../foo/bar
           ~/foo/bar
           ./foo/bar
          @@ -432,7 +439,25 @@ 

          peerDependencies

          with every 1.x version of the host package, use "^1.0" or "1.x" to express this. If you depend on features introduced in 1.5.2, use ">= 1.5.2 < 2".

          bundledDependencies

          -

          Array of package names that will be bundled when publishing the package.

          +

          This defines an array of package names that will be bundled when publishing +the package.

          +

          In cases where you need to preserve npm packages locally or have them +available through a single file download, you can bundle the packages in a +tarball file by specifying the package names in the bundledDependencies +array and executing npm pack.

          +

          For example:

          +

          If we define a package.json like this:

          +
          {
          +  "name": "awesome-web-framework",
          +  "version": "1.0.0",
          +  "bundledDependencies": [
          +    'renderized', 'super-streams'
          +  ]
          +}
          +

          we can obtain awesome-web-framework-1.0.0.tgz file by running npm pack. +This file contains the dependencies renderized and super-streams which +can be installed in a new project by executing npm install +awesome-web-framework-1.0.0.tgz.

          If this is spelled "bundleDependencies", then that is also honored.

          optionalDependencies

          If a dependency can be used, but you would like npm to proceed if it cannot be @@ -470,18 +495,12 @@

          engines

          You can also use the "engines" field to specify which versions of npm are capable of properly installing your program. For example:

          { "engines" : { "npm" : "~1.0.20" } }
          -

          Note that, unless the user has set the engine-strict config flag, this -field is advisory only.

          +

          Unless the user has set the engine-strict config flag, this +field is advisory only will produce warnings when your package is installed as a dependency.

          engineStrict

          -

          NOTE: This feature is deprecated and will be removed in npm 3.0.0.

          -

          If you are sure that your module will definitely not run properly on -versions of Node/npm other than those specified in the engines object, -then you can set "engineStrict": true in your package.json file. -This will override the user's engine-strict config setting.

          -

          Please do not do this unless you are really very very sure. If your -engines object is something overly restrictive, you can quite easily and -inadvertently lock yourself into obscurity and prevent your users from -updating to new versions of Node. Consider this choice carefully.

          +

          This feature was deprecated with npm 3.0.0

          +

          Prior to npm 3.0.0, this feature was used to treat this package as if the +user had set engine-strict.

          os

          You can specify which operating systems your module will run on:

          @@ -548,10 +567,9 @@

          SEE ALSO

        • npm-config(1)
        • npm-config(7)
        • npm-help(1)
        • -
        • npm-faq(7)
        • npm-install(1)
        • npm-publish(1)
        • -
        • npm-rm(1)
        • +
        • npm-uninstall(1)
        @@ -565,5 +583,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/files/npmrc.html b/deps/npm/html/doc/files/npmrc.html index 01a596ff22fc8e..8c4b88bb7ddc87 100644 --- a/deps/npm/html/doc/files/npmrc.html +++ b/deps/npm/html/doc/files/npmrc.html @@ -83,5 +83,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/files/package.json.html b/deps/npm/html/doc/files/package.json.html index 9fecd63fa7865d..d9b6382b8d12c2 100644 --- a/deps/npm/html/doc/files/package.json.html +++ b/deps/npm/html/doc/files/package.json.html @@ -24,7 +24,7 @@

        name

        The name is what your thing is called.

        Some rules:

          -
        • The name must be shorter than 214 characters. This includes the scope for +
        • The name must be less than or equal to 214 characters. This includes the scope for scoped packages.
        • The name can't start with a dot or an underscore.
        • New packages must not have uppercase letters in the name.
        • @@ -85,12 +85,12 @@

          license

          { "license" : "BSD-3-Clause" }
           

          You can check the full list of SPDX license IDs. Ideally you should pick one that is -OSI approved.

          -

          If your package is licensed under multiple common licenses, use an SPDX license +OSI approved.

          +

          If your package is licensed under multiple common licenses, use an SPDX license expression syntax version 2.0 string, like this:

          { "license" : "(ISC OR GPL-3.0)" }
           

          If you are using a license that hasn't been assigned an SPDX identifier, or if -you are using a custom license, use the following valid SPDX expression:

          +you are using a custom license, use a string value like this one:

          { "license" : "SEE LICENSE IN <filename>" }
           

          Then include a file named <filename> at the top level of the package.

          Some old packages used license objects or a "licenses" property containing an @@ -143,10 +143,12 @@

          files

          Certain files are always included, regardless of settings:

          • package.json
          • -
          • README (and its variants)
          • -
          • CHANGELOG (and its variants)
          • +
          • README
          • +
          • CHANGES / CHANGELOG / HISTORY
          • LICENSE / LICENCE
          • +
          • The file in the "main" field
          +

          README, CHANGES & LICENSE can have any case and extension.

          Conversely, some files are always ignored:

          • .git
          • @@ -155,10 +157,12 @@

            files

          • .hg
          • .lock-wscript
          • .wafpickle-N
          • -
          • *.swp
          • +
          • .*.swp
          • .DS_Store
          • ._*
          • npm-debug.log
          • +
          • .npmrc
          • +
          • node_modules

          main

          The main field is a module ID that is the primary entry point to your program. @@ -242,6 +246,9 @@

          directories.doc

          maybe, someday.

          directories.example

          Put example scripts in here. Someday, it might be exposed in some clever way.

          +

          directories.test

          +

          Put your tests in here. It is currently not exposed, but it might be in the +future.

          repository

          Specify the place where your code lives. This is helpful for people who want to contribute. If the git repo is on GitHub, then the npm docs @@ -309,7 +316,7 @@

          dependencies

        • git... See 'Git URLs as Dependencies' below
        • user/repo See 'GitHub URLs' below
        • tag A specific version tagged and published as tag See npm-tag(1)
        • -
        • path/path/path See Local Paths below
        • +
        • path/path/path See Local Paths below

        For example, these are all valid:

        { "dependencies" :
        @@ -354,8 +361,8 @@ 

        GitHub URLs

        }

        Local Paths

        As of version 2.0.0 you can provide a path to a local directory that contains a -package. Local paths can be saved using npm install --save, using any of -these forms:

        +package. Local paths can be saved using npm install -S or +npm install --save, using any of these forms:

        ../foo/bar
         ~/foo/bar
         ./foo/bar
        @@ -432,7 +439,25 @@ 

        peerDependencies

        with every 1.x version of the host package, use "^1.0" or "1.x" to express this. If you depend on features introduced in 1.5.2, use ">= 1.5.2 < 2".

        bundledDependencies

        -

        Array of package names that will be bundled when publishing the package.

        +

        This defines an array of package names that will be bundled when publishing +the package.

        +

        In cases where you need to preserve npm packages locally or have them +available through a single file download, you can bundle the packages in a +tarball file by specifying the package names in the bundledDependencies +array and executing npm pack.

        +

        For example:

        +

        If we define a package.json like this:

        +
        {
        +  "name": "awesome-web-framework",
        +  "version": "1.0.0",
        +  "bundledDependencies": [
        +    'renderized', 'super-streams'
        +  ]
        +}
        +

        we can obtain awesome-web-framework-1.0.0.tgz file by running npm pack. +This file contains the dependencies renderized and super-streams which +can be installed in a new project by executing npm install +awesome-web-framework-1.0.0.tgz.

        If this is spelled "bundleDependencies", then that is also honored.

        optionalDependencies

        If a dependency can be used, but you would like npm to proceed if it cannot be @@ -470,18 +495,12 @@

        engines

        You can also use the "engines" field to specify which versions of npm are capable of properly installing your program. For example:

        { "engines" : { "npm" : "~1.0.20" } }
        -

        Note that, unless the user has set the engine-strict config flag, this -field is advisory only.

        +

        Unless the user has set the engine-strict config flag, this +field is advisory only will produce warnings when your package is installed as a dependency.

        engineStrict

        -

        NOTE: This feature is deprecated and will be removed in npm 3.0.0.

        -

        If you are sure that your module will definitely not run properly on -versions of Node/npm other than those specified in the engines object, -then you can set "engineStrict": true in your package.json file. -This will override the user's engine-strict config setting.

        -

        Please do not do this unless you are really very very sure. If your -engines object is something overly restrictive, you can quite easily and -inadvertently lock yourself into obscurity and prevent your users from -updating to new versions of Node. Consider this choice carefully.

        +

        This feature was deprecated with npm 3.0.0

        +

        Prior to npm 3.0.0, this feature was used to treat this package as if the +user had set engine-strict.

        os

        You can specify which operating systems your module will run on:

        @@ -548,10 +567,9 @@

        SEE ALSO

      • npm-config(1)
      • npm-config(7)
      • npm-help(1)
      • -
      • npm-faq(7)
      • npm-install(1)
      • npm-publish(1)
      • -
      • npm-rm(1)
      • +
      • npm-uninstall(1)
      @@ -565,5 +583,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/index.html b/deps/npm/html/doc/index.html index 7cc68acd4a8cb0..914559250a9278 100644 --- a/deps/npm/html/doc/index.html +++ b/deps/npm/html/doc/index.html @@ -52,6 +52,8 @@

      npm-help(1)

      Get help on npm

      npm-init(1)

      Interactively create a package.json file

      +

      npm-install-test(1)

      +

      Install package(s) and run tests

      npm-install(1)

      Install a package

      @@ -80,8 +82,6 @@

      npm-repo(1)

      Open package repository page in the browser

      npm-restart(1)

      Restart a package

      -

      npm-rm(1)

      -

      Remove a package

      npm-root(1)

      Display npm root

      npm-run-script(1)

      @@ -118,86 +118,6 @@

      npm-whoami(1)

      Display npm username

      API Documentation

      Using npm in your Node programs

      -

      npm(3)

      -

      javascript package manager

      -

      npm-bin(3)

      -

      Display npm bin folder

      -

      npm-bugs(3)

      -

      Bugs for a package in a web browser maybe

      -

      npm-cache(3)

      -

      manage the npm cache programmatically

      -

      npm-commands(3)

      -

      npm commands

      -

      npm-config(3)

      -

      Manage the npm configuration files

      -

      npm-deprecate(3)

      -

      Deprecate a version of a package

      -

      npm-docs(3)

      -

      Docs for a package in a web browser maybe

      -

      npm-edit(3)

      -

      Edit an installed package

      -

      npm-explore(3)

      -

      Browse an installed package

      -

      npm-help-search(3)

      -

      Search the help pages

      -

      npm-init(3)

      -

      Interactively create a package.json file

      -

      npm-install(3)

      -

      install a package programmatically

      - -

      Symlink a package folder

      -

      npm-load(3)

      -

      Load config settings

      -

      npm-ls(3)

      -

      List installed packages

      -

      npm-outdated(3)

      -

      Check for outdated packages

      -

      npm-owner(3)

      -

      Manage package owners

      -

      npm-pack(3)

      -

      Create a tarball from a package

      -

      npm-ping(3)

      -

      Ping npm registry

      -

      npm-prefix(3)

      -

      Display prefix

      -

      npm-prune(3)

      -

      Remove extraneous packages

      -

      npm-publish(3)

      -

      Publish a package

      -

      npm-rebuild(3)

      -

      Rebuild a package

      -

      npm-repo(3)

      -

      Open package repository page in the browser

      -

      npm-restart(3)

      -

      Restart a package

      -

      npm-root(3)

      -

      Display npm root

      -

      npm-run-script(3)

      -

      Run arbitrary package scripts

      -

      npm-search(3)

      -

      Search for packages

      -

      npm-shrinkwrap(3)

      -

      programmatically generate package shrinkwrap file

      -

      npm-start(3)

      -

      Start a package

      -

      npm-stop(3)

      -

      Stop a package

      -

      npm-tag(3)

      -

      Tag a published version

      -

      npm-test(3)

      -

      Test a package

      -

      npm-uninstall(3)

      -

      uninstall a package programmatically

      -

      npm-unpublish(3)

      -

      Remove a package from the registry

      -

      npm-update(3)

      -

      Update a package

      -

      npm-version(3)

      -

      Bump a package version

      -

      npm-view(3)

      -

      View registry info

      -

      npm-whoami(3)

      -

      Display npm username

      Files

      File system structures npm uses

      npm-folders(5)

      @@ -216,8 +136,6 @@

      npm-developers(7)<

      Developer Guide

      npm-disputes(7)

      Handling Module Name Disputes

      -

      npm-faq(7)

      -

      Frequently Asked Questions

      npm-index(7)

      Index of all npm documentation

      npm-orgs(7)

      @@ -244,5 +162,5 @@

      semver(7)

             - + diff --git a/deps/npm/html/doc/misc/npm-coding-style.html b/deps/npm/html/doc/misc/npm-coding-style.html index ac3c95c105c933..f449d709ae4493 100644 --- a/deps/npm/html/doc/misc/npm-coding-style.html +++ b/deps/npm/html/doc/misc/npm-coding-style.html @@ -49,7 +49,7 @@

      Curly braces

    • for (;;) loops. They're actually required.
    • null loops like: while (something) ; (But you'd better have a good reason for doing that.)
    • -
    • case "foo": doSomething(); break
    • +
    • case 'foo': doSomething(); break
    • In front of a leading ( or [ at the start of the line. This prevents the expression from being interpreted as a function call or property access, respectively.
    • @@ -59,9 +59,9 @@

      Curly braces

      ;[a, b, c].forEach(doSomething) for (var i = 0; i < 10; i ++) { switch (state) { - case "begin": start(); continue - case "end": finish(); break - default: throw new Error("unknown state") + case 'begin': start(); continue + case 'end': finish(); break + default: throw new Error('unknown state') } end() } @@ -72,17 +72,24 @@

      Comma First

      across multiple lines, put the comma at the start of the next line, directly below the token that starts the list. Put the final token in the list on a line by itself. For example:

      -
      var magicWords = [ "abracadabra"
      -                 , "gesundheit"
      -                 , "ventrilo"
      +
      var magicWords = [ 'abracadabra'
      +                 , 'gesundheit'
      +                 , 'ventrilo'
                        ]
      -  , spells = { "fireball" : function () { setOnFire() }
      -             , "water" : function () { putOut() }
      +  , spells = { 'fireball' : function () { setOnFire() }
      +             , 'water' : function () { putOut() }
                    }
         , a = 1
      -  , b = "abc"
      +  , b = 'abc'
         , etc
         , somethingElse
      +

      Quotes

      +

      Use single quotes for strings except to avoid escaping.

      +

      Bad:

      +
      var notOk = "Just double quotes"
      +

      Good:

      +
      var ok = 'String contains "double" quotes'
      +var alsoOk = "String contains 'single' quotes or apostrophe"
       

      Whitespace

      Put a single space in front of ( for anything other than a function call. Also use a single space wherever it makes things more readable.

      @@ -132,7 +139,6 @@

      null, undefined, false, 0

      SEE ALSO

      @@ -147,5 +153,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/misc/npm-config.html b/deps/npm/html/doc/misc/npm-config.html index 0fd36894c9d06f..d972c27946a1e8 100644 --- a/deps/npm/html/doc/misc/npm-config.html +++ b/deps/npm/html/doc/misc/npm-config.html @@ -30,13 +30,13 @@

      npmrc Files

      • per-project config file (/path/to/my/project/.npmrc)
      • per-user config file (~/.npmrc)
      • -
      • global config file ($PREFIX/npmrc)
      • +
      • global config file ($PREFIX/etc/npmrc)
      • npm builtin config file (/path/to/npm/npmrc)

      See npmrc(5) for more details.

      Default Configs

      -

      A set of configuration parameters that are internal to npm, and are -defaults if nothing else is specified.

      +

      Run npm config ls -l to see a set of configuration parameters that are +internal to npm, and are defaults if nothing else is specified.

      Shorthands and Other CLI Niceties

      The following shorthands are parsed on the command-line:

        @@ -107,6 +107,13 @@

        always-auth

      Force npm to always require authentication when accessing the registry, even for GET requests.

      +

      also

      +
        +
      • Default: null
      • +
      • Type: String
      • +
      +

      When "dev" or "development" and running local npm shrinkwrap, +npm outdated, or npm update, is an alias for --dev.

      • Default: true
      • @@ -196,7 +203,7 @@

        cert

        A client certificate to pass when accessing the registry.

        color

          -
        • Default: true on Posix, false on Windows
        • +
        • Default: true
        • Type: Boolean or "always"

        If false, never shows colors. If "always" then always shows colors. @@ -226,6 +233,16 @@

        dev

        Install dev-dependencies along with packages.

        Note that dev-dependencies are also installed if the npat flag is set.

        +

        dry-run

        +
          +
        • Default: false
        • +
        • Type: Boolean
        • +
        +

        Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, install, update, +dedupe, uninstall. This is NOT currently honored by network related +commands, eg dist-tags, owner, publish, etc.

        editor

        • Default: EDITOR environment variable if set, or "vi" on Posix, @@ -315,6 +332,17 @@

          globalconfig

        • Type: path

        The config file to read for global config options.

        +

        global-style

        +
          +
        • Default: false
        • +
        • Type: Boolean
        • +
        +

        Causes npm to install the package into your local node_modules folder with +the same layout it uses with the global node_modules folder. Only your +direct dependencies will show in node_modules and everything they depend +on will be flattened in their node_modules folders. This obviously will +eliminate some deduping. If used with legacy-bundling, legacy-bundling will be +preferred.

        group

        • Default: GID of the current process
        • @@ -407,6 +435,15 @@

          key

        • Type: String

        A client key to pass when accessing the registry.

        +

        legacy-bundling

        +
          +
        • Default: false
        • +
        • Type: Boolean
        • +
        +

        Causes npm to install the package such that versions of npm prior to 1.4, +such as the one included with node 0.8, can install the package. This +eliminates all automatic deduping. If used with global-style this option +will be preferred.

        • Default: false
        • @@ -457,6 +494,13 @@

          long

        • Type: Boolean

        Show extended information in npm ls and npm search.

        +

        maxsockets

        +
          +
        • Default: 50
        • +
        • Type: Number
        • +
        +

        The maximum number of connections to use per origin (protocol/host/port +combination). Passed to the http Agent used to make the request.

        message

        • Default: "%s"
        • @@ -483,6 +527,20 @@

          onload-script

        A node module to require() when npm loads. Useful for programmatic usage.

        +

        only

        +
          +
        • Default: null
        • +
        • Type: String
        • +
        +

        When "dev" or "development" and running local npm install without any +arguments, only devDependencies (and their dependencies) are installed.

        +

        When "dev" or "development" and running local npm ls, npm outdated, or +npm update, is an alias for --dev.

        +

        When "prod" or "production" and running local npm install without any +arguments, only non-devDependencies (and their dependencies) are +installed.

        +

        When "prod" or "production" and running local npm ls, npm outdated, or +npm update, is an alias for --production.

        optional

        • Default: true
        • @@ -516,6 +574,14 @@

          production

          local npm install without any arguments.
        • Set the NODE_ENV="production" for lifecycle scripts.
        • +

          progress

          +
            +
          • Default: true
          • +
          • Type: Boolean
          • +
          +

          When set to true, npm will display a progress bar during time intensive +operations, if process.stderr is a TTY.

          +

          Set to false to suppress the progress bar.

          proprietary-attribs

          • Default: true
          • @@ -663,15 +729,6 @@

            sign-git-tag

            using -s to add a signature.

            Note that git requires you to have set up GPG keys in your git configs for this to work properly.

            -

            spin

            -
              -
            • Default: true
            • -
            • Type: Boolean or "always"
            • -
            -

            When set to true, npm will display an ascii spinner while it is doing -things, if process.stderr is a TTY.

            -

            Set to false to suppress the spinner, or set to always to output -the spinner even for non-TTY outputs.

            strict-ssl

            • Default: true
            • @@ -709,7 +766,7 @@

              tmp

              on success, but left behind on failure for forensic purposes.

              unicode

                -
              • Default: true
              • +
              • Default: false on windows, true on mac/unix systems with a unicode locale
              • Type: Boolean

              When set to true, npm uses unicode characters in the tree output. When @@ -799,5 +856,5 @@

              SEE ALSO

                     - + diff --git a/deps/npm/html/doc/misc/npm-developers.html b/deps/npm/html/doc/misc/npm-developers.html index 03d1a8eda0d1c0..77bf7fc0dacb41 100644 --- a/deps/npm/html/doc/misc/npm-developers.html +++ b/deps/npm/html/doc/misc/npm-developers.html @@ -96,7 +96,7 @@

              Keeping files out of your pa create an empty .npmignore file to override it. Like git, npm looks for .npmignore and .gitignore files in all subdirectories of your package, not only the root directory.

              -

              .npmignore files follow the same pattern rules +

              .npmignore files follow the same pattern rules as .gitignore files:

              • Blank lines or lines starting with # are ignored.
              • @@ -161,7 +161,7 @@

                Create a User Account

      and then follow the prompts.

      This is documented better in npm-adduser(1).

      Publish your package

      -

      This part's easy. IN the root of your folder, do this:

      +

      This part's easy. In the root of your folder, do this:

      npm publish
       

      You can give publish a url to a tarball, or a filename of a tarball, or a path to a folder.

      @@ -174,7 +174,6 @@

      Brag about it

      Tell the world how easy it is to install your program!

      SEE ALSO

        -
      • npm-faq(7)
      • npm(1)
      • npm-init(1)
      • package.json(5)
      • @@ -195,5 +194,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/misc/npm-disputes.html b/deps/npm/html/doc/misc/npm-disputes.html index cf739f6b1c5e80..5bc80740136d1e 100644 --- a/deps/npm/html/doc/misc/npm-disputes.html +++ b/deps/npm/html/doc/misc/npm-disputes.html @@ -13,7 +13,7 @@

        npm-disputes

        Handling Module

        SYNOPSIS

        1. Get the author email with npm owner ls <pkgname>
        2. -
        3. Email the author, CC support@npmjs.com
        4. +
        5. Email the author, CC support@npmjs.com
        6. After a few weeks, if there's no resolution, we'll sort it out.

        Don't squat on package names. Publish code or move out of the way.

        @@ -51,12 +51,12 @@

        DESCRIPTION

        owner (Bob).
      • Joe emails Bob, explaining the situation as respectfully as possible, and what he would like to do with the module name. He -adds the npm support staff support@npmjs.com to the CC list of +adds the npm support staff support@npmjs.com to the CC list of the email. Mention in the email that Bob can run npm owner add joe foo to add Joe as an owner of the foo package.
      • After a reasonable amount of time, if Bob has not responded, or if Bob and Joe can't come to any sort of resolution, email support -support@npmjs.com and we'll sort it out. ("Reasonable" is +support@npmjs.com and we'll sort it out. ("Reasonable" is usually at least 4 weeks, but extra time is allowed around common holidays.)
      • @@ -112,5 +112,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/misc/npm-faq.html b/deps/npm/html/doc/misc/npm-faq.html deleted file mode 100644 index eb017f3001274c..00000000000000 --- a/deps/npm/html/doc/misc/npm-faq.html +++ /dev/null @@ -1,312 +0,0 @@ - - - npm-faq - - - - - - -
        - -

        npm-faq

        Frequently Asked Questions

        -

        Where can I find these docs in HTML?

        -

        https://docs.npmjs.com/, or run:

        -
        npm config set viewer browser
        -

        to open these documents in your default web browser rather than man.

        -

        It didn't work.

        -

        That's not really a question.

        -

        Why didn't it work?

        -

        I don't know yet.

        -

        Read the error output, and if you can't figure out what it means, -do what it says and post a bug with all the information it asks for.

        -

        Where does npm put stuff?

        -

        See npm-folders(5)

        -

        tl;dr:

        -
          -
        • Use the npm root command to see where modules go, and the npm bin -command to see where executables go
        • -
        • Global installs are different from local installs. If you install -something with the -g flag, then its executables go in npm bin -g -and its modules go in npm root -g.
        • -
        -

        How do I install something on my computer in a central location?

        -

        Install it globally by tacking -g or --global to the command. (This -is especially important for command line utilities that need to add -their bins to the global system PATH.)

        -

        I installed something globally, but I can't require() it

        -

        Install it locally.

        -

        The global install location is a place for command-line utilities -to put their bins in the system PATH. It's not for use with require().

        -

        If you require() a module in your code, then that means it's a -dependency, and a part of your program. You need to install it locally -in your program.

        -

        Why can't npm just put everything in one place, like other package managers?

        -

        Not every change is an improvement, but every improvement is a change. -This would be like asking git to do network IO for every commit. It's -not going to happen, because it's a terrible idea that causes more -problems than it solves.

        -

        It is much harder to avoid dependency conflicts without nesting -dependencies. This is fundamental to the way that npm works, and has -proven to be an extremely successful approach. See npm-folders(5) for -more details.

        -

        If you want a package to be installed in one place, and have all your -programs reference the same copy of it, then use the npm link command. -That's what it's for. Install it globally, then link it into each -program that uses it.

        -

        Whatever, I really want the old style 'everything global' style.

        -

        Write your own package manager. You could probably even wrap up npm -in a shell script if you really wanted to.

        -

        npm will not help you do something that is known to be a bad idea.

        -

        Should I check my node_modules folder into git?

        -

        Usually, no. Allow npm to resolve dependencies for your packages.

        -

        For packages you deploy, such as websites and apps, -you should use npm shrinkwrap to lock down your full dependency tree:

        -

        https://docs.npmjs.com/cli/shrinkwrap

        -

        If you are paranoid about depending on the npm ecosystem, -you should run a private npm mirror or a private cache.

        -

        If you want 100% confidence in being able to reproduce the specific bytes -included in a deployment, you should use an additional mechanism that can -verify contents rather than versions. For example, -Amazon machine images, DigitalOcean snapshots, Heroku slugs, or simple tarballs.

        -

        Is it 'npm' or 'NPM' or 'Npm'?

        -

        npm should never be capitalized unless it is being displayed in a -location that is customarily all-caps (such as the title of man pages.)

        -

        If 'npm' is an acronym, why is it never capitalized?

        -

        Contrary to the belief of many, "npm" is not in fact an abbreviation for -"Node Package Manager". It is a recursive bacronymic abbreviation for -"npm is not an acronym". (If it was "ninaa", then it would be an -acronym, and thus incorrectly named.)

        -

        "NPM", however, is an acronym (more precisely, a capitonym) for the -National Association of Pastoral Musicians. You can learn more -about them at http://npm.org/.

        -

        In software, "NPM" is a Non-Parametric Mapping utility written by -Chris Rorden. You can analyze pictures of brains with it. Learn more -about the (capitalized) NPM program at http://www.cabiatl.com/mricro/npm/.

        -

        The first seed that eventually grew into this flower was a bash utility -named "pm", which was a shortened descendent of "pkgmakeinst", a -bash function that was used to install various different things on different -platforms, most often using Yahoo's yinst. If npm was ever an -acronym for anything, it was node pm or maybe new pm.

        -

        So, in all seriousness, the "npm" project is named after its command-line -utility, which was organically selected to be easily typed by a right-handed -programmer using a US QWERTY keyboard layout, ending with the -right-ring-finger in a postition to type the - key for flags and -other command-line arguments. That command-line utility is always -lower-case, though it starts most sentences it is a part of.

        -

        How do I list installed packages?

        -

        npm ls

        -

        How do I search for packages?

        -

        npm search

        -

        Arguments are greps. npm search jsdom shows jsdom packages.

        -

        How do I update npm?

        -
        npm install npm -g
        -

        You can also update all outdated local packages by doing npm update without -any arguments, or global packages by doing npm update -g.

        -

        Occasionally, the version of npm will progress such that the current -version cannot be properly installed with the version that you have -installed already. (Consider, if there is ever a bug in the update -command.)

        -

        In those cases, you can do this:

        -
        curl https://www.npmjs.com/install.sh | sh
        -

        What is a package?

        -

        A package is:

        -
          -
        • a) a folder containing a program described by a package.json file
        • -
        • b) a gzipped tarball containing (a)
        • -
        • c) a url that resolves to (b)
        • -
        • d) a <name>@<version> that is published on the registry with (c)
        • -
        • e) a <name>@<tag> that points to (d)
        • -
        • f) a <name> that has a "latest" tag satisfying (e)
        • -
        • g) a git url that, when cloned, results in (a).
        • -
        -

        Even if you never publish your package, you can still get a lot of -benefits of using npm if you just want to write a node program (a), and -perhaps if you also want to be able to easily install it elsewhere -after packing it up into a tarball (b).

        -

        Git urls can be of the form:

        -
        git://github.com/user/project.git#commit-ish
        -git+ssh://user@hostname:project.git#commit-ish
        -git+http://user@hostname/project/blah.git#commit-ish
        -git+https://user@hostname/project/blah.git#commit-ish
        -

        The commit-ish can be any tag, sha, or branch which can be supplied as -an argument to git checkout. The default is master.

        -

        What is a module?

        -

        A module is anything that can be loaded with require() in a Node.js -program. The following things are all examples of things that can be -loaded as modules:

        -
          -
        • A folder with a package.json file containing a main field.
        • -
        • A folder with an index.js file in it.
        • -
        • A JavaScript file.
        • -
        -

        Most npm packages are modules, because they are libraries that you -load with require. However, there's no requirement that an npm -package be a module! Some only contain an executable command-line -interface, and don't provide a main field for use in Node programs.

        -

        Almost all npm packages (at least, those that are Node programs) -contain many modules within them (because every file they load with -require() is a module).

        -

        In the context of a Node program, the module is also the thing that -was loaded from a file. For example, in the following program:

        -
        var req = require('request')
        -

        we might say that "The variable req refers to the request module".

        -

        So, why is it the "node_modules" folder, but "package.json" file? Why not node_packages or module.json?

        -

        The package.json file defines the package. (See "What is a -package?" above.)

        -

        The node_modules folder is the place Node.js looks for modules. -(See "What is a module?" above.)

        -

        For example, if you create a file at node_modules/foo.js and then -had a program that did var f = require('foo.js') then it would load -the module. However, foo.js is not a "package" in this case, -because it does not have a package.json.

        -

        Alternatively, if you create a package which does not have an -index.js or a "main" field in the package.json file, then it is -not a module. Even if it's installed in node_modules, it can't be -an argument to require().

        -

        "node_modules" is the name of my deity's arch-rival, and a Forbidden Word in my religion. Can I configure npm to use a different folder?

        -

        No. This will never happen. This question comes up sometimes, -because it seems silly from the outside that npm couldn't just be -configured to put stuff somewhere else, and then npm could load them -from there. It's an arbitrary spelling choice, right? What's the big -deal?

        -

        At the time of this writing, the string 'node_modules' appears 151 -times in 53 separate files in npm and node core (excluding tests and -documentation).

        -

        Some of these references are in node's built-in module loader. Since -npm is not involved at all at run-time, node itself would have to -be configured to know where you've decided to stick stuff. Complexity -hurdle #1. Since the Node module system is locked, this cannot be -changed, and is enough to kill this request. But I'll continue, in -deference to your deity's delicate feelings regarding spelling.

        -

        Many of the others are in dependencies that npm uses, which are not -necessarily tightly coupled to npm (in the sense that they do not read -npm's configuration files, etc.) Each of these would have to be -configured to take the name of the node_modules folder as a -parameter. Complexity hurdle #2.

        -

        Furthermore, npm has the ability to "bundle" dependencies by adding -the dep names to the "bundledDependencies" list in package.json, -which causes the folder to be included in the package tarball. What -if the author of a module bundles its dependencies, and they use a -different spelling for node_modules? npm would have to rename the -folder at publish time, and then be smart enough to unpack it using -your locally configured name. Complexity hurdle #3.

        -

        Furthermore, what happens when you change this name? Fine, it's -easy enough the first time, just rename the node_modules folders to -./blergyblerp/ or whatever name you choose. But what about when you -change it again? npm doesn't currently track any state about past -configuration settings, so this would be rather difficult to do -properly. It would have to track every previous value for this -config, and always accept any of them, or else yesterday's install may -be broken tomorrow. Complexity hurdle #4.

        -

        Never going to happen. The folder is named node_modules. It is -written indelibly in the Node Way, handed down from the ancient times -of Node 0.3.

        -

        How do I install node with npm?

        -

        You don't. Try one of these node version managers:

        -

        Unix:

        - -

        Windows:

        - -

        How can I use npm for development?

        -

        See npm-developers(7) and package.json(5).

        -

        You'll most likely want to npm link your development folder. That's -awesomely handy.

        -

        To set up your own private registry, check out npm-registry(7).

        -

        Can I list a url as a dependency?

        -

        Yes. It should be a url to a gzipped tarball containing a single folder -that has a package.json in its root, or a git url. -(See "what is a package?" above.)

        - -

        See npm-link(1)

        -

        The package registry website. What is that exactly?

        -

        See npm-registry(7).

        -

        I forgot my password, and can't publish. How do I reset it?

        -

        Go to https://npmjs.com/forgot.

        -

        I get ECONNREFUSED a lot. What's up?

        -

        Either the registry is down, or node's DNS isn't able to reach out.

        -

        To check if the registry is down, open up -https://registry.npmjs.org/ in a web browser. This will also tell -you if you are just unable to access the internet for some reason.

        -

        If the registry IS down, let us know by emailing support@npmjs.com -or posting an issue at https://github.com/npm/npm/issues. If it's -down for the world (and not just on your local network) then we're -probably already being pinged about it.

        -

        You can also often get a faster response by visiting the #npm channel -on Freenode IRC.

        -

        Why no namespaces?

        -

        npm has only one global namespace. If you want to namespace your own packages, -you may: simply use the - character to separate the names or use scoped -packages. npm is a mostly anarchic system. There is not sufficient need to -impose namespace rules on everyone.

        -

        As of 2.0, npm supports scoped packages, which allow you to publish a group of -related modules without worrying about name collisions.

        -

        Every npm user owns the scope associated with their username. For example, the -user named npm owns the scope @npm. Scoped packages are published inside a -scope by naming them as if they were files under the scope directory, e.g., by -setting name in package.json to @npm/npm.

        -

        Scoped packages are supported by the public npm registry. The npm client is -backwards-compatible with un-scoped registries, so it can be used to work with -scoped and un-scoped registries at the same time.

        -

        Unscoped packages can only depend on other unscoped packages. Scoped packages -can depend on packages from their own scope, a different scope, or the public -registry (unscoped).

        -

        For the current documentation of scoped packages, see -https://docs.npmjs.com/misc/scope

        -

        References:

        -
          -
        1. For the reasoning behind the "one global namespace", please see this -discussion: https://github.com/npm/npm/issues/798 (TL;DR: It doesn't -actually make things better, and can make them worse.)

          -
        2. -
        3. For the pre-implementation discussion of the scoped package feature, see -this discussion: https://github.com/npm/npm/issues/5239

          -
        4. -
        -

        Who does npm?

        -

        npm was originally written by Isaac Z. Schlueter, and many others have -contributed to it, some of them quite substantially.

        -

        The npm open source project, The npm Registry, and the community -website are maintained and operated by the -good folks at npm, Inc.

        -

        I have a question or request not addressed here. Where should I put it?

        -

        Post an issue on the github project:

        - -

        Why does npm hate me?

        -

        npm is not capable of hatred. It loves everyone, especially you.

        -

        SEE ALSO

        - - -
        - - - - - - - - - - - - diff --git a/deps/npm/html/doc/misc/npm-index.html b/deps/npm/html/doc/misc/npm-index.html index 2f7381b625bca0..92b5121258cdf3 100644 --- a/deps/npm/html/doc/misc/npm-index.html +++ b/deps/npm/html/doc/misc/npm-index.html @@ -52,6 +52,8 @@

        npm-help(1)

        Get help on npm

        npm-init(1)

        Interactively create a package.json file

        +

        npm-install-test(1)

        +

        Install package(s) and run tests

        npm-install(1)

        Install a package

        @@ -80,8 +82,6 @@

        npm-repo(1)

        Open package repository page in the browser

        npm-restart(1)

        Restart a package

        -

        npm-rm(1)

        -

        Remove a package

        npm-root(1)

        Display npm root

        npm-run-script(1)

        @@ -118,86 +118,6 @@

        npm-whoami(1)

        Display npm username

        API Documentation

        Using npm in your Node programs

        -

        npm(3)

        -

        javascript package manager

        -

        npm-bin(3)

        -

        Display npm bin folder

        -

        npm-bugs(3)

        -

        Bugs for a package in a web browser maybe

        -

        npm-cache(3)

        -

        manage the npm cache programmatically

        -

        npm-commands(3)

        -

        npm commands

        -

        npm-config(3)

        -

        Manage the npm configuration files

        -

        npm-deprecate(3)

        -

        Deprecate a version of a package

        -

        npm-docs(3)

        -

        Docs for a package in a web browser maybe

        -

        npm-edit(3)

        -

        Edit an installed package

        -

        npm-explore(3)

        -

        Browse an installed package

        -

        npm-help-search(3)

        -

        Search the help pages

        -

        npm-init(3)

        -

        Interactively create a package.json file

        -

        npm-install(3)

        -

        install a package programmatically

        - -

        Symlink a package folder

        -

        npm-load(3)

        -

        Load config settings

        -

        npm-ls(3)

        -

        List installed packages

        -

        npm-outdated(3)

        -

        Check for outdated packages

        -

        npm-owner(3)

        -

        Manage package owners

        -

        npm-pack(3)

        -

        Create a tarball from a package

        -

        npm-ping(3)

        -

        Ping npm registry

        -

        npm-prefix(3)

        -

        Display prefix

        -

        npm-prune(3)

        -

        Remove extraneous packages

        -

        npm-publish(3)

        -

        Publish a package

        -

        npm-rebuild(3)

        -

        Rebuild a package

        -

        npm-repo(3)

        -

        Open package repository page in the browser

        -

        npm-restart(3)

        -

        Restart a package

        -

        npm-root(3)

        -

        Display npm root

        -

        npm-run-script(3)

        -

        Run arbitrary package scripts

        -

        npm-search(3)

        -

        Search for packages

        -

        npm-shrinkwrap(3)

        -

        programmatically generate package shrinkwrap file

        -

        npm-start(3)

        -

        Start a package

        -

        npm-stop(3)

        -

        Stop a package

        -

        npm-tag(3)

        -

        Tag a published version

        -

        npm-test(3)

        -

        Test a package

        -

        npm-uninstall(3)

        -

        uninstall a package programmatically

        -

        npm-unpublish(3)

        -

        Remove a package from the registry

        -

        npm-update(3)

        -

        Update a package

        -

        npm-version(3)

        -

        Bump a package version

        -

        npm-view(3)

        -

        View registry info

        -

        npm-whoami(3)

        -

        Display npm username

        Files

        File system structures npm uses

        npm-folders(5)

        @@ -216,8 +136,6 @@

        npm-developers(

        Developer Guide

        npm-disputes(7)

        Handling Module Name Disputes

        -

        npm-faq(7)

        -

        Frequently Asked Questions

        npm-index(7)

        Index of all npm documentation

        npm-orgs(7)

        @@ -244,5 +162,4 @@

        semver(7)

               - - + diff --git a/deps/npm/html/doc/misc/npm-orgs.html b/deps/npm/html/doc/misc/npm-orgs.html index 8c6e768c25c3aa..1dd915ad6b0181 100644 --- a/deps/npm/html/doc/misc/npm-orgs.html +++ b/deps/npm/html/doc/misc/npm-orgs.html @@ -22,8 +22,8 @@

        DESCRIPTION

        The developer will be able to access packages based on the teams they are on. Access is either read-write or read-only.

        There are two main commands:

          -
        1. npm team see npm-access(1) for more details
        2. -
        3. npm access see npm-team(1) for more details
        4. +
        5. npm team see npm-team(1) for more details
        6. +
        7. npm access see npm-access(1) for more details

        Team Admins create teams

          @@ -86,4 +86,4 @@

          Team Admins create teams

                 - + diff --git a/deps/npm/html/doc/misc/npm-registry.html b/deps/npm/html/doc/misc/npm-registry.html index a622e530491129..087565fec40e9c 100644 --- a/deps/npm/html/doc/misc/npm-registry.html +++ b/deps/npm/html/doc/misc/npm-registry.html @@ -17,10 +17,10 @@

          DESCRIPTION

          Additionally, npm's package registry implementation supports several write APIs as well, to allow for publishing packages and managing user account information.

          -

          The official public npm registry is at http://registry.npmjs.org/. It +

          The official public npm registry is at https://registry.npmjs.org/. It is powered by a CouchDB database, of which there is a public mirror at -http://skimdb.npmjs.com/registry. The code for the couchapp is -available at http://github.com/npm/npm-registry-couchapp.

          +https://skimdb.npmjs.com/registry. The code for the couchapp is +available at https://github.com/npm/npm-registry-couchapp.

          The registry URL used is determined by the scope of the package (see npm-scope(7)). If no scope is specified, the default registry is used, which is supplied by the registry config parameter. See npm-config(1), @@ -70,5 +70,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/misc/npm-scope.html b/deps/npm/html/doc/misc/npm-scope.html index a2ac6463331b57..43feb0b22c8a73 100644 --- a/deps/npm/html/doc/misc/npm-scope.html +++ b/deps/npm/html/doc/misc/npm-scope.html @@ -45,7 +45,7 @@

          Requiring scoped packages

          Publishing scoped packages

          Scoped packages can be published to any registry that supports them, including the public npm registry.

          -

          (As of 2015-04-19, the public npm registry does support scoped packages)

          +

          (As of 2015-04-19, and with npm 2.0 or better, the public npm registry does support scoped packages)

          If you wish, you may associate a scope with a registry; see below.

          Publishing public scoped packages to the public npm registry

          To publish a public scoped package, you must specify --access public with @@ -91,5 +91,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/misc/npm-scripts.html b/deps/npm/html/doc/misc/npm-scripts.html index 580535d2c5101b..b9cc536cb13c61 100644 --- a/deps/npm/html/doc/misc/npm-scripts.html +++ b/deps/npm/html/doc/misc/npm-scripts.html @@ -74,7 +74,7 @@

          DEFAULT VALUES

          will default the start command to node server.js.

        • "install": "node-gyp rebuild":

          -

          If there is a bindings.gyp file in the root of your package, npm will +

          If there is a binding.gyp file in the root of your package, npm will default the install command to compile using node-gyp.

        @@ -134,10 +134,10 @@

        Special: package.json "config&q , "uninstall" : "scripts/uninstall.js" } } -

      then the scripts/install.js will be called for the install, -post-install, stages of the lifecycle, and the scripts/uninstall.js -would be called when the package is uninstalled. Since -scripts/install.js is running for three different phases, it would +

    then scripts/install.js will be called for the install +and post-install stages of the lifecycle, and scripts/uninstall.js +will be called when the package is uninstalled. Since +scripts/install.js is running for two different phases, it would be wise in this case to look at the npm_lifecycle_event environment variable.

    If you want to run a make command, you can do so. This works just @@ -176,7 +176,7 @@

    BEST PRACTICES

    by simply describing your package appropriately. In general, this will lead to a more robust and consistent state.
  • Inspect the env to determine where to put things. For instance, if -the npm_config_binroot environ is set to /home/user/bin, then +the npm_config_binroot environment variable is set to /home/user/bin, then don't try to install executables into /usr/local/bin. The user probably set it up that way for a reason.
  • Don't prefix your script commands with "sudo". If root permissions @@ -207,5 +207,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/removing-npm.html b/deps/npm/html/doc/misc/removing-npm.html index dc23b860d8d63f..ea8ea286ebac7d 100644 --- a/deps/npm/html/doc/misc/removing-npm.html +++ b/deps/npm/html/doc/misc/removing-npm.html @@ -42,7 +42,7 @@

    SYNOPSIS

    SEE ALSO

    @@ -57,5 +57,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/semver.html b/deps/npm/html/doc/misc/semver.html index de275ef6e922e6..767fb9d664c047 100644 --- a/deps/npm/html/doc/misc/semver.html +++ b/deps/npm/html/doc/misc/semver.html @@ -94,7 +94,7 @@

    Prerelease Tags

    Prerelease Identifiers

    The method .inc takes an additional identifier string argument that will append the value of the string as a prerelease identifier:

    -
    > semver.inc('1.2.3', 'pre', 'beta')
    +
    > semver.inc('1.2.3', 'prerelease', 'beta')
     '1.2.4-beta.0'
     

    command-line example:

    @@ -199,6 +199,26 @@

    Caret Ranges ^1.2.3
  • ^1.x := >=1.0.0 <2.0.0
  • ^0.x := >=0.0.0 <1.0.0
+

Range Grammar

+

Putting all this together, here is a Backus-Naur grammar for ranges, +for the benefit of parser authors:

+
range-set  ::= range ( logical-or range ) *
+logical-or ::= ( ' ' ) * '||' ( ' ' ) *
+range      ::= hyphen | simple ( ' ' simple ) * | ''
+hyphen     ::= partial ' - ' partial
+simple     ::= primitive | partial | tilde | caret
+primitive  ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial
+partial    ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
+xr         ::= 'x' | 'X' | '*' | nr
+nr         ::= '0' | ['1'-'9']['0'-'9']+
+tilde      ::= '~' partial
+caret      ::= '^' partial
+qualifier  ::= ( '-' pre )? ( '+' build )?
+pre        ::= parts
+build      ::= parts
+parts      ::= part ( '.' part ) *
+part       ::= nr | [-0-9A-Za-z]+
+

Functions

All methods and classes take a final loose boolean argument that, if true, will be more forgiving about not-quite-valid semver strings. @@ -282,5 +302,5 @@

Ranges

       - + diff --git a/deps/npm/html/index.html b/deps/npm/html/index.html index 06ca14ba4ac9b7..bb8681c85c9fd6 100644 --- a/deps/npm/html/index.html +++ b/deps/npm/html/index.html @@ -61,7 +61,7 @@

npm

Easy Zero Line Install

-

Install Node.js
+

Install Node.js
(npm comes with it.)

Because a one-line install is one too many.

@@ -70,24 +70,22 @@

Fancy Install

  1. Get the code. -
  2. Do what the README +
  3. Do what the README says to do.

There's a pretty thorough install script at https://npmjs.org/install.sh

-

For maximum security, make sure to thorougly inspect every +

For maximum security, make sure to thoroughly inspect every program that you run on your computer!

Other Cool Stuff

diff --git a/deps/npm/html/static/toc.js b/deps/npm/html/static/toc.js index 2cfebd0aa968b7..7551e47efdf48e 100644 --- a/deps/npm/html/static/toc.js +++ b/deps/npm/html/static/toc.js @@ -1,29 +1,29 @@ ;(function () { -var wrapper = document.getElementById("wrapper") -var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0) - .filter(function (el) { - return el.parentNode === wrapper - && el.tagName.match(/H[1-6]/) - && el.id - }) -var l = 2 - , toc = document.createElement("ul") -toc.innerHTML = els.map(function (el) { - var i = el.tagName.charAt(1) - , out = "" - while (i > l) { - out += "
    " - l ++ - } - while (i < l) { - out += "
" - l -- - } - out += "
  • " + - ( el.innerText || el.text || el.innerHTML) - + "" - return out -}).join("\n") -toc.id = "toc" -document.body.appendChild(toc) -})(); + var wrapper = document.getElementById('wrapper') + var els = Array.prototype.slice.call(wrapper.getElementsByTagName('*'), 0) + .filter(function (el) { + return el.parentNode === wrapper && + el.tagName.match(/H[1-6]/) && + el.id + }) + var l = 2 + var toc = document.createElement('ul') + toc.innerHTML = els.map(function (el) { + var i = el.tagName.charAt(1) + var out = '' + while (i > l) { + out += '
      ' + l++ + } + while (i < l) { + out += '
    ' + l-- + } + out += '
  • ' + + (el.innerText || el.text || el.innerHTML) + + '' + return out + }).join('\n') + toc.id = 'toc' + document.body.appendChild(toc) +})() diff --git a/deps/npm/lib/access.js b/deps/npm/lib/access.js index 790a760cb72201..158ce50544f1c4 100644 --- a/deps/npm/lib/access.js +++ b/deps/npm/lib/access.js @@ -35,6 +35,7 @@ access.completion = function (opts, cb) { } else { return cb(null, []) } + break case 'public': case 'restricted': case 'ls-packages': @@ -72,7 +73,9 @@ function access (args, cb) { } function parseParams (cmd, args, cb) { - var params = {} + // mapToRegistry will complain if package is undefined, + // but it's not needed for ls-packages + var params = { 'package': '' } if (cmd === 'grant') { params.permissions = args.shift() } @@ -81,22 +84,25 @@ function parseParams (cmd, args, cb) { params.scope = entity[0] params.team = entity[1] } - getPackage(args.shift(), function (err, pkg) { - if (err) { return cb(err) } - params.package = pkg - if (!params.scope && cmd === 'ls-packages') { + if (cmd === 'ls-packages') { + if (!params.scope) { whoami([], true, function (err, scope) { params.scope = scope cb(err, params) }) } else { - if (cmd === 'ls-collaborators') { - params.user = args.shift() - } cb(null, params) } - }) + } else { + getPackage(args.shift(), function (err, pkg) { + if (err) return cb(err) + params.package = pkg + + if (cmd === 'ls-collaborators') params.user = args.shift() + cb(null, params) + }) + } } function getPackage (name, cb) { @@ -105,6 +111,17 @@ function getPackage (name, cb) { } else { readPackageJson( resolve(npm.prefix, 'package.json'), - function (err, data) { cb(err, data.name) }) + function (err, data) { + if (err) { + if (err.code === 'ENOENT') { + cb(new Error('no package name passed to command and no package.json found')) + } else { + cb(err) + } + } else { + cb(null, data.name) + } + } + ) } } diff --git a/deps/npm/lib/adduser.js b/deps/npm/lib/adduser.js index 367f3ba0d92754..b012371b339ad3 100644 --- a/deps/npm/lib/adduser.js +++ b/deps/npm/lib/adduser.js @@ -1,30 +1,32 @@ - module.exports = adduser -var log = require("npmlog") - , npm = require("./npm.js") - , read = require("read") - , userValidate = require("npm-user-validate") - , crypto +var log = require('npmlog') +var npm = require('./npm.js') +var read = require('read') +var userValidate = require('npm-user-validate') +var crypto try { - crypto = require("crypto") + crypto = require('crypto') } catch (ex) {} -adduser.usage = "npm adduser\nThen enter stuff at the prompts" +adduser.usage = 'npm adduser [--registry=url] [--scope=@orgname] [--always-auth]' function adduser (args, cb) { - npm.spinner.stop() - if (!crypto) return cb(new Error( - "You must compile node with ssl support to use the adduser feature")) - - var creds = npm.config.getCredentialsByURI(npm.config.get("registry")) - var c = { u : creds.username || "" - , p : creds.password || "" - , e : creds.email || "" - } - , u = {} - , fns = [readUsername, readPassword, readEmail, save] + if (!crypto) { + return cb(new Error( + 'You must compile node with ssl support to use the adduser feature' + )) + } + + var creds = npm.config.getCredentialsByURI(npm.config.get('registry')) + var c = { + u: creds.username || '', + p: creds.password || '', + e: creds.email || '' + } + var u = {} + var fns = [readUsername, readPassword, readEmail, save] loop() function loop (er) { @@ -37,9 +39,9 @@ function adduser (args, cb) { function readUsername (c, u, cb) { var v = userValidate.username - read({prompt: "Username: ", default: c.u || ""}, function (er, un) { + read({prompt: 'Username: ', default: c.u || ''}, function (er, un) { if (er) { - return cb(er.message === "cancelled" ? er.message : er) + return cb(er.message === 'cancelled' ? er.message : er) } // make sure it's valid. we have to do this here, because @@ -68,17 +70,17 @@ function readPassword (c, u, cb) { var prompt if (c.p && !c.changed) { - prompt = "Password: (or leave unchanged) " + prompt = 'Password: (or leave unchanged) ' } else { - prompt = "Password: " + prompt = 'Password: ' } read({prompt: prompt, silent: true}, function (er, pw) { if (er) { - return cb(er.message === "cancelled" ? er.message : er) + return cb(er.message === 'cancelled' ? er.message : er) } - if (!c.changed && pw === "") { + if (!c.changed && pw === '') { // when the username was not changed, // empty response means "use the old value" pw = c.p @@ -102,10 +104,10 @@ function readPassword (c, u, cb) { function readEmail (c, u, cb) { var v = userValidate.email - var r = { prompt: "Email: (this IS public) ", default: c.e || "" } + var r = { prompt: 'Email: (this IS public) ', default: c.e || '' } read(r, function (er, em) { if (er) { - return cb(er.message === "cancelled" ? er.message : er) + return cb(er.message === 'cancelled' ? er.message : er) } if (!em) { @@ -124,52 +126,50 @@ function readEmail (c, u, cb) { } function save (c, u, cb) { - npm.spinner.start() - // save existing configs, but yank off for this PUT - var uri = npm.config.get("registry") - var scope = npm.config.get("scope") + var uri = npm.config.get('registry') + var scope = npm.config.get('scope') // there may be a saved scope and no --registry (for login) if (scope) { - if (scope.charAt(0) !== "@") scope = "@" + scope + if (scope.charAt(0) !== '@') scope = '@' + scope - var scopedRegistry = npm.config.get(scope + ":registry") - var cliRegistry = npm.config.get("registry", "cli") + var scopedRegistry = npm.config.get(scope + ':registry') + var cliRegistry = npm.config.get('registry', 'cli') if (scopedRegistry && !cliRegistry) uri = scopedRegistry } var params = { - auth : { - username : u.u, - password : u.p, - email : u.e + auth: { + username: u.u, + password: u.p, + email: u.e } } npm.registry.adduser(uri, params, function (er, doc) { - npm.spinner.stop() if (er) return cb(er) // don't want this polluting the configuration - npm.config.del("_token", "user") + npm.config.del('_token', 'user') - if (scope) npm.config.set(scope + ":registry", uri, "user") + if (scope) npm.config.set(scope + ':registry', uri, 'user') if (doc && doc.token) { npm.config.setCredentialsByURI(uri, { - token : doc.token + token: doc.token }) - } - else { + } else { npm.config.setCredentialsByURI(uri, { - username : u.u, - password : u.p, - email : u.e, - alwaysAuth : npm.config.get("always-auth") + username: u.u, + password: u.p, + email: u.e, + alwaysAuth: npm.config.get('always-auth') }) } - log.info("adduser", "Authorized user %s", u.u) - npm.config.save("user", cb) + log.info('adduser', 'Authorized user %s', u.u) + var scopeMessage = scope ? ' to scope ' + scope : '' + console.log('Logged in as %s%s on %s.', u.u, scopeMessage, uri) + npm.config.save('user', cb) }) } diff --git a/deps/npm/lib/bin.js b/deps/npm/lib/bin.js index 5465112d8891e8..2e02617d35a790 100644 --- a/deps/npm/lib/bin.js +++ b/deps/npm/lib/bin.js @@ -1,19 +1,22 @@ module.exports = bin -var npm = require("./npm.js") -var osenv = require("osenv") +var npm = require('./npm.js') +var osenv = require('osenv') -bin.usage = "npm bin\nnpm bin -g\n(just prints the bin folder)" +bin.usage = 'npm bin [--global]' function bin (args, silent, cb) { - if (typeof cb !== "function") cb = silent, silent = false + if (typeof cb !== 'function') { + cb = silent + silent = false + } var b = npm.bin - , PATH = osenv.path() + var PATH = osenv.path() if (!silent) console.log(b) process.nextTick(cb.bind(this, null, b)) - if (npm.config.get("global") && PATH.indexOf(b) === -1) { - npm.config.get("logstream").write("(not in PATH env variable)\n") + if (npm.config.get('global') && PATH.indexOf(b) === -1) { + npm.config.get('logstream').write('(not in PATH env variable)\n') } } diff --git a/deps/npm/lib/bugs.js b/deps/npm/lib/bugs.js index 306d9bb4bfc9fe..d42e68faa5cde5 100644 --- a/deps/npm/lib/bugs.js +++ b/deps/npm/lib/bugs.js @@ -1,16 +1,11 @@ - module.exports = bugs -bugs.usage = "npm bugs " +bugs.usage = 'npm bugs []' -var npm = require("./npm.js") - , log = require("npmlog") - , opener = require("opener") - , path = require("path") - , readJson = require("read-package-json") - , npa = require("npm-package-arg") - , fs = require("fs") - , mapToRegistry = require("./utils/map-to-registry.js") +var npm = require('./npm.js') +var log = require('npmlog') +var opener = require('opener') +var fetchPackageMetadata = require('./fetch-package-metadata.js') bugs.completion = function (opts, cb) { // FIXME: there used to be registry completion here, but it stopped making @@ -19,51 +14,15 @@ bugs.completion = function (opts, cb) { } function bugs (args, cb) { - var n = args.length && npa(args[0]).name || "." - fs.stat(n, function (er, s) { - if (er) { - if (er.code === "ENOENT") return callRegistry(n, cb) - return cb(er) - } - if (!s.isDirectory()) return callRegistry(n, cb) - readJson(path.resolve(n, "package.json"), function(er, d) { - if (er) return cb(er) - getUrlAndOpen(d, cb) - }) - }) -} - -function getUrlAndOpen (d, cb) { - var repo = d.repository || d.repositories - , url - if (d.bugs) { - url = (typeof d.bugs === "string") ? d.bugs : d.bugs.url - } - else if (repo) { - if (Array.isArray(repo)) repo = repo.shift() - if (repo.hasOwnProperty("url")) repo = repo.url - log.verbose("bugs", "repository", repo) - if (repo && repo.match(/^(https?:\/\/|git(:\/\/|@))github.com/)) { - url = repo.replace(/^git(@|:\/\/)/, "https://") - .replace(/^https?:\/\/github.com:/, "https://github.com/") - .replace(/\.git$/, "")+"/issues" - } - } - if (!url) { - url = "https://www.npmjs.org/package/" + d.name - } - log.silly("bugs", "url", url) - opener(url, { command: npm.config.get("browser") }, cb) -} - -function callRegistry (name, cb) { - mapToRegistry(name, npm.config, function (er, uri, auth) { + var n = args.length ? args[0] : '.' + fetchPackageMetadata(n, '.', function (er, d) { if (er) return cb(er) - npm.registry.get(uri + "/latest", { auth : auth }, function (er, d) { - if (er) return cb(er) - - getUrlAndOpen(d, cb) - }) + var url = d.bugs && ((typeof d.bugs === 'string') ? d.bugs : d.bugs.url) + if (!url) { + url = 'https://www.npmjs.org/package/' + d.name + } + log.silly('bugs', 'url', url) + opener(url, { command: npm.config.get('browser') }, cb) }) } diff --git a/deps/npm/lib/build.js b/deps/npm/lib/build.js index 1f2d2efceb4618..e9da59a23dc5a3 100644 --- a/deps/npm/lib/build.js +++ b/deps/npm/lib/build.js @@ -7,100 +7,112 @@ // This runs AFTER install or link are completed. -var npm = require("./npm.js") - , log = require("npmlog") - , chain = require("slide").chain - , fs = require("graceful-fs") - , path = require("path") - , lifecycle = require("./utils/lifecycle.js") - , readJson = require("read-package-json") - , link = require("./utils/link.js") - , linkIfExists = link.ifExists - , cmdShim = require("cmd-shim") - , cmdShimIfExists = cmdShim.ifExists - , asyncMap = require("slide").asyncMap - , ini = require("ini") - , writeFile = require("write-file-atomic") +var npm = require('./npm.js') +var log = require('npmlog') +var chain = require('slide').chain +var fs = require('graceful-fs') +var path = require('path') +var lifecycle = require('./utils/lifecycle.js') +var readJson = require('read-package-json') +var link = require('./utils/link.js') +var linkIfExists = link.ifExists +var cmdShim = require('cmd-shim') +var cmdShimIfExists = cmdShim.ifExists +var asyncMap = require('slide').asyncMap +var ini = require('ini') +var writeFile = require('write-file-atomic') +var packageId = require('./utils/package-id.js') module.exports = build -build.usage = "npm build \n(this is plumbing)" +build.usage = 'npm build []' build._didBuild = {} build._noLC = {} function build (args, global, didPre, didRB, cb) { - if (typeof cb !== "function") cb = didRB, didRB = false - if (typeof cb !== "function") cb = didPre, didPre = false - if (typeof cb !== "function") { - cb = global, global = npm.config.get("global") + if (typeof cb !== 'function') { + cb = didRB + didRB = false } + if (typeof cb !== 'function') { + cb = didPre + didPre = false + } + if (typeof cb !== 'function') { + cb = global + global = npm.config.get('global') + } + // it'd be nice to asyncMap these, but actually, doing them // in parallel generally munges up the output from node-waf var builder = build_(global, didPre, didRB) - chain(args.map(function (arg) { return function (cb) { - builder(arg, cb) - }}), cb) + chain(args.map(function (arg) { + return function (cb) { + builder(arg, cb) + } + }), cb) } -function build_ (global, didPre, didRB) { return function (folder, cb) { - folder = path.resolve(folder) - if (build._didBuild[folder]) log.info("build", "already built", folder) - build._didBuild[folder] = true - log.info("build", folder) - readJson(path.resolve(folder, "package.json"), function (er, pkg) { - if (er) return cb(er) - chain - ( [ !didPre && [lifecycle, pkg, "preinstall", folder] - , [linkStuff, pkg, folder, global, didRB] - , [writeBuiltinConf, pkg, folder] - , didPre !== build._noLC && [lifecycle, pkg, "install", folder] - , didPre !== build._noLC && [lifecycle, pkg, "postinstall", folder] - , didPre !== build._noLC - && npm.config.get("npat") - && [lifecycle, pkg, "test", folder] ] - , cb ) - }) -}} +function build_ (global, didPre, didRB) { + return function (folder, cb) { + folder = path.resolve(folder) + if (build._didBuild[folder]) log.info('build', 'already built', folder) + build._didBuild[folder] = true + log.info('build', folder) + readJson(path.resolve(folder, 'package.json'), function (er, pkg) { + if (er) return cb(er) + chain([ + !didPre && [lifecycle, pkg, 'preinstall', folder], + [linkStuff, pkg, folder, global, didRB], + [writeBuiltinConf, pkg, folder], + didPre !== build._noLC && [lifecycle, pkg, 'install', folder], + didPre !== build._noLC && [lifecycle, pkg, 'postinstall', folder], + didPre !== build._noLC && npm.config.get('npat') && [lifecycle, pkg, 'test', folder] + ], + cb) + }) + } +} -function writeBuiltinConf (pkg, folder, cb) { +var writeBuiltinConf = build.writeBuiltinConf = function (pkg, folder, cb) { // the builtin config is "sticky". Any time npm installs // itself globally, it puts its builtin config file there var parent = path.dirname(folder) var dir = npm.globalDir - if (pkg.name !== "npm" || - !npm.config.get("global") || + if (pkg.name !== 'npm' || + !npm.config.get('global') || !npm.config.usingBuiltin || dir !== parent) { return cb() } var data = ini.stringify(npm.config.sources.builtin.data) - writeFile(path.resolve(folder, "npmrc"), data, cb) + writeFile(path.resolve(folder, 'npmrc'), data, cb) } -function linkStuff (pkg, folder, global, didRB, cb) { +var linkStuff = build.linkStuff = function (pkg, folder, global, didRB, cb) { // allow to opt out of linking binaries. - if (npm.config.get("bin-links") === false) return cb() + if (npm.config.get('bin-links') === false) return cb() // if it's global, and folder is in {prefix}/node_modules, // then bins are in {prefix}/bin // otherwise, then bins are in folder/../.bin - var parent = pkg.name[0] === '@' ? path.dirname(path.dirname(folder)) : path.dirname(folder) + var parent = pkg.name && pkg.name[0] === '@' ? path.dirname(path.dirname(folder)) : path.dirname(folder) var gnm = global && npm.globalDir var gtop = parent === gnm - log.info('linkStuff', pkg._id) - log.silly('linkStuff', pkg._id, 'has', parent, 'as its parent node_modules') - if (global) log.silly('linkStuff', pkg._id, 'is part of a global install') - if (gnm) log.silly('linkStuff', pkg._id, 'is installed into a global node_modules') - if (gtop) log.silly('linkStuff', pkg._id, 'is installed into the top-level global node_modules') + log.info('linkStuff', packageId(pkg)) + log.silly('linkStuff', packageId(pkg), 'has', parent, 'as its parent node_modules') + if (global) log.silly('linkStuff', packageId(pkg), 'is part of a global install') + if (gnm) log.silly('linkStuff', packageId(pkg), 'is installed into a global node_modules') + if (gtop) log.silly('linkStuff', packageId(pkg), 'is installed into the top-level global node_modules') shouldWarn(pkg, folder, global, function () { asyncMap( [linkBins, linkMans, !didRB && rebuildBundles], function (fn, cb) { if (!fn) return cb() - log.verbose(fn.name, pkg._id) + log.verbose(fn.name, packageId(pkg)) fn(pkg, folder, parent, gtop, cb) }, cb @@ -108,27 +120,25 @@ function linkStuff (pkg, folder, global, didRB, cb) { }) } -function shouldWarn(pkg, folder, global, cb) { +function shouldWarn (pkg, folder, global, cb) { var parent = path.dirname(folder) - , top = parent === npm.dir - , cwd = npm.localPrefix + var top = parent === npm.dir + var cwd = npm.localPrefix - readJson(path.resolve(cwd, "package.json"), function(er, topPkg) { + readJson(path.resolve(cwd, 'package.json'), function (er, topPkg) { if (er) return cb(er) var linkedPkg = path.basename(cwd) - , currentPkg = path.basename(folder) + var currentPkg = path.basename(folder) // current searched package is the linked package on first call if (linkedPkg !== currentPkg) { - // don't generate a warning if it's listed in dependencies if (Object.keys(topPkg.dependencies || {}) .concat(Object.keys(topPkg.devDependencies || {})) .indexOf(currentPkg) === -1) { - if (top && pkg.preferGlobal && !global) { - log.warn("prefer global", pkg._id + " should be installed with -g") + log.warn('prefer global', packageId(pkg) + ' should be installed with -g') } } } @@ -138,76 +148,81 @@ function shouldWarn(pkg, folder, global, cb) { } function rebuildBundles (pkg, folder, parent, gtop, cb) { - if (!npm.config.get("rebuild-bundle")) return cb() + if (!npm.config.get('rebuild-bundle')) return cb() var deps = Object.keys(pkg.dependencies || {}) .concat(Object.keys(pkg.devDependencies || {})) - , bundles = pkg.bundleDependencies || pkg.bundledDependencies || [] + var bundles = pkg.bundleDependencies || pkg.bundledDependencies || [] - fs.readdir(path.resolve(folder, "node_modules"), function (er, files) { + fs.readdir(path.resolve(folder, 'node_modules'), function (er, files) { // error means no bundles if (er) return cb() - log.verbose("rebuildBundles", files) + log.verbose('rebuildBundles', files) // don't asyncMap these, because otherwise build script output // gets interleaved and is impossible to read chain(files.filter(function (file) { // rebuild if: // not a .folder, like .bin or .hooks - return !file.match(/^[\._-]/) + return !file.match(/^[\._-]/) && // not some old 0.x style bundle - && file.indexOf("@") === -1 + file.indexOf('@') === -1 && // either not a dep, or explicitly bundled - && (deps.indexOf(file) === -1 || bundles.indexOf(file) !== -1) + (deps.indexOf(file) === -1 || bundles.indexOf(file) !== -1) }).map(function (file) { - file = path.resolve(folder, "node_modules", file) + file = path.resolve(folder, 'node_modules', file) return function (cb) { if (build._didBuild[file]) return cb() - log.verbose("rebuild bundle", file) + log.verbose('rebuild bundle', file) // if file is not a package dir, then don't do it. - fs.lstat(path.resolve(file, "package.json"), function (er) { + fs.lstat(path.resolve(file, 'package.json'), function (er) { if (er) return cb() build_(false)(file, cb) }) - }}), cb) + } + }), cb) }) } function linkBins (pkg, folder, parent, gtop, cb) { - if (!pkg.bin || !gtop && path.basename(parent) !== "node_modules") { + if (!pkg.bin || !gtop && path.basename(parent) !== 'node_modules') { return cb() } var binRoot = gtop ? npm.globalBin - : path.resolve(parent, ".bin") - log.verbose("link bins", [pkg.bin, binRoot, gtop]) + : path.resolve(parent, '.bin') + log.verbose('link bins', [pkg.bin, binRoot, gtop]) asyncMap(Object.keys(pkg.bin), function (b, cb) { - linkBin( path.resolve(folder, pkg.bin[b]) - , path.resolve(binRoot, b) - , gtop && folder - , function (er) { - if (er) return cb(er) - // bins should always be executable. - // XXX skip chmod on windows? - var src = path.resolve(folder, pkg.bin[b]) - fs.chmod(src, npm.modes.exec, function (er) { - if (er && er.code === "ENOENT" && npm.config.get("ignore-scripts")) { - return cb() - } - if (er || !gtop) return cb(er) - var dest = path.resolve(binRoot, b) - , out = npm.config.get("parseable") - ? dest + "::" + src + ":BINFILE" - : dest + " -> " + src - console.log(out) - cb() - }) - }) + linkBin( + path.resolve(folder, pkg.bin[b]), + path.resolve(binRoot, b), + gtop && folder, + function (er) { + if (er) return cb(er) + // bins should always be executable. + // XXX skip chmod on windows? + var src = path.resolve(folder, pkg.bin[b]) + fs.chmod(src, npm.modes.exec, function (er) { + if (er && er.code === 'ENOENT' && npm.config.get('ignore-scripts')) { + return cb() + } + if (er || !gtop) return cb(er) + var dest = path.resolve(binRoot, b) + var out = npm.config.get('parseable') + ? dest + '::' + src + ':BINFILE' + : dest + ' -> ' + src + log.clearProgress() + console.log(out) + log.showProgress() + cb() + }) + } + ) }, cb) } function linkBin (from, to, gently, cb) { - if (process.platform !== "win32") { + if (process.platform !== 'win32') { return linkIfExists(from, to, gently, cb) } else { return cmdShimIfExists(from, to, cb) @@ -215,10 +230,10 @@ function linkBin (from, to, gently, cb) { } function linkMans (pkg, folder, parent, gtop, cb) { - if (!pkg.man || !gtop || process.platform === "win32") return cb() + if (!pkg.man || !gtop || process.platform === 'win32') return cb() - var manRoot = path.resolve(npm.config.get("prefix"), "share", "man") - log.verbose("linkMans", "man files are", pkg.man, "in", manRoot) + var manRoot = path.resolve(npm.config.get('prefix'), 'share', 'man') + log.verbose('linkMans', 'man files are', pkg.man, 'in', manRoot) // make sure that the mans are unique. // otherwise, if there are dupes, it'll fail with EEXIST @@ -231,14 +246,14 @@ function linkMans (pkg, folder, parent, gtop, cb) { }) asyncMap(pkg.man, function (man, cb) { - if (typeof man !== "string") return cb() - log.silly("linkMans", "preparing to link", man) + if (typeof man !== 'string') return cb() + log.silly('linkMans', 'preparing to link', man) var parseMan = man.match(/(.*\.([0-9]+)(\.gz)?)$/) if (!parseMan) { return cb(new Error( - man+" is not a valid name for a man file. " + - "Man files must end with a number, " + - "and optionally a .gz suffix if they are compressed." + man + ' is not a valid name for a man file. ' + + 'Man files must end with a number, ' + + 'and optionally a .gz suffix if they are compressed.' )) } @@ -246,7 +261,7 @@ function linkMans (pkg, folder, parent, gtop, cb) { var sxn = parseMan[2] var bn = path.basename(stem) var manSrc = path.resolve(folder, man) - var manDest = path.join(manRoot, "man" + sxn, bn) + var manDest = path.join(manRoot, 'man' + sxn, bn) linkIfExists(manSrc, manDest, gtop && folder, cb) }, cb) diff --git a/deps/npm/lib/cache.js b/deps/npm/lib/cache.js index 2e11be32f862fa..757ba6e79df709 100644 --- a/deps/npm/lib/cache.js +++ b/deps/npm/lib/cache.js @@ -60,54 +60,53 @@ cache.unpack = unpack cache.clean = clean cache.read = read -var npm = require("./npm.js") - , fs = require("graceful-fs") - , writeFileAtomic = require("write-file-atomic") - , assert = require("assert") - , rm = require("./utils/gently-rm.js") - , readJson = require("read-package-json") - , log = require("npmlog") - , path = require("path") - , asyncMap = require("slide").asyncMap - , tar = require("./utils/tar.js") - , fileCompletion = require("./utils/completion/file-completion.js") - , deprCheck = require("./utils/depr-check.js") - , addNamed = require("./cache/add-named.js") - , addLocal = require("./cache/add-local.js") - , addRemoteTarball = require("./cache/add-remote-tarball.js") - , addRemoteGit = require("./cache/add-remote-git.js") - , inflight = require("inflight") - , realizePackageSpecifier = require("realize-package-specifier") - , npa = require("npm-package-arg") - , getStat = require("./cache/get-stat.js") - , cachedPackageRoot = require("./cache/cached-package-root.js") - , mapToRegistry = require("./utils/map-to-registry.js") - -cache.usage = "npm cache add " - + "\nnpm cache add " - + "\nnpm cache add " - + "\nnpm cache add " - + "\nnpm cache add @" - + "\nnpm cache ls []" - + "\nnpm cache clean [[@]]" +var npm = require('./npm.js') +var fs = require('graceful-fs') +var writeFileAtomic = require('write-file-atomic') +var assert = require('assert') +var rm = require('./utils/gently-rm.js') +var readJson = require('read-package-json') +var log = require('npmlog') +var path = require('path') +var asyncMap = require('slide').asyncMap +var tar = require('./utils/tar.js') +var fileCompletion = require('./utils/completion/file-completion.js') +var deprCheck = require('./utils/depr-check.js') +var addNamed = require('./cache/add-named.js') +var addLocal = require('./cache/add-local.js') +var addRemoteTarball = require('./cache/add-remote-tarball.js') +var addRemoteGit = require('./cache/add-remote-git.js') +var inflight = require('inflight') +var realizePackageSpecifier = require('realize-package-specifier') +var npa = require('npm-package-arg') +var getStat = require('./cache/get-stat.js') +var cachedPackageRoot = require('./cache/cached-package-root.js') +var mapToRegistry = require('./utils/map-to-registry.js') + +cache.usage = 'npm cache add ' + + '\nnpm cache add ' + + '\nnpm cache add ' + + '\nnpm cache add ' + + '\nnpm cache add @' + + '\nnpm cache ls []' + + '\nnpm cache clean [[@]]' cache.completion = function (opts, cb) { - var argv = opts.conf.argv.remain if (argv.length === 2) { - return cb(null, ["add", "ls", "clean"]) + return cb(null, ['add', 'ls', 'clean']) } switch (argv[2]) { - case "clean": - case "ls": + case 'clean': + case 'ls': // cache and ls are easy, because the completion is // what ls_ returns anyway. // just get the partial words, minus the last path part - var p = path.dirname(opts.partialWords.slice(3).join("/")) - if (p === ".") p = "" + var p = path.dirname(opts.partialWords.slice(3).join('/')) + if (p === '.') p = '' return ls_(p, 2, cb) - case "add": + case 'add': // Same semantics as install and publish. return npm.commands.install.completion(opts, cb) } @@ -116,10 +115,10 @@ cache.completion = function (opts, cb) { function cache (args, cb) { var cmd = args.shift() switch (cmd) { - case "rm": case "clear": case "clean": return clean(args, cb) - case "list": case "sl": case "ls": return ls(args, cb) - case "add": return add(args, npm.prefix, cb) - default: return cb("Usage: "+cache.usage) + case 'rm': case 'clear': case 'clean': return clean(args, cb) + case 'list': case 'sl': case 'ls': return ls(args, cb) + case 'add': return add(args, npm.prefix, cb) + default: return cb('Usage: ' + cache.usage) } } @@ -127,30 +126,30 @@ function cache (args, cb) { // just do a readJson and return. // if they're not, then fetch them from the registry. function read (name, ver, forceBypass, cb) { - assert(typeof name === "string", "must include name of module to install") - assert(typeof cb === "function", "must include callback") + assert(typeof name === 'string', 'must include name of module to install') + assert(typeof cb === 'function', 'must include callback') if (forceBypass === undefined || forceBypass === null) forceBypass = true - var root = cachedPackageRoot({name : name, version : ver}) + var root = cachedPackageRoot({name: name, version: ver}) function c (er, data) { - if (er) log.verbose("cache", "addNamed error for", name+"@"+ver, er) + if (er) log.verbose('cache', 'addNamed error for', name + '@' + ver, er) if (data) deprCheck(data) return cb(er, data) } - if (forceBypass && npm.config.get("force")) { - log.verbose("using force", "skipping cache") + if (forceBypass && npm.config.get('force')) { + log.verbose('using force', 'skipping cache') return addNamed(name, ver, null, c) } - readJson(path.join(root, "package", "package.json"), function (er, data) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + readJson(path.join(root, 'package', 'package.json'), function (er, data) { + if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) if (data) { - if (!data.name) return cb(new Error("No name provided")) - if (!data.version) return cb(new Error("No version provided")) + if (!data.name) return cb(new Error('No name provided')) + if (!data.version) return cb(new Error('No version provided')) } if (er) return addNamed(name, ver, null, c) @@ -159,33 +158,33 @@ function read (name, ver, forceBypass, cb) { } function normalize (args) { - var normalized = "" + var normalized = '' if (args.length > 0) { var a = npa(args[0]) if (a.name) normalized = a.name - if (a.rawSpec) normalized = [normalized, a.rawSpec].join("/") - if (args.length > 1) normalized = [normalized].concat(args.slice(1)).join("/") + if (a.rawSpec) normalized = [normalized, a.rawSpec].join('/') + if (args.length > 1) normalized = [normalized].concat(args.slice(1)).join('/') } - if (normalized.substr(-1) === "/") { + if (normalized.substr(-1) === '/') { normalized = normalized.substr(0, normalized.length - 1) } normalized = path.normalize(normalized) - log.silly("ls", "normalized", normalized) + log.silly('ls', 'normalized', normalized) return normalized } // npm cache ls [] function ls (args, cb) { - var prefix = npm.config.get("cache") + var prefix = npm.config.get('cache') if (prefix.indexOf(process.env.HOME) === 0) { - prefix = "~" + prefix.substr(process.env.HOME.length) + prefix = '~' + prefix.substr(process.env.HOME.length) } - ls_(normalize(args), npm.config.get("depth"), function (er, files) { + ls_(normalize(args), npm.config.get('depth'), function (er, files) { console.log(files.map(function (f) { return path.join(prefix, f) - }).join("\n").trim()) + }).join('\n').trim()) cb(er, files) }) } @@ -197,7 +196,7 @@ function ls_ (req, depth, cb) { // npm cache clean [] function clean (args, cb) { - assert(typeof cb === "function", "must include callback") + assert(typeof cb === 'function', 'must include callback') if (!args) args = [] @@ -205,15 +204,17 @@ function clean (args, cb) { if (f === npm.cache) { fs.readdir(npm.cache, function (er, files) { if (er) return cb() - asyncMap( files.filter(function (f) { - return npm.config.get("force") || f !== "-" - }).map(function (f) { - return path.join(npm.cache, f) - }) - , rm, cb ) + asyncMap( + files.filter(function (f) { + return npm.config.get('force') || f !== '-' + }).map(function (f) { + return path.join(npm.cache, f) + }), + rm, + cb + ) }) - } - else { + } else { rm(f, cb) } } @@ -223,8 +224,8 @@ function clean (args, cb) { // npm cache add // npm cache add cache.add = function (pkg, ver, where, scrub, cb) { - assert(typeof pkg === "string", "must include name of package to install") - assert(typeof cb === "function", "must include callback") + assert(typeof pkg === 'string', 'must include name of package to install') + assert(typeof cb === 'function', 'must include callback') if (scrub) { return clean([], function (er) { @@ -235,67 +236,63 @@ cache.add = function (pkg, ver, where, scrub, cb) { return add([pkg, ver], where, cb) } - var adding = 0 function add (args, where, cb) { // this is hot code. almost everything passes through here. // the args can be any of: - // ["url"] - // ["pkg", "version"] - // ["pkg@version"] - // ["pkg", "url"] + // ['url'] + // ['pkg', 'version'] + // ['pkg@version'] + // ['pkg', 'url'] // This is tricky, because urls can contain @ // Also, in some cases we get [name, null] rather // that just a single argument. - var usage = "Usage:\n" - + " npm cache add \n" - + " npm cache add @\n" - + " npm cache add \n" - + " npm cache add \n" - , spec + var usage = 'Usage:\n' + + ' npm cache add \n' + + ' npm cache add @\n' + + ' npm cache add \n' + + ' npm cache add \n' + var spec - log.silly("cache add", "args", args) + log.silly('cache add', 'args', args) if (args[1] === undefined) args[1] = null // at this point the args length must ==2 if (args[1] !== null) { - spec = args[0]+"@"+args[1] + spec = args[0] + '@' + args[1] } else if (args.length === 2) { spec = args[0] } - log.verbose("cache add", "spec", spec) + log.verbose('cache add', 'spec', spec) if (!spec) return cb(usage) - if (adding <= 0) { - npm.spinner.start() - } adding++ cb = afterAdd(cb) realizePackageSpecifier(spec, where, function (err, p) { if (err) return cb(err) - log.silly("cache add", "parsed spec", p) + log.silly('cache add', 'parsed spec', p) switch (p.type) { - case "local": - case "directory": + case 'local': + case 'directory': addLocal(p, null, cb) break - case "remote": + case 'remote': // get auth, if possible - mapToRegistry(spec, npm.config, function (err, uri, auth) { + mapToRegistry(p.raw, npm.config, function (err, uri, auth) { if (err) return cb(err) - addRemoteTarball(p.spec, {name : p.name}, null, auth, cb) + addRemoteTarball(p.spec, { name: p.name }, null, auth, cb) }) break - case "git": - case "hosted": + case 'git': + case 'hosted': addRemoteGit(p.rawSpec, cb) break default: @@ -307,47 +304,63 @@ function add (args, where, cb) { } function unpack (pkg, ver, unpackTarget, dMode, fMode, uid, gid, cb) { - if (typeof cb !== "function") cb = gid, gid = null - if (typeof cb !== "function") cb = uid, uid = null - if (typeof cb !== "function") cb = fMode, fMode = null - if (typeof cb !== "function") cb = dMode, dMode = null + if (typeof cb !== 'function') { + cb = gid + gid = null + } + if (typeof cb !== 'function') { + cb = uid + uid = null + } + if (typeof cb !== 'function') { + cb = fMode + fMode = null + } + if (typeof cb !== 'function') { + cb = dMode + dMode = null + } read(pkg, ver, false, function (er) { if (er) { - log.error("unpack", "Could not read data for %s", pkg + "@" + ver) + log.error('unpack', 'Could not read data for %s', pkg + '@' + ver) return cb(er) } npm.commands.unbuild([unpackTarget], true, function (er) { if (er) return cb(er) - tar.unpack( path.join(cachedPackageRoot({name : pkg, version : ver}), "package.tgz") - , unpackTarget - , dMode, fMode - , uid, gid - , cb ) + tar.unpack( + path.join(cachedPackageRoot({ name: pkg, version: ver }), 'package.tgz'), + unpackTarget, + dMode, fMode, + uid, gid, + cb + ) }) }) } -function afterAdd (cb) { return function (er, data) { - adding-- - if (adding <= 0) npm.spinner.stop() +function afterAdd (cb) { + return function (er, data) { + adding-- - if (er || !data || !data.name || !data.version) return cb(er, data) - log.silly("cache", "afterAdd", data.name+"@"+data.version) + if (er || !data || !data.name || !data.version) return cb(er, data) + log.silly('cache', 'afterAdd', data.name + '@' + data.version) - // Save the resolved, shasum, etc. into the data so that the next - // time we load from this cached data, we have all the same info. - var pj = path.join(cachedPackageRoot(data), "package", "package.json") + // Save the resolved, shasum, etc. into the data so that the next + // time we load from this cached data, we have all the same info. + // Ignore if it fails. + var pj = path.join(cachedPackageRoot(data), 'package', 'package.json') - var done = inflight(pj, cb) - if (!done) return log.verbose("afterAdd", pj, "already in flight; not writing") - log.verbose("afterAdd", pj, "not in flight; writing") + var done = inflight(pj, cb) + if (!done) return log.verbose('afterAdd', pj, 'already in flight; not writing') + log.verbose('afterAdd', pj, 'not in flight; writing') - getStat(function (er, cs) { - if (er) return done(er) - writeFileAtomic(pj, JSON.stringify(data), {chown : cs}, function (er) { - if (!er) log.verbose("afterAdd", pj, "written") - return done(er, data) + getStat(function (er, cs) { + if (er) return done(er) + writeFileAtomic(pj, JSON.stringify(data), { chown: cs }, function (er) { + if (!er) log.verbose('afterAdd', pj, 'written') + return done(null, data) + }) }) - }) -}} + } +} diff --git a/deps/npm/lib/cache/add-local-tarball.js b/deps/npm/lib/cache/add-local-tarball.js index e84b66dd8dd51f..d0952b64ef9a60 100644 --- a/deps/npm/lib/cache/add-local-tarball.js +++ b/deps/npm/lib/cache/add-local-tarball.js @@ -1,26 +1,28 @@ -var mkdir = require("mkdirp") - , assert = require("assert") - , fs = require("graceful-fs") - , writeFileAtomic = require("write-file-atomic") - , path = require("path") - , sha = require("sha") - , npm = require("../npm.js") - , log = require("npmlog") - , tar = require("../utils/tar.js") - , pathIsInside = require("path-is-inside") - , getCacheStat = require("./get-stat.js") - , cachedPackageRoot = require("./cached-package-root.js") - , chownr = require("chownr") - , inflight = require("inflight") - , once = require("once") - , writeStream = require("fs-write-stream-atomic") - , randomBytes = require("crypto").pseudoRandomBytes // only need uniqueness +var mkdir = require('mkdirp') +var assert = require('assert') +var fs = require('graceful-fs') +var writeFileAtomic = require('write-file-atomic') +var path = require('path') +var sha = require('sha') +var npm = require('../npm.js') +var log = require('npmlog') +var tar = require('../utils/tar.js') +var pathIsInside = require('path-is-inside') +var getCacheStat = require('./get-stat.js') +var cachedPackageRoot = require('./cached-package-root.js') +var chownr = require('chownr') +var inflight = require('inflight') +var once = require('once') +var writeStreamAtomic = require('fs-write-stream-atomic') +var tempFilename = require('../utils/temp-filename.js') +var rimraf = require('rimraf') +var packageId = require('../utils/package-id.js') module.exports = addLocalTarball function addLocalTarball (p, pkgData, shasum, cb) { - assert(typeof p === "string", "must have path") - assert(typeof cb === "function", "must have callback") + assert(typeof p === 'string', 'must have path') + assert(typeof cb === 'function', 'must have callback') if (!pkgData) pkgData = {} @@ -28,16 +30,16 @@ function addLocalTarball (p, pkgData, shasum, cb) { if (!shasum) { return sha.get(p, function (er, shasum) { if (er) return cb(er) - log.silly("addLocalTarball", "shasum (computed)", shasum) + log.silly('addLocalTarball', 'shasum (computed)', shasum) addLocalTarball(p, pkgData, shasum, cb) }) } if (pathIsInside(p, npm.cache)) { - if (path.basename(p) !== "package.tgz") { - return cb(new Error("Not a valid cache tarball name: "+p)) + if (path.basename(p) !== 'package.tgz') { + return cb(new Error('Not a valid cache tarball name: ' + p)) } - log.verbose("addLocalTarball", "adding from inside cache", p) + log.verbose('addLocalTarball', 'adding from inside cache', p) return addPlacedTarball(p, pkgData, shasum, cb) } @@ -51,8 +53,8 @@ function addLocalTarball (p, pkgData, shasum, cb) { } function addPlacedTarball (p, pkgData, shasum, cb) { - assert(pkgData, "should have package data by now") - assert(typeof cb === "function", "cb function required") + assert(pkgData, 'should have package data by now') + assert(typeof cb === 'function', 'cb function required') getCacheStat(function (er, cs) { if (er) return cb(er) @@ -61,7 +63,7 @@ function addPlacedTarball (p, pkgData, shasum, cb) { } function addPlacedTarball_ (p, pkgData, uid, gid, resolvedSum, cb) { - var folder = path.join(cachedPackageRoot(pkgData), "package") + var folder = path.join(cachedPackageRoot(pkgData), 'package') // First, make sure we have the shasum, if we don't already. if (!resolvedSum) { @@ -74,7 +76,7 @@ function addPlacedTarball_ (p, pkgData, uid, gid, resolvedSum, cb) { mkdir(folder, function (er) { if (er) return cb(er) - var pj = path.join(folder, "package.json") + var pj = path.join(folder, 'package.json') var json = JSON.stringify(pkgData, null, 2) writeFileAtomic(pj, json, function (er) { cb(er, pkgData) @@ -83,19 +85,19 @@ function addPlacedTarball_ (p, pkgData, uid, gid, resolvedSum, cb) { } function addTmpTarball (tgz, pkgData, shasum, cb) { - assert(typeof cb === "function", "must have callback function") - assert(shasum, "must have shasum by now") + assert(typeof cb === 'function', 'must have callback function') + assert(shasum, 'must have shasum by now') - cb = inflight("addTmpTarball:" + tgz, cb) - if (!cb) return log.verbose("addTmpTarball", tgz, "already in flight; not adding") - log.verbose("addTmpTarball", tgz, "not in flight; adding") + cb = inflight('addTmpTarball:' + tgz, cb) + if (!cb) return log.verbose('addTmpTarball', tgz, 'already in flight; not adding') + log.verbose('addTmpTarball', tgz, 'not in flight; adding') // we already have the package info, so just move into place if (pkgData && pkgData.name && pkgData.version) { log.verbose( - "addTmpTarball", - "already have metadata; skipping unpack for", - pkgData.name + "@" + pkgData.version + 'addTmpTarball', + 'already have metadata; skipping unpack for', + packageId(pkgData) ) return addTmpTarball_(tgz, pkgData, shasum, cb) } @@ -107,34 +109,29 @@ function addTmpTarball (tgz, pkgData, shasum, cb) { // NOTE: we might not have any clue what we think it is, for example if the // user just did `npm install ./foo.tgz` - // generate a unique filename - randomBytes(6, function (er, random) { + var target = tempFilename('unpack') + getCacheStat(function (er, cs) { if (er) return cb(er) - var target = path.join(npm.tmp, "unpack-" + random.toString("hex")) - getCacheStat(function (er, cs) { - if (er) return cb(er) - - log.verbose("addTmpTarball", "validating metadata from", tgz) - tar.unpack(tgz, target, null, null, cs.uid, cs.gid, function (er, data) { - if (er) return cb(er) - + log.verbose('addTmpTarball', 'validating metadata from', tgz) + tar.unpack(tgz, target, null, null, cs.uid, cs.gid, function (unpackEr, data) { + // cleanup the extracted package and move on with the metadata + rimraf(target, function () { + if (unpackEr) return cb(unpackEr) // check that this is what we expected. if (!data.name) { - return cb(new Error("No name provided")) - } - else if (pkgData.name && data.name !== pkgData.name) { - return cb(new Error("Invalid Package: expected " + pkgData.name + - " but found " + data.name)) + return cb(new Error('No name provided')) + } else if (pkgData.name && data.name !== pkgData.name) { + return cb(new Error('Invalid Package: expected ' + pkgData.name + + ' but found ' + data.name)) } if (!data.version) { - return cb(new Error("No version provided")) - } - else if (pkgData.version && data.version !== pkgData.version) { - return cb(new Error("Invalid Package: expected " + - pkgData.name + "@" + pkgData.version + - " but found " + data.name + "@" + data.version)) + return cb(new Error('No version provided')) + } else if (pkgData.version && data.version !== pkgData.version) { + return cb(new Error('Invalid Package: expected ' + + packageId(pkgData) + + ' but found ' + packageId(data))) } addTmpTarball_(tgz, data, shasum, cb) @@ -144,19 +141,18 @@ function addTmpTarball (tgz, pkgData, shasum, cb) { } function addTmpTarball_ (tgz, data, shasum, cb) { - assert(typeof cb === "function", "must have callback function") + assert(typeof cb === 'function', 'must have callback function') cb = once(cb) - assert(data.name, "should have package name by now") - assert(data.version, "should have package version by now") + assert(data.name, 'should have package name by now') + assert(data.version, 'should have package version by now') var root = cachedPackageRoot(data) - var pkg = path.resolve(root, "package") - var target = path.resolve(root, "package.tgz") + var pkg = path.resolve(root, 'package') + var target = path.resolve(root, 'package.tgz') getCacheStat(function (er, cs) { if (er) return cb(er) mkdir(pkg, function (er, created) { - // chown starting from the first dir created by mkdirp, // or the root dir, if none had to be created, so that // we know that we get all the children. @@ -166,14 +162,13 @@ function addTmpTarball_ (tgz, data, shasum, cb) { if (er) return cb(er) var read = fs.createReadStream(tgz) - var write = writeStream(target, { mode: npm.modes.file }) + var write = writeStreamAtomic(target, { mode: npm.modes.file }) var fin = cs.uid && cs.gid ? chown : done - read.on("error", cb).pipe(write).on("error", cb).on("close", fin) + read.on('error', cb).pipe(write).on('error', cb).on('close', fin) }) - }) - function done() { + function done () { data._shasum = data._shasum || shasum cb(null, data) } diff --git a/deps/npm/lib/cache/add-local.js b/deps/npm/lib/cache/add-local.js index e7d286e4fb5d40..075ca5fc61d8de 100644 --- a/deps/npm/lib/cache/add-local.js +++ b/deps/npm/lib/cache/add-local.js @@ -1,44 +1,45 @@ -var assert = require("assert") - , path = require("path") - , mkdir = require("mkdirp") - , chownr = require("chownr") - , pathIsInside = require("path-is-inside") - , readJson = require("read-package-json") - , log = require("npmlog") - , npm = require("../npm.js") - , tar = require("../utils/tar.js") - , deprCheck = require("../utils/depr-check.js") - , getCacheStat = require("./get-stat.js") - , cachedPackageRoot = require("./cached-package-root.js") - , addLocalTarball = require("./add-local-tarball.js") - , sha = require("sha") - , inflight = require("inflight") +var assert = require('assert') +var path = require('path') +var mkdir = require('mkdirp') +var chownr = require('chownr') +var pathIsInside = require('path-is-inside') +var readJson = require('read-package-json') +var log = require('npmlog') +var npm = require('../npm.js') +var tar = require('../utils/tar.js') +var deprCheck = require('../utils/depr-check.js') +var getCacheStat = require('./get-stat.js') +var cachedPackageRoot = require('./cached-package-root.js') +var addLocalTarball = require('./add-local-tarball.js') +var sha = require('sha') +var inflight = require('inflight') +var lifecycle = require('../utils/lifecycle.js') +var iferr = require('iferr') module.exports = addLocal function addLocal (p, pkgData, cb_) { - assert(typeof p === "object", "must have spec info") - assert(typeof cb === "function", "must have callback") + assert(typeof p === 'object', 'must have spec info') + assert(typeof cb === 'function', 'must have callback') pkgData = pkgData || {} function cb (er, data) { if (er) { - log.error("addLocal", "Could not install %s", p.spec) + log.error('addLocal', 'Could not install %s', p.spec) return cb_(er) } - if (data && !data._fromGithub) { - data._from = path.relative(npm.prefix, p.spec) || "." + if (data && !data._fromHosted) { + data._from = path.relative(npm.prefix, p.spec) || '.' var resolved = path.relative(npm.prefix, p.spec) - if (resolved) data._resolved = "file:"+resolved + if (resolved) data._resolved = 'file:' + resolved } return cb_(er, data) } - if (p.type === "directory") { + if (p.type === 'directory') { addLocalDirectory(p.spec, pkgData, null, cb) - } - else { + } else { addLocalTarball(p.spec, pkgData, null, cb) } } @@ -46,33 +47,34 @@ function addLocal (p, pkgData, cb_) { // At this point, if shasum is set, it's something that we've already // read and checked. Just stashing it in the data at this point. function addLocalDirectory (p, pkgData, shasum, cb) { - assert(pkgData, "must pass package data") - assert(typeof cb === "function", "must have callback") + assert(pkgData, 'must pass package data') + assert(typeof cb === 'function', 'must have callback') // if it's a folder, then read the package.json, // tar it to the proper place, and add the cache tar - if (pathIsInside(p, npm.cache)) return cb(new Error( - "Adding a cache directory to the cache will make the world implode.")) + if (pathIsInside(p, npm.cache)) { + return cb(new Error( + 'Adding a cache directory to the cache will make the world implode.' + )) + } - readJson(path.join(p, "package.json"), false, function (er, data) { + readJson(path.join(p, 'package.json'), false, function (er, data) { if (er) return cb(er) if (!data.name) { - return cb(new Error("No name provided in package.json")) - } - else if (pkgData.name && pkgData.name !== data.name) { + return cb(new Error('No name provided in package.json')) + } else if (pkgData.name && pkgData.name !== data.name) { return cb(new Error( - "Invalid package: expected " + pkgData.name + " but found " + data.name + 'Invalid package: expected ' + pkgData.name + ' but found ' + data.name )) } if (!data.version) { - return cb(new Error("No version provided in package.json")) - } - else if (pkgData.version && pkgData.version !== data.version) { + return cb(new Error('No version provided in package.json')) + } else if (pkgData.version && pkgData.version !== data.version) { return cb(new Error( - "Invalid package: expected " + pkgData.name + "@" + pkgData.version + - " but found " + data.name + "@" + data.version + 'Invalid package: expected ' + pkgData.name + '@' + pkgData.version + + ' but found ' + data.name + '@' + data.version )) } @@ -80,27 +82,34 @@ function addLocalDirectory (p, pkgData, shasum, cb) { // pack to {cache}/name/ver/package.tgz var root = cachedPackageRoot(data) - var tgz = path.resolve(root, "package.tgz") - var pj = path.resolve(root, "package/package.json") + var tgz = path.resolve(root, 'package.tgz') + var pj = path.resolve(root, 'package/package.json') var wrapped = inflight(tgz, next) - if (!wrapped) return log.verbose("addLocalDirectory", tgz, "already in flight; waiting") - log.verbose("addLocalDirectory", tgz, "not in flight; packing") + if (!wrapped) return log.verbose('addLocalDirectory', tgz, 'already in flight; waiting') + log.verbose('addLocalDirectory', tgz, 'not in flight; packing') getCacheStat(function (er, cs) { mkdir(path.dirname(pj), function (er, made) { if (er) return cb(er) - var fancy = !pathIsInside(p, npm.tmp) - tar.pack(tgz, p, data, fancy, function (er) { - if (er) { - log.error("addLocalDirectory", "Could not pack", p, "to", tgz) - return cb(er) - } - - if (!cs || isNaN(cs.uid) || isNaN(cs.gid)) wrapped() - - chownr(made || tgz, cs.uid, cs.gid, wrapped) - }) + var doPrePublish = !pathIsInside(p, npm.tmp) + if (doPrePublish) { + lifecycle(data, 'prepublish', p, iferr(cb, thenPack)) + } else { + thenPack() + } + function thenPack () { + tar.pack(tgz, p, data, function (er) { + if (er) { + log.error('addLocalDirectory', 'Could not pack', p, 'to', tgz) + return cb(er) + } + + if (!cs || isNaN(cs.uid) || isNaN(cs.gid)) wrapped() + + chownr(made || tgz, cs.uid, cs.gid, wrapped) + }) + } }) }) diff --git a/deps/npm/lib/cache/add-named.js b/deps/npm/lib/cache/add-named.js index acc67bf9d26d4f..f0e5e2c33a8f31 100644 --- a/deps/npm/lib/cache/add-named.js +++ b/deps/npm/lib/cache/add-named.js @@ -1,23 +1,24 @@ -var path = require("path") - , assert = require("assert") - , fs = require("graceful-fs") - , http = require("http") - , log = require("npmlog") - , semver = require("semver") - , readJson = require("read-package-json") - , url = require("url") - , npm = require("../npm.js") - , deprCheck = require("../utils/depr-check.js") - , inflight = require("inflight") - , addRemoteTarball = require("./add-remote-tarball.js") - , cachedPackageRoot = require("./cached-package-root.js") - , mapToRegistry = require("../utils/map-to-registry.js") - +var path = require('path') +var assert = require('assert') +var fs = require('graceful-fs') +var http = require('http') +var log = require('npmlog') +var semver = require('semver') +var readJson = require('read-package-json') +var url = require('url') +var npm = require('../npm.js') +var deprCheck = require('../utils/depr-check.js') +var inflight = require('inflight') +var addRemoteTarball = require('./add-remote-tarball.js') +var cachedPackageRoot = require('./cached-package-root.js') +var mapToRegistry = require('../utils/map-to-registry.js') +var pulseTillDone = require('../utils/pulse-till-done.js') +var packageId = require('../utils/package-id.js') module.exports = addNamed function getOnceFromRegistry (name, from, next, done) { - function fixName(err, data, json, resp) { + function fixName (err, data, json, resp) { // this is only necessary until npm/npm-registry-client#80 is fixed if (err && err.pkgid && err.pkgid !== name) { err.message = err.message.replace( @@ -32,24 +33,24 @@ function getOnceFromRegistry (name, from, next, done) { mapToRegistry(name, npm.config, function (er, uri, auth) { if (er) return done(er) - var key = "registry:" + uri + var key = 'registry:' + uri next = inflight(key, next) - if (!next) return log.verbose(from, key, "already in flight; waiting") - else log.verbose(from, key, "not in flight; fetching") + if (!next) return log.verbose(from, key, 'already in flight; waiting') + else log.verbose(from, key, 'not in flight; fetching') - npm.registry.get(uri, { auth : auth }, fixName) + npm.registry.get(uri, { auth: auth }, pulseTillDone('fetchRegistry', fixName)) }) } function addNamed (name, version, data, cb_) { - assert(typeof name === "string", "must have module name") - assert(typeof cb_ === "function", "must have callback") + assert(typeof name === 'string', 'must have module name') + assert(typeof cb_ === 'function', 'must have callback') - var key = name + "@" + version - log.silly("addNamed", key) + var key = name + '@' + version + log.silly('addNamed', key) function cb (er, data) { - if (data && !data._fromGithub) data._from = key + if (data && !data._fromHosted) data._from = key cb_(er, data) } @@ -66,29 +67,29 @@ function addNamed (name, version, data, cb_) { } function addNameTag (name, tag, data, cb) { - log.info("addNameTag", [name, tag]) + log.info('addNameTag', [name, tag]) var explicit = true if (!tag) { explicit = false - tag = npm.config.get("tag") + tag = npm.config.get('tag') } - getOnceFromRegistry(name, "addNameTag", next, cb) + getOnceFromRegistry(name, 'addNameTag', next, cb) function next (er, data, json, resp) { if (!er) er = errorResponse(name, resp) if (er) return cb(er) - log.silly("addNameTag", "next cb for", name, "with tag", tag) + log.silly('addNameTag', 'next cb for', name, 'with tag', tag) engineFilter(data) - if (data["dist-tags"] && data["dist-tags"][tag] - && data.versions[data["dist-tags"][tag]]) { - var ver = data["dist-tags"][tag] + if (data['dist-tags'] && data['dist-tags'][tag] && + data.versions[data['dist-tags'][tag]]) { + var ver = data['dist-tags'][tag] return addNamed(name, ver, data.versions[ver], cb) } if (!explicit && Object.keys(data.versions).length) { - return addNamed(name, "*", data, cb) + return addNamed(name, '*', data, cb) } er = installTargetsError(tag, data) @@ -98,17 +99,17 @@ function addNameTag (name, tag, data, cb) { function engineFilter (data) { var npmv = npm.version - , nodev = npm.config.get("node-version") - , strict = npm.config.get("engine-strict") + var nodev = npm.config.get('node-version') + var strict = npm.config.get('engine-strict') - if (!nodev || npm.config.get("force")) return data + if (!nodev || npm.config.get('force')) return data Object.keys(data.versions || {}).forEach(function (v) { var eng = data.versions[v].engines if (!eng) return - if (!strict && !data.versions[v].engineStrict) return - if (eng.node && !semver.satisfies(nodev, eng.node, true) - || eng.npm && !semver.satisfies(npmv, eng.npm, true)) { + if (!strict) return + if (eng.node && !semver.satisfies(nodev, eng.node, true) || + eng.npm && !semver.satisfies(npmv, eng.npm, true)) { delete data.versions[v] } }) @@ -116,7 +117,7 @@ function engineFilter (data) { function addNameVersion (name, v, data, cb) { var ver = semver.valid(v, true) - if (!ver) return cb(new Error("Invalid version: "+v)) + if (!ver) return cb(new Error('Invalid version: ' + v)) var response @@ -125,7 +126,7 @@ function addNameVersion (name, v, data, cb) { return next() } - getOnceFromRegistry(name, "addNameVersion", setData, cb) + getOnceFromRegistry(name, 'addNameVersion', setData, cb) function setData (er, d, json, resp) { if (!er) { @@ -134,7 +135,7 @@ function addNameVersion (name, v, data, cb) { if (er) return cb(er) data = d && d.versions[ver] if (!data) { - er = new Error("version not found: "+name+"@"+ver) + er = new Error('version not found: ' + name + '@' + ver) er.package = name er.statusCode = 404 return cb(er) @@ -147,27 +148,30 @@ function addNameVersion (name, v, data, cb) { deprCheck(data) var dist = data.dist - if (!dist) return cb(new Error("No dist in "+data._id+" package")) + if (!dist) return cb(new Error('No dist in ' + packageId(data) + ' package')) - if (!dist.tarball) return cb(new Error( - "No dist.tarball in " + data._id + " package")) + if (!dist.tarball) { + return cb(new Error( + 'No dist.tarball in ' + packageId(data) + ' package' + )) + } - if ((response && response.statusCode !== 304) || npm.config.get("force")) { + if ((response && response.statusCode !== 304) || npm.config.get('force')) { return fetchit() } // we got cached data, so let's see if we have a tarball. - var pkgroot = cachedPackageRoot({name : name, version : ver}) - var pkgtgz = path.join(pkgroot, "package.tgz") - var pkgjson = path.join(pkgroot, "package", "package.json") + var pkgroot = cachedPackageRoot({ name: name, version: ver }) + var pkgtgz = path.join(pkgroot, 'package.tgz') + var pkgjson = path.join(pkgroot, 'package', 'package.json') fs.stat(pkgtgz, function (er) { if (!er) { readJson(pkgjson, function (er, data) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) if (data) { - if (!data.name) return cb(new Error("No name provided")) - if (!data.version) return cb(new Error("No version provided")) + if (!data.name) return cb(new Error('No name provided')) + if (!data.version) return cb(new Error('No version provided')) // check the SHA of the package we have, to ensure it wasn't installed // from somewhere other than the registry (eg, a fork) @@ -205,8 +209,8 @@ function addNameVersion (name, v, data, cb) { // Only add non-shasum'ed packages if --forced. Only ancient things // would lack this for good reasons nowadays. - if (!dist.shasum && !npm.config.get("force")) { - return cb(new Error("package lacks shasum: " + data._id)) + if (!dist.shasum && !npm.config.get('force')) { + return cb(new Error('package lacks shasum: ' + packageId(data))) } addRemoteTarball(tb, data, dist.shasum, auth, cb) @@ -217,15 +221,17 @@ function addNameVersion (name, v, data, cb) { function addNameRange (name, range, data, cb) { range = semver.validRange(range, true) - if (range === null) return cb(new Error( - "Invalid version range: " + range - )) + if (range === null) { + return cb(new Error( + 'Invalid version range: ' + range + )) + } - log.silly("addNameRange", {name:name, range:range, hasData:!!data}) + log.silly('addNameRange', { name: name, range: range, hasData: !!data }) if (data) return next() - getOnceFromRegistry(name, "addNameRange", setData, cb) + getOnceFromRegistry(name, 'addNameRange', setData, cb) function setData (er, d, json, resp) { if (!er) { @@ -237,18 +243,20 @@ function addNameRange (name, range, data, cb) { } function next () { - log.silly( "addNameRange", "number 2" - , {name:name, range:range, hasData:!!data}) + log.silly( + 'addNameRange', + 'number 2', { name: name, range: range, hasData: !!data } + ) engineFilter(data) - log.silly("addNameRange", "versions" + log.silly('addNameRange', 'versions' , [data.name, Object.keys(data.versions || {})]) // if the tagged version satisfies, then use that. - var tagged = data["dist-tags"][npm.config.get("tag")] - if (tagged - && data.versions[tagged] - && semver.satisfies(tagged, range, true)) { + var tagged = data['dist-tags'][npm.config.get('tag')] + if (tagged && + data.versions[tagged] && + semver.satisfies(tagged, range, true)) { return addNamed(name, tagged, data.versions[tagged], cb) } @@ -256,8 +264,8 @@ function addNameRange (name, range, data, cb) { var versions = Object.keys(data.versions || {}) var ms = semver.maxSatisfying(versions, range, true) if (!ms) { - if (range === "*" && versions.length) { - return addNameTag(name, "latest", data, cb) + if (range === '*' && versions.length) { + return addNameTag(name, 'latest', data, cb) } else { return cb(installTargetsError(range, data)) } @@ -270,20 +278,19 @@ function addNameRange (name, range, data, cb) { } function installTargetsError (requested, data) { - var targets = Object.keys(data["dist-tags"]).filter(function (f) { + var targets = Object.keys(data['dist-tags']).filter(function (f) { return (data.versions || {}).hasOwnProperty(f) }).concat(Object.keys(data.versions || {})) - requested = data.name + (requested ? "@'" + requested + "'" : "") + requested = data.name + (requested ? "@'" + requested + "'" : '') targets = targets.length - ? "Valid install targets:\n" + JSON.stringify(targets) + "\n" - : "No valid targets found.\n" - + "Perhaps not compatible with your version of node?" + ? 'Valid install targets:\n' + targets.join(', ') + '\n' + : 'No valid targets found.\n' + + 'Perhaps not compatible with your version of node?' - var er = new Error( "No compatible version found: " - + requested + "\n" + targets) - er.code = "ETARGET" + var er = new Error('No compatible version found: ' + requested + '\n' + targets) + er.code = 'ETARGET' return er } @@ -292,7 +299,7 @@ function errorResponse (name, response) { if (response.statusCode >= 400) { er = new Error(http.STATUS_CODES[response.statusCode]) er.statusCode = response.statusCode - er.code = "E" + er.statusCode + er.code = 'E' + er.statusCode er.pkgid = name } return er diff --git a/deps/npm/lib/cache/add-remote-git.js b/deps/npm/lib/cache/add-remote-git.js index d3ecccdce9af81..5fbd8dbeda201f 100644 --- a/deps/npm/lib/cache/add-remote-git.js +++ b/deps/npm/lib/cache/add-remote-git.js @@ -1,5 +1,4 @@ var assert = require('assert') -var crypto = require('crypto') var fs = require('graceful-fs') var path = require('path') var url = require('url') @@ -13,12 +12,14 @@ var mkdir = require('mkdirp') var normalizeGitUrl = require('normalize-git-url') var npa = require('npm-package-arg') var realizePackageSpecifier = require('realize-package-specifier') +var uniqueFilename = require('unique-filename') var addLocal = require('./add-local.js') var correctMkdir = require('../utils/correct-mkdir.js') var git = require('../utils/git.js') var npm = require('../npm.js') var rm = require('../utils/gently-rm.js') +var tempFilename = require('../utils/temp-filename.js') var remotes = path.resolve(npm.config.get('cache'), '_git-remotes') var templates = path.join(remotes, '_templates') @@ -47,7 +48,7 @@ function addRemoteGit (uri, _cb) { if (parsed) { // normalize GitHub syntax to org/repo (for now) var from - if (parsed.type === 'github' && parsed.default === 'shortcut') { + if (parsed.type === 'github' && parsed.getDefaultRepresentation() === 'shortcut') { from = parsed.path() } else { from = parsed.toString() @@ -56,7 +57,7 @@ function addRemoteGit (uri, _cb) { log.verbose('addRemoteGit', from, 'is a repository hosted by', parsed.type) // prefer explicit URLs to pushing everything through shortcuts - if (parsed.default !== 'shortcut') { + if (parsed.getDefaultRepresentation() !== 'shortcut') { return tryClone(from, parsed.toString(), false, cb) } @@ -75,7 +76,7 @@ function addRemoteGit (uri, _cb) { function tryGitProto (from, hostedInfo, cb) { var gitURL = hostedInfo.git() - if (!gitURL) return trySSH(from, hostedInfo, cb) + if (!gitURL) return tryHTTPS(from, hostedInfo, cb) log.silly('tryGitProto', 'attempting to clone', gitURL) tryClone(from, gitURL, true, function (er) { @@ -115,9 +116,9 @@ function tryClone (from, combinedURL, silent, cb) { var treeish = normalized.branch // ensure that similarly-named remotes don't collide - var repoID = cloneURL.replace(/[^a-zA-Z0-9]+/g, '-') + '-' + - crypto.createHash('sha1').update(combinedURL).digest('hex').slice(0, 8) - var cachedRemote = path.join(remotes, repoID) + var cachedRemote = uniqueFilename(remotes, combinedURL.replace(/[^a-zA-Z0-9]+/g, '-'), cloneURL) + var repoID = path.relative(remotes, cachedRemote) + cachedRemote = path.join(remotes, repoID) cb = inflight(repoID, cb) if (!cb) { @@ -297,11 +298,7 @@ function resolveHead (from, cloneURL, treeish, cachedRemote, cb) { log.verbose('resolveHead', from, 'resolved Git URL:', resolvedURL) // generate a unique filename - var tmpdir = path.join( - npm.tmp, - 'git-cache-' + crypto.pseudoRandomBytes(6).toString('hex'), - resolvedTreeish - ) + var tmpdir = path.join(tempFilename('git-cache'), resolvedTreeish) log.silly('resolveHead', 'Git working directory:', tmpdir) mkdir(tmpdir, function (er) { @@ -349,6 +346,24 @@ function checkoutTreeish (from, resolvedURL, resolvedTreeish, tmpdir, cb) { } log.verbose('checkoutTreeish', from, 'checkout', stdout) + updateSubmodules(from, resolvedURL, tmpdir, cb) + } + ) +} + +function updateSubmodules (from, resolvedURL, tmpdir, cb) { + var args = ['submodule', '-q', 'update', '--init', '--recursive'] + git.whichAndExec( + args, + { cwd: tmpdir, env: gitEnv() }, + function (er, stdout, stderr) { + stdout = (stdout + '\n' + stderr).trim() + if (er) { + log.error('git ' + args.join(' ') + ':', stderr) + return cb(er) + } + log.verbose('updateSubmodules', from, 'submodule update', stdout) + // convince addLocal that the checkout is a local dependency realizePackageSpecifier(tmpdir, function (er, spec) { if (er) { diff --git a/deps/npm/lib/cache/add-remote-tarball.js b/deps/npm/lib/cache/add-remote-tarball.js index 66d22009663307..90296c111fcf5a 100644 --- a/deps/npm/lib/cache/add-remote-tarball.js +++ b/deps/npm/lib/cache/add-remote-tarball.js @@ -1,20 +1,23 @@ -var mkdir = require("mkdirp") - , assert = require("assert") - , log = require("npmlog") - , path = require("path") - , sha = require("sha") - , retry = require("retry") - , createWriteStream = require("fs-write-stream-atomic") - , npm = require("../npm.js") - , inflight = require("inflight") - , addLocalTarball = require("./add-local-tarball.js") - , cacheFile = require("npm-cache-filename") +var mkdir = require('mkdirp') +var assert = require('assert') +var log = require('npmlog') +var path = require('path') +var sha = require('sha') +var retry = require('retry') +var writeStreamAtomic = require('fs-write-stream-atomic') +var PassThrough = require('readable-stream').PassThrough +var npm = require('../npm.js') +var inflight = require('inflight') +var addLocalTarball = require('./add-local-tarball.js') +var cacheFile = require('npm-cache-filename') +var rimraf = require('rimraf') +var pulseTillDone = require('../utils/pulse-till-done.js') module.exports = addRemoteTarball function addRemoteTarball (u, pkgData, shasum, auth, cb_) { - assert(typeof u === "string", "must have module URL") - assert(typeof cb_ === "function", "must have callback") + assert(typeof u === 'string', 'must have module URL') + assert(typeof cb_ === 'function', 'must have callback') function cb (er, data) { if (data) { @@ -26,8 +29,8 @@ function addRemoteTarball (u, pkgData, shasum, auth, cb_) { } cb_ = inflight(u, cb_) - if (!cb_) return log.verbose("addRemoteTarball", u, "already in flight; waiting") - log.verbose("addRemoteTarball", u, "not in flight; adding") + if (!cb_) return log.verbose('addRemoteTarball', u, 'already in flight; waiting') + log.verbose('addRemoteTarball', u, 'not in flight; adding') // XXX Fetch direct to cache location, store tarballs under // ${cache}/registry.npmjs.org/pkg/-/pkg-1.2.3.tgz @@ -35,10 +38,16 @@ function addRemoteTarball (u, pkgData, shasum, auth, cb_) { function next (er, resp, shasum) { if (er) return cb(er) - addLocalTarball(tmp, pkgData, shasum, cb) + addLocalTarball(tmp, pkgData, shasum, cleanup) + } + function cleanup (er, data) { + if (er) return cb(er) + rimraf(tmp, function () { + cb(er, data) + }) } - log.verbose("addRemoteTarball", [u, shasum]) + log.verbose('addRemoteTarball', [u, shasum]) mkdir(path.dirname(tmp), function (er) { if (er) return cb(er) addRemoteTarball_(u, tmp, shasum, auth, next) @@ -49,21 +58,24 @@ function addRemoteTarball_ (u, tmp, shasum, auth, cb) { // Tuned to spread 3 attempts over about a minute. // See formula at . var operation = retry.operation({ - retries: npm.config.get("fetch-retries") - , factor: npm.config.get("fetch-retry-factor") - , minTimeout: npm.config.get("fetch-retry-mintimeout") - , maxTimeout: npm.config.get("fetch-retry-maxtimeout") + retries: npm.config.get('fetch-retries'), + factor: npm.config.get('fetch-retry-factor'), + minTimeout: npm.config.get('fetch-retry-mintimeout'), + maxTimeout: npm.config.get('fetch-retry-maxtimeout') }) operation.attempt(function (currentAttempt) { - log.info("retry", "fetch attempt " + currentAttempt - + " at " + (new Date()).toLocaleTimeString()) + log.info( + 'retry', + 'fetch attempt', currentAttempt, + 'at', (new Date()).toLocaleTimeString() + ) fetchAndShaCheck(u, tmp, shasum, auth, function (er, response, shasum) { // Only retry on 408, 5xx or no `response`. var sc = response && response.statusCode var statusRetry = !sc || (sc === 408 || sc >= 500) if (er && statusRetry && operation.retry(er)) { - log.warn("retry", "will retry, error on last attempt: " + er) + log.warn('retry', 'will retry, error on last attempt: ' + er) return } cb(er, response, shasum) @@ -72,39 +84,49 @@ function addRemoteTarball_ (u, tmp, shasum, auth, cb) { } function fetchAndShaCheck (u, tmp, shasum, auth, cb) { - npm.registry.fetch(u, { auth : auth }, function (er, response) { + cb = pulseTillDone('fetchTarball', cb) + npm.registry.fetch(u, { auth: auth }, function (er, response) { if (er) { - log.error("fetch failed", u) + log.error('fetch failed', u) return cb(er, response) } - var tarball = createWriteStream(tmp, { mode : npm.modes.file }) - tarball.on("error", function (er) { + var tarball = writeStreamAtomic(tmp, { mode: npm.modes.file }) + tarball.on('error', function (er) { cb(er) tarball.destroy() }) - tarball.on("finish", function () { + tarball.on('finish', function () { if (!shasum) { // Well, we weren't given a shasum, so at least sha what we have // in case we want to compare it to something else later return sha.get(tmp, function (er, shasum) { - log.silly("fetchAndShaCheck", "shasum", shasum) + log.silly('fetchAndShaCheck', 'shasum', shasum) cb(er, response, shasum) }) } // validate that the url we just downloaded matches the expected shasum. - log.silly("fetchAndShaCheck", "shasum", shasum) + log.silly('fetchAndShaCheck', 'shasum', shasum) sha.check(tmp, shasum, function (er) { if (er && er.message) { // add original filename for better debuggability - er.message = er.message + "\n" + "From: " + u + er.message = er.message + '\n' + 'From: ' + u } return cb(er, response, shasum) }) }) - response.pipe(tarball) + // 0.8 http streams have a bug, where if they're paused with data in + // their buffers when the socket closes, they call `end` before emptying + // those buffers, which results in the entire pipeline ending and thus + // the point that applied backpressure never being able to trigger a + // `resume`. + // We work around this by piping into a pass through stream that has + // unlimited buffering. The pass through stream is from readable-stream + // and is thus a current streams3 implementation that is free of these + // bugs even on 0.8. + response.pipe(PassThrough({highWaterMark: Infinity})).pipe(tarball) }) } diff --git a/deps/npm/lib/cache/cached-package-root.js b/deps/npm/lib/cache/cached-package-root.js index 7163314a8ede62..b47fac6c9e2ea0 100644 --- a/deps/npm/lib/cache/cached-package-root.js +++ b/deps/npm/lib/cache/cached-package-root.js @@ -1,14 +1,14 @@ -var assert = require("assert") -var resolve = require("path").resolve +var assert = require('assert') +var resolve = require('path').resolve -var npm = require("../npm.js") +var npm = require('../npm.js') module.exports = getCacheRoot function getCacheRoot (data) { - assert(data, "must pass package metadata") - assert(data.name, "package metadata must include name") - assert(data.version, "package metadata must include version") + assert(data, 'must pass package metadata') + assert(data.name, 'package metadata must include name') + assert(data.version, 'package metadata must include version') return resolve(npm.cache, data.name, data.version) } diff --git a/deps/npm/lib/cache/caching-client.js b/deps/npm/lib/cache/caching-client.js index ec8eb8e16ce083..f06dde0021a0a8 100644 --- a/deps/npm/lib/cache/caching-client.js +++ b/deps/npm/lib/cache/caching-client.js @@ -1,40 +1,41 @@ module.exports = CachingRegistryClient -var path = require("path") - , fs = require("graceful-fs") - , url = require("url") - , assert = require("assert") - , inherits = require("util").inherits - -var RegistryClient = require("npm-registry-client") - , npm = require("../npm.js") - , log = require("npmlog") - , getCacheStat = require("./get-stat.js") - , cacheFile = require("npm-cache-filename") - , mkdirp = require("mkdirp") - , rimraf = require("rimraf") - , chownr = require("chownr") - , writeFile = require("write-file-atomic") +var path = require('path') +var fs = require('graceful-fs') +var url = require('url') +var assert = require('assert') +var inherits = require('util').inherits + +var RegistryClient = require('npm-registry-client') +var npm = require('../npm.js') +var log = require('npmlog') +var getCacheStat = require('./get-stat.js') +var cacheFile = require('npm-cache-filename') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var chownr = require('chownr') +var writeFile = require('write-file-atomic') +var parseJSON = require('../utils/parse-json') function CachingRegistryClient (config) { RegistryClient.call(this, adaptConfig(config)) - this._mapToCache = cacheFile(config.get("cache")) + this._mapToCache = cacheFile(config.get('cache')) // swizzle in our custom cache invalidation logic this._request = this.request - this.request = this._invalidatingRequest - this.get = get + this.request = this._invalidatingRequest + this.get = get } inherits(CachingRegistryClient, RegistryClient) CachingRegistryClient.prototype._invalidatingRequest = function (uri, params, cb) { var client = this - this._request.call(this, uri, params, function () { + this._request(uri, params, function () { var args = arguments var method = params.method - if (method !== "HEAD" && method !== "GET") { + if (method !== 'HEAD' && method !== 'GET') { var invalidated = client._mapToCache(uri) // invalidate cache // @@ -43,7 +44,7 @@ CachingRegistryClient.prototype._invalidatingRequest = function (uri, params, cb // thinking that it didn't work when it did. // Note that failure is an acceptable option here, since the only // result will be a stale cache for some helper commands. - log.verbose("request", "invalidating", invalidated, "on", method) + log.verbose('request', 'invalidating', invalidated, 'on', method) return rimraf(invalidated, function () { cb.apply(undefined, args) }) @@ -54,23 +55,23 @@ CachingRegistryClient.prototype._invalidatingRequest = function (uri, params, cb } function get (uri, params, cb) { - assert(typeof uri === "string", "must pass registry URI to get") - assert(params && typeof params === "object", "must pass params to get") - assert(typeof cb === "function", "must pass callback to get") + assert(typeof uri === 'string', 'must pass registry URI to get') + assert(params && typeof params === 'object', 'must pass params to get') + assert(typeof cb === 'function', 'must pass callback to get') var parsed = url.parse(uri) assert( - parsed.protocol === "http:" || parsed.protocol === "https:", - "must have a URL that starts with http: or https:" + parsed.protocol === 'http:' || parsed.protocol === 'https:', + 'must have a URL that starts with http: or https:' ) - var cacheBase = cacheFile(npm.config.get("cache"))(uri) - var cachePath = path.join(cacheBase, ".cache.json") + var cacheBase = cacheFile(npm.config.get('cache'))(uri) + var cachePath = path.join(cacheBase, '.cache.json') // If the GET is part of a write operation (PUT or DELETE), then // skip past the cache entirely, but still save the results. if (uri.match(/\?write=true$/)) { - log.verbose("get", "GET as part of write; not caching result") + log.verbose('get', 'GET as part of write; not caching result') return get_.call(this, uri, cachePath, params, cb) } @@ -78,20 +79,14 @@ function get (uri, params, cb) { fs.stat(cachePath, function (er, stat) { if (!er) { fs.readFile(cachePath, function (er, data) { - try { - data = JSON.parse(data) - } - catch (ex) { - data = null - } + data = parseJSON.noExceptions(data) params.stat = stat params.data = data get_.call(client, uri, cachePath, params, cb) }) - } - else { + } else { get_.call(client, uri, cachePath, params, cb) } }) @@ -99,16 +94,16 @@ function get (uri, params, cb) { function get_ (uri, cachePath, params, cb) { var staleOk = params.staleOk === undefined ? false : params.staleOk - , timeout = params.timeout === undefined ? -1 : params.timeout - , data = params.data - , stat = params.stat - , etag - , lastModified - - timeout = Math.min(timeout, npm.config.get("cache-max") || 0) - timeout = Math.max(timeout, npm.config.get("cache-min") || -Infinity) + var timeout = params.timeout === undefined ? -1 : params.timeout + var data = params.data + var stat = params.stat + var etag + var lastModified + + timeout = Math.min(timeout, npm.config.get('cache-max') || 0) + timeout = Math.max(timeout, npm.config.get('cache-min') || -Infinity) if (process.env.COMP_CWORD !== undefined && - process.env.COMP_LINE !== undefined && + process.env.COMP_LINE !== undefined && process.env.COMP_POINT !== undefined) { timeout = Math.max(timeout, 60000) } @@ -118,19 +113,19 @@ function get_ (uri, cachePath, params, cb) { if (data._lastModified) lastModified = data._lastModified if (stat && timeout && timeout > 0) { - if ((Date.now() - stat.mtime.getTime())/1000 < timeout) { - log.verbose("get", uri, "not expired, no request") + if ((Date.now() - stat.mtime.getTime()) / 1000 < timeout) { + log.verbose('get', uri, 'not expired, no request') delete data._etag delete data._lastModified - return cb(null, data, JSON.stringify(data), { statusCode : 304 }) + return cb(null, data, JSON.stringify(data), { statusCode: 304 }) } if (staleOk) { - log.verbose("get", uri, "staleOk, background update") + log.verbose('get', uri, 'staleOk, background update') delete data._etag delete data._lastModified process.nextTick( - cb.bind(null, null, data, JSON.stringify(data), { statusCode : 304 } ) + cb.bind(null, null, data, JSON.stringify(data), { statusCode: 304 }) ) cb = function () {} } @@ -138,10 +133,10 @@ function get_ (uri, cachePath, params, cb) { } var options = { - etag : etag, - lastModified : lastModified, - follow : params.follow, - auth : params.auth + etag: etag, + lastModified: lastModified, + follow: params.follow, + auth: params.auth } this.request(uri, options, function (er, remoteData, raw, response) { // if we get an error talking to the registry, but we have it @@ -152,15 +147,15 @@ function get_ (uri, cachePath, params, cb) { } if (response) { - log.silly("get", "cb", [response.statusCode, response.headers]) + log.silly('get', 'cb', [response.statusCode, response.headers]) if (response.statusCode === 304 && (etag || lastModified)) { remoteData = data - log.verbose(etag ? "etag" : "lastModified", uri+" from cache") + log.verbose(etag ? 'etag' : 'lastModified', uri + ' from cache') } } data = remoteData - if (!data) er = er || new Error("failed to fetch from registry: " + uri) + if (!data) er = er || new Error('failed to fetch from registry: ' + uri) if (er) return cb(er, data, raw, response) @@ -174,7 +169,7 @@ function get_ (uri, cachePath, params, cb) { } function saveToCache (cachePath, data, saved) { - log.verbose("get", "saving", data.name, "to", cachePath) + log.verbose('get', 'saving', data.name, 'to', cachePath) getCacheStat(function (er, st) { mkdirp(path.dirname(cachePath), function (er, made) { if (er) return saved() @@ -192,26 +187,27 @@ function get_ (uri, cachePath, params, cb) { function adaptConfig (config) { return { - proxy : { - http : config.get("proxy"), - https : config.get("https-proxy"), - localAddress : config.get("local-address") + proxy: { + http: config.get('proxy'), + https: config.get('https-proxy'), + localAddress: config.get('local-address') }, - ssl : { - certificate : config.get("cert"), - key : config.get("key"), - ca : config.get("ca"), - strict : config.get("strict-ssl") + ssl: { + certificate: config.get('cert'), + key: config.get('key'), + ca: config.get('ca'), + strict: config.get('strict-ssl') }, - retry : { - retries : config.get("fetch-retries"), - factor : config.get("fetch-retry-factor"), - minTimeout : config.get("fetch-retry-mintimeout"), - maxTimeout : config.get("fetch-retry-maxtimeout") + retry: { + retries: config.get('fetch-retries'), + factor: config.get('fetch-retry-factor'), + minTimeout: config.get('fetch-retry-mintimeout'), + maxTimeout: config.get('fetch-retry-maxtimeout') }, - userAgent : config.get("user-agent"), - log : log, - defaultTag : config.get("tag"), - couchToken : config.get("_token") + userAgent: config.get('user-agent'), + log: log, + defaultTag: config.get('tag'), + couchToken: config.get('_token'), + maxSockets: config.get('maxsockets') } } diff --git a/deps/npm/lib/cache/update-index.js b/deps/npm/lib/cache/update-index.js index ab1ede120b2d88..a872b034908de5 100644 --- a/deps/npm/lib/cache/update-index.js +++ b/deps/npm/lib/cache/update-index.js @@ -10,6 +10,8 @@ var log = require('npmlog') var cacheFile = require('npm-cache-filename') var getCacheStat = require('./get-stat.js') var mapToRegistry = require('../utils/map-to-registry.js') +var pulseTillDone = require('../utils/pulse-till-done.js') +var parseJSON = require('../utils/parse-json.js') /* /-/all is special. * It uses timestamp-based caching and partial updates, @@ -46,9 +48,8 @@ function updateIndex (staleness, cb) { chownr(made || cachePath, st.uid, st.gid, function (er) { if (er) return cb(er) - try { - data = JSON.parse(data) - } catch (ex) { + data = parseJSON.noExceptions(data) + if (!data) { fs.writeFile(cachePath, '{}', function (er) { if (er) return cb(new Error('Broken cache.')) @@ -80,7 +81,7 @@ function updateIndex (staleness, cb) { function updateIndex_ (all, params, data, cachePath, cb) { log.silly('update-index', 'fetching', all) - npm.registry.request(all, params, function (er, updates, _, res) { + npm.registry.request(all, params, pulseTillDone('updateIndex', function (er, updates, _, res) { if (er) return cb(er, data) var headers = res.headers @@ -100,5 +101,5 @@ function updateIndex_ (all, params, data, cachePath, cb) { }) }) }) - }) + })) } diff --git a/deps/npm/lib/completion.js b/deps/npm/lib/completion.js index 1d26ffcf8ac92d..96f4c3ee55f021 100644 --- a/deps/npm/lib/completion.js +++ b/deps/npm/lib/completion.js @@ -1,119 +1,113 @@ module.exports = completion -completion.usage = "npm completion >> ~/.bashrc\n" - + "npm completion >> ~/.zshrc\n" - + "source <(npm completion)" - -var npm = require("./npm.js") - , npmconf = require("./config/core.js") - , configDefs = npmconf.defs - , configTypes = configDefs.types - , shorthands = configDefs.shorthands - , nopt = require("nopt") - , configNames = Object.keys(configTypes).filter(function (e) { - return e.charAt(0) !== "_" - }) - , shorthandNames = Object.keys(shorthands) - , allConfs = configNames.concat(shorthandNames) - , once = require("once") - +completion.usage = 'source <(npm completion)' + +var npm = require('./npm.js') +var npmconf = require('./config/core.js') +var configDefs = npmconf.defs +var configTypes = configDefs.types +var shorthands = configDefs.shorthands +var nopt = require('nopt') +var configNames = Object.keys(configTypes) + .filter(function (e) { return e.charAt(0) !== '_' }) +var shorthandNames = Object.keys(shorthands) +var allConfs = configNames.concat(shorthandNames) +var once = require('once') completion.completion = function (opts, cb) { if (opts.w > 3) return cb() - var fs = require("graceful-fs") - , path = require("path") - , bashExists = null - , zshExists = null - fs.stat(path.resolve(process.env.HOME, ".bashrc"), function (er) { + var fs = require('graceful-fs') + var path = require('path') + var bashExists = null + var zshExists = null + fs.stat(path.resolve(process.env.HOME, '.bashrc'), function (er) { bashExists = !er next() }) - fs.stat(path.resolve(process.env.HOME, ".zshrc"), function (er) { + fs.stat(path.resolve(process.env.HOME, '.zshrc'), function (er) { zshExists = !er next() }) function next () { if (zshExists === null || bashExists === null) return var out = [] - if (zshExists) out.push("~/.zshrc") - if (bashExists) out.push("~/.bashrc") - if (opts.w === 2) out = out.map(function (m) { - return [">>", m] - }) + if (zshExists) out.push('~/.zshrc') + if (bashExists) out.push('~/.bashrc') + if (opts.w === 2) { + out = out.map(function (m) { + return ['>>', m] + }) + } cb(null, out) } } function completion (args, cb) { - if (process.platform === "win32") { - var e = new Error("npm completion not supported on windows") - e.code = "ENOTSUP" - e.errno = require("constants").ENOTSUP + if (process.platform === 'win32' && !(/^MINGW(32|64)$/.test(process.env.MSYSTEM))) { + var e = new Error('npm completion supported only in MINGW / Git bash on Windows') + e.code = 'ENOTSUP' + e.errno = require('constants').ENOTSUP return cb(e) } // if the COMP_* isn't in the env, then just dump the script. - if (process.env.COMP_CWORD === undefined - ||process.env.COMP_LINE === undefined - ||process.env.COMP_POINT === undefined - ) return dumpScript(cb) + if (process.env.COMP_CWORD === undefined || + process.env.COMP_LINE === undefined || + process.env.COMP_POINT === undefined) { + return dumpScript(cb) + } console.error(process.env.COMP_CWORD) console.error(process.env.COMP_LINE) console.error(process.env.COMP_POINT) - //console.log("abracadabrasauce\nabracad cat monger") - //if (Math.random() * 3 < 1) console.log("man\\ bear\\ pig") - //else if (Math.random() * 3 < 1) - // console.log("porkchop\\ sandwiches\nporkman") - //else console.log("encephylophagy") - // get the partial line and partial word, // if the point isn't at the end. // ie, tabbing at: npm foo b|ar var w = +process.env.COMP_CWORD - , words = args.map(unescape) - , word = words[w] - , line = process.env.COMP_LINE - , point = +process.env.COMP_POINT - , partialLine = line.substr(0, point) - , partialWords = words.slice(0, w) + var words = args.map(unescape) + var word = words[w] + var line = process.env.COMP_LINE + var point = +process.env.COMP_POINT + var partialLine = line.substr(0, point) + var partialWords = words.slice(0, w) // figure out where in that last word the point is. var partialWord = args[w] - , i = partialWord.length - while (partialWord.substr(0, i) !== partialLine.substr(-1*i) && i > 0) { - i -- + var i = partialWord.length + while (partialWord.substr(0, i) !== partialLine.substr(-1 * i) && i > 0) { + i-- } partialWord = unescape(partialWord.substr(0, i)) partialWords.push(partialWord) - var opts = { words : words - , w : w - , word : word - , line : line - , lineLength : line.length - , point : point - , partialLine : partialLine - , partialWords : partialWords - , partialWord : partialWord - , raw: args - } + var opts = { + words: words, + w: w, + word: word, + line: line, + lineLength: line.length, + point: point, + partialLine: partialLine, + partialWords: partialWords, + partialWord: partialWord, + raw: args + } cb = wrapCb(cb, opts) console.error(opts) - if (partialWords.slice(0, -1).indexOf("--") === -1) { - if (word.charAt(0) === "-") return configCompl(opts, cb) - if (words[w - 1] - && words[w - 1].charAt(0) === "-" - && !isFlag(words[w - 1])) { + if (partialWords.slice(0, -1).indexOf('--') === -1) { + if (word.charAt(0) === '-') return configCompl(opts, cb) + if (words[w - 1] && + words[w - 1].charAt(0) === '-' && + !isFlag(words[w - 1])) { // awaiting a value for a non-bool config. // don't even try to do this for now - console.error("configValueCompl") + console.error('configValueCompl') return configValueCompl(opts, cb) } } @@ -145,20 +139,20 @@ function completion (args, cb) { } function dumpScript (cb) { - var fs = require("graceful-fs") - , path = require("path") - , p = path.resolve(__dirname, "utils/completion.sh") + var fs = require('graceful-fs') + var path = require('path') + var p = path.resolve(__dirname, 'utils/completion.sh') // The Darwin patch below results in callbacks first for the write and then // for the error handler, so make sure we only call our callback once. cb = once(cb) - fs.readFile(p, "utf8", function (er, d) { + fs.readFile(p, 'utf8', function (er, d) { if (er) return cb(er) - d = d.replace(/^\#\!.*?\n/, "") + d = d.replace(/^\#\!.*?\n/, '') process.stdout.write(d, function () { cb() }) - process.stdout.on("error", function (er) { + process.stdout.on('error', function (er) { // Darwin is a real dick sometimes. // // This is necessary because the "source" or "." program in @@ -169,67 +163,72 @@ function dumpScript (cb) { // Really, one should not be tossing away EPIPE errors, or any // errors, so casually. But, without this, `. <(npm completion)` // can never ever work on OS X. - if (er.errno === "EPIPE") er = null + if (er.errno === 'EPIPE') er = null cb(er) }) - }) } function unescape (w) { - if (w.charAt(0) === "\"") return w.replace(/^"|"$/g, "") - else return w.replace(/\\ /g, " ") + if (w.charAt(0) === '\'') return w.replace(/^'|'$/g, '') + else return w.replace(/\\ /g, ' ') } function escape (w) { if (!w.match(/\s+/)) return w - return "\"" + w + "\"" + return '\'' + w + '\'' } // The command should respond with an array. Loop over that, // wrapping quotes around any that have spaces, and writing // them to stdout. Use console.log, not the outfd config. // If any of the items are arrays, then join them with a space. -// Ie, returning ["a", "b c", ["d", "e"]] would allow it to expand -// to: "a", "b c", or "d" "e" -function wrapCb (cb, opts) { return function (er, compls) { - if (!Array.isArray(compls)) compls = compls ? [compls] : [] - compls = compls.map(function (c) { - if (Array.isArray(c)) c = c.map(escape).join(" ") - else c = escape(c) - return c - }) - if (opts.partialWord) compls = compls.filter(function (c) { - return c.indexOf(opts.partialWord) === 0 - }) - console.error([er && er.stack, compls, opts.partialWord]) - if (er || compls.length === 0) return cb(er) +// Ie, returning ['a', 'b c', ['d', 'e']] would allow it to expand +// to: 'a', 'b c', or 'd' 'e' +function wrapCb (cb, opts) { + return function (er, compls) { + if (!Array.isArray(compls)) compls = compls ? [compls] : [] + compls = compls.map(function (c) { + if (Array.isArray(c)) c = c.map(escape).join(' ') + else c = escape(c) + return c + }) - console.log(compls.join("\n")) - cb() -}} + if (opts.partialWord) { + compls = compls.filter(function (c) { + return c.indexOf(opts.partialWord) === 0 + }) + } + + console.error([er && er.stack, compls, opts.partialWord]) + if (er || compls.length === 0) return cb(er) + + console.log(compls.join('\n')) + cb() + } +} // the current word has a dash. Return the config names, // with the same number of dashes as the current word has. function configCompl (opts, cb) { var word = opts.word - , split = word.match(/^(-+)((?:no-)*)(.*)$/) - , dashes = split[1] - , no = split[2] - , flags = configNames.filter(isFlag) + var split = word.match(/^(-+)((?:no-)*)(.*)$/) + var dashes = split[1] + var no = split[2] + var flags = configNames.filter(isFlag) console.error(flags) return cb(null, allConfs.map(function (c) { return dashes + c }).concat(flags.map(function (f) { - return dashes + (no || "no-") + f + return dashes + (no || 'no-') + f }))) } // expand with the valid values of various config values. // not yet implemented. function configValueCompl (opts, cb) { - console.error("configValue", opts) + console.error('configValue', opts) return cb(null, []) } @@ -237,8 +236,8 @@ function configValueCompl (opts, cb) { function isFlag (word) { // shorthands never take args. var split = word.match(/^(-*)((?:no-)+)?(.*)$/) - , no = split[2] - , conf = split[3] + var no = split[2] + var conf = split[3] return no || configTypes[conf] === Boolean || shorthands[conf] } diff --git a/deps/npm/lib/config.js b/deps/npm/lib/config.js index c79cdc5b8b254f..65bd9feced7423 100644 --- a/deps/npm/lib/config.js +++ b/deps/npm/lib/config.js @@ -1,46 +1,47 @@ module.exports = config -config.usage = "npm config set " - + "\nnpm config get []" - + "\nnpm config delete " - + "\nnpm config list" - + "\nnpm config edit" - + "\nnpm set " - + "\nnpm get []" +config.usage = 'npm config set ' + + '\nnpm config get []' + + '\nnpm config delete ' + + '\nnpm config list' + + '\nnpm config edit' + + '\nnpm set ' + + '\nnpm get []' -var log = require("npmlog") - , npm = require("./npm.js") - , npmconf = require("./config/core.js") - , fs = require("graceful-fs") - , writeFileAtomic = require("write-file-atomic") - , types = npmconf.defs.types - , ini = require("ini") - , editor = require("editor") - , os = require("os") - , umask = require("./utils/umask") +var log = require('npmlog') +var npm = require('./npm.js') +var npmconf = require('./config/core.js') +var fs = require('graceful-fs') +var writeFileAtomic = require('write-file-atomic') +var types = npmconf.defs.types +var ini = require('ini') +var editor = require('editor') +var os = require('os') +var umask = require('./utils/umask') config.completion = function (opts, cb) { var argv = opts.conf.argv.remain - if (argv[1] !== "config") argv.unshift("config") + if (argv[1] !== 'config') argv.unshift('config') if (argv.length === 2) { - var cmds = ["get", "set", "delete", "ls", "rm", "edit"] - if (opts.partialWord !== "l") cmds.push("list") + var cmds = ['get', 'set', 'delete', 'ls', 'rm', 'edit'] + if (opts.partialWord !== 'l') cmds.push('list') return cb(null, cmds) } var action = argv[2] switch (action) { - case "set": + case 'set': // todo: complete with valid values, if possible. if (argv.length > 3) return cb(null, []) // fallthrough - case "get": - case "delete": - case "rm": + /*eslint no-fallthrough:0*/ + case 'get': + case 'delete': + case 'rm': return cb(null, Object.keys(types)) - case "edit": - case "list": case "ls": + case 'edit': + case 'list': case 'ls': return cb(null, []) default: return cb(null, []) } @@ -52,87 +53,87 @@ config.completion = function (opts, cb) { function config (args, cb) { var action = args.shift() switch (action) { - case "set": return set(args[0], args[1], cb) - case "get": return get(args[0], cb) - case "delete": case "rm": case "del": return del(args[0], cb) - case "list": case "ls": return list(cb) - case "edit": return edit(cb) + case 'set': return set(args[0], args[1], cb) + case 'get': return get(args[0], cb) + case 'delete': case 'rm': case 'del': return del(args[0], cb) + case 'list': case 'ls': return list(cb) + case 'edit': return edit(cb) default: return unknown(action, cb) } } function edit (cb) { - var e = npm.config.get("editor") - , which = npm.config.get("global") ? "global" : "user" - , f = npm.config.get(which + "config") - if (!e) return cb(new Error("No EDITOR config or environ set.")) + var e = npm.config.get('editor') + var which = npm.config.get('global') ? 'global' : 'user' + var f = npm.config.get(which + 'config') + if (!e) return cb(new Error('No EDITOR config or environ set.')) npm.config.save(which, function (er) { if (er) return cb(er) - fs.readFile(f, "utf8", function (er, data) { - if (er) data = "" - data = [ ";;;;" - , "; npm "+(npm.config.get("global") ? - "globalconfig" : "userconfig")+" file" - , "; this is a simple ini-formatted file" - , "; lines that start with semi-colons are comments." - , "; read `npm help config` for help on the various options" - , ";;;;" - , "" - , data - ].concat( [ ";;;;" - , "; all options with default values" - , ";;;;" - ] - ) - .concat(Object.keys(npmconf.defaults).reduce(function (arr, key) { - var obj = {} - obj[key] = npmconf.defaults[key] - if (key === "logstream") return arr - return arr.concat( - ini.stringify(obj) - .replace(/\n$/m, "") - .replace(/^/g, "; ") - .replace(/\n/g, "\n; ") - .split("\n")) - }, [])) - .concat([""]) - .join(os.EOL) - writeFileAtomic - ( f - , data - , function (er) { - if (er) return cb(er) - editor(f, { editor: e }, cb) - } - ) + fs.readFile(f, 'utf8', function (er, data) { + if (er) data = '' + data = [ + ';;;;', + '; npm ' + (npm.config.get('global') + ? 'globalconfig' : 'userconfig') + ' file', + '; this is a simple ini-formatted file', + '; lines that start with semi-colons are comments.', + '; read `npm help config` for help on the various options', + ';;;;', + '', + data + ].concat([ + ';;;;', + '; all options with default values', + ';;;;' + ]).concat(Object.keys(npmconf.defaults).reduce(function (arr, key) { + var obj = {} + obj[key] = npmconf.defaults[key] + if (key === 'logstream') return arr + return arr.concat( + ini.stringify(obj) + .replace(/\n$/m, '') + .replace(/^/g, '; ') + .replace(/\n/g, '\n; ') + .split('\n')) + }, [])) + .concat(['']) + .join(os.EOL) + writeFileAtomic( + f, + data, + function (er) { + if (er) return cb(er) + editor(f, { editor: e }, cb) + } + ) }) }) } function del (key, cb) { - if (!key) return cb(new Error("no key provided")) - var where = npm.config.get("global") ? "global" : "user" + if (!key) return cb(new Error('no key provided')) + var where = npm.config.get('global') ? 'global' : 'user' npm.config.del(key, where) npm.config.save(where, cb) } function set (key, val, cb) { if (key === undefined) { - return unknown("", cb) + return unknown('', cb) } if (val === undefined) { - if (key.indexOf("=") !== -1) { - var k = key.split("=") + if (key.indexOf('=') !== -1) { + var k = key.split('=') key = k.shift() - val = k.join("=") + val = k.join('=') } else { - val = "" + val = '' } } key = key.trim() val = val.trim() - log.info("config", "set %j %j", key, val) - var where = npm.config.get("global") ? "global" : "user" + log.info('config', 'set %j %j', key, val) + var where = npm.config.get('global') ? 'global' : 'user' if (key.match(/umask/)) val = umask.fromString(val) npm.config.set(key, val, where) npm.config.save(where, cb) @@ -140,8 +141,8 @@ function set (key, val, cb) { function get (key, cb) { if (!key) return list(cb) - if (!public(key)) { - return cb(new Error("---sekretz---")) + if (!publicVar(key)) { + return cb(new Error('---sekretz---')) } var val = npm.config.get(key) if (key.match(/umask/)) val = umask.toString(val) @@ -153,133 +154,148 @@ function sort (a, b) { return a > b ? 1 : -1 } -function public (k) { - return !(k.charAt(0) === "_" || - k.indexOf(":_") !== -1 || +function publicVar (k) { + return !(k.charAt(0) === '_' || + k.indexOf(':_') !== -1 || types[k] !== types[k]) } function getKeys (data) { - return Object.keys(data).filter(public).sort(sort) + return Object.keys(data).filter(publicVar).sort(sort) } function list (cb) { - var msg = "" - , long = npm.config.get("long") + var msg = '' + var long = npm.config.get('long') var cli = npm.config.sources.cli.data - , cliKeys = getKeys(cli) + var cliKeys = getKeys(cli) if (cliKeys.length) { - msg += "; cli configs\n" + msg += '; cli configs\n' cliKeys.forEach(function (k) { - if (cli[k] && typeof cli[k] === "object") return - if (k === "argv") return - msg += k + " = " + JSON.stringify(cli[k]) + "\n" + if (cli[k] && typeof cli[k] === 'object') return + if (k === 'argv') return + msg += k + ' = ' + JSON.stringify(cli[k]) + '\n' }) - msg += "\n" + msg += '\n' } // env configs var env = npm.config.sources.env.data - , envKeys = getKeys(env) + var envKeys = getKeys(env) if (envKeys.length) { - msg += "; environment configs\n" + msg += '; environment configs\n' envKeys.forEach(function (k) { if (env[k] !== npm.config.get(k)) { if (!long) return - msg += "; " + k + " = " + JSON.stringify(env[k]) - + " (overridden)\n" - } else msg += k + " = " + JSON.stringify(env[k]) + "\n" + msg += '; ' + k + ' = ' + + JSON.stringify(env[k]) + ' (overridden)\n' + } else msg += k + ' = ' + JSON.stringify(env[k]) + '\n' }) - msg += "\n" + msg += '\n' + } + + // project config file + var project = npm.config.sources.project + var pconf = project.data + var ppath = project.path + var pconfKeys = getKeys(pconf) + if (pconfKeys.length) { + msg += '; project config ' + ppath + '\n' + pconfKeys.forEach(function (k) { + var val = (k.charAt(0) === '_') + ? '---sekretz---' + : JSON.stringify(pconf[k]) + if (pconf[k] !== npm.config.get(k)) { + if (!long) return + msg += '; ' + k + ' = ' + val + ' (overridden)\n' + } else msg += k + ' = ' + val + '\n' + }) + msg += '\n' } // user config file var uconf = npm.config.sources.user.data - , uconfKeys = getKeys(uconf) + var uconfKeys = getKeys(uconf) if (uconfKeys.length) { - msg += "; userconfig " + npm.config.get("userconfig") + "\n" + msg += '; userconfig ' + npm.config.get('userconfig') + '\n' uconfKeys.forEach(function (k) { - var val = (k.charAt(0) === "_") - ? "---sekretz---" + var val = (k.charAt(0) === '_') + ? '---sekretz---' : JSON.stringify(uconf[k]) if (uconf[k] !== npm.config.get(k)) { if (!long) return - msg += "; " + k + " = " + val - + " (overridden)\n" - } else msg += k + " = " + val + "\n" + msg += '; ' + k + ' = ' + val + ' (overridden)\n' + } else msg += k + ' = ' + val + '\n' }) - msg += "\n" + msg += '\n' } // global config file var gconf = npm.config.sources.global.data - , gconfKeys = getKeys(gconf) + var gconfKeys = getKeys(gconf) if (gconfKeys.length) { - msg += "; globalconfig " + npm.config.get("globalconfig") + "\n" + msg += '; globalconfig ' + npm.config.get('globalconfig') + '\n' gconfKeys.forEach(function (k) { - var val = (k.charAt(0) === "_") - ? "---sekretz---" + var val = (k.charAt(0) === '_') + ? '---sekretz---' : JSON.stringify(gconf[k]) if (gconf[k] !== npm.config.get(k)) { if (!long) return - msg += "; " + k + " = " + val - + " (overridden)\n" - } else msg += k + " = " + val + "\n" + msg += '; ' + k + ' = ' + val + ' (overridden)\n' + } else msg += k + ' = ' + val + '\n' }) - msg += "\n" + msg += '\n' } // builtin config file var builtin = npm.config.sources.builtin || {} if (builtin && builtin.data) { var bconf = builtin.data - , bpath = builtin.path - , bconfKeys = getKeys(bconf) + var bpath = builtin.path + var bconfKeys = getKeys(bconf) if (bconfKeys.length) { - msg += "; builtin config " + bpath + "\n" + msg += '; builtin config ' + bpath + '\n' bconfKeys.forEach(function (k) { - var val = (k.charAt(0) === "_") - ? "---sekretz---" + var val = (k.charAt(0) === '_') + ? '---sekretz---' : JSON.stringify(bconf[k]) if (bconf[k] !== npm.config.get(k)) { if (!long) return - msg += "; " + k + " = " + val - + " (overridden)\n" - } else msg += k + " = " + val + "\n" + msg += '; ' + k + ' = ' + val + ' (overridden)\n' + } else msg += k + ' = ' + val + '\n' }) - msg += "\n" + msg += '\n' } } // only show defaults if --long if (!long) { - msg += "; node bin location = " + process.execPath + "\n" - + "; cwd = " + process.cwd() + "\n" - + "; HOME = " + process.env.HOME + "\n" - + "; 'npm config ls -l' to show all defaults.\n" + msg += '; node bin location = ' + process.execPath + '\n' + + '; cwd = ' + process.cwd() + '\n' + + '; HOME = ' + process.env.HOME + '\n' + + '; "npm config ls -l" to show all defaults.\n' console.log(msg) return cb() } var defaults = npmconf.defaults - , defKeys = getKeys(defaults) - msg += "; default values\n" + var defKeys = getKeys(defaults) + msg += '; default values\n' defKeys.forEach(function (k) { - if (defaults[k] && typeof defaults[k] === "object") return + if (defaults[k] && typeof defaults[k] === 'object') return var val = JSON.stringify(defaults[k]) if (defaults[k] !== npm.config.get(k)) { - msg += "; " + k + " = " + val - + " (overridden)\n" - } else msg += k + " = " + val + "\n" + msg += '; ' + k + ' = ' + val + ' (overridden)\n' + } else msg += k + ' = ' + val + '\n' }) - msg += "\n" + msg += '\n' console.log(msg) return cb() } function unknown (action, cb) { - cb("Usage:\n" + config.usage) + cb('Usage:\n' + config.usage) } diff --git a/deps/npm/lib/config/clear-credentials-by-uri.js b/deps/npm/lib/config/clear-credentials-by-uri.js index 88131f7adb5b91..13c356605f0210 100644 --- a/deps/npm/lib/config/clear-credentials-by-uri.js +++ b/deps/npm/lib/config/clear-credentials-by-uri.js @@ -1,16 +1,16 @@ -var assert = require("assert") +var assert = require('assert') -var toNerfDart = require("./nerf-dart.js") +var toNerfDart = require('./nerf-dart.js') module.exports = clearCredentialsByURI function clearCredentialsByURI (uri) { - assert(uri && typeof uri === "string", "registry URL is required") + assert(uri && typeof uri === 'string', 'registry URL is required') var nerfed = toNerfDart(uri) - this.del(nerfed + ":_authToken", "user") - this.del(nerfed + ":_password", "user") - this.del(nerfed + ":username", "user") - this.del(nerfed + ":email", "user") + this.del(nerfed + ':_authToken', 'user') + this.del(nerfed + ':_password', 'user') + this.del(nerfed + ':username', 'user') + this.del(nerfed + ':email', 'user') } diff --git a/deps/npm/lib/config/cmd-list.js b/deps/npm/lib/config/cmd-list.js new file mode 100644 index 00000000000000..9cf975c54a1b8a --- /dev/null +++ b/deps/npm/lib/config/cmd-list.js @@ -0,0 +1,114 @@ +var extend = Object.assign || require('util')._extend + +// short names for common things +var shorthands = { + 'un': 'uninstall', + 'rb': 'rebuild', + 'list': 'ls', + 'ln': 'link', + 'i': 'install', + 'it': 'install-test', + 'up': 'update', + 'c': 'config', + 's': 'search', + 'se': 'search', + 'unstar': 'star', // same function + 'tst': 'test', + 't': 'test', + 'ddp': 'dedupe', + 'v': 'view' +} + +var affordances = { + 'la': 'ls', + 'll': 'ls', + 'verison': 'version', + 'isntall': 'install', + 'dist-tags': 'dist-tag', + 'apihelp': 'help', + 'find-dupes': 'dedupe', + 'upgrade': 'update', + 'login': 'adduser', + 'add-user': 'adduser', + 'author': 'owner', + 'home': 'docs', + 'issues': 'bugs', + 'info': 'view', + 'show': 'view', + 'find': 'search', + 'unlink': 'uninstall', + 'remove': 'uninstall', + 'rm': 'uninstall', + 'r': 'uninstall' +} + +// these are filenames in . +var cmdList = [ + 'install', + 'install-test', + 'uninstall', + 'cache', + 'config', + 'set', + 'get', + 'update', + 'outdated', + 'prune', + 'pack', + 'dedupe', + + 'rebuild', + 'link', + + 'publish', + 'star', + 'stars', + 'tag', + 'adduser', + 'logout', + 'unpublish', + 'owner', + 'access', + 'team', + 'deprecate', + 'shrinkwrap', + + 'help', + 'help-search', + 'ls', + 'search', + 'view', + 'init', + 'version', + 'edit', + 'explore', + 'docs', + 'repo', + 'bugs', + 'root', + 'prefix', + 'bin', + 'whoami', + 'dist-tag', + 'ping', + + 'test', + 'stop', + 'start', + 'restart', + 'run-script', + 'completion' +] + +var plumbing = [ + 'build', + 'unbuild', + 'xmas', + 'substack', + 'visnup' +] +module.exports.aliases = extend(extend({}, shorthands), affordances) +module.exports.shorthands = shorthands +module.exports.affordances = affordances +module.exports.cmdList = cmdList +module.exports.plumbing = plumbing diff --git a/deps/npm/lib/config/core.js b/deps/npm/lib/config/core.js index f11a98dfb88c62..d1306eb4c85d01 100644 --- a/deps/npm/lib/config/core.js +++ b/deps/npm/lib/config/core.js @@ -1,16 +1,15 @@ - -var CC = require("config-chain").ConfigChain -var inherits = require("inherits") -var configDefs = require("./defaults.js") +var CC = require('config-chain').ConfigChain +var inherits = require('inherits') +var configDefs = require('./defaults.js') var types = configDefs.types -var once = require("once") -var fs = require("fs") -var path = require("path") -var nopt = require("nopt") -var ini = require("ini") +var once = require('once') +var fs = require('fs') +var path = require('path') +var nopt = require('nopt') +var ini = require('ini') var Umask = configDefs.Umask -var mkdirp = require("mkdirp") -var umask = require("../utils/umask") +var mkdirp = require('mkdirp') +var umask = require('../utils/umask') exports.load = load exports.Conf = Conf @@ -19,11 +18,11 @@ exports.rootConf = null exports.usingBuiltin = false exports.defs = configDefs -Object.defineProperty(exports, "defaults", { get: function () { +Object.defineProperty(exports, 'defaults', { get: function () { return configDefs.defaults }, enumerable: true }) -Object.defineProperty(exports, "types", { get: function () { +Object.defineProperty(exports, 'types', { get: function () { return configDefs.types }, enumerable: true }) @@ -34,20 +33,19 @@ var myUid = process.env.SUDO_UID !== undefined var myGid = process.env.SUDO_GID !== undefined ? process.env.SUDO_GID : (process.getgid && process.getgid()) - var loading = false var loadCbs = [] function load () { var cli, builtin, cb - for (var i = 0; i < arguments.length; i++) + for (var i = 0; i < arguments.length; i++) { switch (typeof arguments[i]) { - case "string": builtin = arguments[i]; break - case "object": cli = arguments[i]; break - case "function": cb = arguments[i]; break + case 'string': builtin = arguments[i]; break + case 'object': cli = arguments[i]; break + case 'function': cb = arguments[i]; break } + } - if (!cb) - cb = function () {} + if (!cb) cb = function () {} if (exports.loaded) { var ret = exports.loaded @@ -59,17 +57,17 @@ function load () { } // either a fresh object, or a clone of the passed in obj - if (!cli) + if (!cli) { cli = {} - else + } else { cli = Object.keys(cli).reduce(function (c, k) { c[k] = cli[k] return c }, {}) + } loadCbs.push(cb) - if (loading) - return + if (loading) return loading = true @@ -87,28 +85,28 @@ function load () { // check for a builtin if provided. exports.usingBuiltin = !!builtin var rc = exports.rootConf = new Conf() - if (builtin) - rc.addFile(builtin, "builtin") - else - rc.add({}, "builtin") + if (builtin) { + rc.addFile(builtin, 'builtin') + } else { + rc.add({}, 'builtin') + } - rc.on("load", function () { + rc.on('load', function () { load_(builtin, rc, cli, cb) }) - rc.on("error", cb) + rc.on('error', cb) } -function load_(builtin, rc, cli, cb) { +function load_ (builtin, rc, cli, cb) { var defaults = configDefs.defaults var conf = new Conf(rc) conf.usingBuiltin = !!builtin - conf.add(cli, "cli") + conf.add(cli, 'cli') conf.addEnv() - conf.loadPrefix(function(er) { - if (er) - return cb(er) + conf.loadPrefix(function (er) { + if (er) return cb(er) // If you're doing `npm --userconfig=~/foo.npmrc` then you'd expect // that ~/.npmrc won't override the stuff in ~/foo.npmrc (or, indeed @@ -126,24 +124,24 @@ function load_(builtin, rc, cli, cb) { // the default or resolved userconfig value. npm will log a "verbose" // message about this when it happens, but it is a rare enough edge case // that we don't have to be super concerned about it. - var projectConf = path.resolve(conf.localPrefix, ".npmrc") - var defaultUserConfig = rc.get("userconfig") - var resolvedUserConfig = conf.get("userconfig") - if (!conf.get("global") && + var projectConf = path.resolve(conf.localPrefix, '.npmrc') + var defaultUserConfig = rc.get('userconfig') + var resolvedUserConfig = conf.get('userconfig') + if (!conf.get('global') && projectConf !== defaultUserConfig && projectConf !== resolvedUserConfig) { - conf.addFile(projectConf, "project") - conf.once("load", afterPrefix) + conf.addFile(projectConf, 'project') + conf.once('load', afterPrefix) } else { - conf.add({}, "project") + conf.add({}, 'project') afterPrefix() } }) - function afterPrefix() { - conf.addFile(conf.get("userconfig"), "user") - conf.once("error", cb) - conf.once("load", afterUser) + function afterPrefix () { + conf.addFile(conf.get('userconfig'), 'user') + conf.once('error', cb) + conf.once('load', afterUser) } function afterUser () { @@ -152,11 +150,11 @@ function load_(builtin, rc, cli, cb) { // Eg, `npm config get globalconfig --prefix ~/local` should // return `~/local/etc/npmrc` // annoying humans and their expectations! - if (conf.get("prefix")) { - var etc = path.resolve(conf.get("prefix"), "etc") - mkdirp(etc, function (err) { - defaults.globalconfig = path.resolve(etc, "npmrc") - defaults.globalignorefile = path.resolve(etc, "npmignore") + if (conf.get('prefix')) { + var etc = path.resolve(conf.get('prefix'), 'etc') + mkdirp(etc, function () { + defaults.globalconfig = path.resolve(etc, 'npmrc') + defaults.globalignorefile = path.resolve(etc, 'npmignore') afterUserContinuation() }) } else { @@ -164,25 +162,24 @@ function load_(builtin, rc, cli, cb) { } } - function afterUserContinuation() { - conf.addFile(conf.get("globalconfig"), "global") + function afterUserContinuation () { + conf.addFile(conf.get('globalconfig'), 'global') // move the builtin into the conf stack now. conf.root = defaults - conf.add(rc.shift(), "builtin") - conf.once("load", function () { + conf.add(rc.shift(), 'builtin') + conf.once('load', function () { conf.loadExtras(afterExtras) }) } - function afterExtras(er) { - if (er) - return cb(er) + function afterExtras (er) { + if (er) return cb(er) // warn about invalid bits. validate(conf) - var cafile = conf.get("cafile") + var cafile = conf.get('cafile') if (cafile) { return conf.loadCAFile(cafile, finalize) @@ -191,7 +188,7 @@ function load_(builtin, rc, cli, cb) { finalize() } - function finalize(er) { + function finalize (er) { if (er) { return cb(er) } @@ -208,36 +205,35 @@ function load_(builtin, rc, cli, cb) { // 4. Can inherit from another Conf object, using it as the base. inherits(Conf, CC) function Conf (base) { - if (!(this instanceof Conf)) - return new Conf(base) + if (!(this instanceof Conf)) return new Conf(base) CC.apply(this) - if (base) - if (base instanceof Conf) + if (base) { + if (base instanceof Conf) { this.root = base.list[0] || base.root - else + } else { this.root = base - else + } + } else { this.root = configDefs.defaults + } } -Conf.prototype.loadPrefix = require("./load-prefix.js") -Conf.prototype.loadCAFile = require("./load-cafile.js") -Conf.prototype.loadUid = require("./load-uid.js") -Conf.prototype.setUser = require("./set-user.js") -Conf.prototype.findPrefix = require("./find-prefix.js") -Conf.prototype.getCredentialsByURI = require("./get-credentials-by-uri.js") -Conf.prototype.setCredentialsByURI = require("./set-credentials-by-uri.js") -Conf.prototype.clearCredentialsByURI = require("./clear-credentials-by-uri.js") - -Conf.prototype.loadExtras = function(cb) { - this.setUser(function(er) { - if (er) - return cb(er) - this.loadUid(function(er) { - if (er) - return cb(er) +Conf.prototype.loadPrefix = require('./load-prefix.js') +Conf.prototype.loadCAFile = require('./load-cafile.js') +Conf.prototype.loadUid = require('./load-uid.js') +Conf.prototype.setUser = require('./set-user.js') +Conf.prototype.findPrefix = require('./find-prefix.js') +Conf.prototype.getCredentialsByURI = require('./get-credentials-by-uri.js') +Conf.prototype.setCredentialsByURI = require('./set-credentials-by-uri.js') +Conf.prototype.clearCredentialsByURI = require('./clear-credentials-by-uri.js') + +Conf.prototype.loadExtras = function (cb) { + this.setUser(function (er) { + if (er) return cb(er) + this.loadUid(function (er) { + if (er) return cb(er) // Without prefix, nothing will ever work mkdirp(this.prefix, cb) }.bind(this)) @@ -247,17 +243,17 @@ Conf.prototype.loadExtras = function(cb) { Conf.prototype.save = function (where, cb) { var target = this.sources[where] if (!target || !(target.path || target.source) || !target.data) { - if (where !== "builtin") - var er = new Error("bad save target: " + where) + var er + if (where !== 'builtin') er = new Error('bad save target: ' + where) if (cb) { process.nextTick(cb.bind(null, er)) return this } - return this.emit("error", er) + return this.emit('error', er) } if (target.source) { - var pref = target.prefix || "" + var pref = target.prefix || '' Object.keys(target.data).forEach(function (k) { target.source[pref + k] = target.data[k] }) @@ -267,11 +263,29 @@ Conf.prototype.save = function (where, cb) { var data = ini.stringify(target.data) + var then = function then (er) { + if (er) return done(er) + + fs.chmod(target.path, mode, done) + } + + var done = function done (er) { + if (er) { + if (cb) return cb(er) + else return this.emit('error', er) + } + this._saving -- + if (this._saving === 0) { + if (cb) cb() + this.emit('save') + } + } + then = then.bind(this) done = done.bind(this) this._saving ++ - var mode = where === "user" ? "0600" : "0666" + var mode = where === 'user' ? '0600' : '0666' if (!data.trim()) { fs.unlink(target.path, function () { // ignore the possible error (e.g. the file doesn't exist) @@ -279,57 +293,39 @@ Conf.prototype.save = function (where, cb) { }) } else { mkdirp(path.dirname(target.path), function (er) { - if (er) - return then(er) - fs.writeFile(target.path, data, "utf8", function (er) { - if (er) - return then(er) - if (where === "user" && myUid && myGid) + if (er) return then(er) + fs.writeFile(target.path, data, 'utf8', function (er) { + if (er) return then(er) + if (where === 'user' && myUid && myGid) { fs.chown(target.path, +myUid, +myGid, then) - else + } else { then() + } }) }) } - function then (er) { - if (er) - return done(er) - fs.chmod(target.path, mode, done) - } - - function done (er) { - if (er) { - if (cb) return cb(er) - else return this.emit("error", er) - } - this._saving -- - if (this._saving === 0) { - if (cb) cb() - this.emit("save") - } - } - return this } Conf.prototype.addFile = function (file, name) { name = name || file - var marker = {__source__:name} - this.sources[name] = { path: file, type: "ini" } + var marker = { __source__: name } + this.sources[name] = { path: file, type: 'ini' } this.push(marker) this._await() - fs.readFile(file, "utf8", function (er, data) { - if (er) // just ignore missing files. - return this.add({}, marker) - this.addString(data, file, "ini", marker) + fs.readFile(file, 'utf8', function (er, data) { + // just ignore missing files. + if (er) return this.add({}, marker) + + this.addString(data, file, 'ini', marker) }.bind(this)) return this } // always ini files. Conf.prototype.parse = function (content, file) { - return CC.prototype.parse.call(this, content, file, "ini") + return CC.prototype.parse.call(this, content, file, 'ini') } Conf.prototype.add = function (data, marker) { @@ -337,9 +333,8 @@ Conf.prototype.add = function (data, marker) { Object.keys(data).forEach(function (k) { data[k] = parseField(data[k], k) }) - } - catch (e) { - this.emit("error", e) + } catch (e) { + this.emit('error', e) return this } return CC.prototype.add.call(this, data, marker) @@ -351,82 +346,77 @@ Conf.prototype.addEnv = function (env) { Object.keys(env) .filter(function (k) { return k.match(/^npm_config_/i) }) .forEach(function (k) { - if (!env[k]) - return + if (!env[k]) return // leave first char untouched, even if - // it is a "_" - convert all other to "-" + // it is a '_' - convert all other to '-' var p = k.toLowerCase() - .replace(/^npm_config_/, "") - .replace(/(?!^)_/g, "-") + .replace(/^npm_config_/, '') + .replace(/(?!^)_/g, '-') conf[p] = env[k] }) - return CC.prototype.addEnv.call(this, "", conf, "env") + return CC.prototype.addEnv.call(this, '', conf, 'env') } function parseField (f, k) { - if (typeof f !== "string" && !(f instanceof String)) - return f + if (typeof f !== 'string' && !(f instanceof String)) return f // type can be an array or single thing. var typeList = [].concat(types[k]) - var isPath = -1 !== typeList.indexOf(path) - var isBool = -1 !== typeList.indexOf(Boolean) - var isString = -1 !== typeList.indexOf(String) - var isUmask = -1 !== typeList.indexOf(Umask) - var isNumber = -1 !== typeList.indexOf(Number) + var isPath = typeList.indexOf(path) !== -1 + var isBool = typeList.indexOf(Boolean) !== -1 + var isString = typeList.indexOf(String) !== -1 + var isUmask = typeList.indexOf(Umask) !== -1 + var isNumber = typeList.indexOf(Number) !== -1 - f = (""+f).trim() + f = ('' + f).trim() if (f.match(/^".*"$/)) { try { f = JSON.parse(f) - } - catch (e) { - throw new Error("Failed parsing JSON config key " + k + ": " + f) + } catch (e) { + throw new Error('Failed parsing JSON config key ' + k + ': ' + f) } } - if (isBool && !isString && f === "") - return true + if (isBool && !isString && f === '') return true switch (f) { - case "true": return true - case "false": return false - case "null": return null - case "undefined": return undefined + case 'true': return true + case 'false': return false + case 'null': return null + case 'undefined': return undefined } f = envReplace(f) if (isPath) { - var homePattern = process.platform === "win32" ? /^~(\/|\\)/ : /^~\// + var homePattern = process.platform === 'win32' ? /^~(\/|\\)/ : /^~\// if (f.match(homePattern) && process.env.HOME) { f = path.resolve(process.env.HOME, f.substr(2)) } f = path.resolve(f) } - if (isUmask) - f = umask.fromString(f) + if (isUmask) f = umask.fromString(f) - if (isNumber && !isNaN(f)) - f = +f + if (isNumber && !isNaN(f)) f = +f return f } function envReplace (f) { - if (typeof f !== "string" || !f) return f + if (typeof f !== 'string' || !f) return f // replace any ${ENV} values with the appropriate environ. var envExpr = /(\\*)\$\{([^}]+)\}/g return f.replace(envExpr, function (orig, esc, name) { esc = esc.length && esc.length % 2 - if (esc) - return orig - if (undefined === process.env[name]) - throw new Error("Failed to replace env in config: "+orig) + if (esc) return orig + if (undefined === process.env[name]) { + throw new Error('Failed to replace env in config: ' + orig) + } + return process.env[name] }) } diff --git a/deps/npm/lib/config/defaults.js b/deps/npm/lib/config/defaults.js index a90d4c22b0a87e..e93c1e57eced42 100644 --- a/deps/npm/lib/config/defaults.js +++ b/deps/npm/lib/config/defaults.js @@ -1,23 +1,23 @@ // defaults, types, and shorthands. - -var path = require("path") - , url = require("url") - , Stream = require("stream").Stream - , semver = require("semver") - , stableFamily = semver.parse(process.version) - , nopt = require("nopt") - , os = require("os") - , osenv = require("osenv") - , umask = require("../utils/umask") +var path = require('path') +var url = require('url') +var Stream = require('stream').Stream +var semver = require('semver') +var stableFamily = semver.parse(process.version) +var nopt = require('nopt') +var os = require('os') +var osenv = require('osenv') +var umask = require('../utils/umask') +var hasUnicode = require('has-unicode') var log try { - log = require("npmlog") + log = require('npmlog') } catch (er) { - var util = require("util") + var util = require('util') log = { warn: function (m) { - console.warn(m + " " + util.format.apply(util, [].slice.call(arguments, 1))) + console.warn(m + ' ' + util.format.apply(util, [].slice.call(arguments, 1))) } } } @@ -42,7 +42,7 @@ nopt.typeDefs.Stream = { type: Stream, validate: validateStream } nopt.typeDefs.Umask = { type: Umask, validate: validateUmask } nopt.invalidHandler = function (k, val, type) { - log.warn("invalid config", k + "=" + JSON.stringify(val)) + log.warn('invalid config', k + '=' + JSON.stringify(val)) if (Array.isArray(type)) { if (type.indexOf(url) !== -1) type = url @@ -51,25 +51,25 @@ nopt.invalidHandler = function (k, val, type) { switch (type) { case Umask: - log.warn("invalid config", "Must be umask, octal number in range 0000..0777") + log.warn('invalid config', 'Must be umask, octal number in range 0000..0777') break case url: - log.warn("invalid config", "Must be a full url with 'http://'") + log.warn('invalid config', "Must be a full url with 'http://'") break case path: - log.warn("invalid config", "Must be a valid filesystem path") + log.warn('invalid config', 'Must be a valid filesystem path') break case Number: - log.warn("invalid config", "Must be a numeric value") + log.warn('invalid config', 'Must be a numeric value') break case Stream: - log.warn("invalid config", "Must be an instance of the Stream class") + log.warn('invalid config', 'Must be an instance of the Stream class') break } } if (!stableFamily || (+stableFamily.minor % 2)) stableFamily = null -else stableFamily = stableFamily.major + "." + stableFamily.minor +else stableFamily = stableFamily.major + '.' + stableFamily.minor var defaults @@ -79,20 +79,19 @@ var home = osenv.home() var uidOrPid = process.getuid ? process.getuid() : process.pid if (home) process.env.HOME = home -else home = path.resolve(temp, "npm-" + uidOrPid) +else home = path.resolve(temp, 'npm-' + uidOrPid) -var cacheExtra = process.platform === "win32" ? "npm-cache" : ".npm" -var cacheRoot = process.platform === "win32" && process.env.APPDATA || home +var cacheExtra = process.platform === 'win32' ? 'npm-cache' : '.npm' +var cacheRoot = process.platform === 'win32' && process.env.APPDATA || home var cache = path.resolve(cacheRoot, cacheExtra) - var globalPrefix -Object.defineProperty(exports, "defaults", {get: function () { +Object.defineProperty(exports, 'defaults', {get: function () { if (defaults) return defaults if (process.env.PREFIX) { globalPrefix = process.env.PREFIX - } else if (process.platform === "win32") { + } else if (process.platform === 'win32') { // c:\node\node.exe --> prefix=c:\node\ globalPrefix = path.dirname(process.execPath) } else { @@ -106,214 +105,228 @@ Object.defineProperty(exports, "defaults", {get: function () { } defaults = { - access : null - , "always-auth" : false - - , "bin-links" : true - , browser : null - - , ca: null - , cafile: null - - , cache : cache - - , "cache-lock-stale": 60000 - , "cache-lock-retries": 10 - , "cache-lock-wait": 10000 - - , "cache-max": Infinity - , "cache-min": 10 - - , cert: null - - , color : true - , depth: Infinity - , description : true - , dev : false - , editor : osenv.editor() - , "engine-strict": false - , force : false - - , "fetch-retries": 2 - , "fetch-retry-factor": 10 - , "fetch-retry-mintimeout": 10000 - , "fetch-retry-maxtimeout": 60000 - - , git: "git" - , "git-tag-version": true - - , global : false - , globalconfig : path.resolve(globalPrefix, "etc", "npmrc") - , group : process.platform === "win32" ? 0 - : process.env.SUDO_GID || (process.getgid && process.getgid()) - , heading: "npm" - , "if-present": false - , "ignore-scripts": false - , "init-module": path.resolve(home, ".npm-init.js") - , "init-author-name" : "" - , "init-author-email" : "" - , "init-author-url" : "" - , "init-version": "1.0.0" - , "init-license": "ISC" - , json: false - , key: null - , link: false - , "local-address" : undefined - , loglevel : "warn" - , logstream : process.stderr - , long : false - , message : "%s" - , "node-version" : process.version - , npat : false - , "onload-script" : false - , optional: true - , parseable : false - , prefix : globalPrefix - , production: process.env.NODE_ENV === "production" - , "proprietary-attribs": true - , proxy : null - , "https-proxy" : null - , "user-agent" : "npm/{npm-version} " - + "node/{node-version} " - + "{platform} " - + "{arch}" - , "rebuild-bundle" : true - , registry : "https://registry.npmjs.org/" - , rollback : true - , save : false - , "save-bundle": false - , "save-dev" : false - , "save-exact" : false - , "save-optional" : false - , "save-prefix": "^" - , scope : "" - , searchopts: "" - , searchexclude: null - , searchsort: "name" - , shell : osenv.shell() - , shrinkwrap: true - , "sign-git-tag": false - , spin: true - , "strict-ssl": true - , tag : "latest" - , "tag-version-prefix" : "v" - , tmp : temp - , unicode : true - , "unsafe-perm" : process.platform === "win32" - || process.platform === "cygwin" - || !( process.getuid && process.setuid - && process.getgid && process.setgid ) - || process.getuid() !== 0 - , usage : false - , user : process.platform === "win32" ? 0 : "nobody" - , userconfig : path.resolve(home, ".npmrc") - , umask: process.umask ? process.umask() : umask.fromString("022") - , version : false - , versions : false - , viewer: process.platform === "win32" ? "browser" : "man" - - , _exit : true + access: null, + 'always-auth': false, + also: null, + + 'bin-links': true, + browser: null, + + ca: null, + cafile: null, + + cache: cache, + + 'cache-lock-stale': 60000, + 'cache-lock-retries': 10, + 'cache-lock-wait': 10000, + + 'cache-max': Infinity, + 'cache-min': 10, + + cert: null, + + color: true, + depth: Infinity, + description: true, + dev: false, + 'dry-run': false, + editor: osenv.editor(), + 'engine-strict': false, + force: false, + + 'fetch-retries': 2, + 'fetch-retry-factor': 10, + 'fetch-retry-mintimeout': 10000, + 'fetch-retry-maxtimeout': 60000, + + git: 'git', + 'git-tag-version': true, + + global: false, + globalconfig: path.resolve(globalPrefix, 'etc', 'npmrc'), + 'global-style': false, + group: process.platform === 'win32' ? 0 + : process.env.SUDO_GID || (process.getgid && process.getgid()), + heading: 'npm', + 'if-present': false, + 'ignore-scripts': false, + 'init-module': path.resolve(home, '.npm-init.js'), + 'init-author-name': '', + 'init-author-email': '', + 'init-author-url': '', + 'init-version': '1.0.0', + 'init-license': 'ISC', + json: false, + key: null, + 'legacy-bundling': false, + link: false, + 'local-address': undefined, + loglevel: 'warn', + logstream: process.stderr, + long: false, + maxsockets: 50, + message: '%s', + 'node-version': process.version, + npat: false, + 'onload-script': false, + only: null, + optional: true, + parseable: false, + prefix: globalPrefix, + production: process.env.NODE_ENV === 'production', + 'progress': !process.env.TRAVIS && !process.env.CI, + 'proprietary-attribs': true, + proxy: null, + 'https-proxy': null, + 'user-agent': 'npm/{npm-version} ' + + 'node/{node-version} ' + + '{platform} ' + + '{arch}', + 'rebuild-bundle': true, + registry: 'https://registry.npmjs.org/', + rollback: true, + save: false, + 'save-bundle': false, + 'save-dev': false, + 'save-exact': false, + 'save-optional': false, + 'save-prefix': '^', + scope: '', + searchopts: '', + searchexclude: null, + searchsort: 'name', + shell: osenv.shell(), + shrinkwrap: true, + 'sign-git-tag': false, + 'strict-ssl': true, + tag: 'latest', + 'tag-version-prefix': 'v', + tmp: temp, + unicode: hasUnicode(), + 'unsafe-perm': process.platform === 'win32' || + process.platform === 'cygwin' || + !(process.getuid && process.setuid && + process.getgid && process.setgid) || + process.getuid() !== 0, + usage: false, + user: process.platform === 'win32' ? 0 : 'nobody', + userconfig: path.resolve(home, '.npmrc'), + umask: process.umask ? process.umask() : umask.fromString('022'), + version: false, + versions: false, + viewer: process.platform === 'win32' ? 'browser' : 'man', + + _exit: true } return defaults }}) -exports.types = - { access : [null, "restricted", "public"] - , "always-auth" : Boolean - , "bin-links": Boolean - , browser : [null, String] - , ca: [null, String, Array] - , cafile : path - , cache : path - , "cache-lock-stale": Number - , "cache-lock-retries": Number - , "cache-lock-wait": Number - , "cache-max": Number - , "cache-min": Number - , cert: [null, String] - , color : ["always", Boolean] - , depth : Number - , description : Boolean - , dev : Boolean - , editor : String - , "engine-strict": Boolean - , force : Boolean - , "fetch-retries": Number - , "fetch-retry-factor": Number - , "fetch-retry-mintimeout": Number - , "fetch-retry-maxtimeout": Number - , git: String - , "git-tag-version": Boolean - , global : Boolean - , globalconfig : path - , group : [Number, String] - , "https-proxy" : [null, url] - , "user-agent" : String - , "heading": String - , "if-present": Boolean - , "ignore-scripts": Boolean - , "init-module": path - , "init-author-name" : String - , "init-author-email" : String - , "init-author-url" : ["", url] - , "init-license": String - , "init-version": semver - , json: Boolean - , key: [null, String] - , link: Boolean +exports.types = { + access: [null, 'restricted', 'public'], + 'always-auth': Boolean, + also: [null, 'dev', 'development'], + 'bin-links': Boolean, + browser: [null, String], + ca: [null, String, Array], + cafile: path, + cache: path, + 'cache-lock-stale': Number, + 'cache-lock-retries': Number, + 'cache-lock-wait': Number, + 'cache-max': Number, + 'cache-min': Number, + cert: [null, String], + color: ['always', Boolean], + depth: Number, + description: Boolean, + dev: Boolean, + 'dry-run': Boolean, + editor: String, + 'engine-strict': Boolean, + force: Boolean, + 'fetch-retries': Number, + 'fetch-retry-factor': Number, + 'fetch-retry-mintimeout': Number, + 'fetch-retry-maxtimeout': Number, + git: String, + 'git-tag-version': Boolean, + global: Boolean, + globalconfig: path, + 'global-style': Boolean, + group: [Number, String], + 'https-proxy': [null, url], + 'user-agent': String, + 'heading': String, + 'if-present': Boolean, + 'ignore-scripts': Boolean, + 'init-module': path, + 'init-author-name': String, + 'init-author-email': String, + 'init-author-url': ['', url], + 'init-license': String, + 'init-version': semver, + json: Boolean, + key: [null, String], + 'legacy-bundling': Boolean, + link: Boolean, // local-address must be listed as an IP for a local network interface // must be IPv4 due to node bug - , "local-address" : getLocalAddresses() - , loglevel : ["silent", "error", "warn", "http", "info", "verbose", "silly"] - , logstream : Stream - , long : Boolean - , message: String - , "node-version" : [null, semver] - , npat : Boolean - , "onload-script" : [null, String] - , optional: Boolean - , parseable : Boolean - , prefix: path - , production: Boolean - , "proprietary-attribs": Boolean - , proxy : [null, false, url] // allow proxy to be disabled explicitly - , "rebuild-bundle" : Boolean - , registry : [null, url] - , rollback : Boolean - , save : Boolean - , "save-bundle": Boolean - , "save-dev" : Boolean - , "save-exact" : Boolean - , "save-optional" : Boolean - , "save-prefix": String - , scope : String - , searchopts : String - , searchexclude: [null, String] - , searchsort: [ "name", "-name" - , "description", "-description" - , "author", "-author" - , "date", "-date" - , "keywords", "-keywords" ] - , shell : String - , shrinkwrap: Boolean - , "sign-git-tag": Boolean - , spin: ["always", Boolean] - , "strict-ssl": Boolean - , tag : String - , tmp : path - , unicode : Boolean - , "unsafe-perm" : Boolean - , usage : Boolean - , user : [Number, String] - , userconfig : path - , umask: Umask - , version : Boolean - , "tag-version-prefix" : String - , versions : Boolean - , viewer: String - , _exit : Boolean - } + 'local-address': getLocalAddresses(), + loglevel: ['silent', 'error', 'warn', 'http', 'info', 'verbose', 'silly'], + logstream: Stream, + long: Boolean, + maxsockets: Number, + message: String, + 'node-version': [null, semver], + npat: Boolean, + 'onload-script': [null, String], + only: [null, 'dev', 'development', 'prod', 'production'], + optional: Boolean, + parseable: Boolean, + prefix: path, + production: Boolean, + progress: Boolean, + 'proprietary-attribs': Boolean, + proxy: [null, false, url], // allow proxy to be disabled explicitly + 'rebuild-bundle': Boolean, + registry: [null, url], + rollback: Boolean, + save: Boolean, + 'save-bundle': Boolean, + 'save-dev': Boolean, + 'save-exact': Boolean, + 'save-optional': Boolean, + 'save-prefix': String, + scope: String, + searchopts: String, + searchexclude: [null, String], + searchsort: [ + 'name', '-name', + 'description', '-description', + 'author', '-author', + 'date', '-date', + 'keywords', '-keywords' + ], + shell: String, + shrinkwrap: Boolean, + 'sign-git-tag': Boolean, + 'strict-ssl': Boolean, + tag: String, + tmp: path, + unicode: Boolean, + 'unsafe-perm': Boolean, + usage: Boolean, + user: [Number, String], + userconfig: path, + umask: Umask, + version: Boolean, + 'tag-version-prefix': String, + versions: Boolean, + viewer: String, + _exit: Boolean +} function getLocalAddresses () { var interfaces @@ -338,41 +351,41 @@ function getLocalAddresses () { }, []).concat(undefined) } -exports.shorthands = - { s : ["--loglevel", "silent"] - , d : ["--loglevel", "info"] - , dd : ["--loglevel", "verbose"] - , ddd : ["--loglevel", "silly"] - , noreg : ["--no-registry"] - , N : ["--no-registry"] - , reg : ["--registry"] - , "no-reg" : ["--no-registry"] - , silent : ["--loglevel", "silent"] - , verbose : ["--loglevel", "verbose"] - , quiet: ["--loglevel", "warn"] - , q: ["--loglevel", "warn"] - , h : ["--usage"] - , H : ["--usage"] - , "?" : ["--usage"] - , help : ["--usage"] - , v : ["--version"] - , f : ["--force"] - , gangster : ["--force"] - , gangsta : ["--force"] - , desc : ["--description"] - , "no-desc" : ["--no-description"] - , "local" : ["--no-global"] - , l : ["--long"] - , m : ["--message"] - , p : ["--parseable"] - , porcelain : ["--parseable"] - , g : ["--global"] - , S : ["--save"] - , D : ["--save-dev"] - , E : ["--save-exact"] - , O : ["--save-optional"] - , y : ["--yes"] - , n : ["--no-yes"] - , B : ["--save-bundle"] - , C : ["--prefix"] - } +exports.shorthands = { + s: ['--loglevel', 'silent'], + d: ['--loglevel', 'info'], + dd: ['--loglevel', 'verbose'], + ddd: ['--loglevel', 'silly'], + noreg: ['--no-registry'], + N: ['--no-registry'], + reg: ['--registry'], + 'no-reg': ['--no-registry'], + silent: ['--loglevel', 'silent'], + verbose: ['--loglevel', 'verbose'], + quiet: ['--loglevel', 'warn'], + q: ['--loglevel', 'warn'], + h: ['--usage'], + H: ['--usage'], + '?': ['--usage'], + help: ['--usage'], + v: ['--version'], + f: ['--force'], + gangster: ['--force'], + gangsta: ['--force'], + desc: ['--description'], + 'no-desc': ['--no-description'], + 'local': ['--no-global'], + l: ['--long'], + m: ['--message'], + p: ['--parseable'], + porcelain: ['--parseable'], + g: ['--global'], + S: ['--save'], + D: ['--save-dev'], + E: ['--save-exact'], + O: ['--save-optional'], + y: ['--yes'], + n: ['--no-yes'], + B: ['--save-bundle'], + C: ['--prefix'] +} diff --git a/deps/npm/lib/config/find-prefix.js b/deps/npm/lib/config/find-prefix.js index bb00cd6b10c2fe..58f5cc8040b4d6 100644 --- a/deps/npm/lib/config/find-prefix.js +++ b/deps/npm/lib/config/find-prefix.js @@ -2,8 +2,8 @@ module.exports = findPrefix -var fs = require("fs") -var path = require("path") +var fs = require('fs') +var path = require('path') function findPrefix (p, cb_) { function cb (er, p) { @@ -17,7 +17,7 @@ function findPrefix (p, cb_) { // walk up until we hopefully find one. // if none anywhere, then use cwd. var walkedUp = false - while (path.basename(p) === "node_modules") { + while (path.basename(p) === 'node_modules') { p = path.dirname(p) walkedUp = true } @@ -27,8 +27,8 @@ function findPrefix (p, cb_) { } function findPrefix_ (p, original, cb) { - if (p === "/" - || (process.platform === "win32" && p.match(/^[a-zA-Z]:(\\|\/)?$/))) { + if (p === '/' || + (process.platform === 'win32' && p.match(/^[a-zA-Z]:(\\|\/)?$/))) { return cb(null, original) } fs.readdir(p, function (er, files) { @@ -36,15 +36,15 @@ function findPrefix_ (p, original, cb) { // unless the prefix was simply a non // existent directory. if (er && p === original) { - if (er.code === "ENOENT") return cb(null, original); + if (er.code === 'ENOENT') return cb(null, original) return cb(er) } // walked up too high or something. if (er) return cb(null, original) - if (files.indexOf("node_modules") !== -1 - || files.indexOf("package.json") !== -1) { + if (files.indexOf('node_modules') !== -1 || + files.indexOf('package.json') !== -1) { return cb(null, p) } diff --git a/deps/npm/lib/config/get-credentials-by-uri.js b/deps/npm/lib/config/get-credentials-by-uri.js index 26a7f4317c6a3a..19779c41372cf4 100644 --- a/deps/npm/lib/config/get-credentials-by-uri.js +++ b/deps/npm/lib/config/get-credentials-by-uri.js @@ -1,27 +1,35 @@ -var assert = require("assert") +var assert = require('assert') -var toNerfDart = require("./nerf-dart.js") +var toNerfDart = require('./nerf-dart.js') module.exports = getCredentialsByURI function getCredentialsByURI (uri) { - assert(uri && typeof uri === "string", "registry URL is required") + assert(uri && typeof uri === 'string', 'registry URL is required') var nerfed = toNerfDart(uri) - var defnerf = toNerfDart(this.get("registry")) + var defnerf = toNerfDart(this.get('registry')) // hidden class micro-optimization var c = { - scope : nerfed, - token : undefined, - password : undefined, - username : undefined, - email : undefined, - auth : undefined, - alwaysAuth : undefined + scope: nerfed, + token: undefined, + password: undefined, + username: undefined, + email: undefined, + auth: undefined, + alwaysAuth: undefined } - if (this.get(nerfed + ":_authToken")) { - c.token = this.get(nerfed + ":_authToken") + // used to override scope matching for tokens as well as legacy auth + if (this.get(nerfed + ':always-auth') !== undefined) { + var val = this.get(nerfed + ':always-auth') + c.alwaysAuth = val === 'false' ? false : !!val + } else if (this.get('always-auth') !== undefined) { + c.alwaysAuth = this.get('always-auth') + } + + if (this.get(nerfed + ':_authToken')) { + c.token = this.get(nerfed + ':_authToken') // the bearer token is enough, don't confuse things return c } @@ -30,43 +38,36 @@ function getCredentialsByURI (uri) { // registry, if set. // // XXX(isaacs): Remove when npm 1.4 is no longer relevant - var authDef = this.get("_auth") - var userDef = this.get("username") - var passDef = this.get("_password") + var authDef = this.get('_auth') + var userDef = this.get('username') + var passDef = this.get('_password') if (authDef && !(userDef && passDef)) { - authDef = new Buffer(authDef, "base64").toString() - authDef = authDef.split(":") + authDef = new Buffer(authDef, 'base64').toString() + authDef = authDef.split(':') userDef = authDef.shift() - passDef = authDef.join(":") + passDef = authDef.join(':') } - if (this.get(nerfed + ":_password")) { - c.password = new Buffer(this.get(nerfed + ":_password"), "base64").toString("utf8") + if (this.get(nerfed + ':_password')) { + c.password = new Buffer(this.get(nerfed + ':_password'), 'base64').toString('utf8') } else if (nerfed === defnerf && passDef) { c.password = passDef } - if (this.get(nerfed + ":username")) { - c.username = this.get(nerfed + ":username") + if (this.get(nerfed + ':username')) { + c.username = this.get(nerfed + ':username') } else if (nerfed === defnerf && userDef) { c.username = userDef } - if (this.get(nerfed + ":email")) { - c.email = this.get(nerfed + ":email") - } else if (this.get("email")) { - c.email = this.get("email") - } - - if (this.get(nerfed + ":always-auth") !== undefined) { - var val = this.get(nerfed + ":always-auth") - c.alwaysAuth = val === "false" ? false : !!val - } else if (this.get("always-auth") !== undefined) { - c.alwaysAuth = this.get("always-auth") + if (this.get(nerfed + ':email')) { + c.email = this.get(nerfed + ':email') + } else if (this.get('email')) { + c.email = this.get('email') } if (c.username && c.password) { - c.auth = new Buffer(c.username + ":" + c.password).toString("base64") + c.auth = new Buffer(c.username + ':' + c.password).toString('base64') } return c diff --git a/deps/npm/lib/config/load-cafile.js b/deps/npm/lib/config/load-cafile.js index cc63615ff55532..de8f61625a6b17 100644 --- a/deps/npm/lib/config/load-cafile.js +++ b/deps/npm/lib/config/load-cafile.js @@ -1,34 +1,32 @@ module.exports = loadCAFile -var fs = require("fs") +var fs = require('fs') -function loadCAFile(cafilePath, cb) { - if (!cafilePath) - return process.nextTick(cb) +function loadCAFile (cafilePath, cb) { + if (!cafilePath) return process.nextTick(cb) - fs.readFile(cafilePath, "utf8", afterCARead.bind(this)) - - function afterCARead(er, cadata) { + fs.readFile(cafilePath, 'utf8', afterCARead.bind(this)) + function afterCARead (er, cadata) { if (er) { // previous cafile no longer exists, so just continue on gracefully if (er.code === 'ENOENT') return cb() return cb(er) } - var delim = "-----END CERTIFICATE-----" + var delim = '-----END CERTIFICATE-----' var output output = cadata .split(delim) - .filter(function(xs) { + .filter(function (xs) { return !!xs.trim() }) - .map(function(xs) { + .map(function (xs) { return xs.trimLeft() + delim }) - this.set("ca", output) + this.set('ca', output) cb(null) } } diff --git a/deps/npm/lib/config/load-prefix.js b/deps/npm/lib/config/load-prefix.js index 39d076fb7d4434..bb5d9f3be56bf1 100644 --- a/deps/npm/lib/config/load-prefix.js +++ b/deps/npm/lib/config/load-prefix.js @@ -1,43 +1,45 @@ module.exports = loadPrefix -var findPrefix = require("./find-prefix.js") -var path = require("path") +var findPrefix = require('./find-prefix.js') +var path = require('path') function loadPrefix (cb) { var cli = this.list[0] - Object.defineProperty(this, "prefix", - { set : function (prefix) { - var g = this.get("global") - this[g ? "globalPrefix" : "localPrefix"] = prefix - }.bind(this) - , get : function () { - var g = this.get("global") + Object.defineProperty(this, 'prefix', + { + set: function (prefix) { + var g = this.get('global') + this[g ? 'globalPrefix' : 'localPrefix'] = prefix + }.bind(this), + get: function () { + var g = this.get('global') return g ? this.globalPrefix : this.localPrefix - }.bind(this) - , enumerable : true + }.bind(this), + enumerable: true }) - Object.defineProperty(this, "globalPrefix", - { set : function (prefix) { - this.set("prefix", prefix) - }.bind(this) - , get : function () { - return path.resolve(this.get("prefix")) - }.bind(this) - , enumerable : true + Object.defineProperty(this, 'globalPrefix', + { + set: function (prefix) { + this.set('prefix', prefix) + }.bind(this), + get: function () { + return path.resolve(this.get('prefix')) + }.bind(this), + enumerable: true }) var p - Object.defineProperty(this, "localPrefix", - { set : function (prefix) { p = prefix }, - get : function () { return p } - , enumerable: true }) + Object.defineProperty(this, 'localPrefix', + { set: function (prefix) { p = prefix }, + get: function () { return p }, + enumerable: true }) // try to guess at a good node_modules location. // If we are *explicitly* given a prefix on the cli, then // always use that. otherwise, infer local prefix from cwd. - if (Object.prototype.hasOwnProperty.call(cli, "prefix")) { + if (Object.prototype.hasOwnProperty.call(cli, 'prefix')) { p = path.resolve(cli.prefix) process.nextTick(cb) } else { diff --git a/deps/npm/lib/config/load-uid.js b/deps/npm/lib/config/load-uid.js index 3ca79877353519..859eac7494bc7e 100644 --- a/deps/npm/lib/config/load-uid.js +++ b/deps/npm/lib/config/load-uid.js @@ -1,14 +1,14 @@ module.exports = loadUid -var getUid = require("uid-number") +var getUid = require('uid-number') // Call in the context of a npmconf object function loadUid (cb) { // if we're not in unsafe-perm mode, then figure out who // to run stuff as. Do this first, to support `npm update npm -g` - if (!this.get("unsafe-perm")) { - getUid(this.get("user"), this.get("group"), cb) + if (!this.get('unsafe-perm')) { + getUid(this.get('user'), this.get('group'), cb) } else { process.nextTick(cb) } diff --git a/deps/npm/lib/config/nerf-dart.js b/deps/npm/lib/config/nerf-dart.js index 07c817500f6fbe..8d2bdd26edf9ba 100644 --- a/deps/npm/lib/config/nerf-dart.js +++ b/deps/npm/lib/config/nerf-dart.js @@ -1,4 +1,4 @@ -var url = require("url") +var url = require('url') module.exports = toNerfDart @@ -11,7 +11,7 @@ module.exports = toNerfDart * * @returns {String} A nerfed URL. */ -function toNerfDart(uri) { +function toNerfDart (uri) { var parsed = url.parse(uri) delete parsed.protocol delete parsed.auth @@ -19,5 +19,5 @@ function toNerfDart(uri) { delete parsed.search delete parsed.hash - return url.resolve(url.format(parsed), ".") + return url.resolve(url.format(parsed), '.') } diff --git a/deps/npm/lib/config/set-credentials-by-uri.js b/deps/npm/lib/config/set-credentials-by-uri.js index 31eab4479ede21..74211380d86b6f 100644 --- a/deps/npm/lib/config/set-credentials-by-uri.js +++ b/deps/npm/lib/config/set-credentials-by-uri.js @@ -1,42 +1,39 @@ -var assert = require("assert") +var assert = require('assert') -var toNerfDart = require("./nerf-dart.js") +var toNerfDart = require('./nerf-dart.js') module.exports = setCredentialsByURI function setCredentialsByURI (uri, c) { - assert(uri && typeof uri === "string", "registry URL is required") - assert(c && typeof c === "object", "credentials are required") + assert(uri && typeof uri === 'string', 'registry URL is required') + assert(c && typeof c === 'object', 'credentials are required') var nerfed = toNerfDart(uri) if (c.token) { - this.set(nerfed + ":_authToken", c.token, "user") - this.del(nerfed + ":_password", "user") - this.del(nerfed + ":username", "user") - this.del(nerfed + ":email", "user") - this.del(nerfed + ":always-auth", "user") - } - else if (c.username || c.password || c.email) { - assert(c.username, "must include username") - assert(c.password, "must include password") - assert(c.email, "must include email address") - - this.del(nerfed + ":_authToken", "user") - - var encoded = new Buffer(c.password, "utf8").toString("base64") - this.set(nerfed + ":_password", encoded, "user") - this.set(nerfed + ":username", c.username, "user") - this.set(nerfed + ":email", c.email, "user") + this.set(nerfed + ':_authToken', c.token, 'user') + this.del(nerfed + ':_password', 'user') + this.del(nerfed + ':username', 'user') + this.del(nerfed + ':email', 'user') + this.del(nerfed + ':always-auth', 'user') + } else if (c.username || c.password || c.email) { + assert(c.username, 'must include username') + assert(c.password, 'must include password') + assert(c.email, 'must include email address') + + this.del(nerfed + ':_authToken', 'user') + + var encoded = new Buffer(c.password, 'utf8').toString('base64') + this.set(nerfed + ':_password', encoded, 'user') + this.set(nerfed + ':username', c.username, 'user') + this.set(nerfed + ':email', c.email, 'user') if (c.alwaysAuth !== undefined) { - this.set(nerfed + ":always-auth", c.alwaysAuth, "user") + this.set(nerfed + ':always-auth', c.alwaysAuth, 'user') + } else { + this.del(nerfed + ':always-auth', 'user') } - else { - this.del(nerfed + ":always-auth", "user") - } - } - else { - throw new Error("No credentials to set.") + } else { + throw new Error('No credentials to set.') } } diff --git a/deps/npm/lib/config/set-user.js b/deps/npm/lib/config/set-user.js index 4c207a6792a6f4..14cc21d2ebd998 100644 --- a/deps/npm/lib/config/set-user.js +++ b/deps/npm/lib/config/set-user.js @@ -1,9 +1,9 @@ module.exports = setUser -var assert = require("assert") -var path = require("path") -var fs = require("fs") -var mkdirp = require("mkdirp") +var assert = require('assert') +var path = require('path') +var fs = require('fs') +var mkdirp = require('mkdirp') function setUser (cb) { var defaultConf = this.root @@ -12,13 +12,13 @@ function setUser (cb) { // If global, leave it as-is. // If not global, then set the user to the owner of the prefix folder. // Just set the default, so it can be overridden. - if (this.get("global")) return cb() + if (this.get('global')) return cb() if (process.env.SUDO_UID) { defaultConf.user = +(process.env.SUDO_UID) return cb() } - var prefix = path.resolve(this.get("prefix")) + var prefix = path.resolve(this.get('prefix')) mkdirp(prefix, function (er) { if (er) return cb(er) fs.stat(prefix, function (er, st) { diff --git a/deps/npm/lib/dedupe.js b/deps/npm/lib/dedupe.js index c63705e18d6ea9..3159d41391197d 100644 --- a/deps/npm/lib/dedupe.js +++ b/deps/npm/lib/dedupe.js @@ -1,375 +1,163 @@ -// traverse the node_modules/package.json tree -// looking for duplicates. If any duplicates are found, -// then move them up to the highest level necessary -// in order to make them no longer duplicated. -// -// This is kind of ugly, and really highlights the need for -// much better "put pkg X at folder Y" abstraction. Oh well, -// whatever. Perfect enemy of the good, and all that. - -var fs = require("fs") -var asyncMap = require("slide").asyncMap -var path = require("path") -var readJson = require("read-package-json") -var semver = require("semver") -var rm = require("./utils/gently-rm.js") -var log = require("npmlog") -var npm = require("./npm.js") -var mapToRegistry = require("./utils/map-to-registry.js") +var util = require('util') +var path = require('path') +var validate = require('aproba') +var without = require('lodash.without') +var asyncMap = require('slide').asyncMap +var chain = require('slide').chain +var npa = require('npm-package-arg') +var log = require('npmlog') +var npm = require('./npm.js') +var Installer = require('./install.js').Installer +var findRequirement = require('./install/deps.js').findRequirement +var earliestInstallable = require('./install/deps.js').earliestInstallable +var checkPermissions = require('./install/check-permissions.js') +var decomposeActions = require('./install/decompose-actions.js') +var loadExtraneous = require('./install/deps.js').loadExtraneous +var filterInvalidActions = require('./install/filter-invalid-actions.js') +var recalculateMetadata = require('./install/deps.js').recalculateMetadata +var sortActions = require('./install/diff-trees.js').sortActions +var moduleName = require('./utils/module-name.js') +var packageId = require('./utils/package-id.js') +var childPath = require('./utils/child-path.js') module.exports = dedupe +module.exports.Deduper = Deduper -dedupe.usage = "npm dedupe [pkg pkg...]" +dedupe.usage = 'npm dedupe' -function dedupe (args, silent, cb) { - if (typeof silent === "function") cb = silent, silent = false +function dedupe (args, cb) { + validate('AF', arguments) + // the /path/to/node_modules/.. + var where = path.resolve(npm.dir, '..') var dryrun = false if (npm.command.match(/^find/)) dryrun = true - return dedupe_(npm.prefix, args, {}, dryrun, silent, cb) -} - -function dedupe_ (dir, filter, unavoidable, dryrun, silent, cb) { - readInstalled(path.resolve(dir), {}, null, function (er, data, counter) { - if (er) { - return cb(er) - } - - if (!data) { - return cb() - } - - // find out which things are dupes - var dupes = Object.keys(counter || {}).filter(function (k) { - if (filter.length && -1 === filter.indexOf(k)) return false - return counter[k] > 1 && !unavoidable[k] - }).reduce(function (s, k) { - s[k] = [] - return s - }, {}) - - // any that are unavoidable need to remain as they are. don't even - // try to touch them or figure it out. Maybe some day, we can do - // something a bit more clever here, but for now, just skip over it, - // and all its children. - ;(function U (obj) { - if (unavoidable[obj.name]) { - obj.unavoidable = true - } - if (obj.parent && obj.parent.unavoidable) { - obj.unavoidable = true - } - Object.keys(obj.children).forEach(function (k) { - U(obj.children[k]) - }) - })(data) - - // then collect them up and figure out who needs them - ;(function C (obj) { - if (dupes[obj.name] && !obj.unavoidable) { - dupes[obj.name].push(obj) - obj.duplicate = true - } - obj.dependents = whoDepends(obj) - Object.keys(obj.children).forEach(function (k) { - C(obj.children[k]) - }) - })(data) - - if (dryrun) { - var k = Object.keys(dupes) - if (!k.length) return cb() - return npm.commands.ls(k, silent, cb) - } - - var summary = Object.keys(dupes).map(function (n) { - return [n, dupes[n].filter(function (d) { - return d && d.parent && !d.parent.duplicate && !d.unavoidable - }).map(function M (d) { - return [d.path, d.version, d.dependents.map(function (k) { - return [k.path, k.version, k.dependencies[d.name] || ""] - })] - })] - }).map(function (item) { - var set = item[1] - - var ranges = set.map(function (i) { - return i[2].map(function (d) { - return d[2] - }) - }).reduce(function (l, r) { - return l.concat(r) - }, []).map(function (v, i, set) { - if (set.indexOf(v) !== i) return false - return v - }).filter(function (v) { - return v !== false - }) - - var locs = set.map(function (i) { - return i[0] - }) - - var versions = set.map(function (i) { - return i[1] - }).filter(function (v, i, set) { - return set.indexOf(v) === i - }) - - var has = set.map(function (i) { - return [i[0], i[1]] - }).reduce(function (set, kv) { - set[kv[0]] = kv[1] - return set - }, {}) + if (npm.config.get('dry-run')) dryrun = true - var loc = locs.length ? locs.reduce(function (a, b) { - // a=/path/to/node_modules/foo/node_modules/bar - // b=/path/to/node_modules/elk/node_modules/bar - // ==/path/to/node_modules/bar - var nmReg = new RegExp("\\" + path.sep + "node_modules\\" + path.sep) - a = a.split(nmReg) - b = b.split(nmReg) - var name = a.pop() - b.pop() - // find the longest chain that both A and B share. - // then push the name back on it, and join by /node_modules/ - for (var i = 0, al = a.length, bl = b.length; i < al && i < bl && a[i] === b[i]; i++); - return a.slice(0, i).concat(name).join(path.sep + "node_modules" + path.sep) - }) : undefined - - return [item[0], { item: item - , ranges: ranges - , locs: locs - , loc: loc - , has: has - , versions: versions - }] - }).filter(function (i) { - return i[1].loc - }) - - findVersions(npm, summary, function (er, set) { - if (er) return cb(er) - if (!set.length) return cb() - installAndRetest(set, filter, dir, unavoidable, silent, cb) - }) - }) + new Deduper(where, dryrun).run(cb) } -function installAndRetest (set, filter, dir, unavoidable, silent, cb) { - //return cb(null, set) - var remove = [] - - asyncMap(set, function (item, cb) { - // [name, has, loc, locMatch, regMatch, others] - var name = item[0] - var has = item[1] - var where = item[2] - var locMatch = item[3] - var regMatch = item[4] - var others = item[5] - - // nothing to be done here. oh well. just a conflict. - if (!locMatch && !regMatch) { - log.warn("unavoidable conflict", item[0], item[1]) - log.warn("unavoidable conflict", "Not de-duplicating") - unavoidable[item[0]] = true - return cb() - } - - // nothing to do except to clean up the extraneous deps - if (locMatch && has[where] === locMatch) { - remove.push.apply(remove, others) - return cb() - } - - if (regMatch) { - var what = name + "@" + regMatch - // where is /path/to/node_modules/foo/node_modules/bar - // for package "bar", but we need it to be just - // /path/to/node_modules/foo - var nmReg = new RegExp("\\" + path.sep + "node_modules\\" + path.sep) - where = where.split(nmReg) - where.pop() - where = where.join(path.sep + "node_modules" + path.sep) - remove.push.apply(remove, others) - - return npm.commands.install(where, what, cb) - } - - // hrm? - return cb(new Error("danger zone\n" + name + " " + - regMatch + " " + locMatch)) - - }, function (er) { - if (er) return cb(er) - asyncMap(remove, rm, function (er) { - if (er) return cb(er) - remove.forEach(function (r) { - log.info("rm", r) - }) - dedupe_(dir, filter, unavoidable, false, silent, cb) - }) - }) +function Deduper (where, dryrun) { + validate('SB', arguments) + Installer.call(this, where, dryrun, []) + this.noPackageJsonOk = true + this.topLevelLifecycles = false } - -function findVersions (npm, summary, cb) { - // now, for each item in the summary, try to find the maximum version - // that will satisfy all the ranges. next step is to install it at - // the specified location. - asyncMap(summary, function (item, cb) { - var name = item[0] - var data = item[1] - var loc = data.loc - var locs = data.locs.filter(function (l) { - return l !== loc +util.inherits(Deduper, Installer) + +Deduper.prototype.normalizeTree = function (log, cb) { + validate('OF', arguments) + log.silly('dedupe', 'normalizeTree') + // If we're looking globally only look at the one package we're operating on + if (npm.config.get('global')) { + var args = this.args + this.currentTree.children = this.currentTree.children.filter(function (child) { + return args.filter(function (arg) { return arg === moduleName(child) }).length }) + } + Installer.prototype.normalizeTree.call(this, log, cb) +} - // not actually a dupe, or perhaps all the other copies were - // children of a dupe, so this'll maybe be picked up later. - if (locs.length === 0) { - return cb(null, []) - } - - // { : } - var has = data.has - - // the versions that we already have. - // if one of these is ok, then prefer to use that. - // otherwise, try fetching from the registry. - var versions = data.versions - - var ranges = data.ranges - mapToRegistry(name, npm.config, function (er, uri, auth) { - if (er) return cb(er) - - npm.registry.get(uri, { auth : auth }, next) - }) +Deduper.prototype.loadIdealTree = function (cb) { + validate('F', arguments) + log.silly('install', 'loadIdealTree') - function next (er, data) { - var regVersions = er ? [] : Object.keys(data.versions) - var locMatch = bestMatch(versions, ranges) - var tag = npm.config.get("tag") - var distTag = data["dist-tags"] && data["dist-tags"][tag] + var self = this + chain([ + [this.newTracker(this.progress.loadIdealTree, 'cloneCurrentTree')], + [this, this.cloneCurrentTreeToIdealTree], + [this, this.finishTracker, 'cloneCurrentTree'], - var regMatch - if (distTag && data.versions[distTag] && matches(distTag, ranges)) { - regMatch = distTag - } else { - regMatch = bestMatch(regVersions, ranges) - } + [this.newTracker(this.progress.loadIdealTree, 'loadAllDepsIntoIdealTree', 10)], + [ function (next) { + loadExtraneous(self.idealTree, self.progress.loadAllDepsIntoIdealTree, next) + } ], + [this, this.finishTracker, 'loadAllDepsIntoIdealTree'], - cb(null, [[name, has, loc, locMatch, regMatch, locs]]) - } - }, cb) + [this, function (next) { recalculateMetadata(this.idealTree, log, next) }] + ], cb) } -function matches (version, ranges) { - return !ranges.some(function (r) { - return !semver.satisfies(version, r, true) - }) +Deduper.prototype.generateActionsToTake = function (cb) { + validate('F', arguments) + log.silly('dedupe', 'generateActionsToTake') + chain([ + [this.newTracker(log, 'hoist', 1)], + [hoistChildren, this.idealTree, this.differences], + [this, this.finishTracker, 'hoist'], + [this.newTracker(log, 'sort-actions', 1)], + [this, function (next) { + this.differences = sortActions(this.differences) + next() + }], + [this, this.finishTracker, 'sort-actions'], + [filterInvalidActions, this.where, this.differences], + [checkPermissions, this.differences], + [decomposeActions, this.differences, this.todo] + ], cb) } -function bestMatch (versions, ranges) { - return versions.filter(function (v) { - return matches(v, ranges) - }).sort(semver.compareLoose).pop() +function move (node, hoistTo, diff) { + node.parent.children = without(node.parent.children, node) + hoistTo.children.push(node) + node.fromPath = node.path + node.path = childPath(hoistTo.path, node) + node.parent = hoistTo + if (!diff.filter(function (action) { return action[0] === 'move' && action[1] === node }).length) { + diff.push(['move', node]) + } } - -function readInstalled (dir, counter, parent, cb) { - var pkg, children, realpath - - fs.realpath(dir, function (er, rp) { - realpath = rp - next() +function moveRemainingChildren (node, diff) { + node.children.forEach(function (child) { + move(child, node, diff) + moveRemainingChildren(child, diff) }) +} - readJson(path.resolve(dir, "package.json"), function (er, data) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) - if (er) return cb() // not a package, probably. - counter[data.name] = counter[data.name] || 0 - counter[data.name]++ - pkg = - { _id: data._id - , name: data.name - , version: data.version - , dependencies: data.dependencies || {} - , optionalDependencies: data.optionalDependencies || {} - , devDependencies: data.devDependencies || {} - , bundledDependencies: data.bundledDependencies || [] - , path: dir - , realPath: dir - , children: {} - , parent: parent - , family: Object.create(parent ? parent.family : null) - , unavoidable: false - , duplicate: false - } - if (parent) { - parent.children[data.name] = pkg - parent.family[data.name] = pkg - } - next() - }) - - fs.readdir(path.resolve(dir, "node_modules"), function (er, c) { - children = children || [] // error is ok, just means no children. - // check if there are scoped packages. - asyncMap(c || [], function (child, cb) { - if (child.indexOf('@') === 0) { - fs.readdir(path.resolve(dir, "node_modules", child), function (er, scopedChildren) { - // error is ok, just means no children. - (scopedChildren || []).forEach(function (sc) { - children.push(path.join(child, sc)) - }) - cb() - }) - } else { - children.push(child) - cb() - } - }, function (er) { - if (er) return cb(er) - children = children.filter(function (p) { - return !p.match(/^[\._-]/) - }) - next(); - }); - }) - - function next () { - if (!children || !pkg || !realpath) return - - // ignore devDependencies. Just leave them where they are. - children = children.filter(function (c) { - return !pkg.devDependencies.hasOwnProperty(c) - }) +function remove (child, diff, done) { + remove_(child, diff, {}, done) +} - pkg.realPath = realpath - if (pkg.realPath !== pkg.path) children = [] - var d = path.resolve(dir, "node_modules") - asyncMap(children, function (child, cb) { - readInstalled(path.resolve(d, child), counter, pkg, cb) - }, function (er) { - cb(er, pkg, counter) - }) - } +function remove_ (child, diff, seen, done) { + if (seen[child.path]) return done() + seen[child.path] = true + diff.push(['remove', child]) + child.parent.children = without(child.parent.children, child) + asyncMap(child.children, function (child, next) { + remove_(child, diff, seen, next) + }, done) } -function whoDepends (pkg) { - var start = pkg.parent || pkg - return whoDepends_(pkg, [], start) +function hoistChildren (tree, diff, next) { + hoistChildren_(tree, diff, {}, next) } -function whoDepends_ (pkg, who, test) { - if (test !== pkg && - test.dependencies[pkg.name] && - test.family[pkg.name] === pkg) { - who.push(test) - } - Object.keys(test.children).forEach(function (n) { - whoDepends_(pkg, who, test.children[n]) - }) - return who +function hoistChildren_ (tree, diff, seen, next) { + validate('OAOF', arguments) + if (seen[tree.path]) return next() + seen[tree.path] = true + asyncMap(tree.children, function (child, done) { + if (!tree.parent) return hoistChildren_(child, diff, seen, done) + var better = findRequirement(tree.parent, moduleName(child), child.package._requested || npa(packageId(child))) + if (better) { + return chain([ + [remove, child, diff], + [recalculateMetadata, tree, log] + ], done) + } + var hoistTo = earliestInstallable(tree, tree.parent, child.package) + if (hoistTo) { + move(child, hoistTo, diff) + chain([ + [recalculateMetadata, hoistTo, log], + [hoistChildren_, child, diff, seen], + [ function (next) { + moveRemainingChildren(child, diff) + next() + } ] + ], done) + } else { + done() + } + }, next) } diff --git a/deps/npm/lib/deprecate.js b/deps/npm/lib/deprecate.js index c90ad9027231c0..dff61973ed65db 100644 --- a/deps/npm/lib/deprecate.js +++ b/deps/npm/lib/deprecate.js @@ -1,25 +1,25 @@ -var npm = require("./npm.js") - , mapToRegistry = require("./utils/map-to-registry.js") - , npa = require("npm-package-arg") +var npm = require('./npm.js') +var mapToRegistry = require('./utils/map-to-registry.js') +var npa = require('npm-package-arg') module.exports = deprecate -deprecate.usage = "npm deprecate [@] " +deprecate.usage = 'npm deprecate [@] ' deprecate.completion = function (opts, cb) { // first, get a list of remote packages this user owns. // once we have a user account, then don't complete anything. if (opts.conf.argv.remain.length > 2) return cb() // get the list of packages by user - var path = "/-/by-user/" + var path = '/-/by-user/' mapToRegistry(path, npm.config, function (er, uri, c) { if (er) return cb(er) if (!(c && c.username)) return cb() var params = { - timeout : 60000, - auth : c + timeout: 60000, + auth: c } npm.registry.get(uri + c.username, params, function (er, list) { if (er) return cb() @@ -31,19 +31,23 @@ deprecate.completion = function (opts, cb) { function deprecate (args, cb) { var pkg = args[0] - , msg = args[1] - if (msg === undefined) return cb("Usage: " + deprecate.usage) + var msg = args[1] + if (msg === undefined) return cb('Usage: ' + deprecate.usage) // fetch the data and make sure it exists. var p = npa(pkg) + // npa makes the default spec "latest", but for deprecation + // "*" is the appropriate default. + if (p.rawSpec === '') p.spec = '*' + mapToRegistry(p.name, npm.config, function (er, uri, auth) { if (er) return cb(er) var params = { - version : p.spec, - message : msg, - auth : auth + version: p.spec, + message: msg, + auth: auth } npm.registry.deprecate(uri, params, cb) }) diff --git a/deps/npm/lib/dist-tag.js b/deps/npm/lib/dist-tag.js index 48b40202f9a142..d0bae9ab4409c6 100644 --- a/deps/npm/lib/dist-tag.js +++ b/deps/npm/lib/dist-tag.js @@ -1,21 +1,21 @@ module.exports = distTag -var log = require("npmlog") -var npa = require("npm-package-arg") -var semver = require("semver") +var log = require('npmlog') +var npa = require('npm-package-arg') +var semver = require('semver') -var npm = require("./npm.js") -var mapToRegistry = require("./utils/map-to-registry.js") -var readLocalPkg = require("./utils/read-local-package.js") +var npm = require('./npm.js') +var mapToRegistry = require('./utils/map-to-registry.js') +var readLocalPkg = require('./utils/read-local-package.js') -distTag.usage = "npm dist-tag add @ []" - + "\nnpm dist-tag rm " - + "\nnpm dist-tag ls []" +distTag.usage = 'npm dist-tag add @ []' + + '\nnpm dist-tag rm ' + + '\nnpm dist-tag ls []' distTag.completion = function (opts, cb) { var argv = opts.conf.argv.remain if (argv.length === 2) { - return cb(null, ["add", "rm", "ls"]) + return cb(null, ['add', 'rm', 'ls']) } switch (argv[2]) { @@ -27,29 +27,29 @@ distTag.completion = function (opts, cb) { function distTag (args, cb) { var cmd = args.shift() switch (cmd) { - case "add": case "a": case "set": case "s": + case 'add': case 'a': case 'set': case 's': return add(args[0], args[1], cb) - case "rm": case "r": case "del": case "d": case "remove": + case 'rm': case 'r': case 'del': case 'd': case 'remove': return remove(args[1], args[0], cb) - case "ls": case "l": case "sl": case "list": + case 'ls': case 'l': case 'sl': case 'list': return list(args[0], cb) default: - return cb("Usage:\n"+distTag.usage) + return cb('Usage:\n' + distTag.usage) } } function add (spec, tag, cb) { - var thing = npa(spec || "") + var thing = npa(spec || '') var pkg = thing.name var version = thing.rawSpec - var t = (tag || npm.config.get("tag")).trim() + var t = (tag || npm.config.get('tag')).trim() - log.verbose("dist-tag add", t, "to", pkg+"@"+version) + log.verbose('dist-tag add', t, 'to', pkg + '@' + version) - if (!pkg || !version || !t) return cb("Usage:\n"+distTag.usage) + if (!pkg || !version || !t) return cb('Usage:\n' + distTag.usage) if (semver.validRange(t)) { - var er = new Error("Tag name must not be a valid SemVer range: " + t) + var er = new Error('Tag name must not be a valid SemVer range: ' + t) return cb(er) } @@ -57,23 +57,23 @@ function add (spec, tag, cb) { if (er) return cb(er) if (tags[t] === version) { - log.warn("dist-tag add", t, "is already set to version", version) + log.warn('dist-tag add', t, 'is already set to version', version) return cb() } tags[t] = version mapToRegistry(pkg, npm.config, function (er, uri, auth, base) { var params = { - package : pkg, - distTag : t, - version : version, - auth : auth + 'package': pkg, + distTag: t, + version: version, + auth: auth } npm.registry.distTags.add(base, params, function (er) { if (er) return cb(er) - console.log("+"+t+": "+pkg+"@"+version) + console.log('+' + t + ': ' + pkg + '@' + version) cb() }) }) @@ -81,14 +81,14 @@ function add (spec, tag, cb) { } function remove (tag, pkg, cb) { - log.verbose("dist-tag del", tag, "from", pkg) + log.verbose('dist-tag del', tag, 'from', pkg) fetchTags(pkg, function (er, tags) { if (er) return cb(er) if (!tags[tag]) { - log.info("dist-tag del", tag, "is not a dist-tag on", pkg) - return cb(new Error(tag+" is not a dist-tag on "+pkg)) + log.info('dist-tag del', tag, 'is not a dist-tag on', pkg) + return cb(new Error(tag + ' is not a dist-tag on ' + pkg)) } var version = tags[tag] @@ -96,15 +96,15 @@ function remove (tag, pkg, cb) { mapToRegistry(pkg, npm.config, function (er, uri, auth, base) { var params = { - package : pkg, - distTag : tag, - auth : auth + 'package': pkg, + distTag: tag, + auth: auth } npm.registry.distTags.rm(base, params, function (er) { if (er) return cb(er) - console.log("-"+tag+": "+pkg+"@"+version) + console.log('-' + tag + ': ' + pkg + '@' + version) cb() }) }) @@ -112,20 +112,22 @@ function remove (tag, pkg, cb) { } function list (pkg, cb) { - if (!pkg) return readLocalPkg(function (er, pkg) { - if (er) return cb(er) - if (!pkg) return cb(distTag.usage) - list(pkg, cb) - }) + if (!pkg) { + return readLocalPkg(function (er, pkg) { + if (er) return cb(er) + if (!pkg) return cb(distTag.usage) + list(pkg, cb) + }) + } fetchTags(pkg, function (er, tags) { if (er) { - log.error("dist-tag ls", "Couldn't get dist-tag data for", pkg) + log.error('dist-tag ls', "Couldn't get dist-tag data for", pkg) return cb(er) } var msg = Object.keys(tags).map(function (k) { - return k+": "+tags[k] - }).sort().join("\n") + return k + ': ' + tags[k] + }).sort().join('\n') console.log(msg) cb(er, tags) }) @@ -136,13 +138,13 @@ function fetchTags (pkg, cb) { if (er) return cb(er) var params = { - package : pkg, - auth : auth + 'package': pkg, + auth: auth } npm.registry.distTags.fetch(base, params, function (er, tags) { if (er) return cb(er) if (!tags || !Object.keys(tags).length) { - return cb(new Error("No dist-tags found for " + pkg)) + return cb(new Error('No dist-tags found for ' + pkg)) } cb(null, tags) diff --git a/deps/npm/lib/docs.js b/deps/npm/lib/docs.js index 0de2349ddc952c..ea4bd561077e86 100644 --- a/deps/npm/lib/docs.js +++ b/deps/npm/lib/docs.js @@ -1,14 +1,12 @@ module.exports = docs -docs.usage = "npm docs " -docs.usage += "\n" -docs.usage += "npm docs ." +docs.usage = 'npm docs ' + + '\nnpm docs .' -var npm = require("./npm.js") - , opener = require("opener") - , path = require("path") - , log = require("npmlog") - , mapToRegistry = require("./utils/map-to-registry.js") +var npm = require('./npm.js') +var opener = require('opener') +var log = require('npmlog') +var fetchPackageMetadata = require('./fetch-package-metadata.js') docs.completion = function (opts, cb) { // FIXME: there used to be registry completion here, but it stopped making @@ -16,16 +14,12 @@ docs.completion = function (opts, cb) { cb() } -function url (json) { - return json.homepage ? json.homepage : "https://npmjs.org/package/" + json.name -} - function docs (args, cb) { - args = args || [] + if (!args || !args.length) args = ['.'] var pending = args.length - if (!pending) return getDoc(".", cb) - args.forEach(function(proj) { - getDoc(proj, function(err) { + log.silly('docs', args) + args.forEach(function (proj) { + getDoc(proj, function (err) { if (err) { return cb(err) } @@ -35,37 +29,11 @@ function docs (args, cb) { } function getDoc (project, cb) { - project = project || "." - var package = path.resolve(npm.localPrefix, "package.json") - - if (project === "." || project === "./") { - var json - try { - json = require(package) - if (!json.name) throw new Error('package.json does not have a valid "name" property') - project = json.name - } catch (e) { - log.error(e.message) - return cb(docs.usage) - } - - return opener(url(json), { command: npm.config.get("browser") }, cb) - } - - mapToRegistry(project, npm.config, function (er, uri, auth) { + log.silly('getDoc', project) + fetchPackageMetadata(project, '.', function (er, d) { if (er) return cb(er) - - npm.registry.get(uri + "/latest", { timeout : 3600, auth : auth }, next) + var url = d.homepage + if (!url) url = 'https://www.npmjs.org/package/' + d.name + return opener(url, {command: npm.config.get('browser')}, cb) }) - - function next (er, json) { - var github = "https://github.com/" + project + "#readme" - - if (er) { - if (project.split("/").length !== 2) return cb(er) - return opener(github, { command: npm.config.get("browser") }, cb) - } - - return opener(url(json), { command: npm.config.get("browser") }, cb) - } } diff --git a/deps/npm/lib/edit.js b/deps/npm/lib/edit.js index ddf501d54e56be..155db6fd97828c 100644 --- a/deps/npm/lib/edit.js +++ b/deps/npm/lib/edit.js @@ -1,25 +1,28 @@ -// npm edit [@] +// npm edit // open the package folder in the $EDITOR module.exports = edit -edit.usage = "npm edit " +edit.usage = 'npm edit [@]' -edit.completion = require("./utils/completion/installed-shallow.js") +edit.completion = require('./utils/completion/installed-shallow.js') -var npm = require("./npm.js") - , path = require("path") - , fs = require("graceful-fs") - , editor = require("editor") +var npm = require('./npm.js') +var path = require('path') +var fs = require('graceful-fs') +var editor = require('editor') function edit (args, cb) { var p = args[0] if (args.length !== 1 || !p) return cb(edit.usage) - var e = npm.config.get("editor") - if (!e) return cb(new Error( - "No editor set. Set the 'editor' config, or $EDITOR environ.")) - p = p.split("/") - .join("/node_modules/") - .replace(/(\/node_modules)+/, "/node_modules") + var e = npm.config.get('editor') + if (!e) { + return cb(new Error( + "No editor set. Set the 'editor' config, or $EDITOR environ." + )) + } + p = p.split('/') + .join('/node_modules/') + .replace(/(\/node_modules)+/, '/node_modules') var f = path.resolve(npm.dir, p) fs.lstat(f, function (er) { if (er) return cb(er) diff --git a/deps/npm/lib/explore.js b/deps/npm/lib/explore.js index 96475a0691f987..105ff84cc81301 100644 --- a/deps/npm/lib/explore.js +++ b/deps/npm/lib/explore.js @@ -2,33 +2,39 @@ // open a subshell to the package folder. module.exports = explore -explore.usage = "npm explore [ -- ]" -explore.completion = require("./utils/completion/installed-shallow.js") +explore.usage = 'npm explore [ -- ]' +explore.completion = require('./utils/completion/installed-shallow.js') -var npm = require("./npm.js") - , spawn = require("./utils/spawn") - , path = require("path") - , fs = require("graceful-fs") +var npm = require('./npm.js') +var spawn = require('./utils/spawn') +var path = require('path') +var fs = require('graceful-fs') function explore (args, cb) { if (args.length < 1 || !args[0]) return cb(explore.usage) var p = args.shift() - args = args.join(" ").trim() - if (args) args = ["-c", args] + args = args.join(' ').trim() + if (args) args = ['-c', args] else args = [] var cwd = path.resolve(npm.dir, p) - var sh = npm.config.get("shell") + var sh = npm.config.get('shell') fs.stat(cwd, function (er, s) { - if (er || !s.isDirectory()) return cb(new Error( - "It doesn't look like "+p+" is installed.")) - if (!args.length) console.log( - "\nExploring "+cwd+"\n"+ - "Type 'exit' or ^D when finished\n") + if (er || !s.isDirectory()) { + return cb(new Error( + "It doesn't look like " + p + ' is installed.' + )) + } - npm.spinner.stop() - var shell = spawn(sh, args, { cwd: cwd, stdio: "inherit" }) - shell.on("close", function (er) { + if (!args.length) { + console.log( + '\nExploring ' + cwd + '\n' + + "Type 'exit' or ^D when finished\n" + ) + } + + var shell = spawn(sh, args, { cwd: cwd, stdio: 'inherit' }) + shell.on('close', function (er) { // only fail if non-interactive. if (!args.length) return cb() cb(er) diff --git a/deps/npm/lib/faq.js b/deps/npm/lib/faq.js deleted file mode 100644 index 912db0072f21e1..00000000000000 --- a/deps/npm/lib/faq.js +++ /dev/null @@ -1,8 +0,0 @@ - -module.exports = faq - -faq.usage = "npm faq" - -var npm = require("./npm.js") - -function faq (args, cb) { npm.commands.help(["faq"], cb) } diff --git a/deps/npm/lib/fetch-package-metadata.js b/deps/npm/lib/fetch-package-metadata.js new file mode 100644 index 00000000000000..9e62cacd914166 --- /dev/null +++ b/deps/npm/lib/fetch-package-metadata.js @@ -0,0 +1,341 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') +var zlib = require('zlib') + +var log = require('npmlog') +var realizePackageSpecifier = require('realize-package-specifier') +var tar = require('tar') +var once = require('once') +var semver = require('semver') +var readPackageTree = require('read-package-tree') +var readPackageJson = require('read-package-json') +var iferr = require('iferr') +var rimraf = require('rimraf') +var clone = require('lodash.clonedeep') +var validate = require('aproba') +var unpipe = require('unpipe') +var normalizePackageData = require('normalize-package-data') + +var npm = require('./npm.js') +var mapToRegistry = require('./utils/map-to-registry.js') +var cache = require('./cache.js') +var cachedPackageRoot = require('./cache/cached-package-root.js') +var tempFilename = require('./utils/temp-filename.js') +var getCacheStat = require('./cache/get-stat.js') +var unpack = require('./utils/tar.js').unpack +var pulseTillDone = require('./utils/pulse-till-done.js') +var parseJSON = require('./utils/parse-json.js') + +function andLogAndFinish (spec, tracker, done) { + validate('SF', [spec, done]) + return function (er, pkg) { + if (er) { + log.silly('fetchPackageMetaData', 'error for ' + spec, er) + if (tracker) tracker.finish() + } + return done(er, pkg) + } +} + +module.exports = function fetchPackageMetadata (spec, where, tracker, done) { + if (!done) { + done = tracker || where + tracker = null + if (done === where) where = null + } + if (typeof spec === 'object') { + var dep = spec + spec = dep.raw + } + var logAndFinish = andLogAndFinish(spec, tracker, done) + if (!dep) { + log.silly('fetchPackageMetaData', spec) + return realizePackageSpecifier(spec, where, iferr(logAndFinish, function (dep) { + fetchPackageMetadata(dep, where, tracker, done) + })) + } + if (dep.type === 'version' || dep.type === 'range' || dep.type === 'tag') { + fetchNamedPackageData(dep, addRequestedAndFinish) + } else if (dep.type === 'directory') { + fetchDirectoryPackageData(dep, where, addRequestedAndFinish) + } else { + fetchOtherPackageData(spec, dep, where, addRequestedAndFinish) + } + function addRequestedAndFinish (er, pkg) { + if (pkg) { + pkg._requested = dep + pkg._spec = spec + pkg._where = where + if (!pkg._args) pkg._args = [] + pkg._args.push([pkg._spec, pkg._where]) + // non-npm registries can and will return unnormalized data, plus + // even the npm registry may have package data normalized with older + // normalization rules. This ensures we get package data in a consistent, + // stable format. + try { + normalizePackageData(pkg) + } catch (ex) { + // don't care + } + } + logAndFinish(er, pkg) + } +} + +function fetchOtherPackageData (spec, dep, where, next) { + validate('SOSF', arguments) + log.silly('fetchOtherPackageData', spec) + cache.add(spec, null, where, false, iferr(next, function (pkg) { + var result = clone(pkg) + result._inCache = true + next(null, result) + })) +} + +function fetchDirectoryPackageData (dep, where, next) { + validate('OSF', arguments) + log.silly('fetchDirectoryPackageData', dep.name || dep.rawSpec) + readPackageJson(path.join(dep.spec, 'package.json'), false, next) +} + +var regCache = {} + +function fetchNamedPackageData (dep, next) { + validate('OF', arguments) + log.silly('fetchNamedPackageData', dep.name || dep.rawSpec) + mapToRegistry(dep.name || dep.rawSpec, npm.config, iferr(next, function (url, auth) { + if (regCache[url]) { + pickVersionFromRegistryDocument(clone(regCache[url])) + } else { + npm.registry.get(url, {auth: auth}, pulseTillDone('fetchMetadata', iferr(next, pickVersionFromRegistryDocument))) + } + function returnAndAddMetadata (pkg) { + delete pkg._from + delete pkg._resolved + delete pkg._shasum + next(null, pkg) + } + function pickVersionFromRegistryDocument (pkg) { + if (!regCache[url]) regCache[url] = pkg + var versions = Object.keys(pkg.versions).sort(semver.rcompare) + + if (dep.type === 'tag') { + var tagVersion = pkg['dist-tags'][dep.spec] + if (pkg.versions[tagVersion]) return returnAndAddMetadata(pkg.versions[tagVersion]) + } else { + var latestVersion = pkg['dist-tags'][npm.config.get('tag')] || versions[0] + + // Find the the most recent version less than or equal + // to latestVersion that satisfies our spec + for (var ii = 0; ii < versions.length; ++ii) { + if (semver.gt(versions[ii], latestVersion)) continue + if (semver.satisfies(versions[ii], dep.spec)) { + return returnAndAddMetadata(pkg.versions[versions[ii]]) + } + } + + // Failing that, try finding the most recent version that matches + // our spec + for (var jj = 0; jj < versions.length; ++jj) { + if (semver.satisfies(versions[jj], dep.spec)) { + return returnAndAddMetadata(pkg.versions[versions[jj]]) + } + } + + // Failing THAT, if the range was '*' uses latestVersion + if (dep.spec === '*') { + return returnAndAddMetadata(pkg.versions[latestVersion]) + } + } + + // And failing that, we error out + var targets = versions.length + ? 'Valid install targets:\n' + versions.join(', ') + '\n' + : 'No valid targets found.' + var er = new Error('No compatible version found: ' + + dep.raw + '\n' + targets) + return next(er) + } + })) +} + +function retryWithCached (pkg, asserter, next) { + if (!pkg._inCache) { + cache.add(pkg._spec, null, pkg._where, false, iferr(next, function (newpkg) { + Object.keys(newpkg).forEach(function (key) { + if (key[0] !== '_') return + pkg[key] = newpkg[key] + }) + pkg._inCache = true + return asserter(pkg, next) + })) + } + return !pkg._inCache +} + +module.exports.addShrinkwrap = function addShrinkwrap (pkg, next) { + validate('OF', arguments) + if (pkg._shrinkwrap !== undefined) return next(null, pkg) + if (retryWithCached(pkg, addShrinkwrap, next)) return + pkg._shrinkwrap = null + // FIXME: cache the shrinkwrap directly + var pkgname = pkg.name + var ver = pkg.version + var tarball = path.join(cachedPackageRoot({name: pkgname, version: ver}), 'package.tgz') + untarStream(tarball, function (er, untar) { + if (er) { + if (er.code === 'ENOTTARBALL') { + pkg._shrinkwrap = null + return next() + } else { + return next(er) + } + } + if (er) return next(er) + var foundShrinkwrap = false + untar.on('entry', function (entry) { + if (!/^(?:[^\/]+[\/])npm-shrinkwrap.json$/.test(entry.path)) return + log.silly('addShrinkwrap', 'Found shrinkwrap in ' + pkgname + ' ' + entry.path) + foundShrinkwrap = true + var shrinkwrap = '' + entry.on('data', function (chunk) { + shrinkwrap += chunk + }) + entry.on('end', function () { + untar.close() + log.silly('addShrinkwrap', 'Completed reading shrinkwrap in ' + pkgname) + try { + pkg._shrinkwrap = parseJSON(shrinkwrap) + } catch (ex) { + var er = new Error('Error parsing ' + pkgname + '@' + ver + "'s npm-shrinkwrap.json: " + ex.message) + er.type = 'ESHRINKWRAP' + return next(er) + } + next(null, pkg) + }) + entry.resume() + }) + untar.on('end', function () { + if (!foundShrinkwrap) { + pkg._shrinkwrap = null + next(null, pkg) + } + }) + }) +} + +module.exports.addBundled = function addBundled (pkg, next) { + validate('OF', arguments) + if (pkg._bundled !== undefined) return next(null, pkg) + if (!pkg.bundleDependencies) return next(null, pkg) + if (retryWithCached(pkg, addBundled, next)) return + pkg._bundled = null + var pkgname = pkg.name + var ver = pkg.version + var tarball = path.join(cachedPackageRoot({name: pkgname, version: ver}), 'package.tgz') + var target = tempFilename('unpack') + getCacheStat(iferr(next, function (cs) { + log.verbose('addBundled', 'extract', tarball) + unpack(tarball, target, null, null, cs.uid, cs.gid, iferr(next, function () { + log.silly('addBundled', 'read tarball') + readPackageTree(target, function (er, tree) { + log.silly('cleanup', 'remove extracted module') + rimraf(target, function () { + if (tree) { + pkg._bundled = tree.children + } + next(null, pkg) + }) + }) + })) + })) +} + +// FIXME: hasGzipHeader / hasTarHeader / untarStream duplicate a lot +// of code from lib/utils/tar.js– these should be brought together. + +function hasGzipHeader (c) { + return c[0] === 0x1F && c[1] === 0x8B && c[2] === 0x08 +} + +function hasTarHeader (c) { + return c[257] === 0x75 && // tar archives have 7573746172 at position + c[258] === 0x73 && // 257 and 003030 or 202000 at position 262 + c[259] === 0x74 && + c[260] === 0x61 && + c[261] === 0x72 && + + ((c[262] === 0x00 && + c[263] === 0x30 && + c[264] === 0x30) || + + (c[262] === 0x20 && + c[263] === 0x20 && + c[264] === 0x00)) +} + +function untarStream (tarball, cb) { + validate('SF', arguments) + cb = once(cb) + + var stream + var file = stream = fs.createReadStream(tarball) + var tounpipe = [file] + file.on('error', function (er) { + er = new Error('Error extracting ' + tarball + ' archive: ' + er.message) + er.code = 'EREADFILE' + cb(er) + }) + file.on('data', function OD (c) { + if (hasGzipHeader(c)) { + doGunzip() + } else if (hasTarHeader(c)) { + doUntar() + } else { + if (file.close) file.close() + if (file.destroy) file.destroy() + var er = new Error('Non-gzip/tarball ' + tarball) + er.code = 'ENOTTARBALL' + return cb(er) + } + file.removeListener('data', OD) + file.emit('data', c) + cb(null, stream) + }) + + function doGunzip () { + var gunzip = stream.pipe(zlib.createGunzip()) + gunzip.on('error', function (er) { + er = new Error('Error extracting ' + tarball + ' archive: ' + er.message) + er.code = 'EGUNZIP' + cb(er) + }) + tounpipe.push(gunzip) + stream = gunzip + doUntar() + } + + function doUntar () { + var untar = stream.pipe(tar.Parse()) + untar.on('error', function (er) { + er = new Error('Error extracting ' + tarball + ' archive: ' + er.message) + er.code = 'EUNTAR' + cb(er) + }) + tounpipe.push(untar) + stream = untar + addClose() + } + + function addClose () { + stream.close = function () { + tounpipe.forEach(function (stream) { + unpipe(stream) + }) + + if (file.close) file.close() + if (file.destroy) file.destroy() + } + } +} diff --git a/deps/npm/lib/fetch-package-metadata.md b/deps/npm/lib/fetch-package-metadata.md new file mode 100644 index 00000000000000..6a7d4fc595de24 --- /dev/null +++ b/deps/npm/lib/fetch-package-metadata.md @@ -0,0 +1,37 @@ +fetch-package-metadata +---------------------- + + var fetchPackageMetadata = require("npm/lib/fetch-package-metadata") + fetchPackageMetadata(spec, contextdir, callback) + +This will get package metadata (and if possible, ONLY package metadata) for +a specifer as passed to `npm install` et al, eg `npm@next` or `npm@^2.0.3` + +## fetchPackageMetadata(*spec*, *contextdir*, *tracker*, *callback*) + +* *spec* **string** | **object** -- The package specifier, can be anything npm can + understand (see [realize-package-specifier]), or it can be the result from + realize-package-specifier or npm-package-arg (for non-local deps). + +* *contextdir* **string** -- The directory from which relative paths to + local packages should be resolved. + +* *tracker* **object** -- **(optional)** An are-we-there-yet tracker group as + provided by `npm.log.newGroup()`. + +* *callback* **function (er, package)** -- Called when the package information + has been loaded. `package` is the object for of the `package.json` + matching the requested spec. In the case of named packages, it comes from + the registry and thus may not exactly match what's found in the associated + tarball. + +[realize-package-specifier]: (https://github.com/npm/realize-package-specifier) + +In the case of tarballs and git repos, it will use the cache to download +them in order to get the package metadata. For named packages, only the +metadata is downloaded (eg http://registry.npmjs.org/package). For local +directories, the package.json is read directly. For local tarballs, the +tarball is streamed in memory and just the package.json is extracted from +it. (Due to the nature of tars, having the package.json early in the file +will result in it being loaded faster– the extractor short-circuits the +uncompress/untar streams as best as it can.) diff --git a/deps/npm/lib/get.js b/deps/npm/lib/get.js index aa058002ec19a8..8dc805ec560c31 100644 --- a/deps/npm/lib/get.js +++ b/deps/npm/lib/get.js @@ -1,12 +1,12 @@ module.exports = get -get.usage = "npm get (See `npm config`)" +get.usage = 'npm get (See `npm config`)' -var npm = require("./npm.js") +var npm = require('./npm.js') get.completion = npm.commands.config.completion function get (args, cb) { - npm.commands.config(["get"].concat(args), cb) + npm.commands.config(['get'].concat(args), cb) } diff --git a/deps/npm/lib/help-search.js b/deps/npm/lib/help-search.js index d8553453bc54df..8a138feebed420 100644 --- a/deps/npm/lib/help-search.js +++ b/deps/npm/lib/help-search.js @@ -1,29 +1,29 @@ module.exports = helpSearch -var fs = require("graceful-fs") - , path = require("path") - , asyncMap = require("slide").asyncMap - , npm = require("./npm.js") - , glob = require("glob") - , color = require("ansicolors") +var fs = require('graceful-fs') +var path = require('path') +var asyncMap = require('slide').asyncMap +var npm = require('./npm.js') +var glob = require('glob') +var color = require('ansicolors') -helpSearch.usage = "npm help-search " +helpSearch.usage = 'npm help-search ' function helpSearch (args, silent, cb) { - if (typeof cb !== "function") cb = silent, silent = false + if (typeof cb !== 'function') { + cb = silent + silent = false + } if (!args.length) return cb(helpSearch.usage) - var docPath = path.resolve(__dirname, "..", "doc") - return glob(docPath + "/*/*.md", function (er, files) { - if (er) - return cb(er) + var docPath = path.resolve(__dirname, '..', 'doc') + return glob(docPath + '/*/*.md', function (er, files) { + if (er) return cb(er) readFiles(files, function (er, data) { - if (er) - return cb(er) + if (er) return cb(er) searchFiles(args, data, function (er, results) { - if (er) - return cb(er) + if (er) return cb(er) formatResults(args, results, cb) }) }) @@ -52,8 +52,7 @@ function searchFiles (args, files, cb) { for (var a = 0, l = args.length; a < l && !match; a++) { match = data.toLowerCase().indexOf(args[a].toLowerCase()) !== -1 } - if (!match) - return + if (!match) return var lines = data.split(/\n+/) @@ -61,14 +60,14 @@ function searchFiles (args, files, cb) { // if the next line has a search term, then skip all 3 // otherwise, set the line to null. then remove the nulls. l = lines.length - for (var i = 0; i < l; i ++) { + for (var i = 0; i < l; i++) { var line = lines[i] - , nextLine = lines[i + 1] - , ll + var nextLine = lines[i + 1] + var ll match = false if (nextLine) { - for (a = 0, ll = args.length; a < ll && !match; a ++) { + for (a = 0, ll = args.length; a < ll && !match; a++) { match = nextLine.toLowerCase() .indexOf(args[a].toLowerCase()) !== -1 } @@ -80,12 +79,12 @@ function searchFiles (args, files, cb) { } match = false - for (a = 0, ll = args.length; a < ll && !match; a ++) { + for (a = 0, ll = args.length; a < ll && !match; a++) { match = line.toLowerCase().indexOf(args[a].toLowerCase()) !== -1 } if (match) { // skip over the next line - i ++ + i++ continue } @@ -94,7 +93,7 @@ function searchFiles (args, files, cb) { // now squish any string of nulls into a single null lines = lines.reduce(function (l, r) { - if (!(r === null && l[l.length-1] === null)) l.push(r) + if (!(r === null && l[l.length - 1] === null)) l.push(r) return l }, []) @@ -103,10 +102,10 @@ function searchFiles (args, files, cb) { // now see how many args were found at all. var found = {} - , totalHits = 0 + var totalHits = 0 lines.forEach(function (line) { args.forEach(function (arg) { - var hit = (line || "").toLowerCase() + var hit = (line || '').toLowerCase() .split(arg.toLowerCase()).length - 1 if (hit > 0) { found[arg] = (found[arg] || 0) + hit @@ -115,27 +114,28 @@ function searchFiles (args, files, cb) { }) }) - var cmd = "npm help " - if (path.basename(path.dirname(file)) === "api") { - cmd = "npm apihelp " + var cmd = 'npm help ' + if (path.basename(path.dirname(file)) === 'api') { + cmd = 'npm apihelp ' } - cmd += path.basename(file, ".md").replace(/^npm-/, "") - results.push({ file: file - , cmd: cmd - , lines: lines - , found: Object.keys(found) - , hits: found - , totalHits: totalHits - }) + cmd += path.basename(file, '.md').replace(/^npm-/, '') + results.push({ + file: file, + cmd: cmd, + lines: lines, + found: Object.keys(found), + hits: found, + totalHits: totalHits + }) }) // if only one result, then just show that help section. if (results.length === 1) { - return npm.commands.help([results[0].file.replace(/\.md$/, "")], cb) + return npm.commands.help([results[0].file.replace(/\.md$/, '')], cb) } if (results.length === 0) { - console.log("No results for " + args.map(JSON.stringify).join(" ")) + console.log('No results for ' + args.map(JSON.stringify).join(' ')) return cb() } @@ -161,48 +161,49 @@ function formatResults (args, results, cb) { var out = results.map(function (res) { var out = res.cmd - , r = Object.keys(res.hits).map(function (k) { - return k + ":" + res.hits[k] - }).sort(function (a, b) { - return a > b ? 1 : -1 - }).join(" ") + var r = Object.keys(res.hits) + .map(function (k) { + return k + ':' + res.hits[k] + }).sort(function (a, b) { + return a > b ? 1 : -1 + }).join(' ') out += ((new Array(Math.max(1, cols - out.length - r.length))) - .join(" ")) + r + .join(' ')) + r - if (!npm.config.get("long")) return out + if (!npm.config.get('long')) return out - out = "\n\n" + out - + "\n" + (new Array(cols)).join("—") + "\n" - + res.lines.map(function (line, i) { - if (line === null || i > 3) return "" - for (var out = line, a = 0, l = args.length; a < l; a ++) { - var finder = out.toLowerCase().split(args[a].toLowerCase()) - , newOut = "" - , p = 0 + out = '\n\n' + out + '\n' + + (new Array(cols)).join('—') + '\n' + + res.lines.map(function (line, i) { + if (line === null || i > 3) return '' + for (var out = line, a = 0, l = args.length; a < l; a++) { + var finder = out.toLowerCase().split(args[a].toLowerCase()) + var newOut = '' + var p = 0 - finder.forEach(function (f) { - newOut += out.substr(p, f.length) + finder.forEach(function (f) { + newOut += out.substr(p, f.length) - var hilit = out.substr(p + f.length, args[a].length) - if (npm.color) hilit = color.bgBlack(color.red(hilit)) - newOut += hilit + var hilit = out.substr(p + f.length, args[a].length) + if (npm.color) hilit = color.bgBlack(color.red(hilit)) + newOut += hilit - p += f.length + args[a].length - }) - } + p += f.length + args[a].length + }) + } - return newOut - }).join("\n").trim() + return newOut + }).join('\n').trim() return out - }).join("\n") - - if (results.length && !npm.config.get("long")) { - out = "Top hits for "+(args.map(JSON.stringify).join(" ")) - + "\n" + (new Array(cols)).join("—") + "\n" - + out - + "\n" + (new Array(cols)).join("—") + "\n" - + "(run with -l or --long to see more context)" + }).join('\n') + + if (results.length && !npm.config.get('long')) { + out = 'Top hits for ' + (args.map(JSON.stringify).join(' ')) + '\n' + + (new Array(cols)).join('—') + '\n' + + out + '\n' + + (new Array(cols)).join('—') + '\n' + + '(run with -l or --long to see more context)' } console.log(out.trim()) diff --git a/deps/npm/lib/help.js b/deps/npm/lib/help.js index 942d27b41e17b8..cecc6e02b086ea 100644 --- a/deps/npm/lib/help.js +++ b/deps/npm/lib/help.js @@ -6,16 +6,18 @@ help.completion = function (opts, cb) { getSections(cb) } -var path = require("path") - , spawn = require("./utils/spawn") - , npm = require("./npm.js") - , log = require("npmlog") - , opener = require("opener") - , glob = require("glob") +var path = require('path') +var spawn = require('./utils/spawn') +var npm = require('./npm.js') +var log = require('npmlog') +var opener = require('opener') +var glob = require('glob') +var cmdList = require('./config/cmd-list').cmdList +var shorthands = require('./config/cmd-list').shorthands +var commands = cmdList.concat(Object.keys(shorthands)) function help (args, cb) { - npm.spinner.stop() - var argv = npm.config.get("argv").cooked + var argv = npm.config.get('argv').cooked var argnum = 0 if (args.length === 2 && ~~args[0]) { @@ -24,54 +26,53 @@ function help (args, cb) { // npm help foo bar baz: search topics if (args.length > 1 && args[0]) { - return npm.commands["help-search"](args, argnum, cb) + return npm.commands['help-search'](args, argnum, cb) } var section = npm.deref(args[0]) || args[0] // npm help : show basic usage if (!section) { - var valid = argv[0] === "help" ? 0 : 1 + var valid = argv[0] === 'help' ? 0 : 1 return npmUsage(valid, cb) } - // npm -h: show command usage - if ( npm.config.get("usage") - && npm.commands[section] - && npm.commands[section].usage - ) { - npm.config.set("loglevel", "silent") - log.level = "silent" + if (npm.config.get('usage') && + npm.commands[section] && + npm.commands[section].usage) { + npm.config.set('loglevel', 'silent') + log.level = 'silent' console.log(npm.commands[section].usage) return cb() } // npm apihelp
    : Prefer section 3 over section 1 - var apihelp = argv.length && -1 !== argv[0].indexOf("api") + var apihelp = argv.length && argv[0].indexOf('api') !== -1 var pref = apihelp ? [3, 1, 5, 7] : [1, 3, 5, 7] - if (argnum) + if (argnum) { pref = [ argnum ].concat(pref.filter(function (n) { return n !== argnum })) + } // npm help
    : Try to find the path - var manroot = path.resolve(__dirname, "..", "man") + var manroot = path.resolve(__dirname, '..', 'man') // legacy - if (section === "global") section = "folders" - else if (section === "json") section = "package.json" + if (section === 'global') section = 'folders' + else if (section === 'json') section = 'package.json' // find either /section.n or /npm-section.n // The glob is used in the glob. The regexp is used much // further down. Globs and regexps are different - var compextglob = ".+(gz|bz2|lzma|[FYzZ]|xz)" - var compextre = "\\.(gz|bz2|lzma|[FYzZ]|xz)$" - var f = "+(npm-" + section + "|" + section + ").[0-9]?(" + compextglob + ")" - return glob(manroot + "/*/" + f, function (er, mans) { + var compextglob = '.+(gz|bz2|lzma|[FYzZ]|xz)' + var compextre = '\\.(gz|bz2|lzma|[FYzZ]|xz)$' + var f = '+(npm-' + section + '|' + section + ').[0-9]?(' + compextglob + ')' + return glob(manroot + '/*/' + f, function (er, mans) { if (er) return cb(er) - if (!mans.length) return npm.commands["help-search"](args, cb) + if (!mans.length) return npm.commands['help-search'](args, cb) mans = mans.map(function (man) { var ext = path.extname(man) @@ -103,83 +104,82 @@ function pickMan (mans, pref_) { function viewMan (man, cb) { var nre = /([0-9]+)$/ var num = man.match(nre)[1] - var section = path.basename(man, "." + num) + var section = path.basename(man, '.' + num) // at this point, we know that the specified man page exists - var manpath = path.join(__dirname, "..", "man") - , env = {} + var manpath = path.join(__dirname, '..', 'man') + var env = {} Object.keys(process.env).forEach(function (i) { env[i] = process.env[i] }) env.MANPATH = manpath - var viewer = npm.config.get("viewer") + var viewer = npm.config.get('viewer') var conf switch (viewer) { - case "woman": - var a = ["-e", "(woman-find-file \"" + man + "\")"] - conf = { env: env, stdio: "inherit" } - var woman = spawn("emacsclient", a, conf) - woman.on("close", cb) + case 'woman': + var a = ['-e', '(woman-find-file \'' + man + '\')'] + conf = { env: env, stdio: 'inherit' } + var woman = spawn('emacsclient', a, conf) + woman.on('close', cb) break - case "browser": - opener(htmlMan(man), { command: npm.config.get("browser") }, cb) + case 'browser': + opener(htmlMan(man), { command: npm.config.get('browser') }, cb) break default: - conf = { env: env, stdio: "inherit" } - var manProcess = spawn("man", [num, section], conf) - manProcess.on("close", cb) + conf = { env: env, stdio: 'inherit' } + var manProcess = spawn('man', [num, section], conf) + manProcess.on('close', cb) break } } function htmlMan (man) { var sect = +man.match(/([0-9]+)$/)[1] - var f = path.basename(man).replace(/([0-9]+)$/, "html") + var f = path.basename(man).replace(/([0-9]+)$/, 'html') switch (sect) { case 1: - sect = "cli" + sect = 'cli' break case 3: - sect = "api" + sect = 'api' break case 5: - sect = "files" + sect = 'files' break case 7: - sect = "misc" + sect = 'misc' break default: - throw new Error("invalid man section: " + sect) + throw new Error('invalid man section: ' + sect) } - return path.resolve(__dirname, "..", "html", "doc", sect, f) + return path.resolve(__dirname, '..', 'html', 'doc', sect, f) } function npmUsage (valid, cb) { - npm.config.set("loglevel", "silent") - log.level = "silent" - console.log( - [ "\nUsage: npm " - , "" - , "where is one of:" - , npm.config.get("long") ? usages() - : " " + wrap(Object.keys(npm.commands)) - , "" - , "npm -h quick help on " - , "npm -l display full usage info" - , "npm faq commonly asked questions" - , "npm help search for help on " - , "npm help npm involved overview" - , "" - , "Specify configs in the ini-formatted file:" - , " " + npm.config.get("userconfig") - , "or on the command line via: npm --key value" - , "Config info can be viewed via: npm help config" - , "" - , "npm@" + npm.version + " " + path.dirname(__dirname) - ].join("\n")) + npm.config.set('loglevel', 'silent') + log.level = 'silent' + console.log([ + '\nUsage: npm ', + '', + 'where is one of:', + npm.config.get('long') ? usages() + : ' ' + wrap(commands), + '', + 'npm -h quick help on ', + 'npm -l display full usage info', + 'npm help search for help on ', + 'npm help npm involved overview', + '', + 'Specify configs in the ini-formatted file:', + ' ' + npm.config.get('userconfig'), + 'or on the command line via: npm --key value', + 'Config info can be viewed via: npm help config', + '', + 'npm@' + npm.version + ' ' + path.dirname(__dirname) + ].join('\n')) cb(valid) } @@ -189,50 +189,50 @@ function usages () { return Object.keys(npm.commands).filter(function (c) { return c === npm.deref(c) }).reduce(function (set, c) { - set.push([c, npm.commands[c].usage || ""]) + set.push([c, npm.commands[c].usage || '']) maxLen = Math.max(maxLen, c.length) return set }, []).map(function (item) { var c = item[0] - , usage = item[1] - return "\n " + c + (new Array(maxLen - c.length + 2).join(" ")) - + (usage.split("\n") - .join("\n" + (new Array(maxLen + 6).join(" ")))) - }).join("\n") + var usage = item[1] + return '\n ' + + c + (new Array(maxLen - c.length + 2).join(' ')) + + (usage.split('\n').join('\n' + (new Array(maxLen + 6).join(' ')))) + }).join('\n') } - function wrap (arr) { - var out = [""] - , l = 0 - , line + var out = [''] + var l = 0 + var line line = process.stdout.columns - if (!line) + if (!line) { line = 60 - else + } else { line = Math.min(60, Math.max(line - 16, 24)) + } - arr.sort(function (a,b) { return a --save` afterwards to install a package and" - ,"save it as a dependency in the package.json file." - ,"" - ,"Press ^C at any time to quit." - ].join("\n")) + console.log([ + 'This utility will walk you through creating a package.json file.', + 'It only covers the most common items, and tries to guess sensible defaults.', + '', + 'See `npm help json` for definitive documentation on these fields', + 'and exactly what they do.', + '', + 'Use `npm install --save` afterwards to install a package and', + 'save it as a dependency in the package.json file.', + '', + 'Press ^C at any time to quit.' + ].join('\n')) } initJson(dir, initFile, npm.config, function (er, data) { log.resume() - log.silly("package data", data) - if (er && er.message === "canceled") { - log.warn("init", "canceled") + log.silly('package data', data) + if (er && er.message === 'canceled') { + log.warn('init', 'canceled') return cb(null, data) } - log.info("init", "written successfully") + log.info('init', 'written successfully') cb(er, data) }) } diff --git a/deps/npm/lib/install-test.js b/deps/npm/lib/install-test.js new file mode 100644 index 00000000000000..feadb25d695e67 --- /dev/null +++ b/deps/npm/lib/install-test.js @@ -0,0 +1,23 @@ +'use strict' + +// npm install-test +// Runs `npm install` and then runs `npm test` + +module.exports = installTest +var install = require('./install.js') +var test = require('./test.js') + +installTest.usage = '\nnpm install-test [args]' + + '\nSame args as `npm install`' + + '\n\nalias: npm it' + +installTest.completion = install.completion + +function installTest (args, cb) { + install(args, function (er) { + if (er) { + return cb(er) + } + test([], cb) + }) +} diff --git a/deps/npm/lib/install.js b/deps/npm/lib/install.js index 9cc6a46fc0ca06..2f8bff1ce3a672 100644 --- a/deps/npm/lib/install.js +++ b/deps/npm/lib/install.js @@ -1,3 +1,4 @@ +'use strict' // npm install // // See doc/install.md for more description @@ -12,23 +13,23 @@ // added, and then that's passed to the next generation of installation. module.exports = install - -install.usage = "npm install" - + "\nnpm install " - + "\nnpm install @" - + "\nnpm install @" - + "\nnpm install @" - + "\nnpm install " - + "\nnpm install " - + "\nnpm install " - + "\nnpm install " - + "\nnpm install /" - + "\n\nCan specify one or more: npm install ./foo.tgz bar@stable /some/folder" - + "\nIf no argument is supplied and ./npm-shrinkwrap.json is " - + "\npresent, installs dependencies specified in the shrinkwrap." - + "\nOtherwise, installs dependencies from ./package.json." +module.exports.Installer = Installer + +install.usage = '\nnpm install (with no args, in package dir)' + + '\nnpm install [<@scope>/]' + + '\nnpm install [<@scope>/]@' + + '\nnpm install [<@scope>/]@' + + '\nnpm install [<@scope>/]@' + + '\nnpm install ' + + '\nnpm install ' + + '\nnpm install ' + + '\nnpm install ' + + '\nnpm install /' + + '\n\nalias: npm i' + + '\ncommon options: [--save|--save-dev|--save-optional] [--save-exact]' install.completion = function (opts, cb) { + validate('OF', arguments) // install can complete to a folder with a package.json, or any package. // if it has a slash, then it's gotta be a folder // if it starts with https?://, then just give up, because it's a url @@ -42,12 +43,12 @@ install.completion = function (opts, cb) { // is a folder containing a package.json file. If that is not the // case we return 0 matches, which will trigger the default bash // complete. - var lastSlashIdx = opts.partialWord.lastIndexOf("/") + var lastSlashIdx = opts.partialWord.lastIndexOf('/') var partialName = opts.partialWord.slice(lastSlashIdx + 1) var partialPath = opts.partialWord.slice(0, lastSlashIdx) - if (partialPath === "") partialPath = "/" + if (partialPath === '') partialPath = '/' - function annotatePackageDirMatch (sibling, cb) { + var annotatePackageDirMatch = function (sibling, cb) { var fullPath = path.join(partialPath, sibling) if (sibling.slice(0, partialName.length) !== partialName) { return cb(null, null) // not name match @@ -59,7 +60,7 @@ install.completion = function (opts, cb) { null, { fullPath: fullPath, - isPackage: contents.indexOf("package.json") !== -1 + isPackage: contents.indexOf('package.json') !== -1 } ) }) @@ -86,1111 +87,642 @@ install.completion = function (opts, cb) { cb() } -var npm = require("./npm.js") - , semver = require("semver") - , readJson = require("read-package-json") - , readInstalled = require("read-installed") - , log = require("npmlog") - , path = require("path") - , fs = require("graceful-fs") - , writeFileAtomic = require("write-file-atomic") - , cache = require("./cache.js") - , asyncMap = require("slide").asyncMap - , chain = require("slide").chain - , url = require("url") - , mkdir = require("mkdirp") - , lifecycle = require("./utils/lifecycle.js") - , archy = require("archy") - , npmInstallChecks = require("npm-install-checks") - , sortedObject = require("sorted-object") - , mapToRegistry = require("./utils/map-to-registry.js") - , npa = require("npm-package-arg") - , inflight = require("inflight") - , locker = require("./utils/locker.js") - , lock = locker.lock - , unlock = locker.unlock - , warnStrict = require("./utils/warn-deprecated.js")("engineStrict") - , warnPeers = require("./utils/warn-deprecated.js")("peerDependencies") - -function install (args, cb_) { - var hasArguments = !!args.length - - function cb (er, installed) { - if (er) return cb_(er) - - validateInstall(where, function (er, problem) { - if (er) return cb_(er) - - if (problem) { - var peerInvalidError = new Error("The package " + problem._id + - " does not satisfy its siblings' peerDependencies requirements!") - peerInvalidError.code = "EPEERINVALID" - peerInvalidError.packageName = problem.name - peerInvalidError.packageVersion = problem.version - peerInvalidError.peersDepending = problem.peersDepending - return cb(peerInvalidError) - } - - var tree = treeify(installed || []) - , pretty = prettify(tree, installed).trim() - - if (pretty) console.log(pretty) - save(where, installed, tree, pretty, hasArguments, cb_) - }) - } - - // the /path/to/node_modules/.. - var where = path.resolve(npm.dir, "..") - - // internal api: install(where, what, cb) - if (arguments.length === 3) { - where = args - args = [].concat(cb_) // pass in [] to do default dep-install - cb_ = arguments[2] - log.verbose("install", "where, what", [where, args]) - } - - if (!npm.config.get("global")) { - args = args.filter(function (a) { - return path.resolve(a) !== where - }) - } - - mkdir(where, function (er) { - if (er) return cb(er) - // install dependencies locally by default, - // or install current folder globally - if (!args.length) { - var opt = { dev: npm.config.get("dev") || !npm.config.get("production") } - - if (npm.config.get("global")) args = ["."] - else return readDependencies(null, where, opt, function (er, data) { - if (er) { - log.error("install", "Couldn't read dependencies") - return cb(er) - } - var deps = Object.keys(data.dependencies || {}) - log.verbose("install", "where, deps", [where, deps]) - - // FIXME: Install peerDependencies as direct dependencies, but only at - // the top level. Should only last until peerDependencies are nerfed to - // no longer implicitly install themselves. - var peers = [] - Object.keys(data.peerDependencies || {}).forEach(function (dep) { - if (!data.dependencies[dep]) { - log.verbose( - "install", - "peerDependency", dep, "wasn't going to be installed; adding" - ) - warnPeers([ - "The peer dependency "+dep+" included from "+data.name+" will no", - "longer be automatically installed to fulfill the peerDependency ", - "in npm 3+. Your application will need to depend on it explicitly." - ], dep+","+data.name) - peers.push(dep) - } - }) - log.verbose("install", "where, peers", [where, peers]) - - var context = { family: {} - , ancestors: {} - , explicit: false - , parent: data - , root: true - , wrap: null } - - if (data.name === path.basename(where) && - path.basename(path.dirname(where)) === "node_modules") { - // Only include in ancestry if it can actually be required. - // Otherwise, it does not count. - context.family[data.name] = - context.ancestors[data.name] = data.version - } - - installManyTop(deps.map(function (dep) { - var target = data.dependencies[dep] - return dep + "@" + target - }).concat(peers.map(function (dep) { - var target = data.peerDependencies[dep] - return dep + "@" + target - })), where, context, function(er, results) { - if (er || npm.config.get("production")) return cb(er, results) - lifecycle(data, "prepublish", where, function(er) { - return cb(er, results) - }) - }) +// system packages +var fs = require('fs') +var path = require('path') + +// dependencies +var log = require('npmlog') +var readPackageTree = require('read-package-tree') +var chain = require('slide').chain +var asyncMap = require('slide').asyncMap +var archy = require('archy') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var iferr = require('iferr') +var validate = require('aproba') + +// npm internal utils +var npm = require('./npm.js') +var locker = require('./utils/locker.js') +var lock = locker.lock +var unlock = locker.unlock +var ls = require('./ls.js') +var parseJSON = require('./utils/parse-json.js') + +// install specific libraries +var copyTree = require('./install/copy-tree.js') +var readShrinkwrap = require('./install/read-shrinkwrap.js') +var recalculateMetadata = require('./install/deps.js').recalculateMetadata +var loadDeps = require('./install/deps.js').loadDeps +var loadDevDeps = require('./install/deps.js').loadDevDeps +var getAllMetadata = require('./install/deps.js').getAllMetadata +var loadRequestedDeps = require('./install/deps.js').loadRequestedDeps +var loadExtraneous = require('./install/deps.js').loadExtraneous +var pruneTree = require('./install/prune-tree.js') +var diffTrees = require('./install/diff-trees.js') +var checkPermissions = require('./install/check-permissions.js') +var decomposeActions = require('./install/decompose-actions.js') +var filterInvalidActions = require('./install/filter-invalid-actions.js') +var validateTree = require('./install/validate-tree.js') +var validateArgs = require('./install/validate-args.js') +var saveRequested = require('./install/save.js').saveRequested +var getSaveType = require('./install/save.js').getSaveType +var doSerialActions = require('./install/actions.js').doSerial +var doReverseSerialActions = require('./install/actions.js').doReverseSerial +var doParallelActions = require('./install/actions.js').doParallel +var doOneAction = require('./install/actions.js').doOne +var packageId = require('./utils/package-id.js') +var moduleName = require('./utils/module-name.js') +var errorMessage = require('./utils/error-message.js') + +function unlockCB (lockPath, name, cb) { + validate('SSF', arguments) + return function (installEr) { + var args = arguments + try { + unlock(lockPath, name, reportErrorAndReturn) + } catch (unlockEx) { + process.nextTick(function () { + reportErrorAndReturn(unlockEx) }) } - - // initial "family" is the name:version of the root, if it's got - // a package.json file. - var jsonPath = path.resolve(where, "package.json") - log.verbose('install', 'initial load of', jsonPath) - readJson(jsonPath, log.warn, function (er, data) { - if (er - && er.code !== "ENOENT" - && er.code !== "ENOTDIR") return cb(er) - if (er) data = null - var context = { family: {} - , ancestors: {} - , explicit: true - , parent: data - , root: true - , wrap: null } - if (data && data.name === path.basename(where) && - path.basename(path.dirname(where)) === "node_modules") { - context.family[data.name] = context.ancestors[data.name] = data.version + function reportErrorAndReturn (unlockEr) { + if (installEr) { + if (unlockEr && unlockEr.code !== 'ENOTLOCKED') { + log.warn('unlock' + name, unlockEr) + } + return cb.apply(null, args) } - var fn = npm.config.get("global") ? installMany : installManyTop - fn(args, where, context, cb) - }) - }) -} - -function validateInstall (where, cb) { - var jsonPath = path.resolve(where, 'package.json') - log.verbose('validateInstall', 'loading', jsonPath, 'for validation') - readJson(jsonPath, log.warn, function (er, data) { - if (er - && er.code !== 'ENOENT' - && er.code !== 'ENOTDIR') return cb(er) - - if (data && data.engineStrict) { - warnStrict([ - "Per-package engineStrict (found in this package's package.json) ", - "won't be used in npm 3+. Use the config setting `engine-strict` instead." - ], data.name) + if (unlockEr) return cb(unlockEr) + return cb.apply(null, args) } - - readInstalled(where, { log: log.warn, dev: true }, function (er, data) { - if (er) return cb(er) - - cb(null, findPeerInvalid_(data.dependencies, [])) - }) - }) + } } -function findPeerInvalid_ (packageMap, fpiList) { - if (fpiList.indexOf(packageMap) !== -1) - return undefined - - fpiList.push(packageMap) - - for (var packageName in packageMap) { - var pkg = packageMap[packageName] +function install (where, args, cb) { + if (!cb) { + cb = args + args = where + where = null + } + var globalTop = path.resolve(npm.globalDir, '..') + if (!where) { + where = npm.config.get('global') + ? globalTop + : npm.prefix + } + validate('SAF', [where, args, cb]) + // the /path/to/node_modules/.. + var dryrun = !!npm.config.get('dry-run') - if (pkg.peerInvalid) { - var peersDepending = {} - for (var peerName in packageMap) { - var peer = packageMap[peerName] - if (peer.peerDependencies && peer.peerDependencies[packageName]) { - peersDepending[peer.name + "@" + peer.version] = - peer.peerDependencies[packageName] - } - } - return { name: pkg.name, peersDepending: peersDepending, version: pkg.version, _id: pkg._id } - } + if (npm.config.get('dev')) { + log.warn('install', 'Usage of the `--dev` option is deprecated. Use `--only=dev` instead.') + } - if (pkg.dependencies) { - var invalid = findPeerInvalid_(pkg.dependencies, fpiList) - if (invalid) - return invalid - } + if (where === globalTop && !args.length) { + args = ['.'] } + args = args.filter(function (a) { + return path.resolve(a) !== npm.prefix + }) - return null + new Installer(where, dryrun, args).run(cb) } -// reads dependencies for the package at "where". There are several cases, -// depending on our current state and the package's configuration: -// -// 1. If "context" is specified, then we examine the context to see if there's a -// shrinkwrap there. In that case, dependencies are read from the shrinkwrap. -// 2. Otherwise, if an npm-shrinkwrap.json file is present, dependencies are -// read from there. -// 3. Otherwise, dependencies come from package.json. -// -// Regardless of which case we fall into, "cb" is invoked with a first argument -// describing the full package (as though readJson had been used) but with -// "dependencies" read as described above. The second argument to "cb" is the -// shrinkwrap to use in processing this package's dependencies, which may be -// "wrap" (in case 1) or a new shrinkwrap (in case 2). -function readDependencies (context, where, opts, cb) { - var wrap = context ? context.wrap : null - - var jsonPath = path.resolve(where, 'package.json') - log.verbose('readDependencies', 'loading dependencies from', jsonPath) - readJson(jsonPath, log.warn, function (er, data) { - if (er && er.code === "ENOENT") er.code = "ENOPACKAGEJSON" - if (er) return cb(er) - - if (opts && opts.dev) { - if (!data.dependencies) data.dependencies = {} - Object.keys(data.devDependencies || {}).forEach(function (k) { - if (data.dependencies[k]) { - log.warn("package.json", "Dependency '%s' exists in both dependencies " + - "and devDependencies, using '%s@%s' from dependencies", - k, k, data.dependencies[k]) - } else { - data.dependencies[k] = data.devDependencies[k] - } - }) - } - - if (!npm.config.get("optional") && data.optionalDependencies) { - Object.keys(data.optionalDependencies).forEach(function (d) { - delete data.dependencies[d] - }) +function Installer (where, dryrun, args) { + validate('SBA', arguments) + this.where = where + this.dryrun = dryrun + this.args = args + this.currentTree = null + this.idealTree = null + this.differences = [] + this.todo = [] + this.progress = {} + this.noPackageJsonOk = !!args.length + this.topLevelLifecycles = !args.length + this.npat = npm.config.get('npat') + this.dev = npm.config.get('dev') || (!/^prod(uction)?$/.test(npm.config.get('only')) && !npm.config.get('production')) || /^dev(elopment)?$/.test(npm.config.get('only')) + this.prod = !/^dev(elopment)?$/.test(npm.config.get('only')) + this.rollback = npm.config.get('rollback') + this.link = npm.config.get('link') + this.global = this.where === path.resolve(npm.globalDir, '..') +} +Installer.prototype = {} + +Installer.prototype.run = function (cb) { + validate('F', arguments) + + // FIXME: This is bad and I should feel bad. + // lib/install needs to have some way of sharing _limited_ + // state with the things it calls. Passing the object is too + // much. The global config is WAY too much. =( =( + // But not having this is gonna break linked modules in + // subtle stupid ways, and refactoring all this code isn't + // the right thing to do just yet. + if (this.global) { + var prevGlobal = npm.config.get('global') + npm.config.set('global', true) + var next = cb + cb = function () { + npm.config.set('global', prevGlobal) + next.apply(null, arguments) } + } - // User has opted out of shrinkwraps entirely - if (npm.config.get("shrinkwrap") === false) - return cb(null, data, null) - - if (wrap) { - log.verbose("readDependencies: using existing wrap", [where, wrap]) - var rv = {} - Object.keys(data).forEach(function (key) { - rv[key] = data[key] - }) - rv.dependencies = {} - Object.keys(wrap).forEach(function (key) { - log.verbose("from wrap", [key, wrap[key]]) - rv.dependencies[key] = readWrap(wrap[key]) - }) - log.verbose("readDependencies returned deps", rv.dependencies) - return cb(null, rv, wrap) + var installSteps = [] + var postInstallSteps = [] + installSteps.push( + [this.newTracker(log, 'loadCurrentTree', 4)], + [this, this.loadCurrentTree], + [this, this.finishTracker, 'loadCurrentTree'], + + [this.newTracker(log, 'loadIdealTree', 12)], + [this, this.loadIdealTree], + [this, this.finishTracker, 'loadIdealTree'], + + [this, this.debugTree, 'currentTree', 'currentTree'], + [this, this.debugTree, 'idealTree', 'idealTree'], + + [this.newTracker(log, 'generateActionsToTake')], + [this, this.generateActionsToTake], + [this, this.finishTracker, 'generateActionsToTake'], + + [this, this.debugActions, 'diffTrees', 'differences'], + [this, this.debugActions, 'decomposeActions', 'todo']) + if (!this.dryrun) { + installSteps.push( + [this.newTracker(log, 'executeActions', 8)], + [this, this.executeActions], + [this, this.finishTracker, 'executeActions']) + var node_modules = path.resolve(this.where, 'node_modules') + var staging = path.resolve(node_modules, '.staging') + postInstallSteps.push( + [this.newTracker(log, 'rollbackFailedOptional', 1)], + [this, this.rollbackFailedOptional, staging, this.todo], + [this, this.finishTracker, 'rollbackFailedOptional'], + [this, this.commit, staging, this.todo], + [this.newTracker(log, 'runTopLevelLifecycles', 2)], + [this, this.runTopLevelLifecycles], + [this, this.finishTracker, 'runTopLevelLifecycles']) + + if (getSaveType(this.args)) { + postInstallSteps.push( + [this, this.saveToDependencies]) } - - var wrapfile = path.resolve(where, "npm-shrinkwrap.json") - - fs.readFile(wrapfile, "utf8", function (er, wrapjson) { - if (er) return cb(null, data, null) - - log.verbose("readDependencies", "npm-shrinkwrap.json is overriding dependencies") - var newwrap - try { - newwrap = JSON.parse(wrapjson) - } catch (ex) { - return cb(ex) + } + postInstallSteps.push( + [this, this.printInstalled]) + + var self = this + chain(installSteps, function (installEr) { + if (installEr) self.failing = true + chain(postInstallSteps, function (postInstallEr) { + if (self.idealTree) { + self.idealTree.warnings.forEach(function (warning) { + if (warning.code === 'EPACKAGEJSON' && self.global) return + if (warning.code === 'ENOTDIR') return + errorMessage(warning).summary.forEach(function (logline) { + log.warn.apply(log, logline) + }) + }) } - - log.info("shrinkwrap", "file %j", wrapfile) - var rv = {} - Object.keys(data).forEach(function (key) { - rv[key] = data[key] - }) - rv.dependencies = {} - Object.keys(newwrap.dependencies || {}).forEach(function (key) { - rv.dependencies[key] = readWrap(newwrap.dependencies[key]) - }) - - // fold in devDependencies if not already present, at top level - if (opts && opts.dev) { - Object.keys(data.devDependencies || {}).forEach(function (k) { - rv.dependencies[k] = rv.dependencies[k] || data.devDependencies[k] + if (installEr && postInstallEr) { + var msg = errorMessage(postInstallEr) + msg.summary.forEach(function (logline) { + log.warn.apply(log, logline) + }) + msg.detail.forEach(function (logline) { + log.verbose.apply(log, logline) }) } - - log.verbose("readDependencies returned deps", rv.dependencies) - return cb(null, rv, newwrap.dependencies) + cb(installEr || postInstallEr, self.getInstalledModules(), self.idealTree) }) }) } -function readWrap (w) { - return (w.resolved) ? w.resolved - : (w.from && url.parse(w.from).protocol) ? w.from - : w.version +Installer.prototype.loadArgMetadata = function (next) { + var self = this + getAllMetadata(this.args, this.currentTree, iferr(next, function (args) { + self.args = args + next() + })) } -// if the -S|--save option is specified, then write installed packages -// as dependencies to a package.json file. -function save (where, installed, tree, pretty, hasArguments, cb) { - if (!hasArguments || - !npm.config.get("save") && - !npm.config.get("save-dev") && - !npm.config.get("save-optional") || - npm.config.get("global")) { - return cb(null, installed, tree, pretty) +Installer.prototype.newTracker = function (tracker, name, size) { + validate('OS', [tracker, name]) + if (size) validate('N', [size]) + this.progress[name] = tracker.newGroup(name, size) + var self = this + return function (next) { + self.progress[name].silly(name, 'Starting') + next() } +} - var saveBundle = npm.config.get("save-bundle") - var savePrefix = npm.config.get("save-prefix") - - // each item in the tree is a top-level thing that should be saved - // to the package.json file. - // The relevant tree shape is { : {what:} } - var saveTarget = path.resolve(where, "package.json") +Installer.prototype.finishTracker = function (name, cb) { + validate('SF', arguments) + this.progress[name].silly(name, 'Finishing') + this.progress[name].finish() + cb() +} - asyncMap(Object.keys(tree), function (k, cb) { - // if "from" is remote, git, or hosted, then save that instead. - var t = tree[k] - , f = npa(t.from) - , a = npa(t.what) - , w = [a.name, a.spec] +Installer.prototype.loadCurrentTree = function (cb) { + validate('F', arguments) + log.silly('install', 'loadCurrentTree') + var todo = [] + if (this.global) { + todo.push([this, this.readGlobalPackageData]) + } else { + todo.push([this, this.readLocalPackageData]) + } + todo.push( + [this, this.normalizeTree, log.newGroup('normalizeTree')]) + chain(todo, cb) +} +Installer.prototype.loadIdealTree = function (cb) { + validate('F', arguments) + log.silly('install', 'loadIdealTree') - fs.stat(t.from, function (er){ - if (!er) { - w[1] = "file:" + t.from - } else if (['hosted', 'git', 'remote'].indexOf(f.type) !== -1) { - w[1] = t.from - } - cb(null, [w]) - }) - } - , function (er, arr) { - var things = arr.reduce(function (set, k) { - var rangeDescriptor = semver.valid(k[1], true) && - semver.gte(k[1], "0.1.0", true) && - !npm.config.get("save-exact") - ? savePrefix : "" - set[k[0]] = rangeDescriptor + k[1] - return set - }, {}) - - - // don't use readJson, because we don't want to do all the other - // tricky npm-specific stuff that's in there. - fs.readFile(saveTarget, function (er, data) { - // ignore errors here, just don't save it. - try { - data = JSON.parse(data.toString("utf8")) - } catch (ex) { - er = ex - } + chain([ + [this.newTracker(this.progress.loadIdealTree, 'cloneCurrentTree')], + [this, this.cloneCurrentTreeToIdealTree], + [this, this.finishTracker, 'cloneCurrentTree'], - if (er) { - return cb(null, installed, tree, pretty) - } + [this.newTracker(this.progress.loadIdealTree, 'loadShrinkwrap')], + [this, this.loadShrinkwrap], + [this, this.finishTracker, 'loadShrinkwrap'], - var deps = npm.config.get("save-optional") ? "optionalDependencies" - : npm.config.get("save-dev") ? "devDependencies" - : "dependencies" + [this.newTracker(this.progress.loadIdealTree, 'loadAllDepsIntoIdealTree', 10)], + [this, this.loadAllDepsIntoIdealTree], + [this, this.finishTracker, 'loadAllDepsIntoIdealTree'], - if (saveBundle) { - var bundle = data.bundleDependencies || data.bundledDependencies - delete data.bundledDependencies - if (!Array.isArray(bundle)) bundle = [] - data.bundleDependencies = bundle.sort() - } + [this, function (next) { recalculateMetadata(this.idealTree, log, next) }], + [this, this.debugTree, 'idealTree:prePrune', 'idealTree'], + [this, function (next) { next(pruneTree(this.idealTree)) }] + ], cb) +} - log.verbose("save", "saving", things) - data[deps] = data[deps] || {} - Object.keys(things).forEach(function (t) { - data[deps][t] = things[t] - if (saveBundle) { - var i = bundle.indexOf(t) - if (i === -1) bundle.push(t) - data.bundleDependencies = bundle.sort() - } - }) +Installer.prototype.loadAllDepsIntoIdealTree = function (cb) { + validate('F', arguments) + log.silly('install', 'loadAllDepsIntoIdealTree') + var saveDeps = getSaveType(this.args) + + var cg = this.progress.loadAllDepsIntoIdealTree + var installNewModules = !!this.args.length + var steps = [] + + if (installNewModules) { + steps.push([validateArgs, this.idealTree, this.args]) + steps.push([loadRequestedDeps, this.args, this.idealTree, saveDeps, cg.newGroup('loadRequestedDeps')]) + } else { + if (this.prod) { + steps.push( + [loadDeps, this.idealTree, cg.newGroup('loadDeps')]) + } + if (this.dev) { + steps.push( + [loadDevDeps, this.idealTree, cg.newGroup('loadDevDeps')]) + } + } + steps.push( + [loadExtraneous.andResolveDeps, this.idealTree, cg.newGroup('loadExtraneous')]) + chain(steps, cb) +} - data[deps] = sortedObject(data[deps]) +Installer.prototype.generateActionsToTake = function (cb) { + validate('F', arguments) + log.silly('install', 'generateActionsToTake') + var cg = this.progress.generateActionsToTake + chain([ + [validateTree, this.idealTree, cg.newGroup('validateTree')], + [diffTrees, this.currentTree, this.idealTree, this.differences, cg.newGroup('diffTrees')], + [this, this.computeLinked], + [filterInvalidActions, this.where, this.differences], + [checkPermissions, this.differences], + [decomposeActions, this.differences, this.todo] + ], cb) +} - log.silly("save", "writing", saveTarget) - data = JSON.stringify(data, null, 2) + "\n" - writeFileAtomic(saveTarget, data, function (er) { - cb(er, installed, tree, pretty) - }) +Installer.prototype.computeLinked = function (cb) { + validate('F', arguments) + if (!this.link || this.global) return cb() + var linkTodoList = [] + var self = this + asyncMap(this.differences, function (action, next) { + var cmd = action[0] + var pkg = action[1] + if (cmd !== 'add' && cmd !== 'update') return next() + var isReqByTop = pkg.package._requiredBy.filter(function (name) { return name === '/' }).length + var isReqByUser = pkg.package._requiredBy.filter(function (name) { return name === '#USER' }).length + var isExtraneous = pkg.package._requiredBy.length === 0 + if (!isReqByTop && !isReqByUser && !isExtraneous) return next() + isLinkable(pkg, function (install, link) { + if (install) linkTodoList.push(['global-install', pkg]) + if (link) linkTodoList.push(['global-link', pkg]) + if (install || link) { + pkg.parent.children = pkg.parent.children.filter(function (child) { return child !== pkg }) + } + next() }) + }, function () { + if (linkTodoList.length === 0) return cb() + pruneTree(self.idealTree) + self.differences.length = 0 + Array.prototype.push.apply(self.differences, linkTodoList) + diffTrees(self.currentTree, self.idealTree, self.differences, log.newGroup('d2'), cb) }) } - -// Outputting *all* the installed modules is a bit confusing, -// because the length of the path does not make it clear -// that the submodules are not immediately require()able. -// TODO: Show the complete tree, ls-style, but only if --long is provided -function prettify (tree, installed) { - function red (set, kv) { - set[kv[0]] = kv[1] - return set - } - - if (npm.config.get("json")) { - tree = Object.keys(tree).map(function (p) { - if (!tree[p]) return null - var what = npa(tree[p].what) - , name = what.name - , version = what.spec - , o = { name: name, version: version, from: tree[p].from } - o.dependencies = tree[p].children.map(function P (dep) { - var what = npa(dep.what) - , name = what.name - , version = what.spec - , o = { version: version, from: dep.from } - o.dependencies = dep.children.map(P).reduce(red, {}) - return [name, o] - }).reduce(red, {}) - return o +function isLinkable (pkg, cb) { + var globalPackage = path.resolve(npm.globalPrefix, 'lib', 'node_modules', moduleName(pkg)) + var globalPackageJson = path.resolve(globalPackage, 'package.json') + fs.stat(globalPackage, function (er) { + if (er) return cb(true, true) + fs.readFile(globalPackageJson, function (er, data) { + var json = parseJSON.noExceptions(data) + cb(false, json && json.version === pkg.package.version) }) - - return JSON.stringify(tree, null, 2) - } - if (npm.config.get("parseable")) return parseable(installed) - - return Object.keys(tree).map(function (p) { - return archy({ label: tree[p].what + " " + p - , nodes: (tree[p].children || []).map(function P (c) { - if (npm.config.get("long")) { - return { label: c.what, nodes: c.children.map(P) } - } - var g = c.children.map(function (g) { - return g.what - }).join(", ") - if (g) g = " (" + g + ")" - return c.what + g - }) - }, "", { unicode: npm.config.get("unicode") }) - }).join("\n") + }) } -function parseable (installed) { - var long = npm.config.get("long") - , cwd = process.cwd() - return installed.map(function (item) { - return path.resolve(cwd, item[1]) + - ( long ? ":" + item[0] : "" ) - }).join("\n") -} +Installer.prototype.executeActions = function (cb) { + validate('F', arguments) + log.silly('install', 'executeActions') + var todo = this.todo + var cg = this.progress.executeActions + + var node_modules = path.resolve(this.where, 'node_modules') + var staging = path.resolve(node_modules, '.staging') + var steps = [] + var trackLifecycle = cg.newGroup('lifecycle') + + cb = unlockCB(node_modules, '.staging', cb) + + steps.push( + [doSerialActions, 'global-install', staging, todo, trackLifecycle.newGroup('global-install')], + [doParallelActions, 'fetch', staging, todo, cg.newGroup('fetch', 10)], + [lock, node_modules, '.staging'], + [rimraf, staging], + [mkdirp, staging], + [doParallelActions, 'extract', staging, todo, cg.newGroup('extract', 10)], + [doParallelActions, 'preinstall', staging, todo, trackLifecycle.newGroup('preinstall')], + [doReverseSerialActions, 'remove', staging, todo, cg.newGroup('remove')], + [doSerialActions, 'move', staging, todo, cg.newGroup('move')], + [doSerialActions, 'finalize', staging, todo, cg.newGroup('finalize')], + [doSerialActions, 'build', staging, todo, trackLifecycle.newGroup('build')], + [doSerialActions, 'global-link', staging, todo, trackLifecycle.newGroup('global-link')], + [doParallelActions, 'update-linked', staging, todo, trackLifecycle.newGroup('update-linked')], + [doSerialActions, 'install', staging, todo, trackLifecycle.newGroup('install')], + [doSerialActions, 'postinstall', staging, todo, trackLifecycle.newGroup('postinstall')]) + if (this.npat) { + steps.push( + [doParallelActions, 'test', staging, todo, trackLifecycle.newGroup('npat')]) + } -function treeify (installed) { - // each item is [what, where, parent, parentDir] - // If no parent, then report it. - // otherwise, tack it into the parent's children list. - // If the parent isn't a top-level then ignore it. - var whatWhere = installed.reduce(function (l, r) { - var parentDir = r[3] - , parent = r[2] - , where = r[1] - , what = r[0] - , from = r[4] - l[where] = { parentDir: parentDir - , parent: parent - , children: [] - , where: where - , what: what - , from: from } - return l - }, {}) - - // log.warn("install", whatWhere, "whatWhere") - return Object.keys(whatWhere).reduce(function (l, r) { - var ww = whatWhere[r] - //log.warn("r, ww", [r, ww]) - if (!ww.parent) { - l[r] = ww + var self = this + chain(steps, function (er) { + if (!er || self.rollback) { + rimraf(staging, function () { cb(er) }) } else { - var p = whatWhere[ww.parentDir] - if (p) p.children.push(ww) - else l[r] = ww + cb(er) } - return l - }, {}) + }) } +Installer.prototype.rollbackFailedOptional = function (staging, actionsToRun, cb) { + if (!this.rollback) return cb() + var failed = actionsToRun.map(function (action) { + return action[1] + }).filter(function (pkg) { + return pkg.failed && pkg.rollback + }) + asyncMap(failed, function (pkg, next) { + asyncMap(pkg.rollback, function (rollback, done) { + rollback(staging, pkg, done) + }, next) + }, cb) +} -// just like installMany, but also add the existing packages in -// where/node_modules to the family object. -function installManyTop (what, where, context, cb_) { - function cb (er, d) { - if (context.explicit || er) return cb_(er, d) - // since this wasn't an explicit install, let's build the top - // folder, so that `npm install` also runs the lifecycle scripts. - npm.commands.build([where], false, true, function (er) { - return cb_(er, d) +Installer.prototype.commit = function (staging, actionsToRun, cb) { + var toCommit = actionsToRun.map(function (action) { return action[1] }).filter(function (pkg) { return !pkg.failed && pkg.commit }) + asyncMap(toCommit, function (pkg, next) { + asyncMap(pkg.commit, function (commit, done) { + commit(staging, pkg, done) + }, function () { + pkg.commit = [] + next.apply(null, arguments) }) - } - - if (context.explicit) return next() + }, cb) +} - var jsonPath = path.join(where, 'package.json') - log.verbose('installManyTop', 'reading for lifecycle', jsonPath) - readJson(jsonPath, log.warn, function (er, data) { - if (er) return next(er) - lifecycle(data, "preinstall", where, next) - }) +Installer.prototype.runTopLevelLifecycles = function (cb) { + validate('F', arguments) + if (this.failing) return cb() + log.silly('install', 'runTopLevelLifecycles') + var steps = [] + var trackLifecycle = this.progress.runTopLevelLifecycles + if (!this.topLevelLifecycles) { + trackLifecycle.finish() + return cb() + } - function next (er) { - if (er) return cb(er) - installManyTop_(what, where, context, cb) + steps.push( + [doOneAction, 'preinstall', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('preinstall:.')], + [doOneAction, 'build', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('build:.')], + [doOneAction, 'install', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('install:.')], + [doOneAction, 'postinstall', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('postinstall:.')]) + if (this.npat) { + steps.push( + [doOneAction, 'test', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('npat:.')]) } + if (this.dev) { + steps.push( + [doOneAction, 'prepublish', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('prepublish')]) + } + chain(steps, cb) } -function installManyTop_ (what, where, context, cb) { - var nm = path.resolve(where, "node_modules") - - fs.readdir(nm, function (er, pkgs) { - if (er) return installMany(what, where, context, cb) - - var scopes = [], unscoped = [] - pkgs.filter(function (p) { - return !p.match(/^[\._-]/) - }).forEach(function (p) { - // @names deserve deeper investigation - if (p[0] === "@") { - scopes.push(p) - } - else { - unscoped.push(p) - } - }) - - maybeScoped(scopes, nm, function (er, scoped) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) - // recombine unscoped with @scope/package packages - asyncMap(unscoped.concat(scoped).map(function (p) { - return path.resolve(nm, p, "package.json") - }), function (jsonPath, cb) { - log.verbose('installManyTop', 'reading scoped package data from', jsonPath) - readJson(jsonPath, log.info, function (er, data) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) - if (er) return cb(null, []) - cb(null, [[data.name, data.version]]) - }) - }, function (er, packages) { - // if there's nothing in node_modules, then don't freak out. - if (er) packages = [] - // add all the existing packages to the family list. - // however, do not add to the ancestors list. - packages.forEach(function (p) { - context.family[p[0]] = p[1] - }) - installMany(what, where, context, cb) - }) - }) - }) +Installer.prototype.saveToDependencies = function (cb) { + validate('F', arguments) + if (this.failing) return cb() + log.silly('install', 'saveToDependencies') + saveRequested(this.args, this.idealTree, cb) } -function maybeScoped (scopes, where, cb) { - // find packages in scopes - asyncMap(scopes, function (scope, cb) { - fs.readdir(path.resolve(where, scope), function (er, scoped) { - if (er) return cb(er) - var paths = scoped.map(function (p) { - return path.join(scope, p) +Installer.prototype.readGlobalPackageData = function (cb) { + validate('F', arguments) + log.silly('install', 'readGlobalPackageData') + var self = this + this.loadArgMetadata(iferr(cb, function () { + mkdirp(self.where, iferr(cb, function () { + var pkgs = {} + self.args.forEach(function (pkg) { + pkgs[pkg.name] = true }) - cb(null, paths) - }) - }, cb) + readPackageTree(self.where, function (ctx, kid) { return ctx.parent || pkgs[kid] }, iferr(cb, function (currentTree) { + self.currentTree = currentTree + return cb() + })) + })) + })) } -function installMany (what, where, context, cb) { - // readDependencies takes care of figuring out whether the list of - // dependencies we'll iterate below comes from an existing shrinkwrap from a - // parent level, a new shrinkwrap at this level, or package.json at this - // level, as well as which shrinkwrap (if any) our dependencies should use. - var opt = { dev: npm.config.get("dev") } - readDependencies(context, where, opt, function (er, data, wrap) { - if (er) data = {} - - var parent = data - - // if we're explicitly installing "what" into "where", then the shrinkwrap - // for "where" doesn't apply. This would be the case if someone were adding - // a new package to a shrinkwrapped package. (data.dependencies will not be - // used here except to indicate what packages are already present, so - // there's no harm in using that.) - if (context.explicit) wrap = null - - var deps = data.dependencies || {} - var devDeps = data.devDependencies || {} - - // what is a list of things. - // resolve each one. - asyncMap( what - , targetResolver(where, context, deps, devDeps) - , function (er, targets) { - - if (er) return cb(er) - - var bundled = data.bundleDependencies || data.bundledDependencies || [] - // only take the hit for readInstalled if there are probably bundled - // dependencies to read - if (bundled.length) { - readInstalled(where, { dev: true }, andBuildResolvedTree) - } else { - andBuildResolvedTree() +Installer.prototype.readLocalPackageData = function (cb) { + validate('F', arguments) + log.silly('install', 'readLocalPackageData') + var self = this + mkdirp(this.where, iferr(cb, function () { + readPackageTree(self.where, iferr(cb, function (currentTree) { + self.currentTree = currentTree + self.currentTree.warnings = [] + if (!self.noPackageJsonOk && !currentTree.package) { + log.error('install', "Couldn't read dependencies") + var er = new Error("ENOENT, open '" + path.join(self.where, 'package.json') + "'") + er.code = 'ENOPACKAGEJSON' + er.errno = 34 + return cb(er) } - - function andBuildResolvedTree (er, current) { - if (er) return cb(er) - - // each target will be a data object corresponding - // to a package, folder, or whatever that is in the cache now. - var newPrev = Object.create(context.family) - , newAnc = Object.create(context.ancestors) - - if (!context.root) { - newAnc[data.name] = data.version - } - bundled.forEach(function (bundle) { - var bundleData = current.dependencies[bundle] - if ((!bundleData || !bundleData.version) && current.devDependencies) { - log.verbose( - 'installMany', bundle, 'was bundled with', - data.name + '@' + data.version + - ", but wasn't found in dependencies. Trying devDependencies" - ) - bundleData = current.devDependencies[bundle] - } - - if (!bundleData || !bundleData.version) { - log.warn( - 'installMany', bundle, 'was bundled with', - data.name + '@' + data.version + - ", but bundled package wasn't found in unpacked tree" - ) - } else { - log.verbose( - 'installMany', bundle + '@' + bundleData.version, - 'was bundled with', data.name + '@' + data.version - ) - newPrev[bundle] = bundleData.version + if (!currentTree.package) currentTree.package = {} + self.loadArgMetadata(iferr(cb, function () { + if (currentTree.package._shrinkwrap) return cb() + fs.readFile(path.join(self.where, 'npm-shrinkwrap.json'), function (er, data) { + if (er) return cb() + try { + currentTree.package._shrinkwrap = parseJSON(data) + } catch (ex) { + return cb(ex) } + return cb() }) - targets.forEach(function (t) { - newPrev[t.name] = t.version - }) - log.silly("install resolved", targets) - targets.filter(function (t) { return t }).forEach(function (t) { - log.info("install", "%s into %s", t._id, where) - }) - asyncMap(targets, function (target, cb) { - log.info("installOne", target._id) - var wrapData = wrap ? wrap[target.name] : null - var newWrap = wrapData && wrapData.dependencies - ? wrap[target.name].dependencies || {} - : null - var newContext = { family: newPrev - , ancestors: newAnc - , parent: parent - , explicit: false - , wrap: newWrap } - installOne(target, where, newContext, cb) - }, cb) - } - }) - }) + })) + })) + })) } -function targetResolver (where, context, deps, devDeps) { - var alreadyInstalledManually = [] - , resolveLeft = 0 - , nm = path.resolve(where, "node_modules") - , parent = context.parent - , wrap = context.wrap - - if (!context.explicit) readdir(nm) - - function readdir(name) { - resolveLeft++ - fs.readdir(name, function (er, inst) { - if (er) return resolveLeft-- - - // don't even mess with non-package looking things - inst = inst.filter(function (p) { - if (!p.match(/^[@\._-]/)) return true - // scoped packages - readdir(path.join(name, p)) - }) - - asyncMap(inst, function (pkg, cb) { - var jsonPath = path.resolve(name, pkg, 'package.json') - log.verbose('targetResolver', 'reading package data from', jsonPath) - readJson(jsonPath, log.info, function (er, d) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) - // error means it's not a package, most likely. - if (er) return cb(null, []) - - // if it's a bundled dep, then assume that anything there is valid. - // otherwise, make sure that it's a semver match with what we want. - var bd = parent.bundleDependencies - var isBundled = bd && bd.indexOf(d.name) !== -1 - var expectedVersion = deps[d.name] || (devDeps && devDeps[d.name]) || "*" - var currentIsSatisfactory = semver.satisfies(d.version, expectedVersion, true) - if (isBundled || currentIsSatisfactory || deps[d.name] === d._resolved) { - return cb(null, d.name) - } - - // see if the package had been previously linked - fs.lstat(path.resolve(nm, pkg), function(err, s) { - if (err) return cb(null, []) - if (s.isSymbolicLink()) { - return cb(null, d.name) - } +Installer.prototype.cloneCurrentTreeToIdealTree = function (cb) { + validate('F', arguments) + log.silly('install', 'cloneCurrentTreeToIdealTree') + this.idealTree = copyTree(this.currentTree) + this.idealTree.warnings = [] + cb() +} - // something is there, but it's not satisfactory. Clobber it. - return cb(null, []) - }) - }) - }, function (er, inst) { - // this is the list of things that are valid and should be ignored. - alreadyInstalledManually = alreadyInstalledManually.concat(inst) - resolveLeft-- - }) - }) +Installer.prototype.loadShrinkwrap = function (cb) { + validate('F', arguments) + log.silly('install', 'loadShrinkwrap') + var installNewModules = !!this.args.length + if (installNewModules) { + readShrinkwrap(this.idealTree, cb) + } else { + readShrinkwrap.andInflate(this.idealTree, cb) } +} - var to = 0 - return function resolver (what, cb) { - if (resolveLeft) return setTimeout(function () { - resolver(what, cb) - }, to++) - - // now we know what's been installed here manually, - // or tampered with in some way that npm doesn't want to overwrite. - if (alreadyInstalledManually.indexOf(npa(what).name) !== -1) { - log.verbose("already installed", "skipping %s %s", what, where) - return cb(null, []) - } - - // check for a version installed higher in the tree. - // If installing from a shrinkwrap, it must match exactly. - if (context.family[what]) { - log.verbose('install', what, 'is installed as', context.family[what]) - if (wrap && wrap[what].version === context.family[what]) { - log.verbose("shrinkwrap", "use existing", what) - return cb(null, []) - } - } - - // if it's identical to its parent, then it's probably someone - // doing `npm install foo` inside of the foo project. Print - // a warning, and skip it. - if (parent && parent.name === what && !npm.config.get("force")) { - log.warn("install", "Refusing to install %s as a dependency of itself" - , what) - return cb(null, []) - } - - if (wrap) { - var name = npa(what).name - if (wrap[name]) { - var wrapTarget = readWrap(wrap[name]) - what = name + "@" + wrapTarget - } else { - log.verbose("shrinkwrap", "skipping %s (not in shrinkwrap)", what) - } - } else if (deps[what]) { - what = what + "@" + deps[what] - } - - // This is where we actually fetch the package, if it's not already - // in the cache. - // If it's a git repo, then we want to install it, even if the parent - // already has a matching copy. - // If it's not a git repo, and the parent already has that pkg, then - // we can skip installing it again. - var pkgroot = path.resolve(npm.prefix, (parent && parent._from) || "") - cache.add(what, null, pkgroot, false, function (er, data) { - if (er && parent && parent.optionalDependencies && - parent.optionalDependencies.hasOwnProperty(npa(what).name)) { - log.warn("optional dep failed, continuing", what) - log.verbose("optional dep failed, continuing", [what, er]) - return cb(null, []) - } - - var type = npa(what).type - var isGit = type === "git" || type === "hosted" - - if (!er && - data && - !context.explicit && - context.family[data.name] === data.version && - !npm.config.get("force") && - !isGit) { - log.info("already installed", data.name + "@" + data.version) - return cb(null, []) +Installer.prototype.normalizeTree = function (log, cb) { + validate('OF', arguments) + log.silly('install', 'normalizeTree') + recalculateMetadata(this.currentTree, log, iferr(cb, function (tree) { + tree.children.forEach(function (child) { + if (child.package._requiredBy.length === 0) { + child.package._requiredBy.push('#EXISTING') } - - - if (data && !data._from) data._from = what - if (er && parent && parent.name) er.parent = parent.name - return cb(er, data || []) }) - } + cb(null, tree) + })) } -// we've already decided to install this. if anything's in the way, -// then uninstall it first. -function installOne (target, where, context, cb) { - // the --link flag makes this a "link" command if it's at the - // the top level. - var isGit = false - var type = npa(target._from).type - if (target && target._from) isGit = type === 'git' || type === 'hosted' - - if (where === npm.prefix && npm.config.get("link") - && !npm.config.get("global") && !isGit) { - return localLink(target, where, context, cb) - } - installOne_(target, where, context, function (er, installedWhat) { - - // check if this one is optional to its parent. - if (er && context.parent && context.parent.optionalDependencies && - context.parent.optionalDependencies.hasOwnProperty(target.name)) { - log.warn("optional dep failed, continuing", target._id) - log.verbose("optional dep failed, continuing", [target._id, er]) - er = null - } - - cb(er, installedWhat) +Installer.prototype.getInstalledModules = function () { + return this.differences.filter(function (action) { + var mutation = action[0] + return (mutation === 'add' || mutation === 'update') + }).map(function (action) { + var child = action[1] + return [child.package._id, child.path] }) - } -function localLink (target, where, context, cb) { - log.verbose("localLink", target._id) - var jsonPath = path.resolve(npm.globalDir, target.name , 'package.json') - var parent = context.parent - - log.verbose('localLink', 'reading data to link', target.name, 'from', jsonPath) - readJson(jsonPath, log.warn, function (er, data) { - function thenLink () { - npm.commands.link([target.name], function (er, d) { - log.silly("localLink", "back from link", [er, d]) - cb(er, [resultList(target, where, parent && parent._id)]) - }) - } - - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) - if (er || data._id === target._id) { - if (er) { - install( path.resolve(npm.globalDir, "..") - , target._id - , function (er) { - if (er) return cb(er, []) - thenLink() - }) - } else thenLink() - } else { - log.verbose("localLink", "install locally (no link)", target._id) - installOne_(target, where, context, cb) +Installer.prototype.printInstalled = function (cb) { + validate('F', arguments) + log.silly('install', 'printInstalled') + var self = this + log.clearProgress() + this.differences.forEach(function (action) { + var mutation = action[0] + var child = action[1] + var name = packageId(child) + var where = path.relative(self.where, child.path) + if (mutation === 'remove') { + console.log('- ' + name + ' ' + where) + } else if (mutation === 'move') { + var oldWhere = path.relative(self.where, child.fromPath) + console.log(name + ' ' + oldWhere + ' -> ' + where) } }) -} - -function resultList (target, where, parentId) { - var nm = path.resolve(where, "node_modules") - , targetFolder = path.resolve(nm, target.name) - , prettyWhere = where - - if (!npm.config.get("global")) { - prettyWhere = path.relative(process.cwd(), where) - } - - if (prettyWhere === ".") prettyWhere = null - - if (!npm.config.get("global")) { - // print out the folder relative to where we are right now. - targetFolder = path.relative(process.cwd(), targetFolder) - } - - return [ target._id - , targetFolder - , prettyWhere && parentId - , parentId && prettyWhere - , target._from ] -} - -var installed = Object.create(null) - -function installOne_ (target, where, context, cb_) { - var nm = path.resolve(where, "node_modules") - , targetFolder = path.resolve(nm, target.name) - , prettyWhere = path.relative(process.cwd(), where) - , parent = context.parent - - if (prettyWhere === ".") prettyWhere = null - - cb_ = inflight(target.name + ":" + where, cb_) - if (!cb_) { - return log.verbose("installOne", "of", target.name, "to", where, "already in flight; waiting") - } - else { - log.verbose("installOne", "of", target.name, "to", where, "not in flight; installing") - } - - function cb(er, data) { - unlock(nm, target.name, function () { cb_(er, data) }) - } - - lock(nm, target.name, function (er) { - if (er) return cb(er) - - if (targetFolder in installed) { - log.error("install", "trying to install", target.version, "to", targetFolder) - log.error("install", "but already installed versions", installed[targetFolder]) - installed[targetFolder].push(target.version) - } - else { - installed[targetFolder] = [target.version] - } - - var force = npm.config.get("force") - , nodeVersion = npm.config.get("node-version") - , strict = npm.config.get("engine-strict") - , c = npmInstallChecks - - chain( - [ [c.checkEngine, target, npm.version, nodeVersion, force, strict] - , [c.checkPlatform, target, force] - , [c.checkCycle, target, context.ancestors] - , [c.checkGit, targetFolder] - , [write, target, targetFolder, context] ] - , function (er, d) { - if (er) return cb(er) - - d.push(resultList(target, where, parent && parent._id)) - cb(er, d) - } - ) + var addedOrMoved = this.differences.filter(function (action) { + var mutation = action[0] + var child = action[1] + return !child.failed && (mutation === 'add' || mutation === 'update') + }).map(function (action) { + var child = action[1] + return child.path }) -} - -function write (target, targetFolder, context, cb_) { - var up = npm.config.get("unsafe-perm") - , user = up ? null : npm.config.get("user") - , group = up ? null : npm.config.get("group") - , family = context.family - - function cb (er, data) { - // cache.unpack returns the data object, and all we care about - // is the list of installed packages from that last thing. - if (!er) return cb_(er, data) - - if (npm.config.get("rollback") === false) return cb_(er) - npm.rollbacks.push(targetFolder) - cb_(er, data) - } - - var bundled = [] - - log.silly("install write", "writing", target.name, target.version, "to", targetFolder) - chain( - [ [ cache.unpack, target.name, target.version, targetFolder, null, null, user, group ], - function writePackageJSON (cb) { - var jsonPath = path.resolve(targetFolder, 'package.json') - log.verbose('write', 'writing to', jsonPath) - writeFileAtomic(jsonPath, JSON.stringify(target, null, 2) + '\n', cb) - }, - [ lifecycle, target, "preinstall", targetFolder ], - function collectBundled (cb) { - if (!target.bundleDependencies) return cb() - - var bd = path.resolve(targetFolder, "node_modules") - fs.readdir(bd, function (er, b) { - // nothing bundled, maybe - if (er) return cb() - bundled = b || [] - cb() - }) - } ] - - // nest the chain so that we can throw away the results returned - // up until this point, since we really don't care about it. - , function X (er) { - if (er) return cb(er) - - // before continuing to installing dependencies, check for a shrinkwrap. - var opt = { dev: npm.config.get("dev") } - readDependencies(context, targetFolder, opt, function (er, data, wrap) { - if (er) return cb(er); - var deps = prepareForInstallMany(data, "dependencies", bundled, wrap, - family) - var depsTargetFolder = targetFolder - var depsContext = { family: family - , ancestors: context.ancestors - , parent: target - , explicit: false - , wrap: wrap } - - var actions = - [ [ installManyAndBuild, deps, depsTargetFolder, depsContext ] ] - - // FIXME: This is an accident waiting to happen! - // - // 1. If multiple children at the same level of the tree share a - // peerDependency that's not in the parent's dependencies, because - // the peerDeps don't get added to the family, they will keep - // getting reinstalled (worked around by inflighting installOne). - // 2. The installer can't safely build at the parent level because - // that's already being done by the parent's installAndBuild. This - // runs the risk of the peerDependency never getting built. - // - // The fix: Don't install peerDependencies; require them to be - // included as explicit dependencies / devDependencies, and warn - // or error when they're missing. See #5080 for more arguments in - // favor of killing implicit peerDependency installs with fire. - var peerDeps = prepareForInstallMany(data, "peerDependencies", bundled, - wrap, family) - peerDeps.forEach(function (pd) { - warnPeers([ - "The peer dependency "+pd+" included from "+data.name+" will no", - "longer be automatically installed to fulfill the peerDependency ", - "in npm 3+. Your application will need to depend on it explicitly." - ], pd+","+data.name) - }) - - // Package scopes cause an addditional tree level which needs to be - // considered when resolving a peerDependency's target folder. - var pdTargetFolder - if (npa(target.name).scope) { - pdTargetFolder = path.resolve(targetFolder, '../../..') - } else { - pdTargetFolder = path.resolve(targetFolder, '../..') - } - - var pdContext = context - if (peerDeps.length > 0) { - actions.push( - [ installMany, peerDeps, pdTargetFolder, pdContext ] - ) - } - - chain(actions, cb) - }) + log.showProgress() + if (!addedOrMoved.length) return cb() + recalculateMetadata(this.idealTree, log, iferr(cb, function (tree) { + log.clearProgress() + // These options control both how installs happen AND how `ls` shows output. + // Something like `npm install --production` only installs production deps. + // By contrast `npm install --production foo` installs `foo` and the + // `production` option is ignored. But when it comes time for `ls` to show + // its output, it excludes the thing we just installed because that flag. + // The summary output we get should be unfiltered, showing everything + // installed, so we clear these options before calling `ls`. + npm.config.set('production', false) + npm.config.set('dev', false) + npm.config.set('only', '') + npm.config.set('also', '') + ls.fromTree(self.where, tree, addedOrMoved, false, function () { + log.showProgress() + cb() }) + })) } -function installManyAndBuild (deps, targetFolder, context, cb) { - installMany(deps, targetFolder, context, function (er, d) { - log.verbose("about to build", targetFolder) - if (er) return cb(er) - npm.commands.build( [targetFolder] - , npm.config.get("global") - , true - , function (er) { return cb(er, d) }) +Installer.prototype.debugActions = function (name, actionListName, cb) { + validate('SSF', arguments) + var actionsToLog = this[actionListName] + log.silly(name, 'action count', actionsToLog.length) + actionsToLog.forEach(function (action) { + log.silly(name, action.map(function (value) { + return (value && value.package) ? packageId(value) : value + }).join(' ')) }) + cb() } -function prepareForInstallMany (packageData, depsKey, bundled, wrap, family) { - var deps = Object.keys(packageData[depsKey] || {}) +// This takes an object and a property name instead of a value to allow us +// to define the arguments for use by chain before the property exists yet. +Installer.prototype.debugTree = function (name, treeName, cb) { + validate('SSF', arguments) + log.silly(name, this.prettify(this[treeName]).trim()) + cb() +} - // don't install bundleDependencies, unless they're missing. - if (packageData.bundleDependencies) { - deps = deps.filter(function (d) { - return packageData.bundleDependencies.indexOf(d) === -1 || - bundled.indexOf(d) === -1 - }) +Installer.prototype.prettify = function (tree) { + validate('O', arguments) + var seen = {} + function byName (aa, bb) { + return packageId(aa).localeCompare(packageId(bb)) } - - return deps.filter(function (d) { - // prefer to not install things that are satisfied by - // something in the "family" list, unless we're installing - // from a shrinkwrap. - if (wrap) return wrap - if (semver.validRange(family[d], true)) { - return !semver.satisfies(family[d], packageData[depsKey][d], true) + function expandTree (tree) { + seen[tree.path] = true + return { + label: packageId(tree), + nodes: tree.children.filter(function (tree) { return !seen[tree.path] }).sort(byName).map(expandTree) } - return true - }).map(function (d) { - var v = packageData[depsKey][d] - var t = d + "@" + v - log.silly("prepareForInstallMany", "adding", t, "from", packageData.name, depsKey) - return t - }) + } + return archy(expandTree(tree), '', { unicode: npm.config.get('unicode') }) } diff --git a/deps/npm/lib/install/access-error.js b/deps/npm/lib/install/access-error.js new file mode 100644 index 00000000000000..ff94be98576379 --- /dev/null +++ b/deps/npm/lib/install/access-error.js @@ -0,0 +1,8 @@ +'use strict' +module.exports = function (dir, er) { + if (!er) return + var accessEr = new Error("EACCES, access '" + dir + "'", -13) + accessEr.code = 'EACCES' + accessEr.path = dir + return accessEr +} diff --git a/deps/npm/lib/install/action/build.js b/deps/npm/lib/install/action/build.js new file mode 100644 index 00000000000000..ffb870d6865888 --- /dev/null +++ b/deps/npm/lib/install/action/build.js @@ -0,0 +1,13 @@ +'use strict' +var chain = require('slide').chain +var build = require('../../build.js') +var npm = require('../../npm.js') +var packageId = require('../../utils/package-id.js') + +module.exports = function (top, buildpath, pkg, log, next) { + log.silly('build', packageId(pkg)) + chain([ + [build.linkStuff, pkg.package, pkg.path, npm.config.get('global'), true], + [build.writeBuiltinConf, pkg.package, pkg.path] + ], next) +} diff --git a/deps/npm/lib/install/action/extract.js b/deps/npm/lib/install/action/extract.js new file mode 100644 index 00000000000000..4b627a5c3054fd --- /dev/null +++ b/deps/npm/lib/install/action/extract.js @@ -0,0 +1,84 @@ +'use strict' +var path = require('path') +var iferr = require('iferr') +var asyncMap = require('slide').asyncMap +var fs = require('graceful-fs') +var rename = require('../../utils/rename.js') +var gentlyRm = require('../../utils/gently-rm.js') +var updatePackageJson = require('../update-package-json') +var npm = require('../../npm.js') +var moduleName = require('../../utils/module-name.js') +var packageId = require('../../utils/package-id.js') +var cache = require('../../cache.js') +var buildPath = require('../build-path.js') + +module.exports = function (top, buildpath, pkg, log, next) { + log.silly('extract', packageId(pkg)) + var up = npm.config.get('unsafe-perm') + var user = up ? null : npm.config.get('user') + var group = up ? null : npm.config.get('group') + cache.unpack(pkg.package.name, pkg.package.version, buildpath, null, null, user, group, + andUpdatePackageJson(pkg, buildpath, andStageBundledChildren(pkg, buildpath, log, next))) +} + +function andUpdatePackageJson (pkg, buildpath, next) { + return iferr(next, function () { + updatePackageJson(pkg, buildpath, next) + }) +} + +function andStageBundledChildren (pkg, buildpath, log, next) { + var staging = path.resolve(buildpath, '..') + return iferr(next, function () { + asyncMap(pkg.children, andStageBundledModule(pkg, staging, buildpath), cleanupBundled) + }) + function cleanupBundled () { + gentlyRm(path.join(buildpath, 'node_modules'), next) + } +} + +function andStageBundledModule (bundler, staging, parentPath) { + return function (child, next) { + stageBundledModule(bundler, child, staging, parentPath, next) + } +} + +function getTree (pkg) { + while (pkg.parent) pkg = pkg.parent + return pkg +} + +function warn (pkg, code, msg) { + var tree = getTree(pkg) + var err = new Error(msg) + err.code = code + tree.warnings.push(err) +} + +function stageBundledModule (bundler, child, staging, parentPath, next) { + var stageFrom = path.join(parentPath, 'node_modules', child.package.name) + var stageTo = buildPath(staging, child) + + asyncMap(child.children, andStageBundledModule(bundler, staging, stageFrom), iferr(next, moveModule)) + + function moveModule () { + if (child.fromBundle) { + return rename(stageFrom, stageTo, iferr(next, updateMovedPackageJson)) + } else { + return fs.stat(stageFrom, function (notExists, exists) { + if (exists) { + warn(bundler, 'EBUNDLEOVERRIDE', 'In ' + packageId(bundler) + + ' replacing bundled version of ' + moduleName(child) + + ' with ' + packageId(child)) + return gentlyRm(stageFrom, next) + } else { + return next() + } + }) + } + } + + function updateMovedPackageJson () { + updatePackageJson(child, stageTo, next) + } +} diff --git a/deps/npm/lib/install/action/fetch.js b/deps/npm/lib/install/action/fetch.js new file mode 100644 index 00000000000000..a706b1967b172d --- /dev/null +++ b/deps/npm/lib/install/action/fetch.js @@ -0,0 +1,29 @@ +'use strict' +// var cache = require('../../cache.js') +// var packageId = require('../../utils/package-id.js') +// var moduleName = require('../../utils/module-name.js') + +module.exports = function (top, buildpath, pkg, log, next) { + next() +/* +// FIXME: Unnecessary as long as we have to have the tarball to resolve all deps, which +// is progressively seeming to be likely for the indefinite future. +// ALSO fails for local deps specified with relative URLs outside of the top level. + + var name = moduleName(pkg) + var version + switch (pkg.package._requested.type) { + case 'version': + case 'range': + version = pkg.package.version + break + case 'hosted': + name = name + '@' + pkg.package._requested.spec + break + default: + name = pkg.package._requested.raw + } + log.silly('fetch', packageId(pkg)) + cache.add(name, version, top, false, next) +*/ +} diff --git a/deps/npm/lib/install/action/finalize.js b/deps/npm/lib/install/action/finalize.js new file mode 100644 index 00000000000000..ad278df20f5979 --- /dev/null +++ b/deps/npm/lib/install/action/finalize.js @@ -0,0 +1,92 @@ +'use strict' +var path = require('path') +var rimraf = require('rimraf') +var fs = require('graceful-fs') +var mkdirp = require('mkdirp') +var asyncMap = require('slide').asyncMap +var rename = require('../../utils/rename.js') + +module.exports = function (top, buildpath, pkg, log, next) { + log.silly('finalize', pkg.path) + + var delpath = path.join(path.dirname(pkg.path), '.' + path.basename(pkg.path) + '.DELETE') + + mkdirp(path.resolve(pkg.path, '..'), whenParentExists) + + function whenParentExists (mkdirEr) { + if (mkdirEr) return next(mkdirEr) + // We stat first, because we can't rely on ENOTEMPTY from Windows. + // Windows, by contrast, gives the generic EPERM of a folder already exists. + fs.lstat(pkg.path, destStatted) + } + + function destStatted (doesNotExist) { + if (doesNotExist) { + rename(buildpath, pkg.path, whenMoved) + } else { + moveAway() + } + } + + function whenMoved (renameEr) { + if (!renameEr) return next() + if (renameEr.code !== 'ENOTEMPTY') return next(renameEr) + moveAway() + } + + function moveAway () { + rename(pkg.path, delpath, whenOldMovedAway) + } + + function whenOldMovedAway (renameEr) { + if (renameEr) return next(renameEr) + rename(buildpath, pkg.path, whenConflictMoved) + } + + function whenConflictMoved (renameEr) { + // if we got an error we'll try to put back the original module back, + // succeed or fail though we want the original error that caused this + if (renameEr) return rename(delpath, pkg.path, function () { next(renameEr) }) + fs.readdir(path.join(delpath, 'node_modules'), makeTarget) + } + + function makeTarget (readdirEr, files) { + if (readdirEr) return cleanup() + if (!files.length) return cleanup() + mkdirp(path.join(pkg.path, 'node_modules'), function (mkdirEr) { moveModules(mkdirEr, files) }) + } + + function moveModules (mkdirEr, files) { + if (mkdirEr) return next(mkdirEr) + asyncMap(files, function (file, done) { + var from = path.join(delpath, 'node_modules', file) + var to = path.join(pkg.path, 'node_modules', file) + rename(from, to, done) + }, cleanup) + } + + function cleanup (moveEr) { + if (moveEr) return next(moveEr) + rimraf(delpath, afterCleanup) + } + + function afterCleanup (rimrafEr) { + if (rimrafEr) log.warn('finalize', rimrafEr) + next() + } +} + +module.exports.rollback = function (buildpath, pkg, next) { + var top = path.resolve(buildpath, '..') + rimraf(pkg.path, function () { + removeEmptyParents(pkg.path) + }) + function removeEmptyParents (pkgdir) { + if (path.relative(top, pkgdir)[0] === '.') return next() + fs.rmdir(pkgdir, function (er) { + // FIXME: Make sure windows does what we want here + if (er && er.code !== 'ENOENT') return next() + removeEmptyParents(path.resolve(pkgdir, '..')) + }) + } +} diff --git a/deps/npm/lib/install/action/global-install.js b/deps/npm/lib/install/action/global-install.js new file mode 100644 index 00000000000000..a2aa59402568c5 --- /dev/null +++ b/deps/npm/lib/install/action/global-install.js @@ -0,0 +1,17 @@ +'use strict' +var path = require('path') +var npm = require('../../npm.js') +var Installer = require('../../install.js').Installer +var packageId = require('../../utils/package-id.js') + +module.exports = function (top, buildpath, pkg, log, next) { + log.silly('global-install', packageId(pkg)) + var globalRoot = path.resolve(npm.globalDir, '..') + npm.config.set('global', true) + var install = new Installer(globalRoot, false, [pkg.package.name + '@' + pkg.package._requested.spec]) + install.link = false + install.run(function () { + npm.config.set('global', false) + next.apply(null, arguments) + }) +} diff --git a/deps/npm/lib/install/action/global-link.js b/deps/npm/lib/install/action/global-link.js new file mode 100644 index 00000000000000..daad48e97425ef --- /dev/null +++ b/deps/npm/lib/install/action/global-link.js @@ -0,0 +1,8 @@ +'use strict' +var npm = require('../../npm.js') +var packageId = require('../../utils/package-id.js') + +module.exports = function (top, buildpath, pkg, log, next) { + log.silly('global-link', packageId(pkg)) + npm.link(pkg.package.name, next) +} diff --git a/deps/npm/lib/install/action/install.js b/deps/npm/lib/install/action/install.js new file mode 100644 index 00000000000000..f7b3295534c8b0 --- /dev/null +++ b/deps/npm/lib/install/action/install.js @@ -0,0 +1,8 @@ +'use strict' +var lifecycle = require('../../utils/lifecycle.js') +var packageId = require('../../utils/package-id.js') + +module.exports = function (top, buildpath, pkg, log, next) { + log.silly('install', packageId(pkg), buildpath) + lifecycle(pkg.package, 'install', pkg.path, false, false, next) +} diff --git a/deps/npm/lib/install/action/move.js b/deps/npm/lib/install/action/move.js new file mode 100644 index 00000000000000..ee6bdb95257713 --- /dev/null +++ b/deps/npm/lib/install/action/move.js @@ -0,0 +1,98 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') +var chain = require('slide').chain +var iferr = require('iferr') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var rmStuff = require('../../unbuild.js').rmStuff +var lifecycle = require('../../utils/lifecycle.js') +var updatePackageJson = require('../update-package-json.js') +var rename = require('../../utils/rename.js') + +/* + Move a module from one point in the node_modules tree to another. + Do not disturb either the source or target location's node_modules + folders. +*/ + +module.exports = function (top, buildpath, pkg, log, next) { + log.silly('move', pkg.fromPath, pkg.path) + chain([ + [lifecycle, pkg.package, 'preuninstall', pkg.fromPath, false, true], + [lifecycle, pkg.package, 'uninstall', pkg.fromPath, false, true], + [rmStuff, pkg.package, pkg.fromPath], + [lifecycle, pkg.package, 'postuninstall', pkg.fromPath, false, true], + [moveModuleOnly, pkg.fromPath, pkg.path, log], + [lifecycle, pkg.package, 'preinstall', pkg.path, false, true], + [removeEmptyParents, path.resolve(pkg.fromPath, '..')], + [updatePackageJson, pkg, pkg.path] + ], next) +} + +function removeEmptyParents (pkgdir, next) { + fs.rmdir(pkgdir, function (er) { + // FIXME: Make sure windows does what we want here + if (er && er.code !== 'ENOENT') return next() + removeEmptyParents(path.resolve(pkgdir, '..'), next) + }) +} + +function moveModuleOnly (from, to, log, done) { + var fromModules = path.join(from, 'node_modules') + var tempFromModules = from + '.node_modules' + var toModules = path.join(to, 'node_modules') + var tempToModules = to + '.node_modules' + + log.silly('move', 'move existing destination node_modules away', toModules) + + rename(toModules, tempToModules, removeDestination(done)) + + function removeDestination (next) { + return function (er) { + log.silly('move', 'remove existing destination', to) + if (er) { + rimraf(to, iferr(next, makeDestination(next))) + } else { + rimraf(to, iferr(next, makeDestination(iferr(next, moveToModulesBack(next))))) + } + } + } + + function moveToModulesBack (next) { + return function () { + log.silly('move', 'move existing destination node_modules back', toModules) + rename(tempToModules, toModules, iferr(done, next)) + } + } + + function makeDestination (next) { + return function () { + log.silly('move', 'make sure destination parent exists', path.resolve(to, '..')) + mkdirp(path.resolve(to, '..'), iferr(done, moveNodeModules(next))) + } + } + + function moveNodeModules (next) { + return function () { + log.silly('move', 'move source node_modules away', fromModules) + rename(fromModules, tempFromModules, iferr(doMove(next), doMove(moveNodeModulesBack(next)))) + } + } + + function doMove (next) { + return function () { + log.silly('move', 'move module dir to final dest', from, to) + rename(from, to, iferr(done, next)) + } + } + + function moveNodeModulesBack (next) { + return function () { + mkdirp(from, iferr(done, function () { + log.silly('move', 'put source node_modules back', fromModules) + rename(tempFromModules, fromModules, iferr(done, next)) + })) + } + } +} diff --git a/deps/npm/lib/install/action/postinstall.js b/deps/npm/lib/install/action/postinstall.js new file mode 100644 index 00000000000000..4ca4c8baec272f --- /dev/null +++ b/deps/npm/lib/install/action/postinstall.js @@ -0,0 +1,8 @@ +'use strict' +var lifecycle = require('../../utils/lifecycle.js') +var packageId = require('../../utils/package-id.js') + +module.exports = function (top, buildpath, pkg, log, next) { + log.silly('postinstall', packageId(pkg), buildpath) + lifecycle(pkg.package, 'postinstall', pkg.path, false, false, next) +} diff --git a/deps/npm/lib/install/action/preinstall.js b/deps/npm/lib/install/action/preinstall.js new file mode 100644 index 00000000000000..abd767016e36ab --- /dev/null +++ b/deps/npm/lib/install/action/preinstall.js @@ -0,0 +1,8 @@ +'use strict' +var lifecycle = require('../../utils/lifecycle.js') +var packageId = require('../../utils/package-id.js') + +module.exports = function (top, buildpath, pkg, log, next) { + log.silly('preinstall', packageId(pkg), buildpath) + lifecycle(pkg.package, 'preinstall', buildpath, false, false, next) +} diff --git a/deps/npm/lib/install/action/prepublish.js b/deps/npm/lib/install/action/prepublish.js new file mode 100644 index 00000000000000..b9a5a5d6f1ba67 --- /dev/null +++ b/deps/npm/lib/install/action/prepublish.js @@ -0,0 +1,8 @@ +'use strict' +var lifecycle = require('../../utils/lifecycle.js') +var packageId = require('../../utils/package-id.js') + +module.exports = function (top, buildpath, pkg, log, next) { + log.silly('prepublish', packageId(pkg), buildpath) + lifecycle(pkg.package, 'prepublish', buildpath, false, false, next) +} diff --git a/deps/npm/lib/install/action/remove.js b/deps/npm/lib/install/action/remove.js new file mode 100644 index 00000000000000..7b05a81b6d5e68 --- /dev/null +++ b/deps/npm/lib/install/action/remove.js @@ -0,0 +1,81 @@ +'use strict' +var path = require('path') +var fs = require('graceful-fs') +var rimraf = require('rimraf') +var asyncMap = require('slide').asyncMap +var mkdirp = require('mkdirp') +var npm = require('../../npm.js') +var andIgnoreErrors = require('../and-ignore-errors.js') +var rename = require('../../utils/rename.js') + +// This is weird because we want to remove the module but not it's node_modules folder +// allowing for this allows us to not worry about the order of operations +module.exports = function (top, buildpath, pkg, log, next) { + log.silly('remove', pkg.path) + if (pkg.target) { + removeLink(pkg, next) + } else { + removeDir(pkg, log, next) + } +} + +function removeLink (pkg, next) { + npm.commands.unbuild(pkg.path, true, next) +} + +function removeDir (pkg, log, next) { + var modpath = path.join(path.dirname(pkg.path), '.' + path.basename(pkg.path) + '.MODULES') + + rename(path.join(pkg.path, 'node_modules'), modpath, unbuildPackage) + + function unbuildPackage (renameEr) { + npm.commands.unbuild(pkg.path, true, function () { + rimraf(pkg.path, renameEr ? andRemoveEmptyParents(pkg.path) : moveModulesBack) + }) + } + + function andRemoveEmptyParents (path) { + return function (er) { + if (er) return next(er) + removeEmptyParents(pkg.path) + } + } + + function moveModulesBack () { + fs.readdir(modpath, makeTarget) + } + + function makeTarget (readdirEr, files) { + if (readdirEr) return cleanup() + if (!files.length) return cleanup() + mkdirp(path.join(pkg.path, 'node_modules'), function (mkdirEr) { moveModules(mkdirEr, files) }) + } + + function moveModules (mkdirEr, files) { + if (mkdirEr) return next(mkdirEr) + asyncMap(files, function (file, done) { + var from = path.join(modpath, file) + var to = path.join(pkg.path, 'node_modules', file) + // we ignore errors here, because they can legitimately happen, for instance, + // bundled modules will be in both node_modules folders + rename(from, to, andIgnoreErrors(done)) + }, cleanup) + } + + function cleanup () { + rimraf(modpath, afterCleanup) + } + + function afterCleanup (rimrafEr) { + if (rimrafEr) log.warn('remove', rimrafEr) + removeEmptyParents(path.resolve(pkg.path, '..')) + } + + function removeEmptyParents (pkgdir) { + fs.rmdir(pkgdir, function (er) { + // FIXME: Make sure windows does what we want here + if (er && er.code !== 'ENOENT') return next() + removeEmptyParents(path.resolve(pkgdir, '..')) + }) + } +} diff --git a/deps/npm/lib/install/action/test.js b/deps/npm/lib/install/action/test.js new file mode 100644 index 00000000000000..ee315290ad0554 --- /dev/null +++ b/deps/npm/lib/install/action/test.js @@ -0,0 +1,8 @@ +'use strict' +var lifecycle = require('../../utils/lifecycle.js') +var packageId = require('../../utils/package-id.js') + +module.exports = function (top, buildpath, pkg, log, next) { + log.silly('test', packageId(pkg), buildpath) + lifecycle(pkg.package, 'test', buildpath, false, false, next) +} diff --git a/deps/npm/lib/install/action/update-linked.js b/deps/npm/lib/install/action/update-linked.js new file mode 100644 index 00000000000000..46c4cdfadd1509 --- /dev/null +++ b/deps/npm/lib/install/action/update-linked.js @@ -0,0 +1,8 @@ +'use strict' +var path = require('path') + +module.exports = function (top, buildpath, pkg, log, next) { + log.warn('update-linked', path.relative(top, pkg.path), 'needs updating to', pkg.package.version, + 'from', pkg.oldPkg.package.version, "but we can't, as it's a symlink") + next() +} diff --git a/deps/npm/lib/install/actions.js b/deps/npm/lib/install/actions.js new file mode 100644 index 00000000000000..5d162f86d0a511 --- /dev/null +++ b/deps/npm/lib/install/actions.js @@ -0,0 +1,129 @@ +'use strict' +var path = require('path') +var validate = require('aproba') +var chain = require('slide').chain +var asyncMap = require('slide').asyncMap +var log = require('npmlog') +var andFinishTracker = require('./and-finish-tracker.js') +var andAddParentToErrors = require('./and-add-parent-to-errors.js') +var failedDependency = require('./deps.js').failedDependency +var packageId = require('../utils/package-id.js') +var moduleName = require('../utils/module-name.js') +var buildPath = require('./build-path.js') + +var actions = {} + +actions.fetch = require('./action/fetch.js') +actions.extract = require('./action/extract.js') +actions.build = require('./action/build.js') +actions.test = require('./action/test.js') +actions.preinstall = require('./action/preinstall.js') +actions.install = require('./action/install.js') +actions.postinstall = require('./action/postinstall.js') +actions.prepublish = require('./action/prepublish.js') +actions.finalize = require('./action/finalize.js') +actions.remove = require('./action/remove.js') +actions.move = require('./action/move.js') +actions['update-linked'] = require('./action/update-linked.js') +actions['global-install'] = require('./action/global-install.js') +actions['global-link'] = require('./action/global-link.js') + +// FIXME: We wrap actions like three ways to sunday here. +// Rewrite this to only work one way. + +Object.keys(actions).forEach(function (actionName) { + var action = actions[actionName] + actions[actionName] = function (top, buildpath, pkg, log, next) { + validate('SSOOF', arguments) + // refuse to run actions for failed packages + if (pkg.failed) return next() + if (action.rollback) { + if (!pkg.rollback) pkg.rollback = [] + pkg.rollback.unshift(action.rollback) + } + if (action.commit) { + if (!pkg.commit) pkg.commit = [] + pkg.commit.push(action.commit) + } + return action(top, buildpath, pkg, log, andFinishTracker(log, andAddParentToErrors(pkg.parent, andHandleOptionalDepErrors(pkg, next)))) + } +}) + +function markAsFailed (pkg) { + pkg.failed = true + pkg.requires.forEach(function (req) { + req.requiredBy = req.requiredBy.filter(function (reqReqBy) { return reqReqBy !== pkg }) + if (req.requiredBy.length === 0 && !req.userRequired && !req.existing) { + markAsFailed(req) + } + }) +} + +function andHandleOptionalDepErrors (pkg, next) { + return function (er) { + if (!er) return next.apply(null, arguments) + markAsFailed(pkg) + var anyFatal = pkg.userRequired || !pkg.parent + for (var ii = 0; ii < pkg.requiredBy.length; ++ii) { + var parent = pkg.requiredBy[ii] + var isFatal = failedDependency(parent, pkg) + if (isFatal) anyFatal = true + } + if (anyFatal) return next.apply(null, arguments) + log.warn('install:' + packageId(pkg), er.message) + log.verbose('install:' + packageId(pkg), er.stack) + next() + } +} + +function prepareAction (staging, log) { + validate('SO', arguments) + return function (action) { + validate('SO', action) + var cmd = action[0] + var pkg = action[1] + if (!actions[cmd]) throw new Error('Unknown decomposed command "' + cmd + '" (is it new?)') + var top = path.resolve(staging, '../..') + var buildpath = buildPath(staging, pkg) + return [actions[cmd], top, buildpath, pkg, log.newGroup(cmd + ':' + moduleName(pkg))] + } +} + +exports.actions = actions + +function execAction (todo, done) { + validate('AF', arguments) + var cmd = todo.shift() + todo.push(done) + cmd.apply(null, todo) +} + +exports.doOne = function (cmd, staging, pkg, log, next) { + validate('SSOOF', arguments) + execAction(prepareAction(staging, log)([cmd, pkg]), next) +} + +exports.doSerial = function (type, staging, actionsToRun, log, next) { + validate('SSAOF', arguments) + actionsToRun = actionsToRun + .filter(function (value) { return value[0] === type }) + log.silly('doSerial', '%s %d', type, actionsToRun.length) + chain(actionsToRun.map(prepareAction(staging, log)), andFinishTracker(log, next)) +} + +exports.doReverseSerial = function (type, staging, actionsToRun, log, next) { + validate('SSAOF', arguments) + actionsToRun = actionsToRun + .filter(function (value) { return value[0] === type }) + .reverse() + log.silly('doReverseSerial', '%s %d', type, actionsToRun.length) + chain(actionsToRun.map(prepareAction(staging, log)), andFinishTracker(log, next)) +} + +exports.doParallel = function (type, staging, actionsToRun, log, next) { + validate('SSAOF', arguments) + actionsToRun = actionsToRun.filter(function (value) { return value[0] === type }) + log.silly('doParallel', type + ' ' + actionsToRun.length) + + asyncMap(actionsToRun.map(prepareAction(staging, log)), execAction, andFinishTracker(log, next)) +} diff --git a/deps/npm/lib/install/and-add-parent-to-errors.js b/deps/npm/lib/install/and-add-parent-to-errors.js new file mode 100644 index 00000000000000..62a86bd4a6c360 --- /dev/null +++ b/deps/npm/lib/install/and-add-parent-to-errors.js @@ -0,0 +1,13 @@ +'use strict' +var validate = require('aproba') + +module.exports = function (parent, cb) { + validate('F', [cb]) + return function (er) { + if (!er) return cb.apply(null, arguments) + if (er instanceof Error && parent && parent.package && parent.package.name) { + er.parent = parent.package.name + } + cb(er) + } +} diff --git a/deps/npm/lib/install/and-finish-tracker.js b/deps/npm/lib/install/and-finish-tracker.js new file mode 100644 index 00000000000000..2bab60ddc40080 --- /dev/null +++ b/deps/npm/lib/install/and-finish-tracker.js @@ -0,0 +1,16 @@ +'use strict' +var validate = require('aproba') + +module.exports = function (tracker, cb) { + validate('OF', [tracker, cb]) + return function () { + tracker.finish() + cb.apply(null, arguments) + } +} + +module.exports.now = function (tracker, cb) { + validate('OF', [tracker, cb]) + tracker.finish() + cb.apply(null, Array.prototype.slice.call(arguments, 2)) +} diff --git a/deps/npm/lib/install/and-ignore-errors.js b/deps/npm/lib/install/and-ignore-errors.js new file mode 100644 index 00000000000000..cf46ad82155b5c --- /dev/null +++ b/deps/npm/lib/install/and-ignore-errors.js @@ -0,0 +1,9 @@ +'use strict' + +module.exports = function (cb) { + return function () { + var args = Array.prototype.slice.call(arguments, 1) + if (args.length) args.unshift(null) + return cb.apply(null, args) + } +} diff --git a/deps/npm/lib/install/build-path.js b/deps/npm/lib/install/build-path.js new file mode 100644 index 00000000000000..ebef544f80059e --- /dev/null +++ b/deps/npm/lib/install/build-path.js @@ -0,0 +1,8 @@ +'use strict' +var uniqueFilename = require('unique-filename') +var moduleName = require('../utils/module-name.js') + +module.exports = buildPath +function buildPath (staging, pkg) { + return uniqueFilename(staging, moduleName(pkg), pkg.realpath) +} diff --git a/deps/npm/lib/install/check-permissions.js b/deps/npm/lib/install/check-permissions.js new file mode 100644 index 00000000000000..7806fcff993e19 --- /dev/null +++ b/deps/npm/lib/install/check-permissions.js @@ -0,0 +1,69 @@ +'use strict' +var path = require('path') +var log = require('npmlog') +var validate = require('aproba') +var uniq = require('lodash.uniq') +var asyncMap = require('slide').asyncMap +var npm = require('../npm.js') +var exists = require('./exists.js') +var writable = require('./writable.js') + +module.exports = function (actions, next) { + validate('AF', arguments) + var errors = [] + asyncMap(actions, function (action, done) { + var cmd = action[0] + var pkg = action[1] + switch (cmd) { + case 'add': + hasAnyWriteAccess(path.resolve(pkg.path, '..'), errors, done) + break + case 'update': + case 'remove': + hasWriteAccess(pkg.path, errors, andHasWriteAccess(path.resolve(pkg.path, '..'), errors, done)) + break + case 'move': + hasAnyWriteAccess(pkg.path, errors, andHasWriteAccess(path.resolve(pkg.fromPath, '..'), errors, done)) + break + default: + done() + } + }, function () { + if (!errors.length) return next() + uniq(errors.map(function (er) { return 'Missing write access to ' + er.path })).forEach(function (er) { + log.warn('checkPermissions', er) + }) + npm.config.get('force') ? next() : next(errors[0]) + }) +} + +function andHasWriteAccess (dir, errors, done) { + validate('SAF', arguments) + return function () { + hasWriteAccess(dir, errors, done) + } +} + +function hasAnyWriteAccess (dir, errors, done) { + validate('SAF', arguments) + findNearestDir() + function findNearestDir () { + var nextDir = path.resolve(dir, '..') + exists(dir, function (dirDoesntExist) { + if (!dirDoesntExist || nextDir === dir) { + return hasWriteAccess(dir, errors, done) + } else { + dir = nextDir + findNearestDir() + } + }) + } +} + +function hasWriteAccess (dir, errors, done) { + validate('SAF', arguments) + writable(dir, function (er) { + if (er) errors.push(er) + done() + }) +} diff --git a/deps/npm/lib/install/copy-tree.js b/deps/npm/lib/install/copy-tree.js new file mode 100644 index 00000000000000..67a9c687a22d25 --- /dev/null +++ b/deps/npm/lib/install/copy-tree.js @@ -0,0 +1,25 @@ +'use strict' + +module.exports = function (tree) { + return copyTree(tree, {}) +} + +function copyTree (tree, cache) { + if (cache[tree.path]) return cache[tree.path] + var newTree = cache[tree.path] = Object.create(tree) + copyModuleList(newTree, 'children', cache) + newTree.children.forEach(function (child) { + child.parent = newTree + }) + copyModuleList(newTree, 'requires', cache) + copyModuleList(newTree, 'requiredBy', cache) + return newTree +} + +function copyModuleList (tree, key, cache) { + var newList = [] + tree[key].forEach(function (child) { + newList.push(copyTree(child, cache)) + }) + tree[key] = newList +} diff --git a/deps/npm/lib/install/decompose-actions.js b/deps/npm/lib/install/decompose-actions.js new file mode 100644 index 00000000000000..d91c952f5aa452 --- /dev/null +++ b/deps/npm/lib/install/decompose-actions.js @@ -0,0 +1,55 @@ +'use strict' +var validate = require('aproba') +var asyncMap = require('slide').asyncMap +var npm = require('../npm.js') + +module.exports = function (differences, decomposed, next) { + validate('AAF', arguments) + asyncMap(differences, function (action, done) { + var cmd = action[0] + var pkg = action[1] + switch (cmd) { + case 'add': + case 'update': + addSteps(decomposed, pkg, done) + break + case 'move': + moveSteps(decomposed, pkg, done) + break + case 'remove': + case 'update-linked': + default: + defaultSteps(decomposed, cmd, pkg, done) + } + }, next) +} + +function addSteps (decomposed, pkg, done) { + if (!pkg.fromBundle) { + decomposed.push(['fetch', pkg]) + decomposed.push(['extract', pkg]) + decomposed.push(['test', pkg]) + } + if (!pkg.fromBundle || npm.config.get('rebuild-bundle')) { + decomposed.push(['preinstall', pkg]) + decomposed.push(['build', pkg]) + decomposed.push(['install', pkg]) + decomposed.push(['postinstall', pkg]) + } + decomposed.push(['finalize', pkg]) + done() +} + +function moveSteps (decomposed, pkg, done) { + decomposed.push(['move', pkg]) + decomposed.push(['build', pkg]) + decomposed.push(['install', pkg]) + decomposed.push(['postinstall', pkg]) + decomposed.push(['test', pkg]) + done() +} + +function defaultSteps (decomposed, cmd, pkg, done) { + decomposed.push([cmd, pkg]) + done() +} diff --git a/deps/npm/lib/install/deps.js b/deps/npm/lib/install/deps.js new file mode 100644 index 00000000000000..e15403545caa20 --- /dev/null +++ b/deps/npm/lib/install/deps.js @@ -0,0 +1,595 @@ +'use strict' +var assert = require('assert') +var path = require('path') +var url = require('url') +var semver = require('semver') +var asyncMap = require('slide').asyncMap +var chain = require('slide').chain +var union = require('lodash.union') +var iferr = require('iferr') +var npa = require('npm-package-arg') +var validate = require('aproba') +var realizePackageSpecifier = require('realize-package-specifier') +var dezalgo = require('dezalgo') +var fetchPackageMetadata = require('../fetch-package-metadata.js') +var andAddParentToErrors = require('./and-add-parent-to-errors.js') +var addShrinkwrap = require('../fetch-package-metadata.js').addShrinkwrap +var addBundled = require('../fetch-package-metadata.js').addBundled +var readShrinkwrap = require('./read-shrinkwrap.js') +var inflateShrinkwrap = require('./inflate-shrinkwrap.js') +var inflateBundled = require('./inflate-bundled.js') +var andFinishTracker = require('./and-finish-tracker.js') +var npm = require('../npm.js') +var flatName = require('./flatten-tree.js').flatName +var createChild = require('./node.js').create +var resetMetadata = require('./node.js').reset +var andIgnoreErrors = require('./and-ignore-errors.js') +var isInstallable = require('./validate-args.js').isInstallable +var packageId = require('../utils/package-id.js') +var moduleName = require('../utils/module-name.js') + +// The export functions in this module mutate a dependency tree, adding +// items to them. + +function isDep (tree, child) { + if (child.fromShrinkwrap) return true + var name = moduleName(child) + var requested = isProdDep(tree, name) + var matches + if (requested) matches = doesChildVersionMatch(child, requested, tree) + if (matches) return matches + requested = isDevDep(tree, name) + if (!requested) return + return doesChildVersionMatch(child, requested, tree) +} + +function isDevDep (tree, name) { + var devDeps = tree.package.devDependencies || {} + var reqVer = devDeps[name] + if (reqVer == null) return + return npa(name + '@' + reqVer) +} + +function isProdDep (tree, name) { + var deps = tree.package.dependencies || {} + var reqVer = deps[name] + if (reqVer == null) return false + return npa(name + '@' + reqVer) +} + +var registryTypes = { range: true, version: true } + +function doesChildVersionMatch (child, requested, requestor) { + // we always consider deps provided by a shrinkwrap as "correct" or else + // we'll subvert them if they're intentionally "invalid" + if (child.parent === requestor && child.fromShrinkwrap) return true + // ranges of * ALWAYS count as a match, because when downloading we allow + // prereleases to match * if there are ONLY prereleases + if (requested.spec === '*') return true + + var childReq = child.package._requested + if (childReq) { + if (childReq.rawSpec === requested.rawSpec) return true + if (childReq.type === requested.type && childReq.spec === requested.spec) return true + } + if (!registryTypes[requested.type]) return requested.rawSpec === child.package._from + return semver.satisfies(child.package.version, requested.spec) +} + +exports.recalculateMetadata = function (tree, log, next) { + recalculateMetadata(tree, log, {}, next) +} + +function recalculateMetadata (tree, log, seen, next) { + validate('OOOF', arguments) + if (seen[tree.path]) return next() + seen[tree.path] = true + if (tree.parent == null) resetMetadata(tree) + function markDeps (spec, done) { + validate('SF', arguments) + realizePackageSpecifier(spec, packageRelativePath(tree), function (er, req) { + if (er || !req.name) return done() + var child = findRequirement(tree, req.name, req) + if (child) { + resolveWithExistingModule(child, tree, log, andIgnoreErrors(done)) + } else if (tree.package.dependencies[req.name] != null) { + tree.missingDeps[req.name] = req.rawSpec + done() + } else if (tree.package.devDependencies[req.name] != null) { + tree.missingDevDeps[req.name] = req.rawSpec + done() + } else { + done() + } + }) + } + function specs (deps) { + return Object.keys(deps).map(function (depname) { return depname + '@' + deps[depname] }) + } + var tomark = specs(tree.package.dependencies) + if (!tree.parent && (npm.config.get('dev') || !npm.config.get('production'))) { + tomark = union(tomark, specs(tree.package.devDependencies)) + } + tree.children = tree.children.filter(function (child) { return !child.failed }) + chain([ + [asyncMap, tomark, markDeps], + [asyncMap, tree.children, function (child, done) { recalculateMetadata(child, log, seen, done) }] + ], function () { + tree.userRequired = tree.package._requiredBy.some(function (req) { return req === '#USER' }) + tree.existing = tree.package._requiredBy.some(function (req) { return req === '#EXISTING' }) + tree.package._location = flatNameFromTree(tree) + next(null, tree) + }) +} + +function addRequiredDep (tree, child) { + if (!isDep(tree, child)) return false + var name = isProdDep(tree, moduleName(child)) ? flatNameFromTree(tree) : '#DEV:' + flatNameFromTree(tree) + replaceModuleName(child.package, '_requiredBy', name) + replaceModule(child, 'requiredBy', tree) + replaceModule(tree, 'requires', child) + return true +} + +exports._removeObsoleteDep = removeObsoleteDep +function removeObsoleteDep (child) { + if (child.removed) return + child.removed = true + var requires = child.requires || [] + requires.forEach(function (requirement) { + requirement.requiredBy = requirement.requiredBy.filter(function (reqBy) { return reqBy !== child }) + if (requirement.requiredBy.length === 0) removeObsoleteDep(requirement) + }) +} + +function matchingDep (tree, name) { + if (tree.package.dependencies && tree.package.dependencies[name]) return tree.package.dependencies[name] + if (tree.package.devDependencies && tree.package.devDependencies[name]) return tree.package.devDependencies[name] + return +} + +function packageRelativePath (tree) { + if (!tree) return '' + var requested = tree.package._requested || {} + var isLocal = requested.type === 'directory' || requested.type === 'local' + return isLocal ? requested.spec : tree.path +} + +function getShrinkwrap (tree, name) { + return tree.package._shrinkwrap && tree.package._shrinkwrap.dependencies && tree.package._shrinkwrap.dependencies[name] +} + +exports.getAllMetadata = function (args, tree, next) { + asyncMap(args, function (spec, done) { + if (tree && spec.lastIndexOf('@') <= 0) { + var sw = getShrinkwrap(tree, spec) + if (sw) { + // FIXME: This is duplicated in inflate-shrinkwrap and should be factoed + // into a shared function + spec = sw.resolved + ? spec + '@' + sw.resolved + : (sw.from && url.parse(sw.from).protocol) + ? spec + '@' + sw.from + : spec + '@' + sw.version + } else { + var version = matchingDep(tree, spec) + if (version != null) { + spec += '@' + version + } + } + } + fetchPackageMetadata(spec, packageRelativePath(tree), done) + }, next) +} + +// Add a list of args to tree's top level dependencies +exports.loadRequestedDeps = function (args, tree, saveToDependencies, log, next) { + validate('AOOF', [args, tree, log, next]) + asyncMap(args, function (pkg, done) { + var depLoaded = andAddParentToErrors(tree, done) + resolveWithNewModule(pkg, tree, log.newGroup('loadRequestedDeps'), iferr(depLoaded, function (child, tracker) { + validate('OO', arguments) + if (npm.config.get('global')) { + child.isGlobal = true + } + var childName = moduleName(child) + if (saveToDependencies) { + tree.package[saveToDependencies][childName] = + child.package._requested.rawSpec || child.package._requested.spec + } + if (saveToDependencies && saveToDependencies !== 'devDependencies') { + tree.package.dependencies[childName] = + child.package._requested.rawSpec || child.package._requested.spec + } + child.userRequired = true + child.save = saveToDependencies + + // For things the user asked to install, that aren't a dependency (or + // won't be when we're done), flag it as "depending" on the user + // themselves, so we don't remove it as a dep that no longer exists + if (!addRequiredDep(tree, child)) { + replaceModuleName(child.package, '_requiredBy', '#USER') + } + depLoaded(null, child, tracker) + })) + }, andForEachChild(loadDeps, andFinishTracker(log, next))) +} + +function moduleNameMatches (name) { + return function (child) { return moduleName(child) === name } +} + +function noModuleNameMatches (name) { + return function (child) { return moduleName(child) !== name } +} + +// while this implementation does not require async calling, doing so +// gives this a consistent interface with loadDeps et al +exports.removeDeps = function (args, tree, saveToDependencies, log, next) { + validate('AOOF', [args, tree, log, next]) + args.forEach(function (pkg) { + var pkgName = moduleName(pkg) + if (saveToDependencies) { + var toRemove = tree.children.filter(moduleNameMatches(pkgName)) + var pkgToRemove = toRemove[0] || createChild({package: {name: pkgName}}) + replaceModule(tree, 'removed', pkgToRemove) + pkgToRemove.save = saveToDependencies + } + tree.children = tree.children.filter(noModuleNameMatches(pkgName)) + }) + log.finish() + next() +} + +function andForEachChild (load, next) { + validate('F', [next]) + next = dezalgo(next) + return function (er, children, logs) { + // when children is empty, logs won't be passed in at all (asyncMap is weird) + // so shortcircuit before arg validation + if (!er && (!children || children.length === 0)) return next() + validate('EAA', arguments) + if (er) return next(er) + assert(children.length === logs.length) + var cmds = [] + for (var ii = 0; ii < children.length; ++ii) { + cmds.push([load, children[ii], logs[ii]]) + } + var sortedCmds = cmds.sort(function installOrder (aa, bb) { + return moduleName(aa[1]).localeCompare(moduleName(bb[1])) + }) + chain(sortedCmds, next) + } +} + +function isDepOptional (tree, name) { + if (!tree.package.optionalDependencies) return false + if (tree.package.optionalDependencies[name] != null) return true + return false +} + +var failedDependency = exports.failedDependency = function (tree, name_pkg) { + var name, pkg + if (typeof name_pkg === 'string') { + name = name_pkg + } else { + pkg = name_pkg + name = moduleName(pkg) + } + + tree.children = tree.children.filter(noModuleNameMatches(name)) + + if (isDepOptional(tree, name)) { + return false + } + + tree.failed = true + + if (!tree.parent) return true + + if (tree.userRequired) return true + + for (var ii = 0; ii < tree.requiredBy.length; ++ii) { + var requireParent = tree.requiredBy[ii] + if (failedDependency(requireParent, tree.package)) { + return true + } + } + return false +} + +function top (tree) { + if (tree.parent) return top(tree.parent) + return tree +} + +function treeWarn (tree, what, error) { + var topTree = top(tree) + if (!topTree.warnings) topTree.warnings = [] + error.optional = flatNameFromTree(tree) + '/' + what + topTree.warnings.push(error) +} + +function andHandleOptionalErrors (log, tree, name, done) { + validate('OOSF', arguments) + return function (er, child, childLog) { + if (!er) validate('OO', [child, childLog]) + if (!er) return done(er, child, childLog) + var isFatal = failedDependency(tree, name) + if (er && !isFatal) { + tree.children = tree.children.filter(noModuleNameMatches(name)) + treeWarn(tree, name, er) + return done() + } else { + return done(er, child, childLog) + } + } +} + +// Load any missing dependencies in the given tree +exports.loadDeps = loadDeps +function loadDeps (tree, log, next) { + validate('OOF', arguments) + if (tree.loaded || (tree.parent && tree.parent.failed)) return andFinishTracker.now(log, next) + if (tree.parent) tree.loaded = true + if (!tree.package.dependencies) tree.package.dependencies = {} + asyncMap(Object.keys(tree.package.dependencies), function (dep, done) { + var version = tree.package.dependencies[dep] + if (tree.package.optionalDependencies && + tree.package.optionalDependencies[dep] && + !npm.config.get('optional')) { + return done() + } + + addDependency(dep, version, tree, log.newGroup('loadDep:' + dep), andHandleOptionalErrors(log, tree, dep, done)) + }, andForEachChild(loadDeps, andFinishTracker(log, next))) +} + +// Load development dependencies into the given tree +exports.loadDevDeps = function (tree, log, next) { + validate('OOF', arguments) + if (!tree.package.devDependencies) return andFinishTracker.now(log, next) + asyncMap(Object.keys(tree.package.devDependencies), function (dep, done) { + // things defined as both dev dependencies and regular dependencies are treated + // as the former + if (tree.package.dependencies[dep]) return done() + + var logGroup = log.newGroup('loadDevDep:' + dep) + addDependency(dep, tree.package.devDependencies[dep], tree, logGroup, done) + }, andForEachChild(loadDeps, andFinishTracker(log, next))) +} + +exports.loadExtraneous = function loadExtraneous (tree, log, next) { + var seen = {} + function loadExtraneous (tree, log, next) { + validate('OOF', arguments) + if (seen[tree.path]) return next() + seen[tree.path] = true + asyncMap(tree.children.filter(function (child) { return !child.loaded }), function (child, done) { + resolveWithExistingModule(child, tree, log, done) + }, andForEachChild(loadExtraneous, andFinishTracker(log, next))) + } + loadExtraneous(tree, log, next) +} + +exports.loadExtraneous.andResolveDeps = function (tree, log, next) { + validate('OOF', arguments) + asyncMap(tree.children.filter(function (child) { return !child.loaded }), function (child, done) { + resolveWithExistingModule(child, tree, log, done) + }, andForEachChild(loadDeps, andFinishTracker(log, next))) +} + +function addDependency (name, versionSpec, tree, log, done) { + validate('SSOOF', arguments) + var next = andAddParentToErrors(tree, done) + var spec = name + '@' + versionSpec + realizePackageSpecifier(spec, packageRelativePath(tree), iferr(done, function (req) { + var child = findRequirement(tree, name, req) + if (child) { + resolveWithExistingModule(child, tree, log, iferr(next, function (child, log) { + if (child.package._shrinkwrap === undefined) { + readShrinkwrap.andInflate(child, function (er) { next(er, child, log) }) + } else { + next(null, child, log) + } + })) + } else { + resolveWithNewModule(req, tree, log, next) + } + })) +} + +function resolveWithExistingModule (child, tree, log, next) { + validate('OOOF', arguments) + addRequiredDep(tree, child) + + if (tree.parent && child.parent !== tree) updatePhantomChildren(tree.parent, child) + + next(null, child, log) +} + +var updatePhantomChildren = exports.updatePhantomChildren = function (current, child) { + validate('OO', arguments) + while (current && current !== child.parent) { + // FIXME: phantomChildren doesn't actually belong in the package.json + if (!current.package._phantomChildren) current.package._phantomChildren = {} + current.package._phantomChildren[moduleName(child)] = child.package.version + current = current.parent + } +} + +function flatNameFromTree (tree) { + validate('O', arguments) + if (!tree.parent) return '/' + var path = flatNameFromTree(tree.parent) + if (path !== '/') path += '/' + return flatName(path, tree) +} + +exports._replaceModuleName = replaceModuleName +function replaceModuleName (obj, key, name) { + validate('OSS', arguments) + obj[key] = union(obj[key] || [], [name]) +} + +exports._replaceModule = replaceModule +function replaceModule (obj, key, child) { + validate('OSO', arguments) + if (!obj[key]) obj[key] = [] + // we replace children with a new array object instead of mutating it + // because mutating it results in weird failure states. + // I would very much like to know _why_ this is. =/ + var children = [].concat(obj[key]) + var childName = moduleName(child) + for (var replaceAt = 0; replaceAt < children.length; ++replaceAt) { + if (moduleName(children[replaceAt]) === childName) break + } + var replacing = children.splice(replaceAt, 1, child) + obj[key] = children + return replacing[0] +} + +function resolveWithNewModule (pkg, tree, log, next) { + validate('OOOF', arguments) + if (pkg.type) { + return fetchPackageMetadata(pkg, packageRelativePath(tree), log.newItem('fetchMetadata'), iferr(next, function (pkg) { + resolveWithNewModule(pkg, tree, log, next) + })) + } + + if (!pkg._installable) { + log.silly('resolveWithNewModule', packageId(pkg), 'checking installable status') + return isInstallable(pkg, iferr(next, function () { + pkg._installable = true + resolveWithNewModule(pkg, tree, log, next) + })) + } + + if (!pkg._from) { + pkg._from = pkg._requested.name + '@' + pkg._requested.spec + } + addShrinkwrap(pkg, iferr(next, function () { + addBundled(pkg, iferr(next, function () { + var parent = earliestInstallable(tree, tree, pkg) || tree + var child = createChild({ + package: pkg, + parent: parent, + path: path.join(parent.path, 'node_modules', pkg.name), + realpath: path.resolve(parent.realpath, 'node_modules', pkg.name), + children: pkg._bundled || [], + isLink: tree.isLink + }) + + var replaced = replaceModule(parent, 'children', child) + if (replaced) removeObsoleteDep(replaced) + addRequiredDep(tree, child) + pkg._location = flatNameFromTree(child) + + if (tree.parent && parent !== tree) updatePhantomChildren(tree.parent, child) + + if (pkg._bundled) { + inflateBundled(child, child.children) + } + + if (pkg._shrinkwrap && pkg._shrinkwrap.dependencies) { + return inflateShrinkwrap(child, pkg._shrinkwrap.dependencies, function (er) { + next(er, child, log) + }) + } + + next(null, child, log) + })) + })) +} + +var validatePeerDeps = exports.validatePeerDeps = function (tree, onInvalid) { + if (!tree.package.peerDependencies) return + Object.keys(tree.package.peerDependencies).forEach(function (pkgname) { + var version = tree.package.peerDependencies[pkgname] + var match = findRequirement(tree.parent || tree, pkgname, npa(pkgname + '@' + version)) + if (!match) onInvalid(tree, pkgname, version) + }) +} + +exports.validateAllPeerDeps = function (tree, onInvalid) { + validateAllPeerDeps(tree, onInvalid, {}) +} + +function validateAllPeerDeps (tree, onInvalid, seen) { + validate('OFO', arguments) + if (seen[tree.path]) return + seen[tree.path] = true + validatePeerDeps(tree, onInvalid) + tree.children.forEach(function (child) { validateAllPeerDeps(child, onInvalid, seen) }) +} + +// Determine if a module requirement is already met by the tree at or above +// our current location in the tree. +var findRequirement = exports.findRequirement = function (tree, name, requested, requestor) { + validate('OSO', [tree, name, requested]) + if (!requestor) requestor = tree + var nameMatch = function (child) { + return moduleName(child) === name && child.parent && !child.removed + } + var versionMatch = function (child) { + return doesChildVersionMatch(child, requested, requestor) + } + if (nameMatch(tree)) { + // this *is* the module, but it doesn't match the version, so a + // new copy will have to be installed + return versionMatch(tree) ? tree : null + } + + var matches = tree.children.filter(nameMatch) + if (matches.length) { + matches = matches.filter(versionMatch) + // the module exists as a dependent, but the version doesn't match, so + // a new copy will have to be installed above here + if (matches.length) return matches[0] + return null + } + if (!tree.parent) return null + return findRequirement(tree.parent, name, requested, requestor) +} + +// Find the highest level in the tree that we can install this module in. +// If the module isn't installed above us yet, that'd be the very top. +// If it is, then it's the level below where its installed. +var earliestInstallable = exports.earliestInstallable = function (requiredBy, tree, pkg) { + validate('OOO', arguments) + + function undeletedModuleMatches (child) { + return !child.removed && moduleName(child) === pkg.name + } + if (tree.children.some(undeletedModuleMatches)) return null + + // If any of the children of this tree have conflicting + // binaries then we need to decline to install this package here. + var binaryMatches = typeof pkg.bin === 'object' && tree.children.some(function (child) { + if (child.removed) return false + if (typeof child.package.bin !== 'object') return false + return Object.keys(child.package.bin).some(function (bin) { + return pkg.bin[bin] + }) + }) + if (binaryMatches) return null + + // if this tree location requested the same module then we KNOW it + // isn't compatible because if it were findRequirement would have + // found that version. + var deps = tree.package.dependencies || {} + if (!tree.removed && requiredBy !== tree && deps[pkg.name]) { + return null + } + + // FIXME: phantomChildren doesn't actually belong in the package.json + if (tree.package._phantomChildren && tree.package._phantomChildren[pkg.name]) return null + + if (!tree.parent) return tree + if (tree.isGlobal) return tree + + if (npm.config.get('global-style') && !tree.parent.parent) return tree + if (npm.config.get('legacy-bundling')) return tree + + return (earliestInstallable(requiredBy, tree.parent, pkg) || tree) +} diff --git a/deps/npm/lib/install/diff-trees.js b/deps/npm/lib/install/diff-trees.js new file mode 100644 index 00000000000000..8000124604e272 --- /dev/null +++ b/deps/npm/lib/install/diff-trees.js @@ -0,0 +1,158 @@ +'use strict' +var validate = require('aproba') +var npa = require('npm-package-arg') +var flattenTree = require('./flatten-tree.js') + +function nonRegistrySource (pkg) { + validate('O', arguments) + var requested = pkg._requested || (pkg._from && npa(pkg._from)) + if (!requested) return false + + if (requested.type === 'hosted') return true + if (requested.type === 'local') return true + return false +} + +function pkgAreEquiv (aa, bb) { + var aaSha = (aa.dist && aa.dist.shasum) || aa._shasum + var bbSha = (bb.dist && bb.dist.shasum) || bb._shasum + if (aaSha === bbSha) return true + if (aaSha || bbSha) return false + if (nonRegistrySource(aa) || nonRegistrySource(bb)) return false + if (aa.version === bb.version) return true + return false +} + +function getNameAndVersion (pkg) { + var versionspec = pkg._shasum + + if (!versionspec && nonRegistrySource(pkg)) { + if (pkg._requested) { + versionspec = pkg._requested.spec + } else if (pkg._from) { + versionspec = npa(pkg._from).spec + } + } + if (!versionspec) { + versionspec = pkg.version + } + return pkg.name + '@' + versionspec +} + +function pushAll (aa, bb) { + Array.prototype.push.apply(aa, bb) +} + +module.exports = function (oldTree, newTree, differences, log, next) { + validate('OOAOF', arguments) + pushAll(differences, sortActions(diffTrees(oldTree, newTree))) + log.finish() + next() +} + +function isLink (node) { + return node && node.isLink +} + +function requiredByAllLinked (node) { + if (!node.requiredBy.length) return false + return node.requiredBy.filter(isLink).length === node.requiredBy.length +} + +function isNotReqByTop (req) { + return req !== '/' && // '/' is the top level itself + req !== '#USER' && // #USER + req !== '#EXTRANEOUS' +} + +var sortActions = module.exports.sortActions = function (differences) { + var actions = {} + differences.forEach(function (action) { + var child = action[1] + actions[child.package._location] = action + }) + + var sorted = [] + var added = {} + + var sortedlocs = Object.keys(actions).sort(sortByLocation) + + // Do top level deps first, this stops the sorting by required order from + // unsorting these deps. + var toplocs = sortedlocs.filter(function (location) { + var mod = actions[location][1] + if (!mod.package._requiredBy) return true + // If the module is required by ANY non-top level package + // then we don't want to include this. + return !mod.package._requiredBy.some(isNotReqByTop) + }) + + toplocs.concat(sortedlocs).forEach(function (location) { + sortByDeps(actions[location]) + }) + + function sortByLocation (aa, bb) { + return bb.localeCompare(aa) + } + function sortByDeps (action) { + var mod = action[1] + if (added[mod.package._location]) return + added[mod.package._location] = action + mod.package._requiredBy.sort().forEach(function (location) { + if (actions[location]) sortByDeps(actions[location]) + }) + sorted.unshift(action) + } + + return sorted +} + +function diffTrees (oldTree, newTree) { + validate('OO', arguments) + var differences = [] + var flatOldTree = flattenTree(oldTree) + var flatNewTree = flattenTree(newTree) + var toRemove = {} + var toRemoveByNameAndVer = {} + // find differences + Object.keys(flatOldTree).forEach(function (flatname) { + if (flatNewTree[flatname]) return + var pkg = flatOldTree[flatname] + toRemove[flatname] = pkg + var namever = getNameAndVersion(pkg.package) + if (!toRemoveByNameAndVer[namever]) toRemoveByNameAndVer[namever] = [] + toRemoveByNameAndVer[namever].push(flatname) + }) + Object.keys(flatNewTree).forEach(function (path) { + var pkg = flatNewTree[path] + pkg.oldPkg = flatOldTree[path] + pkg.isInLink = (pkg.oldPkg && isLink(pkg.oldPkg.parent)) || + (pkg.parent && isLink(pkg.parent)) || + requiredByAllLinked(pkg) + if (pkg.oldPkg) { + if (!pkg.userRequired && pkgAreEquiv(pkg.oldPkg.package, pkg.package)) return + if (!pkg.isInLink && (isLink(pkg.oldPkg) || isLink(pkg))) { + differences.push(['update-linked', pkg]) + } else { + differences.push(['update', pkg]) + } + } else { + var vername = getNameAndVersion(pkg.package) + if (toRemoveByNameAndVer[vername] && toRemoveByNameAndVer[vername].length && !pkg.fromBundle) { + var flatname = toRemoveByNameAndVer[vername].shift() + pkg.fromPath = toRemove[flatname].path + differences.push(['move', pkg]) + delete toRemove[flatname] + } else { + differences.push(['add', pkg]) + } + } + }) + Object + .keys(toRemove) + .map(function (path) { return toRemove[path] }) + .forEach(function (pkg) { + differences.push(['remove', pkg]) + }) + return differences +} diff --git a/deps/npm/lib/install/exists.js b/deps/npm/lib/install/exists.js new file mode 100644 index 00000000000000..59100d63ba0d94 --- /dev/null +++ b/deps/npm/lib/install/exists.js @@ -0,0 +1,27 @@ +'use strict' +var fs = require('fs') +var inflight = require('inflight') +var accessError = require('./access-error.js') +var isFsAccessAvailable = require('./is-fs-access-available.js') + +if (isFsAccessAvailable) { + module.exports = fsAccessImplementation +} else { + module.exports = fsStatImplementation +} + +// exposed only for testing purposes +module.exports.fsAccessImplementation = fsAccessImplementation +module.exports.fsStatImplementation = fsStatImplementation + +function fsAccessImplementation (dir, done) { + done = inflight('exists:' + dir, done) + if (!done) return + fs.access(dir, fs.F_OK, done) +} + +function fsStatImplementation (dir, done) { + done = inflight('exists:' + dir, done) + if (!done) return + fs.stat(dir, function (er) { done(accessError(dir, er)) }) +} diff --git a/deps/npm/lib/install/filter-invalid-actions.js b/deps/npm/lib/install/filter-invalid-actions.js new file mode 100644 index 00000000000000..2c5d430c5d52d4 --- /dev/null +++ b/deps/npm/lib/install/filter-invalid-actions.js @@ -0,0 +1,36 @@ +'use strict' +var path = require('path') +var validate = require('aproba') +var log = require('npmlog') +var packageId = require('../utils/package-id.js') + +module.exports = function (top, differences, next) { + validate('SAF', arguments) + var action + var keep = [] + + differences.forEach(function (action) { + var cmd = action[0] + var pkg = action[1] + if (cmd === 'remove') { + pkg.removing = true + } + }) + + /*eslint no-cond-assign:0*/ + while (action = differences.shift()) { + var cmd = action[0] + var pkg = action[1] + if (pkg.isInLink || (pkg.parent && (pkg.parent.target || pkg.parent.isLink))) { + // we want to skip warning if this is a child of another module that we're removing + if (!pkg.parent.removing) { + log.warn('skippingAction', 'Module is inside a symlinked module: not running ' + + cmd + ' ' + packageId(pkg) + ' ' + path.relative(top, pkg.path)) + } + } else { + keep.push(action) + } + } + differences.push.apply(differences, keep) + next() +} diff --git a/deps/npm/lib/install/flatten-tree.js b/deps/npm/lib/install/flatten-tree.js new file mode 100644 index 00000000000000..869685a4e8450c --- /dev/null +++ b/deps/npm/lib/install/flatten-tree.js @@ -0,0 +1,30 @@ +'use strict' +var validate = require('aproba') +var moduleName = require('../utils/module-name.js') + +module.exports = function (tree) { + validate('O', arguments) + var seen = {} + var flat = {} + var todo = [[tree, '/']] + while (todo.length) { + var next = todo.shift() + var pkg = next[0] + seen[pkg.path] = true + var path = next[1] + flat[path] = pkg + if (path !== '/') path += '/' + for (var ii = 0; ii < pkg.children.length; ++ii) { + var child = pkg.children[ii] + if (!seen[child.path]) { + todo.push([child, flatName(path, child)]) + } + } + } + return flat +} + +var flatName = module.exports.flatName = function (path, child) { + validate('SO', arguments) + return path + (moduleName(child) || 'TOP') +} diff --git a/deps/npm/lib/install/inflate-bundled.js b/deps/npm/lib/install/inflate-bundled.js new file mode 100644 index 00000000000000..c597e7a566dbb7 --- /dev/null +++ b/deps/npm/lib/install/inflate-bundled.js @@ -0,0 +1,15 @@ +'use strict' +var validate = require('aproba') +var childPath = require('../utils/child-path.js') + +module.exports = function inflateBundled (parent, children) { + validate('OA', arguments) + children.forEach(function (child) { + child.fromBundle = true + child.parent = parent + child.path = childPath(parent.path, child) + child.realpath = childPath(parent.path, child) + child.isLink = child.isLink || parent.isLink || parent.target + inflateBundled(child, child.children) + }) +} diff --git a/deps/npm/lib/install/inflate-shrinkwrap.js b/deps/npm/lib/install/inflate-shrinkwrap.js new file mode 100644 index 00000000000000..ce22f4e4c53734 --- /dev/null +++ b/deps/npm/lib/install/inflate-shrinkwrap.js @@ -0,0 +1,59 @@ +'use strict' +var url = require('url') +var asyncMap = require('slide').asyncMap +var validate = require('aproba') +var iferr = require('iferr') +var fetchPackageMetadata = require('../fetch-package-metadata.js') +var addShrinkwrap = require('../fetch-package-metadata.js').addShrinkwrap +var addBundled = require('../fetch-package-metadata.js').addBundled +var inflateBundled = require('./inflate-bundled.js') +var npm = require('../npm.js') +var createChild = require('./node.js').create +var moduleName = require('../utils/module-name.js') +var childPath = require('../utils/child-path.js') + +var inflateShrinkwrap = module.exports = function (tree, swdeps, finishInflating) { + validate('OOF', arguments) + if (!npm.config.get('shrinkwrap')) return finishInflating() + var onDisk = {} + tree.children.forEach(function (child) { onDisk[moduleName(child)] = child }) + tree.children = [] + asyncMap(Object.keys(swdeps), function (name, next) { + var sw = swdeps[name] + var spec = sw.resolved + ? name + '@' + sw.resolved + : (sw.from && url.parse(sw.from).protocol) + ? name + '@' + sw.from + : name + '@' + sw.version + var child = onDisk[name] + if (child && (child.fromShrinkwrap || + (sw.resolved && child.package._resolved === sw.resolved) || + (sw.from && url.parse(sw.from).protocol && child.package._from === sw.from) || + child.package.version === sw.version)) { + if (!child.fromShrinkwrap) child.fromShrinkwrap = spec + tree.children.push(child) + return next() + } + fetchPackageMetadata(spec, tree.path, iferr(next, function (pkg) { + pkg._from = sw.from || spec + addShrinkwrap(pkg, iferr(next, function () { + addBundled(pkg, iferr(next, function () { + var child = createChild({ + package: pkg, + loaded: false, + parent: tree, + fromShrinkwrap: spec, + path: childPath(tree.path, pkg), + realpath: childPath(tree.realpath, pkg), + children: pkg._bundled || [] + }) + tree.children.push(child) + if (pkg._bundled) { + inflateBundled(child, child.children) + } + inflateShrinkwrap(child, sw.dependencies || {}, next) + })) + })) + })) + }, finishInflating) +} diff --git a/deps/npm/lib/install/is-dev.js b/deps/npm/lib/install/is-dev.js new file mode 100644 index 00000000000000..b1f2c4b6614975 --- /dev/null +++ b/deps/npm/lib/install/is-dev.js @@ -0,0 +1,7 @@ +'use strict' +var isDev = exports.isDev = function (node) { + return node.package._requiredBy.some(function (req) { return req === '#DEV:/' }) +} +exports.isOnlyDev = function (node) { + return node.package._requiredBy.length === 1 && isDev(node) +} diff --git a/deps/npm/lib/install/is-extraneous.js b/deps/npm/lib/install/is-extraneous.js new file mode 100644 index 00000000000000..cd4d954668426a --- /dev/null +++ b/deps/npm/lib/install/is-extraneous.js @@ -0,0 +1,14 @@ +'use strict' +var path = require('path') +var isDev = require('./is-dev.js').isDev +var npm = require('../npm.js') + +module.exports = function (tree) { + var pkg = tree.package + var requiredBy = pkg._requiredBy.filter(function (req) { return req[0] !== '#' }) + var isTopLevel = tree.parent == null + var isChildOfTop = !isTopLevel && tree.parent.parent == null + var isTopGlobal = isChildOfTop && tree.parent.path === path.resolve(npm.globalDir, '..') + var topHasNoPackageJson = isChildOfTop && tree.parent.error + return !isTopLevel && (!isChildOfTop || !topHasNoPackageJson) && !isTopGlobal && requiredBy.length === 0 && !isDev(tree) +} diff --git a/deps/npm/lib/install/is-fs-access-available.js b/deps/npm/lib/install/is-fs-access-available.js new file mode 100644 index 00000000000000..a7d2640d794b5d --- /dev/null +++ b/deps/npm/lib/install/is-fs-access-available.js @@ -0,0 +1,22 @@ +'use strict' +var fs = require('fs') +var semver = require('semver') +var isWindows = process.platform === 'win32' + +// fs.access first introduced in node 0.12 / io.js +if (!fs.access) { + module.exports = false +} else if (!isWindows) { + // fs.access always works on non-Windows OSes + module.exports = true +} else { + // The Windows implementation of `fs.access` has a bug where it will + // sometimes return access errors all the time for directories, even + // when access is available. As all we actually test ARE directories, this + // is a bit of a problem. + // This was fixed in io.js version 1.5.0 + // As of 2015-07-20, it is still unfixed in node: + // https://github.com/joyent/node/issues/25657 + + module.exports = semver.gte(process.version, '1.5.0') +} diff --git a/deps/npm/lib/install/mutate-into-logical-tree.js b/deps/npm/lib/install/mutate-into-logical-tree.js new file mode 100644 index 00000000000000..833aa94c9400cc --- /dev/null +++ b/deps/npm/lib/install/mutate-into-logical-tree.js @@ -0,0 +1,113 @@ +'use strict' +var union = require('lodash.union') +var without = require('lodash.without') +var validate = require('aproba') +var flattenTree = require('./flatten-tree.js') +var isExtraneous = require('./is-extraneous.js') +var validateAllPeerDeps = require('./deps.js').validateAllPeerDeps +var packageId = require('../utils/package-id.js') +var moduleName = require('../utils/module-name.js') + +var mutateIntoLogicalTree = module.exports = function (tree) { + validate('O', arguments) + + validateAllPeerDeps(tree, function (tree, pkgname, version) { + if (!tree.missingPeers) tree.missingPeers = {} + tree.missingPeers[pkgname] = version + }) + + var flat = flattenTree(tree) + + function getNode (flatname) { + return flatname.substr(0, 5) === '#DEV:' + ? flat[flatname.substr(5)] + : flat[flatname] + } + + Object.keys(flat).sort().forEach(function (flatname) { + var node = flat[flatname] + var requiredBy = node.package._requiredBy || [] + var requiredByNames = requiredBy.filter(function (parentFlatname) { + var parentNode = getNode(parentFlatname) + if (!parentNode) return false + return parentNode.package.dependencies[moduleName(node)] || + (parentNode.package.devDependencies && parentNode.package.devDependencies[moduleName(node)]) + }) + requiredBy = requiredByNames.map(getNode) + + node.requiredBy = requiredBy + + if (!requiredBy.length) return + + if (node.parent) node.parent.children = without(node.parent.children, node) + + requiredBy.forEach(function (parentNode) { + parentNode.children = union(parentNode.children, [node]) + }) + if (node.package._requiredBy.some(function (nodename) { return nodename[0] === '#' })) { + tree.children = union(tree.children, [node]) + } + }) + return tree +} + +module.exports.asReadInstalled = function (tree) { + mutateIntoLogicalTree(tree) + return translateTree(tree) +} + +function translateTree (tree) { + return translateTree_(tree, {}) +} + +function translateTree_ (tree, seen) { + var pkg = tree.package + if (seen[tree.path]) return pkg + seen[tree.path] = pkg + if (pkg._dependencies) return pkg + pkg._dependencies = pkg.dependencies + pkg.dependencies = {} + tree.children.forEach(function (child) { + pkg.dependencies[moduleName(child)] = translateTree_(child, seen) + }) + Object.keys(tree.missingDeps).forEach(function (name) { + if (pkg.dependencies[name]) { + pkg.dependencies[name].invalid = true + pkg.dependencies[name].realName = name + pkg.dependencies[name].extraneous = false + } else { + pkg.dependencies[name] = { + requiredBy: tree.missingDeps[name], + missing: true, + optional: !!pkg.optionalDependencies[name] + } + } + }) + var checkForMissingPeers = (tree.parent ? [] : [tree]).concat(tree.children) + checkForMissingPeers.filter(function (child) { + return child.missingPeers + }).forEach(function (child) { + Object.keys(child.missingPeers).forEach(function (pkgname) { + var version = child.missingPeers[pkgname] + var peerPkg = pkg.dependencies[pkgname] + if (!peerPkg) { + peerPkg = pkg.dependencies[pkgname] = { + _id: pkgname + '@' + version, + name: pkgname, + version: version + } + } + if (!peerPkg.peerMissing) peerPkg.peerMissing = [] + peerPkg.peerMissing.push({ + requiredBy: packageId(child), + requires: pkgname + '@' + version + }) + }) + }) + pkg.path = tree.path + + pkg.error = tree.error + pkg.extraneous = isExtraneous(tree) + if (tree.target && tree.parent && !tree.parent.target) pkg.link = tree.realpath + return pkg +} diff --git a/deps/npm/lib/install/node.js b/deps/npm/lib/install/node.js new file mode 100644 index 00000000000000..c76dc765ba493c --- /dev/null +++ b/deps/npm/lib/install/node.js @@ -0,0 +1,61 @@ +'use strict' + +var defaultTemplate = { + package: { + dependencies: {}, + devDependencies: {}, + optionalDependencies: {}, + _requiredBy: [], + _phantomChildren: {} + }, + loaded: false, + children: [], + requiredBy: [], + requires: [], + missingDeps: {}, + missingDevDeps: {}, + path: null, + realpath: null, + userRequired: false, + existing: false +} + +function isLink (node) { + return node && node.isLink +} + +var create = exports.create = function (node, template) { + if (!template) template = defaultTemplate + Object.keys(template).forEach(function (key) { + if (template[key] != null && typeof template[key] === 'object' && !(template[key] instanceof Array)) { + if (!node[key]) node[key] = {} + return create(node[key], template[key]) + } + if (node[key] != null) return + node[key] = template[key] + }) + if (isLink(node) || isLink(node.parent)) { + node.isLink = true + } + return node +} + +exports.reset = function (node) { + reset(node, {}) +} + +function reset (node, seen) { + if (seen[node.path]) return + seen[node.path] = true + var child = create(node) + child.package._requiredBy = child.package._requiredBy.filter(function (req) { + return req[0] === '#' + }) + child.requiredBy = [] + child.package._phantomChildren = {} + // FIXME: cleaning up after read-package-json's mess =( + if (child.package._id === '@') delete child.package._id + child.missingDeps = {} + child.children.forEach(function (child) { reset(child, seen) }) + if (!child.package.version) child.package.version = '' +} diff --git a/deps/npm/lib/install/prune-tree.js b/deps/npm/lib/install/prune-tree.js new file mode 100644 index 00000000000000..eb3edf4f75bafc --- /dev/null +++ b/deps/npm/lib/install/prune-tree.js @@ -0,0 +1,36 @@ +'use strict' +var validate = require('aproba') +var flattenTree = require('./flatten-tree.js') + +function isNotPackage (mod) { + return function (parentMod) { return mod !== parentMod } +} + +module.exports = function pruneTree (tree) { + validate('O', arguments) + var flat = flattenTree(tree) + // we just do this repeatedly until there are no more orphaned packages + // which isn't as effecient as it could be on a REALLY big tree + // but we'll face that if it proves to be an issue + var removedPackage + do { + removedPackage = false + Object.keys(flat).forEach(function (flatname) { + var child = flat[flatname] + if (!child.parent) return + child.package._requiredBy = (child.package._requiredBy || []).filter(function (req) { + var isDev = req.substr(0, 4) === '#DEV' + if (req[0] === '#' && !isDev) return true + if (flat[req]) return true + if (!isDev) return false + var reqChildAsDevDep = flat[req.substr(5)] + return reqChildAsDevDep && !reqChildAsDevDep.parent + }) + if (!child.package._requiredBy.length) { + removedPackage = true + delete flat[flatname] + child.parent.children = child.parent.children.filter(isNotPackage(child)) + } + }) + } while (removedPackage) +} diff --git a/deps/npm/lib/install/read-shrinkwrap.js b/deps/npm/lib/install/read-shrinkwrap.js new file mode 100644 index 00000000000000..35180b688dbadc --- /dev/null +++ b/deps/npm/lib/install/read-shrinkwrap.js @@ -0,0 +1,32 @@ +'use strict' +var path = require('path') +var fs = require('graceful-fs') +var iferr = require('iferr') +var inflateShrinkwrap = require('./inflate-shrinkwrap.js') +var parseJSON = require('../utils/parse-json.js') + +var readShrinkwrap = module.exports = function (child, next) { + fs.readFile(path.join(child.path, 'npm-shrinkwrap.json'), function (er, data) { + if (er) { + child.package._shrinkwrap = null + return next() + } + try { + child.package._shrinkwrap = parseJSON(data) + } catch (ex) { + child.package._shrinkwrap = null + return next(ex) + } + return next() + }) +} + +module.exports.andInflate = function (child, next) { + readShrinkwrap(child, iferr(next, function () { + if (child.package._shrinkwrap) { + return inflateShrinkwrap(child, child.package._shrinkwrap.dependencies || {}, next) + } else { + return next() + } + })) +} diff --git a/deps/npm/lib/install/save.js b/deps/npm/lib/install/save.js new file mode 100644 index 00000000000000..acbe8c5bb3579f --- /dev/null +++ b/deps/npm/lib/install/save.js @@ -0,0 +1,221 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') +var url = require('url') +var writeFileAtomic = require('write-file-atomic') +var log = require('npmlog') +var semver = require('semver') +var iferr = require('iferr') +var validate = require('aproba') +var without = require('lodash.without') +var npm = require('../npm.js') +var deepSortObject = require('../utils/deep-sort-object.js') +var parseJSON = require('../utils/parse-json.js') +var moduleName = require('../utils/module-name.js') + +// if the -S|--save option is specified, then write installed packages +// as dependencies to a package.json file. + +exports.saveRequested = function (args, tree, andReturn) { + validate('AOF', arguments) + savePackageJson(args, tree, andWarnErrors(andSaveShrinkwrap(tree, andReturn))) +} + +function andSaveShrinkwrap (tree, andReturn) { + validate('OF', arguments) + return function (er) { + validate('E', arguments) + saveShrinkwrap(tree, andWarnErrors(andReturn)) + } +} + +function andWarnErrors (cb) { + validate('F', arguments) + return function (er) { + if (er) log.warn('saveError', er.message) + arguments[0] = null + cb.apply(null, arguments) + } +} + +function saveShrinkwrap (tree, next) { + validate('OF', arguments) + var saveTarget = path.resolve(tree.path, 'npm-shrinkwrap.json') + fs.stat(saveTarget, function (er, stat) { + if (er) return next() + var save = npm.config.get('save') + var saveDev = npm.config.get('save-dev') + var saveOptional = npm.config.get('save-optional') + + var shrinkwrap = tree.package._shrinkwrap || {dependencies: {}} + var hasDevOnlyDeps = tree.requires.filter(function (dep) { + var devReqs = dep.package._requiredBy.filter(function (name) { return name.substr(0, 4) === '#DEV' }) + return devReqs.length === dep.package._requiredBy.length + }).some(function (dep) { + return shrinkwrap.dependencies[dep.package.name] != null + }) + + if (!saveOptional && saveDev && !hasDevOnlyDeps) return next() + if (saveOptional || !save) return next() + + if (hasDevOnlyDeps) { + var dev = npm.config.get('dev') + npm.config.set('dev', true) + npm.commands.shrinkwrap([], true, function () { + npm.config.set('dev', dev) + next.apply(this, arguments) + }) + } else { + npm.commands.shrinkwrap([], true, next) + } + }) +} + +function savePackageJson (args, tree, next) { + validate('AOF', arguments) + var saveBundle = npm.config.get('save-bundle') + + // each item in the tree is a top-level thing that should be saved + // to the package.json file. + // The relevant tree shape is { : {what:} } + var saveTarget = path.resolve(tree.path, 'package.json') + // don't use readJson, because we don't want to do all the other + // tricky npm-specific stuff that's in there. + fs.readFile(saveTarget, iferr(next, function (packagejson) { + try { + packagejson = parseJSON(packagejson) + } catch (ex) { + return next(ex) + } + + // If we're saving bundled deps, normalize the key before we start + if (saveBundle) { + var bundle = packagejson.bundleDependencies || packagejson.bundledDependencies + delete packagejson.bundledDependencies + if (!Array.isArray(bundle)) bundle = [] + } + + var toSave = getThingsToSave(tree) + var toRemove = getThingsToRemove(args, tree) + var savingTo = {} + toSave.forEach(function (pkg) { savingTo[pkg.save] = true }) + toRemove.forEach(function (pkg) { savingTo[pkg.save] = true }) + + Object.keys(savingTo).forEach(function (save) { + if (!packagejson[save]) packagejson[save] = {} + }) + + log.verbose('saving', toSave) + toSave.forEach(function (pkg) { + packagejson[pkg.save][pkg.name] = pkg.spec + if (saveBundle) { + var ii = bundle.indexOf(pkg.name) + if (ii === -1) bundle.push(pkg.name) + } + }) + + toRemove.forEach(function (pkg) { + delete packagejson[pkg.save][pkg.name] + if (saveBundle) { + bundle = without(bundle, pkg.name) + } + }) + + Object.keys(savingTo).forEach(function (key) { + packagejson[key] = deepSortObject(packagejson[key]) + }) + if (saveBundle) { + packagejson.bundledDependencies = deepSortObject(bundle) + } + + var json = JSON.stringify(packagejson, null, 2) + '\n' + writeFileAtomic(saveTarget, json, next) + })) +} + +var getSaveType = exports.getSaveType = function (args) { + validate('A', arguments) + var nothingToSave = !args.length + var globalInstall = npm.config.get('global') + var noSaveFlags = !npm.config.get('save') && + !npm.config.get('save-dev') && + !npm.config.get('save-optional') + if (nothingToSave || globalInstall || noSaveFlags) return null + + if (npm.config.get('save-optional')) return 'optionalDependencies' + else if (npm.config.get('save-dev')) return 'devDependencies' + else return 'dependencies' +} + +function computeVersionSpec (child) { + validate('O', arguments) + var requested = child.package._requested + if (!requested || requested.type === 'tag') { + requested = { + type: 'version', + spec: child.package.version + } + } + if (requested.type === 'version' || requested.type === 'range') { + var version = child.package.version + var rangeDescriptor = '' + if (semver.valid(version, true) && + semver.gte(version, '0.1.0', true) && + !npm.config.get('save-exact')) { + rangeDescriptor = npm.config.get('save-prefix') + } + return rangeDescriptor + version + } else if (requested.type === 'directory' || requested.type === 'local') { + var relativePath = path.relative(child.parent.path, requested.spec) + if (/^[.][.]/.test(relativePath)) { + return url.format({ + protocol: 'file', + slashes: true, + pathname: requested.spec + }) + } else { + return url.format({ + protocol: 'file', + slashes: false, + pathname: relativePath + }) + } + } else if (requested.type === 'hosted') { + return requested.spec + } else { + return requested.rawSpec + } +} + +function getThingsToSave (tree) { + validate('O', arguments) + var toSave = tree.children.filter(function (child) { + return child.save + }).map(function (child) { + return { + name: moduleName(child), + spec: computeVersionSpec(child), + save: child.save + } + }) + return toSave +} + +function getThingsToRemove (args, tree) { + validate('AO', arguments) + if (!tree.removed) return [] + var toRemove = tree.removed.map(function (child) { + return { + name: moduleName(child), + save: child.save + } + }) + var saveType = getSaveType(args) + args.forEach(function (arg) { + toRemove.push({ + name: arg, + save: saveType + }) + }) + return toRemove +} diff --git a/deps/npm/lib/install/update-package-json.js b/deps/npm/lib/install/update-package-json.js new file mode 100644 index 00000000000000..97b2f05bb0fa97 --- /dev/null +++ b/deps/npm/lib/install/update-package-json.js @@ -0,0 +1,18 @@ +'use strict' +var path = require('path') +var writeFileAtomic = require('write-file-atomic') +var deepSortObject = require('../utils/deep-sort-object.js') + +module.exports = function (pkg, buildpath, next) { + // FIXME: This bundled dance is because we're sticking a big tree of bundled + // deps into the parsed package.json– it probably doesn't belong there =/ + // But the real reason we don't just dump it out is that it's the result + // of npm-read-tree, which produces circular data structures, due to the + // parent and children keys. + var bundled = pkg.package._bundled + delete pkg.package._bundled // FIXME + var packagejson = deepSortObject(pkg.package) + var data = JSON.stringify(packagejson, null, 2) + '\n' + pkg.package._bundled = bundled + writeFileAtomic(path.resolve(buildpath, 'package.json'), data, next) +} diff --git a/deps/npm/lib/install/validate-args.js b/deps/npm/lib/install/validate-args.js new file mode 100644 index 00000000000000..02c0558e4c5319 --- /dev/null +++ b/deps/npm/lib/install/validate-args.js @@ -0,0 +1,57 @@ +'use strict' +var validate = require('aproba') +var asyncMap = require('slide').asyncMap +var chain = require('slide').chain +var npmInstallChecks = require('npm-install-checks') +var iferr = require('iferr') +var checkEngine = npmInstallChecks.checkEngine +var checkPlatform = npmInstallChecks.checkPlatform +var npm = require('../npm.js') + +module.exports = function (idealTree, args, next) { + validate('OAF', arguments) + var force = npm.config.get('force') + + asyncMap(args, function (pkg, done) { + chain([ + [checkSelf, idealTree, pkg, force], + [isInstallable, pkg] + ], done) + }, next) +} + +function getWarnings (pkg) { + while (pkg.parent) pkg = pkg.parent + if (!pkg.warnings) pkg.warnings = [] + return pkg.warnings +} + +var isInstallable = module.exports.isInstallable = function (pkg, next) { + var force = npm.config.get('force') + var nodeVersion = npm.config.get('node-version') + if (/-/.test(nodeVersion)) { + // for the purposes of validation, if the node version is a prerelease, + // strip that. We check and warn about this sceanrio over in validate-tree. + nodeVersion = nodeVersion.replace(/-.*/, '') + } + var strict = npm.config.get('engine-strict') + checkEngine(pkg, npm.version, nodeVersion, force, strict, iferr(next, thenWarnEngineIssues)) + function thenWarnEngineIssues (warn) { + if (warn) getWarnings(pkg).push(warn) + checkPlatform(pkg, force, next) + } +} + +function checkSelf (idealTree, pkg, force, next) { + if (idealTree.package && idealTree.package.name !== pkg.name) return next() + if (force) { + var warn = new Error("Wouldn't install " + pkg.name + ' as a dependency of itself, but being forced') + warn.code = 'ENOSELF' + idealTree.warnings.push(warn) + next() + } else { + var er = new Error('Refusing to install ' + pkg.name + ' as a dependency of itself') + er.code = 'ENOSELF' + next(er) + } +} diff --git a/deps/npm/lib/install/validate-tree.js b/deps/npm/lib/install/validate-tree.js new file mode 100644 index 00000000000000..e89cd6fdd2db45 --- /dev/null +++ b/deps/npm/lib/install/validate-tree.js @@ -0,0 +1,77 @@ +'use strict' +var path = require('path') +var validate = require('aproba') +var asyncMap = require('slide').asyncMap +var chain = require('slide').chain +var npmInstallChecks = require('npm-install-checks') +var checkGit = npmInstallChecks.checkGit +var clone = require('lodash.clonedeep') +var normalizePackageData = require('normalize-package-data') +var npm = require('../npm.js') +var andFinishTracker = require('./and-finish-tracker.js') +var flattenTree = require('./flatten-tree.js') +var validateAllPeerDeps = require('./deps.js').validateAllPeerDeps +var packageId = require('../utils/package-id.js') + +module.exports = function (idealTree, log, next) { + validate('OOF', arguments) + var moduleMap = flattenTree(idealTree) + var modules = Object.keys(moduleMap).map(function (name) { return moduleMap[name] }) + + chain([ + [asyncMap, modules, function (mod, done) { + chain([ + mod.parent && !mod.isLink && [checkGit, mod.realpath], + [checkErrors, mod, idealTree] + ], done) + }], + [thenValidateAllPeerDeps, idealTree], + [thenCheckTop, idealTree] + ], andFinishTracker(log, next)) +} + +function checkErrors (mod, idealTree, next) { + if (mod.error && (mod.parent || path.resolve(npm.globalDir, '..') !== mod.path)) idealTree.warnings.push(mod.error) + next() +} + +function thenValidateAllPeerDeps (idealTree, next) { + validate('OF', arguments) + validateAllPeerDeps(idealTree, function (tree, pkgname, version) { + var warn = new Error(packageId(tree) + ' requires a peer of ' + pkgname + '@' + + version + ' but none was installed.') + warn.code = 'EPEERINVALID' + idealTree.warnings.push(warn) + }) + next() +} + +function thenCheckTop (idealTree, next) { + validate('OF', arguments) + if (idealTree.package.error) return next() + + // FIXME: when we replace read-package-json with something less magic, + // this should done elsewhere. + // As it is, the package has already been normalized and thus some + // errors are suppressed. + var pkg = clone(idealTree.package) + try { + normalizePackageData(pkg, function (warn) { + var warnObj = new Error(packageId(idealTree) + ' ' + warn) + warnObj.code = 'EPACKAGEJSON' + idealTree.warnings.push(warnObj) + }, false) + } catch (er) { + er.code = 'EPACKAGEJSON' + idealTree.warnings.push(er) + } + + var nodeVersion = npm.config.get('node-version') + if (/-/.test(nodeVersion)) { + // if this is a prerelease node… + var warnObj = new Error('You are using a pre-release version of node and things may not work as expected') + warnObj.code = 'ENODEPRE' + idealTree.warnings.push(warnObj) + } + next() +} diff --git a/deps/npm/lib/install/writable.js b/deps/npm/lib/install/writable.js new file mode 100644 index 00000000000000..199b48f5970688 --- /dev/null +++ b/deps/npm/lib/install/writable.js @@ -0,0 +1,35 @@ +'use strict' +var path = require('path') +var fs = require('fs') +var inflight = require('inflight') +var accessError = require('./access-error.js') +var andIgnoreErrors = require('./and-ignore-errors.js') +var isFsAccessAvailable = require('./is-fs-access-available.js') + +if (isFsAccessAvailable) { + module.exports = fsAccessImplementation +} else { + module.exports = fsOpenImplementation +} + +// exposed only for testing purposes +module.exports.fsAccessImplementation = fsAccessImplementation +module.exports.fsOpenImplementation = fsOpenImplementation + +function fsAccessImplementation (dir, done) { + done = inflight('writable:' + dir, done) + if (!done) return + fs.access(dir, fs.W_OK, done) +} + +function fsOpenImplementation (dir, done) { + done = inflight('writable:' + dir, done) + if (!done) return + var tmp = path.join(dir, '.npm.check.permissions') + fs.open(tmp, 'w', function (er, fd) { + if (er) return done(accessError(dir, er)) + fs.close(fd, function () { + fs.unlink(tmp, andIgnoreErrors(done)) + }) + }) +} diff --git a/deps/npm/lib/link.js b/deps/npm/lib/link.js index 19c5dd062906e6..7ee518419fe7af 100644 --- a/deps/npm/lib/link.js +++ b/deps/npm/lib/link.js @@ -1,20 +1,21 @@ // link with no args: symlink the folder to the global location // link with package arg: symlink the global to the local -var npm = require("./npm.js") - , symlink = require("./utils/link.js") - , fs = require("graceful-fs") - , log = require("npmlog") - , asyncMap = require("slide").asyncMap - , chain = require("slide").chain - , path = require("path") - , build = require("./build.js") - , npa = require("npm-package-arg") +var npm = require('./npm.js') +var symlink = require('./utils/link.js') +var fs = require('graceful-fs') +var log = require('npmlog') +var asyncMap = require('slide').asyncMap +var chain = require('slide').chain +var path = require('path') +var build = require('./build.js') +var npa = require('npm-package-arg') module.exports = link -link.usage = "npm link (in package dir)" - + "\nnpm link (link global into local)" +link.usage = 'npm link (in package dir)' + + '\nnpm link [<@scope>/][@]' + + '\n\nalias: npm ln' link.completion = function (opts, cb) { var dir = npm.globalDir @@ -37,30 +38,44 @@ function link (args, cb) { } } - if (npm.config.get("global")) { - return cb(new Error("link should never be --global.\n" - +"Please re-run this command with --local")) + if (npm.config.get('global')) { + return cb(new Error( + 'link should never be --global.\n' + + 'Please re-run this command with --local' + )) } - if (args.length === 1 && args[0] === ".") args = [] + if (args.length === 1 && args[0] === '.') args = [] if (args.length) return linkInstall(args, cb) linkPkg(npm.prefix, cb) } +function parentFolder (id, folder) { + if (id[0] === '@') { + return path.resolve(folder, '..', '..') + } else { + return path.resolve(folder, '..') + } +} + function linkInstall (pkgs, cb) { asyncMap(pkgs, function (pkg, cb) { - var t = path.resolve(npm.globalDir, "..") - , pp = path.resolve(npm.globalDir, pkg) - , rp = null - , target = path.resolve(npm.dir, pkg) + var t = path.resolve(npm.globalDir, '..') + var pp = path.resolve(npm.globalDir, pkg) + var rp = null + var target = path.resolve(npm.dir, pkg) function n (er, data) { if (er) return cb(er, data) - // install returns [ [folder, pkgId], ... ] - // but we definitely installed just one thing. - var d = data.filter(function (d) { return !d[3] }) - var what = npa(d[0][0]) - pp = d[0][1] + // we want the ONE thing that was installed into the global dir + var installed = data.filter(function (info) { + var id = info[0] + var folder = info[1] + return parentFolder(id, folder) === npm.globalDir + }) + var id = installed[0][0] + pp = installed[0][1] + var what = npa(id) pkg = what.name target = path.resolve(npm.dir, pkg) next() @@ -68,7 +83,7 @@ function linkInstall (pkgs, cb) { // if it's a folder, a random not-installed thing, or not a scoped package, // then link or install it first - if (pkg[0] !== "@" && (pkg.indexOf("/") !== -1 || pkg.indexOf("\\") !== -1)) { + if (pkg[0] !== '@' && (pkg.indexOf('/') !== -1 || pkg.indexOf('\\') !== -1)) { return fs.lstat(path.resolve(pkg), function (er, st) { if (er || !st.isDirectory()) { npm.commands.install(t, pkg, n) @@ -82,13 +97,13 @@ function linkInstall (pkgs, cb) { fs.lstat(pp, function (er, st) { if (er) { rp = pp - return npm.commands.install(t, pkg, n) + return npm.commands.install(t, [pkg], n) } else if (!st.isSymbolicLink()) { rp = pp next() } else { return fs.realpath(pp, function (er, real) { - if (er) log.warn("invalid symbolic link", pkg) + if (er) log.warn('invalid symbolic link', pkg) else rp = real next() }) @@ -96,39 +111,44 @@ function linkInstall (pkgs, cb) { }) function next () { - chain - ( [ [function (cb) { - log.verbose("link", "symlinking %s to %s", pp, target) - cb() - }] - , [symlink, pp, target] + if (npm.config.get('dry-run')) return resultPrinter(pkg, pp, target, rp, cb) + chain( + [ + [ function (cb) { + log.verbose('link', 'symlinking %s to %s', pp, target) + cb() + } ], + [symlink, pp, target], // do not run any scripts - , rp && [build, [target], npm.config.get("global"), build._noLC, true] - , [ resultPrinter, pkg, pp, target, rp ] ] - , cb ) + rp && [build, [target], npm.config.get('global'), build._noLC, true], + [resultPrinter, pkg, pp, target, rp] + ], + cb + ) } }, cb) } function linkPkg (folder, cb_) { var me = folder || npm.prefix - , readJson = require("read-package-json") + var readJson = require('read-package-json') - log.verbose("linkPkg", folder) + log.verbose('linkPkg', folder) - readJson(path.resolve(me, "package.json"), function (er, d) { + readJson(path.resolve(me, 'package.json'), function (er, d) { function cb (er) { return cb_(er, [[d && d._id, target, null, null]]) } if (er) return cb(er) if (!d.name) { - er = new Error("Package must have a name field to be linked") + er = new Error('Package must have a name field to be linked') return cb(er) } + if (npm.config.get('dry-run')) return resultPrinter(path.basename(me), me, target, cb) var target = path.resolve(npm.globalDir, d.name) symlink(me, target, false, true, function (er) { if (er) return cb(er) - log.verbose("link", "build target", target) + log.verbose('link', 'build target', target) // also install missing dependencies. npm.commands.install(me, [], function (er) { if (er) return cb(er) @@ -144,16 +164,21 @@ function linkPkg (folder, cb_) { } function resultPrinter (pkg, src, dest, rp, cb) { - if (typeof cb !== "function") cb = rp, rp = null + if (typeof cb !== 'function') { + cb = rp + rp = null + } var where = dest - rp = (rp || "").trim() - src = (src || "").trim() + rp = (rp || '').trim() + src = (src || '').trim() // XXX If --json is set, then look up the data from the package.json - if (npm.config.get("parseable")) { + if (npm.config.get('parseable')) { return parseableOutput(dest, rp || src, cb) } if (rp === src) rp = null - console.log(where + " -> " + src + (rp ? " -> " + rp: "")) + log.clearProgress() + console.log(where + ' -> ' + src + (rp ? ' -> ' + rp : '')) + log.showProgress() cb() } @@ -161,10 +186,12 @@ function parseableOutput (dest, rp, cb) { // XXX this should match ls --parseable and install --parseable // look up the data from package.json, format it the same way. // - // link is always effectively "long", since it doesn't help much to + // link is always effectively 'long', since it doesn't help much to // *just* print the target folder. // However, we don't actually ever read the version number, so // the second field is always blank. - console.log(dest + "::" + rp) + log.clearProgress() + console.log(dest + '::' + rp) + log.showProgress() cb() } diff --git a/deps/npm/lib/logout.js b/deps/npm/lib/logout.js index 64635be4decc4c..a3287d42d16592 100644 --- a/deps/npm/lib/logout.js +++ b/deps/npm/lib/logout.js @@ -1,39 +1,42 @@ module.exports = logout -var dezalgo = require("dezalgo") -var log = require("npmlog") +var dezalgo = require('dezalgo') +var log = require('npmlog') -var npm = require("./npm.js") -var mapToRegistry = require("./utils/map-to-registry.js") +var npm = require('./npm.js') +var mapToRegistry = require('./utils/map-to-registry.js') -logout.usage = "npm logout [--registry] [--scope]" +logout.usage = 'npm logout [--registry=] [--scope=<@scope>]' + +function afterLogout (normalized, cb) { + var scope = npm.config.get('scope') + + if (scope) npm.config.del(scope + ':registry') + + npm.config.clearCredentialsByURI(normalized) + npm.config.save('user', cb) +} function logout (args, cb) { - npm.spinner.start() cb = dezalgo(cb) - mapToRegistry("/", npm.config, function (err, uri, auth, normalized) { + mapToRegistry('/', npm.config, function (err, uri, auth, normalized) { if (err) return cb(err) if (auth.token) { - log.verbose("logout", "clearing session token for", normalized) + log.verbose('logout', 'clearing session token for', normalized) npm.registry.logout(normalized, { auth: auth }, function (err) { if (err) return cb(err) - npm.config.clearCredentialsByURI(normalized) - npm.spinner.stop() - npm.config.save("user", cb) + afterLogout(normalized, cb) }) - } - else if (auth.username || auth.password) { - log.verbose("logout", "clearing user credentials for", normalized) - npm.config.clearCredentialsByURI(normalized) - npm.spinner.stop() - npm.config.save("user", cb) - } - else { + } else if (auth.username || auth.password) { + log.verbose('logout', 'clearing user credentials for', normalized) + + afterLogout(normalized, cb) + } else { cb(new Error( - "Not logged in to", normalized + ",", "so can't log out." + 'Not logged in to', normalized + ',', "so can't log out." )) } }) diff --git a/deps/npm/lib/ls.js b/deps/npm/lib/ls.js index c7877b925e6be7..b5dc44888eeb68 100644 --- a/deps/npm/lib/ls.js +++ b/deps/npm/lib/ls.js @@ -1,4 +1,3 @@ - // show the installed versions of packages // // --parseable creates output like this: @@ -7,74 +6,102 @@ module.exports = exports = ls -var npm = require("./npm.js") - , readInstalled = require("read-installed") - , log = require("npmlog") - , path = require("path") - , archy = require("archy") - , semver = require("semver") - , url = require("url") - , color = require("ansicolors") - , npa = require("npm-package-arg") +var path = require('path') +var url = require('url') +var readPackageTree = require('read-package-tree') +var log = require('npmlog') +var archy = require('archy') +var semver = require('semver') +var color = require('ansicolors') +var npa = require('npm-package-arg') +var iferr = require('iferr') +var npm = require('./npm.js') +var mutateIntoLogicalTree = require('./install/mutate-into-logical-tree.js') +var recalculateMetadata = require('./install/deps.js').recalculateMetadata +var packageId = require('./utils/package-id.js') + +ls.usage = 'npm ls [[<@scope>/] ...]' + + '\n\naliases: list, la, ll' + +ls.completion = require('./utils/completion/installed-deep.js') -ls.usage = "npm ls" +function ls (args, silent, cb) { + if (typeof cb !== 'function') { + cb = silent + silent = false + } + var dir = path.resolve(npm.dir, '..') + readPackageTree(dir, andRecalculateMetadata(iferr(cb, function (physicalTree) { + lsFromTree(dir, physicalTree, args, silent, cb) + }))) +} -ls.completion = require("./utils/completion/installed-deep.js") +function andRecalculateMetadata (next) { + return function (er, tree) { + recalculateMetadata(tree || {}, log, next) + } +} -function ls (args, silent, cb) { - if (typeof cb !== "function") cb = silent, silent = false +function inList (list, value) { + return list.indexOf(value) !== -1 +} - var dir = path.resolve(npm.dir, "..") +var lsFromTree = ls.fromTree = function (dir, physicalTree, args, silent, cb) { + if (typeof cb !== 'function') { + cb = silent + silent = false + } // npm ls 'foo@~1.3' bar 'baz@<2' - if (!args) args = [] - else args = args.map(function (a) { - var p = npa(a) - , name = p.name - , ver = semver.validRange(p.rawSpec) || "" - - return [ name, ver ] - }) + if (!args) { + args = [] + } else { + args = args.map(function (a) { + var p = npa(a) + var name = p.name + var ver = semver.validRange(p.rawSpec) || '' + return [ name, ver, a ] + }) + } - var depth = npm.config.get("depth") - var opt = { depth: depth, log: log.warn, dev: true } - readInstalled(dir, opt, function (er, data) { - pruneNestedExtraneous(data) - filterByEnv(data) - var bfs = bfsify(data, args) - , lite = getLite(bfs) - - if (er || silent) return cb(er, data, lite) - - var long = npm.config.get("long") - , json = npm.config.get("json") - , out - if (json) { - var seen = [] - var d = long ? bfs : lite - // the raw data can be circular - out = JSON.stringify(d, function (k, o) { - if (typeof o === "object") { - if (-1 !== seen.indexOf(o)) return "[Circular]" - seen.push(o) - } - return o - }, 2) - } else if (npm.config.get("parseable")) { - out = makeParseable(bfs, long, dir) - } else if (data) { - out = makeArchy(bfs, long, dir) - } - console.log(out) + var data = mutateIntoLogicalTree.asReadInstalled(physicalTree) + + pruneNestedExtraneous(data) + filterByEnv(data) + var bfs = filterFound(bfsify(data), args) + var lite = getLite(bfs) + + if (silent) return cb(null, data, lite) + + var long = npm.config.get('long') + var json = npm.config.get('json') + var out + if (json) { + var seen = [] + var d = long ? bfs : lite + // the raw data can be circular + out = JSON.stringify(d, function (k, o) { + if (typeof o === 'object') { + if (inList(seen, o)) return '[Circular]' + seen.push(o) + } + return o + }, 2) + } else if (npm.config.get('parseable')) { + out = makeParseable(bfs, long, dir) + } else if (data) { + out = makeArchy(bfs, long, dir) + } + console.log(out) - if (args.length && !data._found) process.exitCode = 1 + if (args.length && !data._found) process.exitCode = 1 - // if any errors were found, then complain and exit status 1 - if (lite.problems && lite.problems.length) { - er = lite.problems.join("\n") - } - cb(er, data, lite) - }) + var er + // if any errors were found, then complain and exit status 1 + if (lite.problems && lite.problems.length) { + er = lite.problems.join('\n') + } + cb(er, data, lite) } function pruneNestedExtraneous (data, visited) { @@ -90,16 +117,21 @@ function pruneNestedExtraneous (data, visited) { } function filterByEnv (data) { - var dev = npm.config.get("dev") - var production = npm.config.get("production") - if (dev === production) return + var dev = npm.config.get('dev') || /^dev(elopment)?$/.test(npm.config.get('only')) + var production = npm.config.get('production') || /^prod(uction)?$/.test(npm.config.get('only')) var dependencies = {} - var devDependencies = data.devDependencies || [] + var devKeys = Object.keys(data.devDependencies || []) + var prodKeys = Object.keys(data._dependencies || []) Object.keys(data.dependencies).forEach(function (name) { - var keys = Object.keys(devDependencies) - if (production && keys.indexOf(name) !== -1) return - if (dev && keys.indexOf(name) === -1) return - dependencies[name] = data.dependencies[name] + if (!dev && inList(devKeys, name) && data.dependencies[name].missing) { + return + } + + if ((dev && inList(devKeys, name)) || // only --dev + (production && inList(prodKeys, name)) || // only --production + (!dev && !production)) { // no --production|--dev|--only=xxx + dependencies[name] = data.dependencies[name] + } }) data.dependencies = dependencies } @@ -111,59 +143,88 @@ function alphasort (a, b) { : a < b ? -1 : 0 } -function getLite (data, noname) { +function isCruft (data) { + return data.extraneous && data.error && data.error.code === 'ENOTDIR' +} + +function getLite (data, noname, depth) { var lite = {} - , maxDepth = npm.config.get("depth") + if (isCruft(data)) return lite + + var maxDepth = npm.config.get('depth') + + if (typeof depth === 'undefined') depth = 0 if (!noname && data.name) lite.name = data.name if (data.version) lite.version = data.version if (data.extraneous) { lite.extraneous = true lite.problems = lite.problems || [] - lite.problems.push( "extraneous: " - + data.name + "@" + data.version - + " " + (data.path || "") ) + lite.problems.push('extraneous: ' + packageId(data) + ' ' + (data.path || '')) } - if (data._from) + if (data.error && data.path !== path.resolve(npm.globalDir, '..') && + (data.error.code !== 'ENOENT' || noname)) { + lite.invalid = true + lite.problems = lite.problems || [] + var message = data.error.message + lite.problems.push('error in ' + data.path + ': ' + message) + } + + if (data._from) { lite.from = data._from + } - if (data._resolved) + if (data._resolved) { lite.resolved = data._resolved + } if (data.invalid) { lite.invalid = true lite.problems = lite.problems || [] - lite.problems.push( "invalid: " - + data.name + "@" + data.version - + " " + (data.path || "") ) + lite.problems.push('invalid: ' + + packageId(data) + + ' ' + (data.path || '')) } if (data.peerInvalid) { lite.peerInvalid = true lite.problems = lite.problems || [] - lite.problems.push( "peer invalid: " - + data.name + "@" + data.version - + " " + (data.path || "") ) + lite.problems.push('peer dep not met: ' + + packageId(data) + + ' ' + (data.path || '')) } - if (data.dependencies) { - var deps = Object.keys(data.dependencies) - if (deps.length) lite.dependencies = deps.map(function (d) { + var deps = (data.dependencies && Object.keys(data.dependencies)) || [] + if (deps.length) { + lite.dependencies = deps.map(function (d) { var dep = data.dependencies[d] - if (typeof dep === "string") { + if (dep.missing && !dep.optional) { lite.problems = lite.problems || [] var p if (data.depth > maxDepth) { - p = "max depth reached: " + p = 'max depth reached: ' } else { - p = "missing: " + p = 'missing: ' } - p += d + "@" + dep - + ", required by " - + data.name + "@" + data.version + p += d + '@' + dep.requiredBy + + ', required by ' + + packageId(data) lite.problems.push(p) - return [d, { required: dep, missing: true }] + return [d, { required: dep.requiredBy, missing: true }] + } else if (dep.peerMissing) { + lite.problems = lite.problems || [] + dep.peerMissing.forEach(function (missing) { + var pdm = 'peer dep missing: ' + + missing.requires + + ', required by ' + + missing.requiredBy + lite.problems.push(pdm) + }) + return [d, { required: dep, peerMissing: true }] + } else if (npm.config.get('json')) { + if (depth === maxDepth) delete dep.dependencies + return [d, getLite(dep, true, depth + 1)] } return [d, getLite(dep, true)] }).reduce(function (deps, d) { @@ -178,7 +239,7 @@ function getLite (data, noname) { return lite } -function bfsify (root, args, current, queue, seen) { +function bfsify (root) { // walk over the data, and turn it from this: // +-- a // | `-- b @@ -188,137 +249,167 @@ function bfsify (root, args, current, queue, seen) { // +-- a // `-- b // which looks nicer - args = args || [] - current = current || root - queue = queue || [] - seen = seen || [root] - var deps = current.dependencies = current.dependencies || {} - Object.keys(deps).forEach(function (d) { - var dep = deps[d] - if (typeof dep !== "object") return - if (seen.indexOf(dep) !== -1) { - if (npm.config.get("parseable") || !npm.config.get("long")) { - delete deps[d] - return - } else { - dep = deps[d] = Object.create(dep) - dep.dependencies = {} + var queue = [root] + var seen = [root] + + while (queue.length) { + var current = queue.shift() + var deps = current.dependencies = current.dependencies || {} + Object.keys(deps).forEach(function (d) { + var dep = deps[d] + if (dep.missing) return + if (inList(seen, dep)) { + if (npm.config.get('parseable') || !npm.config.get('long')) { + delete deps[d] + return + } else { + dep = deps[d] = Object.create(dep) + dep.dependencies = {} + } } - } - queue.push(dep) - seen.push(dep) - }) - - if (!queue.length) { - // if there were args, then only show the paths to found nodes. - return filterFound(root, args) + queue.push(dep) + seen.push(dep) + }) } - return bfsify(root, args, queue.shift(), queue, seen) + + return root } function filterFound (root, args) { if (!args.length) return root var deps = root.dependencies - if (deps) Object.keys(deps).forEach(function (d) { - var dep = filterFound(deps[d], args) - - // see if this one itself matches - var found = false - for (var i = 0; !found && i < args.length; i ++) { - if (d === args[i][0]) { - found = semver.satisfies(dep.version, args[i][1], true) + if (deps) { + Object.keys(deps).forEach(function (depName) { + var dep = filterFound(deps[depName], args) + if (dep.peerMissing) return + + // see if this one itself matches + var found = false + for (var ii = 0; !found && ii < args.length; ii++) { + var argName = args[ii][0] + var argVersion = args[ii][1] + var argRaw = args[ii][2] + if (depName === argName) { + found = semver.satisfies(dep.version, argVersion, true) + } else if (dep.path === argRaw) { + found = true + } } - } - // included explicitly - if (found) dep._found = true - // included because a child was included - if (dep._found && !root._found) root._found = 1 - // not included - if (!dep._found) delete deps[d] - }) + // included explicitly + if (found) dep._found = true + // included because a child was included + if (dep._found && !root._found) root._found = 1 + // not included + if (!dep._found) delete deps[depName] + }) + } if (!root._found) root._found = false return root } function makeArchy (data, long, dir) { var out = makeArchy_(data, long, dir, 0) - return archy(out, "", { unicode: npm.config.get("unicode") }) + return archy(out, '', { unicode: npm.config.get('unicode') }) } function makeArchy_ (data, long, dir, depth, parent, d) { - if (typeof data === "string") { - if (depth -1 <= npm.config.get("depth")) { + if (data.missing) { + if (depth - 1 <= npm.config.get('depth')) { // just missing - var unmet = "UNMET DEPENDENCY" + var unmet = 'UNMET ' + (data.optional ? 'OPTIONAL ' : '') + 'DEPENDENCY' if (npm.color) { - unmet = color.bgBlack(color.red(unmet)) + if (data.optional) { + unmet = color.bgBlack(color.yellow(unmet)) + } else { + unmet = color.bgBlack(color.red(unmet)) + } } - data = unmet + " " + d + "@" + data + data = unmet + ' ' + d + '@' + data.requiredBy } else { - data = d+"@"+ data + data = d + '@' + data.requiredBy } return data } var out = {} // the top level is a bit special. - out.label = data._id || "" + out.label = data._id || '' if (data._found === true && data._id) { if (npm.color) { - out.label = color.bgBlack(color.yellow(out.label.trim())) + " " + out.label = color.bgBlack(color.yellow(out.label.trim())) + ' ' } else { - out.label = out.label.trim() + " " + out.label = out.label.trim() + ' ' } } - if (data.link) out.label += " -> " + data.link + if (data.link) out.label += ' -> ' + data.link if (data.invalid) { - if (data.realName !== data.name) out.label += " ("+data.realName+")" - var invalid = "invalid" + if (data.realName !== data.name) out.label += ' (' + data.realName + ')' + var invalid = 'invalid' if (npm.color) invalid = color.bgBlack(color.red(invalid)) - out.label += " " + invalid + out.label += ' ' + invalid } if (data.peerInvalid) { - var peerInvalid = "peer invalid" + var peerInvalid = 'peer invalid' if (npm.color) peerInvalid = color.bgBlack(color.red(peerInvalid)) - out.label += " " + peerInvalid + out.label += ' ' + peerInvalid + } + + if (data.peerMissing) { + var peerMissing = 'UNMET PEER DEPENDENCY' + if (npm.color) peerMissing = color.bgBlack(color.red(peerMissing)) + out.label = peerMissing + ' ' + out.label } if (data.extraneous && data.path !== dir) { - var extraneous = "extraneous" + var extraneous = 'extraneous' if (npm.color) extraneous = color.bgBlack(color.green(extraneous)) - out.label += " " + extraneous + out.label += ' ' + extraneous + } + + if (data.error && depth) { + var message = data.error.message + if (message.indexOf('\n')) message = message.slice(0, message.indexOf('\n')) + var error = 'error: ' + message + if (npm.color) error = color.bgRed(color.brightWhite(error)) + out.label += ' ' + error } // add giturl to name@version if (data._resolved) { - var type = npa(data._resolved).type - var isGit = type === 'git' || type === 'hosted' - if (isGit) { - out.label += ' (' + data._resolved + ')' + try { + var type = npa(data._resolved).type + var isGit = type === 'git' || type === 'hosted' + if (isGit) { + out.label += ' (' + data._resolved + ')' + } + } catch (ex) { + // npa threw an exception then it ain't git so whatev } } if (long) { - if (dir === data.path) out.label += "\n" + dir - out.label += "\n" + getExtras(data, dir) + if (dir === data.path) out.label += '\n' + dir + out.label += '\n' + getExtras(data, dir) } else if (dir === data.path) { - if (out.label) out.label += " " + if (out.label) out.label += ' ' out.label += dir } // now all the children. out.nodes = [] - if (depth <= npm.config.get("depth")) { + if (depth <= npm.config.get('depth')) { out.nodes = Object.keys(data.dependencies || {}) - .sort(alphasort).map(function (d) { + .sort(alphasort).filter(function (d) { + return !isCruft(data.dependencies[d]) + }).map(function (d) { return makeArchy_(data.dependencies[d], long, dir, depth + 1, data, d) }) } if (out.nodes.length === 0 && data.path === dir) { - out.nodes = ["(empty)"] + out.nodes = ['(empty)'] } return out @@ -332,55 +423,56 @@ function getExtras (data) { if (data.homepage) extras.push(data.homepage) if (data._from) { var from = data._from - if (from.indexOf(data.name + "@") === 0) { + if (from.indexOf(data.name + '@') === 0) { from = from.substr(data.name.length + 1) } var u = url.parse(from) if (u.protocol) extras.push(from) } - return extras.join("\n") + return extras.join('\n') } - function makeParseable (data, long, dir, depth, parent, d) { depth = depth || 0 - + if (depth > npm.config.get('depth')) return [ makeParseable_(data, long, dir, depth, parent, d) ] return [ makeParseable_(data, long, dir, depth, parent, d) ] .concat(Object.keys(data.dependencies || {}) .sort(alphasort).map(function (d) { return makeParseable(data.dependencies[d], long, dir, depth + 1, data, d) })) .filter(function (x) { return x }) - .join("\n") + .join('\n') } function makeParseable_ (data, long, dir, depth, parent, d) { - if (data.hasOwnProperty("_found") && data._found !== true) return "" - - if (typeof data === "string") { - if (data.depth < npm.config.get("depth")) { - data = npm.config.get("long") - ? path.resolve(parent.path, "node_modules", d) - + ":"+d+"@"+JSON.stringify(data)+":INVALID:MISSING" - : "" + if (data.hasOwnProperty('_found') && data._found !== true) return '' + + if (data.missing) { + if (depth < npm.config.get('depth')) { + data = npm.config.get('long') + ? path.resolve(parent.path, 'node_modules', d) + + ':' + d + '@' + JSON.stringify(data.requiredBy) + ':INVALID:MISSING' + : '' } else { - data = path.resolve(data.path || "", "node_modules", d || "") - + (npm.config.get("long") - ? ":" + d + "@" + JSON.stringify(data) - + ":" // no realpath resolved - + ":MAXDEPTH" - : "") + data = path.resolve(dir || '', 'node_modules', d || '') + + (npm.config.get('long') + ? ':' + d + '@' + JSON.stringify(data.requiredBy) + + ':' + // no realpath resolved + ':MAXDEPTH' + : '') } return data } - if (!npm.config.get("long")) return data.path + if (!npm.config.get('long')) return data.path - return data.path - + ":" + (data._id || "") - + ":" + (data.realPath !== data.path ? data.realPath : "") - + (data.extraneous ? ":EXTRANEOUS" : "") - + (data.invalid ? ":INVALID" : "") - + (data.peerInvalid ? ":PEERINVALID" : "") + return data.path + + ':' + (data._id || '') + + ':' + (data.realPath !== data.path ? data.realPath : '') + + (data.extraneous ? ':EXTRANEOUS' : '') + + (data.error && data.path !== path.resolve(npm.globalDir, '..') ? ':ERROR' : '') + + (data.invalid ? ':INVALID' : '') + + (data.peerInvalid ? ':PEERINVALID' : '') + + (data.peerMissing ? ':PEERINVALID:MISSING' : '') } diff --git a/deps/npm/lib/npm.js b/deps/npm/lib/npm.js index c049d95ba6e24b..4d451650635413 100644 --- a/deps/npm/lib/npm.js +++ b/deps/npm/lib/npm.js @@ -1,469 +1,394 @@ -;(function(){ -// windows: running "npm blah" in this folder will invoke WSH, not node. -if (typeof WScript !== "undefined") { - WScript.echo("npm does not work when run\n" - +"with the Windows Scripting Host\n\n" - +"'cd' to a different directory,\n" - +"or type 'npm.cmd ',\n" - +"or type 'node npm '.") - WScript.quit(1) - return -} - - -var EventEmitter = require("events").EventEmitter - , npm = module.exports = new EventEmitter() - , npmconf = require("./config/core.js") - , log = require("npmlog") - , gfs = require('graceful-fs') - , fs = gfs.gracefulify(require('fs')) - , path = require("path") - , abbrev = require("abbrev") - , which = require("which") - , CachingRegClient = require("./cache/caching-client.js") - , charSpin = require("char-spinner") - -npm.config = { - loaded: false, - get: function() { - throw new Error('npm.load() required') - }, - set: function() { - throw new Error('npm.load() required') +;(function () { + // windows: running 'npm blah' in this folder will invoke WSH, not node. + /*globals WScript*/ + if (typeof WScript !== 'undefined') { + WScript.echo( + 'npm does not work when run\n' + + 'with the Windows Scripting Host\n\n' + + '"cd" to a different directory,\n' + + 'or type "npm.cmd ",\n' + + 'or type "node npm ".' + ) + WScript.quit(1) + return } -} -npm.commands = {} + var gfs = require('graceful-fs') + // Patch the global fs module here at the app level + var fs = gfs.gracefulify(require('fs')) + + var EventEmitter = require('events').EventEmitter + var npm = module.exports = new EventEmitter() + var npmconf = require('./config/core.js') + var log = require('npmlog') + + var path = require('path') + var abbrev = require('abbrev') + var which = require('which') + var CachingRegClient = require('./cache/caching-client.js') + var parseJSON = require('./utils/parse-json.js') + var aliases = require('./config/cmd-list').aliases + var cmdList = require('./config/cmd-list').cmdList + var plumbing = require('./config/cmd-list').plumbing + + npm.config = { + loaded: false, + get: function () { + throw new Error('npm.load() required') + }, + set: function () { + throw new Error('npm.load() required') + } + } -npm.rollbacks = [] + npm.commands = {} + + npm.rollbacks = [] -try { - // startup, ok to do this synchronously - var j = JSON.parse(fs.readFileSync( - path.join(__dirname, "../package.json"))+"") - npm.version = j.version -} catch (ex) { try { - log.info("error reading version", ex) - } catch (er) {} - npm.version = ex -} - -var commandCache = {} - // short names for common things - , aliases = { "rm" : "uninstall" - , "r" : "uninstall" - , "un" : "uninstall" - , "unlink" : "uninstall" - , "remove" : "uninstall" - , "rb" : "rebuild" - , "list" : "ls" - , "la" : "ls" - , "ll" : "ls" - , "ln" : "link" - , "i" : "install" - , "isntall" : "install" - , "up" : "update" - , "upgrade" : "update" - , "c" : "config" - , "dist-tags" : "dist-tag" - , "info" : "view" - , "show" : "view" - , "find" : "search" - , "s" : "search" - , "se" : "search" - , "author" : "owner" - , "home" : "docs" - , "issues": "bugs" - , "unstar": "star" // same function - , "apihelp" : "help" - , "login": "adduser" - , "add-user": "adduser" - , "tst": "test" - , "t": "test" - , "find-dupes": "dedupe" - , "ddp": "dedupe" - , "v": "view" - , "verison": "version" - } - - , aliasNames = Object.keys(aliases) - // these are filenames in . - , cmdList = [ "install" - , "uninstall" - , "cache" - , "config" - , "set" - , "get" - , "update" - , "outdated" - , "prune" - , "pack" - , "dedupe" - - , "rebuild" - , "link" - - , "publish" - , "star" - , "stars" - , "tag" - , "adduser" - , "logout" - , "unpublish" - , "owner" - , "access" - , "team" - , "deprecate" - , "shrinkwrap" - - , "help" - , "help-search" - , "ls" - , "search" - , "view" - , "init" - , "version" - , "edit" - , "explore" - , "docs" - , "repo" - , "bugs" - , "faq" - , "root" - , "prefix" - , "bin" - , "whoami" - , "dist-tag" - , "ping" - - , "test" - , "stop" - , "start" - , "restart" - , "run-script" - , "completion" - ] - , plumbing = [ "build" - , "unbuild" - , "xmas" - , "substack" - , "visnup" - ] - , littleGuys = [ "isntall" ] - , fullList = cmdList.concat(aliasNames).filter(function (c) { - return plumbing.indexOf(c) === -1 - }) - , abbrevs = abbrev(fullList) - -// we have our reasons -fullList = npm.fullList = fullList.filter(function (c) { - return littleGuys.indexOf(c) === -1 -}) - -npm.spinner = - { int: null - , started: false - , start: function () { - if (npm.spinner.int) return - var c = npm.config.get("spin") - if (!c) return - var stream = npm.config.get("logstream") - var opt = { tty: c !== "always", stream: stream } - opt.cleanup = !npm.spinner.started - npm.spinner.int = charSpin(opt) - npm.spinner.started = true - } - , stop: function () { - clearInterval(npm.spinner.int) - npm.spinner.int = null - } + // startup, ok to do this synchronously + var j = parseJSON(fs.readFileSync( + path.join(__dirname, '../package.json')) + '') + npm.version = j.version + } catch (ex) { + try { + log.info('error reading version', ex) + } catch (er) {} + npm.version = ex } -Object.keys(abbrevs).concat(plumbing).forEach(function addCommand (c) { - Object.defineProperty(npm.commands, c, { get : function () { - if (!loaded) throw new Error( - "Call npm.load(config, cb) before using this command.\n"+ - "See the README.md or cli.js for example usage.") - var a = npm.deref(c) - if (c === "la" || c === "ll") { - npm.config.set("long", true) - } + var commandCache = {} + var aliasNames = Object.keys(aliases) - npm.command = c - if (commandCache[a]) return commandCache[a] + var littleGuys = [ 'isntall', 'verison' ] + var fullList = cmdList.concat(aliasNames).filter(function (c) { + return plumbing.indexOf(c) === -1 + }) + var abbrevs = abbrev(fullList) - var cmd = require(__dirname+"/"+a+".js") + // we have our reasons + fullList = npm.fullList = fullList.filter(function (c) { + return littleGuys.indexOf(c) === -1 + }) - commandCache[a] = function () { - var args = Array.prototype.slice.call(arguments, 0) - if (typeof args[args.length - 1] !== "function") { - args.push(defaultCb) + Object.keys(abbrevs).concat(plumbing).forEach(function addCommand (c) { + Object.defineProperty(npm.commands, c, { get: function () { + if (!loaded) { + throw new Error( + 'Call npm.load(config, cb) before using this command.\n' + + 'See the README.md or cli.js for example usage.' + ) } - if (args.length === 1) args.unshift([]) - - npm.registry.version = npm.version - if (!npm.registry.refer) { - npm.registry.refer = [a].concat(args[0]).map(function (arg) { - // exclude anything that might be a URL, path, or private module - // Those things will always have a slash in them somewhere - if (arg && arg.match && arg.match(/\/|\\/)) { - return "[REDACTED]" - } else { - return arg - } - }).filter(function (arg) { - return arg && arg.match - }).join(" ") + var a = npm.deref(c) + if (c === 'la' || c === 'll') { + npm.config.set('long', true) } - cmd.apply(npm, args) - } + npm.command = c + if (commandCache[a]) return commandCache[a] + + var cmd = require(__dirname + '/' + a + '.js') + + commandCache[a] = function () { + var args = Array.prototype.slice.call(arguments, 0) + if (typeof args[args.length - 1] !== 'function') { + args.push(defaultCb) + } + if (args.length === 1) args.unshift([]) + + npm.registry.version = npm.version + if (!npm.registry.refer) { + npm.registry.refer = [a].concat(args[0]).map(function (arg) { + // exclude anything that might be a URL, path, or private module + // Those things will always have a slash in them somewhere + if (arg && arg.match && arg.match(/\/|\\/)) { + return '[REDACTED]' + } else { + return arg + } + }).filter(function (arg) { + return arg && arg.match + }).join(' ') + } + + cmd.apply(npm, args) + } - Object.keys(cmd).forEach(function (k) { - commandCache[a][k] = cmd[k] - }) + Object.keys(cmd).forEach(function (k) { + commandCache[a][k] = cmd[k] + }) - return commandCache[a] - }, enumerable: fullList.indexOf(c) !== -1, configurable: true }) + return commandCache[a] + }, enumerable: fullList.indexOf(c) !== -1, configurable: true }) - // make css-case commands callable via camelCase as well - if (c.match(/\-([a-z])/)) { - addCommand(c.replace(/\-([a-z])/g, function (a, b) { - return b.toUpperCase() - })) - } -}) + // make css-case commands callable via camelCase as well + if (c.match(/\-([a-z])/)) { + addCommand(c.replace(/\-([a-z])/g, function (a, b) { + return b.toUpperCase() + })) + } + }) -function defaultCb (er, data) { - if (er) console.error(er.stack || er.message) - else console.log(data) -} + function defaultCb (er, data) { + log.disableProgress() + if (er) console.error(er.stack || er.message) + else console.log(data) + } -npm.deref = function (c) { - if (!c) return "" - if (c.match(/[A-Z]/)) c = c.replace(/([A-Z])/g, function (m) { - return "-" + m.toLowerCase() - }) - if (plumbing.indexOf(c) !== -1) return c - var a = abbrevs[c] - if (aliases[a]) a = aliases[a] - return a -} - -var loaded = false - , loading = false - , loadErr = null - , loadListeners = [] - -function loadCb (er) { - loadListeners.forEach(function (cb) { - process.nextTick(cb.bind(npm, er, npm)) - }) - loadListeners.length = 0 -} - -npm.load = function (cli, cb_) { - if (!cb_ && typeof cli === "function") cb_ = cli , cli = {} - if (!cb_) cb_ = function () {} - if (!cli) cli = {} - loadListeners.push(cb_) - if (loaded || loadErr) return cb(loadErr) - if (loading) return - loading = true - var onload = true - - function cb (er) { - if (loadErr) return - loadErr = er - if (er) return cb_(er) - if (npm.config.get("force")) { - log.warn("using --force", "I sure hope you know what you are doing.") - } - npm.config.loaded = true - loaded = true - loadCb(loadErr = er) - if (onload = onload && npm.config.get("onload-script")) { - require(onload) - onload = false + npm.deref = function (c) { + if (!c) return '' + if (c.match(/[A-Z]/)) { + c = c.replace(/([A-Z])/g, function (m) { + return '-' + m.toLowerCase() + }) } + if (plumbing.indexOf(c) !== -1) return c + var a = abbrevs[c] + if (aliases[a]) a = aliases[a] + return a } - log.pause() + var loaded = false + var loading = false + var loadErr = null + var loadListeners = [] - load(npm, cli, cb) -} + function loadCb (er) { + loadListeners.forEach(function (cb) { + process.nextTick(cb.bind(npm, er, npm)) + }) + loadListeners.length = 0 + } -function load (npm, cli, cb) { - which(process.argv[0], function (er, node) { - if (!er && node.toUpperCase() !== process.execPath.toUpperCase()) { - log.verbose("node symlink", node) - process.execPath = node - process.installPrefix = path.resolve(node, "..", "..") + npm.load = function (cli, cb_) { + if (!cb_ && typeof cli === 'function') { + cb_ = cli + cli = {} } - - // look up configs - //console.error("about to look up configs") - - var builtin = path.resolve(__dirname, "..", "npmrc") - npmconf.load(cli, builtin, function (er, config) { - if (er === config) er = null - - npm.config = config - if (er) return cb(er) - - // if the "project" config is not a filename, and we're - // not in global mode, then that means that it collided - // with either the default or effective userland config - if (!config.get("global") - && config.sources.project - && config.sources.project.type !== "ini") { - log.verbose("config" - , "Skipping project config: %s. " - + "(matches userconfig)" - , config.localPrefix + "/.npmrc") + if (!cb_) cb_ = function () {} + if (!cli) cli = {} + loadListeners.push(cb_) + if (loaded || loadErr) return cb(loadErr) + if (loading) return + loading = true + var onload = true + + function cb (er) { + if (loadErr) return + loadErr = er + if (er) return cb_(er) + if (npm.config.get('force')) { + log.warn('using --force', 'I sure hope you know what you are doing.') } - - // Include npm-version and node-version in user-agent - var ua = config.get("user-agent") || "" - ua = ua.replace(/\{node-version\}/gi, process.version) - ua = ua.replace(/\{npm-version\}/gi, npm.version) - ua = ua.replace(/\{platform\}/gi, process.platform) - ua = ua.replace(/\{arch\}/gi, process.arch) - config.set("user-agent", ua) - - var color = config.get("color") - - log.level = config.get("loglevel") - log.heading = config.get("heading") || "npm" - log.stream = config.get("logstream") - - switch (color) { - case "always": - log.enableColor() - npm.color = true - break - case false: - log.disableColor() - npm.color = false - break - default: - var tty = require("tty") - if (process.stdout.isTTY) npm.color = true - else if (!tty.isatty) npm.color = true - else if (tty.isatty(1)) npm.color = true - else npm.color = false - break + npm.config.loaded = true + loaded = true + loadCb(loadErr = er) + onload = onload && npm.config.get('onload-script') + if (onload) { + try { + require(onload) + } catch (err) { + log.warn('onload-script', 'failed to require onload script', onload) + log.warn('onload-script', err) + } + onload = false } + } - log.resume() - - // at this point the configs are all set. - // go ahead and spin up the registry client. - npm.registry = new CachingRegClient(npm.config) - - var umask = npm.config.get("umask") - npm.modes = { exec: 0777 & (~umask) - , file: 0666 & (~umask) - , umask: umask } + log.pause() - var gp = Object.getOwnPropertyDescriptor(config, "globalPrefix") - Object.defineProperty(npm, "globalPrefix", gp) + load(npm, cli, cb) + } - var lp = Object.getOwnPropertyDescriptor(config, "localPrefix") - Object.defineProperty(npm, "localPrefix", lp) + function load (npm, cli, cb) { + which(process.argv[0], function (er, node) { + if (!er && node.toUpperCase() !== process.execPath.toUpperCase()) { + log.verbose('node symlink', node) + process.execPath = node + process.installPrefix = path.resolve(node, '..', '..') + } - return cb(null, npm) + // look up configs + var builtin = path.resolve(__dirname, '..', 'npmrc') + npmconf.load(cli, builtin, function (er, config) { + if (er === config) er = null + + npm.config = config + if (er) return cb(er) + + // if the 'project' config is not a filename, and we're + // not in global mode, then that means that it collided + // with either the default or effective userland config + if (!config.get('global') && + config.sources.project && + config.sources.project.type !== 'ini') { + log.verbose( + 'config', + 'Skipping project config: %s. (matches userconfig)', + config.localPrefix + '/.npmrc' + ) + } + + // Include npm-version and node-version in user-agent + var ua = config.get('user-agent') || '' + ua = ua.replace(/\{node-version\}/gi, process.version) + ua = ua.replace(/\{npm-version\}/gi, npm.version) + ua = ua.replace(/\{platform\}/gi, process.platform) + ua = ua.replace(/\{arch\}/gi, process.arch) + config.set('user-agent', ua) + + var color = config.get('color') + + log.level = config.get('loglevel') + log.heading = config.get('heading') || 'npm' + log.stream = config.get('logstream') + + switch (color) { + case 'always': + log.enableColor() + npm.color = true + break + case false: + log.disableColor() + npm.color = false + break + default: + var tty = require('tty') + if (process.stdout.isTTY) npm.color = true + else if (!tty.isatty) npm.color = true + else if (tty.isatty(1)) npm.color = true + else npm.color = false + break + } + + log.resume() + + if (config.get('progress')) { + log.enableProgress() + } else { + log.disableProgress() + } + + if (config.get('unicode')) { + log.enableUnicode() + } else { + log.disableUnicode() + } + + // at this point the configs are all set. + // go ahead and spin up the registry client. + npm.registry = new CachingRegClient(npm.config) + + var umask = npm.config.get('umask') + npm.modes = { + exec: parseInt('0777', 8) & (~umask), + file: parseInt('0666', 8) & (~umask), + umask: umask + } + + var gp = Object.getOwnPropertyDescriptor(config, 'globalPrefix') + Object.defineProperty(npm, 'globalPrefix', gp) + + var lp = Object.getOwnPropertyDescriptor(config, 'localPrefix') + Object.defineProperty(npm, 'localPrefix', lp) + + return cb(null, npm) + }) }) - }) -} + } -Object.defineProperty(npm, "prefix", - { get : function () { - return npm.config.get("global") ? npm.globalPrefix : npm.localPrefix - } - , set : function (r) { - var k = npm.config.get("global") ? "globalPrefix" : "localPrefix" - return npm[k] = r - } - , enumerable : true - }) + Object.defineProperty(npm, 'prefix', + { + get: function () { + return npm.config.get('global') ? npm.globalPrefix : npm.localPrefix + }, + set: function (r) { + var k = npm.config.get('global') ? 'globalPrefix' : 'localPrefix' + npm[k] = r + return r + }, + enumerable: true + }) -Object.defineProperty(npm, "bin", - { get : function () { - if (npm.config.get("global")) return npm.globalBin - return path.resolve(npm.root, ".bin") - } - , enumerable : true - }) + Object.defineProperty(npm, 'bin', + { + get: function () { + if (npm.config.get('global')) return npm.globalBin + return path.resolve(npm.root, '.bin') + }, + enumerable: true + }) -Object.defineProperty(npm, "globalBin", - { get : function () { - var b = npm.globalPrefix - if (process.platform !== "win32") b = path.resolve(b, "bin") - return b - } - }) + Object.defineProperty(npm, 'globalBin', + { + get: function () { + var b = npm.globalPrefix + if (process.platform !== 'win32') b = path.resolve(b, 'bin') + return b + } + }) -Object.defineProperty(npm, "dir", - { get : function () { - if (npm.config.get("global")) return npm.globalDir - return path.resolve(npm.prefix, "node_modules") - } - , enumerable : true - }) + Object.defineProperty(npm, 'dir', + { + get: function () { + if (npm.config.get('global')) return npm.globalDir + return path.resolve(npm.prefix, 'node_modules') + }, + enumerable: true + }) -Object.defineProperty(npm, "globalDir", - { get : function () { - return (process.platform !== "win32") - ? path.resolve(npm.globalPrefix, "lib", "node_modules") - : path.resolve(npm.globalPrefix, "node_modules") - } - , enumerable : true - }) + Object.defineProperty(npm, 'globalDir', + { + get: function () { + return (process.platform !== 'win32') + ? path.resolve(npm.globalPrefix, 'lib', 'node_modules') + : path.resolve(npm.globalPrefix, 'node_modules') + }, + enumerable: true + }) -Object.defineProperty(npm, "root", - { get : function () { return npm.dir } }) + Object.defineProperty(npm, 'root', + { get: function () { return npm.dir } }) -Object.defineProperty(npm, "cache", - { get : function () { return npm.config.get("cache") } - , set : function (r) { return npm.config.set("cache", r) } - , enumerable : true - }) + Object.defineProperty(npm, 'cache', + { get: function () { return npm.config.get('cache') }, + set: function (r) { return npm.config.set('cache', r) }, + enumerable: true + }) -var tmpFolder -var rand = require("crypto").randomBytes(4).toString("hex") -Object.defineProperty(npm, "tmp", - { get : function () { - if (!tmpFolder) tmpFolder = "npm-" + process.pid + "-" + rand - return path.resolve(npm.config.get("tmp"), tmpFolder) - } - , enumerable : true - }) + var tmpFolder + var rand = require('crypto').randomBytes(4).toString('hex') + Object.defineProperty(npm, 'tmp', + { + get: function () { + if (!tmpFolder) tmpFolder = 'npm-' + process.pid + '-' + rand + return path.resolve(npm.config.get('tmp'), tmpFolder) + }, + enumerable: true + }) -// the better to repl you with -Object.getOwnPropertyNames(npm.commands).forEach(function (n) { - if (npm.hasOwnProperty(n) || n === "config") return + // the better to repl you with + Object.getOwnPropertyNames(npm.commands).forEach(function (n) { + if (npm.hasOwnProperty(n) || n === 'config') return - Object.defineProperty(npm, n, { get: function () { - return function () { - var args = Array.prototype.slice.call(arguments, 0) - , cb = defaultCb + Object.defineProperty(npm, n, { get: function () { + return function () { + var args = Array.prototype.slice.call(arguments, 0) + var cb = defaultCb - if (args.length === 1 && Array.isArray(args[0])) { - args = args[0] - } + if (args.length === 1 && Array.isArray(args[0])) { + args = args[0] + } - if (typeof args[args.length - 1] === "function") { - cb = args.pop() + if (typeof args[args.length - 1] === 'function') { + cb = args.pop() + } + npm.commands[n](args, cb) } + }, enumerable: false, configurable: true }) + }) - npm.commands[n](args, cb) - } - }, enumerable: false, configurable: true }) -}) - -if (require.main === module) { - require("../bin/npm-cli.js") -} + if (require.main === module) { + require('../bin/npm-cli.js') + } })() diff --git a/deps/npm/lib/outdated.js b/deps/npm/lib/outdated.js index ab49d109690ee6..50bdb363d1cdaf 100644 --- a/deps/npm/lib/outdated.js +++ b/deps/npm/lib/outdated.js @@ -16,97 +16,130 @@ packages. module.exports = outdated -outdated.usage = "npm outdated [ [ ...]]" - -outdated.completion = require("./utils/completion/installed-deep.js") - - -var path = require("path") - , readJson = require("read-package-json") - , cache = require("./cache.js") - , asyncMap = require("slide").asyncMap - , npm = require("./npm.js") - , url = require("url") - , color = require("ansicolors") - , styles = require("ansistyles") - , table = require("text-table") - , semver = require("semver") - , os = require("os") - , mapToRegistry = require("./utils/map-to-registry.js") - , npa = require("npm-package-arg") - , readInstalled = require("read-installed") - , long = npm.config.get("long") - , log = require("npmlog") +outdated.usage = 'npm outdated [[<@scope>/] ...]' + +outdated.completion = require('./utils/completion/installed-deep.js') + +var os = require('os') +var url = require('url') +var path = require('path') +var log = require('npmlog') +var readPackageTree = require('read-package-tree') +var readJson = require('read-package-json') +var asyncMap = require('slide').asyncMap +var color = require('ansicolors') +var styles = require('ansistyles') +var table = require('text-table') +var semver = require('semver') +var npa = require('npm-package-arg') +var mutateIntoLogicalTree = require('./install/mutate-into-logical-tree.js') +var cache = require('./cache.js') +var npm = require('./npm.js') +var long = npm.config.get('long') +var mapToRegistry = require('./utils/map-to-registry.js') +var isExtraneous = require('./install/is-extraneous.js') +var recalculateMetadata = require('./install/deps.js').recalculateMetadata +var moduleName = require('./utils/module-name.js') + +function uniqName (item) { + return item[0].path + '|' + item[1] + '|' + item[7] +} + +function uniq (list) { + var uniqed = [] + var seen = {} + list.forEach(function (item) { + var name = uniqName(item) + if (seen[name]) return + seen[name] = true + uniqed.push(item) + }) + return uniqed +} + +function andRecalculateMetadata (next) { + return function (er, tree) { + if (er) return next(er) + recalculateMetadata(tree, log, next) + } +} function outdated (args, silent, cb) { - if (typeof cb !== "function") cb = silent, silent = false - var dir = path.resolve(npm.dir, "..") + if (typeof cb !== 'function') { + cb = silent + silent = false + } + var dir = path.resolve(npm.dir, '..') // default depth for `outdated` is 0 (cf. `ls`) - if (npm.config.get("depth") === Infinity) npm.config.set("depth", 0) - - outdated_(args, dir, {}, 0, function (er, list) { - if (!list) list = [] - if (er || silent || list.length === 0) return cb(er, list) - list.sort(function(a, b) { - var aa = a[1].toLowerCase() - , bb = b[1].toLowerCase() - return aa === bb ? 0 - : aa < bb ? -1 : 1 - }) - if (npm.config.get("json")) { - console.log(makeJSON(list)) - } else if (npm.config.get("parseable")) { - console.log(makeParseable(list)) - } else { - var outList = list.map(makePretty) - var outHead = [ "Package" - , "Current" - , "Wanted" - , "Latest" - , "Location" - ] - if (long) outHead.push("Package Type") - var outTable = [outHead].concat(outList) - - if (npm.color) { - outTable[0] = outTable[0].map(function(heading) { - return styles.underline(heading) - }) - } + if (npm.config.get('depth') === Infinity) npm.config.set('depth', 0) + + readPackageTree(dir, andRecalculateMetadata(function (er, tree) { + mutateIntoLogicalTree(tree) + outdated_(args, '', tree, {}, 0, function (er, list) { + list = uniq(list || []).sort(function (aa, bb) { + return aa[0].path.localeCompare(bb[0].path) || + aa[1].localeCompare(bb[1]) + }) + if (er || silent || list.length === 0) return cb(er, list) + log.disableProgress() + if (npm.config.get('json')) { + console.log(makeJSON(list)) + } else if (npm.config.get('parseable')) { + console.log(makeParseable(list)) + } else { + var outList = list.map(makePretty) + var outHead = [ 'Package', + 'Current', + 'Wanted', + 'Latest', + 'Location' + ] + if (long) outHead.push('Package Type') + var outTable = [outHead].concat(outList) + + if (npm.color) { + outTable[0] = outTable[0].map(function (heading) { + return styles.underline(heading) + }) + } - var tableOpts = { align: ["l", "r", "r", "r", "l"] - , stringLength: function(s) { return ansiTrim(s).length } - } - console.log(table(outTable, tableOpts)) - } - cb(null, list) - }) + var tableOpts = { + align: ['l', 'r', 'r', 'r', 'l'], + stringLength: function (s) { return ansiTrim(s).length } + } + console.log(table(outTable, tableOpts)) + } + cb(null, list.map(function (item) { return [item[0].parent.path].concat(item.slice(1, 7)) })) + }) + })) } // [[ dir, dep, has, want, latest, type ]] function makePretty (p) { - var dep = p[1] - , dir = path.resolve(p[0], "node_modules", dep) - , has = p[2] - , want = p[3] - , latest = p[4] - , type = p[6] - - if (!npm.config.get("global")) { + var dep = p[0] + var depname = p[1] + var dir = dep.path + var has = p[2] + var want = p[3] + var latest = p[4] + var type = p[6] + var deppath = p[7] + + if (!npm.config.get('global')) { dir = path.relative(process.cwd(), dir) } - var columns = [ dep - , has || "MISSING" - , want - , latest - , dirToPrettyLocation(dir) + var columns = [ depname, + has || 'MISSING', + want, + latest, + deppath ] if (long) columns[5] = type if (npm.color) { - columns[0] = color[has === want ? "yellow" : "red"](columns[0]) // dep + columns[0] = color[has === want || want === 'linked' ? 'yellow' : 'red'](columns[0]) // dep columns[2] = color.green(columns[2]) // want columns[3] = color.magenta(columns[3]) // latest columns[4] = color.brightBlack(columns[4]) // dir @@ -117,171 +150,162 @@ function makePretty (p) { } function ansiTrim (str) { - var r = new RegExp("\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|" + - "\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)", "g") - return str.replace(r, "") -} - -function dirToPrettyLocation (dir) { - return dir.replace(/^node_modules[/\\]/, "") - .replace(/[[/\\]node_modules[/\\]/g, " > ") + var r = new RegExp('\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|' + + '\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)', 'g') + return str.replace(r, '') } function makeParseable (list) { return list.map(function (p) { - - var dep = p[1] - , dir = path.resolve(p[0], "node_modules", dep) - , has = p[2] - , want = p[3] - , latest = p[4] - , type = p[6] - - var out = [ dir - , dep + "@" + want - , (has ? (dep + "@" + has) : "MISSING") - , dep + "@" + latest - ] - if (long) out.push(type) - - return out.join(":") + var dep = p[0] + var depname = p[1] + var dir = dep.path + var has = p[2] + var want = p[3] + var latest = p[4] + var type = p[6] + + var out = [ + dir, + depname + '@' + want, + (has ? (depname + '@' + has) : 'MISSING'), + depname + '@' + latest + ] + if (long) out.push(type) + + return out.join(':') }).join(os.EOL) } function makeJSON (list) { var out = {} list.forEach(function (p) { - var dir = path.resolve(p[0], "node_modules", p[1]) - if (!npm.config.get("global")) { + var dep = p[0] + var depname = p[1] + var dir = dep.path + var has = p[2] + var want = p[3] + var latest = p[4] + var type = p[6] + if (!npm.config.get('global')) { dir = path.relative(process.cwd(), dir) } - out[p[1]] = { current: p[2] - , wanted: p[3] - , latest: p[4] - , location: dir + out[depname] = { current: has, + wanted: want, + latest: latest, + location: dir } - if (long) out[p[1]].type = p[6] + if (long) out[depname].type = type }) return JSON.stringify(out, null, 2) } -function outdated_ (args, dir, parentHas, depth, cb) { - // get the deps from package.json, or {:"*"} - // asyncMap over deps: - // shouldHave = cache.add(dep, req).version - // if has === shouldHave then - // return outdated(args, dir/node_modules/dep, parentHas + has) - // else if dep in args or args is empty - // return [dir, dep, has, shouldHave] - - if (depth > npm.config.get("depth")) { +function outdated_ (args, path, tree, parentHas, depth, cb) { + if (!tree.package) tree.package = {} + if (path && tree.package.name) path += ' > ' + tree.package.name + if (!path && tree.package.name) path = tree.package.name + if (depth > npm.config.get('depth')) { return cb(null, []) } - var deps = null var types = {} - readJson(path.resolve(dir, "package.json"), function (er, d) { - d = d || {} - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) - deps = (er) ? true : (d.dependencies || {}) - if (!er) { - Object.keys(deps).forEach(function (k) { - types[k] = "dependencies" - }) - } - - if (npm.config.get("save-dev")) { - deps = d.devDependencies || {} - Object.keys(deps).forEach(function (k) { - types[k] = "devDependencies" - }) - - return next() - } - - if (npm.config.get("save")) { - // remove optional dependencies from dependencies during --save. - Object.keys(d.optionalDependencies || {}).forEach(function (k) { - delete deps[k] - }) - return next() - } - - if (npm.config.get("save-optional")) { - deps = d.optionalDependencies || {} - Object.keys(deps).forEach(function (k) { - types[k] = "optionalDependencies" - }) - return next() - } + var pkg = tree.package - var doUpdate = npm.config.get("dev") || - (!npm.config.get("production") && - !Object.keys(parentHas).length && - !npm.config.get("global")) + var deps = tree.children.filter(function (child) { return !isExtraneous(child) }) || [] - if (!er && d && doUpdate) { - Object.keys(d.devDependencies || {}).forEach(function (k) { - if (!(k in parentHas)) { - deps[k] = d.devDependencies[k] - types[k] = "devDependencies" - } - }) - } - return next() + deps.forEach(function (dep) { + types[moduleName(dep)] = 'dependencies' }) - var has = null - readInstalled(path.resolve(dir), { dev : true }, function (er, data) { - if (er) { - has = Object.create(parentHas) - return next() - } - var pkgs = Object.keys(data.dependencies) - pkgs = pkgs.filter(function (p) { - return !p.match(/^[\._-]/) + Object.keys(tree.missingDeps).forEach(function (name) { + deps.push({ + package: { name: name }, + path: tree.path, + parent: tree, + isMissing: true }) - asyncMap(pkgs, function (pkg, cb) { - var jsonFile = path.resolve(dir, "node_modules", pkg, "package.json") - readJson(jsonFile, function (er, d) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) - if (d && d.name && d.private) delete deps[d.name] - cb(null, er ? [] : [[d.name, d.version, d._from]]) - }) - }, function (er, pvs) { - if (er) return cb(er) - has = Object.create(parentHas) - pvs.forEach(function (pv) { - has[pv[0]] = { - version: pv[1], - from: pv[2] - } + types[name] = 'dependencies' + }) + + // If we explicitly asked for dev deps OR we didn't ask for production deps + // AND we asked to save dev-deps OR we didn't ask to save anything that's NOT + // dev deps then… + // (All the save checking here is because this gets called from npm-update currently + // and that requires this logic around dev deps.) + // FIXME: Refactor npm update to not be in terms of outdated. + var dev = npm.config.get('dev') || /^dev(elopment)?$/.test(npm.config.get('also')) + var prod = npm.config.get('production') || /^prod(uction)?$/.test(npm.config.get('only')) + if ((dev || !prod) && + (npm.config.get('save-dev') || ( + !npm.config.get('save') && !npm.config.get('save-optional')))) { + Object.keys(tree.missingDevDeps).forEach(function (name) { + deps.push({ + package: { name: name }, + path: tree.path, + parent: tree, + isMissing: true }) + if (!types[name]) { + types[name] = 'devDependencies' + } + }) + } - next() + if (npm.config.get('save-dev')) { + deps = deps.filter(function (dep) { return pkg.devDependencies[moduleName(dep)] }) + deps.forEach(function (dep) { + types[moduleName(dep)] = 'devDependencies' }) - }) + } else if (npm.config.get('save')) { + // remove optional dependencies from dependencies during --save. + deps = deps.filter(function (dep) { return !pkg.optionalDependencies[moduleName(dep)] }) + } else if (npm.config.get('save-optional')) { + deps = deps.filter(function (dep) { return pkg.optionalDependencies[moduleName(dep)] }) + deps.forEach(function (dep) { + types[moduleName(dep)] = 'optionalDependencies' + }) + } + var doUpdate = dev || ( + !prod && + !Object.keys(parentHas).length && + !npm.config.get('global') + ) + if (doUpdate) { + Object.keys(pkg.devDependencies).forEach(function (k) { + if (!(k in parentHas)) { + deps[k] = pkg.devDependencies[k] + types[k] = 'devDependencies' + } + }) + } - function next () { - if (!has || !deps) return - if (deps === true) { - deps = Object.keys(has).reduce(function (l, r) { - l[r] = "latest" - return l - }, {}) + var has = Object.create(parentHas) + tree.children.forEach(function (child) { + if (child.package.name && child.package.private) { + deps = deps.filter(function (dep) { return dep !== child }) } + has[child.package.name] = { + version: child.package.version, + from: child.package._from + } + }) - // now get what we should have, based on the dep. - // if has[dep] !== shouldHave[dep], then cb with the data - // otherwise dive into the folder - asyncMap(Object.keys(deps), function (dep, cb) { - if (!long) return shouldUpdate(args, dir, dep, has, deps[dep], depth, cb) - - shouldUpdate(args, dir, dep, has, deps[dep], depth, cb, types[dep]) - }, cb) - } + // now get what we should have, based on the dep. + // if has[dep] !== shouldHave[dep], then cb with the data + // otherwise dive into the folder + asyncMap(deps, function (dep, cb) { + var name = moduleName(dep) + var required = (tree.package.dependencies)[name] || + (tree.package.optionalDependencies)[name] || + (tree.package.devDependencies)[name] || + dep.package._requested && dep.package._requested.spec || + '*' + if (!long) return shouldUpdate(args, dep, name, has, required, depth, path, cb) + + shouldUpdate(args, dep, name, has, required, depth, path, cb, types[name]) + }, cb) } -function shouldUpdate (args, dir, dep, has, req, depth, cb, type) { +function shouldUpdate (args, tree, dep, has, req, depth, pkgpath, cb, type) { // look up the most recent version. // if that's what we already have, or if it's not on the args list, // then dive into it. Otherwise, cb() with the data. @@ -292,31 +316,35 @@ function shouldUpdate (args, dir, dep, has, req, depth, cb, type) { function skip (er) { // show user that no viable version can be found if (er) return cb(er) - outdated_( args - , path.resolve(dir, "node_modules", dep) - , has - , depth + 1 - , cb ) + outdated_(args, + pkgpath, + tree, + has, + depth + 1, + cb) } function doIt (wanted, latest) { if (!long) { - return cb(null, [[ dir, dep, curr && curr.version, wanted, latest, req]]) + return cb(null, [[tree, dep, curr && curr.version, wanted, latest, req, null, pkgpath]]) } - cb(null, [[ dir, dep, curr && curr.version, wanted, latest, req, type]]) + cb(null, [[tree, dep, curr && curr.version, wanted, latest, req, type, pkgpath]]) } if (args.length && args.indexOf(dep) === -1) return skip() var parsed = npa(dep + '@' + req) - if (parsed.type === "git" || (parsed.hosted && parsed.hosted.type === "github")) { - return doIt("git", "git") + if (tree.isLink && (tree.parent !== null && tree.parent.parent === null)) { + return doIt('linked', 'linked') + } + if (parsed.type === 'git' || parsed.type === 'hosted') { + return doIt('git', 'git') } // search for the latest package mapToRegistry(dep, npm.config, function (er, uri, auth) { if (er) return cb(er) - npm.registry.get(uri, { auth : auth }, updateDeps) + npm.registry.get(uri, { auth: auth }, updateDeps) }) function updateLocalDeps (latestRegistryVersion) { @@ -348,13 +376,14 @@ function shouldUpdate (args, dir, dep, has, req, depth, cb, type) { return updateLocalDeps() } - if (!d || !d["dist-tags"] || !d.versions) return cb() - var l = d.versions[d["dist-tags"].latest] + if (!d || !d['dist-tags'] || !d.versions) return cb() + var l = d.versions[d['dist-tags'].latest] if (!l) return cb() var r = req - if (d["dist-tags"][req]) - r = d["dist-tags"][req] + if (d['dist-tags'][req]) { + r = d['dist-tags'][req] + } if (semver.validRange(r, true)) { // some kind of semver range. @@ -369,11 +398,11 @@ function shouldUpdate (args, dir, dep, has, req, depth, cb, type) { // We didn't find the version in the doc. See if cache can find it. cache.add(dep, req, null, false, onCacheAdd) - function onCacheAdd(er, d) { + function onCacheAdd (er, d) { // if this fails, then it means we can't update this thing. // it's probably a thing that isn't published. if (er) { - if (er.code && er.code === "ETARGET") { + if (er.code && er.code === 'ETARGET') { // no viable version found return skip(er) } @@ -385,14 +414,14 @@ function shouldUpdate (args, dir, dep, has, req, depth, cb, type) { var dFromUrl = d._from && url.parse(d._from).protocol var cFromUrl = curr && curr.from && url.parse(curr.from).protocol - if (!curr || dFromUrl && cFromUrl && d._from !== curr.from - || d.version !== curr.version - || d.version !== l.version) { + if (!curr || + dFromUrl && cFromUrl && d._from !== curr.from || + d.version !== curr.version || + d.version !== l.version) { if (parsed.type === 'local') return updateLocalDeps(l.version) doIt(d.version, l.version) - } - else { + } else { skip() } } diff --git a/deps/npm/lib/owner.js b/deps/npm/lib/owner.js index c9adb792249d75..f32f405dd19e64 100644 --- a/deps/npm/lib/owner.js +++ b/deps/npm/lib/owner.js @@ -1,21 +1,21 @@ module.exports = owner -owner.usage = "npm owner add " - + "\nnpm owner rm " - + "\nnpm owner ls " +owner.usage = 'npm owner add [<@scope>/]' + + '\nnpm owner rm [<@scope>/]' + + '\nnpm owner ls [<@scope>/]' -var npm = require("./npm.js") - , log = require("npmlog") - , mapToRegistry = require("./utils/map-to-registry.js") - , readLocalPkg = require("./utils/read-local-package.js") +var npm = require('./npm.js') +var log = require('npmlog') +var mapToRegistry = require('./utils/map-to-registry.js') +var readLocalPkg = require('./utils/read-local-package.js') owner.completion = function (opts, cb) { var argv = opts.conf.argv.remain if (argv.length > 4) return cb() if (argv.length <= 2) { - var subs = ["add", "rm"] - if (opts.partialWord === "l") subs.push("ls") - else subs.push("ls", "list") + var subs = ['add', 'rm'] + if (opts.partialWord === 'l') subs.push('ls') + else subs.push('ls', 'list') return cb(null, subs) } @@ -25,44 +25,45 @@ owner.completion = function (opts, cb) { var un = encodeURIComponent(username) var byUser, theUser switch (argv[2]) { - case "ls": + case 'ls': // FIXME: there used to be registry completion here, but it stopped // making sense somewhere around 50,000 packages on the registry return cb() - case "rm": + case 'rm': if (argv.length > 3) { theUser = encodeURIComponent(argv[3]) - byUser = "-/by-user/" + theUser + "|" + un + byUser = '-/by-user/' + theUser + '|' + un return mapToRegistry(byUser, npm.config, function (er, uri, auth) { if (er) return cb(er) console.error(uri) - npm.registry.get(uri, { auth : auth }, function (er, d) { + npm.registry.get(uri, { auth: auth }, function (er, d) { if (er) return cb(er) // return the intersection return cb(null, d[theUser].filter(function (p) { // kludge for server adminery. - return un === "isaacs" || d[un].indexOf(p) === -1 + return un === 'isaacs' || d[un].indexOf(p) === -1 })) }) }) } // else fallthrough - case "add": + /*eslint no-fallthrough:0*/ + case 'add': if (argv.length > 3) { theUser = encodeURIComponent(argv[3]) - byUser = "-/by-user/" + theUser + "|" + un + byUser = '-/by-user/' + theUser + '|' + un return mapToRegistry(byUser, npm.config, function (er, uri, auth) { if (er) return cb(er) console.error(uri) - npm.registry.get(uri, { auth : auth }, function (er, d) { + npm.registry.get(uri, { auth: auth }, function (er, d) { console.error(uri, er || d) // return mine that they're not already on. if (er) return cb(er) var mine = d[un] || [] - , theirs = d[theUser] || [] + var theirs = d[theUser] || [] return cb(null, mine.filter(function (p) { return theirs.indexOf(p) === -1 })) @@ -70,10 +71,10 @@ owner.completion = function (opts, cb) { }) } // just list all users who aren't me. - return mapToRegistry("-/users", npm.config, function (er, uri, auth) { + return mapToRegistry('-/users', npm.config, function (er, uri, auth) { if (er) return cb(er) - npm.registry.get(uri, { auth : auth }, function (er, list) { + npm.registry.get(uri, { auth: auth }, function (er, list) { if (er) return cb() return cb(null, Object.keys(list).filter(function (n) { return n !== un @@ -90,34 +91,39 @@ owner.completion = function (opts, cb) { function owner (args, cb) { var action = args.shift() switch (action) { - case "ls": case "list": return ls(args[0], cb) - case "add": return add(args[0], args[1], cb) - case "rm": case "remove": return rm(args[0], args[1], cb) + case 'ls': case 'list': return ls(args[0], cb) + case 'add': return add(args[0], args[1], cb) + case 'rm': case 'remove': return rm(args[0], args[1], cb) default: return unknown(action, cb) } } function ls (pkg, cb) { - if (!pkg) return readLocalPkg(function (er, pkg) { - if (er) return cb(er) - if (!pkg) return cb(owner.usage) - ls(pkg, cb) - }) + if (!pkg) { + return readLocalPkg(function (er, pkg) { + if (er) return cb(er) + if (!pkg) return cb(owner.usage) + ls(pkg, cb) + }) + } mapToRegistry(pkg, npm.config, function (er, uri, auth) { if (er) return cb(er) - npm.registry.get(uri, { auth : auth }, function (er, data) { - var msg = "" + npm.registry.get(uri, { auth: auth }, function (er, data) { + var msg = '' if (er) { - log.error("owner ls", "Couldn't get owner data", pkg) + log.error('owner ls', "Couldn't get owner data", pkg) return cb(er) } var owners = data.maintainers - if (!owners || !owners.length) msg = "admin party!" - else msg = owners.map(function (o) { - return o.name + " <" + o.email + ">" - }).join("\n") + if (!owners || !owners.length) { + msg = 'admin party!' + } else { + msg = owners.map(function (o) { + return o.name + ' <' + o.email + '>' + }).join('\n') + } console.log(msg) cb(er, owners) }) @@ -126,20 +132,24 @@ function ls (pkg, cb) { function add (user, pkg, cb) { if (!user) return cb(owner.usage) - if (!pkg) return readLocalPkg(function (er, pkg) { - if (er) return cb(er) - if (!pkg) return cb(new Error(owner.usage)) - add(user, pkg, cb) - }) + if (!pkg) { + return readLocalPkg(function (er, pkg) { + if (er) return cb(er) + if (!pkg) return cb(new Error(owner.usage)) + add(user, pkg, cb) + }) + } - log.verbose("owner add", "%s to %s", user, pkg) + log.verbose('owner add', '%s to %s', user, pkg) mutate(pkg, user, function (u, owners) { if (!owners) owners = [] - for (var i = 0, l = owners.length; i < l; i ++) { + for (var i = 0, l = owners.length; i < l; i++) { var o = owners[i] if (o.name === u.name) { - log.info( "owner add" - , "Already a package owner: " + o.name + " <" + o.email + ">") + log.info( + 'owner add', + 'Already a package owner: ' + o.name + ' <' + o.email + '>' + ) return false } } @@ -149,58 +159,69 @@ function add (user, pkg, cb) { } function rm (user, pkg, cb) { - if (!pkg) return readLocalPkg(function (er, pkg) { - if (er) return cb(er) - if (!pkg) return cb(new Error(owner.usage)) - rm(user, pkg, cb) - }) + if (!pkg) { + return readLocalPkg(function (er, pkg) { + if (er) return cb(er) + if (!pkg) return cb(new Error(owner.usage)) + rm(user, pkg, cb) + }) + } - log.verbose("owner rm", "%s from %s", user, pkg) + log.verbose('owner rm', '%s from %s', user, pkg) mutate(pkg, user, function (u, owners) { var found = false - , m = owners.filter(function (o) { - var match = (o.name === user) - found = found || match - return !match - }) + var m = owners.filter(function (o) { + var match = (o.name === user) + found = found || match + return !match + }) + if (!found) { - log.info("owner rm", "Not a package owner: " + user) + log.info('owner rm', 'Not a package owner: ' + user) return false } - if (!m.length) return new Error( - "Cannot remove all owners of a package. Add someone else first.") + + if (!m.length) { + return new Error( + 'Cannot remove all owners of a package. Add someone else first.' + ) + } + return m }, cb) } function mutate (pkg, user, mutation, cb) { if (user) { - var byUser = "-/user/org.couchdb.user:" + user + var byUser = '-/user/org.couchdb.user:' + user mapToRegistry(byUser, npm.config, function (er, uri, auth) { if (er) return cb(er) - npm.registry.get(uri, { auth : auth }, mutate_) + npm.registry.get(uri, { auth: auth }, mutate_) }) } else { mutate_(null, null) } function mutate_ (er, u) { - if (!er && user && (!u || u.error)) er = new Error( - "Couldn't get user data for " + user + ": " + JSON.stringify(u)) + if (!er && user && (!u || u.error)) { + er = new Error( + "Couldn't get user data for " + user + ': ' + JSON.stringify(u) + ) + } if (er) { - log.error("owner mutate", "Error getting user data for %s", user) + log.error('owner mutate', 'Error getting user data for %s', user) return cb(er) } - if (u) u = { "name" : u.name, "email" : u.email } + if (u) u = { name: u.name, email: u.email } mapToRegistry(pkg, npm.config, function (er, uri, auth) { if (er) return cb(er) - npm.registry.get(uri, { auth : auth }, function (er, data) { + npm.registry.get(uri, { auth: auth }, function (er, data) { if (er) { - log.error("owner mutate", "Error getting package data for %s", pkg) + log.error('owner mutate', 'Error getting package data for %s', pkg) return cb(er) } @@ -213,32 +234,30 @@ function mutate (pkg, user, mutation, cb) { if (m instanceof Error) return cb(m) // error data = { - _id : data._id, - _rev : data._rev, - maintainers : m + _id: data._id, + _rev: data._rev, + maintainers: m } - var dataPath = pkg.replace("/", "%2f") + "/-rev/" + data._rev + var dataPath = pkg.replace('/', '%2f') + '/-rev/' + data._rev mapToRegistry(dataPath, npm.config, function (er, uri, auth) { if (er) return cb(er) var params = { - method : "PUT", - body : data, - auth : auth + method: 'PUT', + body: data, + auth: auth } npm.registry.request(uri, params, function (er, data) { if (!er && data.error) { - er = new Error("Failed to update package metadata: "+JSON.stringify(data)) + er = new Error('Failed to update package metadata: ' + JSON.stringify(data)) } if (er) { - log.error("owner mutate", "Failed to update package metadata") - } - else if (m.length > beforeMutation) { - console.log("+ %s (%s)", user, pkg) - } - else if (m.length < beforeMutation) { - console.log("- %s (%s)", user, pkg) + log.error('owner mutate', 'Failed to update package metadata') + } else if (m.length > beforeMutation) { + console.log('+ %s (%s)', user, pkg) + } else if (m.length < beforeMutation) { + console.log('- %s (%s)', user, pkg) } cb(er, data) @@ -250,5 +269,5 @@ function mutate (pkg, user, mutation, cb) { } function unknown (action, cb) { - cb("Usage: \n" + owner.usage) + cb('Usage: \n' + owner.usage) } diff --git a/deps/npm/lib/pack.js b/deps/npm/lib/pack.js index a5ce90094f6a3a..c98f5f202016b8 100644 --- a/deps/npm/lib/pack.js +++ b/deps/npm/lib/pack.js @@ -4,39 +4,42 @@ module.exports = pack -var npm = require("./npm.js") - , install = require("./install.js") - , cache = require("./cache.js") - , fs = require("graceful-fs") - , chain = require("slide").chain - , path = require("path") - , cwd = process.cwd() - , writeStream = require('fs-write-stream-atomic') - , cachedPackageRoot = require("./cache/cached-package-root.js") +var install = require('./install.js') +var cache = require('./cache.js') +var fs = require('graceful-fs') +var chain = require('slide').chain +var path = require('path') +var cwd = process.cwd() +var writeStreamAtomic = require('fs-write-stream-atomic') +var cachedPackageRoot = require('./cache/cached-package-root.js') -pack.usage = "npm pack " +pack.usage = 'npm pack [[<@scope>/]...]' // if it can be installed, it can be packed. pack.completion = install.completion function pack (args, silent, cb) { - if (typeof cb !== "function") cb = silent, silent = false + if (typeof cb !== 'function') { + cb = silent + silent = false + } - if (args.length === 0) args = ["."] + if (args.length === 0) args = ['.'] - chain(args.map(function (arg) { return function (cb) { - pack_(arg, cb) - }}), function (er, files) { - if (er || silent) return cb(er, files) - printFiles(files, cb) - }) + chain( + args.map(function (arg) { return function (cb) { pack_(arg, cb) } }), + function (er, files) { + if (er || silent) return cb(er, files) + printFiles(files, cb) + } + ) } function printFiles (files, cb) { files = files.map(function (file) { return path.relative(cwd, file) }) - console.log(files.join("\n")) + console.log(files.join('\n')) cb() } @@ -47,17 +50,17 @@ function pack_ (pkg, cb) { // scoped packages get special treatment var name = data.name - if (name[0] === "@") name = name.substr(1).replace(/\//g, "-") - var fname = name + "-" + data.version + ".tgz" + if (name[0] === '@') name = name.substr(1).replace(/\//g, '-') + var fname = name + '-' + data.version + '.tgz' - var cached = path.join(cachedPackageRoot(data), "package.tgz") - , from = fs.createReadStream(cached) - , to = writeStream(fname) - , errState = null + var cached = path.join(cachedPackageRoot(data), 'package.tgz') + var from = fs.createReadStream(cached) + var to = writeStreamAtomic(fname) + var errState = null - from.on("error", cb_) - to.on("error", cb_) - to.on("close", cb_) + from.on('error', cb_) + to.on('error', cb_) + to.on('close', cb_) from.pipe(to) function cb_ (er) { diff --git a/deps/npm/lib/prefix.js b/deps/npm/lib/prefix.js index e002edea155d12..42f61103f64a2e 100644 --- a/deps/npm/lib/prefix.js +++ b/deps/npm/lib/prefix.js @@ -1,11 +1,14 @@ module.exports = prefix -var npm = require("./npm.js") +var npm = require('./npm.js') -prefix.usage = "npm prefix\nnpm prefix -g\n(just prints the prefix folder)" +prefix.usage = 'npm prefix [-g]' function prefix (args, silent, cb) { - if (typeof cb !== "function") cb = silent, silent = false + if (typeof cb !== 'function') { + cb = silent + silent = false + } if (!silent) console.log(npm.prefix) process.nextTick(cb.bind(this, null, npm.prefix)) } diff --git a/deps/npm/lib/prune.js b/deps/npm/lib/prune.js index edba876013580b..46373742f59afd 100644 --- a/deps/npm/lib/prune.js +++ b/deps/npm/lib/prune.js @@ -2,28 +2,28 @@ module.exports = prune -prune.usage = "npm prune" +prune.usage = 'npm prune [[<@scope>/]...] [--production]' -var readInstalled = require("read-installed") - , npm = require("./npm.js") - , path = require("path") - , readJson = require("read-package-json") - , log = require("npmlog") +var readInstalled = require('read-installed') +var npm = require('./npm.js') +var path = require('path') +var readJson = require('read-package-json') +var log = require('npmlog') -prune.completion = require("./utils/completion/installed-deep.js") +prune.completion = require('./utils/completion/installed-deep.js') function prune (args, cb) { - //check if is a valid package.json file - var jsonFile = path.resolve(npm.dir, "..", "package.json" ) + // check if is a valid package.json file + var jsonFile = path.resolve(npm.dir, '..', 'package.json') readJson(jsonFile, log.warn, function (er) { if (er) return cb(er) next() }) - function next() { + function next () { var opt = { - depth: npm.config.get("depth"), - dev: !npm.config.get("production") || npm.config.get("dev") + depth: npm.config.get('depth'), + dev: !npm.config.get('production') || npm.config.get('dev') } readInstalled(npm.prefix, opt, function (er, data) { if (er) return cb(er) @@ -39,11 +39,9 @@ function prune_ (args, data, cb) { function prunables (args, data, seen) { var deps = data.dependencies || {} return Object.keys(deps).map(function (d) { - if (typeof deps[d] !== "object" - || seen.indexOf(deps[d]) !== -1) return null + if (typeof deps[d] !== 'object' || seen.indexOf(deps[d]) !== -1) return null seen.push(deps[d]) - if (deps[d].extraneous - && (args.length === 0 || args.indexOf(d) !== -1)) { + if (deps[d].extraneous && (args.length === 0 || args.indexOf(d) !== -1)) { var extra = deps[d] delete deps[d] return extra.path @@ -51,6 +49,6 @@ function prunables (args, data, seen) { return prunables(args, deps[d], seen) }).filter(function (d) { return d !== null }) .reduce(function FLAT (l, r) { - return l.concat(Array.isArray(r) ? r.reduce(FLAT,[]) : r) + return l.concat(Array.isArray(r) ? r.reduce(FLAT, []) : r) }, []) } diff --git a/deps/npm/lib/publish.js b/deps/npm/lib/publish.js index 8f1c73c3c98fe5..45de4f24b40ef9 100644 --- a/deps/npm/lib/publish.js +++ b/deps/npm/lib/publish.js @@ -1,23 +1,22 @@ module.exports = publish -var npm = require("./npm.js") - , log = require("npmlog") - , path = require("path") - , readJson = require("read-package-json") - , lifecycle = require("./utils/lifecycle.js") - , chain = require("slide").chain - , mapToRegistry = require("./utils/map-to-registry.js") - , cachedPackageRoot = require("./cache/cached-package-root.js") - , createReadStream = require("graceful-fs").createReadStream - , npa = require("npm-package-arg") - , semver = require('semver') - , getPublishConfig = require("./utils/get-publish-config.js") - -publish.usage = "npm publish [--tag ]" - + "\nnpm publish [--tag ]" - + "\n\nPublishes '.' if no argument supplied" - + "\n\nSets tag `latest` if no --tag specified" +var npm = require('./npm.js') +var log = require('npmlog') +var path = require('path') +var readJson = require('read-package-json') +var lifecycle = require('./utils/lifecycle.js') +var chain = require('slide').chain +var mapToRegistry = require('./utils/map-to-registry.js') +var cachedPackageRoot = require('./cache/cached-package-root.js') +var createReadStream = require('graceful-fs').createReadStream +var npa = require('npm-package-arg') +var semver = require('semver') +var getPublishConfig = require('./utils/get-publish-config.js') + +publish.usage = 'npm publish [|] [--tag ] [--access ]' + + "\n\nPublishes '.' if no argument supplied" + + '\n\nSets tag `latest` if no --tag specified' publish.completion = function (opts, cb) { // publish can complete to a folder with a package.json @@ -27,29 +26,29 @@ publish.completion = function (opts, cb) { } function publish (args, isRetry, cb) { - if (typeof cb !== "function") { + if (typeof cb !== 'function') { cb = isRetry isRetry = false } - if (args.length === 0) args = ["."] + if (args.length === 0) args = ['.'] if (args.length !== 1) return cb(publish.usage) - log.verbose("publish", args) + log.verbose('publish', args) var t = npm.config.get('tag').trim() if (semver.validRange(t)) { - var er = new Error("Tag name must not be a valid SemVer range: " + t) + var er = new Error('Tag name must not be a valid SemVer range: ' + t) return cb(er) } var arg = args[0] // if it's a local folder, then run the prepublish there, first. - readJson(path.resolve(arg, "package.json"), function (er, data) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + readJson(path.resolve(arg, 'package.json'), function (er, data) { + if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) if (data) { - if (!data.name) return cb(new Error("No name provided")) - if (!data.version) return cb(new Error("No version provided")) + if (!data.name) return cb(new Error('No name provided')) + if (!data.version) return cb(new Error('No version provided')) } // Error is OK. Could be publishing a URL or tarball, however, that means @@ -61,26 +60,29 @@ function publish (args, isRetry, cb) { } // didPre in this case means that we already ran the prepublish script, -// and that the "dir" is an actual directory, and not something silly +// and that the 'dir' is an actual directory, and not something silly // like a tarball or name@version thing. // That means that we can run publish/postpublish in the dir, rather than // in the cache dir. function cacheAddPublish (dir, didPre, isRetry, cb) { npm.commands.cache.add(dir, null, null, false, function (er, data) { if (er) return cb(er) - log.silly("publish", data) - var cachedir = path.resolve(cachedPackageRoot(data), "package") - chain([ !didPre && - [lifecycle, data, "prepublish", cachedir] - , [publish_, dir, data, isRetry, cachedir] - , [lifecycle, data, "publish", didPre ? dir : cachedir] - , [lifecycle, data, "postpublish", didPre ? dir : cachedir] ] - , cb ) + log.silly('publish', data) + var cachedir = path.resolve(cachedPackageRoot(data), 'package') + chain( + [ + !didPre && [lifecycle, data, 'prepublish', cachedir], + [publish_, dir, data, isRetry, cachedir], + [lifecycle, data, 'publish', didPre ? dir : cachedir], + [lifecycle, data, 'postpublish', didPre ? dir : cachedir] + ], + cb + ) }) } function publish_ (arg, data, isRetry, cachedir, cb) { - if (!data) return cb(new Error("no package.json file found")) + if (!data) return cb(new Error('no package.json file found')) var mappedConfig = getPublishConfig( data.publishConfig, @@ -90,51 +92,52 @@ function publish_ (arg, data, isRetry, cachedir, cb) { var config = mappedConfig.config var registry = mappedConfig.client - data._npmVersion = npm.version + data._npmVersion = npm.version data._nodeVersion = process.versions.node delete data.modules - if (data.private) return cb( - new Error( - "This package has been marked as private\n" + + if (data.private) { + return cb(new Error( + 'This package has been marked as private\n' + "Remove the 'private' field from the package.json to publish it." - ) - ) + )) + } mapToRegistry(data.name, config, function (er, registryURI, auth, registryBase) { if (er) return cb(er) - var tarballPath = cachedir + ".tgz" + var tarballPath = cachedir + '.tgz' // we just want the base registry URL in this case - log.verbose("publish", "registryBase", registryBase) - log.silly("publish", "uploading", tarballPath) + log.verbose('publish', 'registryBase', registryBase) + log.silly('publish', 'uploading', tarballPath) data._npmUser = { - name : auth.username, - email : auth.email + name: auth.username, + email: auth.email } var params = { - metadata : data, - body : createReadStream(tarballPath), - auth : auth + metadata: data, + body: createReadStream(tarballPath), + auth: auth } // registry-frontdoor cares about the access level, which is only // configurable for scoped packages - if (config.get("access")) { - if (!npa(data.name).scope && config.get("access") === "restricted") { + if (config.get('access')) { + if (!npa(data.name).scope && config.get('access') === 'restricted') { return cb(new Error("Can't restrict access to unscoped packages.")) } - params.access = config.get("access") + params.access = config.get('access') } + log.showProgress('publish:' + data._id) registry.publish(registryBase, params, function (er) { - if (er && er.code === "EPUBLISHCONFLICT" && - npm.config.get("force") && !isRetry) { - log.warn("publish", "Forced publish over " + data._id) + if (er && er.code === 'EPUBLISHCONFLICT' && + npm.config.get('force') && !isRetry) { + log.warn('publish', 'Forced publish over ' + data._id) return npm.commands.unpublish([data._id], function (er) { // ignore errors. Use the force. Reach out with your feelings. // but if it fails again, then report the first error. @@ -144,7 +147,8 @@ function publish_ (arg, data, isRetry, cachedir, cb) { // report the unpublish error if this was a retry and unpublish failed if (er && isRetry && isRetry !== true) return cb(isRetry) if (er) return cb(er) - console.log("+ " + data._id) + log.clearProgress() + console.log('+ ' + data._id) cb() }) }) diff --git a/deps/npm/lib/rebuild.js b/deps/npm/lib/rebuild.js index ab372c6ec07c7e..0e36c6361efef0 100644 --- a/deps/npm/lib/rebuild.js +++ b/deps/npm/lib/rebuild.js @@ -1,27 +1,27 @@ module.exports = rebuild -var readInstalled = require("read-installed") - , semver = require("semver") - , log = require("npmlog") - , npm = require("./npm.js") - , npa = require("npm-package-arg") +var readInstalled = require('read-installed') +var semver = require('semver') +var log = require('npmlog') +var npm = require('./npm.js') +var npa = require('npm-package-arg') -rebuild.usage = "npm rebuild [[@] [name[@] ...]]" +rebuild.usage = 'npm rebuild [[<@scope>/]...]' -rebuild.completion = require("./utils/completion/installed-deep.js") +rebuild.completion = require('./utils/completion/installed-deep.js') function rebuild (args, cb) { - var opt = { depth: npm.config.get("depth"), dev: true } + var opt = { depth: npm.config.get('depth'), dev: true } readInstalled(npm.prefix, opt, function (er, data) { - log.info("readInstalled", typeof data) + log.info('readInstalled', typeof data) if (er) return cb(er) var set = filter(data, args) - , folders = Object.keys(set).filter(function (f) { - return f !== npm.prefix - }) + var folders = Object.keys(set).filter(function (f) { + return f !== npm.prefix + }) if (!folders.length) return cb() - log.silly("rebuild set", folders) + log.silly('rebuild set', folders) cleanBuild(folders, set, cb) }) } @@ -29,9 +29,11 @@ function rebuild (args, cb) { function cleanBuild (folders, set, cb) { npm.commands.build(folders, function (er) { if (er) return cb(er) + log.clearProgress() console.log(folders.map(function (f) { - return set[f] + " " + f - }).join("\n")) + return set[f] + ' ' + f + }).join('\n')) + log.showProgress() cb() }) } @@ -45,11 +47,11 @@ function filter (data, args, set, seen) { var pass if (!args.length) pass = true // rebuild everything else if (data.name && data._id) { - for (var i = 0, l = args.length; i < l; i ++) { + for (var i = 0, l = args.length; i < l; i++) { var arg = args[i] - , nv = npa(arg) - , n = nv.name - , v = nv.rawSpec + var nv = npa(arg) + var n = nv.name + var v = nv.rawSpec if (n !== data.name) continue if (!semver.satisfies(data.version, v, true)) continue pass = true @@ -57,7 +59,7 @@ function filter (data, args, set, seen) { } } if (pass && data._id) { - log.verbose("rebuild", "path, id", [data.path, data._id]) + log.verbose('rebuild', 'path, id', [data.path, data._id]) set[data.path] = data._id } // need to also dive through kids, always. @@ -66,7 +68,7 @@ function filter (data, args, set, seen) { Object.keys(data.dependencies || {}).forEach(function (d) { // return var dep = data.dependencies[d] - if (typeof dep === "string") return + if (typeof dep === 'string') return filter(dep, args, set, seen) }) return set diff --git a/deps/npm/lib/repo.js b/deps/npm/lib/repo.js index 1b0454773d74d7..caaf422cfeee2c 100644 --- a/deps/npm/lib/repo.js +++ b/deps/npm/lib/repo.js @@ -1,18 +1,12 @@ - module.exports = repo -repo.usage = "npm repo " +repo.usage = 'npm repo []' -var npm = require("./npm.js") - , opener = require("opener") - , github = require("github-url-from-git") - , githubUserRepo = require("github-url-from-username-repo") - , path = require("path") - , readJson = require("read-package-json") - , fs = require("fs") - , url_ = require("url") - , mapToRegistry = require("./utils/map-to-registry.js") - , npa = require("npm-package-arg") +var npm = require('./npm.js') +var opener = require('opener') +var hostedGitInfo = require('hosted-git-info') +var url_ = require('url') +var fetchPackageMetadata = require('./fetch-package-metadata.js') repo.completion = function (opts, cb) { // FIXME: there used to be registry completion here, but it stopped making @@ -21,58 +15,37 @@ repo.completion = function (opts, cb) { } function repo (args, cb) { - var n = args.length && npa(args[0]).name || "." - fs.stat(n, function (er, s) { - if (er && er.code === "ENOENT") return callRegistry(n, cb) - else if (er) return cb(er) - if (!s.isDirectory()) return callRegistry(n, cb) - readJson(path.resolve(n, "package.json"), function (er, d) { - if (er) return cb(er) - getUrlAndOpen(d, cb) - }) + var n = args.length ? args[0] : '.' + fetchPackageMetadata(n, '.', function (er, d) { + if (er) return cb(er) + getUrlAndOpen(d, cb) }) } function getUrlAndOpen (d, cb) { var r = d.repository - if (!r) return cb(new Error("no repository")) + if (!r) return cb(new Error('no repository')) // XXX remove this when npm@v1.3.10 from node 0.10 is deprecated // from https://github.com/npm/npm-www/issues/418 - if (githubUserRepo(r.url)) - r.url = githubUserRepo(r.url) + var info = hostedGitInfo.fromUrl(r.url) + var url = info ? info.browse() : unknownHostedUrl(r.url) - var url = (r.url && ~r.url.indexOf("github")) - ? github(r.url) - : nonGithubUrl(r.url) - - if (!url) - return cb(new Error("no repository: could not get url")) - opener(url, { command: npm.config.get("browser") }, cb) -} + if (!url) return cb(new Error('no repository: could not get url')) -function callRegistry (n, cb) { - mapToRegistry(n, npm.config, function (er, uri) { - if (er) return cb(er) - - npm.registry.get(uri + "/latest", { timeout : 3600 }, function (er, d) { - if (er) return cb(er) - getUrlAndOpen(d, cb) - }) - }) + opener(url, { command: npm.config.get('browser') }, cb) } -function nonGithubUrl (url) { +function unknownHostedUrl (url) { try { - var idx = url.indexOf("@") + var idx = url.indexOf('@') if (idx !== -1) { - url = url.slice(idx+1).replace(/:([^\d]+)/, "/$1") + url = url.slice(idx + 1).replace(/:([^\d]+)/, '/$1') } url = url_.parse(url) - var protocol = url.protocol === "https:" - ? "https:" - : "http:" - return protocol + "//" + (url.host || "") + - url.path.replace(/\.git$/, "") - } - catch(e) {} + var protocol = url.protocol === 'https:' + ? 'https:' + : 'http:' + return protocol + '//' + (url.host || '') + + url.path.replace(/\.git$/, '') + } catch (e) {} } diff --git a/deps/npm/lib/restart.js b/deps/npm/lib/restart.js index 69c4b913db62db..601249fd6b36b0 100644 --- a/deps/npm/lib/restart.js +++ b/deps/npm/lib/restart.js @@ -1 +1 @@ -module.exports = require("./utils/lifecycle.js").cmd("restart") +module.exports = require('./utils/lifecycle.js').cmd('restart') diff --git a/deps/npm/lib/root.js b/deps/npm/lib/root.js index b2f731ed55ae99..958361d351a4b0 100644 --- a/deps/npm/lib/root.js +++ b/deps/npm/lib/root.js @@ -1,11 +1,14 @@ module.exports = root -var npm = require("./npm.js") +var npm = require('./npm.js') -root.usage = "npm root\nnpm root -g\n(just prints the root folder)" +root.usage = 'npm root [-g]' function root (args, silent, cb) { - if (typeof cb !== "function") cb = silent, silent = false + if (typeof cb !== 'function') { + cb = silent + silent = false + } if (!silent) console.log(npm.dir) process.nextTick(cb.bind(this, null, npm.dir)) } diff --git a/deps/npm/lib/run-script.js b/deps/npm/lib/run-script.js index 2c805615a42e3a..ef5e6560047763 100644 --- a/deps/npm/lib/run-script.js +++ b/deps/npm/lib/run-script.js @@ -1,16 +1,16 @@ module.exports = runScript -var lifecycle = require("./utils/lifecycle.js") - , npm = require("./npm.js") - , path = require("path") - , readJson = require("read-package-json") - , log = require("npmlog") - , chain = require("slide").chain +var lifecycle = require('./utils/lifecycle.js') +var npm = require('./npm.js') +var path = require('path') +var readJson = require('read-package-json') +var log = require('npmlog') +var chain = require('slide').chain -runScript.usage = "npm run-script [-- ]" +runScript.usage = 'npm run-script [-- ...]' + + '\n\nalias: npm run' runScript.completion = function (opts, cb) { - // see if there's already a package specified. var argv = opts.conf.argv.remain @@ -19,20 +19,19 @@ runScript.completion = function (opts, cb) { if (argv.length === 3) { // either specified a script locally, in which case, done, // or a package, in which case, complete against its scripts - var json = path.join(npm.localPrefix, "package.json") + var json = path.join(npm.localPrefix, 'package.json') return readJson(json, function (er, d) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) if (er) d = {} var scripts = Object.keys(d.scripts || {}) - console.error("local scripts", scripts) + console.error('local scripts', scripts) if (scripts.indexOf(argv[2]) !== -1) return cb() // ok, try to find out which package it was, then - var pref = npm.config.get("global") ? npm.config.get("prefix") + var pref = npm.config.get('global') ? npm.config.get('prefix') : npm.localPrefix - var pkgDir = path.resolve( pref, "node_modules" - , argv[2], "package.json" ) + var pkgDir = path.resolve(pref, 'node_modules', argv[2], 'package.json') readJson(pkgDir, function (er, d) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) if (er) d = {} var scripts = Object.keys(d.scripts || {}) return cb(null, scripts) @@ -40,8 +39,8 @@ runScript.completion = function (opts, cb) { }) } - readJson(path.join(npm.localPrefix, "package.json"), function (er, d) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + readJson(path.join(npm.localPrefix, 'package.json'), function (er, d) { + if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) d = d || {} cb(null, Object.keys(d.scripts || {})) }) @@ -51,23 +50,30 @@ function runScript (args, cb) { if (!args.length) return list(cb) var pkgdir = npm.localPrefix - , cmd = args.shift() + var cmd = args.shift() - readJson(path.resolve(pkgdir, "package.json"), function (er, d) { + readJson(path.resolve(pkgdir, 'package.json'), function (er, d) { if (er) return cb(er) run(d, pkgdir, cmd, args, cb) }) } -function list(cb) { - var json = path.join(npm.localPrefix, "package.json") - var cmdList = [ "publish", "install", "uninstall" - , "test", "stop", "start", "restart", "version" - ].reduce(function (l, p) { - return l.concat(["pre" + p, p, "post" + p]) - }, []) - return readJson(json, function(er, d) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) +function list (cb) { + var json = path.join(npm.localPrefix, 'package.json') + var cmdList = [ + 'publish', + 'install', + 'uninstall', + 'test', + 'stop', + 'start', + 'restart', + 'version' + ].reduce(function (l, p) { + return l.concat(['pre' + p, p, 'post' + p]) + }, []) + return readJson(json, function (er, d) { + if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) if (er) d = {} var allScripts = Object.keys(d.scripts || {}) var scripts = [] @@ -77,37 +83,36 @@ function list(cb) { else runScripts.push(script) }) - if (log.level === "silent") { + if (log.level === 'silent') { return cb(null, allScripts) } - if (npm.config.get("json")) { + if (npm.config.get('json')) { console.log(JSON.stringify(d.scripts || {}, null, 2)) return cb(null, allScripts) } - if (npm.config.get("parseable")) { - allScripts.forEach(function(script) { - console.log(script + ":" + d.scripts[script]) + if (npm.config.get('parseable')) { + allScripts.forEach(function (script) { + console.log(script + ':' + d.scripts[script]) }) return cb(null, allScripts) } - var s = "\n " - var prefix = " " + var s = '\n ' + var prefix = ' ' if (scripts.length) { - console.log("Lifecycle scripts included in %s:", d.name) + console.log('Lifecycle scripts included in %s:', d.name) } - scripts.forEach(function(script) { + scripts.forEach(function (script) { console.log(prefix + script + s + d.scripts[script]) }) if (!scripts.length && runScripts.length) { - console.log("Scripts available in %s via `npm run-script`:", d.name) - } - else if (runScripts.length) { - console.log("\navailable via `npm run-script`:") + console.log('Scripts available in %s via `npm run-script`:', d.name) + } else if (runScripts.length) { + console.log('\navailable via `npm run-script`:') } - runScripts.forEach(function(script) { + runScripts.forEach(function (script) { console.log(prefix + script + s + d.scripts[script]) }) return cb(null, allScripts) @@ -118,38 +123,38 @@ function run (pkg, wd, cmd, args, cb) { if (!pkg.scripts) pkg.scripts = {} var cmds - if (cmd === "restart" && !pkg.scripts.restart) { + if (cmd === 'restart' && !pkg.scripts.restart) { cmds = [ - "prestop", "stop", "poststop", - "restart", - "prestart", "start", "poststart" + 'prestop', 'stop', 'poststop', + 'restart', + 'prestart', 'start', 'poststart' ] } else { if (!pkg.scripts[cmd]) { - if (cmd === "test") { - pkg.scripts.test = "echo \"Error: no test specified\"" - } else if (cmd === "env") { - if (process.platform === "win32") { - log.verbose("run-script using default platform env: SET (Windows)") - pkg.scripts[cmd] = "SET" + if (cmd === 'test') { + pkg.scripts.test = 'echo \'Error: no test specified\'' + } else if (cmd === 'env') { + if (process.platform === 'win32') { + log.verbose('run-script using default platform env: SET (Windows)') + pkg.scripts[cmd] = 'SET' } else { - log.verbose("run-script using default platform env: env (Unix)") - pkg.scripts[cmd] = "env" + log.verbose('run-script using default platform env: env (Unix)') + pkg.scripts[cmd] = 'env' } - } else if (npm.config.get("if-present")) { - return cb(null); + } else if (npm.config.get('if-present')) { + return cb(null) } else { - return cb(new Error("missing script: " + cmd)) + return cb(new Error('missing script: ' + cmd)) } } cmds = [cmd] } if (!cmd.match(/^(pre|post)/)) { - cmds = ["pre"+cmd].concat(cmds).concat("post"+cmd) + cmds = ['pre' + cmd].concat(cmds).concat('post' + cmd) } - log.verbose("run-script", cmds) + log.verbose('run-script', cmds) chain(cmds.map(function (c) { // pass cli arguments after -- to script. if (pkg.scripts[c] && c === cmd) { @@ -164,8 +169,8 @@ function run (pkg, wd, cmd, args, cb) { // join arguments after '--' and pass them to script, // handle special characters such as ', ", ' '. function joinArgs (args) { - var joinedArgs = "" - args.forEach(function(arg) { + var joinedArgs = '' + args.forEach(function (arg) { joinedArgs += ' "' + arg.replace(/"/g, '\\"') + '"' }) return joinedArgs diff --git a/deps/npm/lib/search.js b/deps/npm/lib/search.js index 840bc2f6b785df..bf1f6499a71d51 100644 --- a/deps/npm/lib/search.js +++ b/deps/npm/lib/search.js @@ -1,17 +1,18 @@ module.exports = exports = search -var npm = require("./npm.js") - , columnify = require("columnify") - , updateIndex = require("./cache/update-index.js") +var npm = require('./npm.js') +var columnify = require('columnify') +var updateIndex = require('./cache/update-index.js') -search.usage = "npm search [some search terms ...]" +search.usage = 'npm search [--long] [search terms ...]' + + '\n\naliases: s, se' search.completion = function (opts, cb) { var compl = {} - , partial = opts.partialWord - , ipartial = partial.toLowerCase() - , plen = partial.length + var partial = opts.partialWord + var ipartial = partial.toLowerCase() + var plen = partial.length // get the batch of data that matches so far. // this is an example of using npm.commands.search programmatically @@ -19,7 +20,7 @@ search.completion = function (opts, cb) { search(opts.conf.argv.remain.slice(2), true, function (er, data) { if (er) return cb(er) Object.keys(data).forEach(function (name) { - data[name].words.split(" ").forEach(function (w) { + data[name].words.split(' ').forEach(function (w) { if (w.toLowerCase().indexOf(ipartial) === 0) { compl[partial + w.substr(plen)] = true } @@ -30,19 +31,29 @@ search.completion = function (opts, cb) { } function search (args, silent, staleness, cb) { - if (typeof cb !== "function") cb = staleness, staleness = 600 - if (typeof cb !== "function") cb = silent, silent = false + if (typeof cb !== 'function') { + cb = staleness + staleness = 600 + } + if (typeof cb !== 'function') { + cb = silent + silent = false + } - var searchopts = npm.config.get("searchopts") - var searchexclude = npm.config.get("searchexclude") + var searchopts = npm.config.get('searchopts') + var searchexclude = npm.config.get('searchexclude') - if (typeof searchopts !== "string") searchopts = "" + if (typeof searchopts !== 'string') searchopts = '' searchopts = searchopts.split(/\s+/) var opts = searchopts.concat(args).map(function (s) { return s.toLowerCase() }).filter(function (s) { return s }) - if (typeof searchexclude === "string") { + if (opts.length === 0) { + return cb(new Error('search must be called with arguments')) + } + + if (typeof searchexclude === 'string') { searchexclude = searchexclude.split(/\s+/) } else { searchexclude = [] @@ -73,7 +84,7 @@ function filter (data, args, notArgs) { return Object.keys(data).map(function (d) { return data[d] }).filter(function (d) { - return typeof d === "object" + return typeof d === 'object' }).map(stripData).map(getWords).filter(function (data) { return filterWords(data, args, notArgs) }).reduce(function (l, r) { @@ -83,51 +94,52 @@ function filter (data, args, notArgs) { } function stripData (data) { - return { name: data.name - , description: npm.config.get("description") ? data.description : "" - , maintainers: (data.maintainers || []).map(function (m) { - return "=" + m.name - }) - , url: !Object.keys(data.versions || {}).length ? data.url : null - , keywords: data.keywords || [] - , version: Object.keys(data.versions || {})[0] || [] - , time: data.time - && data.time.modified - && (new Date(data.time.modified).toISOString() - .split("T").join(" ") - .replace(/:[0-9]{2}\.[0-9]{3}Z$/, "")) - .slice(0, -5) // remove time - || "prehistoric" - } + return { + name: data.name, + description: npm.config.get('description') ? data.description : '', + maintainers: (data.maintainers || []).map(function (m) { + return '=' + m.name + }), + url: !Object.keys(data.versions || {}).length ? data.url : null, + keywords: data.keywords || [], + version: Object.keys(data.versions || {})[0] || [], + time: data.time && + data.time.modified && + (new Date(data.time.modified).toISOString() // remove time + .split('T').join(' ') + .replace(/:[0-9]{2}\.[0-9]{3}Z$/, '')) + .slice(0, -5) || + 'prehistoric' + } } function getWords (data) { data.words = [ data.name ] .concat(data.description) .concat(data.maintainers) - .concat(data.url && ("<" + data.url + ">")) + .concat(data.url && ('<' + data.url + '>')) .concat(data.keywords) .map(function (f) { return f && f.trim && f.trim() }) .filter(function (f) { return f }) - .join(" ") + .join(' ') .toLowerCase() return data } function filterWords (data, args, notArgs) { var words = data.words - for (var i = 0, l = args.length; i < l; i ++) { + for (var i = 0, l = args.length; i < l; i++) { if (!match(words, args[i])) return false } - for (i = 0, l = notArgs.length; i < l; i ++) { + for (i = 0, l = notArgs.length; i < l; i++) { if (match(words, notArgs[i])) return false } return true } function match (words, arg) { - if (arg.charAt(0) === "/") { - arg = arg.replace(/\/$/, "") + if (arg.charAt(0) === '/') { + arg = arg.replace(/\/$/, '') arg = new RegExp(arg.substr(1, arg.length - 1)) return words.match(arg) } @@ -135,132 +147,135 @@ function match (words, arg) { } function prettify (data, args) { - var searchsort = (npm.config.get("searchsort") || "NAME").toLowerCase() - , sortField = searchsort.replace(/^\-+/, "") - , searchRev = searchsort.charAt(0) === "-" - , truncate = !npm.config.get("long") + var searchsort = (npm.config.get('searchsort') || 'NAME').toLowerCase() + var sortField = searchsort.replace(/^\-+/, '') + var searchRev = searchsort.charAt(0) === '-' + var truncate = !npm.config.get('long') if (Object.keys(data).length === 0) { - return "No match found for "+(args.map(JSON.stringify).join(" ")) + return 'No match found for ' + (args.map(JSON.stringify).join(' ')) } var lines = Object.keys(data).map(function (d) { // strip keyname return data[d] - }).map(function(dat) { + }).map(function (dat) { dat.author = dat.maintainers delete dat.maintainers dat.date = dat.time delete dat.time return dat - }).map(function(dat) { + }).map(function (dat) { // split keywords on whitespace or , - if (typeof dat.keywords === "string") { + if (typeof dat.keywords === 'string') { dat.keywords = dat.keywords.split(/[,\s]+/) } if (Array.isArray(dat.keywords)) { - dat.keywords = dat.keywords.join(" ") + dat.keywords = dat.keywords.join(' ') } // split author on whitespace or , - if (typeof dat.author === "string") { + if (typeof dat.author === 'string') { dat.author = dat.author.split(/[,\s]+/) } if (Array.isArray(dat.author)) { - dat.author = dat.author.join(" ") + dat.author = dat.author.join(' ') } return dat }) - lines.sort(function(a, b) { + lines.sort(function (a, b) { var aa = a[sortField].toLowerCase() - , bb = b[sortField].toLowerCase() + var bb = b[sortField].toLowerCase() return aa === bb ? 0 : aa < bb ? -1 : 1 }) if (searchRev) lines.reverse() - var columns = npm.config.get("description") - ? ["name", "description", "author", "date", "version", "keywords"] - : ["name", "author", "date", "version", "keywords"] - - var output = columnify(lines, { - include: columns - , truncate: truncate - , config: { - name: { maxWidth: 40, truncate: false, truncateMarker: "" } - , description: { maxWidth: 60 } - , author: { maxWidth: 20 } - , date: { maxWidth: 11 } - , version: { maxWidth: 11 } - , keywords: { maxWidth: Infinity } + var columns = npm.config.get('description') + ? ['name', 'description', 'author', 'date', 'version', 'keywords'] + : ['name', 'author', 'date', 'version', 'keywords'] + + var output = columnify( + lines, + { + include: columns, + truncate: truncate, + config: { + name: { maxWidth: 40, truncate: false, truncateMarker: '' }, + description: { maxWidth: 60 }, + author: { maxWidth: 20 }, + date: { maxWidth: 11 }, + version: { maxWidth: 11 }, + keywords: { maxWidth: Infinity } } - }) + } + ) output = trimToMaxWidth(output) output = highlightSearchTerms(output, args) return output } -var colors = [31, 33, 32, 36, 34, 35 ] - , cl = colors.length +var colors = [31, 33, 32, 36, 34, 35] +var cl = colors.length function addColorMarker (str, arg, i) { var m = i % cl + 1 - , markStart = String.fromCharCode(m) - , markEnd = String.fromCharCode(0) - - if (arg.charAt(0) === "/") { - //arg = arg.replace(/\/$/, "") - return str.replace( new RegExp(arg.substr(1, arg.length - 2), "gi") - , function (bit) { return markStart + bit + markEnd } ) - + var markStart = String.fromCharCode(m) + var markEnd = String.fromCharCode(0) + + if (arg.charAt(0) === '/') { + return str.replace( + new RegExp(arg.substr(1, arg.length - 2), 'gi'), + function (bit) { return markStart + bit + markEnd } + ) } // just a normal string, do the split/map thing var pieces = str.toLowerCase().split(arg.toLowerCase()) - , p = 0 + var p = 0 return pieces.map(function (piece) { piece = str.substr(p, piece.length) - var mark = markStart - + str.substr(p+piece.length, arg.length) - + markEnd + var mark = markStart + + str.substr(p + piece.length, arg.length) + + markEnd p += piece.length + arg.length return piece + mark - }).join("") + }).join('') } function colorize (line) { - for (var i = 0; i < cl; i ++) { + for (var i = 0; i < cl; i++) { var m = i + 1 - var color = npm.color ? "\033["+colors[i]+"m" : "" + var color = npm.color ? '\u001B[' + colors[i] + 'm' : '' line = line.split(String.fromCharCode(m)).join(color) } - var uncolor = npm.color ? "\033[0m" : "" - return line.split("\u0000").join(uncolor) + var uncolor = npm.color ? '\u001B[0m' : '' + return line.split('\u0000').join(uncolor) } -function getMaxWidth() { +function getMaxWidth () { var cols try { - var tty = require("tty") - , stdout = process.stdout + var tty = require('tty') + var stdout = process.stdout cols = !tty.isatty(stdout.fd) ? Infinity : process.stdout.getWindowSize()[0] cols = (cols === 0) ? Infinity : cols } catch (ex) { cols = Infinity } return cols } -function trimToMaxWidth(str) { +function trimToMaxWidth (str) { var maxWidth = getMaxWidth() - return str.split("\n").map(function(line) { + return str.split('\n').map(function (line) { return line.slice(0, maxWidth) - }).join("\n") + }).join('\n') } -function highlightSearchTerms(str, terms) { +function highlightSearchTerms (str, terms) { terms.forEach(function (arg, i) { str = addColorMarker(str, arg, i) }) diff --git a/deps/npm/lib/set.js b/deps/npm/lib/set.js index c83602ec1f6ce3..b5e7376fbd55f5 100644 --- a/deps/npm/lib/set.js +++ b/deps/npm/lib/set.js @@ -1,13 +1,13 @@ module.exports = set -set.usage = "npm set (See `npm config`)" +set.usage = 'npm set (See `npm config`)' -var npm = require("./npm.js") +var npm = require('./npm.js') set.completion = npm.commands.config.completion function set (args, cb) { if (!args.length) return cb(set.usage) - npm.commands.config(["set"].concat(args), cb) + npm.commands.config(['set'].concat(args), cb) } diff --git a/deps/npm/lib/shrinkwrap.js b/deps/npm/lib/shrinkwrap.js index 03192a3fa47225..9a6d8e76bd549e 100644 --- a/deps/npm/lib/shrinkwrap.js +++ b/deps/npm/lib/shrinkwrap.js @@ -3,84 +3,128 @@ module.exports = exports = shrinkwrap -var npm = require("./npm.js") - , log = require("npmlog") - , fs = require("fs") - , writeFileAtomic = require("write-file-atomic") - , path = require("path") - , readJson = require("read-package-json") - , sortedObject = require("sorted-object") +var path = require('path') +var log = require('npmlog') +var writeFileAtomic = require('write-file-atomic') +var iferr = require('iferr') +var readPackageTree = require('read-package-tree') +var validate = require('aproba') +var npm = require('./npm.js') +var recalculateMetadata = require('./install/deps.js').recalculateMetadata +var validatePeerDeps = require('./install/deps.js').validatePeerDeps +var isExtraneous = require('./install/is-extraneous.js') +var isOnlyDev = require('./install/is-dev.js').isOnlyDev +var packageId = require('./utils/package-id.js') +var moduleName = require('./utils/module-name.js') -shrinkwrap.usage = "npm shrinkwrap" +shrinkwrap.usage = 'npm shrinkwrap' function shrinkwrap (args, silent, cb) { - if (typeof cb !== "function") cb = silent, silent = false + if (typeof cb !== 'function') { + cb = silent + silent = false + } if (args.length) { - log.warn("shrinkwrap", "doesn't take positional args") + log.warn('shrinkwrap', "doesn't take positional args") } - // https://github.com/npm/npm/issues/7641 - // introduced because `npm ls` can now show dev and prod depenednecy - // trees separately - if (npm.config.get("dev")) { - npm.config.set("production", true) - } - npm.commands.ls([], true, function (er, _, pkginfo) { - if (er) return cb(er) - shrinkwrap_(pkginfo, silent, npm.config.get("dev"), cb) - }) + var dir = path.resolve(npm.dir, '..') + npm.config.set('production', true) + readPackageTree(dir, andRecalculateMetadata(iferr(cb, function (tree) { + var pkginfo = treeToShrinkwrap(tree, !!npm.config.get('dev') || /^dev(elopment)?$/.test(npm.config.get('also'))) + shrinkwrap_(pkginfo, silent, cb) + }))) } -function shrinkwrap_ (pkginfo, silent, dev, cb) { - if (pkginfo.problems) { - return cb(new Error("Problems were encountered\n" - +"Please correct and try again.\n" - +pkginfo.problems.join("\n"))) +function andRecalculateMetadata (next) { + validate('F', arguments) + return function (er, tree) { + validate('EO', arguments) + if (er) return next(er) + recalculateMetadata(tree, log, next) } +} - if (!dev) { - // remove dev deps unless the user does --dev - readJson(path.resolve(npm.prefix, "package.json"), function (er, data) { - if (er) - return cb(er) - if (data.devDependencies) { - Object.keys(data.devDependencies).forEach(function (dep) { - if (data.dependencies && data.dependencies[dep]) { - // do not exclude the dev dependency if it's also listed as a dependency - return - } +function treeToShrinkwrap (tree, dev) { + validate('OB', arguments) + var pkginfo = {} + if (tree.package.name) pkginfo.name = tree.package.name + if (tree.package.version) pkginfo.version = tree.package.version + var problems = [] + if (tree.children.length) { + shrinkwrapDeps(dev, problems, pkginfo.dependencies = {}, tree) + } + if (problems.length) pkginfo.problems = problems + return pkginfo +} - log.warn("shrinkwrap", "Excluding devDependency: %s", dep, data.dependencies) - delete pkginfo.dependencies[dep] - }) - } - save(pkginfo, silent, cb) +function shrinkwrapDeps (dev, problems, deps, tree, seen) { + validate('BAOO', [dev, problems, deps, tree]) + if (!seen) seen = {} + if (seen[tree.path]) return + seen[tree.path] = true + Object.keys(tree.missingDeps).forEach(function (name) { + var invalid = tree.children.filter(function (dep) { return moduleName(dep) === name })[0] + if (invalid) { + problems.push('invalid: have ' + invalid.package._id + ' (expected: ' + tree.missingDeps[name] + ') ' + invalid.path) + } else if (!tree.package.optionalDependencies || !tree.package.optionalDependencies[name]) { + var topname = packageId(tree) + problems.push('missing: ' + name + '@' + tree.package.dependencies[name] + + (topname ? ', required by ' + topname : '')) + } + }) + tree.children.sort(function (aa, bb) { return moduleName(aa).localeCompare(moduleName(bb)) }).forEach(function (child) { + if (!dev && isOnlyDev(child)) { + log.warn('shrinkwrap', 'Excluding devDependency: %s', packageId(child), child.parent.package.dependencies) + return + } + var pkginfo = deps[moduleName(child)] = {} + pkginfo.version = child.package.version + pkginfo.from = child.package._from + pkginfo.resolved = child.package._resolved + if (isExtraneous(child)) { + problems.push('extraneous: ' + child.package._id + ' ' + child.path) + } + validatePeerDeps(child, function (tree, pkgname, version) { + problems.push('peer invalid: ' + pkgname + '@' + version + + ', required by ' + child.package._id) }) - } else { - save(pkginfo, silent, cb) - } + if (child.children.length) { + shrinkwrapDeps(dev, problems, pkginfo.dependencies = {}, child, seen) + } + }) } +function shrinkwrap_ (pkginfo, silent, cb) { + if (pkginfo.problems) { + return cb(new Error('Problems were encountered\n' + + 'Please correct and try again.\n' + + pkginfo.problems.join('\n'))) + } + + save(pkginfo, silent, cb) +} function save (pkginfo, silent, cb) { // copy the keys over in a well defined order // because javascript objects serialize arbitrarily - pkginfo.dependencies = sortedObject(pkginfo.dependencies || {}) var swdata try { - swdata = JSON.stringify(pkginfo, null, 2) + "\n" + swdata = JSON.stringify(pkginfo, null, 2) + '\n' } catch (er) { - log.error("shrinkwrap", "Error converting package info to json") + log.error('shrinkwrap', 'Error converting package info to json') return cb(er) } - var file = path.resolve(npm.prefix, "npm-shrinkwrap.json") + var file = path.resolve(npm.prefix, 'npm-shrinkwrap.json') writeFileAtomic(file, swdata, function (er) { if (er) return cb(er) if (silent) return cb(null, pkginfo) - console.log("wrote npm-shrinkwrap.json") + log.clearProgress() + console.log('wrote npm-shrinkwrap.json') + log.showProgress() cb(null, pkginfo) }) } diff --git a/deps/npm/lib/star.js b/deps/npm/lib/star.js index 1f324336c0c57f..29c4037d0cb2b0 100644 --- a/deps/npm/lib/star.js +++ b/deps/npm/lib/star.js @@ -1,13 +1,12 @@ - module.exports = star -var npm = require("./npm.js") - , log = require("npmlog") - , asyncMap = require("slide").asyncMap - , mapToRegistry = require("./utils/map-to-registry.js") +var npm = require('./npm.js') +var log = require('npmlog') +var asyncMap = require('slide').asyncMap +var mapToRegistry = require('./utils/map-to-registry.js') -star.usage = "npm star [pkg, pkg, ...]\n" - + "npm unstar [pkg, pkg, ...]" +star.usage = 'npm star [...]\n' + + 'npm unstar [...]' star.completion = function (opts, cb) { // FIXME: there used to be registry completion here, but it stopped making @@ -17,22 +16,22 @@ star.completion = function (opts, cb) { function star (args, cb) { if (!args.length) return cb(star.usage) - var s = npm.config.get("unicode") ? "\u2605 " : "(*)" - , u = npm.config.get("unicode") ? "\u2606 " : "( )" - , using = !(npm.command.match(/^un/)) + var s = npm.config.get('unicode') ? '\u2605 ' : '(*)' + var u = npm.config.get('unicode') ? '\u2606 ' : '( )' + var using = !(npm.command.match(/^un/)) if (!using) s = u asyncMap(args, function (pkg, cb) { mapToRegistry(pkg, npm.config, function (er, uri, auth) { if (er) return cb(er) var params = { - starred : using, - auth : auth + starred: using, + auth: auth } npm.registry.star(uri, params, function (er, data, raw, req) { if (!er) { - console.log(s + " "+pkg) - log.verbose("star", data) + console.log(s + ' ' + pkg) + log.verbose('star', data) } cb(er, data, raw, req) }) diff --git a/deps/npm/lib/stars.js b/deps/npm/lib/stars.js index 01ec76e42c1f4c..4ad8f02e59dca9 100644 --- a/deps/npm/lib/stars.js +++ b/deps/npm/lib/stars.js @@ -1,10 +1,10 @@ module.exports = stars -stars.usage = "npm stars [username]" +stars.usage = 'npm stars []' -var npm = require("./npm.js") - , log = require("npmlog") - , mapToRegistry = require("./utils/map-to-registry.js") +var npm = require('./npm.js') +var log = require('npmlog') +var mapToRegistry = require('./utils/map-to-registry.js') function stars (args, cb) { npm.commands.whoami([], true, function (er, username) { @@ -20,12 +20,12 @@ function stars (args, cb) { if (er.code !== 'ENEEDAUTH') return cb(er) } - mapToRegistry("", npm.config, function (er, uri, auth) { + mapToRegistry('', npm.config, function (er, uri, auth) { if (er) return cb(er) var params = { - username : name, - auth : auth + username: name, + auth: auth } npm.registry.stars(uri, params, showstars) }) @@ -35,9 +35,9 @@ function stars (args, cb) { if (er) return cb(er) if (data.rows.length === 0) { - log.warn("stars", "user has not starred any packages.") + log.warn('stars', 'user has not starred any packages.') } else { - data.rows.forEach(function(a) { + data.rows.forEach(function (a) { console.log(a.value) }) } diff --git a/deps/npm/lib/start.js b/deps/npm/lib/start.js index 98823825bb17ba..85d61e78d0a43a 100644 --- a/deps/npm/lib/start.js +++ b/deps/npm/lib/start.js @@ -1 +1 @@ -module.exports = require("./utils/lifecycle.js").cmd("start") +module.exports = require('./utils/lifecycle.js').cmd('start') diff --git a/deps/npm/lib/stop.js b/deps/npm/lib/stop.js index 8ea5ba6aa61b99..e4d02ff28165b9 100644 --- a/deps/npm/lib/stop.js +++ b/deps/npm/lib/stop.js @@ -1 +1 @@ -module.exports = require("./utils/lifecycle.js").cmd("stop") +module.exports = require('./utils/lifecycle.js').cmd('stop') diff --git a/deps/npm/lib/substack.js b/deps/npm/lib/substack.js index 1929f187384949..c39a5dcc482a8d 100644 --- a/deps/npm/lib/substack.js +++ b/deps/npm/lib/substack.js @@ -1,15 +1,16 @@ module.exports = substack -var npm = require("./npm.js") +var npm = require('./npm.js') -var isms = - [ "\033[32mbeep \033[35mboop\033[m" - , "Replace your configs with services" - , "SEPARATE ALL THE CONCERNS!" - , "MODULE ALL THE THINGS!" - , "\\o/" - , "but first, burritos" - , "full time mad scientist here" - , "c/,,\\" ] +var isms = [ + '\u001b[32mbeep \u001b[35mboop\u001b[m', + 'Replace your configs with services', + 'SEPARATE ALL THE CONCERNS!', + 'MODULE ALL THE THINGS!', + '\\o/', + 'but first, burritos', + 'full time mad scientist here', + 'c/,,\\' +] function substack (args, cb) { var i = Math.floor(Math.random() * isms.length) diff --git a/deps/npm/lib/tag.js b/deps/npm/lib/tag.js index 75da0b2174fff7..01db4d8ea65b1d 100644 --- a/deps/npm/lib/tag.js +++ b/deps/npm/lib/tag.js @@ -1,40 +1,41 @@ // turns out tagging isn't very complicated // all the smarts are in the couch. module.exports = tag -tag.usage = "npm tag @ []" +tag.usage = '[DEPRECATED] npm tag @ []' + + '\nSee `dist-tag`' -tag.completion = require("./unpublish.js").completion +tag.completion = require('./unpublish.js').completion -var npm = require("./npm.js") - , mapToRegistry = require("./utils/map-to-registry.js") - , npa = require("npm-package-arg") - , semver = require("semver") - , log = require("npmlog") +var npm = require('./npm.js') +var mapToRegistry = require('./utils/map-to-registry.js') +var npa = require('npm-package-arg') +var semver = require('semver') +var log = require('npmlog') function tag (args, cb) { - var thing = npa(args.shift() || "") - , project = thing.name - , version = thing.rawSpec - , t = args.shift() || npm.config.get("tag") + var thing = npa(args.shift() || '') + var project = thing.name + var version = thing.rawSpec + var t = args.shift() || npm.config.get('tag') t = t.trim() - if (!project || !version || !t) return cb("Usage:\n"+tag.usage) + if (!project || !version || !t) return cb('Usage:\n' + tag.usage) if (semver.validRange(t)) { - var er = new Error("Tag name must not be a valid SemVer range: " + t) + var er = new Error('Tag name must not be a valid SemVer range: ' + t) return cb(er) } - log.warn("tag", "This command is deprecated. Use `npm dist-tag` instead.") + log.warn('tag', 'This command is deprecated. Use `npm dist-tag` instead.') mapToRegistry(project, npm.config, function (er, uri, auth) { if (er) return cb(er) var params = { - version : version, - tag : t, - auth : auth + version: version, + tag: t, + auth: auth } npm.registry.tag(uri, params, cb) }) diff --git a/deps/npm/lib/test.js b/deps/npm/lib/test.js index dd4994cf28d159..cbc75821708b12 100644 --- a/deps/npm/lib/test.js +++ b/deps/npm/lib/test.js @@ -1,12 +1,12 @@ module.exports = test -var testCmd = require("./utils/lifecycle.js").cmd("test") +var testCmd = require('./utils/lifecycle.js').cmd('test') function test (args, cb) { testCmd(args, function (er) { if (!er) return cb() - if (er.code === "ELIFECYCLE") { - return cb("Test failed. See above for more details.") + if (er.code === 'ELIFECYCLE') { + return cb('Test failed. See above for more details.') } return cb(er) }) diff --git a/deps/npm/lib/unbuild.js b/deps/npm/lib/unbuild.js index d5fe0e6a0d1541..9bb8d7b6658bac 100644 --- a/deps/npm/lib/unbuild.js +++ b/deps/npm/lib/unbuild.js @@ -1,59 +1,70 @@ module.exports = unbuild -unbuild.usage = "npm unbuild \n(this is plumbing)" +module.exports.rmStuff = rmStuff +unbuild.usage = 'npm unbuild \n(this is plumbing)' -var readJson = require("read-package-json") - , gentlyRm = require("./utils/gently-rm.js") - , npm = require("./npm.js") - , path = require("path") - , isInside = require("path-is-inside") - , lifecycle = require("./utils/lifecycle.js") - , asyncMap = require("slide").asyncMap - , chain = require("slide").chain - , log = require("npmlog") - , build = require("./build.js") +var readJson = require('read-package-json') +var gentlyRm = require('./utils/gently-rm.js') +var npm = require('./npm.js') +var path = require('path') +var isInside = require('path-is-inside') +var lifecycle = require('./utils/lifecycle.js') +var asyncMap = require('slide').asyncMap +var chain = require('slide').chain +var log = require('npmlog') +var build = require('./build.js') // args is a list of folders. // remove any bins/etc, and then delete the folder. function unbuild (args, silent, cb) { - if (typeof silent === "function") cb = silent, silent = false + if (typeof silent === 'function') { + cb = silent + silent = false + } asyncMap(args, unbuild_(silent), cb) } -function unbuild_ (silent) { return function (folder, cb_) { - function cb (er) { - cb_(er, path.relative(npm.root, folder)) - } - folder = path.resolve(folder) - var base = isInside(folder, npm.prefix) ? npm.prefix : folder - delete build._didBuild[folder] - log.verbose("unbuild", folder.substr(npm.prefix.length + 1)) - readJson(path.resolve(folder, "package.json"), function (er, pkg) { - // if no json, then just trash it, but no scripts or whatever. - if (er) return gentlyRm(folder, false, base, cb) - chain - ( [ [lifecycle, pkg, "preuninstall", folder, false, true] - , [lifecycle, pkg, "uninstall", folder, false, true] - , !silent && function(cb) { - console.log("unbuild " + pkg._id) +function unbuild_ (silent) { + return function (folder, cb_) { + function cb (er) { + cb_(er, path.relative(npm.root, folder)) + } + folder = path.resolve(folder) + var base = isInside(folder, npm.prefix) ? npm.prefix : folder + delete build._didBuild[folder] + log.verbose('unbuild', folder.substr(npm.prefix.length + 1)) + readJson(path.resolve(folder, 'package.json'), function (er, pkg) { + // if no json, then just trash it, but no scripts or whatever. + if (er) return gentlyRm(folder, false, base, cb) + chain( + [ + [lifecycle, pkg, 'preuninstall', folder, false, true], + [lifecycle, pkg, 'uninstall', folder, false, true], + !silent && function (cb) { + log.clearProgress() + console.log('unbuild ' + pkg._id) + log.showProgress() cb() - } - , [rmStuff, pkg, folder] - , [lifecycle, pkg, "postuninstall", folder, false, true] - , [gentlyRm, folder, false, base] ] - , cb ) - }) -}} + }, + [rmStuff, pkg, folder], + [lifecycle, pkg, 'postuninstall', folder, false, true], + [gentlyRm, folder, false, base] + ], + cb + ) + }) + } +} function rmStuff (pkg, folder, cb) { // if it's global, and folder is in {prefix}/node_modules, // then bins are in {prefix}/bin // otherwise, then bins are in folder/../.bin var parent = path.dirname(folder) - , gnm = npm.dir - , top = gnm === parent + var gnm = npm.dir + var top = gnm === parent - log.verbose("unbuild rmStuff", pkg._id, "from", gnm) - if (!top) log.verbose("unbuild rmStuff", "in", parent) + log.verbose('unbuild rmStuff', pkg._id, 'from', gnm) + if (!top) log.verbose('unbuild rmStuff', 'in', parent) asyncMap([rmBins, rmMans], function (fn, cb) { fn(pkg, folder, parent, top, cb) }, cb) @@ -61,26 +72,31 @@ function rmStuff (pkg, folder, cb) { function rmBins (pkg, folder, parent, top, cb) { if (!pkg.bin) return cb() - var binRoot = top ? npm.bin : path.resolve(parent, ".bin") + var binRoot = top ? npm.bin : path.resolve(parent, '.bin') asyncMap(Object.keys(pkg.bin), function (b, cb) { - if (process.platform === "win32") { - chain([ [gentlyRm, path.resolve(binRoot, b) + ".cmd", true] - , [gentlyRm, path.resolve(binRoot, b), true] ], cb) + if (process.platform === 'win32') { + chain([ [gentlyRm, path.resolve(binRoot, b) + '.cmd', true, folder], + [gentlyRm, path.resolve(binRoot, b), true, folder] ], cb) } else { - gentlyRm(path.resolve(binRoot, b), true, cb) + gentlyRm(path.resolve(binRoot, b), true, folder, cb) } - }, cb) + }, gentlyRmBinRoot) + + function gentlyRmBinRoot (err) { + if (err || top) return cb(err) + return gentlyRm(binRoot, true, parent, cb) + } } function rmMans (pkg, folder, parent, top, cb) { - if (!pkg.man - || !top - || process.platform === "win32" - || !npm.config.get("global")) { + if (!pkg.man || + !top || + process.platform === 'win32' || + !npm.config.get('global')) { return cb() } - var manRoot = path.resolve(npm.config.get("prefix"), "share", "man") - log.verbose("rmMans", "man files are", pkg.man, "in", manRoot) + var manRoot = path.resolve(npm.config.get('prefix'), 'share', 'man') + log.verbose('rmMans', 'man files are', pkg.man, 'in', manRoot) asyncMap(pkg.man, function (man, cb) { if (Array.isArray(man)) { man.forEach(rmMan) @@ -89,25 +105,25 @@ function rmMans (pkg, folder, parent, top, cb) { } function rmMan (man) { - log.silly("rmMan", "preparing to remove", man) + log.silly('rmMan', 'preparing to remove', man) var parseMan = man.match(/(.*\.([0-9]+)(\.gz)?)$/) if (!parseMan) { log.error( - "rmMan", man, "is not a valid name for a man file.", - "Man files must end with a number, " + - "and optionally a .gz suffix if they are compressed." + 'rmMan', man, 'is not a valid name for a man file.', + 'Man files must end with a number, ' + + 'and optionally a .gz suffix if they are compressed.' ) return cb() } var stem = parseMan[1] var sxn = parseMan[2] - var gz = parseMan[3] || "" + var gz = parseMan[3] || '' var bn = path.basename(stem) var manDest = path.join( manRoot, - "man"+sxn, - (bn.indexOf(pkg.name) === 0 ? bn : pkg.name+"-"+bn)+"."+sxn+gz + 'man' + sxn, + (bn.indexOf(pkg.name) === 0 ? bn : pkg.name + '-' + bn) + '.' + sxn + gz ) gentlyRm(manDest, true, cb) } diff --git a/deps/npm/lib/uninstall.js b/deps/npm/lib/uninstall.js index 600c6819740f77..03a0a56303c3d5 100644 --- a/deps/npm/lib/uninstall.js +++ b/deps/npm/lib/uninstall.js @@ -1,128 +1,73 @@ - +'use strict' // remove a package. module.exports = uninstall +module.exports.Uninstaller = Uninstaller -uninstall.usage = "npm uninstall [@ [[@] ...]" - + "\nnpm rm [@ [[@] ...]" +uninstall.usage = 'npm uninstall [<@scope>/][@]... [--save|--save-dev|--save-optional]' + + '\n\naliases: remove, rm, r, un, unlink' -uninstall.completion = require("./utils/completion/installed-shallow.js") +var util = require('util') +var path = require('path') +var validate = require('aproba') +var chain = require('slide').chain +var readJson = require('read-package-json') +var npm = require('./npm.js') +var Installer = require('./install.js').Installer +var getSaveType = require('./install/save.js').getSaveType +var removeDeps = require('./install/deps.js').removeDeps +var loadExtraneous = require('./install/deps.js').loadExtraneous +var log = require('npmlog') -var fs = require("graceful-fs") - , writeFileAtomic = require("write-file-atomic") - , log = require("npmlog") - , readJson = require("read-package-json") - , path = require("path") - , npm = require("./npm.js") - , asyncMap = require("slide").asyncMap +uninstall.completion = require('./utils/completion/installed-shallow.js') function uninstall (args, cb) { - // this is super easy - // get the list of args that correspond to package names in either - // the global npm.dir, - // then call unbuild on all those folders to pull out their bins - // and mans and whatnot, and then delete the folder. - - var nm = npm.dir - if (args.length === 1 && args[0] === ".") args = [] - if (args.length) return uninstall_(args, nm, cb) + validate('AF', arguments) + // the /path/to/node_modules/.. + var dryrun = !!npm.config.get('dry-run') - // remove this package from the global space, if it's installed there - readJson(path.resolve(npm.localPrefix, "package.json"), function (er, pkg) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) - if (er) return cb(uninstall.usage) - uninstall_( [pkg.name] - , npm.globalDir - , cb ) + if (args.length === 1 && args[0] === '.') args = [] + args = args.filter(function (a) { + return path.resolve(a) !== where }) -} - -function uninstall_ (args, nm, cb) { - // if we've been asked to --save or --save-dev or --save-optional, - // then also remove it from the associated dependencies hash. - var s = npm.config.get('save') - , d = npm.config.get('save-dev') - , o = npm.config.get('save-optional') - if (s || d || o) { - cb = saver(args, nm, cb) - } - - asyncMap(args, function (arg, cb) { - // uninstall .. should not delete /usr/local/lib/node_modules/.. - var p = path.join(path.resolve(nm), path.join("/", arg)) - if (path.resolve(p) === nm) { - log.warn("uninstall", "invalid argument: %j", arg) - return cb(null, []) - } - fs.lstat(p, function (er) { - if (er) { - log.warn("uninstall", "not installed in %s: %j", nm, arg) - return cb(null, []) - } - cb(null, p) + var where = npm.config.get('global') || !args.length + ? path.resolve(npm.globalDir, '..') + : npm.prefix + + if (args.length) { + new Uninstaller(where, dryrun, args).run(cb) + } else { + // remove this package from the global space, if it's installed there + readJson(path.resolve(npm.localPrefix, 'package.json'), function (er, pkg) { + if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) + if (er) return cb(uninstall.usage) + new Uninstaller(where, dryrun, [pkg.name]).run(cb) }) - }, function (er, folders) { - if (er) return cb(er) - asyncMap(folders, npm.commands.unbuild, cb) - }) + } } -function saver (args, nm, cb_) { - return cb - function cb (er, data) { - var s = npm.config.get('save') - , d = npm.config.get('save-dev') - , o = npm.config.get('save-optional') - if (er || !(s || d || o)) return cb_(er, data) - var pj = path.resolve(nm, '..', 'package.json') - // don't use readJson here, because we don't want all the defaults - // filled in, for mans and other bs. - fs.readFile(pj, 'utf8', function (er, json) { - var pkg - try { - pkg = JSON.parse(json) - } catch (_) {} - if (!pkg) return cb_(null, data) - - var bundle - if (npm.config.get('save-bundle')) { - bundle = pkg.bundleDependencies || pkg.bundledDependencies - if (!Array.isArray(bundle)) bundle = undefined - } - - var changed = false - args.forEach(function (a) { - ; [ [s, 'dependencies'] - , [o, 'optionalDependencies'] - , [d, 'devDependencies'] ].forEach(function (f) { - var flag = f[0] - , field = f[1] - if (!flag || !pkg[field] || !pkg[field].hasOwnProperty(a)) return - changed = true +function Uninstaller (where, dryrun, args) { + validate('SBA', arguments) + Installer.call(this, where, dryrun, args) +} +util.inherits(Uninstaller, Installer) - if (bundle) { - var i = bundle.indexOf(a) - if (i !== -1) bundle.splice(i, 1) - } +Uninstaller.prototype.loadArgMetadata = function (next) { + this.args = this.args.map(function (arg) { return {name: arg} }) + next() +} - delete pkg[field][a] - }) - }) - if (!changed) return cb_(null, data) +Uninstaller.prototype.loadAllDepsIntoIdealTree = function (cb) { + validate('F', arguments) + log.silly('uninstall', 'loadAllDepsIntoIdealtree') + var saveDeps = getSaveType(this.args) - if (bundle) { - delete pkg.bundledDependencies - if (bundle.length) { - pkg.bundleDependencies = bundle - } else { - delete pkg.bundleDependencies - } - } + var cg = this.progress.loadAllDepsIntoIdealTree + var steps = [] - writeFileAtomic(pj, JSON.stringify(pkg, null, 2) + "\n", function (er) { - return cb_(er, data) - }) - }) - } + steps.push( + [removeDeps, this.args, this.idealTree, saveDeps, cg.newGroup('removeDeps')], + [loadExtraneous, this.idealTree, cg.newGroup('loadExtraneous')]) + chain(steps, cb) } diff --git a/deps/npm/lib/unpublish.js b/deps/npm/lib/unpublish.js index 111f27aa2d2997..63f87b8207d246 100644 --- a/deps/npm/lib/unpublish.js +++ b/deps/npm/lib/unpublish.js @@ -1,15 +1,15 @@ module.exports = unpublish -var log = require("npmlog") -var npm = require("./npm.js") -var readJson = require("read-package-json") -var path = require("path") -var mapToRegistry = require("./utils/map-to-registry.js") -var npa = require("npm-package-arg") -var getPublishConfig = require("./utils/get-publish-config.js") +var log = require('npmlog') +var npm = require('./npm.js') +var readJson = require('read-package-json') +var path = require('path') +var mapToRegistry = require('./utils/map-to-registry.js') +var npa = require('npm-package-arg') +var getPublishConfig = require('./utils/get-publish-config.js') -unpublish.usage = "npm unpublish [@]" +unpublish.usage = 'npm unpublish [<@scope>/][@]' unpublish.completion = function (opts, cb) { if (opts.conf.argv.remain.length >= 3) return cb() @@ -18,11 +18,11 @@ unpublish.completion = function (opts, cb) { var un = encodeURIComponent(username) if (!un) return cb() - var byUser = "-/by-user/" + un + var byUser = '-/by-user/' + un mapToRegistry(byUser, npm.config, function (er, uri, auth) { if (er) return cb(er) - npm.registry.get(uri, { auth : auth }, function (er, pkgs) { + npm.registry.get(uri, { auth: auth }, function (er, pkgs) { // do a bit of filtering at this point, so that we don't need // to fetch versions for more than one thing, but also don't // accidentally a whole project. @@ -36,12 +36,12 @@ unpublish.completion = function (opts, cb) { mapToRegistry(pkgs[0], npm.config, function (er, uri, auth) { if (er) return cb(er) - npm.registry.get(uri, { auth : auth }, function (er, d) { + npm.registry.get(uri, { auth: auth }, function (er, d) { if (er) return cb(er) var vers = Object.keys(d.versions) if (!vers.length) return cb(null, pkgs) return cb(null, vers.map(function (v) { - return pkgs[0] + "@" + v + return pkgs[0] + '@' + v })) }) }) @@ -54,24 +54,26 @@ function unpublish (args, cb) { if (args.length > 1) return cb(unpublish.usage) var thing = args.length ? npa(args[0]) : {} - , project = thing.name - , version = thing.rawSpec - - log.silly("unpublish", "args[0]", args[0]) - log.silly("unpublish", "thing", thing) - if (!version && !npm.config.get("force")) { - return cb("Refusing to delete entire project.\n" - + "Run with --force to do this.\n" - + unpublish.usage) + var project = thing.name + var version = thing.rawSpec + + log.silly('unpublish', 'args[0]', args[0]) + log.silly('unpublish', 'thing', thing) + if (!version && !npm.config.get('force')) { + return cb( + 'Refusing to delete entire project.\n' + + 'Run with --force to do this.\n' + + unpublish.usage + ) } if (!project || path.resolve(project) === npm.localPrefix) { // if there's a package.json in the current folder, then // read the package name and version out of that. - var cwdJson = path.join(npm.localPrefix, "package.json") + var cwdJson = path.join(npm.localPrefix, 'package.json') return readJson(cwdJson, function (er, data) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) - if (er) return cb("Usage:\n" + unpublish.usage) + if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) + if (er) return cb('Usage:\n' + unpublish.usage) log.verbose('unpublish', data) gotProject(data.name, data.version, data.publishConfig, cb) }) @@ -87,7 +89,7 @@ function gotProject (project, version, publishConfig, cb_) { function cb (er) { if (er) return cb_(er) - console.log("- " + project + (version ? "@" + version : "")) + console.log('- ' + project + (version ? '@' + version : '')) cb_() } @@ -96,9 +98,9 @@ function gotProject (project, version, publishConfig, cb_) { var registry = mappedConfig.client // remove from the cache first - npm.commands.cache(["clean", project, version], function (er) { + npm.commands.cache(['clean', project, version], function (er) { if (er) { - log.error("unpublish", "Failed to clean cache") + log.error('unpublish', 'Failed to clean cache') return cb(er) } diff --git a/deps/npm/lib/update.js b/deps/npm/lib/update.js index 3e9438e9231629..f09b5accade972 100644 --- a/deps/npm/lib/update.js +++ b/deps/npm/lib/update.js @@ -1,58 +1,60 @@ -/* -for each pkg in prefix that isn't a git repo - look for a new version of pkg that satisfies dep - if so, install it. - if not, then update it -*/ - module.exports = update -update.usage = "npm update [pkg]" - -var npm = require("./npm.js") - , asyncMap = require("slide").asyncMap - , log = require("npmlog") +update.usage = 'npm update [-g] [...]' - // load these, just so that we know that they'll be available, in case - // npm itself is getting overwritten. - , install = require("./install.js") - , build = require("./build.js") +var url = require('url') +var log = require('npmlog') +var chain = require('slide').chain +var npm = require('./npm.js') +var Installer = require('./install.js').Installer update.completion = npm.commands.outdated.completion function update (args, cb) { - npm.commands.outdated(args, true, function (er, outdated) { + var dryrun = false + if (npm.config.get('dry-run')) dryrun = true + + npm.commands.outdated(args, true, function (er, rawOutdated) { if (er) return cb(er) + var outdated = rawOutdated.map(function (ww) { + return { + dep: ww[0], + depname: ww[1], + current: ww[2], + wanted: ww[3], + latest: ww[4], + req: ww[5], + what: ww[1] + '@' + ww[3] + } + }) var wanted = outdated.filter(function (ww) { - var dep = ww[1] - var current = ww[2] - var wanted = ww[3] - var latest = ww[4] - if (current === wanted && wanted !== latest) { + if (ww.current === ww.wanted && ww.wanted !== ww.latest) { log.verbose( 'outdated', - 'not updating', dep, + 'not updating', ww.depname, "because it's currently at the maximum version that matches its specified semver range" ) } - return current !== wanted + return ww.current !== ww.wanted && ww.latest !== 'linked' }) if (wanted.length === 0) return cb() log.info('outdated', 'updating', wanted) - asyncMap(wanted, function (ww, cb) { - // [[ dir, dep, has, want, req ]] - var where = ww[0] - , dep = ww[1] - , want = ww[3] - , what = dep + "@" + want - , req = ww[5] - , url = require('url') - + var toInstall = {} + wanted.forEach(function (ww) { // use the initial installation method (repo, tar, git) for updating - if (url.parse(req).protocol) what = req - npm.commands.install(where, what, cb) - }, cb) + if (url.parse(ww.req).protocol) ww.what = ww.req + + var where = ww.dep.parent && ww.dep.parent.path || ww.dep.path + if (toInstall[where]) { + toInstall[where].push(ww.what) + } else { + toInstall[where] = [ww.what] + } + }) + chain(Object.keys(toInstall).map(function (where) { + return [new Installer(where, dryrun, toInstall[where]), 'run'] + }), cb) }) } diff --git a/deps/npm/lib/utils/child-path.js b/deps/npm/lib/utils/child-path.js new file mode 100644 index 00000000000000..4594f43221ff62 --- /dev/null +++ b/deps/npm/lib/utils/child-path.js @@ -0,0 +1,10 @@ +'use strict' +var path = require('path') +var validate = require('aproba') +var moduleName = require('../utils/module-name.js') + +module.exports = childPath +function childPath (parentPath, child) { + validate('SO', arguments) + return path.join(parentPath, 'node_modules', moduleName(child)) +} diff --git a/deps/npm/lib/utils/completion/file-completion.js b/deps/npm/lib/utils/completion/file-completion.js index 6ce2f83467d012..78777a025ec88a 100644 --- a/deps/npm/lib/utils/completion/file-completion.js +++ b/deps/npm/lib/utils/completion/file-completion.js @@ -1,21 +1,24 @@ module.exports = fileCompletion -var mkdir = require("mkdirp") - , path = require("path") - , glob = require("glob") +var mkdir = require('mkdirp') +var path = require('path') +var glob = require('glob') function fileCompletion (root, req, depth, cb) { - if (typeof cb !== "function") cb = depth, depth = Infinity + if (typeof cb !== 'function') { + cb = depth + depth = Infinity + } mkdir(root, function (er) { if (er) return cb(er) // can be either exactly the req, or a descendent - var pattern = root + "/{" + req + "," + req + "/**/*}" - , opts = { mark: true, dot: true, maxDepth: depth } + var pattern = root + '/{' + req + ',' + req + '/**/*}' + var opts = { mark: true, dot: true, maxDepth: depth } glob(pattern, opts, function (er, files) { if (er) return cb(er) return cb(null, (files || []).map(function (f) { - var tail = f.substr(root.length + 1).replace(/^\//, "") + var tail = f.substr(root.length + 1).replace(/^\//, '') return path.join(req, tail) })) }) diff --git a/deps/npm/lib/utils/completion/installed-deep.js b/deps/npm/lib/utils/completion/installed-deep.js index 5fb67d263f12e7..dc9bfbee8a2da7 100644 --- a/deps/npm/lib/utils/completion/installed-deep.js +++ b/deps/npm/lib/utils/completion/installed-deep.js @@ -1,21 +1,25 @@ module.exports = installedDeep -var npm = require("../../npm.js") - , readInstalled = require("read-installed") +var npm = require('../../npm.js') +var readInstalled = require('read-installed') function installedDeep (opts, cb) { var local - , global - , depth = npm.config.get("depth") - , opt = { depth: depth, dev: true } + var global + var depth = npm.config.get('depth') + var opt = { depth: depth, dev: true } - if (npm.config.get("global")) local = [], next() - else readInstalled(npm.prefix, opt, function (er, data) { - local = getNames(data || {}) + if (npm.config.get('global')) { + local = [] next() - }) + } else { + readInstalled(npm.prefix, opt, function (er, data) { + local = getNames(data || {}) + next() + }) + } - readInstalled(npm.config.get("prefix"), opt, function (er, data) { + readInstalled(npm.config.get('prefix'), opt, function (er, data) { global = getNames(data || {}) next() }) @@ -37,14 +41,12 @@ function installedDeep (opts, cb) { function next () { if (!local || !global) return - if (!npm.config.get("global")) { + if (!npm.config.get('global')) { global = global.map(function (g) { - return [g, "-g"] + return [g, '-g'] }) } var names = local.concat(global) return cb(null, names) } - } - diff --git a/deps/npm/lib/utils/completion/installed-shallow.js b/deps/npm/lib/utils/completion/installed-shallow.js index 8d64649d5f66a9..bf692fedea3a5d 100644 --- a/deps/npm/lib/utils/completion/installed-shallow.js +++ b/deps/npm/lib/utils/completion/installed-shallow.js @@ -1,31 +1,39 @@ module.exports = installedShallow -var npm = require("../../npm.js") - , fs = require("graceful-fs") - , path = require("path") - , readJson = require("read-package-json") - , asyncMap = require("slide").asyncMap +var npm = require('../../npm.js') +var fs = require('graceful-fs') +var path = require('path') +var readJson = require('read-package-json') +var asyncMap = require('slide').asyncMap function installedShallow (opts, filter, cb) { - if (typeof cb !== "function") cb = filter, filter = null + if (typeof cb !== 'function') { + cb = filter + filter = null + } var conf = opts.conf - , args = conf.argv.remain + var args = conf.argv.remain if (args.length > 3) return cb() var local - , global - , localDir = npm.dir - , globalDir = npm.globalDir - if (npm.config.get("global")) local = [], next() - else fs.readdir(localDir, function (er, pkgs) { - local = (pkgs || []).filter(function (p) { - return p.charAt(0) !== "." - }) + var global + var localDir = npm.dir + var globalDir = npm.globalDir + if (npm.config.get('global')) { + local = [] next() - }) + } else { + fs.readdir(localDir, function (er, pkgs) { + local = (pkgs || []).filter(function (p) { + return p.charAt(0) !== '.' + }) + next() + }) + } + fs.readdir(globalDir, function (er, pkgs) { global = (pkgs || []).filter(function (p) { - return p.charAt(0) !== "." + return p.charAt(0) !== '.' }) next() }) @@ -37,7 +45,7 @@ function installedShallow (opts, filter, cb) { function filterInstalled (local, global, filter, cb) { var fl - , fg + var fg if (!filter) { fl = local @@ -46,7 +54,7 @@ function filterInstalled (local, global, filter, cb) { } asyncMap(local, function (p, cb) { - readJson(path.join(npm.dir, p, "package.json"), function (er, d) { + readJson(path.join(npm.dir, p, 'package.json'), function (er, d) { if (!d || !filter(d)) return cb(null, []) return cb(null, d.name) }) @@ -57,7 +65,7 @@ function filterInstalled (local, global, filter, cb) { var globalDir = npm.globalDir asyncMap(global, function (p, cb) { - readJson(path.join(globalDir, p, "package.json"), function (er, d) { + readJson(path.join(globalDir, p, 'package.json'), function (er, d) { if (!d || !filter(d)) return cb(null, []) return cb(null, d.name) }) @@ -68,12 +76,12 @@ function filterInstalled (local, global, filter, cb) { function next () { if (!fg || !fl) return - if (!npm.config.get("global")) { + if (!npm.config.get('global')) { fg = fg.map(function (g) { - return [g, "-g"] + return [g, '-g'] }) } - console.error("filtered", fl, fg) + console.error('filtered', fl, fg) return cb(null, fl.concat(fg)) } } diff --git a/deps/npm/lib/utils/correct-mkdir.js b/deps/npm/lib/utils/correct-mkdir.js index 650c56fb17deb7..c0a31bdc58a10a 100644 --- a/deps/npm/lib/utils/correct-mkdir.js +++ b/deps/npm/lib/utils/correct-mkdir.js @@ -10,6 +10,13 @@ var stats = {} var effectiveOwner module.exports = function correctMkdir (path, cb) { cb = dezalgo(cb) + cb = inflight('correctMkdir:' + path, cb) + if (!cb) { + return log.verbose('correctMkdir', path, 'correctMkdir already in flight; waiting') + } else { + log.verbose('correctMkdir', path, 'correctMkdir not in flight; initializing') + } + if (stats[path]) return cb(null, stats[path]) fs.stat(path, function (er, st) { diff --git a/deps/npm/lib/utils/deep-sort-object.js b/deps/npm/lib/utils/deep-sort-object.js new file mode 100644 index 00000000000000..a9971506997013 --- /dev/null +++ b/deps/npm/lib/utils/deep-sort-object.js @@ -0,0 +1,16 @@ +'use strict' +var sortedObject = require('sorted-object') + +module.exports = function deepSortObject (obj, sortBy) { + if (obj == null || typeof obj !== 'object') return obj + if (obj instanceof Array) { + return obj.map(function (x) { + return deepSortObject(x, sortBy) + }) + } + obj = sortedObject(obj) + Object.keys(obj).forEach(function (key) { + obj[key] = deepSortObject(obj[key], sortBy) + }) + return obj +} diff --git a/deps/npm/lib/utils/depr-check.js b/deps/npm/lib/utils/depr-check.js index 7166348b086607..89cf402739a841 100644 --- a/deps/npm/lib/utils/depr-check.js +++ b/deps/npm/lib/utils/depr-check.js @@ -1,13 +1,13 @@ -var log = require("npmlog") +var log = require('npmlog') var deprecated = {} - , deprWarned = {} +var deprWarned = {} module.exports = function deprCheck (data) { if (deprecated[data._id]) data.deprecated = deprecated[data._id] if (data.deprecated) deprecated[data._id] = data.deprecated else return if (!deprWarned[data._id]) { deprWarned[data._id] = true - log.warn("deprecated", "%s: %s", data._id, data.deprecated) + log.warn('deprecated', '%s: %s', data._id, data.deprecated) } } diff --git a/deps/npm/lib/utils/error-handler.js b/deps/npm/lib/utils/error-handler.js index dac6a17f251c90..91b180e1b305a1 100644 --- a/deps/npm/lib/utils/error-handler.js +++ b/deps/npm/lib/utils/error-handler.js @@ -2,45 +2,47 @@ module.exports = errorHandler var cbCalled = false - , log = require("npmlog") - , npm = require("../npm.js") - , rm = require("rimraf") - , itWorked = false - , path = require("path") - , wroteLogFile = false - , exitCode = 0 - , rollbacks = npm.rollbacks - , chain = require("slide").chain - , writeStream = require("fs-write-stream-atomic") - , nameValidator = require("validate-npm-package-name") - - -process.on("exit", function (code) { - // console.error("exit", code) +var log = require('npmlog') +var npm = require('../npm.js') +var rm = require('rimraf') +var itWorked = false +var path = require('path') +var wroteLogFile = false +var exitCode = 0 +var rollbacks = npm.rollbacks +var chain = require('slide').chain +var writeStreamAtomic = require('fs-write-stream-atomic') +var errorMessage = require('./error-message.js') + +process.on('exit', function (code) { + log.disableProgress() if (!npm.config || !npm.config.loaded) return if (code) itWorked = false - if (itWorked) log.info("ok") + if (itWorked) log.info('ok') else { if (!cbCalled) { - log.error("", "cb() never called!") + log.error('', 'cb() never called!') } if (wroteLogFile) { // just a line break - if (log.levels[log.level] <= log.levels.error) console.error("") - - log.error("", - ["Please include the following file with any support request:" - ," " + path.resolve("npm-debug.log") - ].join("\n")) + if (log.levels[log.level] <= log.levels.error) console.error('') + + log.error( + '', + [ + 'Please include the following file with any support request:', + ' ' + path.resolve('npm-debug.log') + ].join('\n') + ) wroteLogFile = false } if (code) { - log.error("code", code) + log.error('code', code) } } - var doExit = npm.config.get("_exit") + var doExit = npm.config.get('_exit') if (doExit) { // actually exit. if (exitCode === 0 && !itWorked) { @@ -55,9 +57,9 @@ process.on("exit", function (code) { function exit (code, noLog) { exitCode = exitCode || process.exitCode || code - var doExit = npm.config ? npm.config.get("_exit") : true - log.verbose("exit", [code, doExit]) - if (log.level === "silent") noLog = true + var doExit = npm.config ? npm.config.get('_exit') : true + log.verbose('exit', [code, doExit]) + if (log.level === 'silent') noLog = true if (rollbacks.length) { chain(rollbacks.map(function (f) { @@ -66,22 +68,22 @@ function exit (code, noLog) { } }), function (er) { if (er) { - log.error("error rolling back", er) + log.error('error rolling back', er) if (!code) errorHandler(er) - else if (noLog) rm("npm-debug.log", reallyExit.bind(null, er)) + else if (noLog) rm('npm-debug.log', reallyExit.bind(null, er)) else writeLogFile(reallyExit.bind(this, er)) } else { if (!noLog && code) writeLogFile(reallyExit) - else rm("npm-debug.log", reallyExit) + else rm('npm-debug.log', reallyExit) } }) rollbacks.length = 0 } else if (code && !noLog) writeLogFile(reallyExit) - else rm("npm-debug.log", reallyExit) + else rm('npm-debug.log', reallyExit) function reallyExit (er) { - if (er && !code) code = typeof er.errno === "number" ? er.errno : 1 + if (er && !code) code = typeof er.errno === 'number' ? er.errno : 1 // truncate once it's been written. log.record.length = 0 @@ -91,298 +93,89 @@ function exit (code, noLog) { // just emit a fake exit event. // if we're really exiting, then let it exit on its own, so that // in-process stuff can finish or clean up first. - if (!doExit) process.emit("exit", code) - npm.spinner.stop() + if (!doExit) process.emit('exit', code) } } - function errorHandler (er) { - // console.error("errorHandler", er) + log.disableProgress() + // console.error('errorHandler', er) if (!npm.config || !npm.config.loaded) { // logging won't work unless we pretend that it's ready - er = er || new Error("Exit prior to config file resolving.") + er = er || new Error('Exit prior to config file resolving.') console.error(er.stack || er.message) } if (cbCalled) { - er = er || new Error("Callback called more than once.") + er = er || new Error('Callback called more than once.') } cbCalled = true if (!er) return exit(0) - if (typeof er === "string") { - log.error("", er) + if (typeof er === 'string') { + log.error('', er) return exit(1, true) } else if (!(er instanceof Error)) { - log.error("weird error", er) + log.error('weird error', er) return exit(1, true) } var m = er.code || er.message.match(/^(?:Error: )?(E[A-Z]+)/) - if (m && !er.code) er.code = m - - ; [ "type" - , "fstream_path" - , "fstream_unc_path" - , "fstream_type" - , "fstream_class" - , "fstream_finish_call" - , "fstream_linkpath" - , "stack" - , "fstream_stack" - , "statusCode" - , "pkgid" - ].forEach(function (k) { - var v = er[k] - if (!v) return - if (k === "fstream_stack") v = v.join("\n") - log.verbose(k, v) - }) - - log.verbose("cwd", process.cwd()) + if (m && !er.code) { + er.code = m + } - var os = require("os") - // log.error("System", os.type() + " " + os.release()) - // log.error("command", process.argv.map(JSON.stringify).join(" ")) - // log.error("node -v", process.version) - // log.error("npm -v", npm.version) - log.error("", os.type() + " " + os.release()) - log.error("argv", process.argv.map(JSON.stringify).join(" ")) - log.error("node", process.version) - log.error("npm ", "v" + npm.version) + ;[ + 'type', + 'fstream_path', + 'fstream_unc_path', + 'fstream_type', + 'fstream_class', + 'fstream_finish_call', + 'fstream_linkpath', + 'stack', + 'fstream_stack', + 'statusCode', + 'pkgid' + ].forEach(function (k) { + var v = er[k] + if (!v) return + if (k === 'fstream_stack') v = v.join('\n') + log.verbose(k, v) + }) - ; [ "file" - , "path" - , "code" - , "errno" - , "syscall" - ].forEach(function (k) { - var v = er[k] - if (v) log.error(k, v) - }) + log.verbose('cwd', process.cwd()) + + var os = require('os') + // log.error('System', os.type() + ' ' + os.release()) + // log.error('command', process.argv.map(JSON.stringify).join(' ')) + // log.error('node -v', process.version) + // log.error('npm -v', npm.version) + log.error('', os.type() + ' ' + os.release()) + log.error('argv', process.argv.map(JSON.stringify).join(' ')) + log.error('node', process.version) + log.error('npm ', 'v' + npm.version) + + ;[ + 'file', + 'path', + 'code', + 'errno', + 'syscall' + ].forEach(function (k) { + var v = er[k] + if (v) log.error(k, v) + }) // just a line break - if (log.levels[log.level] <= log.levels.error) console.error("") - - switch (er.code) { - case "ECONNREFUSED": - log.error("", er) - log.error("", ["\nIf you are behind a proxy, please make sure that the" - ,"'proxy' config is set properly. See: 'npm help config'" - ].join("\n")) - break - - case "EACCES": - case "EPERM": - log.error("", er) - log.error("", ["\nPlease try running this command again as root/Administrator." - ].join("\n")) - break - - case "ELIFECYCLE": - log.error("", er.message) - log.error("", ["","Failed at the "+er.pkgid+" "+er.stage+" script '"+er.script+"'." - ,"This is most likely a problem with the "+er.pkgname+" package," - ,"not with npm itself." - ,"Tell the author that this fails on your system:" - ," "+er.script - ,"You can get their info via:" - ," npm owner ls "+er.pkgname - ,"There is likely additional logging output above." - ].join("\n")) - break - - case "ENOGIT": - log.error("", er.message) - log.error("", ["","Failed using git." - ,"This is most likely not a problem with npm itself." - ,"Please check if you have git installed and in your PATH." - ].join("\n")) - break - - case "EJSONPARSE": - log.error("", er.message) - log.error("", "File: "+er.file) - log.error("", ["Failed to parse package.json data." - ,"package.json must be actual JSON, not just JavaScript." - ,"","This is not a bug in npm." - ,"Tell the package author to fix their package.json file." - ].join("\n"), "JSON.parse") - break - - // TODO(isaacs) - // Add a special case here for E401 and E403 explaining auth issues? - - case "E404": - var msg = [er.message] - if (er.pkgid && er.pkgid !== "-") { - msg.push("", "'" + er.pkgid + "' is not in the npm registry.") - - var valResult = nameValidator(er.pkgid) - - if (valResult.validForNewPackages) { - msg.push("You should bug the author to publish it (or use the name yourself!)") - } else { - msg.push("Your package name is not valid, because", "") - - var errorsArray = (valResult.errors || []).concat(valResult.warnings || []) - errorsArray.forEach(function(item, idx) { - msg.push(" " + (idx + 1) + ". " + item) - }) - } + if (log.levels[log.level] <= log.levels.error) console.error('') - if (er.parent) { - msg.push("It was specified as a dependency of '"+er.parent+"'") - } - msg.push("\nNote that you can also install from a" - ,"tarball, folder, http url, or git url.") - } - // There's no need to have 404 in the message as well. - msg[0] = msg[0].replace(/^404\s+/, "") - log.error("404", msg.join("\n")) - break - - case "EPUBLISHCONFLICT": - log.error("publish fail", ["Cannot publish over existing version." - ,"Update the 'version' field in package.json and try again." - ,"" - ,"To automatically increment version numbers, see:" - ," npm help version" - ].join("\n")) - break - - case "EISGIT": - log.error("git", [er.message - ," "+er.path - ,"Refusing to remove it. Update manually," - ,"or move it out of the way first." - ].join("\n")) - break - - case "ECYCLE": - log.error("cycle", [er.message - ,"While installing: "+er.pkgid - ,"Found a pathological dependency case that npm cannot solve." - ,"Please report this to the package author." - ].join("\n")) - break - - case "EBADPLATFORM": - log.error("notsup", [er.message - ,"Not compatible with your operating system or architecture: "+er.pkgid - ,"Valid OS: "+er.os.join(",") - ,"Valid Arch: "+er.cpu.join(",") - ,"Actual OS: "+process.platform - ,"Actual Arch: "+process.arch - ].join("\n")) - break - - case "EEXIST": - log.error([er.message - ,"File exists: "+er.path - ,"Move it away, and try again."].join("\n")) - break - - case "ENEEDAUTH": - log.error("need auth", [er.message - ,"You need to authorize this machine using `npm adduser`" - ].join("\n")) - break - - case "EPEERINVALID": - var peerErrors = Object.keys(er.peersDepending).map(function (peer) { - return "Peer " + peer + " wants " + er.packageName + "@" - + er.peersDepending[peer] - }) - log.error("peerinvalid", [er.message].concat(peerErrors).join("\n")) - break - - case "ECONNRESET": - case "ENOTFOUND": - case "ETIMEDOUT": - case "EAI_FAIL": - log.error("network", [er.message - ,"This is most likely not a problem with npm itself" - ,"and is related to network connectivity." - ,"In most cases you are behind a proxy or have bad network settings." - ,"\nIf you are behind a proxy, please make sure that the" - ,"'proxy' config is set properly. See: 'npm help config'" - ].join("\n")) - break - - case "ENOPACKAGEJSON": - log.error("package.json", [er.message - ,"This is most likely not a problem with npm itself." - ,"npm can't find a package.json file in your current directory." - ].join("\n")) - break - - case "ETARGET": - var msg = [er.message - ,"This is most likely not a problem with npm itself." - ,"In most cases you or one of your dependencies are requesting" - ,"a package version that doesn't exist." - ] - if (er.parent) { - msg.push("\nIt was specified as a dependency of '"+er.parent+"'\n") - } - log.error("notarget", msg.join("\n")) - break - - case "ENOTSUP": - if (er.required) { - log.error("notsup", [er.message - ,"Not compatible with your version of node/npm: "+er.pkgid - ,"Required: "+JSON.stringify(er.required) - ,"Actual: " - +JSON.stringify({npm:npm.version - ,node:npm.config.get("node-version")}) - ].join("\n")) - break - } // else passthrough - - case "ENOSPC": - log.error("nospc", [er.message - ,"This is most likely not a problem with npm itself" - ,"and is related to insufficient space on your system." - ].join("\n")) - break - - case "EROFS": - log.error("rofs", [er.message - ,"This is most likely not a problem with npm itself" - ,"and is related to the file system being read-only." - ,"\nOften virtualized file systems, or other file systems" - ,"that don't support symlinks, give this error." - ].join("\n")) - break - - case "ENOENT": - log.error("enoent", [er.message - ,"This is most likely not a problem with npm itself" - ,"and is related to npm not being able to find a file." - ,er.file?"\nCheck if the file '"+er.file+"' is present.":"" - ].join("\n")) - break - - case "EISDIR": - log.error("eisdir", [er.message - ,"This is most likely not a problem with npm itself" - ,"and is related to npm not being able to find a package.json in" - ,"a package you are trying to install." - ].join("\n")) - break - - default: - log.error("", er.message || er) - log.error("", ["", "If you need help, you may report this error at:" - ," " - ].join("\n")) - break - } + var msg = errorMessage(er) + msg.summary.concat(msg.detail).forEach(function (errline) { + log.error.apply(log, errline) + }) - exit(typeof er.errno === "number" ? er.errno : 1) + exit(typeof er.errno === 'number' ? er.errno : 1) } var writingLogFile = false @@ -391,22 +184,22 @@ function writeLogFile (cb) { writingLogFile = true wroteLogFile = true - var fstr = writeStream("npm-debug.log") - , os = require("os") - , out = "" + var fstr = writeStreamAtomic('npm-debug.log') + var os = require('os') + var out = '' log.record.forEach(function (m) { var pref = [m.id, m.level] if (m.prefix) pref.push(m.prefix) - pref = pref.join(" ") + pref = pref.join(' ') m.message.trim().split(/\r?\n/).map(function (line) { - return (pref + " " + line).trim() + return (pref + ' ' + line).trim() }).forEach(function (line) { out += line + os.EOL }) }) fstr.end(out) - fstr.on("close", cb) + fstr.on('close', cb) } diff --git a/deps/npm/lib/utils/error-message.js b/deps/npm/lib/utils/error-message.js new file mode 100644 index 00000000000000..fca92ee4cb5358 --- /dev/null +++ b/deps/npm/lib/utils/error-message.js @@ -0,0 +1,317 @@ +'use strict' +var npm = require('../npm.js') +var util = require('util') +var nameValidator = require('validate-npm-package-name') + +module.exports = errorMessage + +function errorMessage (er) { + var short = [] + var detail = [] + if (er.optional) { + short.push(['optional', 'Skipping failed optional dependency ' + er.optional + ':']) + } + switch (er.code) { + case 'ECONNREFUSED': + short.push(['', er]) + detail.push([ + '', + [ + '\nIf you are behind a proxy, please make sure that the', + "'proxy' config is set properly. See: 'npm help config'" + ].join('\n') + ]) + break + + case 'EACCES': + case 'EPERM': + short.push(['', er]) + detail.push(['', ['\nPlease try running this command again as root/Administrator.' + ].join('\n')]) + break + + case 'ELIFECYCLE': + short.push(['', er.message]) + detail.push([ + '', + [ + '', + 'Failed at the ' + er.pkgid + ' ' + er.stage + " script '" + er.script + "'.", + 'Make sure you have the latest version of node.js and npm installed.', + 'If you do, this is most likely a problem with the ' + er.pkgname + ' package,', + 'not with npm itself.', + 'Tell the author that this fails on your system:', + ' ' + er.script, + 'You can get information on how to open an issue for this project with:', + ' npm bugs ' + er.pkgname, + 'Or if that isn\'t available, you can get their info via:', + ' npm owner ls ' + er.pkgname, + 'There is likely additional logging output above.' + ].join('\n')] + ) + break + + case 'ENOGIT': + short.push(['', er.message]) + detail.push([ + '', + [ + '', + 'Failed using git.', + 'This is most likely not a problem with npm itself.', + 'Please check if you have git installed and in your PATH.' + ].join('\n') + ]) + break + + case 'EJSONPARSE': + short.push(['', er.message]) + short.push(['', 'File: ' + er.file]) + detail.push([ + '', + [ + 'Failed to parse package.json data.', + 'package.json must be actual JSON, not just JavaScript.', + '', + 'This is not a bug in npm.', + 'Tell the package author to fix their package.json file.' + ].join('\n'), + 'JSON.parse' + ]) + break + + // TODO(isaacs) + // Add a special case here for E401 and E403 explaining auth issues? + + case 'E404': + // There's no need to have 404 in the message as well. + var msg = er.message.replace(/^404\s+/, '') + short.push(['404', msg]) + if (er.pkgid && er.pkgid !== '-') { + detail.push(['404', '']) + detail.push(['404', '', "'" + er.pkgid + "' is not in the npm registry."]) + + var valResult = nameValidator(er.pkgid) + + if (valResult.validForNewPackages) { + detail.push(['404', 'You should bug the author to publish it (or use the name yourself!)']) + } else { + detail.push(['404', 'Your package name is not valid, because', '']) + + var errorsArray = (valResult.errors || []).concat(valResult.warnings || []) + errorsArray.forEach(function (item, idx) { + detail.push(['404', ' ' + (idx + 1) + '. ' + item]) + }) + } + + if (er.parent) { + detail.push(['404', "It was specified as a dependency of '" + er.parent + "'"]) + } + detail.push(['404', '\nNote that you can also install from a']) + detail.push(['404', 'tarball, folder, http url, or git url.']) + } + break + + case 'EPUBLISHCONFLICT': + short.push(['publish fail', 'Cannot publish over existing version.']) + detail.push(['publish fail', "Update the 'version' field in package.json and try again."]) + detail.push(['publish fail', '']) + detail.push(['publish fail', 'To automatically increment version numbers, see:']) + detail.push(['publish fail', ' npm help version']) + break + + case 'EISGIT': + short.push(['git', er.message]) + short.push(['git', ' ' + er.path]) + detail.push([ + 'git', + [ + 'Refusing to remove it. Update manually,', + 'or move it out of the way first.' + ].join('\n') + ]) + break + + case 'ECYCLE': + short.push([ + 'cycle', + [ + er.message, + 'While installing: ' + er.pkgid + ].join('\n') + ]) + detail.push([ + 'cycle', + [ + 'Found a pathological dependency case that npm cannot solve.', + 'Please report this to the package author.' + ].join('\n') + ]) + break + + case 'EBADPLATFORM': + short.push([ + 'notsup', + [ + 'Not compatible with your operating system or architecture: ' + er.pkgid + ].join('\n') + ]) + detail.push([ + 'notsup', + [ + 'Valid OS: ' + (er.os.join ? er.os.join(',') : util.inspect(er.os)), + 'Valid Arch: ' + (er.cpu.join ? er.cpu.join(',') : util.inspect(er.cpu)), + 'Actual OS: ' + process.platform, + 'Actual Arch: ' + process.arch + ].join('\n') + ]) + break + + case 'EEXIST': + short.push(['', er.message]) + short.push(['', 'File exists: ' + er.path]) + detail.push(['', 'Move it away, and try again.']) + break + + case 'ENEEDAUTH': + short.push(['need auth', er.message]) + detail.push(['need auth', 'You need to authorize this machine using `npm adduser`']) + break + + case 'ECONNRESET': + case 'ENOTFOUND': + case 'ETIMEDOUT': + case 'EAI_FAIL': + short.push(['network', er.message]) + detail.push([ + 'network', + [ + 'This is most likely not a problem with npm itself', + 'and is related to network connectivity.', + 'In most cases you are behind a proxy or have bad network settings.', + '\nIf you are behind a proxy, please make sure that the', + "'proxy' config is set properly. See: 'npm help config'" + ].join('\n') + ]) + break + + case 'ENOPACKAGEJSON': + short.push(['package.json', er.message]) + detail.push([ + 'package.json', + [ + 'This is most likely not a problem with npm itself.', + "npm can't find a package.json file in your current directory." + ].join('\n') + ]) + break + + case 'ETARGET': + short.push(['notarget', er.message]) + msg = [ + 'This is most likely not a problem with npm itself.', + 'In most cases you or one of your dependencies are requesting', + "a package version that doesn't exist." + ] + if (er.parent) { + msg.push("\nIt was specified as a dependency of '" + er.parent + "'\n") + } + detail.push(['notarget', msg.join('\n')]) + break + + case 'ENOTSUP': + if (er.required) { + short.push(['notsup', er.message]) + short.push(['notsup', 'Not compatible with your version of node/npm: ' + er.pkgid]) + detail.push([ + 'notsup', + [ + 'Not compatible with your version of node/npm: ' + er.pkgid, + 'Required: ' + JSON.stringify(er.required), + 'Actual: ' + JSON.stringify({ + npm: npm.version, + node: npm.config.get('node-version') + }) + ].join('\n') + ]) + break + } // else passthrough + /*eslint no-fallthrough:0*/ + + case 'ENOSPC': + short.push(['nospc', er.message]) + detail.push([ + 'nospc', + [ + 'This is most likely not a problem with npm itself', + 'and is related to insufficient space on your system.' + ].join('\n') + ]) + break + + case 'EROFS': + short.push(['rofs', er.message]) + detail.push([ + 'rofs', + [ + 'This is most likely not a problem with npm itself', + 'and is related to the file system being read-only.', + '\nOften virtualized file systems, or other file systems', + "that don't support symlinks, give this error." + ].join('\n') + ]) + break + + case 'ENOENT': + short.push(['enoent', er.message]) + detail.push([ + 'enoent', + [ + er.message, + 'This is most likely not a problem with npm itself', + 'and is related to npm not being able to find a file.', + er.file ? "\nCheck if the file '" + er.file + "' is present." : '' + ].join('\n') + ]) + break + + case 'EMISSINGARG': + case 'EUNKNOWNTYPE': + case 'EINVALIDTYPE': + case 'ETOOMANYARGS': + short.push(['typeerror', er.stack]) + detail.push([ + 'typeerror', + [ + 'This is an error with npm itself. Please report this error at:', + ' ' + ].join('\n') + ]) + break + + case 'EISDIR': + short.push(['eisdir', er.message]) + detail.push([ + 'eisdir', + [ + 'This is most likely not a problem with npm itself', + 'and is related to npm not being able to find a package.json in', + 'a package you are trying to install.' + ].join('\n') + ]) + break + + default: + short.push(['', er.message || er]) + detail.push([ + '', + [ + '', + 'If you need help, you may report this error at:', + ' ' + ].join('\n') + ]) + break + } + return {summary: short, detail: detail} +} diff --git a/deps/npm/lib/utils/gently-rm.js b/deps/npm/lib/utils/gently-rm.js index ad0b4d039933c9..634bf94fcc5df0 100644 --- a/deps/npm/lib/utils/gently-rm.js +++ b/deps/npm/lib/utils/gently-rm.js @@ -1,19 +1,22 @@ -// only remove the thing if it's a symlink into a specific folder. -// This is a very common use-case of npm's, but not so common elsewhere. +// only remove the thing if it's a symlink into a specific folder. This is +// a very common use-case of npm's, but not so common elsewhere. -module.exports = gentlyRm +exports = module.exports = gentlyRm -var npm = require('../npm.js') -var log = require('npmlog') var resolve = require('path').resolve var dirname = require('path').dirname +var normalize = require('path').normalize +var validate = require('aproba') +var log = require('npmlog') var lstat = require('graceful-fs').lstat var readlink = require('graceful-fs').readlink var isInside = require('path-is-inside') var vacuum = require('fs-vacuum') -var some = require('async-some') +var chain = require('slide').chain var asyncMap = require('slide').asyncMap -var normalize = require('path').normalize +var readCmdShim = require('read-cmd-shim') +var iferr = require('iferr') +var npm = require('../npm.js') function gentlyRm (target, gently, base, cb) { if (!cb) { @@ -35,8 +38,9 @@ function gentlyRm (target, gently, base, cb) { // never rm the root, prefix, or bin dirs // - // globals included because of `npm link` -- as far as the package requesting - // the link is concerned, the linked package is always installed globally + // globals included because of `npm link` -- as far as the package + // requesting the link is concerned, the linked package is always + // installed globally var prefixes = [ npm.prefix, npm.globalPrefix, @@ -47,151 +51,247 @@ function gentlyRm (target, gently, base, cb) { npm.globalBin ] - var resolved = normalize(resolve(npm.prefix, target)) - if (prefixes.indexOf(resolved) !== -1) { - log.verbose('gentlyRm', resolved, "is part of npm and can't be removed") - return cb(new Error('May not delete: ' + resolved)) + var targetPath = normalize(resolve(npm.prefix, target)) + if (prefixes.indexOf(targetPath) !== -1) { + log.verbose('gentlyRm', targetPath, "is part of npm and can't be removed") + return cb(new Error('May not delete: ' + targetPath)) } - var options = { log: log.silly.bind(log, 'vacuum-fs') } if (npm.config.get('force') || !gently) options.purge = true if (base) options.base = normalize(resolve(npm.prefix, base)) if (!gently) { - log.verbose('gentlyRm', "don't care about contents; nuking", resolved) - return vacuum(resolved, options, cb) + log.verbose('gentlyRm', "don't care about contents; nuking", targetPath) + return vacuum(targetPath, options, cb) } - var parent = options.base = normalize(base ? resolve(npm.prefix, base) : npm.prefix) - - // is the parent directory managed by npm? - log.silly('gentlyRm', 'verifying', parent, 'is an npm working directory') - some(prefixes, isManaged(parent), function (er, matched) { - if (er) return cb(er) - - if (!matched) { - log.error('gentlyRm', 'containing path', parent, "isn't under npm's control") - return clobberFail(resolved, parent, cb) + var parent = options.base = options.base || normalize(npm.prefix) + + // Do all the async work we'll need to do in order to tell if this is a + // safe operation + chain([ + [isEverInside, parent, prefixes], + [readLinkOrShim, targetPath], + [isEverInside, targetPath, prefixes], + [isEverInside, targetPath, [parent]] + ], function (er, results) { + if (er) { + if (er.code === 'ENOENT') return cb() + return cb(er) } - log.silly('gentlyRm', 'containing path', parent, "is under npm's control, in", matched) - - // is the target directly contained within the (now known to be - // managed) parent? - if (isInside(resolved, parent)) { - log.silly('gentlyRm', 'deletion target', resolved, 'is under', parent) - log.verbose('gentlyRm', 'vacuuming from', resolved, 'up to', parent) - return vacuum(resolved, options, cb) + var parentInfo = { + path: parent, + managed: results[0] + } + var targetInfo = { + path: targetPath, + symlink: results[1], + managed: results[2], + inParent: results[3] } - log.silly('gentlyRm', resolved, 'is not under', parent) - - // the target isn't directly within the parent, but is it itself managed? - log.silly('gentlyRm', 'verifying', resolved, 'is an npm working directory') - some(prefixes, isManaged(resolved), function (er, matched) { - if (er) return cb(er) - - if (matched) { - log.silly('gentlyRm', resolved, "is under npm's control, in", matched) - options.base = matched - log.verbose('gentlyRm', 'removing', resolved, 'with base', options.base) - return vacuum(resolved, options, cb) - } - log.verbose('gentlyRm', resolved, "is not under npm's control") - - // the target isn't managed directly, but maybe it's a link... - log.silly('gentlyRm', 'checking to see if', resolved, 'is a link') - lstat(resolved, function (er, stat) { - if (er) { - // race conditions are common when unbuilding - if (er.code === 'ENOENT') return cb(null) - return cb(er) - } - if (!stat.isSymbolicLink()) { - log.error('gentlyRm', resolved, 'is outside', parent, 'and not a link') - return clobberFail(resolved, parent, cb) - } + isSafeToRm(parentInfo, targetInfo, iferr(cb, thenRemove)) - // ...and maybe the link source, when read... - log.silly('gentlyRm', resolved, 'is a link') - readlink(resolved, function (er, link) { - if (er) { - // race conditions are common when unbuilding - if (er.code === 'ENOENT') return cb(null) - return cb(er) - } - - // ...is inside the managed parent - var source = resolve(dirname(resolved), link) - if (isInside(source, parent)) { - log.silly('gentlyRm', source, 'symlink target', resolved, 'is inside', parent) - log.verbose('gentlyRm', 'vacuuming', resolved) - return vacuum(resolved, options, cb) - } - - log.error('gentlyRm', source, 'symlink target', resolved, 'is not controlled by npm', parent) - return clobberFail(target, parent, cb) - }) - }) - }) + function thenRemove (toRemove, removeBase) { + if (!toRemove) return cb() + if (removeBase) options.base = removeBase + log.verbose('gentlyRm', options.purge ? 'Purging' : 'Vacuuming', + toRemove, 'up to', options.base) + return vacuum(toRemove, options, cb) + } }) } -var resolvedPaths = {} -function isManaged (target) { - return function predicate (path, cb) { - if (!path) { - log.verbose('isManaged', 'no path passed for target', target) - return cb(null, false) - } - - asyncMap([path, target], resolveSymlink, function (er, results) { - if (er) { - if (er.code === 'ENOENT') return cb(null, false) +exports._isSafeToRm = isSafeToRm +function isSafeToRm (parent, target, cb) { + log.silly('gentlyRm', 'parent.path =', parent.path) + log.silly('gentlyRm', 'parent.managed =', + parent.managed && parent.managed.target + ' is in ' + parent.managed.path) + log.silly('gentlyRm', 'target.path = ', target.path) + log.silly('gentlyRm', 'target.symlink =', target.symlink) + log.silly('gentlyRm', 'target.managed =', + target.managed && target.managed.target + ' is in ' + target.managed.path) + log.silly('gentlyRm', 'target.inParent = ', target.inParent) + + // The parent directory or something it symlinks to must eventually be in + // a folder that npm maintains. + if (!parent.managed) { + log.verbose('gentlyRm', parent.path, + 'is not contained in any diretory npm is known to control or ' + + 'any place they link to') + return cb(clobberFail(target.path, 'containing path ' + parent.path + + " isn't under npm's control")) + } - return cb(er) - } + // The target or something it symlinks to must eventually be in the parent + // or something the parent symlinks to + if (target.inParent) { + var actualTarget = target.inParent.target + var targetsParent = target.inParent.path + // if the target.path was what we found in some version of parent, remove + // using that parent as the base + if (target.path === actualTarget) { + return cb(null, target.path, targetsParent) + } else { + // If something the target.path links to was what was found, just + // remove target.path in the location it was found. + return cb(null, target.path, dirname(target.path)) + } + } - var path = results[0] - var target = results[1] - var inside = isInside(target, path) - if (!inside) log.silly('isManaged', target, 'is not inside', path) + // If the target is in a managed directory and is in a symlink, but was + // not in our parent that usually means someone else installed a bin file + // with the same name as one of our bin files. + if (target.managed && target.symlink) { + log.warn('gentlyRm', 'not removing', target.path, + "as it wasn't installed by", parent.path) + return cb() + } - return cb(null, inside && path) - }) + if (target.symlink) { + return cb(clobberFail(target.path, target.symlink + + ' symlink target is not controlled by npm ' + parent.path)) + } else { + return cb(clobberFail(target.path, 'is outside ' + parent.path + + ' and not a link')) } +} - function resolveSymlink (toResolve, cb) { - var resolved = resolve(npm.prefix, toResolve) +function clobberFail (target, msg) { + validate('SS', arguments) + var er = new Error('Refusing to delete ' + target + ': ' + msg) + er.code = 'EEXIST' + er.path = target + return er +} - // if the path has already been memoized, return immediately - var cached = resolvedPaths[resolved] - if (cached) return cb(null, cached) +function isENOENT (err) { + return err && err.code === 'ENOENT' +} + +function notENOENT (err) { + return !isENOENT(err) +} - // otherwise, check the path - lstat(resolved, function (er, stat) { - if (er) return cb(er) +function skipENOENT (cb) { + return function (err, value) { + if (isENOENT(err)) { + return cb(null, false) + } else { + return cb(err, value) + } + } +} - // if it's not a link, cache & return the path itself - if (!stat.isSymbolicLink()) { - resolvedPaths[resolved] = resolved - return cb(null, resolved) +function errorsToValues (fn) { + return function () { + var args = Array.prototype.slice.call(arguments) + var cb = args.pop() + args.push(function (err, value) { + if (err) { + return cb(null, err) + } else { + return cb(null, value) } + }) + fn.apply(null, args) + } +} - // otherwise, cache & return the link's source - readlink(resolved, function (er, source) { - if (er) return cb(er) +function isNotError (value) { + return !(value instanceof Error) +} - resolved = resolve(resolved, source) - resolvedPaths[resolved] = resolved - cb(null, resolved) - }) +exports._isEverInside = isEverInside +// return the first of path, where target (or anything it symlinks to) +// isInside the path (or anything it symlinks to) +function isEverInside (target, paths, cb) { + validate('SAF', arguments) + asyncMap(paths, errorsToValues(readAllLinks), iferr(cb, function (resolvedPaths) { + var errorFree = resolvedPaths.filter(isNotError) + if (errorFree.length === 0) { + var badErrors = resolvedPaths.filter(notENOENT) + if (badErrors.length === 0) { + return cb(null, false) + } else { + return cb(badErrors[0]) + } + } + readAllLinks(target, iferr(skipENOENT(cb), function (targets) { + cb(null, areAnyInsideAny(targets, errorFree)) + })) + })) +} + +exports._areAnyInsideAny = areAnyInsideAny +// Return the first path found that any target is inside +function areAnyInsideAny (targets, paths) { + validate('AA', arguments) + var toCheck = [] + paths.forEach(function (path) { + targets.forEach(function (target) { + toCheck.push([target, path]) }) + }) + for (var ii = 0; ii < toCheck.length; ++ii) { + var target = toCheck[ii][0] + var path = toCheck[ii][1] + var inside = isInside(target, path) + if (!inside) log.silly('isEverInside', target, 'is not inside', path) + if (inside && path) return inside && path && {target: target, path: path} } + return false } -function clobberFail (target, root, cb) { - var er = new Error('Refusing to delete: ' + target + ' not in ' + root) - er.code = 'EEXIST' - er.path = target - return cb(er) +exports._readAllLinks = readAllLinks +// resolves chains of symlinks of unlimited depth, returning a list of paths +// it's seen in the process when it hits either a symlink cycle or a +// non-symlink +function readAllLinks (path, cb) { + validate('SF', arguments) + var seen = {} + _readAllLinks(path) + + function _readAllLinks (path) { + if (seen[path]) return cb(null, Object.keys(seen)) + seen[path] = true + resolveSymlink(path, iferr(cb, _readAllLinks)) + } +} + +exports._resolveSymlink = resolveSymlink +var resolvedPaths = {} +function resolveSymlink (symlink, cb) { + validate('SF', arguments) + var cached = resolvedPaths[symlink] + if (cached) return cb(null, cached) + + readLinkOrShim(symlink, iferr(cb, function (symlinkTarget) { + if (symlinkTarget) { + resolvedPaths[symlink] = resolve(dirname(symlink), symlinkTarget) + } else { + resolvedPaths[symlink] = symlink + } + return cb(null, resolvedPaths[symlink]) + })) +} + +exports._readLinkOrShim = readLinkOrShim +function readLinkOrShim (path, cb) { + validate('SF', arguments) + lstat(path, iferr(cb, function (stat) { + if (stat.isSymbolicLink()) { + readlink(path, cb) + } else { + readCmdShim(path, function (er, source) { + if (!er) return cb(null, source) + // lstat wouldn't return an error on these, so we don't either. + if (er.code === 'ENOTASHIM' || er.code === 'EISDIR') { + return cb(null, null) + } else { + return cb(er) + } + }) + } + })) } diff --git a/deps/npm/lib/utils/git.js b/deps/npm/lib/utils/git.js index 9c80ea55375f78..2d9da1086e150b 100644 --- a/deps/npm/lib/utils/git.js +++ b/deps/npm/lib/utils/git.js @@ -1,20 +1,19 @@ - // handle some git configuration for windows exports.spawn = spawnGit exports.chainableExec = chainableExec exports.whichAndExec = whichAndExec -var exec = require("child_process").execFile - , spawn = require("./spawn") - , npm = require("../npm.js") - , which = require("which") - , git = npm.config.get("git") - , assert = require("assert") - , log = require("npmlog") +var exec = require('child_process').execFile +var spawn = require('./spawn') +var npm = require('../npm.js') +var which = require('which') +var git = npm.config.get('git') +var assert = require('assert') +var log = require('npmlog') function prefixGitArgs () { - return process.platform === "win32" ? ["-c", "core.longpaths=true"] : [] + return process.platform === 'win32' ? ['-c', 'core.longpaths=true'] : [] } function execGit (args, options, cb) { @@ -24,7 +23,7 @@ function execGit (args, options, cb) { } function spawnGit (args, options) { - log.info("git", args) + log.info('git', args) return spawn(git, prefixGitArgs().concat(args || []), options) } @@ -38,11 +37,11 @@ function whichGit (cb) { } function whichAndExec (args, options, cb) { - assert.equal(typeof cb, "function", "no callback provided") + assert.equal(typeof cb, 'function', 'no callback provided') // check for git whichGit(function (err) { if (err) { - err.code = "ENOGIT" + err.code = 'ENOGIT' return cb(err) } diff --git a/deps/npm/lib/utils/lifecycle.js b/deps/npm/lib/utils/lifecycle.js index 9805a1c0c1dc45..b29248d953a592 100644 --- a/deps/npm/lib/utils/lifecycle.js +++ b/deps/npm/lib/utils/lifecycle.js @@ -1,21 +1,22 @@ exports = module.exports = lifecycle exports.cmd = cmd exports.makeEnv = makeEnv - -var log = require("npmlog") -var spawn = require("./spawn") -var npm = require("../npm.js") -var path = require("path") -var fs = require("graceful-fs") -var chain = require("slide").chain -var Stream = require("stream").Stream -var PATH = "PATH" -var uidNumber = require("uid-number") -var umask = require("./umask") - -// windows calls it's path "Path" usually, but this is not guaranteed. -if (process.platform === "win32") { - PATH = "Path" +exports._incorrectWorkingDirectory = _incorrectWorkingDirectory + +var log = require('npmlog') +var spawn = require('./spawn') +var npm = require('../npm.js') +var path = require('path') +var fs = require('graceful-fs') +var chain = require('slide').chain +var Stream = require('stream').Stream +var PATH = 'PATH' +var uidNumber = require('uid-number') +var umask = require('./umask') + +// windows calls it's path 'Path' usually, but this is not guaranteed. +if (process.platform === 'win32') { + PATH = 'Path' Object.keys(process.env).forEach(function (e) { if (e.match(/^PATH$/i)) { PATH = e @@ -23,27 +24,40 @@ if (process.platform === "win32") { }) } +function logid (pkg, stage) { + return pkg._id + '~' + stage + ':' +} + function lifecycle (pkg, stage, wd, unsafe, failOk, cb) { - if (typeof cb !== "function") cb = failOk, failOk = false - if (typeof cb !== "function") cb = unsafe, unsafe = false - if (typeof cb !== "function") cb = wd, wd = null + if (typeof cb !== 'function') { + cb = failOk + failOk = false + } + if (typeof cb !== 'function') { + cb = unsafe + unsafe = false + } + if (typeof cb !== 'function') { + cb = wd + wd = null + } while (pkg && pkg._data) pkg = pkg._data - if (!pkg) return cb(new Error("Invalid package data")) + if (!pkg) return cb(new Error('Invalid package data')) - log.info(stage, pkg._id) + log.info('lifecycle', logid(pkg, stage), pkg._id) if (!pkg.scripts || npm.config.get('ignore-scripts')) pkg.scripts = {} validWd(wd || path.resolve(npm.dir, pkg.name), function (er, wd) { if (er) return cb(er) - unsafe = unsafe || npm.config.get("unsafe-perm") + unsafe = unsafe || npm.config.get('unsafe-perm') - if ((wd.indexOf(npm.dir) !== 0 || - wd.indexOf(pkg.name) !== wd.length - pkg.name.length) && + if ((wd.indexOf(npm.dir) !== 0 || _incorrectWorkingDirectory(wd, pkg)) && !unsafe && pkg.scripts[stage]) { - log.warn( "cannot run in wd", "%s %s (wd=%s)" - , pkg._id, pkg.scripts[stage], wd) + log.warn('lifecycle', logid(pkg, stage), 'cannot run in wd', + '%s %s (wd=%s)', pkg._id, pkg.scripts[stage], wd + ) return cb() } @@ -53,63 +67,68 @@ function lifecycle (pkg, stage, wd, unsafe, failOk, cb) { env.npm_node_execpath = env.NODE = env.NODE || process.execPath env.npm_execpath = require.main.filename - // "nobody" typically doesn't have permission to write to /tmp + // 'nobody' typically doesn't have permission to write to /tmp // even if it's never used, sh freaks out. - if (!npm.config.get("unsafe-perm")) env.TMPDIR = wd + if (!npm.config.get('unsafe-perm')) env.TMPDIR = wd lifecycle_(pkg, stage, wd, env, unsafe, failOk, cb) }) } -function checkForLink (pkg, cb) { - var f = path.join(npm.dir, pkg.name) - fs.lstat(f, function (er, s) { - cb(null, !(er || !s.isSymbolicLink())) - }) +function _incorrectWorkingDirectory (wd, pkg) { + return wd.lastIndexOf(pkg.name) !== wd.length - pkg.name.length } function lifecycle_ (pkg, stage, wd, env, unsafe, failOk, cb) { var pathArr = [] - , p = wd.split("node_modules") - , acc = path.resolve(p.shift()) + var p = wd.split('node_modules') + var acc = path.resolve(p.shift()) p.forEach(function (pp) { - pathArr.unshift(path.join(acc, "node_modules", ".bin")) - acc = path.join(acc, "node_modules", pp) + pathArr.unshift(path.join(acc, 'node_modules', '.bin')) + acc = path.join(acc, 'node_modules', pp) }) - pathArr.unshift(path.join(acc, "node_modules", ".bin")) + pathArr.unshift(path.join(acc, 'node_modules', '.bin')) // we also unshift the bundled node-gyp-bin folder so that // the bundled one will be used for installing things. - pathArr.unshift(path.join(__dirname, "..", "..", "bin", "node-gyp-bin")) + pathArr.unshift(path.join(__dirname, '..', '..', 'bin', 'node-gyp-bin')) + + // prefer current node interpreter in child scripts + pathArr.push(path.dirname(process.execPath)) if (env[PATH]) pathArr.push(env[PATH]) - env[PATH] = pathArr.join(process.platform === "win32" ? ";" : ":") + env[PATH] = pathArr.join(process.platform === 'win32' ? ';' : ':') var packageLifecycle = pkg.scripts && pkg.scripts.hasOwnProperty(stage) if (packageLifecycle) { // define this here so it's available to all scripts. env.npm_lifecycle_script = pkg.scripts[stage] + } else { + log.silly('lifecycle', logid(pkg, stage), 'no script for ' + stage + ', continuing') } function done (er) { if (er) { - if (npm.config.get("force")) { - log.info("forced, continuing", er) + if (npm.config.get('force')) { + log.info('lifecycle', logid(pkg, stage), 'forced, continuing', er) er = null } else if (failOk) { - log.warn("continuing anyway", er.message) + log.warn('lifecycle', logid(pkg, stage), 'continuing anyway', er.message) er = null } } cb(er) } - chain - ( [ packageLifecycle && [runPackageLifecycle, pkg, env, wd, unsafe] - , [runHookLifecycle, pkg, env, wd, unsafe] ] - , done ) + chain( + [ + packageLifecycle && [runPackageLifecycle, pkg, env, wd, unsafe], + [runHookLifecycle, pkg, env, wd, unsafe] + ], + done + ) } function validWd (d, cb) { @@ -117,7 +136,7 @@ function validWd (d, cb) { if (er || !st.isDirectory()) { var p = path.dirname(d) if (p === d) { - return cb(new Error("Could not find suitable wd")) + return cb(new Error('Could not find suitable wd')) } return validWd(p, cb) } @@ -128,17 +147,16 @@ function validWd (d, cb) { function runPackageLifecycle (pkg, env, wd, unsafe, cb) { // run package lifecycle scripts in the package root, or the nearest parent. var stage = env.npm_lifecycle_event - , cmd = env.npm_lifecycle_script + var cmd = env.npm_lifecycle_script - var note = "\n> " + pkg._id + " " + stage + " " + wd - + "\n> " + cmd + "\n" + var note = '\n> ' + pkg._id + ' ' + stage + ' ' + wd + + '\n> ' + cmd + '\n' runCmd(note, cmd, pkg, env, stage, wd, unsafe, cb) } - var running = false var queue = [] -function dequeue() { +function dequeue () { running = false if (queue.length) { var r = queue.shift() @@ -154,18 +172,17 @@ function runCmd (note, cmd, pkg, env, stage, wd, unsafe, cb) { running = true log.pause() - var user = unsafe ? null : npm.config.get("user") - , group = unsafe ? null : npm.config.get("group") + var user = unsafe ? null : npm.config.get('user') + var group = unsafe ? null : npm.config.get('group') if (log.level !== 'silent') { - if (npm.spinner.int) { - npm.config.get("logstream").write("\r \r") - } + log.clearProgress() console.log(note) + log.showProgress() } - log.verbose("unsafe-perm in lifecycle", unsafe) + log.verbose('lifecycle', logid(pkg, stage), 'unsafe-perm in lifecycle', unsafe) - if (process.platform === "win32") { + if (process.platform === 'win32') { unsafe = true } @@ -179,17 +196,17 @@ function runCmd (note, cmd, pkg, env, stage, wd, unsafe, cb) { } function runCmd_ (cmd, pkg, env, wd, stage, unsafe, uid, gid, cb_) { - function cb (er) { cb_.apply(null, arguments) log.resume() process.nextTick(dequeue) } - var conf = { cwd: wd - , env: env - , stdio: [ 0, 1, 2 ] - } + var conf = { + cwd: wd, + env: env, + stdio: [ 0, 1, 2 ] + } if (!unsafe) { conf.uid = uid ^ 0 @@ -205,59 +222,69 @@ function runCmd_ (cmd, pkg, env, wd, stage, unsafe, uid, gid, cb_) { conf.windowsVerbatimArguments = true } + log.verbose('lifecycle', logid(pkg, stage), 'PATH:', env[PATH]) + log.verbose('lifecycle', logid(pkg, stage), 'CWD:', wd) + log.silly('lifecycle', logid(pkg, stage), 'Args:', [shFlag, cmd]) + + var progressEnabled = log.progressEnabled + if (progressEnabled) log.disableProgress() var proc = spawn(sh, [shFlag, cmd], conf) - proc.on("error", procError) - proc.on("close", function (code, signal) { + + proc.on('error', procError) + proc.on('close', function (code, signal) { + log.silly('lifecycle', logid(pkg, stage), 'Returned: code:', code, ' signal:', signal) if (signal) { - process.kill(process.pid, signal); + process.kill(process.pid, signal) } else if (code) { - var er = new Error("Exit status " + code) + var er = new Error('Exit status ' + code) } procError(er) }) + process.once('SIGTERM', procKill) function procError (er) { - if (er && !npm.ROLLBACK) { - log.info(pkg._id, "Failed to exec "+stage+" script") - er.message = pkg._id + " " - + stage + ": `" + cmd +"`\n" - + er.message - if (er.code !== "EPERM") { - er.code = "ELIFECYCLE" + if (progressEnabled) log.enableProgress() + if (er) { + log.info('lifecycle', logid(pkg, stage), 'Failed to exec ' + stage + ' script') + er.message = pkg._id + ' ' + stage + ': `' + cmd + '`\n' + + er.message + if (er.code !== 'EPERM') { + er.code = 'ELIFECYCLE' } + fs.stat(npm.dir, function (statError, d) { + if (statError && statError.code === 'ENOENT' && npm.dir.split(path.sep).slice(-1)[0] === 'node_modules') { + log.warn('', 'Local package.json exists, but node_modules missing, did you mean to install?') + } + }) er.pkgid = pkg._id er.stage = stage er.script = cmd er.pkgname = pkg.name - return cb(er) - } else if (er) { - log.error(pkg._id+"."+stage, er) - log.error(pkg._id+"."+stage, "continuing anyway") - return cb() } - cb(er) + process.removeListener('SIGTERM', procKill) + return cb(er) + } + function procKill () { + proc.kill() } } - function runHookLifecycle (pkg, env, wd, unsafe, cb) { // check for a hook script, run if present. var stage = env.npm_lifecycle_event - , hook = path.join(npm.dir, ".hooks", stage) - , user = unsafe ? null : npm.config.get("user") - , group = unsafe ? null : npm.config.get("group") - , cmd = hook + var hook = path.join(npm.dir, '.hooks', stage) + var cmd = hook fs.stat(hook, function (er) { if (er) return cb() - var note = "\n> " + pkg._id + " " + stage + " " + wd - + "\n> " + cmd + var note = '\n> ' + pkg._id + ' ' + stage + ' ' + wd + + '\n> ' + cmd runCmd(note, hook, pkg, env, stage, wd, unsafe, cb) }) } function makeEnv (data, prefix, env) { - prefix = prefix || "npm_package_" + prefix = prefix || 'npm_package_' if (!env) { env = {} for (var i in process.env) if (!i.match(/^npm_/)) { @@ -265,52 +292,55 @@ function makeEnv (data, prefix, env) { } // npat asks for tap output - if (npm.config.get("npat")) env.TAP = 1 + if (npm.config.get('npat')) env.TAP = 1 // express and others respect the NODE_ENV value. - if (npm.config.get("production")) env.NODE_ENV = "production" - - } else if (!data.hasOwnProperty("_lifecycleEnv")) { - Object.defineProperty(data, "_lifecycleEnv", - { value : env - , enumerable : false - }) + if (npm.config.get('production')) env.NODE_ENV = 'production' + } else if (!data.hasOwnProperty('_lifecycleEnv')) { + Object.defineProperty(data, '_lifecycleEnv', + { + value: env, + enumerable: false + } + ) } - for (var i in data) if (i.charAt(0) !== "_") { - var envKey = (prefix+i).replace(/[^a-zA-Z0-9_]/g, '_') - if (i === "readme") { + for (i in data) if (i.charAt(0) !== '_') { + var envKey = (prefix + i).replace(/[^a-zA-Z0-9_]/g, '_') + if (i === 'readme') { continue } - if (data[i] && typeof(data[i]) === "object") { + if (data[i] && typeof data[i] === 'object') { try { // quick and dirty detection for cyclical structures JSON.stringify(data[i]) - makeEnv(data[i], envKey+"_", env) + makeEnv(data[i], envKey + '_', env) } catch (ex) { // usually these are package objects. // just get the path and basic details. var d = data[i] - makeEnv( { name: d.name, version: d.version, path:d.path } - , envKey+"_", env) + makeEnv( + { name: d.name, version: d.version, path: d.path }, + envKey + '_', + env + ) } } else { env[envKey] = String(data[i]) - env[envKey] = -1 !== env[envKey].indexOf("\n") - ? JSON.stringify(env[envKey]) - : env[envKey] + env[envKey] = env[envKey].indexOf('\n') !== -1 + ? JSON.stringify(env[envKey]) + : env[envKey] } - } - if (prefix !== "npm_package_") return env + if (prefix !== 'npm_package_') return env - prefix = "npm_config_" + prefix = 'npm_config_' var pkgConfig = {} - , keys = npm.config.keys - , pkgVerConfig = {} - , namePref = data.name + ":" - , verPref = data.name + "@" + data.version + ":" + var keys = npm.config.keys + var pkgVerConfig = {} + var namePref = data.name + ':' + var verPref = data.name + '@' + data.version + ':' keys.forEach(function (i) { // in some rare cases (e.g. working with nerf darts), there are segmented @@ -321,29 +351,30 @@ function makeEnv (data, prefix, env) { var value = npm.config.get(i) if (value instanceof Stream || Array.isArray(value)) return if (i.match(/umask/)) value = umask.toString(value) - if (!value) value = "" - else if (typeof value === "number") value = "" + value - else if (typeof value !== "string") value = JSON.stringify(value) + if (!value) value = '' + else if (typeof value === 'number') value = '' + value + else if (typeof value !== 'string') value = JSON.stringify(value) - value = -1 !== value.indexOf("\n") + value = value.indexOf('\n') !== -1 ? JSON.stringify(value) : value - i = i.replace(/^_+/, "") + i = i.replace(/^_+/, '') + var k if (i.indexOf(namePref) === 0) { - var k = i.substr(namePref.length).replace(/[^a-zA-Z0-9_]/g, "_") - pkgConfig[ k ] = value + k = i.substr(namePref.length).replace(/[^a-zA-Z0-9_]/g, '_') + pkgConfig[k] = value } else if (i.indexOf(verPref) === 0) { - var k = i.substr(verPref.length).replace(/[^a-zA-Z0-9_]/g, "_") - pkgVerConfig[ k ] = value + k = i.substr(verPref.length).replace(/[^a-zA-Z0-9_]/g, '_') + pkgVerConfig[k] = value } - var envKey = (prefix+i).replace(/[^a-zA-Z0-9_]/g, "_") + var envKey = (prefix + i).replace(/[^a-zA-Z0-9_]/g, '_') env[envKey] = value }) - prefix = "npm_package_config_" + prefix = 'npm_package_config_' ;[pkgConfig, pkgVerConfig].forEach(function (conf) { for (var i in conf) { - var envKey = (prefix+i) + var envKey = (prefix + i) env[envKey] = conf[i] } }) @@ -353,10 +384,10 @@ function makeEnv (data, prefix, env) { function cmd (stage) { function CMD (args, cb) { - npm.commands["run-script"]([stage].concat(args), cb) + npm.commands['run-script']([stage].concat(args), cb) } - CMD.usage = "npm "+stage+" [-- ]" - var installedShallow = require("./completion/installed-shallow.js") + CMD.usage = 'npm ' + stage + ' [-- ]' + var installedShallow = require('./completion/installed-shallow.js') CMD.completion = function (opts, cb) { installedShallow(opts, function (d) { return d.scripts && d.scripts[stage] diff --git a/deps/npm/lib/utils/link.js b/deps/npm/lib/utils/link.js index e353bfae9372a4..d0492e076fd6b8 100644 --- a/deps/npm/lib/utils/link.js +++ b/deps/npm/lib/utils/link.js @@ -1,29 +1,62 @@ - module.exports = link link.ifExists = linkIfExists -var fs = require("graceful-fs") - , chain = require("slide").chain - , mkdir = require("mkdirp") - , rm = require("./gently-rm.js") - , path = require("path") - , npm = require("../npm.js") +var fs = require('graceful-fs') +var chain = require('slide').chain +var mkdir = require('mkdirp') +var rm = require('./gently-rm.js') +var path = require('path') +var npm = require('../npm.js') function linkIfExists (from, to, gently, cb) { fs.stat(from, function (er) { if (er) return cb() - link(from, to, gently, cb) + fs.readlink(to, function (er, fromOnDisk) { + // if the link already exists and matches what we would do, + // we don't need to do anything + if (!er) { + var toDir = path.dirname(to) + var absoluteFrom = path.resolve(toDir, from) + var absoluteFromOnDisk = path.resolve(toDir, fromOnDisk) + if (absoluteFrom === absoluteFromOnDisk) return cb() + } + link(from, to, gently, cb) + }) + }) +} + +function resolveIfSymlink (maybeSymlinkPath, cb) { + fs.lstat(maybeSymlinkPath, function (err, stat) { + if (err) return cb.apply(this, arguments) + if (!stat.isSymbolicLink()) return cb(null, maybeSymlinkPath) + fs.readlink(maybeSymlinkPath, cb) + }) +} + +function ensureFromIsNotSource (from, to, cb) { + resolveIfSymlink(from, function (err, fromDestination) { + if (err) return cb.apply(this, arguments) + if (path.resolve(path.dirname(from), fromDestination) === path.resolve(to)) { + return cb(new Error('Link target resolves to the same directory as link source: ' + to)) + } + cb.apply(this, arguments) }) } function link (from, to, gently, abs, cb) { - if (typeof cb !== "function") cb = abs, abs = false - if (typeof cb !== "function") cb = gently, gently = null - if (npm.config.get("force")) gently = false + if (typeof cb !== 'function') { + cb = abs + abs = false + } + if (typeof cb !== 'function') { + cb = gently + gently = null + } + if (npm.config.get('force')) gently = false to = path.resolve(to) var target = from = path.resolve(from) - if (!abs && process.platform !== "win32") { + if (!abs && process.platform !== 'win32') { // junctions on windows must be absolute target = path.relative(path.dirname(to), from) // if there is no folder in common, then it will be much @@ -31,10 +64,14 @@ function link (from, to, gently, abs, cb) { if (target.length >= from.length) target = from } - chain - ( [ [fs, "stat", from] - , [rm, to, gently] - , [mkdir, path.dirname(to)] - , [fs, "symlink", target, to, "junction"] ] - , cb) + chain( + [ + [ensureFromIsNotSource, from, to], + [fs, 'stat', from], + [rm, to, gently], + [mkdir, path.dirname(to)], + [fs, 'symlink', target, to, 'junction'] + ], + cb + ) } diff --git a/deps/npm/lib/utils/locker.js b/deps/npm/lib/utils/locker.js index 293d2da052b956..9cd8b2c4fdac95 100644 --- a/deps/npm/lib/utils/locker.js +++ b/deps/npm/lib/utils/locker.js @@ -1,38 +1,39 @@ -var crypto = require("crypto") -var resolve = require("path").resolve +var crypto = require('crypto') +var resolve = require('path').resolve -var lockfile = require("lockfile") -var log = require("npmlog") -var mkdirp = require("mkdirp") +var lockfile = require('lockfile') +var log = require('npmlog') -var npm = require("../npm.js") +var npm = require('../npm.js') var correctMkdir = require('../utils/correct-mkdir.js') var installLocks = {} function lockFileName (base, name) { - var c = name.replace(/[^a-zA-Z0-9]+/g, "-").replace(/^-+|-+$/g, "") - , p = resolve(base, name) - , h = crypto.createHash("sha1").update(p).digest("hex") - , l = resolve(npm.cache, "_locks") + var c = name.replace(/[^a-zA-Z0-9]+/g, '-').replace(/^-+|-+$/g, '') + var p = resolve(base, name) + var h = crypto.createHash('sha1').update(p).digest('hex') + var l = resolve(npm.cache, '_locks') - return resolve(l, c.substr(0, 24)+"-"+h.substr(0, 16)+".lock") + return resolve(l, c.substr(0, 24) + '-' + h.substr(0, 16) + '.lock') } function lock (base, name, cb) { - var lockDir = resolve(npm.cache, "_locks") + var lockDir = resolve(npm.cache, '_locks') correctMkdir(lockDir, function (er) { if (er) return cb(er) - var opts = { stale: npm.config.get("cache-lock-stale") - , retries: npm.config.get("cache-lock-retries") - , wait: npm.config.get("cache-lock-wait") } + var opts = { + stale: npm.config.get('cache-lock-stale'), + retries: npm.config.get('cache-lock-retries'), + wait: npm.config.get('cache-lock-wait') + } var lf = lockFileName(base, name) lockfile.lock(lf, opts, function (er) { - if (er) log.warn("locking", lf, "failed", er) + if (er) log.warn('locking', lf, 'failed', er) if (!er) { - log.verbose("lock", "using", lf, "for", resolve(base, name)) + log.verbose('lock', 'using', lf, 'for', resolve(base, name)) installLocks[lf] = true } @@ -43,31 +44,30 @@ function lock (base, name, cb) { function unlock (base, name, cb) { var lf = lockFileName(base, name) - , locked = installLocks[lf] + var locked = installLocks[lf] if (locked === false) { return process.nextTick(cb) - } - else if (locked === true) { + } else if (locked === true) { lockfile.unlock(lf, function (er) { if (er) { - log.warn("unlocking", lf, "failed", er) - } - else { + log.warn('unlocking', lf, 'failed', er) + } else { installLocks[lf] = false - log.verbose("unlock", "done using", lf, "for", resolve(base, name)) + log.verbose('unlock', 'done using', lf, 'for', resolve(base, name)) } cb(er) }) - } - else { - throw new Error( - "Attempt to unlock " + resolve(base, name) + ", which hasn't been locked" + } else { + var notLocked = new Error( + 'Attempt to unlock ' + resolve(base, name) + ", which hasn't been locked" ) + notLocked.code = 'ENOTLOCKED' + throw notLocked } } module.exports = { - lock : lock, - unlock : unlock + lock: lock, + unlock: unlock } diff --git a/deps/npm/lib/utils/map-to-registry.js b/deps/npm/lib/utils/map-to-registry.js index bd68a26d42ef8e..9e7ce6749042c3 100644 --- a/deps/npm/lib/utils/map-to-registry.js +++ b/deps/npm/lib/utils/map-to-registry.js @@ -1,56 +1,100 @@ -var url = require("url") +var url = require('url') -var log = require("npmlog") - , npa = require("npm-package-arg") +var log = require('npmlog') +var npa = require('npm-package-arg') module.exports = mapToRegistry -function mapToRegistry(name, config, cb) { - log.silly("mapToRegistry", "name", name) +function mapToRegistry (name, config, cb) { + log.silly('mapToRegistry', 'name', name) var registry // the name itself takes precedence var data = npa(name) if (data.scope) { // the name is definitely scoped, so escape now - name = name.replace("/", "%2f") + name = name.replace('/', '%2f') - log.silly("mapToRegistry", "scope (from package name)", data.scope) + log.silly('mapToRegistry', 'scope (from package name)', data.scope) - registry = config.get(data.scope + ":registry") + registry = config.get(data.scope + ':registry') if (!registry) { - log.verbose("mapToRegistry", "no registry URL found in name for scope", data.scope) + log.verbose('mapToRegistry', 'no registry URL found in name for scope', data.scope) } } // ...then --scope=@scope or --scope=scope - var scope = config.get("scope") + var scope = config.get('scope') if (!registry && scope) { // I'm an enabler, sorry - if (scope.charAt(0) !== "@") scope = "@" + scope + if (scope.charAt(0) !== '@') scope = '@' + scope - log.silly("mapToRegistry", "scope (from config)", scope) + log.silly('mapToRegistry', 'scope (from config)', scope) - registry = config.get(scope + ":registry") + registry = config.get(scope + ':registry') if (!registry) { - log.verbose("mapToRegistry", "no registry URL found in config for scope", scope) + log.verbose('mapToRegistry', 'no registry URL found in config for scope', scope) } } // ...and finally use the default registry if (!registry) { - log.silly("mapToRegistry", "using default registry") - registry = config.get("registry") + log.silly('mapToRegistry', 'using default registry') + registry = config.get('registry') } - log.silly("mapToRegistry", "registry", registry) + log.silly('mapToRegistry', 'registry', registry) var auth = config.getCredentialsByURI(registry) // normalize registry URL so resolution doesn't drop a piece of registry URL - var normalized = registry.slice(-1) !== "/" ? registry+"/" : registry - var uri = url.resolve(normalized, name) - log.silly("mapToRegistry", "uri", uri) + var normalized = registry.slice(-1) !== '/' ? registry + '/' : registry + var uri + log.silly('mapToRegistry', 'data', data) + if (data.type === 'remote') { + uri = data.spec + } else { + uri = url.resolve(normalized, name) + } + + log.silly('mapToRegistry', 'uri', uri) + + cb(null, uri, scopeAuth(uri, registry, auth), normalized) +} + +function scopeAuth (uri, registry, auth) { + var cleaned = { + scope: auth.scope, + email: auth.email, + alwaysAuth: auth.alwaysAuth, + token: undefined, + username: undefined, + password: undefined, + auth: undefined + } + + var requestHost + var registryHost + + if (auth.token || auth.auth || (auth.username && auth.password)) { + requestHost = url.parse(uri).hostname + registryHost = url.parse(registry).hostname + + if (requestHost === registryHost) { + cleaned.token = auth.token + cleaned.auth = auth.auth + cleaned.username = auth.username + cleaned.password = auth.password + } else if (auth.alwaysAuth) { + log.verbose('scopeAuth', 'alwaysAuth set for', registry) + cleaned.token = auth.token + cleaned.auth = auth.auth + cleaned.username = auth.username + cleaned.password = auth.password + } else { + log.silly('scopeAuth', uri, "doesn't share host with registry", registry) + } + } - cb(null, uri, auth, normalized) + return cleaned } diff --git a/deps/npm/lib/utils/module-name.js b/deps/npm/lib/utils/module-name.js new file mode 100644 index 00000000000000..7ca175487c0989 --- /dev/null +++ b/deps/npm/lib/utils/module-name.js @@ -0,0 +1,33 @@ +'use strict' +var path = require('path') +var validate = require('aproba') + +module.exports = moduleName +module.exports.test = {} + +module.exports.test.pathToPackageName = pathToPackageName +function pathToPackageName (dir) { + if (dir == null) return '' + if (dir === '') return '' + var name = path.relative(path.resolve(dir, '..'), dir) + var scoped = path.relative(path.resolve(dir, '../..'), dir) + if (scoped[0] === '@') return scoped + return name +} + +module.exports.test.isNotEmpty = isNotEmpty +function isNotEmpty (str) { + return str != null && str !== '' +} + +var unknown = 0 +function moduleName (tree) { + validate('O', arguments) + var pkg = tree.package || tree + if (isNotEmpty(pkg.name)) return pkg.name + var pkgName = pathToPackageName(tree.path) + if (pkgName !== '') return pkgName + if (tree._invalidName != null) return tree._invalidName + tree._invalidName = '!invalid#' + (++unknown) + return tree._invalidName +} diff --git a/deps/npm/lib/utils/package-id.js b/deps/npm/lib/utils/package-id.js new file mode 100644 index 00000000000000..2c5e3314694c31 --- /dev/null +++ b/deps/npm/lib/utils/package-id.js @@ -0,0 +1,15 @@ +'use strict' +var moduleName = require('./module-name.js') + +module.exports = function (tree) { + var pkg = tree.package || tree + // FIXME: Excluding the '@' here is cleaning up after the mess that + // read-package-json makes. =( + if (pkg._id && pkg._id !== '@') return pkg._id + var name = moduleName(tree) + if (pkg.version) { + return name + '@' + pkg.version + } else { + return name + } +} diff --git a/deps/npm/lib/utils/parse-json.js b/deps/npm/lib/utils/parse-json.js new file mode 100644 index 00000000000000..5c0b959a0d39ee --- /dev/null +++ b/deps/npm/lib/utils/parse-json.js @@ -0,0 +1,24 @@ +'use strict' +var parseJSON = module.exports = function (content) { + return JSON.parse(stripBOM(content)) +} + +parseJSON.noExceptions = function (content) { + try { + return parseJSON(content) + } catch (ex) { + return + } +} + +// from read-package-json +function stripBOM (content) { + content = content.toString() + // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + // because the buffer-to-string conversion in `fs.readFileSync()` + // translates it to FEFF, the UTF-16 BOM. + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1) + } + return content +} diff --git a/deps/npm/lib/utils/pulse-till-done.js b/deps/npm/lib/utils/pulse-till-done.js new file mode 100644 index 00000000000000..fc6450e0030015 --- /dev/null +++ b/deps/npm/lib/utils/pulse-till-done.js @@ -0,0 +1,21 @@ +'use strict' +var validate = require('aproba') +var log = require('npmlog') + +var pulsers = 0 +var pulse + +module.exports = function (prefix, cb) { + validate('SF', [prefix, cb]) + if (!pulsers++) { + pulse = setInterval(function () { + log.gauge.pulse('network') + }, 250) + } + return function () { + if (!--pulsers) { + clearInterval(pulse) + } + cb.apply(null, arguments) + } +} diff --git a/deps/npm/lib/utils/read-local-package.js b/deps/npm/lib/utils/read-local-package.js index ca6d613210f1da..27ca7b4e395376 100644 --- a/deps/npm/lib/utils/read-local-package.js +++ b/deps/npm/lib/utils/read-local-package.js @@ -1,12 +1,12 @@ exports = module.exports = readLocalPkg -var npm = require("../npm.js") - , readJson = require("read-package-json") +var npm = require('../npm.js') +var readJson = require('read-package-json') function readLocalPkg (cb) { - if (npm.config.get("global")) return cb() - var path = require("path") - readJson(path.resolve(npm.prefix, "package.json"), function (er, d) { + if (npm.config.get('global')) return cb() + var path = require('path') + readJson(path.resolve(npm.prefix, 'package.json'), function (er, d) { return cb(er, d && d.name) }) } diff --git a/deps/npm/lib/utils/rename.js b/deps/npm/lib/utils/rename.js new file mode 100644 index 00000000000000..8a444289844b10 --- /dev/null +++ b/deps/npm/lib/utils/rename.js @@ -0,0 +1,16 @@ +'use strict' +var fs = require('graceful-fs') +var SaveStack = require('./save-stack.js') + +module.exports = rename + +function rename (from, to, cb) { + var saved = new SaveStack(rename) + fs.rename(from, to, function (er) { + if (er) { + return cb(saved.completeWith(er)) + } else { + return cb() + } + }) +} diff --git a/deps/npm/lib/utils/save-stack.js b/deps/npm/lib/utils/save-stack.js new file mode 100644 index 00000000000000..42c4aab5f94483 --- /dev/null +++ b/deps/npm/lib/utils/save-stack.js @@ -0,0 +1,16 @@ +'use strict' +var inherits = require('inherits') + +module.exports = SaveStack + +function SaveStack (fn) { + Error.call(this) + Error.captureStackTrace(this, fn || SaveStack) +} +inherits(SaveStack, Error) + +SaveStack.prototype.completeWith = function (er) { + this['__' + 'proto' + '__'] = er + this.stack = this.stack + '\n\n' + er.stack + return this +} diff --git a/deps/npm/lib/utils/spawn.js b/deps/npm/lib/utils/spawn.js index 74684521f741a0..e389d83e02c64d 100644 --- a/deps/npm/lib/utils/spawn.js +++ b/deps/npm/lib/utils/spawn.js @@ -1,16 +1,16 @@ module.exports = spawn -var _spawn = require("child_process").spawn -var EventEmitter = require("events").EventEmitter +var _spawn = require('child_process').spawn +var EventEmitter = require('events').EventEmitter function spawn (cmd, args, options) { var raw = _spawn(cmd, args, options) var cooked = new EventEmitter() - raw.on("error", function (er) { + raw.on('error', function (er) { er.file = cmd - cooked.emit("error", er) - }).on("close", function (code, signal) { + cooked.emit('error', er) + }).on('close', function (code, signal) { // Create ENOENT error because Node.js v0.8 will not emit // an `error` event if the command could not be found. if (code === 127) { @@ -21,7 +21,7 @@ function spawn (cmd, args, options) { er.file = cmd cooked.emit('error', er) } else { - cooked.emit("close", code, signal) + cooked.emit('close', code, signal) } }) diff --git a/deps/npm/lib/utils/tar.js b/deps/npm/lib/utils/tar.js index 7656b5d9754a3a..8eb2311d096a6c 100644 --- a/deps/npm/lib/utils/tar.js +++ b/deps/npm/lib/utils/tar.js @@ -1,22 +1,28 @@ // commands for packing and unpacking tarballs // this file is used by lib/cache.js -var npm = require("../npm.js") - , fs = require("graceful-fs") - , writeFileAtomic = require("write-file-atomic") - , writeStreamAtomic = require("fs-write-stream-atomic") - , path = require("path") - , log = require("npmlog") - , uidNumber = require("uid-number") - , rm = require("./gently-rm.js") - , readJson = require("read-package-json") - , myUid = process.getuid && process.getuid() - , myGid = process.getgid && process.getgid() - , tar = require("tar") - , zlib = require("zlib") - , fstream = require("fstream") - , Packer = require("fstream-npm") - , lifecycle = require("./lifecycle.js") +var fs = require('graceful-fs') +var path = require('path') +var writeFileAtomic = require('write-file-atomic') +var writeStreamAtomic = require('fs-write-stream-atomic') +var log = require('npmlog') +var uidNumber = require('uid-number') +var readJson = require('read-package-json') +var tar = require('tar') +var zlib = require('zlib') +var fstream = require('fstream') +var Packer = require('fstream-npm') +var iferr = require('iferr') +var inherits = require('inherits') +var npm = require('../npm.js') +var rm = require('./gently-rm.js') +var myUid = process.getuid && process.getuid() +var myGid = process.getgid && process.getgid() +var readPackageTree = require('read-package-tree') +var union = require('lodash.union') +var flattenTree = require('../install/flatten-tree.js') +var moduleName = require('./module-name.js') +var packageId = require('./package-id.js') if (process.env.SUDO_UID && myUid === 0) { if (!isNaN(process.env.SUDO_UID)) myUid = +process.env.SUDO_UID @@ -26,28 +32,148 @@ if (process.env.SUDO_UID && myUid === 0) { exports.pack = pack exports.unpack = unpack -function pack (tarball, folder, pkg, dfc, cb) { - log.verbose("tar pack", [tarball, folder]) - if (typeof cb !== "function") cb = dfc, dfc = false +function pack (tarball, folder, pkg, cb) { + log.verbose('tar pack', [tarball, folder]) + + log.verbose('tarball', tarball) + log.verbose('folder', folder) + + readJson(path.join(folder, 'package.json'), function (er, pkg) { + if (er || !pkg.bundleDependencies) { + pack_(tarball, folder, null, null, pkg, cb) + } else { + // we require this at runtime due to load-order issues, because recursive + // requires fail if you replace the exports object, and we do, not in deps, but + // in a dep of it. + var recalculateMetadata = require('../install/deps.js').recalculateMetadata + + readPackageTree(folder, iferr(cb, function (tree) { + recalculateMetadata(tree, log.newGroup('pack:' + pkg), iferr(cb, function () { + pack_(tarball, folder, tree, flattenTree(tree), pkg, cb) + })) + })) + } + }) +} - log.verbose("tarball", tarball) - log.verbose("folder", folder) +function BundledPacker (props) { + Packer.call(this, props) +} +inherits(BundledPacker, Packer) + +BundledPacker.prototype.applyIgnores = function (entry, partial, entryObj) { + // package.json files can never be ignored. + if (entry === 'package.json') return true + + // readme files should never be ignored. + if (entry.match(/^readme(\.[^\.]*)$/i)) return true + + // license files should never be ignored. + if (entry.match(/^(license|licence)(\.[^\.]*)?$/i)) return true + + // changelogs should never be ignored. + if (entry.match(/^(changes|changelog|history)(\.[^\.]*)?$/i)) return true + + // special rules. see below. + if (entry === 'node_modules' && this.packageRoot) return true + + // some files are *never* allowed under any circumstances + if (entry === '.git' || + entry === '.lock-wscript' || + entry.match(/^\.wafpickle-[0-9]+$/) || + entry === 'CVS' || + entry === '.svn' || + entry === '.hg' || + entry.match(/^\..*\.swp$/) || + entry === '.DS_Store' || + entry.match(/^\._/) || + entry === 'npm-debug.log' + ) { + return false + } - if (dfc) { - // do fancy crap - return lifecycle(pkg, "prepublish", folder, function (er) { - if (er) return cb(er) - pack_(tarball, folder, pkg, cb) - }) - } else { - pack_(tarball, folder, pkg, cb) + // in a node_modules folder, we only include bundled dependencies + // also, prevent packages in node_modules from being affected + // by rules set in the containing package, so that + // bundles don't get busted. + // Also, once in a bundle, everything is installed as-is + // To prevent infinite cycles in the case of cyclic deps that are + // linked with npm link, even in a bundle, deps are only bundled + // if they're not already present at a higher level. + if (this.bundleMagic) { + // bubbling up. stop here and allow anything the bundled pkg allows + if (entry.indexOf('/') !== -1) return true + + // never include the .bin. It's typically full of platform-specific + // stuff like symlinks and .cmd files anyway. + if (entry === '.bin') return false + + // the package root. + var p = this.parent + // the package before this one. + var pp = p && p.parent + + // if this entry has already been bundled, and is a symlink, + // and it is the *same* symlink as this one, then exclude it. + if (pp && pp.bundleLinks && this.bundleLinks && + pp.bundleLinks[entry] && + pp.bundleLinks[entry] === this.bundleLinks[entry]) { + return false + } + + // since it's *not* a symbolic link, if we're *already* in a bundle, + // then we should include everything. + if (pp && pp.package && pp.basename === 'node_modules') { + return true + } + + // only include it at this point if it's a bundleDependency + return this.isBundled(entry) } + // if (this.bundled) return true + + return Packer.prototype.applyIgnores.call(this, entry, partial, entryObj) } -function pack_ (tarball, folder, pkg, cb) { - new Packer({ path: folder, type: "Directory", isDirectory: true }) - .on("error", function (er) { - if (er) log.error("tar pack", "Error reading " + folder) +function nameMatch (name) { return function (other) { return name === moduleName(other) } } + +function pack_ (tarball, folder, tree, flatTree, pkg, cb) { + function InstancePacker (props) { + BundledPacker.call(this, props) + } + inherits(InstancePacker, BundledPacker) + InstancePacker.prototype.isBundled = function (name) { + var bd = this.package && this.package.bundleDependencies + if (!bd) return false + + if (!Array.isArray(bd)) { + throw new Error(packageId(this) + '\'s `bundledDependencies` should ' + + 'be an array') + } + if (!tree) return false + + if (bd.indexOf(name) !== -1) return true + var pkg = tree.children.filter(nameMatch(name))[0] + if (!pkg) return false + var requiredBy = union([], pkg.package._requiredBy) + var seen = {} + while (requiredBy.length) { + var req = requiredBy.shift() + if (seen[req]) continue + seen[req] = true + var reqPkg = flatTree[req] + if (!reqPkg) continue + if (reqPkg.parent === tree && bd.indexOf(moduleName(reqPkg)) !== -1) { + return true + } + requiredBy = union(requiredBy, reqPkg.package._requiredBy) + } + return false + } + + new InstancePacker({ path: folder, type: 'Directory', isDirectory: true }) + .on('error', function (er) { + if (er) log.error('tar pack', 'Error reading ' + folder) return cb(er) }) @@ -56,32 +182,43 @@ function pack_ (tarball, folder, pkg, cb) { // However, npm *itself* excludes these from its own package, // so that it can be more easily bootstrapped using old and // non-compliant tar implementations. - .pipe(tar.Pack({ noProprietary: !npm.config.get("proprietary-attribs") })) - .on("error", function (er) { - if (er) log.error("tar.pack", "tar creation error", tarball) + .pipe(tar.Pack({ noProprietary: !npm.config.get('proprietary-attribs') })) + .on('error', function (er) { + if (er) log.error('tar.pack', 'tar creation error', tarball) cb(er) }) .pipe(zlib.Gzip()) - .on("error", function (er) { - if (er) log.error("tar.pack", "gzip error "+tarball) + .on('error', function (er) { + if (er) log.error('tar.pack', 'gzip error ' + tarball) cb(er) }) .pipe(writeStreamAtomic(tarball)) - .on("error", function (er) { - if (er) log.error("tar.pack", "Could not write "+tarball) + .on('error', function (er) { + if (er) log.error('tar.pack', 'Could not write ' + tarball) cb(er) }) - .on("close", cb) + .on('close', cb) } - function unpack (tarball, unpackTarget, dMode, fMode, uid, gid, cb) { - log.verbose("tar", "unpack", tarball) - log.verbose("tar", "unpacking to", unpackTarget) - if (typeof cb !== "function") cb = gid, gid = null - if (typeof cb !== "function") cb = uid, uid = null - if (typeof cb !== "function") cb = fMode, fMode = npm.modes.file - if (typeof cb !== "function") cb = dMode, dMode = npm.modes.exec + log.verbose('tar', 'unpack', tarball) + log.verbose('tar', 'unpacking to', unpackTarget) + if (typeof cb !== 'function') { + cb = gid + gid = null + } + if (typeof cb !== 'function') { + cb = uid + uid = null + } + if (typeof cb !== 'function') { + cb = fMode + fMode = npm.modes.file + } + if (typeof cb !== 'function') { + cb = dMode + dMode = npm.modes.exec + } uidNumber(uid, gid, function (er, uid, gid) { if (er) return cb(er) @@ -89,26 +226,25 @@ function unpack (tarball, unpackTarget, dMode, fMode, uid, gid, cb) { }) } -function unpack_ ( tarball, unpackTarget, dMode, fMode, uid, gid, cb ) { +function unpack_ (tarball, unpackTarget, dMode, fMode, uid, gid, cb) { rm(unpackTarget, function (er) { if (er) return cb(er) // gzip {tarball} --decompress --stdout \ // | tar -mvxpf - --strip-components=1 -C {unpackTarget} - gunzTarPerm( tarball, unpackTarget - , dMode, fMode - , uid, gid - , function (er, folder) { - if (er) return cb(er) - readJson(path.resolve(folder, "package.json"), cb) - }) + gunzTarPerm(tarball, unpackTarget, + dMode, fMode, + uid, gid, + function (er, folder) { + if (er) return cb(er) + readJson(path.resolve(folder, 'package.json'), cb) + }) }) } - function gunzTarPerm (tarball, target, dMode, fMode, uid, gid, cb_) { if (!dMode) dMode = npm.modes.exec if (!fMode) fMode = npm.modes.file - log.silly("gunzTarPerm", "modes", [dMode.toString(8), fMode.toString(8)]) + log.silly('gunzTarPerm', 'modes', [dMode.toString(8), fMode.toString(8)]) var cbCalled = false function cb (er) { @@ -119,51 +255,51 @@ function gunzTarPerm (tarball, target, dMode, fMode, uid, gid, cb_) { var fst = fs.createReadStream(tarball) - fst.on("open", function (fd) { + fst.on('open', function (fd) { fs.fstat(fd, function (er, st) { - if (er) return fst.emit("error", er) + if (er) return fst.emit('error', er) if (st.size === 0) { - er = new Error("0-byte tarball\n" + - "Please run `npm cache clean`") - fst.emit("error", er) + er = new Error('0-byte tarball\n' + + 'Please run `npm cache clean`') + fst.emit('error', er) } }) }) // figure out who we're supposed to be, if we're not pretending // to be a specific user. - if (npm.config.get("unsafe-perm") && process.platform !== "win32") { + if (npm.config.get('unsafe-perm') && process.platform !== 'win32') { uid = myUid gid = myGid } function extractEntry (entry) { - log.silly("gunzTarPerm", "extractEntry", entry.path) + log.silly('gunzTarPerm', 'extractEntry', entry.path) // never create things that are user-unreadable, // or dirs that are user-un-listable. Only leads to headaches. var originalMode = entry.mode = entry.mode || entry.props.mode - entry.mode = entry.mode | (entry.type === "Directory" ? dMode : fMode) + entry.mode = entry.mode | (entry.type === 'Directory' ? dMode : fMode) entry.mode = entry.mode & (~npm.modes.umask) entry.props.mode = entry.mode if (originalMode !== entry.mode) { - log.silly( "gunzTarPerm", "modified mode" - , [entry.path, originalMode, entry.mode]) + log.silly('gunzTarPerm', 'modified mode', + [entry.path, originalMode, entry.mode]) } // if there's a specific owner uid/gid that we want, then set that - if (process.platform !== "win32" && - typeof uid === "number" && - typeof gid === "number") { + if (process.platform !== 'win32' && + typeof uid === 'number' && + typeof gid === 'number') { entry.props.uid = entry.uid = uid entry.props.gid = entry.gid = gid } } - var extractOpts = { type: "Directory", path: target, strip: 1 } + var extractOpts = { type: 'Directory', path: target, strip: 1 } - if (process.platform !== "win32" && - typeof uid === "number" && - typeof gid === "number") { + if (process.platform !== 'win32' && + typeof uid === 'number' && + typeof gid === 'number') { extractOpts.uid = uid extractOpts.gid = gid } @@ -172,9 +308,9 @@ function gunzTarPerm (tarball, target, dMode, fMode, uid, gid, cb_) { extractOpts.filter = function () { // symbolic links are not allowed in packages. if (this.type.match(/^.*Link$/)) { - log.warn( "excluding symbolic link" - , this.path.substr(target.length + 1) - + " -> " + this.linkpath ) + log.warn('excluding symbolic link', + this.path.substr(target.length + 1) + + ' -> ' + this.linkpath) return false } @@ -182,12 +318,12 @@ function gunzTarPerm (tarball, target, dMode, fMode, uid, gid, cb_) { // employed during tarball creation, in the fstream-npm module. // It is duplicated here to handle tarballs that are created // using other means, such as system tar or git archive. - if (this.type === "File") { + if (this.type === 'File') { var base = path.basename(this.path) - if (base === ".npmignore") { + if (base === '.npmignore') { sawIgnores[ this.path ] = true - } else if (base === ".gitignore") { - var npmignore = this.path.replace(/\.gitignore$/, ".npmignore") + } else if (base === '.gitignore') { + var npmignore = this.path.replace(/\.gitignore$/, '.npmignore') if (sawIgnores[npmignore]) { // Skip this one, already seen. return false @@ -202,13 +338,12 @@ function gunzTarPerm (tarball, target, dMode, fMode, uid, gid, cb_) { return true } - fst - .on("error", function (er) { - if (er) log.error("tar.unpack", "error reading "+tarball) + .on('error', function (er) { + if (er) log.error('tar.unpack', 'error reading ' + tarball) cb(er) }) - .on("data", function OD (c) { + .on('data', function OD (c) { // detect what it is. // Then, depending on that, we'll figure out whether it's // a single-file module, gzipped tarball, or naked tarball. @@ -218,59 +353,59 @@ function gunzTarPerm (tarball, target, dMode, fMode, uid, gid, cb_) { c[2] === 0x08) { fst .pipe(zlib.Unzip()) - .on("error", function (er) { - if (er) log.error("tar.unpack", "unzip error "+tarball) + .on('error', function (er) { + if (er) log.error('tar.unpack', 'unzip error ' + tarball) cb(er) }) .pipe(tar.Extract(extractOpts)) - .on("entry", extractEntry) - .on("error", function (er) { - if (er) log.error("tar.unpack", "untar error "+tarball) + .on('entry', extractEntry) + .on('error', function (er) { + if (er) log.error('tar.unpack', 'untar error ' + tarball) cb(er) }) - .on("close", cb) + .on('close', cb) } else if (hasTarHeader(c)) { // naked tar fst .pipe(tar.Extract(extractOpts)) - .on("entry", extractEntry) - .on("error", function (er) { - if (er) log.error("tar.unpack", "untar error "+tarball) + .on('entry', extractEntry) + .on('error', function (er) { + if (er) log.error('tar.unpack', 'untar error ' + tarball) cb(er) }) - .on("close", cb) + .on('close', cb) } else { // naked js file - var jsOpts = { path: path.resolve(target, "index.js") } + var jsOpts = { path: path.resolve(target, 'index.js') } - if (process.platform !== "win32" && - typeof uid === "number" && - typeof gid === "number") { + if (process.platform !== 'win32' && + typeof uid === 'number' && + typeof gid === 'number') { jsOpts.uid = uid jsOpts.gid = gid } fst .pipe(fstream.Writer(jsOpts)) - .on("error", function (er) { - if (er) log.error("tar.unpack", "copy error "+tarball) + .on('error', function (er) { + if (er) log.error('tar.unpack', 'copy error ' + tarball) cb(er) }) - .on("close", function () { - var j = path.resolve(target, "package.json") + .on('close', function () { + var j = path.resolve(target, 'package.json') readJson(j, function (er, d) { if (er) { - log.error("not a package", tarball) + log.error('not a package', tarball) return cb(er) } - writeFileAtomic(j, JSON.stringify(d) + "\n", cb) + writeFileAtomic(j, JSON.stringify(d) + '\n', cb) }) }) } // now un-hook, and re-emit the chunk - fst.removeListener("data", OD) - fst.emit("data", c) + fst.removeListener('data', OD) + fst.emit('data', c) }) } diff --git a/deps/npm/lib/utils/temp-filename.js b/deps/npm/lib/utils/temp-filename.js new file mode 100644 index 00000000000000..6b8245e8b790f0 --- /dev/null +++ b/deps/npm/lib/utils/temp-filename.js @@ -0,0 +1,7 @@ +'use strict' +var uniqueFilename = require('unique-filename') +var npm = require('../npm.js') + +module.exports = function (prefix) { + return uniqueFilename(npm.tmp, prefix) +} diff --git a/deps/npm/lib/utils/umask.js b/deps/npm/lib/utils/umask.js index 6ccb4a1194b658..2dde1befa69dce 100644 --- a/deps/npm/lib/utils/umask.js +++ b/deps/npm/lib/utils/umask.js @@ -1,5 +1,5 @@ -var umask = require("umask") -var npmlog = require("npmlog") +var umask = require('umask') +var npmlog = require('npmlog') var _fromString = umask.fromString module.exports = umask @@ -8,7 +8,7 @@ module.exports = umask umask.fromString = function (val) { _fromString(val, function (err, result) { if (err) { - npmlog.warn("invalid umask", err.message) + npmlog.warn('invalid umask', err.message) } val = result }) diff --git a/deps/npm/lib/utils/warn-deprecated.js b/deps/npm/lib/utils/warn-deprecated.js index ec821b9bd495b1..fe5c5ec82a304d 100644 --- a/deps/npm/lib/utils/warn-deprecated.js +++ b/deps/npm/lib/utils/warn-deprecated.js @@ -1,6 +1,6 @@ module.exports = warnDeprecated -var log = require("npmlog") +var log = require('npmlog') var deprecations = {} @@ -11,8 +11,7 @@ function warnDeprecated (type) { deprecations[type] = {} messages.forEach(function (m) { log.warn(type, m) }) } - } - else { + } else { if (!deprecations[type]) deprecations[type] = {} if (!deprecations[type][instance]) { diff --git a/deps/npm/lib/version.js b/deps/npm/lib/version.js index dbd48a0145a3d7..448c7713cedbca 100644 --- a/deps/npm/lib/version.js +++ b/deps/npm/lib/version.js @@ -12,8 +12,9 @@ var npm = require('./npm.js') var git = require('./utils/git.js') var assert = require('assert') var lifecycle = require('./utils/lifecycle.js') +var parseJSON = require('./utils/parse-json.js') -version.usage = 'npm version [ | major | minor | patch | premajor | preminor | prepatch | prerelease]' + +version.usage = 'npm version [ | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git]' + '\n(run in package dir)\n' + "'npm -v' or 'npm --version' to print npm version " + '(' + npm.version + ')\n' + @@ -28,16 +29,7 @@ function version (args, silent, cb_) { } if (args.length > 1) return cb_(version.usage) - var packagePath = path.join(npm.localPrefix, 'package.json') - fs.readFile(packagePath, function (er, data) { - if (data) data = data.toString() - try { - data = JSON.parse(data) - } catch (e) { - er = e - data = null - } - + readPackage(function (er, data) { if (!args.length) return dump(data, cb_) if (er) { @@ -45,27 +37,73 @@ function version (args, silent, cb_) { return cb_(er) } - var newVersion = semver.valid(args[0]) - if (!newVersion) newVersion = semver.inc(data.version, args[0]) - if (!newVersion) return cb_(version.usage) - if (data.version === newVersion) return cb_(new Error('Version not changed')) - data.version = newVersion - var lifecycleData = Object.create(data) - lifecycleData._id = data.name + '@' + newVersion - var localData = {} - - var where = npm.prefix - chain([ - [checkGit, localData], - [lifecycle, lifecycleData, 'preversion', where], - [updatePackage, newVersion, silent], - [lifecycle, lifecycleData, 'version', where], - [commit, localData, newVersion], - [lifecycle, lifecycleData, 'postversion', where] ], - cb_) + if (args[0] === 'from-git') { + retrieveTagVersion(silent, data, cb_) + } else { + var newVersion = semver.valid(args[0]) + if (!newVersion) newVersion = semver.inc(data.version, args[0]) + if (!newVersion) return cb_(version.usage) + persistVersion(newVersion, silent, data, cb_) + } + }) +} + +function retrieveTagVersion (silent, data, cb_) { + chain([ + verifyGit, + parseLastGitTag + ], function (er, results) { + if (er) return cb_(er) + var localData = { + hasGit: true, + existingTag: true + } + + var version = results[results.length - 1] + persistVersion(version, silent, data, localData, cb_) + }) +} + +function parseLastGitTag (cb) { + var options = { env: process.env } + git.whichAndExec(['describe', '--abbrev=0'], options, function (er, stdout) { + if (er) { + if (er.message.indexOf('No names found') !== -1) return cb(new Error('No tags found')) + return cb(er) + } + + var tag = stdout.trim() + var prefix = npm.config.get('tag-version-prefix') + // Strip the prefix from the start of the tag: + if (tag.indexOf(prefix) === 0) tag = tag.slice(prefix.length) + var version = semver.valid(tag) + if (!version) return cb(new Error(tag + ' is not a valid version')) + cb(null, version) }) } +function persistVersion (newVersion, silent, data, localData, cb_) { + if (typeof localData === 'function') { + cb_ = localData + localData = {} + } + + if (data.version === newVersion) return cb_(new Error('Version not changed')) + data.version = newVersion + var lifecycleData = Object.create(data) + lifecycleData._id = data.name + '@' + newVersion + + var where = npm.prefix + chain([ + !localData.hasGit && [checkGit, localData], + [lifecycle, lifecycleData, 'preversion', where], + [updatePackage, newVersion, silent], + [lifecycle, lifecycleData, 'version', where], + [commit, localData, newVersion], + [lifecycle, lifecycleData, 'postversion', where] + ], cb_) +} + function readPackage (cb) { var packagePath = path.join(npm.localPrefix, 'package.json') fs.readFile(packagePath, function (er, data) { @@ -97,7 +135,8 @@ function updatePackage (newVersion, silent, cb_) { function commit (localData, newVersion, cb) { updateShrinkwrap(newVersion, function (er, hasShrinkwrap) { if (er || !localData.hasGit) return cb(er) - _commit(newVersion, hasShrinkwrap, cb) + localData.hasShrinkwrap = hasShrinkwrap + _commit(newVersion, localData, cb) }) } @@ -107,7 +146,7 @@ function updateShrinkwrap (newVersion, cb) { try { data = data.toString() - data = JSON.parse(data) + data = parseJSON(data) } catch (er) { log.error('version', 'Bad npm-shrinkwrap.json data') return cb(er) @@ -139,8 +178,51 @@ function dump (data, cb) { cb() } +function statGitFolder (cb) { + fs.stat(path.join(npm.localPrefix, '.git'), cb) +} + +function callGitStatus (cb) { + git.whichAndExec( + [ 'status', '--porcelain' ], + { env: process.env }, + cb + ) +} + +function cleanStatusLines (stdout) { + var lines = stdout.trim().split('\n').filter(function (line) { + return line.trim() && !line.match(/^\?\? /) + }).map(function (line) { + return line.trim() + }) + + return lines +} + +function verifyGit (cb) { + function checkStatus (er) { + if (er) return cb(er) + callGitStatus(checkStdout) + } + + function checkStdout (er, stdout) { + if (er) return cb(er) + var lines = cleanStatusLines(stdout) + if (lines.length > 0) { + return cb(new Error( + 'Git working directory not clean.\n' + lines.join('\n') + )) + } + + cb() + } + + statGitFolder(checkStatus) +} + function checkGit (localData, cb) { - fs.stat(path.join(npm.localPrefix, '.git'), function (er, s) { + statGitFolder(function (er) { var doGit = !er && npm.config.get('git-tag-version') if (!doGit) { if (er) log.verbose('version', 'error checking for .git', er) @@ -149,47 +231,45 @@ function checkGit (localData, cb) { } // check for git - git.whichAndExec( - [ 'status', '--porcelain' ], - { env: process.env }, - function (er, stdout) { - if (er && er.code === 'ENOGIT') { - log.warn( - 'version', - 'This is a Git checkout, but the git command was not found.', - 'npm could not create a Git tag for this release!' - ) - return cb(null, false) - } - - var lines = stdout.trim().split('\n').filter(function (line) { - return line.trim() && !line.match(/^\?\? /) - }).map(function (line) { - return line.trim() - }) - if (lines.length && !npm.config.get('force')) { - return cb(new Error( - 'Git working directory not clean.\n' + lines.join('\n') - )) - } - localData.hasGit = true - cb(null, true) + callGitStatus(function (er, stdout) { + if (er && er.code === 'ENOGIT') { + log.warn( + 'version', + 'This is a Git checkout, but the git command was not found.', + 'npm could not create a Git tag for this release!' + ) + return cb(null, false) + } + + var lines = cleanStatusLines(stdout) + if (lines.length && !npm.config.get('force')) { + return cb(new Error( + 'Git working directory not clean.\n' + lines.join('\n') + )) } - ) + localData.hasGit = true + cb(null, true) + }) }) } -function _commit (version, hasShrinkwrap, cb) { +function _commit (version, localData, cb) { + var packagePath = path.join(npm.localPrefix, 'package.json') var options = { env: process.env } var message = npm.config.get('message').replace(/%s/g, version) var sign = npm.config.get('sign-git-tag') var flag = sign ? '-sm' : '-am' chain( [ - git.chainableExec([ 'add', 'package.json' ], options), - hasShrinkwrap && git.chainableExec([ 'add', 'npm-shrinkwrap.json' ], options), + git.chainableExec([ 'add', packagePath ], options), + localData.hasShrinkwrap && git.chainableExec([ 'add', 'npm-shrinkwrap.json' ], options), git.chainableExec([ 'commit', '-m', message ], options), - git.chainableExec([ 'tag', npm.config.get('tag-version-prefix') + version, flag, message ], options) + !localData.existingTag && git.chainableExec([ + 'tag', + npm.config.get('tag-version-prefix') + version, + flag, + message + ], options) ], cb ) diff --git a/deps/npm/lib/view.js b/deps/npm/lib/view.js index 9199d352ae7ff8..e6fa21655e3492 100644 --- a/deps/npm/lib/view.js +++ b/deps/npm/lib/view.js @@ -1,16 +1,17 @@ // npm view [pkg [pkg ...]] module.exports = view -view.usage = "npm view pkg[@version] [[.subfield]...]" - -var npm = require("./npm.js") - , readJson = require("read-package-json") - , log = require("npmlog") - , util = require("util") - , semver = require("semver") - , mapToRegistry = require("./utils/map-to-registry.js") - , npa = require("npm-package-arg") - , path = require("path") +view.usage = 'npm view [<@scope>/][@] [[.subfield]...]' + + '\n\naliases: info, show, v' + +var npm = require('./npm.js') +var readJson = require('read-package-json') +var log = require('npmlog') +var util = require('util') +var semver = require('semver') +var mapToRegistry = require('./utils/map-to-registry.js') +var npa = require('npm-package-arg') +var path = require('path') view.completion = function (opts, cb) { if (opts.conf.argv.remain.length <= 2) { @@ -19,14 +20,14 @@ view.completion = function (opts, cb) { return cb() } // have the package, get the fields. - var tag = npm.config.get("tag") + var tag = npm.config.get('tag') mapToRegistry(opts.conf.argv.remain[2], npm.config, function (er, uri, auth) { if (er) return cb(er) - npm.registry.get(uri, { auth : auth }, function (er, d) { + npm.registry.get(uri, { auth: auth }, function (er, d) { if (er) return cb(er) - var dv = d.versions[d["dist-tags"][tag]] - , fields = [] + var dv = d.versions[d['dist-tags'][tag]] + var fields = [] d.versions = Object.keys(d.versions).sort(semver.compareLoose) fields = getFields(d).concat(getFields(dv)) cb(null, fields) @@ -38,48 +39,51 @@ view.completion = function (opts, cb) { if (!d) return f pref = pref || [] Object.keys(d).forEach(function (k) { - if (k.charAt(0) === "_" || k.indexOf(".") !== -1) return - var p = pref.concat(k).join(".") + if (k.charAt(0) === '_' || k.indexOf('.') !== -1) return + var p = pref.concat(k).join('.') f.push(p) if (Array.isArray(d[k])) { d[k].forEach(function (val, i) { - var pi = p + "[" + i + "]" - if (val && typeof val === "object") getFields(val, f, [p]) + var pi = p + '[' + i + ']' + if (val && typeof val === 'object') getFields(val, f, [p]) else f.push(pi) }) return } - if (typeof d[k] === "object") getFields(d[k], f, [p]) + if (typeof d[k] === 'object') getFields(d[k], f, [p]) }) return f } } function view (args, silent, cb) { - if (typeof cb !== "function") cb = silent, silent = false + if (typeof cb !== 'function') { + cb = silent + silent = false + } - if (!args.length) args = ["."] + if (!args.length) args = ['.'] var pkg = args.shift() - , nv = npa(pkg) - , name = nv.name - , local = (name === "." || !name) + var nv = npa(pkg) + var name = nv.name + var local = (name === '.' || !name) - if (npm.config.get("global") && local) { - return cb(new Error("Cannot use view command in global mode.")) + if (npm.config.get('global') && local) { + return cb(new Error('Cannot use view command in global mode.')) } if (local) { var dir = npm.prefix - readJson(path.resolve(dir, "package.json"), function (er, d) { + readJson(path.resolve(dir, 'package.json'), function (er, d) { d = d || {} - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) - if (!d.name) return cb(new Error("Invalid package.json")) + if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) + if (!d.name) return cb(new Error('Invalid package.json')) var p = d.name nv = npa(p) - if (pkg && ~pkg.indexOf("@")) { - nv.rawSpec = pkg.split("@")[pkg.indexOf("@")] + if (pkg && ~pkg.indexOf('@')) { + nv.rawSpec = pkg.split('@')[pkg.indexOf('@')] } fetchAndRead(nv, args, silent, cb) @@ -92,53 +96,54 @@ function view (args, silent, cb) { function fetchAndRead (nv, args, silent, cb) { // get the data about this package var name = nv.name - , version = nv.rawSpec || npm.config.get("tag") + var version = nv.rawSpec || npm.config.get('tag') mapToRegistry(name, npm.config, function (er, uri, auth) { if (er) return cb(er) - npm.registry.get(uri, { auth : auth }, function (er, data) { + npm.registry.get(uri, { auth: auth }, function (er, data) { if (er) return cb(er) - if (data["dist-tags"] && data["dist-tags"].hasOwnProperty(version)) { - version = data["dist-tags"][version] + if (data['dist-tags'] && data['dist-tags'].hasOwnProperty(version)) { + version = data['dist-tags'][version] } if (data.time && data.time.unpublished) { var u = data.time.unpublished - er = new Error("Unpublished by " + u.name + " on " + u.time) + er = new Error('Unpublished by ' + u.name + ' on ' + u.time) er.statusCode = 404 - er.code = "E404" + er.code = 'E404' er.pkgid = data._id return cb(er, data) } - var results = [] - , error = null - , versions = data.versions || {} + var error = null + var versions = data.versions || {} data.versions = Object.keys(versions).sort(semver.compareLoose) - if (!args.length) args = [""] + if (!args.length) args = [''] // remove readme unless we asked for it - if (-1 === args.indexOf("readme")) { + if (args.indexOf('readme') === -1) { delete data.readme } Object.keys(versions).forEach(function (v) { - if (semver.satisfies(v, version, true)) args.forEach(function (args) { - // remove readme unless we asked for it - if (-1 === args.indexOf("readme")) { - delete versions[v].readme - } - results.push(showFields(data, versions[v], args)) - }) + if (semver.satisfies(v, version, true)) { + args.forEach(function (args) { + // remove readme unless we asked for it + if (args.indexOf('readme') !== -1) { + delete versions[v].readme + } + results.push(showFields(data, versions[v], args)) + }) + } }) results = results.reduce(reducer, {}) var retval = results - if (args.length === 1 && args[0] === "") { + if (args.length === 1 && args[0] === '') { retval = cleanBlanks(retval) - log.silly("cleanup", retval) + log.silly('cleanup', retval) } if (error || silent) cb(error, retval) @@ -150,18 +155,21 @@ function fetchAndRead (nv, args, silent, cb) { function cleanBlanks (obj) { var clean = {} Object.keys(obj).forEach(function (version) { - clean[version] = obj[version][""] + clean[version] = obj[version][''] }) return clean } function reducer (l, r) { - if (r) Object.keys(r).forEach(function (v) { - l[v] = l[v] || {} - Object.keys(r[v]).forEach(function (t) { - l[v][t] = r[v][t] + if (r) { + Object.keys(r).forEach(function (v) { + l[v] = l[v] || {} + Object.keys(r[v]).forEach(function (t) { + l[v][t] = r[v][t] + }) }) - }) + } + return l } @@ -173,12 +181,12 @@ function showFields (data, version, fields) { o[k] = s[k] }) }) - return search(o, fields.split("."), version.version, fields) + return search(o, fields.split('.'), version.version, fields) } function search (data, fields, version, title) { var field - , tail = fields + var tail = fields while (!field && fields.length) field = tail.shift() fields = [field].concat(tail) var o @@ -195,7 +203,7 @@ function search (data, fields, version, title) { if (data.field && data.field.hasOwnProperty(index)) { return search(data[field][index], tail, version, title) } else { - field = field + "[" + index + "]" + field = field + '[' + index + ']' } } if (Array.isArray(data)) { @@ -205,8 +213,8 @@ function search (data, fields, version, title) { var results = [] data.forEach(function (data, i) { var tl = title.length - , newt = title.substr(0, tl-(fields.join(".").length) - 1) - + "["+i+"]" + [""].concat(fields).join(".") + var newt = title.substr(0, tl - fields.join('.').length - 1) + + '[' + i + ']' + [''].concat(fields).join('.') results.push(search(data, fields.slice(), version, newt)) }) results = results.reduce(reducer, {}) @@ -215,11 +223,11 @@ function search (data, fields, version, title) { if (!data.hasOwnProperty(field)) return undefined data = data[field] if (tail.length) { - if (typeof data === "object") { + if (typeof data === 'object') { // there are more fields to deal with. return search(data, tail, version, title) } else { - return new Error("Not an object: "+data) + return new Error('Not an object: ' + data) } } o = {} @@ -230,33 +238,52 @@ function search (data, fields, version, title) { function printData (data, name, cb) { var versions = Object.keys(data) - , msg = "" - , includeVersions = versions.length > 1 - , includeFields + var msg = '' + var msgJson = [] + var includeVersions = versions.length > 1 + var includeFields versions.forEach(function (v) { var fields = Object.keys(data[v]) includeFields = includeFields || (fields.length > 1) + msgJson.push({}) fields.forEach(function (f) { var d = cleanup(data[v][f]) - if (includeVersions || includeFields || typeof d !== "string") { - d = cleanup(data[v][f]) - d = npm.config.get("json") - ? JSON.stringify(d, null, 2) - : util.inspect(d, false, 5, npm.color) - } else if (typeof d === "string" && npm.config.get("json")) { + if (fields.length === 1 && npm.config.get('json')) { + msgJson[msgJson.length - 1][f] = d + } + if (includeVersions || includeFields || typeof d !== 'string') { + if (npm.config.get('json')) { + msgJson[msgJson.length - 1][f] = d + } else { + d = util.inspect(d, false, 5, npm.color) + } + } else if (typeof d === 'string' && npm.config.get('json')) { d = JSON.stringify(d) } - if (f && includeFields) f += " = " - if (d.indexOf("\n") !== -1) d = " \n" + d - msg += (includeVersions ? name + "@" + v + " " : "") - + (includeFields ? f : "") + d + "\n" + if (!npm.config.get('json')) { + if (f && includeFields) f += ' = ' + if (d.indexOf('\n') !== -1) d = ' \n' + d + msg += (includeVersions ? name + '@' + v + ' ' : '') + + (includeFields ? f : '') + d + '\n' + } }) }) + if (msgJson.length && Object.keys(msgJson[0]).length === 1) { + var k = Object.keys(msgJson[0])[0] + msgJson = msgJson.map(function (m) { return m[k] }) + } + + if (!msg) { + msg = JSON.stringify(msgJson[0], null, 2) + '\n' + } else if (msgJson.length > 1) { + msg = JSON.stringify(msgJson, null, 2) + '\n' + } + // preserve output symmetry by adding a whitespace-only line at the end if // there's one at the beginning - if (/^\s*\n/.test(msg)) msg += "\n" + if (/^\s*\n/.test(msg)) msg += '\n' // print directly to stdout to not unnecessarily add blank lines process.stdout.write(msg) @@ -265,38 +292,34 @@ function printData (data, name, cb) { } function cleanup (data) { if (Array.isArray(data)) { - if (data.length === 1) { - data = data[0] - } else { - return data.map(cleanup) - } + return data.map(cleanup) } - if (!data || typeof data !== "object") return data + if (!data || typeof data !== 'object') return data - if (typeof data.versions === "object" - && data.versions - && !Array.isArray(data.versions)) { + if (typeof data.versions === 'object' && + data.versions && + !Array.isArray(data.versions)) { data.versions = Object.keys(data.versions || {}) } var keys = Object.keys(data) keys.forEach(function (d) { - if (d.charAt(0) === "_") delete data[d] - else if (typeof data[d] === "object") data[d] = cleanup(data[d]) + if (d.charAt(0) === '_') delete data[d] + else if (typeof data[d] === 'object') data[d] = cleanup(data[d]) }) keys = Object.keys(data) - if (keys.length <= 3 - && data.name - && (keys.length === 1 - || keys.length === 3 && data.email && data.url - || keys.length === 2 && (data.email || data.url))) { + if (keys.length <= 3 && + data.name && + (keys.length === 1 || + keys.length === 3 && data.email && data.url || + keys.length === 2 && (data.email || data.url))) { data = unparsePerson(data) } return data } function unparsePerson (d) { - if (typeof d === "string") return d - return d.name - + (d.email ? " <"+d.email+">" : "") - + (d.url ? " ("+d.url+")" : "") + if (typeof d === 'string') return d + return d.name + + (d.email ? ' <' + d.email + '>' : '') + + (d.url ? ' (' + d.url + ')' : '') } diff --git a/deps/npm/lib/visnup.js b/deps/npm/lib/visnup.js index 8d710c20b0dcc8..b0352fd6d049f2 100644 --- a/deps/npm/lib/visnup.js +++ b/deps/npm/lib/visnup.js @@ -1,38 +1,38 @@ module.exports = visnup -var npm = require("./npm.js") +var npm = require('./npm.js') var handsomeFace = [ - [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 237, 236, 236, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 235, 236, 235, 233, 237, 235, 233, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 235, 233, 232, 235, 235, 234, 233, 236, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 0, 0, 0, 0, 237, 235, 232, 232, 234, 233, 233, 232, 232, 233, 232, 232, 235, 232, 233, 234, 234, 0, 0, 0, 0, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 0, 0, 0, 232, 232, 232, 239, 238, 235, 233, 232, 232, 232, 232, 232, 232, 232, 233, 235, 232, 233, 233, 232, 0, 0, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 234, 234, 232, 233, 234, 233, 234, 235, 233, 235, 60, 238, 238, 234, 234, 233, 234, 233, 238, 251, 246, 233, 233, 232, 0, 0, 0, 0, 0, 0] - ,[0, 0, 233, 233, 233, 232, 232, 239, 249, 251, 252, 231, 231, 188, 250, 254, 59, 60, 255, 231, 231, 231, 252, 235, 239, 235, 232, 233, 0, 0, 0, 0, 0, 0] - ,[0, 0, 232, 233, 232, 232, 232, 248, 231, 231, 231, 231, 231, 231, 231, 254, 238, 254, 231, 231, 231, 231, 231, 252, 233, 235, 237, 233, 234, 0, 0, 0, 0, 0] - ,[0, 0, 233, 232, 232, 232, 248, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 251, 233, 233, 233, 236, 233, 0, 0, 0, 0] - ,[232, 233, 233, 232, 232, 246, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 249, 233, 234, 234, 0, 0, 0, 0] - ,[232, 232, 232, 232, 233, 249, 231, 255, 255, 255, 255, 254, 109, 60, 239, 237, 238, 237, 235, 235, 235, 235, 236, 235, 235, 235, 234, 232, 232, 232, 232, 232, 233, 0] - ,[0, 232, 232, 233, 233, 233, 233, 233, 233, 233, 233, 233, 235, 236, 238, 238, 235, 188, 254, 254, 145, 236, 252, 254, 254, 254, 254, 249, 236, 235, 232, 232, 233, 0] - ,[0, 0, 233, 237, 249, 239, 233, 252, 231, 231, 231, 231, 231, 231, 254, 235, 235, 254, 231, 231, 251, 235, 237, 231, 231, 231, 231, 7, 237, 235, 232, 233, 233, 0] - ,[0, 0, 0, 0, 233, 248, 239, 233, 231, 231, 231, 231, 254, 233, 233, 235, 254, 255, 231, 254, 237, 236, 254, 239, 235, 235, 233, 233, 232, 232, 233, 232, 0, 0] - ,[0, 0, 0, 232, 233, 246, 255, 255, 236, 236, 236, 236, 236, 255, 231, 231, 231, 231, 231, 231, 252, 234, 248, 231, 231, 231, 231, 248, 232, 232, 232, 0, 0, 0] - ,[0, 0, 0, 0, 235, 237, 7, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 255, 238, 235, 7, 231, 231, 231, 246, 232, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 0, 235, 103, 188, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 252, 232, 238, 231, 231, 255, 244, 232, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 0, 235, 236, 103, 146, 253, 255, 231, 231, 231, 231, 231, 253, 251, 250, 250, 250, 246, 232, 235, 152, 255, 146, 66, 233, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 0, 0, 233, 103, 146, 146, 146, 146, 254, 231, 231, 231, 109, 103, 146, 255, 188, 239, 240, 103, 255, 253, 103, 238, 234, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 0, 0, 232, 235, 109, 146, 146, 146, 146, 146, 252, 152, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 103, 235, 233, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 0, 0, 0, 235, 235, 103, 146, 146, 146, 146, 146, 146, 188, 188, 188, 188, 188, 188, 152, 146, 146, 146, 66, 235, 0, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 0, 0, 0, 0, 233, 235, 66, 146, 146, 146, 146, 152, 255, 146, 240, 239, 241, 109, 146, 146, 146, 103, 233, 0, 0, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 0, 0, 0, 0, 0, 234, 237, 109, 146, 146, 146, 146, 146, 254, 231, 231, 188, 146, 146, 146, 103, 233, 0, 0, 0, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 233, 237, 60, 103, 146, 146, 146, 146, 146, 103, 66, 60, 235, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 233, 233, 236, 235, 237, 235, 237, 237, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]] - + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 237, 236, 236, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 235, 236, 235, 233, 237, 235, 233, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 235, 233, 232, 235, 235, 234, 233, 236, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 237, 235, 232, 232, 234, 233, 233, 232, 232, 233, 232, 232, 235, 232, 233, 234, 234, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 232, 232, 232, 239, 238, 235, 233, 232, 232, 232, 232, 232, 232, 232, 233, 235, 232, 233, 233, 232, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 234, 234, 232, 233, 234, 233, 234, 235, 233, 235, 60, 238, 238, 234, 234, 233, 234, 233, 238, 251, 246, 233, 233, 232, 0, 0, 0, 0, 0, 0], + [0, 0, 233, 233, 233, 232, 232, 239, 249, 251, 252, 231, 231, 188, 250, 254, 59, 60, 255, 231, 231, 231, 252, 235, 239, 235, 232, 233, 0, 0, 0, 0, 0, 0], + [0, 0, 232, 233, 232, 232, 232, 248, 231, 231, 231, 231, 231, 231, 231, 254, 238, 254, 231, 231, 231, 231, 231, 252, 233, 235, 237, 233, 234, 0, 0, 0, 0, 0], + [0, 0, 233, 232, 232, 232, 248, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 251, 233, 233, 233, 236, 233, 0, 0, 0, 0], + [232, 233, 233, 232, 232, 246, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 249, 233, 234, 234, 0, 0, 0, 0], + [232, 232, 232, 232, 233, 249, 231, 255, 255, 255, 255, 254, 109, 60, 239, 237, 238, 237, 235, 235, 235, 235, 236, 235, 235, 235, 234, 232, 232, 232, 232, 232, 233, 0], + [0, 232, 232, 233, 233, 233, 233, 233, 233, 233, 233, 233, 235, 236, 238, 238, 235, 188, 254, 254, 145, 236, 252, 254, 254, 254, 254, 249, 236, 235, 232, 232, 233, 0], + [0, 0, 233, 237, 249, 239, 233, 252, 231, 231, 231, 231, 231, 231, 254, 235, 235, 254, 231, 231, 251, 235, 237, 231, 231, 231, 231, 7, 237, 235, 232, 233, 233, 0], + [0, 0, 0, 0, 233, 248, 239, 233, 231, 231, 231, 231, 254, 233, 233, 235, 254, 255, 231, 254, 237, 236, 254, 239, 235, 235, 233, 233, 232, 232, 233, 232, 0, 0], + [0, 0, 0, 232, 233, 246, 255, 255, 236, 236, 236, 236, 236, 255, 231, 231, 231, 231, 231, 231, 252, 234, 248, 231, 231, 231, 231, 248, 232, 232, 232, 0, 0, 0], + [0, 0, 0, 0, 235, 237, 7, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 255, 238, 235, 7, 231, 231, 231, 246, 232, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 235, 103, 188, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 252, 232, 238, 231, 231, 255, 244, 232, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 235, 236, 103, 146, 253, 255, 231, 231, 231, 231, 231, 253, 251, 250, 250, 250, 246, 232, 235, 152, 255, 146, 66, 233, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 233, 103, 146, 146, 146, 146, 254, 231, 231, 231, 109, 103, 146, 255, 188, 239, 240, 103, 255, 253, 103, 238, 234, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 232, 235, 109, 146, 146, 146, 146, 146, 252, 152, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 103, 235, 233, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 235, 235, 103, 146, 146, 146, 146, 146, 146, 188, 188, 188, 188, 188, 188, 152, 146, 146, 146, 66, 235, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 233, 235, 66, 146, 146, 146, 146, 152, 255, 146, 240, 239, 241, 109, 146, 146, 146, 103, 233, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 234, 237, 109, 146, 146, 146, 146, 146, 254, 231, 231, 188, 146, 146, 146, 103, 233, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 233, 237, 60, 103, 146, 146, 146, 146, 146, 103, 66, 60, 235, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 233, 233, 236, 235, 237, 235, 237, 237, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] +] function visnup (args, cb) { handsomeFace.forEach(function (line) { console.log(line.map(function (ch) { - return "\033[" + (ch ? "48;5;" + ch : ch) + "m" + return '\u001b[' + (ch ? '48;5;' + ch : ch) + 'm' }).join(' ')) }) diff --git a/deps/npm/lib/whoami.js b/deps/npm/lib/whoami.js index bef0184a0065bd..feb6fab95ae89c 100644 --- a/deps/npm/lib/whoami.js +++ b/deps/npm/lib/whoami.js @@ -1,31 +1,30 @@ -var npm = require("./npm.js") +var npm = require('./npm.js') module.exports = whoami -whoami.usage = "npm whoami\n(just prints username according to given registry)" +whoami.usage = 'npm whoami [--registry ]\n(just prints username according to given registry)' function whoami (args, silent, cb) { // FIXME: need tighter checking on this, but is a breaking change - if (typeof cb !== "function") { + if (typeof cb !== 'function') { cb = silent silent = false } - var registry = npm.config.get("registry") - if (!registry) return cb(new Error("no default registry set")) + var registry = npm.config.get('registry') + if (!registry) return cb(new Error('no default registry set')) var auth = npm.config.getCredentialsByURI(registry) if (auth) { if (auth.username) { if (!silent) console.log(auth.username) return process.nextTick(cb.bind(this, null, auth.username)) - } - else if (auth.token) { - return npm.registry.whoami(registry, { auth : auth }, function (er, username) { + } else if (auth.token) { + return npm.registry.whoami(registry, { auth: auth }, function (er, username) { if (er) return cb(er) if (!username) { var needNewSession = new Error( - "Your auth token is no longer valid. Please log in again." + 'Your auth token is no longer valid. Please log in again.' ) needNewSession.code = 'ENEEDAUTH' return cb(needNewSession) @@ -40,7 +39,7 @@ function whoami (args, silent, cb) { // At this point, if they have a credentials object, it doesn't have a token // or auth in it. Probably just the default registry. var needAuth = new Error( - "this command requires you to be logged in." + 'this command requires you to be logged in.' ) needAuth.code = 'ENEEDAUTH' process.nextTick(cb.bind(this, needAuth)) diff --git a/deps/npm/lib/xmas.js b/deps/npm/lib/xmas.js index fa8d1db556d9a5..25535533e10fbd 100644 --- a/deps/npm/lib/xmas.js +++ b/deps/npm/lib/xmas.js @@ -1,55 +1,59 @@ // happy xmas -var log = require("npmlog") +var log = require('npmlog') module.exports = function (args, cb) { -var s = process.platform === "win32" ? " *" : " \u2605" - , f = "\uFF0F" - , b = "\uFF3C" - , x = process.platform === "win32" ? " " : "" - , o = [ "\u0069" , "\u0020", "\u0020", "\u0020", "\u0020", "\u0020" - , "\u0020", "\u0020", "\u0020", "\u0020", "\u0020", "\u0020" - , "\u0020", "\u2E1B","\u2042","\u2E2E","&","@","\uFF61" ] - , oc = [21,33,34,35,36,37] - , l = "\u005e" + var s = process.platform === 'win32' ? ' *' : ' \u2605' + var f = '\uFF0F' + var b = '\uFF3C' + var x = process.platform === 'win32' ? ' ' : '' + var o = [ + '\u0069', '\u0020', '\u0020', '\u0020', '\u0020', '\u0020', + '\u0020', '\u0020', '\u0020', '\u0020', '\u0020', '\u0020', + '\u0020', '\u2E1B', '\u2042', '\u2E2E', '&', '@', '\uFF61' + ] + var oc = [21, 33, 34, 35, 36, 37] + var l = '\u005e' -function w (s) { process.stderr.write(s) } + function w (s) { process.stderr.write(s) } -w("\n") -;(function T (H) { - for (var i = 0; i < H; i ++) w(" ") - w(x+"\033[33m"+s+"\n") - var M = H * 2 - 1 - for (var L = 1; L <= H; L ++) { - var O = L * 2 - 2 - var S = (M - O) / 2 - for (i = 0; i < S; i ++) w(" ") - w(x+"\033[32m"+f) - for (i = 0; i < O; i ++) w( - "\033["+oc[Math.floor(Math.random()*oc.length)]+"m"+ - o[Math.floor(Math.random() * o.length)] - ) - w(x+"\033[32m"+b+"\n") - } - w(" ") - for (i = 1; i < H; i ++) w("\033[32m"+l) - w("| "+x+" |") - for (i = 1; i < H; i ++) w("\033[32m"+l) - if (H > 10) { - w("\n ") - for (i = 1; i < H; i ++) w(" ") - w("| "+x+" |") - for (i = 1; i < H; i ++) w(" ") - } -})(20) -w("\n\n") -log.heading = '' -log.addLevel('npm', 100000, log.headingStyle) -log.npm("loves you", "Happy Xmas, Noders!") -cb() + w('\n') + ;(function T (H) { + for (var i = 0; i < H; i++) w(' ') + w(x + '\u001b[33m' + s + '\n') + var M = H * 2 - 1 + for (var L = 1; L <= H; L++) { + var O = L * 2 - 2 + var S = (M - O) / 2 + for (i = 0; i < S; i++) w(' ') + w(x + '\u001b[32m' + f) + for (i = 0; i < O; i++) { + w( + '\u001b[' + oc[Math.floor(Math.random() * oc.length)] + 'm' + + o[Math.floor(Math.random() * o.length)] + ) + } + w(x + '\u001b[32m' + b + '\n') + } + w(' ') + for (i = 1; i < H; i++) w('\u001b[32m' + l) + w('| ' + x + ' |') + for (i = 1; i < H; i++) w('\u001b[32m' + l) + if (H > 10) { + w('\n ') + for (i = 1; i < H; i++) w(' ') + w('| ' + x + ' |') + for (i = 1; i < H; i++) w(' ') + } + })(20) + w('\n\n') + log.heading = '' + log.addLevel('npm', 100000, log.headingStyle) + log.npm('loves you', 'Happy Xmas, Noders!') + cb() } -var dg=false -Object.defineProperty(module.exports, "usage", {get:function () { +var dg = false +Object.defineProperty(module.exports, 'usage', {get: function () { if (dg) module.exports([], function () {}) dg = true - return " " + return ' ' }}) diff --git a/deps/npm/man/man1/npm-README.1 b/deps/npm/man/man1/npm-README.1 index 423811f5be80f1..644147b483dccd 100644 --- a/deps/npm/man/man1/npm-README.1 +++ b/deps/npm/man/man1/npm-README.1 @@ -1,4 +1,4 @@ -.TH "NPM" "1" "October 2015" "" "" +.TH "NPM" "1" "April 2016" "" "" .SH "NAME" \fBnpm\fR \- a JavaScript package manager .P @@ -14,6 +14,17 @@ Much more info available via \fBnpm help\fP once it's installed\. .P To install an old \fBand unsupported\fR version of npm that works on node 0\.3 and prior, clone the git repo and dig through the old tags and branches\. +.P +\fBnpm is configured to use npm, Inc\.'s public package registry at +https://registry\.npmjs\.org by default\.\fR +.P +You can configure npm to use any compatible registry you +like, and even run your own registry\. Check out the doc on +registries \fIhttps://docs\.npmjs\.com/misc/registry\fR\|\. +.P +Use of someone else's registry may be governed by terms of use\. The +terms of use for the default public registry are available at +https://www\.npmjs\.com\|\. .SH Super Easy Install .P npm is bundled with node \fIhttp://nodejs\.org/download/\fR\|\. @@ -131,101 +142,14 @@ Uninstalling npm does not remove configuration files by default\. You must remove them yourself manually if you want them gone\. Note that this means that future npm installs will not remember the settings that you have chosen\. -.SH Using npm Programmatically -.P -Although npm can be used programmatically, its API is meant for use by the CLI -\fIonly\fR, and no guarantees are made regarding its fitness for any other purpose\. -If you want to use npm to reliably perform some task, the safest thing to do is -to invoke the desired \fBnpm\fP command with appropriate arguments\. -.P -The semantic version of npm refers to the CLI itself, rather than the -underlying API\. \fIThe internal API is not guaranteed to remain stable even when -npm's version indicates no breaking changes have been made according to -semver\.\fR -.P -If you \fIstill\fR would like to use npm programmatically, it's \fIpossible\fR\|\. The API -isn't very well documented, but it \fIis\fR rather simple\. -.P -Eventually, npm will be just a thin CLI wrapper around the modules that it -depends on, but for now, there are some things that only the CLI can do\. You -should try using one of npm's dependencies first, and only use the API if what -you're trying to do is only supported by npm itself\. -.P -.RS 2 -.nf -var npm = require("npm") -npm\.load(myConfigObject, function (er) { - if (er) return handlError(er) - npm\.commands\.install(["some", "args"], function (er, data) { - if (er) return commandFailed(er) - // command succeeded, and data might have some info - }) - npm\.registry\.log\.on("log", function (message) { \.\.\.\. }) -}) -.fi -.RE -.P -The \fBload\fP function takes an object hash of the command\-line configs\. -The various \fBnpm\.commands\.\fP functions take an \fBarray\fR of -positional argument \fBstrings\fR\|\. The last argument to any -\fBnpm\.commands\.\fP function is a callback\. Some commands take other -optional arguments\. Read the source\. -.P -You cannot set configs individually for any single npm function at this -time\. Since \fBnpm\fP is a singleton, any call to \fBnpm\.config\.set\fP will -change the value for \fIall\fR npm commands in that process\. -.P -See \fB\|\./bin/npm\-cli\.js\fP for an example of pulling config values off of the -command line arguments using nopt\. You may also want to check out \fBnpm -help config\fP to learn about all the options you can set there\. .SH More Docs .P Check out the docs \fIhttps://docs\.npmjs\.com/\fR, -especially the faq \fIhttps://docs\.npmjs\.com/misc/faq\fR\|\. .P You can use the \fBnpm help\fP command to read any of them\. .P If you're a developer, and you want to use npm to publish your program, you should read this \fIhttps://docs\.npmjs\.com/misc/developers\fR -.SH Legal Stuff -.P -"npm" and "The npm Registry" are owned by npm, Inc\. -All rights reserved\. See the included LICENSE file for more details\. -.P -"Node\.js" and "node" are trademarks owned by Joyent, Inc\. -.P -Modules published on the npm registry are not officially endorsed by -npm, Inc\. or the Node\.js project\. -.P -Data published to the npm registry is not part of npm itself, and is -the sole property of the publisher\. While every effort is made to -ensure accountability, there is absolutely no guarantee, warranty, or -assertion expressed or implied as to the quality, fitness for a -specific purpose, or lack of malice in any given npm package\. -.P -If you have a complaint about a package in the public npm registry, -and cannot resolve it with the package -owner \fIhttps://docs\.npmjs\.com/misc/disputes\fR, please email -support@npmjs\.com and explain the situation\. -.P -Any data published to The npm Registry (including user account -information) may be removed or modified at the sole discretion of the -npm server administrators\. -.SS In plainer english -.P -npm is the property of npm, Inc\. -.P -If you publish something, it's yours, and you are solely accountable -for it\. -.P -If other people publish something, it's theirs\. -.P -Users can publish Bad Stuff\. It will be removed promptly if reported\. -But there is no vetting process for published modules, and you use -them at your own risk\. Please inspect the source\. -.P -If you publish Bad Stuff, we may delete it from the registry, or even -ban your account in extreme cases\. So don't do that\. .SH BUGS .P When you find issues, please report them: @@ -246,8 +170,6 @@ will no doubt tell you to put the output in a gist or email\. .IP \(bu 2 npm help npm .IP \(bu 2 -npm help 7 faq -.IP \(bu 2 npm help help .IP \(bu 2 npm help 7 index diff --git a/deps/npm/man/man1/npm-access.1 b/deps/npm/man/man1/npm-access.1 index 925f3a13998520..1346590429cfea 100644 --- a/deps/npm/man/man1/npm-access.1 +++ b/deps/npm/man/man1/npm-access.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ACCESS" "1" "October 2015" "" "" +.TH "NPM\-ACCESS" "1" "April 2016" "" "" .SH "NAME" \fBnpm-access\fR \- Set access level on published packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-adduser.1 b/deps/npm/man/man1/npm-adduser.1 index bea5f3722cffa9..cc034a4f0c4026 100644 --- a/deps/npm/man/man1/npm-adduser.1 +++ b/deps/npm/man/man1/npm-adduser.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ADDUSER" "1" "October 2015" "" "" +.TH "NPM\-ADDUSER" "1" "April 2016" "" "" .SH "NAME" \fBnpm-adduser\fR \- Add a registry user account .SH SYNOPSIS @@ -6,6 +6,8 @@ .RS 2 .nf npm adduser [\-\-registry=url] [\-\-scope=@orgname] [\-\-always\-auth] + +aliases: login, add\-user .fi .RE .SH DESCRIPTION @@ -29,7 +31,7 @@ your existing record\. .SH CONFIGURATION .SS registry .P -Default: http://registry\.npmjs\.org/ +Default: https://registry\.npmjs\.org/ .P The base URL of the npm package registry\. If \fBscope\fP is also specified, this registry will only be used for packages with that scope\. See npm help 7 \fBnpm\-scope\fP\|\. @@ -64,9 +66,11 @@ npm adduser \-\-registry=http://private\-registry\.example\.com \-\-always\-auth .RE .P This will ensure that all requests to that registry (including for tarballs) -include an authorization header\. See \fBalways\-auth\fP in npm help 7 \fBnpm\-config\fP for more -details on always\-auth\. Registry\-specific configuration of \fBalways\-auth\fP takes -precedence over any global configuration\. +include an authorization header\. This setting may be necessary for use with +private registries where metadata and package tarballs are stored on hosts with +different hostnames\. See \fBalways\-auth\fP in npm help 7 \fBnpm\-config\fP for more details on +always\-auth\. Registry\-specific configuration of \fBalways\-auth\fP takes precedence +over any global configuration\. .SH SEE ALSO .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-bin.1 b/deps/npm/man/man1/npm-bin.1 index 4f28530086d1c9..7d1c758fcf156b 100644 --- a/deps/npm/man/man1/npm-bin.1 +++ b/deps/npm/man/man1/npm-bin.1 @@ -1,11 +1,11 @@ -.TH "NPM\-BIN" "1" "October 2015" "" "" +.TH "NPM\-BIN" "1" "April 2016" "" "" .SH "NAME" \fBnpm-bin\fR \- Display npm bin folder .SH SYNOPSIS .P .RS 2 .nf -npm bin +npm bin [\-g|\-\-global] .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-bugs.1 b/deps/npm/man/man1/npm-bugs.1 index 513355ae976c8d..b7a0d8329c0156 100644 --- a/deps/npm/man/man1/npm-bugs.1 +++ b/deps/npm/man/man1/npm-bugs.1 @@ -1,12 +1,13 @@ -.TH "NPM\-BUGS" "1" "October 2015" "" "" +.TH "NPM\-BUGS" "1" "April 2016" "" "" .SH "NAME" \fBnpm-bugs\fR \- Bugs for a package in a web browser maybe .SH SYNOPSIS .P .RS 2 .nf -npm bugs -npm bugs (with no args in a package dir) +npm bugs [] + +aliases: issues .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-build.1 b/deps/npm/man/man1/npm-build.1 index 8e20ab1770b086..ede3c890ec717d 100644 --- a/deps/npm/man/man1/npm-build.1 +++ b/deps/npm/man/man1/npm-build.1 @@ -1,11 +1,11 @@ -.TH "NPM\-BUILD" "1" "October 2015" "" "" +.TH "NPM\-BUILD" "1" "April 2016" "" "" .SH "NAME" \fBnpm-build\fR \- Build a package .SH SYNOPSIS .P .RS 2 .nf -npm build +npm build [] .fi .RE .RS 0 diff --git a/deps/npm/man/man1/npm-bundle.1 b/deps/npm/man/man1/npm-bundle.1 index 0e6d0817bfda95..aa1540bdc95279 100644 --- a/deps/npm/man/man1/npm-bundle.1 +++ b/deps/npm/man/man1/npm-bundle.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BUNDLE" "1" "October 2015" "" "" +.TH "NPM\-BUNDLE" "1" "April 2016" "" "" .SH "NAME" \fBnpm-bundle\fR \- REMOVED .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-cache.1 b/deps/npm/man/man1/npm-cache.1 index ff3e7c8058b95d..dd9f6176743341 100644 --- a/deps/npm/man/man1/npm-cache.1 +++ b/deps/npm/man/man1/npm-cache.1 @@ -1,4 +1,4 @@ -.TH "NPM\-CACHE" "1" "October 2015" "" "" +.TH "NPM\-CACHE" "1" "April 2016" "" "" .SH "NAME" \fBnpm-cache\fR \- Manipulates packages cache .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-completion.1 b/deps/npm/man/man1/npm-completion.1 index ce7235fbd71c65..7cdb4643c91b39 100644 --- a/deps/npm/man/man1/npm-completion.1 +++ b/deps/npm/man/man1/npm-completion.1 @@ -1,11 +1,11 @@ -.TH "NPM\-COMPLETION" "1" "October 2015" "" "" +.TH "NPM\-COMPLETION" "1" "April 2016" "" "" .SH "NAME" \fBnpm-completion\fR \- Tab Completion for npm .SH SYNOPSIS .P .RS 2 .nf -\|\. <(npm completion) +source <(npm completion) .fi .RE .SH DESCRIPTION @@ -15,7 +15,14 @@ Enables tab\-completion in all npm commands\. The synopsis above loads the completions into your current shell\. Adding it to your ~/\.bashrc or ~/\.zshrc will make the completions available -everywhere\. +everywhere: +.P +.RS 2 +.nf +npm completion >> ~/\.bashrc +npm completion >> ~/\.zshrc +.fi +.RE .P You may of course also pipe the output of npm completion to a file such as \fB/usr/local/etc/bash_completion\.d/npm\fP if you have a system @@ -29,8 +36,6 @@ completions based on the arguments\. .IP \(bu 2 npm help 7 developers .IP \(bu 2 -npm help 7 faq -.IP \(bu 2 npm help npm .RE diff --git a/deps/npm/man/man1/npm-config.1 b/deps/npm/man/man1/npm-config.1 index 47a5bd197ebad3..7ab468e1844b51 100644 --- a/deps/npm/man/man1/npm-config.1 +++ b/deps/npm/man/man1/npm-config.1 @@ -1,18 +1,19 @@ -.TH "NPM\-CONFIG" "1" "October 2015" "" "" +.TH "NPM\-CONFIG" "1" "April 2016" "" "" .SH "NAME" \fBnpm-config\fR \- Manage the npm configuration files .SH SYNOPSIS .P .RS 2 .nf -npm config set [\-\-global] +npm config set [\-g|\-\-global] npm config get npm config delete npm config list npm config edit -npm c [set|get|delete|list] npm get -npm set [\-\-global] +npm set [\-g|\-\-global] + +aliases: c .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-dedupe.1 b/deps/npm/man/man1/npm-dedupe.1 index 9d73fcb177e764..45f829f98d21d0 100644 --- a/deps/npm/man/man1/npm-dedupe.1 +++ b/deps/npm/man/man1/npm-dedupe.1 @@ -1,12 +1,14 @@ -.TH "NPM\-DEDUPE" "1" "October 2015" "" "" +.TH "NPM\-DEDUPE" "1" "April 2016" "" "" .SH "NAME" \fBnpm-dedupe\fR \- Reduce duplication .SH SYNOPSIS .P .RS 2 .nf -npm dedupe [package names\.\.\.] -npm ddp [package names\.\.\.] +npm dedupe +npm ddp + +aliases: find\-dupes, ddp .fi .RE .SH DESCRIPTION @@ -42,25 +44,20 @@ Because of the hierarchical nature of node's module lookup, b and d will both get their dependency met by the single c package at the root level of the tree\. .P +The deduplication algorithm walks the tree, moving each dependency as far +up in the tree as possible, even if duplicates are not found\. This will +result in both a flat and deduplicated tree\. +.P If a suitable version exists at the target location in the tree already, then it will be left untouched, but the other duplicates will be deleted\. .P -If no suitable version can be found, then a warning is printed, and -nothing is done\. -.P -If any arguments are supplied, then they are filters, and only the -named packages will be touched\. -.P -Note that this operation transforms the dependency tree, and may -result in packages getting updated versions, perhaps from the npm -registry\. +Arguments are ignored\. Dedupe always acts on the entire tree\. .P -This feature is experimental, and may change in future versions\. +Modules .P -The \fB\-\-tag\fP argument will apply to all of the affected dependencies\. If a -tag with the given name exists, the tagged version is preferred over newer -versions\. +Note that this operation transforms the dependency tree, but will never +result in new modules being installed\. .SH SEE ALSO .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-deprecate.1 b/deps/npm/man/man1/npm-deprecate.1 index 1c41959dacdb9b..c7fd28ada8a392 100644 --- a/deps/npm/man/man1/npm-deprecate.1 +++ b/deps/npm/man/man1/npm-deprecate.1 @@ -1,11 +1,11 @@ -.TH "NPM\-DEPRECATE" "1" "October 2015" "" "" +.TH "NPM\-DEPRECATE" "1" "April 2016" "" "" .SH "NAME" \fBnpm-deprecate\fR \- Deprecate a version of a package .SH SYNOPSIS .P .RS 2 .nf -npm deprecate [@] +npm deprecate [@] .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-dist-tag.1 b/deps/npm/man/man1/npm-dist-tag.1 index 9d7742d8108432..a92340fe760066 100644 --- a/deps/npm/man/man1/npm-dist-tag.1 +++ b/deps/npm/man/man1/npm-dist-tag.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DIST\-TAG" "1" "October 2015" "" "" +.TH "NPM\-DIST\-TAG" "1" "April 2016" "" "" .SH "NAME" \fBnpm-dist-tag\fR \- Modify package distribution tags .SH SYNOPSIS @@ -8,6 +8,8 @@ npm dist\-tag add @ [] npm dist\-tag rm npm dist\-tag ls [] + +aliases: dist\-tags .fi .RE .SH DESCRIPTION @@ -47,16 +49,29 @@ npm install \-\-tag .P This also applies to \fBnpm dedupe\fP\|\. .P -Publishing a package sets the "latest" tag to the published version unless the +Publishing a package sets the \fBlatest\fP tag to the published version unless the \fB\-\-tag\fP option is used\. For example, \fBnpm publish \-\-tag=beta\fP\|\. +.P +By default, \fBnpm install \fP (without any \fB@\fP or \fB@\fP +specifier) installs the \fBlatest\fP tag\. .SH PURPOSE .P -Tags can be used to provide an alias instead of version numbers\. For -example, \fBnpm\fP currently uses the tag "next" to identify the upcoming -version, and the tag "latest" to identify the current version\. +Tags can be used to provide an alias instead of version numbers\. +.P +For example, a project might choose to have multiple streams of development +and use a different tag for each stream, +e\.g\., \fBstable\fP, \fBbeta\fP, \fBdev\fP, \fBcanary\fP\|\. .P -A project might choose to have multiple streams of development, e\.g\., -"stable", "canary"\. +By default, the \fBlatest\fP tag is used by npm to identify the current version of +a package, and \fBnpm install \fP (without any \fB@\fP or \fB@\fP +specifier) installs the \fBlatest\fP tag\. Typically, projects only use the \fBlatest\fP +tag for stable release versions, and use other tags for unstable versions such +as prereleases\. +.P +The \fBnext\fP tag is used by some projects to identify the upcoming version\. +.P +By default, other than \fBlatest\fP, no tag has any special significance to npm +itself\. .SH CAVEATS .P This command used to be known as \fBnpm tag\fP, which only created new tags, and so @@ -88,8 +103,6 @@ npm help config .IP \(bu 2 npm help 7 config .IP \(bu 2 -npm apihelp tag -.IP \(bu 2 npm help 5 npmrc .RE diff --git a/deps/npm/man/man1/npm-docs.1 b/deps/npm/man/man1/npm-docs.1 index 328ad817fdf33e..245d07ab331ae8 100644 --- a/deps/npm/man/man1/npm-docs.1 +++ b/deps/npm/man/man1/npm-docs.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DOCS" "1" "October 2015" "" "" +.TH "NPM\-DOCS" "1" "April 2016" "" "" .SH "NAME" \fBnpm-docs\fR \- Docs for a package in a web browser maybe .SH SYNOPSIS @@ -6,9 +6,9 @@ .RS 2 .nf npm docs [ [ \.\.\.]] -npm docs (with no args in a package dir) +npm docs \. npm home [ [ \.\.\.]] -npm home (with no args in a package dir) +npm home \. .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-edit.1 b/deps/npm/man/man1/npm-edit.1 index c3cba10dcc9943..743425af86d020 100644 --- a/deps/npm/man/man1/npm-edit.1 +++ b/deps/npm/man/man1/npm-edit.1 @@ -1,11 +1,11 @@ -.TH "NPM\-EDIT" "1" "October 2015" "" "" +.TH "NPM\-EDIT" "1" "April 2016" "" "" .SH "NAME" \fBnpm-edit\fR \- Edit an installed package .SH SYNOPSIS .P .RS 2 .nf -npm edit [@] +npm edit [@] .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-explore.1 b/deps/npm/man/man1/npm-explore.1 index b588f8d2f2726b..e9c937d299a291 100644 --- a/deps/npm/man/man1/npm-explore.1 +++ b/deps/npm/man/man1/npm-explore.1 @@ -1,11 +1,11 @@ -.TH "NPM\-EXPLORE" "1" "October 2015" "" "" +.TH "NPM\-EXPLORE" "1" "April 2016" "" "" .SH "NAME" \fBnpm-explore\fR \- Browse an installed package .SH SYNOPSIS .P .RS 2 .nf -npm explore [ \-\- ] +npm explore [ \-\- ] .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-help-search.1 b/deps/npm/man/man1/npm-help-search.1 index 1fa13cc301775f..f2927e071a245d 100644 --- a/deps/npm/man/man1/npm-help-search.1 +++ b/deps/npm/man/man1/npm-help-search.1 @@ -1,11 +1,11 @@ -.TH "NPM\-HELP\-SEARCH" "1" "October 2015" "" "" +.TH "NPM\-HELP\-SEARCH" "1" "April 2016" "" "" .SH "NAME" \fBnpm-help-search\fR \- Search npm help documentation .SH SYNOPSIS .P .RS 2 .nf -npm help\-search some search terms +npm help\-search .fi .RE .SH DESCRIPTION @@ -24,7 +24,7 @@ command directly\. .IP \(bu 2 Type: Boolean .IP \(bu 2 -Default false +Default: false .RE .P @@ -37,8 +37,6 @@ If false, then help\-search will just list out the help topics found\. .IP \(bu 2 npm help npm .IP \(bu 2 -npm help 7 faq -.IP \(bu 2 npm help help .RE diff --git a/deps/npm/man/man1/npm-help.1 b/deps/npm/man/man1/npm-help.1 index 5083a5866f9f9a..bb5230c05d897c 100644 --- a/deps/npm/man/man1/npm-help.1 +++ b/deps/npm/man/man1/npm-help.1 @@ -1,12 +1,11 @@ -.TH "NPM\-HELP" "1" "October 2015" "" "" +.TH "NPM\-HELP" "1" "April 2016" "" "" .SH "NAME" \fBnpm-help\fR \- Get help on npm .SH SYNOPSIS .P .RS 2 .nf -npm help -npm help some search terms +npm help [] .fi .RE .SH DESCRIPTION @@ -37,8 +36,6 @@ npm help npm .IP \(bu 2 README .IP \(bu 2 -npm help 7 faq -.IP \(bu 2 npm help 5 folders .IP \(bu 2 npm help config diff --git a/deps/npm/man/man1/npm-init.1 b/deps/npm/man/man1/npm-init.1 index 56da738cb8d521..20d3c87fc2dcfc 100644 --- a/deps/npm/man/man1/npm-init.1 +++ b/deps/npm/man/man1/npm-init.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INIT" "1" "October 2015" "" "" +.TH "NPM\-INIT" "1" "April 2016" "" "" .SH "NAME" \fBnpm-init\fR \- Interactively create a package\.json file .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-install-test.1 b/deps/npm/man/man1/npm-install-test.1 new file mode 100644 index 00000000000000..45462e78ea1ab3 --- /dev/null +++ b/deps/npm/man/man1/npm-install-test.1 @@ -0,0 +1,32 @@ +.TH "NPM" "" "April 2016" "" "" +.SH "NAME" +\fBnpm\fR +.SH SYNOPSIS +.P +.RS 2 +.nf +npm install\-test (with no args, in package dir) +npm install\-test [<@scope>/] +npm install\-test [<@scope>/]@ +npm install\-test [<@scope>/]@ +npm install\-test [<@scope>/]@ +npm install\-test +npm install\-test +npm install\-test + +alias: npm it +common options: [\-\-save|\-\-save\-dev|\-\-save\-optional] [\-\-save\-exact] [\-\-dry\-run] +.fi +.RE +.SH DESCRIPTION +.P +This command runs an \fBnpm install\fP followed immediately by an \fBnpm test\fP\|\. It +takes exactly the same arguments as \fBnpm install\fP\|\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help install +.IP \(bu 2 +npm help test + +.RE diff --git a/deps/npm/man/man1/npm-install.1 b/deps/npm/man/man1/npm-install.1 index c135dfb4a392f1..11de983b7a72ad 100644 --- a/deps/npm/man/man1/npm-install.1 +++ b/deps/npm/man/man1/npm-install.1 @@ -1,19 +1,21 @@ -.TH "NPM\-INSTALL" "1" "October 2015" "" "" +.TH "NPM\-INSTALL" "1" "April 2016" "" "" .SH "NAME" \fBnpm-install\fR \- Install a package .SH SYNOPSIS .P .RS 2 .nf -npm install (with no args in a package dir) +npm install (with no args, in package dir) +npm install [<@scope>/] +npm install [<@scope>/]@ +npm install [<@scope>/]@ +npm install [<@scope>/]@ npm install npm install npm install -npm install [@/] [\-\-save|\-\-save\-dev|\-\-save\-optional] [\-\-save\-exact] -npm install [@/]@ -npm install [@/]@ -npm install [@/]@ -npm i (with any of the previous argument usage) + +alias: npm i +common options: [\-S|\-\-save|\-D|\-\-save\-dev|\-O|\-\-save\-optional] [\-E|\-\-save\-exact] [\-B|\-\-save\-bundle] [\-\-dry\-run] .fi .RE .SH DESCRIPTION @@ -25,7 +27,7 @@ by that\. See npm help shrinkwrap\. A \fBpackage\fP is: .RS 0 .IP \(bu 2 -a) a folder containing a program described by a package\.json file +a) a folder containing a program described by a npm help 5 \fBpackage\.json\fP file .IP \(bu 2 b) a gzipped tarball containing (a) .IP \(bu 2 @@ -33,11 +35,11 @@ c) a url that resolves to (b) .IP \(bu 2 d) a \fB@\fP that is published on the registry (see npm help 7 \fBnpm\-registry\fP) with (c) .IP \(bu 2 -e) a \fB@\fP that points to (d) +e) a \fB@\fP (see npm help \fBnpm\-dist\-tag\fP) that points to (d) .IP \(bu 2 f) a \fB\fP that has a "latest" tag satisfying (e) .IP \(bu 2 -g) a \fB\fP that resolves to (b) +g) a \fB\fP that resolves to (a) .RE .P @@ -52,7 +54,8 @@ after packing it up into a tarball (b)\. In global mode (ie, with \fB\-g\fP or \fB\-\-global\fP appended to the command), it installs the current package context (ie, the current working directory) as a global package\. - By default, \fBnpm install\fP will install all modules listed as dependencies\. + By default, \fBnpm install\fP will install all modules listed as dependencies + in npm help 5 \fBpackage\.json\fP\|\. With the \fB\-\-production\fP flag (or when the \fBNODE_ENV\fP environment variable is set to \fBproduction\fP), npm will not install modules listed in \fBdevDependencies\fP\|\. @@ -83,9 +86,9 @@ after packing it up into a tarball (b)\. .fi .RE .IP \(bu 2 -\fBnpm install [@/] [\-\-save|\-\-save\-dev|\-\-save\-optional]\fP: +\fBnpm install [<@scope>/] [\-S|\-\-save|\-D|\-\-save\-dev|\-O|\-\-save\-optional]\fP: Do a \fB@\fP install, where \fB\fP is the "tag" config\. (See - npm help 7 \fBnpm\-config\fP\|\.) + npm help 7 \fBnpm\-config\fP\|\. The config's default value is \fBlatest\fP\|\.) In most cases, this will install the latest version of the module published on npm\. Example: @@ -99,17 +102,21 @@ after packing it up into a tarball (b)\. the package version in your main package\.json: .RS 0 .IP \(bu 2 -\fB\-\-save\fP: Package will appear in your \fBdependencies\fP\|\. +\fB\-S, \-\-save\fP: Package will appear in your \fBdependencies\fP\|\. .IP \(bu 2 -\fB\-\-save\-dev\fP: Package will appear in your \fBdevDependencies\fP\|\. +\fB\-D, \-\-save\-dev\fP: Package will appear in your \fBdevDependencies\fP\|\. .IP \(bu 2 -\fB\-\-save\-optional\fP: Package will appear in your \fBoptionalDependencies\fP\|\. +\fB\-O, \-\-save\-optional\fP: Package will appear in your \fBoptionalDependencies\fP\|\. When using any of the above options to save dependencies to your -package\.json, there is an additional, optional flag: +package\.json, there are two additional, optional flags: .IP \(bu 2 -\fB\-\-save\-exact\fP: Saved dependencies will be configured with an +\fB\-E, \-\-save\-exact\fP: Saved dependencies will be configured with an exact version rather than using npm's default semver range operator\. +.IP \(bu 2 +\fB\-B, \-\-save\-bundle\fP: Saved dependencies will also be added to your \fBbundleDependencies\fP list\. +Further, if you have an \fBnpm\-shrinkwrap\.json\fP then it will be updated as +well\. \fB\fP is optional\. The package will be downloaded from the registry associated with the specified scope\. If no registry is associated with the given scope the default registry is assumed\. See npm help 7 \fBnpm\-scope\fP\|\. @@ -126,6 +133,7 @@ npm install @myorg/privatepackage npm install node\-tap \-\-save\-dev npm install dtrace\-provider \-\-save\-optional npm install readable\-stream \-\-save \-\-save\-exact +npm install ansi\-regex \-\-save \-\-save\-bundle .fi .RE @@ -142,7 +150,7 @@ fetch the package by name if it is not valid\. .RE .RS 0 .IP \(bu 2 -\fBnpm install [@/]@\fP: +\fBnpm install [<@scope>/]@\fP: Install the version of the package that is referenced by the specified tag\. If the tag does not exist in the registry data for that package, then this will fail\. @@ -155,7 +163,7 @@ fetch the package by name if it is not valid\. .fi .RE .IP \(bu 2 -\fBnpm install [@/]@\fP: +\fBnpm install [<@scope>/]@\fP: Install the specified version of the package\. This will fail if the version has not been published to the registry\. Example: @@ -167,7 +175,7 @@ fetch the package by name if it is not valid\. .fi .RE .IP \(bu 2 -\fBnpm install [@/]@\fP: +\fBnpm install [<@scope>/]@\fP: Install a version of the package matching the specified version range\. This will follow the same rules for resolving dependencies described in npm help 5 \fBpackage\.json\fP\|\. Note that most version ranges must be put in quotes so that your shell will @@ -182,17 +190,19 @@ fetch the package by name if it is not valid\. .RE .IP \(bu 2 \fBnpm install \fP: - Install a package by cloning a git remote url\. The format of the git - url is: + Installs the package from the hosted git provider, cloning it with + \fBgit\fP\|\. First it tries via the https (git with github) and if that fails, via ssh\. .P .RS 2 .nf - ://[[:]@][:][:/][#] + ://[[:]@][:][:][/][#] .fi .RE - \fB\fP is one of \fBgit\fP, \fBgit+ssh\fP, \fBgit+http\fP, or - \fBgit+https\fP\|\. If no \fB\fP is specified, then \fBmaster\fP is - used\. + \fB\fP is one of \fBgit\fP, \fBgit+ssh\fP, \fBgit+http\fP, \fBgit+https\fP, + or \fBgit+file\fP\|\. + If no \fB\fP is specified, then \fBmaster\fP is used\. + If the repository makes use of submodules, those submodules will + be cloned as well\. The following git environment variables are recognized by npm and will be added to the environment when running git: .RS 0 @@ -240,7 +250,7 @@ GIT_SSH_COMMAND='ssh \-i ~/\.ssh/custom_ident' npm install git+ssh://git@github\ \fBnpm install gist:[/][#]\fP: Install the package at \fBhttps://gist\.github\.com/gistID\fP by attempting to clone it using \fBgit\fP\|\. The GitHub username associated with the gist is - optional and will not be saved in \fBpackage\.json\fP if \fB\-\-save\fP is used\. + optional and will not be saved in \fBpackage\.json\fP if \fB\-S\fP or \fB\-\-save\fP is used\. If you don't specify a \fIcommit\-ish\fR then \fBmaster\fP will be used\. Example: .P @@ -289,7 +299,10 @@ The \fB\-\-tag\fP argument will apply to all of the specified install targets\. tag with the given name exists, the tagged version is preferred over newer versions\. .P -The \fB\-\-force\fP argument will force npm to fetch remote resources even if a +The \fB\-\-dry\-run\fP argument will report in the usual way what the install would +have done without actually installing anything\. +.P +The \fB\-f\fP or \fB\-\-force\fP argument will force npm to fetch remote resources even if a local copy exists on disk\. .P .RS 2 @@ -298,9 +311,22 @@ npm install sax \-\-force .fi .RE .P -The \fB\-\-global\fP argument will cause npm to install the package globally +The \fB\-g\fP or \fB\-\-global\fP argument will cause npm to install the package globally rather than locally\. See npm help 5 \fBnpm\-folders\fP\|\. .P +The \fB\-\-global\-style\fP argument will cause npm to install the package into +your local \fBnode_modules\fP folder with the same layout it uses with the +global \fBnode_modules\fP folder\. Only your direct dependencies will show in +\fBnode_modules\fP and everything they depend on will be flattened in their +\fBnode_modules\fP folders\. This obviously will eliminate some deduping\. +.P +The \fB\-\-ignore\-scripts\fP argument will cause npm to not execute any +scripts defined in the package\.json\. See npm help 7 \fBnpm\-scripts\fP\|\. +.P +The \fB\-\-legacy\-bundling\fP argument will cause npm to install the package such +that versions of npm prior to 1\.4, such as the one included with node 0\.8, +can install the package\. This eliminates all automatic deduping\. +.P The \fB\-\-link\fP argument will cause npm to link global installs into the local space in some cases\. .P @@ -316,6 +342,9 @@ shrinkwrap file and use the package\.json instead\. The \fB\-\-nodedir=/path/to/node/source\fP argument will allow npm to find the node source code so that npm can compile native modules\. .P +The \fB\-\-only={prod[uction]|dev[elopment]}\fP argument will cause either only +\fBdevDependencies\fP or only non\-\fBdevDependencies\fP to be installed regardless of the \fBNODE_ENV\fP\|\. +.P See npm help 7 \fBnpm\-config\fP\|\. Many of the configuration params have some effect on installation, since that's most of what npm does\. .SH ALGORITHM @@ -324,15 +353,16 @@ To install a package, npm uses the following algorithm: .P .RS 2 .nf -install(where, what, family, ancestors) -fetch what, unpack to /node_modules/ -for each dep in what\.dependencies - resolve dep to precise version -for each dep@version in what\.dependencies - not in /node_modules//node_modules/* - and not in - add precise version deps to - install(/node_modules/, dep, family) +load the existing node_modules tree from disk +clone the tree +fetch the package\.json and assorted metadata and add it to the clone +walk the clone and add any missing dependencies + dependencies will be added as close to the top as is possible + without breaking any other modules +compare the original tree with the cloned tree and make a list of +actions to take to convert one to the other +execute all of the actions, deepest first + kinds of actions are install, update, remove and move .fi .RE .P @@ -343,13 +373,29 @@ this algorithm produces: .nf A +\-\- B -`\-\- C - `\-\- D ++\-\- C ++\-\- D .fi .RE .P That is, the dependency from B to C is satisfied by the fact that A -already caused C to be installed at a higher level\. +already caused C to be installed at a higher level\. D is still installed +at the top level because nothing conflicts with it\. +.P +For \fBA{B,C}, B{C,D@1}, C{D@2}\fP, this algorithm produces: +.P +.RS 2 +.nf +A ++\-\- B ++\-\- C + `\-\- D@2 ++\-\- D@1 +.fi +.RE +.P +Because B's D@1 will be installed in the top level, C now has to install D@2 +privately for itself\. .P See npm help 5 folders for a more detailed description of the specific folder structures that npm creates\. @@ -402,9 +448,11 @@ npm help 7 registry .IP \(bu 2 npm help tag .IP \(bu 2 -npm help rm +npm help uninstall .IP \(bu 2 npm help shrinkwrap +.IP \(bu 2 +npm help 5 package\.json .RE diff --git a/deps/npm/man/man1/npm-link.1 b/deps/npm/man/man1/npm-link.1 index 7fee404349015f..d99fcf1d08ddb7 100644 --- a/deps/npm/man/man1/npm-link.1 +++ b/deps/npm/man/man1/npm-link.1 @@ -1,25 +1,27 @@ -.TH "NPM\-LINK" "1" "October 2015" "" "" +.TH "NPM\-LINK" "1" "April 2016" "" "" .SH "NAME" \fBnpm-link\fR \- Symlink a package folder .SH SYNOPSIS .P .RS 2 .nf -npm link (in package folder) -npm link [@/] -npm ln (with any of the previous argument usage) +npm link (in package dir) +npm link [<@scope>/][@] + +alias: npm ln .fi .RE .SH DESCRIPTION .P Package linking is a two\-step process\. .P -First, \fBnpm link\fP in a package folder will create a globally\-installed -symbolic link from \fBprefix/package\-name\fP to the current folder (see -npm help 7 \fBnpm\-config\fP for the value of \fBprefix\fP)\. +First, \fBnpm link\fP in a package folder will create a symlink in the global folder +\fB{prefix}/lib/node_modules/\fP that links to the package where the \fBnpm +link\fP command was executed\. (see npm help 7 \fBnpm\-config\fP for the value of \fBprefix\fP)\. .P Next, in some other location, \fBnpm link package\-name\fP will create a -symlink from the local \fBnode_modules\fP folder to the global symlink\. +symbolic link from globally\-installed \fBpackage\-name\fP to \fBnode_modules/\fP +of the current folder\. .P Note that \fBpackage\-name\fP is taken from \fBpackage\.json\fP, not from directory name\. @@ -46,7 +48,7 @@ npm link redis # link\-install the package .P Now, any changes to ~/projects/node\-redis will be reflected in ~/projects/node\-bloggy/node_modules/node\-redis/\. Note that the link should -be to the package name, not the directory name for that package\. +be to the package name, not the directory name for that package\. .P You may also shortcut the two steps in one\. For example, to do the above use\-case in a shorter way: @@ -83,8 +85,6 @@ npm link @myorg/privatepackage .IP \(bu 2 npm help 7 developers .IP \(bu 2 -npm help 7 faq -.IP \(bu 2 npm help 5 package\.json .IP \(bu 2 npm help install diff --git a/deps/npm/man/man1/npm-logout.1 b/deps/npm/man/man1/npm-logout.1 index d7ea3cd978ff04..4cb1d2c6329cbc 100644 --- a/deps/npm/man/man1/npm-logout.1 +++ b/deps/npm/man/man1/npm-logout.1 @@ -1,11 +1,11 @@ -.TH "NPM\-LOGOUT" "1" "October 2015" "" "" +.TH "NPM\-LOGOUT" "1" "April 2016" "" "" .SH "NAME" \fBnpm-logout\fR \- Log out of the registry .SH SYNOPSIS .P .RS 2 .nf -npm logout [\-\-registry=url] [\-\-scope=@orgname] +npm logout [\-\-registry=] [\-\-scope=<@scope>] .fi .RE .SH DESCRIPTION @@ -23,7 +23,7 @@ connected to that scope, if set\. .SH CONFIGURATION .SS registry .P -Default: http://registry\.npmjs\.org/ +Default: https://registry\.npmjs\.org/ .P The base URL of the npm package registry\. If \fBscope\fP is also specified, it takes precedence\. @@ -31,18 +31,13 @@ it takes precedence\. .P Default: none .P -If specified, the user and login credentials given will be associated -with the specified scope\. See npm help 7 \fBnpm\-scope\fP\|\. You can use both at the same time, -e\.g\. +If specified, you will be logged out of the specified scope\. See npm help 7 \fBnpm\-scope\fP\|\. .P .RS 2 .nf -npm adduser \-\-registry=http://myregistry\.example\.com \-\-scope=@myco +npm logout \-\-scope=@myco .fi .RE -.P -This will set a registry for the given scope and login or create a user for -that registry at the same time\. .SH SEE ALSO .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1 index a65a3fa8902551..8298409c660249 100644 --- a/deps/npm/man/man1/npm-ls.1 +++ b/deps/npm/man/man1/npm-ls.1 @@ -1,14 +1,13 @@ -.TH "NPM\-LS" "1" "October 2015" "" "" +.TH "NPM\-LS" "1" "April 2016" "" "" .SH "NAME" \fBnpm-ls\fR \- List installed packages .SH SYNOPSIS .P .RS 2 .nf -npm list [[@/] \.\.\.] -npm ls [[@/] \.\.\.] -npm la [[@/] \.\.\.] -npm ll [[@/] \.\.\.] +npm ls [[<@scope>/] \.\.\.] + +aliases: list, la, ll .fi .RE .SH DESCRIPTION @@ -23,7 +22,7 @@ For example, running \fBnpm ls promzard\fP in npm's source tree will show: .P .RS 2 .nf -npm@2.14.7 /path/to/npm +npm@3.8.6 /path/to/npm └─┬ init\-package\-json@0\.0\.4 └── promzard@0\.1\.5 .fi @@ -35,6 +34,9 @@ If a project specifies git urls for dependencies these are shown in parentheses after the name@version to make it easier for users to recognize potential forks of a project\. .P +The tree shown is the logical dependency tree, based on package +dependencies, not the physical layout of your node_modules folder\. +.P When run as \fBll\fP or \fBla\fP, it shows extended information by default\. .SH CONFIGURATION .SS json @@ -106,6 +108,16 @@ Default: false .RE .P Display only the dependency tree for packages in \fBdevDependencies\fP\|\. +.SS only +.RS 0 +.IP \(bu 2 +Type: String + +.RE +.P +When "dev" or "development", is an alias to \fBdev\fP\|\. +.P +When "prod" or "production", is an alias to \fBproduction\fP\|\.` .SH SEE ALSO .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-outdated.1 b/deps/npm/man/man1/npm-outdated.1 index 7f96b4e48cde03..6cb81b075b3d18 100644 --- a/deps/npm/man/man1/npm-outdated.1 +++ b/deps/npm/man/man1/npm-outdated.1 @@ -1,11 +1,11 @@ -.TH "NPM\-OUTDATED" "1" "October 2015" "" "" +.TH "NPM\-OUTDATED" "1" "April 2016" "" "" .SH "NAME" \fBnpm-outdated\fR \- Check for outdated packages .SH SYNOPSIS .P .RS 2 .nf -npm outdated [ [ \.\.\.]] +npm outdated [[<@scope>/] \.\.\.] .fi .RE .SH DESCRIPTION @@ -13,9 +13,77 @@ npm outdated [ [ \.\.\.]] This command will check the registry to see if any (or, specific) installed packages are currently outdated\. .P -The resulting field 'wanted' shows the latest version according to the -version specified in the package\.json, the field 'latest' the very latest -version of the package\. +In the output: +.RS 0 +.IP \(bu 2 +\fBwanted\fP is the maximum version of the package that satisfies the semver +range specified in \fBpackage\.json\fP\|\. If there's no available semver range (i\.e\. +you're running \fBnpm outdated \-\-global\fP, or the package isn't included in +\fBpackage\.json\fP), then \fBwanted\fP shows the currently\-installed version\. +.IP \(bu 2 +\fBlatest\fP is the version of the package tagged as latest in the registry\. +Running \fBnpm publish\fP with no special configuration will publish the package +with a dist\-tag of \fBlatest\fP\|\. This may or may not be the maximum version of +the package, or the most\-recently published version of the package, depending +on how the package's developer manages the latest npm help dist\-tag\. +.IP \(bu 2 +\fBlocation\fP is where in the dependency tree the package is located\. Note that +\fBnpm outdated\fP defaults to a depth of 0, so unless you override that, you'll +always be seeing only top\-level dependencies that are outdated\. +.IP \(bu 2 +\fBpackage type\fP (when using \fB\-\-long\fP / \fB\-l\fP) tells you whether this package is +a \fBdependency\fP or a \fBdevDependency\fP\|\. Packages not included in \fBpackage\.json\fP +are always marked \fBdependencies\fP\|\. + +.RE +.SS An example +.P +.RS 2 +.nf +$ npm outdated +Package Current Wanted Latest Location +glob 5\.0\.15 5\.0\.15 6\.0\.1 test\-outdated\-output +nothingness 0\.0\.3 git git test\-outdated\-output +npm 3\.5\.1 3\.5\.2 3\.5\.1 test\-outdated\-output +local\-dev 0\.0\.3 linked linked test\-outdated\-output +once 1\.3\.2 1\.3\.3 1\.3\.3 test\-outdated\-output +.fi +.RE +.P +With these \fBdependencies\fP: +.P +.RS 2 +.nf +{ + "glob": "^5\.0\.15", + "nothingness": "github:othiym23/nothingness#master", + "npm": "^3\.5\.1", + "once": "^1\.3\.1" +} +.fi +.RE +.P +A few things to note: +.RS 0 +.IP \(bu 2 +\fBglob\fP requires \fB^5\fP, which prevents npm from installing \fBglob@6\fP, which is +outside the semver range\. +.IP \(bu 2 +Git dependencies will always be reinstalled, because of how they're specified\. +The installed committish might satisfy the dependency specifier (if it's +something immutable, like a commit SHA), or it might not, so \fBnpm outdated\fP and +\fBnpm update\fP have to fetch Git repos to check\. This is why currently doing a +reinstall of a Git dependency always forces a new clone and install\. +.IP \(bu 2 +\fBnpm@3\.5\.2\fP is marked as "wanted", but "latest" is \fBnpm@3\.5\.1\fP because npm +uses dist\-tags to manage its \fBlatest\fP and \fBnext\fP release channels\. \fBnpm update\fP +will install the \fInewest\fR version, but \fBnpm install npm\fP (with no semver range) +will install whatever's tagged as \fBlatest\fP\|\. +.IP \(bu 2 +\fBonce\fP is just plain out of date\. Reinstalling \fBnode_modules\fP from scratch or +running \fBnpm update\fP will bring it up to spec\. + +.RE .SH CONFIGURATION .SS json .RS 0 @@ -61,6 +129,8 @@ project\. .SS depth .RS 0 .IP \(bu 2 +Default: 0 +.IP \(bu 2 Type: Int .RE @@ -71,6 +141,8 @@ Max depth for checking dependency tree\. .IP \(bu 2 npm help update .IP \(bu 2 +npm help dist\-tag +.IP \(bu 2 npm help 7 registry .IP \(bu 2 npm help 5 folders diff --git a/deps/npm/man/man1/npm-owner.1 b/deps/npm/man/man1/npm-owner.1 index 28d2cc125f578c..30aeb00bbab548 100644 --- a/deps/npm/man/man1/npm-owner.1 +++ b/deps/npm/man/man1/npm-owner.1 @@ -1,13 +1,15 @@ -.TH "NPM\-OWNER" "1" "October 2015" "" "" +.TH "NPM\-OWNER" "1" "April 2016" "" "" .SH "NAME" \fBnpm-owner\fR \- Manage package owners .SH SYNOPSIS .P .RS 2 .nf -npm owner ls -npm owner add -npm owner rm +npm owner add [<@scope>/] +npm owner rm [<@scope>/] +npm owner ls [<@scope>/] + +aliases: author .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-pack.1 b/deps/npm/man/man1/npm-pack.1 index 295d918bfed991..4d242b139c17ea 100644 --- a/deps/npm/man/man1/npm-pack.1 +++ b/deps/npm/man/man1/npm-pack.1 @@ -1,20 +1,20 @@ -.TH "NPM\-PACK" "1" "October 2015" "" "" +.TH "NPM\-PACK" "1" "April 2016" "" "" .SH "NAME" \fBnpm-pack\fR \- Create a tarball from a package .SH SYNOPSIS .P .RS 2 .nf -npm pack [ [ \.\.\.]] +npm pack [[<@scope>/]\.\.\.] .fi .RE .SH DESCRIPTION .P For anything that's installable (that is, a package folder, tarball, -tarball url, name@tag, name@version, or name), this command will fetch -it to the cache, and then copy the tarball to the current working -directory as \fB\-\.tgz\fP, and then write the filenames out to -stdout\. +tarball url, name@tag, name@version, name, or scoped name), this +command will fetch it to the cache, and then copy the tarball to the +current working directory as \fB\-\.tgz\fP, and then write +the filenames out to stdout\. .P If the same package is specified multiple times, then the file will be overwritten the second time\. diff --git a/deps/npm/man/man1/npm-ping.1 b/deps/npm/man/man1/npm-ping.1 index af69ba3a784219..a39c37419239af 100644 --- a/deps/npm/man/man1/npm-ping.1 +++ b/deps/npm/man/man1/npm-ping.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PING" "1" "October 2015" "" "" +.TH "NPM\-PING" "1" "April 2016" "" "" .SH "NAME" \fBnpm-ping\fR \- Ping npm registry .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-prefix.1 b/deps/npm/man/man1/npm-prefix.1 index 9ce37848d97d52..a37596200914bb 100644 --- a/deps/npm/man/man1/npm-prefix.1 +++ b/deps/npm/man/man1/npm-prefix.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PREFIX" "1" "October 2015" "" "" +.TH "NPM\-PREFIX" "1" "April 2016" "" "" .SH "NAME" \fBnpm-prefix\fR \- Display prefix .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-prune.1 b/deps/npm/man/man1/npm-prune.1 index bb9908f5152bb9..6538b5a8015491 100644 --- a/deps/npm/man/man1/npm-prune.1 +++ b/deps/npm/man/man1/npm-prune.1 @@ -1,12 +1,11 @@ -.TH "NPM\-PRUNE" "1" "October 2015" "" "" +.TH "NPM\-PRUNE" "1" "April 2016" "" "" .SH "NAME" \fBnpm-prune\fR \- Remove extraneous packages .SH SYNOPSIS .P .RS 2 .nf -npm prune [ [ [/]\.\.\.] [\-\-production] .fi .RE .SH DESCRIPTION @@ -25,7 +24,7 @@ negate \fBNODE_ENV\fP being set to \fBproduction\fP\|\. .SH SEE ALSO .RS 0 .IP \(bu 2 -npm help rm +npm help uninstall .IP \(bu 2 npm help 5 folders .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-publish.1 b/deps/npm/man/man1/npm-publish.1 index 20d1f36f6cd0d9..182d4bbbeef29d 100644 --- a/deps/npm/man/man1/npm-publish.1 +++ b/deps/npm/man/man1/npm-publish.1 @@ -1,19 +1,24 @@ -.TH "NPM\-PUBLISH" "1" "October 2015" "" "" +.TH "NPM\-PUBLISH" "1" "April 2016" "" "" .SH "NAME" \fBnpm-publish\fR \- Publish a package .SH SYNOPSIS .P .RS 2 .nf -npm publish [\-\-tag ] [\-\-access ] -npm publish [\-\-tag ] [\-\-access ] +npm publish [|] [\-\-tag ] [\-\-access ] + +Publishes '\.' if no argument supplied +Sets tag 'latest' if no \-\-tag specified .fi .RE .SH DESCRIPTION .P -Publishes a package to the registry so that it can be installed by name\. See -npm help 7 \fBnpm\-developers\fP for details on what's included in the published package, as -well as details on how the package is built\. +Publishes a package to the registry so that it can be installed by name\. All +files in the package directory are included if no local \fB\|\.gitignore\fP or +\fB\|\.npmignore\fP file exists\. If both files exist and a file is ignored by +\fB\|\.gitignore\fP but not by \fB\|\.npmignore\fP then it will be included\. See +npm help 7 \fBnpm\-developers\fP for full details on what's included in the published +package, as well as details on how the package is built\. .P By default npm will publish to the public registry\. This can be overridden by specifying a different default registry or using a npm help 7 \fBnpm\-scope\fP in the name @@ -30,7 +35,8 @@ with a package\.json file inside\. \fB[\-\-tag ]\fP Registers the published package with the given tag, such that \fBnpm install @\fP will install this version\. By default, \fBnpm publish\fP updates -and \fBnpm install\fP installs the \fBlatest\fP tag\. +and \fBnpm install\fP installs the \fBlatest\fP tag\. See npm help \fBnpm\-dist\-tag\fP for +details about tags\. .IP \(bu 2 \fB[\-\-access ]\fP Tells the registry whether this package should be published as public or diff --git a/deps/npm/man/man1/npm-rebuild.1 b/deps/npm/man/man1/npm-rebuild.1 index b10caeef0d8b46..668002e2ba480f 100644 --- a/deps/npm/man/man1/npm-rebuild.1 +++ b/deps/npm/man/man1/npm-rebuild.1 @@ -1,19 +1,14 @@ -.TH "NPM\-REBUILD" "1" "October 2015" "" "" +.TH "NPM\-REBUILD" "1" "April 2016" "" "" .SH "NAME" \fBnpm-rebuild\fR \- Rebuild a package .SH SYNOPSIS .P .RS 2 .nf -npm rebuild [ [ \.\.\.]] -npm rb [ [ \.\.\.]] -.fi -.RE -.RS 0 -.IP \(bu 2 -\fB\fP: -The package to rebuild +npm rebuild [[<@scope>/]\.\.\.] +alias: npm rb +.fi .RE .SH DESCRIPTION .P diff --git a/deps/npm/man/man1/npm-repo.1 b/deps/npm/man/man1/npm-repo.1 index 14f228c9553ee5..86dc40727d9251 100644 --- a/deps/npm/man/man1/npm-repo.1 +++ b/deps/npm/man/man1/npm-repo.1 @@ -1,12 +1,11 @@ -.TH "NPM\-REPO" "1" "October 2015" "" "" +.TH "NPM\-REPO" "1" "April 2016" "" "" .SH "NAME" \fBnpm-repo\fR \- Open package repository page in the browser .SH SYNOPSIS .P .RS 2 .nf -npm repo -npm repo (with no args in a package dir) +npm repo [] .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-restart.1 b/deps/npm/man/man1/npm-restart.1 index 31e61af29de800..5127fcf9e5e7c0 100644 --- a/deps/npm/man/man1/npm-restart.1 +++ b/deps/npm/man/man1/npm-restart.1 @@ -1,4 +1,4 @@ -.TH "NPM\-RESTART" "1" "October 2015" "" "" +.TH "NPM\-RESTART" "1" "April 2016" "" "" .SH "NAME" \fBnpm-restart\fR \- Restart a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-rm.1 b/deps/npm/man/man1/npm-rm.1 deleted file mode 100644 index 9c2506635a491d..00000000000000 --- a/deps/npm/man/man1/npm-rm.1 +++ /dev/null @@ -1,34 +0,0 @@ -.TH "NPM\-RM" "1" "October 2015" "" "" -.SH "NAME" -\fBnpm-rm\fR \- Remove a package -.SH SYNOPSIS -.P -.RS 2 -.nf -npm rm -npm r -npm uninstall -npm un -.fi -.RE -.SH DESCRIPTION -.P -This uninstalls a package, completely removing everything npm installed -on its behalf\. -.SH SEE ALSO -.RS 0 -.IP \(bu 2 -npm help prune -.IP \(bu 2 -npm help install -.IP \(bu 2 -npm help 5 folders -.IP \(bu 2 -npm help config -.IP \(bu 2 -npm help 7 config -.IP \(bu 2 -npm help 5 npmrc - -.RE - diff --git a/deps/npm/man/man1/npm-root.1 b/deps/npm/man/man1/npm-root.1 index 20e4a2f687ebea..8fd77cf6bc0eb3 100644 --- a/deps/npm/man/man1/npm-root.1 +++ b/deps/npm/man/man1/npm-root.1 @@ -1,11 +1,11 @@ -.TH "NPM\-ROOT" "1" "October 2015" "" "" +.TH "NPM\-ROOT" "1" "April 2016" "" "" .SH "NAME" \fBnpm-root\fR \- Display npm root .SH SYNOPSIS .P .RS 2 .nf -npm root +npm root [\-g] .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-run-script.1 b/deps/npm/man/man1/npm-run-script.1 index e4da37dc2af7c5..618d49d3d1fffb 100644 --- a/deps/npm/man/man1/npm-run-script.1 +++ b/deps/npm/man/man1/npm-run-script.1 @@ -1,12 +1,13 @@ -.TH "NPM\-RUN\-SCRIPT" "1" "October 2015" "" "" +.TH "NPM\-RUN\-SCRIPT" "1" "April 2016" "" "" .SH "NAME" \fBnpm-run-script\fR \- Run arbitrary package scripts .SH SYNOPSIS .P .RS 2 .nf -npm run\-script [command] [\-\- ] -npm run [command] [\-\- ] +npm run\-script [\-\- \.\.\.] + +alias: npm run .fi .RE .SH DESCRIPTION @@ -49,6 +50,9 @@ you should write: .RE .P instead of \fB"scripts": {"test": "node_modules/\.bin/tap test/\\*\.js"}\fP to run your tests\. +.P +If you try to run a script without having a \fBnode_modules\fP directory and it fails, +you will be given a warning to run \fBnpm install\fP, just in case you've forgotten\. .SH SEE ALSO .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-search.1 b/deps/npm/man/man1/npm-search.1 index ea2a9c82431130..c99830fca52797 100644 --- a/deps/npm/man/man1/npm-search.1 +++ b/deps/npm/man/man1/npm-search.1 @@ -1,13 +1,13 @@ -.TH "NPM\-SEARCH" "1" "October 2015" "" "" +.TH "NPM\-SEARCH" "1" "April 2016" "" "" .SH "NAME" \fBnpm-search\fR \- Search for packages .SH SYNOPSIS .P .RS 2 .nf -npm search [\-\-long] [search terms \.\.\.] -npm s [search terms \.\.\.] -npm se [search terms \.\.\.] +npm search [\-l|\-\-long] [search terms \.\.\.] + +aliases: s, se, find .fi .RE .SH DESCRIPTION @@ -31,6 +31,18 @@ Display full package descriptions and other long text across multiple lines\. When disabled (default) search results are truncated to fit neatly on a single line\. Modules with extremely long names will fall on multiple lines\. +.SS registry +.RS 0 +.IP \(bu 2 +Default: https://registry\.npmjs\.org/ +.IP \(bu 2 +Type : url + +.RE +.P +Search the specified registry for modules\. If you have configured npm to point to a different default registry, +such as your internal private module repository, \fBnpm search\fP will default to that registry when searching\. +Pass a different registry url such as the default above in order to override this setting\. .SH SEE ALSO .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-shrinkwrap.1 b/deps/npm/man/man1/npm-shrinkwrap.1 index 1a8abd78292a6f..13d7c2d85be9ad 100644 --- a/deps/npm/man/man1/npm-shrinkwrap.1 +++ b/deps/npm/man/man1/npm-shrinkwrap.1 @@ -1,4 +1,4 @@ -.TH "NPM\-SHRINKWRAP" "1" "October 2015" "" "" +.TH "NPM\-SHRINKWRAP" "1" "April 2016" "" "" .SH "NAME" \fBnpm-shrinkwrap\fR \- Lock down dependency versions .SH SYNOPSIS @@ -115,9 +115,13 @@ This generates \fBnpm\-shrinkwrap\.json\fP, which will look something like this: "dependencies": { "B": { "version": "0\.0\.1", + "from": "B@^0\.0\.1", + "resolved": "https://registry\.npmjs\.org/B/\-/B\-0\.0\.1\.tgz", "dependencies": { "C": { - "version": "0\.0\.1" + "version": "0\.0\.1", + "from": "org/C#v0\.0\.1", + "resolved": "git://github\.com/org/C\.git#5c380ae319fc4efe9e7f2d9c78b0faa588fd99b4" } } } @@ -126,15 +130,18 @@ This generates \fBnpm\-shrinkwrap\.json\fP, which will look something like this: .fi .RE .P -The shrinkwrap command has locked down the dependencies based on -what's currently installed in node_modules\. When \fBnpm install\fP -installs a package with an \fBnpm\-shrinkwrap\.json\fP in the package -root, the shrinkwrap file (rather than \fBpackage\.json\fP files) completely -drives the installation of that package and all of its dependencies -(recursively)\. So now the author publishes A@0\.1\.0, and subsequent -installs of this package will use B@0\.0\.1 and C@0\.0\.1, regardless the -dependencies and versions listed in A's, B's, and C's \fBpackage\.json\fP -files\. +The shrinkwrap command has locked down the dependencies based on what's +currently installed in \fBnode_modules\fP\|\. The installation behavior is changed to: +.RS 0 +.IP 1. 3 +The module tree described by the shrinkwrap is reproduced\. This means +reproducing the structure described in the file, using the specific files +referenced in "resolved" if available, falling back to normal package +resolution using "version" if one isn't\. +.IP 2. 3 +The tree is walked and any missing dependencies are installed in the usual fashion\. + +.RE .SS Using shrinkwrapped packages .P Using a shrinkwrapped package is no different than using any other @@ -161,17 +168,16 @@ To add or update a dependency in a shrinkwrapped package: Run \fBnpm install\fP in the package root to install the current versions of all dependencies\. .IP 2. 3 -Add or update dependencies\. \fBnpm install\fP each new or updated -package individually and then update \fBpackage\.json\fP\|\. Note that they -must be explicitly named in order to be installed: running \fBnpm -install\fP with no arguments will merely reproduce the existing +Add or update dependencies\. \fBnpm install \-\-save\fP each new or updated +package individually to update the \fBpackage\.json\fP and the shrinkwrap\. +Note that they must be explicitly named in order to be installed: running +\fBnpm install\fP with no arguments will merely reproduce the existing shrinkwrap\. .IP 3. 3 Validate that the package works as expected with the new dependencies\. .IP 4. 3 -Run \fBnpm shrinkwrap\fP, commit the new \fBnpm\-shrinkwrap\.json\fP, and -publish your package\. +Commit the new \fBnpm\-shrinkwrap\.json\fP, and publish your package\. .RE .P diff --git a/deps/npm/man/man1/npm-star.1 b/deps/npm/man/man1/npm-star.1 index 7bcb1db69f9685..9f52ce52dd26ae 100644 --- a/deps/npm/man/man1/npm-star.1 +++ b/deps/npm/man/man1/npm-star.1 @@ -1,12 +1,12 @@ -.TH "NPM\-STAR" "1" "October 2015" "" "" +.TH "NPM\-STAR" "1" "April 2016" "" "" .SH "NAME" \fBnpm-star\fR \- Mark your favorite packages .SH SYNOPSIS .P .RS 2 .nf -npm star [, \.\.\.] -npm unstar [, \.\.\.] +npm star [\.\.\.] +npm unstar [\.\.\.] .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-stars.1 b/deps/npm/man/man1/npm-stars.1 index 2d8c3b2c7def7f..59d5897e12625a 100644 --- a/deps/npm/man/man1/npm-stars.1 +++ b/deps/npm/man/man1/npm-stars.1 @@ -1,12 +1,11 @@ -.TH "NPM\-STARS" "1" "October 2015" "" "" +.TH "NPM\-STARS" "1" "April 2016" "" "" .SH "NAME" \fBnpm-stars\fR \- View packages marked as favorites .SH SYNOPSIS .P .RS 2 .nf -npm stars -npm stars [username] +npm stars [] .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-start.1 b/deps/npm/man/man1/npm-start.1 index eb5f7b8aeac55c..bd65a9149f8a8c 100644 --- a/deps/npm/man/man1/npm-start.1 +++ b/deps/npm/man/man1/npm-start.1 @@ -1,4 +1,4 @@ -.TH "NPM\-START" "1" "October 2015" "" "" +.TH "NPM\-START" "1" "April 2016" "" "" .SH "NAME" \fBnpm-start\fR \- Start a package .SH SYNOPSIS @@ -10,7 +10,13 @@ npm start [\-\- ] .RE .SH DESCRIPTION .P -This runs a package's "start" script, if one was provided\. +This runs an arbitrary command specified in the package's \fB"start"\fP property of +its \fB"scripts"\fP object\. If no \fB"start"\fP property is specified on the +\fB"scripts"\fP object, it will run \fBnode server\.js\fP\|\. +.P +As of \fBnpm@2\.0\.0\fP \fIhttp://blog\.npmjs\.org/post/98131109725/npm\-2\-0\-0\fR, you can +use custom arguments when executing scripts\. Refer to npm help run\-script for +more details\. .SH SEE ALSO .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-stop.1 b/deps/npm/man/man1/npm-stop.1 index 8e2510625533ac..a99c6fe5ab4d03 100644 --- a/deps/npm/man/man1/npm-stop.1 +++ b/deps/npm/man/man1/npm-stop.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STOP" "1" "October 2015" "" "" +.TH "NPM\-STOP" "1" "April 2016" "" "" .SH "NAME" \fBnpm-stop\fR \- Stop a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-tag.1 b/deps/npm/man/man1/npm-tag.1 index affc443d538540..4a670febef08f5 100644 --- a/deps/npm/man/man1/npm-tag.1 +++ b/deps/npm/man/man1/npm-tag.1 @@ -1,11 +1,12 @@ -.TH "NPM\-TAG" "1" "October 2015" "" "" +.TH "NPM\-TAG" "1" "April 2016" "" "" .SH "NAME" \fBnpm-tag\fR \- Tag a published version .SH SYNOPSIS .P .RS 2 .nf -npm tag @ [] +[DEPRECATED] npm tag @ [] +See `dist\-tag` .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-team.1 b/deps/npm/man/man1/npm-team.1 index afe5434c1ebb7c..297e648c741b79 100644 --- a/deps/npm/man/man1/npm-team.1 +++ b/deps/npm/man/man1/npm-team.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TEAM" "1" "October 2015" "" "" +.TH "NPM\-TEAM" "1" "April 2016" "" "" .SH "NAME" \fBnpm-team\fR \- Manage organization teams and team memberships .SH SYNOPSIS @@ -21,10 +21,10 @@ npm team edit Used to manage teams in organizations, and change team memberships\. Does not handle permissions for packages\. .P -Teams must always be fully qualified with the organization/scope they belond to +Teams must always be fully qualified with the organization/scope they belong to when operating on them, separated by a colon (\fB:\fP)\. That is, if you have a \fBdevelopers\fP team on a \fBfoo\fP organization, you must always refer to that team as -\fBdevelopers:foo\fP in these commands\. +\fBfoo:developers\fP in these commands\. .RS 0 .IP \(bu 2 create / destroy: @@ -58,6 +58,6 @@ use the \fBnpm access\fP command to grant or revoke the appropriate permissions\ .IP \(bu 2 npm help access .IP \(bu 2 -npm help 7 registr +npm help 7 registry .RE diff --git a/deps/npm/man/man1/npm-test.1 b/deps/npm/man/man1/npm-test.1 index 08720089a6200f..068e0176723209 100644 --- a/deps/npm/man/man1/npm-test.1 +++ b/deps/npm/man/man1/npm-test.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TEST" "1" "October 2015" "" "" +.TH "NPM\-TEST" "1" "April 2016" "" "" .SH "NAME" \fBnpm-test\fR \- Test a package .SH SYNOPSIS @@ -6,7 +6,8 @@ .RS 2 .nf npm test [\-\- ] - npm tst [\-\- ] + + aliases: t, tst .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-uninstall.1 b/deps/npm/man/man1/npm-uninstall.1 index fedb41b730f211..65b28b4bd7fdc3 100644 --- a/deps/npm/man/man1/npm-uninstall.1 +++ b/deps/npm/man/man1/npm-uninstall.1 @@ -1,12 +1,13 @@ -.TH "NPM\-RM" "1" "October 2015" "" "" +.TH "NPM\-UNINSTALL" "1" "April 2016" "" "" .SH "NAME" -\fBnpm-rm\fR \- Remove a package +\fBnpm-uninstall\fR \- Remove a package .SH SYNOPSIS .P .RS 2 .nf -npm uninstall [@/] [\-\-save|\-\-save\-dev|\-\-save\-optional] -npm rm (with any of the previous argument usage) +npm uninstall [<@scope>/][@]\.\.\. [\-S|\-\-save|\-D|\-\-save\-dev|\-O|\-\-save\-optional] + +aliases: remove, rm, r, un, unlink .fi .RE .SH DESCRIPTION @@ -29,14 +30,17 @@ it uninstalls the current package context as a global package\. the package version in your main package\.json: .RS 0 .IP \(bu 2 -\fB\-\-save\fP: Package will be removed from your \fBdependencies\fP\|\. +\fB\-S, \-\-save\fP: Package will be removed from your \fBdependencies\fP\|\. .IP \(bu 2 -\fB\-\-save\-dev\fP: Package will be removed from your \fBdevDependencies\fP\|\. +\fB\-D, \-\-save\-dev\fP: Package will be removed from your \fBdevDependencies\fP\|\. .IP \(bu 2 -\fB\-\-save\-optional\fP: Package will be removed from your \fBoptionalDependencies\fP\|\. +\fB\-O, \-\-save\-optional\fP: Package will be removed from your \fBoptionalDependencies\fP\|\. .RE .P +Further, if you have an \fBnpm\-shrinkwrap\.json\fP then it will be updated as +well\. +.P Scope is optional and follows the usual rules for npm help 7 \fBnpm\-scope\fP\|\. .P Examples: diff --git a/deps/npm/man/man1/npm-unpublish.1 b/deps/npm/man/man1/npm-unpublish.1 index f3c46aac93ac88..aded668480f987 100644 --- a/deps/npm/man/man1/npm-unpublish.1 +++ b/deps/npm/man/man1/npm-unpublish.1 @@ -1,11 +1,11 @@ -.TH "NPM\-UNPUBLISH" "1" "October 2015" "" "" +.TH "NPM\-UNPUBLISH" "1" "April 2016" "" "" .SH "NAME" \fBnpm-unpublish\fR \- Remove a package from the registry .SH SYNOPSIS .P .RS 2 .nf -npm unpublish [@/][@] +npm unpublish [<@scope>/][@] .fi .RE .SH WARNING diff --git a/deps/npm/man/man1/npm-update.1 b/deps/npm/man/man1/npm-update.1 index 4e247b50082a94..dc262065b271cb 100644 --- a/deps/npm/man/man1/npm-update.1 +++ b/deps/npm/man/man1/npm-update.1 @@ -1,11 +1,13 @@ -.TH "NPM\-UPDATE" "1" "October 2015" "" "" +.TH "NPM\-UPDATE" "1" "April 2016" "" "" .SH "NAME" \fBnpm-update\fR \- Update a package .SH SYNOPSIS .P .RS 2 .nf -npm update [\-g] [ [ \.\.\.]] +npm update [\-g] [\.\.\.] + +aliases: up, upgrade .fi .RE .SH DESCRIPTION @@ -25,18 +27,7 @@ or local) will be updated\. .P As of \fBnpm@2\.6\.1\fP, the \fBnpm update\fP will only inspect top\-level packages\. Prior versions of \fBnpm\fP would also recursively inspect all dependencies\. -To get the old behavior, use \fBnpm \-\-depth 9999 update\fP, but be warned that -simultaneous asynchronous update of all packages, including \fBnpm\fP itself -and packages that \fBnpm\fP depends on, often causes problems up to and including -the uninstallation of \fBnpm\fP itself\. -.P -To restore a missing \fBnpm\fP, use the command: -.P -.RS 2 -.nf -curl \-L https://npmjs\.com/install\.sh | sh -.fi -.RE +To get the old behavior, use \fBnpm \-\-depth 9999 update\fP\|\. .SH EXAMPLES .P IMPORTANT VERSION NOTE: these examples assume \fBnpm@2\.6\.1\fP or later\. For @@ -49,17 +40,18 @@ on dependencies, \fBdep1\fP (\fBdep2\fP, \.\. etc\.)\. The published versions o .RS 2 .nf { - dist\-tags: { latest: "1\.2\.2" }, - versions: { "1\.2\.2", - "1\.2\.1", - "1\.2\.0", - "1\.1\.2", - "1\.1\.1", - "1\.0\.0", - "0\.4\.1", - "0\.4\.0", - "0\.2\.0" - } + "dist\-tags": { "latest": "1\.2\.2" }, + "versions": [ + "1\.2\.2", + "1\.2\.1", + "1\.2\.0", + "1\.1\.2", + "1\.1\.1", + "1\.0\.0", + "0\.4\.1", + "0\.4\.0", + "0\.2\.0" + ] } .fi .RE @@ -69,8 +61,8 @@ If \fBapp\fP\|'s \fBpackage\.json\fP contains: .P .RS 2 .nf -dependencies: { - dep1: "^1\.1\.1" +"dependencies": { + "dep1": "^1\.1\.1" } .fi .RE @@ -83,8 +75,8 @@ However, if \fBapp\fP\|'s \fBpackage\.json\fP contains: .P .RS 2 .nf -dependencies: { - dep1: "~1\.1\.1" +"dependencies": { + "dep1": "~1\.1\.1" } .fi .RE @@ -99,8 +91,8 @@ Suppose \fBapp\fP has a caret dependency on a version below \fB1\.0\.0\fP, for e .P .RS 2 .nf -dependencies: { - dep1: "^0\.2\.0" +"dependencies": { + "dep1": "^0\.2\.0" } .fi .RE @@ -112,8 +104,8 @@ If the dependence were on \fB^0\.4\.0\fP: .P .RS 2 .nf -dependencies: { - dep1: "^0\.4\.0" +"dependencies": { + "dep1": "^0\.4\.0" } .fi .RE @@ -124,12 +116,13 @@ version that satisfies \fB^0\.4\.0\fP (\fB>= 0\.4\.0 <0\.5\.0\fP) .P When you want to update a package and save the new version as the minimum required dependency in \fBpackage\.json\fP, you can use -\fBnpm update \-\-save\fP\|\. For example if \fBpackage\.json\fP contains +\fBnpm update \-S\fP or \fBnpm update \-\-save\fP\|\. For example if +\fBpackage\.json\fP contains: .P .RS 2 .nf -dependencies: { - dep1: "^1\.1\.1" +"dependencies": { + "dep1": "^1\.1\.1" } .fi .RE @@ -139,8 +132,8 @@ and \fBpackage\.json\fP will be modified: .P .RS 2 .nf -dependencies: { - dep1: "^1\.2\.2" +"dependencies": { + "dep1": "^1\.2\.2" } .fi .RE @@ -149,7 +142,7 @@ Note that \fBnpm\fP will only write an updated version to \fBpackage\.json\fP if it installs a new package\. .SS Updating Globally\-Installed Packages .P -\fBnpm update \-g\fP will apply the \fBupdate\fP action to each globally\- installed +\fBnpm update \-g\fP will apply the \fBupdate\fP action to each globally installed package that is \fBoutdated\fP \-\- that is, has a version that is different from \fBlatest\fP\|\. .P diff --git a/deps/npm/man/man1/npm-version.1 b/deps/npm/man/man1/npm-version.1 index 5c04c279f913ab..ac74ee8dd6f25b 100644 --- a/deps/npm/man/man1/npm-version.1 +++ b/deps/npm/man/man1/npm-version.1 @@ -1,11 +1,15 @@ -.TH "NPM\-VERSION" "1" "October 2015" "" "" +.TH "NPM\-VERSION" "1" "April 2016" "" "" .SH "NAME" \fBnpm-version\fR \- Bump a package version .SH SYNOPSIS .P .RS 2 .nf -npm version [ | major | minor | patch | premajor | preminor | prepatch | prerelease] +npm version [ | major | minor | patch | premajor | preminor | prepatch | prerelease | from\-git] + +\|'npm [\-v | \-\-version]' to print npm version +\|'npm view version' to view a package's published version +\|'npm ls' to inspect current package/dependency versions .fi .RE .SH DESCRIPTION @@ -13,18 +17,19 @@ npm version [ | major | minor | patch | premajor | preminor | prepat Run this in a package directory to bump the version and write the new data back to \fBpackage\.json\fP and, if present, \fBnpm\-shrinkwrap\.json\fP\|\. .P -The \fBnewversion\fP argument should be a valid semver string, \fIor\fR a -valid second argument to semver\.inc (one of \fBpatch\fP, \fBminor\fP, \fBmajor\fP, -\fBprepatch\fP, \fBpreminor\fP, \fBpremajor\fP, \fBprerelease\fP)\. In the second case, +The \fBnewversion\fP argument should be a valid semver string, a +valid second argument to semver\.inc \fIhttps://github\.com/npm/node\-semver#functions\fR (one of \fBpatch\fP, \fBminor\fP, \fBmajor\fP, +\fBprepatch\fP, \fBpreminor\fP, \fBpremajor\fP, \fBprerelease\fP), or \fBfrom\-git\fP\|\. In the second case, the existing version will be incremented by 1 in the specified field\. +\fBfrom\-git\fP will try to read the latest git tag, and use that as the new npm version\. .P If run in a git repo, it will also create a version commit and tag\. This behavior is controlled by \fBgit\-tag\-version\fP (see below), and can be disabled on the command line by running \fBnpm \-\-no\-git\-tag\-version version\fP\|\. -It will fail if the working directory is not clean, unless the \fB\-\-force\fP -flag is set\. +It will fail if the working directory is not clean, unless the \fB\-f\fP or +\fB\-\-force\fP flag is set\. .P -If supplied with \fB\-\-message\fP (shorthand: \fB\-m\fP) config option, npm will +If supplied with \fB\-m\fP or \fB\-\-message\fP config option, npm will use it as a commit message when creating a version commit\. If the \fBmessage\fP config contains \fB%s\fP then that will be replaced with the resulting version number\. For example: diff --git a/deps/npm/man/man1/npm-view.1 b/deps/npm/man/man1/npm-view.1 index ba3fe90030d0d7..62b2042cd17037 100644 --- a/deps/npm/man/man1/npm-view.1 +++ b/deps/npm/man/man1/npm-view.1 @@ -1,12 +1,13 @@ -.TH "NPM\-VIEW" "1" "October 2015" "" "" +.TH "NPM\-VIEW" "1" "April 2016" "" "" .SH "NAME" \fBnpm-view\fR \- View registry info .SH SYNOPSIS .P .RS 2 .nf -npm view [@/][@] [[\.]\.\.\.] -npm v [@/][@] [[\.]\.\.\.] +npm view [<@scope>/][@] [[\.]\.\.\.] + +aliases: info, show, v .fi .RE .SH DESCRIPTION @@ -76,7 +77,7 @@ npm view express contributors[0]\.email .RE .P Multiple fields may be specified, and will be printed one after another\. -For exampls, to get all the contributor names and email addresses, you +For example, to get all the contributor names and email addresses, you can do this: .P .RS 2 @@ -104,6 +105,15 @@ was required by each matching version of yui3: npm view yui3@'>0\.5\.4' dependencies\.jsdom .fi .RE +.P +To show the \fBconnect\fP package version history, you can do +this: +.P +.RS 2 +.nf +npm view connect versions +.fi +.RE .SH OUTPUT .P If only a single string field for a single version is output, then it diff --git a/deps/npm/man/man1/npm-whoami.1 b/deps/npm/man/man1/npm-whoami.1 index b52b509ebb670d..183016ae025a82 100644 --- a/deps/npm/man/man1/npm-whoami.1 +++ b/deps/npm/man/man1/npm-whoami.1 @@ -1,11 +1,11 @@ -.TH "NPM\-WHOAMI" "1" "October 2015" "" "" +.TH "NPM\-WHOAMI" "1" "April 2016" "" "" .SH "NAME" \fBnpm-whoami\fR \- Display npm username .SH SYNOPSIS .P .RS 2 .nf -npm whoami +npm whoami [\-\-registry ] .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1 index 3837768230bf87..165cf1b890622c 100644 --- a/deps/npm/man/man1/npm.1 +++ b/deps/npm/man/man1/npm.1 @@ -1,4 +1,4 @@ -.TH "NPM" "1" "October 2015" "" "" +.TH "NPM" "1" "April 2016" "" "" .SH "NAME" \fBnpm\fR \- javascript package manager .SH SYNOPSIS @@ -10,7 +10,7 @@ npm [args] .RE .SH VERSION .P -2.14.7 +3.8.6 .SH DESCRIPTION .P npm is the package manager for the Node JavaScript platform\. It puts @@ -66,7 +66,7 @@ defaults to the current working directory\. Packages are installed to .RE .P -Local mode is the default\. Use \fB\-\-global\fP or \fB\-g\fP on any command to +Local mode is the default\. Use \fB\-g\fP or \fB\-\-global\fP on any command to operate in global mode instead\. .SH DEVELOPER USAGE .P @@ -152,13 +152,13 @@ file in the "doc" folder\. (Don't worry about generating the man page\.) Contributors are listed in npm's \fBpackage\.json\fP file\. You can view them easily by doing \fBnpm view npm contributors\fP\|\. .P -If you would like to contribute, but don't know what to work on, check -the issues list or ask on the mailing list\. +If you would like to contribute, but don't know what to work on, read +the contributing guidelines and check the issues list\. .RS 0 .IP \(bu 2 -http://github\.com/npm/npm/issues +https://github\.com/npm/npm/wiki/Contributing\-Guidelines .IP \(bu 2 -npm\-@googlegroups\.com +https://github\.com/npm/npm/issues .RE .SH BUGS @@ -167,10 +167,7 @@ When you find issues, please report them: .RS 0 .IP \(bu 2 web: -http://github\.com/npm/npm/issues -.IP \(bu 2 -email: -npm\-@googlegroups\.com +https://github\.com/npm/npm/issues .RE .P @@ -190,8 +187,6 @@ i@izs\.me .IP \(bu 2 npm help help .IP \(bu 2 -npm help 7 faq -.IP \(bu 2 README .IP \(bu 2 npm help 5 package\.json @@ -205,8 +200,6 @@ npm help 7 config npm help 5 npmrc .IP \(bu 2 npm help 7 index -.IP \(bu 2 -npm apihelp npm .RE diff --git a/deps/npm/man/man3/npm-bin.3 b/deps/npm/man/man3/npm-bin.3 deleted file mode 100644 index 31c2c4326d8b52..00000000000000 --- a/deps/npm/man/man3/npm-bin.3 +++ /dev/null @@ -1,17 +0,0 @@ -.TH "NPM\-BIN" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-bin\fR \- Display npm bin folder -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.bin(args, cb) -.fi -.RE -.SH DESCRIPTION -.P -Print the folder where npm will install executables\. -.P -This function should not be used programmatically\. Instead, just refer -to the \fBnpm\.bin\fP property\. - diff --git a/deps/npm/man/man3/npm-bugs.3 b/deps/npm/man/man3/npm-bugs.3 deleted file mode 100644 index 860af2e5762598..00000000000000 --- a/deps/npm/man/man3/npm-bugs.3 +++ /dev/null @@ -1,23 +0,0 @@ -.TH "NPM\-BUGS" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-bugs\fR \- Bugs for a package in a web browser maybe -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.bugs(package, callback) -.fi -.RE -.SH DESCRIPTION -.P -This command tries to guess at the likely location of a package's -bug tracker URL, and then tries to open it using the \fB\-\-browser\fP -config param\. -.P -Like other commands, the first parameter is an array\. This command only -uses the first element, which is expected to be a package name with an -optional version number\. -.P -This command will launch a browser, so this command may not be the most -friendly for programmatic use\. - diff --git a/deps/npm/man/man3/npm-cache.3 b/deps/npm/man/man3/npm-cache.3 deleted file mode 100644 index 5ca2d8c7063e60..00000000000000 --- a/deps/npm/man/man3/npm-cache.3 +++ /dev/null @@ -1,34 +0,0 @@ -.TH "NPM\-CACHE" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-cache\fR \- manage the npm cache programmatically -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.cache([args], callback) - -// helpers -npm\.commands\.cache\.clean([args], callback) -npm\.commands\.cache\.add([args], callback) -npm\.commands\.cache\.read(name, version, forceBypass, callback) -.fi -.RE -.SH DESCRIPTION -.P -This acts much the same ways as the npm help cache command line -functionality\. -.P -The callback is called with the package\.json data of the thing that is -eventually added to or read from the cache\. -.P -The top level \fBnpm\.commands\.cache(\.\.\.)\fP functionality is a public -interface, and like all commands on the \fBnpm\.commands\fP object, it will -match the command line behavior exactly\. -.P -However, the cache folder structure and the cache helper functions are -considered \fBinternal\fR API surface, and as such, may change in future -releases of npm, potentially without warning or significant version -incrementation\. -.P -Use at your own risk\. - diff --git a/deps/npm/man/man3/npm-commands.3 b/deps/npm/man/man3/npm-commands.3 deleted file mode 100644 index 9036288732f2a3..00000000000000 --- a/deps/npm/man/man3/npm-commands.3 +++ /dev/null @@ -1,28 +0,0 @@ -.TH "NPM\-COMMANDS" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-commands\fR \- npm commands -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands[](args, callback) -.fi -.RE -.SH DESCRIPTION -.P -npm comes with a full set of commands, and each of the commands takes a -similar set of arguments\. -.P -In general, all commands on the command object take an \fBarray\fR of positional -argument \fBstrings\fR\|\. The last argument to any function is a callback\. Some -commands are special and take other optional arguments\. -.P -All commands have their own man page\. See \fBman npm\-\fP for command\-line -usage, or \fBman 3 npm\-\fP for programmatic usage\. -.SH SEE ALSO -.RS 0 -.IP \(bu 2 -npm help 7 index - -.RE - diff --git a/deps/npm/man/man3/npm-config.3 b/deps/npm/man/man3/npm-config.3 deleted file mode 100644 index d27e2dcc453458..00000000000000 --- a/deps/npm/man/man3/npm-config.3 +++ /dev/null @@ -1,49 +0,0 @@ -.TH "NPM\-CONFIG" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-config\fR \- Manage the npm configuration files -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.config(args, callback) -var val = npm\.config\.get(key) -npm\.config\.set(key, val) -.fi -.RE -.SH DESCRIPTION -.P -This function acts much the same way as the command\-line version\. The first -element in the array tells config what to do\. Possible values are: -.RS 0 -.IP \(bu 2 -\fBset\fP - Sets a config parameter\. The second element in \fBargs\fP is interpreted as the - key, and the third element is interpreted as the value\. -.IP \(bu 2 -\fBget\fP - Gets the value of a config parameter\. The second element in \fBargs\fP is the - key to get the value of\. -.IP \(bu 2 -\fBdelete\fP (\fBrm\fP or \fBdel\fP) - Deletes a parameter from the config\. The second element in \fBargs\fP is the - key to delete\. -.IP \(bu 2 -\fBlist\fP (\fBls\fP) - Show all configs that aren't secret\. No parameters necessary\. -.IP \(bu 2 -\fBedit\fP: - Opens the config file in the default editor\. This command isn't very useful - programmatically, but it is made available\. - -.RE -.P -To programmatically access npm configuration settings, or set them for -the duration of a program, use the \fBnpm\.config\.set\fP and \fBnpm\.config\.get\fP -functions instead\. -.SH SEE ALSO -.RS 0 -.IP \(bu 2 -npm apihelp npm - -.RE - diff --git a/deps/npm/man/man3/npm-deprecate.3 b/deps/npm/man/man3/npm-deprecate.3 deleted file mode 100644 index 39cf6336c213ee..00000000000000 --- a/deps/npm/man/man3/npm-deprecate.3 +++ /dev/null @@ -1,43 +0,0 @@ -.TH "NPM\-DEPRECATE" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-deprecate\fR \- Deprecate a version of a package -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.deprecate(args, callback) -.fi -.RE -.SH DESCRIPTION -.P -This command will update the npm registry entry for a package, providing -a deprecation warning to all who attempt to install it\. -.P -The 'args' parameter must have exactly two elements: -.RS 0 -.IP \(bu 2 -\fBpackage[@version]\fP - The \fBversion\fP portion is optional, and may be either a range, or a - specific version, or a tag\. -.IP \(bu 2 -\fBmessage\fP - The warning message that will be printed whenever a user attempts to - install the package\. - -.RE -.P -Note that you must be the package owner to deprecate something\. See the -\fBowner\fP and \fBadduser\fP help topics\. -.P -To un\-deprecate a package, specify an empty string (\fB""\fP) for the \fBmessage\fP argument\. -.SH SEE ALSO -.RS 0 -.IP \(bu 2 -npm apihelp publish -.IP \(bu 2 -npm apihelp unpublish -.IP \(bu 2 -npm help 7 registry - -.RE - diff --git a/deps/npm/man/man3/npm-docs.3 b/deps/npm/man/man3/npm-docs.3 deleted file mode 100644 index f0c01390e296bb..00000000000000 --- a/deps/npm/man/man3/npm-docs.3 +++ /dev/null @@ -1,23 +0,0 @@ -.TH "NPM\-DOCS" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-docs\fR \- Docs for a package in a web browser maybe -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.docs(package, callback) -.fi -.RE -.SH DESCRIPTION -.P -This command tries to guess at the likely location of a package's -documentation URL, and then tries to open it using the \fB\-\-browser\fP -config param\. -.P -Like other commands, the first parameter is an array\. This command only -uses the first element, which is expected to be a package name with an -optional version number\. -.P -This command will launch a browser, so this command may not be the most -friendly for programmatic use\. - diff --git a/deps/npm/man/man3/npm-edit.3 b/deps/npm/man/man3/npm-edit.3 deleted file mode 100644 index c1c79f822970cd..00000000000000 --- a/deps/npm/man/man3/npm-edit.3 +++ /dev/null @@ -1,28 +0,0 @@ -.TH "NPM\-EDIT" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-edit\fR \- Edit an installed package -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.edit(package, callback) -.fi -.RE -.SH DESCRIPTION -.P -Opens the package folder in the default editor (or whatever you've -configured as the npm \fBeditor\fP config \-\- see \fBnpm help config\fP\|\.) -.P -After it has been edited, the package is rebuilt so as to pick up any -changes in compiled packages\. -.P -For instance, you can do \fBnpm install connect\fP to install connect -into your package, and then \fBnpm\.commands\.edit(["connect"], callback)\fP -to make a few changes to your locally installed copy\. -.P -The first parameter is a string array with a single element, the package -to open\. The package can optionally have a version number attached\. -.P -Since this command opens an editor in a new process, be careful about where -and how this is used\. - diff --git a/deps/npm/man/man3/npm-explore.3 b/deps/npm/man/man3/npm-explore.3 deleted file mode 100644 index 702d5bfc800c09..00000000000000 --- a/deps/npm/man/man3/npm-explore.3 +++ /dev/null @@ -1,22 +0,0 @@ -.TH "NPM\-EXPLORE" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-explore\fR \- Browse an installed package -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.explore(args, callback) -.fi -.RE -.SH DESCRIPTION -.P -Spawn a subshell in the directory of the installed package specified\. -.P -If a command is specified, then it is run in the subshell, which then -immediately terminates\. -.P -Note that the package is \fInot\fR automatically rebuilt afterwards, so be -sure to use \fBnpm rebuild \fP if you make any changes\. -.P -The first element in the 'args' parameter must be a package name\. After that is the optional command, which can be any number of strings\. All of the strings will be combined into one, space\-delimited command\. - diff --git a/deps/npm/man/man3/npm-help-search.3 b/deps/npm/man/man3/npm-help-search.3 deleted file mode 100644 index 8e8053b588a062..00000000000000 --- a/deps/npm/man/man3/npm-help-search.3 +++ /dev/null @@ -1,41 +0,0 @@ -.TH "NPM\-HELP\-SEARCH" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-help-search\fR \- Search the help pages -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.helpSearch(args, [silent,] callback) -.fi -.RE -.SH DESCRIPTION -.P -This command is rarely useful, but it exists in the rare case that it is\. -.P -This command takes an array of search terms and returns the help pages that -match in order of best match\. -.P -If there is only one match, then npm displays that help section\. If there -are multiple results, the results are printed to the screen formatted and the -array of results is returned\. Each result is an object with these properties: -.RS 0 -.IP \(bu 2 -hits: -A map of args to number of hits on that arg\. For example, {"npm": 3} -.IP \(bu 2 -found: -Total number of unique args that matched\. -.IP \(bu 2 -totalHits: -Total number of hits\. -.IP \(bu 2 -lines: -An array of all matching lines (and some adjacent lines)\. -.IP \(bu 2 -file: -Name of the file that matched - -.RE -.P -The silent parameter is not necessary not used, but it may in the future\. - diff --git a/deps/npm/man/man3/npm-init.3 b/deps/npm/man/man3/npm-init.3 deleted file mode 100644 index b2eab12fe34944..00000000000000 --- a/deps/npm/man/man3/npm-init.3 +++ /dev/null @@ -1,32 +0,0 @@ -.TH "NPM" "" "October 2015" "" "" -.SH "NAME" -\fBnpm\fR -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.init(args, callback) -.fi -.RE -.SH DESCRIPTION -.P -This will ask you a bunch of questions, and then write a package\.json for you\. -.P -It attempts to make reasonable guesses about what you want things to be set to, -and then writes a package\.json file with the options you've selected\. -.P -If you already have a package\.json file, it'll read that first, and default to -the options in there\. -.P -It is strictly additive, so it does not delete options from your package\.json -without a really good reason to do so\. -.P -Since this function expects to be run on the command\-line, it doesn't work very -well as a programmatically\. The best option is to roll your own, and since -JavaScript makes it stupid simple to output formatted JSON, that is the -preferred method\. If you're sure you want to handle command\-line prompting, -then go ahead and use this programmatically\. -.SH SEE ALSO -.P -npm help 5 package\.json - diff --git a/deps/npm/man/man3/npm-install.3 b/deps/npm/man/man3/npm-install.3 deleted file mode 100644 index 75397cdc95bff2..00000000000000 --- a/deps/npm/man/man3/npm-install.3 +++ /dev/null @@ -1,23 +0,0 @@ -.TH "NPM\-INSTALL" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-install\fR \- install a package programmatically -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.install([where,] packages, callback) -.fi -.RE -.SH DESCRIPTION -.P -This acts much the same ways as installing on the command\-line\. -.P -The 'where' parameter is optional and only used internally, and it specifies -where the packages should be installed to\. -.P -The 'packages' parameter is an array of strings\. Each element in the array is -the name of a package to be installed\. -.P -Finally, 'callback' is a function that will be called when all packages have been -installed or when an error has been encountered\. - diff --git a/deps/npm/man/man3/npm-link.3 b/deps/npm/man/man3/npm-link.3 deleted file mode 100644 index 2829bab6af0ed5..00000000000000 --- a/deps/npm/man/man3/npm-link.3 +++ /dev/null @@ -1,41 +0,0 @@ -.TH "NPM\-LINK" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-link\fR \- Symlink a package folder -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.link(callback) -npm\.commands\.link(packages, callback) -.fi -.RE -.SH DESCRIPTION -.P -Package linking is a two\-step process\. -.P -Without parameters, link will create a globally\-installed -symbolic link from \fBprefix/package\-name\fP to the current folder\. -.P -With a parameters, link will create a symlink from the local \fBnode_modules\fP -folder to the global symlink\. -.P -When creating tarballs for \fBnpm publish\fP, the linked packages are -"snapshotted" to their current state by resolving the symbolic links\. -.P -This is -handy for installing your own stuff, so that you can work on it and test it -iteratively without having to continually rebuild\. -.P -For example: -.P -.RS 2 -.nf -npm\.commands\.link(cb) # creates global link from the cwd - # (say redis package) -npm\.commands\.link('redis', cb) # link\-install the package -.fi -.RE -.P -Now, any changes to the redis package will be reflected in -the package in the current working directory - diff --git a/deps/npm/man/man3/npm-load.3 b/deps/npm/man/man3/npm-load.3 deleted file mode 100644 index dd0017ec748989..00000000000000 --- a/deps/npm/man/man3/npm-load.3 +++ /dev/null @@ -1,34 +0,0 @@ -.TH "NPM\-LOAD" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-load\fR \- Load config settings -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.load(conf, cb) -.fi -.RE -.SH DESCRIPTION -.P -npm\.load() must be called before any other function call\. Both parameters are -optional, but the second is recommended\. -.P -The first parameter is an object containing command\-line config params, and the -second parameter is a callback that will be called when npm is loaded and ready -to serve\. -.P -The first parameter should follow a similar structure as the package\.json -config object\. -.P -For example, to emulate the \-\-dev flag, pass an object that looks like this: -.P -.RS 2 -.nf -{ - "dev": true -} -.fi -.RE -.P -For a list of all the available command\-line configs, see \fBnpm help config\fP - diff --git a/deps/npm/man/man3/npm-ls.3 b/deps/npm/man/man3/npm-ls.3 deleted file mode 100644 index 3f998266170e32..00000000000000 --- a/deps/npm/man/man3/npm-ls.3 +++ /dev/null @@ -1,68 +0,0 @@ -.TH "NPM\-LS" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-ls\fR \- List installed packages -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.ls(args, [silent,] callback) -.fi -.RE -.SH DESCRIPTION -.P -This command will print to stdout all the versions of packages that are -installed, as well as their dependencies, in a tree\-structure\. It will also -return that data using the callback\. -.P -This command does not take any arguments, but args must be defined\. -Beyond that, if any arguments are passed in, npm will politely warn that it -does not take positional arguments, though you may set config flags -like with any other command, such as \fBglobal\fP to list global packages\. -.P -It will print out extraneous, missing, and invalid packages\. -.P -If the silent parameter is set to true, nothing will be output to the screen, -but the data will still be returned\. -.P -Callback is provided an error if one occurred, the full data about which -packages are installed and which dependencies they will receive, and a -"lite" data object which just shows which versions are installed where\. -Note that the full data object is a circular structure, so care must be -taken if it is serialized to JSON\. -.SH CONFIGURATION -.SS long -.RS 0 -.IP \(bu 2 -Default: false -.IP \(bu 2 -Type: Boolean - -.RE -.P -Show extended information\. -.SS parseable -.RS 0 -.IP \(bu 2 -Default: false -.IP \(bu 2 -Type: Boolean - -.RE -.P -Show parseable output instead of tree view\. -.SS global -.RS 0 -.IP \(bu 2 -Default: false -.IP \(bu 2 -Type: Boolean - -.RE -.P -List packages in the global install prefix instead of in the current -project\. -.P -Note, if parseable is set or long isn't set, then duplicates will be trimmed\. -This means that if a submodule has the same dependency as a parent module, then the -dependency will only be output once\. - diff --git a/deps/npm/man/man3/npm-outdated.3 b/deps/npm/man/man3/npm-outdated.3 deleted file mode 100644 index 09e51e92ef0309..00000000000000 --- a/deps/npm/man/man3/npm-outdated.3 +++ /dev/null @@ -1,17 +0,0 @@ -.TH "NPM\-OUTDATED" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-outdated\fR \- Check for outdated packages -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.outdated([packages,] callback) -.fi -.RE -.SH DESCRIPTION -.P -This command will check the registry to see if the specified packages are -currently outdated\. -.P -If the 'packages' parameter is left out, npm will check all packages\. - diff --git a/deps/npm/man/man3/npm-owner.3 b/deps/npm/man/man3/npm-owner.3 deleted file mode 100644 index d0b24cbd54e44a..00000000000000 --- a/deps/npm/man/man3/npm-owner.3 +++ /dev/null @@ -1,43 +0,0 @@ -.TH "NPM\-OWNER" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-owner\fR \- Manage package owners -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.owner(args, callback) -.fi -.RE -.SH DESCRIPTION -.P -The first element of the 'args' parameter defines what to do, and the subsequent -elements depend on the action\. Possible values for the action are (order of -parameters are given in parenthesis): -.RS 0 -.IP \(bu 2 -ls (package): -List all the users who have access to modify a package and push new versions\. -Handy when you need to know who to bug for help\. -.IP \(bu 2 -add (user, package): -Add a new user as a maintainer of a package\. This user is enabled to modify -metadata, publish new versions, and add other owners\. -.IP \(bu 2 -rm (user, package): -Remove a user from the package owner list\. This immediately revokes their -privileges\. - -.RE -.P -Note that there is only one level of access\. Either you can modify a package, -or you can't\. Future versions may contain more fine\-grained access levels, but -that is not implemented at this time\. -.SH SEE ALSO -.RS 0 -.IP \(bu 2 -npm apihelp publish -.IP \(bu 2 -npm help 7 registry - -.RE - diff --git a/deps/npm/man/man3/npm-pack.3 b/deps/npm/man/man3/npm-pack.3 deleted file mode 100644 index be86942dd4cd98..00000000000000 --- a/deps/npm/man/man3/npm-pack.3 +++ /dev/null @@ -1,23 +0,0 @@ -.TH "NPM\-PACK" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-pack\fR \- Create a tarball from a package -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.pack([packages,] callback) -.fi -.RE -.SH DESCRIPTION -.P -For anything that's installable (that is, a package folder, tarball, -tarball url, name@tag, name@version, or name), this command will fetch -it to the cache, and then copy the tarball to the current working -directory as \fB\-\.tgz\fP, and then write the filenames out to -stdout\. -.P -If the same package is specified multiple times, then the file will be -overwritten the second time\. -.P -If no arguments are supplied, then npm packs the current package folder\. - diff --git a/deps/npm/man/man3/npm-ping.3 b/deps/npm/man/man3/npm-ping.3 deleted file mode 100644 index 9963edd15d665b..00000000000000 --- a/deps/npm/man/man3/npm-ping.3 +++ /dev/null @@ -1,17 +0,0 @@ -.TH "NPM\-PING" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-ping\fR \- Ping npm registry -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.registry\.ping(registry, options, function (er, pong)) -.fi -.RE -.SH DESCRIPTION -.P -Attempts to connect to the given registry, returning a \fBpong\fP -object with various metadata if it succeeds\. -.P -This function is primarily useful for debugging connection issues -to npm registries\. diff --git a/deps/npm/man/man3/npm-prefix.3 b/deps/npm/man/man3/npm-prefix.3 deleted file mode 100644 index 33c118fc2fb6e3..00000000000000 --- a/deps/npm/man/man3/npm-prefix.3 +++ /dev/null @@ -1,19 +0,0 @@ -.TH "NPM\-PREFIX" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-prefix\fR \- Display prefix -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.prefix(args, callback) -.fi -.RE -.SH DESCRIPTION -.P -Print the prefix to standard out\. -.P -\|'args' is never used and callback is never called with data\. -\|'args' must be present or things will break\. -.P -This function is not useful programmatically - diff --git a/deps/npm/man/man3/npm-prune.3 b/deps/npm/man/man3/npm-prune.3 deleted file mode 100644 index 49f4d0ad650ca6..00000000000000 --- a/deps/npm/man/man3/npm-prune.3 +++ /dev/null @@ -1,21 +0,0 @@ -.TH "NPM\-PRUNE" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-prune\fR \- Remove extraneous packages -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.prune([packages,] callback) -.fi -.RE -.SH DESCRIPTION -.P -This command removes "extraneous" packages\. -.P -The first parameter is optional, and it specifies packages to be removed\. -.P -No packages are specified, then all packages will be checked\. -.P -Extraneous packages are packages that are not listed on the parent -package's dependencies list\. - diff --git a/deps/npm/man/man3/npm-publish.3 b/deps/npm/man/man3/npm-publish.3 deleted file mode 100644 index 5be59e838273ed..00000000000000 --- a/deps/npm/man/man3/npm-publish.3 +++ /dev/null @@ -1,41 +0,0 @@ -.TH "NPM\-PUBLISH" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-publish\fR \- Publish a package -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.publish([packages,] callback) -.fi -.RE -.SH DESCRIPTION -.P -Publishes a package to the registry so that it can be installed by name\. -Possible values in the 'packages' array are: -.RS 0 -.IP \(bu 2 -\fB\fP: -A folder containing a package\.json file -.IP \(bu 2 -\fB\fP: -A url or file path to a gzipped tar archive containing a single folder -with a package\.json file inside\. - -.RE -.P -If the package array is empty, npm will try to publish something in the -current working directory\. -.P -This command could fails if one of the packages specified already exists in -the registry\. Overwrites when the "force" environment variable is set\. -.SH SEE ALSO -.RS 0 -.IP \(bu 2 -npm help 7 registry -.IP \(bu 2 -npm help adduser -.IP \(bu 2 -npm apihelp owner - -.RE - diff --git a/deps/npm/man/man3/npm-rebuild.3 b/deps/npm/man/man3/npm-rebuild.3 deleted file mode 100644 index 714c5778b8f184..00000000000000 --- a/deps/npm/man/man3/npm-rebuild.3 +++ /dev/null @@ -1,19 +0,0 @@ -.TH "NPM\-REBUILD" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-rebuild\fR \- Rebuild a package -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.rebuild([packages,] callback) -.fi -.RE -.SH DESCRIPTION -.P -This command runs the \fBnpm build\fP command on each of the matched packages\. This is useful -when you install a new version of node, and must recompile all your C++ addons with -the new binary\. If no 'packages' parameter is specify, every package will be rebuilt\. -.SH CONFIGURATION -.P -See \fBnpm help build\fP - diff --git a/deps/npm/man/man3/npm-repo.3 b/deps/npm/man/man3/npm-repo.3 deleted file mode 100644 index dae556f6a92812..00000000000000 --- a/deps/npm/man/man3/npm-repo.3 +++ /dev/null @@ -1,23 +0,0 @@ -.TH "NPM\-REPO" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-repo\fR \- Open package repository page in the browser -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.repo(package, callback) -.fi -.RE -.SH DESCRIPTION -.P -This command tries to guess at the likely location of a package's -repository URL, and then tries to open it using the \fB\-\-browser\fP -config param\. -.P -Like other commands, the first parameter is an array\. This command only -uses the first element, which is expected to be a package name with an -optional version number\. -.P -This command will launch a browser, so this command may not be the most -friendly for programmatic use\. - diff --git a/deps/npm/man/man3/npm-restart.3 b/deps/npm/man/man3/npm-restart.3 deleted file mode 100644 index dad6281d126e8f..00000000000000 --- a/deps/npm/man/man3/npm-restart.3 +++ /dev/null @@ -1,58 +0,0 @@ -.TH "NPM\-RESTART" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-restart\fR \- Restart a package -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.restart(packages, callback) -.fi -.RE -.SH DESCRIPTION -.P -This restarts a package (or multiple packages)\. -.P -This runs a package's "stop", "restart", and "start" scripts, and associated -pre\- and post\- scripts, in the order given below: -.RS 0 -.IP 1. 3 -prerestart -.IP 2. 3 -prestop -.IP 3. 3 -stop -.IP 4. 3 -poststop -.IP 5. 3 -restart -.IP 6. 3 -prestart -.IP 7. 3 -start -.IP 8. 3 -poststart -.IP 9. 3 -postrestart - -.RE -.P -If no version is specified, then it restarts the "active" version\. -.P -npm can restart multiple packages\. Just specify multiple packages in -the \fBpackages\fP parameter\. -.SH NOTE -.P -Note that the "restart" script is run \fBin addition to\fR the "stop" -and "start" scripts, not instead of them\. -.P -This is the behavior as of \fBnpm\fP major version 2\. A change in this -behavior will be accompanied by an increase in major version number -.SH SEE ALSO -.RS 0 -.IP \(bu 2 -npm apihelp start -.IP \(bu 2 -npm apihelp stop - -.RE - diff --git a/deps/npm/man/man3/npm-root.3 b/deps/npm/man/man3/npm-root.3 deleted file mode 100644 index 3fd75ab7b16c51..00000000000000 --- a/deps/npm/man/man3/npm-root.3 +++ /dev/null @@ -1,19 +0,0 @@ -.TH "NPM\-ROOT" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-root\fR \- Display npm root -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.root(args, callback) -.fi -.RE -.SH DESCRIPTION -.P -Print the effective \fBnode_modules\fP folder to standard out\. -.P -\|'args' is never used and callback is never called with data\. -\|'args' must be present or things will break\. -.P -This function is not useful programmatically\. - diff --git a/deps/npm/man/man3/npm-run-script.3 b/deps/npm/man/man3/npm-run-script.3 deleted file mode 100644 index bc4508c0409221..00000000000000 --- a/deps/npm/man/man3/npm-run-script.3 +++ /dev/null @@ -1,37 +0,0 @@ -.TH "NPM\-RUN\-SCRIPT" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-run-script\fR \- Run arbitrary package scripts -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.run\-script(args, callback) -.fi -.RE -.SH DESCRIPTION -.P -This runs an arbitrary command from a package's "scripts" object\. -.P -It is used by the test, start, restart, and stop commands, but can be -called directly, as well\. -.P -The 'args' parameter is an array of strings\. Behavior depends on the number -of elements\. If there is only one element, npm assumes that the element -represents a command to be run on the local repository\. If there is more than -one element, then the first is assumed to be the package and the second is -assumed to be the command to run\. All other elements are ignored\. -.SH SEE ALSO -.RS 0 -.IP \(bu 2 -npm help 7 scripts -.IP \(bu 2 -npm apihelp test -.IP \(bu 2 -npm apihelp start -.IP \(bu 2 -npm apihelp restart -.IP \(bu 2 -npm apihelp stop - -.RE - diff --git a/deps/npm/man/man3/npm-search.3 b/deps/npm/man/man3/npm-search.3 deleted file mode 100644 index 85a9ede36c97c4..00000000000000 --- a/deps/npm/man/man3/npm-search.3 +++ /dev/null @@ -1,52 +0,0 @@ -.TH "NPM\-SEARCH" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-search\fR \- Search for packages -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.search(searchTerms, [silent,] [staleness,] callback) -.fi -.RE -.SH DESCRIPTION -.P -Search the registry for packages matching the search terms\. The available parameters are: -.RS 0 -.IP \(bu 2 -searchTerms: -Array of search terms\. These terms are case\-insensitive\. -.IP \(bu 2 -silent: -If true, npm will not log anything to the console\. -.IP \(bu 2 -staleness: -This is the threshold for stale packages\. "Fresh" packages are not refreshed -from the registry\. This value is measured in seconds\. -.IP \(bu 2 -callback: -Returns an object where each key is the name of a package, and the value -is information about that package along with a 'words' property, which is -a space\-delimited string of all of the interesting words in that package\. -The only properties included are those that are searched, which generally include: -.RS 0 -.IP \(bu 2 -name -.IP \(bu 2 -description -.IP \(bu 2 -maintainers -.IP \(bu 2 -url -.IP \(bu 2 -keywords - -.RE - -.RE -.P -A search on the registry excludes any result that does not match all of the -search terms\. It also removes any items from the results that contain an -excluded term (the "searchexclude" config)\. The search is case insensitive -and doesn't try to read your mind (it doesn't do any verb tense matching or the -like)\. - diff --git a/deps/npm/man/man3/npm-shrinkwrap.3 b/deps/npm/man/man3/npm-shrinkwrap.3 deleted file mode 100644 index 7211d969a67432..00000000000000 --- a/deps/npm/man/man3/npm-shrinkwrap.3 +++ /dev/null @@ -1,24 +0,0 @@ -.TH "NPM\-SHRINKWRAP" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-shrinkwrap\fR \- programmatically generate package shrinkwrap file -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.shrinkwrap(args, [silent,] callback) -.fi -.RE -.SH DESCRIPTION -.P -This acts much the same ways as shrinkwrapping on the command\-line\. -.P -This command does not take any arguments, but 'args' must be defined\. -Beyond that, if any arguments are passed in, npm will politely warn that it -does not take positional arguments\. -.P -If the 'silent' parameter is set to true, nothing will be output to the screen, -but the shrinkwrap file will still be written\. -.P -Finally, 'callback' is a function that will be called when the shrinkwrap has -been saved\. - diff --git a/deps/npm/man/man3/npm-start.3 b/deps/npm/man/man3/npm-start.3 deleted file mode 100644 index 7629bc9ee48094..00000000000000 --- a/deps/npm/man/man3/npm-start.3 +++ /dev/null @@ -1,17 +0,0 @@ -.TH "NPM\-START" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-start\fR \- Start a package -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.start(packages, callback) -.fi -.RE -.SH DESCRIPTION -.P -This runs a package's "start" script, if one was provided\. -.P -npm can start multiple packages\. Just specify multiple packages in the -\fBpackages\fP parameter\. - diff --git a/deps/npm/man/man3/npm-stop.3 b/deps/npm/man/man3/npm-stop.3 deleted file mode 100644 index 95f6e61542a34c..00000000000000 --- a/deps/npm/man/man3/npm-stop.3 +++ /dev/null @@ -1,17 +0,0 @@ -.TH "NPM\-STOP" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-stop\fR \- Stop a package -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.stop(packages, callback) -.fi -.RE -.SH DESCRIPTION -.P -This runs a package's "stop" script, if one was provided\. -.P -npm can run stop on multiple packages\. Just specify multiple packages -in the \fBpackages\fP parameter\. - diff --git a/deps/npm/man/man3/npm-tag.3 b/deps/npm/man/man3/npm-tag.3 deleted file mode 100644 index 643c57c9687663..00000000000000 --- a/deps/npm/man/man3/npm-tag.3 +++ /dev/null @@ -1,27 +0,0 @@ -.TH "NPM\-TAG" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-tag\fR \- Tag a published version -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.tag(package@version, tag, callback) -.fi -.RE -.SH DESCRIPTION -.P -Tags the specified version of the package with the specified tag, or the -\fB\-\-tag\fP config if not specified\. -.P -The 'package@version' is an array of strings, but only the first two elements are -currently used\. -.P -The first element must be in the form package@version, where package -is the package name and version is the version number (much like installing a -specific version)\. -.P -The second element is the name of the tag to tag this version with\. If this -parameter is missing or falsey (empty), the default from the config will be -used\. For more information about how to set this config, check -\fBman 3 npm\-config\fP for programmatic usage or \fBman npm\-config\fP for cli usage\. - diff --git a/deps/npm/man/man3/npm-test.3 b/deps/npm/man/man3/npm-test.3 deleted file mode 100644 index 5434f91e74af9d..00000000000000 --- a/deps/npm/man/man3/npm-test.3 +++ /dev/null @@ -1,20 +0,0 @@ -.TH "NPM\-TEST" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-test\fR \- Test a package -.SH SYNOPSIS -.P -.RS 2 -.nf - npm\.commands\.test(packages, callback) -.fi -.RE -.SH DESCRIPTION -.P -This runs a package's "test" script, if one was provided\. -.P -To run tests as a condition of installation, set the \fBnpat\fP config to -true\. -.P -npm can run tests on multiple packages\. Just specify multiple packages -in the \fBpackages\fP parameter\. - diff --git a/deps/npm/man/man3/npm-uninstall.3 b/deps/npm/man/man3/npm-uninstall.3 deleted file mode 100644 index 168df5f0eb9870..00000000000000 --- a/deps/npm/man/man3/npm-uninstall.3 +++ /dev/null @@ -1,20 +0,0 @@ -.TH "NPM\-UNINSTALL" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-uninstall\fR \- uninstall a package programmatically -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.uninstall(packages, callback) -.fi -.RE -.SH DESCRIPTION -.P -This acts much the same ways as uninstalling on the command\-line\. -.P -The 'packages' parameter is an array of strings\. Each element in the array is -the name of a package to be uninstalled\. -.P -Finally, 'callback' is a function that will be called when all packages have been -uninstalled or when an error has been encountered\. - diff --git a/deps/npm/man/man3/npm-unpublish.3 b/deps/npm/man/man3/npm-unpublish.3 deleted file mode 100644 index 1d10b121f3a8f0..00000000000000 --- a/deps/npm/man/man3/npm-unpublish.3 +++ /dev/null @@ -1,24 +0,0 @@ -.TH "NPM\-UNPUBLISH" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-unpublish\fR \- Remove a package from the registry -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.unpublish(package, callback) -.fi -.RE -.SH DESCRIPTION -.P -This removes a package version from the registry, deleting its -entry and removing the tarball\. -.P -The package parameter must be defined\. -.P -Only the first element in the package parameter is used\. If there is no first -element, then npm assumes that the package at the current working directory -is what is meant\. -.P -If no version is specified, or if all versions are removed then -the root package entry is removed from the registry entirely\. - diff --git a/deps/npm/man/man3/npm-update.3 b/deps/npm/man/man3/npm-update.3 deleted file mode 100644 index 2f67a13b9aa69c..00000000000000 --- a/deps/npm/man/man3/npm-update.3 +++ /dev/null @@ -1,26 +0,0 @@ -.TH "NPM\-UPDATE" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-update\fR \- Update a package -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.update(packages, callback) -.fi -.RE -.TH "DESCRIPTION" "" "October 2015" "" "" -.SH "NAME" -\fBDESCRIPTION\fR -.P -Updates a package, upgrading it to the latest version\. It also installs any -missing packages\. -.P -The \fBpackages\fP argument is an array of packages to update\. The \fBcallback\fP -parameter will be called when done or when an error occurs\. -.SH SEE ALSO -.RS 0 -.IP \(bu 2 -npm help update - -.RE - diff --git a/deps/npm/man/man3/npm-version.3 b/deps/npm/man/man3/npm-version.3 deleted file mode 100644 index 32d8ce6c8adaaa..00000000000000 --- a/deps/npm/man/man3/npm-version.3 +++ /dev/null @@ -1,22 +0,0 @@ -.TH "NPM\-VERSION" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-version\fR \- Bump a package version -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.version(newversion, callback) -.fi -.RE -.SH DESCRIPTION -.P -Run this in a package directory to bump the version and write the new -data back to the package\.json file\. -.P -If run in a git repo, it will also create a version commit and tag, and -fail if the repo is not clean\. -.P -Like all other commands, this function takes a string array as its first -parameter\. The difference, however, is this function will fail if it does -not have exactly one element\. The only element should be a version number\. - diff --git a/deps/npm/man/man3/npm-view.3 b/deps/npm/man/man3/npm-view.3 deleted file mode 100644 index 45ece20c3a4026..00000000000000 --- a/deps/npm/man/man3/npm-view.3 +++ /dev/null @@ -1,131 +0,0 @@ -.TH "NPM\-VIEW" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-view\fR \- View registry info -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.view(args, [silent,] callback) -.fi -.RE -.SH DESCRIPTION -.P -This command shows data about a package and prints it to the stream -referenced by the \fBoutfd\fP config, which defaults to stdout\. -.P -The "args" parameter is an ordered list that closely resembles the command\-line -usage\. The elements should be ordered such that the first element is -the package and version (package@version)\. The version is optional\. After that, -the rest of the parameters are fields with optional subfields ("field\.subfield") -which can be used to get only the information desired from the registry\. -.P -The callback will be passed all of the data returned by the query\. -.P -For example, to get the package registry entry for the \fBconnect\fP package, -you can do this: -.P -.RS 2 -.nf -npm\.commands\.view(["connect"], callback) -.fi -.RE -.P -If no version is specified, "latest" is assumed\. -.P -Field names can be specified after the package descriptor\. -For example, to show the dependencies of the \fBronn\fP package at version -0\.3\.5, you could do the following: -.P -.RS 2 -.nf -npm\.commands\.view(["ronn@0\.3\.5", "dependencies"], callback) -.fi -.RE -.P -You can view child field by separating them with a period\. -To view the git repository URL for the latest version of npm, you could -do this: -.P -.RS 2 -.nf -npm\.commands\.view(["npm", "repository\.url"], callback) -.fi -.RE -.P -For fields that are arrays, requesting a non\-numeric field will return -all of the values from the objects in the list\. For example, to get all -the contributor names for the "express" project, you can do this: -.P -.RS 2 -.nf -npm\.commands\.view(["express", "contributors\.email"], callback) -.fi -.RE -.P -You may also use numeric indices in square braces to specifically select -an item in an array field\. To just get the email address of the first -contributor in the list, you can do this: -.P -.RS 2 -.nf -npm\.commands\.view(["express", "contributors[0]\.email"], callback) -.fi -.RE -.P -Multiple fields may be specified, and will be printed one after another\. -For exampls, to get all the contributor names and email addresses, you -can do this: -.P -.RS 2 -.nf -npm\.commands\.view(["express", "contributors\.name", "contributors\.email"], callback) -.fi -.RE -.P -"Person" fields are shown as a string if they would be shown as an -object\. So, for example, this will show the list of npm contributors in -the shortened string format\. (See \fBnpm help json\fP for more on this\.) -.P -.RS 2 -.nf -npm\.commands\.view(["npm", "contributors"], callback) -.fi -.RE -.P -If a version range is provided, then data will be printed for every -matching version of the package\. This will show which version of jsdom -was required by each matching version of yui3: -.P -.RS 2 -.nf -npm\.commands\.view(["yui3@>0\.5\.4", "dependencies\.jsdom"], callback) -.fi -.RE -.SH OUTPUT -.P -If only a single string field for a single version is output, then it -will not be colorized or quoted, so as to enable piping the output to -another command\. -.P -If the version range matches multiple versions, than each printed value -will be prefixed with the version it applies to\. -.P -If multiple fields are requested, than each of them are prefixed with -the field name\. -.P -Console output can be disabled by setting the 'silent' parameter to true\. -.SH RETURN VALUE -.P -The data returned will be an object in this formation: -.P -.RS 2 -.nf -{ : - { : - , \.\.\. } -, \.\.\. } -.fi -.RE -.P -corresponding to the list of fields selected\. - diff --git a/deps/npm/man/man3/npm-whoami.3 b/deps/npm/man/man3/npm-whoami.3 deleted file mode 100644 index a580afe2e517b0..00000000000000 --- a/deps/npm/man/man3/npm-whoami.3 +++ /dev/null @@ -1,19 +0,0 @@ -.TH "NPM\-WHOAMI" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-whoami\fR \- Display npm username -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.whoami(args, callback) -.fi -.RE -.SH DESCRIPTION -.P -Print the \fBusername\fP config to standard output\. -.P -\|'args' is never used and callback is never called with data\. -\|'args' must be present or things will break\. -.P -This function is not useful programmatically - diff --git a/deps/npm/man/man3/npm.3 b/deps/npm/man/man3/npm.3 deleted file mode 100644 index 1cbe624eebfbea..00000000000000 --- a/deps/npm/man/man3/npm.3 +++ /dev/null @@ -1,124 +0,0 @@ -.TH "NPM" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm\fR \- javascript package manager -.SH SYNOPSIS -.P -.RS 2 -.nf -var npm = require("npm") -npm\.load([configObject, ]function (er, npm) { - // use the npm object, now that it's loaded\. - - npm\.config\.set(key, val) - val = npm\.config\.get(key) - - console\.log("prefix = %s", npm\.prefix) - - npm\.commands\.install(["package"], cb) -}) -.fi -.RE -.SH VERSION -.P -2.14.7 -.SH DESCRIPTION -.P -This is the API documentation for npm\. -To find documentation of the command line -client, see npm help \fBnpm\fP\|\. -.P -Prior to using npm's commands, \fBnpm\.load()\fP must be called\. If you provide -\fBconfigObject\fP as an object map of top\-level configs, they override the values -stored in the various config locations\. In the npm command line client, this -set of configs is parsed from the command line options\. Additional -configuration params are loaded from two configuration files\. See -npm help \fBnpm\-config\fP, npm help 7 \fBnpm\-config\fP, and npm help 5 \fBnpmrc\fP for more information\. -.P -After that, each of the functions are accessible in the -commands object: \fBnpm\.commands\.\fP\|\. See npm help 7 \fBnpm\-index\fP for a list of -all possible commands\. -.P -All commands on the command object take an \fBarray\fR of positional argument -\fBstrings\fR\|\. The last argument to any function is a callback\. Some -commands take other optional arguments\. -.P -Configs cannot currently be set on a per function basis, as each call to -npm\.config\.set will change the value for \fIall\fR npm commands in that process\. -.P -To find API documentation for a specific command, run the \fBnpm apihelp\fP -command\. -.SH METHODS AND PROPERTIES -.RS 0 -.IP \(bu 2 -\fBnpm\.load(configs, cb)\fP - Load the configuration params, and call the \fBcb\fP function once the - globalconfig and userconfig files have been loaded as well, or on - nextTick if they've already been loaded\. -.IP \(bu 2 -\fBnpm\.config\fP - An object for accessing npm configuration parameters\. -.RS 0 -.IP \(bu 2 -\fBnpm\.config\.get(key)\fP -.IP \(bu 2 -\fBnpm\.config\.set(key, val)\fP -.IP \(bu 2 -\fBnpm\.config\.del(key)\fP - -.RE -.IP \(bu 2 -\fBnpm\.dir\fP or \fBnpm\.root\fP - The \fBnode_modules\fP directory where npm will operate\. -.IP \(bu 2 -\fBnpm\.prefix\fP - The prefix where npm is operating\. (Most often the current working - directory\.) -.IP \(bu 2 -\fBnpm\.cache\fP - The place where npm keeps JSON and tarballs it fetches from the - registry (or uploads to the registry)\. -.IP \(bu 2 -\fBnpm\.tmp\fP - npm's temporary working directory\. -.IP \(bu 2 -\fBnpm\.deref\fP - Get the "real" name for a command that has either an alias or - abbreviation\. - -.RE -.SH MAGIC -.P -For each of the methods in the \fBnpm\.commands\fP object, a method is added to the -npm object, which takes a set of positional string arguments rather than an -array and a callback\. -.P -If the last argument is a callback, then it will use the supplied -callback\. However, if no callback is provided, then it will print out -the error or results\. -.P -For example, this would work in a node repl: -.P -.RS 2 -.nf -> npm = require("npm") -> npm\.load() // wait a sec\.\.\. -> npm\.install("dnode", "express") -.fi -.RE -.P -Note that that \fIwon't\fR work in a node program, since the \fBinstall\fP -method will get called before the configuration load is completed\. -.SH ABBREVS -.P -In order to support \fBnpm ins foo\fP instead of \fBnpm install foo\fP, the -\fBnpm\.commands\fP object has a set of abbreviations as well as the full -method names\. Use the \fBnpm\.deref\fP method to find the real name\. -.P -For example: -.P -.RS 2 -.nf -var cmd = npm\.deref("unp") // cmd === "unpublish" -.fi -.RE - diff --git a/deps/npm/man/man5/npm-folders.5 b/deps/npm/man/man5/npm-folders.5 index bdc08bb2db50f9..f4f37f0c22b2a7 100644 --- a/deps/npm/man/man5/npm-folders.5 +++ b/deps/npm/man/man5/npm-folders.5 @@ -1,4 +1,4 @@ -.TH "NPM\-FOLDERS" "5" "October 2015" "" "" +.TH "NPM\-FOLDERS" "5" "April 2016" "" "" .SH "NAME" \fBnpm-folders\fR \- Folder Structures Used by npm .SH DESCRIPTION @@ -25,12 +25,10 @@ If you need both, then install it in both places, or use \fBnpm link\fP\|\. .SS prefix Configuration .P The \fBprefix\fP config defaults to the location where node is installed\. -On most systems, this is \fB/usr/local\fP, and most of the time is the same -as node's \fBprocess\.installPrefix\fP\|\. -.P -On windows, this is the exact location of the node\.exe binary\. On Unix -systems, it's one level up, since node is typically installed at -\fB{prefix}/bin/node\fP rather than \fB{prefix}/node\.exe\fP\|\. +On most systems, this is \fB/usr/local\fP\|\. On windows, this is the exact +location of the node\.exe binary\. On Unix systems, it's one level up, +since node is typically installed at \fB{prefix}/bin/node\fP rather than +\fB{prefix}/node\.exe\fP\|\. .P When the \fBglobal\fP flag is set, npm installs things into this prefix\. When it is not set, it uses the root of the current package, or the @@ -49,7 +47,7 @@ Global installs on Windows go to \fB{prefix}/node_modules\fP (that is, no Scoped packages are installed the same way, except they are grouped together in a sub\-folder of the relevant \fBnode_modules\fP folder with the name of that scope prefix by the @ symbol, e\.g\. \fBnpm install @myorg/package\fP would place -the package in \fB{prefix}/node_modules/@myorg/package\fP\|\. See npm help 7 \fBscopes\fP for +the package in \fB{prefix}/node_modules/@myorg/package\fP\|\. See npm help 7 \fBscope\fP for more details\. .P If you wish to \fBrequire()\fP a package, then install it locally\. @@ -209,8 +207,6 @@ cannot be found elsewhere\. See npm help 5 \fBpackage\.json\fP for more informa .SH SEE ALSO .RS 0 .IP \(bu 2 -npm help 7 faq -.IP \(bu 2 npm help 5 package\.json .IP \(bu 2 npm help install diff --git a/deps/npm/man/man5/npm-global.5 b/deps/npm/man/man5/npm-global.5 index bdc08bb2db50f9..f4f37f0c22b2a7 100644 --- a/deps/npm/man/man5/npm-global.5 +++ b/deps/npm/man/man5/npm-global.5 @@ -1,4 +1,4 @@ -.TH "NPM\-FOLDERS" "5" "October 2015" "" "" +.TH "NPM\-FOLDERS" "5" "April 2016" "" "" .SH "NAME" \fBnpm-folders\fR \- Folder Structures Used by npm .SH DESCRIPTION @@ -25,12 +25,10 @@ If you need both, then install it in both places, or use \fBnpm link\fP\|\. .SS prefix Configuration .P The \fBprefix\fP config defaults to the location where node is installed\. -On most systems, this is \fB/usr/local\fP, and most of the time is the same -as node's \fBprocess\.installPrefix\fP\|\. -.P -On windows, this is the exact location of the node\.exe binary\. On Unix -systems, it's one level up, since node is typically installed at -\fB{prefix}/bin/node\fP rather than \fB{prefix}/node\.exe\fP\|\. +On most systems, this is \fB/usr/local\fP\|\. On windows, this is the exact +location of the node\.exe binary\. On Unix systems, it's one level up, +since node is typically installed at \fB{prefix}/bin/node\fP rather than +\fB{prefix}/node\.exe\fP\|\. .P When the \fBglobal\fP flag is set, npm installs things into this prefix\. When it is not set, it uses the root of the current package, or the @@ -49,7 +47,7 @@ Global installs on Windows go to \fB{prefix}/node_modules\fP (that is, no Scoped packages are installed the same way, except they are grouped together in a sub\-folder of the relevant \fBnode_modules\fP folder with the name of that scope prefix by the @ symbol, e\.g\. \fBnpm install @myorg/package\fP would place -the package in \fB{prefix}/node_modules/@myorg/package\fP\|\. See npm help 7 \fBscopes\fP for +the package in \fB{prefix}/node_modules/@myorg/package\fP\|\. See npm help 7 \fBscope\fP for more details\. .P If you wish to \fBrequire()\fP a package, then install it locally\. @@ -209,8 +207,6 @@ cannot be found elsewhere\. See npm help 5 \fBpackage\.json\fP for more informa .SH SEE ALSO .RS 0 .IP \(bu 2 -npm help 7 faq -.IP \(bu 2 npm help 5 package\.json .IP \(bu 2 npm help install diff --git a/deps/npm/man/man5/npm-json.5 b/deps/npm/man/man5/npm-json.5 index c41943c22da223..09689ad85bfd57 100644 --- a/deps/npm/man/man5/npm-json.5 +++ b/deps/npm/man/man5/npm-json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE\.JSON" "5" "October 2015" "" "" +.TH "PACKAGE\.JSON" "5" "April 2016" "" "" .SH "NAME" \fBpackage.json\fR \- Specifics of npm's package\.json handling .SH DESCRIPTION @@ -21,7 +21,7 @@ The name is what your thing is called\. Some rules: .RS 0 .IP \(bu 2 -The name must be shorter than 214 characters\. This includes the scope for +The name must be less than or equal to 214 characters\. This includes the scope for scoped packages\. .IP \(bu 2 The name can't start with a dot or an underscore\. @@ -118,10 +118,10 @@ current SPDX license identifier for the license you're using, like this: .P You can check the full list of SPDX license IDs \fIhttps://spdx\.org/licenses/\fR\|\. Ideally you should pick one that is -OSI \fIhttp://opensource\.org/licenses/alphabetical\fR approved\. +OSI \fIhttps://opensource\.org/licenses/alphabetical\fR approved\. .P If your package is licensed under multiple common licenses, use an SPDX license -expression syntax version 2\.0 string \fIhttp://npmjs\.com/package/spdx\fR, like this: +expression syntax version 2\.0 string \fIhttps://npmjs\.com/package/spdx\fR, like this: .P .RS 2 .nf @@ -130,7 +130,7 @@ expression syntax version 2\.0 string \fIhttp://npmjs\.com/package/spdx\fR, like .RE .P If you are using a license that hasn't been assigned an SPDX identifier, or if -you are using a custom license, use the following valid SPDX expression: +you are using a custom license, use a string value like this one: .P .RS 2 .nf @@ -227,14 +227,18 @@ Certain files are always included, regardless of settings: .IP \(bu 2 \fBpackage\.json\fP .IP \(bu 2 -\fBREADME\fP (and its variants) +\fBREADME\fP .IP \(bu 2 -\fBCHANGELOG\fP (and its variants) +\fBCHANGES\fP / \fBCHANGELOG\fP / \fBHISTORY\fP .IP \(bu 2 \fBLICENSE\fP / \fBLICENCE\fP +.IP \(bu 2 +The file in the "main" field .RE .P +\fBREADME\fP, \fBCHANGES\fP & \fBLICENSE\fP can have any case and extension\. +.P Conversely, some files are always ignored: .RS 0 .IP \(bu 2 @@ -250,13 +254,17 @@ Conversely, some files are always ignored: .IP \(bu 2 \fB\|\.wafpickle\-N\fP .IP \(bu 2 -\fB*\.swp\fP +\fB\|\.*\.swp\fP .IP \(bu 2 \fB\|\.DS_Store\fP .IP \(bu 2 \fB\|\._*\fP .IP \(bu 2 \fBnpm\-debug\.log\fP +.IP \(bu 2 +\fB\|\.npmrc\fP +.IP \(bu 2 +\fBnode_modules\fP .RE .SH main @@ -395,6 +403,10 @@ maybe, someday\. .SS directories\.example .P Put example scripts in here\. Someday, it might be exposed in some clever way\. +.SS directories\.test +.P +Put your tests in here\. It is currently not exposed, but it might be in the +future\. .SH repository .P Specify the place where your code lives\. This is helpful for people who @@ -506,7 +518,7 @@ See npm help 7 semver for more details about specifying version ranges\. .IP \(bu 2 \fBtag\fP A specific version tagged and published as \fBtag\fP See npm help \fBnpm\-tag\fP .IP \(bu 2 -\fBpath/path/path\fP See Local Paths below +\fBpath/path/path\fP See Local Paths \fI#local\-paths\fR below .RE .P @@ -574,8 +586,8 @@ included\. For example: .SH Local Paths .P As of version 2\.0\.0 you can provide a path to a local directory that contains a -package\. Local paths can be saved using \fBnpm install \-\-save\fP, using any of -these forms: +package\. Local paths can be saved using \fBnpm install \-S\fP or +\fBnpm install \-\-save\fP, using any of these forms: .P .RS 2 .nf @@ -692,7 +704,34 @@ with every 1\.x version of the host package, use \fB"^1\.0"\fP or \fB"1\.x"\fP t this\. If you depend on features introduced in 1\.5\.2, use \fB">= 1\.5\.2 < 2"\fP\|\. .SH bundledDependencies .P -Array of package names that will be bundled when publishing the package\. +This defines an array of package names that will be bundled when publishing +the package\. +.P +In cases where you need to preserve npm packages locally or have them +available through a single file download, you can bundle the packages in a +tarball file by specifying the package names in the \fBbundledDependencies\fP +array and executing \fBnpm pack\fP\|\. +.P +For example: +.P +If we define a package\.json like this: +.P +.RS 2 +.nf +{ + "name": "awesome\-web\-framework", + "version": "1\.0\.0", + "bundledDependencies": [ + 'renderized', 'super\-streams' + ] +} +.fi +.RE +.P +we can obtain \fBawesome\-web\-framework\-1\.0\.0\.tgz\fP file by running \fBnpm pack\fP\|\. +This file contains the dependencies \fBrenderized\fP and \fBsuper\-streams\fP which +can be installed in a new project by executing \fBnpm install +awesome\-web\-framework\-1\.0\.0\.tgz\fP\|\. .P If this is spelled \fB"bundleDependencies"\fP, then that is also honored\. .SH optionalDependencies @@ -754,21 +793,14 @@ are capable of properly installing your program\. For example: .fi .RE .P -Note that, unless the user has set the \fBengine\-strict\fP config flag, this -field is advisory only\. +Unless the user has set the \fBengine\-strict\fP config flag, this +field is advisory only will produce warnings when your package is installed as a dependency\. .SH engineStrict .P -\fBNOTE: This feature is deprecated and will be removed in npm 3\.0\.0\.\fR +\fBThis feature was deprecated with npm 3\.0\.0\fR .P -If you are sure that your module will \fIdefinitely not\fR run properly on -versions of Node/npm other than those specified in the \fBengines\fP object, -then you can set \fB"engineStrict": true\fP in your package\.json file\. -This will override the user's \fBengine\-strict\fP config setting\. -.P -Please do not do this unless you are really very very sure\. If your -engines object is something overly restrictive, you can quite easily and -inadvertently lock yourself into obscurity and prevent your users from -updating to new versions of Node\. Consider this choice carefully\. +Prior to npm 3\.0\.0, this feature was used to treat this package as if the +user had set \fBengine\-strict\fP\|\. .SH os .P You can specify which operating systems your @@ -878,13 +910,11 @@ npm help 7 config .IP \(bu 2 npm help help .IP \(bu 2 -npm help 7 faq -.IP \(bu 2 npm help install .IP \(bu 2 npm help publish .IP \(bu 2 -npm help rm +npm help uninstall .RE diff --git a/deps/npm/man/man5/npmrc.5 b/deps/npm/man/man5/npmrc.5 index 3c00980f3ac3a8..63054cde3c2e2f 100644 --- a/deps/npm/man/man5/npmrc.5 +++ b/deps/npm/man/man5/npmrc.5 @@ -1,4 +1,4 @@ -.TH "NPMRC" "5" "October 2015" "" "" +.TH "NPMRC" "5" "April 2016" "" "" .SH "NAME" \fBnpmrc\fR \- The npm config files .SH DESCRIPTION diff --git a/deps/npm/man/man5/package.json.5 b/deps/npm/man/man5/package.json.5 index c41943c22da223..09689ad85bfd57 100644 --- a/deps/npm/man/man5/package.json.5 +++ b/deps/npm/man/man5/package.json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE\.JSON" "5" "October 2015" "" "" +.TH "PACKAGE\.JSON" "5" "April 2016" "" "" .SH "NAME" \fBpackage.json\fR \- Specifics of npm's package\.json handling .SH DESCRIPTION @@ -21,7 +21,7 @@ The name is what your thing is called\. Some rules: .RS 0 .IP \(bu 2 -The name must be shorter than 214 characters\. This includes the scope for +The name must be less than or equal to 214 characters\. This includes the scope for scoped packages\. .IP \(bu 2 The name can't start with a dot or an underscore\. @@ -118,10 +118,10 @@ current SPDX license identifier for the license you're using, like this: .P You can check the full list of SPDX license IDs \fIhttps://spdx\.org/licenses/\fR\|\. Ideally you should pick one that is -OSI \fIhttp://opensource\.org/licenses/alphabetical\fR approved\. +OSI \fIhttps://opensource\.org/licenses/alphabetical\fR approved\. .P If your package is licensed under multiple common licenses, use an SPDX license -expression syntax version 2\.0 string \fIhttp://npmjs\.com/package/spdx\fR, like this: +expression syntax version 2\.0 string \fIhttps://npmjs\.com/package/spdx\fR, like this: .P .RS 2 .nf @@ -130,7 +130,7 @@ expression syntax version 2\.0 string \fIhttp://npmjs\.com/package/spdx\fR, like .RE .P If you are using a license that hasn't been assigned an SPDX identifier, or if -you are using a custom license, use the following valid SPDX expression: +you are using a custom license, use a string value like this one: .P .RS 2 .nf @@ -227,14 +227,18 @@ Certain files are always included, regardless of settings: .IP \(bu 2 \fBpackage\.json\fP .IP \(bu 2 -\fBREADME\fP (and its variants) +\fBREADME\fP .IP \(bu 2 -\fBCHANGELOG\fP (and its variants) +\fBCHANGES\fP / \fBCHANGELOG\fP / \fBHISTORY\fP .IP \(bu 2 \fBLICENSE\fP / \fBLICENCE\fP +.IP \(bu 2 +The file in the "main" field .RE .P +\fBREADME\fP, \fBCHANGES\fP & \fBLICENSE\fP can have any case and extension\. +.P Conversely, some files are always ignored: .RS 0 .IP \(bu 2 @@ -250,13 +254,17 @@ Conversely, some files are always ignored: .IP \(bu 2 \fB\|\.wafpickle\-N\fP .IP \(bu 2 -\fB*\.swp\fP +\fB\|\.*\.swp\fP .IP \(bu 2 \fB\|\.DS_Store\fP .IP \(bu 2 \fB\|\._*\fP .IP \(bu 2 \fBnpm\-debug\.log\fP +.IP \(bu 2 +\fB\|\.npmrc\fP +.IP \(bu 2 +\fBnode_modules\fP .RE .SH main @@ -395,6 +403,10 @@ maybe, someday\. .SS directories\.example .P Put example scripts in here\. Someday, it might be exposed in some clever way\. +.SS directories\.test +.P +Put your tests in here\. It is currently not exposed, but it might be in the +future\. .SH repository .P Specify the place where your code lives\. This is helpful for people who @@ -506,7 +518,7 @@ See npm help 7 semver for more details about specifying version ranges\. .IP \(bu 2 \fBtag\fP A specific version tagged and published as \fBtag\fP See npm help \fBnpm\-tag\fP .IP \(bu 2 -\fBpath/path/path\fP See Local Paths below +\fBpath/path/path\fP See Local Paths \fI#local\-paths\fR below .RE .P @@ -574,8 +586,8 @@ included\. For example: .SH Local Paths .P As of version 2\.0\.0 you can provide a path to a local directory that contains a -package\. Local paths can be saved using \fBnpm install \-\-save\fP, using any of -these forms: +package\. Local paths can be saved using \fBnpm install \-S\fP or +\fBnpm install \-\-save\fP, using any of these forms: .P .RS 2 .nf @@ -692,7 +704,34 @@ with every 1\.x version of the host package, use \fB"^1\.0"\fP or \fB"1\.x"\fP t this\. If you depend on features introduced in 1\.5\.2, use \fB">= 1\.5\.2 < 2"\fP\|\. .SH bundledDependencies .P -Array of package names that will be bundled when publishing the package\. +This defines an array of package names that will be bundled when publishing +the package\. +.P +In cases where you need to preserve npm packages locally or have them +available through a single file download, you can bundle the packages in a +tarball file by specifying the package names in the \fBbundledDependencies\fP +array and executing \fBnpm pack\fP\|\. +.P +For example: +.P +If we define a package\.json like this: +.P +.RS 2 +.nf +{ + "name": "awesome\-web\-framework", + "version": "1\.0\.0", + "bundledDependencies": [ + 'renderized', 'super\-streams' + ] +} +.fi +.RE +.P +we can obtain \fBawesome\-web\-framework\-1\.0\.0\.tgz\fP file by running \fBnpm pack\fP\|\. +This file contains the dependencies \fBrenderized\fP and \fBsuper\-streams\fP which +can be installed in a new project by executing \fBnpm install +awesome\-web\-framework\-1\.0\.0\.tgz\fP\|\. .P If this is spelled \fB"bundleDependencies"\fP, then that is also honored\. .SH optionalDependencies @@ -754,21 +793,14 @@ are capable of properly installing your program\. For example: .fi .RE .P -Note that, unless the user has set the \fBengine\-strict\fP config flag, this -field is advisory only\. +Unless the user has set the \fBengine\-strict\fP config flag, this +field is advisory only will produce warnings when your package is installed as a dependency\. .SH engineStrict .P -\fBNOTE: This feature is deprecated and will be removed in npm 3\.0\.0\.\fR +\fBThis feature was deprecated with npm 3\.0\.0\fR .P -If you are sure that your module will \fIdefinitely not\fR run properly on -versions of Node/npm other than those specified in the \fBengines\fP object, -then you can set \fB"engineStrict": true\fP in your package\.json file\. -This will override the user's \fBengine\-strict\fP config setting\. -.P -Please do not do this unless you are really very very sure\. If your -engines object is something overly restrictive, you can quite easily and -inadvertently lock yourself into obscurity and prevent your users from -updating to new versions of Node\. Consider this choice carefully\. +Prior to npm 3\.0\.0, this feature was used to treat this package as if the +user had set \fBengine\-strict\fP\|\. .SH os .P You can specify which operating systems your @@ -878,13 +910,11 @@ npm help 7 config .IP \(bu 2 npm help help .IP \(bu 2 -npm help 7 faq -.IP \(bu 2 npm help install .IP \(bu 2 npm help publish .IP \(bu 2 -npm help rm +npm help uninstall .RE diff --git a/deps/npm/man/man7/npm-coding-style.7 b/deps/npm/man/man7/npm-coding-style.7 index afed87ce6ba4ca..745ac94e2d317b 100644 --- a/deps/npm/man/man7/npm-coding-style.7 +++ b/deps/npm/man/man7/npm-coding-style.7 @@ -1,4 +1,4 @@ -.TH "NPM\-CODING\-STYLE" "7" "October 2015" "" "" +.TH "NPM\-CODING\-STYLE" "7" "April 2016" "" "" .SH "NAME" \fBnpm-coding-style\fR \- npm's "funny" coding style .SH DESCRIPTION @@ -76,7 +76,7 @@ Don't use them except in four situations: null loops like: \fBwhile (something) ;\fP (But you'd better have a good reason for doing that\.) .IP \(bu 2 -\fBcase "foo": doSomething(); break\fP +\fBcase 'foo': doSomething(); break\fP .IP \(bu 2 In front of a leading \fB(\fP or \fB[\fP at the start of the line\. This prevents the expression from being interpreted @@ -92,9 +92,9 @@ Some examples of good semicolon usage: ;[a, b, c]\.forEach(doSomething) for (var i = 0; i < 10; i ++) { switch (state) { - case "begin": start(); continue - case "end": finish(); break - default: throw new Error("unknown state") + case 'begin': start(); continue + case 'end': finish(); break + default: throw new Error('unknown state') } end() } @@ -112,19 +112,39 @@ final token in the list on a line by itself\. For example: .P .RS 2 .nf -var magicWords = [ "abracadabra" - , "gesundheit" - , "ventrilo" +var magicWords = [ 'abracadabra' + , 'gesundheit' + , 'ventrilo' ] - , spells = { "fireball" : function () { setOnFire() } - , "water" : function () { putOut() } + , spells = { 'fireball' : function () { setOnFire() } + , 'water' : function () { putOut() } } , a = 1 - , b = "abc" + , b = 'abc' , etc , somethingElse .fi .RE +.SH Quotes +.P +Use single quotes for strings except to avoid escaping\. +.P +Bad: +.P +.RS 2 +.nf +var notOk = "Just double quotes" +.fi +.RE +.P +Good: +.P +.RS 2 +.nf +var ok = 'String contains "double" quotes' +var alsoOk = "String contains 'single' quotes or apostrophe" +.fi +.RE .SH Whitespace .P Put a single space in front of ( for anything other than a function call\. @@ -196,8 +216,6 @@ Boolean objects are verboten\. .IP \(bu 2 npm help 7 developers .IP \(bu 2 -npm help 7 faq -.IP \(bu 2 npm help npm .RE diff --git a/deps/npm/man/man7/npm-config.7 b/deps/npm/man/man7/npm-config.7 index 6fa530413b75d1..3a4df5e5e02166 100644 --- a/deps/npm/man/man7/npm-config.7 +++ b/deps/npm/man/man7/npm-config.7 @@ -1,4 +1,4 @@ -.TH "NPM\-CONFIG" "7" "October 2015" "" "" +.TH "NPM\-CONFIG" "7" "April 2016" "" "" .SH "NAME" \fBnpm-config\fR \- More than you probably want to know about npm configuration .SH DESCRIPTION @@ -28,7 +28,7 @@ per\-project config file (/path/to/my/project/\.npmrc) .IP \(bu 2 per\-user config file (~/\.npmrc) .IP \(bu 2 -global config file ($PREFIX/npmrc) +global config file ($PREFIX/etc/npmrc) .IP \(bu 2 npm builtin config file (/path/to/npm/npmrc) @@ -37,8 +37,8 @@ npm builtin config file (/path/to/npm/npmrc) See npm help 5 npmrc for more details\. .SS Default Configs .P -A set of configuration parameters that are internal to npm, and are -defaults if nothing else is specified\. +Run \fBnpm config ls \-l\fP to see a set of configuration parameters that are +internal to npm, and are defaults if nothing else is specified\. .SH Shorthands and Other CLI Niceties .P The following shorthands are parsed on the command\-line: @@ -173,6 +173,17 @@ Type: Boolean .P Force npm to always require authentication when accessing the registry, even for \fBGET\fP requests\. +.SS also +.RS 0 +.IP \(bu 2 +Default: null +.IP \(bu 2 +Type: String + +.RE +.P +When "dev" or "development" and running local \fBnpm shrinkwrap\fP, +\fBnpm outdated\fP, or \fBnpm update\fP, is an alias for \fB\-\-dev\fP\|\. .SS bin\-links .RS 0 .IP \(bu 2 @@ -323,7 +334,7 @@ A client certificate to pass when accessing the registry\. .SS color .RS 0 .IP \(bu 2 -Default: true on Posix, false on Windows +Default: true .IP \(bu 2 Type: Boolean or \fB"always"\fP @@ -370,6 +381,20 @@ Install \fBdev\-dependencies\fP along with packages\. .P Note that \fBdev\-dependencies\fP are also installed if the \fBnpat\fP flag is set\. +.SS dry\-run +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Indicates that you don't want npm to make any changes and that it should +only report what it would have done\. This can be passed into any of the +commands that modify your local installation, eg, \fBinstall\fP, \fBupdate\fP, +\fBdedupe\fP, \fBuninstall\fP\|\. This is NOT currently honored by network related +commands, eg \fBdist\-tags\fP, \fBowner\fP, \fBpublish\fP, etc\. .SS editor .RS 0 .IP \(bu 2 @@ -512,6 +537,21 @@ Type: path .RE .P The config file to read for global config options\. +.SS global\-style +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Causes npm to install the package into your local \fBnode_modules\fP folder with +the same layout it uses with the global \fBnode_modules\fP folder\. Only your +direct dependencies will show in \fBnode_modules\fP and everything they depend +on will be flattened in their \fBnode_modules\fP folders\. This obviously will +eliminate some deduping\. If used with \fBlegacy\-bundling\fP, \fBlegacy\-bundling\fP will be +preferred\. .SS group .RS 0 .IP \(bu 2 @@ -657,6 +697,19 @@ Type: String .RE .P A client key to pass when accessing the registry\. +.SS legacy\-bundling +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Causes npm to install the package such that versions of npm prior to 1\.4, +such as the one included with node 0\.8, can install the package\. This +eliminates all automatic deduping\. If used with \fBglobal\-style\fP this option +will be preferred\. .SS link .RS 0 .IP \(bu 2 @@ -735,6 +788,17 @@ Type: Boolean .RE .P Show extended information in \fBnpm ls\fP and \fBnpm search\fP\|\. +.SS maxsockets +.RS 0 +.IP \(bu 2 +Default: 50 +.IP \(bu 2 +Type: Number + +.RE +.P +The maximum number of connections to use per origin (protocol/host/port +combination)\. Passed to the \fBhttp\fP \fBAgent\fP used to make the request\. .SS message .RS 0 .IP \(bu 2 @@ -778,6 +842,27 @@ Type: path .P A node module to \fBrequire()\fP when npm loads\. Useful for programmatic usage\. +.SS only +.RS 0 +.IP \(bu 2 +Default: null +.IP \(bu 2 +Type: String + +.RE +.P +When "dev" or "development" and running local \fBnpm install\fP without any +arguments, only devDependencies (and their dependencies) are installed\. +.P +When "dev" or "development" and running local \fBnpm ls\fP, \fBnpm outdated\fP, or +\fBnpm update\fP, is an alias for \fB\-\-dev\fP\|\. +.P +When "prod" or "production" and running local \fBnpm install\fP without any +arguments, only non\-devDependencies (and their dependencies) are +installed\. +.P +When "prod" or "production" and running local \fBnpm ls\fP, \fBnpm outdated\fP, or +\fBnpm update\fP, is an alias for \fB\-\-production\fP\|\. .SS optional .RS 0 .IP \(bu 2 @@ -830,6 +915,19 @@ local \fBnpm install\fP without any arguments\. Set the NODE_ENV="production" for lifecycle scripts\. .RE +.SS progress +.RS 0 +.IP \(bu 2 +Default: true +.IP \(bu 2 +Type: Boolean + +.RE +.P +When set to \fBtrue\fP, npm will display a progress bar during time intensive +operations, if \fBprocess\.stderr\fP is a TTY\. +.P +Set to \fBfalse\fP to suppress the progress bar\. .SS proprietary\-attribs .RS 0 .IP \(bu 2 @@ -1060,20 +1158,6 @@ using \fB\-s\fP to add a signature\. .P Note that git requires you to have set up GPG keys in your git configs for this to work properly\. -.SS spin -.RS 0 -.IP \(bu 2 -Default: true -.IP \(bu 2 -Type: Boolean or \fB"always"\fP - -.RE -.P -When set to \fBtrue\fP, npm will display an ascii spinner while it is doing -things, if \fBprocess\.stderr\fP is a TTY\. -.P -Set to \fBfalse\fP to suppress the spinner, or set to \fBalways\fP to output -the spinner even for non\-TTY outputs\. .SS strict\-ssl .RS 0 .IP \(bu 2 @@ -1131,7 +1215,7 @@ on success, but left behind on failure for forensic purposes\. .SS unicode .RS 0 .IP \(bu 2 -Default: true +Default: false on windows, true on mac/unix systems with a unicode locale .IP \(bu 2 Type: Boolean diff --git a/deps/npm/man/man7/npm-developers.7 b/deps/npm/man/man7/npm-developers.7 index 80c6e6e8aba370..3d9247ac04bc1e 100644 --- a/deps/npm/man/man7/npm-developers.7 +++ b/deps/npm/man/man7/npm-developers.7 @@ -1,4 +1,4 @@ -.TH "NPM\-DEVELOPERS" "7" "October 2015" "" "" +.TH "NPM\-DEVELOPERS" "7" "April 2016" "" "" .SH "NAME" \fBnpm-developers\fR \- Developer Guide .SH DESCRIPTION @@ -114,7 +114,7 @@ create an empty \fB\|\.npmignore\fP file to override it\. Like \fBgit\fP, \fBnpm for \fB\|\.npmignore\fP and \fB\|\.gitignore\fP files in all subdirectories of your package, not only the root directory\. .P -\fB\|\.npmignore\fP files follow the same pattern rules \fIhttp://git\-scm\.com/book/en/v2/Git\-Basics\-Recording\-Changes\-to\-the\-Repository#Ignoring\-Files\fR +\fB\|\.npmignore\fP files follow the same pattern rules \fIhttps://git\-scm\.com/book/en/v2/Git\-Basics\-Recording\-Changes\-to\-the\-Repository#Ignoring\-Files\fR as \fB\|\.gitignore\fP files: .RS 0 .IP \(bu 2 @@ -239,7 +239,7 @@ and then follow the prompts\. This is documented better in npm help adduser\. .SH Publish your package .P -This part's easy\. IN the root of your folder, do this: +This part's easy\. In the root of your folder, do this: .P .RS 2 .nf @@ -262,8 +262,6 @@ Tell the world how easy it is to install your program! .SH SEE ALSO .RS 0 .IP \(bu 2 -npm help 7 faq -.IP \(bu 2 npm help npm .IP \(bu 2 npm help init diff --git a/deps/npm/man/man7/npm-disputes.7 b/deps/npm/man/man7/npm-disputes.7 index 6deead895a42de..385921c79cb06b 100644 --- a/deps/npm/man/man7/npm-disputes.7 +++ b/deps/npm/man/man7/npm-disputes.7 @@ -1,4 +1,4 @@ -.TH "NPM\-DISPUTES" "7" "October 2015" "" "" +.TH "NPM\-DISPUTES" "7" "April 2016" "" "" .SH "NAME" \fBnpm-disputes\fR \- Handling Module Name Disputes .SH SYNOPSIS diff --git a/deps/npm/man/man7/npm-faq.7 b/deps/npm/man/man7/npm-faq.7 deleted file mode 100644 index ba392cd67e854c..00000000000000 --- a/deps/npm/man/man7/npm-faq.7 +++ /dev/null @@ -1,429 +0,0 @@ -.TH "NPM\-FAQ" "7" "October 2015" "" "" -.SH "NAME" -\fBnpm-faq\fR \- Frequently Asked Questions -.SH Where can I find these docs in HTML? -.P -https://docs\.npmjs\.com/, or run: -.P -.RS 2 -.nf -npm config set viewer browser -.fi -.RE -.P -to open these documents in your default web browser rather than \fBman\fP\|\. -.SH It didn't work\. -.P -That's not really a question\. -.SH Why didn't it work? -.P -I don't know yet\. -.P -Read the error output, and if you can't figure out what it means, -do what it says and post a bug with all the information it asks for\. -.SH Where does npm put stuff? -.P -See npm help 5 \fBnpm\-folders\fP -.P -tl;dr: -.RS 0 -.IP \(bu 2 -Use the \fBnpm root\fP command to see where modules go, and the \fBnpm bin\fP -command to see where executables go -.IP \(bu 2 -Global installs are different from local installs\. If you install -something with the \fB\-g\fP flag, then its executables go in \fBnpm bin \-g\fP -and its modules go in \fBnpm root \-g\fP\|\. - -.RE -.SH How do I install something on my computer in a central location? -.P -Install it globally by tacking \fB\-g\fP or \fB\-\-global\fP to the command\. (This -is especially important for command line utilities that need to add -their bins to the global system \fBPATH\fP\|\.) -.SH I installed something globally, but I can't \fBrequire()\fP it -.P -Install it locally\. -.P -The global install location is a place for command\-line utilities -to put their bins in the system \fBPATH\fP\|\. It's not for use with \fBrequire()\fP\|\. -.P -If you \fBrequire()\fP a module in your code, then that means it's a -dependency, and a part of your program\. You need to install it locally -in your program\. -.SH Why can't npm just put everything in one place, like other package managers? -.P -Not every change is an improvement, but every improvement is a change\. -This would be like asking git to do network IO for every commit\. It's -not going to happen, because it's a terrible idea that causes more -problems than it solves\. -.P -It is much harder to avoid dependency conflicts without nesting -dependencies\. This is fundamental to the way that npm works, and has -proven to be an extremely successful approach\. See npm help 5 \fBnpm\-folders\fP for -more details\. -.P -If you want a package to be installed in one place, and have all your -programs reference the same copy of it, then use the \fBnpm link\fP command\. -That's what it's for\. Install it globally, then link it into each -program that uses it\. -.SH Whatever, I really want the old style 'everything global' style\. -.P -Write your own package manager\. You could probably even wrap up \fBnpm\fP -in a shell script if you really wanted to\. -.P -npm will not help you do something that is known to be a bad idea\. -.SH Should I check my \fBnode_modules\fP folder into git? -.P -Usually, no\. Allow npm to resolve dependencies for your packages\. -.P -For packages you \fBdeploy\fR, such as websites and apps, -you should use npm shrinkwrap to lock down your full dependency tree: -.P -https://docs\.npmjs\.com/cli/shrinkwrap -.P -If you are paranoid about depending on the npm ecosystem, -you should run a private npm mirror or a private cache\. -.P -If you want 100% confidence in being able to reproduce the specific bytes -included in a deployment, you should use an additional mechanism that can -verify contents rather than versions\. For example, -Amazon machine images, DigitalOcean snapshots, Heroku slugs, or simple tarballs\. -.SH Is it 'npm' or 'NPM' or 'Npm'? -.P -npm should never be capitalized unless it is being displayed in a -location that is customarily all\-caps (such as the title of man pages\.) -.SH If 'npm' is an acronym, why is it never capitalized? -.P -Contrary to the belief of many, "npm" is not in fact an abbreviation for -"Node Package Manager"\. It is a recursive bacronymic abbreviation for -"npm is not an acronym"\. (If it was "ninaa", then it would be an -acronym, and thus incorrectly named\.) -.P -"NPM", however, \fIis\fR an acronym (more precisely, a capitonym) for the -National Association of Pastoral Musicians\. You can learn more -about them at http://npm\.org/\|\. -.P -In software, "NPM" is a Non\-Parametric Mapping utility written by -Chris Rorden\. You can analyze pictures of brains with it\. Learn more -about the (capitalized) NPM program at http://www\.cabiatl\.com/mricro/npm/\|\. -.P -The first seed that eventually grew into this flower was a bash utility -named "pm", which was a shortened descendent of "pkgmakeinst", a -bash function that was used to install various different things on different -platforms, most often using Yahoo's \fByinst\fP\|\. If \fBnpm\fP was ever an -acronym for anything, it was \fBnode pm\fP or maybe \fBnew pm\fP\|\. -.P -So, in all seriousness, the "npm" project is named after its command\-line -utility, which was organically selected to be easily typed by a right\-handed -programmer using a US QWERTY keyboard layout, ending with the -right\-ring\-finger in a postition to type the \fB\-\fP key for flags and -other command\-line arguments\. That command\-line utility is always -lower\-case, though it starts most sentences it is a part of\. -.SH How do I list installed packages? -.P -\fBnpm ls\fP -.SH How do I search for packages? -.P -\fBnpm search\fP -.P -Arguments are greps\. \fBnpm search jsdom\fP shows jsdom packages\. -.SH How do I update npm? -.P -.RS 2 -.nf -npm install npm \-g -.fi -.RE -.P -You can also update all outdated local packages by doing \fBnpm update\fP without -any arguments, or global packages by doing \fBnpm update \-g\fP\|\. -.P -Occasionally, the version of npm will progress such that the current -version cannot be properly installed with the version that you have -installed already\. (Consider, if there is ever a bug in the \fBupdate\fP -command\.) -.P -In those cases, you can do this: -.P -.RS 2 -.nf -curl https://www\.npmjs\.com/install\.sh | sh -.fi -.RE -.SH What is a \fBpackage\fP? -.P -A package is: -.RS 0 -.IP \(bu 2 -a) a folder containing a program described by a package\.json file -.IP \(bu 2 -b) a gzipped tarball containing (a) -.IP \(bu 2 -c) a url that resolves to (b) -.IP \(bu 2 -d) a \fB@\fP that is published on the registry with (c) -.IP \(bu 2 -e) a \fB@\fP that points to (d) -.IP \(bu 2 -f) a \fB\fP that has a "latest" tag satisfying (e) -.IP \(bu 2 -g) a \fBgit\fP url that, when cloned, results in (a)\. - -.RE -.P -Even if you never publish your package, you can still get a lot of -benefits of using npm if you just want to write a node program (a), and -perhaps if you also want to be able to easily install it elsewhere -after packing it up into a tarball (b)\. -.P -Git urls can be of the form: -.P -.RS 2 -.nf -git://github\.com/user/project\.git#commit\-ish -git+ssh://user@hostname:project\.git#commit\-ish -git+http://user@hostname/project/blah\.git#commit\-ish -git+https://user@hostname/project/blah\.git#commit\-ish -.fi -.RE -.P -The \fBcommit\-ish\fP can be any tag, sha, or branch which can be supplied as -an argument to \fBgit checkout\fP\|\. The default is \fBmaster\fP\|\. -.SH What is a \fBmodule\fP? -.P -A module is anything that can be loaded with \fBrequire()\fP in a Node\.js -program\. The following things are all examples of things that can be -loaded as modules: -.RS 0 -.IP \(bu 2 -A folder with a \fBpackage\.json\fP file containing a \fBmain\fP field\. -.IP \(bu 2 -A folder with an \fBindex\.js\fP file in it\. -.IP \(bu 2 -A JavaScript file\. - -.RE -.P -Most npm packages are modules, because they are libraries that you -load with \fBrequire\fP\|\. However, there's no requirement that an npm -package be a module! Some only contain an executable command\-line -interface, and don't provide a \fBmain\fP field for use in Node programs\. -.P -Almost all npm packages (at least, those that are Node programs) -\fIcontain\fR many modules within them (because every file they load with -\fBrequire()\fP is a module)\. -.P -In the context of a Node program, the \fBmodule\fP is also the thing that -was loaded \fIfrom\fR a file\. For example, in the following program: -.P -.RS 2 -.nf -var req = require('request') -.fi -.RE -.P -we might say that "The variable \fBreq\fP refers to the \fBrequest\fP module"\. -.SH So, why is it the "\fBnode_modules\fP" folder, but "\fBpackage\.json\fP" file? Why not \fBnode_packages\fP or \fBmodule\.json\fP? -.P -The \fBpackage\.json\fP file defines the package\. (See "What is a -package?" above\.) -.P -The \fBnode_modules\fP folder is the place Node\.js looks for modules\. -(See "What is a module?" above\.) -.P -For example, if you create a file at \fBnode_modules/foo\.js\fP and then -had a program that did \fBvar f = require('foo\.js')\fP then it would load -the module\. However, \fBfoo\.js\fP is not a "package" in this case, -because it does not have a package\.json\. -.P -Alternatively, if you create a package which does not have an -\fBindex\.js\fP or a \fB"main"\fP field in the \fBpackage\.json\fP file, then it is -not a module\. Even if it's installed in \fBnode_modules\fP, it can't be -an argument to \fBrequire()\fP\|\. -.SH \fB"node_modules"\fP is the name of my deity's arch\-rival, and a Forbidden Word in my religion\. Can I configure npm to use a different folder? -.P -No\. This will never happen\. This question comes up sometimes, -because it seems silly from the outside that npm couldn't just be -configured to put stuff somewhere else, and then npm could load them -from there\. It's an arbitrary spelling choice, right? What's the big -deal? -.P -At the time of this writing, the string \fB\|'node_modules'\fP appears 151 -times in 53 separate files in npm and node core (excluding tests and -documentation)\. -.P -Some of these references are in node's built\-in module loader\. Since -npm is not involved \fBat all\fR at run\-time, node itself would have to -be configured to know where you've decided to stick stuff\. Complexity -hurdle #1\. Since the Node module system is locked, this cannot be -changed, and is enough to kill this request\. But I'll continue, in -deference to your deity's delicate feelings regarding spelling\. -.P -Many of the others are in dependencies that npm uses, which are not -necessarily tightly coupled to npm (in the sense that they do not read -npm's configuration files, etc\.) Each of these would have to be -configured to take the name of the \fBnode_modules\fP folder as a -parameter\. Complexity hurdle #2\. -.P -Furthermore, npm has the ability to "bundle" dependencies by adding -the dep names to the \fB"bundledDependencies"\fP list in package\.json, -which causes the folder to be included in the package tarball\. What -if the author of a module bundles its dependencies, and they use a -different spelling for \fBnode_modules\fP? npm would have to rename the -folder at publish time, and then be smart enough to unpack it using -your locally configured name\. Complexity hurdle #3\. -.P -Furthermore, what happens when you \fIchange\fR this name? Fine, it's -easy enough the first time, just rename the \fBnode_modules\fP folders to -\fB\|\./blergyblerp/\fP or whatever name you choose\. But what about when you -change it again? npm doesn't currently track any state about past -configuration settings, so this would be rather difficult to do -properly\. It would have to track every previous value for this -config, and always accept any of them, or else yesterday's install may -be broken tomorrow\. Complexity hurdle #4\. -.P -Never going to happen\. The folder is named \fBnode_modules\fP\|\. It is -written indelibly in the Node Way, handed down from the ancient times -of Node 0\.3\. -.SH How do I install node with npm? -.P -You don't\. Try one of these node version managers: -.P -Unix: -.RS 0 -.IP \(bu 2 -http://github\.com/isaacs/nave -.IP \(bu 2 -http://github\.com/visionmedia/n -.IP \(bu 2 -http://github\.com/creationix/nvm - -.RE -.P -Windows: -.RS 0 -.IP \(bu 2 -http://github\.com/marcelklehr/nodist -.IP \(bu 2 -https://github\.com/coreybutler/nvm\-windows -.IP \(bu 2 -https://github\.com/hakobera/nvmw -.IP \(bu 2 -https://github\.com/nanjingboy/nvmw - -.RE -.SH How can I use npm for development? -.P -See npm help 7 \fBnpm\-developers\fP and npm help 5 \fBpackage\.json\fP\|\. -.P -You'll most likely want to \fBnpm link\fP your development folder\. That's -awesomely handy\. -.P -To set up your own private registry, check out npm help 7 \fBnpm\-registry\fP\|\. -.SH Can I list a url as a dependency? -.P -Yes\. It should be a url to a gzipped tarball containing a single folder -that has a package\.json in its root, or a git url\. -(See "what is a package?" above\.) -.SH How do I symlink to a dev folder so I don't have to keep re\-installing? -.P -See npm help \fBnpm\-link\fP -.SH The package registry website\. What is that exactly? -.P -See npm help 7 \fBnpm\-registry\fP\|\. -.SH I forgot my password, and can't publish\. How do I reset it? -.P -Go to https://npmjs\.com/forgot\|\. -.SH I get ECONNREFUSED a lot\. What's up? -.P -Either the registry is down, or node's DNS isn't able to reach out\. -.P -To check if the registry is down, open up -https://registry\.npmjs\.org/ in a web browser\. This will also tell -you if you are just unable to access the internet for some reason\. -.P -If the registry IS down, let us know by emailing support@npmjs\.com -or posting an issue at https://github\.com/npm/npm/issues\|\. If it's -down for the world (and not just on your local network) then we're -probably already being pinged about it\. -.P -You can also often get a faster response by visiting the #npm channel -on Freenode IRC\. -.SH Why no namespaces? -.P -npm has only one global namespace\. If you want to namespace your own packages, -you may: simply use the \fB\-\fP character to separate the names or use scoped -packages\. npm is a mostly anarchic system\. There is not sufficient need to -impose namespace rules on everyone\. -.P -As of 2\.0, npm supports scoped packages, which allow you to publish a group of -related modules without worrying about name collisions\. -.P -Every npm user owns the scope associated with their username\. For example, the -user named \fBnpm\fP owns the scope \fB@npm\fP\|\. Scoped packages are published inside a -scope by naming them as if they were files under the scope directory, e\.g\., by -setting \fBname\fP in \fBpackage\.json\fP to \fB@npm/npm\fP\|\. -.P -Scoped packages are supported by the public npm registry\. The npm client is -backwards\-compatible with un\-scoped registries, so it can be used to work with -scoped and un\-scoped registries at the same time\. -.P -Unscoped packages can only depend on other unscoped packages\. Scoped packages -can depend on packages from their own scope, a different scope, or the public -registry (unscoped)\. -.P -For the current documentation of scoped packages, see -https://docs\.npmjs\.com/misc/scope -.P -References: -.RS 0 -.IP 1. 3 -For the reasoning behind the "one global namespace", please see this -discussion: https://github\.com/npm/npm/issues/798 (TL;DR: It doesn't -actually make things better, and can make them worse\.) -.IP 2. 3 -For the pre\-implementation discussion of the scoped package feature, see -this discussion: https://github\.com/npm/npm/issues/5239 - -.RE -.SH Who does npm? -.P -npm was originally written by Isaac Z\. Schlueter, and many others have -contributed to it, some of them quite substantially\. -.P -The npm open source project, The npm Registry, and the community -website \fIhttps://www\.npmjs\.com\fR are maintained and operated by the -good folks at npm, Inc\. \fIhttp://www\.npmjs\.com\fR -.SH I have a question or request not addressed here\. Where should I put it? -.P -Post an issue on the github project: -.RS 0 -.IP \(bu 2 -https://github\.com/npm/npm/issues - -.RE -.SH Why does npm hate me? -.P -npm is not capable of hatred\. It loves everyone, especially you\. -.SH SEE ALSO -.RS 0 -.IP \(bu 2 -npm help npm -.IP \(bu 2 -npm help 7 developers -.IP \(bu 2 -npm help 5 package\.json -.IP \(bu 2 -npm help config -.IP \(bu 2 -npm help 7 config -.IP \(bu 2 -npm help 5 npmrc -.IP \(bu 2 -npm help 7 config -.IP \(bu 2 -npm help 5 folders - -.RE - diff --git a/deps/npm/man/man7/npm-index.7 b/deps/npm/man/man7/npm-index.7 index 4ab8ccd28afe77..17b6fa7777978d 100644 --- a/deps/npm/man/man7/npm-index.7 +++ b/deps/npm/man/man7/npm-index.7 @@ -1,4 +1,4 @@ -.TH "NPM\-INDEX" "7" "October 2015" "" "" +.TH "NPM\-INDEX" "7" "April 2016" "" "" .SH "NAME" \fBnpm-index\fR \- Index of all npm documentation .SS npm help README @@ -64,6 +64,9 @@ Get help on npm .SS npm help init .P Interactively create a package\.json file +.SS npm help install\-test +.P +Install package(s) and run tests .SS npm help install .P Install a package @@ -106,9 +109,6 @@ Open package repository page in the browser .SS npm help restart .P Restart a package -.SS npm help rm -.P -Remove a package .SS npm help root .P Display npm root @@ -163,126 +163,6 @@ Display npm username .SH API Documentation .P Using npm in your Node programs -.SS npm apihelp npm -.P -javascript package manager -.SS npm apihelp bin -.P -Display npm bin folder -.SS npm apihelp bugs -.P -Bugs for a package in a web browser maybe -.SS npm apihelp cache -.P -manage the npm cache programmatically -.SS npm apihelp commands -.P -npm commands -.SS npm apihelp config -.P -Manage the npm configuration files -.SS npm apihelp deprecate -.P -Deprecate a version of a package -.SS npm apihelp docs -.P -Docs for a package in a web browser maybe -.SS npm apihelp edit -.P -Edit an installed package -.SS npm apihelp explore -.P -Browse an installed package -.SS npm apihelp help\-search -.P -Search the help pages -.SS npm apihelp init -.P -Interactively create a package\.json file -.SS npm apihelp install -.P -install a package programmatically -.SS npm apihelp link -.P -Symlink a package folder -.SS npm apihelp load -.P -Load config settings -.SS npm apihelp ls -.P -List installed packages -.SS npm apihelp outdated -.P -Check for outdated packages -.SS npm apihelp owner -.P -Manage package owners -.SS npm apihelp pack -.P -Create a tarball from a package -.SS npm apihelp ping -.P -Ping npm registry -.SS npm apihelp prefix -.P -Display prefix -.SS npm apihelp prune -.P -Remove extraneous packages -.SS npm apihelp publish -.P -Publish a package -.SS npm apihelp rebuild -.P -Rebuild a package -.SS npm apihelp repo -.P -Open package repository page in the browser -.SS npm apihelp restart -.P -Restart a package -.SS npm apihelp root -.P -Display npm root -.SS npm apihelp run\-script -.P -Run arbitrary package scripts -.SS npm apihelp search -.P -Search for packages -.SS npm apihelp shrinkwrap -.P -programmatically generate package shrinkwrap file -.SS npm apihelp start -.P -Start a package -.SS npm apihelp stop -.P -Stop a package -.SS npm apihelp tag -.P -Tag a published version -.SS npm apihelp test -.P -Test a package -.SS npm apihelp uninstall -.P -uninstall a package programmatically -.SS npm apihelp unpublish -.P -Remove a package from the registry -.SS npm apihelp update -.P -Update a package -.SS npm apihelp version -.P -Bump a package version -.SS npm apihelp view -.P -View registry info -.SS npm apihelp whoami -.P -Display npm username .SH Files .P File system structures npm uses @@ -310,9 +190,6 @@ Developer Guide .SS npm help 7 disputes .P Handling Module Name Disputes -.SS npm help 7 faq -.P -Frequently Asked Questions .SS npm help 7 index .P Index of all npm documentation diff --git a/deps/npm/man/man7/npm-orgs.7 b/deps/npm/man/man7/npm-orgs.7 index 1167bcdbed97d3..71c5197f64faeb 100644 --- a/deps/npm/man/man7/npm-orgs.7 +++ b/deps/npm/man/man7/npm-orgs.7 @@ -1,4 +1,4 @@ -.TH "NPM\-ORGS" "7" "October 2015" "" "" +.TH "NPM\-ORGS" "7" "April 2016" "" "" .SH "NAME" \fBnpm-orgs\fR \- Working with Teams & Orgs .SH DESCRIPTION @@ -23,9 +23,9 @@ The developer will be able to access packages based on the teams they are on\. A There are two main commands: .RS 0 .IP 1. 3 -\fBnpm team\fP see npm help access for more details +\fBnpm team\fP see npm help team for more details .IP 2. 3 -\fBnpm access\fP see npm help team for more details +\fBnpm access\fP see npm help access for more details .RE .SH Team Admins create teams diff --git a/deps/npm/man/man7/npm-registry.7 b/deps/npm/man/man7/npm-registry.7 index 5cfd79c4a7b6de..e50735dc74db70 100644 --- a/deps/npm/man/man7/npm-registry.7 +++ b/deps/npm/man/man7/npm-registry.7 @@ -1,4 +1,4 @@ -.TH "NPM\-REGISTRY" "7" "October 2015" "" "" +.TH "NPM\-REGISTRY" "7" "April 2016" "" "" .SH "NAME" \fBnpm-registry\fR \- The JavaScript Package Registry .SH DESCRIPTION @@ -11,10 +11,10 @@ Additionally, npm's package registry implementation supports several write APIs as well, to allow for publishing packages and managing user account information\. .P -The official public npm registry is at http://registry\.npmjs\.org/\|\. It +The official public npm registry is at https://registry\.npmjs\.org/\|\. It is powered by a CouchDB database, of which there is a public mirror at -http://skimdb\.npmjs\.com/registry\|\. The code for the couchapp is -available at http://github\.com/npm/npm\-registry\-couchapp\|\. +https://skimdb\.npmjs\.com/registry\|\. The code for the couchapp is +available at https://github\.com/npm/npm\-registry\-couchapp\|\. .P The registry URL used is determined by the scope of the package (see npm help 7 \fBnpm\-scope\fP)\. If no scope is specified, the default registry is used, which is diff --git a/deps/npm/man/man7/npm-scope.7 b/deps/npm/man/man7/npm-scope.7 index 2a166acdbacf49..e26b614bd42601 100644 --- a/deps/npm/man/man7/npm-scope.7 +++ b/deps/npm/man/man7/npm-scope.7 @@ -1,4 +1,4 @@ -.TH "NPM\-SCOPE" "7" "October 2015" "" "" +.TH "NPM\-SCOPE" "7" "April 2016" "" "" .SH "NAME" \fBnpm-scope\fR \- Scoped packages .SH DESCRIPTION @@ -67,7 +67,7 @@ just specifying to require the module \fBmypackage\fP in the folder called \fB@m Scoped packages can be published to any registry that supports them, including the public npm registry\. .P -(As of 2015\-04\-19, the public npm registry \fBdoes\fR support scoped packages) +(As of 2015\-04\-19, and with npm 2\.0 or better, the public npm registry \fBdoes\fR support scoped packages) .P If you wish, you may associate a scope with a registry; see below\. .SS Publishing public scoped packages to the public npm registry diff --git a/deps/npm/man/man7/npm-scripts.7 b/deps/npm/man/man7/npm-scripts.7 index 20ca80b0e2fa54..72c220f0639fa6 100644 --- a/deps/npm/man/man7/npm-scripts.7 +++ b/deps/npm/man/man7/npm-scripts.7 @@ -1,4 +1,4 @@ -.TH "NPM\-SCRIPTS" "7" "October 2015" "" "" +.TH "NPM\-SCRIPTS" "7" "April 2016" "" "" .SH "NAME" \fBnpm-scripts\fR \- How npm handles the "scripts" field .SH DESCRIPTION @@ -92,7 +92,7 @@ If there is a \fBserver\.js\fP file in the root of your package, then npm will default the \fBstart\fP command to \fBnode server\.js\fP\|\. .IP \(bu 2 \fB"install": "node\-gyp rebuild"\fP: -If there is a \fBbindings\.gyp\fP file in the root of your package, npm will +If there is a \fBbinding\.gyp\fP file in the root of your package, npm will default the \fBinstall\fP command to compile using node\-gyp\. .RE @@ -195,10 +195,10 @@ For example, if your package\.json contains this: .fi .RE .P -then the \fBscripts/install\.js\fP will be called for the install, -post\-install, stages of the lifecycle, and the \fBscripts/uninstall\.js\fP -would be called when the package is uninstalled\. Since -\fBscripts/install\.js\fP is running for three different phases, it would +then \fBscripts/install\.js\fP will be called for the install +and post\-install stages of the lifecycle, and \fBscripts/uninstall\.js\fP +will be called when the package is uninstalled\. Since +\fBscripts/install\.js\fP is running for two different phases, it would be wise in this case to look at the \fBnpm_lifecycle_event\fP environment variable\. .P @@ -252,7 +252,7 @@ by simply describing your package appropriately\. In general, this will lead to a more robust and consistent state\. .IP \(bu 2 Inspect the env to determine where to put things\. For instance, if -the \fBnpm_config_binroot\fP environ is set to \fB/home/user/bin\fP, then +the \fBnpm_config_binroot\fP environment variable is set to \fB/home/user/bin\fP, then don't try to install executables into \fB/usr/local/bin\fP\|\. The user probably set it up that way for a reason\. .IP \(bu 2 diff --git a/deps/npm/man/man7/removing-npm.7 b/deps/npm/man/man7/removing-npm.7 index f0324607cf2f84..d77f66995cf073 100644 --- a/deps/npm/man/man7/removing-npm.7 +++ b/deps/npm/man/man7/removing-npm.7 @@ -1,4 +1,4 @@ -.TH "NPM\-REMOVAL" "1" "October 2015" "" "" +.TH "NPM\-REMOVAL" "1" "April 2016" "" "" .SH "NAME" \fBnpm-removal\fR \- Cleaning the Slate .SH SYNOPSIS @@ -70,7 +70,7 @@ find /usr/local/{lib/node,bin} \-exec grep \-l npm \\{\\} \\; ; .IP \(bu 2 README .IP \(bu 2 -npm help rm +npm help uninstall .IP \(bu 2 npm help prune diff --git a/deps/npm/man/man7/semver.7 b/deps/npm/man/man7/semver.7 index db93d201df8c07..acec7e039a26e4 100644 --- a/deps/npm/man/man7/semver.7 +++ b/deps/npm/man/man7/semver.7 @@ -1,4 +1,4 @@ -.TH "SEMVER" "7" "October 2015" "" "" +.TH "SEMVER" "7" "April 2016" "" "" .SH "NAME" \fBsemver\fR \- The semantic versioner for npm .SH Usage @@ -119,7 +119,7 @@ will append the value of the string as a prerelease identifier: .P .RS 2 .nf -> semver\.inc('1\.2\.3', 'pre', 'beta') +> semver\.inc('1\.2\.3', 'prerelease', 'beta') \|'1\.2\.4\-beta\.0' .fi .RE @@ -283,6 +283,31 @@ zero\. .IP \(bu 2 \fB^0\.x\fP := \fB>=0\.0\.0 <1\.0\.0\fP +.RE +.SS Range Grammar +.P +Putting all this together, here is a Backus\-Naur grammar for ranges, +for the benefit of parser authors: +.P +.RS 2 +.nf +range\-set ::= range ( logical\-or range ) * +logical\-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' \- ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial +partial ::= xr ( '\.' xr ( '\.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | ['1'\-'9']['0'\-'9']+ +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '\-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '\.' part ) * +part ::= nr | [\-0\-9A\-Za\-z]+ +.fi .RE .SH Functions .P diff --git a/deps/npm/node_modules/abbrev/package.json b/deps/npm/node_modules/abbrev/package.json index 9b71f630b71ae1..d3e3a661edcd3c 100644 --- a/deps/npm/node_modules/abbrev/package.json +++ b/deps/npm/node_modules/abbrev/package.json @@ -18,30 +18,14 @@ "devDependencies": { "tap": "^1.2.0" }, - "gitHead": "821d09ce7da33627f91bbd8ed631497ed6f760c2", + "readme": "# abbrev-js\n\nJust like [ruby's Abbrev](http://apidock.com/ruby/Abbrev).\n\nUsage:\n\n var abbrev = require(\"abbrev\");\n abbrev(\"foo\", \"fool\", \"folding\", \"flop\");\n \n // returns:\n { fl: 'flop'\n , flo: 'flop'\n , flop: 'flop'\n , fol: 'folding'\n , fold: 'folding'\n , foldi: 'folding'\n , foldin: 'folding'\n , folding: 'folding'\n , foo: 'foo'\n , fool: 'fool'\n }\n\nThis is handy for command-line scripts, or other cases where you want to be able to accept shorthands.\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/isaacs/abbrev-js/issues" }, "homepage": "https://github.com/isaacs/abbrev-js#readme", "_id": "abbrev@1.0.7", "_shasum": "5b6035b2ee9d4fb5cf859f08a9be81b208491843", - "_from": "abbrev@>=1.0.7 <1.1.0", - "_npmVersion": "2.10.1", - "_nodeVersion": "2.0.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "5b6035b2ee9d4fb5cf859f08a9be81b208491843", - "tarball": "http://registry.npmjs.org/abbrev/-/abbrev-1.0.7.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.7.tgz" + "_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.7.tgz", + "_from": "abbrev@>=1.0.7 <1.1.0" } diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/index.js b/deps/npm/node_modules/ansi-regex/index.js similarity index 100% rename from deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/index.js rename to deps/npm/node_modules/ansi-regex/index.js diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/license b/deps/npm/node_modules/ansi-regex/license similarity index 100% rename from deps/npm/node_modules/columnify/node_modules/strip-ansi/license rename to deps/npm/node_modules/ansi-regex/license diff --git a/deps/npm/node_modules/ansi-regex/package.json b/deps/npm/node_modules/ansi-regex/package.json new file mode 100644 index 00000000000000..36b92255d4d2c5 --- /dev/null +++ b/deps/npm/node_modules/ansi-regex/package.json @@ -0,0 +1,77 @@ +{ + "name": "ansi-regex", + "version": "2.0.0", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/ansi-regex.git" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "maintainers": [ + { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + { + "name": "Joshua Appelman", + "email": "jappelman@xebia.com", + "url": "jbnicolai.com" + } + ], + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha test/test.js", + "view-supported": "node test/viewCodes.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "mocha": "*" + }, + "readme": "# ansi-regex [![Build Status](https://travis-ci.org/sindresorhus/ansi-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/ansi-regex)\n\n> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)\n\n\n## Install\n\n```\n$ npm install --save ansi-regex\n```\n\n\n## Usage\n\n```js\nvar ansiRegex = require('ansi-regex');\n\nansiRegex().test('\\u001b[4mcake\\u001b[0m');\n//=> true\n\nansiRegex().test('cake');\n//=> false\n\n'\\u001b[4mcake\\u001b[0m'.match(ansiRegex());\n//=> ['\\u001b[4m', '\\u001b[0m']\n```\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n", + "readmeFilename": "readme.md", + "bugs": { + "url": "https://github.com/sindresorhus/ansi-regex/issues" + }, + "homepage": "https://github.com/sindresorhus/ansi-regex#readme", + "_id": "ansi-regex@2.0.0", + "_shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", + "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz", + "_from": "ansi-regex@2.0.0" +} diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/readme.md b/deps/npm/node_modules/ansi-regex/readme.md similarity index 100% rename from deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/readme.md rename to deps/npm/node_modules/ansi-regex/readme.md diff --git a/deps/npm/node_modules/ansi/History.md b/deps/npm/node_modules/ansi/History.md deleted file mode 100644 index f4a9fe30434aea..00000000000000 --- a/deps/npm/node_modules/ansi/History.md +++ /dev/null @@ -1,16 +0,0 @@ - -0.3.0 / 2014-05-09 -================== - - * package: remove "test" script and "devDependencies" - * package: remove "engines" section - * pacakge: remove "bin" section - * package: beautify - * examples: remove `starwars` example (#15) - * Documented goto, horizontalAbsolute, and eraseLine methods in README.md (#12, @Jammerwoch) - * add `.jshintrc` file - -< 0.3.0 -======= - - * Prehistoric diff --git a/deps/npm/node_modules/ansi/package.json b/deps/npm/node_modules/ansi/package.json deleted file mode 100644 index 706ae63067694d..00000000000000 --- a/deps/npm/node_modules/ansi/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "ansi", - "description": "Advanced ANSI formatting tool for Node.js", - "keywords": [ - "ansi", - "formatting", - "cursor", - "color", - "terminal", - "rgb", - "256", - "stream" - ], - "version": "0.3.0", - "author": { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://tootallnate.net" - }, - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/ansi.js.git" - }, - "main": "./lib/ansi.js", - "bugs": { - "url": "https://github.com/TooTallNate/ansi.js/issues" - }, - "homepage": "https://github.com/TooTallNate/ansi.js", - "_id": "ansi@0.3.0", - "_shasum": "74b2f1f187c8553c7f95015bcb76009fb43d38e0", - "_from": "ansi@latest", - "_npmVersion": "1.4.9", - "_npmUser": { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - }, - "maintainers": [ - { - "name": "TooTallNate", - "email": "nathan@tootallnate.net" - }, - { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - } - ], - "dist": { - "shasum": "74b2f1f187c8553c7f95015bcb76009fb43d38e0", - "tarball": "http://registry.npmjs.org/ansi/-/ansi-0.3.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/ansicolors/package.json b/deps/npm/node_modules/ansicolors/package.json index bca06da296aa24..6eef1fd18e95d4 100644 --- a/deps/npm/node_modules/ansicolors/package.json +++ b/deps/npm/node_modules/ansicolors/package.json @@ -28,7 +28,24 @@ "bugs": { "url": "https://github.com/thlorenz/ansicolors/issues" }, - "homepage": "https://github.com/thlorenz/ansicolors", "_id": "ansicolors@0.3.2", - "_from": "ansicolors@latest" + "dist": { + "shasum": "665597de86a9ffe3aa9bfbe6cae5c6ea426b4979", + "tarball": "http://registry.npmjs.org/ansicolors/-/ansicolors-0.3.2.tgz" + }, + "_from": "ansicolors@>=0.3.2 <0.4.0", + "_npmVersion": "1.3.11", + "_npmUser": { + "name": "thlorenz", + "email": "thlorenz@gmx.de" + }, + "maintainers": [ + { + "name": "thlorenz", + "email": "thlorenz@gmx.de" + } + ], + "directories": {}, + "_shasum": "665597de86a9ffe3aa9bfbe6cae5c6ea426b4979", + "_resolved": "https://registry.npmjs.org/ansicolors/-/ansicolors-0.3.2.tgz" } diff --git a/deps/npm/node_modules/ansistyles/package.json b/deps/npm/node_modules/ansistyles/package.json index dec9cd9e69a832..12ddf0d45ec56d 100644 --- a/deps/npm/node_modules/ansistyles/package.json +++ b/deps/npm/node_modules/ansistyles/package.json @@ -28,11 +28,24 @@ "bugs": { "url": "https://github.com/thlorenz/ansistyles/issues" }, - "homepage": "https://github.com/thlorenz/ansistyles", "_id": "ansistyles@0.1.3", "dist": { - "shasum": "b14f315fe763a2b3a88df9d3261a517e666c4615" + "shasum": "5de60415bda071bb37127854c864f41b23254539", + "tarball": "http://registry.npmjs.org/ansistyles/-/ansistyles-0.1.3.tgz" }, - "_from": "ansistyles@0.1.3", + "_from": "ansistyles@>=0.1.3 <0.2.0", + "_npmVersion": "1.3.11", + "_npmUser": { + "name": "thlorenz", + "email": "thlorenz@gmx.de" + }, + "maintainers": [ + { + "name": "thlorenz", + "email": "thlorenz@gmx.de" + } + ], + "directories": {}, + "_shasum": "5de60415bda071bb37127854c864f41b23254539", "_resolved": "https://registry.npmjs.org/ansistyles/-/ansistyles-0.1.3.tgz" } diff --git a/deps/npm/node_modules/aproba/.npmignore b/deps/npm/node_modules/aproba/.npmignore new file mode 100644 index 00000000000000..24001896d6d0c9 --- /dev/null +++ b/deps/npm/node_modules/aproba/.npmignore @@ -0,0 +1,3 @@ +*~ +node_modules +.#* diff --git a/deps/npm/node_modules/aproba/LICENSE b/deps/npm/node_modules/aproba/LICENSE new file mode 100644 index 00000000000000..2a4982dc40cb69 --- /dev/null +++ b/deps/npm/node_modules/aproba/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/aproba/README.md b/deps/npm/node_modules/aproba/README.md new file mode 100644 index 00000000000000..e5c1f5595b8e2a --- /dev/null +++ b/deps/npm/node_modules/aproba/README.md @@ -0,0 +1,54 @@ +aproba +====== + +A rediculously light-weight function argument validator + +``` +var validate = require("aproba") + +function myfunc(a, b, c) { + // `a` must be a string, `b` a number, `c` a function + validate('SNF', arguments) // [a,b,c] is also valid +} + +myfunc('test', 23, function () {}) // ok +myfunc(123, 23, function () {}) // type error +myfunc('test', 23) // missing arg error +myfunc('test', 23, function () {}, true) // too many args error + +``` + +Valid types are: + +type | description +---- | ----------- +* | matches any type +A | instanceof Array OR an arguments object +S | typeof == string +N | typeof == number +F | typeof == function +O | typeof == object and not type A and not type E +B | typeof == boolean +E | instanceof Error OR null + +Validation failures throw one of three exception types, distinguished by a +`code` property of `EMISSINGARG`, `EINVALIDTYPE` or `ETOOMANYARGS`. + +If an error argument is found and is not null then the remaining arguments will not be validated. + +### Why this exists + +I wanted a very simple argument validator. It needed to do two things: + +1. Be more concise and easier to use than assertions + +2. Not encourage an infinite bikeshed of DSLs + +This is why types are specified by a single character and there's no such +thing as an optional argument. + +This is not intended to validate user data. This is specifically about +asserting the interface of your functions. + +If you need greater validation, I encourage you to write them by hand or +look elsewhere. diff --git a/deps/npm/node_modules/aproba/index.js b/deps/npm/node_modules/aproba/index.js new file mode 100644 index 00000000000000..7d8ff07f87a4c0 --- /dev/null +++ b/deps/npm/node_modules/aproba/index.js @@ -0,0 +1,53 @@ +"use strict" + +var types = { + "*": ["any", function () { return true }], + A: ["array", function (thingy) { return thingy instanceof Array || (typeof thingy === "object" && thingy.hasOwnProperty("callee")) }], + S: ["string", function (thingy) { return typeof thingy === "string" }], + N: ["number", function (thingy) { return typeof thingy === "number" }], + F: ["function", function (thingy) { return typeof thingy === "function" }], + O: ["object", function (thingy) { return typeof thingy === "object" && !types.A[1](thingy) && !types.E[1](thingy) }], + B: ["boolean", function (thingy) { return typeof thingy == "boolean" }], + E: ["error", function (thingy) { return thingy instanceof Error }] +} + +var validate = module.exports = function (schema, args) { + if (!schema) throw missingRequiredArg(0, "schema") + if (!args) throw missingRequiredArg(1, "args") + if (!types.S[1](schema)) throw invalidType(0, "string", schema) + if (!types.A[1](args)) throw invalidType(1, "array", args) + for (var ii = 0; ii < schema.length; ++ii) { + var type = schema[ii] + if (!types[type]) throw unknownType(ii, type) + var typeLabel = types[type][0] + var typeCheck = types[type][1] + if (type === "E" && args[ii] == null) continue + if (args[ii] == null) throw missingRequiredArg(ii) + if (!typeCheck(args[ii])) throw invalidType(ii, typeLabel, args[ii]) + if (type === "E") return + } + if (schema.length < args.length) throw tooManyArgs(schema.length, args.length) +} + +function missingRequiredArg(num) { + return newException("EMISSINGARG", "Missing required argument #"+(num+1)) +} + +function unknownType(num, type) { + return newException("EUNKNOWNTYPE", "Unknown type "+type+" in argument #"+(num+1)) +} + +function invalidType(num, type, value) { + return newException("EINVALIDTYPE", "Argument #"+(num+1)+": Expected "+type+" but got "+typeof value) +} + +function tooManyArgs(expected, got) { + return newException("ETOOMANYARGS", "Too many arguments, expected "+expected+" and got "+got) +} + +function newException(code, msg) { + var e = new Error(msg) + e.code = code + Error.captureStackTrace(e, validate) + return e +} diff --git a/deps/npm/node_modules/aproba/package.json b/deps/npm/node_modules/aproba/package.json new file mode 100644 index 00000000000000..b41acdf973396c --- /dev/null +++ b/deps/npm/node_modules/aproba/package.json @@ -0,0 +1,54 @@ +{ + "name": "aproba", + "version": "1.0.1", + "description": "A rediculously light-weight argument validator", + "main": "index.js", + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tap": "^0.7.0" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/iarna/aproba" + }, + "keywords": [ + "argument", + "validate" + ], + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/iarna/aproba/issues" + }, + "homepage": "https://github.com/iarna/aproba", + "gitHead": "a2ea029793a14cddb9457afd0a83dc421889c7ad", + "_id": "aproba@1.0.1", + "_shasum": "c4ac2cc5becfb8b099de7ef9f02790e7d32d99ef", + "_from": "aproba@>=1.0.1 <1.1.0", + "_npmVersion": "2.7.5", + "_nodeVersion": "1.6.2", + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "dist": { + "shasum": "c4ac2cc5becfb8b099de7ef9f02790e7d32d99ef", + "tarball": "http://registry.npmjs.org/aproba/-/aproba-1.0.1.tgz" + }, + "_resolved": "https://registry.npmjs.org/aproba/-/aproba-1.0.1.tgz" +} diff --git a/deps/npm/node_modules/aproba/test/index.js b/deps/npm/node_modules/aproba/test/index.js new file mode 100644 index 00000000000000..0574709c8f5d7d --- /dev/null +++ b/deps/npm/node_modules/aproba/test/index.js @@ -0,0 +1,85 @@ +"use strict" +var test = require("tap").test +var validate = require("../index.js") + +function thrown (t, code, msg, todo) { + validate("OSSF", arguments) + try { + todo() + t.fail(msg) + } + catch (e) { + t.is(e.code, code, msg + e.message) + } +} + +function notThrown (t, msg, todo) { + validate("OSF", arguments) + try { + todo() + t.pass(msg) + } + catch (e) { + t.fail(msg+"\n"+e.stack) + } +} + +test("general", function (t) { + t.plan(69) + var values = { + "A": [], + "S": "test", + "N": 123, + "F": function () {}, + "O": {}, + "B": false, + "E": new Error() + } + Object.keys(values).forEach(function (type) { + Object.keys(values).forEach(function (contraType) { + if (type === contraType) { + notThrown(t, type + " matches " + contraType, function () { + validate(type, [values[contraType]]) + }) + } + else { + thrown(t, "EINVALIDTYPE", type + " does not match " + contraType, function () { + validate(type, [values[contraType]]) + }) + } + }) + if (type === "E") { + notThrown(t, "null is ok for E", function () { + validate(type, [null]) + }) + } + else { + thrown(t, "EMISSINGARG", "null not ok for "+type, function () { + validate(type, [null]) + }) + } + }) + Object.keys(values).forEach(function (contraType) { + notThrown(t, "* matches " + contraType, function () { + validate("*", [values[contraType]]) + }) + }) + thrown(t, "EMISSINGARG", "not enough args", function () { + validate("SNF", ["abc", 123]) + }) + thrown(t, "ETOOMANYARGS", "too many args", function () { + validate("SNF", ["abc", 123, function () {}, true]) + }) + notThrown(t, "E matches null", function () { + validate("E", [null]) + }) + notThrown(t, "E matches undefined", function () { + validate("E", [undefined]) + }) + notThrown(t, "E w/ error requires nothing else", function () { + validate("ESN", [new Error(), "foo"]) + }) + thrown(t, "EMISSINGARG", "E w/o error works as usual", function () { + validate("ESN", [null, "foo"]) + }) +}) diff --git a/deps/npm/node_modules/archy/.travis.yml b/deps/npm/node_modules/archy/.travis.yml new file mode 100644 index 00000000000000..895dbd36234210 --- /dev/null +++ b/deps/npm/node_modules/archy/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.6 + - 0.8 diff --git a/deps/npm/node_modules/archy/package.json b/deps/npm/node_modules/archy/package.json index 4b3da6637268ca..d49bc87768d96b 100644 --- a/deps/npm/node_modules/archy/package.json +++ b/deps/npm/node_modules/archy/package.json @@ -36,7 +36,7 @@ }, "repository": { "type": "git", - "url": "http://github.com/substack/node-archy.git" + "url": "git+ssh://git@github.com/substack/node-archy.git" }, "keywords": [ "hierarchy", @@ -58,7 +58,7 @@ "homepage": "https://github.com/substack/node-archy", "_id": "archy@1.0.0", "_shasum": "f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40", - "_from": "archy@>=1.0.0 <2.0.0", + "_from": "archy@>=1.0.0 <1.1.0", "_npmVersion": "1.4.25", "_npmUser": { "name": "substack", @@ -75,5 +75,6 @@ "tarball": "http://registry.npmjs.org/archy/-/archy-1.0.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz" + "_resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/async-some/.eslintrc b/deps/npm/node_modules/async-some/.eslintrc deleted file mode 100644 index 5c39c67eca02a9..00000000000000 --- a/deps/npm/node_modules/async-some/.eslintrc +++ /dev/null @@ -1,18 +0,0 @@ -{ - "env" : { - "node" : true - }, - "rules" : { - "curly" : 0, - "no-lonely-if" : 1, - "no-mixed-requires" : 0, - "no-underscore-dangle" : 0, - "no-unused-vars" : [2, {"vars" : "all", "args" : "after-used"}], - "no-use-before-define" : [2, "nofunc"], - "quotes" : [1, "double", "avoid-escape"], - "semi" : [2, "never"], - "space-after-keywords" : 1, - "space-infix-ops" : 0, - "strict" : 0 - } -} diff --git a/deps/npm/node_modules/async-some/LICENSE b/deps/npm/node_modules/async-some/LICENSE deleted file mode 100644 index d21147bf1965eb..00000000000000 --- a/deps/npm/node_modules/async-some/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2014-2015, Forrest L Norvell - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/async-some/README.md b/deps/npm/node_modules/async-some/README.md deleted file mode 100644 index bb502ee0608720..00000000000000 --- a/deps/npm/node_modules/async-some/README.md +++ /dev/null @@ -1,62 +0,0 @@ -# some - -Short-circuited async Array.prototype.some implementation. - -Serially evaluates a list of values from a JS array or arraylike -against an asynchronous predicate, terminating on the first truthy -value. If the predicate encounters an error, pass it to the completion -callback. Otherwise, pass the truthy value passed by the predicate, or -`false` if no truthy value was passed. - -Is -[Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony)-proof, -browser-safe, and pretty efficient. - -## Usage - -```javascript -var some = require("async-some"); -var resolve = require("path").resolve; -var stat = require("fs").stat; -var readFileSync = require("fs").readFileSync; - -some(["apple", "seaweed", "ham", "quince"], porkDetector, function (error, match) { - if (error) return console.error(error); - - if (match) return console.dir(JSON.parse(readFileSync(match))); - - console.error("time to buy more Sporkle™!"); -}); - -var PREFIX = resolve(__dirname, "../pork_store"); -function porkDetector(value, cb) { - var path = resolve(PREFIX, value + ".json"); - stat(path, function (er, stat) { - if (er) { - if (er.code === "ENOENT") return cb(null, false); - - return cb(er); - } - - cb(er, path); - }); -} -``` - -### some(list, test, callback) - -* `list` {Object} An arraylike (either an Array or the arguments arraylike) to - be checked. -* `test` {Function} The predicate against which the elements of `list` will be - tested. Takes two parameters: - * `element` {any} The element of the list to be tested. - * `callback` {Function} The continuation to be called once the test is - complete. Takes (again) two values: - * `error` {Error} Any errors that the predicate encountered. - * `value` {any} A truthy value. A non-falsy result terminates checking the - entire list. -* `callback` {Function} The callback to invoke when either a value has been - found or the entire input list has been processed with no result. Is invoked - with the traditional two parameters: - * `error` {Error} Errors that were encountered during the evaluation of some(). - * `match` {any} Value successfully matched by `test`, if any. diff --git a/deps/npm/node_modules/async-some/package.json b/deps/npm/node_modules/async-some/package.json deleted file mode 100644 index b7d5521e58dfba..00000000000000 --- a/deps/npm/node_modules/async-some/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "async-some", - "version": "1.0.2", - "description": "short-circuited, asynchronous version of Array.protototype.some", - "main": "some.js", - "scripts": { - "test": "tap test/*.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/othiym23/async-some.git" - }, - "keywords": [ - "async", - "some", - "array", - "collections", - "fp" - ], - "author": { - "name": "Forrest L Norvell", - "email": "ogd@aoaioxxysz.net" - }, - "license": "ISC", - "bugs": { - "url": "https://github.com/othiym23/async-some/issues" - }, - "homepage": "https://github.com/othiym23/async-some", - "dependencies": { - "dezalgo": "^1.0.2" - }, - "devDependencies": { - "tap": "^1.1.0" - }, - "readme": "# some\n\nShort-circuited async Array.prototype.some implementation.\n\nSerially evaluates a list of values from a JS array or arraylike\nagainst an asynchronous predicate, terminating on the first truthy\nvalue. If the predicate encounters an error, pass it to the completion\ncallback. Otherwise, pass the truthy value passed by the predicate, or\n`false` if no truthy value was passed.\n\nIs\n[Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony)-proof,\nbrowser-safe, and pretty efficient.\n\n## Usage\n\n```javascript\nvar some = require(\"async-some\");\nvar resolve = require(\"path\").resolve;\nvar stat = require(\"fs\").stat;\nvar readFileSync = require(\"fs\").readFileSync;\n\nsome([\"apple\", \"seaweed\", \"ham\", \"quince\"], porkDetector, function (error, match) {\n if (error) return console.error(error);\n\n if (match) return console.dir(JSON.parse(readFileSync(match)));\n\n console.error(\"time to buy more Sporkle™!\");\n});\n\nvar PREFIX = resolve(__dirname, \"../pork_store\");\nfunction porkDetector(value, cb) {\n var path = resolve(PREFIX, value + \".json\");\n stat(path, function (er, stat) {\n if (er) {\n if (er.code === \"ENOENT\") return cb(null, false);\n\n return cb(er);\n }\n\n cb(er, path);\n });\n}\n```\n\n### some(list, test, callback)\n\n* `list` {Object} An arraylike (either an Array or the arguments arraylike) to\n be checked.\n* `test` {Function} The predicate against which the elements of `list` will be\n tested. Takes two parameters:\n * `element` {any} The element of the list to be tested.\n * `callback` {Function} The continuation to be called once the test is\n complete. Takes (again) two values:\n * `error` {Error} Any errors that the predicate encountered.\n * `value` {any} A truthy value. A non-falsy result terminates checking the\n entire list.\n* `callback` {Function} The callback to invoke when either a value has been\n found or the entire input list has been processed with no result. Is invoked\n with the traditional two parameters:\n * `error` {Error} Errors that were encountered during the evaluation of some().\n * `match` {any} Value successfully matched by `test`, if any.\n", - "readmeFilename": "README.md", - "gitHead": "3a5086ad54739c48b2bbf073f23bcc95658199e3", - "_id": "async-some@1.0.2", - "_shasum": "4d8a81620d5958791b5b98f802d3207776e95509", - "_from": "async-some@>=1.0.2 <1.1.0" -} diff --git a/deps/npm/node_modules/async-some/some.js b/deps/npm/node_modules/async-some/some.js deleted file mode 100644 index 0419709f763daa..00000000000000 --- a/deps/npm/node_modules/async-some/some.js +++ /dev/null @@ -1,47 +0,0 @@ -var assert = require("assert") -var dezalgoify = require("dezalgo") - -module.exports = some - -/** - * short-circuited async Array.prototype.some implementation - * - * Serially evaluates a list of values from a JS array or arraylike - * against an asynchronous predicate, terminating on the first truthy - * value. If the predicate encounters an error, pass it to the completion - * callback. Otherwise, pass the truthy value passed by the predicate, or - * `false` if no truthy value was passed. - */ -function some (list, test, cb) { - assert("length" in list, "array must be arraylike") - assert.equal(typeof test, "function", "predicate must be callable") - assert.equal(typeof cb, "function", "callback must be callable") - - var array = slice(list) - , index = 0 - , length = array.length - , hecomes = dezalgoify(cb) - - map() - - function map () { - if (index >= length) return hecomes(null, false) - - test(array[index], reduce) - } - - function reduce (er, result) { - if (er) return hecomes(er, false) - if (result) return hecomes(null, result) - - index++ - map() - } -} - -// Array.prototype.slice on arguments arraylike is expensive -function slice(args) { - var l = args.length, a = [], i - for (i = 0; i < l; i++) a[i] = args[i] - return a -} diff --git a/deps/npm/node_modules/async-some/test/base-case.js b/deps/npm/node_modules/async-some/test/base-case.js deleted file mode 100644 index 356890521d6bd7..00000000000000 --- a/deps/npm/node_modules/async-some/test/base-case.js +++ /dev/null @@ -1,35 +0,0 @@ -var test = require("tap").test - -var some = require("../some.js") - -test("some() array base case", function (t) { - some([], failer, function (error, match) { - t.ifError(error, "ran successfully") - - t.notOk(match, "nothing to find, so nothing found") - - t.end() - }) - - function failer(value, cb) { - cb(new Error("test should never have been called")) - } -}) - -test("some() arguments arraylike base case", function (t) { - go() - - function go() { - some(arguments, failer, function (error, match) { - t.ifError(error, "ran successfully") - - t.notOk(match, "nothing to find, so nothing found") - - t.end() - }) - - function failer(value, cb) { - cb(new Error("test should never have been called")) - } - } -}) diff --git a/deps/npm/node_modules/async-some/test/parameters.js b/deps/npm/node_modules/async-some/test/parameters.js deleted file mode 100644 index 0706d1da6fc628..00000000000000 --- a/deps/npm/node_modules/async-some/test/parameters.js +++ /dev/null @@ -1,37 +0,0 @@ -var test = require("tap").test - -var some = require("../some.js") - -var NOP = function () {} - -test("some() called with bogus parameters", function (t) { - t.throws(function () { - some() - }, "throws when called with no parameters") - - t.throws(function () { - some(null, NOP, NOP) - }, "throws when called with no list") - - t.throws(function () { - some([], null, NOP) - }, "throws when called with no predicate") - - t.throws(function () { - some([], NOP, null) - }, "throws when called with no callback") - - t.throws(function () { - some({}, NOP, NOP) - }, "throws when called with wrong list type") - - t.throws(function () { - some([], "ham", NOP) - }, "throws when called with wrong test type") - - t.throws(function () { - some([], NOP, "ham") - }, "throws when called with wrong test type") - - t.end() -}) diff --git a/deps/npm/node_modules/async-some/test/simple.js b/deps/npm/node_modules/async-some/test/simple.js deleted file mode 100644 index 3d68e1e5076c0d..00000000000000 --- a/deps/npm/node_modules/async-some/test/simple.js +++ /dev/null @@ -1,60 +0,0 @@ -var test = require("tap").test - -var some = require("../some.js") - -test("some() doesn't find anything asynchronously", function (t) { - some(["a", "b", "c", "d", "e", "f", "g"], predicate, function (error, match) { - t.ifError(error, "ran successfully") - - t.notOk(match, "nothing to find, so nothing found") - - t.end() - }) - - function predicate(value, cb) { - // dezalgo ensures it's safe to not do this, but just in case - setTimeout(function () { cb(null, value > "j" && value) }) - } -}) - -test("some() doesn't find anything synchronously", function (t) { - some(["a", "b", "c", "d", "e", "f", "g"], predicate, function (error, match) { - t.ifError(error, "ran successfully") - - t.notOk(match, "nothing to find, so nothing found") - - t.end() - }) - - function predicate(value, cb) { - cb(null, value > "j" && value) - } -}) - -test("some() doesn't find anything asynchronously", function (t) { - some(["a", "b", "c", "d", "e", "f", "g"], predicate, function (error, match) { - t.ifError(error, "ran successfully") - - t.equals(match, "d", "found expected element") - - t.end() - }) - - function predicate(value, cb) { - setTimeout(function () { cb(null, value > "c" && value) }) - } -}) - -test("some() doesn't find anything synchronously", function (t) { - some(["a", "b", "c", "d", "e", "f", "g"], predicate, function (error, match) { - t.ifError(error, "ran successfully") - - t.equals(match, "d", "found expected") - - t.end() - }) - - function predicate(value, cb) { - cb(null, value > "c" && value) - } -}) diff --git a/deps/npm/node_modules/block-stream/package.json b/deps/npm/node_modules/block-stream/package.json deleted file mode 100644 index 80227bb69ed8ab..00000000000000 --- a/deps/npm/node_modules/block-stream/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "name": "block-stream", - "description": "a stream of blocks", - "version": "0.0.8", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/block-stream.git" - }, - "engines": { - "node": "0.4 || >=0.5.8" - }, - "main": "block-stream.js", - "dependencies": { - "inherits": "~2.0.0" - }, - "devDependencies": { - "tap": "0.x" - }, - "scripts": { - "test": "tap test/" - }, - "license": "ISC", - "gitHead": "b35520314f4763af0788d65a846bb43d9c0a8f02", - "bugs": { - "url": "https://github.com/isaacs/block-stream/issues" - }, - "homepage": "https://github.com/isaacs/block-stream#readme", - "_id": "block-stream@0.0.8", - "_shasum": "0688f46da2bbf9cff0c4f68225a0cb95cbe8a46b", - "_from": "block-stream@0.0.8", - "_npmVersion": "2.10.0", - "_nodeVersion": "2.0.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "0688f46da2bbf9cff0c4f68225a0cb95cbe8a46b", - "tarball": "http://registry.npmjs.org/block-stream/-/block-stream-0.0.8.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.8.tgz" -} diff --git a/deps/npm/node_modules/char-spinner/README.md b/deps/npm/node_modules/char-spinner/README.md deleted file mode 100644 index b1290f5925b7d0..00000000000000 --- a/deps/npm/node_modules/char-spinner/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# char-spinner - -Put a little spinner on process.stderr, as unobtrusively as possible. - -## USAGE - -```javascript -var spinner = require("char-spinner") - -// All options are optional -// even the options argument itself is optional -spinner(options) -``` - -## OPTIONS - -Usually the defaults are what you want. Mostly they're just -configurable for testing purposes. - -* `stream` Output stream. Default=`process.stderr` -* `tty` Only show spinner if output stream has a truish `.isTTY`. Default=`true` -* `string` String of chars to spin. Default=`'/-\\|'` -* `interval` Number of ms between frames, bigger = slower. Default=`50` -* `cleanup` Print `'\r \r'` to stream on process exit. Default=`true` -* `unref` Unreference the spinner interval so that the process can - exit normally. Default=`true` -* `delay` Number of frames to "skip over" before printing the spinner. - Useful if you want to avoid showing the spinner for very fast - actions. Default=`2` - -Returns the generated interval, if one was created. diff --git a/deps/npm/node_modules/char-spinner/package.json b/deps/npm/node_modules/char-spinner/package.json deleted file mode 100644 index 91092d84bb4089..00000000000000 --- a/deps/npm/node_modules/char-spinner/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "char-spinner", - "version": "1.0.1", - "description": "Put a little spinner on process.stderr, as unobtrusively as possible.", - "main": "spin.js", - "directories": { - "test": "test" - }, - "dependencies": {}, - "devDependencies": { - "tap": "^0.4.10" - }, - "scripts": { - "test": "tap test/*.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/char-spinner" - }, - "keywords": [ - "char", - "spinner" - ], - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "ISC", - "bugs": { - "url": "https://github.com/isaacs/char-spinner/issues" - }, - "homepage": "https://github.com/isaacs/char-spinner", - "gitHead": "091b2ff5960aa083f68a5619fa93999d072aa152", - "_id": "char-spinner@1.0.1", - "_shasum": "e6ea67bd247e107112983b7ab0479ed362800081", - "_from": "char-spinner@latest", - "_npmVersion": "1.4.13", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "dist": { - "shasum": "e6ea67bd247e107112983b7ab0479ed362800081", - "tarball": "http://registry.npmjs.org/char-spinner/-/char-spinner-1.0.1.tgz" - }, - "_resolved": "https://registry.npmjs.org/char-spinner/-/char-spinner-1.0.1.tgz" -} diff --git a/deps/npm/node_modules/char-spinner/spin.js b/deps/npm/node_modules/char-spinner/spin.js deleted file mode 100644 index cae8540c6fa649..00000000000000 --- a/deps/npm/node_modules/char-spinner/spin.js +++ /dev/null @@ -1,51 +0,0 @@ -module.exports = spinner - -function spinner(opt) { - opt = opt || {} - var str = opt.stream || process.stderr - var tty = typeof opt.tty === 'boolean' ? opt.tty : true - var string = opt.string || '/-\\|' - var ms = typeof opt.interval === 'number' ? opt.interval : 50 - if (ms < 0) ms = 0 - if (tty && !str.isTTY) return false - var CR = str.isTTY ? '\u001b[0G' : '\u000d'; - var CLEAR = str.isTTY ? '\u001b[2K' : '\u000d \u000d'; - - var s = 0 - var sprite = string.split('') - var wrote = false - - var delay = typeof opt.delay === 'number' ? opt.delay : 2 - - var interval = setInterval(function() { - if (--delay >= 0) return - s = ++s % sprite.length - var c = sprite[s] - str.write(c + CR) - wrote = true - }, ms) - - var unref = typeof opt.unref === 'boolean' ? opt.unref : true - if (unref && typeof interval.unref === 'function') { - interval.unref() - } - - var cleanup = typeof opt.cleanup === 'boolean' ? opt.cleanup : true - if (cleanup) { - process.on('exit', function() { - if (wrote) { - str.write(CLEAR); - } - }) - } - - module.exports.clear = function () { - str.write(CLEAR); - }; - - return interval -} - -module.exports.clear = function () {}; - - diff --git a/deps/npm/node_modules/char-spinner/test/basic.js b/deps/npm/node_modules/char-spinner/test/basic.js deleted file mode 100644 index ed91b984f70b20..00000000000000 --- a/deps/npm/node_modules/char-spinner/test/basic.js +++ /dev/null @@ -1,35 +0,0 @@ -var test = require('tap').test -var spinner = require('../spin.js') - -test('does nothing when not a tty', function(t) { - var int = spinner({ - stream: { write: function(c) { - throw new Error('wrote something: ' + JSON.stringify(c)) - }, isTTY: false }, - }) - t.notOk(int) - t.end() -}) - -test('write spinny stuff', function(t) { - var output = '' - var written = 0 - var expect = "b\u001b[0Gc\u001b[0Gd\u001b[0Ge\u001b[0Gf\u001b[0Gg\u001b[0Gh\u001b[0Gi\u001b[0Gj\u001b[0Gk\u001b[0Gl\u001b[0Gm\u001b[0Gn\u001b[0Go\u001b[0Gp\u001b[0Ga\u001b[0Gb\u001b[0Gc\u001b[0Gd\u001b[0Ge\u001b[0Gf\u001b[0Gg\u001b[0Gh\u001b[0Gi\u001b[0Gj\u001b[0Gk\u001b[0Gl\u001b[0Gm\u001b[0Gn\u001b[0Go\u001b[0Gp\u001b[0Ga\u001b[0Gb\u001b[0Gc\u001b[0Gd\u001b[0Ge\u001b[0Gf\u001b[0Gg\u001b[0Gh\u001b[0Gi\u001b[0Gj\u001b[0Gk\u001b[0Gl\u001b[0Gm\u001b[0Gn\u001b[0Go\u001b[0Gp\u001b[0Ga\u001b[0Gb\u001b[0Gc\u001b[0G" - - var int = spinner({ - interval: 0, - string: 'abcdefghijklmnop', - stream: { - write: function(c) { - output += c - if (++written == 50) { - t.equal(output, expect) - clearInterval(int) - t.end() - } - }, - isTTY: true - }, - cleanup: false - }) -}) diff --git a/deps/npm/node_modules/chmodr/README.md b/deps/npm/node_modules/chmodr/README.md deleted file mode 100644 index e3e9313c1c3091..00000000000000 --- a/deps/npm/node_modules/chmodr/README.md +++ /dev/null @@ -1,3 +0,0 @@ -Like `chmod -R`. - -Takes the same arguments as `fs.chmod()` diff --git a/deps/npm/node_modules/chmodr/chmodr.js b/deps/npm/node_modules/chmodr/chmodr.js deleted file mode 100644 index 1e167da21bfcb6..00000000000000 --- a/deps/npm/node_modules/chmodr/chmodr.js +++ /dev/null @@ -1,65 +0,0 @@ -module.exports = chmodr -chmodr.sync = chmodrSync - -var fs = require("fs") -, path = require("path") - -function chmodr (p, mode, cb) { - fs.readdir(p, function (er, children) { - // any error other than ENOTDIR means it's not readable, or - // doesn't exist. give up. - if (er && er.code !== "ENOTDIR") - return cb(er) - var isDir = !er - var m = isDir ? dirMode(mode) : mode - if (er || !children.length) - return fs.chmod(p, m, cb) - - var len = children.length - var errState = null - children.forEach(function (child) { - var pathChild = path.resolve(p, child); - fs.lstat(pathChild, function(er, stats) { - if (er) - return cb(er) - if (!stats.isSymbolicLink()) - chmodr(pathChild, mode, then) - else - then() - }) - }) - function then (er) { - if (errState) return - if (er) return cb(errState = er) - if (-- len === 0) return fs.chmod(p, dirMode(mode), cb) - } - }) -} - -function chmodrSync (p, mode) { - var children - try { - children = fs.readdirSync(p) - } catch (er) { - if (er && er.code === "ENOTDIR") return fs.chmodSync(p, mode) - throw er - } - if (!children.length) return fs.chmodSync(p, dirMode(mode)) - - children.forEach(function (child) { - var pathChild = path.resolve(p, child) - var stats = fs.lstatSync(pathChild) - if (!stats.isSymbolicLink()) - chmodrSync(pathChild, mode) - }) - return fs.chmodSync(p, dirMode(mode)) -} - -// If a party has r, add x -// so that dirs are listable -function dirMode(mode) { - if (mode & 0400) mode |= 0100 - if (mode & 040) mode |= 010 - if (mode & 04) mode |= 01 - return mode -} diff --git a/deps/npm/node_modules/chmodr/package.json b/deps/npm/node_modules/chmodr/package.json deleted file mode 100644 index 54febed62cb8c9..00000000000000 --- a/deps/npm/node_modules/chmodr/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "name": "chmodr", - "description": "like `chmod -R`", - "version": "1.0.1", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/chmodr.git" - }, - "main": "chmodr.js", - "devDependencies": { - "mkdirp": "0.3", - "rimraf": "", - "tap": "^1.3.2" - }, - "scripts": { - "test": "tap test/*.js" - }, - "license": "ISC", - "files": [ - "chmodr.js" - ], - "gitHead": "a1ffe57f50c7d1a32e342ed1a03772d37bb4d00e", - "bugs": { - "url": "https://github.com/isaacs/chmodr/issues" - }, - "homepage": "https://github.com/isaacs/chmodr#readme", - "_id": "chmodr@1.0.1", - "_shasum": "858e07efd75b6633ae6121ffaa33b2900bcfe18d", - "_from": "chmodr@>=1.0.1 <1.1.0", - "_npmVersion": "3.2.1", - "_nodeVersion": "2.2.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "858e07efd75b6633ae6121ffaa33b2900bcfe18d", - "tarball": "http://registry.npmjs.org/chmodr/-/chmodr-1.0.1.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/chmodr/-/chmodr-1.0.1.tgz" -} diff --git a/deps/npm/node_modules/chownr/package.json b/deps/npm/node_modules/chownr/package.json index fdd1dd23083e77..700666e4deba20 100644 --- a/deps/npm/node_modules/chownr/package.json +++ b/deps/npm/node_modules/chownr/package.json @@ -31,7 +31,7 @@ "homepage": "https://github.com/isaacs/chownr#readme", "_id": "chownr@1.0.1", "_shasum": "e2a75042a9551908bebd25b8523d5f9769d79181", - "_from": "chownr@1.0.1", + "_from": "chownr@>=1.0.1 <1.1.0", "_npmVersion": "3.2.2", "_nodeVersion": "2.2.1", "_npmUser": { diff --git a/deps/npm/node_modules/cmd-shim/README.md b/deps/npm/node_modules/cmd-shim/README.md index 951d3c18c6c8ad..ff6745f8e5970d 100644 --- a/deps/npm/node_modules/cmd-shim/README.md +++ b/deps/npm/node_modules/cmd-shim/README.md @@ -6,8 +6,8 @@ since symlinks are not suitable for this purpose there. On Unix systems, you should use a symbolic link instead. [![Build Status](https://img.shields.io/travis/ForbesLindesay/cmd-shim/master.svg)](https://travis-ci.org/ForbesLindesay/cmd-shim) -[![Dependency Status](https://img.shields.io/gemnasium/ForbesLindesay/cmd-shim.svg)](https://gemnasium.com/ForbesLindesay/cmd-shim) -[![NPM version](https://img.shields.io/npm/v/cmd-shim.svg)](http://badge.fury.io/js/cmd-shim) +[![Dependency Status](https://img.shields.io/david/ForbesLindesay/cmd-shim.svg)](https://david-dm.org/ForbesLindesay/cmd-shim) +[![NPM version](https://img.shields.io/npm/v/cmd-shim.svg)](https://www.npmjs.com/package/cmd-shim) ## Installation diff --git a/deps/npm/node_modules/cmd-shim/index.js b/deps/npm/node_modules/cmd-shim/index.js index 59a1f6cbd62da0..9f22e103a5fe87 100644 --- a/deps/npm/node_modules/cmd-shim/index.js +++ b/deps/npm/node_modules/cmd-shim/index.js @@ -109,7 +109,7 @@ function writeShim_ (from, to, prog, args, cb) { + " " + prog + " " + args + " " + target + " %*\r\n" + ")" } else { - cmd = prog + " " + args + " " + target + " %*\r\n" + cmd = "@" + prog + " " + args + " " + target + " %*\r\n" } // #!/bin/sh @@ -132,7 +132,7 @@ function writeShim_ (from, to, prog, args, cb) { if (shLongProg) { sh = sh - + "basedir=`dirname \"$0\"`\n" + + "basedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")\n" + "\n" + "case `uname` in\n" + " *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;\n" diff --git a/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/.npmignore b/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7d1b3184..00000000000000 --- a/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/README.md b/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/README.md deleted file mode 100644 index 13a2e86050a3eb..00000000000000 --- a/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# graceful-fs - -graceful-fs functions as a drop-in replacement for the fs module, -making various improvements. - -The improvements are meant to normalize behavior across different -platforms and environments, and to make filesystem access more -resilient to errors. - -## Improvements over [fs module](http://api.nodejs.org/fs.html) - -graceful-fs: - -* Queues up `open` and `readdir` calls, and retries them once - something closes if there is an EMFILE error from too many file - descriptors. -* fixes `lchmod` for Node versions prior to 0.6.2. -* implements `fs.lutimes` if possible. Otherwise it becomes a noop. -* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or - `lchown` if the user isn't root. -* makes `lchmod` and `lchown` become noops, if not available. -* retries reading a file if `read` results in EAGAIN error. - -On Windows, it retries renaming a file for up to one second if `EACCESS` -or `EPERM` error occurs, likely because antivirus software has locked -the directory. - -## USAGE - -```javascript -// use just like fs -var fs = require('graceful-fs') - -// now go and do stuff with it... -fs.readFileSync('some-file-or-whatever') -``` diff --git a/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/fs.js b/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/fs.js deleted file mode 100644 index 64ad980232ec0d..00000000000000 --- a/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/fs.js +++ /dev/null @@ -1,11 +0,0 @@ -// eeeeeevvvvviiiiiiillllll -// more evil than monkey-patching the native builtin? -// Not sure. - -var mod = require("module") -var pre = '(function (exports, require, module, __filename, __dirname) { ' -var post = '});' -var src = pre + process.binding('natives').fs + post -var vm = require('vm') -var fn = vm.runInThisContext(src) -fn(exports, require, module, __filename, __dirname) diff --git a/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/graceful-fs.js b/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index fb206b83854a19..00000000000000 --- a/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,158 +0,0 @@ -// Monkey-patching the fs module. -// It's ugly, but there is simply no other way to do this. -var fs = module.exports = require('./fs.js') - -var assert = require('assert') - -// fix up some busted stuff, mostly on windows and old nodes -require('./polyfills.js') - -var util = require('util') - -function noop () {} - -var debug = noop -if (util.debuglog) - debug = util.debuglog('gfs') -else if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) - debug = function() { - var m = util.format.apply(util, arguments) - m = 'GFS: ' + m.split(/\n/).join('\nGFS: ') - console.error(m) - } - -if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) { - process.on('exit', function() { - debug('fds', fds) - debug(queue) - assert.equal(queue.length, 0) - }) -} - - -var originalOpen = fs.open -fs.open = open - -function open(path, flags, mode, cb) { - if (typeof mode === "function") cb = mode, mode = null - if (typeof cb !== "function") cb = noop - new OpenReq(path, flags, mode, cb) -} - -function OpenReq(path, flags, mode, cb) { - this.path = path - this.flags = flags - this.mode = mode - this.cb = cb - Req.call(this) -} - -util.inherits(OpenReq, Req) - -OpenReq.prototype.process = function() { - originalOpen.call(fs, this.path, this.flags, this.mode, this.done) -} - -var fds = {} -OpenReq.prototype.done = function(er, fd) { - debug('open done', er, fd) - if (fd) - fds['fd' + fd] = this.path - Req.prototype.done.call(this, er, fd) -} - - -var originalReaddir = fs.readdir -fs.readdir = readdir - -function readdir(path, cb) { - if (typeof cb !== "function") cb = noop - new ReaddirReq(path, cb) -} - -function ReaddirReq(path, cb) { - this.path = path - this.cb = cb - Req.call(this) -} - -util.inherits(ReaddirReq, Req) - -ReaddirReq.prototype.process = function() { - originalReaddir.call(fs, this.path, this.done) -} - -ReaddirReq.prototype.done = function(er, files) { - if (files && files.sort) - files = files.sort() - Req.prototype.done.call(this, er, files) - onclose() -} - - -var originalClose = fs.close -fs.close = close - -function close (fd, cb) { - debug('close', fd) - if (typeof cb !== "function") cb = noop - delete fds['fd' + fd] - originalClose.call(fs, fd, function(er) { - onclose() - cb(er) - }) -} - - -var originalCloseSync = fs.closeSync -fs.closeSync = closeSync - -function closeSync (fd) { - try { - return originalCloseSync(fd) - } finally { - onclose() - } -} - - -// Req class -function Req () { - // start processing - this.done = this.done.bind(this) - this.failures = 0 - this.process() -} - -Req.prototype.done = function (er, result) { - var tryAgain = false - if (er) { - var code = er.code - var tryAgain = code === "EMFILE" || code === "ENFILE" - if (process.platform === "win32") - tryAgain = tryAgain || code === "OK" - } - - if (tryAgain) { - this.failures ++ - enqueue(this) - } else { - var cb = this.cb - cb(er, result) - } -} - -var queue = [] - -function enqueue(req) { - queue.push(req) - debug('enqueue %d %s', queue.length, req.constructor.name, req) -} - -function onclose() { - var req = queue.shift() - if (req) { - debug('process', req.constructor.name, req) - req.process() - } -} diff --git a/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/package.json b/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/package.json deleted file mode 100644 index dc3ce5501994a8..00000000000000 --- a/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "_args": [ - [ - "graceful-fs@>3.0.1 <4.0.0-0", - "/Users/isaacs/dev/npm/npm/node_modules/cmd-shim" - ] - ], - "_from": "graceful-fs@>3.0.1 <4.0.0-0", - "_id": "graceful-fs@3.0.8", - "_inCache": true, - "_location": "/cmd-shim/graceful-fs", - "_nodeVersion": "2.0.1", - "_npmUser": { - "email": "isaacs@npmjs.com", - "name": "isaacs" - }, - "_npmVersion": "2.10.1", - "_phantomChildren": {}, - "_requested": { - "name": "graceful-fs", - "raw": "graceful-fs@>3.0.1 <4.0.0-0", - "rawSpec": ">3.0.1 <4.0.0-0", - "scope": null, - "spec": ">3.0.1 <4.0.0-0", - "type": "range" - }, - "_requiredBy": [ - "/cmd-shim" - ], - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.8.tgz", - "_shasum": "ce813e725fa82f7e6147d51c9a5ca68270551c22", - "_shrinkwrap": null, - "_spec": "graceful-fs@>3.0.1 <4.0.0-0", - "_where": "/Users/isaacs/dev/npm/npm/node_modules/cmd-shim", - "author": { - "email": "i@izs.me", - "name": "Isaac Z. Schlueter", - "url": "http://blog.izs.me" - }, - "bugs": { - "url": "https://github.com/isaacs/node-graceful-fs/issues" - }, - "dependencies": {}, - "description": "A drop-in replacement for fs, making various improvements.", - "devDependencies": { - "mkdirp": "^0.5.0", - "rimraf": "^2.2.8", - "tap": "^1.2.0" - }, - "directories": { - "test": "test" - }, - "dist": { - "shasum": "ce813e725fa82f7e6147d51c9a5ca68270551c22", - "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.8.tgz" - }, - "engines": { - "node": ">=0.4.0" - }, - "gitHead": "45c57aa5e323c35a985a525de6f0c9a6ef59e1f8", - "homepage": "https://github.com/isaacs/node-graceful-fs#readme", - "keywords": [ - "EACCESS", - "EAGAIN", - "EINVAL", - "EMFILE", - "EPERM", - "error", - "errors", - "fs", - "handling", - "module", - "queue", - "reading", - "retries", - "retry" - ], - "license": "ISC", - "main": "graceful-fs.js", - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "name": "graceful-fs", - "optionalDependencies": {}, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-graceful-fs.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "version": "3.0.8" -} diff --git a/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/polyfills.js b/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/polyfills.js deleted file mode 100644 index 8ac5006e2da24d..00000000000000 --- a/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/polyfills.js +++ /dev/null @@ -1,254 +0,0 @@ -var fs = require('./fs.js') -var constants = require('constants') - -var origCwd = process.cwd -var cwd = null -process.cwd = function() { - if (!cwd) - cwd = origCwd.call(process) - return cwd -} -var chdir = process.chdir -process.chdir = function(d) { - cwd = null - chdir.call(process, d) -} - -// (re-)implement some things that are known busted or missing. - -// lchmod, broken prior to 0.6.2 -// back-port the fix here. -if (constants.hasOwnProperty('O_SYMLINK') && - process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - fs.lchmod = function (path, mode, callback) { - callback = callback || noop - fs.open( path - , constants.O_WRONLY | constants.O_SYMLINK - , mode - , function (err, fd) { - if (err) { - callback(err) - return - } - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - fs.fchmod(fd, mode, function (err) { - fs.close(fd, function(err2) { - callback(err || err2) - }) - }) - }) - } - - fs.lchmodSync = function (path, mode) { - var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) - - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - var err, err2 - try { - var ret = fs.fchmodSync(fd, mode) - } catch (er) { - err = er - } - try { - fs.closeSync(fd) - } catch (er) { - err2 = er - } - if (err || err2) throw (err || err2) - return ret - } -} - - -// lutimes implementation, or no-op -if (!fs.lutimes) { - if (constants.hasOwnProperty("O_SYMLINK")) { - fs.lutimes = function (path, at, mt, cb) { - fs.open(path, constants.O_SYMLINK, function (er, fd) { - cb = cb || noop - if (er) return cb(er) - fs.futimes(fd, at, mt, function (er) { - fs.close(fd, function (er2) { - return cb(er || er2) - }) - }) - }) - } - - fs.lutimesSync = function (path, at, mt) { - var fd = fs.openSync(path, constants.O_SYMLINK) - , err - , err2 - , ret - - try { - var ret = fs.futimesSync(fd, at, mt) - } catch (er) { - err = er - } - try { - fs.closeSync(fd) - } catch (er) { - err2 = er - } - if (err || err2) throw (err || err2) - return ret - } - - } else if (fs.utimensat && constants.hasOwnProperty("AT_SYMLINK_NOFOLLOW")) { - // maybe utimensat will be bound soonish? - fs.lutimes = function (path, at, mt, cb) { - fs.utimensat(path, at, mt, constants.AT_SYMLINK_NOFOLLOW, cb) - } - - fs.lutimesSync = function (path, at, mt) { - return fs.utimensatSync(path, at, mt, constants.AT_SYMLINK_NOFOLLOW) - } - - } else { - fs.lutimes = function (_a, _b, _c, cb) { process.nextTick(cb) } - fs.lutimesSync = function () {} - } -} - - -// https://github.com/isaacs/node-graceful-fs/issues/4 -// Chown should not fail on einval or eperm if non-root. -// It should not fail on enosys ever, as this just indicates -// that a fs doesn't support the intended operation. - -fs.chown = chownFix(fs.chown) -fs.fchown = chownFix(fs.fchown) -fs.lchown = chownFix(fs.lchown) - -fs.chmod = chownFix(fs.chmod) -fs.fchmod = chownFix(fs.fchmod) -fs.lchmod = chownFix(fs.lchmod) - -fs.chownSync = chownFixSync(fs.chownSync) -fs.fchownSync = chownFixSync(fs.fchownSync) -fs.lchownSync = chownFixSync(fs.lchownSync) - -fs.chmodSync = chownFix(fs.chmodSync) -fs.fchmodSync = chownFix(fs.fchmodSync) -fs.lchmodSync = chownFix(fs.lchmodSync) - -function chownFix (orig) { - if (!orig) return orig - return function (target, uid, gid, cb) { - return orig.call(fs, target, uid, gid, function (er, res) { - if (chownErOk(er)) er = null - cb(er, res) - }) - } -} - -function chownFixSync (orig) { - if (!orig) return orig - return function (target, uid, gid) { - try { - return orig.call(fs, target, uid, gid) - } catch (er) { - if (!chownErOk(er)) throw er - } - } -} - -// ENOSYS means that the fs doesn't support the op. Just ignore -// that, because it doesn't matter. -// -// if there's no getuid, or if getuid() is something other -// than 0, and the error is EINVAL or EPERM, then just ignore -// it. -// -// This specific case is a silent failure in cp, install, tar, -// and most other unix tools that manage permissions. -// -// When running as root, or if other types of errors are -// encountered, then it's strict. -function chownErOk (er) { - if (!er) - return true - - if (er.code === "ENOSYS") - return true - - var nonroot = !process.getuid || process.getuid() !== 0 - if (nonroot) { - if (er.code === "EINVAL" || er.code === "EPERM") - return true - } - - return false -} - - -// if lchmod/lchown do not exist, then make them no-ops -if (!fs.lchmod) { - fs.lchmod = function (path, mode, cb) { - process.nextTick(cb) - } - fs.lchmodSync = function () {} -} -if (!fs.lchown) { - fs.lchown = function (path, uid, gid, cb) { - process.nextTick(cb) - } - fs.lchownSync = function () {} -} - - - -// on Windows, A/V software can lock the directory, causing this -// to fail with an EACCES or EPERM if the directory contains newly -// created files. Try again on failure, for up to 1 second. -if (process.platform === "win32") { - var rename_ = fs.rename - fs.rename = function rename (from, to, cb) { - var start = Date.now() - rename_(from, to, function CB (er) { - if (er - && (er.code === "EACCES" || er.code === "EPERM") - && Date.now() - start < 1000) { - return rename_(from, to, CB) - } - if(cb) cb(er) - }) - } -} - - -// if read() returns EAGAIN, then just try it again. -var read = fs.read -fs.read = function (fd, buffer, offset, length, position, callback_) { - var callback - if (callback_ && typeof callback_ === 'function') { - var eagCounter = 0 - callback = function (er, _, __) { - if (er && er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - return read.call(fs, fd, buffer, offset, length, position, callback) - } - callback_.apply(this, arguments) - } - } - return read.call(fs, fd, buffer, offset, length, position, callback) -} - -var readSync = fs.readSync -fs.readSync = function (fd, buffer, offset, length, position) { - var eagCounter = 0 - while (true) { - try { - return readSync.call(fs, fd, buffer, offset, length, position) - } catch (er) { - if (er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - continue - } - throw er - } - } -} diff --git a/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/test/max-open.js b/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/test/max-open.js deleted file mode 100644 index a6b9ba43d3a6de..00000000000000 --- a/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/test/max-open.js +++ /dev/null @@ -1,69 +0,0 @@ -var test = require('tap').test -var fs = require('../') - -test('open lots of stuff', function (t) { - // Get around EBADF from libuv by making sure that stderr is opened - // Otherwise Darwin will refuse to give us a FD for stderr! - process.stderr.write('') - - // How many parallel open()'s to do - var n = 1024 - var opens = 0 - var fds = [] - var going = true - var closing = false - var doneCalled = 0 - - for (var i = 0; i < n; i++) { - go() - } - - function go() { - opens++ - fs.open(__filename, 'r', function (er, fd) { - if (er) throw er - fds.push(fd) - if (going) go() - }) - } - - // should hit ulimit pretty fast - setTimeout(function () { - going = false - t.equal(opens - fds.length, n) - done() - }, 100) - - - function done () { - if (closing) return - doneCalled++ - - if (fds.length === 0) { - console.error('done called %d times', doneCalled) - // First because of the timeout - // Then to close the fd's opened afterwards - // Then this time, to complete. - // Might take multiple passes, depending on CPU speed - // and ulimit, but at least 3 in every case. - t.ok(doneCalled >= 2) - return t.end() - } - - closing = true - setTimeout(function () { - // console.error('do closing again') - closing = false - done() - }, 100) - - // console.error('closing time') - var closes = fds.slice(0) - fds.length = 0 - closes.forEach(function (fd) { - fs.close(fd, function (er) { - if (er) throw er - }) - }) - } -}) diff --git a/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/test/open.js b/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 85732f236b0026..00000000000000 --- a/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/test/open.js +++ /dev/null @@ -1,39 +0,0 @@ -var test = require('tap').test -var fs = require('../graceful-fs.js') - -test('graceful fs is monkeypatched fs', function (t) { - t.equal(fs, require('../fs.js')) - t.end() -}) - -test('open an existing file works', function (t) { - var fd = fs.openSync(__filename, 'r') - fs.closeSync(fd) - fs.open(__filename, 'r', function (er, fd) { - if (er) throw er - fs.close(fd, function (er) { - if (er) throw er - t.pass('works') - t.end() - }) - }) -}) - -test('open a non-existing file throws', function (t) { - var er - try { - var fd = fs.openSync('this file does not exist', 'r') - } catch (x) { - er = x - } - t.ok(er, 'should throw') - t.notOk(fd, 'should not get an fd') - t.equal(er.code, 'ENOENT') - - fs.open('neither does this file', 'r', function (er, fd) { - t.ok(er, 'should throw') - t.notOk(fd, 'should not get an fd') - t.equal(er.code, 'ENOENT') - t.end() - }) -}) diff --git a/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/test/readdir-sort.js b/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/test/readdir-sort.js deleted file mode 100644 index cb63a6846ed78f..00000000000000 --- a/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/test/readdir-sort.js +++ /dev/null @@ -1,20 +0,0 @@ -var test = require("tap").test -var fs = require("../fs.js") - -var readdir = fs.readdir -fs.readdir = function(path, cb) { - process.nextTick(function() { - cb(null, ["b", "z", "a"]) - }) -} - -var g = require("../") - -test("readdir reorder", function (t) { - g.readdir("whatevers", function (er, files) { - if (er) - throw er - t.same(files, [ "a", "b", "z" ]) - t.end() - }) -}) diff --git a/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/test/write-then-read.js b/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/test/write-then-read.js deleted file mode 100644 index 21e4c26bf6c9dc..00000000000000 --- a/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/test/write-then-read.js +++ /dev/null @@ -1,47 +0,0 @@ -var fs = require('../'); -var rimraf = require('rimraf'); -var mkdirp = require('mkdirp'); -var test = require('tap').test; -var p = require('path').resolve(__dirname, 'files'); - -process.chdir(__dirname) - -// Make sure to reserve the stderr fd -process.stderr.write(''); - -var num = 4097; -var paths = new Array(num); - -test('make files', function (t) { - rimraf.sync(p); - mkdirp.sync(p); - - for (var i = 0; i < num; ++i) { - paths[i] = 'files/file-' + i; - fs.writeFileSync(paths[i], 'content'); - } - - t.end(); -}) - -test('read files', function (t) { - // now read them - var done = 0; - for (var i = 0; i < num; ++i) { - fs.readFile(paths[i], function(err, data) { - if (err) - throw err; - - ++done; - if (done === num) { - t.pass('success'); - t.end() - } - }); - } -}); - -test('cleanup', function (t) { - rimraf.sync(p); - t.end(); -}); diff --git a/deps/npm/node_modules/cmd-shim/package.json b/deps/npm/node_modules/cmd-shim/package.json index e1f4f543ea708c..1867f1db86237e 100644 --- a/deps/npm/node_modules/cmd-shim/package.json +++ b/deps/npm/node_modules/cmd-shim/package.json @@ -1,46 +1,77 @@ { - "name": "cmd-shim", - "version": "2.0.1", - "description": "Used in npm for command line application support", - "scripts": { - "test": "tap test/*.js" + "_args": [ + [ + "cmd-shim@2.0.2", + "/Users/zkat/Documents/code/npm" + ] + ], + "_from": "cmd-shim@2.0.2", + "_id": "cmd-shim@2.0.2", + "_inCache": true, + "_installable": true, + "_location": "/cmd-shim", + "_nodeVersion": "1.6.2", + "_npmOperationalInternal": { + "host": "packages-6-west.internal.npmjs.com", + "tmp": "tmp/cmd-shim-2.0.2.tgz_1455116566936_0.7582207734230906" }, - "repository": { - "type": "git", - "url": "https://github.com/ForbesLindesay/cmd-shim.git" + "_npmUser": { + "email": "forbes@lindesay.co.uk", + "name": "forbeslindesay" + }, + "_npmVersion": "2.7.1", + "_phantomChildren": {}, + "_requested": { + "name": "cmd-shim", + "raw": "cmd-shim@2.0.2", + "rawSpec": "2.0.2", + "scope": null, + "spec": "2.0.2", + "type": "version" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-2.0.2.tgz", + "_shasum": "6fcbda99483a8fd15d7d30a196ca69d688a2efdb", + "_shrinkwrap": null, + "_spec": "cmd-shim@2.0.2", + "_where": "/Users/zkat/Documents/code/npm", + "bugs": { + "url": "https://github.com/ForbesLindesay/cmd-shim/issues" }, - "license": "BSD", "dependencies": { - "graceful-fs": ">3.0.1 <4.0.0-0", + "graceful-fs": "^4.1.2", "mkdirp": "~0.5.0" }, + "description": "Used in npm for command line application support", "devDependencies": { - "tap": "~0.4.11", - "rimraf": "~2.2.8" + "rimraf": "~2.2.8", + "tap": "~0.4.11" }, - "gitHead": "6f53d506be590fe9ac20c9801512cd1a3aad5974", - "bugs": { - "url": "https://github.com/ForbesLindesay/cmd-shim/issues" + "directories": {}, + "dist": { + "shasum": "6fcbda99483a8fd15d7d30a196ca69d688a2efdb", + "tarball": "http://registry.npmjs.org/cmd-shim/-/cmd-shim-2.0.2.tgz" }, + "gitHead": "8492e2a92b5062bb02a9eec509e57eea94b110a7", "homepage": "https://github.com/ForbesLindesay/cmd-shim", - "_id": "cmd-shim@2.0.1", - "_shasum": "4512a373d2391679aec51ad1d4733559e9b85d4a", - "_from": "cmd-shim@>=2.0.1-0 <3.0.0-0", - "_npmVersion": "1.5.0-alpha-4", - "_npmUser": { - "name": "forbeslindesay", - "email": "forbes@lindesay.co.uk" - }, + "license": "BSD-2-Clause", "maintainers": [ { - "name": "forbeslindesay", - "email": "forbes@lindesay.co.uk" + "email": "forbes@lindesay.co.uk", + "name": "forbeslindesay" } ], - "dist": { - "shasum": "4512a373d2391679aec51ad1d4733559e9b85d4a", - "tarball": "http://registry.npmjs.org/cmd-shim/-/cmd-shim-2.0.1.tgz" + "name": "cmd-shim", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/ForbesLindesay/cmd-shim.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-2.0.1.tgz" + "scripts": { + "test": "tap test/*.js" + }, + "version": "2.0.2" } diff --git a/deps/npm/node_modules/cmd-shim/test/basic.js b/deps/npm/node_modules/cmd-shim/test/basic.js index 3cb42347d33ada..09823158b865ab 100755 --- a/deps/npm/node_modules/cmd-shim/test/basic.js +++ b/deps/npm/node_modules/cmd-shim/test/basic.js @@ -15,7 +15,7 @@ test('no shebang', function (t) { t.equal(fs.readFileSync(to, 'utf8'), "\"$basedir/from.exe\" \"$@\"\nexit $?\n") t.equal(fs.readFileSync(to + '.cmd', 'utf8'), - "\"%~dp0\\from.exe\" %*\r\n") + "@\"%~dp0\\from.exe\" %*\r\n") t.end() }) }) @@ -31,7 +31,7 @@ test('env shebang', function (t) { t.equal(fs.readFileSync(to, 'utf8'), "#!/bin/sh"+ - "\nbasedir=`dirname \"$0\"`"+ + "\nbasedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")"+ "\n"+ "\ncase `uname` in"+ "\n *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;"+ @@ -69,7 +69,7 @@ test('env shebang with args', function (t) { t.equal(fs.readFileSync(to, 'utf8'), "#!/bin/sh"+ - "\nbasedir=`dirname \"$0\"`"+ + "\nbasedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")"+ "\n"+ "\ncase `uname` in"+ "\n *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;"+ @@ -107,7 +107,7 @@ test('explicit shebang', function (t) { t.equal(fs.readFileSync(to, 'utf8'), "#!/bin/sh" + - "\nbasedir=`dirname \"$0\"`" + + "\nbasedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")" + "\n" + "\ncase `uname` in" + "\n *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;" + @@ -146,7 +146,7 @@ test('explicit shebang with args', function (t) { t.equal(fs.readFileSync(to, 'utf8'), "#!/bin/sh" + - "\nbasedir=`dirname \"$0\"`" + + "\nbasedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")" + "\n" + "\ncase `uname` in" + "\n *CYGWIN*) basedir=`cygpath -w \"$basedir\"`;;" + diff --git a/deps/npm/node_modules/columnify/columnify.js b/deps/npm/node_modules/columnify/columnify.js index 42b2089a3485c0..334d5509ae222e 100644 --- a/deps/npm/node_modules/columnify/columnify.js +++ b/deps/npm/node_modules/columnify/columnify.js @@ -145,6 +145,8 @@ module.exports = function (items) { column.width = items.map(function (item) { return item[columnName]; }).reduce(function (min, cur) { + // if already at maxWidth don't bother testing + if (min >= column.maxWidth) return min; return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, wcwidth(cur)))); }, 0); }); @@ -181,9 +183,11 @@ module.exports = function (items) { var column = columns[columnName]; column.width = items.map(function (item) { return item[columnName].reduce(function (min, cur) { + if (min >= column.maxWidth) return min; return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, wcwidth(cur)))); }, 0); }).reduce(function (min, cur) { + if (min >= column.maxWidth) return min; return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, cur))); }, 0); }); @@ -217,7 +221,7 @@ function createRows(items, columns, columnNames, paddingChr) { }); // combine matching lines of each rows - var _loop = function (i) { + var _loop = function _loop(i) { row[i] = row[i] || []; columnNames.forEach(function (columnName) { var column = columns[columnName]; @@ -240,12 +244,15 @@ function createRows(items, columns, columnNames, paddingChr) { */ function mixin() { - if (Object.assign) return Object.assign.apply(Object, arguments); + var _Object; + + if (Object.assign) return (_Object = Object).assign.apply(_Object, arguments); return ObjectAssign.apply(undefined, arguments); } function ObjectAssign(target, firstSource) { "use strict"; + if (target === undefined || target === null) throw new TypeError("Cannot convert first argument to object"); var to = Object(target); diff --git a/deps/npm/node_modules/columnify/index.js b/deps/npm/node_modules/columnify/index.js index 227b41efc609c1..221269b3e76b72 100644 --- a/deps/npm/node_modules/columnify/index.js +++ b/deps/npm/node_modules/columnify/index.js @@ -135,6 +135,8 @@ module.exports = function(items, options = {}) { column.width = items .map(item => item[columnName]) .reduce((min, cur) => { + // if already at maxWidth don't bother testing + if (min >= column.maxWidth) return min return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, wcwidth(cur)))) }, 0) }) @@ -171,9 +173,11 @@ module.exports = function(items, options = {}) { let column = columns[columnName] column.width = items.map(item => { return item[columnName].reduce((min, cur) => { + if (min >= column.maxWidth) return min return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, wcwidth(cur)))) }, 0) }).reduce((min, cur) => { + if (min >= column.maxWidth) return min return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, cur))) }, 0) }) diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/package.json b/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/package.json deleted file mode 100644 index 7fc07677a044ac..00000000000000 --- a/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "name": "ansi-regex", - "version": "2.0.0", - "description": "Regular expression for matching ANSI escape codes", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/ansi-regex.git" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - } - ], - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha test/test.js", - "view-supported": "node test/viewCodes.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "text", - "regex", - "regexp", - "re", - "match", - "test", - "find", - "pattern" - ], - "devDependencies": { - "mocha": "*" - }, - "gitHead": "57c3f2941a73079fa8b081e02a522e3d29913e2f", - "bugs": { - "url": "https://github.com/sindresorhus/ansi-regex/issues" - }, - "homepage": "https://github.com/sindresorhus/ansi-regex", - "_id": "ansi-regex@2.0.0", - "_shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", - "_from": "ansi-regex@>=2.0.0 <3.0.0", - "_npmVersion": "2.11.2", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", - "tarball": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json b/deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json deleted file mode 100644 index 2871d037908d62..00000000000000 --- a/deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "name": "strip-ansi", - "version": "3.0.0", - "description": "Strip ANSI escape codes", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/strip-ansi.git" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - } - ], - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "node test.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "strip", - "trim", - "remove", - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "devDependencies": { - "ava": "0.0.4" - }, - "gitHead": "3f05b9810e1438f946e2eb84ee854cc00b972e9e", - "bugs": { - "url": "https://github.com/sindresorhus/strip-ansi/issues" - }, - "homepage": "https://github.com/sindresorhus/strip-ansi", - "_id": "strip-ansi@3.0.0", - "_shasum": "7510b665567ca914ccb5d7e072763ac968be3724", - "_from": "strip-ansi@>=3.0.0 <4.0.0", - "_npmVersion": "2.11.2", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "7510b665567ca914ccb5d7e072763ac968be3724", - "tarball": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/readme.md b/deps/npm/node_modules/columnify/node_modules/strip-ansi/readme.md deleted file mode 100644 index 76091512df5e46..00000000000000 --- a/deps/npm/node_modules/columnify/node_modules/strip-ansi/readme.md +++ /dev/null @@ -1,33 +0,0 @@ -# strip-ansi [![Build Status](https://travis-ci.org/sindresorhus/strip-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-ansi) - -> Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) - - -## Install - -``` -$ npm install --save strip-ansi -``` - - -## Usage - -```js -var stripAnsi = require('strip-ansi'); - -stripAnsi('\u001b[4mcake\u001b[0m'); -//=> 'cake' -``` - - -## Related - -- [strip-ansi-cli](https://github.com/sindresorhus/strip-ansi-cli) - CLI for this module -- [has-ansi](https://github.com/sindresorhus/has-ansi) - Check if a string has ANSI escape codes -- [ansi-regex](https://github.com/sindresorhus/ansi-regex) - Regular expression for matching ANSI escape codes -- [chalk](https://github.com/sindresorhus/chalk) - Terminal string styling done right - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/LICENSE b/deps/npm/node_modules/columnify/node_modules/wcwidth/LICENSE index 313ef1e888e41b..14deaf94b8162d 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/LICENSE +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/LICENSE @@ -27,4 +27,3 @@ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/docs/index.md b/deps/npm/node_modules/columnify/node_modules/wcwidth/docs/index.md index 5c5126d03287b4..64c1f3f7cd8a8a 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/docs/index.md +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/docs/index.md @@ -60,6 +60,3 @@ for any purpose and without fee is hereby granted. The author disclaims all warranties with regard to this software. Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c - - - diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/.travis.yml b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/.travis.yml index 58f23716aefb94..20fd86b6a5bee3 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/.travis.yml +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/.travis.yml @@ -1,5 +1,3 @@ language: node_js node_js: - - 0.6 - - 0.8 - 0.10 diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/LICENSE b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/LICENSE index fc808cce89d4a4..cc3c87bc3bfd85 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/LICENSE +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/LICENSE @@ -1,4 +1,4 @@ -Copyright © 2011-2014 Paul Vorbach +Copyright © 2011-2015 Paul Vorbach 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 diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/README.md b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/README.md index d7231cfca7daa7..0b6cecae29b52d 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/README.md +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/README.md @@ -2,16 +2,16 @@ [![build status](https://secure.travis-ci.org/pvorb/node-clone.png)](http://travis-ci.org/pvorb/node-clone) -offers foolproof _deep cloning_ of variables in JavaScript. +[![info badge](https://nodei.co/npm/clone.png?downloads=true&downloadRank=true&stars=true)](http://npm-stat.com/charts.html?package=clone) + +offers foolproof _deep cloning_ of objects, arrays, numbers, strings etc. in JavaScript. ## Installation npm install clone -or - - ender build clone +(It also works with browserify, ender or standalone.) ## Example @@ -105,7 +105,7 @@ github](https://github.com/pvorb/node-clone/issues) or send me an email to ## License -Copyright © 2011-2014 [Paul Vorbach](http://paul.vorba.ch/) and +Copyright © 2011-2015 [Paul Vorbach](http://paul.vorba.ch/) and [contributors](https://github.com/pvorb/node-clone/graphs/contributors). Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/clone.js b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/clone.js index f8fa3159a7c4ee..6263759203bd5d 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/clone.js +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/clone.js @@ -1,34 +1,6 @@ +var clone = (function() { 'use strict'; -function objectToString(o) { - return Object.prototype.toString.call(o); -} - -// shim for Node's 'util' package -// DO NOT REMOVE THIS! It is required for compatibility with EnderJS (http://enderjs.com/). -var util = { - isArray: function (ar) { - return Array.isArray(ar) || (typeof ar === 'object' && objectToString(ar) === '[object Array]'); - }, - isDate: function (d) { - return typeof d === 'object' && objectToString(d) === '[object Date]'; - }, - isRegExp: function (re) { - return typeof re === 'object' && objectToString(re) === '[object RegExp]'; - }, - getRegExpFlags: function (re) { - var flags = ''; - re.global && (flags += 'g'); - re.ignoreCase && (flags += 'i'); - re.multiline && (flags += 'm'); - return flags; - } -}; - - -if (typeof module === 'object') - module.exports = clone; - /** * Clones (copies) an Object using deep copying. * @@ -47,8 +19,14 @@ if (typeof module === 'object') * @param `prototype` - sets the prototype to be used when cloning an object. * (optional - defaults to parent prototype). */ - function clone(parent, circular, depth, prototype) { + var filter; + if (typeof circular === 'object') { + depth = circular.depth; + prototype = circular.prototype; + filter = circular.filter; + circular = circular.circular + } // maintain two arrays for circular references, where corresponding parents // and children have the same index var allParents = []; @@ -77,12 +55,12 @@ function clone(parent, circular, depth, prototype) { return parent; } - if (util.isArray(parent)) { + if (clone.__isArray(parent)) { child = []; - } else if (util.isRegExp(parent)) { - child = new RegExp(parent.source, util.getRegExpFlags(parent)); + } else if (clone.__isRegExp(parent)) { + child = new RegExp(parent.source, __getRegExpFlags(parent)); if (parent.lastIndex) child.lastIndex = parent.lastIndex; - } else if (util.isDate(parent)) { + } else if (clone.__isDate(parent)) { child = new Date(parent.getTime()); } else if (useBuffer && Buffer.isBuffer(parent)) { child = new Buffer(parent.length); @@ -114,7 +92,7 @@ function clone(parent, circular, depth, prototype) { if (proto) { attrs = Object.getOwnPropertyDescriptor(proto, i); } - + if (attrs && attrs.set == null) { continue; } @@ -134,7 +112,7 @@ function clone(parent, circular, depth, prototype) { * USE WITH CAUTION! This may not behave as you wish if you do not know how this * works. */ -clone.clonePrototype = function(parent) { +clone.clonePrototype = function clonePrototype(parent) { if (parent === null) return null; @@ -142,3 +120,41 @@ clone.clonePrototype = function(parent) { c.prototype = parent; return new c(); }; + +// private utility functions + +function __objToStr(o) { + return Object.prototype.toString.call(o); +}; +clone.__objToStr = __objToStr; + +function __isDate(o) { + return typeof o === 'object' && __objToStr(o) === '[object Date]'; +}; +clone.__isDate = __isDate; + +function __isArray(o) { + return typeof o === 'object' && __objToStr(o) === '[object Array]'; +}; +clone.__isArray = __isArray; + +function __isRegExp(o) { + return typeof o === 'object' && __objToStr(o) === '[object RegExp]'; +}; +clone.__isRegExp = __isRegExp; + +function __getRegExpFlags(re) { + var flags = ''; + if (re.global) flags += 'g'; + if (re.ignoreCase) flags += 'i'; + if (re.multiline) flags += 'm'; + return flags; +}; +clone.__getRegExpFlags = __getRegExpFlags; + +return clone; +})(); + +if (typeof module === 'object' && module.exports) { + module.exports = clone; +} diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/package.json b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/package.json index bc8e878a54c34b..d401747f6d5b33 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/package.json +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/package.json @@ -8,7 +8,7 @@ "function", "date" ], - "version": "0.1.19", + "version": "1.0.2", "repository": { "type": "git", "url": "git://github.com/pvorb/node-clone.git" @@ -86,41 +86,33 @@ "name": "Róbert Oroszi", "email": "robert+gh@oroszi.net", "url": "https://github.com/oroce" + }, + { + "name": "Aurélio A. Heckert", + "url": "http://softwarelivre.org/aurium" + }, + { + "name": "Guy Ellis", + "url": "http://www.guyellisrocks.com/" } ], "license": "MIT", "engines": { - "node": "*" + "node": ">=0.8" }, "dependencies": {}, "devDependencies": { - "underscore": "*", - "nodeunit": "*" + "nodeunit": "~0.9.0" }, "optionalDependencies": {}, "scripts": { "test": "nodeunit test.js" }, - "gitHead": "bb11a43363a0f69e8ac014cb5376ce215ea1f8fd", - "homepage": "https://github.com/pvorb/node-clone", - "_id": "clone@0.1.19", - "_shasum": "613fb68639b26a494ac53253e15b1a6bd88ada85", - "_from": "clone@>=0.1.5 <0.2.0", - "_npmVersion": "1.4.14", - "_npmUser": { - "name": "pvorb", - "email": "paul@vorba.ch" - }, - "maintainers": [ - { - "name": "pvorb", - "email": "paul@vorb.de" - } - ], - "dist": { - "shasum": "613fb68639b26a494ac53253e15b1a6bd88ada85", - "tarball": "http://registry.npmjs.org/clone/-/clone-0.1.19.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/clone/-/clone-0.1.19.tgz" + "readme": "# clone\n\n[![build status](https://secure.travis-ci.org/pvorb/node-clone.png)](http://travis-ci.org/pvorb/node-clone)\n\n[![info badge](https://nodei.co/npm/clone.png?downloads=true&downloadRank=true&stars=true)](http://npm-stat.com/charts.html?package=clone)\n\noffers foolproof _deep cloning_ of objects, arrays, numbers, strings etc. in JavaScript.\n\n\n## Installation\n\n npm install clone\n\n(It also works with browserify, ender or standalone.)\n\n\n## Example\n\n~~~ javascript\nvar clone = require('clone');\n\nvar a, b;\n\na = { foo: { bar: 'baz' } }; // initial value of a\n\nb = clone(a); // clone a -> b\na.foo.bar = 'foo'; // change a\n\nconsole.log(a); // show a\nconsole.log(b); // show b\n~~~\n\nThis will print:\n\n~~~ javascript\n{ foo: { bar: 'foo' } }\n{ foo: { bar: 'baz' } }\n~~~\n\n**clone** masters cloning simple objects (even with custom prototype), arrays,\nDate objects, and RegExp objects. Everything is cloned recursively, so that you\ncan clone dates in arrays in objects, for example.\n\n\n## API\n\n`clone(val, circular, depth)`\n\n * `val` -- the value that you want to clone, any type allowed\n * `circular` -- boolean\n\n Call `clone` with `circular` set to `false` if you are certain that `obj`\n contains no circular references. This will give better performance if needed.\n There is no error if `undefined` or `null` is passed as `obj`.\n * `depth` -- depth to which the object is to be cloned (optional,\n defaults to infinity)\n\n`clone.clonePrototype(obj)`\n\n * `obj` -- the object that you want to clone\n\nDoes a prototype clone as\n[described by Oran Looney](http://oranlooney.com/functional-javascript/).\n\n\n## Circular References\n\n~~~ javascript\nvar a, b;\n\na = { hello: 'world' };\n\na.myself = a;\nb = clone(a);\n\nconsole.log(b);\n~~~\n\nThis will print:\n\n~~~ javascript\n{ hello: \"world\", myself: [Circular] }\n~~~\n\nSo, `b.myself` points to `b`, not `a`. Neat!\n\n\n## Test\n\n npm test\n\n\n## Caveat\n\nSome special objects like a socket or `process.stdout`/`stderr` are known to not\nbe cloneable. If you find other objects that cannot be cloned, please [open an\nissue](https://github.com/pvorb/node-clone/issues/new).\n\n\n## Bugs and Issues\n\nIf you encounter any bugs or issues, feel free to [open an issue at\ngithub](https://github.com/pvorb/node-clone/issues) or send me an email to\n. I also always like to hear from you, if you’re using my code.\n\n## License\n\nCopyright © 2011-2015 [Paul Vorbach](http://paul.vorba.ch/) and\n[contributors](https://github.com/pvorb/node-clone/graphs/contributors).\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the “Software”), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", + "readmeFilename": "README.md", + "homepage": "https://github.com/pvorb/node-clone#readme", + "_id": "clone@1.0.2", + "_shasum": "260b7a99ebb1edfe247538175f783243cb19d149", + "_resolved": "https://registry.npmjs.org/clone/-/clone-1.0.2.tgz", + "_from": "clone@>=1.0.2 <2.0.0" } diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test-apart-ctx.html b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test-apart-ctx.html new file mode 100644 index 00000000000000..4d532bb7175192 --- /dev/null +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test-apart-ctx.html @@ -0,0 +1,22 @@ + + + + Clone Test-Suite (Browser) + + + + + diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.html b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.html new file mode 100644 index 00000000000000..a955702516dfb3 --- /dev/null +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.html @@ -0,0 +1,148 @@ + + + + + Clone Test-Suite (Browser) + + + + + +

    Clone Test-Suite (Browser)

    + Tests started: ; + Tests finished: . +
      + + + diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.js b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.js index cb3d16631ab87f..e8b65b3fed93c5 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.js +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.js @@ -1,16 +1,50 @@ -if(module.parent === null) { - console.log('Run this test file with nodeunit:'); - console.log('$ nodeunit test.js'); -} +var clone = require('./'); +function inspect(obj) { + seen = []; + return JSON.stringify(obj, function (key, val) { + if (val != null && typeof val == "object") { + if (seen.indexOf(val) >= 0) { + return '[cyclic]'; + } -var clone = require('./'); -var util = require('util'); -var _ = require('underscore'); + seen.push(val); + } + return val; + }); +} + +// Creates a new VM in node, or an iframe in a browser in order to run the +// script +function apartContext(context, script, callback) { + var vm = require('vm'); + if (vm) { + var ctx = vm.createContext({ ctx: context }); + callback(vm.runInContext(script, ctx)); + } else if (document && document.createElement) { + var iframe = document.createElement('iframe'); + iframe.style.display = 'none'; + document.body.appendChild(iframe); + + var myCtxId = 'tmpCtx' + Math.random(); + + window[myCtxId] = context; + iframe.src = 'test-apart-ctx.html?' + myCtxId + '&' + encodeURIComponent(script); + iframe.onload = function() { + try { + callback(iframe.contentWindow.results); + } catch (e) { + throw e; + } + }; + } else { + console.log('WARNING: cannot create an apart context.'); + } +} -exports["clone string"] = function(test) { +exports["clone string"] = function (test) { test.expect(2); // how many tests? var a = "foo"; @@ -21,9 +55,7 @@ exports["clone string"] = function(test) { test.done(); }; - - -exports["clone number"] = function(test) { +exports["clone number"] = function (test) { test.expect(5); // how many tests? var a = 0; @@ -40,37 +72,30 @@ exports["clone number"] = function(test) { test.done(); }; - - -exports["clone date"] = function(test) { +exports["clone date"] = function (test) { test.expect(3); // how many tests? var a = new Date; var c = clone(a); - test.ok(a instanceof Date); - test.ok(c instanceof Date); - test.equal(c.getTime(), a.getTime()); + test.ok(!!a.getUTCDate && !!a.toUTCString); + test.ok(!!c.getUTCDate && !!c.toUTCString); + test.equal(a.getTime(), c.getTime()); test.done(); }; - - -exports["clone object"] = function(test) { - test.expect(2); // how many tests? +exports["clone object"] = function (test) { + test.expect(1); // how many tests? var a = { foo: { bar: "baz" } }; var b = clone(a); - test.ok(_(a).isEqual(b), "underscore equal"); test.deepEqual(b, a); test.done(); }; - - -exports["clone array"] = function(test) { +exports["clone array"] = function (test) { test.expect(2); // how many tests? var a = [ @@ -79,13 +104,17 @@ exports["clone array"] = function(test) { ]; var b = clone(a); - test.ok(_(a).isEqual(b), "underscore equal"); + test.ok(b instanceof Array); test.deepEqual(b, a); test.done(); }; -exports["clone buffer"] = function(test) { +exports["clone buffer"] = function (test) { + if (typeof Buffer == 'undefined') { + return test.done(); + } + test.expect(1); var a = new Buffer("this is a test buffer"); @@ -96,14 +125,11 @@ exports["clone buffer"] = function(test) { test.done(); }; - - -exports["clone regexp"] = function(test) { +exports["clone regexp"] = function (test) { test.expect(5); var a = /abc123/gi; var b = clone(a); - test.deepEqual(b, a); var c = /a/g; @@ -119,63 +145,54 @@ exports["clone regexp"] = function(test) { test.done(); }; - -exports["clone object containing array"] = function(test) { - test.expect(2); // how many tests? +exports["clone object containing array"] = function (test) { + test.expect(1); // how many tests? var a = { arr1: [ { a: '1234', b: '2345' } ], arr2: [ { c: '345', d: '456' } ] }; + var b = clone(a); - test.ok(_(a).isEqual(b), "underscore equal"); test.deepEqual(b, a); test.done(); }; - - -exports["clone object with circular reference"] = function(test) { +exports["clone object with circular reference"] = function (test) { test.expect(8); // how many tests? - var _ = test.ok; - var c = [1, "foo", {'hello': 'bar'}, function() {}, false, [2]]; + var c = [1, "foo", {'hello': 'bar'}, function () {}, false, [2]]; var b = [c, 2, 3, 4]; + var a = {'b': b, 'c': c}; a.loop = a; a.loop2 = a; c.loop = c; c.aloop = a; + var aCopy = clone(a); - _(a != aCopy); - _(a.c != aCopy.c); - _(aCopy.c == aCopy.b[0]); - _(aCopy.c.loop.loop.aloop == aCopy); - _(aCopy.c[0] == a.c[0]); - - //console.log(util.inspect(aCopy, true, null) ); - //console.log("------------------------------------------------------------"); - //console.log(util.inspect(a, true, null) ); - _(eq(a, aCopy)); + test.ok(a != aCopy); + test.ok(a.c != aCopy.c); + test.ok(aCopy.c == aCopy.b[0]); + test.ok(aCopy.c.loop.loop.aloop == aCopy); + test.ok(aCopy.c[0] == a.c[0]); + + test.ok(eq(a, aCopy)); aCopy.c[0] = 2; - _(!eq(a, aCopy)); + test.ok(!eq(a, aCopy)); aCopy.c = "2"; - _(!eq(a, aCopy)); - //console.log("------------------------------------------------------------"); - //console.log(util.inspect(aCopy, true, null) ); + test.ok(!eq(a, aCopy)); function eq(x, y) { - return util.inspect(x, true, null) === util.inspect(y, true, null); + return inspect(x) === inspect(y); } test.done(); }; - - -exports['clonePrototype'] = function(test) { +exports['clone prototype'] = function (test) { test.expect(3); // how many tests? var a = { @@ -190,34 +207,38 @@ exports['clonePrototype'] = function(test) { test.strictEqual(b.y, a.y); test.done(); -} +}; -exports['cloneWithinNewVMContext'] = function(test) { - test.expect(3); - var vm = require('vm'); - var ctx = vm.createContext({ clone: clone }); - var script = "clone( {array: [1, 2, 3], date: new Date(), regex: /^foo$/ig} );"; - var results = vm.runInContext(script, ctx); - test.ok(results.array instanceof Array); - test.ok(results.date instanceof Date); - test.ok(results.regex instanceof RegExp); - test.done(); -} +exports['clone within an apart context'] = function (test) { + var results = apartContext({ clone: clone }, + "results = ctx.clone({ a: [1, 2, 3], d: new Date(), r: /^foo$/ig })", + function (results) { + test.ok(results.a.constructor.toString() === Array.toString()); + test.ok(results.d.constructor.toString() === Date.toString()); + test.ok(results.r.constructor.toString() === RegExp.toString()); + test.done(); + }); +}; -exports['cloneObjectWithNoConstructor'] = function(test) { +exports['clone object with no constructor'] = function (test) { test.expect(3); + var n = null; + var a = { foo: 'bar' }; a.__proto__ = n; test.ok(typeof a === 'object'); test.ok(typeof a !== null); + var b = clone(a); test.ok(a.foo, b.foo); + test.done(); -} +}; exports['clone object with depth argument'] = function (test) { test.expect(6); + var a = { foo: { bar : { @@ -225,6 +246,7 @@ exports['clone object with depth argument'] = function (test) { } } }; + var b = clone(a, false, 1); test.deepEqual(b, a); test.notEqual(b, a); @@ -234,28 +256,35 @@ exports['clone object with depth argument'] = function (test) { test.deepEqual(b, a); test.notEqual(b.foo, a.foo); test.strictEqual(b.foo.bar, a.foo.bar); + test.done(); -} +}; exports['maintain prototype chain in clones'] = function (test) { test.expect(1); - function Constructor() {} - var a = new Constructor(); + + function T() {} + + var a = new T(); var b = clone(a); test.strictEqual(Object.getPrototypeOf(a), Object.getPrototypeOf(b)); + test.done(); -} +}; exports['parent prototype is overriden with prototype provided'] = function (test) { test.expect(1); - function Constructor() {} - var a = new Constructor(); + + function T() {} + + var a = new T(); var b = clone(a, true, Infinity, null); test.strictEqual(b.__defineSetter__, undefined); + test.done(); -} +}; -exports['clone object with null children'] = function(test) { +exports['clone object with null children'] = function (test) { test.expect(1); var a = { foo: { @@ -265,12 +294,14 @@ exports['clone object with null children'] = function(test) { } } }; + var b = clone(a); + test.deepEqual(b, a); test.done(); -} +}; -exports['clone instance with getter'] = function(test) { +exports['clone instance with getter'] = function (test) { test.expect(1); function Ctor() {}; Object.defineProperty(Ctor.prototype, 'prop', { @@ -286,4 +317,56 @@ exports['clone instance with getter'] = function(test) { test.strictEqual(b.prop, 'value'); test.done(); -}; \ No newline at end of file +}; + +exports['get RegExp flags'] = function (test) { + test.strictEqual(clone.__getRegExpFlags(/a/), '' ); + test.strictEqual(clone.__getRegExpFlags(/a/i), 'i' ); + test.strictEqual(clone.__getRegExpFlags(/a/g), 'g' ); + test.strictEqual(clone.__getRegExpFlags(/a/gi), 'gi'); + test.strictEqual(clone.__getRegExpFlags(/a/m), 'm' ); + + test.done(); +}; + +exports["recognize Array object"] = function (test) { + var results = apartContext(null, "results = [1, 2, 3]", function(alien) { + var local = [4, 5, 6]; + test.ok(clone.__isArray(alien)); // recognize in other context. + test.ok(clone.__isArray(local)); // recognize in local context. + test.ok(!clone.__isDate(alien)); + test.ok(!clone.__isDate(local)); + test.ok(!clone.__isRegExp(alien)); + test.ok(!clone.__isRegExp(local)); + test.done(); + }); +}; + +exports["recognize Date object"] = function (test) { + var results = apartContext(null, "results = new Date()", function(alien) { + var local = new Date(); + + test.ok(clone.__isDate(alien)); // recognize in other context. + test.ok(clone.__isDate(local)); // recognize in local context. + test.ok(!clone.__isArray(alien)); + test.ok(!clone.__isArray(local)); + test.ok(!clone.__isRegExp(alien)); + test.ok(!clone.__isRegExp(local)); + + test.done(); + }); +}; + +exports["recognize RegExp object"] = function (test) { + var results = apartContext(null, "results = /foo/", function(alien) { + var local = /bar/; + + test.ok(clone.__isRegExp(alien)); // recognize in other context. + test.ok(clone.__isRegExp(local)); // recognize in local context. + test.ok(!clone.__isArray(alien)); + test.ok(!clone.__isArray(local)); + test.ok(!clone.__isDate(alien)); + test.ok(!clone.__isDate(local)); + test.done(); + }); +}; diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/package.json b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/package.json index fdd074d0f4afbb..ef5197861a276e 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/package.json +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/package.json @@ -1,6 +1,6 @@ { "name": "defaults", - "version": "1.0.2", + "version": "1.0.3", "description": "merge single level defaults over a config object", "main": "index.js", "scripts": { @@ -20,34 +20,35 @@ }, "license": "MIT", "dependencies": { - "clone": "~0.1.5" + "clone": "^1.0.2" }, "devDependencies": { - "tap": "~0.4.0" + "tap": "^2.0.0" }, - "gitHead": "22c57d1f87a2f03c1f9d21bd39c67db8553a0064", + "gitHead": "8831ec32a5f999bfae1a8c9bf32880971ed7c6f2", "bugs": { "url": "https://github.com/tmpvar/defaults/issues" }, - "homepage": "https://github.com/tmpvar/defaults", - "_id": "defaults@1.0.2", - "_shasum": "6902e25aa047649a501e19ef9e98f3e8365c109a", + "homepage": "https://github.com/tmpvar/defaults#readme", + "_id": "defaults@1.0.3", + "_shasum": "c656051e9817d9ff08ed881477f3fe4019f3ef7d", "_from": "defaults@>=1.0.0 <2.0.0", - "_npmVersion": "1.4.23", + "_npmVersion": "2.14.4", + "_nodeVersion": "4.1.1", "_npmUser": { "name": "tmpvar", "email": "tmpvar@gmail.com" }, + "dist": { + "shasum": "c656051e9817d9ff08ed881477f3fe4019f3ef7d", + "tarball": "http://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz" + }, "maintainers": [ { "name": "tmpvar", "email": "tmpvar@gmail.com" } ], - "dist": { - "shasum": "6902e25aa047649a501e19ef9e98f3e8365c109a", - "tarball": "http://registry.npmjs.org/defaults/-/defaults-1.0.2.tgz" - }, "directories": {}, - "_resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.2.tgz" + "_resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz" } diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/test.js b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/test.js index 60e0ffba8b4aab..eab79ff71f1498 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/test.js +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/test.js @@ -31,4 +31,3 @@ test("ensure defaults clone nested objects", function(t) { t.ok(result.b !== d.b, 'objects should be clones'); t.end(); }); - diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/package.json b/deps/npm/node_modules/columnify/node_modules/wcwidth/package.json index 4744d9dc3f7f7b..49fc6f0408a7a5 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/package.json +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/package.json @@ -56,5 +56,6 @@ "shasum": "02d059ff7a8fc741e0f6b5da1e69b2b40daeca6f", "tarball": "http://registry.npmjs.org/wcwidth/-/wcwidth-1.0.0.tgz" }, - "_resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.0.tgz" + "_resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/columnify/package.json b/deps/npm/node_modules/columnify/package.json index 1dc803973c6900..a661b6e356d707 100644 --- a/deps/npm/node_modules/columnify/package.json +++ b/deps/npm/node_modules/columnify/package.json @@ -1,67 +1,100 @@ { - "name": "columnify", - "version": "1.5.2", - "description": "Render data in text columns. Supports in-column text-wrap.", - "main": "columnify.js", - "scripts": { - "pretest": "npm prune", - "test": "make prepublish && tape test/*.js | tap-spec", - "bench": "npm test && node bench", - "prepublish": "make prepublish" + "_args": [ + [ + "columnify@1.5.4", + "/Users/rebecca/code/npm" + ] + ], + "_from": "columnify@1.5.4", + "_id": "columnify@1.5.4", + "_inCache": true, + "_installable": true, + "_location": "/columnify", + "_nodeVersion": "4.2.3", + "_npmUser": { + "email": "secoif@gmail.com", + "name": "timoxley" + }, + "_npmVersion": "2.14.7", + "_phantomChildren": {}, + "_requested": { + "name": "columnify", + "raw": "columnify@1.5.4", + "rawSpec": "1.5.4", + "scope": null, + "spec": "1.5.4", + "type": "version" }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/columnify/-/columnify-1.5.4.tgz", + "_shasum": "4737ddf1c7b69a8a7c340570782e947eec8e78bb", + "_shrinkwrap": null, + "_spec": "columnify@1.5.4", + "_where": "/Users/rebecca/code/npm", "author": { "name": "Tim Oxley" }, - "license": "MIT", - "devDependencies": { - "babel": "^5.8.21", - "chalk": "^1.1.0", - "tap-spec": "^4.0.2", - "tape": "^4.0.3" - }, - "repository": { - "type": "git", - "url": "git://github.com/timoxley/columnify.git" + "babel": { + "presets": [ + "es2015" + ] }, - "keywords": [ - "column", - "text", - "ansi", - "console", - "terminal", - "wrap", - "table" - ], "bugs": { "url": "https://github.com/timoxley/columnify/issues" }, - "homepage": "https://github.com/timoxley/columnify", "dependencies": { "strip-ansi": "^3.0.0", "wcwidth": "^1.0.0" }, + "description": "Render data in text columns. Supports in-column text-wrap.", + "devDependencies": { + "babel": "^6.3.26", + "babel-cli": "^6.3.17", + "babel-preset-es2015": "^6.3.13", + "chalk": "^1.1.1", + "tap-spec": "^4.1.1", + "tape": "^4.4.0" + }, "directories": { "test": "test" }, - "gitHead": "e7417b78091844ff2f3ba62551a4817c7ae217bd", - "_id": "columnify@1.5.2", - "_shasum": "6937930d47c22a9bfa20732a7fd619d47eaba65a", - "_from": "columnify@1.5.2", - "_npmVersion": "2.9.0", - "_nodeVersion": "2.0.1", - "_npmUser": { - "name": "timoxley", - "email": "secoif@gmail.com" + "dist": { + "shasum": "4737ddf1c7b69a8a7c340570782e947eec8e78bb", + "tarball": "http://registry.npmjs.org/columnify/-/columnify-1.5.4.tgz" }, + "gitHead": "b5373b3d6344bf59e1ab63c912c188c34bce5889", + "homepage": "https://github.com/timoxley/columnify", + "keywords": [ + "ansi", + "column", + "console", + "table", + "terminal", + "text", + "wrap" + ], + "license": "MIT", + "main": "columnify.js", "maintainers": [ { "name": "timoxley", "email": "secoif@gmail.com" } ], - "dist": { - "shasum": "6937930d47c22a9bfa20732a7fd619d47eaba65a", - "tarball": "http://registry.npmjs.org/columnify/-/columnify-1.5.2.tgz" + "name": "columnify", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/timoxley/columnify.git" + }, + "scripts": { + "bench": "npm test && node bench", + "prepublish": "make prepublish", + "pretest": "npm prune", + "test": "make prepublish && tape test/*.js | tap-spec" }, - "_resolved": "https://registry.npmjs.org/columnify/-/columnify-1.5.2.tgz" + "version": "1.5.4" } diff --git a/deps/npm/node_modules/columnify/utils.js b/deps/npm/node_modules/columnify/utils.js index 30682af3b1fe9c..df3e6cc44e8561 100644 --- a/deps/npm/node_modules/columnify/utils.js +++ b/deps/npm/node_modules/columnify/utils.js @@ -108,33 +108,46 @@ function splitIntoLines(str, max) { * @return String */ -function splitLongWords(str, max, truncationChar, result) { +function splitLongWords(str, max, truncationChar) { str = str.trim() - result = result || [] - if (!str) return result.join(' ') || '' + var result = [] var words = str.split(' ') - var word = words.shift() || str - if (wcwidth(word) > max) { - // slice is based on length no wcwidth - var i = 0 - var wwidth = 0 - var limit = max - wcwidth(truncationChar) - while (i < word.length) { - var w = wcwidth(word.charAt(i)) - if(w + wwidth > limit) - break - wwidth += w - ++i + var remainder = '' + + var truncationWidth = wcwidth(truncationChar) + + while (remainder || words.length) { + if (remainder) { + var word = remainder + remainder = '' + } else { + var word = words.shift() } - var remainder = word.slice(i) // get remainder - words.unshift(remainder) // save remainder for next loop + if (wcwidth(word) > max) { + // slice is based on length no wcwidth + var i = 0 + var wwidth = 0 + var limit = max - truncationWidth + while (i < word.length) { + var w = wcwidth(word.charAt(i)) + if (w + wwidth > limit) { + break + } + wwidth += w + ++i + } + + remainder = word.slice(i) // get remainder + // save remainder for next loop - word = word.slice(0, i) // grab truncated word - word += truncationChar // add trailing … or whatever + word = word.slice(0, i) // grab truncated word + word += truncationChar // add trailing … or whatever + } + result.push(word) } - result.push(word) - return splitLongWords(words.join(' '), max, truncationChar, result) + + return result.join(' ') } diff --git a/deps/npm/node_modules/config-chain/node_modules/proto-list/package.json b/deps/npm/node_modules/config-chain/node_modules/proto-list/package.json index 458621ad892adf..1a0d0a8ce24262 100644 --- a/deps/npm/node_modules/config-chain/node_modules/proto-list/package.json +++ b/deps/npm/node_modules/config-chain/node_modules/proto-list/package.json @@ -19,30 +19,14 @@ "devDependencies": { "tap": "0" }, - "gitHead": "9e4af12d4dddee2fd531f0fe0c21c9cfacb78ac0", + "readme": "A list of objects, bound by their prototype chain.\n\nUsed in npm's config stuff.\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/isaacs/proto-list/issues" }, "homepage": "https://github.com/isaacs/proto-list#readme", "_id": "proto-list@1.2.4", "_shasum": "212d5bfe1318306a420f6402b8e26ff39647a849", - "_from": "proto-list@>=1.2.1 <1.3.0", - "_npmVersion": "2.10.0", - "_nodeVersion": "2.0.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "212d5bfe1318306a420f6402b8e26ff39647a849", - "tarball": "http://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz" + "_resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "_from": "proto-list@>=1.2.1 <1.3.0" } diff --git a/deps/npm/node_modules/config-chain/package.json b/deps/npm/node_modules/config-chain/package.json index b25913cab0143b..f7d3e531ba894e 100644 --- a/deps/npm/node_modules/config-chain/package.json +++ b/deps/npm/node_modules/config-chain/package.json @@ -1,46 +1,68 @@ { - "name": "config-chain", - "version": "1.1.9", - "licenses": [ - { - "type": "MIT", - "url": "https://raw.githubusercontent.com/dominictarr/config-chain/master/LICENCE" - } + "_args": [ + [ + "config-chain@1.1.10", + "/Users/rebecca/code/npm" + ] ], - "description": "HANDLE CONFIGURATION ONCE AND FOR ALL", - "homepage": "http://github.com/dominictarr/config-chain", - "repository": { - "type": "git", - "url": "https://github.com/dominictarr/config-chain.git" - }, - "dependencies": { - "proto-list": "~1.2.1", - "ini": "1" + "_from": "config-chain@1.1.10", + "_id": "config-chain@1.1.10", + "_inCache": true, + "_installable": true, + "_location": "/config-chain", + "_nodeVersion": "5.3.0", + "_npmUser": { + "email": "dominic.tarr@gmail.com", + "name": "dominictarr" }, - "devDependencies": { - "tap": "0.3.0" + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "name": "config-chain", + "raw": "config-chain@1.1.10", + "rawSpec": "1.1.10", + "scope": null, + "spec": "1.1.10", + "type": "version" }, + "_requiredBy": [ + "/", + "/standard/standard-format/esformatter-jsx/js-beautify" + ], + "_resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.10.tgz", + "_shasum": "7fc383de0fcc84d711cb465bd176579cad612346", + "_shrinkwrap": null, + "_spec": "config-chain@1.1.10", + "_where": "/Users/rebecca/code/npm", "author": { - "name": "Dominic Tarr", "email": "dominic.tarr@gmail.com", + "name": "Dominic Tarr", "url": "http://dominictarr.com" }, - "scripts": { - "test": "tap test/" - }, - "gitHead": "832609897082a0a887c59dadb105f4db6de1ab4c", "bugs": { "url": "https://github.com/dominictarr/config-chain/issues" }, - "_id": "config-chain@1.1.9", - "_shasum": "39ac7d4dca84faad926124c54cff25a53aa8bf6e", - "_from": "config-chain@>=1.1.9 <1.2.0", - "_npmVersion": "2.11.0", - "_nodeVersion": "0.12.4", - "_npmUser": { - "name": "dominictarr", - "email": "dominic.tarr@gmail.com" + "dependencies": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" + }, + "description": "HANDLE CONFIGURATION ONCE AND FOR ALL", + "devDependencies": { + "tap": "0.3.0" + }, + "directories": {}, + "dist": { + "shasum": "7fc383de0fcc84d711cb465bd176579cad612346", + "tarball": "http://registry.npmjs.org/config-chain/-/config-chain-1.1.10.tgz" }, + "gitHead": "0b6db3e14b9cdbe31460292bc4caf3983f977816", + "homepage": "http://github.com/dominictarr/config-chain", + "licenses": [ + { + "type": "MIT", + "url": "https://raw.githubusercontent.com/dominictarr/config-chain/master/LICENCE" + } + ], "maintainers": [ { "name": "dominictarr", @@ -51,10 +73,15 @@ "email": "i@izs.me" } ], - "dist": { - "shasum": "39ac7d4dca84faad926124c54cff25a53aa8bf6e", - "tarball": "http://registry.npmjs.org/config-chain/-/config-chain-1.1.9.tgz" + "name": "config-chain", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/dominictarr/config-chain.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.9.tgz" + "scripts": { + "test": "tap test/" + }, + "version": "1.1.10" } diff --git a/deps/npm/node_modules/config-chain/test/save.js b/deps/npm/node_modules/config-chain/test/save.js index 783461317cced9..bc97bbd3f6f1df 100644 --- a/deps/npm/node_modules/config-chain/test/save.js +++ b/deps/npm/node_modules/config-chain/test/save.js @@ -38,7 +38,7 @@ test('test saving and loading ini files', function (t) { .save('jsonfile') .on('save', function () { t.equal(fs.readFileSync(f1, 'utf8'), - "bloo = jaus\nfoo = zoo\n") + "bloo=jaus\nfoo=zoo\n") t.equal(fs.readFileSync(f2, 'utf8'), "{\"oof\":\"ooz\",\"oolb\":\"suaj\"}") diff --git a/deps/npm/node_modules/read-installed/node_modules/debuglog/LICENSE b/deps/npm/node_modules/debuglog/LICENSE similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/debuglog/LICENSE rename to deps/npm/node_modules/debuglog/LICENSE diff --git a/deps/npm/node_modules/read-installed/node_modules/debuglog/README.md b/deps/npm/node_modules/debuglog/README.md similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/debuglog/README.md rename to deps/npm/node_modules/debuglog/README.md diff --git a/deps/npm/node_modules/read-installed/node_modules/debuglog/debuglog.js b/deps/npm/node_modules/debuglog/debuglog.js similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/debuglog/debuglog.js rename to deps/npm/node_modules/debuglog/debuglog.js diff --git a/deps/npm/node_modules/debuglog/package.json b/deps/npm/node_modules/debuglog/package.json new file mode 100644 index 00000000000000..b192d407f7e062 --- /dev/null +++ b/deps/npm/node_modules/debuglog/package.json @@ -0,0 +1,46 @@ +{ + "name": "debuglog", + "version": "1.0.1", + "description": "backport of util.debuglog from node v0.11", + "license": "MIT", + "main": "debuglog.js", + "repository": { + "type": "git", + "url": "git+https://github.com/sam-github/node-debuglog.git" + }, + "author": { + "name": "Sam Roberts", + "email": "sam@strongloop.com" + }, + "engines": { + "node": "*" + }, + "browser": { + "util": false + }, + "bugs": { + "url": "https://github.com/sam-github/node-debuglog/issues" + }, + "homepage": "https://github.com/sam-github/node-debuglog", + "_id": "debuglog@1.0.1", + "dist": { + "shasum": "aa24ffb9ac3df9a2351837cfb2d279360cd78492", + "tarball": "http://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz" + }, + "_from": "debuglog@1.0.1", + "_npmVersion": "1.4.3", + "_npmUser": { + "name": "octet", + "email": "sam@strongloop.com" + }, + "maintainers": [ + { + "name": "octet", + "email": "sam@strongloop.com" + } + ], + "directories": {}, + "_shasum": "aa24ffb9ac3df9a2351837cfb2d279360cd78492", + "_resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/dezalgo/node_modules/asap/LICENSE.md b/deps/npm/node_modules/dezalgo/node_modules/asap/LICENSE.md index ba18c61390db9a..0d82d695f7a242 100644 --- a/deps/npm/node_modules/dezalgo/node_modules/asap/LICENSE.md +++ b/deps/npm/node_modules/dezalgo/node_modules/asap/LICENSE.md @@ -18,4 +18,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/deps/npm/node_modules/dezalgo/node_modules/asap/README.md b/deps/npm/node_modules/dezalgo/node_modules/asap/README.md index 452fd8c2037099..d60a08a044d9c2 100644 --- a/deps/npm/node_modules/dezalgo/node_modules/asap/README.md +++ b/deps/npm/node_modules/dezalgo/node_modules/asap/README.md @@ -234,4 +234,3 @@ browser-only implementation. Copyright 2009-2014 by Contributors MIT License (enclosed) - diff --git a/deps/npm/node_modules/dezalgo/node_modules/asap/asap.js b/deps/npm/node_modules/dezalgo/node_modules/asap/asap.js index f04fcd58fc0b22..3a27c8cee7a597 100644 --- a/deps/npm/node_modules/dezalgo/node_modules/asap/asap.js +++ b/deps/npm/node_modules/dezalgo/node_modules/asap/asap.js @@ -62,4 +62,3 @@ RawTask.prototype.call = function () { freeTasks.push(this); } }; - diff --git a/deps/npm/node_modules/dezalgo/node_modules/asap/package.json b/deps/npm/node_modules/dezalgo/node_modules/asap/package.json index e01b3f06de9ed2..ba54d711f849cd 100644 --- a/deps/npm/node_modules/dezalgo/node_modules/asap/package.json +++ b/deps/npm/node_modules/dezalgo/node_modules/asap/package.json @@ -51,35 +51,14 @@ "wd": "^0.2.21", "weak-map": "^1.0.5" }, - "gitHead": "ccbf94d4e4a0c3afc2df13331044020a46a74ab6", + "readme": "# ASAP\n\n[![Build Status](https://travis-ci.org/kriskowal/asap.png?branch=master)](https://travis-ci.org/kriskowal/asap)\n\nPromise and asynchronous observer libraries, as well as hand-rolled callback\nprograms and libraries, often need a mechanism to postpone the execution of a\ncallback until the next available event.\n(See [Designing API’s for Asynchrony][Zalgo].)\nThe `asap` function executes a task **as soon as possible** but not before it\nreturns, waiting only for the completion of the current event and previously\nscheduled tasks.\n\n```javascript\nasap(function () {\n // ...\n});\n```\n\n[Zalgo]: http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony\n\nThis CommonJS package provides an `asap` module that exports a function that\nexecutes a task function *as soon as possible*.\n\nASAP strives to schedule events to occur before yielding for IO, reflow,\nor redrawing.\nEach event receives an independent stack, with only platform code in parent\nframes and the events run in the order they are scheduled.\n\nASAP provides a fast event queue that will execute tasks until it is\nempty before yielding to the JavaScript engine's underlying event-loop.\nWhen a task gets added to a previously empty event queue, ASAP schedules a flush\nevent, preferring for that event to occur before the JavaScript engine has an\nopportunity to perform IO tasks or rendering, thus making the first task and\nsubsequent tasks semantically indistinguishable.\nASAP uses a variety of techniques to preserve this invariant on different\nversions of browsers and Node.js.\n\nBy design, ASAP prevents input events from being handled until the task\nqueue is empty.\nIf the process is busy enough, this may cause incoming connection requests to be\ndropped, and may cause existing connections to inform the sender to reduce the\ntransmission rate or stall.\nASAP allows this on the theory that, if there is enough work to do, there is no\nsense in looking for trouble.\nAs a consequence, ASAP can interfere with smooth animation.\nIf your task should be tied to the rendering loop, consider using\n`requestAnimationFrame` instead.\nA long sequence of tasks can also effect the long running script dialog.\nIf this is a problem, you may be able to use ASAP’s cousin `setImmediate` to\nbreak long processes into shorter intervals and periodically allow the browser\nto breathe.\n`setImmediate` will yield for IO, reflow, and repaint events.\nIt also returns a handler and can be canceled.\nFor a `setImmediate` shim, consider [YuzuJS setImmediate][setImmediate].\n\n[setImmediate]: https://github.com/YuzuJS/setImmediate\n\nTake care.\nASAP can sustain infinite recursive calls without warning.\nIt will not halt from a stack overflow, and it will not consume unbounded\nmemory.\nThis is behaviorally equivalent to an infinite loop.\nJust as with infinite loops, you can monitor a Node.js process for this behavior\nwith a heart-beat signal.\nAs with infinite loops, a very small amount of caution goes a long way to\navoiding problems.\n\n```javascript\nfunction loop() {\n asap(loop);\n}\nloop();\n```\n\nIn browsers, if a task throws an exception, it will not interrupt the flushing\nof high-priority tasks.\nThe exception will be postponed to a later, low-priority event to avoid\nslow-downs.\nIn Node.js, if a task throws an exception, ASAP will resume flushing only if—and\nonly after—the error is handled by `domain.on(\"error\")` or\n`process.on(\"uncaughtException\")`.\n\n## Raw ASAP\n\nChecking for exceptions comes at a cost.\nThe package also provides an `asap/raw` module that exports the underlying\nimplementation which is faster but stalls if a task throws an exception.\nThis internal version of the ASAP function does not check for errors.\nIf a task does throw an error, it will stall the event queue unless you manually\ncall `rawAsap.requestFlush()` before throwing the error, or any time after.\n\nIn Node.js, `asap/raw` also runs all tasks outside any domain.\nIf you need a task to be bound to your domain, you will have to do it manually.\n\n```js\nif (process.domain) {\n task = process.domain.bind(task);\n}\nrawAsap(task);\n```\n\n## Tasks\n\nA task may be any object that implements `call()`.\nA function will suffice, but closures tend not to be reusable and can cause\ngarbage collector churn.\nBoth `asap` and `rawAsap` accept task objects to give you the option of\nrecycling task objects or using higher callable object abstractions.\nSee the `asap` source for an illustration.\n\n\n## Compatibility\n\nASAP is tested on Node.js v0.10 and in a broad spectrum of web browsers.\nThe following charts capture the browser test results for the most recent\nrelease.\nThe first chart shows test results for ASAP running in the main window context.\nThe second chart shows test results for ASAP running in a web worker context.\nTest results are inconclusive (grey) on browsers that do not support web\nworkers.\nThese data are captured automatically by [Continuous\nIntegration][].\n\n[Continuous Integration]: https://github.com/kriskowal/asap/blob/master/CONTRIBUTING.md\n\n![Browser Compatibility](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-results-matrix.svg)\n\n![Compatibility in Web Workers](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-worker-results-matrix.svg)\n\n## Caveats\n\nWhen a task is added to an empty event queue, it is not always possible to\nguarantee that the task queue will begin flushing immediately after the current\nevent.\nHowever, once the task queue begins flushing, it will not yield until the queue\nis empty, even if the queue grows while executing tasks.\n\nThe following browsers allow the use of [DOM mutation observers][] to access\nthe HTML [microtask queue][], and thus begin flushing ASAP's task queue\nimmediately at the end of the current event loop turn, before any rendering or\nIO:\n\n[microtask queue]: http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#microtask-queue\n[DOM mutation observers]: http://dom.spec.whatwg.org/#mutation-observers\n\n- Android 4–4.3\n- Chrome 26–34\n- Firefox 14–29\n- Internet Explorer 11\n- iPad Safari 6–7.1\n- iPhone Safari 7–7.1\n- Safari 6–7\n\nIn the absense of mutation observers, there are a few browsers, and situations\nlike web workers in some of the above browsers, where [message channels][]\nwould be a useful way to avoid falling back to timers.\nMessage channels give direct access to the HTML [task queue][], so the ASAP\ntask queue would flush after any already queued rendering and IO tasks, but\nwithout having the minimum delay imposed by timers.\nHowever, among these browsers, Internet Explorer 10 and Safari do not reliably\ndispatch messages, so they are not worth the trouble to implement.\n\n[message channels]: http://www.whatwg.org/specs/web-apps/current-work/multipage/web-messaging.html#message-channels\n[task queue]: http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#concept-task\n\n- Internet Explorer 10\n- Safair 5.0-1\n- Opera 11-12\n\nIn the absense of mutation observers, these browsers and the following browsers\nall fall back to using `setTimeout` and `setInterval` to ensure that a `flush`\noccurs.\nThe implementation uses both and cancels whatever handler loses the race, since\n`setTimeout` tends to occasionally skip tasks in unisolated circumstances.\nTimers generally delay the flushing of ASAP's task queue for four milliseconds.\n\n- Firefox 3–13\n- Internet Explorer 6–10\n- iPad Safari 4.3\n- Lynx 2.8.7\n\n\n## Heritage\n\nASAP has been factored out of the [Q][] asynchronous promise library.\nIt originally had a naïve implementation in terms of `setTimeout`, but\n[Malte Ubl][NonBlocking] provided an insight that `postMessage` might be\nuseful for creating a high-priority, no-delay event dispatch hack.\nSince then, Internet Explorer proposed and implemented `setImmediate`.\nRobert Katić began contributing to Q by measuring the performance of\nthe internal implementation of `asap`, paying particular attention to\nerror recovery.\nDomenic, Robert, and Kris Kowal collectively settled on the current strategy of\nunrolling the high-priority event queue internally regardless of what strategy\nwe used to dispatch the potentially lower-priority flush event.\nDomenic went on to make ASAP cooperate with Node.js domains.\n\n[Q]: https://github.com/kriskowal/q\n[NonBlocking]: http://www.nonblocking.io/2011/06/windownexttick.html\n\nFor further reading, Nicholas Zakas provided a thorough article on [The\nCase for setImmediate][NCZ].\n\n[NCZ]: http://www.nczonline.net/blog/2013/07/09/the-case-for-setimmediate/\n\nEmber’s RSVP promise implementation later [adopted][RSVP ASAP] the name ASAP but\nfurther developed the implentation.\nParticularly, The `MessagePort` implementation was abandoned due to interaction\n[problems with Mobile Internet Explorer][IE Problems] in favor of an\nimplementation backed on the newer and more reliable DOM `MutationObserver`\ninterface.\nThese changes were back-ported into this library.\n\n[IE Problems]: https://github.com/cujojs/when/issues/197\n[RSVP ASAP]: https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js\n\nIn addition, ASAP factored into `asap` and `asap/raw`, such that `asap` remained\nexception-safe, but `asap/raw` provided a tight kernel that could be used for\ntasks that guaranteed that they would not throw exceptions.\nThis core is useful for promise implementations that capture thrown errors in\nrejected promises and do not need a second safety net.\nAt the same time, the exception handling in `asap` was factored into separate\nimplementations for Node.js and browsers, using the the [Browserify][Browser\nConfig] `browser` property in `package.json` to instruct browser module loaders\nand bundlers, including [Browserify][], [Mr][], and [Mop][], to use the\nbrowser-only implementation.\n\n[Browser Config]: https://gist.github.com/defunctzombie/4339901\n[Browserify]: https://github.com/substack/node-browserify\n[Mr]: https://github.com/montagejs/mr\n[Mop]: https://github.com/montagejs/mop\n\n## License\n\nCopyright 2009-2014 by Contributors\nMIT License (enclosed)\n\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/kriskowal/asap/issues" }, "homepage": "https://github.com/kriskowal/asap#readme", "_id": "asap@2.0.3", "_shasum": "1fc1d1564ee11620dfca6d67029850913f9f4679", - "_from": "asap@>=2.0.0 <3.0.0", - "_npmVersion": "2.8.3", - "_nodeVersion": "1.8.1", - "_npmUser": { - "name": "kriskowal", - "email": "kris.kowal@cixar.com" - }, - "maintainers": [ - { - "name": "kriskowal", - "email": "kris.kowal@cixar.com" - }, - { - "name": "forbeslindesay", - "email": "forbes@lindesay.co.uk" - } - ], - "dist": { - "shasum": "1fc1d1564ee11620dfca6d67029850913f9f4679", - "tarball": "http://registry.npmjs.org/asap/-/asap-2.0.3.tgz" - }, - "directories": {}, "_resolved": "https://registry.npmjs.org/asap/-/asap-2.0.3.tgz", - "readme": "ERROR: No README data found!" + "_from": "asap@>=2.0.0 <3.0.0" } diff --git a/deps/npm/node_modules/editor/package.json b/deps/npm/node_modules/editor/package.json index 0e5abd3bfb2607..48c09bff305707 100644 --- a/deps/npm/node_modules/editor/package.json +++ b/deps/npm/node_modules/editor/package.json @@ -56,5 +56,6 @@ "email": "mail@substack.net" } ], - "_resolved": "https://registry.npmjs.org/editor/-/editor-1.0.0.tgz" + "_resolved": "https://registry.npmjs.org/editor/-/editor-1.0.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/fs-vacuum/package.json b/deps/npm/node_modules/fs-vacuum/package.json index c7d9895a924d72..a1eb3f128684da 100644 --- a/deps/npm/node_modules/fs-vacuum/package.json +++ b/deps/npm/node_modules/fs-vacuum/package.json @@ -34,10 +34,30 @@ "path-is-inside": "^1.0.1", "rimraf": "^2.2.8" }, - "readme": "# fs-vacuum\n\nRemove the empty branches of a directory tree, optionally up to (but not\nincluding) a specified base directory. Optionally nukes the leaf directory.\n\n## Usage\n\n```javascript\nvar logger = require(\"npmlog\");\nvar vacuum = require(\"fs-vacuum\");\n\nvar options = {\n base : \"/path/to/my/tree/root\",\n purge : true,\n log : logger.silly.bind(logger, \"myCleanup\")\n};\n\n/* Assuming there are no other files or directories in \"out\", \"to\", or \"my\",\n * the final path will just be \"/path/to/my/tree/root\".\n */\nvacuum(\"/path/to/my/tree/root/out/to/my/files\", function (error) {\n if (error) console.error(\"Unable to cleanly vacuum:\", error.message);\n});\n```\n# vacuum(directory, options, callback)\n\n* `directory` {String} Leaf node to remove. **Must be a directory, symlink, or file.**\n* `options` {Object}\n * `base` {String} No directories at or above this level of the filesystem will be removed.\n * `purge` {Boolean} If set, nuke the whole leaf directory, including its contents.\n * `log` {Function} A logging function that takes `npmlog`-compatible argument lists.\n* `callback` {Function} Function to call once vacuuming is complete.\n * `error` {Error} What went wrong along the way, if anything.\n", - "readmeFilename": "README.md", "gitHead": "498a44d987ee11bc355fe1ec479d55a689fc37ef", "_id": "fs-vacuum@1.2.7", "_shasum": "75e501f9d2889ba2fe9fe12f936ba5dad50ca35a", - "_from": "fs-vacuum@1.2.7" + "_from": "fs-vacuum@>=1.2.7 <1.3.0", + "_npmVersion": "2.14.3", + "_nodeVersion": "2.2.2", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "75e501f9d2889ba2fe9fe12f936ba5dad50ca35a", + "tarball": "http://registry.npmjs.org/fs-vacuum/-/fs-vacuum-1.2.7.tgz" + }, + "maintainers": [ + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/fs-vacuum/-/fs-vacuum-1.2.7.tgz" } diff --git a/deps/npm/node_modules/fs-write-stream-atomic/.npmignore b/deps/npm/node_modules/fs-write-stream-atomic/.npmignore new file mode 100644 index 00000000000000..2f24c57c382e41 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/.npmignore @@ -0,0 +1,3 @@ +node_modules/ +coverage/ +.nyc_output/ diff --git a/deps/npm/node_modules/fs-write-stream-atomic/.travis.yml b/deps/npm/node_modules/fs-write-stream-atomic/.travis.yml new file mode 100644 index 00000000000000..68946625271c27 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/.travis.yml @@ -0,0 +1,11 @@ +language: node_js +sudo: false +before_install: + - "npm -g install npm" +node_js: + - "0.8" + - "0.10" + - "0.12" + - "iojs" + - "4" + - "5" diff --git a/deps/npm/node_modules/fs-write-stream-atomic/index.js b/deps/npm/node_modules/fs-write-stream-atomic/index.js index d86b8c673f23ad..59b50db6d72927 100644 --- a/deps/npm/node_modules/fs-write-stream-atomic/index.js +++ b/deps/npm/node_modules/fs-write-stream-atomic/index.js @@ -1,96 +1,124 @@ var fs = require('graceful-fs') +var Writable = require('readable-stream').Writable var util = require('util') -var crypto = require('crypto') +var MurmurHash3 = require('imurmurhash') +var iferr = require('iferr') -function md5hex () { - var hash = crypto.createHash('md5') - for (var ii=0; ii ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('-v{,,}') +// => ['-v', '-v', '-v'] + +expand('file{0..2}.jpg') +// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] + +expand('file-{a..c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('file{2..0}.jpg') +// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] + +expand('file{0..4..2}.jpg') +// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] + +expand('file-{a..e..2}.jpg') +// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] + +expand('file{00..10..5}.jpg') +// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] + +expand('{{A..C},{a..c}}') +// => ['A', 'B', 'C', 'a', 'b', 'c'] + +expand('ppp{,config,oe{,conf}}') +// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] +``` + +## API + +```js +var expand = require('brace-expansion'); +``` + +### var expanded = expand(str) + +Return an array of all possible and valid expansions of `str`. If none are +found, `[str]` is returned. + +Valid expansions are: + +```js +/^(.*,)+(.+)?$/ +// {a,b,...} +``` + +A comma seperated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +A numeric sequence from `x` to `y` inclusive, with optional increment. +If `x` or `y` start with a leading `0`, all the numbers will be padded +to have equal length. Negative numbers and backwards iteration work too. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +An alphabetic sequence from `x` to `y` inclusive, with optional increment. +`x` and `y` must be exactly one character, and if given, `incr` must be a +number. + +For compatibility reasons, the string `${` is not eligible for brace expansion. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install brace-expansion +``` + +## Contributors + +- [Julian Gruber](https://github.com/juliangruber) +- [Isaac Z. Schlueter](https://github.com/isaacs) + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/example.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/example.js new file mode 100644 index 00000000000000..36cde4de5c114b --- /dev/null +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/example.js @@ -0,0 +1,7 @@ +var expand = require('./'); + +console.log(expand('http://any.org/archive{1996..1999}/vol{1..4}/part{a,b,c}.html')); +console.log(expand('http://www.numericals.com/file{1..100..10}.txt')); +console.log(expand('http://www.letters.com/file{a..z..2}.txt')); +console.log(expand('mkdir /usr/local/src/bash/{old,new,dist,bugs}')); +console.log(expand('chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}')); diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/index.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/index.js new file mode 100644 index 00000000000000..f8d40f79acde0a --- /dev/null +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/index.js @@ -0,0 +1,190 @@ +var concatMap = require('concat-map'); +var balanced = require('balanced-match'); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = /^(.*,)+(.+)?$/.test(m.body); + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + + return expansions; +} diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore similarity index 100% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/.travis.yml b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml similarity index 100% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/.travis.yml rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md new file mode 100644 index 00000000000000..2cdc8e4148cc0a --- /dev/null +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md @@ -0,0 +1,21 @@ +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile new file mode 100644 index 00000000000000..dd2730cfde0cab --- /dev/null +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile @@ -0,0 +1,5 @@ + +test: + @node_modules/.bin/tape test/*.js + +.PHONY: test diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md new file mode 100644 index 00000000000000..421f3aa5f951a2 --- /dev/null +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md @@ -0,0 +1,89 @@ +# balanced-match + +Match balanced string pairs, like `{` and `}` or `` and ``. + +[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) +[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) + +[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) + +## Example + +Get the first matching pair of braces: + +```js +var balanced = require('balanced-match'); + +console.log(balanced('{', '}', 'pre{in{nested}}post')); +console.log(balanced('{', '}', 'pre{first}between{second}post')); +``` + +The matches are: + +```bash +$ node example.js +{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } +{ start: 3, + end: 9, + pre: 'pre', + body: 'first', + post: 'between{second}post' } +``` + +## API + +### var m = balanced(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +object with those keys: + +* **start** the index of the first match of `a` +* **end** the index of the matching `b` +* **pre** the preamble, `a` and `b` not included +* **body** the match, `a` and `b` not included +* **post** the postscript, `a` and `b` not included + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`. + +### var r = balanced.range(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +array with indexes: `[ , ]`. + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]`. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install balanced-match +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js new file mode 100644 index 00000000000000..9ce76f480a4321 --- /dev/null +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js @@ -0,0 +1,4 @@ +var balanced = require('./'); + +console.log(balanced('{', '}', 'pre{in{nested}}post')); +console.log(balanced('{', '}', 'pre{first}between{second}post')); diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js new file mode 100644 index 00000000000000..75f3d71cba90bc --- /dev/null +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js @@ -0,0 +1,50 @@ +module.exports = balanced; +function balanced(a, b, str) { + var r = range(a, b, str); + + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} + +balanced.range = range; +function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; + + if (ai >= 0 && bi > 0) { + begs = []; + left = str.length; + + while (i < str.length && i >= 0 && ! result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + + bi = str.indexOf(b, i + 1); + } + + i = ai < bi && ai >= 0 ? ai : bi; + } + + if (begs.length) { + result = [ left, right ]; + } + } + + return result; +} diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json new file mode 100644 index 00000000000000..d71e6b979bee4b --- /dev/null +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json @@ -0,0 +1,98 @@ +{ + "_args": [ + [ + "balanced-match@^0.3.0", + "/Users/rebecca/code/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion" + ] + ], + "_from": "balanced-match@>=0.3.0 <0.4.0", + "_id": "balanced-match@0.3.0", + "_inCache": true, + "_installable": true, + "_location": "/fstream-npm/fstream-ignore/minimatch/brace-expansion/balanced-match", + "_nodeVersion": "4.2.1", + "_npmUser": { + "email": "julian@juliangruber.com", + "name": "juliangruber" + }, + "_npmVersion": "2.14.7", + "_phantomChildren": {}, + "_requested": { + "name": "balanced-match", + "raw": "balanced-match@^0.3.0", + "rawSpec": "^0.3.0", + "scope": null, + "spec": ">=0.3.0 <0.4.0", + "type": "range" + }, + "_requiredBy": [ + "/fstream-npm/fstream-ignore/minimatch/brace-expansion" + ], + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz", + "_shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756", + "_shrinkwrap": null, + "_spec": "balanced-match@^0.3.0", + "_where": "/Users/rebecca/code/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion", + "author": { + "email": "mail@juliangruber.com", + "name": "Julian Gruber", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/balanced-match/issues" + }, + "dependencies": {}, + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "devDependencies": { + "tape": "~4.2.2" + }, + "directories": {}, + "dist": { + "shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756", + "tarball": "http://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz" + }, + "gitHead": "a7114b0986554787e90b7ac595a043ca75ea77e5", + "homepage": "https://github.com/juliangruber/balanced-match", + "keywords": [ + "balanced", + "match", + "parse", + "regexp", + "test" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + } + ], + "name": "balanced-match", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "scripts": { + "test": "make test" + }, + "testling": { + "browsers": [ + "android-browser/4.2..latest", + "chrome/25..latest", + "chrome/canary", + "firefox/20..latest", + "firefox/nightly", + "ie/8..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "opera/12..latest", + "opera/next", + "safari/5.1..latest" + ], + "files": "test/*.js" + }, + "version": "0.3.0" +} diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js new file mode 100644 index 00000000000000..f5e98e3f2a3240 --- /dev/null +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js @@ -0,0 +1,84 @@ +var test = require('tape'); +var balanced = require('..'); + +test('balanced', function(t) { + t.deepEqual(balanced('{', '}', 'pre{in{nest}}post'), { + start: 3, + end: 12, + pre: 'pre', + body: 'in{nest}', + post: 'post' + }); + t.deepEqual(balanced('{', '}', '{{{{{{{{{in}post'), { + start: 8, + end: 11, + pre: '{{{{{{{{', + body: 'in', + post: 'post' + }); + t.deepEqual(balanced('{', '}', 'pre{body{in}post'), { + start: 8, + end: 11, + pre: 'pre{body', + body: 'in', + post: 'post' + }); + t.deepEqual(balanced('{', '}', 'pre}{in{nest}}post'), { + start: 4, + end: 13, + pre: 'pre}', + body: 'in{nest}', + post: 'post' + }); + t.deepEqual(balanced('{', '}', 'pre{body}between{body2}post'), { + start: 3, + end: 8, + pre: 'pre', + body: 'body', + post: 'between{body2}post' + }); + t.notOk(balanced('{', '}', 'nope'), 'should be notOk'); + t.deepEqual(balanced('', '', 'preinnestpost'), { + start: 3, + end: 19, + pre: 'pre', + body: 'innest', + post: 'post' + }); + t.deepEqual(balanced('', '', 'preinnestpost'), { + start: 7, + end: 23, + pre: 'pre', + body: 'innest', + post: 'post' + }); + t.deepEqual(balanced('{{', '}}', 'pre{{{in}}}post'), { + start: 3, + end: 9, + pre: 'pre', + body: '{in}', + post: 'post' + }); + t.deepEqual(balanced('{{{', '}}', 'pre{{{in}}}post'), { + start: 3, + end: 8, + pre: 'pre', + body: 'in', + post: '}post' + }); + t.deepEqual(balanced('{', '}', 'pre{{first}in{second}post'), { + start: 4, + end: 10, + pre: 'pre{', + body: 'first', + post: 'in{second}post' + }); + t.deepEqual(balanced('', 'prepost'), { + start: 3, + end: 4, + pre: 'pre', + body: '', + post: 'post' + }); + t.end(); +}); diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml similarity index 100% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE similarity index 100% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown similarity index 100% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js similarity index 100% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js similarity index 100% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js diff --git a/tools/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json similarity index 100% rename from tools/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js similarity index 100% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json new file mode 100644 index 00000000000000..14febd4da676dd --- /dev/null +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json @@ -0,0 +1,100 @@ +{ + "_args": [ + [ + "brace-expansion@^1.0.0", + "/Users/rebecca/code/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch" + ] + ], + "_from": "brace-expansion@>=1.0.0 <2.0.0", + "_id": "brace-expansion@1.1.2", + "_inCache": true, + "_installable": true, + "_location": "/fstream-npm/fstream-ignore/minimatch/brace-expansion", + "_nodeVersion": "4.2.1", + "_npmUser": { + "email": "julian@juliangruber.com", + "name": "juliangruber" + }, + "_npmVersion": "2.14.7", + "_phantomChildren": {}, + "_requested": { + "name": "brace-expansion", + "raw": "brace-expansion@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/fstream-npm/fstream-ignore/minimatch" + ], + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.2.tgz", + "_shasum": "f21445d0488b658e2771efd870eff51df29f04ef", + "_shrinkwrap": null, + "_spec": "brace-expansion@^1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch", + "author": { + "email": "mail@juliangruber.com", + "name": "Julian Gruber", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/brace-expansion/issues" + }, + "dependencies": { + "balanced-match": "^0.3.0", + "concat-map": "0.0.1" + }, + "description": "Brace expansion as known from sh/bash", + "devDependencies": { + "tape": "4.2.2" + }, + "directories": {}, + "dist": { + "shasum": "f21445d0488b658e2771efd870eff51df29f04ef", + "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.2.tgz" + }, + "gitHead": "b03773a30fa516b1374945b68e9acb6253d595fa", + "homepage": "https://github.com/juliangruber/brace-expansion", + "keywords": [], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + } + ], + "name": "brace-expansion", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/brace-expansion.git" + }, + "scripts": { + "gentest": "bash test/generate.sh", + "test": "tape test/*.js" + }, + "testling": { + "browsers": [ + "android-browser/4.2..latest", + "chrome/25..latest", + "chrome/canary", + "firefox/20..latest", + "firefox/nightly", + "ie/8..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "opera/12..latest", + "opera/next", + "safari/5.1..latest" + ], + "files": "test/*.js" + }, + "version": "1.1.2" +} diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/package.json b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/package.json new file mode 100644 index 00000000000000..51abf989189a64 --- /dev/null +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/package.json @@ -0,0 +1,60 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + "name": "minimatch", + "description": "a glob matcher in javascript", + "version": "3.0.0", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "main": "minimatch.js", + "scripts": { + "posttest": "standard minimatch.js test/*.js", + "test": "tap test/*.js" + }, + "engines": { + "node": "*" + }, + "dependencies": { + "brace-expansion": "^1.0.0" + }, + "devDependencies": { + "standard": "^3.7.2", + "tap": "^1.2.0" + }, + "license": "ISC", + "files": [ + "minimatch.js" + ], + "gitHead": "270dbea567f0af6918cb18103e98c612aa717a20", + "bugs": { + "url": "https://github.com/isaacs/minimatch/issues" + }, + "homepage": "https://github.com/isaacs/minimatch#readme", + "_id": "minimatch@3.0.0", + "_shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83", + "_from": "minimatch@>=3.0.0 <4.0.0", + "_npmVersion": "3.3.2", + "_nodeVersion": "4.0.0", + "_npmUser": { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + "dist": { + "shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83", + "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/package.json b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/package.json index 1a505bd4a2afc2..ad55dd41f1ac02 100644 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/package.json +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/package.json @@ -6,7 +6,7 @@ }, "name": "fstream-ignore", "description": "A thing for ignoring files based on globs", - "version": "1.0.2", + "version": "1.0.3", "repository": { "type": "git", "url": "git://github.com/isaacs/fstream-ignore.git" @@ -18,39 +18,43 @@ "dependencies": { "fstream": "^1.0.0", "inherits": "2", - "minimatch": "^2.0.1" + "minimatch": "^3.0.0" }, "devDependencies": { - "tap": "", + "mkdirp": "", "rimraf": "", - "mkdirp": "" + "tap": "^2.2.0" }, "license": "ISC", - "gitHead": "20363d39660671c0de746bd07a0d07de7090d085", + "gitHead": "86c835eef61049496003f6b90c1e6c1236c92d6a", "bugs": { "url": "https://github.com/isaacs/fstream-ignore/issues" }, - "homepage": "https://github.com/isaacs/fstream-ignore", - "_id": "fstream-ignore@1.0.2", - "_shasum": "18c891db01b782a74a7bff936a0f24997741c7ab", + "homepage": "https://github.com/isaacs/fstream-ignore#readme", + "_id": "fstream-ignore@1.0.3", + "_shasum": "4c74d91fa88b22b42f4f86a18a2820dd79d8fcdd", "_from": "fstream-ignore@>=1.0.0 <2.0.0", - "_npmVersion": "2.1.11", - "_nodeVersion": "0.10.16", + "_npmVersion": "2.14.8", + "_nodeVersion": "4.2.1", "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + "dist": { + "shasum": "4c74d91fa88b22b42f4f86a18a2820dd79d8fcdd", + "tarball": "http://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.3.tgz" }, "maintainers": [ { "name": "isaacs", - "email": "i@izs.me" + "email": "isaacs@npmjs.com" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" } ], - "dist": { - "shasum": "18c891db01b782a74a7bff936a0f24997741c7ab", - "tarball": "http://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.2.tgz" - }, "directories": {}, - "_resolved": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.2.tgz", + "_resolved": "https://registry.npmjs.org/fstream-ignore/-/fstream-ignore-1.0.3.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/test/00-setup.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/test/00-setup.js index 7d7e4a1b784c23..351bcd10f15782 100644 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/test/00-setup.js +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/test/00-setup.js @@ -68,4 +68,3 @@ tap.test("create fixtures", function (t) { }) t.end() }) - diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/test/common.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/test/common.js index 0e6cd989c978fa..79470eba617344 100644 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/test/common.js +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/test/common.js @@ -1,5 +1,5 @@ if (require.main === module) { - console.log("0..1") + console.log("1..1") console.log("ok 1 trivial pass") return } diff --git a/deps/npm/node_modules/fstream-npm/package.json b/deps/npm/node_modules/fstream-npm/package.json index f3ab7b8faf1adc..7b5da94c0440d3 100644 --- a/deps/npm/node_modules/fstream-npm/package.json +++ b/deps/npm/node_modules/fstream-npm/package.json @@ -6,10 +6,10 @@ }, "name": "fstream-npm", "description": "fstream class for creating npm packages", - "version": "1.0.5", + "version": "1.0.7", "repository": { "type": "git", - "url": "git://github.com/isaacs/fstream-npm.git" + "url": "git+https://github.com/npm/fstream-npm.git" }, "scripts": { "test": "standard && tap test/*.js" @@ -29,12 +29,12 @@ "license": "ISC", "readme": "# fstream-npm\n\nThis is an fstream DirReader class that will read a directory and filter\nthings according to the semantics of what goes in an npm package.\n\nFor example:\n\n```javascript\n// This will print out all the files that would be included\n// by 'npm publish' or 'npm install' of this directory.\n\nvar FN = require(\"fstream-npm\")\nFN({ path: \"./\" })\n .on(\"child\", function (e) {\n console.error(e.path.substr(e.root.path.length + 1))\n })\n```\n\n", "readmeFilename": "README.md", - "gitHead": "f6ec06b9c45d7330213a5b446fff424b5a74e197", + "gitHead": "d57b6b24f91156067f73417dd8785c6312bfc75f", "bugs": { - "url": "https://github.com/isaacs/fstream-npm/issues" + "url": "https://github.com/npm/fstream-npm/issues" }, - "homepage": "https://github.com/isaacs/fstream-npm#readme", - "_id": "fstream-npm@1.0.5", - "_shasum": "4c1d1cbc6da95c745f8d2c52077a1d2e7b337206", - "_from": "fstream-npm@>=1.0.5 <1.1.0" + "homepage": "https://github.com/npm/fstream-npm#readme", + "_id": "fstream-npm@1.0.7", + "_shasum": "7ed0d1ac13d7686dd9e1bf6ceb8be273bf6d2f86", + "_from": "fstream-npm@>=1.0.7 <1.1.0" } diff --git a/deps/npm/node_modules/fstream-npm/test/ignores.js b/deps/npm/node_modules/fstream-npm/test/ignores.js index fef5dcc222bc70..ac94251f72caa2 100644 --- a/deps/npm/node_modules/fstream-npm/test/ignores.js +++ b/deps/npm/node_modules/fstream-npm/test/ignores.js @@ -9,8 +9,6 @@ var Packer = require('..') var pkg = join(__dirname, 'test-package') -var gitDir = join(pkg, '.git') - var elfJS = function () {/* module.exports = function () { console.log("i'm a elf") @@ -30,31 +28,49 @@ test('setup', function (t) { var included = [ 'package.json', - 'elf.js' + 'elf.js', + join('deps', 'foo', 'config', 'config.gypi') ] test('follows npm package ignoring rules', function (t) { var subject = new Packer({ path: pkg, type: 'Directory', isDirectory: true }) + var filenames = [] subject.on('entry', function (entry) { t.equal(entry.type, 'File', 'only files in this package') - var filename = entry.basename - t.ok( - included.indexOf(filename) > -1, - filename + ' is included' - ) + + // include relative path in filename + var filename = entry._path.slice(entry.root._path.length + 1) + + filenames.push(filename) }) // need to do this so fstream doesn't explode when files are removed from // under it - subject.on('end', function () { t.end() }) + subject.on('end', function () { + // ensure we get *exactly* the results we expect by comparing in both + // directions + filenames.forEach(function (filename) { + t.ok( + included.indexOf(filename) > -1, + filename + ' is included' + ) + }) + included.forEach(function (filename) { + t.ok( + filenames.indexOf(filename) > -1, + filename + ' is not included' + ) + }) + t.end() + }) }) test('cleanup', function (t) { - cleanup() - t.end() + // rimraf.sync chokes here for some reason + rimraf(pkg, function () { t.end() }) }) function setup () { - cleanup() + rimraf.sync(pkg) mkdirp.sync(pkg) fs.writeFileSync( join(pkg, 'package.json'), @@ -71,25 +87,46 @@ function setup () { 'packaged=false' ) - var build = join(pkg, 'build') - mkdirp.sync(build) fs.writeFileSync( - join(build, 'config.gypi'), + join(pkg, '.npmignore'), + '.npmignore\ndummy\npackage.json' + ) + + fs.writeFileSync( + join(pkg, 'dummy'), + 'foo' + ) + + var buildDir = join(pkg, 'build') + mkdirp.sync(buildDir) + fs.writeFileSync( + join(buildDir, 'config.gypi'), "i_wont_be_included_by_fstream='with any luck'" ) + var depscfg = join(pkg, 'deps', 'foo', 'config') + mkdirp.sync(depscfg) + fs.writeFileSync( + join(depscfg, 'config.gypi'), + "i_will_be_included_by_fstream='with any luck'" + ) + fs.writeFileSync( - join(build, 'npm-debug.log'), + join(buildDir, 'npm-debug.log'), '0 lol\n' ) + var gitDir = join(pkg, '.git') mkdirp.sync(gitDir) fs.writeFileSync( join(gitDir, 'gitstub'), "won't fool git, also won't be included by fstream" ) -} -function cleanup () { - rimraf.sync(pkg) + var historyDir = join(pkg, 'node_modules/history') + mkdirp.sync(historyDir) + fs.writeFileSync( + join(historyDir, 'README.md'), + "please don't include me" + ) } diff --git a/deps/npm/node_modules/fstream/package.json b/deps/npm/node_modules/fstream/package.json index 8c008195442823..dd1f45fc99faf6 100644 --- a/deps/npm/node_modules/fstream/package.json +++ b/deps/npm/node_modules/fstream/package.json @@ -29,8 +29,6 @@ "test": "standard && tap examples/*.js" }, "license": "ISC", - "readme": "Like FS streams, but with stat on them, and supporting directories and\nsymbolic links, as well as normal files. Also, you can use this to set\nthe stats on a file, even if you don't change its contents, or to create\na symlink, etc.\n\nSo, for example, you can \"write\" a directory, and it'll call `mkdir`. You\ncan specify a uid and gid, and it'll call `chown`. You can specify a\n`mtime` and `atime`, and it'll call `utimes`. You can call it a symlink\nand provide a `linkpath` and it'll call `symlink`.\n\nNote that it won't automatically resolve symbolic links. So, if you\ncall `fstream.Reader('/some/symlink')` then you'll get an object\nthat stats and then ends immediately (since it has no data). To follow\nsymbolic links, do this: `fstream.Reader({path:'/some/symlink', follow:\ntrue })`.\n\nThere are various checks to make sure that the bytes emitted are the\nsame as the intended size, if the size is set.\n\n## Examples\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n })\n .write(\"hello\\n\")\n .end()\n```\n\nThis will create the directories if they're missing, and then write\n`hello\\n` into the file, chmod it to 0755, and assert that 6 bytes have\nbeen written when it's done.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n , flags: \"a\"\n })\n .write(\"hello\\n\")\n .end()\n```\n\nYou can pass flags in, if you want to append to a file.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/symlink\"\n , linkpath: \"./file\"\n , SymbolicLink: true\n , mode: \"0755\" // octal strings supported\n })\n .end()\n```\n\nIf isSymbolicLink is a function, it'll be called, and if it returns\ntrue, then it'll treat it as a symlink. If it's not a function, then\nany truish value will make a symlink, or you can set `type:\n'SymbolicLink'`, which does the same thing.\n\nNote that the linkpath is relative to the symbolic link location, not\nthe parent dir or cwd.\n\n```javascript\nfstream\n .Reader(\"path/to/dir\")\n .pipe(fstream.Writer(\"path/to/other/dir\"))\n```\n\nThis will do like `cp -Rp path/to/dir path/to/other/dir`. If the other\ndir exists and isn't a directory, then it'll emit an error. It'll also\nset the uid, gid, mode, etc. to be identical. In this way, it's more\nlike `rsync -a` than simply a copy.\n", - "readmeFilename": "README.md", "gitHead": "d9f81146c50e687f1df04c1a0e7e4c173eb3dae2", "bugs": { "url": "https://github.com/isaacs/fstream/issues" @@ -38,5 +36,36 @@ "homepage": "https://github.com/isaacs/fstream#readme", "_id": "fstream@1.0.8", "_shasum": "7e8d7a73abb3647ef36e4b8a15ca801dba03d038", - "_from": "fstream@1.0.8" + "_from": "fstream@>=1.0.8 <1.1.0", + "_npmVersion": "2.14.3", + "_nodeVersion": "2.2.2", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "7e8d7a73abb3647ef36e4b8a15ca801dba03d038", + "tarball": "http://registry.npmjs.org/fstream/-/fstream-1.0.8.tgz" + }, + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.8.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/github-url-from-git/LICENSE b/deps/npm/node_modules/github-url-from-git/LICENSE deleted file mode 100644 index b7409302c44e35..00000000000000 --- a/deps/npm/node_modules/github-url-from-git/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2013 TJ Holowaychuk - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/github-url-from-git/Makefile b/deps/npm/node_modules/github-url-from-git/Makefile deleted file mode 100644 index 37f330e81b98c1..00000000000000 --- a/deps/npm/node_modules/github-url-from-git/Makefile +++ /dev/null @@ -1,5 +0,0 @@ - -test: - @./node_modules/.bin/mocha test.js --reporter spec --require should - -.PHONY: test diff --git a/deps/npm/node_modules/github-url-from-git/Readme.md b/deps/npm/node_modules/github-url-from-git/Readme.md deleted file mode 100644 index 9dccaa8db696fa..00000000000000 --- a/deps/npm/node_modules/github-url-from-git/Readme.md +++ /dev/null @@ -1,92 +0,0 @@ - -# github-url-from-git - -```js -describe('parse(url)', function(){ - it('should support git://*', function(){ - var url = 'git://github.com/jamesor/mongoose-versioner'; - parse(url).should.equal('https://github.com/jamesor/mongoose-versioner'); - }) - - it('should support git://*.git', function(){ - var url = 'git://github.com/treygriffith/cellar.git'; - parse(url).should.equal('https://github.com/treygriffith/cellar'); - }) - - it('should support https://*', function(){ - var url = 'https://github.com/Empeeric/i18n-node'; - parse(url).should.equal('https://github.com/Empeeric/i18n-node'); - }) - - it('should support https://*.git', function(){ - var url = 'https://jpillora@github.com/banchee/tranquil.git'; - parse(url).should.equal('https://github.com/banchee/tranquil'); - }) - - it('should return undefined on failure', function(){ - var url = 'git://github.com/justgord/.git'; - assert(null == parse(url)); - }) - - it('should parse git@github.com:bcoe/thumbd.git', function() { - var url = 'git@github.com:bcoe/thumbd.git'; - parse(url).should.eql('https://github.com/bcoe/thumbd'); - }) - - it('should parse git@github.com:bcoe/thumbd.git#2.7.0', function() { - var url = 'git@github.com:bcoe/thumbd.git#2.7.0'; - parse(url).should.eql('https://github.com/bcoe/thumbd'); - }) - - it('should parse git+https://github.com/bcoe/thumbd.git', function() { - var url = 'git+https://github.com/bcoe/thumbd.git'; - parse(url).should.eql('https://github.com/bcoe/thumbd'); - }) - - it('should parse git+ssh://github.com/bcoe/thumbd.git', function() { - var url = 'git+ssh://github.com/bcoe/thumbd.git'; - parse(url).should.eql('https://github.com/bcoe/thumbd'); - }) - - it('should parse https://EastCloud@github.com/EastCloud/node-websockets.git', function() { - var url = 'https://EastCloud@github.com/EastCloud/node-websockets.git'; - parse(url).should.eql('https://github.com/EastCloud/node-websockets'); - }) - - // gist urls. - - it('should parse git@gist urls', function() { - var url = 'git@gist.github.com:3135914.git'; - parse(url).should.equal('https://gist.github.com/3135914') - }) - - it('should parse https://gist urls', function() { - var url = 'https://gist.github.com/3135914.git'; - parse(url).should.equal('https://gist.github.com/3135914') - }) - - // Handle arbitrary GitHub Enterprise domains. - - it('should parse parse extra GHE urls provided', function() { - var url = 'git://github.example.com/treygriffith/cellar.git'; - parse( - url, {extraBaseUrls: ['github.example.com']} - ).should.equal('https://github.example.com/treygriffith/cellar'); - }); - - it('should parse GHE urls with multiple subdomains', function() { - var url = 'git://github.internal.example.com/treygriffith/cellar.git'; - parse( - url, {extraBaseUrls: ['github.internal.example.com']} - ).should.equal('https://github.internal.example.com/treygriffith/cellar'); - }); -}) - -describe('re', function() { - it('should expose GitHub url parsing regex', function() { - parse.re.source.should.equal( - /^(?:https?:\/\/|git:\/\/)?(?:[^@]+@)?(gist.github.com|github.com)[:\/]([^\/]+\/[^\/]+?|[0-9]+)$/.source - ) - }); -}) -``` diff --git a/deps/npm/node_modules/github-url-from-git/index.js b/deps/npm/node_modules/github-url-from-git/index.js deleted file mode 100644 index 44872e8c10c2f8..00000000000000 --- a/deps/npm/node_modules/github-url-from-git/index.js +++ /dev/null @@ -1,32 +0,0 @@ -// convert git:// form url to github URL, e.g., -// git://github.com/bcoe/foo.git -// https://github.com/bcoe/foo. -function githubUrlFromGit(url, opts){ - try { - var m = re(opts).exec(url.replace(/\.git(#.*)?$/, '')); - var host = m[1]; - var path = m[2]; - return 'https://' + host + '/' + path; - } catch (err) { - // ignore - } -}; - -// generate the git:// parsing regex -// with options, e.g., the ability -// to specify multiple GHE domains. -function re(opts) { - opts = opts || {}; - // whitelist of URLs that should be treated as GitHub repos. - var baseUrls = ['gist.github.com', 'github.com'].concat(opts.extraBaseUrls || []); - // build regex from whitelist. - return new RegExp( - /^(?:https?:\/\/|git:\/\/|git\+ssh:\/\/|git\+https:\/\/)?(?:[^@]+@)?/.source + - '(' + baseUrls.join('|') + ')' + - /[:\/]([^\/]+\/[^\/]+?|[0-9]+)$/.source - ); -} - -githubUrlFromGit.re = re(); - -module.exports = githubUrlFromGit; diff --git a/deps/npm/node_modules/github-url-from-git/package.json b/deps/npm/node_modules/github-url-from-git/package.json deleted file mode 100644 index 229af333ca4146..00000000000000 --- a/deps/npm/node_modules/github-url-from-git/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "github-url-from-git", - "version": "1.4.0", - "description": "Parse a github git url and return the github repo url", - "main": "index.js", - "scripts": { - "test": "mocha test.js --reporter spec --require should" - }, - "repository": { - "type": "git", - "url": "https://github.com/visionmedia/node-github-url-from-git.git" - }, - "keywords": [ - "github", - "git", - "url", - "parser" - ], - "author": { - "name": "TJ Holowaychuk" - }, - "license": "MIT", - "devDependencies": { - "better-assert": "~1.0.0", - "mocha": "~1.9.0", - "should": "~1.2.2" - }, - "gitHead": "154df00b0b590c29be5d2a5822e7b2e160b75345", - "bugs": { - "url": "https://github.com/visionmedia/node-github-url-from-git/issues" - }, - "homepage": "https://github.com/visionmedia/node-github-url-from-git", - "_id": "github-url-from-git@1.4.0", - "_shasum": "285e6b520819001bde128674704379e4ff03e0de", - "_from": "github-url-from-git@>=1.4.0-0 <2.0.0-0", - "_npmVersion": "2.0.0-alpha.7", - "_npmUser": { - "name": "bcoe", - "email": "bencoe@gmail.com" - }, - "maintainers": [ - { - "name": "tjholowaychuk", - "email": "tj@vision-media.ca" - }, - { - "name": "bcoe", - "email": "bencoe@gmail.com" - } - ], - "dist": { - "shasum": "285e6b520819001bde128674704379e4ff03e0de", - "tarball": "http://registry.npmjs.org/github-url-from-git/-/github-url-from-git-1.4.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/github-url-from-git/-/github-url-from-git-1.4.0.tgz" -} diff --git a/deps/npm/node_modules/github-url-from-git/test.js b/deps/npm/node_modules/github-url-from-git/test.js deleted file mode 100644 index 93aa38bb1f9f9f..00000000000000 --- a/deps/npm/node_modules/github-url-from-git/test.js +++ /dev/null @@ -1,90 +0,0 @@ -var parse = require('./'); -var assert = require('better-assert'); - -describe('parse(url)', function(){ - it('should support git://*', function(){ - var url = 'git://github.com/jamesor/mongoose-versioner'; - parse(url).should.equal('https://github.com/jamesor/mongoose-versioner'); - }) - - it('should support git://*.git', function(){ - var url = 'git://github.com/treygriffith/cellar.git'; - parse(url).should.equal('https://github.com/treygriffith/cellar'); - }) - - it('should support https://*', function(){ - var url = 'https://github.com/Empeeric/i18n-node'; - parse(url).should.equal('https://github.com/Empeeric/i18n-node'); - }) - - it('should support https://*.git', function(){ - var url = 'https://jpillora@github.com/banchee/tranquil.git'; - parse(url).should.equal('https://github.com/banchee/tranquil'); - }) - - it('should return undefined on failure', function(){ - var url = 'git://github.com/justgord/.git'; - assert(null == parse(url)); - }) - - it('should parse git@github.com:bcoe/thumbd.git', function() { - var url = 'git@github.com:bcoe/thumbd.git'; - parse(url).should.eql('https://github.com/bcoe/thumbd'); - }) - - it('should parse git@github.com:bcoe/thumbd.git#2.7.0', function() { - var url = 'git@github.com:bcoe/thumbd.git#2.7.0'; - parse(url).should.eql('https://github.com/bcoe/thumbd'); - }) - - it('should parse git+https://github.com/bcoe/thumbd.git', function() { - var url = 'git+https://github.com/bcoe/thumbd.git'; - parse(url).should.eql('https://github.com/bcoe/thumbd'); - }) - - it('should parse git+ssh://github.com/bcoe/thumbd.git', function() { - var url = 'git+ssh://github.com/bcoe/thumbd.git'; - parse(url).should.eql('https://github.com/bcoe/thumbd'); - }) - - it('should parse https://EastCloud@github.com/EastCloud/node-websockets.git', function() { - var url = 'https://EastCloud@github.com/EastCloud/node-websockets.git'; - parse(url).should.eql('https://github.com/EastCloud/node-websockets'); - }) - - // gist urls. - - it('should parse git@gist urls', function() { - var url = 'git@gist.github.com:3135914.git'; - parse(url).should.equal('https://gist.github.com/3135914') - }) - - it('should parse https://gist urls', function() { - var url = 'https://gist.github.com/3135914.git'; - parse(url).should.equal('https://gist.github.com/3135914') - }) - - // Handle arbitrary GitHub Enterprise domains. - - it('should parse parse extra GHE urls provided', function() { - var url = 'git://github.example.com/treygriffith/cellar.git'; - parse( - url, {extraBaseUrls: ['github.example.com']} - ).should.equal('https://github.example.com/treygriffith/cellar'); - }); - - it('should parse GHE urls with multiple subdomains', function() { - var url = 'git://github.internal.example.com/treygriffith/cellar.git'; - parse( - url, {extraBaseUrls: ['github.internal.example.com']} - ).should.equal('https://github.internal.example.com/treygriffith/cellar'); - }); -}) - -describe('re', function() { - it('should expose GitHub url parsing regex', function() { - parse.re.source.should.equal( - /^(?:https?:\/\/|git:\/\/|git\+ssh:\/\/|git\+https:\/\/)?(?:[^@]+@)?(gist.github.com|github.com)[:\/]([^\/]+\/[^\/]+?|[0-9]+)$/.source - ) - }); -}) diff --git a/deps/npm/node_modules/github-url-from-username-repo/.npmignore b/deps/npm/node_modules/github-url-from-username-repo/.npmignore deleted file mode 100644 index 39747c08b4dc95..00000000000000 --- a/deps/npm/node_modules/github-url-from-username-repo/.npmignore +++ /dev/null @@ -1,13 +0,0 @@ -*.swp -.*.swp - -.DS_Store -*~ -.project -.settings -npm-debug.log -coverage.html -.idea -lib-cov - -node_modules \ No newline at end of file diff --git a/deps/npm/node_modules/github-url-from-username-repo/.travis.yml b/deps/npm/node_modules/github-url-from-username-repo/.travis.yml deleted file mode 100644 index a12e3f0fdebc13..00000000000000 --- a/deps/npm/node_modules/github-url-from-username-repo/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" \ No newline at end of file diff --git a/deps/npm/node_modules/github-url-from-username-repo/LICENSE b/deps/npm/node_modules/github-url-from-username-repo/LICENSE deleted file mode 100644 index 44c152ba75756c..00000000000000 --- a/deps/npm/node_modules/github-url-from-username-repo/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) Robert Kowalski ("Author") -All rights reserved. - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/deps/npm/node_modules/github-url-from-username-repo/README.md b/deps/npm/node_modules/github-url-from-username-repo/README.md deleted file mode 100644 index 9adbee0ea38635..00000000000000 --- a/deps/npm/node_modules/github-url-from-username-repo/README.md +++ /dev/null @@ -1,21 +0,0 @@ -[![Build Status](https://travis-ci.org/robertkowalski/github-url-from-username-repo.png?branch=master)](https://travis-ci.org/robertkowalski/github-url-from-username-repo) -[![Dependency Status](https://gemnasium.com/robertkowalski/github-url-from-username-repo.png)](https://gemnasium.com/robertkowalski/github-url-from-username-repo) - - -# github-url-from-username-repo - -## API - -### getUrl(url, [forBrowser]) - -Get's the url normalized for npm. -If `forBrowser` is true, return a GitHub url that is usable in a webbrowser. - -## Usage - -```javascript - -var getUrl = require("github-url-from-username-repo") -getUrl("visionmedia/express") // https://github.com/visionmedia/express - -``` diff --git a/deps/npm/node_modules/github-url-from-username-repo/index.js b/deps/npm/node_modules/github-url-from-username-repo/index.js deleted file mode 100644 index f9d77f952f59fa..00000000000000 --- a/deps/npm/node_modules/github-url-from-username-repo/index.js +++ /dev/null @@ -1,21 +0,0 @@ -module.exports = getUrl - -function getUrl (r, forBrowser) { - if (!r) return null - // Regex taken from https://github.com/npm/npm-package-arg/commit/01dce583c64afae07b66a2a8a6033aeba871c3cd - // Note: This does not fully test the git ref format. - // See https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html - // - // The only way to do this properly would be to shell out to - // git-check-ref-format, and as this is a fast sync function, - // we don't want to do that. Just let git fail if it turns - // out that the commit-ish is invalid. - // GH usernames cannot start with . or - - if (/^[^@%\/\s\.-][^:@%\/\s]*\/[^@\s\/%]+(?:#.*)?$/.test(r)) { - if (forBrowser) - r = r.replace("#", "/tree/") - return "https://github.com/" + r - } - - return null -} diff --git a/deps/npm/node_modules/github-url-from-username-repo/package.json b/deps/npm/node_modules/github-url-from-username-repo/package.json deleted file mode 100644 index f8aa80d5b6fb0b..00000000000000 --- a/deps/npm/node_modules/github-url-from-username-repo/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "github-url-from-username-repo", - "version": "1.0.2", - "description": "Create urls from username/repo", - "main": "index.js", - "scripts": { - "test": "mocha -R spec" - }, - "devDependencies": { - "mocha": "~1.13.0" - }, - "repository": { - "type": "git", - "url": "git@github.com:robertkowalski/github-url-from-username-repo.git" - }, - "author": { - "name": "Robert Kowalski", - "email": "rok@kowalski.gd" - }, - "license": "BSD-2-Clause", - "bugs": { - "url": "https://github.com/robertkowalski/github-url-from-username-repo/issues" - }, - "keywords": [ - "git", - "github", - "repo" - ], - "readme": "[![Build Status](https://travis-ci.org/robertkowalski/github-url-from-username-repo.png?branch=master)](https://travis-ci.org/robertkowalski/github-url-from-username-repo)\n[![Dependency Status](https://gemnasium.com/robertkowalski/github-url-from-username-repo.png)](https://gemnasium.com/robertkowalski/github-url-from-username-repo)\n\n\n# github-url-from-username-repo\n\n## API\n\n### getUrl(url, [forBrowser])\n\nGet's the url normalized for npm.\nIf `forBrowser` is true, return a GitHub url that is usable in a webbrowser.\n\n## Usage\n\n```javascript\n\nvar getUrl = require(\"github-url-from-username-repo\")\ngetUrl(\"visionmedia/express\") // https://github.com/visionmedia/express\n\n```\n", - "readmeFilename": "README.md", - "gitHead": "d404a13f7f04edaed0e2f068a43b81230b8c7aee", - "homepage": "https://github.com/robertkowalski/github-url-from-username-repo", - "_id": "github-url-from-username-repo@1.0.2", - "_shasum": "7dd79330d2abe69c10c2cef79714c97215791dfa", - "_from": "github-url-from-username-repo@>=1.0.2-0 <2.0.0-0" -} diff --git a/deps/npm/node_modules/github-url-from-username-repo/test/index.js b/deps/npm/node_modules/github-url-from-username-repo/test/index.js deleted file mode 100644 index 10fe3a34cc37c3..00000000000000 --- a/deps/npm/node_modules/github-url-from-username-repo/test/index.js +++ /dev/null @@ -1,70 +0,0 @@ -var assert = require("assert") -var getUrl = require("../") - -describe("github url from username/repo", function () { - it("returns a github url for the username/repo", function () { - var url = getUrl("visionmedia/express") - assert.equal("https://github.com/visionmedia/express", url) - }) - - it("returns null if it does not match", function () { - var url = getUrl("package") - assert.deepEqual(null, url) - }) - - it("returns null if no repo/user was given", function () { - var url = getUrl() - assert.deepEqual(null, url) - }) - - it("returns null for something that's already a URI", function () { - var url = getUrl("file:../relative") - assert.deepEqual(null, url) - }) - - it("works with .", function () { - var url = getUrl("component/.download.er.js.") - assert.equal("https://github.com/component/.download.er.js.", url) - }) - - it("works with . in the beginning", function () { - var url = getUrl("component/.downloader.js") - assert.equal("https://github.com/component/.downloader.js", url) - }) - - it("works with -", function () { - var url = getUrl("component/-dow-nloader.j-s") - assert.equal("https://github.com/component/-dow-nloader.j-s", url) - }) - - it("can handle branches with #", function () { - var url = getUrl( - "component/entejs#1c3e1fe71640b4b477f04d947bd53c473799b277") - - assert.equal("https://github.com/component/entejs#1c3e1fe71640b" + - "4b477f04d947bd53c473799b277", url) - }) - - it("can handle branches with slashes", function () { - var url = getUrl( - "component/entejs#some/branch/name") - - assert.equal("https://github.com/component/entejs#some/branch/name", url) - }) - - describe("browser mode", function () { - it("is able to return urls for branches", function () { - var url = getUrl( - "component/entejs#1c3e1fe71640b4b477f04d947bd53c473799b277", true) - - assert.equal("https://github.com/component/entejs/tree/1c3e1fe71640b" + - "4b477f04d947bd53c473799b277", url) - }) - it("is able to return urls without a branch for the browser", function () { - var url = getUrl( - "component/entejs", true) - - assert.equal("https://github.com/component/entejs", url) - }) - }) -}) diff --git a/deps/npm/node_modules/glob/README.md b/deps/npm/node_modules/glob/README.md index 063cf950ac0c29..9dd9384fa143c3 100644 --- a/deps/npm/node_modules/glob/README.md +++ b/deps/npm/node_modules/glob/README.md @@ -1,9 +1,9 @@ -[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Dependency Status](https://david-dm.org/isaacs/node-glob.svg)](https://david-dm.org/isaacs/node-glob) [![devDependency Status](https://david-dm.org/isaacs/node-glob/dev-status.svg)](https://david-dm.org/isaacs/node-glob#info=devDependencies) [![optionalDependency Status](https://david-dm.org/isaacs/node-glob/optional-status.svg)](https://david-dm.org/isaacs/node-glob#info=optionalDependencies) - # Glob Match files using the patterns the shell uses, like stars and stuff. +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) + This is a glob implementation in JavaScript. It uses the `minimatch` library to do its matching. @@ -11,6 +11,12 @@ library to do its matching. ## Usage +Install with npm + +``` +npm i glob +``` + ```javascript var glob = require("glob") @@ -74,14 +80,6 @@ slashes in it, then it will seek for any file anywhere in the tree with a matching basename. For example, `*.js` would match `test/simple/basic.js`. -### Negation - -The intent for negation would be for a pattern starting with `!` to -match everything that *doesn't* match the supplied pattern. However, -the implementation is weird, and for the time being, this should be -avoided. The behavior is deprecated in version 5, and will be removed -entirely in version 6. - ### Empty Sets If no matching files are found, then an empty array is returned. This @@ -114,19 +112,19 @@ options. ## glob(pattern, [options], cb) -* `pattern` {String} Pattern to be matched -* `options` {Object} -* `cb` {Function} - * `err` {Error | null} - * `matches` {Array} filenames found matching the pattern +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* `cb` `{Function}` + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern Perform an asynchronous glob search. ## glob.sync(pattern, [options]) -* `pattern` {String} Pattern to be matched -* `options` {Object} -* return: {Array} filenames found matching the pattern +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* return: `{Array}` filenames found matching the pattern Perform a synchronous glob search. @@ -144,11 +142,11 @@ immediately. ### new glob.Glob(pattern, [options], [cb]) -* `pattern` {String} pattern to search for -* `options` {Object} -* `cb` {Function} Called when an error occurs, or matches are found - * `err` {Error | null} - * `matches` {Array} filenames found matching the pattern +* `pattern` `{String}` pattern to search for +* `options` `{Object}` +* `cb` `{Function}` Called when an error occurs, or matches are found + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern Note that if the `sync` flag is set in the options, then matches will be immediately available on the `g.found` member. @@ -164,8 +162,8 @@ be immediately available on the `g.found` member. values: * `false` - Path does not exist * `true` - Path exists - * `'DIR'` - Path exists, and is not a directory - * `'FILE'` - Path exists, and is a directory + * `'FILE'` - Path exists, and is not a directory + * `'DIR'` - Path exists, and is a directory * `[file, entries, ...]` - Path exists, is a directory, and the array value is the results of `fs.readdir` * `statCache` Cache of `fs.stat` results, to prevent statting the same @@ -182,7 +180,8 @@ be immediately available on the `g.found` member. matches found. If the `nonull` option is set, and no match was found, then the `matches` list contains the original pattern. The matches are sorted, unless the `nosort` flag is set. -* `match` Every time a match is found, this is emitted with the matched. +* `match` Every time a match is found, this is emitted with the specific + thing that matched. It is not deduplicated or resolved to a realpath. * `error` Emitted when an unexpected error is encountered, or whenever any fs error occurs if `options.strict` is set. * `abort` When `abort()` is called, this event is raised. @@ -264,7 +263,9 @@ the filesystem. equivalent to `**/*.js`, matching all js files in all directories. * `nodir` Do not match directories, only files. (Note: to match *only* directories, simply put a `/` at the end of the pattern.) -* `ignore` Add a pattern or an array of patterns to exclude matches. +* `ignore` Add a pattern or an array of glob patterns to exclude matches. + Note: `ignore` patterns are *always* in `dot:true` mode, regardless + of any other settings. * `follow` Follow symlinked directories when expanding `**` patterns. Note that this can result in a lot of duplicate references in the presence of cyclic links. @@ -272,10 +273,6 @@ the filesystem. In the case of a symlink that cannot be resolved, the full absolute path to the matched entry is returned (though it will usually be a broken symlink) -* `nonegate` Suppress deprecated `negate` behavior. (See below.) - Default=true -* `nocomment` Suppress deprecated `comment` behavior. (See below.) - Default=true ## Comparisons to other fnmatch/glob implementations @@ -308,22 +305,13 @@ checked for validity. Since those two are valid, matching proceeds. ### Comments and Negation -**Note**: In version 5 of this module, negation and comments are -**disabled** by default. You can explicitly set `nonegate:false` or -`nocomment:false` to re-enable them. They are going away entirely in -version 6. - -The intent for negation would be for a pattern starting with `!` to -match everything that *doesn't* match the supplied pattern. However, -the implementation is weird. It is better to use the `ignore` option -to set a pattern or set of patterns to exclude from matches. If you -want the "everything except *x*" type of behavior, you can use `**` as -the main pattern, and set an `ignore` for the things to exclude. - -The comments feature is added in minimatch, primarily to more easily -support use cases like ignore files, where a `#` at the start of a -line makes the pattern "empty". However, in the context of a -straightforward filesystem globber, "comments" don't make much sense. +Previously, this module let you mark a pattern as a "comment" if it +started with a `#` character, or a "negated" pattern if it started +with a `!` character. + +These options were deprecated in version 5, and removed in version 6. + +To specify things that should not match, use the `ignore` option. ## Windows diff --git a/deps/npm/node_modules/glob/changelog.md b/deps/npm/node_modules/glob/changelog.md new file mode 100644 index 00000000000000..41636771e3a7cd --- /dev/null +++ b/deps/npm/node_modules/glob/changelog.md @@ -0,0 +1,67 @@ +## 7.0 + +- Raise error if `options.cwd` is specified, and not a directory + +## 6.0 + +- Remove comment and negation pattern support +- Ignore patterns are always in `dot:true` mode + +## 5.0 + +- Deprecate comment and negation patterns +- Fix regression in `mark` and `nodir` options from making all cache + keys absolute path. +- Abort if `fs.readdir` returns an error that's unexpected +- Don't emit `match` events for ignored items +- Treat ENOTSUP like ENOTDIR in readdir + +## 4.5 + +- Add `options.follow` to always follow directory symlinks in globstar +- Add `options.realpath` to call `fs.realpath` on all results +- Always cache based on absolute path + +## 4.4 + +- Add `options.ignore` +- Fix handling of broken symlinks + +## 4.3 + +- Bump minimatch to 2.x +- Pass all tests on Windows + +## 4.2 + +- Add `glob.hasMagic` function +- Add `options.nodir` flag + +## 4.1 + +- Refactor sync and async implementations for performance +- Throw if callback provided to sync glob function +- Treat symbolic links in globstar results the same as Bash 4.3 + +## 4.0 + +- Use `^` for dependency versions (bumped major because this breaks + older npm versions) +- Ensure callbacks are only ever called once +- switch to ISC license + +## 3.x + +- Rewrite in JavaScript +- Add support for setting root, cwd, and windows support +- Cache many fs calls +- Add globstar support +- emit match events + +## 2.x + +- Use `glob.h` and `fnmatch.h` from NetBSD + +## 1.x + +- `glob.h` static binding. diff --git a/deps/npm/node_modules/glob/common.js b/deps/npm/node_modules/glob/common.js index e36a631cab20c4..58dc41e6632160 100644 --- a/deps/npm/node_modules/glob/common.js +++ b/deps/npm/node_modules/glob/common.js @@ -36,15 +36,16 @@ function setupIgnores (self, options) { } } +// ignore patterns are always in dot:true mode. function ignoreMap (pattern) { var gmatcher = null if (pattern.slice(-3) === '/**') { var gpattern = pattern.replace(/(\/\*\*)+$/, '') - gmatcher = new Minimatch(gpattern) + gmatcher = new Minimatch(gpattern, { dot: true }) } return { - matcher: new Minimatch(pattern), + matcher: new Minimatch(pattern, { dot: true }), gmatcher: gmatcher } } @@ -92,8 +93,8 @@ function setopts (self, pattern, options) { if (!ownProp(options, "cwd")) self.cwd = cwd else { - self.cwd = options.cwd - self.changedCwd = path.resolve(options.cwd) !== cwd + self.cwd = path.resolve(options.cwd) + self.changedCwd = self.cwd !== cwd } self.root = options.root || path.resolve(self.cwd, "/") @@ -101,37 +102,18 @@ function setopts (self, pattern, options) { if (process.platform === "win32") self.root = self.root.replace(/\\/g, "/") + self.cwdAbs = makeAbs(self, self.cwd) self.nomount = !!options.nomount - // disable comments and negation unless the user explicitly - // passes in false as the option. - options.nonegate = options.nonegate === false ? false : true - options.nocomment = options.nocomment === false ? false : true - deprecationWarning(options) + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true self.minimatch = new Minimatch(pattern, options) self.options = self.minimatch.options } -// TODO(isaacs): remove entirely in v6 -// exported to reset in tests -exports.deprecationWarned -function deprecationWarning(options) { - if (!options.nonegate || !options.nocomment) { - if (process.noDeprecation !== true && !exports.deprecationWarned) { - var msg = 'glob WARNING: comments and negation will be disabled in v6' - if (process.throwDeprecation) - throw new Error(msg) - else if (process.traceDeprecation) - console.trace(msg) - else - console.error(msg) - - exports.deprecationWarned = true - } - } -} - function finish (self) { var nou = self.nounique var all = nou ? [] : Object.create(null) @@ -172,7 +154,11 @@ function finish (self) { } if (self.nodir) { all = all.filter(function (e) { - return !(/\/$/.test(e)) + var notDir = !(/\/$/.test(e)) + var c = self.cache[e] || self.cache[makeAbs(self, e)] + if (notDir && c) + notDir = c !== 'DIR' && !Array.isArray(c) + return notDir }) } } @@ -220,6 +206,10 @@ function makeAbs (self, f) { } else { abs = path.resolve(f) } + + if (process.platform === 'win32') + abs = abs.replace(/\\/g, '/') + return abs } diff --git a/deps/npm/node_modules/glob/glob.js b/deps/npm/node_modules/glob/glob.js index 022d2ac8c6e58b..4dba04adec43c4 100644 --- a/deps/npm/node_modules/glob/glob.js +++ b/deps/npm/node_modules/glob/glob.js @@ -80,8 +80,21 @@ var GlobSync = glob.GlobSync = globSync.GlobSync // old api surface glob.glob = glob +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } + + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} + glob.hasMagic = function (pattern, options_) { - var options = util._extend({}, options_) + var options = extend({}, options_) options.noprocess = true var g = new Glob(pattern, options) @@ -149,14 +162,23 @@ function Glob (pattern, options, cb) { if (n === 0) return done() + var sync = true for (var i = 0; i < n; i ++) { this._process(this.minimatch.set[i], i, false, done) } + sync = false function done () { --self._processing - if (self._processing <= 0) - self._finish() + if (self._processing <= 0) { + if (sync) { + process.nextTick(function () { + self._finish() + }) + } else { + self._finish() + } + } } } @@ -558,7 +580,15 @@ Glob.prototype._readdirError = function (f, er, cb) { switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 case 'ENOTDIR': // totally normal. means it *does* exist. - this.cache[this._makeAbs(f)] = 'FILE' + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + this.emit('error', error) + this.abort() + } break case 'ENOENT': // not terribly unusual diff --git a/deps/npm/node_modules/chmodr/LICENSE b/deps/npm/node_modules/glob/node_modules/minimatch/LICENSE similarity index 100% rename from deps/npm/node_modules/chmodr/LICENSE rename to deps/npm/node_modules/glob/node_modules/minimatch/LICENSE diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/README.md b/deps/npm/node_modules/glob/node_modules/minimatch/README.md new file mode 100644 index 00000000000000..d458bc2e0a6b03 --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/README.md @@ -0,0 +1,216 @@ +# minimatch + +A minimal matching utility. + +[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) + + +This is the matching library used internally by npm. + +It works by converting glob expressions into JavaScript `RegExp` +objects. + +## Usage + +```javascript +var minimatch = require("minimatch") + +minimatch("bar.foo", "*.foo") // true! +minimatch("bar.foo", "*.bar") // false! +minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! +``` + +## Features + +Supports these glob features: + +* Brace Expansion +* Extended glob matching +* "Globstar" `**` matching + +See: + +* `man sh` +* `man bash` +* `man 3 fnmatch` +* `man 5 gitignore` + +## Minimatch Class + +Create a minimatch object by instanting the `minimatch.Minimatch` class. + +```javascript +var Minimatch = require("minimatch").Minimatch +var mm = new Minimatch(pattern, options) +``` + +### Properties + +* `pattern` The original pattern the minimatch object represents. +* `options` The options supplied to the constructor. +* `set` A 2-dimensional array of regexp or string expressions. + Each row in the + array corresponds to a brace-expanded pattern. Each item in the row + corresponds to a single path-part. For example, the pattern + `{a,b/c}/d` would expand to a set of patterns like: + + [ [ a, d ] + , [ b, c, d ] ] + + If a portion of the pattern doesn't have any "magic" in it + (that is, it's something like `"foo"` rather than `fo*o?`), then it + will be left as a string rather than converted to a regular + expression. + +* `regexp` Created by the `makeRe` method. A single regular expression + expressing the entire pattern. This is useful in cases where you wish + to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. +* `negate` True if the pattern is negated. +* `comment` True if the pattern is a comment. +* `empty` True if the pattern is `""`. + +### Methods + +* `makeRe` Generate the `regexp` member if necessary, and return it. + Will return `false` if the pattern is invalid. +* `match(fname)` Return true if the filename matches the pattern, or + false otherwise. +* `matchOne(fileArray, patternArray, partial)` Take a `/`-split + filename, and match it against a single row in the `regExpSet`. This + method is mainly for internal use, but is exposed so that it can be + used by a glob-walker that needs to avoid excessive filesystem calls. + +All other methods are internal, and will be called as necessary. + +## Functions + +The top-level exported function has a `cache` property, which is an LRU +cache set to store 100 items. So, calling these methods repeatedly +with the same pattern and options will use the same Minimatch object, +saving the cost of parsing it multiple times. + +### minimatch(path, pattern, options) + +Main export. Tests a path against the pattern using the options. + +```javascript +var isJS = minimatch(file, "*.js", { matchBase: true }) +``` + +### minimatch.filter(pattern, options) + +Returns a function that tests its +supplied argument, suitable for use with `Array.filter`. Example: + +```javascript +var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) +``` + +### minimatch.match(list, pattern, options) + +Match against the list of +files, in the style of fnmatch or glob. If nothing is matched, and +options.nonull is set, then return a list containing the pattern itself. + +```javascript +var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) +``` + +### minimatch.makeRe(pattern, options) + +Make a regular expression object from the pattern. + +## Options + +All options are `false` by default. + +### debug + +Dump a ton of stuff to stderr. + +### nobrace + +Do not expand `{a,b}` and `{1..3}` brace sets. + +### noglobstar + +Disable `**` matching against multiple folder names. + +### dot + +Allow patterns to match filenames starting with a period, even if +the pattern does not explicitly have a period in that spot. + +Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` +is set. + +### noext + +Disable "extglob" style patterns like `+(a|b)`. + +### nocase + +Perform a case-insensitive match. + +### nonull + +When a match is not found by `minimatch.match`, return a list containing +the pattern itself if this option is set. When not set, an empty list +is returned if there are no matches. + +### matchBase + +If set, then patterns without slashes will be matched +against the basename of the path if it contains slashes. For example, +`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. + +### nocomment + +Suppress the behavior of treating `#` at the start of a pattern as a +comment. + +### nonegate + +Suppress the behavior of treating a leading `!` character as negation. + +### flipNegate + +Returns from negate expressions the same as if they were not negated. +(Ie, true on a hit, false on a miss.) + + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between minimatch and other +implementations, and are intentional. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then minimatch.match returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/minimatch.js b/deps/npm/node_modules/glob/node_modules/minimatch/minimatch.js new file mode 100644 index 00000000000000..ec4c05c570c52e --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/minimatch.js @@ -0,0 +1,912 @@ +module.exports = minimatch +minimatch.Minimatch = Minimatch + +var path = { sep: '/' } +try { + path = require('path') +} catch (er) {} + +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} +var expand = require('brace-expansion') + +// any single thing other than / +// don't need to escape / when using new RegExp() +var qmark = '[^/]' + +// * => any number of characters +var star = qmark + '*?' + +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' + +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' + +// characters that need to be escaped in RegExp. +var reSpecials = charSet('().*{}+?[]^$\\!') + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split('').reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + a = a || {} + b = b || {} + var t = {} + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return minimatch + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig.minimatch(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return Minimatch + return minimatch.defaults(def).Minimatch +} + +function minimatch (p, pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false + } + + // "" only matches "" + if (pattern.trim() === '') return p === '' + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options) + } + + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } + + if (!options) options = {} + pattern = pattern.trim() + + // windows support: need to use /, not \ + if (path.sep !== '/') { + pattern = pattern.split(path.sep).join('/') + } + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function () {} + +Minimatch.prototype.make = make +function make () { + // don't do it more than once. + if (this._made) return + + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = console.error + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return s.indexOf(false) === -1 + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + var negate = false + var options = this.options + var negateOffset = 0 + + if (options.nonegate) return + + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { + negate = !negate + negateOffset++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options) +} + +Minimatch.prototype.braceExpand = braceExpand + +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options + } else { + options = {} + } + } + + pattern = typeof pattern === 'undefined' + ? this.pattern : pattern + + if (typeof pattern === 'undefined') { + throw new Error('undefined pattern') + } + + if (options.nobrace || + !pattern.match(/\{.*\}/)) { + // shortcut. no need to expand. + return [pattern] + } + + return expand(pattern) +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + var options = this.options + + // shortcuts + if (!options.noglobstar && pattern === '**') return GLOBSTAR + if (pattern === '') return '' + + var re = '' + var hasMagic = !!options.nocase + var escaping = false + // ? => one single character + var patternListStack = [] + var negativeLists = [] + var plType + var stateChar + var inClass = false + var reClassStart = -1 + var classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + var self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star + hasMagic = true + break + case '?': + re += qmark + hasMagic = true + break + default: + re += '\\' + stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for (var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += '\\' + c + escaping = false + continue + } + + switch (c) { + case '/': + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + + case '\\': + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === '!' && i === classStart + 1) c = '^' + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case '(': + if (inClass) { + re += '(' + continue + } + + if (!stateChar) { + re += '\\(' + continue + } + + plType = stateChar + patternListStack.push({ + type: plType, + start: i - 1, + reStart: re.length + }) + // negation is (?:(?!js)[^/]*) + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ')': + if (inClass || !patternListStack.length) { + re += '\\)' + continue + } + + clearStateChar() + hasMagic = true + re += ')' + var pl = patternListStack.pop() + plType = pl.type + // negation is (?:(?!js)[^/]*) + // The others are (?:) + switch (plType) { + case '!': + negativeLists.push(pl) + re += ')[^/]*?)' + pl.reEnd = re.length + break + case '?': + case '+': + case '*': + re += plType + break + case '@': break // the default anyway + } + continue + + case '|': + if (inClass || !patternListStack.length || escaping) { + re += '\\|' + escaping = false + continue + } + + clearStateChar() + re += '|' + continue + + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += '\\' + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c + escaping = false + continue + } + + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + if (inClass) { + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === '^' && inClass)) { + re += '\\' + } + + re += c + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + 3) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\' + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }) + + this.debug('tail=%j\n %s', tail, tail) + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case '.': + case '[': + case '(': addPatternStart = true + } + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] + + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) + + nlLast += nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter + + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } + + if (addPatternStart) { + re = patternStart + re + } + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? 'i' : '' + var regExp = new RegExp('^' + re + '$', flags) + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) { + this.regexp = false + return this.regexp + } + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + var flags = options.nocase ? 'i' : '' + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|') + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' + + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' + + try { + this.regexp = new RegExp(re, flags) + } catch (ex) { + this.regexp = false + } + return this.regexp +} + +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = match +function match (f, partial) { + this.debug('match', f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === '' + + if (f === '/' && partial) return true + + var options = this.options + + // windows: need to use /, not \ + if (path.sep !== '/') { + f = f.split(path.sep).join('/') + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, 'set', set) + + // Find the basename of the path by looking for the last non-empty segment + var filename + var i + for (i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (i = 0; i < set.length; i++) { + var pattern = set[i] + var file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) + + this.debug('matchOne', file.length, pattern.length) + + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++) { + this.debug('matchOne loop') + var p = pattern[pi] + var f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + var pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr) + break + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr++ + } + } + + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === 'string') { + if (options.nocase) { + hit = f.toLowerCase() === p.toLowerCase() + } else { + hit = f === p + } + this.debug('string match', p, f, hit) + } else { + hit = f.match(p) + this.debug('pattern match', p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') + return emptyFileEnd + } + + // should be unreachable. + throw new Error('wtf?') +} + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, '$1') +} + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') +} diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore new file mode 100644 index 00000000000000..353546af2368e1 --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore @@ -0,0 +1,3 @@ +test +.gitignore +.travis.yml diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md new file mode 100644 index 00000000000000..b0d793ed5d9016 --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md @@ -0,0 +1,122 @@ +# brace-expansion + +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +as known from sh/bash, in JavaScript. + +[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) +[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) + +[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) + +## Example + +```js +var expand = require('brace-expansion'); + +expand('file-{a,b,c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('-v{,,}') +// => ['-v', '-v', '-v'] + +expand('file{0..2}.jpg') +// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] + +expand('file-{a..c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('file{2..0}.jpg') +// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] + +expand('file{0..4..2}.jpg') +// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] + +expand('file-{a..e..2}.jpg') +// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] + +expand('file{00..10..5}.jpg') +// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] + +expand('{{A..C},{a..c}}') +// => ['A', 'B', 'C', 'a', 'b', 'c'] + +expand('ppp{,config,oe{,conf}}') +// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] +``` + +## API + +```js +var expand = require('brace-expansion'); +``` + +### var expanded = expand(str) + +Return an array of all possible and valid expansions of `str`. If none are +found, `[str]` is returned. + +Valid expansions are: + +```js +/^(.*,)+(.+)?$/ +// {a,b,...} +``` + +A comma seperated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +A numeric sequence from `x` to `y` inclusive, with optional increment. +If `x` or `y` start with a leading `0`, all the numbers will be padded +to have equal length. Negative numbers and backwards iteration work too. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +An alphabetic sequence from `x` to `y` inclusive, with optional increment. +`x` and `y` must be exactly one character, and if given, `incr` must be a +number. + +For compatibility reasons, the string `${` is not eligible for brace expansion. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install brace-expansion +``` + +## Contributors + +- [Julian Gruber](https://github.com/juliangruber) +- [Isaac Z. Schlueter](https://github.com/isaacs) + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js new file mode 100644 index 00000000000000..36cde4de5c114b --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js @@ -0,0 +1,7 @@ +var expand = require('./'); + +console.log(expand('http://any.org/archive{1996..1999}/vol{1..4}/part{a,b,c}.html')); +console.log(expand('http://www.numericals.com/file{1..100..10}.txt')); +console.log(expand('http://www.letters.com/file{a..z..2}.txt')); +console.log(expand('mkdir /usr/local/src/bash/{old,new,dist,bugs}')); +console.log(expand('chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}')); diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js new file mode 100644 index 00000000000000..abe535df327354 --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js @@ -0,0 +1,190 @@ +var concatMap = require('concat-map'); +var balanced = require('balanced-match'); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = /^(.*,)+(.+)?$/.test(m.body); + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + + return expansions; +} diff --git a/tools/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore similarity index 100% rename from tools/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore rename to deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.travis.yml b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml similarity index 100% rename from deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.travis.yml rename to deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md new file mode 100644 index 00000000000000..2cdc8e4148cc0a --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md @@ -0,0 +1,21 @@ +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile new file mode 100644 index 00000000000000..dd2730cfde0cab --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile @@ -0,0 +1,5 @@ + +test: + @node_modules/.bin/tape test/*.js + +.PHONY: test diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md new file mode 100644 index 00000000000000..421f3aa5f951a2 --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md @@ -0,0 +1,89 @@ +# balanced-match + +Match balanced string pairs, like `{` and `}` or `` and ``. + +[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) +[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) + +[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) + +## Example + +Get the first matching pair of braces: + +```js +var balanced = require('balanced-match'); + +console.log(balanced('{', '}', 'pre{in{nested}}post')); +console.log(balanced('{', '}', 'pre{first}between{second}post')); +``` + +The matches are: + +```bash +$ node example.js +{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } +{ start: 3, + end: 9, + pre: 'pre', + body: 'first', + post: 'between{second}post' } +``` + +## API + +### var m = balanced(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +object with those keys: + +* **start** the index of the first match of `a` +* **end** the index of the matching `b` +* **pre** the preamble, `a` and `b` not included +* **body** the match, `a` and `b` not included +* **post** the postscript, `a` and `b` not included + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`. + +### var r = balanced.range(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +array with indexes: `[ , ]`. + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]`. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install balanced-match +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js new file mode 100644 index 00000000000000..9ce76f480a4321 --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js @@ -0,0 +1,4 @@ +var balanced = require('./'); + +console.log(balanced('{', '}', 'pre{in{nested}}post')); +console.log(balanced('{', '}', 'pre{first}between{second}post')); diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js new file mode 100644 index 00000000000000..75f3d71cba90bc --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js @@ -0,0 +1,50 @@ +module.exports = balanced; +function balanced(a, b, str) { + var r = range(a, b, str); + + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} + +balanced.range = range; +function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; + + if (ai >= 0 && bi > 0) { + begs = []; + left = str.length; + + while (i < str.length && i >= 0 && ! result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + + bi = str.indexOf(b, i + 1); + } + + i = ai < bi && ai >= 0 ? ai : bi; + } + + if (begs.length) { + result = [ left, right ]; + } + } + + return result; +} diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json new file mode 100644 index 00000000000000..5de119ba5b5760 --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json @@ -0,0 +1,98 @@ +{ + "_args": [ + [ + "balanced-match@^0.3.0", + "/Users/rebecca/code/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" + ] + ], + "_from": "balanced-match@>=0.3.0 <0.4.0", + "_id": "balanced-match@0.3.0", + "_inCache": true, + "_installable": true, + "_location": "/glob/minimatch/brace-expansion/balanced-match", + "_nodeVersion": "4.2.1", + "_npmUser": { + "email": "julian@juliangruber.com", + "name": "juliangruber" + }, + "_npmVersion": "2.14.7", + "_phantomChildren": {}, + "_requested": { + "name": "balanced-match", + "raw": "balanced-match@^0.3.0", + "rawSpec": "^0.3.0", + "scope": null, + "spec": ">=0.3.0 <0.4.0", + "type": "range" + }, + "_requiredBy": [ + "/glob/minimatch/brace-expansion" + ], + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz", + "_shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756", + "_shrinkwrap": null, + "_spec": "balanced-match@^0.3.0", + "_where": "/Users/rebecca/code/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion", + "author": { + "email": "mail@juliangruber.com", + "name": "Julian Gruber", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/balanced-match/issues" + }, + "dependencies": {}, + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "devDependencies": { + "tape": "~4.2.2" + }, + "directories": {}, + "dist": { + "shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756", + "tarball": "http://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz" + }, + "gitHead": "a7114b0986554787e90b7ac595a043ca75ea77e5", + "homepage": "https://github.com/juliangruber/balanced-match", + "keywords": [ + "balanced", + "match", + "parse", + "regexp", + "test" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + } + ], + "name": "balanced-match", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "scripts": { + "test": "make test" + }, + "testling": { + "browsers": [ + "android-browser/4.2..latest", + "chrome/25..latest", + "chrome/canary", + "firefox/20..latest", + "firefox/nightly", + "ie/8..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "opera/12..latest", + "opera/next", + "safari/5.1..latest" + ], + "files": "test/*.js" + }, + "version": "0.3.0" +} diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js new file mode 100644 index 00000000000000..f5e98e3f2a3240 --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js @@ -0,0 +1,84 @@ +var test = require('tape'); +var balanced = require('..'); + +test('balanced', function(t) { + t.deepEqual(balanced('{', '}', 'pre{in{nest}}post'), { + start: 3, + end: 12, + pre: 'pre', + body: 'in{nest}', + post: 'post' + }); + t.deepEqual(balanced('{', '}', '{{{{{{{{{in}post'), { + start: 8, + end: 11, + pre: '{{{{{{{{', + body: 'in', + post: 'post' + }); + t.deepEqual(balanced('{', '}', 'pre{body{in}post'), { + start: 8, + end: 11, + pre: 'pre{body', + body: 'in', + post: 'post' + }); + t.deepEqual(balanced('{', '}', 'pre}{in{nest}}post'), { + start: 4, + end: 13, + pre: 'pre}', + body: 'in{nest}', + post: 'post' + }); + t.deepEqual(balanced('{', '}', 'pre{body}between{body2}post'), { + start: 3, + end: 8, + pre: 'pre', + body: 'body', + post: 'between{body2}post' + }); + t.notOk(balanced('{', '}', 'nope'), 'should be notOk'); + t.deepEqual(balanced('', '', 'preinnestpost'), { + start: 3, + end: 19, + pre: 'pre', + body: 'innest', + post: 'post' + }); + t.deepEqual(balanced('', '', 'preinnestpost'), { + start: 7, + end: 23, + pre: 'pre', + body: 'innest', + post: 'post' + }); + t.deepEqual(balanced('{{', '}}', 'pre{{{in}}}post'), { + start: 3, + end: 9, + pre: 'pre', + body: '{in}', + post: 'post' + }); + t.deepEqual(balanced('{{{', '}}', 'pre{{{in}}}post'), { + start: 3, + end: 8, + pre: 'pre', + body: 'in', + post: '}post' + }); + t.deepEqual(balanced('{', '}', 'pre{{first}in{second}post'), { + start: 4, + end: 10, + pre: 'pre{', + body: 'first', + post: 'in{second}post' + }); + t.deepEqual(balanced('', 'prepost'), { + start: 3, + end: 4, + pre: 'pre', + body: '', + post: 'post' + }); + t.end(); +}); diff --git a/tools/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml similarity index 100% rename from tools/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml rename to deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml diff --git a/tools/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE similarity index 100% rename from tools/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE rename to deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE diff --git a/tools/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown similarity index 100% rename from tools/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown rename to deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown diff --git a/tools/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js similarity index 100% rename from tools/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js rename to deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js diff --git a/tools/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js similarity index 100% rename from tools/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js rename to deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json new file mode 100644 index 00000000000000..386ed516010565 --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json @@ -0,0 +1,82 @@ +{ + "name": "concat-map", + "description": "concatenative mapdashery", + "version": "0.0.1", + "repository": { + "type": "git", + "url": "git://github.com/substack/node-concat-map.git" + }, + "main": "index.js", + "keywords": [ + "concat", + "concatMap", + "map", + "functional", + "higher-order" + ], + "directories": { + "example": "example", + "test": "test" + }, + "scripts": { + "test": "tape test/*.js" + }, + "devDependencies": { + "tape": "~2.4.0" + }, + "license": "MIT", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "testling": { + "files": "test/*.js", + "browsers": { + "ie": [ + 6, + 7, + 8, + 9 + ], + "ff": [ + 3.5, + 10, + 15 + ], + "chrome": [ + 10, + 22 + ], + "safari": [ + 5.1 + ], + "opera": [ + 12 + ] + } + }, + "bugs": { + "url": "https://github.com/substack/node-concat-map/issues" + }, + "homepage": "https://github.com/substack/node-concat-map", + "_id": "concat-map@0.0.1", + "dist": { + "shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", + "tarball": "http://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + }, + "_from": "concat-map@0.0.1", + "_npmVersion": "1.3.21", + "_npmUser": { + "name": "substack", + "email": "mail@substack.net" + }, + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", + "_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" +} diff --git a/tools/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js similarity index 100% rename from tools/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js rename to deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json new file mode 100644 index 00000000000000..2917f0eac0e7bf --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json @@ -0,0 +1,104 @@ +{ + "_args": [ + [ + "brace-expansion@^1.0.0", + "/Users/rebecca/code/npm/node_modules/glob/node_modules/minimatch" + ] + ], + "_from": "brace-expansion@>=1.0.0 <2.0.0", + "_id": "brace-expansion@1.1.3", + "_inCache": true, + "_installable": true, + "_location": "/glob/minimatch/brace-expansion", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-6-west.internal.npmjs.com", + "tmp": "tmp/brace-expansion-1.1.3.tgz_1455216688668_0.948847763473168" + }, + "_npmUser": { + "email": "julian@juliangruber.com", + "name": "juliangruber" + }, + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "name": "brace-expansion", + "raw": "brace-expansion@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/glob/minimatch" + ], + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz", + "_shasum": "46bff50115d47fc9ab89854abb87d98078a10991", + "_shrinkwrap": null, + "_spec": "brace-expansion@^1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/glob/node_modules/minimatch", + "author": { + "email": "mail@juliangruber.com", + "name": "Julian Gruber", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/brace-expansion/issues" + }, + "dependencies": { + "balanced-match": "^0.3.0", + "concat-map": "0.0.1" + }, + "description": "Brace expansion as known from sh/bash", + "devDependencies": { + "tape": "4.4.0" + }, + "directories": {}, + "dist": { + "shasum": "46bff50115d47fc9ab89854abb87d98078a10991", + "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz" + }, + "gitHead": "f0da1bb668e655f67b6b2d660c6e1c19e2a6f231", + "homepage": "https://github.com/juliangruber/brace-expansion", + "keywords": [], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "email": "julian@juliangruber.com", + "name": "juliangruber" + }, + { + "email": "isaacs@npmjs.com", + "name": "isaacs" + } + ], + "name": "brace-expansion", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/brace-expansion.git" + }, + "scripts": { + "gentest": "bash test/generate.sh", + "test": "tape test/*.js" + }, + "testling": { + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ], + "files": "test/*.js" + }, + "version": "1.1.3" +} diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/package.json b/deps/npm/node_modules/glob/node_modules/minimatch/package.json new file mode 100644 index 00000000000000..4944eb0bccfada --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/package.json @@ -0,0 +1,60 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + "name": "minimatch", + "description": "a glob matcher in javascript", + "version": "3.0.0", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "main": "minimatch.js", + "scripts": { + "posttest": "standard minimatch.js test/*.js", + "test": "tap test/*.js" + }, + "engines": { + "node": "*" + }, + "dependencies": { + "brace-expansion": "^1.0.0" + }, + "devDependencies": { + "standard": "^3.7.2", + "tap": "^1.2.0" + }, + "license": "ISC", + "files": [ + "minimatch.js" + ], + "gitHead": "270dbea567f0af6918cb18103e98c612aa717a20", + "bugs": { + "url": "https://github.com/isaacs/minimatch/issues" + }, + "homepage": "https://github.com/isaacs/minimatch#readme", + "_id": "minimatch@3.0.0", + "_shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83", + "_from": "minimatch@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", + "_npmVersion": "3.3.2", + "_nodeVersion": "4.0.0", + "_npmUser": { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + "dist": { + "shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83", + "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/glob/node_modules/path-is-absolute/package.json b/deps/npm/node_modules/glob/node_modules/path-is-absolute/package.json index 39372636f3fb4f..bf60d74dbd3297 100644 --- a/deps/npm/node_modules/glob/node_modules/path-is-absolute/package.json +++ b/deps/npm/node_modules/glob/node_modules/path-is-absolute/package.json @@ -40,31 +40,14 @@ "detect", "check" ], - "gitHead": "7a76a0c9f2263192beedbe0a820e4d0baee5b7a1", + "readme": "# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute)\n\n> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) ponyfill\n\n> Ponyfill: A polyfill that doesn't overwrite the native method\n\n\n## Install\n\n```\n$ npm install --save path-is-absolute\n```\n\n\n## Usage\n\n```js\nvar pathIsAbsolute = require('path-is-absolute');\n\n// Linux\npathIsAbsolute('/home/foo');\n//=> true\n\n// Windows\npathIsAbsolute('C:/Users/');\n//=> true\n\n// Any OS\npathIsAbsolute.posix('/home/foo');\n//=> true\n```\n\n\n## API\n\nSee the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path).\n\n### pathIsAbsolute(path)\n\n### pathIsAbsolute.posix(path)\n\nThe Posix specific version.\n\n### pathIsAbsolute.win32(path)\n\nThe Windows specific version.\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n", + "readmeFilename": "readme.md", "bugs": { "url": "https://github.com/sindresorhus/path-is-absolute/issues" }, - "homepage": "https://github.com/sindresorhus/path-is-absolute", + "homepage": "https://github.com/sindresorhus/path-is-absolute#readme", "_id": "path-is-absolute@1.0.0", "_shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912", - "_from": "path-is-absolute@>=1.0.0 <2.0.0", - "_npmVersion": "2.5.1", - "_nodeVersion": "0.12.0", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "dist": { - "shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912", - "tarball": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz" - }, - "directories": {}, "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz", - "readme": "ERROR: No README data found!" + "_from": "path-is-absolute@>=1.0.0 <2.0.0" } diff --git a/deps/npm/node_modules/glob/package.json b/deps/npm/node_modules/glob/package.json index 2949b83be0637f..cf191d217966b1 100644 --- a/deps/npm/node_modules/glob/package.json +++ b/deps/npm/node_modules/glob/package.json @@ -1,24 +1,51 @@ { - "author": { - "name": "Isaac Z. Schlueter", + "_args": [ + [ + "glob@7.0.3", + "/Users/rebecca/code/npm" + ] + ], + "_from": "glob@7.0.3", + "_id": "glob@7.0.3", + "_inCache": true, + "_installable": true, + "_location": "/glob", + "_nodeVersion": "5.6.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/glob-7.0.3.tgz_1457166529288_0.7840580905321985" + }, + "_npmUser": { "email": "i@izs.me", - "url": "http://blog.izs.me/" + "name": "isaacs" }, - "name": "glob", - "description": "a little globber", - "version": "5.0.15", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-glob.git" + "_npmVersion": "3.7.3", + "_phantomChildren": {}, + "_requested": { + "name": "glob", + "raw": "glob@7.0.3", + "rawSpec": "7.0.3", + "scope": null, + "spec": "7.0.3", + "type": "version" }, - "main": "glob.js", - "files": [ - "glob.js", - "sync.js", - "common.js" + "_requiredBy": [ + "/", + "/rimraf", + "/tap" ], - "engines": { - "node": "*" + "_resolved": "https://registry.npmjs.org/glob/-/glob-7.0.3.tgz", + "_shasum": "0aa235931a4a96ac13d60ffac2fb877bd6ed4f58", + "_shrinkwrap": null, + "_spec": "glob@7.0.3", + "_where": "/Users/rebecca/code/npm", + "author": { + "email": "i@izs.me", + "name": "Isaac Z. Schlueter", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/node-glob/issues" }, "dependencies": { "inflight": "^1.0.4", @@ -27,47 +54,51 @@ "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, + "description": "a little globber", "devDependencies": { "mkdirp": "0", "rimraf": "^2.2.8", - "tap": "^1.1.4", + "tap": "^5.7.0", "tick": "0.0.6" }, - "scripts": { - "prepublish": "npm run benchclean", - "profclean": "rm -f v8.log profile.txt", - "test": "tap test/*.js --cov", - "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", - "bench": "bash benchmark.sh", - "prof": "bash prof.sh && cat profile.txt", - "benchclean": "node benchclean.js" + "directories": {}, + "dist": { + "shasum": "0aa235931a4a96ac13d60ffac2fb877bd6ed4f58", + "tarball": "http://registry.npmjs.org/glob/-/glob-7.0.3.tgz" }, - "license": "ISC", - "gitHead": "3a7e71d453dd80e75b196fd262dd23ed54beeceb", - "bugs": { - "url": "https://github.com/isaacs/node-glob/issues" + "engines": { + "node": "*" }, + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "gitHead": "2fc2278ab857c7df117213a2fb431de090be6353", "homepage": "https://github.com/isaacs/node-glob#readme", - "_id": "glob@5.0.15", - "_shasum": "1bc936b9e02f4a603fcc222ecf7633d30b8b93b1", - "_from": "glob@5.0.15", - "_npmVersion": "3.3.2", - "_nodeVersion": "4.0.0", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "1bc936b9e02f4a603fcc222ecf7633d30b8b93b1", - "tarball": "http://registry.npmjs.org/glob/-/glob-5.0.15.tgz" - }, + "license": "ISC", + "main": "glob.js", "maintainers": [ { - "name": "isaacs", - "email": "i@izs.me" + "email": "i@izs.me", + "name": "isaacs" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "readme": "ERROR: No README data found!" + "name": "glob", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "scripts": { + "bench": "bash benchmark.sh", + "benchclean": "node benchclean.js", + "prepublish": "npm run benchclean", + "prof": "bash prof.sh && cat profile.txt", + "profclean": "rm -f v8.log profile.txt", + "test": "tap test/*.js --cov", + "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js" + }, + "version": "7.0.3" } diff --git a/deps/npm/node_modules/glob/sync.js b/deps/npm/node_modules/glob/sync.js index 09883d2ce0c9de..301577ab5f228f 100644 --- a/deps/npm/node_modules/glob/sync.js +++ b/deps/npm/node_modules/glob/sync.js @@ -305,7 +305,14 @@ GlobSync.prototype._readdirError = function (f, er) { switch (er.code) { case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 case 'ENOTDIR': // totally normal. means it *does* exist. - this.cache[this._makeAbs(f)] = 'FILE' + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + throw error + } break case 'ENOENT': // not terribly unusual diff --git a/deps/npm/node_modules/graceful-fs/README.md b/deps/npm/node_modules/graceful-fs/README.md index 13a2e86050a3eb..d920aaac9e17af 100644 --- a/deps/npm/node_modules/graceful-fs/README.md +++ b/deps/npm/node_modules/graceful-fs/README.md @@ -34,3 +34,20 @@ var fs = require('graceful-fs') // now go and do stuff with it... fs.readFileSync('some-file-or-whatever') ``` + +## Global Patching + +If you want to patch the global fs module (or any other fs-like +module) you can do this: + +```javascript +// Make sure to read the caveat below. +var realFs = require('fs') +var gracefulFs = require('graceful-fs') +gracefulFs.gracefulify(realFs) +``` + +This should only ever be done at the top-level application layer, in +order to delay on EMFILE errors from any fs-using dependencies. You +should **not** do this in a library, because it can cause unexpected +delays in other parts of the program. diff --git a/deps/npm/node_modules/graceful-fs/graceful-fs.js b/deps/npm/node_modules/graceful-fs/graceful-fs.js index fe3b17cb60adee..9bf803e686c703 100644 --- a/deps/npm/node_modules/graceful-fs/graceful-fs.js +++ b/deps/npm/node_modules/graceful-fs/graceful-fs.js @@ -33,6 +33,7 @@ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH) { // retry() whenever a close happens *anywhere* in the program. // This is essential when multiple graceful-fs instances are // in play at the same time. +module.exports.close = fs.close = (function (fs$close) { return function (fd, cb) { return fs$close.call(fs, fd, function (err) { if (!err) @@ -43,6 +44,7 @@ fs.close = (function (fs$close) { return function (fd, cb) { }) }})(fs.close) +module.exports.closeSync = fs.closeSync = (function (fs$closeSync) { return function (fd) { // Note that graceful-fs also retries when fs.closeSync() fails. // Looks like a bug to me, although it's probably a harmless one. diff --git a/deps/npm/node_modules/graceful-fs/package.json b/deps/npm/node_modules/graceful-fs/package.json index f9e1598a6545ea..f8fc8a0ebb6a30 100644 --- a/deps/npm/node_modules/graceful-fs/package.json +++ b/deps/npm/node_modules/graceful-fs/package.json @@ -1,56 +1,74 @@ { "_args": [ [ - "graceful-fs@latest", - "/Users/isaacs/dev/npm/npm" + "graceful-fs@~4.1.2", + "/Users/rebecca/code/npm" ] ], - "_from": "graceful-fs@latest", - "_id": "graceful-fs@4.1.2", + "_from": "graceful-fs@>=4.1.2 <4.2.0", + "_id": "graceful-fs@4.1.3", "_inCache": true, + "_installable": true, "_location": "/graceful-fs", - "_nodeVersion": "2.2.1", + "_nodeVersion": "4.0.0", + "_npmOperationalInternal": { + "host": "packages-6-west.internal.npmjs.com", + "tmp": "tmp/graceful-fs-4.1.3.tgz_1454449326495_0.943017533281818" + }, "_npmUser": { - "email": "isaacs@npmjs.com", + "email": "i@izs.me", "name": "isaacs" }, - "_npmVersion": "3.0.0", + "_npmVersion": "3.7.0", "_phantomChildren": {}, "_requested": { "name": "graceful-fs", - "raw": "graceful-fs@latest", - "rawSpec": "latest", + "raw": "graceful-fs@~4.1.2", + "rawSpec": "~4.1.2", "scope": null, - "spec": "latest", - "type": "tag" + "spec": ">=4.1.2 <4.2.0", + "type": "range" }, "_requiredBy": [ - "/" + "/", + "/fs-vacuum", + "/fs-write-stream-atomic", + "/fstream", + "/node-gyp", + "/npm-registry-client", + "/read-cmd-shim", + "/read-installed", + "/read-package-json", + "/readdir-scoped-modules", + "/sha", + "/standard/standard-engine/eslint/file-entry-cache/flat-cache", + "/standard/standard-engine/eslint/file-entry-cache/flat-cache/read-json-sync", + "/standard/standard-format/esformatter-jsx/babel-core/regenerator/commoner", + "/tap/nyc/read-pkg/load-json-file", + "/tap/nyc/read-pkg/path-type", + "/write-file-atomic" ], - "_shasum": "fe2239b7574972e67e41f808823f9bfa4a991e37", + "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.3.tgz", + "_shasum": "92033ce11113c41e2628d61fdfa40bc10dc0155c", "_shrinkwrap": null, - "_spec": "graceful-fs@latest", - "_where": "/Users/isaacs/dev/npm/npm", + "_spec": "graceful-fs@~4.1.2", + "_where": "/Users/rebecca/code/npm", "bugs": { "url": "https://github.com/isaacs/node-graceful-fs/issues" }, "dependencies": {}, "description": "A drop-in replacement for fs, making various improvements.", - "version": "3.0.8", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-graceful-fs.git" - }, - "main": "graceful-fs.js", - "engines": { - "node": ">=0.4.0" + "devDependencies": { + "mkdirp": "^0.5.0", + "rimraf": "^2.2.8", + "tap": "^5.4.2" }, "directories": { "test": "test" }, "dist": { - "shasum": "fe2239b7574972e67e41f808823f9bfa4a991e37", - "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.2.tgz" + "shasum": "92033ce11113c41e2628d61fdfa40bc10dc0155c", + "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.3.tgz" }, "engines": { "node": ">=0.4.0" @@ -61,48 +79,26 @@ "legacy-streams.js", "polyfills.js" ], - "gitHead": "c286080071b6be9aa9ba108b0bb9b44ff122926d", + "gitHead": "694c56f3aed4aee62d6df169be123d3984f61b85", "homepage": "https://github.com/isaacs/node-graceful-fs#readme", "keywords": [ + "EACCESS", + "EAGAIN", + "EINVAL", + "EMFILE", + "EPERM", + "error", + "errors", "fs", + "handling", "module", + "queue", "reading", - "retry", "retries", - "queue", - "error", - "errors", - "handling", - "EMFILE", - "EAGAIN", - "EINVAL", - "EPERM", - "EACCESS" + "retry" ], "license": "ISC", - "devDependencies": { - "mkdirp": "^0.5.0", - "rimraf": "^2.2.8", - "tap": "^1.2.0" - }, - "gitHead": "45c57aa5e323c35a985a525de6f0c9a6ef59e1f8", - "bugs": { - "url": "https://github.com/isaacs/node-graceful-fs/issues" - }, - "homepage": "https://github.com/isaacs/node-graceful-fs#readme", - "_id": "graceful-fs@3.0.8", - "_shasum": "ce813e725fa82f7e6147d51c9a5ca68270551c22", - "_from": "graceful-fs@>=3.0.8 <3.1.0", - "_npmVersion": "2.10.1", - "_nodeVersion": "2.0.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "ce813e725fa82f7e6147d51c9a5ca68270551c22", - "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.8.tgz" - }, + "main": "graceful-fs.js", "maintainers": [ { "name": "isaacs", @@ -111,6 +107,7 @@ ], "name": "graceful-fs", "optionalDependencies": {}, + "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git+https://github.com/isaacs/node-graceful-fs.git" @@ -118,5 +115,5 @@ "scripts": { "test": "node test.js | tap -" }, - "version": "4.1.2" + "version": "4.1.3" } diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/.npmignore b/deps/npm/node_modules/has-unicode/.npmignore similarity index 100% rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/.npmignore rename to deps/npm/node_modules/has-unicode/.npmignore diff --git a/deps/npm/node_modules/has-unicode/LICENSE b/deps/npm/node_modules/has-unicode/LICENSE new file mode 100644 index 00000000000000..e756052969b780 --- /dev/null +++ b/deps/npm/node_modules/has-unicode/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2014, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/has-unicode/README.md b/deps/npm/node_modules/has-unicode/README.md new file mode 100644 index 00000000000000..ebe3c2a7f4f9fa --- /dev/null +++ b/deps/npm/node_modules/has-unicode/README.md @@ -0,0 +1,42 @@ +has-unicode +=========== + +Try to guess if your terminal supports unicode + +```javascript +var hasUnicode = require("has-unicode") + +if (hasUnicode()) { + // the terminal probably has unicode support +} +``` +```javascript +var hasUnicode = require("has-unicode").tryHarder +hasUnicode(function(unicodeSupported) { + if (unicodeSupported) { + // the terminal probably has unicode support + } +}) +``` + +## Detecting Unicode + +What we actually detect is UTF-8 support, as that's what Node itself supports. +If you have a UTF-16 locale then you won't be detected as unicode capable. + +### Windows + +Since at least Windows 7, `cmd` and `powershell` have been unicode capable, +but unfortunately even then it's not guaranteed. In many localizations it +still uses legacy code pages and there's no facility short of running +programs or linking C++ that will let us detect this. As such, we +report any Windows installation as NOT unicode capable, and recommend +that you encourage your users to override this via config. + +### Unix Like Operating Systems + +We look at the environment variables `LC_ALL`, `LC_CTYPE`, and `LANG` in +that order. For `LC_ALL` and `LANG`, it looks for `.UTF-8` in the value. +For `LC_CTYPE` it looks to see if the value is `UTF-8`. This is sufficient +for most POSIX systems. While locale data can be put in `/etc/locale.conf` +as well, AFAIK it's always copied into the environment. diff --git a/deps/npm/node_modules/has-unicode/index.js b/deps/npm/node_modules/has-unicode/index.js new file mode 100644 index 00000000000000..9bf537b1cd48e5 --- /dev/null +++ b/deps/npm/node_modules/has-unicode/index.js @@ -0,0 +1,21 @@ +"use strict" +var os = require("os") + +var hasUnicode = module.exports = function () { + // Recent Win32 platforms (>XP) CAN support unicode in the console but + // don't have to, and in non-english locales often use traditional local + // code pages. There's no way, short of windows system calls or execing + // the chcp command line program to figure this out. As such, we default + // this to false and encourage your users to override it via config if + // appropriate. + if (os.type() == "Windows_NT") { return false } + + var isUTF8 = /[.]UTF-8/ + if (isUTF8.test(process.env.LC_ALL) + || process.env.LC_CTYPE == 'UTF-8' + || isUTF8.test(process.env.LANG)) { + return true + } + + return false +} diff --git a/deps/npm/node_modules/has-unicode/package.json b/deps/npm/node_modules/has-unicode/package.json new file mode 100644 index 00000000000000..924e3b7a097caf --- /dev/null +++ b/deps/npm/node_modules/has-unicode/package.json @@ -0,0 +1,79 @@ +{ + "_args": [ + [ + "has-unicode@2.0.0", + "/Users/rebecca/code/npm" + ] + ], + "_from": "has-unicode@2.0.0", + "_id": "has-unicode@2.0.0", + "_inCache": true, + "_installable": true, + "_location": "/has-unicode", + "_nodeVersion": "4.2.2", + "_npmUser": { + "email": "me@re-becca.org", + "name": "iarna" + }, + "_npmVersion": "2.14.7", + "_phantomChildren": {}, + "_requested": { + "name": "has-unicode", + "raw": "has-unicode@2.0.0", + "rawSpec": "2.0.0", + "scope": null, + "spec": "2.0.0", + "type": "version" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "file:../has-unicode", + "_shasum": "a3cd96c307ba41d559c5a2ee408c12a11c4c2ec3", + "_shrinkwrap": null, + "_spec": "has-unicode@2.0.0", + "_where": "/Users/rebecca/code/npm", + "author": { + "email": "me@re-becca.org", + "name": "Rebecca Turner" + }, + "bugs": { + "url": "https://github.com/iarna/has-unicode/issues" + }, + "dependencies": {}, + "description": "Try to guess if your terminal supports unicode", + "devDependencies": { + "require-inject": "^1.3.0", + "tap": "^2.3.1" + }, + "directories": {}, + "dist": { + "shasum": "a3cd96c307ba41d559c5a2ee408c12a11c4c2ec3", + "tarball": "http://registry.npmjs.org/has-unicode/-/has-unicode-2.0.0.tgz" + }, + "gitHead": "fdd5de141a5564bdb5bc991d951209da40f6a598", + "homepage": "https://github.com/iarna/has-unicode", + "keywords": [ + "terminal", + "unicode" + ], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "has-unicode", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/has-unicode.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "2.0.0" +} diff --git a/deps/npm/node_modules/has-unicode/test/index.js b/deps/npm/node_modules/has-unicode/test/index.js new file mode 100644 index 00000000000000..cbdfda335088ee --- /dev/null +++ b/deps/npm/node_modules/has-unicode/test/index.js @@ -0,0 +1,26 @@ +"use strict" +var test = require("tap").test +var requireInject = require("require-inject") + +test("Windows", function (t) { + t.plan(1) + var hasUnicode = requireInject("../index.js", { + os: { type: function () { return "Windows_NT" } } + }) + t.is(hasUnicode(), false, "Windows is assumed NOT to be unicode aware") +}) +test("Unix Env", function (t) { + t.plan(3) + var hasUnicode = requireInject("../index.js", { + os: { type: function () { return "Linux" } }, + child_process: { exec: function (cmd,cb) { cb(new Error("not available")) } } + }) + process.env.LANG = "en_US.UTF-8" + process.env.LC_ALL = null + t.is(hasUnicode(), true, "Linux with a UTF8 language") + process.env.LANG = null + process.env.LC_ALL = "en_US.UTF-8" + t.is(hasUnicode(), true, "Linux with UTF8 locale") + process.env.LC_ALL = null + t.is(hasUnicode(), false, "Linux without UTF8 language or locale") +}) diff --git a/deps/npm/node_modules/hosted-git-info/package.json b/deps/npm/node_modules/hosted-git-info/package.json index 8d34aca2d72223..1f78066ca45c1d 100644 --- a/deps/npm/node_modules/hosted-git-info/package.json +++ b/deps/npm/node_modules/hosted-git-info/package.json @@ -30,30 +30,10 @@ "standard": "^3.3.2", "tap": "^0.4.13" }, + "readme": "# hosted-git-info\n\nThis will let you identify and transform various git hosts URLs between\nprotocols. It also can tell you what the URL is for the raw path for\nparticular file for direct access without git.\n\n## Usage\n\n```javascript\nvar hostedGitInfo = require(\"hosted-git-info\")\nvar info = hostedGitInfo.fromUrl(\"git@github.com:npm/hosted-git-info.git\")\n/* info looks like:\n{\n type: \"github\",\n domain: \"github.com\",\n user: \"npm\",\n project: \"hosted-git-info\"\n}\n*/\n```\n\nIf the URL can't be matched with a git host, `null` will be returned. We\ncan match git, ssh and https urls. Additionally, we can match ssh connect\nstrings (`git@github.com:npm/hosted-git-info`) and shortcuts (eg,\n`github:npm/hosted-git-info`). Github specifically, is detected in the case\nof a third, unprefixed, form: `npm/hosted-git-info`.\n\nIf it does match, the returned object has properties of:\n\n* info.type -- The short name of the service\n* info.domain -- The domain for git protocol use\n* info.user -- The name of the user/org on the git host\n* info.project -- The name of the project on the git host\n\nAnd methods of:\n\n* info.file(path)\n\nGiven the path of a file relative to the repository, returns a URL for\ndirectly fetching it from the githost. If no committish was set then\n`master` will be used as the default.\n\nFor example `hostedGitInfo.fromUrl(\"git@github.com:npm/hosted-git-info.git#v1.0.0\").file(\"package.json\")`\nwould return `https://raw.githubusercontent.com/npm/hosted-git-info/v1.0.0/package.json`\n\n* info.shortcut()\n\neg, `github:npm/hosted-git-info`\n\n* info.browse()\n\neg, `https://github.com/npm/hosted-git-info/tree/v1.2.0`\n\n* info.bugs()\n\neg, `https://github.com/npm/hosted-git-info/issues`\n\n* info.docs()\n\neg, `https://github.com/npm/hosted-git-info/tree/v1.2.0#readme`\n\n* info.https()\n\neg, `git+https://github.com/npm/hosted-git-info.git`\n\n* info.sshurl()\n\neg, `git+ssh://git@github.com/npm/hosted-git-info.git`\n\n* info.ssh()\n\neg, `git@github.com:npm/hosted-git-info.git`\n\n* info.path()\n\neg, `npm/hosted-git-info`\n\n* info.getDefaultRepresentation()\n\nReturns the default output type. The default output type is based on the\nstring you passed in to be parsed\n\n* info.toString()\n\nUses the getDefaultRepresentation to call one of the other methods to get a URL for\nthis resource. As such `hostedGitInfo.fromUrl(url).toString()` will give\nyou a normalized version of the URL that still uses the same protocol.\n\nShortcuts will still be returned as shortcuts, but the special case github\nform of `org/project` will be normalized to `github:org/project`.\n\nSSH connect strings will be normalized into `git+ssh` URLs.\n\n\n## Supported hosts\n\nCurrently this supports Github, Bitbucket and Gitlab. Pull requests for\nadditional hosts welcome.\n\n", + "readmeFilename": "README.md", "gitHead": "9e1a36df8eb050a663713c79e56d89dadba2bd8d", "_id": "hosted-git-info@2.1.4", "_shasum": "d9e953b26988be88096c46e926494d9604c300f8", - "_from": "hosted-git-info@>=2.1.2 <2.2.0", - "_npmVersion": "2.10.1", - "_nodeVersion": "2.0.2", - "_npmUser": { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" - }, - "dist": { - "shasum": "d9e953b26988be88096c46e926494d9604c300f8", - "tarball": "http://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.1.4.tgz" - }, - "maintainers": [ - { - "name": "iarna", - "email": "me@re-becca.org" - }, - { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.1.4.tgz" + "_from": "hosted-git-info@>=2.1.4 <2.2.0" } diff --git a/deps/npm/node_modules/ansi/.npmignore b/deps/npm/node_modules/iferr/.npmignore similarity index 100% rename from deps/npm/node_modules/ansi/.npmignore rename to deps/npm/node_modules/iferr/.npmignore diff --git a/deps/npm/node_modules/iferr/LICENSE b/deps/npm/node_modules/iferr/LICENSE new file mode 100644 index 00000000000000..19d5f4bce547ba --- /dev/null +++ b/deps/npm/node_modules/iferr/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Nadav Ivgi + +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. \ No newline at end of file diff --git a/deps/npm/node_modules/iferr/README.md b/deps/npm/node_modules/iferr/README.md new file mode 100644 index 00000000000000..0940763fa94137 --- /dev/null +++ b/deps/npm/node_modules/iferr/README.md @@ -0,0 +1,40 @@ +# iferr + +Higher-order functions for easier error handling. + +`if (err) return cb(err);` be gone! + +## Install +```bash +npm install iferr +``` + +## Use + +### JavaScript example +```js +var iferr = require('iferr'); + +function get_friends_count(id, cb) { + User.load_user(id, iferr(cb, function(user) { + user.load_friends(iferr(cb, function(friends) { + cb(null, friends.length); + })); + })); +} +``` + +### CoffeeScript example +```coffee +iferr = require 'iferr' + +get_friends_count = (id, cb) -> + User.load_user id, iferr cb, (user) -> + user.load_friends iferr cb, (friends) -> + cb null, friends.length +``` + +(TODO: document tiferr, throwerr and printerr) + +## License +MIT diff --git a/deps/npm/node_modules/iferr/index.coffee b/deps/npm/node_modules/iferr/index.coffee new file mode 100644 index 00000000000000..da6d00719f10c4 --- /dev/null +++ b/deps/npm/node_modules/iferr/index.coffee @@ -0,0 +1,24 @@ +# Delegates to `succ` on sucecss or to `fail` on error +# ex: Thing.load 123, iferr cb, (thing) -> ... +iferr = (fail, succ) -> (err, a...) -> + if err? then fail err + else succ? a... + +# Like iferr, but also catches errors thrown from `succ` and passes to `fail` +tiferr = (fail, succ) -> iferr fail, (a...) -> + try succ a... + catch err then fail err + +# Delegate to the success function on success, or throw the error otherwise +# ex: Thing.load 123, throwerr (thing) -> ... +throwerr = iferr.bind null, (err) -> throw err + +# Prints errors when one is passed, or does nothing otherwise +# ex: thing.save printerr +printerr = iferr (err) -> console.error err.stack or err + +module.exports = exports = iferr +exports.iferr = iferr +exports.tiferr = tiferr +exports.throwerr = throwerr +exports.printerr = printerr diff --git a/deps/npm/node_modules/iferr/index.js b/deps/npm/node_modules/iferr/index.js new file mode 100644 index 00000000000000..78fce3d2b0965a --- /dev/null +++ b/deps/npm/node_modules/iferr/index.js @@ -0,0 +1,49 @@ +// Generated by CoffeeScript 1.7.1 +(function() { + var exports, iferr, printerr, throwerr, tiferr, + __slice = [].slice; + + iferr = function(fail, succ) { + return function() { + var a, err; + err = arguments[0], a = 2 <= arguments.length ? __slice.call(arguments, 1) : []; + if (err != null) { + return fail(err); + } else { + return typeof succ === "function" ? succ.apply(null, a) : void 0; + } + }; + }; + + tiferr = function(fail, succ) { + return iferr(fail, function() { + var a, err; + a = 1 <= arguments.length ? __slice.call(arguments, 0) : []; + try { + return succ.apply(null, a); + } catch (_error) { + err = _error; + return fail(err); + } + }); + }; + + throwerr = iferr.bind(null, function(err) { + throw err; + }); + + printerr = iferr(function(err) { + return console.error(err.stack || err); + }); + + module.exports = exports = iferr; + + exports.iferr = iferr; + + exports.tiferr = tiferr; + + exports.throwerr = throwerr; + + exports.printerr = printerr; + +}).call(this); diff --git a/deps/npm/node_modules/iferr/package.json b/deps/npm/node_modules/iferr/package.json new file mode 100644 index 00000000000000..9017857c56ddbc --- /dev/null +++ b/deps/npm/node_modules/iferr/package.json @@ -0,0 +1,50 @@ +{ + "name": "iferr", + "version": "0.1.5", + "description": "Higher-order functions for easier error handling", + "main": "index.js", + "scripts": { + "test": "mocha", + "prepublish": "coffee -c index.coffee" + }, + "repository": { + "type": "git", + "url": "https://github.com/shesek/iferr" + }, + "keywords": [ + "error", + "errors" + ], + "author": { + "name": "Nadav Ivgi" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/shesek/iferr/issues" + }, + "homepage": "https://github.com/shesek/iferr", + "devDependencies": { + "coffee-script": "^1.7.1", + "mocha": "^1.18.2" + }, + "_id": "iferr@0.1.5", + "dist": { + "shasum": "c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501", + "tarball": "http://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz" + }, + "_from": "iferr@>=0.1.5 <0.2.0", + "_npmVersion": "1.4.4", + "_npmUser": { + "name": "nadav", + "email": "npm@shesek.info" + }, + "maintainers": [ + { + "name": "nadav", + "email": "npm@shesek.info" + } + ], + "directories": {}, + "_shasum": "c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501", + "_resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz" +} diff --git a/deps/npm/node_modules/iferr/test/index.coffee b/deps/npm/node_modules/iferr/test/index.coffee new file mode 100644 index 00000000000000..be0bc56fdf1b96 --- /dev/null +++ b/deps/npm/node_modules/iferr/test/index.coffee @@ -0,0 +1,42 @@ +{ iferr, tiferr, throwerr } = require '../index.coffee' +{ equal: eq, throws } = require 'assert' + +invoke_fail = (cb) -> cb new Error 'callback error' +invoke_succ = (cb) -> cb null +throw_error = -> throw new Error 'thrown' + +describe 'iferr', -> + it 'calls the error callback on errors', (done) -> + invoke_fail iferr( + (err) -> + eq err.message, 'callback error' + do done + -> + done new Error 'shouldn\'t call the success callback' + ) + + it 'calls the success callback on success', (done) -> + invoke_succ iferr( + -> done new Error 'shouldn\'t call the error callback' + done + ) + +describe 'tiferr', -> + it 'catches errors in the success callback', (done) -> + invoke_succ tiferr( + (err) -> + eq err.message, 'thrown' + do done + throw_error + ) + +describe 'throwerr', -> + it 'throws errors passed to the callback', (done)-> + try invoke_fail throwerr -> + done 'shouldn\'t call the success callback' + catch err + eq err.message, 'callback error' + do done + + it 'delegates to the success callback otherwise', (done) -> + invoke_succ throwerr done diff --git a/deps/npm/node_modules/iferr/test/mocha.opts b/deps/npm/node_modules/iferr/test/mocha.opts new file mode 100644 index 00000000000000..019defcf152a84 --- /dev/null +++ b/deps/npm/node_modules/iferr/test/mocha.opts @@ -0,0 +1,2 @@ +--compilers coffee:coffee-script/register +--reporter spec diff --git a/deps/npm/node_modules/imurmurhash/README.md b/deps/npm/node_modules/imurmurhash/README.md new file mode 100644 index 00000000000000..f35b20a0ef5bfe --- /dev/null +++ b/deps/npm/node_modules/imurmurhash/README.md @@ -0,0 +1,122 @@ +iMurmurHash.js +============== + +An incremental implementation of the MurmurHash3 (32-bit) hashing algorithm for JavaScript based on [Gary Court's implementation](https://github.com/garycourt/murmurhash-js) with [kazuyukitanimura's modifications](https://github.com/kazuyukitanimura/murmurhash-js). + +This version works significantly faster than the non-incremental version if you need to hash many small strings into a single hash, since string concatenation (to build the single string to pass the non-incremental version) is fairly costly. In one case tested, using the incremental version was about 50% faster than concatenating 5-10 strings and then hashing. + +Installation +------------ + +To use iMurmurHash in the browser, [download the latest version](https://raw.github.com/jensyt/imurmurhash-js/master/imurmurhash.min.js) and include it as a script on your site. + +```html + + +``` + +--- + +To use iMurmurHash in Node.js, install the module using NPM: + +```bash +npm install imurmurhash +``` + +Then simply include it in your scripts: + +```javascript +MurmurHash3 = require('imurmurhash'); +``` + +Quick Example +------------- + +```javascript +// Create the initial hash +var hashState = MurmurHash3('string'); + +// Incrementally add text +hashState.hash('more strings'); +hashState.hash('even more strings'); + +// All calls can be chained if desired +hashState.hash('and').hash('some').hash('more'); + +// Get a result +hashState.result(); +// returns 0xe4ccfe6b +``` + +Functions +--------- + +### MurmurHash3 ([string], [seed]) +Get a hash state object, optionally initialized with the given _string_ and _seed_. _Seed_ must be a positive integer if provided. Calling this function without the `new` keyword will return a cached state object that has been reset. This is safe to use as long as the object is only used from a single thread and no other hashes are created while operating on this one. If this constraint cannot be met, you can use `new` to create a new state object. For example: + +```javascript +// Use the cached object, calling the function again will return the same +// object (but reset, so the current state would be lost) +hashState = MurmurHash3(); +... + +// Create a new object that can be safely used however you wish. Calling the +// function again will simply return a new state object, and no state loss +// will occur, at the cost of creating more objects. +hashState = new MurmurHash3(); +``` + +Both methods can be mixed however you like if you have different use cases. + +--- + +### MurmurHash3.prototype.hash (string) +Incrementally add _string_ to the hash. This can be called as many times as you want for the hash state object, including after a call to `result()`. Returns `this` so calls can be chained. + +--- + +### MurmurHash3.prototype.result () +Get the result of the hash as a 32-bit positive integer. This performs the tail and finalizer portions of the algorithm, but does not store the result in the state object. This means that it is perfectly safe to get results and then continue adding strings via `hash`. + +```javascript +// Do the whole string at once +MurmurHash3('this is a test string').result(); +// 0x70529328 + +// Do part of the string, get a result, then the other part +var m = MurmurHash3('this is a'); +m.result(); +// 0xbfc4f834 +m.hash(' test string').result(); +// 0x70529328 (same as above) +``` + +--- + +### MurmurHash3.prototype.reset ([seed]) +Reset the state object for reuse, optionally using the given _seed_ (defaults to 0 like the constructor). Returns `this` so calls can be chained. + +--- + +License (MIT) +------------- +Copyright (c) 2013 Gary Court, Jens Taylor + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/imurmurhash/imurmurhash.js b/deps/npm/node_modules/imurmurhash/imurmurhash.js new file mode 100644 index 00000000000000..05347a2536fce2 --- /dev/null +++ b/deps/npm/node_modules/imurmurhash/imurmurhash.js @@ -0,0 +1,138 @@ +/** + * @preserve + * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) + * + * @author Jens Taylor + * @see http://github.com/homebrewing/brauhaus-diff + * @author Gary Court + * @see http://github.com/garycourt/murmurhash-js + * @author Austin Appleby + * @see http://sites.google.com/site/murmurhash/ + */ +(function(){ + var cache; + + // Call this function without `new` to use the cached object (good for + // single-threaded environments), or with `new` to create a new object. + // + // @param {string} key A UTF-16 or ASCII string + // @param {number} seed An optional positive integer + // @return {object} A MurmurHash3 object for incremental hashing + function MurmurHash3(key, seed) { + var m = this instanceof MurmurHash3 ? this : cache; + m.reset(seed) + if (typeof key === 'string' && key.length > 0) { + m.hash(key); + } + + if (m !== this) { + return m; + } + }; + + // Incrementally add a string to this hash + // + // @param {string} key A UTF-16 or ASCII string + // @return {object} this + MurmurHash3.prototype.hash = function(key) { + var h1, k1, i, top, len; + + len = key.length; + this.len += len; + + k1 = this.k1; + i = 0; + switch (this.rem) { + case 0: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) : 0; + case 1: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 8 : 0; + case 2: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 16 : 0; + case 3: + k1 ^= len > i ? (key.charCodeAt(i) & 0xff) << 24 : 0; + k1 ^= len > i ? (key.charCodeAt(i++) & 0xff00) >> 8 : 0; + } + + this.rem = (len + this.rem) & 3; // & 3 is same as % 4 + len -= this.rem; + if (len > 0) { + h1 = this.h1; + while (1) { + k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; + k1 = (k1 << 15) | (k1 >>> 17); + k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; + + h1 ^= k1; + h1 = (h1 << 13) | (h1 >>> 19); + h1 = (h1 * 5 + 0xe6546b64) & 0xffffffff; + + if (i >= len) { + break; + } + + k1 = ((key.charCodeAt(i++) & 0xffff)) ^ + ((key.charCodeAt(i++) & 0xffff) << 8) ^ + ((key.charCodeAt(i++) & 0xffff) << 16); + top = key.charCodeAt(i++); + k1 ^= ((top & 0xff) << 24) ^ + ((top & 0xff00) >> 8); + } + + k1 = 0; + switch (this.rem) { + case 3: k1 ^= (key.charCodeAt(i + 2) & 0xffff) << 16; + case 2: k1 ^= (key.charCodeAt(i + 1) & 0xffff) << 8; + case 1: k1 ^= (key.charCodeAt(i) & 0xffff); + } + + this.h1 = h1; + } + + this.k1 = k1; + return this; + }; + + // Get the result of this hash + // + // @return {number} The 32-bit hash + MurmurHash3.prototype.result = function() { + var k1, h1; + + k1 = this.k1; + h1 = this.h1; + + if (k1 > 0) { + k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; + k1 = (k1 << 15) | (k1 >>> 17); + k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; + h1 ^= k1; + } + + h1 ^= this.len; + + h1 ^= h1 >>> 16; + h1 = (h1 * 0xca6b + (h1 & 0xffff) * 0x85eb0000) & 0xffffffff; + h1 ^= h1 >>> 13; + h1 = (h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000) & 0xffffffff; + h1 ^= h1 >>> 16; + + return h1 >>> 0; + }; + + // Reset the hash object for reuse + // + // @param {number} seed An optional positive integer + MurmurHash3.prototype.reset = function(seed) { + this.h1 = typeof seed === 'number' ? seed : 0; + this.rem = this.k1 = this.len = 0; + return this; + }; + + // A cached object to use. This can be safely used if you're in a single- + // threaded environment, otherwise you need to create new hashes to use. + cache = new MurmurHash3(); + + if (typeof(module) != 'undefined') { + module.exports = MurmurHash3; + } else { + this.MurmurHash3 = MurmurHash3; + } +}()); diff --git a/deps/npm/node_modules/imurmurhash/imurmurhash.min.js b/deps/npm/node_modules/imurmurhash/imurmurhash.min.js new file mode 100644 index 00000000000000..dc0ee88d6b69c9 --- /dev/null +++ b/deps/npm/node_modules/imurmurhash/imurmurhash.min.js @@ -0,0 +1,12 @@ +/** + * @preserve + * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) + * + * @author Jens Taylor + * @see http://github.com/homebrewing/brauhaus-diff + * @author Gary Court + * @see http://github.com/garycourt/murmurhash-js + * @author Austin Appleby + * @see http://sites.google.com/site/murmurhash/ + */ +!function(){function t(h,r){var s=this instanceof t?this:e;return s.reset(r),"string"==typeof h&&h.length>0&&s.hash(h),s!==this?s:void 0}var e;t.prototype.hash=function(t){var e,h,r,s,i;switch(i=t.length,this.len+=i,h=this.k1,r=0,this.rem){case 0:h^=i>r?65535&t.charCodeAt(r++):0;case 1:h^=i>r?(65535&t.charCodeAt(r++))<<8:0;case 2:h^=i>r?(65535&t.charCodeAt(r++))<<16:0;case 3:h^=i>r?(255&t.charCodeAt(r))<<24:0,h^=i>r?(65280&t.charCodeAt(r++))>>8:0}if(this.rem=3&i+this.rem,i-=this.rem,i>0){for(e=this.h1;;){if(h=4294967295&11601*h+3432906752*(65535&h),h=h<<15|h>>>17,h=4294967295&13715*h+461832192*(65535&h),e^=h,e=e<<13|e>>>19,e=4294967295&5*e+3864292196,r>=i)break;h=65535&t.charCodeAt(r++)^(65535&t.charCodeAt(r++))<<8^(65535&t.charCodeAt(r++))<<16,s=t.charCodeAt(r++),h^=(255&s)<<24^(65280&s)>>8}switch(h=0,this.rem){case 3:h^=(65535&t.charCodeAt(r+2))<<16;case 2:h^=(65535&t.charCodeAt(r+1))<<8;case 1:h^=65535&t.charCodeAt(r)}this.h1=e}return this.k1=h,this},t.prototype.result=function(){var t,e;return t=this.k1,e=this.h1,t>0&&(t=4294967295&11601*t+3432906752*(65535&t),t=t<<15|t>>>17,t=4294967295&13715*t+461832192*(65535&t),e^=t),e^=this.len,e^=e>>>16,e=4294967295&51819*e+2246770688*(65535&e),e^=e>>>13,e=4294967295&44597*e+3266445312*(65535&e),e^=e>>>16,e>>>0},t.prototype.reset=function(t){return this.h1="number"==typeof t?t:0,this.rem=this.k1=this.len=0,this},e=new t,"undefined"!=typeof module?module.exports=t:this.MurmurHash3=t}(); \ No newline at end of file diff --git a/deps/npm/node_modules/imurmurhash/package.json b/deps/npm/node_modules/imurmurhash/package.json new file mode 100644 index 00000000000000..a8d0b1746207a5 --- /dev/null +++ b/deps/npm/node_modules/imurmurhash/package.json @@ -0,0 +1,85 @@ +{ + "_args": [ + [ + "imurmurhash@^0.1.4", + "/Users/ogd/Documents/projects/npm/npm/node_modules/fs-write-stream-atomic" + ] + ], + "_from": "imurmurhash@>=0.1.4 <0.2.0", + "_id": "imurmurhash@0.1.4", + "_inCache": true, + "_installable": true, + "_location": "/imurmurhash", + "_npmUser": { + "email": "jensyt@gmail.com", + "name": "jensyt" + }, + "_npmVersion": "1.3.2", + "_phantomChildren": {}, + "_requested": { + "name": "imurmurhash", + "raw": "imurmurhash@^0.1.4", + "rawSpec": "^0.1.4", + "scope": null, + "spec": ">=0.1.4 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/fs-write-stream-atomic" + ], + "_resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "_shasum": "9218b9b2b928a238b13dc4fb6b6d576f231453ea", + "_shrinkwrap": null, + "_spec": "imurmurhash@^0.1.4", + "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/fs-write-stream-atomic", + "author": { + "email": "jensyt@gmail.com", + "name": "Jens Taylor", + "url": "https://github.com/homebrewing" + }, + "bugs": { + "url": "https://github.com/jensyt/imurmurhash-js/issues" + }, + "dependencies": {}, + "description": "An incremental implementation of MurmurHash3", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "9218b9b2b928a238b13dc4fb6b6d576f231453ea", + "tarball": "http://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz" + }, + "engines": { + "node": ">=0.8.19" + }, + "files": [ + "README.md", + "imurmurhash.js", + "imurmurhash.min.js", + "package.json" + ], + "homepage": "https://github.com/jensyt/imurmurhash-js", + "keywords": [ + "hash", + "incremental", + "murmur", + "murmurhash", + "murmurhash3" + ], + "license": "MIT", + "main": "imurmurhash.js", + "maintainers": [ + { + "name": "jensyt", + "email": "jensyt@gmail.com" + } + ], + "name": "imurmurhash", + "optionalDependencies": {}, + "readme": "iMurmurHash.js\n==============\n\nAn incremental implementation of the MurmurHash3 (32-bit) hashing algorithm for JavaScript based on [Gary Court's implementation](https://github.com/garycourt/murmurhash-js) with [kazuyukitanimura's modifications](https://github.com/kazuyukitanimura/murmurhash-js).\n\nThis version works significantly faster than the non-incremental version if you need to hash many small strings into a single hash, since string concatenation (to build the single string to pass the non-incremental version) is fairly costly. In one case tested, using the incremental version was about 50% faster than concatenating 5-10 strings and then hashing.\n\nInstallation\n------------\n\nTo use iMurmurHash in the browser, [download the latest version](https://raw.github.com/jensyt/imurmurhash-js/master/imurmurhash.min.js) and include it as a script on your site.\n\n```html\n\n\n```\n\n---\n\nTo use iMurmurHash in Node.js, install the module using NPM:\n\n```bash\nnpm install imurmurhash\n```\n\nThen simply include it in your scripts:\n\n```javascript\nMurmurHash3 = require('imurmurhash');\n```\n\nQuick Example\n-------------\n\n```javascript\n// Create the initial hash\nvar hashState = MurmurHash3('string');\n\n// Incrementally add text\nhashState.hash('more strings');\nhashState.hash('even more strings');\n\n// All calls can be chained if desired\nhashState.hash('and').hash('some').hash('more');\n\n// Get a result\nhashState.result();\n// returns 0xe4ccfe6b\n```\n\nFunctions\n---------\n\n### MurmurHash3 ([string], [seed])\nGet a hash state object, optionally initialized with the given _string_ and _seed_. _Seed_ must be a positive integer if provided. Calling this function without the `new` keyword will return a cached state object that has been reset. This is safe to use as long as the object is only used from a single thread and no other hashes are created while operating on this one. If this constraint cannot be met, you can use `new` to create a new state object. For example:\n\n```javascript\n// Use the cached object, calling the function again will return the same\n// object (but reset, so the current state would be lost)\nhashState = MurmurHash3();\n...\n\n// Create a new object that can be safely used however you wish. Calling the\n// function again will simply return a new state object, and no state loss\n// will occur, at the cost of creating more objects.\nhashState = new MurmurHash3();\n```\n\nBoth methods can be mixed however you like if you have different use cases.\n\n---\n\n### MurmurHash3.prototype.hash (string)\nIncrementally add _string_ to the hash. This can be called as many times as you want for the hash state object, including after a call to `result()`. Returns `this` so calls can be chained.\n\n---\n\n### MurmurHash3.prototype.result ()\nGet the result of the hash as a 32-bit positive integer. This performs the tail and finalizer portions of the algorithm, but does not store the result in the state object. This means that it is perfectly safe to get results and then continue adding strings via `hash`.\n\n```javascript\n// Do the whole string at once\nMurmurHash3('this is a test string').result();\n// 0x70529328\n\n// Do part of the string, get a result, then the other part\nvar m = MurmurHash3('this is a');\nm.result();\n// 0xbfc4f834\nm.hash(' test string').result();\n// 0x70529328 (same as above)\n```\n\n---\n\n### MurmurHash3.prototype.reset ([seed])\nReset the state object for reuse, optionally using the given _seed_ (defaults to 0 like the constructor). Returns `this` so calls can be chained.\n\n---\n\nLicense (MIT)\n-------------\nCopyright (c) 2013 Gary Court, Jens Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", + "readmeFilename": "README.md", + "repository": { + "type": "git", + "url": "git+https://github.com/jensyt/imurmurhash-js.git" + }, + "version": "0.1.4" +} diff --git a/deps/npm/node_modules/inflight/package.json b/deps/npm/node_modules/inflight/package.json index e0b63729cc6dc8..48b4c0e1605a36 100644 --- a/deps/npm/node_modules/inflight/package.json +++ b/deps/npm/node_modules/inflight/package.json @@ -15,7 +15,7 @@ }, "repository": { "type": "git", - "url": "git://github.com/isaacs/inflight" + "url": "git://github.com/isaacs/inflight.git" }, "author": { "name": "Isaac Z. Schlueter", @@ -29,8 +29,8 @@ "license": "ISC", "readme": "# inflight\n\nAdd callbacks to requests in flight to avoid async duplication\n\n## USAGE\n\n```javascript\nvar inflight = require('inflight')\n\n// some request that does some stuff\nfunction req(key, callback) {\n // key is any random string. like a url or filename or whatever.\n //\n // will return either a falsey value, indicating that the\n // request for this key is already in flight, or a new callback\n // which when called will call all callbacks passed to inflightk\n // with the same key\n callback = inflight(key, callback)\n\n // If we got a falsey value back, then there's already a req going\n if (!callback) return\n\n // this is where you'd fetch the url or whatever\n // callback is also once()-ified, so it can safely be assigned\n // to multiple events etc. First call wins.\n setTimeout(function() {\n callback(null, key)\n }, 100)\n}\n\n// only assigns a single setTimeout\n// when it dings, all cbs get called\nreq('foo', cb1)\nreq('foo', cb2)\nreq('foo', cb3)\nreq('foo', cb4)\n```\n", "readmeFilename": "README.md", - "gitHead": "c7b5531d572a867064d4a1da9e013e8910b7d1ba", "_id": "inflight@1.0.4", "_shasum": "6cbb4521ebd51ce0ec0a936bfd7657ef7e9b172a", + "_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz", "_from": "inflight@>=1.0.4 <1.1.0" } diff --git a/deps/npm/node_modules/inherits/package.json b/deps/npm/node_modules/inherits/package.json index a0cd42683614fd..933382a7f44bac 100644 --- a/deps/npm/node_modules/inherits/package.json +++ b/deps/npm/node_modules/inherits/package.json @@ -16,7 +16,7 @@ "browser": "./inherits_browser.js", "repository": { "type": "git", - "url": "git://github.com/isaacs/inherits" + "url": "git://github.com/isaacs/inherits.git" }, "license": "ISC", "scripts": { @@ -27,25 +27,9 @@ "bugs": { "url": "https://github.com/isaacs/inherits/issues" }, + "homepage": "https://github.com/isaacs/inherits#readme", "_id": "inherits@2.0.1", - "dist": { - "shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", - "tarball": "http://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" - }, - "_from": "inherits@latest", - "_npmVersion": "1.3.8", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, "_shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "homepage": "https://github.com/isaacs/inherits" + "_from": "inherits@>=2.0.1 <2.1.0" } diff --git a/deps/npm/node_modules/ini/package.json b/deps/npm/node_modules/ini/package.json index e9b9d5396c0e09..7ea6710a9ae381 100644 --- a/deps/npm/node_modules/ini/package.json +++ b/deps/npm/node_modules/ini/package.json @@ -26,31 +26,14 @@ "files": [ "ini.js" ], - "gitHead": "4a3001abc4c608e51add9f1d2b2cadf02b8e6dea", + "readme": "An ini format parser and serializer for node.\n\nSections are treated as nested objects. Items before the first\nheading are saved on the object directly.\n\n## Usage\n\nConsider an ini-file `config.ini` that looks like this:\n\n ; this comment is being ignored\n scope = global\n\n [database]\n user = dbuser\n password = dbpassword\n database = use_this_database\n\n [paths.default]\n datadir = /var/lib/data\n array[] = first value\n array[] = second value\n array[] = third value\n\nYou can read, manipulate and write the ini-file like so:\n\n var fs = require('fs')\n , ini = require('ini')\n\n var config = ini.parse(fs.readFileSync('./config.ini', 'utf-8'))\n\n config.scope = 'local'\n config.database.database = 'use_another_database'\n config.paths.default.tmpdir = '/tmp'\n delete config.paths.default.datadir\n config.paths.default.array.push('fourth value')\n\n fs.writeFileSync('./config_modified.ini', ini.stringify(config, { section: 'section' }))\n\nThis will result in a file called `config_modified.ini` being written\nto the filesystem with the following content:\n\n [section]\n scope=local\n [section.database]\n user=dbuser\n password=dbpassword\n database=use_another_database\n [section.paths.default]\n tmpdir=/tmp\n array[]=first value\n array[]=second value\n array[]=third value\n array[]=fourth value\n\n\n## API\n\n### decode(inistring)\n\nDecode the ini-style formatted `inistring` into a nested object.\n\n### parse(inistring)\n\nAlias for `decode(inistring)`\n\n### encode(object, [options])\n\nEncode the object `object` into an ini-style formatted string. If the\noptional parameter `section` is given, then all top-level properties\nof the object are put into this section and the `section`-string is\nprepended to all sub-sections, see the usage example above.\n\nThe `options` object may contain the following:\n\n* `section` A string which will be the first `section` in the encoded\n ini data. Defaults to none.\n* `whitespace` Boolean to specify whether to put whitespace around the\n `=` character. By default, whitespace is omitted, to be friendly to\n some persnickety old parsers that don't tolerate it well. But some\n find that it's more human-readable and pretty with the whitespace.\n\nFor backwards compatibility reasons, if a `string` options is passed\nin, then it is assumed to be the `section` value.\n\n### stringify(object, [options])\n\nAlias for `encode(object, [options])`\n\n### safe(val)\n\nEscapes the string `val` such that it is safe to be used as a key or\nvalue in an ini-file. Basically escapes quotes. For example\n\n ini.safe('\"unsafe string\"')\n\nwould result in\n\n \"\\\"unsafe string\\\"\"\n\n### unsafe(val)\n\nUnescapes the string `val`\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/isaacs/ini/issues" }, "homepage": "https://github.com/isaacs/ini#readme", "_id": "ini@1.3.4", "_shasum": "0537cb79daf59b59a1a517dff706c86ec039162e", - "_from": "ini@latest", - "_npmVersion": "2.10.1", - "_nodeVersion": "2.0.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "0537cb79daf59b59a1a517dff706c86ec039162e", - "tarball": "http://registry.npmjs.org/ini/-/ini-1.3.4.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, "_resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", - "readme": "ERROR: No README data found!" + "_from": "ini@>=1.3.4 <1.4.0" } diff --git a/deps/npm/node_modules/init-package-json/README.md b/deps/npm/node_modules/init-package-json/README.md index 2cc79c4bf78100..bd64c1230986fc 100644 --- a/deps/npm/node_modules/init-package-json/README.md +++ b/deps/npm/node_modules/init-package-json/README.md @@ -41,5 +41,5 @@ Or from the command line: $ npm-init ``` -See [PromZard](https://github.com/isaacs/promzard) for details about +See [PromZard](https://github.com/npm/promzard) for details about what can go in the config file. diff --git a/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/LICENSE b/deps/npm/node_modules/init-package-json/node_modules/glob/LICENSE similarity index 100% rename from deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/LICENSE rename to deps/npm/node_modules/init-package-json/node_modules/glob/LICENSE diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/README.md b/deps/npm/node_modules/init-package-json/node_modules/glob/README.md new file mode 100644 index 00000000000000..6960483bac63c6 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/README.md @@ -0,0 +1,359 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +![](oh-my-glob.gif) + +## Usage + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Glob Primer + +"Globs" are the patterns you type when you do stuff like `ls *.js` on +the command line, or put `build/*` in a `.gitignore` file. + +Before parsing the path part patterns, braced sections are expanded +into a set. Braced sections start with `{` and end with `}`, with any +number of comma-delimited sections within. Braced sections may contain +slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. + +The following characters have special magic meaning when used in a +path portion: + +* `*` Matches 0 or more characters in a single path portion +* `?` Matches 1 character +* `[...]` Matches a range of characters, similar to a RegExp range. + If the first character of the range is `!` or `^` then it matches + any character not in the range. +* `!(pattern|pattern|pattern)` Matches anything that does not match + any of the patterns provided. +* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the + patterns provided. +* `+(pattern|pattern|pattern)` Matches one or more occurrences of the + patterns provided. +* `*(a|b|c)` Matches zero or more occurrences of the patterns provided +* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns + provided +* `**` If a "globstar" is alone in a path portion, then it matches + zero or more directories and subdirectories searching for matches. + It does not crawl symlinked directories. + +### Dots + +If a file or directory path portion has a `.` as the first character, +then it will not match any glob pattern unless that pattern's +corresponding path part also has a `.` as its first character. + +For example, the pattern `a/.*/c` would match the file at `a/.b/c`. +However the pattern `a/*/c` would not, because `*` does not start with +a dot character. + +You can make glob treat dots as normal characters by setting +`dot:true` in the options. + +### Basename Matching + +If you set `matchBase:true` in the options, and the pattern has no +slashes in it, then it will seek for any file anywhere in the tree +with a matching basename. For example, `*.js` would match +`test/simple/basic.js`. + +### Empty Sets + +If no matching files are found, then an empty array is returned. This +differs from the shell, where the pattern itself is returned. For +example: + + $ echo a*s*d*f + a*s*d*f + +To get the bash-style behavior, set the `nonull:true` in the options. + +### See Also: + +* `man sh` +* `man bash` (Search for "Pattern Matching") +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob.hasMagic(pattern, [options]) + +Returns `true` if there are any special characters in the pattern, and +`false` otherwise. + +Note that the options affect the results. If `noext:true` is set in +the options object, then `+(a|b)` will not be considered a magic +pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` +then that is considered magical, unless `nobrace:true` is set in the +options. + +## glob(pattern, [options], cb) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* `cb` `{Function}` + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* return: `{Array}` filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instantiating the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` `{String}` pattern to search for +* `options` `{Object}` +* `cb` `{Function}` Called when an error occurs, or matches are found + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `'FILE'` - Path exists, and is not a directory + * `'DIR'` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` +* `statCache` Cache of `fs.stat` results, to prevent statting the same + path multiple times. +* `symlinks` A record of which paths are symbolic links, which is + relevant in resolving `**` patterns. +* `realpathCache` An optional object which is passed to `fs.realpath` + to minimize unnecessary syscalls. It is stored on the instantiated + Glob object, and may be re-used. + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the specific + thing that matched. It is not deduplicated or resolved to a realpath. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `pause` Temporarily stop the search +* `resume` Resume the search +* `abort` Stop the search forever + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the Glob object, as well. + +If you are running many `glob` operations, you can pass a Glob object +as the `options` argument to a subsequent operation to shortcut some +`stat` and `readdir` calls. At the very least, you may pass in shared +`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that +parallel glob operations will be sped up by sharing information about +the filesystem. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. +* `silent` When an unusual error is encountered when attempting to + read a directory, a warning will be printed to stderr. Set the + `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered when attempting to + read a directory, the process will just continue on in search of + other matches. Set the `strict` option to raise an error in these + cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary + to set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `symlinks` A cache of known symbolic links. You may pass in a + previously generated `symlinks` object to save `lstat` calls when + resolving `**` matches. +* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. Set this + flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `debug` Set to enable debug logging in minimatch and glob. +* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. +* `noglobstar` Do not match `**` against multiple filenames. (Ie, + treat it as a normal `*` instead.) +* `noext` Do not match `+(a|b)` "extglob" patterns. +* `nocase` Perform a case-insensitive match. Note: on + case-insensitive filesystems, non-magic patterns will match by + default, since `stat` and `readdir` will not raise errors. +* `matchBase` Perform a basename-only match if the pattern does not + contain any slash characters. That is, `*.js` would be treated as + equivalent to `**/*.js`, matching all js files in all directories. +* `nodir` Do not match directories, only files. (Note: to match + *only* directories, simply put a `/` at the end of the pattern.) +* `ignore` Add a pattern or an array of glob patterns to exclude matches. + Note: `ignore` patterns are *always* in `dot:true` mode, regardless + of any other settings. +* `follow` Follow symlinked directories when expanding `**` patterns. + Note that this can result in a lot of duplicate references in the + presence of cyclic links. +* `realpath` Set to true to call `fs.realpath` on all of the results. + In the case of a symlink that cannot be resolved, the full absolute + path to the matched entry is returned (though it will usually be a + broken symlink) + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.3, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +Note that symlinked directories are not crawled as part of a `**`, +though their contents may match against subsequent portions of the +pattern. This prevents infinite loops and duplicates and the like. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +### Comments and Negation + +Previously, this module let you mark a pattern as a "comment" if it +started with a `#` character, or a "negated" pattern if it started +with a `!` character. + +These options were deprecated in version 5, and removed in version 6. + +To specify things that should not match, use the `ignore` option. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. + +## Contributing + +Any change to behavior (including bugfixes) must come with a test. + +Patches that fail tests or reduce performance will be rejected. + +``` +# to run tests +npm test + +# to re-generate test fixtures +npm run test-regen + +# to benchmark against bash/zsh +npm run bench + +# to profile javascript +npm run prof +``` diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/common.js b/deps/npm/node_modules/init-package-json/node_modules/glob/common.js new file mode 100644 index 00000000000000..c9127eb334f18b --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/common.js @@ -0,0 +1,226 @@ +exports.alphasort = alphasort +exports.alphasorti = alphasorti +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var path = require("path") +var minimatch = require("minimatch") +var isAbsolute = require("path-is-absolute") +var Minimatch = minimatch.Minimatch + +function alphasorti (a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()) +} + +function alphasort (a, b) { + return a.localeCompare(b) +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || [] + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} + +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } + + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = options.cwd + self.changedCwd = path.resolve(options.cwd) !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + self.nomount = !!options.nomount + + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(self.nocase ? alphasorti : alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + return !(/\/$/.test(e)) + }) + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + + self.found = all +} + +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/glob.js b/deps/npm/node_modules/init-package-json/node_modules/glob/glob.js new file mode 100644 index 00000000000000..a62da27ebd507a --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/glob.js @@ -0,0 +1,765 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob + +var fs = require('fs') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var inherits = require('inherits') +var EE = require('events').EventEmitter +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var globSync = require('./sync.js') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = require('inflight') +var util = require('util') +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +var once = require('once') + +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) +} + +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } + + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} + +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + this._didRealPath = false + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } + + var self = this + var n = this.minimatch.set.length + this._processing = 0 + this.matches = new Array(n) + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + + function done () { + --self._processing + if (self._processing <= 0) + self._finish() + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + fs.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} + +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (this.matches[index][e]) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = this._makeAbs(e) + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + if (this.mark) + e = this._mark(e) + + this.matches[index][e] = true + + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er) + return cb() + + var isSym = lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + this.cache[this._makeAbs(f)] = 'FILE' + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } + + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er) { + this.statCache[abs] = false + return cb() + } + + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && !stat.isDirectory()) + return cb(null, false, stat) + + var c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c !== 'DIR') + return cb() + + return cb(null, c, stat) +} diff --git a/deps/npm/node_modules/lru-cache/LICENSE b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/LICENSE similarity index 100% rename from deps/npm/node_modules/lru-cache/LICENSE rename to deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/LICENSE diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/README.md b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/README.md new file mode 100644 index 00000000000000..d458bc2e0a6b03 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/README.md @@ -0,0 +1,216 @@ +# minimatch + +A minimal matching utility. + +[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) + + +This is the matching library used internally by npm. + +It works by converting glob expressions into JavaScript `RegExp` +objects. + +## Usage + +```javascript +var minimatch = require("minimatch") + +minimatch("bar.foo", "*.foo") // true! +minimatch("bar.foo", "*.bar") // false! +minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! +``` + +## Features + +Supports these glob features: + +* Brace Expansion +* Extended glob matching +* "Globstar" `**` matching + +See: + +* `man sh` +* `man bash` +* `man 3 fnmatch` +* `man 5 gitignore` + +## Minimatch Class + +Create a minimatch object by instanting the `minimatch.Minimatch` class. + +```javascript +var Minimatch = require("minimatch").Minimatch +var mm = new Minimatch(pattern, options) +``` + +### Properties + +* `pattern` The original pattern the minimatch object represents. +* `options` The options supplied to the constructor. +* `set` A 2-dimensional array of regexp or string expressions. + Each row in the + array corresponds to a brace-expanded pattern. Each item in the row + corresponds to a single path-part. For example, the pattern + `{a,b/c}/d` would expand to a set of patterns like: + + [ [ a, d ] + , [ b, c, d ] ] + + If a portion of the pattern doesn't have any "magic" in it + (that is, it's something like `"foo"` rather than `fo*o?`), then it + will be left as a string rather than converted to a regular + expression. + +* `regexp` Created by the `makeRe` method. A single regular expression + expressing the entire pattern. This is useful in cases where you wish + to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. +* `negate` True if the pattern is negated. +* `comment` True if the pattern is a comment. +* `empty` True if the pattern is `""`. + +### Methods + +* `makeRe` Generate the `regexp` member if necessary, and return it. + Will return `false` if the pattern is invalid. +* `match(fname)` Return true if the filename matches the pattern, or + false otherwise. +* `matchOne(fileArray, patternArray, partial)` Take a `/`-split + filename, and match it against a single row in the `regExpSet`. This + method is mainly for internal use, but is exposed so that it can be + used by a glob-walker that needs to avoid excessive filesystem calls. + +All other methods are internal, and will be called as necessary. + +## Functions + +The top-level exported function has a `cache` property, which is an LRU +cache set to store 100 items. So, calling these methods repeatedly +with the same pattern and options will use the same Minimatch object, +saving the cost of parsing it multiple times. + +### minimatch(path, pattern, options) + +Main export. Tests a path against the pattern using the options. + +```javascript +var isJS = minimatch(file, "*.js", { matchBase: true }) +``` + +### minimatch.filter(pattern, options) + +Returns a function that tests its +supplied argument, suitable for use with `Array.filter`. Example: + +```javascript +var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) +``` + +### minimatch.match(list, pattern, options) + +Match against the list of +files, in the style of fnmatch or glob. If nothing is matched, and +options.nonull is set, then return a list containing the pattern itself. + +```javascript +var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) +``` + +### minimatch.makeRe(pattern, options) + +Make a regular expression object from the pattern. + +## Options + +All options are `false` by default. + +### debug + +Dump a ton of stuff to stderr. + +### nobrace + +Do not expand `{a,b}` and `{1..3}` brace sets. + +### noglobstar + +Disable `**` matching against multiple folder names. + +### dot + +Allow patterns to match filenames starting with a period, even if +the pattern does not explicitly have a period in that spot. + +Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` +is set. + +### noext + +Disable "extglob" style patterns like `+(a|b)`. + +### nocase + +Perform a case-insensitive match. + +### nonull + +When a match is not found by `minimatch.match`, return a list containing +the pattern itself if this option is set. When not set, an empty list +is returned if there are no matches. + +### matchBase + +If set, then patterns without slashes will be matched +against the basename of the path if it contains slashes. For example, +`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. + +### nocomment + +Suppress the behavior of treating `#` at the start of a pattern as a +comment. + +### nonegate + +Suppress the behavior of treating a leading `!` character as negation. + +### flipNegate + +Returns from negate expressions the same as if they were not negated. +(Ie, true on a hit, false on a miss.) + + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between minimatch and other +implementations, and are intentional. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then minimatch.match returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/minimatch.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/minimatch.js new file mode 100644 index 00000000000000..ec4c05c570c52e --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/minimatch.js @@ -0,0 +1,912 @@ +module.exports = minimatch +minimatch.Minimatch = Minimatch + +var path = { sep: '/' } +try { + path = require('path') +} catch (er) {} + +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} +var expand = require('brace-expansion') + +// any single thing other than / +// don't need to escape / when using new RegExp() +var qmark = '[^/]' + +// * => any number of characters +var star = qmark + '*?' + +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' + +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' + +// characters that need to be escaped in RegExp. +var reSpecials = charSet('().*{}+?[]^$\\!') + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split('').reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + a = a || {} + b = b || {} + var t = {} + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return minimatch + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig.minimatch(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return Minimatch + return minimatch.defaults(def).Minimatch +} + +function minimatch (p, pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false + } + + // "" only matches "" + if (pattern.trim() === '') return p === '' + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options) + } + + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } + + if (!options) options = {} + pattern = pattern.trim() + + // windows support: need to use /, not \ + if (path.sep !== '/') { + pattern = pattern.split(path.sep).join('/') + } + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function () {} + +Minimatch.prototype.make = make +function make () { + // don't do it more than once. + if (this._made) return + + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = console.error + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return s.indexOf(false) === -1 + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + var negate = false + var options = this.options + var negateOffset = 0 + + if (options.nonegate) return + + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { + negate = !negate + negateOffset++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options) +} + +Minimatch.prototype.braceExpand = braceExpand + +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options + } else { + options = {} + } + } + + pattern = typeof pattern === 'undefined' + ? this.pattern : pattern + + if (typeof pattern === 'undefined') { + throw new Error('undefined pattern') + } + + if (options.nobrace || + !pattern.match(/\{.*\}/)) { + // shortcut. no need to expand. + return [pattern] + } + + return expand(pattern) +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + var options = this.options + + // shortcuts + if (!options.noglobstar && pattern === '**') return GLOBSTAR + if (pattern === '') return '' + + var re = '' + var hasMagic = !!options.nocase + var escaping = false + // ? => one single character + var patternListStack = [] + var negativeLists = [] + var plType + var stateChar + var inClass = false + var reClassStart = -1 + var classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + var self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star + hasMagic = true + break + case '?': + re += qmark + hasMagic = true + break + default: + re += '\\' + stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for (var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += '\\' + c + escaping = false + continue + } + + switch (c) { + case '/': + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + + case '\\': + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === '!' && i === classStart + 1) c = '^' + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case '(': + if (inClass) { + re += '(' + continue + } + + if (!stateChar) { + re += '\\(' + continue + } + + plType = stateChar + patternListStack.push({ + type: plType, + start: i - 1, + reStart: re.length + }) + // negation is (?:(?!js)[^/]*) + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ')': + if (inClass || !patternListStack.length) { + re += '\\)' + continue + } + + clearStateChar() + hasMagic = true + re += ')' + var pl = patternListStack.pop() + plType = pl.type + // negation is (?:(?!js)[^/]*) + // The others are (?:) + switch (plType) { + case '!': + negativeLists.push(pl) + re += ')[^/]*?)' + pl.reEnd = re.length + break + case '?': + case '+': + case '*': + re += plType + break + case '@': break // the default anyway + } + continue + + case '|': + if (inClass || !patternListStack.length || escaping) { + re += '\\|' + escaping = false + continue + } + + clearStateChar() + re += '|' + continue + + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += '\\' + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c + escaping = false + continue + } + + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + if (inClass) { + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === '^' && inClass)) { + re += '\\' + } + + re += c + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + 3) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\' + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }) + + this.debug('tail=%j\n %s', tail, tail) + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case '.': + case '[': + case '(': addPatternStart = true + } + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] + + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) + + nlLast += nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter + + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } + + if (addPatternStart) { + re = patternStart + re + } + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? 'i' : '' + var regExp = new RegExp('^' + re + '$', flags) + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) { + this.regexp = false + return this.regexp + } + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + var flags = options.nocase ? 'i' : '' + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|') + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' + + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' + + try { + this.regexp = new RegExp(re, flags) + } catch (ex) { + this.regexp = false + } + return this.regexp +} + +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = match +function match (f, partial) { + this.debug('match', f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === '' + + if (f === '/' && partial) return true + + var options = this.options + + // windows: need to use /, not \ + if (path.sep !== '/') { + f = f.split(path.sep).join('/') + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, 'set', set) + + // Find the basename of the path by looking for the last non-empty segment + var filename + var i + for (i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (i = 0; i < set.length; i++) { + var pattern = set[i] + var file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) + + this.debug('matchOne', file.length, pattern.length) + + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++) { + this.debug('matchOne loop') + var p = pattern[pi] + var f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + var pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr) + break + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr++ + } + } + + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === 'string') { + if (options.nocase) { + hit = f.toLowerCase() === p.toLowerCase() + } else { + hit = f === p + } + this.debug('string match', p, f, hit) + } else { + hit = f.match(p) + this.debug('pattern match', p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') + return emptyFileEnd + } + + // should be unreachable. + throw new Error('wtf?') +} + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, '$1') +} + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') +} diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore new file mode 100644 index 00000000000000..353546af2368e1 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore @@ -0,0 +1,3 @@ +test +.gitignore +.travis.yml diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md new file mode 100644 index 00000000000000..b0d793ed5d9016 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md @@ -0,0 +1,122 @@ +# brace-expansion + +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +as known from sh/bash, in JavaScript. + +[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) +[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) + +[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) + +## Example + +```js +var expand = require('brace-expansion'); + +expand('file-{a,b,c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('-v{,,}') +// => ['-v', '-v', '-v'] + +expand('file{0..2}.jpg') +// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] + +expand('file-{a..c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('file{2..0}.jpg') +// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] + +expand('file{0..4..2}.jpg') +// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] + +expand('file-{a..e..2}.jpg') +// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] + +expand('file{00..10..5}.jpg') +// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] + +expand('{{A..C},{a..c}}') +// => ['A', 'B', 'C', 'a', 'b', 'c'] + +expand('ppp{,config,oe{,conf}}') +// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] +``` + +## API + +```js +var expand = require('brace-expansion'); +``` + +### var expanded = expand(str) + +Return an array of all possible and valid expansions of `str`. If none are +found, `[str]` is returned. + +Valid expansions are: + +```js +/^(.*,)+(.+)?$/ +// {a,b,...} +``` + +A comma seperated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +A numeric sequence from `x` to `y` inclusive, with optional increment. +If `x` or `y` start with a leading `0`, all the numbers will be padded +to have equal length. Negative numbers and backwards iteration work too. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +An alphabetic sequence from `x` to `y` inclusive, with optional increment. +`x` and `y` must be exactly one character, and if given, `incr` must be a +number. + +For compatibility reasons, the string `${` is not eligible for brace expansion. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install brace-expansion +``` + +## Contributors + +- [Julian Gruber](https://github.com/juliangruber) +- [Isaac Z. Schlueter](https://github.com/isaacs) + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js new file mode 100644 index 00000000000000..36cde4de5c114b --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js @@ -0,0 +1,7 @@ +var expand = require('./'); + +console.log(expand('http://any.org/archive{1996..1999}/vol{1..4}/part{a,b,c}.html')); +console.log(expand('http://www.numericals.com/file{1..100..10}.txt')); +console.log(expand('http://www.letters.com/file{a..z..2}.txt')); +console.log(expand('mkdir /usr/local/src/bash/{old,new,dist,bugs}')); +console.log(expand('chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}')); diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js new file mode 100644 index 00000000000000..abe535df327354 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js @@ -0,0 +1,190 @@ +var concatMap = require('concat-map'); +var balanced = require('balanced-match'); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = /^(.*,)+(.+)?$/.test(m.body); + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + + return expansions; +} diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore new file mode 100644 index 00000000000000..fd4f2b066b339e --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore @@ -0,0 +1,2 @@ +node_modules +.DS_Store diff --git a/tools/eslint/node_modules/is-my-json-valid/.travis.yml b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml similarity index 100% rename from tools/eslint/node_modules/is-my-json-valid/.travis.yml rename to deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md new file mode 100644 index 00000000000000..2cdc8e4148cc0a --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md @@ -0,0 +1,21 @@ +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile new file mode 100644 index 00000000000000..dd2730cfde0cab --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile @@ -0,0 +1,5 @@ + +test: + @node_modules/.bin/tape test/*.js + +.PHONY: test diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md new file mode 100644 index 00000000000000..421f3aa5f951a2 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md @@ -0,0 +1,89 @@ +# balanced-match + +Match balanced string pairs, like `{` and `}` or `` and ``. + +[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) +[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) + +[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) + +## Example + +Get the first matching pair of braces: + +```js +var balanced = require('balanced-match'); + +console.log(balanced('{', '}', 'pre{in{nested}}post')); +console.log(balanced('{', '}', 'pre{first}between{second}post')); +``` + +The matches are: + +```bash +$ node example.js +{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } +{ start: 3, + end: 9, + pre: 'pre', + body: 'first', + post: 'between{second}post' } +``` + +## API + +### var m = balanced(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +object with those keys: + +* **start** the index of the first match of `a` +* **end** the index of the matching `b` +* **pre** the preamble, `a` and `b` not included +* **body** the match, `a` and `b` not included +* **post** the postscript, `a` and `b` not included + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`. + +### var r = balanced.range(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +array with indexes: `[ , ]`. + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]`. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install balanced-match +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js new file mode 100644 index 00000000000000..9ce76f480a4321 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js @@ -0,0 +1,4 @@ +var balanced = require('./'); + +console.log(balanced('{', '}', 'pre{in{nested}}post')); +console.log(balanced('{', '}', 'pre{first}between{second}post')); diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js new file mode 100644 index 00000000000000..75f3d71cba90bc --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js @@ -0,0 +1,50 @@ +module.exports = balanced; +function balanced(a, b, str) { + var r = range(a, b, str); + + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} + +balanced.range = range; +function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; + + if (ai >= 0 && bi > 0) { + begs = []; + left = str.length; + + while (i < str.length && i >= 0 && ! result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + + bi = str.indexOf(b, i + 1); + } + + i = ai < bi && ai >= 0 ? ai : bi; + } + + if (begs.length) { + result = [ left, right ]; + } + } + + return result; +} diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json new file mode 100644 index 00000000000000..652900ae4cc29b --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json @@ -0,0 +1,100 @@ +{ + "_args": [ + [ + "balanced-match@^0.3.0", + "/Users/rebecca/code/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" + ], + [ + "balanced-match@^0.3.0", + "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" + ] + ], + "_from": "balanced-match@>=0.3.0 <0.4.0", + "_id": "balanced-match@0.3.0", + "_inCache": true, + "_installable": true, + "_location": "/init-package-json/glob/minimatch/brace-expansion/balanced-match", + "_nodeVersion": "4.2.1", + "_npmUser": { + "email": "julian@juliangruber.com", + "name": "juliangruber" + }, + "_npmVersion": "2.14.7", + "_phantomChildren": {}, + "_requested": { + "name": "balanced-match", + "raw": "balanced-match@^0.3.0", + "rawSpec": "^0.3.0", + "scope": null, + "spec": ">=0.3.0 <0.4.0", + "type": "range" + }, + "_requiredBy": [ + "/init-package-json/glob/minimatch/brace-expansion" + ], + "_shrinkwrap": null, + "_spec": "balanced-match@^0.3.0", + "_where": "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion", + "author": { + "email": "mail@juliangruber.com", + "name": "Julian Gruber", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/balanced-match/issues" + }, + "dependencies": {}, + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "devDependencies": { + "tape": "~4.2.2" + }, + "directories": {}, + "dist": { + "shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756", + "tarball": "http://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz" + }, + "gitHead": "a7114b0986554787e90b7ac595a043ca75ea77e5", + "homepage": "https://github.com/juliangruber/balanced-match", + "keywords": [ + "match", + "regexp", + "test", + "balanced", + "parse" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "email": "julian@juliangruber.com", + "name": "juliangruber" + } + ], + "name": "balanced-match", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "scripts": { + "test": "make test" + }, + "testling": { + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ], + "files": "test/*.js" + }, + "version": "0.3.0" +} diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js new file mode 100644 index 00000000000000..f5e98e3f2a3240 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js @@ -0,0 +1,84 @@ +var test = require('tape'); +var balanced = require('..'); + +test('balanced', function(t) { + t.deepEqual(balanced('{', '}', 'pre{in{nest}}post'), { + start: 3, + end: 12, + pre: 'pre', + body: 'in{nest}', + post: 'post' + }); + t.deepEqual(balanced('{', '}', '{{{{{{{{{in}post'), { + start: 8, + end: 11, + pre: '{{{{{{{{', + body: 'in', + post: 'post' + }); + t.deepEqual(balanced('{', '}', 'pre{body{in}post'), { + start: 8, + end: 11, + pre: 'pre{body', + body: 'in', + post: 'post' + }); + t.deepEqual(balanced('{', '}', 'pre}{in{nest}}post'), { + start: 4, + end: 13, + pre: 'pre}', + body: 'in{nest}', + post: 'post' + }); + t.deepEqual(balanced('{', '}', 'pre{body}between{body2}post'), { + start: 3, + end: 8, + pre: 'pre', + body: 'body', + post: 'between{body2}post' + }); + t.notOk(balanced('{', '}', 'nope'), 'should be notOk'); + t.deepEqual(balanced('', '', 'preinnestpost'), { + start: 3, + end: 19, + pre: 'pre', + body: 'innest', + post: 'post' + }); + t.deepEqual(balanced('', '', 'preinnestpost'), { + start: 7, + end: 23, + pre: 'pre', + body: 'innest', + post: 'post' + }); + t.deepEqual(balanced('{{', '}}', 'pre{{{in}}}post'), { + start: 3, + end: 9, + pre: 'pre', + body: '{in}', + post: 'post' + }); + t.deepEqual(balanced('{{{', '}}', 'pre{{{in}}}post'), { + start: 3, + end: 8, + pre: 'pre', + body: 'in', + post: '}post' + }); + t.deepEqual(balanced('{', '}', 'pre{{first}in{second}post'), { + start: 4, + end: 10, + pre: 'pre{', + body: 'first', + post: 'in{second}post' + }); + t.deepEqual(balanced('', 'prepost'), { + start: 3, + end: 4, + pre: 'pre', + body: '', + post: 'post' + }); + t.end(); +}); diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml new file mode 100644 index 00000000000000..f1d0f13c8a54d0 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.4 + - 0.6 diff --git a/tools/eslint/node_modules/mkdirp/node_modules/minimist/LICENSE b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE similarity index 100% rename from tools/eslint/node_modules/mkdirp/node_modules/minimist/LICENSE rename to deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown new file mode 100644 index 00000000000000..408f70a1be473c --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown @@ -0,0 +1,62 @@ +concat-map +========== + +Concatenative mapdashery. + +[![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map) + +[![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map) + +example +======= + +``` js +var concatMap = require('concat-map'); +var xs = [ 1, 2, 3, 4, 5, 6 ]; +var ys = concatMap(xs, function (x) { + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; +}); +console.dir(ys); +``` + +*** + +``` +[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ] +``` + +methods +======= + +``` js +var concatMap = require('concat-map') +``` + +concatMap(xs, fn) +----------------- + +Return an array of concatenated elements by calling `fn(x, i)` for each element +`x` and each index `i` in the array `xs`. + +When `fn(x, i)` returns an array, its result will be concatenated with the +result array. If `fn(x, i)` returns anything else, that value will be pushed +onto the end of the result array. + +install +======= + +With [npm](http://npmjs.org) do: + +``` +npm install concat-map +``` + +license +======= + +MIT + +notes +===== + +This module was written while sitting high above the ground in a tree. diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js new file mode 100644 index 00000000000000..33656217b61d8f --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js @@ -0,0 +1,6 @@ +var concatMap = require('../'); +var xs = [ 1, 2, 3, 4, 5, 6 ]; +var ys = concatMap(xs, function (x) { + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; +}); +console.dir(ys); diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js new file mode 100644 index 00000000000000..b29a7812e5055a --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js @@ -0,0 +1,13 @@ +module.exports = function (xs, fn) { + var res = []; + for (var i = 0; i < xs.length; i++) { + var x = fn(xs[i], i); + if (isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json new file mode 100644 index 00000000000000..9b6c500890ddd5 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json @@ -0,0 +1,111 @@ +{ + "_args": [ + [ + "concat-map@0.0.1", + "/Users/rebecca/code/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" + ], + [ + "concat-map@0.0.1", + "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" + ] + ], + "_from": "concat-map@0.0.1", + "_id": "concat-map@0.0.1", + "_inCache": true, + "_installable": true, + "_location": "/init-package-json/glob/minimatch/brace-expansion/concat-map", + "_npmUser": { + "email": "mail@substack.net", + "name": "substack" + }, + "_npmVersion": "1.3.21", + "_phantomChildren": {}, + "_requested": { + "name": "concat-map", + "raw": "concat-map@0.0.1", + "rawSpec": "0.0.1", + "scope": null, + "spec": "0.0.1", + "type": "version" + }, + "_requiredBy": [ + "/init-package-json/glob/minimatch/brace-expansion" + ], + "_shrinkwrap": null, + "_spec": "concat-map@0.0.1", + "_where": "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion", + "author": { + "email": "mail@substack.net", + "name": "James Halliday", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/node-concat-map/issues" + }, + "dependencies": {}, + "description": "concatenative mapdashery", + "devDependencies": { + "tape": "~2.4.0" + }, + "directories": { + "example": "example", + "test": "test" + }, + "dist": { + "shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", + "tarball": "http://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + }, + "homepage": "https://github.com/substack/node-concat-map", + "keywords": [ + "concat", + "concatMap", + "map", + "functional", + "higher-order" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "email": "mail@substack.net", + "name": "substack" + } + ], + "name": "concat-map", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/substack/node-concat-map.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "testling": { + "browsers": { + "chrome": [ + 10, + 22 + ], + "ff": [ + 3.5, + 10, + 15 + ], + "ie": [ + 6, + 7, + 8, + 9 + ], + "opera": [ + 12 + ], + "safari": [ + 5.1 + ] + }, + "files": "test/*.js" + }, + "version": "0.0.1" +} diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js new file mode 100644 index 00000000000000..fdbd7022f6da17 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js @@ -0,0 +1,39 @@ +var concatMap = require('../'); +var test = require('tape'); + +test('empty or not', function (t) { + var xs = [ 1, 2, 3, 4, 5, 6 ]; + var ixes = []; + var ys = concatMap(xs, function (x, ix) { + ixes.push(ix); + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; + }); + t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]); + t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]); + t.end(); +}); + +test('always something', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function (x) { + return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ]; + }); + t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); + t.end(); +}); + +test('scalars', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function (x) { + return x === 'b' ? [ 'B', 'B', 'B' ] : x; + }); + t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); + t.end(); +}); + +test('undefs', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function () {}); + t.same(ys, [ undefined, undefined, undefined, undefined ]); + t.end(); +}); diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json new file mode 100644 index 00000000000000..1c2bcddd5af779 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json @@ -0,0 +1,106 @@ +{ + "_args": [ + [ + "brace-expansion@^1.0.0", + "/Users/rebecca/code/npm/node_modules/glob/node_modules/minimatch" + ], + [ + "brace-expansion@^1.0.0", + "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch" + ] + ], + "_from": "brace-expansion@>=1.0.0 <2.0.0", + "_id": "brace-expansion@1.1.3", + "_inCache": true, + "_installable": true, + "_location": "/init-package-json/glob/minimatch/brace-expansion", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-6-west.internal.npmjs.com", + "tmp": "tmp/brace-expansion-1.1.3.tgz_1455216688668_0.948847763473168" + }, + "_npmUser": { + "email": "julian@juliangruber.com", + "name": "juliangruber" + }, + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "name": "brace-expansion", + "raw": "brace-expansion@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/init-package-json/glob/minimatch" + ], + "_shrinkwrap": null, + "_spec": "brace-expansion@^1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch", + "author": { + "email": "mail@juliangruber.com", + "name": "Julian Gruber", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/brace-expansion/issues" + }, + "dependencies": { + "balanced-match": "^0.3.0", + "concat-map": "0.0.1" + }, + "description": "Brace expansion as known from sh/bash", + "devDependencies": { + "tape": "4.4.0" + }, + "directories": {}, + "dist": { + "shasum": "46bff50115d47fc9ab89854abb87d98078a10991", + "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz" + }, + "gitHead": "f0da1bb668e655f67b6b2d660c6e1c19e2a6f231", + "homepage": "https://github.com/juliangruber/brace-expansion", + "keywords": [], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "email": "julian@juliangruber.com", + "name": "juliangruber" + }, + { + "email": "isaacs@npmjs.com", + "name": "isaacs" + } + ], + "name": "brace-expansion", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/brace-expansion.git" + }, + "scripts": { + "gentest": "bash test/generate.sh", + "test": "tape test/*.js" + }, + "testling": { + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ], + "files": "test/*.js" + }, + "version": "1.1.3" +} diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/package.json b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/package.json new file mode 100644 index 00000000000000..ded42917e5f997 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/package.json @@ -0,0 +1,87 @@ +{ + "_args": [ + [ + "minimatch@2 || 3", + "/Users/rebecca/code/npm/node_modules/glob" + ], + [ + "minimatch@2 || 3", + "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob" + ] + ], + "_from": "minimatch@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", + "_id": "minimatch@3.0.0", + "_inCache": true, + "_installable": true, + "_location": "/init-package-json/glob/minimatch", + "_nodeVersion": "4.0.0", + "_npmUser": { + "email": "isaacs@npmjs.com", + "name": "isaacs" + }, + "_npmVersion": "3.3.2", + "_phantomChildren": {}, + "_requested": { + "name": "minimatch", + "raw": "minimatch@2 || 3", + "rawSpec": "2 || 3", + "scope": null, + "spec": ">=2.0.0 <3.0.0||>=3.0.0 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/init-package-json/glob" + ], + "_shrinkwrap": null, + "_spec": "minimatch@2 || 3", + "_where": "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob", + "author": { + "email": "i@izs.me", + "name": "Isaac Z. Schlueter", + "url": "http://blog.izs.me" + }, + "bugs": { + "url": "https://github.com/isaacs/minimatch/issues" + }, + "dependencies": { + "brace-expansion": "^1.0.0" + }, + "description": "a glob matcher in javascript", + "devDependencies": { + "standard": "^3.7.2", + "tap": "^1.2.0" + }, + "directories": {}, + "dist": { + "shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83", + "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz" + }, + "engines": { + "node": "*" + }, + "files": [ + "minimatch.js" + ], + "gitHead": "270dbea567f0af6918cb18103e98c612aa717a20", + "homepage": "https://github.com/isaacs/minimatch#readme", + "license": "ISC", + "main": "minimatch.js", + "maintainers": [ + { + "email": "i@izs.me", + "name": "isaacs" + } + ], + "name": "minimatch", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "scripts": { + "posttest": "standard minimatch.js test/*.js", + "test": "tap test/*.js" + }, + "version": "3.0.0" +} diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/index.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/index.js new file mode 100644 index 00000000000000..19f103f908ac72 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/index.js @@ -0,0 +1,20 @@ +'use strict'; + +function posix(path) { + return path.charAt(0) === '/'; +}; + +function win32(path) { + // https://github.com/joyent/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 + var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + var result = splitDeviceRe.exec(path); + var device = result[1] || ''; + var isUnc = !!device && device.charAt(1) !== ':'; + + // UNC paths are always absolute + return !!result[2] || isUnc; +}; + +module.exports = process.platform === 'win32' ? win32 : posix; +module.exports.posix = posix; +module.exports.win32 = win32; diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/license b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/license similarity index 100% rename from deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/license rename to deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/license diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/package.json b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/package.json new file mode 100644 index 00000000000000..3fc29597c545c7 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/package.json @@ -0,0 +1,99 @@ +{ + "_args": [ + [ + "path-is-absolute@^1.0.0", + "/Users/rebecca/code/npm/node_modules/glob" + ], + [ + "path-is-absolute@^1.0.0", + "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob" + ] + ], + "_from": "path-is-absolute@>=1.0.0 <2.0.0", + "_id": "path-is-absolute@1.0.0", + "_inCache": true, + "_installable": true, + "_location": "/init-package-json/glob/path-is-absolute", + "_nodeVersion": "0.12.0", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_npmVersion": "2.5.1", + "_phantomChildren": {}, + "_requested": { + "name": "path-is-absolute", + "raw": "path-is-absolute@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/init-package-json/glob" + ], + "_shrinkwrap": null, + "_spec": "path-is-absolute@^1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/path-is-absolute/issues" + }, + "dependencies": {}, + "description": "Node.js 0.12 path.isAbsolute() ponyfill", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912", + "tarball": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "7a76a0c9f2263192beedbe0a820e4d0baee5b7a1", + "homepage": "https://github.com/sindresorhus/path-is-absolute", + "keywords": [ + "path", + "paths", + "file", + "dir", + "absolute", + "isabsolute", + "is-absolute", + "built-in", + "util", + "utils", + "core", + "ponyfill", + "polyfill", + "shim", + "is", + "detect", + "check" + ], + "license": "MIT", + "maintainers": [ + { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + } + ], + "name": "path-is-absolute", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/path-is-absolute.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md new file mode 100644 index 00000000000000..cdf94f4309a27e --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md @@ -0,0 +1,51 @@ +# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute) + +> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) ponyfill + +> Ponyfill: A polyfill that doesn't overwrite the native method + + +## Install + +``` +$ npm install --save path-is-absolute +``` + + +## Usage + +```js +var pathIsAbsolute = require('path-is-absolute'); + +// Linux +pathIsAbsolute('/home/foo'); +//=> true + +// Windows +pathIsAbsolute('C:/Users/'); +//=> true + +// Any OS +pathIsAbsolute.posix('/home/foo'); +//=> true +``` + + +## API + +See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path). + +### pathIsAbsolute(path) + +### pathIsAbsolute.posix(path) + +The Posix specific version. + +### pathIsAbsolute.win32(path) + +The Windows specific version. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/package.json b/deps/npm/node_modules/init-package-json/node_modules/glob/package.json new file mode 100644 index 00000000000000..1ce30a9b38b138 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/package.json @@ -0,0 +1,98 @@ +{ + "_args": [ + [ + "glob@^6.0.0", + "/Users/rebecca/code/npm/node_modules/init-package-json" + ] + ], + "_from": "glob@>=6.0.0 <7.0.0", + "_id": "glob@6.0.4", + "_inCache": true, + "_installable": true, + "_location": "/init-package-json/glob", + "_nodeVersion": "4.0.0", + "_npmUser": { + "email": "i@izs.me", + "name": "isaacs" + }, + "_npmVersion": "2.14.15", + "_phantomChildren": {}, + "_requested": { + "name": "glob", + "raw": "glob@^6.0.0", + "rawSpec": "^6.0.0", + "scope": null, + "spec": ">=6.0.0 <7.0.0", + "type": "range" + }, + "_requiredBy": [ + "/init-package-json" + ], + "_resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", + "_shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22", + "_shrinkwrap": null, + "_spec": "glob@^6.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/init-package-json", + "author": { + "email": "i@izs.me", + "name": "Isaac Z. Schlueter", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/node-glob/issues" + }, + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "description": "a little globber", + "devDependencies": { + "mkdirp": "0", + "rimraf": "^2.2.8", + "tap": "^5.0.0", + "tick": "0.0.6" + }, + "directories": {}, + "dist": { + "shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22", + "tarball": "http://registry.npmjs.org/glob/-/glob-6.0.4.tgz" + }, + "engines": { + "node": "*" + }, + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "gitHead": "3bd419c538737e56fda7e21c21ff52ca0c198df6", + "homepage": "https://github.com/isaacs/node-glob#readme", + "license": "ISC", + "main": "glob.js", + "maintainers": [ + { + "email": "i@izs.me", + "name": "isaacs" + } + ], + "name": "glob", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "scripts": { + "bench": "bash benchmark.sh", + "benchclean": "node benchclean.js", + "prepublish": "npm run benchclean", + "prof": "bash prof.sh && cat profile.txt", + "profclean": "rm -f v8.log profile.txt", + "test": "tap test/*.js --cov", + "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js" + }, + "version": "6.0.4" +} diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/sync.js b/deps/npm/node_modules/init-package-json/node_modules/glob/sync.js new file mode 100644 index 00000000000000..09883d2ce0c9de --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/sync.js @@ -0,0 +1,460 @@ +module.exports = globSync +globSync.GlobSync = GlobSync + +var fs = require('fs') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var Glob = require('./glob.js').Glob +var util = require('util') +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = fs.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this.matches[index][e] = true + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + var abs = this._makeAbs(e) + if (this.mark) + e = this._mark(e) + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[this._makeAbs(e)] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + // lstat failed, doesn't exist + return null + } + + var isSym = lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + this.cache[this._makeAbs(f)] = 'FILE' + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this.matches[index][prefix] = true +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + return false + } + + if (lstat.isSymbolicLink()) { + try { + stat = fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c !== 'DIR') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} diff --git a/deps/npm/node_modules/init-package-json/node_modules/promzard/example/substack-input.js b/deps/npm/node_modules/init-package-json/node_modules/promzard/example/substack-input.js index bf7aedb82d41fd..c049c20f9a2736 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/promzard/example/substack-input.js +++ b/deps/npm/node_modules/init-package-json/node_modules/promzard/example/substack-input.js @@ -17,7 +17,7 @@ module.exports = { ; } catch (e) {} - + return prompt('description', value); })(), "main" : prompt('entry point', 'index.js'), diff --git a/deps/npm/node_modules/init-package-json/node_modules/promzard/promzard.js b/deps/npm/node_modules/init-package-json/node_modules/promzard/promzard.js index da1abca9535e4f..424152a802eb02 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/promzard/promzard.js +++ b/deps/npm/node_modules/init-package-json/node_modules/promzard/promzard.js @@ -235,4 +235,3 @@ PromZard.prototype.prompt = function (pdt, cb) { read({ prompt: prompt + ':' , default: def }, cb) } - diff --git a/deps/npm/node_modules/init-package-json/node_modules/promzard/test/simple.js b/deps/npm/node_modules/init-package-json/node_modules/promzard/test/simple.js index 034a86475afbd5..bcf8791113ead7 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/promzard/test/simple.js +++ b/deps/npm/node_modules/init-package-json/node_modules/promzard/test/simple.js @@ -3,7 +3,7 @@ var promzard = require('../'); test('simple', function (t) { t.plan(1); - + var ctx = { tmpdir : '/tmp' } var file = __dirname + '/simple.input'; promzard(file, ctx, function (err, output) { @@ -19,11 +19,11 @@ test('simple', function (t) { output ); }); - + setTimeout(function () { process.stdin.emit('data', '\n'); }, 100); - + setTimeout(function () { process.stdin.emit('data', '55\n'); }, 200); diff --git a/deps/npm/node_modules/init-package-json/package.json b/deps/npm/node_modules/init-package-json/package.json index 0cc543ece404f1..21e33c570ccc3f 100644 --- a/deps/npm/node_modules/init-package-json/package.json +++ b/deps/npm/node_modules/init-package-json/package.json @@ -1,23 +1,49 @@ { - "name": "init-package-json", - "version": "1.9.1", - "main": "init-package-json.js", - "scripts": { - "test": "tap test/*.js" + "_args": [ + [ + "init-package-json@~1.9.3", + "/Users/rebecca/code/npm" + ] + ], + "_from": "init-package-json@>=1.9.3 <1.10.0", + "_id": "init-package-json@1.9.3", + "_inCache": true, + "_installable": true, + "_location": "/init-package-json", + "_nodeVersion": "4.2.2", + "_npmUser": { + "email": "me@re-becca.org", + "name": "iarna" }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/init-package-json.git" + "_npmVersion": "3.5.4", + "_phantomChildren": { + "read": "1.0.7" + }, + "_requested": { + "name": "init-package-json", + "raw": "init-package-json@~1.9.3", + "rawSpec": "~1.9.3", + "scope": null, + "spec": ">=1.9.3 <1.10.0", + "type": "range" }, + "_requiredBy": [ + "/" + ], + "_shasum": "ca2ff94709b6d9aaad66533c11a0aff645f15c7d", + "_shrinkwrap": null, + "_spec": "init-package-json@~1.9.3", + "_where": "/Users/rebecca/code/npm", "author": { - "name": "Isaac Z. Schlueter", "email": "i@izs.me", + "name": "Isaac Z. Schlueter", "url": "http://blog.izs.me/" }, - "license": "ISC", - "description": "A node module to get your node module started", + "bugs": { + "url": "https://github.com/npm/init-package-json/issues" + }, "dependencies": { - "glob": "^5.0.3", + "glob": "^6.0.0", "npm-package-arg": "^4.0.0", "promzard": "^0.3.0", "read": "~1.0.1", @@ -26,39 +52,31 @@ "validate-npm-package-license": "^3.0.1", "validate-npm-package-name": "^2.0.1" }, + "description": "A node module to get your node module started", "devDependencies": { "npm": "^2", "rimraf": "^2.1.4", "tap": "^1.2.0" }, + "directories": {}, + "dist": { + "shasum": "ca2ff94709b6d9aaad66533c11a0aff645f15c7d", + "tarball": "http://registry.npmjs.org/init-package-json/-/init-package-json-1.9.3.tgz" + }, + "gitHead": "12eb24ff2f75f84a4a27436bc6f6cb765cbd9ee2", + "homepage": "https://github.com/npm/init-package-json#readme", "keywords": [ + "helper", "init", - "package.json", "package", - "helper", - "wizard", - "wizerd", + "package.json", "prompt", - "start" + "start", + "wizard", + "wizerd" ], - "gitHead": "37c38b4e23189eb5645901fa6851f343fddd4b73", - "bugs": { - "url": "https://github.com/isaacs/init-package-json/issues" - }, - "homepage": "https://github.com/isaacs/init-package-json#readme", - "_id": "init-package-json@1.9.1", - "_shasum": "a28e05b5baeb3363cd473df68d30d3a80523a31c", - "_from": "init-package-json@1.9.1", - "_npmVersion": "2.14.1", - "_nodeVersion": "2.2.2", - "_npmUser": { - "name": "zkat", - "email": "kat@sykosomatic.org" - }, - "dist": { - "shasum": "a28e05b5baeb3363cd473df68d30d3a80523a31c", - "tarball": "http://registry.npmjs.org/init-package-json/-/init-package-json-1.9.1.tgz" - }, + "license": "ISC", + "main": "init-package-json.js", "maintainers": [ { "name": "isaacs", @@ -77,6 +95,15 @@ "email": "kat@sykosomatic.org" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.9.1.tgz" + "name": "init-package-json", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/init-package-json.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "1.9.3" } diff --git a/deps/npm/node_modules/lockfile/package.json b/deps/npm/node_modules/lockfile/package.json index cd18aa2ed520fe..dcb230e26165a1 100644 --- a/deps/npm/node_modules/lockfile/package.json +++ b/deps/npm/node_modules/lockfile/package.json @@ -38,7 +38,7 @@ "homepage": "https://github.com/isaacs/lockfile#readme", "_id": "lockfile@1.0.1", "_shasum": "9d353ecfe3f54d150bb57f89d51746935a39c4f5", - "_from": "lockfile@>=1.0.0 <1.1.0", + "_from": "lockfile@>=1.0.1 <1.1.0", "_npmVersion": "2.10.0", "_nodeVersion": "2.0.1", "_npmUser": { @@ -59,5 +59,6 @@ "email": "i@izs.me" } ], - "_resolved": "https://registry.npmjs.org/lockfile/-/lockfile-1.0.1.tgz" + "_resolved": "https://registry.npmjs.org/lockfile/-/lockfile-1.0.1.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/LICENSE.txt b/deps/npm/node_modules/lodash._baseindexof/LICENSE.txt similarity index 100% rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/LICENSE.txt rename to deps/npm/node_modules/lodash._baseindexof/LICENSE.txt diff --git a/deps/npm/node_modules/lodash._baseindexof/README.md b/deps/npm/node_modules/lodash._baseindexof/README.md new file mode 100644 index 00000000000000..ddcc79d5d66aee --- /dev/null +++ b/deps/npm/node_modules/lodash._baseindexof/README.md @@ -0,0 +1,20 @@ +# lodash._baseindexof v3.1.0 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseIndexOf` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._baseindexof +``` + +In Node.js/io.js: + +```js +var baseIndexOf = require('lodash._baseindexof'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash._baseindexof) for more details. diff --git a/deps/npm/node_modules/lodash._baseindexof/index.js b/deps/npm/node_modules/lodash._baseindexof/index.js new file mode 100644 index 00000000000000..e5da79147894ae --- /dev/null +++ b/deps/npm/node_modules/lodash._baseindexof/index.js @@ -0,0 +1,57 @@ +/** + * lodash 3.1.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.2 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** + * The base implementation of `_.indexOf` without support for binary searches. + * + * @private + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + if (value !== value) { + return indexOfNaN(array, fromIndex); + } + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +/** + * Gets the index at which the first occurrence of `NaN` is found in `array`. + * If `fromRight` is provided elements of `array` are iterated from right to left. + * + * @private + * @param {Array} array The array to search. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched `NaN`, else `-1`. + */ +function indexOfNaN(array, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 0 : -1); + + while ((fromRight ? index-- : ++index < length)) { + var other = array[index]; + if (other !== other) { + return index; + } + } + return -1; +} + +module.exports = baseIndexOf; diff --git a/deps/npm/node_modules/lodash._baseindexof/package.json b/deps/npm/node_modules/lodash._baseindexof/package.json new file mode 100644 index 00000000000000..e95728db128a6b --- /dev/null +++ b/deps/npm/node_modules/lodash._baseindexof/package.json @@ -0,0 +1,56 @@ +{ + "name": "lodash._baseindexof", + "version": "3.1.0", + "description": "The modern build of lodash’s internal `baseIndexOf` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "readme": "# lodash._baseindexof v3.1.0\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseIndexOf` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._baseindexof\n```\n\nIn Node.js/io.js:\n\n```js\nvar baseIndexOf = require('lodash._baseindexof');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash._baseindexof) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash._baseindexof@3.1.0", + "_shasum": "fe52b53a1c6761e42618d654e4a25789ed61822c", + "_resolved": "https://registry.npmjs.org/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz", + "_from": "lodash._baseindexof@3.1.0" +} diff --git a/deps/npm/node_modules/lodash._baseuniq/LICENSE b/deps/npm/node_modules/lodash._baseuniq/LICENSE new file mode 100644 index 00000000000000..bcbe13d67a9621 --- /dev/null +++ b/deps/npm/node_modules/lodash._baseuniq/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/lodash._baseuniq/README.md b/deps/npm/node_modules/lodash._baseuniq/README.md new file mode 100644 index 00000000000000..1d02b801f9bb3b --- /dev/null +++ b/deps/npm/node_modules/lodash._baseuniq/README.md @@ -0,0 +1,18 @@ +# lodash._baseuniq v4.5.1 + +The internal [lodash](https://lodash.com/) function `baseUniq` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._baseuniq +``` + +In Node.js: +```js +var baseUniq = require('lodash._baseuniq'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/4.5.1-npm-packages/lodash._baseuniq) for more details. diff --git a/deps/npm/node_modules/lodash._baseuniq/index.js b/deps/npm/node_modules/lodash._baseuniq/index.js new file mode 100644 index 00000000000000..ffdc06f7b57aff --- /dev/null +++ b/deps/npm/node_modules/lodash._baseuniq/index.js @@ -0,0 +1,207 @@ +/** + * lodash 4.5.1 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var SetCache = require('lodash._setcache'), + createSet = require('lodash._createset'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} array The array to search. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludes(array, value) { + return !!array.length && baseIndexOf(array, value, 0) > -1; +} + +/** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to search. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; +} + +/** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + if (value !== value) { + return indexOfNaN(array, fromIndex); + } + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +/** + * Gets the index at which the first occurrence of `NaN` is found in `array`. + * + * @private + * @param {Array} array The array to search. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched `NaN`, else `-1`. + */ +function indexOfNaN(array, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 0 : -1); + + while ((fromRight ? index-- : ++index < length)) { + var other = array[index]; + if (other !== other) { + return index; + } + } + return -1; +} + +/** + * Converts `set` to an array. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the converted array. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** + * Checks if `value` is in `cache`. + * + * @private + * @param {Object} cache The set cache to search. + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function cacheHas(cache, value) { + var map = cache.__data__; + if (isKeyable(value)) { + var data = map.__data__, + hash = typeof value == 'string' ? data.string : data.hash; + + return hash[value] === HASH_UNDEFINED; + } + return map.has(value); +} + +/** + * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ +function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return type == 'number' || type == 'boolean' || + (type == 'string' && value != '__proto__') || value == null; +} + +module.exports = baseUniq; diff --git a/deps/npm/node_modules/lodash._baseuniq/node_modules/lodash._createset/LICENSE b/deps/npm/node_modules/lodash._baseuniq/node_modules/lodash._createset/LICENSE new file mode 100644 index 00000000000000..bcbe13d67a9621 --- /dev/null +++ b/deps/npm/node_modules/lodash._baseuniq/node_modules/lodash._createset/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/lodash._baseuniq/node_modules/lodash._createset/README.md b/deps/npm/node_modules/lodash._baseuniq/node_modules/lodash._createset/README.md new file mode 100644 index 00000000000000..fe6cc9b5121339 --- /dev/null +++ b/deps/npm/node_modules/lodash._baseuniq/node_modules/lodash._createset/README.md @@ -0,0 +1,18 @@ +# lodash._createset v4.0.1 + +The internal [lodash](https://lodash.com/) function `createSet` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._createset +``` + +In Node.js: +```js +var createSet = require('lodash._createset'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/4.0.1-npm-packages/lodash._createset) for more details. diff --git a/deps/npm/node_modules/lodash._baseuniq/node_modules/lodash._createset/index.js b/deps/npm/node_modules/lodash._baseuniq/node_modules/lodash._createset/index.js new file mode 100644 index 00000000000000..8c85b236d13461 --- /dev/null +++ b/deps/npm/node_modules/lodash._baseuniq/node_modules/lodash._createset/index.js @@ -0,0 +1,260 @@ +/** + * lodash 4.0.1 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** `Object#toString` result references. */ +var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; + +/** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari > 5). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to determine if values are of the language type `Object`. */ +var objectTypes = { + 'function': true, + 'object': true +}; + +/** Detect free variable `exports`. */ +var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) + ? exports + : undefined; + +/** Detect free variable `module`. */ +var freeModule = (objectTypes[typeof module] && module && !module.nodeType) + ? module + : undefined; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); + +/** Detect free variable `self`. */ +var freeSelf = checkGlobal(objectTypes[typeof self] && self); + +/** Detect free variable `window`. */ +var freeWindow = checkGlobal(objectTypes[typeof window] && window); + +/** Detect `this` as the global object. */ +var thisGlobal = checkGlobal(objectTypes[typeof this] && this); + +/** + * Used as a reference to the global object. + * + * The `this` value is used if it's the global object to avoid Greasemonkey's + * restricted `window` object, otherwise the `window` object is used. + */ +var root = freeGlobal || + ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || + freeSelf || thisGlobal || Function('return this')(); + +/** + * Checks if `value` is a global object. + * + * @private + * @param {*} value The value to check. + * @returns {null|Object} Returns `value` if it's a global object, else `null`. + */ +function checkGlobal(value) { + return (value && value.Object === Object) ? value : null; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = Function.prototype.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/* Built-in method references that are verified to be native. */ +var Set = getNative(root, 'Set'); + +/** + * Creates a set of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ +var createSet = !(Set && new Set([1, 2]).size === 2) ? noop : function(values) { + return new Set(values); +}; + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = object[key]; + return isNative(value) ? value : undefined; +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array and weak map constructors, + // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ +function isNative(value) { + if (value == null) { + return false; + } + if (isFunction(value)) { + return reIsNative.test(funcToString.call(value)); + } + return isObjectLike(value) && + (isHostObject(value) ? reIsNative : reIsHostCtor).test(value); +} + +/** + * A no-operation function that returns `undefined` regardless of the + * arguments it receives. + * + * @static + * @memberOf _ + * @category Util + * @example + * + * var object = { 'user': 'fred' }; + * + * _.noop(object) === undefined; + * // => true + */ +function noop() { + // No operation performed. +} + +module.exports = createSet; diff --git a/deps/npm/node_modules/lodash._baseuniq/node_modules/lodash._createset/package.json b/deps/npm/node_modules/lodash._baseuniq/node_modules/lodash._createset/package.json new file mode 100644 index 00000000000000..857e620a91b611 --- /dev/null +++ b/deps/npm/node_modules/lodash._baseuniq/node_modules/lodash._createset/package.json @@ -0,0 +1,101 @@ +{ + "_args": [ + [ + "lodash._createset@~4.0.0", + "/Users/zkat/Documents/code/npm/node_modules/lodash._baseuniq" + ] + ], + "_from": "lodash._createset@>=4.0.0 <4.1.0", + "_id": "lodash._createset@4.0.1", + "_inCache": true, + "_installable": true, + "_location": "/lodash._baseuniq/lodash._createset", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-13-west.internal.npmjs.com", + "tmp": "tmp/lodash._createset-4.0.1.tgz_1456896434807_0.3753381560090929" + }, + "_npmUser": { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + "_npmVersion": "2.14.17", + "_phantomChildren": {}, + "_requested": { + "name": "lodash._createset", + "raw": "lodash._createset@~4.0.0", + "rawSpec": "~4.0.0", + "scope": null, + "spec": ">=4.0.0 <4.1.0", + "type": "range" + }, + "_requiredBy": [ + "/lodash._baseuniq" + ], + "_resolved": "https://registry.npmjs.org/lodash._createset/-/lodash._createset-4.0.1.tgz", + "_shasum": "00e891e3dd386c4512fcb1f49060dfa4d02a9819", + "_shrinkwrap": null, + "_spec": "lodash._createset@~4.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/lodash._baseuniq", + "author": { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "contributors": [ + { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + { + "email": "blaine.bublitz@gmail.com", + "name": "Blaine Bublitz", + "url": "https://github.com/phated" + }, + { + "email": "mathias@qiwi.be", + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": {}, + "description": "The internal lodash function `createSet` exported as a module.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "00e891e3dd386c4512fcb1f49060dfa4d02a9819", + "tarball": "https://registry.npmjs.org/lodash._createset/-/lodash._createset-4.0.1.tgz" + }, + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "maintainers": [ + { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + { + "email": "mathias@qiwi.be", + "name": "mathias" + }, + { + "email": "blaine.bublitz@gmail.com", + "name": "phated" + } + ], + "name": "lodash._createset", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.0.1" +} diff --git a/deps/npm/node_modules/lodash._baseuniq/node_modules/lodash._setcache/LICENSE b/deps/npm/node_modules/lodash._baseuniq/node_modules/lodash._setcache/LICENSE new file mode 100644 index 00000000000000..bcbe13d67a9621 --- /dev/null +++ b/deps/npm/node_modules/lodash._baseuniq/node_modules/lodash._setcache/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/lodash._baseuniq/node_modules/lodash._setcache/README.md b/deps/npm/node_modules/lodash._baseuniq/node_modules/lodash._setcache/README.md new file mode 100644 index 00000000000000..696e7cd135725c --- /dev/null +++ b/deps/npm/node_modules/lodash._baseuniq/node_modules/lodash._setcache/README.md @@ -0,0 +1,18 @@ +# lodash._setcache v4.1.1 + +The internal [lodash](https://lodash.com/) function `SetCache` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._setcache +``` + +In Node.js: +```js +var SetCache = require('lodash._setcache'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/4.1.1-npm-packages/lodash._setcache) for more details. diff --git a/deps/npm/node_modules/lodash._baseuniq/node_modules/lodash._setcache/index.js b/deps/npm/node_modules/lodash._baseuniq/node_modules/lodash._setcache/index.js new file mode 100644 index 00000000000000..dd96de49f1fa96 --- /dev/null +++ b/deps/npm/node_modules/lodash._baseuniq/node_modules/lodash._setcache/index.js @@ -0,0 +1,588 @@ +/** + * lodash 4.1.1 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** `Object#toString` result references. */ +var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; + +/** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari > 5). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to determine if values are of the language type `Object`. */ +var objectTypes = { + 'function': true, + 'object': true +}; + +/** Detect free variable `exports`. */ +var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) + ? exports + : undefined; + +/** Detect free variable `module`. */ +var freeModule = (objectTypes[typeof module] && module && !module.nodeType) + ? module + : undefined; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); + +/** Detect free variable `self`. */ +var freeSelf = checkGlobal(objectTypes[typeof self] && self); + +/** Detect free variable `window`. */ +var freeWindow = checkGlobal(objectTypes[typeof window] && window); + +/** Detect `this` as the global object. */ +var thisGlobal = checkGlobal(objectTypes[typeof this] && this); + +/** + * Used as a reference to the global object. + * + * The `this` value is used if it's the global object to avoid Greasemonkey's + * restricted `window` object, otherwise the `window` object is used. + */ +var root = freeGlobal || + ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || + freeSelf || thisGlobal || Function('return this')(); + +/** + * Checks if `value` is a global object. + * + * @private + * @param {*} value The value to check. + * @returns {null|Object} Returns `value` if it's a global object, else `null`. + */ +function checkGlobal(value) { + return (value && value.Object === Object) ? value : null; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = Function.prototype.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'), + nativeCreate = getNative(Object, 'create'); + +/** + * Creates an hash object. + * + * @private + * @constructor + * @returns {Object} Returns the new hash object. + */ +function Hash() {} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(hash, key) { + return hashHas(hash, key) && delete hash[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @param {Object} hash The hash to query. + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(hash, key) { + if (nativeCreate) { + var result = hash[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(hash, key) ? hash[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @param {Object} hash The hash to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(hash, key) { + return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + */ +function hashSet(hash, key, value) { + hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; +} + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function MapCache(values) { + var index = -1, + length = values ? values.length : 0; + + this.clear(); + while (++index < length) { + var entry = values[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapClear() { + this.__data__ = { + 'hash': new Hash, + 'map': Map ? new Map : [], + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapDelete(key) { + var data = this.__data__; + if (isKeyable(key)) { + return hashDelete(typeof key == 'string' ? data.string : data.hash, key); + } + return Map ? data.map['delete'](key) : assocDelete(data.map, key); +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapGet(key) { + var data = this.__data__; + if (isKeyable(key)) { + return hashGet(typeof key == 'string' ? data.string : data.hash, key); + } + return Map ? data.map.get(key) : assocGet(data.map, key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapHas(key) { + var data = this.__data__; + if (isKeyable(key)) { + return hashHas(typeof key == 'string' ? data.string : data.hash, key); + } + return Map ? data.map.has(key) : assocHas(data.map, key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache object. + */ +function mapSet(key, value) { + var data = this.__data__; + if (isKeyable(key)) { + hashSet(typeof key == 'string' ? data.string : data.hash, key, value); + } else if (Map) { + data.map.set(key, value); + } else { + assocSet(data.map, key, value); + } + return this; +} + +/** + * + * Creates a set cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values ? values.length : 0; + + this.__data__ = new MapCache; + while (++index < length) { + this.push(values[index]); + } +} + +/** + * Adds `value` to the set cache. + * + * @private + * @name push + * @memberOf SetCache + * @param {*} value The value to cache. + */ +function cachePush(value) { + var map = this.__data__; + if (isKeyable(value)) { + var data = map.__data__, + hash = typeof value == 'string' ? data.string : data.hash; + + hash[value] = HASH_UNDEFINED; + } + else { + map.set(value, HASH_UNDEFINED); + } +} + +/** + * Removes `key` and its value from the associative array. + * + * @private + * @param {Array} array The array to query. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function assocDelete(array, key) { + var index = assocIndexOf(array, key); + if (index < 0) { + return false; + } + var lastIndex = array.length - 1; + if (index == lastIndex) { + array.pop(); + } else { + splice.call(array, index, 1); + } + return true; +} + +/** + * Gets the associative array value for `key`. + * + * @private + * @param {Array} array The array to query. + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function assocGet(array, key) { + var index = assocIndexOf(array, key); + return index < 0 ? undefined : array[index][1]; +} + +/** + * Checks if an associative array value for `key` exists. + * + * @private + * @param {Array} array The array to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function assocHas(array, key) { + return assocIndexOf(array, key) > -1; +} + +/** + * Gets the index at which the first occurrence of `key` is found in `array` + * of key-value pairs. + * + * @private + * @param {Array} array The array to search. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * Sets the associative array `key` to `value`. + * + * @private + * @param {Array} array The array to modify. + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + */ +function assocSet(array, key, value) { + var index = assocIndexOf(array, key); + if (index < 0) { + array.push([key, value]); + } else { + array[index][1] = value; + } +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = object[key]; + return isNative(value) ? value : undefined; +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return type == 'number' || type == 'boolean' || + (type == 'string' && value != '__proto__') || value == null; +} + +/** + * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'user': 'fred' }; + * var other = { 'user': 'fred' }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array and weak map constructors, + // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ +function isNative(value) { + if (value == null) { + return false; + } + if (isFunction(value)) { + return reIsNative.test(funcToString.call(value)); + } + return isObjectLike(value) && + (isHostObject(value) ? reIsNative : reIsHostCtor).test(value); +} + +// Avoid inheriting from `Object.prototype` when possible. +Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto; + +// Add functions to the `MapCache`. +MapCache.prototype.clear = mapClear; +MapCache.prototype['delete'] = mapDelete; +MapCache.prototype.get = mapGet; +MapCache.prototype.has = mapHas; +MapCache.prototype.set = mapSet; + +// Add functions to the `SetCache`. +SetCache.prototype.push = cachePush; + +module.exports = SetCache; diff --git a/deps/npm/node_modules/lodash._baseuniq/node_modules/lodash._setcache/package.json b/deps/npm/node_modules/lodash._baseuniq/node_modules/lodash._setcache/package.json new file mode 100644 index 00000000000000..2fedb703b4b97b --- /dev/null +++ b/deps/npm/node_modules/lodash._baseuniq/node_modules/lodash._setcache/package.json @@ -0,0 +1,101 @@ +{ + "_args": [ + [ + "lodash._setcache@~4.1.0", + "/Users/zkat/Documents/code/npm/node_modules/lodash._baseuniq" + ] + ], + "_from": "lodash._setcache@>=4.1.0 <4.2.0", + "_id": "lodash._setcache@4.1.1", + "_inCache": true, + "_installable": true, + "_location": "/lodash._baseuniq/lodash._setcache", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/lodash._setcache-4.1.1.tgz_1456896443505_0.39592266851104796" + }, + "_npmUser": { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + "_npmVersion": "2.14.17", + "_phantomChildren": {}, + "_requested": { + "name": "lodash._setcache", + "raw": "lodash._setcache@~4.1.0", + "rawSpec": "~4.1.0", + "scope": null, + "spec": ">=4.1.0 <4.2.0", + "type": "range" + }, + "_requiredBy": [ + "/lodash._baseuniq" + ], + "_resolved": "https://registry.npmjs.org/lodash._setcache/-/lodash._setcache-4.1.1.tgz", + "_shasum": "338f47e49f21ba8bb89e621e7815d781bd4dbd97", + "_shrinkwrap": null, + "_spec": "lodash._setcache@~4.1.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/lodash._baseuniq", + "author": { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "contributors": [ + { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + { + "email": "blaine.bublitz@gmail.com", + "name": "Blaine Bublitz", + "url": "https://github.com/phated" + }, + { + "email": "mathias@qiwi.be", + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": {}, + "description": "The internal lodash function `SetCache` exported as a module.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "338f47e49f21ba8bb89e621e7815d781bd4dbd97", + "tarball": "https://registry.npmjs.org/lodash._setcache/-/lodash._setcache-4.1.1.tgz" + }, + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "maintainers": [ + { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + { + "email": "mathias@qiwi.be", + "name": "mathias" + }, + { + "email": "blaine.bublitz@gmail.com", + "name": "phated" + } + ], + "name": "lodash._setcache", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.1.1" +} diff --git a/deps/npm/node_modules/lodash._baseuniq/package.json b/deps/npm/node_modules/lodash._baseuniq/package.json new file mode 100644 index 00000000000000..f4cffe5507b59f --- /dev/null +++ b/deps/npm/node_modules/lodash._baseuniq/package.json @@ -0,0 +1,106 @@ +{ + "_args": [ + [ + "lodash._baseuniq@4.5.1", + "/Users/zkat/Documents/code/npm" + ] + ], + "_from": "lodash._baseuniq@4.5.1", + "_id": "lodash._baseuniq@4.5.1", + "_inCache": true, + "_installable": true, + "_location": "/lodash._baseuniq", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/lodash._baseuniq-4.5.1.tgz_1459310621859_0.6014031588565558" + }, + "_npmUser": { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + "_npmVersion": "2.15.1", + "_phantomChildren": {}, + "_requested": { + "name": "lodash._baseuniq", + "raw": "lodash._baseuniq@4.5.1", + "rawSpec": "4.5.1", + "scope": null, + "spec": "4.5.1", + "type": "version" + }, + "_requiredBy": [ + "/", + "/lodash.union", + "/lodash.uniq" + ], + "_resolved": "https://registry.npmjs.org/lodash._baseuniq/-/lodash._baseuniq-4.5.1.tgz", + "_shasum": "1980430c2e64ee86df6dd35794e1a301b2ab74de", + "_shrinkwrap": null, + "_spec": "lodash._baseuniq@4.5.1", + "_where": "/Users/zkat/Documents/code/npm", + "author": { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "contributors": [ + { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + { + "email": "blaine.bublitz@gmail.com", + "name": "Blaine Bublitz", + "url": "https://github.com/phated" + }, + { + "email": "mathias@qiwi.be", + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": { + "lodash._createset": "~4.0.0", + "lodash._setcache": "~4.1.0" + }, + "description": "The internal lodash function `baseUniq` exported as a module.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "1980430c2e64ee86df6dd35794e1a301b2ab74de", + "tarball": "https://registry.npmjs.org/lodash._baseuniq/-/lodash._baseuniq-4.5.1.tgz" + }, + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "maintainers": [ + { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + { + "email": "mathias@qiwi.be", + "name": "mathias" + }, + { + "email": "blaine@iceddev.com", + "name": "phated" + } + ], + "name": "lodash._baseuniq", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.5.1" +} diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/LICENSE.txt b/deps/npm/node_modules/lodash._bindcallback/LICENSE.txt similarity index 100% rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/LICENSE.txt rename to deps/npm/node_modules/lodash._bindcallback/LICENSE.txt diff --git a/deps/npm/node_modules/lodash._bindcallback/README.md b/deps/npm/node_modules/lodash._bindcallback/README.md new file mode 100644 index 00000000000000..d287f26d81bc3c --- /dev/null +++ b/deps/npm/node_modules/lodash._bindcallback/README.md @@ -0,0 +1,20 @@ +# lodash._bindcallback v3.0.1 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `bindCallback` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._bindcallback +``` + +In Node.js/io.js: + +```js +var bindCallback = require('lodash._bindcallback'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._bindcallback) for more details. diff --git a/deps/npm/node_modules/lodash._bindcallback/index.js b/deps/npm/node_modules/lodash._bindcallback/index.js new file mode 100644 index 00000000000000..ef6811d1a5ebf3 --- /dev/null +++ b/deps/npm/node_modules/lodash._bindcallback/index.js @@ -0,0 +1,65 @@ +/** + * lodash 3.0.1 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** + * A specialized version of `baseCallback` which only supports `this` binding + * and specifying the number of arguments to provide to `func`. + * + * @private + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {number} [argCount] The number of arguments to provide to `func`. + * @returns {Function} Returns the callback. + */ +function bindCallback(func, thisArg, argCount) { + if (typeof func != 'function') { + return identity; + } + if (thisArg === undefined) { + return func; + } + switch (argCount) { + case 1: return function(value) { + return func.call(thisArg, value); + }; + case 3: return function(value, index, collection) { + return func.call(thisArg, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(thisArg, accumulator, value, index, collection); + }; + case 5: return function(value, other, key, object, source) { + return func.call(thisArg, value, other, key, object, source); + }; + } + return function() { + return func.apply(thisArg, arguments); + }; +} + +/** + * This method returns the first argument provided to it. + * + * @static + * @memberOf _ + * @category Utility + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'user': 'fred' }; + * + * _.identity(object) === object; + * // => true + */ +function identity(value) { + return value; +} + +module.exports = bindCallback; diff --git a/deps/npm/node_modules/lodash._bindcallback/package.json b/deps/npm/node_modules/lodash._bindcallback/package.json new file mode 100644 index 00000000000000..551b321e44136e --- /dev/null +++ b/deps/npm/node_modules/lodash._bindcallback/package.json @@ -0,0 +1,56 @@ +{ + "name": "lodash._bindcallback", + "version": "3.0.1", + "description": "The modern build of lodash’s internal `bindCallback` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "readme": "# lodash._bindcallback v3.0.1\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `bindCallback` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._bindcallback\n```\n\nIn Node.js/io.js:\n\n```js\nvar bindCallback = require('lodash._bindcallback');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._bindcallback) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash._bindcallback@3.0.1", + "_shasum": "e531c27644cf8b57a99e17ed95b35c748789392e", + "_resolved": "https://registry.npmjs.org/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz", + "_from": "lodash._bindcallback@3.0.1" +} diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/LICENSE.txt b/deps/npm/node_modules/lodash._cacheindexof/LICENSE.txt similarity index 100% rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/LICENSE.txt rename to deps/npm/node_modules/lodash._cacheindexof/LICENSE.txt diff --git a/deps/npm/node_modules/lodash._cacheindexof/README.md b/deps/npm/node_modules/lodash._cacheindexof/README.md new file mode 100644 index 00000000000000..69d2b62bf5dbed --- /dev/null +++ b/deps/npm/node_modules/lodash._cacheindexof/README.md @@ -0,0 +1,20 @@ +# lodash._cacheindexof v3.0.2 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `cacheIndexOf` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._cacheindexof +``` + +In Node.js/io.js: + +```js +var cacheIndexOf = require('lodash._cacheindexof'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash._cacheindexof) for more details. diff --git a/deps/npm/node_modules/lodash._cacheindexof/index.js b/deps/npm/node_modules/lodash._cacheindexof/index.js new file mode 100644 index 00000000000000..bc1d5afcfd5778 --- /dev/null +++ b/deps/npm/node_modules/lodash._cacheindexof/index.js @@ -0,0 +1,53 @@ +/** + * lodash 3.0.2 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** + * Checks if `value` is in `cache` mimicking the return signature of + * `_.indexOf` by returning `0` if the value is found, else `-1`. + * + * @private + * @param {Object} cache The cache to search. + * @param {*} value The value to search for. + * @returns {number} Returns `0` if `value` is found, else `-1`. + */ +function cacheIndexOf(cache, value) { + var data = cache.data, + result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value]; + + return result ? 0 : -1; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +module.exports = cacheIndexOf; diff --git a/deps/npm/node_modules/lodash._cacheindexof/package.json b/deps/npm/node_modules/lodash._cacheindexof/package.json new file mode 100644 index 00000000000000..c46ba3bd3fad64 --- /dev/null +++ b/deps/npm/node_modules/lodash._cacheindexof/package.json @@ -0,0 +1,56 @@ +{ + "name": "lodash._cacheindexof", + "version": "3.0.2", + "description": "The modern build of lodash’s internal `cacheIndexOf` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "readme": "# lodash._cacheindexof v3.0.2\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `cacheIndexOf` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._cacheindexof\n```\n\nIn Node.js/io.js:\n\n```js\nvar cacheIndexOf = require('lodash._cacheindexof');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash._cacheindexof) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash._cacheindexof@3.0.2", + "_shasum": "3dc69ac82498d2ee5e3ce56091bafd2adc7bde92", + "_resolved": "https://registry.npmjs.org/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz", + "_from": "lodash._cacheindexof@3.0.2" +} diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/LICENSE.txt b/deps/npm/node_modules/lodash._createcache/LICENSE similarity index 100% rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/LICENSE.txt rename to deps/npm/node_modules/lodash._createcache/LICENSE diff --git a/deps/npm/node_modules/lodash._createcache/README.md b/deps/npm/node_modules/lodash._createcache/README.md new file mode 100644 index 00000000000000..0ee4834d086a5b --- /dev/null +++ b/deps/npm/node_modules/lodash._createcache/README.md @@ -0,0 +1,20 @@ +# lodash._createcache v3.1.2 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `createCache` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._createcache +``` + +In Node.js/io.js: + +```js +var createCache = require('lodash._createcache'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.1.2-npm-packages/lodash._createcache) for more details. diff --git a/deps/npm/node_modules/lodash._createcache/index.js b/deps/npm/node_modules/lodash._createcache/index.js new file mode 100644 index 00000000000000..6cf391c1497a4c --- /dev/null +++ b/deps/npm/node_modules/lodash._createcache/index.js @@ -0,0 +1,91 @@ +/** + * lodash 3.1.2 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var getNative = require('lodash._getnative'); + +/** Native method references. */ +var Set = getNative(global, 'Set'); + +/* Native method references for those with the same name as other `lodash` methods. */ +var nativeCreate = getNative(Object, 'create'); + +/** + * + * Creates a cache object to store unique values. + * + * @private + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var length = values ? values.length : 0; + + this.data = { 'hash': nativeCreate(null), 'set': new Set }; + while (length--) { + this.push(values[length]); + } +} + +/** + * Adds `value` to the cache. + * + * @private + * @name push + * @memberOf SetCache + * @param {*} value The value to cache. + */ +function cachePush(value) { + var data = this.data; + if (typeof value == 'string' || isObject(value)) { + data.set.add(value); + } else { + data.hash[value] = true; + } +} + +/** + * Creates a `Set` cache object to optimize linear searches of large arrays. + * + * @private + * @param {Array} [values] The values to cache. + * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`. + */ +function createCache(values) { + return (nativeCreate && Set) ? new SetCache(values) : null; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +// Add functions to the `Set` cache. +SetCache.prototype.push = cachePush; + +module.exports = createCache; diff --git a/deps/npm/node_modules/lodash._createcache/package.json b/deps/npm/node_modules/lodash._createcache/package.json new file mode 100644 index 00000000000000..844c9c04a6b066 --- /dev/null +++ b/deps/npm/node_modules/lodash._createcache/package.json @@ -0,0 +1,59 @@ +{ + "name": "lodash._createcache", + "version": "3.1.2", + "description": "The modern build of lodash’s internal `createCache` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "dependencies": { + "lodash._getnative": "^3.0.0" + }, + "readme": "# lodash._createcache v3.1.2\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `createCache` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._createcache\n```\n\nIn Node.js/io.js:\n\n```js\nvar createCache = require('lodash._createcache');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.1.2-npm-packages/lodash._createcache) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash._createcache@3.1.2", + "_shasum": "56d6a064017625e79ebca6b8018e17440bdcf093", + "_resolved": "https://registry.npmjs.org/lodash._createcache/-/lodash._createcache-3.1.2.tgz", + "_from": "lodash._createcache@3.1.2" +} diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/LICENSE.txt b/deps/npm/node_modules/lodash._getnative/LICENSE similarity index 100% rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/LICENSE.txt rename to deps/npm/node_modules/lodash._getnative/LICENSE diff --git a/deps/npm/node_modules/lodash._getnative/README.md b/deps/npm/node_modules/lodash._getnative/README.md new file mode 100644 index 00000000000000..7835cec0ab1c02 --- /dev/null +++ b/deps/npm/node_modules/lodash._getnative/README.md @@ -0,0 +1,20 @@ +# lodash._getnative v3.9.1 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `getNative` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._getnative +``` + +In Node.js/io.js: + +```js +var getNative = require('lodash._getnative'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.9.1-npm-packages/lodash._getnative) for more details. diff --git a/deps/npm/node_modules/lodash._getnative/index.js b/deps/npm/node_modules/lodash._getnative/index.js new file mode 100644 index 00000000000000..a32063d27b9e74 --- /dev/null +++ b/deps/npm/node_modules/lodash._getnative/index.js @@ -0,0 +1,137 @@ +/** + * lodash 3.9.1 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** `Object#toString` result references. */ +var funcTag = '[object Function]'; + +/** Used to detect host constructors (Safari > 5). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var fnToString = Function.prototype.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = object == null ? undefined : object[key]; + return isNative(value) ? value : undefined; +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in older versions of Chrome and Safari which return 'function' for regexes + // and Safari 8 equivalents which return 'object' for typed array constructors. + return isObject(value) && objToString.call(value) == funcTag; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ +function isNative(value) { + if (value == null) { + return false; + } + if (isFunction(value)) { + return reIsNative.test(fnToString.call(value)); + } + return isObjectLike(value) && reIsHostCtor.test(value); +} + +module.exports = getNative; diff --git a/deps/npm/node_modules/lodash._getnative/package.json b/deps/npm/node_modules/lodash._getnative/package.json new file mode 100644 index 00000000000000..455383d29fce10 --- /dev/null +++ b/deps/npm/node_modules/lodash._getnative/package.json @@ -0,0 +1,56 @@ +{ + "name": "lodash._getnative", + "version": "3.9.1", + "description": "The modern build of lodash’s internal `getNative` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "readme": "# lodash._getnative v3.9.1\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `getNative` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._getnative\n```\n\nIn Node.js/io.js:\n\n```js\nvar getNative = require('lodash._getnative');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.9.1-npm-packages/lodash._getnative) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash._getnative@3.9.1", + "_shasum": "570bc7dede46d61cdcde687d65d3eecbaa3aaff5", + "_resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", + "_from": "lodash._getnative@3.9.1" +} diff --git a/deps/npm/node_modules/lodash.clonedeep/LICENSE b/deps/npm/node_modules/lodash.clonedeep/LICENSE new file mode 100644 index 00000000000000..bcbe13d67a9621 --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/lodash.clonedeep/README.md b/deps/npm/node_modules/lodash.clonedeep/README.md new file mode 100644 index 00000000000000..1287ee1c00732a --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/README.md @@ -0,0 +1,18 @@ +# lodash.clonedeep v4.3.2 + +The [lodash](https://lodash.com/) method `_.cloneDeep` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.clonedeep +``` + +In Node.js: +```js +var cloneDeep = require('lodash.clonedeep'); +``` + +See the [documentation](https://lodash.com/docs#cloneDeep) or [package source](https://github.com/lodash/lodash/blob/4.3.2-npm-packages/lodash.clonedeep) for more details. diff --git a/deps/npm/node_modules/lodash.clonedeep/index.js b/deps/npm/node_modules/lodash.clonedeep/index.js new file mode 100644 index 00000000000000..88794c2c4a3bfe --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/index.js @@ -0,0 +1,31 @@ +/** + * lodash 4.3.2 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var baseClone = require('lodash._baseclone'); + +/** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ +function cloneDeep(value) { + return baseClone(value, true, true); +} + +module.exports = cloneDeep; diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/LICENSE b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/LICENSE new file mode 100644 index 00000000000000..bcbe13d67a9621 --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/README.md b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/README.md new file mode 100644 index 00000000000000..7c997274efee06 --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/README.md @@ -0,0 +1,18 @@ +# lodash._baseclone v4.5.3 + +The internal [lodash](https://lodash.com/) function `baseClone` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._baseclone +``` + +In Node.js: +```js +var baseClone = require('lodash._baseclone'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/4.5.3-npm-packages/lodash._baseclone) for more details. diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/index.js b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/index.js new file mode 100644 index 00000000000000..4781750782800a --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/index.js @@ -0,0 +1,1644 @@ +/** + * lodash 4.5.3 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to match `RegExp` flags from their coerced string values. */ +var reFlags = /\w*$/; + +/** Used to detect host constructors (Safari > 5). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Used to identify `toStringTag` values supported by `_.clone`. */ +var cloneableTags = {}; +cloneableTags[argsTag] = cloneableTags[arrayTag] = +cloneableTags[arrayBufferTag] = cloneableTags[boolTag] = +cloneableTags[dateTag] = cloneableTags[float32Tag] = +cloneableTags[float64Tag] = cloneableTags[int8Tag] = +cloneableTags[int16Tag] = cloneableTags[int32Tag] = +cloneableTags[mapTag] = cloneableTags[numberTag] = +cloneableTags[objectTag] = cloneableTags[regexpTag] = +cloneableTags[setTag] = cloneableTags[stringTag] = +cloneableTags[symbolTag] = cloneableTags[uint8Tag] = +cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = +cloneableTags[uint32Tag] = true; +cloneableTags[errorTag] = cloneableTags[funcTag] = +cloneableTags[weakMapTag] = false; + +/** Used to determine if values are of the language type `Object`. */ +var objectTypes = { + 'function': true, + 'object': true +}; + +/** Detect free variable `exports`. */ +var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) + ? exports + : undefined; + +/** Detect free variable `module`. */ +var freeModule = (objectTypes[typeof module] && module && !module.nodeType) + ? module + : undefined; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = (freeModule && freeModule.exports === freeExports) + ? freeExports + : undefined; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); + +/** Detect free variable `self`. */ +var freeSelf = checkGlobal(objectTypes[typeof self] && self); + +/** Detect free variable `window`. */ +var freeWindow = checkGlobal(objectTypes[typeof window] && window); + +/** Detect `this` as the global object. */ +var thisGlobal = checkGlobal(objectTypes[typeof this] && this); + +/** + * Used as a reference to the global object. + * + * The `this` value is used if it's the global object to avoid Greasemonkey's + * restricted `window` object, otherwise the `window` object is used. + */ +var root = freeGlobal || + ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || + freeSelf || thisGlobal || Function('return this')(); + +/** + * Adds the key-value `pair` to `map`. + * + * @private + * @param {Object} map The map to modify. + * @param {Array} pair The key-value pair to add. + * @returns {Object} Returns `map`. + */ +function addMapEntry(map, pair) { + // Don't return `Map#set` because it doesn't return the map instance in IE 11. + map.set(pair[0], pair[1]); + return map; +} + +/** + * Adds `value` to `set`. + * + * @private + * @param {Object} set The set to modify. + * @param {*} value The value to add. + * @returns {Object} Returns `set`. + */ +function addSetEntry(set, value) { + set.add(value); + return set; +} + +/** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ +function arrayEach(array, iteratee) { + var index = -1, + length = array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; +} + +/** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as the initial value. + * @returns {*} Returns the accumulated value. + */ +function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array.length; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * Checks if `value` is a global object. + * + * @private + * @param {*} value The value to check. + * @returns {null|Object} Returns `value` if it's a global object, else `null`. + */ +function checkGlobal(value) { + return (value && value.Object === Object) ? value : null; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; + length = length == null ? MAX_SAFE_INTEGER : length; + return value > -1 && value % 1 == 0 && value < length; +} + +/** + * Converts `map` to an array. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the converted array. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +/** + * Converts `set` to an array. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the converted array. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = Function.prototype.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + getPrototypeOf = Object.getPrototypeOf, + getOwnPropertySymbols = Object.getOwnPropertySymbols, + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = Object.keys; + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + +/** Used to detect maps, sets, and weakmaps. */ +var mapCtorString = Map ? funcToString.call(Map) : '', + setCtorString = Set ? funcToString.call(Set) : '', + weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : ''; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * Creates an hash object. + * + * @private + * @constructor + * @returns {Object} Returns the new hash object. + */ +function Hash() {} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(hash, key) { + return hashHas(hash, key) && delete hash[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @param {Object} hash The hash to query. + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(hash, key) { + if (nativeCreate) { + var result = hash[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(hash, key) ? hash[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @param {Object} hash The hash to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(hash, key) { + return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + */ +function hashSet(hash, key, value) { + hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; +} + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function MapCache(values) { + var index = -1, + length = values ? values.length : 0; + + this.clear(); + while (++index < length) { + var entry = values[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapClear() { + this.__data__ = { + 'hash': new Hash, + 'map': Map ? new Map : [], + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapDelete(key) { + var data = this.__data__; + if (isKeyable(key)) { + return hashDelete(typeof key == 'string' ? data.string : data.hash, key); + } + return Map ? data.map['delete'](key) : assocDelete(data.map, key); +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapGet(key) { + var data = this.__data__; + if (isKeyable(key)) { + return hashGet(typeof key == 'string' ? data.string : data.hash, key); + } + return Map ? data.map.get(key) : assocGet(data.map, key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapHas(key) { + var data = this.__data__; + if (isKeyable(key)) { + return hashHas(typeof key == 'string' ? data.string : data.hash, key); + } + return Map ? data.map.has(key) : assocHas(data.map, key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache object. + */ +function mapSet(key, value) { + var data = this.__data__; + if (isKeyable(key)) { + hashSet(typeof key == 'string' ? data.string : data.hash, key, value); + } else if (Map) { + data.map.set(key, value); + } else { + assocSet(data.map, key, value); + } + return this; +} + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function Stack(values) { + var index = -1, + length = values ? values.length : 0; + + this.clear(); + while (++index < length) { + var entry = values[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = { 'array': [], 'map': null }; +} + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + var data = this.__data__, + array = data.array; + + return array ? assocDelete(array, key) : data.map['delete'](key); +} + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + var data = this.__data__, + array = data.array; + + return array ? assocGet(array, key) : data.map.get(key); +} + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + var data = this.__data__, + array = data.array; + + return array ? assocHas(array, key) : data.map.has(key); +} + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache object. + */ +function stackSet(key, value) { + var data = this.__data__, + array = data.array; + + if (array) { + if (array.length < (LARGE_ARRAY_SIZE - 1)) { + assocSet(array, key, value); + } else { + data.array = null; + data.map = new MapCache(array); + } + } + var map = data.map; + if (map) { + map.set(key, value); + } + return this; +} + +/** + * Removes `key` and its value from the associative array. + * + * @private + * @param {Array} array The array to query. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function assocDelete(array, key) { + var index = assocIndexOf(array, key); + if (index < 0) { + return false; + } + var lastIndex = array.length - 1; + if (index == lastIndex) { + array.pop(); + } else { + splice.call(array, index, 1); + } + return true; +} + +/** + * Gets the associative array value for `key`. + * + * @private + * @param {Array} array The array to query. + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function assocGet(array, key) { + var index = assocIndexOf(array, key); + return index < 0 ? undefined : array[index][1]; +} + +/** + * Checks if an associative array value for `key` exists. + * + * @private + * @param {Array} array The array to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function assocHas(array, key) { + return assocIndexOf(array, key) > -1; +} + +/** + * Gets the index at which the first occurrence of `key` is found in `array` + * of key-value pairs. + * + * @private + * @param {Array} array The array to search. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * Sets the associative array `key` to `value`. + * + * @private + * @param {Array} array The array to modify. + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + */ +function assocSet(array, key, value) { + var index = assocIndexOf(array, key); + if (index < 0) { + array.push([key, value]); + } else { + array[index][1] = value; + } +} + +/** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + object[key] = value; + } +} + +/** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); +} + +/** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @param {boolean} [isFull] Specify a clone including symbols. + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ +function baseClone(value, isDeep, isFull, customizer, key, object, stack) { + var result; + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + if (isHostObject(value)) { + return object ? value : {}; + } + result = initCloneObject(isFunc ? {} : value); + if (!isDeep) { + result = baseAssign(result, value); + return isFull ? copySymbols(value, result) : result; + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + // Recursively populate clone (susceptible to call stack limits). + (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) { + assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); + }); + return (isFull && !isArr) ? copySymbols(value, result) : result; +} + +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} prototype The object to inherit from. + * @returns {Object} Returns the new object. + */ +function baseCreate(proto) { + return isObject(proto) ? objectCreate(proto) : {}; +} + +/** + * The base implementation of `baseForIn` and `baseForOwn` which iterates + * over `object` properties returned by `keysFunc` invoking `iteratee` for + * each property. Iteratee functions may exit iteration early by explicitly + * returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +/** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); +} + +/** + * The base implementation of `_.has` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHas(object, key) { + // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`, + // that are composed entirely of index properties, return `false` for + // `hasOwnProperty` checks of them. + return hasOwnProperty.call(object, key) || + (typeof object == 'object' && key in object && getPrototypeOf(object) === null); +} + +/** + * The base implementation of `_.keys` which doesn't skip the constructor + * property of prototypes or treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + return nativeKeys(Object(object)); +} + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var result = new buffer.constructor(buffer.length); + buffer.copy(result); + return result; +} + +/** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; +} + +/** + * Creates a clone of `map`. + * + * @private + * @param {Object} map The map to clone. + * @returns {Object} Returns the cloned map. + */ +function cloneMap(map) { + return arrayReduce(mapToArray(map), addMapEntry, new map.constructor); +} + +/** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ +function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; +} + +/** + * Creates a clone of `set`. + * + * @private + * @param {Object} set The set to clone. + * @returns {Object} Returns the cloned set. + */ +function cloneSet(set) { + return arrayReduce(setToArray(set), addSetEntry, new set.constructor); +} + +/** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ +function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; +} + +/** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); +} + +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property names to copy. + * @param {Object} [object={}] The object to copy properties to. + * @returns {Object} Returns `object`. + */ +function copyObject(source, props, object) { + return copyObjectWith(source, props, object); +} + +/** + * This function is like `copyObject` except that it accepts a function to + * customize copied values. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property names to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ +function copyObjectWith(source, props, object, customizer) { + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : source[key]; + + assignValue(object, key, newValue); + } + return object; +} + +/** + * Copies own symbol properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ +function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); +} + +/** + * Creates a base function for methods like `_.forIn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +/** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * that affects Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ +var getLength = baseProperty('length'); + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = object[key]; + return isNative(value) ? value : undefined; +} + +/** + * Creates an array of the own symbol properties of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = getOwnPropertySymbols || function() { + return []; +}; + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function getTag(value) { + return objectToString.call(value); +} + +// Fallback for IE 11 providing `toStringTag` values for maps, sets, and weakmaps. +if ((Map && getTag(new Map) != mapTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = objectToString.call(value), + Ctor = result == objectTag ? value.constructor : null, + ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case mapCtorString: return mapTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +/** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ +function initCloneArray(array) { + var length = array.length, + result = array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; +} + +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototypeOf(object)) + : {}; +} + +/** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return cloneMap(object); + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return cloneSet(object); + + case symbolTag: + return cloneSymbol(object); + } +} + +/** + * Creates an array of index keys for `object` values of arrays, + * `arguments` objects, and strings, otherwise `null` is returned. + * + * @private + * @param {Object} object The object to query. + * @returns {Array|null} Returns index keys, else `null`. + */ +function indexKeys(object) { + var length = object ? object.length : undefined; + if (isLength(length) && + (isArray(object) || isString(object) || isArguments(object))) { + return baseTimes(length, String); + } + return null; +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return type == 'number' || type == 'boolean' || + (type == 'string' && value != '__proto__') || value == null; +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'user': 'fred' }; + * var other = { 'user': 'fred' }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @type {Function} + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(getLength(value)) && !isFunction(value); +} + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = !Buffer ? constant(false) : function(value) { + return value instanceof Buffer; +}; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array and weak map constructors, + // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ +function isNative(value) { + if (value == null) { + return false; + } + if (isFunction(value)) { + return reIsNative.test(funcToString.call(value)); + } + return isObjectLike(value) && + (isHostObject(value) ? reIsNative : reIsHostCtor).test(value); +} + +/** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ +function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag); +} + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) + * for more details. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + var isProto = isPrototype(object); + if (!(isProto || isArrayLike(object))) { + return baseKeys(object); + } + var indexes = indexKeys(object), + skipIndexes = !!indexes, + result = indexes || [], + length = result.length; + + for (var key in object) { + if (baseHas(object, key) && + !(skipIndexes && (key == 'length' || isIndex(key, length))) && + !(isProto && key == 'constructor')) { + result.push(key); + } + } + return result; +} + +/** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new function. + * @example + * + * var object = { 'user': 'fred' }; + * var getter = _.constant(object); + * + * getter() === object; + * // => true + */ +function constant(value) { + return function() { + return value; + }; +} + +// Avoid inheriting from `Object.prototype` when possible. +Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto; + +// Add functions to the `MapCache`. +MapCache.prototype.clear = mapClear; +MapCache.prototype['delete'] = mapDelete; +MapCache.prototype.get = mapGet; +MapCache.prototype.has = mapHas; +MapCache.prototype.set = mapSet; + +// Add functions to the `Stack` cache. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +module.exports = baseClone; diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/package.json b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/package.json new file mode 100644 index 00000000000000..64c0ac7a1411d5 --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/package.json @@ -0,0 +1,101 @@ +{ + "_args": [ + [ + "lodash._baseclone@^4.0.0", + "/Users/rebecca/code/npm/node_modules/lodash.clonedeep" + ] + ], + "_from": "lodash._baseclone@>=4.0.0 <5.0.0", + "_id": "lodash._baseclone@4.5.3", + "_inCache": true, + "_installable": true, + "_location": "/lodash.clonedeep/lodash._baseclone", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/lodash._baseclone-4.5.3.tgz_1456902628287_0.513930449495092" + }, + "_npmUser": { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + "_npmVersion": "2.14.17", + "_phantomChildren": {}, + "_requested": { + "name": "lodash._baseclone", + "raw": "lodash._baseclone@^4.0.0", + "rawSpec": "^4.0.0", + "scope": null, + "spec": ">=4.0.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/lodash.clonedeep" + ], + "_resolved": "https://registry.npmjs.org/lodash._baseclone/-/lodash._baseclone-4.5.3.tgz", + "_shasum": "c3f6df594c44c16012f9ecd59e58d5f70d3d72e2", + "_shrinkwrap": null, + "_spec": "lodash._baseclone@^4.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/lodash.clonedeep", + "author": { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "contributors": [ + { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + { + "email": "blaine.bublitz@gmail.com", + "name": "Blaine Bublitz", + "url": "https://github.com/phated" + }, + { + "email": "mathias@qiwi.be", + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": {}, + "description": "The internal lodash function `baseClone` exported as a module.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "c3f6df594c44c16012f9ecd59e58d5f70d3d72e2", + "tarball": "http://registry.npmjs.org/lodash._baseclone/-/lodash._baseclone-4.5.3.tgz" + }, + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "maintainers": [ + { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + { + "email": "mathias@qiwi.be", + "name": "mathias" + }, + { + "email": "blaine@iceddev.com", + "name": "phated" + } + ], + "name": "lodash._baseclone", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.5.3" +} diff --git a/deps/npm/node_modules/lodash.clonedeep/package.json b/deps/npm/node_modules/lodash.clonedeep/package.json new file mode 100644 index 00000000000000..9da20a9494d7fc --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/package.json @@ -0,0 +1,107 @@ +{ + "_args": [ + [ + "lodash.clonedeep@4.3.2", + "/Users/zkat/Documents/code/npm" + ] + ], + "_from": "lodash.clonedeep@4.3.2", + "_id": "lodash.clonedeep@4.3.2", + "_inCache": true, + "_installable": true, + "_location": "/lodash.clonedeep", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/lodash.clonedeep-4.3.2.tgz_1459310662712_0.4621682942379266" + }, + "_npmUser": { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + "_npmVersion": "2.15.1", + "_phantomChildren": {}, + "_requested": { + "name": "lodash.clonedeep", + "raw": "lodash.clonedeep@4.3.2", + "rawSpec": "4.3.2", + "scope": null, + "spec": "4.3.2", + "type": "version" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.3.2.tgz", + "_shasum": "d0112c02c76b5223833aebc6a4b6e334f0d057de", + "_shrinkwrap": null, + "_spec": "lodash.clonedeep@4.3.2", + "_where": "/Users/zkat/Documents/code/npm", + "author": { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "contributors": [ + { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + { + "email": "blaine.bublitz@gmail.com", + "name": "Blaine Bublitz", + "url": "https://github.com/phated" + }, + { + "email": "mathias@qiwi.be", + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": { + "lodash._baseclone": "~4.5.0" + }, + "description": "The lodash method `_.cloneDeep` exported as a module.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "d0112c02c76b5223833aebc6a4b6e334f0d057de", + "tarball": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.3.2.tgz" + }, + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash-modularized", + "clonedeep" + ], + "license": "MIT", + "maintainers": [ + { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + { + "email": "mathias@qiwi.be", + "name": "mathias" + }, + { + "email": "blaine@iceddev.com", + "name": "phated" + } + ], + "name": "lodash.clonedeep", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.3.2" +} diff --git a/deps/npm/node_modules/lodash.isarray/LICENSE b/deps/npm/node_modules/lodash.isarray/LICENSE new file mode 100644 index 00000000000000..b054ca5a3ac7d6 --- /dev/null +++ b/deps/npm/node_modules/lodash.isarray/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/lodash.isarray/README.md b/deps/npm/node_modules/lodash.isarray/README.md new file mode 100644 index 00000000000000..da1580fabe9919 --- /dev/null +++ b/deps/npm/node_modules/lodash.isarray/README.md @@ -0,0 +1,18 @@ +# lodash.isarray v4.0.0 + +The [lodash](https://lodash.com/) method `_.isArray` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.isarray +``` + +In Node.js: +```js +var isArray = require('lodash.isarray'); +``` + +See the [documentation](https://lodash.com/docs#isArray) or [package source](https://github.com/lodash/lodash/blob/4.0.0-npm-packages/lodash.isarray) for more details. diff --git a/deps/npm/node_modules/lodash.isarray/index.js b/deps/npm/node_modules/lodash.isarray/index.js new file mode 100644 index 00000000000000..105fd4249e782f --- /dev/null +++ b/deps/npm/node_modules/lodash.isarray/index.js @@ -0,0 +1,35 @@ +/** + * lodash 4.0.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @type Function + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +module.exports = isArray; diff --git a/deps/npm/node_modules/lodash.isarray/package.json b/deps/npm/node_modules/lodash.isarray/package.json new file mode 100644 index 00000000000000..606f67a82fcd5a --- /dev/null +++ b/deps/npm/node_modules/lodash.isarray/package.json @@ -0,0 +1,104 @@ +{ + "_args": [ + [ + "lodash.isarray@latest", + "/Users/rebecca/code/npm" + ] + ], + "_from": "lodash.isarray@latest", + "_id": "lodash.isarray@4.0.0", + "_inCache": true, + "_installable": true, + "_location": "/lodash.isarray", + "_nodeVersion": "5.4.0", + "_npmUser": { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + "_npmVersion": "2.14.15", + "_phantomChildren": {}, + "_requested": { + "name": "lodash.isarray", + "raw": "lodash.isarray@latest", + "rawSpec": "latest", + "scope": null, + "spec": "latest", + "type": "tag" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-4.0.0.tgz", + "_shasum": "2aca496b28c4ca6d726715313590c02e6ea34403", + "_shrinkwrap": null, + "_spec": "lodash.isarray@latest", + "_where": "/Users/rebecca/code/npm", + "author": { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "https://github.com/phated" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": {}, + "description": "The lodash method `_.isArray` exported as a module.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "2aca496b28c4ca6d726715313590c02e6ea34403", + "tarball": "http://registry.npmjs.org/lodash.isarray/-/lodash.isarray-4.0.0.tgz" + }, + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "isarray", + "lodash", + "lodash-modularized", + "stdlib", + "util" + ], + "license": "MIT", + "maintainers": [ + { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + { + "name": "phated", + "email": "blaine@iceddev.com" + } + ], + "name": "lodash.isarray", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.0.0" +} diff --git a/deps/npm/node_modules/lodash.keys/LICENSE b/deps/npm/node_modules/lodash.keys/LICENSE new file mode 100644 index 00000000000000..bcbe13d67a9621 --- /dev/null +++ b/deps/npm/node_modules/lodash.keys/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/lodash.keys/README.md b/deps/npm/node_modules/lodash.keys/README.md new file mode 100644 index 00000000000000..0ea25ba6b217ad --- /dev/null +++ b/deps/npm/node_modules/lodash.keys/README.md @@ -0,0 +1,18 @@ +# lodash.keys v4.0.5 + +The [lodash](https://lodash.com/) method `_.keys` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.keys +``` + +In Node.js: +```js +var keys = require('lodash.keys'); +``` + +See the [documentation](https://lodash.com/docs#keys) or [package source](https://github.com/lodash/lodash/blob/4.0.5-npm-packages/lodash.keys) for more details. diff --git a/deps/npm/node_modules/lodash.keys/index.js b/deps/npm/node_modules/lodash.keys/index.js new file mode 100644 index 00000000000000..81b3627ed50a3f --- /dev/null +++ b/deps/npm/node_modules/lodash.keys/index.js @@ -0,0 +1,436 @@ +/** + * lodash 4.0.5 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + stringTag = '[object String]'; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; + length = length == null ? MAX_SAFE_INTEGER : length; + return value > -1 && value % 1 == 0 && value < length; +} + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Built-in value references. */ +var getPrototypeOf = Object.getPrototypeOf, + propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = Object.keys; + +/** + * The base implementation of `_.has` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHas(object, key) { + // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`, + // that are composed entirely of index properties, return `false` for + // `hasOwnProperty` checks of them. + return hasOwnProperty.call(object, key) || + (typeof object == 'object' && key in object && getPrototypeOf(object) === null); +} + +/** + * The base implementation of `_.keys` which doesn't skip the constructor + * property of prototypes or treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + return nativeKeys(Object(object)); +} + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * that affects Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ +var getLength = baseProperty('length'); + +/** + * Creates an array of index keys for `object` values of arrays, + * `arguments` objects, and strings, otherwise `null` is returned. + * + * @private + * @param {Object} object The object to query. + * @returns {Array|null} Returns index keys, else `null`. + */ +function indexKeys(object) { + var length = object ? object.length : undefined; + if (isLength(length) && + (isArray(object) || isString(object) || isArguments(object))) { + return baseTimes(length, String); + } + return null; +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @type {Function} + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(getLength(value)) && !isFunction(value); +} + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array and weak map constructors, + // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ +function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag); +} + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) + * for more details. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + var isProto = isPrototype(object); + if (!(isProto || isArrayLike(object))) { + return baseKeys(object); + } + var indexes = indexKeys(object), + skipIndexes = !!indexes, + result = indexes || [], + length = result.length; + + for (var key in object) { + if (baseHas(object, key) && + !(skipIndexes && (key == 'length' || isIndex(key, length))) && + !(isProto && key == 'constructor')) { + result.push(key); + } + } + return result; +} + +module.exports = keys; diff --git a/deps/npm/node_modules/lodash.keys/package.json b/deps/npm/node_modules/lodash.keys/package.json new file mode 100644 index 00000000000000..a11b70f00e7128 --- /dev/null +++ b/deps/npm/node_modules/lodash.keys/package.json @@ -0,0 +1,105 @@ +{ + "_args": [ + [ + "lodash.keys@~4.0.4", + "/Users/rebecca/code/npm" + ] + ], + "_from": "lodash.keys@>=4.0.4 <4.1.0", + "_id": "lodash.keys@4.0.5", + "_inCache": true, + "_installable": true, + "_location": "/lodash.keys", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-13-west.internal.npmjs.com", + "tmp": "tmp/lodash.keys-4.0.5.tgz_1456896665060_0.7360312680248171" + }, + "_npmUser": { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + "_npmVersion": "2.14.17", + "_phantomChildren": {}, + "_requested": { + "name": "lodash.keys", + "raw": "lodash.keys@~4.0.4", + "rawSpec": "~4.0.4", + "scope": null, + "spec": ">=4.0.4 <4.1.0", + "type": "range" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-4.0.5.tgz", + "_shasum": "e8839257ec931ec48d8cfd2f0d7e4b53a1df106c", + "_shrinkwrap": null, + "_spec": "lodash.keys@~4.0.4", + "_where": "/Users/rebecca/code/npm", + "author": { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "contributors": [ + { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + { + "email": "blaine.bublitz@gmail.com", + "name": "Blaine Bublitz", + "url": "https://github.com/phated" + }, + { + "email": "mathias@qiwi.be", + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": {}, + "description": "The lodash method `_.keys` exported as a module.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "e8839257ec931ec48d8cfd2f0d7e4b53a1df106c", + "tarball": "http://registry.npmjs.org/lodash.keys/-/lodash.keys-4.0.5.tgz" + }, + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash-modularized", + "keys" + ], + "license": "MIT", + "maintainers": [ + { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + { + "email": "mathias@qiwi.be", + "name": "mathias" + }, + { + "email": "blaine@iceddev.com", + "name": "phated" + } + ], + "name": "lodash.keys", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.0.5" +} diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/LICENSE.txt b/deps/npm/node_modules/lodash.restparam/LICENSE.txt similarity index 100% rename from tools/eslint/node_modules/inquirer/node_modules/lodash/LICENSE.txt rename to deps/npm/node_modules/lodash.restparam/LICENSE.txt diff --git a/deps/npm/node_modules/lodash.restparam/README.md b/deps/npm/node_modules/lodash.restparam/README.md new file mode 100644 index 00000000000000..80e47a4f9b2093 --- /dev/null +++ b/deps/npm/node_modules/lodash.restparam/README.md @@ -0,0 +1,20 @@ +# lodash.restparam v3.6.1 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.restParam` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.restparam +``` + +In Node.js/io.js: + +```js +var restParam = require('lodash.restparam'); +``` + +See the [documentation](https://lodash.com/docs#restParam) or [package source](https://github.com/lodash/lodash/blob/3.6.1-npm-packages/lodash.restparam) for more details. diff --git a/deps/npm/node_modules/lodash.restparam/index.js b/deps/npm/node_modules/lodash.restparam/index.js new file mode 100644 index 00000000000000..932f47ac743461 --- /dev/null +++ b/deps/npm/node_modules/lodash.restparam/index.js @@ -0,0 +1,67 @@ +/** + * lodash 3.6.1 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/* Native method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as an array. + * + * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters). + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.restParam(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); + * + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' + */ +function restParam(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + rest = Array(length); + + while (++index < length) { + rest[index] = args[start + index]; + } + switch (start) { + case 0: return func.call(this, rest); + case 1: return func.call(this, args[0], rest); + case 2: return func.call(this, args[0], args[1], rest); + } + var otherArgs = Array(start + 1); + index = -1; + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = rest; + return func.apply(this, otherArgs); + }; +} + +module.exports = restParam; diff --git a/deps/npm/node_modules/lodash.restparam/package.json b/deps/npm/node_modules/lodash.restparam/package.json new file mode 100644 index 00000000000000..f3a9247f460609 --- /dev/null +++ b/deps/npm/node_modules/lodash.restparam/package.json @@ -0,0 +1,62 @@ +{ + "name": "lodash.restparam", + "version": "3.6.1", + "description": "The modern build of lodash’s `_.restParam` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": [ + "lodash", + "lodash-modularized", + "stdlib", + "util" + ], + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "readme": "# lodash.restparam v3.6.1\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.restParam` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash.restparam\n```\n\nIn Node.js/io.js:\n\n```js\nvar restParam = require('lodash.restparam');\n```\n\nSee the [documentation](https://lodash.com/docs#restParam) or [package source](https://github.com/lodash/lodash/blob/3.6.1-npm-packages/lodash.restparam) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash.restparam@3.6.1", + "_shasum": "936a4e309ef330a7645ed4145986c85ae5b20805", + "_resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", + "_from": "lodash.restparam@3.6.1" +} diff --git a/deps/npm/node_modules/lodash.union/LICENSE b/deps/npm/node_modules/lodash.union/LICENSE new file mode 100644 index 00000000000000..bcbe13d67a9621 --- /dev/null +++ b/deps/npm/node_modules/lodash.union/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/lodash.union/README.md b/deps/npm/node_modules/lodash.union/README.md new file mode 100644 index 00000000000000..51b5100b9a6352 --- /dev/null +++ b/deps/npm/node_modules/lodash.union/README.md @@ -0,0 +1,18 @@ +# lodash.union v4.2.1 + +The [lodash](https://lodash.com/) method `_.union` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.union +``` + +In Node.js: +```js +var union = require('lodash.union'); +``` + +See the [documentation](https://lodash.com/docs#union) or [package source](https://github.com/lodash/lodash/blob/4.2.1-npm-packages/lodash.union) for more details. diff --git a/deps/npm/node_modules/lodash.union/index.js b/deps/npm/node_modules/lodash.union/index.js new file mode 100644 index 00000000000000..158c0d75c04d41 --- /dev/null +++ b/deps/npm/node_modules/lodash.union/index.js @@ -0,0 +1,32 @@ +/** + * lodash 4.2.1 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var baseFlatten = require('lodash._baseflatten'), + baseUniq = require('lodash._baseuniq'), + rest = require('lodash.rest'); + +/** + * Creates an array of unique values, in order, from all given arrays using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.union([2, 1], [4, 2], [1, 2]); + * // => [2, 1, 4] + */ +var union = rest(function(arrays) { + return baseUniq(baseFlatten(arrays, 1, true)); +}); + +module.exports = union; diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/LICENSE b/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/LICENSE new file mode 100644 index 00000000000000..bcbe13d67a9621 --- /dev/null +++ b/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/README.md b/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/README.md new file mode 100644 index 00000000000000..4250ad4af77c0e --- /dev/null +++ b/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/README.md @@ -0,0 +1,18 @@ +# lodash._baseflatten v4.1.1 + +The internal [lodash](https://lodash.com/) function `baseFlatten` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._baseflatten +``` + +In Node.js: +```js +var baseFlatten = require('lodash._baseflatten'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/4.1.1-npm-packages/lodash._baseflatten) for more details. diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/index.js b/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/index.js new file mode 100644 index 00000000000000..cf05fe5f1a59a6 --- /dev/null +++ b/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/index.js @@ -0,0 +1,320 @@ +/** + * lodash 4.1.1 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [isStrict] Restrict flattening to arrays-like objects. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ +function baseFlatten(array, depth, isStrict, result) { + result || (result = []); + + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index]; + if (depth > 0 && isArrayLikeObject(value) && + (isStrict || isArray(value) || isArguments(value))) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; +} + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * that affects Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ +var getLength = baseProperty('length'); + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @type {Function} + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(getLength(value)) && !isFunction(value); +} + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array and weak map constructors, + // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +module.exports = baseFlatten; diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/package.json b/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/package.json new file mode 100644 index 00000000000000..8b2e4529bf0a75 --- /dev/null +++ b/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/package.json @@ -0,0 +1,101 @@ +{ + "_args": [ + [ + "lodash._baseflatten@~4.1.0", + "/Users/zkat/Documents/code/npm/node_modules/lodash.union" + ] + ], + "_from": "lodash._baseflatten@>=4.1.0 <4.2.0", + "_id": "lodash._baseflatten@4.1.1", + "_inCache": true, + "_installable": true, + "_location": "/lodash.union/lodash._baseflatten", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-13-west.internal.npmjs.com", + "tmp": "tmp/lodash._baseflatten-4.1.1.tgz_1456896418067_0.31963246082887053" + }, + "_npmUser": { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + "_npmVersion": "2.14.17", + "_phantomChildren": {}, + "_requested": { + "name": "lodash._baseflatten", + "raw": "lodash._baseflatten@~4.1.0", + "rawSpec": "~4.1.0", + "scope": null, + "spec": ">=4.1.0 <4.2.0", + "type": "range" + }, + "_requiredBy": [ + "/lodash.union" + ], + "_resolved": "https://registry.npmjs.org/lodash._baseflatten/-/lodash._baseflatten-4.1.1.tgz", + "_shasum": "5c87403b88f3687a88d26424faadf3aa054aab0d", + "_shrinkwrap": null, + "_spec": "lodash._baseflatten@~4.1.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/lodash.union", + "author": { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "contributors": [ + { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + { + "email": "blaine.bublitz@gmail.com", + "name": "Blaine Bublitz", + "url": "https://github.com/phated" + }, + { + "email": "mathias@qiwi.be", + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": {}, + "description": "The internal lodash function `baseFlatten` exported as a module.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "5c87403b88f3687a88d26424faadf3aa054aab0d", + "tarball": "http://registry.npmjs.org/lodash._baseflatten/-/lodash._baseflatten-4.1.1.tgz" + }, + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "maintainers": [ + { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + { + "email": "mathias@qiwi.be", + "name": "mathias" + }, + { + "email": "blaine@iceddev.com", + "name": "phated" + } + ], + "name": "lodash._baseflatten", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.1.1" +} diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/LICENSE b/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/LICENSE new file mode 100644 index 00000000000000..b054ca5a3ac7d6 --- /dev/null +++ b/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/README.md b/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/README.md new file mode 100644 index 00000000000000..8924e9d7f4d93e --- /dev/null +++ b/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/README.md @@ -0,0 +1,18 @@ +# lodash.rest v4.0.1 + +The [lodash](https://lodash.com/) method `_.rest` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.rest +``` + +In Node.js: +```js +var rest = require('lodash.rest'); +``` + +See the [documentation](https://lodash.com/docs#rest) or [package source](https://github.com/lodash/lodash/blob/4.0.1-npm-packages/lodash.rest) for more details. diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/index.js b/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/index.js new file mode 100644 index 00000000000000..289de317230756 --- /dev/null +++ b/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/index.js @@ -0,0 +1,247 @@ +/** + * lodash 4.0.1 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + +/** `Object#toString` result references. */ +var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + var length = args.length; + switch (length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as an array. + * + * **Note:** This method is based on the [rest parameter](https://mdn.io/rest_parameters). + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.rest(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); + * + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' + */ +function rest(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + switch (start) { + case 0: return func.call(this, array); + case 1: return func.call(this, args[0], array); + case 2: return func.call(this, args[0], args[1], array); + } + var otherArgs = Array(start + 1); + index = -1; + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = array; + return apply(func, this, otherArgs); + }; +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array constructors, and + // PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Converts `value` to an integer. + * + * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3'); + * // => 3 + */ +function toInteger(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + var remainder = value % 1; + return value === value ? (remainder ? value - remainder : value) : 0; +} + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3); + * // => 3 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3'); + * // => 3 + */ +function toNumber(value) { + if (isObject(value)) { + var other = isFunction(value.valueOf) ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +module.exports = rest; diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/package.json b/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/package.json new file mode 100644 index 00000000000000..cced8dbac078ee --- /dev/null +++ b/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/package.json @@ -0,0 +1,105 @@ +{ + "_args": [ + [ + "lodash.rest@^4.0.0", + "/Users/rebecca/code/npm/node_modules/lodash.union" + ] + ], + "_from": "lodash.rest@>=4.0.0 <5.0.0", + "_id": "lodash.rest@4.0.1", + "_inCache": true, + "_installable": true, + "_location": "/lodash.union/lodash.rest", + "_nodeVersion": "5.4.0", + "_npmOperationalInternal": { + "host": "packages-5-east.internal.npmjs.com", + "tmp": "tmp/lodash.rest-4.0.1.tgz_1454484670768_0.6682933256961405" + }, + "_npmUser": { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + "_npmVersion": "2.14.15", + "_phantomChildren": {}, + "_requested": { + "name": "lodash.rest", + "raw": "lodash.rest@^4.0.0", + "rawSpec": "^4.0.0", + "scope": null, + "spec": ">=4.0.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/lodash.union" + ], + "_resolved": "https://registry.npmjs.org/lodash.rest/-/lodash.rest-4.0.1.tgz", + "_shasum": "cbecbb84e68e499a1b242baf9b27bb63ef4dd980", + "_shrinkwrap": null, + "_spec": "lodash.rest@^4.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/lodash.union", + "author": { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "https://github.com/phated" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": {}, + "description": "The lodash method `_.rest` exported as a module.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "cbecbb84e68e499a1b242baf9b27bb63ef4dd980", + "tarball": "http://registry.npmjs.org/lodash.rest/-/lodash.rest-4.0.1.tgz" + }, + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash-modularized", + "rest" + ], + "license": "MIT", + "maintainers": [ + { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + { + "name": "phated", + "email": "blaine@iceddev.com" + } + ], + "name": "lodash.rest", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.0.1" +} diff --git a/deps/npm/node_modules/lodash.union/package.json b/deps/npm/node_modules/lodash.union/package.json new file mode 100644 index 00000000000000..d00522437f94d2 --- /dev/null +++ b/deps/npm/node_modules/lodash.union/package.json @@ -0,0 +1,109 @@ +{ + "_args": [ + [ + "lodash.union@4.2.1", + "/Users/zkat/Documents/code/npm" + ] + ], + "_from": "lodash.union@4.2.1", + "_id": "lodash.union@4.2.1", + "_inCache": true, + "_installable": true, + "_location": "/lodash.union", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/lodash.union-4.2.1.tgz_1459310986493_0.07747984793968499" + }, + "_npmUser": { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + "_npmVersion": "2.15.1", + "_phantomChildren": {}, + "_requested": { + "name": "lodash.union", + "raw": "lodash.union@4.2.1", + "rawSpec": "4.2.1", + "scope": null, + "spec": "4.2.1", + "type": "version" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.2.1.tgz", + "_shasum": "6871017b9b1ff71952c1e2bb2e25b1046a7e2842", + "_shrinkwrap": null, + "_spec": "lodash.union@4.2.1", + "_where": "/Users/zkat/Documents/code/npm", + "author": { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "contributors": [ + { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + { + "email": "blaine.bublitz@gmail.com", + "name": "Blaine Bublitz", + "url": "https://github.com/phated" + }, + { + "email": "mathias@qiwi.be", + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": { + "lodash._baseflatten": "~4.1.0", + "lodash._baseuniq": "~4.5.0", + "lodash.rest": "^4.0.0" + }, + "description": "The lodash method `_.union` exported as a module.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "6871017b9b1ff71952c1e2bb2e25b1046a7e2842", + "tarball": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.2.1.tgz" + }, + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash-modularized", + "union" + ], + "license": "MIT", + "maintainers": [ + { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + { + "email": "mathias@qiwi.be", + "name": "mathias" + }, + { + "email": "blaine@iceddev.com", + "name": "phated" + } + ], + "name": "lodash.union", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.2.1" +} diff --git a/deps/npm/node_modules/lodash.uniq/LICENSE b/deps/npm/node_modules/lodash.uniq/LICENSE new file mode 100644 index 00000000000000..bcbe13d67a9621 --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/lodash.uniq/README.md b/deps/npm/node_modules/lodash.uniq/README.md new file mode 100644 index 00000000000000..31e7c591ea3cb9 --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/README.md @@ -0,0 +1,18 @@ +# lodash.uniq v4.2.1 + +The [lodash](https://lodash.com/) method `_.uniq` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.uniq +``` + +In Node.js: +```js +var uniq = require('lodash.uniq'); +``` + +See the [documentation](https://lodash.com/docs#uniq) or [package source](https://github.com/lodash/lodash/blob/4.2.1-npm-packages/lodash.uniq) for more details. diff --git a/deps/npm/node_modules/lodash.uniq/index.js b/deps/npm/node_modules/lodash.uniq/index.js new file mode 100644 index 00000000000000..567c6ece6a4d25 --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/index.js @@ -0,0 +1,33 @@ +/** + * lodash 4.2.1 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var baseUniq = require('lodash._baseuniq'); + +/** + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons, in which only the first occurrence of each element + * is kept. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniq([2, 1, 2]); + * // => [2, 1] + */ +function uniq(array) { + return (array && array.length) + ? baseUniq(array) + : []; +} + +module.exports = uniq; diff --git a/deps/npm/node_modules/lodash.uniq/package.json b/deps/npm/node_modules/lodash.uniq/package.json new file mode 100644 index 00000000000000..2823bb8d2c9e17 --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/package.json @@ -0,0 +1,107 @@ +{ + "_args": [ + [ + "lodash.uniq@4.2.1", + "/Users/zkat/Documents/code/npm" + ] + ], + "_from": "lodash.uniq@4.2.1", + "_id": "lodash.uniq@4.2.1", + "_inCache": true, + "_installable": true, + "_location": "/lodash.uniq", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/lodash.uniq-4.2.1.tgz_1459310991318_0.029993396950885653" + }, + "_npmUser": { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + "_npmVersion": "2.15.1", + "_phantomChildren": {}, + "_requested": { + "name": "lodash.uniq", + "raw": "lodash.uniq@4.2.1", + "rawSpec": "4.2.1", + "scope": null, + "spec": "4.2.1", + "type": "version" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.2.1.tgz", + "_shasum": "4210d4b90647ee24211b469aed0ef84902069743", + "_shrinkwrap": null, + "_spec": "lodash.uniq@4.2.1", + "_where": "/Users/zkat/Documents/code/npm", + "author": { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "contributors": [ + { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + { + "email": "blaine.bublitz@gmail.com", + "name": "Blaine Bublitz", + "url": "https://github.com/phated" + }, + { + "email": "mathias@qiwi.be", + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": { + "lodash._baseuniq": "~4.5.0" + }, + "description": "The lodash method `_.uniq` exported as a module.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "4210d4b90647ee24211b469aed0ef84902069743", + "tarball": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.2.1.tgz" + }, + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash-modularized", + "uniq" + ], + "license": "MIT", + "maintainers": [ + { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + { + "email": "mathias@qiwi.be", + "name": "mathias" + }, + { + "email": "blaine@iceddev.com", + "name": "phated" + } + ], + "name": "lodash.uniq", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.2.1" +} diff --git a/deps/npm/node_modules/lodash.without/LICENSE b/deps/npm/node_modules/lodash.without/LICENSE new file mode 100644 index 00000000000000..bcbe13d67a9621 --- /dev/null +++ b/deps/npm/node_modules/lodash.without/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/lodash.without/README.md b/deps/npm/node_modules/lodash.without/README.md new file mode 100644 index 00000000000000..3299e4c531993b --- /dev/null +++ b/deps/npm/node_modules/lodash.without/README.md @@ -0,0 +1,18 @@ +# lodash.without v4.1.2 + +The [lodash](https://lodash.com/) method `_.without` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.without +``` + +In Node.js: +```js +var without = require('lodash.without'); +``` + +See the [documentation](https://lodash.com/docs#without) or [package source](https://github.com/lodash/lodash/blob/4.1.2-npm-packages/lodash.without) for more details. diff --git a/deps/npm/node_modules/lodash.without/index.js b/deps/npm/node_modules/lodash.without/index.js new file mode 100644 index 00000000000000..f9ed54a01cebf9 --- /dev/null +++ b/deps/npm/node_modules/lodash.without/index.js @@ -0,0 +1,238 @@ +/** + * lodash 4.1.2 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var baseDifference = require('lodash._basedifference'), + rest = require('lodash.rest'); + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * that affects Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ +var getLength = baseProperty('length'); + +/** + * Creates an array excluding all given values using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to filter. + * @param {...*} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.without([1, 2, 1, 3], 1, 2); + * // => [3] + */ +var without = rest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, values) + : []; +}); + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(getLength(value)) && !isFunction(value); +} + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array and weak map constructors, + // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +module.exports = without; diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/LICENSE b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/LICENSE new file mode 100644 index 00000000000000..bcbe13d67a9621 --- /dev/null +++ b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/README.md b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/README.md new file mode 100644 index 00000000000000..0ff2f166076c3b --- /dev/null +++ b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/README.md @@ -0,0 +1,18 @@ +# lodash._basedifference v4.4.1 + +The internal [lodash](https://lodash.com/) function `baseDifference` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._basedifference +``` + +In Node.js: +```js +var baseDifference = require('lodash._basedifference'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/4.4.1-npm-packages/lodash._basedifference) for more details. diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/index.js b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/index.js new file mode 100644 index 00000000000000..5fa779dfdd4391 --- /dev/null +++ b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/index.js @@ -0,0 +1,217 @@ +/** + * lodash 4.4.1 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var SetCache = require('lodash._setcache'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} array The array to search. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludes(array, value) { + return !!array.length && baseIndexOf(array, value, 0) > -1; +} + +/** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to search. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; +} + +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} + +/** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + if (value !== value) { + return indexOfNaN(array, fromIndex); + } + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.unary` without support for storing wrapper metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +/** + * Gets the index at which the first occurrence of `NaN` is found in `array`. + * + * @private + * @param {Array} array The array to search. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched `NaN`, else `-1`. + */ +function indexOfNaN(array, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 0 : -1); + + while ((fromRight ? index-- : ++index < length)) { + var other = array[index]; + if (other !== other) { + return index; + } + } + return -1; +} + +/** + * Checks if `value` is in `cache`. + * + * @private + * @param {Object} cache The set cache to search. + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function cacheHas(cache, value) { + var map = cache.__data__; + if (isKeyable(value)) { + var data = map.__data__, + hash = typeof value == 'string' ? data.string : data.hash; + + return hash[value] === HASH_UNDEFINED; + } + return map.has(value); +} + +/** + * The base implementation of methods like `_.difference` without support for + * excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ +function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return type == 'number' || type == 'boolean' || + (type == 'string' && value != '__proto__') || value == null; +} + +module.exports = baseDifference; diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._setcache/LICENSE b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._setcache/LICENSE new file mode 100644 index 00000000000000..bcbe13d67a9621 --- /dev/null +++ b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._setcache/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._setcache/README.md b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._setcache/README.md new file mode 100644 index 00000000000000..696e7cd135725c --- /dev/null +++ b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._setcache/README.md @@ -0,0 +1,18 @@ +# lodash._setcache v4.1.1 + +The internal [lodash](https://lodash.com/) function `SetCache` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._setcache +``` + +In Node.js: +```js +var SetCache = require('lodash._setcache'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/4.1.1-npm-packages/lodash._setcache) for more details. diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._setcache/index.js b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._setcache/index.js new file mode 100644 index 00000000000000..dd96de49f1fa96 --- /dev/null +++ b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._setcache/index.js @@ -0,0 +1,588 @@ +/** + * lodash 4.1.1 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** `Object#toString` result references. */ +var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; + +/** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari > 5). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to determine if values are of the language type `Object`. */ +var objectTypes = { + 'function': true, + 'object': true +}; + +/** Detect free variable `exports`. */ +var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) + ? exports + : undefined; + +/** Detect free variable `module`. */ +var freeModule = (objectTypes[typeof module] && module && !module.nodeType) + ? module + : undefined; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); + +/** Detect free variable `self`. */ +var freeSelf = checkGlobal(objectTypes[typeof self] && self); + +/** Detect free variable `window`. */ +var freeWindow = checkGlobal(objectTypes[typeof window] && window); + +/** Detect `this` as the global object. */ +var thisGlobal = checkGlobal(objectTypes[typeof this] && this); + +/** + * Used as a reference to the global object. + * + * The `this` value is used if it's the global object to avoid Greasemonkey's + * restricted `window` object, otherwise the `window` object is used. + */ +var root = freeGlobal || + ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || + freeSelf || thisGlobal || Function('return this')(); + +/** + * Checks if `value` is a global object. + * + * @private + * @param {*} value The value to check. + * @returns {null|Object} Returns `value` if it's a global object, else `null`. + */ +function checkGlobal(value) { + return (value && value.Object === Object) ? value : null; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = Function.prototype.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'), + nativeCreate = getNative(Object, 'create'); + +/** + * Creates an hash object. + * + * @private + * @constructor + * @returns {Object} Returns the new hash object. + */ +function Hash() {} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(hash, key) { + return hashHas(hash, key) && delete hash[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @param {Object} hash The hash to query. + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(hash, key) { + if (nativeCreate) { + var result = hash[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(hash, key) ? hash[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @param {Object} hash The hash to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(hash, key) { + return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + */ +function hashSet(hash, key, value) { + hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; +} + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function MapCache(values) { + var index = -1, + length = values ? values.length : 0; + + this.clear(); + while (++index < length) { + var entry = values[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapClear() { + this.__data__ = { + 'hash': new Hash, + 'map': Map ? new Map : [], + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapDelete(key) { + var data = this.__data__; + if (isKeyable(key)) { + return hashDelete(typeof key == 'string' ? data.string : data.hash, key); + } + return Map ? data.map['delete'](key) : assocDelete(data.map, key); +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapGet(key) { + var data = this.__data__; + if (isKeyable(key)) { + return hashGet(typeof key == 'string' ? data.string : data.hash, key); + } + return Map ? data.map.get(key) : assocGet(data.map, key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapHas(key) { + var data = this.__data__; + if (isKeyable(key)) { + return hashHas(typeof key == 'string' ? data.string : data.hash, key); + } + return Map ? data.map.has(key) : assocHas(data.map, key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache object. + */ +function mapSet(key, value) { + var data = this.__data__; + if (isKeyable(key)) { + hashSet(typeof key == 'string' ? data.string : data.hash, key, value); + } else if (Map) { + data.map.set(key, value); + } else { + assocSet(data.map, key, value); + } + return this; +} + +/** + * + * Creates a set cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values ? values.length : 0; + + this.__data__ = new MapCache; + while (++index < length) { + this.push(values[index]); + } +} + +/** + * Adds `value` to the set cache. + * + * @private + * @name push + * @memberOf SetCache + * @param {*} value The value to cache. + */ +function cachePush(value) { + var map = this.__data__; + if (isKeyable(value)) { + var data = map.__data__, + hash = typeof value == 'string' ? data.string : data.hash; + + hash[value] = HASH_UNDEFINED; + } + else { + map.set(value, HASH_UNDEFINED); + } +} + +/** + * Removes `key` and its value from the associative array. + * + * @private + * @param {Array} array The array to query. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function assocDelete(array, key) { + var index = assocIndexOf(array, key); + if (index < 0) { + return false; + } + var lastIndex = array.length - 1; + if (index == lastIndex) { + array.pop(); + } else { + splice.call(array, index, 1); + } + return true; +} + +/** + * Gets the associative array value for `key`. + * + * @private + * @param {Array} array The array to query. + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function assocGet(array, key) { + var index = assocIndexOf(array, key); + return index < 0 ? undefined : array[index][1]; +} + +/** + * Checks if an associative array value for `key` exists. + * + * @private + * @param {Array} array The array to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function assocHas(array, key) { + return assocIndexOf(array, key) > -1; +} + +/** + * Gets the index at which the first occurrence of `key` is found in `array` + * of key-value pairs. + * + * @private + * @param {Array} array The array to search. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * Sets the associative array `key` to `value`. + * + * @private + * @param {Array} array The array to modify. + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + */ +function assocSet(array, key, value) { + var index = assocIndexOf(array, key); + if (index < 0) { + array.push([key, value]); + } else { + array[index][1] = value; + } +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = object[key]; + return isNative(value) ? value : undefined; +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return type == 'number' || type == 'boolean' || + (type == 'string' && value != '__proto__') || value == null; +} + +/** + * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'user': 'fred' }; + * var other = { 'user': 'fred' }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array and weak map constructors, + // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ +function isNative(value) { + if (value == null) { + return false; + } + if (isFunction(value)) { + return reIsNative.test(funcToString.call(value)); + } + return isObjectLike(value) && + (isHostObject(value) ? reIsNative : reIsHostCtor).test(value); +} + +// Avoid inheriting from `Object.prototype` when possible. +Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto; + +// Add functions to the `MapCache`. +MapCache.prototype.clear = mapClear; +MapCache.prototype['delete'] = mapDelete; +MapCache.prototype.get = mapGet; +MapCache.prototype.has = mapHas; +MapCache.prototype.set = mapSet; + +// Add functions to the `SetCache`. +SetCache.prototype.push = cachePush; + +module.exports = SetCache; diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._setcache/package.json b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._setcache/package.json new file mode 100644 index 00000000000000..217a0b8d9b1d37 --- /dev/null +++ b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._setcache/package.json @@ -0,0 +1,101 @@ +{ + "_args": [ + [ + "lodash._setcache@^4.0.0", + "/Users/rebecca/code/npm/node_modules/lodash.without/node_modules/lodash._basedifference" + ] + ], + "_from": "lodash._setcache@>=4.0.0 <5.0.0", + "_id": "lodash._setcache@4.1.1", + "_inCache": true, + "_installable": true, + "_location": "/lodash.without/lodash._basedifference/lodash._setcache", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/lodash._setcache-4.1.1.tgz_1456896443505_0.39592266851104796" + }, + "_npmUser": { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + "_npmVersion": "2.14.17", + "_phantomChildren": {}, + "_requested": { + "name": "lodash._setcache", + "raw": "lodash._setcache@^4.0.0", + "rawSpec": "^4.0.0", + "scope": null, + "spec": ">=4.0.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/lodash.without/lodash._basedifference" + ], + "_resolved": "https://registry.npmjs.org/lodash._setcache/-/lodash._setcache-4.1.1.tgz", + "_shasum": "338f47e49f21ba8bb89e621e7815d781bd4dbd97", + "_shrinkwrap": null, + "_spec": "lodash._setcache@^4.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/lodash.without/node_modules/lodash._basedifference", + "author": { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "contributors": [ + { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + { + "email": "blaine.bublitz@gmail.com", + "name": "Blaine Bublitz", + "url": "https://github.com/phated" + }, + { + "email": "mathias@qiwi.be", + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": {}, + "description": "The internal lodash function `SetCache` exported as a module.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "338f47e49f21ba8bb89e621e7815d781bd4dbd97", + "tarball": "http://registry.npmjs.org/lodash._setcache/-/lodash._setcache-4.1.1.tgz" + }, + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "maintainers": [ + { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + { + "email": "mathias@qiwi.be", + "name": "mathias" + }, + { + "email": "blaine.bublitz@gmail.com", + "name": "phated" + } + ], + "name": "lodash._setcache", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.1.1" +} diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/package.json b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/package.json new file mode 100644 index 00000000000000..5442d0abf9a3c4 --- /dev/null +++ b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/package.json @@ -0,0 +1,103 @@ +{ + "_args": [ + [ + "lodash._basedifference@~4.4.0", + "/Users/zkat/Documents/code/npm/node_modules/lodash.without" + ] + ], + "_from": "lodash._basedifference@>=4.4.0 <4.5.0", + "_id": "lodash._basedifference@4.4.1", + "_inCache": true, + "_installable": true, + "_location": "/lodash.without/lodash._basedifference", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/lodash._basedifference-4.4.1.tgz_1459310599651_0.6456912821158767" + }, + "_npmUser": { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + "_npmVersion": "2.15.1", + "_phantomChildren": {}, + "_requested": { + "name": "lodash._basedifference", + "raw": "lodash._basedifference@~4.4.0", + "rawSpec": "~4.4.0", + "scope": null, + "spec": ">=4.4.0 <4.5.0", + "type": "range" + }, + "_requiredBy": [ + "/lodash.without" + ], + "_resolved": "https://registry.npmjs.org/lodash._basedifference/-/lodash._basedifference-4.4.1.tgz", + "_shasum": "537bde6fd0f3eeec28e37288dd51459765181b4d", + "_shrinkwrap": null, + "_spec": "lodash._basedifference@~4.4.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/lodash.without", + "author": { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "contributors": [ + { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + { + "email": "blaine.bublitz@gmail.com", + "name": "Blaine Bublitz", + "url": "https://github.com/phated" + }, + { + "email": "mathias@qiwi.be", + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": { + "lodash._setcache": "~4.1.0" + }, + "description": "The internal lodash function `baseDifference` exported as a module.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "537bde6fd0f3eeec28e37288dd51459765181b4d", + "tarball": "https://registry.npmjs.org/lodash._basedifference/-/lodash._basedifference-4.4.1.tgz" + }, + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "maintainers": [ + { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + { + "email": "mathias@qiwi.be", + "name": "mathias" + }, + { + "email": "blaine@iceddev.com", + "name": "phated" + } + ], + "name": "lodash._basedifference", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.4.1" +} diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/LICENSE b/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/LICENSE new file mode 100644 index 00000000000000..b054ca5a3ac7d6 --- /dev/null +++ b/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/README.md b/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/README.md new file mode 100644 index 00000000000000..8924e9d7f4d93e --- /dev/null +++ b/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/README.md @@ -0,0 +1,18 @@ +# lodash.rest v4.0.1 + +The [lodash](https://lodash.com/) method `_.rest` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.rest +``` + +In Node.js: +```js +var rest = require('lodash.rest'); +``` + +See the [documentation](https://lodash.com/docs#rest) or [package source](https://github.com/lodash/lodash/blob/4.0.1-npm-packages/lodash.rest) for more details. diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/index.js b/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/index.js new file mode 100644 index 00000000000000..289de317230756 --- /dev/null +++ b/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/index.js @@ -0,0 +1,247 @@ +/** + * lodash 4.0.1 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + +/** `Object#toString` result references. */ +var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + var length = args.length; + switch (length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as an array. + * + * **Note:** This method is based on the [rest parameter](https://mdn.io/rest_parameters). + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.rest(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); + * + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' + */ +function rest(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + switch (start) { + case 0: return func.call(this, array); + case 1: return func.call(this, args[0], array); + case 2: return func.call(this, args[0], args[1], array); + } + var otherArgs = Array(start + 1); + index = -1; + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = array; + return apply(func, this, otherArgs); + }; +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array constructors, and + // PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Converts `value` to an integer. + * + * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3'); + * // => 3 + */ +function toInteger(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + var remainder = value % 1; + return value === value ? (remainder ? value - remainder : value) : 0; +} + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3); + * // => 3 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3'); + * // => 3 + */ +function toNumber(value) { + if (isObject(value)) { + var other = isFunction(value.valueOf) ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +module.exports = rest; diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/package.json b/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/package.json new file mode 100644 index 00000000000000..f368b23412f717 --- /dev/null +++ b/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/package.json @@ -0,0 +1,105 @@ +{ + "_args": [ + [ + "lodash.rest@^4.0.0", + "/Users/rebecca/code/npm/node_modules/lodash.without" + ] + ], + "_from": "lodash.rest@>=4.0.0 <5.0.0", + "_id": "lodash.rest@4.0.1", + "_inCache": true, + "_installable": true, + "_location": "/lodash.without/lodash.rest", + "_nodeVersion": "5.4.0", + "_npmOperationalInternal": { + "host": "packages-5-east.internal.npmjs.com", + "tmp": "tmp/lodash.rest-4.0.1.tgz_1454484670768_0.6682933256961405" + }, + "_npmUser": { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + "_npmVersion": "2.14.15", + "_phantomChildren": {}, + "_requested": { + "name": "lodash.rest", + "raw": "lodash.rest@^4.0.0", + "rawSpec": "^4.0.0", + "scope": null, + "spec": ">=4.0.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/lodash.without" + ], + "_resolved": "https://registry.npmjs.org/lodash.rest/-/lodash.rest-4.0.1.tgz", + "_shasum": "cbecbb84e68e499a1b242baf9b27bb63ef4dd980", + "_shrinkwrap": null, + "_spec": "lodash.rest@^4.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/lodash.without", + "author": { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "https://github.com/phated" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": {}, + "description": "The lodash method `_.rest` exported as a module.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "cbecbb84e68e499a1b242baf9b27bb63ef4dd980", + "tarball": "http://registry.npmjs.org/lodash.rest/-/lodash.rest-4.0.1.tgz" + }, + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash-modularized", + "rest" + ], + "license": "MIT", + "maintainers": [ + { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + { + "name": "phated", + "email": "blaine@iceddev.com" + } + ], + "name": "lodash.rest", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.0.1" +} diff --git a/deps/npm/node_modules/lodash.without/package.json b/deps/npm/node_modules/lodash.without/package.json new file mode 100644 index 00000000000000..ac1b49c2745fba --- /dev/null +++ b/deps/npm/node_modules/lodash.without/package.json @@ -0,0 +1,108 @@ +{ + "_args": [ + [ + "lodash.without@4.1.2", + "/Users/zkat/Documents/code/npm" + ] + ], + "_from": "lodash.without@4.1.2", + "_id": "lodash.without@4.1.2", + "_inCache": true, + "_installable": true, + "_location": "/lodash.without", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/lodash.without-4.1.2.tgz_1459311008459_0.16177126462571323" + }, + "_npmUser": { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + "_npmVersion": "2.15.1", + "_phantomChildren": {}, + "_requested": { + "name": "lodash.without", + "raw": "lodash.without@4.1.2", + "rawSpec": "4.1.2", + "scope": null, + "spec": "4.1.2", + "type": "version" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/lodash.without/-/lodash.without-4.1.2.tgz", + "_shasum": "c68b1981e1b001bd87eef7487dba0af267846229", + "_shrinkwrap": null, + "_spec": "lodash.without@4.1.2", + "_where": "/Users/zkat/Documents/code/npm", + "author": { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "contributors": [ + { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + { + "email": "blaine.bublitz@gmail.com", + "name": "Blaine Bublitz", + "url": "https://github.com/phated" + }, + { + "email": "mathias@qiwi.be", + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": { + "lodash._basedifference": "~4.4.0", + "lodash.rest": "^4.0.0" + }, + "description": "The lodash method `_.without` exported as a module.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "c68b1981e1b001bd87eef7487dba0af267846229", + "tarball": "https://registry.npmjs.org/lodash.without/-/lodash.without-4.1.2.tgz" + }, + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash-modularized", + "without" + ], + "license": "MIT", + "maintainers": [ + { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + { + "email": "mathias@qiwi.be", + "name": "mathias" + }, + { + "email": "blaine@iceddev.com", + "name": "phated" + } + ], + "name": "lodash.without", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.1.2" +} diff --git a/deps/npm/node_modules/lru-cache/README.md b/deps/npm/node_modules/lru-cache/README.md deleted file mode 100644 index 3fd6d0bcae478e..00000000000000 --- a/deps/npm/node_modules/lru-cache/README.md +++ /dev/null @@ -1,119 +0,0 @@ -# lru cache - -A cache object that deletes the least-recently-used items. - -## Usage: - -```javascript -var LRU = require("lru-cache") - , options = { max: 500 - , length: function (n) { return n * 2 } - , dispose: function (key, n) { n.close() } - , maxAge: 1000 * 60 * 60 } - , cache = LRU(options) - , otherCache = LRU(50) // sets just the max size - -cache.set("key", "value") -cache.get("key") // "value" - -cache.reset() // empty the cache -``` - -If you put more stuff in it, then items will fall out. - -If you try to put an oversized thing in it, then it'll fall out right -away. - -## Options - -* `max` The maximum size of the cache, checked by applying the length - function to all values in the cache. Not setting this is kind of - silly, since that's the whole purpose of this lib, but it defaults - to `Infinity`. -* `maxAge` Maximum age in ms. Items are not pro-actively pruned out - as they age, but if you try to get an item that is too old, it'll - drop it and return undefined instead of giving it to you. -* `length` Function that is used to calculate the length of stored - items. If you're storing strings or buffers, then you probably want - to do something like `function(n){return n.length}`. The default is - `function(n){return 1}`, which is fine if you want to store `max` - like-sized things. -* `dispose` Function that is called on items when they are dropped - from the cache. This can be handy if you want to close file - descriptors or do other cleanup tasks when items are no longer - accessible. Called with `key, value`. It's called *before* - actually removing the item from the internal cache, so if you want - to immediately put it back in, you'll have to do that in a - `nextTick` or `setTimeout` callback or it won't do anything. -* `stale` By default, if you set a `maxAge`, it'll only actually pull - stale items out of the cache when you `get(key)`. (That is, it's - not pre-emptively doing a `setTimeout` or anything.) If you set - `stale:true`, it'll return the stale value before deleting it. If - you don't set this, then it'll return `undefined` when you try to - get a stale entry, as if it had already been deleted. - -## API - -* `set(key, value, maxAge)` -* `get(key) => value` - - Both of these will update the "recently used"-ness of the key. - They do what you think. `max` is optional and overrides the - cache `max` option if provided. - -* `peek(key)` - - Returns the key value (or `undefined` if not found) without - updating the "recently used"-ness of the key. - - (If you find yourself using this a lot, you *might* be using the - wrong sort of data structure, but there are some use cases where - it's handy.) - -* `del(key)` - - Deletes a key out of the cache. - -* `reset()` - - Clear the cache entirely, throwing away all values. - -* `has(key)` - - Check if a key is in the cache, without updating the recent-ness - or deleting it for being stale. - -* `forEach(function(value,key,cache), [thisp])` - - Just like `Array.prototype.forEach`. Iterates over all the keys - in the cache, in order of recent-ness. (Ie, more recently used - items are iterated over first.) - -* `keys()` - - Return an array of the keys in the cache. - -* `values()` - - Return an array of the values in the cache. - -* `length()` - - Return total length of objects in cache taking into account - `length` options function. - -* `itemCount` - - Return total quantity of objects currently in cache. Note, that - `stale` (see options) items are returned as part of this item - count. - -* `dump()` - - Return an array of the cache entries ready for serialization and usage - with 'destinationCache.load(arr)`. - -* `load(cacheEntriesArray)` - - Loads another cache entries array, obtained with `sourceCache.dump()`, - into the cache. The destination cache is reset before loading new entries diff --git a/deps/npm/node_modules/lru-cache/lib/lru-cache.js b/deps/npm/node_modules/lru-cache/lib/lru-cache.js deleted file mode 100644 index 32c2d2d90be150..00000000000000 --- a/deps/npm/node_modules/lru-cache/lib/lru-cache.js +++ /dev/null @@ -1,318 +0,0 @@ -;(function () { // closure for web browsers - -if (typeof module === 'object' && module.exports) { - module.exports = LRUCache -} else { - // just set the global for non-node platforms. - this.LRUCache = LRUCache -} - -function hOP (obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key) -} - -function naiveLength () { return 1 } - -function LRUCache (options) { - if (!(this instanceof LRUCache)) - return new LRUCache(options) - - if (typeof options === 'number') - options = { max: options } - - if (!options) - options = {} - - this._max = options.max - // Kind of weird to have a default max of Infinity, but oh well. - if (!this._max || !(typeof this._max === "number") || this._max <= 0 ) - this._max = Infinity - - this._lengthCalculator = options.length || naiveLength - if (typeof this._lengthCalculator !== "function") - this._lengthCalculator = naiveLength - - this._allowStale = options.stale || false - this._maxAge = options.maxAge || null - this._dispose = options.dispose - this.reset() -} - -// resize the cache when the max changes. -Object.defineProperty(LRUCache.prototype, "max", - { set : function (mL) { - if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity - this._max = mL - if (this._length > this._max) trim(this) - } - , get : function () { return this._max } - , enumerable : true - }) - -// resize the cache when the lengthCalculator changes. -Object.defineProperty(LRUCache.prototype, "lengthCalculator", - { set : function (lC) { - if (typeof lC !== "function") { - this._lengthCalculator = naiveLength - this._length = this._itemCount - for (var key in this._cache) { - this._cache[key].length = 1 - } - } else { - this._lengthCalculator = lC - this._length = 0 - for (var key in this._cache) { - this._cache[key].length = this._lengthCalculator(this._cache[key].value) - this._length += this._cache[key].length - } - } - - if (this._length > this._max) trim(this) - } - , get : function () { return this._lengthCalculator } - , enumerable : true - }) - -Object.defineProperty(LRUCache.prototype, "length", - { get : function () { return this._length } - , enumerable : true - }) - - -Object.defineProperty(LRUCache.prototype, "itemCount", - { get : function () { return this._itemCount } - , enumerable : true - }) - -LRUCache.prototype.forEach = function (fn, thisp) { - thisp = thisp || this - var i = 0 - var itemCount = this._itemCount - - for (var k = this._mru - 1; k >= 0 && i < itemCount; k--) if (this._lruList[k]) { - i++ - var hit = this._lruList[k] - if (isStale(this, hit)) { - del(this, hit) - if (!this._allowStale) hit = undefined - } - if (hit) { - fn.call(thisp, hit.value, hit.key, this) - } - } -} - -LRUCache.prototype.keys = function () { - var keys = new Array(this._itemCount) - var i = 0 - for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { - var hit = this._lruList[k] - keys[i++] = hit.key - } - return keys -} - -LRUCache.prototype.values = function () { - var values = new Array(this._itemCount) - var i = 0 - for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { - var hit = this._lruList[k] - values[i++] = hit.value - } - return values -} - -LRUCache.prototype.reset = function () { - if (this._dispose && this._cache) { - for (var k in this._cache) { - this._dispose(k, this._cache[k].value) - } - } - - this._cache = Object.create(null) // hash of items by key - this._lruList = Object.create(null) // list of items in order of use recency - this._mru = 0 // most recently used - this._lru = 0 // least recently used - this._length = 0 // number of items in the list - this._itemCount = 0 -} - -LRUCache.prototype.dump = function () { - var arr = [] - var i = 0 - - for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { - var hit = this._lruList[k] - if (!isStale(this, hit)) { - //Do not store staled hits - ++i - arr.push({ - k: hit.key, - v: hit.value, - e: hit.now + (hit.maxAge || 0) - }); - } - } - //arr has the most read first - return arr -} - -LRUCache.prototype.dumpLru = function () { - return this._lruList -} - -LRUCache.prototype.set = function (key, value, maxAge) { - maxAge = maxAge || this._maxAge - var now = maxAge ? Date.now() : 0 - var len = this._lengthCalculator(value) - - if (hOP(this._cache, key)) { - if (len > this._max) { - del(this, this._cache[key]) - return false - } - // dispose of the old one before overwriting - if (this._dispose) - this._dispose(key, this._cache[key].value) - - this._cache[key].now = now - this._cache[key].maxAge = maxAge - this._cache[key].value = value - this._length += (len - this._cache[key].length) - this._cache[key].length = len - this.get(key) - - if (this._length > this._max) - trim(this) - - return true - } - - var hit = new Entry(key, value, this._mru++, len, now, maxAge) - - // oversized objects fall out of cache automatically. - if (hit.length > this._max) { - if (this._dispose) this._dispose(key, value) - return false - } - - this._length += hit.length - this._lruList[hit.lu] = this._cache[key] = hit - this._itemCount ++ - - if (this._length > this._max) - trim(this) - - return true -} - -LRUCache.prototype.has = function (key) { - if (!hOP(this._cache, key)) return false - var hit = this._cache[key] - if (isStale(this, hit)) { - return false - } - return true -} - -LRUCache.prototype.get = function (key) { - return get(this, key, true) -} - -LRUCache.prototype.peek = function (key) { - return get(this, key, false) -} - -LRUCache.prototype.pop = function () { - var hit = this._lruList[this._lru] - del(this, hit) - return hit || null -} - -LRUCache.prototype.del = function (key) { - del(this, this._cache[key]) -} - -LRUCache.prototype.load = function (arr) { - //reset the cache - this.reset(); - - var now = Date.now() - //A previous serialized cache has the most recent items first - for (var l = arr.length - 1; l >= 0; l-- ) { - var hit = arr[l] - var expiresAt = hit.e || 0 - if (expiresAt === 0) { - //the item was created without expiration in a non aged cache - this.set(hit.k, hit.v) - } else { - var maxAge = expiresAt - now - //dont add already expired items - if (maxAge > 0) this.set(hit.k, hit.v, maxAge) - } - } -} - -function get (self, key, doUse) { - var hit = self._cache[key] - if (hit) { - if (isStale(self, hit)) { - del(self, hit) - if (!self._allowStale) hit = undefined - } else { - if (doUse) use(self, hit) - } - if (hit) hit = hit.value - } - return hit -} - -function isStale(self, hit) { - if (!hit || (!hit.maxAge && !self._maxAge)) return false - var stale = false; - var diff = Date.now() - hit.now - if (hit.maxAge) { - stale = diff > hit.maxAge - } else { - stale = self._maxAge && (diff > self._maxAge) - } - return stale; -} - -function use (self, hit) { - shiftLU(self, hit) - hit.lu = self._mru ++ - self._lruList[hit.lu] = hit -} - -function trim (self) { - while (self._lru < self._mru && self._length > self._max) - del(self, self._lruList[self._lru]) -} - -function shiftLU (self, hit) { - delete self._lruList[ hit.lu ] - while (self._lru < self._mru && !self._lruList[self._lru]) self._lru ++ -} - -function del (self, hit) { - if (hit) { - if (self._dispose) self._dispose(hit.key, hit.value) - self._length -= hit.length - self._itemCount -- - delete self._cache[ hit.key ] - shiftLU(self, hit) - } -} - -// classy, since V8 prefers predictable objects. -function Entry (key, value, lu, length, now, maxAge) { - this.key = key - this.value = value - this.lu = lu - this.length = length - this.now = now - if (maxAge) this.maxAge = maxAge -} - -})() diff --git a/deps/npm/node_modules/lru-cache/package.json b/deps/npm/node_modules/lru-cache/package.json deleted file mode 100644 index 5a9d76a1d5f455..00000000000000 --- a/deps/npm/node_modules/lru-cache/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "lru-cache", - "description": "A cache object that deletes the least-recently-used items.", - "version": "2.7.0", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - "keywords": [ - "mru", - "lru", - "cache" - ], - "scripts": { - "test": "tap test --gc" - }, - "main": "lib/lru-cache.js", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-lru-cache.git" - }, - "devDependencies": { - "tap": "^1.2.0", - "weak": "" - }, - "license": "ISC", - "gitHead": "fc6ee93093f4e463e5946736d4c48adc013724d1", - "bugs": { - "url": "https://github.com/isaacs/node-lru-cache/issues" - }, - "homepage": "https://github.com/isaacs/node-lru-cache#readme", - "_id": "lru-cache@2.7.0", - "_shasum": "aaa376a4cd970f9cebf5ec1909566ec034f07ee6", - "_from": "lru-cache@2.7.0", - "_npmVersion": "3.3.2", - "_nodeVersion": "4.0.0", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "aaa376a4cd970f9cebf5ec1909566ec034f07ee6", - "tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-2.7.0.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/minimatch/browser.js b/deps/npm/node_modules/minimatch/browser.js deleted file mode 100644 index 7d0515920e5cb3..00000000000000 --- a/deps/npm/node_modules/minimatch/browser.js +++ /dev/null @@ -1,1159 +0,0 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.minimatch = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o any number of characters -var star = qmark + '*?' - -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - -// characters that need to be escaped in RegExp. -var reSpecials = charSet('().*{}+?[]^$\\!') - -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split('').reduce(function (set, c) { - set[c] = true - return set - }, {}) -} - -// normalizes slashes. -var slashSplit = /\/+/ - -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} - -function ext (a, b) { - a = a || {} - b = b || {} - var t = {} - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - return t -} - -minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return minimatch - - var orig = minimatch - - var m = function minimatch (p, pattern, options) { - return orig.minimatch(p, pattern, ext(def, options)) - } - - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } - - return m -} - -Minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return Minimatch - return minimatch.defaults(def).Minimatch -} - -function minimatch (p, pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } - - // "" only matches "" - if (pattern.trim() === '') return p === '' - - return new Minimatch(pattern, options).match(p) -} - -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options) - } - - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - pattern = pattern.trim() - - // windows support: need to use /, not \ - if (path.sep !== '/') { - pattern = pattern.split(path.sep).join('/') - } - - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - - // make the set of regexps etc. - this.make() -} - -Minimatch.prototype.debug = function () {} - -Minimatch.prototype.make = make -function make () { - // don't do it more than once. - if (this._made) return - - var pattern = this.pattern - var options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - var set = this.globSet = this.braceExpand() - - if (options.debug) this.debug = console.error - - this.debug(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) - - this.debug(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - this.debug(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return s.indexOf(false) === -1 - }) - - this.debug(this.pattern, set) - - this.set = set -} - -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - var negate = false - var options = this.options - var negateOffset = 0 - - if (options.nonegate) return - - for (var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === '!' - ; i++) { - negate = !negate - negateOffset++ - } - - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} - -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return braceExpand(pattern, options) -} - -Minimatch.prototype.braceExpand = braceExpand - -function braceExpand (pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options - } else { - options = {} - } - } - - pattern = typeof pattern === 'undefined' - ? this.pattern : pattern - - if (typeof pattern === 'undefined') { - throw new Error('undefined pattern') - } - - if (options.nobrace || - !pattern.match(/\{.*\}/)) { - // shortcut. no need to expand. - return [pattern] - } - - return expand(pattern) -} - -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - var options = this.options - - // shortcuts - if (!options.noglobstar && pattern === '**') return GLOBSTAR - if (pattern === '') return '' - - var re = '' - var hasMagic = !!options.nocase - var escaping = false - // ? => one single character - var patternListStack = [] - var negativeLists = [] - var plType - var stateChar - var inClass = false - var reClassStart = -1 - var classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - var patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - var self = this - - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - self.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - - for (var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) - - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += '\\' + c - escaping = false - continue - } - - switch (c) { - case '/': - // completely not allowed, even escaped. - // Should already be path-split by now. - return false - - case '\\': - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - self.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case '(': - if (inClass) { - re += '(' - continue - } - - if (!stateChar) { - re += '\\(' - continue - } - - plType = stateChar - patternListStack.push({ - type: plType, - start: i - 1, - reStart: re.length - }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!(?:' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue - - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue - } - - clearStateChar() - hasMagic = true - re += ')' - var pl = patternListStack.pop() - plType = pl.type - // negation is (?:(?!js)[^/]*) - // The others are (?:) - switch (plType) { - case '!': - negativeLists.push(pl) - re += ')[^/]*?)' - pl.reEnd = re.length - break - case '?': - case '+': - case '*': - re += plType - break - case '@': break // the default anyway - } - continue - - case '|': - if (inClass || !patternListStack.length || escaping) { - re += '\\|' - escaping = false - continue - } - - clearStateChar() - re += '|' - continue - - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += '\\' + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - escaping = false - continue - } - - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - if (inClass) { - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - var cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - var sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } - } - - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === '^' && inClass)) { - re += '\\' - } - - re += c - - } // switch - } // for - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + 3) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) - - this.debug('tail=%j\n %s', tail, tail) - var t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } - - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case '.': - case '[': - case '(': addPatternStart = true - } - - // Hack to work around lack of negative lookbehind in JS - // A pattern like: *.!(x).!(y|z) needs to ensure that a name - // like 'a.xyz.yz' doesn't match. So, the first negative - // lookahead, has to look ALL the way ahead, to the end of - // the pattern. - for (var n = negativeLists.length - 1; n > -1; n--) { - var nl = negativeLists[n] - - var nlBefore = re.slice(0, nl.reStart) - var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) - var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) - var nlAfter = re.slice(nl.reEnd) - - nlLast += nlAfter - - // Handle nested stuff like *(*.js|!(*.json)), where open parens - // mean that we should *not* include the ) in the bit that is considered - // "after" the negated section. - var openParensBefore = nlBefore.split('(').length - 1 - var cleanAfter = nlAfter - for (i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') - } - nlAfter = cleanAfter - - var dollar = '' - if (nlAfter === '' && isSub !== SUBPARSE) { - dollar = '$' - } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast - re = newRe - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) { - re = '(?=.)' + re - } - - if (addPatternStart) { - re = patternStart + re - } - - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } - - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - - var flags = options.nocase ? 'i' : '' - var regExp = new RegExp('^' + re + '$', flags) - - regExp._glob = pattern - regExp._src = re - - return regExp -} - -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() -} - -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set - - if (!set.length) { - this.regexp = false - return this.regexp - } - var options = this.options - - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - var flags = options.nocase ? 'i' : '' - - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === 'string') ? regExpEscape(p) - : p._src - }).join('\\\/') - }).join('|') - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' - - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' - - try { - this.regexp = new RegExp(re, flags) - } catch (ex) { - this.regexp = false - } - return this.regexp -} - -minimatch.match = function (list, pattern, options) { - options = options || {} - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} - -Minimatch.prototype.match = match -function match (f, partial) { - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' - - if (f === '/' && partial) return true - - var options = this.options - - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } - - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) - - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. - - var set = this.set - this.debug(this.pattern, 'set', set) - - // Find the basename of the path by looking for the last non-empty segment - var filename - var i - for (i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } - - for (i = 0; i < set.length; i++) { - var pattern = set[i] - var file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - var hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate -} - -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options - - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) - - this.debug('matchOne', file.length, pattern.length) - - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] - - this.debug(pattern, p, f) - - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } - - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] - - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) - - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } - - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } - - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - if (options.nocase) { - hit = f.toLowerCase() === p.toLowerCase() - } else { - hit = f === p - } - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) - } - - if (!hit) return false - } - - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') - return emptyFileEnd - } - - // should be unreachable. - throw new Error('wtf?') -} - -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, '$1') -} - -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') -} - -},{"brace-expansion":2,"path":undefined}],2:[function(require,module,exports){ -var concatMap = require('concat-map'); -var balanced = require('balanced-match'); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - var expansions = expand(escapeBraces(str)); - return expansions.filter(identity).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = /^(.*,)+(.+)?$/.test(m.body); - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0]).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post) - : ['']; - - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el) }); - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - expansions.push([pre, N[j], post[k]].join('')) - } - } - - return expansions; -} - - -},{"balanced-match":3,"concat-map":4}],3:[function(require,module,exports){ -module.exports = balanced; -function balanced(a, b, str) { - var bal = 0; - var m = {}; - var ended = false; - - for (var i = 0; i < str.length; i++) { - if (a == str.substr(i, a.length)) { - if (!('start' in m)) m.start = i; - bal++; - } - else if (b == str.substr(i, b.length) && 'start' in m) { - ended = true; - bal--; - if (!bal) { - m.end = i; - m.pre = str.substr(0, m.start); - m.body = (m.end - m.start > 1) - ? str.substring(m.start + a.length, m.end) - : ''; - m.post = str.slice(m.end + b.length); - return m; - } - } - } - - // if we opened more than we closed, find the one we closed - if (bal && ended) { - var start = m.start + a.length; - m = balanced(a, b, str.substr(start)); - if (m) { - m.start += start; - m.end += start; - m.pre = str.slice(0, start) + m.pre; - } - return m; - } -} - -},{}],4:[function(require,module,exports){ -module.exports = function (xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - var x = fn(xs[i], i); - if (Array.isArray(x)) res.push.apply(res, x); - else res.push(x); - } - return res; -}; - -},{}]},{},[1])(1) -}); \ No newline at end of file diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/.npmignore b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/.npmignore deleted file mode 100644 index 249bc20eb5573c..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -*.sw* diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/README.md b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/README.md deleted file mode 100644 index 62bc7bae3fed28..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/README.md +++ /dev/null @@ -1,121 +0,0 @@ -# brace-expansion - -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), -as known from sh/bash, in JavaScript. - -[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) - -[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) - -## Example - -```js -var expand = require('brace-expansion'); - -expand('file-{a,b,c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('-v{,,}') -// => ['-v', '-v', '-v'] - -expand('file{0..2}.jpg') -// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] - -expand('file-{a..c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('file{2..0}.jpg') -// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] - -expand('file{0..4..2}.jpg') -// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] - -expand('file-{a..e..2}.jpg') -// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] - -expand('file{00..10..5}.jpg') -// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] - -expand('{{A..C},{a..c}}') -// => ['A', 'B', 'C', 'a', 'b', 'c'] - -expand('ppp{,config,oe{,conf}}') -// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] -``` - -## API - -```js -var expand = require('brace-expansion'); -``` - -### var expanded = expand(str) - -Return an array of all possible and valid expansions of `str`. If none are -found, `[str]` is returned. - -Valid expansions are: - -```js -/^(.*,)+(.+)?$/ -// {a,b,...} -``` - -A comma seperated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -A numeric sequence from `x` to `y` inclusive, with optional increment. -If `x` or `y` start with a leading `0`, all the numbers will be padded -to have equal length. Negative numbers and backwards iteration work too. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -An alphabetic sequence from `x` to `y` inclusive, with optional increment. -`x` and `y` must be exactly one character, and if given, `incr` must be a -number. - -For compatibility reasons, the string `${` is not eligible for brace expansion. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install brace-expansion -``` - -## Contributors - -- [Julian Gruber](https://github.com/juliangruber) -- [Isaac Z. Schlueter](https://github.com/isaacs) - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/example.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/example.js deleted file mode 100644 index 60ecfc74d41618..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/example.js +++ /dev/null @@ -1,8 +0,0 @@ -var expand = require('./'); - -console.log(expand('http://any.org/archive{1996..1999}/vol{1..4}/part{a,b,c}.html')); -console.log(expand('http://www.numericals.com/file{1..100..10}.txt')); -console.log(expand('http://www.letters.com/file{a..z..2}.txt')); -console.log(expand('mkdir /usr/local/src/bash/{old,new,dist,bugs}')); -console.log(expand('chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}')); - diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/index.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/index.js deleted file mode 100644 index a23104e9550173..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/index.js +++ /dev/null @@ -1,191 +0,0 @@ -var concatMap = require('concat-map'); -var balanced = require('balanced-match'); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - return expand(escapeBraces(str), true).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str, isTop) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = /^(.*,)+(.+)?$/.test(m.body); - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; - - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } - - return expansions; -} - diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile deleted file mode 100644 index fa5da71a6d0d34..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +++ /dev/null @@ -1,6 +0,0 @@ - -test: - @node_modules/.bin/tape test/*.js - -.PHONY: test - diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md deleted file mode 100644 index 2aff0ebff4403e..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +++ /dev/null @@ -1,80 +0,0 @@ -# balanced-match - -Match balanced string pairs, like `{` and `}` or `` and ``. - -[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) -[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) - -[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) - -## Example - -Get the first matching pair of braces: - -```js -var balanced = require('balanced-match'); - -console.log(balanced('{', '}', 'pre{in{nested}}post')); -console.log(balanced('{', '}', 'pre{first}between{second}post')); -``` - -The matches are: - -```bash -$ node example.js -{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } -{ start: 3, - end: 9, - pre: 'pre', - body: 'first', - post: 'between{second}post' } -``` - -## API - -### var m = balanced(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -object with those keys: - -* **start** the index of the first match of `a` -* **end** the index of the matching `b` -* **pre** the preamble, `a` and `b` not included -* **body** the match, `a` and `b` not included -* **post** the postscript, `a` and `b` not included - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install balanced-match -``` - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js deleted file mode 100644 index c02ad348e69aec..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +++ /dev/null @@ -1,5 +0,0 @@ -var balanced = require('./'); - -console.log(balanced('{', '}', 'pre{in{nested}}post')); -console.log(balanced('{', '}', 'pre{first}between{second}post')); - diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js deleted file mode 100644 index d165ae8174ca82..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +++ /dev/null @@ -1,38 +0,0 @@ -module.exports = balanced; -function balanced(a, b, str) { - var bal = 0; - var m = {}; - var ended = false; - - for (var i = 0; i < str.length; i++) { - if (a == str.substr(i, a.length)) { - if (!('start' in m)) m.start = i; - bal++; - } - else if (b == str.substr(i, b.length) && 'start' in m) { - ended = true; - bal--; - if (!bal) { - m.end = i; - m.pre = str.substr(0, m.start); - m.body = (m.end - m.start > 1) - ? str.substring(m.start + a.length, m.end) - : ''; - m.post = str.slice(m.end + b.length); - return m; - } - } - } - - // if we opened more than we closed, find the one we closed - if (bal && ended) { - var start = m.start + a.length; - m = balanced(a, b, str.substr(start)); - if (m) { - m.start += start; - m.end += start; - m.pre = str.slice(0, start) + m.pre; - } - return m; - } -} diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json deleted file mode 100644 index ede6efefa07883..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "balanced-match", - "description": "Match balanced character pairs, like \"{\" and \"}\"", - "version": "0.2.0", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/balanced-match.git" - }, - "homepage": "https://github.com/juliangruber/balanced-match", - "main": "index.js", - "scripts": { - "test": "make test" - }, - "dependencies": {}, - "devDependencies": { - "tape": "~1.1.1" - }, - "keywords": [ - "match", - "regexp", - "test", - "balanced", - "parse" - ], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT", - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "gitHead": "ba40ed78e7114a4a67c51da768a100184dead39c", - "bugs": { - "url": "https://github.com/juliangruber/balanced-match/issues" - }, - "_id": "balanced-match@0.2.0", - "_shasum": "38f6730c03aab6d5edbb52bd934885e756d71674", - "_from": "balanced-match@>=0.2.0 <0.3.0", - "_npmVersion": "2.1.8", - "_nodeVersion": "0.10.32", - "_npmUser": { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - "maintainers": [ - { - "name": "juliangruber", - "email": "julian@juliangruber.com" - } - ], - "dist": { - "shasum": "38f6730c03aab6d5edbb52bd934885e756d71674", - "tarball": "http://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js deleted file mode 100644 index 36bfd39954850d..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +++ /dev/null @@ -1,56 +0,0 @@ -var test = require('tape'); -var balanced = require('..'); - -test('balanced', function(t) { - t.deepEqual(balanced('{', '}', 'pre{in{nest}}post'), { - start: 3, - end: 12, - pre: 'pre', - body: 'in{nest}', - post: 'post' - }); - t.deepEqual(balanced('{', '}', '{{{{{{{{{in}post'), { - start: 8, - end: 11, - pre: '{{{{{{{{', - body: 'in', - post: 'post' - }); - t.deepEqual(balanced('{', '}', 'pre{body{in}post'), { - start: 8, - end: 11, - pre: 'pre{body', - body: 'in', - post: 'post' - }); - t.deepEqual(balanced('{', '}', 'pre}{in{nest}}post'), { - start: 4, - end: 13, - pre: 'pre}', - body: 'in{nest}', - post: 'post' - }); - t.deepEqual(balanced('{', '}', 'pre{body}between{body2}post'), { - start: 3, - end: 8, - pre: 'pre', - body: 'body', - post: 'between{body2}post' - }); - t.notOk(balanced('{', '}', 'nope'), 'should be notOk'); - t.deepEqual(balanced('', '', 'preinnestpost'), { - start: 3, - end: 19, - pre: 'pre', - body: 'innest', - post: 'post' - }); - t.deepEqual(balanced('', '', 'preinnestpost'), { - start: 7, - end: 23, - pre: 'pre', - body: 'innest', - post: 'post' - }); - t.end(); -}); diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json deleted file mode 100644 index 2f1bd3d5d241b8..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "name": "concat-map", - "description": "concatenative mapdashery", - "version": "0.0.1", - "repository": { - "type": "git", - "url": "git://github.com/substack/node-concat-map.git" - }, - "main": "index.js", - "keywords": [ - "concat", - "concatMap", - "map", - "functional", - "higher-order" - ], - "directories": { - "example": "example", - "test": "test" - }, - "scripts": { - "test": "tape test/*.js" - }, - "devDependencies": { - "tape": "~2.4.0" - }, - "license": "MIT", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "testling": { - "files": "test/*.js", - "browsers": { - "ie": [ - 6, - 7, - 8, - 9 - ], - "ff": [ - 3.5, - 10, - 15 - ], - "chrome": [ - 10, - 22 - ], - "safari": [ - 5.1 - ], - "opera": [ - 12 - ] - } - }, - "bugs": { - "url": "https://github.com/substack/node-concat-map/issues" - }, - "homepage": "https://github.com/substack/node-concat-map", - "_id": "concat-map@0.0.1", - "dist": { - "shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", - "tarball": "https://registrytwo.npmjs.com/concat-map/-/concat-map-0.0.1.tgz" - }, - "_from": "concat-map@0.0.1", - "_npmVersion": "1.3.21", - "_npmUser": { - "name": "substack", - "email": "mail@substack.net" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", - "_resolved": "https://registrytwo.npmjs.com/concat-map/-/concat-map-0.0.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/package.json b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/package.json deleted file mode 100644 index 5f1866c8b5a29e..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "brace-expansion", - "description": "Brace expansion as known from sh/bash", - "version": "1.1.0", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/brace-expansion.git" - }, - "homepage": "https://github.com/juliangruber/brace-expansion", - "main": "index.js", - "scripts": { - "test": "tape test/*.js", - "gentest": "bash test/generate.sh" - }, - "dependencies": { - "balanced-match": "^0.2.0", - "concat-map": "0.0.1" - }, - "devDependencies": { - "tape": "^3.0.3" - }, - "keywords": [], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT", - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "gitHead": "b5fa3b1c74e5e2dba2d0efa19b28335641bc1164", - "bugs": { - "url": "https://github.com/juliangruber/brace-expansion/issues" - }, - "_id": "brace-expansion@1.1.0", - "_shasum": "c9b7d03c03f37bc704be100e522b40db8f6cfcd9", - "_from": "brace-expansion@>=1.0.0 <2.0.0", - "_npmVersion": "2.1.10", - "_nodeVersion": "0.10.32", - "_npmUser": { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - "maintainers": [ - { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - { - "name": "isaacs", - "email": "isaacs@npmjs.com" - } - ], - "dist": { - "shasum": "c9b7d03c03f37bc704be100e522b40db8f6cfcd9", - "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js deleted file mode 100644 index 5fe2b8ad48cc1c..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js +++ /dev/null @@ -1,32 +0,0 @@ -var test = require('tape'); -var expand = require('..'); -var fs = require('fs'); -var resfile = __dirname + '/bash-results.txt'; -var cases = fs.readFileSync(resfile, 'utf8').split('><><><><'); - -// throw away the EOF marker -cases.pop() - -test('matches bash expansions', function(t) { - cases.forEach(function(testcase) { - var set = testcase.split('\n'); - var pattern = set.shift(); - var actual = expand(pattern); - - // If it expands to the empty string, then it's actually - // just nothing, but Bash is a singly typed language, so - // "nothing" is the same as "". - if (set.length === 1 && set[0] === '') { - set = [] - } else { - // otherwise, strip off the [] that were added so that - // "" expansions would be preserved properly. - set = set.map(function (s) { - return s.replace(/^\[|\]$/g, '') - }) - } - - t.same(actual, set, pattern); - }); - t.end(); -}) diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt deleted file mode 100644 index 958148d26aacb9..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt +++ /dev/null @@ -1,1075 +0,0 @@ -A{b,{d,e},{f,g}}Z -[AbZ] -[AdZ] -[AeZ] -[AfZ] -[AgZ]><><><><><><><\{a,b}{{a,b},a,b} -[{a,b}a] -[{a,b}b] -[{a,b}a] -[{a,b}b]><><><><{{a,b} -[{a] -[{b]><><><><{a,b}} -[a}] -[b}]><><><><{,} -><><><><><><><{,}b -[b] -[b]><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><{-01..5} -[-01] -[000] -[001] -[002] -[003] -[004] -[005]><><><><{-05..100..5} -[-05] -[000] -[005] -[010] -[015] -[020] -[025] -[030] -[035] -[040] -[045] -[050] -[055] -[060] -[065] -[070] -[075] -[080] -[085] -[090] -[095] -[100]><><><><{-05..100} -[-05] -[-04] -[-03] -[-02] -[-01] -[000] -[001] -[002] -[003] -[004] -[005] -[006] -[007] -[008] -[009] -[010] -[011] -[012] -[013] -[014] -[015] -[016] -[017] -[018] -[019] -[020] -[021] -[022] -[023] -[024] -[025] -[026] -[027] -[028] -[029] -[030] -[031] -[032] -[033] -[034] -[035] -[036] -[037] -[038] -[039] -[040] -[041] -[042] -[043] -[044] -[045] -[046] -[047] -[048] -[049] -[050] -[051] -[052] -[053] -[054] -[055] -[056] -[057] -[058] -[059] -[060] -[061] -[062] -[063] -[064] -[065] -[066] -[067] -[068] -[069] -[070] -[071] -[072] -[073] -[074] -[075] -[076] -[077] -[078] -[079] -[080] -[081] -[082] -[083] -[084] -[085] -[086] -[087] -[088] -[089] -[090] -[091] -[092] -[093] -[094] -[095] -[096] -[097] -[098] -[099] -[100]><><><><{0..5..2} -[0] -[2] -[4]><><><><{0001..05..2} -[0001] -[0003] -[0005]><><><><{0001..-5..2} -[0001] -[-001] -[-003] -[-005]><><><><{0001..-5..-2} -[0001] -[-001] -[-003] -[-005]><><><><{0001..5..-2} -[0001] -[0003] -[0005]><><><><{01..5} -[01] -[02] -[03] -[04] -[05]><><><><{1..05} -[01] -[02] -[03] -[04] -[05]><><><><{1..05..3} -[01] -[04]><><><><{05..100} -[005] -[006] -[007] -[008] -[009] -[010] -[011] -[012] -[013] -[014] -[015] -[016] -[017] -[018] -[019] -[020] -[021] -[022] -[023] -[024] -[025] -[026] -[027] -[028] -[029] -[030] -[031] -[032] -[033] -[034] -[035] -[036] -[037] -[038] -[039] -[040] -[041] -[042] -[043] -[044] -[045] -[046] -[047] -[048] -[049] -[050] -[051] -[052] -[053] -[054] -[055] -[056] -[057] -[058] -[059] -[060] -[061] -[062] -[063] -[064] -[065] -[066] -[067] -[068] -[069] -[070] -[071] -[072] -[073] -[074] -[075] -[076] -[077] -[078] -[079] -[080] -[081] -[082] -[083] -[084] -[085] -[086] -[087] -[088] -[089] -[090] -[091] -[092] -[093] -[094] -[095] -[096] -[097] -[098] -[099] -[100]><><><><{0a..0z} -[{0a..0z}]><><><><{a,b\}c,d} -[a] -[b}c] -[d]><><><><{a,b{c,d} -[{a,bc] -[{a,bd]><><><><{a,b}c,d} -[ac,d}] -[bc,d}]><><><><{a..F} -[a] -[`] -[_] -[^] -[]] -[] -[[] -[Z] -[Y] -[X] -[W] -[V] -[U] -[T] -[S] -[R] -[Q] -[P] -[O] -[N] -[M] -[L] -[K] -[J] -[I] -[H] -[G] -[F]><><><><{A..f} -[A] -[B] -[C] -[D] -[E] -[F] -[G] -[H] -[I] -[J] -[K] -[L] -[M] -[N] -[O] -[P] -[Q] -[R] -[S] -[T] -[U] -[V] -[W] -[X] -[Y] -[Z] -[[] -[] -[]] -[^] -[_] -[`] -[a] -[b] -[c] -[d] -[e] -[f]><><><><{a..Z} -[a] -[`] -[_] -[^] -[]] -[] -[[] -[Z]><><><><{A..z} -[A] -[B] -[C] -[D] -[E] -[F] -[G] -[H] -[I] -[J] -[K] -[L] -[M] -[N] -[O] -[P] -[Q] -[R] -[S] -[T] -[U] -[V] -[W] -[X] -[Y] -[Z] -[[] -[] -[]] -[^] -[_] -[`] -[a] -[b] -[c] -[d] -[e] -[f] -[g] -[h] -[i] -[j] -[k] -[l] -[m] -[n] -[o] -[p] -[q] -[r] -[s] -[t] -[u] -[v] -[w] -[x] -[y] -[z]><><><><{z..A} -[z] -[y] -[x] -[w] -[v] -[u] -[t] -[s] -[r] -[q] -[p] -[o] -[n] -[m] -[l] -[k] -[j] -[i] -[h] -[g] -[f] -[e] -[d] -[c] -[b] -[a] -[`] -[_] -[^] -[]] -[] -[[] -[Z] -[Y] -[X] -[W] -[V] -[U] -[T] -[S] -[R] -[Q] -[P] -[O] -[N] -[M] -[L] -[K] -[J] -[I] -[H] -[G] -[F] -[E] -[D] -[C] -[B] -[A]><><><><{Z..a} -[Z] -[[] -[] -[]] -[^] -[_] -[`] -[a]><><><><{a..F..2} -[a] -[_] -[]] -[[] -[Y] -[W] -[U] -[S] -[Q] -[O] -[M] -[K] -[I] -[G]><><><><{A..f..02} -[A] -[C] -[E] -[G] -[I] -[K] -[M] -[O] -[Q] -[S] -[U] -[W] -[Y] -[[] -[]] -[_] -[a] -[c] -[e]><><><><{a..Z..5} -[a] -[]><><><><><><><{A..z..10} -[A] -[K] -[U] -[_] -[i] -[s]><><><><{z..A..-2} -[z] -[x] -[v] -[t] -[r] -[p] -[n] -[l] -[j] -[h] -[f] -[d] -[b] -[`] -[^] -[] -[Z] -[X] -[V] -[T] -[R] -[P] -[N] -[L] -[J] -[H] -[F] -[D] -[B]><><><><{Z..a..20} -[Z]><><><><{a{,b} -[{a] -[{ab]><><><><{a},b} -[a}] -[b]><><><><{x,y{,}g} -[x] -[yg] -[yg]><><><><{x,y{}g} -[x] -[y{}g]><><><><{{a,b} -[{a] -[{b]><><><><{{a,b},c} -[a] -[b] -[c]><><><><{{a,b}c} -[{ac}] -[{bc}]><><><><{{a,b},} -[a] -[b]><><><><><><><{{a,b},}c -[ac] -[bc] -[c]><><><><{{a,b}.} -[{a.}] -[{b.}]><><><><{{a,b}} -[{a}] -[{b}]><><><><><><>< -><><><><{-10..00} -[-10] -[-09] -[-08] -[-07] -[-06] -[-05] -[-04] -[-03] -[-02] -[-01] -[000]><><><><{a,\\{a,b}c} -[a] -[\ac] -[\bc]><><><><{a,\{a,b}c} -[ac}] -[{ac}] -[bc}]><><><><><><><{-10.\.00} -[{-10..00}]><><><><><><><><><><{l,n,m}xyz -[lxyz] -[nxyz] -[mxyz]><><><><{abc\,def} -[{abc,def}]><><><><{abc} -[{abc}]><><><><{x\,y,\{abc\},trie} -[x,y] -[{abc}] -[trie]><><><><{} -[{}]><><><><} -[}]><><><><{ -[{]><><><><><><><{1..10} -[1] -[2] -[3] -[4] -[5] -[6] -[7] -[8] -[9] -[10]><><><><{0..10,braces} -[0..10] -[braces]><><><><{{0..10},braces} -[0] -[1] -[2] -[3] -[4] -[5] -[6] -[7] -[8] -[9] -[10] -[braces]><><><><><><><{3..3} -[3]><><><><><><><{10..1} -[10] -[9] -[8] -[7] -[6] -[5] -[4] -[3] -[2] -[1]><><><><{10..1}y -[10y] -[9y] -[8y] -[7y] -[6y] -[5y] -[4y] -[3y] -[2y] -[1y]><><><><><><><{a..f} -[a] -[b] -[c] -[d] -[e] -[f]><><><><{f..a} -[f] -[e] -[d] -[c] -[b] -[a]><><><><{a..A} -[a] -[`] -[_] -[^] -[]] -[] -[[] -[Z] -[Y] -[X] -[W] -[V] -[U] -[T] -[S] -[R] -[Q] -[P] -[O] -[N] -[M] -[L] -[K] -[J] -[I] -[H] -[G] -[F] -[E] -[D] -[C] -[B] -[A]><><><><{A..a} -[A] -[B] -[C] -[D] -[E] -[F] -[G] -[H] -[I] -[J] -[K] -[L] -[M] -[N] -[O] -[P] -[Q] -[R] -[S] -[T] -[U] -[V] -[W] -[X] -[Y] -[Z] -[[] -[] -[]] -[^] -[_] -[`] -[a]><><><><{f..f} -[f]><><><><{1..f} -[{1..f}]><><><><{f..1} -[{f..1}]><><><><{-1..-10} -[-1] -[-2] -[-3] -[-4] -[-5] -[-6] -[-7] -[-8] -[-9] -[-10]><><><><{-20..0} -[-20] -[-19] -[-18] -[-17] -[-16] -[-15] -[-14] -[-13] -[-12] -[-11] -[-10] -[-9] -[-8] -[-7] -[-6] -[-5] -[-4] -[-3] -[-2] -[-1] -[0]><><><><><><><><><><{klklkl}{1,2,3} -[{klklkl}1] -[{klklkl}2] -[{klklkl}3]><><><><{1..10..2} -[1] -[3] -[5] -[7] -[9]><><><><{-1..-10..2} -[-1] -[-3] -[-5] -[-7] -[-9]><><><><{-1..-10..-2} -[-1] -[-3] -[-5] -[-7] -[-9]><><><><{10..1..-2} -[10] -[8] -[6] -[4] -[2]><><><><{10..1..2} -[10] -[8] -[6] -[4] -[2]><><><><{1..20..2} -[1] -[3] -[5] -[7] -[9] -[11] -[13] -[15] -[17] -[19]><><><><{1..20..20} -[1]><><><><{100..0..5} -[100] -[95] -[90] -[85] -[80] -[75] -[70] -[65] -[60] -[55] -[50] -[45] -[40] -[35] -[30] -[25] -[20] -[15] -[10] -[5] -[0]><><><><{100..0..-5} -[100] -[95] -[90] -[85] -[80] -[75] -[70] -[65] -[60] -[55] -[50] -[45] -[40] -[35] -[30] -[25] -[20] -[15] -[10] -[5] -[0]><><><><{a..z} -[a] -[b] -[c] -[d] -[e] -[f] -[g] -[h] -[i] -[j] -[k] -[l] -[m] -[n] -[o] -[p] -[q] -[r] -[s] -[t] -[u] -[v] -[w] -[x] -[y] -[z]><><><><{a..z..2} -[a] -[c] -[e] -[g] -[i] -[k] -[m] -[o] -[q] -[s] -[u] -[w] -[y]><><><><{z..a..-2} -[z] -[x] -[v] -[t] -[r] -[p] -[n] -[l] -[j] -[h] -[f] -[d] -[b]><><><><{2147483645..2147483649} -[2147483645] -[2147483646] -[2147483647] -[2147483648] -[2147483649]><><><><{10..0..2} -[10] -[8] -[6] -[4] -[2] -[0]><><><><{10..0..-2} -[10] -[8] -[6] -[4] -[2] -[0]><><><><{-50..-0..5} -[-50] -[-45] -[-40] -[-35] -[-30] -[-25] -[-20] -[-15] -[-10] -[-5] -[0]><><><><{1..10.f} -[{1..10.f}]><><><><{1..ff} -[{1..ff}]><><><><{1..10..ff} -[{1..10..ff}]><><><><{1.20..2} -[{1.20..2}]><><><><{1..20..f2} -[{1..20..f2}]><><><><{1..20..2f} -[{1..20..2f}]><><><><{1..2f..2} -[{1..2f..2}]><><><><{1..ff..2} -[{1..ff..2}]><><><><{1..ff} -[{1..ff}]><><><><{1..f} -[{1..f}]><><><><{1..0f} -[{1..0f}]><><><><{1..10f} -[{1..10f}]><><><><{1..10.f} -[{1..10.f}]><><><><{1..10.f} -[{1..10.f}]><><><>< \ No newline at end of file diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt deleted file mode 100644 index e5161c3da869f3..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt +++ /dev/null @@ -1,182 +0,0 @@ -# skip quotes for now -# "{x,x}" -# {"x,x"} -# {x","x} -# '{a,b}{{a,b},a,b}' -A{b,{d,e},{f,g}}Z -PRE-{a,b}{{a,b},a,b}-POST -\\{a,b}{{a,b},a,b} -{{a,b} -{a,b}} -{,} -a{,} -{,}b -a{,}b -a{b}c -a{1..5}b -a{01..5}b -a{-01..5}b -a{-01..5..3}b -a{001..9}b -a{b,c{d,e},{f,g}h}x{y,z -a{b,c{d,e},{f,g}h}x{y,z\\} -a{b,c{d,e},{f,g}h}x{y,z} -a{b{c{d,e}f{x,y{{g}h -a{b{c{d,e}f{x,y{}g}h -a{b{c{d,e}f{x,y}}g}h -a{b{c{d,e}f}g}h -a{{x,y},z}b -f{x,y{g,z}}h -f{x,y{{g,z}}h -f{x,y{{g,z}}h} -f{x,y{{g}h -f{x,y{{g}}h -f{x,y{}g}h -z{a,b{,c}d -z{a,b},c}d -{-01..5} -{-05..100..5} -{-05..100} -{0..5..2} -{0001..05..2} -{0001..-5..2} -{0001..-5..-2} -{0001..5..-2} -{01..5} -{1..05} -{1..05..3} -{05..100} -{0a..0z} -{a,b\\}c,d} -{a,b{c,d} -{a,b}c,d} -{a..F} -{A..f} -{a..Z} -{A..z} -{z..A} -{Z..a} -{a..F..2} -{A..f..02} -{a..Z..5} -d{a..Z..5}b -{A..z..10} -{z..A..-2} -{Z..a..20} -{a{,b} -{a},b} -{x,y{,}g} -{x,y{}g} -{{a,b} -{{a,b},c} -{{a,b}c} -{{a,b},} -X{{a,b},}X -{{a,b},}c -{{a,b}.} -{{a,b}} -X{a..#}X -# this next one is an empty string - -{-10..00} -# Need to escape slashes in here for reasons i guess. -{a,\\\\{a,b}c} -{a,\\{a,b}c} -a,\\{b,c} -{-10.\\.00} -#### bash tests/braces.tests -# Note that some tests are edited out because some features of -# bash are intentionally not supported in this brace expander. -ff{c,b,a} -f{d,e,f}g -{l,n,m}xyz -{abc\\,def} -{abc} -{x\\,y,\\{abc\\},trie} -# not impementing back-ticks obviously -# XXXX\\{`echo a b c | tr ' ' ','`\\} -{} -# We only ever have to worry about parsing a single argument, -# not a command line, so spaces have a different meaning than bash. -# { } -} -{ -abcd{efgh -# spaces -# foo {1,2} bar -# not impementing back-ticks obviously -# `zecho foo {1,2} bar` -# $(zecho foo {1,2} bar) -# ${var} is not a variable here, like it is in bash. omit. -# foo{bar,${var}.} -# foo{bar,${var}} -# isaacs: skip quotes for now -# "${var}"{x,y} -# $var{x,y} -# ${var}{x,y} -# new sequence brace operators -{1..10} -# this doesn't work yet -{0..10,braces} -# but this does -{{0..10},braces} -x{{0..10},braces}y -{3..3} -x{3..3}y -{10..1} -{10..1}y -x{10..1}y -{a..f} -{f..a} -{a..A} -{A..a} -{f..f} -# mixes are incorrectly-formed brace expansions -{1..f} -{f..1} -# spaces -# 0{1..9} {10..20} -# do negative numbers work? -{-1..-10} -{-20..0} -# weirdly-formed brace expansions -- fixed in post-bash-3.1 -a-{b{d,e}}-c -a-{bdef-{g,i}-c -# isaacs: skip quotes for now -# {"klklkl"}{1,2,3} -# isaacs: this is a valid test, though -{klklkl}{1,2,3} -# {"x,x"} -{1..10..2} -{-1..-10..2} -{-1..-10..-2} -{10..1..-2} -{10..1..2} -{1..20..2} -{1..20..20} -{100..0..5} -{100..0..-5} -{a..z} -{a..z..2} -{z..a..-2} -# make sure brace expansion handles ints > 2**31 - 1 using intmax_t -{2147483645..2147483649} -# unwanted zero-padding -- fixed post-bash-4.0 -{10..0..2} -{10..0..-2} -{-50..-0..5} -# bad -{1..10.f} -{1..ff} -{1..10..ff} -{1.20..2} -{1..20..f2} -{1..20..2f} -{1..2f..2} -{1..ff..2} -{1..ff} -{1..f} -{1..0f} -{1..10f} -{1..10.f} -{1..10.f} diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js deleted file mode 100644 index 3fcc185a7d6dcc..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js +++ /dev/null @@ -1,9 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('ignores ${', function(t) { - t.deepEqual(expand('${1..3}'), ['${1..3}']); - t.deepEqual(expand('${a,b}${c,d}'), ['${a,b}${c,d}']); - t.deepEqual(expand('x${a,b}x${c,d}x'), ['x${a,b}x${c,d}x']); - t.end(); -}); diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js deleted file mode 100644 index e429121eab8059..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js +++ /dev/null @@ -1,10 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('empty option', function(t) { - t.deepEqual(expand('-v{,,,,}'), [ - '-v', '-v', '-v', '-v', '-v' - ]); - t.end(); -}); - diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh deleted file mode 100644 index e040e664d9f881..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash - -set -e - -# Bash 4.3 because of arbitrary need to pick a single standard. - -if [ "${BASH_VERSINFO[0]}" != "4" ] || [ "${BASH_VERSINFO[1]}" != "3" ]; then - echo "this script requires bash 4.3" >&2 - exit 1 -fi - -CDPATH= cd "$(dirname "$0")" - -js='require("./")(process.argv[1]).join(" ")' - -cat cases.txt | \ - while read case; do - if [ "${case:0:1}" = "#" ]; then - continue; - fi; - b="$($BASH -c 'for c in '"$case"'; do echo ["$c"]; done')" - echo "$case" - echo -n "$b><><><><"; - done > bash-results.txt diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js deleted file mode 100644 index 8d434c23d4514d..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js +++ /dev/null @@ -1,15 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('negative increment', function(t) { - t.deepEqual(expand('{3..1}'), ['3', '2', '1']); - t.deepEqual(expand('{10..8}'), ['10', '9', '8']); - t.deepEqual(expand('{10..08}'), ['10', '09', '08']); - t.deepEqual(expand('{c..a}'), ['c', 'b', 'a']); - - t.deepEqual(expand('{4..0..2}'), ['4', '2', '0']); - t.deepEqual(expand('{4..0..-2}'), ['4', '2', '0']); - t.deepEqual(expand('{e..a..2}'), ['e', 'c', 'a']); - - t.end(); -}); diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/nested.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/nested.js deleted file mode 100644 index 0862dc51f90aee..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/nested.js +++ /dev/null @@ -1,16 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('nested', function(t) { - t.deepEqual(expand('{a,b{1..3},c}'), [ - 'a', 'b1', 'b2', 'b3', 'c' - ]); - t.deepEqual(expand('{{A..Z},{a..z}}'), - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('') - ); - t.deepEqual(expand('ppp{,config,oe{,conf}}'), [ - 'ppp', 'pppconfig', 'pppoe', 'pppoeconf' - ]); - t.end(); -}); - diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/order.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/order.js deleted file mode 100644 index c00ad155fe6760..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/order.js +++ /dev/null @@ -1,10 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('order', function(t) { - t.deepEqual(expand('a{d,c,b}e'), [ - 'ade', 'ace', 'abe' - ]); - t.end(); -}); - diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/pad.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/pad.js deleted file mode 100644 index e4158775f1bd06..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/pad.js +++ /dev/null @@ -1,13 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('pad', function(t) { - t.deepEqual(expand('{9..11}'), [ - '9', '10', '11' - ]); - t.deepEqual(expand('{09..11}'), [ - '09', '10', '11' - ]); - t.end(); -}); - diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js deleted file mode 100644 index 3038fba7416b3a..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js +++ /dev/null @@ -1,7 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('x and y of same type', function(t) { - t.deepEqual(expand('{a..9}'), ['{a..9}']); - t.end(); -}); diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js deleted file mode 100644 index f73a9579ab398b..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js +++ /dev/null @@ -1,50 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('numeric sequences', function(t) { - t.deepEqual(expand('a{1..2}b{2..3}c'), [ - 'a1b2c', 'a1b3c', 'a2b2c', 'a2b3c' - ]); - t.deepEqual(expand('{1..2}{2..3}'), [ - '12', '13', '22', '23' - ]); - t.end(); -}); - -test('numeric sequences with step count', function(t) { - t.deepEqual(expand('{0..8..2}'), [ - '0', '2', '4', '6', '8' - ]); - t.deepEqual(expand('{1..8..2}'), [ - '1', '3', '5', '7' - ]); - t.end(); -}); - -test('numeric sequence with negative x / y', function(t) { - t.deepEqual(expand('{3..-2}'), [ - '3', '2', '1', '0', '-1', '-2' - ]); - t.end(); -}); - -test('alphabetic sequences', function(t) { - t.deepEqual(expand('1{a..b}2{b..c}3'), [ - '1a2b3', '1a2c3', '1b2b3', '1b2c3' - ]); - t.deepEqual(expand('{a..b}{b..c}'), [ - 'ab', 'ac', 'bb', 'bc' - ]); - t.end(); -}); - -test('alphabetic sequences with step count', function(t) { - t.deepEqual(expand('{a..k..2}'), [ - 'a', 'c', 'e', 'g', 'i', 'k' - ]); - t.deepEqual(expand('{b..k..2}'), [ - 'b', 'd', 'f', 'h', 'j' - ]); - t.end(); -}); - diff --git a/deps/npm/node_modules/minimatch/package.json b/deps/npm/node_modules/minimatch/package.json deleted file mode 100644 index c7c9a089ceb430..00000000000000 --- a/deps/npm/node_modules/minimatch/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "name": "minimatch", - "description": "a glob matcher in javascript", - "version": "2.0.10", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "posttest": "standard minimatch.js test/*.js", - "test": "tap test/*.js", - "prepublish": "browserify -o browser.js -e minimatch.js -s minimatch --bare" - }, - "engines": { - "node": "*" - }, - "dependencies": { - "brace-expansion": "^1.0.0" - }, - "devDependencies": { - "browserify": "^9.0.3", - "standard": "^3.7.2", - "tap": "^1.2.0" - }, - "license": "ISC", - "files": [ - "minimatch.js", - "browser.js" - ], - "gitHead": "6afb85f0c324b321f76a38df81891e562693e257", - "bugs": { - "url": "https://github.com/isaacs/minimatch/issues" - }, - "homepage": "https://github.com/isaacs/minimatch#readme", - "_id": "minimatch@2.0.10", - "_shasum": "8d087c39c6b38c001b97fca7ce6d0e1e80afbac7", - "_from": "minimatch@2.0.10", - "_npmVersion": "3.1.0", - "_nodeVersion": "2.2.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "8d087c39c6b38c001b97fca7ce6d0e1e80afbac7", - "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz" -} diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/index.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/index.js index 584f551a6da734..a5793ceccec488 100644 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/index.js +++ b/deps/npm/node_modules/mkdirp/node_modules/minimist/index.js @@ -1,16 +1,16 @@ module.exports = function (args, opts) { if (!opts) opts = {}; - + var flags = { bools : {}, strings : {} }; - + [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { flags.bools[key] = true; }); - + [].concat(opts.string).filter(Boolean).forEach(function (key) { flags.strings[key] = true; }); - + var aliases = {}; Object.keys(opts.alias || {}).forEach(function (key) { aliases[key] = [].concat(opts.alias[key]); @@ -20,14 +20,14 @@ module.exports = function (args, opts) { })); }); }); - + var defaults = opts['default'] || {}; - + var argv = { _ : [] }; Object.keys(flags.bools).forEach(function (key) { setArg(key, defaults[key] === undefined ? false : defaults[key]); }); - + var notFlags = []; if (args.indexOf('--') !== -1) { @@ -40,15 +40,15 @@ module.exports = function (args, opts) { ? Number(val) : val ; setKey(argv, key.split('.'), value); - + (aliases[key] || []).forEach(function (x) { setKey(argv, x.split('.'), value); }); } - + for (var i = 0; i < args.length; i++) { var arg = args[i]; - + if (/^--.+=/.test(arg)) { // Using [\s\S] instead of . because js doesn't support the // 'dotall' regex modifier. See: @@ -79,23 +79,23 @@ module.exports = function (args, opts) { } else if (/^-[^-]+/.test(arg)) { var letters = arg.slice(1,-1).split(''); - + var broken = false; for (var j = 0; j < letters.length; j++) { var next = arg.slice(j+2); - + if (next === '-') { setArg(letters[j], next) continue; } - + if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { setArg(letters[j], next); broken = true; break; } - + if (letters[j+1] && letters[j+1].match(/\W/)) { setArg(letters[j], arg.slice(j+2)); broken = true; @@ -105,7 +105,7 @@ module.exports = function (args, opts) { setArg(letters[j], flags.strings[letters[j]] ? '' : true); } } - + var key = arg.slice(-1)[0]; if (!broken && key !== '-') { if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) @@ -129,17 +129,17 @@ module.exports = function (args, opts) { ); } } - + Object.keys(defaults).forEach(function (key) { if (!hasKey(argv, key.split('.'))) { setKey(argv, key.split('.'), defaults[key]); - + (aliases[key] || []).forEach(function (x) { setKey(argv, x.split('.'), defaults[key]); }); } }); - + notFlags.forEach(function(key) { argv._.push(key); }); @@ -163,7 +163,7 @@ function setKey (obj, keys, value) { if (o[key] === undefined) o[key] = {}; o = o[key]; }); - + var key = keys[keys.length - 1]; if (o[key] === undefined || typeof o[key] === 'boolean') { o[key] = value; diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/package.json b/deps/npm/node_modules/mkdirp/node_modules/minimist/package.json index 7cd80f4f41ac5a..ca6e58da3020e6 100644 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/package.json +++ b/deps/npm/node_modules/mkdirp/node_modules/minimist/package.json @@ -40,27 +40,13 @@ "url": "http://substack.net" }, "license": "MIT", + "readme": "# minimist\n\nparse argument options\n\nThis module is the guts of optimist's argument parser without all the\nfanciful decoration.\n\n[![browser support](https://ci.testling.com/substack/minimist.png)](http://ci.testling.com/substack/minimist)\n\n[![build status](https://secure.travis-ci.org/substack/minimist.png)](http://travis-ci.org/substack/minimist)\n\n# example\n\n``` js\nvar argv = require('minimist')(process.argv.slice(2));\nconsole.dir(argv);\n```\n\n```\n$ node example/parse.js -a beep -b boop\n{ _: [], a: 'beep', b: 'boop' }\n```\n\n```\n$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz\n{ _: [ 'foo', 'bar', 'baz' ],\n x: 3,\n y: 4,\n n: 5,\n a: true,\n b: true,\n c: true,\n beep: 'boop' }\n```\n\n# methods\n\n``` js\nvar parseArgs = require('minimist')\n```\n\n## var argv = parseArgs(args, opts={})\n\nReturn an argument object `argv` populated with the array arguments from `args`.\n\n`argv._` contains all the arguments that didn't have an option associated with\nthem.\n\nNumeric-looking arguments will be returned as numbers unless `opts.string` or\n`opts.boolean` is set for that argument name.\n\nAny arguments after `'--'` will not be parsed and will end up in `argv._`.\n\noptions can be:\n\n* `opts.string` - a string or array of strings argument names to always treat as\nstrings\n* `opts.boolean` - a string or array of strings to always treat as booleans\n* `opts.alias` - an object mapping string names to strings or arrays of string\nargument names to use as aliases\n* `opts.default` - an object mapping string argument names to default values\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install minimist\n```\n\n# license\n\nMIT\n", + "readmeFilename": "readme.markdown", "bugs": { "url": "https://github.com/substack/minimist/issues" }, "_id": "minimist@0.0.8", - "dist": { - "shasum": "857fcabfc3397d2625b8228262e86aa7a011b05d", - "tarball": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" - }, - "_from": "minimist@0.0.8", - "_npmVersion": "1.4.3", - "_npmUser": { - "name": "substack", - "email": "mail@substack.net" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "directories": {}, "_shasum": "857fcabfc3397d2625b8228262e86aa7a011b05d", - "_resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" + "_resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "_from": "minimist@0.0.8" } diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse.js index 8a90646696628e..47e92237fb0bbc 100644 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse.js +++ b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse.js @@ -14,7 +14,7 @@ test('parse args', function (t) { ); t.end(); }); - + test('comprehensive', function (t) { t.deepEqual( parse([ @@ -80,13 +80,13 @@ test('flag boolean value', function (t) { boolean: [ 't', 'verbose' ], default: { verbose: true } }); - + t.deepEqual(argv, { verbose: false, t: true, _: ['moo'] }); - + t.deepEqual(typeof argv.verbose, 'boolean'); t.deepEqual(typeof argv.t, 'boolean'); t.end(); @@ -97,13 +97,13 @@ test('flag boolean default false', function (t) { boolean: ['t', 'verbose'], default: { verbose: false, t: false } }); - + t.deepEqual(argv, { verbose: false, t: false, _: ['moo'] }); - + t.deepEqual(typeof argv.verbose, 'boolean'); t.deepEqual(typeof argv.t, 'boolean'); t.end(); @@ -114,14 +114,14 @@ test('boolean groups', function (t) { var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], { boolean: ['x','y','z'] }); - + t.deepEqual(argv, { x : true, y : false, z : true, _ : [ 'one', 'two', 'three' ] }); - + t.deepEqual(typeof argv.x, 'boolean'); t.deepEqual(typeof argv.y, 'boolean'); t.deepEqual(typeof argv.z, 'boolean'); @@ -131,7 +131,7 @@ test('boolean groups', function (t) { test('newlines in params' , function (t) { var args = parse([ '-s', "X\nX" ]) t.deepEqual(args, { _ : [], s : "X\nX" }); - + // reproduce in bash: // VALUE="new // line" @@ -145,7 +145,7 @@ test('strings' , function (t) { var s = parse([ '-s', '0001234' ], { string: 's' }).s; t.equal(s, '0001234'); t.equal(typeof s, 'string'); - + var x = parse([ '-x', '56' ], { string: 'x' }).x; t.equal(x, '56'); t.equal(typeof x, 'string'); @@ -222,7 +222,7 @@ test('nested dotted objects', function (t) { '--foo.quux.quibble', '5', '--foo.quux.o_O', '--beep.boop' ]); - + t.same(argv.foo, { bar : 3, baz : 4, @@ -254,9 +254,9 @@ test('boolean and alias with chainable api', function (t) { h: true, '_': [ 'derp' ] }; - + t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); + t.same(propertyArgv, expected); t.end(); }); @@ -295,7 +295,7 @@ test('boolean and alias using explicit true', function (t) { }; t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); + t.same(propertyArgv, expected); t.end(); }); @@ -311,7 +311,7 @@ test('boolean and --x=true', function(t) { parsed = parse(['--boool', '--other=false'], { boolean: 'boool' }); - + t.same(parsed.boool, true); t.same(parsed.other, 'false'); t.end(); diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js index 21851b036ee6d9..7c4c2abe397797 100644 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js +++ b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js @@ -3,7 +3,7 @@ var test = require('tape'); test('parse with modifier functions' , function (t) { t.plan(1); - + var argv = parse([ '-b', '123' ], { boolean: 'b' }); t.deepEqual(argv, { b: true, _: ['123'] }); }); diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/short.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/short.js index d513a1c2529095..ac18880f1eb50c 100644 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/short.js +++ b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/short.js @@ -43,7 +43,7 @@ test('short', function (t) { ); t.end(); }); - + test('mixed short bool and capture', function (t) { t.same( parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), @@ -54,7 +54,7 @@ test('mixed short bool and capture', function (t) { ); t.end(); }); - + test('short and long', function (t) { t.deepEqual( parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), diff --git a/deps/npm/node_modules/mkdirp/package.json b/deps/npm/node_modules/mkdirp/package.json index 24411034800529..8f46140d7fc5d3 100644 --- a/deps/npm/node_modules/mkdirp/package.json +++ b/deps/npm/node_modules/mkdirp/package.json @@ -30,30 +30,14 @@ "mkdirp": "bin/cmd.js" }, "license": "MIT", - "gitHead": "d4eff0f06093aed4f387e88e9fc301cb76beedc7", + "readme": "# mkdirp\n\nLike `mkdir -p`, but in node.js!\n\n[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)\n\n# example\n\n## pow.js\n\n```js\nvar mkdirp = require('mkdirp');\n \nmkdirp('/tmp/foo/bar/baz', function (err) {\n if (err) console.error(err)\n else console.log('pow!')\n});\n```\n\nOutput\n\n```\npow!\n```\n\nAnd now /tmp/foo/bar/baz exists, huzzah!\n\n# methods\n\n```js\nvar mkdirp = require('mkdirp');\n```\n\n## mkdirp(dir, opts, cb)\n\nCreate a new directory and any necessary subdirectories at `dir` with octal\npermission string `opts.mode`. If `opts` is a non-object, it will be treated as\nthe `opts.mode`.\n\nIf `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\n`cb(err, made)` fires with the error or the first directory `made`\nthat had to be created, if any.\n\nYou can optionally pass in an alternate `fs` implementation by passing in\n`opts.fs`. Your implementation should have `opts.fs.mkdir(path, mode, cb)` and\n`opts.fs.stat(path, cb)`.\n\n## mkdirp.sync(dir, opts)\n\nSynchronously create a new directory and any necessary subdirectories at `dir`\nwith octal permission string `opts.mode`. If `opts` is a non-object, it will be\ntreated as the `opts.mode`.\n\nIf `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\nReturns the first directory that had to be created, if any.\n\nYou can optionally pass in an alternate `fs` implementation by passing in\n`opts.fs`. Your implementation should have `opts.fs.mkdirSync(path, mode)` and\n`opts.fs.statSync(path)`.\n\n# usage\n\nThis package also ships with a `mkdirp` command.\n\n```\nusage: mkdirp [DIR1,DIR2..] {OPTIONS}\n\n Create each supplied directory including any necessary parent directories that\n don't yet exist.\n \n If the directory already exists, do nothing.\n\nOPTIONS are:\n\n -m, --mode If a directory needs to be created, set the mode as an octal\n permission string.\n\n```\n\n# install\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install mkdirp\n```\n\nto get the library, or\n\n```\nnpm install -g mkdirp\n```\n\nto get the command.\n\n# license\n\nMIT\n", + "readmeFilename": "readme.markdown", "bugs": { "url": "https://github.com/substack/node-mkdirp/issues" }, "homepage": "https://github.com/substack/node-mkdirp#readme", "_id": "mkdirp@0.5.1", "_shasum": "30057438eac6cf7f8c4767f38648d6697d75c903", - "_from": "mkdirp@>=0.5.1 <0.6.0", - "_npmVersion": "2.9.0", - "_nodeVersion": "2.0.0", - "_npmUser": { - "name": "substack", - "email": "substack@gmail.com" - }, - "dist": { - "shasum": "30057438eac6cf7f8c4767f38648d6697d75c903", - "tarball": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz" + "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "_from": "mkdirp@>=0.5.1 <0.6.0" } diff --git a/deps/npm/node_modules/node-gyp/CHANGELOG.md b/deps/npm/node_modules/node-gyp/CHANGELOG.md index 4c8cc367814497..089ee84a4d7dbc 100644 --- a/deps/npm/node_modules/node-gyp/CHANGELOG.md +++ b/deps/npm/node_modules/node-gyp/CHANGELOG.md @@ -1,3 +1,36 @@ +v3.3.0 2016-02-16 + +* [[`818d854a4d`](https://github.com/nodejs/node-gyp/commit/818d854a4d)] - Introduce NODEJS_ORG_MIRROR and IOJS_ORG_MIRROR (Rod Vagg) [#878](https://github.com/nodejs/node-gyp/pull/878) +* [[`d1e4cc4b62`](https://github.com/nodejs/node-gyp/commit/d1e4cc4b62)] - **(SEMVER-MINOR)** Download headers tarball for ~0.12.10 || ~0.10.42 (Rod Vagg) [#877](https://github.com/nodejs/node-gyp/pull/877) +* [[`6e28ad1bea`](https://github.com/nodejs/node-gyp/commit/6e28ad1bea)] - Allow for npmlog@2.x (Rebecca Turner) [#861](https://github.com/nodejs/node-gyp/pull/861) +* [[`07371e5812`](https://github.com/nodejs/node-gyp/commit/07371e5812)] - Use -fPIC for NetBSD. (Marcin Cieślak) [#856](https://github.com/nodejs/node-gyp/pull/856) +* [[`8c4b0ffa50`](https://github.com/nodejs/node-gyp/commit/8c4b0ffa50)] - **(SEMVER-MINOR)** Add --cafile command line option. (Ben Noordhuis) [#837](https://github.com/nodejs/node-gyp/pull/837) +* [[`b3ad43498e`](https://github.com/nodejs/node-gyp/commit/b3ad43498e)] - **(SEMVER-MINOR)** Make download() function testable. (Ben Noordhuis) [#837](https://github.com/nodejs/node-gyp/pull/837) + +v3.2.1 2015-12-03 + +* [[`ab89b477c4`](https://github.com/nodejs/node-gyp/commit/ab89b477c4)] - Upgrade gyp to b3cef02. (Ben Noordhuis) [#831](https://github.com/nodejs/node-gyp/pull/831) +* [[`90078ecb17`](https://github.com/nodejs/node-gyp/commit/90078ecb17)] - Define WIN32_LEAN_AND_MEAN conditionally. (Ben Noordhuis) [#824](https://github.com/nodejs/node-gyp/pull/824) + +v3.2.0 2015-11-25 + +* [[`268f1ca4c7`](https://github.com/nodejs/node-gyp/commit/268f1ca4c7)] - Use result of `which` when searching for python. (Refael Ackermann) [#668](https://github.com/nodejs/node-gyp/pull/668) +* [[`817ed9bd78`](https://github.com/nodejs/node-gyp/commit/817ed9bd78)] - Add test for python executable search logic. (Ben Noordhuis) [#756](https://github.com/nodejs/node-gyp/pull/756) +* [[`0e2dfda1f3`](https://github.com/nodejs/node-gyp/commit/0e2dfda1f3)] - Fix test/test-options when run through `npm test`. (Ben Noordhuis) [#755](https://github.com/nodejs/node-gyp/pull/755) +* [[`9bfa0876b4`](https://github.com/nodejs/node-gyp/commit/9bfa0876b4)] - Add support for AIX (Michael Dawson) [#753](https://github.com/nodejs/node-gyp/pull/753) +* [[`a8d441a0a2`](https://github.com/nodejs/node-gyp/commit/a8d441a0a2)] - Update README for Windows 10 support. (Jason Williams) [#766](https://github.com/nodejs/node-gyp/pull/766) +* [[`d1d6015276`](https://github.com/nodejs/node-gyp/commit/d1d6015276)] - Update broken links and switch to HTTPS. (andrew morton) + +v3.1.0 2015-11-14 + +* [[`9049241f91`](https://github.com/nodejs/node-gyp/commit/9049241f91)] - **gyp**: don't use links at all, just copy the files instead (Nathan Zadoks) +* [[`8ef90348d1`](https://github.com/nodejs/node-gyp/commit/8ef90348d1)] - **gyp**: apply https://codereview.chromium.org/11361103/ (Nathan Rajlich) +* [[`a2ed0df84e`](https://github.com/nodejs/node-gyp/commit/a2ed0df84e)] - **gyp**: always install into $PRODUCT_DIR (Nathan Rajlich) +* [[`cc8b2fa83e`](https://github.com/nodejs/node-gyp/commit/cc8b2fa83e)] - Update gyp to b3cef02. (Imran Iqbal) [#781](https://github.com/nodejs/node-gyp/pull/781) +* [[`f5d86eb84e`](https://github.com/nodejs/node-gyp/commit/f5d86eb84e)] - Update to tar@2.0.0. (Edgar Muentes) [#797](https://github.com/nodejs/node-gyp/pull/797) +* [[`2ac7de02c4`](https://github.com/nodejs/node-gyp/commit/2ac7de02c4)] - Fix infinite loop with zero-length options. (Ben Noordhuis) [#745](https://github.com/nodejs/node-gyp/pull/745) +* [[`101bed639b`](https://github.com/nodejs/node-gyp/commit/101bed639b)] - This platform value came from debian package, and now the value (Jérémy Lal) [#738](https://github.com/nodejs/node-gyp/pull/738) + v3.0.3 2015-09-14 * [[`ad827cda30`](https://github.com/nodejs/node-gyp/commit/ad827cda30)] - tarballUrl global and && when checking for iojs (Lars-Magnus Skog) [#729](https://github.com/nodejs/node-gyp/pull/729) diff --git a/deps/npm/node_modules/node-gyp/README.md b/deps/npm/node_modules/node-gyp/README.md index 779dc6adc2713b..dec739f16fde99 100644 --- a/deps/npm/node_modules/node-gyp/README.md +++ b/deps/npm/node_modules/node-gyp/README.md @@ -38,11 +38,11 @@ You will also need to install: * A proper C/C++ compiler toolchain, like [GCC](https://gcc.gnu.org) * On Mac OS X: * `python` (`v2.7` recommended, `v3.x.x` is __*not*__ supported) (already installed on Mac OS X) - * [Xcode](https://developer.apple.com/xcode/downloads/) + * [Xcode](https://developer.apple.com/xcode/download/) * You also need to install the `Command Line Tools` via Xcode. You can find this under the menu `Xcode -> Preferences -> Downloads` * This step will install `gcc` and the related toolchain containing `make` * On Windows: - * [Python][windows-python] ([`v2.7.3`][windows-python-v2.7.3] recommended, `v3.x.x` is __*not*__ supported) + * Python ([`v2.7.10`][python-v2.7.10] recommended, `v3.x.x` is __*not*__ supported) * Make sure that you have a PYTHON environment variable, and it is set to drive:\path\to\python.exe not to a folder * Windows XP/Vista/7: * Microsoft Visual Studio C++ 2013 ([Express][msvc2013] version works well) @@ -50,6 +50,14 @@ You will also need to install: * If you get errors that the 64-bit compilers are not installed you may also need the [compiler update for the Windows SDK 7.1] * Windows 7/8: * Microsoft Visual Studio C++ 2013 for Windows Desktop ([Express][msvc2013] version works well) + * Windows 10: + * Install the latest version of npm (3.3.6 at the time of writing) + * Install Python 2.7 from https://www.python.org/download/releases/2.7/ and make sure its on the System Path + * Install Visual Studio Community 2015 Edition. (Custom Install, Select Visual C++ during the installation) + * Set the environment variable GYP_MSVS_VERSION=2015 + * Run the command prompt as Administrator + * $ npm install (--msvs_version=2015) <-- Shouldn't be needed if you have set GYP_MSVS_VERSION env + * If the above steps have not worked or you are unsure please visit http://www.serverpals.com/blog/building-using-node-gyp-with-visual-studio-express-2015-on-windows-10-pro-x64 for a full walkthrough * All Windows Versions * For 64-bit builds of node and native modules you will _**also**_ need the [Windows 7 64-bit SDK][win7sdk] * You may need to run one of the following commands if your build complains about WindowsSDKDir not being set, and you are sure you have already installed the SDK: @@ -136,9 +144,9 @@ A barebones `gyp` file appropriate for building a node addon looks like: Some additional resources for addons and writing `gyp` files: * ["Going Native" a nodeschool.io tutorial](http://nodeschool.io/#goingnative) - * ["Hello World" node addon example](https://github.com/joyent/node/tree/master/test/addons/hello-world) - * [gyp user documentation](https://chromium.googlesource.com/external/gyp/+/master/docs/UserDocumentation.md) - * [gyp input format reference](https://chromium.googlesource.com/external/gyp/+/master/docs/InputFormatReference.md) + * ["Hello World" node addon example](https://github.com/nodejs/node/tree/master/test/addons/hello-world) + * [gyp user documentation](https://gyp.gsrc.io/docs/UserDocumentation.md) + * [gyp input format reference](https://gyp.gsrc.io/docs/InputFormatReference.md) * [*"binding.gyp" files out in the wild* wiki page](https://github.com/nodejs/node-gyp/wiki/%22binding.gyp%22-files-out-in-the-wild) @@ -185,8 +193,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -[windows-python]: http://www.python.org/getit/windows -[windows-python-v2.7.3]: http://www.python.org/download/releases/2.7.3#download -[msvc2013]: http://www.microsoft.com/en-gb/download/details.aspx?id=44914 -[win7sdk]: http://www.microsoft.com/en-us/download/details.aspx?id=8279 -[compiler update for the Windows SDK 7.1]: http://www.microsoft.com/en-us/download/details.aspx?id=4422 +[python-v2.7.10]: https://www.python.org/downloads/release/python-2710/ +[msvc2013]: https://www.microsoft.com/en-gb/download/details.aspx?id=44914 +[win7sdk]: https://www.microsoft.com/en-us/download/details.aspx?id=8279 +[compiler update for the Windows SDK 7.1]: https://www.microsoft.com/en-us/download/details.aspx?id=4422 diff --git a/deps/npm/node_modules/node-gyp/addon.gypi b/deps/npm/node_modules/node-gyp/addon.gypi index 510b00c713f55c..552e4748d3b7e7 100644 --- a/deps/npm/node_modules/node-gyp/addon.gypi +++ b/deps/npm/node_modules/node-gyp/addon.gypi @@ -65,6 +65,11 @@ 'DYLIB_INSTALL_NAME_BASE': '@rpath' }, }], + [ 'OS=="aix"', { + 'ldflags': [ + '-Wl,-bimport:<(node_exp_file)' + ], + }], [ 'OS=="win"', { 'libraries': [ '-lkernel32.lib', @@ -94,7 +99,8 @@ '_FILE_OFFSET_BITS=64' ], }], - [ 'OS=="freebsd" or OS=="openbsd" or OS=="solaris" or (OS=="linux" and target_arch!="ia32")', { + [ 'OS in "freebsd openbsd netbsd solaris" or \ + (OS=="linux" and target_arch!="ia32")', { 'cflags': [ '-fPIC' ], }] ] diff --git a/deps/npm/node_modules/node-gyp/gyp/AUTHORS b/deps/npm/node_modules/node-gyp/gyp/AUTHORS index 9389ca0a23e48f..fecf84a1c4d72a 100644 --- a/deps/npm/node_modules/node-gyp/gyp/AUTHORS +++ b/deps/npm/node_modules/node-gyp/gyp/AUTHORS @@ -9,3 +9,4 @@ Steven Knight Ryan Norton David J. Sankel Eric N. Vander Weele +Tom Freudenberg diff --git a/deps/npm/node_modules/node-gyp/gyp/PRESUBMIT.py b/deps/npm/node_modules/node-gyp/gyp/PRESUBMIT.py index abec27b3e33120..dde025383c3276 100644 --- a/deps/npm/node_modules/node-gyp/gyp/PRESUBMIT.py +++ b/deps/npm/node_modules/node-gyp/gyp/PRESUBMIT.py @@ -125,15 +125,13 @@ def CheckChangeOnCommit(input_api, output_api): TRYBOTS = [ - 'gyp-win32', - 'gyp-win64', - 'gyp-linux', - 'gyp-mac', - 'gyp-android' + 'linux_try', + 'mac_try', + 'win_try', ] def GetPreferredTryMasters(_, change): return { - 'tryserver.nacl': { t: set(['defaulttests']) for t in TRYBOTS }, + 'client.gyp': { t: set(['defaulttests']) for t in TRYBOTS }, } diff --git a/deps/npm/node_modules/node-gyp/gyp/buildbot/buildbot_run.py b/deps/npm/node_modules/node-gyp/gyp/buildbot/buildbot_run.py index f46ab1822fe321..9a2b71f1b355cf 100755 --- a/deps/npm/node_modules/node-gyp/gyp/buildbot/buildbot_run.py +++ b/deps/npm/node_modules/node-gyp/gyp/buildbot/buildbot_run.py @@ -3,27 +3,17 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. - """Argument-less script to select what to run on the buildbots.""" - -import filecmp import os import shutil import subprocess import sys -if sys.platform in ['win32', 'cygwin']: - EXE_SUFFIX = '.exe' -else: - EXE_SUFFIX = '' - - BUILDBOT_DIR = os.path.dirname(os.path.abspath(__file__)) TRUNK_DIR = os.path.dirname(BUILDBOT_DIR) ROOT_DIR = os.path.dirname(TRUNK_DIR) -ANDROID_DIR = os.path.join(ROOT_DIR, 'android') CMAKE_DIR = os.path.join(ROOT_DIR, 'cmake') CMAKE_BIN_DIR = os.path.join(CMAKE_DIR, 'bin') OUT_DIR = os.path.join(TRUNK_DIR, 'out') @@ -71,95 +61,6 @@ def PrepareCmake(): CallSubProcess( ['make', 'cmake'], cwd=CMAKE_DIR) -_ANDROID_SETUP = 'source build/envsetup.sh && lunch full-eng' - - -def PrepareAndroidTree(): - """Prepare an Android tree to run 'android' format tests.""" - if os.environ['BUILDBOT_CLOBBER'] == '1': - print '@@@BUILD_STEP Clobber Android checkout@@@' - shutil.rmtree(ANDROID_DIR) - - # (Re)create the directory so that the following steps will succeed. - if not os.path.isdir(ANDROID_DIR): - os.mkdir(ANDROID_DIR) - - # We use a manifest from the gyp project listing pinned revisions of AOSP to - # use, to ensure that we test against a stable target. This needs to be - # updated to pick up new build system changes sometimes, so we must test if - # it has changed. - manifest_filename = 'aosp_manifest.xml' - gyp_manifest = os.path.join(BUILDBOT_DIR, manifest_filename) - android_manifest = os.path.join(ANDROID_DIR, '.repo', 'manifests', - manifest_filename) - manifest_is_current = (os.path.isfile(android_manifest) and - filecmp.cmp(gyp_manifest, android_manifest)) - if not manifest_is_current: - # It's safe to repeat these steps, so just do them again to make sure we are - # in a good state. - print '@@@BUILD_STEP Initialize Android checkout@@@' - CallSubProcess( - ['repo', 'init', - '-u', 'https://android.googlesource.com/platform/manifest', - '-b', 'master', - '-g', 'all,-notdefault,-device,-darwin,-mips,-x86'], - cwd=ANDROID_DIR) - shutil.copy(gyp_manifest, android_manifest) - - print '@@@BUILD_STEP Sync Android@@@' - CallSubProcess(['repo', 'sync', '-j4', '-m', manifest_filename], - cwd=ANDROID_DIR) - - # If we already built the system image successfully and didn't sync to a new - # version of the source, skip running the build again as it's expensive even - # when there's nothing to do. - system_img = os.path.join(ANDROID_DIR, 'out', 'target', 'product', 'generic', - 'system.img') - if manifest_is_current and os.path.isfile(system_img): - return - - print '@@@BUILD_STEP Build Android@@@' - CallSubProcess( - ['/bin/bash', - '-c', '%s && make -j4' % _ANDROID_SETUP], - cwd=ANDROID_DIR) - - -def StartAndroidEmulator(): - """Start an android emulator from the built android tree.""" - print '@@@BUILD_STEP Start Android emulator@@@' - - CallSubProcess(['/bin/bash', '-c', - '%s && adb kill-server ' % _ANDROID_SETUP], - cwd=ANDROID_DIR) - - # If taskset is available, use it to force adbd to run only on one core, as, - # sadly, it improves its reliability (see crbug.com/268450). - adbd_wrapper = '' - with open(os.devnull, 'w') as devnull_fd: - if subprocess.call(['which', 'taskset'], stdout=devnull_fd) == 0: - adbd_wrapper = 'taskset -c 0' - CallSubProcess(['/bin/bash', '-c', - '%s && %s adb start-server ' % (_ANDROID_SETUP, adbd_wrapper)], - cwd=ANDROID_DIR) - - subprocess.Popen( - ['/bin/bash', '-c', - '%s && emulator -no-window' % _ANDROID_SETUP], - cwd=ANDROID_DIR) - CallSubProcess( - ['/bin/bash', '-c', - '%s && adb wait-for-device' % _ANDROID_SETUP], - cwd=ANDROID_DIR) - - -def StopAndroidEmulator(): - """Stop all android emulators.""" - print '@@@BUILD_STEP Stop Android emulator@@@' - # If this fails, it's because there is no emulator running. - subprocess.call(['pkill', 'emulator.*']) - - def GypTestFormat(title, format=None, msvs_version=None, tests=[]): """Run the gyp tests for a given format, emitting annotator tags. @@ -185,15 +86,7 @@ def GypTestFormat(title, format=None, msvs_version=None, tests=[]): '--format', format, '--path', CMAKE_BIN_DIR, '--chdir', 'gyp'] + tests) - if format == 'android': - # gyptest needs the environment setup from envsetup/lunch in order to build - # using the 'android' backend, so this is done in a single shell. - retcode = subprocess.call( - ['/bin/bash', - '-c', '%s && cd %s && %s' % (_ANDROID_SETUP, ROOT_DIR, command)], - cwd=ANDROID_DIR, env=env) - else: - retcode = subprocess.call(command, cwd=ROOT_DIR, env=env, shell=True) + retcode = subprocess.call(command, cwd=ROOT_DIR, env=env, shell=True) if retcode: # Emit failure tag, and keep going. print '@@@STEP_FAILURE@@@' @@ -209,15 +102,7 @@ def GypBuild(): print 'Done.' retcode = 0 - # The Android gyp bot runs on linux so this must be tested first. - if os.environ['BUILDBOT_BUILDERNAME'] == 'gyp-android': - PrepareAndroidTree() - StartAndroidEmulator() - try: - retcode += GypTestFormat('android') - finally: - StopAndroidEmulator() - elif sys.platform.startswith('linux'): + if sys.platform.startswith('linux'): retcode += GypTestFormat('ninja') retcode += GypTestFormat('make') PrepareCmake() diff --git a/deps/npm/node_modules/node-gyp/gyp/buildbot/commit_queue/cq_config.json b/deps/npm/node_modules/node-gyp/gyp/buildbot/commit_queue/cq_config.json index bbf20e394f3bb6..656c21e54fb12f 100644 --- a/deps/npm/node_modules/node-gyp/gyp/buildbot/commit_queue/cq_config.json +++ b/deps/npm/node_modules/node-gyp/gyp/buildbot/commit_queue/cq_config.json @@ -3,7 +3,6 @@ "launched": { "tryserver.nacl": { "gyp-presubmit": ["defaulttests"], - "gyp-android": ["defaulttests"], "gyp-linux": ["defaulttests"], "gyp-mac": ["defaulttests"], "gyp-win32": ["defaulttests"], diff --git a/deps/npm/node_modules/node-gyp/gyp/gyp_main.py b/deps/npm/node_modules/node-gyp/gyp/gyp_main.py index 4ec872f0f95aa3..25a6eba94aae7d 100755 --- a/deps/npm/node_modules/node-gyp/gyp/gyp_main.py +++ b/deps/npm/node_modules/node-gyp/gyp/gyp_main.py @@ -4,15 +4,13 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import os import sys -# TODO(mark): sys.path manipulation is some temporary testing stuff. -try: - import gyp -except ImportError, e: - import os.path - sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), 'pylib')) - import gyp +# Make sure we're using the version of pylib in this repo, not one installed +# elsewhere on the system. +sys.path.insert(0, os.path.join(os.path.dirname(sys.argv[0]), 'pylib')) +import gyp if __name__ == '__main__': sys.exit(gyp.script_main()) diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py index dde0e07092b167..4985756bdde76a 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py @@ -708,10 +708,7 @@ def _ValidateSettings(validators, settings, stderr): _MSBuildOnly(_compile, 'BuildingInIDE', _boolean) _MSBuildOnly(_compile, 'CompileAsManaged', _Enumeration([], new=['false', - 'true', # /clr - 'Pure', # /clr:pure - 'Safe', # /clr:safe - 'OldSyntax'])) # /clr:oldSyntax + 'true'])) # /clr _MSBuildOnly(_compile, 'CreateHotpatchableImage', _boolean) # /hotpatch _MSBuildOnly(_compile, 'MultiProcessorCompilation', _boolean) # /MP _MSBuildOnly(_compile, 'PreprocessOutputPath', _string) # /Fi diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py index d24dcac4d5e13e..bf6ea6b802ff91 100755 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py @@ -296,7 +296,7 @@ def testValidateMSBuildSettings_settings(self): 'BuildingInIDE': 'true', 'CallingConvention': 'Cdecl', 'CompileAs': 'CompileAsC', - 'CompileAsManaged': 'Pure', + 'CompileAsManaged': 'true', 'CreateHotpatchableImage': 'true', 'DebugInformationFormat': 'ProgramDatabase', 'DisableLanguageExtensions': 'true', diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py index 92e583fd6e27c7..d9bfa684fa30c2 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py @@ -84,10 +84,11 @@ def SetupScript(self, target_arch): # vcvars32, which it can only find if VS??COMNTOOLS is set, which it # isn't always. if target_arch == 'x86': - if self.short_name == '2013' and ( + if self.short_name >= '2013' and self.short_name[-1] != 'e' and ( os.environ.get('PROCESSOR_ARCHITECTURE') == 'AMD64' or os.environ.get('PROCESSOR_ARCHITEW6432') == 'AMD64'): - # VS2013 non-Express has a x64-x86 cross that we want to prefer. + # VS2013 and later, non-Express have a x64-x86 cross that we want + # to prefer. return [os.path.normpath( os.path.join(self.path, 'VC/vcvarsall.bat')), 'amd64_x86'] # Otherwise, the standard x86 compiler. diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py index ac6d918b849922..668f38b60d0093 100755 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py @@ -49,7 +49,7 @@ def FindBuildFiles(): def Load(build_files, format, default_variables={}, includes=[], depth='.', params=None, check=False, - circular_check=True): + circular_check=True, duplicate_basename_check=True): """ Loads one or more specified build files. default_variables and includes will be copied before use. @@ -126,6 +126,7 @@ def Load(build_files, format, default_variables={}, # Process the input specific to this generator. result = gyp.input.Load(build_files, default_variables, includes[:], depth, generator_input_info, check, circular_check, + duplicate_basename_check, params['parallel'], params['root_targets']) return [generator] + result @@ -324,6 +325,16 @@ def gyp_main(args): parser.add_option('--no-circular-check', dest='circular_check', action='store_false', default=True, regenerate=False, help="don't check for circular relationships between files") + # --no-duplicate-basename-check disables the check for duplicate basenames + # in a static_library/shared_library project. Visual C++ 2008 generator + # doesn't support this configuration. Libtool on Mac also generates warnings + # when duplicate basenames are passed into Make generator on Mac. + # TODO(yukawa): Remove this option when these legacy generators are + # deprecated. + parser.add_option('--no-duplicate-basename-check', + dest='duplicate_basename_check', action='store_false', + default=True, regenerate=False, + help="don't check for duplicate basenames") parser.add_option('--no-parallel', action='store_true', default=False, help='Disable multiprocessing') parser.add_option('-S', '--suffix', dest='suffix', default='', @@ -499,7 +510,8 @@ def gyp_main(args): # Start with the default variables from the command line. [generator, flat_list, targets, data] = Load( build_files, format, cmdline_default_variables, includes, options.depth, - params, options.check, options.circular_check) + params, options.check, options.circular_check, + options.duplicate_basename_check) # TODO(mark): Pass |data| for now because the generator needs a list of # build files that came in. In the future, maybe it should just accept diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py index b6875e43efcbc4..256e3f3a6b2400 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/common.py @@ -131,13 +131,20 @@ def QualifiedTarget(build_file, target, toolset): @memoize -def RelativePath(path, relative_to): +def RelativePath(path, relative_to, follow_path_symlink=True): # Assuming both |path| and |relative_to| are relative to the current # directory, returns a relative path that identifies path relative to # relative_to. + # If |follow_symlink_path| is true (default) and |path| is a symlink, then + # this method returns a path to the real file represented by |path|. If it is + # false, this method returns a path to the symlink. If |path| is not a + # symlink, this option has no effect. # Convert to normalized (and therefore absolute paths). - path = os.path.realpath(path) + if follow_path_symlink: + path = os.path.realpath(path) + else: + path = os.path.abspath(path) relative_to = os.path.realpath(relative_to) # On Windows, we can't create a relative path to a different drive, so just @@ -418,6 +425,8 @@ def GetFlavor(params): return 'freebsd' if sys.platform.startswith('openbsd'): return 'openbsd' + if sys.platform.startswith('netbsd'): + return 'netbsd' if sys.platform.startswith('aix'): return 'aix' diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py index 15b80ef973793c..921c1a6b714328 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py @@ -7,23 +7,59 @@ the generator flag config_path) the path of a json file that dictates the files and targets to search for. The following keys are supported: files: list of paths (relative) of the files to search for. -targets: list of targets to search for. The target names are unqualified. +test_targets: unqualified target names to search for. Any target in this list +that depends upon a file in |files| is output regardless of the type of target +or chain of dependencies. +additional_compile_targets: Unqualified targets to search for in addition to +test_targets. Targets in the combined list that depend upon a file in |files| +are not necessarily output. For example, if the target is of type none then the +target is not output (but one of the descendants of the target will be). The following is output: error: only supplied if there is an error. -targets: the set of targets passed in via targets that either directly or - indirectly depend upon the set of paths supplied in files. -build_targets: minimal set of targets that directly depend on the changed - files and need to be built. The expectation is this set of targets is passed - into a build step. +compile_targets: minimal set of targets that directly or indirectly (for + targets of type none) depend on the files in |files| and is one of the + supplied targets or a target that one of the supplied targets depends on. + The expectation is this set of targets is passed into a build step. This list + always contains the output of test_targets as well. +test_targets: set of targets from the supplied |test_targets| that either + directly or indirectly depend upon a file in |files|. This list if useful + if additional processing needs to be done for certain targets after the + build, such as running tests. status: outputs one of three values: none of the supplied files were found, one of the include files changed so that it should be assumed everything - changed (in this case targets and build_targets are not output) or at + changed (in this case test_targets and compile_targets are not output) or at least one file was found. -invalid_targets: list of supplied targets thare were not found. +invalid_targets: list of supplied targets that were not found. + +Example: +Consider a graph like the following: + A D + / \ +B C +A depends upon both B and C, A is of type none and B and C are executables. +D is an executable, has no dependencies and nothing depends on it. +If |additional_compile_targets| = ["A"], |test_targets| = ["B", "C"] and +files = ["b.cc", "d.cc"] (B depends upon b.cc and D depends upon d.cc), then +the following is output: +|compile_targets| = ["B"] B must built as it depends upon the changed file b.cc +and the supplied target A depends upon it. A is not output as a build_target +as it is of type none with no rules and actions. +|test_targets| = ["B"] B directly depends upon the change file b.cc. + +Even though the file d.cc, which D depends upon, has changed D is not output +as it was not supplied by way of |additional_compile_targets| or |test_targets|. If the generator flag analyzer_output_path is specified, output is written there. Otherwise output is written to stdout. + +In Gyp the "all" target is shorthand for the root targets in the files passed +to gyp. For example, if file "a.gyp" contains targets "a1" and +"a2", and file "b.gyp" contains targets "b1" and "b2" and "a2" has a dependency +on "b2" and gyp is supplied "a.gyp" then "all" consists of "a1" and "a2". +Notice that "b1" and "b2" are not in the "all" target as "b.gyp" was not +directly supplied to gyp. OTOH if both "a.gyp" and "b.gyp" are supplied to gyp +then the "all" target includes "b1" and "b2". """ import gyp.common @@ -183,7 +219,10 @@ class Target(object): added_to_compile_targets: used when determining if the target was added to the set of targets that needs to be built. in_roots: true if this target is a descendant of one of the root nodes. - is_executable: true if the type of target is executable.""" + is_executable: true if the type of target is executable. + is_static_library: true if the type of target is static_library. + is_or_has_linked_ancestor: true if the target does a link (eg executable), or + if there is a target in back_deps that does a link.""" def __init__(self, name): self.deps = set() self.match_status = MATCH_STATUS_TBD @@ -196,6 +235,8 @@ def __init__(self, name): self.added_to_compile_targets = False self.in_roots = False self.is_executable = False + self.is_static_library = False + self.is_or_has_linked_ancestor = False class Config(object): @@ -205,6 +246,8 @@ class Config(object): def __init__(self): self.files = [] self.targets = set() + self.additional_compile_target_names = set() + self.test_target_names = set() def Init(self, params): """Initializes Config. This is a separate method as it raises an exception @@ -224,7 +267,9 @@ def Init(self, params): if not isinstance(config, dict): raise Exception('config_path must be a JSON file containing a dictionary') self.files = config.get('files', []) - self.targets = set(config.get('targets', [])) + self.additional_compile_target_names = set( + config.get('additional_compile_targets', [])) + self.test_target_names = set(config.get('test_targets', [])) def _WasBuildFileModified(build_file, data, files, toplevel_dir): @@ -266,8 +311,8 @@ def _GetOrCreateTargetByName(targets, target_name): def _DoesTargetTypeRequireBuild(target_dict): """Returns true if the target type is such that it needs to be built.""" # If a 'none' target has rules or actions we assume it requires a build. - return target_dict['type'] != 'none' or \ - target_dict.get('actions') or target_dict.get('rules') + return bool(target_dict['type'] != 'none' or + target_dict.get('actions') or target_dict.get('rules')) def _GenerateTargets(data, target_list, target_dicts, toplevel_dir, files, @@ -275,12 +320,13 @@ def _GenerateTargets(data, target_list, target_dicts, toplevel_dir, files, """Returns a tuple of the following: . A dictionary mapping from fully qualified name to Target. . A list of the targets that have a source file in |files|. - . Set of root Targets reachable from the the files |build_files|. + . Targets that constitute the 'all' target. See description at top of file + for details on the 'all' target. This sets the |match_status| of the targets that contain any of the source files in |files| to MATCH_STATUS_MATCHES. |toplevel_dir| is the root of the source tree.""" # Maps from target name to Target. - targets = {} + name_to_target = {} # Targets that matched. matching_targets = [] @@ -300,7 +346,8 @@ def _GenerateTargets(data, target_list, target_dicts, toplevel_dir, files, while len(targets_to_visit) > 0: target_name = targets_to_visit.pop() - created_target, target = _GetOrCreateTargetByName(targets, target_name) + created_target, target = _GetOrCreateTargetByName(name_to_target, + target_name) if created_target: roots.add(target) elif target.visited: @@ -309,7 +356,11 @@ def _GenerateTargets(data, target_list, target_dicts, toplevel_dir, files, target.visited = True target.requires_build = _DoesTargetTypeRequireBuild( target_dicts[target_name]) - target.is_executable = target_dicts[target_name]['type'] == 'executable' + target_type = target_dicts[target_name]['type'] + target.is_executable = target_type == 'executable' + target.is_static_library = target_type == 'static_library' + target.is_or_has_linked_ancestor = (target_type == 'executable' or + target_type == 'shared_library') build_file = gyp.common.ParseQualifiedTarget(target_name)[0] if not build_file in build_file_in_files: @@ -329,7 +380,7 @@ def _GenerateTargets(data, target_list, target_dicts, toplevel_dir, files, sources = _ExtractSources(target_name, target_dicts[target_name], toplevel_dir) for source in sources: - if source in files: + if _ToGypPath(os.path.normpath(source)) in files: print 'target', target_name, 'matches', source target.match_status = MATCH_STATUS_MATCHES matching_targets.append(target) @@ -339,22 +390,25 @@ def _GenerateTargets(data, target_list, target_dicts, toplevel_dir, files, for dep in target_dicts[target_name].get('dependencies', []): targets_to_visit.append(dep) - created_dep_target, dep_target = _GetOrCreateTargetByName(targets, dep) + created_dep_target, dep_target = _GetOrCreateTargetByName(name_to_target, + dep) if not created_dep_target: roots.discard(dep_target) target.deps.add(dep_target) dep_target.back_deps.add(target) - return targets, matching_targets, roots & build_file_targets + return name_to_target, matching_targets, roots & build_file_targets def _GetUnqualifiedToTargetMapping(all_targets, to_find): - """Returns a mapping (dictionary) from unqualified name to Target for all the - Targets in |to_find|.""" + """Returns a tuple of the following: + . mapping (dictionary) from unqualified name to Target for all the + Targets in |to_find|. + . any target names not found. If this is empty all targets were found.""" result = {} if not to_find: - return result + return {}, [] to_find = set(to_find) for target_name in all_targets.keys(): extracted = gyp.common.ParseQualifiedTarget(target_name) @@ -362,13 +416,14 @@ def _GetUnqualifiedToTargetMapping(all_targets, to_find): to_find.remove(extracted[1]) result[extracted[1]] = all_targets[target_name] if not to_find: - return result - return result + return result, [] + return result, [x for x in to_find] -def _DoesTargetDependOn(target): - """Returns true if |target| or any of its dependencies matches the supplied - set of paths. This updates |matches| of the Targets as it recurses. +def _DoesTargetDependOnMatchingTargets(target): + """Returns true if |target| or any of its dependencies is one of the + targets containing the files supplied as input to analyzer. This updates + |matches| of the Targets as it recurses. target: the Target to look for.""" if target.match_status == MATCH_STATUS_DOESNT_MATCH: return False @@ -376,25 +431,28 @@ def _DoesTargetDependOn(target): target.match_status == MATCH_STATUS_MATCHES_BY_DEPENDENCY: return True for dep in target.deps: - if _DoesTargetDependOn(dep): + if _DoesTargetDependOnMatchingTargets(dep): target.match_status = MATCH_STATUS_MATCHES_BY_DEPENDENCY + print '\t', target.name, 'matches by dep', dep.name return True target.match_status = MATCH_STATUS_DOESNT_MATCH return False -def _GetTargetsDependingOn(possible_targets): +def _GetTargetsDependingOnMatchingTargets(possible_targets): """Returns the list of Targets in |possible_targets| that depend (either - directly on indirectly) on the matched targets. + directly on indirectly) on at least one of the targets containing the files + supplied as input to analyzer. possible_targets: targets to search from.""" found = [] + print 'Targets that matched by dependency:' for target in possible_targets: - if _DoesTargetDependOn(target): + if _DoesTargetDependOnMatchingTargets(target): found.append(target) return found -def _AddBuildTargets(target, roots, add_if_no_ancestor, result): +def _AddCompileTargets(target, roots, add_if_no_ancestor, result): """Recurses through all targets that depend on |target|, adding all targets that need to be built (and are in |roots|) to |result|. roots: set of root targets. @@ -405,31 +463,45 @@ def _AddBuildTargets(target, roots, add_if_no_ancestor, result): return target.visited = True - target.in_roots = not target.back_deps and target in roots + target.in_roots = target in roots for back_dep_target in target.back_deps: - _AddBuildTargets(back_dep_target, roots, False, result) + _AddCompileTargets(back_dep_target, roots, False, result) target.added_to_compile_targets |= back_dep_target.added_to_compile_targets target.in_roots |= back_dep_target.in_roots + target.is_or_has_linked_ancestor |= ( + back_dep_target.is_or_has_linked_ancestor) # Always add 'executable' targets. Even though they may be built by other # targets that depend upon them it makes detection of what is going to be # built easier. + # And always add static_libraries that have no dependencies on them from + # linkables. This is necessary as the other dependencies on them may be + # static libraries themselves, which are not compile time dependencies. if target.in_roots and \ (target.is_executable or (not target.added_to_compile_targets and - (add_if_no_ancestor or target.requires_build))): + (add_if_no_ancestor or target.requires_build)) or + (target.is_static_library and add_if_no_ancestor and + not target.is_or_has_linked_ancestor)): + print '\t\tadding to compile targets', target.name, 'executable', \ + target.is_executable, 'added_to_compile_targets', \ + target.added_to_compile_targets, 'add_if_no_ancestor', \ + add_if_no_ancestor, 'requires_build', target.requires_build, \ + 'is_static_library', target.is_static_library, \ + 'is_or_has_linked_ancestor', target.is_or_has_linked_ancestor result.add(target) target.added_to_compile_targets = True -def _GetBuildTargets(matching_targets, roots): +def _GetCompileTargets(matching_targets, supplied_targets): """Returns the set of Targets that require a build. matching_targets: targets that changed and need to be built. - roots: set of root targets in the build files to search from.""" + supplied_targets: set of targets supplied to analyzer to search from.""" result = set() for target in matching_targets: - _AddBuildTargets(target, roots, True, result) + print 'finding compile targets for match', target.name + _AddCompileTargets(target, supplied_targets, True, result) return result @@ -454,6 +526,16 @@ def _WriteOutput(params, **values): print 'Targets that require a build:' for target in values['build_targets']: print '\t', target + if 'compile_targets' in values: + values['compile_targets'].sort() + print 'Targets that need to be built:' + for target in values['compile_targets']: + print '\t', target + if 'test_targets' in values: + values['test_targets'].sort() + print 'Test targets:' + for target in values['test_targets']: + print '\t', target output_path = params.get('generator_flags', {}).get( 'analyzer_output_path', None) @@ -473,7 +555,7 @@ def _WasGypIncludeFileModified(params, files): files.""" if params['options'].includes: for include in params['options'].includes: - if _ToGypPath(include) in files: + if _ToGypPath(os.path.normpath(include)) in files: print 'Include file modified, assuming all changed', include return True return False @@ -513,11 +595,104 @@ def CalculateVariables(default_variables, params): default_variables.setdefault('OS', operating_system) +class TargetCalculator(object): + """Calculates the matching test_targets and matching compile_targets.""" + def __init__(self, files, additional_compile_target_names, test_target_names, + data, target_list, target_dicts, toplevel_dir, build_files): + self._additional_compile_target_names = set(additional_compile_target_names) + self._test_target_names = set(test_target_names) + self._name_to_target, self._changed_targets, self._root_targets = ( + _GenerateTargets(data, target_list, target_dicts, toplevel_dir, + frozenset(files), build_files)) + self._unqualified_mapping, self.invalid_targets = ( + _GetUnqualifiedToTargetMapping(self._name_to_target, + self._supplied_target_names_no_all())) + + def _supplied_target_names(self): + return self._additional_compile_target_names | self._test_target_names + + def _supplied_target_names_no_all(self): + """Returns the supplied test targets without 'all'.""" + result = self._supplied_target_names(); + result.discard('all') + return result + + def is_build_impacted(self): + """Returns true if the supplied files impact the build at all.""" + return self._changed_targets + + def find_matching_test_target_names(self): + """Returns the set of output test targets.""" + assert self.is_build_impacted() + # Find the test targets first. 'all' is special cased to mean all the + # root targets. To deal with all the supplied |test_targets| are expanded + # to include the root targets during lookup. If any of the root targets + # match, we remove it and replace it with 'all'. + test_target_names_no_all = set(self._test_target_names) + test_target_names_no_all.discard('all') + test_targets_no_all = _LookupTargets(test_target_names_no_all, + self._unqualified_mapping) + test_target_names_contains_all = 'all' in self._test_target_names + if test_target_names_contains_all: + test_targets = [x for x in (set(test_targets_no_all) | + set(self._root_targets))] + else: + test_targets = [x for x in test_targets_no_all] + print 'supplied test_targets' + for target_name in self._test_target_names: + print '\t', target_name + print 'found test_targets' + for target in test_targets: + print '\t', target.name + print 'searching for matching test targets' + matching_test_targets = _GetTargetsDependingOnMatchingTargets(test_targets) + matching_test_targets_contains_all = (test_target_names_contains_all and + set(matching_test_targets) & + set(self._root_targets)) + if matching_test_targets_contains_all: + # Remove any of the targets for all that were not explicitly supplied, + # 'all' is subsequentely added to the matching names below. + matching_test_targets = [x for x in (set(matching_test_targets) & + set(test_targets_no_all))] + print 'matched test_targets' + for target in matching_test_targets: + print '\t', target.name + matching_target_names = [gyp.common.ParseQualifiedTarget(target.name)[1] + for target in matching_test_targets] + if matching_test_targets_contains_all: + matching_target_names.append('all') + print '\tall' + return matching_target_names + + def find_matching_compile_target_names(self): + """Returns the set of output compile targets.""" + assert self.is_build_impacted(); + # Compile targets are found by searching up from changed targets. + # Reset the visited status for _GetBuildTargets. + for target in self._name_to_target.itervalues(): + target.visited = False + + supplied_targets = _LookupTargets(self._supplied_target_names_no_all(), + self._unqualified_mapping) + if 'all' in self._supplied_target_names(): + supplied_targets = [x for x in (set(supplied_targets) | + set(self._root_targets))] + print 'Supplied test_targets & compile_targets' + for target in supplied_targets: + print '\t', target.name + print 'Finding compile targets' + compile_targets = _GetCompileTargets(self._changed_targets, + supplied_targets) + return [gyp.common.ParseQualifiedTarget(target.name)[1] + for target in compile_targets] + + def GenerateOutput(target_list, target_dicts, data, params): """Called by gyp as the final stage. Outputs results.""" config = Config() try: config.Init(params) + if not config.files: raise Exception('Must specify files to analyze via config_path generator ' 'flag') @@ -528,41 +703,38 @@ def GenerateOutput(target_list, target_dicts, data, params): if _WasGypIncludeFileModified(params, config.files): result_dict = { 'status': all_changed_string, - 'targets': list(config.targets) } + 'test_targets': list(config.test_target_names), + 'compile_targets': list( + config.additional_compile_target_names | + config.test_target_names) } _WriteOutput(params, **result_dict) return - all_targets, matching_targets, roots = _GenerateTargets( - data, target_list, target_dicts, toplevel_dir, frozenset(config.files), - params['build_files']) - - unqualified_mapping = _GetUnqualifiedToTargetMapping(all_targets, - config.targets) - invalid_targets = None - if len(unqualified_mapping) != len(config.targets): - invalid_targets = _NamesNotIn(config.targets, unqualified_mapping) - - if matching_targets: - search_targets = _LookupTargets(config.targets, unqualified_mapping) - matched_search_targets = _GetTargetsDependingOn(search_targets) - # Reset the visited status for _GetBuildTargets. - for target in all_targets.itervalues(): - target.visited = False - build_targets = _GetBuildTargets(matching_targets, roots) - matched_search_targets = [gyp.common.ParseQualifiedTarget(target.name)[1] - for target in matched_search_targets] - build_targets = [gyp.common.ParseQualifiedTarget(target.name)[1] - for target in build_targets] - else: - matched_search_targets = [] - build_targets = [] - - result_dict = { 'targets': matched_search_targets, - 'status': found_dependency_string if matching_targets else - no_dependency_string, - 'build_targets': build_targets} - if invalid_targets: - result_dict['invalid_targets'] = invalid_targets + calculator = TargetCalculator(config.files, + config.additional_compile_target_names, + config.test_target_names, data, + target_list, target_dicts, toplevel_dir, + params['build_files']) + if not calculator.is_build_impacted(): + result_dict = { 'status': no_dependency_string, + 'test_targets': [], + 'compile_targets': [] } + if calculator.invalid_targets: + result_dict['invalid_targets'] = calculator.invalid_targets + _WriteOutput(params, **result_dict) + return + + test_target_names = calculator.find_matching_test_target_names() + compile_target_names = calculator.find_matching_compile_target_names() + found_at_least_one_target = compile_target_names or test_target_names + result_dict = { 'test_targets': test_target_names, + 'status': found_dependency_string if + found_at_least_one_target else no_dependency_string, + 'compile_targets': list( + set(compile_target_names) | + set(test_target_names)) } + if calculator.invalid_targets: + result_dict['invalid_targets'] = calculator.invalid_targets _WriteOutput(params, **result_dict) except Exception as e: diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py index ad6eff6d17b17d..bb9eb5f4b96775 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py @@ -164,7 +164,7 @@ def Write(self, qualified_target, relative_target, base_path, output_filename, if self.toolset == 'host': self.WriteLn('LOCAL_IS_HOST_MODULE := true') self.WriteLn('LOCAL_MULTILIB := $(GYP_HOST_MULTILIB)') - else: + elif sdk_version > 0: self.WriteLn('LOCAL_MODULE_TARGET_ARCH := ' '$(TARGET_$(GYP_VAR_PREFIX)ARCH)') self.WriteLn('LOCAL_SDK_VERSION := %s' % sdk_version) @@ -965,7 +965,7 @@ def GenerateOutput(target_list, target_dicts, data, params): builddir_name = generator_flags.get('output_dir', 'out') limit_to_target_all = generator_flags.get('limit_to_target_all', False) write_alias_targets = generator_flags.get('write_alias_targets', True) - sdk_version = generator_flags.get('aosp_sdk_version', 19) + sdk_version = generator_flags.get('aosp_sdk_version', 0) android_top_dir = os.environ.get('ANDROID_BUILD_TOP') assert android_top_dir, '$ANDROID_BUILD_TOP not set; you need to run lunch.' diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py index 8f5feddee1cb35..17f5e6396c6303 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py @@ -55,7 +55,7 @@ 'CONFIGURATION_NAME': '${configuration}', } -FULL_PATH_VARS = ('${CMAKE_SOURCE_DIR}', '${builddir}', '${obj}') +FULL_PATH_VARS = ('${CMAKE_CURRENT_LIST_DIR}', '${builddir}', '${obj}') generator_supports_multiple_toolsets = True generator_wants_static_library_dependencies_adjusted = True @@ -103,7 +103,7 @@ def NormjoinPathForceCMakeSource(base_path, rel_path): if any([rel_path.startswith(var) for var in FULL_PATH_VARS]): return rel_path # TODO: do we need to check base_path for absolute variables as well? - return os.path.join('${CMAKE_SOURCE_DIR}', + return os.path.join('${CMAKE_CURRENT_LIST_DIR}', os.path.normpath(os.path.join(base_path, rel_path))) @@ -150,20 +150,17 @@ def SetFileProperty(output, source_name, property_name, values, sep): output.write('")\n') -def SetFilesProperty(output, source_names, property_name, values, sep): +def SetFilesProperty(output, variable, property_name, values, sep): """Given a set of source files, sets the given property on them.""" - output.write('set_source_files_properties(\n') - for source_name in source_names: - output.write(' ') - output.write(source_name) - output.write('\n') - output.write(' PROPERTIES\n ') + output.write('set_source_files_properties(') + WriteVariable(output, variable) + output.write(' PROPERTIES ') output.write(property_name) output.write(' "') for value in values: output.write(CMakeStringEscape(value)) output.write(sep) - output.write('"\n)\n') + output.write('")\n') def SetTargetProperty(output, target_name, property_name, values, sep=''): @@ -236,11 +233,11 @@ def StringToCMakeTargetName(a): """Converts the given string 'a' to a valid CMake target name. All invalid characters are replaced by '_'. - Invalid for cmake: ' ', '/', '(', ')' + Invalid for cmake: ' ', '/', '(', ')', '"' Invalid for make: ':' Invalid for unknown reasons but cause failures: '.' """ - return a.translate(string.maketrans(' /():.', '______')) + return a.translate(string.maketrans(' /():."', '_______')) def WriteActions(target_name, actions, extra_sources, extra_deps, @@ -296,7 +293,7 @@ def WriteActions(target_name, actions, extra_sources, extra_deps, WriteVariable(output, inputs_name) output.write('\n') - output.write(' WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/') + output.write(' WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/') output.write(path_to_gyp) output.write('\n') @@ -401,9 +398,9 @@ def WriteRules(target_name, rules, extra_sources, extra_deps, output.write(NormjoinPath(path_to_gyp, rule_source)) output.write('\n') - # CMAKE_SOURCE_DIR is where the CMakeLists.txt lives. + # CMAKE_CURRENT_LIST_DIR is where the CMakeLists.txt lives. # The cwd is the current build directory. - output.write(' WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/') + output.write(' WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/') output.write(path_to_gyp) output.write('\n') @@ -488,7 +485,7 @@ def __init__(self, ext, command): copy = file_copy if os.path.basename(src) else dir_copy - copy.cmake_inputs.append(NormjoinPath(path_to_gyp, src)) + copy.cmake_inputs.append(NormjoinPathForceCMakeSource(path_to_gyp, src)) copy.cmake_outputs.append(NormjoinPathForceCMakeSource(path_to_gyp, dst)) copy.gyp_inputs.append(src) copy.gyp_outputs.append(dst) @@ -525,7 +522,7 @@ def __init__(self, ext, command): WriteVariable(output, copy.inputs_name, ' ') output.write('\n') - output.write('WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/') + output.write('WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/') output.write(path_to_gyp) output.write('\n') @@ -640,6 +637,12 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use, target_type = spec.get('type', '') target_toolset = spec.get('toolset') + cmake_target_type = cmake_target_type_from_gyp_target_type.get(target_type) + if cmake_target_type is None: + print ('Target %s has unknown target type %s, skipping.' % + ( target_name, target_type ) ) + return + SetVariable(output, 'TARGET', target_name) SetVariable(output, 'TOOLSET', target_toolset) @@ -667,27 +670,89 @@ def WriteTarget(namer, qualified_target, target_dicts, build_dir, config_to_use, srcs = spec.get('sources', []) # Gyp separates the sheep from the goats based on file extensions. - def partition(l, p): - return reduce(lambda x, e: x[not p(e)].append(e) or x, l, ([], [])) - compilable_srcs, other_srcs = partition(srcs, Compilable) + # A full separation is done here because of flag handing (see below). + s_sources = [] + c_sources = [] + cxx_sources = [] + linkable_sources = [] + other_sources = [] + for src in srcs: + _, ext = os.path.splitext(src) + src_type = COMPILABLE_EXTENSIONS.get(ext, None) + src_norm_path = NormjoinPath(path_from_cmakelists_to_gyp, src); - # CMake gets upset when executable targets provide no sources. - if target_type == 'executable' and not compilable_srcs and not extra_sources: - print ('Executable %s has no complilable sources, treating as "none".' % - target_name ) - target_type = 'none' + if src_type == 's': + s_sources.append(src_norm_path) + elif src_type == 'cc': + c_sources.append(src_norm_path) + elif src_type == 'cxx': + cxx_sources.append(src_norm_path) + elif Linkable(ext): + linkable_sources.append(src_norm_path) + else: + other_sources.append(src_norm_path) - cmake_target_type = cmake_target_type_from_gyp_target_type.get(target_type) - if cmake_target_type is None: - print ('Target %s has unknown target type %s, skipping.' % - ( target_name, target_type ) ) - return + for extra_source in extra_sources: + src, real_source = extra_source + _, ext = os.path.splitext(real_source) + src_type = COMPILABLE_EXTENSIONS.get(ext, None) + + if src_type == 's': + s_sources.append(src) + elif src_type == 'cc': + c_sources.append(src) + elif src_type == 'cxx': + cxx_sources.append(src) + elif Linkable(ext): + linkable_sources.append(src) + else: + other_sources.append(src) + + s_sources_name = None + if s_sources: + s_sources_name = cmake_target_name + '__asm_srcs' + SetVariableList(output, s_sources_name, s_sources) + + c_sources_name = None + if c_sources: + c_sources_name = cmake_target_name + '__c_srcs' + SetVariableList(output, c_sources_name, c_sources) + + cxx_sources_name = None + if cxx_sources: + cxx_sources_name = cmake_target_name + '__cxx_srcs' + SetVariableList(output, cxx_sources_name, cxx_sources) + + linkable_sources_name = None + if linkable_sources: + linkable_sources_name = cmake_target_name + '__linkable_srcs' + SetVariableList(output, linkable_sources_name, linkable_sources) + + other_sources_name = None + if other_sources: + other_sources_name = cmake_target_name + '__other_srcs' + SetVariableList(output, other_sources_name, other_sources) + + # CMake gets upset when executable targets provide no sources. + # http://www.cmake.org/pipermail/cmake/2010-July/038461.html + dummy_sources_name = None + has_sources = (s_sources_name or + c_sources_name or + cxx_sources_name or + linkable_sources_name or + other_sources_name) + if target_type == 'executable' and not has_sources: + dummy_sources_name = cmake_target_name + '__dummy_srcs' + SetVariable(output, dummy_sources_name, + "${obj}.${TOOLSET}/${TARGET}/genc/dummy.c") + output.write('if(NOT EXISTS "') + WriteVariable(output, dummy_sources_name) + output.write('")\n') + output.write(' file(WRITE "') + WriteVariable(output, dummy_sources_name) + output.write('" "")\n') + output.write("endif()\n") - other_srcs_name = None - if other_srcs: - other_srcs_name = cmake_target_name + '__other_srcs' - SetVariableList(output, other_srcs_name, - [NormjoinPath(path_from_cmakelists_to_gyp, src) for src in other_srcs]) # CMake is opposed to setting linker directories and considers the practice # of setting linker directories dangerous. Instead, it favors the use of @@ -713,31 +778,48 @@ def partition(l, p): output.write(' ') output.write(cmake_target_type.modifier) - if other_srcs_name: - WriteVariable(output, other_srcs_name, ' ') - - output.write('\n') - - for src in compilable_srcs: - output.write(' ') - output.write(NormjoinPath(path_from_cmakelists_to_gyp, src)) - output.write('\n') - for extra_source in extra_sources: - output.write(' ') - src, _ = extra_source - output.write(NormjoinPath(path_from_cmakelists_to_gyp, src)) - output.write('\n') + if s_sources_name: + WriteVariable(output, s_sources_name, ' ') + if c_sources_name: + WriteVariable(output, c_sources_name, ' ') + if cxx_sources_name: + WriteVariable(output, cxx_sources_name, ' ') + if linkable_sources_name: + WriteVariable(output, linkable_sources_name, ' ') + if other_sources_name: + WriteVariable(output, other_sources_name, ' ') + if dummy_sources_name: + WriteVariable(output, dummy_sources_name, ' ') output.write(')\n') + # Let CMake know if the 'all' target should depend on this target. + exclude_from_all = ('TRUE' if qualified_target not in all_qualified_targets + else 'FALSE') + SetTargetProperty(output, cmake_target_name, + 'EXCLUDE_FROM_ALL', exclude_from_all) + for extra_target_name in extra_deps: + SetTargetProperty(output, extra_target_name, + 'EXCLUDE_FROM_ALL', exclude_from_all) + # Output name and location. if target_type != 'none': + # Link as 'C' if there are no other files + if not c_sources and not cxx_sources: + SetTargetProperty(output, cmake_target_name, 'LINKER_LANGUAGE', ['C']) + # Mark uncompiled sources as uncompiled. - if other_srcs_name: + if other_sources_name: output.write('set_source_files_properties(') - WriteVariable(output, other_srcs_name, '') + WriteVariable(output, other_sources_name, '') output.write(' PROPERTIES HEADER_FILE_ONLY "TRUE")\n') + # Mark object sources as linkable. + if linkable_sources_name: + output.write('set_source_files_properties(') + WriteVariable(output, other_sources_name, '') + output.write(' PROPERTIES EXTERNAL_OBJECT "TRUE")\n') + # Output directory target_output_directory = spec.get('product_dir') if target_output_directory is None: @@ -804,122 +886,84 @@ def partition(l, p): cmake_target_output_basename) SetFileProperty(output, cmake_target_output, 'GENERATED', ['TRUE'], '') - # Let CMake know if the 'all' target should depend on this target. - exclude_from_all = ('TRUE' if qualified_target not in all_qualified_targets - else 'FALSE') - SetTargetProperty(output, cmake_target_name, - 'EXCLUDE_FROM_ALL', exclude_from_all) - for extra_target_name in extra_deps: - SetTargetProperty(output, extra_target_name, - 'EXCLUDE_FROM_ALL', exclude_from_all) - - # Includes - includes = config.get('include_dirs') - if includes: - # This (target include directories) is what requires CMake 2.8.8 - includes_name = cmake_target_name + '__include_dirs' - SetVariableList(output, includes_name, - [NormjoinPathForceCMakeSource(path_from_cmakelists_to_gyp, include) - for include in includes]) - output.write('set_property(TARGET ') - output.write(cmake_target_name) - output.write(' APPEND PROPERTY INCLUDE_DIRECTORIES ') - WriteVariable(output, includes_name, '') - output.write(')\n') - - # Defines - defines = config.get('defines') - if defines is not None: - SetTargetProperty(output, - cmake_target_name, - 'COMPILE_DEFINITIONS', - defines, - ';') - - # Compile Flags - http://www.cmake.org/Bug/view.php?id=6493 - # CMake currently does not have target C and CXX flags. - # So, instead of doing... - - # cflags_c = config.get('cflags_c') - # if cflags_c is not None: - # SetTargetProperty(output, cmake_target_name, - # 'C_COMPILE_FLAGS', cflags_c, ' ') - - # cflags_cc = config.get('cflags_cc') - # if cflags_cc is not None: - # SetTargetProperty(output, cmake_target_name, - # 'CXX_COMPILE_FLAGS', cflags_cc, ' ') - - # Instead we must... - s_sources = [] - c_sources = [] - cxx_sources = [] - for src in srcs: - _, ext = os.path.splitext(src) - src_type = COMPILABLE_EXTENSIONS.get(ext, None) - - if src_type == 's': - s_sources.append(NormjoinPath(path_from_cmakelists_to_gyp, src)) - - if src_type == 'cc': - c_sources.append(NormjoinPath(path_from_cmakelists_to_gyp, src)) - - if src_type == 'cxx': - cxx_sources.append(NormjoinPath(path_from_cmakelists_to_gyp, src)) - - for extra_source in extra_sources: - src, real_source = extra_source - _, ext = os.path.splitext(real_source) - src_type = COMPILABLE_EXTENSIONS.get(ext, None) - - if src_type == 's': - s_sources.append(NormjoinPath(path_from_cmakelists_to_gyp, src)) - - if src_type == 'cc': - c_sources.append(NormjoinPath(path_from_cmakelists_to_gyp, src)) - - if src_type == 'cxx': - cxx_sources.append(NormjoinPath(path_from_cmakelists_to_gyp, src)) - - cflags = config.get('cflags', []) - cflags_c = config.get('cflags_c', []) - cflags_cxx = config.get('cflags_cc', []) - if c_sources and not (s_sources or cxx_sources): - flags = [] - flags.extend(cflags) - flags.extend(cflags_c) - SetTargetProperty(output, cmake_target_name, 'COMPILE_FLAGS', flags, ' ') - - elif cxx_sources and not (s_sources or c_sources): - flags = [] - flags.extend(cflags) - flags.extend(cflags_cxx) - SetTargetProperty(output, cmake_target_name, 'COMPILE_FLAGS', flags, ' ') - - else: - if s_sources and cflags: - SetFilesProperty(output, s_sources, 'COMPILE_FLAGS', cflags, ' ') + # Includes + includes = config.get('include_dirs') + if includes: + # This (target include directories) is what requires CMake 2.8.8 + includes_name = cmake_target_name + '__include_dirs' + SetVariableList(output, includes_name, + [NormjoinPathForceCMakeSource(path_from_cmakelists_to_gyp, include) + for include in includes]) + output.write('set_property(TARGET ') + output.write(cmake_target_name) + output.write(' APPEND PROPERTY INCLUDE_DIRECTORIES ') + WriteVariable(output, includes_name, '') + output.write(')\n') - if c_sources and (cflags or cflags_c): + # Defines + defines = config.get('defines') + if defines is not None: + SetTargetProperty(output, + cmake_target_name, + 'COMPILE_DEFINITIONS', + defines, + ';') + + # Compile Flags - http://www.cmake.org/Bug/view.php?id=6493 + # CMake currently does not have target C and CXX flags. + # So, instead of doing... + + # cflags_c = config.get('cflags_c') + # if cflags_c is not None: + # SetTargetProperty(output, cmake_target_name, + # 'C_COMPILE_FLAGS', cflags_c, ' ') + + # cflags_cc = config.get('cflags_cc') + # if cflags_cc is not None: + # SetTargetProperty(output, cmake_target_name, + # 'CXX_COMPILE_FLAGS', cflags_cc, ' ') + + # Instead we must... + cflags = config.get('cflags', []) + cflags_c = config.get('cflags_c', []) + cflags_cxx = config.get('cflags_cc', []) + if (not cflags_c or not c_sources) and (not cflags_cxx or not cxx_sources): + SetTargetProperty(output, cmake_target_name, 'COMPILE_FLAGS', cflags, ' ') + + elif c_sources and not (s_sources or cxx_sources): flags = [] flags.extend(cflags) flags.extend(cflags_c) - SetFilesProperty(output, c_sources, 'COMPILE_FLAGS', flags, ' ') + SetTargetProperty(output, cmake_target_name, 'COMPILE_FLAGS', flags, ' ') - if cxx_sources and (cflags or cflags_cxx): + elif cxx_sources and not (s_sources or c_sources): flags = [] flags.extend(cflags) flags.extend(cflags_cxx) - SetFilesProperty(output, cxx_sources, 'COMPILE_FLAGS', flags, ' ') + SetTargetProperty(output, cmake_target_name, 'COMPILE_FLAGS', flags, ' ') - # Have assembly link as c if there are no other files - if not c_sources and not cxx_sources and s_sources: - SetTargetProperty(output, cmake_target_name, 'LINKER_LANGUAGE', ['C']) - - # Linker flags - ldflags = config.get('ldflags') - if ldflags is not None: - SetTargetProperty(output, cmake_target_name, 'LINK_FLAGS', ldflags, ' ') + else: + # TODO: This is broken, one cannot generally set properties on files, + # as other targets may require different properties on the same files. + if s_sources and cflags: + SetFilesProperty(output, s_sources_name, 'COMPILE_FLAGS', cflags, ' ') + + if c_sources and (cflags or cflags_c): + flags = [] + flags.extend(cflags) + flags.extend(cflags_c) + SetFilesProperty(output, c_sources_name, 'COMPILE_FLAGS', flags, ' ') + + if cxx_sources and (cflags or cflags_cxx): + flags = [] + flags.extend(cflags) + flags.extend(cflags_cxx) + SetFilesProperty(output, cxx_sources_name, 'COMPILE_FLAGS', flags, ' ') + + # Linker flags + ldflags = config.get('ldflags') + if ldflags is not None: + SetTargetProperty(output, cmake_target_name, 'LINK_FLAGS', ldflags, ' ') # Note on Dependencies and Libraries: # CMake wants to handle link order, resolving the link line up front. @@ -1040,20 +1084,49 @@ def GenerateOutputForConfig(target_list, target_dicts, data, output.write('cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)\n') output.write('cmake_policy(VERSION 2.8.8)\n') - _, project_target, _ = gyp.common.ParseQualifiedTarget(target_list[-1]) + gyp_file, project_target, _ = gyp.common.ParseQualifiedTarget(target_list[-1]) output.write('project(') output.write(project_target) output.write(')\n') SetVariable(output, 'configuration', config_to_use) + ar = None + cc = None + cxx = None + + make_global_settings = data[gyp_file].get('make_global_settings', []) + build_to_top = gyp.common.InvertRelativePath(build_dir, + options.toplevel_dir) + for key, value in make_global_settings: + if key == 'AR': + ar = os.path.join(build_to_top, value) + if key == 'CC': + cc = os.path.join(build_to_top, value) + if key == 'CXX': + cxx = os.path.join(build_to_top, value) + + ar = gyp.common.GetEnvironFallback(['AR_target', 'AR'], ar) + cc = gyp.common.GetEnvironFallback(['CC_target', 'CC'], cc) + cxx = gyp.common.GetEnvironFallback(['CXX_target', 'CXX'], cxx) + + if ar: + SetVariable(output, 'CMAKE_AR', ar) + if cc: + SetVariable(output, 'CMAKE_C_COMPILER', cc) + if cxx: + SetVariable(output, 'CMAKE_CXX_COMPILER', cxx) + # The following appears to be as-yet undocumented. # http://public.kitware.com/Bug/view.php?id=8392 output.write('enable_language(ASM)\n') # ASM-ATT does not support .S files. # output.write('enable_language(ASM-ATT)\n') - SetVariable(output, 'builddir', '${CMAKE_BINARY_DIR}') + if cc: + SetVariable(output, 'CMAKE_ASM_COMPILER', cc) + + SetVariable(output, 'builddir', '${CMAKE_CURRENT_BINARY_DIR}') SetVariable(output, 'obj', '${builddir}/obj') output.write('\n') @@ -1066,6 +1139,11 @@ def GenerateOutputForConfig(target_list, target_dicts, data, output.write('set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)\n') output.write('\n') + # Force ninja to use rsp files. Otherwise link and ar lines can get too long, + # resulting in 'Argument list too long' errors. + output.write('set(CMAKE_NINJA_FORCE_RESPONSE_FILE 1)\n') + output.write('\n') + namer = CMakeNamer(target_list) # The list of targets upon which the 'all' target should depend. diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py index 927ba6ebad771c..160eafe2efeca0 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py @@ -14,6 +14,9 @@ generator_wants_static_library_dependencies_adjusted = False +generator_filelist_paths = { +} + generator_default_variables = { } for dirname in ['INTERMEDIATE_DIR', 'SHARED_INTERMEDIATE_DIR', 'PRODUCT_DIR', @@ -56,6 +59,17 @@ def CalculateGeneratorInputInfo(params): global generator_wants_static_library_dependencies_adjusted generator_wants_static_library_dependencies_adjusted = True + toplevel = params['options'].toplevel_dir + generator_dir = os.path.relpath(params['options'].generator_output or '.') + # output_dir: relative path from generator_dir to the build directory. + output_dir = generator_flags.get('output_dir', 'out') + qualified_out_dir = os.path.normpath(os.path.join( + toplevel, generator_dir, output_dir, 'gypfiles')) + global generator_filelist_paths + generator_filelist_paths = { + 'toplevel': toplevel, + 'qualified_out_dir': qualified_out_dir, + } def GenerateOutput(target_list, target_dicts, data, params): # Map of target -> list of targets it depends on. @@ -74,7 +88,11 @@ def GenerateOutput(target_list, target_dicts, data, params): edges[target].append(dep) targets_to_visit.append(dep) - filename = 'dump.json' + try: + filepath = params['generator_flags']['output_dir'] + except KeyError: + filepath = '.' + filename = os.path.join(filepath, 'dump.json') f = open(filename, 'w') json.dump(edges, f) f.close() diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py index 06c7fdc2e84ce8..aefdac787c2408 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py @@ -211,10 +211,10 @@ def CalculateGeneratorInputInfo(params): LINK_COMMANDS_AIX = """\ quiet_cmd_alink = AR($(TOOLSET)) $@ -cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^) +cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^) quiet_cmd_alink_thin = AR($(TOOLSET)) $@ -cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^) +cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^) quiet_cmd_link = LINK($(TOOLSET)) $@ cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) @@ -273,9 +273,9 @@ def CalculateGeneratorInputInfo(params): %(make_global_settings)s CC.target ?= %(CC.target)s -CFLAGS.target ?= $(CFLAGS) +CFLAGS.target ?= $(CPPFLAGS) $(CFLAGS) CXX.target ?= %(CXX.target)s -CXXFLAGS.target ?= $(CXXFLAGS) +CXXFLAGS.target ?= $(CPPFLAGS) $(CXXFLAGS) LINK.target ?= %(LINK.target)s LDFLAGS.target ?= $(LDFLAGS) AR.target ?= $(AR) @@ -286,9 +286,9 @@ def CalculateGeneratorInputInfo(params): # TODO(evan): move all cross-compilation logic to gyp-time so we don't need # to replicate this environment fallback in make as well. CC.host ?= %(CC.host)s -CFLAGS.host ?= +CFLAGS.host ?= $(CPPFLAGS_host) $(CFLAGS_host) CXX.host ?= %(CXX.host)s -CXXFLAGS.host ?= +CXXFLAGS.host ?= $(CPPFLAGS_host) $(CXXFLAGS_host) LINK.host ?= %(LINK.host)s LDFLAGS.host ?= AR.host ?= %(AR.host)s @@ -365,7 +365,7 @@ def CalculateGeneratorInputInfo(params): quiet_cmd_copy = COPY $@ # send stderr to /dev/null to ignore messages when linking directories. -cmd_copy = rm -rf "$@" && cp -af "$<" "$@" +cmd_copy = rm -rf "$@" && cp %(copy_archive_args)s "$<" "$@" %(link_commands)s """ @@ -1019,7 +1019,8 @@ def WriteRules(self, rules, extra_sources, extra_outputs, # accidentally writing duplicate dummy rules for those outputs. self.WriteLn('%s: obj := $(abs_obj)' % outputs[0]) self.WriteLn('%s: builddir := $(abs_builddir)' % outputs[0]) - self.WriteMakeRule(outputs, inputs + ['FORCE_DO_CMD'], actions) + self.WriteMakeRule(outputs, inputs, actions, + command="%s_%d" % (name, count)) # Spaces in rule filenames are not supported, but rule variables have # spaces in them (e.g. RULE_INPUT_PATH expands to '$(abspath $<)'). # The spaces within the variables are valid, so remove the variables @@ -1578,7 +1579,7 @@ def WriteTarget(self, spec, configs, deps, link_deps, bundle_deps, for link_dep in link_deps: assert ' ' not in link_dep, ( "Spaces in alink input filenames not supported (%s)" % link_dep) - if (self.flavor not in ('mac', 'openbsd', 'win') and not + if (self.flavor not in ('mac', 'openbsd', 'netbsd', 'win') and not self.is_standalone_static_library): self.WriteDoCmd([self.output_binary], link_deps, 'alink_thin', part_of_all, postbuilds=postbuilds) @@ -1688,6 +1689,7 @@ def WriteDoCmd(self, outputs, inputs, command, part_of_all, comment=None, self.WriteMakeRule(outputs, inputs, actions = ['$(call do_cmd,%s%s)' % (command, suffix)], comment = comment, + command = command, force = True) # Add our outputs to the list of targets we read depfiles from. # all_deps is only used for deps file reading, and for deps files we replace @@ -1698,7 +1700,7 @@ def WriteDoCmd(self, outputs, inputs, command, part_of_all, comment=None, def WriteMakeRule(self, outputs, inputs, actions=None, comment=None, - order_only=False, force=False, phony=False): + order_only=False, force=False, phony=False, command=None): """Write a Makefile rule, with some extra tricks. outputs: a list of outputs for the rule (note: this is not directly @@ -1711,6 +1713,7 @@ def WriteMakeRule(self, outputs, inputs, actions=None, comment=None, force: if true, include FORCE_DO_CMD as an order-only dep phony: if true, the rule does not actually generate the named output, the output is just a name to run the rule + command: (optional) command name to generate unambiguous labels """ outputs = map(QuoteSpaces, outputs) inputs = map(QuoteSpaces, inputs) @@ -1719,44 +1722,38 @@ def WriteMakeRule(self, outputs, inputs, actions=None, comment=None, self.WriteLn('# ' + comment) if phony: self.WriteLn('.PHONY: ' + ' '.join(outputs)) - # TODO(evanm): just make order_only a list of deps instead of these hacks. - if order_only: - order_insert = '| ' - pick_output = ' '.join(outputs) - else: - order_insert = '' - pick_output = outputs[0] - if force: - force_append = ' FORCE_DO_CMD' - else: - force_append = '' if actions: self.WriteLn("%s: TOOLSET := $(TOOLSET)" % outputs[0]) - self.WriteLn('%s: %s%s%s' % (pick_output, order_insert, ' '.join(inputs), - force_append)) + force_append = ' FORCE_DO_CMD' if force else '' + + if order_only: + # Order only rule: Just write a simple rule. + # TODO(evanm): just make order_only a list of deps instead of this hack. + self.WriteLn('%s: | %s%s' % + (' '.join(outputs), ' '.join(inputs), force_append)) + elif len(outputs) == 1: + # Regular rule, one output: Just write a simple rule. + self.WriteLn('%s: %s%s' % (outputs[0], ' '.join(inputs), force_append)) + else: + # Regular rule, more than one output: Multiple outputs are tricky in + # make. We will write three rules: + # - All outputs depend on an intermediate file. + # - Make .INTERMEDIATE depend on the intermediate. + # - The intermediate file depends on the inputs and executes the + # actual command. + # - The intermediate recipe will 'touch' the intermediate file. + # - The multi-output rule will have an do-nothing recipe. + intermediate = "%s.intermediate" % (command if command else self.target) + self.WriteLn('%s: %s' % (' '.join(outputs), intermediate)) + self.WriteLn('\t%s' % '@:'); + self.WriteLn('%s: %s' % ('.INTERMEDIATE', intermediate)) + self.WriteLn('%s: %s%s' % + (intermediate, ' '.join(inputs), force_append)) + actions.insert(0, '$(call do_cmd,touch)') + if actions: for action in actions: self.WriteLn('\t%s' % action) - if not order_only and len(outputs) > 1: - # If we have more than one output, a rule like - # foo bar: baz - # that for *each* output we must run the action, potentially - # in parallel. That is not what we're trying to write -- what - # we want is that we run the action once and it generates all - # the files. - # http://www.gnu.org/software/hello/manual/automake/Multiple-Outputs.html - # discusses this problem and has this solution: - # 1) Write the naive rule that would produce parallel runs of - # the action. - # 2) Make the outputs seralized on each other, so we won't start - # a parallel run until the first run finishes, at which point - # we'll have generated all the outputs and we're done. - self.WriteLn('%s: %s' % (' '.join(outputs[1:]), outputs[0])) - # Add a dummy command to the "extra outputs" rule, otherwise make seems to - # think these outputs haven't (couldn't have?) changed, and thus doesn't - # flag them as changed (i.e. include in '$?') when evaluating dependent - # rules, which in turn causes do_cmd() to skip running dependent commands. - self.WriteLn('%s: ;' % (' '.join(outputs[1:]))) self.WriteLn() @@ -2015,6 +2012,7 @@ def CalculateMakefilePath(build_file, base_name): srcdir_prefix = '$(srcdir)/' flock_command= 'flock' + copy_archive_arguments = '-af' header_params = { 'default_target': default_target, 'builddir': builddir_name, @@ -2024,6 +2022,7 @@ def CalculateMakefilePath(build_file, base_name): 'link_commands': LINK_COMMANDS_LINUX, 'extra_commands': '', 'srcdir': srcdir, + 'copy_archive_args': copy_archive_arguments, } if flavor == 'mac': flock_command = './gyp-mac-tool flock' @@ -2047,8 +2046,15 @@ def CalculateMakefilePath(build_file, base_name): header_params.update({ 'flock': 'lockf', }) + elif flavor == 'openbsd': + copy_archive_arguments = '-pPRf' + header_params.update({ + 'copy_archive_args': copy_archive_arguments, + }) elif flavor == 'aix': + copy_archive_arguments = '-pPRf' header_params.update({ + 'copy_archive_args': copy_archive_arguments, 'link_commands': LINK_COMMANDS_AIX, 'flock': './gyp-flock-tool flock', 'flock_index': 2, diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py index 8e6bd7ba0a0592..2ecf964c687c13 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py @@ -86,6 +86,9 @@ def _import_OrderedDict(): 'msvs_enable_winrt', 'msvs_requires_importlibrary', 'msvs_enable_winphone', + 'msvs_application_type_revision', + 'msvs_target_platform_version', + 'msvs_target_platform_minversion', ] @@ -2344,6 +2347,9 @@ def _GenerateMSBuildRuleTargetsFile(targets_path, msbuild_rules): rule_name, {'Condition': "'@(%s)' != '' and '%%(%s.ExcludedFromBuild)' != " "'true'" % (rule_name, rule_name), + 'EchoOff': 'true', + 'StandardOutputImportance': 'High', + 'StandardErrorImportance': 'High', 'CommandLineTemplate': '%%(%s.CommandLineTemplate)' % rule_name, 'AdditionalOptions': '%%(%s.AdditionalOptions)' % rule_name, 'Inputs': rule_inputs @@ -2634,8 +2640,23 @@ def _GetMSBuildGlobalProperties(spec, guid, gyp_file_name): if spec.get('msvs_enable_winrt'): properties[0].append(['DefaultLanguage', 'en-US']) properties[0].append(['AppContainerApplication', 'true']) - properties[0].append(['ApplicationTypeRevision', '8.1']) - + if spec.get('msvs_application_type_revision'): + app_type_revision = spec.get('msvs_application_type_revision') + properties[0].append(['ApplicationTypeRevision', app_type_revision]) + else: + properties[0].append(['ApplicationTypeRevision', '8.1']) + + if spec.get('msvs_target_platform_version'): + target_platform_version = spec.get('msvs_target_platform_version') + properties[0].append(['WindowsTargetPlatformVersion', + target_platform_version]) + if spec.get('msvs_target_platform_minversion'): + target_platform_minversion = spec.get('msvs_target_platform_minversion') + properties[0].append(['WindowsTargetPlatformMinVersion', + target_platform_minversion]) + else: + properties[0].append(['WindowsTargetPlatformMinVersion', + target_platform_version]) if spec.get('msvs_enable_winphone'): properties[0].append(['ApplicationType', 'Windows Phone']) else: diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py index 624c99ae896b26..841067ed348112 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py @@ -139,8 +139,11 @@ def __init__(self, type): self.bundle = None # On Windows, incremental linking requires linking against all the .objs # that compose a .lib (rather than the .lib itself). That list is stored - # here. + # here. In this case, we also need to save the compile_deps for the target, + # so that the the target that directly depends on the .objs can also depend + # on those. self.component_objs = None + self.compile_deps = None # Windows only. The import .lib is the output of a build step, but # because dependents only link against the lib (not both the lib and the # dll) we keep track of the import library here. @@ -474,16 +477,17 @@ def WriteSpec(self, spec, config_name, generator_flags): elif self.flavor == 'mac' and len(self.archs) > 1: link_deps = collections.defaultdict(list) - + compile_deps = self.target.actions_stamp or actions_depends if self.flavor == 'win' and self.target.type == 'static_library': self.target.component_objs = link_deps + self.target.compile_deps = compile_deps # Write out a link step, if needed. output = None is_empty_bundle = not link_deps and not mac_bundle_depends if link_deps or self.target.actions_stamp or actions_depends: output = self.WriteTarget(spec, config_name, config, link_deps, - self.target.actions_stamp or actions_depends) + compile_deps) if self.is_mac_bundle: mac_bundle_depends.append(output) @@ -921,6 +925,11 @@ def WriteSourcesForArch(self, ninja_file, config_name, config, sources, os.environ.get('CFLAGS', '').split() + cflags_c) cflags_cc = (os.environ.get('CPPFLAGS', '').split() + os.environ.get('CXXFLAGS', '').split() + cflags_cc) + elif self.toolset == 'host': + cflags_c = (os.environ.get('CPPFLAGS_host', '').split() + + os.environ.get('CFLAGS_host', '').split() + cflags_c) + cflags_cc = (os.environ.get('CPPFLAGS_host', '').split() + + os.environ.get('CXXFLAGS_host', '').split() + cflags_cc) defines = config.get('defines', []) + extra_defines self.WriteVariableList(ninja_file, 'defines', @@ -1088,6 +1097,7 @@ def WriteLinkForArch(self, ninja_file, spec, config_name, config, implicit_deps = set() solibs = set() + order_deps = set() if 'dependencies' in spec: # Two kinds of dependencies: @@ -1106,6 +1116,8 @@ def WriteLinkForArch(self, ninja_file, spec, config_name, config, target.component_objs and self.msvs_settings.IsUseLibraryDependencyInputs(config_name)): new_deps = target.component_objs + if target.compile_deps: + order_deps.add(target.compile_deps) elif self.flavor == 'win' and target.import_lib: new_deps = [target.import_lib] elif target.UsesToc(self.flavor): @@ -1169,7 +1181,7 @@ def WriteLinkForArch(self, ninja_file, spec, config_name, config, ldflags.append(r'-Wl,-rpath=\$$ORIGIN/%s' % rpath) ldflags.append('-Wl,-rpath-link=%s' % rpath) self.WriteVariableList(ninja_file, 'ldflags', - gyp.common.uniquer(map(self.ExpandSpecial, ldflags))) + map(self.ExpandSpecial, ldflags)) library_dirs = config.get('library_dirs', []) if self.flavor == 'win': @@ -1244,6 +1256,7 @@ def WriteLinkForArch(self, ninja_file, spec, config_name, config, ninja_file.build(output, command + command_suffix, link_deps, implicit=list(implicit_deps), + order_only=list(order_deps), variables=extra_bindings) return linked_binary @@ -1258,7 +1271,7 @@ def WriteTarget(self, spec, config_name, config, link_deps, compile_deps): self.target.type = 'none' elif spec['type'] == 'static_library': self.target.binary = self.ComputeOutput(spec) - if (self.flavor not in ('mac', 'openbsd', 'win') and not + if (self.flavor not in ('mac', 'openbsd', 'netbsd', 'win') and not self.is_standalone_static_library): self.ninja.build(self.target.binary, 'alink_thin', link_deps, order_only=compile_deps) @@ -1672,7 +1685,7 @@ def CommandWithWrapper(cmd, wrappers, prog): def GetDefaultConcurrentLinks(): """Returns a best-guess for a number of concurrent links.""" - pool_size = int(os.getenv('GYP_LINK_CONCURRENCY', 0)) + pool_size = int(os.environ.get('GYP_LINK_CONCURRENCY', 0)) if pool_size: return pool_size @@ -1696,8 +1709,10 @@ class MEMORYSTATUSEX(ctypes.Structure): stat.dwLength = ctypes.sizeof(stat) ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(stat)) - mem_limit = max(1, stat.ullTotalPhys / (4 * (2 ** 30))) # total / 4GB - hard_cap = max(1, int(os.getenv('GYP_LINK_CONCURRENCY_MAX', 2**32))) + # VS 2015 uses 20% more working set than VS 2013 and can consume all RAM + # on a 64 GB machine. + mem_limit = max(1, stat.ullTotalPhys / (5 * (2 ** 30))) # total / 5GB + hard_cap = max(1, int(os.environ.get('GYP_LINK_CONCURRENCY_MAX', 2**32))) return min(mem_limit, hard_cap) elif sys.platform.startswith('linux'): if os.path.exists("/proc/meminfo"): @@ -2275,7 +2290,11 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params, if flavor == 'mac': gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(data[build_file], spec) - build_file = gyp.common.RelativePath(build_file, options.toplevel_dir) + # If build_file is a symlink, we must not follow it because there's a chance + # it could point to a path above toplevel_dir, and we cannot correctly deal + # with that case at the moment. + build_file = gyp.common.RelativePath(build_file, options.toplevel_dir, + False) qualified_target_for_hash = gyp.common.QualifiedTarget(build_file, name, toolset) diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py index 482b53ac8ad9ec..0e3fb9301ecb9e 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py @@ -87,6 +87,8 @@ 'mac_framework_private_headers', ] +generator_filelist_paths = None + # Xcode's standard set of library directories, which don't need to be duplicated # in LIBRARY_SEARCH_PATHS. This list is not exhaustive, but that's okay. xcode_standard_library_dirs = frozenset([ @@ -578,6 +580,26 @@ def PerformBuild(data, configurations, params): subprocess.check_call(arguments) +def CalculateGeneratorInputInfo(params): + toplevel = params['options'].toplevel_dir + if params.get('flavor') == 'ninja': + generator_dir = os.path.relpath(params['options'].generator_output or '.') + output_dir = params.get('generator_flags', {}).get('output_dir', 'out') + output_dir = os.path.normpath(os.path.join(generator_dir, output_dir)) + qualified_out_dir = os.path.normpath(os.path.join( + toplevel, output_dir, 'gypfiles-xcode-ninja')) + else: + output_dir = os.path.normpath(os.path.join(toplevel, 'xcodebuild')) + qualified_out_dir = os.path.normpath(os.path.join( + toplevel, output_dir, 'gypfiles')) + + global generator_filelist_paths + generator_filelist_paths = { + 'toplevel': toplevel, + 'qualified_out_dir': qualified_out_dir, + } + + def GenerateOutput(target_list, target_dicts, data, params): # Optionally configure each spec to use ninja as the external builder. ninja_wrapper = params.get('flavor') == 'ninja' @@ -590,6 +612,15 @@ def GenerateOutput(target_list, target_dicts, data, params): parallel_builds = generator_flags.get('xcode_parallel_builds', True) serialize_all_tests = \ generator_flags.get('xcode_serialize_all_test_runs', True) + upgrade_check_project_version = \ + generator_flags.get('xcode_upgrade_check_project_version', None) + + # Format upgrade_check_project_version with leading zeros as needed. + if upgrade_check_project_version: + upgrade_check_project_version = str(upgrade_check_project_version) + while len(upgrade_check_project_version) < 4: + upgrade_check_project_version = '0' + upgrade_check_project_version + skip_excluded_files = \ not generator_flags.get('xcode_list_excluded_files', True) xcode_projects = {} @@ -604,9 +635,17 @@ def GenerateOutput(target_list, target_dicts, data, params): xcode_projects[build_file] = xcp pbxp = xcp.project + # Set project-level attributes from multiple options + project_attributes = {}; if parallel_builds: - pbxp.SetProperty('attributes', - {'BuildIndependentTargetsInParallel': 'YES'}) + project_attributes['BuildIndependentTargetsInParallel'] = 'YES' + if upgrade_check_project_version: + project_attributes['LastUpgradeCheck'] = upgrade_check_project_version + project_attributes['LastTestingUpgradeCheck'] = \ + upgrade_check_project_version + project_attributes['LastSwiftUpdateCheck'] = \ + upgrade_check_project_version + pbxp.SetProperty('attributes', project_attributes) # Add gyp/gypi files to project if not generator_flags.get('standalone'): @@ -648,6 +687,7 @@ def GenerateOutput(target_list, target_dicts, data, params): 'loadable_module': 'com.googlecode.gyp.xcode.bundle', 'shared_library': 'com.apple.product-type.library.dynamic', 'static_library': 'com.apple.product-type.library.static', + 'mac_kernel_extension': 'com.apple.product-type.kernel-extension', 'executable+bundle': 'com.apple.product-type.application', 'loadable_module+bundle': 'com.apple.product-type.bundle', 'loadable_module+xctest': 'com.apple.product-type.bundle.unit-test', @@ -655,7 +695,9 @@ def GenerateOutput(target_list, target_dicts, data, params): 'executable+extension+bundle': 'com.apple.product-type.app-extension', 'executable+watch+extension+bundle': 'com.apple.product-type.watchkit-extension', - 'executable+watch+bundle': 'com.apple.product-type.application.watchapp', + 'executable+watch+bundle': + 'com.apple.product-type.application.watchapp', + 'mac_kernel_extension+bundle': 'com.apple.product-type.kernel-extension', } target_properties = { diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py index 34fbc54711923c..20178672b23bd8 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py @@ -28,7 +28,12 @@ # A list of types that are treated as linkable. -linkable_types = ['executable', 'shared_library', 'loadable_module'] +linkable_types = [ + 'executable', + 'shared_library', + 'loadable_module', + 'mac_kernel_extension', +] # A list of sections that contain links to other targets. dependency_sections = ['dependencies', 'export_dependent_settings'] @@ -57,7 +62,7 @@ def IsPathSection(section): # If section ends in one of the '=+?!' characters, it's applied to a section # without the trailing characters. '/' is notably absent from this list, # because there's no way for a regular expression to be treated as a path. - while section[-1:] in '=+?!': + while section and section[-1:] in '=+?!': section = section[:-1] if section in path_sections: @@ -893,11 +898,15 @@ def ExpandVariables(input, phase, variables, build_file): else: # Fix up command with platform specific workarounds. contents = FixupPlatformCommand(contents) - p = subprocess.Popen(contents, shell=use_shell, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - stdin=subprocess.PIPE, - cwd=build_file_dir) + try: + p = subprocess.Popen(contents, shell=use_shell, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + stdin=subprocess.PIPE, + cwd=build_file_dir) + except Exception, e: + raise GypError("%s while executing command '%s' in %s" % + (e, contents, build_file)) p_stdout, p_stderr = p.communicate('') @@ -905,8 +914,8 @@ def ExpandVariables(input, phase, variables, build_file): sys.stderr.write(p_stderr) # Simulate check_call behavior, since check_call only exists # in python 2.5 and later. - raise GypError("Call to '%s' returned exit status %d." % - (contents, p.returncode)) + raise GypError("Call to '%s' returned exit status %d while in %s." % + (contents, p.returncode, build_file)) replacement = p_stdout.rstrip() cached_command_results[cache_key] = replacement @@ -1662,8 +1671,8 @@ def DeepDependencies(self, dependencies=None): if dependency.ref is None: continue if dependency.ref not in dependencies: - dependencies.add(dependency.ref) dependency.DeepDependencies(dependencies) + dependencies.add(dependency.ref) return dependencies @@ -1720,11 +1729,12 @@ def _LinkDependenciesInternal(self, targets, include_shared_libraries, dependencies.add(self.ref) return dependencies - # Executables and loadable modules are already fully and finally linked. - # Nothing else can be a link dependency of them, there can only be - # dependencies in the sense that a dependent target might run an - # executable or load the loadable_module. - if not initial and target_type in ('executable', 'loadable_module'): + # Executables, mac kernel extensions and loadable modules are already fully + # and finally linked. Nothing else can be a link dependency of them, there + # can only be dependencies in the sense that a dependent target might run + # an executable or load the loadable_module. + if not initial and target_type in ('executable', 'loadable_module', + 'mac_kernel_extension'): return dependencies # Shared libraries are already fully linked. They should only be included @@ -2475,7 +2485,7 @@ def ValidateTargetType(target, target_dict): """ VALID_TARGET_TYPES = ('executable', 'loadable_module', 'static_library', 'shared_library', - 'none') + 'mac_kernel_extension', 'none') target_type = target_dict.get('type', None) if target_type not in VALID_TARGET_TYPES: raise GypError("Target %s has an invalid target type '%s'. " @@ -2488,6 +2498,35 @@ def ValidateTargetType(target, target_dict): target_type)) +def ValidateSourcesInTarget(target, target_dict, build_file, + duplicate_basename_check): + if not duplicate_basename_check: + return + if target_dict.get('type', None) != 'static_library': + return + sources = target_dict.get('sources', []) + basenames = {} + for source in sources: + name, ext = os.path.splitext(source) + is_compiled_file = ext in [ + '.c', '.cc', '.cpp', '.cxx', '.m', '.mm', '.s', '.S'] + if not is_compiled_file: + continue + basename = os.path.basename(name) # Don't include extension. + basenames.setdefault(basename, []).append(source) + + error = '' + for basename, files in basenames.iteritems(): + if len(files) > 1: + error += ' %s: %s\n' % (basename, ' '.join(files)) + + if error: + print('static library %s has several files with the same basename:\n' % + target + error + 'libtool on Mac cannot handle that. Use ' + '--no-duplicate-basename-check to disable this validation.') + raise GypError('Duplicate basenames in sources section, see list above') + + def ValidateRulesInTarget(target, target_dict, extra_sources_for_rules): """Ensures that the rules sections in target_dict are valid and consistent, and determines which sources they apply to. @@ -2708,7 +2747,7 @@ def SetGeneratorGlobals(generator_input_info): def Load(build_files, variables, includes, depth, generator_input_info, check, - circular_check, parallel, root_targets): + circular_check, duplicate_basename_check, parallel, root_targets): SetGeneratorGlobals(generator_input_info) # A generator can have other lists (in addition to sources) be processed # for rules. @@ -2840,6 +2879,8 @@ def Load(build_files, variables, includes, depth, generator_input_info, check, target_dict = targets[target] build_file = gyp.common.BuildFile(target) ValidateTargetType(target, target_dict) + ValidateSourcesInTarget(target, target_dict, build_file, + duplicate_basename_check) ValidateRulesInTarget(target, target_dict, extra_sources_for_rules) ValidateRunAsInTarget(target, target_dict, build_file) ValidateActionsInTarget(target, target_dict, build_file) diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py index 366439a062d36b..eeeaceb0c7aa23 100755 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py @@ -603,8 +603,7 @@ def _ExpandVariables(self, data, substitutions): if isinstance(data, list): return [self._ExpandVariables(v, substitutions) for v in data] if isinstance(data, dict): - return dict((k, self._ExpandVariables(data[k], - substitutions)) for k in data) + return {k: self._ExpandVariables(data[k], substitutions) for k in data} return data if __name__ == '__main__': diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py index ce5c46ea5b3d95..ca67b122f0b9b1 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py @@ -442,6 +442,7 @@ def GetCflags(self, config): cl('FloatingPointModel', map={'0': 'precise', '1': 'strict', '2': 'fast'}, prefix='/fp:', default='0') + cl('CompileAsManaged', map={'false': '', 'true': '/clr'}) cl('WholeProgramOptimization', map={'true': '/GL'}) cl('WarningLevel', prefix='/W') cl('WarnAsError', map={'true': '/WX'}) @@ -593,6 +594,15 @@ def GetLdflags(self, config, gyp_to_build_path, expand_special, '2': 'WINDOWS%s' % minimum_required_version}, prefix='/SUBSYSTEM:') + stack_reserve_size = self._Setting( + ('VCLinkerTool', 'StackReserveSize'), config, default='') + if stack_reserve_size: + stack_commit_size = self._Setting( + ('VCLinkerTool', 'StackCommitSize'), config, default='') + if stack_commit_size: + stack_commit_size = ',' + stack_commit_size + ldflags.append('/STACK:%s%s' % (stack_reserve_size, stack_commit_size)) + ld('TerminalServerAware', map={'1': ':NO', '2': ''}, prefix='/TSAWARE') ld('LinkIncremental', map={'1': ':NO', '2': ''}, prefix='/INCREMENTAL') ld('BaseAddress', prefix='/BASE:') diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py index 417e465f7853f4..bb6f1ea436f258 100755 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py @@ -123,7 +123,9 @@ def ExecLinkWrapper(self, arch, use_separate_mspdbsrv, *args): stderr=subprocess.STDOUT) out, _ = link.communicate() for line in out.splitlines(): - if not line.startswith(' Creating library '): + if (not line.startswith(' Creating library ') and + not line.startswith('Generating code') and + not line.startswith('Finished generating code')): print line return link.returncode diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py index f1a839a2f59e89..b06bdc4e8b73a4 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py @@ -525,6 +525,13 @@ def GetCflags(self, configname, arch=None): if self._Test('GCC_WARN_ABOUT_MISSING_NEWLINE', 'YES', default='NO'): cflags.append('-Wnewline-eof') + # In Xcode, this is only activated when GCC_COMPILER_VERSION is clang or + # llvm-gcc. It also requires a fairly recent libtool, and + # if the system clang isn't used, DYLD_LIBRARY_PATH needs to contain the + # path to the libLTO.dylib that matches the used clang. + if self._Test('LLVM_LTO', 'YES', default='NO'): + cflags.append('-flto') + self._AppendPlatformVersionMinFlags(cflags) # TODO: @@ -831,8 +838,9 @@ def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None): # These flags reflect the compilation options used by xcode to compile # extensions. ldflags.append('-lpkstart') - ldflags.append(sdk_root + - '/System/Library/PrivateFrameworks/PlugInKit.framework/PlugInKit') + if XcodeVersion() < '0900': + ldflags.append(sdk_root + + '/System/Library/PrivateFrameworks/PlugInKit.framework/PlugInKit') ldflags.append('-fapplication-extension') ldflags.append('-Xlinker -rpath ' '-Xlinker @executable_path/../../Frameworks') @@ -1024,7 +1032,23 @@ def _AdjustLibrary(self, library, config_name=None): sdk_root = self._SdkPath(config_name) if not sdk_root: sdk_root = '' - return l.replace('$(SDKROOT)', sdk_root) + # Xcode 7 started shipping with ".tbd" (text based stubs) files instead of + # ".dylib" without providing a real support for them. What it does, for + # "/usr/lib" libraries, is do "-L/usr/lib -lname" which is dependent on the + # library order and cause collision when building Chrome. + # + # Instead substitude ".tbd" to ".dylib" in the generated project when the + # following conditions are both true: + # - library is referenced in the gyp file as "$(SDKROOT)/**/*.dylib", + # - the ".dylib" file does not exists but a ".tbd" file do. + library = l.replace('$(SDKROOT)', sdk_root) + if l.startswith('$(SDKROOT)'): + basename, ext = os.path.splitext(library) + if ext == '.dylib' and not os.path.exists(library): + tbd_library = basename + '.tbd' + if os.path.exists(tbd_library): + library = tbd_library + return library def AdjustLibraries(self, libraries, config_name=None): """Transforms entries like 'Cocoa.framework' in libraries into entries like @@ -1428,6 +1452,7 @@ def _GetXcodeEnv(xcode_settings, built_products_dir, srcroot, configuration, # These are filled in on a as-needed basis. env = { + 'BUILT_FRAMEWORKS_DIR' : built_products_dir, 'BUILT_PRODUCTS_DIR' : built_products_dir, 'CONFIGURATION' : configuration, 'PRODUCT_NAME' : xcode_settings.GetProductName(), diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py index 034a0d2d4fcc23..d08b7f777002f0 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py @@ -1492,6 +1492,7 @@ def __init__(self, properties=None, id=None, parent=None): 'icns': 'image.icns', 'java': 'sourcecode.java', 'js': 'sourcecode.javascript', + 'kext': 'wrapper.kext', 'm': 'sourcecode.c.objc', 'mm': 'sourcecode.cpp.objcpp', 'nib': 'wrapper.nib', @@ -1951,6 +1952,7 @@ class PBXCopyFilesBuildPhase(XCBuildPhase): # path_tree_to_subfolder maps names of Xcode variables to the associated # dstSubfolderSpec property value used in a PBXCopyFilesBuildPhase object. path_tree_to_subfolder = { + 'BUILT_FRAMEWORKS_DIR': 10, # Frameworks Directory 'BUILT_PRODUCTS_DIR': 16, # Products Directory # Other types that can be chosen via the Xcode UI. # TODO(mark): Map Xcode variable names to these. @@ -1958,7 +1960,6 @@ class PBXCopyFilesBuildPhase(XCBuildPhase): # : 6, # Executables: 6 # : 7, # Resources # : 15, # Java Resources - # : 10, # Frameworks # : 11, # Shared Frameworks # : 12, # Shared Support # : 13, # PlugIns @@ -2262,6 +2263,8 @@ class PBXNativeTarget(XCTarget): '', '.xctest'], 'com.googlecode.gyp.xcode.bundle': ['compiled.mach-o.dylib', '', '.so'], + 'com.apple.product-type.kernel-extension': ['wrapper.kext', + '', '.kext'], } def __init__(self, properties=None, id=None, parent=None, diff --git a/deps/npm/node_modules/node-gyp/lib/build.js b/deps/npm/node_modules/node-gyp/lib/build.js index 198017b262add5..3a3edccf872b92 100644 --- a/deps/npm/node_modules/node-gyp/lib/build.js +++ b/deps/npm/node_modules/node-gyp/lib/build.js @@ -19,9 +19,15 @@ var fs = require('graceful-fs') exports.usage = 'Invokes `' + (win ? 'msbuild' : 'make') + '` and builds the module' function build (gyp, argv, callback) { + var platformMake = 'make' + if (process.platform === 'aix') { + platformMake = 'gmake' + } else if (process.platform.indexOf('bsd') !== -1) { + platformMake = 'gmake' + } + var release = processRelease(argv, gyp, process.version, process.release) - , makeCommand = gyp.opts.make || process.env.MAKE - || (process.platform.indexOf('bsd') != -1 && process.platform.indexOf('kfreebsd') == -1 ? 'gmake' : 'make') + , makeCommand = gyp.opts.make || process.env.MAKE || platformMake , command = win ? 'msbuild' : makeCommand , buildDir = path.resolve('build') , configPath = path.resolve(buildDir, 'config.gypi') diff --git a/deps/npm/node_modules/node-gyp/lib/configure.js b/deps/npm/node_modules/node-gyp/lib/configure.js index 009935202af98a..4e0652961ea902 100644 --- a/deps/npm/node_modules/node-gyp/lib/configure.js +++ b/deps/npm/node_modules/node-gyp/lib/configure.js @@ -1,4 +1,5 @@ module.exports = exports = configure +module.exports.test = { findPython: findPython } /** * Module dependencies. @@ -19,6 +20,7 @@ var fs = require('graceful-fs') , spawn = cp.spawn , execFile = cp.execFile , win = process.platform == 'win32' + , findNodeDirectory = require('./find-node-directory') exports.usage = 'Generates ' + (win ? 'MSVC project files' : 'a Makefile') + ' for the current module' @@ -31,97 +33,14 @@ function configure (gyp, argv, callback) { , nodeDir , release = processRelease(argv, gyp, process.version, process.release) - checkPython() - - // Check if Python is in the $PATH - function checkPython () { - log.verbose('check python', 'checking for Python executable "%s" in the PATH', python) - which(python, function (err, execPath) { - if (err) { - log.verbose('`which` failed', python, err) - if (python === 'python2') { - python = 'python' - return checkPython() - } - if (win) { - guessPython() - } else { - failNoPython() - } - } else { - log.verbose('`which` succeeded', python, execPath) - checkPythonVersion() - } - }) - } - - // Called on Windows when "python" isn't available in the current $PATH. - // We're gonna check if "%SystemDrive%\python27\python.exe" exists. - function guessPython () { - log.verbose('could not find "' + python + '". guessing location') - var rootDir = process.env.SystemDrive || 'C:\\' - if (rootDir[rootDir.length - 1] !== '\\') { - rootDir += '\\' + findPython(python, function (err, found) { + if (err) { + callback(err) + } else { + python = found + getNodeDir() } - var pythonPath = path.resolve(rootDir, 'Python27', 'python.exe') - log.verbose('ensuring that file exists:', pythonPath) - fs.stat(pythonPath, function (err, stat) { - if (err) { - if (err.code == 'ENOENT') { - failNoPython() - } else { - callback(err) - } - return - } - python = pythonPath - checkPythonVersion() - }) - } - - function checkPythonVersion () { - var env = extend({}, process.env) - env.TERM = 'dumb' - - execFile(python, ['-c', 'import platform; print(platform.python_version());'], { env: env }, function (err, stdout) { - if (err) { - return callback(err) - } - log.verbose('check python version', '`%s -c "import platform; print(platform.python_version());"` returned: %j', python, stdout) - var version = stdout.trim() - if (~version.indexOf('+')) { - log.silly('stripping "+" sign(s) from version') - version = version.replace(/\+/g, '') - } - if (~version.indexOf('rc')) { - log.silly('stripping "rc" identifier from version') - version = version.replace(/rc(.*)$/ig, '') - } - var range = semver.Range('>=2.5.0 <3.0.0') - var valid = false - try { - valid = range.test(version) - } catch (e) { - log.silly('range.test() error', e) - } - if (valid) { - getNodeDir() - } else { - failPythonVersion(version) - } - }) - } - - function failNoPython () { - callback(new Error('Can\'t find Python executable "' + python + - '", you can set the PYTHON env variable.')) - } - - function failPythonVersion (badVersion) { - callback(new Error('Python executable "' + python + - '" is v' + badVersion + ', which is not supported by gyp.\n' + - 'You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.')) - } + }) function getNodeDir () { @@ -299,6 +218,34 @@ function configure (gyp, argv, callback) { argv.push('-I', config) }) + // for AIX we need to set up the path to the exp file + // which contains the symbols needed for linking. + // The file will either be in one of the following + // depending on whether it is an installed or + // development environment: + // - the include/node directory + // - the out/Release directory + // - the out/Debug directory + // - the root directory + var node_exp_file = '' + if (process.platform === 'aix') { + var node_root_dir = findNodeDirectory() + var candidates = ['include/node/node.exp', + 'out/Release/node.exp', + 'out/Debug/node.exp', + 'node.exp'] + for (var next = 0; next < candidates.length; next++) { + node_exp_file = path.resolve(node_root_dir, candidates[next]) + try { + fs.accessSync(node_exp_file, fs.R_OK) + // exp file found, stop looking + break + } catch (exception) { + // this candidate was not found or not readable, do nothing + } + } + } + // this logic ported from the old `gyp_addon` python file var gyp_script = path.resolve(__dirname, '..', 'gyp', 'gyp_main.py') var addon_gypi = path.resolve(__dirname, '..', 'addon.gypi') @@ -319,6 +266,9 @@ function configure (gyp, argv, callback) { argv.push('-Dlibrary=shared_library') argv.push('-Dvisibility=default') argv.push('-Dnode_root_dir=' + nodeDir) + if (process.platform === 'aix') { + argv.push('-Dnode_exp_file=' + node_exp_file) + } argv.push('-Dnode_gyp_dir=' + nodeGypDir) argv.push('-Dnode_lib_file=' + release.name + '.lib') argv.push('-Dmodule_root_dir=' + process.cwd()) @@ -360,3 +310,101 @@ function configure (gyp, argv, callback) { } } + +function findPython (python, callback) { + checkPython() + + // Check if Python is in the $PATH + function checkPython () { + log.verbose('check python', 'checking for Python executable "%s" in the PATH', python) + which(python, function (err, execPath) { + if (err) { + log.verbose('`which` failed', python, err) + if (python === 'python2') { + python = 'python' + return checkPython() + } + if (win) { + guessPython() + } else { + failNoPython() + } + } else { + log.verbose('`which` succeeded', python, execPath) + // Found the `python` exceutable, and from now on we use it explicitly. + // This solves #667 and #750 (`execFile` won't run batch files + // (*.cmd, and *.bat)) + python = execPath + checkPythonVersion() + } + }) + } + + // Called on Windows when "python" isn't available in the current $PATH. + // We're gonna check if "%SystemDrive%\python27\python.exe" exists. + function guessPython () { + log.verbose('could not find "' + python + '". guessing location') + var rootDir = process.env.SystemDrive || 'C:\\' + if (rootDir[rootDir.length - 1] !== '\\') { + rootDir += '\\' + } + var pythonPath = path.resolve(rootDir, 'Python27', 'python.exe') + log.verbose('ensuring that file exists:', pythonPath) + fs.stat(pythonPath, function (err, stat) { + if (err) { + if (err.code == 'ENOENT') { + failNoPython() + } else { + callback(err) + } + return + } + python = pythonPath + checkPythonVersion() + }) + } + + function checkPythonVersion () { + var env = extend({}, process.env) + env.TERM = 'dumb' + + execFile(python, ['-c', 'import platform; print(platform.python_version());'], { env: env }, function (err, stdout) { + if (err) { + return callback(err) + } + log.verbose('check python version', '`%s -c "import platform; print(platform.python_version());"` returned: %j', python, stdout) + var version = stdout.trim() + if (~version.indexOf('+')) { + log.silly('stripping "+" sign(s) from version') + version = version.replace(/\+/g, '') + } + if (~version.indexOf('rc')) { + log.silly('stripping "rc" identifier from version') + version = version.replace(/rc(.*)$/ig, '') + } + var range = semver.Range('>=2.5.0 <3.0.0') + var valid = false + try { + valid = range.test(version) + } catch (e) { + log.silly('range.test() error', e) + } + if (valid) { + callback(null, python) + } else { + failPythonVersion(version) + } + }) + } + + function failNoPython () { + callback(new Error('Can\'t find Python executable "' + python + + '", you can set the PYTHON env variable.')) + } + + function failPythonVersion (badVersion) { + callback(new Error('Python executable "' + python + + '" is v' + badVersion + ', which is not supported by gyp.\n' + + 'You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.')) + } +} diff --git a/deps/npm/node_modules/node-gyp/lib/find-node-directory.js b/deps/npm/node_modules/node-gyp/lib/find-node-directory.js new file mode 100644 index 00000000000000..3aee8a109ae280 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/lib/find-node-directory.js @@ -0,0 +1,61 @@ +var path = require('path') + , log = require('npmlog') + +function findNodeDirectory(scriptLocation, processObj) { + // set dirname and process if not passed in + // this facilitates regression tests + if (scriptLocation === undefined) { + scriptLocation = __dirname + } + if (processObj === undefined) { + processObj = process + } + + // Have a look to see what is above us, to try and work out where we are + npm_parent_directory = path.join(scriptLocation, '../../../..') + log.verbose('node-gyp root', 'npm_parent_directory is ' + + path.basename(npm_parent_directory)) + node_root_dir = "" + + log.verbose('node-gyp root', 'Finding node root directory') + if (path.basename(npm_parent_directory) === 'deps') { + // We are in a build directory where this script lives in + // deps/npm/node_modules/node-gyp/lib + node_root_dir = path.join(npm_parent_directory, '..') + log.verbose('node-gyp root', 'in build directory, root = ' + + node_root_dir) + } else if (path.basename(npm_parent_directory) === 'node_modules') { + // We are in a node install directory where this script lives in + // lib/node_modules/npm/node_modules/node-gyp/lib or + // node_modules/npm/node_modules/node-gyp/lib depending on the + // platform + if (processObj.platform === 'win32') { + node_root_dir = path.join(npm_parent_directory, '..') + } else { + node_root_dir = path.join(npm_parent_directory, '../..') + } + log.verbose('node-gyp root', 'in install directory, root = ' + + node_root_dir) + } else { + // We don't know where we are, try working it out from the location + // of the node binary + var node_dir = path.dirname(processObj.execPath) + var directory_up = path.basename(node_dir) + if (directory_up === 'bin') { + node_root_dir = path.join(node_dir, '..') + } else if (directory_up === 'Release' || directory_up === 'Debug') { + // If we are a recently built node, and the directory structure + // is that of a repository. If we are on Windows then we only need + // to go one level up, everything else, two + if (processObj.platform === 'win32') { + node_root_dir = path.join(node_dir, '..') + } else { + node_root_dir = path.join(node_dir, '../..') + } + } + // Else return the default blank, "". + } + return node_root_dir +} + +module.exports = findNodeDirectory diff --git a/deps/npm/node_modules/node-gyp/lib/install.js b/deps/npm/node_modules/node-gyp/lib/install.js index ddad77ec2b9509..fa2e1c5430086b 100644 --- a/deps/npm/node_modules/node-gyp/lib/install.js +++ b/deps/npm/node_modules/node-gyp/lib/install.js @@ -1,6 +1,8 @@ module.exports = exports = install +module.exports.test = { download: download, readCAFile: readCAFile } + exports.usage = 'Install node development files for the specified node version.' /** @@ -110,45 +112,6 @@ function install (gyp, argv, callback) { go() } - function download (url) { - log.http('GET', url) - - var req = null - var requestOpts = { - uri: url - , headers: { - 'User-Agent': 'node-gyp v' + gyp.version + ' (node ' + process.version + ')' - } - } - - // basic support for a proxy server - var proxyUrl = gyp.opts.proxy - || process.env.http_proxy - || process.env.HTTP_PROXY - || process.env.npm_config_proxy - if (proxyUrl) { - if (/^https?:\/\//i.test(proxyUrl)) { - log.verbose('download', 'using proxy url: "%s"', proxyUrl) - requestOpts.proxy = proxyUrl - } else { - log.warn('download', 'ignoring invalid "proxy" config setting: "%s"', proxyUrl) - } - } - try { - // The "request" constructor can throw sometimes apparently :( - // See: https://github.com/nodejs/node-gyp/issues/114 - req = request(requestOpts) - } catch (e) { - cb(e) - } - if (req) { - req.on('response', function (res) { - log.http(res.statusCode, url) - }) - } - return req - } - function getContentSha(res, callback) { var shasum = crypto.createHash('sha256') res.on('data', function (chunk) { @@ -218,8 +181,11 @@ function install (gyp, argv, callback) { return } - var req = download(release.tarballUrl) - if (!req) return + try { + var req = download(gyp, process.env, release.tarballUrl) + } catch (e) { + return cb(e) + } // something went wrong downloading the tarball? req.on('error', function (err) { @@ -311,8 +277,12 @@ function install (gyp, argv, callback) { var shasumsPath = path.resolve(devDir, 'SHASUMS256.txt') log.verbose('checksum url', release.shasumsUrl) - var req = download(release.shasumsUrl) - if (!req) return + try { + var req = download(gyp, process.env, release.shasumsUrl) + } catch (e) { + return cb(e) + } + req.on('error', done) req.on('response', function (res) { if (res.statusCode !== 200) { @@ -358,8 +328,12 @@ function install (gyp, argv, callback) { if (err) return done(err) log.verbose('streaming 32-bit ' + release.name + '.lib to:', libPath32) - var req = download(release.libUrl32) - if (!req) return + try { + var req = download(gyp, process.env, release.libUrl32, cb) + } catch (e) { + return cb(e) + } + req.on('error', done) req.on('response', function (res) { if (res.statusCode !== 200) { @@ -384,8 +358,12 @@ function install (gyp, argv, callback) { if (err) return done(err) log.verbose('streaming 64-bit ' + release.name + '.lib to:', libPath64) - var req = download(release.libUrl64) - if (!req) return + try { + var req = download(gyp, process.env, release.libUrl64, cb) + } catch (e) { + return cb(e) + } + req.on('error', done) req.on('response', function (res) { if (res.statusCode !== 200) { @@ -444,3 +422,48 @@ function install (gyp, argv, callback) { } } + +function download (gyp, env, url) { + log.http('GET', url) + + var requestOpts = { + uri: url + , headers: { + 'User-Agent': 'node-gyp v' + gyp.version + ' (node ' + process.version + ')' + } + } + + var cafile = gyp.opts.cafile + if (cafile) { + requestOpts.ca = readCAFile(cafile) + } + + // basic support for a proxy server + var proxyUrl = gyp.opts.proxy + || env.http_proxy + || env.HTTP_PROXY + || env.npm_config_proxy + if (proxyUrl) { + if (/^https?:\/\//i.test(proxyUrl)) { + log.verbose('download', 'using proxy url: "%s"', proxyUrl) + requestOpts.proxy = proxyUrl + } else { + log.warn('download', 'ignoring invalid "proxy" config setting: "%s"', proxyUrl) + } + } + + var req = request(requestOpts) + req.on('response', function (res) { + log.http(res.statusCode, url) + }) + + return req +} + +function readCAFile (filename) { + // The CA file can contain multiple certificates so split on certificate + // boundaries. [\S\s]*? is used to match everything including newlines. + var ca = fs.readFileSync(filename, 'utf8') + var re = /(-----BEGIN CERTIFICATE-----[\S\s]*?-----END CERTIFICATE-----)/g + return ca.match(re) +} diff --git a/deps/npm/node_modules/node-gyp/lib/node-gyp.js b/deps/npm/node_modules/node-gyp/lib/node-gyp.js index d6d6509a7a8b03..a5a332885597bf 100644 --- a/deps/npm/node_modules/node-gyp/lib/node-gyp.js +++ b/deps/npm/node_modules/node-gyp/lib/node-gyp.js @@ -84,6 +84,7 @@ proto.package = require('../package') proto.configDefs = { help: Boolean // everywhere , arch: String // 'configure' + , cafile: String // 'install' , debug: Boolean // 'build' , directory: String // bin , make: String // 'build' @@ -164,7 +165,9 @@ proto.parseArgv = function parseOpts (argv) { } else { // add the user-defined options to the config name = name.substring(npm_config_prefix.length) - this.opts[name] = val + // gyp@741b7f1 enters an infinite loop when it encounters + // zero-length options so ensure those don't get through. + if (name) this.opts[name] = val } }, this) diff --git a/deps/npm/node_modules/node-gyp/lib/process-release.js b/deps/npm/node_modules/node-gyp/lib/process-release.js index 2a574f437e10af..f5a3cca6357b6d 100644 --- a/deps/npm/node_modules/node-gyp/lib/process-release.js +++ b/deps/npm/node_modules/node-gyp/lib/process-release.js @@ -1,7 +1,10 @@ var semver = require('semver') , url = require('url') , path = require('path') + , log = require('npmlog') + // versions where -headers.tar.gz started shipping + , headersTarballRange = '>= 3.0.0 || ~0.12.10 || ~0.10.42' , bitsre = /\/win-(x86|x64)\// , bitsreV3 = /\/win-(x86|ia32|x64)\// // io.js v3.x.x shipped with "ia32" but should // have been "x86" @@ -21,6 +24,7 @@ function processRelease (argv, gyp, defaultVersion, defaultRelease) { , libUrl32 , libUrl64 , tarballUrl + , canGetHeaders if (!versionSemver) { // not a valid semver string, nothing we can do @@ -49,10 +53,25 @@ function processRelease (argv, gyp, defaultVersion, defaultRelease) { // check for the nvm.sh standard mirror env variables if (!overrideDistUrl) { - if (isIojs && process.env.NVM_IOJS_ORG_MIRROR) - overrideDistUrl = process.env.NVM_IOJS_ORG_MIRROR - else if (process.env.NVM_NODEJS_ORG_MIRROR) - overrideDistUrl = process.env.NVM_NODEJS_ORG_MIRROR + if (isIojs) { + if (process.env.IOJS_ORG_MIRROR) { + overrideDistUrl = process.env.IOJS_ORG_MIRROR + } else if (process.env.NVM_IOJS_ORG_MIRROR) {// remove on next semver-major + overrideDistUrl = process.env.NVM_IOJS_ORG_MIRROR + log.warn('download', + 'NVM_IOJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, ' + + 'please use IOJS_ORG_MIRROR') + } + } else { + if (process.env.NODEJS_ORG_MIRROR) { + overrideDistUrl = process.env.NODEJS_ORG_MIRROR + } else if (process.env.NVM_NODEJS_ORG_MIRROR) {// remove on next semver-major + overrideDistUrl = process.env.NVM_NODEJS_ORG_MIRROR + log.warn('download', + 'NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, ' + + 'please use NODEJS_ORG_MIRROR') + } + } } @@ -93,7 +112,8 @@ function processRelease (argv, gyp, defaultVersion, defaultRelease) { // making the bold assumption that anything with a version number >3.0.0 will // have a *-headers.tar.gz file in its dist location, even some frankenstein // custom version - tarballUrl = url.resolve(baseUrl, name + '-v' + version + (versionSemver.major >= 3 ? '-headers' : '') + '.tar.gz') + canGetHeaders = semver.satisfies(versionSemver, headersTarballRange) + tarballUrl = url.resolve(baseUrl, name + '-v' + version + (canGetHeaders ? '-headers' : '') + '.tar.gz') return { version: version, diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore index 249bc20eb5573c..353546af2368e1 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore @@ -1,2 +1,3 @@ -node_modules -*.sw* +test +.gitignore +.travis.yml diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md index 62bc7bae3fed28..b0d793ed5d9016 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md @@ -1,9 +1,10 @@ # brace-expansion -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), as known from sh/bash, in JavaScript. [![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) +[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) [![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js index 60ecfc74d41618..36cde4de5c114b 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js @@ -5,4 +5,3 @@ console.log(expand('http://www.numericals.com/file{1..100..10}.txt')); console.log(expand('http://www.letters.com/file{a..z..2}.txt')); console.log(expand('mkdir /usr/local/src/bash/{old,new,dist,bugs}')); console.log(expand('chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}')); - diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js index a23104e9550173..abe535df327354 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js @@ -99,7 +99,7 @@ function expand(str, isTop) { var isOptions = /^(.*,)+(.+)?$/.test(m.body); if (!isSequence && !isOptions) { // {a},b} - if (m.post.match(/,.*}/)) { + if (m.post.match(/,.*\}/)) { str = m.pre + '{' + m.body + escClose + m.post; return expand(str); } @@ -188,4 +188,3 @@ function expand(str, isTop) { return expansions; } - diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml index cc4dba29d959a2..6e5919de39a312 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml @@ -1,4 +1,3 @@ language: node_js node_js: - - "0.8" - "0.10" diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md new file mode 100644 index 00000000000000..2cdc8e4148cc0a --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md @@ -0,0 +1,21 @@ +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile index fa5da71a6d0d34..dd2730cfde0cab 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile @@ -3,4 +3,3 @@ test: @node_modules/.bin/tape test/*.js .PHONY: test - diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md index 2aff0ebff4403e..421f3aa5f951a2 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md @@ -47,6 +47,15 @@ If there's no match, `undefined` will be returned. If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`. +### var r = balanced.range(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +array with indexes: `[ , ]`. + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]`. + ## Installation With [npm](https://npmjs.org) do: diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js index c02ad348e69aec..9ce76f480a4321 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js @@ -2,4 +2,3 @@ var balanced = require('./'); console.log(balanced('{', '}', 'pre{in{nested}}post')); console.log(balanced('{', '}', 'pre{first}between{second}post')); - diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js index d165ae8174ca82..75f3d71cba90bc 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js @@ -1,38 +1,50 @@ module.exports = balanced; function balanced(a, b, str) { - var bal = 0; - var m = {}; - var ended = false; - - for (var i = 0; i < str.length; i++) { - if (a == str.substr(i, a.length)) { - if (!('start' in m)) m.start = i; - bal++; - } - else if (b == str.substr(i, b.length) && 'start' in m) { - ended = true; - bal--; - if (!bal) { - m.end = i; - m.pre = str.substr(0, m.start); - m.body = (m.end - m.start > 1) - ? str.substring(m.start + a.length, m.end) - : ''; - m.post = str.slice(m.end + b.length); - return m; + var r = range(a, b, str); + + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} + +balanced.range = range; +function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; + + if (ai >= 0 && bi > 0) { + begs = []; + left = str.length; + + while (i < str.length && i >= 0 && ! result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + + bi = str.indexOf(b, i + 1); } + + i = ai < bi && ai >= 0 ? ai : bi; } - } - // if we opened more than we closed, find the one we closed - if (bal && ended) { - var start = m.start + a.length; - m = balanced(a, b, str.substr(start)); - if (m) { - m.start += start; - m.end += start; - m.pre = str.slice(0, start) + m.pre; + if (begs.length) { + result = [ left, right ]; } - return m; } + + return result; } diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json index ede6efefa07883..ac0c6aaca5848e 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json @@ -1,73 +1,98 @@ { - "name": "balanced-match", - "description": "Match balanced character pairs, like \"{\" and \"}\"", - "version": "0.2.0", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/balanced-match.git" - }, - "homepage": "https://github.com/juliangruber/balanced-match", - "main": "index.js", - "scripts": { - "test": "make test" + "_args": [ + [ + "balanced-match@^0.3.0", + "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" + ] + ], + "_from": "balanced-match@>=0.3.0 <0.4.0", + "_id": "balanced-match@0.3.0", + "_inCache": true, + "_installable": true, + "_location": "/node-gyp/glob/minimatch/brace-expansion/balanced-match", + "_nodeVersion": "4.2.1", + "_npmUser": { + "email": "julian@juliangruber.com", + "name": "juliangruber" }, - "dependencies": {}, - "devDependencies": { - "tape": "~1.1.1" + "_npmVersion": "2.14.7", + "_phantomChildren": {}, + "_requested": { + "name": "balanced-match", + "raw": "balanced-match@^0.3.0", + "rawSpec": "^0.3.0", + "scope": null, + "spec": ">=0.3.0 <0.4.0", + "type": "range" }, - "keywords": [ - "match", - "regexp", - "test", - "balanced", - "parse" + "_requiredBy": [ + "/node-gyp/glob/minimatch/brace-expansion" ], + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz", + "_shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756", + "_shrinkwrap": null, + "_spec": "balanced-match@^0.3.0", + "_where": "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion", "author": { - "name": "Julian Gruber", "email": "mail@juliangruber.com", + "name": "Julian Gruber", "url": "http://juliangruber.com" }, - "license": "MIT", - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "gitHead": "ba40ed78e7114a4a67c51da768a100184dead39c", "bugs": { "url": "https://github.com/juliangruber/balanced-match/issues" }, - "_id": "balanced-match@0.2.0", - "_shasum": "38f6730c03aab6d5edbb52bd934885e756d71674", - "_from": "balanced-match@>=0.2.0 <0.3.0", - "_npmVersion": "2.1.8", - "_nodeVersion": "0.10.32", - "_npmUser": { - "name": "juliangruber", - "email": "julian@juliangruber.com" + "dependencies": {}, + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "devDependencies": { + "tape": "~4.2.2" }, + "directories": {}, + "dist": { + "shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756", + "tarball": "http://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz" + }, + "gitHead": "a7114b0986554787e90b7ac595a043ca75ea77e5", + "homepage": "https://github.com/juliangruber/balanced-match", + "keywords": [ + "balanced", + "match", + "parse", + "regexp", + "test" + ], + "license": "MIT", + "main": "index.js", "maintainers": [ { "name": "juliangruber", "email": "julian@juliangruber.com" } ], - "dist": { - "shasum": "38f6730c03aab6d5edbb52bd934885e756d71674", - "tarball": "http://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz" + "name": "balanced-match", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz", - "readme": "ERROR: No README data found!" + "scripts": { + "test": "make test" + }, + "testling": { + "browsers": [ + "android-browser/4.2..latest", + "chrome/25..latest", + "chrome/canary", + "firefox/20..latest", + "firefox/nightly", + "ie/8..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "opera/12..latest", + "opera/next", + "safari/5.1..latest" + ], + "files": "test/*.js" + }, + "version": "0.3.0" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js index 36bfd39954850d..f5e98e3f2a3240 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js @@ -52,5 +52,33 @@ test('balanced', function(t) { body: 'innest', post: 'post' }); + t.deepEqual(balanced('{{', '}}', 'pre{{{in}}}post'), { + start: 3, + end: 9, + pre: 'pre', + body: '{in}', + post: 'post' + }); + t.deepEqual(balanced('{{{', '}}', 'pre{{{in}}}post'), { + start: 3, + end: 8, + pre: 'pre', + body: 'in', + post: '}post' + }); + t.deepEqual(balanced('{', '}', 'pre{{first}in{second}post'), { + start: 4, + end: 10, + pre: 'pre{', + body: 'first', + post: 'in{second}post' + }); + t.deepEqual(balanced('', 'prepost'), { + start: 3, + end: 4, + pre: 'pre', + body: '', + post: 'post' + }); t.end(); }); diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json index b516138098fba9..15acbe5c07ae55 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json @@ -1,83 +1,109 @@ { - "name": "concat-map", + "_args": [ + [ + "concat-map@0.0.1", + "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" + ] + ], + "_from": "concat-map@0.0.1", + "_id": "concat-map@0.0.1", + "_inCache": true, + "_installable": true, + "_location": "/node-gyp/glob/minimatch/brace-expansion/concat-map", + "_npmUser": { + "email": "mail@substack.net", + "name": "substack" + }, + "_npmVersion": "1.3.21", + "_phantomChildren": {}, + "_requested": { + "name": "concat-map", + "raw": "concat-map@0.0.1", + "rawSpec": "0.0.1", + "scope": null, + "spec": "0.0.1", + "type": "version" + }, + "_requiredBy": [ + "/node-gyp/glob/minimatch/brace-expansion" + ], + "_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", + "_shrinkwrap": null, + "_spec": "concat-map@0.0.1", + "_where": "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion", + "author": { + "email": "mail@substack.net", + "name": "James Halliday", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/node-concat-map/issues" + }, + "dependencies": {}, "description": "concatenative mapdashery", - "version": "0.0.1", - "repository": { - "type": "git", - "url": "git://github.com/substack/node-concat-map.git" + "devDependencies": { + "tape": "~2.4.0" }, - "main": "index.js", + "directories": { + "example": "example", + "test": "test" + }, + "dist": { + "shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", + "tarball": "http://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + }, + "homepage": "https://github.com/substack/node-concat-map", "keywords": [ "concat", "concatMap", - "map", "functional", - "higher-order" + "higher-order", + "map" ], - "directories": { - "example": "example", - "test": "test" + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "name": "concat-map", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/substack/node-concat-map.git" }, "scripts": { "test": "tape test/*.js" }, - "devDependencies": { - "tape": "~2.4.0" - }, - "license": "MIT", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, "testling": { - "files": "test/*.js", "browsers": { + "chrome": [ + 10, + 22 + ], + "ff": [ + 10, + 15, + 3.5 + ], "ie": [ 6, 7, 8, 9 ], - "ff": [ - 3.5, - 10, - 15 - ], - "chrome": [ - 10, - 22 + "opera": [ + 12 ], "safari": [ 5.1 - ], - "opera": [ - 12 ] - } - }, - "bugs": { - "url": "https://github.com/substack/node-concat-map/issues" - }, - "homepage": "https://github.com/substack/node-concat-map", - "_id": "concat-map@0.0.1", - "dist": { - "shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", - "tarball": "http://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + }, + "files": "test/*.js" }, - "_from": "concat-map@0.0.1", - "_npmVersion": "1.3.21", - "_npmUser": { - "name": "substack", - "email": "mail@substack.net" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", - "_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "readme": "ERROR: No README data found!" + "version": "0.0.1" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json index 5f1866c8b5a29e..fffa04e2966692 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json @@ -1,33 +1,90 @@ { - "name": "brace-expansion", - "description": "Brace expansion as known from sh/bash", - "version": "1.1.0", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/brace-expansion.git" + "_args": [ + [ + "brace-expansion@^1.0.0", + "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch" + ] + ], + "_from": "brace-expansion@>=1.0.0 <2.0.0", + "_id": "brace-expansion@1.1.3", + "_inCache": true, + "_installable": true, + "_location": "/node-gyp/glob/minimatch/brace-expansion", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-6-west.internal.npmjs.com", + "tmp": "tmp/brace-expansion-1.1.3.tgz_1455216688668_0.948847763473168" }, - "homepage": "https://github.com/juliangruber/brace-expansion", - "main": "index.js", - "scripts": { - "test": "tape test/*.js", - "gentest": "bash test/generate.sh" + "_npmUser": { + "email": "julian@juliangruber.com", + "name": "juliangruber" + }, + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "name": "brace-expansion", + "raw": "brace-expansion@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/glob/minimatch" + ], + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz", + "_shasum": "46bff50115d47fc9ab89854abb87d98078a10991", + "_shrinkwrap": null, + "_spec": "brace-expansion@^1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch", + "author": { + "email": "mail@juliangruber.com", + "name": "Julian Gruber", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/brace-expansion/issues" }, "dependencies": { - "balanced-match": "^0.2.0", + "balanced-match": "^0.3.0", "concat-map": "0.0.1" }, + "description": "Brace expansion as known from sh/bash", "devDependencies": { - "tape": "^3.0.3" + "tape": "4.4.0" }, - "keywords": [], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" + "directories": {}, + "dist": { + "shasum": "46bff50115d47fc9ab89854abb87d98078a10991", + "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz" }, + "gitHead": "f0da1bb668e655f67b6b2d660c6e1c19e2a6f231", + "homepage": "https://github.com/juliangruber/brace-expansion", + "keywords": [], "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "email": "julian@juliangruber.com", + "name": "juliangruber" + }, + { + "email": "isaacs@npmjs.com", + "name": "isaacs" + } + ], + "name": "brace-expansion", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/brace-expansion.git" + }, + "scripts": { + "gentest": "bash test/generate.sh", + "test": "tape test/*.js" + }, "testling": { - "files": "test/*.js", "browsers": [ "ie/8..latest", "firefox/20..latest", @@ -40,36 +97,8 @@ "ipad/6.0..latest", "iphone/6.0..latest", "android-browser/4.2..latest" - ] + ], + "files": "test/*.js" }, - "gitHead": "b5fa3b1c74e5e2dba2d0efa19b28335641bc1164", - "bugs": { - "url": "https://github.com/juliangruber/brace-expansion/issues" - }, - "_id": "brace-expansion@1.1.0", - "_shasum": "c9b7d03c03f37bc704be100e522b40db8f6cfcd9", - "_from": "brace-expansion@>=1.0.0 <2.0.0", - "_npmVersion": "2.1.10", - "_nodeVersion": "0.10.32", - "_npmUser": { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - "maintainers": [ - { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - { - "name": "isaacs", - "email": "isaacs@npmjs.com" - } - ], - "dist": { - "shasum": "c9b7d03c03f37bc704be100e522b40db8f6cfcd9", - "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.0.tgz", - "readme": "ERROR: No README data found!" + "version": "1.1.3" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js deleted file mode 100644 index 5fe2b8ad48cc1c..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js +++ /dev/null @@ -1,32 +0,0 @@ -var test = require('tape'); -var expand = require('..'); -var fs = require('fs'); -var resfile = __dirname + '/bash-results.txt'; -var cases = fs.readFileSync(resfile, 'utf8').split('><><><><'); - -// throw away the EOF marker -cases.pop() - -test('matches bash expansions', function(t) { - cases.forEach(function(testcase) { - var set = testcase.split('\n'); - var pattern = set.shift(); - var actual = expand(pattern); - - // If it expands to the empty string, then it's actually - // just nothing, but Bash is a singly typed language, so - // "nothing" is the same as "". - if (set.length === 1 && set[0] === '') { - set = [] - } else { - // otherwise, strip off the [] that were added so that - // "" expansions would be preserved properly. - set = set.map(function (s) { - return s.replace(/^\[|\]$/g, '') - }) - } - - t.same(actual, set, pattern); - }); - t.end(); -}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt deleted file mode 100644 index 958148d26aacb9..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt +++ /dev/null @@ -1,1075 +0,0 @@ -A{b,{d,e},{f,g}}Z -[AbZ] -[AdZ] -[AeZ] -[AfZ] -[AgZ]><><><><><><><\{a,b}{{a,b},a,b} -[{a,b}a] -[{a,b}b] -[{a,b}a] -[{a,b}b]><><><><{{a,b} -[{a] -[{b]><><><><{a,b}} -[a}] -[b}]><><><><{,} -><><><><><><><{,}b -[b] -[b]><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><{-01..5} -[-01] -[000] -[001] -[002] -[003] -[004] -[005]><><><><{-05..100..5} -[-05] -[000] -[005] -[010] -[015] -[020] -[025] -[030] -[035] -[040] -[045] -[050] -[055] -[060] -[065] -[070] -[075] -[080] -[085] -[090] -[095] -[100]><><><><{-05..100} -[-05] -[-04] -[-03] -[-02] -[-01] -[000] -[001] -[002] -[003] -[004] -[005] -[006] -[007] -[008] -[009] -[010] -[011] -[012] -[013] -[014] -[015] -[016] -[017] -[018] -[019] -[020] -[021] -[022] -[023] -[024] -[025] -[026] -[027] -[028] -[029] -[030] -[031] -[032] -[033] -[034] -[035] -[036] -[037] -[038] -[039] -[040] -[041] -[042] -[043] -[044] -[045] -[046] -[047] -[048] -[049] -[050] -[051] -[052] -[053] -[054] -[055] -[056] -[057] -[058] -[059] -[060] -[061] -[062] -[063] -[064] -[065] -[066] -[067] -[068] -[069] -[070] -[071] -[072] -[073] -[074] -[075] -[076] -[077] -[078] -[079] -[080] -[081] -[082] -[083] -[084] -[085] -[086] -[087] -[088] -[089] -[090] -[091] -[092] -[093] -[094] -[095] -[096] -[097] -[098] -[099] -[100]><><><><{0..5..2} -[0] -[2] -[4]><><><><{0001..05..2} -[0001] -[0003] -[0005]><><><><{0001..-5..2} -[0001] -[-001] -[-003] -[-005]><><><><{0001..-5..-2} -[0001] -[-001] -[-003] -[-005]><><><><{0001..5..-2} -[0001] -[0003] -[0005]><><><><{01..5} -[01] -[02] -[03] -[04] -[05]><><><><{1..05} -[01] -[02] -[03] -[04] -[05]><><><><{1..05..3} -[01] -[04]><><><><{05..100} -[005] -[006] -[007] -[008] -[009] -[010] -[011] -[012] -[013] -[014] -[015] -[016] -[017] -[018] -[019] -[020] -[021] -[022] -[023] -[024] -[025] -[026] -[027] -[028] -[029] -[030] -[031] -[032] -[033] -[034] -[035] -[036] -[037] -[038] -[039] -[040] -[041] -[042] -[043] -[044] -[045] -[046] -[047] -[048] -[049] -[050] -[051] -[052] -[053] -[054] -[055] -[056] -[057] -[058] -[059] -[060] -[061] -[062] -[063] -[064] -[065] -[066] -[067] -[068] -[069] -[070] -[071] -[072] -[073] -[074] -[075] -[076] -[077] -[078] -[079] -[080] -[081] -[082] -[083] -[084] -[085] -[086] -[087] -[088] -[089] -[090] -[091] -[092] -[093] -[094] -[095] -[096] -[097] -[098] -[099] -[100]><><><><{0a..0z} -[{0a..0z}]><><><><{a,b\}c,d} -[a] -[b}c] -[d]><><><><{a,b{c,d} -[{a,bc] -[{a,bd]><><><><{a,b}c,d} -[ac,d}] -[bc,d}]><><><><{a..F} -[a] -[`] -[_] -[^] -[]] -[] -[[] -[Z] -[Y] -[X] -[W] -[V] -[U] -[T] -[S] -[R] -[Q] -[P] -[O] -[N] -[M] -[L] -[K] -[J] -[I] -[H] -[G] -[F]><><><><{A..f} -[A] -[B] -[C] -[D] -[E] -[F] -[G] -[H] -[I] -[J] -[K] -[L] -[M] -[N] -[O] -[P] -[Q] -[R] -[S] -[T] -[U] -[V] -[W] -[X] -[Y] -[Z] -[[] -[] -[]] -[^] -[_] -[`] -[a] -[b] -[c] -[d] -[e] -[f]><><><><{a..Z} -[a] -[`] -[_] -[^] -[]] -[] -[[] -[Z]><><><><{A..z} -[A] -[B] -[C] -[D] -[E] -[F] -[G] -[H] -[I] -[J] -[K] -[L] -[M] -[N] -[O] -[P] -[Q] -[R] -[S] -[T] -[U] -[V] -[W] -[X] -[Y] -[Z] -[[] -[] -[]] -[^] -[_] -[`] -[a] -[b] -[c] -[d] -[e] -[f] -[g] -[h] -[i] -[j] -[k] -[l] -[m] -[n] -[o] -[p] -[q] -[r] -[s] -[t] -[u] -[v] -[w] -[x] -[y] -[z]><><><><{z..A} -[z] -[y] -[x] -[w] -[v] -[u] -[t] -[s] -[r] -[q] -[p] -[o] -[n] -[m] -[l] -[k] -[j] -[i] -[h] -[g] -[f] -[e] -[d] -[c] -[b] -[a] -[`] -[_] -[^] -[]] -[] -[[] -[Z] -[Y] -[X] -[W] -[V] -[U] -[T] -[S] -[R] -[Q] -[P] -[O] -[N] -[M] -[L] -[K] -[J] -[I] -[H] -[G] -[F] -[E] -[D] -[C] -[B] -[A]><><><><{Z..a} -[Z] -[[] -[] -[]] -[^] -[_] -[`] -[a]><><><><{a..F..2} -[a] -[_] -[]] -[[] -[Y] -[W] -[U] -[S] -[Q] -[O] -[M] -[K] -[I] -[G]><><><><{A..f..02} -[A] -[C] -[E] -[G] -[I] -[K] -[M] -[O] -[Q] -[S] -[U] -[W] -[Y] -[[] -[]] -[_] -[a] -[c] -[e]><><><><{a..Z..5} -[a] -[]><><><><><><><{A..z..10} -[A] -[K] -[U] -[_] -[i] -[s]><><><><{z..A..-2} -[z] -[x] -[v] -[t] -[r] -[p] -[n] -[l] -[j] -[h] -[f] -[d] -[b] -[`] -[^] -[] -[Z] -[X] -[V] -[T] -[R] -[P] -[N] -[L] -[J] -[H] -[F] -[D] -[B]><><><><{Z..a..20} -[Z]><><><><{a{,b} -[{a] -[{ab]><><><><{a},b} -[a}] -[b]><><><><{x,y{,}g} -[x] -[yg] -[yg]><><><><{x,y{}g} -[x] -[y{}g]><><><><{{a,b} -[{a] -[{b]><><><><{{a,b},c} -[a] -[b] -[c]><><><><{{a,b}c} -[{ac}] -[{bc}]><><><><{{a,b},} -[a] -[b]><><><><><><><{{a,b},}c -[ac] -[bc] -[c]><><><><{{a,b}.} -[{a.}] -[{b.}]><><><><{{a,b}} -[{a}] -[{b}]><><><><><><>< -><><><><{-10..00} -[-10] -[-09] -[-08] -[-07] -[-06] -[-05] -[-04] -[-03] -[-02] -[-01] -[000]><><><><{a,\\{a,b}c} -[a] -[\ac] -[\bc]><><><><{a,\{a,b}c} -[ac}] -[{ac}] -[bc}]><><><><><><><{-10.\.00} -[{-10..00}]><><><><><><><><><><{l,n,m}xyz -[lxyz] -[nxyz] -[mxyz]><><><><{abc\,def} -[{abc,def}]><><><><{abc} -[{abc}]><><><><{x\,y,\{abc\},trie} -[x,y] -[{abc}] -[trie]><><><><{} -[{}]><><><><} -[}]><><><><{ -[{]><><><><><><><{1..10} -[1] -[2] -[3] -[4] -[5] -[6] -[7] -[8] -[9] -[10]><><><><{0..10,braces} -[0..10] -[braces]><><><><{{0..10},braces} -[0] -[1] -[2] -[3] -[4] -[5] -[6] -[7] -[8] -[9] -[10] -[braces]><><><><><><><{3..3} -[3]><><><><><><><{10..1} -[10] -[9] -[8] -[7] -[6] -[5] -[4] -[3] -[2] -[1]><><><><{10..1}y -[10y] -[9y] -[8y] -[7y] -[6y] -[5y] -[4y] -[3y] -[2y] -[1y]><><><><><><><{a..f} -[a] -[b] -[c] -[d] -[e] -[f]><><><><{f..a} -[f] -[e] -[d] -[c] -[b] -[a]><><><><{a..A} -[a] -[`] -[_] -[^] -[]] -[] -[[] -[Z] -[Y] -[X] -[W] -[V] -[U] -[T] -[S] -[R] -[Q] -[P] -[O] -[N] -[M] -[L] -[K] -[J] -[I] -[H] -[G] -[F] -[E] -[D] -[C] -[B] -[A]><><><><{A..a} -[A] -[B] -[C] -[D] -[E] -[F] -[G] -[H] -[I] -[J] -[K] -[L] -[M] -[N] -[O] -[P] -[Q] -[R] -[S] -[T] -[U] -[V] -[W] -[X] -[Y] -[Z] -[[] -[] -[]] -[^] -[_] -[`] -[a]><><><><{f..f} -[f]><><><><{1..f} -[{1..f}]><><><><{f..1} -[{f..1}]><><><><{-1..-10} -[-1] -[-2] -[-3] -[-4] -[-5] -[-6] -[-7] -[-8] -[-9] -[-10]><><><><{-20..0} -[-20] -[-19] -[-18] -[-17] -[-16] -[-15] -[-14] -[-13] -[-12] -[-11] -[-10] -[-9] -[-8] -[-7] -[-6] -[-5] -[-4] -[-3] -[-2] -[-1] -[0]><><><><><><><><><><{klklkl}{1,2,3} -[{klklkl}1] -[{klklkl}2] -[{klklkl}3]><><><><{1..10..2} -[1] -[3] -[5] -[7] -[9]><><><><{-1..-10..2} -[-1] -[-3] -[-5] -[-7] -[-9]><><><><{-1..-10..-2} -[-1] -[-3] -[-5] -[-7] -[-9]><><><><{10..1..-2} -[10] -[8] -[6] -[4] -[2]><><><><{10..1..2} -[10] -[8] -[6] -[4] -[2]><><><><{1..20..2} -[1] -[3] -[5] -[7] -[9] -[11] -[13] -[15] -[17] -[19]><><><><{1..20..20} -[1]><><><><{100..0..5} -[100] -[95] -[90] -[85] -[80] -[75] -[70] -[65] -[60] -[55] -[50] -[45] -[40] -[35] -[30] -[25] -[20] -[15] -[10] -[5] -[0]><><><><{100..0..-5} -[100] -[95] -[90] -[85] -[80] -[75] -[70] -[65] -[60] -[55] -[50] -[45] -[40] -[35] -[30] -[25] -[20] -[15] -[10] -[5] -[0]><><><><{a..z} -[a] -[b] -[c] -[d] -[e] -[f] -[g] -[h] -[i] -[j] -[k] -[l] -[m] -[n] -[o] -[p] -[q] -[r] -[s] -[t] -[u] -[v] -[w] -[x] -[y] -[z]><><><><{a..z..2} -[a] -[c] -[e] -[g] -[i] -[k] -[m] -[o] -[q] -[s] -[u] -[w] -[y]><><><><{z..a..-2} -[z] -[x] -[v] -[t] -[r] -[p] -[n] -[l] -[j] -[h] -[f] -[d] -[b]><><><><{2147483645..2147483649} -[2147483645] -[2147483646] -[2147483647] -[2147483648] -[2147483649]><><><><{10..0..2} -[10] -[8] -[6] -[4] -[2] -[0]><><><><{10..0..-2} -[10] -[8] -[6] -[4] -[2] -[0]><><><><{-50..-0..5} -[-50] -[-45] -[-40] -[-35] -[-30] -[-25] -[-20] -[-15] -[-10] -[-5] -[0]><><><><{1..10.f} -[{1..10.f}]><><><><{1..ff} -[{1..ff}]><><><><{1..10..ff} -[{1..10..ff}]><><><><{1.20..2} -[{1.20..2}]><><><><{1..20..f2} -[{1..20..f2}]><><><><{1..20..2f} -[{1..20..2f}]><><><><{1..2f..2} -[{1..2f..2}]><><><><{1..ff..2} -[{1..ff..2}]><><><><{1..ff} -[{1..ff}]><><><><{1..f} -[{1..f}]><><><><{1..0f} -[{1..0f}]><><><><{1..10f} -[{1..10f}]><><><><{1..10.f} -[{1..10.f}]><><><><{1..10.f} -[{1..10.f}]><><><>< \ No newline at end of file diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt deleted file mode 100644 index e5161c3da869f3..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt +++ /dev/null @@ -1,182 +0,0 @@ -# skip quotes for now -# "{x,x}" -# {"x,x"} -# {x","x} -# '{a,b}{{a,b},a,b}' -A{b,{d,e},{f,g}}Z -PRE-{a,b}{{a,b},a,b}-POST -\\{a,b}{{a,b},a,b} -{{a,b} -{a,b}} -{,} -a{,} -{,}b -a{,}b -a{b}c -a{1..5}b -a{01..5}b -a{-01..5}b -a{-01..5..3}b -a{001..9}b -a{b,c{d,e},{f,g}h}x{y,z -a{b,c{d,e},{f,g}h}x{y,z\\} -a{b,c{d,e},{f,g}h}x{y,z} -a{b{c{d,e}f{x,y{{g}h -a{b{c{d,e}f{x,y{}g}h -a{b{c{d,e}f{x,y}}g}h -a{b{c{d,e}f}g}h -a{{x,y},z}b -f{x,y{g,z}}h -f{x,y{{g,z}}h -f{x,y{{g,z}}h} -f{x,y{{g}h -f{x,y{{g}}h -f{x,y{}g}h -z{a,b{,c}d -z{a,b},c}d -{-01..5} -{-05..100..5} -{-05..100} -{0..5..2} -{0001..05..2} -{0001..-5..2} -{0001..-5..-2} -{0001..5..-2} -{01..5} -{1..05} -{1..05..3} -{05..100} -{0a..0z} -{a,b\\}c,d} -{a,b{c,d} -{a,b}c,d} -{a..F} -{A..f} -{a..Z} -{A..z} -{z..A} -{Z..a} -{a..F..2} -{A..f..02} -{a..Z..5} -d{a..Z..5}b -{A..z..10} -{z..A..-2} -{Z..a..20} -{a{,b} -{a},b} -{x,y{,}g} -{x,y{}g} -{{a,b} -{{a,b},c} -{{a,b}c} -{{a,b},} -X{{a,b},}X -{{a,b},}c -{{a,b}.} -{{a,b}} -X{a..#}X -# this next one is an empty string - -{-10..00} -# Need to escape slashes in here for reasons i guess. -{a,\\\\{a,b}c} -{a,\\{a,b}c} -a,\\{b,c} -{-10.\\.00} -#### bash tests/braces.tests -# Note that some tests are edited out because some features of -# bash are intentionally not supported in this brace expander. -ff{c,b,a} -f{d,e,f}g -{l,n,m}xyz -{abc\\,def} -{abc} -{x\\,y,\\{abc\\},trie} -# not impementing back-ticks obviously -# XXXX\\{`echo a b c | tr ' ' ','`\\} -{} -# We only ever have to worry about parsing a single argument, -# not a command line, so spaces have a different meaning than bash. -# { } -} -{ -abcd{efgh -# spaces -# foo {1,2} bar -# not impementing back-ticks obviously -# `zecho foo {1,2} bar` -# $(zecho foo {1,2} bar) -# ${var} is not a variable here, like it is in bash. omit. -# foo{bar,${var}.} -# foo{bar,${var}} -# isaacs: skip quotes for now -# "${var}"{x,y} -# $var{x,y} -# ${var}{x,y} -# new sequence brace operators -{1..10} -# this doesn't work yet -{0..10,braces} -# but this does -{{0..10},braces} -x{{0..10},braces}y -{3..3} -x{3..3}y -{10..1} -{10..1}y -x{10..1}y -{a..f} -{f..a} -{a..A} -{A..a} -{f..f} -# mixes are incorrectly-formed brace expansions -{1..f} -{f..1} -# spaces -# 0{1..9} {10..20} -# do negative numbers work? -{-1..-10} -{-20..0} -# weirdly-formed brace expansions -- fixed in post-bash-3.1 -a-{b{d,e}}-c -a-{bdef-{g,i}-c -# isaacs: skip quotes for now -# {"klklkl"}{1,2,3} -# isaacs: this is a valid test, though -{klklkl}{1,2,3} -# {"x,x"} -{1..10..2} -{-1..-10..2} -{-1..-10..-2} -{10..1..-2} -{10..1..2} -{1..20..2} -{1..20..20} -{100..0..5} -{100..0..-5} -{a..z} -{a..z..2} -{z..a..-2} -# make sure brace expansion handles ints > 2**31 - 1 using intmax_t -{2147483645..2147483649} -# unwanted zero-padding -- fixed post-bash-4.0 -{10..0..2} -{10..0..-2} -{-50..-0..5} -# bad -{1..10.f} -{1..ff} -{1..10..ff} -{1.20..2} -{1..20..f2} -{1..20..2f} -{1..2f..2} -{1..ff..2} -{1..ff} -{1..f} -{1..0f} -{1..10f} -{1..10.f} -{1..10.f} diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js deleted file mode 100644 index 3fcc185a7d6dcc..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js +++ /dev/null @@ -1,9 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('ignores ${', function(t) { - t.deepEqual(expand('${1..3}'), ['${1..3}']); - t.deepEqual(expand('${a,b}${c,d}'), ['${a,b}${c,d}']); - t.deepEqual(expand('x${a,b}x${c,d}x'), ['x${a,b}x${c,d}x']); - t.end(); -}); diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js deleted file mode 100644 index e429121eab8059..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js +++ /dev/null @@ -1,10 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('empty option', function(t) { - t.deepEqual(expand('-v{,,,,}'), [ - '-v', '-v', '-v', '-v', '-v' - ]); - t.end(); -}); - diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh deleted file mode 100644 index e040e664d9f881..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash - -set -e - -# Bash 4.3 because of arbitrary need to pick a single standard. - -if [ "${BASH_VERSINFO[0]}" != "4" ] || [ "${BASH_VERSINFO[1]}" != "3" ]; then - echo "this script requires bash 4.3" >&2 - exit 1 -fi - -CDPATH= cd "$(dirname "$0")" - -js='require("./")(process.argv[1]).join(" ")' - -cat cases.txt | \ - while read case; do - if [ "${case:0:1}" = "#" ]; then - continue; - fi; - b="$($BASH -c 'for c in '"$case"'; do echo ["$c"]; done')" - echo "$case" - echo -n "$b><><><><"; - done > bash-results.txt diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js deleted file mode 100644 index 8d434c23d4514d..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js +++ /dev/null @@ -1,15 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('negative increment', function(t) { - t.deepEqual(expand('{3..1}'), ['3', '2', '1']); - t.deepEqual(expand('{10..8}'), ['10', '9', '8']); - t.deepEqual(expand('{10..08}'), ['10', '09', '08']); - t.deepEqual(expand('{c..a}'), ['c', 'b', 'a']); - - t.deepEqual(expand('{4..0..2}'), ['4', '2', '0']); - t.deepEqual(expand('{4..0..-2}'), ['4', '2', '0']); - t.deepEqual(expand('{e..a..2}'), ['e', 'c', 'a']); - - t.end(); -}); diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/nested.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/nested.js deleted file mode 100644 index 0862dc51f90aee..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/nested.js +++ /dev/null @@ -1,16 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('nested', function(t) { - t.deepEqual(expand('{a,b{1..3},c}'), [ - 'a', 'b1', 'b2', 'b3', 'c' - ]); - t.deepEqual(expand('{{A..Z},{a..z}}'), - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('') - ); - t.deepEqual(expand('ppp{,config,oe{,conf}}'), [ - 'ppp', 'pppconfig', 'pppoe', 'pppoeconf' - ]); - t.end(); -}); - diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/order.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/order.js deleted file mode 100644 index c00ad155fe6760..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/order.js +++ /dev/null @@ -1,10 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('order', function(t) { - t.deepEqual(expand('a{d,c,b}e'), [ - 'ade', 'ace', 'abe' - ]); - t.end(); -}); - diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/pad.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/pad.js deleted file mode 100644 index e4158775f1bd06..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/pad.js +++ /dev/null @@ -1,13 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('pad', function(t) { - t.deepEqual(expand('{9..11}'), [ - '9', '10', '11' - ]); - t.deepEqual(expand('{09..11}'), [ - '09', '10', '11' - ]); - t.end(); -}); - diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js deleted file mode 100644 index 3038fba7416b3a..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js +++ /dev/null @@ -1,7 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('x and y of same type', function(t) { - t.deepEqual(expand('{a..9}'), ['{a..9}']); - t.end(); -}); diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js deleted file mode 100644 index f73a9579ab398b..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js +++ /dev/null @@ -1,50 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('numeric sequences', function(t) { - t.deepEqual(expand('a{1..2}b{2..3}c'), [ - 'a1b2c', 'a1b3c', 'a2b2c', 'a2b3c' - ]); - t.deepEqual(expand('{1..2}{2..3}'), [ - '12', '13', '22', '23' - ]); - t.end(); -}); - -test('numeric sequences with step count', function(t) { - t.deepEqual(expand('{0..8..2}'), [ - '0', '2', '4', '6', '8' - ]); - t.deepEqual(expand('{1..8..2}'), [ - '1', '3', '5', '7' - ]); - t.end(); -}); - -test('numeric sequence with negative x / y', function(t) { - t.deepEqual(expand('{3..-2}'), [ - '3', '2', '1', '0', '-1', '-2' - ]); - t.end(); -}); - -test('alphabetic sequences', function(t) { - t.deepEqual(expand('1{a..b}2{b..c}3'), [ - '1a2b3', '1a2c3', '1b2b3', '1b2c3' - ]); - t.deepEqual(expand('{a..b}{b..c}'), [ - 'ab', 'ac', 'bb', 'bc' - ]); - t.end(); -}); - -test('alphabetic sequences with step count', function(t) { - t.deepEqual(expand('{a..k..2}'), [ - 'a', 'c', 'e', 'g', 'i', 'k' - ]); - t.deepEqual(expand('{b..k..2}'), [ - 'b', 'd', 'f', 'h', 'j' - ]); - t.end(); -}); - diff --git a/deps/npm/node_modules/lru-cache/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.npmignore similarity index 100% rename from deps/npm/node_modules/lru-cache/.npmignore rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.npmignore diff --git a/deps/npm/node_modules/lru-cache/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.travis.yml similarity index 100% rename from deps/npm/node_modules/lru-cache/.travis.yml rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.travis.yml diff --git a/deps/npm/node_modules/lru-cache/CONTRIBUTORS b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS similarity index 100% rename from deps/npm/node_modules/lru-cache/CONTRIBUTORS rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS diff --git a/deps/npm/node_modules/minimatch/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/LICENSE similarity index 100% rename from deps/npm/node_modules/minimatch/LICENSE rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/LICENSE diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/README.md b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/README.md new file mode 100644 index 00000000000000..c06814e0414d56 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/README.md @@ -0,0 +1,137 @@ +# lru cache + +A cache object that deletes the least-recently-used items. + +## Usage: + +```javascript +var LRU = require("lru-cache") + , options = { max: 500 + , length: function (n) { return n * 2 } + , dispose: function (key, n) { n.close() } + , maxAge: 1000 * 60 * 60 } + , cache = LRU(options) + , otherCache = LRU(50) // sets just the max size + +cache.set("key", "value") +cache.get("key") // "value" + +cache.reset() // empty the cache +``` + +If you put more stuff in it, then items will fall out. + +If you try to put an oversized thing in it, then it'll fall out right +away. + +## Keys should always be Strings or Numbers + +Note: this module will print warnings to `console.error` if you use a +key that is not a String or Number. Because items are stored in an +object, which coerces keys to a string, it won't go well for you if +you try to use a key that is not a unique string, it'll cause surprise +collisions. For example: + +```JavaScript +// Bad Example! Dont' do this! +var cache = LRU() +var a = {} +var b = {} +cache.set(a, 'this is a') +cache.set(b, 'this is b') +console.log(cache.get(a)) // prints: 'this is b' +``` + +## Options + +* `max` The maximum size of the cache, checked by applying the length + function to all values in the cache. Not setting this is kind of + silly, since that's the whole purpose of this lib, but it defaults + to `Infinity`. +* `maxAge` Maximum age in ms. Items are not pro-actively pruned out + as they age, but if you try to get an item that is too old, it'll + drop it and return undefined instead of giving it to you. +* `length` Function that is used to calculate the length of stored + items. If you're storing strings or buffers, then you probably want + to do something like `function(n){return n.length}`. The default is + `function(n){return 1}`, which is fine if you want to store `max` + like-sized things. +* `dispose` Function that is called on items when they are dropped + from the cache. This can be handy if you want to close file + descriptors or do other cleanup tasks when items are no longer + accessible. Called with `key, value`. It's called *before* + actually removing the item from the internal cache, so if you want + to immediately put it back in, you'll have to do that in a + `nextTick` or `setTimeout` callback or it won't do anything. +* `stale` By default, if you set a `maxAge`, it'll only actually pull + stale items out of the cache when you `get(key)`. (That is, it's + not pre-emptively doing a `setTimeout` or anything.) If you set + `stale:true`, it'll return the stale value before deleting it. If + you don't set this, then it'll return `undefined` when you try to + get a stale entry, as if it had already been deleted. + +## API + +* `set(key, value, maxAge)` +* `get(key) => value` + + Both of these will update the "recently used"-ness of the key. + They do what you think. `max` is optional and overrides the + cache `max` option if provided. + +* `peek(key)` + + Returns the key value (or `undefined` if not found) without + updating the "recently used"-ness of the key. + + (If you find yourself using this a lot, you *might* be using the + wrong sort of data structure, but there are some use cases where + it's handy.) + +* `del(key)` + + Deletes a key out of the cache. + +* `reset()` + + Clear the cache entirely, throwing away all values. + +* `has(key)` + + Check if a key is in the cache, without updating the recent-ness + or deleting it for being stale. + +* `forEach(function(value,key,cache), [thisp])` + + Just like `Array.prototype.forEach`. Iterates over all the keys + in the cache, in order of recent-ness. (Ie, more recently used + items are iterated over first.) + +* `keys()` + + Return an array of the keys in the cache. + +* `values()` + + Return an array of the values in the cache. + +* `length()` + + Return total length of objects in cache taking into account + `length` options function. + +* `itemCount` + + Return total quantity of objects currently in cache. Note, that + `stale` (see options) items are returned as part of this item + count. + +* `dump()` + + Return an array of the cache entries ready for serialization and usage + with 'destinationCache.load(arr)`. + +* `load(cacheEntriesArray)` + + Loads another cache entries array, obtained with `sourceCache.dump()`, + into the cache. The destination cache is reset before loading new entries diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js new file mode 100644 index 00000000000000..2bbe653be8ad08 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js @@ -0,0 +1,334 @@ +;(function () { // closure for web browsers + +if (typeof module === 'object' && module.exports) { + module.exports = LRUCache +} else { + // just set the global for non-node platforms. + this.LRUCache = LRUCache +} + +function hOP (obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key) +} + +function naiveLength () { return 1 } + +var didTypeWarning = false +function typeCheckKey(key) { + if (!didTypeWarning && typeof key !== 'string' && typeof key !== 'number') { + didTypeWarning = true + console.error(new TypeError("LRU: key must be a string or number. Almost certainly a bug! " + typeof key).stack) + } +} + +function LRUCache (options) { + if (!(this instanceof LRUCache)) + return new LRUCache(options) + + if (typeof options === 'number') + options = { max: options } + + if (!options) + options = {} + + this._max = options.max + // Kind of weird to have a default max of Infinity, but oh well. + if (!this._max || !(typeof this._max === "number") || this._max <= 0 ) + this._max = Infinity + + this._lengthCalculator = options.length || naiveLength + if (typeof this._lengthCalculator !== "function") + this._lengthCalculator = naiveLength + + this._allowStale = options.stale || false + this._maxAge = options.maxAge || null + this._dispose = options.dispose + this.reset() +} + +// resize the cache when the max changes. +Object.defineProperty(LRUCache.prototype, "max", + { set : function (mL) { + if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity + this._max = mL + if (this._length > this._max) trim(this) + } + , get : function () { return this._max } + , enumerable : true + }) + +// resize the cache when the lengthCalculator changes. +Object.defineProperty(LRUCache.prototype, "lengthCalculator", + { set : function (lC) { + if (typeof lC !== "function") { + this._lengthCalculator = naiveLength + this._length = this._itemCount + for (var key in this._cache) { + this._cache[key].length = 1 + } + } else { + this._lengthCalculator = lC + this._length = 0 + for (var key in this._cache) { + this._cache[key].length = this._lengthCalculator(this._cache[key].value) + this._length += this._cache[key].length + } + } + + if (this._length > this._max) trim(this) + } + , get : function () { return this._lengthCalculator } + , enumerable : true + }) + +Object.defineProperty(LRUCache.prototype, "length", + { get : function () { return this._length } + , enumerable : true + }) + + +Object.defineProperty(LRUCache.prototype, "itemCount", + { get : function () { return this._itemCount } + , enumerable : true + }) + +LRUCache.prototype.forEach = function (fn, thisp) { + thisp = thisp || this + var i = 0 + var itemCount = this._itemCount + + for (var k = this._mru - 1; k >= 0 && i < itemCount; k--) if (this._lruList[k]) { + i++ + var hit = this._lruList[k] + if (isStale(this, hit)) { + del(this, hit) + if (!this._allowStale) hit = undefined + } + if (hit) { + fn.call(thisp, hit.value, hit.key, this) + } + } +} + +LRUCache.prototype.keys = function () { + var keys = new Array(this._itemCount) + var i = 0 + for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { + var hit = this._lruList[k] + keys[i++] = hit.key + } + return keys +} + +LRUCache.prototype.values = function () { + var values = new Array(this._itemCount) + var i = 0 + for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { + var hit = this._lruList[k] + values[i++] = hit.value + } + return values +} + +LRUCache.prototype.reset = function () { + if (this._dispose && this._cache) { + for (var k in this._cache) { + this._dispose(k, this._cache[k].value) + } + } + + this._cache = Object.create(null) // hash of items by key + this._lruList = Object.create(null) // list of items in order of use recency + this._mru = 0 // most recently used + this._lru = 0 // least recently used + this._length = 0 // number of items in the list + this._itemCount = 0 +} + +LRUCache.prototype.dump = function () { + var arr = [] + var i = 0 + + for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { + var hit = this._lruList[k] + if (!isStale(this, hit)) { + //Do not store staled hits + ++i + arr.push({ + k: hit.key, + v: hit.value, + e: hit.now + (hit.maxAge || 0) + }); + } + } + //arr has the most read first + return arr +} + +LRUCache.prototype.dumpLru = function () { + return this._lruList +} + +LRUCache.prototype.set = function (key, value, maxAge) { + maxAge = maxAge || this._maxAge + typeCheckKey(key) + + var now = maxAge ? Date.now() : 0 + var len = this._lengthCalculator(value) + + if (hOP(this._cache, key)) { + if (len > this._max) { + del(this, this._cache[key]) + return false + } + // dispose of the old one before overwriting + if (this._dispose) + this._dispose(key, this._cache[key].value) + + this._cache[key].now = now + this._cache[key].maxAge = maxAge + this._cache[key].value = value + this._length += (len - this._cache[key].length) + this._cache[key].length = len + this.get(key) + + if (this._length > this._max) + trim(this) + + return true + } + + var hit = new Entry(key, value, this._mru++, len, now, maxAge) + + // oversized objects fall out of cache automatically. + if (hit.length > this._max) { + if (this._dispose) this._dispose(key, value) + return false + } + + this._length += hit.length + this._lruList[hit.lu] = this._cache[key] = hit + this._itemCount ++ + + if (this._length > this._max) + trim(this) + + return true +} + +LRUCache.prototype.has = function (key) { + typeCheckKey(key) + if (!hOP(this._cache, key)) return false + var hit = this._cache[key] + if (isStale(this, hit)) { + return false + } + return true +} + +LRUCache.prototype.get = function (key) { + typeCheckKey(key) + return get(this, key, true) +} + +LRUCache.prototype.peek = function (key) { + typeCheckKey(key) + return get(this, key, false) +} + +LRUCache.prototype.pop = function () { + var hit = this._lruList[this._lru] + del(this, hit) + return hit || null +} + +LRUCache.prototype.del = function (key) { + typeCheckKey(key) + del(this, this._cache[key]) +} + +LRUCache.prototype.load = function (arr) { + //reset the cache + this.reset(); + + var now = Date.now() + //A previous serialized cache has the most recent items first + for (var l = arr.length - 1; l >= 0; l-- ) { + var hit = arr[l] + typeCheckKey(hit.k) + var expiresAt = hit.e || 0 + if (expiresAt === 0) { + //the item was created without expiration in a non aged cache + this.set(hit.k, hit.v) + } else { + var maxAge = expiresAt - now + //dont add already expired items + if (maxAge > 0) this.set(hit.k, hit.v, maxAge) + } + } +} + +function get (self, key, doUse) { + typeCheckKey(key) + var hit = self._cache[key] + if (hit) { + if (isStale(self, hit)) { + del(self, hit) + if (!self._allowStale) hit = undefined + } else { + if (doUse) use(self, hit) + } + if (hit) hit = hit.value + } + return hit +} + +function isStale(self, hit) { + if (!hit || (!hit.maxAge && !self._maxAge)) return false + var stale = false; + var diff = Date.now() - hit.now + if (hit.maxAge) { + stale = diff > hit.maxAge + } else { + stale = self._maxAge && (diff > self._maxAge) + } + return stale; +} + +function use (self, hit) { + shiftLU(self, hit) + hit.lu = self._mru ++ + self._lruList[hit.lu] = hit +} + +function trim (self) { + while (self._lru < self._mru && self._length > self._max) + del(self, self._lruList[self._lru]) +} + +function shiftLU (self, hit) { + delete self._lruList[ hit.lu ] + while (self._lru < self._mru && !self._lruList[self._lru]) self._lru ++ +} + +function del (self, hit) { + if (hit) { + if (self._dispose) self._dispose(hit.key, hit.value) + self._length -= hit.length + self._itemCount -- + delete self._cache[ hit.key ] + shiftLU(self, hit) + } +} + +// classy, since V8 prefers predictable objects. +function Entry (key, value, lu, length, now, maxAge) { + this.key = key + this.value = value + this.lu = lu + this.length = length + this.now = now + if (maxAge) this.maxAge = maxAge +} + +})() diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/package.json b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/package.json new file mode 100644 index 00000000000000..411b59ea1b1f4f --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/package.json @@ -0,0 +1,84 @@ +{ + "_args": [ + [ + "lru-cache@2", + "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/minimatch" + ] + ], + "_from": "lru-cache@>=2.0.0 <3.0.0", + "_id": "lru-cache@2.7.3", + "_inCache": true, + "_installable": true, + "_location": "/node-gyp/minimatch/lru-cache", + "_nodeVersion": "4.0.0", + "_npmUser": { + "email": "i@izs.me", + "name": "isaacs" + }, + "_npmVersion": "3.3.2", + "_phantomChildren": {}, + "_requested": { + "name": "lru-cache", + "raw": "lru-cache@2", + "rawSpec": "2", + "scope": null, + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/minimatch" + ], + "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "_shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952", + "_shrinkwrap": null, + "_spec": "lru-cache@2", + "_where": "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/minimatch", + "author": { + "email": "i@izs.me", + "name": "Isaac Z. Schlueter" + }, + "bugs": { + "url": "https://github.com/isaacs/node-lru-cache/issues" + }, + "dependencies": {}, + "description": "A cache object that deletes the least-recently-used items.", + "devDependencies": { + "tap": "^1.2.0", + "weak": "" + }, + "directories": {}, + "dist": { + "shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952", + "tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz" + }, + "gitHead": "292048199f6d28b77fbe584279a1898e25e4c714", + "homepage": "https://github.com/isaacs/node-lru-cache#readme", + "keywords": [ + "cache", + "lru", + "mru" + ], + "license": "ISC", + "main": "lib/lru-cache.js", + "maintainers": [ + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + } + ], + "name": "lru-cache", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-lru-cache.git" + }, + "scripts": { + "test": "tap test --gc" + }, + "version": "2.7.3" +} diff --git a/deps/npm/node_modules/lru-cache/test/basic.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/basic.js similarity index 100% rename from deps/npm/node_modules/lru-cache/test/basic.js rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/basic.js diff --git a/deps/npm/node_modules/lru-cache/test/foreach.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/foreach.js similarity index 100% rename from deps/npm/node_modules/lru-cache/test/foreach.js rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/foreach.js diff --git a/deps/npm/node_modules/lru-cache/test/memory-leak.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js similarity index 100% rename from deps/npm/node_modules/lru-cache/test/memory-leak.js rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js diff --git a/deps/npm/node_modules/lru-cache/test/serialize.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/serialize.js similarity index 100% rename from deps/npm/node_modules/lru-cache/test/serialize.js rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/serialize.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/package.json b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/package.json index 4255e77a933eed..b1dbae0a802671 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/package.json @@ -1,60 +1,85 @@ { - "name": "sigmund", - "version": "1.0.1", - "description": "Quick and dirty signatures for Objects.", - "main": "sigmund.js", - "directories": { - "test": "test" - }, - "dependencies": {}, - "devDependencies": { - "tap": "~0.3.0" - }, - "scripts": { - "test": "tap test/*.js", - "bench": "node bench.js" + "_args": [ + [ + "sigmund@~1.0.0", + "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/minimatch" + ] + ], + "_from": "sigmund@>=1.0.0 <1.1.0", + "_id": "sigmund@1.0.1", + "_inCache": true, + "_installable": true, + "_location": "/node-gyp/minimatch/sigmund", + "_nodeVersion": "2.0.1", + "_npmUser": { + "email": "isaacs@npmjs.com", + "name": "isaacs" }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/sigmund.git" + "_npmVersion": "2.10.0", + "_phantomChildren": {}, + "_requested": { + "name": "sigmund", + "raw": "sigmund@~1.0.0", + "rawSpec": "~1.0.0", + "scope": null, + "spec": ">=1.0.0 <1.1.0", + "type": "range" }, - "keywords": [ - "object", - "signature", - "key", - "data", - "psychoanalysis" + "_requiredBy": [ + "/node-gyp/minimatch" ], + "_resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "_shasum": "3ff21f198cad2175f9f3b781853fd94d0d19b590", + "_shrinkwrap": null, + "_spec": "sigmund@~1.0.0", + "_where": "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/minimatch", "author": { - "name": "Isaac Z. Schlueter", "email": "i@izs.me", + "name": "Isaac Z. Schlueter", "url": "http://blog.izs.me/" }, - "license": "ISC", - "gitHead": "527f97aa5bb253d927348698c0cd3bb267d098c6", "bugs": { "url": "https://github.com/isaacs/sigmund/issues" }, - "homepage": "https://github.com/isaacs/sigmund#readme", - "_id": "sigmund@1.0.1", - "_shasum": "3ff21f198cad2175f9f3b781853fd94d0d19b590", - "_from": "sigmund@>=1.0.0 <1.1.0", - "_npmVersion": "2.10.0", - "_nodeVersion": "2.0.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" + "dependencies": {}, + "description": "Quick and dirty signatures for Objects.", + "devDependencies": { + "tap": "~0.3.0" + }, + "directories": { + "test": "test" }, "dist": { "shasum": "3ff21f198cad2175f9f3b781853fd94d0d19b590", "tarball": "http://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz" }, + "gitHead": "527f97aa5bb253d927348698c0cd3bb267d098c6", + "homepage": "https://github.com/isaacs/sigmund#readme", + "keywords": [ + "data", + "key", + "object", + "psychoanalysis", + "signature" + ], + "license": "ISC", + "main": "sigmund.js", "maintainers": [ { "name": "isaacs", "email": "i@izs.me" } ], - "_resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", - "readme": "ERROR: No README data found!" + "name": "sigmund", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/sigmund.git" + }, + "scripts": { + "bench": "node bench.js", + "test": "tap test/*.js" + }, + "version": "1.0.1" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/test/basic.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/test/basic.js index 50c53a13e98d0e..6149a80239f059 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/test/basic.js +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/test/basic.js @@ -21,4 +21,3 @@ test('basic', function (t) { t.equal(sigmund(obj3), cycleHash) t.end() }) - diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/package.json b/deps/npm/node_modules/node-gyp/node_modules/minimatch/package.json index 8bf46ccae0c4f6..2f0d2de57e663e 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/package.json @@ -1,58 +1,83 @@ { - "author": { - "name": "Isaac Z. Schlueter", + "_args": [ + [ + "minimatch@1", + "/Users/rebecca/code/release/npm-3/node_modules/node-gyp" + ] + ], + "_from": "minimatch@>=1.0.0 <2.0.0", + "_id": "minimatch@1.0.0", + "_inCache": true, + "_installable": true, + "_location": "/node-gyp/minimatch", + "_npmUser": { "email": "i@izs.me", - "url": "http://blog.izs.me" + "name": "isaacs" }, - "name": "minimatch", - "description": "a glob matcher in javascript", - "version": "1.0.0", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" + "_npmVersion": "1.4.21", + "_phantomChildren": {}, + "_requested": { + "name": "minimatch", + "raw": "minimatch@1", + "rawSpec": "1", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" }, - "main": "minimatch.js", - "scripts": { - "test": "tap test/*.js" + "_requiredBy": [ + "/node-gyp" + ], + "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz", + "_shasum": "e0dd2120b49e1b724ce8d714c520822a9438576d", + "_shrinkwrap": null, + "_spec": "minimatch@1", + "_where": "/Users/rebecca/code/release/npm-3/node_modules/node-gyp", + "author": { + "email": "i@izs.me", + "name": "Isaac Z. Schlueter", + "url": "http://blog.izs.me" }, - "engines": { - "node": "*" + "bugs": { + "url": "https://github.com/isaacs/minimatch/issues" }, "dependencies": { "lru-cache": "2", "sigmund": "~1.0.0" }, + "description": "a glob matcher in javascript", "devDependencies": { "tap": "" }, - "license": { - "type": "MIT", - "url": "http://github.com/isaacs/minimatch/raw/master/LICENSE" + "directories": {}, + "dist": { + "shasum": "e0dd2120b49e1b724ce8d714c520822a9438576d", + "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz" }, - "gitHead": "b374a643976eb55cdc19c60b6dd51ebe9bcc607a", - "bugs": { - "url": "https://github.com/isaacs/minimatch/issues" + "engines": { + "node": "*" }, + "gitHead": "b374a643976eb55cdc19c60b6dd51ebe9bcc607a", "homepage": "https://github.com/isaacs/minimatch", - "_id": "minimatch@1.0.0", - "_shasum": "e0dd2120b49e1b724ce8d714c520822a9438576d", - "_from": "minimatch@>=1.0.0 <2.0.0", - "_npmVersion": "1.4.21", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" + "license": { + "type": "MIT", + "url": "http://github.com/isaacs/minimatch/raw/master/LICENSE" }, + "main": "minimatch.js", "maintainers": [ { "name": "isaacs", "email": "i@izs.me" } ], - "dist": { - "shasum": "e0dd2120b49e1b724ce8d714c520822a9438576d", - "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz" + "name": "minimatch", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz", - "readme": "ERROR: No README data found!" + "scripts": { + "test": "tap test/*.js" + }, + "version": "1.0.0" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/brace-expand.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/brace-expand.js index e63d3f60c80e82..c3e19d9baf571b 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/brace-expand.js +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/brace-expand.js @@ -36,5 +36,3 @@ tap.test("brace expansion", function (t) { console.error("ending") t.end() }) - - diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/path-array/.travis.yml index c7d8e3d83c60b6..41840cb357b87a 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/.travis.yml +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/.travis.yml @@ -1,6 +1,27 @@ +sudo: false + language: node_js + node_js: - - 0.8 - - 0.9 - - 0.10 - - 0.11 + - "0.8" + - "0.10" + - "0.12" + - "1" + - "2" + - "3" + - "4" + - "5" + +install: + - PATH="`npm bin`:`npm bin -g`:$PATH" + # Node 0.8 comes with a too obsolete npm + - if [[ "`node --version`" =~ ^v0\.8\. ]]; then npm install -g npm@1.4.28 ; fi + # Install dependencies and build + - npm install + +script: + # Output useful info for debugging + - node --version + - npm --version + # Run tests + - npm test diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/History.md b/deps/npm/node_modules/node-gyp/node_modules/path-array/History.md index ff93a2a28f2f46..bbdacd30a0001a 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/History.md +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/History.md @@ -1,4 +1,12 @@ +1.0.1 / 2016-01-14 +================== + + * add MIT LICENSE file + * update "array-index" to v1.0.0 with new API + * travis: test more node versions and fix v0.8 + * travis: use quotes around node versions + 1.0.0 / 2014-11-11 ================== diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/path-array/LICENSE new file mode 100644 index 00000000000000..2a54ccd2ebe03d --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2013 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/index.js index 40b982d2f17053..1e8170136e7e9e 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/index.js +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/index.js @@ -94,7 +94,7 @@ PathArray.prototype._getLength = function () { * @api private */ -PathArray.prototype.__get__ = function get (index) { +PathArray.prototype[ArrayIndex.get] = function get (index) { return this._array()[index]; }; @@ -104,7 +104,7 @@ PathArray.prototype.__get__ = function get (index) { * @api private */ -PathArray.prototype.__set__ = function set (index, value) { +PathArray.prototype[ArrayIndex.set] = function set (index, value) { var arr = this._array(); arr[index] = value; this._setArray(arr); diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/.jshintrc b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/.jshintrc new file mode 100644 index 00000000000000..182e34d07d7835 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/.jshintrc @@ -0,0 +1,4 @@ +{ + "asi": true, + "laxcomma": true +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/.travis.yml index 99cdc7439aacd1..41840cb357b87a 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/.travis.yml +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/.travis.yml @@ -1,5 +1,27 @@ +sudo: false + language: node_js + node_js: - "0.8" - "0.10" - - "0.11" + - "0.12" + - "1" + - "2" + - "3" + - "4" + - "5" + +install: + - PATH="`npm bin`:`npm bin -g`:$PATH" + # Node 0.8 comes with a too obsolete npm + - if [[ "`node --version`" =~ ^v0\.8\. ]]; then npm install -g npm@1.4.28 ; fi + # Install dependencies and build + - npm install + +script: + # Output useful info for debugging + - node --version + - npm --version + # Run tests + - npm test diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/History.md b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/History.md index 20b03e9a8369ec..12990228a43a13 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/History.md +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/History.md @@ -1,11 +1,39 @@ +1.0.0 / 2016-01-02 +================== + + * remove `__get__` and `__set__` functionality + * README: s/->/→/ + +0.9.1 / 2015-12-29 +================== + + * fix backwards compat with tests + * README: update samples for new Symbols API + * travis: attempt to fix node v8 + +0.9.0 / 2015-12-27 +================== + + * add backwards compat logic with deprecate message + * add LICENSE field and entry in package.json + * convert to using es6 Symbols + * remove extraneous debug() calls + * travis: test moar Node.js versions + +0.2.0 / 2015-12-02 +================== + + * add support for invoking as a Mixin + * travis: test node v0.6 + 0.1.1 / 2014-11-03 ================== - * index: use `%o` debug formatters - * .travis: don't test node v0.9.x - * README: use svg for Travis badge - * add .jshintrc file + * index: use `%o` debug formatters + * .travis: don't test node v0.9.x + * README: use svg for Travis badge + * add .jshintrc file 0.1.0 / 2013-12-01 ================== diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/LICENSE new file mode 100644 index 00000000000000..2ea4dc5efb8729 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2012 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/README.md b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/README.md index ecd3498dd116b3..b8d715d6ebf6c0 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/README.md +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/README.md @@ -6,8 +6,8 @@ array-index This little module provides an `ArrayIndex` constructor function that you can inherit from with your own objects. When a numbered property gets read, then the -`__get__` function on the object will be invoked. When a numbered property gets -set, then the `__set__` function on the object will be invoked. +`ArrayIndex.get` function on the object will be invoked. When a numbered property gets +set, then the `ArrayIndex.set` function on the object will be invoked. Installation @@ -26,22 +26,22 @@ Examples A quick silly example, using `Math.sqrt()` for the "getter": ``` js -var ArrayIndex = require('array-index') +var ArrayIndex = require('array-index'); // let's just create a singleton instance. -var a = new ArrayIndex() +var a = new ArrayIndex(); -// the "__get__" function is invoked for each "a[n]" access. +// the "ArrayIndex.get" function is invoked for each "a[n]" access. // it is given a single argument, the "index" currently being accessed. // so here, we're passing in the `Math.sqrt()` function, so accessing // "a[9]" will return `Math.sqrt(9)`. -a.__get__ = Math.sqrt +a[ArrayIndex.get] = Math.sqrt; -// the "__get__" and "__set__" functions are only invoked up +// the "ArrayIndex.get" and "ArrayIndex.set" functions are only invoked up // to "a.length", so we must set that manually. -a.length = 10 +a.length = 10; -console.log(a) +console.log(a); // [ 0, // 1, // 1.4142135623730951, @@ -51,19 +51,18 @@ console.log(a) // 2.449489742783178, // 2.6457513110645907, // 2.8284271247461903, -// 3, -// __get__: [Function: sqrt] ] +// 3 ] ``` Here's an example of creating a subclass of `ArrayIndex` using `util.inherits()`: ``` js -var ArrayIndex = require('array-index') -var inherits = require('util').inherits +var ArrayIndex = require('array-index'); +var inherits = require('util').inherits; function MyArray (length) { // be sure to call the ArrayIndex constructor in your own constructor - ArrayIndex.call(this, length) + ArrayIndex.call(this, length); // the "set" object will contain values at indexes previously set, // so that they can be returned in the "getter" function. This is just a @@ -71,28 +70,28 @@ function MyArray (length) { Object.defineProperty(this, 'set', { value: Object.create(null), enumerable: false - }) + }); } // inherit from the ArrayIndex's prototype -inherits(MyArray, ArrayIndex) +inherits(MyArray, ArrayIndex); -MyArray.prototype.__get__ = function (index) { - if (index in this.set) return this.set[index] - return index * 2 -} +MyArray.prototype[ArrayIndex.get] = function (index) { + if (index in this.set) return this.set[index]; + return index * 2; +}; -MyArray.prototype.__set__ = function (index, v) { - this.set[index] = v -} +MyArray.prototype[ArrayIndex.set] = function (index, v) { + this.set[index] = v; +}; // and now you can create some instances -var a = new MyArray(15) -a[9] = a[10] = a[14] = '_' -a[0] = 'nate' +var a = new MyArray(15); +a[9] = a[10] = a[14] = '_'; +a[0] = 'nate'; -console.log(a) +console.log(a); // [ 'nate', 2, 4, 6, 8, 10, 12, 14, 16, '_', '_', 22, 24, 26, '_' ] ``` @@ -102,28 +101,28 @@ API The `ArrayIndex` base class is meant to be subclassed, but it also has a few convenient functions built-in. -### "length" -> Number +### "length" → Number -The length of the ArrayIndex instance. The `__get__` and `__set__` functions will +The length of the ArrayIndex instance. The `ArrayIndex.get` and `ArrayIndex.set` functions will only be invoked on the object up to this "length". You may set this length at any time to adjust the amount range where the getters/setters will be invoked. -### "toArray()" -> Array +### "toArray()" → Array Returns a new regular Array instance with the same values that this ArrayIndex -class would have. This function calls the `__get__` function repeatedly from +class would have. This function calls the `ArrayIndex.get` function repeatedly from `0...length-1` and returns the "flattened" array instance. -### "toJSON()" -> Array +### "toJSON()" → Array All `ArrayIndex` instances get basic support for `JSON.stringify()`, which is the same as a "flattened" Array being stringified. -### "toString()" -> String +### "toString()" → String The `toString()` override is basically just `array.toArray().toString()`. -### "format()" -> String +### "format()" → String The `inspect()` implementation for the REPL attempts to mimic what a regular Array looks like in the REPL. diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/component.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/component.json index 390d7a7fe88214..f5f21fc7d642e8 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/component.json +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/component.json @@ -9,7 +9,7 @@ "setter", "proxy" ], - "version": "0.1.1", + "version": "1.0.0", "dependencies": { "visionmedia/debug": "*" }, diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/index.js index 18069c6bcd4d7d..a2e4110c1802b7 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/index.js +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/index.js @@ -3,61 +3,62 @@ * Module dependencies. */ -var util = require('util') -var debug = require('debug')('array-index') +var Symbol = require('es6-symbol'); +var debug = require('debug')('array-index'); + +var get = Symbol('get'); +var set = Symbol('set'); +var length = Symbol('length'); /** * JavaScript Array "length" is bound to an unsigned 32-bit int. * See: http://stackoverflow.com/a/6155063/376773 */ -var MAX_LENGTH = Math.pow(2, 32) +var MAX_LENGTH = Math.pow(2, 32); /** * Module exports. */ -module.exports = ArrayIndex +module.exports = ArrayIndex; +ArrayIndex.get = get; +ArrayIndex.set = set; /** * Subclass this. */ -function ArrayIndex (length) { +function ArrayIndex (_length) { Object.defineProperty(this, 'length', { get: getLength, set: setLength, enumerable: false, configurable: true - }) + }); - Object.defineProperty(this, '__length', { - value: 0, - writable: true, - enumerable: false, - configurable: true - }) + this[length] = 0; if (arguments.length > 0) { - this.length = length + setLength.call(this, _length); } } /** - * You overwrite the "__get__" function in your subclass. + * You overwrite the "get" Symbol in your subclass. */ -ArrayIndex.prototype.__get__ = function () { - throw new Error('you must implement the __get__ function') -} +ArrayIndex.prototype[ArrayIndex.get] = function () { + throw new Error('you must implement the `ArrayIndex.get` Symbol'); +}; /** - * You overwrite the "__set__" function in your subclass. + * You overwrite the "set" Symbol in your subclass. */ -ArrayIndex.prototype.__set__ = function () { - throw new Error('you must implement the __set__ function') -} +ArrayIndex.prototype[ArrayIndex.set] = function () { + throw new Error('you must implement the `ArrayIndex.set` Symbol'); +}; /** * Converts this array class into a real JavaScript Array. Note that this @@ -70,91 +71,92 @@ ArrayIndex.prototype.__set__ = function () { */ ArrayIndex.prototype.toArray = function toArray () { - var i = 0, l = this.length, array = new Array(l) + var i = 0; + var l = this.length; + var array = new Array(l); for (; i < l; i++) { - array[i] = this[i] + array[i] = this[i]; } - return array -} + return array; +}; /** * Basic support for `JSON.stringify()`. */ ArrayIndex.prototype.toJSON = function toJSON () { - return this.toArray() -} + return this.toArray(); +}; /** * toString() override. Use Array.prototype.toString(). */ ArrayIndex.prototype.toString = function toString () { - var a = this.toArray() - return a.toString.apply(a, arguments) -} + var a = this.toArray(); + return a.toString.apply(a, arguments); +}; /** * inspect() override. For the REPL. */ ArrayIndex.prototype.inspect = function inspect () { - var a = this.toArray() + var a = this.toArray(); Object.keys(this).forEach(function (k) { - a[k] = this[k] - }, this) - return util.inspect(a) -} + a[k] = this[k]; + }, this); + return a; +}; /** * Getter for the "length" property. - * Returns the value of the "__length" property. + * Returns the value of the "length" Symbol. */ function getLength () { - debug('getting "length": %o', this.__length) - return this.__length -} + debug('getting "length": %o', this[length]); + return this[length]; +}; /** * Setter for the "length" property. - * Calls "ensureLength()", then sets the "__length" property. + * Calls "ensureLength()", then sets the "length" Symbol. */ function setLength (v) { - debug('setting "length": %o', v) - return this.__length = ensureLength(v) -} + debug('setting "length": %o', v); + return this[length] = ensureLength(this, v); +}; /** - * Ensures that getters/setters from 0 up to "_length" have been defined - * on `ArrayIndex.prototype`. + * Ensures that getters/setters from 0 up to "_newLength" have been defined + * on `Object.getPrototypeOf(this)`. * * @api private */ -function ensureLength (_length) { - var length - if (_length > MAX_LENGTH) { - length = MAX_LENGTH +function ensureLength (self, _newLength) { + var newLength; + if (_newLength > MAX_LENGTH) { + newLength = MAX_LENGTH; } else { - length = _length | 0 + newLength = _newLength | 0; } - var cur = ArrayIndex.prototype.__length__ | 0 - var num = length - cur + var proto = Object.getPrototypeOf(self); + var cur = proto[length] | 0; + var num = newLength - cur; if (num > 0) { - var desc = {} - debug('creating a descriptor object with %o entries', num) - for (var i = cur; i < length; i++) { - desc[i] = setup(i) + var desc = {}; + debug('creating a descriptor object with %o entries', num); + for (var i = cur; i < newLength; i++) { + desc[i] = setup(i); } - debug('done creating descriptor object') - debug('calling `Object.defineProperties()` with %o entries', num) - Object.defineProperties(ArrayIndex.prototype, desc) - debug('finished `Object.defineProperties()`') - ArrayIndex.prototype.__length__ = length + debug('calling `Object.defineProperties()` with %o entries', num); + Object.defineProperties(proto, desc); + proto[length] = newLength; } - return length + return newLength; } /** @@ -166,15 +168,15 @@ function ensureLength (_length) { function setup (index) { function get () { - return this.__get__(index) + return this[ArrayIndex.get](index); } function set (v) { - return this.__set__(index, v) + return this[ArrayIndex.set](index, v); } return { - enumerable: true - , configurable: true - , get: get - , set: set - } + enumerable: true, + configurable: true, + get: get, + set: set + }; } diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/package.json index 253335e6234907..a60580a9d183e5 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/package.json @@ -1,48 +1,74 @@ { - "name": "ms", - "version": "0.7.1", - "description": "Tiny ms conversion utility", - "repository": { - "type": "git", - "url": "git://github.com/guille/ms.js.git" + "_args": [ + [ + "ms@0.7.1", + "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug" + ] + ], + "_from": "ms@0.7.1", + "_id": "ms@0.7.1", + "_inCache": true, + "_installable": true, + "_location": "/node-gyp/path-array/array-index/debug/ms", + "_nodeVersion": "0.12.2", + "_npmUser": { + "email": "rauchg@gmail.com", + "name": "rauchg" }, - "main": "./index", - "devDependencies": { - "mocha": "*", - "expect.js": "*", - "serve": "*" + "_npmVersion": "2.7.5", + "_phantomChildren": {}, + "_requested": { + "name": "ms", + "raw": "ms@0.7.1", + "rawSpec": "0.7.1", + "scope": null, + "spec": "0.7.1", + "type": "version" + }, + "_requiredBy": [ + "/node-gyp/path-array/array-index/debug" + ], + "_resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "_shasum": "9cd13c03adbff25b65effde7ce864ee952017098", + "_shrinkwrap": null, + "_spec": "ms@0.7.1", + "_where": "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug", + "bugs": { + "url": "https://github.com/guille/ms.js/issues" }, "component": { "scripts": { "ms/index.js": "index.js" } }, - "gitHead": "713dcf26d9e6fd9dbc95affe7eff9783b7f1b909", - "bugs": { - "url": "https://github.com/guille/ms.js/issues" + "dependencies": {}, + "description": "Tiny ms conversion utility", + "devDependencies": { + "expect.js": "*", + "mocha": "*", + "serve": "*" }, - "homepage": "https://github.com/guille/ms.js", - "_id": "ms@0.7.1", - "scripts": {}, - "_shasum": "9cd13c03adbff25b65effde7ce864ee952017098", - "_from": "ms@0.7.1", - "_npmVersion": "2.7.5", - "_nodeVersion": "0.12.2", - "_npmUser": { - "name": "rauchg", - "email": "rauchg@gmail.com" + "directories": {}, + "dist": { + "shasum": "9cd13c03adbff25b65effde7ce864ee952017098", + "tarball": "http://registry.npmjs.org/ms/-/ms-0.7.1.tgz" }, + "gitHead": "713dcf26d9e6fd9dbc95affe7eff9783b7f1b909", + "homepage": "https://github.com/guille/ms.js", + "main": "./index", "maintainers": [ { "name": "rauchg", "email": "rauchg@gmail.com" } ], - "dist": { - "shasum": "9cd13c03adbff25b65effde7ce864ee952017098", - "tarball": "http://registry.npmjs.org/ms/-/ms-0.7.1.tgz" + "name": "ms", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/guille/ms.js.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", - "readme": "ERROR: No README data found!" + "scripts": {}, + "version": "0.7.1" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/package.json index 7e6d9fc59a1755..758deaf8c330e0 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/package.json @@ -1,19 +1,51 @@ { - "name": "debug", - "version": "2.2.0", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/debug.git" + "_args": [ + [ + "debug@*", + "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/path-array/node_modules/array-index" + ] + ], + "_from": "debug@*", + "_id": "debug@2.2.0", + "_inCache": true, + "_installable": true, + "_location": "/node-gyp/path-array/array-index/debug", + "_nodeVersion": "0.12.2", + "_npmUser": { + "email": "nathan@tootallnate.net", + "name": "tootallnate" }, - "description": "small debugging utility", - "keywords": [ - "debug", - "log", - "debugger" + "_npmVersion": "2.7.4", + "_phantomChildren": {}, + "_requested": { + "name": "debug", + "raw": "debug@*", + "rawSpec": "*", + "scope": null, + "spec": "*", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/path-array/array-index" ], + "_resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "_shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", + "_shrinkwrap": null, + "_spec": "debug@*", + "_where": "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/path-array/node_modules/array-index", "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" + "email": "tj@vision-media.ca", + "name": "TJ Holowaychuk" + }, + "browser": "./browser.js", + "bugs": { + "url": "https://github.com/visionmedia/debug/issues" + }, + "component": { + "scripts": { + "debug/debug.js": "debug.js", + "debug/index.js": "browser.js" + } }, "contributors": [ { @@ -22,37 +54,28 @@ "url": "http://n8.io" } ], - "license": "MIT", "dependencies": { "ms": "0.7.1" }, + "description": "small debugging utility", "devDependencies": { "browserify": "9.0.3", "mocha": "*" }, - "main": "./node.js", - "browser": "./browser.js", - "component": { - "scripts": { - "debug/index.js": "browser.js", - "debug/debug.js": "debug.js" - } + "directories": {}, + "dist": { + "shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", + "tarball": "http://registry.npmjs.org/debug/-/debug-2.2.0.tgz" }, "gitHead": "b38458422b5aa8aa6d286b10dfe427e8a67e2b35", - "bugs": { - "url": "https://github.com/visionmedia/debug/issues" - }, "homepage": "https://github.com/visionmedia/debug", - "_id": "debug@2.2.0", - "scripts": {}, - "_shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", - "_from": "debug@*", - "_npmVersion": "2.7.4", - "_nodeVersion": "0.12.2", - "_npmUser": { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - }, + "keywords": [ + "debug", + "debugger", + "log" + ], + "license": "MIT", + "main": "./node.js", "maintainers": [ { "name": "tjholowaychuk", @@ -63,11 +86,13 @@ "email": "nathan@tootallnate.net" } ], - "dist": { - "shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", - "tarball": "http://registry.npmjs.org/debug/-/debug-2.2.0.tgz" + "name": "debug", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "readme": "ERROR: No README data found!" + "scripts": {}, + "version": "2.2.0" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/.lint b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/.lint new file mode 100644 index 00000000000000..df1e53cd5f547e --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/.lint @@ -0,0 +1,15 @@ +@root + +module + +tabs +indent 2 +maxlen 100 + +ass +nomen +plusplus +newcap +vars + +predef+ Symbol diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/.npmignore similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/.npmignore rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/.npmignore diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/.travis.yml new file mode 100644 index 00000000000000..6830765b567773 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/.travis.yml @@ -0,0 +1,10 @@ +sudo: false # http://docs.travis-ci.com/user/workers/container-based-infrastructure/ +language: node_js +node_js: + - 0.12 + - v4 + - v5 + +notifications: + email: + - medikoo+es6-symbol@medikoo.com diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/CHANGES b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/CHANGES new file mode 100644 index 00000000000000..cbedd4244bc8b6 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/CHANGES @@ -0,0 +1,46 @@ +v3.0.2 -- 2015.12.12 +* Fix definition flow, so uneven state of Symbol implementation doesn't crash initialization of + polyfill. See #13 + +v3.0.1 -- 2015.10.22 +* Workaround for IE11 bug (reported in #12) + +v3.0.0 -- 2015.10.02 +* Reuse native symbols (e.g. iterator, toStringTag etc.) in a polyfill if they're available + Otherwise polyfill symbols may not be recognized by other functions +* Improve documentation + +v2.0.1 -- 2015.01.28 +* Fix Symbol.prototype[Symbol.isPrimitive] implementation +* Improve validation within Symbol.prototype.toString and + Symbol.prototype.valueOf + +v2.0.0 -- 2015.01.28 +* Update up to changes in specification: + * Implement `for` and `keyFor` + * Remove `Symbol.create` and `Symbol.isRegExp` + * Add `Symbol.match`, `Symbol.replace`, `Symbol.search`, `Symbol.species` and + `Symbol.split` +* Rename `validSymbol` to `validateSymbol` +* Improve documentation +* Remove dead test modules + +v1.0.0 -- 2015.01.26 +* Fix enumerability for symbol properties set normally (e.g. obj[symbol] = value) +* Introduce initialization via hidden constructor +* Fix isSymbol handling of polyfill values when native Symbol is present +* Fix spelling of LICENSE +* Configure lint scripts + +v0.1.1 -- 2014.10.07 +* Fix isImplemented, so it returns true in case of polyfill +* Improve documentations + +v0.1.0 -- 2014.04.28 +* Assure strictly npm dependencies +* Update to use latest versions of dependencies +* Fix implementation detection so it doesn't crash on `String(symbol)` +* throw on `new Symbol()` (as decided by TC39) + +v0.0.0 -- 2013.11.15 +* Initial (dev) version \ No newline at end of file diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/LICENSE similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/LICENSE rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/LICENSE diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/README.md b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/README.md new file mode 100644 index 00000000000000..0fa8978450cb4f --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/README.md @@ -0,0 +1,71 @@ +# es6-symbol +## ECMAScript 6 Symbol polyfill + +For more information about symbols see following links +- [Symbols in ECMAScript 6 by Axel Rauschmayer](http://www.2ality.com/2014/12/es6-symbols.html) +- [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) +- [Specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-symbol-constructor) + +### Limitations + +Underneath it uses real string property names which can easily be retrieved, however accidental collision with other property names is unlikely. + +### Usage + +It’s safest to use *es6-symbol* as a [ponyfill](http://kikobeats.com/polyfill-ponyfill-and-prollyfill/) – a polyfill which doesn’t touch global objects: + +```javascript +var Symbol = require('es6-symbol'); +``` + +If you want to make sure your environment implements `Symbol` globally, do: + +```javascript +require('es6-symbol/implement'); +``` + +If you strictly want to use polyfill even if native `Symbol` exists (hard to find a good reason for that), do: + +```javascript +var Symbol = require('es6-symbol/polyfill'); +``` + +#### API + +Best is to refer to [specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-symbol-objects). Still if you want quick look, follow examples: + +```javascript +var Symbol = require('es6-symbol'); + +var symbol = Symbol('My custom symbol'); +var x = {}; + +x[symbol] = 'foo'; +console.log(x[symbol]); 'foo' + +// Detect iterable: +var iterator, result; +if (possiblyIterable[Symbol.iterator]) { + iterator = possiblyIterable[Symbol.iterator](); + result = iterator.next(); + while(!result.done) { + console.log(result.value); + result = iterator.next(); + } +} +``` + +### Installation +#### NPM + +In your project path: + + $ npm install es6-symbol + +##### Browser + +To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/) + +## Tests [![Build Status](https://travis-ci.org/medikoo/es6-symbol.png)](https://travis-ci.org/medikoo/es6-symbol) + + $ npm test diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/is-native-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-native-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/is-native-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-native-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/is-symbol.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-symbol.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/is-symbol.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-symbol.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/.lint b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/.lint similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/.lint rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/.lint diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/.npmignore similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/.npmignore rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/.npmignore diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/.travis.yml similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/.travis.yml rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/.travis.yml diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/CHANGES b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/CHANGES similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/CHANGES rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/CHANGES diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/LICENCE b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/LICENCE similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/LICENCE rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/LICENCE diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/README.md b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/README.md similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/README.md rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/README.md diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/auto-bind.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/auto-bind.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/auto-bind.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/auto-bind.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/lazy.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/lazy.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/lazy.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/lazy.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/package.json new file mode 100644 index 00000000000000..b7c327850c5f13 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/package.json @@ -0,0 +1,85 @@ +{ + "_args": [ + [ + "d@~0.1.1", + "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol" + ] + ], + "_from": "d@>=0.1.1 <0.2.0", + "_id": "d@0.1.1", + "_inCache": true, + "_installable": true, + "_location": "/node-gyp/path-array/array-index/es6-symbol/d", + "_npmUser": { + "email": "medikoo+npm@medikoo.com", + "name": "medikoo" + }, + "_npmVersion": "1.4.3", + "_phantomChildren": {}, + "_requested": { + "name": "d", + "raw": "d@~0.1.1", + "rawSpec": "~0.1.1", + "scope": null, + "spec": ">=0.1.1 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/path-array/array-index/es6-symbol", + "/node-gyp/path-array/array-index/es6-symbol/es5-ext/es6-iterator" + ], + "_resolved": "https://registry.npmjs.org/d/-/d-0.1.1.tgz", + "_shasum": "da184c535d18d8ee7ba2aa229b914009fae11309", + "_shrinkwrap": null, + "_spec": "d@~0.1.1", + "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol", + "author": { + "email": "medyk@medikoo.com", + "name": "Mariusz Nowak", + "url": "http://www.medikoo.com/" + }, + "bugs": { + "url": "https://github.com/medikoo/d/issues" + }, + "dependencies": { + "es5-ext": "~0.10.2" + }, + "description": "Property descriptor factory", + "devDependencies": { + "tad": "~0.1.21" + }, + "directories": {}, + "dist": { + "shasum": "da184c535d18d8ee7ba2aa229b914009fae11309", + "tarball": "http://registry.npmjs.org/d/-/d-0.1.1.tgz" + }, + "homepage": "https://github.com/medikoo/d", + "keywords": [ + "descriptor", + "descriptors", + "ecma", + "ecmascript", + "es", + "meta", + "properties", + "property" + ], + "license": "MIT", + "maintainers": [ + { + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" + } + ], + "name": "d", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/medikoo/d.git" + }, + "scripts": { + "test": "node node_modules/tad/bin/tad" + }, + "version": "0.1.1" +} diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/test/auto-bind.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/test/auto-bind.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/test/auto-bind.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/test/auto-bind.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/test/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/test/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/test/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/test/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/test/lazy.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/test/lazy.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/test/lazy.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/test/lazy.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/.lint b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.lint similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/.lint rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.lint diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.lintignore b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.lintignore new file mode 100644 index 00000000000000..eece4ff3c76f4a --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.lintignore @@ -0,0 +1,9 @@ +/string/#/normalize/_data.js +/test/boolean/is-boolean.js +/test/date/is-date.js +/test/number/is-number.js +/test/object/is-copy.js +/test/object/is-number-value.js +/test/object/is-object.js +/test/reg-exp/is-reg-exp.js +/test/string/is-string.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.npmignore similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/.npmignore rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.npmignore diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.travis.yml new file mode 100644 index 00000000000000..e8e18ee77d88ed --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.travis.yml @@ -0,0 +1,15 @@ +sudo: false # http://docs.travis-ci.com/user/workers/container-based-infrastructure/ +language: node_js +node_js: + - 0.12 + - 4 + - 5 + +before_install: + - mkdir node_modules; ln -s ../ node_modules/es5-ext + +notifications: + email: + - medikoo+es5-ext@medikoo.com + +script: "npm test && npm run lint" diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/CHANGES b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/CHANGES new file mode 100644 index 00000000000000..92ee5f6ef64ca9 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/CHANGES @@ -0,0 +1,628 @@ +v0.10.11 -- 2015.12.18 +* Ensure that check for implementation of RegExp flags doesn't crash in V8 (thanks @mathiasbynens) + +v0.10.10 -- 2015.12.11 +* Add Object.isNumberValue util + +v0.10.9 -- 2015.12.01 +* Add Object.ensureNaturalNumber and Object.ensureNaturalNumberValue + +v0.10.8 -- 2015.10.02 +* Add Number.isNatural +* Add Object.find and Object.findKey +* Support arrays in Object.copyDeep +* Fix iteration issue in forEachRight and someRight +* Fix detection of native sinh +* Depend on es6-symbol v3 + +v0.10.7 -- 2015.04.22 +* New utlitities. They're convention differs from v0.10, as they were supposed to land in v1. + Still they're non breaking and start the conventions to be used in v1 + * Object.validateArrayLike + * Object.validateArrayLikeObject + * Object.validateStringifiable + * Object.validateStringifiableValue + * Universal utilities for array-like/iterable objects + * Iterable.is + * Iterable.validate + * Iterable.validateObject + * Iterable.forEach +* Fix camelToHyphen resolution, it must be absolutely reversable by hyphenToCamel +* Fix calculations of large numbers in Math.tanh +* Fix algorithm of Math.sinh +* Fix indexes to not use real symbols +* Fix length of String.fromCodePoint +* Fix tests of Array#copyWithin +* Update Travis CI configuration + +v0.10.6 -- 2015.02.02 +* Fix handling of infinite values in Math.trunc +* Fix handling of getters in Object.normalizeOptions + +v0.10.5 -- 2015.01.20 +* Add Function#toStringTokens +* Add Object.serialize and Object.unserialize +* Add String.randomUniq +* Fix Strin#camelToHyphen issue with tokens that end with digit +* Optimise Number.isInteger logic +* Improve documentation +* Configure lint scripts +* Fix spelling of LICENSE + +v0.10.4 -- 2014.04.30 +* Assure maximum spec compliance of Array.of and Array.from (thanks @mathiasbynens) +* Improve documentations + +v0.10.3 -- 2014.04.29 +Provide accurate iterators handling: +* Array.from improvements: + * Assure right unicode symbols resolution when processing strings in Array.from + * Rely on ES6 symbol shim and use native @@iterator Symbol if provided by environment +* Add methods: + * Array.prototype.entries + * Array.prototype.keys + * Array.prototype.values + * Array.prototype[@@iterator] + * String.prototype[@@iterator] + +Improve documentation + +v0.10.2 -- 2014.04.24 +- Simplify and deprecate `isCallable`. It seems in ES5 based engines there are + no callable objects which are `typeof obj !== 'function'` +- Update Array.from map callback signature (up to latest resolution of TC39) +- Improve documentation + +v0.10.1 -- 2014.04.14 +Bump version for npm +(Workaround for accidental premature publish & unpublish of v0.10.0 a while ago) + +v0.10.0 -- 2014.04.13 +Major update: +- All methods and function specified for ECMAScript 6 are now introduced as + shims accompanied with functions through which (optionally) they can be + implementend on native objects +- Filename convention was changed to shorter and strictly lower case names. e.g. + `lib/String/prototype/starts-with` became `string/#/starts-with` +- Generated functions are guaranteed to have expected length +- Objects with null prototype (created via `Object.create(null)`) are widely + supported (older version have crashed due to implied `obj.hasOwnProperty` and + related invocations) +- Support array subclasses +- When handling lists do not limit its length to Uint32 range +- Use newly introduced `Object.eq` for strict equality in place of `Object.is` +- Iteration of Object have been improved so properties that were hidden or + removed after iteration started are not iterated. + +Additions: +- `Array.isPlainArray` +- `Array.validArray` +- `Array.prototype.concat` (as updated with ES6) +- `Array.prototype.copyWithin` (as introduced with ES6) +- `Array.prototype.fill` (as introduced with ES6) +- `Array.prototype.filter` (as updated with ES6) +- `Array.prototype.findIndex` (as introduced with ES6) +- `Array.prototype.map` (as updated with ES6) +- `Array.prototype.separate` +- `Array.prototype.slice` (as updated with ES6) +- `Array.prototype.splice` (as updated with ES6) +- `Function.prototype.copy` +- `Math.acosh` (as introduced with ES6) +- `Math.atanh` (as introduced with ES6) +- `Math.cbrt` (as introduced with ES6) +- `Math.clz32` (as introduced with ES6) +- `Math.cosh` (as introduced with ES6) +- `Math.expm1` (as introduced with ES6) +- `Math.fround` (as introduced with ES6) +- `Math.hypot` (as introduced with ES6) +- `Math.imul` (as introduced with ES6) +- `Math.log2` (as introduced with ES6) +- `Math.log10` (as introduced with ES6) +- `Math.log1p` (as introduced with ES6) +- `Math.sinh` (as introduced with ES6) +- `Math.tanh` (as introduced with ES6) +- `Math.trunc` (as introduced with ES6) +- `Number.EPSILON` (as introduced with ES6) +- `Number.MIN_SAFE_INTEGER` (as introduced with ES6) +- `Number.MAX_SAFE_INTEGER` (as introduced with ES6) +- `Number.isFinite` (as introduced with ES6) +- `Number.isInteger` (as introduced with ES6) +- `Number.isSafeInteger` (as introduced with ES6) +- `Object.create` (with fix for V8 issue which disallows prototype turn of + objects derived from null +- `Object.eq` - Less restrictive version of `Object.is` based on SameValueZero + algorithm +- `Object.firstKey` +- `Object.keys` (as updated with ES6) +- `Object.mixinPrototypes` +- `Object.primitiveSet` +- `Object.setPrototypeOf` (as introduced with ES6) +- `Object.validObject` +- `RegExp.escape` +- `RegExp.prototype.match` (as introduced with ES6) +- `RegExp.prototype.replace` (as introduced with ES6) +- `RegExp.prototype.search` (as introduced with ES6) +- `RegExp.prototype.split` (as introduced with ES6) +- `RegExp.prototype.sticky` (as introduced with ES6) +- `RegExp.prototype.unicode` (as introduced with ES6) +- `String.fromCodePoint` (as introduced with ES6) +- `String.raw` (as introduced with ES6) +- `String.prototype.at` +- `String.prototype.codePointAt` (as introduced with ES6) +- `String.prototype.normalize` (as introduced with ES6) +- `String.prototype.plainReplaceAll` + +Removals: +- `reserved` set +- `Array.prototype.commonLeft` +- `Function.insert` +- `Function.remove` +- `Function.prototype.silent` +- `Function.prototype.wrap` +- `Object.descriptor` Move to external `d` project. + See: https://github.com/medikoo/d +- `Object.diff` +- `Object.extendDeep` +- `Object.reduce` +- `Object.values` +- `String.prototype.trimCommonLeft` + +Renames: +- `Function.i` into `Function.identity` +- `Function.k` into `Function.constant` +- `Number.toInt` into `Number.toInteger` +- `Number.toUint` into `Number.toPosInteger` +- `Object.extend` into `Object.assign` (as introduced in ES 6) +- `Object.extendProperties` into `Object.mixin`, with improved internal + handling, so it matches temporarily specified `Object.mixin` for ECMAScript 6 +- `Object.isList` into `Object.isArrayLike` +- `Object.mapToArray` into `Object.toArray` (with fixed function length) +- `Object.toPlainObject` into `Object.normalizeOptions` (as this is the real + use case where we use this function) +- `Function.prototype.chain` into `Function.prototype.compose` +- `Function.prototype.match` into `Function.prototype.spread` +- `String.prototype.format` into `String.formatMethod` + +Improvements & Fixes: +- Remove workaround for primitive values handling in object iterators +- `Array.from`: Update so it follows ES 6 spec +- `Array.prototype.compact`: filters just null and undefined values + (not all falsies) +- `Array.prototype.eIndexOf` and `Array.prototype.eLastIndexOf`: fix position + handling, improve internals +- `Array.prototype.find`: return undefined not null, in case of not found + (follow ES 6) +- `Array.prototype.remove` fix function length +- `Error.custom`: simplify, Custom class case is addressed by outer + `error-create` project -> https://github.com/medikoo/error-create +- `Error.isError` true only for Error instances (remove detection of host + Exception objects) +- `Number.prototype.pad`: Normalize negative pad +- `Object.clear`: Handle errors same way as in `Object.assign` +- `Object.compact`: filters just null and undefined values (not all falsies) +- `Object.compare`: Take into account NaN values +- `Object.copy`: Split into `Object.copy` and `Object.copyDeep` +- `Object.isCopy`: Separate into `Object.isCopy` and `Object.isCopyDeep`, where + `isCopyDeep` handles nested plain objects and plain arrays only +- `String.prototype.endsWith`: Adjust up to ES6 specification +- `String.prototype.repeat`: Adjust up to ES6 specification and improve algorithm +- `String.prototype.simpleReplace`: Rename into `String.prototype.plainReplace` +- `String.prototype.startsWith`: Adjust up to ES6 specification +- Update lint rules, and adjust code to that +- Update Travis CI configuration +- Remove Makefile (it's cross-env utility) + +v0.9.2 -- 2013.03.11 +Added: +* Array.prototype.isCopy +* Array.prototype.isUniq +* Error.CustomError +* Function.validFunction +* Object.extendDeep +* Object.descriptor.binder +* Object.safeTraverse +* RegExp.validRegExp +* String.prototype.capitalize +* String.prototype.simpleReplace + +Fixed: +* Fix Array.prototype.diff for sparse arrays +* Accept primitive objects as input values in Object iteration methods and + Object.clear, Object.count, Object.diff, Object.extend, + Object.getPropertyNames, Object.values +* Pass expected arguments to callbacks of Object.filter, Object.mapKeys, + Object.mapToArray, Object.map +* Improve callable callback support in Object.mapToArray + +v0.9.1 -- 2012.09.17 +* Object.reduce - reduce for hash-like collections +* Accapt any callable object as callback in Object.filter, mapKeys and map +* Convention cleanup + +v0.9.0 -- 2012.09.13 +We're getting to real solid API + +Removed: +* Function#memoize - it's grown up to be external package, to be soon published + as 'memoizee' +* String.guid - it doesn't fit es5-ext (extensions) concept, will be provided as + external package +# Function.arguments - obsolete +# Function.context - obsolete +# Function#flip - not readable when used, so it was never used +# Object.clone - obsolete and confusing + +Added: +* String#camelToHyphen - String format convertion + +Renamed: +* String#dashToCamelCase -> String#hyphenToCamel + +Fixes: +* Object.isObject - Quote names in literals that match reserved keywords + (older implementations crashed on that) +* String#repeat - Do not accept negative values (coerce them to 1) + +Improvements: +* Array#remove - Accepts many arguments, we can now remove many values at once +* Object iterators (forEach, map, some) - Compare function invoked with scope + object bound to this +* Function#curry - Algorithm cleanup +* Object.isCopy - Support for all types, not just plain objects +* Object.isPlainObject - Support for cross-frame objects +* Do not memoize any of the functions, it shouldn't be decided internally +* Remove Object.freeze calls in reserved, it's not up to convention +* Improved documentation +* Better linting (hard-core approach using both JSLint mod and JSHint) +* Optional arguments are now documented in funtions signature + +v0.8.2 -- 2012.06.22 +Fix errors in Array's intersection and exclusion methods, related to improper +usage of contains method + +v0.8.1 -- 2012.06.13 +Reorganized internal logic of Function.prototype.memoize. So it's more safe now +and clears cache properly. Additionally preventCache option was provided. + +v0.8.0 -- 2012.05.28 +Again, major overhaul. Probably last experimental stuff was trashed, all API +looks more like standard extensions now. + +Changes: +* Turn all Object.prototype extensions into functions and move them to Object +namespace. We learned that extending Object.prototype is bad idea in any case. +* Rename Function.prototype.curry into Function.prototype.partial. This function + is really doing partial application while currying is slightly different + concept. +* Convert Function.prototype.ncurry to new implementation of + Function.prototype.curry, it now serves real curry concept additionaly it + covers use cases for aritize and hold, which were removed. +* Rename Array's peek to last, and provide support for sparse arrays in it +* Rename Date's monthDaysCount into daysInMonth +* Simplify object iterators, now order of iteration can be configured with just + compareFn argument (no extra byKeys option) +* Rename Object.isDuplicate to Object.isCopy +* Rename Object.isEqual to Object.is which is compatible with future 'is' + keyword +* Function.memoize is now Function.prototype.memoize. Additionally clear cache + functionality is added, and access to original arguments object. +* Rename validation functions: assertNotNull to validValue, assertCallable to + validCallable. validValue was moved to Object namespace. On success they now + return validated value instead of true, it supports better composition. + Additionally created Date.validDate and Error.validError +* All documentation is now held in README.md not in code files. +* Move guid to String namespace. All guids now start with numbers. +* Array.generate: fill argument is now optional +* Object.toArray is now Array.from (as new ES6 specification draft suggests) +* All methods that rely on indexOf or lastIndexOf, now rely on egal (Object.is) + versions of them (eIndexOf, eLastIndexOf) +* Turn all get* functions that returned methods into actuall methods (get* + functionality can still be achieved with help of Function.prototype.partial). + So: Date.getFormat is now Date.prototype.format, + Number.getPad is now Number.prototype.pad, + String.getFormat is now String.prototype.format, + String.getIndent is now String.prototype.indent, + String.getPad is now String.prototype.pad +* Refactored Object.descriptor, it is now just two functions, main one and + main.gs, main is for describing values, and gs for describing getters and + setters. Configuration is passed with first argument as string e.g. 'ce' for + configurable and enumerable. If no configuration string is provided then by + default it returns configurable and writable but not enumerable for value or + configurable but not enumerable for getter/setter +* Function.prototype.silent now returns prepared function (it was + expected to be fixed for 0.7) +* Reserved keywords map (reserved) is now array not hash. +* Object.merge is now Object.extend (while former Object.extend was completely + removed) - 'extend' implies that we change object, not creating new one (as + 'merge' may imply). Similarily Object.mergeProperties was renamed to + Object.extendProperties +* Position argument support in Array.prototype.contains and + String.prototype.contains (so it follows ES6 specification draft) +* endPosition argument support in String.prototype.endsWith and fromPosition + argument support in String.prototype.startsWith (so it follows ES6 + specification draft) +* Better and cleaner String.prototype.indent implementation. No default value + for indent string argument, optional nest value (defaults to 1), remove + nostart argument +* Correct length values for most methods (so they reflect length of similar + methods in standard) +* Length argument is now optional in number and string pad methods. +* Improve arguments validation in general, so it adheres to standard conventions +* Fixed format of package.json + +Removed methods and functions: +* Object.prototype.slice - Object is not ordered collection, so slice doesn't + make sense. +* Function's rcurry, rncurry, s - too cumbersome for JS, not many use cases for + that +* Function.prototype.aritize and Function.prototype.hold - same functionality + can be achieved with new Function.prototype.curry +* Function.prototype.log - provided more generic Function.prototype.wrap for + same use case +* getNextIdGenerator - no use case for that (String.guid should be used if + needed) +* Object.toObject - Can be now acheived with Object(validValue(x)) +* Array.prototype.someValue - no real use case (personally used once and + case was already controversial) +* Date.prototype.duration - moved to external package +* Number.getAutoincrement - No real use case +* Object.prototype.extend, Object.prototype.override, + Object.prototype.plainCreate, Object.prototype.plainExtend - It was probably + too complex, same should be achieved just with Object.create, + Object.descriptor and by saving references to super methods in local scope. +* Object.getCompareBy - Functions should be created individually for each use + case +* Object.get, Object.getSet, Object.set, Object.unset - Not many use cases and + same can be easily achieved with simple inline function +* String.getPrefixWith - Not real use case for something that can be easily + achieved with '+' operator +* Object.isPrimitive - It's just negation of Object.isObject +* Number.prototype.isLess, Number.prototype.isLessOrEqual - they shouldn't be in + Number namespace and should rather be addressed with simple inline functions. +* Number.prototype.subtract - Should rather be addressed with simple inline + function + +New methods and functions: +* Array.prototype.lastIndex - Returns last declared index in array +* String.prototype.last - last for strings +* Function.prototype.wrap - Wrap function with other, it allows to specify + before and after behavior transform return value or prevent original function + from being called. +* Math.sign - Returns sign of a number (already in ES6 specification draft) +* Number.toInt - Converts value to integer (already in ES6 specification draft) +* Number.isNaN - Returns true if value is NaN (already in ES6 specification + draft) +* Number.toUint - Converts value to unsigned integer +* Number.toUint32 - Converts value to 32bit unsigned integer +* Array.prototype.eIndexOf, eLastIndexOf - Egal version (that uses Object.is) of + standard methods (all methods that were using native indexOf or lastIndexOf + now uses eIndexOf and elastIndexOf respectively) +* Array.of - as it's specified for ES6 + +Fixes: +* Fixed binarySearch so it always returns valid list index +* Object.isList - it failed on lists that are callable (e.g. NodeList in Nitro + engine) +* Object.map now supports third argument for callback + +v0.7.1 -- 2012.01.05 +New methods: +* Array.prototype.firstIndex - returns first valid index of array (for + sparse arrays it may not be '0' + +Improvements: +* Array.prototype.first - now returns value for index returned by firstIndex +* Object.prototype.mapToArray - can be called without callback, then array of + key-value pairs is returned + +Fixes +* Array.prototype.forEachRight, object's length read through UInt32 conversion + +v0.7.0 -- 2011.12.27 +Major update. +Stepped back from experimental ideas and introduced more standard approach +taking example from how ES5 methods and functions are designed. One exceptions +is that, we don’t refrain from declaring methods for Object.prototype - it’s up +to developer whether how he decides to use it in his context (as function or as +method). + +In general: +* Removed any method 'functionalization' and functionalize method itself. + es5-ext declares plain methods, which can be configured to work as functions + with call.bind(method) - see documentation. +* Removed separation of Object methods for ES5 (with descriptors) and + ES3 (plain) - we're following ES5 idea on that, some methods are intended just + for enumerable properties and some are for all properties, all are declared + for Object.prototype +* Removed separation of Array generic (collected in List folder) and not generic + methods (collected in Array folder). Now all methods are generic and are in + Array/prototype folder. This separation also meant, that methods in Array are + usually destructive. We don’t do that separation now, there’s generally no use + case for destructive iterators, we should be fine with one version of each + method, (same as ES5 is fine with e.g. one, non destructive 'filter' method) +* Folder structure resembles tree of native ES5 Objects +* All methods are written with ES5 conventions in mind, it means that most + methods are generic and can be run on any object. In more detail: + ** Array.prototype and Object.prototype methods can be run on any object (any + not null or undefined value), + ** Date.prototype methods should be called only on Date instances. + ** Function.prototype methods can be called on any callable objects (not + necessarily functions) + ** Number.prototype & String.prototype methods can be called on any value, in + case of Number it it’ll be degraded to number, in case of string it’ll be + degraded to string. +* Travis CI support (only for Node v0.6 branch, as v0.4 has buggy V8 version) + +Improvements for existing functions and methods: +* Function.memoize (was Function.cache) is now fully generic, can operate on any + type of arguments and it’s NaN safe (all NaN objects are considered equal) +* Method properties passed to Object.prototype.extend or + Object.prototype.override can aside of _super optionally take prototype object + via _proto argument +* Object iterators: forEach, mapToArray and every can now iterate in specified + order +* pluck, invoke and other functions that return reusable functions or methods + have now their results memoized. + +New methods: +* Global: assertNotNull, getNextIdGenerator, guid, isEqual, isPrimitive, + toObject +* Array: generate +* Array.prototype: binarySearch, clear, contains, diff, exclusion, find, first, + forEachRight, group, indexesOf, intersection, remove, someRight, someValue +* Boolean: isBoolean +* Date: isDate +* Function: arguments, context, insert, isArguments, remove +* Function.prototype: not, silent +* Number: getAutoincrement, isNumber +* Number.prototype: isLessOrEqual, isLess, subtract +* Object: assertCallable, descriptor (functions for clean descriptors), + getCompareBy, isCallable, isObject +* Object.prototype: clone (real clone), compact, count, diff, empty, + getPropertyNames, get, keyOf, mapKeys, override, plainCreate, plainExtend, + slice, some, unset +* RegExp: isRegExp +* String: getPrefixWith, isString +* String.prototype: caseInsensitiveCompare, contains, isNumeric + +Renamed methods: +* Date.clone -> Date.prototype.copy +* Date.format -> Date.getFormat +* Date/day/floor -> Date.prototype.floorDay +* Date/month/floor -> Date.prototype.floorMonth +* Date/month/year -> Date.prototype.floorYear +* Function.cache -> Function.memoize +* Function.getApplyArg -> Function.prototype.match +* Function.sequence -> Function.prototype.chain +* List.findSameStartLength -> Array.prototype.commonLeft +* Number.pad -> Number.getPad +* Object/plain/clone -> Object.prototype.copy +* Object/plain/elevate -> Object.prototype.flatten +* Object/plain/same -> Object.prototype.isDuplicate +* Object/plain/setValue -> Object.getSet +* String.format -> String.getFormat +* String.indent -> String.getIndent +* String.pad -> String.getPad +* String.trimLeftStr -> String.prototype.trimCommonLeft +* Object.merge -> Object.prototype.mergeProperties +* Object/plain/pluck -> Object.prototype.get +* Array.clone is now Array.prototype.copy and can be used also on any array-like + objects +* List.isList -> Object.isList +* List.toArray -> Object.prototype.toArray +* String/convert/dashToCamelCase -> String.prototype.dashToCamelCase + +Removed methods: +* Array.compact - removed destructive version (that operated on same array), we + have now non destructive version as Array.prototype.compact. +* Function.applyBind -> use apply.bind directly +* Function.bindBind -> use bind.bind directly +* Function.callBind -> use call.bind directly +* Fuction.clone -> no valid use case +* Function.dscope -> controversial approach, shouldn’t be considered seriously +* Function.functionalize -> It was experimental but standards are standards +* List/sort/length -> It can be easy obtained by Object.getCompareBy(‘length’) +* List.concat -> Concat’s for array-like’s makes no sense, just convert to array + first +* List.every -> Use Array.prototype.every directly +* List.filter -> Use Array.prototype.filter directly +* List.forEach -> User Array.prototype.forEach directly +* List.isListObject -> No valid use case, do: isList(list) && (typeof list === + 'object’) +* List.map -> Use Array.prototype.map directly +* List.reduce -> Use Array.prototype.reduce directly +* List.shiftSame -> Use Array.prototype.commonLeft and do slice +* List.slice -> Use Array.prototype.slice directly +* List.some -> Use Array.prototype.some directly +* Object.bindMethods -> it was version that considered descriptors, we have now + Object.prototype.bindMethods which operates only on enumerable properties +* Object.every -> version that considered all properties, we have now + Object.prototype.every which iterates only enumerables +* Object.invoke -> no use case +* Object.mergeDeep -> no use case +* Object.pluck -> no use case +* Object.same -> it considered descriptors, now there’s only Object.isDuplicate + which compares only enumerable properties +* Object.sameType -> no use case +* Object.toDescriptor and Object.toDescriptors -> replaced by much nicer + Object.descriptor functions +* Object/plain/link -> no use case (it was used internally only by + Object/plain/merge) +* Object/plain/setTrue -> now easily configurable by more universal + Object.getSet(true) +* String.trimRightStr -> Eventually String.prototype.trimCommonRight will be + added + +v0.6.3 -- 2011.12.12 +* Cleared npm warning for misnamed property in package.json + +v0.6.2 -- 2011.08.12 +* Calling String.indent without scope (global scope then) now treated as calling + it with null scope, it allows more direct invocations when using default nest + string: indent().call(str, nest) + +v0.6.1 -- 2011.08.08 +* Added TAD test suite to devDependencies, configured test commands. + Tests can be run with 'make test' or 'npm test' + +v0.6.0 -- 2011.08.07 +New methods: +* Array: clone, compact (in place) +* Date: format, duration, clone, monthDaysCount, day.floor, month.floor, + year.floor +* Function: getApplyArg, , ncurry, rncurry, hold, cache, log +* List: findSameStartLength, shiftSame, peek, isListObject +* Number: pad +* Object: sameType, toString, mapToArray, mergeDeep, toDescriptor, + toDescriptors, invoke +* String: startsWith, endsWith, indent, trimLeftStr, trimRightStr, pad, format + +Fixed: +* Object.extend does now prototypal extend as exptected +* Object.merge now tries to overwrite only configurable properties +* Function.flip + +Improved: +* Faster List.toArray +* Better global retrieval +* Functionalized all Function methods +* Renamed bindApply and bindCall to applyBind and callBind +* Removed Function.inherit (as it's unintuitive curry clone) +* Straightforward logic in Function.k +* Fixed naming of some tests files (letter case issue) +* Renamed Function.saturate into Function.lock +* String.dashToCamelCase digits support +* Strings now considered as List objects +* Improved List.compact +* Concise logic for List.concat +* Test wit TAD in clean ES5 context + +v0.5.1 -- 2011.07.11 +* Function's bindBind, bindCall and bindApply now more versatile + +v0.5.0 -- 2011.07.07 +* Removed Object.is and List.apply +* Renamed Object.plain.is to Object.plain.isPlainObject (keep naming convention + consistent) +* Improved documentation + +v0.4.0 -- 2011.07.05 +* Take most functions on Object to Object.plain to keep them away from object + descriptors +* Object functions with ES5 standard in mind (object descriptors) + +v0.3.0 -- 2011.06.24 +* New functions +* Consistent file naming (dash instead of camelCase) + +v0.2.1 -- 2011.05.28 +* Renamed Functions.K and Function.S to to lowercase versions (use consistent + naming) + +v0.2.0 -- 2011.05.28 +* Renamed Array folder to List (as its generic functions for array-like objects) +* Added Makefile +* Added various functions + +v0.1.0 -- 2011.05.24 +* Initial version diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/LICENSE similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/LICENSE rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/LICENSE diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/README.md b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/README.md new file mode 100644 index 00000000000000..ad09fe2317bfa7 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/README.md @@ -0,0 +1,993 @@ +# es5-ext +## ECMAScript 5 extensions +### (with respect to ECMAScript 6 standard) + +Shims for upcoming ES6 standard and other goodies implemented strictly with ECMAScript conventions in mind. + +It's designed to be used in compliant ECMAScript 5 or ECMAScript 6 environments. Older environments are not supported, although most of the features should work with correct ECMAScript 5 shim on board. + +When used in ECMAScript 6 environment, native implementation (if valid) takes precedence over shims. + +### Installation + + $ npm install es5-ext + +To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/) + +### Usage + +#### ECMAScript 6 features + +You can force ES6 features to be implemented in your environment, e.g. following will assign `from` function to `Array` (only if it's not implemented already). + +```javascript +require('es5-ext/array/from/implement'); +Array.from('foo'); // ['f', 'o', 'o'] +``` + +You can also access shims directly, without fixing native objects. Following will return native `Array.from` if it's available and fallback to shim if it's not. + +```javascript +var aFrom = require('es5-ext/array/from'); +aFrom('foo'); // ['f', 'o', 'o'] +``` + +If you want to use shim unconditionally (even if native implementation exists) do: + +```javascript +var aFrom = require('es5-ext/array/from/shim'); +aFrom('foo'); // ['f', 'o', 'o'] +``` + +##### List of ES6 shims + +It's about properties introduced with ES6 and those that have been updated in new spec. + +- `Array.from` -> `require('es5-ext/array/from')` +- `Array.of` -> `require('es5-ext/array/of')` +- `Array.prototype.concat` -> `require('es5-ext/array/#/concat')` +- `Array.prototype.copyWithin` -> `require('es5-ext/array/#/copy-within')` +- `Array.prototype.entries` -> `require('es5-ext/array/#/entries')` +- `Array.prototype.fill` -> `require('es5-ext/array/#/fill')` +- `Array.prototype.filter` -> `require('es5-ext/array/#/filter')` +- `Array.prototype.find` -> `require('es5-ext/array/#/find')` +- `Array.prototype.findIndex` -> `require('es5-ext/array/#/find-index')` +- `Array.prototype.keys` -> `require('es5-ext/array/#/keys')` +- `Array.prototype.map` -> `require('es5-ext/array/#/map')` +- `Array.prototype.slice` -> `require('es5-ext/array/#/slice')` +- `Array.prototype.splice` -> `require('es5-ext/array/#/splice')` +- `Array.prototype.values` -> `require('es5-ext/array/#/values')` +- `Array.prototype[@@iterator]` -> `require('es5-ext/array/#/@@iterator')` +- `Math.acosh` -> `require('es5-ext/math/acosh')` +- `Math.asinh` -> `require('es5-ext/math/asinh')` +- `Math.atanh` -> `require('es5-ext/math/atanh')` +- `Math.cbrt` -> `require('es5-ext/math/cbrt')` +- `Math.clz32` -> `require('es5-ext/math/clz32')` +- `Math.cosh` -> `require('es5-ext/math/cosh')` +- `Math.exmp1` -> `require('es5-ext/math/expm1')` +- `Math.fround` -> `require('es5-ext/math/fround')` +- `Math.hypot` -> `require('es5-ext/math/hypot')` +- `Math.imul` -> `require('es5-ext/math/imul')` +- `Math.log1p` -> `require('es5-ext/math/log1p')` +- `Math.log2` -> `require('es5-ext/math/log2')` +- `Math.log10` -> `require('es5-ext/math/log10')` +- `Math.sign` -> `require('es5-ext/math/sign')` +- `Math.signh` -> `require('es5-ext/math/signh')` +- `Math.tanh` -> `require('es5-ext/math/tanh')` +- `Math.trunc` -> `require('es5-ext/math/trunc')` +- `Number.EPSILON` -> `require('es5-ext/number/epsilon')` +- `Number.MAX_SAFE_INTEGER` -> `require('es5-ext/number/max-safe-integer')` +- `Number.MIN_SAFE_INTEGER` -> `require('es5-ext/number/min-safe-integer')` +- `Number.isFinite` -> `require('es5-ext/number/is-finite')` +- `Number.isInteger` -> `require('es5-ext/number/is-integer')` +- `Number.isNaN` -> `require('es5-ext/number/is-nan')` +- `Number.isSafeInteger` -> `require('es5-ext/number/is-safe-integer')` +- `Object.assign` -> `require('es5-ext/object/assign')` +- `Object.keys` -> `require('es5-ext/object/keys')` +- `Object.setPrototypeOf` -> `require('es5-ext/object/set-prototype-of')` +- `RegExp.prototype.match` -> `require('es5-ext/reg-exp/#/match')` +- `RegExp.prototype.replace` -> `require('es5-ext/reg-exp/#/replace')` +- `RegExp.prototype.search` -> `require('es5-ext/reg-exp/#/search')` +- `RegExp.prototype.split` -> `require('es5-ext/reg-exp/#/split')` +- `RegExp.prototype.sticky` -> Implement with `require('es5-ext/reg-exp/#/sticky/implement')`, use as function with `require('es5-ext/reg-exp/#/is-sticky')` +- `RegExp.prototype.unicode` -> Implement with `require('es5-ext/reg-exp/#/unicode/implement')`, use as function with `require('es5-ext/reg-exp/#/is-unicode')` +- `String.fromCodePoint` -> `require('es5-ext/string/from-code-point')` +- `String.raw` -> `require('es5-ext/string/raw')` +- `String.prototype.codePointAt` -> `require('es5-ext/string/#/code-point-at')` +- `String.prototype.contains` -> `require('es5-ext/string/#/contains')` +- `String.prototype.endsWith` -> `require('es5-ext/string/#/ends-with')` +- `String.prototype.normalize` -> `require('es5-ext/string/#/normalize')` +- `String.prototype.repeat` -> `require('es5-ext/string/#/repeat')` +- `String.prototype.startsWith` -> `require('es5-ext/string/#/starts-with')` +- `String.prototype[@@iterator]` -> `require('es5-ext/string/#/@@iterator')` + +#### Non ECMAScript standard features + +__es5-ext__ provides also other utils, and implements them as if they were proposed for a standard. It mostly offers methods (not functions) which can directly be assigned to native prototypes: + +```javascript +Object.defineProperty(Function.prototype, 'partial', { value: require('es5-ext/function/#/partial'), + configurable: true, enumerable: false, writable: true }); +Object.defineProperty(Array.prototype, 'flatten', { value: require('es5-ext/array/#/flatten'), + configurable: true, enumerable: false, writable: true }); +Object.defineProperty(String.prototype, 'capitalize', { value: require('es5-ext/string/#/capitalize'), + configurable: true, enumerable: false, writable: true }); +``` + +See [es5-extend](https://github.com/wookieb/es5-extend#es5-extend), a great utility that automatically will extend natives for you. + +__Important:__ Remember to __not__ extend natives in scope of generic reusable packages (e.g. ones you intend to publish to npm). Extending natives is fine __only__ if you're the _owner_ of the global scope, so e.g. in final project you lead development of. + +When you're in situation when native extensions are not good idea, then you should use methods indirectly: + + +```javascript +var flatten = require('es5-ext/array/#/flatten'); + +flatten.call([1, [2, [3, 4]]]); // [1, 2, 3, 4] +``` + +for better convenience you can turn methods into functions: + + +```javascript +var call = Function.prototype.call +var flatten = call.bind(require('es5-ext/array/#/flatten')); + +flatten([1, [2, [3, 4]]]); // [1, 2, 3, 4] +``` + +You can configure custom toolkit (like [underscorejs](http://underscorejs.org/)), and use it throughout your application + +```javascript +var util = {}; +util.partial = call.bind(require('es5-ext/function/#/partial')); +util.flatten = call.bind(require('es5-ext/array/#/flatten')); +util.startsWith = call.bind(require('es5-ext/string/#/starts-with')); + +util.flatten([1, [2, [3, 4]]]); // [1, 2, 3, 4] +``` + +As with native ones most methods are generic and can be run on any type of object. + +## API + +### Global extensions + +#### global _(es5-ext/global)_ + +Object that represents global scope + +### Array Constructor extensions + +#### from(arrayLike[, mapFn[, thisArg]]) _(es5-ext/array/from)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.from). +Returns array representation of _iterable_ or _arrayLike_. If _arrayLike_ is an instance of array, its copy is returned. + +#### generate([length[, …fill]]) _(es5-ext/array/generate)_ + +Generate an array of pre-given _length_ built of repeated arguments. + +#### isPlainArray(x) _(es5-ext/array/is-plain-array)_ + +Returns true if object is plain array (not instance of one of the Array's extensions). + +#### of([…items]) _(es5-ext/array/of)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.of). +Create an array from given arguments. + +#### toArray(obj) _(es5-ext/array/to-array)_ + +Returns array representation of `obj`. If `obj` is already an array, `obj` is returned back. + +#### validArray(obj) _(es5-ext/array/valid-array)_ + +Returns `obj` if it's an array, otherwise throws `TypeError` + +### Array Prototype extensions + +#### arr.binarySearch(compareFn) _(es5-ext/array/#/binary-search)_ + +In __sorted__ list search for index of item for which _compareFn_ returns value closest to _0_. +It's variant of binary search algorithm + +#### arr.clear() _(es5-ext/array/#/clear)_ + +Clears the array + +#### arr.compact() _(es5-ext/array/#/compact)_ + +Returns a copy of the context with all non-values (`null` or `undefined`) removed. + +#### arr.concat() _(es5-ext/array/#/concat)_ + +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.concat). +ES6's version of `concat`. Supports `isConcatSpreadable` symbol, and returns array of same type as the context. + +#### arr.contains(searchElement[, position]) _(es5-ext/array/#/contains)_ + +Whether list contains the given value. + +#### arr.copyWithin(target, start[, end]) _(es5-ext/array/#/copy-within)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.copywithin). + +#### arr.diff(other) _(es5-ext/array/#/diff)_ + +Returns the array of elements that are present in context list but not present in other list. + +#### arr.eIndexOf(searchElement[, fromIndex]) _(es5-ext/array/#/e-index-of)_ + +_egal_ version of `indexOf` method. [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) logic is used for comparision + +#### arr.eLastIndexOf(searchElement[, fromIndex]) _(es5-ext/array/#/e-last-index-of)_ + +_egal_ version of `lastIndexOf` method. [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) logic is used for comparision + +#### arr.entries() _(es5-ext/array/#/entries)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.entries). +Returns iterator object, which traverses the array. Each value is represented with an array, where first value is an index and second is corresponding to index value. + +#### arr.exclusion([…lists]]) _(es5-ext/array/#/exclusion)_ + +Returns the array of elements that are found only in one of the lists (either context list or list provided in arguments). + +#### arr.fill(value[, start, end]) _(es5-ext/array/#/fill)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.fill). + +#### arr.filter(callback[, thisArg]) _(es5-ext/array/#/filter)_ + +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.filter). +ES6's version of `filter`, returns array of same type as the context. + +#### arr.find(predicate[, thisArg]) _(es5-ext/array/#/find)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.find). +Return first element for which given function returns true + +#### arr.findIndex(predicate[, thisArg]) _(es5-ext/array/#/find-index)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.findindex). +Return first index for which given function returns true + +#### arr.first() _(es5-ext/array/#/first)_ + +Returns value for first defined index + +#### arr.firstIndex() _(es5-ext/array/#/first-index)_ + +Returns first declared index of the array + +#### arr.flatten() _(es5-ext/array/#/flatten)_ + +Returns flattened version of the array + +#### arr.forEachRight(cb[, thisArg]) _(es5-ext/array/#/for-each-right)_ + +`forEach` starting from last element + +#### arr.group(cb[, thisArg]) _(es5-ext/array/#/group)_ + +Group list elements by value returned by _cb_ function + +#### arr.indexesOf(searchElement[, fromIndex]) _(es5-ext/array/#/indexes-of)_ + +Returns array of all indexes of given value + +#### arr.intersection([…lists]) _(es5-ext/array/#/intersection)_ + +Computes the array of values that are the intersection of all lists (context list and lists given in arguments) + +#### arr.isCopy(other) _(es5-ext/array/#/is-copy)_ + +Returns true if both context and _other_ lists have same content + +#### arr.isUniq() _(es5-ext/array/#/is-uniq)_ + +Returns true if all values in array are unique + +#### arr.keys() _(es5-ext/array/#/keys)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.keys). +Returns iterator object, which traverses all array indexes. + +#### arr.last() _(es5-ext/array/#/last)_ + +Returns value of last defined index + +#### arr.lastIndex() _(es5-ext/array/#/last)_ + +Returns last defined index of the array + +#### arr.map(callback[, thisArg]) _(es5-ext/array/#/map)_ + +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.map). +ES6's version of `map`, returns array of same type as the context. + +#### arr.remove(value[, …valuen]) _(es5-ext/array/#/remove)_ + +Remove values from the array + +#### arr.separate(sep) _(es5-ext/array/#/separate)_ + +Returns array with items separated with `sep` value + +#### arr.slice(callback[, thisArg]) _(es5-ext/array/#/slice)_ + +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.slice). +ES6's version of `slice`, returns array of same type as the context. + +#### arr.someRight(cb[, thisArg]) _(es5-ext/array/#/someRight)_ + +`some` starting from last element + +#### arr.splice(callback[, thisArg]) _(es5-ext/array/#/splice)_ + +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.splice). +ES6's version of `splice`, returns array of same type as the context. + +#### arr.uniq() _(es5-ext/array/#/uniq)_ + +Returns duplicate-free version of the array + +#### arr.values() _(es5-ext/array/#/values)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.values). +Returns iterator object which traverses all array values. + +#### arr[@@iterator] _(es5-ext/array/#/@@iterator)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype-@@iterator). +Returns iterator object which traverses all array values. + +### Boolean Constructor extensions + +#### isBoolean(x) _(es5-ext/boolean/is-boolean)_ + +Whether value is boolean + +### Date Constructor extensions + +#### isDate(x) _(es5-ext/date/is-date)_ + +Whether value is date instance + +#### validDate(x) _(es5-ext/date/valid-date)_ + +If given object is not date throw TypeError in other case return it. + +### Date Prototype extensions + +#### date.copy(date) _(es5-ext/date/#/copy)_ + +Returns a copy of the date object + +#### date.daysInMonth() _(es5-ext/date/#/days-in-month)_ + +Returns number of days of date's month + +#### date.floorDay() _(es5-ext/date/#/floor-day)_ + +Sets the date time to 00:00:00.000 + +#### date.floorMonth() _(es5-ext/date/#/floor-month)_ + +Sets date day to 1 and date time to 00:00:00.000 + +#### date.floorYear() _(es5-ext/date/#/floor-year)_ + +Sets date month to 0, day to 1 and date time to 00:00:00.000 + +#### date.format(pattern) _(es5-ext/date/#/format)_ + +Formats date up to given string. Supported patterns: + +* `%Y` - Year with century, 1999, 2003 +* `%y` - Year without century, 99, 03 +* `%m` - Month, 01..12 +* `%d` - Day of the month 01..31 +* `%H` - Hour (24-hour clock), 00..23 +* `%M` - Minute, 00..59 +* `%S` - Second, 00..59 +* `%L` - Milliseconds, 000..999 + +### Error Constructor extensions + +#### custom(message/*, code, ext*/) _(es5-ext/error/custom)_ + +Creates custom error object, optinally extended with `code` and other extension properties (provided with `ext` object) + +#### isError(x) _(es5-ext/error/is-error)_ + +Whether value is an error (instance of `Error`). + +#### validError(x) _(es5-ext/error/valid-error)_ + +If given object is not error throw TypeError in other case return it. + +### Error Prototype extensions + +#### err.throw() _(es5-ext/error/#/throw)_ + +Throws error + +### Function Constructor extensions + +Some of the functions were inspired by [Functional JavaScript](http://osteele.com/sources/javascript/functional/) project by Olivier Steele + +#### constant(x) _(es5-ext/function/constant)_ + +Returns a constant function that returns pregiven argument + +_k(x)(y) =def x_ + +#### identity(x) _(es5-ext/function/identity)_ + +Identity function. Returns first argument + +_i(x) =def x_ + +#### invoke(name[, …args]) _(es5-ext/function/invoke)_ + +Returns a function that takes an object as an argument, and applies object's +_name_ method to arguments. +_name_ can be name of the method or method itself. + +_invoke(name, …args)(object, …args2) =def object\[name\]\(…args, …args2\)_ + +#### isArguments(x) _(es5-ext/function/is-arguments)_ + +Whether value is arguments object + +#### isFunction(arg) _(es5-ext/function/is-function)_ + +Wether value is instance of function + +#### noop() _(es5-ext/function/noop)_ + +No operation function + +#### pluck(name) _(es5-ext/function/pluck)_ + +Returns a function that takes an object, and returns the value of its _name_ +property + +_pluck(name)(obj) =def obj[name]_ + +#### validFunction(arg) _(es5-ext/function/valid-function)_ + +If given object is not function throw TypeError in other case return it. + +### Function Prototype extensions + +Some of the methods were inspired by [Functional JavaScript](http://osteele.com/sources/javascript/functional/) project by Olivier Steele + +#### fn.compose([…fns]) _(es5-ext/function/#/compose)_ + +Applies the functions in reverse argument-list order. + +_f1.compose(f2, f3, f4)(…args) =def f1(f2(f3(f4(…arg))))_ + +#### fn.copy() _(es5-ext/function/#/copy)_ + +Produces copy of given function + +#### fn.curry([n]) _(es5-ext/function/#/curry)_ + +Invoking the function returned by this function only _n_ arguments are passed to the underlying function. If the underlying function is not saturated, the result is a function that passes all its arguments to the underlying function. +If _n_ is not provided then it defaults to context function length + +_f.curry(4)(arg1, arg2)(arg3)(arg4) =def f(arg1, args2, arg3, arg4)_ + +#### fn.lock([…args]) _(es5-ext/function/#/lock)_ + +Returns a function that applies the underlying function to _args_, and ignores its own arguments. + +_f.lock(…args)(…args2) =def f(…args)_ + +_Named after it's counterpart in Google Closure_ + +#### fn.not() _(es5-ext/function/#/not)_ + +Returns a function that returns boolean negation of value returned by underlying function. + +_f.not()(…args) =def !f(…args)_ + +#### fn.partial([…args]) _(es5-ext/function/#/partial)_ + +Returns a function that when called will behave like context function called with initially passed arguments. If more arguments are suplilied, they are appended to initial args. + +_f.partial(…args1)(…args2) =def f(…args1, …args2)_ + +#### fn.spread() _(es5-ext/function/#/spread)_ + +Returns a function that applies underlying function with first list argument + +_f.match()(args) =def f.apply(null, args)_ + +#### fn.toStringTokens() _(es5-ext/function/#/to-string-tokens)_ + +Serializes function into two (arguments and body) string tokens. Result is plain object with `args` and `body` properties. + +### Math extensions + +#### acosh(x) _(es5-ext/math/acosh)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.acosh). + +#### asinh(x) _(es5-ext/math/asinh)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.asinh). + +#### atanh(x) _(es5-ext/math/atanh)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.atanh). + +#### cbrt(x) _(es5-ext/math/cbrt)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cbrt). + +#### clz32(x) _(es5-ext/math/clz32)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.clz32). + +#### cosh(x) _(es5-ext/math/cosh)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cosh). + +#### expm1(x) _(es5-ext/math/expm1)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.expm1). + +#### fround(x) _(es5-ext/math/fround)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.fround). + +#### hypot([…values]) _(es5-ext/math/hypot)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.hypot). + +#### imul(x, y) _(es5-ext/math/imul)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.imul). + +#### log1p(x) _(es5-ext/math/log1p)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log1p). + +#### log2(x) _(es5-ext/math/log2)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log2). + +#### log10(x) _(es5-ext/math/log10)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log10). + +#### sign(x) _(es5-ext/math/sign)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sign). + +#### sinh(x) _(es5-ext/math/sinh)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sinh). + +#### tanh(x) _(es5-ext/math/tanh)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.tanh). + +#### trunc(x) _(es5-ext/math/trunc)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.trunc). + +### Number Constructor extensions + +#### EPSILON _(es5-ext/number/epsilon)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.epsilon). + +The difference between 1 and the smallest value greater than 1 that is representable as a Number value, which is approximately 2.2204460492503130808472633361816 x 10-16. + +#### isFinite(x) _(es5-ext/number/is-finite)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite). +Whether value is finite. Differs from global isNaN that it doesn't do type coercion. + +#### isInteger(x) _(es5-ext/number/is-integer)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isinteger). +Whether value is integer. + +#### isNaN(x) _(es5-ext/number/is-nan)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isnan). +Whether value is NaN. Differs from global isNaN that it doesn't do type coercion. + +#### isNumber(x) _(es5-ext/number/is-number)_ + +Whether given value is number + +#### isSafeInteger(x) _(es5-ext/number/is-safe-integer)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.issafeinteger). + +#### MAX_SAFE_INTEGER _(es5-ext/number/max-safe-integer)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.maxsafeinteger). +The value of Number.MAX_SAFE_INTEGER is 9007199254740991. + +#### MIN_SAFE_INTEGER _(es5-ext/number/min-safe-integer)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.minsafeinteger). +The value of Number.MIN_SAFE_INTEGER is -9007199254740991 (253-1). + +#### toInteger(x) _(es5-ext/number/to-integer)_ + +Converts value to integer + +#### toPosInteger(x) _(es5-ext/number/to-pos-integer)_ + +Converts value to positive integer. If provided value is less than 0, then 0 is returned + +#### toUint32(x) _(es5-ext/number/to-uint32)_ + +Converts value to unsigned 32 bit integer. This type is used for array lengths. +See: http://www.2ality.com/2012/02/js-integers.html + +### Number Prototype extensions + +#### num.pad(length[, precision]) _(es5-ext/number/#/pad)_ + +Pad given number with zeros. Returns string + +### Object Constructor extensions + +#### assign(target, source[, …sourcen]) _(es5-ext/object/assign)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign). +Extend _target_ by enumerable own properties of other objects. If properties are already set on target object, they will be overwritten. + +#### clear(obj) _(es5-ext/object/clear)_ + +Remove all enumerable own properties of the object + +#### compact(obj) _(es5-ext/object/compact)_ + +Returns copy of the object with all enumerable properties that have no falsy values + +#### compare(obj1, obj2) _(es5-ext/object/compare)_ + +Universal cross-type compare function. To be used for e.g. array sort. + +#### copy(obj) _(es5-ext/object/copy)_ + +Returns copy of the object with all enumerable properties. + +#### copyDeep(obj) _(es5-ext/object/copy-deep)_ + +Returns deep copy of the object with all enumerable properties. + +#### count(obj) _(es5-ext/object/count)_ + +Counts number of enumerable own properties on object + +#### create(obj[, properties]) _(es5-ext/object/create)_ + +`Object.create` alternative that provides workaround for [V8 issue](http://code.google.com/p/v8/issues/detail?id=2804). + +When `null` is provided as a prototype, it's substituted with specially prepared object that derives from Object.prototype but has all Object.prototype properties shadowed with undefined. + +It's quirky solution that allows us to have plain objects with no truthy properties but with turnable prototype. + +Use only for objects that you plan to switch prototypes of and be aware of limitations of this workaround. + +#### eq(x, y) _(es5-ext/object/eq)_ + +Whether two values are equal, using [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) algorithm. + +#### every(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/every)_ + +Analogous to Array.prototype.every. Returns true if every key-value pair in this object satisfies the provided testing function. +Optionally _compareFn_ can be provided which assures that keys are tested in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key). + +#### filter(obj, cb[, thisArg]) _(es5-ext/object/filter)_ + +Analogous to Array.prototype.filter. Returns new object with properites for which _cb_ function returned truthy value. + +#### firstKey(obj) _(es5-ext/object/first-key)_ + +Returns first enumerable key of the object, as keys are unordered by specification, it can be any key of an object. + +#### flatten(obj) _(es5-ext/object/flatten)_ + +Returns new object, with flatten properties of input object + +_flatten({ a: { b: 1 }, c: { d: 1 } }) =def { b: 1, d: 1 }_ + +#### forEach(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/for-each)_ + +Analogous to Array.prototype.forEach. Calls a function for each key-value pair found in object +Optionally _compareFn_ can be provided which assures that properties are iterated in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key). + +#### getPropertyNames() _(es5-ext/object/get-property-names)_ + +Get all (not just own) property names of the object + +#### is(x, y) _(es5-ext/object/is)_ + +Whether two values are equal, using [_SameValue_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) algorithm. + +#### isArrayLike(x) _(es5-ext/object/is-array-like)_ + +Whether object is array-like object + +#### isCopy(x, y) _(es5-ext/object/is-copy)_ + +Two values are considered a copy of same value when all of their own enumerable properties have same values. + +#### isCopyDeep(x, y) _(es5-ext/object/is-copy-deep)_ + +Deep comparision of objects + +#### isEmpty(obj) _(es5-ext/object/is-empty)_ + +True if object doesn't have any own enumerable property + +#### isObject(arg) _(es5-ext/object/is-object)_ + +Whether value is not primitive + +#### isPlainObject(arg) _(es5-ext/object/is-plain-object)_ + +Whether object is plain object, its protototype should be Object.prototype and it cannot be host object. + +#### keyOf(obj, searchValue) _(es5-ext/object/key-of)_ + +Search object for value + +#### keys(obj) _(es5-ext/object/keys)_ + +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys). +ES6's version of `keys`, doesn't throw on primitive input + +#### map(obj, cb[, thisArg]) _(es5-ext/object/map)_ + +Analogous to Array.prototype.map. Creates a new object with properties which values are results of calling a provided function on every key-value pair in this object. + +#### mapKeys(obj, cb[, thisArg]) _(es5-ext/object/map-keys)_ + +Create new object with same values, but remapped keys + +#### mixin(target, source) _(es5-ext/object/mixin)_ + +Extend _target_ by all own properties of other objects. Properties found in both objects will be overwritten (unless they're not configurable and cannot be overwritten). +_It was for a moment part of ECMAScript 6 draft._ + +#### mixinPrototypes(target, …source]) _(es5-ext/object/mixin-prototypes)_ + +Extends _target_, with all source and source's prototype properties. +Useful as an alternative for `setPrototypeOf` in environments in which it cannot be shimmed (no `__proto__` support). + +#### normalizeOptions(options) _(es5-ext/object/normalize-options)_ + +Normalizes options object into flat plain object. + +Useful for functions in which we either need to keep options object for future reference or need to modify it for internal use. + +- It never returns input `options` object back (always a copy is created) +- `options` can be undefined in such case empty plain object is returned. +- Copies all enumerable properties found down prototype chain. + +#### primitiveSet([…names]) _(es5-ext/object/primitive-set)_ + +Creates `null` prototype based plain object, and sets on it all property names provided in arguments to true. + +#### safeTraverse(obj[, …names]) _(es5-ext/object/safe-traverse)_ + +Safe navigation of object properties. See http://wiki.ecmascript.org/doku.php?id=strawman:existential_operator + +#### serialize(value) _(es5-ext/object/serialize)_ + +Serialize value into string. Differs from [JSON.stringify](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that it serializes also dates, functions and regular expresssions. + +#### setPrototypeOf(object, proto) _(es5-ext/object/set-prototype-of)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.setprototypeof). +If native version is not provided, it depends on existence of `__proto__` functionality, if it's missing, `null` instead of function is exposed. + +#### some(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/some)_ + +Analogous to Array.prototype.some Returns true if any key-value pair satisfies the provided +testing function. +Optionally _compareFn_ can be provided which assures that keys are tested in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key). + +#### toArray(obj[, cb[, thisArg[, compareFn]]]) _(es5-ext/object/to-array)_ + +Creates an array of results of calling a provided function on every key-value pair in this object. +Optionally _compareFn_ can be provided which assures that results are added in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key). + +#### unserialize(str) _(es5-ext/object/unserialize)_ + +Userializes value previously serialized with [serialize](#serializevalue-es5-extobjectserialize) + +#### validCallable(x) _(es5-ext/object/valid-callable)_ + +If given object is not callable throw TypeError in other case return it. + +#### validObject(x) _(es5-ext/object/valid-object)_ + +Throws error if given value is not an object, otherwise it is returned. + +#### validValue(x) _(es5-ext/object/valid-value)_ + +Throws error if given value is `null` or `undefined`, otherwise returns value. + +### RegExp Constructor extensions + +#### escape(str) _(es5-ext/reg-exp/escape)_ + +Escapes string to be used in regular expression + +#### isRegExp(x) _(es5-ext/reg-exp/is-reg-exp)_ + +Whether object is regular expression + +#### validRegExp(x) _(es5-ext/reg-exp/valid-reg-exp)_ + +If object is regular expression it is returned, otherwise TypeError is thrown. + +### RegExp Prototype extensions + +#### re.isSticky(x) _(es5-ext/reg-exp/#/is-sticky)_ + +Whether regular expression has `sticky` flag. + +It's to be used as counterpart to [regExp.sticky](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-get-regexp.prototype.sticky) if it's not implemented. + +#### re.isUnicode(x) _(es5-ext/reg-exp/#/is-unicode)_ + +Whether regular expression has `unicode` flag. + +It's to be used as counterpart to [regExp.unicode](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-get-regexp.prototype.unicode) if it's not implemented. + +#### re.match(string) _(es5-ext/reg-exp/#/match)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.match). + +#### re.replace(string, replaceValue) _(es5-ext/reg-exp/#/replace)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.replace). + +#### re.search(string) _(es5-ext/reg-exp/#/search)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.search). + +#### re.split(string) _(es5-ext/reg-exp/#/search)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.split). + +#### re.sticky _(es5-ext/reg-exp/#/sticky/implement)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.sticky). +It's a getter, so only `implement` and `is-implemented` modules are provided. + +#### re.unicode _(es5-ext/reg-exp/#/unicode/implement)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.unicode). +It's a getter, so only `implement` and `is-implemented` modules are provided. + +### String Constructor extensions + +#### formatMethod(fMap) _(es5-ext/string/format-method)_ + +Creates format method. It's used e.g. to create `Date.prototype.format` method + +#### fromCodePoint([…codePoints]) _(es5-ext/string/from-code-point)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.fromcodepoint) + +#### isString(x) _(es5-ext/string/is-string)_ + +Whether object is string + +#### randomUniq() _(es5-ext/string/random-uniq)_ + +Returns randomly generated id, with guarantee of local uniqueness (no same id will be returned twice) + +#### raw(callSite[, …substitutions]) _(es5-ext/string/raw)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.raw) + +### String Prototype extensions + +#### str.at(pos) _(es5-ext/string/#/at)_ + +_Proposed for ECMAScript 6/7 standard, but not (yet) in a draft_ + +Returns a string at given position in Unicode-safe manner. +Based on [implementation by Mathias Bynens](https://github.com/mathiasbynens/String.prototype.at). + +#### str.camelToHyphen() _(es5-ext/string/#/camel-to-hyphen)_ + +Convert camelCase string to hyphen separated, e.g. one-two-three -> oneTwoThree. +Useful when converting names from js property convention into filename convention. + +#### str.capitalize() _(es5-ext/string/#/capitalize)_ + +Capitalize first character of a string + +#### str.caseInsensitiveCompare(str) _(es5-ext/string/#/case-insensitive-compare)_ + +Case insensitive compare + +#### str.codePointAt(pos) _(es5-ext/string/#/code-point-at)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.codepointat) + +Based on [implementation by Mathias Bynens](https://github.com/mathiasbynens/String.prototype.codePointAt). + +#### str.contains(searchString[, position]) _(es5-ext/string/#/contains)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.contains) + +Whether string contains given string. + +#### str.endsWith(searchString[, endPosition]) _(es5-ext/string/#/ends-with)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.endswith). +Whether strings ends with given string + +#### str.hyphenToCamel() _(es5-ext/string/#/hyphen-to-camel)_ + +Convert hyphen separated string to camelCase, e.g. one-two-three -> oneTwoThree. +Useful when converting names from filename convention to js property name convention. + +#### str.indent(str[, count]) _(es5-ext/string/#/indent)_ + +Indents each line with provided _str_ (if _count_ given then _str_ is repeated _count_ times). + +#### str.last() _(es5-ext/string/#/last)_ + +Return last character + +#### str.normalize([form]) _(es5-ext/string/#/normalize)_ + +[_Introduced with ECMAScript 6_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize). +Returns the Unicode Normalization Form of a given string. +Based on Matsuza's version. Code used for integrated shim can be found at [github.com/walling/unorm](https://github.com/walling/unorm/blob/master/lib/unorm.js) + +#### str.pad(fill[, length]) _(es5-ext/string/#/pad)_ + +Pad string with _fill_. +If _length_ si given than _fill_ is reapated _length_ times. +If _length_ is negative then pad is applied from right. + +#### str.repeat(n) _(es5-ext/string/#/repeat)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.repeat). +Repeat given string _n_ times + +#### str.plainReplace(search, replace) _(es5-ext/string/#/plain-replace)_ + +Simple `replace` version. Doesn't support regular expressions. Replaces just first occurrence of search string. Doesn't support insert patterns, therefore it is safe to replace text with text obtained programmatically (there's no need for additional _$_ characters escape in such case). + +#### str.plainReplaceAll(search, replace) _(es5-ext/string/#/plain-replace-all)_ + +Simple `replace` version. Doesn't support regular expressions. Replaces all occurrences of search string. Doesn't support insert patterns, therefore it is safe to replace text with text obtained programmatically (there's no need for additional _$_ characters escape in such case). + +#### str.startsWith(searchString[, position]) _(es5-ext/string/#/starts-with)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.startswith). +Whether strings starts with given string + +#### str[@@iterator] _(es5-ext/string/#/@@iterator)_ + +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype-@@iterator). +Returns iterator object which traverses all string characters (with respect to unicode symbols) + +### Tests [![Build Status](https://travis-ci.org/medikoo/es5-ext.png)](https://travis-ci.org/medikoo/es5-ext) + + $ npm test diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/@@iterator/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/@@iterator/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/@@iterator/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/@@iterator/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/@@iterator/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/@@iterator/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/@@iterator/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/@@iterator/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/@@iterator/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/@@iterator/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/@@iterator/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/@@iterator/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/@@iterator/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/@@iterator/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/@@iterator/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/@@iterator/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/_compare-by-length.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/_compare-by-length.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/_compare-by-length.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/_compare-by-length.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/binary-search.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/binary-search.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/binary-search.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/binary-search.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/clear.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/clear.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/clear.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/clear.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/compact.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/compact.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/compact.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/compact.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/concat/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/concat/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/concat/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/concat/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/concat/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/concat/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/concat/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/concat/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/concat/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/concat/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/concat/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/concat/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/concat/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/concat/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/concat/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/concat/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/contains.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/contains.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/contains.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/contains.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/copy-within/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/copy-within/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/copy-within/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/copy-within/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/copy-within/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/copy-within/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/copy-within/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/copy-within/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/copy-within/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/copy-within/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/copy-within/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/copy-within/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/copy-within/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/copy-within/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/copy-within/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/copy-within/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/diff.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/diff.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/diff.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/diff.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/e-index-of.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/e-index-of.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/e-index-of.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/e-index-of.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/e-last-index-of.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/e-last-index-of.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/e-last-index-of.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/e-last-index-of.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/entries/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/entries/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/entries/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/entries/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/entries/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/entries/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/entries/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/entries/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/entries/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/entries/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/entries/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/entries/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/entries/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/entries/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/entries/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/entries/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/exclusion.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/exclusion.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/exclusion.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/exclusion.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/fill/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/fill/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/fill/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/fill/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/fill/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/fill/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/fill/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/fill/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/fill/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/fill/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/fill/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/fill/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/fill/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/fill/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/fill/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/fill/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/filter/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/filter/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/filter/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/filter/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/filter/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/filter/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/filter/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/filter/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/filter/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/filter/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/filter/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/filter/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/filter/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/filter/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/filter/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/filter/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/find-index/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find-index/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/find-index/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find-index/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/find-index/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find-index/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/find-index/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find-index/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/find-index/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find-index/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/find-index/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find-index/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/find-index/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find-index/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/find-index/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find-index/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/find/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/find/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/find/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/find/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/find/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/find/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/find/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/find/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/find/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/first-index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/first-index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/first-index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/first-index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/first.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/first.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/first.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/first.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/flatten.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/flatten.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/flatten.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/flatten.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/for-each-right.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/for-each-right.js new file mode 100644 index 00000000000000..1702bb164466fb --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/for-each-right.js @@ -0,0 +1,20 @@ +'use strict'; + +var toPosInt = require('../../number/to-pos-integer') + , callable = require('../../object/valid-callable') + , value = require('../../object/valid-value') + + , hasOwnProperty = Object.prototype.hasOwnProperty + , call = Function.prototype.call; + +module.exports = function (cb/*, thisArg*/) { + var i, self, thisArg; + + self = Object(value(this)); + callable(cb); + thisArg = arguments[1]; + + for (i = (toPosInt(self.length) - 1); i >= 0; --i) { + if (hasOwnProperty.call(self, i)) call.call(cb, thisArg, self[i], i, self); + } +}; diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/group.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/group.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/group.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/group.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/indexes-of.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/indexes-of.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/indexes-of.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/indexes-of.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/intersection.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/intersection.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/intersection.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/intersection.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/is-copy.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/is-copy.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/is-copy.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/is-copy.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/is-uniq.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/is-uniq.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/is-uniq.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/is-uniq.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/keys/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/keys/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/keys/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/keys/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/keys/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/keys/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/keys/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/keys/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/keys/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/keys/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/keys/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/keys/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/keys/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/keys/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/keys/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/keys/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/last-index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/last-index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/last-index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/last-index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/last.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/last.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/last.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/last.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/map/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/map/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/map/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/map/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/map/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/map/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/map/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/map/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/map/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/map/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/map/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/map/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/map/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/map/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/map/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/map/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/remove.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/remove.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/remove.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/remove.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/separate.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/separate.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/separate.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/separate.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/slice/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/slice/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/slice/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/slice/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/slice/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/slice/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/slice/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/slice/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/slice/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/slice/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/slice/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/slice/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/slice/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/slice/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/slice/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/slice/shim.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/some-right.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/some-right.js new file mode 100644 index 00000000000000..f54cf945c38447 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/some-right.js @@ -0,0 +1,23 @@ +'use strict'; + +var toPosInt = require('../../number/to-pos-integer') + , callable = require('../../object/valid-callable') + , value = require('../../object/valid-value') + + , hasOwnProperty = Object.prototype.hasOwnProperty + , call = Function.prototype.call; + +module.exports = function (cb/*, thisArg*/) { + var i, self, thisArg; + self = Object(value(this)); + callable(cb); + thisArg = arguments[1]; + + for (i = (toPosInt(self.length) - 1); i >= 0; --i) { + if (hasOwnProperty.call(self, i) && + call.call(cb, thisArg, self[i], i, self)) { + return true; + } + } + return false; +}; diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/splice/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/splice/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/splice/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/splice/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/splice/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/splice/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/splice/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/splice/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/splice/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/splice/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/splice/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/splice/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/splice/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/splice/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/splice/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/splice/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/uniq.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/uniq.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/uniq.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/uniq.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/values/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/values/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/values/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/values/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/values/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/values/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/values/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/values/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/values/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/values/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/values/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/values/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/values/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/values/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/values/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/values/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/_is-extensible.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/_is-extensible.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/_is-extensible.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/_is-extensible.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/_sub-array-dummy-safe.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/_sub-array-dummy-safe.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/_sub-array-dummy-safe.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/_sub-array-dummy-safe.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/_sub-array-dummy.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/_sub-array-dummy.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/_sub-array-dummy.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/_sub-array-dummy.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/from/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/from/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/from/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/from/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/from/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/from/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/from/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/from/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/from/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/from/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/from/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/from/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/from/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/from/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/from/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/from/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/generate.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/generate.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/generate.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/generate.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/is-plain-array.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/is-plain-array.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/is-plain-array.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/is-plain-array.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/of/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/of/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/of/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/of/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/of/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/of/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/of/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/of/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/of/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/of/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/of/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/of/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/of/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/of/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/of/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/of/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/to-array.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/to-array.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/to-array.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/to-array.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/valid-array.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/valid-array.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/valid-array.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/valid-array.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/boolean/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/boolean/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/boolean/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/boolean/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/boolean/is-boolean.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/boolean/is-boolean.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/boolean/is-boolean.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/boolean/is-boolean.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/date/#/copy.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/copy.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/date/#/copy.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/copy.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/date/#/days-in-month.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/days-in-month.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/date/#/days-in-month.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/days-in-month.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/date/#/floor-day.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/floor-day.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/date/#/floor-day.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/floor-day.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/date/#/floor-month.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/floor-month.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/date/#/floor-month.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/floor-month.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/date/#/floor-year.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/floor-year.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/date/#/floor-year.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/floor-year.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/date/#/format.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/format.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/date/#/format.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/format.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/date/#/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/date/#/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/#/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/date/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/date/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/date/is-date.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/is-date.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/date/is-date.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/is-date.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/date/valid-date.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/valid-date.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/date/valid-date.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/valid-date.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/error/#/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/#/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/error/#/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/#/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/error/#/throw.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/#/throw.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/error/#/throw.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/#/throw.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/error/custom.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/custom.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/error/custom.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/custom.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/error/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/error/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/error/is-error.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/is-error.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/error/is-error.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/is-error.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/error/valid-error.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/valid-error.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/error/valid-error.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/error/valid-error.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/#/compose.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/compose.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/#/compose.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/compose.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/#/copy.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/copy.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/#/copy.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/copy.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/#/curry.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/curry.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/#/curry.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/curry.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/#/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/#/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/#/lock.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/lock.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/#/lock.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/lock.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/#/not.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/not.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/#/not.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/not.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/#/partial.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/partial.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/#/partial.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/partial.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/#/spread.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/spread.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/#/spread.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/spread.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/#/to-string-tokens.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/to-string-tokens.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/#/to-string-tokens.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/to-string-tokens.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/_define-length.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/_define-length.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/_define-length.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/_define-length.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/constant.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/constant.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/constant.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/constant.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/identity.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/identity.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/identity.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/identity.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/invoke.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/invoke.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/invoke.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/invoke.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/is-arguments.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/is-arguments.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/is-arguments.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/is-arguments.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/is-function.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/is-function.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/is-function.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/is-function.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/noop.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/noop.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/noop.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/noop.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/pluck.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/pluck.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/pluck.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/pluck.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/valid-function.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/valid-function.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/function/valid-function.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/valid-function.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/global.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/global.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/global.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/global.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/iterable/for-each.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/iterable/for-each.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/iterable/for-each.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/iterable/for-each.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/iterable/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/iterable/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/iterable/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/iterable/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/iterable/is.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/iterable/is.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/iterable/is.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/iterable/is.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/iterable/validate-object.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/iterable/validate-object.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/iterable/validate-object.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/iterable/validate-object.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/iterable/validate.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/iterable/validate.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/iterable/validate.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/iterable/validate.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/_pack-ieee754.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/_pack-ieee754.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/_pack-ieee754.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/_pack-ieee754.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/_unpack-ieee754.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/_unpack-ieee754.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/_unpack-ieee754.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/_unpack-ieee754.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/acosh/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/acosh/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/acosh/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/acosh/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/acosh/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/acosh/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/acosh/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/acosh/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/acosh/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/acosh/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/acosh/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/acosh/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/acosh/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/acosh/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/acosh/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/acosh/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/asinh/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/asinh/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/asinh/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/asinh/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/asinh/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/asinh/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/asinh/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/asinh/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/asinh/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/asinh/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/asinh/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/asinh/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/asinh/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/asinh/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/asinh/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/asinh/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/atanh/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/atanh/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/atanh/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/atanh/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/atanh/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/atanh/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/atanh/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/atanh/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/atanh/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/atanh/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/atanh/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/atanh/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/atanh/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/atanh/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/atanh/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/atanh/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/cbrt/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cbrt/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/cbrt/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cbrt/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/cbrt/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cbrt/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/cbrt/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cbrt/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/cbrt/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cbrt/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/cbrt/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cbrt/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/cbrt/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cbrt/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/cbrt/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cbrt/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/clz32/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/clz32/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/clz32/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/clz32/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/clz32/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/clz32/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/clz32/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/clz32/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/clz32/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/clz32/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/clz32/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/clz32/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/clz32/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/clz32/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/clz32/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/clz32/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/cosh/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cosh/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/cosh/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cosh/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/cosh/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cosh/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/cosh/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cosh/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/cosh/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cosh/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/cosh/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cosh/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/cosh/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cosh/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/cosh/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/cosh/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/expm1/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/expm1/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/expm1/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/expm1/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/expm1/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/expm1/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/expm1/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/expm1/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/expm1/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/expm1/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/expm1/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/expm1/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/expm1/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/expm1/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/expm1/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/expm1/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/fround/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/fround/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/fround/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/fround/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/fround/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/fround/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/fround/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/fround/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/fround/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/fround/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/fround/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/fround/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/fround/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/fround/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/fround/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/fround/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/hypot/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/hypot/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/hypot/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/hypot/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/hypot/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/hypot/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/hypot/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/hypot/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/hypot/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/hypot/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/hypot/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/hypot/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/hypot/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/hypot/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/hypot/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/hypot/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/imul/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/imul/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/imul/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/imul/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/imul/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/imul/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/imul/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/imul/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/imul/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/imul/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/imul/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/imul/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/imul/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/imul/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/imul/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/imul/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/log10/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log10/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/log10/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log10/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/log10/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log10/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/log10/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log10/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/log10/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log10/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/log10/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log10/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/log10/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log10/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/log10/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log10/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/log1p/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log1p/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/log1p/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log1p/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/log1p/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log1p/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/log1p/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log1p/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/log1p/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log1p/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/log1p/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log1p/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/log1p/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log1p/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/log1p/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log1p/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/log2/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log2/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/log2/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log2/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/log2/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log2/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/log2/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log2/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/log2/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log2/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/log2/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log2/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/log2/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log2/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/log2/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/log2/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/sign/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sign/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/sign/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sign/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/sign/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sign/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/sign/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sign/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/sign/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sign/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/sign/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sign/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/sign/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sign/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/sign/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sign/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/sinh/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sinh/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/sinh/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sinh/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/sinh/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sinh/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/sinh/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sinh/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/sinh/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sinh/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/sinh/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sinh/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/sinh/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sinh/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/sinh/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/sinh/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/tanh/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/tanh/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/tanh/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/tanh/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/tanh/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/tanh/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/tanh/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/tanh/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/tanh/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/tanh/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/tanh/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/tanh/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/tanh/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/tanh/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/tanh/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/tanh/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/trunc/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/trunc/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/trunc/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/trunc/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/trunc/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/trunc/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/trunc/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/trunc/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/trunc/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/trunc/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/trunc/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/trunc/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/trunc/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/trunc/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/math/trunc/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/math/trunc/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/#/chain.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/#/chain.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/#/chain.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/#/chain.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/.lint b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/.lint similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/.lint rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/.lint diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/.npmignore similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/.npmignore rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/.npmignore diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/.travis.yml new file mode 100644 index 00000000000000..fc254110608e62 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/.travis.yml @@ -0,0 +1,11 @@ +sudo: false # http://docs.travis-ci.com/user/workers/container-based-infrastructure/ +language: node_js +node_js: + - 0.12 + - 4 + +notifications: + email: + - medikoo+es6-iterator@medikoo.com + +script: "npm test && npm run lint" diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/CHANGES b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/CHANGES new file mode 100644 index 00000000000000..ce33180939c05f --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/CHANGES @@ -0,0 +1,35 @@ +v2.0.0 -- 2015.10.02 +* Use es6-symbol at v3 + +v1.0.0 -- 2015.06.23 +* Implement support for arguments object +* Drop support for v0.8 node ('^' in package.json dependencies) + +v0.1.3 -- 2015.02.02 +* Update dependencies +* Fix spelling of LICENSE + +v0.1.2 -- 2014.11.19 +* Optimise internal `_next` to not verify internal's list length at all times + (#2 thanks @RReverser) +* Fix documentation examples +* Configure lint scripts + +v0.1.1 -- 2014.04.29 +* Fix es6-symbol dependency version + +v0.1.0 -- 2014.04.29 +* Assure strictly npm hosted dependencies +* Remove sparse arrays dedicated handling (as per spec) +* Add: isIterable, validIterable and chain (method) +* Remove toArray, it's addressed by Array.from (polyfil can be found in es5-ext/array/from) +* Add break possiblity to 'forOf' via 'doBreak' function argument +* Provide dedicated iterator for array-likes (ArrayIterator) and for strings (StringIterator) +* Provide @@toStringTag symbol +* When available rely on @@iterator symbol +* Remove 32bit integer maximum list length restriction +* Improve Iterator internals +* Update to use latest version of dependencies + +v0.0.0 -- 2013.10.12 +Initial (dev version) \ No newline at end of file diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/LICENSE similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/LICENSE rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/LICENSE diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/README.md b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/README.md new file mode 100644 index 00000000000000..30faa82bbaefaa --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/README.md @@ -0,0 +1,148 @@ +# es6-iterator +## ECMAScript 6 Iterator interface + +### Installation + + $ npm install es6-iterator + +To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/) + +## API + +### Constructors + +#### Iterator(list) _(es6-iterator)_ + +Abstract Iterator interface. Meant for extensions and not to be used on its own. + +Accepts any _list_ object (technically object with numeric _length_ property). + +_Mind it doesn't iterate strings properly, for that use dedicated [StringIterator](#string-iterator)_ + +```javascript +var Iterator = require('es6-iterator') +var iterator = new Iterator([1, 2, 3]); + +iterator.next(); // { value: 1, done: false } +iterator.next(); // { value: 2, done: false } +iterator.next(); // { value: 3, done: false } +iterator.next(); // { value: undefined, done: true } +``` + + +#### ArrayIterator(arrayLike[, kind]) _(es6-iterator/array)_ + +Dedicated for arrays and array-likes. Supports three iteration kinds: +* __value__ _(default)_ - Iterates values +* __key__ - Iterates indexes +* __key+value__ - Iterates keys and indexes, each iteration value is in _[key, value]_ form. + + +```javascript +var ArrayIterator = require('es6-iterator/array') +var iterator = new ArrayIterator([1, 2, 3], 'key+value'); + +iterator.next(); // { value: [0, 1], done: false } +iterator.next(); // { value: [1, 2], done: false } +iterator.next(); // { value: [2, 3], done: false } +iterator.next(); // { value: undefined, done: true } +``` + +May also be used for _arguments_ objects: + +```javascript +(function () { + var iterator = new ArrayIterator(arguments); + + iterator.next(); // { value: 1, done: false } + iterator.next(); // { value: 2, done: false } + iterator.next(); // { value: 3, done: false } + iterator.next(); // { value: undefined, done: true } +}(1, 2, 3)); +``` + +#### StringIterator(str) _(es6-iterator/string)_ + +Assures proper iteration over unicode symbols. +See: http://mathiasbynens.be/notes/javascript-unicode + +```javascript +var StringIterator = require('es6-iterator/string'); +var iterator = new StringIterator('f🙈o🙉o🙊'); + +iterator.next(); // { value: 'f', done: false } +iterator.next(); // { value: '🙈', done: false } +iterator.next(); // { value: 'o', done: false } +iterator.next(); // { value: '🙉', done: false } +iterator.next(); // { value: 'o', done: false } +iterator.next(); // { value: '🙊', done: false } +iterator.next(); // { value: undefined, done: true } +``` + +### Function utilities + +#### forOf(iterable, callback[, thisArg]) _(es6-iterator/for-of)_ + +Polyfill for ECMAScript 6 [`for...of`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) statement. + +``` +var forOf = require('es6-iterator/for-of'); +var result = []; + +forOf('🙈🙉🙊', function (monkey) { result.push(monkey); }); +console.log(result); // ['🙈', '🙉', '🙊']; +``` + +Optionally you can break iteration at any point: + +```javascript +var result = []; + +forOf([1,2,3,4]', function (val, doBreak) { + result.push(monkey); + if (val >= 3) doBreak(); +}); +console.log(result); // [1, 2, 3]; +``` + +#### get(obj) _(es6-iterator/get)_ + +Return iterator for any iterable object. + +```javascript +var getIterator = require('es6-iterator/get'); +var iterator = get([1,2,3]); + +iterator.next(); // { value: 1, done: false } +iterator.next(); // { value: 2, done: false } +iterator.next(); // { value: 3, done: false } +iterator.next(); // { value: undefined, done: true } +``` + +#### isIterable(obj) _(es6-iterator/is-iterable)_ + +Whether _obj_ is iterable + +```javascript +var isIterable = require('es6-iterator/is-iterable'); + +isIterable(null); // false +isIterable(true); // false +isIterable('str'); // true +isIterable(['a', 'r', 'r']); // true +isIterable(new ArrayIterator([])); // true +``` + +#### validIterable(obj) _(es6-iterator/valid-iterable)_ + +If _obj_ is an iterable it is returned. Otherwise _TypeError_ is thrown. + +### Method extensions + +#### iterator.chain(iterator1[, …iteratorn]) _(es6-iterator/#/chain)_ + +Chain multiple iterators into one. + +### Tests [![Build Status](https://travis-ci.org/medikoo/es6-iterator.png)](https://travis-ci.org/medikoo/es6-iterator) + + $ npm test diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/array.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/array.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/array.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/array.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/for-of.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/for-of.js new file mode 100644 index 00000000000000..c7a28411d59db9 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/for-of.js @@ -0,0 +1,46 @@ +'use strict'; + +var isArguments = require('es5-ext/function/is-arguments') + , callable = require('es5-ext/object/valid-callable') + , isString = require('es5-ext/string/is-string') + , get = require('./get') + + , isArray = Array.isArray, call = Function.prototype.call + , some = Array.prototype.some; + +module.exports = function (iterable, cb/*, thisArg*/) { + var mode, thisArg = arguments[2], result, doBreak, broken, i, l, char, code; + if (isArray(iterable) || isArguments(iterable)) mode = 'array'; + else if (isString(iterable)) mode = 'string'; + else iterable = get(iterable); + + callable(cb); + doBreak = function () { broken = true; }; + if (mode === 'array') { + some.call(iterable, function (value) { + call.call(cb, thisArg, value, doBreak); + if (broken) return true; + }); + return; + } + if (mode === 'string') { + l = iterable.length; + for (i = 0; i < l; ++i) { + char = iterable[i]; + if ((i + 1) < l) { + code = char.charCodeAt(0); + if ((code >= 0xD800) && (code <= 0xDBFF)) char += iterable[++i]; + } + call.call(cb, thisArg, char, doBreak); + if (broken) break; + } + return; + } + result = iterable.next(); + + while (!result.done) { + call.call(cb, thisArg, result.value, doBreak); + if (broken) return; + result = iterable.next(); + } +}; diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/get.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/get.js new file mode 100644 index 00000000000000..7c7e052b191d63 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/get.js @@ -0,0 +1,15 @@ +'use strict'; + +var isArguments = require('es5-ext/function/is-arguments') + , isString = require('es5-ext/string/is-string') + , ArrayIterator = require('./array') + , StringIterator = require('./string') + , iterable = require('./valid-iterable') + , iteratorSymbol = require('es6-symbol').iterator; + +module.exports = function (obj) { + if (typeof iterable(obj)[iteratorSymbol] === 'function') return obj[iteratorSymbol](); + if (isArguments(obj)) return new ArrayIterator(obj); + if (isString(obj)) return new StringIterator(obj); + return new ArrayIterator(obj); +}; diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/index.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/is-iterable.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/is-iterable.js new file mode 100644 index 00000000000000..2c6f496c38c4c2 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/is-iterable.js @@ -0,0 +1,15 @@ +'use strict'; + +var isArguments = require('es5-ext/function/is-arguments') + , isString = require('es5-ext/string/is-string') + , iteratorSymbol = require('es6-symbol').iterator + + , isArray = Array.isArray; + +module.exports = function (value) { + if (value == null) return false; + if (isArray(value)) return true; + if (isString(value)) return true; + if (isArguments(value)) return true; + return (typeof value[iteratorSymbol] === 'function'); +}; diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/package.json new file mode 100644 index 00000000000000..e4e603f6b2edf0 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/package.json @@ -0,0 +1,91 @@ +{ + "_args": [ + [ + "es6-iterator@2", + "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext" + ] + ], + "_from": "es6-iterator@>=2.0.0 <3.0.0", + "_id": "es6-iterator@2.0.0", + "_inCache": true, + "_installable": true, + "_location": "/node-gyp/path-array/array-index/es6-symbol/es5-ext/es6-iterator", + "_nodeVersion": "0.12.7", + "_npmUser": { + "email": "medikoo+npm@medikoo.com", + "name": "medikoo" + }, + "_npmVersion": "2.11.3", + "_phantomChildren": {}, + "_requested": { + "name": "es6-iterator", + "raw": "es6-iterator@2", + "rawSpec": "2", + "scope": null, + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/path-array/array-index/es6-symbol/es5-ext" + ], + "_resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.0.tgz", + "_shasum": "bd968567d61635e33c0b80727613c9cb4b096bac", + "_shrinkwrap": null, + "_spec": "es6-iterator@2", + "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext", + "author": { + "email": "medyk@medikoo.com", + "name": "Mariusz Nowak", + "url": "http://www.medikoo.com/" + }, + "bugs": { + "url": "https://github.com/medikoo/es6-iterator/issues" + }, + "dependencies": { + "d": "^0.1.1", + "es5-ext": "^0.10.7", + "es6-symbol": "3" + }, + "description": "Iterator abstraction based on ES6 specification", + "devDependencies": { + "event-emitter": "^0.3.4", + "tad": "^0.2.3", + "xlint": "^0.2.2", + "xlint-jslint-medikoo": "^0.1.3" + }, + "directories": {}, + "dist": { + "shasum": "bd968567d61635e33c0b80727613c9cb4b096bac", + "tarball": "http://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.0.tgz" + }, + "gitHead": "4d9445834e87780ab373b14d6791e860899e2d31", + "homepage": "https://github.com/medikoo/es6-iterator#readme", + "keywords": [ + "array", + "generator", + "iterator", + "list", + "map", + "set" + ], + "license": "MIT", + "maintainers": [ + { + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" + } + ], + "name": "es6-iterator", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/medikoo/es6-iterator.git" + }, + "scripts": { + "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream", + "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", + "test": "node ./node_modules/tad/bin/tad" + }, + "version": "2.0.0" +} diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/string.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/string.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/string.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/string.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/test/#/chain.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/#/chain.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/test/#/chain.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/#/chain.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/test/array.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/array.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/test/array.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/array.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/for-of.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/for-of.js new file mode 100644 index 00000000000000..108df7d97a3c39 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/for-of.js @@ -0,0 +1,40 @@ +'use strict'; + +var ArrayIterator = require('../array') + + , slice = Array.prototype.slice; + +module.exports = function (t, a) { + var i = 0, x = ['raz', 'dwa', 'trzy'], y = {}, called = 0; + t(x, function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "Array " + i + "#"); + a(this, y, "Array: context: " + (i++) + "#"); + }, y); + i = 0; + t((function () { return arguments; }('raz', 'dwa', 'trzy')), function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "Arguments" + i + "#"); + a(this, y, "Arguments: context: " + (i++) + "#"); + }, y); + i = 0; + t(x = 'foo', function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "String " + i + "#"); + a(this, y, "Regular String: context: " + (i++) + "#"); + }, y); + i = 0; + x = ['r', '💩', 'z']; + t('r💩z', function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "String " + i + "#"); + a(this, y, "Unicode String: context: " + (i++) + "#"); + }, y); + i = 0; + t(new ArrayIterator(x), function () { + a.deep(slice.call(arguments, 0, 1), [x[i]], "Iterator " + i + "#"); + a(this, y, "Iterator: context: " + (i++) + "#"); + }, y); + + t(x = ['raz', 'dwa', 'trzy'], function (value, doBreak) { + ++called; + return doBreak(); + }); + a(called, 1, "Break"); +}; diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/get.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/get.js new file mode 100644 index 00000000000000..81ce6e6ae48b79 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/get.js @@ -0,0 +1,17 @@ +'use strict'; + +var iteratorSymbol = require('es6-symbol').iterator + , Iterator = require('../'); + +module.exports = function (t, a) { + var iterator; + a.throws(function () { t(); }, TypeError, "Null"); + a.throws(function () { t({}); }, TypeError, "Plain object"); + a.throws(function () { t({ length: 0 }); }, TypeError, "Array-like"); + iterator = {}; + iterator[iteratorSymbol] = function () { return new Iterator([]); }; + a(t(iterator) instanceof Iterator, true, "Iterator"); + a(String(t([])), '[object Array Iterator]', " Array"); + a(String(t((function () { return arguments; }()))), '[object Array Iterator]', " Arguments"); + a(String(t('foo')), '[object String Iterator]', "String"); +}; diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/test/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/test/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/index.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/is-iterable.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/is-iterable.js new file mode 100644 index 00000000000000..438ad349ca3d48 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/is-iterable.js @@ -0,0 +1,19 @@ +'use strict'; + +var iteratorSymbol = require('es6-symbol').iterator + , Iterator = require('../'); + +module.exports = function (t, a) { + var iterator; + a(t(), false, "Undefined"); + a(t(123), false, "Number"); + a(t({}), false, "Plain object"); + a(t({ length: 0 }), false, "Array-like"); + iterator = {}; + iterator[iteratorSymbol] = function () { return new Iterator([]); }; + a(t(iterator), true, "Iterator"); + a(t([]), true, "Array"); + a(t('foo'), true, "String"); + a(t(''), true, "Empty string"); + a(t((function () { return arguments; }())), true, "Arguments"); +}; diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/test/string.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/string.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/test/string.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/string.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/valid-iterable.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/valid-iterable.js new file mode 100644 index 00000000000000..a407f1a0c46923 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/test/valid-iterable.js @@ -0,0 +1,18 @@ +'use strict'; + +var iteratorSymbol = require('es6-symbol').iterator + , Iterator = require('../'); + +module.exports = function (t, a) { + var obj; + a.throws(function () { t(); }, TypeError, "Undefined"); + a.throws(function () { t({}); }, TypeError, "Plain object"); + a.throws(function () { t({ length: 0 }); }, TypeError, "Array-like"); + obj = {}; + obj[iteratorSymbol] = function () { return new Iterator([]); }; + a(t(obj), obj, "Iterator"); + obj = []; + a(t(obj), obj, 'Array'); + obj = (function () { return arguments; }()); + a(t(obj), obj, "Arguments"); +}; diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/valid-iterable.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/valid-iterable.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/valid-iterable.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/valid-iterable.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/#/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/#/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/#/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/#/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/#/pad.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/#/pad.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/#/pad.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/#/pad.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/epsilon/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/epsilon/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/epsilon/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/epsilon/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/epsilon/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/epsilon/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/epsilon/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/epsilon/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/epsilon/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/epsilon/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/epsilon/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/epsilon/is-implemented.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/index.js new file mode 100644 index 00000000000000..841b3612c0a7ca --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/index.js @@ -0,0 +1,17 @@ +'use strict'; + +module.exports = { + '#': require('./#'), + EPSILON: require('./epsilon'), + isFinite: require('./is-finite'), + isInteger: require('./is-integer'), + isNaN: require('./is-nan'), + isNatural: require('./is-natural'), + isNumber: require('./is-number'), + isSafeInteger: require('./is-safe-integer'), + MAX_SAFE_INTEGER: require('./max-safe-integer'), + MIN_SAFE_INTEGER: require('./min-safe-integer'), + toInteger: require('./to-integer'), + toPosInteger: require('./to-pos-integer'), + toUint32: require('./to-uint32') +}; diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-finite/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-finite/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-finite/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-finite/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-finite/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-finite/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-finite/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-finite/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-finite/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-finite/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-finite/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-finite/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-finite/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-finite/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-finite/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-finite/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-integer/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-integer/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-integer/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-integer/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-integer/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-integer/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-integer/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-integer/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-integer/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-integer/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-integer/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-integer/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-integer/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-integer/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-integer/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-integer/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-nan/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-nan/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-nan/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-nan/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-nan/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-nan/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-nan/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-nan/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-nan/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-nan/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-nan/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-nan/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-nan/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-nan/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-nan/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-nan/shim.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-natural.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-natural.js new file mode 100644 index 00000000000000..831090d23c3745 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-natural.js @@ -0,0 +1,5 @@ +'use strict'; + +var isInteger = require('./is-integer'); + +module.exports = function (num) { return isInteger(num) && (num >= 0); }; diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-number.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-number.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-number.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-number.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-safe-integer/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-safe-integer/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-safe-integer/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-safe-integer/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-safe-integer/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-safe-integer/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-safe-integer/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-safe-integer/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-safe-integer/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-safe-integer/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-safe-integer/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-safe-integer/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-safe-integer/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-safe-integer/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/is-safe-integer/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/is-safe-integer/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/max-safe-integer/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/max-safe-integer/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/max-safe-integer/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/max-safe-integer/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/max-safe-integer/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/max-safe-integer/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/max-safe-integer/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/max-safe-integer/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/max-safe-integer/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/max-safe-integer/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/max-safe-integer/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/max-safe-integer/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/min-safe-integer/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/min-safe-integer/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/min-safe-integer/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/min-safe-integer/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/min-safe-integer/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/min-safe-integer/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/min-safe-integer/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/min-safe-integer/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/min-safe-integer/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/min-safe-integer/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/min-safe-integer/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/min-safe-integer/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/to-integer.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/to-integer.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/to-integer.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/to-integer.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/to-pos-integer.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/to-pos-integer.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/to-pos-integer.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/to-pos-integer.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/to-uint32.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/to-uint32.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/to-uint32.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/number/to-uint32.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/_iterate.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/_iterate.js new file mode 100644 index 00000000000000..1ccbaf2742eb16 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/_iterate.js @@ -0,0 +1,29 @@ +// Internal method, used by iteration functions. +// Calls a function for each key-value pair found in object +// Optionally takes compareFn to iterate object in specific order + +'use strict'; + +var callable = require('./valid-callable') + , value = require('./valid-value') + + , bind = Function.prototype.bind, call = Function.prototype.call, keys = Object.keys + , propertyIsEnumerable = Object.prototype.propertyIsEnumerable; + +module.exports = function (method, defVal) { + return function (obj, cb/*, thisArg, compareFn*/) { + var list, thisArg = arguments[2], compareFn = arguments[3]; + obj = Object(value(obj)); + callable(cb); + + list = keys(obj); + if (compareFn) { + list.sort((typeof compareFn === 'function') ? bind.call(compareFn, obj) : undefined); + } + if (typeof method !== 'function') method = list[method]; + return call.call(method, list, function (key, index) { + if (!propertyIsEnumerable.call(obj, key)) return defVal; + return call.call(cb, thisArg, obj[key], key, obj, index); + }); + }; +}; diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/assign/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/assign/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/assign/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/assign/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/assign/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/assign/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/assign/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/assign/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/assign/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/assign/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/assign/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/assign/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/assign/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/assign/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/assign/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/assign/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/clear.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/clear.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/clear.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/clear.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/compact.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/compact.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/compact.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/compact.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/compare.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/compare.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/compare.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/compare.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/copy-deep.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/copy-deep.js new file mode 100644 index 00000000000000..b203a7c6934c57 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/copy-deep.js @@ -0,0 +1,38 @@ +'use strict'; + +var forEach = require('./for-each') + , isPlainObject = require('./is-plain-object') + , value = require('./valid-value') + + , isArray = Array.isArray + , copy, copyItem; + +copyItem = function (value, key) { + var index; + if (!isPlainObject(value) && !isArray(value)) return value; + index = this[0].indexOf(value); + if (index === -1) return copy.call(this, value); + return this[1][index]; +}; + +copy = function (source) { + var target = isArray(source) ? [] : {}; + this[0].push(source); + this[1].push(target); + if (isArray(source)) { + source.forEach(function (value, key) { + target[key] = copyItem.call(this, value, key); + }, this); + } else { + forEach(source, function (value, key) { + target[key] = copyItem.call(this, value, key); + }, this); + } + return target; +}; + +module.exports = function (source) { + var obj = Object(value(source)); + if (obj !== source) return obj; + return copy.call([[], []], obj); +}; diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/copy.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/copy.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/copy.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/copy.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/count.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/count.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/count.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/count.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/create.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/create.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/create.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/create.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/ensure-natural-number-value.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/ensure-natural-number-value.js new file mode 100644 index 00000000000000..f58fb4e4a709f5 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/ensure-natural-number-value.js @@ -0,0 +1,8 @@ +'use strict'; + +var ensure = require('./ensure-natural-number'); + +module.exports = function (arg) { + if (arg == null) throw new TypeError(arg + " is not a natural number"); + return ensure(arg); +}; diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/ensure-natural-number.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/ensure-natural-number.js new file mode 100644 index 00000000000000..af9b4d77c29efe --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/ensure-natural-number.js @@ -0,0 +1,9 @@ +'use strict'; + +var isNatural = require('../number/is-natural'); + +module.exports = function (arg) { + var num = Number(arg); + if (!isNatural(num)) throw new TypeError(arg + " is not a natural number"); + return num; +}; diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/eq.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/eq.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/eq.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/eq.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/every.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/every.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/every.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/every.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/filter.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/filter.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/filter.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/filter.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/find-key.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/find-key.js new file mode 100644 index 00000000000000..5841fd709a4f86 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/find-key.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./_iterate')(require('../array/#/find'), false); diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/find.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/find.js new file mode 100644 index 00000000000000..c94f643f3f50c6 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/find.js @@ -0,0 +1,8 @@ +'use strict'; + +var findKey = require('./find-key'); + +module.exports = function (obj, cb/*, thisArg, compareFn*/) { + var key = findKey.apply(this, arguments); + return (key == null) ? key : obj[key]; +}; diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/first-key.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/first-key.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/first-key.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/first-key.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/flatten.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/flatten.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/flatten.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/flatten.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/for-each.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/for-each.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/for-each.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/for-each.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/get-property-names.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/get-property-names.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/get-property-names.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/get-property-names.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/index.js new file mode 100644 index 00000000000000..77f5b6aebab1e1 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/index.js @@ -0,0 +1,53 @@ +'use strict'; + +module.exports = { + assign: require('./assign'), + clear: require('./clear'), + compact: require('./compact'), + compare: require('./compare'), + copy: require('./copy'), + copyDeep: require('./copy-deep'), + count: require('./count'), + create: require('./create'), + ensureNaturalNumber: require('./ensure-natural-number'), + ensureNaturalNumberValue: require('./ensure-natural-number-value'), + eq: require('./eq'), + every: require('./every'), + filter: require('./filter'), + find: require('./find'), + findKey: require('./find-key'), + firstKey: require('./first-key'), + flatten: require('./flatten'), + forEach: require('./for-each'), + getPropertyNames: require('./get-property-names'), + is: require('./is'), + isArrayLike: require('./is-array-like'), + isCallable: require('./is-callable'), + isCopy: require('./is-copy'), + isCopyDeep: require('./is-copy-deep'), + isEmpty: require('./is-empty'), + isNumberValue: require('./is-number-value'), + isObject: require('./is-object'), + isPlainObject: require('./is-plain-object'), + keyOf: require('./key-of'), + keys: require('./keys'), + map: require('./map'), + mapKeys: require('./map-keys'), + normalizeOptions: require('./normalize-options'), + mixin: require('./mixin'), + mixinPrototypes: require('./mixin-prototypes'), + primitiveSet: require('./primitive-set'), + safeTraverse: require('./safe-traverse'), + serialize: require('./serialize'), + setPrototypeOf: require('./set-prototype-of'), + some: require('./some'), + toArray: require('./to-array'), + unserialize: require('./unserialize'), + validateArrayLike: require('./validate-array-like'), + validateArrayLikeObject: require('./validate-array-like-object'), + validCallable: require('./valid-callable'), + validObject: require('./valid-object'), + validateStringifiable: require('./validate-stringifiable'), + validateStringifiableValue: require('./validate-stringifiable-value'), + validValue: require('./valid-value') +}; diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/is-array-like.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-array-like.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/is-array-like.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-array-like.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/is-callable.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-callable.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/is-callable.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-callable.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/is-copy-deep.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-copy-deep.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/is-copy-deep.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-copy-deep.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/is-copy.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-copy.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/is-copy.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-copy.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/is-empty.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-empty.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/is-empty.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-empty.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-number-value.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-number-value.js new file mode 100644 index 00000000000000..f6396f580f8911 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-number-value.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = function (value) { return (value != null) && !isNaN(value); }; diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/is-object.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-object.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/is-object.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-object.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/is-plain-object.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-plain-object.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/is-plain-object.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is-plain-object.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/is.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/is.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/is.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/key-of.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/key-of.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/key-of.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/key-of.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/keys/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/keys/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/keys/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/keys/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/keys/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/keys/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/keys/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/keys/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/keys/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/keys/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/keys/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/keys/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/keys/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/keys/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/keys/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/keys/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/map-keys.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/map-keys.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/map-keys.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/map-keys.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/map.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/map.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/map.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/map.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/mixin-prototypes.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/mixin-prototypes.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/mixin-prototypes.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/mixin-prototypes.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/mixin.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/mixin.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/mixin.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/mixin.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/normalize-options.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/normalize-options.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/normalize-options.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/normalize-options.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/primitive-set.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/primitive-set.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/primitive-set.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/primitive-set.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/safe-traverse.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/safe-traverse.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/safe-traverse.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/safe-traverse.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/serialize.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/serialize.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/serialize.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/serialize.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/set-prototype-of/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/set-prototype-of/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/set-prototype-of/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/set-prototype-of/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/set-prototype-of/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/set-prototype-of/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/set-prototype-of/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/set-prototype-of/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/set-prototype-of/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/set-prototype-of/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/set-prototype-of/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/set-prototype-of/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/set-prototype-of/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/set-prototype-of/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/set-prototype-of/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/set-prototype-of/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/some.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/some.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/some.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/some.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/to-array.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/to-array.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/to-array.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/to-array.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/unserialize.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/unserialize.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/unserialize.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/unserialize.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/valid-callable.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/valid-callable.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/valid-callable.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/valid-callable.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/valid-object.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/valid-object.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/valid-object.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/valid-object.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/valid-value.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/valid-value.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/valid-value.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/valid-value.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/validate-array-like-object.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/validate-array-like-object.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/validate-array-like-object.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/validate-array-like-object.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/validate-array-like.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/validate-array-like.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/validate-array-like.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/validate-array-like.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/validate-stringifiable-value.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/validate-stringifiable-value.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/validate-stringifiable-value.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/validate-stringifiable-value.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/validate-stringifiable.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/validate-stringifiable.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/validate-stringifiable.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/validate-stringifiable.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/package.json new file mode 100644 index 00000000000000..597a347e96bc9f --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/package.json @@ -0,0 +1,105 @@ +{ + "_args": [ + [ + "es5-ext@~0.10.10", + "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol" + ] + ], + "_from": "es5-ext@>=0.10.10 <0.11.0", + "_id": "es5-ext@0.10.11", + "_inCache": true, + "_installable": true, + "_location": "/node-gyp/path-array/array-index/es6-symbol/es5-ext", + "_nodeVersion": "4.2.3", + "_npmUser": { + "email": "medikoo+npm@medikoo.com", + "name": "medikoo" + }, + "_npmVersion": "2.14.7", + "_phantomChildren": { + "d": "0.1.1", + "es5-ext": "0.10.11", + "es6-symbol": "3.0.2" + }, + "_requested": { + "name": "es5-ext", + "raw": "es5-ext@~0.10.10", + "rawSpec": "~0.10.10", + "scope": null, + "spec": ">=0.10.10 <0.11.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/path-array/array-index/es6-symbol", + "/node-gyp/path-array/array-index/es6-symbol/d", + "/node-gyp/path-array/array-index/es6-symbol/es5-ext/es6-iterator" + ], + "_resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.11.tgz", + "_shasum": "8184c3e705a820948c2dbe043849379b1dbd0c45", + "_shrinkwrap": null, + "_spec": "es5-ext@~0.10.10", + "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol", + "author": { + "email": "medyk@medikoo.com", + "name": "Mariusz Nowak", + "url": "http://www.medikoo.com/" + }, + "bugs": { + "url": "https://github.com/medikoo/es5-ext/issues" + }, + "dependencies": { + "es6-iterator": "2", + "es6-symbol": "~3.0.2" + }, + "description": "ECMAScript extensions and shims", + "devDependencies": { + "tad": "~0.2.4", + "xlint": "~0.2.2", + "xlint-jslint-medikoo": "~0.1.4" + }, + "directories": {}, + "dist": { + "shasum": "8184c3e705a820948c2dbe043849379b1dbd0c45", + "tarball": "http://registry.npmjs.org/es5-ext/-/es5-ext-0.10.11.tgz" + }, + "gitHead": "aba94140a6bf79ce1a448a2db8834e8c1842b527", + "homepage": "https://github.com/medikoo/es5-ext#readme", + "keywords": [ + "addons", + "ecmascript", + "ecmascript5", + "ecmascript6", + "es5", + "es6", + "ext", + "extensions", + "extras", + "harmony", + "javascript", + "polyfill", + "shim", + "util", + "utilities", + "utils" + ], + "license": "MIT", + "maintainers": [ + { + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" + } + ], + "name": "es5-ext", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/medikoo/es5-ext.git" + }, + "scripts": { + "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream", + "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", + "test": "node ./node_modules/tad/bin/tad" + }, + "version": "0.10.11" +} diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/is-sticky.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/is-sticky.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/is-sticky.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/is-sticky.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/is-unicode.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/is-unicode.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/is-unicode.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/is-unicode.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/match/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/match/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/match/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/match/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/match/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/match/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/match/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/match/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/match/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/match/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/match/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/match/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/match/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/match/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/match/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/match/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/replace/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/replace/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/replace/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/replace/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/replace/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/replace/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/replace/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/replace/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/replace/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/replace/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/replace/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/replace/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/replace/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/replace/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/replace/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/replace/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/search/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/search/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/search/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/search/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/search/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/search/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/search/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/search/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/search/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/search/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/search/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/search/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/search/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/search/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/search/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/search/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/split/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/split/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/split/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/split/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/split/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/split/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/split/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/split/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/split/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/split/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/split/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/split/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/split/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/split/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/split/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/split/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/sticky/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/sticky/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/sticky/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/sticky/implement.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/sticky/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/sticky/is-implemented.js new file mode 100644 index 00000000000000..e4184ee4ecef30 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/sticky/is-implemented.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function () { + var dummyRegExp = /a/; + // We need to do check on instance and not on prototype due to how ES2015 spec evolved: + // https://github.com/tc39/ecma262/issues/262 + // https://github.com/tc39/ecma262/pull/263 + // https://bugs.chromium.org/p/v8/issues/detail?id=4617 + return 'sticky' in dummyRegExp; +}; diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/unicode/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/unicode/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/unicode/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/unicode/implement.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/unicode/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/unicode/is-implemented.js new file mode 100644 index 00000000000000..3e3a54b6691e55 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/#/unicode/is-implemented.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function () { + var dummyRegExp = /a/; + // We need to do check on instance and not on prototype due to how ES2015 spec evolved: + // https://github.com/tc39/ecma262/issues/262 + // https://github.com/tc39/ecma262/pull/263 + // https://bugs.chromium.org/p/v8/issues/detail?id=4617 + return 'unicode' in dummyRegExp; +}; diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/escape.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/escape.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/escape.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/escape.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/is-reg-exp.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/is-reg-exp.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/is-reg-exp.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/is-reg-exp.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/valid-reg-exp.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/valid-reg-exp.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/valid-reg-exp.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/reg-exp/valid-reg-exp.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/@@iterator/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/@@iterator/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/@@iterator/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/@@iterator/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/@@iterator/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/@@iterator/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/@@iterator/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/@@iterator/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/@@iterator/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/@@iterator/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/@@iterator/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/@@iterator/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/@@iterator/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/@@iterator/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/@@iterator/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/@@iterator/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/at.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/at.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/at.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/at.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/camel-to-hyphen.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/camel-to-hyphen.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/camel-to-hyphen.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/camel-to-hyphen.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/capitalize.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/capitalize.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/capitalize.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/capitalize.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/case-insensitive-compare.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/case-insensitive-compare.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/case-insensitive-compare.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/case-insensitive-compare.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/code-point-at/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/code-point-at/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/code-point-at/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/code-point-at/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/code-point-at/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/code-point-at/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/code-point-at/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/code-point-at/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/code-point-at/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/code-point-at/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/code-point-at/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/code-point-at/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/code-point-at/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/code-point-at/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/code-point-at/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/code-point-at/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/contains/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/contains/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/contains/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/contains/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/contains/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/contains/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/contains/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/contains/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/contains/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/contains/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/contains/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/contains/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/contains/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/contains/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/contains/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/contains/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/ends-with/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/ends-with/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/ends-with/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/ends-with/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/ends-with/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/ends-with/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/ends-with/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/ends-with/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/ends-with/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/ends-with/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/ends-with/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/ends-with/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/ends-with/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/ends-with/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/ends-with/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/ends-with/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/hyphen-to-camel.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/hyphen-to-camel.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/hyphen-to-camel.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/hyphen-to-camel.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/indent.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/indent.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/indent.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/indent.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/index.js new file mode 100644 index 00000000000000..3efa01c040b19c --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/index.js @@ -0,0 +1,22 @@ +'use strict'; + +module.exports = { + '@@iterator': require('./@@iterator'), + at: require('./at'), + camelToHyphen: require('./camel-to-hyphen'), + capitalize: require('./capitalize'), + caseInsensitiveCompare: require('./case-insensitive-compare'), + codePointAt: require('./code-point-at'), + contains: require('./contains'), + hyphenToCamel: require('./hyphen-to-camel'), + endsWith: require('./ends-with'), + indent: require('./indent'), + last: require('./last'), + normalize: require('./normalize'), + pad: require('./pad'), + plainReplace: require('./plain-replace'), + plainReplaceAll: require('./plain-replace-all'), + repeat: require('./repeat'), + startsWith: require('./starts-with'), + uncapitalize: require('./uncapitalize') +}; diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/last.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/last.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/last.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/last.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/normalize/_data.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/normalize/_data.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/normalize/_data.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/normalize/_data.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/normalize/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/normalize/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/normalize/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/normalize/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/normalize/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/normalize/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/normalize/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/normalize/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/normalize/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/normalize/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/normalize/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/normalize/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/normalize/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/normalize/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/normalize/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/normalize/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/pad.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/pad.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/pad.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/pad.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/plain-replace-all.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/plain-replace-all.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/plain-replace-all.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/plain-replace-all.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/plain-replace.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/plain-replace.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/plain-replace.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/plain-replace.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/repeat/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/repeat/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/repeat/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/repeat/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/repeat/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/repeat/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/repeat/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/repeat/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/repeat/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/repeat/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/repeat/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/repeat/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/repeat/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/repeat/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/repeat/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/repeat/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/starts-with/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/starts-with/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/starts-with/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/starts-with/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/starts-with/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/starts-with/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/starts-with/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/starts-with/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/starts-with/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/starts-with/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/starts-with/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/starts-with/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/starts-with/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/starts-with/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/starts-with/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/starts-with/shim.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/uncapitalize.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/uncapitalize.js new file mode 100644 index 00000000000000..bedd7e7b007c5d --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/#/uncapitalize.js @@ -0,0 +1,8 @@ +'use strict'; + +var ensureStringifiable = require('../../object/validate-stringifiable-value'); + +module.exports = function () { + var str = ensureStringifiable(this); + return str.charAt(0).toLowerCase() + str.slice(1); +}; diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/format-method.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/format-method.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/format-method.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/format-method.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/from-code-point/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/from-code-point/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/from-code-point/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/from-code-point/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/from-code-point/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/from-code-point/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/from-code-point/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/from-code-point/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/from-code-point/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/from-code-point/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/from-code-point/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/from-code-point/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/from-code-point/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/from-code-point/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/from-code-point/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/from-code-point/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/is-string.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/is-string.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/is-string.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/is-string.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/random-uniq.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/random-uniq.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/random-uniq.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/random-uniq.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/raw/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/raw/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/raw/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/raw/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/raw/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/raw/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/raw/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/raw/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/raw/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/raw/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/raw/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/raw/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/raw/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/raw/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/raw/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/string/raw/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/__tad.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/__tad.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/__tad.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/__tad.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/@@iterator/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/@@iterator/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/@@iterator/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/@@iterator/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/@@iterator/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/@@iterator/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/@@iterator/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/@@iterator/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/@@iterator/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/@@iterator/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/@@iterator/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/@@iterator/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/@@iterator/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/@@iterator/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/@@iterator/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/@@iterator/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/_compare-by-length.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/_compare-by-length.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/_compare-by-length.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/_compare-by-length.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/binary-search.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/binary-search.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/binary-search.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/binary-search.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/clear.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/clear.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/clear.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/clear.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/compact.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/compact.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/compact.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/compact.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/concat/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/concat/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/concat/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/concat/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/concat/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/concat/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/concat/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/concat/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/concat/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/concat/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/concat/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/concat/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/concat/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/concat/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/concat/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/concat/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/contains.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/contains.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/contains.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/contains.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/copy-within/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/copy-within/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/copy-within/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/copy-within/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/copy-within/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/copy-within/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/copy-within/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/copy-within/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/copy-within/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/copy-within/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/copy-within/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/copy-within/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/copy-within/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/copy-within/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/copy-within/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/copy-within/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/diff.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/diff.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/diff.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/diff.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/e-index-of.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/e-index-of.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/e-index-of.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/e-index-of.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/e-last-index-of.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/e-last-index-of.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/e-last-index-of.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/e-last-index-of.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/entries/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/entries/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/entries/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/entries/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/entries/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/entries/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/entries/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/entries/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/entries/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/entries/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/entries/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/entries/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/entries/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/entries/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/entries/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/entries/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/exclusion.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/exclusion.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/exclusion.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/exclusion.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/fill/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/fill/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/fill/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/fill/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/fill/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/fill/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/fill/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/fill/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/fill/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/fill/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/fill/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/fill/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/fill/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/fill/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/fill/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/fill/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/filter/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/filter/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/filter/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/filter/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/filter/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/filter/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/filter/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/filter/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/filter/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/filter/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/filter/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/filter/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/filter/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/filter/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/filter/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/filter/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/find-index/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find-index/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/find-index/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find-index/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/find-index/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find-index/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/find-index/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find-index/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/find-index/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find-index/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/find-index/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find-index/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/find-index/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find-index/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/find-index/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find-index/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/find/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/find/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/find/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/find/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/find/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/find/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/find/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/find/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/find/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/first-index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/first-index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/first-index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/first-index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/first.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/first.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/first.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/first.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/flatten.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/flatten.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/flatten.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/flatten.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/for-each-right.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/for-each-right.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/for-each-right.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/for-each-right.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/group.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/group.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/group.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/group.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/indexes-of.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/indexes-of.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/indexes-of.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/indexes-of.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/intersection.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/intersection.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/intersection.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/intersection.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/is-copy.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/is-copy.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/is-copy.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/is-copy.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/is-uniq.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/is-uniq.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/is-uniq.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/is-uniq.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/keys/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/keys/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/keys/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/keys/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/keys/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/keys/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/keys/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/keys/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/keys/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/keys/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/keys/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/keys/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/keys/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/keys/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/keys/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/keys/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/last-index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/last-index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/last-index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/last-index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/last.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/last.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/last.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/last.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/map/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/map/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/map/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/map/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/map/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/map/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/map/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/map/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/map/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/map/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/map/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/map/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/map/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/map/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/map/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/map/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/remove.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/remove.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/remove.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/remove.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/separate.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/separate.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/separate.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/separate.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/slice/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/slice/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/slice/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/slice/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/slice/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/slice/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/slice/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/slice/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/slice/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/slice/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/slice/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/slice/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/slice/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/slice/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/slice/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/slice/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/some-right.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/some-right.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/some-right.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/some-right.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/splice/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/splice/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/splice/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/splice/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/splice/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/splice/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/splice/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/splice/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/splice/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/splice/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/splice/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/splice/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/splice/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/splice/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/splice/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/splice/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/uniq.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/uniq.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/uniq.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/uniq.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/values/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/values/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/values/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/values/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/values/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/values/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/values/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/values/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/values/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/values/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/values/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/values/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/values/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/values/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/#/values/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/#/values/shim.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/__scopes.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/__scopes.js new file mode 100644 index 00000000000000..6bfdcbc9494a87 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/__scopes.js @@ -0,0 +1,11 @@ +'use strict'; + +exports.Array = ['1', '2', '3']; + +exports.Arguments = (function () { + return arguments; +}('1', '2', '3')); + +exports.String = "123"; + +exports.Object = { 0: '1', 1: '2', 2: '3', 3: '4', length: 3 }; diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/_is-extensible.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/_is-extensible.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/_is-extensible.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/_is-extensible.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/_sub-array-dummy-safe.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/_sub-array-dummy-safe.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/_sub-array-dummy-safe.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/_sub-array-dummy-safe.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/_sub-array-dummy.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/_sub-array-dummy.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/_sub-array-dummy.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/_sub-array-dummy.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/from/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/from/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/from/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/from/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/from/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/from/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/from/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/from/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/from/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/from/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/from/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/from/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/from/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/from/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/from/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/from/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/generate.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/generate.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/generate.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/generate.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/is-plain-array.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/is-plain-array.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/is-plain-array.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/is-plain-array.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/of/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/of/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/of/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/of/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/of/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/of/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/of/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/of/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/of/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/of/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/of/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/of/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/of/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/of/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/of/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/of/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/to-array.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/to-array.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/to-array.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/to-array.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/valid-array.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/valid-array.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/valid-array.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/array/valid-array.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/boolean/is-boolean.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/boolean/is-boolean.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/boolean/is-boolean.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/boolean/is-boolean.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/date/#/copy.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/copy.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/date/#/copy.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/copy.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/date/#/days-in-month.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/days-in-month.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/date/#/days-in-month.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/days-in-month.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/date/#/floor-day.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/floor-day.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/date/#/floor-day.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/floor-day.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/date/#/floor-month.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/floor-month.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/date/#/floor-month.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/floor-month.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/date/#/floor-year.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/floor-year.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/date/#/floor-year.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/floor-year.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/date/#/format.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/format.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/date/#/format.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/#/format.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/date/is-date.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/is-date.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/date/is-date.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/is-date.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/date/valid-date.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/valid-date.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/date/valid-date.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/date/valid-date.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/error/#/throw.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/error/#/throw.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/error/#/throw.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/error/#/throw.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/error/custom.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/error/custom.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/error/custom.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/error/custom.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/error/is-error.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/error/is-error.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/error/is-error.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/error/is-error.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/error/valid-error.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/error/valid-error.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/error/valid-error.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/error/valid-error.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/#/compose.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/compose.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/#/compose.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/compose.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/#/copy.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/copy.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/#/copy.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/copy.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/#/curry.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/curry.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/#/curry.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/curry.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/#/lock.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/lock.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/#/lock.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/lock.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/#/not.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/not.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/#/not.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/not.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/#/partial.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/partial.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/#/partial.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/partial.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/#/spread.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/spread.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/#/spread.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/spread.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/#/to-string-tokens.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/to-string-tokens.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/#/to-string-tokens.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/#/to-string-tokens.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/_define-length.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/_define-length.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/_define-length.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/_define-length.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/constant.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/constant.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/constant.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/constant.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/identity.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/identity.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/identity.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/identity.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/invoke.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/invoke.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/invoke.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/invoke.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/is-arguments.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/is-arguments.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/is-arguments.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/is-arguments.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/is-function.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/is-function.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/is-function.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/is-function.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/noop.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/noop.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/noop.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/noop.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/pluck.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/pluck.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/pluck.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/pluck.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/valid-function.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/valid-function.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/function/valid-function.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/function/valid-function.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/global.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/global.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/global.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/global.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/iterable/for-each.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/iterable/for-each.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/iterable/for-each.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/iterable/for-each.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/iterable/is.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/iterable/is.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/iterable/is.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/iterable/is.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/iterable/validate-object.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/iterable/validate-object.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/iterable/validate-object.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/iterable/validate-object.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/iterable/validate.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/iterable/validate.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/iterable/validate.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/iterable/validate.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/_pack-ieee754.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/_pack-ieee754.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/_pack-ieee754.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/_pack-ieee754.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/_unpack-ieee754.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/_unpack-ieee754.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/_unpack-ieee754.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/_unpack-ieee754.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/acosh/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/acosh/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/acosh/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/acosh/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/acosh/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/acosh/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/acosh/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/acosh/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/acosh/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/acosh/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/acosh/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/acosh/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/acosh/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/acosh/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/acosh/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/acosh/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/asinh/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/asinh/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/asinh/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/asinh/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/asinh/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/asinh/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/asinh/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/asinh/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/asinh/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/asinh/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/asinh/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/asinh/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/asinh/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/asinh/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/asinh/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/asinh/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/atanh/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/atanh/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/atanh/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/atanh/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/atanh/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/atanh/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/atanh/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/atanh/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/atanh/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/atanh/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/atanh/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/atanh/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/atanh/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/atanh/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/atanh/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/atanh/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/cbrt/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cbrt/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/cbrt/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cbrt/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/cbrt/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cbrt/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/cbrt/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cbrt/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/cbrt/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cbrt/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/cbrt/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cbrt/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/cbrt/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cbrt/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/cbrt/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cbrt/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/clz32/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/clz32/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/clz32/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/clz32/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/clz32/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/clz32/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/clz32/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/clz32/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/clz32/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/clz32/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/clz32/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/clz32/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/clz32/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/clz32/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/clz32/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/clz32/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/cosh/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cosh/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/cosh/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cosh/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/cosh/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cosh/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/cosh/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cosh/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/cosh/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cosh/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/cosh/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cosh/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/cosh/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cosh/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/cosh/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/cosh/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/expm1/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/expm1/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/expm1/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/expm1/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/expm1/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/expm1/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/expm1/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/expm1/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/expm1/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/expm1/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/expm1/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/expm1/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/expm1/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/expm1/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/expm1/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/expm1/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/fround/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/fround/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/fround/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/fround/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/fround/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/fround/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/fround/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/fround/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/fround/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/fround/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/fround/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/fround/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/fround/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/fround/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/fround/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/fround/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/hypot/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/hypot/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/hypot/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/hypot/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/hypot/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/hypot/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/hypot/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/hypot/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/hypot/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/hypot/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/hypot/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/hypot/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/hypot/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/hypot/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/hypot/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/hypot/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/imul/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/imul/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/imul/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/imul/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/imul/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/imul/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/imul/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/imul/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/imul/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/imul/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/imul/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/imul/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/imul/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/imul/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/imul/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/imul/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/log10/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log10/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/log10/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log10/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/log10/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log10/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/log10/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log10/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/log10/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log10/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/log10/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log10/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/log10/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log10/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/log10/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log10/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/log1p/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log1p/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/log1p/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log1p/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/log1p/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log1p/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/log1p/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log1p/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/log1p/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log1p/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/log1p/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log1p/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/log1p/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log1p/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/log1p/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log1p/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/log2/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log2/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/log2/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log2/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/log2/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log2/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/log2/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log2/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/log2/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log2/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/log2/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log2/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/log2/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log2/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/log2/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/log2/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/sign/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sign/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/sign/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sign/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/sign/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sign/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/sign/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sign/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/sign/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sign/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/sign/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sign/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/sign/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sign/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/sign/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sign/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/sinh/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sinh/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/sinh/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sinh/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/sinh/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sinh/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/sinh/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sinh/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/sinh/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sinh/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/sinh/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sinh/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/sinh/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sinh/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/sinh/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/sinh/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/tanh/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/tanh/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/tanh/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/tanh/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/tanh/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/tanh/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/tanh/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/tanh/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/tanh/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/tanh/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/tanh/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/tanh/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/tanh/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/tanh/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/tanh/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/tanh/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/trunc/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/trunc/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/trunc/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/trunc/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/trunc/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/trunc/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/trunc/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/trunc/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/trunc/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/trunc/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/trunc/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/trunc/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/trunc/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/trunc/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/math/trunc/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/math/trunc/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/#/pad.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/#/pad.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/#/pad.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/#/pad.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/epsilon/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/epsilon/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/epsilon/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/epsilon/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/epsilon/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/epsilon/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/epsilon/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/epsilon/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/epsilon/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/epsilon/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/epsilon/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/epsilon/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-finite/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-finite/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-finite/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-finite/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-finite/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-finite/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-finite/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-finite/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-finite/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-finite/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-finite/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-finite/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-finite/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-finite/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-finite/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-finite/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-integer/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-integer/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-integer/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-integer/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-integer/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-integer/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-integer/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-integer/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-integer/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-integer/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-integer/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-integer/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-integer/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-integer/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-integer/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-integer/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-nan/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-nan/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-nan/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-nan/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-nan/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-nan/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-nan/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-nan/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-nan/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-nan/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-nan/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-nan/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-nan/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-nan/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-nan/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-nan/shim.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-natural.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-natural.js new file mode 100644 index 00000000000000..d56f12042b48f3 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-natural.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function (t, a) { + a(t(2), true, "Number"); + a(t(-2), false, "Negative"); + a(t(2.34), false, "Float"); + a(t('23'), false, "Not numeric"); + a(t(NaN), false, "NaN"); + a(t(Infinity), false, "Infinity"); +}; diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-number.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-number.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-number.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-number.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-safe-integer/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-safe-integer/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-safe-integer/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-safe-integer/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-safe-integer/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-safe-integer/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-safe-integer/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-safe-integer/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-safe-integer/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-safe-integer/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-safe-integer/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-safe-integer/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-safe-integer/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-safe-integer/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/is-safe-integer/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/is-safe-integer/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/max-safe-integer/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/max-safe-integer/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/max-safe-integer/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/max-safe-integer/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/max-safe-integer/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/max-safe-integer/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/max-safe-integer/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/max-safe-integer/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/max-safe-integer/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/max-safe-integer/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/max-safe-integer/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/max-safe-integer/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/min-safe-integer/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/min-safe-integer/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/min-safe-integer/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/min-safe-integer/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/min-safe-integer/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/min-safe-integer/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/min-safe-integer/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/min-safe-integer/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/min-safe-integer/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/min-safe-integer/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/min-safe-integer/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/min-safe-integer/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/to-integer.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/to-integer.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/to-integer.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/to-integer.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/to-pos-integer.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/to-pos-integer.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/to-pos-integer.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/to-pos-integer.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/to-uint32.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/to-uint32.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/number/to-uint32.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/number/to-uint32.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/_iterate.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/_iterate.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/_iterate.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/_iterate.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/assign/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/assign/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/assign/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/assign/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/assign/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/assign/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/assign/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/assign/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/assign/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/assign/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/assign/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/assign/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/assign/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/assign/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/assign/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/assign/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/clear.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/clear.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/clear.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/clear.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/compact.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/compact.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/compact.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/compact.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/compare.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/compare.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/compare.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/compare.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/copy-deep.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/copy-deep.js new file mode 100644 index 00000000000000..79e02be49e3c11 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/copy-deep.js @@ -0,0 +1,28 @@ +'use strict'; + +var stringify = JSON.stringify; + +module.exports = function (t, a) { + var o = { 1: 'raz', 2: 'dwa', 3: 'trzy' } + , no = t(o); + + a.not(no, o, "Return different object"); + a(stringify(no), stringify(o), "Match properties and values"); + + o = { foo: 'bar', raz: { dwa: 'dwa', + trzy: { cztery: 'pięć', 'sześć': 'siedem' }, osiem: {}, + 'dziewięć': function () { } }, + 'dziesięć': 10, "jedenaście": ['raz', ['dwa', 'trzy', { elo: "true" }]] }; + o.raz.rec = o; + + no = t(o); + a.not(o.raz, no.raz, "Deep"); + a.not(o.raz.trzy, no.raz.trzy, "Deep #2"); + a(stringify(o.raz.trzy), stringify(no.raz.trzy), "Deep content"); + a(no.raz.rec, no, "Recursive"); + a.not(o.raz.osiem, no.raz.osiem, "Empty object"); + a(o.raz['dziewięć'], no.raz['dziewięć'], "Function"); + a.not(o['jedenaście'], no['jedenaście']); + a.not(o['jedenaście'][1], no['jedenaście'][1]); + a.not(o['jedenaście'][1][2], no['jedenaście'][1][2]); +}; diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/copy.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/copy.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/copy.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/copy.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/count.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/count.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/count.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/count.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/create.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/create.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/create.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/create.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/ensure-natural-number-value.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/ensure-natural-number-value.js new file mode 100644 index 00000000000000..dde23986babe18 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/ensure-natural-number-value.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function (t, a) { + a.throws(function () { t(undefined); }, TypeError, "Undefined"); + a.throws(function () { t(null); }, TypeError, "Null"); + a(t(2), 2, "Number"); + a.throws(function () { t(-2); }, TypeError, "Negative"); + a.throws(function () { t(2.34); }, TypeError, "Float"); + a(t('23'), 23, "Numeric string"); + a.throws(function () { t(NaN); }, TypeError, "NaN"); + a.throws(function () { t(Infinity); }, TypeError, "Infinity"); +}; diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/ensure-natural-number.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/ensure-natural-number.js new file mode 100644 index 00000000000000..5ebed1e524fcef --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/ensure-natural-number.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function (t, a) { + a.throws(function () { t(undefined); }, TypeError, "Undefined"); + a(t(null), 0, "Null"); + a(t(2), 2, "Number"); + a.throws(function () { t(-2); }, TypeError, "Negative"); + a.throws(function () { t(2.34); }, TypeError, "Float"); + a(t('23'), 23, "Numeric string"); + a.throws(function () { t(NaN); }, TypeError, "NaN"); + a.throws(function () { t(Infinity); }, TypeError, "Infinity"); +}; diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/eq.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/eq.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/eq.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/eq.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/every.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/every.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/every.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/every.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/filter.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/filter.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/filter.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/filter.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/find-key.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/find-key.js new file mode 100644 index 00000000000000..cca834d9362a29 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/find-key.js @@ -0,0 +1,23 @@ +'use strict'; + +var o = { 1: 1, 2: 2, 3: 3 }; + +module.exports = function (t, a) { + var o2 = {}, i = 0; + t(o, function (value, name) { + o2[name] = value; + return false; + }); + a(JSON.stringify(o2), JSON.stringify(o), "Iterates"); + + a(t(o, function () { + ++i; + return true; + }), '1', "Finds"); + a(i, 1, "Stops iteration after condition is met"); + + a(t(o, function () { + return false; + }), undefined, "Fails"); + +}; diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/find.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/find.js new file mode 100644 index 00000000000000..b6ad60a542b741 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/find.js @@ -0,0 +1,23 @@ +'use strict'; + +var o = { 1: 1, 2: 2, 3: 3 }; + +module.exports = function (t, a) { + var o2 = {}, i = 0; + t(o, function (value, name) { + o2[name] = value; + return false; + }); + a(JSON.stringify(o2), JSON.stringify(o), "Iterates"); + + a(t(o, function () { + ++i; + return true; + }), 1, "Finds"); + a(i, 1, "Stops iteration after condition is met"); + + a(t(o, function () { + return false; + }), undefined, "Fails"); + +}; diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/first-key.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/first-key.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/first-key.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/first-key.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/flatten.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/flatten.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/flatten.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/flatten.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/for-each.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/for-each.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/for-each.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/for-each.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/get-property-names.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/get-property-names.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/get-property-names.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/get-property-names.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/is-array-like.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-array-like.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/is-array-like.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-array-like.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/is-callable.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-callable.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/is-callable.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-callable.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/is-copy-deep.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-copy-deep.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/is-copy-deep.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-copy-deep.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/is-copy.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-copy.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/is-copy.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-copy.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/is-empty.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-empty.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/is-empty.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-empty.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-number-value.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-number-value.js new file mode 100644 index 00000000000000..21b6b620323b63 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-number-value.js @@ -0,0 +1,15 @@ +'use strict'; + +module.exports = function (t, a) { + a(t(undefined), false, "Undefined"); + a(t(null), false, "Null"); + a(t(0), true, "Zero"); + a(t(NaN), false, "NaN"); + a(t(Infinity), true, "Infinity"); + a(t(12), true, "Number"); + a(t(false), true, "Boolean"); + a(t(new Date()), true, "Date"); + a(t(new Number(2)), true, "Number object"); + a(t('asdfaf'), false, "String"); + a(t(''), true, "Empty String"); +}; diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/is-object.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-object.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/is-object.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-object.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/is-plain-object.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-plain-object.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/is-plain-object.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is-plain-object.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/is.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/is.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/is.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/key-of.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/key-of.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/key-of.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/key-of.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/keys/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/keys/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/keys/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/keys/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/keys/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/keys/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/keys/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/keys/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/keys/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/keys/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/keys/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/keys/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/keys/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/keys/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/keys/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/keys/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/map-keys.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/map-keys.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/map-keys.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/map-keys.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/map.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/map.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/map.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/map.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/mixin-prototypes.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/mixin-prototypes.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/mixin-prototypes.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/mixin-prototypes.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/mixin.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/mixin.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/mixin.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/mixin.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/normalize-options.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/normalize-options.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/normalize-options.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/normalize-options.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/primitive-set.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/primitive-set.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/primitive-set.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/primitive-set.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/safe-traverse.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/safe-traverse.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/safe-traverse.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/safe-traverse.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/serialize.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/serialize.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/serialize.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/serialize.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/set-prototype-of/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/set-prototype-of/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/set-prototype-of/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/set-prototype-of/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/set-prototype-of/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/set-prototype-of/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/set-prototype-of/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/set-prototype-of/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/set-prototype-of/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/set-prototype-of/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/set-prototype-of/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/set-prototype-of/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/set-prototype-of/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/set-prototype-of/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/set-prototype-of/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/set-prototype-of/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/some.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/some.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/some.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/some.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/to-array.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/to-array.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/to-array.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/to-array.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/unserialize.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/unserialize.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/unserialize.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/unserialize.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/valid-callable.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/valid-callable.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/valid-callable.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/valid-callable.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/valid-object.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/valid-object.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/valid-object.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/valid-object.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/valid-value.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/valid-value.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/valid-value.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/valid-value.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/validate-array-like-object.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/validate-array-like-object.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/validate-array-like-object.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/validate-array-like-object.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/validate-array-like.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/validate-array-like.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/validate-array-like.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/validate-array-like.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/validate-stringifiable-value.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/validate-stringifiable-value.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/validate-stringifiable-value.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/validate-stringifiable-value.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/validate-stringifiable.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/validate-stringifiable.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/validate-stringifiable.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/object/validate-stringifiable.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/is-sticky.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/is-sticky.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/is-sticky.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/is-sticky.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/is-unicode.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/is-unicode.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/is-unicode.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/is-unicode.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/match/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/match/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/match/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/match/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/match/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/match/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/match/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/match/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/match/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/match/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/match/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/match/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/match/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/match/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/match/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/match/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/replace/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/replace/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/replace/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/replace/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/replace/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/replace/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/replace/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/replace/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/replace/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/replace/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/replace/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/replace/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/replace/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/replace/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/replace/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/replace/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/search/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/search/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/search/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/search/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/search/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/search/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/search/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/search/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/search/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/search/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/search/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/search/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/search/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/search/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/search/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/search/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/split/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/split/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/split/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/split/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/split/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/split/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/split/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/split/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/split/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/split/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/split/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/split/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/split/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/split/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/split/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/split/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/sticky/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/sticky/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/sticky/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/sticky/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/sticky/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/sticky/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/sticky/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/sticky/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/unicode/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/unicode/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/unicode/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/unicode/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/unicode/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/unicode/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/#/unicode/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/#/unicode/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/escape.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/escape.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/escape.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/escape.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/is-reg-exp.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/is-reg-exp.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/is-reg-exp.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/is-reg-exp.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/valid-reg-exp.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/valid-reg-exp.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/reg-exp/valid-reg-exp.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/reg-exp/valid-reg-exp.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/@@iterator/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/@@iterator/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/@@iterator/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/@@iterator/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/@@iterator/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/@@iterator/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/@@iterator/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/@@iterator/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/@@iterator/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/@@iterator/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/@@iterator/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/@@iterator/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/@@iterator/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/@@iterator/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/@@iterator/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/@@iterator/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/at.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/at.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/at.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/at.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/camel-to-hyphen.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/camel-to-hyphen.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/camel-to-hyphen.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/camel-to-hyphen.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/capitalize.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/capitalize.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/capitalize.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/capitalize.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/case-insensitive-compare.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/case-insensitive-compare.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/case-insensitive-compare.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/case-insensitive-compare.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/code-point-at/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/code-point-at/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/code-point-at/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/code-point-at/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/code-point-at/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/code-point-at/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/code-point-at/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/code-point-at/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/code-point-at/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/code-point-at/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/code-point-at/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/code-point-at/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/code-point-at/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/code-point-at/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/code-point-at/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/code-point-at/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/contains/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/contains/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/contains/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/contains/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/contains/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/contains/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/contains/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/contains/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/contains/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/contains/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/contains/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/contains/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/contains/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/contains/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/contains/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/contains/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/ends-with/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/ends-with/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/ends-with/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/ends-with/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/ends-with/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/ends-with/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/ends-with/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/ends-with/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/ends-with/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/ends-with/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/ends-with/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/ends-with/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/ends-with/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/ends-with/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/ends-with/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/ends-with/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/hyphen-to-camel.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/hyphen-to-camel.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/hyphen-to-camel.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/hyphen-to-camel.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/indent.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/indent.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/indent.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/indent.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/last.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/last.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/last.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/last.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/normalize/_data.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/normalize/_data.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/normalize/_data.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/normalize/_data.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/normalize/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/normalize/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/normalize/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/normalize/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/normalize/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/normalize/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/normalize/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/normalize/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/normalize/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/normalize/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/normalize/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/normalize/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/normalize/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/normalize/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/normalize/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/normalize/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/pad.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/pad.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/pad.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/pad.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/plain-replace-all.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/plain-replace-all.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/plain-replace-all.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/plain-replace-all.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/plain-replace.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/plain-replace.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/plain-replace.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/plain-replace.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/repeat/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/repeat/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/repeat/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/repeat/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/repeat/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/repeat/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/repeat/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/repeat/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/repeat/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/repeat/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/repeat/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/repeat/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/repeat/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/repeat/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/repeat/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/repeat/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/starts-with/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/starts-with/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/starts-with/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/starts-with/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/starts-with/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/starts-with/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/starts-with/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/starts-with/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/starts-with/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/starts-with/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/starts-with/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/starts-with/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/starts-with/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/starts-with/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/#/starts-with/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/starts-with/shim.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/uncapitalize.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/uncapitalize.js new file mode 100644 index 00000000000000..50f35f1fe40a91 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/uncapitalize.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function (t, a) { + a(t.call('raz'), 'raz', "Word"); + a(t.call('BLA'), 'bLA', "Uppercase"); + a(t.call(''), '', "Empty"); + a(t.call('a'), 'a', "One letter"); + a(t.call('this is a test'), 'this is a test', "Sentence"); + a(t.call('This is a test'), 'this is a test', "Capitalized sentence"); +}; diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/format-method.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/format-method.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/format-method.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/format-method.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/from-code-point/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/from-code-point/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/from-code-point/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/from-code-point/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/from-code-point/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/from-code-point/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/from-code-point/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/from-code-point/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/from-code-point/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/from-code-point/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/from-code-point/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/from-code-point/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/from-code-point/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/from-code-point/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/from-code-point/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/from-code-point/shim.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/is-string.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/is-string.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/is-string.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/is-string.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/random-uniq.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/random-uniq.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/random-uniq.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/random-uniq.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/raw/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/raw/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/raw/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/raw/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/raw/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/raw/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/raw/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/raw/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/raw/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/raw/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/raw/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/raw/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/raw/shim.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/raw/shim.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/string/raw/shim.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/raw/shim.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/package.json new file mode 100644 index 00000000000000..f98280ca28c400 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/package.json @@ -0,0 +1,95 @@ +{ + "_args": [ + [ + "es6-symbol@^3.0.2", + "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index" + ] + ], + "_from": "es6-symbol@>=3.0.2 <4.0.0", + "_id": "es6-symbol@3.0.2", + "_inCache": true, + "_installable": true, + "_location": "/node-gyp/path-array/array-index/es6-symbol", + "_nodeVersion": "5.2.0", + "_npmUser": { + "email": "medikoo+npm@medikoo.com", + "name": "medikoo" + }, + "_npmVersion": "3.3.12", + "_phantomChildren": { + "es6-symbol": "3.0.2" + }, + "_requested": { + "name": "es6-symbol", + "raw": "es6-symbol@^3.0.2", + "rawSpec": "^3.0.2", + "scope": null, + "spec": ">=3.0.2 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/path-array/array-index", + "/node-gyp/path-array/array-index/es6-symbol/es5-ext", + "/node-gyp/path-array/array-index/es6-symbol/es5-ext/es6-iterator" + ], + "_resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.0.2.tgz", + "_shasum": "1e928878c6f5e63541625b4bb4df4af07d154219", + "_shrinkwrap": null, + "_spec": "es6-symbol@^3.0.2", + "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index", + "author": { + "email": "medyk@medikoo.com", + "name": "Mariusz Nowak", + "url": "http://www.medikoo.com/" + }, + "bugs": { + "url": "https://github.com/medikoo/es6-symbol/issues" + }, + "dependencies": { + "d": "~0.1.1", + "es5-ext": "~0.10.10" + }, + "description": "ECMAScript 6 Symbol polyfill", + "devDependencies": { + "tad": "~0.2.4", + "xlint": "~0.2.2", + "xlint-jslint-medikoo": "~0.1.4" + }, + "directories": {}, + "dist": { + "shasum": "1e928878c6f5e63541625b4bb4df4af07d154219", + "tarball": "http://registry.npmjs.org/es6-symbol/-/es6-symbol-3.0.2.tgz" + }, + "gitHead": "b7da6b926c44e3745de69b17c98c00a5c84b4ebe", + "homepage": "https://github.com/medikoo/es6-symbol#readme", + "keywords": [ + "ecmascript", + "es6", + "harmony", + "polyfill", + "ponyfill", + "private", + "property", + "symbol" + ], + "license": "MIT", + "maintainers": [ + { + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" + } + ], + "name": "es6-symbol", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/medikoo/es6-symbol.git" + }, + "scripts": { + "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream", + "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", + "test": "node ./node_modules/tad/bin/tad" + }, + "version": "3.0.2" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/polyfill.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/polyfill.js new file mode 100644 index 00000000000000..7c3c8fe90025ca --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/polyfill.js @@ -0,0 +1,107 @@ +// ES2015 Symbol polyfill for environments that do not support it (or partially support it_ + +'use strict'; + +var d = require('d') + , validateSymbol = require('./validate-symbol') + + , create = Object.create, defineProperties = Object.defineProperties + , defineProperty = Object.defineProperty, objPrototype = Object.prototype + , NativeSymbol, SymbolPolyfill, HiddenSymbol, globalSymbols = create(null); + +if (typeof Symbol === 'function') NativeSymbol = Symbol; + +var generateName = (function () { + var created = create(null); + return function (desc) { + var postfix = 0, name, ie11BugWorkaround; + while (created[desc + (postfix || '')]) ++postfix; + desc += (postfix || ''); + created[desc] = true; + name = '@@' + desc; + defineProperty(objPrototype, name, d.gs(null, function (value) { + // For IE11 issue see: + // https://connect.microsoft.com/IE/feedbackdetail/view/1928508/ + // ie11-broken-getters-on-dom-objects + // https://github.com/medikoo/es6-symbol/issues/12 + if (ie11BugWorkaround) return; + ie11BugWorkaround = true; + defineProperty(this, name, d(value)); + ie11BugWorkaround = false; + })); + return name; + }; +}()); + +// Internal constructor (not one exposed) for creating Symbol instances. +// This one is used to ensure that `someSymbol instanceof Symbol` always return false +HiddenSymbol = function Symbol(description) { + if (this instanceof HiddenSymbol) throw new TypeError('TypeError: Symbol is not a constructor'); + return SymbolPolyfill(description); +}; + +// Exposed `Symbol` constructor +// (returns instances of HiddenSymbol) +module.exports = SymbolPolyfill = function Symbol(description) { + var symbol; + if (this instanceof Symbol) throw new TypeError('TypeError: Symbol is not a constructor'); + symbol = create(HiddenSymbol.prototype); + description = (description === undefined ? '' : String(description)); + return defineProperties(symbol, { + __description__: d('', description), + __name__: d('', generateName(description)) + }); +}; +defineProperties(SymbolPolyfill, { + for: d(function (key) { + if (globalSymbols[key]) return globalSymbols[key]; + return (globalSymbols[key] = SymbolPolyfill(String(key))); + }), + keyFor: d(function (s) { + var key; + validateSymbol(s); + for (key in globalSymbols) if (globalSymbols[key] === s) return key; + }), + + // If there's native implementation of given symbol, let's fallback to it + // to ensure proper interoperability with other native functions e.g. Array.from + hasInstance: d('', (NativeSymbol && NativeSymbol.hasInstance) || SymbolPolyfill('hasInstance')), + isConcatSpreadable: d('', (NativeSymbol && NativeSymbol.isConcatSpreadable) || + SymbolPolyfill('isConcatSpreadable')), + iterator: d('', (NativeSymbol && NativeSymbol.iterator) || SymbolPolyfill('iterator')), + match: d('', (NativeSymbol && NativeSymbol.match) || SymbolPolyfill('match')), + replace: d('', (NativeSymbol && NativeSymbol.replace) || SymbolPolyfill('replace')), + search: d('', (NativeSymbol && NativeSymbol.search) || SymbolPolyfill('search')), + species: d('', (NativeSymbol && NativeSymbol.species) || SymbolPolyfill('species')), + split: d('', (NativeSymbol && NativeSymbol.split) || SymbolPolyfill('split')), + toPrimitive: d('', (NativeSymbol && NativeSymbol.toPrimitive) || SymbolPolyfill('toPrimitive')), + toStringTag: d('', (NativeSymbol && NativeSymbol.toStringTag) || SymbolPolyfill('toStringTag')), + unscopables: d('', (NativeSymbol && NativeSymbol.unscopables) || SymbolPolyfill('unscopables')) +}); + +// Internal tweaks for real symbol producer +defineProperties(HiddenSymbol.prototype, { + constructor: d(SymbolPolyfill), + toString: d('', function () { return this.__name__; }) +}); + +// Proper implementation of methods exposed on Symbol.prototype +// They won't be accessible on produced symbol instances as they derive from HiddenSymbol.prototype +defineProperties(SymbolPolyfill.prototype, { + toString: d(function () { return 'Symbol (' + validateSymbol(this).__description__ + ')'; }), + valueOf: d(function () { return validateSymbol(this); }) +}); +defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toPrimitive, d('', + function () { return validateSymbol(this); })); +defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d('c', 'Symbol')); + +// Proper implementaton of toPrimitive and toStringTag for returned symbol instances +defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toStringTag, + d('c', SymbolPolyfill.prototype[SymbolPolyfill.toStringTag])); + +// Note: It's important to define `toPrimitive` as last one, as some implementations +// implement `toPrimitive` natively without implementing `toStringTag` (or other specified symbols) +// And that may invoke error in definition flow: +// See: https://github.com/medikoo/es6-symbol/issues/13#issuecomment-164146149 +defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toPrimitive, + d('c', SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive])); diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/test/implement.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/implement.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/test/implement.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/implement.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/test/index.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/test/index.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/test/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/is-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/test/is-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/is-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/test/is-native-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/is-native-implemented.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/test/is-native-implemented.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/is-native-implemented.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/test/is-symbol.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/is-symbol.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/test/is-symbol.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/is-symbol.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/test/polyfill.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/polyfill.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/test/polyfill.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/polyfill.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/test/validate-symbol.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/validate-symbol.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/test/validate-symbol.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/validate-symbol.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/validate-symbol.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/validate-symbol.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/validate-symbol.js rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/validate-symbol.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/package.json index 6ba9df72c29bc3..dd33e385601890 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/package.json @@ -1,58 +1,86 @@ { - "name": "array-index", - "description": "Invoke getter/setter functions on array-like objects", - "keywords": [ - "index", - "array", - "getter", - "setter", - "proxy" + "_args": [ + [ + "array-index@^1.0.0", + "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array" + ] ], - "version": "0.1.1", + "_from": "array-index@>=1.0.0 <2.0.0", + "_id": "array-index@1.0.0", + "_inCache": true, + "_installable": true, + "_location": "/node-gyp/path-array/array-index", + "_nodeVersion": "5.3.0", + "_npmUser": { + "email": "nathan@tootallnate.net", + "name": "tootallnate" + }, + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "name": "array-index", + "raw": "array-index@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/path-array" + ], + "_resolved": "https://registry.npmjs.org/array-index/-/array-index-1.0.0.tgz", + "_shasum": "ec56a749ee103e4e08c790b9c353df16055b97f9", + "_shrinkwrap": null, + "_spec": "array-index@^1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array", "author": { - "name": "Nathan Rajlich", "email": "nathan@tootallnate.net", + "name": "Nathan Rajlich", "url": "http://tootallnate.net" }, - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/array-index.git" - }, - "main": "index.js", - "scripts": { - "test": "node test" + "bugs": { + "url": "https://github.com/TooTallNate/array-index/issues" }, "dependencies": { - "debug": "*" + "debug": "^2.2.0", + "es6-symbol": "^3.0.2" + }, + "description": "Invoke getter/setter functions on array-like objects", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "ec56a749ee103e4e08c790b9c353df16055b97f9", + "tarball": "http://registry.npmjs.org/array-index/-/array-index-1.0.0.tgz" }, "engines": { "node": "*" }, - "gitHead": "65a5d884f25b4b7a1608e367d715d713dbd3b3d6", - "bugs": { - "url": "https://github.com/TooTallNate/array-index/issues" - }, - "homepage": "https://github.com/TooTallNate/array-index", - "_id": "array-index@0.1.1", - "_shasum": "4d5eaf06cc3d925847cd73d1535c217ba306d3e1", - "_from": "array-index@>=0.1.0 <0.2.0", - "_npmVersion": "2.1.3", - "_nodeVersion": "0.10.32", - "_npmUser": { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - }, + "gitHead": "4b3cc059c70eefd8ef2a0d4213d681b671eb3d11", + "homepage": "https://github.com/TooTallNate/array-index#readme", + "keywords": [ + "array", + "getter", + "index", + "proxy", + "setter" + ], + "license": "MIT", + "main": "index.js", "maintainers": [ { "name": "tootallnate", "email": "nathan@tootallnate.net" } ], - "dist": { - "shasum": "4d5eaf06cc3d925847cd73d1535c217ba306d3e1", - "tarball": "http://registry.npmjs.org/array-index/-/array-index-0.1.1.tgz" + "name": "array-index", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/array-index.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/array-index/-/array-index-0.1.1.tgz", - "readme": "ERROR: No README data found!" + "scripts": { + "test": "node test" + }, + "version": "1.0.0" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/test.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/test.js index d9e9c182813bc8..65ff607f1c4678 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/test.js +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/test.js @@ -1,4 +1,3 @@ - var ArrayIndex = require('./') var inherits = require('util').inherits var assert = require('assert') @@ -19,14 +18,15 @@ inherits(Arrayish, ArrayIndex) // create an instance and run some tests var a = new Arrayish(11) +assert.equal(a.length, 11); assert.throws(function () { a[0] -}, /__get__/) +}, /you must implement the `ArrayIndex.get` Symbol/) assert.throws(function () { a[0] = 0 -}, /__set__/) +}, /you must implement the `ArrayIndex.set` Symbol/) /** @@ -35,7 +35,7 @@ assert.throws(function () { * return the index as-is. */ -Arrayish.prototype.__get__ = function get (index) { +Arrayish.prototype[ArrayIndex.get] = function get (index) { if (index in this.sets) { return +this.sets[index] * index } else { @@ -47,7 +47,7 @@ Arrayish.prototype.__get__ = function get (index) { * Store the last value set for this index. */ -Arrayish.prototype.__set__ = function set (index, value) { +Arrayish.prototype[ArrayIndex.set] = function set (index, value) { this.sets[index] = value } @@ -74,3 +74,37 @@ a[4] = 20 a[6] = 5.55432 var b = [0, 1, 2, 3, 80, 5, 33.325919999999996, 7, 8, 9, 30] assert.equal(JSON.stringify(b), JSON.stringify(a)) + + +/** + * It should work when invoking as a Mixin. + */ + +function Foo () { + ArrayIndex.call(this, 5); +} +var f = new Foo(); + +// these throw because there's no __get__ and __set__ function defined +assert.throws(function () { + f[0]; +}); +assert.throws(function () { + f[0] = 0 +}); + +f[ArrayIndex.get] = function (index) { + return index * 2; +}; + +assert.equal(f[0], 0); +assert.equal(f[1], 2); +assert.equal(f[2], 4); +assert.equal(f[3], 6); + +f[ArrayIndex.set] = function (index, value) { + this['foo' + index] = value; +}; + +f[1] = 'bar'; +assert.equal(f.foo1, 'bar'); diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/package.json index 41d25482b86772..e69958df330685 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/package.json @@ -1,56 +1,82 @@ { - "name": "path-array", - "version": "1.0.0", - "description": "Treat your $PATH like a JavaScript Array", - "main": "index.js", - "scripts": { - "test": "mocha --reporter spec" + "_args": [ + [ + "path-array@^1.0.0", + "/Users/rebecca/code/npm/node_modules/node-gyp" + ] + ], + "_from": "path-array@>=1.0.0 <2.0.0", + "_id": "path-array@1.0.1", + "_inCache": true, + "_installable": true, + "_location": "/node-gyp/path-array", + "_nodeVersion": "5.3.0", + "_npmUser": { + "email": "nathan@tootallnate.net", + "name": "tootallnate" }, - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/node-path-array.git" + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "name": "path-array", + "raw": "path-array@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" }, - "keywords": [ - "PATH", - "env", - "array" + "_requiredBy": [ + "/node-gyp" ], + "_resolved": "https://registry.npmjs.org/path-array/-/path-array-1.0.1.tgz", + "_shasum": "7e2f0f35f07a2015122b868b7eac0eb2c4fec271", + "_shrinkwrap": null, + "_spec": "path-array@^1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/node-gyp", "author": { - "name": "Nathan Rajlich", "email": "nathan@tootallnate.net", + "name": "Nathan Rajlich", "url": "http://n8.io/" }, - "license": "MIT", "bugs": { "url": "https://github.com/TooTallNate/node-path-array/issues" }, - "homepage": "https://github.com/TooTallNate/node-path-array", "dependencies": { - "array-index": "~0.1.0" + "array-index": "^1.0.0" }, + "description": "Treat your $PATH like a JavaScript Array", "devDependencies": { "mocha": "~1.16.1" }, - "gitHead": "5d1fedd54e4413459f67e4a4babb024144cd00d0", - "_id": "path-array@1.0.0", - "_shasum": "6c14130c33084f0150553c657b38397ab67aaa4e", - "_from": "path-array@>=1.0.0 <2.0.0", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "tootallnate", - "email": "nathan@tootallnate.net" + "directories": {}, + "dist": { + "shasum": "7e2f0f35f07a2015122b868b7eac0eb2c4fec271", + "tarball": "http://registry.npmjs.org/path-array/-/path-array-1.0.1.tgz" }, + "gitHead": "d249bd897661ca60720218edabbfeaa73c67778a", + "homepage": "https://github.com/TooTallNate/node-path-array", + "keywords": [ + "PATH", + "array", + "env" + ], + "license": "MIT", + "main": "index.js", "maintainers": [ { "name": "tootallnate", "email": "nathan@tootallnate.net" } ], - "dist": { - "shasum": "6c14130c33084f0150553c657b38397ab67aaa4e", - "tarball": "http://registry.npmjs.org/path-array/-/path-array-1.0.0.tgz" + "name": "path-array", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/node-path-array.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/path-array/-/path-array-1.0.0.tgz", - "readme": "ERROR: No README data found!" + "scripts": { + "test": "mocha --reporter spec" + }, + "version": "1.0.1" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/tar/.npmignore deleted file mode 100644 index c167ad5b1c12f8..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/tar/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -.*.swp -node_modules -examples/extract/ -test/tmp/ -test/fixtures/ diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/tar/.travis.yml deleted file mode 100644 index fca8ef019405d5..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/tar/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.10 - - 0.11 diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/LICENCE b/deps/npm/node_modules/node-gyp/node_modules/tar/LICENCE deleted file mode 100644 index 74489e2e2658e7..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/tar/LICENCE +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) Isaac Z. Schlueter -All rights reserved. - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/README.md b/deps/npm/node_modules/node-gyp/node_modules/tar/README.md deleted file mode 100644 index 424a2782bf7b59..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/tar/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# node-tar - -Tar for Node.js. - -[![NPM](https://nodei.co/npm/tar.png)](https://nodei.co/npm/tar/) - -## API - -See `examples/` for usage examples. - -### var tar = require('tar') - -Returns an object with `.Pack`, `.Extract` and `.Parse` methods. - -### tar.Pack([properties]) - -Returns a through stream. Use -[fstream](https://npmjs.org/package/fstream) to write files into the -pack stream and you will receive tar archive data from the pack -stream. - -This only works with directories, it does not work with individual files. - -The optional `properties` object are used to set properties in the tar -'Global Extended Header'. - -### tar.Extract([options]) - -Returns a through stream. Write tar data to the stream and the files -in the tarball will be extracted onto the filesystem. - -`options` can be: - -```js -{ - path: '/path/to/extract/tar/into', - strip: 0, // how many path segments to strip from the root when extracting -} -``` - -`options` also get passed to the `fstream.Writer` instance that `tar` -uses internally. - -### tar.Parse() - -Returns a writable stream. Write tar data to it and it will emit -`entry` events for each entry parsed from the tarball. This is used by -`tar.Extract`. diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/examples/extracter.js b/deps/npm/node_modules/node-gyp/node_modules/tar/examples/extracter.js deleted file mode 100644 index f6253a72c5cd3e..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/tar/examples/extracter.js +++ /dev/null @@ -1,19 +0,0 @@ -var tar = require("../tar.js") - , fs = require("fs") - - -function onError(err) { - console.error('An error occurred:', err) -} - -function onEnd() { - console.log('Extracted!') -} - -var extractor = tar.Extract({path: __dirname + "/extract"}) - .on('error', onError) - .on('end', onEnd); - -fs.createReadStream(__dirname + "/../test/fixtures/c.tar") - .on('error', onError) - .pipe(extractor); diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/examples/packer.js b/deps/npm/node_modules/node-gyp/node_modules/tar/examples/packer.js deleted file mode 100644 index 039969ce300d12..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/tar/examples/packer.js +++ /dev/null @@ -1,24 +0,0 @@ -var tar = require("../tar.js") - , fstream = require("fstream") - , fs = require("fs") - -var dirDest = fs.createWriteStream('dir.tar') - - -function onError(err) { - console.error('An error occurred:', err) -} - -function onEnd() { - console.log('Packed!') -} - -var packer = tar.Pack({ noProprietary: true }) - .on('error', onError) - .on('end', onEnd); - -// This must be a "directory" -fstream.Reader({ path: __dirname, type: "Directory" }) - .on('error', onError) - .pipe(packer) - .pipe(dirDest) diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/examples/reader.js b/deps/npm/node_modules/node-gyp/node_modules/tar/examples/reader.js deleted file mode 100644 index 39f3f0888a2cfd..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/tar/examples/reader.js +++ /dev/null @@ -1,36 +0,0 @@ -var tar = require("../tar.js") - , fs = require("fs") - -fs.createReadStream(__dirname + "/../test/fixtures/c.tar") - .pipe(tar.Parse()) - .on("extendedHeader", function (e) { - console.error("extended pax header", e.props) - e.on("end", function () { - console.error("extended pax fields:", e.fields) - }) - }) - .on("ignoredEntry", function (e) { - console.error("ignoredEntry?!?", e.props) - }) - .on("longLinkpath", function (e) { - console.error("longLinkpath entry", e.props) - e.on("end", function () { - console.error("value=%j", e.body.toString()) - }) - }) - .on("longPath", function (e) { - console.error("longPath entry", e.props) - e.on("end", function () { - console.error("value=%j", e.body.toString()) - }) - }) - .on("entry", function (e) { - console.error("entry", e.props) - e.on("data", function (c) { - console.error(" >>>" + c.toString().replace(/\n/g, "\\n")) - }) - e.on("end", function () { - console.error(" << 0 - return !this._needDrain -} - -EntryWriter.prototype.end = function (c) { - // console.error(".. ew end") - if (c) this._buffer.push(c) - this._buffer.push(EOF) - this._ended = true - this._process() - this._needDrain = this._buffer.length > 0 -} - -EntryWriter.prototype.pause = function () { - // console.error(".. ew pause") - this._paused = true - this.emit("pause") -} - -EntryWriter.prototype.resume = function () { - // console.error(".. ew resume") - this._paused = false - this.emit("resume") - this._process() -} - -EntryWriter.prototype.add = function (entry) { - // console.error(".. ew add") - if (!this.parent) return this.emit("error", new Error("no parent")) - - // make sure that the _header and such is emitted, and clear out - // the _currentEntry link on the parent. - if (!this._ended) this.end() - - return this.parent.add(entry) -} - -EntryWriter.prototype._header = function () { - // console.error(".. ew header") - if (this._didHeader) return - this._didHeader = true - - var headerBlock = TarHeader.encode(this.props) - - if (this.props.needExtended && !this._meta) { - var me = this - - ExtendedHeaderWriter = ExtendedHeaderWriter || - require("./extended-header-writer.js") - - ExtendedHeaderWriter(this.props) - .on("data", function (c) { - me.emit("data", c) - }) - .on("error", function (er) { - me.emit("error", er) - }) - .end() - } - - // console.error(".. .. ew headerBlock emitting") - this.emit("data", headerBlock) - this.emit("header") -} - -EntryWriter.prototype._process = function () { - // console.error(".. .. ew process") - if (!this._didHeader && !this._meta) { - this._header() - } - - if (this._paused || this._processing) { - // console.error(".. .. .. paused=%j, processing=%j", this._paused, this._processing) - return - } - - this._processing = true - - var buf = this._buffer - for (var i = 0; i < buf.length; i ++) { - // console.error(".. .. .. i=%d", i) - - var c = buf[i] - - if (c === EOF) this._stream.end() - else this._stream.write(c) - - if (this._paused) { - // console.error(".. .. .. paused mid-emission") - this._processing = false - if (i < buf.length) { - this._needDrain = true - this._buffer = buf.slice(i + 1) - } - return - } - } - - // console.error(".. .. .. emitted") - this._buffer.length = 0 - this._processing = false - - // console.error(".. .. .. emitting drain") - this.emit("drain") -} - -EntryWriter.prototype.destroy = function () {} diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/lib/entry.js b/deps/npm/node_modules/node-gyp/node_modules/tar/lib/entry.js deleted file mode 100644 index 4af5c410838af8..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/tar/lib/entry.js +++ /dev/null @@ -1,213 +0,0 @@ -// A passthrough read/write stream that sets its properties -// based on a header, extendedHeader, and globalHeader -// -// Can be either a file system object of some sort, or -// a pax/ustar metadata entry. - -module.exports = Entry - -var TarHeader = require("./header.js") - , tar = require("../tar") - , assert = require("assert").ok - , Stream = require("stream").Stream - , inherits = require("inherits") - , fstream = require("fstream").Abstract - -function Entry (header, extended, global) { - Stream.call(this) - this.readable = true - this.writable = true - - this._needDrain = false - this._paused = false - this._reading = false - this._ending = false - this._ended = false - this._remaining = 0 - this._queue = [] - this._index = 0 - this._queueLen = 0 - - this._read = this._read.bind(this) - - this.props = {} - this._header = header - this._extended = extended || {} - - // globals can change throughout the course of - // a file parse operation. Freeze it at its current state. - this._global = {} - var me = this - Object.keys(global || {}).forEach(function (g) { - me._global[g] = global[g] - }) - - this._setProps() -} - -inherits(Entry, Stream) - -Entry.prototype.write = function (c) { - if (this._ending) this.error("write() after end()", null, true) - if (this._remaining === 0) { - this.error("invalid bytes past eof") - } - - // often we'll get a bunch of \0 at the end of the last write, - // since chunks will always be 512 bytes when reading a tarball. - if (c.length > this._remaining) { - c = c.slice(0, this._remaining) - } - this._remaining -= c.length - - // put it on the stack. - var ql = this._queueLen - this._queue.push(c) - this._queueLen ++ - - this._read() - - // either paused, or buffered - if (this._paused || ql > 0) { - this._needDrain = true - return false - } - - return true -} - -Entry.prototype.end = function (c) { - if (c) this.write(c) - this._ending = true - this._read() -} - -Entry.prototype.pause = function () { - this._paused = true - this.emit("pause") -} - -Entry.prototype.resume = function () { - // console.error(" Tar Entry resume", this.path) - this.emit("resume") - this._paused = false - this._read() - return this._queueLen - this._index > 1 -} - - // This is bound to the instance -Entry.prototype._read = function () { - // console.error(" Tar Entry _read", this.path) - - if (this._paused || this._reading || this._ended) return - - // set this flag so that event handlers don't inadvertently - // get multiple _read() calls running. - this._reading = true - - // have any data to emit? - while (this._index < this._queueLen && !this._paused) { - var chunk = this._queue[this._index ++] - this.emit("data", chunk) - } - - // check if we're drained - if (this._index >= this._queueLen) { - this._queue.length = this._queueLen = this._index = 0 - if (this._needDrain) { - this._needDrain = false - this.emit("drain") - } - if (this._ending) { - this._ended = true - this.emit("end") - } - } - - // if the queue gets too big, then pluck off whatever we can. - // this should be fairly rare. - var mql = this._maxQueueLen - if (this._queueLen > mql && this._index > 0) { - mql = Math.min(this._index, mql) - this._index -= mql - this._queueLen -= mql - this._queue = this._queue.slice(mql) - } - - this._reading = false -} - -Entry.prototype._setProps = function () { - // props = extended->global->header->{} - var header = this._header - , extended = this._extended - , global = this._global - , props = this.props - - // first get the values from the normal header. - var fields = tar.fields - for (var f = 0; fields[f] !== null; f ++) { - var field = fields[f] - , val = header[field] - if (typeof val !== "undefined") props[field] = val - } - - // next, the global header for this file. - // numeric values, etc, will have already been parsed. - ;[global, extended].forEach(function (p) { - Object.keys(p).forEach(function (f) { - if (typeof p[f] !== "undefined") props[f] = p[f] - }) - }) - - // no nulls allowed in path or linkpath - ;["path", "linkpath"].forEach(function (p) { - if (props.hasOwnProperty(p)) { - props[p] = props[p].split("\0")[0] - } - }) - - - // set date fields to be a proper date - ;["mtime", "ctime", "atime"].forEach(function (p) { - if (props.hasOwnProperty(p)) { - props[p] = new Date(props[p] * 1000) - } - }) - - // set the type so that we know what kind of file to create - var type - switch (tar.types[props.type]) { - case "OldFile": - case "ContiguousFile": - type = "File" - break - - case "GNUDumpDir": - type = "Directory" - break - - case undefined: - type = "Unknown" - break - - case "Link": - case "SymbolicLink": - case "CharacterDevice": - case "BlockDevice": - case "Directory": - case "FIFO": - default: - type = tar.types[props.type] - } - - this.type = type - this.path = props.path - this.size = props.size - - // size is special, since it signals when the file needs to end. - this._remaining = props.size -} - -Entry.prototype.warn = fstream.warn -Entry.prototype.error = fstream.error diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/lib/extended-header-writer.js b/deps/npm/node_modules/node-gyp/node_modules/tar/lib/extended-header-writer.js deleted file mode 100644 index 1728c4583ae060..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/tar/lib/extended-header-writer.js +++ /dev/null @@ -1,191 +0,0 @@ - -module.exports = ExtendedHeaderWriter - -var inherits = require("inherits") - , EntryWriter = require("./entry-writer.js") - -inherits(ExtendedHeaderWriter, EntryWriter) - -var tar = require("../tar.js") - , path = require("path") - , TarHeader = require("./header.js") - -// props is the props of the thing we need to write an -// extended header for. -// Don't be shy with it. Just encode everything. -function ExtendedHeaderWriter (props) { - // console.error(">> ehw ctor") - var me = this - - if (!(me instanceof ExtendedHeaderWriter)) { - return new ExtendedHeaderWriter(props) - } - - me.fields = props - - var p = - { path : ("PaxHeader" + path.join("/", props.path || "")) - .replace(/\\/g, "/").substr(0, 100) - , mode : props.mode || 0666 - , uid : props.uid || 0 - , gid : props.gid || 0 - , size : 0 // will be set later - , mtime : props.mtime || Date.now() / 1000 - , type : "x" - , linkpath : "" - , ustar : "ustar\0" - , ustarver : "00" - , uname : props.uname || "" - , gname : props.gname || "" - , devmaj : props.devmaj || 0 - , devmin : props.devmin || 0 - } - - - EntryWriter.call(me, p) - // console.error(">> ehw props", me.props) - me.props = p - - me._meta = true -} - -ExtendedHeaderWriter.prototype.end = function () { - // console.error(">> ehw end") - var me = this - - if (me._ended) return - me._ended = true - - me._encodeFields() - - if (me.props.size === 0) { - // nothing to write! - me._ready = true - me._stream.end() - return - } - - me._stream.write(TarHeader.encode(me.props)) - me.body.forEach(function (l) { - me._stream.write(l) - }) - me._ready = true - - // console.error(">> ehw _process calling end()", me.props) - this._stream.end() -} - -ExtendedHeaderWriter.prototype._encodeFields = function () { - // console.error(">> ehw _encodeFields") - this.body = [] - if (this.fields.prefix) { - this.fields.path = this.fields.prefix + "/" + this.fields.path - this.fields.prefix = "" - } - encodeFields(this.fields, "", this.body, this.fields.noProprietary) - var me = this - this.body.forEach(function (l) { - me.props.size += l.length - }) -} - -function encodeFields (fields, prefix, body, nop) { - // console.error(">> >> ehw encodeFields") - // "%d %s=%s\n", , , - // The length is a decimal number, and includes itself and the \n - // Numeric values are decimal strings. - - Object.keys(fields).forEach(function (k) { - var val = fields[k] - , numeric = tar.numeric[k] - - if (prefix) k = prefix + "." + k - - // already including NODETAR.type, don't need File=true also - if (k === fields.type && val === true) return - - switch (k) { - // don't include anything that's always handled just fine - // in the normal header, or only meaningful in the context - // of nodetar - case "mode": - case "cksum": - case "ustar": - case "ustarver": - case "prefix": - case "basename": - case "dirname": - case "needExtended": - case "block": - case "filter": - return - - case "rdev": - if (val === 0) return - break - - case "nlink": - case "dev": // Truly a hero among men, Creator of Star! - case "ino": // Speak his name with reverent awe! It is: - k = "SCHILY." + k - break - - default: break - } - - if (val && typeof val === "object" && - !Buffer.isBuffer(val)) encodeFields(val, k, body, nop) - else if (val === null || val === undefined) return - else body.push.apply(body, encodeField(k, val, nop)) - }) - - return body -} - -function encodeField (k, v, nop) { - // lowercase keys must be valid, otherwise prefix with - // "NODETAR." - if (k.charAt(0) === k.charAt(0).toLowerCase()) { - var m = k.split(".")[0] - if (!tar.knownExtended[m]) k = "NODETAR." + k - } - - // no proprietary - if (nop && k.charAt(0) !== k.charAt(0).toLowerCase()) { - return [] - } - - if (typeof val === "number") val = val.toString(10) - - var s = new Buffer(" " + k + "=" + v + "\n") - , digits = Math.floor(Math.log(s.length) / Math.log(10)) + 1 - - // console.error("1 s=%j digits=%j s.length=%d", s.toString(), digits, s.length) - - // if adding that many digits will make it go over that length, - // then add one to it. For example, if the string is: - // " foo=bar\n" - // then that's 9 characters. With the "9", that bumps the length - // up to 10. However, this is invalid: - // "10 foo=bar\n" - // but, since that's actually 11 characters, since 10 adds another - // character to the length, and the length includes the number - // itself. In that case, just bump it up again. - if (s.length + digits >= Math.pow(10, digits)) digits += 1 - // console.error("2 s=%j digits=%j s.length=%d", s.toString(), digits, s.length) - - var len = digits + s.length - // console.error("3 s=%j digits=%j s.length=%d len=%d", s.toString(), digits, s.length, len) - var lenBuf = new Buffer("" + len) - if (lenBuf.length + s.length !== len) { - throw new Error("Bad length calculation\n"+ - "len="+len+"\n"+ - "lenBuf="+JSON.stringify(lenBuf.toString())+"\n"+ - "lenBuf.length="+lenBuf.length+"\n"+ - "digits="+digits+"\n"+ - "s="+JSON.stringify(s.toString())+"\n"+ - "s.length="+s.length) - } - - return [lenBuf, s] -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/lib/extended-header.js b/deps/npm/node_modules/node-gyp/node_modules/tar/lib/extended-header.js deleted file mode 100644 index 74f432ceee5b24..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/tar/lib/extended-header.js +++ /dev/null @@ -1,140 +0,0 @@ -// An Entry consisting of: -// -// "%d %s=%s\n", , , -// -// The length is a decimal number, and includes itself and the \n -// \0 does not terminate anything. Only the length terminates the string. -// Numeric values are decimal strings. - -module.exports = ExtendedHeader - -var Entry = require("./entry.js") - , inherits = require("inherits") - , tar = require("../tar.js") - , numeric = tar.numeric - , keyTrans = { "SCHILY.dev": "dev" - , "SCHILY.ino": "ino" - , "SCHILY.nlink": "nlink" } - -function ExtendedHeader () { - Entry.apply(this, arguments) - this.on("data", this._parse) - this.fields = {} - this._position = 0 - this._fieldPos = 0 - this._state = SIZE - this._sizeBuf = [] - this._keyBuf = [] - this._valBuf = [] - this._size = -1 - this._key = "" -} - -inherits(ExtendedHeader, Entry) -ExtendedHeader.prototype._parse = parse - -var s = 0 - , states = ExtendedHeader.states = {} - , SIZE = states.SIZE = s++ - , KEY = states.KEY = s++ - , VAL = states.VAL = s++ - , ERR = states.ERR = s++ - -Object.keys(states).forEach(function (s) { - states[states[s]] = states[s] -}) - -states[s] = null - -// char code values for comparison -var _0 = "0".charCodeAt(0) - , _9 = "9".charCodeAt(0) - , point = ".".charCodeAt(0) - , a = "a".charCodeAt(0) - , Z = "Z".charCodeAt(0) - , a = "a".charCodeAt(0) - , z = "z".charCodeAt(0) - , space = " ".charCodeAt(0) - , eq = "=".charCodeAt(0) - , cr = "\n".charCodeAt(0) - -function parse (c) { - if (this._state === ERR) return - - for ( var i = 0, l = c.length - ; i < l - ; this._position++, this._fieldPos++, i++) { - // console.error("top of loop, size="+this._size) - - var b = c[i] - - if (this._size >= 0 && this._fieldPos > this._size) { - error(this, "field exceeds length="+this._size) - return - } - - switch (this._state) { - case ERR: return - - case SIZE: - // console.error("parsing size, b=%d, rest=%j", b, c.slice(i).toString()) - if (b === space) { - this._state = KEY - // this._fieldPos = this._sizeBuf.length - this._size = parseInt(new Buffer(this._sizeBuf).toString(), 10) - this._sizeBuf.length = 0 - continue - } - if (b < _0 || b > _9) { - error(this, "expected [" + _0 + ".." + _9 + "], got " + b) - return - } - this._sizeBuf.push(b) - continue - - case KEY: - // can be any char except =, not > size. - if (b === eq) { - this._state = VAL - this._key = new Buffer(this._keyBuf).toString() - if (keyTrans[this._key]) this._key = keyTrans[this._key] - this._keyBuf.length = 0 - continue - } - this._keyBuf.push(b) - continue - - case VAL: - // field must end with cr - if (this._fieldPos === this._size - 1) { - // console.error("finished with "+this._key) - if (b !== cr) { - error(this, "expected \\n at end of field") - return - } - var val = new Buffer(this._valBuf).toString() - if (numeric[this._key]) { - val = parseFloat(val) - } - this.fields[this._key] = val - - this._valBuf.length = 0 - this._state = SIZE - this._size = -1 - this._fieldPos = -1 - continue - } - this._valBuf.push(b) - continue - } - } -} - -function error (me, msg) { - msg = "invalid header: " + msg - + "\nposition=" + me._position - + "\nfield position=" + me._fieldPos - - me.error(msg) - me.state = ERR -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/lib/extract.js b/deps/npm/node_modules/node-gyp/node_modules/tar/lib/extract.js deleted file mode 100644 index 9fb1e6fb1b502c..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/tar/lib/extract.js +++ /dev/null @@ -1,86 +0,0 @@ -// give it a tarball and a path, and it'll dump the contents - -module.exports = Extract - -var tar = require("../tar.js") - , fstream = require("fstream") - , inherits = require("inherits") - , path = require("path") - -function Extract (opts) { - if (!(this instanceof Extract)) return new Extract(opts) - tar.Parse.apply(this) - - // have to dump into a directory - opts.type = "Directory" - opts.Directory = true - - if (typeof opts !== "object") { - opts = { path: opts } - } - - // better to drop in cwd? seems more standard. - opts.path = opts.path || path.resolve("node-tar-extract") - opts.type = "Directory" - opts.Directory = true - - // similar to --strip or --strip-components - opts.strip = +opts.strip - if (!opts.strip || opts.strip <= 0) opts.strip = 0 - - this._fst = fstream.Writer(opts) - - this.pause() - var me = this - - // Hardlinks in tarballs are relative to the root - // of the tarball. So, they need to be resolved against - // the target directory in order to be created properly. - me.on("entry", function (entry) { - // if there's a "strip" argument, then strip off that many - // path components. - if (opts.strip) { - var p = entry.path.split("/").slice(opts.strip).join("/") - entry.path = entry.props.path = p - if (entry.linkpath) { - var lp = entry.linkpath.split("/").slice(opts.strip).join("/") - entry.linkpath = entry.props.linkpath = lp - } - } - if (entry.type !== "Link") return - entry.linkpath = entry.props.linkpath = - path.join(opts.path, path.join("/", entry.props.linkpath)) - }) - - this._fst.on("ready", function () { - me.pipe(me._fst, { end: false }) - me.resume() - }) - - this._fst.on('error', function(err) { - me.emit('error', err) - }) - - this._fst.on('drain', function() { - me.emit('drain') - }) - - // this._fst.on("end", function () { - // console.error("\nEEEE Extract End", me._fst.path) - // }) - - this._fst.on("close", function () { - // console.error("\nEEEE Extract End", me._fst.path) - me.emit("end") - me.emit("close") - }) -} - -inherits(Extract, tar.Parse) - -Extract.prototype._streamEnd = function () { - var me = this - if (!me._ended) me.error("unexpected eof") - me._fst.end() - // my .end() is coming later. -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/lib/global-header-writer.js b/deps/npm/node_modules/node-gyp/node_modules/tar/lib/global-header-writer.js deleted file mode 100644 index 0bfc7b80aa7c67..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/tar/lib/global-header-writer.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = GlobalHeaderWriter - -var ExtendedHeaderWriter = require("./extended-header-writer.js") - , inherits = require("inherits") - -inherits(GlobalHeaderWriter, ExtendedHeaderWriter) - -function GlobalHeaderWriter (props) { - if (!(this instanceof GlobalHeaderWriter)) { - return new GlobalHeaderWriter(props) - } - ExtendedHeaderWriter.call(this, props) - this.props.type = "g" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/lib/header.js b/deps/npm/node_modules/node-gyp/node_modules/tar/lib/header.js deleted file mode 100644 index 05b237c0c7b32a..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/tar/lib/header.js +++ /dev/null @@ -1,385 +0,0 @@ -// parse a 512-byte header block to a data object, or vice-versa -// If the data won't fit nicely in a simple header, then generate -// the appropriate extended header file, and return that. - -module.exports = TarHeader - -var tar = require("../tar.js") - , fields = tar.fields - , fieldOffs = tar.fieldOffs - , fieldEnds = tar.fieldEnds - , fieldSize = tar.fieldSize - , numeric = tar.numeric - , assert = require("assert").ok - , space = " ".charCodeAt(0) - , slash = "/".charCodeAt(0) - , bslash = process.platform === "win32" ? "\\".charCodeAt(0) : null - -function TarHeader (block) { - if (!(this instanceof TarHeader)) return new TarHeader(block) - if (block) this.decode(block) -} - -TarHeader.prototype = - { decode : decode - , encode: encode - , calcSum: calcSum - , checkSum: checkSum - } - -TarHeader.parseNumeric = parseNumeric -TarHeader.encode = encode -TarHeader.decode = decode - -// note that this will only do the normal ustar header, not any kind -// of extended posix header file. If something doesn't fit comfortably, -// then it will set obj.needExtended = true, and set the block to -// the closest approximation. -function encode (obj) { - if (!obj && !(this instanceof TarHeader)) throw new Error( - "encode must be called on a TarHeader, or supplied an object") - - obj = obj || this - var block = obj.block = new Buffer(512) - - // if the object has a "prefix", then that's actually an extension of - // the path field. - if (obj.prefix) { - // console.error("%% header encoding, got a prefix", obj.prefix) - obj.path = obj.prefix + "/" + obj.path - // console.error("%% header encoding, prefixed path", obj.path) - obj.prefix = "" - } - - obj.needExtended = false - - if (obj.mode) { - if (typeof obj.mode === "string") obj.mode = parseInt(obj.mode, 8) - obj.mode = obj.mode & 0777 - } - - for (var f = 0; fields[f] !== null; f ++) { - var field = fields[f] - , off = fieldOffs[f] - , end = fieldEnds[f] - , ret - - switch (field) { - case "cksum": - // special, done below, after all the others - break - - case "prefix": - // special, this is an extension of the "path" field. - // console.error("%% header encoding, skip prefix later") - break - - case "type": - // convert from long name to a single char. - var type = obj.type || "0" - if (type.length > 1) { - type = tar.types[obj.type] - if (!type) type = "0" - } - writeText(block, off, end, type) - break - - case "path": - // uses the "prefix" field if > 100 bytes, but <= 255 - var pathLen = Buffer.byteLength(obj.path) - , pathFSize = fieldSize[fields.path] - , prefFSize = fieldSize[fields.prefix] - - // paths between 100 and 255 should use the prefix field. - // longer than 255 - if (pathLen > pathFSize && - pathLen <= pathFSize + prefFSize) { - // need to find a slash somewhere in the middle so that - // path and prefix both fit in their respective fields - var searchStart = pathLen - 1 - pathFSize - , searchEnd = prefFSize - , found = false - , pathBuf = new Buffer(obj.path) - - for ( var s = searchStart - ; (s <= searchEnd) - ; s ++ ) { - if (pathBuf[s] === slash || pathBuf[s] === bslash) { - found = s - break - } - } - - if (found !== false) { - prefix = pathBuf.slice(0, found).toString("utf8") - path = pathBuf.slice(found + 1).toString("utf8") - - ret = writeText(block, off, end, path) - off = fieldOffs[fields.prefix] - end = fieldEnds[fields.prefix] - // console.error("%% header writing prefix", off, end, prefix) - ret = writeText(block, off, end, prefix) || ret - break - } - } - - // paths less than 100 chars don't need a prefix - // and paths longer than 255 need an extended header and will fail - // on old implementations no matter what we do here. - // Null out the prefix, and fallthrough to default. - // console.error("%% header writing no prefix") - var poff = fieldOffs[fields.prefix] - , pend = fieldEnds[fields.prefix] - writeText(block, poff, pend, "") - // fallthrough - - // all other fields are numeric or text - default: - ret = numeric[field] - ? writeNumeric(block, off, end, obj[field]) - : writeText(block, off, end, obj[field] || "") - break - } - obj.needExtended = obj.needExtended || ret - } - - var off = fieldOffs[fields.cksum] - , end = fieldEnds[fields.cksum] - - writeNumeric(block, off, end, calcSum.call(this, block)) - - return block -} - -// if it's a negative number, or greater than will fit, -// then use write256. -var MAXNUM = { 12: 077777777777 - , 11: 07777777777 - , 8 : 07777777 - , 7 : 0777777 } -function writeNumeric (block, off, end, num) { - var writeLen = end - off - , maxNum = MAXNUM[writeLen] || 0 - - num = num || 0 - // console.error(" numeric", num) - - if (num instanceof Date || - Object.prototype.toString.call(num) === "[object Date]") { - num = num.getTime() / 1000 - } - - if (num > maxNum || num < 0) { - write256(block, off, end, num) - // need an extended header if negative or too big. - return true - } - - // god, tar is so annoying - // if the string is small enough, you should put a space - // between the octal string and the \0, but if it doesn't - // fit, then don't. - var numStr = Math.floor(num).toString(8) - if (num < MAXNUM[writeLen - 1]) numStr += " " - - // pad with "0" chars - if (numStr.length < writeLen) { - numStr = (new Array(writeLen - numStr.length).join("0")) + numStr - } - - if (numStr.length !== writeLen - 1) { - throw new Error("invalid length: " + JSON.stringify(numStr) + "\n" + - "expected: "+writeLen) - } - block.write(numStr, off, writeLen, "utf8") - block[end - 1] = 0 -} - -function write256 (block, off, end, num) { - var buf = block.slice(off, end) - var positive = num >= 0 - buf[0] = positive ? 0x80 : 0xFF - - // get the number as a base-256 tuple - if (!positive) num *= -1 - var tuple = [] - do { - var n = num % 256 - tuple.push(n) - num = (num - n) / 256 - } while (num) - - var bytes = tuple.length - - var fill = buf.length - bytes - for (var i = 1; i < fill; i ++) { - buf[i] = positive ? 0 : 0xFF - } - - // tuple is a base256 number, with [0] as the *least* significant byte - // if it's negative, then we need to flip all the bits once we hit the - // first non-zero bit. The 2's-complement is (0x100 - n), and the 1's- - // complement is (0xFF - n). - var zero = true - for (i = bytes; i > 0; i --) { - var byte = tuple[bytes - i] - if (positive) buf[fill + i] = byte - else if (zero && byte === 0) buf[fill + i] = 0 - else if (zero) { - zero = false - buf[fill + i] = 0x100 - byte - } else buf[fill + i] = 0xFF - byte - } -} - -function writeText (block, off, end, str) { - // strings are written as utf8, then padded with \0 - var strLen = Buffer.byteLength(str) - , writeLen = Math.min(strLen, end - off) - // non-ascii fields need extended headers - // long fields get truncated - , needExtended = strLen !== str.length || strLen > writeLen - - // write the string, and null-pad - if (writeLen > 0) block.write(str, off, writeLen, "utf8") - for (var i = off + writeLen; i < end; i ++) block[i] = 0 - - return needExtended -} - -function calcSum (block) { - block = block || this.block - assert(Buffer.isBuffer(block) && block.length === 512) - - if (!block) throw new Error("Need block to checksum") - - // now figure out what it would be if the cksum was " " - var sum = 0 - , start = fieldOffs[fields.cksum] - , end = fieldEnds[fields.cksum] - - for (var i = 0; i < fieldOffs[fields.cksum]; i ++) { - sum += block[i] - } - - for (var i = start; i < end; i ++) { - sum += space - } - - for (var i = end; i < 512; i ++) { - sum += block[i] - } - - return sum -} - - -function checkSum (block) { - var sum = calcSum.call(this, block) - block = block || this.block - - var cksum = block.slice(fieldOffs[fields.cksum], fieldEnds[fields.cksum]) - cksum = parseNumeric(cksum) - - return cksum === sum -} - -function decode (block) { - block = block || this.block - assert(Buffer.isBuffer(block) && block.length === 512) - - this.block = block - this.cksumValid = this.checkSum() - - var prefix = null - - // slice off each field. - for (var f = 0; fields[f] !== null; f ++) { - var field = fields[f] - , val = block.slice(fieldOffs[f], fieldEnds[f]) - - switch (field) { - case "ustar": - // if not ustar, then everything after that is just padding. - if (val.toString() !== "ustar\0") { - this.ustar = false - return - } else { - // console.error("ustar:", val, val.toString()) - this.ustar = val.toString() - } - break - - // prefix is special, since it might signal the xstar header - case "prefix": - var atime = parseNumeric(val.slice(131, 131 + 12)) - , ctime = parseNumeric(val.slice(131 + 12, 131 + 12 + 12)) - if ((val[130] === 0 || val[130] === space) && - typeof atime === "number" && - typeof ctime === "number" && - val[131 + 12] === space && - val[131 + 12 + 12] === space) { - this.atime = atime - this.ctime = ctime - val = val.slice(0, 130) - } - prefix = val.toString("utf8").replace(/\0+$/, "") - // console.error("%% header reading prefix", prefix) - break - - // all other fields are null-padding text - // or a number. - default: - if (numeric[field]) { - this[field] = parseNumeric(val) - } else { - this[field] = val.toString("utf8").replace(/\0+$/, "") - } - break - } - } - - // if we got a prefix, then prepend it to the path. - if (prefix) { - this.path = prefix + "/" + this.path - // console.error("%% header got a prefix", this.path) - } -} - -function parse256 (buf) { - // first byte MUST be either 80 or FF - // 80 for positive, FF for 2's comp - var positive - if (buf[0] === 0x80) positive = true - else if (buf[0] === 0xFF) positive = false - else return null - - // build up a base-256 tuple from the least sig to the highest - var zero = false - , tuple = [] - for (var i = buf.length - 1; i > 0; i --) { - var byte = buf[i] - if (positive) tuple.push(byte) - else if (zero && byte === 0) tuple.push(0) - else if (zero) { - zero = false - tuple.push(0x100 - byte) - } else tuple.push(0xFF - byte) - } - - for (var sum = 0, i = 0, l = tuple.length; i < l; i ++) { - sum += tuple[i] * Math.pow(256, i) - } - - return positive ? sum : -1 * sum -} - -function parseNumeric (f) { - if (f[0] & 0x80) return parse256(f) - - var str = f.toString("utf8").split("\0")[0].trim() - , res = parseInt(str, 8) - - return isNaN(res) ? null : res -} - diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/lib/pack.js b/deps/npm/node_modules/node-gyp/node_modules/tar/lib/pack.js deleted file mode 100644 index 3ff14dd695100e..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/tar/lib/pack.js +++ /dev/null @@ -1,231 +0,0 @@ -// pipe in an fstream, and it'll make a tarball. -// key-value pair argument is global extended header props. - -module.exports = Pack - -var EntryWriter = require("./entry-writer.js") - , Stream = require("stream").Stream - , path = require("path") - , inherits = require("inherits") - , GlobalHeaderWriter = require("./global-header-writer.js") - , collect = require("fstream").collect - , eof = new Buffer(512) - -for (var i = 0; i < 512; i ++) eof[i] = 0 - -inherits(Pack, Stream) - -function Pack (props) { - // console.error("-- p ctor") - var me = this - if (!(me instanceof Pack)) return new Pack(props) - - if (props) me._noProprietary = props.noProprietary - else me._noProprietary = false - - me._global = props - - me.readable = true - me.writable = true - me._buffer = [] - // console.error("-- -- set current to null in ctor") - me._currentEntry = null - me._processing = false - - me._pipeRoot = null - me.on("pipe", function (src) { - if (src.root === me._pipeRoot) return - me._pipeRoot = src - src.on("end", function () { - me._pipeRoot = null - }) - me.add(src) - }) -} - -Pack.prototype.addGlobal = function (props) { - // console.error("-- p addGlobal") - if (this._didGlobal) return - this._didGlobal = true - - var me = this - GlobalHeaderWriter(props) - .on("data", function (c) { - me.emit("data", c) - }) - .end() -} - -Pack.prototype.add = function (stream) { - if (this._global && !this._didGlobal) this.addGlobal(this._global) - - if (this._ended) return this.emit("error", new Error("add after end")) - - collect(stream) - this._buffer.push(stream) - this._process() - this._needDrain = this._buffer.length > 0 - return !this._needDrain -} - -Pack.prototype.pause = function () { - this._paused = true - if (this._currentEntry) this._currentEntry.pause() - this.emit("pause") -} - -Pack.prototype.resume = function () { - this._paused = false - if (this._currentEntry) this._currentEntry.resume() - this.emit("resume") - this._process() -} - -Pack.prototype.end = function () { - this._ended = true - this._buffer.push(eof) - this._process() -} - -Pack.prototype._process = function () { - var me = this - if (me._paused || me._processing) { - return - } - - var entry = me._buffer.shift() - - if (!entry) { - if (me._needDrain) { - me.emit("drain") - } - return - } - - if (entry.ready === false) { - // console.error("-- entry is not ready", entry) - me._buffer.unshift(entry) - entry.on("ready", function () { - // console.error("-- -- ready!", entry) - me._process() - }) - return - } - - me._processing = true - - if (entry === eof) { - // need 2 ending null blocks. - me.emit("data", eof) - me.emit("data", eof) - me.emit("end") - me.emit("close") - return - } - - // Change the path to be relative to the root dir that was - // added to the tarball. - // - // XXX This should be more like how -C works, so you can - // explicitly set a root dir, and also explicitly set a pathname - // in the tarball to use. That way we can skip a lot of extra - // work when resolving symlinks for bundled dependencies in npm. - - var root = path.dirname((entry.root || entry).path) - var wprops = {} - - Object.keys(entry.props || {}).forEach(function (k) { - wprops[k] = entry.props[k] - }) - - if (me._noProprietary) wprops.noProprietary = true - - wprops.path = path.relative(root, entry.path || '') - - // actually not a matter of opinion or taste. - if (process.platform === "win32") { - wprops.path = wprops.path.replace(/\\/g, "/") - } - - if (!wprops.type) - wprops.type = 'Directory' - - switch (wprops.type) { - // sockets not supported - case "Socket": - return - - case "Directory": - wprops.path += "/" - wprops.size = 0 - break - - case "Link": - var lp = path.resolve(path.dirname(entry.path), entry.linkpath) - wprops.linkpath = path.relative(root, lp) || "." - wprops.size = 0 - break - - case "SymbolicLink": - var lp = path.resolve(path.dirname(entry.path), entry.linkpath) - wprops.linkpath = path.relative(path.dirname(entry.path), lp) || "." - wprops.size = 0 - break - } - - // console.error("-- new writer", wprops) - // if (!wprops.type) { - // // console.error("-- no type?", entry.constructor.name, entry) - // } - - // console.error("-- -- set current to new writer", wprops.path) - var writer = me._currentEntry = EntryWriter(wprops) - - writer.parent = me - - // writer.on("end", function () { - // // console.error("-- -- writer end", writer.path) - // }) - - writer.on("data", function (c) { - me.emit("data", c) - }) - - writer.on("header", function () { - Buffer.prototype.toJSON = function () { - return this.toString().split(/\0/).join(".") - } - // console.error("-- -- writer header %j", writer.props) - if (writer.props.size === 0) nextEntry() - }) - writer.on("close", nextEntry) - - var ended = false - function nextEntry () { - if (ended) return - ended = true - - // console.error("-- -- writer close", writer.path) - // console.error("-- -- set current to null", wprops.path) - me._currentEntry = null - me._processing = false - me._process() - } - - writer.on("error", function (er) { - // console.error("-- -- writer error", writer.path) - me.emit("error", er) - }) - - // if it's the root, then there's no need to add its entries, - // or data, since they'll be added directly. - if (entry === me._pipeRoot) { - // console.error("-- is the root, don't auto-add") - writer.add = null - } - - entry.pipe(writer) -} - -Pack.prototype.destroy = function () {} -Pack.prototype.write = function () {} diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/lib/parse.js b/deps/npm/node_modules/node-gyp/node_modules/tar/lib/parse.js deleted file mode 100644 index 8517c481bc6ef4..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/tar/lib/parse.js +++ /dev/null @@ -1,271 +0,0 @@ - -// A writable stream. -// It emits "entry" events, which provide a readable stream that has -// header info attached. - -module.exports = Parse.create = Parse - -var stream = require("stream") - , Stream = stream.Stream - , BlockStream = require("block-stream") - , tar = require("../tar.js") - , TarHeader = require("./header.js") - , Entry = require("./entry.js") - , BufferEntry = require("./buffer-entry.js") - , ExtendedHeader = require("./extended-header.js") - , assert = require("assert").ok - , inherits = require("inherits") - , fstream = require("fstream") - -// reading a tar is a lot like reading a directory -// However, we're actually not going to run the ctor, -// since it does a stat and various other stuff. -// This inheritance gives us the pause/resume/pipe -// behavior that is desired. -inherits(Parse, fstream.Reader) - -function Parse () { - var me = this - if (!(me instanceof Parse)) return new Parse() - - // doesn't apply fstream.Reader ctor? - // no, becasue we don't want to stat/etc, we just - // want to get the entry/add logic from .pipe() - Stream.apply(me) - - me.writable = true - me.readable = true - me._stream = new BlockStream(512) - me.position = 0 - me._ended = false - - me._stream.on("error", function (e) { - me.emit("error", e) - }) - - me._stream.on("data", function (c) { - me._process(c) - }) - - me._stream.on("end", function () { - me._streamEnd() - }) - - me._stream.on("drain", function () { - me.emit("drain") - }) -} - -// overridden in Extract class, since it needs to -// wait for its DirWriter part to finish before -// emitting "end" -Parse.prototype._streamEnd = function () { - var me = this - if (!me._ended) me.error("unexpected eof") - me.emit("end") -} - -// a tar reader is actually a filter, not just a readable stream. -// So, you should pipe a tarball stream into it, and it needs these -// write/end methods to do that. -Parse.prototype.write = function (c) { - if (this._ended) { - // gnutar puts a LOT of nulls at the end. - // you can keep writing these things forever. - // Just ignore them. - for (var i = 0, l = c.length; i > l; i ++) { - if (c[i] !== 0) return this.error("write() after end()") - } - return - } - return this._stream.write(c) -} - -Parse.prototype.end = function (c) { - this._ended = true - return this._stream.end(c) -} - -// don't need to do anything, since we're just -// proxying the data up from the _stream. -// Just need to override the parent's "Not Implemented" -// error-thrower. -Parse.prototype._read = function () {} - -Parse.prototype._process = function (c) { - assert(c && c.length === 512, "block size should be 512") - - // one of three cases. - // 1. A new header - // 2. A part of a file/extended header - // 3. One of two or more EOF null blocks - - if (this._entry) { - var entry = this._entry - entry.write(c) - if (entry._remaining === 0) { - entry.end() - this._entry = null - } - } else { - // either zeroes or a header - var zero = true - for (var i = 0; i < 512 && zero; i ++) { - zero = c[i] === 0 - } - - // eof is *at least* 2 blocks of nulls, and then the end of the - // file. you can put blocks of nulls between entries anywhere, - // so appending one tarball to another is technically valid. - // ending without the eof null blocks is not allowed, however. - if (zero) { - if (this._eofStarted) - this._ended = true - this._eofStarted = true - } else { - this._eofStarted = false - this._startEntry(c) - } - } - - this.position += 512 -} - -// take a header chunk, start the right kind of entry. -Parse.prototype._startEntry = function (c) { - var header = new TarHeader(c) - , self = this - , entry - , ev - , EntryType - , onend - , meta = false - - if (null === header.size || !header.cksumValid) { - var e = new Error("invalid tar file") - e.header = header - e.tar_file_offset = this.position - e.tar_block = this.position / 512 - return this.emit("error", e) - } - - switch (tar.types[header.type]) { - case "File": - case "OldFile": - case "Link": - case "SymbolicLink": - case "CharacterDevice": - case "BlockDevice": - case "Directory": - case "FIFO": - case "ContiguousFile": - case "GNUDumpDir": - // start a file. - // pass in any extended headers - // These ones consumers are typically most interested in. - EntryType = Entry - ev = "entry" - break - - case "GlobalExtendedHeader": - // extended headers that apply to the rest of the tarball - EntryType = ExtendedHeader - onend = function () { - self._global = self._global || {} - Object.keys(entry.fields).forEach(function (k) { - self._global[k] = entry.fields[k] - }) - } - ev = "globalExtendedHeader" - meta = true - break - - case "ExtendedHeader": - case "OldExtendedHeader": - // extended headers that apply to the next entry - EntryType = ExtendedHeader - onend = function () { - self._extended = entry.fields - } - ev = "extendedHeader" - meta = true - break - - case "NextFileHasLongLinkpath": - // set linkpath= in extended header - EntryType = BufferEntry - onend = function () { - self._extended = self._extended || {} - self._extended.linkpath = entry.body - } - ev = "longLinkpath" - meta = true - break - - case "NextFileHasLongPath": - case "OldGnuLongPath": - // set path= in file-extended header - EntryType = BufferEntry - onend = function () { - self._extended = self._extended || {} - self._extended.path = entry.body - } - ev = "longPath" - meta = true - break - - default: - // all the rest we skip, but still set the _entry - // member, so that we can skip over their data appropriately. - // emit an event to say that this is an ignored entry type? - EntryType = Entry - ev = "ignoredEntry" - break - } - - var global, extended - if (meta) { - global = extended = null - } else { - var global = this._global - var extended = this._extended - - // extendedHeader only applies to one entry, so once we start - // an entry, it's over. - this._extended = null - } - entry = new EntryType(header, extended, global) - entry.meta = meta - - // only proxy data events of normal files. - if (!meta) { - entry.on("data", function (c) { - me.emit("data", c) - }) - } - - if (onend) entry.on("end", onend) - - this._entry = entry - var me = this - - entry.on("pause", function () { - me.pause() - }) - - entry.on("resume", function () { - me.resume() - }) - - if (this.listeners("*").length) { - this.emit("*", ev, entry) - } - - this.emit(ev, entry) - - // Zero-byte entry. End immediately. - if (entry.props.size === 0) { - entry.end() - this._entry = null - } -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/package.json b/deps/npm/node_modules/node-gyp/node_modules/tar/package.json deleted file mode 100644 index 7fab5394cd6ec2..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/tar/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "name": "tar", - "description": "tar for node", - "version": "1.0.3", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-tar.git" - }, - "main": "tar.js", - "scripts": { - "test": "tap test/*.js" - }, - "dependencies": { - "block-stream": "*", - "fstream": "^1.0.2", - "inherits": "2" - }, - "devDependencies": { - "graceful-fs": "^3.0.2", - "rimraf": "1.x", - "tap": "0.x", - "mkdirp": "^0.5.0" - }, - "license": "BSD", - "gitHead": "f4151128c585da236c6b1e278b762ecaedc20c15", - "bugs": { - "url": "https://github.com/isaacs/node-tar/issues" - }, - "homepage": "https://github.com/isaacs/node-tar", - "_id": "tar@1.0.3", - "_shasum": "15bcdab244fa4add44e4244a0176edb8aa9a2b44", - "_from": "tar@>=1.0.0 <2.0.0", - "_npmVersion": "2.1.10", - "_nodeVersion": "0.10.33", - "_npmUser": { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - }, - { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" - } - ], - "dist": { - "shasum": "15bcdab244fa4add44e4244a0176edb8aa9a2b44", - "tarball": "http://registry.npmjs.org/tar/-/tar-1.0.3.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/tar/-/tar-1.0.3.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/tar.js b/deps/npm/node_modules/node-gyp/node_modules/tar/tar.js deleted file mode 100644 index a81298b9a0b126..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/tar/tar.js +++ /dev/null @@ -1,173 +0,0 @@ -// field paths that every tar file must have. -// header is padded to 512 bytes. -var f = 0 - , fields = {} - , path = fields.path = f++ - , mode = fields.mode = f++ - , uid = fields.uid = f++ - , gid = fields.gid = f++ - , size = fields.size = f++ - , mtime = fields.mtime = f++ - , cksum = fields.cksum = f++ - , type = fields.type = f++ - , linkpath = fields.linkpath = f++ - , headerSize = 512 - , blockSize = 512 - , fieldSize = [] - -fieldSize[path] = 100 -fieldSize[mode] = 8 -fieldSize[uid] = 8 -fieldSize[gid] = 8 -fieldSize[size] = 12 -fieldSize[mtime] = 12 -fieldSize[cksum] = 8 -fieldSize[type] = 1 -fieldSize[linkpath] = 100 - -// "ustar\0" may introduce another bunch of headers. -// these are optional, and will be nulled out if not present. - -var ustar = fields.ustar = f++ - , ustarver = fields.ustarver = f++ - , uname = fields.uname = f++ - , gname = fields.gname = f++ - , devmaj = fields.devmaj = f++ - , devmin = fields.devmin = f++ - , prefix = fields.prefix = f++ - , fill = fields.fill = f++ - -// terminate fields. -fields[f] = null - -fieldSize[ustar] = 6 -fieldSize[ustarver] = 2 -fieldSize[uname] = 32 -fieldSize[gname] = 32 -fieldSize[devmaj] = 8 -fieldSize[devmin] = 8 -fieldSize[prefix] = 155 -fieldSize[fill] = 12 - -// nb: prefix field may in fact be 130 bytes of prefix, -// a null char, 12 bytes for atime, 12 bytes for ctime. -// -// To recognize this format: -// 1. prefix[130] === ' ' or '\0' -// 2. atime and ctime are octal numeric values -// 3. atime and ctime have ' ' in their last byte - -var fieldEnds = {} - , fieldOffs = {} - , fe = 0 -for (var i = 0; i < f; i ++) { - fieldOffs[i] = fe - fieldEnds[i] = (fe += fieldSize[i]) -} - -// build a translation table of field paths. -Object.keys(fields).forEach(function (f) { - if (fields[f] !== null) fields[fields[f]] = f -}) - -// different values of the 'type' field -// paths match the values of Stats.isX() functions, where appropriate -var types = - { 0: "File" - , "\0": "OldFile" // like 0 - , "": "OldFile" - , 1: "Link" - , 2: "SymbolicLink" - , 3: "CharacterDevice" - , 4: "BlockDevice" - , 5: "Directory" - , 6: "FIFO" - , 7: "ContiguousFile" // like 0 - // posix headers - , g: "GlobalExtendedHeader" // k=v for the rest of the archive - , x: "ExtendedHeader" // k=v for the next file - // vendor-specific stuff - , A: "SolarisACL" // skip - , D: "GNUDumpDir" // like 5, but with data, which should be skipped - , I: "Inode" // metadata only, skip - , K: "NextFileHasLongLinkpath" // data = link path of next file - , L: "NextFileHasLongPath" // data = path of next file - , M: "ContinuationFile" // skip - , N: "OldGnuLongPath" // like L - , S: "SparseFile" // skip - , V: "TapeVolumeHeader" // skip - , X: "OldExtendedHeader" // like x - } - -Object.keys(types).forEach(function (t) { - types[types[t]] = types[types[t]] || t -}) - -// values for the mode field -var modes = - { suid: 04000 // set uid on extraction - , sgid: 02000 // set gid on extraction - , svtx: 01000 // set restricted deletion flag on dirs on extraction - , uread: 0400 - , uwrite: 0200 - , uexec: 0100 - , gread: 040 - , gwrite: 020 - , gexec: 010 - , oread: 4 - , owrite: 2 - , oexec: 1 - , all: 07777 - } - -var numeric = - { mode: true - , uid: true - , gid: true - , size: true - , mtime: true - , devmaj: true - , devmin: true - , cksum: true - , atime: true - , ctime: true - , dev: true - , ino: true - , nlink: true - } - -Object.keys(modes).forEach(function (t) { - modes[modes[t]] = modes[modes[t]] || t -}) - -var knownExtended = - { atime: true - , charset: true - , comment: true - , ctime: true - , gid: true - , gname: true - , linkpath: true - , mtime: true - , path: true - , realtime: true - , security: true - , size: true - , uid: true - , uname: true } - - -exports.fields = fields -exports.fieldSize = fieldSize -exports.fieldOffs = fieldOffs -exports.fieldEnds = fieldEnds -exports.types = types -exports.modes = modes -exports.numeric = numeric -exports.headerSize = headerSize -exports.blockSize = blockSize -exports.knownExtended = knownExtended - -exports.Pack = require("./lib/pack.js") -exports.Parse = require("./lib/parse.js") -exports.Extract = require("./lib/extract.js") diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/test/00-setup-fixtures.js b/deps/npm/node_modules/node-gyp/node_modules/tar/test/00-setup-fixtures.js deleted file mode 100644 index 1524ff7af05700..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/tar/test/00-setup-fixtures.js +++ /dev/null @@ -1,53 +0,0 @@ -// the fixtures have some weird stuff that is painful -// to include directly in the repo for various reasons. -// -// So, unpack the fixtures with the system tar first. -// -// This means, of course, that it'll only work if you -// already have a tar implementation, and some of them -// will not properly unpack the fixtures anyway. -// -// But, since usually those tests will fail on Windows -// and other systems with less capable filesystems anyway, -// at least this way we don't cause inconveniences by -// merely cloning the repo or installing the package. - -var tap = require("tap") -, child_process = require("child_process") -, rimraf = require("rimraf") -, test = tap.test -, path = require("path") - -test("clean fixtures", function (t) { - rimraf(path.resolve(__dirname, "fixtures"), function (er) { - t.ifError(er, "rimraf ./fixtures/") - t.end() - }) -}) - -test("clean tmp", function (t) { - rimraf(path.resolve(__dirname, "tmp"), function (er) { - t.ifError(er, "rimraf ./tmp/") - t.end() - }) -}) - -test("extract fixtures", function (t) { - var c = child_process.spawn("tar" - ,["xzvf", "fixtures.tgz"] - ,{ cwd: __dirname }) - - c.stdout.on("data", errwrite) - c.stderr.on("data", errwrite) - function errwrite (chunk) { - process.stderr.write(chunk) - } - - c.on("exit", function (code) { - t.equal(code, 0, "extract fixtures should exit with 0") - if (code) { - t.comment("Note, all tests from here on out will fail because of this.") - } - t.end() - }) -}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/test/extract-move.js b/deps/npm/node_modules/node-gyp/node_modules/tar/test/extract-move.js deleted file mode 100644 index 45400cd9bb818d..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/tar/test/extract-move.js +++ /dev/null @@ -1,132 +0,0 @@ -// Set the umask, so that it works the same everywhere. -process.umask(parseInt('22', 8)) - -var tap = require("tap") - , tar = require("../tar.js") - , fs = require("fs") - , gfs = require("graceful-fs") - , path = require("path") - , file = path.resolve(__dirname, "fixtures/dir.tar") - , target = path.resolve(__dirname, "tmp/extract-test") - , index = 0 - , fstream = require("fstream") - , rimraf = require("rimraf") - , mkdirp = require("mkdirp") - - , ee = 0 - , expectEntries = [ - { - "path" : "dir/", - "mode" : "750", - "type" : "5", - "depth" : undefined, - "size" : 0, - "linkpath" : "", - "nlink" : undefined, - "dev" : undefined, - "ino" : undefined - }, - { - "path" : "dir/sub/", - "mode" : "750", - "type" : "5", - "depth" : undefined, - "size" : 0, - "linkpath" : "", - "nlink" : undefined, - "dev" : undefined, - "ino" : undefined - } ] - -function slow (fs, method, t1, t2) { - var orig = fs[method] - if (!orig) return null - fs[method] = function () { - var args = [].slice.call(arguments) - console.error("slow", method, args[0]) - var cb = args.pop() - - setTimeout(function () { - orig.apply(fs, args.concat(function(er, data) { - setTimeout(function() { - cb(er, data) - }, t2) - })) - }, t1) - } -} - -// Make sure we get the graceful-fs that fstream is using. -var gfs2 -try { - gfs2 = require("fstream/node_modules/graceful-fs") -} catch (er) {} - -var slowMethods = ["chown", "chmod", "utimes", "lutimes"] -slowMethods.forEach(function (method) { - var t1 = 500 - var t2 = 0 - slow(fs, method, t1, t2) - slow(gfs, method, t1, t2) - if (gfs2) { - slow(gfs2, method, t1, t2) - } -}) - - - -// The extract class basically just pipes the input -// to a Reader, and then to a fstream.DirWriter - -// So, this is as much a test of fstream.Reader and fstream.Writer -// as it is of tar.Extract, but it sort of makes sense. - -tap.test("preclean", function (t) { - rimraf.sync(target) - /mkdirp.sync(target) - t.pass("cleaned!") - t.end() -}) - -tap.test("extract test", function (t) { - var extract = tar.Extract(target) - var inp = fs.createReadStream(file) - - // give it a weird buffer size to try to break in odd places - inp.bufferSize = 1234 - - inp.pipe(extract) - - extract.on("end", function () { - rimraf.sync(target) - - t.equal(ee, expectEntries.length, "should see "+ee+" entries") - - // should get no more entries after end - extract.removeAllListeners("entry") - extract.on("entry", function (e) { - t.fail("Should not get entries after end!") - }) - - t.end() - }) - - - extract.on("entry", function (entry) { - var found = - { path: entry.path - , mode: entry.props.mode.toString(8) - , type: entry.props.type - , depth: entry.props.depth - , size: entry.props.size - , linkpath: entry.props.linkpath - , nlink: entry.props.nlink - , dev: entry.props.dev - , ino: entry.props.ino - } - - var wanted = expectEntries[ee ++] - - t.equivalent(found, wanted, "tar entry " + ee + " " + wanted.path) - }) -}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/test/extract.js b/deps/npm/node_modules/node-gyp/node_modules/tar/test/extract.js deleted file mode 100644 index eca4e7cc962db6..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/tar/test/extract.js +++ /dev/null @@ -1,367 +0,0 @@ -// Set the umask, so that it works the same everywhere. -process.umask(parseInt('22', 8)) - -var tap = require("tap") - , tar = require("../tar.js") - , fs = require("fs") - , path = require("path") - , file = path.resolve(__dirname, "fixtures/c.tar") - , target = path.resolve(__dirname, "tmp/extract-test") - , index = 0 - , fstream = require("fstream") - - , ee = 0 - , expectEntries = -[ { path: 'c.txt', - mode: '644', - type: '0', - depth: undefined, - size: 513, - linkpath: '', - nlink: undefined, - dev: undefined, - ino: undefined }, - { path: 'cc.txt', - mode: '644', - type: '0', - depth: undefined, - size: 513, - linkpath: '', - nlink: undefined, - dev: undefined, - ino: undefined }, - { path: 'r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - mode: '644', - type: '0', - depth: undefined, - size: 100, - linkpath: '', - nlink: undefined, - dev: undefined, - ino: undefined }, - { path: 'Ω.txt', - mode: '644', - type: '0', - depth: undefined, - size: 2, - linkpath: '', - nlink: undefined, - dev: undefined, - ino: undefined }, - { path: 'Ω.txt', - mode: '644', - type: '0', - depth: undefined, - size: 2, - linkpath: '', - nlink: 1, - dev: 234881026, - ino: 51693379 }, - { path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - mode: '644', - type: '0', - depth: undefined, - size: 200, - linkpath: '', - nlink: 1, - dev: 234881026, - ino: 51681874 }, - { path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - mode: '644', - type: '0', - depth: undefined, - size: 201, - linkpath: '', - nlink: undefined, - dev: undefined, - ino: undefined }, - { path: '200LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL', - mode: '777', - type: '2', - depth: undefined, - size: 0, - linkpath: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - nlink: undefined, - dev: undefined, - ino: undefined }, - { path: '200-hard', - mode: '644', - type: '0', - depth: undefined, - size: 200, - linkpath: '', - nlink: 2, - dev: 234881026, - ino: 51681874 }, - { path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - mode: '644', - type: '1', - depth: undefined, - size: 0, - linkpath: path.resolve(target, '200-hard'), - nlink: 2, - dev: 234881026, - ino: 51681874 } ] - - , ef = 0 - , expectFiles = -[ { path: '', - mode: '40755', - type: 'Directory', - depth: 0, - linkpath: undefined }, - { path: '/200-hard', - mode: '100644', - type: 'File', - depth: 1, - size: 200, - linkpath: undefined, - nlink: 2 }, - { path: '/200LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL', - mode: '120777', - type: 'SymbolicLink', - depth: 1, - size: 200, - linkpath: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - nlink: 1 }, - { path: '/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - mode: '100644', - type: 'Link', - depth: 1, - size: 200, - linkpath: path.join(target, '200-hard'), - nlink: 2 }, - { path: '/c.txt', - mode: '100644', - type: 'File', - depth: 1, - size: 513, - linkpath: undefined, - nlink: 1 }, - { path: '/cc.txt', - mode: '100644', - type: 'File', - depth: 1, - size: 513, - linkpath: undefined, - nlink: 1 }, - { path: '/r', - mode: '40755', - type: 'Directory', - depth: 1, - linkpath: undefined }, - { path: '/r/e', - mode: '40755', - type: 'Directory', - depth: 2, - linkpath: undefined }, - { path: '/r/e/a', - mode: '40755', - type: 'Directory', - depth: 3, - linkpath: undefined }, - { path: '/r/e/a/l', - mode: '40755', - type: 'Directory', - depth: 4, - linkpath: undefined }, - { path: '/r/e/a/l/l', - mode: '40755', - type: 'Directory', - depth: 5, - linkpath: undefined }, - { path: '/r/e/a/l/l/y', - mode: '40755', - type: 'Directory', - depth: 6, - linkpath: undefined }, - { path: '/r/e/a/l/l/y/-', - mode: '40755', - type: 'Directory', - depth: 7, - linkpath: undefined }, - { path: '/r/e/a/l/l/y/-/d', - mode: '40755', - type: 'Directory', - depth: 8, - linkpath: undefined }, - { path: '/r/e/a/l/l/y/-/d/e', - mode: '40755', - type: 'Directory', - depth: 9, - linkpath: undefined }, - { path: '/r/e/a/l/l/y/-/d/e/e', - mode: '40755', - type: 'Directory', - depth: 10, - linkpath: undefined }, - { path: '/r/e/a/l/l/y/-/d/e/e/p', - mode: '40755', - type: 'Directory', - depth: 11, - linkpath: undefined }, - { path: '/r/e/a/l/l/y/-/d/e/e/p/-', - mode: '40755', - type: 'Directory', - depth: 12, - linkpath: undefined }, - { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f', - mode: '40755', - type: 'Directory', - depth: 13, - linkpath: undefined }, - { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o', - mode: '40755', - type: 'Directory', - depth: 14, - linkpath: undefined }, - { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l', - mode: '40755', - type: 'Directory', - depth: 15, - linkpath: undefined }, - { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d', - mode: '40755', - type: 'Directory', - depth: 16, - linkpath: undefined }, - { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e', - mode: '40755', - type: 'Directory', - depth: 17, - linkpath: undefined }, - { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r', - mode: '40755', - type: 'Directory', - depth: 18, - linkpath: undefined }, - { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-', - mode: '40755', - type: 'Directory', - depth: 19, - linkpath: undefined }, - { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p', - mode: '40755', - type: 'Directory', - depth: 20, - linkpath: undefined }, - { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a', - mode: '40755', - type: 'Directory', - depth: 21, - linkpath: undefined }, - { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t', - mode: '40755', - type: 'Directory', - depth: 22, - linkpath: undefined }, - { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h', - mode: '40755', - type: 'Directory', - depth: 23, - linkpath: undefined }, - { path: '/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - mode: '100644', - type: 'File', - depth: 24, - size: 100, - linkpath: undefined, - nlink: 1 }, - { path: '/Ω.txt', - mode: '100644', - type: 'File', - depth: 1, - size: 2, - linkpath: undefined, - nlink: 1 } ] - - - -// The extract class basically just pipes the input -// to a Reader, and then to a fstream.DirWriter - -// So, this is as much a test of fstream.Reader and fstream.Writer -// as it is of tar.Extract, but it sort of makes sense. - -tap.test("preclean", function (t) { - require("rimraf").sync(__dirname + "/tmp/extract-test") - t.pass("cleaned!") - t.end() -}) - -tap.test("extract test", function (t) { - var extract = tar.Extract(target) - var inp = fs.createReadStream(file) - - // give it a weird buffer size to try to break in odd places - inp.bufferSize = 1234 - - inp.pipe(extract) - - extract.on("end", function () { - t.equal(ee, expectEntries.length, "should see "+ee+" entries") - - // should get no more entries after end - extract.removeAllListeners("entry") - extract.on("entry", function (e) { - t.fail("Should not get entries after end!") - }) - - next() - }) - - extract.on("entry", function (entry) { - var found = - { path: entry.path - , mode: entry.props.mode.toString(8) - , type: entry.props.type - , depth: entry.props.depth - , size: entry.props.size - , linkpath: entry.props.linkpath - , nlink: entry.props.nlink - , dev: entry.props.dev - , ino: entry.props.ino - } - - var wanted = expectEntries[ee ++] - - t.equivalent(found, wanted, "tar entry " + ee + " " + wanted.path) - }) - - function next () { - var r = fstream.Reader({ path: target - , type: "Directory" - // this is just to encourage consistency - , sort: "alpha" }) - - r.on("ready", function () { - foundEntry(r) - }) - - r.on("end", finish) - - function foundEntry (entry) { - var p = entry.path.substr(target.length) - var found = - { path: p - , mode: entry.props.mode.toString(8) - , type: entry.props.type - , depth: entry.props.depth - , size: entry.props.size - , linkpath: entry.props.linkpath - , nlink: entry.props.nlink - } - - var wanted = expectFiles[ef ++] - - t.has(found, wanted, "unpacked file " + ef + " " + wanted.path) - - entry.on("entry", foundEntry) - } - - function finish () { - t.equal(ef, expectFiles.length, "should have "+ef+" items") - t.end() - } - } -}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/test/fixtures.tgz b/deps/npm/node_modules/node-gyp/node_modules/tar/test/fixtures.tgz deleted file mode 100644 index f1676023afa2bb..00000000000000 Binary files a/deps/npm/node_modules/node-gyp/node_modules/tar/test/fixtures.tgz and /dev/null differ diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/test/header.js b/deps/npm/node_modules/node-gyp/node_modules/tar/test/header.js deleted file mode 100644 index 8ea6f79500de73..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/tar/test/header.js +++ /dev/null @@ -1,183 +0,0 @@ -var tap = require("tap") -var TarHeader = require("../lib/header.js") -var tar = require("../tar.js") -var fs = require("fs") - - -var headers = - { "a.txt file header": - [ "612e747874000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030303036343420003035373736312000303030303234200030303030303030303430312031313635313336303333332030313234353100203000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000757374617200303069736161637300000000000000000000000000000000000000000000000000007374616666000000000000000000000000000000000000000000000000000000303030303030200030303030303020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - , { cksumValid: true - , path: 'a.txt' - , mode: 420 - , uid: 24561 - , gid: 20 - , size: 257 - , mtime: 1319493851 - , cksum: 5417 - , type: '0' - , linkpath: '' - , ustar: 'ustar\0' - , ustarver: '00' - , uname: 'isaacs' - , gname: 'staff' - , devmaj: 0 - , devmin: 0 - , fill: '' } - ] - - , "omega pax": // the extended header from omega tar. - [ "5061784865616465722fcea92e74787400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030303036343420003035373736312000303030303234200030303030303030303137302031313534333731303631312030313530353100207800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000757374617200303069736161637300000000000000000000000000000000000000000000000000007374616666000000000000000000000000000000000000000000000000000000303030303030200030303030303020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - , { cksumValid: true - , path: 'PaxHeader/Ω.txt' - , mode: 420 - , uid: 24561 - , gid: 20 - , size: 120 - , mtime: 1301254537 - , cksum: 6697 - , type: 'x' - , linkpath: '' - , ustar: 'ustar\0' - , ustarver: '00' - , uname: 'isaacs' - , gname: 'staff' - , devmaj: 0 - , devmin: 0 - , fill: '' } ] - - , "omega file header": - [ "cea92e7478740000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030303036343420003035373736312000303030303234200030303030303030303030322031313534333731303631312030313330373200203000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000757374617200303069736161637300000000000000000000000000000000000000000000000000007374616666000000000000000000000000000000000000000000000000000000303030303030200030303030303020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - , { cksumValid: true - , path: 'Ω.txt' - , mode: 420 - , uid: 24561 - , gid: 20 - , size: 2 - , mtime: 1301254537 - , cksum: 5690 - , type: '0' - , linkpath: '' - , ustar: 'ustar\0' - , ustarver: '00' - , uname: 'isaacs' - , gname: 'staff' - , devmaj: 0 - , devmin: 0 - , fill: '' } ] - - , "foo.js file header": - [ "666f6f2e6a730000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030303036343420003035373736312000303030303234200030303030303030303030342031313534333637303734312030313236313700203000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000757374617200303069736161637300000000000000000000000000000000000000000000000000007374616666000000000000000000000000000000000000000000000000000000303030303030200030303030303020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - , { cksumValid: true - , path: 'foo.js' - , mode: 420 - , uid: 24561 - , gid: 20 - , size: 4 - , mtime: 1301246433 - , cksum: 5519 - , type: '0' - , linkpath: '' - , ustar: 'ustar\0' - , ustarver: '00' - , uname: 'isaacs' - , gname: 'staff' - , devmaj: 0 - , devmin: 0 - , fill: '' } - ] - - , "b.txt file header": - [ "622e747874000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030303036343420003035373736312000303030303234200030303030303030313030302031313635313336303637372030313234363100203000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000757374617200303069736161637300000000000000000000000000000000000000000000000000007374616666000000000000000000000000000000000000000000000000000000303030303030200030303030303020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - , { cksumValid: true - , path: 'b.txt' - , mode: 420 - , uid: 24561 - , gid: 20 - , size: 512 - , mtime: 1319494079 - , cksum: 5425 - , type: '0' - , linkpath: '' - , ustar: 'ustar\0' - , ustarver: '00' - , uname: 'isaacs' - , gname: 'staff' - , devmaj: 0 - , devmin: 0 - , fill: '' } - ] - - , "deep nested file": - [ "636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363636363633030303634342000303537373631200030303030323420003030303030303030313434203131363532313531353333203034333331340020300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000075737461720030306973616163730000000000000000000000000000000000000000000000000000737461666600000000000000000000000000000000000000000000000000000030303030303020003030303030302000722f652f612f6c2f6c2f792f2d2f642f652f652f702f2d2f662f6f2f6c2f642f652f722f2d2f702f612f742f680000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - , { cksumValid: true, - path: 'r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' - , mode: 420 - , uid: 24561 - , gid: 20 - , size: 100 - , mtime: 1319687003 - , cksum: 18124 - , type: '0' - , linkpath: '' - , ustar: 'ustar\0' - , ustarver: '00' - , uname: 'isaacs' - , gname: 'staff' - , devmaj: 0 - , devmin: 0 - , fill: '' } - ] - } - -tap.test("parsing", function (t) { - Object.keys(headers).forEach(function (name) { - var h = headers[name] - , header = new Buffer(h[0], "hex") - , expect = h[1] - , parsed = new TarHeader(header) - - // console.error(parsed) - t.has(parsed, expect, "parse " + name) - }) - t.end() -}) - -tap.test("encoding", function (t) { - Object.keys(headers).forEach(function (name) { - var h = headers[name] - , expect = new Buffer(h[0], "hex") - , encoded = TarHeader.encode(h[1]) - - // might have slightly different bytes, since the standard - // isn't very strict, but should have the same semantics - // checkSum will be different, but cksumValid will be true - - var th = new TarHeader(encoded) - delete h[1].block - delete h[1].needExtended - delete h[1].cksum - t.has(th, h[1], "fields "+name) - }) - t.end() -}) - -// test these manually. they're a bit rare to find in the wild -tap.test("parseNumeric tests", function (t) { - var parseNumeric = TarHeader.parseNumeric - , numbers = - { "303737373737373700": 2097151 - , "30373737373737373737373700": 8589934591 - , "303030303036343400": 420 - , "800000ffffffffffff": 281474976710655 - , "ffffff000000000001": -281474976710654 - , "ffffff000000000000": -281474976710655 - , "800000000000200000": 2097152 - , "8000000000001544c5": 1393861 - , "ffffffffffff1544c5": -15383354 } - Object.keys(numbers).forEach(function (n) { - var b = new Buffer(n, "hex") - t.equal(parseNumeric(b), numbers[n], n + " === " + numbers[n]) - }) - t.end() -}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/test/pack-no-proprietary.js b/deps/npm/node_modules/node-gyp/node_modules/tar/test/pack-no-proprietary.js deleted file mode 100644 index d4b03a1fe936be..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/tar/test/pack-no-proprietary.js +++ /dev/null @@ -1,886 +0,0 @@ -// This is exactly like test/pack.js, except that it's excluding -// any proprietary headers. -// -// This loses some information about the filesystem, but creates -// tarballs that are supported by more versions of tar, especially -// old non-spec-compliant copies of gnutar. - -// the symlink file is excluded from git, because it makes -// windows freak the hell out. -var fs = require("fs") - , path = require("path") - , symlink = path.resolve(__dirname, "fixtures/symlink") -try { fs.unlinkSync(symlink) } catch (e) {} -fs.symlinkSync("./hardlink-1", symlink) -process.on("exit", function () { - fs.unlinkSync(symlink) -}) - -var tap = require("tap") - , tar = require("../tar.js") - , pkg = require("../package.json") - , Pack = tar.Pack - , fstream = require("fstream") - , Reader = fstream.Reader - , Writer = fstream.Writer - , input = path.resolve(__dirname, "fixtures/") - , target = path.resolve(__dirname, "tmp/pack.tar") - , uid = process.getuid ? process.getuid() : 0 - , gid = process.getgid ? process.getgid() : 0 - - , entries = - - // the global header and root fixtures/ dir are going to get - // a different date each time, so omit that bit. - // Also, dev/ino values differ across machines, so that's not - // included. - [ [ 'entry', - { path: 'fixtures/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'extendedHeader', - { path: 'PaxHeader/fixtures/200cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - mode: 420, - uid: uid, - gid: gid, - type: 'x', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' }, - { path: 'fixtures/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - uid: uid, - gid: gid, - size: 200 } ] - - , [ 'entry', - { path: 'fixtures/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - mode: 420, - uid: uid, - gid: gid, - size: 200, - type: '0', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/a.txt', - mode: 420, - uid: uid, - gid: gid, - size: 257, - type: '0', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/b.txt', - mode: 420, - uid: uid, - gid: gid, - size: 512, - type: '0', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/c.txt', - mode: 420, - uid: uid, - gid: gid, - size: 513, - type: '0', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/cc.txt', - mode: 420, - uid: uid, - gid: gid, - size: 513, - type: '0', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/dir/', - mode: 488, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/dir/sub/', - mode: 488, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/foo.js', - mode: 420, - uid: uid, - gid: gid, - size: 4, - type: '0', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/hardlink-1', - mode: 420, - uid: uid, - gid: gid, - size: 200, - type: '0', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/hardlink-2', - mode: 420, - uid: uid, - gid: gid, - size: 0, - type: '1', - linkpath: 'fixtures/hardlink-1', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/omega.txt', - mode: 420, - uid: uid, - gid: gid, - size: 2, - type: '0', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/packtest/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/packtest/omega.txt', - mode: 420, - uid: uid, - gid: gid, - size: 2, - type: '0', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/packtest/star.4.html', - mode: 420, - uid: uid, - gid: gid, - size: 54081, - type: '0', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'extendedHeader', - { path: 'PaxHeader/fixtures/packtest/Ω.txt', - mode: 420, - uid: uid, - gid: gid, - type: 'x', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' }, - { path: 'fixtures/packtest/Ω.txt', - uid: uid, - gid: gid, - size: 2 } ] - - , [ 'entry', - { path: 'fixtures/packtest/Ω.txt', - mode: 420, - uid: uid, - gid: gid, - size: 2, - type: '0', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - mode: 420, - uid: uid, - gid: gid, - size: 100, - type: '0', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/symlink', - uid: uid, - gid: gid, - size: 0, - type: '2', - linkpath: 'hardlink-1', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'extendedHeader', - { path: 'PaxHeader/fixtures/Ω.txt', - mode: 420, - uid: uid, - gid: gid, - type: 'x', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' }, - { path: "fixtures/Ω.txt" - , uid: uid - , gid: gid - , size: 2 } ] - - , [ 'entry', - { path: 'fixtures/Ω.txt', - mode: 420, - uid: uid, - gid: gid, - size: 2, - type: '0', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - ] - - -// first, make sure that the hardlinks are actually hardlinks, or this -// won't work. Git has a way of replacing them with a copy. -var hard1 = path.resolve(__dirname, "fixtures/hardlink-1") - , hard2 = path.resolve(__dirname, "fixtures/hardlink-2") - , fs = require("fs") - -try { fs.unlinkSync(hard2) } catch (e) {} -fs.linkSync(hard1, hard2) - -tap.test("with global header", { timeout: 10000 }, function (t) { - runTest(t, true) -}) - -tap.test("without global header", { timeout: 10000 }, function (t) { - runTest(t, false) -}) - -function alphasort (a, b) { - return a === b ? 0 - : a.toLowerCase() > b.toLowerCase() ? 1 - : a.toLowerCase() < b.toLowerCase() ? -1 - : a > b ? 1 - : -1 -} - - -function runTest (t, doGH) { - var reader = Reader({ path: input - , filter: function () { - return !this.path.match(/\.(tar|hex)$/) - } - , sort: alphasort - }) - - var props = doGH ? pkg : {} - props.noProprietary = true - var pack = Pack(props) - var writer = Writer(target) - - // global header should be skipped regardless, since it has no content. - var entry = 0 - - t.ok(reader, "reader ok") - t.ok(pack, "pack ok") - t.ok(writer, "writer ok") - - pack.pipe(writer) - - var parse = tar.Parse() - t.ok(parse, "parser should be ok") - - pack.on("data", function (c) { - // console.error("PACK DATA") - if (c.length !== 512) { - // this one is too noisy, only assert if it'll be relevant - t.equal(c.length, 512, "parser should emit data in 512byte blocks") - } - parse.write(c) - }) - - pack.on("end", function () { - // console.error("PACK END") - t.pass("parser ends") - parse.end() - }) - - pack.on("error", function (er) { - t.fail("pack error", er) - }) - - parse.on("error", function (er) { - t.fail("parse error", er) - }) - - writer.on("error", function (er) { - t.fail("writer error", er) - }) - - reader.on("error", function (er) { - t.fail("reader error", er) - }) - - parse.on("*", function (ev, e) { - var wanted = entries[entry++] - if (!wanted) { - t.fail("unexpected event: "+ev) - return - } - t.equal(ev, wanted[0], "event type should be "+wanted[0]) - - if (ev !== wanted[0] || e.path !== wanted[1].path) { - console.error("wanted", wanted) - console.error([ev, e.props]) - e.on("end", function () { - console.error(e.fields) - throw "break" - }) - } - - t.has(e.props, wanted[1], "properties "+wanted[1].path) - if (wanted[2]) { - e.on("end", function () { - if (!e.fields) { - t.ok(e.fields, "should get fields") - } else { - t.has(e.fields, wanted[2], "should get expected fields") - } - }) - } - }) - - reader.pipe(pack) - - writer.on("close", function () { - t.equal(entry, entries.length, "should get all expected entries") - t.pass("it finished") - t.end() - }) - -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/test/pack.js b/deps/npm/node_modules/node-gyp/node_modules/tar/test/pack.js deleted file mode 100644 index bf033c12987862..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/tar/test/pack.js +++ /dev/null @@ -1,934 +0,0 @@ - -// the symlink file is excluded from git, because it makes -// windows freak the hell out. -var fs = require("fs") - , path = require("path") - , symlink = path.resolve(__dirname, "fixtures/symlink") -try { fs.unlinkSync(symlink) } catch (e) {} -fs.symlinkSync("./hardlink-1", symlink) -process.on("exit", function () { - fs.unlinkSync(symlink) -}) - - -var tap = require("tap") - , tar = require("../tar.js") - , pkg = require("../package.json") - , Pack = tar.Pack - , fstream = require("fstream") - , Reader = fstream.Reader - , Writer = fstream.Writer - , input = path.resolve(__dirname, "fixtures/") - , target = path.resolve(__dirname, "tmp/pack.tar") - , uid = process.getuid ? process.getuid() : 0 - , gid = process.getgid ? process.getgid() : 0 - - , entries = - - // the global header and root fixtures/ dir are going to get - // a different date each time, so omit that bit. - // Also, dev/ino values differ across machines, so that's not - // included. - [ [ 'globalExtendedHeader', - { path: 'PaxHeader/', - mode: 438, - uid: 0, - gid: 0, - type: 'g', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' }, - { "NODETAR.author": pkg.author, - "NODETAR.name": pkg.name, - "NODETAR.description": pkg.description, - "NODETAR.version": pkg.version, - "NODETAR.repository.type": pkg.repository.type, - "NODETAR.repository.url": pkg.repository.url, - "NODETAR.main": pkg.main, - "NODETAR.scripts.test": pkg.scripts.test } ] - - , [ 'entry', - { path: 'fixtures/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'extendedHeader', - { path: 'PaxHeader/fixtures/200cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - mode: 420, - uid: uid, - gid: gid, - type: 'x', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' }, - { path: 'fixtures/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - 'NODETAR.depth': '1', - 'NODETAR.type': 'File', - nlink: 1, - uid: uid, - gid: gid, - size: 200, - 'NODETAR.blksize': '4096', - 'NODETAR.blocks': '8' } ] - - , [ 'entry', - { path: 'fixtures/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - mode: 420, - uid: uid, - gid: gid, - size: 200, - type: '0', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '', - 'NODETAR.depth': '1', - 'NODETAR.type': 'File', - nlink: 1, - 'NODETAR.blksize': '4096', - 'NODETAR.blocks': '8' } ] - - , [ 'entry', - { path: 'fixtures/a.txt', - mode: 420, - uid: uid, - gid: gid, - size: 257, - type: '0', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/b.txt', - mode: 420, - uid: uid, - gid: gid, - size: 512, - type: '0', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/c.txt', - mode: 420, - uid: uid, - gid: gid, - size: 513, - type: '0', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/cc.txt', - mode: 420, - uid: uid, - gid: gid, - size: 513, - type: '0', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/dir/', - mode: 488, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/dir/sub/', - mode: 488, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - - , [ 'entry', - { path: 'fixtures/foo.js', - mode: 420, - uid: uid, - gid: gid, - size: 4, - type: '0', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/hardlink-1', - mode: 420, - uid: uid, - gid: gid, - size: 200, - type: '0', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/hardlink-2', - mode: 420, - uid: uid, - gid: gid, - size: 0, - type: '1', - linkpath: 'fixtures/hardlink-1', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/omega.txt', - mode: 420, - uid: uid, - gid: gid, - size: 2, - type: '0', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/packtest/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/packtest/omega.txt', - mode: 420, - uid: uid, - gid: gid, - size: 2, - type: '0', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/packtest/star.4.html', - mode: 420, - uid: uid, - gid: gid, - size: 54081, - type: '0', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'extendedHeader', - { path: 'PaxHeader/fixtures/packtest/Ω.txt', - mode: 420, - uid: uid, - gid: gid, - type: 'x', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' }, - { path: 'fixtures/packtest/Ω.txt', - 'NODETAR.depth': '2', - 'NODETAR.type': 'File', - nlink: 1, - uid: uid, - gid: gid, - size: 2, - 'NODETAR.blksize': '4096', - 'NODETAR.blocks': '8' } ] - - , [ 'entry', - { path: 'fixtures/packtest/Ω.txt', - mode: 420, - uid: uid, - gid: gid, - size: 2, - type: '0', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '', - 'NODETAR.depth': '2', - 'NODETAR.type': 'File', - nlink: 1, - 'NODETAR.blksize': '4096', - 'NODETAR.blocks': '8' } ] - - , [ 'entry', - { path: 'fixtures/r/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/', - mode: 493, - uid: uid, - gid: gid, - size: 0, - type: '5', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - mode: 420, - uid: uid, - gid: gid, - size: 100, - type: '0', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'entry', - { path: 'fixtures/symlink', - uid: uid, - gid: gid, - size: 0, - type: '2', - linkpath: 'hardlink-1', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' } ] - - , [ 'extendedHeader', - { path: 'PaxHeader/fixtures/Ω.txt', - mode: 420, - uid: uid, - gid: gid, - type: 'x', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '' }, - { path: "fixtures/Ω.txt" - , "NODETAR.depth": "1" - , "NODETAR.type": "File" - , nlink: 1 - , uid: uid - , gid: gid - , size: 2 - , "NODETAR.blksize": "4096" - , "NODETAR.blocks": "8" } ] - - , [ 'entry', - { path: 'fixtures/Ω.txt', - mode: 420, - uid: uid, - gid: gid, - size: 2, - type: '0', - linkpath: '', - ustar: 'ustar\u0000', - ustarver: '00', - uname: '', - gname: '', - devmaj: 0, - devmin: 0, - fill: '', - 'NODETAR.depth': '1', - 'NODETAR.type': 'File', - nlink: 1, - 'NODETAR.blksize': '4096', - 'NODETAR.blocks': '8' } ] - ] - - -// first, make sure that the hardlinks are actually hardlinks, or this -// won't work. Git has a way of replacing them with a copy. -var hard1 = path.resolve(__dirname, "fixtures/hardlink-1") - , hard2 = path.resolve(__dirname, "fixtures/hardlink-2") - , fs = require("fs") - -try { fs.unlinkSync(hard2) } catch (e) {} -fs.linkSync(hard1, hard2) - -tap.test("with global header", { timeout: 10000 }, function (t) { - runTest(t, true) -}) - -tap.test("without global header", { timeout: 10000 }, function (t) { - runTest(t, false) -}) - -function alphasort (a, b) { - return a === b ? 0 - : a.toLowerCase() > b.toLowerCase() ? 1 - : a.toLowerCase() < b.toLowerCase() ? -1 - : a > b ? 1 - : -1 -} - - -function runTest (t, doGH) { - var reader = Reader({ path: input - , filter: function () { - return !this.path.match(/\.(tar|hex)$/) - } - , sort: alphasort - }) - - var pack = Pack(doGH ? pkg : null) - var writer = Writer(target) - - // skip the global header if we're not doing that. - var entry = doGH ? 0 : 1 - - t.ok(reader, "reader ok") - t.ok(pack, "pack ok") - t.ok(writer, "writer ok") - - pack.pipe(writer) - - var parse = tar.Parse() - t.ok(parse, "parser should be ok") - - pack.on("data", function (c) { - // console.error("PACK DATA") - if (c.length !== 512) { - // this one is too noisy, only assert if it'll be relevant - t.equal(c.length, 512, "parser should emit data in 512byte blocks") - } - parse.write(c) - }) - - pack.on("end", function () { - // console.error("PACK END") - t.pass("parser ends") - parse.end() - }) - - pack.on("error", function (er) { - t.fail("pack error", er) - }) - - parse.on("error", function (er) { - t.fail("parse error", er) - }) - - writer.on("error", function (er) { - t.fail("writer error", er) - }) - - reader.on("error", function (er) { - t.fail("reader error", er) - }) - - parse.on("*", function (ev, e) { - var wanted = entries[entry++] - if (!wanted) { - t.fail("unexpected event: "+ev) - return - } - t.equal(ev, wanted[0], "event type should be "+wanted[0]) - - if (ev !== wanted[0] || e.path !== wanted[1].path) { - console.error("wanted", wanted) - console.error([ev, e.props]) - e.on("end", function () { - console.error(e.fields) - throw "break" - }) - } - - - t.has(e.props, wanted[1], "properties "+wanted[1].path) - if (wanted[2]) { - e.on("end", function () { - if (!e.fields) { - t.ok(e.fields, "should get fields") - } else { - t.has(e.fields, wanted[2], "should get expected fields") - } - }) - } - }) - - reader.pipe(pack) - - writer.on("close", function () { - t.equal(entry, entries.length, "should get all expected entries") - t.pass("it finished") - t.end() - }) - -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/test/parse.js b/deps/npm/node_modules/node-gyp/node_modules/tar/test/parse.js deleted file mode 100644 index f765a50129bff1..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/tar/test/parse.js +++ /dev/null @@ -1,359 +0,0 @@ -var tap = require("tap") - , tar = require("../tar.js") - , fs = require("fs") - , path = require("path") - , file = path.resolve(__dirname, "fixtures/c.tar") - , index = 0 - - , expect = -[ [ 'entry', - { path: 'c.txt', - mode: 420, - uid: 24561, - gid: 20, - size: 513, - mtime: new Date('Wed, 26 Oct 2011 01:10:58 GMT'), - cksum: 5422, - type: '0', - linkpath: '', - ustar: 'ustar\0', - ustarver: '00', - uname: 'isaacs', - gname: 'staff', - devmaj: 0, - devmin: 0, - fill: '' }, - undefined ], - [ 'entry', - { path: 'cc.txt', - mode: 420, - uid: 24561, - gid: 20, - size: 513, - mtime: new Date('Wed, 26 Oct 2011 01:11:02 GMT'), - cksum: 5525, - type: '0', - linkpath: '', - ustar: 'ustar\0', - ustarver: '00', - uname: 'isaacs', - gname: 'staff', - devmaj: 0, - devmin: 0, - fill: '' }, - undefined ], - [ 'entry', - { path: 'r/e/a/l/l/y/-/d/e/e/p/-/f/o/l/d/e/r/-/p/a/t/h/cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - mode: 420, - uid: 24561, - gid: 20, - size: 100, - mtime: new Date('Thu, 27 Oct 2011 03:43:23 GMT'), - cksum: 18124, - type: '0', - linkpath: '', - ustar: 'ustar\0', - ustarver: '00', - uname: 'isaacs', - gname: 'staff', - devmaj: 0, - devmin: 0, - fill: '' }, - undefined ], - [ 'entry', - { path: 'Ω.txt', - mode: 420, - uid: 24561, - gid: 20, - size: 2, - mtime: new Date('Thu, 27 Oct 2011 17:51:49 GMT'), - cksum: 5695, - type: '0', - linkpath: '', - ustar: 'ustar\0', - ustarver: '00', - uname: 'isaacs', - gname: 'staff', - devmaj: 0, - devmin: 0, - fill: '' }, - undefined ], - [ 'extendedHeader', - { path: 'PaxHeader/Ω.txt', - mode: 420, - uid: 24561, - gid: 20, - size: 120, - mtime: new Date('Thu, 27 Oct 2011 17:51:49 GMT'), - cksum: 6702, - type: 'x', - linkpath: '', - ustar: 'ustar\0', - ustarver: '00', - uname: 'isaacs', - gname: 'staff', - devmaj: 0, - devmin: 0, - fill: '' }, - { path: 'Ω.txt', - ctime: 1319737909, - atime: 1319739061, - dev: 234881026, - ino: 51693379, - nlink: 1 } ], - [ 'entry', - { path: 'Ω.txt', - mode: 420, - uid: 24561, - gid: 20, - size: 2, - mtime: new Date('Thu, 27 Oct 2011 17:51:49 GMT'), - cksum: 5695, - type: '0', - linkpath: '', - ustar: 'ustar\0', - ustarver: '00', - uname: 'isaacs', - gname: 'staff', - devmaj: 0, - devmin: 0, - fill: '', - ctime: new Date('Thu, 27 Oct 2011 17:51:49 GMT'), - atime: new Date('Thu, 27 Oct 2011 18:11:01 GMT'), - dev: 234881026, - ino: 51693379, - nlink: 1 }, - undefined ], - [ 'extendedHeader', - { path: 'PaxHeader/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - mode: 420, - uid: 24561, - gid: 20, - size: 353, - mtime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'), - cksum: 14488, - type: 'x', - linkpath: '', - ustar: 'ustar\0', - ustarver: '00', - uname: 'isaacs', - gname: 'staff', - devmaj: 0, - devmin: 0, - fill: '' }, - { path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - ctime: 1319686868, - atime: 1319741254, - 'LIBARCHIVE.creationtime': '1319686852', - dev: 234881026, - ino: 51681874, - nlink: 1 } ], - [ 'entry', - { path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - mode: 420, - uid: 24561, - gid: 20, - size: 200, - mtime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'), - cksum: 14570, - type: '0', - linkpath: '', - ustar: 'ustar\0', - ustarver: '00', - uname: 'isaacs', - gname: 'staff', - devmaj: 0, - devmin: 0, - fill: '', - ctime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'), - atime: new Date('Thu, 27 Oct 2011 18:47:34 GMT'), - 'LIBARCHIVE.creationtime': '1319686852', - dev: 234881026, - ino: 51681874, - nlink: 1 }, - undefined ], - [ 'longPath', - { path: '././@LongLink', - mode: 0, - uid: 0, - gid: 0, - size: 201, - mtime: new Date('Thu, 01 Jan 1970 00:00:00 GMT'), - cksum: 4976, - type: 'L', - linkpath: '', - ustar: false }, - '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' ], - [ 'entry', - { path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - mode: 420, - uid: 1000, - gid: 1000, - size: 201, - mtime: new Date('Thu, 27 Oct 2011 22:21:50 GMT'), - cksum: 14086, - type: '0', - linkpath: '', - ustar: false }, - undefined ], - [ 'longLinkpath', - { path: '././@LongLink', - mode: 0, - uid: 0, - gid: 0, - size: 201, - mtime: new Date('Thu, 01 Jan 1970 00:00:00 GMT'), - cksum: 4975, - type: 'K', - linkpath: '', - ustar: false }, - '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' ], - [ 'longPath', - { path: '././@LongLink', - mode: 0, - uid: 0, - gid: 0, - size: 201, - mtime: new Date('Thu, 01 Jan 1970 00:00:00 GMT'), - cksum: 4976, - type: 'L', - linkpath: '', - ustar: false }, - '200LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL' ], - [ 'entry', - { path: '200LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL', - mode: 511, - uid: 1000, - gid: 1000, - size: 0, - mtime: new Date('Fri, 28 Oct 2011 23:05:17 GMT'), - cksum: 21603, - type: '2', - linkpath: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - ustar: false }, - undefined ], - [ 'extendedHeader', - { path: 'PaxHeader/200-hard', - mode: 420, - uid: 24561, - gid: 20, - size: 143, - mtime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'), - cksum: 6533, - type: 'x', - linkpath: '', - ustar: 'ustar\0', - ustarver: '00', - uname: 'isaacs', - gname: 'staff', - devmaj: 0, - devmin: 0, - fill: '' }, - { ctime: 1320617144, - atime: 1320617232, - 'LIBARCHIVE.creationtime': '1319686852', - dev: 234881026, - ino: 51681874, - nlink: 2 } ], - [ 'entry', - { path: '200-hard', - mode: 420, - uid: 24561, - gid: 20, - size: 200, - mtime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'), - cksum: 5526, - type: '0', - linkpath: '', - ustar: 'ustar\0', - ustarver: '00', - uname: 'isaacs', - gname: 'staff', - devmaj: 0, - devmin: 0, - fill: '', - ctime: new Date('Sun, 06 Nov 2011 22:05:44 GMT'), - atime: new Date('Sun, 06 Nov 2011 22:07:12 GMT'), - 'LIBARCHIVE.creationtime': '1319686852', - dev: 234881026, - ino: 51681874, - nlink: 2 }, - undefined ], - [ 'extendedHeader', - { path: 'PaxHeader/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - mode: 420, - uid: 24561, - gid: 20, - size: 353, - mtime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'), - cksum: 14488, - type: 'x', - linkpath: '', - ustar: 'ustar\0', - ustarver: '00', - uname: 'isaacs', - gname: 'staff', - devmaj: 0, - devmin: 0, - fill: '' }, - { path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - ctime: 1320617144, - atime: 1320617406, - 'LIBARCHIVE.creationtime': '1319686852', - dev: 234881026, - ino: 51681874, - nlink: 2 } ], - [ 'entry', - { path: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - mode: 420, - uid: 24561, - gid: 20, - size: 0, - mtime: new Date('Thu, 27 Oct 2011 03:41:08 GMT'), - cksum: 15173, - type: '1', - linkpath: '200-hard', - ustar: 'ustar\0', - ustarver: '00', - uname: 'isaacs', - gname: 'staff', - devmaj: 0, - devmin: 0, - fill: '', - ctime: new Date('Sun, 06 Nov 2011 22:05:44 GMT'), - atime: new Date('Sun, 06 Nov 2011 22:10:06 GMT'), - 'LIBARCHIVE.creationtime': '1319686852', - dev: 234881026, - ino: 51681874, - nlink: 2 }, - undefined ] ] - - -tap.test("parser test", function (t) { - var parser = tar.Parse() - - parser.on("end", function () { - t.equal(index, expect.length, "saw all expected events") - t.end() - }) - - fs.createReadStream(file) - .pipe(parser) - .on("*", function (ev, entry) { - var wanted = expect[index] - if (!wanted) { - return t.fail("Unexpected event: " + ev) - } - var result = [ev, entry.props] - entry.on("end", function () { - result.push(entry.fields || entry.body) - - t.equal(ev, wanted[0], index + " event type") - t.equivalent(entry.props, wanted[1], wanted[1].path + " entry properties") - if (wanted[2]) { - t.equivalent(result[2], wanted[2], "metadata values") - } - index ++ - }) - }) -}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/tar/test/zz-cleanup.js b/deps/npm/node_modules/node-gyp/node_modules/tar/test/zz-cleanup.js deleted file mode 100644 index a00ff7faa03906..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/tar/test/zz-cleanup.js +++ /dev/null @@ -1,20 +0,0 @@ -// clean up the fixtures - -var tap = require("tap") -, rimraf = require("rimraf") -, test = tap.test -, path = require("path") - -test("clean fixtures", function (t) { - rimraf(path.resolve(__dirname, "fixtures"), function (er) { - t.ifError(er, "rimraf ./fixtures/") - t.end() - }) -}) - -test("clean tmp", function (t) { - rimraf(path.resolve(__dirname, "tmp"), function (er) { - t.ifError(er, "rimraf ./tmp/") - t.end() - }) -}) diff --git a/deps/npm/node_modules/node-gyp/package.json b/deps/npm/node_modules/node-gyp/package.json index 76fc168f2d955d..bbbc22ce91b18a 100644 --- a/deps/npm/node_modules/node-gyp/package.json +++ b/deps/npm/node_modules/node-gyp/package.json @@ -1,32 +1,57 @@ { - "name": "node-gyp", - "description": "Node.js native addon build tool", - "license": "MIT", - "keywords": [ - "native", - "addon", - "module", - "c", - "c++", - "bindings", - "gyp" + "_args": [ + [ + "node-gyp@3.3.1", + "/Users/rebecca/code/npm" + ] ], - "version": "3.0.3", - "installVersion": 9, + "_from": "node-gyp@3.3.1", + "_id": "node-gyp@3.3.1", + "_inCache": true, + "_installable": true, + "_location": "/node-gyp", + "_nodeVersion": "6.0.0-pre", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/node-gyp-3.3.1.tgz_1457115144174_0.4018901875242591" + }, + "_npmUser": { + "email": "info@bnoordhuis.nl", + "name": "bnoordhuis" + }, + "_npmVersion": "3.3.12", + "_phantomChildren": { + "inflight": "1.0.4", + "inherits": "2.0.1", + "once": "1.3.3" + }, + "_requested": { + "name": "node-gyp", + "raw": "node-gyp@3.3.1", + "rawSpec": "3.3.1", + "scope": null, + "spec": "3.3.1", + "type": "version" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.3.1.tgz", + "_shasum": "80f7b6d7c2f9c0495ba42c518a670c99bdf6e4a0", + "_shrinkwrap": null, + "_spec": "node-gyp@3.3.1", + "_where": "/Users/rebecca/code/npm", "author": { - "name": "Nathan Rajlich", "email": "nathan@tootallnate.net", + "name": "Nathan Rajlich", "url": "http://tootallnate.net" }, - "repository": { - "type": "git", - "url": "git://github.com/nodejs/node-gyp.git" - }, - "preferGlobal": true, "bin": { "node-gyp": "./bin/node-gyp.js" }, - "main": "./lib/node-gyp.js", + "bugs": { + "url": "https://github.com/nodejs/node-gyp/issues" + }, "dependencies": { "fstream": "^1.0.0", "glob": "3 || 4", @@ -34,65 +59,77 @@ "minimatch": "1", "mkdirp": "^0.5.0", "nopt": "2 || 3", - "npmlog": "0 || 1", + "npmlog": "0 || 1 || 2", "osenv": "0", "path-array": "^1.0.0", "request": "2", "rimraf": "2", "semver": "2.x || 3.x || 4 || 5", - "tar": "^1.0.0", + "tar": "^2.0.0", "which": "1" }, - "engines": { - "node": ">= 0.8.0" - }, + "description": "Node.js native addon build tool", "devDependencies": { "tape": "~4.2.0" }, - "scripts": { - "test": "tape test/test-*" - }, - "gitHead": "d6b03851d366c7fa78e7d2f57c61bb074ea45ea3", - "bugs": { - "url": "https://github.com/nodejs/node-gyp/issues" + "directories": {}, + "dist": { + "shasum": "80f7b6d7c2f9c0495ba42c518a670c99bdf6e4a0", + "tarball": "http://registry.npmjs.org/node-gyp/-/node-gyp-3.3.1.tgz" }, - "homepage": "https://github.com/nodejs/node-gyp", - "_id": "node-gyp@3.0.3", - "_shasum": "9b004219f4fa9efbfd78c5fc674aa12e58fb8694", - "_from": "node-gyp@3.0.3", - "_npmVersion": "2.14.2", - "_nodeVersion": "4.0.0", - "_npmUser": { - "name": "rvagg", - "email": "rod@vagg.org" + "engines": { + "node": ">= 0.8.0" }, + "gitHead": "1dcf356ca7b658789447108b29a985c00ffcf0f5", + "homepage": "https://github.com/nodejs/node-gyp#readme", + "installVersion": 9, + "keywords": [ + "native", + "addon", + "module", + "c", + "c++", + "bindings", + "gyp" + ], + "license": "MIT", + "main": "./lib/node-gyp.js", "maintainers": [ { - "name": "TooTallNate", - "email": "nathan@tootallnate.net" + "email": "nathan@tootallnate.net", + "name": "TooTallNate" }, { - "name": "fishrock123", - "email": "fishrock123@rocketmail.com" + "email": "info@bnoordhuis.nl", + "name": "bnoordhuis" }, { - "name": "isaacs", - "email": "isaacs@npmjs.com" + "email": "fishrock123@rocketmail.com", + "name": "fishrock123" }, { - "name": "rvagg", - "email": "rod@vagg.org" + "email": "i@izs.me", + "name": "isaacs" }, { - "name": "tootallnate", - "email": "nathan@tootallnate.net" + "email": "rod@vagg.org", + "name": "rvagg" + }, + { + "email": "nathan@tootallnate.net", + "name": "tootallnate" } ], - "dist": { - "shasum": "9b004219f4fa9efbfd78c5fc674aa12e58fb8694", - "tarball": "http://registry.npmjs.org/node-gyp/-/node-gyp-3.0.3.tgz" + "name": "node-gyp", + "optionalDependencies": {}, + "preferGlobal": true, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/nodejs/node-gyp.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.0.3.tgz", - "readme": "ERROR: No README data found!" + "scripts": { + "test": "tape test/test-*" + }, + "version": "3.3.1" } diff --git a/deps/npm/node_modules/node-gyp/src/win_delay_load_hook.c b/deps/npm/node_modules/node-gyp/src/win_delay_load_hook.c index f397cfa195e448..b1e170aa13bd95 100644 --- a/deps/npm/node_modules/node-gyp/src/win_delay_load_hook.c +++ b/deps/npm/node_modules/node-gyp/src/win_delay_load_hook.c @@ -9,7 +9,10 @@ #ifdef _MSC_VER +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif + #include #include diff --git a/deps/npm/node_modules/node-gyp/test/docker.sh b/deps/npm/node_modules/node-gyp/test/docker.sh index b64b79a3769186..ac21aa8d75c989 100755 --- a/deps/npm/node_modules/node-gyp/test/docker.sh +++ b/deps/npm/node_modules/node-gyp/test/docker.sh @@ -2,9 +2,11 @@ #set -e -test_node_versions="0.8.28 0.10.40 0.12.7" +test_node_versions="0.8.28 0.10.40 0.12.7 4.3.0 5.6.0" test_iojs_versions="1.8.4 2.4.0 3.3.0" +myuid=$(id -u) +mygid=$(id -g) __dirname="$(CDPATH= cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" dot_node_gyp=${__dirname}/.node-gyp/ @@ -41,6 +43,7 @@ run_tests() { /bin/su -s /bin/bash node-gyp -c 'cd && ${run_cmd}'" rm -rf $dot_node_gyp + mkdir $dot_node_gyp docker run \ --rm -i \ @@ -52,10 +55,10 @@ run_tests() { # A base image with build tools and a user account setup_container "node-gyp-test/base" "ubuntu:14.04" " + adduser --gecos node-gyp --home /node-gyp/ --disabled-login node-gyp --uid $myuid && + echo "node-gyp:node-gyp" | chpasswd && apt-get update && - apt-get install -y build-essential python git rsync curl && - adduser --gecos node-gyp --home /node-gyp/ --disabled-login node-gyp && - echo "node-gyp:node-gyp" | chpasswd + apt-get install -y build-essential python git rsync curl " # An image on top of the base containing clones of repos we want to use for testing @@ -111,7 +114,9 @@ test_download_node_version() { test_download_node_version "0.12.7" "0.10.30/src" "0.10.30" test_download_node_version "3.3.0" "iojs-1.8.4/src" "1.8.4" # should download the headers file -test_download_node_version "3.3.0" "iojs-3.2.0/include/node" "3.2.0" +test_download_node_version "3.3.0" "iojs-3.3.0/include/node" "3.3.0" +test_download_node_version "4.3.0" "4.3.0/include/node" "4.3.0" +test_download_node_version "5.6.0" "5.6.0/include/node" "5.6.0" # TODO: test --dist-url by starting up a localhost server and serving up tarballs @@ -126,6 +131,7 @@ run_tests "3.3.0" " nc -z localhost 8080 && echo -e \"\\n\\n\\033[31mFAILED TO USE LOCAL PROXY\\033[39m\\n\\n\" " +# REMOVE after next semver-major run_tests "3.3.0" " (node /node-gyp-src/test/simple-proxy.js 8080 /doobar/ https://iojs.org/dist/ &) && cd node-buffertools && @@ -133,6 +139,7 @@ run_tests "3.3.0" " nc -z localhost 8080 && echo -e \"\\n\\n\\033[31mFAILED TO USE LOCAL PROXY\\033[39m\\n\\n\" " +# REMOVE after next semver-major run_tests "0.12.7" " (node /node-gyp-src/test/simple-proxy.js 8080 /boombar/ https://nodejs.org/dist/ &) && cd node-buffertools && @@ -140,4 +147,18 @@ run_tests "0.12.7" " nc -z localhost 8080 && echo -e \"\\n\\n\\033[31mFAILED TO USE LOCAL PROXY\\033[39m\\n\\n\" " +run_tests "3.3.0" " + (node /node-gyp-src/test/simple-proxy.js 8080 /doobar/ https://iojs.org/dist/ &) && + cd node-buffertools && + IOJS_ORG_MIRROR=http://localhost:8080/doobar/ /node-gyp-src/bin/node-gyp.js --loglevel=info rebuild && + nc -z localhost 8080 && echo -e \"\\n\\n\\033[31mFAILED TO USE LOCAL PROXY\\033[39m\\n\\n\" +" + +run_tests "0.12.7" " + (node /node-gyp-src/test/simple-proxy.js 8080 /boombar/ https://nodejs.org/dist/ &) && + cd node-buffertools && + NODEJS_ORG_MIRROR=http://localhost:8080/boombar/ /node-gyp-src/bin/node-gyp.js --loglevel=info rebuild && + nc -z localhost 8080 && echo -e \"\\n\\n\\033[31mFAILED TO USE LOCAL PROXY\\033[39m\\n\\n\" +" + rm -rf $dot_node_gyp diff --git a/deps/npm/node_modules/node-gyp/test/fixtures/ca-bundle.crt b/deps/npm/node_modules/node-gyp/test/fixtures/ca-bundle.crt new file mode 100644 index 00000000000000..fb1dea98a78c84 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/test/fixtures/ca-bundle.crt @@ -0,0 +1,40 @@ +-----BEGIN CERTIFICATE----- +MIIDJjCCAg4CAhnOMA0GCSqGSIb3DQEBBQUAMH0xCzAJBgNVBAYTAlVTMQswCQYD +VQQIDAJDQTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzEZMBcGA1UECgwQU3Ryb25n +TG9vcCwgSW5jLjESMBAGA1UECwwJU3Ryb25nT3BzMRowGAYDVQQDDBFjYS5zdHJv +bmdsb29wLmNvbTAeFw0xNTEyMDgyMzM1MzNaFw00MzA0MjQyMzM1MzNaMBkxFzAV +BgNVBAMMDnN0cm9uZ2xvb3AuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEAwOYI7OZ2FX/YjRgLZoDQlbPc5UZXU/j0e1wwiJNPtPEax9Y5Uoza0Pnt +Ikzkc2SfvQ+IJrhXo385tI0W5juuqbHnE7UrjUuPjUX6NHevkxcs/flmjan5wnZM +cPsGhH71WDuUEEflvZihf2Se2x+xgZtMhc5XGmVmRuZFYKvkgUhA2/w8/QrK+jPT +n9QRJxZjWNh2RBdC1B7u4jffSmOSUljYFH1I2eTeY+Rdi6YUIYSU9gEoZxsv3Tia +SomfMF5jt2Mouo6MzA+IhLvvFjcrcph1Qxgi9RkfdCMMd+Ipm9YWELkyG1bDRpQy +0iyHD4gvVsAqz1Y2KdRSdc3Kt+nTqwIDAQABoxkwFzAVBgNVHREEDjAMhwQAAAAA +hwR/AAABMA0GCSqGSIb3DQEBBQUAA4IBAQAhy4J0hML3NgmDRHdL5/iTucBe22Mf +jJjg2aifD1S187dHm+Il4qZNO2plWwAhN0h704f+8wpsaALxUvBIu6nvlvcMP5PH +jGN5JLe2Km3UaPvYOQU2SgacLilu+uBcIo2JSHLV6O7ziqUj5Gior6YxDLCtEZie +Ea8aX5/YjuACtEMJ1JjRqjgkM66XAoUe0E8onOK3FgTIO3tGoTJwRp0zS50pFuP0 +PsZtT04ck6mmXEXXknNoAyBCvPypfms9OHqcUIW9fiQnrGbS/Ri4QSQYj0DtFk/1 +na4fY1gf3zTHxH8259b/TOOaPfTnCEsOQtjUrWNR4xhmVZ+HJy4yytUW +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDbzCCAlcCAmm6MA0GCSqGSIb3DQEBCwUAMH0xCzAJBgNVBAYTAlVTMQswCQYD +VQQIDAJDQTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzEZMBcGA1UECgwQU3Ryb25n +TG9vcCwgSW5jLjESMBAGA1UECwwJU3Ryb25nT3BzMRowGAYDVQQDDBFjYS5zdHJv +bmdsb29wLmNvbTAeFw0xNTEyMDgyMzM1MzNaFw00MzA0MjQyMzM1MzNaMH0xCzAJ +BgNVBAYTAlVTMQswCQYDVQQIDAJDQTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzEZ +MBcGA1UECgwQU3Ryb25nTG9vcCwgSW5jLjESMBAGA1UECwwJU3Ryb25nT3BzMRow +GAYDVQQDDBFjYS5zdHJvbmdsb29wLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBANfj86jkvvYDjHBgiqWhk9Cj+bqiMq3MqnV0CBO4iuK33Fo6XssE +H+yVdXlIBFbFe6t655MdBVOR2Sfj7WqNh96vhu6PyDHiwcQlTaiLU6nhIed1J4Wv +lvnJHFmp8Wbtx5AgLT4UYu03ftvXEl2DLi3vhSL2tRM1ebXHB/KPbRWkb25DPX0P +foOHot3f2dgNe2x6kponf7E/QDmAu3s7Nlkfh+ryDhgGU7wocXEhXbprNqRqOGNo +xbXgUI+/9XDxYT/7Gn5LF/fPjtN+aB0SKMnTsDhprVlZie83mlqJ46fOOrR+vrsQ +mi/1m/TadrARtZoIExC/cQRdVM05EK4tUa8CAwEAATANBgkqhkiG9w0BAQsFAAOC +AQEAQ7k5WhyhDTIGYCNzRnrMHWSzGqa1y4tJMW06wafJNRqTm1cthq1ibc6Hfq5a +K10K0qMcgauRTfQ1MWrVCTW/KnJ1vkhiTOH+RvxapGn84gSaRmV6KZen0+gMsgae +KEGe/3Hn+PmDVV+PTamHgPACfpTww38WHIe/7Ce9gHfG7MZ8cKHNZhDy0IAYPln+ +YRwMLd7JNQffHAbWb2CE1mcea4H/12U8JZW5tHCF6y9V+7IuDzqwIrLKcW3lG17n +VUG6ODF/Ryqn3V5X+TL91YyXi6c34y34IpC7MQDV/67U7+5Bp5CfeDPWW2wVSrW+ +uGZtfEvhbNm6m2i4UNmpCXxUZQ== +-----END CERTIFICATE----- diff --git a/deps/npm/node_modules/node-gyp/test/fixtures/ca.crt b/deps/npm/node_modules/node-gyp/test/fixtures/ca.crt new file mode 100644 index 00000000000000..9d2755a74f6cde --- /dev/null +++ b/deps/npm/node_modules/node-gyp/test/fixtures/ca.crt @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDbzCCAlcCAmm6MA0GCSqGSIb3DQEBCwUAMH0xCzAJBgNVBAYTAlVTMQswCQYD +VQQIDAJDQTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzEZMBcGA1UECgwQU3Ryb25n +TG9vcCwgSW5jLjESMBAGA1UECwwJU3Ryb25nT3BzMRowGAYDVQQDDBFjYS5zdHJv +bmdsb29wLmNvbTAeFw0xNTEyMDgyMzM1MzNaFw00MzA0MjQyMzM1MzNaMH0xCzAJ +BgNVBAYTAlVTMQswCQYDVQQIDAJDQTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzEZ +MBcGA1UECgwQU3Ryb25nTG9vcCwgSW5jLjESMBAGA1UECwwJU3Ryb25nT3BzMRow +GAYDVQQDDBFjYS5zdHJvbmdsb29wLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBANfj86jkvvYDjHBgiqWhk9Cj+bqiMq3MqnV0CBO4iuK33Fo6XssE +H+yVdXlIBFbFe6t655MdBVOR2Sfj7WqNh96vhu6PyDHiwcQlTaiLU6nhIed1J4Wv +lvnJHFmp8Wbtx5AgLT4UYu03ftvXEl2DLi3vhSL2tRM1ebXHB/KPbRWkb25DPX0P +foOHot3f2dgNe2x6kponf7E/QDmAu3s7Nlkfh+ryDhgGU7wocXEhXbprNqRqOGNo +xbXgUI+/9XDxYT/7Gn5LF/fPjtN+aB0SKMnTsDhprVlZie83mlqJ46fOOrR+vrsQ +mi/1m/TadrARtZoIExC/cQRdVM05EK4tUa8CAwEAATANBgkqhkiG9w0BAQsFAAOC +AQEAQ7k5WhyhDTIGYCNzRnrMHWSzGqa1y4tJMW06wafJNRqTm1cthq1ibc6Hfq5a +K10K0qMcgauRTfQ1MWrVCTW/KnJ1vkhiTOH+RvxapGn84gSaRmV6KZen0+gMsgae +KEGe/3Hn+PmDVV+PTamHgPACfpTww38WHIe/7Ce9gHfG7MZ8cKHNZhDy0IAYPln+ +YRwMLd7JNQffHAbWb2CE1mcea4H/12U8JZW5tHCF6y9V+7IuDzqwIrLKcW3lG17n +VUG6ODF/Ryqn3V5X+TL91YyXi6c34y34IpC7MQDV/67U7+5Bp5CfeDPWW2wVSrW+ +uGZtfEvhbNm6m2i4UNmpCXxUZQ== +-----END CERTIFICATE----- diff --git a/deps/npm/node_modules/node-gyp/test/fixtures/server.crt b/deps/npm/node_modules/node-gyp/test/fixtures/server.crt new file mode 100644 index 00000000000000..fe13bb96c599cf --- /dev/null +++ b/deps/npm/node_modules/node-gyp/test/fixtures/server.crt @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDJjCCAg4CAhnOMA0GCSqGSIb3DQEBBQUAMH0xCzAJBgNVBAYTAlVTMQswCQYD +VQQIDAJDQTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzEZMBcGA1UECgwQU3Ryb25n +TG9vcCwgSW5jLjESMBAGA1UECwwJU3Ryb25nT3BzMRowGAYDVQQDDBFjYS5zdHJv +bmdsb29wLmNvbTAeFw0xNTEyMDgyMzM1MzNaFw00MzA0MjQyMzM1MzNaMBkxFzAV +BgNVBAMMDnN0cm9uZ2xvb3AuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEAwOYI7OZ2FX/YjRgLZoDQlbPc5UZXU/j0e1wwiJNPtPEax9Y5Uoza0Pnt +Ikzkc2SfvQ+IJrhXo385tI0W5juuqbHnE7UrjUuPjUX6NHevkxcs/flmjan5wnZM +cPsGhH71WDuUEEflvZihf2Se2x+xgZtMhc5XGmVmRuZFYKvkgUhA2/w8/QrK+jPT +n9QRJxZjWNh2RBdC1B7u4jffSmOSUljYFH1I2eTeY+Rdi6YUIYSU9gEoZxsv3Tia +SomfMF5jt2Mouo6MzA+IhLvvFjcrcph1Qxgi9RkfdCMMd+Ipm9YWELkyG1bDRpQy +0iyHD4gvVsAqz1Y2KdRSdc3Kt+nTqwIDAQABoxkwFzAVBgNVHREEDjAMhwQAAAAA +hwR/AAABMA0GCSqGSIb3DQEBBQUAA4IBAQAhy4J0hML3NgmDRHdL5/iTucBe22Mf +jJjg2aifD1S187dHm+Il4qZNO2plWwAhN0h704f+8wpsaALxUvBIu6nvlvcMP5PH +jGN5JLe2Km3UaPvYOQU2SgacLilu+uBcIo2JSHLV6O7ziqUj5Gior6YxDLCtEZie +Ea8aX5/YjuACtEMJ1JjRqjgkM66XAoUe0E8onOK3FgTIO3tGoTJwRp0zS50pFuP0 +PsZtT04ck6mmXEXXknNoAyBCvPypfms9OHqcUIW9fiQnrGbS/Ri4QSQYj0DtFk/1 +na4fY1gf3zTHxH8259b/TOOaPfTnCEsOQtjUrWNR4xhmVZ+HJy4yytUW +-----END CERTIFICATE----- diff --git a/deps/npm/node_modules/node-gyp/test/fixtures/server.key b/deps/npm/node_modules/node-gyp/test/fixtures/server.key new file mode 100644 index 00000000000000..f8227f4c0c2d43 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/test/fixtures/server.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDA5gjs5nYVf9iN +GAtmgNCVs9zlRldT+PR7XDCIk0+08RrH1jlSjNrQ+e0iTORzZJ+9D4gmuFejfzm0 +jRbmO66psecTtSuNS4+NRfo0d6+TFyz9+WaNqfnCdkxw+waEfvVYO5QQR+W9mKF/ +ZJ7bH7GBm0yFzlcaZWZG5kVgq+SBSEDb/Dz9Csr6M9Of1BEnFmNY2HZEF0LUHu7i +N99KY5JSWNgUfUjZ5N5j5F2LphQhhJT2AShnGy/dOJpKiZ8wXmO3Yyi6jozMD4iE +u+8WNytymHVDGCL1GR90Iwx34imb1hYQuTIbVsNGlDLSLIcPiC9WwCrPVjYp1FJ1 +zcq36dOrAgMBAAECggEACg60Xm2xsHNG/ixHw+NpfLSxCr89JGKxlJD88tIDcOK1 +S8AOoxA3BHhTddteeenALmJV7fbkkuC6SICmtgBcnfppmuxyRd6vsGT6o6ut2tR1 +gxRy1WYMYKg8WhOshlH8RspscODeyKDhorvDUJd5cNGBDuTwQ68PwxiUe3La6iac +EVQoKohg9EmRIhMF1i8I00zXE8p3XENrlTc491ipc+gLPIP5vtqHyQztEUkZHkWd +dXbs+n1hGCr+4FxrphGYEW80HINzmume7dGChr8nvF4ZZcuWW13DJuNim6pQno1i +hM8VdXm8XphLh0XEGI5OCfu/CetkBILZRXKltZk6AQKBgQDoBqJzRlp7regYNU4q +usfS+43tPNaJ0o4DIzcLawqpmK/B/cZStzHl14Sm62BVkKV6cnWAJPeLkENPMFoV +7Q7wLZBJxpPzqXkpeiDkKN4Wovca891Rffne5Sz6IDB5mOxMjfKIEPd5RkmB5Lkp +qQLwm3YJ2AJcLagG/Gi1DFDRAQKBgQDU1G9T43Mjke6TXG0u7gCSb+VwyDRsrvJA +u2vy6+MANRc1EEF31YLmTKOU5XxUmhtIu7TUbgPoNi0HuRFXx4Zul3BPlAosLMJv +kNQbA/9d0YQAfSgTsploN5CX65dLZ4ejIzVgDZREzpIBWTze6YZTA2DT5iOIet84 +DD5DujY4qwKBgG0PuUo/9oYOD3tZiv1wwD5+uY6auykbTF9TLStzzBY9y9d+hrsY +mx6zOAoRtz1g+TdeF7b9KVJzo//T9XQ68nuYnyreaWrt7SK+4jj8sK+pOEd1+0Cz +20CXLpX/jWmKpP+y9R5aA0kA7cpdjV90rwoTuN8Vpr5XQ5TNDhaTzGUBAoGABYig +fGXlkH8y3NICZL37ddNC+/O4qTrDQbudyusnM9ItkEuj6CG9DY/gkPaGjQyUuQdo +ZD2YDGmcMh81vDqL3ERDv03yFcP0KkJxwWIRObdA32JhsGFsa7FGKS0O+f7vH+bC +dITl3gQg97gCRSl9PJtR4TCSq/HF7Acld01YK5ECgYEAwLFB5JIuxrowJe74cCMP +n5Rwuc8vWdOsg+ytvQTv0/hVCdzcaLet6YvagnWTWaU7PUwTFxZs/mLQ9CAWVutK +IRzs/GWxGFjH5xotDaJdDDzSdQye4tUqvUVxv7zzzsVycCPBYFkyRQ8Tmr5FLtUJ +Cl48TZ6J8Rx5avjdtOw3QC8= +-----END PRIVATE KEY----- diff --git a/deps/npm/node_modules/node-gyp/test/test-download.js b/deps/npm/node_modules/node-gyp/test/test-download.js new file mode 100644 index 00000000000000..6e6f64f058c2e6 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/test/test-download.js @@ -0,0 +1,102 @@ +'use strict' + +var fs = require('fs') +var http = require('http') +var https = require('https') +var test = require('tape') +var install = require('../lib/install') + +test('download over http', function (t) { + t.plan(2) + + var server = http.createServer(function (req, res) { + t.strictEqual(req.headers['user-agent'], + 'node-gyp v42 (node ' + process.version + ')') + res.end('ok') + server.close() + }) + + var host = '127.0.0.1' + server.listen(0, host, function () { + var port = this.address().port + var gyp = { + opts: {}, + version: '42', + } + var url = 'http://' + host + ':' + port + var req = install.test.download(gyp, {}, url) + req.on('response', function (res) { + var body = '' + res.setEncoding('utf8') + res.on('data', function(data) { + body += data + }) + res.on('end', function() { + t.strictEqual(body, 'ok') + }) + }) + }) +}) + +test('download over https with custom ca', function (t) { + t.plan(3) + + var cert = fs.readFileSync(__dirname + '/fixtures/server.crt', 'utf8') + var key = fs.readFileSync(__dirname + '/fixtures/server.key', 'utf8') + + var cafile = __dirname + '/fixtures/ca.crt' + var ca = install.test.readCAFile(cafile) + t.strictEqual(ca.length, 1) + + var options = { ca: ca, cert: cert, key: key } + var server = https.createServer(options, function (req, res) { + t.strictEqual(req.headers['user-agent'], + 'node-gyp v42 (node ' + process.version + ')') + res.end('ok') + server.close() + }) + + server.on('clientError', function (err) { + throw err + }) + + var host = '127.0.0.1' + server.listen(8000, host, function () { + var port = this.address().port + var gyp = { + opts: { cafile: cafile }, + version: '42', + } + var url = 'https://' + host + ':' + port + var req = install.test.download(gyp, {}, url) + req.on('response', function (res) { + var body = '' + res.setEncoding('utf8') + res.on('data', function(data) { + body += data + }) + res.on('end', function() { + t.strictEqual(body, 'ok') + }) + }) + }) +}) + +test('download with missing cafile', function (t) { + t.plan(1) + var gyp = { + opts: { cafile: 'no.such.file' }, + } + try { + install.test.download(gyp, {}, 'http://bad/') + } catch (e) { + t.ok(/no.such.file/.test(e.message)) + } +}) + +test('check certificate splitting', function (t) { + var cas = install.test.readCAFile(__dirname + '/fixtures/ca-bundle.crt') + t.plan(2) + t.strictEqual(cas.length, 2) + t.notStrictEqual(cas[0], cas[1]) +}) diff --git a/deps/npm/node_modules/node-gyp/test/test-find-node-directory.js b/deps/npm/node_modules/node-gyp/test/test-find-node-directory.js new file mode 100644 index 00000000000000..46659d0cfe8fa2 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/test/test-find-node-directory.js @@ -0,0 +1,115 @@ +var test = require('tape') +var path = require('path') +var findNodeDirectory = require('../lib/find-node-directory') + +var platforms = ['darwin', 'freebsd', 'linux', 'sunos', 'win32', 'aix'] + +// we should find the directory based on the directory +// the script is running in and it should match the layout +// in a build tree where npm is installed in +// .... /deps/npm +test('test find-node-directory - node install', function (t) { + t.plan(platforms.length) + for (var next = 0; next < platforms.length; next++) { + var processObj = {execPath: '/x/y/bin/node', platform: platforms[next]} + t.equal( + findNodeDirectory('/x/deps/npm/node_modules/node-gyp/lib', processObj), + path.join('/x')) + } +}) + +// we should find the directory based on the directory +// the script is running in and it should match the layout +// in an installed tree where npm is installed in +// .... /lib/node_modules/npm or .../node_modules/npm +// depending on the patform +test('test find-node-directory - node build', function (t) { + t.plan(platforms.length) + for (var next = 0; next < platforms.length; next++) { + var processObj = {execPath: '/x/y/bin/node', platform: platforms[next]} + if (platforms[next] === 'win32') { + t.equal( + findNodeDirectory('/y/node_modules/npm/node_modules/node-gyp/lib', + processObj), path.join('/y')) + } else { + t.equal( + findNodeDirectory('/y/lib/node_modules/npm/node_modules/node-gyp/lib', + processObj), path.join('/y')) + } + } +}) + +// we should find the directory based on the execPath +// for node and match because it was in the bin directory +test('test find-node-directory - node in bin directory', function (t) { + t.plan(platforms.length) + for (var next = 0; next < platforms.length; next++) { + var processObj = {execPath: '/x/y/bin/node', platform: platforms[next]} + t.equal( + findNodeDirectory('/nothere/npm/node_modules/node-gyp/lib', processObj), + path.join('/x/y')) + } +}) + +// we should find the directory based on the execPath +// for node and match because it was in the Release directory +test('test find-node-directory - node in build release dir', function (t) { + t.plan(platforms.length) + for (var next = 0; next < platforms.length; next++) { + var processObj + if (platforms[next] === 'win32') { + processObj = {execPath: '/x/y/Release/node', platform: platforms[next]} + } else { + processObj = {execPath: '/x/y/out/Release/node', + platform: platforms[next]} + } + + t.equal( + findNodeDirectory('/nothere/npm/node_modules/node-gyp/lib', processObj), + path.join('/x/y')) + } +}) + +// we should find the directory based on the execPath +// for node and match because it was in the Debug directory +test('test find-node-directory - node in Debug release dir', function (t) { + t.plan(platforms.length) + for (var next = 0; next < platforms.length; next++) { + var processObj + if (platforms[next] === 'win32') { + processObj = {execPath: '/a/b/Debug/node', platform: platforms[next]} + } else { + processObj = {execPath: '/a/b/out/Debug/node', platform: platforms[next]} + } + + t.equal( + findNodeDirectory('/nothere/npm/node_modules/node-gyp/lib', processObj), + path.join('/a/b')) + } +}) + +// we should not find it as it will not match based on the execPath nor +// the directory from which the script is running +test('test find-node-directory - not found', function (t) { + t.plan(platforms.length) + for (var next = 0; next < platforms.length; next++) { + var processObj = {execPath: '/x/y/z/y', platform:next} + t.equal(findNodeDirectory('/a/b/c/d', processObj), '') + } +}) + +// we should find the directory based on the directory +// the script is running in and it should match the layout +// in a build tree where npm is installed in +// .... /deps/npm +// same test as above but make sure additional directory entries +// don't cause an issue +test('test find-node-directory - node install', function (t) { + t.plan(platforms.length) + for (var next = 0; next < platforms.length; next++) { + var processObj = {execPath: '/x/y/bin/node', platform: platforms[next]} + t.equal( + findNodeDirectory('/x/y/z/a/b/c/deps/npm/node_modules/node-gyp/lib', + processObj), path.join('/x/y/z/a/b/c')) + } +}) diff --git a/deps/npm/node_modules/node-gyp/test/test-find-python.js b/deps/npm/node_modules/node-gyp/test/test-find-python.js new file mode 100644 index 00000000000000..7f5c3946794f20 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/test/test-find-python.js @@ -0,0 +1,20 @@ +'use strict' + +var test = require('tape') +var configure = require('../lib/configure') +var execFile = require('child_process').execFile + +test('find python executable', function (t) { + t.plan(4) + + configure.test.findPython('python', function (err, found) { + t.strictEqual(err, null) + var proc = execFile(found, ['-V'], function (err, stdout, stderr) { + t.strictEqual(err, null) + t.strictEqual(stdout, '') + t.ok(/Python 2/.test(stderr)) + }) + proc.stdout.setEncoding('utf-8') + proc.stderr.setEncoding('utf-8') + }) +}) diff --git a/deps/npm/node_modules/node-gyp/test/test-options.js b/deps/npm/node_modules/node-gyp/test/test-options.js new file mode 100644 index 00000000000000..d097f81be62c8f --- /dev/null +++ b/deps/npm/node_modules/node-gyp/test/test-options.js @@ -0,0 +1,25 @@ +'use strict'; + +var test = require('tape') +var gyp = require('../lib/node-gyp') + +test('options in environment', function (t) { + t.plan(1) + + // `npm test` dumps a ton of npm_config_* variables in the environment. + Object.keys(process.env) + .filter(function(key) { return /^npm_config_/.test(key) }) + .forEach(function(key) { delete process.env[key] }) + + // Zero-length keys should get filtered out. + process.env.npm_config_ = '42' + // Other keys should get added. + process.env.npm_config_x = '42' + // Except loglevel. + process.env.npm_config_loglevel = 'debug' + + var g = gyp(); + g.parseArgv(['rebuild']) // Also sets opts.argv. + + t.deepEqual(Object.keys(g.opts).sort(), ['argv', 'x']) +}) diff --git a/deps/npm/node_modules/node-gyp/test/test-process-release.js b/deps/npm/node_modules/node-gyp/test/test-process-release.js index 33655ab726a555..48411ae0a7d5a9 100644 --- a/deps/npm/node_modules/node-gyp/test/test-process-release.js +++ b/deps/npm/node_modules/node-gyp/test/test-process-release.js @@ -45,23 +45,93 @@ test('test process release - process.version = 0.10.21', function (t) { }) }) -test('test process release - process.version = 0.12.22', function (t) { +// prior to -headers.tar.gz +test('test process release - process.version = 0.12.9', function (t) { t.plan(2) - var release = processRelease([], { opts: {} }, 'v0.12.22', null) + var release = processRelease([], { opts: {} }, 'v0.12.9', null) - t.equal(release.semver.version, '0.12.22') + t.equal(release.semver.version, '0.12.9') delete release.semver t.deepEqual(release, { - version: '0.12.22', + version: '0.12.9', name: 'node', - baseUrl: 'https://nodejs.org/dist/v0.12.22/', - tarballUrl: 'https://nodejs.org/dist/v0.12.22/node-v0.12.22.tar.gz', - shasumsUrl: 'https://nodejs.org/dist/v0.12.22/SHASUMS256.txt', - versionDir: '0.12.22', - libUrl32: 'https://nodejs.org/dist/v0.12.22/node.lib', - libUrl64: 'https://nodejs.org/dist/v0.12.22/x64/node.lib', + baseUrl: 'https://nodejs.org/dist/v0.12.9/', + tarballUrl: 'https://nodejs.org/dist/v0.12.9/node-v0.12.9.tar.gz', + shasumsUrl: 'https://nodejs.org/dist/v0.12.9/SHASUMS256.txt', + versionDir: '0.12.9', + libUrl32: 'https://nodejs.org/dist/v0.12.9/node.lib', + libUrl64: 'https://nodejs.org/dist/v0.12.9/x64/node.lib', + libPath32: 'node.lib', + libPath64: 'x64/node.lib' + }) +}) + +// prior to -headers.tar.gz +test('test process release - process.version = 0.10.41', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v0.10.41', null) + + t.equal(release.semver.version, '0.10.41') + delete release.semver + + t.deepEqual(release, { + version: '0.10.41', + name: 'node', + baseUrl: 'https://nodejs.org/dist/v0.10.41/', + tarballUrl: 'https://nodejs.org/dist/v0.10.41/node-v0.10.41.tar.gz', + shasumsUrl: 'https://nodejs.org/dist/v0.10.41/SHASUMS256.txt', + versionDir: '0.10.41', + libUrl32: 'https://nodejs.org/dist/v0.10.41/node.lib', + libUrl64: 'https://nodejs.org/dist/v0.10.41/x64/node.lib', + libPath32: 'node.lib', + libPath64: 'x64/node.lib' + }) +}) + +// has -headers.tar.gz +test('test process release - process.release ~ node@0.10.42', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v0.10.42', null) + + t.equal(release.semver.version, '0.10.42') + delete release.semver + + t.deepEqual(release, { + version: '0.10.42', + name: 'node', + baseUrl: 'https://nodejs.org/dist/v0.10.42/', + tarballUrl: 'https://nodejs.org/dist/v0.10.42/node-v0.10.42-headers.tar.gz', + shasumsUrl: 'https://nodejs.org/dist/v0.10.42/SHASUMS256.txt', + versionDir: '0.10.42', + libUrl32: 'https://nodejs.org/dist/v0.10.42/node.lib', + libUrl64: 'https://nodejs.org/dist/v0.10.42/x64/node.lib', + libPath32: 'node.lib', + libPath64: 'x64/node.lib' + }) +}) + +// has -headers.tar.gz +test('test process release - process.release ~ node@0.12.10', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v0.12.10', null) + + t.equal(release.semver.version, '0.12.10') + delete release.semver + + t.deepEqual(release, { + version: '0.12.10', + name: 'node', + baseUrl: 'https://nodejs.org/dist/v0.12.10/', + tarballUrl: 'https://nodejs.org/dist/v0.12.10/node-v0.12.10-headers.tar.gz', + shasumsUrl: 'https://nodejs.org/dist/v0.12.10/SHASUMS256.txt', + versionDir: '0.12.10', + libUrl32: 'https://nodejs.org/dist/v0.12.10/node.lib', + libUrl64: 'https://nodejs.org/dist/v0.12.10/x64/node.lib', libPath32: 'node.lib', libPath64: 'x64/node.lib' }) @@ -448,3 +518,120 @@ test('test process release - process.release ~ node@4.0.0-rc.4 - bogus string pa libPath64: 'win-x64/node.lib' }) }) + +test('test process release - NODEJS_ORG_MIRROR', function (t) { + t.plan(2) + + process.env.NODEJS_ORG_MIRROR = 'http://foo.bar' + + var release = processRelease([], { opts: {} }, 'v4.1.23', { + name: 'node', + headersUrl: 'https://nodejs.org/dist/v4.1.23/node-v4.1.23-headers.tar.gz' + }) + + t.equal(release.semver.version, '4.1.23') + delete release.semver + + t.deepEqual(release, { + version: '4.1.23', + name: 'node', + baseUrl: 'http://foo.bar/v4.1.23/', + tarballUrl: 'http://foo.bar/v4.1.23/node-v4.1.23-headers.tar.gz', + shasumsUrl: 'http://foo.bar/v4.1.23/SHASUMS256.txt', + versionDir: '4.1.23', + libUrl32: 'http://foo.bar/v4.1.23/win-x86/node.lib', + libUrl64: 'http://foo.bar/v4.1.23/win-x64/node.lib', + libPath32: 'win-x86/node.lib', + libPath64: 'win-x64/node.lib' + }) + + delete process.env.NODEJS_ORG_MIRROR +}) + +test('test process release - NVM_NODEJS_ORG_MIRROR', function (t) { + t.plan(2) + + process.env.NVM_NODEJS_ORG_MIRROR = 'http://foo.bar' + + var release = processRelease([], { opts: {} }, 'v4.1.23', { + name: 'node', + headersUrl: 'https://nodejs.org/dist/v4.1.23/node-v4.1.23-headers.tar.gz' + }) + + t.equal(release.semver.version, '4.1.23') + delete release.semver + + t.deepEqual(release, { + version: '4.1.23', + name: 'node', + baseUrl: 'http://foo.bar/v4.1.23/', + tarballUrl: 'http://foo.bar/v4.1.23/node-v4.1.23-headers.tar.gz', + shasumsUrl: 'http://foo.bar/v4.1.23/SHASUMS256.txt', + versionDir: '4.1.23', + libUrl32: 'http://foo.bar/v4.1.23/win-x86/node.lib', + libUrl64: 'http://foo.bar/v4.1.23/win-x64/node.lib', + libPath32: 'win-x86/node.lib', + libPath64: 'win-x64/node.lib' + }) + + delete process.env.NVM_NODEJS_ORG_MIRROR +}) + +test('test process release - IOJS_ORG_MIRROR', function (t) { + t.plan(2) + + process.env.IOJS_ORG_MIRROR = 'http://foo.bar' + + var release = processRelease([], { opts: {} }, 'v3.2.24', { + name: 'io.js', + headersUrl: 'https://iojs.org/download/release/v3.2.24/iojs-v3.2.24-headers.tar.gz' + }) + + t.equal(release.semver.version, '3.2.24') + delete release.semver + + t.deepEqual(release, { + version: '3.2.24', + name: 'iojs', + baseUrl: 'http://foo.bar/v3.2.24/', + tarballUrl: 'http://foo.bar/v3.2.24/iojs-v3.2.24-headers.tar.gz', + shasumsUrl: 'http://foo.bar/v3.2.24/SHASUMS256.txt', + versionDir: 'iojs-3.2.24', + libUrl32: 'http://foo.bar/v3.2.24/win-x86/iojs.lib', + libUrl64: 'http://foo.bar/v3.2.24/win-x64/iojs.lib', + libPath32: 'win-x86/iojs.lib', + libPath64: 'win-x64/iojs.lib' + }) + + delete process.env.IOJS_ORG_MIRROR +}) + + +test('test process release - NVM_IOJS_ORG_MIRROR', function (t) { + t.plan(2) + + process.env.NVM_IOJS_ORG_MIRROR = 'http://foo.bar' + + var release = processRelease([], { opts: {} }, 'v3.2.24', { + name: 'io.js', + headersUrl: 'https://iojs.org/download/release/v3.2.24/iojs-v3.2.24-headers.tar.gz' + }) + + t.equal(release.semver.version, '3.2.24') + delete release.semver + + t.deepEqual(release, { + version: '3.2.24', + name: 'iojs', + baseUrl: 'http://foo.bar/v3.2.24/', + tarballUrl: 'http://foo.bar/v3.2.24/iojs-v3.2.24-headers.tar.gz', + shasumsUrl: 'http://foo.bar/v3.2.24/SHASUMS256.txt', + versionDir: 'iojs-3.2.24', + libUrl32: 'http://foo.bar/v3.2.24/win-x86/iojs.lib', + libUrl64: 'http://foo.bar/v3.2.24/win-x64/iojs.lib', + libPath32: 'win-x86/iojs.lib', + libPath64: 'win-x64/iojs.lib' + }) + + delete process.env.NVM_IOJS_ORG_MIRROR +}) diff --git a/deps/npm/node_modules/nopt/lib/nopt.js b/deps/npm/node_modules/nopt/lib/nopt.js index 5309a00fc7db34..97707e784243bc 100644 --- a/deps/npm/node_modules/nopt/lib/nopt.js +++ b/deps/npm/node_modules/nopt/lib/nopt.js @@ -207,7 +207,8 @@ function validate (data, k, val, type, typeDefs) { for (var i = 0, l = types.length; i < l; i ++) { debug("test type %j %j %j", k, val, types[i]) var t = typeDefs[types[i]] - if (t && type === t.type) { + if (t && + ((type && type.name && t.type && t.type.name) ? (type.name === t.type.name) : (type === t.type))) { var d = {} ok = false !== t.validate(d, k, val) val = d[k] diff --git a/deps/npm/node_modules/nopt/package.json b/deps/npm/node_modules/nopt/package.json index 618f93467e283f..ada51ba4bf3211 100644 --- a/deps/npm/node_modules/nopt/package.json +++ b/deps/npm/node_modules/nopt/package.json @@ -1,38 +1,91 @@ { - "name": "nopt", - "version": "3.0.4", - "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.", + "_args": [ + [ + "nopt@~3.0.6", + "/Users/ogd/Documents/projects/npm/npm" + ] + ], + "_from": "nopt@>=3.0.6 <3.1.0", + "_id": "nopt@3.0.6", + "_inCache": true, + "_installable": true, + "_location": "/nopt", + "_nodeVersion": "4.2.1", + "_npmUser": { + "email": "ogd@aoaioxxysz.net", + "name": "othiym23" + }, + "_npmVersion": "2.14.10", + "_phantomChildren": {}, + "_requested": { + "name": "nopt", + "raw": "nopt@~3.0.6", + "rawSpec": "~3.0.6", + "scope": null, + "spec": ">=3.0.6 <3.1.0", + "type": "range" + }, + "_requiredBy": [ + "/", + "/node-gyp", + "/standard/standard-format/esformatter-jsx/js-beautify", + "/tap/nyc/istanbul" + ], + "_resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "_shasum": "c6465dbf08abcd4db359317f79ac68a646b28ff9", + "_shrinkwrap": null, + "_spec": "nopt@~3.0.6", + "_where": "/Users/ogd/Documents/projects/npm/npm", "author": { - "name": "Isaac Z. Schlueter", "email": "i@izs.me", + "name": "Isaac Z. Schlueter", "url": "http://blog.izs.me/" }, - "main": "lib/nopt.js", - "scripts": { - "test": "tap test/*.js" - }, - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/isaacs/nopt.git" - }, "bin": { "nopt": "./bin/nopt.js" }, - "license": "ISC", + "bugs": { + "url": "https://github.com/npm/nopt/issues" + }, "dependencies": { "abbrev": "1" }, + "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.", "devDependencies": { "tap": "^1.2.0" }, - "readme": "If you want to write an option parser, and have it be good, there are\ntwo ways to do it. The Right Way, and the Wrong Way.\n\nThe Wrong Way is to sit down and write an option parser. We've all done\nthat.\n\nThe Right Way is to write some complex configurable program with so many\noptions that you hit the limit of your frustration just trying to\nmanage them all, and defer it with duct-tape solutions until you see\nexactly to the core of the problem, and finally snap and write an\nawesome option parser.\n\nIf you want to write an option parser, don't write an option parser.\nWrite a package manager, or a source control system, or a service\nrestarter, or an operating system. You probably won't end up with a\ngood one of those, but if you don't give up, and you are relentless and\ndiligent enough in your procrastination, you may just end up with a very\nnice option parser.\n\n## USAGE\n\n // my-program.js\n var nopt = require(\"nopt\")\n , Stream = require(\"stream\").Stream\n , path = require(\"path\")\n , knownOpts = { \"foo\" : [String, null]\n , \"bar\" : [Stream, Number]\n , \"baz\" : path\n , \"bloo\" : [ \"big\", \"medium\", \"small\" ]\n , \"flag\" : Boolean\n , \"pick\" : Boolean\n , \"many1\" : [String, Array]\n , \"many2\" : [path]\n }\n , shortHands = { \"foofoo\" : [\"--foo\", \"Mr. Foo\"]\n , \"b7\" : [\"--bar\", \"7\"]\n , \"m\" : [\"--bloo\", \"medium\"]\n , \"p\" : [\"--pick\"]\n , \"f\" : [\"--flag\"]\n }\n // everything is optional.\n // knownOpts and shorthands default to {}\n // arg list defaults to process.argv\n // slice defaults to 2\n , parsed = nopt(knownOpts, shortHands, process.argv, 2)\n console.log(parsed)\n\nThis would give you support for any of the following:\n\n```bash\n$ node my-program.js --foo \"blerp\" --no-flag\n{ \"foo\" : \"blerp\", \"flag\" : false }\n\n$ node my-program.js ---bar 7 --foo \"Mr. Hand\" --flag\n{ bar: 7, foo: \"Mr. Hand\", flag: true }\n\n$ node my-program.js --foo \"blerp\" -f -----p\n{ foo: \"blerp\", flag: true, pick: true }\n\n$ node my-program.js -fp --foofoo\n{ foo: \"Mr. Foo\", flag: true, pick: true }\n\n$ node my-program.js --foofoo -- -fp # -- stops the flag parsing.\n{ foo: \"Mr. Foo\", argv: { remain: [\"-fp\"] } }\n\n$ node my-program.js --blatzk -fp # unknown opts are ok.\n{ blatzk: true, flag: true, pick: true }\n\n$ node my-program.js --blatzk=1000 -fp # but you need to use = if they have a value\n{ blatzk: 1000, flag: true, pick: true }\n\n$ node my-program.js --no-blatzk -fp # unless they start with \"no-\"\n{ blatzk: false, flag: true, pick: true }\n\n$ node my-program.js --baz b/a/z # known paths are resolved.\n{ baz: \"/Users/isaacs/b/a/z\" }\n\n# if Array is one of the types, then it can take many\n# values, and will always be an array. The other types provided\n# specify what types are allowed in the list.\n\n$ node my-program.js --many1 5 --many1 null --many1 foo\n{ many1: [\"5\", \"null\", \"foo\"] }\n\n$ node my-program.js --many2 foo --many2 bar\n{ many2: [\"/path/to/foo\", \"path/to/bar\"] }\n```\n\nRead the tests at the bottom of `lib/nopt.js` for more examples of\nwhat this puppy can do.\n\n## Types\n\nThe following types are supported, and defined on `nopt.typeDefs`\n\n* String: A normal string. No parsing is done.\n* path: A file system path. Gets resolved against cwd if not absolute.\n* url: A url. If it doesn't parse, it isn't accepted.\n* Number: Must be numeric.\n* Date: Must parse as a date. If it does, and `Date` is one of the options,\n then it will return a Date object, not a string.\n* Boolean: Must be either `true` or `false`. If an option is a boolean,\n then it does not need a value, and its presence will imply `true` as\n the value. To negate boolean flags, do `--no-whatever` or `--whatever\n false`\n* NaN: Means that the option is strictly not allowed. Any value will\n fail.\n* Stream: An object matching the \"Stream\" class in node. Valuable\n for use when validating programmatically. (npm uses this to let you\n supply any WriteStream on the `outfd` and `logfd` config options.)\n* Array: If `Array` is specified as one of the types, then the value\n will be parsed as a list of options. This means that multiple values\n can be specified, and that the value will always be an array.\n\nIf a type is an array of values not on this list, then those are\nconsidered valid values. For instance, in the example above, the\n`--bloo` option can only be one of `\"big\"`, `\"medium\"`, or `\"small\"`,\nand any other value will be rejected.\n\nWhen parsing unknown fields, `\"true\"`, `\"false\"`, and `\"null\"` will be\ninterpreted as their JavaScript equivalents.\n\nYou can also mix types and values, or multiple types, in a list. For\ninstance `{ blah: [Number, null] }` would allow a value to be set to\neither a Number or null. When types are ordered, this implies a\npreference, and the first type that can be used to properly interpret\nthe value will be used.\n\nTo define a new type, add it to `nopt.typeDefs`. Each item in that\nhash is an object with a `type` member and a `validate` method. The\n`type` member is an object that matches what goes in the type list. The\n`validate` method is a function that gets called with `validate(data,\nkey, val)`. Validate methods should assign `data[key]` to the valid\nvalue of `val` if it can be handled properly, or return boolean\n`false` if it cannot.\n\nYou can also call `nopt.clean(data, types, typeDefs)` to clean up a\nconfig object and remove its invalid properties.\n\n## Error Handling\n\nBy default, nopt outputs a warning to standard error when invalid values for\nknown options are found. You can change this behavior by assigning a method\nto `nopt.invalidHandler`. This method will be called with\nthe offending `nopt.invalidHandler(key, val, types)`.\n\nIf no `nopt.invalidHandler` is assigned, then it will console.error\nits whining. If it is assigned to boolean `false` then the warning is\nsuppressed.\n\n## Abbreviations\n\nYes, they are supported. If you define options like this:\n\n```javascript\n{ \"foolhardyelephants\" : Boolean\n, \"pileofmonkeys\" : Boolean }\n```\n\nThen this will work:\n\n```bash\nnode program.js --foolhar --pil\nnode program.js --no-f --pileofmon\n# etc.\n```\n\n## Shorthands\n\nShorthands are a hash of shorter option names to a snippet of args that\nthey expand to.\n\nIf multiple one-character shorthands are all combined, and the\ncombination does not unambiguously match any other option or shorthand,\nthen they will be broken up into their constituent parts. For example:\n\n```json\n{ \"s\" : [\"--loglevel\", \"silent\"]\n, \"g\" : \"--global\"\n, \"f\" : \"--force\"\n, \"p\" : \"--parseable\"\n, \"l\" : \"--long\"\n}\n```\n\n```bash\nnpm ls -sgflp\n# just like doing this:\nnpm ls --loglevel silent --global --force --long --parseable\n```\n\n## The Rest of the args\n\nThe config object returned by nopt is given a special member called\n`argv`, which is an object with the following fields:\n\n* `remain`: The remaining args after all the parsing has occurred.\n* `original`: The args as they originally appeared.\n* `cooked`: The args after flags and shorthands are expanded.\n\n## Slicing\n\nNode programs are called with more or less the exact argv as it appears\nin C land, after the v8 and node-specific options have been plucked off.\nAs such, `argv[0]` is always `node` and `argv[1]` is always the\nJavaScript program being run.\n\nThat's usually not very useful to you. So they're sliced off by\ndefault. If you want them, then you can pass in `0` as the last\nargument, or any other number that you'd like to slice off the start of\nthe list.\n", - "readmeFilename": "README.md", - "gitHead": "f52626631ea1afef5a6dd9acf23ddd1466831a08", - "bugs": { - "url": "https://github.com/isaacs/nopt/issues" + "directories": {}, + "dist": { + "shasum": "c6465dbf08abcd4db359317f79ac68a646b28ff9", + "tarball": "http://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz" + }, + "gitHead": "10a750c9bb99c1950160353459e733ac2aa18cb6", + "homepage": "https://github.com/npm/nopt#readme", + "license": "ISC", + "main": "lib/nopt.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "name": "nopt", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/nopt.git" + }, + "scripts": { + "test": "tap test/*.js" }, - "homepage": "https://github.com/isaacs/nopt#readme", - "_id": "nopt@3.0.4", - "_shasum": "dd63bc9c72a6e4e85b85cdc0ca314598facede5e", - "_from": "nopt@3.0.4" + "version": "3.0.6" } diff --git a/deps/npm/node_modules/nopt/test/basic.js b/deps/npm/node_modules/nopt/test/basic.js index 2f9088cf674766..d399de9209932c 100644 --- a/deps/npm/node_modules/nopt/test/basic.js +++ b/deps/npm/node_modules/nopt/test/basic.js @@ -31,6 +31,28 @@ test("Unknown options are not parsed as numbers", function (t) { t.end() }); +// https://github.com/npm/nopt/issues/48 +test("Check types based on name of type", function (t) { + var parsed = nopt({"parse-me": {name: "Number"}}, null, ['--parse-me=1.20'], 0) + t.equal(parsed['parse-me'], 1.2) + t.end() +}) + + +test("Missing types are not parsed", function (t) { + var parsed = nopt({"parse-me": {}}, null, ['--parse-me=1.20'], 0) + //should only contain argv + t.equal(Object.keys(parsed).length, 1) + t.end() +}) + +test("Types passed without a name are not parsed", function (t) { + var parsed = nopt({"parse-me": {}}, {}, ['--parse-me=1.20'], 0) + //should only contain argv + t.equal(Object.keys(parsed).length, 1) + t.end() +}) + test("other tests", function (t) { var util = require("util") diff --git a/deps/npm/node_modules/normalize-git-url/package.json b/deps/npm/node_modules/normalize-git-url/package.json index b2dc3d910a907a..ab01c0e8f3f669 100644 --- a/deps/npm/node_modules/normalize-git-url/package.json +++ b/deps/npm/node_modules/normalize-git-url/package.json @@ -33,10 +33,33 @@ "url": "https://github.com/npm/normalize-git-url/issues" }, "homepage": "https://github.com/npm/normalize-git-url", - "readme": "# normalize-git-url\n\nYou have a bunch of Git URLs. You want to convert them to a canonical\nrepresentation, probably for use inside npm so that it doesn't end up creating\na bunch of superfluous cached origins. You use this package.\n\n## Usage\n\n```javascript\nvar ngu = require('normalize-git-url');\nvar normalized = ngu(\"git+ssh://git@github.com:organization/repo.git#hashbrowns\")\n// get back:\n// {\n// url : \"ssh://git@github.com/organization/repo.git\",\n// branch : \"hashbrowns\" // did u know hashbrowns are delicious?\n// }\n```\n\n## API\n\nThere's just the one function, and all it takes is a single parameter, a non-normalized Git URL.\n\n### normalizeGitUrl(url)\n\n* `url` {String} The Git URL (very loosely speaking) to be normalized.\n\nReturns an object with the following format:\n\n* `url` {String} The normalized URL.\n* `branch` {String} The treeish to be checked out once the repo at `url` is\n cloned. It doesn't have to be a branch, but it's a lot easier to intuit what\n the output is for with that name.\n\n## Limitations\n\nRight now this doesn't try to special-case GitHub too much -- it doesn't ensure\nthat `.git` is added to the end of URLs, it doesn't prefer `https:` over\n`http:` or `ssh:`, it doesn't deal with redirects, and it doesn't try to\nresolve symbolic names to treeish hashcodes. For now, it just tries to account\nfor minor differences in representation.\n", - "readmeFilename": "README.md", "gitHead": "8393cd4345e404eb6ad2ff6853dcc8287807ca22", "_id": "normalize-git-url@3.0.1", "_shasum": "d40d419d05a15870271e50534dbb7b8ccd9b0a5c", - "_from": "normalize-git-url@latest" + "_from": "normalize-git-url@>=3.0.1 <3.1.0", + "_npmVersion": "3.1.2", + "_nodeVersion": "2.2.2", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "d40d419d05a15870271e50534dbb7b8ccd9b0a5c", + "tarball": "http://registry.npmjs.org/normalize-git-url/-/normalize-git-url-3.0.1.tgz" + }, + "maintainers": [ + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "_resolved": "https://registry.npmjs.org/normalize-git-url/-/normalize-git-url-3.0.1.tgz" } diff --git a/deps/npm/node_modules/normalize-package-data/README.md b/deps/npm/node_modules/normalize-package-data/README.md index 9f412a0ac02f88..526745ef6923f9 100644 --- a/deps/npm/node_modules/normalize-package-data/README.md +++ b/deps/npm/node_modules/normalize-package-data/README.md @@ -95,7 +95,7 @@ If `version` field is given, the value of the version field must be a valid *sem ### Rules for license field -The `license` field should be a valid *SDPDX license expression* or one of the special values allowed by [validate-npm-package-license](https://npmjs.com/packages/validate-npm-package-license). See [documentation for the license field in package.json](https://docs.npmjs.com/files/package.json#license). +The `license` field should be a valid *SPDX license expression* or one of the special values allowed by [validate-npm-package-license](https://npmjs.com/packages/validate-npm-package-license). See [documentation for the license field in package.json](https://docs.npmjs.com/files/package.json#license). ## Credits diff --git a/deps/npm/node_modules/normalize-package-data/lib/fixer.js b/deps/npm/node_modules/normalize-package-data/lib/fixer.js index 5f64f01d7216fc..1409c69c9dd43e 100644 --- a/deps/npm/node_modules/normalize-package-data/lib/fixer.js +++ b/deps/npm/node_modules/normalize-package-data/lib/fixer.js @@ -83,7 +83,12 @@ var fixer = module.exports = { if (!data.bin) return; if (typeof data.bin === "string") { var b = {} - b[data.name] = data.bin + var match + if (match = data.name.match(/^@[^/]+[/](.*)$/)) { + b[match[1]] = data.bin + } else { + b[data.name] = data.bin + } data.bin = b } } diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/index.js b/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/index.js index df3474a10f3f12..9ef35ab0694e73 100644 --- a/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/index.js +++ b/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/index.js @@ -6,5 +6,5 @@ var blacklist = [ ]; module.exports = Object.keys(process.binding('natives')).filter(function (el) { - return !/^_|^internal/.test(el) && blacklist.indexOf(el) === -1; + return !/^_|^internal|\//.test(el) && blacklist.indexOf(el) === -1; }).sort(); diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/package.json b/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/package.json index a6851b0e059203..a1288015d3a90e 100644 --- a/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/package.json +++ b/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/package.json @@ -1,69 +1,96 @@ { - "name": "builtin-modules", - "version": "1.1.0", - "description": "List of the Node.js builtin modules", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/builtin-modules.git" + "_args": [ + [ + "builtin-modules@^1.0.0", + "/Users/rebecca/code/npm/node_modules/normalize-package-data/node_modules/is-builtin-module" + ] + ], + "_from": "builtin-modules@>=1.0.0 <2.0.0", + "_id": "builtin-modules@1.1.1", + "_inCache": true, + "_installable": true, + "_location": "/normalize-package-data/is-builtin-module/builtin-modules", + "_nodeVersion": "5.3.0", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" }, + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "name": "builtin-modules", + "raw": "builtin-modules@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/normalize-package-data/is-builtin-module" + ], + "_resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "_shasum": "270f076c5a72c02f5b65a47df94c5fe3a278892f", + "_shrinkwrap": null, + "_spec": "builtin-modules@^1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/normalize-package-data/node_modules/is-builtin-module", "author": { - "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", "url": "sindresorhus.com" }, + "bugs": { + "url": "https://github.com/sindresorhus/builtin-modules/issues" + }, + "dependencies": {}, + "description": "List of the Node.js builtin modules", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "270f076c5a72c02f5b65a47df94c5fe3a278892f", + "tarball": "http://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz" + }, "engines": { "node": ">=0.10.0" }, - "scripts": { - "test": "xo && ava", - "make": "node make.js" - }, "files": [ + "builtin-modules.json", "index.js", - "static.js", - "builtin-modules.json" + "static.js" ], + "gitHead": "0ea253452b1d8cb3a70d16464f909dbc0bc370fe", + "homepage": "https://github.com/sindresorhus/builtin-modules#readme", "keywords": [ - "builtin", + "array", "built-in", + "builtin", "builtins", - "node", - "modules", - "core", "bundled", + "core", "list", - "array", - "names" + "modules", + "names", + "node" ], - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "gitHead": "d317be16fab701f2ac73bc9aa771f60ec052ed66", - "bugs": { - "url": "https://github.com/sindresorhus/builtin-modules/issues" - }, - "homepage": "https://github.com/sindresorhus/builtin-modules#readme", - "_id": "builtin-modules@1.1.0", - "_shasum": "1053955fd994a5746e525e4ac717b81caf07491c", - "_from": "builtin-modules@>=1.0.0 <2.0.0", - "_npmVersion": "2.13.3", - "_nodeVersion": "3.0.0", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "1053955fd994a5746e525e4ac717b81caf07491c", - "tarball": "http://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.0.tgz" - }, + "license": "MIT", "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.0.tgz" + "name": "builtin-modules", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/builtin-modules.git" + }, + "scripts": { + "make": "node make.js", + "test": "xo && ava" + }, + "version": "1.1.1" } diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/package.json b/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/package.json index 58feefdfb8884b..3e0bf21f85c0c7 100644 --- a/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/package.json +++ b/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/package.json @@ -5,7 +5,7 @@ "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/sindresorhus/is-builtin-module" + "url": "git+https://github.com/sindresorhus/is-builtin-module.git" }, "author": { "name": "Sindre Sorhus", @@ -68,5 +68,6 @@ } ], "directories": {}, - "_resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz" + "_resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/normalize-package-data/package.json b/deps/npm/node_modules/normalize-package-data/package.json index 464b0092769317..f8c8aa90874262 100644 --- a/deps/npm/node_modules/normalize-package-data/package.json +++ b/deps/npm/node_modules/normalize-package-data/package.json @@ -1,6 +1,6 @@ { "name": "normalize-package-data", - "version": "2.3.4", + "version": "2.3.5", "author": { "name": "Meryn Stol", "email": "merynstol@gmail.com" @@ -16,15 +16,15 @@ "test": "tap test/*.js" }, "dependencies": { - "hosted-git-info": "^2.0.2", + "hosted-git-info": "^2.1.4", "is-builtin-module": "^1.0.0", "semver": "2 || 3 || 4 || 5", "validate-npm-package-license": "^3.0.1" }, "devDependencies": { - "async": "~0.9.0", - "tap": "^1.1.0", - "underscore": "~1.4.4" + "async": "^1.5.0", + "tap": "^2.2.0", + "underscore": "^1.8.3" }, "contributors": [ { @@ -40,14 +40,47 @@ "email": "rok@kowalski.gd" } ], - "readme": "# normalize-package-data [![Build Status](https://travis-ci.org/npm/normalize-package-data.png?branch=master)](https://travis-ci.org/npm/normalize-package-data)\n\nnormalize-package data exports a function that normalizes package metadata. This data is typically found in a package.json file, but in principle could come from any source - for example the npm registry.\n\nnormalize-package-data is used by [read-package-json](https://npmjs.org/package/read-package-json) to normalize the data it reads from a package.json file. In turn, read-package-json is used by [npm](https://npmjs.org/package/npm) and various npm-related tools.\n\n## Installation\n\n```\nnpm install normalize-package-data\n```\n\n## Usage\n\nBasic usage is really simple. You call the function that normalize-package-data exports. Let's call it `normalizeData`.\n\n```javascript\nnormalizeData = require('normalize-package-data')\npackageData = fs.readFileSync(\"package.json\")\nnormalizeData(packageData)\n// packageData is now normalized\n```\n\n#### Strict mode\n\nYou may activate strict validation by passing true as the second argument.\n\n```javascript\nnormalizeData = require('normalize-package-data')\npackageData = fs.readFileSync(\"package.json\")\nwarnFn = function(msg) { console.error(msg) }\nnormalizeData(packageData, true)\n// packageData is now normalized\n```\n\nIf strict mode is activated, only Semver 2.0 version strings are accepted. Otherwise, Semver 1.0 strings are accepted as well. Packages must have a name, and the name field must not have contain leading or trailing whitespace.\n\n#### Warnings\n\nOptionally, you may pass a \"warning\" function. It gets called whenever the `normalizeData` function encounters something that doesn't look right. It indicates less than perfect input data.\n\n```javascript\nnormalizeData = require('normalize-package-data')\npackageData = fs.readFileSync(\"package.json\")\nwarnFn = function(msg) { console.error(msg) }\nnormalizeData(packageData, warnFn)\n// packageData is now normalized. Any number of warnings may have been logged.\n```\n\nYou may combine strict validation with warnings by passing `true` as the second argument, and `warnFn` as third.\n\nWhen `private` field is set to `true`, warnings will be suppressed.\n\n### Potential exceptions\n\nIf the supplied data has an invalid name or version vield, `normalizeData` will throw an error. Depending on where you call `normalizeData`, you may want to catch these errors so can pass them to a callback.\n\n## What normalization (currently) entails\n\n* The value of `name` field gets trimmed (unless in strict mode).\n* The value of the `version` field gets cleaned by `semver.clean`. See [documentation for the semver module](https://github.com/isaacs/node-semver).\n* If `name` and/or `version` fields are missing, they are set to empty strings.\n* If `files` field is not an array, it will be removed.\n* If `bin` field is a string, then `bin` field will become an object with `name` set to the value of the `name` field, and `bin` set to the original string value.\n* If `man` field is a string, it will become an array with the original string as its sole member.\n* If `keywords` field is string, it is considered to be a list of keywords separated by one or more white-space characters. It gets converted to an array by splitting on `\\s+`.\n* All people fields (`author`, `maintainers`, `contributors`) get converted into objects with name, email and url properties.\n* If `bundledDependencies` field (a typo) exists and `bundleDependencies` field does not, `bundledDependencies` will get renamed to `bundleDependencies`.\n* If the value of any of the dependencies fields (`dependencies`, `devDependencies`, `optionalDependencies`) is a string, it gets converted into an object with familiar `name=>value` pairs.\n* The values in `optionalDependencies` get added to `dependencies`. The `optionalDependencies` array is left untouched.\n* As of v2: Dependencies that point at known hosted git providers (currently: github, bitbucket, gitlab) will have their URLs canonicalized, but protocols will be preserved.\n* As of v2: Dependencies that use shortcuts for hosted git providers (`org/proj`, `github:org/proj`, `bitbucket:org/proj`, `gitlab:org/proj`, `gist:docid`) will have the shortcut left in place. (In the case of github, the `org/proj` form will be expanded to `github:org/proj`.) THIS MARKS A BREAKING CHANGE FROM V1, where the shorcut was previously expanded to a URL.\n* If `description` field does not exist, but `readme` field does, then (more or less) the first paragraph of text that's found in the readme is taken as value for `description`.\n* If `repository` field is a string, it will become an object with `url` set to the original string value, and `type` set to `\"git\"`.\n* If `repository.url` is not a valid url, but in the style of \"[owner-name]/[repo-name]\", `repository.url` will be set to git+https://github.com/[owner-name]/[repo-name].git\n* If `bugs` field is a string, the value of `bugs` field is changed into an object with `url` set to the original string value.\n* If `bugs` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `bugs` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/issues . If the repository field points to a GitHub Gist repo url, the associated http url is chosen.\n* If `bugs` field is an object, the resulting value only has email and url properties. If email and url properties are not strings, they are ignored. If no valid values for either email or url is found, bugs field will be removed.\n* If `homepage` field is not a string, it will be removed.\n* If the url in the `homepage` field does not specify a protocol, then http is assumed. For example, `myproject.org` will be changed to `http://myproject.org`.\n* If `homepage` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `homepage` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/ . If the repository field points to a GitHub Gist repo url, the associated http url is chosen.\n\n### Rules for name field\n\nIf `name` field is given, the value of the name field must be a string. The string may not:\n\n* start with a period.\n* contain the following characters: `/@\\s+%`\n* contain and characters that would need to be encoded for use in urls.\n* resemble the word `node_modules` or `favicon.ico` (case doesn't matter).\n\n### Rules for version field\n\nIf `version` field is given, the value of the version field must be a valid *semver* string, as determined by the `semver.valid` method. See [documentation for the semver module](https://github.com/isaacs/node-semver).\n\n### Rules for license field\n\nThe `license` field should be a valid *SDPDX license expression* or one of the special values allowed by [validate-npm-package-license](https://npmjs.com/packages/validate-npm-package-license). See [documentation for the license field in package.json](https://docs.npmjs.com/files/package.json#license).\n\n## Credits\n\nThis package contains code based on read-package-json written by Isaac Z. Schlueter. Used with permisson.\n\n## License\n\nnormalize-package-data is released under the [BSD 2-Clause License](http://opensource.org/licenses/MIT). \nCopyright (c) 2013 Meryn Stol \n", - "readmeFilename": "README.md", - "gitHead": "0aa15b23116f2dfd086f1ed6bf213cbb7e7490dd", + "gitHead": "3dc7756af20b3b1b24c6d75302448ca3659e0a65", "bugs": { "url": "https://github.com/npm/normalize-package-data/issues" }, "homepage": "https://github.com/npm/normalize-package-data#readme", - "_id": "normalize-package-data@2.3.4", - "_shasum": "b92233ce6ef04fbd6bc0c05dead155af33a623e0", - "_from": "normalize-package-data@2.3.4" + "_id": "normalize-package-data@2.3.5", + "_shasum": "8d924f142960e1777e7ffe170543631cc7cb02df", + "_from": "normalize-package-data@>=2.3.5 <2.4.0", + "_npmVersion": "3.3.6", + "_nodeVersion": "5.0.0", + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "dist": { + "shasum": "8d924f142960e1777e7ffe170543631cc7cb02df", + "tarball": "http://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.3.5.tgz" + }, + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "meryn", + "email": "merynstol@gmail.com" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.3.5.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/normalize-package-data/test/normalize.js b/deps/npm/node_modules/normalize-package-data/test/normalize.js index de6f1ce5b5ba11..3926938b6ac287 100644 --- a/deps/npm/node_modules/normalize-package-data/test/normalize.js +++ b/deps/npm/node_modules/normalize-package-data/test/normalize.js @@ -2,8 +2,6 @@ var tap = require("tap") var fs = require("fs") var path = require("path") -var globals = Object.keys(global) - var normalize = require("../lib/normalize") var warningMessages = require("../lib/warning_messages.json") var safeFormat = require("../lib/safe_format") @@ -246,8 +244,3 @@ tap.test("deprecation warning for array in dependencies fields", function(t) { t.ok(~warnings.indexOf(safeFormat(warningMessages.deprecatedArrayDependencies, 'optionalDependencies')), "deprecation warning") t.end() }) - -tap.test('no new globals', function(t) { - t.same(Object.keys(global), globals) - t.end() -}) diff --git a/deps/npm/node_modules/normalize-package-data/test/scoped.js b/deps/npm/node_modules/normalize-package-data/test/scoped.js index 31bbf4f7fc5376..82d2a543f97251 100644 --- a/deps/npm/node_modules/normalize-package-data/test/scoped.js +++ b/deps/npm/node_modules/normalize-package-data/test/scoped.js @@ -1,6 +1,7 @@ var test = require("tap").test var fixNameField = require("../lib/fixer.js").fixNameField +var fixBinField = require("../lib/fixer.js").fixBinField test("a simple scoped module has a valid name", function (t) { var data = {name : "@org/package"} @@ -49,3 +50,10 @@ test("'@/package' is not a valid name", function (t) { t.end() }) + +test("name='@org/package', bin='bin.js' is bin={package:'bin.js'}", function (t) { + var obj = {name : "@org/package", bin: "bin.js"} + fixBinField(obj) + t.isDeeply(obj.bin, {package: 'bin.js'}) + t.end() +}) diff --git a/deps/npm/node_modules/npm-cache-filename/package.json b/deps/npm/node_modules/npm-cache-filename/package.json index b2431b96c2f688..76ec9d1a1355c2 100644 --- a/deps/npm/node_modules/npm-cache-filename/package.json +++ b/deps/npm/node_modules/npm-cache-filename/package.json @@ -27,7 +27,7 @@ "gitHead": "b7eef12919fdf544a3b83bba73093f7268c40c1e", "_id": "npm-cache-filename@1.0.2", "_shasum": "ded306c5b0bfc870a9e9faf823bc5f283e05ae11", - "_from": "npm-cache-filename@1.0.2", + "_from": "npm-cache-filename@>=1.0.2 <1.1.0", "_npmVersion": "2.12.1", "_nodeVersion": "2.2.2", "_npmUser": { diff --git a/deps/npm/node_modules/npm-install-checks/CHANGELOG.md b/deps/npm/node_modules/npm-install-checks/CHANGELOG.md new file mode 100644 index 00000000000000..f16f72d2fb4a01 --- /dev/null +++ b/deps/npm/node_modules/npm-install-checks/CHANGELOG.md @@ -0,0 +1,10 @@ +### v3.0.0 2016-01-12 + +* Change error messages to be more informative. +* checkEngine, when not in strict mode, now calls back with the error + object as the second argument instead of warning. +* checkCycle no longer logs when cycle errors are found. + +### v2.0.0 2015-01-20 + +* Remove checking of engineStrict in the package.json diff --git a/deps/npm/node_modules/npm-install-checks/README.md b/deps/npm/node_modules/npm-install-checks/README.md index 7da4af1487e1d2..19ae5a4af3af51 100644 --- a/deps/npm/node_modules/npm-install-checks/README.md +++ b/deps/npm/node_modules/npm-install-checks/README.md @@ -5,7 +5,9 @@ A package that contains checks that npm runs during the installation. ## API ### .checkEngine(target, npmVer, nodeVer, force, strict, cb) -Check if node/npm version is supported by the package. +Check if node/npm version is supported by the package. If not +strict and it isn't supported, `cb` is called with the error +object as its second argument. Error type: `ENOTSUP` diff --git a/deps/npm/node_modules/npm-install-checks/index.js b/deps/npm/node_modules/npm-install-checks/index.js index 10f214fa931e97..9ea7b875e4234b 100644 --- a/deps/npm/node_modules/npm-install-checks/index.js +++ b/deps/npm/node_modules/npm-install-checks/index.js @@ -1,26 +1,24 @@ -var fs = require("fs") -var path = require("path") -var log = require("npmlog") -var semver = require("semver") +var fs = require('fs') +var path = require('path') +var util = require('util') +var semver = require('semver') exports.checkEngine = checkEngine function checkEngine (target, npmVer, nodeVer, force, strict, cb) { var nodev = force ? null : nodeVer - , strict = strict || target.engineStrict - , eng = target.engines + var eng = target.engines if (!eng) return cb() - if (nodev && eng.node && !semver.satisfies(nodev, eng.node) - || eng.npm && !semver.satisfies(npmVer, eng.npm)) { - + if (nodev && eng.node && !semver.satisfies(nodev, eng.node) || + eng.npm && !semver.satisfies(npmVer, eng.npm)) { + var er = new Error(util.format('Unsupported engine for %s: wanted: %j (current: %j)', + target._id, eng, {node: nodev, npm: npmVer})) + er.code = 'ENOTSUP' + er.required = eng + er.pkgid = target._id if (strict) { - var er = new Error("Unsupported") - er.code = "ENOTSUP" - er.required = eng - er.pkgid = target._id return cb(er) } else { - log.warn( "engine", "%s: wanted: %j (current: %j)" - , target._id, eng, {node: nodev, npm: npmVer} ) + return cb(null, er) } } return cb() @@ -29,9 +27,9 @@ function checkEngine (target, npmVer, nodeVer, force, strict, cb) { exports.checkPlatform = checkPlatform function checkPlatform (target, force, cb) { var platform = process.platform - , arch = process.arch - , osOk = true - , cpuOk = true + var arch = process.arch + var osOk = true + var cpuOk = true if (force) { return cb() @@ -44,8 +42,9 @@ function checkPlatform (target, force, cb) { cpuOk = checkList(arch, target.cpu) } if (!osOk || !cpuOk) { - var er = new Error("Unsupported") - er.code = "EBADPLATFORM" + var er = new Error(util.format('Unsupported platform for %s: wanted %j (current: %j)', + target._id, target, {os: platform, cpu: arch})) + er.code = 'EBADPLATFORM' er.os = target.os || ['any'] er.cpu = target.cpu || ['any'] er.pkgid = target._id @@ -56,12 +55,12 @@ function checkPlatform (target, force, cb) { function checkList (value, list) { var tmp - , match = false - , blc = 0 - if (typeof list === "string") { + var match = false + var blc = 0 + if (typeof list === 'string') { list = [list] } - if (list.length === 1 && list[0] === "any") { + if (list.length === 1 && list[0] === 'any') { return true } for (var i = 0; i < list.length; ++i) { @@ -103,24 +102,23 @@ function checkCycle (target, ancestors, cb) { // is used *twice* here: to skip the first level of repetition. var p = Object.getPrototypeOf(Object.getPrototypeOf(ancestors)) - , name = target.name - , version = target.version + var name = target.name + var version = target.version while (p && p !== Object.prototype && p[name] !== version) { p = Object.getPrototypeOf(p) } if (p[name] !== version) return cb() - var er = new Error("Unresolvable cycle detected") + var er = new Error(target._id + ': Unresolvable cycle detected') var tree = [target._id, JSON.parse(JSON.stringify(ancestors))] - , t = Object.getPrototypeOf(ancestors) + var t = Object.getPrototypeOf(ancestors) while (t && t !== Object.prototype) { if (t === p) t.THIS_IS_P = true tree.push(JSON.parse(JSON.stringify(t))) t = Object.getPrototypeOf(t) } - log.verbose("unresolvable dependency tree", tree) er.pkgid = target._id - er.code = "ECYCLE" + er.code = 'ECYCLE' return cb(er) } @@ -134,11 +132,11 @@ function checkGit (folder, cb) { } function checkGit_ (folder, cb) { - fs.stat(path.resolve(folder, ".git"), function (er, s) { + fs.stat(path.resolve(folder, '.git'), function (er, s) { if (!er && s.isDirectory()) { - var e = new Error("Appears to be a git repo or submodule.") + var e = new Error(folder + ': Appears to be a git repo or submodule.') e.path = folder - e.code = "EISGIT" + e.code = 'EISGIT' return cb(e) } cb() diff --git a/deps/npm/node_modules/npm-install-checks/package.json b/deps/npm/node_modules/npm-install-checks/package.json index 3e7203c6fa549d..71e725db4de07c 100644 --- a/deps/npm/node_modules/npm-install-checks/package.json +++ b/deps/npm/node_modules/npm-install-checks/package.json @@ -1,41 +1,94 @@ { - "name": "npm-install-checks", - "version": "1.0.6", - "description": "checks that npm runs during the installation of a module", - "main": "index.js", + "_args": [ + [ + "npm-install-checks@3.0.0", + "/Users/rebecca/code/npm" + ] + ], + "_from": "npm-install-checks@3.0.0", + "_id": "npm-install-checks@3.0.0", + "_inCache": true, + "_installable": true, + "_location": "/npm-install-checks", + "_nodeVersion": "4.2.2", + "_npmUser": { + "email": "me@re-becca.org", + "name": "iarna" + }, + "_npmVersion": "3.5.3", + "_phantomChildren": {}, + "_requested": { + "name": "npm-install-checks", + "raw": "npm-install-checks@3.0.0", + "rawSpec": "3.0.0", + "scope": null, + "spec": "3.0.0", + "type": "version" + }, + "_requiredBy": [ + "/" + ], + "_shasum": "d4aecdfd51a53e3723b7b2f93b2ee28e307bc0d7", + "_shrinkwrap": null, + "_spec": "npm-install-checks@3.0.0", + "_where": "/Users/rebecca/code/npm", + "author": { + "email": "rok@kowalski.gd", + "name": "Robert Kowalski" + }, + "bugs": { + "url": "https://github.com/npm/npm-install-checks/issues" + }, "dependencies": { - "npmlog": "0.1 || 1", "semver": "^2.3.0 || 3.x || 4 || 5" }, + "description": "checks that npm runs during the installation of a module", "devDependencies": { "mkdirp": "~0.3.5", "rimraf": "~2.2.5", - "tap": "^1.2.0" - }, - "scripts": { - "test": "tap test/*.js" + "standard": "^5.4.1", + "tap": "^5.0.1" }, - "repository": { - "type": "git", - "url": "git://github.com/npm/npm-install-checks.git" + "directories": {}, + "dist": { + "shasum": "d4aecdfd51a53e3723b7b2f93b2ee28e307bc0d7", + "tarball": "http://registry.npmjs.org/npm-install-checks/-/npm-install-checks-3.0.0.tgz" }, + "gitHead": "49d3ea33262de10f99ac6968e621be416f572774", "homepage": "https://github.com/npm/npm-install-checks", "keywords": [ - "npm,", - "install" + "install", + "npm," ], - "author": { - "name": "Robert Kowalski", - "email": "rok@kowalski.gd" - }, "license": "BSD-2-Clause", - "bugs": { - "url": "https://github.com/npm/npm-install-checks/issues" + "main": "index.js", + "maintainers": [ + { + "name": "robertkowalski", + "email": "rok@kowalski.gd" + }, + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + } + ], + "name": "npm-install-checks", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/npm/npm-install-checks.git" + }, + "scripts": { + "test": "standard && tap --coverage test/*.js" }, - "readme": "# npm-install-checks\n\nA package that contains checks that npm runs during the installation.\n\n## API\n\n### .checkEngine(target, npmVer, nodeVer, force, strict, cb)\nCheck if node/npm version is supported by the package.\n\nError type: `ENOTSUP`\n\n### .checkPlatform(target, force, cb)\nCheck if OS/Arch is supported by the package.\n\nError type: `EBADPLATFORM`\n\n### .checkCycle(target, ancestors, cb)\nCheck for cyclic dependencies.\n\nError type: `ECYCLE`\n\n### .checkGit(folder, cb)\nCheck if a folder is a .git folder.\n\nError type: `EISGIT`\n", - "readmeFilename": "README.md", - "gitHead": "f28aebca7f5df0ddb13161b0f04d069004f6c367", - "_id": "npm-install-checks@1.0.6", - "_shasum": "8d4c1e852806e4e2d66601ab787be5841550d0cb", - "_from": "npm-install-checks@>=1.0.6 <1.1.0" + "version": "3.0.0" } diff --git a/deps/npm/node_modules/npm-install-checks/test/check-engine.js b/deps/npm/node_modules/npm-install-checks/test/check-engine.js index a16b13d7dbd8fe..a8fa0390a13471 100644 --- a/deps/npm/node_modules/npm-install-checks/test/check-engine.js +++ b/deps/npm/node_modules/npm-install-checks/test/check-engine.js @@ -1,35 +1,62 @@ -var test = require("tap").test -var c = require("../index.js").checkEngine +var test = require('tap').test +var c = require('../index.js').checkEngine -test("no engine defined", function (t) { - c({ engines: {}}, "1.1.2", "0.2.1", false, true, function (err) { - t.notOk(err, "no error present") +test('no engine defined', function (t) { + c({ engines: {} }, '1.1.2', '0.2.1', false, true, function (err) { + t.notOk(err, 'no error present') t.end() }) }) -test("node version too old", function (t) { - var target = { engines: { node: "0.10.24" }} - c(target, "1.1.2", "0.10.18", false, true, function (err) { - t.ok(err, "returns an error") - t.equals(err.required.node, "0.10.24") +test('node version too old', function (t) { + var target = { engines: { node: '0.10.24' } } + c(target, '1.1.2', '0.10.18', false, true, function (err) { + t.ok(err, 'returns an error') + t.equals(err.required.node, '0.10.24') t.end() }) }) -test("npm version too old", function (t) { - var target = { engines: { npm: "1.3.6" }} - c(target, "1.4.2", "0.2.1", false, true, function (err) { - t.ok(err, "returns an error") - t.equals(err.required.npm, "1.3.6") - t.end() - }) +test('npm version too old', function (t) { + var target = { engines: { npm: '^1.4.6' } } + c(target, '1.3.2', '0.2.1', false, true, function (err) { + t.ok(err, 'returns an error') + t.equals(err.required.npm, '^1.4.6') + t.end() + }) +}) + +test('strict=false w/engineStrict json does not return an error', function (t) { + var target = { engines: { npm: '1.3.6' }, engineStrict: true } + c(target, '1.4.2', '0.2.1', false, false, function (err, warn) { + t.notOk(err, 'returns no error') + t.ok(warn, 'returns warning object') + t.equals(warn.required.npm, '1.3.6') + t.end() + }) +}) + +test('force node version too old', function (t) { + var target = { _id: 'test@1.0.0', engines: { node: '0.1.0' } } + c(target, '1.3.2', '0.2.1', true, true, function (err, warn) { + t.is(err, undefined, 'returns no error') + t.notOk(warn, 'returns no warning') + t.end() + }) +}) + +test('force npm version too old', function (t) { + var target = { _id: 'test@1.0.0', engines: { npm: '^1.4.6' } } + c(target, '1.3.2', '0.2.1', true, true, function (err, warn) { + t.ok(err, "can't force an npm version mismatch") + t.end() + }) }) -test("strict=false does not return an error", function (t) { - var target = { engines: { npm: "1.3.6" }} - c(target, "1.4.2", "0.2.1", false, false, function (err) { - t.notOk(err, "returns no error") +test('no engine', function (t) { + c({}, '1.3.2', '0.2.1', false, true, function (err, warn) { + t.notOk(err, 'returns no error') + t.notOk(warn, 'returns no warning') t.end() }) }) diff --git a/deps/npm/node_modules/npm-install-checks/test/check-git.js b/deps/npm/node_modules/npm-install-checks/test/check-git.js index d09d0b518196d8..0fadd0631b73d4 100644 --- a/deps/npm/node_modules/npm-install-checks/test/check-git.js +++ b/deps/npm/node_modules/npm-install-checks/test/check-git.js @@ -1,31 +1,37 @@ -var test = require("tap").test -var c = require("../index.js").checkGit -var fs = require("fs") -var rimraf = require("rimraf") -var mkdirp = require("mkdirp") -var path = require("path") -var gitFixturePath = path.resolve(__dirname, "out") +var test = require('tap').test +var c = require('../index.js').checkGit +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var path = require('path') +var gitFixturePath = path.resolve(__dirname, 'out') -test("is .git repo", function (t) { - mkdirp(gitFixturePath + "/.git", function () { +test('is .git repo', function (t) { + mkdirp(gitFixturePath + '/.git', function () { c(gitFixturePath, function (err) { - t.ok(err, "error present") - t.equal(err.code, "EISGIT") + t.ok(err, 'error present') + t.equal(err.code, 'EISGIT') t.end() }) }) }) -test("is not a .git repo", function (t) { +test('is not a .git repo', function (t) { c(__dirname, function (err) { - t.notOk(err, "error not present") + t.notOk(err, 'error not present') t.end() }) }) -test("cleanup", function (t) { +test('non-thing', function (t) { + c('/path/to/no/where', function (err) { + t.notOk(err, 'non-existent path is not a .git repo') + t.end() + }) +}) + +test('cleanup', function (t) { rimraf(gitFixturePath, function () { - t.pass("cleanup") + t.pass('cleanup') t.end() }) }) diff --git a/deps/npm/node_modules/npm-install-checks/test/check-platform.js b/deps/npm/node_modules/npm-install-checks/test/check-platform.js index eeeb1bceffa293..23dbfba4a9b797 100644 --- a/deps/npm/node_modules/npm-install-checks/test/check-platform.js +++ b/deps/npm/node_modules/npm-install-checks/test/check-platform.js @@ -1,44 +1,104 @@ -var test = require("tap").test -var c = require("../index.js").checkPlatform +var test = require('tap').test +var c = require('../index.js').checkPlatform -test("target cpu wrong", function (t) { +test('target cpu wrong', function (t) { var target = {} - target.cpu = "enten-cpu" - target.os = "any" + target.cpu = 'enten-cpu' + target.os = 'any' c(target, false, function (err) { - t.ok(err, "error present") - t.equal(err.code, "EBADPLATFORM") + t.ok(err, 'error present') + t.equal(err.code, 'EBADPLATFORM') t.end() }) }) -test("os wrong", function (t) { +test('os wrong', function (t) { var target = {} - target.cpu = "any" - target.os = "enten-os" + target.cpu = 'any' + target.os = 'enten-os' c(target, false, function (err) { - t.ok(err, "error present") - t.equal(err.code, "EBADPLATFORM") + t.ok(err, 'error present') + t.equal(err.code, 'EBADPLATFORM') t.end() }) }) -test("nothing wrong", function (t) { +test('nothing wrong', function (t) { var target = {} - target.cpu = "any" - target.os = "any" + target.cpu = 'any' + target.os = 'any' c(target, false, function (err) { - t.notOk(err, "no error present") + t.notOk(err, 'no error present') t.end() }) }) -test("force", function (t) { +test('force', function (t) { var target = {} - target.cpu = "enten-cpu" - target.os = "any" + target.cpu = 'enten-cpu' + target.os = 'any' c(target, true, function (err) { - t.notOk(err, "no error present") + t.notOk(err, 'no error present') + t.end() + }) +}) + +test('no opinions', function (t) { + var target = {} + c(target, false, function (err) { + t.notOk(err, 'no error present') + t.end() + }) +}) + +test('only target cpu wrong', function (t) { + var target = {} + target.cpu = 'enten-cpu' + c(target, false, function (err) { + t.ok(err, 'error present') + t.equal(err.code, 'EBADPLATFORM') + t.end() + }) +}) + +test('only os wrong', function (t) { + var target = {} + target.os = 'enten-os' + c(target, false, function (err) { + t.ok(err, 'error present') + t.equal(err.code, 'EBADPLATFORM') + t.end() + }) +}) + +test('everything wrong w/arrays', function (t) { + var target = {} + target.cpu = ['enten-cpu'] + target.os = ['enten-os'] + c(target, false, function (err) { + t.ok(err, 'error present') + t.equal(err.code, 'EBADPLATFORM') + t.end() + }) +}) + +test('os wrong (negation)', function (t) { + var target = {} + target.cpu = 'any' + target.os = '!' + process.platform + c(target, false, function (err) { + t.ok(err, 'error present') + t.equal(err.code, 'EBADPLATFORM') + t.end() + }) +}) + +test('nothing wrong (negation)', function (t) { + var target = {} + target.cpu = '!enten-cpu' + target.os = '!enten-os' + c(target, false, function (err) { + t.notOk(err, 'no error present') t.end() }) }) diff --git a/deps/npm/node_modules/npm-package-arg/README.md b/deps/npm/node_modules/npm-package-arg/README.md index d37b35533a8f08..82968a4bef8c0f 100644 --- a/deps/npm/node_modules/npm-package-arg/README.md +++ b/deps/npm/node_modules/npm-package-arg/README.md @@ -99,3 +99,7 @@ keys: * `scope` - If a name is something like `@org/module` then the `scope` field will be set to `org`. If it doesn't have a scoped name, then scope is `null`. + +If you only include a name and no specifier part, eg, `foo` or `foo@` then +a default of `latest` will be used (as of 4.1.0). This is contrast with +previous behavior where `*` was used. diff --git a/deps/npm/node_modules/npm-package-arg/npa.js b/deps/npm/node_modules/npm-package-arg/npa.js index 2cba4cfb1591b9..8989049ec86375 100644 --- a/deps/npm/node_modules/npm-package-arg/npa.js +++ b/deps/npm/node_modules/npm-package-arg/npa.js @@ -82,6 +82,7 @@ function npa (arg) { // if it's got / chars in it, then assume that it's local. if (res.name) { + if (arg == '') arg = 'latest' var version = semver.valid(arg, true) var range = semver.validRange(arg, true) // foo@... @@ -101,8 +102,8 @@ function npa (arg) { var p = arg.match(parseName) if (p && validName(p[2]) && (!p[1] || validName(p[1]))) { - res.type = "range" - res.spec = "*" + res.type = "tag" + res.spec = "latest" res.rawSpec = "" res.name = arg if (p[1]) diff --git a/deps/npm/node_modules/npm-package-arg/package.json b/deps/npm/node_modules/npm-package-arg/package.json index 9caed85e739668..ec518ddf5da4d2 100644 --- a/deps/npm/node_modules/npm-package-arg/package.json +++ b/deps/npm/node_modules/npm-package-arg/package.json @@ -1,39 +1,90 @@ { - "name": "npm-package-arg", - "version": "4.0.2", - "description": "Parse the things that can be arguments to `npm install`", - "main": "npa.js", - "directories": { - "test": "test" + "_args": [ + [ + "npm-package-arg@~4.1.0", + "/Users/rebecca/code/npm" + ] + ], + "_from": "npm-package-arg@>=4.1.0 <4.2.0", + "_id": "npm-package-arg@4.1.0", + "_inCache": true, + "_installable": true, + "_location": "/npm-package-arg", + "_nodeVersion": "4.2.1", + "_npmUser": { + "email": "me@re-becca.org", + "name": "iarna" + }, + "_npmVersion": "3.4.0", + "_phantomChildren": {}, + "_requested": { + "name": "npm-package-arg", + "raw": "npm-package-arg@~4.1.0", + "rawSpec": "~4.1.0", + "scope": null, + "spec": ">=4.1.0 <4.2.0", + "type": "range" + }, + "_requiredBy": [ + "/", + "/init-package-json", + "/npm-registry-client", + "/realize-package-specifier" + ], + "_shasum": "2e015f8ac00737cb97f997c9cbf059f42a74527d", + "_shrinkwrap": null, + "_spec": "npm-package-arg@~4.1.0", + "_where": "/Users/rebecca/code/npm", + "author": { + "email": "i@izs.me", + "name": "Isaac Z. Schlueter", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/npm/npm-package-arg/issues" }, "dependencies": { "hosted-git-info": "^2.1.4", "semver": "4 || 5" }, + "description": "Parse the things that can be arguments to `npm install`", "devDependencies": { "tap": "^1.2.0" }, - "scripts": { - "test": "tap test/*.js" + "directories": { + "test": "test" + }, + "dist": { + "shasum": "2e015f8ac00737cb97f997c9cbf059f42a74527d", + "tarball": "http://registry.npmjs.org/npm-package-arg/-/npm-package-arg-4.1.0.tgz" }, + "gitHead": "383b4783a076b825815be51eb1ab2e4bb8a1e1fc", + "homepage": "https://github.com/npm/npm-package-arg", + "license": "ISC", + "main": "npa.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "npm-package-arg", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git+https://github.com/npm/npm-package-arg.git" }, - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "ISC", - "bugs": { - "url": "https://github.com/npm/npm-package-arg/issues" + "scripts": { + "test": "tap test/*.js" }, - "homepage": "https://github.com/npm/npm-package-arg", - "readme": "# npm-package-arg\n\nParse package name and specifier passed to commands like `npm install` or\n`npm cache add`. This just parses the text given-- it's worth noting that\n`npm` has further logic it applies by looking at your disk to figure out\nwhat ambiguous specifiers are. If you want that logic, please see\n[realize-package-specifier].\n\n[realize-package-specifier]: https://www.npmjs.org/package/realize-package-specifier\n\nArguments look like: `foo@1.2`, `@bar/foo@1.2`, `foo@user/foo`, `http://x.com/foo.tgz`,\n`git+https://github.com/user/foo`, `bitbucket:user/foo`, `foo.tar.gz` or `bar`\n\n## EXAMPLES\n\n```javascript\nvar assert = require(\"assert\")\nvar npa = require(\"npm-package-arg\")\n\n// Pass in the descriptor, and it'll return an object\nvar parsed = npa(\"@bar/foo@1.2\")\n\n// Returns an object like:\n{\n raw: '@bar/foo@1.2', // what was passed in\n name: \"@bar/foo\", // the name of the package\n scope: \"@bar\", // the private scope of the package, or null\n type: \"range\", // the type of specifier this is\n spec: \">=1.2.0 <1.3.0\" // the expanded specifier\n rawSpec: \"1.2\" // the specifier as passed in\n }\n\n// Parsing urls pointing at hosted git services produces a variation:\nvar parsed = npa(\"git+https://github.com/user/foo\")\n\n// Returns an object like:\n{\n raw: 'git+https://github.com/user/foo',\n scope: null,\n name: null,\n rawSpec: 'git+https://github.com/user/foo',\n spec: 'user/foo',\n type: 'hosted',\n hosted: {\n type: 'github',\n ssh: 'git@github.com:user/foo.git',\n sshurl: 'git+ssh://git@github.com/user/foo.git',\n https: 'https://github.com/user/foo.git',\n directUrl: 'https://raw.githubusercontent.com/user/foo/master/package.json'\n }\n}\n\n// Completely unreasonable invalid garbage throws an error\n// Make sure you wrap this in a try/catch if you have not\n// already sanitized the inputs!\nassert.throws(function() {\n npa(\"this is not \\0 a valid package name or url\")\n})\n```\n\n## USING\n\n`var npa = require('npm-package-arg')`\n\n* var result = npa(*arg*)\n\nParses *arg* and returns a result object detailing what *arg* is.\n\n*arg* -- a package descriptor, like: `foo@1.2`, or `foo@user/foo`, or\n`http://x.com/foo.tgz`, or `git+https://github.com/user/foo`\n\n## RESULT OBJECT\n\nThe objects that are returned by npm-package-arg contain the following\nkeys:\n\n* `name` - If known, the `name` field expected in the resulting pkg.\n* `type` - One of the following strings:\n * `git` - A git repo\n * `hosted` - A hosted project, from github, bitbucket or gitlab. Originally\n either a full url pointing at one of these services or a shorthand like\n `user/project` or `github:user/project` for github or `bitbucket:user/project`\n for bitbucket.\n * `tag` - A tagged version, like `\"foo@latest\"`\n * `version` - A specific version number, like `\"foo@1.2.3\"`\n * `range` - A version range, like `\"foo@2.x\"`\n * `local` - A local file or folder path\n * `remote` - An http url (presumably to a tgz)\n* `spec` - The \"thing\". URL, the range, git repo, etc.\n* `hosted` - If type=hosted this will be an object with the following keys:\n * `type` - github, bitbucket or gitlab\n * `ssh` - The ssh path for this git repo\n * `sshUrl` - The ssh URL for this git repo\n * `httpsUrl` - The HTTPS URL for this git repo\n * `directUrl` - The URL for the package.json in this git repo\n* `raw` - The original un-modified string that was provided.\n* `rawSpec` - The part after the `name@...`, as it was originally\n provided.\n* `scope` - If a name is something like `@org/module` then the `scope`\n field will be set to `org`. If it doesn't have a scoped name, then\n scope is `null`.\n", - "readmeFilename": "README.md", - "gitHead": "8d3c51c33807fabde4db86a3811831b756eaf2eb", - "_id": "npm-package-arg@4.0.2", - "_shasum": "3f28235f9f6428e54bfeca73629e27d6c81a7e82", - "_from": "npm-package-arg@>=4.0.2 <4.1.0" + "version": "4.1.0" } diff --git a/deps/npm/node_modules/npm-package-arg/test/basic.js b/deps/npm/node_modules/npm-package-arg/test/basic.js index a3d58c88c50380..b72826b901a36a 100644 --- a/deps/npm/node_modules/npm-package-arg/test/basic.js +++ b/deps/npm/node_modules/npm-package-arg/test/basic.js @@ -18,8 +18,8 @@ require("tap").test("basic", function (t) { name: "@foo/bar", scope: "@foo", rawSpec: "", - spec: "*", - type: "range" + spec: "latest", + type: "tag" }, "@foo/bar@": { @@ -27,8 +27,8 @@ require("tap").test("basic", function (t) { name: "@foo/bar", scope: "@foo", rawSpec: "", - spec: "*", - type: "range" + spec: "latest", + type: "tag" }, "@foo/bar@baz": { @@ -143,8 +143,8 @@ require("tap").test("basic", function (t) { "foo": { name: "foo", - type: "range", - spec: "*", + type: "tag", + spec: "latest", raw: "foo" } } diff --git a/deps/npm/node_modules/npm-registry-client/README.md b/deps/npm/node_modules/npm-registry-client/README.md index fb3226cf401b5b..2caa3643708f80 100644 --- a/deps/npm/node_modules/npm-registry-client/README.md +++ b/deps/npm/node_modules/npm-registry-client/README.md @@ -310,5 +310,9 @@ any): Default = `"latest"` * `couchToken` {Object} A token for use with [couch-login](https://npmjs.org/package/couch-login). -* `sessionToken` {string} A random identifier for this set of client requests. +* `sessionToken` {String} A random identifier for this set of client requests. Default = 8 random hexadecimal bytes. +* `maxSockets` {Number} The maximum number of connections that will be open per + origin (unique combination of protocol:host:port). Passed to the + [httpAgent](https://nodejs.org/api/http.html#http_agent_maxsockets). + Default = 50 diff --git a/deps/npm/node_modules/npm-registry-client/index.js b/deps/npm/node_modules/npm-registry-client/index.js index 9b99a23738f103..a199801f98da99 100644 --- a/deps/npm/node_modules/npm-registry-client/index.js +++ b/deps/npm/node_modules/npm-registry-client/index.js @@ -39,6 +39,7 @@ function RegClient (config) { if (typeof this.config.retry.factor !== 'number') this.config.retry.factor = 10 if (typeof this.config.retry.minTimeout !== 'number') this.config.retry.minTimeout = 10000 if (typeof this.config.retry.maxTimeout !== 'number') this.config.retry.maxTimeout = 60000 + if (typeof this.config.maxSockets !== 'number') this.config.maxSockets = 50 this.config.userAgent = this.config.userAgent || 'node/' + process.version this.config.defaultTag = this.config.defaultTag || 'latest' diff --git a/deps/npm/node_modules/npm-registry-client/lib/access.js b/deps/npm/node_modules/npm-registry-client/lib/access.js index badb770ea49a75..ff01e95e282d83 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/access.js +++ b/deps/npm/node_modules/npm-registry-client/lib/access.js @@ -102,20 +102,20 @@ function accessAssertions (subcommand, uri, params, cb) { 'callback': [cb, 'function'] }) if (contains([ - 'public', 'restricted', 'grant', 'revoke', 'ls-collaborators' + 'public', 'restricted' ], subcommand)) { - typeChecks({ 'package': [params.package, 'string']}) + typeChecks({ 'package': [params.package, 'string'] }) assert(!!npa(params.package).scope, 'access commands are only accessible for scoped packages') } if (contains(['grant', 'revoke', 'ls-packages'], subcommand)) { - typeChecks({ 'scope': [params.scope, 'string']}) + typeChecks({ 'scope': [params.scope, 'string'] }) } if (contains(['grant', 'revoke'], subcommand)) { - typeChecks({ 'team': [params.team, 'string']}) + typeChecks({ 'team': [params.team, 'string'] }) } if (subcommand === 'grant') { - typeChecks({ 'permissions': [params.permissions, 'string']}) + typeChecks({ 'permissions': [params.permissions, 'string'] }) assert(params.permissions === 'read-only' || params.permissions === 'read-write', 'permissions must be either read-only or read-write') diff --git a/deps/npm/node_modules/npm-registry-client/lib/initialize.js b/deps/npm/node_modules/npm-registry-client/lib/initialize.js index 4a2160fbbdad8a..3c12697f03cba6 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/initialize.js +++ b/deps/npm/node_modules/npm-registry-client/lib/initialize.js @@ -4,9 +4,6 @@ var HttpsAgent = require('https').Agent var pkg = require('../package.json') -var httpAgent -var httpsAgent - module.exports = initialize function initialize (uri, method, accept, headers) { @@ -24,7 +21,7 @@ function initialize (uri, method, accept, headers) { cert: this.config.ssl.certificate, key: this.config.ssl.key, ca: this.config.ssl.ca, - agent: getAgent(uri.protocol, this.config) + agent: getAgent.call(this, uri.protocol) } // allow explicit disabling of proxy in environment via CLI @@ -55,28 +52,30 @@ function initialize (uri, method, accept, headers) { return opts } -function getAgent (protocol, config) { +function getAgent (protocol) { if (protocol === 'https:') { - if (!httpsAgent) { - httpsAgent = new HttpsAgent({ + if (!this.httpsAgent) { + this.httpsAgent = new HttpsAgent({ keepAlive: true, - localAddress: config.proxy.localAddress, - rejectUnauthorized: config.ssl.strict, - ca: config.ssl.ca, - cert: config.ssl.certificate, - key: config.ssl.key + maxSockets: this.config.maxSockets, + localAddress: this.config.proxy.localAddress, + rejectUnauthorized: this.config.ssl.strict, + ca: this.config.ssl.ca, + cert: this.config.ssl.certificate, + key: this.config.ssl.key }) } - return httpsAgent + return this.httpsAgent } else { - if (!httpAgent) { - httpAgent = new HttpAgent({ + if (!this.httpAgent) { + this.httpAgent = new HttpAgent({ keepAlive: true, - localAddress: config.proxy.localAddress + maxSockets: this.config.maxSockets, + localAddress: this.config.proxy.localAddress }) } - return httpAgent + return this.httpAgent } } diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/LICENSE b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/LICENSE index 99c130e1de3427..1e836b4760025f 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/LICENSE +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/LICENSE @@ -2,23 +2,23 @@ The MIT License Copyright (c) 2013 Max Ogden -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, +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 +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 +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. \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.npmignore b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.npmignore deleted file mode 100644 index 38344f87a62766..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -build/ -test/ -examples/ -fs.js -zlib.js \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.travis.yml b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.travis.yml deleted file mode 100644 index a2870dfb162343..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.travis.yml +++ /dev/null @@ -1,39 +0,0 @@ -sudo: false -language: node_js -before_install: - - npm install -g npm -notifications: - email: false -matrix: - include: - - node_js: '0.8' - env: TASK=test - - node_js: '0.10' - env: TASK=test - - node_js: '0.11' - env: TASK=test - - node_js: '0.12' - env: TASK=test - - node_js: 'iojs' - env: TASK=test - - node_js: 'iojs' - env: TASK=browser BROWSER_NAME=opera BROWSER_VERSION="11..latest" - - node_js: 'iojs' - env: TASK=browser BROWSER_NAME=ie BROWSER_VERSION="9..latest" - - node_js: 'iojs' - env: TASK=browser BROWSER_NAME=chrome BROWSER_VERSION="39..beta" - - node_js: 'iojs' - env: TASK=browser BROWSER_NAME=firefox BROWSER_VERSION="34..beta" - - node_js: 'iojs' - env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="6.0..latest" - - node_js: 'iojs' - env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="6.0..latest" - - node_js: 'iojs' - env: TASK=browser BROWSER_NAME=safari BROWSER_VERSION="5..latest" - - node_js: 'iojs' - env: TASK=browser BROWSER_NAME=android BROWSER_VERSION="4.0..latest" -script: "npm run $TASK" -env: - global: - - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= - - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/README.md deleted file mode 100644 index 77fafa3da15f9f..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# readable-stream - -***Node-core streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) - - -[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) -[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) - - -[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) - -```bash -npm install --save readable-stream -``` - -***Node-core streams for userland*** - -This package is a mirror of the Streams2 and Streams3 implementations in -Node-core, including [documentation](doc/stream.markdown). - -If you want to guarantee a stable streams base, regardless of what version of -Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). - -As of version 2.0.0 **readable-stream** uses semantic versioning. - -# Streams WG Team Members - -* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> - - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B -* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> - - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 -* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> - - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D -* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> -* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> -* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/stream.markdown b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/stream.markdown deleted file mode 100644 index a2270c88057950..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/stream.markdown +++ /dev/null @@ -1,1651 +0,0 @@ -# Stream - - Stability: 2 - Stable - -A stream is an abstract interface implemented by various objects in -io.js. For example a [request to an HTTP -server](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_http_incomingmessage) is a stream, as is -[stdout][]. Streams are readable, writable, or both. All streams are -instances of [EventEmitter][] - -You can load the Stream base classes by doing `require('stream')`. -There are base classes provided for [Readable][] streams, [Writable][] -streams, [Duplex][] streams, and [Transform][] streams. - -This document is split up into 3 sections. The first explains the -parts of the API that you need to be aware of to use streams in your -programs. If you never implement a streaming API yourself, you can -stop there. - -The second section explains the parts of the API that you need to use -if you implement your own custom streams yourself. The API is -designed to make this easy for you to do. - -The third section goes into more depth about how streams work, -including some of the internal mechanisms and functions that you -should probably not modify unless you definitely know what you are -doing. - - -## API for Stream Consumers - - - -Streams can be either [Readable][], [Writable][], or both ([Duplex][]). - -All streams are EventEmitters, but they also have other custom methods -and properties depending on whether they are Readable, Writable, or -Duplex. - -If a stream is both Readable and Writable, then it implements all of -the methods and events below. So, a [Duplex][] or [Transform][] stream is -fully described by this API, though their implementation may be -somewhat different. - -It is not necessary to implement Stream interfaces in order to consume -streams in your programs. If you **are** implementing streaming -interfaces in your own program, please also refer to -[API for Stream Implementors][] below. - -Almost all io.js programs, no matter how simple, use Streams in some -way. Here is an example of using Streams in an io.js program: - -```javascript -var http = require('http'); - -var server = http.createServer(function (req, res) { - // req is an http.IncomingMessage, which is a Readable Stream - // res is an http.ServerResponse, which is a Writable Stream - - var body = ''; - // we want to get the data as utf8 strings - // If you don't set an encoding, then you'll get Buffer objects - req.setEncoding('utf8'); - - // Readable streams emit 'data' events once a listener is added - req.on('data', function (chunk) { - body += chunk; - }); - - // the end event tells you that you have entire body - req.on('end', function () { - try { - var data = JSON.parse(body); - } catch (er) { - // uh oh! bad json! - res.statusCode = 400; - return res.end('error: ' + er.message); - } - - // write back something interesting to the user: - res.write(typeof data); - res.end(); - }); -}); - -server.listen(1337); - -// $ curl localhost:1337 -d '{}' -// object -// $ curl localhost:1337 -d '"foo"' -// string -// $ curl localhost:1337 -d 'not json' -// error: Unexpected token o -``` - -### Class: stream.Readable - - - -The Readable stream interface is the abstraction for a *source* of -data that you are reading from. In other words, data comes *out* of a -Readable stream. - -A Readable stream will not start emitting data until you indicate that -you are ready to receive it. - -Readable streams have two "modes": a **flowing mode** and a **paused -mode**. When in flowing mode, data is read from the underlying system -and provided to your program as fast as possible. In paused mode, you -must explicitly call `stream.read()` to get chunks of data out. -Streams start out in paused mode. - -**Note**: If no data event handlers are attached, and there are no -[`pipe()`][] destinations, and the stream is switched into flowing -mode, then data will be lost. - -You can switch to flowing mode by doing any of the following: - -* Adding a [`'data'` event][] handler to listen for data. -* Calling the [`resume()`][] method to explicitly open the flow. -* Calling the [`pipe()`][] method to send the data to a [Writable][]. - -You can switch back to paused mode by doing either of the following: - -* If there are no pipe destinations, by calling the [`pause()`][] - method. -* If there are pipe destinations, by removing any [`'data'` event][] - handlers, and removing all pipe destinations by calling the - [`unpipe()`][] method. - -Note that, for backwards compatibility reasons, removing `'data'` -event handlers will **not** automatically pause the stream. Also, if -there are piped destinations, then calling `pause()` will not -guarantee that the stream will *remain* paused once those -destinations drain and ask for more data. - -Examples of readable streams include: - -* [http responses, on the client](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_http_incomingmessage) -* [http requests, on the server](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_http_incomingmessage) -* [fs read streams](https://iojs.org/dist/v2.3.0/doc/api/fs.html#fs_class_fs_readstream) -* [zlib streams][] -* [crypto streams][] -* [tcp sockets][] -* [child process stdout and stderr][] -* [process.stdin][] - -#### Event: 'readable' - -When a chunk of data can be read from the stream, it will emit a -`'readable'` event. - -In some cases, listening for a `'readable'` event will cause some data -to be read into the internal buffer from the underlying system, if it -hadn't already. - -```javascript -var readable = getReadableStreamSomehow(); -readable.on('readable', function() { - // there is some data to read now -}); -``` - -Once the internal buffer is drained, a `readable` event will fire -again when more data is available. - -#### Event: 'data' - -* `chunk` {Buffer | String} The chunk of data. - -Attaching a `data` event listener to a stream that has not been -explicitly paused will switch the stream into flowing mode. Data will -then be passed as soon as it is available. - -If you just want to get all the data out of the stream as fast as -possible, this is the best way to do so. - -```javascript -var readable = getReadableStreamSomehow(); -readable.on('data', function(chunk) { - console.log('got %d bytes of data', chunk.length); -}); -``` - -#### Event: 'end' - -This event fires when there will be no more data to read. - -Note that the `end` event **will not fire** unless the data is -completely consumed. This can be done by switching into flowing mode, -or by calling `read()` repeatedly until you get to the end. - -```javascript -var readable = getReadableStreamSomehow(); -readable.on('data', function(chunk) { - console.log('got %d bytes of data', chunk.length); -}); -readable.on('end', function() { - console.log('there will be no more data.'); -}); -``` - -#### Event: 'close' - -Emitted when the underlying resource (for example, the backing file -descriptor) has been closed. Not all streams will emit this. - -#### Event: 'error' - -* {Error Object} - -Emitted if there was an error receiving data. - -#### readable.read([size]) - -* `size` {Number} Optional argument to specify how much data to read. -* Return {String | Buffer | null} - -The `read()` method pulls some data out of the internal buffer and -returns it. If there is no data available, then it will return -`null`. - -If you pass in a `size` argument, then it will return that many -bytes. If `size` bytes are not available, then it will return `null`. - -If you do not specify a `size` argument, then it will return all the -data in the internal buffer. - -This method should only be called in paused mode. In flowing mode, -this method is called automatically until the internal buffer is -drained. - -```javascript -var readable = getReadableStreamSomehow(); -readable.on('readable', function() { - var chunk; - while (null !== (chunk = readable.read())) { - console.log('got %d bytes of data', chunk.length); - } -}); -``` - -If this method returns a data chunk, then it will also trigger the -emission of a [`'data'` event][]. - -#### readable.setEncoding(encoding) - -* `encoding` {String} The encoding to use. -* Return: `this` - -Call this function to cause the stream to return strings of the -specified encoding instead of Buffer objects. For example, if you do -`readable.setEncoding('utf8')`, then the output data will be -interpreted as UTF-8 data, and returned as strings. If you do -`readable.setEncoding('hex')`, then the data will be encoded in -hexadecimal string format. - -This properly handles multi-byte characters that would otherwise be -potentially mangled if you simply pulled the Buffers directly and -called `buf.toString(encoding)` on them. If you want to read the data -as strings, always use this method. - -```javascript -var readable = getReadableStreamSomehow(); -readable.setEncoding('utf8'); -readable.on('data', function(chunk) { - assert.equal(typeof chunk, 'string'); - console.log('got %d characters of string data', chunk.length); -}); -``` - -#### readable.resume() - -* Return: `this` - -This method will cause the readable stream to resume emitting `data` -events. - -This method will switch the stream into flowing mode. If you do *not* -want to consume the data from a stream, but you *do* want to get to -its `end` event, you can call [`readable.resume()`][] to open the flow of -data. - -```javascript -var readable = getReadableStreamSomehow(); -readable.resume(); -readable.on('end', function() { - console.log('got to the end, but did not read anything'); -}); -``` - -#### readable.pause() - -* Return: `this` - -This method will cause a stream in flowing mode to stop emitting -`data` events, switching out of flowing mode. Any data that becomes -available will remain in the internal buffer. - -```javascript -var readable = getReadableStreamSomehow(); -readable.on('data', function(chunk) { - console.log('got %d bytes of data', chunk.length); - readable.pause(); - console.log('there will be no more data for 1 second'); - setTimeout(function() { - console.log('now data will start flowing again'); - readable.resume(); - }, 1000); -}); -``` - -#### readable.isPaused() - -* Return: `Boolean` - -This method returns whether or not the `readable` has been **explicitly** -paused by client code (using `readable.pause()` without a corresponding -`readable.resume()`). - -```javascript -var readable = new stream.Readable - -readable.isPaused() // === false -readable.pause() -readable.isPaused() // === true -readable.resume() -readable.isPaused() // === false -``` - -#### readable.pipe(destination[, options]) - -* `destination` {[Writable][] Stream} The destination for writing data -* `options` {Object} Pipe options - * `end` {Boolean} End the writer when the reader ends. Default = `true` - -This method pulls all the data out of a readable stream, and writes it -to the supplied destination, automatically managing the flow so that -the destination is not overwhelmed by a fast readable stream. - -Multiple destinations can be piped to safely. - -```javascript -var readable = getReadableStreamSomehow(); -var writable = fs.createWriteStream('file.txt'); -// All the data from readable goes into 'file.txt' -readable.pipe(writable); -``` - -This function returns the destination stream, so you can set up pipe -chains like so: - -```javascript -var r = fs.createReadStream('file.txt'); -var z = zlib.createGzip(); -var w = fs.createWriteStream('file.txt.gz'); -r.pipe(z).pipe(w); -``` - -For example, emulating the Unix `cat` command: - -```javascript -process.stdin.pipe(process.stdout); -``` - -By default [`end()`][] is called on the destination when the source stream -emits `end`, so that `destination` is no longer writable. Pass `{ end: -false }` as `options` to keep the destination stream open. - -This keeps `writer` open so that "Goodbye" can be written at the -end. - -```javascript -reader.pipe(writer, { end: false }); -reader.on('end', function() { - writer.end('Goodbye\n'); -}); -``` - -Note that `process.stderr` and `process.stdout` are never closed until -the process exits, regardless of the specified options. - -#### readable.unpipe([destination]) - -* `destination` {[Writable][] Stream} Optional specific stream to unpipe - -This method will remove the hooks set up for a previous `pipe()` call. - -If the destination is not specified, then all pipes are removed. - -If the destination is specified, but no pipe is set up for it, then -this is a no-op. - -```javascript -var readable = getReadableStreamSomehow(); -var writable = fs.createWriteStream('file.txt'); -// All the data from readable goes into 'file.txt', -// but only for the first second -readable.pipe(writable); -setTimeout(function() { - console.log('stop writing to file.txt'); - readable.unpipe(writable); - console.log('manually close the file stream'); - writable.end(); -}, 1000); -``` - -#### readable.unshift(chunk) - -* `chunk` {Buffer | String} Chunk of data to unshift onto the read queue - -This is useful in certain cases where a stream is being consumed by a -parser, which needs to "un-consume" some data that it has -optimistically pulled out of the source, so that the stream can be -passed on to some other party. - -If you find that you must often call `stream.unshift(chunk)` in your -programs, consider implementing a [Transform][] stream instead. (See API -for Stream Implementors, below.) - -```javascript -// Pull off a header delimited by \n\n -// use unshift() if we get too much -// Call the callback with (error, header, stream) -var StringDecoder = require('string_decoder').StringDecoder; -function parseHeader(stream, callback) { - stream.on('error', callback); - stream.on('readable', onReadable); - var decoder = new StringDecoder('utf8'); - var header = ''; - function onReadable() { - var chunk; - while (null !== (chunk = stream.read())) { - var str = decoder.write(chunk); - if (str.match(/\n\n/)) { - // found the header boundary - var split = str.split(/\n\n/); - header += split.shift(); - var remaining = split.join('\n\n'); - var buf = new Buffer(remaining, 'utf8'); - if (buf.length) - stream.unshift(buf); - stream.removeListener('error', callback); - stream.removeListener('readable', onReadable); - // now the body of the message can be read from the stream. - callback(null, header, stream); - } else { - // still reading the header. - header += str; - } - } - } -} -``` - -#### readable.wrap(stream) - -* `stream` {Stream} An "old style" readable stream - -Versions of Node.js prior to v0.10 had streams that did not implement the -entire Streams API as it is today. (See "Compatibility" below for -more information.) - -If you are using an older io.js library that emits `'data'` events and -has a [`pause()`][] method that is advisory only, then you can use the -`wrap()` method to create a [Readable][] stream that uses the old stream -as its data source. - -You will very rarely ever need to call this function, but it exists -as a convenience for interacting with old io.js programs and libraries. - -For example: - -```javascript -var OldReader = require('./old-api-module.js').OldReader; -var oreader = new OldReader; -var Readable = require('stream').Readable; -var myReader = new Readable().wrap(oreader); - -myReader.on('readable', function() { - myReader.read(); // etc. -}); -``` - - -### Class: stream.Writable - - - -The Writable stream interface is an abstraction for a *destination* -that you are writing data *to*. - -Examples of writable streams include: - -* [http requests, on the client](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_class_http_clientrequest) -* [http responses, on the server](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_class_http_serverresponse) -* [fs write streams](https://iojs.org/dist/v2.3.0/doc/api/fs.html#fs_class_fs_writestream) -* [zlib streams][] -* [crypto streams][] -* [tcp sockets][] -* [child process stdin](https://iojs.org/dist/v2.3.0/doc/api/child_process.html#child_process_child_stdin) -* [process.stdout][], [process.stderr][] - -#### writable.write(chunk[, encoding][, callback]) - -* `chunk` {String | Buffer} The data to write -* `encoding` {String} The encoding, if `chunk` is a String -* `callback` {Function} Callback for when this chunk of data is flushed -* Returns: {Boolean} True if the data was handled completely. - -This method writes some data to the underlying system, and calls the -supplied callback once the data has been fully handled. - -The return value indicates if you should continue writing right now. -If the data had to be buffered internally, then it will return -`false`. Otherwise, it will return `true`. - -This return value is strictly advisory. You MAY continue to write, -even if it returns `false`. However, writes will be buffered in -memory, so it is best not to do this excessively. Instead, wait for -the `drain` event before writing more data. - -#### Event: 'drain' - -If a [`writable.write(chunk)`][] call returns false, then the `drain` -event will indicate when it is appropriate to begin writing more data -to the stream. - -```javascript -// Write the data to the supplied writable stream 1MM times. -// Be attentive to back-pressure. -function writeOneMillionTimes(writer, data, encoding, callback) { - var i = 1000000; - write(); - function write() { - var ok = true; - do { - i -= 1; - if (i === 0) { - // last time! - writer.write(data, encoding, callback); - } else { - // see if we should continue, or wait - // don't pass the callback, because we're not done yet. - ok = writer.write(data, encoding); - } - } while (i > 0 && ok); - if (i > 0) { - // had to stop early! - // write some more once it drains - writer.once('drain', write); - } - } -} -``` - -#### writable.cork() - -Forces buffering of all writes. - -Buffered data will be flushed either at `.uncork()` or at `.end()` call. - -#### writable.uncork() - -Flush all data, buffered since `.cork()` call. - -#### writable.setDefaultEncoding(encoding) - -* `encoding` {String} The new default encoding - -Sets the default encoding for a writable stream. - -#### writable.end([chunk][, encoding][, callback]) - -* `chunk` {String | Buffer} Optional data to write -* `encoding` {String} The encoding, if `chunk` is a String -* `callback` {Function} Optional callback for when the stream is finished - -Call this method when no more data will be written to the stream. If -supplied, the callback is attached as a listener on the `finish` event. - -Calling [`write()`][] after calling [`end()`][] will raise an error. - -```javascript -// write 'hello, ' and then end with 'world!' -var file = fs.createWriteStream('example.txt'); -file.write('hello, '); -file.end('world!'); -// writing more now is not allowed! -``` - -#### Event: 'finish' - -When the [`end()`][] method has been called, and all data has been flushed -to the underlying system, this event is emitted. - -```javascript -var writer = getWritableStreamSomehow(); -for (var i = 0; i < 100; i ++) { - writer.write('hello, #' + i + '!\n'); -} -writer.end('this is the end\n'); -writer.on('finish', function() { - console.error('all writes are now complete.'); -}); -``` - -#### Event: 'pipe' - -* `src` {[Readable][] Stream} source stream that is piping to this writable - -This is emitted whenever the `pipe()` method is called on a readable -stream, adding this writable to its set of destinations. - -```javascript -var writer = getWritableStreamSomehow(); -var reader = getReadableStreamSomehow(); -writer.on('pipe', function(src) { - console.error('something is piping into the writer'); - assert.equal(src, reader); -}); -reader.pipe(writer); -``` - -#### Event: 'unpipe' - -* `src` {[Readable][] Stream} The source stream that [unpiped][] this writable - -This is emitted whenever the [`unpipe()`][] method is called on a -readable stream, removing this writable from its set of destinations. - -```javascript -var writer = getWritableStreamSomehow(); -var reader = getReadableStreamSomehow(); -writer.on('unpipe', function(src) { - console.error('something has stopped piping into the writer'); - assert.equal(src, reader); -}); -reader.pipe(writer); -reader.unpipe(writer); -``` - -#### Event: 'error' - -* {Error object} - -Emitted if there was an error when writing or piping data. - -### Class: stream.Duplex - -Duplex streams are streams that implement both the [Readable][] and -[Writable][] interfaces. See above for usage. - -Examples of Duplex streams include: - -* [tcp sockets][] -* [zlib streams][] -* [crypto streams][] - - -### Class: stream.Transform - -Transform streams are [Duplex][] streams where the output is in some way -computed from the input. They implement both the [Readable][] and -[Writable][] interfaces. See above for usage. - -Examples of Transform streams include: - -* [zlib streams][] -* [crypto streams][] - - -## API for Stream Implementors - - - -To implement any sort of stream, the pattern is the same: - -1. Extend the appropriate parent class in your own subclass. (The - [`util.inherits`][] method is particularly helpful for this.) -2. Call the appropriate parent class constructor in your constructor, - to be sure that the internal mechanisms are set up properly. -2. Implement one or more specific methods, as detailed below. - -The class to extend and the method(s) to implement depend on the sort -of stream class you are writing: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      -

      Use-case

      -
      -

      Class

      -
      -

      Method(s) to implement

      -
      -

      Reading only

      -
      -

      [Readable](#stream_class_stream_readable_1)

      -
      -

      [_read][]

      -
      -

      Writing only

      -
      -

      [Writable](#stream_class_stream_writable_1)

      -
      -

      [_write][], _writev

      -
      -

      Reading and writing

      -
      -

      [Duplex](#stream_class_stream_duplex_1)

      -
      -

      [_read][], [_write][], _writev

      -
      -

      Operate on written data, then read the result

      -
      -

      [Transform](#stream_class_stream_transform_1)

      -
      -

      _transform, _flush

      -
      - -In your implementation code, it is very important to never call the -methods described in [API for Stream Consumers][] above. Otherwise, you -can potentially cause adverse side effects in programs that consume -your streaming interfaces. - -### Class: stream.Readable - - - -`stream.Readable` is an abstract class designed to be extended with an -underlying implementation of the [`_read(size)`][] method. - -Please see above under [API for Stream Consumers][] for how to consume -streams in your programs. What follows is an explanation of how to -implement Readable streams in your programs. - -#### Example: A Counting Stream - - - -This is a basic example of a Readable stream. It emits the numerals -from 1 to 1,000,000 in ascending order, and then ends. - -```javascript -var Readable = require('stream').Readable; -var util = require('util'); -util.inherits(Counter, Readable); - -function Counter(opt) { - Readable.call(this, opt); - this._max = 1000000; - this._index = 1; -} - -Counter.prototype._read = function() { - var i = this._index++; - if (i > this._max) - this.push(null); - else { - var str = '' + i; - var buf = new Buffer(str, 'ascii'); - this.push(buf); - } -}; -``` - -#### Example: SimpleProtocol v1 (Sub-optimal) - -This is similar to the `parseHeader` function described above, but -implemented as a custom stream. Also, note that this implementation -does not convert the incoming data to a string. - -However, this would be better implemented as a [Transform][] stream. See -below for a better implementation. - -```javascript -// A parser for a simple data protocol. -// The "header" is a JSON object, followed by 2 \n characters, and -// then a message body. -// -// NOTE: This can be done more simply as a Transform stream! -// Using Readable directly for this is sub-optimal. See the -// alternative example below under the Transform section. - -var Readable = require('stream').Readable; -var util = require('util'); - -util.inherits(SimpleProtocol, Readable); - -function SimpleProtocol(source, options) { - if (!(this instanceof SimpleProtocol)) - return new SimpleProtocol(source, options); - - Readable.call(this, options); - this._inBody = false; - this._sawFirstCr = false; - - // source is a readable stream, such as a socket or file - this._source = source; - - var self = this; - source.on('end', function() { - self.push(null); - }); - - // give it a kick whenever the source is readable - // read(0) will not consume any bytes - source.on('readable', function() { - self.read(0); - }); - - this._rawHeader = []; - this.header = null; -} - -SimpleProtocol.prototype._read = function(n) { - if (!this._inBody) { - var chunk = this._source.read(); - - // if the source doesn't have data, we don't have data yet. - if (chunk === null) - return this.push(''); - - // check if the chunk has a \n\n - var split = -1; - for (var i = 0; i < chunk.length; i++) { - if (chunk[i] === 10) { // '\n' - if (this._sawFirstCr) { - split = i; - break; - } else { - this._sawFirstCr = true; - } - } else { - this._sawFirstCr = false; - } - } - - if (split === -1) { - // still waiting for the \n\n - // stash the chunk, and try again. - this._rawHeader.push(chunk); - this.push(''); - } else { - this._inBody = true; - var h = chunk.slice(0, split); - this._rawHeader.push(h); - var header = Buffer.concat(this._rawHeader).toString(); - try { - this.header = JSON.parse(header); - } catch (er) { - this.emit('error', new Error('invalid simple protocol data')); - return; - } - // now, because we got some extra data, unshift the rest - // back into the read queue so that our consumer will see it. - var b = chunk.slice(split); - this.unshift(b); - - // and let them know that we are done parsing the header. - this.emit('header', this.header); - } - } else { - // from there on, just provide the data to our consumer. - // careful not to push(null), since that would indicate EOF. - var chunk = this._source.read(); - if (chunk) this.push(chunk); - } -}; - -// Usage: -// var parser = new SimpleProtocol(source); -// Now parser is a readable stream that will emit 'header' -// with the parsed header data. -``` - - -#### new stream.Readable([options]) - -* `options` {Object} - * `highWaterMark` {Number} The maximum number of bytes to store in - the internal buffer before ceasing to read from the underlying - resource. Default=16kb, or 16 for `objectMode` streams - * `encoding` {String} If specified, then buffers will be decoded to - strings using the specified encoding. Default=null - * `objectMode` {Boolean} Whether this stream should behave - as a stream of objects. Meaning that stream.read(n) returns - a single value instead of a Buffer of size n. Default=false - -In classes that extend the Readable class, make sure to call the -Readable constructor so that the buffering settings can be properly -initialized. - -#### readable.\_read(size) - -* `size` {Number} Number of bytes to read asynchronously - -Note: **Implement this function, but do NOT call it directly.** - -This function should NOT be called directly. It should be implemented -by child classes, and only called by the internal Readable class -methods. - -All Readable stream implementations must provide a `_read` method to -fetch data from the underlying resource. - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -When data is available, put it into the read queue by calling -`readable.push(chunk)`. If `push` returns false, then you should stop -reading. When `_read` is called again, you should start pushing more -data. - -The `size` argument is advisory. Implementations where a "read" is a -single call that returns data can use this to know how much data to -fetch. Implementations where that is not relevant, such as TCP or -TLS, may ignore this argument, and simply provide data whenever it -becomes available. There is no need, for example to "wait" until -`size` bytes are available before calling [`stream.push(chunk)`][]. - -#### readable.push(chunk[, encoding]) - -* `chunk` {Buffer | null | String} Chunk of data to push into the read queue -* `encoding` {String} Encoding of String chunks. Must be a valid - Buffer encoding, such as `'utf8'` or `'ascii'` -* return {Boolean} Whether or not more pushes should be performed - -Note: **This function should be called by Readable implementors, NOT -by consumers of Readable streams.** - -The `_read()` function will not be called again until at least one -`push(chunk)` call is made. - -The `Readable` class works by putting data into a read queue to be -pulled out later by calling the `read()` method when the `'readable'` -event fires. - -The `push()` method will explicitly insert some data into the read -queue. If it is called with `null` then it will signal the end of the -data (EOF). - -This API is designed to be as flexible as possible. For example, -you may be wrapping a lower-level source which has some sort of -pause/resume mechanism, and a data callback. In those cases, you -could wrap the low-level source object by doing something like this: - -```javascript -// source is an object with readStop() and readStart() methods, -// and an `ondata` member that gets called when it has data, and -// an `onend` member that gets called when the data is over. - -util.inherits(SourceWrapper, Readable); - -function SourceWrapper(options) { - Readable.call(this, options); - - this._source = getLowlevelSourceObject(); - var self = this; - - // Every time there's data, we push it into the internal buffer. - this._source.ondata = function(chunk) { - // if push() returns false, then we need to stop reading from source - if (!self.push(chunk)) - self._source.readStop(); - }; - - // When the source ends, we push the EOF-signaling `null` chunk - this._source.onend = function() { - self.push(null); - }; -} - -// _read will be called when the stream wants to pull more data in -// the advisory size argument is ignored in this case. -SourceWrapper.prototype._read = function(size) { - this._source.readStart(); -}; -``` - - -### Class: stream.Writable - - - -`stream.Writable` is an abstract class designed to be extended with an -underlying implementation of the [`_write(chunk, encoding, callback)`][] method. - -Please see above under [API for Stream Consumers][] for how to consume -writable streams in your programs. What follows is an explanation of -how to implement Writable streams in your programs. - -#### new stream.Writable([options]) - -* `options` {Object} - * `highWaterMark` {Number} Buffer level when [`write()`][] starts - returning false. Default=16kb, or 16 for `objectMode` streams - * `decodeStrings` {Boolean} Whether or not to decode strings into - Buffers before passing them to [`_write()`][]. Default=true - * `objectMode` {Boolean} Whether or not the `write(anyObj)` is - a valid operation. If set you can write arbitrary data instead - of only `Buffer` / `String` data. Default=false - -In classes that extend the Writable class, make sure to call the -constructor so that the buffering settings can be properly -initialized. - -#### writable.\_write(chunk, encoding, callback) - -* `chunk` {Buffer | String} The chunk to be written. Will **always** - be a buffer unless the `decodeStrings` option was set to `false`. -* `encoding` {String} If the chunk is a string, then this is the - encoding type. If chunk is a buffer, then this is the special - value - 'buffer', ignore it in this case. -* `callback` {Function} Call this function (optionally with an error - argument) when you are done processing the supplied chunk. - -All Writable stream implementations must provide a [`_write()`][] -method to send data to the underlying resource. - -Note: **This function MUST NOT be called directly.** It should be -implemented by child classes, and called by the internal Writable -class methods only. - -Call the callback using the standard `callback(error)` pattern to -signal that the write completed successfully or with an error. - -If the `decodeStrings` flag is set in the constructor options, then -`chunk` may be a string rather than a Buffer, and `encoding` will -indicate the sort of string that it is. This is to support -implementations that have an optimized handling for certain string -data encodings. If you do not explicitly set the `decodeStrings` -option to `false`, then you can safely ignore the `encoding` argument, -and assume that `chunk` will always be a Buffer. - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -#### writable.\_writev(chunks, callback) - -* `chunks` {Array} The chunks to be written. Each chunk has following - format: `{ chunk: ..., encoding: ... }`. -* `callback` {Function} Call this function (optionally with an error - argument) when you are done processing the supplied chunks. - -Note: **This function MUST NOT be called directly.** It may be -implemented by child classes, and called by the internal Writable -class methods only. - -This function is completely optional to implement. In most cases it is -unnecessary. If implemented, it will be called with all the chunks -that are buffered in the write queue. - - -### Class: stream.Duplex - - - -A "duplex" stream is one that is both Readable and Writable, such as a -TCP socket connection. - -Note that `stream.Duplex` is an abstract class designed to be extended -with an underlying implementation of the `_read(size)` and -[`_write(chunk, encoding, callback)`][] methods as you would with a -Readable or Writable stream class. - -Since JavaScript doesn't have multiple prototypal inheritance, this -class prototypally inherits from Readable, and then parasitically from -Writable. It is thus up to the user to implement both the lowlevel -`_read(n)` method as well as the lowlevel -[`_write(chunk, encoding, callback)`][] method on extension duplex classes. - -#### new stream.Duplex(options) - -* `options` {Object} Passed to both Writable and Readable - constructors. Also has the following fields: - * `allowHalfOpen` {Boolean} Default=true. If set to `false`, then - the stream will automatically end the readable side when the - writable side ends and vice versa. - * `readableObjectMode` {Boolean} Default=false. Sets `objectMode` - for readable side of the stream. Has no effect if `objectMode` - is `true`. - * `writableObjectMode` {Boolean} Default=false. Sets `objectMode` - for writable side of the stream. Has no effect if `objectMode` - is `true`. - -In classes that extend the Duplex class, make sure to call the -constructor so that the buffering settings can be properly -initialized. - - -### Class: stream.Transform - -A "transform" stream is a duplex stream where the output is causally -connected in some way to the input, such as a [zlib][] stream or a -[crypto][] stream. - -There is no requirement that the output be the same size as the input, -the same number of chunks, or arrive at the same time. For example, a -Hash stream will only ever have a single chunk of output which is -provided when the input is ended. A zlib stream will produce output -that is either much smaller or much larger than its input. - -Rather than implement the [`_read()`][] and [`_write()`][] methods, Transform -classes must implement the `_transform()` method, and may optionally -also implement the `_flush()` method. (See below.) - -#### new stream.Transform([options]) - -* `options` {Object} Passed to both Writable and Readable - constructors. - -In classes that extend the Transform class, make sure to call the -constructor so that the buffering settings can be properly -initialized. - -#### transform.\_transform(chunk, encoding, callback) - -* `chunk` {Buffer | String} The chunk to be transformed. Will **always** - be a buffer unless the `decodeStrings` option was set to `false`. -* `encoding` {String} If the chunk is a string, then this is the - encoding type. If chunk is a buffer, then this is the special - value - 'buffer', ignore it in this case. -* `callback` {Function} Call this function (optionally with an error - argument and data) when you are done processing the supplied chunk. - -Note: **This function MUST NOT be called directly.** It should be -implemented by child classes, and called by the internal Transform -class methods only. - -All Transform stream implementations must provide a `_transform` -method to accept input and produce output. - -`_transform` should do whatever has to be done in this specific -Transform class, to handle the bytes being written, and pass them off -to the readable portion of the interface. Do asynchronous I/O, -process things, and so on. - -Call `transform.push(outputChunk)` 0 or more times to generate output -from this input chunk, depending on how much data you want to output -as a result of this chunk. - -Call the callback function only when the current chunk is completely -consumed. Note that there may or may not be output as a result of any -particular input chunk. If you supply output as the second argument to the -callback, it will be passed to push method, in other words the following are -equivalent: - -```javascript -transform.prototype._transform = function (data, encoding, callback) { - this.push(data); - callback(); -} - -transform.prototype._transform = function (data, encoding, callback) { - callback(null, data); -} -``` - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -#### transform.\_flush(callback) - -* `callback` {Function} Call this function (optionally with an error - argument) when you are done flushing any remaining data. - -Note: **This function MUST NOT be called directly.** It MAY be implemented -by child classes, and if so, will be called by the internal Transform -class methods only. - -In some cases, your transform operation may need to emit a bit more -data at the end of the stream. For example, a `Zlib` compression -stream will store up some internal state so that it can optimally -compress the output. At the end, however, it needs to do the best it -can with what is left, so that the data will be complete. - -In those cases, you can implement a `_flush` method, which will be -called at the very end, after all the written data is consumed, but -before emitting `end` to signal the end of the readable side. Just -like with `_transform`, call `transform.push(chunk)` zero or more -times, as appropriate, and call `callback` when the flush operation is -complete. - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -#### Events: 'finish' and 'end' - -The [`finish`][] and [`end`][] events are from the parent Writable -and Readable classes respectively. The `finish` event is fired after -`.end()` is called and all chunks have been processed by `_transform`, -`end` is fired after all data has been output which is after the callback -in `_flush` has been called. - -#### Example: `SimpleProtocol` parser v2 - -The example above of a simple protocol parser can be implemented -simply by using the higher level [Transform][] stream class, similar to -the `parseHeader` and `SimpleProtocol v1` examples above. - -In this example, rather than providing the input as an argument, it -would be piped into the parser, which is a more idiomatic io.js stream -approach. - -```javascript -var util = require('util'); -var Transform = require('stream').Transform; -util.inherits(SimpleProtocol, Transform); - -function SimpleProtocol(options) { - if (!(this instanceof SimpleProtocol)) - return new SimpleProtocol(options); - - Transform.call(this, options); - this._inBody = false; - this._sawFirstCr = false; - this._rawHeader = []; - this.header = null; -} - -SimpleProtocol.prototype._transform = function(chunk, encoding, done) { - if (!this._inBody) { - // check if the chunk has a \n\n - var split = -1; - for (var i = 0; i < chunk.length; i++) { - if (chunk[i] === 10) { // '\n' - if (this._sawFirstCr) { - split = i; - break; - } else { - this._sawFirstCr = true; - } - } else { - this._sawFirstCr = false; - } - } - - if (split === -1) { - // still waiting for the \n\n - // stash the chunk, and try again. - this._rawHeader.push(chunk); - } else { - this._inBody = true; - var h = chunk.slice(0, split); - this._rawHeader.push(h); - var header = Buffer.concat(this._rawHeader).toString(); - try { - this.header = JSON.parse(header); - } catch (er) { - this.emit('error', new Error('invalid simple protocol data')); - return; - } - // and let them know that we are done parsing the header. - this.emit('header', this.header); - - // now, because we got some extra data, emit this first. - this.push(chunk.slice(split)); - } - } else { - // from there on, just provide the data to our consumer as-is. - this.push(chunk); - } - done(); -}; - -// Usage: -// var parser = new SimpleProtocol(); -// source.pipe(parser) -// Now parser is a readable stream that will emit 'header' -// with the parsed header data. -``` - - -### Class: stream.PassThrough - -This is a trivial implementation of a [Transform][] stream that simply -passes the input bytes across to the output. Its purpose is mainly -for examples and testing, but there are occasionally use cases where -it can come in handy as a building block for novel sorts of streams. - - -## Simplified Constructor API - - - -In simple cases there is now the added benefit of being able to construct a stream without inheritance. - -This can be done by passing the appropriate methods as constructor options: - -Examples: - -### Readable -```javascript -var readable = new stream.Readable({ - read: function(n) { - // sets this._read under the hood - } -}); -``` - -### Writable -```javascript -var writable = new stream.Writable({ - write: function(chunk, encoding, next) { - // sets this._write under the hood - } -}); - -// or - -var writable = new stream.Writable({ - writev: function(chunks, next) { - // sets this._writev under the hood - } -}); -``` - -### Duplex -```javascript -var duplex = new stream.Duplex({ - read: function(n) { - // sets this._read under the hood - }, - write: function(chunk, encoding, next) { - // sets this._write under the hood - } -}); - -// or - -var duplex = new stream.Duplex({ - read: function(n) { - // sets this._read under the hood - }, - writev: function(chunks, next) { - // sets this._writev under the hood - } -}); -``` - -### Transform -```javascript -var transform = new stream.Transform({ - transform: function(chunk, encoding, next) { - // sets this._transform under the hood - }, - flush: function(done) { - // sets this._flush under the hood - } -}); -``` - -## Streams: Under the Hood - - - -### Buffering - - - -Both Writable and Readable streams will buffer data on an internal -object called `_writableState.buffer` or `_readableState.buffer`, -respectively. - -The amount of data that will potentially be buffered depends on the -`highWaterMark` option which is passed into the constructor. - -Buffering in Readable streams happens when the implementation calls -[`stream.push(chunk)`][]. If the consumer of the Stream does not call -`stream.read()`, then the data will sit in the internal queue until it -is consumed. - -Buffering in Writable streams happens when the user calls -[`stream.write(chunk)`][] repeatedly, even when `write()` returns `false`. - -The purpose of streams, especially with the `pipe()` method, is to -limit the buffering of data to acceptable levels, so that sources and -destinations of varying speed will not overwhelm the available memory. - -### `stream.read(0)` - -There are some cases where you want to trigger a refresh of the -underlying readable stream mechanisms, without actually consuming any -data. In that case, you can call `stream.read(0)`, which will always -return null. - -If the internal read buffer is below the `highWaterMark`, and the -stream is not currently reading, then calling `read(0)` will trigger -a low-level `_read` call. - -There is almost never a need to do this. However, you will see some -cases in io.js's internals where this is done, particularly in the -Readable stream class internals. - -### `stream.push('')` - -Pushing a zero-byte string or Buffer (when not in [Object mode][]) has an -interesting side effect. Because it *is* a call to -[`stream.push()`][], it will end the `reading` process. However, it -does *not* add any data to the readable buffer, so there's nothing for -a user to consume. - -Very rarely, there are cases where you have no data to provide now, -but the consumer of your stream (or, perhaps, another bit of your own -code) will know when to check again, by calling `stream.read(0)`. In -those cases, you *may* call `stream.push('')`. - -So far, the only use case for this functionality is in the -[tls.CryptoStream][] class, which is deprecated in io.js v1.0. If you -find that you have to use `stream.push('')`, please consider another -approach, because it almost certainly indicates that something is -horribly wrong. - -### Compatibility with Older Node.js Versions - - - -In versions of Node.js prior to v0.10, the Readable stream interface was -simpler, but also less powerful and less useful. - -* Rather than waiting for you to call the `read()` method, `'data'` - events would start emitting immediately. If you needed to do some - I/O to decide how to handle data, then you had to store the chunks - in some kind of buffer so that they would not be lost. -* The [`pause()`][] method was advisory, rather than guaranteed. This - meant that you still had to be prepared to receive `'data'` events - even when the stream was in a paused state. - -In io.js v1.0 and Node.js v0.10, the Readable class described below was added. -For backwards compatibility with older Node.js programs, Readable streams -switch into "flowing mode" when a `'data'` event handler is added, or -when the [`resume()`][] method is called. The effect is that, even if -you are not using the new `read()` method and `'readable'` event, you -no longer have to worry about losing `'data'` chunks. - -Most programs will continue to function normally. However, this -introduces an edge case in the following conditions: - -* No [`'data'` event][] handler is added. -* The [`resume()`][] method is never called. -* The stream is not piped to any writable destination. - -For example, consider the following code: - -```javascript -// WARNING! BROKEN! -net.createServer(function(socket) { - - // we add an 'end' method, but never consume the data - socket.on('end', function() { - // It will never get here. - socket.end('I got your message (but didnt read it)\n'); - }); - -}).listen(1337); -``` - -In versions of Node.js prior to v0.10, the incoming message data would be -simply discarded. However, in io.js v1.0 and Node.js v0.10 and beyond, -the socket will remain paused forever. - -The workaround in this situation is to call the `resume()` method to -start the flow of data: - -```javascript -// Workaround -net.createServer(function(socket) { - - socket.on('end', function() { - socket.end('I got your message (but didnt read it)\n'); - }); - - // start the flow of data, discarding it. - socket.resume(); - -}).listen(1337); -``` - -In addition to new Readable streams switching into flowing mode, -pre-v0.10 style streams can be wrapped in a Readable class using the -`wrap()` method. - - -### Object Mode - - - -Normally, Streams operate on Strings and Buffers exclusively. - -Streams that are in **object mode** can emit generic JavaScript values -other than Buffers and Strings. - -A Readable stream in object mode will always return a single item from -a call to `stream.read(size)`, regardless of what the size argument -is. - -A Writable stream in object mode will always ignore the `encoding` -argument to `stream.write(data, encoding)`. - -The special value `null` still retains its special value for object -mode streams. That is, for object mode readable streams, `null` as a -return value from `stream.read()` indicates that there is no more -data, and [`stream.push(null)`][] will signal the end of stream data -(`EOF`). - -No streams in io.js core are object mode streams. This pattern is only -used by userland streaming libraries. - -You should set `objectMode` in your stream child class constructor on -the options object. Setting `objectMode` mid-stream is not safe. - -For Duplex streams `objectMode` can be set exclusively for readable or -writable side with `readableObjectMode` and `writableObjectMode` -respectively. These options can be used to implement parsers and -serializers with Transform streams. - -```javascript -var util = require('util'); -var StringDecoder = require('string_decoder').StringDecoder; -var Transform = require('stream').Transform; -util.inherits(JSONParseStream, Transform); - -// Gets \n-delimited JSON string data, and emits the parsed objects -function JSONParseStream() { - if (!(this instanceof JSONParseStream)) - return new JSONParseStream(); - - Transform.call(this, { readableObjectMode : true }); - - this._buffer = ''; - this._decoder = new StringDecoder('utf8'); -} - -JSONParseStream.prototype._transform = function(chunk, encoding, cb) { - this._buffer += this._decoder.write(chunk); - // split on newlines - var lines = this._buffer.split(/\r?\n/); - // keep the last partial line buffered - this._buffer = lines.pop(); - for (var l = 0; l < lines.length; l++) { - var line = lines[l]; - try { - var obj = JSON.parse(line); - } catch (er) { - this.emit('error', er); - return; - } - // push the parsed object out to the readable consumer - this.push(obj); - } - cb(); -}; - -JSONParseStream.prototype._flush = function(cb) { - // Just handle any leftover - var rem = this._buffer.trim(); - if (rem) { - try { - var obj = JSON.parse(rem); - } catch (er) { - this.emit('error', er); - return; - } - // push the parsed object out to the readable consumer - this.push(obj); - } - cb(); -}; -``` - - -[EventEmitter]: https://iojs.org/dist/v2.3.0/doc/api/events.html#events_class_events_eventemitter -[Object mode]: #stream_object_mode -[`stream.push(chunk)`]: #stream_readable_push_chunk_encoding -[`stream.push(null)`]: #stream_readable_push_chunk_encoding -[`stream.push()`]: #stream_readable_push_chunk_encoding -[`unpipe()`]: #stream_readable_unpipe_destination -[unpiped]: #stream_readable_unpipe_destination -[tcp sockets]: https://iojs.org/dist/v2.3.0/doc/api/net.html#net_class_net_socket -[zlib streams]: zlib.html -[zlib]: zlib.html -[crypto streams]: crypto.html -[crypto]: crypto.html -[tls.CryptoStream]: https://iojs.org/dist/v2.3.0/doc/api/tls.html#tls_class_cryptostream -[process.stdin]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stdin -[stdout]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stdout -[process.stdout]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stdout -[process.stderr]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stderr -[child process stdout and stderr]: https://iojs.org/dist/v2.3.0/doc/api/child_process.html#child_process_child_stdout -[API for Stream Consumers]: #stream_api_for_stream_consumers -[API for Stream Implementors]: #stream_api_for_stream_implementors -[Readable]: #stream_class_stream_readable -[Writable]: #stream_class_stream_writable -[Duplex]: #stream_class_stream_duplex -[Transform]: #stream_class_stream_transform -[`end`]: #stream_event_end -[`finish`]: #stream_event_finish -[`_read(size)`]: #stream_readable_read_size_1 -[`_read()`]: #stream_readable_read_size_1 -[_read]: #stream_readable_read_size_1 -[`writable.write(chunk)`]: #stream_writable_write_chunk_encoding_callback -[`write(chunk, encoding, callback)`]: #stream_writable_write_chunk_encoding_callback -[`write()`]: #stream_writable_write_chunk_encoding_callback -[`stream.write(chunk)`]: #stream_writable_write_chunk_encoding_callback -[`_write(chunk, encoding, callback)`]: #stream_writable_write_chunk_encoding_callback_1 -[`_write()`]: #stream_writable_write_chunk_encoding_callback_1 -[_write]: #stream_writable_write_chunk_encoding_callback_1 -[`util.inherits`]: https://iojs.org/dist/v2.3.0/doc/api/util.html#util_util_inherits_constructor_superconstructor -[`end()`]: #stream_writable_end_chunk_encoding_callback -[`'data'` event]: #stream_event_data -[`resume()`]: #stream_readable_resume -[`readable.resume()`]: #stream_readable_resume -[`pause()`]: #stream_readable_pause -[`unpipe()`]: #stream_readable_unpipe_destination -[`pipe()`]: #stream_readable_pipe_destination_options diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js deleted file mode 100644 index 69558af037cd66..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js +++ /dev/null @@ -1,82 +0,0 @@ -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - -'use strict'; - -/**/ -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) keys.push(key); - return keys; -} -/**/ - - -module.exports = Duplex; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - - - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var Readable = require('./_stream_readable'); -var Writable = require('./_stream_writable'); - -util.inherits(Duplex, Readable); - -var keys = objectKeys(Writable.prototype); -for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) - Duplex.prototype[method] = Writable.prototype[method]; -} - -function Duplex(options) { - if (!(this instanceof Duplex)) - return new Duplex(options); - - Readable.call(this, options); - Writable.call(this, options); - - if (options && options.readable === false) - this.readable = false; - - if (options && options.writable === false) - this.writable = false; - - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) - this.allowHalfOpen = false; - - this.once('end', onend); -} - -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) - return; - - // no more data can be written. - // But allow more writes to happen in this tick. - processNextTick(onEndNT, this); -} - -function onEndNT(self) { - self.end(); -} - -function forEach (xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js deleted file mode 100644 index bddfdd01537a40..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js +++ /dev/null @@ -1,27 +0,0 @@ -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. - -'use strict'; - -module.exports = PassThrough; - -var Transform = require('./_stream_transform'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) - return new PassThrough(options); - - Transform.call(this, options); -} - -PassThrough.prototype._transform = function(chunk, encoding, cb) { - cb(null, chunk); -}; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js deleted file mode 100644 index eef3d825d7a084..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js +++ /dev/null @@ -1,959 +0,0 @@ -'use strict'; - -module.exports = Readable; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - - -/**/ -var isArray = require('isarray'); -/**/ - - -/**/ -var Buffer = require('buffer').Buffer; -/**/ - -Readable.ReadableState = ReadableState; - -var EE = require('events').EventEmitter; - -/**/ -if (!EE.listenerCount) EE.listenerCount = function(emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - - - -/**/ -var Stream; -(function (){try{ - Stream = require('st' + 'ream'); -}catch(_){}finally{ - if (!Stream) - Stream = require('events').EventEmitter; -}}()) -/**/ - -var Buffer = require('buffer').Buffer; - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - - - -/**/ -var debug = require('util'); -if (debug && debug.debuglog) { - debug = debug.debuglog('stream'); -} else { - debug = function () {}; -} -/**/ - -var StringDecoder; - -util.inherits(Readable, Stream); - -function ReadableState(options, stream) { - var Duplex = require('./_stream_duplex'); - - options = options || {}; - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - - if (stream instanceof Duplex) - this.objectMode = this.objectMode || !!options.readableObjectMode; - - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; - - // cast to ints. - this.highWaterMark = ~~this.highWaterMark; - - this.buffer = []; - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // when piping, we only care about 'readable' events that happen - // after read()ing all the bytes and not getting any pushback. - this.ranOut = false; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) - StringDecoder = require('string_decoder/').StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} - -function Readable(options) { - var Duplex = require('./_stream_duplex'); - - if (!(this instanceof Readable)) - return new Readable(options); - - this._readableState = new ReadableState(options, this); - - // legacy - this.readable = true; - - if (options && typeof options.read === 'function') - this._read = options.read; - - Stream.call(this); -} - -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function(chunk, encoding) { - var state = this._readableState; - - if (!state.objectMode && typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = new Buffer(chunk, encoding); - encoding = ''; - } - } - - return readableAddChunk(this, state, chunk, encoding, false); -}; - -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function(chunk) { - var state = this._readableState; - return readableAddChunk(this, state, chunk, '', true); -}; - -Readable.prototype.isPaused = function() { - return this._readableState.flowing === false; -}; - -function readableAddChunk(stream, state, chunk, encoding, addToFront) { - var er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (state.ended && !addToFront) { - var e = new Error('stream.push() after EOF'); - stream.emit('error', e); - } else if (state.endEmitted && addToFront) { - var e = new Error('stream.unshift() after end event'); - stream.emit('error', e); - } else { - if (state.decoder && !addToFront && !encoding) - chunk = state.decoder.write(chunk); - - if (!addToFront) - state.reading = false; - - // if we want the data now, just emit it. - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) - state.buffer.unshift(chunk); - else - state.buffer.push(chunk); - - if (state.needReadable) - emitReadable(stream); - } - - maybeReadMore(stream, state); - } - } else if (!addToFront) { - state.reading = false; - } - - return needMoreData(state); -} - - - -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && - (state.needReadable || - state.length < state.highWaterMark || - state.length === 0); -} - -// backwards compatibility. -Readable.prototype.setEncoding = function(enc) { - if (!StringDecoder) - StringDecoder = require('string_decoder/').StringDecoder; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; -}; - -// Don't raise the hwm > 128MB -var MAX_HWM = 0x800000; -function roundUpToNextPowerOf2(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 - n--; - for (var p = 1; p < 32; p <<= 1) n |= n >> p; - n++; - } - return n; -} - -function howMuchToRead(n, state) { - if (state.length === 0 && state.ended) - return 0; - - if (state.objectMode) - return n === 0 ? 0 : 1; - - if (n === null || isNaN(n)) { - // only flow one buffer at a time - if (state.flowing && state.buffer.length) - return state.buffer[0].length; - else - return state.length; - } - - if (n <= 0) - return 0; - - // If we're asking for more than the target buffer level, - // then raise the water mark. Bump up to the next highest - // power of 2, to prevent increasing it excessively in tiny - // amounts. - if (n > state.highWaterMark) - state.highWaterMark = roundUpToNextPowerOf2(n); - - // don't have that much. return null, unless we've ended. - if (n > state.length) { - if (!state.ended) { - state.needReadable = true; - return 0; - } else { - return state.length; - } - } - - return n; -} - -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function(n) { - debug('read', n); - var state = this._readableState; - var nOrig = n; - - if (typeof n !== 'number' || n > 0) - state.emittedReadable = false; - - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && - state.needReadable && - (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) - endReadable(this); - else - emitReadable(this); - return null; - } - - n = howMuchToRead(n, state); - - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) - endReadable(this); - return null; - } - - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); - - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } - - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } - - if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) - state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - } - - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (doRead && !state.reading) - n = howMuchToRead(nOrig, state); - - var ret; - if (n > 0) - ret = fromList(n, state); - else - ret = null; - - if (ret === null) { - state.needReadable = true; - n = 0; - } - - state.length -= n; - - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (state.length === 0 && !state.ended) - state.needReadable = true; - - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended && state.length === 0) - endReadable(this); - - if (ret !== null) - this.emit('data', ret); - - return ret; -}; - -function chunkInvalid(state, chunk) { - var er = null; - if (!(Buffer.isBuffer(chunk)) && - typeof chunk !== 'string' && - chunk !== null && - chunk !== undefined && - !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} - - -function onEofChunk(stream, state) { - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); -} - -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) - processNextTick(emitReadable_, stream); - else - emitReadable_(stream); - } -} - -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); -} - - -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - processNextTick(maybeReadMore_, stream, state); - } -} - -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && - state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break; - else - len = state.length; - } - state.readingMore = false; -} - -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function(n) { - this.emit('error', new Error('not implemented')); -}; - -Readable.prototype.pipe = function(dest, pipeOpts) { - var src = this; - var state = this._readableState; - - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - - var doEnd = (!pipeOpts || pipeOpts.end !== false) && - dest !== process.stdout && - dest !== process.stderr; - - var endFn = doEnd ? onend : cleanup; - if (state.endEmitted) - processNextTick(endFn); - else - src.once('end', endFn); - - dest.on('unpipe', onunpipe); - function onunpipe(readable) { - debug('onunpipe'); - if (readable === src) { - cleanup(); - } - } - - function onend() { - debug('onend'); - dest.end(); - } - - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', cleanup); - src.removeListener('data', ondata); - - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && - (!dest._writableState || dest._writableState.needDrain)) - ondrain(); - } - - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - var ret = dest.write(chunk); - if (false === ret) { - debug('false write response, pause', - src._readableState.awaitDrain); - src._readableState.awaitDrain++; - src.pause(); - } - } - - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EE.listenerCount(dest, 'error') === 0) - dest.emit('error', er); - } - // This is a brutally ugly hack to make sure that our error handler - // is attached before any userland ones. NEVER DO THIS. - if (!dest._events || !dest._events.error) - dest.on('error', onerror); - else if (isArray(dest._events.error)) - dest._events.error.unshift(onerror); - else - dest._events.error = [onerror, dest._events.error]; - - - - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); - - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } - - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } - - return dest; -}; - -function pipeOnDrain(src) { - return function() { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) - state.awaitDrain--; - if (state.awaitDrain === 0 && EE.listenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; -} - - -Readable.prototype.unpipe = function(dest) { - var state = this._readableState; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) - return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) - return this; - - if (!dest) - dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) - dest.emit('unpipe', this); - return this; - } - - // slow case. multiple pipe destinations. - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - - for (var i = 0; i < len; i++) - dests[i].emit('unpipe', this); - return this; - } - - // try to find the right one. - var i = indexOf(state.pipes, dest); - if (i === -1) - return this; - - state.pipes.splice(i, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) - state.pipes = state.pipes[0]; - - dest.emit('unpipe', this); - - return this; -}; - -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function(ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - - // If listening to data, and it has not explicitly been paused, - // then call resume to start the flow of data on the next tick. - if (ev === 'data' && false !== this._readableState.flowing) { - this.resume(); - } - - if (ev === 'readable' && this.readable) { - var state = this._readableState; - if (!state.readableListening) { - state.readableListening = true; - state.emittedReadable = false; - state.needReadable = true; - if (!state.reading) { - processNextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this, state); - } - } - } - - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; - -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} - -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function() { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - resume(this, state); - } - return this; -}; - -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - processNextTick(resume_, stream, state); - } -} - -function resume_(stream, state) { - if (!state.reading) { - debug('resume read 0'); - stream.read(0); - } - - state.resumeScheduled = false; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) - stream.read(0); -} - -Readable.prototype.pause = function() { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - return this; -}; - -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - if (state.flowing) { - do { - var chunk = stream.read(); - } while (null !== chunk && state.flowing); - } -} - -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function(stream) { - var state = this._readableState; - var paused = false; - - var self = this; - stream.on('end', function() { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) - self.push(chunk); - } - - self.push(null); - }); - - stream.on('data', function(chunk) { - debug('wrapped data'); - if (state.decoder) - chunk = state.decoder.write(chunk); - - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) - return; - else if (!state.objectMode && (!chunk || !chunk.length)) - return; - - var ret = self.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); - - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function(method) { return function() { - return stream[method].apply(stream, arguments); - }; }(i); - } - } - - // proxy certain important events. - var events = ['error', 'close', 'destroy', 'pause', 'resume']; - forEach(events, function(ev) { - stream.on(ev, self.emit.bind(self, ev)); - }); - - // when we try to consume some more bytes, simply unpause the - // underlying stream. - self._read = function(n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); - } - }; - - return self; -}; - - - -// exposed for testing purposes only. -Readable._fromList = fromList; - -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -function fromList(n, state) { - var list = state.buffer; - var length = state.length; - var stringMode = !!state.decoder; - var objectMode = !!state.objectMode; - var ret; - - // nothing in the list, definitely empty. - if (list.length === 0) - return null; - - if (length === 0) - ret = null; - else if (objectMode) - ret = list.shift(); - else if (!n || n >= length) { - // read it all, truncate the array. - if (stringMode) - ret = list.join(''); - else - ret = Buffer.concat(list, length); - list.length = 0; - } else { - // read just some of it. - if (n < list[0].length) { - // just take a part of the first list item. - // slice is the same for buffers and strings. - var buf = list[0]; - ret = buf.slice(0, n); - list[0] = buf.slice(n); - } else if (n === list[0].length) { - // first list is a perfect match - ret = list.shift(); - } else { - // complex case. - // we have enough to cover it, but it spans past the first buffer. - if (stringMode) - ret = ''; - else - ret = new Buffer(n); - - var c = 0; - for (var i = 0, l = list.length; i < l && c < n; i++) { - var buf = list[0]; - var cpy = Math.min(n - c, buf.length); - - if (stringMode) - ret += buf.slice(0, cpy); - else - buf.copy(ret, c, 0, cpy); - - if (cpy < buf.length) - list[0] = buf.slice(cpy); - else - list.shift(); - - c += cpy; - } - } - } - - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) - throw new Error('endReadable called on non-empty stream'); - - if (!state.endEmitted) { - state.ended = true; - processNextTick(endReadableNT, state, stream); - } -} - -function endReadableNT(state, stream) { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } -} - -function forEach (xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} - -function indexOf (xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - return -1; -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js deleted file mode 100644 index 3675d18d915610..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js +++ /dev/null @@ -1,197 +0,0 @@ -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. - -'use strict'; - -module.exports = Transform; - -var Duplex = require('./_stream_duplex'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(Transform, Duplex); - - -function TransformState(stream) { - this.afterTransform = function(er, data) { - return afterTransform(stream, er, data); - }; - - this.needTransform = false; - this.transforming = false; - this.writecb = null; - this.writechunk = null; -} - -function afterTransform(stream, er, data) { - var ts = stream._transformState; - ts.transforming = false; - - var cb = ts.writecb; - - if (!cb) - return stream.emit('error', new Error('no writecb in Transform class')); - - ts.writechunk = null; - ts.writecb = null; - - if (data !== null && data !== undefined) - stream.push(data); - - if (cb) - cb(er); - - var rs = stream._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - stream._read(rs.highWaterMark); - } -} - - -function Transform(options) { - if (!(this instanceof Transform)) - return new Transform(options); - - Duplex.call(this, options); - - this._transformState = new TransformState(this); - - // when the writable side finishes, then flush out anything remaining. - var stream = this; - - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; - - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; - - if (options) { - if (typeof options.transform === 'function') - this._transform = options.transform; - - if (typeof options.flush === 'function') - this._flush = options.flush; - } - - this.once('prefinish', function() { - if (typeof this._flush === 'function') - this._flush(function(er) { - done(stream, er); - }); - else - done(stream); - }); -} - -Transform.prototype.push = function(chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; - -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function(chunk, encoding, cb) { - throw new Error('not implemented'); -}; - -Transform.prototype._write = function(chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || - rs.needReadable || - rs.length < rs.highWaterMark) - this._read(rs.highWaterMark); - } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function(n) { - var ts = this._transformState; - - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; - - -function done(stream, er) { - if (er) - return stream.emit('error', er); - - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - var ws = stream._writableState; - var ts = stream._transformState; - - if (ws.length) - throw new Error('calling transform done when ws.length != 0'); - - if (ts.transforming) - throw new Error('calling transform done when still transforming'); - - return stream.push(null); -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js deleted file mode 100644 index b232952016a9c1..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js +++ /dev/null @@ -1,520 +0,0 @@ -// A bit simpler than readable streams. -// Implement an async ._write(chunk, cb), and it'll handle all -// the drain event emission and buffering. - -'use strict'; - -module.exports = Writable; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - - -/**/ -var Buffer = require('buffer').Buffer; -/**/ - -Writable.WritableState = WritableState; - - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - - - -/**/ -var Stream; -(function (){try{ - Stream = require('st' + 'ream'); -}catch(_){}finally{ - if (!Stream) - Stream = require('events').EventEmitter; -}}()) -/**/ - -var Buffer = require('buffer').Buffer; - -util.inherits(Writable, Stream); - -function nop() {} - -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} - -function WritableState(options, stream) { - var Duplex = require('./_stream_duplex'); - - options = options || {}; - - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; - - if (stream instanceof Duplex) - this.objectMode = this.objectMode || !!options.writableObjectMode; - - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; - - // cast to ints. - this.highWaterMark = ~~this.highWaterMark; - - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; - - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; - - // a flag to see when we're in the middle of a write. - this.writing = false; - - // when true all writes will be buffered until .uncork() call - this.corked = 0; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; - - // the callback that's passed to _write(chunk,cb) - this.onwrite = function(er) { - onwrite(stream, er); - }; - - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; - - this.bufferedRequest = null; - this.lastBufferedRequest = null; - - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; - - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; - - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; -} - -WritableState.prototype.getBuffer = function writableStateGetBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; - } - return out; -}; - -(function (){try { -Object.defineProperty(WritableState.prototype, 'buffer', { - get: require('util-deprecate')(function() { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use ' + - '_writableState.getBuffer() instead.') -}); -}catch(_){}}()); - - -function Writable(options) { - var Duplex = require('./_stream_duplex'); - - // Writable ctor is applied to Duplexes, though they're not - // instanceof Writable, they're instanceof Readable. - if (!(this instanceof Writable) && !(this instanceof Duplex)) - return new Writable(options); - - this._writableState = new WritableState(options, this); - - // legacy. - this.writable = true; - - if (options) { - if (typeof options.write === 'function') - this._write = options.write; - - if (typeof options.writev === 'function') - this._writev = options.writev; - } - - Stream.call(this); -} - -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function() { - this.emit('error', new Error('Cannot pipe. Not readable.')); -}; - - -function writeAfterEnd(stream, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - processNextTick(cb, er); -} - -// If we get something that is not a buffer, string, null, or undefined, -// and we're not in objectMode, then that's an error. -// Otherwise stream chunks are all considered to be of length=1, and the -// watermarks determine how many objects to keep in the buffer, rather than -// how many bytes or characters. -function validChunk(stream, state, chunk, cb) { - var valid = true; - - if (!(Buffer.isBuffer(chunk)) && - typeof chunk !== 'string' && - chunk !== null && - chunk !== undefined && - !state.objectMode) { - var er = new TypeError('Invalid non-string/buffer chunk'); - stream.emit('error', er); - processNextTick(cb, er); - valid = false; - } - return valid; -} - -Writable.prototype.write = function(chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (Buffer.isBuffer(chunk)) - encoding = 'buffer'; - else if (!encoding) - encoding = state.defaultEncoding; - - if (typeof cb !== 'function') - cb = nop; - - if (state.ended) - writeAfterEnd(this, cb); - else if (validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, chunk, encoding, cb); - } - - return ret; -}; - -Writable.prototype.cork = function() { - var state = this._writableState; - - state.corked++; -}; - -Writable.prototype.uncork = function() { - var state = this._writableState; - - if (state.corked) { - state.corked--; - - if (!state.writing && - !state.corked && - !state.finished && - !state.bufferProcessing && - state.bufferedRequest) - clearBuffer(this, state); - } -}; - -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') - encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', -'ucs2', 'ucs-2','utf16le', 'utf-16le', 'raw'] -.indexOf((encoding + '').toLowerCase()) > -1)) - throw new TypeError('Unknown encoding: ' + encoding); - this._writableState.defaultEncoding = encoding; -}; - -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && - state.decodeStrings !== false && - typeof chunk === 'string') { - chunk = new Buffer(chunk, encoding); - } - return chunk; -} - -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, chunk, encoding, cb) { - chunk = decodeChunk(state, chunk, encoding); - - if (Buffer.isBuffer(chunk)) - encoding = 'buffer'; - var len = state.objectMode ? 1 : chunk.length; - - state.length += len; - - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) - state.needDrain = true; - - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - - return ret; -} - -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) - stream._writev(chunk, state.onwrite); - else - stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} - -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - if (sync) - processNextTick(cb, er); - else - cb(er); - - stream._writableState.errorEmitted = true; - stream.emit('error', er); -} - -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} - -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - - onwriteStateUpdate(state); - - if (er) - onwriteError(stream, state, sync, er, cb); - else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state); - - if (!finished && - !state.corked && - !state.bufferProcessing && - state.bufferedRequest) { - clearBuffer(stream, state); - } - - if (sync) { - processNextTick(afterWrite, stream, state, finished, cb); - } else { - afterWrite(stream, state, finished, cb); - } - } -} - -function afterWrite(stream, state, finished, cb) { - if (!finished) - onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} - -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} - - -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var buffer = []; - var cbs = []; - while (entry) { - cbs.push(entry.callback); - buffer.push(entry); - entry = entry.next; - } - - // count the one we are adding, as well. - // TODO(isaacs) clean this up - state.pendingcb++; - state.lastBufferedRequest = null; - doWrite(stream, state, true, state.length, buffer, '', function(err) { - for (var i = 0; i < cbs.length; i++) { - state.pendingcb--; - cbs[i](err); - } - }); - - // Clear buffer - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } - } - - if (entry === null) - state.lastBufferedRequest = null; - } - state.bufferedRequest = entry; - state.bufferProcessing = false; -} - -Writable.prototype._write = function(chunk, encoding, cb) { - cb(new Error('not implemented')); -}; - -Writable.prototype._writev = null; - -Writable.prototype.end = function(chunk, encoding, cb) { - var state = this._writableState; - - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (chunk !== null && chunk !== undefined) - this.write(chunk, encoding); - - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); - } - - // ignore unnecessary end() calls. - if (!state.ending && !state.finished) - endWritable(this, state, cb); -}; - - -function needFinish(state) { - return (state.ending && - state.length === 0 && - state.bufferedRequest === null && - !state.finished && - !state.writing); -} - -function prefinish(stream, state) { - if (!state.prefinished) { - state.prefinished = true; - stream.emit('prefinish'); - } -} - -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - if (state.pendingcb === 0) { - prefinish(stream, state); - state.finished = true; - stream.emit('finish'); - } else { - prefinish(stream, state); - } - } - return need; -} - -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) - processNextTick(cb); - else - stream.once('finish', cb); - } - state.ended = true; -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/lib/util.js deleted file mode 100644 index 9074e8ebcb61e9..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/lib/util.js +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. -function isArray(ar) { - return Array.isArray(ar); -} -exports.isArray = isArray; - -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; - -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; - -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; - -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; - -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; - -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; - -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return isObject(re) && objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return isObject(d) && objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; - -function isError(e) { - return isObject(e) && - (objectToString(e) === '[object Error]' || e instanceof Error); -} -exports.isError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; - -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -function isBuffer(arg) { - return Buffer.isBuffer(arg); -} -exports.isBuffer = isBuffer; - -function objectToString(o) { - return Object.prototype.toString.call(o); -} \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json deleted file mode 100644 index 466dfdfe0139b3..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "core-util-is", - "version": "1.0.1", - "description": "The `util.is*` functions introduced in Node v0.12.", - "main": "lib/util.js", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/core-util-is.git" - }, - "keywords": [ - "util", - "isBuffer", - "isArray", - "isNumber", - "isString", - "isRegExp", - "isThis", - "isThat", - "polyfill" - ], - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/isaacs/core-util-is/issues" - }, - "readme": "# core-util-is\n\nThe `util.is*` functions introduced in Node v0.12.\n", - "readmeFilename": "README.md", - "homepage": "https://github.com/isaacs/core-util-is", - "_id": "core-util-is@1.0.1", - "dist": { - "shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538", - "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" - }, - "_from": "core-util-is@>=1.0.0 <1.1.0", - "_npmVersion": "1.3.23", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, - "_shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538", - "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/util.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/util.js deleted file mode 100644 index 007fa10575636d..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/util.js +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. -function isArray(ar) { - return Array.isArray(ar); -} -exports.isArray = isArray; - -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; - -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; - -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; - -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; - -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; - -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; - -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return isObject(re) && objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return isObject(d) && objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; - -function isError(e) { - return isObject(e) && objectToString(e) === '[object Error]'; -} -exports.isError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; - -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -function isBuffer(arg) { - return arg instanceof Buffer; -} -exports.isBuffer = isBuffer; - -function objectToString(o) { - return Object.prototype.toString.call(o); -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/README.md deleted file mode 100644 index 052a62b8d7b7ae..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -# isarray - -`Array#isArray` for older browsers. - -## Usage - -```js -var isArray = require('isarray'); - -console.log(isArray([])); // => true -console.log(isArray({})); // => false -``` - -## Installation - -With [npm](http://npmjs.org) do - -```bash -$ npm install isarray -``` - -Then bundle for the browser with -[browserify](https://github.com/substack/browserify). - -With [component](http://component.io) do - -```bash -$ component install juliangruber/isarray -``` - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/build/build.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/build/build.js deleted file mode 100644 index e1856ef0943728..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/build/build.js +++ /dev/null @@ -1,208 +0,0 @@ - -/** - * Require the given path. - * - * @param {String} path - * @return {Object} exports - * @api public - */ - -function require(path, parent, orig) { - var resolved = require.resolve(path); - - // lookup failed - if (null == resolved) { - orig = orig || path; - parent = parent || 'root'; - var err = new Error('Failed to require "' + orig + '" from "' + parent + '"'); - err.path = orig; - err.parent = parent; - err.require = true; - throw err; - } - - var module = require.modules[resolved]; - - // perform real require() - // by invoking the module's - // registered function - if (!module.exports) { - module.exports = {}; - module.client = module.component = true; - module.call(this, module.exports, require.relative(resolved), module); - } - - return module.exports; -} - -/** - * Registered modules. - */ - -require.modules = {}; - -/** - * Registered aliases. - */ - -require.aliases = {}; - -/** - * Resolve `path`. - * - * Lookup: - * - * - PATH/index.js - * - PATH.js - * - PATH - * - * @param {String} path - * @return {String} path or null - * @api private - */ - -require.resolve = function(path) { - if (path.charAt(0) === '/') path = path.slice(1); - var index = path + '/index.js'; - - var paths = [ - path, - path + '.js', - path + '.json', - path + '/index.js', - path + '/index.json' - ]; - - for (var i = 0; i < paths.length; i++) { - var path = paths[i]; - if (require.modules.hasOwnProperty(path)) return path; - } - - if (require.aliases.hasOwnProperty(index)) { - return require.aliases[index]; - } -}; - -/** - * Normalize `path` relative to the current path. - * - * @param {String} curr - * @param {String} path - * @return {String} - * @api private - */ - -require.normalize = function(curr, path) { - var segs = []; - - if ('.' != path.charAt(0)) return path; - - curr = curr.split('/'); - path = path.split('/'); - - for (var i = 0; i < path.length; ++i) { - if ('..' == path[i]) { - curr.pop(); - } else if ('.' != path[i] && '' != path[i]) { - segs.push(path[i]); - } - } - - return curr.concat(segs).join('/'); -}; - -/** - * Register module at `path` with callback `definition`. - * - * @param {String} path - * @param {Function} definition - * @api private - */ - -require.register = function(path, definition) { - require.modules[path] = definition; -}; - -/** - * Alias a module definition. - * - * @param {String} from - * @param {String} to - * @api private - */ - -require.alias = function(from, to) { - if (!require.modules.hasOwnProperty(from)) { - throw new Error('Failed to alias "' + from + '", it does not exist'); - } - require.aliases[to] = from; -}; - -/** - * Return a require function relative to the `parent` path. - * - * @param {String} parent - * @return {Function} - * @api private - */ - -require.relative = function(parent) { - var p = require.normalize(parent, '..'); - - /** - * lastIndexOf helper. - */ - - function lastIndexOf(arr, obj) { - var i = arr.length; - while (i--) { - if (arr[i] === obj) return i; - } - return -1; - } - - /** - * The relative require() itself. - */ - - function localRequire(path) { - var resolved = localRequire.resolve(path); - return require(resolved, parent, path); - } - - /** - * Resolve relative to the parent. - */ - - localRequire.resolve = function(path) { - var c = path.charAt(0); - if ('/' == c) return path.slice(1); - if ('.' == c) return require.normalize(p, path); - - // resolve deps by returning - // the dep in the nearest "deps" - // directory - var segs = parent.split('/'); - var i = lastIndexOf(segs, 'deps') + 1; - if (!i) i = 0; - path = segs.slice(0, i + 1).join('/') + '/deps/' + path; - return path; - }; - - /** - * Check if module is defined at `path`. - */ - - localRequire.exists = function(path) { - return require.modules.hasOwnProperty(localRequire.resolve(path)); - }; - - return localRequire; -}; -require.register("isarray/index.js", function(exports, require, module){ -module.exports = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; -}; - -}); -require.alias("isarray/index.js", "isarray/index.js"); diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/component.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/component.json deleted file mode 100644 index 9e31b683889015..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name" : "isarray", - "description" : "Array#isArray for older browsers", - "version" : "0.0.1", - "repository" : "juliangruber/isarray", - "homepage": "https://github.com/juliangruber/isarray", - "main" : "index.js", - "scripts" : [ - "index.js" - ], - "dependencies" : {}, - "keywords": ["browser","isarray","array"], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT" -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/index.js deleted file mode 100644 index 5f5ad45d46dda9..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/index.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; -}; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/package.json deleted file mode 100644 index 19228ab6fdcaaf..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "isarray", - "description": "Array#isArray for older browsers", - "version": "0.0.1", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/isarray.git" - }, - "homepage": "https://github.com/juliangruber/isarray", - "main": "index.js", - "scripts": { - "test": "tap test/*.js" - }, - "dependencies": {}, - "devDependencies": { - "tap": "*" - }, - "keywords": [ - "browser", - "isarray", - "array" - ], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT", - "_id": "isarray@0.0.1", - "dist": { - "shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", - "tarball": "http://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" - }, - "_from": "isarray@0.0.1", - "_npmVersion": "1.2.18", - "_npmUser": { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - "maintainers": [ - { - "name": "juliangruber", - "email": "julian@juliangruber.com" - } - ], - "directories": {}, - "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", - "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "bugs": { - "url": "https://github.com/juliangruber/isarray/issues" - }, - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml deleted file mode 100644 index 5ac98855343cee..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" - - "0.11" - - "0.12" - - "iojs" diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/index.js deleted file mode 100644 index 049521cad7ba1b..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/index.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; -module.exports = nextTick; - -function nextTick(fn) { - var args = new Array(arguments.length - 1); - var i = 0; - while (i < args.length) { - args[i++] = arguments[i]; - } - process.nextTick(function afterTick() { - fn.apply(null, args); - }); -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json deleted file mode 100644 index 087586e8f8cedd..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "process-nextick-args", - "version": "1.0.3", - "description": "process.nextTick but always with args", - "main": "index.js", - "scripts": { - "test": "node test.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/calvinmetcalf/process-nextick-args.git" - }, - "author": "", - "license": "MIT", - "bugs": { - "url": "https://github.com/calvinmetcalf/process-nextick-args/issues" - }, - "homepage": "https://github.com/calvinmetcalf/process-nextick-args", - "devDependencies": { - "tap": "~0.2.6" - }, - "gitHead": "e855846a69662b9489f1ad3dde1ebf2ccc4370b8", - "_id": "process-nextick-args@1.0.3", - "_shasum": "e272eed825d5e9f4ea74d8d73b1fe311c3beb630", - "_from": "process-nextick-args@>=1.0.0 <1.1.0", - "_npmVersion": "2.9.0", - "_nodeVersion": "2.5.0", - "_npmUser": { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - }, - "dist": { - "shasum": "e272eed825d5e9f4ea74d8d73b1fe311c3beb630", - "tarball": "http://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.3.tgz" - }, - "maintainers": [ - { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.3.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/.npmignore b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/.npmignore deleted file mode 100644 index 206320cc1d21b9..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -build -test diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json deleted file mode 100644 index 0364d54ba46af6..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "string_decoder", - "version": "0.10.31", - "description": "The string_decoder module from Node core", - "main": "index.js", - "dependencies": {}, - "devDependencies": { - "tap": "~0.4.8" - }, - "scripts": { - "test": "tap test/simple/*.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/rvagg/string_decoder.git" - }, - "homepage": "https://github.com/rvagg/string_decoder", - "keywords": [ - "string", - "decoder", - "browser", - "browserify" - ], - "license": "MIT", - "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0", - "bugs": { - "url": "https://github.com/rvagg/string_decoder/issues" - }, - "_id": "string_decoder@0.10.31", - "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "_from": "string_decoder@>=0.10.0 <0.11.0", - "_npmVersion": "1.4.23", - "_npmUser": { - "name": "rvagg", - "email": "rod@vagg.org" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - }, - { - "name": "rvagg", - "email": "rod@vagg.org" - } - ], - "dist": { - "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/History.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/History.md deleted file mode 100644 index ec010299b1b259..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/History.md +++ /dev/null @@ -1,11 +0,0 @@ - -1.0.1 / 2014-11-25 -================== - - * browser: use `console.warn()` for deprecation calls - * browser: more jsdocs - -1.0.0 / 2014-04-30 -================== - - * initial commit diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/browser.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/browser.js deleted file mode 100644 index 55fa5a4bc6056a..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/browser.js +++ /dev/null @@ -1,62 +0,0 @@ - -/** - * Module exports. - */ - -module.exports = deprecate; - -/** - * Mark that a method should not be used. - * Returns a modified function which warns once by default. - * - * If `localStorage.noDeprecation = true` is set, then it is a no-op. - * - * If `localStorage.throwDeprecation = true` is set, then deprecated functions - * will throw an Error when invoked. - * - * If `localStorage.traceDeprecation = true` is set, then deprecated functions - * will invoke `console.trace()` instead of `console.error()`. - * - * @param {Function} fn - the function to deprecate - * @param {String} msg - the string to print to the console when `fn` is invoked - * @returns {Function} a new "deprecated" version of `fn` - * @api public - */ - -function deprecate (fn, msg) { - if (config('noDeprecation')) { - return fn; - } - - var warned = false; - function deprecated() { - if (!warned) { - if (config('throwDeprecation')) { - throw new Error(msg); - } else if (config('traceDeprecation')) { - console.trace(msg); - } else { - console.warn(msg); - } - warned = true; - } - return fn.apply(this, arguments); - } - - return deprecated; -} - -/** - * Checks `localStorage` for boolean values for the given `name`. - * - * @param {String} name - * @returns {Boolean} - * @api private - */ - -function config (name) { - if (!global.localStorage) return false; - var val = global.localStorage[name]; - if (null == val) return false; - return String(val).toLowerCase() === 'true'; -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json deleted file mode 100644 index ea487da0e43000..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "util-deprecate", - "version": "1.0.1", - "description": "The Node.js `util.deprecate()` function with browser support", - "main": "node.js", - "browser": "browser.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/util-deprecate.git" - }, - "keywords": [ - "util", - "deprecate", - "browserify", - "browser", - "node" - ], - "author": { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://n8.io/" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/TooTallNate/util-deprecate/issues" - }, - "homepage": "https://github.com/TooTallNate/util-deprecate", - "gitHead": "6e923f7d98a0afbe5b9c7db9d0f0029c1936746c", - "_id": "util-deprecate@1.0.1", - "_shasum": "3556a3d13c4c6aa7983d7e2425478197199b7881", - "_from": "util-deprecate@>=1.0.1 <1.1.0", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - }, - "maintainers": [ - { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - } - ], - "dist": { - "shasum": "3556a3d13c4c6aa7983d7e2425478197199b7881", - "tarball": "http://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/package.json deleted file mode 100644 index 70ad998cae2d45..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "readable-stream", - "version": "2.0.2", - "description": "Streams3, a user-land copy of the stream library from iojs v2.x", - "main": "readable.js", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "process-nextick-args": "~1.0.0", - "string_decoder": "~0.10.x", - "util-deprecate": "~1.0.1" - }, - "devDependencies": { - "tap": "~0.2.6", - "tape": "~4.0.0", - "zuul": "~3.0.0" - }, - "scripts": { - "test": "tap test/parallel/*.js", - "browser": "zuul --browser-name $BROWSER_NAME --browser-version $BROWSER_VERSION -- test/browser.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/nodejs/readable-stream.git" - }, - "keywords": [ - "readable", - "stream", - "pipe" - ], - "browser": { - "util": false - }, - "license": "MIT", - "gitHead": "1a70134a71196eeabb5e27bc7580faaa68d30513", - "bugs": { - "url": "https://github.com/nodejs/readable-stream/issues" - }, - "homepage": "https://github.com/nodejs/readable-stream#readme", - "_id": "readable-stream@2.0.2", - "_shasum": "bec81beae8cf455168bc2e5b2b31f5bcfaed9b1b", - "_from": "readable-stream@>=2.0.0 <2.1.0", - "_npmVersion": "2.11.1", - "_nodeVersion": "2.3.0", - "_npmUser": { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - }, - "dist": { - "shasum": "bec81beae8cf455168bc2e5b2b31f5bcfaed9b1b", - "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.2.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - }, - { - "name": "rvagg", - "email": "rod@vagg.org" - }, - { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.2.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js index 425950f9fc9ed7..e57dabdcebc9c1 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js @@ -11,7 +11,7 @@ test('u8a without globals', function (t) { vm.runInNewContext(src, c); var TA = c.module.exports; var ua = new(TA.Uint8Array)(5); - + t.equal(ua.length, 5); ua[1] = 256 + 55; t.equal(ua[1], 55); diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json index caa06817b0e47a..5a3f8b401e4449 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json @@ -1,6 +1,6 @@ { "name": "concat-stream", - "version": "1.5.0", + "version": "1.5.1", "description": "writable stream that concatenates strings or binary data and calls a callback with the result", "tags": [ "stream", @@ -54,28 +54,28 @@ "android-browser/4.2..latest" ] }, - "gitHead": "7cb37c8ddc0fd2ea03c104d07d44d84b83a31185", + "gitHead": "522adc12d82f57c691a5f946fbc8ba08718dcdcb", "homepage": "https://github.com/maxogden/concat-stream#readme", - "_id": "concat-stream@1.5.0", - "_shasum": "53f7d43c51c5e43f81c8fdd03321c631be68d611", + "_id": "concat-stream@1.5.1", + "_shasum": "f3b80acf9e1f48e3875c0688b41b6c31602eea1c", "_from": "concat-stream@>=1.4.6 <2.0.0", - "_npmVersion": "2.9.0", - "_nodeVersion": "1.8.2", + "_npmVersion": "2.14.2", + "_nodeVersion": "4.0.0", "_npmUser": { "name": "maxogden", "email": "max@maxogden.com" }, + "dist": { + "shasum": "f3b80acf9e1f48e3875c0688b41b6c31602eea1c", + "tarball": "http://registry.npmjs.org/concat-stream/-/concat-stream-1.5.1.tgz" + }, "maintainers": [ { "name": "maxogden", "email": "max@maxogden.com" } ], - "dist": { - "shasum": "53f7d43c51c5e43f81c8fdd03321c631be68d611", - "tarball": "http://registry.npmjs.org/concat-stream/-/concat-stream-1.5.0.tgz" - }, "directories": {}, - "_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.0.tgz", + "_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.1.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/readme.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/readme.md index 69234d52a535bb..fdfbc40b47e256 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/readme.md +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/readme.md @@ -1,6 +1,6 @@ # concat-stream -Writable stream that concatenates strings or binary data and calls a callback with the result. Not a transform stream -- more of a stream sink. +Writable stream that concatenates all the data from a stream and calls a callback with the result. Use this when you want to collect all the data from a stream into a single buffer. [![Build Status](https://travis-ci.org/maxogden/concat-stream.svg?branch=master)](https://travis-ci.org/maxogden/concat-stream) @@ -14,6 +14,10 @@ Only use this if you know you can fit all of the output of your stream into a si There are also `objectMode` streams that emit things other than Buffers, and you can concatenate these too. See below for details. +## Related + +`stream-each` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. + ### examples #### Buffers @@ -73,7 +77,7 @@ var concat = require('concat-stream') Return a `writable` stream that will fire `cb(data)` with all of the data that was written to the stream. Data can be written to `writable` as strings, -Buffers, arrays of byte integers, and Uint8Arrays. +Buffers, arrays of byte integers, and Uint8Arrays. By default `concat-stream` will give you back the same data type as the type of the first buffer written to the stream. Use `opts.encoding` to set what format `data` should be returned as, e.g. if you if you don't want to rely on the built-in type checking or for some other reason. @@ -89,6 +93,8 @@ If you don't specify an encoding, and the types can't be inferred (e.g. you writ `concat-stream` does not handle errors for you, so you must handle errors on whatever streams you pipe into `concat-stream`. This is a general rule when programming with node.js streams: always handle errors on each and every stream. Since `concat-stream` is not itself a stream it does not emit errors. +We recommend using [`end-of-stream`](https://npmjs.org/end-of-stream) or [`pump`](https://npmjs.org/pump) for writing error tolerant stream code. + # license MIT LICENSE diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/.npmignore b/deps/npm/node_modules/npm-registry-client/node_modules/retry/.npmignore new file mode 100644 index 00000000000000..e7726a071b7f39 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/.npmignore @@ -0,0 +1,2 @@ +/node_modules/* +npm-debug.log diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/License b/deps/npm/node_modules/npm-registry-client/node_modules/retry/License new file mode 100644 index 00000000000000..0b58de379fb308 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/License @@ -0,0 +1,21 @@ +Copyright (c) 2011: +Tim Koschützki (tim@debuggable.com) +Felix Geisendörfer (felix@debuggable.com) + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/Makefile b/deps/npm/node_modules/npm-registry-client/node_modules/retry/Makefile new file mode 100644 index 00000000000000..98e7167bbe359f --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/Makefile @@ -0,0 +1,21 @@ +SHELL := /bin/bash + +test: + @node test/runner.js + +release-major: test + npm version major -m "Release %s" + git push + npm publish + +release-minor: test + npm version minor -m "Release %s" + git push + npm publish + +release-patch: test + npm version patch -m "Release %s" + git push + npm publish + +.PHONY: test diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/retry/README.md new file mode 100644 index 00000000000000..09d9c8a81bf121 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/README.md @@ -0,0 +1,195 @@ +# retry + +Abstraction for exponential and custom retry strategies for failed operations. + +## Installation + + npm install retry + +## Current Status + +This module has been tested and is ready to be used. + +## Tutorial + +The example below will retry a potentially failing `dns.resolve` operation +`10` times using an exponential backoff strategy. With the default settings, this +means the last attempt is made after `17 minutes and 3 seconds`. + +``` javascript +var dns = require('dns'); +var retry = require('retry'); + +function faultTolerantResolve(address, cb) { + var operation = retry.operation(); + + operation.attempt(function(currentAttempt) { + dns.resolve(address, function(err, addresses) { + if (operation.retry(err)) { + return; + } + + cb(err ? operation.mainError() : null, addresses); + }); + }); +} + +faultTolerantResolve('nodejs.org', function(err, addresses) { + console.log(err, addresses); +}); +``` + +Of course you can also configure the factors that go into the exponential +backoff. See the API documentation below for all available settings. +currentAttempt is an int representing the number of attempts so far. + +``` javascript +var operation = retry.operation({ + retries: 5, + factor: 3, + minTimeout: 1 * 1000, + maxTimeout: 60 * 1000, + randomize: true, +}); +``` + +## API + +### retry.operation([options]) + +Creates a new `RetryOperation` object. See the `retry.timeouts()` function +below for available `options`. + +### retry.timeouts([options]) + +Returns an array of timeouts. All time `options` and return values are in +milliseconds. If `options` is an array, a copy of that array is returned. + +`options` is a JS object that can contain any of the following keys: + +* `retries`: The maximum amount of times to retry the operation. Default is `10`. +* `factor`: The exponential factor to use. Default is `2`. +* `minTimeout`: The number of milliseconds before starting the first retry. Default is `1000`. +* `maxTimeout`: The maximum number of milliseconds between two retries. Default is `Infinity`. +* `randomize`: Randomizes the timeouts by multiplying with a factor between `1` to `2`. Default is `false`. + +The formula used to calculate the individual timeouts is: + +``` +var Math.min(random * minTimeout * Math.pow(factor, attempt), maxTimeout); +``` + +Have a look at [this article][article] for a better explanation of approach. + +If you want to tune your `factor` / `times` settings to attempt the last retry +after a certain amount of time, you can use wolfram alpha. For example in order +to tune for `10` attempts in `5 minutes`, you can use this equation: + +![screenshot](https://github.com/tim-kos/node-retry/raw/master/equation.gif) + +Explaining the various values from left to right: + +* `k = 0 ... 9`: The `retries` value (10) +* `1000`: The `minTimeout` value in ms (1000) +* `x^k`: No need to change this, `x` will be your resulting factor +* `5 * 60 * 1000`: The desired total amount of time for retrying in ms (5 minutes) + +To make this a little easier for you, use wolfram alpha to do the calculations: + + + +[article]: http://dthain.blogspot.com/2009/02/exponential-backoff-in-distributed.html + +### retry.createTimeout(attempt, opts) + +Returns a new `timeout` (integer in milliseconds) based on the given parameters. + +`attempt` is an integer representing for which retry the timeout should be calculated. If your retry operation was executed 4 times you had one attempt and 3 retries. If you then want to calculate a new timeout, you should set `attempt` to 4 (attempts are zero-indexed). + +`opts` can include `factor`, `minTimeout`, `randomize` (boolean) and `maxTimeout`. They are documented above. + +`retry.createTimeout()` is used internally by `retry.timeouts()` and is public for you to be able to create your own timeouts for reinserting an item, see [issue #13](https://github.com/tim-kos/node-retry/issues/13). + +### retry.wrap(obj, [options], [methodNames]) + +Wrap all functions of the `obj` with retry. Optionally you can pass operation options and +an array of method names which need to be wrapped. + +``` +retry.wrap(obj) + +retry.wrap(obj, ['method1', 'method2']); + +retry.wrap(obj, {retries: 3}); + +retry.wrap(obj, {retries: 3}, ['method1', 'method2']); +``` +The `options` object can take any options that the usual call to `retry.operation` can take. + +### new RetryOperation(timeouts) + +Creates a new `RetryOperation` where `timeouts` is an array where each value is +a timeout given in milliseconds. + +#### retryOperation.errors() + +Returns an array of all errors that have been passed to +`retryOperation.retry()` so far. + +#### retryOperation.mainError() + +A reference to the error object that occured most frequently. Errors are +compared using the `error.message` property. + +If multiple error messages occured the same amount of time, the last error +object with that message is returned. + +If no errors occured so far, the value is `null`. + +#### retryOperation.attempt(fn, timeoutOps) + +Defines the function `fn` that is to be retried and executes it for the first +time right away. The `fn` function can receive an optional `currentAttempt` callback that represents the number of attempts to execute `fn` so far. + +Optionally defines `timeoutOps` which is an object having a property `timeout` in miliseconds and a property `cb` callback function. +Whenever your retry operation takes longer than `timeout` to execute, the timeout callback function `cb` is called. + + +#### retryOperation.try(fn) + +This is an alias for `retryOperation.attempt(fn)`. This is deprecated. + +#### retryOperation.start(fn) + +This is an alias for `retryOperation.attempt(fn)`. This is deprecated. + +#### retryOperation.retry(error) + +Returns `false` when no `error` value is given, or the maximum amount of retries +has been reached. + +Otherwise it returns `true`, and retries the operation after the timeout for +the current attempt number. + +#### retryOperation.attempts() + +Returns an int representing the number of attempts it took to call `fn` before it was successful. + +## License + +retry is licensed under the MIT license. + + +#Changelog + +0.7.0 Some bugfixes and made retry.createTimeout() public. Fixed issues [#10](https://github.com/tim-kos/node-retry/issues/10), [#12](https://github.com/tim-kos/node-retry/issues/12), and [#13](https://github.com/tim-kos/node-retry/issues/13). + +0.6.0 Introduced optional timeOps parameter for the attempt() function which is an object having a property timeout in miliseconds and a property cb callback function. Whenever your retry operation takes longer than timeout to execute, the timeout callback function cb is called. + +0.5.0 Some minor refactorings. + +0.4.0 Changed retryOperation.try() to retryOperation.attempt(). Deprecated the aliases start() and try() for it. + +0.3.0 Added retryOperation.start() which is an alias for retryOperation.try(). + +0.2.0 Added attempts() function and parameter to retryOperation.try() representing the number of attempts it took to call fn(). diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/equation.gif b/deps/npm/node_modules/npm-registry-client/node_modules/retry/equation.gif new file mode 100644 index 00000000000000..97107237ba19f5 Binary files /dev/null and b/deps/npm/node_modules/npm-registry-client/node_modules/retry/equation.gif differ diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/dns.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/dns.js new file mode 100644 index 00000000000000..d6351e9d05bb33 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/dns.js @@ -0,0 +1,31 @@ +var dns = require('dns'); +var retry = require('../lib/retry'); + +function faultTolerantResolve(address, cb) { + var opts = { + retries: 2, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: 2 * 1000, + randomize: true + }; + var operation = retry.operation(opts); + + operation.attempt(function(currentAttempt) { + dns.resolve(address, function(err, addresses) { + if (operation.retry(err)) { + return; + } + + cb(operation.mainError(), operation.errors(), addresses); + }); + }); +} + +faultTolerantResolve('nodejs.org', function(err, errors, addresses) { + console.warn('err:'); + console.log(err); + + console.warn('addresses:'); + console.log(addresses); +}); diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/index.js new file mode 100644 index 00000000000000..ee62f3a112c28b --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/retry'); \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js new file mode 100644 index 00000000000000..94685652c426fd --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js @@ -0,0 +1,94 @@ +var RetryOperation = require('./retry_operation'); + +exports.operation = function(options) { + var retryForever = false; + if (options && options.forever === true) retryForever = true; + var timeouts = exports.timeouts(options); + return new RetryOperation(timeouts, retryForever); +}; + +exports.timeouts = function(options) { + if (options instanceof Array) { + return [].concat(options); + } + + var opts = { + retries: 10, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: Infinity, + randomize: false + }; + for (var key in options) { + opts[key] = options[key]; + } + + if (opts.minTimeout > opts.maxTimeout) { + throw new Error('minTimeout is greater than maxTimeout'); + } + + var timeouts = []; + for (var i = 0; i < opts.retries; i++) { + timeouts.push(this.createTimeout(i, opts)); + } + + // sort the array numerically ascending + timeouts.sort(function(a,b) { + return a - b; + }); + + return timeouts; +}; + +exports.createTimeout = function(attempt, opts) { + var random = (opts.randomize) + ? (Math.random() + 1) + : 1; + + var timeout = Math.round(random * opts.minTimeout * Math.pow(opts.factor, attempt)); + timeout = Math.min(timeout, opts.maxTimeout); + + return timeout; +}; + +exports.wrap = function(obj, options, methods) { + if (options instanceof Array) { + methods = options; + options = null; + } + + if (!methods) { + methods = []; + for (var key in obj) { + if (typeof obj[key] === 'function') { + methods.push(key); + } + } + } + + for (var i = 0; i < methods.length; i++) { + var method = methods[i]; + var original = obj[method]; + + obj[method] = function retryWrapper() { + var op = exports.operation(options); + var args = Array.prototype.slice.call(arguments); + var callback = args.pop(); + + args.push(function(err) { + if (op.retry(err)) { + return; + } + if (err) { + arguments[0] = op.mainError(); + } + callback.apply(this, arguments); + }); + + op.attempt(function() { + original.apply(obj, args); + }); + }; + obj[method].options = options; + } +}; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js new file mode 100644 index 00000000000000..52b895544e6a58 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js @@ -0,0 +1,120 @@ +function RetryOperation(timeouts, retryForever) { + this._timeouts = timeouts; + this._fn = null; + this._errors = []; + this._attempts = 1; + this._operationTimeout = null; + this._operationTimeoutCb = null; + this._timeout = null; + + if (!!retryForever) { + this._cachedTimeouts = this._timeouts.slice(0); + } +} +module.exports = RetryOperation; + +RetryOperation.prototype.retry = function(err) { + if (this._timeout) { + clearTimeout(this._timeout); + } + + if (!err) { + return false; + } + + this._errors.push(err); + + var timeout = this._timeouts.shift(); + if (timeout === undefined) { + if (this._cachedTimeouts) { + // retry forever, only keep last error + this._errors.splice(this._errors.length - 1, this._errors.length); + this._timeouts = this._cachedTimeouts.slice(0); + timeout = this._timeouts.shift(); + } else { + return false; + } + } + + var self = this; + setTimeout(function() { + self._attempts++; + + if (self._operationTimeoutCb) { + self._timeout = setTimeout(function() { + self._operationTimeoutCb(self._attempts); + }, self._operationTimeout); + } + + self._fn(self._attempts); + }, timeout); + + return true; +}; + +RetryOperation.prototype.attempt = function(fn, timeoutOps) { + this._fn = fn; + + if (timeoutOps) { + if (timeoutOps.timeout) { + this._operationTimeout = timeoutOps.timeout; + } + if (timeoutOps.cb) { + this._operationTimeoutCb = timeoutOps.cb; + } + } + + var self = this; + if (this._operationTimeoutCb) { + this._timeout = setTimeout(function() { + self._operationTimeoutCb(); + }, self._operationTimeout); + } + + this._fn(this._attempts); +}; + +RetryOperation.prototype.try = function(fn) { + console.log('Using RetryOperation.try() is deprecated'); + this.attempt(fn); +}; + +RetryOperation.prototype.start = function(fn) { + console.log('Using RetryOperation.start() is deprecated'); + this.attempt(fn); +}; + +RetryOperation.prototype.start = RetryOperation.prototype.try; + +RetryOperation.prototype.errors = function() { + return this._errors; +}; + +RetryOperation.prototype.attempts = function() { + return this._attempts; +}; + +RetryOperation.prototype.mainError = function() { + if (this._errors.length === 0) { + return null; + } + + var counts = {}; + var mainError = null; + var mainErrorCount = 0; + + for (var i = 0; i < this._errors.length; i++) { + var error = this._errors[i]; + var message = error.message; + var count = (counts[message] || 0) + 1; + + counts[message] = count; + + if (count >= mainErrorCount) { + mainError = error; + mainErrorCount = count; + } + } + + return mainError; +}; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/retry/package.json new file mode 100644 index 00000000000000..c274f9d6a7047c --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/package.json @@ -0,0 +1,79 @@ +{ + "_args": [ + [ + "retry@^0.8.0", + "/Users/rebecca/code/npm/node_modules/npm-registry-client" + ] + ], + "_from": "retry@>=0.8.0 <0.9.0", + "_id": "retry@0.8.0", + "_inCache": true, + "_installable": true, + "_location": "/npm-registry-client/retry", + "_nodeVersion": "0.10.33", + "_npmUser": { + "email": "tim@debuggable.com", + "name": "tim-kos" + }, + "_npmVersion": "2.1.7", + "_phantomChildren": {}, + "_requested": { + "name": "retry", + "raw": "retry@^0.8.0", + "rawSpec": "^0.8.0", + "scope": null, + "spec": ">=0.8.0 <0.9.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client" + ], + "_resolved": "https://registry.npmjs.org/retry/-/retry-0.8.0.tgz", + "_shasum": "2367628dc0edb247b1eab649dc53ac8628ac2d5f", + "_shrinkwrap": null, + "_spec": "retry@^0.8.0", + "_where": "/Users/rebecca/code/npm/node_modules/npm-registry-client", + "author": { + "email": "tim@debuggable.com", + "name": "Tim Koschützki", + "url": "http://debuggable.com/" + }, + "bugs": { + "url": "https://github.com/tim-kos/node-retry/issues" + }, + "dependencies": {}, + "description": "Abstraction for exponential and custom retry strategies for failed operations.", + "devDependencies": { + "fake": "0.2.0", + "far": "0.0.1" + }, + "directories": { + "lib": "./lib" + }, + "dist": { + "shasum": "2367628dc0edb247b1eab649dc53ac8628ac2d5f", + "tarball": "http://registry.npmjs.org/retry/-/retry-0.8.0.tgz" + }, + "engines": { + "node": "*" + }, + "gitHead": "9446e803d6a41ae08732a4a215ae5bf1ff1ccfdd", + "homepage": "https://github.com/tim-kos/node-retry", + "license": "MIT", + "main": "index", + "maintainers": [ + { + "name": "tim-kos", + "email": "tim@debuggable.com" + } + ], + "name": "retry", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/tim-kos/node-retry.git" + }, + "scripts": {}, + "version": "0.8.0" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/common.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/common.js new file mode 100644 index 00000000000000..224720696ebac8 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/common.js @@ -0,0 +1,10 @@ +var common = module.exports; +var path = require('path'); + +var rootDir = path.join(__dirname, '..'); +common.dir = { + lib: rootDir + '/lib' +}; + +common.assert = require('assert'); +common.fake = require('fake'); \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js new file mode 100644 index 00000000000000..cecfa3b7310013 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js @@ -0,0 +1,106 @@ +var common = require('../common'); +var assert = common.assert; +var fake = common.fake.create(); +var retry = require(common.dir.lib + '/retry'); + +(function testErrors() { + var operation = retry.operation(); + + var error = new Error('some error'); + var error2 = new Error('some other error'); + operation._errors.push(error); + operation._errors.push(error2); + + assert.deepEqual(operation.errors(), [error, error2]); +})(); + +(function testMainErrorReturnsMostFrequentError() { + var operation = retry.operation(); + var error = new Error('some error'); + var error2 = new Error('some other error'); + + operation._errors.push(error); + operation._errors.push(error2); + operation._errors.push(error); + + assert.strictEqual(operation.mainError(), error); +})(); + +(function testMainErrorReturnsLastErrorOnEqualCount() { + var operation = retry.operation(); + var error = new Error('some error'); + var error2 = new Error('some other error'); + + operation._errors.push(error); + operation._errors.push(error2); + + assert.strictEqual(operation.mainError(), error2); +})(); + +(function testAttempt() { + var operation = retry.operation(); + var fn = new Function(); + + var timeoutOpts = { + timeout: 1, + cb: function() {} + }; + operation.attempt(fn, timeoutOpts); + + assert.strictEqual(fn, operation._fn); + assert.strictEqual(timeoutOpts.timeout, operation._operationTimeout); + assert.strictEqual(timeoutOpts.cb, operation._operationTimeoutCb); +})(); + +(function testRetry() { + var times = 3; + var error = new Error('some error'); + var operation = retry.operation([1, 2, 3]); + var attempts = 0; + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + if (operation.retry(error)) { + return; + } + + assert.strictEqual(attempts, 4); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + }); + }; + + fn(); +})(); + +(function testRetryForever() { + var error = new Error('some error'); + var operation = retry.operation({ retries: 3, forever: true }); + var attempts = 0; + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + if (attempts !== 6 && operation.retry(error)) { + return; + } + + assert.strictEqual(attempts, 6); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + }); + }; + + fn(); +})(); diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-wrap.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-wrap.js new file mode 100644 index 00000000000000..7ca8bc7eb596b5 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-wrap.js @@ -0,0 +1,77 @@ +var common = require('../common'); +var assert = common.assert; +var fake = common.fake.create(); +var retry = require(common.dir.lib + '/retry'); + +function getLib() { + return { + fn1: function() {}, + fn2: function() {}, + fn3: function() {} + }; +} + +(function wrapAll() { + var lib = getLib(); + retry.wrap(lib); + assert.equal(lib.fn1.name, 'retryWrapper'); + assert.equal(lib.fn2.name, 'retryWrapper'); + assert.equal(lib.fn3.name, 'retryWrapper'); +}()); + +(function wrapAllPassOptions() { + var lib = getLib(); + retry.wrap(lib, {retries: 2}); + assert.equal(lib.fn1.name, 'retryWrapper'); + assert.equal(lib.fn2.name, 'retryWrapper'); + assert.equal(lib.fn3.name, 'retryWrapper'); + assert.equal(lib.fn1.options.retries, 2); + assert.equal(lib.fn2.options.retries, 2); + assert.equal(lib.fn3.options.retries, 2); +}()); + +(function wrapDefined() { + var lib = getLib(); + retry.wrap(lib, ['fn2', 'fn3']); + assert.notEqual(lib.fn1.name, 'retryWrapper'); + assert.equal(lib.fn2.name, 'retryWrapper'); + assert.equal(lib.fn3.name, 'retryWrapper'); +}()); + +(function wrapDefinedAndPassOptions() { + var lib = getLib(); + retry.wrap(lib, {retries: 2}, ['fn2', 'fn3']); + assert.notEqual(lib.fn1.name, 'retryWrapper'); + assert.equal(lib.fn2.name, 'retryWrapper'); + assert.equal(lib.fn3.name, 'retryWrapper'); + assert.equal(lib.fn2.options.retries, 2); + assert.equal(lib.fn3.options.retries, 2); +}()); + +(function runWrappedWithoutError() { + var callbackCalled; + var lib = {method: function(a, b, callback) { + assert.equal(a, 1); + assert.equal(b, 2); + assert.equal(typeof callback, 'function'); + callback(); + }}; + retry.wrap(lib); + lib.method(1, 2, function() { + callbackCalled = true; + }); + assert.ok(callbackCalled); +}()); + +(function runWrappedWithError() { + var callbackCalled; + var lib = {method: function(callback) { + callback(new Error('Some error')); + }}; + retry.wrap(lib, {retries: 1}); + lib.method(function(err) { + callbackCalled = true; + assert.ok(err instanceof Error); + }); + assert.ok(!callbackCalled); +}()); diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-timeouts.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-timeouts.js new file mode 100644 index 00000000000000..7206b0fb0b01d0 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-timeouts.js @@ -0,0 +1,69 @@ +var common = require('../common'); +var assert = common.assert; +var retry = require(common.dir.lib + '/retry'); + +(function testDefaultValues() { + var timeouts = retry.timeouts(); + + assert.equal(timeouts.length, 10); + assert.equal(timeouts[0], 1000); + assert.equal(timeouts[1], 2000); + assert.equal(timeouts[2], 4000); +})(); + +(function testDefaultValuesWithRandomize() { + var minTimeout = 5000; + var timeouts = retry.timeouts({ + minTimeout: minTimeout, + randomize: true + }); + + assert.equal(timeouts.length, 10); + assert.ok(timeouts[0] > minTimeout); + assert.ok(timeouts[1] > timeouts[0]); + assert.ok(timeouts[2] > timeouts[1]); +})(); + +(function testPassedTimeoutsAreUsed() { + var timeoutsArray = [1000, 2000, 3000]; + var timeouts = retry.timeouts(timeoutsArray); + assert.deepEqual(timeouts, timeoutsArray); + assert.notStrictEqual(timeouts, timeoutsArray); +})(); + +(function testTimeoutsAreWithinBoundaries() { + var minTimeout = 1000; + var maxTimeout = 10000; + var timeouts = retry.timeouts({ + minTimeout: minTimeout, + maxTimeout: maxTimeout + }); + for (var i = 0; i < timeouts; i++) { + assert.ok(timeouts[i] >= minTimeout); + assert.ok(timeouts[i] <= maxTimeout); + } +})(); + +(function testTimeoutsAreIncremental() { + var timeouts = retry.timeouts(); + var lastTimeout = timeouts[0]; + for (var i = 0; i < timeouts; i++) { + assert.ok(timeouts[i] > lastTimeout); + lastTimeout = timeouts[i]; + } +})(); + +(function testTimeoutsAreIncrementalForFactorsLessThanOne() { + var timeouts = retry.timeouts({ + retries: 3, + factor: 0.5 + }); + + var expected = [250, 500, 1000]; + assert.deepEqual(expected, timeouts); +})(); + +(function testRetries() { + var timeouts = retry.timeouts({retries: 2}); + assert.strictEqual(timeouts.length, 2); +})(); diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/runner.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/runner.js new file mode 100644 index 00000000000000..e0ee2f570fe3c0 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/runner.js @@ -0,0 +1,5 @@ +var far = require('far').create(); + +far.add(__dirname); +far.include(/\/test-.*\.js$/); +far.execute(); diff --git a/deps/npm/node_modules/npm-registry-client/package.json b/deps/npm/node_modules/npm-registry-client/package.json index ab9f763737eda5..ca717a0bd3b952 100644 --- a/deps/npm/node_modules/npm-registry-client/package.json +++ b/deps/npm/node_modules/npm-registry-client/package.json @@ -1,18 +1,51 @@ { + "_args": [ + [ + "npm-registry-client@latest", + "/Users/rebecca/code/npm" + ] + ], + "_from": "npm-registry-client@latest", + "_id": "npm-registry-client@7.1.0", + "_inCache": true, + "_installable": true, + "_location": "/npm-registry-client", + "_nodeVersion": "5.4.0", + "_npmOperationalInternal": { + "host": "packages-5-east.internal.npmjs.com", + "tmp": "tmp/npm-registry-client-7.1.0.tgz_1456435497334_0.35472381697036326" + }, + "_npmUser": { + "email": "me@re-becca.org", + "name": "iarna" + }, + "_npmVersion": "3.7.5", + "_phantomChildren": { + "inherits": "2.0.1", + "readable-stream": "2.0.5" + }, + "_requested": { + "name": "npm-registry-client", + "raw": "npm-registry-client@latest", + "rawSpec": "latest", + "scope": null, + "spec": "latest", + "type": "tag" + }, + "_requiredBy": [ + "/" + ], + "_shasum": "e3be14ab279fe5123e15ab5c8a650445415664a5", + "_shrinkwrap": null, + "_spec": "npm-registry-client@latest", + "_where": "/Users/rebecca/code/npm", "author": { - "name": "Isaac Z. Schlueter", "email": "i@izs.me", + "name": "Isaac Z. Schlueter", "url": "http://blog.izs.me/" }, - "name": "npm-registry-client", - "description": "Client for the npm registry", - "version": "7.0.7", - "repository": { - "url": "git://github.com/isaacs/npm-registry-client.git" - }, - "main": "index.js", - "scripts": { - "test": "standard && tap test/*.js" + "bugs": { + "url": "https://github.com/npm/npm-registry-client/issues" }, "dependencies": { "chownr": "^1.0.1", @@ -21,14 +54,15 @@ "mkdirp": "^0.5.0", "normalize-package-data": "~1.0.1 || ^2.0.0", "npm-package-arg": "^3.0.0 || ^4.0.0", + "npmlog": "~2.0.0", "once": "^1.3.0", "request": "^2.47.0", "retry": "^0.8.0", "rimraf": "2", "semver": "2 >=2.2.1 || 3.x || 4 || 5", - "slide": "^1.1.3", - "npmlog": "" + "slide": "^1.1.3" }, + "description": "Client for the npm registry", "devDependencies": { "negotiator": "^0.4.9", "nock": "^0.56.0", @@ -36,18 +70,43 @@ "standard": "^4.0.0", "tap": "^1.2.0" }, - "optionalDependencies": { - "npmlog": "" + "directories": {}, + "dist": { + "shasum": "e3be14ab279fe5123e15ab5c8a650445415664a5", + "tarball": "http://registry.npmjs.org/npm-registry-client/-/npm-registry-client-7.1.0.tgz" }, + "gitHead": "d077cb652152a8c265369d9d169cba8a52239fb4", + "homepage": "https://github.com/npm/npm-registry-client#readme", "license": "ISC", - "readme": "# npm-registry-client\n\nThe code that npm uses to talk to the registry.\n\nIt handles all the caching and HTTP calls.\n\n## Usage\n\n```javascript\nvar RegClient = require('npm-registry-client')\nvar client = new RegClient(config)\nvar uri = \"https://registry.npmjs.org/npm\"\nvar params = {timeout: 1000}\n\nclient.get(uri, params, function (error, data, raw, res) {\n // error is an error if there was a problem.\n // data is the parsed data object\n // raw is the json string\n // res is the response from couch\n})\n```\n\n# Registry URLs\n\nThe registry calls take either a full URL pointing to a resource in the\nregistry, or a base URL for the registry as a whole (including the registry\npath – but be sure to terminate the path with `/`). `http` and `https` URLs are\nthe only ones supported.\n\n## Using the client\n\nEvery call to the client follows the same pattern:\n\n* `uri` {String} The *fully-qualified* URI of the registry API method being\n invoked.\n* `params` {Object} Per-request parameters.\n* `callback` {Function} Callback to be invoked when the call is complete.\n\n### Credentials\n\nMany requests to the registry can by authenticated, and require credentials\nfor authorization. These credentials always look the same:\n\n* `username` {String}\n* `password` {String}\n* `email` {String}\n* `alwaysAuth` {Boolean} Whether calls to the target registry are always\n authed.\n\n**or**\n\n* `token` {String}\n* `alwaysAuth` {Boolean} Whether calls to the target registry are always\n authed.\n\n## API\n\n### client.access(uri, params, cb)\n\n* `uri` {String} Registry URL for the package's access API endpoint.\n Looks like `/-/package//access`.\n* `params` {Object} Object containing per-request properties.\n * `access` {String} New access level for the package. Can be either\n `public` or `restricted`. Registry will raise an error if trying\n to change the access level of an unscoped package.\n * `auth` {Credentials}\n\nSet the access level for scoped packages. For now, there are only two\naccess levels: \"public\" and \"restricted\".\n\n### client.adduser(uri, params, cb)\n\n* `uri` {String} Base registry URL.\n* `params` {Object} Object containing per-request properties.\n * `auth` {Credentials}\n* `cb` {Function}\n * `error` {Error | null}\n * `data` {Object} the parsed data object\n * `raw` {String} the json\n * `res` {Response Object} response from couch\n\nAdd a user account to the registry, or verify the credentials.\n\n### client.deprecate(uri, params, cb)\n\n* `uri` {String} Full registry URI for the deprecated package.\n* `params` {Object} Object containing per-request properties.\n * `version` {String} Semver version range.\n * `message` {String} The message to use as a deprecation warning.\n * `auth` {Credentials}\n* `cb` {Function}\n\nDeprecate a version of a package in the registry.\n\n### client.distTags.fetch(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `auth` {Credentials}\n* `cb` {Function}\n\nFetch all of the `dist-tags` for the named package.\n\n### client.distTags.add(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `distTag` {String} Name of the new `dist-tag`.\n * `version` {String} Exact version to be mapped to the `dist-tag`.\n * `auth` {Credentials}\n* `cb` {Function}\n\nAdd (or replace) a single dist-tag onto the named package.\n\n### client.distTags.set(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `distTags` {Object} Object containing a map from tag names to package\n versions.\n * `auth` {Credentials}\n* `cb` {Function}\n\nSet all of the `dist-tags` for the named package at once, creating any\n`dist-tags` that do not already exit. Any `dist-tags` not included in the\n`distTags` map will be removed.\n\n### client.distTags.update(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `distTags` {Object} Object containing a map from tag names to package\n versions.\n * `auth` {Credentials}\n* `cb` {Function}\n\nUpdate the values of multiple `dist-tags`, creating any `dist-tags` that do\nnot already exist. Any pre-existing `dist-tags` not included in the `distTags`\nmap will be left alone.\n\n### client.distTags.rm(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `distTag` {String} Name of the new `dist-tag`.\n * `auth` {Credentials}\n* `cb` {Function}\n\nRemove a single `dist-tag` from the named package.\n\n### client.get(uri, params, cb)\n\n* `uri` {String} The complete registry URI to fetch\n* `params` {Object} Object containing per-request properties.\n * `timeout` {Number} Duration before the request times out. Optional\n (default: never).\n * `follow` {Boolean} Follow 302/301 responses. Optional (default: true).\n * `staleOk` {Boolean} If there's cached data available, then return that to\n the callback quickly, and update the cache the background. Optional\n (default: false).\n * `auth` {Credentials} Optional.\n* `cb` {Function}\n\nFetches data from the registry via a GET request, saving it in the cache folder\nwith the ETag or the \"Last Modified\" timestamp.\n\n### client.publish(uri, params, cb)\n\n* `uri` {String} The registry URI for the package to publish.\n* `params` {Object} Object containing per-request properties.\n * `metadata` {Object} Package metadata.\n * `access` {String} Access for the package. Can be `public` or `restricted` (no default).\n * `body` {Stream} Stream of the package body / tarball.\n * `auth` {Credentials}\n* `cb` {Function}\n\nPublish a package to the registry.\n\nNote that this does not create the tarball from a folder.\n\n### client.star(uri, params, cb)\n\n* `uri` {String} The complete registry URI for the package to star.\n* `params` {Object} Object containing per-request properties.\n * `starred` {Boolean} True to star the package, false to unstar it. Optional\n (default: false).\n * `auth` {Credentials}\n* `cb` {Function}\n\nStar or unstar a package.\n\nNote that the user does not have to be the package owner to star or unstar a\npackage, though other writes do require that the user be the package owner.\n\n### client.stars(uri, params, cb)\n\n* `uri` {String} The base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `username` {String} Name of user to fetch starred packages for. Optional\n (default: user in `auth`).\n * `auth` {Credentials} Optional (required if `username` is omitted).\n* `cb` {Function}\n\nView your own or another user's starred packages.\n\n### client.tag(uri, params, cb)\n\n* `uri` {String} The complete registry URI to tag\n* `params` {Object} Object containing per-request properties.\n * `version` {String} Version to tag.\n * `tag` {String} Tag name to apply.\n * `auth` {Credentials}\n* `cb` {Function}\n\nMark a version in the `dist-tags` hash, so that `pkg@tag` will fetch the\nspecified version.\n\n### client.unpublish(uri, params, cb)\n\n* `uri` {String} The complete registry URI of the package to unpublish.\n* `params` {Object} Object containing per-request properties.\n * `version` {String} version to unpublish. Optional – omit to unpublish all\n versions.\n * `auth` {Credentials}\n* `cb` {Function}\n\nRemove a version of a package (or all versions) from the registry. When the\nlast version us unpublished, the entire document is removed from the database.\n\n### client.whoami(uri, params, cb)\n\n* `uri` {String} The base registry for the URI.\n* `params` {Object} Object containing per-request properties.\n * `auth` {Credentials}\n* `cb` {Function}\n\nSimple call to see who the registry thinks you are. Especially useful with\ntoken-based auth.\n\n\n## PLUMBING\n\nThe below are primarily intended for use by the rest of the API, or by the npm\ncaching logic directly.\n\n### client.request(uri, params, cb)\n\n* `uri` {String} URI pointing to the resource to request.\n* `params` {Object} Object containing per-request properties.\n * `method` {String} HTTP method. Optional (default: \"GET\").\n * `body` {Stream | Buffer | String | Object} The request body. Objects\n that are not Buffers or Streams are encoded as JSON. Optional – body\n only used for write operations.\n * `etag` {String} The cached ETag. Optional.\n * `lastModified` {String} The cached Last-Modified timestamp. Optional.\n * `follow` {Boolean} Follow 302/301 responses. Optional (default: true).\n * `auth` {Credentials} Optional.\n* `cb` {Function}\n * `error` {Error | null}\n * `data` {Object} the parsed data object\n * `raw` {String} the json\n * `res` {Response Object} response from couch\n\nMake a generic request to the registry. All the other methods are wrappers\naround `client.request`.\n\n### client.fetch(uri, params, cb)\n\n* `uri` {String} The complete registry URI to upload to\n* `params` {Object} Object containing per-request properties.\n * `headers` {Stream} HTTP headers to be included with the request. Optional.\n * `auth` {Credentials} Optional.\n* `cb` {Function}\n\nFetch a package from a URL, with auth set appropriately if included. Used to\ncache remote tarballs as well as request package tarballs from the registry.\n\n# Configuration\n\nThe client uses its own configuration, which is just passed in as a simple\nnested object. The following are the supported values (with their defaults, if\nany):\n\n* `proxy.http` {URL} The URL to proxy HTTP requests through.\n* `proxy.https` {URL} The URL to proxy HTTPS requests through. Defaults to be\n the same as `proxy.http` if unset.\n* `proxy.localAddress` {IP} The local address to use on multi-homed systems.\n* `ssl.ca` {String} Certificate signing authority certificates to trust.\n* `ssl.certificate` {String} Client certificate (PEM encoded). Enable access\n to servers that require client certificates.\n* `ssl.key` {String} Private key (PEM encoded) for client certificate.\n* `ssl.strict` {Boolean} Whether or not to be strict with SSL certificates.\n Default = `true`\n* `retry.count` {Number} Number of times to retry on GET failures. Default = 2.\n* `retry.factor` {Number} `factor` setting for `node-retry`. Default = 10.\n* `retry.minTimeout` {Number} `minTimeout` setting for `node-retry`.\n Default = 10000 (10 seconds)\n* `retry.maxTimeout` {Number} `maxTimeout` setting for `node-retry`.\n Default = 60000 (60 seconds)\n* `userAgent` {String} User agent header to send. Default =\n `\"node/{process.version}\"`\n* `log` {Object} The logger to use. Defaults to `require(\"npmlog\")` if\n that works, otherwise logs are disabled.\n* `defaultTag` {String} The default tag to use when publishing new packages.\n Default = `\"latest\"`\n* `couchToken` {Object} A token for use with\n [couch-login](https://npmjs.org/package/couch-login).\n* `sessionToken` {string} A random identifier for this set of client requests.\n Default = 8 random hexadecimal bytes.\n", - "readmeFilename": "README.md", - "gitHead": "06f188917bf575fe7dc7c2f6d1d4adbaa50bc423", - "bugs": { - "url": "https://github.com/isaacs/npm-registry-client/issues" + "main": "index.js", + "maintainers": [ + { + "email": "isaacs@npmjs.com", + "name": "isaacs" + }, + { + "email": "ogd@aoaioxxysz.net", + "name": "othiym23" + }, + { + "email": "me@re-becca.org", + "name": "iarna" + }, + { + "email": "kat@sykosomatic.org", + "name": "zkat" + } + ], + "name": "npm-registry-client", + "optionalDependencies": { + "npmlog": "~2.0.0" + }, + "readme": "ERROR: No README data found!", + "repository": { + "url": "git+https://github.com/npm/npm-registry-client.git" + }, + "scripts": { + "test": "standard && tap test/*.js" }, - "homepage": "https://github.com/isaacs/npm-registry-client#readme", - "_id": "npm-registry-client@7.0.7", - "_shasum": "899d7c8fefe87b72a70d8c9e075fb874539e0d3e", - "_from": "npm-registry-client@7.0.7" + "version": "7.1.0" } diff --git a/deps/npm/node_modules/npm-registry-client/test/access.js b/deps/npm/node_modules/npm-registry-client/test/access.js index c07b1bd6a33294..78b00017f18512 100644 --- a/deps/npm/node_modules/npm-registry-client/test/access.js +++ b/deps/npm/node_modules/npm-registry-client/test/access.js @@ -14,6 +14,13 @@ var PARAMS = { package: '@foo/bar', permissions: 'read-write' } +var UNSCOPED = { + auth: { token: 'foo' }, + scope: 'myorg', + team: 'myteam', + package: 'bar', + permissions: 'read-write' +} var commands = [ 'public', 'restricted', 'grant', 'revoke', 'ls-packages', 'ls-collaborators' @@ -72,6 +79,25 @@ test('access grant basic', function (t) { }) }) +test('access grant basic unscoped', function (t) { + server.expect('PUT', '/-/team/myorg/myteam/package', function (req, res) { + t.equal(req.method, 'PUT') + onJsonReq(req, function (json) { + t.deepEqual(json, { + permissions: UNSCOPED.permissions, + package: UNSCOPED.package + }) + res.statusCode = 201 + res.json({ accessChanged: true }) + }) + }) + client.access('grant', URI, UNSCOPED, function (error, data) { + t.ifError(error, 'no errors') + t.ok(data.accessChanged, 'access level set') + t.end() + }) +}) + test('access revoke basic', function (t) { server.expect('DELETE', '/-/team/myorg/myteam/package', function (req, res) { t.equal(req.method, 'DELETE') @@ -90,6 +116,24 @@ test('access revoke basic', function (t) { }) }) +test('access revoke basic unscoped', function (t) { + server.expect('DELETE', '/-/team/myorg/myteam/package', function (req, res) { + t.equal(req.method, 'DELETE') + onJsonReq(req, function (json) { + t.deepEqual(json, { + package: UNSCOPED.package + }) + res.statusCode = 200 + res.json({ accessChanged: true }) + }) + }) + client.access('revoke', URI, UNSCOPED, function (error, data) { + t.ifError(error, 'no errors') + t.ok(data.accessChanged, 'access level set') + t.end() + }) +}) + test('ls-packages on team', function (t) { var serverPackages = { '@foo/bar': 'write', @@ -188,7 +232,7 @@ test('ls-collaborators', function (t) { }) }) -test('ls-collaborators w/ scope', function (t) { +test('ls-collaborators w/scope', function (t) { var serverCollaborators = { 'myorg:myteam': 'write', 'myorg:anotherteam': 'read' @@ -212,6 +256,30 @@ test('ls-collaborators w/ scope', function (t) { }) }) +test('ls-collaborators w/o scope', function (t) { + var serverCollaborators = { + 'myorg:myteam': 'write', + 'myorg:anotherteam': 'read' + } + var clientCollaborators = { + 'myorg:myteam': 'read-write', + 'myorg:anotherteam': 'read-only' + } + var uri = '/-/package/bar/collaborators?format=cli&user=zkat' + server.expect('GET', uri, function (req, res) { + t.equal(req.method, 'GET') + res.statusCode = 200 + res.json(serverCollaborators) + }) + var params = Object.create(UNSCOPED) + params.user = 'zkat' + client.access('ls-collaborators', URI, params, function (error, data) { + t.ifError(error, 'no errors') + t.same(data, clientCollaborators) + t.end() + }) +}) + test('access command base validation', function (t) { t.throws(function () { client.access(undefined, URI, PARAMS, nop) @@ -242,7 +310,7 @@ test('access command base validation', function (t) { client.access(cmd, URI, PARAMS, undefined) }, 'callback is required') if (contains([ - 'public', 'restricted', 'grant', 'revoke', 'ls-collaborators' + 'public', 'restricted' ], cmd)) { t.throws(function () { var params = Object.create(PARAMS) @@ -253,7 +321,7 @@ test('access command base validation', function (t) { var params = Object.create(PARAMS) params.package = 'underscore' client.access(cmd, URI, params, nop) - }, 'only scopes packages are allowed') + }, 'only scoped packages are allowed') } if (contains(['grant', 'revoke', 'ls-packages'], cmd)) { t.throws(function () { diff --git a/deps/npm/node_modules/npm-registry-client/test/initialize.js b/deps/npm/node_modules/npm-registry-client/test/initialize.js index aefbe626fce210..3856b67b45e0f8 100644 --- a/deps/npm/node_modules/npm-registry-client/test/initialize.js +++ b/deps/npm/node_modules/npm-registry-client/test/initialize.js @@ -1,4 +1,5 @@ var test = require('tap').test +var url = require('url') // var server = require('./lib/server.js') var Client = require('../') @@ -29,6 +30,39 @@ test('defaulted initialization', function (t) { var HttpAgent = require('http').Agent t.ok(options.agent instanceof HttpAgent, 'got an HTTP agent for an HTTP URL') + t.equal(options.agent.maxSockets, 50, 'maxSockets set to a reasonable default') + + t.end() +}) + +test('intializing with maxSockets set works for http', function (t) { + var client = new Client({ maxSockets: Infinity }) + var options = client.initialize( + url.parse('http://localhost:1337/'), + 'GET', + 'application/json', + {} + ) + + var HttpAgent = require('http').Agent + t.ok(options.agent instanceof HttpAgent, 'got an HTTP agent for an HTTP URL') + t.equal(options.agent.maxSockets, Infinity, 'request uses configured value for maxSockets') + + t.end() +}) + +test('intializing with maxSockets set works for https', function (t) { + var client = new Client({ maxSockets: Infinity }) + var options = client.initialize( + url.parse('https://localhost:1337/'), + 'GET', + 'application/json', + {} + ) + + var HttpsAgent = require('https').Agent + t.ok(options.agent instanceof HttpsAgent, 'got an HTTPS agent for an HTTPS URL') + t.equal(options.agent.maxSockets, Infinity, 'request uses configured value for maxSockets') t.end() }) diff --git a/deps/npm/node_modules/npm-user-validate/package.json b/deps/npm/node_modules/npm-user-validate/package.json index 8a27d7cfe1ad49..2cc56691ec4fd4 100644 --- a/deps/npm/node_modules/npm-user-validate/package.json +++ b/deps/npm/node_modules/npm-user-validate/package.json @@ -30,7 +30,7 @@ "homepage": "https://github.com/npm/npm-user-validate#readme", "_id": "npm-user-validate@0.1.2", "_shasum": "d585da0b47c9f41a9e6ca684b6fd84ba41ebe87d", - "_from": "npm-user-validate@>=0.1.1 <0.2.0", + "_from": "npm-user-validate@>=0.1.2 <0.2.0", "_npmVersion": "2.10.0", "_nodeVersion": "2.0.1", "_npmUser": { diff --git a/deps/npm/node_modules/npmlog/.travis.yml b/deps/npm/node_modules/npmlog/.travis.yml new file mode 100644 index 00000000000000..e76e1ac81ff366 --- /dev/null +++ b/deps/npm/node_modules/npmlog/.travis.yml @@ -0,0 +1,14 @@ +language: node_js +sudo: false +node_js: + - "5" + - "4" + - iojs + - "0.12" + - "0.10" + - "0.8" +before_install: + - "npm install -g npm" +script: "npm test" +notifications: + slack: npm-inc:kRqQjto7YbINqHPb1X6nS3g8 diff --git a/deps/npm/node_modules/npmlog/log.js b/deps/npm/node_modules/npmlog/log.js index 8bf6422b6cf44d..8d781f17319084 100644 --- a/deps/npm/node_modules/npmlog/log.js +++ b/deps/npm/node_modules/npmlog/log.js @@ -100,9 +100,10 @@ log.clearProgress = function () { this.gauge.hide() } -log.showProgress = function (name) { +log.showProgress = function (name, completed) { if (!this.progressEnabled) return - this.gauge.show(name, this.tracker.completed()) + if (completed == null) completed = this.tracker.completed() + this.gauge.show(name, completed) }.bind(log) // bind for use in tracker's on-change listener // temporarily stop emitting, but don't drop @@ -245,3 +246,6 @@ log.addLevel('http', 3000, { fg: 'green', bg: 'black' }) log.addLevel('warn', 4000, { fg: 'black', bg: 'yellow' }, 'WARN') log.addLevel('error', 5000, { fg: 'red', bg: 'black' }, 'ERR!') log.addLevel('silent', Infinity) + +// allow 'error' prefix +log.on('error', function(){}) diff --git a/deps/npm/node_modules/ansi/.jshintrc b/deps/npm/node_modules/npmlog/node_modules/ansi/.jshintrc similarity index 100% rename from deps/npm/node_modules/ansi/.jshintrc rename to deps/npm/node_modules/npmlog/node_modules/ansi/.jshintrc diff --git a/deps/npm/node_modules/async-some/.npmignore b/deps/npm/node_modules/npmlog/node_modules/ansi/.npmignore similarity index 100% rename from deps/npm/node_modules/async-some/.npmignore rename to deps/npm/node_modules/npmlog/node_modules/ansi/.npmignore diff --git a/deps/npm/node_modules/npmlog/node_modules/ansi/History.md b/deps/npm/node_modules/npmlog/node_modules/ansi/History.md new file mode 100644 index 00000000000000..aea8aaf0991e70 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/ansi/History.md @@ -0,0 +1,23 @@ + +0.3.1 / 2016-01-14 +================== + + * add MIT LICENSE file (#23, @kasicka) + * preserve chaining after redundant style-method calls (#19, @drewblaisdell) + * package: add "license" field (#16, @BenjaminTsai) + +0.3.0 / 2014-05-09 +================== + + * package: remove "test" script and "devDependencies" + * package: remove "engines" section + * pacakge: remove "bin" section + * package: beautify + * examples: remove `starwars` example (#15) + * Documented goto, horizontalAbsolute, and eraseLine methods in README.md (#12, @Jammerwoch) + * add `.jshintrc` file + +< 0.3.0 +======= + + * Prehistoric diff --git a/deps/npm/node_modules/npmlog/node_modules/ansi/LICENSE b/deps/npm/node_modules/npmlog/node_modules/ansi/LICENSE new file mode 100644 index 00000000000000..2ea4dc5efb8729 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/ansi/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2012 Nathan Rajlich + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/ansi/README.md b/deps/npm/node_modules/npmlog/node_modules/ansi/README.md similarity index 100% rename from deps/npm/node_modules/ansi/README.md rename to deps/npm/node_modules/npmlog/node_modules/ansi/README.md diff --git a/deps/npm/node_modules/ansi/examples/beep/index.js b/deps/npm/node_modules/npmlog/node_modules/ansi/examples/beep/index.js similarity index 100% rename from deps/npm/node_modules/ansi/examples/beep/index.js rename to deps/npm/node_modules/npmlog/node_modules/ansi/examples/beep/index.js diff --git a/deps/npm/node_modules/ansi/examples/clear/index.js b/deps/npm/node_modules/npmlog/node_modules/ansi/examples/clear/index.js similarity index 100% rename from deps/npm/node_modules/ansi/examples/clear/index.js rename to deps/npm/node_modules/npmlog/node_modules/ansi/examples/clear/index.js diff --git a/deps/npm/node_modules/ansi/examples/cursorPosition.js b/deps/npm/node_modules/npmlog/node_modules/ansi/examples/cursorPosition.js similarity index 100% rename from deps/npm/node_modules/ansi/examples/cursorPosition.js rename to deps/npm/node_modules/npmlog/node_modules/ansi/examples/cursorPosition.js diff --git a/deps/npm/node_modules/ansi/examples/progress/index.js b/deps/npm/node_modules/npmlog/node_modules/ansi/examples/progress/index.js similarity index 100% rename from deps/npm/node_modules/ansi/examples/progress/index.js rename to deps/npm/node_modules/npmlog/node_modules/ansi/examples/progress/index.js diff --git a/deps/npm/node_modules/ansi/lib/ansi.js b/deps/npm/node_modules/npmlog/node_modules/ansi/lib/ansi.js similarity index 99% rename from deps/npm/node_modules/ansi/lib/ansi.js rename to deps/npm/node_modules/npmlog/node_modules/ansi/lib/ansi.js index 52fc8ec8bea14b..b1714e328995c1 100644 --- a/deps/npm/node_modules/ansi/lib/ansi.js +++ b/deps/npm/node_modules/npmlog/node_modules/ansi/lib/ansi.js @@ -238,14 +238,14 @@ Object.keys(styles).forEach(function (style) { , r = reset[style] Cursor.prototype[style] = function () { - if (this[name]) return + if (this[name]) return this this.enabled && this.write(prefix + c + suffix) this[name] = true return this } Cursor.prototype['reset' + name] = function () { - if (!this[name]) return + if (!this[name]) return this this.enabled && this.write(prefix + r + suffix) this[name] = false return this diff --git a/deps/npm/node_modules/ansi/lib/newlines.js b/deps/npm/node_modules/npmlog/node_modules/ansi/lib/newlines.js similarity index 100% rename from deps/npm/node_modules/ansi/lib/newlines.js rename to deps/npm/node_modules/npmlog/node_modules/ansi/lib/newlines.js diff --git a/deps/npm/node_modules/npmlog/node_modules/ansi/package.json b/deps/npm/node_modules/npmlog/node_modules/ansi/package.json new file mode 100644 index 00000000000000..f02794d71e2188 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/ansi/package.json @@ -0,0 +1,86 @@ +{ + "_args": [ + [ + "ansi@~0.3.0", + "/Users/rebecca/code/npm/node_modules/npmlog" + ] + ], + "_from": "ansi@>=0.3.0 <0.4.0", + "_id": "ansi@0.3.1", + "_inCache": true, + "_installable": true, + "_location": "/npmlog/ansi", + "_nodeVersion": "5.3.0", + "_npmUser": { + "email": "nathan@tootallnate.net", + "name": "tootallnate" + }, + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "name": "ansi", + "raw": "ansi@~0.3.0", + "rawSpec": "~0.3.0", + "scope": null, + "spec": ">=0.3.0 <0.4.0", + "type": "range" + }, + "_requiredBy": [ + "/npmlog", + "/npmlog/gauge" + ], + "_resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz", + "_shasum": "0c42d4fb17160d5a9af1e484bace1c66922c1b21", + "_shrinkwrap": null, + "_spec": "ansi@~0.3.0", + "_where": "/Users/rebecca/code/npm/node_modules/npmlog", + "author": { + "email": "nathan@tootallnate.net", + "name": "Nathan Rajlich", + "url": "http://tootallnate.net" + }, + "bugs": { + "url": "https://github.com/TooTallNate/ansi.js/issues" + }, + "dependencies": {}, + "description": "Advanced ANSI formatting tool for Node.js", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "0c42d4fb17160d5a9af1e484bace1c66922c1b21", + "tarball": "http://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz" + }, + "gitHead": "4d0d4af94e0bdaa648bd7262acd3bde4b98d5246", + "homepage": "https://github.com/TooTallNate/ansi.js#readme", + "keywords": [ + "256", + "ansi", + "color", + "cursor", + "formatting", + "rgb", + "stream", + "terminal" + ], + "license": "MIT", + "main": "./lib/ansi.js", + "maintainers": [ + { + "name": "TooTallNate", + "email": "nathan@tootallnate.net" + }, + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + } + ], + "name": "ansi", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/ansi.js.git" + }, + "scripts": {}, + "version": "0.3.1" +} diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/.npmignore b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/.npmignore index 926ddf616c7c12..bc818974f8633f 100644 --- a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/.npmignore +++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/.npmignore @@ -1,3 +1,5 @@ *~ .#* node_modules +coverage +.nyc_output diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/CHANGES.md b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/CHANGES.md new file mode 100644 index 00000000000000..e990b86ddfb416 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/CHANGES.md @@ -0,0 +1,19 @@ +Hi, figured we could actually use a changelog now: + +## 1.1.1 2016-01-29 + +* Fix a typo in stream completion tracker + +## 1.1.0 2016-01-29 + +* Rewrote completion percent computation to be low impact– no more walking a + tree of completion groups every time we need this info. Previously, with + medium sized tree of completion groups, even a relatively modest number of + calls to the top level `completed()` method would result in absurd numbers + of calls overall as it walked down the tree. We now, instead, keep track as + we bubble up changes, so the computation is limited to when data changes and + to the depth of that one branch, instead of _every_ node. (Plus, we were already + incurring _this_ cost, since we already bubbled out changes.) +* Moved different tracker types out to their own files. +* Made tests test for TOO MANY events too. +* Standarized the source code formatting diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/LICENSE b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/LICENSE new file mode 100644 index 00000000000000..af4588069db82d --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/LICENSE @@ -0,0 +1,5 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/README.md b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/README.md index 52f9f9ae1ed4a2..f8789800aa784c 100644 --- a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/README.md +++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/README.md @@ -25,7 +25,7 @@ single.completeWork(20) console.log(top.completed()) // 0.2 fs.stat("file", function(er, stat) { - if (er) throw er + if (er) throw er var stream = top.newStream("file", stat.size) console.log(top.completed()) // now 0.1 as single is 50% of the job and is 20% complete // and 50% * 20% == 10% @@ -62,8 +62,18 @@ This will result in one or more `change` events being emitted. Events ====== -All tracker objects emit `change` events with an argument of the name of the -thing changing. +All tracker objects emit `change` events with the following arguments: + +``` +function (name, completed, tracker) +``` + +`name` is the name of the tracker that originally emitted the event, +or if it didn't have one, the first containing tracker group that had one. + +`completed` is the percent complete (as returned by `tracker.completed()` method). + +`tracker` is the tracker object that you are listening for events on. TrackerGroup ============ @@ -128,7 +138,8 @@ Tracker events. Defaults to undefined. * **todo** *(optional)* The amount of work todo (a number). Defaults to 0. -Ordinarily these are constructed as a part of a tracker group (via `newItem`) but they c +Ordinarily these are constructed as a part of a tracker group (via +`newItem`). * var completed = tracker.completed() diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/index.js b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/index.js index 22f47ac8852b89..57d8743fdad177 100644 --- a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/index.js +++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/index.js @@ -1,130 +1,4 @@ -"use strict" -var stream = require("readable-stream"); -var EventEmitter = require("events").EventEmitter -var util = require("util") -var delegate = require("delegates") - -var TrackerGroup = exports.TrackerGroup = function (name) { - EventEmitter.call(this) - this.name = name - this.trackGroup = [] - var self = this - this.totalWeight = 0 - var noteChange = this.noteChange = function (name) { - self.emit("change", name || this.name) - }.bind(this) - this.trackGroup.forEach(function(unit) { - unit.on("change", noteChange) - }) -} -util.inherits(TrackerGroup, EventEmitter) - -TrackerGroup.prototype.completed = function () { - if (this.trackGroup.length==0) return 0 - var valPerWeight = 1 / this.totalWeight - var completed = 0 - this.trackGroup.forEach(function(T) { - completed += valPerWeight * T.weight * T.completed() - }) - return completed -} - -TrackerGroup.prototype.addUnit = function (unit, weight, noChange) { - unit.weight = weight || 1 - this.totalWeight += unit.weight - this.trackGroup.push(unit) - unit.on("change", this.noteChange) - if (! noChange) this.emit("change", this.name) - return unit -} - -TrackerGroup.prototype.newGroup = function (name, weight) { - return this.addUnit(new TrackerGroup(name), weight) -} - -TrackerGroup.prototype.newItem = function (name, todo, weight) { - return this.addUnit(new Tracker(name, todo), weight) -} - -TrackerGroup.prototype.newStream = function (name, todo, weight) { - return this.addUnit(new TrackerStream(name, todo), weight) -} - -TrackerGroup.prototype.finish = function () { - if (! this.trackGroup.length) { this.addUnit(new Tracker(), 1, true) } - var self = this - this.trackGroup.forEach(function(T) { - T.removeListener("change", self.noteChange) - T.finish() - }) - this.emit("change", this.name) -} - -var buffer = " " -TrackerGroup.prototype.debug = function (depth) { - depth = depth || 0 - var indent = depth ? buffer.substr(0,depth) : "" - var output = indent + (this.name||"top") + ": " + this.completed() + "\n" - this.trackGroup.forEach(function(T) { - if (T instanceof TrackerGroup) { - output += T.debug(depth + 1) - } - else { - output += indent + " " + T.name + ": " + T.completed() + "\n" - } - }) - return output -} - -var Tracker = exports.Tracker = function (name,todo) { - EventEmitter.call(this) - this.name = name - this.workDone = 0 - this.workTodo = todo || 0 -} -util.inherits(Tracker, EventEmitter) - -Tracker.prototype.completed = function () { - return this.workTodo==0 ? 0 : this.workDone / this.workTodo -} - -Tracker.prototype.addWork = function (work) { - this.workTodo += work - this.emit("change", this.name) -} - -Tracker.prototype.completeWork = function (work) { - this.workDone += work - if (this.workDone > this.workTodo) this.workDone = this.workTodo - this.emit("change", this.name) -} - -Tracker.prototype.finish = function () { - this.workTodo = this.workDone = 1 - this.emit("change", this.name) -} - - -var TrackerStream = exports.TrackerStream = function (name, size, options) { - stream.Transform.call(this, options) - this.tracker = new Tracker(name, size) - this.name = name - var self = this - this.tracker.on("change", function (name) { self.emit("change", name) }) -} -util.inherits(TrackerStream, stream.Transform) - -TrackerStream.prototype._transform = function (data, encoding, cb) { - this.tracker.completeWork(data.length ? data.length : 1) - this.push(data) - cb() -} - -TrackerStream.prototype._flush = function (cb) { - this.tracker.finish() - cb() -} - -delegate(TrackerStream.prototype, "tracker") - .method("completed") - .method("addWork") +'use strict' +exports.TrackerGroup = require('./tracker-group.js') +exports.Tracker = require('./tracker.js') +exports.TrackerStream = require('./tracker-stream.js') diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/History.md b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/History.md index aee31a4c35b7f3..25959eab67b840 100644 --- a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/History.md +++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/History.md @@ -1,4 +1,10 @@ +1.0.0 / 2015-12-14 +================== + + * Merge pull request #12 from kasicka/master + * Add license text + 0.1.0 / 2014-10-17 ================== diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/License b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/License new file mode 100644 index 00000000000000..60de60addbe7e9 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/License @@ -0,0 +1,20 @@ +Copyright (c) 2015 TJ Holowaychuk + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json index ea3c1da0d490b2..a32bbf52b2bbca 100644 --- a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json +++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json @@ -1,33 +1,59 @@ { - "name": "delegates", - "version": "0.1.0", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/node-delegates.git" + "_args": [ + [ + "delegates@^1.0.0", + "/Users/rebecca/code/npm/node_modules/npmlog/node_modules/are-we-there-yet" + ] + ], + "_from": "delegates@>=1.0.0 <2.0.0", + "_id": "delegates@1.0.0", + "_inCache": true, + "_installable": true, + "_location": "/npmlog/are-we-there-yet/delegates", + "_nodeVersion": "4.2.1", + "_npmUser": { + "email": "tj@vision-media.ca", + "name": "tjholowaychuk" }, - "description": "delegate methods and accessors to another property", - "keywords": [ - "delegate", - "delegation" + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "name": "delegates", + "raw": "delegates@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npmlog/are-we-there-yet" ], + "_resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "_shasum": "84c6e159b81904fdca59a0ef44cd870d31250f9a", + "_shrinkwrap": null, + "_spec": "delegates@^1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/npmlog/node_modules/are-we-there-yet", + "bugs": { + "url": "https://github.com/visionmedia/node-delegates/issues" + }, "dependencies": {}, + "description": "delegate methods and accessors to another property", "devDependencies": { "mocha": "*", "should": "*" }, - "license": "MIT", - "bugs": { - "url": "https://github.com/visionmedia/node-delegates/issues" - }, - "homepage": "https://github.com/visionmedia/node-delegates", - "_id": "delegates@0.1.0", - "_shasum": "b4b57be11a1653517a04b27f0949bdc327dfe390", - "_from": "delegates@>=0.1.0 <0.2.0", - "_npmVersion": "1.4.9", - "_npmUser": { - "name": "dominicbarnes", - "email": "dominic@dbarnes.info" + "directories": {}, + "dist": { + "shasum": "84c6e159b81904fdca59a0ef44cd870d31250f9a", + "tarball": "http://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz" }, + "gitHead": "c4dc07ef1ed51c2b2a63f3585e5ef949ee577a49", + "homepage": "https://github.com/visionmedia/node-delegates#readme", + "keywords": [ + "delegate", + "delegation" + ], + "license": "MIT", "maintainers": [ { "name": "tjholowaychuk", @@ -38,11 +64,13 @@ "email": "dominic@dbarnes.info" } ], - "dist": { - "shasum": "b4b57be11a1653517a04b27f0949bdc327dfe390", - "tarball": "http://registry.npmjs.org/delegates/-/delegates-0.1.0.tgz" + "name": "delegates", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/visionmedia/node-delegates.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/delegates/-/delegates-0.1.0.tgz", - "readme": "ERROR: No README data found!" + "scripts": {}, + "version": "1.0.0" } diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/package.json b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/package.json index 759100666932a3..eb2dea38b8b726 100644 --- a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/package.json +++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/package.json @@ -1,51 +1,81 @@ { - "name": "are-we-there-yet", - "version": "1.0.4", - "description": "Keep track of the overall completion of many dispirate processes", - "main": "index.js", - "scripts": { - "test": "tap test/*.js" + "_args": [ + [ + "are-we-there-yet@~1.1.2", + "/Users/rebecca/code/npm/node_modules/npmlog" + ] + ], + "_from": "are-we-there-yet@>=1.1.2 <1.2.0", + "_id": "are-we-there-yet@1.1.2", + "_inCache": true, + "_installable": true, + "_location": "/npmlog/are-we-there-yet", + "_nodeVersion": "4.2.2", + "_npmOperationalInternal": { + "host": "packages-13-west.internal.npmjs.com", + "tmp": "tmp/are-we-there-yet-1.1.2.tgz_1458084397358_0.15847722673788667" }, - "repository": { - "type": "git", - "url": "git+https://github.com/iarna/are-we-there-yet.git" + "_npmUser": { + "email": "me@re-becca.org", + "name": "iarna" + }, + "_npmVersion": "3.8.1", + "_phantomChildren": {}, + "_requested": { + "name": "are-we-there-yet", + "raw": "are-we-there-yet@~1.1.2", + "rawSpec": "~1.1.2", + "scope": null, + "spec": ">=1.1.2 <1.2.0", + "type": "range" }, + "_requiredBy": [ + "/npmlog" + ], + "_shasum": "80e470e95a084794fe1899262c5667c6e88de1b3", + "_shrinkwrap": null, + "_spec": "are-we-there-yet@~1.1.2", + "_where": "/Users/rebecca/code/npm/node_modules/npmlog", "author": { "name": "Rebecca Turner", "url": "http://re-becca.org" }, - "license": "ISC", "bugs": { "url": "https://github.com/iarna/are-we-there-yet/issues" }, - "homepage": "https://github.com/iarna/are-we-there-yet", + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.0 || ^1.1.13" + }, + "description": "Keep track of the overall completion of many dispirate processes", "devDependencies": { - "tap": "^0.4.13" + "standard": "^6.0.8", + "tap": "^5.7.0" }, - "dependencies": { - "delegates": "^0.1.0", - "readable-stream": "^1.1.13" - }, - "gitHead": "7ce414849b81ab83935a935275def01914821bde", - "_id": "are-we-there-yet@1.0.4", - "_shasum": "527fe389f7bcba90806106b99244eaa07e886f85", - "_from": "are-we-there-yet@>=1.0.0 <1.1.0", - "_npmVersion": "2.0.0", - "_npmUser": { - "name": "iarna", - "email": "me@re-becca.org" + "directories": {}, + "dist": { + "shasum": "80e470e95a084794fe1899262c5667c6e88de1b3", + "tarball": "http://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.2.tgz" }, + "gitHead": "dd5706e2204cb681e78031d0ffe156ed4cc75823", + "homepage": "https://github.com/iarna/are-we-there-yet", + "license": "ISC", + "main": "index.js", "maintainers": [ { - "name": "iarna", - "email": "me@re-becca.org" + "email": "me@re-becca.org", + "name": "iarna" } ], - "dist": { - "shasum": "527fe389f7bcba90806106b99244eaa07e886f85", - "tarball": "http://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.0.4.tgz" + "name": "are-we-there-yet", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/are-we-there-yet.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.0.4.tgz", - "readme": "ERROR: No README data found!" + "scripts": { + "test": "standard && tap test/*.js" + }, + "version": "1.1.2" } diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/lib/test-event.js b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/lib/test-event.js new file mode 100644 index 00000000000000..2aa7c05c5864fa --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/lib/test-event.js @@ -0,0 +1,29 @@ +'use strict' +var util = require('util') + +module.exports = function (obj, event, next) { + var timeout = setTimeout(gotTimeout, 10) + obj.once(event, gotResult) + + function gotTimeout () { + obj.removeListener(event, gotResult) + next(new Error('Timeout listening for ' + event)) + } + var result = [] + function gotResult () { + result = Array.prototype.slice.call(arguments) + clearTimeout(timeout) + timeout = setTimeout(gotNoMoreResults, 10) + obj.once(event, gotTooManyResults) + } + function gotNoMoreResults () { + obj.removeListener(event, gotTooManyResults) + var args = [null].concat(result) + next.apply(null, args) + } + function gotTooManyResults () { + var secondResult = Array.prototype.slice.call(arguments) + clearTimeout(timeout) + next(new Error('Got too many results, first ' + util.inspect(result) + ' and then ' + util.inspect(secondResult))) + } +} diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/tracker.js b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/tracker.js index 18c31c32cfda1e..374c7739d0c011 100644 --- a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/tracker.js +++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/tracker.js @@ -1,56 +1,57 @@ -"use strict" -var test = require("tap").test -var Tracker = require("../index.js").Tracker - -var timeoutError = new Error("timeout") -var testEvent = function (obj,event,next) { - var timeout = setTimeout(function(){ - obj.removeListener(event, eventHandler) - next(timeoutError) - }, 10) - var eventHandler = function () { - var args = Array.prototype.slice.call(arguments) - args.unshift(null) - clearTimeout(timeout) - next.apply(null, args) - } - obj.once(event, eventHandler) -} +'use strict' +var test = require('tap').test +var Tracker = require('../index.js').Tracker + +var testEvent = require('./lib/test-event.js') -test("Tracker", function (t) { - t.plan(10) +var name = 'test' - var name = "test" - var track = new Tracker(name) +test('initialization', function (t) { + var simple = new Tracker(name) - t.is(track.completed(), 0, "Nothing todo is 0 completion") + t.is(simple.completed(), 0, 'Nothing todo is 0 completion') + t.done() +}) - var todo = 100 +var track +var todo = 100 +test('completion', function (t) { track = new Tracker(name, todo) - t.is(track.completed(), 0, "Nothing done is 0 completion") + t.is(track.completed(), 0, 'Nothing done is 0 completion') - testEvent(track, "change", afterCompleteWork) - track.completeWork(100) - function afterCompleteWork(er, onChangeName) { - t.is(er, null, "completeWork: on change event fired") - t.is(onChangeName, name, "completeWork: on change emits the correct name") - } - t.is(track.completed(), 1, "completeWork: 100% completed") + testEvent(track, 'change', afterCompleteWork) + + track.completeWork(todo) + t.is(track.completed(), 1, 'completeWork: 100% completed') - testEvent(track, "change", afterAddWork) - track.addWork(100) - function afterAddWork(er, onChangeName) { - t.is(er, null, "addWork: on change event fired") - t.is(onChangeName, name, "addWork: on change emits the correct name") + function afterCompleteWork (er, onChangeName) { + t.is(er, null, 'completeWork: on change event fired') + t.is(onChangeName, name, 'completeWork: on change emits the correct name') + t.done() } - t.is(track.completed(), 0.5, "addWork: 50% completed") +}) +test('add more work', function (t) { + testEvent(track, 'change', afterAddWork) + track.addWork(todo) + t.is(track.completed(), 0.5, 'addWork: 50% completed') + function afterAddWork (er, onChangeName) { + t.is(er, null, 'addWork: on change event fired') + t.is(onChangeName, name, 'addWork: on change emits the correct name') + t.done() + } +}) +test('complete more work', function (t) { track.completeWork(200) - t.is(track.completed(), 1, "completeWork: Over completion is still only 100% complete") + t.is(track.completed(), 1, 'completeWork: Over completion is still only 100% complete') + t.done() +}) - track = new Tracker(name, todo) - track.completeWork(50) - track.finish() - t.is(track.completed(), 1, "finish: Explicitly finishing moves to 100%") +test('finish is always 100%', function (t) { + var finishtest = new Tracker(name, todo) + finishtest.completeWork(50) + finishtest.finish() + t.is(finishtest.completed(), 1, 'finish: Explicitly finishing moves to 100%') + t.done() }) diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/trackergroup.js b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/trackergroup.js index a64e121c03a1f1..799a7670b65934 100644 --- a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/trackergroup.js +++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/trackergroup.js @@ -1,87 +1,96 @@ -"use strict" -var test = require("tap").test -var Tracker = require("../index.js").Tracker -var TrackerGroup = require("../index.js").TrackerGroup +'use strict' +var test = require('tap').test +var TrackerGroup = require('../index.js').TrackerGroup +var testEvent = require('./lib/test-event.js') -var timeoutError = new Error("timeout") -var testEvent = function (obj,event,next) { - var timeout = setTimeout(function(){ - obj.removeListener(event, eventHandler) - next(timeoutError) - }, 10) - var eventHandler = function () { - var args = Array.prototype.slice.call(arguments) - args.unshift(null) - clearTimeout(timeout) - next.apply(null, args) - } - obj.once(event, eventHandler) -} - -test("TrackerGroup", function (t) { - var name = "test" +test('TrackerGroup', function (t) { + var name = 'test' var track = new TrackerGroup(name) - t.is(track.completed(), 0, "Nothing todo is 0 completion") - testEvent(track, "change", afterFinishEmpty) + t.is(track.completed(), 0, 'Nothing todo is 0 completion') + testEvent(track, 'change', afterFinishEmpty) track.finish() var a, b - function afterFinishEmpty(er, onChangeName) { - t.is(er, null, "finishEmpty: on change event fired") - t.is(onChangeName, name, "finishEmpty: on change emits the correct name") - t.is(track.completed(), 1, "finishEmpty: Finishing an empty group actually finishes it") + function afterFinishEmpty (er, onChangeName, completion) { + t.is(er, null, 'finishEmpty: on change event fired') + t.is(onChangeName, name, 'finishEmpty: on change emits the correct name') + t.is(completion, 1, 'finishEmpty: passed through completion was correct') + t.is(track.completed(), 1, 'finishEmpty: Finishing an empty group actually finishes it') track = new TrackerGroup(name) - a = track.newItem("a", 10, 1) - b = track.newItem("b", 10, 1) - t.is(track.completed(), 0, "Initially empty") - testEvent(track, "change", afterCompleteWork) + a = track.newItem('a', 10, 1) + b = track.newItem('b', 10, 1) + t.is(track.completed(), 0, 'Initially empty') + testEvent(track, 'change', afterCompleteWork) a.completeWork(5) } - function afterCompleteWork(er, onChangeName) { - t.is(er, null, "on change event fired") - t.is(onChangeName, "a", "on change emits the correct name") - t.is(track.completed(), 0.25, "Complete half of one is a quarter overall") - testEvent(track, "change", afterFinishAll) + function afterCompleteWork (er, onChangeName, completion) { + t.is(er, null, 'on change event fired') + t.is(onChangeName, 'a', 'on change emits the correct name') + t.is(completion, 0.25, 'Complete half of one is a quarter overall') + t.is(track.completed(), 0.25, 'Complete half of one is a quarter overall') + testEvent(track, 'change', afterFinishAll) track.finish() } - function afterFinishAll(er, onChangeName) { - t.is(er, null, "finishAll: on change event fired") - t.is(onChangeName, name, "finishAll: on change emits the correct name") - t.is(track.completed(), 1, "Finishing everything ") - + function afterFinishAll (er, onChangeName, completion) { + t.is(er, null, 'finishAll: on change event fired') + t.is(onChangeName, name, 'finishAll: on change emits the correct name') + t.is(completion, 1, 'Finishing everything ') + t.is(track.completed(), 1, 'Finishing everything ') + track = new TrackerGroup(name) - a = track.newItem("a", 10, 2) - b = track.newItem("b", 10, 1) - t.is(track.completed(), 0, "weighted: Initially empty") - testEvent(track, "change", afterWeightedCompleteWork) + a = track.newItem('a', 10, 2) + b = track.newItem('b', 10, 1) + t.is(track.completed(), 0, 'weighted: Initially empty') + testEvent(track, 'change', afterWeightedCompleteWork) a.completeWork(5) } - function afterWeightedCompleteWork(er, onChangeName) { - t.is(er, null, "weighted: on change event fired") - t.is(onChangeName, "a", "weighted: on change emits the correct name") - t.is(Math.round(track.completed()*100), 33, "weighted: Complete half of double weighted") - testEvent(track, "change", afterWeightedFinishAll) + function afterWeightedCompleteWork (er, onChangeName, completion) { + t.is(er, null, 'weighted: on change event fired') + t.is(onChangeName, 'a', 'weighted: on change emits the correct name') + t.is(Math.floor(completion * 100), 33, 'weighted: Complete half of double weighted') + t.is(Math.floor(track.completed() * 100), 33, 'weighted: Complete half of double weighted') + testEvent(track, 'change', afterWeightedFinishAll) track.finish() } - function afterWeightedFinishAll(er, onChangeName) { - t.is(er, null, "weightedFinishAll: on change event fired") - t.is(onChangeName, name, "weightedFinishAll: on change emits the correct name") - t.is(track.completed(), 1, "weightedFinishaAll: Finishing everything ") - + function afterWeightedFinishAll (er, onChangeName, completion) { + t.is(er, null, 'weightedFinishAll: on change event fired') + t.is(onChangeName, name, 'weightedFinishAll: on change emits the correct name') + t.is(completion, 1, 'weightedFinishaAll: Finishing everything ') + t.is(track.completed(), 1, 'weightedFinishaAll: Finishing everything ') + track = new TrackerGroup(name) - a = track.newGroup("a", 10) - b = track.newGroup("b", 10) - var a1 = a.newItem("a.1",10) + a = track.newGroup('a', 10) + b = track.newGroup('b', 10) + var a1 = a.newItem('a.1', 10) a1.completeWork(5) - t.is(track.completed(), 0.25, "nested: Initially quarter done") - testEvent(track, "change", afterNestedComplete) + t.is(track.completed(), 0.25, 'nested: Initially quarter done') + testEvent(track, 'change', afterNestedComplete) b.finish() } - function afterNestedComplete(er, onChangeName) { - t.is(er, null, "nestedComplete: on change event fired") - t.is(onChangeName, "b", "nestedComplete: on change emits the correct name") - t.is(track.completed(), 0.75, "nestedComplete: Finishing everything ") + function afterNestedComplete (er, onChangeName, completion) { + t.is(er, null, 'nestedComplete: on change event fired') + t.is(onChangeName, 'b', 'nestedComplete: on change emits the correct name') + t.is(completion, 0.75, 'nestedComplete: Finishing everything ') + t.is(track.completed(), 0.75, 'nestedComplete: Finishing everything ') t.end() } }) + +test('cycles', function (t) { + var track = new TrackerGroup('top') + testCycle(track, track) + var layer1 = track.newGroup('layer1') + testCycle(layer1, track) + t.end() + + function testCycle (addTo, toAdd) { + try { + addTo.addUnit(toAdd) + t.fail(toAdd.name) + } catch (ex) { + console.log(ex) + t.pass(toAdd.name) + } + } +}) diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/trackerstream.js b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/trackerstream.js index 72b6043097f477..65f04b03769190 100644 --- a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/trackerstream.js +++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/trackerstream.js @@ -1,65 +1,51 @@ -"use strict" -var test = require("tap").test -var util = require("util") -var stream = require("readable-stream") -var TrackerStream = require("../index.js").TrackerStream - -var timeoutError = new Error("timeout") -var testEvent = function (obj,event,next) { - var timeout = setTimeout(function(){ - obj.removeListener(event, eventHandler) - next(timeoutError) - }, 10) - var eventHandler = function () { - var args = Array.prototype.slice.call(arguments) - args.unshift(null) - clearTimeout(timeout) - next.apply(null, args) - } - obj.once(event, eventHandler) -} +'use strict' +var test = require('tap').test +var util = require('util') +var stream = require('readable-stream') +var TrackerStream = require('../index.js').TrackerStream +var testEvent = require('./lib/test-event.js') var Sink = function () { - stream.Writable.apply(this,arguments) + stream.Writable.apply(this, arguments) } util.inherits(Sink, stream.Writable) Sink.prototype._write = function (data, encoding, cb) { cb() } -test("TrackerStream", function (t) { +test('TrackerStream', function (t) { t.plan(9) - var name = "test" + var name = 'test' var track = new TrackerStream(name) - t.is(track.completed(), 0, "Nothing todo is 0 completion") + t.is(track.completed(), 0, 'Nothing todo is 0 completion') var todo = 10 track = new TrackerStream(name, todo) - t.is(track.completed(), 0, "Nothing done is 0 completion") + t.is(track.completed(), 0, 'Nothing done is 0 completion') track.pipe(new Sink()) - testEvent(track, "change", afterCompleteWork) - track.write("0123456789") - function afterCompleteWork(er, onChangeName) { - t.is(er, null, "write: on change event fired") - t.is(onChangeName, name, "write: on change emits the correct name") - t.is(track.completed(), 1, "write: 100% completed") + testEvent(track, 'change', afterCompleteWork) + track.write('0123456789') + function afterCompleteWork (er, onChangeName) { + t.is(er, null, 'write: on change event fired') + t.is(onChangeName, name, 'write: on change emits the correct name') + t.is(track.completed(), 1, 'write: 100% completed') - testEvent(track, "change", afterAddWork) + testEvent(track, 'change', afterAddWork) track.addWork(10) } - function afterAddWork(er, onChangeName) { - t.is(er, null, "addWork: on change event fired") - t.is(track.completed(), 0.5, "addWork: 50% completed") + function afterAddWork (er, onChangeName) { + t.is(er, null, 'addWork: on change event fired') + t.is(track.completed(), 0.5, 'addWork: 50% completed') - testEvent(track, "change", afterAllWork) - track.write("ABCDEFGHIJKLMNOPQRST") + testEvent(track, 'change', afterAllWork) + track.write('ABCDEFGHIJKLMNOPQRST') } - function afterAllWork(er) { - t.is(er, null, "allWork: on change event fired") - t.is(track.completed(), 1, "allWork: 100% completed") + function afterAllWork (er) { + t.is(er, null, 'allWork: on change event fired') + t.is(track.completed(), 1, 'allWork: 100% completed') } }) diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker-base.js b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker-base.js new file mode 100644 index 00000000000000..6f436875578a7a --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker-base.js @@ -0,0 +1,11 @@ +'use strict' +var EventEmitter = require('events').EventEmitter +var util = require('util') + +var trackerId = 0 +var TrackerBase = module.exports = function (name) { + EventEmitter.call(this) + this.id = ++trackerId + this.name = name +} +util.inherits(TrackerBase, EventEmitter) diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker-group.js b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker-group.js new file mode 100644 index 00000000000000..9759e1226db046 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker-group.js @@ -0,0 +1,107 @@ +'use strict' +var util = require('util') +var TrackerBase = require('./tracker-base.js') +var Tracker = require('./tracker.js') +var TrackerStream = require('./tracker-stream.js') + +var TrackerGroup = module.exports = function (name) { + TrackerBase.call(this, name) + this.parentGroup = null + this.trackers = [] + this.completion = {} + this.weight = {} + this.totalWeight = 0 + this.finished = false + this.bubbleChange = bubbleChange(this) +} +util.inherits(TrackerGroup, TrackerBase) + +function bubbleChange (trackerGroup) { + return function (name, completed, tracker) { + trackerGroup.completion[tracker.id] = completed + if (trackerGroup.finished) return + trackerGroup.emit('change', name || trackerGroup.name, trackerGroup.completed(), trackerGroup) + } +} + +TrackerGroup.prototype.nameInTree = function () { + var names = [] + var from = this + while (from) { + names.unshift(from.name) + from = from.parentGroup + } + return names.join('/') +} + +TrackerGroup.prototype.addUnit = function (unit, weight) { + if (unit.addUnit) { + var toTest = this + while (toTest) { + if (unit === toTest) { + throw new Error( + 'Attempted to add tracker group ' + + unit.name + ' to tree that already includes it ' + + this.nameInTree(this)) + } + toTest = toTest.parentGroup + } + unit.parentGroup = this + } + this.weight[unit.id] = weight || 1 + this.totalWeight += this.weight[unit.id] + this.trackers.push(unit) + this.completion[unit.id] = unit.completed() + unit.on('change', this.bubbleChange) + if (!this.finished) this.emit('change', unit.name, this.completion[unit.id], unit) + return unit +} + +TrackerGroup.prototype.completed = function () { + if (this.trackers.length === 0) return 0 + var valPerWeight = 1 / this.totalWeight + var completed = 0 + for (var ii = 0; ii < this.trackers.length; ii++) { + var trackerId = this.trackers[ii].id + completed += valPerWeight * this.weight[trackerId] * this.completion[trackerId] + } + return completed +} + +TrackerGroup.prototype.newGroup = function (name, weight) { + return this.addUnit(new TrackerGroup(name), weight) +} + +TrackerGroup.prototype.newItem = function (name, todo, weight) { + return this.addUnit(new Tracker(name, todo), weight) +} + +TrackerGroup.prototype.newStream = function (name, todo, weight) { + return this.addUnit(new TrackerStream(name, todo), weight) +} + +TrackerGroup.prototype.finish = function () { + this.finished = true + if (!this.trackers.length) this.addUnit(new Tracker(), 1, true) + for (var ii = 0; ii < this.trackers.length; ii++) { + var tracker = this.trackers[ii] + tracker.finish() + tracker.removeListener('change', this.bubbleChange) + } + this.emit('change', this.name, 1, this) +} + +var buffer = ' ' +TrackerGroup.prototype.debug = function (depth) { + depth = depth || 0 + var indent = depth ? buffer.substr(0, depth) : '' + var output = indent + (this.name || 'top') + ': ' + this.completed() + '\n' + this.trackers.forEach(function (tracker) { + if (tracker instanceof TrackerGroup) { + output += tracker.debug(depth + 1) + } else { + output += indent + ' ' + tracker.name + ': ' + tracker.completed() + '\n' + } + }) + return output +} diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker-stream.js b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker-stream.js new file mode 100644 index 00000000000000..fb9598ed4e9c31 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker-stream.js @@ -0,0 +1,35 @@ +'use strict' +var util = require('util') +var stream = require('readable-stream') +var delegate = require('delegates') +var Tracker = require('./tracker.js') + +var TrackerStream = module.exports = function (name, size, options) { + stream.Transform.call(this, options) + this.tracker = new Tracker(name, size) + this.name = name + this.id = this.tracker.id + this.tracker.on('change', delegateChange(this)) +} +util.inherits(TrackerStream, stream.Transform) + +function delegateChange (trackerStream) { + return function (name, completion, tracker) { + trackerStream.emit('change', name, completion, trackerStream) + } +} + +TrackerStream.prototype._transform = function (data, encoding, cb) { + this.tracker.completeWork(data.length ? data.length : 1) + this.push(data) + cb() +} + +TrackerStream.prototype._flush = function (cb) { + this.tracker.finish() + cb() +} + +delegate(TrackerStream.prototype, 'tracker') + .method('completed') + .method('addWork') diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker.js b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker.js new file mode 100644 index 00000000000000..68c2339b45409a --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/tracker.js @@ -0,0 +1,30 @@ +'use strict' +var util = require('util') +var TrackerBase = require('./tracker-base.js') + +var Tracker = module.exports = function (name, todo) { + TrackerBase.call(this, name) + this.workDone = 0 + this.workTodo = todo || 0 +} +util.inherits(Tracker, TrackerBase) + +Tracker.prototype.completed = function () { + return this.workTodo === 0 ? 0 : this.workDone / this.workTodo +} + +Tracker.prototype.addWork = function (work) { + this.workTodo += work + this.emit('change', this.name, this.completed(), this) +} + +Tracker.prototype.completeWork = function (work) { + this.workDone += work + if (this.workDone > this.workTodo) this.workDone = this.workTodo + this.emit('change', this.name, this.completed(), this) +} + +Tracker.prototype.finish = function () { + this.workTodo = this.workDone = 1 + this.emit('change', this.name, 1, this) +} diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/README.md index fb9eb0a7d1e125..337dc9d8d45e14 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/README.md +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/README.md @@ -1,7 +1,7 @@ gauge ===== -A nearly stateless terminal based horizontal guage / progress bar. +A nearly stateless terminal based horizontal gauge / progress bar. ```javascript var Gauge = require("gauge") @@ -30,6 +30,11 @@ gauge.hide() Constructs a new gauge. Gauges are drawn on a single line, and are not drawn if the current terminal isn't a tty. +If you resize your terminal in a way that can be detected then the gauge +will be drawn at the new size. As a general rule, growing your terminal will +be clean, but shrinking your terminal will result in cruft as we don't have +enough information to know where what we wrote previously is now located. + The **options** object can have the following properties, all of which are optional: @@ -117,7 +122,7 @@ will be turned into the gauge line. The default template is: ```javascript [ - {type: "name", separated: true, maxLength: 25, minWidth: 25, align: "left"}, + {type: "name", separated: true, maxLength: 25, minLength: 25, align: "left"}, {type: "spinner", separated: true}, {type: "startgroup"}, {type: "completionbar"}, @@ -131,7 +136,7 @@ be be included verbatum in the output. If the template element is an object, it can have the following keys: * *type* can be: - * `name` – The most recent name passed to `show`; if this is in response to a + * `name` – The most recent name passed to `show`; if this is in response to a `pulse` then the name passed to `pulse` will be appended along with the subsection property from the theme. * `spinner` – If you've ever called `pulse` this will be one of the characters @@ -148,7 +153,7 @@ If the template element is an object, it can have the following keys: will be padded according to the *align* value. * *align* – (Default: left) Possible values "left", "right" and "center". Works as you'd expect from word processors. -* *length* – Provides a single value for both *minLength* and *maxLength*. If both +* *length* – Provides a single value for both *minLength* and *maxLength*. If both *length* and *minLength or *maxLength* are specifed then the latter take precedence. ### Tracking Completion diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/LICENSE b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/LICENSE deleted file mode 100644 index d42e25e95655bb..00000000000000 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/LICENSE +++ /dev/null @@ -1,14 +0,0 @@ -Copyright (c) 2014, Rebecca Turner - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/README.md deleted file mode 100644 index e9d3cc326c144a..00000000000000 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/README.md +++ /dev/null @@ -1,40 +0,0 @@ -has-unicode -=========== - -Try to guess if your terminal supports unicode - -```javascript -var hasUnicode = require("has-unicode") - -if (hasUnicode()) { - // the terminal probably has unicode support -} -``` -```javascript -var hasUnicode = require("has-unicode").tryHarder -hasUnicode(function(unicodeSupported) { - if (unicodeSupported) { - // the terminal probably has unicode support - } -}) -``` - -## Detecting Unicode - -What we actually detect is UTF-8 support, as that's what Node itself supports. -If you have a UTF-16 locale then you won't be detected as unicode capable. - -### Windows - -Since at least Windows 7, `cmd` and `powershell` have been unicode capable. -As such, we report any Windows installation as unicode capable. - - -### Unix Like Operating Systems - -We look at the environment variables `LC_ALL`, `LC_CTYPE`, and `LANG` in -that order. For `LC_ALL` and `LANG`, it looks for `.UTF-8` in the value. -For `LC_CTYPE` it looks to see if the value is `UTF-8`. This is sufficient -for most POSIX systems. While locale data can be put in `/etc/locale.conf` -as well, AFAIK it's always copied into the environment. - diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/index.js deleted file mode 100644 index edceb703094082..00000000000000 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/index.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict" -var os = require("os") -var child_process = require("child_process") - -var hasUnicode = module.exports = function () { - // Supported Win32 platforms (>XP) support unicode in the console, though - // font support isn't fantastic. - if (os.type() == "Windows_NT") { return true } - - var isUTF8 = /[.]UTF-8/ - if (isUTF8.test(process.env.LC_ALL) - || process.env.LC_CTYPE == 'UTF-8' - || isUTF8.test(process.env.LANG)) { - return true - } - - return false -} diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/package.json deleted file mode 100644 index fd552a9e4096ee..00000000000000 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "has-unicode", - "version": "1.0.0", - "description": "Try to guess if your terminal supports unicode", - "main": "index.js", - "scripts": { - "test": "tap test/*.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/iarna/has-unicode.git" - }, - "keywords": [ - "unicode", - "terminal" - ], - "author": { - "name": "Rebecca Turner", - "email": "me@re-becca.org" - }, - "license": "ISC", - "bugs": { - "url": "https://github.com/iarna/has-unicode/issues" - }, - "homepage": "https://github.com/iarna/has-unicode", - "devDependencies": { - "require-inject": "^1.1.1", - "tap": "^0.4.13" - }, - "gitHead": "a8c3dcf3be5f0c8f8e26a3e7ffea7da24344a006", - "_id": "has-unicode@1.0.0", - "_shasum": "bac5c44e064c2ffc3b8fcbd8c71afe08f9afc8cc", - "_from": "has-unicode@>=1.0.0 <2.0.0", - "_npmVersion": "2.1.11", - "_nodeVersion": "0.10.33", - "_npmUser": { - "name": "iarna", - "email": "me@re-becca.org" - }, - "maintainers": [ - { - "name": "iarna", - "email": "me@re-becca.org" - } - ], - "dist": { - "shasum": "bac5c44e064c2ffc3b8fcbd8c71afe08f9afc8cc", - "tarball": "http://registry.npmjs.org/has-unicode/-/has-unicode-1.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-1.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/test/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/test/index.js deleted file mode 100644 index 2394c14ef7fce9..00000000000000 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/test/index.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict" -var test = require("tap").test -var requireInject = require("require-inject") - -test("Windows", function (t) { - t.plan(1) - var hasUnicode = requireInject("../index.js", { - os: { type: function () { return "Windows_NT" } } - }) - t.is(hasUnicode(), true, "Windows is assumed to be unicode aware") -}) -test("Unix Env", function (t) { - t.plan(3) - var hasUnicode = requireInject("../index.js", { - os: { type: function () { return "Linux" } }, - child_process: { exec: function (cmd,cb) { cb(new Error("not available")) } } - }) - process.env.LANG = "en_US.UTF-8" - process.env.LC_ALL = null - t.is(hasUnicode(), true, "Linux with a UTF8 language") - process.env.LANG = null - process.env.LC_ALL = "en_US.UTF-8" - t.is(hasUnicode(), true, "Linux with UTF8 locale") - process.env.LC_ALL = null - t.is(hasUnicode(), false, "Linux without UTF8 language or locale") -}) diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/README.md deleted file mode 100644 index ad04ea956e4d20..00000000000000 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._basetostring v3.0.0 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseToString` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._basetostring -``` - -In Node.js/io.js: - -```js -var baseToString = require('lodash._basetostring'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash._basetostring) for more details. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/index.js deleted file mode 100644 index 71ac885889b9e6..00000000000000 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/index.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * lodash 3.0.0 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * Converts `value` to a string if it is not one. An empty string is returned - * for `null` or `undefined` values. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - if (typeof value == 'string') { - return value; - } - return value == null ? '' : (value + ''); -} - -module.exports = baseToString; diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/package.json deleted file mode 100644 index dfb815b75772c1..00000000000000 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "lodash._basetostring", - "version": "3.0.0", - "description": "The modern build of lodash’s internal `baseToString` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._basetostring@3.0.0", - "_shasum": "75a9a4aaaa2b2a8761111ff5431e7d83c1daf0e2", - "_from": "lodash._basetostring@3.0.0", - "_npmVersion": "2.3.0", - "_nodeVersion": "0.10.35", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - } - ], - "dist": { - "shasum": "75a9a4aaaa2b2a8761111ff5431e7d83c1daf0e2", - "tarball": "http://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/README.md deleted file mode 100644 index 0e1c73128ce792..00000000000000 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash._createpadding v3.6.0 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `createPadding` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._createpadding -``` - -In Node.js/io.js: - -```js -var createPadding = require('lodash._createpadding'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.6.0-npm-packages/lodash._createpadding) for more details. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/index.js deleted file mode 100644 index 72890bd2d8f4cf..00000000000000 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/index.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * lodash 3.6.0 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.2 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -var repeat = require('lodash.repeat'); - -/** Native method references. */ -var ceil = Math.ceil; - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeIsFinite = global.isFinite; - -/** - * Creates the padding required for `string` based on the given `length`. - * The `chars` string is truncated if the number of characters exceeds `length`. - * - * @private - * @param {string} string The string to create padding for. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the pad for `string`. - */ -function createPadding(string, length, chars) { - var strLength = string.length; - length = +length; - - if (strLength >= length || !nativeIsFinite(length)) { - return ''; - } - var padLength = length - strLength; - chars = chars == null ? ' ' : (chars + ''); - return repeat(chars, ceil(padLength / chars.length)).slice(0, padLength); -} - -module.exports = createPadding; diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE.txt b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE.txt deleted file mode 100644 index 17764328c826b5..00000000000000 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md deleted file mode 100644 index d2796e3f739a4f..00000000000000 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash.repeat v3.0.0 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.repeat` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.repeat -``` - -In Node.js/io.js: - -```js -var repeat = require('lodash.repeat'); -``` - -See the [documentation](https://lodash.com/docs#repeat) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.repeat) for more details. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js deleted file mode 100644 index 68e100813461a4..00000000000000 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * lodash 3.0.0 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -var baseToString = require('lodash._basetostring'); - -/** Native method references. */ -var floor = Math.floor; - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeIsFinite = global.isFinite; - -/** - * Repeats the given string `n` times. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to repeat. - * @param {number} [n=0] The number of times to repeat the string. - * @returns {string} Returns the repeated string. - * @example - * - * _.repeat('*', 3); - * // => '***' - * - * _.repeat('abc', 2); - * // => 'abcabc' - * - * _.repeat('abc', 0); - * // => '' - */ -function repeat(string, n) { - var result = ''; - string = baseToString(string); - n = +n; - if (n < 1 || !string || !nativeIsFinite(n)) { - return result; - } - // Leverage the exponentiation by squaring algorithm for a faster repeat. - // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. - do { - if (n % 2) { - result += string; - } - n = floor(n / 2); - string += string; - } while (n); - - return result; -} - -module.exports = repeat; diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json deleted file mode 100644 index de5156da130dc2..00000000000000 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "name": "lodash.repeat", - "version": "3.0.0", - "description": "The modern build of lodash’s `_.repeat` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": [ - "lodash", - "lodash-modularized", - "stdlib", - "util" - ], - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "dependencies": { - "lodash._basetostring": "^3.0.0" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash.repeat@3.0.0", - "_shasum": "c340f4136c99dc5b2e397b3fd50cffbd172a94b0", - "_from": "lodash.repeat@>=3.0.0 <4.0.0", - "_npmVersion": "2.3.0", - "_nodeVersion": "0.10.35", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - } - ], - "dist": { - "shasum": "c340f4136c99dc5b2e397b3fd50cffbd172a94b0", - "tarball": "http://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/package.json deleted file mode 100644 index ffe797253ae925..00000000000000 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "lodash._createpadding", - "version": "3.6.0", - "description": "The modern build of lodash’s internal `createPadding` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "dependencies": { - "lodash.repeat": "^3.0.0" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash._createpadding@3.6.0", - "_shasum": "c466850dd1a05e6bfec54fd0cf0db28b68332d5e", - "_from": "lodash._createpadding@3.6.0", - "_npmVersion": "2.7.3", - "_nodeVersion": "0.12.0", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - } - ], - "dist": { - "shasum": "c466850dd1a05e6bfec54fd0cf0db28b68332d5e", - "tarball": "http://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/LICENSE b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/LICENSE new file mode 100644 index 00000000000000..bcbe13d67a9621 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/README.md index 9b4891cd8c6f41..f43453bf2e04eb 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/README.md +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/README.md @@ -1,20 +1,18 @@ -# lodash.pad v3.1.0 +# lodash.pad v4.1.0 -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.pad` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. +The [lodash](https://lodash.com/) method `_.pad` exported as a [Node.js](https://nodejs.org/) module. ## Installation Using npm: - ```bash $ {sudo -H} npm i -g npm $ npm i --save lodash.pad ``` -In Node.js/io.js: - +In Node.js: ```js var pad = require('lodash.pad'); ``` -See the [documentation](https://lodash.com/docs#pad) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.pad) for more details. +See the [documentation](https://lodash.com/docs#pad) or [package source](https://github.com/lodash/lodash/blob/4.1.0-npm-packages/lodash.pad) for more details. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/index.js index d08251ba5939ee..6220e0f831a714 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/index.js +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/index.js @@ -1,23 +1,263 @@ /** - * lodash 3.1.0 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.2 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * lodash 4.1.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ -var baseToString = require('lodash._basetostring'), - createPadding = require('lodash._createpadding'); +var repeat = require('lodash.repeat'), + toString = require('lodash.tostring'); -/** Native method references. */ -var ceil = Math.ceil, - floor = Math.floor; +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeIsFinite = global.isFinite; +/** `Object#toString` result references. */ +var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsComboSymbolsRange = '\\u20d0-\\u20f0', + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange + ']', + rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ +var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ +function stringSize(string) { + if (!(string && reHasComplexSymbol.test(string))) { + return string.length; + } + var result = reComplexSymbol.lastIndex = 0; + while (reComplexSymbol.test(string)) { + result++; + } + return result; +} + +/** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function stringToArray(string) { + return string.match(reComplexSymbol); +} + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeCeil = Math.ceil, + nativeFloor = Math.floor; + +/** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {string} string The string to create padding for. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ +function createPadding(string, length, chars) { + length = toInteger(length); + + var strLength = stringSize(string); + if (!length || strLength >= length) { + return ''; + } + var padLength = length - strLength; + chars = chars === undefined ? ' ' : (chars + ''); + + var result = repeat(chars, nativeCeil(padLength / stringSize(chars))); + return reHasComplexSymbol.test(chars) + ? stringToArray(result).slice(0, padLength).join('') + : result.slice(0, padLength); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array constructors, and + // PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Converts `value` to an integer. + * + * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3'); + * // => 3 + */ +function toInteger(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + var remainder = value % 1; + return value === value ? (remainder ? value - remainder : value) : 0; +} + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3); + * // => 3 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3'); + * // => 3 + */ +function toNumber(value) { + if (isObject(value)) { + var other = isFunction(value.valueOf) ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} /** - * Pads `string` on the left and right sides if it is shorter than `length`. + * Pads `string` on the left and right sides if it's shorter than `length`. * Padding characters are truncated if they can't be evenly divided by `length`. * * @static @@ -39,19 +279,18 @@ var nativeIsFinite = global.isFinite; * // => 'abc' */ function pad(string, length, chars) { - string = baseToString(string); - length = +length; + string = toString(string); + length = toInteger(length); - var strLength = string.length; - if (strLength >= length || !nativeIsFinite(length)) { + var strLength = stringSize(string); + if (!length || strLength >= length) { return string; } var mid = (length - strLength) / 2, - leftLength = floor(mid), - rightLength = ceil(mid); + leftLength = nativeFloor(mid), + rightLength = nativeCeil(mid); - chars = createPadding('', rightLength, chars); - return chars.slice(0, leftLength) + string + chars; + return createPadding('', leftLength, chars) + string + createPadding('', rightLength, chars); } module.exports = pad; diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/LICENSE b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/LICENSE new file mode 100644 index 00000000000000..bcbe13d67a9621 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/README.md new file mode 100644 index 00000000000000..33b447cd53e779 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/README.md @@ -0,0 +1,18 @@ +# lodash.repeat v4.0.0 + +The [lodash](https://lodash.com/) method `_.repeat` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.repeat +``` + +In Node.js: +```js +var repeat = require('lodash.repeat'); +``` + +See the [documentation](https://lodash.com/docs#repeat) or [package source](https://github.com/lodash/lodash/blob/4.0.0-npm-packages/lodash.repeat) for more details. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/index.js new file mode 100644 index 00000000000000..7a54e85714c367 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/index.js @@ -0,0 +1,215 @@ +/** + * lodash 4.0.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var toString = require('lodash.tostring'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + +/** `Object#toString` result references. */ +var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeFloor = Math.floor; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array constructors, and + // PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Converts `value` to an integer. + * + * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3'); + * // => 3 + */ +function toInteger(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + var remainder = value % 1; + return value === value ? (remainder ? value - remainder : value) : 0; +} + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3); + * // => 3 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3'); + * // => 3 + */ +function toNumber(value) { + if (isObject(value)) { + var other = isFunction(value.valueOf) ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +/** + * Repeats the given string `n` times. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to repeat. + * @param {number} [n=0] The number of times to repeat the string. + * @returns {string} Returns the repeated string. + * @example + * + * _.repeat('*', 3); + * // => '***' + * + * _.repeat('abc', 2); + * // => 'abcabc' + * + * _.repeat('abc', 0); + * // => '' + */ +function repeat(string, n) { + string = toString(string); + n = toInteger(n); + + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + string += string; + } while (n); + + return result; +} + +module.exports = repeat; diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/package.json new file mode 100644 index 00000000000000..b9946dcdbf7951 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/package.json @@ -0,0 +1,107 @@ +{ + "_args": [ + [ + "lodash.repeat@^4.0.0", + "/Users/rebecca/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad" + ] + ], + "_from": "lodash.repeat@>=4.0.0 <5.0.0", + "_id": "lodash.repeat@4.0.0", + "_inCache": true, + "_installable": true, + "_location": "/npmlog/gauge/lodash.pad/lodash.repeat", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-9-west.internal.npmjs.com", + "tmp": "tmp/lodash.repeat-4.0.0.tgz_1455602646227_0.7481637196615338" + }, + "_npmUser": { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + "_npmVersion": "2.14.18", + "_phantomChildren": {}, + "_requested": { + "name": "lodash.repeat", + "raw": "lodash.repeat@^4.0.0", + "rawSpec": "^4.0.0", + "scope": null, + "spec": ">=4.0.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npmlog/gauge/lodash.pad" + ], + "_resolved": "https://registry.npmjs.org/lodash.repeat/-/lodash.repeat-4.0.0.tgz", + "_shasum": "aaf570b2ab0bfb0dda6d6e93291d54b30b1f7d22", + "_shrinkwrap": null, + "_spec": "lodash.repeat@^4.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad", + "author": { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "contributors": [ + { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + { + "email": "blaine@iceddev.com", + "name": "Blaine Bublitz", + "url": "https://github.com/phated" + }, + { + "email": "mathias@qiwi.be", + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": { + "lodash.tostring": "^4.0.0" + }, + "description": "The lodash method `_.repeat` exported as a module.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "aaf570b2ab0bfb0dda6d6e93291d54b30b1f7d22", + "tarball": "http://registry.npmjs.org/lodash.repeat/-/lodash.repeat-4.0.0.tgz" + }, + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash-modularized", + "repeat" + ], + "license": "MIT", + "maintainers": [ + { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + { + "email": "mathias@qiwi.be", + "name": "mathias" + }, + { + "email": "blaine@iceddev.com", + "name": "phated" + } + ], + "name": "lodash.repeat", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.0.0" +} diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/LICENSE b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/LICENSE new file mode 100644 index 00000000000000..bcbe13d67a9621 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/README.md new file mode 100644 index 00000000000000..b3858fd68e7866 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/README.md @@ -0,0 +1,18 @@ +# lodash.tostring v4.1.2 + +The [lodash](https://lodash.com/) method `_.toString` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.tostring +``` + +In Node.js: +```js +var toString = require('lodash.tostring'); +``` + +See the [documentation](https://lodash.com/docs#toString) or [package source](https://github.com/lodash/lodash/blob/4.1.2-npm-packages/lodash.tostring) for more details. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/index.js new file mode 100644 index 00000000000000..5c0e3e2b987eb6 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/index.js @@ -0,0 +1,164 @@ +/** + * lodash 4.1.2 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Used to determine if values are of the language type `Object`. */ +var objectTypes = { + 'function': true, + 'object': true +}; + +/** Detect free variable `exports`. */ +var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) + ? exports + : undefined; + +/** Detect free variable `module`. */ +var freeModule = (objectTypes[typeof module] && module && !module.nodeType) + ? module + : undefined; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); + +/** Detect free variable `self`. */ +var freeSelf = checkGlobal(objectTypes[typeof self] && self); + +/** Detect free variable `window`. */ +var freeWindow = checkGlobal(objectTypes[typeof window] && window); + +/** Detect `this` as the global object. */ +var thisGlobal = checkGlobal(objectTypes[typeof this] && this); + +/** + * Used as a reference to the global object. + * + * The `this` value is used if it's the global object to avoid Greasemonkey's + * restricted `window` object, otherwise the `window` object is used. + */ +var root = freeGlobal || + ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || + freeSelf || thisGlobal || Function('return this')(); + +/** + * Checks if `value` is a global object. + * + * @private + * @param {*} value The value to check. + * @returns {null|Object} Returns `value` if it's a global object, else `null`. + */ +function checkGlobal(value) { + return (value && value.Object === Object) ? value : null; +} + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Built-in value references. */ +var Symbol = root.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (value == null) { + return ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +module.exports = toString; diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/package.json new file mode 100644 index 00000000000000..8ee1a50433d1f6 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/package.json @@ -0,0 +1,106 @@ +{ + "_args": [ + [ + "lodash.tostring@^4.0.0", + "/Users/rebecca/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad" + ] + ], + "_from": "lodash.tostring@>=4.0.0 <5.0.0", + "_id": "lodash.tostring@4.1.2", + "_inCache": true, + "_installable": true, + "_location": "/npmlog/gauge/lodash.pad/lodash.tostring", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-13-west.internal.npmjs.com", + "tmp": "tmp/lodash.tostring-4.1.2.tgz_1456896853027_0.8195764778647572" + }, + "_npmUser": { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + "_npmVersion": "2.14.17", + "_phantomChildren": {}, + "_requested": { + "name": "lodash.tostring", + "raw": "lodash.tostring@^4.0.0", + "rawSpec": "^4.0.0", + "scope": null, + "spec": ">=4.0.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npmlog/gauge/lodash.pad", + "/npmlog/gauge/lodash.pad/lodash.repeat" + ], + "_resolved": "https://registry.npmjs.org/lodash.tostring/-/lodash.tostring-4.1.2.tgz", + "_shasum": "7d326a5cf64da4298f2fd35b688d848267535288", + "_shrinkwrap": null, + "_spec": "lodash.tostring@^4.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad", + "author": { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "contributors": [ + { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + { + "email": "blaine.bublitz@gmail.com", + "name": "Blaine Bublitz", + "url": "https://github.com/phated" + }, + { + "email": "mathias@qiwi.be", + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": {}, + "description": "The lodash method `_.toString` exported as a module.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "7d326a5cf64da4298f2fd35b688d848267535288", + "tarball": "http://registry.npmjs.org/lodash.tostring/-/lodash.tostring-4.1.2.tgz" + }, + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash-modularized", + "tostring" + ], + "license": "MIT", + "maintainers": [ + { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + { + "email": "mathias@qiwi.be", + "name": "mathias" + }, + { + "email": "blaine.bublitz@gmail.com", + "name": "phated" + } + ], + "name": "lodash.tostring", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.1.2" +} diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json index 6f028c0cc622d8..2b83241d5057e0 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json @@ -1,98 +1,108 @@ { - "name": "lodash.pad", - "version": "3.1.0", - "description": "The modern build of lodash’s `_.pad` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": [ - "lodash", - "lodash-modularized", - "stdlib", - "util" + "_args": [ + [ + "lodash.pad@^4.1.0", + "/Users/rebecca/code/npm/node_modules/npmlog/node_modules/gauge" + ] + ], + "_from": "lodash.pad@>=4.1.0 <5.0.0", + "_id": "lodash.pad@4.1.0", + "_inCache": true, + "_installable": true, + "_location": "/npmlog/gauge/lodash.pad", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-9-west.internal.npmjs.com", + "tmp": "tmp/lodash.pad-4.1.0.tgz_1455615516420_0.3130727862007916" + }, + "_npmUser": { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + "_npmVersion": "2.14.18", + "_phantomChildren": {}, + "_requested": { + "name": "lodash.pad", + "raw": "lodash.pad@^4.1.0", + "rawSpec": "^4.1.0", + "scope": null, + "spec": ">=4.1.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npmlog/gauge" ], + "_resolved": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-4.1.0.tgz", + "_shasum": "dbbe3a9681fccb69970473a2263f50c196ac3aa9", + "_shrinkwrap": null, + "_spec": "lodash.pad@^4.1.0", + "_where": "/Users/rebecca/code/npm/node_modules/npmlog/node_modules/gauge", "author": { - "name": "John-David Dalton", "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", "url": "http://allyoucanleet.com/" }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, "contributors": [ { - "name": "John-David Dalton", "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", "url": "http://allyoucanleet.com/" }, { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" + "name": "Blaine Bublitz", + "url": "https://github.com/phated" }, { - "name": "Mathias Bynens", "email": "mathias@qiwi.be", + "name": "Mathias Bynens", "url": "https://mathiasbynens.be/" } ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, "dependencies": { - "lodash._basetostring": "^3.0.0", - "lodash._createpadding": "^3.0.0" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" + "lodash.repeat": "^4.0.0", + "lodash.tostring": "^4.0.0" }, - "_id": "lodash.pad@3.1.0", - "_shasum": "9f18b1f3749a95e197b5ff2ae752ea9851ada965", - "_from": "lodash.pad@>=3.0.0 <4.0.0", - "_npmVersion": "2.7.3", - "_nodeVersion": "0.12.0", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" + "description": "The lodash method `_.pad` exported as a module.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "dbbe3a9681fccb69970473a2263f50c196ac3aa9", + "tarball": "http://registry.npmjs.org/lodash.pad/-/lodash.pad-4.1.0.tgz" }, + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash-modularized", + "pad" + ], + "license": "MIT", "maintainers": [ { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" + "email": "john.david.dalton@gmail.com", + "name": "jdalton" }, { - "name": "mathias", - "email": "mathias@qiwi.be" + "email": "mathias@qiwi.be", + "name": "mathias" }, { - "name": "phated", - "email": "blaine@iceddev.com" + "email": "blaine@iceddev.com", + "name": "phated" } ], - "dist": { - "shasum": "9f18b1f3749a95e197b5ff2ae752ea9851ada965", - "tarball": "http://registry.npmjs.org/lodash.pad/-/lodash.pad-3.1.0.tgz" + "name": "lodash.pad", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-3.1.0.tgz", - "readme": "ERROR: No README data found!" + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.1.0" } diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/LICENSE b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/LICENSE new file mode 100644 index 00000000000000..bcbe13d67a9621 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/README.md new file mode 100644 index 00000000000000..ac84987849bf1a --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/README.md @@ -0,0 +1,18 @@ +# lodash.padend v4.2.0 + +The [lodash](https://lodash.com/) method `_.padEnd` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.padend +``` + +In Node.js: +```js +var padEnd = require('lodash.padend'); +``` + +See the [documentation](https://lodash.com/docs#padEnd) or [package source](https://github.com/lodash/lodash/blob/4.2.0-npm-packages/lodash.padend) for more details. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/index.js new file mode 100644 index 00000000000000..d7c813a1dbd015 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/index.js @@ -0,0 +1,285 @@ +/** + * lodash 4.2.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var repeat = require('lodash.repeat'), + toString = require('lodash.tostring'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + +/** `Object#toString` result references. */ +var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsComboSymbolsRange = '\\u20d0-\\u20f0', + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange + ']', + rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ +var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ +function stringSize(string) { + if (!(string && reHasComplexSymbol.test(string))) { + return string.length; + } + var result = reComplexSymbol.lastIndex = 0; + while (reComplexSymbol.test(string)) { + result++; + } + return result; +} + +/** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function stringToArray(string) { + return string.match(reComplexSymbol); +} + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeCeil = Math.ceil; + +/** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {string} string The string to create padding for. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ +function createPadding(string, length, chars) { + length = toInteger(length); + + var strLength = stringSize(string); + if (!length || strLength >= length) { + return ''; + } + var padLength = length - strLength; + chars = chars === undefined ? ' ' : (chars + ''); + + var result = repeat(chars, nativeCeil(padLength / stringSize(chars))); + return reHasComplexSymbol.test(chars) + ? stringToArray(result).slice(0, padLength).join('') + : result.slice(0, padLength); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array constructors, and + // PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Converts `value` to an integer. + * + * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3'); + * // => 3 + */ +function toInteger(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + var remainder = value % 1; + return value === value ? (remainder ? value - remainder : value) : 0; +} + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3); + * // => 3 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3'); + * // => 3 + */ +function toNumber(value) { + if (isObject(value)) { + var other = isFunction(value.valueOf) ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +/** + * Pads `string` on the right side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padEnd('abc', 6); + * // => 'abc ' + * + * _.padEnd('abc', 6, '_-'); + * // => 'abc_-_' + * + * _.padEnd('abc', 3); + * // => 'abc' + */ +function padEnd(string, length, chars) { + string = toString(string); + return string + createPadding(string, length, chars); +} + +module.exports = padEnd; diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.repeat/LICENSE b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.repeat/LICENSE new file mode 100644 index 00000000000000..bcbe13d67a9621 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.repeat/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.repeat/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.repeat/README.md new file mode 100644 index 00000000000000..33b447cd53e779 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.repeat/README.md @@ -0,0 +1,18 @@ +# lodash.repeat v4.0.0 + +The [lodash](https://lodash.com/) method `_.repeat` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.repeat +``` + +In Node.js: +```js +var repeat = require('lodash.repeat'); +``` + +See the [documentation](https://lodash.com/docs#repeat) or [package source](https://github.com/lodash/lodash/blob/4.0.0-npm-packages/lodash.repeat) for more details. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.repeat/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.repeat/index.js new file mode 100644 index 00000000000000..7a54e85714c367 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.repeat/index.js @@ -0,0 +1,215 @@ +/** + * lodash 4.0.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var toString = require('lodash.tostring'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + +/** `Object#toString` result references. */ +var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeFloor = Math.floor; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array constructors, and + // PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Converts `value` to an integer. + * + * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3'); + * // => 3 + */ +function toInteger(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + var remainder = value % 1; + return value === value ? (remainder ? value - remainder : value) : 0; +} + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3); + * // => 3 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3'); + * // => 3 + */ +function toNumber(value) { + if (isObject(value)) { + var other = isFunction(value.valueOf) ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +/** + * Repeats the given string `n` times. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to repeat. + * @param {number} [n=0] The number of times to repeat the string. + * @returns {string} Returns the repeated string. + * @example + * + * _.repeat('*', 3); + * // => '***' + * + * _.repeat('abc', 2); + * // => 'abcabc' + * + * _.repeat('abc', 0); + * // => '' + */ +function repeat(string, n) { + string = toString(string); + n = toInteger(n); + + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + string += string; + } while (n); + + return result; +} + +module.exports = repeat; diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.repeat/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.repeat/package.json new file mode 100644 index 00000000000000..e98ee4125c0d0c --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.repeat/package.json @@ -0,0 +1,109 @@ +{ + "_args": [ + [ + "lodash.repeat@^4.0.0", + "/Users/rebecca/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad" + ], + [ + "lodash.repeat@^4.0.0", + "/Users/rebecca/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend" + ] + ], + "_from": "lodash.repeat@>=4.0.0 <5.0.0", + "_id": "lodash.repeat@4.0.0", + "_inCache": true, + "_installable": true, + "_location": "/npmlog/gauge/lodash.padend/lodash.repeat", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-9-west.internal.npmjs.com", + "tmp": "tmp/lodash.repeat-4.0.0.tgz_1455602646227_0.7481637196615338" + }, + "_npmUser": { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + "_npmVersion": "2.14.18", + "_phantomChildren": {}, + "_requested": { + "name": "lodash.repeat", + "raw": "lodash.repeat@^4.0.0", + "rawSpec": "^4.0.0", + "scope": null, + "spec": ">=4.0.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npmlog/gauge/lodash.padend" + ], + "_shrinkwrap": null, + "_spec": "lodash.repeat@^4.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend", + "author": { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "contributors": [ + { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + { + "email": "blaine@iceddev.com", + "name": "Blaine Bublitz", + "url": "https://github.com/phated" + }, + { + "email": "mathias@qiwi.be", + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": { + "lodash.tostring": "^4.0.0" + }, + "description": "The lodash method `_.repeat` exported as a module.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "aaf570b2ab0bfb0dda6d6e93291d54b30b1f7d22", + "tarball": "http://registry.npmjs.org/lodash.repeat/-/lodash.repeat-4.0.0.tgz" + }, + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash-modularized", + "repeat" + ], + "license": "MIT", + "maintainers": [ + { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + { + "email": "mathias@qiwi.be", + "name": "mathias" + }, + { + "email": "blaine@iceddev.com", + "name": "phated" + } + ], + "name": "lodash.repeat", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.0.0" +} diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/LICENSE b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/LICENSE new file mode 100644 index 00000000000000..bcbe13d67a9621 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/README.md new file mode 100644 index 00000000000000..b3858fd68e7866 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/README.md @@ -0,0 +1,18 @@ +# lodash.tostring v4.1.2 + +The [lodash](https://lodash.com/) method `_.toString` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.tostring +``` + +In Node.js: +```js +var toString = require('lodash.tostring'); +``` + +See the [documentation](https://lodash.com/docs#toString) or [package source](https://github.com/lodash/lodash/blob/4.1.2-npm-packages/lodash.tostring) for more details. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/index.js new file mode 100644 index 00000000000000..5c0e3e2b987eb6 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/index.js @@ -0,0 +1,164 @@ +/** + * lodash 4.1.2 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Used to determine if values are of the language type `Object`. */ +var objectTypes = { + 'function': true, + 'object': true +}; + +/** Detect free variable `exports`. */ +var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) + ? exports + : undefined; + +/** Detect free variable `module`. */ +var freeModule = (objectTypes[typeof module] && module && !module.nodeType) + ? module + : undefined; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); + +/** Detect free variable `self`. */ +var freeSelf = checkGlobal(objectTypes[typeof self] && self); + +/** Detect free variable `window`. */ +var freeWindow = checkGlobal(objectTypes[typeof window] && window); + +/** Detect `this` as the global object. */ +var thisGlobal = checkGlobal(objectTypes[typeof this] && this); + +/** + * Used as a reference to the global object. + * + * The `this` value is used if it's the global object to avoid Greasemonkey's + * restricted `window` object, otherwise the `window` object is used. + */ +var root = freeGlobal || + ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || + freeSelf || thisGlobal || Function('return this')(); + +/** + * Checks if `value` is a global object. + * + * @private + * @param {*} value The value to check. + * @returns {null|Object} Returns `value` if it's a global object, else `null`. + */ +function checkGlobal(value) { + return (value && value.Object === Object) ? value : null; +} + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Built-in value references. */ +var Symbol = root.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (value == null) { + return ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +module.exports = toString; diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/package.json new file mode 100644 index 00000000000000..61501df10307e9 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/package.json @@ -0,0 +1,108 @@ +{ + "_args": [ + [ + "lodash.tostring@^4.0.0", + "/Users/rebecca/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad" + ], + [ + "lodash.tostring@^4.0.0", + "/Users/rebecca/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend" + ] + ], + "_from": "lodash.tostring@>=4.0.0 <5.0.0", + "_id": "lodash.tostring@4.1.2", + "_inCache": true, + "_installable": true, + "_location": "/npmlog/gauge/lodash.padend/lodash.tostring", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-13-west.internal.npmjs.com", + "tmp": "tmp/lodash.tostring-4.1.2.tgz_1456896853027_0.8195764778647572" + }, + "_npmUser": { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + "_npmVersion": "2.14.17", + "_phantomChildren": {}, + "_requested": { + "name": "lodash.tostring", + "raw": "lodash.tostring@^4.0.0", + "rawSpec": "^4.0.0", + "scope": null, + "spec": ">=4.0.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npmlog/gauge/lodash.padend", + "/npmlog/gauge/lodash.padend/lodash.repeat" + ], + "_shrinkwrap": null, + "_spec": "lodash.tostring@^4.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend", + "author": { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "contributors": [ + { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + { + "email": "blaine.bublitz@gmail.com", + "name": "Blaine Bublitz", + "url": "https://github.com/phated" + }, + { + "email": "mathias@qiwi.be", + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": {}, + "description": "The lodash method `_.toString` exported as a module.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "7d326a5cf64da4298f2fd35b688d848267535288", + "tarball": "http://registry.npmjs.org/lodash.tostring/-/lodash.tostring-4.1.2.tgz" + }, + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash-modularized", + "tostring" + ], + "license": "MIT", + "maintainers": [ + { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + { + "email": "mathias@qiwi.be", + "name": "mathias" + }, + { + "email": "blaine.bublitz@gmail.com", + "name": "phated" + } + ], + "name": "lodash.tostring", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.1.2" +} diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/package.json new file mode 100644 index 00000000000000..fa826877c5a5e4 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/package.json @@ -0,0 +1,108 @@ +{ + "_args": [ + [ + "lodash.padend@^4.1.0", + "/Users/rebecca/code/npm/node_modules/npmlog/node_modules/gauge" + ] + ], + "_from": "lodash.padend@>=4.1.0 <5.0.0", + "_id": "lodash.padend@4.2.0", + "_inCache": true, + "_installable": true, + "_location": "/npmlog/gauge/lodash.padend", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-6-west.internal.npmjs.com", + "tmp": "tmp/lodash.padend-4.2.0.tgz_1455615519416_0.9670630963519216" + }, + "_npmUser": { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + "_npmVersion": "2.14.18", + "_phantomChildren": {}, + "_requested": { + "name": "lodash.padend", + "raw": "lodash.padend@^4.1.0", + "rawSpec": "^4.1.0", + "scope": null, + "spec": ">=4.1.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npmlog/gauge" + ], + "_resolved": "https://registry.npmjs.org/lodash.padend/-/lodash.padend-4.2.0.tgz", + "_shasum": "b84e8c3401d4538055c6e321a51e3aee19881a18", + "_shrinkwrap": null, + "_spec": "lodash.padend@^4.1.0", + "_where": "/Users/rebecca/code/npm/node_modules/npmlog/node_modules/gauge", + "author": { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "contributors": [ + { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + { + "email": "blaine@iceddev.com", + "name": "Blaine Bublitz", + "url": "https://github.com/phated" + }, + { + "email": "mathias@qiwi.be", + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": { + "lodash.repeat": "^4.0.0", + "lodash.tostring": "^4.0.0" + }, + "description": "The lodash method `_.padEnd` exported as a module.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "b84e8c3401d4538055c6e321a51e3aee19881a18", + "tarball": "http://registry.npmjs.org/lodash.padend/-/lodash.padend-4.2.0.tgz" + }, + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash-modularized", + "padend" + ], + "license": "MIT", + "maintainers": [ + { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + { + "email": "mathias@qiwi.be", + "name": "mathias" + }, + { + "email": "blaine.bublitz@gmail.com", + "name": "phated" + } + ], + "name": "lodash.padend", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.2.0" +} diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/README.md deleted file mode 100644 index 641b4d6f007ad4..00000000000000 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash.padleft v3.1.1 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.padLeft` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.padleft -``` - -In Node.js/io.js: - -```js -var padLeft = require('lodash.padleft'); -``` - -See the [documentation](https://lodash.com/docs#padLeft) or [package source](https://github.com/lodash/lodash/blob/3.1.1-npm-packages/lodash.padleft) for more details. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/index.js deleted file mode 100644 index 2abb69a6c06558..00000000000000 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/index.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - * lodash 3.1.1 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -var baseToString = require('lodash._basetostring'), - createPadding = require('lodash._createpadding'); - -/** - * Creates a function for `_.padLeft` or `_.padRight`. - * - * @private - * @param {boolean} [fromRight] Specify padding from the right. - * @returns {Function} Returns the new pad function. - */ -function createPadDir(fromRight) { - return function(string, length, chars) { - string = baseToString(string); - return (fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string); - }; -} - -/** - * Pads `string` on the left side if it is shorter than `length`. Padding - * characters are truncated if they exceed `length`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padLeft('abc', 6); - * // => ' abc' - * - * _.padLeft('abc', 6, '_-'); - * // => '_-_abc' - * - * _.padLeft('abc', 3); - * // => 'abc' - */ -var padLeft = createPadDir(); - -module.exports = padLeft; diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/package.json deleted file mode 100644 index 55b0c256f9d1bc..00000000000000 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/package.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "name": "lodash.padleft", - "version": "3.1.1", - "description": "The modern build of lodash’s `_.padLeft` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": [ - "lodash", - "lodash-modularized", - "stdlib", - "util" - ], - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "dependencies": { - "lodash._basetostring": "^3.0.0", - "lodash._createpadding": "^3.0.0" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash.padleft@3.1.1", - "_shasum": "150151f1e0245edba15d50af2d71f1d5cff46530", - "_from": "lodash.padleft@>=3.0.0 <4.0.0", - "_npmVersion": "2.9.0", - "_nodeVersion": "0.12.2", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - } - ], - "dist": { - "shasum": "150151f1e0245edba15d50af2d71f1d5cff46530", - "tarball": "http://registry.npmjs.org/lodash.padleft/-/lodash.padleft-3.1.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.padleft/-/lodash.padleft-3.1.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/README.md deleted file mode 100644 index bcd6e5742fe126..00000000000000 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# lodash.padright v3.1.1 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.padRight` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.padright -``` - -In Node.js/io.js: - -```js -var padRight = require('lodash.padright'); -``` - -See the [documentation](https://lodash.com/docs#padRight) or [package source](https://github.com/lodash/lodash/blob/3.1.1-npm-packages/lodash.padright) for more details. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/index.js deleted file mode 100644 index 6de81c4bbedc1c..00000000000000 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/index.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - * lodash 3.1.1 (Custom Build) - * Build: `lodash modern modularize exports="npm" -o ./` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -var baseToString = require('lodash._basetostring'), - createPadding = require('lodash._createpadding'); - -/** - * Creates a function for `_.padLeft` or `_.padRight`. - * - * @private - * @param {boolean} [fromRight] Specify padding from the right. - * @returns {Function} Returns the new pad function. - */ -function createPadDir(fromRight) { - return function(string, length, chars) { - string = baseToString(string); - return (fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string); - }; -} - -/** - * Pads `string` on the right side if it is shorter than `length`. Padding - * characters are truncated if they exceed `length`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padRight('abc', 6); - * // => 'abc ' - * - * _.padRight('abc', 6, '_-'); - * // => 'abc_-_' - * - * _.padRight('abc', 3); - * // => 'abc' - */ -var padRight = createPadDir(true); - -module.exports = padRight; diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/package.json deleted file mode 100644 index 2a40f94bfc3bfd..00000000000000 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/package.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "name": "lodash.padright", - "version": "3.1.1", - "description": "The modern build of lodash’s `_.padRight` as a module.", - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "keywords": [ - "lodash", - "lodash-modularized", - "stdlib", - "util" - ], - "author": { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - "contributors": [ - { - "name": "John-David Dalton", - "email": "john.david.dalton@gmail.com", - "url": "http://allyoucanleet.com/" - }, - { - "name": "Benjamin Tan", - "email": "demoneaux@gmail.com", - "url": "https://d10.github.io/" - }, - { - "name": "Blaine Bublitz", - "email": "blaine@iceddev.com", - "url": "http://www.iceddev.com/" - }, - { - "name": "Kit Cambridge", - "email": "github@kitcambridge.be", - "url": "http://kitcambridge.be/" - }, - { - "name": "Mathias Bynens", - "email": "mathias@qiwi.be", - "url": "https://mathiasbynens.be/" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "dependencies": { - "lodash._basetostring": "^3.0.0", - "lodash._createpadding": "^3.0.0" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "_id": "lodash.padright@3.1.1", - "_shasum": "79f7770baaa39738c040aeb5465e8d88f2aacec0", - "_from": "lodash.padright@>=3.0.0 <4.0.0", - "_npmVersion": "2.9.0", - "_nodeVersion": "0.12.2", - "_npmUser": { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - "maintainers": [ - { - "name": "jdalton", - "email": "john.david.dalton@gmail.com" - }, - { - "name": "d10", - "email": "demoneaux@gmail.com" - }, - { - "name": "kitcambridge", - "email": "github@kitcambridge.be" - }, - { - "name": "mathias", - "email": "mathias@qiwi.be" - }, - { - "name": "phated", - "email": "blaine@iceddev.com" - } - ], - "dist": { - "shasum": "79f7770baaa39738c040aeb5465e8d88f2aacec0", - "tarball": "http://registry.npmjs.org/lodash.padright/-/lodash.padright-3.1.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.padright/-/lodash.padright-3.1.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/LICENSE b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/LICENSE new file mode 100644 index 00000000000000..bcbe13d67a9621 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/README.md new file mode 100644 index 00000000000000..d3176b0012afb9 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/README.md @@ -0,0 +1,18 @@ +# lodash.padstart v4.2.0 + +The [lodash](https://lodash.com/) method `_.padStart` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.padstart +``` + +In Node.js: +```js +var padStart = require('lodash.padstart'); +``` + +See the [documentation](https://lodash.com/docs#padStart) or [package source](https://github.com/lodash/lodash/blob/4.2.0-npm-packages/lodash.padstart) for more details. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/index.js new file mode 100644 index 00000000000000..9f403a1f857fae --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/index.js @@ -0,0 +1,285 @@ +/** + * lodash 4.2.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var repeat = require('lodash.repeat'), + toString = require('lodash.tostring'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + +/** `Object#toString` result references. */ +var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsComboSymbolsRange = '\\u20d0-\\u20f0', + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange + ']', + rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ +var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ +function stringSize(string) { + if (!(string && reHasComplexSymbol.test(string))) { + return string.length; + } + var result = reComplexSymbol.lastIndex = 0; + while (reComplexSymbol.test(string)) { + result++; + } + return result; +} + +/** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function stringToArray(string) { + return string.match(reComplexSymbol); +} + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeCeil = Math.ceil; + +/** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {string} string The string to create padding for. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ +function createPadding(string, length, chars) { + length = toInteger(length); + + var strLength = stringSize(string); + if (!length || strLength >= length) { + return ''; + } + var padLength = length - strLength; + chars = chars === undefined ? ' ' : (chars + ''); + + var result = repeat(chars, nativeCeil(padLength / stringSize(chars))); + return reHasComplexSymbol.test(chars) + ? stringToArray(result).slice(0, padLength).join('') + : result.slice(0, padLength); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array constructors, and + // PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Converts `value` to an integer. + * + * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3'); + * // => 3 + */ +function toInteger(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + var remainder = value % 1; + return value === value ? (remainder ? value - remainder : value) : 0; +} + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3); + * // => 3 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3'); + * // => 3 + */ +function toNumber(value) { + if (isObject(value)) { + var other = isFunction(value.valueOf) ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +/** + * Pads `string` on the left side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padStart('abc', 6); + * // => ' abc' + * + * _.padStart('abc', 6, '_-'); + * // => '_-_abc' + * + * _.padStart('abc', 3); + * // => 'abc' + */ +function padStart(string, length, chars) { + string = toString(string); + return createPadding(string, length, chars) + string; +} + +module.exports = padStart; diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.repeat/LICENSE b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.repeat/LICENSE new file mode 100644 index 00000000000000..bcbe13d67a9621 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.repeat/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.repeat/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.repeat/README.md new file mode 100644 index 00000000000000..33b447cd53e779 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.repeat/README.md @@ -0,0 +1,18 @@ +# lodash.repeat v4.0.0 + +The [lodash](https://lodash.com/) method `_.repeat` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.repeat +``` + +In Node.js: +```js +var repeat = require('lodash.repeat'); +``` + +See the [documentation](https://lodash.com/docs#repeat) or [package source](https://github.com/lodash/lodash/blob/4.0.0-npm-packages/lodash.repeat) for more details. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.repeat/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.repeat/index.js new file mode 100644 index 00000000000000..7a54e85714c367 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.repeat/index.js @@ -0,0 +1,215 @@ +/** + * lodash 4.0.0 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var toString = require('lodash.tostring'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + +/** `Object#toString` result references. */ +var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; + +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + +/** Used to detect bad signed hexadecimal string values. */ +var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + +/** Used to detect binary string values. */ +var reIsBinary = /^0b[01]+$/i; + +/** Used to detect octal string values. */ +var reIsOctal = /^0o[0-7]+$/i; + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeFloor = Math.floor; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array constructors, and + // PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Converts `value` to an integer. + * + * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3'); + * // => 3 + */ +function toInteger(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + var remainder = value % 1; + return value === value ? (remainder ? value - remainder : value) : 0; +} + +/** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3); + * // => 3 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3'); + * // => 3 + */ +function toNumber(value) { + if (isObject(value)) { + var other = isFunction(value.valueOf) ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); +} + +/** + * Repeats the given string `n` times. + * + * @static + * @memberOf _ + * @category String + * @param {string} [string=''] The string to repeat. + * @param {number} [n=0] The number of times to repeat the string. + * @returns {string} Returns the repeated string. + * @example + * + * _.repeat('*', 3); + * // => '***' + * + * _.repeat('abc', 2); + * // => 'abcabc' + * + * _.repeat('abc', 0); + * // => '' + */ +function repeat(string, n) { + string = toString(string); + n = toInteger(n); + + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + string += string; + } while (n); + + return result; +} + +module.exports = repeat; diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.repeat/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.repeat/package.json new file mode 100644 index 00000000000000..8bb2966c4a3149 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.repeat/package.json @@ -0,0 +1,109 @@ +{ + "_args": [ + [ + "lodash.repeat@^4.0.0", + "/Users/rebecca/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad" + ], + [ + "lodash.repeat@^4.0.0", + "/Users/rebecca/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart" + ] + ], + "_from": "lodash.repeat@>=4.0.0 <5.0.0", + "_id": "lodash.repeat@4.0.0", + "_inCache": true, + "_installable": true, + "_location": "/npmlog/gauge/lodash.padstart/lodash.repeat", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-9-west.internal.npmjs.com", + "tmp": "tmp/lodash.repeat-4.0.0.tgz_1455602646227_0.7481637196615338" + }, + "_npmUser": { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + "_npmVersion": "2.14.18", + "_phantomChildren": {}, + "_requested": { + "name": "lodash.repeat", + "raw": "lodash.repeat@^4.0.0", + "rawSpec": "^4.0.0", + "scope": null, + "spec": ">=4.0.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npmlog/gauge/lodash.padstart" + ], + "_shrinkwrap": null, + "_spec": "lodash.repeat@^4.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart", + "author": { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "contributors": [ + { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + { + "email": "blaine@iceddev.com", + "name": "Blaine Bublitz", + "url": "https://github.com/phated" + }, + { + "email": "mathias@qiwi.be", + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": { + "lodash.tostring": "^4.0.0" + }, + "description": "The lodash method `_.repeat` exported as a module.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "aaf570b2ab0bfb0dda6d6e93291d54b30b1f7d22", + "tarball": "http://registry.npmjs.org/lodash.repeat/-/lodash.repeat-4.0.0.tgz" + }, + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash-modularized", + "repeat" + ], + "license": "MIT", + "maintainers": [ + { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + { + "email": "mathias@qiwi.be", + "name": "mathias" + }, + { + "email": "blaine@iceddev.com", + "name": "phated" + } + ], + "name": "lodash.repeat", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.0.0" +} diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/LICENSE b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/LICENSE new file mode 100644 index 00000000000000..bcbe13d67a9621 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright 2012-2016 The Dojo Foundation +Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/README.md new file mode 100644 index 00000000000000..b3858fd68e7866 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/README.md @@ -0,0 +1,18 @@ +# lodash.tostring v4.1.2 + +The [lodash](https://lodash.com/) method `_.toString` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.tostring +``` + +In Node.js: +```js +var toString = require('lodash.tostring'); +``` + +See the [documentation](https://lodash.com/docs#toString) or [package source](https://github.com/lodash/lodash/blob/4.1.2-npm-packages/lodash.tostring) for more details. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/index.js new file mode 100644 index 00000000000000..5c0e3e2b987eb6 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/index.js @@ -0,0 +1,164 @@ +/** + * lodash 4.1.2 (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright 2012-2016 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Used to determine if values are of the language type `Object`. */ +var objectTypes = { + 'function': true, + 'object': true +}; + +/** Detect free variable `exports`. */ +var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) + ? exports + : undefined; + +/** Detect free variable `module`. */ +var freeModule = (objectTypes[typeof module] && module && !module.nodeType) + ? module + : undefined; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); + +/** Detect free variable `self`. */ +var freeSelf = checkGlobal(objectTypes[typeof self] && self); + +/** Detect free variable `window`. */ +var freeWindow = checkGlobal(objectTypes[typeof window] && window); + +/** Detect `this` as the global object. */ +var thisGlobal = checkGlobal(objectTypes[typeof this] && this); + +/** + * Used as a reference to the global object. + * + * The `this` value is used if it's the global object to avoid Greasemonkey's + * restricted `window` object, otherwise the `window` object is used. + */ +var root = freeGlobal || + ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || + freeSelf || thisGlobal || Function('return this')(); + +/** + * Checks if `value` is a global object. + * + * @private + * @param {*} value The value to check. + * @returns {null|Object} Returns `value` if it's a global object, else `null`. + */ +function checkGlobal(value) { + return (value && value.Object === Object) ? value : null; +} + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Built-in value references. */ +var Symbol = root.Symbol; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +/** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ +function toString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (value == null) { + return ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +module.exports = toString; diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/package.json new file mode 100644 index 00000000000000..a50df30e2cbe25 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/package.json @@ -0,0 +1,108 @@ +{ + "_args": [ + [ + "lodash.tostring@^4.0.0", + "/Users/rebecca/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad" + ], + [ + "lodash.tostring@^4.0.0", + "/Users/rebecca/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart" + ] + ], + "_from": "lodash.tostring@>=4.0.0 <5.0.0", + "_id": "lodash.tostring@4.1.2", + "_inCache": true, + "_installable": true, + "_location": "/npmlog/gauge/lodash.padstart/lodash.tostring", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-13-west.internal.npmjs.com", + "tmp": "tmp/lodash.tostring-4.1.2.tgz_1456896853027_0.8195764778647572" + }, + "_npmUser": { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + "_npmVersion": "2.14.17", + "_phantomChildren": {}, + "_requested": { + "name": "lodash.tostring", + "raw": "lodash.tostring@^4.0.0", + "rawSpec": "^4.0.0", + "scope": null, + "spec": ">=4.0.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npmlog/gauge/lodash.padstart", + "/npmlog/gauge/lodash.padstart/lodash.repeat" + ], + "_shrinkwrap": null, + "_spec": "lodash.tostring@^4.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart", + "author": { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "contributors": [ + { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + { + "email": "blaine.bublitz@gmail.com", + "name": "Blaine Bublitz", + "url": "https://github.com/phated" + }, + { + "email": "mathias@qiwi.be", + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": {}, + "description": "The lodash method `_.toString` exported as a module.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "7d326a5cf64da4298f2fd35b688d848267535288", + "tarball": "http://registry.npmjs.org/lodash.tostring/-/lodash.tostring-4.1.2.tgz" + }, + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash-modularized", + "tostring" + ], + "license": "MIT", + "maintainers": [ + { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + { + "email": "mathias@qiwi.be", + "name": "mathias" + }, + { + "email": "blaine.bublitz@gmail.com", + "name": "phated" + } + ], + "name": "lodash.tostring", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.1.2" +} diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/package.json new file mode 100644 index 00000000000000..0a4deb7c03e0a6 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/package.json @@ -0,0 +1,108 @@ +{ + "_args": [ + [ + "lodash.padstart@^4.1.0", + "/Users/rebecca/code/npm/node_modules/npmlog/node_modules/gauge" + ] + ], + "_from": "lodash.padstart@>=4.1.0 <5.0.0", + "_id": "lodash.padstart@4.2.0", + "_inCache": true, + "_installable": true, + "_location": "/npmlog/gauge/lodash.padstart", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-6-west.internal.npmjs.com", + "tmp": "tmp/lodash.padstart-4.2.0.tgz_1455615522339_0.6710881665349007" + }, + "_npmUser": { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + "_npmVersion": "2.14.18", + "_phantomChildren": {}, + "_requested": { + "name": "lodash.padstart", + "raw": "lodash.padstart@^4.1.0", + "rawSpec": "^4.1.0", + "scope": null, + "spec": ">=4.1.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npmlog/gauge" + ], + "_resolved": "https://registry.npmjs.org/lodash.padstart/-/lodash.padstart-4.2.0.tgz", + "_shasum": "e36f89fd6c3b5072219087695b765de83ec96985", + "_shrinkwrap": null, + "_spec": "lodash.padstart@^4.1.0", + "_where": "/Users/rebecca/code/npm/node_modules/npmlog/node_modules/gauge", + "author": { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "contributors": [ + { + "email": "john.david.dalton@gmail.com", + "name": "John-David Dalton", + "url": "http://allyoucanleet.com/" + }, + { + "email": "blaine@iceddev.com", + "name": "Blaine Bublitz", + "url": "https://github.com/phated" + }, + { + "email": "mathias@qiwi.be", + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + } + ], + "dependencies": { + "lodash.repeat": "^4.0.0", + "lodash.tostring": "^4.0.0" + }, + "description": "The lodash method `_.padStart` exported as a module.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "e36f89fd6c3b5072219087695b765de83ec96985", + "tarball": "http://registry.npmjs.org/lodash.padstart/-/lodash.padstart-4.2.0.tgz" + }, + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "keywords": [ + "lodash-modularized", + "padstart" + ], + "license": "MIT", + "maintainers": [ + { + "email": "john.david.dalton@gmail.com", + "name": "jdalton" + }, + { + "email": "mathias@qiwi.be", + "name": "mathias" + }, + { + "email": "blaine.bublitz@gmail.com", + "name": "phated" + } + ], + "name": "lodash.padstart", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "version": "4.2.0" +} diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/package.json index 227173e6401edd..efbb346bb4f587 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/package.json +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/package.json @@ -1,60 +1,88 @@ { - "name": "gauge", - "version": "1.2.0", - "description": "A terminal based horizontal guage", - "main": "progress-bar.js", - "scripts": { - "test": "tap test/*.js" + "_args": [ + [ + "gauge@~1.2.5", + "/Users/rebecca/code/npm/node_modules/npmlog" + ] + ], + "_from": "gauge@>=1.2.5 <1.3.0", + "_id": "gauge@1.2.7", + "_inCache": true, + "_installable": true, + "_location": "/npmlog/gauge", + "_nodeVersion": "4.2.2", + "_npmOperationalInternal": { + "host": "packages-9-west.internal.npmjs.com", + "tmp": "tmp/gauge-1.2.7.tgz_1455835409513_0.6293477965518832" }, - "repository": { - "type": "git", - "url": "git+https://github.com/iarna/gauge.git" + "_npmUser": { + "email": "me@re-becca.org", + "name": "iarna" }, - "keywords": [ - "progressbar", - "progress", - "gauge" + "_npmVersion": "3.7.2", + "_phantomChildren": {}, + "_requested": { + "name": "gauge", + "raw": "gauge@~1.2.5", + "rawSpec": "~1.2.5", + "scope": null, + "spec": ">=1.2.5 <1.3.0", + "type": "range" + }, + "_requiredBy": [ + "/npmlog" ], + "_shasum": "e9cec5483d3d4ee0ef44b60a7d99e4935e136d93", + "_shrinkwrap": null, + "_spec": "gauge@~1.2.5", + "_where": "/Users/rebecca/code/npm/node_modules/npmlog", "author": { - "name": "Rebecca Turner", - "email": "me@re-becca.org" + "email": "me@re-becca.org", + "name": "Rebecca Turner" }, - "license": "ISC", "bugs": { "url": "https://github.com/iarna/gauge/issues" }, - "homepage": "https://github.com/iarna/gauge", "dependencies": { "ansi": "^0.3.0", - "has-unicode": "^1.0.0", - "lodash.pad": "^3.0.0", - "lodash.padleft": "^3.0.0", - "lodash.padright": "^3.0.0" + "has-unicode": "^2.0.0", + "lodash.pad": "^4.1.0", + "lodash.padend": "^4.1.0", + "lodash.padstart": "^4.1.0" }, + "description": "A terminal based horizontal guage", "devDependencies": { - "tap": "^0.4.13" - }, - "gitHead": "db15c35374816b3fc3b9e1e54866f31ed7f4a733", - "_id": "gauge@1.2.0", - "_shasum": "3094ab1285633f799814388fc8f2de67b4c012c5", - "_from": "gauge@>=1.2.0 <1.3.0", - "_npmVersion": "2.6.0", - "_nodeVersion": "1.1.0", - "_npmUser": { - "name": "iarna", - "email": "me@re-becca.org" + "tap": "^5.6.0" }, + "directories": {}, + "dist": { + "shasum": "e9cec5483d3d4ee0ef44b60a7d99e4935e136d93", + "tarball": "http://registry.npmjs.org/gauge/-/gauge-1.2.7.tgz" + }, + "gitHead": "75a7d0a4ed67489ac992ed3d211bed60376ca7c1", + "homepage": "https://github.com/iarna/gauge", + "keywords": [ + "progressbar", + "progress", + "gauge" + ], + "license": "ISC", + "main": "progress-bar.js", "maintainers": [ { - "name": "iarna", - "email": "me@re-becca.org" + "email": "me@re-becca.org", + "name": "iarna" } ], - "dist": { - "shasum": "3094ab1285633f799814388fc8f2de67b4c012c5", - "tarball": "http://registry.npmjs.org/gauge/-/gauge-1.2.0.tgz" + "name": "gauge", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/gauge.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/gauge/-/gauge-1.2.0.tgz", - "readme": "ERROR: No README data found!" + "scripts": { + "test": "tap test/*.js" + }, + "version": "1.2.7" } diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/progress-bar.js b/deps/npm/node_modules/npmlog/node_modules/gauge/progress-bar.js index 39dbf2ac43dd9a..ddfc4a44be4ded 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/progress-bar.js +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/progress-bar.js @@ -3,16 +3,18 @@ var hasUnicode = require("has-unicode") var ansi = require("ansi") var align = { center: require("lodash.pad"), - left: require("lodash.padright"), - right: require("lodash.padleft") + left: require("lodash.padend"), + right: require("lodash.padstart") } var defaultStream = process.stderr function isTTY() { return process.stderr.isTTY } function getWritableTTYColumns() { - // One less than the actual as writing to the final column wraps the line - return process.stderr.columns - 1 + // Writing to the final column wraps the line + // We have to use stdout here, because Node's magic SIGWINCH handler only + // updates process.stdout, not process.stderr + return process.stdout.columns - 1 } var ProgressBar = module.exports = function (options, cursor) { @@ -34,11 +36,18 @@ var ProgressBar = module.exports = function (options, cursor) { {type: "completionbar"}, {type: "endgroup"} ] - this.updatefreq = options.maxUpdateFrequency || 50 + this.updatefreq = options.maxUpdateFrequency == null ? 50 : options.maxUpdateFrequency this.lastName = "" this.lastCompleted = 0 this.spun = 0 this.last = new Date(0) + + var self = this + this._handleSizeChange = function () { + if (!self.showing) return + self.hide() + self.show() + } } ProgressBar.prototype = {} @@ -68,6 +77,14 @@ ProgressBar.prototype.setTemplate = function(template) { this.template = template } +ProgressBar.prototype._enableResizeEvents = function() { + process.stdout.on('resize', this._handleSizeChange) +} + +ProgressBar.prototype._disableResizeEvents = function() { + process.stdout.removeListener('resize', this._handleSizeChange) +} + ProgressBar.prototype.disable = function() { this.hide() this.disabled = true @@ -115,13 +132,12 @@ ProgressBar.prototype.show = function(name, completed) { if (!isTTY()) return if (this.disabled) return if (! this.spun && ! completed) return - if (this.tryAgain) { - clearTimeout(this.tryAgain) - this.tryAgain = null - } + if (this.tryAgain) return var self = this + if (this.showing && new Date() - this.last < this.updatefreq) { this.tryAgain = setTimeout(function () { + self.tryAgain = null if (self.disabled) return if (! self.spun && ! completed) return drawBar() diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/test/progress-bar.js b/deps/npm/node_modules/npmlog/node_modules/gauge/test/progress-bar.js index 8e2a5ad6438fdd..5d3e7e78fe000e 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/test/progress-bar.js +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/test/progress-bar.js @@ -4,7 +4,7 @@ var ProgressBar = require("../progress-bar.js") var cursor = [] var C -var bar = new ProgressBar({theme: ProgressBar.ascii}, C = { +var bar = new ProgressBar({theme: ProgressBar.ascii, maxUpdateFrequency: 0}, C = { show: function () { cursor.push(["show"]) return C @@ -70,7 +70,7 @@ test("hide", function (t) { test("renderTemplate", function (t) { t.plan(16) - process.stderr.columns = 11 + process.stdout.columns = 11 var result = bar.renderTemplate(ProgressBar.ascii,[{type: "name"}],{name: "NAME"}) t.is(result, "NAME", "name substitution") var result = bar.renderTemplate(ProgressBar.ascii,[{type: "completionbar"}],{completed: 0}) @@ -108,7 +108,7 @@ test("renderTemplate", function (t) { test("show & pulse", function (t) { t.plan(23) - process.stderr.columns = 16 + process.stdout.columns = 16 cursor = [] process.stderr.isTTY = false bar.template[0].length = 6 @@ -146,3 +146,31 @@ test("show & pulse", function (t) { [ 'write', 'S -> P | |----|\n' ], [ 'show' ] ]) }) + +test("window resizing", function (t) { + t.plan(16) + process.stderr.isTTY = true + process.stdout.columns = 32 + bar.show("NAME", 0.1) + cursor = [] + bar.last = new Date(0) + bar.pulse() + isOutput(t, "32 columns", + [ [ 'up', 1 ], + [ 'hide' ], + [ 'horizontalAbsolute', 0 ], + [ 'write', 'NAME / |##------------------|\n' ], + [ 'show' ] ]) + + process.stdout.columns = 16 + bar.show("NAME", 0.5) + cursor = [] + bar.last = new Date(0) + bar.pulse() + isOutput(t, "16 columns", + [ [ 'up', 1 ], + [ 'hide' ], + [ 'horizontalAbsolute', 0 ], + [ 'write', 'NAME - |##--|\n' ], + [ 'show' ] ]); +}); diff --git a/deps/npm/node_modules/npmlog/package.json b/deps/npm/node_modules/npmlog/package.json index 1613546d9f195c..153145ab056059 100644 --- a/deps/npm/node_modules/npmlog/package.json +++ b/deps/npm/node_modules/npmlog/package.json @@ -1,58 +1,95 @@ { + "_args": [ + [ + "npmlog@~2.0.2", + "/Users/rebecca/code/npm" + ] + ], + "_from": "npmlog@>=2.0.2 <2.1.0", + "_id": "npmlog@2.0.3", + "_inCache": true, + "_installable": true, + "_location": "/npmlog", + "_nodeVersion": "4.2.2", + "_npmOperationalInternal": { + "host": "packages-13-west.internal.npmjs.com", + "tmp": "tmp/npmlog-2.0.3.tgz_1458089035965_0.5096880353521556" + }, + "_npmUser": { + "email": "me@re-becca.org", + "name": "iarna" + }, + "_npmVersion": "3.8.1", + "_phantomChildren": { + "has-unicode": "2.0.0", + "readable-stream": "2.0.6" + }, + "_requested": { + "name": "npmlog", + "raw": "npmlog@~2.0.2", + "rawSpec": "~2.0.2", + "scope": null, + "spec": ">=2.0.2 <2.1.0", + "type": "range" + }, + "_requiredBy": [ + "/", + "/node-gyp", + "/npm-registry-client" + ], + "_shasum": "020f99351f0c02e399c674ba256e7c4d3b3dd298", + "_shrinkwrap": null, + "_spec": "npmlog@~2.0.2", + "_where": "/Users/rebecca/code/npm", "author": { - "name": "Isaac Z. Schlueter", "email": "i@izs.me", + "name": "Isaac Z. Schlueter", "url": "http://blog.izs.me/" }, - "name": "npmlog", - "description": "logger for npm", - "version": "1.2.1", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/npmlog.git" - }, - "main": "log.js", - "scripts": { - "test": "tap test/*.js" + "bugs": { + "url": "https://github.com/npm/npmlog/issues" }, "dependencies": { - "ansi": "~0.3.0", - "are-we-there-yet": "~1.0.0", - "gauge": "~1.2.0" + "ansi": "~0.3.1", + "are-we-there-yet": "~1.1.2", + "gauge": "~1.2.5" }, + "description": "logger for npm", "devDependencies": { - "tap": "" - }, - "license": "ISC", - "gitHead": "4e1a73a567036064ded425a7d48c863d53550b4f", - "bugs": { - "url": "https://github.com/isaacs/npmlog/issues" - }, - "homepage": "https://github.com/isaacs/npmlog#readme", - "_id": "npmlog@1.2.1", - "_shasum": "28e7be619609b53f7ad1dd300a10d64d716268b6", - "_from": "npmlog@>=1.2.1 <1.3.0", - "_npmVersion": "2.10.0", - "_nodeVersion": "2.0.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" + "tap": "~5.7.0" }, + "directories": {}, "dist": { - "shasum": "28e7be619609b53f7ad1dd300a10d64d716268b6", - "tarball": "http://registry.npmjs.org/npmlog/-/npmlog-1.2.1.tgz" + "shasum": "020f99351f0c02e399c674ba256e7c4d3b3dd298", + "tarball": "http://registry.npmjs.org/npmlog/-/npmlog-2.0.3.tgz" }, + "gitHead": "9dfe26296118ceb5443e76f347f256c35e7ca999", + "homepage": "https://github.com/npm/npmlog#readme", + "license": "ISC", + "main": "log.js", "maintainers": [ { - "name": "isaacs", - "email": "i@izs.me" + "email": "me@re-becca.org", + "name": "iarna" + }, + { + "email": "i@izs.me", + "name": "isaacs" }, { - "name": "iarna", - "email": "me@re-becca.org" + "email": "ogd@aoaioxxysz.net", + "name": "othiym23" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/npmlog/-/npmlog-1.2.1.tgz", - "readme": "ERROR: No README data found!" + "name": "npmlog", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/npmlog.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "2.0.3" } diff --git a/deps/npm/node_modules/npmlog/test/basic.js b/deps/npm/node_modules/npmlog/test/basic.js index 1afcabd1c6bd8d..1887d3a2a8cd4e 100644 --- a/deps/npm/node_modules/npmlog/test/basic.js +++ b/deps/npm/node_modules/npmlog/test/basic.js @@ -24,6 +24,7 @@ var resultExpect = '\u001b[0m\u001b[37m\u001b[40mnpm\u001b[0m \u001b[0m\u001b[31m\u001b[40mERR!\u001b[0m \u001b[0m\u001b[35m404\u001b[0m and maybe a stack.\n', '\u001b[0m\u001b[37m\u001b[40mnpm\u001b[0m \u001b[0m\u001b[31m\u001b[40mERR!\u001b[0m \u001b[0m\u001b[35m404\u001b[0m \n', '\u001b[0m\u001b[37m\u001b[40mnpm\u001b[0m \u001b[0m\u0007noise\u001b[0m\u001b[35m\u001b[0m LOUD NOISES\n', + '\u001b[0m\u001b[37m\u001b[40mnpm\u001b[0m \u001b[0m\u0007noise\u001b[0m \u001b[0m\u001b[35merror\u001b[0m erroring\n', '\u001b[0m' ] var logPrefixEventsExpect = @@ -161,7 +162,12 @@ var logEventsExpect = level: 'noise', prefix: false, message: 'LOUD NOISES', - messageRaw: [ 'LOUD NOISES' ] } ] + messageRaw: [ 'LOUD NOISES' ] }, + { id: 23, + level: 'noise', + prefix: 'error', + message: 'erroring', + messageRaw: [ 'erroring' ] } ] var Stream = require('stream').Stream var s = new Stream() @@ -217,6 +223,7 @@ tap.test('basic', function (t) { 'and maybe a stack.\n') log.addLevel('noise', 10000, {beep: true}) log.noise(false, 'LOUD NOISES') + log.noise('error', 'erroring') t.deepEqual(result.join('').trim(), resultExpect.join('').trim(), 'result') t.deepEqual(log.record, logEventsExpect, 'record') diff --git a/deps/npm/node_modules/npmlog/test/progress.js b/deps/npm/node_modules/npmlog/test/progress.js index 97b13ded2c6660..68dca2afc73575 100644 --- a/deps/npm/node_modules/npmlog/test/progress.js +++ b/deps/npm/node_modules/npmlog/test/progress.js @@ -1,6 +1,7 @@ 'use strict' var test = require('tap').test +var Progress = require('are-we-there-yet') var log = require('../log.js') var actions = [] @@ -38,9 +39,18 @@ function didActions(t, msg, output) { actions = [] } +function resetTracker() { + log.disableProgress() + log.tracker = new Progress.TrackerGroup() + log.enableProgress() + actions = [] +} test('enableProgress', function (t) { t.plan(6) + resetTracker() + log.disableProgress() + actions = [] log.enableProgress() didActions(t, 'enableProgress', [ [ 'enable' ], [ 'show', undefined, 0 ] ]) log.enableProgress() @@ -49,6 +59,7 @@ test('enableProgress', function (t) { test('disableProgress', function (t) { t.plan(4) + resetTracker() log.disableProgress() didActions(t, 'disableProgress', [ [ 'hide' ], [ 'disable' ] ]) log.disableProgress() @@ -57,6 +68,9 @@ test('disableProgress', function (t) { test('showProgress', function (t) { t.plan(5) + resetTracker() + log.disableProgress() + actions = [] log.showProgress('foo') didActions(t, 'showProgress disabled', []) log.enableProgress() @@ -67,6 +81,7 @@ test('showProgress', function (t) { test('clearProgress', function (t) { t.plan(3) + resetTracker() log.clearProgress() didActions(t, 'clearProgress', [ [ 'hide' ] ]) log.disableProgress() @@ -77,10 +92,10 @@ test('clearProgress', function (t) { test("newItem", function (t) { t.plan(12) - log.enableProgress() + resetTracker() actions = [] var a = log.newItem("test", 10) - didActions(t, "newItem", [ [ 'show', undefined, 0 ] ]) + didActions(t, "newItem", [ [ 'show', 'test', 0 ] ]) a.completeWork(5) didActions(t, "newItem:completeWork", [ [ 'show', 'test', 0.5 ] ]) a.finish() @@ -90,24 +105,26 @@ test("newItem", function (t) { // test that log objects proxy through. And test that completion status filters up test("newGroup", function (t) { t.plan(23) + resetTracker() var a = log.newGroup("newGroup") - didActions(t, "newGroup", [ [ 'show', undefined, 0.5 ] ]) + didActions(t, 'newGroup', [[ 'show', 'newGroup', 0 ]]) a.warn("test", "this is a test") - didActions(t, "newGroup:warn", [ [ 'pulse', 'test' ], [ 'hide' ], [ 'show', undefined, 0.5 ] ]) + didActions(t, "newGroup:warn", [ [ 'pulse', 'test' ], [ 'hide' ], [ 'show', undefined, 0 ] ]) var b = a.newItem("newGroup2", 10) - didActions(t, "newGroup:newItem", [ [ 'show', 'newGroup', 0.5 ] ]) + didActions(t, "newGroup:newItem", [ [ 'show', 'newGroup2', 0 ] ]) b.completeWork(5) - didActions(t, "newGroup:completeWork", [ [ 'show', 'newGroup2', 0.75 ] ]) + didActions(t, "newGroup:completeWork", [ [ 'show', 'newGroup2', 0.5] ]) a.finish() didActions(t, "newGroup:finish", [ [ 'show', 'newGroup', 1 ] ]) }) test("newStream", function (t) { t.plan(13) + resetTracker() var a = log.newStream("newStream", 10) - didActions(t, "newStream", [ [ 'show', undefined, 0.6666666666666666 ] ]) + didActions(t, "newStream", [ [ 'show', 'newStream', 0 ] ]) a.write("abcde") - didActions(t, "newStream", [ [ 'show', 'newStream', 0.8333333333333333 ] ]) + didActions(t, "newStream", [ [ 'show', 'newStream', 0.5 ] ]) a.write("fghij") didActions(t, "newStream", [ [ 'show', 'newStream', 1 ] ]) t.is(log.tracker.completed(), 1, "Overall completion") diff --git a/deps/npm/node_modules/once/package.json b/deps/npm/node_modules/once/package.json index c85f12ebe1d4fa..f5fd8173cb19c3 100644 --- a/deps/npm/node_modules/once/package.json +++ b/deps/npm/node_modules/once/package.json @@ -1,60 +1,97 @@ { - "name": "once", - "version": "1.3.2", - "description": "Run a function exactly one time", - "main": "once.js", - "directories": { - "test": "test" + "_args": [ + [ + "once@~1.3.3", + "/Users/ogd/Documents/projects/npm/npm" + ] + ], + "_from": "once@>=1.3.3 <1.4.0", + "_id": "once@1.3.3", + "_inCache": true, + "_installable": true, + "_location": "/once", + "_nodeVersion": "4.0.0", + "_npmUser": { + "email": "i@izs.me", + "name": "isaacs" + }, + "_npmVersion": "3.3.2", + "_phantomChildren": {}, + "_requested": { + "name": "once", + "raw": "once@~1.3.3", + "rawSpec": "~1.3.3", + "scope": null, + "spec": ">=1.3.3 <1.4.0", + "type": "range" + }, + "_requiredBy": [ + "/", + "/glob", + "/inflight", + "/node-gyp/glob", + "/npm-registry-client", + "/read-package-tree", + "/readdir-scoped-modules", + "/standard/standard-engine/eslint/file-entry-cache/flat-cache/del/globby/glob", + "/standard/standard-engine/eslint/inquirer/run-async", + "/tap/nyc/istanbul" + ], + "_resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "_shasum": "b2e261557ce4c314ec8304f3fa82663e4297ca20", + "_shrinkwrap": null, + "_spec": "once@~1.3.3", + "_where": "/Users/ogd/Documents/projects/npm/npm", + "author": { + "email": "i@izs.me", + "name": "Isaac Z. Schlueter", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/once/issues" }, "dependencies": { "wrappy": "1" }, + "description": "Run a function exactly one time", "devDependencies": { - "tap": "~0.3.0" + "tap": "^1.2.0" }, - "scripts": { - "test": "tap test/*.js" + "directories": { + "test": "test" }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/once.git" + "dist": { + "shasum": "b2e261557ce4c314ec8304f3fa82663e4297ca20", + "tarball": "http://registry.npmjs.org/once/-/once-1.3.3.tgz" }, + "files": [ + "once.js" + ], + "gitHead": "2ad558657e17fafd24803217ba854762842e4178", + "homepage": "https://github.com/isaacs/once#readme", "keywords": [ - "once", "function", + "once", "one", "single" ], - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, "license": "ISC", - "gitHead": "e35eed5a7867574e2bf2260a1ba23970958b22f2", - "bugs": { - "url": "https://github.com/isaacs/once/issues" - }, - "homepage": "https://github.com/isaacs/once#readme", - "_id": "once@1.3.2", - "_shasum": "d8feeca93b039ec1dcdee7741c92bdac5e28081b", - "_from": "once@>=1.3.2 <1.4.0", - "_npmVersion": "2.9.1", - "_nodeVersion": "2.0.0", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "d8feeca93b039ec1dcdee7741c92bdac5e28081b", - "tarball": "http://registry.npmjs.org/once/-/once-1.3.2.tgz" - }, + "main": "once.js", "maintainers": [ { "name": "isaacs", "email": "i@izs.me" } ], - "_resolved": "https://registry.npmjs.org/once/-/once-1.3.2.tgz", - "readme": "ERROR: No README data found!" + "name": "once", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/once.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "1.3.3" } diff --git a/deps/npm/node_modules/once/test/once.js b/deps/npm/node_modules/once/test/once.js deleted file mode 100644 index c618360dfaeb56..00000000000000 --- a/deps/npm/node_modules/once/test/once.js +++ /dev/null @@ -1,23 +0,0 @@ -var test = require('tap').test -var once = require('../once.js') - -test('once', function (t) { - var f = 0 - function fn (g) { - t.equal(f, 0) - f ++ - return f + g + this - } - fn.ownProperty = {} - var foo = once(fn) - t.equal(fn.ownProperty, foo.ownProperty) - t.notOk(foo.called) - for (var i = 0; i < 1E3; i++) { - t.same(f, i === 0 ? 0 : 1) - var g = foo.call(1, 1) - t.ok(foo.called) - t.same(g, 3) - t.same(f, 1) - } - t.end() -}) diff --git a/deps/npm/node_modules/opener/package.json b/deps/npm/node_modules/opener/package.json index aab02afc15bcb6..7364b919fc083f 100644 --- a/deps/npm/node_modules/opener/package.json +++ b/deps/npm/node_modules/opener/package.json @@ -10,7 +10,7 @@ "license": "WTFPL", "repository": { "type": "git", - "url": "https://github.com/domenic/opener" + "url": "git+https://github.com/domenic/opener.git" }, "main": "opener.js", "bin": { @@ -50,5 +50,6 @@ "tarball": "http://registry.npmjs.org/opener/-/opener-1.4.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/opener/-/opener-1.4.1.tgz" + "_resolved": "https://registry.npmjs.org/opener/-/opener-1.4.1.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/osenv/node_modules/os-homedir/index.js b/deps/npm/node_modules/osenv/node_modules/os-homedir/index.js index 758ff653df10a9..33066166fe6692 100644 --- a/deps/npm/node_modules/osenv/node_modules/os-homedir/index.js +++ b/deps/npm/node_modules/osenv/node_modules/os-homedir/index.js @@ -15,7 +15,7 @@ function homedir() { } if (process.platform === 'linux') { - return home || (user ? (process.getuid() === 0 ? '/root' : '/home/' + user) : null); + return home || (process.getuid() === 0 ? '/root' : (user ? '/home/' + user : null)); } return home || null; diff --git a/deps/npm/node_modules/osenv/node_modules/os-homedir/package.json b/deps/npm/node_modules/osenv/node_modules/os-homedir/package.json index c9a3b650c0516d..53c8c6e5e62c4d 100644 --- a/deps/npm/node_modules/osenv/node_modules/os-homedir/package.json +++ b/deps/npm/node_modules/osenv/node_modules/os-homedir/package.json @@ -1,6 +1,6 @@ { "name": "os-homedir", - "version": "1.0.0", + "version": "1.0.1", "description": "io.js 2.3.0 os.homedir() ponyfill", "license": "MIT", "repository": { @@ -40,31 +40,14 @@ "ava": "0.0.4", "path-exists": "^1.0.0" }, - "gitHead": "7e39e2e049de404f06233fa617ecf46fed997a78", + "readme": "# os-homedir [![Build Status](https://travis-ci.org/sindresorhus/os-homedir.svg?branch=master)](https://travis-ci.org/sindresorhus/os-homedir)\n\n> io.js 2.3.0 [`os.homedir()`](https://iojs.org/api/os.html#os_os_homedir) ponyfill\n\n> Ponyfill: A polyfill that doesn't overwrite the native method\n\n\n## Install\n\n```\n$ npm install --save os-homedir\n```\n\n\n## Usage\n\n```js\nvar osHomedir = require('os-homedir');\n\nconsole.log(osHomedir());\n//=> /Users/sindresorhus\n```\n\n\n## Related\n\n- [user-home](https://github.com/sindresorhus/user-home) - Same as this module but caches the result\n- [home-or-tmp](https://github.com/sindresorhus/home-or-tmp) - Get the user home directory with fallback to the system temp directory\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n", + "readmeFilename": "readme.md", "bugs": { "url": "https://github.com/sindresorhus/os-homedir/issues" }, - "homepage": "https://github.com/sindresorhus/os-homedir", - "_id": "os-homedir@1.0.0", - "_shasum": "e37078bc61b5869063053897257e39ec1261b702", - "_from": "os-homedir@>=1.0.0 <2.0.0", - "_npmVersion": "2.11.1", - "_nodeVersion": "2.3.0", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "e37078bc61b5869063053897257e39ec1261b702", - "tarball": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.0.tgz" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.0.tgz", - "readme": "ERROR: No README data found!" + "homepage": "https://github.com/sindresorhus/os-homedir#readme", + "_id": "os-homedir@1.0.1", + "_shasum": "0d62bdf44b916fd3bbdcf2cab191948fb094f007", + "_resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.1.tgz", + "_from": "os-homedir@>=1.0.0 <2.0.0" } diff --git a/deps/npm/node_modules/osenv/node_modules/os-tmpdir/package.json b/deps/npm/node_modules/osenv/node_modules/os-tmpdir/package.json index f8b2682bf83cfe..071ea5ec83fa23 100644 --- a/deps/npm/node_modules/osenv/node_modules/os-tmpdir/package.json +++ b/deps/npm/node_modules/osenv/node_modules/os-tmpdir/package.json @@ -5,7 +5,7 @@ "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/sindresorhus/os-tmpdir" + "url": "git+https://github.com/sindresorhus/os-tmpdir.git" }, "author": { "name": "Sindre Sorhus", @@ -40,30 +40,14 @@ "devDependencies": { "ava": "0.0.4" }, - "gitHead": "5c5d355f81378980db629d60128ad03e02b1c1e5", + "readme": "# os-tmpdir [![Build Status](https://travis-ci.org/sindresorhus/os-tmpdir.svg?branch=master)](https://travis-ci.org/sindresorhus/os-tmpdir)\n\n> Node.js [`os.tmpdir()`](https://nodejs.org/api/os.html#os_os_tmpdir) ponyfill\n\n> Ponyfill: A polyfill that doesn't overwrite the native method\n\nUse this instead of `require('os').tmpdir()` to get a consistent behaviour on different Node.js versions (even 0.8).\n\n*This is actually taken from io.js 2.0.2 as it contains some fixes that haven't bubbled up to Node.js yet.*\n\n\n## Install\n\n```\n$ npm install --save os-tmpdir\n```\n\n\n## Usage\n\n```js\nvar osTmpdir = require('os-tmpdir');\n\nosTmpdir();\n//=> /var/folders/m3/5574nnhn0yj488ccryqr7tc80000gn/T\n```\n\n\n## API\n\nSee the [`os.tmpdir()` docs](https://nodejs.org/api/os.html#os_os_tmpdir).\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n", + "readmeFilename": "readme.md", "bugs": { "url": "https://github.com/sindresorhus/os-tmpdir/issues" }, - "homepage": "https://github.com/sindresorhus/os-tmpdir", + "homepage": "https://github.com/sindresorhus/os-tmpdir#readme", "_id": "os-tmpdir@1.0.1", "_shasum": "e9b423a1edaf479882562e92ed71d7743a071b6e", - "_from": "os-tmpdir@>=1.0.0 <2.0.0", - "_npmVersion": "2.9.1", - "_nodeVersion": "0.12.3", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "e9b423a1edaf479882562e92ed71d7743a071b6e", - "tarball": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.1.tgz" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.1.tgz" + "_resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.1.tgz", + "_from": "os-tmpdir@>=1.0.0 <2.0.0" } diff --git a/deps/npm/node_modules/osenv/package.json b/deps/npm/node_modules/osenv/package.json index d5718bdb1111ab..ac0c03cda62409 100644 --- a/deps/npm/node_modules/osenv/package.json +++ b/deps/npm/node_modules/osenv/package.json @@ -35,41 +35,14 @@ }, "license": "ISC", "description": "Look up environment settings specific to different operating systems", - "gitHead": "f746b3405d8f9e28054d11b97e1436f6a15016c4", + "readme": "# osenv\n\nLook up environment settings specific to different operating systems.\n\n## Usage\n\n```javascript\nvar osenv = require('osenv')\nvar path = osenv.path()\nvar user = osenv.user()\n// etc.\n\n// Some things are not reliably in the env, and have a fallback command:\nvar h = osenv.hostname(function (er, hostname) {\n h = hostname\n})\n// This will still cause it to be memoized, so calling osenv.hostname()\n// is now an immediate operation.\n\n// You can always send a cb, which will get called in the nextTick\n// if it's been memoized, or wait for the fallback data if it wasn't\n// found in the environment.\nosenv.hostname(function (er, hostname) {\n if (er) console.error('error looking up hostname')\n else console.log('this machine calls itself %s', hostname)\n})\n```\n\n## osenv.hostname()\n\nThe machine name. Calls `hostname` if not found.\n\n## osenv.user()\n\nThe currently logged-in user. Calls `whoami` if not found.\n\n## osenv.prompt()\n\nEither PS1 on unix, or PROMPT on Windows.\n\n## osenv.tmpdir()\n\nThe place where temporary files should be created.\n\n## osenv.home()\n\nNo place like it.\n\n## osenv.path()\n\nAn array of the places that the operating system will search for\nexecutables.\n\n## osenv.editor() \n\nReturn the executable name of the editor program. This uses the EDITOR\nand VISUAL environment variables, and falls back to `vi` on Unix, or\n`notepad.exe` on Windows.\n\n## osenv.shell()\n\nThe SHELL on Unix, which Windows calls the ComSpec. Defaults to 'bash'\nor 'cmd'.\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/npm/osenv/issues" }, "homepage": "https://github.com/npm/osenv#readme", "_id": "osenv@0.1.3", "_shasum": "83cf05c6d6458fc4d5ac6362ea325d92f2754217", - "_from": "osenv@0.1.3", - "_npmVersion": "3.0.0", - "_nodeVersion": "2.2.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "83cf05c6d6458fc4d5ac6362ea325d92f2754217", - "tarball": "http://registry.npmjs.org/osenv/-/osenv-0.1.3.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - }, - { - "name": "robertkowalski", - "email": "rok@kowalski.gd" - }, - { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" - }, - { - "name": "iarna", - "email": "me@re-becca.org" - } - ], - "_resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.3.tgz" + "_resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.3.tgz", + "_from": "osenv@>=0.1.3 <0.2.0" } diff --git a/deps/npm/node_modules/path-is-inside/package.json b/deps/npm/node_modules/path-is-inside/package.json index b96d6fea0e8b92..deced257898031 100644 --- a/deps/npm/node_modules/path-is-inside/package.json +++ b/deps/npm/node_modules/path-is-inside/package.json @@ -33,11 +33,9 @@ }, "readme": "# Is This Path Inside This Other Path?\n\nIt turns out this question isn't trivial to answer using Node's built-in path APIs. A naive `indexOf`-based solution will fail sometimes on Windows, which is case-insensitive (see e.g. [isaacs/npm#4214][]). You might then think to be clever with `path.resolve`, but you have to be careful to account for situations whether the paths have different drive letters, or else you'll cause bugs like [isaacs/npm#4313][]. And let's not even get started on trailing slashes.\n\nThe **path-is-inside** package will give you a robust, cross-platform way of detecting whether a given path is inside another path.\n\n## Usage\n\nPretty simple. First the path being tested; then the potential parent. Like so:\n\n```js\nvar pathIsInside = require(\"path-is-inside\");\n\npathIsInside(\"/x/y/z\", \"/x/y\") // true\npathIsInside(\"/x/y\", \"/x/y/z\") // false\n```\n\n## OS-Specific Behavior\n\nLike Node's built-in path module, path-is-inside treats all file paths on Windows as case-insensitive, whereas it treats all file paths on *-nix operating systems as case-sensitive. Keep this in mind especially when working on a Mac, where, despite Node's defaults, the OS usually treats paths case-insensitively.\n\nIn practice, this means:\n\n```js\n// On Windows\n\npathIsInside(\"C:\\\\X\\\\Y\\\\Z\", \"C:\\\\x\\\\y\") // true\n\n// On *-nix, including Mac OS X\n\npathIsInside(\"/X/Y/Z\", \"/x/y\") // false\n```\n\n[isaacs/npm#4214]: https://github.com/isaacs/npm/pull/4214\n[isaacs/npm#4313]: https://github.com/isaacs/npm/issues/4313\n", "readmeFilename": "README.md", - "homepage": "https://github.com/domenic/path-is-inside", + "homepage": "https://github.com/domenic/path-is-inside#readme", "_id": "path-is-inside@1.0.1", - "dist": { - "shasum": "c5e6c4764c4cd41f2ac839c53be5621d085726b3" - }, - "_from": "path-is-inside@1.0.1", - "_resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.1.tgz" + "_shasum": "98d8f1d030bf04bd7aeee4a1ba5485d40318fd89", + "_resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.1.tgz", + "_from": "path-is-inside@>=1.0.1 <1.1.0" } diff --git a/deps/npm/node_modules/read-cmd-shim/.npmignore b/deps/npm/node_modules/read-cmd-shim/.npmignore new file mode 100644 index 00000000000000..ac50549639a976 --- /dev/null +++ b/deps/npm/node_modules/read-cmd-shim/.npmignore @@ -0,0 +1,3 @@ +.#* +*~ +node_modules diff --git a/deps/npm/node_modules/read-cmd-shim/README.md b/deps/npm/node_modules/read-cmd-shim/README.md new file mode 100644 index 00000000000000..2f0b5f6cc671e0 --- /dev/null +++ b/deps/npm/node_modules/read-cmd-shim/README.md @@ -0,0 +1,36 @@ +# read-cmd-shim + +Figure out what a [`cmd-shim`](https://github.com/ForbesLindesay/cmd-shim) +is pointing at. This acts as the equivalent of +[`fs.readlink`](https://nodejs.org/api/fs.html#fs_fs_readlink_path_callback). + +### Usage + +``` +var readCmdShim = require('read-cmd-shim') + +readCmdShim('/path/to/shim.cmd', function (er, destination) { + … +}) + +var destination = readCmdShim.sync('/path/to/shim.cmd') + +### readCmdShim(path, callback) + +Reads the `cmd-shim` located at `path` and calls back with the _relative_ +path that the shim points at. Consider this as roughly the equivalent of +`fs.readlink`. + +This can read both `.cmd` style that are run by the Windows Command Prompt +and Powershell, and the kind without any extension that are used by Cygwin. + +This can return errors that `fs.readFile` returns, except that they'll +include a stack trace from where `readCmdShim` was called. Plus it can +return a special `ENOTASHIM` exception, when it can't find a cmd-shim in the +file referenced by `path`. This should only happen if you pass in a +non-command shim. + + +### readCmdShim.sync(path) + +Same as above but synchronous. Errors are thrown. diff --git a/deps/npm/node_modules/read-cmd-shim/index.js b/deps/npm/node_modules/read-cmd-shim/index.js new file mode 100644 index 00000000000000..6a2265449af268 --- /dev/null +++ b/deps/npm/node_modules/read-cmd-shim/index.js @@ -0,0 +1,54 @@ +'use strict' +var fs = require('graceful-fs') + +function extractPath (path, cmdshimContents) { + if (/[.]cmd$/.test(path)) { + return extractPathFromCmd(cmdshimContents) + } else { + return extractPathFromCygwin(cmdshimContents) + } +} + +function extractPathFromCmd (cmdshimContents) { + var matches = cmdshimContents.match(/"%~dp0\\([^"]+?)"\s+%[*]/) + return matches && matches[1] +} + +function extractPathFromCygwin (cmdshimContents) { + var matches = cmdshimContents.match(/"[$]basedir[/]([^"]+?)"\s+"[$]@"/) + return matches && matches[1] +} + +function wrapError (thrown, newError) { + newError.message = thrown.message + newError.code = thrown.code + return newError +} + +function notaShim (path, er) { + if (!er) { + er = new Error() + Error.captureStackTrace(er, notaShim) + } + er.code = 'ENOTASHIM' + er.message = "Can't read shim path from '" + path + "', it doesn't appear to be a cmd-shim" + return er +} + +var readCmdShim = module.exports = function (path, cb) { + var er = new Error() + Error.captureStackTrace(er, readCmdShim) + fs.readFile(path, function (readFileEr, contents) { + if (readFileEr) return cb(wrapError(readFileEr, er)) + var destination = extractPath(path, contents.toString()) + if (destination) return cb(null, destination) + return cb(notaShim(path, er)) + }) +} + +module.exports.sync = function (path) { + var contents = fs.readFileSync(path) + var destination = extractPath(path, contents.toString()) + if (!destination) throw notaShim(path) + return destination +} diff --git a/deps/npm/node_modules/read-cmd-shim/package.json b/deps/npm/node_modules/read-cmd-shim/package.json new file mode 100644 index 00000000000000..04f8addc4d9bb9 --- /dev/null +++ b/deps/npm/node_modules/read-cmd-shim/package.json @@ -0,0 +1,54 @@ +{ + "name": "read-cmd-shim", + "version": "1.0.1", + "description": "Figure out what a cmd-shim is pointing at. This acts as the equivalent of fs.readlink.", + "main": "index.js", + "dependencies": { + "graceful-fs": "^4.1.2" + }, + "devDependencies": { + "cmd-shim": "^2.0.1", + "rimraf": "^2.4.3", + "standard": "^5.2.2", + "tap": "^1.4.1" + }, + "scripts": { + "test": "standard && tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/read-cmd-shim.git" + }, + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org", + "url": "http://re-becca.org/" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/read-cmd-shim/issues" + }, + "homepage": "https://github.com/npm/read-cmd-shim#readme", + "gitHead": "7c50879bf49743a1c69f9d7f0ba1638fc46bb40c", + "_id": "read-cmd-shim@1.0.1", + "_shasum": "2d5d157786a37c055d22077c32c53f8329e91c7b", + "_from": "read-cmd-shim@>=1.0.1 <1.1.0", + "_npmVersion": "3.3.0", + "_nodeVersion": "3.1.0", + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "dist": { + "shasum": "2d5d157786a37c055d22077c32c53f8329e91c7b", + "tarball": "http://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-1.0.1.tgz" + }, + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-1.0.1.tgz" +} diff --git a/deps/npm/node_modules/read-cmd-shim/test/integration.js b/deps/npm/node_modules/read-cmd-shim/test/integration.js new file mode 100644 index 00000000000000..269f964727cd6b --- /dev/null +++ b/deps/npm/node_modules/read-cmd-shim/test/integration.js @@ -0,0 +1,139 @@ +'use strict' +var path = require('path') +var fs = require('graceful-fs') +var test = require('tap').test +var rimraf = require('rimraf') +var cmdShim = require('cmd-shim') +var readCmdShim = require('../index.js') +var workDir = path.join(__dirname, path.basename(__filename, '.js')) +var testShbang = path.join(workDir, 'test-shbang') +var testShbangCmd = testShbang + '.cmd' +var testShim = path.join(workDir, 'test') +var testShimCmd = testShim + '.cmd' + +test('setup', function (t) { + rimraf.sync(workDir) + fs.mkdirSync(workDir) + fs.writeFileSync(testShbang + '.js', '#!/usr/bin/env node\ntrue') + cmdShim(__filename, testShim, function (er) { + t.error(er) + cmdShim(testShbang + '.js', testShbang, function (er) { + t.error(er) + t.done() + }) + }) +}) + +test('async-read-no-shbang', function (t) { + t.plan(2) + readCmdShim(testShimCmd, function (er, dest) { + t.error(er) + t.is(dest, '..\\basic.js') + t.done() + }) +}) + +test('sync-read-no-shbang', function (t) { + t.plan(1) + var dest = readCmdShim.sync(testShimCmd) + t.is(dest, '..\\basic.js') + t.done() +}) + +test('async-read-shbang', function (t) { + t.plan(2) + readCmdShim(testShbangCmd, function (er, dest) { + t.error(er) + t.is(dest, 'test-shbang.js') + t.done() + }) +}) + +test('sync-read-shbang', function (t) { + t.plan(1) + var dest = readCmdShim.sync(testShbangCmd) + t.is(dest, 'test-shbang.js') + t.done() +}) + +test('async-read-no-shbang-cygwin', function (t) { + t.plan(2) + readCmdShim(testShim, function (er, dest) { + t.error(er) + t.is(dest, '../basic.js') + t.done() + }) +}) + +test('sync-read-no-shbang-cygwin', function (t) { + t.plan(1) + var dest = readCmdShim.sync(testShim) + t.is(dest, '../basic.js') + t.done() +}) + +test('async-read-shbang-cygwin', function (t) { + t.plan(2) + readCmdShim(testShbang, function (er, dest) { + t.error(er) + t.is(dest, 'test-shbang.js') + t.done() + }) +}) + +test('sync-read-shbang-cygwin', function (t) { + t.plan(1) + var dest = readCmdShim.sync(testShbang) + t.is(dest, 'test-shbang.js') + t.done() +}) + +test('async-read-dir', function (t) { + t.plan(2) + readCmdShim(workDir, function (er) { + t.ok(er) + t.is(er.code, 'EISDIR', "cmd-shims can't be directories") + t.done() + }) +}) + +test('sync-read-dir', function (t) { + t.plan(1) + t.throws(function () { readCmdShim.sync(workDir) }, "cmd-shims can't be directories") + t.done() +}) + +test('async-read-not-there', function (t) { + t.plan(2) + readCmdShim('/path/to/nowhere', function (er, dest) { + t.ok(er, 'missing files throw errors') + t.is(er.code, 'ENOENT', "cmd-shim file doesn't exist") + t.done() + }) +}) + +test('sync-read-not-there', function (t) { + t.plan(1) + t.throws(function () { readCmdShim.sync('/path/to/nowhere') }, "cmd-shim file doesn't exist") + t.done() +}) + +test('async-read-not-shim', function (t) { + t.plan(2) + readCmdShim(__filename, function (er, dest) { + t.ok(er) + t.is(er.code, 'ENOTASHIM', 'shim file specified is not a shim') + t.done() + }) +}) + +test('sync-read-not-shim', function (t) { + t.plan(1) + t.throws(function () { readCmdShim.sync(__filename) }, 'shim file specified is not a shim') + t.done() +}) + +test('cleanup', function (t) { + rimraf.sync(workDir) + t.done() +}) diff --git a/deps/npm/node_modules/read-installed/node_modules/debuglog/package.json b/deps/npm/node_modules/read-installed/node_modules/debuglog/package.json deleted file mode 100644 index 39fac076703ce0..00000000000000 --- a/deps/npm/node_modules/read-installed/node_modules/debuglog/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "debuglog", - "version": "1.0.1", - "description": "backport of util.debuglog from node v0.11", - "license": "MIT", - "main": "debuglog.js", - "repository": { - "type": "git", - "url": "https://github.com/sam-github/node-debuglog.git" - }, - "author": { - "name": "Sam Roberts", - "email": "sam@strongloop.com" - }, - "engines": { - "node": "*" - }, - "browser": { - "util": false - }, - "bugs": { - "url": "https://github.com/sam-github/node-debuglog/issues" - }, - "homepage": "https://github.com/sam-github/node-debuglog", - "_id": "debuglog@1.0.1", - "dist": { - "shasum": "aa24ffb9ac3df9a2351837cfb2d279360cd78492", - "tarball": "http://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz" - }, - "_from": "debuglog@>=1.0.1 <2.0.0", - "_npmVersion": "1.4.3", - "_npmUser": { - "name": "octet", - "email": "sam@strongloop.com" - }, - "maintainers": [ - { - "name": "octet", - "email": "sam@strongloop.com" - } - ], - "directories": {}, - "_shasum": "aa24ffb9ac3df9a2351837cfb2d279360cd78492", - "_resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz" -} diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/package.json b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/package.json deleted file mode 100644 index d9c7b715554e80..00000000000000 --- a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "readdir-scoped-modules", - "version": "1.0.2", - "description": "Like `fs.readdir` but handling `@org/module` dirs as if they were a single entry.", - "main": "readdir.js", - "directories": { - "test": "test" - }, - "dependencies": { - "debuglog": "^1.0.1", - "dezalgo": "^1.0.0", - "graceful-fs": "^4.1.2", - "once": "^1.3.0" - }, - "devDependencies": { - "tap": "^1.2.0" - }, - "scripts": { - "test": "tap test/*.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/npm/readdir-scoped-modules.git" - }, - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "ISC", - "bugs": { - "url": "https://github.com/npm/readdir-scoped-modules/issues" - }, - "homepage": "https://github.com/npm/readdir-scoped-modules", - "readme": "# readdir-scoped-modules\n\nLike `fs.readdir` but handling `@org/module` dirs as if they were\na single entry.\n\nUsed by npm.\n\n## USAGE\n\n```javascript\nvar readdir = require('readdir-scoped-modules')\n\nreaddir('node_modules', function (er, entries) {\n // entries will be something like\n // ['a', '@org/foo', '@org/bar']\n})\n```\n", - "readmeFilename": "README.md", - "gitHead": "d41d5de877cb4e9e3f14b92913132680af73d1b4", - "_id": "readdir-scoped-modules@1.0.2", - "_shasum": "9fafa37d286be5d92cbaebdee030dc9b5f406747", - "_from": "readdir-scoped-modules@>=1.0.0 <2.0.0" -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/LICENSE b/deps/npm/node_modules/read-installed/node_modules/util-extend/LICENSE similarity index 100% rename from deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/LICENSE rename to deps/npm/node_modules/read-installed/node_modules/util-extend/LICENSE diff --git a/deps/npm/node_modules/read-installed/node_modules/util-extend/package.json b/deps/npm/node_modules/read-installed/node_modules/util-extend/package.json index 259d6c1049fac5..137656aa825a30 100644 --- a/deps/npm/node_modules/read-installed/node_modules/util-extend/package.json +++ b/deps/npm/node_modules/read-installed/node_modules/util-extend/package.json @@ -1,41 +1,69 @@ { - "name": "util-extend", - "version": "1.0.1", - "description": "Node's internal object extension function", - "main": "extend.js", - "scripts": { - "test": "node test.js" + "_args": [ + [ + "util-extend@^1.0.1", + "/Users/rebecca/code/npm/node_modules/read-installed" + ] + ], + "_from": "util-extend@>=1.0.1 <2.0.0", + "_id": "util-extend@1.0.3", + "_inCache": true, + "_installable": true, + "_location": "/read-installed/util-extend", + "_nodeVersion": "4.0.0", + "_npmUser": { + "email": "i@izs.me", + "name": "isaacs" }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/util-extend.git" + "_npmVersion": "2.14.15", + "_phantomChildren": {}, + "_requested": { + "name": "util-extend", + "raw": "util-extend@^1.0.1", + "rawSpec": "^1.0.1", + "scope": null, + "spec": ">=1.0.1 <2.0.0", + "type": "range" }, + "_requiredBy": [ + "/read-installed" + ], + "_resolved": "https://registry.npmjs.org/util-extend/-/util-extend-1.0.3.tgz", + "_shasum": "a7c216d267545169637b3b6edc6ca9119e2ff93f", + "_shrinkwrap": null, + "_spec": "util-extend@^1.0.1", + "_where": "/Users/rebecca/code/npm/node_modules/read-installed", "author": "", - "license": "MIT", - "readmeFilename": "README.md", - "readme": "# util-extend\n\nThe Node object extending function that Node uses for Node!\n\n## Usage\n\n```js\nvar extend = require('util-extend');\nfunction functionThatTakesOptions(options) {\n var options = extend(defaults, options);\n // now any unset options are set to the defaults.\n}\n```\n", "bugs": { "url": "https://github.com/isaacs/util-extend/issues" }, - "_id": "util-extend@1.0.1", + "dependencies": {}, + "description": "Node's internal object extension function", + "devDependencies": {}, + "directories": {}, "dist": { - "shasum": "bb703b79480293ddcdcfb3c6a9fea20f483415bc", - "tarball": "http://registry.npmjs.org/util-extend/-/util-extend-1.0.1.tgz" - }, - "_from": "util-extend@>=1.0.1 <2.0.0", - "_npmVersion": "1.3.4", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" + "shasum": "a7c216d267545169637b3b6edc6ca9119e2ff93f", + "tarball": "http://registry.npmjs.org/util-extend/-/util-extend-1.0.3.tgz" }, + "gitHead": "22757dc229edbb253af63d533f27a837184f4a51", + "homepage": "https://github.com/isaacs/util-extend#readme", + "license": "MIT", + "main": "extend.js", "maintainers": [ { "name": "isaacs", "email": "i@izs.me" } ], - "directories": {}, - "_shasum": "bb703b79480293ddcdcfb3c6a9fea20f483415bc", - "_resolved": "https://registry.npmjs.org/util-extend/-/util-extend-1.0.1.tgz", - "homepage": "https://github.com/isaacs/util-extend#readme" + "name": "util-extend", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/util-extend.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.3" } diff --git a/deps/npm/node_modules/read-installed/package.json b/deps/npm/node_modules/read-installed/package.json index b1b3c5fa5a9fbc..76977474cddf21 100644 --- a/deps/npm/node_modules/read-installed/package.json +++ b/deps/npm/node_modules/read-installed/package.json @@ -33,8 +33,6 @@ "rimraf": "^2.2.8", "tap": "^1.2.0" }, - "readme": "# read-installed\n\nRead all the installed packages in a folder, and return a tree\nstructure with all the data.\n\nnpm uses this.\n\n## 2.0.0\n\nBreaking changes in `2.0.0`:\n\nThe second argument is now an `Object` that contains the following keys:\n\n * `depth` optional, defaults to Infinity\n * `log` optional log Function\n * `dev` optional, default false, set to true to include devDependencies\n\n## Usage\n\n```javascript\nvar readInstalled = require(\"read-installed\")\n// optional options\nvar options = { dev: false, log: fn, depth: 2 }\nreadInstalled(folder, options, function (er, data) {\n ...\n})\n```\n", - "readmeFilename": "README.md", "gitHead": "da02df6acdb5f5ee31d8c637ef31fb50efb455c1", "bugs": { "url": "https://github.com/isaacs/read-installed/issues" @@ -42,5 +40,35 @@ "homepage": "https://github.com/isaacs/read-installed#readme", "_id": "read-installed@4.0.3", "_shasum": "ff9b8b67f187d1e4c29b9feb31f6b223acd19067", - "_from": "read-installed@4.0.3" + "_from": "read-installed@>=4.0.3 <4.1.0", + "_npmVersion": "2.14.3", + "_nodeVersion": "2.2.2", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "ff9b8b67f187d1e4c29b9feb31f6b223acd19067", + "tarball": "http://registry.npmjs.org/read-installed/-/read-installed-4.0.3.tgz" + }, + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/read-installed/-/read-installed-4.0.3.tgz" } diff --git a/deps/npm/node_modules/read-package-json/README.md b/deps/npm/node_modules/read-package-json/README.md index d497722a435835..05ba112ccbefc3 100644 --- a/deps/npm/node_modules/read-package-json/README.md +++ b/deps/npm/node_modules/read-package-json/README.md @@ -105,15 +105,6 @@ If a bindings.gyp file exists, and there is not already a `scripts.install` field, then the `scripts.install` field will be set to `node-gyp rebuild`. -### `wscript` - -If a wscript file exists, and there is not already a `scripts.install` -field, then the `scripts.install` field will be set to `node-waf clean ; -node-waf configure build`. - -Note that the `bindings.gyp` file supercedes this, since node-waf has -been deprecated in favor of node-gyp. - ### `index.js` If the json file does not exist, but there is a `index.js` file diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/LICENSE b/deps/npm/node_modules/read-package-json/node_modules/glob/LICENSE similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/LICENSE rename to deps/npm/node_modules/read-package-json/node_modules/glob/LICENSE diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/README.md b/deps/npm/node_modules/read-package-json/node_modules/glob/README.md new file mode 100644 index 00000000000000..6960483bac63c6 --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/README.md @@ -0,0 +1,359 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +![](oh-my-glob.gif) + +## Usage + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Glob Primer + +"Globs" are the patterns you type when you do stuff like `ls *.js` on +the command line, or put `build/*` in a `.gitignore` file. + +Before parsing the path part patterns, braced sections are expanded +into a set. Braced sections start with `{` and end with `}`, with any +number of comma-delimited sections within. Braced sections may contain +slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. + +The following characters have special magic meaning when used in a +path portion: + +* `*` Matches 0 or more characters in a single path portion +* `?` Matches 1 character +* `[...]` Matches a range of characters, similar to a RegExp range. + If the first character of the range is `!` or `^` then it matches + any character not in the range. +* `!(pattern|pattern|pattern)` Matches anything that does not match + any of the patterns provided. +* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the + patterns provided. +* `+(pattern|pattern|pattern)` Matches one or more occurrences of the + patterns provided. +* `*(a|b|c)` Matches zero or more occurrences of the patterns provided +* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns + provided +* `**` If a "globstar" is alone in a path portion, then it matches + zero or more directories and subdirectories searching for matches. + It does not crawl symlinked directories. + +### Dots + +If a file or directory path portion has a `.` as the first character, +then it will not match any glob pattern unless that pattern's +corresponding path part also has a `.` as its first character. + +For example, the pattern `a/.*/c` would match the file at `a/.b/c`. +However the pattern `a/*/c` would not, because `*` does not start with +a dot character. + +You can make glob treat dots as normal characters by setting +`dot:true` in the options. + +### Basename Matching + +If you set `matchBase:true` in the options, and the pattern has no +slashes in it, then it will seek for any file anywhere in the tree +with a matching basename. For example, `*.js` would match +`test/simple/basic.js`. + +### Empty Sets + +If no matching files are found, then an empty array is returned. This +differs from the shell, where the pattern itself is returned. For +example: + + $ echo a*s*d*f + a*s*d*f + +To get the bash-style behavior, set the `nonull:true` in the options. + +### See Also: + +* `man sh` +* `man bash` (Search for "Pattern Matching") +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob.hasMagic(pattern, [options]) + +Returns `true` if there are any special characters in the pattern, and +`false` otherwise. + +Note that the options affect the results. If `noext:true` is set in +the options object, then `+(a|b)` will not be considered a magic +pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` +then that is considered magical, unless `nobrace:true` is set in the +options. + +## glob(pattern, [options], cb) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* `cb` `{Function}` + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* return: `{Array}` filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instantiating the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` `{String}` pattern to search for +* `options` `{Object}` +* `cb` `{Function}` Called when an error occurs, or matches are found + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `'FILE'` - Path exists, and is not a directory + * `'DIR'` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` +* `statCache` Cache of `fs.stat` results, to prevent statting the same + path multiple times. +* `symlinks` A record of which paths are symbolic links, which is + relevant in resolving `**` patterns. +* `realpathCache` An optional object which is passed to `fs.realpath` + to minimize unnecessary syscalls. It is stored on the instantiated + Glob object, and may be re-used. + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the specific + thing that matched. It is not deduplicated or resolved to a realpath. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `pause` Temporarily stop the search +* `resume` Resume the search +* `abort` Stop the search forever + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the Glob object, as well. + +If you are running many `glob` operations, you can pass a Glob object +as the `options` argument to a subsequent operation to shortcut some +`stat` and `readdir` calls. At the very least, you may pass in shared +`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that +parallel glob operations will be sped up by sharing information about +the filesystem. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. +* `silent` When an unusual error is encountered when attempting to + read a directory, a warning will be printed to stderr. Set the + `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered when attempting to + read a directory, the process will just continue on in search of + other matches. Set the `strict` option to raise an error in these + cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary + to set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `symlinks` A cache of known symbolic links. You may pass in a + previously generated `symlinks` object to save `lstat` calls when + resolving `**` matches. +* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. Set this + flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `debug` Set to enable debug logging in minimatch and glob. +* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. +* `noglobstar` Do not match `**` against multiple filenames. (Ie, + treat it as a normal `*` instead.) +* `noext` Do not match `+(a|b)` "extglob" patterns. +* `nocase` Perform a case-insensitive match. Note: on + case-insensitive filesystems, non-magic patterns will match by + default, since `stat` and `readdir` will not raise errors. +* `matchBase` Perform a basename-only match if the pattern does not + contain any slash characters. That is, `*.js` would be treated as + equivalent to `**/*.js`, matching all js files in all directories. +* `nodir` Do not match directories, only files. (Note: to match + *only* directories, simply put a `/` at the end of the pattern.) +* `ignore` Add a pattern or an array of glob patterns to exclude matches. + Note: `ignore` patterns are *always* in `dot:true` mode, regardless + of any other settings. +* `follow` Follow symlinked directories when expanding `**` patterns. + Note that this can result in a lot of duplicate references in the + presence of cyclic links. +* `realpath` Set to true to call `fs.realpath` on all of the results. + In the case of a symlink that cannot be resolved, the full absolute + path to the matched entry is returned (though it will usually be a + broken symlink) + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.3, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +Note that symlinked directories are not crawled as part of a `**`, +though their contents may match against subsequent portions of the +pattern. This prevents infinite loops and duplicates and the like. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +### Comments and Negation + +Previously, this module let you mark a pattern as a "comment" if it +started with a `#` character, or a "negated" pattern if it started +with a `!` character. + +These options were deprecated in version 5, and removed in version 6. + +To specify things that should not match, use the `ignore` option. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. + +## Contributing + +Any change to behavior (including bugfixes) must come with a test. + +Patches that fail tests or reduce performance will be rejected. + +``` +# to run tests +npm test + +# to re-generate test fixtures +npm run test-regen + +# to benchmark against bash/zsh +npm run bench + +# to profile javascript +npm run prof +``` diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/common.js b/deps/npm/node_modules/read-package-json/node_modules/glob/common.js new file mode 100644 index 00000000000000..c9127eb334f18b --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/common.js @@ -0,0 +1,226 @@ +exports.alphasort = alphasort +exports.alphasorti = alphasorti +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var path = require("path") +var minimatch = require("minimatch") +var isAbsolute = require("path-is-absolute") +var Minimatch = minimatch.Minimatch + +function alphasorti (a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()) +} + +function alphasort (a, b) { + return a.localeCompare(b) +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || [] + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} + +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } + + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = options.cwd + self.changedCwd = path.resolve(options.cwd) !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + self.nomount = !!options.nomount + + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(self.nocase ? alphasorti : alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + return !(/\/$/.test(e)) + }) + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + + self.found = all +} + +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/glob.js b/deps/npm/node_modules/read-package-json/node_modules/glob/glob.js new file mode 100644 index 00000000000000..a62da27ebd507a --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/glob.js @@ -0,0 +1,765 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob + +var fs = require('fs') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var inherits = require('inherits') +var EE = require('events').EventEmitter +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var globSync = require('./sync.js') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = require('inflight') +var util = require('util') +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +var once = require('once') + +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) +} + +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } + + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} + +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + this._didRealPath = false + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } + + var self = this + var n = this.minimatch.set.length + this._processing = 0 + this.matches = new Array(n) + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + + function done () { + --self._processing + if (self._processing <= 0) + self._finish() + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + fs.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} + +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (this.matches[index][e]) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = this._makeAbs(e) + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + if (this.mark) + e = this._mark(e) + + this.matches[index][e] = true + + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er) + return cb() + + var isSym = lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + this.cache[this._makeAbs(f)] = 'FILE' + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } + + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er) { + this.statCache[abs] = false + return cb() + } + + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && !stat.isDirectory()) + return cb(null, false, stat) + + var c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c !== 'DIR') + return cb() + + return cb(null, c, stat) +} diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/LICENSE b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/LICENSE new file mode 100644 index 00000000000000..19129e315fe593 --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/README.md b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/README.md new file mode 100644 index 00000000000000..d458bc2e0a6b03 --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/README.md @@ -0,0 +1,216 @@ +# minimatch + +A minimal matching utility. + +[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) + + +This is the matching library used internally by npm. + +It works by converting glob expressions into JavaScript `RegExp` +objects. + +## Usage + +```javascript +var minimatch = require("minimatch") + +minimatch("bar.foo", "*.foo") // true! +minimatch("bar.foo", "*.bar") // false! +minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! +``` + +## Features + +Supports these glob features: + +* Brace Expansion +* Extended glob matching +* "Globstar" `**` matching + +See: + +* `man sh` +* `man bash` +* `man 3 fnmatch` +* `man 5 gitignore` + +## Minimatch Class + +Create a minimatch object by instanting the `minimatch.Minimatch` class. + +```javascript +var Minimatch = require("minimatch").Minimatch +var mm = new Minimatch(pattern, options) +``` + +### Properties + +* `pattern` The original pattern the minimatch object represents. +* `options` The options supplied to the constructor. +* `set` A 2-dimensional array of regexp or string expressions. + Each row in the + array corresponds to a brace-expanded pattern. Each item in the row + corresponds to a single path-part. For example, the pattern + `{a,b/c}/d` would expand to a set of patterns like: + + [ [ a, d ] + , [ b, c, d ] ] + + If a portion of the pattern doesn't have any "magic" in it + (that is, it's something like `"foo"` rather than `fo*o?`), then it + will be left as a string rather than converted to a regular + expression. + +* `regexp` Created by the `makeRe` method. A single regular expression + expressing the entire pattern. This is useful in cases where you wish + to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. +* `negate` True if the pattern is negated. +* `comment` True if the pattern is a comment. +* `empty` True if the pattern is `""`. + +### Methods + +* `makeRe` Generate the `regexp` member if necessary, and return it. + Will return `false` if the pattern is invalid. +* `match(fname)` Return true if the filename matches the pattern, or + false otherwise. +* `matchOne(fileArray, patternArray, partial)` Take a `/`-split + filename, and match it against a single row in the `regExpSet`. This + method is mainly for internal use, but is exposed so that it can be + used by a glob-walker that needs to avoid excessive filesystem calls. + +All other methods are internal, and will be called as necessary. + +## Functions + +The top-level exported function has a `cache` property, which is an LRU +cache set to store 100 items. So, calling these methods repeatedly +with the same pattern and options will use the same Minimatch object, +saving the cost of parsing it multiple times. + +### minimatch(path, pattern, options) + +Main export. Tests a path against the pattern using the options. + +```javascript +var isJS = minimatch(file, "*.js", { matchBase: true }) +``` + +### minimatch.filter(pattern, options) + +Returns a function that tests its +supplied argument, suitable for use with `Array.filter`. Example: + +```javascript +var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) +``` + +### minimatch.match(list, pattern, options) + +Match against the list of +files, in the style of fnmatch or glob. If nothing is matched, and +options.nonull is set, then return a list containing the pattern itself. + +```javascript +var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) +``` + +### minimatch.makeRe(pattern, options) + +Make a regular expression object from the pattern. + +## Options + +All options are `false` by default. + +### debug + +Dump a ton of stuff to stderr. + +### nobrace + +Do not expand `{a,b}` and `{1..3}` brace sets. + +### noglobstar + +Disable `**` matching against multiple folder names. + +### dot + +Allow patterns to match filenames starting with a period, even if +the pattern does not explicitly have a period in that spot. + +Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` +is set. + +### noext + +Disable "extglob" style patterns like `+(a|b)`. + +### nocase + +Perform a case-insensitive match. + +### nonull + +When a match is not found by `minimatch.match`, return a list containing +the pattern itself if this option is set. When not set, an empty list +is returned if there are no matches. + +### matchBase + +If set, then patterns without slashes will be matched +against the basename of the path if it contains slashes. For example, +`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. + +### nocomment + +Suppress the behavior of treating `#` at the start of a pattern as a +comment. + +### nonegate + +Suppress the behavior of treating a leading `!` character as negation. + +### flipNegate + +Returns from negate expressions the same as if they were not negated. +(Ie, true on a hit, false on a miss.) + + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between minimatch and other +implementations, and are intentional. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then minimatch.match returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/minimatch.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/minimatch.js new file mode 100644 index 00000000000000..ec4c05c570c52e --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/minimatch.js @@ -0,0 +1,912 @@ +module.exports = minimatch +minimatch.Minimatch = Minimatch + +var path = { sep: '/' } +try { + path = require('path') +} catch (er) {} + +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} +var expand = require('brace-expansion') + +// any single thing other than / +// don't need to escape / when using new RegExp() +var qmark = '[^/]' + +// * => any number of characters +var star = qmark + '*?' + +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' + +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' + +// characters that need to be escaped in RegExp. +var reSpecials = charSet('().*{}+?[]^$\\!') + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split('').reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + a = a || {} + b = b || {} + var t = {} + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return minimatch + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig.minimatch(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return Minimatch + return minimatch.defaults(def).Minimatch +} + +function minimatch (p, pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false + } + + // "" only matches "" + if (pattern.trim() === '') return p === '' + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options) + } + + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } + + if (!options) options = {} + pattern = pattern.trim() + + // windows support: need to use /, not \ + if (path.sep !== '/') { + pattern = pattern.split(path.sep).join('/') + } + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function () {} + +Minimatch.prototype.make = make +function make () { + // don't do it more than once. + if (this._made) return + + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = console.error + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return s.indexOf(false) === -1 + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + var negate = false + var options = this.options + var negateOffset = 0 + + if (options.nonegate) return + + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { + negate = !negate + negateOffset++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options) +} + +Minimatch.prototype.braceExpand = braceExpand + +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options + } else { + options = {} + } + } + + pattern = typeof pattern === 'undefined' + ? this.pattern : pattern + + if (typeof pattern === 'undefined') { + throw new Error('undefined pattern') + } + + if (options.nobrace || + !pattern.match(/\{.*\}/)) { + // shortcut. no need to expand. + return [pattern] + } + + return expand(pattern) +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + var options = this.options + + // shortcuts + if (!options.noglobstar && pattern === '**') return GLOBSTAR + if (pattern === '') return '' + + var re = '' + var hasMagic = !!options.nocase + var escaping = false + // ? => one single character + var patternListStack = [] + var negativeLists = [] + var plType + var stateChar + var inClass = false + var reClassStart = -1 + var classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + var self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star + hasMagic = true + break + case '?': + re += qmark + hasMagic = true + break + default: + re += '\\' + stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for (var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += '\\' + c + escaping = false + continue + } + + switch (c) { + case '/': + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + + case '\\': + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === '!' && i === classStart + 1) c = '^' + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case '(': + if (inClass) { + re += '(' + continue + } + + if (!stateChar) { + re += '\\(' + continue + } + + plType = stateChar + patternListStack.push({ + type: plType, + start: i - 1, + reStart: re.length + }) + // negation is (?:(?!js)[^/]*) + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ')': + if (inClass || !patternListStack.length) { + re += '\\)' + continue + } + + clearStateChar() + hasMagic = true + re += ')' + var pl = patternListStack.pop() + plType = pl.type + // negation is (?:(?!js)[^/]*) + // The others are (?:) + switch (plType) { + case '!': + negativeLists.push(pl) + re += ')[^/]*?)' + pl.reEnd = re.length + break + case '?': + case '+': + case '*': + re += plType + break + case '@': break // the default anyway + } + continue + + case '|': + if (inClass || !patternListStack.length || escaping) { + re += '\\|' + escaping = false + continue + } + + clearStateChar() + re += '|' + continue + + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += '\\' + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c + escaping = false + continue + } + + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + if (inClass) { + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === '^' && inClass)) { + re += '\\' + } + + re += c + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + 3) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\' + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }) + + this.debug('tail=%j\n %s', tail, tail) + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case '.': + case '[': + case '(': addPatternStart = true + } + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] + + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) + + nlLast += nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter + + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } + + if (addPatternStart) { + re = patternStart + re + } + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? 'i' : '' + var regExp = new RegExp('^' + re + '$', flags) + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) { + this.regexp = false + return this.regexp + } + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + var flags = options.nocase ? 'i' : '' + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|') + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' + + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' + + try { + this.regexp = new RegExp(re, flags) + } catch (ex) { + this.regexp = false + } + return this.regexp +} + +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = match +function match (f, partial) { + this.debug('match', f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === '' + + if (f === '/' && partial) return true + + var options = this.options + + // windows: need to use /, not \ + if (path.sep !== '/') { + f = f.split(path.sep).join('/') + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, 'set', set) + + // Find the basename of the path by looking for the last non-empty segment + var filename + var i + for (i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (i = 0; i < set.length; i++) { + var pattern = set[i] + var file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) + + this.debug('matchOne', file.length, pattern.length) + + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++) { + this.debug('matchOne loop') + var p = pattern[pi] + var f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + var pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr) + break + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr++ + } + } + + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === 'string') { + if (options.nocase) { + hit = f.toLowerCase() === p.toLowerCase() + } else { + hit = f === p + } + this.debug('string match', p, f, hit) + } else { + hit = f.match(p) + this.debug('pattern match', p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') + return emptyFileEnd + } + + // should be unreachable. + throw new Error('wtf?') +} + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, '$1') +} + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') +} diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore new file mode 100644 index 00000000000000..353546af2368e1 --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore @@ -0,0 +1,3 @@ +test +.gitignore +.travis.yml diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md new file mode 100644 index 00000000000000..b0d793ed5d9016 --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md @@ -0,0 +1,122 @@ +# brace-expansion + +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +as known from sh/bash, in JavaScript. + +[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) +[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) + +[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) + +## Example + +```js +var expand = require('brace-expansion'); + +expand('file-{a,b,c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('-v{,,}') +// => ['-v', '-v', '-v'] + +expand('file{0..2}.jpg') +// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] + +expand('file-{a..c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('file{2..0}.jpg') +// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] + +expand('file{0..4..2}.jpg') +// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] + +expand('file-{a..e..2}.jpg') +// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] + +expand('file{00..10..5}.jpg') +// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] + +expand('{{A..C},{a..c}}') +// => ['A', 'B', 'C', 'a', 'b', 'c'] + +expand('ppp{,config,oe{,conf}}') +// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] +``` + +## API + +```js +var expand = require('brace-expansion'); +``` + +### var expanded = expand(str) + +Return an array of all possible and valid expansions of `str`. If none are +found, `[str]` is returned. + +Valid expansions are: + +```js +/^(.*,)+(.+)?$/ +// {a,b,...} +``` + +A comma seperated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +A numeric sequence from `x` to `y` inclusive, with optional increment. +If `x` or `y` start with a leading `0`, all the numbers will be padded +to have equal length. Negative numbers and backwards iteration work too. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +An alphabetic sequence from `x` to `y` inclusive, with optional increment. +`x` and `y` must be exactly one character, and if given, `incr` must be a +number. + +For compatibility reasons, the string `${` is not eligible for brace expansion. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install brace-expansion +``` + +## Contributors + +- [Julian Gruber](https://github.com/juliangruber) +- [Isaac Z. Schlueter](https://github.com/isaacs) + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js new file mode 100644 index 00000000000000..36cde4de5c114b --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js @@ -0,0 +1,7 @@ +var expand = require('./'); + +console.log(expand('http://any.org/archive{1996..1999}/vol{1..4}/part{a,b,c}.html')); +console.log(expand('http://www.numericals.com/file{1..100..10}.txt')); +console.log(expand('http://www.letters.com/file{a..z..2}.txt')); +console.log(expand('mkdir /usr/local/src/bash/{old,new,dist,bugs}')); +console.log(expand('chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}')); diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js new file mode 100644 index 00000000000000..abe535df327354 --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js @@ -0,0 +1,190 @@ +var concatMap = require('concat-map'); +var balanced = require('balanced-match'); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = /^(.*,)+(.+)?$/.test(m.body); + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + + return expansions; +} diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore new file mode 100644 index 00000000000000..fd4f2b066b339e --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore @@ -0,0 +1,2 @@ +node_modules +.DS_Store diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/.travis.yml b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml similarity index 100% rename from tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/.travis.yml rename to deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md new file mode 100644 index 00000000000000..2cdc8e4148cc0a --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md @@ -0,0 +1,21 @@ +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile new file mode 100644 index 00000000000000..dd2730cfde0cab --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile @@ -0,0 +1,5 @@ + +test: + @node_modules/.bin/tape test/*.js + +.PHONY: test diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md new file mode 100644 index 00000000000000..421f3aa5f951a2 --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md @@ -0,0 +1,89 @@ +# balanced-match + +Match balanced string pairs, like `{` and `}` or `` and ``. + +[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) +[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) + +[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) + +## Example + +Get the first matching pair of braces: + +```js +var balanced = require('balanced-match'); + +console.log(balanced('{', '}', 'pre{in{nested}}post')); +console.log(balanced('{', '}', 'pre{first}between{second}post')); +``` + +The matches are: + +```bash +$ node example.js +{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } +{ start: 3, + end: 9, + pre: 'pre', + body: 'first', + post: 'between{second}post' } +``` + +## API + +### var m = balanced(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +object with those keys: + +* **start** the index of the first match of `a` +* **end** the index of the matching `b` +* **pre** the preamble, `a` and `b` not included +* **body** the match, `a` and `b` not included +* **post** the postscript, `a` and `b` not included + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`. + +### var r = balanced.range(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +array with indexes: `[
      , ]`. + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]`. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install balanced-match +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js new file mode 100644 index 00000000000000..9ce76f480a4321 --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js @@ -0,0 +1,4 @@ +var balanced = require('./'); + +console.log(balanced('{', '}', 'pre{in{nested}}post')); +console.log(balanced('{', '}', 'pre{first}between{second}post')); diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js new file mode 100644 index 00000000000000..75f3d71cba90bc --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js @@ -0,0 +1,50 @@ +module.exports = balanced; +function balanced(a, b, str) { + var r = range(a, b, str); + + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} + +balanced.range = range; +function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; + + if (ai >= 0 && bi > 0) { + begs = []; + left = str.length; + + while (i < str.length && i >= 0 && ! result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + + bi = str.indexOf(b, i + 1); + } + + i = ai < bi && ai >= 0 ? ai : bi; + } + + if (begs.length) { + result = [ left, right ]; + } + } + + return result; +} diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json new file mode 100644 index 00000000000000..24523f3bb16b79 --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json @@ -0,0 +1,100 @@ +{ + "_args": [ + [ + "balanced-match@^0.3.0", + "/Users/rebecca/code/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" + ], + [ + "balanced-match@^0.3.0", + "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" + ] + ], + "_from": "balanced-match@>=0.3.0 <0.4.0", + "_id": "balanced-match@0.3.0", + "_inCache": true, + "_installable": true, + "_location": "/read-package-json/glob/minimatch/brace-expansion/balanced-match", + "_nodeVersion": "4.2.1", + "_npmUser": { + "email": "julian@juliangruber.com", + "name": "juliangruber" + }, + "_npmVersion": "2.14.7", + "_phantomChildren": {}, + "_requested": { + "name": "balanced-match", + "raw": "balanced-match@^0.3.0", + "rawSpec": "^0.3.0", + "scope": null, + "spec": ">=0.3.0 <0.4.0", + "type": "range" + }, + "_requiredBy": [ + "/read-package-json/glob/minimatch/brace-expansion" + ], + "_shrinkwrap": null, + "_spec": "balanced-match@^0.3.0", + "_where": "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion", + "author": { + "email": "mail@juliangruber.com", + "name": "Julian Gruber", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/balanced-match/issues" + }, + "dependencies": {}, + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "devDependencies": { + "tape": "~4.2.2" + }, + "directories": {}, + "dist": { + "shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756", + "tarball": "http://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz" + }, + "gitHead": "a7114b0986554787e90b7ac595a043ca75ea77e5", + "homepage": "https://github.com/juliangruber/balanced-match", + "keywords": [ + "match", + "regexp", + "test", + "balanced", + "parse" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "email": "julian@juliangruber.com", + "name": "juliangruber" + } + ], + "name": "balanced-match", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "scripts": { + "test": "make test" + }, + "testling": { + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ], + "files": "test/*.js" + }, + "version": "0.3.0" +} diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js new file mode 100644 index 00000000000000..f5e98e3f2a3240 --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js @@ -0,0 +1,84 @@ +var test = require('tape'); +var balanced = require('..'); + +test('balanced', function(t) { + t.deepEqual(balanced('{', '}', 'pre{in{nest}}post'), { + start: 3, + end: 12, + pre: 'pre', + body: 'in{nest}', + post: 'post' + }); + t.deepEqual(balanced('{', '}', '{{{{{{{{{in}post'), { + start: 8, + end: 11, + pre: '{{{{{{{{', + body: 'in', + post: 'post' + }); + t.deepEqual(balanced('{', '}', 'pre{body{in}post'), { + start: 8, + end: 11, + pre: 'pre{body', + body: 'in', + post: 'post' + }); + t.deepEqual(balanced('{', '}', 'pre}{in{nest}}post'), { + start: 4, + end: 13, + pre: 'pre}', + body: 'in{nest}', + post: 'post' + }); + t.deepEqual(balanced('{', '}', 'pre{body}between{body2}post'), { + start: 3, + end: 8, + pre: 'pre', + body: 'body', + post: 'between{body2}post' + }); + t.notOk(balanced('{', '}', 'nope'), 'should be notOk'); + t.deepEqual(balanced('', '', 'preinnestpost'), { + start: 3, + end: 19, + pre: 'pre', + body: 'innest', + post: 'post' + }); + t.deepEqual(balanced('', '', 'preinnestpost'), { + start: 7, + end: 23, + pre: 'pre', + body: 'innest', + post: 'post' + }); + t.deepEqual(balanced('{{', '}}', 'pre{{{in}}}post'), { + start: 3, + end: 9, + pre: 'pre', + body: '{in}', + post: 'post' + }); + t.deepEqual(balanced('{{{', '}}', 'pre{{{in}}}post'), { + start: 3, + end: 8, + pre: 'pre', + body: 'in', + post: '}post' + }); + t.deepEqual(balanced('{', '}', 'pre{{first}in{second}post'), { + start: 4, + end: 10, + pre: 'pre{', + body: 'first', + post: 'in{second}post' + }); + t.deepEqual(balanced('', 'prepost'), { + start: 3, + end: 4, + pre: 'pre', + body: '', + post: 'post' + }); + t.end(); +}); diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml new file mode 100644 index 00000000000000..f1d0f13c8a54d0 --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.4 + - 0.6 diff --git a/tools/eslint/node_modules/optionator/node_modules/wordwrap/LICENSE b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/wordwrap/LICENSE rename to deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown new file mode 100644 index 00000000000000..408f70a1be473c --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown @@ -0,0 +1,62 @@ +concat-map +========== + +Concatenative mapdashery. + +[![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map) + +[![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map) + +example +======= + +``` js +var concatMap = require('concat-map'); +var xs = [ 1, 2, 3, 4, 5, 6 ]; +var ys = concatMap(xs, function (x) { + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; +}); +console.dir(ys); +``` + +*** + +``` +[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ] +``` + +methods +======= + +``` js +var concatMap = require('concat-map') +``` + +concatMap(xs, fn) +----------------- + +Return an array of concatenated elements by calling `fn(x, i)` for each element +`x` and each index `i` in the array `xs`. + +When `fn(x, i)` returns an array, its result will be concatenated with the +result array. If `fn(x, i)` returns anything else, that value will be pushed +onto the end of the result array. + +install +======= + +With [npm](http://npmjs.org) do: + +``` +npm install concat-map +``` + +license +======= + +MIT + +notes +===== + +This module was written while sitting high above the ground in a tree. diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js new file mode 100644 index 00000000000000..33656217b61d8f --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js @@ -0,0 +1,6 @@ +var concatMap = require('../'); +var xs = [ 1, 2, 3, 4, 5, 6 ]; +var ys = concatMap(xs, function (x) { + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; +}); +console.dir(ys); diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js new file mode 100644 index 00000000000000..b29a7812e5055a --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js @@ -0,0 +1,13 @@ +module.exports = function (xs, fn) { + var res = []; + for (var i = 0; i < xs.length; i++) { + var x = fn(xs[i], i); + if (isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json new file mode 100644 index 00000000000000..177d7a5f196dcf --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json @@ -0,0 +1,111 @@ +{ + "_args": [ + [ + "concat-map@0.0.1", + "/Users/rebecca/code/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" + ], + [ + "concat-map@0.0.1", + "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" + ] + ], + "_from": "concat-map@0.0.1", + "_id": "concat-map@0.0.1", + "_inCache": true, + "_installable": true, + "_location": "/read-package-json/glob/minimatch/brace-expansion/concat-map", + "_npmUser": { + "email": "mail@substack.net", + "name": "substack" + }, + "_npmVersion": "1.3.21", + "_phantomChildren": {}, + "_requested": { + "name": "concat-map", + "raw": "concat-map@0.0.1", + "rawSpec": "0.0.1", + "scope": null, + "spec": "0.0.1", + "type": "version" + }, + "_requiredBy": [ + "/read-package-json/glob/minimatch/brace-expansion" + ], + "_shrinkwrap": null, + "_spec": "concat-map@0.0.1", + "_where": "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion", + "author": { + "email": "mail@substack.net", + "name": "James Halliday", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/node-concat-map/issues" + }, + "dependencies": {}, + "description": "concatenative mapdashery", + "devDependencies": { + "tape": "~2.4.0" + }, + "directories": { + "example": "example", + "test": "test" + }, + "dist": { + "shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", + "tarball": "http://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + }, + "homepage": "https://github.com/substack/node-concat-map", + "keywords": [ + "concat", + "concatMap", + "map", + "functional", + "higher-order" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "email": "mail@substack.net", + "name": "substack" + } + ], + "name": "concat-map", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/substack/node-concat-map.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "testling": { + "browsers": { + "chrome": [ + 10, + 22 + ], + "ff": [ + 3.5, + 10, + 15 + ], + "ie": [ + 6, + 7, + 8, + 9 + ], + "opera": [ + 12 + ], + "safari": [ + 5.1 + ] + }, + "files": "test/*.js" + }, + "version": "0.0.1" +} diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js new file mode 100644 index 00000000000000..fdbd7022f6da17 --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js @@ -0,0 +1,39 @@ +var concatMap = require('../'); +var test = require('tape'); + +test('empty or not', function (t) { + var xs = [ 1, 2, 3, 4, 5, 6 ]; + var ixes = []; + var ys = concatMap(xs, function (x, ix) { + ixes.push(ix); + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; + }); + t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]); + t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]); + t.end(); +}); + +test('always something', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function (x) { + return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ]; + }); + t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); + t.end(); +}); + +test('scalars', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function (x) { + return x === 'b' ? [ 'B', 'B', 'B' ] : x; + }); + t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); + t.end(); +}); + +test('undefs', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function () {}); + t.same(ys, [ undefined, undefined, undefined, undefined ]); + t.end(); +}); diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json new file mode 100644 index 00000000000000..94b5f9c010285d --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json @@ -0,0 +1,106 @@ +{ + "_args": [ + [ + "brace-expansion@^1.0.0", + "/Users/rebecca/code/npm/node_modules/glob/node_modules/minimatch" + ], + [ + "brace-expansion@^1.0.0", + "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch" + ] + ], + "_from": "brace-expansion@>=1.0.0 <2.0.0", + "_id": "brace-expansion@1.1.3", + "_inCache": true, + "_installable": true, + "_location": "/read-package-json/glob/minimatch/brace-expansion", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-6-west.internal.npmjs.com", + "tmp": "tmp/brace-expansion-1.1.3.tgz_1455216688668_0.948847763473168" + }, + "_npmUser": { + "email": "julian@juliangruber.com", + "name": "juliangruber" + }, + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "name": "brace-expansion", + "raw": "brace-expansion@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/read-package-json/glob/minimatch" + ], + "_shrinkwrap": null, + "_spec": "brace-expansion@^1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch", + "author": { + "email": "mail@juliangruber.com", + "name": "Julian Gruber", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/brace-expansion/issues" + }, + "dependencies": { + "balanced-match": "^0.3.0", + "concat-map": "0.0.1" + }, + "description": "Brace expansion as known from sh/bash", + "devDependencies": { + "tape": "4.4.0" + }, + "directories": {}, + "dist": { + "shasum": "46bff50115d47fc9ab89854abb87d98078a10991", + "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz" + }, + "gitHead": "f0da1bb668e655f67b6b2d660c6e1c19e2a6f231", + "homepage": "https://github.com/juliangruber/brace-expansion", + "keywords": [], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "email": "julian@juliangruber.com", + "name": "juliangruber" + }, + { + "email": "isaacs@npmjs.com", + "name": "isaacs" + } + ], + "name": "brace-expansion", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/brace-expansion.git" + }, + "scripts": { + "gentest": "bash test/generate.sh", + "test": "tape test/*.js" + }, + "testling": { + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ], + "files": "test/*.js" + }, + "version": "1.1.3" +} diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/package.json b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/package.json new file mode 100644 index 00000000000000..c2f6fff778e6df --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/package.json @@ -0,0 +1,87 @@ +{ + "_args": [ + [ + "minimatch@2 || 3", + "/Users/rebecca/code/npm/node_modules/glob" + ], + [ + "minimatch@2 || 3", + "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob" + ] + ], + "_from": "minimatch@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", + "_id": "minimatch@3.0.0", + "_inCache": true, + "_installable": true, + "_location": "/read-package-json/glob/minimatch", + "_nodeVersion": "4.0.0", + "_npmUser": { + "email": "isaacs@npmjs.com", + "name": "isaacs" + }, + "_npmVersion": "3.3.2", + "_phantomChildren": {}, + "_requested": { + "name": "minimatch", + "raw": "minimatch@2 || 3", + "rawSpec": "2 || 3", + "scope": null, + "spec": ">=2.0.0 <3.0.0||>=3.0.0 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/read-package-json/glob" + ], + "_shrinkwrap": null, + "_spec": "minimatch@2 || 3", + "_where": "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob", + "author": { + "email": "i@izs.me", + "name": "Isaac Z. Schlueter", + "url": "http://blog.izs.me" + }, + "bugs": { + "url": "https://github.com/isaacs/minimatch/issues" + }, + "dependencies": { + "brace-expansion": "^1.0.0" + }, + "description": "a glob matcher in javascript", + "devDependencies": { + "standard": "^3.7.2", + "tap": "^1.2.0" + }, + "directories": {}, + "dist": { + "shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83", + "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz" + }, + "engines": { + "node": "*" + }, + "files": [ + "minimatch.js" + ], + "gitHead": "270dbea567f0af6918cb18103e98c612aa717a20", + "homepage": "https://github.com/isaacs/minimatch#readme", + "license": "ISC", + "main": "minimatch.js", + "maintainers": [ + { + "email": "i@izs.me", + "name": "isaacs" + } + ], + "name": "minimatch", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "scripts": { + "posttest": "standard minimatch.js test/*.js", + "test": "tap test/*.js" + }, + "version": "3.0.0" +} diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/index.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/index.js new file mode 100644 index 00000000000000..19f103f908ac72 --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/index.js @@ -0,0 +1,20 @@ +'use strict'; + +function posix(path) { + return path.charAt(0) === '/'; +}; + +function win32(path) { + // https://github.com/joyent/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 + var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; + var result = splitDeviceRe.exec(path); + var device = result[1] || ''; + var isUnc = !!device && device.charAt(1) !== ':'; + + // UNC paths are always absolute + return !!result[2] || isUnc; +}; + +module.exports = process.platform === 'win32' ? win32 : posix; +module.exports.posix = posix; +module.exports.win32 = win32; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/license b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/license similarity index 100% rename from deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/license rename to deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/license diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/package.json b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/package.json new file mode 100644 index 00000000000000..2bff7fef55bbc1 --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/package.json @@ -0,0 +1,99 @@ +{ + "_args": [ + [ + "path-is-absolute@^1.0.0", + "/Users/rebecca/code/npm/node_modules/glob" + ], + [ + "path-is-absolute@^1.0.0", + "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob" + ] + ], + "_from": "path-is-absolute@>=1.0.0 <2.0.0", + "_id": "path-is-absolute@1.0.0", + "_inCache": true, + "_installable": true, + "_location": "/read-package-json/glob/path-is-absolute", + "_nodeVersion": "0.12.0", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_npmVersion": "2.5.1", + "_phantomChildren": {}, + "_requested": { + "name": "path-is-absolute", + "raw": "path-is-absolute@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/read-package-json/glob" + ], + "_shrinkwrap": null, + "_spec": "path-is-absolute@^1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/path-is-absolute/issues" + }, + "dependencies": {}, + "description": "Node.js 0.12 path.isAbsolute() ponyfill", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912", + "tarball": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "7a76a0c9f2263192beedbe0a820e4d0baee5b7a1", + "homepage": "https://github.com/sindresorhus/path-is-absolute", + "keywords": [ + "path", + "paths", + "file", + "dir", + "absolute", + "isabsolute", + "is-absolute", + "built-in", + "util", + "utils", + "core", + "ponyfill", + "polyfill", + "shim", + "is", + "detect", + "check" + ], + "license": "MIT", + "maintainers": [ + { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + } + ], + "name": "path-is-absolute", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/path-is-absolute.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md new file mode 100644 index 00000000000000..cdf94f4309a27e --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md @@ -0,0 +1,51 @@ +# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute) + +> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) ponyfill + +> Ponyfill: A polyfill that doesn't overwrite the native method + + +## Install + +``` +$ npm install --save path-is-absolute +``` + + +## Usage + +```js +var pathIsAbsolute = require('path-is-absolute'); + +// Linux +pathIsAbsolute('/home/foo'); +//=> true + +// Windows +pathIsAbsolute('C:/Users/'); +//=> true + +// Any OS +pathIsAbsolute.posix('/home/foo'); +//=> true +``` + + +## API + +See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path). + +### pathIsAbsolute(path) + +### pathIsAbsolute.posix(path) + +The Posix specific version. + +### pathIsAbsolute.win32(path) + +The Windows specific version. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/package.json b/deps/npm/node_modules/read-package-json/node_modules/glob/package.json new file mode 100644 index 00000000000000..6070250b2020d4 --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/package.json @@ -0,0 +1,98 @@ +{ + "_args": [ + [ + "glob@^6.0.0", + "/Users/rebecca/code/npm/node_modules/read-package-json" + ] + ], + "_from": "glob@>=6.0.0 <7.0.0", + "_id": "glob@6.0.4", + "_inCache": true, + "_installable": true, + "_location": "/read-package-json/glob", + "_nodeVersion": "4.0.0", + "_npmUser": { + "email": "i@izs.me", + "name": "isaacs" + }, + "_npmVersion": "2.14.15", + "_phantomChildren": {}, + "_requested": { + "name": "glob", + "raw": "glob@^6.0.0", + "rawSpec": "^6.0.0", + "scope": null, + "spec": ">=6.0.0 <7.0.0", + "type": "range" + }, + "_requiredBy": [ + "/read-package-json" + ], + "_resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", + "_shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22", + "_shrinkwrap": null, + "_spec": "glob@^6.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/read-package-json", + "author": { + "email": "i@izs.me", + "name": "Isaac Z. Schlueter", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/node-glob/issues" + }, + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "description": "a little globber", + "devDependencies": { + "mkdirp": "0", + "rimraf": "^2.2.8", + "tap": "^5.0.0", + "tick": "0.0.6" + }, + "directories": {}, + "dist": { + "shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22", + "tarball": "http://registry.npmjs.org/glob/-/glob-6.0.4.tgz" + }, + "engines": { + "node": "*" + }, + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "gitHead": "3bd419c538737e56fda7e21c21ff52ca0c198df6", + "homepage": "https://github.com/isaacs/node-glob#readme", + "license": "ISC", + "main": "glob.js", + "maintainers": [ + { + "email": "i@izs.me", + "name": "isaacs" + } + ], + "name": "glob", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "scripts": { + "bench": "bash benchmark.sh", + "benchclean": "node benchclean.js", + "prepublish": "npm run benchclean", + "prof": "bash prof.sh && cat profile.txt", + "profclean": "rm -f v8.log profile.txt", + "test": "tap test/*.js --cov", + "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js" + }, + "version": "6.0.4" +} diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/sync.js b/deps/npm/node_modules/read-package-json/node_modules/glob/sync.js new file mode 100644 index 00000000000000..09883d2ce0c9de --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/sync.js @@ -0,0 +1,460 @@ +module.exports = globSync +globSync.GlobSync = GlobSync + +var fs = require('fs') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var Glob = require('./glob.js').Glob +var util = require('util') +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = fs.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this.matches[index][e] = true + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + var abs = this._makeAbs(e) + if (this.mark) + e = this._mark(e) + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[this._makeAbs(e)] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + // lstat failed, doesn't exist + return null + } + + var isSym = lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + this.cache[this._makeAbs(f)] = 'FILE' + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this.matches[index][prefix] = true +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + return false + } + + if (lstat.isSymbolicLink()) { + try { + stat = fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c !== 'DIR') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/LICENSE b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/LICENSE index e637724b3bc595..c3d2eb3550079b 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/LICENSE +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/LICENSE @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/.editorconfig b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/.editorconfig deleted file mode 100644 index 8de2a35e3a2b74..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/.editorconfig +++ /dev/null @@ -1,19 +0,0 @@ -root = true - -[*] -charset = utf-8 -end_of_line = lf -trim_trailing_whitespace = true -insert_final_newline = true - -[{.,}*.{js,json,json5,yml,yaml}] -indent_style = space -indent_size = 2 - -[*.md] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -[Makefile] -indent_style = tab diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/.npmignore b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/.npmignore index b561496c91d48f..5ae40150eea106 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/.npmignore +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/.npmignore @@ -1,6 +1,9 @@ package.json node_modules -test/external +test +benchmark +docs examples +/.editorconfig /.eslint* /.travis.yml diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/README.md b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/README.md index 85d52a2dcea030..3d61083fb04dd0 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/README.md +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/README.md @@ -240,4 +240,3 @@ JSON.stringify will split this into 15 lines, and it's hard to read. Yet again, this feature comes with a performance hit, so if user experience matters to you more than performance, use this module. If your JSON will be consumed by machines, use JSON.stringify instead. As a rule of thumb, if you use "space" argument to indent your JSON, you'd better use this module instead. - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/benchmark/benchmark.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/benchmark/benchmark.js deleted file mode 100755 index 28a6aad75ad937..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/benchmark/benchmark.js +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env node - -var Benchmark = require('benchmark') -var YAML = require('js-yaml') -var JJU = require('../') -var JSON5 = require('json5') -var suite = new Benchmark.Suite - -var sample -sample = require('fs').readFileSync(__dirname + '/../package.yaml') -sample = YAML.safeLoad(sample) -sample = JSON.stringify(sample) - -var functions = { - 'JSON': function(x) { JSON.parse(x) }, - 'JSON5': function(x) { JSON5.parse(x) }, - 'JJU': function(x) { JJU.parse(x) }, - 'JS-YAML': function(x) { YAML.safeLoad(x) }, -} - -for (var name in functions) { - with ({ fn: functions[name] }) { - suite.add(name, { - onCycle: function onCycle(event) { - process.stdout.write('\r\033[2K - ' + event.target) - }, - fn: function () { - fn(sample) - }, - }) - } -} - -console.log() -suite.on('cycle', function(event) { - console.log('\r\033[2K + ' + String(event.target)) -}) -.run() - -process.on('exit', function() { console.log() }) diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/benchmark/package.json b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/benchmark/package.json deleted file mode 100644 index 7f0dcf08b7209d..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/benchmark/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "benchmarks", - "private": true, - "dependencies": { - "json5": "*", - "js-yaml": "*", - "benchmark": "*" - } -} diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/docs/Grammar.md b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/docs/Grammar.md deleted file mode 100644 index eb7c8bc667fd54..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/docs/Grammar.md +++ /dev/null @@ -1,219 +0,0 @@ - -JSON5 grammar expressed in EBNF form. - -PS: I don't know what is appropriate syntax highlighter for this, so I'm using "modula2" because why not. I also inserted after backslash to preserve syntax highlighting, this character has nothing to do with actual JSON5 syntax and should be ignored. - -```modula2 -json5_text = expression_with_whitespace - -expression_with_whitespace = [white_space] , expression , [white_space] - -expression = literal - | array_literal - | object_literal - -literal = null_literal - | boolean_literal - | signed_numeric_literal - | string_literal - -null_literal = 'null' - -boolean_literal = 'true' - | 'false' - -(* Source Characters *) - -source_character = . - (* any Unicode code unit *) - -line_terminator = - | - | - | - -line_terminator_sequence = - | - | - | - | , - -white_space = white_space_element - | white_space , white_space_element - -white_space_element = white_space_character - | comment - -white_space_character = - | - | - | - | - | - | - -comment = multi_line_comment - | single_line_comment - -multi_line_comment = '/*' , [multi_line_comment_chars] , '*/' - -multi_line_comment_chars = (source_character - '*') , [multi_line_comment_chars] - | '*' , [post_asterisk_comment_chars] - -post_asterisk_comment_chars = (source_character - ('*' | '/')) , [multi_line_comment_chars] - | '*' , [post_asterisk_comment_chars] - -single_line_comment = '//' , [single_line_comment_chars] - -single_line_comment_chars = single_line_comment_char , single_line_comment_chars - -single_line_comment_char = source_character - line_terminator - -(* Character classes *) - -decimal_digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' - -non_zero_digit = decimal_digit - '0' - -hex_digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'a' - | 'b' | 'c' | 'd' | 'e' | 'f' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' - -ascii_letter = ascii_letter_lowercase - | ascii_letter_uppercase - -ascii_letter_lowercase = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' - | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' - | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z' - -ascii_letter_uppercase = 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' - | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' - | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z' - -(* Numeric Literals *) - -signed_numeric_literal = '-' , numeric_literal - | '+' , numeric_literal - | numeric_literal - -numeric_literal = decimal_literal - | hex_integer_literal - | non_finite_literal - -non_finite_literal = 'Infinity' - | 'NaN' - -decimal_literal = decimal_integer_literal , '.' , [decimal_digits] , [exponent_part] - | '.' , decimal_digits , [exponent_part] - | decimal_integer_literal , [exponent_part] - -decimal_integer_literal = '0' - | non_zero_digit , [decimal_digits] - -decimal_digits = decimal_digit - | decimal_digits , decimal_digit - -exponent_part = exponent_indicator , signed_integer - -exponent_indicator = 'e' | 'E' - -signed_integer = decimal_digits - | '+' , decimal_digits - | '-' , decimal_digits - -hex_integer_literal = '0x' , hex_digit - | '0X' , hex_digit - | hex_integer_literal , hex_digit - -(* String Literals *) - -string_literal = '"' , [double_string_characters] , '"' - | "'" , [single_string_characters] , "'" - -double_string_characters = double_string_character , [double_string_characters] - -single_string_characters = single_string_character , [single_string_characters] - -double_string_character = source_character - ('"' | '\​' | line_terminator) - | '\​' , escape_sequence - | line_continuation - -single_string_character = source_character - ("'" | '\​' | line_terminator) - | '\​' , escape_sequence - | line_continuation - -line_continuation = '\​' , line_terminator_sequence - -escape_sequence = character_escape_sequence - | '0' - | hex_escape_sequence - | unicode_escape_sequence - -character_escape_sequence = single_escape_character - | non_escape_character - -single_escape_character = '"' | "'" | '\​' | 'b' | 'f' | 'n' | 'r' | 't' | 'v' - -non_escape_character = source_character - (escape_character | line_terminator) - -escape_character = single_escape_character - | decimal_digit - | 'x' - | 'u' - -hex_escape_sequence = 'x' , hex_digit , hex_digit - -unicode_escape_sequence = 'u' , hex_digit , hex_digit , hex_digit , hex_digit - -(* Array Literals *) - -array_literal = '[' , [white_space] , ']' - | '[' , [white_space] , element_list , ']' - | '[' , [white_space] , element_list , ',' , [white_space] , ']' - -element_list = expression , [white_space] - | element_list , ',' , [white_space] , expression , [white_space] - -(* Object Literals *) - -object_literal = '{' , [white_space] , '}' - | '{' , [white_space] , property_name_and_value_list , '}' - | '{' , [white_space] , property_name_and_value_list , ',' , '}' - -property_name_and_value_list = property_assignment , [white_space] - | property_name_and_value_list , [white_space] , ',' , [white_space] , property_assignment , [white_space] - -property_assignment = property_name , [white_space] , ':' , [white_space] , expression - -property_name = identifier_name - | string_literal - | numeric_literal - -identifier_name = identifier_start - | identifier_name , identifier_part - -identifier_start = unicode_letter - | '$' - | '_' - | '\​' , unicode_escape_sequence - -identifier_part = identifier_start - | unicode_combining_mark - | unicode_digit - | unicode_connector_punctuation - | - | - -unicode_letter = ascii_letter - (* + any character in the Unicode categories "Uppercase letter (Lu)", "Lowercase letter (Ll)", "Titlecase letter (Lt)", "Modifier letter (Lm)", "Other letter (Lo)", or "Letter number (Nl)" *) - -unicode_combining_mark = - (* + any character in the Unicode categories "Non-spacing mark (Mn)" or "Combining spacing mark (Mc)" *) - -unicode_digit = decimal_digit - (* + any character in the Unicode category "Decimal number (Nd)" *) - -unicode_connector_punctuation = - (* + any character in the Unicode category "Connector punctuation (Pc)" *) - - -``` diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/docs/JSON5.md b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/docs/JSON5.md deleted file mode 100644 index bbe18a3d8ce213..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/docs/JSON5.md +++ /dev/null @@ -1,50 +0,0 @@ -## JSON5 syntax - -We support slighly modified version of JSON5, see https://groups.google.com/forum/#!topic/json5/3DjClVYI6Wg - -I started from ES5 specification and added a set of additional restrictions on top of ES5 spec. So I'd expect my implementation to be much closer to javascript. It's no longer an extension of json, but a reduction of ecmascript, which was my original intent. - -This JSON5 version is a subset of ES5 language, specification is here: - -http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf - -This is a language that defines data structures only, so following notes/restrictions are applied: - -- Literals (NullLiteral, BooleanLiteral, NumericLiteral, StringLiteral) are allowed. -- Compatibility syntax is not supported, which means octal literals are forbidden. -- ArrayLiterals and allowed, but instead of AssignmentExpressions you can only use other allowed Literals, ArrayLiterals and ObjectLiterals. Elisions are currently not supported. -- ObjectLiterals and allowed, but instead of AssignmentExpressions you can only use other allowed Literals, ArrayLiterals and ObjectLiterals. Setters and getters are forbidden. -- All other primary expressions ("this", Identifier, Expression) are forbidden. -- Two unary expressions ('-' and '+') allowed before NumericLiterals. -- Any data that has a number type can be represented, including +0, -0, +Infinity, -Infinity and NaN. -- "undefined" is forbidden, use null instead if applicable. -- Comments and whitespace are defined according to spec. - -Main authority here is ES5 spec, so strict backward JSON compatibility is not guaranteed. - - -If you're unsure whether a behaviour of this library is a bug or not, you can run this test: - -```javascript -JSON5.parse(String(something)) -``` - -Should always be equal to: - -```javascript -eval('(function(){return ('+String(something)+'\n)\n})()') -``` - -If `something` meets all rules above. Parens and newlines in the example above are carefully placed so comments and another newlines will work properly, so don't look so impressed about that. - - -## Weirdness of JSON5 - -These are the parts that I don't particulary like, but see no good way to fix: - - - no elisions, `[,,,] -> [null,null,null]` - - `[Object], [Circular]` aren't parsed - - no way of nicely representing multiline strings - - unicode property names are way to hard to implement - - Date and other custom objects - - incompatible with YAML (at least comments) diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/analyze.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/analyze.js index 9b0f9af01cd9e8..39303b0969081c 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/analyze.js +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/analyze.js @@ -89,4 +89,3 @@ module.exports.analyze = function analyzeJSON(input, options) { return result } - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/document.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/document.js index cfab8691fc9aba..af1a01a03d062b 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/document.js +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/document.js @@ -482,4 +482,3 @@ module.exports.Document = Document module.exports.update = function updateJSON(source, new_value, options) { return Document(source, options).update(new_value).toString() } - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js index 5f9fe998610d0f..2b7894937862d5 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js @@ -749,4 +749,3 @@ module.exports.tokenize = function tokenizeJSON(input, options) { tokens.data = module.exports.parse(input, options) return tokens } - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js index ce89d77ee1f433..754019eac551c1 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js @@ -380,4 +380,3 @@ module.exports.stringify = function stringifyJSON(object, options, _space) { return _stringify(object, options, 0, '') } - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/utils.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/utils.js index a8476b6c4630e1..dd4752c73a4078 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/utils.js +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/utils.js @@ -43,4 +43,3 @@ module.exports.middleware = function() { throw Error('this function is removed, use express-json5 instead') } } - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.json b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.json index ed34885e26881b..f1b467a6ebd039 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.json +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.json @@ -1,6 +1,6 @@ { "name": "jju", - "version": "1.2.0", + "version": "1.2.1", "description": "a set of utilities to work with JSON / JSON5 documents", "author": { "name": "Alex Kocharin", @@ -37,12 +37,12 @@ "type": "WTFPL", "url": "http://www.wtfpl.net/txt/copying/" }, - "gitHead": "6f1b2a8321cb0dfcffc50378b3632853cf529671", - "_id": "jju@1.2.0", - "_shasum": "add5b586fec853b44929d78bf94864ab577c02e9", + "gitHead": "8b079c1d03af527ab28a47c7b714d6f888abc53d", + "_id": "jju@1.2.1", + "_shasum": "edf6ec20d5d668c80c2c00cea63f8a9422a4b528", "_from": "jju@>=1.1.0 <2.0.0", "_npmVersion": "2.0.1", - "_nodeVersion": "1.1.1", + "_nodeVersion": "2.2.1", "_npmUser": { "name": "rlidwka", "email": "alex@kocharin.ru" @@ -54,10 +54,10 @@ } ], "dist": { - "shasum": "add5b586fec853b44929d78bf94864ab577c02e9", - "tarball": "http://registry.npmjs.org/jju/-/jju-1.2.0.tgz" + "shasum": "edf6ec20d5d668c80c2c00cea63f8a9422a4b528", + "tarball": "http://registry.npmjs.org/jju/-/jju-1.2.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/jju/-/jju-1.2.0.tgz", + "_resolved": "https://registry.npmjs.org/jju/-/jju-1.2.1.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml index cab7b5d0bcad28..4d81c219f19511 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml @@ -3,7 +3,7 @@ # "jju" stands for "json/json5 utils" name: jju -version: 1.2.0 +version: 1.2.1 description: a set of utilities to work with JSON / JSON5 documents author: @@ -43,4 +43,3 @@ publishConfig: license: type: WTFPL url: http://www.wtfpl.net/txt/copying/ - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/portable-json5-tests.yaml b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/portable-json5-tests.yaml deleted file mode 100644 index 5bf6ac38fe13bf..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/portable-json5-tests.yaml +++ /dev/null @@ -1,916 +0,0 @@ -# vi:set ts=2 sts=2 sw=2 et: -# -# Copyright (c) JD 2456730 Alex Kocharin -# -# Permission to use, copy, modify, and/or distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# The original file is available here: -# https://github.com/rlidwka/jju/tree/master/test/portable-json5-tests.yaml -# -# ---------------------------------------------------------------------------- -# -# Portable JSON5 test suite. -# -# This file contains an actual YAML data and it may include fancy syntax. -# If your platform does not support YAML, you might wish to pre-process it -# using a generic YAML parser. -# - -%YAML 1.2 ---- -# -# "input" is an arbitrary JSON5 you have to parse -# "output" is a normalized JSON you have to compare your result with, -# or !error (null) if your input should result in parser error -# -# Types of tests: -# -# - basic - Tests that every JSON5 parser should pass. -# -# - advanced - Tests that bring close compatibility with javascript. Not -# strictly required, but nice to have for completeness. -# -# - extra - Extra test cases you can follow at your discretion. -# -# Questionable features like elisions go to extra. All valid javascript, but -# invalid json5 also goes to extra. Feel free to ignore this section if you -# want to. Thus, eval(input) is a complete json5 parser, that should pass all -# basic and advanced tests. -# - -# Basic types in minimal form -# --------------------------- - -type-no-data: - type: extra - output: !error - input: '' - -type-null: - type: basic - output: null - input: > - null - -# undefined is not supported, -# null should be used instead -type-no-undefined: - type: extra - output: !error - input: > - undefined - -type-no-raw: - type: extra - output: !error - input: > - foobar - -type-bool-true: - type: basic - output: true - input: > - true - -type-bool-false: - type: basic - output: false - input: > - false - -type-number: - type: basic - output: 0 - input: > - 0 - -type-string: - type: basic - output: "" - input: > - "" - -type-object: - type: basic - output: {} - input: > - {} - -type-array: - type: basic - output: [] - input: > - [] - -# Numbers: special -# ---------------- - -# note: it's hard to test this -# just add `1/x < 0` check in your code somewhere -num-negative-zero: - type: extra - output: -0.0 - input: > - -0 - -num-nan: - type: basic - output: .nan - input: > - NaN - -num-signed-nan: - type: basic - output: .nan - input: > - +NaN - -num-positive-inf: - type: basic - output: +.inf - input: > - Infinity - -num-negative-inf: - type: basic - output: -.inf - input: > - -Infinity - -num-inf-exact-case: - type: extra - output: !error - input: > - INFINITY - -# Numbers: hexadecimal -# -------------------- - -num-hex-zero: - type: basic - output: 0 - input: > - 0x0 - -num-cut-hex: - type: basic - output: !error - input: > - 0x - -num-all-hex: - type: basic - output: 12841684683518 - input: > - 0xBADF00DCAFE - -num-mixed-case: - type: basic - output: 3735928559 - input: > - 0xDeAdBEef - -num-signed-hex: - type: advanced - output: 31 - input: > - +0x1F - -num-negative-hex: - type: advanced - output: -31 - input: > - -0x1f - -num-bad-hex: - type: advanced - output: !error - input: > - 0xBADxF00D - -num-no-hex-float: - type: advanced - output: !error - input: > - 0x12.345 - -# this is not actually an exponent :) -num-hex-exponent: - type: advanced - output: 4836 - input: > - 0x0012e4 - -# Numbers: octal -# -------------- - -# Octals are primarily used in config files -# to set up a file mask (like 0777) -# -# Note: they will have 0o12345 syntax instead -# of 012345 in the ES6, so we'll need to switch -# as well in the future - -num-octal: - type: extra - output: 342391 - input: > - 01234567 - -num-octal-zeroes: - type: extra - output: -24000 - input: > - -000000056700 - -num-bad-octal: - type: extra - output: !error - input: > - 012345678 - -num-no-octal-float: - type: extra - output: !error - input: > - 012.345 - -num-no-octal-exp: - type: extra - output: !error - input: > - 0123e4 - -# Numbers: floating point -# ----------------------- - -num-float: - type: basic - output: 123.456 - input: > - 123.456 - -num-signed-foat: - type: basic - output: -0.00098765 - input: > - -0.00098765 - -num-omit-trailing-mantissa: - type: basic - output: 1234000 - input: > - 1234.e3 - -num-omit-leading-mantissa: - type: advanced - output: -123.4 - input: > - -.1234e3 - -num-bad-float: - type: advanced - output: !error - input: > - 0.12.345 - -num-bad-sum: - type: extra - output: !error - input: > - 0.12+345 - -num-uc-exp: - type: advanced - output: -1230000 - input: > - -123E+4 - -num-float-exp: - type: basic - output: 123000 - input: > - 0.0123e7 - -num-bad-exp: - type: extra - output: !error - input: > - 123e7.3 - -num-bad-char: - type: extra - output: !error - input: > - 123a456 - -num-no-exp: - type: advanced - output: !error - input: > - 123e - -num-zero-exp: - type: advanced - output: -0.0 - input: > - -.00e-0 - -num-dec-base-signed-exp: - type: advanced - output: 0.00000123 - input: > - 1230000E-012 - -# String: quotes -# -------------- - -string-double-quotes: - type: basic - output: foobar - input: > - "foobar" - -string-single-quotes: - type: basic - output: foobar - input: > - 'foobar' - -string-open: - type: basic - output: !error - input: > - "\\\\\\\\\\\\\" - -string-not-open: - type: basic - output: "\\\\\\\\\\\\\\" - input: > - "\\\\\\\\\\\\\\" - -string-continuation: - type: advanced - output: " foo bar " - input: > - " foo \ - bar \ - " - -string-win-continuation: - type: advanced - output: "foobar" - input: "'foo\\\r\nbar'" - -string-win-reverse-continuation: - type: advanced - output: !error - input: "'foo\\\n\rbar'" - -string-unicode-continuation: - type: advanced - output: "foobarbaz" - input: "'foo\\\u2028bar\\\u2029baz'" - -string-multi-bad-continuation: - type: advanced - output: !error - input: > - foo\ - - bar - -string-bad-ending: - type: basic - output: !error - input: "'foo\rbar'" - -string-bad-ending-2028: - type: advanced - output: !error - input: "'foo\u2028bar'" - -string-bad-ending-2029: - type: advanced - output: !error - input: "'foo\u2029bar'" - -string-literal-unicode: - type: advanced - output: "foo\uFEFF\u2030bar\u1234" - input: "'foo\uFEFF\u2030bar\u1234'" - -string-control-char: - type: advanced - output: "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0b\x0c\x0e\x0f" - input: "'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0b\x0c\x0e\x0f'" - -# String: escape sequences -# ------------------------ - -string-octal-escape: - type: extra - output: "\x1b[1;32mhi\x1b[m??" - input: > - '\033[1;32mhi\033[m\077\077' - -string-octal-two-digits: - type: extra - output: "\n\x1c\x2e\x07890\x01" - input: > - '\12\34\56\78\90\1' - -string-octal-three-digits: - type: extra - output: "\n34.78\xff 0" - input: > - '\01234\5678\377\400' - -string-hex-escape: - type: extra - output: "\x01\x23\xab\xcd\xef" - input: > - "\x01\x23\xab\xCd\xEF" - -# \0 is *not* an octal escape sequence, -# and is allowed even in strict mode -string-zero-point: - type: basic - output: "\0" - input: > - '\0' - -string-escape-double-quotes: - type: basic - output: "\"''" - input: > - "\"'\'" - -string-escape-single-quotes: - type: basic - output: " '\"\" " - input: > - ' \'"\" ' - -string-escape-json-chars: - type: basic - output: "\\\/\b\f\n\r\t" - input: > - "\\\/\b\f\n\r\t" - -# this character was left out of -# json spec for whatever reason -string-escape-slash-v: - type: basic - output: "\v" - input: > - "\v" - -string-unicode-escape: - type: basic - output: "\u0000\uffffx\ufeff\u1234\u9f6a\u2028\uabcd" - input: > - "\u0000\uFFFFx\uFeFf\u1234\u9F6a\u2028\uabcd" - -string-arbitrary-escape: - type: advanced - output: "X12Uqwe\r\tyiopasd\fghjklzc\u000b\b\nm9 " - input: > - '\X12\U\q\w\e\r\t\y\i\o\p\a\s\d\f\g\h\j\k\l\z\c\v\b\n\m\9\ ' - -string-bad-unicode: - type: advanced - output: !error - input: > - '\uEFGH' - -string-incomplete-unicode: - type: advanced - output: !error - input: > - '\u$' - -string-bad-hex: - type: advanced - output: !error - input: > - '\xFG' - -string-incomplete-hex: - type: advanced - output: !error - input: > - '\x$' - -# Object literals -# --------------- - -object-nested: - type: basic - output: {q:{'w':{"e":[1]}}} - input: | - {q:{'w':{"e":[1]}}} - -object-trailing-comma: - type: basic - output: {foo: 'bar'} - input: | - {foo: 'bar',} - -object-leading-comma-style: - type: basic - output: {q: 1,w: 2,e: 3} - input: | - { q: 1 - , w: 2 - , e: 3 - } - -object-incomplete: - type: basic - output: !error - input: | - {q:1,w:2,{} - -object-isnt-array: - type: basic - output: !error - input: | - {1,2} - -object-no-single-comma: - type: basic - output: !error - input: | - {,} - -object-no-elisions: - type: basic - output: !error - input: | - {q:1,,w:2} - -# Objects: keys -# ------------- - -object-singlequoted: - type: basic - output: {q: 1,w: 2,e: 3} - input: | - {'q':1,'w':2,'e':3} - -object-doublequoted: - type: basic - output: {q: 1,w: 2,e: 3} - input: | - {"q":1,"w":2,"e":3} - -object-unquoted: - type: basic - output: {$FOO_bar123: 'baz'} - input: > - {$FOO_bar123: 'baz'} - -object-no-first-digit: - type: advanced - output: !error - input: > - {123foo: bar} - -object-unquoted-unicode: - type: advanced - output: {"\u1f04\u03bb\u03c6\u03b1": baz} - input: "{\u1f04\u03bb\u03c6\u03b1:'baz'}" - -object-unicode-escape-key: - type: advanced - output: {foo: 'bar', "\u1f04\u03bb\u03c6\u03b1": baz, "qwe\u1f04rty": quux} - input: | - {foo:'bar', \u1f04\u03bb\u03c6\u03b1:'baz', qwe\u1f04rty: "quux"} - -object-no-raw-literal: - type: extra - output: !error - input: | - {foo: bar} - -object-bad-literal: - type: advanced - output: !error - input: | - {foo-bar: 123} - -object-no-space-in-key: - type: advanced - output: !error - input: | - {foo bar: 123} - -object-no-comment-in-key: - type: advanced - output: !error - input: | - {foo/*bar*/baz: 123} - -object-float-keys: - type: advanced - output: {'1': 'one', '3.1415': 'pi'} - input: | - {1:'one', 3.1415:'pi'} - -object-no-negative: - type: advanced - output: !error - input: | - {-5: 123} - -object-exponent-keys: - type: advanced - output: {'1': 'exp', '1000': 'pos', '0.001': 'neg'} - input: | - {1e0: 'exp', 1e+3: 'pos', 1e-3: 'neg'} - -object-octal-keys: - type: extra - output: {'668': 1} - input: | - {01234: 1} - -object-hex-keys: - type: advanced - output: {'51966': 1} - input: | - {0xCAFE: 1} - -object-null-keys: - type: basic - output: {'null': null} - input: | - {null: null} - -object-no-array-keys: - type: extra - output: !error - input: | - {[]: 123} - -object-no-empty-keys: - type: basic - output: !error - input: | - {: 123} - -object-empty-string-key: - type: basic - output: {s: {'': 1}, m: {'': 2}} - input: | - {s: {'': 1}, m: {"": 2}} - -object-bad-unicode-space: - type: advanced - output: !error - input: | - { \u0020foobar: 123 } - -object-bad-unicode-dash: - type: advanced - output: !error - input: | - { foo\u002dbar: 123} - -object-incomplete-unicode-sequence: - type: advanced - output: !error - input: | - { foo\u12f: 123 } - -object-double-escape: - type: advanced - output: !error - input: | - { foo\\u1234bar: 123 } - -object-we-arent-es3: - type: basic - output: {new: 1, delete: 2, throw: 3} - input: | - {new: 1, delete: 2, throw: 3} - -object-last-digits: - type: basic - output: {$123e2: 1, abc123: 2} - input: | - {$123e2: 1, abc123: 2} - -object-unicode-in-string: - type: advanced - output: {"\uff13qwe": 123} - input: | - {"\uff13qwe": 123} - -object-unicode-esc-in-string: - type: advanced - output: {"\\uff13qwe": 123} - input: | - {"\\uff13qwe": 123} - -object-unicode-digits-first-esc: - type: advanced - output: !error - input: | - {\uff13qwe: 123} - -object-unicode-digits-first-lit: - type: advanced - output: !error - input: "{\uff13qwe: 123}" - -object-unicode-weirdness-esc: - type: advanced - output: {"digit\uff13": 1, "comb\u094F": 2, "punct\u2040": 3, "zwnj\u200C": 4} - input: | - {digit\uff13: 1, comb\u094F: 2, punct\u2040: 3, zwnj\u200C: 4} - -object-unicode-weirdness-lit: - type: advanced - output: {"digit\uff13": 1, "comb\u094F": 2, "punct\u2040": 3, "zwnj\u200C": 4} - input: "{digit\uff13: 1, comb\u094F: 2, punct\u2040: 3, zwnj\u200C: 4}" - -# Array literals -# -------------- - -array-all-types: - type: basic - output: [1.2,"3,4",{},[],null,+.inf] - input: | - [1.2,"3,4",{},[],null,Infinity] - -array-trailing-comma: - type: basic - output: [1,2,3,4] - input: | - [1,2,3,4,] - -array-leading-comma-style: - type: basic - output: [quux,foo,bar,baz] - input: | - [ 'quux' - , 'foo' - , 'bar' - , 'baz' - ] - -array-incomplete: - type: basic - output: !error - input: | - [1,2,3,[] - -array-nested: - type: basic - output: [[[[[[]]]]],[[],[]]] - input: | - [[[[[[/*[]*/]]]]],[[],[]]] - -array-isnt-object: - type: extra - output: !error - input: | - [1:2] - -array-no-single-comma: - type: extra - output: !error - input: | - [,] - -array-no-elisions: - type: extra - output: !error - input: | - [1,,2,3] - -# Comments -# -------- - -comment-single: - type: basic - output: foobar - input: | - // blahblah - "foobar" - // another one - -comment-multi: - type: basic - output: foobar - input: | - /* - * 123 - */ - "foobar" - /**/ - -comment-single-newlines: - type: advanced - output: [ 123, 456, 789 ] - input: "[// foo\r123,// bar\u2028456,// baz\u2029789]" - -comment-inside: - type: advanced - output: [123, '// foo', '/* bar'] - input: > - [ - /* - " // */ 123, // ", - "// foo", - '/* bar', - ] - -comment-in-token: - type: advanced - output: !error - input: - 123/*comment*/456 - -comment-java-style: - type: basic - output: 123 - input: - /*****************/ - 123 - /****************/ - -comment-object: - type: basic - output: {q: 123} - input: /**/{/**/q/**/:/**/123/**/,/**/}// - -# Whitespace -# ---------- - -ws-no-whitespace: - type: basic - output: {"foo":bar,bar:["qwe",null,[],{}],"baz":123} - input: '{foo:"bar","bar":["qwe",null,[],{}],"baz":123}' - -ws-allow-prefix: - type: basic - output: 123 - input: " \t123" - -ws-unicode-spaces: - type: advanced - output: { foo : 123 } - input: " - \u0020\u00A0\uFEFF - { - \x09\x0A\x0B\x0C\x0D\u1680\u180E - foo - \u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A - : - \u2028\u2029\u202F\u205F\u3000 - 123 - \uFEFF - }" - -ws-unicode-newlines: - type: advanced - output: [ 123, 456 ] - input: " - [ - \u000D - 123, - \u2028 - 456, - \u2029 - ] - " - -# Multiple tokens -# --------------- - -multi-string-nospace: - type: basic - output: !error - input: '"foo""bar"' - -multi-string: - type: basic - output: !error - input: '"foo" "bar"' - -# note: valid javascript -multi-array: - type: extra - output: !error - input: '[0] [0]' - -multi-object: - type: basic - output: !error - input: '{} {}' -... diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_analyze.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_analyze.js deleted file mode 100644 index 2a24e01eac2c2d..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_analyze.js +++ /dev/null @@ -1,53 +0,0 @@ -var _assert = require('assert') -var analyze = require('../').analyze - -function addTest(a, b) { - if (typeof(describe) === 'function') { - it('test_analyze: ' + a + ' == ' + b, function() { - _assert.equal(a, b) - }) - } else { - _assert.equal(a, b) - } -} - -var t = analyze(JSON.stringify(require('os').networkInterfaces())) -addTest(t.has_whitespace, false) -addTest(t.has_comments, false) -addTest(t.has_newlines, false) -addTest(t.newline, '\n') -addTest(t.quote, '"') -addTest(t.quote_keys, true) -addTest(t.indent, '') - -var t = analyze(JSON.stringify(require('os').networkInterfaces(), null, 2)) -addTest(t.has_whitespace, true) -addTest(t.has_comments, false) -addTest(t.has_newlines, true) -addTest(t.newline, '\n') -addTest(t.quote, '"') -addTest(t.quote_keys, true) -addTest(t.indent, ' ') - -var t = analyze(JSON.stringify(require('os').networkInterfaces(), null, 3)) -addTest(t.indent, ' ') - -var t = analyze(JSON.stringify(require('os').networkInterfaces(), null, '\t')) -addTest(t.indent, '\t') - -var t = analyze(JSON.stringify(require('os').networkInterfaces(), null, 3).replace(/\n/g, '\r\n')) -addTest(t.indent, ' ') -addTest(t.newline, '\r\n') - -var t = analyze(JSON.stringify(require('os').networkInterfaces()).replace(/"/g, "'")) -addTest(t.quote, "'") -addTest(t.quote_keys, true) - -var t = analyze("{foo:'bar', 'bar':\"baz\", 'baz':\"quux\"}") -addTest(t.quote, "'") -addTest(t.quote_keys, false) - -var t = analyze("{foo:'bar', \"bar\":'baz', \"baz\":\"quux\"}") -addTest(t.quote, '"') -addTest(t.quote_keys, false) - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_document.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_document.js deleted file mode 100644 index 5f1ef2aaf6a764..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_document.js +++ /dev/null @@ -1,214 +0,0 @@ -var assert = require('assert') -var create = require('../lib/document').Document -var jju = require('..') - -var str = '{ x\r\n:\n1, y: {"..z.": 123, t: null, s:"123", a:[ 1,2,{x:3},] }}\n' -var d = create(str) -assert.equal(d + '', str) -assert.deepEqual(d.get(''), {x:1,y:{'..z.':123,t:null,s:'123',a:[1,2,{x:3}]}}) -assert.deepEqual(d.get('x'), 1) -assert.deepEqual(d.get('x.x'), undefined) -assert.deepEqual(d.get('x.x.x.x'), undefined) -assert.strictEqual(d.get('y.x'), undefined) -assert.deepEqual(d.get('y.s'), '123') -assert.strictEqual(d.get('y.t'), null) -assert.strictEqual(d.get('y.t.x'), undefined) -assert.equal(d.has(''), true) -assert.equal(d.has('x'), true) -assert.equal(d.has('x.x'), false) -assert.equal(d.has('x.x.x.x'), false) -assert.equal(d.has('y.x'), false) -assert.equal(d.has('y'), true) -assert.equal(d.has('y.s'), true) -assert.equal(d.has('y.t'), true) -assert.equal(d.has('a'), false) - -// arrays -assert.deepEqual(d.get('y.a'), [1,2,{x:3}]) -assert.deepEqual(d.get('y.a.0'), 1) -assert.deepEqual(d.get('y.a.2.x'), 3) -assert.deepEqual(d.get('y.a.10'), undefined) -assert.deepEqual(d.has('y.a.0'), true) -assert.deepEqual(d.has('y.a.10'), false) -assert.deepEqual(d.get('y.a.2'), {x:3}) -assert.deepEqual(d.get('y.a.-1'), undefined) - -// controversial -assert.strictEqual(d.get('y.s.0'), undefined) -assert.equal(d.has('y.s.0'), false) - -// paths -assert.deepEqual(d.get([]), {x:1,y:{'..z.':123,t:null,s:'123',a:[1,2,{x:3}]}}) -assert.strictEqual(d.has([]), true) -assert.strictEqual(d.get(['y','..z.']), 123) -assert.strictEqual(d.has(['y','..z.']), true) -assert.deepEqual(d.get(['y','a',2,'x']), 3) -assert.deepEqual(create('[1]').set(0, 4).get(''), [4]) -assert.deepEqual(create('[1]').set(1, 4).get(''), [1,4]) -assert.deepEqual(create('[1]').has(0), true) -assert.deepEqual(create('[1]').has(1), false) -assert.deepEqual(create('[1]').get(0), 1) - -// invalid paths -assert.throws(function() { create('[1]').set(null, 4) }, /invalid path type/i) -assert.throws(function() { create('[1]').set({}, 4) }, /invalid path type/i) -assert.throws(function() { create('[1]').set(/./, 4) }, /invalid path type/i) -assert.throws(function() { create('[1]').set(function(){}, 4) }, /invalid path type/i) -assert.throws(function() { create('[1]').set(false, 4) }, /invalid path type/i) -assert.throws(function() { create('[1]').set(undefined, 4) }, /invalid path type/i) - -// set root -assert.strictEqual(create(str).set('', 4).get(''), 4) -assert.strictEqual(create(str).set('', null).get(''), null) -assert.strictEqual(create(str).set('', {x:4}).get('x'), 4) -assert.deepEqual(create(str).set('', [1,2,3]).get(''), [1,2,3]) -assert.strictEqual(create('1').set('', 4).get(''), 4) -assert.strictEqual(create('null').set('', 4).get(''), 4) -assert.strictEqual(create('[]').set('', 4).get(''), 4) -assert.strictEqual(create('{}').set('', 4).get(''), 4) - -// set 1st level -assert.deepEqual(create('{}').set('x', 4).get('x'), 4) -assert.deepEqual(create('{a:{b:[]}}').set('a.b.0', 4).get('a'), {b:[4]}) -//assert.deepEqual(create('1').set('x', 4).get('x'), 4) -//assert.deepEqual(create('null').set('x', 4).get('x'), 4) - -// array: boundaries -assert.strictEqual(create('[]').set('0', 4).get('0'), 4) -assert.strictEqual(create('[1,2,3]').set('2', 4).get('2'), 4) -assert.strictEqual(create('[1,2,3]').set('3', 4).get('3'), 4) - -// various error cases -assert.throws(function() { create('1').set('x', 4) }, /set key .* of an non-object/) -assert.throws(function() { create('null').set('x', 4) }, /set key .* of an non-object/) -assert.throws(function() { create('[]').set('x', 4) }, /set key .* of an array/) -assert.throws(function() { create('""').set('x', 4) }, /set key .* of an non-object/) -assert.throws(function() { create('{}').set('x.x.x', 4) }, /set key .* of an non-object/) -assert.throws(function() { create('1').set('1', 4) }, /set key .* of an non-object/) -assert.throws(function() { create('null').set('1', 4) }, /set key .* of an non-object/) -assert.throws(function() { create('""').set('1', 4) }, /set key .* of an non-object/) -assert.throws(function() { create('[]').set('-1', 4) }, /set key .* of an array/) -assert.throws(function() { create('[]').set('1', 4) }, /set key .* out of bounds/) -assert.throws(function() { create('[1,2,3]').set('4', 4) }, /set key .* out of bounds/) -assert.throws(function() { create('{a:{b:[]}}').set('a.b.x', 4) }, /set key .* of an array/) - -// unsetting stuff -assert.throws(function() { create('[]').unset('') }, /can't remove root document/) - -// arrays: handling spaces correctly -assert.equal(create("[]").set(0,{})+"", '[{}]') -assert.equal(create("[0]").set(1,{})+"", '[0,{}]') -assert.equal(create("[0,]").set(1,{})+"", '[0,{},]') -assert.equal(create("[ ]").set(0,{})+"", '[{} ]') -assert.equal(create("[ 0 , ]").set(1,{})+"", '[ 0 , {}, ]') -assert.equal(create("[ 0 ]").set(1,{})+"", '[ 0, {} ]') -assert.equal(create("{}").set('y',{})+"", '{"y":{}}') -assert.equal(create("{x:1}").set('y',{})+"", '{x:1,y:{}}') -assert.equal(create("{x:1,}").set('y',{})+"", '{x:1,y:{},}') -assert.equal(create("{ }").set('y',{})+"", '{"y":{} }') -assert.equal(create("{ x:1 , }").set('y',{})+"", '{ x:1 , y:{}, }') -assert.equal(create("{ x:1 }").set('y',{})+"", '{ x:1, y:{} }') - -// deleting elements -assert.throws(function() { create('[]').unset('0') }, /unset key .* out of bounds/) -assert.throws(function() { create('[1,2]').unset('2') }, /unset key .* out of bounds/) -assert.throws(function() { create('[1,2,3]').unset('0') }, /in the middle of an array/) - -// CommonJS assert spec is "awesome" -assert.deepEqual(create('[1,2]').unset('1').get(''), [1]) -assert.deepEqual(create('[1,2]').unset('1').get('').length, 1) -assert.deepEqual(create('[1,2,3]').unset('2').unset('1').get(''), [1]) -assert.deepEqual(create('[1,2,3]').unset('2').unset('1').get('').length, 1) -assert.deepEqual(create('[1]').unset('0').get(''), []) -assert.deepEqual(create('[1]').unset('0').get('').length, 0) - -assert.deepEqual(create('{x:{y:"z"}, z:4}').unset('x').get(''), {z:4}) -assert.throws(function() { create('[1,2]').unset('') }, /root/) - -// getting crazy -//assert.deepEqual(create(str).set('a.b.c.d.e', 1).get('a'), {b:{c:{d:{e:1}}}}) - -// update: arrays -assert.deepEqual(create("[1]").update([2,3])+"", '[2,3]') -assert.deepEqual(create("[1]").update([2,3,4])+"", '[2,3,4]') -assert.deepEqual(create("[]").update([2])+"", '[2]') -assert.deepEqual(create("[2]").update([])+"", '[]') -assert.deepEqual(create("[2,3,4]").update([2,3])+"", '[2,3]') -assert.deepEqual(create("[2,3,4]").update([])+"", '[]') -assert.deepEqual(create("[]").update([2,3,4])+"", '[2,3,4]') -assert.deepEqual(create(" /*zz*/ [ 2 , 3 , 4 ] /*xx*/ ").update([])+"", ' /*zz*/ [ ] /*xx*/ ') -assert.deepEqual(create(" /*zz*/ [ ] /*xx*/ ").update([2,3,4])+"", ' /*zz*/ [2,3,4 ] /*xx*/ ') - -// update: objects -assert.deepEqual(create("{x:1}").update({x:1,y:2,z:3})+"", '{x:1,y:2,z:3}') -assert.deepEqual(create("{x:1}").update({x:2,z:3,t:4})+"", '{x:2,z:3,t:4}') -assert.deepEqual(create("{}").update({x:1,y:2})+"", '{"x":1,"y":2}') -assert.deepEqual(create("{x:1}").update({})+"", '{}') -assert.deepEqual(create("{x:1,y:2}").update({x:1})+"", '{x:1}') -assert.deepEqual(create(" /*zz*/ { x /*a*/ : /*b*/ 2 , y:3 , z //\n: 4 } /*xx*/ ").update({})+"", ' /*zz*/ { } /*xx*/ ') -assert.deepEqual(create(" /*zz*/ { } /*xx*/ ").update({x: 2, y: 3, z: 4})+"", ' /*zz*/ {"x":2,"y":3,"z":4 } /*xx*/ ') - -// remove trailing comma -assert.deepEqual(create("{x:1,}").update({})+"", '{}') -assert.deepEqual(create("[0,]").update([])+"", '[]') -assert.deepEqual(create("[0 /*z*/ , /*z*/]").update([])+"", '[ /*z*/]') - -// mode -assert.equal(create('{"test":123}', {mode:'json'}).update({q:1,w:2})+'', '{"q":1,"w":2}') - -assert.equal(create('{1:2}').update({ a: 1, b: [1,2], c: 3})+'', '{a:1,b:[1,2],c:3}') - -// undef -//assert.throws(function(){ jju.update(undefined, undefined) }, /root doc/) -assert.equal(jju.update(undefined, undefined), '') -assert.equal(jju.update(undefined, 42), '42') -assert.equal(jju.update(undefined, {x: 5}), '{"x":5}') - -/* - * real test - */ -var upd = { name: 'yapm', - version: '0.6.0', - description: 'npm wrapper allowing to use package.yaml instead of package.json', - author: { name: 'Alex Kocharin', email: 'alex@kocharin.ru' }, - keywords: - [ 'package manager', - 'modules', - 'install', - 'package.yaml', - 'package.json5', - 'yaml', - 'json5', - 'npm' ], - preferGlobal: true, - homepage: 'https://npmjs.org/doc/', - repository: { type: 'git', url: 'https://github.com/rlidwka/yapm' }, - bugs: { url: 'http://github.com/rlidwka/yapm/issues' }, - main: './yapm.js', - bin: { yapm: './yapm.js' }, - dependencies: { npm: '*', 'js-yaml': '*', through: '*', 'json5-utils': '*' }, - devDependencies: { async: '*' }, - optionalDependencies: { 'yaml-update': '*' }, - test_nonascii: 'тест' } - -assert.deepEqual(create(create('{"garbage":"garbage"}').update(upd)).get(''), upd) -assert.deepEqual(JSON.parse(create('{"garbage":"garbage"}', {mode:'json',legacy:true}).update(upd)), upd) - -//console.log(create('{"garbage":"garbage"}').update(upd)+'') - -//assert.deepEqual(create(" [ ] //").set(0,{})+"" [ ,{}] // - - -//node -e 'console.log(require("./document").Document("{}").set("",[1,2,3])+"")'[1, 2, 3] - -//alex@elu:~/json5-utils/lib$ node -e 'console.log(require("./document").Document("[]").set("0",[1,2,3]).get(""))' -//[ [ 1, 2, 3 ] ] - - -/*assert.equal(create('"test"').get(''), 'test') -assert.equal(create('"test"').get([]), 'test') -assert.equal(create('"test"').get(false), 'test') -assert.equal(create(undefined).get(''), undefined) - -//assert.equal(create('"test"').set('', 'foo').toString(), '"foo"') -*/ diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_errors.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_errors.js deleted file mode 100644 index 8b2cdb7dcbdf67..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_errors.js +++ /dev/null @@ -1,56 +0,0 @@ -var assert = require('assert') -var parse = require('../').parse - -function addTest(arg, row, col, errRegExp) { - var fn = function() { - try { - parse(arg) - } catch(err) { - if (row !== undefined) assert.equal(err.row, row, 'wrong row: ' + err.row) - if (col !== undefined) assert.equal(err.column, col, 'wrong column: ' + err.column) - if (errRegExp) assert(errRegExp.exec(err.message)) - return - } - throw Error("no error") - } - - if (typeof(describe) === 'function') { - it('test_errors: ' + JSON.stringify(arg), fn) - } else { - fn() - } -} - -// semicolon will be unexpected, so it indicates an error position -addTest(';', 1, 1) -addTest('\n\n\n;', 4, 1) -addTest('\r\n;', 2, 1) -addTest('\n\r;', 3, 1) -addTest('\n\u2028;', 3, 1) -addTest('\n\u2029;', 3, 1) -addTest('[\n1\n,\n;', 4, 1) -addTest('{\n;', 2, 1) -addTest('{\n1\n:\n;', 4, 1) -addTest('.e3', 1, 3, /"\.e3"/) - -// line continuations -addTest('["\\\n",\n;', 3, 1) -addTest('["\\\r\n",\n;', 3, 1) -addTest('["\\\u2028",\n;', 3, 1) -addTest('["\\\u2029",\n;', 3, 1) - -// bareword rewind -addTest('nulz', 1, 1) - -// no data -addTest(' ', 1, 3, /No data.*whitespace/) -addTest('blah', 1, 1, /Unexpected token 'b'/) -addTest('', 1, 1, /No data.*empty input/) - -try { - parse('{{{{{{{{{') -} catch(err) { - var x = err.stack.match(/parseObject/g) - assert(!x || x.length < 2, "shouldn't blow up the stack with internal calls") -} - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_parse.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_parse.js deleted file mode 100644 index d33e61ee7e37be..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_parse.js +++ /dev/null @@ -1,171 +0,0 @@ -var assert = require('assert') -var parse = require('../').parse - -function addTest(arg, bulk) { - function fn_json5() { - //console.log('testing: ', arg) - try { - var x = parse(arg) - } catch(err) { - x = 'fail' - } - try { - var z = eval('(function(){"use strict"\nreturn ('+String(arg)+'\n)\n})()') - } catch(err) { - z = 'fail' - } - assert.deepEqual(x, z) - } - - function fn_strict() { - //console.log('testing: ', arg) - try { - var x = parse(arg, {mode: 'json'}) - } catch(err) { - x = 'fail' - } - try { - var z = JSON.parse(arg) - } catch(err) { - z = 'fail' - } - assert.deepEqual(x, z) - } - - if (typeof(describe) === 'function' && !bulk) { - it('test_parse_json5: ' + JSON.stringify(arg), fn_json5) - it('test_parse_strict: ' + JSON.stringify(arg), fn_strict) - } else { - fn_json5() - fn_strict() - } -} - -addTest('"\\uaaaa\\u0000\\uFFFF\\uFaAb"') -addTest(' "\\xaa\\x00\xFF\xFa\0\0" ') -addTest('"\\\'\\"\\b\\f\\t\\n\\r\\v"') -addTest('"\\q\\w\\e\\r\\t\\y\\\\i\\o\\p\\[\\/\\\\"') -addTest('"\\\n\\\r\n\\\n"') -addTest('\'\\\n\\\r\n\\\n\'') -addTest(' null') -addTest('true ') -addTest('false') -addTest(' Infinity ') -addTest('+Infinity') -addTest('[]') -addTest('[ 0xA2, 0X024324AaBf]') -addTest('-0x12') -addTest(' [1,2,3,4,5]') -addTest('[1,2,3,4,5,] ') -addTest('[1e-13]') -addTest('[null, true, false]') -addTest(' [1,2,"3,4,",5,]') -addTest('[ 1,\n2,"3,4," \r\n,\n5,]') -addTest('[ 1 , 2 , 3 , 4 , 5 , ]') -addTest('{} ') -addTest('{"2":1,"3":null,}') -addTest('{ "2 " : 1 , "3":null , }') -addTest('{ \"2\" : 25e245 , \"3\": 23 }') -addTest('{"2":1,"3":nul,}') -addTest('{:1,"3":nul,}') -addTest('[1,2] // ssssssssss 3,4,5,] ') -addTest('[1,2 , // ssssssssss \n//xxx\n3,4,5,] ') -addTest('[1,2 /* ssssssssss 3,4,*/ /* */ , 5 ] ') -addTest('[1,2 /* ssssssssss 3,4,*/ /* * , 5 ] ') -addTest('{"3":1,"3":,}') -addTest('{ чйуач:1, щцкшчлм : 4,}') -addTest('{ qef-:1 }') -addTest('{ $$$:1 , ___: 3}') -addTest('{3:1,2:1}') -addTest('{3.4e3:1}') -addTest('{-3e3:1}') -addTest('{+3e3:1}') -addTest('{.3e3:1}') - -for (var i=0; i<200; i++) { - addTest('"' + String.fromCharCode(i) + '"', true) -} - -// strict JSON test cases -addTest('"\\xaa"') -addTest('"\\0"') -addTest('"\0"') -addTest('"\\v"') -addTest('{null: 123}') -addTest("{'null': 123}") - -assert.throws(function() { - parse('0o') -}) - -assert.strictEqual(parse('01234567'), 342391) -assert.strictEqual(parse('0o1234567'), 342391) - -// undef -assert.strictEqual(parse(undefined), undefined) - -// whitespaces -addTest('[1,\r\n2,\r3,\n]') -'\u0020\u00A0\uFEFF\x09\x0A\x0B\x0C\x0D\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000'.split('').forEach(function(x) { - addTest(x+'[1,'+x+'2]'+x) - addTest('"'+x+'"'+x) -}) -'\u000A\u000D\u2028\u2029'.split('').forEach(function(x) { - addTest(x+'[1,'+x+'2]'+x) - addTest('"\\'+x+'"'+x) -}) - -/* weird ES6 stuff, not working - -if (process.version > 'v0.11.7') { - assert(Array.isArray(parse('{__proto__:[]}').__proto__)) - assert.equal(parse('{__proto__:{xxx:5}}').xxx, undefined) - assert.equal(parse('{__proto__:{xxx:5}}').__proto__.xxx, 5) - - var o1 = parse('{"__proto__":[]}') - assert.deepEqual([], o1.__proto__) - assert.deepEqual(["__proto__"], Object.keys(o1)) - assert.deepEqual([], Object.getOwnPropertyDescriptor(o1, "__proto__").value) - assert.deepEqual(["__proto__"], Object.getOwnPropertyNames(o1)) - assert(o1.hasOwnProperty("__proto__")) - assert(Object.prototype.isPrototypeOf(o1)) - - // Parse a non-object value as __proto__. - var o2 = JSON.parse('{"__proto__":5}') - assert.deepEqual(5, o2.__proto__) - assert.deepEqual(["__proto__"], Object.keys(o2)) - assert.deepEqual(5, Object.getOwnPropertyDescriptor(o2, "__proto__").value) - assert.deepEqual(["__proto__"], Object.getOwnPropertyNames(o2)) - assert(o2.hasOwnProperty("__proto__")) - assert(Object.prototype.isPrototypeOf(o2)) -}*/ - -assert.throws(parse.bind(null, "{-1:42}")) - -for (var i=0; i<100; i++) { - var str = '-01.e'.split('') - - var rnd = [1,2,3,4,5].map(function(x) { - x = ~~(Math.random()*str.length) - return str[x] - }).join('') - - try { - var x = parse(rnd) - } catch(err) { - x = 'fail' - } - try { - var y = JSON.parse(rnd) - } catch(err) { - y = 'fail' - } - try { - var z = eval(rnd) - } catch(err) { - z = 'fail' - } - //console.log(rnd, x, y, z) - if (x !== y && x !== z) throw 'ERROR' -} - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_portable.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_portable.js deleted file mode 100644 index 0143e7d8e5bff6..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_portable.js +++ /dev/null @@ -1,60 +0,0 @@ -var assert = require('assert') -var FS = require('fs') -var YAML = require('js-yaml') -var jju = require('../') - -function addTest(name, fn) { - if (typeof(describe) === 'function') { - it(name, fn) - } else { - fn() - } -} - -var schema = YAML.Schema.create([ - new YAML.Type('!error', { - kind: 'scalar', - resolve: function (state) { - //state.result = null - return true - }, - }) -]) - -var tests = YAML.safeLoad(FS.readFileSync(__dirname + '/portable-json5-tests.yaml', 'utf8'), { - schema: schema -}) - -if (!Object.is) { - Object.defineProperty(Object, 'is', { - value: function(x, y) { - if (x === y) { - return x !== 0 || 1 / x === 1 / y; - } - return x !== x && y !== y; - }, - configurable: true, - enumerable: false, - writable: true, - }) -} - -for (var k in tests) { - ;(function(k) { - addTest(k, function() { - try { - var result = jju.parse(tests[k].input) - } catch(err) { - result = null - } - - // need deepStrictEqual - if (typeof(result) === 'object') { - assert.deepEqual(result, tests[k].output) - } else { - assert(Object.is(result, tests[k].output), String(result) + ' == ' + tests[k].output) - } - }) - })(k) -} - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_stringify.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_stringify.js deleted file mode 100644 index c97e38e93c1f61..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_stringify.js +++ /dev/null @@ -1,89 +0,0 @@ -var assert = require('assert') -var parse = require('../').parse -var stringify = require('../').stringify - -function deepEqual(x, y) { - if (Number.isNaN(x)) { - return assert(Number.isNaN(y)) - } - assert.deepEqual(x, y) -} - -function addTest(arg, arg2, arg3) { - function fn() { - deepEqual(parse(stringify(arg)), arg2 === undefined ? arg : arg2) - if (arg !== undefined) deepEqual(JSON.parse(stringify(arg, {mode: 'json', indent: false})), (arg3 === undefined ? (arg2 === undefined ? arg : arg2) : arg3)) - } - - if (typeof(describe) === 'function') { - it('test_stringify: ' + JSON.stringify(arg), fn) - } else { - fn() - } -} - -addTest(0) -addTest(-0) -addTest(NaN, undefined, null) -addTest(Infinity, undefined, null) -addTest(-Infinity, undefined, null) -addTest(123) -addTest(19508130958019385.135135) -addTest(-2e123) -addTest(null) -addTest(undefined) -addTest([]) -addTest([,,,,,,,], [null,null,null,null,null,null,null]) -addTest([undefined,null,1,2,3,], [null,null,1,2,3]) -addTest([[[[]]],[[]]]) -addTest({}) -addTest({1:2,3:4}) -addTest({1:{1:{1:{1:4}}}, 3:4}) -addTest({1:undefined, 3:undefined}, {}) -addTest(new Number(4), 4) -addTest(new Boolean(true), true) -addTest(new String('xqefxef'), 'xqefxef') -addTest(new Boolean(), false) - -var r='';for (var i=0; i<5000; i++) {r+=String.fromCharCode(i)} -addTest(r) - -assert.equal("[1, 2, 3]", stringify([1, 2, 3], {indent: 1})) -assert.equal("[1, 2, 3]", stringify([1, 2, 3], {indent: 2})) - -var oddball = Object(42) -oddball.__proto__ = { __proto__: null } -assert.equal('{}', stringify(oddball)) - -/* this WILL throw -var falseNum = Object("37") -falseNum.__proto__ = Number.prototype -assert.equal("{0: '3', 1: '7'}", stringify(falseNum))*/ - -assert.equal(stringify(Infinity), 'Infinity') -assert.equal(stringify(Infinity, {mode: 'json'}), 'null') -assert.equal(stringify(NaN), 'NaN') -assert.equal(stringify(NaN, {mode: 'json'}), 'null') -assert.equal(stringify(-0), '-0') - -assert.equal(stringify('test', null), "'test'") - -var array = [""] -var expected = "''" -for (var i = 0; i < 1000; i++) { - array.push("") - expected = "''," + expected -} -expected = '[' + expected + ']' -assert.equal(expected, stringify(array, {indent: false})) - -assert.strictEqual(stringify([1,2,3], function(){}), undefined) - -// don't stringify prototype -assert.equal('{a: 1}', stringify({a:1,__proto__:{b:2}})) - -// sort keys tests -assert.equal('{a: 1, b: 2, z: 3}', stringify({b:2,a:1,z:3}, {sort_keys: 1})) -assert.equal('{a: 1, b: {a: 2, b: 5, c: 1}, z: 3}', stringify({b:{c:1,a:2,b:5},a:1,z:3}, {sort_keys: 1})) -assert.equal('{a: [3, 5, 1], b: 2, z: 3}', stringify({b:2,a:[3,5,1],z:3}, {sort_keys: 1})) -assert.equal('{b: 2, a: 1, z: 3}', stringify({b:2,a:1,z:3}, {sort_keys: 0})) diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_tokenize.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_tokenize.js deleted file mode 100644 index 64fb7ec93d9fef..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_tokenize.js +++ /dev/null @@ -1,99 +0,0 @@ -var assert = require('assert') -var parse = require('../').parse - -function tokenize(arg) { - var result = [] - parse(arg, {_tokenize: function(smth) { - result.push(smth) - }}) - assert.deepEqual(result.map(function(x){return x.raw}).join(''), arg) - return result -} - -function addTest(x, exp) { - function fn(){assert.deepEqual(tokenize(x), exp)} - - if (typeof(describe) === 'function') { - it('test_tokenize: ' + JSON.stringify(x), fn) - } else { - fn() - } -} - -addTest('123', [ { raw: '123', value: 123, type: 'literal', stack: [] }]) - -addTest(' /* zz */\r\n true /* zz */\n', -[ { raw: ' ', type: 'whitespace', stack: [] }, - { raw: '/* zz */', type: 'comment', stack: [] }, - { raw: '\r\n', type: 'newline', stack: [] }, - { raw: ' ', type: 'whitespace', stack: [] }, - { raw: 'true', type: 'literal', value: true, stack: [] }, - { raw: ' ', type: 'whitespace', stack: [] }, - { raw: '/* zz */', type: 'comment', stack: [] }, - { raw: '\n', type: 'newline', stack: [] } ]) - -addTest('{q:123, w : /*zz*/\n\r 345 } ', -[ { raw: '{', type: 'separator', stack: [] }, - { raw: 'q', type: 'key', value: 'q', stack: [] }, - { raw: ':', type: 'separator', stack: [] }, - { raw: '123', type: 'literal', value: 123, stack: ['q'] }, - { raw: ',', type: 'separator', stack: [] }, - { raw: ' ', type: 'whitespace', stack: [] }, - { raw: 'w', type: 'key', value: 'w', stack: [] }, - { raw: ' ', type: 'whitespace', stack: [] }, - { raw: ':', type: 'separator', stack: [] }, - { raw: ' ', type: 'whitespace', stack: [] }, - { raw: '/*zz*/', type: 'comment', stack: [] }, - { raw: '\n', type: 'newline', stack: [] }, - { raw: '\r', type: 'newline', stack: [] }, - { raw: ' ', type: 'whitespace', stack: [] }, - { raw: '345', type: 'literal', value: 345, stack: ['w'] }, - { raw: ' ', type: 'whitespace', stack: [] }, - { raw: '}', type: 'separator', stack: [] }, - { raw: ' ', type: 'whitespace', stack: [] } ]) - -addTest('null /* */// xxx\n//xxx', -[ { raw: 'null', type: 'literal', value: null, stack: [] }, - { raw: ' ', type: 'whitespace', stack: [] }, - { raw: '/* */', type: 'comment', stack: [] }, - { raw: '// xxx', type: 'comment', stack: [] }, - { raw: '\n', type: 'newline', stack: [] }, - { raw: '//xxx', type: 'comment', stack: [] } ]) - -addTest('[1,2,[[],[1]],{},{1:2},{q:{q:{}}},]', -[ { raw: '[', type: 'separator', stack: [] }, - { raw: '1', type: 'literal', value: 1, stack: [0] }, - { raw: ',', type: 'separator', stack: [] }, - { raw: '2', type: 'literal', value: 2, stack: [1] }, - { raw: ',', type: 'separator', stack: [] }, - { raw: '[', type: 'separator', stack: [2] }, - { raw: '[', type: 'separator', stack: [2,0] }, - { raw: ']', type: 'separator', stack: [2,0] }, - { raw: ',', type: 'separator', stack: [2] }, - { raw: '[', type: 'separator', stack: [2,1] }, - { raw: '1', type: 'literal', value: 1, stack: [2,1,0] }, - { raw: ']', type: 'separator', stack: [2,1] }, - { raw: ']', type: 'separator', stack: [2] }, - { raw: ',', type: 'separator', stack: [] }, - { raw: '{', type: 'separator', stack: [3] }, - { raw: '}', type: 'separator', stack: [3] }, - { raw: ',', type: 'separator', stack: [] }, - { raw: '{', type: 'separator', stack: [4] }, - { raw: '1', type: 'key', value: 1, stack: [4] }, - { raw: ':', type: 'separator', stack: [4] }, - { raw: '2', type: 'literal', value: 2, stack: [4,'1'] }, - { raw: '}', type: 'separator', stack: [4] }, - { raw: ',', type: 'separator', stack: [] }, - { raw: '{', type: 'separator', stack: [5] }, - { raw: 'q', type: 'key', value: 'q', stack: [5] }, - { raw: ':', type: 'separator', stack: [5] }, - { raw: '{', type: 'separator', stack: [5,'q'] }, - { raw: 'q', type: 'key', value: 'q', stack: [5,'q'] }, - { raw: ':', type: 'separator', stack: [5,'q'] }, - { raw: '{', type: 'separator', stack: [5,'q','q'] }, - { raw: '}', type: 'separator', stack: [5,'q','q'] }, - { raw: '}', type: 'separator', stack: [5,'q'] }, - { raw: '}', type: 'separator', stack: [5] }, - { raw: ',', type: 'separator', stack: [] }, - { raw: ']', type: 'separator', stack: [] } ]) - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_updates.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_updates.js deleted file mode 100644 index b7482519a919a7..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_updates.js +++ /dev/null @@ -1,22 +0,0 @@ -var assert = require('assert') -var FS = require('fs') -var YAML = require('js-yaml') -var jju = require('../') - -function addTest(name, fn) { - if (typeof(describe) === 'function') { - it(name, fn) - } else { - fn() - } -} - -FS.readdirSync(__dirname + '/update').filter(function(file) { - return file.match(/^[^\.].*\.yaml$/) -}).forEach(function(file) { - addTest('update: ' + file, function() { - var test = YAML.load(FS.readFileSync(__dirname + '/update/' + file, 'utf8')) - assert.strictEqual(test.test(jju, test.input), test.output) - }) -}) - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/author.yaml b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/author.yaml deleted file mode 100644 index 4b08bb61b49056..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/author.yaml +++ /dev/null @@ -1,31 +0,0 @@ -input: | - { "name": "just-a-demo", - "version": "0.1.2", - "description": "blahblahblah", - "main": "test.js", - "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, - "author": "John Doe ", - "license": "BSD-2-Clause" } - -output: | - { "name": "just-a-demo", - "version": "0.1.2", - "description": "blahblahblah", - "main": "test.js", - "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, - "author": { - "name": "John Doe", - "email": "whoever@google.com" - }, - "license": "BSD-2-Clause" } - -test: !!js/function | - function(jju, input) { - obj = jju.parse(input) - obj.author = { - name: 'John Doe', - email: 'whoever@google.com', - } - return jju.update(input, obj) - } - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/deep-object.yaml b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/deep-object.yaml deleted file mode 100644 index e0795a37874e9e..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/deep-object.yaml +++ /dev/null @@ -1,36 +0,0 @@ -input: | - { - "foo": { - "bar": { - "baz": { - "quux": "4" - } - } - } - } - -output: | - { - "foo": { - "bar": { - "baz": { - "quux": "4" - }, - "qwe": { - "rty": { - "aaa": { - "bbb": 1 - } - } - } - } - } - } - -test: !!js/function | - function(jju, input) { - obj = jju.parse(input) - obj.foo.bar.qwe = {rty: {aaa: {bbb: 1}}} - return jju.update(input, obj, {mode:'json'}) - } - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/delete.yaml b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/delete.yaml deleted file mode 100644 index b964715d37b0b4..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/delete.yaml +++ /dev/null @@ -1,36 +0,0 @@ -input: | - { - "name": "test", - "version": "0.0.0", - "dependencies": { - "foo": "1.2.x", - "bar": ">= 1" - }, - "bundleDependencies": [ - "foo", - "bar" - ], - "license": "BSD-2-Clause" - } - -output: | - { - "name": "test", - "version": "0.0.0", - "dependencies": { - "foo": "1.2.x" - }, - "bundleDependencies": [ - "foo" - ], - "license": "BSD-2-Clause" - } - -test: !!js/function | - function(jju, input) { - obj = jju.parse(input) - obj.bundleDependencies.pop() - delete obj.dependencies.bar - return jju.update(input, obj, {mode:'json'}) - } - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/norm-array.yaml b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/norm-array.yaml deleted file mode 100644 index c5b9dd952d1255..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/norm-array.yaml +++ /dev/null @@ -1,32 +0,0 @@ -input: | - { - "name": "test", - "version": "0.0.0", - "bundleDependencies": [ - "foo", - "bar" - ], - "license": "BSD-2-Clause" - } - -output: | - { - "name": "test", - "version": "0.0.0", - "bundleDependencies": [ - "foo", - "bar", - "baz", - "quux" - ], - "license": "BSD-2-Clause" - } - -test: !!js/function | - function(jju, input) { - obj = jju.parse(input) - obj.bundleDependencies.push('baz') - obj.bundleDependencies.push('quux') - return jju.update(input, obj, {mode:'json'}) - } - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/norm-object.yaml b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/norm-object.yaml deleted file mode 100644 index 93878675b7abc7..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/norm-object.yaml +++ /dev/null @@ -1,32 +0,0 @@ -input: | - { - "name": "test", - "version": "0.0.0", - "dependencies": { - "foobar": "*", - "bazquux": ">= 1.1.1" - }, - "license": "BSD-2-Clause" - } - -output: | - { - "name": "test", - "version": "0.0.0", - "dependencies": { - "foobar": "*", - "bazquux": ">= 1.1.1", - "whatever": "1.2.x", - "qwerty": "1" - }, - "license": "BSD-2-Clause" - } - -test: !!js/function | - function(jju, input) { - obj = jju.parse(input) - obj.dependencies.whatever = '1.2.x' - obj.dependencies.qwerty = '1' - return jju.update(input, obj, {mode:'json'}) - } - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/npm-array-bin.yaml b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/npm-array-bin.yaml deleted file mode 100644 index 35e1639bfda28b..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/npm-array-bin.yaml +++ /dev/null @@ -1,29 +0,0 @@ -input: | - { "name":"npm-test-array-bin" - , "version":"1.2.5" - , "bin": [ "bin/array-bin" ] - , "scripts": { "test": "node test.js" } } - -# less than ideal, I know... -output: | - { "name":"npm-test-array-bin" - , "version":"1.2.5" - , "bin": {"array-bin":"bin/array-bin"} - , "scripts": { "test": "node test.js" }, "readme": "just an npm test\n", "readmeFilename": "README", "description": "just an npm test", "_id": "npm-test-array-bin@1.2.5", "dist": {"shasum":"9c426a1bd55e98718ab4ddcc01fa57ea83c649f1"}, "_from": "npm-test-array-bin/" } - -test: !!js/function | - function(jju, input) { - obj = - { name: 'npm-test-array-bin', - version: '1.2.5', - bin: { 'array-bin': 'bin/array-bin' }, - scripts: { test: 'node test.js' }, - readme: 'just an npm test\n', - readmeFilename: 'README', - description: 'just an npm test', - _id: 'npm-test-array-bin@1.2.5', - dist: { shasum: '9c426a1bd55e98718ab4ddcc01fa57ea83c649f1' }, - _from: 'npm-test-array-bin/' } - return jju.update(input, obj) - } - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/pkg-json5.yaml b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/pkg-json5.yaml deleted file mode 100644 index 21a5c6eb141ed4..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/pkg-json5.yaml +++ /dev/null @@ -1,36 +0,0 @@ -input: | - // vim:syntax=javascript - { - name: 'yapm', - version: '1.1.0-1325', // upstream npm@1.3.25 - description: 'A package manager for node (npm fork)', - } - -output: | - // vim:syntax=javascript - { - name: 'yapm', - version: '1.1.0-1325', // upstream npm@1.3.25 - description: 'A package manager for node (npm fork)', - _id: 'yapm@1.1.0-1325', - dist: { - shasum: 'd5aa31c1ad00c1e7e57e07cea1b22c1806a47111', - }, - _from: './zzz', - } - -test: !!js/function | - function(jju, input) { - var upd = { - "name": "yapm", - "version": "1.1.0-1325", - "description": "A package manager for node (npm fork)", - "_id": "yapm@1.1.0-1325", - "dist": { - "shasum": "d5aa31c1ad00c1e7e57e07cea1b22c1806a47111" - }, - "_from": "./zzz" - } - return jju.update(input, upd) - } - diff --git a/deps/npm/node_modules/read-package-json/package.json b/deps/npm/node_modules/read-package-json/package.json index 17113419c0ab74..30b62ea733afb4 100644 --- a/deps/npm/node_modules/read-package-json/package.json +++ b/deps/npm/node_modules/read-package-json/package.json @@ -1,42 +1,97 @@ { - "name": "read-package-json", - "version": "2.0.1", + "_args": [ + [ + "read-package-json@2.0.3", + "/Users/rebecca/code/npm" + ] + ], + "_from": "read-package-json@2.0.3", + "_id": "read-package-json@2.0.3", + "_inCache": true, + "_installable": true, + "_location": "/read-package-json", + "_nodeVersion": "4.2.2", + "_npmUser": { + "email": "me@re-becca.org", + "name": "iarna" + }, + "_npmVersion": "3.5.4", + "_phantomChildren": {}, + "_requested": { + "name": "read-package-json", + "raw": "read-package-json@2.0.3", + "rawSpec": "2.0.3", + "scope": null, + "spec": "2.0.3", + "type": "version" + }, + "_requiredBy": [ + "/", + "/init-package-json", + "/read-installed", + "/read-package-tree" + ], + "_shasum": "f8cec1627053b54f384b353224545e607554c5d2", + "_shrinkwrap": null, + "_spec": "read-package-json@2.0.3", + "_where": "/Users/rebecca/code/npm", "author": { - "name": "Isaac Z. Schlueter", "email": "i@izs.me", + "name": "Isaac Z. Schlueter", "url": "http://blog.izs.me/" }, - "description": "The thing npm uses to read package.json files with semantics and defaults and validation", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/read-package-json.git" - }, - "main": "read-json.js", - "scripts": { - "test": "standard && tap test/*.js" + "bugs": { + "url": "https://github.com/npm/read-package-json/issues" }, "dependencies": { - "glob": "^5.0.3", + "glob": "^6.0.0", + "graceful-fs": "^4.1.2", "json-parse-helpfulerror": "^1.0.2", - "normalize-package-data": "^2.0.0", - "graceful-fs": "^4.1.2" + "normalize-package-data": "^2.0.0" }, + "description": "The thing npm uses to read package.json files with semantics and defaults and validation", "devDependencies": { - "standard": "^3.3.1", + "standard": "^5.3.1", "tap": "^1.2.0" }, + "directories": {}, + "dist": { + "shasum": "f8cec1627053b54f384b353224545e607554c5d2", + "tarball": "http://registry.npmjs.org/read-package-json/-/read-package-json-2.0.3.tgz" + }, + "gitHead": "336a212716bb830781d7e71580adaeda377b69d9", + "homepage": "https://github.com/npm/read-package-json#readme", + "license": "ISC", + "main": "read-json.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "name": "read-package-json", "optionalDependencies": { "graceful-fs": "^4.1.2" }, - "license": "ISC", - "readme": "# read-package-json\n\nThis is the thing that npm uses to read package.json files. It\nvalidates some stuff, and loads some default things.\n\nIt keeps a cache of the files you've read, so that you don't end\nup reading the same package.json file multiple times.\n\nNote that if you just want to see what's literally in the package.json\nfile, you can usually do `var data = require('some-module/package.json')`.\n\nThis module is basically only needed by npm, but it's handy to see what\nnpm will see when it looks at your package.\n\n## Usage\n\n```javascript\nvar readJson = require('read-package-json')\n\n// readJson(filename, [logFunction=noop], [strict=false], cb)\nreadJson('/path/to/package.json', console.error, false, function (er, data) {\n if (er) {\n console.error(\"There was an error reading the file\")\n return\n }\n\n console.error('the package data is', data)\n});\n```\n\n## readJson(file, [logFn = noop], [strict = false], cb)\n\n* `file` {String} The path to the package.json file\n* `logFn` {Function} Function to handle logging. Defaults to a noop.\n* `strict` {Boolean} True to enforce SemVer 2.0 version strings, and\n other strict requirements.\n* `cb` {Function} Gets called with `(er, data)`, as is The Node Way.\n\nReads the JSON file and does the things.\n\n## `package.json` Fields\n\nSee `man 5 package.json` or `npm help json`.\n\n## readJson.log\n\nBy default this is a reference to the `npmlog` module. But if that\nmodule can't be found, then it'll be set to just a dummy thing that does\nnothing.\n\nReplace with your own `{log,warn,error}` object for fun loggy time.\n\n## readJson.extras(file, data, cb)\n\nRun all the extra stuff relative to the file, with the parsed data.\n\nModifies the data as it does stuff. Calls the cb when it's done.\n\n## readJson.extraSet = [fn, fn, ...]\n\nArray of functions that are called by `extras`. Each one receives the\narguments `fn(file, data, cb)` and is expected to call `cb(er, data)`\nwhen done or when an error occurs.\n\nOrder is indeterminate, so each function should be completely\nindependent.\n\nMix and match!\n\n## readJson.cache\n\nThe `lru-cache` object that readJson uses to not read the same file over\nand over again. See\n[lru-cache](https://github.com/isaacs/node-lru-cache) for details.\n\n## Other Relevant Files Besides `package.json`\n\nSome other files have an effect on the resulting data object, in the\nfollowing ways:\n\n### `README?(.*)`\n\nIf there is a `README` or `README.*` file present, then npm will attach\na `readme` field to the data with the contents of this file.\n\nOwing to the fact that roughly 100% of existing node modules have\nMarkdown README files, it will generally be assumed to be Markdown,\nregardless of the extension. Please plan accordingly.\n\n### `server.js`\n\nIf there is a `server.js` file, and there is not already a\n`scripts.start` field, then `scripts.start` will be set to `node\nserver.js`.\n\n### `AUTHORS`\n\nIf there is not already a `contributors` field, then the `contributors`\nfield will be set to the contents of the `AUTHORS` file, split by lines,\nand parsed.\n\n### `bindings.gyp`\n\nIf a bindings.gyp file exists, and there is not already a\n`scripts.install` field, then the `scripts.install` field will be set to\n`node-gyp rebuild`.\n\n### `wscript`\n\nIf a wscript file exists, and there is not already a `scripts.install`\nfield, then the `scripts.install` field will be set to `node-waf clean ;\nnode-waf configure build`.\n\nNote that the `bindings.gyp` file supercedes this, since node-waf has\nbeen deprecated in favor of node-gyp.\n\n### `index.js`\n\nIf the json file does not exist, but there is a `index.js` file\npresent instead, and that file has a package comment, then it will try\nto parse the package comment, and use that as the data instead.\n\nA package comment looks like this:\n\n```javascript\n/**package\n * { \"name\": \"my-bare-module\"\n * , \"version\": \"1.2.3\"\n * , \"description\": \"etc....\" }\n **/\n\n// or...\n\n/**package\n{ \"name\": \"my-bare-module\"\n, \"version\": \"1.2.3\"\n, \"description\": \"etc....\" }\n**/\n```\n\nThe important thing is that it starts with `/**package`, and ends with\n`**/`. If the package.json file exists, then the index.js is not\nparsed.\n\n### `{directories.man}/*.[0-9]`\n\nIf there is not already a `man` field defined as an array of files or a\nsingle file, and\nthere is a `directories.man` field defined, then that directory will\nbe searched for manpages.\n\nAny valid manpages found in that directory will be assigned to the `man`\narray, and installed in the appropriate man directory at package install\ntime, when installed globally on a Unix system.\n\n### `{directories.bin}/*`\n\nIf there is not already a `bin` field defined as a string filename or a\nhash of ` : ` pairs, then the `directories.bin`\ndirectory will be searched and all the files within it will be linked as\nexecutables at install time.\n\nWhen installing locally, npm links bins into `node_modules/.bin`, which\nis in the `PATH` environ when npm runs scripts. When\ninstalling globally, they are linked into `{prefix}/bin`, which is\npresumably in the `PATH` environment variable.\n", - "readmeFilename": "README.md", - "gitHead": "d4f9f52c823750e7f2a7b9069bc56b9fd3a0ee96", - "bugs": { - "url": "https://github.com/isaacs/read-package-json/issues" + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/read-package-json.git" + }, + "scripts": { + "test": "standard && tap test/*.js" }, - "homepage": "https://github.com/isaacs/read-package-json#readme", - "_id": "read-package-json@2.0.1", - "_shasum": "b822abfc2c4f0abfe7f52de6448be4560b6e7053", - "_from": "read-package-json@2.0.1" + "version": "2.0.3" } diff --git a/deps/npm/node_modules/read-package-json/test/readmes.js b/deps/npm/node_modules/read-package-json/test/readmes.js index c74cafb9250330..bd891772134720 100644 --- a/deps/npm/node_modules/read-package-json/test/readmes.js +++ b/deps/npm/node_modules/read-package-json/test/readmes.js @@ -5,7 +5,6 @@ var p = path.resolve(__dirname, 'fixtures/readmes/package.json') var readJson = require('../') -var expect = {} var expect = { 'name': 'readmes', 'version': '99.999.999999999', diff --git a/deps/npm/node_modules/read-package-json/zunda b/deps/npm/node_modules/read-package-json/zunda new file mode 100644 index 00000000000000..8a80494483ec17 --- /dev/null +++ b/deps/npm/node_modules/read-package-json/zunda @@ -0,0 +1 @@ +{"_id":"zunda","_rev":"2-d344ae8ca038029c6651c8fd579d3b39","name":"zunda","description":"Zunda for Node.js","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"zunda","version":"0.0.1","author":{"name":"inken"},"description":"Zunda for Node.js","main":"zunda.js","dependencies":{"execsync":"*"},"repository":{"type":"git","url":"https://github.com/inkenkun/node-zunda.git"},"keywords":["zunda"],"homepage":"http://x1.inkenkun.com/","license":"MIT","bugs":{"url":"https://github.com/inkenkun/node-zunda/issues"},"_id":"zunda@0.0.1","dist":{"shasum":"c54fe03aa53efbcf52fcd5c7da4180d3f37871c9","tarball":"http://registry.npmjs.org/zunda/-/zunda-0.0.1.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"inken","email":"inkenkun@gmail.com"},"maintainers":[{"name":"inken","email":"inkenkun@gmail.com"}],"directories":{}}},"readme":"# ZundaJS\r\n\r\nZundaの結果をパースする Node.js 用モジュールです。\r\n\r\n## Installation\r\n\r\n``` shell\r\n$ npm install zunda\r\n```\r\n\r\n\r\n## Usage\r\n\r\n### Asynchronous\r\n\r\n```javascript\r\n\tvar Zunda = new require('zunda')\r\n\t , zunda = new Zunda()\r\n\t;\r\n\tzunda.parse('次郎は大阪に行ったが、太郎は東京には行かず地元に残ろうとした', function(err, result) {\r\n\t\tif (err) throw err;\r\n\t\tconsole.log(result);\r\n\t});\r\n```\r\n\r\n### Synchronous\r\n\r\n```javascript\r\n\tvar Zunda = new require('zunda')\r\n\t , zunda = new Zunda()\r\n\t;\r\n\tvar result = zunda.parseSync('次郎は大阪に行ったが、太郎は東京には行かず地元に残ろうとした');\r\n\tconsole.log(result);\r\n```\r\n\r\n## Result\r\n\r\n\r\n\t [ \r\n\t { event: [ '#EVENT0', '4', 'wr:筆者', '非未来', '0', '叙述', '成立', '0', '0' ],\r\n words: '次郎は大阪に行ったが、',\r\n \t wakachi: '次郎 は 大阪 に 行っ た が 、' },\r\n { event: [ '#EVENT1', '13', 'wr:筆者', '未来', '0', '叙述', '不成立', '0', '0' ],\r\n words: '太郎は東京には行かず',\r\n wakachi: '太郎 は 東京 に は 行か ず' },\r\n { event: [ '#EVENT2', '17', 'wr:筆者', '未来', '0', '意志', '高確率', 'ポジティブ', '0' ],\r\n words: '地元に残ろうとした',\r\n wakachi: '地元 に 残ろ う と し た' },\r\n { event: [ '#EVENT3', '20', 'wr:筆者', '非未来', '0', '叙述', '成立', '0', '0' ],\r\n words: '残ろうとした',\r\n wakachi: '残ろ う と し た' } \r\n ]\r\n\r\n\r\n\r\n## Reference\r\n\r\nhicomiさんの mecab-async https://www.npmjs.org/package/mecab-async を参考にさせていただきました。\r\nzunda https://code.google.com/p/zunda/\r\n","maintainers":[{"name":"inken","email":"inkenkun@gmail.com"}],"time":{"modified":"2014-06-23T01:53:45.429Z","created":"2014-06-23T01:53:45.429Z","0.0.1":"2014-06-23T01:53:45.429Z"},"homepage":"http://x1.inkenkun.com/","keywords":["zunda"],"repository":{"type":"git","url":"https://github.com/inkenkun/node-zunda.git"},"author":{"name":"inken"},"bugs":{"url":"https://github.com/inkenkun/node-zunda/issues"},"license":"MIT","readmeFilename":"README.md","_attachments":{}} \ No newline at end of file diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/.travis.yml b/deps/npm/node_modules/read-package-tree/.travis.yml similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/.travis.yml rename to deps/npm/node_modules/read-package-tree/.travis.yml diff --git a/deps/npm/node_modules/read-package-tree/LICENSE b/deps/npm/node_modules/read-package-tree/LICENSE new file mode 100644 index 00000000000000..19129e315fe593 --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/read-package-tree/README.md b/deps/npm/node_modules/read-package-tree/README.md new file mode 100644 index 00000000000000..b3cda81f7fdcf4 --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/README.md @@ -0,0 +1,68 @@ +# read-package-tree + +Read the contents of node_modules. + +## USAGE + +```javascript +var rpt = require ('read-package-tree') +rpt('/path/to/pkg/root', function (node, kidName) { + // optional filter function– if included, each package folder found is passed to + // it to see if it should be included in the final tree + // node is what we're adding children to + // kidName is the directory name of the module we're considering adding + // return true -> include, false -> skip +}, function (er, data) { + // er means that something didn't work. + // data is a structure like: + // { + // package: + // package.name: defaults to `basename(path)` + // children: [ ] + // parent: + // path: + // realpath: + // isLink: + // target: + // error: + // } +}) +``` + +That's it. It doesn't figure out if dependencies are met, it doesn't +mutate package.json data objects (beyond what +[read-package-json](http://npm.im/read-package-json) already does), it +doesn't limit its search to include/exclude `devDependencies`, or +anything else. + +Just follows the links in the `node_modules` heirarchy and reads the +package.json files it finds therein. + +## Symbolic Links + +When there are symlinks to packages in the `node_modules` hierarchy, a +`Link` object will be created, with a `target` that is a `Node` +object. + +For the most part, you can treat `Link` objects just the same as +`Node` objects. But if your tree-walking program needs to treat +symlinks differently from normal folders, then make sure to check the +object. + +In a given `read-package-tree` run, a specific `path` will always +correspond to a single object, and a specific `realpath` will always +correspond to a single `Node` object. This means that you may not be +able to pass the resulting data object to `JSON.stringify`, because it +may contain cycles. + +## Errors + +Errors parsing or finding a package.json in node_modules will result in a +node with the error property set. We will still find deeper node_modules +if any exist. *Prior to `5.0.0` these aborted tree reading with an error +callback.* + +Only a few classes of errors are fatal (result in an error callback): + +* If the top level location is entirely missing, that will error. +* if `fs.realpath` returns an error for any path its trying to resolve. diff --git a/deps/npm/node_modules/read-package-tree/package.json b/deps/npm/node_modules/read-package-tree/package.json new file mode 100644 index 00000000000000..4691dae1d2ad8b --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/package.json @@ -0,0 +1,62 @@ +{ + "name": "read-package-tree", + "version": "5.1.2", + "description": "Read the contents of node_modules.", + "main": "rpt.js", + "directories": { + "test": "test" + }, + "dependencies": { + "debuglog": "^1.0.1", + "dezalgo": "^1.0.0", + "once": "^1.3.0", + "read-package-json": "^2.0.0", + "readdir-scoped-modules": "^1.0.0" + }, + "devDependencies": { + "archy": "0", + "tap": "^1.2.0" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/read-package-tree.git" + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/read-package-tree/issues" + }, + "homepage": "https://github.com/npm/read-package-tree", + "gitHead": "2ed40c4654804f2a5ddb7b0b2c509080731eea6b", + "_id": "read-package-tree@5.1.2", + "_shasum": "e3a488792f40cf470819f01a610e719d64f09094", + "_from": "read-package-tree@>=5.1.2 <5.2.0", + "_npmVersion": "2.13.3", + "_nodeVersion": "0.12.7", + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "dist": { + "shasum": "e3a488792f40cf470819f01a610e719d64f09094", + "tarball": "http://registry.npmjs.org/read-package-tree/-/read-package-tree-5.1.2.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "_resolved": "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.1.2.tgz" +} diff --git a/deps/npm/node_modules/read-package-tree/rpt.js b/deps/npm/node_modules/read-package-tree/rpt.js new file mode 100644 index 00000000000000..acd91bd8c01434 --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/rpt.js @@ -0,0 +1,190 @@ +var fs = require('fs') +var rpj = require('read-package-json') +var path = require('path') +var dz = require('dezalgo') +var once = require('once') +var readdir = require('readdir-scoped-modules') +var debug = require('debuglog')('rpt') + +function dpath (p) { + if (!p) return '' + if (p.indexOf(process.cwd()) === 0) { + p = p.substr(process.cwd().length + 1) + } + return p +} + +module.exports = rpt + +rpt.Node = Node +rpt.Link = Link + +var ID = 0 +function Node (pkg, logical, physical, er, cache) { + if (cache[physical]) return cache[physical] + + if (!(this instanceof Node)) { + return new Node(pkg, logical, physical, er, cache) + } + + cache[physical] = this + + debug(this.constructor.name, dpath(physical), pkg && pkg._id) + + this.id = ID++ + this.package = pkg || {} + this.path = logical + this.realpath = physical + this.parent = null + this.isLink = false + this.children = [] + this.error = er +} + +Node.prototype.package = null +Node.prototype.path = '' +Node.prototype.realpath = '' +Node.prototype.children = null +Node.prototype.error = null + +function Link (pkg, logical, physical, realpath, er, cache) { + if (cache[physical]) return cache[physical] + + if (!(this instanceof Link)) { + return new Link(pkg, logical, physical, realpath, er, cache) + } + + cache[physical] = this + + debug(this.constructor.name, dpath(physical), pkg && pkg._id) + + this.id = ID++ + this.path = logical + this.realpath = realpath + this.package = pkg || {} + this.parent = null + this.target = new Node(this.package, logical, realpath, er, cache) + this.isLink = true + this.children = this.target.children + this.error = er +} + +Link.prototype = Object.create(Node.prototype, { + constructor: { value: Link } +}) +Link.prototype.target = null +Link.prototype.realpath = '' + +function loadNode (logical, physical, cache, cb) { + debug('loadNode', dpath(logical)) + fs.realpath(physical, function (er, real) { + if (er) return cb(er) + debug('realpath l=%j p=%j real=%j', dpath(logical), dpath(physical), dpath(real)) + var pj = path.resolve(real, 'package.json') + rpj(pj, function (er, pkg) { + pkg = pkg || null + var node + if (physical === real) { + node = new Node(pkg, logical, physical, er, cache) + } else { + node = new Link(pkg, logical, physical, real, er, cache) + } + + cb(null, node) + }) + }) +} + +function loadChildren (node, cache, filterWith, cb) { + debug('loadChildren', dpath(node.path)) + // don't let it be called more than once + cb = once(cb) + var nm = path.resolve(node.path, 'node_modules') + readdir(nm, function (er, kids) { + // If there are no children, that's fine, just return + if (er) return cb(null, node) + + kids = kids.filter(function (kid) { + return kid[0] !== '.' && (!filterWith || filterWith(node, kid)) + }) + + var l = kids . length + if (l === 0) return cb(null, node) + + kids.forEach(function (kid) { + var kidPath = path.resolve(nm, kid) + var kidRealPath = path.resolve(node.realpath,'node_modules',kid) + loadNode(kidPath, kidRealPath, cache, then) + }) + + function then (er, kid) { + if (er) return cb(er) + + node.children.push(kid) + kid.parent = node + if (--l === 0) { + sortChildren(node) + return cb(null, node) + } + } + }) +} + +function sortChildren (node) { + node.children = node.children.sort(function (a, b) { + a = a.package.name ? a.package.name.toLowerCase() : a.path + b = b.package.name ? b.package.name.toLowerCase() : b.path + return a > b ? 1 : -1 + }) +} + +function loadTree (node, did, cache, filterWith, cb) { + debug('loadTree', dpath(node.path), !!cache[node.path]) + + if (did[node.realpath]) { + return dz(cb)(null, node) + } + + did[node.realpath] = true + + cb = once(cb) + loadChildren(node, cache, filterWith, function (er, node) { + if (er) return cb(er) + + var kids = node.children.filter(function (kid) { + return !did[kid.realpath] + }) + + var l = kids.length + if (l === 0) return cb(null, node) + + kids.forEach(function (kid, index) { + loadTree(kid, did, cache, filterWith, then) + }) + + function then (er, kid) { + if (er) return cb(er) + + if (--l === 0) cb(null, node) + } + }) +} + +function rpt (root, filterWith, cb) { + if (!cb) { + cb = filterWith + filterWith = null + } + fs.realpath(root, function (er, realRoot) { + if (er) return cb(er) + debug('rpt', dpath(realRoot)) + var cache = Object.create(null) + loadNode(root, realRoot, cache, function (er, node) { + // if there's an error, it's fine, as long as we got a node + if (!node) return cb(er) + loadTree(node, {}, cache, filterWith, function (lter, tree) { + cb(er && er.code !== 'ENOENT' ? er : lter, tree) + }) + }) + }) +} diff --git a/deps/npm/node_modules/read-package-tree/test/basic.js b/deps/npm/node_modules/read-package-tree/test/basic.js new file mode 100644 index 00000000000000..0dcb538911f3f2 --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/test/basic.js @@ -0,0 +1,155 @@ +var test = require('tap').test +var rpt = require('../rpt.js') +var path = require('path') +var fs = require('fs') +var archy = require('archy') +var fixtures = path.resolve(__dirname, 'fixtures') +var roots = [ 'root', 'other', 'selflink', 'noname' ] +var cwd = path.resolve(__dirname, '..') + +var symlinks = { + 'selflink/node_modules/@scope/z/node_modules/glob': + '../../../foo/node_modules/glob', + 'other/node_modules/glob': + '../../root/node_modules/@scope/x/node_modules/glob', + 'linkedroot': + 'root', + 'deep/root': + '../root', + 'deeproot': + 'deep' +} + +function cleanup () { + Object.keys(symlinks).forEach(function (s) { + var p = path.resolve(cwd, 'test/fixtures', s) + try { + fs.unlinkSync(p) + } catch (er) {} + }) +} + +test('setup symlinks', function (t) { + cleanup() + + Object.keys(symlinks).forEach(function (s) { + var p = path.resolve(cwd, 'test/fixtures', s) + fs.symlinkSync(symlinks [ s ], p, 'dir') + }) + + t.end() +}) + +roots.forEach(function (root) { + var dir = path.resolve(fixtures, root) + var expectedtxt = path.resolve(dir, 'archy.txt') + var expectedre = path.resolve(dir, 'archy.re') + + test(root, function (t) { + rpt(dir, function (er, d) { + if (er && er.code !== 'ENOENT') throw er + + var actual = archy(archyize(d)).trim() + // console . log ('----', dir) + console.log(actual) + // console . log (require ('util') . inspect (d, { + // depth: Infinity + // })) + try { + var expect = fs.readFileSync(expectedtxt, 'utf8').trim() + t.equal(actual, expect, root + ' tree') + } catch (e) { + var expect = new RegExp(fs.readFileSync(expectedre, 'utf8').trim()) + t.like(actual, expect, root + ' tree') + } + t.end() + }) + }) +}) + +test('linkedroot', function (t) { + var dir = path.resolve(fixtures, 'linkedroot') + var out = dir + '-archy.txt' + rpt(dir, function (er, d) { + if (er && er.code !== 'ENOENT') throw er + + var actual = archy(archyize(d)).trim() + console.log(actual) + var expect = fs.readFileSync(out, 'utf8').trim() + t.equal(actual, expect, 'linkedroot tree') + t.end() + }) +}) + +test('deeproot', function (t) { + var dir = path.resolve(fixtures, 'deeproot/root') + var out = path.resolve(fixtures, 'deep') + '-archy.txt' + rpt(dir, function (er, d) { + if (er && er.code !== 'ENOENT') throw er + + var actual = archy(archyize(d)).trim() + console.log(actual) + var expect = fs.readFileSync(out, 'utf8').trim() + t.equal(actual, expect, 'deeproot tree') + t.end() + }) +}) + +test('broken json', function (t) { + rpt(path.resolve(fixtures, 'bad'), function (er, d) { + t.ok(d.error, 'Got an error object') + t.equal(d.error && d.error.code, 'EJSONPARSE') + t.ok(d, 'Got a tree') + t.end() + }) +}) + +test('missing json does not obscure deeper errors', function (t) { + rpt(path.resolve(fixtures, 'empty'), function (er, d) { + var error = d.error + t.ok(error, 'Error reading json of top level') + t.equal(error && error.code, 'ENOENT') + var childError = d.children.length===1 && d.children[0].error + t.ok(childError, 'Error parsing JSON of child node') + t.equal(childError && childError.code, 'EJSONPARSE') + t.end() + }) +}) +test('missing folder', function (t) { + rpt(path.resolve(fixtures, 'does-not-exist'), function (er, d) { + t.ok(er, 'Got an error object') + t.equal(er && er.code, 'ENOENT') + t.ok(!d, 'No tree on top level error') + t.end() + }) +}) + + +function archyize (d, seen) { + seen = seen || {} + var path = d.path + if (d.target) { + path = d.target.path + } + + var label = d.package._id ? d.package._id + ' ' : + d.package.name ? d.package.name + (d.package.version ? '@' + d.package.version : '') + ' ' : + '' + label += path.substr(cwd.length + 1) + + if (d . target) { + return { label: label + ' (symlink)', nodes: [] } + } + + return { + label: label, + nodes: d.children.map(function (kid) { + return archyize(kid, seen) + }) + } +} + +test('cleanup', function (t) { + cleanup() + t.end() +}) diff --git a/deps/npm/node_modules/read-package-tree/test/fixtures/bad/package.json b/deps/npm/node_modules/read-package-tree/test/fixtures/bad/package.json new file mode 100644 index 00000000000000..21d815ec3b0c33 --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/test/fixtures/bad/package.json @@ -0,0 +1,2 @@ +{ + "NOPE" diff --git a/deps/npm/node_modules/read-package-tree/test/fixtures/deep-archy.txt b/deps/npm/node_modules/read-package-tree/test/fixtures/deep-archy.txt new file mode 100644 index 00000000000000..630eab1a493700 --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/test/fixtures/deep-archy.txt @@ -0,0 +1,11 @@ +root@1.2.3 test/fixtures/deeproot/root +├─┬ @scope/x@1.2.3 test/fixtures/deeproot/root/node_modules/@scope/x +│ └─┬ glob@4.0.5 test/fixtures/deeproot/root/node_modules/@scope/x/node_modules/glob +│ ├── graceful-fs@3.0.2 test/fixtures/deeproot/root/node_modules/@scope/x/node_modules/glob/node_modules/graceful-fs +│ ├── inherits@2.0.1 test/fixtures/deeproot/root/node_modules/@scope/x/node_modules/glob/node_modules/inherits +│ ├─┬ minimatch@1.0.0 test/fixtures/deeproot/root/node_modules/@scope/x/node_modules/glob/node_modules/minimatch +│ │ ├── lru-cache@2.5.0 test/fixtures/deeproot/root/node_modules/@scope/x/node_modules/glob/node_modules/minimatch/node_modules/lru-cache +│ │ └── sigmund@1.0.0 test/fixtures/deeproot/root/node_modules/@scope/x/node_modules/glob/node_modules/minimatch/node_modules/sigmund +│ └── once@1.3.0 test/fixtures/deeproot/root/node_modules/@scope/x/node_modules/glob/node_modules/once +├── @scope/y@1.2.3 test/fixtures/deeproot/root/node_modules/@scope/y +└── foo@1.2.3 test/fixtures/deeproot/root/node_modules/foo \ No newline at end of file diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@org/x/.keep b/deps/npm/node_modules/read-package-tree/test/fixtures/deep/.keep similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@org/x/.keep rename to deps/npm/node_modules/read-package-tree/test/fixtures/deep/.keep diff --git a/deps/npm/node_modules/read-package-tree/test/fixtures/empty/node_modules/foo/package.json b/deps/npm/node_modules/read-package-tree/test/fixtures/empty/node_modules/foo/package.json new file mode 100644 index 00000000000000..98232c64fce936 --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/test/fixtures/empty/node_modules/foo/package.json @@ -0,0 +1 @@ +{ diff --git a/deps/npm/node_modules/read-package-tree/test/fixtures/linkedroot-archy.txt b/deps/npm/node_modules/read-package-tree/test/fixtures/linkedroot-archy.txt new file mode 100644 index 00000000000000..e34a46031304d4 --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/test/fixtures/linkedroot-archy.txt @@ -0,0 +1,11 @@ +root@1.2.3 test/fixtures/linkedroot +├─┬ @scope/x@1.2.3 test/fixtures/linkedroot/node_modules/@scope/x +│ └─┬ glob@4.0.5 test/fixtures/linkedroot/node_modules/@scope/x/node_modules/glob +│ ├── graceful-fs@3.0.2 test/fixtures/linkedroot/node_modules/@scope/x/node_modules/glob/node_modules/graceful-fs +│ ├── inherits@2.0.1 test/fixtures/linkedroot/node_modules/@scope/x/node_modules/glob/node_modules/inherits +│ ├─┬ minimatch@1.0.0 test/fixtures/linkedroot/node_modules/@scope/x/node_modules/glob/node_modules/minimatch +│ │ ├── lru-cache@2.5.0 test/fixtures/linkedroot/node_modules/@scope/x/node_modules/glob/node_modules/minimatch/node_modules/lru-cache +│ │ └── sigmund@1.0.0 test/fixtures/linkedroot/node_modules/@scope/x/node_modules/glob/node_modules/minimatch/node_modules/sigmund +│ └── once@1.3.0 test/fixtures/linkedroot/node_modules/@scope/x/node_modules/glob/node_modules/once +├── @scope/y@1.2.3 test/fixtures/linkedroot/node_modules/@scope/y +└── foo@1.2.3 test/fixtures/linkedroot/node_modules/foo \ No newline at end of file diff --git a/deps/npm/node_modules/read-package-tree/test/fixtures/noname/archy.txt b/deps/npm/node_modules/read-package-tree/test/fixtures/noname/archy.txt new file mode 100644 index 00000000000000..03d78dfc69b8b3 --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/test/fixtures/noname/archy.txt @@ -0,0 +1,2 @@ +test/fixtures/noname +└── test/fixtures/noname/node_modules/foo diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@org/y/.keep b/deps/npm/node_modules/read-package-tree/test/fixtures/noname/node_modules/foo/keep-alive similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@org/y/.keep rename to deps/npm/node_modules/read-package-tree/test/fixtures/noname/node_modules/foo/keep-alive diff --git a/deps/npm/node_modules/read-package-tree/test/fixtures/other/archy.txt b/deps/npm/node_modules/read-package-tree/test/fixtures/other/archy.txt new file mode 100644 index 00000000000000..23666226c91820 --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/test/fixtures/other/archy.txt @@ -0,0 +1,2 @@ +test/fixtures/other +└── glob@4.0.5 test/fixtures/other/node_modules/glob (symlink) \ No newline at end of file diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@scope/x/.keep b/deps/npm/node_modules/read-package-tree/test/fixtures/other/node_modules/.bin similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@scope/x/.keep rename to deps/npm/node_modules/read-package-tree/test/fixtures/other/node_modules/.bin diff --git a/deps/npm/node_modules/read-package-tree/test/fixtures/root/archy.txt b/deps/npm/node_modules/read-package-tree/test/fixtures/root/archy.txt new file mode 100644 index 00000000000000..1aacd3f0b7bc65 --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/test/fixtures/root/archy.txt @@ -0,0 +1,11 @@ +root@1.2.3 test/fixtures/root +├─┬ @scope/x@1.2.3 test/fixtures/root/node_modules/@scope/x +│ └─┬ glob@4.0.5 test/fixtures/root/node_modules/@scope/x/node_modules/glob +│ ├── graceful-fs@3.0.2 test/fixtures/root/node_modules/@scope/x/node_modules/glob/node_modules/graceful-fs +│ ├── inherits@2.0.1 test/fixtures/root/node_modules/@scope/x/node_modules/glob/node_modules/inherits +│ ├─┬ minimatch@1.0.0 test/fixtures/root/node_modules/@scope/x/node_modules/glob/node_modules/minimatch +│ │ ├── lru-cache@2.5.0 test/fixtures/root/node_modules/@scope/x/node_modules/glob/node_modules/minimatch/node_modules/lru-cache +│ │ └── sigmund@1.0.0 test/fixtures/root/node_modules/@scope/x/node_modules/glob/node_modules/minimatch/node_modules/sigmund +│ └── once@1.3.0 test/fixtures/root/node_modules/@scope/x/node_modules/glob/node_modules/once +├── @scope/y@1.2.3 test/fixtures/root/node_modules/@scope/y +└── foo@1.2.3 test/fixtures/root/node_modules/foo \ No newline at end of file diff --git a/deps/npm/node_modules/read-package-tree/test/fixtures/root/package.json b/deps/npm/node_modules/read-package-tree/test/fixtures/root/package.json new file mode 100644 index 00000000000000..010347cee63bc5 --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/test/fixtures/root/package.json @@ -0,0 +1,2 @@ +{"name":"root", + "version":"1.2.3"} \ No newline at end of file diff --git a/deps/npm/node_modules/read-package-tree/test/fixtures/selflink/archy.re b/deps/npm/node_modules/read-package-tree/test/fixtures/selflink/archy.re new file mode 100644 index 00000000000000..22e18109b1b37a --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/test/fixtures/selflink/archy.re @@ -0,0 +1,13 @@ +selflink@1[.]2[.]3 test/fixtures/selflink +├── @scope/y@1[.]2[.]3 test/fixtures/selflink/node_modules/@scope/y +├─┬ @scope/z@1[.]2[.]3 test/fixtures/selflink/node_modules/@scope/z +│ └── glob@4[.]0[.]5 test/fixtures/selflink/node_modules/foo/node_modules/glob [(]symlink[)] +└─┬ foo@1[.]2[.]3 test/fixtures/selflink/node_modules/foo + ├─┬ glob@4[.]0[.]5 test/fixtures/selflink/node_modules/foo/node_modules/glob + │ ├── graceful-fs@3[.]0[.]2 test/fixtures/selflink/node_modules/(foo|@scope/z)/node_modules/glob/node_modules/graceful-fs + │ ├── inherits@2[.]0[.]1 test/fixtures/selflink/node_modules/(foo|@scope/z)/node_modules/glob/node_modules/inherits + │ ├─┬ minimatch@1[.]0[.]0 test/fixtures/selflink/node_modules/(foo|@scope/z)/node_modules/glob/node_modules/minimatch + │ │ ├── lru-cache@2[.]5[.]0 test/fixtures/selflink/node_modules/(foo|@scope/z)/node_modules/glob/node_modules/minimatch/node_modules/lru-cache + │ │ └── sigmund@1[.]0[.]0 test/fixtures/selflink/node_modules/(foo|@scope/z)/node_modules/glob/node_modules/minimatch/node_modules/sigmund + │ └── once@1[.]3[.]0 test/fixtures/selflink/node_modules/(foo|@scope/z)/node_modules/glob/node_modules/once + └── selflink@1[.]2[.]3 test/fixtures/selflink [(]symlink[)] diff --git a/deps/npm/node_modules/read-package-tree/test/fixtures/selflink/package.json b/deps/npm/node_modules/read-package-tree/test/fixtures/selflink/package.json new file mode 100644 index 00000000000000..5bbf35e55b8407 --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/test/fixtures/selflink/package.json @@ -0,0 +1,2 @@ +{"name":"selflink", + "version":"1.2.3"} diff --git a/deps/npm/node_modules/read/node_modules/mute-stream/package.json b/deps/npm/node_modules/read/node_modules/mute-stream/package.json index 9cdb30284561ec..ff64101467594a 100644 --- a/deps/npm/node_modules/read/node_modules/mute-stream/package.json +++ b/deps/npm/node_modules/read/node_modules/mute-stream/package.json @@ -27,29 +27,14 @@ }, "license": "ISC", "description": "Bytes go in, but they don't come out (when muted).", - "gitHead": "17d9854a315f56088d039534f87b740e470a9af0", + "readme": "# mute-stream\n\nBytes go in, but they don't come out (when muted).\n\nThis is a basic pass-through stream, but when muted, the bytes are\nsilently dropped, rather than being passed through.\n\n## Usage\n\n```javascript\nvar MuteStream = require('mute-stream')\n\nvar ms = new MuteStream(options)\n\nms.pipe(process.stdout)\nms.write('foo') // writes 'foo' to stdout\nms.mute()\nms.write('bar') // does not write 'bar'\nms.unmute()\nms.write('baz') // writes 'baz' to stdout\n\n// can also be used to mute incoming data\nvar ms = new MuteStream\ninput.pipe(ms)\n\nms.on('data', function (c) {\n console.log('data: ' + c)\n})\n\ninput.emit('data', 'foo') // logs 'foo'\nms.mute()\ninput.emit('data', 'bar') // does not log 'bar'\nms.unmute()\ninput.emit('data', 'baz') // logs 'baz'\n```\n\n## Options\n\nAll options are optional.\n\n* `replace` Set to a string to replace each character with the\n specified string when muted. (So you can show `****` instead of the\n password, for example.)\n\n* `prompt` If you are using a replacement char, and also using a\n prompt with a readline stream (as for a `Password: *****` input),\n then specify what the prompt is so that backspace will work\n properly. Otherwise, pressing backspace will overwrite the prompt\n with the replacement character, which is weird.\n\n## ms.mute()\n\nSet `muted` to `true`. Turns `.write()` into a no-op.\n\n## ms.unmute()\n\nSet `muted` to `false`\n\n## ms.isTTY\n\nTrue if the pipe destination is a TTY, or if the incoming pipe source is\na TTY.\n\n## Other stream methods...\n\nThe other standard readable and writable stream methods are all\navailable. The MuteStream object acts as a facade to its pipe source\nand destination.\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/isaacs/mute-stream/issues" }, "homepage": "https://github.com/isaacs/mute-stream#readme", "_id": "mute-stream@0.0.5", "_shasum": "8fbfabb0a98a253d3184331f9e8deb7372fac6c0", - "_from": "mute-stream@>=0.0.4 <0.1.0", - "_npmVersion": "2.10.0", - "_nodeVersion": "2.0.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "8fbfabb0a98a253d3184331f9e8deb7372fac6c0", - "tarball": "http://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "_resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz" + "_resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz", + "_from": "mute-stream@>=0.0.4 <0.1.0" } diff --git a/deps/npm/node_modules/read/package.json b/deps/npm/node_modules/read/package.json index b8357c6315dde0..f869931811e2a4 100644 --- a/deps/npm/node_modules/read/package.json +++ b/deps/npm/node_modules/read/package.json @@ -28,30 +28,14 @@ "files": [ "lib/read.js" ], - "gitHead": "b14516b9236c40140fd0666567f5d0c588a09a62", + "readme": "## read\n\nFor reading user input from stdin.\n\nSimilar to the `readline` builtin's `question()` method, but with a\nfew more features.\n\n## USAGE\n\n```javascript\nvar read = require(\"read\")\nread(options, callback)\n```\n\nThe callback gets called with either the user input, or the default\nspecified, or an error, as `callback(error, result, isDefault)`\nnode style.\n\n## OPTIONS\n\nEvery option is optional.\n\n* `prompt` What to write to stdout before reading input.\n* `silent` Don't echo the output as the user types it.\n* `replace` Replace silenced characters with the supplied character value.\n* `timeout` Number of ms to wait for user input before giving up.\n* `default` The default value if the user enters nothing.\n* `edit` Allow the user to edit the default value.\n* `terminal` Treat the output as a TTY, whether it is or not.\n* `input` Readable stream to get input data from. (default `process.stdin`)\n* `output` Writeable stream to write prompts to. (default: `process.stdout`)\n\nIf silent is true, and the input is a TTY, then read will set raw\nmode, and read character by character.\n\n## COMPATIBILITY\n\nThis module works sort of with node 0.6. It does not work with node\nversions less than 0.6. It is best on node 0.8.\n\nOn node version 0.6, it will remove all listeners on the input\nstream's `data` and `keypress` events, because the readline module did\nnot fully clean up after itself in that version of node, and did not\nmake it possible to clean up after it in a way that has no potential\nfor side effects.\n\nAdditionally, some of the readline options (like `terminal`) will not\nfunction in versions of node before 0.8, because they were not\nimplemented in the builtin readline module.\n\n## CONTRIBUTING\n\nPatches welcome.\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/isaacs/read/issues" }, "homepage": "https://github.com/isaacs/read#readme", "_id": "read@1.0.7", "_shasum": "b3da19bd052431a97671d44a42634adf710b40c4", - "_from": "read@1.0.7", - "_npmVersion": "3.2.2", - "_nodeVersion": "2.2.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "b3da19bd052431a97671d44a42634adf710b40c4", - "tarball": "http://registry.npmjs.org/read/-/read-1.0.7.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz" + "_resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", + "_from": "read@>=1.0.7 <1.1.0" } diff --git a/deps/npm/node_modules/readable-stream/.travis.yml b/deps/npm/node_modules/readable-stream/.travis.yml new file mode 100644 index 00000000000000..1b82118460cfe4 --- /dev/null +++ b/deps/npm/node_modules/readable-stream/.travis.yml @@ -0,0 +1,52 @@ +sudo: false +language: node_js +before_install: + - npm install -g npm@2 + - npm install -g npm +notifications: + email: false +matrix: + fast_finish: true + allow_failures: + - env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="6.0..latest" + - env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="6.0..latest" + include: + - node_js: '0.8' + env: TASK=test + - node_js: '0.10' + env: TASK=test + - node_js: '0.11' + env: TASK=test + - node_js: '0.12' + env: TASK=test + - node_js: 1 + env: TASK=test + - node_js: 2 + env: TASK=test + - node_js: 3 + env: TASK=test + - node_js: 4 + env: TASK=test + - node_js: 5 + env: TASK=test + - node_js: 5 + env: TASK=browser BROWSER_NAME=android BROWSER_VERSION="4.0..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=ie BROWSER_VERSION="9..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=opera BROWSER_VERSION="11..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=chrome BROWSER_VERSION="-3..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=firefox BROWSER_VERSION="-3..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="6.0..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="6.0..latest" + - node_js: 5 + env: TASK=browser BROWSER_NAME=safari BROWSER_VERSION="5..latest" +script: "npm run $TASK" +env: + global: + - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= + - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.zuul.yml b/deps/npm/node_modules/readable-stream/.zuul.yml similarity index 100% rename from deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.zuul.yml rename to deps/npm/node_modules/readable-stream/.zuul.yml diff --git a/deps/npm/node_modules/readable-stream/README.md b/deps/npm/node_modules/readable-stream/README.md index e46b823903d2c6..1a67c48cd031b5 100644 --- a/deps/npm/node_modules/readable-stream/README.md +++ b/deps/npm/node_modules/readable-stream/README.md @@ -1,15 +1,36 @@ # readable-stream -***Node-core streams for userland*** +***Node-core v5.8.0 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) + [![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) -[![NPM](https://nodei.co/npm-dl/readable-stream.png&months=6&height=3)](https://nodei.co/npm/readable-stream/) +[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) + + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) + +```bash +npm install --save readable-stream +``` + +***Node-core streams for userland*** -This package is a mirror of the Streams2 and Streams3 implementations in Node-core. +This package is a mirror of the Streams2 and Streams3 implementations in +Node-core, including [documentation](doc/stream.markdown). -If you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core. +If you want to guarantee a stable streams base, regardless of what version of +Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). -**readable-stream** comes in two major versions, v1.0.x and v1.1.x. The former tracks the Streams2 implementation in Node 0.10, including bug-fixes and minor improvements as they are added. The latter tracks Streams3 as it develops in Node 0.11; we will likely see a v1.2.x branch for Node 0.12. +As of version 2.0.0 **readable-stream** uses semantic versioning. -**readable-stream** uses proper patch-level versioning so if you pin to `"~1.0.0"` you’ll get the latest Node 0.10 Streams2 implementation, including any fixes and minor non-breaking improvements. The patch-level versions of 1.0.x and 1.1.x should mirror the patch-level versions of Node-core releases. You should prefer the **1.0.x** releases for now and when you’re ready to start using Streams3, pin to `"~1.1.0"` +# Streams WG Team Members +* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> + - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B +* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> + - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 +* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> + - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D +* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> +* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> +* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> diff --git a/deps/npm/node_modules/readable-stream/doc/stream.markdown b/deps/npm/node_modules/readable-stream/doc/stream.markdown new file mode 100644 index 00000000000000..0bc3819e63b025 --- /dev/null +++ b/deps/npm/node_modules/readable-stream/doc/stream.markdown @@ -0,0 +1,1760 @@ +# Stream + + Stability: 2 - Stable + +A stream is an abstract interface implemented by various objects in +Node.js. For example a [request to an HTTP server][http-incoming-message] is a +stream, as is [`process.stdout`][]. Streams are readable, writable, or both. All +streams are instances of [`EventEmitter`][]. + +You can load the Stream base classes by doing `require('stream')`. +There are base classes provided for [Readable][] streams, [Writable][] +streams, [Duplex][] streams, and [Transform][] streams. + +This document is split up into 3 sections: + +1. The first section explains the parts of the API that you need to be + aware of to use streams in your programs. +2. The second section explains the parts of the API that you need to + use if you implement your own custom streams yourself. The API is designed to + make this easy for you to do. +3. The third section goes into more depth about how streams work, + including some of the internal mechanisms and functions that you + should probably not modify unless you definitely know what you are + doing. + + +## API for Stream Consumers + + + +Streams can be either [Readable][], [Writable][], or both ([Duplex][]). + +All streams are EventEmitters, but they also have other custom methods +and properties depending on whether they are Readable, Writable, or +Duplex. + +If a stream is both Readable and Writable, then it implements all of +the methods and events. So, a [Duplex][] or [Transform][] stream is +fully described by this API, though their implementation may be +somewhat different. + +It is not necessary to implement Stream interfaces in order to consume +streams in your programs. If you **are** implementing streaming +interfaces in your own program, please also refer to +[API for Stream Implementors][]. + +Almost all Node.js programs, no matter how simple, use Streams in some +way. Here is an example of using Streams in an Node.js program: + +```js +const http = require('http'); + +var server = http.createServer( (req, res) => { + // req is an http.IncomingMessage, which is a Readable Stream + // res is an http.ServerResponse, which is a Writable Stream + + var body = ''; + // we want to get the data as utf8 strings + // If you don't set an encoding, then you'll get Buffer objects + req.setEncoding('utf8'); + + // Readable streams emit 'data' events once a listener is added + req.on('data', (chunk) => { + body += chunk; + }); + + // the end event tells you that you have entire body + req.on('end', () => { + try { + var data = JSON.parse(body); + } catch (er) { + // uh oh! bad json! + res.statusCode = 400; + return res.end(`error: ${er.message}`); + } + + // write back something interesting to the user: + res.write(typeof data); + res.end(); + }); +}); + +server.listen(1337); + +// $ curl localhost:1337 -d '{}' +// object +// $ curl localhost:1337 -d '"foo"' +// string +// $ curl localhost:1337 -d 'not json' +// error: Unexpected token o +``` + +### Class: stream.Duplex + +Duplex streams are streams that implement both the [Readable][] and +[Writable][] interfaces. + +Examples of Duplex streams include: + +* [TCP sockets][] +* [zlib streams][zlib] +* [crypto streams][crypto] + +### Class: stream.Readable + + + +The Readable stream interface is the abstraction for a *source* of +data that you are reading from. In other words, data comes *out* of a +Readable stream. + +A Readable stream will not start emitting data until you indicate that +you are ready to receive it. + +Readable streams have two "modes": a **flowing mode** and a **paused +mode**. When in flowing mode, data is read from the underlying system +and provided to your program as fast as possible. In paused mode, you +must explicitly call [`stream.read()`][stream-read] to get chunks of data out. +Streams start out in paused mode. + +**Note**: If no data event handlers are attached, and there are no +[`stream.pipe()`][] destinations, and the stream is switched into flowing +mode, then data will be lost. + +You can switch to flowing mode by doing any of the following: + +* Adding a [`'data'`][] event handler to listen for data. +* Calling the [`stream.resume()`][stream-resume] method to explicitly open the + flow. +* Calling the [`stream.pipe()`][] method to send the data to a [Writable][]. + +You can switch back to paused mode by doing either of the following: + +* If there are no pipe destinations, by calling the + [`stream.pause()`][stream-pause] method. +* If there are pipe destinations, by removing any [`'data'`][] event + handlers, and removing all pipe destinations by calling the + [`stream.unpipe()`][] method. + +Note that, for backwards compatibility reasons, removing [`'data'`][] +event handlers will **not** automatically pause the stream. Also, if +there are piped destinations, then calling [`stream.pause()`][stream-pause] will +not guarantee that the stream will *remain* paused once those +destinations drain and ask for more data. + +Examples of readable streams include: + +* [HTTP responses, on the client][http-incoming-message] +* [HTTP requests, on the server][http-incoming-message] +* [fs read streams][] +* [zlib streams][zlib] +* [crypto streams][crypto] +* [TCP sockets][] +* [child process stdout and stderr][] +* [`process.stdin`][] + +#### Event: 'close' + +Emitted when the stream and any of its underlying resources (a file +descriptor, for example) have been closed. The event indicates that +no more events will be emitted, and no further computation will occur. + +Not all streams will emit the `'close'` event. + +#### Event: 'data' + +* `chunk` {Buffer|String} The chunk of data. + +Attaching a `'data'` event listener to a stream that has not been +explicitly paused will switch the stream into flowing mode. Data will +then be passed as soon as it is available. + +If you just want to get all the data out of the stream as fast as +possible, this is the best way to do so. + +```js +var readable = getReadableStreamSomehow(); +readable.on('data', (chunk) => { + console.log('got %d bytes of data', chunk.length); +}); +``` + +#### Event: 'end' + +This event fires when there will be no more data to read. + +Note that the `'end'` event **will not fire** unless the data is +completely consumed. This can be done by switching into flowing mode, +or by calling [`stream.read()`][stream-read] repeatedly until you get to the +end. + +```js +var readable = getReadableStreamSomehow(); +readable.on('data', (chunk) => { + console.log('got %d bytes of data', chunk.length); +}); +readable.on('end', () => { + console.log('there will be no more data.'); +}); +``` + +#### Event: 'error' + +* {Error Object} + +Emitted if there was an error receiving data. + +#### Event: 'readable' + +When a chunk of data can be read from the stream, it will emit a +`'readable'` event. + +In some cases, listening for a `'readable'` event will cause some data +to be read into the internal buffer from the underlying system, if it +hadn't already. + +```javascript +var readable = getReadableStreamSomehow(); +readable.on('readable', () => { + // there is some data to read now +}); +``` + +Once the internal buffer is drained, a `'readable'` event will fire +again when more data is available. + +The `'readable'` event is not emitted in the "flowing" mode with the +sole exception of the last one, on end-of-stream. + +The `'readable'` event indicates that the stream has new information: +either new data is available or the end of the stream has been reached. +In the former case, [`stream.read()`][stream-read] will return that data. In the +latter case, [`stream.read()`][stream-read] will return null. For instance, in +the following example, `foo.txt` is an empty file: + +```js +const fs = require('fs'); +var rr = fs.createReadStream('foo.txt'); +rr.on('readable', () => { + console.log('readable:', rr.read()); +}); +rr.on('end', () => { + console.log('end'); +}); +``` + +The output of running this script is: + +``` +$ node test.js +readable: null +end +``` + +#### readable.isPaused() + +* Return: {Boolean} + +This method returns whether or not the `readable` has been **explicitly** +paused by client code (using [`stream.pause()`][stream-pause] without a +corresponding [`stream.resume()`][stream-resume]). + +```js +var readable = new stream.Readable + +readable.isPaused() // === false +readable.pause() +readable.isPaused() // === true +readable.resume() +readable.isPaused() // === false +``` + +#### readable.pause() + +* Return: `this` + +This method will cause a stream in flowing mode to stop emitting +[`'data'`][] events, switching out of flowing mode. Any data that becomes +available will remain in the internal buffer. + +```js +var readable = getReadableStreamSomehow(); +readable.on('data', (chunk) => { + console.log('got %d bytes of data', chunk.length); + readable.pause(); + console.log('there will be no more data for 1 second'); + setTimeout(() => { + console.log('now data will start flowing again'); + readable.resume(); + }, 1000); +}); +``` + +#### readable.pipe(destination[, options]) + +* `destination` {stream.Writable} The destination for writing data +* `options` {Object} Pipe options + * `end` {Boolean} End the writer when the reader ends. Default = `true` + +This method pulls all the data out of a readable stream, and writes it +to the supplied destination, automatically managing the flow so that +the destination is not overwhelmed by a fast readable stream. + +Multiple destinations can be piped to safely. + +```js +var readable = getReadableStreamSomehow(); +var writable = fs.createWriteStream('file.txt'); +// All the data from readable goes into 'file.txt' +readable.pipe(writable); +``` + +This function returns the destination stream, so you can set up pipe +chains like so: + +```js +var r = fs.createReadStream('file.txt'); +var z = zlib.createGzip(); +var w = fs.createWriteStream('file.txt.gz'); +r.pipe(z).pipe(w); +``` + +For example, emulating the Unix `cat` command: + +```js +process.stdin.pipe(process.stdout); +``` + +By default [`stream.end()`][stream-end] is called on the destination when the +source stream emits [`'end'`][], so that `destination` is no longer writable. +Pass `{ end: false }` as `options` to keep the destination stream open. + +This keeps `writer` open so that "Goodbye" can be written at the +end. + +```js +reader.pipe(writer, { end: false }); +reader.on('end', () => { + writer.end('Goodbye\n'); +}); +``` + +Note that [`process.stderr`][] and [`process.stdout`][] are never closed until +the process exits, regardless of the specified options. + +#### readable.read([size]) + +* `size` {Number} Optional argument to specify how much data to read. +* Return {String|Buffer|Null} + +The `read()` method pulls some data out of the internal buffer and +returns it. If there is no data available, then it will return +`null`. + +If you pass in a `size` argument, then it will return that many +bytes. If `size` bytes are not available, then it will return `null`, +unless we've ended, in which case it will return the data remaining +in the buffer. + +If you do not specify a `size` argument, then it will return all the +data in the internal buffer. + +This method should only be called in paused mode. In flowing mode, +this method is called automatically until the internal buffer is +drained. + +```js +var readable = getReadableStreamSomehow(); +readable.on('readable', () => { + var chunk; + while (null !== (chunk = readable.read())) { + console.log('got %d bytes of data', chunk.length); + } +}); +``` + +If this method returns a data chunk, then it will also trigger the +emission of a [`'data'`][] event. + +Note that calling [`stream.read([size])`][stream-read] after the [`'end'`][] +event has been triggered will return `null`. No runtime error will be raised. + +#### readable.resume() + +* Return: `this` + +This method will cause the readable stream to resume emitting [`'data'`][] +events. + +This method will switch the stream into flowing mode. If you do *not* +want to consume the data from a stream, but you *do* want to get to +its [`'end'`][] event, you can call [`stream.resume()`][stream-resume] to open +the flow of data. + +```js +var readable = getReadableStreamSomehow(); +readable.resume(); +readable.on('end', () => { + console.log('got to the end, but did not read anything'); +}); +``` + +#### readable.setEncoding(encoding) + +* `encoding` {String} The encoding to use. +* Return: `this` + +Call this function to cause the stream to return strings of the specified +encoding instead of Buffer objects. For example, if you do +`readable.setEncoding('utf8')`, then the output data will be interpreted as +UTF-8 data, and returned as strings. If you do `readable.setEncoding('hex')`, +then the data will be encoded in hexadecimal string format. + +This properly handles multi-byte characters that would otherwise be +potentially mangled if you simply pulled the Buffers directly and +called [`buf.toString(encoding)`][] on them. If you want to read the data +as strings, always use this method. + +Also you can disable any encoding at all with `readable.setEncoding(null)`. +This approach is very useful if you deal with binary data or with large +multi-byte strings spread out over multiple chunks. + +```js +var readable = getReadableStreamSomehow(); +readable.setEncoding('utf8'); +readable.on('data', (chunk) => { + assert.equal(typeof chunk, 'string'); + console.log('got %d characters of string data', chunk.length); +}); +``` + +#### readable.unpipe([destination]) + +* `destination` {stream.Writable} Optional specific stream to unpipe + +This method will remove the hooks set up for a previous [`stream.pipe()`][] +call. + +If the destination is not specified, then all pipes are removed. + +If the destination is specified, but no pipe is set up for it, then +this is a no-op. + +```js +var readable = getReadableStreamSomehow(); +var writable = fs.createWriteStream('file.txt'); +// All the data from readable goes into 'file.txt', +// but only for the first second +readable.pipe(writable); +setTimeout(() => { + console.log('stop writing to file.txt'); + readable.unpipe(writable); + console.log('manually close the file stream'); + writable.end(); +}, 1000); +``` + +#### readable.unshift(chunk) + +* `chunk` {Buffer|String} Chunk of data to unshift onto the read queue + +This is useful in certain cases where a stream is being consumed by a +parser, which needs to "un-consume" some data that it has +optimistically pulled out of the source, so that the stream can be +passed on to some other party. + +Note that `stream.unshift(chunk)` cannot be called after the [`'end'`][] event +has been triggered; a runtime error will be raised. + +If you find that you must often call `stream.unshift(chunk)` in your +programs, consider implementing a [Transform][] stream instead. (See [API +for Stream Implementors][].) + +```js +// Pull off a header delimited by \n\n +// use unshift() if we get too much +// Call the callback with (error, header, stream) +const StringDecoder = require('string_decoder').StringDecoder; +function parseHeader(stream, callback) { + stream.on('error', callback); + stream.on('readable', onReadable); + var decoder = new StringDecoder('utf8'); + var header = ''; + function onReadable() { + var chunk; + while (null !== (chunk = stream.read())) { + var str = decoder.write(chunk); + if (str.match(/\n\n/)) { + // found the header boundary + var split = str.split(/\n\n/); + header += split.shift(); + var remaining = split.join('\n\n'); + var buf = new Buffer(remaining, 'utf8'); + if (buf.length) + stream.unshift(buf); + stream.removeListener('error', callback); + stream.removeListener('readable', onReadable); + // now the body of the message can be read from the stream. + callback(null, header, stream); + } else { + // still reading the header. + header += str; + } + } + } +} +``` + +Note that, unlike [`stream.push(chunk)`][stream-push], `stream.unshift(chunk)` +will not end the reading process by resetting the internal reading state of the +stream. This can cause unexpected results if `unshift()` is called during a +read (i.e. from within a [`stream._read()`][stream-_read] implementation on a +custom stream). Following the call to `unshift()` with an immediate +[`stream.push('')`][stream-push] will reset the reading state appropriately, +however it is best to simply avoid calling `unshift()` while in the process of +performing a read. + +#### readable.wrap(stream) + +* `stream` {Stream} An "old style" readable stream + +Versions of Node.js prior to v0.10 had streams that did not implement the +entire Streams API as it is today. (See [Compatibility][] for +more information.) + +If you are using an older Node.js library that emits [`'data'`][] events and +has a [`stream.pause()`][stream-pause] method that is advisory only, then you +can use the `wrap()` method to create a [Readable][] stream that uses the old +stream as its data source. + +You will very rarely ever need to call this function, but it exists +as a convenience for interacting with old Node.js programs and libraries. + +For example: + +```js +const OldReader = require('./old-api-module.js').OldReader; +const Readable = require('stream').Readable; +const oreader = new OldReader; +const myReader = new Readable().wrap(oreader); + +myReader.on('readable', () => { + myReader.read(); // etc. +}); +``` + +### Class: stream.Transform + +Transform streams are [Duplex][] streams where the output is in some way +computed from the input. They implement both the [Readable][] and +[Writable][] interfaces. + +Examples of Transform streams include: + +* [zlib streams][zlib] +* [crypto streams][crypto] + +### Class: stream.Writable + + + +The Writable stream interface is an abstraction for a *destination* +that you are writing data *to*. + +Examples of writable streams include: + +* [HTTP requests, on the client][] +* [HTTP responses, on the server][] +* [fs write streams][] +* [zlib streams][zlib] +* [crypto streams][crypto] +* [TCP sockets][] +* [child process stdin][] +* [`process.stdout`][], [`process.stderr`][] + +#### Event: 'drain' + +If a [`stream.write(chunk)`][stream-write] call returns `false`, then the +`'drain'` event will indicate when it is appropriate to begin writing more data +to the stream. + +```js +// Write the data to the supplied writable stream one million times. +// Be attentive to back-pressure. +function writeOneMillionTimes(writer, data, encoding, callback) { + var i = 1000000; + write(); + function write() { + var ok = true; + do { + i -= 1; + if (i === 0) { + // last time! + writer.write(data, encoding, callback); + } else { + // see if we should continue, or wait + // don't pass the callback, because we're not done yet. + ok = writer.write(data, encoding); + } + } while (i > 0 && ok); + if (i > 0) { + // had to stop early! + // write some more once it drains + writer.once('drain', write); + } + } +} +``` + +#### Event: 'error' + +* {Error} + +Emitted if there was an error when writing or piping data. + +#### Event: 'finish' + +When the [`stream.end()`][stream-end] method has been called, and all data has +been flushed to the underlying system, this event is emitted. + +```javascript +var writer = getWritableStreamSomehow(); +for (var i = 0; i < 100; i ++) { + writer.write('hello, #${i}!\n'); +} +writer.end('this is the end\n'); +writer.on('finish', () => { + console.error('all writes are now complete.'); +}); +``` + +#### Event: 'pipe' + +* `src` {stream.Readable} source stream that is piping to this writable + +This is emitted whenever the [`stream.pipe()`][] method is called on a readable +stream, adding this writable to its set of destinations. + +```js +var writer = getWritableStreamSomehow(); +var reader = getReadableStreamSomehow(); +writer.on('pipe', (src) => { + console.error('something is piping into the writer'); + assert.equal(src, reader); +}); +reader.pipe(writer); +``` + +#### Event: 'unpipe' + +* `src` {[Readable][] Stream} The source stream that + [unpiped][`stream.unpipe()`] this writable + +This is emitted whenever the [`stream.unpipe()`][] method is called on a +readable stream, removing this writable from its set of destinations. + +```js +var writer = getWritableStreamSomehow(); +var reader = getReadableStreamSomehow(); +writer.on('unpipe', (src) => { + console.error('something has stopped piping into the writer'); + assert.equal(src, reader); +}); +reader.pipe(writer); +reader.unpipe(writer); +``` + +#### writable.cork() + +Forces buffering of all writes. + +Buffered data will be flushed either at [`stream.uncork()`][] or at +[`stream.end()`][stream-end] call. + +#### writable.end([chunk][, encoding][, callback]) + +* `chunk` {String|Buffer} Optional data to write +* `encoding` {String} The encoding, if `chunk` is a String +* `callback` {Function} Optional callback for when the stream is finished + +Call this method when no more data will be written to the stream. If supplied, +the callback is attached as a listener on the [`'finish'`][] event. + +Calling [`stream.write()`][stream-write] after calling +[`stream.end()`][stream-end] will raise an error. + +```js +// write 'hello, ' and then end with 'world!' +var file = fs.createWriteStream('example.txt'); +file.write('hello, '); +file.end('world!'); +// writing more now is not allowed! +``` + +#### writable.setDefaultEncoding(encoding) + +* `encoding` {String} The new default encoding + +Sets the default encoding for a writable stream. + +#### writable.uncork() + +Flush all data, buffered since [`stream.cork()`][] call. + +#### writable.write(chunk[, encoding][, callback]) + +* `chunk` {String|Buffer} The data to write +* `encoding` {String} The encoding, if `chunk` is a String +* `callback` {Function} Callback for when this chunk of data is flushed +* Returns: {Boolean} `true` if the data was handled completely. + +This method writes some data to the underlying system, and calls the +supplied callback once the data has been fully handled. + +The return value indicates if you should continue writing right now. +If the data had to be buffered internally, then it will return +`false`. Otherwise, it will return `true`. + +This return value is strictly advisory. You MAY continue to write, +even if it returns `false`. However, writes will be buffered in +memory, so it is best not to do this excessively. Instead, wait for +the [`'drain'`][] event before writing more data. + + +## API for Stream Implementors + + + +To implement any sort of stream, the pattern is the same: + +1. Extend the appropriate parent class in your own subclass. (The + [`util.inherits()`][] method is particularly helpful for this.) +2. Call the appropriate parent class constructor in your constructor, + to be sure that the internal mechanisms are set up properly. +3. Implement one or more specific methods, as detailed below. + +The class to extend and the method(s) to implement depend on the sort +of stream class you are writing: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +

      Use-case

      +
      +

      Class

      +
      +

      Method(s) to implement

      +
      +

      Reading only

      +
      +

      [Readable](#stream_class_stream_readable_1)

      +
      +

      [_read][stream-_read]

      +
      +

      Writing only

      +
      +

      [Writable](#stream_class_stream_writable_1)

      +
      +

      [_write][stream-_write], [_writev][stream-_writev]

      +
      +

      Reading and writing

      +
      +

      [Duplex](#stream_class_stream_duplex_1)

      +
      +

      [_read][stream-_read], [_write][stream-_write], [_writev][stream-_writev]

      +
      +

      Operate on written data, then read the result

      +
      +

      [Transform](#stream_class_stream_transform_1)

      +
      +

      [_transform][stream-_transform], [_flush][stream-_flush]

      +
      + +In your implementation code, it is very important to never call the methods +described in [API for Stream Consumers][]. Otherwise, you can potentially cause +adverse side effects in programs that consume your streaming interfaces. + +### Class: stream.Duplex + + + +A "duplex" stream is one that is both Readable and Writable, such as a TCP +socket connection. + +Note that `stream.Duplex` is an abstract class designed to be extended +with an underlying implementation of the [`stream._read(size)`][stream-_read] +and [`stream._write(chunk, encoding, callback)`][stream-_write] methods as you +would with a Readable or Writable stream class. + +Since JavaScript doesn't have multiple prototypal inheritance, this class +prototypally inherits from Readable, and then parasitically from Writable. It is +thus up to the user to implement both the low-level +[`stream._read(n)`][stream-_read] method as well as the low-level +[`stream._write(chunk, encoding, callback)`][stream-_write] method on extension +duplex classes. + +#### new stream.Duplex(options) + +* `options` {Object} Passed to both Writable and Readable + constructors. Also has the following fields: + * `allowHalfOpen` {Boolean} Default = `true`. If set to `false`, then + the stream will automatically end the readable side when the + writable side ends and vice versa. + * `readableObjectMode` {Boolean} Default = `false`. Sets `objectMode` + for readable side of the stream. Has no effect if `objectMode` + is `true`. + * `writableObjectMode` {Boolean} Default = `false`. Sets `objectMode` + for writable side of the stream. Has no effect if `objectMode` + is `true`. + +In classes that extend the Duplex class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + +### Class: stream.PassThrough + +This is a trivial implementation of a [Transform][] stream that simply +passes the input bytes across to the output. Its purpose is mainly +for examples and testing, but there are occasionally use cases where +it can come in handy as a building block for novel sorts of streams. + +### Class: stream.Readable + + + +`stream.Readable` is an abstract class designed to be extended with an +underlying implementation of the [`stream._read(size)`][stream-_read] method. + +Please see [API for Stream Consumers][] for how to consume +streams in your programs. What follows is an explanation of how to +implement Readable streams in your programs. + +#### new stream.Readable([options]) + +* `options` {Object} + * `highWaterMark` {Number} The maximum number of bytes to store in + the internal buffer before ceasing to read from the underlying + resource. Default = `16384` (16kb), or `16` for `objectMode` streams + * `encoding` {String} If specified, then buffers will be decoded to + strings using the specified encoding. Default = `null` + * `objectMode` {Boolean} Whether this stream should behave + as a stream of objects. Meaning that [`stream.read(n)`][stream-read] returns + a single value instead of a Buffer of size n. Default = `false` + * `read` {Function} Implementation for the [`stream._read()`][stream-_read] + method. + +In classes that extend the Readable class, make sure to call the +Readable constructor so that the buffering settings can be properly +initialized. + +#### readable.\_read(size) + +* `size` {Number} Number of bytes to read asynchronously + +Note: **Implement this method, but do NOT call it directly.** + +This method is prefixed with an underscore because it is internal to the +class that defines it and should only be called by the internal Readable +class methods. All Readable stream implementations must provide a \_read +method to fetch data from the underlying resource. + +When `_read()` is called, if data is available from the resource, the `_read()` +implementation should start pushing that data into the read queue by calling +[`this.push(dataChunk)`][stream-push]. `_read()` should continue reading from +the resource and pushing data until push returns `false`, at which point it +should stop reading from the resource. Only when `_read()` is called again after +it has stopped should it start reading more data from the resource and pushing +that data onto the queue. + +Note: once the `_read()` method is called, it will not be called again until +the [`stream.push()`][stream-push] method is called. + +The `size` argument is advisory. Implementations where a "read" is a +single call that returns data can use this to know how much data to +fetch. Implementations where that is not relevant, such as TCP or +TLS, may ignore this argument, and simply provide data whenever it +becomes available. There is no need, for example to "wait" until +`size` bytes are available before calling [`stream.push(chunk)`][stream-push]. + +#### readable.push(chunk[, encoding]) + + +* `chunk` {Buffer|Null|String} Chunk of data to push into the read queue +* `encoding` {String} Encoding of String chunks. Must be a valid + Buffer encoding, such as `'utf8'` or `'ascii'` +* return {Boolean} Whether or not more pushes should be performed + +Note: **This method should be called by Readable implementors, NOT +by consumers of Readable streams.** + +If a value other than null is passed, The `push()` method adds a chunk of data +into the queue for subsequent stream processors to consume. If `null` is +passed, it signals the end of the stream (EOF), after which no more data +can be written. + +The data added with `push()` can be pulled out by calling the +[`stream.read()`][stream-read] method when the [`'readable'`][] event fires. + +This API is designed to be as flexible as possible. For example, +you may be wrapping a lower-level source which has some sort of +pause/resume mechanism, and a data callback. In those cases, you +could wrap the low-level source object by doing something like this: + +```js +// source is an object with readStop() and readStart() methods, +// and an `ondata` member that gets called when it has data, and +// an `onend` member that gets called when the data is over. + +util.inherits(SourceWrapper, Readable); + +function SourceWrapper(options) { + Readable.call(this, options); + + this._source = getLowlevelSourceObject(); + + // Every time there's data, we push it into the internal buffer. + this._source.ondata = (chunk) => { + // if push() returns false, then we need to stop reading from source + if (!this.push(chunk)) + this._source.readStop(); + }; + + // When the source ends, we push the EOF-signaling `null` chunk + this._source.onend = () => { + this.push(null); + }; +} + +// _read will be called when the stream wants to pull more data in +// the advisory size argument is ignored in this case. +SourceWrapper.prototype._read = function(size) { + this._source.readStart(); +}; +``` + +#### Example: A Counting Stream + + + +This is a basic example of a Readable stream. It emits the numerals +from 1 to 1,000,000 in ascending order, and then ends. + +```js +const Readable = require('stream').Readable; +const util = require('util'); +util.inherits(Counter, Readable); + +function Counter(opt) { + Readable.call(this, opt); + this._max = 1000000; + this._index = 1; +} + +Counter.prototype._read = function() { + var i = this._index++; + if (i > this._max) + this.push(null); + else { + var str = '' + i; + var buf = new Buffer(str, 'ascii'); + this.push(buf); + } +}; +``` + +#### Example: SimpleProtocol v1 (Sub-optimal) + +This is similar to the `parseHeader` function described +[here](#stream_readable_unshift_chunk), but implemented as a custom stream. +Also, note that this implementation does not convert the incoming data to a +string. + +However, this would be better implemented as a [Transform][] stream. See +[SimpleProtocol v2][] for a better implementation. + +```js +// A parser for a simple data protocol. +// The "header" is a JSON object, followed by 2 \n characters, and +// then a message body. +// +// NOTE: This can be done more simply as a Transform stream! +// Using Readable directly for this is sub-optimal. See the +// alternative example below under the Transform section. + +const Readable = require('stream').Readable; +const util = require('util'); + +util.inherits(SimpleProtocol, Readable); + +function SimpleProtocol(source, options) { + if (!(this instanceof SimpleProtocol)) + return new SimpleProtocol(source, options); + + Readable.call(this, options); + this._inBody = false; + this._sawFirstCr = false; + + // source is a readable stream, such as a socket or file + this._source = source; + + var self = this; + source.on('end', () => { + self.push(null); + }); + + // give it a kick whenever the source is readable + // read(0) will not consume any bytes + source.on('readable', () => { + self.read(0); + }); + + this._rawHeader = []; + this.header = null; +} + +SimpleProtocol.prototype._read = function(n) { + if (!this._inBody) { + var chunk = this._source.read(); + + // if the source doesn't have data, we don't have data yet. + if (chunk === null) + return this.push(''); + + // check if the chunk has a \n\n + var split = -1; + for (var i = 0; i < chunk.length; i++) { + if (chunk[i] === 10) { // '\n' + if (this._sawFirstCr) { + split = i; + break; + } else { + this._sawFirstCr = true; + } + } else { + this._sawFirstCr = false; + } + } + + if (split === -1) { + // still waiting for the \n\n + // stash the chunk, and try again. + this._rawHeader.push(chunk); + this.push(''); + } else { + this._inBody = true; + var h = chunk.slice(0, split); + this._rawHeader.push(h); + var header = Buffer.concat(this._rawHeader).toString(); + try { + this.header = JSON.parse(header); + } catch (er) { + this.emit('error', new Error('invalid simple protocol data')); + return; + } + // now, because we got some extra data, unshift the rest + // back into the read queue so that our consumer will see it. + var b = chunk.slice(split); + this.unshift(b); + // calling unshift by itself does not reset the reading state + // of the stream; since we're inside _read, doing an additional + // push('') will reset the state appropriately. + this.push(''); + + // and let them know that we are done parsing the header. + this.emit('header', this.header); + } + } else { + // from there on, just provide the data to our consumer. + // careful not to push(null), since that would indicate EOF. + var chunk = this._source.read(); + if (chunk) this.push(chunk); + } +}; + +// Usage: +// var parser = new SimpleProtocol(source); +// Now parser is a readable stream that will emit 'header' +// with the parsed header data. +``` + +### Class: stream.Transform + +A "transform" stream is a duplex stream where the output is causally +connected in some way to the input, such as a [zlib][] stream or a +[crypto][] stream. + +There is no requirement that the output be the same size as the input, +the same number of chunks, or arrive at the same time. For example, a +Hash stream will only ever have a single chunk of output which is +provided when the input is ended. A zlib stream will produce output +that is either much smaller or much larger than its input. + +Rather than implement the [`stream._read()`][stream-_read] and +[`stream._write()`][stream-_write] methods, Transform classes must implement the +[`stream._transform()`][stream-_transform] method, and may optionally +also implement the [`stream._flush()`][stream-_flush] method. (See below.) + +#### new stream.Transform([options]) + +* `options` {Object} Passed to both Writable and Readable + constructors. Also has the following fields: + * `transform` {Function} Implementation for the + [`stream._transform()`][stream-_transform] method. + * `flush` {Function} Implementation for the [`stream._flush()`][stream-_flush] + method. + +In classes that extend the Transform class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + +#### Events: 'finish' and 'end' + +The [`'finish'`][] and [`'end'`][] events are from the parent Writable +and Readable classes respectively. The `'finish'` event is fired after +[`stream.end()`][stream-end] is called and all chunks have been processed by +[`stream._transform()`][stream-_transform], `'end'` is fired after all data has +been output which is after the callback in [`stream._flush()`][stream-_flush] +has been called. + +#### transform.\_flush(callback) + +* `callback` {Function} Call this function (optionally with an error + argument) when you are done flushing any remaining data. + +Note: **This function MUST NOT be called directly.** It MAY be implemented +by child classes, and if so, will be called by the internal Transform +class methods only. + +In some cases, your transform operation may need to emit a bit more +data at the end of the stream. For example, a `Zlib` compression +stream will store up some internal state so that it can optimally +compress the output. At the end, however, it needs to do the best it +can with what is left, so that the data will be complete. + +In those cases, you can implement a `_flush()` method, which will be +called at the very end, after all the written data is consumed, but +before emitting [`'end'`][] to signal the end of the readable side. Just +like with [`stream._transform()`][stream-_transform], call +`transform.push(chunk)` zero or more times, as appropriate, and call `callback` +when the flush operation is complete. + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +#### transform.\_transform(chunk, encoding, callback) + +* `chunk` {Buffer|String} The chunk to be transformed. Will **always** + be a buffer unless the `decodeStrings` option was set to `false`. +* `encoding` {String} If the chunk is a string, then this is the + encoding type. If chunk is a buffer, then this is the special + value - 'buffer', ignore it in this case. +* `callback` {Function} Call this function (optionally with an error + argument and data) when you are done processing the supplied chunk. + +Note: **This function MUST NOT be called directly.** It should be +implemented by child classes, and called by the internal Transform +class methods only. + +All Transform stream implementations must provide a `_transform()` +method to accept input and produce output. + +`_transform()` should do whatever has to be done in this specific +Transform class, to handle the bytes being written, and pass them off +to the readable portion of the interface. Do asynchronous I/O, +process things, and so on. + +Call `transform.push(outputChunk)` 0 or more times to generate output +from this input chunk, depending on how much data you want to output +as a result of this chunk. + +Call the callback function only when the current chunk is completely +consumed. Note that there may or may not be output as a result of any +particular input chunk. If you supply a second argument to the callback +it will be passed to the push method. In other words the following are +equivalent: + +```js +transform.prototype._transform = function (data, encoding, callback) { + this.push(data); + callback(); +}; + +transform.prototype._transform = function (data, encoding, callback) { + callback(null, data); +}; +``` + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +#### Example: `SimpleProtocol` parser v2 + +The example [here](#stream_example_simpleprotocol_v1_sub_optimal) of a simple +protocol parser can be implemented simply by using the higher level +[Transform][] stream class, similar to the `parseHeader` and `SimpleProtocol +v1` examples. + +In this example, rather than providing the input as an argument, it +would be piped into the parser, which is a more idiomatic Node.js stream +approach. + +```javascript +const util = require('util'); +const Transform = require('stream').Transform; +util.inherits(SimpleProtocol, Transform); + +function SimpleProtocol(options) { + if (!(this instanceof SimpleProtocol)) + return new SimpleProtocol(options); + + Transform.call(this, options); + this._inBody = false; + this._sawFirstCr = false; + this._rawHeader = []; + this.header = null; +} + +SimpleProtocol.prototype._transform = function(chunk, encoding, done) { + if (!this._inBody) { + // check if the chunk has a \n\n + var split = -1; + for (var i = 0; i < chunk.length; i++) { + if (chunk[i] === 10) { // '\n' + if (this._sawFirstCr) { + split = i; + break; + } else { + this._sawFirstCr = true; + } + } else { + this._sawFirstCr = false; + } + } + + if (split === -1) { + // still waiting for the \n\n + // stash the chunk, and try again. + this._rawHeader.push(chunk); + } else { + this._inBody = true; + var h = chunk.slice(0, split); + this._rawHeader.push(h); + var header = Buffer.concat(this._rawHeader).toString(); + try { + this.header = JSON.parse(header); + } catch (er) { + this.emit('error', new Error('invalid simple protocol data')); + return; + } + // and let them know that we are done parsing the header. + this.emit('header', this.header); + + // now, because we got some extra data, emit this first. + this.push(chunk.slice(split)); + } + } else { + // from there on, just provide the data to our consumer as-is. + this.push(chunk); + } + done(); +}; + +// Usage: +// var parser = new SimpleProtocol(); +// source.pipe(parser) +// Now parser is a readable stream that will emit 'header' +// with the parsed header data. +``` + +### Class: stream.Writable + + + +`stream.Writable` is an abstract class designed to be extended with an +underlying implementation of the +[`stream._write(chunk, encoding, callback)`][stream-_write] method. + +Please see [API for Stream Consumers][] for how to consume +writable streams in your programs. What follows is an explanation of +how to implement Writable streams in your programs. + +#### new stream.Writable([options]) + +* `options` {Object} + * `highWaterMark` {Number} Buffer level when + [`stream.write()`][stream-write] starts returning `false`. Default = `16384` + (16kb), or `16` for `objectMode` streams. + * `decodeStrings` {Boolean} Whether or not to decode strings into + Buffers before passing them to [`stream._write()`][stream-_write]. + Default = `true` + * `objectMode` {Boolean} Whether or not the + [`stream.write(anyObj)`][stream-write] is a valid operation. If set you can + write arbitrary data instead of only `Buffer` / `String` data. + Default = `false` + * `write` {Function} Implementation for the + [`stream._write()`][stream-_write] method. + * `writev` {Function} Implementation for the + [`stream._writev()`][stream-_writev] method. + +In classes that extend the Writable class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + +#### writable.\_write(chunk, encoding, callback) + +* `chunk` {Buffer|String} The chunk to be written. Will **always** + be a buffer unless the `decodeStrings` option was set to `false`. +* `encoding` {String} If the chunk is a string, then this is the + encoding type. If chunk is a buffer, then this is the special + value - 'buffer', ignore it in this case. +* `callback` {Function} Call this function (optionally with an error + argument) when you are done processing the supplied chunk. + +All Writable stream implementations must provide a +[`stream._write()`][stream-_write] method to send data to the underlying +resource. + +Note: **This function MUST NOT be called directly.** It should be +implemented by child classes, and called by the internal Writable +class methods only. + +Call the callback using the standard `callback(error)` pattern to +signal that the write completed successfully or with an error. + +If the `decodeStrings` flag is set in the constructor options, then +`chunk` may be a string rather than a Buffer, and `encoding` will +indicate the sort of string that it is. This is to support +implementations that have an optimized handling for certain string +data encodings. If you do not explicitly set the `decodeStrings` +option to `false`, then you can safely ignore the `encoding` argument, +and assume that `chunk` will always be a Buffer. + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +#### writable.\_writev(chunks, callback) + +* `chunks` {Array} The chunks to be written. Each chunk has following + format: `{ chunk: ..., encoding: ... }`. +* `callback` {Function} Call this function (optionally with an error + argument) when you are done processing the supplied chunks. + +Note: **This function MUST NOT be called directly.** It may be +implemented by child classes, and called by the internal Writable +class methods only. + +This function is completely optional to implement. In most cases it is +unnecessary. If implemented, it will be called with all the chunks +that are buffered in the write queue. + + +## Simplified Constructor API + + + +In simple cases there is now the added benefit of being able to construct a +stream without inheritance. + +This can be done by passing the appropriate methods as constructor options: + +Examples: + +### Duplex + +```js +var duplex = new stream.Duplex({ + read: function(n) { + // sets this._read under the hood + + // push data onto the read queue, passing null + // will signal the end of the stream (EOF) + this.push(chunk); + }, + write: function(chunk, encoding, next) { + // sets this._write under the hood + + // An optional error can be passed as the first argument + next() + } +}); + +// or + +var duplex = new stream.Duplex({ + read: function(n) { + // sets this._read under the hood + + // push data onto the read queue, passing null + // will signal the end of the stream (EOF) + this.push(chunk); + }, + writev: function(chunks, next) { + // sets this._writev under the hood + + // An optional error can be passed as the first argument + next() + } +}); +``` + +### Readable + +```js +var readable = new stream.Readable({ + read: function(n) { + // sets this._read under the hood + + // push data onto the read queue, passing null + // will signal the end of the stream (EOF) + this.push(chunk); + } +}); +``` + +### Transform + +```js +var transform = new stream.Transform({ + transform: function(chunk, encoding, next) { + // sets this._transform under the hood + + // generate output as many times as needed + // this.push(chunk); + + // call when the current chunk is consumed + next(); + }, + flush: function(done) { + // sets this._flush under the hood + + // generate output as many times as needed + // this.push(chunk); + + done(); + } +}); +``` + +### Writable + +```js +var writable = new stream.Writable({ + write: function(chunk, encoding, next) { + // sets this._write under the hood + + // An optional error can be passed as the first argument + next() + } +}); + +// or + +var writable = new stream.Writable({ + writev: function(chunks, next) { + // sets this._writev under the hood + + // An optional error can be passed as the first argument + next() + } +}); +``` + +## Streams: Under the Hood + + + +### Buffering + + + +Both Writable and Readable streams will buffer data on an internal +object which can be retrieved from `_writableState.getBuffer()` or +`_readableState.buffer`, respectively. + +The amount of data that will potentially be buffered depends on the +`highWaterMark` option which is passed into the constructor. + +Buffering in Readable streams happens when the implementation calls +[`stream.push(chunk)`][stream-push]. If the consumer of the Stream does not +call [`stream.read()`][stream-read], then the data will sit in the internal +queue until it is consumed. + +Buffering in Writable streams happens when the user calls +[`stream.write(chunk)`][stream-write] repeatedly, even when it returns `false`. + +The purpose of streams, especially with the [`stream.pipe()`][] method, is to +limit the buffering of data to acceptable levels, so that sources and +destinations of varying speed will not overwhelm the available memory. + +### Compatibility with Older Node.js Versions + + + +In versions of Node.js prior to v0.10, the Readable stream interface was +simpler, but also less powerful and less useful. + +* Rather than waiting for you to call the [`stream.read()`][stream-read] method, + [`'data'`][] events would start emitting immediately. If you needed to do + some I/O to decide how to handle data, then you had to store the chunks + in some kind of buffer so that they would not be lost. +* The [`stream.pause()`][stream-pause] method was advisory, rather than + guaranteed. This meant that you still had to be prepared to receive + [`'data'`][] events even when the stream was in a paused state. + +In Node.js v0.10, the [Readable][] class was added. +For backwards compatibility with older Node.js programs, Readable streams +switch into "flowing mode" when a [`'data'`][] event handler is added, or +when the [`stream.resume()`][stream-resume] method is called. The effect is +that, even if you are not using the new [`stream.read()`][stream-read] method +and [`'readable'`][] event, you no longer have to worry about losing +[`'data'`][] chunks. + +Most programs will continue to function normally. However, this +introduces an edge case in the following conditions: + +* No [`'data'`][] event handler is added. +* The [`stream.resume()`][stream-resume] method is never called. +* The stream is not piped to any writable destination. + +For example, consider the following code: + +```js +// WARNING! BROKEN! +net.createServer((socket) => { + + // we add an 'end' method, but never consume the data + socket.on('end', () => { + // It will never get here. + socket.end('I got your message (but didnt read it)\n'); + }); + +}).listen(1337); +``` + +In versions of Node.js prior to v0.10, the incoming message data would be +simply discarded. However, in Node.js v0.10 and beyond, +the socket will remain paused forever. + +The workaround in this situation is to call the +[`stream.resume()`][stream-resume] method to start the flow of data: + +```js +// Workaround +net.createServer((socket) => { + + socket.on('end', () => { + socket.end('I got your message (but didnt read it)\n'); + }); + + // start the flow of data, discarding it. + socket.resume(); + +}).listen(1337); +``` + +In addition to new Readable streams switching into flowing mode, +pre-v0.10 style streams can be wrapped in a Readable class using the +[`stream.wrap()`][] method. + + +### Object Mode + + + +Normally, Streams operate on Strings and Buffers exclusively. + +Streams that are in **object mode** can emit generic JavaScript values +other than Buffers and Strings. + +A Readable stream in object mode will always return a single item from +a call to [`stream.read(size)`][stream-read], regardless of what the size +argument is. + +A Writable stream in object mode will always ignore the `encoding` +argument to [`stream.write(data, encoding)`][stream-write]. + +The special value `null` still retains its special value for object +mode streams. That is, for object mode readable streams, `null` as a +return value from [`stream.read()`][stream-read] indicates that there is no more +data, and [`stream.push(null)`][stream-push] will signal the end of stream data +(`EOF`). + +No streams in Node.js core are object mode streams. This pattern is only +used by userland streaming libraries. + +You should set `objectMode` in your stream child class constructor on +the options object. Setting `objectMode` mid-stream is not safe. + +For Duplex streams `objectMode` can be set exclusively for readable or +writable side with `readableObjectMode` and `writableObjectMode` +respectively. These options can be used to implement parsers and +serializers with Transform streams. + +```js +const util = require('util'); +const StringDecoder = require('string_decoder').StringDecoder; +const Transform = require('stream').Transform; +util.inherits(JSONParseStream, Transform); + +// Gets \n-delimited JSON string data, and emits the parsed objects +function JSONParseStream() { + if (!(this instanceof JSONParseStream)) + return new JSONParseStream(); + + Transform.call(this, { readableObjectMode : true }); + + this._buffer = ''; + this._decoder = new StringDecoder('utf8'); +} + +JSONParseStream.prototype._transform = function(chunk, encoding, cb) { + this._buffer += this._decoder.write(chunk); + // split on newlines + var lines = this._buffer.split(/\r?\n/); + // keep the last partial line buffered + this._buffer = lines.pop(); + for (var l = 0; l < lines.length; l++) { + var line = lines[l]; + try { + var obj = JSON.parse(line); + } catch (er) { + this.emit('error', er); + return; + } + // push the parsed object out to the readable consumer + this.push(obj); + } + cb(); +}; + +JSONParseStream.prototype._flush = function(cb) { + // Just handle any leftover + var rem = this._buffer.trim(); + if (rem) { + try { + var obj = JSON.parse(rem); + } catch (er) { + this.emit('error', er); + return; + } + // push the parsed object out to the readable consumer + this.push(obj); + } + cb(); +}; +``` + +### `stream.read(0)` + +There are some cases where you want to trigger a refresh of the +underlying readable stream mechanisms, without actually consuming any +data. In that case, you can call `stream.read(0)`, which will always +return null. + +If the internal read buffer is below the `highWaterMark`, and the +stream is not currently reading, then calling `stream.read(0)` will trigger +a low-level [`stream._read()`][stream-_read] call. + +There is almost never a need to do this. However, you will see some +cases in Node.js's internals where this is done, particularly in the +Readable stream class internals. + +### `stream.push('')` + +Pushing a zero-byte string or Buffer (when not in [Object mode][]) has an +interesting side effect. Because it *is* a call to +[`stream.push()`][stream-push], it will end the `reading` process. However, it +does *not* add any data to the readable buffer, so there's nothing for +a user to consume. + +Very rarely, there are cases where you have no data to provide now, +but the consumer of your stream (or, perhaps, another bit of your own +code) will know when to check again, by calling [`stream.read(0)`][stream-read]. +In those cases, you *may* call `stream.push('')`. + +So far, the only use case for this functionality is in the +[`tls.CryptoStream`][] class, which is deprecated in Node.js/io.js v1.0. If you +find that you have to use `stream.push('')`, please consider another +approach, because it almost certainly indicates that something is +horribly wrong. + +[`'data'`]: #stream_event_data +[`'drain'`]: #stream_event_drain +[`'end'`]: #stream_event_end +[`'finish'`]: #stream_event_finish +[`'readable'`]: #stream_event_readable +[`buf.toString(encoding)`]: https://nodejs.org/docs/v5.8.0/api/buffer.html#buffer_buf_tostring_encoding_start_end +[`EventEmitter`]: https://nodejs.org/docs/v5.8.0/api/events.html#events_class_eventemitter +[`process.stderr`]: https://nodejs.org/docs/v5.8.0/api/process.html#process_process_stderr +[`process.stdin`]: https://nodejs.org/docs/v5.8.0/api/process.html#process_process_stdin +[`process.stdout`]: https://nodejs.org/docs/v5.8.0/api/process.html#process_process_stdout +[`stream.cork()`]: #stream_writable_cork +[`stream.pipe()`]: #stream_readable_pipe_destination_options +[`stream.uncork()`]: #stream_writable_uncork +[`stream.unpipe()`]: #stream_readable_unpipe_destination +[`stream.wrap()`]: #stream_readable_wrap_stream +[`tls.CryptoStream`]: https://nodejs.org/docs/v5.8.0/api/tls.html#tls_class_cryptostream +[`util.inherits()`]: https://nodejs.org/docs/v5.8.0/api/util.html#util_util_inherits_constructor_superconstructor +[API for Stream Consumers]: #stream_api_for_stream_consumers +[API for Stream Implementors]: #stream_api_for_stream_implementors +[child process stdin]: https://nodejs.org/docs/v5.8.0/api/child_process.html#child_process_child_stdin +[child process stdout and stderr]: https://nodejs.org/docs/v5.8.0/api/child_process.html#child_process_child_stdout +[Compatibility]: #stream_compatibility_with_older_node_js_versions +[crypto]: crypto.html +[Duplex]: #stream_class_stream_duplex +[fs read streams]: https://nodejs.org/docs/v5.8.0/api/fs.html#fs_class_fs_readstream +[fs write streams]: https://nodejs.org/docs/v5.8.0/api/fs.html#fs_class_fs_writestream +[HTTP requests, on the client]: https://nodejs.org/docs/v5.8.0/api/http.html#http_class_http_clientrequest +[HTTP responses, on the server]: https://nodejs.org/docs/v5.8.0/api/http.html#http_class_http_serverresponse +[http-incoming-message]: https://nodejs.org/docs/v5.8.0/api/http.html#http_class_http_incomingmessage +[Object mode]: #stream_object_mode +[Readable]: #stream_class_stream_readable +[SimpleProtocol v2]: #stream_example_simpleprotocol_parser_v2 +[stream-_flush]: #stream_transform_flush_callback +[stream-_read]: #stream_readable_read_size_1 +[stream-_transform]: #stream_transform_transform_chunk_encoding_callback +[stream-_write]: #stream_writable_write_chunk_encoding_callback_1 +[stream-_writev]: #stream_writable_writev_chunks_callback +[stream-end]: #stream_writable_end_chunk_encoding_callback +[stream-pause]: #stream_readable_pause +[stream-push]: #stream_readable_push_chunk_encoding +[stream-read]: #stream_readable_read_size +[stream-resume]: #stream_readable_resume +[stream-write]: #stream_writable_write_chunk_encoding_callback +[TCP sockets]: https://nodejs.org/docs/v5.8.0/api/net.html#net_class_net_socket +[Transform]: #stream_class_stream_transform +[Writable]: #stream_class_stream_writable +[zlib]: zlib.html diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md similarity index 100% rename from deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md rename to deps/npm/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md diff --git a/deps/npm/node_modules/readable-stream/float.patch b/deps/npm/node_modules/readable-stream/float.patch deleted file mode 100644 index 7abb6dc30b21bf..00000000000000 --- a/deps/npm/node_modules/readable-stream/float.patch +++ /dev/null @@ -1,922 +0,0 @@ -diff --git a/lib/_stream_duplex.js b/lib/_stream_duplex.js -index c5a741c..a2e0d8e 100644 ---- a/lib/_stream_duplex.js -+++ b/lib/_stream_duplex.js -@@ -26,8 +26,8 @@ - - module.exports = Duplex; - var util = require('util'); --var Readable = require('_stream_readable'); --var Writable = require('_stream_writable'); -+var Readable = require('./_stream_readable'); -+var Writable = require('./_stream_writable'); - - util.inherits(Duplex, Readable); - -diff --git a/lib/_stream_passthrough.js b/lib/_stream_passthrough.js -index a5e9864..330c247 100644 ---- a/lib/_stream_passthrough.js -+++ b/lib/_stream_passthrough.js -@@ -25,7 +25,7 @@ - - module.exports = PassThrough; - --var Transform = require('_stream_transform'); -+var Transform = require('./_stream_transform'); - var util = require('util'); - util.inherits(PassThrough, Transform); - -diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js -index 0c3fe3e..90a8298 100644 ---- a/lib/_stream_readable.js -+++ b/lib/_stream_readable.js -@@ -23,10 +23,34 @@ module.exports = Readable; - Readable.ReadableState = ReadableState; - - var EE = require('events').EventEmitter; -+if (!EE.listenerCount) EE.listenerCount = function(emitter, type) { -+ return emitter.listeners(type).length; -+}; -+ -+if (!global.setImmediate) global.setImmediate = function setImmediate(fn) { -+ return setTimeout(fn, 0); -+}; -+if (!global.clearImmediate) global.clearImmediate = function clearImmediate(i) { -+ return clearTimeout(i); -+}; -+ - var Stream = require('stream'); - var util = require('util'); -+if (!util.isUndefined) { -+ var utilIs = require('core-util-is'); -+ for (var f in utilIs) { -+ util[f] = utilIs[f]; -+ } -+} - var StringDecoder; --var debug = util.debuglog('stream'); -+var debug; -+if (util.debuglog) -+ debug = util.debuglog('stream'); -+else try { -+ debug = require('debuglog')('stream'); -+} catch (er) { -+ debug = function() {}; -+} - - util.inherits(Readable, Stream); - -@@ -380,7 +404,7 @@ function chunkInvalid(state, chunk) { - - - function onEofChunk(stream, state) { -- if (state.decoder && !state.ended) { -+ if (state.decoder && !state.ended && state.decoder.end) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); -diff --git a/lib/_stream_transform.js b/lib/_stream_transform.js -index b1f9fcc..b0caf57 100644 ---- a/lib/_stream_transform.js -+++ b/lib/_stream_transform.js -@@ -64,8 +64,14 @@ - - module.exports = Transform; - --var Duplex = require('_stream_duplex'); -+var Duplex = require('./_stream_duplex'); - var util = require('util'); -+if (!util.isUndefined) { -+ var utilIs = require('core-util-is'); -+ for (var f in utilIs) { -+ util[f] = utilIs[f]; -+ } -+} - util.inherits(Transform, Duplex); - - -diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js -index ba2e920..f49288b 100644 ---- a/lib/_stream_writable.js -+++ b/lib/_stream_writable.js -@@ -27,6 +27,12 @@ module.exports = Writable; - Writable.WritableState = WritableState; - - var util = require('util'); -+if (!util.isUndefined) { -+ var utilIs = require('core-util-is'); -+ for (var f in utilIs) { -+ util[f] = utilIs[f]; -+ } -+} - var Stream = require('stream'); - - util.inherits(Writable, Stream); -@@ -119,7 +125,7 @@ function WritableState(options, stream) { - function Writable(options) { - // Writable ctor is applied to Duplexes, though they're not - // instanceof Writable, they're instanceof Readable. -- if (!(this instanceof Writable) && !(this instanceof Stream.Duplex)) -+ if (!(this instanceof Writable) && !(this instanceof require('./_stream_duplex'))) - return new Writable(options); - - this._writableState = new WritableState(options, this); -diff --git a/test/simple/test-stream-big-push.js b/test/simple/test-stream-big-push.js -index e3787e4..8cd2127 100644 ---- a/test/simple/test-stream-big-push.js -+++ b/test/simple/test-stream-big-push.js -@@ -21,7 +21,7 @@ - - var common = require('../common'); - var assert = require('assert'); --var stream = require('stream'); -+var stream = require('../../'); - var str = 'asdfasdfasdfasdfasdf'; - - var r = new stream.Readable({ -diff --git a/test/simple/test-stream-end-paused.js b/test/simple/test-stream-end-paused.js -index bb73777..d40efc7 100644 ---- a/test/simple/test-stream-end-paused.js -+++ b/test/simple/test-stream-end-paused.js -@@ -25,7 +25,7 @@ var gotEnd = false; - - // Make sure we don't miss the end event for paused 0-length streams - --var Readable = require('stream').Readable; -+var Readable = require('../../').Readable; - var stream = new Readable(); - var calledRead = false; - stream._read = function() { -diff --git a/test/simple/test-stream-pipe-after-end.js b/test/simple/test-stream-pipe-after-end.js -index b46ee90..0be8366 100644 ---- a/test/simple/test-stream-pipe-after-end.js -+++ b/test/simple/test-stream-pipe-after-end.js -@@ -22,8 +22,8 @@ - var common = require('../common'); - var assert = require('assert'); - --var Readable = require('_stream_readable'); --var Writable = require('_stream_writable'); -+var Readable = require('../../lib/_stream_readable'); -+var Writable = require('../../lib/_stream_writable'); - var util = require('util'); - - util.inherits(TestReadable, Readable); -diff --git a/test/simple/test-stream-pipe-cleanup.js b/test/simple/test-stream-pipe-cleanup.js -deleted file mode 100644 -index f689358..0000000 ---- a/test/simple/test-stream-pipe-cleanup.js -+++ /dev/null -@@ -1,122 +0,0 @@ --// Copyright Joyent, Inc. and other Node contributors. --// --// 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. -- --// This test asserts that Stream.prototype.pipe does not leave listeners --// hanging on the source or dest. -- --var common = require('../common'); --var stream = require('stream'); --var assert = require('assert'); --var util = require('util'); -- --function Writable() { -- this.writable = true; -- this.endCalls = 0; -- stream.Stream.call(this); --} --util.inherits(Writable, stream.Stream); --Writable.prototype.end = function() { -- this.endCalls++; --}; -- --Writable.prototype.destroy = function() { -- this.endCalls++; --}; -- --function Readable() { -- this.readable = true; -- stream.Stream.call(this); --} --util.inherits(Readable, stream.Stream); -- --function Duplex() { -- this.readable = true; -- Writable.call(this); --} --util.inherits(Duplex, Writable); -- --var i = 0; --var limit = 100; -- --var w = new Writable(); -- --var r; -- --for (i = 0; i < limit; i++) { -- r = new Readable(); -- r.pipe(w); -- r.emit('end'); --} --assert.equal(0, r.listeners('end').length); --assert.equal(limit, w.endCalls); -- --w.endCalls = 0; -- --for (i = 0; i < limit; i++) { -- r = new Readable(); -- r.pipe(w); -- r.emit('close'); --} --assert.equal(0, r.listeners('close').length); --assert.equal(limit, w.endCalls); -- --w.endCalls = 0; -- --r = new Readable(); -- --for (i = 0; i < limit; i++) { -- w = new Writable(); -- r.pipe(w); -- w.emit('close'); --} --assert.equal(0, w.listeners('close').length); -- --r = new Readable(); --w = new Writable(); --var d = new Duplex(); --r.pipe(d); // pipeline A --d.pipe(w); // pipeline B --assert.equal(r.listeners('end').length, 2); // A.onend, A.cleanup --assert.equal(r.listeners('close').length, 2); // A.onclose, A.cleanup --assert.equal(d.listeners('end').length, 2); // B.onend, B.cleanup --assert.equal(d.listeners('close').length, 3); // A.cleanup, B.onclose, B.cleanup --assert.equal(w.listeners('end').length, 0); --assert.equal(w.listeners('close').length, 1); // B.cleanup -- --r.emit('end'); --assert.equal(d.endCalls, 1); --assert.equal(w.endCalls, 0); --assert.equal(r.listeners('end').length, 0); --assert.equal(r.listeners('close').length, 0); --assert.equal(d.listeners('end').length, 2); // B.onend, B.cleanup --assert.equal(d.listeners('close').length, 2); // B.onclose, B.cleanup --assert.equal(w.listeners('end').length, 0); --assert.equal(w.listeners('close').length, 1); // B.cleanup -- --d.emit('end'); --assert.equal(d.endCalls, 1); --assert.equal(w.endCalls, 1); --assert.equal(r.listeners('end').length, 0); --assert.equal(r.listeners('close').length, 0); --assert.equal(d.listeners('end').length, 0); --assert.equal(d.listeners('close').length, 0); --assert.equal(w.listeners('end').length, 0); --assert.equal(w.listeners('close').length, 0); -diff --git a/test/simple/test-stream-pipe-error-handling.js b/test/simple/test-stream-pipe-error-handling.js -index c5d724b..c7d6b7d 100644 ---- a/test/simple/test-stream-pipe-error-handling.js -+++ b/test/simple/test-stream-pipe-error-handling.js -@@ -21,7 +21,7 @@ - - var common = require('../common'); - var assert = require('assert'); --var Stream = require('stream').Stream; -+var Stream = require('../../').Stream; - - (function testErrorListenerCatches() { - var source = new Stream(); -diff --git a/test/simple/test-stream-pipe-event.js b/test/simple/test-stream-pipe-event.js -index cb9d5fe..56f8d61 100644 ---- a/test/simple/test-stream-pipe-event.js -+++ b/test/simple/test-stream-pipe-event.js -@@ -20,7 +20,7 @@ - // USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common'); --var stream = require('stream'); -+var stream = require('../../'); - var assert = require('assert'); - var util = require('util'); - -diff --git a/test/simple/test-stream-push-order.js b/test/simple/test-stream-push-order.js -index f2e6ec2..a5c9bf9 100644 ---- a/test/simple/test-stream-push-order.js -+++ b/test/simple/test-stream-push-order.js -@@ -20,7 +20,7 @@ - // USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common.js'); --var Readable = require('stream').Readable; -+var Readable = require('../../').Readable; - var assert = require('assert'); - - var s = new Readable({ -diff --git a/test/simple/test-stream-push-strings.js b/test/simple/test-stream-push-strings.js -index 06f43dc..1701a9a 100644 ---- a/test/simple/test-stream-push-strings.js -+++ b/test/simple/test-stream-push-strings.js -@@ -22,7 +22,7 @@ - var common = require('../common'); - var assert = require('assert'); - --var Readable = require('stream').Readable; -+var Readable = require('../../').Readable; - var util = require('util'); - - util.inherits(MyStream, Readable); -diff --git a/test/simple/test-stream-readable-event.js b/test/simple/test-stream-readable-event.js -index ba6a577..a8e6f7b 100644 ---- a/test/simple/test-stream-readable-event.js -+++ b/test/simple/test-stream-readable-event.js -@@ -22,7 +22,7 @@ - var common = require('../common'); - var assert = require('assert'); - --var Readable = require('stream').Readable; -+var Readable = require('../../').Readable; - - (function first() { - // First test, not reading when the readable is added. -diff --git a/test/simple/test-stream-readable-flow-recursion.js b/test/simple/test-stream-readable-flow-recursion.js -index 2891ad6..11689ba 100644 ---- a/test/simple/test-stream-readable-flow-recursion.js -+++ b/test/simple/test-stream-readable-flow-recursion.js -@@ -27,7 +27,7 @@ var assert = require('assert'); - // more data continuously, but without triggering a nextTick - // warning or RangeError. - --var Readable = require('stream').Readable; -+var Readable = require('../../').Readable; - - // throw an error if we trigger a nextTick warning. - process.throwDeprecation = true; -diff --git a/test/simple/test-stream-unshift-empty-chunk.js b/test/simple/test-stream-unshift-empty-chunk.js -index 0c96476..7827538 100644 ---- a/test/simple/test-stream-unshift-empty-chunk.js -+++ b/test/simple/test-stream-unshift-empty-chunk.js -@@ -24,7 +24,7 @@ var assert = require('assert'); - - // This test verifies that stream.unshift(Buffer(0)) or - // stream.unshift('') does not set state.reading=false. --var Readable = require('stream').Readable; -+var Readable = require('../../').Readable; - - var r = new Readable(); - var nChunks = 10; -diff --git a/test/simple/test-stream-unshift-read-race.js b/test/simple/test-stream-unshift-read-race.js -index 83fd9fa..17c18aa 100644 ---- a/test/simple/test-stream-unshift-read-race.js -+++ b/test/simple/test-stream-unshift-read-race.js -@@ -29,7 +29,7 @@ var assert = require('assert'); - // 3. push() after the EOF signaling null is an error. - // 4. _read() is not called after pushing the EOF null chunk. - --var stream = require('stream'); -+var stream = require('../../'); - var hwm = 10; - var r = stream.Readable({ highWaterMark: hwm }); - var chunks = 10; -@@ -51,7 +51,14 @@ r._read = function(n) { - - function push(fast) { - assert(!pushedNull, 'push() after null push'); -- var c = pos >= data.length ? null : data.slice(pos, pos + n); -+ var c; -+ if (pos >= data.length) -+ c = null; -+ else { -+ if (n + pos > data.length) -+ n = data.length - pos; -+ c = data.slice(pos, pos + n); -+ } - pushedNull = c === null; - if (fast) { - pos += n; -diff --git a/test/simple/test-stream-writev.js b/test/simple/test-stream-writev.js -index 5b49e6e..b5321f3 100644 ---- a/test/simple/test-stream-writev.js -+++ b/test/simple/test-stream-writev.js -@@ -22,7 +22,7 @@ - var common = require('../common'); - var assert = require('assert'); - --var stream = require('stream'); -+var stream = require('../../'); - - var queue = []; - for (var decode = 0; decode < 2; decode++) { -diff --git a/test/simple/test-stream2-basic.js b/test/simple/test-stream2-basic.js -index 3814bf0..248c1be 100644 ---- a/test/simple/test-stream2-basic.js -+++ b/test/simple/test-stream2-basic.js -@@ -21,7 +21,7 @@ - - - var common = require('../common.js'); --var R = require('_stream_readable'); -+var R = require('../../lib/_stream_readable'); - var assert = require('assert'); - - var util = require('util'); -diff --git a/test/simple/test-stream2-compatibility.js b/test/simple/test-stream2-compatibility.js -index 6cdd4e9..f0fa84b 100644 ---- a/test/simple/test-stream2-compatibility.js -+++ b/test/simple/test-stream2-compatibility.js -@@ -21,7 +21,7 @@ - - - var common = require('../common.js'); --var R = require('_stream_readable'); -+var R = require('../../lib/_stream_readable'); - var assert = require('assert'); - - var util = require('util'); -diff --git a/test/simple/test-stream2-finish-pipe.js b/test/simple/test-stream2-finish-pipe.js -index 39b274f..006a19b 100644 ---- a/test/simple/test-stream2-finish-pipe.js -+++ b/test/simple/test-stream2-finish-pipe.js -@@ -20,7 +20,7 @@ - // USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common.js'); --var stream = require('stream'); -+var stream = require('../../'); - var Buffer = require('buffer').Buffer; - - var r = new stream.Readable(); -diff --git a/test/simple/test-stream2-fs.js b/test/simple/test-stream2-fs.js -deleted file mode 100644 -index e162406..0000000 ---- a/test/simple/test-stream2-fs.js -+++ /dev/null -@@ -1,72 +0,0 @@ --// Copyright Joyent, Inc. and other Node contributors. --// --// 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. -- -- --var common = require('../common.js'); --var R = require('_stream_readable'); --var assert = require('assert'); -- --var fs = require('fs'); --var FSReadable = fs.ReadStream; -- --var path = require('path'); --var file = path.resolve(common.fixturesDir, 'x1024.txt'); -- --var size = fs.statSync(file).size; -- --var expectLengths = [1024]; -- --var util = require('util'); --var Stream = require('stream'); -- --util.inherits(TestWriter, Stream); -- --function TestWriter() { -- Stream.apply(this); -- this.buffer = []; -- this.length = 0; --} -- --TestWriter.prototype.write = function(c) { -- this.buffer.push(c.toString()); -- this.length += c.length; -- return true; --}; -- --TestWriter.prototype.end = function(c) { -- if (c) this.buffer.push(c.toString()); -- this.emit('results', this.buffer); --} -- --var r = new FSReadable(file); --var w = new TestWriter(); -- --w.on('results', function(res) { -- console.error(res, w.length); -- assert.equal(w.length, size); -- var l = 0; -- assert.deepEqual(res.map(function (c) { -- return c.length; -- }), expectLengths); -- console.log('ok'); --}); -- --r.pipe(w); -diff --git a/test/simple/test-stream2-httpclient-response-end.js b/test/simple/test-stream2-httpclient-response-end.js -deleted file mode 100644 -index 15cffc2..0000000 ---- a/test/simple/test-stream2-httpclient-response-end.js -+++ /dev/null -@@ -1,52 +0,0 @@ --// Copyright Joyent, Inc. and other Node contributors. --// --// 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. -- --var common = require('../common.js'); --var assert = require('assert'); --var http = require('http'); --var msg = 'Hello'; --var readable_event = false; --var end_event = false; --var server = http.createServer(function(req, res) { -- res.writeHead(200, {'Content-Type': 'text/plain'}); -- res.end(msg); --}).listen(common.PORT, function() { -- http.get({port: common.PORT}, function(res) { -- var data = ''; -- res.on('readable', function() { -- console.log('readable event'); -- readable_event = true; -- data += res.read(); -- }); -- res.on('end', function() { -- console.log('end event'); -- end_event = true; -- assert.strictEqual(msg, data); -- server.close(); -- }); -- }); --}); -- --process.on('exit', function() { -- assert(readable_event); -- assert(end_event); --}); -- -diff --git a/test/simple/test-stream2-large-read-stall.js b/test/simple/test-stream2-large-read-stall.js -index 2fbfbca..667985b 100644 ---- a/test/simple/test-stream2-large-read-stall.js -+++ b/test/simple/test-stream2-large-read-stall.js -@@ -30,7 +30,7 @@ var PUSHSIZE = 20; - var PUSHCOUNT = 1000; - var HWM = 50; - --var Readable = require('stream').Readable; -+var Readable = require('../../').Readable; - var r = new Readable({ - highWaterMark: HWM - }); -@@ -39,23 +39,23 @@ var rs = r._readableState; - r._read = push; - - r.on('readable', function() { -- console.error('>> readable'); -+ //console.error('>> readable'); - do { -- console.error(' > read(%d)', READSIZE); -+ //console.error(' > read(%d)', READSIZE); - var ret = r.read(READSIZE); -- console.error(' < %j (%d remain)', ret && ret.length, rs.length); -+ //console.error(' < %j (%d remain)', ret && ret.length, rs.length); - } while (ret && ret.length === READSIZE); - -- console.error('<< after read()', -- ret && ret.length, -- rs.needReadable, -- rs.length); -+ //console.error('<< after read()', -+ // ret && ret.length, -+ // rs.needReadable, -+ // rs.length); - }); - - var endEmitted = false; - r.on('end', function() { - endEmitted = true; -- console.error('end'); -+ //console.error('end'); - }); - - var pushes = 0; -@@ -64,11 +64,11 @@ function push() { - return; - - if (pushes++ === PUSHCOUNT) { -- console.error(' push(EOF)'); -+ //console.error(' push(EOF)'); - return r.push(null); - } - -- console.error(' push #%d', pushes); -+ //console.error(' push #%d', pushes); - if (r.push(new Buffer(PUSHSIZE))) - setTimeout(push); - } -diff --git a/test/simple/test-stream2-objects.js b/test/simple/test-stream2-objects.js -index 3e6931d..ff47d89 100644 ---- a/test/simple/test-stream2-objects.js -+++ b/test/simple/test-stream2-objects.js -@@ -21,8 +21,8 @@ - - - var common = require('../common.js'); --var Readable = require('_stream_readable'); --var Writable = require('_stream_writable'); -+var Readable = require('../../lib/_stream_readable'); -+var Writable = require('../../lib/_stream_writable'); - var assert = require('assert'); - - // tiny node-tap lookalike. -diff --git a/test/simple/test-stream2-pipe-error-handling.js b/test/simple/test-stream2-pipe-error-handling.js -index cf7531c..e3f3e4e 100644 ---- a/test/simple/test-stream2-pipe-error-handling.js -+++ b/test/simple/test-stream2-pipe-error-handling.js -@@ -21,7 +21,7 @@ - - var common = require('../common'); - var assert = require('assert'); --var stream = require('stream'); -+var stream = require('../../'); - - (function testErrorListenerCatches() { - var count = 1000; -diff --git a/test/simple/test-stream2-pipe-error-once-listener.js b/test/simple/test-stream2-pipe-error-once-listener.js -index 5e8e3cb..53b2616 100755 ---- a/test/simple/test-stream2-pipe-error-once-listener.js -+++ b/test/simple/test-stream2-pipe-error-once-listener.js -@@ -24,7 +24,7 @@ var common = require('../common.js'); - var assert = require('assert'); - - var util = require('util'); --var stream = require('stream'); -+var stream = require('../../'); - - - var Read = function() { -diff --git a/test/simple/test-stream2-push.js b/test/simple/test-stream2-push.js -index b63edc3..eb2b0e9 100644 ---- a/test/simple/test-stream2-push.js -+++ b/test/simple/test-stream2-push.js -@@ -20,7 +20,7 @@ - // USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common.js'); --var stream = require('stream'); -+var stream = require('../../'); - var Readable = stream.Readable; - var Writable = stream.Writable; - var assert = require('assert'); -diff --git a/test/simple/test-stream2-read-sync-stack.js b/test/simple/test-stream2-read-sync-stack.js -index e8a7305..9740a47 100644 ---- a/test/simple/test-stream2-read-sync-stack.js -+++ b/test/simple/test-stream2-read-sync-stack.js -@@ -21,7 +21,7 @@ - - var common = require('../common'); - var assert = require('assert'); --var Readable = require('stream').Readable; -+var Readable = require('../../').Readable; - var r = new Readable(); - var N = 256 * 1024; - -diff --git a/test/simple/test-stream2-readable-empty-buffer-no-eof.js b/test/simple/test-stream2-readable-empty-buffer-no-eof.js -index cd30178..4b1659d 100644 ---- a/test/simple/test-stream2-readable-empty-buffer-no-eof.js -+++ b/test/simple/test-stream2-readable-empty-buffer-no-eof.js -@@ -22,10 +22,9 @@ - var common = require('../common'); - var assert = require('assert'); - --var Readable = require('stream').Readable; -+var Readable = require('../../').Readable; - - test1(); --test2(); - - function test1() { - var r = new Readable(); -@@ -88,31 +87,3 @@ function test1() { - console.log('ok'); - }); - } -- --function test2() { -- var r = new Readable({ encoding: 'base64' }); -- var reads = 5; -- r._read = function(n) { -- if (!reads--) -- return r.push(null); // EOF -- else -- return r.push(new Buffer('x')); -- }; -- -- var results = []; -- function flow() { -- var chunk; -- while (null !== (chunk = r.read())) -- results.push(chunk + ''); -- } -- r.on('readable', flow); -- r.on('end', function() { -- results.push('EOF'); -- }); -- flow(); -- -- process.on('exit', function() { -- assert.deepEqual(results, [ 'eHh4', 'eHg=', 'EOF' ]); -- console.log('ok'); -- }); --} -diff --git a/test/simple/test-stream2-readable-from-list.js b/test/simple/test-stream2-readable-from-list.js -index 7c96ffe..04a96f5 100644 ---- a/test/simple/test-stream2-readable-from-list.js -+++ b/test/simple/test-stream2-readable-from-list.js -@@ -21,7 +21,7 @@ - - var assert = require('assert'); - var common = require('../common.js'); --var fromList = require('_stream_readable')._fromList; -+var fromList = require('../../lib/_stream_readable')._fromList; - - // tiny node-tap lookalike. - var tests = []; -diff --git a/test/simple/test-stream2-readable-legacy-drain.js b/test/simple/test-stream2-readable-legacy-drain.js -index 675da8e..51fd3d5 100644 ---- a/test/simple/test-stream2-readable-legacy-drain.js -+++ b/test/simple/test-stream2-readable-legacy-drain.js -@@ -22,7 +22,7 @@ - var common = require('../common'); - var assert = require('assert'); - --var Stream = require('stream'); -+var Stream = require('../../'); - var Readable = Stream.Readable; - - var r = new Readable(); -diff --git a/test/simple/test-stream2-readable-non-empty-end.js b/test/simple/test-stream2-readable-non-empty-end.js -index 7314ae7..c971898 100644 ---- a/test/simple/test-stream2-readable-non-empty-end.js -+++ b/test/simple/test-stream2-readable-non-empty-end.js -@@ -21,7 +21,7 @@ - - var assert = require('assert'); - var common = require('../common.js'); --var Readable = require('_stream_readable'); -+var Readable = require('../../lib/_stream_readable'); - - var len = 0; - var chunks = new Array(10); -diff --git a/test/simple/test-stream2-readable-wrap-empty.js b/test/simple/test-stream2-readable-wrap-empty.js -index 2e5cf25..fd8a3dc 100644 ---- a/test/simple/test-stream2-readable-wrap-empty.js -+++ b/test/simple/test-stream2-readable-wrap-empty.js -@@ -22,7 +22,7 @@ - var common = require('../common'); - var assert = require('assert'); - --var Readable = require('_stream_readable'); -+var Readable = require('../../lib/_stream_readable'); - var EE = require('events').EventEmitter; - - var oldStream = new EE(); -diff --git a/test/simple/test-stream2-readable-wrap.js b/test/simple/test-stream2-readable-wrap.js -index 90eea01..6b177f7 100644 ---- a/test/simple/test-stream2-readable-wrap.js -+++ b/test/simple/test-stream2-readable-wrap.js -@@ -22,8 +22,8 @@ - var common = require('../common'); - var assert = require('assert'); - --var Readable = require('_stream_readable'); --var Writable = require('_stream_writable'); -+var Readable = require('../../lib/_stream_readable'); -+var Writable = require('../../lib/_stream_writable'); - var EE = require('events').EventEmitter; - - var testRuns = 0, completedRuns = 0; -diff --git a/test/simple/test-stream2-set-encoding.js b/test/simple/test-stream2-set-encoding.js -index 5d2c32a..685531b 100644 ---- a/test/simple/test-stream2-set-encoding.js -+++ b/test/simple/test-stream2-set-encoding.js -@@ -22,7 +22,7 @@ - - var common = require('../common.js'); - var assert = require('assert'); --var R = require('_stream_readable'); -+var R = require('../../lib/_stream_readable'); - var util = require('util'); - - // tiny node-tap lookalike. -diff --git a/test/simple/test-stream2-transform.js b/test/simple/test-stream2-transform.js -index 9c9ddd8..a0cacc6 100644 ---- a/test/simple/test-stream2-transform.js -+++ b/test/simple/test-stream2-transform.js -@@ -21,8 +21,8 @@ - - var assert = require('assert'); - var common = require('../common.js'); --var PassThrough = require('_stream_passthrough'); --var Transform = require('_stream_transform'); -+var PassThrough = require('../../').PassThrough; -+var Transform = require('../../').Transform; - - // tiny node-tap lookalike. - var tests = []; -diff --git a/test/simple/test-stream2-unpipe-drain.js b/test/simple/test-stream2-unpipe-drain.js -index d66dc3c..365b327 100644 ---- a/test/simple/test-stream2-unpipe-drain.js -+++ b/test/simple/test-stream2-unpipe-drain.js -@@ -22,7 +22,7 @@ - - var common = require('../common.js'); - var assert = require('assert'); --var stream = require('stream'); -+var stream = require('../../'); - var crypto = require('crypto'); - - var util = require('util'); -diff --git a/test/simple/test-stream2-unpipe-leak.js b/test/simple/test-stream2-unpipe-leak.js -index 99f8746..17c92ae 100644 ---- a/test/simple/test-stream2-unpipe-leak.js -+++ b/test/simple/test-stream2-unpipe-leak.js -@@ -22,7 +22,7 @@ - - var common = require('../common.js'); - var assert = require('assert'); --var stream = require('stream'); -+var stream = require('../../'); - - var chunk = new Buffer('hallo'); - -diff --git a/test/simple/test-stream2-writable.js b/test/simple/test-stream2-writable.js -index 704100c..209c3a6 100644 ---- a/test/simple/test-stream2-writable.js -+++ b/test/simple/test-stream2-writable.js -@@ -20,8 +20,8 @@ - // USE OR OTHER DEALINGS IN THE SOFTWARE. - - var common = require('../common.js'); --var W = require('_stream_writable'); --var D = require('_stream_duplex'); -+var W = require('../../').Writable; -+var D = require('../../').Duplex; - var assert = require('assert'); - - var util = require('util'); -diff --git a/test/simple/test-stream3-pause-then-read.js b/test/simple/test-stream3-pause-then-read.js -index b91bde3..2f72c15 100644 ---- a/test/simple/test-stream3-pause-then-read.js -+++ b/test/simple/test-stream3-pause-then-read.js -@@ -22,7 +22,7 @@ - var common = require('../common'); - var assert = require('assert'); - --var stream = require('stream'); -+var stream = require('../../'); - var Readable = stream.Readable; - var Writable = stream.Writable; diff --git a/deps/npm/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/readable-stream/lib/_stream_duplex.js index b513d61a963a40..736693b8400fed 100644 --- a/deps/npm/node_modules/readable-stream/lib/_stream_duplex.js +++ b/deps/npm/node_modules/readable-stream/lib/_stream_duplex.js @@ -1,39 +1,25 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - // a duplex stream is just a stream that is both readable and writable. // Since JS doesn't have multiple prototypal inheritance, this class // prototypally inherits from Readable, and then parasitically from // Writable. -module.exports = Duplex; +'use strict'; /**/ + var objectKeys = Object.keys || function (obj) { var keys = []; - for (var key in obj) keys.push(key); - return keys; -} + for (var key in obj) { + keys.push(key); + }return keys; +}; /**/ +module.exports = Duplex; + +/**/ +var processNextTick = require('process-nextick-args'); +/**/ /**/ var util = require('core-util-is'); @@ -45,27 +31,24 @@ var Writable = require('./_stream_writable'); util.inherits(Duplex, Readable); -forEach(objectKeys(Writable.prototype), function(method) { - if (!Duplex.prototype[method]) - Duplex.prototype[method] = Writable.prototype[method]; -}); +var keys = objectKeys(Writable.prototype); +for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; +} function Duplex(options) { - if (!(this instanceof Duplex)) - return new Duplex(options); + if (!(this instanceof Duplex)) return new Duplex(options); Readable.call(this, options); Writable.call(this, options); - if (options && options.readable === false) - this.readable = false; + if (options && options.readable === false) this.readable = false; - if (options && options.writable === false) - this.writable = false; + if (options && options.writable === false) this.writable = false; this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) - this.allowHalfOpen = false; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; this.once('end', onend); } @@ -74,16 +57,19 @@ function Duplex(options) { function onend() { // if we allow half-open state, or if the writable side ended, // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) - return; + if (this.allowHalfOpen || this._writableState.ended) return; // no more data can be written. // But allow more writes to happen in this tick. - process.nextTick(this.end.bind(this)); + processNextTick(onEndNT, this); } -function forEach (xs, f) { +function onEndNT(self) { + self.end(); +} + +function forEach(xs, f) { for (var i = 0, l = xs.length; i < l; i++) { f(xs[i], i); } -} +} \ No newline at end of file diff --git a/deps/npm/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/readable-stream/lib/_stream_passthrough.js index 895ca50a1d208a..d06f71f1868d77 100644 --- a/deps/npm/node_modules/readable-stream/lib/_stream_passthrough.js +++ b/deps/npm/node_modules/readable-stream/lib/_stream_passthrough.js @@ -1,28 +1,9 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - // a passthrough stream. // basically just the most minimal sort of Transform stream. // Every written chunk gets output as-is. +'use strict'; + module.exports = PassThrough; var Transform = require('./_stream_transform'); @@ -35,12 +16,11 @@ util.inherits = require('inherits'); util.inherits(PassThrough, Transform); function PassThrough(options) { - if (!(this instanceof PassThrough)) - return new PassThrough(options); + if (!(this instanceof PassThrough)) return new PassThrough(options); Transform.call(this, options); } -PassThrough.prototype._transform = function(chunk, encoding, cb) { +PassThrough.prototype._transform = function (chunk, encoding, cb) { cb(null, chunk); -}; +}; \ No newline at end of file diff --git a/deps/npm/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/readable-stream/lib/_stream_readable.js index 19ab3588984252..54a9d5c553d69e 100644 --- a/deps/npm/node_modules/readable-stream/lib/_stream_readable.js +++ b/deps/npm/node_modules/readable-stream/lib/_stream_readable.js @@ -1,30 +1,14 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. +'use strict'; module.exports = Readable; /**/ -var isArray = require('isarray'); +var processNextTick = require('process-nextick-args'); /**/ +/**/ +var isArray = require('isarray'); +/**/ /**/ var Buffer = require('buffer').Buffer; @@ -32,49 +16,66 @@ var Buffer = require('buffer').Buffer; Readable.ReadableState = ReadableState; -var EE = require('events').EventEmitter; +var EE = require('events'); /**/ -if (!EE.listenerCount) EE.listenerCount = function(emitter, type) { +var EElistenerCount = function (emitter, type) { return emitter.listeners(type).length; }; /**/ -var Stream = require('stream'); +/**/ +var Stream; +(function () { + try { + Stream = require('st' + 'ream'); + } catch (_) {} finally { + if (!Stream) Stream = require('events').EventEmitter; + } +})(); +/**/ + +var Buffer = require('buffer').Buffer; /**/ var util = require('core-util-is'); util.inherits = require('inherits'); /**/ -var StringDecoder; - - /**/ -var debug = require('util'); -if (debug && debug.debuglog) { - debug = debug.debuglog('stream'); +var debugUtil = require('util'); +var debug = undefined; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); } else { debug = function () {}; } /**/ +var StringDecoder; util.inherits(Readable, Stream); +var Duplex; function ReadableState(options, stream) { - var Duplex = require('./_stream_duplex'); + Duplex = Duplex || require('./_stream_duplex'); options = options || {}; + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + // the point at which it stops calling _read() to fill the buffer // Note: 0 is a valid value, means "don't call _read preemptively ever" var hwm = options.highWaterMark; - var defaultHwm = options.objectMode ? 16 : 16 * 1024; - this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; // cast to ints. - this.highWaterMark = ~~this.highWaterMark; + this.highWaterMark = ~ ~this.highWaterMark; this.buffer = []; this.length = 0; @@ -96,14 +97,7 @@ function ReadableState(options, stream) { this.needReadable = false; this.emittedReadable = false; this.readableListening = false; - - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - - if (stream instanceof Duplex) - this.objectMode = this.objectMode || !!options.readableObjectMode; + this.resumeScheduled = false; // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. @@ -123,24 +117,25 @@ function ReadableState(options, stream) { this.decoder = null; this.encoding = null; if (options.encoding) { - if (!StringDecoder) - StringDecoder = require('string_decoder/').StringDecoder; + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; this.decoder = new StringDecoder(options.encoding); this.encoding = options.encoding; } } +var Duplex; function Readable(options) { - var Duplex = require('./_stream_duplex'); + Duplex = Duplex || require('./_stream_duplex'); - if (!(this instanceof Readable)) - return new Readable(options); + if (!(this instanceof Readable)) return new Readable(options); this._readableState = new ReadableState(options, this); // legacy this.readable = true; + if (options && typeof options.read === 'function') this._read = options.read; + Stream.call(this); } @@ -148,10 +143,10 @@ function Readable(options) { // This returns true if the highWaterMark has not been hit yet, // similar to how Writable.write() returns true if you should // write() some more. -Readable.prototype.push = function(chunk, encoding) { +Readable.prototype.push = function (chunk, encoding) { var state = this._readableState; - if (util.isString(chunk) && !state.objectMode) { + if (!state.objectMode && typeof chunk === 'string') { encoding = encoding || state.defaultEncoding; if (encoding !== state.encoding) { chunk = new Buffer(chunk, encoding); @@ -163,19 +158,22 @@ Readable.prototype.push = function(chunk, encoding) { }; // Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function(chunk) { +Readable.prototype.unshift = function (chunk) { var state = this._readableState; return readableAddChunk(this, state, chunk, '', true); }; +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; + function readableAddChunk(stream, state, chunk, encoding, addToFront) { var er = chunkInvalid(state, chunk); if (er) { stream.emit('error', er); - } else if (util.isNullOrUndefined(chunk)) { + } else if (chunk === null) { state.reading = false; - if (!state.ended) - onEofChunk(stream, state); + onEofChunk(stream, state); } else if (state.objectMode || chunk && chunk.length > 0) { if (state.ended && !addToFront) { var e = new Error('stream.push() after EOF'); @@ -184,26 +182,28 @@ function readableAddChunk(stream, state, chunk, encoding, addToFront) { var e = new Error('stream.unshift() after end event'); stream.emit('error', e); } else { - if (state.decoder && !addToFront && !encoding) + var skipAdd; + if (state.decoder && !addToFront && !encoding) { chunk = state.decoder.write(chunk); + skipAdd = !state.objectMode && chunk.length === 0; + } - if (!addToFront) - state.reading = false; - - // if we want the data now, just emit it. - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) - state.buffer.unshift(chunk); - else - state.buffer.push(chunk); - - if (state.needReadable) - emitReadable(stream); + if (!addToFront) state.reading = false; + + // Don't add to the buffer if we've decoded to an empty string chunk and + // we're not in object mode + if (!skipAdd) { + // if we want the data now, just emit it. + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + + if (state.needReadable) emitReadable(stream); + } } maybeReadMore(stream, state); @@ -215,8 +215,6 @@ function readableAddChunk(stream, state, chunk, encoding, addToFront) { return needMoreData(state); } - - // if it's past the high water mark, we can push in some more. // Also, if we have no data yet, we can stand some // more bytes. This is to work around cases where hwm=0, @@ -225,92 +223,80 @@ function readableAddChunk(stream, state, chunk, encoding, addToFront) { // needReadable was set, then we ought to push more, so that another // 'readable' event will be triggered. function needMoreData(state) { - return !state.ended && - (state.needReadable || - state.length < state.highWaterMark || - state.length === 0); + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); } // backwards compatibility. -Readable.prototype.setEncoding = function(enc) { - if (!StringDecoder) - StringDecoder = require('string_decoder/').StringDecoder; +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; this._readableState.decoder = new StringDecoder(enc); this._readableState.encoding = enc; return this; }; -// Don't raise the hwm > 128MB +// Don't raise the hwm > 8MB var MAX_HWM = 0x800000; -function roundUpToNextPowerOf2(n) { +function computeNewHighWaterMark(n) { if (n >= MAX_HWM) { n = MAX_HWM; } else { // Get the next highest power of 2 n--; - for (var p = 1; p < 32; p <<= 1) n |= n >> p; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; n++; } return n; } function howMuchToRead(n, state) { - if (state.length === 0 && state.ended) - return 0; + if (state.length === 0 && state.ended) return 0; - if (state.objectMode) - return n === 0 ? 0 : 1; + if (state.objectMode) return n === 0 ? 0 : 1; - if (isNaN(n) || util.isNull(n)) { + if (n === null || isNaN(n)) { // only flow one buffer at a time - if (state.flowing && state.buffer.length) - return state.buffer[0].length; - else - return state.length; + if (state.flowing && state.buffer.length) return state.buffer[0].length;else return state.length; } - if (n <= 0) - return 0; + if (n <= 0) return 0; // If we're asking for more than the target buffer level, // then raise the water mark. Bump up to the next highest // power of 2, to prevent increasing it excessively in tiny // amounts. - if (n > state.highWaterMark) - state.highWaterMark = roundUpToNextPowerOf2(n); + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); // don't have that much. return null, unless we've ended. if (n > state.length) { if (!state.ended) { state.needReadable = true; return 0; - } else + } else { return state.length; + } } return n; } // you can override either this method, or the async _read(n) below. -Readable.prototype.read = function(n) { +Readable.prototype.read = function (n) { debug('read', n); var state = this._readableState; var nOrig = n; - if (!util.isNumber(n) || n > 0) - state.emittedReadable = false; + if (typeof n !== 'number' || n > 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we // already have a bunch of data in the buffer, then just trigger // the 'readable' event and move on. - if (n === 0 && - state.needReadable && - (state.length >= state.highWaterMark || state.ended)) { + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) - endReadable(this); - else - emitReadable(this); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); return null; } @@ -318,8 +304,7 @@ Readable.prototype.read = function(n) { // if we've ended, and we're now clear, then finish it up. if (n === 0 && state.ended) { - if (state.length === 0) - endReadable(this); + if (state.length === 0) endReadable(this); return null; } @@ -367,8 +352,7 @@ Readable.prototype.read = function(n) { state.reading = true; state.sync = true; // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) - state.needReadable = true; + if (state.length === 0) state.needReadable = true; // call internal read method this._read(state.highWaterMark); state.sync = false; @@ -376,16 +360,12 @@ Readable.prototype.read = function(n) { // If _read pushed data synchronously, then `reading` will be false, // and we need to re-evaluate how much data we can return to the user. - if (doRead && !state.reading) - n = howMuchToRead(nOrig, state); + if (doRead && !state.reading) n = howMuchToRead(nOrig, state); var ret; - if (n > 0) - ret = fromList(n, state); - else - ret = null; + if (n > 0) ret = fromList(n, state);else ret = null; - if (util.isNull(ret)) { + if (ret === null) { state.needReadable = true; n = 0; } @@ -394,33 +374,27 @@ Readable.prototype.read = function(n) { // If we have nothing in the buffer, then we want to know // as soon as we *do* get something into the buffer. - if (state.length === 0 && !state.ended) - state.needReadable = true; + if (state.length === 0 && !state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended && state.length === 0) - endReadable(this); + if (nOrig !== n && state.ended && state.length === 0) endReadable(this); - if (!util.isNull(ret)) - this.emit('data', ret); + if (ret !== null) this.emit('data', ret); return ret; }; function chunkInvalid(state, chunk) { var er = null; - if (!util.isBuffer(chunk) && - !util.isString(chunk) && - !util.isNullOrUndefined(chunk) && - !state.objectMode) { + if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { er = new TypeError('Invalid non-string/buffer chunk'); } return er; } - function onEofChunk(stream, state) { - if (state.decoder && !state.ended) { + if (state.ended) return; + if (state.decoder) { var chunk = state.decoder.end(); if (chunk && chunk.length) { state.buffer.push(chunk); @@ -442,12 +416,7 @@ function emitReadable(stream) { if (!state.emittedReadable) { debug('emitReadable', state.flowing); state.emittedReadable = true; - if (state.sync) - process.nextTick(function() { - emitReadable_(stream); - }); - else - emitReadable_(stream); + if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream); } } @@ -457,7 +426,6 @@ function emitReadable_(stream) { flow(stream); } - // at this point, the user has presumably seen the 'readable' event, // and called read() to consume some data. that may have triggered // in turn another _read(n) call, in which case reading = true if @@ -467,23 +435,18 @@ function emitReadable_(stream) { function maybeReadMore(stream, state) { if (!state.readingMore) { state.readingMore = true; - process.nextTick(function() { - maybeReadMore_(stream, state); - }); + processNextTick(maybeReadMore_, stream, state); } } function maybeReadMore_(stream, state) { var len = state.length; - while (!state.reading && !state.flowing && !state.ended && - state.length < state.highWaterMark) { + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { debug('maybeReadMore read 0'); stream.read(0); if (len === state.length) // didn't get any data, stop spinning. - break; - else - len = state.length; + break;else len = state.length; } state.readingMore = false; } @@ -492,11 +455,11 @@ function maybeReadMore_(stream, state) { // call cb(er, data) where data is <= n in length. // for virtual (non-string, non-buffer) streams, "length" is somewhat // arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function(n) { +Readable.prototype._read = function (n) { this.emit('error', new Error('not implemented')); }; -Readable.prototype.pipe = function(dest, pipeOpts) { +Readable.prototype.pipe = function (dest, pipeOpts) { var src = this; var state = this._readableState; @@ -514,15 +477,10 @@ Readable.prototype.pipe = function(dest, pipeOpts) { state.pipesCount += 1; debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - var doEnd = (!pipeOpts || pipeOpts.end !== false) && - dest !== process.stdout && - dest !== process.stderr; + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; var endFn = doEnd ? onend : cleanup; - if (state.endEmitted) - process.nextTick(endFn); - else - src.once('end', endFn); + if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn); dest.on('unpipe', onunpipe); function onunpipe(readable) { @@ -544,6 +502,7 @@ Readable.prototype.pipe = function(dest, pipeOpts) { var ondrain = pipeOnDrain(src); dest.on('drain', ondrain); + var cleanedUp = false; function cleanup() { debug('cleanup'); // cleanup event handlers once the pipe is broken @@ -556,14 +515,14 @@ Readable.prototype.pipe = function(dest, pipeOpts) { src.removeListener('end', cleanup); src.removeListener('data', ondata); + cleanedUp = true; + // if the reader is waiting for a drain event from this // specific writer, then it would cause it to never start // flowing again. // So, if this is awaiting a drain, then we just call it now. // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && - (!dest._writableState || dest._writableState.needDrain)) - ondrain(); + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); } src.on('data', ondata); @@ -571,9 +530,13 @@ Readable.prototype.pipe = function(dest, pipeOpts) { debug('ondata'); var ret = dest.write(chunk); if (false === ret) { - debug('false write response, pause', - src._readableState.awaitDrain); - src._readableState.awaitDrain++; + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + if (state.pipesCount === 1 && state.pipes[0] === dest && src.listenerCount('data') === 1 && !cleanedUp) { + debug('false write response, pause', src._readableState.awaitDrain); + src._readableState.awaitDrain++; + } src.pause(); } } @@ -584,19 +547,11 @@ Readable.prototype.pipe = function(dest, pipeOpts) { debug('onerror', er); unpipe(); dest.removeListener('error', onerror); - if (EE.listenerCount(dest, 'error') === 0) - dest.emit('error', er); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); } // This is a brutally ugly hack to make sure that our error handler // is attached before any userland ones. NEVER DO THIS. - if (!dest._events || !dest._events.error) - dest.on('error', onerror); - else if (isArray(dest._events.error)) - dest._events.error.unshift(onerror); - else - dest._events.error = [onerror, dest._events.error]; - - + if (!dest._events || !dest._events.error) dest.on('error', onerror);else if (isArray(dest._events.error)) dest._events.error.unshift(onerror);else dest._events.error = [onerror, dest._events.error]; // Both close and finish should trigger unpipe, but only once. function onclose() { @@ -629,41 +584,35 @@ Readable.prototype.pipe = function(dest, pipeOpts) { }; function pipeOnDrain(src) { - return function() { + return function () { var state = src._readableState; debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) - state.awaitDrain--; - if (state.awaitDrain === 0 && EE.listenerCount(src, 'data')) { + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { state.flowing = true; flow(src); } }; } - -Readable.prototype.unpipe = function(dest) { +Readable.prototype.unpipe = function (dest) { var state = this._readableState; // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) - return this; + if (state.pipesCount === 0) return this; // just one destination. most common case. if (state.pipesCount === 1) { // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) - return this; + if (dest && dest !== state.pipes) return this; - if (!dest) - dest = state.pipes; + if (!dest) dest = state.pipes; // got a match. state.pipes = null; state.pipesCount = 0; state.flowing = false; - if (dest) - dest.emit('unpipe', this); + if (dest) dest.emit('unpipe', this); return this; } @@ -677,20 +626,18 @@ Readable.prototype.unpipe = function(dest) { state.pipesCount = 0; state.flowing = false; - for (var i = 0; i < len; i++) - dests[i].emit('unpipe', this); - return this; + for (var _i = 0; _i < len; _i++) { + dests[_i].emit('unpipe', this); + }return this; } // try to find the right one. var i = indexOf(state.pipes, dest); - if (i === -1) - return this; + if (i === -1) return this; state.pipes.splice(i, 1); state.pipesCount -= 1; - if (state.pipesCount === 1) - state.pipes = state.pipes[0]; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; dest.emit('unpipe', this); @@ -699,7 +646,7 @@ Readable.prototype.unpipe = function(dest) { // set up data events if they are asked for // Ensure readable listeners eventually get something -Readable.prototype.on = function(ev, fn) { +Readable.prototype.on = function (ev, fn) { var res = Stream.prototype.on.call(this, ev, fn); // If listening to data, and it has not explicitly been paused, @@ -708,18 +655,14 @@ Readable.prototype.on = function(ev, fn) { this.resume(); } - if (ev === 'readable' && this.readable) { + if (ev === 'readable' && !this._readableState.endEmitted) { var state = this._readableState; if (!state.readableListening) { state.readableListening = true; state.emittedReadable = false; state.needReadable = true; if (!state.reading) { - var self = this; - process.nextTick(function() { - debug('readable nexttick read 0'); - self.read(0); - }); + processNextTick(nReadingNextTick, this); } else if (state.length) { emitReadable(this, state); } @@ -730,17 +673,18 @@ Readable.prototype.on = function(ev, fn) { }; Readable.prototype.addListener = Readable.prototype.on; +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + // pause() and resume() are remnants of the legacy readable stream API // If the user uses them, then switch into old mode. -Readable.prototype.resume = function() { +Readable.prototype.resume = function () { var state = this._readableState; if (!state.flowing) { debug('resume'); state.flowing = true; - if (!state.reading) { - debug('resume read 0'); - this.read(0); - } resume(this, state); } return this; @@ -749,21 +693,23 @@ Readable.prototype.resume = function() { function resume(stream, state) { if (!state.resumeScheduled) { state.resumeScheduled = true; - process.nextTick(function() { - resume_(stream, state); - }); + processNextTick(resume_, stream, state); } } function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); + } + state.resumeScheduled = false; stream.emit('resume'); flow(stream); - if (state.flowing && !state.reading) - stream.read(0); + if (state.flowing && !state.reading) stream.read(0); } -Readable.prototype.pause = function() { +Readable.prototype.pause = function () { debug('call pause flowing=%j', this._readableState.flowing); if (false !== this._readableState.flowing) { debug('pause'); @@ -786,28 +732,27 @@ function flow(stream) { // wrap an old-style stream as the async data source. // This is *not* part of the readable stream interface. // It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function(stream) { +Readable.prototype.wrap = function (stream) { var state = this._readableState; var paused = false; var self = this; - stream.on('end', function() { + stream.on('end', function () { debug('wrapped end'); if (state.decoder && !state.ended) { var chunk = state.decoder.end(); - if (chunk && chunk.length) - self.push(chunk); + if (chunk && chunk.length) self.push(chunk); } self.push(null); }); - stream.on('data', function(chunk) { + stream.on('data', function (chunk) { debug('wrapped data'); - if (state.decoder) - chunk = state.decoder.write(chunk); - if (!chunk || !state.objectMode && !chunk.length) - return; + if (state.decoder) chunk = state.decoder.write(chunk); + + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; var ret = self.push(chunk); if (!ret) { @@ -819,22 +764,24 @@ Readable.prototype.wrap = function(stream) { // proxy all the other methods. // important when wrapping filters and duplexes. for (var i in stream) { - if (util.isFunction(stream[i]) && util.isUndefined(this[i])) { - this[i] = function(method) { return function() { - return stream[method].apply(stream, arguments); - }}(i); + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); } } // proxy certain important events. var events = ['error', 'close', 'destroy', 'pause', 'resume']; - forEach(events, function(ev) { + forEach(events, function (ev) { stream.on(ev, self.emit.bind(self, ev)); }); // when we try to consume some more bytes, simply unpause the // underlying stream. - self._read = function(n) { + self._read = function (n) { debug('wrapped _read', n); if (paused) { paused = false; @@ -845,8 +792,6 @@ Readable.prototype.wrap = function(stream) { return self; }; - - // exposed for testing purposes only. Readable._fromList = fromList; @@ -860,19 +805,11 @@ function fromList(n, state) { var ret; // nothing in the list, definitely empty. - if (list.length === 0) - return null; + if (list.length === 0) return null; - if (length === 0) - ret = null; - else if (objectMode) - ret = list.shift(); - else if (!n || n >= length) { + if (length === 0) ret = null;else if (objectMode) ret = list.shift();else if (!n || n >= length) { // read it all, truncate the array. - if (stringMode) - ret = list.join(''); - else - ret = Buffer.concat(list, length); + if (stringMode) ret = list.join('');else if (list.length === 1) ret = list[0];else ret = Buffer.concat(list, length); list.length = 0; } else { // read just some of it. @@ -888,25 +825,16 @@ function fromList(n, state) { } else { // complex case. // we have enough to cover it, but it spans past the first buffer. - if (stringMode) - ret = ''; - else - ret = new Buffer(n); + if (stringMode) ret = '';else ret = new Buffer(n); var c = 0; for (var i = 0, l = list.length; i < l && c < n; i++) { var buf = list[0]; var cpy = Math.min(n - c, buf.length); - if (stringMode) - ret += buf.slice(0, cpy); - else - buf.copy(ret, c, 0, cpy); + if (stringMode) ret += buf.slice(0, cpy);else buf.copy(ret, c, 0, cpy); - if (cpy < buf.length) - list[0] = buf.slice(cpy); - else - list.shift(); + if (cpy < buf.length) list[0] = buf.slice(cpy);else list.shift(); c += cpy; } @@ -921,31 +849,32 @@ function endReadable(stream) { // If we get here before consuming all the bytes, then that is a // bug in node. Should never happen. - if (state.length > 0) - throw new Error('endReadable called on non-empty stream'); + if (state.length > 0) throw new Error('endReadable called on non-empty stream'); if (!state.endEmitted) { state.ended = true; - process.nextTick(function() { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } - }); + processNextTick(endReadableNT, state, stream); } } -function forEach (xs, f) { +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} + +function forEach(xs, f) { for (var i = 0, l = xs.length; i < l; i++) { f(xs[i], i); } } -function indexOf (xs, x) { +function indexOf(xs, x) { for (var i = 0, l = xs.length; i < l; i++) { if (xs[i] === x) return i; } return -1; -} +} \ No newline at end of file diff --git a/deps/npm/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/readable-stream/lib/_stream_transform.js index 905c5e450758b3..625cdc17698059 100644 --- a/deps/npm/node_modules/readable-stream/lib/_stream_transform.js +++ b/deps/npm/node_modules/readable-stream/lib/_stream_transform.js @@ -1,25 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - - // a transform stream is a readable/writable stream where you do // something with the data. Sometimes it's called a "filter", // but that's not a great name for it, since that implies a thing where @@ -62,6 +40,8 @@ // would be consumed, and then the rest would wait (un-transformed) until // the results of the previous transformed chunk were consumed. +'use strict'; + module.exports = Transform; var Duplex = require('./_stream_duplex'); @@ -73,9 +53,8 @@ util.inherits = require('inherits'); util.inherits(Transform, Duplex); - -function TransformState(options, stream) { - this.afterTransform = function(er, data) { +function TransformState(stream) { + this.afterTransform = function (er, data) { return afterTransform(stream, er, data); }; @@ -83,6 +62,7 @@ function TransformState(options, stream) { this.transforming = false; this.writecb = null; this.writechunk = null; + this.writeencoding = null; } function afterTransform(stream, er, data) { @@ -91,17 +71,14 @@ function afterTransform(stream, er, data) { var cb = ts.writecb; - if (!cb) - return stream.emit('error', new Error('no writecb in Transform class')); + if (!cb) return stream.emit('error', new Error('no writecb in Transform class')); ts.writechunk = null; ts.writecb = null; - if (!util.isNullOrUndefined(data)) - stream.push(data); + if (data !== null && data !== undefined) stream.push(data); - if (cb) - cb(er); + cb(er); var rs = stream._readableState; rs.reading = false; @@ -110,14 +87,12 @@ function afterTransform(stream, er, data) { } } - function Transform(options) { - if (!(this instanceof Transform)) - return new Transform(options); + if (!(this instanceof Transform)) return new Transform(options); Duplex.call(this, options); - this._transformState = new TransformState(options, this); + this._transformState = new TransformState(this); // when the writable side finishes, then flush out anything remaining. var stream = this; @@ -130,17 +105,20 @@ function Transform(options) { // sync guard flag. this._readableState.sync = false; - this.once('prefinish', function() { - if (util.isFunction(this._flush)) - this._flush(function(er) { - done(stream, er); - }); - else - done(stream); + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + + if (typeof options.flush === 'function') this._flush = options.flush; + } + + this.once('prefinish', function () { + if (typeof this._flush === 'function') this._flush(function (er) { + done(stream, er); + });else done(stream); }); } -Transform.prototype.push = function(chunk, encoding) { +Transform.prototype.push = function (chunk, encoding) { this._transformState.needTransform = false; return Duplex.prototype.push.call(this, chunk, encoding); }; @@ -155,31 +133,28 @@ Transform.prototype.push = function(chunk, encoding) { // Call `cb(err)` when you are done with this chunk. If you pass // an error, then that'll put the hurt on the whole operation. If you // never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function(chunk, encoding, cb) { +Transform.prototype._transform = function (chunk, encoding, cb) { throw new Error('not implemented'); }; -Transform.prototype._write = function(chunk, encoding, cb) { +Transform.prototype._write = function (chunk, encoding, cb) { var ts = this._transformState; ts.writecb = cb; ts.writechunk = chunk; ts.writeencoding = encoding; if (!ts.transforming) { var rs = this._readableState; - if (ts.needTransform || - rs.needReadable || - rs.length < rs.highWaterMark) - this._read(rs.highWaterMark); + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); } }; // Doesn't matter what the args are here. // _transform does all the work. // That we got here means that the readable side wants more data. -Transform.prototype._read = function(n) { +Transform.prototype._read = function (n) { var ts = this._transformState; - if (!util.isNull(ts.writechunk) && ts.writecb && !ts.transforming) { + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { ts.transforming = true; this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); } else { @@ -189,21 +164,17 @@ Transform.prototype._read = function(n) { } }; - function done(stream, er) { - if (er) - return stream.emit('error', er); + if (er) return stream.emit('error', er); // if there's nothing in the write buffer, then that means // that nothing more will ever be provided var ws = stream._writableState; var ts = stream._transformState; - if (ws.length) - throw new Error('calling transform done when ws.length != 0'); + if (ws.length) throw new Error('calling transform done when ws.length != 0'); - if (ts.transforming) - throw new Error('calling transform done when still transforming'); + if (ts.transforming) throw new Error('calling transform done when still transforming'); return stream.push(null); -} +} \ No newline at end of file diff --git a/deps/npm/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/readable-stream/lib/_stream_writable.js index db8539cd5b818d..95916c992a9507 100644 --- a/deps/npm/node_modules/readable-stream/lib/_stream_writable.js +++ b/deps/npm/node_modules/readable-stream/lib/_stream_writable.js @@ -1,73 +1,81 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - // A bit simpler than readable streams. -// Implement an async ._write(chunk, cb), and it'll handle all +// Implement an async ._write(chunk, encoding, cb), and it'll handle all // the drain event emission and buffering. +'use strict'; + module.exports = Writable; +/**/ +var processNextTick = require('process-nextick-args'); +/**/ + +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick; +/**/ + /**/ var Buffer = require('buffer').Buffer; /**/ Writable.WritableState = WritableState; - /**/ var util = require('core-util-is'); util.inherits = require('inherits'); /**/ -var Stream = require('stream'); +/**/ +var internalUtil = { + deprecate: require('util-deprecate') +}; +/**/ + +/**/ +var Stream; +(function () { + try { + Stream = require('st' + 'ream'); + } catch (_) {} finally { + if (!Stream) Stream = require('events').EventEmitter; + } +})(); +/**/ + +var Buffer = require('buffer').Buffer; util.inherits(Writable, Stream); +function nop() {} + function WriteReq(chunk, encoding, cb) { this.chunk = chunk; this.encoding = encoding; this.callback = cb; + this.next = null; } +var Duplex; function WritableState(options, stream) { - var Duplex = require('./_stream_duplex'); + Duplex = Duplex || require('./_stream_duplex'); options = options || {}; - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var defaultHwm = options.objectMode ? 16 : 16 * 1024; - this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; - // object stream flag to indicate whether or not this stream // contains buffers or objects. this.objectMode = !!options.objectMode; - if (stream instanceof Duplex) - this.objectMode = this.objectMode || !!options.writableObjectMode; + if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; // cast to ints. - this.highWaterMark = ~~this.highWaterMark; + this.highWaterMark = ~ ~this.highWaterMark; this.needDrain = false; // at the start of calling end() @@ -111,7 +119,7 @@ function WritableState(options, stream) { this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb) - this.onwrite = function(er) { + this.onwrite = function (er) { onwrite(stream, er); }; @@ -121,7 +129,8 @@ function WritableState(options, stream) { // the amount that is being written when _write is called. this.writelen = 0; - this.buffer = []; + this.bufferedRequest = null; + this.lastBufferedRequest = null; // number of pending user-supplied write callbacks // this must be 0 before 'finish' can be emitted @@ -133,37 +142,68 @@ function WritableState(options, stream) { // True if the error was already emitted and should not be thrown again this.errorEmitted = false; + + // count buffered requests + this.bufferedRequestCount = 0; + + // create the two objects needed to store the corked requests + // they are not a linked list, as no new elements are inserted in there + this.corkedRequestsFree = new CorkedRequest(this); + this.corkedRequestsFree.next = new CorkedRequest(this); } +WritableState.prototype.getBuffer = function writableStateGetBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; + +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.') + }); + } catch (_) {} +})(); + +var Duplex; function Writable(options) { - var Duplex = require('./_stream_duplex'); + Duplex = Duplex || require('./_stream_duplex'); // Writable ctor is applied to Duplexes, though they're not // instanceof Writable, they're instanceof Readable. - if (!(this instanceof Writable) && !(this instanceof Duplex)) - return new Writable(options); + if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options); this._writableState = new WritableState(options, this); // legacy. this.writable = true; + if (options) { + if (typeof options.write === 'function') this._write = options.write; + + if (typeof options.writev === 'function') this._writev = options.writev; + } + Stream.call(this); } // Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function() { +Writable.prototype.pipe = function () { this.emit('error', new Error('Cannot pipe. Not readable.')); }; - -function writeAfterEnd(stream, state, cb) { +function writeAfterEnd(stream, cb) { var er = new Error('write after end'); // TODO: defer error events consistently everywhere, not just the cb stream.emit('error', er); - process.nextTick(function() { - cb(er); - }); + processNextTick(cb, er); } // If we get something that is not a buffer, string, null, or undefined, @@ -173,40 +213,30 @@ function writeAfterEnd(stream, state, cb) { // how many bytes or characters. function validChunk(stream, state, chunk, cb) { var valid = true; - if (!util.isBuffer(chunk) && - !util.isString(chunk) && - !util.isNullOrUndefined(chunk) && - !state.objectMode) { + + if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { var er = new TypeError('Invalid non-string/buffer chunk'); stream.emit('error', er); - process.nextTick(function() { - cb(er); - }); + processNextTick(cb, er); valid = false; } return valid; } -Writable.prototype.write = function(chunk, encoding, cb) { +Writable.prototype.write = function (chunk, encoding, cb) { var state = this._writableState; var ret = false; - if (util.isFunction(encoding)) { + if (typeof encoding === 'function') { cb = encoding; encoding = null; } - if (util.isBuffer(chunk)) - encoding = 'buffer'; - else if (!encoding) - encoding = state.defaultEncoding; + if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - if (!util.isFunction(cb)) - cb = function() {}; + if (typeof cb !== 'function') cb = nop; - if (state.ended) - writeAfterEnd(this, state, cb); - else if (validChunk(this, state, chunk, cb)) { + if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) { state.pendingcb++; ret = writeOrBuffer(this, state, chunk, encoding, cb); } @@ -214,31 +244,31 @@ Writable.prototype.write = function(chunk, encoding, cb) { return ret; }; -Writable.prototype.cork = function() { +Writable.prototype.cork = function () { var state = this._writableState; state.corked++; }; -Writable.prototype.uncork = function() { +Writable.prototype.uncork = function () { var state = this._writableState; if (state.corked) { state.corked--; - if (!state.writing && - !state.corked && - !state.finished && - !state.bufferProcessing && - state.buffer.length) - clearBuffer(this, state); + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); } }; +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; +}; + function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && - state.decodeStrings !== false && - util.isString(chunk)) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { chunk = new Buffer(chunk, encoding); } return chunk; @@ -249,21 +279,28 @@ function decodeChunk(state, chunk, encoding) { // If we return false, then we need a drain event, so set that flag. function writeOrBuffer(stream, state, chunk, encoding, cb) { chunk = decodeChunk(state, chunk, encoding); - if (util.isBuffer(chunk)) - encoding = 'buffer'; + + if (Buffer.isBuffer(chunk)) encoding = 'buffer'; var len = state.objectMode ? 1 : chunk.length; state.length += len; var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false. - if (!ret) - state.needDrain = true; + if (!ret) state.needDrain = true; - if (state.writing || state.corked) - state.buffer.push(new WriteReq(chunk, encoding, cb)); - else + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { doWrite(stream, state, false, len, chunk, encoding, cb); + } return ret; } @@ -273,23 +310,13 @@ function doWrite(stream, state, writev, len, chunk, encoding, cb) { state.writecb = cb; state.writing = true; state.sync = true; - if (writev) - stream._writev(chunk, state.onwrite); - else - stream._write(chunk, encoding, state.onwrite); + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); state.sync = false; } function onwriteError(stream, state, sync, er, cb) { - if (sync) - process.nextTick(function() { - state.pendingcb--; - cb(er); - }); - else { - state.pendingcb--; - cb(er); - } + --state.pendingcb; + if (sync) processNextTick(cb, er);else cb(er); stream._writableState.errorEmitted = true; stream.emit('error', er); @@ -309,32 +336,26 @@ function onwrite(stream, er) { onwriteStateUpdate(state); - if (er) - onwriteError(stream, state, sync, er, cb); - else { + if (er) onwriteError(stream, state, sync, er, cb);else { // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(stream, state); + var finished = needFinish(state); - if (!finished && - !state.corked && - !state.bufferProcessing && - state.buffer.length) { + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { clearBuffer(stream, state); } if (sync) { - process.nextTick(function() { - afterWrite(stream, state, finished, cb); - }); + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ } else { - afterWrite(stream, state, finished, cb); - } + afterWrite(stream, state, finished, cb); + } } } function afterWrite(stream, state, finished, cb) { - if (!finished) - onwriteDrain(stream, state); + if (!finished) onwriteDrain(stream, state); state.pendingcb--; cb(); finishMaybe(stream, state); @@ -350,80 +371,79 @@ function onwriteDrain(stream, state) { } } - // if there's something in the buffer waiting, then process it function clearBuffer(stream, state) { state.bufferProcessing = true; + var entry = state.bufferedRequest; - if (stream._writev && state.buffer.length > 1) { + if (stream._writev && entry && entry.next) { // Fast case, write everything using _writev() - var cbs = []; - for (var c = 0; c < state.buffer.length; c++) - cbs.push(state.buffer[c].callback); + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + + var count = 0; + while (entry) { + buffer[count] = entry; + entry = entry.next; + count += 1; + } - // count the one we are adding, as well. - // TODO(isaacs) clean this up - state.pendingcb++; - doWrite(stream, state, true, state.length, state.buffer, '', function(err) { - for (var i = 0; i < cbs.length; i++) { - state.pendingcb--; - cbs[i](err); - } - }); + doWrite(stream, state, true, state.length, buffer, '', holder.finish); - // Clear buffer - state.buffer = []; + // doWrite is always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + state.corkedRequestsFree = holder.next; + holder.next = null; } else { // Slow case, write chunks one-by-one - for (var c = 0; c < state.buffer.length; c++) { - var entry = state.buffer[c]; + while (entry) { var chunk = entry.chunk; var encoding = entry.encoding; var cb = entry.callback; var len = state.objectMode ? 1 : chunk.length; doWrite(stream, state, false, len, chunk, encoding, cb); - + entry = entry.next; // if we didn't call the onwrite immediately, then // it means that we need to wait until it does. // also, that means that the chunk and cb are currently // being processed, so move the buffer counter past them. if (state.writing) { - c++; break; } } - if (c < state.buffer.length) - state.buffer = state.buffer.slice(c); - else - state.buffer.length = 0; + if (entry === null) state.lastBufferedRequest = null; } + state.bufferedRequestCount = 0; + state.bufferedRequest = entry; state.bufferProcessing = false; } -Writable.prototype._write = function(chunk, encoding, cb) { +Writable.prototype._write = function (chunk, encoding, cb) { cb(new Error('not implemented')); - }; Writable.prototype._writev = null; -Writable.prototype.end = function(chunk, encoding, cb) { +Writable.prototype.end = function (chunk, encoding, cb) { var state = this._writableState; - if (util.isFunction(chunk)) { + if (typeof chunk === 'function') { cb = chunk; chunk = null; encoding = null; - } else if (util.isFunction(encoding)) { + } else if (typeof encoding === 'function') { cb = encoding; encoding = null; } - if (!util.isNullOrUndefined(chunk)) - this.write(chunk, encoding); + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks if (state.corked) { @@ -432,16 +452,11 @@ Writable.prototype.end = function(chunk, encoding, cb) { } // ignore unnecessary end() calls. - if (!state.ending && !state.finished) - endWritable(this, state, cb); + if (!state.ending && !state.finished) endWritable(this, state, cb); }; - -function needFinish(stream, state) { - return (state.ending && - state.length === 0 && - !state.finished && - !state.writing); +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; } function prefinish(stream, state) { @@ -452,14 +467,15 @@ function prefinish(stream, state) { } function finishMaybe(stream, state) { - var need = needFinish(stream, state); + var need = needFinish(state); if (need) { if (state.pendingcb === 0) { prefinish(stream, state); state.finished = true; stream.emit('finish'); - } else + } else { prefinish(stream, state); + } } return need; } @@ -468,10 +484,33 @@ function endWritable(stream, state, cb) { state.ending = true; finishMaybe(stream, state); if (cb) { - if (state.finished) - process.nextTick(cb); - else - stream.once('finish', cb); + if (state.finished) processNextTick(cb);else stream.once('finish', cb); } state.ended = true; + stream.writable = false; } + +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; + + this.next = null; + this.entry = null; + + this.finish = function (err) { + var entry = _this.entry; + _this.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = _this; + } else { + state.corkedRequestsFree = _this; + } + }; +} \ No newline at end of file diff --git a/deps/npm/node_modules/readable-stream/node_modules/core-util-is/LICENSE b/deps/npm/node_modules/readable-stream/node_modules/core-util-is/LICENSE new file mode 100644 index 00000000000000..d8d7f9437dbf5a --- /dev/null +++ b/deps/npm/node_modules/readable-stream/node_modules/core-util-is/LICENSE @@ -0,0 +1,19 @@ +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/deps/npm/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/deps/npm/node_modules/readable-stream/node_modules/core-util-is/lib/util.js index 9074e8ebcb61e9..ff4c851c075a2f 100644 --- a/deps/npm/node_modules/readable-stream/node_modules/core-util-is/lib/util.js +++ b/deps/npm/node_modules/readable-stream/node_modules/core-util-is/lib/util.js @@ -21,8 +21,12 @@ // NOTE: These type checking functions intentionally don't use `instanceof` // because it is fragile and can be easily faked with `Object.create()`. -function isArray(ar) { - return Array.isArray(ar); + +function isArray(arg) { + if (Array.isArray) { + return Array.isArray(arg); + } + return objectToString(arg) === '[object Array]'; } exports.isArray = isArray; @@ -62,7 +66,7 @@ function isUndefined(arg) { exports.isUndefined = isUndefined; function isRegExp(re) { - return isObject(re) && objectToString(re) === '[object RegExp]'; + return objectToString(re) === '[object RegExp]'; } exports.isRegExp = isRegExp; @@ -72,13 +76,12 @@ function isObject(arg) { exports.isObject = isObject; function isDate(d) { - return isObject(d) && objectToString(d) === '[object Date]'; + return objectToString(d) === '[object Date]'; } exports.isDate = isDate; function isError(e) { - return isObject(e) && - (objectToString(e) === '[object Error]' || e instanceof Error); + return (objectToString(e) === '[object Error]' || e instanceof Error); } exports.isError = isError; @@ -97,11 +100,8 @@ function isPrimitive(arg) { } exports.isPrimitive = isPrimitive; -function isBuffer(arg) { - return Buffer.isBuffer(arg); -} -exports.isBuffer = isBuffer; +exports.isBuffer = Buffer.isBuffer; function objectToString(o) { return Object.prototype.toString.call(o); -} \ No newline at end of file +} diff --git a/deps/npm/node_modules/readable-stream/node_modules/core-util-is/package.json b/deps/npm/node_modules/readable-stream/node_modules/core-util-is/package.json index b67333380c265e..37decd1e2f788e 100644 --- a/deps/npm/node_modules/readable-stream/node_modules/core-util-is/package.json +++ b/deps/npm/node_modules/readable-stream/node_modules/core-util-is/package.json @@ -1,37 +1,88 @@ { - "name": "core-util-is", - "version": "1.0.1", - "description": "The `util.is*` functions introduced in Node v0.12.", - "main": "lib/util.js", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/core-util-is.git" + "_args": [ + [ + "core-util-is@~1.0.0", + "/Users/rebecca/code/npm/node_modules/npm-registry-couchapp/node_modules/readable-stream" + ], + [ + "core-util-is@~1.0.0", + "/Users/rebecca/code/npm/node_modules/readable-stream" + ] + ], + "_from": "core-util-is@>=1.0.0 <1.1.0", + "_id": "core-util-is@1.0.2", + "_inCache": true, + "_installable": true, + "_location": "/readable-stream/core-util-is", + "_nodeVersion": "4.0.0", + "_npmUser": { + "email": "i@izs.me", + "name": "isaacs" }, - "keywords": [ - "util", - "isBuffer", - "isArray", - "isNumber", - "isString", - "isRegExp", - "isThis", - "isThat", - "polyfill" + "_npmVersion": "3.3.2", + "_phantomChildren": {}, + "_requested": { + "name": "core-util-is", + "raw": "core-util-is@~1.0.0", + "rawSpec": "~1.0.0", + "scope": null, + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/readable-stream" ], + "_shrinkwrap": null, + "_spec": "core-util-is@~1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/readable-stream", "author": { - "name": "Isaac Z. Schlueter", "email": "i@izs.me", + "name": "Isaac Z. Schlueter", "url": "http://blog.izs.me/" }, - "license": "MIT", "bugs": { "url": "https://github.com/isaacs/core-util-is/issues" }, - "readme": "# core-util-is\n\nThe `util.is*` functions introduced in Node v0.12.\n", - "readmeFilename": "README.md", + "dependencies": {}, + "description": "The `util.is*` functions introduced in Node v0.12.", + "devDependencies": { + "tap": "^2.3.0" + }, + "directories": {}, + "dist": { + "shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", + "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" + }, + "gitHead": "a177da234df5638b363ddc15fa324619a38577c8", "homepage": "https://github.com/isaacs/core-util-is#readme", - "_id": "core-util-is@1.0.1", - "_shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538", - "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz", - "_from": "core-util-is@>=1.0.0 <1.1.0" + "keywords": [ + "isArray", + "isBuffer", + "isNumber", + "isRegExp", + "isString", + "isThat", + "isThis", + "polyfill", + "util" + ], + "license": "MIT", + "main": "lib/util.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "core-util-is", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/core-util-is.git" + }, + "scripts": { + "test": "tap test.js" + }, + "version": "1.0.2" } diff --git a/deps/npm/node_modules/readable-stream/node_modules/core-util-is/test.js b/deps/npm/node_modules/readable-stream/node_modules/core-util-is/test.js new file mode 100644 index 00000000000000..1a490c65ac8b5d --- /dev/null +++ b/deps/npm/node_modules/readable-stream/node_modules/core-util-is/test.js @@ -0,0 +1,68 @@ +var assert = require('tap'); + +var t = require('./lib/util'); + +assert.equal(t.isArray([]), true); +assert.equal(t.isArray({}), false); + +assert.equal(t.isBoolean(null), false); +assert.equal(t.isBoolean(true), true); +assert.equal(t.isBoolean(false), true); + +assert.equal(t.isNull(null), true); +assert.equal(t.isNull(undefined), false); +assert.equal(t.isNull(false), false); +assert.equal(t.isNull(), false); + +assert.equal(t.isNullOrUndefined(null), true); +assert.equal(t.isNullOrUndefined(undefined), true); +assert.equal(t.isNullOrUndefined(false), false); +assert.equal(t.isNullOrUndefined(), true); + +assert.equal(t.isNumber(null), false); +assert.equal(t.isNumber('1'), false); +assert.equal(t.isNumber(1), true); + +assert.equal(t.isString(null), false); +assert.equal(t.isString('1'), true); +assert.equal(t.isString(1), false); + +assert.equal(t.isSymbol(null), false); +assert.equal(t.isSymbol('1'), false); +assert.equal(t.isSymbol(1), false); +assert.equal(t.isSymbol(Symbol()), true); + +assert.equal(t.isUndefined(null), false); +assert.equal(t.isUndefined(undefined), true); +assert.equal(t.isUndefined(false), false); +assert.equal(t.isUndefined(), true); + +assert.equal(t.isRegExp(null), false); +assert.equal(t.isRegExp('1'), false); +assert.equal(t.isRegExp(new RegExp()), true); + +assert.equal(t.isObject({}), true); +assert.equal(t.isObject([]), true); +assert.equal(t.isObject(new RegExp()), true); +assert.equal(t.isObject(new Date()), true); + +assert.equal(t.isDate(null), false); +assert.equal(t.isDate('1'), false); +assert.equal(t.isDate(new Date()), true); + +assert.equal(t.isError(null), false); +assert.equal(t.isError({ err: true }), false); +assert.equal(t.isError(new Error()), true); + +assert.equal(t.isFunction(null), false); +assert.equal(t.isFunction({ }), false); +assert.equal(t.isFunction(function() {}), true); + +assert.equal(t.isPrimitive(null), true); +assert.equal(t.isPrimitive(''), true); +assert.equal(t.isPrimitive(0), true); +assert.equal(t.isPrimitive(new Date()), false); + +assert.equal(t.isBuffer(null), false); +assert.equal(t.isBuffer({}), false); +assert.equal(t.isBuffer(new Buffer(0)), true); diff --git a/deps/npm/node_modules/readable-stream/node_modules/core-util-is/util.js b/deps/npm/node_modules/readable-stream/node_modules/core-util-is/util.js deleted file mode 100644 index 007fa10575636d..00000000000000 --- a/deps/npm/node_modules/readable-stream/node_modules/core-util-is/util.js +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. -function isArray(ar) { - return Array.isArray(ar); -} -exports.isArray = isArray; - -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; - -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; - -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; - -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; - -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; - -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; - -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return isObject(re) && objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return isObject(d) && objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; - -function isError(e) { - return isObject(e) && objectToString(e) === '[object Error]'; -} -exports.isError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; - -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -function isBuffer(arg) { - return arg instanceof Buffer; -} -exports.isBuffer = isBuffer; - -function objectToString(o) { - return Object.prototype.toString.call(o); -} diff --git a/deps/npm/node_modules/github-url-from-git/.npmignore b/deps/npm/node_modules/readable-stream/node_modules/isarray/.npmignore similarity index 100% rename from deps/npm/node_modules/github-url-from-git/.npmignore rename to deps/npm/node_modules/readable-stream/node_modules/isarray/.npmignore diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml b/deps/npm/node_modules/readable-stream/node_modules/isarray/.travis.yml similarity index 100% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml rename to deps/npm/node_modules/readable-stream/node_modules/isarray/.travis.yml diff --git a/deps/npm/node_modules/readable-stream/node_modules/isarray/Makefile b/deps/npm/node_modules/readable-stream/node_modules/isarray/Makefile new file mode 100644 index 00000000000000..0ecc29c402c243 --- /dev/null +++ b/deps/npm/node_modules/readable-stream/node_modules/isarray/Makefile @@ -0,0 +1,5 @@ + +test: + @node_modules/.bin/tape test.js + +.PHONY: test diff --git a/deps/npm/node_modules/readable-stream/node_modules/isarray/README.md b/deps/npm/node_modules/readable-stream/node_modules/isarray/README.md index 052a62b8d7b7ae..16d2c59c6195f9 100644 --- a/deps/npm/node_modules/readable-stream/node_modules/isarray/README.md +++ b/deps/npm/node_modules/readable-stream/node_modules/isarray/README.md @@ -3,6 +3,12 @@ `Array#isArray` for older browsers. +[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray) +[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray) + +[![browser support](https://ci.testling.com/juliangruber/isarray.png) +](https://ci.testling.com/juliangruber/isarray) + ## Usage ```js diff --git a/deps/npm/node_modules/readable-stream/node_modules/isarray/build/build.js b/deps/npm/node_modules/readable-stream/node_modules/isarray/build/build.js deleted file mode 100644 index ec58596aeebe4e..00000000000000 --- a/deps/npm/node_modules/readable-stream/node_modules/isarray/build/build.js +++ /dev/null @@ -1,209 +0,0 @@ - -/** - * Require the given path. - * - * @param {String} path - * @return {Object} exports - * @api public - */ - -function require(path, parent, orig) { - var resolved = require.resolve(path); - - // lookup failed - if (null == resolved) { - orig = orig || path; - parent = parent || 'root'; - var err = new Error('Failed to require "' + orig + '" from "' + parent + '"'); - err.path = orig; - err.parent = parent; - err.require = true; - throw err; - } - - var module = require.modules[resolved]; - - // perform real require() - // by invoking the module's - // registered function - if (!module.exports) { - module.exports = {}; - module.client = module.component = true; - module.call(this, module.exports, require.relative(resolved), module); - } - - return module.exports; -} - -/** - * Registered modules. - */ - -require.modules = {}; - -/** - * Registered aliases. - */ - -require.aliases = {}; - -/** - * Resolve `path`. - * - * Lookup: - * - * - PATH/index.js - * - PATH.js - * - PATH - * - * @param {String} path - * @return {String} path or null - * @api private - */ - -require.resolve = function(path) { - if (path.charAt(0) === '/') path = path.slice(1); - var index = path + '/index.js'; - - var paths = [ - path, - path + '.js', - path + '.json', - path + '/index.js', - path + '/index.json' - ]; - - for (var i = 0; i < paths.length; i++) { - var path = paths[i]; - if (require.modules.hasOwnProperty(path)) return path; - } - - if (require.aliases.hasOwnProperty(index)) { - return require.aliases[index]; - } -}; - -/** - * Normalize `path` relative to the current path. - * - * @param {String} curr - * @param {String} path - * @return {String} - * @api private - */ - -require.normalize = function(curr, path) { - var segs = []; - - if ('.' != path.charAt(0)) return path; - - curr = curr.split('/'); - path = path.split('/'); - - for (var i = 0; i < path.length; ++i) { - if ('..' == path[i]) { - curr.pop(); - } else if ('.' != path[i] && '' != path[i]) { - segs.push(path[i]); - } - } - - return curr.concat(segs).join('/'); -}; - -/** - * Register module at `path` with callback `definition`. - * - * @param {String} path - * @param {Function} definition - * @api private - */ - -require.register = function(path, definition) { - require.modules[path] = definition; -}; - -/** - * Alias a module definition. - * - * @param {String} from - * @param {String} to - * @api private - */ - -require.alias = function(from, to) { - if (!require.modules.hasOwnProperty(from)) { - throw new Error('Failed to alias "' + from + '", it does not exist'); - } - require.aliases[to] = from; -}; - -/** - * Return a require function relative to the `parent` path. - * - * @param {String} parent - * @return {Function} - * @api private - */ - -require.relative = function(parent) { - var p = require.normalize(parent, '..'); - - /** - * lastIndexOf helper. - */ - - function lastIndexOf(arr, obj) { - var i = arr.length; - while (i--) { - if (arr[i] === obj) return i; - } - return -1; - } - - /** - * The relative require() itself. - */ - - function localRequire(path) { - var resolved = localRequire.resolve(path); - return require(resolved, parent, path); - } - - /** - * Resolve relative to the parent. - */ - - localRequire.resolve = function(path) { - var c = path.charAt(0); - if ('/' == c) return path.slice(1); - if ('.' == c) return require.normalize(p, path); - - // resolve deps by returning - // the dep in the nearest "deps" - // directory - var segs = parent.split('/'); - var i = lastIndexOf(segs, 'deps') + 1; - if (!i) i = 0; - path = segs.slice(0, i + 1).join('/') + '/deps/' + path; - return path; - }; - - /** - * Check if module is defined at `path`. - */ - - localRequire.exists = function(path) { - return require.modules.hasOwnProperty(localRequire.resolve(path)); - }; - - return localRequire; -}; -require.register("isarray/index.js", function(exports, require, module){ -module.exports = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; -}; - -}); -require.alias("isarray/index.js", "isarray/index.js"); - diff --git a/deps/npm/node_modules/readable-stream/node_modules/isarray/index.js b/deps/npm/node_modules/readable-stream/node_modules/isarray/index.js index 5f5ad45d46dda9..a57f63495943a0 100644 --- a/deps/npm/node_modules/readable-stream/node_modules/isarray/index.js +++ b/deps/npm/node_modules/readable-stream/node_modules/isarray/index.js @@ -1,3 +1,5 @@ +var toString = {}.toString; + module.exports = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; + return toString.call(arr) == '[object Array]'; }; diff --git a/deps/npm/node_modules/readable-stream/node_modules/isarray/package.json b/deps/npm/node_modules/readable-stream/node_modules/isarray/package.json index fb1eb3786d8168..a6ff18fbcf10ea 100644 --- a/deps/npm/node_modules/readable-stream/node_modules/isarray/package.json +++ b/deps/npm/node_modules/readable-stream/node_modules/isarray/package.json @@ -1,38 +1,96 @@ { - "name": "isarray", - "description": "Array#isArray for older browsers", - "version": "0.0.1", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/isarray.git" + "_args": [ + [ + "isarray@~1.0.0", + "/Users/rebecca/code/npm/node_modules/readable-stream" + ] + ], + "_from": "isarray@>=1.0.0 <1.1.0", + "_id": "isarray@1.0.0", + "_inCache": true, + "_installable": true, + "_location": "/readable-stream/isarray", + "_nodeVersion": "5.1.0", + "_npmUser": { + "email": "julian@juliangruber.com", + "name": "juliangruber" }, - "homepage": "https://github.com/juliangruber/isarray", - "main": "index.js", - "scripts": { - "test": "tap test/*.js" + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "name": "isarray", + "raw": "isarray@~1.0.0", + "rawSpec": "~1.0.0", + "scope": null, + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/readable-stream" + ], + "_resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "_shasum": "bb935d48582cba168c06834957a54a3e07124f11", + "_shrinkwrap": null, + "_spec": "isarray@~1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/readable-stream", + "author": { + "email": "mail@juliangruber.com", + "name": "Julian Gruber", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/isarray/issues" }, "dependencies": {}, + "description": "Array#isArray for older browsers", "devDependencies": { - "tap": "*" + "tape": "~2.13.4" }, + "directories": {}, + "dist": { + "shasum": "bb935d48582cba168c06834957a54a3e07124f11", + "tarball": "http://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" + }, + "gitHead": "2a23a281f369e9ae06394c0fb4d2381355a6ba33", + "homepage": "https://github.com/juliangruber/isarray", "keywords": [ "browser", "isarray", "array" ], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, "license": "MIT", - "readme": "\n# isarray\n\n`Array#isArray` for older browsers.\n\n## Usage\n\n```js\nvar isArray = require('isarray');\n\nconsole.log(isArray([])); // => true\nconsole.log(isArray({})); // => false\n```\n\n## Installation\n\nWith [npm](http://npmjs.org) do\n\n```bash\n$ npm install isarray\n```\n\nThen bundle for the browser with\n[browserify](https://github.com/substack/browserify).\n\nWith [component](http://component.io) do\n\n```bash\n$ component install juliangruber/isarray\n```\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber <julian@juliangruber.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/juliangruber/isarray/issues" + "main": "index.js", + "maintainers": [ + { + "email": "julian@juliangruber.com", + "name": "juliangruber" + } + ], + "name": "isarray", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/isarray.git" + }, + "scripts": { + "test": "tape test.js" + }, + "testling": { + "browsers": [ + "ie/8..latest", + "firefox/17..latest", + "firefox/nightly", + "chrome/22..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ], + "files": "test.js" }, - "_id": "isarray@0.0.1", - "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", - "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "_from": "isarray@0.0.1" + "version": "1.0.0" } diff --git a/deps/npm/node_modules/readable-stream/node_modules/isarray/test.js b/deps/npm/node_modules/readable-stream/node_modules/isarray/test.js new file mode 100644 index 00000000000000..f7f7bcd19fec56 --- /dev/null +++ b/deps/npm/node_modules/readable-stream/node_modules/isarray/test.js @@ -0,0 +1,19 @@ +var isArray = require('./'); +var test = require('tape'); + +test('is array', function(t){ + t.ok(isArray([])); + t.notOk(isArray({})); + t.notOk(isArray(null)); + t.notOk(isArray(false)); + + var obj = {}; + obj[0] = true; + t.notOk(isArray(obj)); + + var arr = []; + arr.foo = 'bar'; + t.ok(isArray(arr)); + + t.end(); +}); diff --git a/deps/npm/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml b/deps/npm/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml new file mode 100644 index 00000000000000..36201b10017a5e --- /dev/null +++ b/deps/npm/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml @@ -0,0 +1,12 @@ +language: node_js +node_js: + - "0.8" + - "0.10" + - "0.11" + - "0.12" + - "1.7.1" + - 1 + - 2 + - 3 + - 4 + - 5 diff --git a/deps/npm/node_modules/readable-stream/node_modules/process-nextick-args/index.js b/deps/npm/node_modules/readable-stream/node_modules/process-nextick-args/index.js new file mode 100644 index 00000000000000..571c276783c779 --- /dev/null +++ b/deps/npm/node_modules/readable-stream/node_modules/process-nextick-args/index.js @@ -0,0 +1,20 @@ +'use strict'; + +if (!process.version || + process.version.indexOf('v0.') === 0 || + process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { + module.exports = nextTick; +} else { + module.exports = process.nextTick; +} + +function nextTick(fn) { + var args = new Array(arguments.length - 1); + var i = 0; + while (i < args.length) { + args[i++] = arguments[i]; + } + process.nextTick(function afterTick() { + fn.apply(null, args); + }); +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/license.md b/deps/npm/node_modules/readable-stream/node_modules/process-nextick-args/license.md similarity index 100% rename from deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/license.md rename to deps/npm/node_modules/readable-stream/node_modules/process-nextick-args/license.md diff --git a/deps/npm/node_modules/readable-stream/node_modules/process-nextick-args/package.json b/deps/npm/node_modules/readable-stream/node_modules/process-nextick-args/package.json new file mode 100644 index 00000000000000..2d1862b791dbfb --- /dev/null +++ b/deps/npm/node_modules/readable-stream/node_modules/process-nextick-args/package.json @@ -0,0 +1,71 @@ +{ + "_args": [ + [ + "process-nextick-args@~1.0.0", + "/Users/rebecca/code/npm/node_modules/readable-stream" + ] + ], + "_from": "process-nextick-args@>=1.0.0 <1.1.0", + "_id": "process-nextick-args@1.0.6", + "_inCache": true, + "_installable": true, + "_location": "/readable-stream/process-nextick-args", + "_nodeVersion": "4.1.1", + "_npmUser": { + "email": "calvin.metcalf@gmail.com", + "name": "cwmma" + }, + "_npmVersion": "2.14.4", + "_phantomChildren": {}, + "_requested": { + "name": "process-nextick-args", + "raw": "process-nextick-args@~1.0.0", + "rawSpec": "~1.0.0", + "scope": null, + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/readable-stream" + ], + "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.6.tgz", + "_shasum": "0f96b001cea90b12592ce566edb97ec11e69bd05", + "_shrinkwrap": null, + "_spec": "process-nextick-args@~1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/readable-stream", + "author": "", + "bugs": { + "url": "https://github.com/calvinmetcalf/process-nextick-args/issues" + }, + "dependencies": {}, + "description": "process.nextTick but always with args", + "devDependencies": { + "tap": "~0.2.6" + }, + "directories": {}, + "dist": { + "shasum": "0f96b001cea90b12592ce566edb97ec11e69bd05", + "tarball": "http://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.6.tgz" + }, + "gitHead": "e85787b05a8c3c1adb714f332d822e9162699c78", + "homepage": "https://github.com/calvinmetcalf/process-nextick-args", + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + } + ], + "name": "process-nextick-args", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/calvinmetcalf/process-nextick-args.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.6" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/readme.md b/deps/npm/node_modules/readable-stream/node_modules/process-nextick-args/readme.md similarity index 100% rename from deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/readme.md rename to deps/npm/node_modules/readable-stream/node_modules/process-nextick-args/readme.md diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/test.js b/deps/npm/node_modules/readable-stream/node_modules/process-nextick-args/test.js similarity index 100% rename from deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/test.js rename to deps/npm/node_modules/readable-stream/node_modules/process-nextick-args/test.js diff --git a/deps/npm/node_modules/readable-stream/node_modules/string_decoder/package.json b/deps/npm/node_modules/readable-stream/node_modules/string_decoder/package.json index ee70702359198d..53cdd3928960b0 100644 --- a/deps/npm/node_modules/readable-stream/node_modules/string_decoder/package.json +++ b/deps/npm/node_modules/readable-stream/node_modules/string_decoder/package.json @@ -1,34 +1,81 @@ { - "name": "string_decoder", - "version": "0.10.31", - "description": "The string_decoder module from Node core", - "main": "index.js", + "_args": [ + [ + "string_decoder@~0.10.x", + "/Users/rebecca/code/npm/node_modules/npm-registry-couchapp/node_modules/readable-stream" + ], + [ + "string_decoder@~0.10.x", + "/Users/rebecca/code/npm/node_modules/readable-stream" + ] + ], + "_from": "string_decoder@>=0.10.0 <0.11.0", + "_id": "string_decoder@0.10.31", + "_inCache": true, + "_installable": true, + "_location": "/readable-stream/string_decoder", + "_npmUser": { + "email": "rod@vagg.org", + "name": "rvagg" + }, + "_npmVersion": "1.4.23", + "_phantomChildren": {}, + "_requested": { + "name": "string_decoder", + "raw": "string_decoder@~0.10.x", + "rawSpec": "~0.10.x", + "scope": null, + "spec": ">=0.10.0 <0.11.0", + "type": "range" + }, + "_requiredBy": [ + "/readable-stream" + ], + "_shrinkwrap": null, + "_spec": "string_decoder@~0.10.x", + "_where": "/Users/rebecca/code/npm/node_modules/readable-stream", + "bugs": { + "url": "https://github.com/rvagg/string_decoder/issues" + }, "dependencies": {}, + "description": "The string_decoder module from Node core", "devDependencies": { "tap": "~0.4.8" }, - "scripts": { - "test": "tap test/simple/*.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/rvagg/string_decoder.git" + "directories": {}, + "dist": { + "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", + "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" }, + "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0", "homepage": "https://github.com/rvagg/string_decoder", "keywords": [ - "string", - "decoder", "browser", - "browserify" + "browserify", + "decoder", + "string" ], "license": "MIT", - "readme": "**string_decoder.js** (`require('string_decoder')`) from Node.js core\n\nCopyright Joyent, Inc. and other Node contributors. See LICENCE file for details.\n\nVersion numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.**\n\nThe *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version.", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/rvagg/string_decoder/issues" + "main": "index.js", + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + }, + { + "name": "rvagg", + "email": "rod@vagg.org" + } + ], + "name": "string_decoder", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/rvagg/string_decoder.git" }, - "_id": "string_decoder@0.10.31", - "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "_from": "string_decoder@>=0.10.0 <0.11.0" + "scripts": { + "test": "tap test/simple/*.js" + }, + "version": "0.10.31" } diff --git a/deps/npm/node_modules/readable-stream/node_modules/util-deprecate/History.md b/deps/npm/node_modules/readable-stream/node_modules/util-deprecate/History.md new file mode 100644 index 00000000000000..acc8675372e980 --- /dev/null +++ b/deps/npm/node_modules/readable-stream/node_modules/util-deprecate/History.md @@ -0,0 +1,16 @@ + +1.0.2 / 2015-10-07 +================== + + * use try/catch when checking `localStorage` (#3, @kumavis) + +1.0.1 / 2014-11-25 +================== + + * browser: use `console.warn()` for deprecation calls + * browser: more jsdocs + +1.0.0 / 2014-04-30 +================== + + * initial commit diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/LICENSE b/deps/npm/node_modules/readable-stream/node_modules/util-deprecate/LICENSE similarity index 100% rename from deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/LICENSE rename to deps/npm/node_modules/readable-stream/node_modules/util-deprecate/LICENSE diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/README.md b/deps/npm/node_modules/readable-stream/node_modules/util-deprecate/README.md similarity index 100% rename from deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/README.md rename to deps/npm/node_modules/readable-stream/node_modules/util-deprecate/README.md diff --git a/deps/npm/node_modules/readable-stream/node_modules/util-deprecate/browser.js b/deps/npm/node_modules/readable-stream/node_modules/util-deprecate/browser.js new file mode 100644 index 00000000000000..549ae2f065ea5a --- /dev/null +++ b/deps/npm/node_modules/readable-stream/node_modules/util-deprecate/browser.js @@ -0,0 +1,67 @@ + +/** + * Module exports. + */ + +module.exports = deprecate; + +/** + * Mark that a method should not be used. + * Returns a modified function which warns once by default. + * + * If `localStorage.noDeprecation = true` is set, then it is a no-op. + * + * If `localStorage.throwDeprecation = true` is set, then deprecated functions + * will throw an Error when invoked. + * + * If `localStorage.traceDeprecation = true` is set, then deprecated functions + * will invoke `console.trace()` instead of `console.error()`. + * + * @param {Function} fn - the function to deprecate + * @param {String} msg - the string to print to the console when `fn` is invoked + * @returns {Function} a new "deprecated" version of `fn` + * @api public + */ + +function deprecate (fn, msg) { + if (config('noDeprecation')) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (config('throwDeprecation')) { + throw new Error(msg); + } else if (config('traceDeprecation')) { + console.trace(msg); + } else { + console.warn(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +} + +/** + * Checks `localStorage` for boolean values for the given `name`. + * + * @param {String} name + * @returns {Boolean} + * @api private + */ + +function config (name) { + // accessing global.localStorage can trigger a DOMException in sandboxed iframes + try { + if (!global.localStorage) return false; + } catch (_) { + return false; + } + var val = global.localStorage[name]; + if (null == val) return false; + return String(val).toLowerCase() === 'true'; +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/node.js b/deps/npm/node_modules/readable-stream/node_modules/util-deprecate/node.js similarity index 100% rename from deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/node.js rename to deps/npm/node_modules/readable-stream/node_modules/util-deprecate/node.js diff --git a/deps/npm/node_modules/readable-stream/node_modules/util-deprecate/package.json b/deps/npm/node_modules/readable-stream/node_modules/util-deprecate/package.json new file mode 100644 index 00000000000000..3681a0e544f1dd --- /dev/null +++ b/deps/npm/node_modules/readable-stream/node_modules/util-deprecate/package.json @@ -0,0 +1,81 @@ +{ + "_args": [ + [ + "util-deprecate@~1.0.1", + "/Users/rebecca/code/npm/node_modules/readable-stream" + ] + ], + "_from": "util-deprecate@>=1.0.1 <1.1.0", + "_id": "util-deprecate@1.0.2", + "_inCache": true, + "_installable": true, + "_location": "/readable-stream/util-deprecate", + "_nodeVersion": "4.1.2", + "_npmUser": { + "email": "nathan@tootallnate.net", + "name": "tootallnate" + }, + "_npmVersion": "2.14.4", + "_phantomChildren": {}, + "_requested": { + "name": "util-deprecate", + "raw": "util-deprecate@~1.0.1", + "rawSpec": "~1.0.1", + "scope": null, + "spec": ">=1.0.1 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/readable-stream" + ], + "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "_shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", + "_shrinkwrap": null, + "_spec": "util-deprecate@~1.0.1", + "_where": "/Users/rebecca/code/npm/node_modules/readable-stream", + "author": { + "email": "nathan@tootallnate.net", + "name": "Nathan Rajlich", + "url": "http://n8.io/" + }, + "browser": "browser.js", + "bugs": { + "url": "https://github.com/TooTallNate/util-deprecate/issues" + }, + "dependencies": {}, + "description": "The Node.js `util.deprecate()` function with browser support", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", + "tarball": "http://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + }, + "gitHead": "475fb6857cd23fafff20c1be846c1350abf8e6d4", + "homepage": "https://github.com/TooTallNate/util-deprecate", + "keywords": [ + "browser", + "browserify", + "deprecate", + "node", + "util" + ], + "license": "MIT", + "main": "node.js", + "maintainers": [ + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + } + ], + "name": "util-deprecate", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/util-deprecate.git" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "version": "1.0.2" +} diff --git a/deps/npm/node_modules/readable-stream/package.json b/deps/npm/node_modules/readable-stream/package.json index fbc5e7fa4983be..eca885b9a7dbb6 100644 --- a/deps/npm/node_modules/readable-stream/package.json +++ b/deps/npm/node_modules/readable-stream/package.json @@ -1,70 +1,115 @@ { - "name": "readable-stream", - "version": "1.1.13", - "description": "Streams3, a user-land copy of the stream library from Node.js v0.11.x", - "main": "readable.js", + "_args": [ + [ + "readable-stream@~2.0.5", + "/Users/rebecca/code/npm" + ] + ], + "_from": "readable-stream@>=2.0.5 <2.1.0", + "_id": "readable-stream@2.0.6", + "_inCache": true, + "_installable": true, + "_location": "/readable-stream", + "_nodeVersion": "5.7.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/readable-stream-2.0.6.tgz_1457893507709_0.369257491780445" + }, + "_npmUser": { + "email": "calvin.metcalf@gmail.com", + "name": "cwmma" + }, + "_npmVersion": "3.6.0", + "_phantomChildren": {}, + "_requested": { + "name": "readable-stream", + "raw": "readable-stream@~2.0.5", + "rawSpec": "~2.0.5", + "scope": null, + "spec": ">=2.0.5 <2.1.0", + "type": "range" + }, + "_requiredBy": [ + "/", + "/fs-write-stream-atomic", + "/npm-registry-client/concat-stream", + "/npmlog/are-we-there-yet", + "/request/bl", + "/sha", + "/standard/standard-engine/eslint/concat-stream", + "/standard/standard-format/esformatter/npm-run/spawn-sync/concat-stream", + "/tap", + "/tap/coveralls/request/bl", + "/tap/tap-parser" + ], + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "_shasum": "8f90341e68a53ccc928788dacfcd11b36eb9b78e", + "_shrinkwrap": null, + "_spec": "readable-stream@~2.0.5", + "_where": "/Users/rebecca/code/npm", + "browser": { + "util": false + }, + "bugs": { + "url": "https://github.com/nodejs/readable-stream/issues" + }, "dependencies": { "core-util-is": "~1.0.0", - "isarray": "0.0.1", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", "string_decoder": "~0.10.x", - "inherits": "~2.0.1" + "util-deprecate": "~1.0.1" }, + "description": "Streams3, a user-land copy of the stream library from Node.js", "devDependencies": { - "tap": "~0.2.6" - }, - "scripts": { - "test": "tap test/simple/*.js" + "tap": "~0.2.6", + "tape": "~4.5.1", + "zuul": "~3.9.0" }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/readable-stream.git" + "directories": {}, + "dist": { + "shasum": "8f90341e68a53ccc928788dacfcd11b36eb9b78e", + "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz" }, + "gitHead": "01fb5608a970b42c900b96746cadc13d27dd9d7e", + "homepage": "https://github.com/nodejs/readable-stream#readme", "keywords": [ "readable", "stream", "pipe" ], - "browser": { - "util": false - }, - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, "license": "MIT", - "gitHead": "3b672fd7ae92acf5b4ffdbabf74b372a0a56b051", - "bugs": { - "url": "https://github.com/isaacs/readable-stream/issues" - }, - "homepage": "https://github.com/isaacs/readable-stream", - "_id": "readable-stream@1.1.13", - "_shasum": "f6eef764f514c89e2b9e23146a75ba106756d23e", - "_from": "readable-stream@>=1.1.13 <1.2.0", - "_npmVersion": "1.4.23", - "_npmUser": { - "name": "rvagg", - "email": "rod@vagg.org" - }, + "main": "readable.js", "maintainers": [ { - "name": "isaacs", - "email": "i@izs.me" + "email": "isaacs@npmjs.com", + "name": "isaacs" }, { - "name": "tootallnate", - "email": "nathan@tootallnate.net" + "email": "nathan@tootallnate.net", + "name": "tootallnate" }, { - "name": "rvagg", - "email": "rod@vagg.org" + "email": "rod@vagg.org", + "name": "rvagg" + }, + { + "email": "calvin.metcalf@gmail.com", + "name": "cwmma" } ], - "dist": { - "shasum": "f6eef764f514c89e2b9e23146a75ba106756d23e", - "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.13.tgz" + "name": "readable-stream", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/nodejs/readable-stream.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.13.tgz", - "readme": "ERROR: No README data found!" + "scripts": { + "browser": "npm run write-zuul && zuul -- test/browser.js", + "test": "tap test/parallel/*.js test/ours/*.js", + "write-zuul": "printf \"ui: tape\nbrowsers:\n - name: $BROWSER_NAME\n version: $BROWSER_VERSION\n\">.zuul.yml" + }, + "version": "2.0.6" } diff --git a/deps/npm/node_modules/readable-stream/readable.js b/deps/npm/node_modules/readable-stream/readable.js index 09b8bf5091a82e..6222a579864dd2 100644 --- a/deps/npm/node_modules/readable-stream/readable.js +++ b/deps/npm/node_modules/readable-stream/readable.js @@ -1,5 +1,10 @@ +var Stream = (function (){ + try { + return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify + } catch(_){} +}()); exports = module.exports = require('./lib/_stream_readable.js'); -exports.Stream = require('stream'); +exports.Stream = Stream || exports; exports.Readable = exports; exports.Writable = require('./lib/_stream_writable.js'); exports.Duplex = require('./lib/_stream_duplex.js'); diff --git a/deps/npm/node_modules/readdir-scoped-modules/.travis.yml b/deps/npm/node_modules/readdir-scoped-modules/.travis.yml new file mode 100644 index 00000000000000..e1bcee1acd90c1 --- /dev/null +++ b/deps/npm/node_modules/readdir-scoped-modules/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +before_script: npm install -g npm@latest +node_js: + - '0.8' + - '0.10' + - '0.12' + - 'iojs' diff --git a/deps/npm/node_modules/readdir-scoped-modules/LICENSE b/deps/npm/node_modules/readdir-scoped-modules/LICENSE new file mode 100644 index 00000000000000..19129e315fe593 --- /dev/null +++ b/deps/npm/node_modules/readdir-scoped-modules/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/README.md b/deps/npm/node_modules/readdir-scoped-modules/README.md similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/README.md rename to deps/npm/node_modules/readdir-scoped-modules/README.md diff --git a/deps/npm/node_modules/readdir-scoped-modules/package.json b/deps/npm/node_modules/readdir-scoped-modules/package.json new file mode 100644 index 00000000000000..7ca808a1f2aecf --- /dev/null +++ b/deps/npm/node_modules/readdir-scoped-modules/package.json @@ -0,0 +1,65 @@ +{ + "name": "readdir-scoped-modules", + "version": "1.0.2", + "description": "Like `fs.readdir` but handling `@org/module` dirs as if they were a single entry.", + "main": "readdir.js", + "directories": { + "test": "test" + }, + "dependencies": { + "debuglog": "^1.0.1", + "dezalgo": "^1.0.0", + "graceful-fs": "^4.1.2", + "once": "^1.3.0" + }, + "devDependencies": { + "tap": "^1.2.0" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/readdir-scoped-modules.git" + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/readdir-scoped-modules/issues" + }, + "homepage": "https://github.com/npm/readdir-scoped-modules", + "gitHead": "d41d5de877cb4e9e3f14b92913132680af73d1b4", + "_id": "readdir-scoped-modules@1.0.2", + "_shasum": "9fafa37d286be5d92cbaebdee030dc9b5f406747", + "_from": "readdir-scoped-modules@1.0.2", + "_npmVersion": "2.14.3", + "_nodeVersion": "2.2.2", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "9fafa37d286be5d92cbaebdee030dc9b5f406747", + "tarball": "http://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.0.2.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "_resolved": "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.0.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/readdir.js b/deps/npm/node_modules/readdir-scoped-modules/readdir.js similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/readdir.js rename to deps/npm/node_modules/readdir-scoped-modules/readdir.js diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/basic.js b/deps/npm/node_modules/readdir-scoped-modules/test/basic.js similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/basic.js rename to deps/npm/node_modules/readdir-scoped-modules/test/basic.js diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@scope/y/.keep b/deps/npm/node_modules/readdir-scoped-modules/test/fixtures/@org/x/.keep similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@scope/y/.keep rename to deps/npm/node_modules/readdir-scoped-modules/test/fixtures/@org/x/.keep diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/a/x/.keep b/deps/npm/node_modules/readdir-scoped-modules/test/fixtures/@org/y/.keep similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/a/x/.keep rename to deps/npm/node_modules/readdir-scoped-modules/test/fixtures/@org/y/.keep diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/a/y/.keep b/deps/npm/node_modules/readdir-scoped-modules/test/fixtures/@scope/x/.keep similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/a/y/.keep rename to deps/npm/node_modules/readdir-scoped-modules/test/fixtures/@scope/x/.keep diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/b/x/.keep b/deps/npm/node_modules/readdir-scoped-modules/test/fixtures/@scope/y/.keep similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/b/x/.keep rename to deps/npm/node_modules/readdir-scoped-modules/test/fixtures/@scope/y/.keep diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/b/y/.keep b/deps/npm/node_modules/readdir-scoped-modules/test/fixtures/a/x/.keep similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/b/y/.keep rename to deps/npm/node_modules/readdir-scoped-modules/test/fixtures/a/x/.keep diff --git a/deps/npm/test/packages/npm-test-files/include4 b/deps/npm/node_modules/readdir-scoped-modules/test/fixtures/a/y/.keep similarity index 100% rename from deps/npm/test/packages/npm-test-files/include4 rename to deps/npm/node_modules/readdir-scoped-modules/test/fixtures/a/y/.keep diff --git a/deps/npm/test/packages/npm-test-files/sub/include b/deps/npm/node_modules/readdir-scoped-modules/test/fixtures/b/x/.keep similarity index 100% rename from deps/npm/test/packages/npm-test-files/sub/include rename to deps/npm/node_modules/readdir-scoped-modules/test/fixtures/b/x/.keep diff --git a/deps/npm/test/packages/npm-test-files/sub/include2 b/deps/npm/node_modules/readdir-scoped-modules/test/fixtures/b/y/.keep similarity index 100% rename from deps/npm/test/packages/npm-test-files/sub/include2 rename to deps/npm/node_modules/readdir-scoped-modules/test/fixtures/b/y/.keep diff --git a/deps/npm/node_modules/realize-package-specifier/package.json b/deps/npm/node_modules/realize-package-specifier/package.json index b14b24beffe366..6f08eef5be88cc 100644 --- a/deps/npm/node_modules/realize-package-specifier/package.json +++ b/deps/npm/node_modules/realize-package-specifier/package.json @@ -25,33 +25,13 @@ "require-inject": "^1.1.0", "tap": "^0.4.12" }, + "readme": "realize-package-specifier\n-------------------------\n\nParse a package specifier, peeking at the disk to differentiate between\nlocal tarballs, directories and named modules. This implements the logic\nused by `npm install` and `npm cache` to determine where to get packages\nfrom.\n\n```javascript\nvar realizePackageSpecifier = require(\"realize-package-specifier\")\nrealizePackageSpecifier(\"foo.tar.gz\", \".\", function (err, package) {\n …\n})\n```\n\n## Using\n\n* realizePackageSpecifier(*spec*, [*where*,] *callback*)\n\nParses *spec* using `npm-package-arg` and then uses stat to check to see if\nit refers to a local tarball or package directory. Stats are done relative\nto *where*. If it does then the local module is loaded. If it doesn't then\ntarget is left as a remote package specifier. Package directories are\nrecognized by the presence of a package.json in them.\n\n*spec* -- a package specifier, like: `foo@1.2`, or `foo@user/foo`, or\n`http://x.com/foo.tgz`, or `git+https://github.com/user/foo`\n\n*where* (optional, default: .) -- The directory in which we should look for\nlocal tarballs or package directories.\n\n*callback* function(*err*, *result*) -- Called once we've determined what\nkind of specifier this is. The *result* object will be very like the one\nreturned by `npm-package-arg` except with three differences: 1) There's a\nnew type of `directory`. 2) The `local` type only refers to tarballs. 2)\nFor all `local` and `directory` type results spec will contain the full path of\nthe local package.\n\n## Result Object\n\nThe full definition of the result object is:\n\n* `name` - If known, the `name` field expected in the resulting pkg.\n* `type` - One of the following strings:\n * `git` - A git repo\n * `hosted` - A hosted project, from github, bitbucket or gitlab. Originally\n either a full url pointing at one of these services or a shorthand like\n `user/project` or `github:user/project` for github or `bitbucket:user/project`\n for bitbucket.\n * `tag` - A tagged version, like `\"foo@latest\"`\n * `version` - A specific version number, like `\"foo@1.2.3\"`\n * `range` - A version range, like `\"foo@2.x\"`\n * `local` - A local file path\n * `directory` - A local package directory\n * `remote` - An http url (presumably to a tgz)\n* `spec` - The \"thing\". URL, the range, git repo, etc.\n* `hosted` - If type=hosted this will be an object with the following keys:\n * `type` - github, bitbucket or gitlab\n * `ssh` - The ssh path for this git repo\n * `sshurl` - The ssh URL for this git repo\n * `https` - The HTTPS URL for this git repo\n * `directUrl` - The URL for the package.json in this git repo\n* `raw` - The original un-modified string that was provided.\n* `rawSpec` - The part after the `name@...`, as it was originally\n provided.\n* `scope` - If a name is something like `@org/module` then the `scope`\n field will be set to `org`. If it doesn't have a scoped name, then\n scope is `null`.\n\n", + "readmeFilename": "README.md", "gitHead": "4f50130fa6b5e80954a90ea12bab382f53d890b1", "bugs": { "url": "https://github.com/npm/realize-package-specifier/issues" }, "_id": "realize-package-specifier@3.0.1", "_shasum": "fde32e926448e38f99334d95b7b08d51e3a98d9f", - "_from": "realize-package-specifier@>=3.0.0 <3.1.0", - "_npmVersion": "2.10.1", - "_nodeVersion": "2.0.2", - "_npmUser": { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" - }, - "dist": { - "shasum": "fde32e926448e38f99334d95b7b08d51e3a98d9f", - "tarball": "http://registry.npmjs.org/realize-package-specifier/-/realize-package-specifier-3.0.1.tgz" - }, - "maintainers": [ - { - "name": "iarna", - "email": "me@re-becca.org" - }, - { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/realize-package-specifier/-/realize-package-specifier-3.0.1.tgz" + "_from": "realize-package-specifier@>=3.0.1 <3.1.0" } diff --git a/deps/npm/node_modules/request/.travis.yml b/deps/npm/node_modules/request/.travis.yml index d793e7f545f775..c24c59b5d5b4fa 100644 --- a/deps/npm/node_modules/request/.travis.yml +++ b/deps/npm/node_modules/request/.travis.yml @@ -1,9 +1,9 @@ language: node_js node_js: - - "4.0" - - "io.js" - - "0.12" - - "0.10" + - node + - io.js + - 0.12 + - 0.10 sudo: false after_script: "npm run test-cov && cat ./coverage/lcov.info | codecov && cat ./coverage/lcov.info | coveralls" diff --git a/deps/npm/node_modules/request/CHANGELOG.md b/deps/npm/node_modules/request/CHANGELOG.md index a5da7d968f7094..86386a9ae5cba4 100644 --- a/deps/npm/node_modules/request/CHANGELOG.md +++ b/deps/npm/node_modules/request/CHANGELOG.md @@ -1,5 +1,60 @@ ## Change Log +### v2.68.0 (2016/01/27) +- [#2036](https://github.com/request/request/pull/2036) Add AWS Signature Version 4 (@simov, @mirkods) +- [#2022](https://github.com/request/request/pull/2022) Convert numeric multipart bodies to string (@simov, @feross) +- [#2024](https://github.com/request/request/pull/2024) Update har-validator dependency for nsp advisory #76 (@TylerDixon) +- [#2016](https://github.com/request/request/pull/2016) Update qs to version 6.0.2 🚀 (@greenkeeperio-bot) +- [#2007](https://github.com/request/request/pull/2007) Use the `extend` module instead of util._extend (@simov) +- [#2003](https://github.com/request/request/pull/2003) Update browserify to version 13.0.0 🚀 (@greenkeeperio-bot) +- [#1989](https://github.com/request/request/pull/1989) Update buffer-equal to version 1.0.0 🚀 (@greenkeeperio-bot) +- [#1956](https://github.com/request/request/pull/1956) Check form-data content-length value before setting up the header (@jongyoonlee) +- [#1958](https://github.com/request/request/pull/1958) Use IncomingMessage.destroy method (@simov) +- [#1952](https://github.com/request/request/pull/1952) Adds example for Tor proxy (@prometheansacrifice) +- [#1943](https://github.com/request/request/pull/1943) Update eslint to version 1.10.3 🚀 (@simov, @greenkeeperio-bot) +- [#1924](https://github.com/request/request/pull/1924) Update eslint to version 1.10.1 🚀 (@greenkeeperio-bot) +- [#1915](https://github.com/request/request/pull/1915) Remove content-length and transfer-encoding headers from defaultProxyHeaderWhiteList (@yaxia) + +### v2.67.0 (2015/11/19) +- [#1913](https://github.com/request/request/pull/1913) Update http-signature to version 1.1.0 🚀 (@greenkeeperio-bot) + +### v2.66.0 (2015/11/18) +- [#1906](https://github.com/request/request/pull/1906) Update README URLs based on HTTP redirects (@ReadmeCritic) +- [#1905](https://github.com/request/request/pull/1905) Convert typed arrays into regular buffers (@simov) +- [#1902](https://github.com/request/request/pull/1902) node-uuid@1.4.7 breaks build 🚨 (@greenkeeperio-bot) +- [#1894](https://github.com/request/request/pull/1894) Fix tunneling after redirection from https (Original: #1881) (@simov, @falms) +- [#1893](https://github.com/request/request/pull/1893) Update eslint to version 1.9.0 🚀 (@greenkeeperio-bot) +- [#1852](https://github.com/request/request/pull/1852) Update eslint to version 1.7.3 🚀 (@simov, @greenkeeperio-bot, @paulomcnally, @michelsalib, @arbaaz, @vladimirich, @LoicMahieu, @JoshWillik, @jzaefferer, @ryanwholey, @djchie, @thisconnect, @mgenereu, @acroca, @Sebmaster, @Bloutiouf) +- [#1876](https://github.com/request/request/pull/1876) Implement loose matching for har mime types (@simov) +- [#1875](https://github.com/request/request/pull/1875) Update bluebird to version 3.0.2 🚀 (@simov, @greenkeeperio-bot) +- [#1871](https://github.com/request/request/pull/1871) Update browserify to version 12.0.1 🚀 (@greenkeeperio-bot) +- [#1866](https://github.com/request/request/pull/1866) Add missing quotes on x-token property in README (@miguelmota) +- [#1874](https://github.com/request/request/pull/1874) Fix typo in README.md (@gswalden) +- [#1860](https://github.com/request/request/pull/1860) Improve referer header tests and docs (@simov) +- [#1861](https://github.com/request/request/pull/1861) Remove redundant call to Stream constructor (@watson) +- [#1857](https://github.com/request/request/pull/1857) Fix Referer header to point to the original host name (@simov) +- [#1850](https://github.com/request/request/pull/1850) Update karma-coverage to version 0.5.3 🚀 (@greenkeeperio-bot) +- [#1847](https://github.com/request/request/pull/1847) Use node's latest version when building (@simov) +- [#1836](https://github.com/request/request/pull/1836) Tunnel: fix wrong property name (@Bloutiouf) +- [#1820](https://github.com/request/request/pull/1820) Set href as request.js uses it (@mgenereu) +- [#1840](https://github.com/request/request/pull/1840) Update http-signature to version 1.0.2 🚀 (@greenkeeperio-bot) +- [#1845](https://github.com/request/request/pull/1845) Update istanbul to version 0.4.0 🚀 (@greenkeeperio-bot) + +### v2.65.0 (2015/10/11) +- [#1833](https://github.com/request/request/pull/1833) Update aws-sign2 to version 0.6.0 🚀 (@greenkeeperio-bot) +- [#1811](https://github.com/request/request/pull/1811) Enable loose cookie parsing in tough-cookie (@Sebmaster) +- [#1830](https://github.com/request/request/pull/1830) Bring back tilde ranges for all dependencies (@simov) +- [#1821](https://github.com/request/request/pull/1821) Implement support for RFC 2617 MD5-sess algorithm. (@BigDSK) +- [#1828](https://github.com/request/request/pull/1828) Updated qs dependency to 5.2.0 (@acroca) +- [#1818](https://github.com/request/request/pull/1818) Extract `readResponseBody` method out of `onRequestResponse` (@pvoisin) +- [#1819](https://github.com/request/request/pull/1819) Run stringify once (@mgenereu) +- [#1814](https://github.com/request/request/pull/1814) Updated har-validator to version 2.0.2 (@greenkeeperio-bot) +- [#1807](https://github.com/request/request/pull/1807) Updated tough-cookie to version 2.1.0 (@greenkeeperio-bot) +- [#1800](https://github.com/request/request/pull/1800) Add caret ranges for devDependencies, except eslint (@simov) +- [#1799](https://github.com/request/request/pull/1799) Updated karma-browserify to version 4.4.0 (@greenkeeperio-bot) +- [#1797](https://github.com/request/request/pull/1797) Updated tape to version 4.2.0 (@greenkeeperio-bot) +- [#1788](https://github.com/request/request/pull/1788) Pinned all dependencies (@greenkeeperio-bot) + ### v2.64.0 (2015/09/25) - [#1787](https://github.com/request/request/pull/1787) npm ignore examples, release.sh and disabled.appveyor.yml (@thisconnect) - [#1775](https://github.com/request/request/pull/1775) Fix typo in README.md (@djchie) @@ -415,7 +470,7 @@ - [#521](https://github.com/request/request/pull/521) Improving test-localAddress.js (@noway421) - [#529](https://github.com/request/request/pull/529) dependencies versions bump (@jodaka) -### v2.17.0 (2013/04/22) +### v2.18.0 (2013/04/22) - [#523](https://github.com/request/request/pull/523) Updating dependencies (@noway421) - [#520](https://github.com/request/request/pull/520) Fixing test-tunnel.js (@noway421) - [#519](https://github.com/request/request/pull/519) Update internal path state on post-creation QS changes (@jblebrun) diff --git a/deps/npm/node_modules/request/README.md b/deps/npm/node_modules/request/README.md index c18b022abe726d..6ee45b205d5473 100644 --- a/deps/npm/node_modules/request/README.md +++ b/deps/npm/node_modules/request/README.md @@ -161,7 +161,7 @@ request.post({url:'http://service.com/upload', form: {key:'value'}}, function(er #### multipart/form-data (Multipart Form Uploads) -For `multipart/form-data` we use the [form-data](https://github.com/felixge/node-form-data) library by [@felixge](https://github.com/felixge). For the most cases, you can pass your upload form data via the `formData` option. +For `multipart/form-data` we use the [form-data](https://github.com/form-data/form-data) library by [@felixge](https://github.com/felixge). For the most cases, you can pass your upload form data via the `formData` option. ```js @@ -179,7 +179,7 @@ var formData = { ], // Pass optional meta-data with an 'options' object with style: {value: DATA, options: OPTIONS} // Use case: for some types of streams, you'll need to provide "file"-related information manually. - // See the `form-data` README for more information about options: https://github.com/felixge/node-form-data + // See the `form-data` README for more information about options: https://github.com/form-data/form-data custom_file: { value: fs.createReadStream('/dev/urandom'), options: { @@ -206,7 +206,7 @@ form.append('my_field', 'my_value'); form.append('my_buffer', new Buffer([1, 2, 3])); form.append('custom_file', fs.createReadStream(__dirname + '/unicycle.jpg'), {filename: 'unicycle.jpg'}); ``` -See the [form-data README](https://github.com/felixge/node-form-data) for more information & examples. +See the [form-data README](https://github.com/form-data/form-data) for more information & examples. #### multipart/related @@ -472,7 +472,7 @@ HTTP/1.1 200 OK At this point, the connection is left open, and the client is communicating directly with the `endpoint-server.com` machine. -See [the wikipedia page on HTTP Tunneling](http://en.wikipedia.org/wiki/HTTP_tunnel) +See [the wikipedia page on HTTP Tunneling](https://en.wikipedia.org/wiki/HTTP_tunnel) for more information. By default, when proxying `http` traffic, request will simply make a @@ -566,7 +566,7 @@ Here's some examples of valid `no_proxy` values: ## UNIX Domain Sockets -`request` supports making requests to [UNIX Domain Sockets](http://en.wikipedia.org/wiki/Unix_domain_socket). To make one, use the following URL scheme: +`request` supports making requests to [UNIX Domain Sockets](https://en.wikipedia.org/wiki/Unix_domain_socket). To make one, use the following URL scheme: ```js /* Pattern */ 'http://unix:SOCKET:PATH' @@ -746,7 +746,7 @@ The first argument can be either a `url` or an `options` object. The only requir In non-chunked requests, data items with body streams are not allowed. - `preambleCRLF` - append a newline/CRLF before the boundary of your `multipart/form-data` request. - `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request. -- `json` - sets `body` but to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON. +- `json` - sets `body` to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON. - `jsonReviver` - a [reviver function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) that will be passed to `JSON.parse()` when parsing a JSON response body. --- @@ -754,7 +754,7 @@ The first argument can be either a `url` or an `options` object. The only requir - `auth` - A hash containing values `user` || `username`, `pass` || `password`, and `sendImmediately` (optional). See documentation above. - `oauth` - Options for OAuth HMAC-SHA1 signing. See documentation above. - `hawk` - Options for [Hawk signing](https://github.com/hueniverse/hawk). The `credentials` key must contain the necessary signing info, [see hawk docs for details](https://github.com/hueniverse/hawk#usage-example). -- `aws` - `object` containing AWS signing information. Should have the properties `key`, `secret`. Also requires the property `bucket`, unless you’re specifying your `bucket` as part of the path, or the request doesn’t use a bucket (i.e. GET Services) +- `aws` - `object` containing AWS signing information. Should have the properties `key`, `secret`. Also requires the property `bucket`, unless you’re specifying your `bucket` as part of the path, or the request doesn’t use a bucket (i.e. GET Services). If you want to use AWS sign version 4 use the parameter `sign_version` with value `4` otherwise the default is version 2. **Note:** you need to `npm install aws4` first. - `httpSignature` - Options for the [HTTP Signature Scheme](https://github.com/joyent/node-http-signature/blob/master/http_signing.md) using [Joyent's library](https://github.com/joyent/node-http-signature). The `keyId` and `key` properties must be specified. See the docs for other options. --- @@ -762,7 +762,7 @@ The first argument can be either a `url` or an `options` object. The only requir - `followRedirect` - follow HTTP 3xx responses as redirects (default: `true`). This property can also be implemented as function which gets `response` object as a single argument and should return `true` if redirects should continue or `false` otherwise. - `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects (default: `false`) - `maxRedirects` - the maximum number of redirects to follow (default: `10`) -- `removeRefererHeader` - removes the referer header when a redirect happens (default: `false`). +- `removeRefererHeader` - removes the referer header when a redirect happens (default: `false`). **Note:** if true, referer header set in the initial request is preserved during redirect chain. --- @@ -799,8 +799,7 @@ default in Linux can be anywhere from 20-120 seconds][linux-timeout]). - `tunnel` - controls the behavior of [HTTP `CONNECT` tunneling](https://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_tunneling) as follows: - - `undefined` (default) - `true` if the destination is `https` or a previous - request in the redirect chain used a tunneling proxy, `false` otherwise + - `undefined` (default) - `true` if the destination is `https`, `false` otherwise - `true` - always tunnel to the destination by making a `CONNECT` request to the proxy - `false` - request the destination as a `GET` request. @@ -845,7 +844,7 @@ For example: ```js //requests using baseRequest() will set the 'x-token' header var baseRequest = request.defaults({ - headers: {x-token: 'my-token'} + headers: {'x-token': 'my-token'} }) //requests using specialRequest() will include the 'x-token' header set in @@ -933,7 +932,7 @@ There are at least three ways to debug the operation of `request`: 2. Set `require('request').debug = true` at any time (this does the same thing as #1). -3. Use the [request-debug module](https://github.com/nylen/request-debug) to +3. Use the [request-debug module](https://github.com/request/request-debug) to view request and response headers and bodies. [back to top](#table-of-contents) @@ -1076,9 +1075,9 @@ request('http://www.google.com', function() { ``` The cookie store must be a -[`tough-cookie`](https://github.com/goinstant/tough-cookie) +[`tough-cookie`](https://github.com/SalesforceEng/tough-cookie) store and it must support synchronous operations; see the -[`CookieStore` API docs](https://github.com/goinstant/tough-cookie/#cookiestore-api) +[`CookieStore` API docs](https://github.com/SalesforceEng/tough-cookie#cookiestore-api) for details. To inspect your cookie jar after a request: diff --git a/deps/npm/node_modules/request/lib/auth.js b/deps/npm/node_modules/request/lib/auth.js index 1be1f42587b1e5..1cb695216f6b16 100644 --- a/deps/npm/node_modules/request/lib/auth.js +++ b/deps/npm/node_modules/request/lib/auth.js @@ -50,8 +50,6 @@ Auth.prototype.bearer = function (bearer, sendImmediately) { Auth.prototype.digest = function (method, path, authHeader) { // TODO: More complete implementation of RFC 2617. - // - check challenge.algorithm - // - support algorithm="MD5-sess" // - handle challenge.domain // - support qop="auth-int" only // - handle Authentication-Info (not necessarily?) @@ -73,11 +71,28 @@ Auth.prototype.digest = function (method, path, authHeader) { challenge[match[1]] = match[2] || match[3] } - var ha1 = md5(self.user + ':' + challenge.realm + ':' + self.pass) - var ha2 = md5(method + ':' + path) + /** + * RFC 2617: handle both MD5 and MD5-sess algorithms. + * + * If the algorithm directive's value is "MD5" or unspecified, then HA1 is + * HA1=MD5(username:realm:password) + * If the algorithm directive's value is "MD5-sess", then HA1 is + * HA1=MD5(MD5(username:realm:password):nonce:cnonce) + */ + var ha1Compute = function (algorithm, user, realm, pass, nonce, cnonce) { + var ha1 = md5(user + ':' + realm + ':' + pass) + if (algorithm && algorithm.toLowerCase() === 'md5-sess') { + return md5(ha1 + ':' + nonce + ':' + cnonce) + } else { + return ha1 + } + } + var qop = /(^|,)\s*auth\s*($|,)/.test(challenge.qop) && 'auth' var nc = qop && '00000001' var cnonce = qop && uuid().replace(/-/g, '') + var ha1 = ha1Compute(challenge.algorithm, self.user, challenge.realm, self.pass, challenge.nonce, cnonce) + var ha2 = md5(method + ':' + path) var digestResponse = qop ? md5(ha1 + ':' + challenge.nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + ha2) : md5(ha1 + ':' + challenge.nonce + ':' + ha2) diff --git a/deps/npm/node_modules/request/lib/cookies.js b/deps/npm/node_modules/request/lib/cookies.js index adde7c6012bded..412c07d63becb9 100644 --- a/deps/npm/node_modules/request/lib/cookies.js +++ b/deps/npm/node_modules/request/lib/cookies.js @@ -13,13 +13,13 @@ exports.parse = function(str) { if (typeof str !== 'string') { throw new Error('The cookie function only accepts STRING as param') } - return Cookie.parse(str) + return Cookie.parse(str, {loose: true}) } // Adapt the sometimes-Async api of tough.CookieJar to our requirements function RequestJar(store) { var self = this - self._jar = new CookieJar(store) + self._jar = new CookieJar(store, {looseMode: true}) } RequestJar.prototype.setCookie = function(cookieOrStr, uri, options) { var self = this diff --git a/deps/npm/node_modules/request/lib/har.js b/deps/npm/node_modules/request/lib/har.js index 83453a3274bbbe..30595748781ad1 100644 --- a/deps/npm/node_modules/request/lib/har.js +++ b/deps/npm/node_modules/request/lib/har.js @@ -3,7 +3,7 @@ var fs = require('fs') var qs = require('querystring') var validate = require('har-validator') -var util = require('util') +var extend = require('extend') function Har (request) { this.request = request @@ -60,43 +60,53 @@ Har.prototype.prep = function (data) { } // prep body - switch (data.postData.mimeType) { - case 'multipart/mixed': - case 'multipart/related': - case 'multipart/form-data': - case 'multipart/alternative': - // reset values - data.postData.mimeType = 'multipart/form-data' - break - - case 'application/x-www-form-urlencoded': - if (!data.postData.params) { - data.postData.text = '' - } else { - data.postData.paramsObj = data.postData.params.reduce(this.reducer, {}) - - // always overwrite - data.postData.text = qs.stringify(data.postData.paramsObj) - } - break - - case 'text/json': - case 'text/x-json': - case 'application/json': - case 'application/x-json': - data.postData.mimeType = 'application/json' - - if (data.postData.text) { - try { - data.postData.jsonObj = JSON.parse(data.postData.text) - } catch (e) { - this.request.debug(e) - - // force back to text/plain - data.postData.mimeType = 'text/plain' - } + function some (arr) { + return arr.some(function (type) { + return data.postData.mimeType.indexOf(type) === 0 + }) + } + + if (some([ + 'multipart/mixed', + 'multipart/related', + 'multipart/form-data', + 'multipart/alternative'])) { + + // reset values + data.postData.mimeType = 'multipart/form-data' + } + + else if (some([ + 'application/x-www-form-urlencoded'])) { + + if (!data.postData.params) { + data.postData.text = '' + } else { + data.postData.paramsObj = data.postData.params.reduce(this.reducer, {}) + + // always overwrite + data.postData.text = qs.stringify(data.postData.paramsObj) + } + } + + else if (some([ + 'text/json', + 'text/x-json', + 'application/json', + 'application/x-json'])) { + + data.postData.mimeType = 'application/json' + + if (data.postData.text) { + try { + data.postData.jsonObj = JSON.parse(data.postData.text) + } catch (e) { + this.request.debug(e) + + // force back to text/plain + data.postData.mimeType = 'text/plain' } - break + } } return data @@ -108,7 +118,8 @@ Har.prototype.options = function (options) { return options } - var har = util._extend({}, options.har) + var har = {} + extend(har, options.har) // only process the first entry if (har.log && har.log.entries) { @@ -152,51 +163,50 @@ Har.prototype.options = function (options) { options.headers = req.headersObj } - switch (req.postData.mimeType) { - case 'application/x-www-form-urlencoded': - options.form = req.postData.paramsObj - break - - case 'application/json': - if (req.postData.jsonObj) { - options.body = req.postData.jsonObj - options.json = true - } - break - - case 'multipart/form-data': - options.formData = {} + function test (type) { + return req.postData.mimeType.indexOf(type) === 0 + } + if (test('application/x-www-form-urlencoded')) { + options.form = req.postData.paramsObj + } + else if (test('application/json')) { + if (req.postData.jsonObj) { + options.body = req.postData.jsonObj + options.json = true + } + } + else if (test('multipart/form-data')) { + options.formData = {} - req.postData.params.forEach(function (param) { - var attachment = {} + req.postData.params.forEach(function (param) { + var attachment = {} - if (!param.fileName && !param.fileName && !param.contentType) { - options.formData[param.name] = param.value - return - } + if (!param.fileName && !param.fileName && !param.contentType) { + options.formData[param.name] = param.value + return + } - // attempt to read from disk! - if (param.fileName && !param.value) { - attachment.value = fs.createReadStream(param.fileName) - } else if (param.value) { - attachment.value = param.value - } + // attempt to read from disk! + if (param.fileName && !param.value) { + attachment.value = fs.createReadStream(param.fileName) + } else if (param.value) { + attachment.value = param.value + } - if (param.fileName) { - attachment.options = { - filename: param.fileName, - contentType: param.contentType ? param.contentType : null - } + if (param.fileName) { + attachment.options = { + filename: param.fileName, + contentType: param.contentType ? param.contentType : null } - - options.formData[param.name] = attachment - }) - break - - default: - if (req.postData.text) { - options.body = req.postData.text } + + options.formData[param.name] = attachment + }) + } + else { + if (req.postData.text) { + options.body = req.postData.text + } } return options diff --git a/deps/npm/node_modules/request/lib/multipart.js b/deps/npm/node_modules/request/lib/multipart.js index 03618588cc6320..c1281726187b6a 100644 --- a/deps/npm/node_modules/request/lib/multipart.js +++ b/deps/npm/node_modules/request/lib/multipart.js @@ -68,6 +68,9 @@ Multipart.prototype.build = function (parts, chunked) { var body = chunked ? new CombinedStream() : [] function add (part) { + if (typeof part === 'number') { + part = part.toString() + } return chunked ? body.append(part) : body.push(new Buffer(part)) } diff --git a/deps/npm/node_modules/request/lib/redirect.js b/deps/npm/node_modules/request/lib/redirect.js index b2d0f613a35d17..040dfe0e03d335 100644 --- a/deps/npm/node_modules/request/lib/redirect.js +++ b/deps/npm/node_modules/request/lib/redirect.js @@ -105,7 +105,7 @@ Redirect.prototype.onResponse = function (response) { // handle the case where we change protocol from https to http or vice versa if (request.uri.protocol !== uriPrev.protocol) { - request._updateProtocol() + delete request.agent } self.redirects.push( @@ -120,7 +120,6 @@ Redirect.prototype.onResponse = function (response) { // request.method = 'GET' // Force all redirects to use GET || commented out fixes #215 delete request.src delete request.req - delete request.agent delete request._started if (response.statusCode !== 401 && response.statusCode !== 307) { // Remove parameters from the previous response, unless this is the second request @@ -141,7 +140,7 @@ Redirect.prototype.onResponse = function (response) { } if (!self.removeRefererHeader) { - request.setHeader('referer', request.uri.href) + request.setHeader('referer', uriPrev.href) } request.emit('redirect') diff --git a/deps/npm/node_modules/request/lib/tunnel.js b/deps/npm/node_modules/request/lib/tunnel.js index cf28016e26ae36..bf96a8fec53361 100644 --- a/deps/npm/node_modules/request/lib/tunnel.js +++ b/deps/npm/node_modules/request/lib/tunnel.js @@ -12,7 +12,6 @@ var defaultProxyHeaderWhiteList = [ 'cache-control', 'content-encoding', 'content-language', - 'content-length', 'content-location', 'content-md5', 'content-range', @@ -24,7 +23,6 @@ var defaultProxyHeaderWhiteList = [ 'pragma', 'referer', 'te', - 'transfer-encoding', 'user-agent', 'via' ] @@ -34,7 +32,7 @@ var defaultProxyHeaderExclusiveList = [ ] function constructProxyHost(uriObject) { - var port = uriObject.portA + var port = uriObject.port , protocol = uriObject.protocol , proxyHost = uriObject.hostname + ':' @@ -109,22 +107,19 @@ function Tunnel (request) { this.request = request this.proxyHeaderWhiteList = defaultProxyHeaderWhiteList this.proxyHeaderExclusiveList = [] -} - -Tunnel.prototype.isEnabled = function (options) { - var request = this.request - // Tunnel HTTPS by default, or if a previous request in the redirect chain - // was tunneled. Allow the user to override this setting. - - // If self.tunnel is already set (because this is a redirect), use the - // existing value. if (typeof request.tunnel !== 'undefined') { - return request.tunnel + this.tunnelOverride = request.tunnel } +} + +Tunnel.prototype.isEnabled = function () { + var self = this + , request = self.request + // Tunnel HTTPS by default. Allow the user to override this setting. - // If options.tunnel is set (the user specified a value), use it. - if (typeof options.tunnel !== 'undefined') { - return options.tunnel + // If self.tunnelOverride is set (the user specified a value), use it. + if (typeof self.tunnelOverride !== 'undefined') { + return self.tunnelOverride } // If the destination is HTTPS, tunnel. @@ -132,10 +127,8 @@ Tunnel.prototype.isEnabled = function (options) { return true } - // Otherwise, leave tunnel unset, because if a later request in the redirect - // chain is HTTPS then that request (and any subsequent ones) should be - // tunneled. - return undefined + // Otherwise, do not use tunnel. + return false } Tunnel.prototype.setup = function (options) { diff --git a/deps/npm/node_modules/request/node_modules/aws-sign2/index.js b/deps/npm/node_modules/request/node_modules/aws-sign2/index.js index 576e49ddff1bce..54766a13518173 100644 --- a/deps/npm/node_modules/request/node_modules/aws-sign2/index.js +++ b/deps/npm/node_modules/request/node_modules/aws-sign2/index.js @@ -1,8 +1,18 @@ /*! - * knox - auth - * Copyright(c) 2010 LearnBoost - * MIT Licensed + * Copyright 2010 LearnBoost + * + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ /** @@ -17,7 +27,7 @@ var crypto = require('crypto') * Valid keys. */ -var keys = +var keys = [ 'acl' , 'location' , 'logging' @@ -56,7 +66,7 @@ module.exports.authorization = authorization * @param {Object} options * @return {String} * @api private - */ + */ function hmacSha1 (options) { return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64') @@ -65,8 +75,8 @@ function hmacSha1 (options) { module.exports.hmacSha1 = hmacSha1 /** - * Create a base64 sha1 HMAC for `options`. - * + * Create a base64 sha1 HMAC for `options`. + * * @param {Object} options * @return {String} * @api private @@ -79,10 +89,10 @@ function sign (options) { module.exports.sign = sign /** - * Create a base64 sha1 HMAC for `options`. + * Create a base64 sha1 HMAC for `options`. * * Specifically to be used with S3 presigned URLs - * + * * @param {Object} options * @return {String} * @api private @@ -98,7 +108,7 @@ module.exports.signQuery= signQuery * Return a string for sign() with the given `options`. * * Spec: - * + * * \n * \n * \n @@ -114,7 +124,7 @@ module.exports.signQuery= signQuery function stringToSign (options) { var headers = options.amazonHeaders || '' if (headers) headers += '\n' - var r = + var r = [ options.verb , options.md5 , options.contentType @@ -130,7 +140,7 @@ module.exports.queryStringToSign = stringToSign * for S3 presigned URLs * * Spec: - * + * * \n * * diff --git a/deps/npm/node_modules/request/node_modules/aws-sign2/package.json b/deps/npm/node_modules/request/node_modules/aws-sign2/package.json index b454fe46973974..0fe40d0b6e88b3 100644 --- a/deps/npm/node_modules/request/node_modules/aws-sign2/package.json +++ b/deps/npm/node_modules/request/node_modules/aws-sign2/package.json @@ -6,10 +6,11 @@ }, "name": "aws-sign2", "description": "AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.", - "version": "0.5.0", + "version": "0.6.0", "repository": { "url": "git+https://github.com/mikeal/aws-sign.git" }, + "license": "Apache-2.0", "main": "index.js", "dependencies": {}, "devDependencies": {}, @@ -17,18 +18,17 @@ "engines": { "node": "*" }, - "readme": "aws-sign\n========\n\nAWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.\n", - "readmeFilename": "README.md", + "gitHead": "8554bdb41268fa295eb1ee300f4adaa9f7f07fec", "bugs": { "url": "https://github.com/mikeal/aws-sign/issues" }, - "_id": "aws-sign2@0.5.0", - "dist": { - "shasum": "c57103f7a17fc037f02d7c2e64b602ea223f7d63", - "tarball": "http://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz" - }, - "_from": "aws-sign2@>=0.5.0 <0.6.0", - "_npmVersion": "1.3.2", + "homepage": "https://github.com/mikeal/aws-sign#readme", + "_id": "aws-sign2@0.6.0", + "scripts": {}, + "_shasum": "14342dd38dbcc94d0e5b87d763cd63612c0e794f", + "_from": "aws-sign2@>=0.6.0 <0.7.0", + "_npmVersion": "2.14.4", + "_nodeVersion": "4.1.2", "_npmUser": { "name": "mikeal", "email": "mikeal.rogers@gmail.com" @@ -39,8 +39,11 @@ "email": "mikeal.rogers@gmail.com" } ], + "dist": { + "shasum": "14342dd38dbcc94d0e5b87d763cd63612c0e794f", + "tarball": "http://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz" + }, "directories": {}, - "_shasum": "c57103f7a17fc037f02d7c2e64b602ea223f7d63", - "_resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz", - "homepage": "https://github.com/mikeal/aws-sign#readme" + "_resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/request/node_modules/aws4/.npmignore b/deps/npm/node_modules/request/node_modules/aws4/.npmignore new file mode 100644 index 00000000000000..ccafa6b412bff2 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/.npmignore @@ -0,0 +1,3 @@ +test +coverage +examples diff --git a/deps/npm/node_modules/request/node_modules/aws4/.tern-port b/deps/npm/node_modules/request/node_modules/aws4/.tern-port new file mode 100644 index 00000000000000..7fd1b5223deb90 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/.tern-port @@ -0,0 +1 @@ +62638 \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/aws4/.travis.yml b/deps/npm/node_modules/request/node_modules/aws4/.travis.yml new file mode 100644 index 00000000000000..61d06340455977 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "0.10" + - "0.12" + - "4.2" diff --git a/deps/npm/node_modules/request/node_modules/aws4/LICENSE b/deps/npm/node_modules/request/node_modules/aws4/LICENSE new file mode 100644 index 00000000000000..4f321e599569f4 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/LICENSE @@ -0,0 +1,19 @@ +Copyright 2013 Michael Hart (michael.hart.au@gmail.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/request/node_modules/aws4/README.md b/deps/npm/node_modules/request/node_modules/aws4/README.md new file mode 100644 index 00000000000000..068a07a8359617 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/README.md @@ -0,0 +1,509 @@ +aws4 +---- + +[![Build Status](https://secure.travis-ci.org/mhart/aws4.png?branch=master)](http://travis-ci.org/mhart/aws4) + +A small utility to sign vanilla node.js http(s) request options using Amazon's +[AWS Signature Version 4](http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html). + +This signature is supported by nearly all Amazon services, including +[S3](http://docs.aws.amazon.com/AmazonS3/latest/API/), +[EC2](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/), +[DynamoDB](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/API.html), +[Kinesis](http://docs.aws.amazon.com/kinesis/latest/APIReference/), +[Lambda](http://docs.aws.amazon.com/lambda/latest/dg/API_Reference.html), +[SQS](http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/), +[SNS](http://docs.aws.amazon.com/sns/latest/api/), +[IAM](http://docs.aws.amazon.com/IAM/latest/APIReference/), +[STS](http://docs.aws.amazon.com/STS/latest/APIReference/), +[RDS](http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/), +[CloudWatch](http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/), +[CloudWatch Logs](http://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/), +[CodeDeploy](http://docs.aws.amazon.com/codedeploy/latest/APIReference/), +[CloudFront](http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/), +[CloudTrail](http://docs.aws.amazon.com/awscloudtrail/latest/APIReference/), +[ElastiCache](http://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/), +[EMR](http://docs.aws.amazon.com/ElasticMapReduce/latest/API/), +[Glacier](http://docs.aws.amazon.com/amazonglacier/latest/dev/amazon-glacier-api.html), +[CloudSearch](http://docs.aws.amazon.com/cloudsearch/latest/developerguide/APIReq.html), +[Elastic Load Balancing](http://docs.aws.amazon.com/ElasticLoadBalancing/latest/APIReference/), +[Elastic Transcoder](http://docs.aws.amazon.com/elastictranscoder/latest/developerguide/api-reference.html), +[CloudFormation](http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/), +[Elastic Beanstalk](http://docs.aws.amazon.com/elasticbeanstalk/latest/api/), +[Storage Gateway](http://docs.aws.amazon.com/storagegateway/latest/userguide/AWSStorageGatewayAPI.html), +[Data Pipeline](http://docs.aws.amazon.com/datapipeline/latest/APIReference/), +[Direct Connect](http://docs.aws.amazon.com/directconnect/latest/APIReference/), +[Redshift](http://docs.aws.amazon.com/redshift/latest/APIReference/), +[OpsWorks](http://docs.aws.amazon.com/opsworks/latest/APIReference/), +[SES](http://docs.aws.amazon.com/ses/latest/APIReference/), +[SWF](http://docs.aws.amazon.com/amazonswf/latest/apireference/), +[AutoScaling](http://docs.aws.amazon.com/AutoScaling/latest/APIReference/), +[Mobile Analytics](http://docs.aws.amazon.com/mobileanalytics/latest/ug/server-reference.html), +[Cognito Identity](http://docs.aws.amazon.com/cognitoidentity/latest/APIReference/), +[Cognito Sync](http://docs.aws.amazon.com/cognitosync/latest/APIReference/), +[Container Service](http://docs.aws.amazon.com/AmazonECS/latest/APIReference/), +[AppStream](http://docs.aws.amazon.com/appstream/latest/developerguide/appstream-api-rest.html), +[Key Management Service](http://docs.aws.amazon.com/kms/latest/APIReference/), +[Config](http://docs.aws.amazon.com/config/latest/APIReference/), +[CloudHSM](http://docs.aws.amazon.com/cloudhsm/latest/dg/api-ref.html), +[Route53](http://docs.aws.amazon.com/Route53/latest/APIReference/requests-rest.html) and +[Route53 Domains](http://docs.aws.amazon.com/Route53/latest/APIReference/requests-rpc.html). + +Indeed, the only AWS services that *don't* support v4 as of 2014-12-30 are +[Import/Export](http://docs.aws.amazon.com/AWSImportExport/latest/DG/api-reference.html) and +[SimpleDB](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/SDB_API.html) +(they only support [AWS Signature Version 2](https://github.com/mhart/aws2)). + +It also provides defaults for a number of core AWS headers and +request parameters, making it very easy to query AWS services, or +build out a fully-featured AWS library. + +Example +------- + +```javascript +var http = require('http'), + https = require('https'), + aws4 = require('aws4') + +// given an options object you could pass to http.request +var opts = {host: 'sqs.us-east-1.amazonaws.com', path: '/?Action=ListQueues'} + +// alternatively (as aws4 can infer the host): +opts = {service: 'sqs', region: 'us-east-1', path: '/?Action=ListQueues'} + +// alternatively (as us-east-1 is default): +opts = {service: 'sqs', path: '/?Action=ListQueues'} + +aws4.sign(opts) // assumes AWS credentials are available in process.env + +console.log(opts) +/* +{ + host: 'sqs.us-east-1.amazonaws.com', + path: '/?Action=ListQueues', + headers: { + Host: 'sqs.us-east-1.amazonaws.com', + 'X-Amz-Date': '20121226T061030Z', + Authorization: 'AWS4-HMAC-SHA256 Credential=ABCDEF/20121226/us-east-1/sqs/aws4_request, ...' + } +} +*/ + +// we can now use this to query AWS using the standard node.js http API +http.request(opts, function(res) { res.pipe(process.stdout) }).end() +/* + + +... +*/ +``` + +More options +------------ + +```javascript +// you can also pass AWS credentials in explicitly (otherwise taken from process.env) +aws4.sign(opts, {accessKeyId: '', secretAccessKey: ''}) + +// can also add the signature to query strings +aws4.sign({service: 's3', path: '/my-bucket?X-Amz-Expires=12345', signQuery: true}) + +// create a utility function to pipe to stdout (with https this time) +function request(o) { https.request(o, function(res) { res.pipe(process.stdout) }).end(o.body || '') } + +// aws4 can infer the HTTP method if a body is passed in +// method will be POST and Content-Type: 'application/x-www-form-urlencoded; charset=utf-8' +request(aws4.sign({service: 'iam', body: 'Action=ListGroups&Version=2010-05-08'})) +/* + +... +*/ + +// can specify any custom option or header as per usual +request(aws4.sign({ + service: 'dynamodb', + region: 'ap-southeast-2', + method: 'POST', + path: '/', + headers: { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'DynamoDB_20120810.ListTables' + }, + body: '{}' +})) +/* +{"TableNames":[]} +... +*/ + +// works with all other services that support Signature Version 4 + +request(aws4.sign({service: 's3', path: '/', signQuery: true})) +/* + +... +*/ + +request(aws4.sign({service: 'ec2', path: '/?Action=DescribeRegions&Version=2014-06-15'})) +/* + +... +*/ + +request(aws4.sign({service: 'sns', path: '/?Action=ListTopics&Version=2010-03-31'})) +/* + +... +*/ + +request(aws4.sign({service: 'sts', path: '/?Action=GetSessionToken&Version=2011-06-15'})) +/* + +... +*/ + +request(aws4.sign({service: 'cloudsearch', path: '/?Action=ListDomainNames&Version=2013-01-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'ses', path: '/?Action=ListIdentities&Version=2010-12-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'autoscaling', path: '/?Action=DescribeAutoScalingInstances&Version=2011-01-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'elasticloadbalancing', path: '/?Action=DescribeLoadBalancers&Version=2012-06-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'cloudformation', path: '/?Action=ListStacks&Version=2010-05-15'})) +/* + +... +*/ + +request(aws4.sign({service: 'elasticbeanstalk', path: '/?Action=ListAvailableSolutionStacks&Version=2010-12-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'rds', path: '/?Action=DescribeDBInstances&Version=2012-09-17'})) +/* + +... +*/ + +request(aws4.sign({service: 'monitoring', path: '/?Action=ListMetrics&Version=2010-08-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'redshift', path: '/?Action=DescribeClusters&Version=2012-12-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'cloudfront', path: '/2014-05-31/distribution'})) +/* + +... +*/ + +request(aws4.sign({service: 'elasticache', path: '/?Action=DescribeCacheClusters&Version=2014-07-15'})) +/* + +... +*/ + +request(aws4.sign({service: 'elasticmapreduce', path: '/?Action=DescribeJobFlows&Version=2009-03-31'})) +/* + +... +*/ + +request(aws4.sign({service: 'route53', path: '/2013-04-01/hostedzone'})) +/* + +... +*/ + +request(aws4.sign({service: 'appstream', path: '/applications'})) +/* +{"_links":{"curie":[{"href":"http://docs.aws.amazon.com/appstream/latest/... +... +*/ + +request(aws4.sign({service: 'cognito-sync', path: '/identitypools'})) +/* +{"Count":0,"IdentityPoolUsages":[],"MaxResults":16,"NextToken":null} +... +*/ + +request(aws4.sign({service: 'elastictranscoder', path: '/2012-09-25/pipelines'})) +/* +{"NextPageToken":null,"Pipelines":[]} +... +*/ + +request(aws4.sign({service: 'lambda', path: '/2014-11-13/functions/'})) +/* +{"Functions":[],"NextMarker":null} +... +*/ + +request(aws4.sign({service: 'ecs', path: '/?Action=ListClusters&Version=2014-11-13'})) +/* + +... +*/ + +request(aws4.sign({service: 'glacier', path: '/-/vaults', headers: {'X-Amz-Glacier-Version': '2012-06-01'}})) +/* +{"Marker":null,"VaultList":[]} +... +*/ + +request(aws4.sign({service: 'storagegateway', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'StorageGateway_20120630.ListGateways' +}})) +/* +{"Gateways":[]} +... +*/ + +request(aws4.sign({service: 'datapipeline', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'DataPipeline.ListPipelines' +}})) +/* +{"hasMoreResults":false,"pipelineIdList":[]} +... +*/ + +request(aws4.sign({service: 'opsworks', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'OpsWorks_20130218.DescribeStacks' +}})) +/* +{"Stacks":[]} +... +*/ + +request(aws4.sign({service: 'route53domains', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Route53Domains_v20140515.ListDomains' +}})) +/* +{"Domains":[]} +... +*/ + +request(aws4.sign({service: 'kinesis', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Kinesis_20131202.ListStreams' +}})) +/* +{"HasMoreStreams":false,"StreamNames":[]} +... +*/ + +request(aws4.sign({service: 'cloudtrail', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'CloudTrail_20131101.DescribeTrails' +}})) +/* +{"trailList":[]} +... +*/ + +request(aws4.sign({service: 'logs', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.DescribeLogGroups' +}})) +/* +{"logGroups":[]} +... +*/ + +request(aws4.sign({service: 'codedeploy', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'CodeDeploy_20141006.ListApplications' +}})) +/* +{"applications":[]} +... +*/ + +request(aws4.sign({service: 'directconnect', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'OvertureService.DescribeConnections' +}})) +/* +{"connections":[]} +... +*/ + +request(aws4.sign({service: 'kms', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'TrentService.ListKeys' +}})) +/* +{"Keys":[],"Truncated":false} +... +*/ + +request(aws4.sign({service: 'config', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'StarlingDoveService.DescribeDeliveryChannels' +}})) +/* +{"DeliveryChannels":[]} +... +*/ + +request(aws4.sign({service: 'cloudhsm', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'CloudHsmFrontendService.ListAvailableZones' +}})) +/* +{"AZList":["us-east-1a","us-east-1b","us-east-1c"]} +... +*/ + +request(aws4.sign({ + service: 'swf', + body: '{"registrationStatus":"REGISTERED"}', + headers: { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'SimpleWorkflowService.ListDomains' + } +})) +/* +{"domainInfos":[]} +... +*/ + +request(aws4.sign({ + service: 'cognito-identity', + body: '{"MaxResults": 1}', + headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSCognitoIdentityService.ListIdentityPools' + } +})) +/* +{"IdentityPools":[]} +... +*/ + +request(aws4.sign({ + service: 'mobileanalytics', + path: '/2014-06-05/events', + body: JSON.stringify({events:[{ + eventType: 'a', + timestamp: new Date().toISOString(), + session: {}, + }]}), + headers: { + 'Content-Type': 'application/json', + 'X-Amz-Client-Context': JSON.stringify({ + client: {client_id: 'a', app_title: 'a'}, + custom: {}, + env: {platform: 'a'}, + services: {}, + }), + } +})) +/* +(HTTP 202, empty response) +*/ +``` + +API +--- + +### aws4.sign(requestOptions, [credentials]) + +This calculates and populates the `Authorization` header of +`requestOptions`, and any other necessary AWS headers and/or request +options. Returns `requestOptions` as a convenience for chaining. + +`requestOptions` is an object holding the same options that the node.js +[http.request](http://nodejs.org/docs/latest/api/http.html#http_http_request_options_callback) +function takes. + +The following properties of `requestOptions` are used in the signing or +populated if they don't already exist: + +- `hostname` or `host` (will be determined from `service` and `region` if not given) +- `method` (will use `'GET'` if not given or `'POST'` if there is a `body`) +- `path` (will use `'/'` if not given) +- `body` (will use `''` if not given) +- `service` (will be calculated from `hostname` or `host` if not given) +- `region` (will be calculated from `hostname` or `host` or use `'us-east-1'` if not given) +- `headers['Host']` (will use `hostname` or `host` or be calculated if not given) +- `headers['Content-Type']` (will use `'application/x-www-form-urlencoded; charset=utf-8'` + if not given and there is a `body`) +- `headers['Date']` (used to calculate the signature date if given, otherwise `new Date` is used) + +Your AWS credentials (which can be found in your +[AWS console](https://portal.aws.amazon.com/gp/aws/securityCredentials)) +can be specified in one of two ways: + +- As the second argument, like this: + +```javascript +aws4.sign(requestOptions, { + secretAccessKey: "", + accessKeyId: "", + sessionToken: "" +}) +``` + +- From `process.env`, such as this: + +``` +export AWS_SECRET_ACCESS_KEY="" +export AWS_ACCESS_KEY_ID="" +export AWS_SESSION_TOKEN="" +``` + +(will also use `AWS_ACCESS_KEY` and `AWS_SECRET_KEY` if available) + +The `sessionToken` property and `AWS_SESSION_TOKEN` environment variable are optional for signing +with [IAM STS temporary credentials](http://docs.aws.amazon.com/STS/latest/UsingSTS/using-temp-creds.html). + +Installation +------------ + +With [npm](http://npmjs.org/) do: + +``` +npm install aws4 +``` + +Thanks +------ + +Thanks to [@jed](https://github.com/jed) for his +[dynamo-client](https://github.com/jed/dynamo-client) lib where I first +committed and subsequently extracted this code. + +Also thanks to the +[official node.js AWS SDK](https://github.com/aws/aws-sdk-js) for giving +me a start on implementing the v4 signature. diff --git a/deps/npm/node_modules/request/node_modules/aws4/aws4.js b/deps/npm/node_modules/request/node_modules/aws4/aws4.js new file mode 100644 index 00000000000000..3ef54a468fc904 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/aws4.js @@ -0,0 +1,313 @@ +var aws4 = exports, + url = require('url'), + querystring = require('querystring'), + crypto = require('crypto'), + lru = require('lru-cache'), + credentialsCache = lru(1000) + +// http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html + +function hmac(key, string, encoding) { + return crypto.createHmac('sha256', key).update(string, 'utf8').digest(encoding) +} + +function hash(string, encoding) { + return crypto.createHash('sha256').update(string, 'utf8').digest(encoding) +} + +// This function assumes the string has already been percent encoded +function encodeRfc3986(urlEncodedString) { + return urlEncodedString.replace(/[!'()*]/g, function(c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase() + }) +} + +// request: { path | body, [host], [method], [headers], [service], [region] } +// credentials: { accessKeyId, secretAccessKey, [sessionToken] } +function RequestSigner(request, credentials) { + + if (typeof request === 'string') request = url.parse(request) + + var headers = request.headers = (request.headers || {}), + hostParts = this.matchHost(request.hostname || request.host || headers.Host || headers.host) + + this.request = request + this.credentials = credentials || this.defaultCredentials() + + this.service = request.service || hostParts[0] || '' + this.region = request.region || hostParts[1] || 'us-east-1' + + // SES uses a different domain from the service name + if (this.service === 'email') this.service = 'ses' + + if (!request.method && request.body) + request.method = 'POST' + + if (!headers.Host && !headers.host) + headers.Host = request.hostname || request.host || this.createHost() + if (!request.hostname && !request.host) + request.hostname = headers.Host || headers.host +} + +RequestSigner.prototype.matchHost = function(host) { + var match = (host || '').match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com$/) + var hostParts = (match || []).slice(1, 3) + + // ES's hostParts are sometimes the other way round, if the value that is expected + // to be region equals ‘es’ switch them back + // e.g. search-cluster-name-aaaa00aaaa0aaa0aaaaaaa0aaa.us-east-1.es.amazonaws.com + if (hostParts[1] === 'es') + hostParts = hostParts.reverse() + + return hostParts +} + +// http://docs.aws.amazon.com/general/latest/gr/rande.html +RequestSigner.prototype.isSingleRegion = function() { + // Special case for S3 and SimpleDB in us-east-1 + if (['s3', 'sdb'].indexOf(this.service) >= 0 && this.region === 'us-east-1') return true + + return ['cloudfront', 'ls', 'route53', 'iam', 'importexport', 'sts'] + .indexOf(this.service) >= 0 +} + +RequestSigner.prototype.createHost = function() { + var region = this.isSingleRegion() ? '' : + (this.service === 's3' && this.region !== 'us-east-1' ? '-' : '.') + this.region, + service = this.service === 'ses' ? 'email' : this.service + return service + region + '.amazonaws.com' +} + +RequestSigner.prototype.prepareRequest = function() { + this.parsePath() + + var request = this.request, headers = request.headers, query + + if (request.signQuery) { + + this.parsedPath.query = query = this.parsedPath.query || {} + + if (this.credentials.sessionToken) + query['X-Amz-Security-Token'] = this.credentials.sessionToken + + if (this.service === 's3' && !query['X-Amz-Expires']) + query['X-Amz-Expires'] = 86400 + + if (query['X-Amz-Date']) + this.datetime = query['X-Amz-Date'] + else + query['X-Amz-Date'] = this.getDateTime() + + query['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256' + query['X-Amz-Credential'] = this.credentials.accessKeyId + '/' + this.credentialString() + query['X-Amz-SignedHeaders'] = this.signedHeaders() + + } else { + + if (!request.doNotModifyHeaders) { + if (request.body && !headers['Content-Type'] && !headers['content-type']) + headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8' + + if (request.body && !headers['Content-Length'] && !headers['content-length']) + headers['Content-Length'] = Buffer.byteLength(request.body) + + if (this.credentials.sessionToken) + headers['X-Amz-Security-Token'] = this.credentials.sessionToken + + if (this.service === 's3') + headers['X-Amz-Content-Sha256'] = hash(this.request.body || '', 'hex') + + if (headers['X-Amz-Date']) + this.datetime = headers['X-Amz-Date'] + else + headers['X-Amz-Date'] = this.getDateTime() + } + + delete headers.Authorization + delete headers.authorization + } +} + +RequestSigner.prototype.sign = function() { + if (!this.parsedPath) this.prepareRequest() + + if (this.request.signQuery) { + this.parsedPath.query['X-Amz-Signature'] = this.signature() + } else { + this.request.headers.Authorization = this.authHeader() + } + + this.request.path = this.formatPath() + + return this.request +} + +RequestSigner.prototype.getDateTime = function() { + if (!this.datetime) { + var headers = this.request.headers, + date = new Date(headers.Date || headers.date || new Date) + + this.datetime = date.toISOString().replace(/[:\-]|\.\d{3}/g, '') + } + return this.datetime +} + +RequestSigner.prototype.getDate = function() { + return this.getDateTime().substr(0, 8) +} + +RequestSigner.prototype.authHeader = function() { + return [ + 'AWS4-HMAC-SHA256 Credential=' + this.credentials.accessKeyId + '/' + this.credentialString(), + 'SignedHeaders=' + this.signedHeaders(), + 'Signature=' + this.signature(), + ].join(', ') +} + +RequestSigner.prototype.signature = function() { + var date = this.getDate(), + cacheKey = [this.credentials.secretAccessKey, date, this.region, this.service].join(), + kDate, kRegion, kService, kCredentials = credentialsCache.get(cacheKey) + if (!kCredentials) { + kDate = hmac('AWS4' + this.credentials.secretAccessKey, date) + kRegion = hmac(kDate, this.region) + kService = hmac(kRegion, this.service) + kCredentials = hmac(kService, 'aws4_request') + credentialsCache.set(cacheKey, kCredentials) + } + return hmac(kCredentials, this.stringToSign(), 'hex') +} + +RequestSigner.prototype.stringToSign = function() { + return [ + 'AWS4-HMAC-SHA256', + this.getDateTime(), + this.credentialString(), + hash(this.canonicalString(), 'hex'), + ].join('\n') +} + +RequestSigner.prototype.canonicalString = function() { + if (!this.parsedPath) this.prepareRequest() + + var pathStr = this.parsedPath.path, + query = this.parsedPath.query, + queryStr = '', + normalizePath = this.service !== 's3', + decodePath = this.service === 's3' || this.request.doNotEncodePath, + decodeSlashesInPath = this.service === 's3', + firstValOnly = this.service === 's3', + bodyHash = this.service === 's3' && this.request.signQuery ? + 'UNSIGNED-PAYLOAD' : hash(this.request.body || '', 'hex') + + if (query) { + queryStr = encodeRfc3986(querystring.stringify(Object.keys(query).sort().reduce(function(obj, key) { + if (!key) return obj + obj[key] = !Array.isArray(query[key]) ? query[key] : + (firstValOnly ? query[key][0] : query[key].slice().sort()) + return obj + }, {}))) + } + if (pathStr !== '/') { + if (normalizePath) pathStr = pathStr.replace(/\/{2,}/g, '/') + if (pathStr[0] === '/') pathStr = pathStr.slice(1) + pathStr = '/' + pathStr.split('/').reduce(function(path, piece) { + if (normalizePath && piece === '..') { + path.pop() + } else if (!normalizePath || piece !== '.') { + if (decodePath) piece = querystring.unescape(piece) + path.push(encodeRfc3986(querystring.escape(piece))) + } + return path + }, []).join('/') + if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/') + } + + return [ + this.request.method || 'GET', + pathStr, + queryStr, + this.canonicalHeaders() + '\n', + this.signedHeaders(), + bodyHash, + ].join('\n') +} + +RequestSigner.prototype.canonicalHeaders = function() { + var headers = this.request.headers + function trimAll(header) { + return header.toString().trim().replace(/\s+/g, ' ') + } + return Object.keys(headers) + .sort(function(a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1 }) + .map(function(key) { return key.toLowerCase() + ':' + trimAll(headers[key]) }) + .join('\n') +} + +RequestSigner.prototype.signedHeaders = function() { + return Object.keys(this.request.headers) + .map(function(key) { return key.toLowerCase() }) + .sort() + .join(';') +} + +RequestSigner.prototype.credentialString = function() { + return [ + this.getDate(), + this.region, + this.service, + 'aws4_request', + ].join('/') +} + +RequestSigner.prototype.defaultCredentials = function() { + var env = process.env + return { + accessKeyId: env.AWS_ACCESS_KEY_ID || env.AWS_ACCESS_KEY, + secretAccessKey: env.AWS_SECRET_ACCESS_KEY || env.AWS_SECRET_KEY, + sessionToken: env.AWS_SESSION_TOKEN, + } +} + +RequestSigner.prototype.parsePath = function() { + var path = this.request.path || '/', + queryIx = path.indexOf('?'), + query = null + + if (queryIx >= 0) { + query = querystring.parse(path.slice(queryIx + 1)) + path = path.slice(0, queryIx) + } + + // S3 doesn't always encode characters > 127 correctly and + // all services don't encode characters > 255 correctly + // So if there are non-reserved chars (and it's not already all % encoded), just encode them all + if (/[^0-9A-Za-z!'()*\-._~%/]/.test(path)) { + path = path.split('/').map(function(piece) { + return querystring.escape(querystring.unescape(piece)) + }).join('/') + } + + this.parsedPath = { + path: path, + query: query, + } +} + +RequestSigner.prototype.formatPath = function() { + var path = this.parsedPath.path, + query = this.parsedPath.query + + if (!query) return path + + // Services don't support empty query string keys + if (query[''] != null) delete query[''] + + return path + '?' + encodeRfc3986(querystring.stringify(query)) +} + +aws4.RequestSigner = RequestSigner + +aws4.sign = function(request, credentials) { + return new RequestSigner(request, credentials).sign() +} diff --git a/deps/npm/node_modules/request/node_modules/aws4/example.js b/deps/npm/node_modules/request/node_modules/aws4/example.js new file mode 100644 index 00000000000000..5d075409d5de95 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/example.js @@ -0,0 +1,371 @@ +var http = require('http'), + https = require('https'), + aws4 = require('aws4') + +// given an options object you could pass to http.request +var opts = {host: 'sqs.us-east-1.amazonaws.com', path: '/?Action=ListQueues'} + +// alternatively (as aws4 can infer the host): +opts = {service: 'sqs', region: 'us-east-1', path: '/?Action=ListQueues'} + +// alternatively (as us-east-1 is default): +opts = {service: 'sqs', path: '/?Action=ListQueues'} + +aws4.sign(opts) // assumes AWS credentials are available in process.env + +console.log(opts) +/* +{ + host: 'sqs.us-east-1.amazonaws.com', + path: '/?Action=ListQueues', + headers: { + Host: 'sqs.us-east-1.amazonaws.com', + 'X-Amz-Date': '20121226T061030Z', + Authorization: 'AWS4-HMAC-SHA256 Credential=ABCDEF/20121226/us-east-1/sqs/aws4_request, ...' + } +} +*/ + +// we can now use this to query AWS using the standard node.js http API +http.request(opts, function(res) { res.pipe(process.stdout) }).end() +/* + + +... +*/ + +// you can also pass AWS credentials in explicitly (otherwise taken from process.env) +aws4.sign(opts, {accessKeyId: '', secretAccessKey: ''}) + +// can also add the signature to query strings +aws4.sign({service: 's3', path: '/my-bucket?X-Amz-Expires=12345', signQuery: true}) + +// create a utility function to pipe to stdout (with https this time) +function request(o) { https.request(o, function(res) { res.pipe(process.stdout) }).end(o.body || '') } + +// aws4 can infer the HTTP method if a body is passed in +// method will be POST and Content-Type: 'application/x-www-form-urlencoded; charset=utf-8' +request(aws4.sign({service: 'iam', body: 'Action=ListGroups&Version=2010-05-08'})) +/* + +... +*/ + +// can specify any custom option or header as per usual +request(aws4.sign({ + service: 'dynamodb', + region: 'ap-southeast-2', + method: 'POST', + path: '/', + headers: { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'DynamoDB_20120810.ListTables' + }, + body: '{}' +})) +/* +{"TableNames":[]} +... +*/ + +// works with all other services that support Signature Version 4 + +request(aws4.sign({service: 's3', path: '/', signQuery: true})) +/* + +... +*/ + +request(aws4.sign({service: 'ec2', path: '/?Action=DescribeRegions&Version=2014-06-15'})) +/* + +... +*/ + +request(aws4.sign({service: 'sns', path: '/?Action=ListTopics&Version=2010-03-31'})) +/* + +... +*/ + +request(aws4.sign({service: 'sts', path: '/?Action=GetSessionToken&Version=2011-06-15'})) +/* + +... +*/ + +request(aws4.sign({service: 'cloudsearch', path: '/?Action=ListDomainNames&Version=2013-01-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'ses', path: '/?Action=ListIdentities&Version=2010-12-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'autoscaling', path: '/?Action=DescribeAutoScalingInstances&Version=2011-01-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'elasticloadbalancing', path: '/?Action=DescribeLoadBalancers&Version=2012-06-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'cloudformation', path: '/?Action=ListStacks&Version=2010-05-15'})) +/* + +... +*/ + +request(aws4.sign({service: 'elasticbeanstalk', path: '/?Action=ListAvailableSolutionStacks&Version=2010-12-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'rds', path: '/?Action=DescribeDBInstances&Version=2012-09-17'})) +/* + +... +*/ + +request(aws4.sign({service: 'monitoring', path: '/?Action=ListMetrics&Version=2010-08-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'redshift', path: '/?Action=DescribeClusters&Version=2012-12-01'})) +/* + +... +*/ + +request(aws4.sign({service: 'cloudfront', path: '/2014-05-31/distribution'})) +/* + +... +*/ + +request(aws4.sign({service: 'elasticache', path: '/?Action=DescribeCacheClusters&Version=2014-07-15'})) +/* + +... +*/ + +request(aws4.sign({service: 'elasticmapreduce', path: '/?Action=DescribeJobFlows&Version=2009-03-31'})) +/* + +... +*/ + +request(aws4.sign({service: 'route53', path: '/2013-04-01/hostedzone'})) +/* + +... +*/ + +request(aws4.sign({service: 'appstream', path: '/applications'})) +/* +{"_links":{"curie":[{"href":"http://docs.aws.amazon.com/appstream/latest/... +... +*/ + +request(aws4.sign({service: 'cognito-sync', path: '/identitypools'})) +/* +{"Count":0,"IdentityPoolUsages":[],"MaxResults":16,"NextToken":null} +... +*/ + +request(aws4.sign({service: 'elastictranscoder', path: '/2012-09-25/pipelines'})) +/* +{"NextPageToken":null,"Pipelines":[]} +... +*/ + +request(aws4.sign({service: 'lambda', path: '/2014-11-13/functions/'})) +/* +{"Functions":[],"NextMarker":null} +... +*/ + +request(aws4.sign({service: 'ecs', path: '/?Action=ListClusters&Version=2014-11-13'})) +/* + +... +*/ + +request(aws4.sign({service: 'glacier', path: '/-/vaults', headers: {'X-Amz-Glacier-Version': '2012-06-01'}})) +/* +{"Marker":null,"VaultList":[]} +... +*/ + +request(aws4.sign({service: 'storagegateway', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'StorageGateway_20120630.ListGateways' +}})) +/* +{"Gateways":[]} +... +*/ + +request(aws4.sign({service: 'datapipeline', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'DataPipeline.ListPipelines' +}})) +/* +{"hasMoreResults":false,"pipelineIdList":[]} +... +*/ + +request(aws4.sign({service: 'opsworks', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'OpsWorks_20130218.DescribeStacks' +}})) +/* +{"Stacks":[]} +... +*/ + +request(aws4.sign({service: 'route53domains', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Route53Domains_v20140515.ListDomains' +}})) +/* +{"Domains":[]} +... +*/ + +request(aws4.sign({service: 'kinesis', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Kinesis_20131202.ListStreams' +}})) +/* +{"HasMoreStreams":false,"StreamNames":[]} +... +*/ + +request(aws4.sign({service: 'cloudtrail', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'CloudTrail_20131101.DescribeTrails' +}})) +/* +{"trailList":[]} +... +*/ + +request(aws4.sign({service: 'logs', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'Logs_20140328.DescribeLogGroups' +}})) +/* +{"logGroups":[]} +... +*/ + +request(aws4.sign({service: 'codedeploy', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'CodeDeploy_20141006.ListApplications' +}})) +/* +{"applications":[]} +... +*/ + +request(aws4.sign({service: 'directconnect', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'OvertureService.DescribeConnections' +}})) +/* +{"connections":[]} +... +*/ + +request(aws4.sign({service: 'kms', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'TrentService.ListKeys' +}})) +/* +{"Keys":[],"Truncated":false} +... +*/ + +request(aws4.sign({service: 'config', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'StarlingDoveService.DescribeDeliveryChannels' +}})) +/* +{"DeliveryChannels":[]} +... +*/ + +request(aws4.sign({service: 'cloudhsm', body: '{}', headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'CloudHsmFrontendService.ListAvailableZones' +}})) +/* +{"AZList":["us-east-1a","us-east-1b","us-east-1c"]} +... +*/ + +request(aws4.sign({ + service: 'swf', + body: '{"registrationStatus":"REGISTERED"}', + headers: { + 'Content-Type': 'application/x-amz-json-1.0', + 'X-Amz-Target': 'SimpleWorkflowService.ListDomains' + } +})) +/* +{"domainInfos":[]} +... +*/ + +request(aws4.sign({ + service: 'cognito-identity', + body: '{"MaxResults": 1}', + headers: { + 'Content-Type': 'application/x-amz-json-1.1', + 'X-Amz-Target': 'AWSCognitoIdentityService.ListIdentityPools' + } +})) +/* +{"IdentityPools":[]} +... +*/ + +request(aws4.sign({ + service: 'mobileanalytics', + path: '/2014-06-05/events', + body: JSON.stringify({events:[{ + eventType: 'a', + timestamp: new Date().toISOString(), + session: {}, + }]}), + headers: { + 'Content-Type': 'application/json', + 'X-Amz-Client-Context': JSON.stringify({ + client: {client_id: 'a', app_title: 'a'}, + custom: {}, + env: {platform: 'a'}, + services: {}, + }), + } +})) +/* +(HTTP 202, empty response) +*/ + +// Still not updated to v4... + +//request(aws4.sign({service: 'importexport', path: '/?Action=ListJobs&Version=2010-06-01'})) + +//request(aws4.sign({service: 'sdb', path: '/?Action=ListDomains&Version=2009-04-15'})) diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.npmignore b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.npmignore new file mode 100644 index 00000000000000..07e6e472cc75fa --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.npmignore @@ -0,0 +1 @@ +/node_modules diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.travis.yml b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.travis.yml new file mode 100644 index 00000000000000..4af02b3d17e64c --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: + - '0.8' + - '0.10' + - '0.12' + - 'iojs' +before_install: + - npm install -g npm@latest diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/CONTRIBUTORS b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/CONTRIBUTORS new file mode 100644 index 00000000000000..4a0bc5033a06e7 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/CONTRIBUTORS @@ -0,0 +1,14 @@ +# Authors, sorted by whether or not they are me +Isaac Z. Schlueter +Brian Cottingham +Carlos Brito Lage +Jesse Dailey +Kevin O'Hara +Marco Rogers +Mark Cavage +Marko Mikulicic +Nathan Rajlich +Satheesh Natesan +Trent Mick +ashleybrener +n4kz diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/LICENSE b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/LICENSE new file mode 100644 index 00000000000000..19129e315fe593 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/README.md b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/README.md new file mode 100644 index 00000000000000..c06814e0414d56 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/README.md @@ -0,0 +1,137 @@ +# lru cache + +A cache object that deletes the least-recently-used items. + +## Usage: + +```javascript +var LRU = require("lru-cache") + , options = { max: 500 + , length: function (n) { return n * 2 } + , dispose: function (key, n) { n.close() } + , maxAge: 1000 * 60 * 60 } + , cache = LRU(options) + , otherCache = LRU(50) // sets just the max size + +cache.set("key", "value") +cache.get("key") // "value" + +cache.reset() // empty the cache +``` + +If you put more stuff in it, then items will fall out. + +If you try to put an oversized thing in it, then it'll fall out right +away. + +## Keys should always be Strings or Numbers + +Note: this module will print warnings to `console.error` if you use a +key that is not a String or Number. Because items are stored in an +object, which coerces keys to a string, it won't go well for you if +you try to use a key that is not a unique string, it'll cause surprise +collisions. For example: + +```JavaScript +// Bad Example! Dont' do this! +var cache = LRU() +var a = {} +var b = {} +cache.set(a, 'this is a') +cache.set(b, 'this is b') +console.log(cache.get(a)) // prints: 'this is b' +``` + +## Options + +* `max` The maximum size of the cache, checked by applying the length + function to all values in the cache. Not setting this is kind of + silly, since that's the whole purpose of this lib, but it defaults + to `Infinity`. +* `maxAge` Maximum age in ms. Items are not pro-actively pruned out + as they age, but if you try to get an item that is too old, it'll + drop it and return undefined instead of giving it to you. +* `length` Function that is used to calculate the length of stored + items. If you're storing strings or buffers, then you probably want + to do something like `function(n){return n.length}`. The default is + `function(n){return 1}`, which is fine if you want to store `max` + like-sized things. +* `dispose` Function that is called on items when they are dropped + from the cache. This can be handy if you want to close file + descriptors or do other cleanup tasks when items are no longer + accessible. Called with `key, value`. It's called *before* + actually removing the item from the internal cache, so if you want + to immediately put it back in, you'll have to do that in a + `nextTick` or `setTimeout` callback or it won't do anything. +* `stale` By default, if you set a `maxAge`, it'll only actually pull + stale items out of the cache when you `get(key)`. (That is, it's + not pre-emptively doing a `setTimeout` or anything.) If you set + `stale:true`, it'll return the stale value before deleting it. If + you don't set this, then it'll return `undefined` when you try to + get a stale entry, as if it had already been deleted. + +## API + +* `set(key, value, maxAge)` +* `get(key) => value` + + Both of these will update the "recently used"-ness of the key. + They do what you think. `max` is optional and overrides the + cache `max` option if provided. + +* `peek(key)` + + Returns the key value (or `undefined` if not found) without + updating the "recently used"-ness of the key. + + (If you find yourself using this a lot, you *might* be using the + wrong sort of data structure, but there are some use cases where + it's handy.) + +* `del(key)` + + Deletes a key out of the cache. + +* `reset()` + + Clear the cache entirely, throwing away all values. + +* `has(key)` + + Check if a key is in the cache, without updating the recent-ness + or deleting it for being stale. + +* `forEach(function(value,key,cache), [thisp])` + + Just like `Array.prototype.forEach`. Iterates over all the keys + in the cache, in order of recent-ness. (Ie, more recently used + items are iterated over first.) + +* `keys()` + + Return an array of the keys in the cache. + +* `values()` + + Return an array of the values in the cache. + +* `length()` + + Return total length of objects in cache taking into account + `length` options function. + +* `itemCount` + + Return total quantity of objects currently in cache. Note, that + `stale` (see options) items are returned as part of this item + count. + +* `dump()` + + Return an array of the cache entries ready for serialization and usage + with 'destinationCache.load(arr)`. + +* `load(cacheEntriesArray)` + + Loads another cache entries array, obtained with `sourceCache.dump()`, + into the cache. The destination cache is reset before loading new entries diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js new file mode 100644 index 00000000000000..2bbe653be8ad08 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js @@ -0,0 +1,334 @@ +;(function () { // closure for web browsers + +if (typeof module === 'object' && module.exports) { + module.exports = LRUCache +} else { + // just set the global for non-node platforms. + this.LRUCache = LRUCache +} + +function hOP (obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key) +} + +function naiveLength () { return 1 } + +var didTypeWarning = false +function typeCheckKey(key) { + if (!didTypeWarning && typeof key !== 'string' && typeof key !== 'number') { + didTypeWarning = true + console.error(new TypeError("LRU: key must be a string or number. Almost certainly a bug! " + typeof key).stack) + } +} + +function LRUCache (options) { + if (!(this instanceof LRUCache)) + return new LRUCache(options) + + if (typeof options === 'number') + options = { max: options } + + if (!options) + options = {} + + this._max = options.max + // Kind of weird to have a default max of Infinity, but oh well. + if (!this._max || !(typeof this._max === "number") || this._max <= 0 ) + this._max = Infinity + + this._lengthCalculator = options.length || naiveLength + if (typeof this._lengthCalculator !== "function") + this._lengthCalculator = naiveLength + + this._allowStale = options.stale || false + this._maxAge = options.maxAge || null + this._dispose = options.dispose + this.reset() +} + +// resize the cache when the max changes. +Object.defineProperty(LRUCache.prototype, "max", + { set : function (mL) { + if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity + this._max = mL + if (this._length > this._max) trim(this) + } + , get : function () { return this._max } + , enumerable : true + }) + +// resize the cache when the lengthCalculator changes. +Object.defineProperty(LRUCache.prototype, "lengthCalculator", + { set : function (lC) { + if (typeof lC !== "function") { + this._lengthCalculator = naiveLength + this._length = this._itemCount + for (var key in this._cache) { + this._cache[key].length = 1 + } + } else { + this._lengthCalculator = lC + this._length = 0 + for (var key in this._cache) { + this._cache[key].length = this._lengthCalculator(this._cache[key].value) + this._length += this._cache[key].length + } + } + + if (this._length > this._max) trim(this) + } + , get : function () { return this._lengthCalculator } + , enumerable : true + }) + +Object.defineProperty(LRUCache.prototype, "length", + { get : function () { return this._length } + , enumerable : true + }) + + +Object.defineProperty(LRUCache.prototype, "itemCount", + { get : function () { return this._itemCount } + , enumerable : true + }) + +LRUCache.prototype.forEach = function (fn, thisp) { + thisp = thisp || this + var i = 0 + var itemCount = this._itemCount + + for (var k = this._mru - 1; k >= 0 && i < itemCount; k--) if (this._lruList[k]) { + i++ + var hit = this._lruList[k] + if (isStale(this, hit)) { + del(this, hit) + if (!this._allowStale) hit = undefined + } + if (hit) { + fn.call(thisp, hit.value, hit.key, this) + } + } +} + +LRUCache.prototype.keys = function () { + var keys = new Array(this._itemCount) + var i = 0 + for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { + var hit = this._lruList[k] + keys[i++] = hit.key + } + return keys +} + +LRUCache.prototype.values = function () { + var values = new Array(this._itemCount) + var i = 0 + for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { + var hit = this._lruList[k] + values[i++] = hit.value + } + return values +} + +LRUCache.prototype.reset = function () { + if (this._dispose && this._cache) { + for (var k in this._cache) { + this._dispose(k, this._cache[k].value) + } + } + + this._cache = Object.create(null) // hash of items by key + this._lruList = Object.create(null) // list of items in order of use recency + this._mru = 0 // most recently used + this._lru = 0 // least recently used + this._length = 0 // number of items in the list + this._itemCount = 0 +} + +LRUCache.prototype.dump = function () { + var arr = [] + var i = 0 + + for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { + var hit = this._lruList[k] + if (!isStale(this, hit)) { + //Do not store staled hits + ++i + arr.push({ + k: hit.key, + v: hit.value, + e: hit.now + (hit.maxAge || 0) + }); + } + } + //arr has the most read first + return arr +} + +LRUCache.prototype.dumpLru = function () { + return this._lruList +} + +LRUCache.prototype.set = function (key, value, maxAge) { + maxAge = maxAge || this._maxAge + typeCheckKey(key) + + var now = maxAge ? Date.now() : 0 + var len = this._lengthCalculator(value) + + if (hOP(this._cache, key)) { + if (len > this._max) { + del(this, this._cache[key]) + return false + } + // dispose of the old one before overwriting + if (this._dispose) + this._dispose(key, this._cache[key].value) + + this._cache[key].now = now + this._cache[key].maxAge = maxAge + this._cache[key].value = value + this._length += (len - this._cache[key].length) + this._cache[key].length = len + this.get(key) + + if (this._length > this._max) + trim(this) + + return true + } + + var hit = new Entry(key, value, this._mru++, len, now, maxAge) + + // oversized objects fall out of cache automatically. + if (hit.length > this._max) { + if (this._dispose) this._dispose(key, value) + return false + } + + this._length += hit.length + this._lruList[hit.lu] = this._cache[key] = hit + this._itemCount ++ + + if (this._length > this._max) + trim(this) + + return true +} + +LRUCache.prototype.has = function (key) { + typeCheckKey(key) + if (!hOP(this._cache, key)) return false + var hit = this._cache[key] + if (isStale(this, hit)) { + return false + } + return true +} + +LRUCache.prototype.get = function (key) { + typeCheckKey(key) + return get(this, key, true) +} + +LRUCache.prototype.peek = function (key) { + typeCheckKey(key) + return get(this, key, false) +} + +LRUCache.prototype.pop = function () { + var hit = this._lruList[this._lru] + del(this, hit) + return hit || null +} + +LRUCache.prototype.del = function (key) { + typeCheckKey(key) + del(this, this._cache[key]) +} + +LRUCache.prototype.load = function (arr) { + //reset the cache + this.reset(); + + var now = Date.now() + //A previous serialized cache has the most recent items first + for (var l = arr.length - 1; l >= 0; l-- ) { + var hit = arr[l] + typeCheckKey(hit.k) + var expiresAt = hit.e || 0 + if (expiresAt === 0) { + //the item was created without expiration in a non aged cache + this.set(hit.k, hit.v) + } else { + var maxAge = expiresAt - now + //dont add already expired items + if (maxAge > 0) this.set(hit.k, hit.v, maxAge) + } + } +} + +function get (self, key, doUse) { + typeCheckKey(key) + var hit = self._cache[key] + if (hit) { + if (isStale(self, hit)) { + del(self, hit) + if (!self._allowStale) hit = undefined + } else { + if (doUse) use(self, hit) + } + if (hit) hit = hit.value + } + return hit +} + +function isStale(self, hit) { + if (!hit || (!hit.maxAge && !self._maxAge)) return false + var stale = false; + var diff = Date.now() - hit.now + if (hit.maxAge) { + stale = diff > hit.maxAge + } else { + stale = self._maxAge && (diff > self._maxAge) + } + return stale; +} + +function use (self, hit) { + shiftLU(self, hit) + hit.lu = self._mru ++ + self._lruList[hit.lu] = hit +} + +function trim (self) { + while (self._lru < self._mru && self._length > self._max) + del(self, self._lruList[self._lru]) +} + +function shiftLU (self, hit) { + delete self._lruList[ hit.lu ] + while (self._lru < self._mru && !self._lruList[self._lru]) self._lru ++ +} + +function del (self, hit) { + if (hit) { + if (self._dispose) self._dispose(hit.key, hit.value) + self._length -= hit.length + self._itemCount -- + delete self._cache[ hit.key ] + shiftLU(self, hit) + } +} + +// classy, since V8 prefers predictable objects. +function Entry (key, value, lu, length, now, maxAge) { + this.key = key + this.value = value + this.lu = lu + this.length = length + this.now = now + if (maxAge) this.maxAge = maxAge +} + +})() diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/package.json b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/package.json new file mode 100644 index 00000000000000..501c3e735fa4d3 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/package.json @@ -0,0 +1,84 @@ +{ + "_args": [ + [ + "lru-cache@^2.6.5", + "/Users/rebecca/code/npm/node_modules/request/node_modules/aws4" + ] + ], + "_from": "lru-cache@>=2.6.5 <3.0.0", + "_id": "lru-cache@2.7.3", + "_inCache": true, + "_installable": true, + "_location": "/request/aws4/lru-cache", + "_nodeVersion": "4.0.0", + "_npmUser": { + "email": "i@izs.me", + "name": "isaacs" + }, + "_npmVersion": "3.3.2", + "_phantomChildren": {}, + "_requested": { + "name": "lru-cache", + "raw": "lru-cache@^2.6.5", + "rawSpec": "^2.6.5", + "scope": null, + "spec": ">=2.6.5 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request/aws4" + ], + "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "_shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952", + "_shrinkwrap": null, + "_spec": "lru-cache@^2.6.5", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/aws4", + "author": { + "email": "i@izs.me", + "name": "Isaac Z. Schlueter" + }, + "bugs": { + "url": "https://github.com/isaacs/node-lru-cache/issues" + }, + "dependencies": {}, + "description": "A cache object that deletes the least-recently-used items.", + "devDependencies": { + "tap": "^1.2.0", + "weak": "" + }, + "directories": {}, + "dist": { + "shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952", + "tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz" + }, + "gitHead": "292048199f6d28b77fbe584279a1898e25e4c714", + "homepage": "https://github.com/isaacs/node-lru-cache#readme", + "keywords": [ + "cache", + "lru", + "mru" + ], + "license": "ISC", + "main": "lib/lru-cache.js", + "maintainers": [ + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + } + ], + "name": "lru-cache", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-lru-cache.git" + }, + "scripts": { + "test": "tap test --gc" + }, + "version": "2.7.3" +} diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/basic.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/basic.js new file mode 100644 index 00000000000000..b47225f109891f --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/basic.js @@ -0,0 +1,396 @@ +var test = require("tap").test + , LRU = require("../") + +test("basic", function (t) { + var cache = new LRU({max: 10}) + cache.set("key", "value") + t.equal(cache.get("key"), "value") + t.equal(cache.get("nada"), undefined) + t.equal(cache.length, 1) + t.equal(cache.max, 10) + t.end() +}) + +test("least recently set", function (t) { + var cache = new LRU(2) + cache.set("a", "A") + cache.set("b", "B") + cache.set("c", "C") + t.equal(cache.get("c"), "C") + t.equal(cache.get("b"), "B") + t.equal(cache.get("a"), undefined) + t.end() +}) + +test("lru recently gotten", function (t) { + var cache = new LRU(2) + cache.set("a", "A") + cache.set("b", "B") + cache.get("a") + cache.set("c", "C") + t.equal(cache.get("c"), "C") + t.equal(cache.get("b"), undefined) + t.equal(cache.get("a"), "A") + t.end() +}) + +test("del", function (t) { + var cache = new LRU(2) + cache.set("a", "A") + cache.del("a") + t.equal(cache.get("a"), undefined) + t.end() +}) + +test("max", function (t) { + var cache = new LRU(3) + + // test changing the max, verify that the LRU items get dropped. + cache.max = 100 + for (var i = 0; i < 100; i ++) cache.set(i, i) + t.equal(cache.length, 100) + for (var i = 0; i < 100; i ++) { + t.equal(cache.get(i), i) + } + cache.max = 3 + t.equal(cache.length, 3) + for (var i = 0; i < 97; i ++) { + t.equal(cache.get(i), undefined) + } + for (var i = 98; i < 100; i ++) { + t.equal(cache.get(i), i) + } + + // now remove the max restriction, and try again. + cache.max = "hello" + for (var i = 0; i < 100; i ++) cache.set(i, i) + t.equal(cache.length, 100) + for (var i = 0; i < 100; i ++) { + t.equal(cache.get(i), i) + } + // should trigger an immediate resize + cache.max = 3 + t.equal(cache.length, 3) + for (var i = 0; i < 97; i ++) { + t.equal(cache.get(i), undefined) + } + for (var i = 98; i < 100; i ++) { + t.equal(cache.get(i), i) + } + t.end() +}) + +test("reset", function (t) { + var cache = new LRU(10) + cache.set("a", "A") + cache.set("b", "B") + cache.reset() + t.equal(cache.length, 0) + t.equal(cache.max, 10) + t.equal(cache.get("a"), undefined) + t.equal(cache.get("b"), undefined) + t.end() +}) + + +test("basic with weighed length", function (t) { + var cache = new LRU({ + max: 100, + length: function (item) { return item.size } + }) + cache.set("key", {val: "value", size: 50}) + t.equal(cache.get("key").val, "value") + t.equal(cache.get("nada"), undefined) + t.equal(cache.lengthCalculator(cache.get("key")), 50) + t.equal(cache.length, 50) + t.equal(cache.max, 100) + t.end() +}) + + +test("weighed length item too large", function (t) { + var cache = new LRU({ + max: 10, + length: function (item) { return item.size } + }) + t.equal(cache.max, 10) + + // should fall out immediately + cache.set("key", {val: "value", size: 50}) + + t.equal(cache.length, 0) + t.equal(cache.get("key"), undefined) + t.end() +}) + +test("least recently set with weighed length", function (t) { + var cache = new LRU({ + max:8, + length: function (item) { return item.length } + }) + cache.set("a", "A") + cache.set("b", "BB") + cache.set("c", "CCC") + cache.set("d", "DDDD") + t.equal(cache.get("d"), "DDDD") + t.equal(cache.get("c"), "CCC") + t.equal(cache.get("b"), undefined) + t.equal(cache.get("a"), undefined) + t.end() +}) + +test("lru recently gotten with weighed length", function (t) { + var cache = new LRU({ + max: 8, + length: function (item) { return item.length } + }) + cache.set("a", "A") + cache.set("b", "BB") + cache.set("c", "CCC") + cache.get("a") + cache.get("b") + cache.set("d", "DDDD") + t.equal(cache.get("c"), undefined) + t.equal(cache.get("d"), "DDDD") + t.equal(cache.get("b"), "BB") + t.equal(cache.get("a"), "A") + t.end() +}) + +test("lru recently updated with weighed length", function (t) { + var cache = new LRU({ + max: 8, + length: function (item) { return item.length } + }) + cache.set("a", "A") + cache.set("b", "BB") + cache.set("c", "CCC") + t.equal(cache.length, 6) //CCC BB A + cache.set("a", "+A") + t.equal(cache.length, 7) //+A CCC BB + cache.set("b", "++BB") + t.equal(cache.length, 6) //++BB +A + t.equal(cache.get("c"), undefined) + + cache.set("c", "oversized") + t.equal(cache.length, 6) //++BB +A + t.equal(cache.get("c"), undefined) + + cache.set("a", "oversized") + t.equal(cache.length, 4) //++BB + t.equal(cache.get("a"), undefined) + t.equal(cache.get("b"), "++BB") + t.end() +}) + +test("set returns proper booleans", function(t) { + var cache = new LRU({ + max: 5, + length: function (item) { return item.length } + }) + + t.equal(cache.set("a", "A"), true) + + // should return false for max exceeded + t.equal(cache.set("b", "donuts"), false) + + t.equal(cache.set("b", "B"), true) + t.equal(cache.set("c", "CCCC"), true) + t.end() +}) + +test("drop the old items", function(t) { + var cache = new LRU({ + max: 5, + maxAge: 50 + }) + + cache.set("a", "A") + + setTimeout(function () { + cache.set("b", "b") + t.equal(cache.get("a"), "A") + }, 25) + + setTimeout(function () { + cache.set("c", "C") + // timed out + t.notOk(cache.get("a")) + }, 60 + 25) + + setTimeout(function () { + t.notOk(cache.get("b")) + t.equal(cache.get("c"), "C") + }, 90) + + setTimeout(function () { + t.notOk(cache.get("c")) + t.end() + }, 155) +}) + +test("individual item can have it's own maxAge", function(t) { + var cache = new LRU({ + max: 5, + maxAge: 50 + }) + + cache.set("a", "A", 20) + setTimeout(function () { + t.notOk(cache.get("a")) + t.end() + }, 25) +}) + +test("individual item can have it's own maxAge > cache's", function(t) { + var cache = new LRU({ + max: 5, + maxAge: 20 + }) + + cache.set("a", "A", 50) + setTimeout(function () { + t.equal(cache.get("a"), "A") + t.end() + }, 25) +}) + +test("disposal function", function(t) { + var disposed = false + var cache = new LRU({ + max: 1, + dispose: function (k, n) { + disposed = n + } + }) + + cache.set(1, 1) + cache.set(2, 2) + t.equal(disposed, 1) + cache.set(3, 3) + t.equal(disposed, 2) + cache.reset() + t.equal(disposed, 3) + t.end() +}) + +test("disposal function on too big of item", function(t) { + var disposed = false + var cache = new LRU({ + max: 1, + length: function (k) { + return k.length + }, + dispose: function (k, n) { + disposed = n + } + }) + var obj = [ 1, 2 ] + + t.equal(disposed, false) + cache.set("obj", obj) + t.equal(disposed, obj) + t.end() +}) + +test("has()", function(t) { + var cache = new LRU({ + max: 1, + maxAge: 10 + }) + + cache.set('foo', 'bar') + t.equal(cache.has('foo'), true) + cache.set('blu', 'baz') + t.equal(cache.has('foo'), false) + t.equal(cache.has('blu'), true) + setTimeout(function() { + t.equal(cache.has('blu'), false) + t.end() + }, 15) +}) + +test("stale", function(t) { + var cache = new LRU({ + maxAge: 10, + stale: true + }) + + cache.set('foo', 'bar') + t.equal(cache.get('foo'), 'bar') + t.equal(cache.has('foo'), true) + setTimeout(function() { + t.equal(cache.has('foo'), false) + t.equal(cache.get('foo'), 'bar') + t.equal(cache.get('foo'), undefined) + t.end() + }, 15) +}) + +test("lru update via set", function(t) { + var cache = LRU({ max: 2 }); + + cache.set('foo', 1); + cache.set('bar', 2); + cache.del('bar'); + cache.set('baz', 3); + cache.set('qux', 4); + + t.equal(cache.get('foo'), undefined) + t.equal(cache.get('bar'), undefined) + t.equal(cache.get('baz'), 3) + t.equal(cache.get('qux'), 4) + t.end() +}) + +test("least recently set w/ peek", function (t) { + var cache = new LRU(2) + cache.set("a", "A") + cache.set("b", "B") + t.equal(cache.peek("a"), "A") + cache.set("c", "C") + t.equal(cache.get("c"), "C") + t.equal(cache.get("b"), "B") + t.equal(cache.get("a"), undefined) + t.end() +}) + +test("pop the least used item", function (t) { + var cache = new LRU(3) + , last + + cache.set("a", "A") + cache.set("b", "B") + cache.set("c", "C") + + t.equal(cache.length, 3) + t.equal(cache.max, 3) + + // Ensure we pop a, c, b + cache.get("b", "B") + + last = cache.pop() + t.equal(last.key, "a") + t.equal(last.value, "A") + t.equal(cache.length, 2) + t.equal(cache.max, 3) + + last = cache.pop() + t.equal(last.key, "c") + t.equal(last.value, "C") + t.equal(cache.length, 1) + t.equal(cache.max, 3) + + last = cache.pop() + t.equal(last.key, "b") + t.equal(last.value, "B") + t.equal(cache.length, 0) + t.equal(cache.max, 3) + + last = cache.pop() + t.equal(last, null) + t.equal(cache.length, 0) + t.equal(cache.max, 3) + + t.end() +}) diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/foreach.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/foreach.js new file mode 100644 index 00000000000000..4190417cbc61d8 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/foreach.js @@ -0,0 +1,120 @@ +var test = require('tap').test +var LRU = require('../') + +test('forEach', function (t) { + var l = new LRU(5) + for (var i = 0; i < 10; i ++) { + l.set(i.toString(), i.toString(2)) + } + + var i = 9 + l.forEach(function (val, key, cache) { + t.equal(cache, l) + t.equal(key, i.toString()) + t.equal(val, i.toString(2)) + i -= 1 + }) + + // get in order of most recently used + l.get(6) + l.get(8) + + var order = [ 8, 6, 9, 7, 5 ] + var i = 0 + + l.forEach(function (val, key, cache) { + var j = order[i ++] + t.equal(cache, l) + t.equal(key, j.toString()) + t.equal(val, j.toString(2)) + }) + t.equal(i, order.length); + + t.end() +}) + +test('keys() and values()', function (t) { + var l = new LRU(5) + for (var i = 0; i < 10; i ++) { + l.set(i.toString(), i.toString(2)) + } + + t.similar(l.keys(), ['9', '8', '7', '6', '5']) + t.similar(l.values(), ['1001', '1000', '111', '110', '101']) + + // get in order of most recently used + l.get(6) + l.get(8) + + t.similar(l.keys(), ['8', '6', '9', '7', '5']) + t.similar(l.values(), ['1000', '110', '1001', '111', '101']) + + t.end() +}) + +test('all entries are iterated over', function(t) { + var l = new LRU(5) + for (var i = 0; i < 10; i ++) { + l.set(i.toString(), i.toString(2)) + } + + var i = 0 + l.forEach(function (val, key, cache) { + if (i > 0) { + cache.del(key) + } + i += 1 + }) + + t.equal(i, 5) + t.equal(l.keys().length, 1) + + t.end() +}) + +test('all stale entries are removed', function(t) { + var l = new LRU({ max: 5, maxAge: -5, stale: true }) + for (var i = 0; i < 10; i ++) { + l.set(i.toString(), i.toString(2)) + } + + var i = 0 + l.forEach(function () { + i += 1 + }) + + t.equal(i, 5) + t.equal(l.keys().length, 0) + + t.end() +}) + +test('expires', function (t) { + var l = new LRU({ + max: 10, + maxAge: 50 + }) + for (var i = 0; i < 10; i++) { + l.set(i.toString(), i.toString(2), ((i % 2) ? 25 : undefined)) + } + + var i = 0 + var order = [ 8, 6, 4, 2, 0 ] + setTimeout(function () { + l.forEach(function (val, key, cache) { + var j = order[i++] + t.equal(cache, l) + t.equal(key, j.toString()) + t.equal(val, j.toString(2)) + }) + t.equal(i, order.length); + + setTimeout(function () { + var count = 0; + l.forEach(function (val, key, cache) { count++; }) + t.equal(0, count); + t.end() + }, 25) + + }, 26) +}) diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/memory-leak.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/memory-leak.js new file mode 100644 index 00000000000000..b5912f6f168e5e --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/memory-leak.js @@ -0,0 +1,51 @@ +#!/usr/bin/env node --expose_gc + + +var weak = require('weak'); +var test = require('tap').test +var LRU = require('../') +var l = new LRU({ max: 10 }) +var refs = 0 +function X() { + refs ++ + weak(this, deref) +} + +function deref() { + refs -- +} + +test('no leaks', function (t) { + // fill up the cache + for (var i = 0; i < 100; i++) { + l.set(i, new X); + // throw some gets in there, too. + if (i % 2 === 0) + l.get(i / 2) + } + + gc() + + var start = process.memoryUsage() + + // capture the memory + var startRefs = refs + + // do it again, but more + for (var i = 0; i < 10000; i++) { + l.set(i, new X); + // throw some gets in there, too. + if (i % 2 === 0) + l.get(i / 2) + } + + gc() + + var end = process.memoryUsage() + t.equal(refs, startRefs, 'no leaky refs') + + console.error('start: %j\n' + + 'end: %j', start, end); + t.pass(); + t.end(); +}) diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/serialize.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/serialize.js new file mode 100644 index 00000000000000..5fe5dc3d371f1e --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/serialize.js @@ -0,0 +1,215 @@ +var test = require('tap').test +var LRU = require('../') + +test('dump', function (t) { + var cache = new LRU() + + t.equal(cache.dump().length, 0, "nothing in dump for empty cache") + + cache.set("a", "A") + cache.set("b", "B") + t.deepEqual(cache.dump(), [ + { k: "b", v: "B", e: 0 }, + { k: "a", v: "A", e: 0 } + ]) + + cache.set("a", "A"); + t.deepEqual(cache.dump(), [ + { k: "a", v: "A", e: 0 }, + { k: "b", v: "B", e: 0 } + ]) + + cache.get("b"); + t.deepEqual(cache.dump(), [ + { k: "b", v: "B", e: 0 }, + { k: "a", v: "A", e: 0 } + ]) + + cache.del("a"); + t.deepEqual(cache.dump(), [ + { k: "b", v: "B", e: 0 } + ]) + + t.end() +}) + +test("do not dump stale items", function(t) { + var cache = new LRU({ + max: 5, + maxAge: 50 + }) + + //expires at 50 + cache.set("a", "A") + + setTimeout(function () { + //expires at 75 + cache.set("b", "B") + var s = cache.dump() + t.equal(s.length, 2) + t.equal(s[0].k, "b") + t.equal(s[1].k, "a") + }, 25) + + setTimeout(function () { + //expires at 110 + cache.set("c", "C") + var s = cache.dump() + t.equal(s.length, 2) + t.equal(s[0].k, "c") + t.equal(s[1].k, "b") + }, 60) + + setTimeout(function () { + //expires at 130 + cache.set("d", "D", 40) + var s = cache.dump() + t.equal(s.length, 2) + t.equal(s[0].k, "d") + t.equal(s[1].k, "c") + }, 90) + + setTimeout(function () { + var s = cache.dump() + t.equal(s.length, 1) + t.equal(s[0].k, "d") + }, 120) + + setTimeout(function () { + var s = cache.dump() + t.deepEqual(s, []) + t.end() + }, 155) +}) + +test("load basic cache", function(t) { + var cache = new LRU(), + copy = new LRU() + + cache.set("a", "A") + cache.set("b", "B") + + copy.load(cache.dump()) + t.deepEquals(cache.dump(), copy.dump()) + + t.end() +}) + + +test("load staled cache", function(t) { + var cache = new LRU({maxAge: 50}), + copy = new LRU({maxAge: 50}), + arr + + //expires at 50 + cache.set("a", "A") + setTimeout(function () { + //expires at 80 + cache.set("b", "B") + arr = cache.dump() + t.equal(arr.length, 2) + }, 30) + + setTimeout(function () { + copy.load(arr) + t.equal(copy.get("a"), undefined) + t.equal(copy.get("b"), "B") + }, 60) + + setTimeout(function () { + t.equal(copy.get("b"), undefined) + t.end() + }, 90) +}) + +test("load to other size cache", function(t) { + var cache = new LRU({max: 2}), + copy = new LRU({max: 1}) + + cache.set("a", "A") + cache.set("b", "B") + + copy.load(cache.dump()) + t.equal(copy.get("a"), undefined) + t.equal(copy.get("b"), "B") + + //update the last read from original cache + cache.get("a") + copy.load(cache.dump()) + t.equal(copy.get("a"), "A") + t.equal(copy.get("b"), undefined) + + t.end() +}) + + +test("load to other age cache", function(t) { + var cache = new LRU({maxAge: 50}), + aged = new LRU({maxAge: 100}), + simple = new LRU(), + arr, + expired + + //created at 0 + //a would be valid till 0 + 50 + cache.set("a", "A") + setTimeout(function () { + //created at 20 + //b would be valid till 20 + 50 + cache.set("b", "B") + //b would be valid till 20 + 70 + cache.set("c", "C", 70) + arr = cache.dump() + t.equal(arr.length, 3) + }, 20) + + setTimeout(function () { + t.equal(cache.get("a"), undefined) + t.equal(cache.get("b"), "B") + t.equal(cache.get("c"), "C") + + aged.load(arr) + t.equal(aged.get("a"), undefined) + t.equal(aged.get("b"), "B") + t.equal(aged.get("c"), "C") + + simple.load(arr) + t.equal(simple.get("a"), undefined) + t.equal(simple.get("b"), "B") + t.equal(simple.get("c"), "C") + }, 60) + + setTimeout(function () { + t.equal(cache.get("a"), undefined) + t.equal(cache.get("b"), undefined) + t.equal(cache.get("c"), "C") + + aged.load(arr) + t.equal(aged.get("a"), undefined) + t.equal(aged.get("b"), undefined) + t.equal(aged.get("c"), "C") + + simple.load(arr) + t.equal(simple.get("a"), undefined) + t.equal(simple.get("b"), undefined) + t.equal(simple.get("c"), "C") + }, 80) + + setTimeout(function () { + t.equal(cache.get("a"), undefined) + t.equal(cache.get("b"), undefined) + t.equal(cache.get("c"), undefined) + + aged.load(arr) + t.equal(aged.get("a"), undefined) + t.equal(aged.get("b"), undefined) + t.equal(aged.get("c"), undefined) + + simple.load(arr) + t.equal(simple.get("a"), undefined) + t.equal(simple.get("b"), undefined) + t.equal(simple.get("c"), undefined) + t.end() + }, 100) + +}) diff --git a/deps/npm/node_modules/request/node_modules/aws4/package.json b/deps/npm/node_modules/request/node_modules/aws4/package.json new file mode 100644 index 00000000000000..31de63b47c1dc4 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/package.json @@ -0,0 +1,130 @@ +{ + "_args": [ + [ + "aws4@^1.2.1", + "/Users/rebecca/code/npm/node_modules/request" + ] + ], + "_from": "aws4@>=1.2.1 <2.0.0", + "_id": "aws4@1.2.1", + "_inCache": true, + "_installable": true, + "_location": "/request/aws4", + "_nodeVersion": "4.2.4", + "_npmUser": { + "email": "michael.hart.au@gmail.com", + "name": "hichaelmart" + }, + "_npmVersion": "2.14.15", + "_phantomChildren": {}, + "_requested": { + "name": "aws4", + "raw": "aws4@^1.2.1", + "rawSpec": "^1.2.1", + "scope": null, + "spec": ">=1.2.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.2.1.tgz", + "_shasum": "52b5659a4d32583d405f65e1124ac436d07fe5ac", + "_shrinkwrap": null, + "_spec": "aws4@^1.2.1", + "_where": "/Users/rebecca/code/npm/node_modules/request", + "author": { + "email": "michael.hart.au@gmail.com", + "name": "Michael Hart", + "url": "http://github.com/mhart" + }, + "bugs": { + "url": "https://github.com/mhart/aws4/issues" + }, + "dependencies": { + "lru-cache": "^2.6.5" + }, + "description": "Signs and prepares requests using AWS Signature Version 4", + "devDependencies": { + "mocha": "^2.2.5", + "should": "^7.0.1" + }, + "directories": {}, + "dist": { + "shasum": "52b5659a4d32583d405f65e1124ac436d07fe5ac", + "tarball": "http://registry.npmjs.org/aws4/-/aws4-1.2.1.tgz" + }, + "gitHead": "3d8a3a06a8415bd5255b4f60eb91576952e97f5c", + "homepage": "https://github.com/mhart/aws4#readme", + "keywords": [ + "amazon", + "appstream", + "autoscaling", + "aws", + "cloudformation", + "cloudfront", + "cloudhsm", + "cloudsearch", + "cloudtrail", + "cloudwatch", + "codedeploy", + "cognito", + "cognitoidentity", + "cognitosync", + "config", + "containerservice", + "datapipeline", + "directconnect", + "dynamodb", + "ec2", + "ecs", + "elasticache", + "elasticbeanstalk", + "elasticloadbalancing", + "elasticmapreduce", + "elastictranscoder", + "elb", + "emr", + "glacier", + "iam", + "keymanagementservice", + "kinesis", + "kms", + "lambda", + "logs", + "mobileanalytics", + "monitoring", + "opsworks", + "rds", + "redshift", + "route53", + "route53domains", + "s3", + "ses", + "signature", + "sns", + "sqs", + "storagegateway", + "sts", + "swf" + ], + "license": "MIT", + "main": "aws4.js", + "maintainers": [ + { + "name": "hichaelmart", + "email": "michael.hart.au@gmail.com" + } + ], + "name": "aws4", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/mhart/aws4.git" + }, + "scripts": { + "test": "mocha ./test/fast.js ./test/slow.js -b -t 100s -R list" + }, + "version": "1.2.1" +} diff --git a/deps/npm/node_modules/request/node_modules/bl/.jshintrc b/deps/npm/node_modules/request/node_modules/bl/.jshintrc new file mode 100644 index 00000000000000..c8ef3ca4097f82 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/bl/.jshintrc @@ -0,0 +1,59 @@ +{ + "predef": [ ] + , "bitwise": false + , "camelcase": false + , "curly": false + , "eqeqeq": false + , "forin": false + , "immed": false + , "latedef": false + , "noarg": true + , "noempty": true + , "nonew": true + , "plusplus": false + , "quotmark": true + , "regexp": false + , "undef": true + , "unused": true + , "strict": false + , "trailing": true + , "maxlen": 120 + , "asi": true + , "boss": true + , "debug": true + , "eqnull": true + , "esnext": true + , "evil": true + , "expr": true + , "funcscope": false + , "globalstrict": false + , "iterator": false + , "lastsemic": true + , "laxbreak": true + , "laxcomma": true + , "loopfunc": true + , "multistr": false + , "onecase": false + , "proto": false + , "regexdash": false + , "scripturl": true + , "smarttabs": false + , "shadow": false + , "sub": true + , "supernew": false + , "validthis": true + , "browser": true + , "couch": false + , "devel": false + , "dojo": false + , "mootools": false + , "node": true + , "nonstandard": true + , "prototypejs": false + , "rhino": false + , "worker": true + , "wsh": false + , "nomen": false + , "onevar": false + , "passfail": false +} \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/bl/.travis.yml b/deps/npm/node_modules/request/node_modules/bl/.travis.yml index 81c0814189c7b9..e431a1bd0c3d34 100644 --- a/deps/npm/node_modules/request/node_modules/bl/.travis.yml +++ b/deps/npm/node_modules/request/node_modules/bl/.travis.yml @@ -1,14 +1,12 @@ +sudo: false language: node_js -before_install: - - curl --location http://git.io/1OcIZA | bash -s node_js: - - 0.8 - - 0.10 - - 0.11 + - '0.10' + - node + - iojs branches: only: - master notifications: email: - rod@vagg.org -script: npm test diff --git a/deps/npm/node_modules/request/node_modules/bl/bl.js b/deps/npm/node_modules/request/node_modules/bl/bl.js index 7a2f99788e628e..b979ba82e434d2 100644 --- a/deps/npm/node_modules/request/node_modules/bl/bl.js +++ b/deps/npm/node_modules/request/node_modules/bl/bl.js @@ -52,6 +52,11 @@ BufferList.prototype.append = function (buf) { var isBuffer = Buffer.isBuffer(buf) || buf instanceof BufferList + // coerce number arguments to strings, since Buffer(number) does + // uninitialized memory allocation + if (typeof buf == 'number') + buf = buf.toString() + this._bufs.push(isBuffer ? buf : new Buffer(buf)) this.length += buf.length return this diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore deleted file mode 100644 index 38344f87a62766..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -build/ -test/ -examples/ -fs.js -zlib.js \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.travis.yml b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.travis.yml deleted file mode 100644 index a2870dfb162343..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.travis.yml +++ /dev/null @@ -1,39 +0,0 @@ -sudo: false -language: node_js -before_install: - - npm install -g npm -notifications: - email: false -matrix: - include: - - node_js: '0.8' - env: TASK=test - - node_js: '0.10' - env: TASK=test - - node_js: '0.11' - env: TASK=test - - node_js: '0.12' - env: TASK=test - - node_js: 'iojs' - env: TASK=test - - node_js: 'iojs' - env: TASK=browser BROWSER_NAME=opera BROWSER_VERSION="11..latest" - - node_js: 'iojs' - env: TASK=browser BROWSER_NAME=ie BROWSER_VERSION="9..latest" - - node_js: 'iojs' - env: TASK=browser BROWSER_NAME=chrome BROWSER_VERSION="39..beta" - - node_js: 'iojs' - env: TASK=browser BROWSER_NAME=firefox BROWSER_VERSION="34..beta" - - node_js: 'iojs' - env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="6.0..latest" - - node_js: 'iojs' - env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="6.0..latest" - - node_js: 'iojs' - env: TASK=browser BROWSER_NAME=safari BROWSER_VERSION="5..latest" - - node_js: 'iojs' - env: TASK=browser BROWSER_NAME=android BROWSER_VERSION="4.0..latest" -script: "npm run $TASK" -env: - global: - - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= - - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md deleted file mode 100644 index 77fafa3da15f9f..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# readable-stream - -***Node-core streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) - - -[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) -[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) - - -[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) - -```bash -npm install --save readable-stream -``` - -***Node-core streams for userland*** - -This package is a mirror of the Streams2 and Streams3 implementations in -Node-core, including [documentation](doc/stream.markdown). - -If you want to guarantee a stable streams base, regardless of what version of -Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). - -As of version 2.0.0 **readable-stream** uses semantic versioning. - -# Streams WG Team Members - -* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> - - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B -* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> - - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 -* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> - - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D -* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> -* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> -* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/stream.markdown b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/stream.markdown deleted file mode 100644 index a2270c88057950..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/stream.markdown +++ /dev/null @@ -1,1651 +0,0 @@ -# Stream - - Stability: 2 - Stable - -A stream is an abstract interface implemented by various objects in -io.js. For example a [request to an HTTP -server](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_http_incomingmessage) is a stream, as is -[stdout][]. Streams are readable, writable, or both. All streams are -instances of [EventEmitter][] - -You can load the Stream base classes by doing `require('stream')`. -There are base classes provided for [Readable][] streams, [Writable][] -streams, [Duplex][] streams, and [Transform][] streams. - -This document is split up into 3 sections. The first explains the -parts of the API that you need to be aware of to use streams in your -programs. If you never implement a streaming API yourself, you can -stop there. - -The second section explains the parts of the API that you need to use -if you implement your own custom streams yourself. The API is -designed to make this easy for you to do. - -The third section goes into more depth about how streams work, -including some of the internal mechanisms and functions that you -should probably not modify unless you definitely know what you are -doing. - - -## API for Stream Consumers - - - -Streams can be either [Readable][], [Writable][], or both ([Duplex][]). - -All streams are EventEmitters, but they also have other custom methods -and properties depending on whether they are Readable, Writable, or -Duplex. - -If a stream is both Readable and Writable, then it implements all of -the methods and events below. So, a [Duplex][] or [Transform][] stream is -fully described by this API, though their implementation may be -somewhat different. - -It is not necessary to implement Stream interfaces in order to consume -streams in your programs. If you **are** implementing streaming -interfaces in your own program, please also refer to -[API for Stream Implementors][] below. - -Almost all io.js programs, no matter how simple, use Streams in some -way. Here is an example of using Streams in an io.js program: - -```javascript -var http = require('http'); - -var server = http.createServer(function (req, res) { - // req is an http.IncomingMessage, which is a Readable Stream - // res is an http.ServerResponse, which is a Writable Stream - - var body = ''; - // we want to get the data as utf8 strings - // If you don't set an encoding, then you'll get Buffer objects - req.setEncoding('utf8'); - - // Readable streams emit 'data' events once a listener is added - req.on('data', function (chunk) { - body += chunk; - }); - - // the end event tells you that you have entire body - req.on('end', function () { - try { - var data = JSON.parse(body); - } catch (er) { - // uh oh! bad json! - res.statusCode = 400; - return res.end('error: ' + er.message); - } - - // write back something interesting to the user: - res.write(typeof data); - res.end(); - }); -}); - -server.listen(1337); - -// $ curl localhost:1337 -d '{}' -// object -// $ curl localhost:1337 -d '"foo"' -// string -// $ curl localhost:1337 -d 'not json' -// error: Unexpected token o -``` - -### Class: stream.Readable - - - -The Readable stream interface is the abstraction for a *source* of -data that you are reading from. In other words, data comes *out* of a -Readable stream. - -A Readable stream will not start emitting data until you indicate that -you are ready to receive it. - -Readable streams have two "modes": a **flowing mode** and a **paused -mode**. When in flowing mode, data is read from the underlying system -and provided to your program as fast as possible. In paused mode, you -must explicitly call `stream.read()` to get chunks of data out. -Streams start out in paused mode. - -**Note**: If no data event handlers are attached, and there are no -[`pipe()`][] destinations, and the stream is switched into flowing -mode, then data will be lost. - -You can switch to flowing mode by doing any of the following: - -* Adding a [`'data'` event][] handler to listen for data. -* Calling the [`resume()`][] method to explicitly open the flow. -* Calling the [`pipe()`][] method to send the data to a [Writable][]. - -You can switch back to paused mode by doing either of the following: - -* If there are no pipe destinations, by calling the [`pause()`][] - method. -* If there are pipe destinations, by removing any [`'data'` event][] - handlers, and removing all pipe destinations by calling the - [`unpipe()`][] method. - -Note that, for backwards compatibility reasons, removing `'data'` -event handlers will **not** automatically pause the stream. Also, if -there are piped destinations, then calling `pause()` will not -guarantee that the stream will *remain* paused once those -destinations drain and ask for more data. - -Examples of readable streams include: - -* [http responses, on the client](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_http_incomingmessage) -* [http requests, on the server](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_http_incomingmessage) -* [fs read streams](https://iojs.org/dist/v2.3.0/doc/api/fs.html#fs_class_fs_readstream) -* [zlib streams][] -* [crypto streams][] -* [tcp sockets][] -* [child process stdout and stderr][] -* [process.stdin][] - -#### Event: 'readable' - -When a chunk of data can be read from the stream, it will emit a -`'readable'` event. - -In some cases, listening for a `'readable'` event will cause some data -to be read into the internal buffer from the underlying system, if it -hadn't already. - -```javascript -var readable = getReadableStreamSomehow(); -readable.on('readable', function() { - // there is some data to read now -}); -``` - -Once the internal buffer is drained, a `readable` event will fire -again when more data is available. - -#### Event: 'data' - -* `chunk` {Buffer | String} The chunk of data. - -Attaching a `data` event listener to a stream that has not been -explicitly paused will switch the stream into flowing mode. Data will -then be passed as soon as it is available. - -If you just want to get all the data out of the stream as fast as -possible, this is the best way to do so. - -```javascript -var readable = getReadableStreamSomehow(); -readable.on('data', function(chunk) { - console.log('got %d bytes of data', chunk.length); -}); -``` - -#### Event: 'end' - -This event fires when there will be no more data to read. - -Note that the `end` event **will not fire** unless the data is -completely consumed. This can be done by switching into flowing mode, -or by calling `read()` repeatedly until you get to the end. - -```javascript -var readable = getReadableStreamSomehow(); -readable.on('data', function(chunk) { - console.log('got %d bytes of data', chunk.length); -}); -readable.on('end', function() { - console.log('there will be no more data.'); -}); -``` - -#### Event: 'close' - -Emitted when the underlying resource (for example, the backing file -descriptor) has been closed. Not all streams will emit this. - -#### Event: 'error' - -* {Error Object} - -Emitted if there was an error receiving data. - -#### readable.read([size]) - -* `size` {Number} Optional argument to specify how much data to read. -* Return {String | Buffer | null} - -The `read()` method pulls some data out of the internal buffer and -returns it. If there is no data available, then it will return -`null`. - -If you pass in a `size` argument, then it will return that many -bytes. If `size` bytes are not available, then it will return `null`. - -If you do not specify a `size` argument, then it will return all the -data in the internal buffer. - -This method should only be called in paused mode. In flowing mode, -this method is called automatically until the internal buffer is -drained. - -```javascript -var readable = getReadableStreamSomehow(); -readable.on('readable', function() { - var chunk; - while (null !== (chunk = readable.read())) { - console.log('got %d bytes of data', chunk.length); - } -}); -``` - -If this method returns a data chunk, then it will also trigger the -emission of a [`'data'` event][]. - -#### readable.setEncoding(encoding) - -* `encoding` {String} The encoding to use. -* Return: `this` - -Call this function to cause the stream to return strings of the -specified encoding instead of Buffer objects. For example, if you do -`readable.setEncoding('utf8')`, then the output data will be -interpreted as UTF-8 data, and returned as strings. If you do -`readable.setEncoding('hex')`, then the data will be encoded in -hexadecimal string format. - -This properly handles multi-byte characters that would otherwise be -potentially mangled if you simply pulled the Buffers directly and -called `buf.toString(encoding)` on them. If you want to read the data -as strings, always use this method. - -```javascript -var readable = getReadableStreamSomehow(); -readable.setEncoding('utf8'); -readable.on('data', function(chunk) { - assert.equal(typeof chunk, 'string'); - console.log('got %d characters of string data', chunk.length); -}); -``` - -#### readable.resume() - -* Return: `this` - -This method will cause the readable stream to resume emitting `data` -events. - -This method will switch the stream into flowing mode. If you do *not* -want to consume the data from a stream, but you *do* want to get to -its `end` event, you can call [`readable.resume()`][] to open the flow of -data. - -```javascript -var readable = getReadableStreamSomehow(); -readable.resume(); -readable.on('end', function() { - console.log('got to the end, but did not read anything'); -}); -``` - -#### readable.pause() - -* Return: `this` - -This method will cause a stream in flowing mode to stop emitting -`data` events, switching out of flowing mode. Any data that becomes -available will remain in the internal buffer. - -```javascript -var readable = getReadableStreamSomehow(); -readable.on('data', function(chunk) { - console.log('got %d bytes of data', chunk.length); - readable.pause(); - console.log('there will be no more data for 1 second'); - setTimeout(function() { - console.log('now data will start flowing again'); - readable.resume(); - }, 1000); -}); -``` - -#### readable.isPaused() - -* Return: `Boolean` - -This method returns whether or not the `readable` has been **explicitly** -paused by client code (using `readable.pause()` without a corresponding -`readable.resume()`). - -```javascript -var readable = new stream.Readable - -readable.isPaused() // === false -readable.pause() -readable.isPaused() // === true -readable.resume() -readable.isPaused() // === false -``` - -#### readable.pipe(destination[, options]) - -* `destination` {[Writable][] Stream} The destination for writing data -* `options` {Object} Pipe options - * `end` {Boolean} End the writer when the reader ends. Default = `true` - -This method pulls all the data out of a readable stream, and writes it -to the supplied destination, automatically managing the flow so that -the destination is not overwhelmed by a fast readable stream. - -Multiple destinations can be piped to safely. - -```javascript -var readable = getReadableStreamSomehow(); -var writable = fs.createWriteStream('file.txt'); -// All the data from readable goes into 'file.txt' -readable.pipe(writable); -``` - -This function returns the destination stream, so you can set up pipe -chains like so: - -```javascript -var r = fs.createReadStream('file.txt'); -var z = zlib.createGzip(); -var w = fs.createWriteStream('file.txt.gz'); -r.pipe(z).pipe(w); -``` - -For example, emulating the Unix `cat` command: - -```javascript -process.stdin.pipe(process.stdout); -``` - -By default [`end()`][] is called on the destination when the source stream -emits `end`, so that `destination` is no longer writable. Pass `{ end: -false }` as `options` to keep the destination stream open. - -This keeps `writer` open so that "Goodbye" can be written at the -end. - -```javascript -reader.pipe(writer, { end: false }); -reader.on('end', function() { - writer.end('Goodbye\n'); -}); -``` - -Note that `process.stderr` and `process.stdout` are never closed until -the process exits, regardless of the specified options. - -#### readable.unpipe([destination]) - -* `destination` {[Writable][] Stream} Optional specific stream to unpipe - -This method will remove the hooks set up for a previous `pipe()` call. - -If the destination is not specified, then all pipes are removed. - -If the destination is specified, but no pipe is set up for it, then -this is a no-op. - -```javascript -var readable = getReadableStreamSomehow(); -var writable = fs.createWriteStream('file.txt'); -// All the data from readable goes into 'file.txt', -// but only for the first second -readable.pipe(writable); -setTimeout(function() { - console.log('stop writing to file.txt'); - readable.unpipe(writable); - console.log('manually close the file stream'); - writable.end(); -}, 1000); -``` - -#### readable.unshift(chunk) - -* `chunk` {Buffer | String} Chunk of data to unshift onto the read queue - -This is useful in certain cases where a stream is being consumed by a -parser, which needs to "un-consume" some data that it has -optimistically pulled out of the source, so that the stream can be -passed on to some other party. - -If you find that you must often call `stream.unshift(chunk)` in your -programs, consider implementing a [Transform][] stream instead. (See API -for Stream Implementors, below.) - -```javascript -// Pull off a header delimited by \n\n -// use unshift() if we get too much -// Call the callback with (error, header, stream) -var StringDecoder = require('string_decoder').StringDecoder; -function parseHeader(stream, callback) { - stream.on('error', callback); - stream.on('readable', onReadable); - var decoder = new StringDecoder('utf8'); - var header = ''; - function onReadable() { - var chunk; - while (null !== (chunk = stream.read())) { - var str = decoder.write(chunk); - if (str.match(/\n\n/)) { - // found the header boundary - var split = str.split(/\n\n/); - header += split.shift(); - var remaining = split.join('\n\n'); - var buf = new Buffer(remaining, 'utf8'); - if (buf.length) - stream.unshift(buf); - stream.removeListener('error', callback); - stream.removeListener('readable', onReadable); - // now the body of the message can be read from the stream. - callback(null, header, stream); - } else { - // still reading the header. - header += str; - } - } - } -} -``` - -#### readable.wrap(stream) - -* `stream` {Stream} An "old style" readable stream - -Versions of Node.js prior to v0.10 had streams that did not implement the -entire Streams API as it is today. (See "Compatibility" below for -more information.) - -If you are using an older io.js library that emits `'data'` events and -has a [`pause()`][] method that is advisory only, then you can use the -`wrap()` method to create a [Readable][] stream that uses the old stream -as its data source. - -You will very rarely ever need to call this function, but it exists -as a convenience for interacting with old io.js programs and libraries. - -For example: - -```javascript -var OldReader = require('./old-api-module.js').OldReader; -var oreader = new OldReader; -var Readable = require('stream').Readable; -var myReader = new Readable().wrap(oreader); - -myReader.on('readable', function() { - myReader.read(); // etc. -}); -``` - - -### Class: stream.Writable - - - -The Writable stream interface is an abstraction for a *destination* -that you are writing data *to*. - -Examples of writable streams include: - -* [http requests, on the client](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_class_http_clientrequest) -* [http responses, on the server](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_class_http_serverresponse) -* [fs write streams](https://iojs.org/dist/v2.3.0/doc/api/fs.html#fs_class_fs_writestream) -* [zlib streams][] -* [crypto streams][] -* [tcp sockets][] -* [child process stdin](https://iojs.org/dist/v2.3.0/doc/api/child_process.html#child_process_child_stdin) -* [process.stdout][], [process.stderr][] - -#### writable.write(chunk[, encoding][, callback]) - -* `chunk` {String | Buffer} The data to write -* `encoding` {String} The encoding, if `chunk` is a String -* `callback` {Function} Callback for when this chunk of data is flushed -* Returns: {Boolean} True if the data was handled completely. - -This method writes some data to the underlying system, and calls the -supplied callback once the data has been fully handled. - -The return value indicates if you should continue writing right now. -If the data had to be buffered internally, then it will return -`false`. Otherwise, it will return `true`. - -This return value is strictly advisory. You MAY continue to write, -even if it returns `false`. However, writes will be buffered in -memory, so it is best not to do this excessively. Instead, wait for -the `drain` event before writing more data. - -#### Event: 'drain' - -If a [`writable.write(chunk)`][] call returns false, then the `drain` -event will indicate when it is appropriate to begin writing more data -to the stream. - -```javascript -// Write the data to the supplied writable stream 1MM times. -// Be attentive to back-pressure. -function writeOneMillionTimes(writer, data, encoding, callback) { - var i = 1000000; - write(); - function write() { - var ok = true; - do { - i -= 1; - if (i === 0) { - // last time! - writer.write(data, encoding, callback); - } else { - // see if we should continue, or wait - // don't pass the callback, because we're not done yet. - ok = writer.write(data, encoding); - } - } while (i > 0 && ok); - if (i > 0) { - // had to stop early! - // write some more once it drains - writer.once('drain', write); - } - } -} -``` - -#### writable.cork() - -Forces buffering of all writes. - -Buffered data will be flushed either at `.uncork()` or at `.end()` call. - -#### writable.uncork() - -Flush all data, buffered since `.cork()` call. - -#### writable.setDefaultEncoding(encoding) - -* `encoding` {String} The new default encoding - -Sets the default encoding for a writable stream. - -#### writable.end([chunk][, encoding][, callback]) - -* `chunk` {String | Buffer} Optional data to write -* `encoding` {String} The encoding, if `chunk` is a String -* `callback` {Function} Optional callback for when the stream is finished - -Call this method when no more data will be written to the stream. If -supplied, the callback is attached as a listener on the `finish` event. - -Calling [`write()`][] after calling [`end()`][] will raise an error. - -```javascript -// write 'hello, ' and then end with 'world!' -var file = fs.createWriteStream('example.txt'); -file.write('hello, '); -file.end('world!'); -// writing more now is not allowed! -``` - -#### Event: 'finish' - -When the [`end()`][] method has been called, and all data has been flushed -to the underlying system, this event is emitted. - -```javascript -var writer = getWritableStreamSomehow(); -for (var i = 0; i < 100; i ++) { - writer.write('hello, #' + i + '!\n'); -} -writer.end('this is the end\n'); -writer.on('finish', function() { - console.error('all writes are now complete.'); -}); -``` - -#### Event: 'pipe' - -* `src` {[Readable][] Stream} source stream that is piping to this writable - -This is emitted whenever the `pipe()` method is called on a readable -stream, adding this writable to its set of destinations. - -```javascript -var writer = getWritableStreamSomehow(); -var reader = getReadableStreamSomehow(); -writer.on('pipe', function(src) { - console.error('something is piping into the writer'); - assert.equal(src, reader); -}); -reader.pipe(writer); -``` - -#### Event: 'unpipe' - -* `src` {[Readable][] Stream} The source stream that [unpiped][] this writable - -This is emitted whenever the [`unpipe()`][] method is called on a -readable stream, removing this writable from its set of destinations. - -```javascript -var writer = getWritableStreamSomehow(); -var reader = getReadableStreamSomehow(); -writer.on('unpipe', function(src) { - console.error('something has stopped piping into the writer'); - assert.equal(src, reader); -}); -reader.pipe(writer); -reader.unpipe(writer); -``` - -#### Event: 'error' - -* {Error object} - -Emitted if there was an error when writing or piping data. - -### Class: stream.Duplex - -Duplex streams are streams that implement both the [Readable][] and -[Writable][] interfaces. See above for usage. - -Examples of Duplex streams include: - -* [tcp sockets][] -* [zlib streams][] -* [crypto streams][] - - -### Class: stream.Transform - -Transform streams are [Duplex][] streams where the output is in some way -computed from the input. They implement both the [Readable][] and -[Writable][] interfaces. See above for usage. - -Examples of Transform streams include: - -* [zlib streams][] -* [crypto streams][] - - -## API for Stream Implementors - - - -To implement any sort of stream, the pattern is the same: - -1. Extend the appropriate parent class in your own subclass. (The - [`util.inherits`][] method is particularly helpful for this.) -2. Call the appropriate parent class constructor in your constructor, - to be sure that the internal mechanisms are set up properly. -2. Implement one or more specific methods, as detailed below. - -The class to extend and the method(s) to implement depend on the sort -of stream class you are writing: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      -

      Use-case

      -
      -

      Class

      -
      -

      Method(s) to implement

      -
      -

      Reading only

      -
      -

      [Readable](#stream_class_stream_readable_1)

      -
      -

      [_read][]

      -
      -

      Writing only

      -
      -

      [Writable](#stream_class_stream_writable_1)

      -
      -

      [_write][], _writev

      -
      -

      Reading and writing

      -
      -

      [Duplex](#stream_class_stream_duplex_1)

      -
      -

      [_read][], [_write][], _writev

      -
      -

      Operate on written data, then read the result

      -
      -

      [Transform](#stream_class_stream_transform_1)

      -
      -

      _transform, _flush

      -
      - -In your implementation code, it is very important to never call the -methods described in [API for Stream Consumers][] above. Otherwise, you -can potentially cause adverse side effects in programs that consume -your streaming interfaces. - -### Class: stream.Readable - - - -`stream.Readable` is an abstract class designed to be extended with an -underlying implementation of the [`_read(size)`][] method. - -Please see above under [API for Stream Consumers][] for how to consume -streams in your programs. What follows is an explanation of how to -implement Readable streams in your programs. - -#### Example: A Counting Stream - - - -This is a basic example of a Readable stream. It emits the numerals -from 1 to 1,000,000 in ascending order, and then ends. - -```javascript -var Readable = require('stream').Readable; -var util = require('util'); -util.inherits(Counter, Readable); - -function Counter(opt) { - Readable.call(this, opt); - this._max = 1000000; - this._index = 1; -} - -Counter.prototype._read = function() { - var i = this._index++; - if (i > this._max) - this.push(null); - else { - var str = '' + i; - var buf = new Buffer(str, 'ascii'); - this.push(buf); - } -}; -``` - -#### Example: SimpleProtocol v1 (Sub-optimal) - -This is similar to the `parseHeader` function described above, but -implemented as a custom stream. Also, note that this implementation -does not convert the incoming data to a string. - -However, this would be better implemented as a [Transform][] stream. See -below for a better implementation. - -```javascript -// A parser for a simple data protocol. -// The "header" is a JSON object, followed by 2 \n characters, and -// then a message body. -// -// NOTE: This can be done more simply as a Transform stream! -// Using Readable directly for this is sub-optimal. See the -// alternative example below under the Transform section. - -var Readable = require('stream').Readable; -var util = require('util'); - -util.inherits(SimpleProtocol, Readable); - -function SimpleProtocol(source, options) { - if (!(this instanceof SimpleProtocol)) - return new SimpleProtocol(source, options); - - Readable.call(this, options); - this._inBody = false; - this._sawFirstCr = false; - - // source is a readable stream, such as a socket or file - this._source = source; - - var self = this; - source.on('end', function() { - self.push(null); - }); - - // give it a kick whenever the source is readable - // read(0) will not consume any bytes - source.on('readable', function() { - self.read(0); - }); - - this._rawHeader = []; - this.header = null; -} - -SimpleProtocol.prototype._read = function(n) { - if (!this._inBody) { - var chunk = this._source.read(); - - // if the source doesn't have data, we don't have data yet. - if (chunk === null) - return this.push(''); - - // check if the chunk has a \n\n - var split = -1; - for (var i = 0; i < chunk.length; i++) { - if (chunk[i] === 10) { // '\n' - if (this._sawFirstCr) { - split = i; - break; - } else { - this._sawFirstCr = true; - } - } else { - this._sawFirstCr = false; - } - } - - if (split === -1) { - // still waiting for the \n\n - // stash the chunk, and try again. - this._rawHeader.push(chunk); - this.push(''); - } else { - this._inBody = true; - var h = chunk.slice(0, split); - this._rawHeader.push(h); - var header = Buffer.concat(this._rawHeader).toString(); - try { - this.header = JSON.parse(header); - } catch (er) { - this.emit('error', new Error('invalid simple protocol data')); - return; - } - // now, because we got some extra data, unshift the rest - // back into the read queue so that our consumer will see it. - var b = chunk.slice(split); - this.unshift(b); - - // and let them know that we are done parsing the header. - this.emit('header', this.header); - } - } else { - // from there on, just provide the data to our consumer. - // careful not to push(null), since that would indicate EOF. - var chunk = this._source.read(); - if (chunk) this.push(chunk); - } -}; - -// Usage: -// var parser = new SimpleProtocol(source); -// Now parser is a readable stream that will emit 'header' -// with the parsed header data. -``` - - -#### new stream.Readable([options]) - -* `options` {Object} - * `highWaterMark` {Number} The maximum number of bytes to store in - the internal buffer before ceasing to read from the underlying - resource. Default=16kb, or 16 for `objectMode` streams - * `encoding` {String} If specified, then buffers will be decoded to - strings using the specified encoding. Default=null - * `objectMode` {Boolean} Whether this stream should behave - as a stream of objects. Meaning that stream.read(n) returns - a single value instead of a Buffer of size n. Default=false - -In classes that extend the Readable class, make sure to call the -Readable constructor so that the buffering settings can be properly -initialized. - -#### readable.\_read(size) - -* `size` {Number} Number of bytes to read asynchronously - -Note: **Implement this function, but do NOT call it directly.** - -This function should NOT be called directly. It should be implemented -by child classes, and only called by the internal Readable class -methods. - -All Readable stream implementations must provide a `_read` method to -fetch data from the underlying resource. - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -When data is available, put it into the read queue by calling -`readable.push(chunk)`. If `push` returns false, then you should stop -reading. When `_read` is called again, you should start pushing more -data. - -The `size` argument is advisory. Implementations where a "read" is a -single call that returns data can use this to know how much data to -fetch. Implementations where that is not relevant, such as TCP or -TLS, may ignore this argument, and simply provide data whenever it -becomes available. There is no need, for example to "wait" until -`size` bytes are available before calling [`stream.push(chunk)`][]. - -#### readable.push(chunk[, encoding]) - -* `chunk` {Buffer | null | String} Chunk of data to push into the read queue -* `encoding` {String} Encoding of String chunks. Must be a valid - Buffer encoding, such as `'utf8'` or `'ascii'` -* return {Boolean} Whether or not more pushes should be performed - -Note: **This function should be called by Readable implementors, NOT -by consumers of Readable streams.** - -The `_read()` function will not be called again until at least one -`push(chunk)` call is made. - -The `Readable` class works by putting data into a read queue to be -pulled out later by calling the `read()` method when the `'readable'` -event fires. - -The `push()` method will explicitly insert some data into the read -queue. If it is called with `null` then it will signal the end of the -data (EOF). - -This API is designed to be as flexible as possible. For example, -you may be wrapping a lower-level source which has some sort of -pause/resume mechanism, and a data callback. In those cases, you -could wrap the low-level source object by doing something like this: - -```javascript -// source is an object with readStop() and readStart() methods, -// and an `ondata` member that gets called when it has data, and -// an `onend` member that gets called when the data is over. - -util.inherits(SourceWrapper, Readable); - -function SourceWrapper(options) { - Readable.call(this, options); - - this._source = getLowlevelSourceObject(); - var self = this; - - // Every time there's data, we push it into the internal buffer. - this._source.ondata = function(chunk) { - // if push() returns false, then we need to stop reading from source - if (!self.push(chunk)) - self._source.readStop(); - }; - - // When the source ends, we push the EOF-signaling `null` chunk - this._source.onend = function() { - self.push(null); - }; -} - -// _read will be called when the stream wants to pull more data in -// the advisory size argument is ignored in this case. -SourceWrapper.prototype._read = function(size) { - this._source.readStart(); -}; -``` - - -### Class: stream.Writable - - - -`stream.Writable` is an abstract class designed to be extended with an -underlying implementation of the [`_write(chunk, encoding, callback)`][] method. - -Please see above under [API for Stream Consumers][] for how to consume -writable streams in your programs. What follows is an explanation of -how to implement Writable streams in your programs. - -#### new stream.Writable([options]) - -* `options` {Object} - * `highWaterMark` {Number} Buffer level when [`write()`][] starts - returning false. Default=16kb, or 16 for `objectMode` streams - * `decodeStrings` {Boolean} Whether or not to decode strings into - Buffers before passing them to [`_write()`][]. Default=true - * `objectMode` {Boolean} Whether or not the `write(anyObj)` is - a valid operation. If set you can write arbitrary data instead - of only `Buffer` / `String` data. Default=false - -In classes that extend the Writable class, make sure to call the -constructor so that the buffering settings can be properly -initialized. - -#### writable.\_write(chunk, encoding, callback) - -* `chunk` {Buffer | String} The chunk to be written. Will **always** - be a buffer unless the `decodeStrings` option was set to `false`. -* `encoding` {String} If the chunk is a string, then this is the - encoding type. If chunk is a buffer, then this is the special - value - 'buffer', ignore it in this case. -* `callback` {Function} Call this function (optionally with an error - argument) when you are done processing the supplied chunk. - -All Writable stream implementations must provide a [`_write()`][] -method to send data to the underlying resource. - -Note: **This function MUST NOT be called directly.** It should be -implemented by child classes, and called by the internal Writable -class methods only. - -Call the callback using the standard `callback(error)` pattern to -signal that the write completed successfully or with an error. - -If the `decodeStrings` flag is set in the constructor options, then -`chunk` may be a string rather than a Buffer, and `encoding` will -indicate the sort of string that it is. This is to support -implementations that have an optimized handling for certain string -data encodings. If you do not explicitly set the `decodeStrings` -option to `false`, then you can safely ignore the `encoding` argument, -and assume that `chunk` will always be a Buffer. - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -#### writable.\_writev(chunks, callback) - -* `chunks` {Array} The chunks to be written. Each chunk has following - format: `{ chunk: ..., encoding: ... }`. -* `callback` {Function} Call this function (optionally with an error - argument) when you are done processing the supplied chunks. - -Note: **This function MUST NOT be called directly.** It may be -implemented by child classes, and called by the internal Writable -class methods only. - -This function is completely optional to implement. In most cases it is -unnecessary. If implemented, it will be called with all the chunks -that are buffered in the write queue. - - -### Class: stream.Duplex - - - -A "duplex" stream is one that is both Readable and Writable, such as a -TCP socket connection. - -Note that `stream.Duplex` is an abstract class designed to be extended -with an underlying implementation of the `_read(size)` and -[`_write(chunk, encoding, callback)`][] methods as you would with a -Readable or Writable stream class. - -Since JavaScript doesn't have multiple prototypal inheritance, this -class prototypally inherits from Readable, and then parasitically from -Writable. It is thus up to the user to implement both the lowlevel -`_read(n)` method as well as the lowlevel -[`_write(chunk, encoding, callback)`][] method on extension duplex classes. - -#### new stream.Duplex(options) - -* `options` {Object} Passed to both Writable and Readable - constructors. Also has the following fields: - * `allowHalfOpen` {Boolean} Default=true. If set to `false`, then - the stream will automatically end the readable side when the - writable side ends and vice versa. - * `readableObjectMode` {Boolean} Default=false. Sets `objectMode` - for readable side of the stream. Has no effect if `objectMode` - is `true`. - * `writableObjectMode` {Boolean} Default=false. Sets `objectMode` - for writable side of the stream. Has no effect if `objectMode` - is `true`. - -In classes that extend the Duplex class, make sure to call the -constructor so that the buffering settings can be properly -initialized. - - -### Class: stream.Transform - -A "transform" stream is a duplex stream where the output is causally -connected in some way to the input, such as a [zlib][] stream or a -[crypto][] stream. - -There is no requirement that the output be the same size as the input, -the same number of chunks, or arrive at the same time. For example, a -Hash stream will only ever have a single chunk of output which is -provided when the input is ended. A zlib stream will produce output -that is either much smaller or much larger than its input. - -Rather than implement the [`_read()`][] and [`_write()`][] methods, Transform -classes must implement the `_transform()` method, and may optionally -also implement the `_flush()` method. (See below.) - -#### new stream.Transform([options]) - -* `options` {Object} Passed to both Writable and Readable - constructors. - -In classes that extend the Transform class, make sure to call the -constructor so that the buffering settings can be properly -initialized. - -#### transform.\_transform(chunk, encoding, callback) - -* `chunk` {Buffer | String} The chunk to be transformed. Will **always** - be a buffer unless the `decodeStrings` option was set to `false`. -* `encoding` {String} If the chunk is a string, then this is the - encoding type. If chunk is a buffer, then this is the special - value - 'buffer', ignore it in this case. -* `callback` {Function} Call this function (optionally with an error - argument and data) when you are done processing the supplied chunk. - -Note: **This function MUST NOT be called directly.** It should be -implemented by child classes, and called by the internal Transform -class methods only. - -All Transform stream implementations must provide a `_transform` -method to accept input and produce output. - -`_transform` should do whatever has to be done in this specific -Transform class, to handle the bytes being written, and pass them off -to the readable portion of the interface. Do asynchronous I/O, -process things, and so on. - -Call `transform.push(outputChunk)` 0 or more times to generate output -from this input chunk, depending on how much data you want to output -as a result of this chunk. - -Call the callback function only when the current chunk is completely -consumed. Note that there may or may not be output as a result of any -particular input chunk. If you supply output as the second argument to the -callback, it will be passed to push method, in other words the following are -equivalent: - -```javascript -transform.prototype._transform = function (data, encoding, callback) { - this.push(data); - callback(); -} - -transform.prototype._transform = function (data, encoding, callback) { - callback(null, data); -} -``` - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -#### transform.\_flush(callback) - -* `callback` {Function} Call this function (optionally with an error - argument) when you are done flushing any remaining data. - -Note: **This function MUST NOT be called directly.** It MAY be implemented -by child classes, and if so, will be called by the internal Transform -class methods only. - -In some cases, your transform operation may need to emit a bit more -data at the end of the stream. For example, a `Zlib` compression -stream will store up some internal state so that it can optimally -compress the output. At the end, however, it needs to do the best it -can with what is left, so that the data will be complete. - -In those cases, you can implement a `_flush` method, which will be -called at the very end, after all the written data is consumed, but -before emitting `end` to signal the end of the readable side. Just -like with `_transform`, call `transform.push(chunk)` zero or more -times, as appropriate, and call `callback` when the flush operation is -complete. - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -#### Events: 'finish' and 'end' - -The [`finish`][] and [`end`][] events are from the parent Writable -and Readable classes respectively. The `finish` event is fired after -`.end()` is called and all chunks have been processed by `_transform`, -`end` is fired after all data has been output which is after the callback -in `_flush` has been called. - -#### Example: `SimpleProtocol` parser v2 - -The example above of a simple protocol parser can be implemented -simply by using the higher level [Transform][] stream class, similar to -the `parseHeader` and `SimpleProtocol v1` examples above. - -In this example, rather than providing the input as an argument, it -would be piped into the parser, which is a more idiomatic io.js stream -approach. - -```javascript -var util = require('util'); -var Transform = require('stream').Transform; -util.inherits(SimpleProtocol, Transform); - -function SimpleProtocol(options) { - if (!(this instanceof SimpleProtocol)) - return new SimpleProtocol(options); - - Transform.call(this, options); - this._inBody = false; - this._sawFirstCr = false; - this._rawHeader = []; - this.header = null; -} - -SimpleProtocol.prototype._transform = function(chunk, encoding, done) { - if (!this._inBody) { - // check if the chunk has a \n\n - var split = -1; - for (var i = 0; i < chunk.length; i++) { - if (chunk[i] === 10) { // '\n' - if (this._sawFirstCr) { - split = i; - break; - } else { - this._sawFirstCr = true; - } - } else { - this._sawFirstCr = false; - } - } - - if (split === -1) { - // still waiting for the \n\n - // stash the chunk, and try again. - this._rawHeader.push(chunk); - } else { - this._inBody = true; - var h = chunk.slice(0, split); - this._rawHeader.push(h); - var header = Buffer.concat(this._rawHeader).toString(); - try { - this.header = JSON.parse(header); - } catch (er) { - this.emit('error', new Error('invalid simple protocol data')); - return; - } - // and let them know that we are done parsing the header. - this.emit('header', this.header); - - // now, because we got some extra data, emit this first. - this.push(chunk.slice(split)); - } - } else { - // from there on, just provide the data to our consumer as-is. - this.push(chunk); - } - done(); -}; - -// Usage: -// var parser = new SimpleProtocol(); -// source.pipe(parser) -// Now parser is a readable stream that will emit 'header' -// with the parsed header data. -``` - - -### Class: stream.PassThrough - -This is a trivial implementation of a [Transform][] stream that simply -passes the input bytes across to the output. Its purpose is mainly -for examples and testing, but there are occasionally use cases where -it can come in handy as a building block for novel sorts of streams. - - -## Simplified Constructor API - - - -In simple cases there is now the added benefit of being able to construct a stream without inheritance. - -This can be done by passing the appropriate methods as constructor options: - -Examples: - -### Readable -```javascript -var readable = new stream.Readable({ - read: function(n) { - // sets this._read under the hood - } -}); -``` - -### Writable -```javascript -var writable = new stream.Writable({ - write: function(chunk, encoding, next) { - // sets this._write under the hood - } -}); - -// or - -var writable = new stream.Writable({ - writev: function(chunks, next) { - // sets this._writev under the hood - } -}); -``` - -### Duplex -```javascript -var duplex = new stream.Duplex({ - read: function(n) { - // sets this._read under the hood - }, - write: function(chunk, encoding, next) { - // sets this._write under the hood - } -}); - -// or - -var duplex = new stream.Duplex({ - read: function(n) { - // sets this._read under the hood - }, - writev: function(chunks, next) { - // sets this._writev under the hood - } -}); -``` - -### Transform -```javascript -var transform = new stream.Transform({ - transform: function(chunk, encoding, next) { - // sets this._transform under the hood - }, - flush: function(done) { - // sets this._flush under the hood - } -}); -``` - -## Streams: Under the Hood - - - -### Buffering - - - -Both Writable and Readable streams will buffer data on an internal -object called `_writableState.buffer` or `_readableState.buffer`, -respectively. - -The amount of data that will potentially be buffered depends on the -`highWaterMark` option which is passed into the constructor. - -Buffering in Readable streams happens when the implementation calls -[`stream.push(chunk)`][]. If the consumer of the Stream does not call -`stream.read()`, then the data will sit in the internal queue until it -is consumed. - -Buffering in Writable streams happens when the user calls -[`stream.write(chunk)`][] repeatedly, even when `write()` returns `false`. - -The purpose of streams, especially with the `pipe()` method, is to -limit the buffering of data to acceptable levels, so that sources and -destinations of varying speed will not overwhelm the available memory. - -### `stream.read(0)` - -There are some cases where you want to trigger a refresh of the -underlying readable stream mechanisms, without actually consuming any -data. In that case, you can call `stream.read(0)`, which will always -return null. - -If the internal read buffer is below the `highWaterMark`, and the -stream is not currently reading, then calling `read(0)` will trigger -a low-level `_read` call. - -There is almost never a need to do this. However, you will see some -cases in io.js's internals where this is done, particularly in the -Readable stream class internals. - -### `stream.push('')` - -Pushing a zero-byte string or Buffer (when not in [Object mode][]) has an -interesting side effect. Because it *is* a call to -[`stream.push()`][], it will end the `reading` process. However, it -does *not* add any data to the readable buffer, so there's nothing for -a user to consume. - -Very rarely, there are cases where you have no data to provide now, -but the consumer of your stream (or, perhaps, another bit of your own -code) will know when to check again, by calling `stream.read(0)`. In -those cases, you *may* call `stream.push('')`. - -So far, the only use case for this functionality is in the -[tls.CryptoStream][] class, which is deprecated in io.js v1.0. If you -find that you have to use `stream.push('')`, please consider another -approach, because it almost certainly indicates that something is -horribly wrong. - -### Compatibility with Older Node.js Versions - - - -In versions of Node.js prior to v0.10, the Readable stream interface was -simpler, but also less powerful and less useful. - -* Rather than waiting for you to call the `read()` method, `'data'` - events would start emitting immediately. If you needed to do some - I/O to decide how to handle data, then you had to store the chunks - in some kind of buffer so that they would not be lost. -* The [`pause()`][] method was advisory, rather than guaranteed. This - meant that you still had to be prepared to receive `'data'` events - even when the stream was in a paused state. - -In io.js v1.0 and Node.js v0.10, the Readable class described below was added. -For backwards compatibility with older Node.js programs, Readable streams -switch into "flowing mode" when a `'data'` event handler is added, or -when the [`resume()`][] method is called. The effect is that, even if -you are not using the new `read()` method and `'readable'` event, you -no longer have to worry about losing `'data'` chunks. - -Most programs will continue to function normally. However, this -introduces an edge case in the following conditions: - -* No [`'data'` event][] handler is added. -* The [`resume()`][] method is never called. -* The stream is not piped to any writable destination. - -For example, consider the following code: - -```javascript -// WARNING! BROKEN! -net.createServer(function(socket) { - - // we add an 'end' method, but never consume the data - socket.on('end', function() { - // It will never get here. - socket.end('I got your message (but didnt read it)\n'); - }); - -}).listen(1337); -``` - -In versions of Node.js prior to v0.10, the incoming message data would be -simply discarded. However, in io.js v1.0 and Node.js v0.10 and beyond, -the socket will remain paused forever. - -The workaround in this situation is to call the `resume()` method to -start the flow of data: - -```javascript -// Workaround -net.createServer(function(socket) { - - socket.on('end', function() { - socket.end('I got your message (but didnt read it)\n'); - }); - - // start the flow of data, discarding it. - socket.resume(); - -}).listen(1337); -``` - -In addition to new Readable streams switching into flowing mode, -pre-v0.10 style streams can be wrapped in a Readable class using the -`wrap()` method. - - -### Object Mode - - - -Normally, Streams operate on Strings and Buffers exclusively. - -Streams that are in **object mode** can emit generic JavaScript values -other than Buffers and Strings. - -A Readable stream in object mode will always return a single item from -a call to `stream.read(size)`, regardless of what the size argument -is. - -A Writable stream in object mode will always ignore the `encoding` -argument to `stream.write(data, encoding)`. - -The special value `null` still retains its special value for object -mode streams. That is, for object mode readable streams, `null` as a -return value from `stream.read()` indicates that there is no more -data, and [`stream.push(null)`][] will signal the end of stream data -(`EOF`). - -No streams in io.js core are object mode streams. This pattern is only -used by userland streaming libraries. - -You should set `objectMode` in your stream child class constructor on -the options object. Setting `objectMode` mid-stream is not safe. - -For Duplex streams `objectMode` can be set exclusively for readable or -writable side with `readableObjectMode` and `writableObjectMode` -respectively. These options can be used to implement parsers and -serializers with Transform streams. - -```javascript -var util = require('util'); -var StringDecoder = require('string_decoder').StringDecoder; -var Transform = require('stream').Transform; -util.inherits(JSONParseStream, Transform); - -// Gets \n-delimited JSON string data, and emits the parsed objects -function JSONParseStream() { - if (!(this instanceof JSONParseStream)) - return new JSONParseStream(); - - Transform.call(this, { readableObjectMode : true }); - - this._buffer = ''; - this._decoder = new StringDecoder('utf8'); -} - -JSONParseStream.prototype._transform = function(chunk, encoding, cb) { - this._buffer += this._decoder.write(chunk); - // split on newlines - var lines = this._buffer.split(/\r?\n/); - // keep the last partial line buffered - this._buffer = lines.pop(); - for (var l = 0; l < lines.length; l++) { - var line = lines[l]; - try { - var obj = JSON.parse(line); - } catch (er) { - this.emit('error', er); - return; - } - // push the parsed object out to the readable consumer - this.push(obj); - } - cb(); -}; - -JSONParseStream.prototype._flush = function(cb) { - // Just handle any leftover - var rem = this._buffer.trim(); - if (rem) { - try { - var obj = JSON.parse(rem); - } catch (er) { - this.emit('error', er); - return; - } - // push the parsed object out to the readable consumer - this.push(obj); - } - cb(); -}; -``` - - -[EventEmitter]: https://iojs.org/dist/v2.3.0/doc/api/events.html#events_class_events_eventemitter -[Object mode]: #stream_object_mode -[`stream.push(chunk)`]: #stream_readable_push_chunk_encoding -[`stream.push(null)`]: #stream_readable_push_chunk_encoding -[`stream.push()`]: #stream_readable_push_chunk_encoding -[`unpipe()`]: #stream_readable_unpipe_destination -[unpiped]: #stream_readable_unpipe_destination -[tcp sockets]: https://iojs.org/dist/v2.3.0/doc/api/net.html#net_class_net_socket -[zlib streams]: zlib.html -[zlib]: zlib.html -[crypto streams]: crypto.html -[crypto]: crypto.html -[tls.CryptoStream]: https://iojs.org/dist/v2.3.0/doc/api/tls.html#tls_class_cryptostream -[process.stdin]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stdin -[stdout]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stdout -[process.stdout]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stdout -[process.stderr]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stderr -[child process stdout and stderr]: https://iojs.org/dist/v2.3.0/doc/api/child_process.html#child_process_child_stdout -[API for Stream Consumers]: #stream_api_for_stream_consumers -[API for Stream Implementors]: #stream_api_for_stream_implementors -[Readable]: #stream_class_stream_readable -[Writable]: #stream_class_stream_writable -[Duplex]: #stream_class_stream_duplex -[Transform]: #stream_class_stream_transform -[`end`]: #stream_event_end -[`finish`]: #stream_event_finish -[`_read(size)`]: #stream_readable_read_size_1 -[`_read()`]: #stream_readable_read_size_1 -[_read]: #stream_readable_read_size_1 -[`writable.write(chunk)`]: #stream_writable_write_chunk_encoding_callback -[`write(chunk, encoding, callback)`]: #stream_writable_write_chunk_encoding_callback -[`write()`]: #stream_writable_write_chunk_encoding_callback -[`stream.write(chunk)`]: #stream_writable_write_chunk_encoding_callback -[`_write(chunk, encoding, callback)`]: #stream_writable_write_chunk_encoding_callback_1 -[`_write()`]: #stream_writable_write_chunk_encoding_callback_1 -[_write]: #stream_writable_write_chunk_encoding_callback_1 -[`util.inherits`]: https://iojs.org/dist/v2.3.0/doc/api/util.html#util_util_inherits_constructor_superconstructor -[`end()`]: #stream_writable_end_chunk_encoding_callback -[`'data'` event]: #stream_event_data -[`resume()`]: #stream_readable_resume -[`readable.resume()`]: #stream_readable_resume -[`pause()`]: #stream_readable_pause -[`unpipe()`]: #stream_readable_unpipe_destination -[`pipe()`]: #stream_readable_pipe_destination_options diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md deleted file mode 100644 index c141a99c26c638..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +++ /dev/null @@ -1,58 +0,0 @@ -# streams WG Meeting 2015-01-30 - -## Links - -* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg -* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 -* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ - -## Agenda - -Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. - -* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) -* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) -* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) -* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) - -## Minutes - -### adopt a charter - -* group: +1's all around - -### What versioning scheme should be adopted? -* group: +1’s 3.0.0 -* domenic+group: pulling in patches from other sources where appropriate -* mikeal: version independently, suggesting versions for io.js -* mikeal+domenic: work with TC to notify in advance of changes -simpler stream creation - -### streamline creation of streams -* sam: streamline creation of streams -* domenic: nice simple solution posted - but, we lose the opportunity to change the model - may not be backwards incompatible (double check keys) - - **action item:** domenic will check - -### remove implicit flowing of streams on(‘data’) -* add isFlowing / isPaused -* mikeal: worrying that we’re documenting polyfill methods – confuses users -* domenic: more reflective API is probably good, with warning labels for users -* new section for mad scientists (reflective stream access) -* calvin: name the “third state” -* mikeal: maybe borrow the name from whatwg? -* domenic: we’re missing the “third state” -* consensus: kind of difficult to name the third state -* mikeal: figure out differences in states / compat -* mathias: always flow on data – eliminates third state - * explore what it breaks - -**action items:** -* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) -* ask rod/build for infrastructure -* **chris**: explore the “flow on data” approach -* add isPaused/isFlowing -* add new docs section -* move isPaused to that section diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js deleted file mode 100644 index ca807af87620dd..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_duplex.js") diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js deleted file mode 100644 index 69558af037cd66..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js +++ /dev/null @@ -1,82 +0,0 @@ -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - -'use strict'; - -/**/ -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) keys.push(key); - return keys; -} -/**/ - - -module.exports = Duplex; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - - - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var Readable = require('./_stream_readable'); -var Writable = require('./_stream_writable'); - -util.inherits(Duplex, Readable); - -var keys = objectKeys(Writable.prototype); -for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) - Duplex.prototype[method] = Writable.prototype[method]; -} - -function Duplex(options) { - if (!(this instanceof Duplex)) - return new Duplex(options); - - Readable.call(this, options); - Writable.call(this, options); - - if (options && options.readable === false) - this.readable = false; - - if (options && options.writable === false) - this.writable = false; - - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) - this.allowHalfOpen = false; - - this.once('end', onend); -} - -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) - return; - - // no more data can be written. - // But allow more writes to happen in this tick. - processNextTick(onEndNT, this); -} - -function onEndNT(self) { - self.end(); -} - -function forEach (xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js deleted file mode 100644 index bddfdd01537a40..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js +++ /dev/null @@ -1,27 +0,0 @@ -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. - -'use strict'; - -module.exports = PassThrough; - -var Transform = require('./_stream_transform'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) - return new PassThrough(options); - - Transform.call(this, options); -} - -PassThrough.prototype._transform = function(chunk, encoding, cb) { - cb(null, chunk); -}; diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js deleted file mode 100644 index eef3d825d7a084..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js +++ /dev/null @@ -1,959 +0,0 @@ -'use strict'; - -module.exports = Readable; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - - -/**/ -var isArray = require('isarray'); -/**/ - - -/**/ -var Buffer = require('buffer').Buffer; -/**/ - -Readable.ReadableState = ReadableState; - -var EE = require('events').EventEmitter; - -/**/ -if (!EE.listenerCount) EE.listenerCount = function(emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - - - -/**/ -var Stream; -(function (){try{ - Stream = require('st' + 'ream'); -}catch(_){}finally{ - if (!Stream) - Stream = require('events').EventEmitter; -}}()) -/**/ - -var Buffer = require('buffer').Buffer; - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - - - -/**/ -var debug = require('util'); -if (debug && debug.debuglog) { - debug = debug.debuglog('stream'); -} else { - debug = function () {}; -} -/**/ - -var StringDecoder; - -util.inherits(Readable, Stream); - -function ReadableState(options, stream) { - var Duplex = require('./_stream_duplex'); - - options = options || {}; - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - - if (stream instanceof Duplex) - this.objectMode = this.objectMode || !!options.readableObjectMode; - - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; - - // cast to ints. - this.highWaterMark = ~~this.highWaterMark; - - this.buffer = []; - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // when piping, we only care about 'readable' events that happen - // after read()ing all the bytes and not getting any pushback. - this.ranOut = false; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) - StringDecoder = require('string_decoder/').StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} - -function Readable(options) { - var Duplex = require('./_stream_duplex'); - - if (!(this instanceof Readable)) - return new Readable(options); - - this._readableState = new ReadableState(options, this); - - // legacy - this.readable = true; - - if (options && typeof options.read === 'function') - this._read = options.read; - - Stream.call(this); -} - -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function(chunk, encoding) { - var state = this._readableState; - - if (!state.objectMode && typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = new Buffer(chunk, encoding); - encoding = ''; - } - } - - return readableAddChunk(this, state, chunk, encoding, false); -}; - -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function(chunk) { - var state = this._readableState; - return readableAddChunk(this, state, chunk, '', true); -}; - -Readable.prototype.isPaused = function() { - return this._readableState.flowing === false; -}; - -function readableAddChunk(stream, state, chunk, encoding, addToFront) { - var er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (state.ended && !addToFront) { - var e = new Error('stream.push() after EOF'); - stream.emit('error', e); - } else if (state.endEmitted && addToFront) { - var e = new Error('stream.unshift() after end event'); - stream.emit('error', e); - } else { - if (state.decoder && !addToFront && !encoding) - chunk = state.decoder.write(chunk); - - if (!addToFront) - state.reading = false; - - // if we want the data now, just emit it. - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) - state.buffer.unshift(chunk); - else - state.buffer.push(chunk); - - if (state.needReadable) - emitReadable(stream); - } - - maybeReadMore(stream, state); - } - } else if (!addToFront) { - state.reading = false; - } - - return needMoreData(state); -} - - - -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && - (state.needReadable || - state.length < state.highWaterMark || - state.length === 0); -} - -// backwards compatibility. -Readable.prototype.setEncoding = function(enc) { - if (!StringDecoder) - StringDecoder = require('string_decoder/').StringDecoder; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; -}; - -// Don't raise the hwm > 128MB -var MAX_HWM = 0x800000; -function roundUpToNextPowerOf2(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 - n--; - for (var p = 1; p < 32; p <<= 1) n |= n >> p; - n++; - } - return n; -} - -function howMuchToRead(n, state) { - if (state.length === 0 && state.ended) - return 0; - - if (state.objectMode) - return n === 0 ? 0 : 1; - - if (n === null || isNaN(n)) { - // only flow one buffer at a time - if (state.flowing && state.buffer.length) - return state.buffer[0].length; - else - return state.length; - } - - if (n <= 0) - return 0; - - // If we're asking for more than the target buffer level, - // then raise the water mark. Bump up to the next highest - // power of 2, to prevent increasing it excessively in tiny - // amounts. - if (n > state.highWaterMark) - state.highWaterMark = roundUpToNextPowerOf2(n); - - // don't have that much. return null, unless we've ended. - if (n > state.length) { - if (!state.ended) { - state.needReadable = true; - return 0; - } else { - return state.length; - } - } - - return n; -} - -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function(n) { - debug('read', n); - var state = this._readableState; - var nOrig = n; - - if (typeof n !== 'number' || n > 0) - state.emittedReadable = false; - - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && - state.needReadable && - (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) - endReadable(this); - else - emitReadable(this); - return null; - } - - n = howMuchToRead(n, state); - - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) - endReadable(this); - return null; - } - - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); - - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } - - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } - - if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) - state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - } - - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (doRead && !state.reading) - n = howMuchToRead(nOrig, state); - - var ret; - if (n > 0) - ret = fromList(n, state); - else - ret = null; - - if (ret === null) { - state.needReadable = true; - n = 0; - } - - state.length -= n; - - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (state.length === 0 && !state.ended) - state.needReadable = true; - - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended && state.length === 0) - endReadable(this); - - if (ret !== null) - this.emit('data', ret); - - return ret; -}; - -function chunkInvalid(state, chunk) { - var er = null; - if (!(Buffer.isBuffer(chunk)) && - typeof chunk !== 'string' && - chunk !== null && - chunk !== undefined && - !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} - - -function onEofChunk(stream, state) { - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); -} - -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) - processNextTick(emitReadable_, stream); - else - emitReadable_(stream); - } -} - -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); -} - - -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - processNextTick(maybeReadMore_, stream, state); - } -} - -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && - state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break; - else - len = state.length; - } - state.readingMore = false; -} - -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function(n) { - this.emit('error', new Error('not implemented')); -}; - -Readable.prototype.pipe = function(dest, pipeOpts) { - var src = this; - var state = this._readableState; - - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - - var doEnd = (!pipeOpts || pipeOpts.end !== false) && - dest !== process.stdout && - dest !== process.stderr; - - var endFn = doEnd ? onend : cleanup; - if (state.endEmitted) - processNextTick(endFn); - else - src.once('end', endFn); - - dest.on('unpipe', onunpipe); - function onunpipe(readable) { - debug('onunpipe'); - if (readable === src) { - cleanup(); - } - } - - function onend() { - debug('onend'); - dest.end(); - } - - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', cleanup); - src.removeListener('data', ondata); - - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && - (!dest._writableState || dest._writableState.needDrain)) - ondrain(); - } - - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - var ret = dest.write(chunk); - if (false === ret) { - debug('false write response, pause', - src._readableState.awaitDrain); - src._readableState.awaitDrain++; - src.pause(); - } - } - - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EE.listenerCount(dest, 'error') === 0) - dest.emit('error', er); - } - // This is a brutally ugly hack to make sure that our error handler - // is attached before any userland ones. NEVER DO THIS. - if (!dest._events || !dest._events.error) - dest.on('error', onerror); - else if (isArray(dest._events.error)) - dest._events.error.unshift(onerror); - else - dest._events.error = [onerror, dest._events.error]; - - - - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); - - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } - - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } - - return dest; -}; - -function pipeOnDrain(src) { - return function() { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) - state.awaitDrain--; - if (state.awaitDrain === 0 && EE.listenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; -} - - -Readable.prototype.unpipe = function(dest) { - var state = this._readableState; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) - return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) - return this; - - if (!dest) - dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) - dest.emit('unpipe', this); - return this; - } - - // slow case. multiple pipe destinations. - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - - for (var i = 0; i < len; i++) - dests[i].emit('unpipe', this); - return this; - } - - // try to find the right one. - var i = indexOf(state.pipes, dest); - if (i === -1) - return this; - - state.pipes.splice(i, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) - state.pipes = state.pipes[0]; - - dest.emit('unpipe', this); - - return this; -}; - -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function(ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - - // If listening to data, and it has not explicitly been paused, - // then call resume to start the flow of data on the next tick. - if (ev === 'data' && false !== this._readableState.flowing) { - this.resume(); - } - - if (ev === 'readable' && this.readable) { - var state = this._readableState; - if (!state.readableListening) { - state.readableListening = true; - state.emittedReadable = false; - state.needReadable = true; - if (!state.reading) { - processNextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this, state); - } - } - } - - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; - -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} - -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function() { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - resume(this, state); - } - return this; -}; - -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - processNextTick(resume_, stream, state); - } -} - -function resume_(stream, state) { - if (!state.reading) { - debug('resume read 0'); - stream.read(0); - } - - state.resumeScheduled = false; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) - stream.read(0); -} - -Readable.prototype.pause = function() { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - return this; -}; - -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - if (state.flowing) { - do { - var chunk = stream.read(); - } while (null !== chunk && state.flowing); - } -} - -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function(stream) { - var state = this._readableState; - var paused = false; - - var self = this; - stream.on('end', function() { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) - self.push(chunk); - } - - self.push(null); - }); - - stream.on('data', function(chunk) { - debug('wrapped data'); - if (state.decoder) - chunk = state.decoder.write(chunk); - - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) - return; - else if (!state.objectMode && (!chunk || !chunk.length)) - return; - - var ret = self.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); - - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function(method) { return function() { - return stream[method].apply(stream, arguments); - }; }(i); - } - } - - // proxy certain important events. - var events = ['error', 'close', 'destroy', 'pause', 'resume']; - forEach(events, function(ev) { - stream.on(ev, self.emit.bind(self, ev)); - }); - - // when we try to consume some more bytes, simply unpause the - // underlying stream. - self._read = function(n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); - } - }; - - return self; -}; - - - -// exposed for testing purposes only. -Readable._fromList = fromList; - -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -function fromList(n, state) { - var list = state.buffer; - var length = state.length; - var stringMode = !!state.decoder; - var objectMode = !!state.objectMode; - var ret; - - // nothing in the list, definitely empty. - if (list.length === 0) - return null; - - if (length === 0) - ret = null; - else if (objectMode) - ret = list.shift(); - else if (!n || n >= length) { - // read it all, truncate the array. - if (stringMode) - ret = list.join(''); - else - ret = Buffer.concat(list, length); - list.length = 0; - } else { - // read just some of it. - if (n < list[0].length) { - // just take a part of the first list item. - // slice is the same for buffers and strings. - var buf = list[0]; - ret = buf.slice(0, n); - list[0] = buf.slice(n); - } else if (n === list[0].length) { - // first list is a perfect match - ret = list.shift(); - } else { - // complex case. - // we have enough to cover it, but it spans past the first buffer. - if (stringMode) - ret = ''; - else - ret = new Buffer(n); - - var c = 0; - for (var i = 0, l = list.length; i < l && c < n; i++) { - var buf = list[0]; - var cpy = Math.min(n - c, buf.length); - - if (stringMode) - ret += buf.slice(0, cpy); - else - buf.copy(ret, c, 0, cpy); - - if (cpy < buf.length) - list[0] = buf.slice(cpy); - else - list.shift(); - - c += cpy; - } - } - } - - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) - throw new Error('endReadable called on non-empty stream'); - - if (!state.endEmitted) { - state.ended = true; - processNextTick(endReadableNT, state, stream); - } -} - -function endReadableNT(state, stream) { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } -} - -function forEach (xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} - -function indexOf (xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - return -1; -} diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js deleted file mode 100644 index 3675d18d915610..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js +++ /dev/null @@ -1,197 +0,0 @@ -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. - -'use strict'; - -module.exports = Transform; - -var Duplex = require('./_stream_duplex'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(Transform, Duplex); - - -function TransformState(stream) { - this.afterTransform = function(er, data) { - return afterTransform(stream, er, data); - }; - - this.needTransform = false; - this.transforming = false; - this.writecb = null; - this.writechunk = null; -} - -function afterTransform(stream, er, data) { - var ts = stream._transformState; - ts.transforming = false; - - var cb = ts.writecb; - - if (!cb) - return stream.emit('error', new Error('no writecb in Transform class')); - - ts.writechunk = null; - ts.writecb = null; - - if (data !== null && data !== undefined) - stream.push(data); - - if (cb) - cb(er); - - var rs = stream._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - stream._read(rs.highWaterMark); - } -} - - -function Transform(options) { - if (!(this instanceof Transform)) - return new Transform(options); - - Duplex.call(this, options); - - this._transformState = new TransformState(this); - - // when the writable side finishes, then flush out anything remaining. - var stream = this; - - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; - - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; - - if (options) { - if (typeof options.transform === 'function') - this._transform = options.transform; - - if (typeof options.flush === 'function') - this._flush = options.flush; - } - - this.once('prefinish', function() { - if (typeof this._flush === 'function') - this._flush(function(er) { - done(stream, er); - }); - else - done(stream); - }); -} - -Transform.prototype.push = function(chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; - -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function(chunk, encoding, cb) { - throw new Error('not implemented'); -}; - -Transform.prototype._write = function(chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || - rs.needReadable || - rs.length < rs.highWaterMark) - this._read(rs.highWaterMark); - } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function(n) { - var ts = this._transformState; - - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; - - -function done(stream, er) { - if (er) - return stream.emit('error', er); - - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - var ws = stream._writableState; - var ts = stream._transformState; - - if (ws.length) - throw new Error('calling transform done when ws.length != 0'); - - if (ts.transforming) - throw new Error('calling transform done when still transforming'); - - return stream.push(null); -} diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js deleted file mode 100644 index b232952016a9c1..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js +++ /dev/null @@ -1,520 +0,0 @@ -// A bit simpler than readable streams. -// Implement an async ._write(chunk, cb), and it'll handle all -// the drain event emission and buffering. - -'use strict'; - -module.exports = Writable; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - - -/**/ -var Buffer = require('buffer').Buffer; -/**/ - -Writable.WritableState = WritableState; - - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - - - -/**/ -var Stream; -(function (){try{ - Stream = require('st' + 'ream'); -}catch(_){}finally{ - if (!Stream) - Stream = require('events').EventEmitter; -}}()) -/**/ - -var Buffer = require('buffer').Buffer; - -util.inherits(Writable, Stream); - -function nop() {} - -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} - -function WritableState(options, stream) { - var Duplex = require('./_stream_duplex'); - - options = options || {}; - - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; - - if (stream instanceof Duplex) - this.objectMode = this.objectMode || !!options.writableObjectMode; - - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; - - // cast to ints. - this.highWaterMark = ~~this.highWaterMark; - - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; - - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; - - // a flag to see when we're in the middle of a write. - this.writing = false; - - // when true all writes will be buffered until .uncork() call - this.corked = 0; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; - - // the callback that's passed to _write(chunk,cb) - this.onwrite = function(er) { - onwrite(stream, er); - }; - - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; - - this.bufferedRequest = null; - this.lastBufferedRequest = null; - - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; - - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; - - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; -} - -WritableState.prototype.getBuffer = function writableStateGetBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; - } - return out; -}; - -(function (){try { -Object.defineProperty(WritableState.prototype, 'buffer', { - get: require('util-deprecate')(function() { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use ' + - '_writableState.getBuffer() instead.') -}); -}catch(_){}}()); - - -function Writable(options) { - var Duplex = require('./_stream_duplex'); - - // Writable ctor is applied to Duplexes, though they're not - // instanceof Writable, they're instanceof Readable. - if (!(this instanceof Writable) && !(this instanceof Duplex)) - return new Writable(options); - - this._writableState = new WritableState(options, this); - - // legacy. - this.writable = true; - - if (options) { - if (typeof options.write === 'function') - this._write = options.write; - - if (typeof options.writev === 'function') - this._writev = options.writev; - } - - Stream.call(this); -} - -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function() { - this.emit('error', new Error('Cannot pipe. Not readable.')); -}; - - -function writeAfterEnd(stream, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - processNextTick(cb, er); -} - -// If we get something that is not a buffer, string, null, or undefined, -// and we're not in objectMode, then that's an error. -// Otherwise stream chunks are all considered to be of length=1, and the -// watermarks determine how many objects to keep in the buffer, rather than -// how many bytes or characters. -function validChunk(stream, state, chunk, cb) { - var valid = true; - - if (!(Buffer.isBuffer(chunk)) && - typeof chunk !== 'string' && - chunk !== null && - chunk !== undefined && - !state.objectMode) { - var er = new TypeError('Invalid non-string/buffer chunk'); - stream.emit('error', er); - processNextTick(cb, er); - valid = false; - } - return valid; -} - -Writable.prototype.write = function(chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (Buffer.isBuffer(chunk)) - encoding = 'buffer'; - else if (!encoding) - encoding = state.defaultEncoding; - - if (typeof cb !== 'function') - cb = nop; - - if (state.ended) - writeAfterEnd(this, cb); - else if (validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, chunk, encoding, cb); - } - - return ret; -}; - -Writable.prototype.cork = function() { - var state = this._writableState; - - state.corked++; -}; - -Writable.prototype.uncork = function() { - var state = this._writableState; - - if (state.corked) { - state.corked--; - - if (!state.writing && - !state.corked && - !state.finished && - !state.bufferProcessing && - state.bufferedRequest) - clearBuffer(this, state); - } -}; - -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') - encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', -'ucs2', 'ucs-2','utf16le', 'utf-16le', 'raw'] -.indexOf((encoding + '').toLowerCase()) > -1)) - throw new TypeError('Unknown encoding: ' + encoding); - this._writableState.defaultEncoding = encoding; -}; - -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && - state.decodeStrings !== false && - typeof chunk === 'string') { - chunk = new Buffer(chunk, encoding); - } - return chunk; -} - -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, chunk, encoding, cb) { - chunk = decodeChunk(state, chunk, encoding); - - if (Buffer.isBuffer(chunk)) - encoding = 'buffer'; - var len = state.objectMode ? 1 : chunk.length; - - state.length += len; - - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) - state.needDrain = true; - - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - - return ret; -} - -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) - stream._writev(chunk, state.onwrite); - else - stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} - -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - if (sync) - processNextTick(cb, er); - else - cb(er); - - stream._writableState.errorEmitted = true; - stream.emit('error', er); -} - -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} - -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - - onwriteStateUpdate(state); - - if (er) - onwriteError(stream, state, sync, er, cb); - else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state); - - if (!finished && - !state.corked && - !state.bufferProcessing && - state.bufferedRequest) { - clearBuffer(stream, state); - } - - if (sync) { - processNextTick(afterWrite, stream, state, finished, cb); - } else { - afterWrite(stream, state, finished, cb); - } - } -} - -function afterWrite(stream, state, finished, cb) { - if (!finished) - onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} - -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} - - -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var buffer = []; - var cbs = []; - while (entry) { - cbs.push(entry.callback); - buffer.push(entry); - entry = entry.next; - } - - // count the one we are adding, as well. - // TODO(isaacs) clean this up - state.pendingcb++; - state.lastBufferedRequest = null; - doWrite(stream, state, true, state.length, buffer, '', function(err) { - for (var i = 0; i < cbs.length; i++) { - state.pendingcb--; - cbs[i](err); - } - }); - - // Clear buffer - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } - } - - if (entry === null) - state.lastBufferedRequest = null; - } - state.bufferedRequest = entry; - state.bufferProcessing = false; -} - -Writable.prototype._write = function(chunk, encoding, cb) { - cb(new Error('not implemented')); -}; - -Writable.prototype._writev = null; - -Writable.prototype.end = function(chunk, encoding, cb) { - var state = this._writableState; - - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (chunk !== null && chunk !== undefined) - this.write(chunk, encoding); - - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); - } - - // ignore unnecessary end() calls. - if (!state.ending && !state.finished) - endWritable(this, state, cb); -}; - - -function needFinish(state) { - return (state.ending && - state.length === 0 && - state.bufferedRequest === null && - !state.finished && - !state.writing); -} - -function prefinish(stream, state) { - if (!state.prefinished) { - state.prefinished = true; - stream.emit('prefinish'); - } -} - -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - if (state.pendingcb === 0) { - prefinish(stream, state); - state.finished = true; - stream.emit('finish'); - } else { - prefinish(stream, state); - } - } - return need; -} - -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) - processNextTick(cb); - else - stream.once('finish', cb); - } - state.ended = true; -} diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md deleted file mode 100644 index 5a76b4149c5eb5..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# core-util-is - -The `util.is*` functions introduced in Node v0.12. diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch deleted file mode 100644 index a06d5c05f75fd5..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch +++ /dev/null @@ -1,604 +0,0 @@ -diff --git a/lib/util.js b/lib/util.js -index a03e874..9074e8e 100644 ---- a/lib/util.js -+++ b/lib/util.js -@@ -19,430 +19,6 @@ - // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - // USE OR OTHER DEALINGS IN THE SOFTWARE. - --var formatRegExp = /%[sdj%]/g; --exports.format = function(f) { -- if (!isString(f)) { -- var objects = []; -- for (var i = 0; i < arguments.length; i++) { -- objects.push(inspect(arguments[i])); -- } -- return objects.join(' '); -- } -- -- var i = 1; -- var args = arguments; -- var len = args.length; -- var str = String(f).replace(formatRegExp, function(x) { -- if (x === '%%') return '%'; -- if (i >= len) return x; -- switch (x) { -- case '%s': return String(args[i++]); -- case '%d': return Number(args[i++]); -- case '%j': -- try { -- return JSON.stringify(args[i++]); -- } catch (_) { -- return '[Circular]'; -- } -- default: -- return x; -- } -- }); -- for (var x = args[i]; i < len; x = args[++i]) { -- if (isNull(x) || !isObject(x)) { -- str += ' ' + x; -- } else { -- str += ' ' + inspect(x); -- } -- } -- return str; --}; -- -- --// Mark that a method should not be used. --// Returns a modified function which warns once by default. --// If --no-deprecation is set, then it is a no-op. --exports.deprecate = function(fn, msg) { -- // Allow for deprecating things in the process of starting up. -- if (isUndefined(global.process)) { -- return function() { -- return exports.deprecate(fn, msg).apply(this, arguments); -- }; -- } -- -- if (process.noDeprecation === true) { -- return fn; -- } -- -- var warned = false; -- function deprecated() { -- if (!warned) { -- if (process.throwDeprecation) { -- throw new Error(msg); -- } else if (process.traceDeprecation) { -- console.trace(msg); -- } else { -- console.error(msg); -- } -- warned = true; -- } -- return fn.apply(this, arguments); -- } -- -- return deprecated; --}; -- -- --var debugs = {}; --var debugEnviron; --exports.debuglog = function(set) { -- if (isUndefined(debugEnviron)) -- debugEnviron = process.env.NODE_DEBUG || ''; -- set = set.toUpperCase(); -- if (!debugs[set]) { -- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { -- var pid = process.pid; -- debugs[set] = function() { -- var msg = exports.format.apply(exports, arguments); -- console.error('%s %d: %s', set, pid, msg); -- }; -- } else { -- debugs[set] = function() {}; -- } -- } -- return debugs[set]; --}; -- -- --/** -- * Echos the value of a value. Trys to print the value out -- * in the best way possible given the different types. -- * -- * @param {Object} obj The object to print out. -- * @param {Object} opts Optional options object that alters the output. -- */ --/* legacy: obj, showHidden, depth, colors*/ --function inspect(obj, opts) { -- // default options -- var ctx = { -- seen: [], -- stylize: stylizeNoColor -- }; -- // legacy... -- if (arguments.length >= 3) ctx.depth = arguments[2]; -- if (arguments.length >= 4) ctx.colors = arguments[3]; -- if (isBoolean(opts)) { -- // legacy... -- ctx.showHidden = opts; -- } else if (opts) { -- // got an "options" object -- exports._extend(ctx, opts); -- } -- // set default options -- if (isUndefined(ctx.showHidden)) ctx.showHidden = false; -- if (isUndefined(ctx.depth)) ctx.depth = 2; -- if (isUndefined(ctx.colors)) ctx.colors = false; -- if (isUndefined(ctx.customInspect)) ctx.customInspect = true; -- if (ctx.colors) ctx.stylize = stylizeWithColor; -- return formatValue(ctx, obj, ctx.depth); --} --exports.inspect = inspect; -- -- --// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics --inspect.colors = { -- 'bold' : [1, 22], -- 'italic' : [3, 23], -- 'underline' : [4, 24], -- 'inverse' : [7, 27], -- 'white' : [37, 39], -- 'grey' : [90, 39], -- 'black' : [30, 39], -- 'blue' : [34, 39], -- 'cyan' : [36, 39], -- 'green' : [32, 39], -- 'magenta' : [35, 39], -- 'red' : [31, 39], -- 'yellow' : [33, 39] --}; -- --// Don't use 'blue' not visible on cmd.exe --inspect.styles = { -- 'special': 'cyan', -- 'number': 'yellow', -- 'boolean': 'yellow', -- 'undefined': 'grey', -- 'null': 'bold', -- 'string': 'green', -- 'date': 'magenta', -- // "name": intentionally not styling -- 'regexp': 'red' --}; -- -- --function stylizeWithColor(str, styleType) { -- var style = inspect.styles[styleType]; -- -- if (style) { -- return '\u001b[' + inspect.colors[style][0] + 'm' + str + -- '\u001b[' + inspect.colors[style][1] + 'm'; -- } else { -- return str; -- } --} -- -- --function stylizeNoColor(str, styleType) { -- return str; --} -- -- --function arrayToHash(array) { -- var hash = {}; -- -- array.forEach(function(val, idx) { -- hash[val] = true; -- }); -- -- return hash; --} -- -- --function formatValue(ctx, value, recurseTimes) { -- // Provide a hook for user-specified inspect functions. -- // Check that value is an object with an inspect function on it -- if (ctx.customInspect && -- value && -- isFunction(value.inspect) && -- // Filter out the util module, it's inspect function is special -- value.inspect !== exports.inspect && -- // Also filter out any prototype objects using the circular check. -- !(value.constructor && value.constructor.prototype === value)) { -- var ret = value.inspect(recurseTimes, ctx); -- if (!isString(ret)) { -- ret = formatValue(ctx, ret, recurseTimes); -- } -- return ret; -- } -- -- // Primitive types cannot have properties -- var primitive = formatPrimitive(ctx, value); -- if (primitive) { -- return primitive; -- } -- -- // Look up the keys of the object. -- var keys = Object.keys(value); -- var visibleKeys = arrayToHash(keys); -- -- if (ctx.showHidden) { -- keys = Object.getOwnPropertyNames(value); -- } -- -- // Some type of object without properties can be shortcutted. -- if (keys.length === 0) { -- if (isFunction(value)) { -- var name = value.name ? ': ' + value.name : ''; -- return ctx.stylize('[Function' + name + ']', 'special'); -- } -- if (isRegExp(value)) { -- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); -- } -- if (isDate(value)) { -- return ctx.stylize(Date.prototype.toString.call(value), 'date'); -- } -- if (isError(value)) { -- return formatError(value); -- } -- } -- -- var base = '', array = false, braces = ['{', '}']; -- -- // Make Array say that they are Array -- if (isArray(value)) { -- array = true; -- braces = ['[', ']']; -- } -- -- // Make functions say that they are functions -- if (isFunction(value)) { -- var n = value.name ? ': ' + value.name : ''; -- base = ' [Function' + n + ']'; -- } -- -- // Make RegExps say that they are RegExps -- if (isRegExp(value)) { -- base = ' ' + RegExp.prototype.toString.call(value); -- } -- -- // Make dates with properties first say the date -- if (isDate(value)) { -- base = ' ' + Date.prototype.toUTCString.call(value); -- } -- -- // Make error with message first say the error -- if (isError(value)) { -- base = ' ' + formatError(value); -- } -- -- if (keys.length === 0 && (!array || value.length == 0)) { -- return braces[0] + base + braces[1]; -- } -- -- if (recurseTimes < 0) { -- if (isRegExp(value)) { -- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); -- } else { -- return ctx.stylize('[Object]', 'special'); -- } -- } -- -- ctx.seen.push(value); -- -- var output; -- if (array) { -- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); -- } else { -- output = keys.map(function(key) { -- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); -- }); -- } -- -- ctx.seen.pop(); -- -- return reduceToSingleString(output, base, braces); --} -- -- --function formatPrimitive(ctx, value) { -- if (isUndefined(value)) -- return ctx.stylize('undefined', 'undefined'); -- if (isString(value)) { -- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') -- .replace(/'/g, "\\'") -- .replace(/\\"/g, '"') + '\''; -- return ctx.stylize(simple, 'string'); -- } -- if (isNumber(value)) { -- // Format -0 as '-0'. Strict equality won't distinguish 0 from -0, -- // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 . -- if (value === 0 && 1 / value < 0) -- return ctx.stylize('-0', 'number'); -- return ctx.stylize('' + value, 'number'); -- } -- if (isBoolean(value)) -- return ctx.stylize('' + value, 'boolean'); -- // For some reason typeof null is "object", so special case here. -- if (isNull(value)) -- return ctx.stylize('null', 'null'); --} -- -- --function formatError(value) { -- return '[' + Error.prototype.toString.call(value) + ']'; --} -- -- --function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { -- var output = []; -- for (var i = 0, l = value.length; i < l; ++i) { -- if (hasOwnProperty(value, String(i))) { -- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, -- String(i), true)); -- } else { -- output.push(''); -- } -- } -- keys.forEach(function(key) { -- if (!key.match(/^\d+$/)) { -- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, -- key, true)); -- } -- }); -- return output; --} -- -- --function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { -- var name, str, desc; -- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; -- if (desc.get) { -- if (desc.set) { -- str = ctx.stylize('[Getter/Setter]', 'special'); -- } else { -- str = ctx.stylize('[Getter]', 'special'); -- } -- } else { -- if (desc.set) { -- str = ctx.stylize('[Setter]', 'special'); -- } -- } -- if (!hasOwnProperty(visibleKeys, key)) { -- name = '[' + key + ']'; -- } -- if (!str) { -- if (ctx.seen.indexOf(desc.value) < 0) { -- if (isNull(recurseTimes)) { -- str = formatValue(ctx, desc.value, null); -- } else { -- str = formatValue(ctx, desc.value, recurseTimes - 1); -- } -- if (str.indexOf('\n') > -1) { -- if (array) { -- str = str.split('\n').map(function(line) { -- return ' ' + line; -- }).join('\n').substr(2); -- } else { -- str = '\n' + str.split('\n').map(function(line) { -- return ' ' + line; -- }).join('\n'); -- } -- } -- } else { -- str = ctx.stylize('[Circular]', 'special'); -- } -- } -- if (isUndefined(name)) { -- if (array && key.match(/^\d+$/)) { -- return str; -- } -- name = JSON.stringify('' + key); -- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { -- name = name.substr(1, name.length - 2); -- name = ctx.stylize(name, 'name'); -- } else { -- name = name.replace(/'/g, "\\'") -- .replace(/\\"/g, '"') -- .replace(/(^"|"$)/g, "'"); -- name = ctx.stylize(name, 'string'); -- } -- } -- -- return name + ': ' + str; --} -- -- --function reduceToSingleString(output, base, braces) { -- var numLinesEst = 0; -- var length = output.reduce(function(prev, cur) { -- numLinesEst++; -- if (cur.indexOf('\n') >= 0) numLinesEst++; -- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; -- }, 0); -- -- if (length > 60) { -- return braces[0] + -- (base === '' ? '' : base + '\n ') + -- ' ' + -- output.join(',\n ') + -- ' ' + -- braces[1]; -- } -- -- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; --} -- -- - // NOTE: These type checking functions intentionally don't use `instanceof` - // because it is fragile and can be easily faked with `Object.create()`. - function isArray(ar) { -@@ -522,166 +98,10 @@ function isPrimitive(arg) { - exports.isPrimitive = isPrimitive; - - function isBuffer(arg) { -- return arg instanceof Buffer; -+ return Buffer.isBuffer(arg); - } - exports.isBuffer = isBuffer; - - function objectToString(o) { - return Object.prototype.toString.call(o); --} -- -- --function pad(n) { -- return n < 10 ? '0' + n.toString(10) : n.toString(10); --} -- -- --var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', -- 'Oct', 'Nov', 'Dec']; -- --// 26 Feb 16:19:34 --function timestamp() { -- var d = new Date(); -- var time = [pad(d.getHours()), -- pad(d.getMinutes()), -- pad(d.getSeconds())].join(':'); -- return [d.getDate(), months[d.getMonth()], time].join(' '); --} -- -- --// log is just a thin wrapper to console.log that prepends a timestamp --exports.log = function() { -- console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); --}; -- -- --/** -- * Inherit the prototype methods from one constructor into another. -- * -- * The Function.prototype.inherits from lang.js rewritten as a standalone -- * function (not on Function.prototype). NOTE: If this file is to be loaded -- * during bootstrapping this function needs to be rewritten using some native -- * functions as prototype setup using normal JavaScript does not work as -- * expected during bootstrapping (see mirror.js in r114903). -- * -- * @param {function} ctor Constructor function which needs to inherit the -- * prototype. -- * @param {function} superCtor Constructor function to inherit prototype from. -- */ --exports.inherits = function(ctor, superCtor) { -- ctor.super_ = superCtor; -- ctor.prototype = Object.create(superCtor.prototype, { -- constructor: { -- value: ctor, -- enumerable: false, -- writable: true, -- configurable: true -- } -- }); --}; -- --exports._extend = function(origin, add) { -- // Don't do anything if add isn't an object -- if (!add || !isObject(add)) return origin; -- -- var keys = Object.keys(add); -- var i = keys.length; -- while (i--) { -- origin[keys[i]] = add[keys[i]]; -- } -- return origin; --}; -- --function hasOwnProperty(obj, prop) { -- return Object.prototype.hasOwnProperty.call(obj, prop); --} -- -- --// Deprecated old stuff. -- --exports.p = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- console.error(exports.inspect(arguments[i])); -- } --}, 'util.p: Use console.error() instead'); -- -- --exports.exec = exports.deprecate(function() { -- return require('child_process').exec.apply(this, arguments); --}, 'util.exec is now called `child_process.exec`.'); -- -- --exports.print = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stdout.write(String(arguments[i])); -- } --}, 'util.print: Use console.log instead'); -- -- --exports.puts = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stdout.write(arguments[i] + '\n'); -- } --}, 'util.puts: Use console.log instead'); -- -- --exports.debug = exports.deprecate(function(x) { -- process.stderr.write('DEBUG: ' + x + '\n'); --}, 'util.debug: Use console.error instead'); -- -- --exports.error = exports.deprecate(function(x) { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stderr.write(arguments[i] + '\n'); -- } --}, 'util.error: Use console.error instead'); -- -- --exports.pump = exports.deprecate(function(readStream, writeStream, callback) { -- var callbackCalled = false; -- -- function call(a, b, c) { -- if (callback && !callbackCalled) { -- callback(a, b, c); -- callbackCalled = true; -- } -- } -- -- readStream.addListener('data', function(chunk) { -- if (writeStream.write(chunk) === false) readStream.pause(); -- }); -- -- writeStream.addListener('drain', function() { -- readStream.resume(); -- }); -- -- readStream.addListener('end', function() { -- writeStream.end(); -- }); -- -- readStream.addListener('close', function() { -- call(); -- }); -- -- readStream.addListener('error', function(err) { -- writeStream.end(); -- call(err); -- }); -- -- writeStream.addListener('error', function(err) { -- readStream.destroy(); -- call(err); -- }); --}, 'util.pump(): Use readableStream.pipe() instead'); -- -- --var uv; --exports._errnoException = function(err, syscall) { -- if (isUndefined(uv)) uv = process.binding('uv'); -- var errname = uv.errname(err); -- var e = new Error(syscall + ' ' + errname); -- e.code = errname; -- e.errno = errname; -- e.syscall = syscall; -- return e; --}; -+} \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js deleted file mode 100644 index 9074e8ebcb61e9..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. -function isArray(ar) { - return Array.isArray(ar); -} -exports.isArray = isArray; - -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; - -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; - -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; - -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; - -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; - -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; - -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return isObject(re) && objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return isObject(d) && objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; - -function isError(e) { - return isObject(e) && - (objectToString(e) === '[object Error]' || e instanceof Error); -} -exports.isError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; - -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -function isBuffer(arg) { - return Buffer.isBuffer(arg); -} -exports.isBuffer = isBuffer; - -function objectToString(o) { - return Object.prototype.toString.call(o); -} \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json deleted file mode 100644 index 466dfdfe0139b3..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "core-util-is", - "version": "1.0.1", - "description": "The `util.is*` functions introduced in Node v0.12.", - "main": "lib/util.js", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/core-util-is.git" - }, - "keywords": [ - "util", - "isBuffer", - "isArray", - "isNumber", - "isString", - "isRegExp", - "isThis", - "isThat", - "polyfill" - ], - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/isaacs/core-util-is/issues" - }, - "readme": "# core-util-is\n\nThe `util.is*` functions introduced in Node v0.12.\n", - "readmeFilename": "README.md", - "homepage": "https://github.com/isaacs/core-util-is", - "_id": "core-util-is@1.0.1", - "dist": { - "shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538", - "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" - }, - "_from": "core-util-is@>=1.0.0 <1.1.0", - "_npmVersion": "1.3.23", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, - "_shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538", - "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" -} diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/util.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/util.js deleted file mode 100644 index 007fa10575636d..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/util.js +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. -function isArray(ar) { - return Array.isArray(ar); -} -exports.isArray = isArray; - -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; - -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; - -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; - -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; - -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; - -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; - -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return isObject(re) && objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return isObject(d) && objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; - -function isError(e) { - return isObject(e) && objectToString(e) === '[object Error]'; -} -exports.isError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; - -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -function isBuffer(arg) { - return arg instanceof Buffer; -} -exports.isBuffer = isBuffer; - -function objectToString(o) { - return Object.prototype.toString.call(o); -} diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md deleted file mode 100644 index 052a62b8d7b7ae..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -# isarray - -`Array#isArray` for older browsers. - -## Usage - -```js -var isArray = require('isarray'); - -console.log(isArray([])); // => true -console.log(isArray({})); // => false -``` - -## Installation - -With [npm](http://npmjs.org) do - -```bash -$ npm install isarray -``` - -Then bundle for the browser with -[browserify](https://github.com/substack/browserify). - -With [component](http://component.io) do - -```bash -$ component install juliangruber/isarray -``` - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js deleted file mode 100644 index e1856ef0943728..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js +++ /dev/null @@ -1,208 +0,0 @@ - -/** - * Require the given path. - * - * @param {String} path - * @return {Object} exports - * @api public - */ - -function require(path, parent, orig) { - var resolved = require.resolve(path); - - // lookup failed - if (null == resolved) { - orig = orig || path; - parent = parent || 'root'; - var err = new Error('Failed to require "' + orig + '" from "' + parent + '"'); - err.path = orig; - err.parent = parent; - err.require = true; - throw err; - } - - var module = require.modules[resolved]; - - // perform real require() - // by invoking the module's - // registered function - if (!module.exports) { - module.exports = {}; - module.client = module.component = true; - module.call(this, module.exports, require.relative(resolved), module); - } - - return module.exports; -} - -/** - * Registered modules. - */ - -require.modules = {}; - -/** - * Registered aliases. - */ - -require.aliases = {}; - -/** - * Resolve `path`. - * - * Lookup: - * - * - PATH/index.js - * - PATH.js - * - PATH - * - * @param {String} path - * @return {String} path or null - * @api private - */ - -require.resolve = function(path) { - if (path.charAt(0) === '/') path = path.slice(1); - var index = path + '/index.js'; - - var paths = [ - path, - path + '.js', - path + '.json', - path + '/index.js', - path + '/index.json' - ]; - - for (var i = 0; i < paths.length; i++) { - var path = paths[i]; - if (require.modules.hasOwnProperty(path)) return path; - } - - if (require.aliases.hasOwnProperty(index)) { - return require.aliases[index]; - } -}; - -/** - * Normalize `path` relative to the current path. - * - * @param {String} curr - * @param {String} path - * @return {String} - * @api private - */ - -require.normalize = function(curr, path) { - var segs = []; - - if ('.' != path.charAt(0)) return path; - - curr = curr.split('/'); - path = path.split('/'); - - for (var i = 0; i < path.length; ++i) { - if ('..' == path[i]) { - curr.pop(); - } else if ('.' != path[i] && '' != path[i]) { - segs.push(path[i]); - } - } - - return curr.concat(segs).join('/'); -}; - -/** - * Register module at `path` with callback `definition`. - * - * @param {String} path - * @param {Function} definition - * @api private - */ - -require.register = function(path, definition) { - require.modules[path] = definition; -}; - -/** - * Alias a module definition. - * - * @param {String} from - * @param {String} to - * @api private - */ - -require.alias = function(from, to) { - if (!require.modules.hasOwnProperty(from)) { - throw new Error('Failed to alias "' + from + '", it does not exist'); - } - require.aliases[to] = from; -}; - -/** - * Return a require function relative to the `parent` path. - * - * @param {String} parent - * @return {Function} - * @api private - */ - -require.relative = function(parent) { - var p = require.normalize(parent, '..'); - - /** - * lastIndexOf helper. - */ - - function lastIndexOf(arr, obj) { - var i = arr.length; - while (i--) { - if (arr[i] === obj) return i; - } - return -1; - } - - /** - * The relative require() itself. - */ - - function localRequire(path) { - var resolved = localRequire.resolve(path); - return require(resolved, parent, path); - } - - /** - * Resolve relative to the parent. - */ - - localRequire.resolve = function(path) { - var c = path.charAt(0); - if ('/' == c) return path.slice(1); - if ('.' == c) return require.normalize(p, path); - - // resolve deps by returning - // the dep in the nearest "deps" - // directory - var segs = parent.split('/'); - var i = lastIndexOf(segs, 'deps') + 1; - if (!i) i = 0; - path = segs.slice(0, i + 1).join('/') + '/deps/' + path; - return path; - }; - - /** - * Check if module is defined at `path`. - */ - - localRequire.exists = function(path) { - return require.modules.hasOwnProperty(localRequire.resolve(path)); - }; - - return localRequire; -}; -require.register("isarray/index.js", function(exports, require, module){ -module.exports = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; -}; - -}); -require.alias("isarray/index.js", "isarray/index.js"); diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json deleted file mode 100644 index 9e31b683889015..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name" : "isarray", - "description" : "Array#isArray for older browsers", - "version" : "0.0.1", - "repository" : "juliangruber/isarray", - "homepage": "https://github.com/juliangruber/isarray", - "main" : "index.js", - "scripts" : [ - "index.js" - ], - "dependencies" : {}, - "keywords": ["browser","isarray","array"], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT" -} diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js deleted file mode 100644 index 5f5ad45d46dda9..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; -}; diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json deleted file mode 100644 index 19228ab6fdcaaf..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "isarray", - "description": "Array#isArray for older browsers", - "version": "0.0.1", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/isarray.git" - }, - "homepage": "https://github.com/juliangruber/isarray", - "main": "index.js", - "scripts": { - "test": "tap test/*.js" - }, - "dependencies": {}, - "devDependencies": { - "tap": "*" - }, - "keywords": [ - "browser", - "isarray", - "array" - ], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT", - "_id": "isarray@0.0.1", - "dist": { - "shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", - "tarball": "http://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" - }, - "_from": "isarray@0.0.1", - "_npmVersion": "1.2.18", - "_npmUser": { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - "maintainers": [ - { - "name": "juliangruber", - "email": "julian@juliangruber.com" - } - ], - "directories": {}, - "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", - "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "bugs": { - "url": "https://github.com/juliangruber/isarray/issues" - }, - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml deleted file mode 100644 index 5ac98855343cee..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" - - "0.11" - - "0.12" - - "iojs" diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js deleted file mode 100644 index 049521cad7ba1b..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; -module.exports = nextTick; - -function nextTick(fn) { - var args = new Array(arguments.length - 1); - var i = 0; - while (i < args.length) { - args[i++] = arguments[i]; - } - process.nextTick(function afterTick() { - fn.apply(null, args); - }); -} diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json deleted file mode 100644 index 087586e8f8cedd..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "process-nextick-args", - "version": "1.0.3", - "description": "process.nextTick but always with args", - "main": "index.js", - "scripts": { - "test": "node test.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/calvinmetcalf/process-nextick-args.git" - }, - "author": "", - "license": "MIT", - "bugs": { - "url": "https://github.com/calvinmetcalf/process-nextick-args/issues" - }, - "homepage": "https://github.com/calvinmetcalf/process-nextick-args", - "devDependencies": { - "tap": "~0.2.6" - }, - "gitHead": "e855846a69662b9489f1ad3dde1ebf2ccc4370b8", - "_id": "process-nextick-args@1.0.3", - "_shasum": "e272eed825d5e9f4ea74d8d73b1fe311c3beb630", - "_from": "process-nextick-args@>=1.0.0 <1.1.0", - "_npmVersion": "2.9.0", - "_nodeVersion": "2.5.0", - "_npmUser": { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - }, - "dist": { - "shasum": "e272eed825d5e9f4ea74d8d73b1fe311c3beb630", - "tarball": "http://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.3.tgz" - }, - "maintainers": [ - { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.3.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/test.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/test.js deleted file mode 100644 index ef15721584ac99..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/test.js +++ /dev/null @@ -1,24 +0,0 @@ -var test = require("tap").test; -var nextTick = require('./'); - -test('should work', function (t) { - t.plan(5); - nextTick(function (a) { - t.ok(a); - nextTick(function (thing) { - t.equals(thing, 7); - }, 7); - }, true); - nextTick(function (a, b, c) { - t.equals(a, 'step'); - t.equals(b, 3); - t.equals(c, 'profit'); - }, 'step', 3, 'profit'); -}); - -test('correct number of arguments', function (t) { - t.plan(1); - nextTick(function () { - t.equals(2, arguments.length, 'correct number'); - }, 1, 2); -}); diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore deleted file mode 100644 index 206320cc1d21b9..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -build -test diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE deleted file mode 100644 index 6de584a48f5c89..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright Joyent, Inc. and other Node contributors. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to permit -persons to whom the Software is furnished to do so, subject to the -following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md deleted file mode 100644 index 4d2aa001501107..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md +++ /dev/null @@ -1,7 +0,0 @@ -**string_decoder.js** (`require('string_decoder')`) from Node.js core - -Copyright Joyent, Inc. and other Node contributors. See LICENCE file for details. - -Version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.** - -The *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version. \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js deleted file mode 100644 index b00e54fb790982..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -var Buffer = require('buffer').Buffer; - -var isBufferEncoding = Buffer.isEncoding - || function(encoding) { - switch (encoding && encoding.toLowerCase()) { - case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; - default: return false; - } - } - - -function assertEncoding(encoding) { - if (encoding && !isBufferEncoding(encoding)) { - throw new Error('Unknown encoding: ' + encoding); - } -} - -// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. CESU-8 is handled as part of the UTF-8 encoding. -// -// @TODO Handling all encodings inside a single object makes it very difficult -// to reason about this code, so it should be split up in the future. -// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code -// points as used by CESU-8. -var StringDecoder = exports.StringDecoder = function(encoding) { - this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); - assertEncoding(encoding); - switch (this.encoding) { - case 'utf8': - // CESU-8 represents each of Surrogate Pair by 3-bytes - this.surrogateSize = 3; - break; - case 'ucs2': - case 'utf16le': - // UTF-16 represents each of Surrogate Pair by 2-bytes - this.surrogateSize = 2; - this.detectIncompleteChar = utf16DetectIncompleteChar; - break; - case 'base64': - // Base-64 stores 3 bytes in 4 chars, and pads the remainder. - this.surrogateSize = 3; - this.detectIncompleteChar = base64DetectIncompleteChar; - break; - default: - this.write = passThroughWrite; - return; - } - - // Enough space to store all bytes of a single character. UTF-8 needs 4 - // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). - this.charBuffer = new Buffer(6); - // Number of bytes received for the current incomplete multi-byte character. - this.charReceived = 0; - // Number of bytes expected for the current incomplete multi-byte character. - this.charLength = 0; -}; - - -// write decodes the given buffer and returns it as JS string that is -// guaranteed to not contain any partial multi-byte characters. Any partial -// character found at the end of the buffer is buffered up, and will be -// returned when calling write again with the remaining bytes. -// -// Note: Converting a Buffer containing an orphan surrogate to a String -// currently works, but converting a String to a Buffer (via `new Buffer`, or -// Buffer#write) will replace incomplete surrogates with the unicode -// replacement character. See https://codereview.chromium.org/121173009/ . -StringDecoder.prototype.write = function(buffer) { - var charStr = ''; - // if our last write ended with an incomplete multibyte character - while (this.charLength) { - // determine how many remaining bytes this buffer has to offer for this char - var available = (buffer.length >= this.charLength - this.charReceived) ? - this.charLength - this.charReceived : - buffer.length; - - // add the new bytes to the char buffer - buffer.copy(this.charBuffer, this.charReceived, 0, available); - this.charReceived += available; - - if (this.charReceived < this.charLength) { - // still not enough chars in this buffer? wait for more ... - return ''; - } - - // remove bytes belonging to the current character from the buffer - buffer = buffer.slice(available, buffer.length); - - // get the character that was split - charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); - - // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - var charCode = charStr.charCodeAt(charStr.length - 1); - if (charCode >= 0xD800 && charCode <= 0xDBFF) { - this.charLength += this.surrogateSize; - charStr = ''; - continue; - } - this.charReceived = this.charLength = 0; - - // if there are no more bytes in this buffer, just emit our char - if (buffer.length === 0) { - return charStr; - } - break; - } - - // determine and set charLength / charReceived - this.detectIncompleteChar(buffer); - - var end = buffer.length; - if (this.charLength) { - // buffer the incomplete character bytes we got - buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); - end -= this.charReceived; - } - - charStr += buffer.toString(this.encoding, 0, end); - - var end = charStr.length - 1; - var charCode = charStr.charCodeAt(end); - // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - if (charCode >= 0xD800 && charCode <= 0xDBFF) { - var size = this.surrogateSize; - this.charLength += size; - this.charReceived += size; - this.charBuffer.copy(this.charBuffer, size, 0, size); - buffer.copy(this.charBuffer, 0, 0, size); - return charStr.substring(0, end); - } - - // or just emit the charStr - return charStr; -}; - -// detectIncompleteChar determines if there is an incomplete UTF-8 character at -// the end of the given buffer. If so, it sets this.charLength to the byte -// length that character, and sets this.charReceived to the number of bytes -// that are available for this character. -StringDecoder.prototype.detectIncompleteChar = function(buffer) { - // determine how many bytes we have to check at the end of this buffer - var i = (buffer.length >= 3) ? 3 : buffer.length; - - // Figure out if one of the last i bytes of our buffer announces an - // incomplete char. - for (; i > 0; i--) { - var c = buffer[buffer.length - i]; - - // See http://en.wikipedia.org/wiki/UTF-8#Description - - // 110XXXXX - if (i == 1 && c >> 5 == 0x06) { - this.charLength = 2; - break; - } - - // 1110XXXX - if (i <= 2 && c >> 4 == 0x0E) { - this.charLength = 3; - break; - } - - // 11110XXX - if (i <= 3 && c >> 3 == 0x1E) { - this.charLength = 4; - break; - } - } - this.charReceived = i; -}; - -StringDecoder.prototype.end = function(buffer) { - var res = ''; - if (buffer && buffer.length) - res = this.write(buffer); - - if (this.charReceived) { - var cr = this.charReceived; - var buf = this.charBuffer; - var enc = this.encoding; - res += buf.slice(0, cr).toString(enc); - } - - return res; -}; - -function passThroughWrite(buffer) { - return buffer.toString(this.encoding); -} - -function utf16DetectIncompleteChar(buffer) { - this.charReceived = buffer.length % 2; - this.charLength = this.charReceived ? 2 : 0; -} - -function base64DetectIncompleteChar(buffer) { - this.charReceived = buffer.length % 3; - this.charLength = this.charReceived ? 3 : 0; -} diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json deleted file mode 100644 index 0364d54ba46af6..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "string_decoder", - "version": "0.10.31", - "description": "The string_decoder module from Node core", - "main": "index.js", - "dependencies": {}, - "devDependencies": { - "tap": "~0.4.8" - }, - "scripts": { - "test": "tap test/simple/*.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/rvagg/string_decoder.git" - }, - "homepage": "https://github.com/rvagg/string_decoder", - "keywords": [ - "string", - "decoder", - "browser", - "browserify" - ], - "license": "MIT", - "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0", - "bugs": { - "url": "https://github.com/rvagg/string_decoder/issues" - }, - "_id": "string_decoder@0.10.31", - "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "_from": "string_decoder@>=0.10.0 <0.11.0", - "_npmVersion": "1.4.23", - "_npmUser": { - "name": "rvagg", - "email": "rod@vagg.org" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - }, - { - "name": "rvagg", - "email": "rod@vagg.org" - } - ], - "dist": { - "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/History.md b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/History.md deleted file mode 100644 index ec010299b1b259..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/History.md +++ /dev/null @@ -1,11 +0,0 @@ - -1.0.1 / 2014-11-25 -================== - - * browser: use `console.warn()` for deprecation calls - * browser: more jsdocs - -1.0.0 / 2014-04-30 -================== - - * initial commit diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/browser.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/browser.js deleted file mode 100644 index 55fa5a4bc6056a..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/browser.js +++ /dev/null @@ -1,62 +0,0 @@ - -/** - * Module exports. - */ - -module.exports = deprecate; - -/** - * Mark that a method should not be used. - * Returns a modified function which warns once by default. - * - * If `localStorage.noDeprecation = true` is set, then it is a no-op. - * - * If `localStorage.throwDeprecation = true` is set, then deprecated functions - * will throw an Error when invoked. - * - * If `localStorage.traceDeprecation = true` is set, then deprecated functions - * will invoke `console.trace()` instead of `console.error()`. - * - * @param {Function} fn - the function to deprecate - * @param {String} msg - the string to print to the console when `fn` is invoked - * @returns {Function} a new "deprecated" version of `fn` - * @api public - */ - -function deprecate (fn, msg) { - if (config('noDeprecation')) { - return fn; - } - - var warned = false; - function deprecated() { - if (!warned) { - if (config('throwDeprecation')) { - throw new Error(msg); - } else if (config('traceDeprecation')) { - console.trace(msg); - } else { - console.warn(msg); - } - warned = true; - } - return fn.apply(this, arguments); - } - - return deprecated; -} - -/** - * Checks `localStorage` for boolean values for the given `name`. - * - * @param {String} name - * @returns {Boolean} - * @api private - */ - -function config (name) { - if (!global.localStorage) return false; - var val = global.localStorage[name]; - if (null == val) return false; - return String(val).toLowerCase() === 'true'; -} diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json deleted file mode 100644 index ea487da0e43000..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "util-deprecate", - "version": "1.0.1", - "description": "The Node.js `util.deprecate()` function with browser support", - "main": "node.js", - "browser": "browser.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/util-deprecate.git" - }, - "keywords": [ - "util", - "deprecate", - "browserify", - "browser", - "node" - ], - "author": { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://n8.io/" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/TooTallNate/util-deprecate/issues" - }, - "homepage": "https://github.com/TooTallNate/util-deprecate", - "gitHead": "6e923f7d98a0afbe5b9c7db9d0f0029c1936746c", - "_id": "util-deprecate@1.0.1", - "_shasum": "3556a3d13c4c6aa7983d7e2425478197199b7881", - "_from": "util-deprecate@>=1.0.1 <1.1.0", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - }, - "maintainers": [ - { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - } - ], - "dist": { - "shasum": "3556a3d13c4c6aa7983d7e2425478197199b7881", - "tarball": "http://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json deleted file mode 100644 index 70ad998cae2d45..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "readable-stream", - "version": "2.0.2", - "description": "Streams3, a user-land copy of the stream library from iojs v2.x", - "main": "readable.js", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "process-nextick-args": "~1.0.0", - "string_decoder": "~0.10.x", - "util-deprecate": "~1.0.1" - }, - "devDependencies": { - "tap": "~0.2.6", - "tape": "~4.0.0", - "zuul": "~3.0.0" - }, - "scripts": { - "test": "tap test/parallel/*.js", - "browser": "zuul --browser-name $BROWSER_NAME --browser-version $BROWSER_VERSION -- test/browser.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/nodejs/readable-stream.git" - }, - "keywords": [ - "readable", - "stream", - "pipe" - ], - "browser": { - "util": false - }, - "license": "MIT", - "gitHead": "1a70134a71196eeabb5e27bc7580faaa68d30513", - "bugs": { - "url": "https://github.com/nodejs/readable-stream/issues" - }, - "homepage": "https://github.com/nodejs/readable-stream#readme", - "_id": "readable-stream@2.0.2", - "_shasum": "bec81beae8cf455168bc2e5b2b31f5bcfaed9b1b", - "_from": "readable-stream@>=2.0.0 <2.1.0", - "_npmVersion": "2.11.1", - "_nodeVersion": "2.3.0", - "_npmUser": { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - }, - "dist": { - "shasum": "bec81beae8cf455168bc2e5b2b31f5bcfaed9b1b", - "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.2.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - }, - { - "name": "rvagg", - "email": "rod@vagg.org" - }, - { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.2.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js deleted file mode 100644 index 27e8d8a55165f9..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_passthrough.js") diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js deleted file mode 100644 index 6222a579864dd2..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js +++ /dev/null @@ -1,12 +0,0 @@ -var Stream = (function (){ - try { - return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify - } catch(_){} -}()); -exports = module.exports = require('./lib/_stream_readable.js'); -exports.Stream = Stream || exports; -exports.Readable = exports; -exports.Writable = require('./lib/_stream_writable.js'); -exports.Duplex = require('./lib/_stream_duplex.js'); -exports.Transform = require('./lib/_stream_transform.js'); -exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js deleted file mode 100644 index 5d482f0780e993..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_transform.js") diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js deleted file mode 100644 index e1e9efdf3c12e9..00000000000000 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_writable.js") diff --git a/deps/npm/node_modules/request/node_modules/bl/package.json b/deps/npm/node_modules/request/node_modules/bl/package.json index 1513847030a9eb..61b85c1393794e 100644 --- a/deps/npm/node_modules/request/node_modules/bl/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/package.json @@ -1,62 +1,87 @@ { - "name": "bl", - "version": "1.0.0", - "description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!", - "main": "bl.js", - "scripts": { - "test": "node test/test.js | faucet", - "test-local": "brtapsauce-local test/basic-test.js" + "_args": [ + [ + "bl@~1.0.0", + "/Users/rebecca/code/npm/node_modules/request" + ] + ], + "_from": "bl@>=1.0.0 <1.1.0", + "_id": "bl@1.0.1", + "_inCache": true, + "_installable": true, + "_location": "/request/bl", + "_nodeVersion": "6.0.0-nightly2016011666b9c0d8bd", + "_npmUser": { + "email": "rod@vagg.org", + "name": "rvagg" }, - "repository": { - "type": "git", - "url": "git+https://github.com/rvagg/bl.git" + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "name": "bl", + "raw": "bl@~1.0.0", + "rawSpec": "~1.0.0", + "scope": null, + "spec": ">=1.0.0 <1.1.0", + "type": "range" }, - "homepage": "https://github.com/rvagg/bl", + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.npmjs.org/bl/-/bl-1.0.1.tgz", + "_shasum": "0e6df7330308c46515751676cafa7334dc9852fd", + "_shrinkwrap": null, + "_spec": "bl@~1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/request", "authors": [ - "Rod Vagg (https://github.com/rvagg)", + "Jarett Cruger (https://github.com/jcrugzz)", "Matteo Collina (https://github.com/mcollina)", - "Jarett Cruger (https://github.com/jcrugzz)" - ], - "keywords": [ - "buffer", - "buffers", - "stream", - "awesomesauce" + "Rod Vagg (https://github.com/rvagg)" ], - "license": "MIT", + "bugs": { + "url": "https://github.com/rvagg/bl/issues" + }, "dependencies": { - "readable-stream": "~2.0.0" + "readable-stream": "~2.0.5" }, + "description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!", "devDependencies": { - "tape": "~2.12.3", - "hash_file": "~0.1.1", + "brtapsauce": "~0.3.0", "faucet": "~0.0.1", - "brtapsauce": "~0.3.0" - }, - "gitHead": "1794938be6697a6d1e02cd942a4eea59b353347a", - "bugs": { - "url": "https://github.com/rvagg/bl/issues" + "hash_file": "~0.1.1", + "tape": "~2.12.3" }, - "_id": "bl@1.0.0", - "_shasum": "ada9a8a89a6d7ac60862f7dec7db207873e0c3f5", - "_from": "bl@>=1.0.0 <1.1.0", - "_npmVersion": "2.9.0", - "_nodeVersion": "2.0.1-nightly20150618d2e4e03444", - "_npmUser": { - "name": "rvagg", - "email": "rod@vagg.org" + "directories": {}, + "dist": { + "shasum": "0e6df7330308c46515751676cafa7334dc9852fd", + "tarball": "http://registry.npmjs.org/bl/-/bl-1.0.1.tgz" }, + "gitHead": "9eced07e8c4f4b44b42e6e99ac33d4c390b4e74a", + "homepage": "https://github.com/rvagg/bl", + "keywords": [ + "awesomesauce", + "buffer", + "buffers", + "stream" + ], + "license": "MIT", + "main": "bl.js", "maintainers": [ { "name": "rvagg", "email": "rod@vagg.org" } ], - "dist": { - "shasum": "ada9a8a89a6d7ac60862f7dec7db207873e0c3f5", - "tarball": "http://registry.npmjs.org/bl/-/bl-1.0.0.tgz" + "name": "bl", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/rvagg/bl.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/bl/-/bl-1.0.0.tgz", - "readme": "ERROR: No README data found!" + "scripts": { + "test": "node test/test.js | faucet", + "test-local": "brtapsauce-local test/basic-test.js" + }, + "version": "1.0.1" } diff --git a/deps/npm/node_modules/request/node_modules/bl/test/basic-test.js b/deps/npm/node_modules/request/node_modules/bl/test/basic-test.js index 75116a30f4e40e..92572642ff7c65 100644 --- a/deps/npm/node_modules/request/node_modules/bl/test/basic-test.js +++ b/deps/npm/node_modules/request/node_modules/bl/test/basic-test.js @@ -336,6 +336,22 @@ tape('test String appendage', function (t) { t.end() }) +tape('test Number appendage', function (t) { + var bl = new BufferList() + , b = new Buffer('1234567890') + + bl.append(1234) + bl.append(567) + bl.append(89) + bl.append(0) + + encodings.forEach(function (enc) { + t.equal(bl.toString(enc), b.toString(enc)) + }) + + t.end() +}) + tape('write nothing, should get empty buffer', function (t) { t.plan(3) BufferList(function (err, data) { diff --git a/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile index b4ff85a33b6eb4..2d7580746d0b84 100644 --- a/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile +++ b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile @@ -4,4 +4,3 @@ test: @./test/run.js .PHONY: test - diff --git a/deps/npm/node_modules/request/node_modules/combined-stream/package.json b/deps/npm/node_modules/request/node_modules/combined-stream/package.json index 10339866f9134b..e0cd160ff6dbe5 100644 --- a/deps/npm/node_modules/request/node_modules/combined-stream/package.json +++ b/deps/npm/node_modules/request/node_modules/combined-stream/package.json @@ -32,7 +32,7 @@ }, "_id": "combined-stream@1.0.5", "_shasum": "938370a57b4a51dea2c77c15d5c5fdf895164009", - "_from": "combined-stream@>=1.0.1 <1.1.0", + "_from": "combined-stream@>=1.0.5 <1.1.0", "_npmVersion": "2.10.1", "_nodeVersion": "0.12.4", "_npmUser": { diff --git a/deps/npm/node_modules/request/node_modules/forever-agent/index.js b/deps/npm/node_modules/request/node_modules/forever-agent/index.js index 416c7abd709233..d7276fd97391c6 100644 --- a/deps/npm/node_modules/request/node_modules/forever-agent/index.js +++ b/deps/npm/node_modules/request/node_modules/forever-agent/index.js @@ -6,8 +6,8 @@ var util = require('util') , net = require('net') , tls = require('tls') , AgentSSL = require('https').Agent - -function getConnectionName(host, port) { + +function getConnectionName(host, port) { var name = '' if (typeof host === 'string') { name = host + ':' + port @@ -16,7 +16,7 @@ function getConnectionName(host, port) { name = host.host + ':' + host.port + ':' + (host.localAddress ? (host.localAddress + ':') : ':') } return name -} +} function ForeverAgent(options) { var self = this @@ -34,7 +34,7 @@ function ForeverAgent(options) { } else if (self.sockets[name].length < self.minSockets) { if (!self.freeSockets[name]) self.freeSockets[name] = [] self.freeSockets[name].push(socket) - + // if an error happens while we don't use the socket anyway, meh, throw the socket away var onIdleError = function() { socket.destroy() @@ -60,7 +60,7 @@ ForeverAgent.prototype.createConnection = net.createConnection ForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest ForeverAgent.prototype.addRequest = function(req, host, port) { var name = getConnectionName(host, port) - + if (typeof host !== 'string') { var options = host port = options.port @@ -89,7 +89,7 @@ ForeverAgent.prototype.removeSocket = function(s, name, host, port) { delete this.sockets[name] delete this.requests[name] } - + if (this.freeSockets[name]) { var index = this.freeSockets[name].indexOf(s) if (index !== -1) { diff --git a/deps/npm/node_modules/request/node_modules/forever-agent/package.json b/deps/npm/node_modules/request/node_modules/forever-agent/package.json index ef074a51063a85..1d672c1c9a885e 100644 --- a/deps/npm/node_modules/request/node_modules/forever-agent/package.json +++ b/deps/npm/node_modules/request/node_modules/forever-agent/package.json @@ -18,39 +18,14 @@ "engines": { "node": "*" }, - "gitHead": "1b3b6163f2b3c2c4122bbfa288c1325c0df9871d", + "readme": "forever-agent\n=============\n\nHTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/mikeal/forever-agent/issues" }, - "homepage": "https://github.com/mikeal/forever-agent", + "homepage": "https://github.com/mikeal/forever-agent#readme", "_id": "forever-agent@0.6.1", - "scripts": {}, "_shasum": "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91", - "_from": "forever-agent@>=0.6.0 <0.7.0", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "simov", - "email": "simeonvelichkov@gmail.com" - }, - "maintainers": [ - { - "name": "mikeal", - "email": "mikeal.rogers@gmail.com" - }, - { - "name": "nylen", - "email": "jnylen@gmail.com" - }, - { - "name": "simov", - "email": "simeonvelichkov@gmail.com" - } - ], - "dist": { - "shasum": "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91", - "tarball": "http://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz" - }, - "directories": {}, "_resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "readme": "ERROR: No README data found!" + "_from": "forever-agent@>=0.6.1 <0.7.0" } diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md index b0ffd4f3b6bc1e..fcb2b2c0c90711 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md @@ -1,3 +1,24 @@ +# v1.5.2 +- Allow using `"consructor"` as an argument in `memoize` (#998) +- Give a better error messsage when `auto` dependency checking fails (#994) +- Various doc updates (#936, #956, #979, #1002) + +# v1.5.1 +- Fix issue with `pause` in `queue` with concurrency enabled (#946) +- `while` and `until` now pass the final result to callback (#963) +- `auto` will properly handle concurrency when there is no callback (#966) +- `auto` will now properly stop execution when an error occurs (#988, #993) +- Various doc fixes (#971, #980) + +# v1.5.0 + +- Added `transform`, analogous to [`_.transform`](http://lodash.com/docs#transform) (#892) +- `map` now returns an object when an object is passed in, rather than array with non-numeric keys. `map` will begin always returning an array with numeric indexes in the next major release. (#873) +- `auto` now accepts an optional `concurrency` argument to limit the number of running tasks (#637) +- Added `queue#workersList()`, to retrieve the list of currently running tasks. (#891) +- Various code simplifications (#896, #904) +- Various doc fixes :scroll: (#890, #894, #903, #905, #912) + # v1.4.2 - Ensure coverage files don't get published on npm (#879) diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md new file mode 100644 index 00000000000000..3a0f017719b309 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md @@ -0,0 +1,1877 @@ +# Async.js + +[![Build Status via Travis CI](https://travis-ci.org/caolan/async.svg?branch=master)](https://travis-ci.org/caolan/async) +[![NPM version](http://img.shields.io/npm/v/async.svg)](https://www.npmjs.org/package/async) +[![Coverage Status](https://coveralls.io/repos/caolan/async/badge.svg?branch=master)](https://coveralls.io/r/caolan/async?branch=master) +[![Join the chat at https://gitter.im/caolan/async](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/caolan/async?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + + +Async is a utility module which provides straight-forward, powerful functions +for working with asynchronous JavaScript. Although originally designed for +use with [Node.js](http://nodejs.org) and installable via `npm install async`, +it can also be used directly in the browser. + +Async is also installable via: + +- [bower](http://bower.io/): `bower install async` +- [component](https://github.com/component/component): `component install + caolan/async` +- [jam](http://jamjs.org/): `jam install async` +- [spm](http://spmjs.io/): `spm install async` + +Async provides around 20 functions that include the usual 'functional' +suspects (`map`, `reduce`, `filter`, `each`…) as well as some common patterns +for asynchronous control flow (`parallel`, `series`, `waterfall`…). All these +functions assume you follow the Node.js convention of providing a single +callback as the last argument of your `async` function. + + +## Quick Examples + +```javascript +async.map(['file1','file2','file3'], fs.stat, function(err, results){ + // results is now an array of stats for each file +}); + +async.filter(['file1','file2','file3'], fs.exists, function(results){ + // results now equals an array of the existing files +}); + +async.parallel([ + function(){ ... }, + function(){ ... } +], callback); + +async.series([ + function(){ ... }, + function(){ ... } +]); +``` + +There are many more functions available so take a look at the docs below for a +full list. This module aims to be comprehensive, so if you feel anything is +missing please create a GitHub issue for it. + +## Common Pitfalls [(StackOverflow)](http://stackoverflow.com/questions/tagged/async.js) +### Synchronous iteration functions + +If you get an error like `RangeError: Maximum call stack size exceeded.` or other stack overflow issues when using async, you are likely using a synchronous iterator. By *synchronous* we mean a function that calls its callback on the same tick in the javascript event loop, without doing any I/O or using any timers. Calling many callbacks iteratively will quickly overflow the stack. If you run into this issue, just defer your callback with `async.setImmediate` to start a new call stack on the next tick of the event loop. + +This can also arise by accident if you callback early in certain cases: + +```js +async.eachSeries(hugeArray, function iterator(item, callback) { + if (inCache(item)) { + callback(null, cache[item]); // if many items are cached, you'll overflow + } else { + doSomeIO(item, callback); + } +}, function done() { + //... +}); +``` + +Just change it to: + +```js +async.eachSeries(hugeArray, function iterator(item, callback) { + if (inCache(item)) { + async.setImmediate(function () { + callback(null, cache[item]); + }); + } else { + doSomeIO(item, callback); + //... +``` + +Async guards against synchronous functions in some, but not all, cases. If you are still running into stack overflows, you can defer as suggested above, or wrap functions with [`async.ensureAsync`](#ensureAsync) Functions that are asynchronous by their nature do not have this problem and don't need the extra callback deferral. + +If JavaScript's event loop is still a bit nebulous, check out [this article](http://blog.carbonfive.com/2013/10/27/the-javascript-event-loop-explained/) or [this talk](http://2014.jsconf.eu/speakers/philip-roberts-what-the-heck-is-the-event-loop-anyway.html) for more detailed information about how it works. + + +### Multiple callbacks + +Make sure to always `return` when calling a callback early, otherwise you will cause multiple callbacks and unpredictable behavior in many cases. + +```js +async.waterfall([ + function (callback) { + getSomething(options, function (err, result) { + if (err) { + callback(new Error("failed getting something:" + err.message)); + // we should return here + } + // since we did not return, this callback still will be called and + // `processData` will be called twice + callback(null, result); + }); + }, + processData +], done) +``` + +It is always good practice to `return callback(err, result)` whenever a callback call is not the last statement of a function. + + +### Binding a context to an iterator + +This section is really about `bind`, not about `async`. If you are wondering how to +make `async` execute your iterators in a given context, or are confused as to why +a method of another library isn't working as an iterator, study this example: + +```js +// Here is a simple object with an (unnecessarily roundabout) squaring method +var AsyncSquaringLibrary = { + squareExponent: 2, + square: function(number, callback){ + var result = Math.pow(number, this.squareExponent); + setTimeout(function(){ + callback(null, result); + }, 200); + } +}; + +async.map([1, 2, 3], AsyncSquaringLibrary.square, function(err, result){ + // result is [NaN, NaN, NaN] + // This fails because the `this.squareExponent` expression in the square + // function is not evaluated in the context of AsyncSquaringLibrary, and is + // therefore undefined. +}); + +async.map([1, 2, 3], AsyncSquaringLibrary.square.bind(AsyncSquaringLibrary), function(err, result){ + // result is [1, 4, 9] + // With the help of bind we can attach a context to the iterator before + // passing it to async. Now the square function will be executed in its + // 'home' AsyncSquaringLibrary context and the value of `this.squareExponent` + // will be as expected. +}); +``` + +## Download + +The source is available for download from +[GitHub](https://github.com/caolan/async/blob/master/lib/async.js). +Alternatively, you can install using Node Package Manager (`npm`): + + npm install async + +As well as using Bower: + + bower install async + +__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 29.6kb Uncompressed + +## In the Browser + +So far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. + +Usage: + +```html + + +``` + +## Documentation + +Some functions are also available in the following forms: +* `Series` - the same as `` but runs only a single async operation at a time +* `Limit` - the same as `` but runs a maximum of `limit` async operations at a time + +### Collections + +* [`each`](#each), `eachSeries`, `eachLimit` +* [`forEachOf`](#forEachOf), `forEachOfSeries`, `forEachOfLimit` +* [`map`](#map), `mapSeries`, `mapLimit` +* [`filter`](#filter), `filterSeries`, `filterLimit` +* [`reject`](#reject), `rejectSeries`, `rejectLimit` +* [`reduce`](#reduce), [`reduceRight`](#reduceRight) +* [`detect`](#detect), `detectSeries`, `detectLimit` +* [`sortBy`](#sortBy) +* [`some`](#some), `someLimit` +* [`every`](#every), `everyLimit` +* [`concat`](#concat), `concatSeries` + +### Control Flow + +* [`series`](#seriestasks-callback) +* [`parallel`](#parallel), `parallelLimit` +* [`whilst`](#whilst), [`doWhilst`](#doWhilst) +* [`until`](#until), [`doUntil`](#doUntil) +* [`during`](#during), [`doDuring`](#doDuring) +* [`forever`](#forever) +* [`waterfall`](#waterfall) +* [`compose`](#compose) +* [`seq`](#seq) +* [`applyEach`](#applyEach), `applyEachSeries` +* [`queue`](#queue), [`priorityQueue`](#priorityQueue) +* [`cargo`](#cargo) +* [`auto`](#auto) +* [`retry`](#retry) +* [`iterator`](#iterator) +* [`times`](#times), `timesSeries`, `timesLimit` + +### Utils + +* [`apply`](#apply) +* [`nextTick`](#nextTick) +* [`memoize`](#memoize) +* [`unmemoize`](#unmemoize) +* [`ensureAsync`](#ensureAsync) +* [`constant`](#constant) +* [`asyncify`](#asyncify) +* [`wrapSync`](#wrapSync) +* [`log`](#log) +* [`dir`](#dir) +* [`noConflict`](#noConflict) + +## Collections + +
      + +### each(arr, iterator, [callback]) + +Applies the function `iterator` to each item in `arr`, in parallel. +The `iterator` is called with an item from the list, and a callback for when it +has finished. If the `iterator` passes an error to its `callback`, the main +`callback` (for the `each` function) is immediately called with the error. + +Note, that since this function applies `iterator` to each item in parallel, +there is no guarantee that the iterator functions will complete in order. + +__Arguments__ + +* `arr` - An array to iterate over. +* `iterator(item, callback)` - A function to apply to each item in `arr`. + The iterator is passed a `callback(err)` which must be called once it has + completed. If no error has occurred, the `callback` should be run without + arguments or with an explicit `null` argument. The array index is not passed + to the iterator. If you need the index, use [`forEachOf`](#forEachOf). +* `callback(err)` - *Optional* A callback which is called when all `iterator` functions + have finished, or an error occurs. + +__Examples__ + + +```js +// assuming openFiles is an array of file names and saveFile is a function +// to save the modified contents of that file: + +async.each(openFiles, saveFile, function(err){ + // if any of the saves produced an error, err would equal that error +}); +``` + +```js +// assuming openFiles is an array of file names + +async.each(openFiles, function(file, callback) { + + // Perform operation on file here. + console.log('Processing file ' + file); + + if( file.length > 32 ) { + console.log('This file name is too long'); + callback('File name too long'); + } else { + // Do work to process file here + console.log('File processed'); + callback(); + } +}, function(err){ + // if any of the file processing produced an error, err would equal that error + if( err ) { + // One of the iterations produced an error. + // All processing will now stop. + console.log('A file failed to process'); + } else { + console.log('All files have been processed successfully'); + } +}); +``` + +__Related__ + +* eachSeries(arr, iterator, [callback]) +* eachLimit(arr, limit, iterator, [callback]) + +--------------------------------------- + + + + +### forEachOf(obj, iterator, [callback]) + +Like `each`, except that it iterates over objects, and passes the key as the second argument to the iterator. + +__Arguments__ + +* `obj` - An object or array to iterate over. +* `iterator(item, key, callback)` - A function to apply to each item in `obj`. +The `key` is the item's key, or index in the case of an array. The iterator is +passed a `callback(err)` which must be called once it has completed. If no +error has occurred, the callback should be run without arguments or with an +explicit `null` argument. +* `callback(err)` - *Optional* A callback which is called when all `iterator` functions have finished, or an error occurs. + +__Example__ + +```js +var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"}; +var configs = {}; + +async.forEachOf(obj, function (value, key, callback) { + fs.readFile(__dirname + value, "utf8", function (err, data) { + if (err) return callback(err); + try { + configs[key] = JSON.parse(data); + } catch (e) { + return callback(e); + } + callback(); + }) +}, function (err) { + if (err) console.error(err.message); + // configs is now a map of JSON data + doSomethingWith(configs); +}) +``` + +__Related__ + +* forEachOfSeries(obj, iterator, [callback]) +* forEachOfLimit(obj, limit, iterator, [callback]) + +--------------------------------------- + + +### map(arr, iterator, [callback]) + +Produces a new array of values by mapping each value in `arr` through +the `iterator` function. The `iterator` is called with an item from `arr` and a +callback for when it has finished processing. Each of these callback takes 2 arguments: +an `error`, and the transformed item from `arr`. If `iterator` passes an error to its +callback, the main `callback` (for the `map` function) is immediately called with the error. + +Note, that since this function applies the `iterator` to each item in parallel, +there is no guarantee that the `iterator` functions will complete in order. +However, the results array will be in the same order as the original `arr`. + +__Arguments__ + +* `arr` - An array to iterate over. +* `iterator(item, callback)` - A function to apply to each item in `arr`. + The iterator is passed a `callback(err, transformed)` which must be called once + it has completed with an error (which can be `null`) and a transformed item. +* `callback(err, results)` - *Optional* A callback which is called when all `iterator` + functions have finished, or an error occurs. Results is an array of the + transformed items from the `arr`. + +__Example__ + +```js +async.map(['file1','file2','file3'], fs.stat, function(err, results){ + // results is now an array of stats for each file +}); +``` + +__Related__ +* mapSeries(arr, iterator, [callback]) +* mapLimit(arr, limit, iterator, [callback]) + +--------------------------------------- + + + +### filter(arr, iterator, [callback]) + +__Alias:__ `select` + +Returns a new array of all the values in `arr` which pass an async truth test. +_The callback for each `iterator` call only accepts a single argument of `true` or +`false`; it does not accept an error argument first!_ This is in-line with the +way node libraries work with truth tests like `fs.exists`. This operation is +performed in parallel, but the results array will be in the same order as the +original. + +__Arguments__ + +* `arr` - An array to iterate over. +* `iterator(item, callback)` - A truth test to apply to each item in `arr`. + The `iterator` is passed a `callback(truthValue)`, which must be called with a + boolean argument once it has completed. +* `callback(results)` - *Optional* A callback which is called after all the `iterator` + functions have finished. + +__Example__ + +```js +async.filter(['file1','file2','file3'], fs.exists, function(results){ + // results now equals an array of the existing files +}); +``` + +__Related__ + +* filterSeries(arr, iterator, [callback]) +* filterLimit(arr, limit, iterator, [callback]) + +--------------------------------------- + + +### reject(arr, iterator, [callback]) + +The opposite of [`filter`](#filter). Removes values that pass an `async` truth test. + +__Related__ + +* rejectSeries(arr, iterator, [callback]) +* rejectLimit(arr, limit, iterator, [callback]) + +--------------------------------------- + + +### reduce(arr, memo, iterator, [callback]) + +__Aliases:__ `inject`, `foldl` + +Reduces `arr` into a single value using an async `iterator` to return +each successive step. `memo` is the initial state of the reduction. +This function only operates in series. + +For performance reasons, it may make sense to split a call to this function into +a parallel map, and then use the normal `Array.prototype.reduce` on the results. +This function is for situations where each step in the reduction needs to be async; +if you can get the data before reducing it, then it's probably a good idea to do so. + +__Arguments__ + +* `arr` - An array to iterate over. +* `memo` - The initial state of the reduction. +* `iterator(memo, item, callback)` - A function applied to each item in the + array to produce the next step in the reduction. The `iterator` is passed a + `callback(err, reduction)` which accepts an optional error as its first + argument, and the state of the reduction as the second. If an error is + passed to the callback, the reduction is stopped and the main `callback` is + immediately called with the error. +* `callback(err, result)` - *Optional* A callback which is called after all the `iterator` + functions have finished. Result is the reduced value. + +__Example__ + +```js +async.reduce([1,2,3], 0, function(memo, item, callback){ + // pointless async: + process.nextTick(function(){ + callback(null, memo + item) + }); +}, function(err, result){ + // result is now equal to the last value of memo, which is 6 +}); +``` + +--------------------------------------- + + +### reduceRight(arr, memo, iterator, [callback]) + +__Alias:__ `foldr` + +Same as [`reduce`](#reduce), only operates on `arr` in reverse order. + + +--------------------------------------- + + +### detect(arr, iterator, [callback]) + +Returns the first value in `arr` that passes an async truth test. The +`iterator` is applied in parallel, meaning the first iterator to return `true` will +fire the detect `callback` with that result. That means the result might not be +the first item in the original `arr` (in terms of order) that passes the test. + +If order within the original `arr` is important, then look at [`detectSeries`](#detectSeries). + +__Arguments__ + +* `arr` - An array to iterate over. +* `iterator(item, callback)` - A truth test to apply to each item in `arr`. + The iterator is passed a `callback(truthValue)` which must be called with a + boolean argument once it has completed. **Note: this callback does not take an error as its first argument.** +* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns + `true`, or after all the `iterator` functions have finished. Result will be + the first item in the array that passes the truth test (iterator) or the + value `undefined` if none passed. **Note: this callback does not take an error as its first argument.** + +__Example__ + +```js +async.detect(['file1','file2','file3'], fs.exists, function(result){ + // result now equals the first file in the list that exists +}); +``` + +__Related__ + +* detectSeries(arr, iterator, [callback]) +* detectLimit(arr, limit, iterator, [callback]) + +--------------------------------------- + + +### sortBy(arr, iterator, [callback]) + +Sorts a list by the results of running each `arr` value through an async `iterator`. + +__Arguments__ + +* `arr` - An array to iterate over. +* `iterator(item, callback)` - A function to apply to each item in `arr`. + The iterator is passed a `callback(err, sortValue)` which must be called once it + has completed with an error (which can be `null`) and a value to use as the sort + criteria. +* `callback(err, results)` - *Optional* A callback which is called after all the `iterator` + functions have finished, or an error occurs. Results is the items from + the original `arr` sorted by the values returned by the `iterator` calls. + +__Example__ + +```js +async.sortBy(['file1','file2','file3'], function(file, callback){ + fs.stat(file, function(err, stats){ + callback(err, stats.mtime); + }); +}, function(err, results){ + // results is now the original array of files sorted by + // modified date +}); +``` + +__Sort Order__ + +By modifying the callback parameter the sorting order can be influenced: + +```js +//ascending order +async.sortBy([1,9,3,5], function(x, callback){ + callback(null, x); +}, function(err,result){ + //result callback +} ); + +//descending order +async.sortBy([1,9,3,5], function(x, callback){ + callback(null, x*-1); //<- x*-1 instead of x, turns the order around +}, function(err,result){ + //result callback +} ); +``` + +--------------------------------------- + + +### some(arr, iterator, [callback]) + +__Alias:__ `any` + +Returns `true` if at least one element in the `arr` satisfies an async test. +_The callback for each iterator call only accepts a single argument of `true` or +`false`; it does not accept an error argument first!_ This is in-line with the +way node libraries work with truth tests like `fs.exists`. Once any iterator +call returns `true`, the main `callback` is immediately called. + +__Arguments__ + +* `arr` - An array to iterate over. +* `iterator(item, callback)` - A truth test to apply to each item in the array + in parallel. The iterator is passed a `callback(truthValue)`` which must be + called with a boolean argument once it has completed. +* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns + `true`, or after all the iterator functions have finished. Result will be + either `true` or `false` depending on the values of the async tests. + + **Note: the callbacks do not take an error as their first argument.** +__Example__ + +```js +async.some(['file1','file2','file3'], fs.exists, function(result){ + // if result is true then at least one of the files exists +}); +``` + +__Related__ + +* someLimit(arr, limit, iterator, callback) + +--------------------------------------- + + +### every(arr, iterator, [callback]) + +__Alias:__ `all` + +Returns `true` if every element in `arr` satisfies an async test. +_The callback for each `iterator` call only accepts a single argument of `true` or +`false`; it does not accept an error argument first!_ This is in-line with the +way node libraries work with truth tests like `fs.exists`. + +__Arguments__ + +* `arr` - An array to iterate over. +* `iterator(item, callback)` - A truth test to apply to each item in the array + in parallel. The iterator is passed a `callback(truthValue)` which must be + called with a boolean argument once it has completed. +* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns + `false`, or after all the iterator functions have finished. Result will be + either `true` or `false` depending on the values of the async tests. + + **Note: the callbacks do not take an error as their first argument.** + +__Example__ + +```js +async.every(['file1','file2','file3'], fs.exists, function(result){ + // if result is true then every file exists +}); +``` + +__Related__ + +* everyLimit(arr, limit, iterator, callback) + +--------------------------------------- + + +### concat(arr, iterator, [callback]) + +Applies `iterator` to each item in `arr`, concatenating the results. Returns the +concatenated list. The `iterator`s are called in parallel, and the results are +concatenated as they return. There is no guarantee that the results array will +be returned in the original order of `arr` passed to the `iterator` function. + +__Arguments__ + +* `arr` - An array to iterate over. +* `iterator(item, callback)` - A function to apply to each item in `arr`. + The iterator is passed a `callback(err, results)` which must be called once it + has completed with an error (which can be `null`) and an array of results. +* `callback(err, results)` - *Optional* A callback which is called after all the `iterator` + functions have finished, or an error occurs. Results is an array containing + the concatenated results of the `iterator` function. + +__Example__ + +```js +async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){ + // files is now a list of filenames that exist in the 3 directories +}); +``` + +__Related__ + +* concatSeries(arr, iterator, [callback]) + + +## Control Flow + + +### series(tasks, [callback]) + +Run the functions in the `tasks` array in series, each one running once the previous +function has completed. If any functions in the series pass an error to its +callback, no more functions are run, and `callback` is immediately called with the value of the error. +Otherwise, `callback` receives an array of results when `tasks` have completed. + +It is also possible to use an object instead of an array. Each property will be +run as a function, and the results will be passed to the final `callback` as an object +instead of an array. This can be a more readable way of handling results from +[`series`](#series). + +**Note** that while many implementations preserve the order of object properties, the +[ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) +explicitly states that + +> The mechanics and order of enumerating the properties is not specified. + +So if you rely on the order in which your series of functions are executed, and want +this to work on all platforms, consider using an array. + +__Arguments__ + +* `tasks` - An array or object containing functions to run, each function is passed + a `callback(err, result)` it must call on completion with an error `err` (which can + be `null`) and an optional `result` value. +* `callback(err, results)` - An optional callback to run once all the functions + have completed. This function gets a results array (or object) containing all + the result arguments passed to the `task` callbacks. + +__Example__ + +```js +async.series([ + function(callback){ + // do some stuff ... + callback(null, 'one'); + }, + function(callback){ + // do some more stuff ... + callback(null, 'two'); + } +], +// optional callback +function(err, results){ + // results is now equal to ['one', 'two'] +}); + + +// an example using an object instead of an array +async.series({ + one: function(callback){ + setTimeout(function(){ + callback(null, 1); + }, 200); + }, + two: function(callback){ + setTimeout(function(){ + callback(null, 2); + }, 100); + } +}, +function(err, results) { + // results is now equal to: {one: 1, two: 2} +}); +``` + +--------------------------------------- + + +### parallel(tasks, [callback]) + +Run the `tasks` array of functions in parallel, without waiting until the previous +function has completed. If any of the functions pass an error to its +callback, the main `callback` is immediately called with the value of the error. +Once the `tasks` have completed, the results are passed to the final `callback` as an +array. + +**Note:** `parallel` is about kicking-off I/O tasks in parallel, not about parallel execution of code. If your tasks do not use any timers or perform any I/O, they will actually be executed in series. Any synchronous setup sections for each task will happen one after the other. JavaScript remains single-threaded. + +It is also possible to use an object instead of an array. Each property will be +run as a function and the results will be passed to the final `callback` as an object +instead of an array. This can be a more readable way of handling results from +[`parallel`](#parallel). + + +__Arguments__ + +* `tasks` - An array or object containing functions to run. Each function is passed + a `callback(err, result)` which it must call on completion with an error `err` + (which can be `null`) and an optional `result` value. +* `callback(err, results)` - An optional callback to run once all the functions + have completed successfully. This function gets a results array (or object) containing all + the result arguments passed to the task callbacks. + +__Example__ + +```js +async.parallel([ + function(callback){ + setTimeout(function(){ + callback(null, 'one'); + }, 200); + }, + function(callback){ + setTimeout(function(){ + callback(null, 'two'); + }, 100); + } +], +// optional callback +function(err, results){ + // the results array will equal ['one','two'] even though + // the second function had a shorter timeout. +}); + + +// an example using an object instead of an array +async.parallel({ + one: function(callback){ + setTimeout(function(){ + callback(null, 1); + }, 200); + }, + two: function(callback){ + setTimeout(function(){ + callback(null, 2); + }, 100); + } +}, +function(err, results) { + // results is now equals to: {one: 1, two: 2} +}); +``` + +__Related__ + +* parallelLimit(tasks, limit, [callback]) + +--------------------------------------- + + +### whilst(test, fn, callback) + +Repeatedly call `fn`, while `test` returns `true`. Calls `callback` when stopped, +or an error occurs. + +__Arguments__ + +* `test()` - synchronous truth test to perform before each execution of `fn`. +* `fn(callback)` - A function which is called each time `test` passes. The function is + passed a `callback(err)`, which must be called once it has completed with an + optional `err` argument. +* `callback(err, [results])` - A callback which is called after the test + function has failed and repeated execution of `fn` has stopped. `callback` + will be passed an error and any arguments passed to the final `fn`'s callback. + +__Example__ + +```js +var count = 0; + +async.whilst( + function () { return count < 5; }, + function (callback) { + count++; + setTimeout(function () { + callback(null, count); + }, 1000); + }, + function (err, n) { + // 5 seconds have passed, n = 5 + } +); +``` + +--------------------------------------- + + +### doWhilst(fn, test, callback) + +The post-check version of [`whilst`](#whilst). To reflect the difference in +the order of operations, the arguments `test` and `fn` are switched. + +`doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. + +--------------------------------------- + + +### until(test, fn, callback) + +Repeatedly call `fn` until `test` returns `true`. Calls `callback` when stopped, +or an error occurs. `callback` will be passed an error and any arguments passed +to the final `fn`'s callback. + +The inverse of [`whilst`](#whilst). + +--------------------------------------- + + +### doUntil(fn, test, callback) + +Like [`doWhilst`](#doWhilst), except the `test` is inverted. Note the argument ordering differs from `until`. + +--------------------------------------- + + +### during(test, fn, callback) + +Like [`whilst`](#whilst), except the `test` is an asynchronous function that is passed a callback in the form of `function (err, truth)`. If error is passed to `test` or `fn`, the main callback is immediately called with the value of the error. + +__Example__ + +```js +var count = 0; + +async.during( + function (callback) { + return callback(null, count < 5); + }, + function (callback) { + count++; + setTimeout(callback, 1000); + }, + function (err) { + // 5 seconds have passed + } +); +``` + +--------------------------------------- + + +### doDuring(fn, test, callback) + +The post-check version of [`during`](#during). To reflect the difference in +the order of operations, the arguments `test` and `fn` are switched. + +Also a version of [`doWhilst`](#doWhilst) with asynchronous `test` function. + +--------------------------------------- + + +### forever(fn, [errback]) + +Calls the asynchronous function `fn` with a callback parameter that allows it to +call itself again, in series, indefinitely. + +If an error is passed to the callback then `errback` is called with the +error, and execution stops, otherwise it will never be called. + +```js +async.forever( + function(next) { + // next is suitable for passing to things that need a callback(err [, whatever]); + // it will result in this function being called again. + }, + function(err) { + // if next is called with a value in its first parameter, it will appear + // in here as 'err', and execution will stop. + } +); +``` + +--------------------------------------- + + +### waterfall(tasks, [callback]) + +Runs the `tasks` array of functions in series, each passing their results to the next in +the array. However, if any of the `tasks` pass an error to their own callback, the +next function is not executed, and the main `callback` is immediately called with +the error. + +__Arguments__ + +* `tasks` - An array of functions to run, each function is passed a + `callback(err, result1, result2, ...)` it must call on completion. The first + argument is an error (which can be `null`) and any further arguments will be + passed as arguments in order to the next task. +* `callback(err, [results])` - An optional callback to run once all the functions + have completed. This will be passed the results of the last task's callback. + + + +__Example__ + +```js +async.waterfall([ + function(callback) { + callback(null, 'one', 'two'); + }, + function(arg1, arg2, callback) { + // arg1 now equals 'one' and arg2 now equals 'two' + callback(null, 'three'); + }, + function(arg1, callback) { + // arg1 now equals 'three' + callback(null, 'done'); + } +], function (err, result) { + // result now equals 'done' +}); +``` +Or, with named functions: + +```js +async.waterfall([ + myFirstFunction, + mySecondFunction, + myLastFunction, +], function (err, result) { + // result now equals 'done' +}); +function myFirstFunction(callback) { + callback(null, 'one', 'two'); +} +function mySecondFunction(arg1, arg2, callback) { + // arg1 now equals 'one' and arg2 now equals 'two' + callback(null, 'three'); +} +function myLastFunction(arg1, callback) { + // arg1 now equals 'three' + callback(null, 'done'); +} +``` + +Or, if you need to pass any argument to the first function: + +```js +async.waterfall([ + async.apply(myFirstFunction, 'zero'), + mySecondFunction, + myLastFunction, +], function (err, result) { + // result now equals 'done' +}); +function myFirstFunction(arg1, callback) { + // arg1 now equals 'zero' + callback(null, 'one', 'two'); +} +function mySecondFunction(arg1, arg2, callback) { + // arg1 now equals 'one' and arg2 now equals 'two' + callback(null, 'three'); +} +function myLastFunction(arg1, callback) { + // arg1 now equals 'three' + callback(null, 'done'); +} +``` + +--------------------------------------- + +### compose(fn1, fn2...) + +Creates a function which is a composition of the passed asynchronous +functions. Each function consumes the return value of the function that +follows. Composing functions `f()`, `g()`, and `h()` would produce the result of +`f(g(h()))`, only this version uses callbacks to obtain the return values. + +Each function is executed with the `this` binding of the composed function. + +__Arguments__ + +* `functions...` - the asynchronous functions to compose + + +__Example__ + +```js +function add1(n, callback) { + setTimeout(function () { + callback(null, n + 1); + }, 10); +} + +function mul3(n, callback) { + setTimeout(function () { + callback(null, n * 3); + }, 10); +} + +var add1mul3 = async.compose(mul3, add1); + +add1mul3(4, function (err, result) { + // result now equals 15 +}); +``` + +--------------------------------------- + +### seq(fn1, fn2...) + +Version of the compose function that is more natural to read. +Each function consumes the return value of the previous function. +It is the equivalent of [`compose`](#compose) with the arguments reversed. + +Each function is executed with the `this` binding of the composed function. + +__Arguments__ + +* `functions...` - the asynchronous functions to compose + + +__Example__ + +```js +// Requires lodash (or underscore), express3 and dresende's orm2. +// Part of an app, that fetches cats of the logged user. +// This example uses `seq` function to avoid overnesting and error +// handling clutter. +app.get('/cats', function(request, response) { + var User = request.models.User; + async.seq( + _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data)) + function(user, fn) { + user.getCats(fn); // 'getCats' has signature (callback(err, data)) + } + )(req.session.user_id, function (err, cats) { + if (err) { + console.error(err); + response.json({ status: 'error', message: err.message }); + } else { + response.json({ status: 'ok', message: 'Cats found', data: cats }); + } + }); +}); +``` + +--------------------------------------- + +### applyEach(fns, args..., callback) + +Applies the provided arguments to each function in the array, calling +`callback` after all functions have completed. If you only provide the first +argument, then it will return a function which lets you pass in the +arguments as if it were a single function call. + +__Arguments__ + +* `fns` - the asynchronous functions to all call with the same arguments +* `args...` - any number of separate arguments to pass to the function +* `callback` - the final argument should be the callback, called when all + functions have completed processing + + +__Example__ + +```js +async.applyEach([enableSearch, updateSchema], 'bucket', callback); + +// partial application example: +async.each( + buckets, + async.applyEach([enableSearch, updateSchema]), + callback +); +``` + +__Related__ + +* applyEachSeries(tasks, args..., [callback]) + +--------------------------------------- + + +### queue(worker, [concurrency]) + +Creates a `queue` object with the specified `concurrency`. Tasks added to the +`queue` are processed in parallel (up to the `concurrency` limit). If all +`worker`s are in progress, the task is queued until one becomes available. +Once a `worker` completes a `task`, that `task`'s callback is called. + +__Arguments__ + +* `worker(task, callback)` - An asynchronous function for processing a queued + task, which must call its `callback(err)` argument when finished, with an + optional `error` as an argument. If you want to handle errors from an individual task, pass a callback to `q.push()`. +* `concurrency` - An `integer` for determining how many `worker` functions should be + run in parallel. If omitted, the concurrency defaults to `1`. If the concurrency is `0`, an error is thrown. + +__Queue objects__ + +The `queue` object returned by this function has the following properties and +methods: + +* `length()` - a function returning the number of items waiting to be processed. +* `started` - a function returning whether or not any items have been pushed and processed by the queue +* `running()` - a function returning the number of items currently being processed. +* `workersList()` - a function returning the array of items currently being processed. +* `idle()` - a function returning false if there are items waiting or being processed, or true if not. +* `concurrency` - an integer for determining how many `worker` functions should be + run in parallel. This property can be changed after a `queue` is created to + alter the concurrency on-the-fly. +* `push(task, [callback])` - add a new task to the `queue`. Calls `callback` once + the `worker` has finished processing the task. Instead of a single task, a `tasks` array + can be submitted. The respective callback is used for every task in the list. +* `unshift(task, [callback])` - add a new task to the front of the `queue`. +* `saturated` - a callback that is called when the `queue` length hits the `concurrency` limit, + and further tasks will be queued. +* `empty` - a callback that is called when the last item from the `queue` is given to a `worker`. +* `drain` - a callback that is called when the last item from the `queue` has returned from the `worker`. +* `paused` - a boolean for determining whether the queue is in a paused state +* `pause()` - a function that pauses the processing of tasks until `resume()` is called. +* `resume()` - a function that resumes the processing of queued tasks when the queue is paused. +* `kill()` - a function that removes the `drain` callback and empties remaining tasks from the queue forcing it to go idle. + +__Example__ + +```js +// create a queue object with concurrency 2 + +var q = async.queue(function (task, callback) { + console.log('hello ' + task.name); + callback(); +}, 2); + + +// assign a callback +q.drain = function() { + console.log('all items have been processed'); +} + +// add some items to the queue + +q.push({name: 'foo'}, function (err) { + console.log('finished processing foo'); +}); +q.push({name: 'bar'}, function (err) { + console.log('finished processing bar'); +}); + +// add some items to the queue (batch-wise) + +q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) { + console.log('finished processing item'); +}); + +// add some items to the front of the queue + +q.unshift({name: 'bar'}, function (err) { + console.log('finished processing bar'); +}); +``` + + +--------------------------------------- + + +### priorityQueue(worker, concurrency) + +The same as [`queue`](#queue) only tasks are assigned a priority and completed in ascending priority order. There are two differences between `queue` and `priorityQueue` objects: + +* `push(task, priority, [callback])` - `priority` should be a number. If an array of + `tasks` is given, all tasks will be assigned the same priority. +* The `unshift` method was removed. + +--------------------------------------- + + +### cargo(worker, [payload]) + +Creates a `cargo` object with the specified payload. Tasks added to the +cargo will be processed altogether (up to the `payload` limit). If the +`worker` is in progress, the task is queued until it becomes available. Once +the `worker` has completed some tasks, each callback of those tasks is called. +Check out [these](https://assets-git-camo.f3mw1.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://assets-git-camo.f3mw1.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) for how `cargo` and `queue` work. + +While [queue](#queue) passes only one task to one of a group of workers +at a time, cargo passes an array of tasks to a single worker, repeating +when the worker is finished. + +__Arguments__ + +* `worker(tasks, callback)` - An asynchronous function for processing an array of + queued tasks, which must call its `callback(err)` argument when finished, with + an optional `err` argument. +* `payload` - An optional `integer` for determining how many tasks should be + processed per round; if omitted, the default is unlimited. + +__Cargo objects__ + +The `cargo` object returned by this function has the following properties and +methods: + +* `length()` - A function returning the number of items waiting to be processed. +* `payload` - An `integer` for determining how many tasks should be + process per round. This property can be changed after a `cargo` is created to + alter the payload on-the-fly. +* `push(task, [callback])` - Adds `task` to the `queue`. The callback is called + once the `worker` has finished processing the task. Instead of a single task, an array of `tasks` + can be submitted. The respective callback is used for every task in the list. +* `saturated` - A callback that is called when the `queue.length()` hits the concurrency and further tasks will be queued. +* `empty` - A callback that is called when the last item from the `queue` is given to a `worker`. +* `drain` - A callback that is called when the last item from the `queue` has returned from the `worker`. +* `idle()`, `pause()`, `resume()`, `kill()` - cargo inherits all of the same methods and event calbacks as [`queue`](#queue) + +__Example__ + +```js +// create a cargo object with payload 2 + +var cargo = async.cargo(function (tasks, callback) { + for(var i=0; i +### auto(tasks, [concurrency], [callback]) + +Determines the best order for running the functions in `tasks`, based on their requirements. Each function can optionally depend on other functions being completed first, and each function is run as soon as its requirements are satisfied. + +If any of the functions pass an error to their callback, the `auto` sequence will stop. Further tasks will not execute (so any other functions depending on it will not run), and the main `callback` is immediately called with the error. Functions also receive an object containing the results of functions which have completed so far. + +Note, all functions are called with a `results` object as a second argument, +so it is unsafe to pass functions in the `tasks` object which cannot handle the +extra argument. + +For example, this snippet of code: + +```js +async.auto({ + readData: async.apply(fs.readFile, 'data.txt', 'utf-8') +}, callback); +``` + +will have the effect of calling `readFile` with the results object as the last +argument, which will fail: + +```js +fs.readFile('data.txt', 'utf-8', cb, {}); +``` + +Instead, wrap the call to `readFile` in a function which does not forward the +`results` object: + +```js +async.auto({ + readData: function(cb, results){ + fs.readFile('data.txt', 'utf-8', cb); + } +}, callback); +``` + +__Arguments__ + +* `tasks` - An object. Each of its properties is either a function or an array of + requirements, with the function itself the last item in the array. The object's key + of a property serves as the name of the task defined by that property, + i.e. can be used when specifying requirements for other tasks. + The function receives two arguments: (1) a `callback(err, result)` which must be + called when finished, passing an `error` (which can be `null`) and the result of + the function's execution, and (2) a `results` object, containing the results of + the previously executed functions. +* `concurrency` - An optional `integer` for determining the maximum number of tasks that can be run in parallel. By default, as many as possible. +* `callback(err, results)` - An optional callback which is called when all the + tasks have been completed. It receives the `err` argument if any `tasks` + pass an error to their callback. Results are always returned; however, if + an error occurs, no further `tasks` will be performed, and the results + object will only contain partial results. + + +__Example__ + +```js +async.auto({ + get_data: function(callback){ + console.log('in get_data'); + // async code to get some data + callback(null, 'data', 'converted to array'); + }, + make_folder: function(callback){ + console.log('in make_folder'); + // async code to create a directory to store a file in + // this is run at the same time as getting the data + callback(null, 'folder'); + }, + write_file: ['get_data', 'make_folder', function(callback, results){ + console.log('in write_file', JSON.stringify(results)); + // once there is some data and the directory exists, + // write the data to a file in the directory + callback(null, 'filename'); + }], + email_link: ['write_file', function(callback, results){ + console.log('in email_link', JSON.stringify(results)); + // once the file is written let's email a link to it... + // results.write_file contains the filename returned by write_file. + callback(null, {'file':results.write_file, 'email':'user@example.com'}); + }] +}, function(err, results) { + console.log('err = ', err); + console.log('results = ', results); +}); +``` + +This is a fairly trivial example, but to do this using the basic parallel and +series functions would look like this: + +```js +async.parallel([ + function(callback){ + console.log('in get_data'); + // async code to get some data + callback(null, 'data', 'converted to array'); + }, + function(callback){ + console.log('in make_folder'); + // async code to create a directory to store a file in + // this is run at the same time as getting the data + callback(null, 'folder'); + } +], +function(err, results){ + async.series([ + function(callback){ + console.log('in write_file', JSON.stringify(results)); + // once there is some data and the directory exists, + // write the data to a file in the directory + results.push('filename'); + callback(null); + }, + function(callback){ + console.log('in email_link', JSON.stringify(results)); + // once the file is written let's email a link to it... + callback(null, {'file':results.pop(), 'email':'user@example.com'}); + } + ]); +}); +``` + +For a complicated series of `async` tasks, using the [`auto`](#auto) function makes adding +new tasks much easier (and the code more readable). + + +--------------------------------------- + + +### retry([opts = {times: 5, interval: 0}| 5], task, [callback]) + +Attempts to get a successful response from `task` no more than `times` times before +returning an error. If the task is successful, the `callback` will be passed the result +of the successful task. If all attempts fail, the callback will be passed the error and +result (if any) of the final attempt. + +__Arguments__ + +* `opts` - Can be either an object with `times` and `interval` or a number. + * `times` - The number of attempts to make before giving up. The default is `5`. + * `interval` - The time to wait between retries, in milliseconds. The default is `0`. + * If `opts` is a number, the number specifies the number of times to retry, with the default interval of `0`. +* `task(callback, results)` - A function which receives two arguments: (1) a `callback(err, result)` + which must be called when finished, passing `err` (which can be `null`) and the `result` of + the function's execution, and (2) a `results` object, containing the results of + the previously executed functions (if nested inside another control flow). +* `callback(err, results)` - An optional callback which is called when the + task has succeeded, or after the final failed attempt. It receives the `err` and `result` arguments of the last attempt at completing the `task`. + +The [`retry`](#retry) function can be used as a stand-alone control flow by passing a callback, as shown below: + +```js +// try calling apiMethod 3 times +async.retry(3, apiMethod, function(err, result) { + // do something with the result +}); +``` + +```js +// try calling apiMethod 3 times, waiting 200 ms between each retry +async.retry({times: 3, interval: 200}, apiMethod, function(err, result) { + // do something with the result +}); +``` + +```js +// try calling apiMethod the default 5 times no delay between each retry +async.retry(apiMethod, function(err, result) { + // do something with the result +}); +``` + +It can also be embedded within other control flow functions to retry individual methods +that are not as reliable, like this: + +```js +async.auto({ + users: api.getUsers.bind(api), + payments: async.retry(3, api.getPayments.bind(api)) +}, function(err, results) { + // do something with the results +}); +``` + + +--------------------------------------- + + +### iterator(tasks) + +Creates an iterator function which calls the next function in the `tasks` array, +returning a continuation to call the next one after that. It's also possible to +“peek” at the next iterator with `iterator.next()`. + +This function is used internally by the `async` module, but can be useful when +you want to manually control the flow of functions in series. + +__Arguments__ + +* `tasks` - An array of functions to run. + +__Example__ + +```js +var iterator = async.iterator([ + function(){ sys.p('one'); }, + function(){ sys.p('two'); }, + function(){ sys.p('three'); } +]); + +node> var iterator2 = iterator(); +'one' +node> var iterator3 = iterator2(); +'two' +node> iterator3(); +'three' +node> var nextfn = iterator2.next(); +node> nextfn(); +'three' +``` + +--------------------------------------- + + +### apply(function, arguments..) + +Creates a continuation function with some arguments already applied. + +Useful as a shorthand when combined with other control flow functions. Any arguments +passed to the returned function are added to the arguments originally passed +to apply. + +__Arguments__ + +* `function` - The function you want to eventually apply all arguments to. +* `arguments...` - Any number of arguments to automatically apply when the + continuation is called. + +__Example__ + +```js +// using apply + +async.parallel([ + async.apply(fs.writeFile, 'testfile1', 'test1'), + async.apply(fs.writeFile, 'testfile2', 'test2'), +]); + + +// the same process without using apply + +async.parallel([ + function(callback){ + fs.writeFile('testfile1', 'test1', callback); + }, + function(callback){ + fs.writeFile('testfile2', 'test2', callback); + } +]); +``` + +It's possible to pass any number of additional arguments when calling the +continuation: + +```js +node> var fn = async.apply(sys.puts, 'one'); +node> fn('two', 'three'); +one +two +three +``` + +--------------------------------------- + + +### nextTick(callback), setImmediate(callback) + +Calls `callback` on a later loop around the event loop. In Node.js this just +calls `process.nextTick`; in the browser it falls back to `setImmediate(callback)` +if available, otherwise `setTimeout(callback, 0)`, which means other higher priority +events may precede the execution of `callback`. + +This is used internally for browser-compatibility purposes. + +__Arguments__ + +* `callback` - The function to call on a later loop around the event loop. + +__Example__ + +```js +var call_order = []; +async.nextTick(function(){ + call_order.push('two'); + // call_order now equals ['one','two'] +}); +call_order.push('one') +``` + + +### times(n, iterator, [callback]) + +Calls the `iterator` function `n` times, and accumulates results in the same manner +you would use with [`map`](#map). + +__Arguments__ + +* `n` - The number of times to run the function. +* `iterator` - The function to call `n` times. +* `callback` - see [`map`](#map) + +__Example__ + +```js +// Pretend this is some complicated async factory +var createUser = function(id, callback) { + callback(null, { + id: 'user' + id + }) +} +// generate 5 users +async.times(5, function(n, next){ + createUser(n, function(err, user) { + next(err, user) + }) +}, function(err, users) { + // we should now have 5 users +}); +``` + +__Related__ + +* timesSeries(n, iterator, [callback]) +* timesLimit(n, limit, iterator, [callback]) + + +## Utils + + +### memoize(fn, [hasher]) + +Caches the results of an `async` function. When creating a hash to store function +results against, the callback is omitted from the hash and an optional hash +function can be used. + +If no hash function is specified, the first argument is used as a hash key, which may work reasonably if it is a string or a data type that converts to a distinct string. Note that objects and arrays will not behave reasonably. Neither will cases where the other arguments are significant. In such cases, specify your own hash function. + +The cache of results is exposed as the `memo` property of the function returned +by `memoize`. + +__Arguments__ + +* `fn` - The function to proxy and cache results from. +* `hasher` - An optional function for generating a custom hash for storing + results. It has all the arguments applied to it apart from the callback, and + must be synchronous. + +__Example__ + +```js +var slow_fn = function (name, callback) { + // do something + callback(null, result); +}; +var fn = async.memoize(slow_fn); + +// fn can now be used as if it were slow_fn +fn('some name', function () { + // callback +}); +``` + + +### unmemoize(fn) + +Undoes a [`memoize`](#memoize)d function, reverting it to the original, unmemoized +form. Handy for testing. + +__Arguments__ + +* `fn` - the memoized function + +--------------------------------------- + + +### ensureAsync(fn) + +Wrap an async function and ensure it calls its callback on a later tick of the event loop. If the function already calls its callback on a next tick, no extra deferral is added. This is useful for preventing stack overflows (`RangeError: Maximum call stack size exceeded`) and generally keeping [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) contained. + +__Arguments__ + +* `fn` - an async function, one that expects a node-style callback as its last argument + +Returns a wrapped function with the exact same call signature as the function passed in. + +__Example__ + +```js +function sometimesAsync(arg, callback) { + if (cache[arg]) { + return callback(null, cache[arg]); // this would be synchronous!! + } else { + doSomeIO(arg, callback); // this IO would be asynchronous + } +} + +// this has a risk of stack overflows if many results are cached in a row +async.mapSeries(args, sometimesAsync, done); + +// this will defer sometimesAsync's callback if necessary, +// preventing stack overflows +async.mapSeries(args, async.ensureAsync(sometimesAsync), done); + +``` + +--------------------------------------- + + +### constant(values...) + +Returns a function that when called, calls-back with the values provided. Useful as the first function in a `waterfall`, or for plugging values in to `auto`. + +__Example__ + +```js +async.waterfall([ + async.constant(42), + function (value, next) { + // value === 42 + }, + //... +], callback); + +async.waterfall([ + async.constant(filename, "utf8"), + fs.readFile, + function (fileData, next) { + //... + } + //... +], callback); + +async.auto({ + hostname: async.constant("https://server.net/"), + port: findFreePort, + launchServer: ["hostname", "port", function (cb, options) { + startServer(options, cb); + }], + //... +}, callback); + +``` + +--------------------------------------- + + + +### asyncify(func) + +__Alias:__ `wrapSync` + +Take a sync function and make it async, passing its return value to a callback. This is useful for plugging sync functions into a waterfall, series, or other async functions. Any arguments passed to the generated function will be passed to the wrapped function (except for the final callback argument). Errors thrown will be passed to the callback. + +__Example__ + +```js +async.waterfall([ + async.apply(fs.readFile, filename, "utf8"), + async.asyncify(JSON.parse), + function (data, next) { + // data is the result of parsing the text. + // If there was a parsing error, it would have been caught. + } +], callback) +``` + +If the function passed to `asyncify` returns a Promise, that promises's resolved/rejected state will be used to call the callback, rather than simply the synchronous return value. Example: + +```js +async.waterfall([ + async.apply(fs.readFile, filename, "utf8"), + async.asyncify(function (contents) { + return db.model.create(contents); + }), + function (model, next) { + // `model` is the instantiated model object. + // If there was an error, this function would be skipped. + } +], callback) +``` + +This also means you can asyncify ES2016 `async` functions. + +```js +var q = async.queue(async.asyncify(async function (file) { + var intermediateStep = await processFile(file); + return await somePromise(intermediateStep) +})); + +q.push(files); +``` + +--------------------------------------- + + +### log(function, arguments) + +Logs the result of an `async` function to the `console`. Only works in Node.js or +in browsers that support `console.log` and `console.error` (such as FF and Chrome). +If multiple arguments are returned from the async function, `console.log` is +called on each argument in order. + +__Arguments__ + +* `function` - The function you want to eventually apply all arguments to. +* `arguments...` - Any number of arguments to apply to the function. + +__Example__ + +```js +var hello = function(name, callback){ + setTimeout(function(){ + callback(null, 'hello ' + name); + }, 1000); +}; +``` +```js +node> async.log(hello, 'world'); +'hello world' +``` + +--------------------------------------- + + +### dir(function, arguments) + +Logs the result of an `async` function to the `console` using `console.dir` to +display the properties of the resulting object. Only works in Node.js or +in browsers that support `console.dir` and `console.error` (such as FF and Chrome). +If multiple arguments are returned from the async function, `console.dir` is +called on each argument in order. + +__Arguments__ + +* `function` - The function you want to eventually apply all arguments to. +* `arguments...` - Any number of arguments to apply to the function. + +__Example__ + +```js +var hello = function(name, callback){ + setTimeout(function(){ + callback(null, {hello: name}); + }, 1000); +}; +``` +```js +node> async.dir(hello, 'world'); +{hello: 'world'} +``` + +--------------------------------------- + + +### noConflict() + +Changes the value of `async` back to its original value, returning a reference to the +`async` object. diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/dist/async.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/dist/async.js new file mode 100644 index 00000000000000..ee0a268e6d7932 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/dist/async.js @@ -0,0 +1,1265 @@ +/*! + * async + * https://github.com/caolan/async + * + * Copyright 2010-2014 Caolan McMahon + * Released under the MIT license + */ +(function () { + + var async = {}; + function noop() {} + function identity(v) { + return v; + } + function toBool(v) { + return !!v; + } + function notId(v) { + return !v; + } + + // global on the server, window in the browser + var previous_async; + + // Establish the root object, `window` (`self`) in the browser, `global` + // on the server, or `this` in some virtual machines. We use `self` + // instead of `window` for `WebWorker` support. + var root = typeof self === 'object' && self.self === self && self || + typeof global === 'object' && global.global === global && global || + this; + + if (root != null) { + previous_async = root.async; + } + + async.noConflict = function () { + root.async = previous_async; + return async; + }; + + function only_once(fn) { + return function() { + if (fn === null) throw new Error("Callback was already called."); + fn.apply(this, arguments); + fn = null; + }; + } + + function _once(fn) { + return function() { + if (fn === null) return; + fn.apply(this, arguments); + fn = null; + }; + } + + //// cross-browser compatiblity functions //// + + var _toString = Object.prototype.toString; + + var _isArray = Array.isArray || function (obj) { + return _toString.call(obj) === '[object Array]'; + }; + + // Ported from underscore.js isObject + var _isObject = function(obj) { + var type = typeof obj; + return type === 'function' || type === 'object' && !!obj; + }; + + function _isArrayLike(arr) { + return _isArray(arr) || ( + // has a positive integer length property + typeof arr.length === "number" && + arr.length >= 0 && + arr.length % 1 === 0 + ); + } + + function _arrayEach(arr, iterator) { + var index = -1, + length = arr.length; + + while (++index < length) { + iterator(arr[index], index, arr); + } + } + + function _map(arr, iterator) { + var index = -1, + length = arr.length, + result = Array(length); + + while (++index < length) { + result[index] = iterator(arr[index], index, arr); + } + return result; + } + + function _range(count) { + return _map(Array(count), function (v, i) { return i; }); + } + + function _reduce(arr, iterator, memo) { + _arrayEach(arr, function (x, i, a) { + memo = iterator(memo, x, i, a); + }); + return memo; + } + + function _forEachOf(object, iterator) { + _arrayEach(_keys(object), function (key) { + iterator(object[key], key); + }); + } + + function _indexOf(arr, item) { + for (var i = 0; i < arr.length; i++) { + if (arr[i] === item) return i; + } + return -1; + } + + var _keys = Object.keys || function (obj) { + var keys = []; + for (var k in obj) { + if (obj.hasOwnProperty(k)) { + keys.push(k); + } + } + return keys; + }; + + function _keyIterator(coll) { + var i = -1; + var len; + var keys; + if (_isArrayLike(coll)) { + len = coll.length; + return function next() { + i++; + return i < len ? i : null; + }; + } else { + keys = _keys(coll); + len = keys.length; + return function next() { + i++; + return i < len ? keys[i] : null; + }; + } + } + + // Similar to ES6's rest param (http://ariya.ofilabs.com/2013/03/es6-and-rest-parameter.html) + // This accumulates the arguments passed into an array, after a given index. + // From underscore.js (https://github.com/jashkenas/underscore/pull/2140). + function _restParam(func, startIndex) { + startIndex = startIndex == null ? func.length - 1 : +startIndex; + return function() { + var length = Math.max(arguments.length - startIndex, 0); + var rest = Array(length); + for (var index = 0; index < length; index++) { + rest[index] = arguments[index + startIndex]; + } + switch (startIndex) { + case 0: return func.call(this, rest); + case 1: return func.call(this, arguments[0], rest); + } + // Currently unused but handle cases outside of the switch statement: + // var args = Array(startIndex + 1); + // for (index = 0; index < startIndex; index++) { + // args[index] = arguments[index]; + // } + // args[startIndex] = rest; + // return func.apply(this, args); + }; + } + + function _withoutIndex(iterator) { + return function (value, index, callback) { + return iterator(value, callback); + }; + } + + //// exported async module functions //// + + //// nextTick implementation with browser-compatible fallback //// + + // capture the global reference to guard against fakeTimer mocks + var _setImmediate = typeof setImmediate === 'function' && setImmediate; + + var _delay = _setImmediate ? function(fn) { + // not a direct alias for IE10 compatibility + _setImmediate(fn); + } : function(fn) { + setTimeout(fn, 0); + }; + + if (typeof process === 'object' && typeof process.nextTick === 'function') { + async.nextTick = process.nextTick; + } else { + async.nextTick = _delay; + } + async.setImmediate = _setImmediate ? _delay : async.nextTick; + + + async.forEach = + async.each = function (arr, iterator, callback) { + return async.eachOf(arr, _withoutIndex(iterator), callback); + }; + + async.forEachSeries = + async.eachSeries = function (arr, iterator, callback) { + return async.eachOfSeries(arr, _withoutIndex(iterator), callback); + }; + + + async.forEachLimit = + async.eachLimit = function (arr, limit, iterator, callback) { + return _eachOfLimit(limit)(arr, _withoutIndex(iterator), callback); + }; + + async.forEachOf = + async.eachOf = function (object, iterator, callback) { + callback = _once(callback || noop); + object = object || []; + + var iter = _keyIterator(object); + var key, completed = 0; + + while ((key = iter()) != null) { + completed += 1; + iterator(object[key], key, only_once(done)); + } + + if (completed === 0) callback(null); + + function done(err) { + completed--; + if (err) { + callback(err); + } + // Check key is null in case iterator isn't exhausted + // and done resolved synchronously. + else if (key === null && completed <= 0) { + callback(null); + } + } + }; + + async.forEachOfSeries = + async.eachOfSeries = function (obj, iterator, callback) { + callback = _once(callback || noop); + obj = obj || []; + var nextKey = _keyIterator(obj); + var key = nextKey(); + function iterate() { + var sync = true; + if (key === null) { + return callback(null); + } + iterator(obj[key], key, only_once(function (err) { + if (err) { + callback(err); + } + else { + key = nextKey(); + if (key === null) { + return callback(null); + } else { + if (sync) { + async.setImmediate(iterate); + } else { + iterate(); + } + } + } + })); + sync = false; + } + iterate(); + }; + + + + async.forEachOfLimit = + async.eachOfLimit = function (obj, limit, iterator, callback) { + _eachOfLimit(limit)(obj, iterator, callback); + }; + + function _eachOfLimit(limit) { + + return function (obj, iterator, callback) { + callback = _once(callback || noop); + obj = obj || []; + var nextKey = _keyIterator(obj); + if (limit <= 0) { + return callback(null); + } + var done = false; + var running = 0; + var errored = false; + + (function replenish () { + if (done && running <= 0) { + return callback(null); + } + + while (running < limit && !errored) { + var key = nextKey(); + if (key === null) { + done = true; + if (running <= 0) { + callback(null); + } + return; + } + running += 1; + iterator(obj[key], key, only_once(function (err) { + running -= 1; + if (err) { + callback(err); + errored = true; + } + else { + replenish(); + } + })); + } + })(); + }; + } + + + function doParallel(fn) { + return function (obj, iterator, callback) { + return fn(async.eachOf, obj, iterator, callback); + }; + } + function doParallelLimit(fn) { + return function (obj, limit, iterator, callback) { + return fn(_eachOfLimit(limit), obj, iterator, callback); + }; + } + function doSeries(fn) { + return function (obj, iterator, callback) { + return fn(async.eachOfSeries, obj, iterator, callback); + }; + } + + function _asyncMap(eachfn, arr, iterator, callback) { + callback = _once(callback || noop); + arr = arr || []; + var results = _isArrayLike(arr) ? [] : {}; + eachfn(arr, function (value, index, callback) { + iterator(value, function (err, v) { + results[index] = v; + callback(err); + }); + }, function (err) { + callback(err, results); + }); + } + + async.map = doParallel(_asyncMap); + async.mapSeries = doSeries(_asyncMap); + async.mapLimit = doParallelLimit(_asyncMap); + + // reduce only has a series version, as doing reduce in parallel won't + // work in many situations. + async.inject = + async.foldl = + async.reduce = function (arr, memo, iterator, callback) { + async.eachOfSeries(arr, function (x, i, callback) { + iterator(memo, x, function (err, v) { + memo = v; + callback(err); + }); + }, function (err) { + callback(err, memo); + }); + }; + + async.foldr = + async.reduceRight = function (arr, memo, iterator, callback) { + var reversed = _map(arr, identity).reverse(); + async.reduce(reversed, memo, iterator, callback); + }; + + async.transform = function (arr, memo, iterator, callback) { + if (arguments.length === 3) { + callback = iterator; + iterator = memo; + memo = _isArray(arr) ? [] : {}; + } + + async.eachOf(arr, function(v, k, cb) { + iterator(memo, v, k, cb); + }, function(err) { + callback(err, memo); + }); + }; + + function _filter(eachfn, arr, iterator, callback) { + var results = []; + eachfn(arr, function (x, index, callback) { + iterator(x, function (v) { + if (v) { + results.push({index: index, value: x}); + } + callback(); + }); + }, function () { + callback(_map(results.sort(function (a, b) { + return a.index - b.index; + }), function (x) { + return x.value; + })); + }); + } + + async.select = + async.filter = doParallel(_filter); + + async.selectLimit = + async.filterLimit = doParallelLimit(_filter); + + async.selectSeries = + async.filterSeries = doSeries(_filter); + + function _reject(eachfn, arr, iterator, callback) { + _filter(eachfn, arr, function(value, cb) { + iterator(value, function(v) { + cb(!v); + }); + }, callback); + } + async.reject = doParallel(_reject); + async.rejectLimit = doParallelLimit(_reject); + async.rejectSeries = doSeries(_reject); + + function _createTester(eachfn, check, getResult) { + return function(arr, limit, iterator, cb) { + function done() { + if (cb) cb(getResult(false, void 0)); + } + function iteratee(x, _, callback) { + if (!cb) return callback(); + iterator(x, function (v) { + if (cb && check(v)) { + cb(getResult(true, x)); + cb = iterator = false; + } + callback(); + }); + } + if (arguments.length > 3) { + eachfn(arr, limit, iteratee, done); + } else { + cb = iterator; + iterator = limit; + eachfn(arr, iteratee, done); + } + }; + } + + async.any = + async.some = _createTester(async.eachOf, toBool, identity); + + async.someLimit = _createTester(async.eachOfLimit, toBool, identity); + + async.all = + async.every = _createTester(async.eachOf, notId, notId); + + async.everyLimit = _createTester(async.eachOfLimit, notId, notId); + + function _findGetResult(v, x) { + return x; + } + async.detect = _createTester(async.eachOf, identity, _findGetResult); + async.detectSeries = _createTester(async.eachOfSeries, identity, _findGetResult); + async.detectLimit = _createTester(async.eachOfLimit, identity, _findGetResult); + + async.sortBy = function (arr, iterator, callback) { + async.map(arr, function (x, callback) { + iterator(x, function (err, criteria) { + if (err) { + callback(err); + } + else { + callback(null, {value: x, criteria: criteria}); + } + }); + }, function (err, results) { + if (err) { + return callback(err); + } + else { + callback(null, _map(results.sort(comparator), function (x) { + return x.value; + })); + } + + }); + + function comparator(left, right) { + var a = left.criteria, b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + } + }; + + async.auto = function (tasks, concurrency, callback) { + if (typeof arguments[1] === 'function') { + // concurrency is optional, shift the args. + callback = concurrency; + concurrency = null; + } + callback = _once(callback || noop); + var keys = _keys(tasks); + var remainingTasks = keys.length; + if (!remainingTasks) { + return callback(null); + } + if (!concurrency) { + concurrency = remainingTasks; + } + + var results = {}; + var runningTasks = 0; + + var hasError = false; + + var listeners = []; + function addListener(fn) { + listeners.unshift(fn); + } + function removeListener(fn) { + var idx = _indexOf(listeners, fn); + if (idx >= 0) listeners.splice(idx, 1); + } + function taskComplete() { + remainingTasks--; + _arrayEach(listeners.slice(0), function (fn) { + fn(); + }); + } + + addListener(function () { + if (!remainingTasks) { + callback(null, results); + } + }); + + _arrayEach(keys, function (k) { + if (hasError) return; + var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]]; + var taskCallback = _restParam(function(err, args) { + runningTasks--; + if (args.length <= 1) { + args = args[0]; + } + if (err) { + var safeResults = {}; + _forEachOf(results, function(val, rkey) { + safeResults[rkey] = val; + }); + safeResults[k] = args; + hasError = true; + + callback(err, safeResults); + } + else { + results[k] = args; + async.setImmediate(taskComplete); + } + }); + var requires = task.slice(0, task.length - 1); + // prevent dead-locks + var len = requires.length; + var dep; + while (len--) { + if (!(dep = tasks[requires[len]])) { + throw new Error('Has nonexistent dependency in ' + requires.join(', ')); + } + if (_isArray(dep) && _indexOf(dep, k) >= 0) { + throw new Error('Has cyclic dependencies'); + } + } + function ready() { + return runningTasks < concurrency && _reduce(requires, function (a, x) { + return (a && results.hasOwnProperty(x)); + }, true) && !results.hasOwnProperty(k); + } + if (ready()) { + runningTasks++; + task[task.length - 1](taskCallback, results); + } + else { + addListener(listener); + } + function listener() { + if (ready()) { + runningTasks++; + removeListener(listener); + task[task.length - 1](taskCallback, results); + } + } + }); + }; + + + + async.retry = function(times, task, callback) { + var DEFAULT_TIMES = 5; + var DEFAULT_INTERVAL = 0; + + var attempts = []; + + var opts = { + times: DEFAULT_TIMES, + interval: DEFAULT_INTERVAL + }; + + function parseTimes(acc, t){ + if(typeof t === 'number'){ + acc.times = parseInt(t, 10) || DEFAULT_TIMES; + } else if(typeof t === 'object'){ + acc.times = parseInt(t.times, 10) || DEFAULT_TIMES; + acc.interval = parseInt(t.interval, 10) || DEFAULT_INTERVAL; + } else { + throw new Error('Unsupported argument type for \'times\': ' + typeof t); + } + } + + var length = arguments.length; + if (length < 1 || length > 3) { + throw new Error('Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)'); + } else if (length <= 2 && typeof times === 'function') { + callback = task; + task = times; + } + if (typeof times !== 'function') { + parseTimes(opts, times); + } + opts.callback = callback; + opts.task = task; + + function wrappedTask(wrappedCallback, wrappedResults) { + function retryAttempt(task, finalAttempt) { + return function(seriesCallback) { + task(function(err, result){ + seriesCallback(!err || finalAttempt, {err: err, result: result}); + }, wrappedResults); + }; + } + + function retryInterval(interval){ + return function(seriesCallback){ + setTimeout(function(){ + seriesCallback(null); + }, interval); + }; + } + + while (opts.times) { + + var finalAttempt = !(opts.times-=1); + attempts.push(retryAttempt(opts.task, finalAttempt)); + if(!finalAttempt && opts.interval > 0){ + attempts.push(retryInterval(opts.interval)); + } + } + + async.series(attempts, function(done, data){ + data = data[data.length - 1]; + (wrappedCallback || opts.callback)(data.err, data.result); + }); + } + + // If a callback is passed, run this as a controll flow + return opts.callback ? wrappedTask() : wrappedTask; + }; + + async.waterfall = function (tasks, callback) { + callback = _once(callback || noop); + if (!_isArray(tasks)) { + var err = new Error('First argument to waterfall must be an array of functions'); + return callback(err); + } + if (!tasks.length) { + return callback(); + } + function wrapIterator(iterator) { + return _restParam(function (err, args) { + if (err) { + callback.apply(null, [err].concat(args)); + } + else { + var next = iterator.next(); + if (next) { + args.push(wrapIterator(next)); + } + else { + args.push(callback); + } + ensureAsync(iterator).apply(null, args); + } + }); + } + wrapIterator(async.iterator(tasks))(); + }; + + function _parallel(eachfn, tasks, callback) { + callback = callback || noop; + var results = _isArrayLike(tasks) ? [] : {}; + + eachfn(tasks, function (task, key, callback) { + task(_restParam(function (err, args) { + if (args.length <= 1) { + args = args[0]; + } + results[key] = args; + callback(err); + })); + }, function (err) { + callback(err, results); + }); + } + + async.parallel = function (tasks, callback) { + _parallel(async.eachOf, tasks, callback); + }; + + async.parallelLimit = function(tasks, limit, callback) { + _parallel(_eachOfLimit(limit), tasks, callback); + }; + + async.series = function(tasks, callback) { + _parallel(async.eachOfSeries, tasks, callback); + }; + + async.iterator = function (tasks) { + function makeCallback(index) { + function fn() { + if (tasks.length) { + tasks[index].apply(null, arguments); + } + return fn.next(); + } + fn.next = function () { + return (index < tasks.length - 1) ? makeCallback(index + 1): null; + }; + return fn; + } + return makeCallback(0); + }; + + async.apply = _restParam(function (fn, args) { + return _restParam(function (callArgs) { + return fn.apply( + null, args.concat(callArgs) + ); + }); + }); + + function _concat(eachfn, arr, fn, callback) { + var result = []; + eachfn(arr, function (x, index, cb) { + fn(x, function (err, y) { + result = result.concat(y || []); + cb(err); + }); + }, function (err) { + callback(err, result); + }); + } + async.concat = doParallel(_concat); + async.concatSeries = doSeries(_concat); + + async.whilst = function (test, iterator, callback) { + callback = callback || noop; + if (test()) { + var next = _restParam(function(err, args) { + if (err) { + callback(err); + } else if (test.apply(this, args)) { + iterator(next); + } else { + callback.apply(null, [null].concat(args)); + } + }); + iterator(next); + } else { + callback(null); + } + }; + + async.doWhilst = function (iterator, test, callback) { + var calls = 0; + return async.whilst(function() { + return ++calls <= 1 || test.apply(this, arguments); + }, iterator, callback); + }; + + async.until = function (test, iterator, callback) { + return async.whilst(function() { + return !test.apply(this, arguments); + }, iterator, callback); + }; + + async.doUntil = function (iterator, test, callback) { + return async.doWhilst(iterator, function() { + return !test.apply(this, arguments); + }, callback); + }; + + async.during = function (test, iterator, callback) { + callback = callback || noop; + + var next = _restParam(function(err, args) { + if (err) { + callback(err); + } else { + args.push(check); + test.apply(this, args); + } + }); + + var check = function(err, truth) { + if (err) { + callback(err); + } else if (truth) { + iterator(next); + } else { + callback(null); + } + }; + + test(check); + }; + + async.doDuring = function (iterator, test, callback) { + var calls = 0; + async.during(function(next) { + if (calls++ < 1) { + next(null, true); + } else { + test.apply(this, arguments); + } + }, iterator, callback); + }; + + function _queue(worker, concurrency, payload) { + if (concurrency == null) { + concurrency = 1; + } + else if(concurrency === 0) { + throw new Error('Concurrency must not be zero'); + } + function _insert(q, data, pos, callback) { + if (callback != null && typeof callback !== "function") { + throw new Error("task callback must be a function"); + } + q.started = true; + if (!_isArray(data)) { + data = [data]; + } + if(data.length === 0 && q.idle()) { + // call drain immediately if there are no tasks + return async.setImmediate(function() { + q.drain(); + }); + } + _arrayEach(data, function(task) { + var item = { + data: task, + callback: callback || noop + }; + + if (pos) { + q.tasks.unshift(item); + } else { + q.tasks.push(item); + } + + if (q.tasks.length === q.concurrency) { + q.saturated(); + } + }); + async.setImmediate(q.process); + } + function _next(q, tasks) { + return function(){ + workers -= 1; + + var removed = false; + var args = arguments; + _arrayEach(tasks, function (task) { + _arrayEach(workersList, function (worker, index) { + if (worker === task && !removed) { + workersList.splice(index, 1); + removed = true; + } + }); + + task.callback.apply(task, args); + }); + if (q.tasks.length + workers === 0) { + q.drain(); + } + q.process(); + }; + } + + var workers = 0; + var workersList = []; + var q = { + tasks: [], + concurrency: concurrency, + payload: payload, + saturated: noop, + empty: noop, + drain: noop, + started: false, + paused: false, + push: function (data, callback) { + _insert(q, data, false, callback); + }, + kill: function () { + q.drain = noop; + q.tasks = []; + }, + unshift: function (data, callback) { + _insert(q, data, true, callback); + }, + process: function () { + while(!q.paused && workers < q.concurrency && q.tasks.length){ + + var tasks = q.payload ? + q.tasks.splice(0, q.payload) : + q.tasks.splice(0, q.tasks.length); + + var data = _map(tasks, function (task) { + return task.data; + }); + + if (q.tasks.length === 0) { + q.empty(); + } + workers += 1; + workersList.push(tasks[0]); + var cb = only_once(_next(q, tasks)); + worker(data, cb); + } + }, + length: function () { + return q.tasks.length; + }, + running: function () { + return workers; + }, + workersList: function () { + return workersList; + }, + idle: function() { + return q.tasks.length + workers === 0; + }, + pause: function () { + q.paused = true; + }, + resume: function () { + if (q.paused === false) { return; } + q.paused = false; + var resumeCount = Math.min(q.concurrency, q.tasks.length); + // Need to call q.process once per concurrent + // worker to preserve full concurrency after pause + for (var w = 1; w <= resumeCount; w++) { + async.setImmediate(q.process); + } + } + }; + return q; + } + + async.queue = function (worker, concurrency) { + var q = _queue(function (items, cb) { + worker(items[0], cb); + }, concurrency, 1); + + return q; + }; + + async.priorityQueue = function (worker, concurrency) { + + function _compareTasks(a, b){ + return a.priority - b.priority; + } + + function _binarySearch(sequence, item, compare) { + var beg = -1, + end = sequence.length - 1; + while (beg < end) { + var mid = beg + ((end - beg + 1) >>> 1); + if (compare(item, sequence[mid]) >= 0) { + beg = mid; + } else { + end = mid - 1; + } + } + return beg; + } + + function _insert(q, data, priority, callback) { + if (callback != null && typeof callback !== "function") { + throw new Error("task callback must be a function"); + } + q.started = true; + if (!_isArray(data)) { + data = [data]; + } + if(data.length === 0) { + // call drain immediately if there are no tasks + return async.setImmediate(function() { + q.drain(); + }); + } + _arrayEach(data, function(task) { + var item = { + data: task, + priority: priority, + callback: typeof callback === 'function' ? callback : noop + }; + + q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item); + + if (q.tasks.length === q.concurrency) { + q.saturated(); + } + async.setImmediate(q.process); + }); + } + + // Start with a normal queue + var q = async.queue(worker, concurrency); + + // Override push to accept second parameter representing priority + q.push = function (data, priority, callback) { + _insert(q, data, priority, callback); + }; + + // Remove unshift function + delete q.unshift; + + return q; + }; + + async.cargo = function (worker, payload) { + return _queue(worker, 1, payload); + }; + + function _console_fn(name) { + return _restParam(function (fn, args) { + fn.apply(null, args.concat([_restParam(function (err, args) { + if (typeof console === 'object') { + if (err) { + if (console.error) { + console.error(err); + } + } + else if (console[name]) { + _arrayEach(args, function (x) { + console[name](x); + }); + } + } + })])); + }); + } + async.log = _console_fn('log'); + async.dir = _console_fn('dir'); + /*async.info = _console_fn('info'); + async.warn = _console_fn('warn'); + async.error = _console_fn('error');*/ + + async.memoize = function (fn, hasher) { + var memo = {}; + var queues = {}; + var has = Object.prototype.hasOwnProperty; + hasher = hasher || identity; + var memoized = _restParam(function memoized(args) { + var callback = args.pop(); + var key = hasher.apply(null, args); + if (has.call(memo, key)) { + async.setImmediate(function () { + callback.apply(null, memo[key]); + }); + } + else if (has.call(queues, key)) { + queues[key].push(callback); + } + else { + queues[key] = [callback]; + fn.apply(null, args.concat([_restParam(function (args) { + memo[key] = args; + var q = queues[key]; + delete queues[key]; + for (var i = 0, l = q.length; i < l; i++) { + q[i].apply(null, args); + } + })])); + } + }); + memoized.memo = memo; + memoized.unmemoized = fn; + return memoized; + }; + + async.unmemoize = function (fn) { + return function () { + return (fn.unmemoized || fn).apply(null, arguments); + }; + }; + + function _times(mapper) { + return function (count, iterator, callback) { + mapper(_range(count), iterator, callback); + }; + } + + async.times = _times(async.map); + async.timesSeries = _times(async.mapSeries); + async.timesLimit = function (count, limit, iterator, callback) { + return async.mapLimit(_range(count), limit, iterator, callback); + }; + + async.seq = function (/* functions... */) { + var fns = arguments; + return _restParam(function (args) { + var that = this; + + var callback = args[args.length - 1]; + if (typeof callback == 'function') { + args.pop(); + } else { + callback = noop; + } + + async.reduce(fns, args, function (newargs, fn, cb) { + fn.apply(that, newargs.concat([_restParam(function (err, nextargs) { + cb(err, nextargs); + })])); + }, + function (err, results) { + callback.apply(that, [err].concat(results)); + }); + }); + }; + + async.compose = function (/* functions... */) { + return async.seq.apply(null, Array.prototype.reverse.call(arguments)); + }; + + + function _applyEach(eachfn) { + return _restParam(function(fns, args) { + var go = _restParam(function(args) { + var that = this; + var callback = args.pop(); + return eachfn(fns, function (fn, _, cb) { + fn.apply(that, args.concat([cb])); + }, + callback); + }); + if (args.length) { + return go.apply(this, args); + } + else { + return go; + } + }); + } + + async.applyEach = _applyEach(async.eachOf); + async.applyEachSeries = _applyEach(async.eachOfSeries); + + + async.forever = function (fn, callback) { + var done = only_once(callback || noop); + var task = ensureAsync(fn); + function next(err) { + if (err) { + return done(err); + } + task(next); + } + next(); + }; + + function ensureAsync(fn) { + return _restParam(function (args) { + var callback = args.pop(); + args.push(function () { + var innerArgs = arguments; + if (sync) { + async.setImmediate(function () { + callback.apply(null, innerArgs); + }); + } else { + callback.apply(null, innerArgs); + } + }); + var sync = true; + fn.apply(this, args); + sync = false; + }); + } + + async.ensureAsync = ensureAsync; + + async.constant = _restParam(function(values) { + var args = [null].concat(values); + return function (callback) { + return callback.apply(this, args); + }; + }); + + async.wrapSync = + async.asyncify = function asyncify(func) { + return _restParam(function (args) { + var callback = args.pop(); + var result; + try { + result = func.apply(this, args); + } catch (e) { + return callback(e); + } + // if result is Promise object + if (_isObject(result) && typeof result.then === "function") { + result.then(function(value) { + callback(null, value); + })["catch"](function(err) { + callback(err.message ? err : new Error(err)); + }); + } else { + callback(null, result); + } + }); + }; + + // Node.js + if (typeof module === 'object' && module.exports) { + module.exports = async; + } + // AMD / RequireJS + else if (typeof define === 'function' && define.amd) { + define([], function () { + return async; + }); + } + // included directly via + + \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/example.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/example.js new file mode 100644 index 00000000000000..664c1b455bd77e --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/example.js @@ -0,0 +1,3 @@ +var BigInteger = require('./'); +var a = new BigInteger('91823918239182398123'); +console.log(a.bitLength()); \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/index.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/index.js new file mode 100644 index 00000000000000..e32fe13d860085 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/index.js @@ -0,0 +1,1358 @@ +(function(){ + + // Copyright (c) 2005 Tom Wu + // All Rights Reserved. + // See "LICENSE" for details. + + // Basic JavaScript BN library - subset useful for RSA encryption. + + // Bits per digit + var dbits; + + // JavaScript engine analysis + var canary = 0xdeadbeefcafe; + var j_lm = ((canary&0xffffff)==0xefcafe); + + // (public) Constructor + function BigInteger(a,b,c) { + if(a != null) + if("number" == typeof a) this.fromNumber(a,b,c); + else if(b == null && "string" != typeof a) this.fromString(a,256); + else this.fromString(a,b); + } + + // return new, unset BigInteger + function nbi() { return new BigInteger(null); } + + // am: Compute w_j += (x*this_i), propagate carries, + // c is initial carry, returns final carry. + // c < 3*dvalue, x < 2*dvalue, this_i < dvalue + // We need to select the fastest one that works in this environment. + + // am1: use a single mult and divide to get the high bits, + // max digit bits should be 26 because + // max internal value = 2*dvalue^2-2*dvalue (< 2^53) + function am1(i,x,w,j,c,n) { + while(--n >= 0) { + var v = x*this[i++]+w[j]+c; + c = Math.floor(v/0x4000000); + w[j++] = v&0x3ffffff; + } + return c; + } + // am2 avoids a big mult-and-extract completely. + // Max digit bits should be <= 30 because we do bitwise ops + // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31) + function am2(i,x,w,j,c,n) { + var xl = x&0x7fff, xh = x>>15; + while(--n >= 0) { + var l = this[i]&0x7fff; + var h = this[i++]>>15; + var m = xh*l+h*xl; + l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff); + c = (l>>>30)+(m>>>15)+xh*h+(c>>>30); + w[j++] = l&0x3fffffff; + } + return c; + } + // Alternately, set max digit bits to 28 since some + // browsers slow down when dealing with 32-bit numbers. + function am3(i,x,w,j,c,n) { + var xl = x&0x3fff, xh = x>>14; + while(--n >= 0) { + var l = this[i]&0x3fff; + var h = this[i++]>>14; + var m = xh*l+h*xl; + l = xl*l+((m&0x3fff)<<14)+w[j]+c; + c = (l>>28)+(m>>14)+xh*h; + w[j++] = l&0xfffffff; + } + return c; + } + var inBrowser = typeof navigator !== "undefined"; + if(inBrowser && j_lm && (navigator.appName == "Microsoft Internet Explorer")) { + BigInteger.prototype.am = am2; + dbits = 30; + } + else if(inBrowser && j_lm && (navigator.appName != "Netscape")) { + BigInteger.prototype.am = am1; + dbits = 26; + } + else { // Mozilla/Netscape seems to prefer am3 + BigInteger.prototype.am = am3; + dbits = 28; + } + + BigInteger.prototype.DB = dbits; + BigInteger.prototype.DM = ((1<= 0; --i) r[i] = this[i]; + r.t = this.t; + r.s = this.s; + } + + // (protected) set from integer value x, -DV <= x < DV + function bnpFromInt(x) { + this.t = 1; + this.s = (x<0)?-1:0; + if(x > 0) this[0] = x; + else if(x < -1) this[0] = x+this.DV; + else this.t = 0; + } + + // return bigint initialized to value + function nbv(i) { var r = nbi(); r.fromInt(i); return r; } + + // (protected) set from string and radix + function bnpFromString(s,b) { + var k; + if(b == 16) k = 4; + else if(b == 8) k = 3; + else if(b == 256) k = 8; // byte array + else if(b == 2) k = 1; + else if(b == 32) k = 5; + else if(b == 4) k = 2; + else { this.fromRadix(s,b); return; } + this.t = 0; + this.s = 0; + var i = s.length, mi = false, sh = 0; + while(--i >= 0) { + var x = (k==8)?s[i]&0xff:intAt(s,i); + if(x < 0) { + if(s.charAt(i) == "-") mi = true; + continue; + } + mi = false; + if(sh == 0) + this[this.t++] = x; + else if(sh+k > this.DB) { + this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<>(this.DB-sh)); + } + else + this[this.t-1] |= x<= this.DB) sh -= this.DB; + } + if(k == 8 && (s[0]&0x80) != 0) { + this.s = -1; + if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)< 0 && this[this.t-1] == c) --this.t; + } + + // (public) return string representation in given radix + function bnToString(b) { + if(this.s < 0) return "-"+this.negate().toString(b); + var k; + if(b == 16) k = 4; + else if(b == 8) k = 3; + else if(b == 2) k = 1; + else if(b == 32) k = 5; + else if(b == 4) k = 2; + else return this.toRadix(b); + var km = (1< 0) { + if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); } + while(i >= 0) { + if(p < k) { + d = (this[i]&((1<>(p+=this.DB-k); + } + else { + d = (this[i]>>(p-=k))&km; + if(p <= 0) { p += this.DB; --i; } + } + if(d > 0) m = true; + if(m) r += int2char(d); + } + } + return m?r:"0"; + } + + // (public) -this + function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; } + + // (public) |this| + function bnAbs() { return (this.s<0)?this.negate():this; } + + // (public) return + if this > a, - if this < a, 0 if equal + function bnCompareTo(a) { + var r = this.s-a.s; + if(r != 0) return r; + var i = this.t; + r = i-a.t; + if(r != 0) return (this.s<0)?-r:r; + while(--i >= 0) if((r=this[i]-a[i]) != 0) return r; + return 0; + } + + // returns bit length of the integer x + function nbits(x) { + var r = 1, t; + if((t=x>>>16) != 0) { x = t; r += 16; } + if((t=x>>8) != 0) { x = t; r += 8; } + if((t=x>>4) != 0) { x = t; r += 4; } + if((t=x>>2) != 0) { x = t; r += 2; } + if((t=x>>1) != 0) { x = t; r += 1; } + return r; + } + + // (public) return the number of bits in "this" + function bnBitLength() { + if(this.t <= 0) return 0; + return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM)); + } + + // (protected) r = this << n*DB + function bnpDLShiftTo(n,r) { + var i; + for(i = this.t-1; i >= 0; --i) r[i+n] = this[i]; + for(i = n-1; i >= 0; --i) r[i] = 0; + r.t = this.t+n; + r.s = this.s; + } + + // (protected) r = this >> n*DB + function bnpDRShiftTo(n,r) { + for(var i = n; i < this.t; ++i) r[i-n] = this[i]; + r.t = Math.max(this.t-n,0); + r.s = this.s; + } + + // (protected) r = this << n + function bnpLShiftTo(n,r) { + var bs = n%this.DB; + var cbs = this.DB-bs; + var bm = (1<= 0; --i) { + r[i+ds+1] = (this[i]>>cbs)|c; + c = (this[i]&bm)<= 0; --i) r[i] = 0; + r[ds] = c; + r.t = this.t+ds+1; + r.s = this.s; + r.clamp(); + } + + // (protected) r = this >> n + function bnpRShiftTo(n,r) { + r.s = this.s; + var ds = Math.floor(n/this.DB); + if(ds >= this.t) { r.t = 0; return; } + var bs = n%this.DB; + var cbs = this.DB-bs; + var bm = (1<>bs; + for(var i = ds+1; i < this.t; ++i) { + r[i-ds-1] |= (this[i]&bm)<>bs; + } + if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<>= this.DB; + } + if(a.t < this.t) { + c -= a.s; + while(i < this.t) { + c += this[i]; + r[i++] = c&this.DM; + c >>= this.DB; + } + c += this.s; + } + else { + c += this.s; + while(i < a.t) { + c -= a[i]; + r[i++] = c&this.DM; + c >>= this.DB; + } + c -= a.s; + } + r.s = (c<0)?-1:0; + if(c < -1) r[i++] = this.DV+c; + else if(c > 0) r[i++] = c; + r.t = i; + r.clamp(); + } + + // (protected) r = this * a, r != this,a (HAC 14.12) + // "this" should be the larger one if appropriate. + function bnpMultiplyTo(a,r) { + var x = this.abs(), y = a.abs(); + var i = x.t; + r.t = i+y.t; + while(--i >= 0) r[i] = 0; + for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t); + r.s = 0; + r.clamp(); + if(this.s != a.s) BigInteger.ZERO.subTo(r,r); + } + + // (protected) r = this^2, r != this (HAC 14.16) + function bnpSquareTo(r) { + var x = this.abs(); + var i = r.t = 2*x.t; + while(--i >= 0) r[i] = 0; + for(i = 0; i < x.t-1; ++i) { + var c = x.am(i,x[i],r,2*i,0,1); + if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) { + r[i+x.t] -= x.DV; + r[i+x.t+1] = 1; + } + } + if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1); + r.s = 0; + r.clamp(); + } + + // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20) + // r != q, this != m. q or r may be null. + function bnpDivRemTo(m,q,r) { + var pm = m.abs(); + if(pm.t <= 0) return; + var pt = this.abs(); + if(pt.t < pm.t) { + if(q != null) q.fromInt(0); + if(r != null) this.copyTo(r); + return; + } + if(r == null) r = nbi(); + var y = nbi(), ts = this.s, ms = m.s; + var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus + if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } + else { pm.copyTo(y); pt.copyTo(r); } + var ys = y.t; + var y0 = y[ys-1]; + if(y0 == 0) return; + var yt = y0*(1<1)?y[ys-2]>>this.F2:0); + var d1 = this.FV/yt, d2 = (1<= 0) { + r[r.t++] = 1; + r.subTo(t,r); + } + BigInteger.ONE.dlShiftTo(ys,t); + t.subTo(y,y); // "negative" y so we can replace sub with am later + while(y.t < ys) y[y.t++] = 0; + while(--j >= 0) { + // Estimate quotient digit + var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2); + if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out + y.dlShiftTo(j,t); + r.subTo(t,r); + while(r[i] < --qd) r.subTo(t,r); + } + } + if(q != null) { + r.drShiftTo(ys,q); + if(ts != ms) BigInteger.ZERO.subTo(q,q); + } + r.t = ys; + r.clamp(); + if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder + if(ts < 0) BigInteger.ZERO.subTo(r,r); + } + + // (public) this mod a + function bnMod(a) { + var r = nbi(); + this.abs().divRemTo(a,null,r); + if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r); + return r; + } + + // Modular reduction using "classic" algorithm + function Classic(m) { this.m = m; } + function cConvert(x) { + if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m); + else return x; + } + function cRevert(x) { return x; } + function cReduce(x) { x.divRemTo(this.m,null,x); } + function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } + function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); } + + Classic.prototype.convert = cConvert; + Classic.prototype.revert = cRevert; + Classic.prototype.reduce = cReduce; + Classic.prototype.mulTo = cMulTo; + Classic.prototype.sqrTo = cSqrTo; + + // (protected) return "-1/this % 2^DB"; useful for Mont. reduction + // justification: + // xy == 1 (mod m) + // xy = 1+km + // xy(2-xy) = (1+km)(1-km) + // x[y(2-xy)] = 1-k^2m^2 + // x[y(2-xy)] == 1 (mod m^2) + // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2 + // should reduce x and y(2-xy) by m^2 at each step to keep size bounded. + // JS multiply "overflows" differently from C/C++, so care is needed here. + function bnpInvDigit() { + if(this.t < 1) return 0; + var x = this[0]; + if((x&1) == 0) return 0; + var y = x&3; // y == 1/x mod 2^2 + y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4 + y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8 + y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16 + // last step - calculate inverse mod DV directly; + // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints + y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits + // we really want the negative inverse, and -DV < y < DV + return (y>0)?this.DV-y:-y; + } + + // Montgomery reduction + function Montgomery(m) { + this.m = m; + this.mp = m.invDigit(); + this.mpl = this.mp&0x7fff; + this.mph = this.mp>>15; + this.um = (1<<(m.DB-15))-1; + this.mt2 = 2*m.t; + } + + // xR mod m + function montConvert(x) { + var r = nbi(); + x.abs().dlShiftTo(this.m.t,r); + r.divRemTo(this.m,null,r); + if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r); + return r; + } + + // x/R mod m + function montRevert(x) { + var r = nbi(); + x.copyTo(r); + this.reduce(r); + return r; + } + + // x = x/R mod m (HAC 14.32) + function montReduce(x) { + while(x.t <= this.mt2) // pad x so am has enough room later + x[x.t++] = 0; + for(var i = 0; i < this.m.t; ++i) { + // faster way of calculating u0 = x[i]*mp mod DV + var j = x[i]&0x7fff; + var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM; + // use am to combine the multiply-shift-add into one call + j = i+this.m.t; + x[j] += this.m.am(0,u0,x,i,0,this.m.t); + // propagate carry + while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; } + } + x.clamp(); + x.drShiftTo(this.m.t,x); + if(x.compareTo(this.m) >= 0) x.subTo(this.m,x); + } + + // r = "x^2/R mod m"; x != r + function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); } + + // r = "xy/R mod m"; x,y != r + function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } + + Montgomery.prototype.convert = montConvert; + Montgomery.prototype.revert = montRevert; + Montgomery.prototype.reduce = montReduce; + Montgomery.prototype.mulTo = montMulTo; + Montgomery.prototype.sqrTo = montSqrTo; + + // (protected) true iff this is even + function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; } + + // (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79) + function bnpExp(e,z) { + if(e > 0xffffffff || e < 1) return BigInteger.ONE; + var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1; + g.copyTo(r); + while(--i >= 0) { + z.sqrTo(r,r2); + if((e&(1< 0) z.mulTo(r2,g,r); + else { var t = r; r = r2; r2 = t; } + } + return z.revert(r); + } + + // (public) this^e % m, 0 <= e < 2^32 + function bnModPowInt(e,m) { + var z; + if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m); + return this.exp(e,z); + } + + // protected + BigInteger.prototype.copyTo = bnpCopyTo; + BigInteger.prototype.fromInt = bnpFromInt; + BigInteger.prototype.fromString = bnpFromString; + BigInteger.prototype.clamp = bnpClamp; + BigInteger.prototype.dlShiftTo = bnpDLShiftTo; + BigInteger.prototype.drShiftTo = bnpDRShiftTo; + BigInteger.prototype.lShiftTo = bnpLShiftTo; + BigInteger.prototype.rShiftTo = bnpRShiftTo; + BigInteger.prototype.subTo = bnpSubTo; + BigInteger.prototype.multiplyTo = bnpMultiplyTo; + BigInteger.prototype.squareTo = bnpSquareTo; + BigInteger.prototype.divRemTo = bnpDivRemTo; + BigInteger.prototype.invDigit = bnpInvDigit; + BigInteger.prototype.isEven = bnpIsEven; + BigInteger.prototype.exp = bnpExp; + + // public + BigInteger.prototype.toString = bnToString; + BigInteger.prototype.negate = bnNegate; + BigInteger.prototype.abs = bnAbs; + BigInteger.prototype.compareTo = bnCompareTo; + BigInteger.prototype.bitLength = bnBitLength; + BigInteger.prototype.mod = bnMod; + BigInteger.prototype.modPowInt = bnModPowInt; + + // "constants" + BigInteger.ZERO = nbv(0); + BigInteger.ONE = nbv(1); + + // Copyright (c) 2005-2009 Tom Wu + // All Rights Reserved. + // See "LICENSE" for details. + + // Extended JavaScript BN functions, required for RSA private ops. + + // Version 1.1: new BigInteger("0", 10) returns "proper" zero + // Version 1.2: square() API, isProbablePrime fix + + // (public) + function bnClone() { var r = nbi(); this.copyTo(r); return r; } + + // (public) return value as integer + function bnIntValue() { + if(this.s < 0) { + if(this.t == 1) return this[0]-this.DV; + else if(this.t == 0) return -1; + } + else if(this.t == 1) return this[0]; + else if(this.t == 0) return 0; + // assumes 16 < DB < 32 + return ((this[1]&((1<<(32-this.DB))-1))<>24; } + + // (public) return value as short (assumes DB>=16) + function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; } + + // (protected) return x s.t. r^x < DV + function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); } + + // (public) 0 if this == 0, 1 if this > 0 + function bnSigNum() { + if(this.s < 0) return -1; + else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0; + else return 1; + } + + // (protected) convert to radix string + function bnpToRadix(b) { + if(b == null) b = 10; + if(this.signum() == 0 || b < 2 || b > 36) return "0"; + var cs = this.chunkSize(b); + var a = Math.pow(b,cs); + var d = nbv(a), y = nbi(), z = nbi(), r = ""; + this.divRemTo(d,y,z); + while(y.signum() > 0) { + r = (a+z.intValue()).toString(b).substr(1) + r; + y.divRemTo(d,y,z); + } + return z.intValue().toString(b) + r; + } + + // (protected) convert from radix string + function bnpFromRadix(s,b) { + this.fromInt(0); + if(b == null) b = 10; + var cs = this.chunkSize(b); + var d = Math.pow(b,cs), mi = false, j = 0, w = 0; + for(var i = 0; i < s.length; ++i) { + var x = intAt(s,i); + if(x < 0) { + if(s.charAt(i) == "-" && this.signum() == 0) mi = true; + continue; + } + w = b*w+x; + if(++j >= cs) { + this.dMultiply(d); + this.dAddOffset(w,0); + j = 0; + w = 0; + } + } + if(j > 0) { + this.dMultiply(Math.pow(b,j)); + this.dAddOffset(w,0); + } + if(mi) BigInteger.ZERO.subTo(this,this); + } + + // (protected) alternate constructor + function bnpFromNumber(a,b,c) { + if("number" == typeof b) { + // new BigInteger(int,int,RNG) + if(a < 2) this.fromInt(1); + else { + this.fromNumber(a,c); + if(!this.testBit(a-1)) // force MSB set + this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this); + if(this.isEven()) this.dAddOffset(1,0); // force odd + while(!this.isProbablePrime(b)) { + this.dAddOffset(2,0); + if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this); + } + } + } + else { + // new BigInteger(int,RNG) + var x = new Array(), t = a&7; + x.length = (a>>3)+1; + b.nextBytes(x); + if(t > 0) x[0] &= ((1< 0) { + if(p < this.DB && (d = this[i]>>p) != (this.s&this.DM)>>p) + r[k++] = d|(this.s<<(this.DB-p)); + while(i >= 0) { + if(p < 8) { + d = (this[i]&((1<>(p+=this.DB-8); + } + else { + d = (this[i]>>(p-=8))&0xff; + if(p <= 0) { p += this.DB; --i; } + } + if((d&0x80) != 0) d |= -256; + if(k == 0 && (this.s&0x80) != (d&0x80)) ++k; + if(k > 0 || d != this.s) r[k++] = d; + } + } + return r; + } + + function bnEquals(a) { return(this.compareTo(a)==0); } + function bnMin(a) { return(this.compareTo(a)<0)?this:a; } + function bnMax(a) { return(this.compareTo(a)>0)?this:a; } + + // (protected) r = this op a (bitwise) + function bnpBitwiseTo(a,op,r) { + var i, f, m = Math.min(a.t,this.t); + for(i = 0; i < m; ++i) r[i] = op(this[i],a[i]); + if(a.t < this.t) { + f = a.s&this.DM; + for(i = m; i < this.t; ++i) r[i] = op(this[i],f); + r.t = this.t; + } + else { + f = this.s&this.DM; + for(i = m; i < a.t; ++i) r[i] = op(f,a[i]); + r.t = a.t; + } + r.s = op(this.s,a.s); + r.clamp(); + } + + // (public) this & a + function op_and(x,y) { return x&y; } + function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; } + + // (public) this | a + function op_or(x,y) { return x|y; } + function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; } + + // (public) this ^ a + function op_xor(x,y) { return x^y; } + function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; } + + // (public) this & ~a + function op_andnot(x,y) { return x&~y; } + function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; } + + // (public) ~this + function bnNot() { + var r = nbi(); + for(var i = 0; i < this.t; ++i) r[i] = this.DM&~this[i]; + r.t = this.t; + r.s = ~this.s; + return r; + } + + // (public) this << n + function bnShiftLeft(n) { + var r = nbi(); + if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r); + return r; + } + + // (public) this >> n + function bnShiftRight(n) { + var r = nbi(); + if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r); + return r; + } + + // return index of lowest 1-bit in x, x < 2^31 + function lbit(x) { + if(x == 0) return -1; + var r = 0; + if((x&0xffff) == 0) { x >>= 16; r += 16; } + if((x&0xff) == 0) { x >>= 8; r += 8; } + if((x&0xf) == 0) { x >>= 4; r += 4; } + if((x&3) == 0) { x >>= 2; r += 2; } + if((x&1) == 0) ++r; + return r; + } + + // (public) returns index of lowest 1-bit (or -1 if none) + function bnGetLowestSetBit() { + for(var i = 0; i < this.t; ++i) + if(this[i] != 0) return i*this.DB+lbit(this[i]); + if(this.s < 0) return this.t*this.DB; + return -1; + } + + // return number of 1 bits in x + function cbit(x) { + var r = 0; + while(x != 0) { x &= x-1; ++r; } + return r; + } + + // (public) return number of set bits + function bnBitCount() { + var r = 0, x = this.s&this.DM; + for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x); + return r; + } + + // (public) true iff nth bit is set + function bnTestBit(n) { + var j = Math.floor(n/this.DB); + if(j >= this.t) return(this.s!=0); + return((this[j]&(1<<(n%this.DB)))!=0); + } + + // (protected) this op (1<>= this.DB; + } + if(a.t < this.t) { + c += a.s; + while(i < this.t) { + c += this[i]; + r[i++] = c&this.DM; + c >>= this.DB; + } + c += this.s; + } + else { + c += this.s; + while(i < a.t) { + c += a[i]; + r[i++] = c&this.DM; + c >>= this.DB; + } + c += a.s; + } + r.s = (c<0)?-1:0; + if(c > 0) r[i++] = c; + else if(c < -1) r[i++] = this.DV+c; + r.t = i; + r.clamp(); + } + + // (public) this + a + function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; } + + // (public) this - a + function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; } + + // (public) this * a + function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; } + + // (public) this^2 + function bnSquare() { var r = nbi(); this.squareTo(r); return r; } + + // (public) this / a + function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; } + + // (public) this % a + function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; } + + // (public) [this/a,this%a] + function bnDivideAndRemainder(a) { + var q = nbi(), r = nbi(); + this.divRemTo(a,q,r); + return new Array(q,r); + } + + // (protected) this *= n, this >= 0, 1 < n < DV + function bnpDMultiply(n) { + this[this.t] = this.am(0,n-1,this,0,0,this.t); + ++this.t; + this.clamp(); + } + + // (protected) this += n << w words, this >= 0 + function bnpDAddOffset(n,w) { + if(n == 0) return; + while(this.t <= w) this[this.t++] = 0; + this[w] += n; + while(this[w] >= this.DV) { + this[w] -= this.DV; + if(++w >= this.t) this[this.t++] = 0; + ++this[w]; + } + } + + // A "null" reducer + function NullExp() {} + function nNop(x) { return x; } + function nMulTo(x,y,r) { x.multiplyTo(y,r); } + function nSqrTo(x,r) { x.squareTo(r); } + + NullExp.prototype.convert = nNop; + NullExp.prototype.revert = nNop; + NullExp.prototype.mulTo = nMulTo; + NullExp.prototype.sqrTo = nSqrTo; + + // (public) this^e + function bnPow(e) { return this.exp(e,new NullExp()); } + + // (protected) r = lower n words of "this * a", a.t <= n + // "this" should be the larger one if appropriate. + function bnpMultiplyLowerTo(a,n,r) { + var i = Math.min(this.t+a.t,n); + r.s = 0; // assumes a,this >= 0 + r.t = i; + while(i > 0) r[--i] = 0; + var j; + for(j = r.t-this.t; i < j; ++i) r[i+this.t] = this.am(0,a[i],r,i,0,this.t); + for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a[i],r,i,0,n-i); + r.clamp(); + } + + // (protected) r = "this * a" without lower n words, n > 0 + // "this" should be the larger one if appropriate. + function bnpMultiplyUpperTo(a,n,r) { + --n; + var i = r.t = this.t+a.t-n; + r.s = 0; // assumes a,this >= 0 + while(--i >= 0) r[i] = 0; + for(i = Math.max(n-this.t,0); i < a.t; ++i) + r[this.t+i-n] = this.am(n-i,a[i],r,0,0,this.t+i-n); + r.clamp(); + r.drShiftTo(1,r); + } + + // Barrett modular reduction + function Barrett(m) { + // setup Barrett + this.r2 = nbi(); + this.q3 = nbi(); + BigInteger.ONE.dlShiftTo(2*m.t,this.r2); + this.mu = this.r2.divide(m); + this.m = m; + } + + function barrettConvert(x) { + if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m); + else if(x.compareTo(this.m) < 0) return x; + else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; } + } + + function barrettRevert(x) { return x; } + + // x = x mod m (HAC 14.42) + function barrettReduce(x) { + x.drShiftTo(this.m.t-1,this.r2); + if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); } + this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3); + this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2); + while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1); + x.subTo(this.r2,x); + while(x.compareTo(this.m) >= 0) x.subTo(this.m,x); + } + + // r = x^2 mod m; x != r + function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); } + + // r = x*y mod m; x,y != r + function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } + + Barrett.prototype.convert = barrettConvert; + Barrett.prototype.revert = barrettRevert; + Barrett.prototype.reduce = barrettReduce; + Barrett.prototype.mulTo = barrettMulTo; + Barrett.prototype.sqrTo = barrettSqrTo; + + // (public) this^e % m (HAC 14.85) + function bnModPow(e,m) { + var i = e.bitLength(), k, r = nbv(1), z; + if(i <= 0) return r; + else if(i < 18) k = 1; + else if(i < 48) k = 3; + else if(i < 144) k = 4; + else if(i < 768) k = 5; + else k = 6; + if(i < 8) + z = new Classic(m); + else if(m.isEven()) + z = new Barrett(m); + else + z = new Montgomery(m); + + // precomputation + var g = new Array(), n = 3, k1 = k-1, km = (1< 1) { + var g2 = nbi(); + z.sqrTo(g[1],g2); + while(n <= km) { + g[n] = nbi(); + z.mulTo(g2,g[n-2],g[n]); + n += 2; + } + } + + var j = e.t-1, w, is1 = true, r2 = nbi(), t; + i = nbits(e[j])-1; + while(j >= 0) { + if(i >= k1) w = (e[j]>>(i-k1))&km; + else { + w = (e[j]&((1<<(i+1))-1))<<(k1-i); + if(j > 0) w |= e[j-1]>>(this.DB+i-k1); + } + + n = k; + while((w&1) == 0) { w >>= 1; --n; } + if((i -= n) < 0) { i += this.DB; --j; } + if(is1) { // ret == 1, don't bother squaring or multiplying it + g[w].copyTo(r); + is1 = false; + } + else { + while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; } + if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; } + z.mulTo(r2,g[w],r); + } + + while(j >= 0 && (e[j]&(1< 0) { + x.rShiftTo(g,x); + y.rShiftTo(g,y); + } + while(x.signum() > 0) { + if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x); + if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y); + if(x.compareTo(y) >= 0) { + x.subTo(y,x); + x.rShiftTo(1,x); + } + else { + y.subTo(x,y); + y.rShiftTo(1,y); + } + } + if(g > 0) y.lShiftTo(g,y); + return y; + } + + // (protected) this % n, n < 2^26 + function bnpModInt(n) { + if(n <= 0) return 0; + var d = this.DV%n, r = (this.s<0)?n-1:0; + if(this.t > 0) + if(d == 0) r = this[0]%n; + else for(var i = this.t-1; i >= 0; --i) r = (d*r+this[i])%n; + return r; + } + + // (public) 1/this % m (HAC 14.61) + function bnModInverse(m) { + var ac = m.isEven(); + if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO; + var u = m.clone(), v = this.clone(); + var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1); + while(u.signum() != 0) { + while(u.isEven()) { + u.rShiftTo(1,u); + if(ac) { + if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); } + a.rShiftTo(1,a); + } + else if(!b.isEven()) b.subTo(m,b); + b.rShiftTo(1,b); + } + while(v.isEven()) { + v.rShiftTo(1,v); + if(ac) { + if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); } + c.rShiftTo(1,c); + } + else if(!d.isEven()) d.subTo(m,d); + d.rShiftTo(1,d); + } + if(u.compareTo(v) >= 0) { + u.subTo(v,u); + if(ac) a.subTo(c,a); + b.subTo(d,b); + } + else { + v.subTo(u,v); + if(ac) c.subTo(a,c); + d.subTo(b,d); + } + } + if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO; + if(d.compareTo(m) >= 0) return d.subtract(m); + if(d.signum() < 0) d.addTo(m,d); else return d; + if(d.signum() < 0) return d.add(m); else return d; + } + + var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997]; + var lplim = (1<<26)/lowprimes[lowprimes.length-1]; + + // (public) test primality with certainty >= 1-.5^t + function bnIsProbablePrime(t) { + var i, x = this.abs(); + if(x.t == 1 && x[0] <= lowprimes[lowprimes.length-1]) { + for(i = 0; i < lowprimes.length; ++i) + if(x[0] == lowprimes[i]) return true; + return false; + } + if(x.isEven()) return false; + i = 1; + while(i < lowprimes.length) { + var m = lowprimes[i], j = i+1; + while(j < lowprimes.length && m < lplim) m *= lowprimes[j++]; + m = x.modInt(m); + while(i < j) if(m%lowprimes[i++] == 0) return false; + } + return x.millerRabin(t); + } + + // (protected) true if probably prime (HAC 4.24, Miller-Rabin) + function bnpMillerRabin(t) { + var n1 = this.subtract(BigInteger.ONE); + var k = n1.getLowestSetBit(); + if(k <= 0) return false; + var r = n1.shiftRight(k); + t = (t+1)>>1; + if(t > lowprimes.length) t = lowprimes.length; + var a = nbi(); + for(var i = 0; i < t; ++i) { + //Pick bases at random, instead of starting at 2 + a.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]); + var y = a.modPow(r,this); + if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) { + var j = 1; + while(j++ < k && y.compareTo(n1) != 0) { + y = y.modPowInt(2,this); + if(y.compareTo(BigInteger.ONE) == 0) return false; + } + if(y.compareTo(n1) != 0) return false; + } + } + return true; + } + + // protected + BigInteger.prototype.chunkSize = bnpChunkSize; + BigInteger.prototype.toRadix = bnpToRadix; + BigInteger.prototype.fromRadix = bnpFromRadix; + BigInteger.prototype.fromNumber = bnpFromNumber; + BigInteger.prototype.bitwiseTo = bnpBitwiseTo; + BigInteger.prototype.changeBit = bnpChangeBit; + BigInteger.prototype.addTo = bnpAddTo; + BigInteger.prototype.dMultiply = bnpDMultiply; + BigInteger.prototype.dAddOffset = bnpDAddOffset; + BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo; + BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo; + BigInteger.prototype.modInt = bnpModInt; + BigInteger.prototype.millerRabin = bnpMillerRabin; + + // public + BigInteger.prototype.clone = bnClone; + BigInteger.prototype.intValue = bnIntValue; + BigInteger.prototype.byteValue = bnByteValue; + BigInteger.prototype.shortValue = bnShortValue; + BigInteger.prototype.signum = bnSigNum; + BigInteger.prototype.toByteArray = bnToByteArray; + BigInteger.prototype.equals = bnEquals; + BigInteger.prototype.min = bnMin; + BigInteger.prototype.max = bnMax; + BigInteger.prototype.and = bnAnd; + BigInteger.prototype.or = bnOr; + BigInteger.prototype.xor = bnXor; + BigInteger.prototype.andNot = bnAndNot; + BigInteger.prototype.not = bnNot; + BigInteger.prototype.shiftLeft = bnShiftLeft; + BigInteger.prototype.shiftRight = bnShiftRight; + BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit; + BigInteger.prototype.bitCount = bnBitCount; + BigInteger.prototype.testBit = bnTestBit; + BigInteger.prototype.setBit = bnSetBit; + BigInteger.prototype.clearBit = bnClearBit; + BigInteger.prototype.flipBit = bnFlipBit; + BigInteger.prototype.add = bnAdd; + BigInteger.prototype.subtract = bnSubtract; + BigInteger.prototype.multiply = bnMultiply; + BigInteger.prototype.divide = bnDivide; + BigInteger.prototype.remainder = bnRemainder; + BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder; + BigInteger.prototype.modPow = bnModPow; + BigInteger.prototype.modInverse = bnModInverse; + BigInteger.prototype.pow = bnPow; + BigInteger.prototype.gcd = bnGCD; + BigInteger.prototype.isProbablePrime = bnIsProbablePrime; + + // JSBN-specific extension + BigInteger.prototype.square = bnSquare; + + // Expose the Barrett function + BigInteger.prototype.Barrett = Barrett + + // BigInteger interfaces not implemented in jsbn: + + // BigInteger(int signum, byte[] magnitude) + // double doubleValue() + // float floatValue() + // int hashCode() + // long longValue() + // static BigInteger valueOf(long val) + + // Random number generator - requires a PRNG backend, e.g. prng4.js + + // For best results, put code like + // + // in your main HTML document. + + var rng_state; + var rng_pool; + var rng_pptr; + + // Mix in a 32-bit integer into the pool + function rng_seed_int(x) { + rng_pool[rng_pptr++] ^= x & 255; + rng_pool[rng_pptr++] ^= (x >> 8) & 255; + rng_pool[rng_pptr++] ^= (x >> 16) & 255; + rng_pool[rng_pptr++] ^= (x >> 24) & 255; + if(rng_pptr >= rng_psize) rng_pptr -= rng_psize; + } + + // Mix in the current time (w/milliseconds) into the pool + function rng_seed_time() { + rng_seed_int(new Date().getTime()); + } + + // Initialize the pool with junk if needed. + if(rng_pool == null) { + rng_pool = new Array(); + rng_pptr = 0; + var t; + if(typeof window !== "undefined" && window.crypto) { + if (window.crypto.getRandomValues) { + // Use webcrypto if available + var ua = new Uint8Array(32); + window.crypto.getRandomValues(ua); + for(t = 0; t < 32; ++t) + rng_pool[rng_pptr++] = ua[t]; + } + else if(navigator.appName == "Netscape" && navigator.appVersion < "5") { + // Extract entropy (256 bits) from NS4 RNG if available + var z = window.crypto.random(32); + for(t = 0; t < z.length; ++t) + rng_pool[rng_pptr++] = z.charCodeAt(t) & 255; + } + } + while(rng_pptr < rng_psize) { // extract some randomness from Math.random() + t = Math.floor(65536 * Math.random()); + rng_pool[rng_pptr++] = t >>> 8; + rng_pool[rng_pptr++] = t & 255; + } + rng_pptr = 0; + rng_seed_time(); + //rng_seed_int(window.screenX); + //rng_seed_int(window.screenY); + } + + function rng_get_byte() { + if(rng_state == null) { + rng_seed_time(); + rng_state = prng_newstate(); + rng_state.init(rng_pool); + for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr) + rng_pool[rng_pptr] = 0; + rng_pptr = 0; + //rng_pool = null; + } + // TODO: allow reseeding after first request + return rng_state.next(); + } + + function rng_get_bytes(ba) { + var i; + for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte(); + } + + function SecureRandom() {} + + SecureRandom.prototype.nextBytes = rng_get_bytes; + + // prng4.js - uses Arcfour as a PRNG + + function Arcfour() { + this.i = 0; + this.j = 0; + this.S = new Array(); + } + + // Initialize arcfour context from key, an array of ints, each from [0..255] + function ARC4init(key) { + var i, j, t; + for(i = 0; i < 256; ++i) + this.S[i] = i; + j = 0; + for(i = 0; i < 256; ++i) { + j = (j + this.S[i] + key[i % key.length]) & 255; + t = this.S[i]; + this.S[i] = this.S[j]; + this.S[j] = t; + } + this.i = 0; + this.j = 0; + } + + function ARC4next() { + var t; + this.i = (this.i + 1) & 255; + this.j = (this.j + this.S[this.i]) & 255; + t = this.S[this.i]; + this.S[this.i] = this.S[this.j]; + this.S[this.j] = t; + return this.S[(t + this.S[this.i]) & 255]; + } + + Arcfour.prototype.init = ARC4init; + Arcfour.prototype.next = ARC4next; + + // Plug in your RNG constructor here + function prng_newstate() { + return new Arcfour(); + } + + // Pool size must be a multiple of 4 and greater than 32. + // An array of bytes the size of the pool will be passed to init() + var rng_psize = 256; + + if (typeof exports !== 'undefined') { + exports = module.exports = { + BigInteger: BigInteger, + SecureRandom: SecureRandom, + }; + } else { + this.BigInteger = BigInteger; + this.SecureRandom = SecureRandom; + } + +}).call(this); diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/package.json new file mode 100644 index 00000000000000..838d035ffcd59b --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/package.json @@ -0,0 +1,79 @@ +{ + "_args": [ + [ + "jsbn@>=0.1.0 <0.2.0", + "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk" + ] + ], + "_from": "jsbn@>=0.1.0 <0.2.0", + "_id": "jsbn@0.1.0", + "_inCache": true, + "_installable": true, + "_location": "/request/http-signature/sshpk/jsbn", + "_nodeVersion": "0.12.2", + "_npmUser": { + "email": "andyperlitch@gmail.com", + "name": "andyperlitch" + }, + "_npmVersion": "2.7.4", + "_phantomChildren": {}, + "_requested": { + "name": "jsbn", + "raw": "jsbn@>=0.1.0 <0.2.0", + "rawSpec": ">=0.1.0 <0.2.0", + "scope": null, + "spec": ">=0.1.0 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/request/http-signature/sshpk", + "/request/http-signature/sshpk/ecc-jsbn", + "/request/http-signature/sshpk/jodid25519" + ], + "_resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.0.tgz", + "_shasum": "650987da0dd74f4ebf5a11377a2aa2d273e97dfd", + "_shrinkwrap": null, + "_spec": "jsbn@>=0.1.0 <0.2.0", + "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk", + "author": { + "name": "Tom Wu" + }, + "bugs": { + "url": "https://github.com/andyperlitch/jsbn/issues" + }, + "dependencies": {}, + "description": "The jsbn library is a fast, portable implementation of large-number math in pure JavaScript, enabling public-key crypto and other applications on desktop and mobile browsers.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "650987da0dd74f4ebf5a11377a2aa2d273e97dfd", + "tarball": "http://registry.npmjs.org/jsbn/-/jsbn-0.1.0.tgz" + }, + "gitHead": "148a967b112806e63ddeeed78ee7938eef74c84a", + "homepage": "https://github.com/andyperlitch/jsbn", + "keywords": [ + "big", + "biginteger", + "bignumber", + "integer" + ], + "license": "BSD", + "main": "index.js", + "maintainers": [ + { + "name": "andyperlitch", + "email": "andyperlitch@gmail.com" + } + ], + "name": "jsbn", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/andyperlitch/jsbn.git" + }, + "scripts": { + "test": "mocha test.js" + }, + "version": "0.1.0" +} diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/.npmignore b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/.npmignore new file mode 100644 index 00000000000000..7d98dcbd2d360a --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/.npmignore @@ -0,0 +1,4 @@ +.eslintrc +.travis.yml +bower.json +test diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/CHANGELOG.md b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/CHANGELOG.md new file mode 100644 index 00000000000000..a75b45f9c4b81e --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/CHANGELOG.md @@ -0,0 +1,128 @@ +TweetNaCl.js Changelog +====================== + + +v0.13.2 +------- + +* Fixed undefined variable bug in fast version of Poly1305. No worries, this + bug was *never* triggered. + +* Specified CC0 public domain dedication. + +* Updated development dependencies. + + +v0.13.1 +------- + +* Exclude `crypto` and `buffer` modules from browserify builds. + + +v0.13.0 +------- + +* Made `nacl-fast` the default version in NPM package. Now + `require("tweetnacl")` will use fast version; to get the original version, + use `require("tweetnacl/nacl.js")`. + +* Cleanup temporary array after generating random bytes. + + +v0.12.2 +------- + +* Improved performance of curve operations, making `nacl.scalarMult`, `nacl.box`, + `nacl.sign` and related functions up to 3x faster in `nacl-fast` version. + + +v0.12.1 +------- + +* Significantly improved performance of Salsa20 (~1.5x faster) and + Poly1305 (~3.5x faster) in `nacl-fast` version. + + +v0.12.0 +------- + +* Instead of using the given secret key directly, TweetNaCl.js now copies it to + a new array in `nacl.box.keyPair.fromSecretKey` and + `nacl.sign.keyPair.fromSecretKey`. + + +v0.11.2 +------- + +* Added new constant: `nacl.sign.seedLength`. + + +v0.11.1 +------- + +* Even faster hash for both short and long inputs (in `nacl-fast`). + + +v0.11.0 +------- + +* Implement `nacl.sign.keyPair.fromSeed` to enable creation of sign key pairs + deterministically from a 32-byte seed. (It behaves like + [libsodium's](http://doc.libsodium.org/public-key_cryptography/public-key_signatures.html) + `crypto_sign_seed_keypair`: the seed becomes a secret part of the secret key.) + +* Fast version now has an improved hash implementation that is 2x-5x faster. + +* Fixed benchmarks, which may have produced incorrect measurements. + + +v0.10.1 +------- + +* Exported undocumented `nacl.lowlevel.crypto_core_hsalsa20`. + + +v0.10.0 +------- + +* **Signature API breaking change!** `nacl.sign` and `nacl.sign.open` now deal + with signed messages, and new `nacl.sign.detached` and + `nacl.sign.detached.verify` are available. + + Previously, `nacl.sign` returned a signature, and `nacl.sign.open` accepted a + message and "detached" signature. This was unlike NaCl's API, which dealt with + signed messages (concatenation of signature and message). + + The new API is: + + nacl.sign(message, secretKey) -> signedMessage + nacl.sign.open(signedMessage, publicKey) -> message | null + + Since detached signatures are common, two new API functions were introduced: + + nacl.sign.detached(message, secretKey) -> signature + nacl.sign.detached.verify(message, signature, publicKey) -> true | false + + (Note that it's `verify`, not `open`, and it returns a boolean value, unlike + `open`, which returns an "unsigned" message.) + +* NPM package now comes without `test` directory to keep it small. + + +v0.9.2 +------ + +* Improved documentation. +* Fast version: increased theoretical message size limit from 2^32-1 to 2^52 + bytes in Poly1305 (and thus, secretbox and box). However this has no impact + in practice since JavaScript arrays or ArrayBuffers are limited to 32-bit + indexes, and most implementations won't allocate more than a gigabyte or so. + (Obviously, there are no tests for the correctness of implementation.) Also, + it's not recommended to use messages that large without splitting them into + smaller packets anyway. + + +v0.9.1 +------ + +* Initial release diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/README.md b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/README.md new file mode 100644 index 00000000000000..11bd3472c258d1 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/README.md @@ -0,0 +1,463 @@ +TweetNaCl.js +============ + +Port of [TweetNaCl](http://tweetnacl.cr.yp.to) / [NaCl](http://nacl.cr.yp.to/) +to JavaScript for modern browsers and Node.js. Public domain. + +[![Build Status](https://travis-ci.org/dchest/tweetnacl-js.svg?branch=master) +](https://travis-ci.org/dchest/tweetnacl-js) + +[Demo](https://dchest.github.io/tweetnacl-js/) + +**:warning: Beta version. The library is stable and API is frozen, however +it has not been independently reviewed. If you can help reviewing it, please +[contact me](mailto:dmitry@codingrobots.com).** + +Documentation +============= + +* [Overview](#overview) +* [Installation](#installation) +* [Usage](#usage) + * [Public-key authenticated encryption (box)](#public-key-authenticated-encryption-box) + * [Secret-key authenticated encryption (secretbox)](#secret-key-authenticated-encryption-secretbox) + * [Scalar multiplication](#scalar-multiplication) + * [Signatures](#signatures) + * [Hashing](#hashing) + * [Random bytes generation](#random-bytes-generation) + * [Constant-time comparison](#constant-time-comparison) + * [Utilities](#utilities) +* [Examples](#examples) +* [System requirements](#system-requirements) +* [Development and testing](#development-and-testing) +* [Contributors](#contributors) +* [Who uses it](#who-uses-it) + + +Overview +-------- + +The primary goal of this project is to produce a translation of TweetNaCl to +JavaScript which is as close as possible to the original C implementation, plus +a thin layer of idiomatic high-level API on top of it. + +There are two versions, you can use either of them: + +* `nacl.js` is the port of TweetNaCl with minimum differences from the + original + high-level API. + +* `nacl-fast.js` is like `nacl.js`, but with some functions replaced with + faster versions. + + +Installation +------------ + +You can install TweetNaCl.js via a package manager: + +[Bower](http://bower.io): + + $ bower install tweetnacl + +[NPM](https://www.npmjs.org/): + + $ npm install tweetnacl + +or [download source code](https://github.com/dchest/tweetnacl-js/releases). + + +Usage +------ + +All API functions accept and return bytes as `Uint8Array`s. If you need to +encode or decode strings, use functions from `nacl.util` namespace. + +### Public-key authenticated encryption (box) + +Implements *curve25519-xsalsa20-poly1305*. + +#### nacl.box.keyPair() + +Generates a new random key pair for box and returns it as an object with +`publicKey` and `secretKey` members: + + { + publicKey: ..., // Uint8Array with 32-byte public key + secretKey: ... // Uint8Array with 32-byte secret key + } + + +#### nacl.box.keyPair.fromSecretKey(secretKey) + +Returns a key pair for box with public key corresponding to the given secret +key. + +#### nacl.box(message, nonce, theirPublicKey, mySecretKey) + +Encrypt and authenticates message using peer's public key, our secret key, and +the given nonce, which must be unique for each distinct message for a key pair. + +Returns an encrypted and authenticated message, which is +`nacl.box.overheadLength` longer than the original message. + +#### nacl.box.open(box, nonce, theirPublicKey, mySecretKey) + +Authenticates and decrypts the given box with peer's public key, our secret +key, and the given nonce. + +Returns the original message, or `false` if authentication fails. + +#### nacl.box.before(theirPublicKey, mySecretKey) + +Returns a precomputed shared key which can be used in `nacl.box.after` and +`nacl.box.open.after`. + +#### nacl.box.after(message, nonce, sharedKey) + +Same as `nacl.box`, but uses a shared key precomputed with `nacl.box.before`. + +#### nacl.box.open.after(box, nonce, sharedKey) + +Same as `nacl.box.open`, but uses a shared key precomputed with `nacl.box.before`. + +#### nacl.box.publicKeyLength = 32 + +Length of public key in bytes. + +#### nacl.box.secretKeyLength = 32 + +Length of secret key in bytes. + +#### nacl.box.sharedKeyLength = 32 + +Length of precomputed shared key in bytes. + +#### nacl.box.nonceLength = 24 + +Length of nonce in bytes. + +#### nacl.box.overheadLength = 16 + +Length of overhead added to box compared to original message. + + +### Secret-key authenticated encryption (secretbox) + +Implements *xsalsa20-poly1305*. + +#### nacl.secretbox(message, nonce, key) + +Encrypt and authenticates message using the key and the nonce. The nonce must +be unique for each distinct message for this key. + +Returns an encrypted and authenticated message, which is +`nacl.secretbox.overheadLength` longer than the original message. + +#### nacl.secretbox.open(box, nonce, key) + +Authenticates and decrypts the given secret box using the key and the nonce. + +Returns the original message, or `false` if authentication fails. + +#### nacl.secretbox.keyLength = 32 + +Length of key in bytes. + +#### nacl.secretbox.nonceLength = 24 + +Length of nonce in bytes. + +#### nacl.secretbox.overheadLength = 16 + +Length of overhead added to secret box compared to original message. + + +### Scalar multiplication + +Implements *curve25519*. + +#### nacl.scalarMult(n, p) + +Multiplies an integer `n` by a group element `p` and returns the resulting +group element. + +#### nacl.scalarMult.base(n) + +Multiplies an integer `n` by a standard group element and returns the resulting +group element. + +#### nacl.scalarMult.scalarLength = 32 + +Length of scalar in bytes. + +#### nacl.scalarMult.groupElementLength = 32 + +Length of group element in bytes. + + +### Signatures + +Implements [ed25519](http://ed25519.cr.yp.to). + +#### nacl.sign.keyPair() + +Generates new random key pair for signing and returns it as an object with +`publicKey` and `secretKey` members: + + { + publicKey: ..., // Uint8Array with 32-byte public key + secretKey: ... // Uint8Array with 64-byte secret key + } + +#### nacl.sign.keyPair.fromSecretKey(secretKey) + +Returns a signing key pair with public key corresponding to the given +64-byte secret key. The secret key must have been generated by +`nacl.sign.keyPair` or `nacl.sign.keyPair.fromSeed`. + +#### nacl.sign.keyPair.fromSeed(seed) + +Returns a new signing key pair generated deterministically from a 32-byte seed. +The seed must contain enough entropy to be secure. This method is not +recommended for general use: instead, use `nacl.sign.keyPair` to generate a new +key pair from a random seed. + +#### nacl.sign(message, secretKey) + +Signs the message using the secret key and returns a signed message. + +#### nacl.sign.open(signedMessage, publicKey) + +Verifies the signed message and returns the message without signature. + +Returns `null` if verification failed. + +#### nacl.sign.detached(message, secretKey) + +Signs the message using the secret key and returns a signature. + +#### nacl.sign.detached.verify(message, signature, publicKey) + +Verifies the signature for the message and returns `true` if verification +succeeded or `false` if it failed. + +#### nacl.sign.publicKeyLength = 32 + +Length of signing public key in bytes. + +#### nacl.sign.secretKeyLength = 64 + +Length of signing secret key in bytes. + +#### nacl.sign.seedLength = 32 + +Length of seed for `nacl.sign.keyPair.fromSeed` in bytes. + +#### nacl.sign.signatureLength = 64 + +Length of signature in bytes. + + +### Hashing + +Implements *SHA-512*. + +#### nacl.hash(message) + +Returns SHA-512 hash of the message. + +#### nacl.hash.hashLength = 64 + +Length of hash in bytes. + + +### Random bytes generation + +#### nacl.randomBytes(length) + +Returns a `Uint8Array` of the given length containing random bytes of +cryptographic quality. + +**Implementation note** + +TweetNaCl.js uses the following methods to generate random bytes, +depending on the platform it runs on: + +* `window.crypto.getRandomValues` (WebCrypto standard) +* `window.msCrypto.getRandomValues` (Internet Explorer 11) +* `crypto.randomBytes` (Node.js) + +Note that browsers are required to throw `QuotaExceededError` exception if +requested `length` is more than 65536, so do not ask for more than 65536 bytes +in *one call* (multiple calls to get as many bytes as you like are okay: +browsers can generate infinite amount of random bytes without any bad +consequences). + +If the platform doesn't provide a suitable PRNG, the following functions, +which require random numbers, will throw exception: + +* `nacl.randomBytes` +* `nacl.box.keyPair` +* `nacl.sign.keyPair` + +Other functions are deterministic and will continue working. + +If a platform you are targeting doesn't implement secure random number +generator, but you somehow have a cryptographically-strong source of entropy +(not `Math.random`!), and you know what you are doing, you can plug it into +TweetNaCl.js like this: + + nacl.setPRNG(function(x, n) { + // ... copy n random bytes into x ... + }); + +Note that `nacl.setPRNG` *completely replaces* internal random byte generator +with the one provided. + + +### Constant-time comparison + +#### nacl.verify(x, y) + +Compares `x` and `y` in constant time and returns `true` if their lengths are +non-zero and equal, and their contents are equal. + +Returns `false` if either of the arguments has zero length, or arguments have +different lengths, or their contents differ. + + +### Utilities + +Encoding/decoding functions are provided for convenience. They are correct, +however their performance and wide compatibility with uncommon runtimes is not +something that is considered important compared to the simplicity and size of +implementation. You can use third-party libraries if you need to. + +#### nacl.util.decodeUTF8(string) + +Decodes string and returns `Uint8Array` of bytes. + +#### nacl.util.encodeUTF8(array) + +Encodes `Uint8Array` or `Array` of bytes into string. + +#### nacl.util.decodeBase64(string) + +Decodes Base-64 encoded string and returns `Uint8Array` of bytes. + +#### nacl.util.encodeBase64(array) + +Encodes `Uint8Array` or `Array` of bytes into string using Base-64 encoding. + + +System requirements +------------------- + +TweetNaCl.js supports modern browsers that have a cryptographically secure +pseudorandom number generator and typed arrays, including the latest versions +of: + +* Chrome +* Firefox +* Safari (Mac, iOS) +* Internet Explorer 11 + +Other systems: + +* Node.js (we test on 0.10 and later) + + +Development and testing +------------------------ + +Install NPM modules needed for development: + + $ npm install + +To build minified versions: + + $ npm run build + +Tests use minified version, so make sure to rebuild it every time you change +`nacl.js` or `nacl-fast.js`. + +### Testing + +To run tests in Node.js: + + $ npm test + +By default all tests described here work on `nacl.min.js`. To test other +versions, set environment variable `NACL_SRC` to the file name you want to test. +For example, the following command will test fast minified version: + + $ NACL_SRC=nacl-fast.min.js npm test + +To run full suite of tests in Node.js, including comparing outputs of +JavaScript port to outputs of the original C version: + + $ npm run testall + +To prepare tests for browsers: + + $ npm run browser + +and then open `test/browser/test.html` (or `test/browser/test-fast.html`) to +run them. + +To run headless browser tests with `testling`: + + $ npm run testling + +(If you get `Error: spawn ENOENT`, install *xvfb*: `sudo apt-get install xvfb`.) + +### Benchmarking + +To run benchmarks in Node.js: + + $ npm run bench + $ NACL_SRC=nacl-fast.min.js npm run bench + +To run benchmarks in a browser, open `test/benchmark/bench.html` (or +`test/benchmark/bench-fast.html`). + + +Contributors +------------ + +JavaScript port: + + * [Dmitry Chestnykh](http://github.com/dchest) (ported xsalsa20, poly1305, curve25519) + * [Devi Mandiri](https://github.com/devi) (ported curve25519, ed25519, sha512) + +Original authors of [NaCl](http://nacl.cr.yp.to), [TweetNaCl](http://tweetnacl.cr.yp.to) +and [Poly1305-donna](https://github.com/floodyberry/poly1305-donna) +(who are *not* responsible for any errors in this implementation): + + * [Daniel J. Bernstein](http://cr.yp.to/djb.html) + * Wesley Janssen + * [Tanja Lange](http://hyperelliptic.org/tanja) + * [Peter Schwabe](http://www.cryptojedi.org/users/peter/) + * [Matthew Dempsky](https://github.com/mdempsky) + * [Andrew Moon](https://github.com/floodyberry) + +Contributors have dedicated their work to the public domain. + +This software is distributed without any warranty. + + +Third-party libraries based on TweetNaCl.js +------------------------------------------- + +* [forward-secrecy](https://github.com/alax/forward-secrecy) — Axolotl ratchet implementation +* [nacl-stream](https://github.com/dchest/nacl-stream-js) - streaming encryption +* [tweetnacl-auth-js](https://github.com/dchest/tweetnacl-auth-js) — implementation of [`crypto_auth`](http://nacl.cr.yp.to/auth.html) + + +Who uses it +----------- + +Some notable users of TweetNaCl.js: + +* [miniLock](http://minilock.io/) +* [Stellar](https://www.stellar.org/) diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.js new file mode 100644 index 00000000000000..6c4995848cc42c --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.js @@ -0,0 +1,2418 @@ +(function(nacl) { +'use strict'; + +// Ported in 2014 by Dmitry Chestnykh and Devi Mandiri. +// Public domain. +// +// Implementation derived from TweetNaCl version 20140427. +// See for details: http://tweetnacl.cr.yp.to/ + +var gf = function(init) { + var i, r = new Float64Array(16); + if (init) for (i = 0; i < init.length; i++) r[i] = init[i]; + return r; +}; + +// Pluggable, initialized in high-level API below. +var randombytes = function(/* x, n */) { throw new Error('no PRNG'); }; + +var _0 = new Uint8Array(16); +var _9 = new Uint8Array(32); _9[0] = 9; + +var gf0 = gf(), + gf1 = gf([1]), + _121665 = gf([0xdb41, 1]), + D = gf([0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]), + D2 = gf([0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]), + X = gf([0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]), + Y = gf([0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]), + I = gf([0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]); + +function ts64(x, i, h, l) { + x[i] = (h >> 24) & 0xff; + x[i+1] = (h >> 16) & 0xff; + x[i+2] = (h >> 8) & 0xff; + x[i+3] = h & 0xff; + x[i+4] = (l >> 24) & 0xff; + x[i+5] = (l >> 16) & 0xff; + x[i+6] = (l >> 8) & 0xff; + x[i+7] = l & 0xff; +} + +function vn(x, xi, y, yi, n) { + var i,d = 0; + for (i = 0; i < n; i++) d |= x[xi+i]^y[yi+i]; + return (1 & ((d - 1) >>> 8)) - 1; +} + +function crypto_verify_16(x, xi, y, yi) { + return vn(x,xi,y,yi,16); +} + +function crypto_verify_32(x, xi, y, yi) { + return vn(x,xi,y,yi,32); +} + +function core_salsa20(o, p, k, c) { + var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24, + j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24, + j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24, + j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24, + j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24, + j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24, + j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24, + j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24, + j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24, + j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24, + j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24, + j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24, + j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24, + j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24, + j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24, + j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24; + + var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, + x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, + x15 = j15, u; + + for (var i = 0; i < 20; i += 2) { + u = x0 + x12 | 0; + x4 ^= u<<7 | u>>>(32-7); + u = x4 + x0 | 0; + x8 ^= u<<9 | u>>>(32-9); + u = x8 + x4 | 0; + x12 ^= u<<13 | u>>>(32-13); + u = x12 + x8 | 0; + x0 ^= u<<18 | u>>>(32-18); + + u = x5 + x1 | 0; + x9 ^= u<<7 | u>>>(32-7); + u = x9 + x5 | 0; + x13 ^= u<<9 | u>>>(32-9); + u = x13 + x9 | 0; + x1 ^= u<<13 | u>>>(32-13); + u = x1 + x13 | 0; + x5 ^= u<<18 | u>>>(32-18); + + u = x10 + x6 | 0; + x14 ^= u<<7 | u>>>(32-7); + u = x14 + x10 | 0; + x2 ^= u<<9 | u>>>(32-9); + u = x2 + x14 | 0; + x6 ^= u<<13 | u>>>(32-13); + u = x6 + x2 | 0; + x10 ^= u<<18 | u>>>(32-18); + + u = x15 + x11 | 0; + x3 ^= u<<7 | u>>>(32-7); + u = x3 + x15 | 0; + x7 ^= u<<9 | u>>>(32-9); + u = x7 + x3 | 0; + x11 ^= u<<13 | u>>>(32-13); + u = x11 + x7 | 0; + x15 ^= u<<18 | u>>>(32-18); + + u = x0 + x3 | 0; + x1 ^= u<<7 | u>>>(32-7); + u = x1 + x0 | 0; + x2 ^= u<<9 | u>>>(32-9); + u = x2 + x1 | 0; + x3 ^= u<<13 | u>>>(32-13); + u = x3 + x2 | 0; + x0 ^= u<<18 | u>>>(32-18); + + u = x5 + x4 | 0; + x6 ^= u<<7 | u>>>(32-7); + u = x6 + x5 | 0; + x7 ^= u<<9 | u>>>(32-9); + u = x7 + x6 | 0; + x4 ^= u<<13 | u>>>(32-13); + u = x4 + x7 | 0; + x5 ^= u<<18 | u>>>(32-18); + + u = x10 + x9 | 0; + x11 ^= u<<7 | u>>>(32-7); + u = x11 + x10 | 0; + x8 ^= u<<9 | u>>>(32-9); + u = x8 + x11 | 0; + x9 ^= u<<13 | u>>>(32-13); + u = x9 + x8 | 0; + x10 ^= u<<18 | u>>>(32-18); + + u = x15 + x14 | 0; + x12 ^= u<<7 | u>>>(32-7); + u = x12 + x15 | 0; + x13 ^= u<<9 | u>>>(32-9); + u = x13 + x12 | 0; + x14 ^= u<<13 | u>>>(32-13); + u = x14 + x13 | 0; + x15 ^= u<<18 | u>>>(32-18); + } + x0 = x0 + j0 | 0; + x1 = x1 + j1 | 0; + x2 = x2 + j2 | 0; + x3 = x3 + j3 | 0; + x4 = x4 + j4 | 0; + x5 = x5 + j5 | 0; + x6 = x6 + j6 | 0; + x7 = x7 + j7 | 0; + x8 = x8 + j8 | 0; + x9 = x9 + j9 | 0; + x10 = x10 + j10 | 0; + x11 = x11 + j11 | 0; + x12 = x12 + j12 | 0; + x13 = x13 + j13 | 0; + x14 = x14 + j14 | 0; + x15 = x15 + j15 | 0; + + o[ 0] = x0 >>> 0 & 0xff; + o[ 1] = x0 >>> 8 & 0xff; + o[ 2] = x0 >>> 16 & 0xff; + o[ 3] = x0 >>> 24 & 0xff; + + o[ 4] = x1 >>> 0 & 0xff; + o[ 5] = x1 >>> 8 & 0xff; + o[ 6] = x1 >>> 16 & 0xff; + o[ 7] = x1 >>> 24 & 0xff; + + o[ 8] = x2 >>> 0 & 0xff; + o[ 9] = x2 >>> 8 & 0xff; + o[10] = x2 >>> 16 & 0xff; + o[11] = x2 >>> 24 & 0xff; + + o[12] = x3 >>> 0 & 0xff; + o[13] = x3 >>> 8 & 0xff; + o[14] = x3 >>> 16 & 0xff; + o[15] = x3 >>> 24 & 0xff; + + o[16] = x4 >>> 0 & 0xff; + o[17] = x4 >>> 8 & 0xff; + o[18] = x4 >>> 16 & 0xff; + o[19] = x4 >>> 24 & 0xff; + + o[20] = x5 >>> 0 & 0xff; + o[21] = x5 >>> 8 & 0xff; + o[22] = x5 >>> 16 & 0xff; + o[23] = x5 >>> 24 & 0xff; + + o[24] = x6 >>> 0 & 0xff; + o[25] = x6 >>> 8 & 0xff; + o[26] = x6 >>> 16 & 0xff; + o[27] = x6 >>> 24 & 0xff; + + o[28] = x7 >>> 0 & 0xff; + o[29] = x7 >>> 8 & 0xff; + o[30] = x7 >>> 16 & 0xff; + o[31] = x7 >>> 24 & 0xff; + + o[32] = x8 >>> 0 & 0xff; + o[33] = x8 >>> 8 & 0xff; + o[34] = x8 >>> 16 & 0xff; + o[35] = x8 >>> 24 & 0xff; + + o[36] = x9 >>> 0 & 0xff; + o[37] = x9 >>> 8 & 0xff; + o[38] = x9 >>> 16 & 0xff; + o[39] = x9 >>> 24 & 0xff; + + o[40] = x10 >>> 0 & 0xff; + o[41] = x10 >>> 8 & 0xff; + o[42] = x10 >>> 16 & 0xff; + o[43] = x10 >>> 24 & 0xff; + + o[44] = x11 >>> 0 & 0xff; + o[45] = x11 >>> 8 & 0xff; + o[46] = x11 >>> 16 & 0xff; + o[47] = x11 >>> 24 & 0xff; + + o[48] = x12 >>> 0 & 0xff; + o[49] = x12 >>> 8 & 0xff; + o[50] = x12 >>> 16 & 0xff; + o[51] = x12 >>> 24 & 0xff; + + o[52] = x13 >>> 0 & 0xff; + o[53] = x13 >>> 8 & 0xff; + o[54] = x13 >>> 16 & 0xff; + o[55] = x13 >>> 24 & 0xff; + + o[56] = x14 >>> 0 & 0xff; + o[57] = x14 >>> 8 & 0xff; + o[58] = x14 >>> 16 & 0xff; + o[59] = x14 >>> 24 & 0xff; + + o[60] = x15 >>> 0 & 0xff; + o[61] = x15 >>> 8 & 0xff; + o[62] = x15 >>> 16 & 0xff; + o[63] = x15 >>> 24 & 0xff; +} + +function core_hsalsa20(o,p,k,c) { + var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24, + j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24, + j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24, + j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24, + j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24, + j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24, + j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24, + j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24, + j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24, + j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24, + j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24, + j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24, + j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24, + j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24, + j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24, + j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24; + + var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, + x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, + x15 = j15, u; + + for (var i = 0; i < 20; i += 2) { + u = x0 + x12 | 0; + x4 ^= u<<7 | u>>>(32-7); + u = x4 + x0 | 0; + x8 ^= u<<9 | u>>>(32-9); + u = x8 + x4 | 0; + x12 ^= u<<13 | u>>>(32-13); + u = x12 + x8 | 0; + x0 ^= u<<18 | u>>>(32-18); + + u = x5 + x1 | 0; + x9 ^= u<<7 | u>>>(32-7); + u = x9 + x5 | 0; + x13 ^= u<<9 | u>>>(32-9); + u = x13 + x9 | 0; + x1 ^= u<<13 | u>>>(32-13); + u = x1 + x13 | 0; + x5 ^= u<<18 | u>>>(32-18); + + u = x10 + x6 | 0; + x14 ^= u<<7 | u>>>(32-7); + u = x14 + x10 | 0; + x2 ^= u<<9 | u>>>(32-9); + u = x2 + x14 | 0; + x6 ^= u<<13 | u>>>(32-13); + u = x6 + x2 | 0; + x10 ^= u<<18 | u>>>(32-18); + + u = x15 + x11 | 0; + x3 ^= u<<7 | u>>>(32-7); + u = x3 + x15 | 0; + x7 ^= u<<9 | u>>>(32-9); + u = x7 + x3 | 0; + x11 ^= u<<13 | u>>>(32-13); + u = x11 + x7 | 0; + x15 ^= u<<18 | u>>>(32-18); + + u = x0 + x3 | 0; + x1 ^= u<<7 | u>>>(32-7); + u = x1 + x0 | 0; + x2 ^= u<<9 | u>>>(32-9); + u = x2 + x1 | 0; + x3 ^= u<<13 | u>>>(32-13); + u = x3 + x2 | 0; + x0 ^= u<<18 | u>>>(32-18); + + u = x5 + x4 | 0; + x6 ^= u<<7 | u>>>(32-7); + u = x6 + x5 | 0; + x7 ^= u<<9 | u>>>(32-9); + u = x7 + x6 | 0; + x4 ^= u<<13 | u>>>(32-13); + u = x4 + x7 | 0; + x5 ^= u<<18 | u>>>(32-18); + + u = x10 + x9 | 0; + x11 ^= u<<7 | u>>>(32-7); + u = x11 + x10 | 0; + x8 ^= u<<9 | u>>>(32-9); + u = x8 + x11 | 0; + x9 ^= u<<13 | u>>>(32-13); + u = x9 + x8 | 0; + x10 ^= u<<18 | u>>>(32-18); + + u = x15 + x14 | 0; + x12 ^= u<<7 | u>>>(32-7); + u = x12 + x15 | 0; + x13 ^= u<<9 | u>>>(32-9); + u = x13 + x12 | 0; + x14 ^= u<<13 | u>>>(32-13); + u = x14 + x13 | 0; + x15 ^= u<<18 | u>>>(32-18); + } + + o[ 0] = x0 >>> 0 & 0xff; + o[ 1] = x0 >>> 8 & 0xff; + o[ 2] = x0 >>> 16 & 0xff; + o[ 3] = x0 >>> 24 & 0xff; + + o[ 4] = x5 >>> 0 & 0xff; + o[ 5] = x5 >>> 8 & 0xff; + o[ 6] = x5 >>> 16 & 0xff; + o[ 7] = x5 >>> 24 & 0xff; + + o[ 8] = x10 >>> 0 & 0xff; + o[ 9] = x10 >>> 8 & 0xff; + o[10] = x10 >>> 16 & 0xff; + o[11] = x10 >>> 24 & 0xff; + + o[12] = x15 >>> 0 & 0xff; + o[13] = x15 >>> 8 & 0xff; + o[14] = x15 >>> 16 & 0xff; + o[15] = x15 >>> 24 & 0xff; + + o[16] = x6 >>> 0 & 0xff; + o[17] = x6 >>> 8 & 0xff; + o[18] = x6 >>> 16 & 0xff; + o[19] = x6 >>> 24 & 0xff; + + o[20] = x7 >>> 0 & 0xff; + o[21] = x7 >>> 8 & 0xff; + o[22] = x7 >>> 16 & 0xff; + o[23] = x7 >>> 24 & 0xff; + + o[24] = x8 >>> 0 & 0xff; + o[25] = x8 >>> 8 & 0xff; + o[26] = x8 >>> 16 & 0xff; + o[27] = x8 >>> 24 & 0xff; + + o[28] = x9 >>> 0 & 0xff; + o[29] = x9 >>> 8 & 0xff; + o[30] = x9 >>> 16 & 0xff; + o[31] = x9 >>> 24 & 0xff; +} + +function crypto_core_salsa20(out,inp,k,c) { + core_salsa20(out,inp,k,c); +} + +function crypto_core_hsalsa20(out,inp,k,c) { + core_hsalsa20(out,inp,k,c); +} + +var sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]); + // "expand 32-byte k" + +function crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k) { + var z = new Uint8Array(16), x = new Uint8Array(64); + var u, i; + for (i = 0; i < 16; i++) z[i] = 0; + for (i = 0; i < 8; i++) z[i] = n[i]; + while (b >= 64) { + crypto_core_salsa20(x,z,k,sigma); + for (i = 0; i < 64; i++) c[cpos+i] = m[mpos+i] ^ x[i]; + u = 1; + for (i = 8; i < 16; i++) { + u = u + (z[i] & 0xff) | 0; + z[i] = u & 0xff; + u >>>= 8; + } + b -= 64; + cpos += 64; + mpos += 64; + } + if (b > 0) { + crypto_core_salsa20(x,z,k,sigma); + for (i = 0; i < b; i++) c[cpos+i] = m[mpos+i] ^ x[i]; + } + return 0; +} + +function crypto_stream_salsa20(c,cpos,b,n,k) { + var z = new Uint8Array(16), x = new Uint8Array(64); + var u, i; + for (i = 0; i < 16; i++) z[i] = 0; + for (i = 0; i < 8; i++) z[i] = n[i]; + while (b >= 64) { + crypto_core_salsa20(x,z,k,sigma); + for (i = 0; i < 64; i++) c[cpos+i] = x[i]; + u = 1; + for (i = 8; i < 16; i++) { + u = u + (z[i] & 0xff) | 0; + z[i] = u & 0xff; + u >>>= 8; + } + b -= 64; + cpos += 64; + } + if (b > 0) { + crypto_core_salsa20(x,z,k,sigma); + for (i = 0; i < b; i++) c[cpos+i] = x[i]; + } + return 0; +} + +function crypto_stream(c,cpos,d,n,k) { + var s = new Uint8Array(32); + crypto_core_hsalsa20(s,n,k,sigma); + var sn = new Uint8Array(8); + for (var i = 0; i < 8; i++) sn[i] = n[i+16]; + return crypto_stream_salsa20(c,cpos,d,sn,s); +} + +function crypto_stream_xor(c,cpos,m,mpos,d,n,k) { + var s = new Uint8Array(32); + crypto_core_hsalsa20(s,n,k,sigma); + var sn = new Uint8Array(8); + for (var i = 0; i < 8; i++) sn[i] = n[i+16]; + return crypto_stream_salsa20_xor(c,cpos,m,mpos,d,sn,s); +} + +/* +* Port of Andrew Moon's Poly1305-donna-16. Public domain. +* https://github.com/floodyberry/poly1305-donna +*/ + +var poly1305 = function(key) { + this.buffer = new Uint8Array(16); + this.r = new Uint16Array(10); + this.h = new Uint16Array(10); + this.pad = new Uint16Array(8); + this.leftover = 0; + this.fin = 0; + + var t0, t1, t2, t3, t4, t5, t6, t7; + + t0 = key[ 0] & 0xff | (key[ 1] & 0xff) << 8; this.r[0] = ( t0 ) & 0x1fff; + t1 = key[ 2] & 0xff | (key[ 3] & 0xff) << 8; this.r[1] = ((t0 >>> 13) | (t1 << 3)) & 0x1fff; + t2 = key[ 4] & 0xff | (key[ 5] & 0xff) << 8; this.r[2] = ((t1 >>> 10) | (t2 << 6)) & 0x1f03; + t3 = key[ 6] & 0xff | (key[ 7] & 0xff) << 8; this.r[3] = ((t2 >>> 7) | (t3 << 9)) & 0x1fff; + t4 = key[ 8] & 0xff | (key[ 9] & 0xff) << 8; this.r[4] = ((t3 >>> 4) | (t4 << 12)) & 0x00ff; + this.r[5] = ((t4 >>> 1)) & 0x1ffe; + t5 = key[10] & 0xff | (key[11] & 0xff) << 8; this.r[6] = ((t4 >>> 14) | (t5 << 2)) & 0x1fff; + t6 = key[12] & 0xff | (key[13] & 0xff) << 8; this.r[7] = ((t5 >>> 11) | (t6 << 5)) & 0x1f81; + t7 = key[14] & 0xff | (key[15] & 0xff) << 8; this.r[8] = ((t6 >>> 8) | (t7 << 8)) & 0x1fff; + this.r[9] = ((t7 >>> 5)) & 0x007f; + + this.pad[0] = key[16] & 0xff | (key[17] & 0xff) << 8; + this.pad[1] = key[18] & 0xff | (key[19] & 0xff) << 8; + this.pad[2] = key[20] & 0xff | (key[21] & 0xff) << 8; + this.pad[3] = key[22] & 0xff | (key[23] & 0xff) << 8; + this.pad[4] = key[24] & 0xff | (key[25] & 0xff) << 8; + this.pad[5] = key[26] & 0xff | (key[27] & 0xff) << 8; + this.pad[6] = key[28] & 0xff | (key[29] & 0xff) << 8; + this.pad[7] = key[30] & 0xff | (key[31] & 0xff) << 8; +}; + +poly1305.prototype.blocks = function(m, mpos, bytes) { + var hibit = this.fin ? 0 : (1 << 11); + var t0, t1, t2, t3, t4, t5, t6, t7, c; + var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9; + + var h0 = this.h[0], + h1 = this.h[1], + h2 = this.h[2], + h3 = this.h[3], + h4 = this.h[4], + h5 = this.h[5], + h6 = this.h[6], + h7 = this.h[7], + h8 = this.h[8], + h9 = this.h[9]; + + var r0 = this.r[0], + r1 = this.r[1], + r2 = this.r[2], + r3 = this.r[3], + r4 = this.r[4], + r5 = this.r[5], + r6 = this.r[6], + r7 = this.r[7], + r8 = this.r[8], + r9 = this.r[9]; + + while (bytes >= 16) { + t0 = m[mpos+ 0] & 0xff | (m[mpos+ 1] & 0xff) << 8; h0 += ( t0 ) & 0x1fff; + t1 = m[mpos+ 2] & 0xff | (m[mpos+ 3] & 0xff) << 8; h1 += ((t0 >>> 13) | (t1 << 3)) & 0x1fff; + t2 = m[mpos+ 4] & 0xff | (m[mpos+ 5] & 0xff) << 8; h2 += ((t1 >>> 10) | (t2 << 6)) & 0x1fff; + t3 = m[mpos+ 6] & 0xff | (m[mpos+ 7] & 0xff) << 8; h3 += ((t2 >>> 7) | (t3 << 9)) & 0x1fff; + t4 = m[mpos+ 8] & 0xff | (m[mpos+ 9] & 0xff) << 8; h4 += ((t3 >>> 4) | (t4 << 12)) & 0x1fff; + h5 += ((t4 >>> 1)) & 0x1fff; + t5 = m[mpos+10] & 0xff | (m[mpos+11] & 0xff) << 8; h6 += ((t4 >>> 14) | (t5 << 2)) & 0x1fff; + t6 = m[mpos+12] & 0xff | (m[mpos+13] & 0xff) << 8; h7 += ((t5 >>> 11) | (t6 << 5)) & 0x1fff; + t7 = m[mpos+14] & 0xff | (m[mpos+15] & 0xff) << 8; h8 += ((t6 >>> 8) | (t7 << 8)) & 0x1fff; + h9 += ((t7 >>> 5)) | hibit; + + c = 0; + + d0 = c; + d0 += h0 * r0; + d0 += h1 * (5 * r9); + d0 += h2 * (5 * r8); + d0 += h3 * (5 * r7); + d0 += h4 * (5 * r6); + c = (d0 >>> 13); d0 &= 0x1fff; + d0 += h5 * (5 * r5); + d0 += h6 * (5 * r4); + d0 += h7 * (5 * r3); + d0 += h8 * (5 * r2); + d0 += h9 * (5 * r1); + c += (d0 >>> 13); d0 &= 0x1fff; + + d1 = c; + d1 += h0 * r1; + d1 += h1 * r0; + d1 += h2 * (5 * r9); + d1 += h3 * (5 * r8); + d1 += h4 * (5 * r7); + c = (d1 >>> 13); d1 &= 0x1fff; + d1 += h5 * (5 * r6); + d1 += h6 * (5 * r5); + d1 += h7 * (5 * r4); + d1 += h8 * (5 * r3); + d1 += h9 * (5 * r2); + c += (d1 >>> 13); d1 &= 0x1fff; + + d2 = c; + d2 += h0 * r2; + d2 += h1 * r1; + d2 += h2 * r0; + d2 += h3 * (5 * r9); + d2 += h4 * (5 * r8); + c = (d2 >>> 13); d2 &= 0x1fff; + d2 += h5 * (5 * r7); + d2 += h6 * (5 * r6); + d2 += h7 * (5 * r5); + d2 += h8 * (5 * r4); + d2 += h9 * (5 * r3); + c += (d2 >>> 13); d2 &= 0x1fff; + + d3 = c; + d3 += h0 * r3; + d3 += h1 * r2; + d3 += h2 * r1; + d3 += h3 * r0; + d3 += h4 * (5 * r9); + c = (d3 >>> 13); d3 &= 0x1fff; + d3 += h5 * (5 * r8); + d3 += h6 * (5 * r7); + d3 += h7 * (5 * r6); + d3 += h8 * (5 * r5); + d3 += h9 * (5 * r4); + c += (d3 >>> 13); d3 &= 0x1fff; + + d4 = c; + d4 += h0 * r4; + d4 += h1 * r3; + d4 += h2 * r2; + d4 += h3 * r1; + d4 += h4 * r0; + c = (d4 >>> 13); d4 &= 0x1fff; + d4 += h5 * (5 * r9); + d4 += h6 * (5 * r8); + d4 += h7 * (5 * r7); + d4 += h8 * (5 * r6); + d4 += h9 * (5 * r5); + c += (d4 >>> 13); d4 &= 0x1fff; + + d5 = c; + d5 += h0 * r5; + d5 += h1 * r4; + d5 += h2 * r3; + d5 += h3 * r2; + d5 += h4 * r1; + c = (d5 >>> 13); d5 &= 0x1fff; + d5 += h5 * r0; + d5 += h6 * (5 * r9); + d5 += h7 * (5 * r8); + d5 += h8 * (5 * r7); + d5 += h9 * (5 * r6); + c += (d5 >>> 13); d5 &= 0x1fff; + + d6 = c; + d6 += h0 * r6; + d6 += h1 * r5; + d6 += h2 * r4; + d6 += h3 * r3; + d6 += h4 * r2; + c = (d6 >>> 13); d6 &= 0x1fff; + d6 += h5 * r1; + d6 += h6 * r0; + d6 += h7 * (5 * r9); + d6 += h8 * (5 * r8); + d6 += h9 * (5 * r7); + c += (d6 >>> 13); d6 &= 0x1fff; + + d7 = c; + d7 += h0 * r7; + d7 += h1 * r6; + d7 += h2 * r5; + d7 += h3 * r4; + d7 += h4 * r3; + c = (d7 >>> 13); d7 &= 0x1fff; + d7 += h5 * r2; + d7 += h6 * r1; + d7 += h7 * r0; + d7 += h8 * (5 * r9); + d7 += h9 * (5 * r8); + c += (d7 >>> 13); d7 &= 0x1fff; + + d8 = c; + d8 += h0 * r8; + d8 += h1 * r7; + d8 += h2 * r6; + d8 += h3 * r5; + d8 += h4 * r4; + c = (d8 >>> 13); d8 &= 0x1fff; + d8 += h5 * r3; + d8 += h6 * r2; + d8 += h7 * r1; + d8 += h8 * r0; + d8 += h9 * (5 * r9); + c += (d8 >>> 13); d8 &= 0x1fff; + + d9 = c; + d9 += h0 * r9; + d9 += h1 * r8; + d9 += h2 * r7; + d9 += h3 * r6; + d9 += h4 * r5; + c = (d9 >>> 13); d9 &= 0x1fff; + d9 += h5 * r4; + d9 += h6 * r3; + d9 += h7 * r2; + d9 += h8 * r1; + d9 += h9 * r0; + c += (d9 >>> 13); d9 &= 0x1fff; + + c = (((c << 2) + c)) | 0; + c = (c + d0) | 0; + d0 = c & 0x1fff; + c = (c >>> 13); + d1 += c; + + h0 = d0; + h1 = d1; + h2 = d2; + h3 = d3; + h4 = d4; + h5 = d5; + h6 = d6; + h7 = d7; + h8 = d8; + h9 = d9; + + mpos += 16; + bytes -= 16; + } + this.h[0] = h0; + this.h[1] = h1; + this.h[2] = h2; + this.h[3] = h3; + this.h[4] = h4; + this.h[5] = h5; + this.h[6] = h6; + this.h[7] = h7; + this.h[8] = h8; + this.h[9] = h9; +}; + +poly1305.prototype.finish = function(mac, macpos) { + var g = new Uint16Array(10); + var c, mask, f, i; + + if (this.leftover) { + i = this.leftover; + this.buffer[i++] = 1; + for (; i < 16; i++) this.buffer[i] = 0; + this.fin = 1; + this.blocks(this.buffer, 0, 16); + } + + c = this.h[1] >>> 13; + this.h[1] &= 0x1fff; + for (i = 2; i < 10; i++) { + this.h[i] += c; + c = this.h[i] >>> 13; + this.h[i] &= 0x1fff; + } + this.h[0] += (c * 5); + c = this.h[0] >>> 13; + this.h[0] &= 0x1fff; + this.h[1] += c; + c = this.h[1] >>> 13; + this.h[1] &= 0x1fff; + this.h[2] += c; + + g[0] = this.h[0] + 5; + c = g[0] >>> 13; + g[0] &= 0x1fff; + for (i = 1; i < 10; i++) { + g[i] = this.h[i] + c; + c = g[i] >>> 13; + g[i] &= 0x1fff; + } + g[9] -= (1 << 13); + + mask = (g[9] >>> ((2 * 8) - 1)) - 1; + for (i = 0; i < 10; i++) g[i] &= mask; + mask = ~mask; + for (i = 0; i < 10; i++) this.h[i] = (this.h[i] & mask) | g[i]; + + this.h[0] = ((this.h[0] ) | (this.h[1] << 13) ) & 0xffff; + this.h[1] = ((this.h[1] >>> 3) | (this.h[2] << 10) ) & 0xffff; + this.h[2] = ((this.h[2] >>> 6) | (this.h[3] << 7) ) & 0xffff; + this.h[3] = ((this.h[3] >>> 9) | (this.h[4] << 4) ) & 0xffff; + this.h[4] = ((this.h[4] >>> 12) | (this.h[5] << 1) | (this.h[6] << 14)) & 0xffff; + this.h[5] = ((this.h[6] >>> 2) | (this.h[7] << 11) ) & 0xffff; + this.h[6] = ((this.h[7] >>> 5) | (this.h[8] << 8) ) & 0xffff; + this.h[7] = ((this.h[8] >>> 8) | (this.h[9] << 5) ) & 0xffff; + + f = this.h[0] + this.pad[0]; + this.h[0] = f & 0xffff; + for (i = 1; i < 8; i++) { + f = (((this.h[i] + this.pad[i]) | 0) + (f >>> 16)) | 0; + this.h[i] = f & 0xffff; + } + + mac[macpos+ 0] = (this.h[0] >>> 0) & 0xff; + mac[macpos+ 1] = (this.h[0] >>> 8) & 0xff; + mac[macpos+ 2] = (this.h[1] >>> 0) & 0xff; + mac[macpos+ 3] = (this.h[1] >>> 8) & 0xff; + mac[macpos+ 4] = (this.h[2] >>> 0) & 0xff; + mac[macpos+ 5] = (this.h[2] >>> 8) & 0xff; + mac[macpos+ 6] = (this.h[3] >>> 0) & 0xff; + mac[macpos+ 7] = (this.h[3] >>> 8) & 0xff; + mac[macpos+ 8] = (this.h[4] >>> 0) & 0xff; + mac[macpos+ 9] = (this.h[4] >>> 8) & 0xff; + mac[macpos+10] = (this.h[5] >>> 0) & 0xff; + mac[macpos+11] = (this.h[5] >>> 8) & 0xff; + mac[macpos+12] = (this.h[6] >>> 0) & 0xff; + mac[macpos+13] = (this.h[6] >>> 8) & 0xff; + mac[macpos+14] = (this.h[7] >>> 0) & 0xff; + mac[macpos+15] = (this.h[7] >>> 8) & 0xff; +}; + +poly1305.prototype.update = function(m, mpos, bytes) { + var i, want; + + if (this.leftover) { + want = (16 - this.leftover); + if (want > bytes) + want = bytes; + for (i = 0; i < want; i++) + this.buffer[this.leftover + i] = m[mpos+i]; + bytes -= want; + mpos += want; + this.leftover += want; + if (this.leftover < 16) + return; + this.blocks(this.buffer, 0, 16); + this.leftover = 0; + } + + if (bytes >= 16) { + want = bytes - (bytes % 16); + this.blocks(m, mpos, want); + mpos += want; + bytes -= want; + } + + if (bytes) { + for (i = 0; i < bytes; i++) + this.buffer[this.leftover + i] = m[mpos+i]; + this.leftover += bytes; + } +}; + +function crypto_onetimeauth(out, outpos, m, mpos, n, k) { + var s = new poly1305(k); + s.update(m, mpos, n); + s.finish(out, outpos); + return 0; +} + +function crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) { + var x = new Uint8Array(16); + crypto_onetimeauth(x,0,m,mpos,n,k); + return crypto_verify_16(h,hpos,x,0); +} + +function crypto_secretbox(c,m,d,n,k) { + var i; + if (d < 32) return -1; + crypto_stream_xor(c,0,m,0,d,n,k); + crypto_onetimeauth(c, 16, c, 32, d - 32, c); + for (i = 0; i < 16; i++) c[i] = 0; + return 0; +} + +function crypto_secretbox_open(m,c,d,n,k) { + var i; + var x = new Uint8Array(32); + if (d < 32) return -1; + crypto_stream(x,0,32,n,k); + if (crypto_onetimeauth_verify(c, 16,c, 32,d - 32,x) !== 0) return -1; + crypto_stream_xor(m,0,c,0,d,n,k); + for (i = 0; i < 32; i++) m[i] = 0; + return 0; +} + +function set25519(r, a) { + var i; + for (i = 0; i < 16; i++) r[i] = a[i]|0; +} + +function car25519(o) { + var i, v, c = 1; + for (i = 0; i < 16; i++) { + v = o[i] + c + 65535; + c = Math.floor(v / 65536); + o[i] = v - c * 65536; + } + o[0] += c-1 + 37 * (c-1); +} + +function sel25519(p, q, b) { + var t, c = ~(b-1); + for (var i = 0; i < 16; i++) { + t = c & (p[i] ^ q[i]); + p[i] ^= t; + q[i] ^= t; + } +} + +function pack25519(o, n) { + var i, j, b; + var m = gf(), t = gf(); + for (i = 0; i < 16; i++) t[i] = n[i]; + car25519(t); + car25519(t); + car25519(t); + for (j = 0; j < 2; j++) { + m[0] = t[0] - 0xffed; + for (i = 1; i < 15; i++) { + m[i] = t[i] - 0xffff - ((m[i-1]>>16) & 1); + m[i-1] &= 0xffff; + } + m[15] = t[15] - 0x7fff - ((m[14]>>16) & 1); + b = (m[15]>>16) & 1; + m[14] &= 0xffff; + sel25519(t, m, 1-b); + } + for (i = 0; i < 16; i++) { + o[2*i] = t[i] & 0xff; + o[2*i+1] = t[i]>>8; + } +} + +function neq25519(a, b) { + var c = new Uint8Array(32), d = new Uint8Array(32); + pack25519(c, a); + pack25519(d, b); + return crypto_verify_32(c, 0, d, 0); +} + +function par25519(a) { + var d = new Uint8Array(32); + pack25519(d, a); + return d[0] & 1; +} + +function unpack25519(o, n) { + var i; + for (i = 0; i < 16; i++) o[i] = n[2*i] + (n[2*i+1] << 8); + o[15] &= 0x7fff; +} + +function A(o, a, b) { + for (var i = 0; i < 16; i++) o[i] = a[i] + b[i]; +} + +function Z(o, a, b) { + for (var i = 0; i < 16; i++) o[i] = a[i] - b[i]; +} + +function M(o, a, b) { + var v, c, + t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, + t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, + t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0, + t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0, + b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3], + b4 = b[4], + b5 = b[5], + b6 = b[6], + b7 = b[7], + b8 = b[8], + b9 = b[9], + b10 = b[10], + b11 = b[11], + b12 = b[12], + b13 = b[13], + b14 = b[14], + b15 = b[15]; + + v = a[0]; + t0 += v * b0; + t1 += v * b1; + t2 += v * b2; + t3 += v * b3; + t4 += v * b4; + t5 += v * b5; + t6 += v * b6; + t7 += v * b7; + t8 += v * b8; + t9 += v * b9; + t10 += v * b10; + t11 += v * b11; + t12 += v * b12; + t13 += v * b13; + t14 += v * b14; + t15 += v * b15; + v = a[1]; + t1 += v * b0; + t2 += v * b1; + t3 += v * b2; + t4 += v * b3; + t5 += v * b4; + t6 += v * b5; + t7 += v * b6; + t8 += v * b7; + t9 += v * b8; + t10 += v * b9; + t11 += v * b10; + t12 += v * b11; + t13 += v * b12; + t14 += v * b13; + t15 += v * b14; + t16 += v * b15; + v = a[2]; + t2 += v * b0; + t3 += v * b1; + t4 += v * b2; + t5 += v * b3; + t6 += v * b4; + t7 += v * b5; + t8 += v * b6; + t9 += v * b7; + t10 += v * b8; + t11 += v * b9; + t12 += v * b10; + t13 += v * b11; + t14 += v * b12; + t15 += v * b13; + t16 += v * b14; + t17 += v * b15; + v = a[3]; + t3 += v * b0; + t4 += v * b1; + t5 += v * b2; + t6 += v * b3; + t7 += v * b4; + t8 += v * b5; + t9 += v * b6; + t10 += v * b7; + t11 += v * b8; + t12 += v * b9; + t13 += v * b10; + t14 += v * b11; + t15 += v * b12; + t16 += v * b13; + t17 += v * b14; + t18 += v * b15; + v = a[4]; + t4 += v * b0; + t5 += v * b1; + t6 += v * b2; + t7 += v * b3; + t8 += v * b4; + t9 += v * b5; + t10 += v * b6; + t11 += v * b7; + t12 += v * b8; + t13 += v * b9; + t14 += v * b10; + t15 += v * b11; + t16 += v * b12; + t17 += v * b13; + t18 += v * b14; + t19 += v * b15; + v = a[5]; + t5 += v * b0; + t6 += v * b1; + t7 += v * b2; + t8 += v * b3; + t9 += v * b4; + t10 += v * b5; + t11 += v * b6; + t12 += v * b7; + t13 += v * b8; + t14 += v * b9; + t15 += v * b10; + t16 += v * b11; + t17 += v * b12; + t18 += v * b13; + t19 += v * b14; + t20 += v * b15; + v = a[6]; + t6 += v * b0; + t7 += v * b1; + t8 += v * b2; + t9 += v * b3; + t10 += v * b4; + t11 += v * b5; + t12 += v * b6; + t13 += v * b7; + t14 += v * b8; + t15 += v * b9; + t16 += v * b10; + t17 += v * b11; + t18 += v * b12; + t19 += v * b13; + t20 += v * b14; + t21 += v * b15; + v = a[7]; + t7 += v * b0; + t8 += v * b1; + t9 += v * b2; + t10 += v * b3; + t11 += v * b4; + t12 += v * b5; + t13 += v * b6; + t14 += v * b7; + t15 += v * b8; + t16 += v * b9; + t17 += v * b10; + t18 += v * b11; + t19 += v * b12; + t20 += v * b13; + t21 += v * b14; + t22 += v * b15; + v = a[8]; + t8 += v * b0; + t9 += v * b1; + t10 += v * b2; + t11 += v * b3; + t12 += v * b4; + t13 += v * b5; + t14 += v * b6; + t15 += v * b7; + t16 += v * b8; + t17 += v * b9; + t18 += v * b10; + t19 += v * b11; + t20 += v * b12; + t21 += v * b13; + t22 += v * b14; + t23 += v * b15; + v = a[9]; + t9 += v * b0; + t10 += v * b1; + t11 += v * b2; + t12 += v * b3; + t13 += v * b4; + t14 += v * b5; + t15 += v * b6; + t16 += v * b7; + t17 += v * b8; + t18 += v * b9; + t19 += v * b10; + t20 += v * b11; + t21 += v * b12; + t22 += v * b13; + t23 += v * b14; + t24 += v * b15; + v = a[10]; + t10 += v * b0; + t11 += v * b1; + t12 += v * b2; + t13 += v * b3; + t14 += v * b4; + t15 += v * b5; + t16 += v * b6; + t17 += v * b7; + t18 += v * b8; + t19 += v * b9; + t20 += v * b10; + t21 += v * b11; + t22 += v * b12; + t23 += v * b13; + t24 += v * b14; + t25 += v * b15; + v = a[11]; + t11 += v * b0; + t12 += v * b1; + t13 += v * b2; + t14 += v * b3; + t15 += v * b4; + t16 += v * b5; + t17 += v * b6; + t18 += v * b7; + t19 += v * b8; + t20 += v * b9; + t21 += v * b10; + t22 += v * b11; + t23 += v * b12; + t24 += v * b13; + t25 += v * b14; + t26 += v * b15; + v = a[12]; + t12 += v * b0; + t13 += v * b1; + t14 += v * b2; + t15 += v * b3; + t16 += v * b4; + t17 += v * b5; + t18 += v * b6; + t19 += v * b7; + t20 += v * b8; + t21 += v * b9; + t22 += v * b10; + t23 += v * b11; + t24 += v * b12; + t25 += v * b13; + t26 += v * b14; + t27 += v * b15; + v = a[13]; + t13 += v * b0; + t14 += v * b1; + t15 += v * b2; + t16 += v * b3; + t17 += v * b4; + t18 += v * b5; + t19 += v * b6; + t20 += v * b7; + t21 += v * b8; + t22 += v * b9; + t23 += v * b10; + t24 += v * b11; + t25 += v * b12; + t26 += v * b13; + t27 += v * b14; + t28 += v * b15; + v = a[14]; + t14 += v * b0; + t15 += v * b1; + t16 += v * b2; + t17 += v * b3; + t18 += v * b4; + t19 += v * b5; + t20 += v * b6; + t21 += v * b7; + t22 += v * b8; + t23 += v * b9; + t24 += v * b10; + t25 += v * b11; + t26 += v * b12; + t27 += v * b13; + t28 += v * b14; + t29 += v * b15; + v = a[15]; + t15 += v * b0; + t16 += v * b1; + t17 += v * b2; + t18 += v * b3; + t19 += v * b4; + t20 += v * b5; + t21 += v * b6; + t22 += v * b7; + t23 += v * b8; + t24 += v * b9; + t25 += v * b10; + t26 += v * b11; + t27 += v * b12; + t28 += v * b13; + t29 += v * b14; + t30 += v * b15; + + t0 += 38 * t16; + t1 += 38 * t17; + t2 += 38 * t18; + t3 += 38 * t19; + t4 += 38 * t20; + t5 += 38 * t21; + t6 += 38 * t22; + t7 += 38 * t23; + t8 += 38 * t24; + t9 += 38 * t25; + t10 += 38 * t26; + t11 += 38 * t27; + t12 += 38 * t28; + t13 += 38 * t29; + t14 += 38 * t30; + // t15 left as is + + // first car + c = 1; + v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536; + v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536; + v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536; + v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536; + v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536; + v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536; + v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536; + v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536; + v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536; + v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536; + v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536; + v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536; + v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536; + v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536; + v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536; + v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536; + t0 += c-1 + 37 * (c-1); + + // second car + c = 1; + v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536; + v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536; + v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536; + v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536; + v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536; + v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536; + v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536; + v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536; + v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536; + v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536; + v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536; + v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536; + v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536; + v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536; + v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536; + v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536; + t0 += c-1 + 37 * (c-1); + + o[ 0] = t0; + o[ 1] = t1; + o[ 2] = t2; + o[ 3] = t3; + o[ 4] = t4; + o[ 5] = t5; + o[ 6] = t6; + o[ 7] = t7; + o[ 8] = t8; + o[ 9] = t9; + o[10] = t10; + o[11] = t11; + o[12] = t12; + o[13] = t13; + o[14] = t14; + o[15] = t15; +} + +function S(o, a) { + M(o, a, a); +} + +function inv25519(o, i) { + var c = gf(); + var a; + for (a = 0; a < 16; a++) c[a] = i[a]; + for (a = 253; a >= 0; a--) { + S(c, c); + if(a !== 2 && a !== 4) M(c, c, i); + } + for (a = 0; a < 16; a++) o[a] = c[a]; +} + +function pow2523(o, i) { + var c = gf(); + var a; + for (a = 0; a < 16; a++) c[a] = i[a]; + for (a = 250; a >= 0; a--) { + S(c, c); + if(a !== 1) M(c, c, i); + } + for (a = 0; a < 16; a++) o[a] = c[a]; +} + +function crypto_scalarmult(q, n, p) { + var z = new Uint8Array(32); + var x = new Float64Array(80), r, i; + var a = gf(), b = gf(), c = gf(), + d = gf(), e = gf(), f = gf(); + for (i = 0; i < 31; i++) z[i] = n[i]; + z[31]=(n[31]&127)|64; + z[0]&=248; + unpack25519(x,p); + for (i = 0; i < 16; i++) { + b[i]=x[i]; + d[i]=a[i]=c[i]=0; + } + a[0]=d[0]=1; + for (i=254; i>=0; --i) { + r=(z[i>>>3]>>>(i&7))&1; + sel25519(a,b,r); + sel25519(c,d,r); + A(e,a,c); + Z(a,a,c); + A(c,b,d); + Z(b,b,d); + S(d,e); + S(f,a); + M(a,c,a); + M(c,b,e); + A(e,a,c); + Z(a,a,c); + S(b,a); + Z(c,d,f); + M(a,c,_121665); + A(a,a,d); + M(c,c,a); + M(a,d,f); + M(d,b,x); + S(b,e); + sel25519(a,b,r); + sel25519(c,d,r); + } + for (i = 0; i < 16; i++) { + x[i+16]=a[i]; + x[i+32]=c[i]; + x[i+48]=b[i]; + x[i+64]=d[i]; + } + var x32 = x.subarray(32); + var x16 = x.subarray(16); + inv25519(x32,x32); + M(x16,x16,x32); + pack25519(q,x16); + return 0; +} + +function crypto_scalarmult_base(q, n) { + return crypto_scalarmult(q, n, _9); +} + +function crypto_box_keypair(y, x) { + randombytes(x, 32); + return crypto_scalarmult_base(y, x); +} + +function crypto_box_beforenm(k, y, x) { + var s = new Uint8Array(32); + crypto_scalarmult(s, x, y); + return crypto_core_hsalsa20(k, _0, s, sigma); +} + +var crypto_box_afternm = crypto_secretbox; +var crypto_box_open_afternm = crypto_secretbox_open; + +function crypto_box(c, m, d, n, y, x) { + var k = new Uint8Array(32); + crypto_box_beforenm(k, y, x); + return crypto_box_afternm(c, m, d, n, k); +} + +function crypto_box_open(m, c, d, n, y, x) { + var k = new Uint8Array(32); + crypto_box_beforenm(k, y, x); + return crypto_box_open_afternm(m, c, d, n, k); +} + +var K = [ + 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd, + 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc, + 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019, + 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118, + 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe, + 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2, + 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1, + 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694, + 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3, + 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65, + 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483, + 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5, + 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210, + 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4, + 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725, + 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70, + 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926, + 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df, + 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8, + 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b, + 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001, + 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30, + 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910, + 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8, + 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53, + 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8, + 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb, + 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3, + 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60, + 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec, + 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9, + 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b, + 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207, + 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178, + 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6, + 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b, + 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493, + 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c, + 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a, + 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817 +]; + +function crypto_hashblocks_hl(hh, hl, m, n) { + var wh = new Int32Array(16), wl = new Int32Array(16), + bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7, + bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7, + th, tl, i, j, h, l, a, b, c, d; + + var ah0 = hh[0], + ah1 = hh[1], + ah2 = hh[2], + ah3 = hh[3], + ah4 = hh[4], + ah5 = hh[5], + ah6 = hh[6], + ah7 = hh[7], + + al0 = hl[0], + al1 = hl[1], + al2 = hl[2], + al3 = hl[3], + al4 = hl[4], + al5 = hl[5], + al6 = hl[6], + al7 = hl[7]; + + var pos = 0; + while (n >= 128) { + for (i = 0; i < 16; i++) { + j = 8 * i + pos; + wh[i] = (m[j+0] << 24) | (m[j+1] << 16) | (m[j+2] << 8) | m[j+3]; + wl[i] = (m[j+4] << 24) | (m[j+5] << 16) | (m[j+6] << 8) | m[j+7]; + } + for (i = 0; i < 80; i++) { + bh0 = ah0; + bh1 = ah1; + bh2 = ah2; + bh3 = ah3; + bh4 = ah4; + bh5 = ah5; + bh6 = ah6; + bh7 = ah7; + + bl0 = al0; + bl1 = al1; + bl2 = al2; + bl3 = al3; + bl4 = al4; + bl5 = al5; + bl6 = al6; + bl7 = al7; + + // add + h = ah7; + l = al7; + + a = l & 0xffff; b = l >>> 16; + c = h & 0xffff; d = h >>> 16; + + // Sigma1 + h = ((ah4 >>> 14) | (al4 << (32-14))) ^ ((ah4 >>> 18) | (al4 << (32-18))) ^ ((al4 >>> (41-32)) | (ah4 << (32-(41-32)))); + l = ((al4 >>> 14) | (ah4 << (32-14))) ^ ((al4 >>> 18) | (ah4 << (32-18))) ^ ((ah4 >>> (41-32)) | (al4 << (32-(41-32)))); + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + // Ch + h = (ah4 & ah5) ^ (~ah4 & ah6); + l = (al4 & al5) ^ (~al4 & al6); + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + // K + h = K[i*2]; + l = K[i*2+1]; + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + // w + h = wh[i%16]; + l = wl[i%16]; + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + + th = c & 0xffff | d << 16; + tl = a & 0xffff | b << 16; + + // add + h = th; + l = tl; + + a = l & 0xffff; b = l >>> 16; + c = h & 0xffff; d = h >>> 16; + + // Sigma0 + h = ((ah0 >>> 28) | (al0 << (32-28))) ^ ((al0 >>> (34-32)) | (ah0 << (32-(34-32)))) ^ ((al0 >>> (39-32)) | (ah0 << (32-(39-32)))); + l = ((al0 >>> 28) | (ah0 << (32-28))) ^ ((ah0 >>> (34-32)) | (al0 << (32-(34-32)))) ^ ((ah0 >>> (39-32)) | (al0 << (32-(39-32)))); + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + // Maj + h = (ah0 & ah1) ^ (ah0 & ah2) ^ (ah1 & ah2); + l = (al0 & al1) ^ (al0 & al2) ^ (al1 & al2); + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + + bh7 = (c & 0xffff) | (d << 16); + bl7 = (a & 0xffff) | (b << 16); + + // add + h = bh3; + l = bl3; + + a = l & 0xffff; b = l >>> 16; + c = h & 0xffff; d = h >>> 16; + + h = th; + l = tl; + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + + bh3 = (c & 0xffff) | (d << 16); + bl3 = (a & 0xffff) | (b << 16); + + ah1 = bh0; + ah2 = bh1; + ah3 = bh2; + ah4 = bh3; + ah5 = bh4; + ah6 = bh5; + ah7 = bh6; + ah0 = bh7; + + al1 = bl0; + al2 = bl1; + al3 = bl2; + al4 = bl3; + al5 = bl4; + al6 = bl5; + al7 = bl6; + al0 = bl7; + + if (i%16 === 15) { + for (j = 0; j < 16; j++) { + // add + h = wh[j]; + l = wl[j]; + + a = l & 0xffff; b = l >>> 16; + c = h & 0xffff; d = h >>> 16; + + h = wh[(j+9)%16]; + l = wl[(j+9)%16]; + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + // sigma0 + th = wh[(j+1)%16]; + tl = wl[(j+1)%16]; + h = ((th >>> 1) | (tl << (32-1))) ^ ((th >>> 8) | (tl << (32-8))) ^ (th >>> 7); + l = ((tl >>> 1) | (th << (32-1))) ^ ((tl >>> 8) | (th << (32-8))) ^ ((tl >>> 7) | (th << (32-7))); + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + // sigma1 + th = wh[(j+14)%16]; + tl = wl[(j+14)%16]; + h = ((th >>> 19) | (tl << (32-19))) ^ ((tl >>> (61-32)) | (th << (32-(61-32)))) ^ (th >>> 6); + l = ((tl >>> 19) | (th << (32-19))) ^ ((th >>> (61-32)) | (tl << (32-(61-32)))) ^ ((tl >>> 6) | (th << (32-6))); + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + + wh[j] = (c & 0xffff) | (d << 16); + wl[j] = (a & 0xffff) | (b << 16); + } + } + } + + // add + h = ah0; + l = al0; + + a = l & 0xffff; b = l >>> 16; + c = h & 0xffff; d = h >>> 16; + + h = hh[0]; + l = hl[0]; + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + + hh[0] = ah0 = (c & 0xffff) | (d << 16); + hl[0] = al0 = (a & 0xffff) | (b << 16); + + h = ah1; + l = al1; + + a = l & 0xffff; b = l >>> 16; + c = h & 0xffff; d = h >>> 16; + + h = hh[1]; + l = hl[1]; + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + + hh[1] = ah1 = (c & 0xffff) | (d << 16); + hl[1] = al1 = (a & 0xffff) | (b << 16); + + h = ah2; + l = al2; + + a = l & 0xffff; b = l >>> 16; + c = h & 0xffff; d = h >>> 16; + + h = hh[2]; + l = hl[2]; + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + + hh[2] = ah2 = (c & 0xffff) | (d << 16); + hl[2] = al2 = (a & 0xffff) | (b << 16); + + h = ah3; + l = al3; + + a = l & 0xffff; b = l >>> 16; + c = h & 0xffff; d = h >>> 16; + + h = hh[3]; + l = hl[3]; + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + + hh[3] = ah3 = (c & 0xffff) | (d << 16); + hl[3] = al3 = (a & 0xffff) | (b << 16); + + h = ah4; + l = al4; + + a = l & 0xffff; b = l >>> 16; + c = h & 0xffff; d = h >>> 16; + + h = hh[4]; + l = hl[4]; + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + + hh[4] = ah4 = (c & 0xffff) | (d << 16); + hl[4] = al4 = (a & 0xffff) | (b << 16); + + h = ah5; + l = al5; + + a = l & 0xffff; b = l >>> 16; + c = h & 0xffff; d = h >>> 16; + + h = hh[5]; + l = hl[5]; + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + + hh[5] = ah5 = (c & 0xffff) | (d << 16); + hl[5] = al5 = (a & 0xffff) | (b << 16); + + h = ah6; + l = al6; + + a = l & 0xffff; b = l >>> 16; + c = h & 0xffff; d = h >>> 16; + + h = hh[6]; + l = hl[6]; + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + + hh[6] = ah6 = (c & 0xffff) | (d << 16); + hl[6] = al6 = (a & 0xffff) | (b << 16); + + h = ah7; + l = al7; + + a = l & 0xffff; b = l >>> 16; + c = h & 0xffff; d = h >>> 16; + + h = hh[7]; + l = hl[7]; + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + + hh[7] = ah7 = (c & 0xffff) | (d << 16); + hl[7] = al7 = (a & 0xffff) | (b << 16); + + pos += 128; + n -= 128; + } + + return n; +} + +function crypto_hash(out, m, n) { + var hh = new Int32Array(8), + hl = new Int32Array(8), + x = new Uint8Array(256), + i, b = n; + + hh[0] = 0x6a09e667; + hh[1] = 0xbb67ae85; + hh[2] = 0x3c6ef372; + hh[3] = 0xa54ff53a; + hh[4] = 0x510e527f; + hh[5] = 0x9b05688c; + hh[6] = 0x1f83d9ab; + hh[7] = 0x5be0cd19; + + hl[0] = 0xf3bcc908; + hl[1] = 0x84caa73b; + hl[2] = 0xfe94f82b; + hl[3] = 0x5f1d36f1; + hl[4] = 0xade682d1; + hl[5] = 0x2b3e6c1f; + hl[6] = 0xfb41bd6b; + hl[7] = 0x137e2179; + + crypto_hashblocks_hl(hh, hl, m, n); + n %= 128; + + for (i = 0; i < n; i++) x[i] = m[b-n+i]; + x[n] = 128; + + n = 256-128*(n<112?1:0); + x[n-9] = 0; + ts64(x, n-8, (b / 0x20000000) | 0, b << 3); + crypto_hashblocks_hl(hh, hl, x, n); + + for (i = 0; i < 8; i++) ts64(out, 8*i, hh[i], hl[i]); + + return 0; +} + +function add(p, q) { + var a = gf(), b = gf(), c = gf(), + d = gf(), e = gf(), f = gf(), + g = gf(), h = gf(), t = gf(); + + Z(a, p[1], p[0]); + Z(t, q[1], q[0]); + M(a, a, t); + A(b, p[0], p[1]); + A(t, q[0], q[1]); + M(b, b, t); + M(c, p[3], q[3]); + M(c, c, D2); + M(d, p[2], q[2]); + A(d, d, d); + Z(e, b, a); + Z(f, d, c); + A(g, d, c); + A(h, b, a); + + M(p[0], e, f); + M(p[1], h, g); + M(p[2], g, f); + M(p[3], e, h); +} + +function cswap(p, q, b) { + var i; + for (i = 0; i < 4; i++) { + sel25519(p[i], q[i], b); + } +} + +function pack(r, p) { + var tx = gf(), ty = gf(), zi = gf(); + inv25519(zi, p[2]); + M(tx, p[0], zi); + M(ty, p[1], zi); + pack25519(r, ty); + r[31] ^= par25519(tx) << 7; +} + +function scalarmult(p, q, s) { + var b, i; + set25519(p[0], gf0); + set25519(p[1], gf1); + set25519(p[2], gf1); + set25519(p[3], gf0); + for (i = 255; i >= 0; --i) { + b = (s[(i/8)|0] >> (i&7)) & 1; + cswap(p, q, b); + add(q, p); + add(p, p); + cswap(p, q, b); + } +} + +function scalarbase(p, s) { + var q = [gf(), gf(), gf(), gf()]; + set25519(q[0], X); + set25519(q[1], Y); + set25519(q[2], gf1); + M(q[3], X, Y); + scalarmult(p, q, s); +} + +function crypto_sign_keypair(pk, sk, seeded) { + var d = new Uint8Array(64); + var p = [gf(), gf(), gf(), gf()]; + var i; + + if (!seeded) randombytes(sk, 32); + crypto_hash(d, sk, 32); + d[0] &= 248; + d[31] &= 127; + d[31] |= 64; + + scalarbase(p, d); + pack(pk, p); + + for (i = 0; i < 32; i++) sk[i+32] = pk[i]; + return 0; +} + +var L = new Float64Array([0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10]); + +function modL(r, x) { + var carry, i, j, k; + for (i = 63; i >= 32; --i) { + carry = 0; + for (j = i - 32, k = i - 12; j < k; ++j) { + x[j] += carry - 16 * x[i] * L[j - (i - 32)]; + carry = (x[j] + 128) >> 8; + x[j] -= carry * 256; + } + x[j] += carry; + x[i] = 0; + } + carry = 0; + for (j = 0; j < 32; j++) { + x[j] += carry - (x[31] >> 4) * L[j]; + carry = x[j] >> 8; + x[j] &= 255; + } + for (j = 0; j < 32; j++) x[j] -= carry * L[j]; + for (i = 0; i < 32; i++) { + x[i+1] += x[i] >> 8; + r[i] = x[i] & 255; + } +} + +function reduce(r) { + var x = new Float64Array(64), i; + for (i = 0; i < 64; i++) x[i] = r[i]; + for (i = 0; i < 64; i++) r[i] = 0; + modL(r, x); +} + +// Note: difference from C - smlen returned, not passed as argument. +function crypto_sign(sm, m, n, sk) { + var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64); + var i, j, x = new Float64Array(64); + var p = [gf(), gf(), gf(), gf()]; + + crypto_hash(d, sk, 32); + d[0] &= 248; + d[31] &= 127; + d[31] |= 64; + + var smlen = n + 64; + for (i = 0; i < n; i++) sm[64 + i] = m[i]; + for (i = 0; i < 32; i++) sm[32 + i] = d[32 + i]; + + crypto_hash(r, sm.subarray(32), n+32); + reduce(r); + scalarbase(p, r); + pack(sm, p); + + for (i = 32; i < 64; i++) sm[i] = sk[i]; + crypto_hash(h, sm, n + 64); + reduce(h); + + for (i = 0; i < 64; i++) x[i] = 0; + for (i = 0; i < 32; i++) x[i] = r[i]; + for (i = 0; i < 32; i++) { + for (j = 0; j < 32; j++) { + x[i+j] += h[i] * d[j]; + } + } + + modL(sm.subarray(32), x); + return smlen; +} + +function unpackneg(r, p) { + var t = gf(), chk = gf(), num = gf(), + den = gf(), den2 = gf(), den4 = gf(), + den6 = gf(); + + set25519(r[2], gf1); + unpack25519(r[1], p); + S(num, r[1]); + M(den, num, D); + Z(num, num, r[2]); + A(den, r[2], den); + + S(den2, den); + S(den4, den2); + M(den6, den4, den2); + M(t, den6, num); + M(t, t, den); + + pow2523(t, t); + M(t, t, num); + M(t, t, den); + M(t, t, den); + M(r[0], t, den); + + S(chk, r[0]); + M(chk, chk, den); + if (neq25519(chk, num)) M(r[0], r[0], I); + + S(chk, r[0]); + M(chk, chk, den); + if (neq25519(chk, num)) return -1; + + if (par25519(r[0]) === (p[31]>>7)) Z(r[0], gf0, r[0]); + + M(r[3], r[0], r[1]); + return 0; +} + +function crypto_sign_open(m, sm, n, pk) { + var i, mlen; + var t = new Uint8Array(32), h = new Uint8Array(64); + var p = [gf(), gf(), gf(), gf()], + q = [gf(), gf(), gf(), gf()]; + + mlen = -1; + if (n < 64) return -1; + + if (unpackneg(q, pk)) return -1; + + for (i = 0; i < n; i++) m[i] = sm[i]; + for (i = 0; i < 32; i++) m[i+32] = pk[i]; + crypto_hash(h, m, n); + reduce(h); + scalarmult(p, q, h); + + scalarbase(q, sm.subarray(32)); + add(p, q); + pack(t, p); + + n -= 64; + if (crypto_verify_32(sm, 0, t, 0)) { + for (i = 0; i < n; i++) m[i] = 0; + return -1; + } + + for (i = 0; i < n; i++) m[i] = sm[i + 64]; + mlen = n; + return mlen; +} + +var crypto_secretbox_KEYBYTES = 32, + crypto_secretbox_NONCEBYTES = 24, + crypto_secretbox_ZEROBYTES = 32, + crypto_secretbox_BOXZEROBYTES = 16, + crypto_scalarmult_BYTES = 32, + crypto_scalarmult_SCALARBYTES = 32, + crypto_box_PUBLICKEYBYTES = 32, + crypto_box_SECRETKEYBYTES = 32, + crypto_box_BEFORENMBYTES = 32, + crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES, + crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES, + crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES, + crypto_sign_BYTES = 64, + crypto_sign_PUBLICKEYBYTES = 32, + crypto_sign_SECRETKEYBYTES = 64, + crypto_sign_SEEDBYTES = 32, + crypto_hash_BYTES = 64; + +nacl.lowlevel = { + crypto_core_hsalsa20: crypto_core_hsalsa20, + crypto_stream_xor: crypto_stream_xor, + crypto_stream: crypto_stream, + crypto_stream_salsa20_xor: crypto_stream_salsa20_xor, + crypto_stream_salsa20: crypto_stream_salsa20, + crypto_onetimeauth: crypto_onetimeauth, + crypto_onetimeauth_verify: crypto_onetimeauth_verify, + crypto_verify_16: crypto_verify_16, + crypto_verify_32: crypto_verify_32, + crypto_secretbox: crypto_secretbox, + crypto_secretbox_open: crypto_secretbox_open, + crypto_scalarmult: crypto_scalarmult, + crypto_scalarmult_base: crypto_scalarmult_base, + crypto_box_beforenm: crypto_box_beforenm, + crypto_box_afternm: crypto_box_afternm, + crypto_box: crypto_box, + crypto_box_open: crypto_box_open, + crypto_box_keypair: crypto_box_keypair, + crypto_hash: crypto_hash, + crypto_sign: crypto_sign, + crypto_sign_keypair: crypto_sign_keypair, + crypto_sign_open: crypto_sign_open, + + crypto_secretbox_KEYBYTES: crypto_secretbox_KEYBYTES, + crypto_secretbox_NONCEBYTES: crypto_secretbox_NONCEBYTES, + crypto_secretbox_ZEROBYTES: crypto_secretbox_ZEROBYTES, + crypto_secretbox_BOXZEROBYTES: crypto_secretbox_BOXZEROBYTES, + crypto_scalarmult_BYTES: crypto_scalarmult_BYTES, + crypto_scalarmult_SCALARBYTES: crypto_scalarmult_SCALARBYTES, + crypto_box_PUBLICKEYBYTES: crypto_box_PUBLICKEYBYTES, + crypto_box_SECRETKEYBYTES: crypto_box_SECRETKEYBYTES, + crypto_box_BEFORENMBYTES: crypto_box_BEFORENMBYTES, + crypto_box_NONCEBYTES: crypto_box_NONCEBYTES, + crypto_box_ZEROBYTES: crypto_box_ZEROBYTES, + crypto_box_BOXZEROBYTES: crypto_box_BOXZEROBYTES, + crypto_sign_BYTES: crypto_sign_BYTES, + crypto_sign_PUBLICKEYBYTES: crypto_sign_PUBLICKEYBYTES, + crypto_sign_SECRETKEYBYTES: crypto_sign_SECRETKEYBYTES, + crypto_sign_SEEDBYTES: crypto_sign_SEEDBYTES, + crypto_hash_BYTES: crypto_hash_BYTES +}; + +/* High-level API */ + +function checkLengths(k, n) { + if (k.length !== crypto_secretbox_KEYBYTES) throw new Error('bad key size'); + if (n.length !== crypto_secretbox_NONCEBYTES) throw new Error('bad nonce size'); +} + +function checkBoxLengths(pk, sk) { + if (pk.length !== crypto_box_PUBLICKEYBYTES) throw new Error('bad public key size'); + if (sk.length !== crypto_box_SECRETKEYBYTES) throw new Error('bad secret key size'); +} + +function checkArrayTypes() { + var t, i; + for (i = 0; i < arguments.length; i++) { + if ((t = Object.prototype.toString.call(arguments[i])) !== '[object Uint8Array]') + throw new TypeError('unexpected type ' + t + ', use Uint8Array'); + } +} + +function cleanup(arr) { + for (var i = 0; i < arr.length; i++) arr[i] = 0; +} + +nacl.util = {}; + +nacl.util.decodeUTF8 = function(s) { + var i, d = unescape(encodeURIComponent(s)), b = new Uint8Array(d.length); + for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i); + return b; +}; + +nacl.util.encodeUTF8 = function(arr) { + var i, s = []; + for (i = 0; i < arr.length; i++) s.push(String.fromCharCode(arr[i])); + return decodeURIComponent(escape(s.join(''))); +}; + +nacl.util.encodeBase64 = function(arr) { + if (typeof btoa === 'undefined') { + return (new Buffer(arr)).toString('base64'); + } else { + var i, s = [], len = arr.length; + for (i = 0; i < len; i++) s.push(String.fromCharCode(arr[i])); + return btoa(s.join('')); + } +}; + +nacl.util.decodeBase64 = function(s) { + if (typeof atob === 'undefined') { + return new Uint8Array(Array.prototype.slice.call(new Buffer(s, 'base64'), 0)); + } else { + var i, d = atob(s), b = new Uint8Array(d.length); + for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i); + return b; + } +}; + +nacl.randomBytes = function(n) { + var b = new Uint8Array(n); + randombytes(b, n); + return b; +}; + +nacl.secretbox = function(msg, nonce, key) { + checkArrayTypes(msg, nonce, key); + checkLengths(key, nonce); + var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length); + var c = new Uint8Array(m.length); + for (var i = 0; i < msg.length; i++) m[i+crypto_secretbox_ZEROBYTES] = msg[i]; + crypto_secretbox(c, m, m.length, nonce, key); + return c.subarray(crypto_secretbox_BOXZEROBYTES); +}; + +nacl.secretbox.open = function(box, nonce, key) { + checkArrayTypes(box, nonce, key); + checkLengths(key, nonce); + var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length); + var m = new Uint8Array(c.length); + for (var i = 0; i < box.length; i++) c[i+crypto_secretbox_BOXZEROBYTES] = box[i]; + if (c.length < 32) return false; + if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) return false; + return m.subarray(crypto_secretbox_ZEROBYTES); +}; + +nacl.secretbox.keyLength = crypto_secretbox_KEYBYTES; +nacl.secretbox.nonceLength = crypto_secretbox_NONCEBYTES; +nacl.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES; + +nacl.scalarMult = function(n, p) { + checkArrayTypes(n, p); + if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size'); + if (p.length !== crypto_scalarmult_BYTES) throw new Error('bad p size'); + var q = new Uint8Array(crypto_scalarmult_BYTES); + crypto_scalarmult(q, n, p); + return q; +}; + +nacl.scalarMult.base = function(n) { + checkArrayTypes(n); + if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size'); + var q = new Uint8Array(crypto_scalarmult_BYTES); + crypto_scalarmult_base(q, n); + return q; +}; + +nacl.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES; +nacl.scalarMult.groupElementLength = crypto_scalarmult_BYTES; + +nacl.box = function(msg, nonce, publicKey, secretKey) { + var k = nacl.box.before(publicKey, secretKey); + return nacl.secretbox(msg, nonce, k); +}; + +nacl.box.before = function(publicKey, secretKey) { + checkArrayTypes(publicKey, secretKey); + checkBoxLengths(publicKey, secretKey); + var k = new Uint8Array(crypto_box_BEFORENMBYTES); + crypto_box_beforenm(k, publicKey, secretKey); + return k; +}; + +nacl.box.after = nacl.secretbox; + +nacl.box.open = function(msg, nonce, publicKey, secretKey) { + var k = nacl.box.before(publicKey, secretKey); + return nacl.secretbox.open(msg, nonce, k); +}; + +nacl.box.open.after = nacl.secretbox.open; + +nacl.box.keyPair = function() { + var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_box_SECRETKEYBYTES); + crypto_box_keypair(pk, sk); + return {publicKey: pk, secretKey: sk}; +}; + +nacl.box.keyPair.fromSecretKey = function(secretKey) { + checkArrayTypes(secretKey); + if (secretKey.length !== crypto_box_SECRETKEYBYTES) + throw new Error('bad secret key size'); + var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); + crypto_scalarmult_base(pk, secretKey); + return {publicKey: pk, secretKey: new Uint8Array(secretKey)}; +}; + +nacl.box.publicKeyLength = crypto_box_PUBLICKEYBYTES; +nacl.box.secretKeyLength = crypto_box_SECRETKEYBYTES; +nacl.box.sharedKeyLength = crypto_box_BEFORENMBYTES; +nacl.box.nonceLength = crypto_box_NONCEBYTES; +nacl.box.overheadLength = nacl.secretbox.overheadLength; + +nacl.sign = function(msg, secretKey) { + checkArrayTypes(msg, secretKey); + if (secretKey.length !== crypto_sign_SECRETKEYBYTES) + throw new Error('bad secret key size'); + var signedMsg = new Uint8Array(crypto_sign_BYTES+msg.length); + crypto_sign(signedMsg, msg, msg.length, secretKey); + return signedMsg; +}; + +nacl.sign.open = function(signedMsg, publicKey) { + if (arguments.length !== 2) + throw new Error('nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?'); + checkArrayTypes(signedMsg, publicKey); + if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) + throw new Error('bad public key size'); + var tmp = new Uint8Array(signedMsg.length); + var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey); + if (mlen < 0) return null; + var m = new Uint8Array(mlen); + for (var i = 0; i < m.length; i++) m[i] = tmp[i]; + return m; +}; + +nacl.sign.detached = function(msg, secretKey) { + var signedMsg = nacl.sign(msg, secretKey); + var sig = new Uint8Array(crypto_sign_BYTES); + for (var i = 0; i < sig.length; i++) sig[i] = signedMsg[i]; + return sig; +}; + +nacl.sign.detached.verify = function(msg, sig, publicKey) { + checkArrayTypes(msg, sig, publicKey); + if (sig.length !== crypto_sign_BYTES) + throw new Error('bad signature size'); + if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) + throw new Error('bad public key size'); + var sm = new Uint8Array(crypto_sign_BYTES + msg.length); + var m = new Uint8Array(crypto_sign_BYTES + msg.length); + var i; + for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i]; + for (i = 0; i < msg.length; i++) sm[i+crypto_sign_BYTES] = msg[i]; + return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0); +}; + +nacl.sign.keyPair = function() { + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); + crypto_sign_keypair(pk, sk); + return {publicKey: pk, secretKey: sk}; +}; + +nacl.sign.keyPair.fromSecretKey = function(secretKey) { + checkArrayTypes(secretKey); + if (secretKey.length !== crypto_sign_SECRETKEYBYTES) + throw new Error('bad secret key size'); + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + for (var i = 0; i < pk.length; i++) pk[i] = secretKey[32+i]; + return {publicKey: pk, secretKey: new Uint8Array(secretKey)}; +}; + +nacl.sign.keyPair.fromSeed = function(seed) { + checkArrayTypes(seed); + if (seed.length !== crypto_sign_SEEDBYTES) + throw new Error('bad seed size'); + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); + for (var i = 0; i < 32; i++) sk[i] = seed[i]; + crypto_sign_keypair(pk, sk, true); + return {publicKey: pk, secretKey: sk}; +}; + +nacl.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES; +nacl.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES; +nacl.sign.seedLength = crypto_sign_SEEDBYTES; +nacl.sign.signatureLength = crypto_sign_BYTES; + +nacl.hash = function(msg) { + checkArrayTypes(msg); + var h = new Uint8Array(crypto_hash_BYTES); + crypto_hash(h, msg, msg.length); + return h; +}; + +nacl.hash.hashLength = crypto_hash_BYTES; + +nacl.verify = function(x, y) { + checkArrayTypes(x, y); + // Zero length arguments are considered not equal. + if (x.length === 0 || y.length === 0) return false; + if (x.length !== y.length) return false; + return (vn(x, 0, y, 0, x.length) === 0) ? true : false; +}; + +nacl.setPRNG = function(fn) { + randombytes = fn; +}; + +(function() { + // Initialize PRNG if environment provides CSPRNG. + // If not, methods calling randombytes will throw. + var crypto; + if (typeof window !== 'undefined') { + // Browser. + if (window.crypto && window.crypto.getRandomValues) { + crypto = window.crypto; // Standard + } else if (window.msCrypto && window.msCrypto.getRandomValues) { + crypto = window.msCrypto; // Internet Explorer 11+ + } + if (crypto) { + nacl.setPRNG(function(x, n) { + var i, v = new Uint8Array(n); + crypto.getRandomValues(v); + for (i = 0; i < n; i++) x[i] = v[i]; + cleanup(v); + }); + } + } else if (typeof require !== 'undefined') { + // Node.js. + crypto = require('crypto'); + if (crypto) { + nacl.setPRNG(function(x, n) { + var i, v = crypto.randomBytes(n); + for (i = 0; i < n; i++) x[i] = v[i]; + cleanup(v); + }); + } + } +})(); + +})(typeof module !== 'undefined' && module.exports ? module.exports : (window.nacl = window.nacl || {})); diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.min.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.min.js new file mode 100644 index 00000000000000..7072c2af4435bd --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.min.js @@ -0,0 +1,2 @@ +!function(r){"use strict";function t(r,t,n,e){r[t]=n>>24&255,r[t+1]=n>>16&255,r[t+2]=n>>8&255,r[t+3]=255&n,r[t+4]=e>>24&255,r[t+5]=e>>16&255,r[t+6]=e>>8&255,r[t+7]=255&e}function n(r,t,n,e,o){var i,h=0;for(i=0;o>i;i++)h|=r[t+i]^n[e+i];return(1&h-1>>>8)-1}function e(r,t,e,o){return n(r,t,e,o,16)}function o(r,t,e,o){return n(r,t,e,o,32)}function i(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,w=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,g=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,v=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,d=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,A=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,_=i,U=h,E=a,x=f,M=s,m=u,B=c,S=y,K=l,T=w,Y=p,k=g,L=v,C=b,R=d,z=A,P=0;20>P;P+=2)o=_+L|0,M^=o<<7|o>>>25,o=M+_|0,K^=o<<9|o>>>23,o=K+M|0,L^=o<<13|o>>>19,o=L+K|0,_^=o<<18|o>>>14,o=m+U|0,T^=o<<7|o>>>25,o=T+m|0,C^=o<<9|o>>>23,o=C+T|0,U^=o<<13|o>>>19,o=U+C|0,m^=o<<18|o>>>14,o=Y+B|0,R^=o<<7|o>>>25,o=R+Y|0,E^=o<<9|o>>>23,o=E+R|0,B^=o<<13|o>>>19,o=B+E|0,Y^=o<<18|o>>>14,o=z+k|0,x^=o<<7|o>>>25,o=x+z|0,S^=o<<9|o>>>23,o=S+x|0,k^=o<<13|o>>>19,o=k+S|0,z^=o<<18|o>>>14,o=_+x|0,U^=o<<7|o>>>25,o=U+_|0,E^=o<<9|o>>>23,o=E+U|0,x^=o<<13|o>>>19,o=x+E|0,_^=o<<18|o>>>14,o=m+M|0,B^=o<<7|o>>>25,o=B+m|0,S^=o<<9|o>>>23,o=S+B|0,M^=o<<13|o>>>19,o=M+S|0,m^=o<<18|o>>>14,o=Y+T|0,k^=o<<7|o>>>25,o=k+Y|0,K^=o<<9|o>>>23,o=K+k|0,T^=o<<13|o>>>19,o=T+K|0,Y^=o<<18|o>>>14,o=z+R|0,L^=o<<7|o>>>25,o=L+z|0,C^=o<<9|o>>>23,o=C+L|0,R^=o<<13|o>>>19,o=R+C|0,z^=o<<18|o>>>14;_=_+i|0,U=U+h|0,E=E+a|0,x=x+f|0,M=M+s|0,m=m+u|0,B=B+c|0,S=S+y|0,K=K+l|0,T=T+w|0,Y=Y+p|0,k=k+g|0,L=L+v|0,C=C+b|0,R=R+d|0,z=z+A|0,r[0]=_>>>0&255,r[1]=_>>>8&255,r[2]=_>>>16&255,r[3]=_>>>24&255,r[4]=U>>>0&255,r[5]=U>>>8&255,r[6]=U>>>16&255,r[7]=U>>>24&255,r[8]=E>>>0&255,r[9]=E>>>8&255,r[10]=E>>>16&255,r[11]=E>>>24&255,r[12]=x>>>0&255,r[13]=x>>>8&255,r[14]=x>>>16&255,r[15]=x>>>24&255,r[16]=M>>>0&255,r[17]=M>>>8&255,r[18]=M>>>16&255,r[19]=M>>>24&255,r[20]=m>>>0&255,r[21]=m>>>8&255,r[22]=m>>>16&255,r[23]=m>>>24&255,r[24]=B>>>0&255,r[25]=B>>>8&255,r[26]=B>>>16&255,r[27]=B>>>24&255,r[28]=S>>>0&255,r[29]=S>>>8&255,r[30]=S>>>16&255,r[31]=S>>>24&255,r[32]=K>>>0&255,r[33]=K>>>8&255,r[34]=K>>>16&255,r[35]=K>>>24&255,r[36]=T>>>0&255,r[37]=T>>>8&255,r[38]=T>>>16&255,r[39]=T>>>24&255,r[40]=Y>>>0&255,r[41]=Y>>>8&255,r[42]=Y>>>16&255,r[43]=Y>>>24&255,r[44]=k>>>0&255,r[45]=k>>>8&255,r[46]=k>>>16&255,r[47]=k>>>24&255,r[48]=L>>>0&255,r[49]=L>>>8&255,r[50]=L>>>16&255,r[51]=L>>>24&255,r[52]=C>>>0&255,r[53]=C>>>8&255,r[54]=C>>>16&255,r[55]=C>>>24&255,r[56]=R>>>0&255,r[57]=R>>>8&255,r[58]=R>>>16&255,r[59]=R>>>24&255,r[60]=z>>>0&255,r[61]=z>>>8&255,r[62]=z>>>16&255,r[63]=z>>>24&255}function h(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,w=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,g=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,v=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,d=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,A=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,_=i,U=h,E=a,x=f,M=s,m=u,B=c,S=y,K=l,T=w,Y=p,k=g,L=v,C=b,R=d,z=A,P=0;20>P;P+=2)o=_+L|0,M^=o<<7|o>>>25,o=M+_|0,K^=o<<9|o>>>23,o=K+M|0,L^=o<<13|o>>>19,o=L+K|0,_^=o<<18|o>>>14,o=m+U|0,T^=o<<7|o>>>25,o=T+m|0,C^=o<<9|o>>>23,o=C+T|0,U^=o<<13|o>>>19,o=U+C|0,m^=o<<18|o>>>14,o=Y+B|0,R^=o<<7|o>>>25,o=R+Y|0,E^=o<<9|o>>>23,o=E+R|0,B^=o<<13|o>>>19,o=B+E|0,Y^=o<<18|o>>>14,o=z+k|0,x^=o<<7|o>>>25,o=x+z|0,S^=o<<9|o>>>23,o=S+x|0,k^=o<<13|o>>>19,o=k+S|0,z^=o<<18|o>>>14,o=_+x|0,U^=o<<7|o>>>25,o=U+_|0,E^=o<<9|o>>>23,o=E+U|0,x^=o<<13|o>>>19,o=x+E|0,_^=o<<18|o>>>14,o=m+M|0,B^=o<<7|o>>>25,o=B+m|0,S^=o<<9|o>>>23,o=S+B|0,M^=o<<13|o>>>19,o=M+S|0,m^=o<<18|o>>>14,o=Y+T|0,k^=o<<7|o>>>25,o=k+Y|0,K^=o<<9|o>>>23,o=K+k|0,T^=o<<13|o>>>19,o=T+K|0,Y^=o<<18|o>>>14,o=z+R|0,L^=o<<7|o>>>25,o=L+z|0,C^=o<<9|o>>>23,o=C+L|0,R^=o<<13|o>>>19,o=R+C|0,z^=o<<18|o>>>14;r[0]=_>>>0&255,r[1]=_>>>8&255,r[2]=_>>>16&255,r[3]=_>>>24&255,r[4]=m>>>0&255,r[5]=m>>>8&255,r[6]=m>>>16&255,r[7]=m>>>24&255,r[8]=Y>>>0&255,r[9]=Y>>>8&255,r[10]=Y>>>16&255,r[11]=Y>>>24&255,r[12]=z>>>0&255,r[13]=z>>>8&255,r[14]=z>>>16&255,r[15]=z>>>24&255,r[16]=B>>>0&255,r[17]=B>>>8&255,r[18]=B>>>16&255,r[19]=B>>>24&255,r[20]=S>>>0&255,r[21]=S>>>8&255,r[22]=S>>>16&255,r[23]=S>>>24&255,r[24]=K>>>0&255,r[25]=K>>>8&255,r[26]=K>>>16&255,r[27]=K>>>24&255,r[28]=T>>>0&255,r[29]=T>>>8&255,r[30]=T>>>16&255,r[31]=T>>>24&255}function a(r,t,n,e){i(r,t,n,e)}function f(r,t,n,e){h(r,t,n,e)}function s(r,t,n,e,o,i,h){var f,s,u=new Uint8Array(16),c=new Uint8Array(64);for(s=0;16>s;s++)u[s]=0;for(s=0;8>s;s++)u[s]=i[s];for(;o>=64;){for(a(c,u,h,cr),s=0;64>s;s++)r[t+s]=n[e+s]^c[s];for(f=1,s=8;16>s;s++)f=f+(255&u[s])|0,u[s]=255&f,f>>>=8;o-=64,t+=64,e+=64}if(o>0)for(a(c,u,h,cr),s=0;o>s;s++)r[t+s]=n[e+s]^c[s];return 0}function u(r,t,n,e,o){var i,h,f=new Uint8Array(16),s=new Uint8Array(64);for(h=0;16>h;h++)f[h]=0;for(h=0;8>h;h++)f[h]=e[h];for(;n>=64;){for(a(s,f,o,cr),h=0;64>h;h++)r[t+h]=s[h];for(i=1,h=8;16>h;h++)i=i+(255&f[h])|0,f[h]=255&i,i>>>=8;n-=64,t+=64}if(n>0)for(a(s,f,o,cr),h=0;n>h;h++)r[t+h]=s[h];return 0}function c(r,t,n,e,o){var i=new Uint8Array(32);f(i,e,o,cr);for(var h=new Uint8Array(8),a=0;8>a;a++)h[a]=e[a+16];return u(r,t,n,h,i)}function y(r,t,n,e,o,i,h){var a=new Uint8Array(32);f(a,i,h,cr);for(var u=new Uint8Array(8),c=0;8>c;c++)u[c]=i[c+16];return s(r,t,n,e,o,u,a)}function l(r,t,n,e,o,i){var h=new yr(i);return h.update(n,e,o),h.finish(r,t),0}function w(r,t,n,o,i,h){var a=new Uint8Array(16);return l(a,0,n,o,i,h),e(r,t,a,0)}function p(r,t,n,e,o){var i;if(32>n)return-1;for(y(r,0,t,0,n,e,o),l(r,16,r,32,n-32,r),i=0;16>i;i++)r[i]=0;return 0}function g(r,t,n,e,o){var i,h=new Uint8Array(32);if(32>n)return-1;if(c(h,0,32,e,o),0!==w(t,16,t,32,n-32,h))return-1;for(y(r,0,t,0,n,e,o),i=0;32>i;i++)r[i]=0;return 0}function v(r,t){var n;for(n=0;16>n;n++)r[n]=0|t[n]}function b(r){var t,n,e=1;for(t=0;16>t;t++)n=r[t]+e+65535,e=Math.floor(n/65536),r[t]=n-65536*e;r[0]+=e-1+37*(e-1)}function d(r,t,n){for(var e,o=~(n-1),i=0;16>i;i++)e=o&(r[i]^t[i]),r[i]^=e,t[i]^=e}function A(r,t){var n,e,o,i=$(),h=$();for(n=0;16>n;n++)h[n]=t[n];for(b(h),b(h),b(h),e=0;2>e;e++){for(i[0]=h[0]-65517,n=1;15>n;n++)i[n]=h[n]-65535-(i[n-1]>>16&1),i[n-1]&=65535;i[15]=h[15]-32767-(i[14]>>16&1),o=i[15]>>16&1,i[14]&=65535,d(h,i,1-o)}for(n=0;16>n;n++)r[2*n]=255&h[n],r[2*n+1]=h[n]>>8}function _(r,t){var n=new Uint8Array(32),e=new Uint8Array(32);return A(n,r),A(e,t),o(n,0,e,0)}function U(r){var t=new Uint8Array(32);return A(t,r),1&t[0]}function E(r,t){var n;for(n=0;16>n;n++)r[n]=t[2*n]+(t[2*n+1]<<8);r[15]&=32767}function x(r,t,n){for(var e=0;16>e;e++)r[e]=t[e]+n[e]}function M(r,t,n){for(var e=0;16>e;e++)r[e]=t[e]-n[e]}function m(r,t,n){var e,o,i=0,h=0,a=0,f=0,s=0,u=0,c=0,y=0,l=0,w=0,p=0,g=0,v=0,b=0,d=0,A=0,_=0,U=0,E=0,x=0,M=0,m=0,B=0,S=0,K=0,T=0,Y=0,k=0,L=0,C=0,R=0,z=n[0],P=n[1],O=n[2],N=n[3],F=n[4],I=n[5],j=n[6],G=n[7],Z=n[8],V=n[9],q=n[10],X=n[11],D=n[12],H=n[13],J=n[14],Q=n[15];e=t[0],i+=e*z,h+=e*P,a+=e*O,f+=e*N,s+=e*F,u+=e*I,c+=e*j,y+=e*G,l+=e*Z,w+=e*V,p+=e*q,g+=e*X,v+=e*D,b+=e*H,d+=e*J,A+=e*Q,e=t[1],h+=e*z,a+=e*P,f+=e*O,s+=e*N,u+=e*F,c+=e*I,y+=e*j,l+=e*G,w+=e*Z,p+=e*V,g+=e*q,v+=e*X,b+=e*D,d+=e*H,A+=e*J,_+=e*Q,e=t[2],a+=e*z,f+=e*P,s+=e*O,u+=e*N,c+=e*F,y+=e*I,l+=e*j,w+=e*G,p+=e*Z,g+=e*V,v+=e*q,b+=e*X,d+=e*D,A+=e*H,_+=e*J,U+=e*Q,e=t[3],f+=e*z,s+=e*P,u+=e*O,c+=e*N,y+=e*F,l+=e*I,w+=e*j,p+=e*G,g+=e*Z,v+=e*V,b+=e*q,d+=e*X,A+=e*D,_+=e*H,U+=e*J,E+=e*Q,e=t[4],s+=e*z,u+=e*P,c+=e*O,y+=e*N,l+=e*F,w+=e*I,p+=e*j,g+=e*G,v+=e*Z,b+=e*V,d+=e*q,A+=e*X,_+=e*D,U+=e*H,E+=e*J,x+=e*Q,e=t[5],u+=e*z,c+=e*P,y+=e*O,l+=e*N,w+=e*F,p+=e*I,g+=e*j,v+=e*G,b+=e*Z,d+=e*V,A+=e*q,_+=e*X,U+=e*D,E+=e*H,x+=e*J,M+=e*Q,e=t[6],c+=e*z,y+=e*P,l+=e*O,w+=e*N,p+=e*F,g+=e*I,v+=e*j,b+=e*G,d+=e*Z,A+=e*V,_+=e*q,U+=e*X,E+=e*D,x+=e*H,M+=e*J,m+=e*Q,e=t[7],y+=e*z,l+=e*P,w+=e*O,p+=e*N,g+=e*F,v+=e*I,b+=e*j,d+=e*G,A+=e*Z,_+=e*V,U+=e*q,E+=e*X,x+=e*D,M+=e*H,m+=e*J,B+=e*Q,e=t[8],l+=e*z,w+=e*P,p+=e*O,g+=e*N,v+=e*F,b+=e*I,d+=e*j,A+=e*G,_+=e*Z,U+=e*V,E+=e*q,x+=e*X,M+=e*D,m+=e*H,B+=e*J,S+=e*Q,e=t[9],w+=e*z,p+=e*P,g+=e*O,v+=e*N,b+=e*F,d+=e*I,A+=e*j,_+=e*G,U+=e*Z,E+=e*V,x+=e*q,M+=e*X,m+=e*D,B+=e*H,S+=e*J,K+=e*Q,e=t[10],p+=e*z,g+=e*P,v+=e*O,b+=e*N,d+=e*F,A+=e*I,_+=e*j,U+=e*G,E+=e*Z,x+=e*V,M+=e*q,m+=e*X,B+=e*D,S+=e*H,K+=e*J,T+=e*Q,e=t[11],g+=e*z,v+=e*P,b+=e*O,d+=e*N,A+=e*F,_+=e*I,U+=e*j,E+=e*G,x+=e*Z,M+=e*V,m+=e*q,B+=e*X,S+=e*D,K+=e*H,T+=e*J,Y+=e*Q,e=t[12],v+=e*z,b+=e*P,d+=e*O,A+=e*N,_+=e*F,U+=e*I,E+=e*j,x+=e*G,M+=e*Z,m+=e*V,B+=e*q,S+=e*X,K+=e*D,T+=e*H,Y+=e*J,k+=e*Q,e=t[13],b+=e*z,d+=e*P,A+=e*O,_+=e*N,U+=e*F,E+=e*I,x+=e*j,M+=e*G,m+=e*Z,B+=e*V,S+=e*q,K+=e*X,T+=e*D,Y+=e*H,k+=e*J,L+=e*Q,e=t[14],d+=e*z,A+=e*P,_+=e*O,U+=e*N,E+=e*F,x+=e*I,M+=e*j,m+=e*G,B+=e*Z,S+=e*V,K+=e*q,T+=e*X,Y+=e*D,k+=e*H,L+=e*J,C+=e*Q,e=t[15],A+=e*z,_+=e*P,U+=e*O,E+=e*N,x+=e*F,M+=e*I,m+=e*j,B+=e*G,S+=e*Z,K+=e*V,T+=e*q,Y+=e*X,k+=e*D,L+=e*H,C+=e*J,R+=e*Q,i+=38*_,h+=38*U,a+=38*E,f+=38*x,s+=38*M,u+=38*m,c+=38*B,y+=38*S,l+=38*K,w+=38*T,p+=38*Y,g+=38*k,v+=38*L,b+=38*C,d+=38*R,o=1,e=i+o+65535,o=Math.floor(e/65536),i=e-65536*o,e=h+o+65535,o=Math.floor(e/65536),h=e-65536*o,e=a+o+65535,o=Math.floor(e/65536),a=e-65536*o,e=f+o+65535,o=Math.floor(e/65536),f=e-65536*o,e=s+o+65535,o=Math.floor(e/65536),s=e-65536*o,e=u+o+65535,o=Math.floor(e/65536),u=e-65536*o,e=c+o+65535,o=Math.floor(e/65536),c=e-65536*o,e=y+o+65535,o=Math.floor(e/65536),y=e-65536*o,e=l+o+65535,o=Math.floor(e/65536),l=e-65536*o,e=w+o+65535,o=Math.floor(e/65536),w=e-65536*o,e=p+o+65535,o=Math.floor(e/65536),p=e-65536*o,e=g+o+65535,o=Math.floor(e/65536),g=e-65536*o,e=v+o+65535,o=Math.floor(e/65536),v=e-65536*o,e=b+o+65535,o=Math.floor(e/65536),b=e-65536*o,e=d+o+65535,o=Math.floor(e/65536),d=e-65536*o,e=A+o+65535,o=Math.floor(e/65536),A=e-65536*o,i+=o-1+37*(o-1),o=1,e=i+o+65535,o=Math.floor(e/65536),i=e-65536*o,e=h+o+65535,o=Math.floor(e/65536),h=e-65536*o,e=a+o+65535,o=Math.floor(e/65536),a=e-65536*o,e=f+o+65535,o=Math.floor(e/65536),f=e-65536*o,e=s+o+65535,o=Math.floor(e/65536),s=e-65536*o,e=u+o+65535,o=Math.floor(e/65536),u=e-65536*o,e=c+o+65535,o=Math.floor(e/65536),c=e-65536*o,e=y+o+65535,o=Math.floor(e/65536),y=e-65536*o,e=l+o+65535,o=Math.floor(e/65536),l=e-65536*o,e=w+o+65535,o=Math.floor(e/65536),w=e-65536*o,e=p+o+65535,o=Math.floor(e/65536),p=e-65536*o,e=g+o+65535,o=Math.floor(e/65536),g=e-65536*o,e=v+o+65535,o=Math.floor(e/65536),v=e-65536*o,e=b+o+65535,o=Math.floor(e/65536),b=e-65536*o,e=d+o+65535,o=Math.floor(e/65536),d=e-65536*o,e=A+o+65535,o=Math.floor(e/65536),A=e-65536*o,i+=o-1+37*(o-1),r[0]=i,r[1]=h,r[2]=a,r[3]=f,r[4]=s,r[5]=u,r[6]=c,r[7]=y,r[8]=l,r[9]=w,r[10]=p,r[11]=g,r[12]=v,r[13]=b,r[14]=d,r[15]=A}function B(r,t){m(r,t,t)}function S(r,t){var n,e=$();for(n=0;16>n;n++)e[n]=t[n];for(n=253;n>=0;n--)B(e,e),2!==n&&4!==n&&m(e,e,t);for(n=0;16>n;n++)r[n]=e[n]}function K(r,t){var n,e=$();for(n=0;16>n;n++)e[n]=t[n];for(n=250;n>=0;n--)B(e,e),1!==n&&m(e,e,t);for(n=0;16>n;n++)r[n]=e[n]}function T(r,t,n){var e,o,i=new Uint8Array(32),h=new Float64Array(80),a=$(),f=$(),s=$(),u=$(),c=$(),y=$();for(o=0;31>o;o++)i[o]=t[o];for(i[31]=127&t[31]|64,i[0]&=248,E(h,n),o=0;16>o;o++)f[o]=h[o],u[o]=a[o]=s[o]=0;for(a[0]=u[0]=1,o=254;o>=0;--o)e=i[o>>>3]>>>(7&o)&1,d(a,f,e),d(s,u,e),x(c,a,s),M(a,a,s),x(s,f,u),M(f,f,u),B(u,c),B(y,a),m(a,s,a),m(s,f,c),x(c,a,s),M(a,a,s),B(f,a),M(s,u,y),m(a,s,ir),x(a,a,u),m(s,s,a),m(a,u,y),m(u,f,h),B(f,c),d(a,f,e),d(s,u,e);for(o=0;16>o;o++)h[o+16]=a[o],h[o+32]=s[o],h[o+48]=f[o],h[o+64]=u[o];var l=h.subarray(32),w=h.subarray(16);return S(l,l),m(w,w,l),A(r,w),0}function Y(r,t){return T(r,t,nr)}function k(r,t){return rr(t,32),Y(r,t)}function L(r,t,n){var e=new Uint8Array(32);return T(e,n,t),f(r,tr,e,cr)}function C(r,t,n,e,o,i){var h=new Uint8Array(32);return L(h,o,i),lr(r,t,n,e,h)}function R(r,t,n,e,o,i){var h=new Uint8Array(32);return L(h,o,i),wr(r,t,n,e,h)}function z(r,t,n,e){for(var o,i,h,a,f,s,u,c,y,l,w,p,g,v,b,d,A,_,U,E,x,M,m,B,S,K,T=new Int32Array(16),Y=new Int32Array(16),k=r[0],L=r[1],C=r[2],R=r[3],z=r[4],P=r[5],O=r[6],N=r[7],F=t[0],I=t[1],j=t[2],G=t[3],Z=t[4],V=t[5],q=t[6],X=t[7],D=0;e>=128;){for(U=0;16>U;U++)E=8*U+D,T[U]=n[E+0]<<24|n[E+1]<<16|n[E+2]<<8|n[E+3],Y[U]=n[E+4]<<24|n[E+5]<<16|n[E+6]<<8|n[E+7];for(U=0;80>U;U++)if(o=k,i=L,h=C,a=R,f=z,s=P,u=O,c=N,y=F,l=I,w=j,p=G,g=Z,v=V,b=q,d=X,x=N,M=X,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=(z>>>14|Z<<18)^(z>>>18|Z<<14)^(Z>>>9|z<<23),M=(Z>>>14|z<<18)^(Z>>>18|z<<14)^(z>>>9|Z<<23),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=z&P^~z&O,M=Z&V^~Z&q,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=pr[2*U],M=pr[2*U+1],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=T[U%16],M=Y[U%16],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,A=65535&S|K<<16,_=65535&m|B<<16,x=A,M=_,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=(k>>>28|F<<4)^(F>>>2|k<<30)^(F>>>7|k<<25),M=(F>>>28|k<<4)^(k>>>2|F<<30)^(k>>>7|F<<25),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=k&L^k&C^L&C,M=F&I^F&j^I&j,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,c=65535&S|K<<16,d=65535&m|B<<16,x=a,M=p,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=A,M=_,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,a=65535&S|K<<16,p=65535&m|B<<16,L=o,C=i,R=h,z=a,P=f,O=s,N=u,k=c,I=y,j=l,G=w,Z=p,V=g,q=v,X=b,F=d,U%16===15)for(E=0;16>E;E++)x=T[E],M=Y[E],m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=T[(E+9)%16],M=Y[(E+9)%16],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,A=T[(E+1)%16],_=Y[(E+1)%16],x=(A>>>1|_<<31)^(A>>>8|_<<24)^A>>>7,M=(_>>>1|A<<31)^(_>>>8|A<<24)^(_>>>7|A<<25),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,A=T[(E+14)%16],_=Y[(E+14)%16],x=(A>>>19|_<<13)^(_>>>29|A<<3)^A>>>6,M=(_>>>19|A<<13)^(A>>>29|_<<3)^(_>>>6|A<<26),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,T[E]=65535&S|K<<16,Y[E]=65535&m|B<<16;x=k,M=F,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[0],M=t[0],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[0]=k=65535&S|K<<16,t[0]=F=65535&m|B<<16,x=L,M=I,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[1],M=t[1],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[1]=L=65535&S|K<<16,t[1]=I=65535&m|B<<16,x=C,M=j,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[2],M=t[2],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[2]=C=65535&S|K<<16,t[2]=j=65535&m|B<<16,x=R,M=G,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[3],M=t[3],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[3]=R=65535&S|K<<16,t[3]=G=65535&m|B<<16,x=z,M=Z,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[4],M=t[4],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[4]=z=65535&S|K<<16,t[4]=Z=65535&m|B<<16,x=P,M=V,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[5],M=t[5],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[5]=P=65535&S|K<<16,t[5]=V=65535&m|B<<16,x=O,M=q,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[6],M=t[6],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[6]=O=65535&S|K<<16,t[6]=q=65535&m|B<<16,x=N,M=X,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[7],M=t[7],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[7]=N=65535&S|K<<16,t[7]=X=65535&m|B<<16,D+=128,e-=128}return e}function P(r,n,e){var o,i=new Int32Array(8),h=new Int32Array(8),a=new Uint8Array(256),f=e;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,h[0]=4089235720,h[1]=2227873595,h[2]=4271175723,h[3]=1595750129,h[4]=2917565137,h[5]=725511199,h[6]=4215389547,h[7]=327033209,z(i,h,n,e),e%=128,o=0;e>o;o++)a[o]=n[f-e+o];for(a[e]=128,e=256-128*(112>e?1:0),a[e-9]=0,t(a,e-8,f/536870912|0,f<<3),z(i,h,a,e),o=0;8>o;o++)t(r,8*o,i[o],h[o]);return 0}function O(r,t){var n=$(),e=$(),o=$(),i=$(),h=$(),a=$(),f=$(),s=$(),u=$();M(n,r[1],r[0]),M(u,t[1],t[0]),m(n,n,u),x(e,r[0],r[1]),x(u,t[0],t[1]),m(e,e,u),m(o,r[3],t[3]),m(o,o,ar),m(i,r[2],t[2]),x(i,i,i),M(h,e,n),M(a,i,o),x(f,i,o),x(s,e,n),m(r[0],h,a),m(r[1],s,f),m(r[2],f,a),m(r[3],h,s)}function N(r,t,n){var e;for(e=0;4>e;e++)d(r[e],t[e],n)}function F(r,t){var n=$(),e=$(),o=$();S(o,t[2]),m(n,t[0],o),m(e,t[1],o),A(r,e),r[31]^=U(n)<<7}function I(r,t,n){var e,o;for(v(r[0],er),v(r[1],or),v(r[2],or),v(r[3],er),o=255;o>=0;--o)e=n[o/8|0]>>(7&o)&1,N(r,t,e),O(t,r),O(r,r),N(r,t,e)}function j(r,t){var n=[$(),$(),$(),$()];v(n[0],fr),v(n[1],sr),v(n[2],or),m(n[3],fr,sr),I(r,n,t)}function G(r,t,n){var e,o=new Uint8Array(64),i=[$(),$(),$(),$()];for(n||rr(t,32),P(o,t,32),o[0]&=248,o[31]&=127,o[31]|=64,j(i,o),F(r,i),e=0;32>e;e++)t[e+32]=r[e];return 0}function Z(r,t){var n,e,o,i;for(e=63;e>=32;--e){for(n=0,o=e-32,i=e-12;i>o;++o)t[o]+=n-16*t[e]*gr[o-(e-32)],n=t[o]+128>>8,t[o]-=256*n;t[o]+=n,t[e]=0}for(n=0,o=0;32>o;o++)t[o]+=n-(t[31]>>4)*gr[o],n=t[o]>>8,t[o]&=255;for(o=0;32>o;o++)t[o]-=n*gr[o];for(e=0;32>e;e++)t[e+1]+=t[e]>>8,r[e]=255&t[e]}function V(r){var t,n=new Float64Array(64);for(t=0;64>t;t++)n[t]=r[t];for(t=0;64>t;t++)r[t]=0;Z(r,n)}function q(r,t,n,e){var o,i,h=new Uint8Array(64),a=new Uint8Array(64),f=new Uint8Array(64),s=new Float64Array(64),u=[$(),$(),$(),$()];P(h,e,32),h[0]&=248,h[31]&=127,h[31]|=64;var c=n+64;for(o=0;n>o;o++)r[64+o]=t[o];for(o=0;32>o;o++)r[32+o]=h[32+o];for(P(f,r.subarray(32),n+32),V(f),j(u,f),F(r,u),o=32;64>o;o++)r[o]=e[o];for(P(a,r,n+64),V(a),o=0;64>o;o++)s[o]=0;for(o=0;32>o;o++)s[o]=f[o];for(o=0;32>o;o++)for(i=0;32>i;i++)s[o+i]+=a[o]*h[i];return Z(r.subarray(32),s),c}function X(r,t){var n=$(),e=$(),o=$(),i=$(),h=$(),a=$(),f=$();return v(r[2],or),E(r[1],t),B(o,r[1]),m(i,o,hr),M(o,o,r[2]),x(i,r[2],i),B(h,i),B(a,h),m(f,a,h),m(n,f,o),m(n,n,i),K(n,n),m(n,n,o),m(n,n,i),m(n,n,i),m(r[0],n,i),B(e,r[0]),m(e,e,i),_(e,o)&&m(r[0],r[0],ur),B(e,r[0]),m(e,e,i),_(e,o)?-1:(U(r[0])===t[31]>>7&&M(r[0],er,r[0]),m(r[3],r[0],r[1]),0)}function D(r,t,n,e){var i,h,a=new Uint8Array(32),f=new Uint8Array(64),s=[$(),$(),$(),$()],u=[$(),$(),$(),$()];if(h=-1,64>n)return-1;if(X(u,e))return-1;for(i=0;n>i;i++)r[i]=t[i];for(i=0;32>i;i++)r[i+32]=e[i];if(P(f,r,n),V(f),I(s,u,f),j(u,t.subarray(32)),O(s,u),F(a,s),n-=64,o(t,0,a,0)){for(i=0;n>i;i++)r[i]=0;return-1}for(i=0;n>i;i++)r[i]=t[i+64];return h=n}function H(r,t){if(r.length!==vr)throw new Error("bad key size");if(t.length!==br)throw new Error("bad nonce size")}function J(r,t){if(r.length!==Er)throw new Error("bad public key size");if(t.length!==xr)throw new Error("bad secret key size")}function Q(){var r,t;for(t=0;t>>13|n<<3),e=255&r[4]|(255&r[5])<<8,this.r[2]=7939&(n>>>10|e<<6),o=255&r[6]|(255&r[7])<<8,this.r[3]=8191&(e>>>7|o<<9),i=255&r[8]|(255&r[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,h=255&r[10]|(255&r[11])<<8,this.r[6]=8191&(i>>>14|h<<2),a=255&r[12]|(255&r[13])<<8,this.r[7]=8065&(h>>>11|a<<5),f=255&r[14]|(255&r[15])<<8,this.r[8]=8191&(a>>>8|f<<8),this.r[9]=f>>>5&127,this.pad[0]=255&r[16]|(255&r[17])<<8,this.pad[1]=255&r[18]|(255&r[19])<<8,this.pad[2]=255&r[20]|(255&r[21])<<8,this.pad[3]=255&r[22]|(255&r[23])<<8,this.pad[4]=255&r[24]|(255&r[25])<<8,this.pad[5]=255&r[26]|(255&r[27])<<8,this.pad[6]=255&r[28]|(255&r[29])<<8,this.pad[7]=255&r[30]|(255&r[31])<<8};yr.prototype.blocks=function(r,t,n){for(var e,o,i,h,a,f,s,u,c,y,l,w,p,g,v,b,d,A,_,U=this.fin?0:2048,E=this.h[0],x=this.h[1],M=this.h[2],m=this.h[3],B=this.h[4],S=this.h[5],K=this.h[6],T=this.h[7],Y=this.h[8],k=this.h[9],L=this.r[0],C=this.r[1],R=this.r[2],z=this.r[3],P=this.r[4],O=this.r[5],N=this.r[6],F=this.r[7],I=this.r[8],j=this.r[9];n>=16;)e=255&r[t+0]|(255&r[t+1])<<8,E+=8191&e,o=255&r[t+2]|(255&r[t+3])<<8,x+=8191&(e>>>13|o<<3),i=255&r[t+4]|(255&r[t+5])<<8,M+=8191&(o>>>10|i<<6),h=255&r[t+6]|(255&r[t+7])<<8,m+=8191&(i>>>7|h<<9),a=255&r[t+8]|(255&r[t+9])<<8,B+=8191&(h>>>4|a<<12),S+=a>>>1&8191,f=255&r[t+10]|(255&r[t+11])<<8,K+=8191&(a>>>14|f<<2),s=255&r[t+12]|(255&r[t+13])<<8,T+=8191&(f>>>11|s<<5),u=255&r[t+14]|(255&r[t+15])<<8,Y+=8191&(s>>>8|u<<8),k+=u>>>5|U,c=0,y=c,y+=E*L,y+=5*x*j,y+=5*M*I,y+=5*m*F,y+=5*B*N,c=y>>>13,y&=8191,y+=5*S*O,y+=5*K*P,y+=5*T*z,y+=5*Y*R,y+=5*k*C,c+=y>>>13,y&=8191,l=c,l+=E*C,l+=x*L,l+=5*M*j,l+=5*m*I,l+=5*B*F,c=l>>>13,l&=8191,l+=5*S*N,l+=5*K*O,l+=5*T*P,l+=5*Y*z,l+=5*k*R,c+=l>>>13,l&=8191,w=c,w+=E*R,w+=x*C,w+=M*L,w+=5*m*j,w+=5*B*I,c=w>>>13,w&=8191,w+=5*S*F,w+=5*K*N,w+=5*T*O,w+=5*Y*P,w+=5*k*z,c+=w>>>13,w&=8191,p=c,p+=E*z,p+=x*R,p+=M*C,p+=m*L,p+=5*B*j,c=p>>>13,p&=8191,p+=5*S*I,p+=5*K*F,p+=5*T*N,p+=5*Y*O,p+=5*k*P,c+=p>>>13,p&=8191,g=c,g+=E*P,g+=x*z,g+=M*R,g+=m*C,g+=B*L,c=g>>>13,g&=8191,g+=5*S*j,g+=5*K*I,g+=5*T*F,g+=5*Y*N,g+=5*k*O,c+=g>>>13,g&=8191,v=c,v+=E*O,v+=x*P,v+=M*z,v+=m*R,v+=B*C,c=v>>>13,v&=8191,v+=S*L,v+=5*K*j,v+=5*T*I,v+=5*Y*F,v+=5*k*N,c+=v>>>13,v&=8191,b=c,b+=E*N,b+=x*O,b+=M*P,b+=m*z,b+=B*R,c=b>>>13,b&=8191,b+=S*C,b+=K*L,b+=5*T*j,b+=5*Y*I,b+=5*k*F,c+=b>>>13,b&=8191,d=c,d+=E*F,d+=x*N,d+=M*O,d+=m*P,d+=B*z,c=d>>>13,d&=8191,d+=S*R,d+=K*C,d+=T*L,d+=5*Y*j,d+=5*k*I,c+=d>>>13,d&=8191,A=c,A+=E*I,A+=x*F,A+=M*N,A+=m*O,A+=B*P,c=A>>>13,A&=8191,A+=S*z,A+=K*R,A+=T*C,A+=Y*L,A+=5*k*j,c+=A>>>13,A&=8191,_=c,_+=E*j,_+=x*I,_+=M*F,_+=m*N,_+=B*O,c=_>>>13,_&=8191,_+=S*P,_+=K*z,_+=T*R,_+=Y*C,_+=k*L,c+=_>>>13,_&=8191,c=(c<<2)+c|0,c=c+y|0,y=8191&c,c>>>=13,l+=c,E=y,x=l,M=w,m=p,B=g,S=v,K=b,T=d,Y=A,k=_,t+=16,n-=16;this.h[0]=E,this.h[1]=x,this.h[2]=M,this.h[3]=m,this.h[4]=B,this.h[5]=S,this.h[6]=K,this.h[7]=T,this.h[8]=Y,this.h[9]=k},yr.prototype.finish=function(r,t){var n,e,o,i,h=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;16>i;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;10>i;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,h[0]=this.h[0]+5,n=h[0]>>>13,h[0]&=8191,i=1;10>i;i++)h[i]=this.h[i]+n,n=h[i]>>>13,h[i]&=8191;for(h[9]-=8192,e=(h[9]>>>15)-1,i=0;10>i;i++)h[i]&=e;for(e=~e,i=0;10>i;i++)this.h[i]=this.h[i]&e|h[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;8>i;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;r[t+0]=this.h[0]>>>0&255,r[t+1]=this.h[0]>>>8&255,r[t+2]=this.h[1]>>>0&255,r[t+3]=this.h[1]>>>8&255,r[t+4]=this.h[2]>>>0&255,r[t+5]=this.h[2]>>>8&255,r[t+6]=this.h[3]>>>0&255,r[t+7]=this.h[3]>>>8&255,r[t+8]=this.h[4]>>>0&255,r[t+9]=this.h[4]>>>8&255,r[t+10]=this.h[5]>>>0&255,r[t+11]=this.h[5]>>>8&255,r[t+12]=this.h[6]>>>0&255,r[t+13]=this.h[6]>>>8&255,r[t+14]=this.h[7]>>>0&255,r[t+15]=this.h[7]>>>8&255},yr.prototype.update=function(r,t,n){var e,o;if(this.leftover){for(o=16-this.leftover,o>n&&(o=n),e=0;o>e;e++)this.buffer[this.leftover+e]=r[t+e];if(n-=o,t+=o,this.leftover+=o,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(o=n-n%16,this.blocks(r,t,o),t+=o,n-=o),n){for(e=0;n>e;e++)this.buffer[this.leftover+e]=r[t+e];this.leftover+=n}};var lr=p,wr=g,pr=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],gr=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),vr=32,br=24,dr=32,Ar=16,_r=32,Ur=32,Er=32,xr=32,Mr=32,mr=br,Br=dr,Sr=Ar,Kr=64,Tr=32,Yr=64,kr=32,Lr=64;r.lowlevel={crypto_core_hsalsa20:f,crypto_stream_xor:y,crypto_stream:c,crypto_stream_salsa20_xor:s,crypto_stream_salsa20:u,crypto_onetimeauth:l,crypto_onetimeauth_verify:w,crypto_verify_16:e,crypto_verify_32:o,crypto_secretbox:p,crypto_secretbox_open:g,crypto_scalarmult:T,crypto_scalarmult_base:Y,crypto_box_beforenm:L,crypto_box_afternm:lr,crypto_box:C,crypto_box_open:R,crypto_box_keypair:k,crypto_hash:P,crypto_sign:q,crypto_sign_keypair:G,crypto_sign_open:D,crypto_secretbox_KEYBYTES:vr,crypto_secretbox_NONCEBYTES:br,crypto_secretbox_ZEROBYTES:dr,crypto_secretbox_BOXZEROBYTES:Ar,crypto_scalarmult_BYTES:_r,crypto_scalarmult_SCALARBYTES:Ur,crypto_box_PUBLICKEYBYTES:Er,crypto_box_SECRETKEYBYTES:xr,crypto_box_BEFORENMBYTES:Mr,crypto_box_NONCEBYTES:mr,crypto_box_ZEROBYTES:Br,crypto_box_BOXZEROBYTES:Sr,crypto_sign_BYTES:Kr,crypto_sign_PUBLICKEYBYTES:Tr,crypto_sign_SECRETKEYBYTES:Yr,crypto_sign_SEEDBYTES:kr,crypto_hash_BYTES:Lr},r.util={},r.util.decodeUTF8=function(r){var t,n=unescape(encodeURIComponent(r)),e=new Uint8Array(n.length);for(t=0;tt;t++)n.push(String.fromCharCode(r[t]));return btoa(n.join(""))},r.util.decodeBase64=function(r){if("undefined"==typeof atob)return new Uint8Array(Array.prototype.slice.call(new Buffer(r,"base64"),0));var t,n=atob(r),e=new Uint8Array(n.length);for(t=0;te)return null;for(var o=new Uint8Array(e),i=0;ie;e++)o[e]=t[e];for(e=0;e=0},r.sign.keyPair=function(){var r=new Uint8Array(Tr),t=new Uint8Array(Yr);return G(r,t),{publicKey:r,secretKey:t}},r.sign.keyPair.fromSecretKey=function(r){if(Q(r),r.length!==Yr)throw new Error("bad secret key size");for(var t=new Uint8Array(Tr),n=0;ne;e++)n[e]=r[e];return G(t,n,!0),{publicKey:t,secretKey:n}},r.sign.publicKeyLength=Tr,r.sign.secretKeyLength=Yr,r.sign.seedLength=kr,r.sign.signatureLength=Kr,r.hash=function(r){Q(r);var t=new Uint8Array(Lr);return P(t,r,r.length),t},r.hash.hashLength=Lr,r.verify=function(r,t){return Q(r,t),0===r.length||0===t.length?!1:r.length!==t.length?!1:0===n(r,0,t,0,r.length)?!0:!1},r.setPRNG=function(r){rr=r},function(){var t;"undefined"!=typeof window?(window.crypto&&window.crypto.getRandomValues?t=window.crypto:window.msCrypto&&window.msCrypto.getRandomValues&&(t=window.msCrypto),t&&r.setPRNG(function(r,n){var e,o=new Uint8Array(n);for(t.getRandomValues(o),e=0;n>e;e++)r[e]=o[e];W(o)})):"undefined"!=typeof require&&(t=require("crypto"),t&&r.setPRNG(function(r,n){var e,o=t.randomBytes(n);for(e=0;n>e;e++)r[e]=o[e];W(o)}))}()}("undefined"!=typeof module&&module.exports?module.exports:window.nacl=window.nacl||{}); \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.js new file mode 100644 index 00000000000000..b8edbbee692cdf --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.js @@ -0,0 +1,1205 @@ +(function(nacl) { +'use strict'; + +// Ported in 2014 by Dmitry Chestnykh and Devi Mandiri. +// Public domain. +// +// Implementation derived from TweetNaCl version 20140427. +// See for details: http://tweetnacl.cr.yp.to/ + +var u64 = function(h, l) { this.hi = h|0 >>> 0; this.lo = l|0 >>> 0; }; +var gf = function(init) { + var i, r = new Float64Array(16); + if (init) for (i = 0; i < init.length; i++) r[i] = init[i]; + return r; +}; + +// Pluggable, initialized in high-level API below. +var randombytes = function(/* x, n */) { throw new Error('no PRNG'); }; + +var _0 = new Uint8Array(16); +var _9 = new Uint8Array(32); _9[0] = 9; + +var gf0 = gf(), + gf1 = gf([1]), + _121665 = gf([0xdb41, 1]), + D = gf([0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]), + D2 = gf([0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]), + X = gf([0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]), + Y = gf([0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]), + I = gf([0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]); + +function L32(x, c) { return (x << c) | (x >>> (32 - c)); } + +function ld32(x, i) { + var u = x[i+3] & 0xff; + u = (u<<8)|(x[i+2] & 0xff); + u = (u<<8)|(x[i+1] & 0xff); + return (u<<8)|(x[i+0] & 0xff); +} + +function dl64(x, i) { + var h = (x[i] << 24) | (x[i+1] << 16) | (x[i+2] << 8) | x[i+3]; + var l = (x[i+4] << 24) | (x[i+5] << 16) | (x[i+6] << 8) | x[i+7]; + return new u64(h, l); +} + +function st32(x, j, u) { + var i; + for (i = 0; i < 4; i++) { x[j+i] = u & 255; u >>>= 8; } +} + +function ts64(x, i, u) { + x[i] = (u.hi >> 24) & 0xff; + x[i+1] = (u.hi >> 16) & 0xff; + x[i+2] = (u.hi >> 8) & 0xff; + x[i+3] = u.hi & 0xff; + x[i+4] = (u.lo >> 24) & 0xff; + x[i+5] = (u.lo >> 16) & 0xff; + x[i+6] = (u.lo >> 8) & 0xff; + x[i+7] = u.lo & 0xff; +} + +function vn(x, xi, y, yi, n) { + var i,d = 0; + for (i = 0; i < n; i++) d |= x[xi+i]^y[yi+i]; + return (1 & ((d - 1) >>> 8)) - 1; +} + +function crypto_verify_16(x, xi, y, yi) { + return vn(x,xi,y,yi,16); +} + +function crypto_verify_32(x, xi, y, yi) { + return vn(x,xi,y,yi,32); +} + +function core(out,inp,k,c,h) { + var w = new Uint32Array(16), x = new Uint32Array(16), + y = new Uint32Array(16), t = new Uint32Array(4); + var i, j, m; + + for (i = 0; i < 4; i++) { + x[5*i] = ld32(c, 4*i); + x[1+i] = ld32(k, 4*i); + x[6+i] = ld32(inp, 4*i); + x[11+i] = ld32(k, 16+4*i); + } + + for (i = 0; i < 16; i++) y[i] = x[i]; + + for (i = 0; i < 20; i++) { + for (j = 0; j < 4; j++) { + for (m = 0; m < 4; m++) t[m] = x[(5*j+4*m)%16]; + t[1] ^= L32((t[0]+t[3])|0, 7); + t[2] ^= L32((t[1]+t[0])|0, 9); + t[3] ^= L32((t[2]+t[1])|0,13); + t[0] ^= L32((t[3]+t[2])|0,18); + for (m = 0; m < 4; m++) w[4*j+(j+m)%4] = t[m]; + } + for (m = 0; m < 16; m++) x[m] = w[m]; + } + + if (h) { + for (i = 0; i < 16; i++) x[i] = (x[i] + y[i]) | 0; + for (i = 0; i < 4; i++) { + x[5*i] = (x[5*i] - ld32(c, 4*i)) | 0; + x[6+i] = (x[6+i] - ld32(inp, 4*i)) | 0; + } + for (i = 0; i < 4; i++) { + st32(out,4*i,x[5*i]); + st32(out,16+4*i,x[6+i]); + } + } else { + for (i = 0; i < 16; i++) st32(out, 4 * i, (x[i] + y[i]) | 0); + } +} + +function crypto_core_salsa20(out,inp,k,c) { + core(out,inp,k,c,false); + return 0; +} + +function crypto_core_hsalsa20(out,inp,k,c) { + core(out,inp,k,c,true); + return 0; +} + +var sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]); + // "expand 32-byte k" + +function crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k) { + var z = new Uint8Array(16), x = new Uint8Array(64); + var u, i; + if (!b) return 0; + for (i = 0; i < 16; i++) z[i] = 0; + for (i = 0; i < 8; i++) z[i] = n[i]; + while (b >= 64) { + crypto_core_salsa20(x,z,k,sigma); + for (i = 0; i < 64; i++) c[cpos+i] = (m?m[mpos+i]:0) ^ x[i]; + u = 1; + for (i = 8; i < 16; i++) { + u = u + (z[i] & 0xff) | 0; + z[i] = u & 0xff; + u >>>= 8; + } + b -= 64; + cpos += 64; + if (m) mpos += 64; + } + if (b > 0) { + crypto_core_salsa20(x,z,k,sigma); + for (i = 0; i < b; i++) c[cpos+i] = (m?m[mpos+i]:0) ^ x[i]; + } + return 0; +} + +function crypto_stream_salsa20(c,cpos,d,n,k) { + return crypto_stream_salsa20_xor(c,cpos,null,0,d,n,k); +} + +function crypto_stream(c,cpos,d,n,k) { + var s = new Uint8Array(32); + crypto_core_hsalsa20(s,n,k,sigma); + return crypto_stream_salsa20(c,cpos,d,n.subarray(16),s); +} + +function crypto_stream_xor(c,cpos,m,mpos,d,n,k) { + var s = new Uint8Array(32); + crypto_core_hsalsa20(s,n,k,sigma); + return crypto_stream_salsa20_xor(c,cpos,m,mpos,d,n.subarray(16),s); +} + +function add1305(h, c) { + var j, u = 0; + for (j = 0; j < 17; j++) { + u = (u + ((h[j] + c[j]) | 0)) | 0; + h[j] = u & 255; + u >>>= 8; + } +} + +var minusp = new Uint32Array([ + 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 252 +]); + +function crypto_onetimeauth(out, outpos, m, mpos, n, k) { + var s, i, j, u; + var x = new Uint32Array(17), r = new Uint32Array(17), + h = new Uint32Array(17), c = new Uint32Array(17), + g = new Uint32Array(17); + for (j = 0; j < 17; j++) r[j]=h[j]=0; + for (j = 0; j < 16; j++) r[j]=k[j]; + r[3]&=15; + r[4]&=252; + r[7]&=15; + r[8]&=252; + r[11]&=15; + r[12]&=252; + r[15]&=15; + + while (n > 0) { + for (j = 0; j < 17; j++) c[j] = 0; + for (j = 0; (j < 16) && (j < n); ++j) c[j] = m[mpos+j]; + c[j] = 1; + mpos += j; n -= j; + add1305(h,c); + for (i = 0; i < 17; i++) { + x[i] = 0; + for (j = 0; j < 17; j++) x[i] = (x[i] + (h[j] * ((j <= i) ? r[i - j] : ((320 * r[i + 17 - j])|0))) | 0) | 0; + } + for (i = 0; i < 17; i++) h[i] = x[i]; + u = 0; + for (j = 0; j < 16; j++) { + u = (u + h[j]) | 0; + h[j] = u & 255; + u >>>= 8; + } + u = (u + h[16]) | 0; h[16] = u & 3; + u = (5 * (u >>> 2)) | 0; + for (j = 0; j < 16; j++) { + u = (u + h[j]) | 0; + h[j] = u & 255; + u >>>= 8; + } + u = (u + h[16]) | 0; h[16] = u; + } + + for (j = 0; j < 17; j++) g[j] = h[j]; + add1305(h,minusp); + s = (-(h[16] >>> 7) | 0); + for (j = 0; j < 17; j++) h[j] ^= s & (g[j] ^ h[j]); + + for (j = 0; j < 16; j++) c[j] = k[j + 16]; + c[16] = 0; + add1305(h,c); + for (j = 0; j < 16; j++) out[outpos+j] = h[j]; + return 0; +} + +function crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) { + var x = new Uint8Array(16); + crypto_onetimeauth(x,0,m,mpos,n,k); + return crypto_verify_16(h,hpos,x,0); +} + +function crypto_secretbox(c,m,d,n,k) { + var i; + if (d < 32) return -1; + crypto_stream_xor(c,0,m,0,d,n,k); + crypto_onetimeauth(c, 16, c, 32, d - 32, c); + for (i = 0; i < 16; i++) c[i] = 0; + return 0; +} + +function crypto_secretbox_open(m,c,d,n,k) { + var i; + var x = new Uint8Array(32); + if (d < 32) return -1; + crypto_stream(x,0,32,n,k); + if (crypto_onetimeauth_verify(c, 16,c, 32,d - 32,x) !== 0) return -1; + crypto_stream_xor(m,0,c,0,d,n,k); + for (i = 0; i < 32; i++) m[i] = 0; + return 0; +} + +function set25519(r, a) { + var i; + for (i = 0; i < 16; i++) r[i] = a[i]|0; +} + +function car25519(o) { + var c; + var i; + for (i = 0; i < 16; i++) { + o[i] += 65536; + c = Math.floor(o[i] / 65536); + o[(i+1)*(i<15?1:0)] += c - 1 + 37 * (c-1) * (i===15?1:0); + o[i] -= (c * 65536); + } +} + +function sel25519(p, q, b) { + var t, c = ~(b-1); + for (var i = 0; i < 16; i++) { + t = c & (p[i] ^ q[i]); + p[i] ^= t; + q[i] ^= t; + } +} + +function pack25519(o, n) { + var i, j, b; + var m = gf(), t = gf(); + for (i = 0; i < 16; i++) t[i] = n[i]; + car25519(t); + car25519(t); + car25519(t); + for (j = 0; j < 2; j++) { + m[0] = t[0] - 0xffed; + for (i = 1; i < 15; i++) { + m[i] = t[i] - 0xffff - ((m[i-1]>>16) & 1); + m[i-1] &= 0xffff; + } + m[15] = t[15] - 0x7fff - ((m[14]>>16) & 1); + b = (m[15]>>16) & 1; + m[14] &= 0xffff; + sel25519(t, m, 1-b); + } + for (i = 0; i < 16; i++) { + o[2*i] = t[i] & 0xff; + o[2*i+1] = t[i]>>8; + } +} + +function neq25519(a, b) { + var c = new Uint8Array(32), d = new Uint8Array(32); + pack25519(c, a); + pack25519(d, b); + return crypto_verify_32(c, 0, d, 0); +} + +function par25519(a) { + var d = new Uint8Array(32); + pack25519(d, a); + return d[0] & 1; +} + +function unpack25519(o, n) { + var i; + for (i = 0; i < 16; i++) o[i] = n[2*i] + (n[2*i+1] << 8); + o[15] &= 0x7fff; +} + +function A(o, a, b) { + var i; + for (i = 0; i < 16; i++) o[i] = (a[i] + b[i])|0; +} + +function Z(o, a, b) { + var i; + for (i = 0; i < 16; i++) o[i] = (a[i] - b[i])|0; +} + +function M(o, a, b) { + var i, j, t = new Float64Array(31); + for (i = 0; i < 31; i++) t[i] = 0; + for (i = 0; i < 16; i++) { + for (j = 0; j < 16; j++) { + t[i+j] += a[i] * b[j]; + } + } + for (i = 0; i < 15; i++) { + t[i] += 38 * t[i+16]; + } + for (i = 0; i < 16; i++) o[i] = t[i]; + car25519(o); + car25519(o); +} + +function S(o, a) { + M(o, a, a); +} + +function inv25519(o, i) { + var c = gf(); + var a; + for (a = 0; a < 16; a++) c[a] = i[a]; + for (a = 253; a >= 0; a--) { + S(c, c); + if(a !== 2 && a !== 4) M(c, c, i); + } + for (a = 0; a < 16; a++) o[a] = c[a]; +} + +function pow2523(o, i) { + var c = gf(); + var a; + for (a = 0; a < 16; a++) c[a] = i[a]; + for (a = 250; a >= 0; a--) { + S(c, c); + if(a !== 1) M(c, c, i); + } + for (a = 0; a < 16; a++) o[a] = c[a]; +} + +function crypto_scalarmult(q, n, p) { + var z = new Uint8Array(32); + var x = new Float64Array(80), r, i; + var a = gf(), b = gf(), c = gf(), + d = gf(), e = gf(), f = gf(); + for (i = 0; i < 31; i++) z[i] = n[i]; + z[31]=(n[31]&127)|64; + z[0]&=248; + unpack25519(x,p); + for (i = 0; i < 16; i++) { + b[i]=x[i]; + d[i]=a[i]=c[i]=0; + } + a[0]=d[0]=1; + for (i=254; i>=0; --i) { + r=(z[i>>>3]>>>(i&7))&1; + sel25519(a,b,r); + sel25519(c,d,r); + A(e,a,c); + Z(a,a,c); + A(c,b,d); + Z(b,b,d); + S(d,e); + S(f,a); + M(a,c,a); + M(c,b,e); + A(e,a,c); + Z(a,a,c); + S(b,a); + Z(c,d,f); + M(a,c,_121665); + A(a,a,d); + M(c,c,a); + M(a,d,f); + M(d,b,x); + S(b,e); + sel25519(a,b,r); + sel25519(c,d,r); + } + for (i = 0; i < 16; i++) { + x[i+16]=a[i]; + x[i+32]=c[i]; + x[i+48]=b[i]; + x[i+64]=d[i]; + } + var x32 = x.subarray(32); + var x16 = x.subarray(16); + inv25519(x32,x32); + M(x16,x16,x32); + pack25519(q,x16); + return 0; +} + +function crypto_scalarmult_base(q, n) { + return crypto_scalarmult(q, n, _9); +} + +function crypto_box_keypair(y, x) { + randombytes(x, 32); + return crypto_scalarmult_base(y, x); +} + +function crypto_box_beforenm(k, y, x) { + var s = new Uint8Array(32); + crypto_scalarmult(s, x, y); + return crypto_core_hsalsa20(k, _0, s, sigma); +} + +var crypto_box_afternm = crypto_secretbox; +var crypto_box_open_afternm = crypto_secretbox_open; + +function crypto_box(c, m, d, n, y, x) { + var k = new Uint8Array(32); + crypto_box_beforenm(k, y, x); + return crypto_box_afternm(c, m, d, n, k); +} + +function crypto_box_open(m, c, d, n, y, x) { + var k = new Uint8Array(32); + crypto_box_beforenm(k, y, x); + return crypto_box_open_afternm(m, c, d, n, k); +} + +function add64() { + var a = 0, b = 0, c = 0, d = 0, m16 = 65535, l, h, i; + for (i = 0; i < arguments.length; i++) { + l = arguments[i].lo; + h = arguments[i].hi; + a += (l & m16); b += (l >>> 16); + c += (h & m16); d += (h >>> 16); + } + + b += (a >>> 16); + c += (b >>> 16); + d += (c >>> 16); + + return new u64((c & m16) | (d << 16), (a & m16) | (b << 16)); +} + +function shr64(x, c) { + return new u64((x.hi >>> c), (x.lo >>> c) | (x.hi << (32 - c))); +} + +function xor64() { + var l = 0, h = 0, i; + for (i = 0; i < arguments.length; i++) { + l ^= arguments[i].lo; + h ^= arguments[i].hi; + } + return new u64(h, l); +} + +function R(x, c) { + var h, l, c1 = 32 - c; + if (c < 32) { + h = (x.hi >>> c) | (x.lo << c1); + l = (x.lo >>> c) | (x.hi << c1); + } else if (c < 64) { + h = (x.lo >>> c) | (x.hi << c1); + l = (x.hi >>> c) | (x.lo << c1); + } + return new u64(h, l); +} + +function Ch(x, y, z) { + var h = (x.hi & y.hi) ^ (~x.hi & z.hi), + l = (x.lo & y.lo) ^ (~x.lo & z.lo); + return new u64(h, l); +} + +function Maj(x, y, z) { + var h = (x.hi & y.hi) ^ (x.hi & z.hi) ^ (y.hi & z.hi), + l = (x.lo & y.lo) ^ (x.lo & z.lo) ^ (y.lo & z.lo); + return new u64(h, l); +} + +function Sigma0(x) { return xor64(R(x,28), R(x,34), R(x,39)); } +function Sigma1(x) { return xor64(R(x,14), R(x,18), R(x,41)); } +function sigma0(x) { return xor64(R(x, 1), R(x, 8), shr64(x,7)); } +function sigma1(x) { return xor64(R(x,19), R(x,61), shr64(x,6)); } + +var K = [ + new u64(0x428a2f98, 0xd728ae22), new u64(0x71374491, 0x23ef65cd), + new u64(0xb5c0fbcf, 0xec4d3b2f), new u64(0xe9b5dba5, 0x8189dbbc), + new u64(0x3956c25b, 0xf348b538), new u64(0x59f111f1, 0xb605d019), + new u64(0x923f82a4, 0xaf194f9b), new u64(0xab1c5ed5, 0xda6d8118), + new u64(0xd807aa98, 0xa3030242), new u64(0x12835b01, 0x45706fbe), + new u64(0x243185be, 0x4ee4b28c), new u64(0x550c7dc3, 0xd5ffb4e2), + new u64(0x72be5d74, 0xf27b896f), new u64(0x80deb1fe, 0x3b1696b1), + new u64(0x9bdc06a7, 0x25c71235), new u64(0xc19bf174, 0xcf692694), + new u64(0xe49b69c1, 0x9ef14ad2), new u64(0xefbe4786, 0x384f25e3), + new u64(0x0fc19dc6, 0x8b8cd5b5), new u64(0x240ca1cc, 0x77ac9c65), + new u64(0x2de92c6f, 0x592b0275), new u64(0x4a7484aa, 0x6ea6e483), + new u64(0x5cb0a9dc, 0xbd41fbd4), new u64(0x76f988da, 0x831153b5), + new u64(0x983e5152, 0xee66dfab), new u64(0xa831c66d, 0x2db43210), + new u64(0xb00327c8, 0x98fb213f), new u64(0xbf597fc7, 0xbeef0ee4), + new u64(0xc6e00bf3, 0x3da88fc2), new u64(0xd5a79147, 0x930aa725), + new u64(0x06ca6351, 0xe003826f), new u64(0x14292967, 0x0a0e6e70), + new u64(0x27b70a85, 0x46d22ffc), new u64(0x2e1b2138, 0x5c26c926), + new u64(0x4d2c6dfc, 0x5ac42aed), new u64(0x53380d13, 0x9d95b3df), + new u64(0x650a7354, 0x8baf63de), new u64(0x766a0abb, 0x3c77b2a8), + new u64(0x81c2c92e, 0x47edaee6), new u64(0x92722c85, 0x1482353b), + new u64(0xa2bfe8a1, 0x4cf10364), new u64(0xa81a664b, 0xbc423001), + new u64(0xc24b8b70, 0xd0f89791), new u64(0xc76c51a3, 0x0654be30), + new u64(0xd192e819, 0xd6ef5218), new u64(0xd6990624, 0x5565a910), + new u64(0xf40e3585, 0x5771202a), new u64(0x106aa070, 0x32bbd1b8), + new u64(0x19a4c116, 0xb8d2d0c8), new u64(0x1e376c08, 0x5141ab53), + new u64(0x2748774c, 0xdf8eeb99), new u64(0x34b0bcb5, 0xe19b48a8), + new u64(0x391c0cb3, 0xc5c95a63), new u64(0x4ed8aa4a, 0xe3418acb), + new u64(0x5b9cca4f, 0x7763e373), new u64(0x682e6ff3, 0xd6b2b8a3), + new u64(0x748f82ee, 0x5defb2fc), new u64(0x78a5636f, 0x43172f60), + new u64(0x84c87814, 0xa1f0ab72), new u64(0x8cc70208, 0x1a6439ec), + new u64(0x90befffa, 0x23631e28), new u64(0xa4506ceb, 0xde82bde9), + new u64(0xbef9a3f7, 0xb2c67915), new u64(0xc67178f2, 0xe372532b), + new u64(0xca273ece, 0xea26619c), new u64(0xd186b8c7, 0x21c0c207), + new u64(0xeada7dd6, 0xcde0eb1e), new u64(0xf57d4f7f, 0xee6ed178), + new u64(0x06f067aa, 0x72176fba), new u64(0x0a637dc5, 0xa2c898a6), + new u64(0x113f9804, 0xbef90dae), new u64(0x1b710b35, 0x131c471b), + new u64(0x28db77f5, 0x23047d84), new u64(0x32caab7b, 0x40c72493), + new u64(0x3c9ebe0a, 0x15c9bebc), new u64(0x431d67c4, 0x9c100d4c), + new u64(0x4cc5d4be, 0xcb3e42b6), new u64(0x597f299c, 0xfc657e2a), + new u64(0x5fcb6fab, 0x3ad6faec), new u64(0x6c44198c, 0x4a475817) +]; + +function crypto_hashblocks(x, m, n) { + var z = [], b = [], a = [], w = [], t, i, j; + + for (i = 0; i < 8; i++) z[i] = a[i] = dl64(x, 8*i); + + var pos = 0; + while (n >= 128) { + for (i = 0; i < 16; i++) w[i] = dl64(m, 8*i+pos); + for (i = 0; i < 80; i++) { + for (j = 0; j < 8; j++) b[j] = a[j]; + t = add64(a[7], Sigma1(a[4]), Ch(a[4], a[5], a[6]), K[i], w[i%16]); + b[7] = add64(t, Sigma0(a[0]), Maj(a[0], a[1], a[2])); + b[3] = add64(b[3], t); + for (j = 0; j < 8; j++) a[(j+1)%8] = b[j]; + if (i%16 === 15) { + for (j = 0; j < 16; j++) { + w[j] = add64(w[j], w[(j+9)%16], sigma0(w[(j+1)%16]), sigma1(w[(j+14)%16])); + } + } + } + + for (i = 0; i < 8; i++) { + a[i] = add64(a[i], z[i]); + z[i] = a[i]; + } + + pos += 128; + n -= 128; + } + + for (i = 0; i < 8; i++) ts64(x, 8*i, z[i]); + return n; +} + +var iv = new Uint8Array([ + 0x6a,0x09,0xe6,0x67,0xf3,0xbc,0xc9,0x08, + 0xbb,0x67,0xae,0x85,0x84,0xca,0xa7,0x3b, + 0x3c,0x6e,0xf3,0x72,0xfe,0x94,0xf8,0x2b, + 0xa5,0x4f,0xf5,0x3a,0x5f,0x1d,0x36,0xf1, + 0x51,0x0e,0x52,0x7f,0xad,0xe6,0x82,0xd1, + 0x9b,0x05,0x68,0x8c,0x2b,0x3e,0x6c,0x1f, + 0x1f,0x83,0xd9,0xab,0xfb,0x41,0xbd,0x6b, + 0x5b,0xe0,0xcd,0x19,0x13,0x7e,0x21,0x79 +]); + +function crypto_hash(out, m, n) { + var h = new Uint8Array(64), x = new Uint8Array(256); + var i, b = n; + + for (i = 0; i < 64; i++) h[i] = iv[i]; + + crypto_hashblocks(h, m, n); + n %= 128; + + for (i = 0; i < 256; i++) x[i] = 0; + for (i = 0; i < n; i++) x[i] = m[b-n+i]; + x[n] = 128; + + n = 256-128*(n<112?1:0); + x[n-9] = 0; + ts64(x, n-8, new u64((b / 0x20000000) | 0, b << 3)); + crypto_hashblocks(h, x, n); + + for (i = 0; i < 64; i++) out[i] = h[i]; + + return 0; +} + +function add(p, q) { + var a = gf(), b = gf(), c = gf(), + d = gf(), e = gf(), f = gf(), + g = gf(), h = gf(), t = gf(); + + Z(a, p[1], p[0]); + Z(t, q[1], q[0]); + M(a, a, t); + A(b, p[0], p[1]); + A(t, q[0], q[1]); + M(b, b, t); + M(c, p[3], q[3]); + M(c, c, D2); + M(d, p[2], q[2]); + A(d, d, d); + Z(e, b, a); + Z(f, d, c); + A(g, d, c); + A(h, b, a); + + M(p[0], e, f); + M(p[1], h, g); + M(p[2], g, f); + M(p[3], e, h); +} + +function cswap(p, q, b) { + var i; + for (i = 0; i < 4; i++) { + sel25519(p[i], q[i], b); + } +} + +function pack(r, p) { + var tx = gf(), ty = gf(), zi = gf(); + inv25519(zi, p[2]); + M(tx, p[0], zi); + M(ty, p[1], zi); + pack25519(r, ty); + r[31] ^= par25519(tx) << 7; +} + +function scalarmult(p, q, s) { + var b, i; + set25519(p[0], gf0); + set25519(p[1], gf1); + set25519(p[2], gf1); + set25519(p[3], gf0); + for (i = 255; i >= 0; --i) { + b = (s[(i/8)|0] >> (i&7)) & 1; + cswap(p, q, b); + add(q, p); + add(p, p); + cswap(p, q, b); + } +} + +function scalarbase(p, s) { + var q = [gf(), gf(), gf(), gf()]; + set25519(q[0], X); + set25519(q[1], Y); + set25519(q[2], gf1); + M(q[3], X, Y); + scalarmult(p, q, s); +} + +function crypto_sign_keypair(pk, sk, seeded) { + var d = new Uint8Array(64); + var p = [gf(), gf(), gf(), gf()]; + var i; + + if (!seeded) randombytes(sk, 32); + crypto_hash(d, sk, 32); + d[0] &= 248; + d[31] &= 127; + d[31] |= 64; + + scalarbase(p, d); + pack(pk, p); + + for (i = 0; i < 32; i++) sk[i+32] = pk[i]; + return 0; +} + +var L = new Float64Array([0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10]); + +function modL(r, x) { + var carry, i, j, k; + for (i = 63; i >= 32; --i) { + carry = 0; + for (j = i - 32, k = i - 12; j < k; ++j) { + x[j] += carry - 16 * x[i] * L[j - (i - 32)]; + carry = (x[j] + 128) >> 8; + x[j] -= carry * 256; + } + x[j] += carry; + x[i] = 0; + } + carry = 0; + for (j = 0; j < 32; j++) { + x[j] += carry - (x[31] >> 4) * L[j]; + carry = x[j] >> 8; + x[j] &= 255; + } + for (j = 0; j < 32; j++) x[j] -= carry * L[j]; + for (i = 0; i < 32; i++) { + x[i+1] += x[i] >> 8; + r[i] = x[i] & 255; + } +} + +function reduce(r) { + var x = new Float64Array(64), i; + for (i = 0; i < 64; i++) x[i] = r[i]; + for (i = 0; i < 64; i++) r[i] = 0; + modL(r, x); +} + +// Note: difference from C - smlen returned, not passed as argument. +function crypto_sign(sm, m, n, sk) { + var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64); + var i, j, x = new Float64Array(64); + var p = [gf(), gf(), gf(), gf()]; + + crypto_hash(d, sk, 32); + d[0] &= 248; + d[31] &= 127; + d[31] |= 64; + + var smlen = n + 64; + for (i = 0; i < n; i++) sm[64 + i] = m[i]; + for (i = 0; i < 32; i++) sm[32 + i] = d[32 + i]; + + crypto_hash(r, sm.subarray(32), n+32); + reduce(r); + scalarbase(p, r); + pack(sm, p); + + for (i = 32; i < 64; i++) sm[i] = sk[i]; + crypto_hash(h, sm, n + 64); + reduce(h); + + for (i = 0; i < 64; i++) x[i] = 0; + for (i = 0; i < 32; i++) x[i] = r[i]; + for (i = 0; i < 32; i++) { + for (j = 0; j < 32; j++) { + x[i+j] += h[i] * d[j]; + } + } + + modL(sm.subarray(32), x); + return smlen; +} + +function unpackneg(r, p) { + var t = gf(), chk = gf(), num = gf(), + den = gf(), den2 = gf(), den4 = gf(), + den6 = gf(); + + set25519(r[2], gf1); + unpack25519(r[1], p); + S(num, r[1]); + M(den, num, D); + Z(num, num, r[2]); + A(den, r[2], den); + + S(den2, den); + S(den4, den2); + M(den6, den4, den2); + M(t, den6, num); + M(t, t, den); + + pow2523(t, t); + M(t, t, num); + M(t, t, den); + M(t, t, den); + M(r[0], t, den); + + S(chk, r[0]); + M(chk, chk, den); + if (neq25519(chk, num)) M(r[0], r[0], I); + + S(chk, r[0]); + M(chk, chk, den); + if (neq25519(chk, num)) return -1; + + if (par25519(r[0]) === (p[31]>>7)) Z(r[0], gf0, r[0]); + + M(r[3], r[0], r[1]); + return 0; +} + +function crypto_sign_open(m, sm, n, pk) { + var i, mlen; + var t = new Uint8Array(32), h = new Uint8Array(64); + var p = [gf(), gf(), gf(), gf()], + q = [gf(), gf(), gf(), gf()]; + + mlen = -1; + if (n < 64) return -1; + + if (unpackneg(q, pk)) return -1; + + for (i = 0; i < n; i++) m[i] = sm[i]; + for (i = 0; i < 32; i++) m[i+32] = pk[i]; + crypto_hash(h, m, n); + reduce(h); + scalarmult(p, q, h); + + scalarbase(q, sm.subarray(32)); + add(p, q); + pack(t, p); + + n -= 64; + if (crypto_verify_32(sm, 0, t, 0)) { + for (i = 0; i < n; i++) m[i] = 0; + return -1; + } + + for (i = 0; i < n; i++) m[i] = sm[i + 64]; + mlen = n; + return mlen; +} + +var crypto_secretbox_KEYBYTES = 32, + crypto_secretbox_NONCEBYTES = 24, + crypto_secretbox_ZEROBYTES = 32, + crypto_secretbox_BOXZEROBYTES = 16, + crypto_scalarmult_BYTES = 32, + crypto_scalarmult_SCALARBYTES = 32, + crypto_box_PUBLICKEYBYTES = 32, + crypto_box_SECRETKEYBYTES = 32, + crypto_box_BEFORENMBYTES = 32, + crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES, + crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES, + crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES, + crypto_sign_BYTES = 64, + crypto_sign_PUBLICKEYBYTES = 32, + crypto_sign_SECRETKEYBYTES = 64, + crypto_sign_SEEDBYTES = 32, + crypto_hash_BYTES = 64; + +nacl.lowlevel = { + crypto_core_hsalsa20: crypto_core_hsalsa20, + crypto_stream_xor: crypto_stream_xor, + crypto_stream: crypto_stream, + crypto_stream_salsa20_xor: crypto_stream_salsa20_xor, + crypto_stream_salsa20: crypto_stream_salsa20, + crypto_onetimeauth: crypto_onetimeauth, + crypto_onetimeauth_verify: crypto_onetimeauth_verify, + crypto_verify_16: crypto_verify_16, + crypto_verify_32: crypto_verify_32, + crypto_secretbox: crypto_secretbox, + crypto_secretbox_open: crypto_secretbox_open, + crypto_scalarmult: crypto_scalarmult, + crypto_scalarmult_base: crypto_scalarmult_base, + crypto_box_beforenm: crypto_box_beforenm, + crypto_box_afternm: crypto_box_afternm, + crypto_box: crypto_box, + crypto_box_open: crypto_box_open, + crypto_box_keypair: crypto_box_keypair, + crypto_hash: crypto_hash, + crypto_sign: crypto_sign, + crypto_sign_keypair: crypto_sign_keypair, + crypto_sign_open: crypto_sign_open, + + crypto_secretbox_KEYBYTES: crypto_secretbox_KEYBYTES, + crypto_secretbox_NONCEBYTES: crypto_secretbox_NONCEBYTES, + crypto_secretbox_ZEROBYTES: crypto_secretbox_ZEROBYTES, + crypto_secretbox_BOXZEROBYTES: crypto_secretbox_BOXZEROBYTES, + crypto_scalarmult_BYTES: crypto_scalarmult_BYTES, + crypto_scalarmult_SCALARBYTES: crypto_scalarmult_SCALARBYTES, + crypto_box_PUBLICKEYBYTES: crypto_box_PUBLICKEYBYTES, + crypto_box_SECRETKEYBYTES: crypto_box_SECRETKEYBYTES, + crypto_box_BEFORENMBYTES: crypto_box_BEFORENMBYTES, + crypto_box_NONCEBYTES: crypto_box_NONCEBYTES, + crypto_box_ZEROBYTES: crypto_box_ZEROBYTES, + crypto_box_BOXZEROBYTES: crypto_box_BOXZEROBYTES, + crypto_sign_BYTES: crypto_sign_BYTES, + crypto_sign_PUBLICKEYBYTES: crypto_sign_PUBLICKEYBYTES, + crypto_sign_SECRETKEYBYTES: crypto_sign_SECRETKEYBYTES, + crypto_sign_SEEDBYTES: crypto_sign_SEEDBYTES, + crypto_hash_BYTES: crypto_hash_BYTES +}; + +/* High-level API */ + +function checkLengths(k, n) { + if (k.length !== crypto_secretbox_KEYBYTES) throw new Error('bad key size'); + if (n.length !== crypto_secretbox_NONCEBYTES) throw new Error('bad nonce size'); +} + +function checkBoxLengths(pk, sk) { + if (pk.length !== crypto_box_PUBLICKEYBYTES) throw new Error('bad public key size'); + if (sk.length !== crypto_box_SECRETKEYBYTES) throw new Error('bad secret key size'); +} + +function checkArrayTypes() { + var t, i; + for (i = 0; i < arguments.length; i++) { + if ((t = Object.prototype.toString.call(arguments[i])) !== '[object Uint8Array]') + throw new TypeError('unexpected type ' + t + ', use Uint8Array'); + } +} + +function cleanup(arr) { + for (var i = 0; i < arr.length; i++) arr[i] = 0; +} + +nacl.util = {}; + +nacl.util.decodeUTF8 = function(s) { + var i, d = unescape(encodeURIComponent(s)), b = new Uint8Array(d.length); + for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i); + return b; +}; + +nacl.util.encodeUTF8 = function(arr) { + var i, s = []; + for (i = 0; i < arr.length; i++) s.push(String.fromCharCode(arr[i])); + return decodeURIComponent(escape(s.join(''))); +}; + +nacl.util.encodeBase64 = function(arr) { + if (typeof btoa === 'undefined') { + return (new Buffer(arr)).toString('base64'); + } else { + var i, s = [], len = arr.length; + for (i = 0; i < len; i++) s.push(String.fromCharCode(arr[i])); + return btoa(s.join('')); + } +}; + +nacl.util.decodeBase64 = function(s) { + if (typeof atob === 'undefined') { + return new Uint8Array(Array.prototype.slice.call(new Buffer(s, 'base64'), 0)); + } else { + var i, d = atob(s), b = new Uint8Array(d.length); + for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i); + return b; + } +}; + +nacl.randomBytes = function(n) { + var b = new Uint8Array(n); + randombytes(b, n); + return b; +}; + +nacl.secretbox = function(msg, nonce, key) { + checkArrayTypes(msg, nonce, key); + checkLengths(key, nonce); + var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length); + var c = new Uint8Array(m.length); + for (var i = 0; i < msg.length; i++) m[i+crypto_secretbox_ZEROBYTES] = msg[i]; + crypto_secretbox(c, m, m.length, nonce, key); + return c.subarray(crypto_secretbox_BOXZEROBYTES); +}; + +nacl.secretbox.open = function(box, nonce, key) { + checkArrayTypes(box, nonce, key); + checkLengths(key, nonce); + var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length); + var m = new Uint8Array(c.length); + for (var i = 0; i < box.length; i++) c[i+crypto_secretbox_BOXZEROBYTES] = box[i]; + if (c.length < 32) return false; + if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) return false; + return m.subarray(crypto_secretbox_ZEROBYTES); +}; + +nacl.secretbox.keyLength = crypto_secretbox_KEYBYTES; +nacl.secretbox.nonceLength = crypto_secretbox_NONCEBYTES; +nacl.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES; + +nacl.scalarMult = function(n, p) { + checkArrayTypes(n, p); + if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size'); + if (p.length !== crypto_scalarmult_BYTES) throw new Error('bad p size'); + var q = new Uint8Array(crypto_scalarmult_BYTES); + crypto_scalarmult(q, n, p); + return q; +}; + +nacl.scalarMult.base = function(n) { + checkArrayTypes(n); + if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size'); + var q = new Uint8Array(crypto_scalarmult_BYTES); + crypto_scalarmult_base(q, n); + return q; +}; + +nacl.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES; +nacl.scalarMult.groupElementLength = crypto_scalarmult_BYTES; + +nacl.box = function(msg, nonce, publicKey, secretKey) { + var k = nacl.box.before(publicKey, secretKey); + return nacl.secretbox(msg, nonce, k); +}; + +nacl.box.before = function(publicKey, secretKey) { + checkArrayTypes(publicKey, secretKey); + checkBoxLengths(publicKey, secretKey); + var k = new Uint8Array(crypto_box_BEFORENMBYTES); + crypto_box_beforenm(k, publicKey, secretKey); + return k; +}; + +nacl.box.after = nacl.secretbox; + +nacl.box.open = function(msg, nonce, publicKey, secretKey) { + var k = nacl.box.before(publicKey, secretKey); + return nacl.secretbox.open(msg, nonce, k); +}; + +nacl.box.open.after = nacl.secretbox.open; + +nacl.box.keyPair = function() { + var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_box_SECRETKEYBYTES); + crypto_box_keypair(pk, sk); + return {publicKey: pk, secretKey: sk}; +}; + +nacl.box.keyPair.fromSecretKey = function(secretKey) { + checkArrayTypes(secretKey); + if (secretKey.length !== crypto_box_SECRETKEYBYTES) + throw new Error('bad secret key size'); + var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); + crypto_scalarmult_base(pk, secretKey); + return {publicKey: pk, secretKey: new Uint8Array(secretKey)}; +}; + +nacl.box.publicKeyLength = crypto_box_PUBLICKEYBYTES; +nacl.box.secretKeyLength = crypto_box_SECRETKEYBYTES; +nacl.box.sharedKeyLength = crypto_box_BEFORENMBYTES; +nacl.box.nonceLength = crypto_box_NONCEBYTES; +nacl.box.overheadLength = nacl.secretbox.overheadLength; + +nacl.sign = function(msg, secretKey) { + checkArrayTypes(msg, secretKey); + if (secretKey.length !== crypto_sign_SECRETKEYBYTES) + throw new Error('bad secret key size'); + var signedMsg = new Uint8Array(crypto_sign_BYTES+msg.length); + crypto_sign(signedMsg, msg, msg.length, secretKey); + return signedMsg; +}; + +nacl.sign.open = function(signedMsg, publicKey) { + if (arguments.length !== 2) + throw new Error('nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?'); + checkArrayTypes(signedMsg, publicKey); + if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) + throw new Error('bad public key size'); + var tmp = new Uint8Array(signedMsg.length); + var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey); + if (mlen < 0) return null; + var m = new Uint8Array(mlen); + for (var i = 0; i < m.length; i++) m[i] = tmp[i]; + return m; +}; + +nacl.sign.detached = function(msg, secretKey) { + var signedMsg = nacl.sign(msg, secretKey); + var sig = new Uint8Array(crypto_sign_BYTES); + for (var i = 0; i < sig.length; i++) sig[i] = signedMsg[i]; + return sig; +}; + +nacl.sign.detached.verify = function(msg, sig, publicKey) { + checkArrayTypes(msg, sig, publicKey); + if (sig.length !== crypto_sign_BYTES) + throw new Error('bad signature size'); + if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) + throw new Error('bad public key size'); + var sm = new Uint8Array(crypto_sign_BYTES + msg.length); + var m = new Uint8Array(crypto_sign_BYTES + msg.length); + var i; + for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i]; + for (i = 0; i < msg.length; i++) sm[i+crypto_sign_BYTES] = msg[i]; + return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0); +}; + +nacl.sign.keyPair = function() { + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); + crypto_sign_keypair(pk, sk); + return {publicKey: pk, secretKey: sk}; +}; + +nacl.sign.keyPair.fromSecretKey = function(secretKey) { + checkArrayTypes(secretKey); + if (secretKey.length !== crypto_sign_SECRETKEYBYTES) + throw new Error('bad secret key size'); + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + for (var i = 0; i < pk.length; i++) pk[i] = secretKey[32+i]; + return {publicKey: pk, secretKey: new Uint8Array(secretKey)}; +}; + +nacl.sign.keyPair.fromSeed = function(seed) { + checkArrayTypes(seed); + if (seed.length !== crypto_sign_SEEDBYTES) + throw new Error('bad seed size'); + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); + for (var i = 0; i < 32; i++) sk[i] = seed[i]; + crypto_sign_keypair(pk, sk, true); + return {publicKey: pk, secretKey: sk}; +}; + +nacl.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES; +nacl.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES; +nacl.sign.seedLength = crypto_sign_SEEDBYTES; +nacl.sign.signatureLength = crypto_sign_BYTES; + +nacl.hash = function(msg) { + checkArrayTypes(msg); + var h = new Uint8Array(crypto_hash_BYTES); + crypto_hash(h, msg, msg.length); + return h; +}; + +nacl.hash.hashLength = crypto_hash_BYTES; + +nacl.verify = function(x, y) { + checkArrayTypes(x, y); + // Zero length arguments are considered not equal. + if (x.length === 0 || y.length === 0) return false; + if (x.length !== y.length) return false; + return (vn(x, 0, y, 0, x.length) === 0) ? true : false; +}; + +nacl.setPRNG = function(fn) { + randombytes = fn; +}; + +(function() { + // Initialize PRNG if environment provides CSPRNG. + // If not, methods calling randombytes will throw. + var crypto; + if (typeof window !== 'undefined') { + // Browser. + if (window.crypto && window.crypto.getRandomValues) { + crypto = window.crypto; // Standard + } else if (window.msCrypto && window.msCrypto.getRandomValues) { + crypto = window.msCrypto; // Internet Explorer 11+ + } + if (crypto) { + nacl.setPRNG(function(x, n) { + var i, v = new Uint8Array(n); + crypto.getRandomValues(v); + for (i = 0; i < n; i++) x[i] = v[i]; + cleanup(v); + }); + } + } else if (typeof require !== 'undefined') { + // Node.js. + crypto = require('crypto'); + if (crypto) { + nacl.setPRNG(function(x, n) { + var i, v = crypto.randomBytes(n); + for (i = 0; i < n; i++) x[i] = v[i]; + cleanup(v); + }); + } + } +})(); + +})(typeof module !== 'undefined' && module.exports ? module.exports : (window.nacl = window.nacl || {})); diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.min.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.min.js new file mode 100644 index 00000000000000..95d869502e4b0d --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.min.js @@ -0,0 +1 @@ +!function(r){"use strict";function n(r,n){return r<>>32-n}function e(r,n){var e=255&r[n+3];return e=e<<8|255&r[n+2],e=e<<8|255&r[n+1],e<<8|255&r[n+0]}function t(r,n){var e=r[n]<<24|r[n+1]<<16|r[n+2]<<8|r[n+3],t=r[n+4]<<24|r[n+5]<<16|r[n+6]<<8|r[n+7];return new lr(e,t)}function o(r,n,e){var t;for(t=0;4>t;t++)r[n+t]=255&e,e>>>=8}function i(r,n,e){r[n]=e.hi>>24&255,r[n+1]=e.hi>>16&255,r[n+2]=e.hi>>8&255,r[n+3]=255&e.hi,r[n+4]=e.lo>>24&255,r[n+5]=e.lo>>16&255,r[n+6]=e.lo>>8&255,r[n+7]=255&e.lo}function a(r,n,e,t,o){var i,a=0;for(i=0;o>i;i++)a|=r[n+i]^e[t+i];return(1&a-1>>>8)-1}function f(r,n,e,t){return a(r,n,e,t,16)}function u(r,n,e,t){return a(r,n,e,t,32)}function c(r,t,i,a,f){var u,c,w,y=new Uint32Array(16),s=new Uint32Array(16),l=new Uint32Array(16),h=new Uint32Array(4);for(u=0;4>u;u++)s[5*u]=e(a,4*u),s[1+u]=e(i,4*u),s[6+u]=e(t,4*u),s[11+u]=e(i,16+4*u);for(u=0;16>u;u++)l[u]=s[u];for(u=0;20>u;u++){for(c=0;4>c;c++){for(w=0;4>w;w++)h[w]=s[(5*c+4*w)%16];for(h[1]^=n(h[0]+h[3]|0,7),h[2]^=n(h[1]+h[0]|0,9),h[3]^=n(h[2]+h[1]|0,13),h[0]^=n(h[3]+h[2]|0,18),w=0;4>w;w++)y[4*c+(c+w)%4]=h[w]}for(w=0;16>w;w++)s[w]=y[w]}if(f){for(u=0;16>u;u++)s[u]=s[u]+l[u]|0;for(u=0;4>u;u++)s[5*u]=s[5*u]-e(a,4*u)|0,s[6+u]=s[6+u]-e(t,4*u)|0;for(u=0;4>u;u++)o(r,4*u,s[5*u]),o(r,16+4*u,s[6+u])}else for(u=0;16>u;u++)o(r,4*u,s[u]+l[u]|0)}function w(r,n,e,t){return c(r,n,e,t,!1),0}function y(r,n,e,t){return c(r,n,e,t,!0),0}function s(r,n,e,t,o,i,a){var f,u,c=new Uint8Array(16),y=new Uint8Array(64);if(!o)return 0;for(u=0;16>u;u++)c[u]=0;for(u=0;8>u;u++)c[u]=i[u];for(;o>=64;){for(w(y,c,a,Br),u=0;64>u;u++)r[n+u]=(e?e[t+u]:0)^y[u];for(f=1,u=8;16>u;u++)f=f+(255&c[u])|0,c[u]=255&f,f>>>=8;o-=64,n+=64,e&&(t+=64)}if(o>0)for(w(y,c,a,Br),u=0;o>u;u++)r[n+u]=(e?e[t+u]:0)^y[u];return 0}function l(r,n,e,t,o){return s(r,n,null,0,e,t,o)}function h(r,n,e,t,o){var i=new Uint8Array(32);return y(i,t,o,Br),l(r,n,e,t.subarray(16),i)}function g(r,n,e,t,o,i,a){var f=new Uint8Array(32);return y(f,i,a,Br),s(r,n,e,t,o,i.subarray(16),f)}function p(r,n){var e,t=0;for(e=0;17>e;e++)t=t+(r[e]+n[e]|0)|0,r[e]=255&t,t>>>=8}function v(r,n,e,t,o,i){var a,f,u,c,w=new Uint32Array(17),y=new Uint32Array(17),s=new Uint32Array(17),l=new Uint32Array(17),h=new Uint32Array(17);for(u=0;17>u;u++)y[u]=s[u]=0;for(u=0;16>u;u++)y[u]=i[u];for(y[3]&=15,y[4]&=252,y[7]&=15,y[8]&=252,y[11]&=15,y[12]&=252,y[15]&=15;o>0;){for(u=0;17>u;u++)l[u]=0;for(u=0;16>u&&o>u;++u)l[u]=e[t+u];for(l[u]=1,t+=u,o-=u,p(s,l),f=0;17>f;f++)for(w[f]=0,u=0;17>u;u++)w[f]=w[f]+s[u]*(f>=u?y[f-u]:320*y[f+17-u]|0)|0|0;for(f=0;17>f;f++)s[f]=w[f];for(c=0,u=0;16>u;u++)c=c+s[u]|0,s[u]=255&c,c>>>=8;for(c=c+s[16]|0,s[16]=3&c,c=5*(c>>>2)|0,u=0;16>u;u++)c=c+s[u]|0,s[u]=255&c,c>>>=8;c=c+s[16]|0,s[16]=c}for(u=0;17>u;u++)h[u]=s[u];for(p(s,Sr),a=0|-(s[16]>>>7),u=0;17>u;u++)s[u]^=a&(h[u]^s[u]);for(u=0;16>u;u++)l[u]=i[u+16];for(l[16]=0,p(s,l),u=0;16>u;u++)r[n+u]=s[u];return 0}function b(r,n,e,t,o,i){var a=new Uint8Array(16);return v(a,0,e,t,o,i),f(r,n,a,0)}function A(r,n,e,t,o){var i;if(32>e)return-1;for(g(r,0,n,0,e,t,o),v(r,16,r,32,e-32,r),i=0;16>i;i++)r[i]=0;return 0}function U(r,n,e,t,o){var i,a=new Uint8Array(32);if(32>e)return-1;if(h(a,0,32,t,o),0!==b(n,16,n,32,e-32,a))return-1;for(g(r,0,n,0,e,t,o),i=0;32>i;i++)r[i]=0;return 0}function _(r,n){var e;for(e=0;16>e;e++)r[e]=0|n[e]}function d(r){var n,e;for(e=0;16>e;e++)r[e]+=65536,n=Math.floor(r[e]/65536),r[(e+1)*(15>e?1:0)]+=n-1+37*(n-1)*(15===e?1:0),r[e]-=65536*n}function E(r,n,e){for(var t,o=~(e-1),i=0;16>i;i++)t=o&(r[i]^n[i]),r[i]^=t,n[i]^=t}function x(r,n){var e,t,o,i=hr(),a=hr();for(e=0;16>e;e++)a[e]=n[e];for(d(a),d(a),d(a),t=0;2>t;t++){for(i[0]=a[0]-65517,e=1;15>e;e++)i[e]=a[e]-65535-(i[e-1]>>16&1),i[e-1]&=65535;i[15]=a[15]-32767-(i[14]>>16&1),o=i[15]>>16&1,i[14]&=65535,E(a,i,1-o)}for(e=0;16>e;e++)r[2*e]=255&a[e],r[2*e+1]=a[e]>>8}function m(r,n){var e=new Uint8Array(32),t=new Uint8Array(32);return x(e,r),x(t,n),u(e,0,t,0)}function B(r){var n=new Uint8Array(32);return x(n,r),1&n[0]}function S(r,n){var e;for(e=0;16>e;e++)r[e]=n[2*e]+(n[2*e+1]<<8);r[15]&=32767}function K(r,n,e){var t;for(t=0;16>t;t++)r[t]=n[t]+e[t]|0}function T(r,n,e){var t;for(t=0;16>t;t++)r[t]=n[t]-e[t]|0}function Y(r,n,e){var t,o,i=new Float64Array(31);for(t=0;31>t;t++)i[t]=0;for(t=0;16>t;t++)for(o=0;16>o;o++)i[t+o]+=n[t]*e[o];for(t=0;15>t;t++)i[t]+=38*i[t+16];for(t=0;16>t;t++)r[t]=i[t];d(r),d(r)}function L(r,n){Y(r,n,n)}function C(r,n){var e,t=hr();for(e=0;16>e;e++)t[e]=n[e];for(e=253;e>=0;e--)L(t,t),2!==e&&4!==e&&Y(t,t,n);for(e=0;16>e;e++)r[e]=t[e]}function R(r,n){var e,t=hr();for(e=0;16>e;e++)t[e]=n[e];for(e=250;e>=0;e--)L(t,t),1!==e&&Y(t,t,n);for(e=0;16>e;e++)r[e]=t[e]}function k(r,n,e){var t,o,i=new Uint8Array(32),a=new Float64Array(80),f=hr(),u=hr(),c=hr(),w=hr(),y=hr(),s=hr();for(o=0;31>o;o++)i[o]=n[o];for(i[31]=127&n[31]|64,i[0]&=248,S(a,e),o=0;16>o;o++)u[o]=a[o],w[o]=f[o]=c[o]=0;for(f[0]=w[0]=1,o=254;o>=0;--o)t=i[o>>>3]>>>(7&o)&1,E(f,u,t),E(c,w,t),K(y,f,c),T(f,f,c),K(c,u,w),T(u,u,w),L(w,y),L(s,f),Y(f,c,f),Y(c,u,y),K(y,f,c),T(f,f,c),L(u,f),T(c,w,s),Y(f,c,Ur),K(f,f,w),Y(c,c,f),Y(f,w,s),Y(w,u,a),L(u,y),E(f,u,t),E(c,w,t);for(o=0;16>o;o++)a[o+16]=f[o],a[o+32]=c[o],a[o+48]=u[o],a[o+64]=w[o];var l=a.subarray(32),h=a.subarray(16);return C(l,l),Y(h,h,l),x(r,h),0}function z(r,n){return k(r,n,vr)}function P(r,n){return gr(n,32),z(r,n)}function O(r,n,e){var t=new Uint8Array(32);return k(t,e,n),y(r,pr,t,Br)}function F(r,n,e,t,o,i){var a=new Uint8Array(32);return O(a,o,i),Kr(r,n,e,t,a)}function N(r,n,e,t,o,i){var a=new Uint8Array(32);return O(a,o,i),Tr(r,n,e,t,a)}function M(){var r,n,e,t=0,o=0,i=0,a=0,f=65535;for(e=0;e>>16,i+=n&f,a+=n>>>16;return o+=t>>>16,i+=o>>>16,a+=i>>>16,new lr(i&f|a<<16,t&f|o<<16)}function j(r,n){return new lr(r.hi>>>n,r.lo>>>n|r.hi<<32-n)}function G(){var r,n=0,e=0;for(r=0;rn?(e=r.hi>>>n|r.lo<>>n|r.hi<n&&(e=r.lo>>>n|r.hi<>>n|r.lo<a;a++)u[a]=w[a]=t(r,8*a);for(var s=0;e>=128;){for(a=0;16>a;a++)y[a]=t(n,8*a+s);for(a=0;80>a;a++){for(f=0;8>f;f++)c[f]=w[f];for(o=M(w[7],X(w[4]),Z(w[4],w[5],w[6]),Yr[a],y[a%16]),c[7]=M(o,q(w[0]),V(w[0],w[1],w[2])),c[3]=M(c[3],o),f=0;8>f;f++)w[(f+1)%8]=c[f];if(a%16===15)for(f=0;16>f;f++)y[f]=M(y[f],y[(f+9)%16],D(y[(f+1)%16]),H(y[(f+14)%16]))}for(a=0;8>a;a++)w[a]=M(w[a],u[a]),u[a]=w[a];s+=128,e-=128}for(a=0;8>a;a++)i(r,8*a,u[a]);return e}function Q(r,n,e){var t,o=new Uint8Array(64),a=new Uint8Array(256),f=e;for(t=0;64>t;t++)o[t]=Lr[t];for(J(o,n,e),e%=128,t=0;256>t;t++)a[t]=0;for(t=0;e>t;t++)a[t]=n[f-e+t];for(a[e]=128,e=256-128*(112>e?1:0),a[e-9]=0,i(a,e-8,new lr(f/536870912|0,f<<3)),J(o,a,e),t=0;64>t;t++)r[t]=o[t];return 0}function W(r,n){var e=hr(),t=hr(),o=hr(),i=hr(),a=hr(),f=hr(),u=hr(),c=hr(),w=hr();T(e,r[1],r[0]),T(w,n[1],n[0]),Y(e,e,w),K(t,r[0],r[1]),K(w,n[0],n[1]),Y(t,t,w),Y(o,r[3],n[3]),Y(o,o,dr),Y(i,r[2],n[2]),K(i,i,i),T(a,t,e),T(f,i,o),K(u,i,o),K(c,t,e),Y(r[0],a,f),Y(r[1],c,u),Y(r[2],u,f),Y(r[3],a,c)}function $(r,n,e){var t;for(t=0;4>t;t++)E(r[t],n[t],e)}function rr(r,n){var e=hr(),t=hr(),o=hr();C(o,n[2]),Y(e,n[0],o),Y(t,n[1],o),x(r,t),r[31]^=B(e)<<7}function nr(r,n,e){var t,o;for(_(r[0],br),_(r[1],Ar),_(r[2],Ar),_(r[3],br),o=255;o>=0;--o)t=e[o/8|0]>>(7&o)&1,$(r,n,t),W(n,r),W(r,r),$(r,n,t)}function er(r,n){var e=[hr(),hr(),hr(),hr()];_(e[0],Er),_(e[1],xr),_(e[2],Ar),Y(e[3],Er,xr),nr(r,e,n)}function tr(r,n,e){var t,o=new Uint8Array(64),i=[hr(),hr(),hr(),hr()];for(e||gr(n,32),Q(o,n,32),o[0]&=248,o[31]&=127,o[31]|=64,er(i,o),rr(r,i),t=0;32>t;t++)n[t+32]=r[t];return 0}function or(r,n){var e,t,o,i;for(t=63;t>=32;--t){for(e=0,o=t-32,i=t-12;i>o;++o)n[o]+=e-16*n[t]*Cr[o-(t-32)],e=n[o]+128>>8,n[o]-=256*e;n[o]+=e,n[t]=0}for(e=0,o=0;32>o;o++)n[o]+=e-(n[31]>>4)*Cr[o],e=n[o]>>8,n[o]&=255;for(o=0;32>o;o++)n[o]-=e*Cr[o];for(t=0;32>t;t++)n[t+1]+=n[t]>>8,r[t]=255&n[t]}function ir(r){var n,e=new Float64Array(64);for(n=0;64>n;n++)e[n]=r[n];for(n=0;64>n;n++)r[n]=0;or(r,e)}function ar(r,n,e,t){var o,i,a=new Uint8Array(64),f=new Uint8Array(64),u=new Uint8Array(64),c=new Float64Array(64),w=[hr(),hr(),hr(),hr()];Q(a,t,32),a[0]&=248,a[31]&=127,a[31]|=64;var y=e+64;for(o=0;e>o;o++)r[64+o]=n[o];for(o=0;32>o;o++)r[32+o]=a[32+o];for(Q(u,r.subarray(32),e+32),ir(u),er(w,u),rr(r,w),o=32;64>o;o++)r[o]=t[o];for(Q(f,r,e+64),ir(f),o=0;64>o;o++)c[o]=0;for(o=0;32>o;o++)c[o]=u[o];for(o=0;32>o;o++)for(i=0;32>i;i++)c[o+i]+=f[o]*a[i];return or(r.subarray(32),c),y}function fr(r,n){var e=hr(),t=hr(),o=hr(),i=hr(),a=hr(),f=hr(),u=hr();return _(r[2],Ar),S(r[1],n),L(o,r[1]),Y(i,o,_r),T(o,o,r[2]),K(i,r[2],i),L(a,i),L(f,a),Y(u,f,a),Y(e,u,o),Y(e,e,i),R(e,e),Y(e,e,o),Y(e,e,i),Y(e,e,i),Y(r[0],e,i),L(t,r[0]),Y(t,t,i),m(t,o)&&Y(r[0],r[0],mr),L(t,r[0]),Y(t,t,i),m(t,o)?-1:(B(r[0])===n[31]>>7&&T(r[0],br,r[0]),Y(r[3],r[0],r[1]),0)}function ur(r,n,e,t){var o,i,a=new Uint8Array(32),f=new Uint8Array(64),c=[hr(),hr(),hr(),hr()],w=[hr(),hr(),hr(),hr()];if(i=-1,64>e)return-1;if(fr(w,t))return-1;for(o=0;e>o;o++)r[o]=n[o];for(o=0;32>o;o++)r[o+32]=t[o];if(Q(f,r,e),ir(f),nr(c,w,f),er(w,n.subarray(32)),W(c,w),rr(a,c),e-=64,u(n,0,a,0)){for(o=0;e>o;o++)r[o]=0;return-1}for(o=0;e>o;o++)r[o]=n[o+64];return i=e}function cr(r,n){if(r.length!==Rr)throw new Error("bad key size");if(n.length!==kr)throw new Error("bad nonce size")}function wr(r,n){if(r.length!==Nr)throw new Error("bad public key size");if(n.length!==Mr)throw new Error("bad secret key size")}function yr(){var r,n;for(n=0;nn;n++)e.push(String.fromCharCode(r[n]));return btoa(e.join(""))},r.util.decodeBase64=function(r){if("undefined"==typeof atob)return new Uint8Array(Array.prototype.slice.call(new Buffer(r,"base64"),0));var n,e=atob(r),t=new Uint8Array(e.length);for(n=0;nt)return null;for(var o=new Uint8Array(t),i=0;it;t++)o[t]=n[t];for(t=0;t=0},r.sign.keyPair=function(){var r=new Uint8Array(qr),n=new Uint8Array(Xr);return tr(r,n),{publicKey:r,secretKey:n}},r.sign.keyPair.fromSecretKey=function(r){if(yr(r),r.length!==Xr)throw new Error("bad secret key size");for(var n=new Uint8Array(qr),e=0;et;t++)e[t]=r[t];return tr(n,e,!0),{publicKey:n,secretKey:e}},r.sign.publicKeyLength=qr,r.sign.secretKeyLength=Xr,r.sign.seedLength=Dr,r.sign.signatureLength=Vr,r.hash=function(r){yr(r);var n=new Uint8Array(Hr);return Q(n,r,r.length),n},r.hash.hashLength=Hr,r.verify=function(r,n){return yr(r,n),0===r.length||0===n.length?!1:r.length!==n.length?!1:0===a(r,0,n,0,r.length)?!0:!1},r.setPRNG=function(r){gr=r},function(){var n;"undefined"!=typeof window?(window.crypto&&window.crypto.getRandomValues?n=window.crypto:window.msCrypto&&window.msCrypto.getRandomValues&&(n=window.msCrypto),n&&r.setPRNG(function(r,e){var t,o=new Uint8Array(e);for(n.getRandomValues(o),t=0;e>t;t++)r[t]=o[t];sr(o)})):"undefined"!=typeof require&&(n=require("crypto"),n&&r.setPRNG(function(r,e){var t,o=n.randomBytes(e);for(t=0;e>t;t++)r[t]=o[t];sr(o)}))}()}("undefined"!=typeof module&&module.exports?module.exports:window.nacl=window.nacl||{}); \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/package.json new file mode 100644 index 00000000000000..7cca76eb587141 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/package.json @@ -0,0 +1,120 @@ +{ + "_args": [ + [ + "tweetnacl@>=0.13.0 <1.0.0", + "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk" + ] + ], + "_from": "tweetnacl@>=0.13.0 <1.0.0", + "_id": "tweetnacl@0.13.3", + "_inCache": true, + "_installable": true, + "_location": "/request/http-signature/sshpk/tweetnacl", + "_nodeVersion": "4.2.3", + "_npmUser": { + "email": "dmitry@codingrobots.com", + "name": "dchest" + }, + "_npmVersion": "2.14.7", + "_phantomChildren": {}, + "_requested": { + "name": "tweetnacl", + "raw": "tweetnacl@>=0.13.0 <1.0.0", + "rawSpec": ">=0.13.0 <1.0.0", + "scope": null, + "spec": ">=0.13.0 <1.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request/http-signature/sshpk" + ], + "_resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.13.3.tgz", + "_shasum": "d628b56f3bcc3d5ae74ba9d4c1a704def5ab4b56", + "_shrinkwrap": null, + "_spec": "tweetnacl@>=0.13.0 <1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk", + "author": { + "name": "TweetNaCl-js contributors" + }, + "browser": { + "buffer": false, + "crypto": false + }, + "bugs": { + "url": "https://github.com/dchest/tweetnacl-js/issues" + }, + "dependencies": {}, + "description": "Port of TweetNaCl cryptographic library to JavaScript", + "devDependencies": { + "browserify": "^10.1.3", + "eslint": "^1.4.3", + "faucet": "0.0.1", + "tap-browser-color": "^0.1.2", + "tape": "^4.0.0", + "testling": "^1.7.1", + "uglify-js": "^2.4.21" + }, + "directories": { + "test": "test" + }, + "dist": { + "shasum": "d628b56f3bcc3d5ae74ba9d4c1a704def5ab4b56", + "tarball": "http://registry.npmjs.org/tweetnacl/-/tweetnacl-0.13.3.tgz" + }, + "gitHead": "2bb422cb707fba4a5ec9654688564a4fb861b068", + "homepage": "https://dchest.github.io/tweetnacl-js", + "keywords": [ + "crypto", + "cryptography", + "curve25519", + "ed25519", + "encrypt", + "hash", + "key", + "nacl", + "poly1305", + "public", + "salsa20", + "signatures" + ], + "license": "Public domain", + "main": "nacl-fast.js", + "maintainers": [ + { + "name": "dchest", + "email": "dmitry@codingrobots.com" + } + ], + "name": "tweetnacl", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/dchest/tweetnacl-js.git" + }, + "scripts": { + "bench": "node test/benchmark/bench.js", + "browser": "browserify test/browser/init.js test/*.js | uglifyjs -c -m -o test/browser/_bundle.js 2>/dev/null", + "browser-quick": "browserify test/browser/init.js test/*.quick.js | uglifyjs -c -m -o test/browser/_bundle-quick.js 2>/dev/null", + "build": "uglifyjs nacl.js -c -m -o nacl.min.js && uglifyjs nacl-fast.js -c -m -o nacl-fast.min.js", + "chrome": "browserify test/browser/testling_init.js test/*.js | testling -x google-chrome | faucet", + "firefox": "browserify test/browser/testling_init.js test/*.js | testling -x firefox | faucet", + "lint": "eslint nacl.js nacl-fast.js test/*.js test/benchmark/*.js", + "test": "tape test/*.js | faucet", + "testall": "make -C test/c && tape test/*.js test/c/*.js | faucet", + "testling": "browserify test/browser/testling_init.js test/*.js | testling | faucet" + }, + "testling": { + "browsers": [ + "android-browser/latest", + "chrome/22..latest", + "firefox/16..latest", + "ipad/6..latest", + "iphone/6..latest", + "opera/11.0..latest", + "safari/latest" + ], + "files": "test/*.js" + }, + "version": "0.13.3" +} diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/package.json new file mode 100644 index 00000000000000..6fce0e32017062 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/package.json @@ -0,0 +1,120 @@ +{ + "_args": [ + [ + "sshpk@^1.7.0", + "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature" + ] + ], + "_from": "sshpk@>=1.7.0 <2.0.0", + "_id": "sshpk@1.7.3", + "_inCache": true, + "_installable": true, + "_location": "/request/http-signature/sshpk", + "_nodeVersion": "0.12.9", + "_npmUser": { + "email": "alex@cooperi.net", + "name": "arekinath" + }, + "_npmVersion": "2.14.9", + "_phantomChildren": {}, + "_requested": { + "name": "sshpk", + "raw": "sshpk@^1.7.0", + "rawSpec": "^1.7.0", + "scope": null, + "spec": ">=1.7.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request/http-signature" + ], + "_resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.7.3.tgz", + "_shasum": "caa8ef95e30765d856698b7025f9f211ab65962f", + "_shrinkwrap": null, + "_spec": "sshpk@^1.7.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature", + "author": { + "name": "Joyent, Inc" + }, + "bin": { + "sshpk-conv": "bin/sshpk-conv", + "sshpk-sign": "bin/sshpk-sign", + "sshpk-verify": "bin/sshpk-verify" + }, + "bugs": { + "url": "https://github.com/arekinath/node-sshpk/issues" + }, + "contributors": [ + { + "name": "Dave Eddy", + "email": "dave@daveeddy.com" + }, + { + "name": "Mark Cavage", + "email": "mcavage@gmail.com" + }, + { + "name": "Alex Wilson", + "email": "alex@cooperi.net" + } + ], + "dependencies": { + "asn1": ">=0.2.3 <0.3.0", + "assert-plus": ">=0.2.0 <0.3.0", + "dashdash": ">=1.10.1 <2.0.0", + "ecc-jsbn": ">=0.0.1 <1.0.0", + "jodid25519": ">=1.0.0 <2.0.0", + "jsbn": ">=0.1.0 <0.2.0", + "tweetnacl": ">=0.13.0 <1.0.0" + }, + "description": "A library for finding and using SSH public keys", + "devDependencies": { + "benchmark": ">=1.0.0 <2.0.0", + "sinon": ">=1.17.2 <2.0.0", + "tape": ">=3.5.0 <4.0.0", + "temp": "0.8.2" + }, + "directories": { + "bin": "./bin", + "lib": "./lib", + "man": "./man/man1" + }, + "dist": { + "shasum": "caa8ef95e30765d856698b7025f9f211ab65962f", + "tarball": "http://registry.npmjs.org/sshpk/-/sshpk-1.7.3.tgz" + }, + "engines": { + "node": ">=0.8.0" + }, + "gitHead": "3d98bfc22bb1c09f0747244acbb408f3ca9448b5", + "homepage": "https://github.com/arekinath/node-sshpk#readme", + "license": "MIT", + "main": "lib/index.js", + "maintainers": [ + { + "name": "arekinath", + "email": "alex@cooperi.net" + } + ], + "man": [ + "/Users/alex.wilson/dev/sshpk/man/man1/sshpk-conv.1", + "/Users/alex.wilson/dev/sshpk/man/man1/sshpk-sign.1", + "/Users/alex.wilson/dev/sshpk/man/man1/sshpk-verify.1" + ], + "name": "sshpk", + "optionalDependencies": { + "ecc-jsbn": ">=0.0.1 <1.0.0", + "jodid25519": ">=1.0.0 <2.0.0", + "jsbn": ">=0.1.0 <0.2.0", + "tweetnacl": ">=0.13.0 <1.0.0" + }, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/arekinath/node-sshpk.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "version": "1.7.3" +} diff --git a/deps/npm/node_modules/request/node_modules/http-signature/package.json b/deps/npm/node_modules/request/node_modules/http-signature/package.json index 47d76cffcf9187..c7479c09ff97a4 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/package.json @@ -1,11 +1,44 @@ { - "name": "http-signature", - "description": "Reference implementation of Joyent's HTTP Signature scheme.", - "version": "0.11.0", - "license": "MIT", + "_args": [ + [ + "http-signature@~1.1.0", + "/Users/rebecca/code/npm/node_modules/request" + ] + ], + "_from": "http-signature@>=1.1.0 <1.2.0", + "_id": "http-signature@1.1.1", + "_inCache": true, + "_installable": true, + "_location": "/request/http-signature", + "_nodeVersion": "0.12.9", + "_npmUser": { + "email": "alex@cooperi.net", + "name": "arekinath" + }, + "_npmVersion": "2.14.9", + "_phantomChildren": {}, + "_requested": { + "name": "http-signature", + "raw": "http-signature@~1.1.0", + "rawSpec": "~1.1.0", + "scope": null, + "spec": ">=1.1.0 <1.2.0", + "type": "range" + }, + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", + "_shasum": "df72e267066cd0ac67fb76adf8e134a8fbcf91bf", + "_shrinkwrap": null, + "_spec": "http-signature@~1.1.0", + "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { "name": "Joyent, Inc" }, + "bugs": { + "url": "https://github.com/joyent/node-http-signature/issues" + }, "contributors": [ { "name": "Mark Cavage", @@ -20,45 +53,38 @@ "email": "patrick.f.mooney@gmail.com" } ], - "repository": { - "type": "git", - "url": "git://github.com/joyent/node-http-signature.git" - }, - "homepage": "https://github.com/joyent/node-http-signature/", - "bugs": { - "url": "https://github.com/joyent/node-http-signature/issues" - }, - "keywords": [ - "https", - "request" - ], - "engines": { - "node": ">=0.8" - }, - "main": "lib/index.js", - "scripts": { - "test": "tap test/*.js" - }, "dependencies": { - "assert-plus": "^0.1.5", - "asn1": "0.1.11", - "ctype": "0.5.3" + "assert-plus": "^0.2.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" }, + "description": "Reference implementation of Joyent's HTTP Signature scheme.", "devDependencies": { "node-uuid": "^1.4.1", "tap": "0.4.2" }, - "_id": "http-signature@0.11.0", - "_shasum": "1796cf67a001ad5cd6849dca0991485f09089fe6", - "_resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.11.0.tgz", - "_from": "http-signature@>=0.11.0 <0.12.0", - "_npmVersion": "2.5.1", - "_nodeVersion": "0.10.36", - "_npmUser": { - "name": "pfmooney", - "email": "patrick.f.mooney@gmail.com" + "directories": {}, + "dist": { + "shasum": "df72e267066cd0ac67fb76adf8e134a8fbcf91bf", + "tarball": "http://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz" }, + "engines": { + "node": ">=0.8", + "npm": ">=1.3.7" + }, + "gitHead": "74d3f35e3aa436d83723c53b01e266f448e8149a", + "homepage": "https://github.com/joyent/node-http-signature/", + "keywords": [ + "https", + "request" + ], + "license": "MIT", + "main": "lib/index.js", "maintainers": [ + { + "name": "arekinath", + "email": "alex@cooperi.net" + }, { "name": "mcavage", "email": "mcavage@gmail.com" @@ -68,10 +94,15 @@ "email": "patrick.f.mooney@gmail.com" } ], - "dist": { - "shasum": "1796cf67a001ad5cd6849dca0991485f09089fe6", - "tarball": "http://registry.npmjs.org/http-signature/-/http-signature-0.11.0.tgz" + "name": "http-signature", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/joyent/node-http-signature.git" }, - "directories": {}, - "readme": "ERROR: No README data found!" + "scripts": { + "test": "tap test/*.js" + }, + "version": "1.1.1" } diff --git a/deps/npm/node_modules/request/node_modules/is-typedarray/LICENSE.md b/deps/npm/node_modules/request/node_modules/is-typedarray/LICENSE.md new file mode 100644 index 00000000000000..ee27ba4b4412b0 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/is-typedarray/LICENSE.md @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/request/node_modules/is-typedarray/README.md b/deps/npm/node_modules/request/node_modules/is-typedarray/README.md new file mode 100644 index 00000000000000..27528639193584 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/is-typedarray/README.md @@ -0,0 +1,16 @@ +# is-typedarray [![locked](http://badges.github.io/stability-badges/dist/locked.svg)](http://github.com/badges/stability-badges) + +Detect whether or not an object is a +[Typed Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays). + +## Usage + +[![NPM](https://nodei.co/npm/is-typedarray.png)](https://nodei.co/npm/is-typedarray/) + +### isTypedArray(array) + +Returns `true` when array is a Typed Array, and `false` when it is not. + +## License + +MIT. See [LICENSE.md](http://github.com/hughsk/is-typedarray/blob/master/LICENSE.md) for details. diff --git a/deps/npm/node_modules/request/node_modules/is-typedarray/index.js b/deps/npm/node_modules/request/node_modules/is-typedarray/index.js new file mode 100644 index 00000000000000..58596036cdf159 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/is-typedarray/index.js @@ -0,0 +1,41 @@ +module.exports = isTypedArray +isTypedArray.strict = isStrictTypedArray +isTypedArray.loose = isLooseTypedArray + +var toString = Object.prototype.toString +var names = { + '[object Int8Array]': true + , '[object Int16Array]': true + , '[object Int32Array]': true + , '[object Uint8Array]': true + , '[object Uint8ClampedArray]': true + , '[object Uint16Array]': true + , '[object Uint32Array]': true + , '[object Float32Array]': true + , '[object Float64Array]': true +} + +function isTypedArray(arr) { + return ( + isStrictTypedArray(arr) + || isLooseTypedArray(arr) + ) +} + +function isStrictTypedArray(arr) { + return ( + arr instanceof Int8Array + || arr instanceof Int16Array + || arr instanceof Int32Array + || arr instanceof Uint8Array + || arr instanceof Uint8ClampedArray + || arr instanceof Uint16Array + || arr instanceof Uint32Array + || arr instanceof Float32Array + || arr instanceof Float64Array + ) +} + +function isLooseTypedArray(arr) { + return names[toString.call(arr)] +} diff --git a/deps/npm/node_modules/request/node_modules/is-typedarray/package.json b/deps/npm/node_modules/request/node_modules/is-typedarray/package.json new file mode 100644 index 00000000000000..863afc5165c769 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/is-typedarray/package.json @@ -0,0 +1,82 @@ +{ + "_args": [ + [ + "is-typedarray@~1.0.0", + "/Users/ogd/Documents/projects/npm/npm/node_modules/request" + ] + ], + "_from": "is-typedarray@>=1.0.0 <1.1.0", + "_id": "is-typedarray@1.0.0", + "_inCache": true, + "_installable": true, + "_location": "/request/is-typedarray", + "_nodeVersion": "0.10.36", + "_npmUser": { + "email": "hughskennedy@gmail.com", + "name": "hughsk" + }, + "_npmVersion": "2.7.5", + "_phantomChildren": {}, + "_requested": { + "name": "is-typedarray", + "raw": "is-typedarray@~1.0.0", + "rawSpec": "~1.0.0", + "scope": null, + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "_shasum": "e479c80858df0c1b11ddda6940f96011fcda4a9a", + "_shrinkwrap": null, + "_spec": "is-typedarray@~1.0.0", + "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request", + "author": { + "email": "hughskennedy@gmail.com", + "name": "Hugh Kennedy", + "url": "http://hughsk.io/" + }, + "bugs": { + "url": "https://github.com/hughsk/is-typedarray/issues" + }, + "dependencies": {}, + "description": "Detect whether or not an object is a Typed Array", + "devDependencies": { + "tape": "^2.13.1" + }, + "directories": {}, + "dist": { + "shasum": "e479c80858df0c1b11ddda6940f96011fcda4a9a", + "tarball": "http://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz" + }, + "gitHead": "0617cfa871686cf541af62b144f130488f44f6fe", + "homepage": "https://github.com/hughsk/is-typedarray", + "keywords": [ + "array", + "detect", + "is", + "typed", + "util" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "hughsk", + "email": "hughskennedy@gmail.com" + } + ], + "name": "is-typedarray", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/hughsk/is-typedarray.git" + }, + "scripts": { + "test": "node test" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/request/node_modules/is-typedarray/test.js b/deps/npm/node_modules/request/node_modules/is-typedarray/test.js new file mode 100644 index 00000000000000..b0c176fa302aa0 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/is-typedarray/test.js @@ -0,0 +1,34 @@ +var test = require('tape') +var ista = require('./') + +test('strict', function(t) { + t.ok(ista.strict(new Int8Array), 'Int8Array') + t.ok(ista.strict(new Int16Array), 'Int16Array') + t.ok(ista.strict(new Int32Array), 'Int32Array') + t.ok(ista.strict(new Uint8Array), 'Uint8Array') + t.ok(ista.strict(new Uint16Array), 'Uint16Array') + t.ok(ista.strict(new Uint32Array), 'Uint32Array') + t.ok(ista.strict(new Float32Array), 'Float32Array') + t.ok(ista.strict(new Float64Array), 'Float64Array') + + t.ok(!ista.strict(new Array), 'Array') + t.ok(!ista.strict([]), '[]') + + t.end() +}) + +test('loose', function(t) { + t.ok(ista.loose(new Int8Array), 'Int8Array') + t.ok(ista.loose(new Int16Array), 'Int16Array') + t.ok(ista.loose(new Int32Array), 'Int32Array') + t.ok(ista.loose(new Uint8Array), 'Uint8Array') + t.ok(ista.loose(new Uint16Array), 'Uint16Array') + t.ok(ista.loose(new Uint32Array), 'Uint32Array') + t.ok(ista.loose(new Float32Array), 'Float32Array') + t.ok(ista.loose(new Float64Array), 'Float64Array') + + t.ok(!ista.loose(new Array), 'Array') + t.ok(!ista.loose([]), '[]') + + t.end() +}) diff --git a/deps/npm/node_modules/request/node_modules/isstream/package.json b/deps/npm/node_modules/request/node_modules/isstream/package.json index 74e97e608cc11e..87c26fe121c130 100644 --- a/deps/npm/node_modules/request/node_modules/isstream/package.json +++ b/deps/npm/node_modules/request/node_modules/isstream/package.json @@ -33,27 +33,10 @@ "url": "https://github.com/rvagg/isstream/issues" }, "homepage": "https://github.com/rvagg/isstream", - "gitHead": "cd39cba6da939b4fc9110825203adc506422c3dc", + "readme": "# isStream\n\n[![Build Status](https://secure.travis-ci.org/rvagg/isstream.png)](http://travis-ci.org/rvagg/isstream)\n\n**Test if an object is a `Stream`**\n\n[![NPM](https://nodei.co/npm/isstream.svg)](https://nodei.co/npm/isstream/)\n\nThe missing `Stream.isStream(obj)`: determine if an object is standard Node.js `Stream`. Works for Node-core `Stream` objects (for 0.8, 0.10, 0.11, and in theory, older and newer versions) and all versions of **[readable-stream](https://github.com/isaacs/readable-stream)**.\n\n## Usage:\n\n```js\nvar isStream = require('isstream')\nvar Stream = require('stream')\n\nisStream(new Stream()) // true\n\nisStream({}) // false\n\nisStream(new Stream.Readable()) // true\nisStream(new Stream.Writable()) // true\nisStream(new Stream.Duplex()) // true\nisStream(new Stream.Transform()) // true\nisStream(new Stream.PassThrough()) // true\n```\n\n## But wait! There's more!\n\nYou can also test for `isReadable(obj)`, `isWritable(obj)` and `isDuplex(obj)` to test for implementations of Streams2 (and Streams3) base classes.\n\n```js\nvar isReadable = require('isstream').isReadable\nvar isWritable = require('isstream').isWritable\nvar isDuplex = require('isstream').isDuplex\nvar Stream = require('stream')\n\nisReadable(new Stream()) // false\nisWritable(new Stream()) // false\nisDuplex(new Stream()) // false\n\nisReadable(new Stream.Readable()) // true\nisReadable(new Stream.Writable()) // false\nisReadable(new Stream.Duplex()) // true\nisReadable(new Stream.Transform()) // true\nisReadable(new Stream.PassThrough()) // true\n\nisWritable(new Stream.Readable()) // false\nisWritable(new Stream.Writable()) // true\nisWritable(new Stream.Duplex()) // true\nisWritable(new Stream.Transform()) // true\nisWritable(new Stream.PassThrough()) // true\n\nisDuplex(new Stream.Readable()) // false\nisDuplex(new Stream.Writable()) // false\nisDuplex(new Stream.Duplex()) // true\nisDuplex(new Stream.Transform()) // true\nisDuplex(new Stream.PassThrough()) // true\n```\n\n*Reminder: when implementing your own streams, please [use **readable-stream** rather than core streams](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).*\n\n\n## License\n\n**isStream** is Copyright (c) 2015 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.\n", + "readmeFilename": "README.md", "_id": "isstream@0.1.2", "_shasum": "47e63f7af55afa6f92e1500e690eb8b8529c099a", - "_from": "isstream@>=0.1.1 <0.2.0", - "_npmVersion": "2.6.1", - "_nodeVersion": "1.4.3", - "_npmUser": { - "name": "rvagg", - "email": "rod@vagg.org" - }, - "maintainers": [ - { - "name": "rvagg", - "email": "rod@vagg.org" - } - ], - "dist": { - "shasum": "47e63f7af55afa6f92e1500e690eb8b8529c099a", - "tarball": "http://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz" - }, - "directories": {}, "_resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "readme": "ERROR: No README data found!" + "_from": "isstream@>=0.1.2 <0.2.0" } diff --git a/deps/npm/node_modules/request/node_modules/isstream/test.js b/deps/npm/node_modules/request/node_modules/isstream/test.js index 8c950c55e6375f..881e70b3098ff7 100644 --- a/deps/npm/node_modules/request/node_modules/isstream/test.js +++ b/deps/npm/node_modules/request/node_modules/isstream/test.js @@ -163,6 +163,3 @@ testDuplex(true, 'ReadableStream11.PassThrough', new (ReadableStream11.PassThrou }) }) - - - diff --git a/deps/npm/node_modules/request/node_modules/json-stringify-safe/package.json b/deps/npm/node_modules/request/node_modules/json-stringify-safe/package.json index e3cbf9a7471c7d..f09f9d57168c19 100644 --- a/deps/npm/node_modules/request/node_modules/json-stringify-safe/package.json +++ b/deps/npm/node_modules/request/node_modules/json-stringify-safe/package.json @@ -38,31 +38,10 @@ "must": ">= 0.12 < 0.13", "sinon": ">= 1.12.2 < 2" }, - "gitHead": "3890dceab3ad14f8701e38ca74f38276abc76de5", + "readme": "# json-stringify-safe\n\nLike JSON.stringify, but doesn't throw on circular references.\n\n## Usage\n\nTakes the same arguments as `JSON.stringify`.\n\n```javascript\nvar stringify = require('json-stringify-safe');\nvar circularObj = {};\ncircularObj.circularRef = circularObj;\ncircularObj.list = [ circularObj, circularObj ];\nconsole.log(stringify(circularObj, null, 2));\n```\n\nOutput:\n\n```json\n{\n \"circularRef\": \"[Circular]\",\n \"list\": [\n \"[Circular]\",\n \"[Circular]\"\n ]\n}\n```\n\n## Details\n\n```\nstringify(obj, serializer, indent, decycler)\n```\n\nThe first three arguments are the same as to JSON.stringify. The last\nis an argument that's only used when the object has been seen already.\n\nThe default `decycler` function returns the string `'[Circular]'`.\nIf, for example, you pass in `function(k,v){}` (return nothing) then it\nwill prune cycles. If you pass in `function(k,v){ return {foo: 'bar'}}`,\nthen cyclical objects will always be represented as `{\"foo\":\"bar\"}` in\nthe result.\n\n```\nstringify.getSerialize(serializer, decycler)\n```\n\nReturns a serializer that can be used elsewhere. This is the actual\nfunction that's passed to JSON.stringify.\n\n**Note** that the function returned from `getSerialize` is stateful for now, so\ndo **not** use it more than once.\n", + "readmeFilename": "README.md", "_id": "json-stringify-safe@5.0.1", "_shasum": "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb", - "_from": "json-stringify-safe@>=5.0.0 <5.1.0", - "_npmVersion": "2.10.0", - "_nodeVersion": "2.0.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb", - "tarball": "http://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - }, - { - "name": "moll", - "email": "andri@dot.ee" - } - ], - "directories": {}, "_resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "readme": "ERROR: No README data found!" + "_from": "json-stringify-safe@>=5.0.1 <5.1.0" } diff --git a/deps/npm/node_modules/request/node_modules/mime-types/HISTORY.md b/deps/npm/node_modules/request/node_modules/mime-types/HISTORY.md index 3057e4940a22ad..61b54b4201e30b 100644 --- a/deps/npm/node_modules/request/node_modules/mime-types/HISTORY.md +++ b/deps/npm/node_modules/request/node_modules/mime-types/HISTORY.md @@ -1,3 +1,15 @@ +2.1.9 / 2016-01-06 +================== + + * deps: mime-db@~1.21.0 + - Add new mime types + +2.1.8 / 2015-11-30 +================== + + * deps: mime-db@~1.20.0 + - Add new mime types + 2.1.7 / 2015-09-20 ================== diff --git a/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md b/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md index 3088a726f620b8..41a667af5cd6e1 100644 --- a/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md +++ b/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md @@ -1,3 +1,35 @@ +1.21.0 / 2016-01-06 +=================== + + * Add `application/emergencycalldata.comment+xml` + * Add `application/emergencycalldata.deviceinfo+xml` + * Add `application/emergencycalldata.providerinfo+xml` + * Add `application/emergencycalldata.serviceinfo+xml` + * Add `application/emergencycalldata.subscriberinfo+xml` + * Add `application/vnd.filmit.zfc` + * Add `application/vnd.google-apps.document` + * Add `application/vnd.google-apps.presentation` + * Add `application/vnd.google-apps.spreadsheet` + * Add `application/vnd.mapbox-vector-tile` + * Add `application/vnd.ms-printdevicecapabilities+xml` + * Add `application/vnd.ms-windows.devicepairing` + * Add `application/vnd.ms-windows.nwprinting.oob` + * Add `application/vnd.tml` + * Add `audio/evs` + +1.20.0 / 2015-11-10 +=================== + + * Add `application/cdni` + * Add `application/csvm+json` + * Add `application/rfc+xml` + * Add `application/vnd.3gpp.access-transfer-events+xml` + * Add `application/vnd.3gpp.srvcc-ext+xml` + * Add `application/vnd.ms-windows.wsd.oob` + * Add `application/vnd.oxli.countgraph` + * Add `application/vnd.pagerduty+json` + * Add `text/x-suse-ymp` + 1.19.0 / 2015-09-17 =================== diff --git a/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/README.md b/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/README.md index 164cca0301af8c..7662440bb9f9a2 100644 --- a/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/README.md +++ b/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/README.md @@ -52,7 +52,7 @@ Each mime type has the following properties: - `iana` - [IANA-defined media types](http://www.iana.org/assignments/media-types/media-types.xhtml) - `nginx` - [nginx media types](http://hg.nginx.org/nginx/raw-file/default/conf/mime.types) - `.extensions[]` - known extensions associated with this mime type. -- `.compressible` - whether a file of this type is can be gzipped. +- `.compressible` - whether a file of this type can be gzipped. - `.charset` - the default charset associated with this type, if any. If unknown, every property could be `undefined`. diff --git a/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json b/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json index f5b1a8c5119640..412ba9ed65e1e0 100644 --- a/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json +++ b/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json @@ -158,6 +158,9 @@ "source": "iana", "extensions": ["cdmiq"] }, + "application/cdni": { + "source": "iana" + }, "application/cea": { "source": "iana" }, @@ -198,6 +201,10 @@ "application/cstadata+xml": { "source": "iana" }, + "application/csvm+json": { + "source": "iana", + "compressible": true + }, "application/cu-seeme": { "source": "apache", "extensions": ["cu"] @@ -277,6 +284,21 @@ "source": "iana", "compressible": false }, + "application/emergencycalldata.comment+xml": { + "source": "iana" + }, + "application/emergencycalldata.deviceinfo+xml": { + "source": "iana" + }, + "application/emergencycalldata.providerinfo+xml": { + "source": "iana" + }, + "application/emergencycalldata.serviceinfo+xml": { + "source": "iana" + }, + "application/emergencycalldata.subscriberinfo+xml": { + "source": "iana" + }, "application/emma+xml": { "source": "iana", "extensions": ["emma"] @@ -882,6 +904,9 @@ "source": "iana", "extensions": ["rld"] }, + "application/rfc+xml": { + "source": "iana" + }, "application/riscos": { "source": "iana" }, @@ -1157,6 +1182,9 @@ "application/vnd.3gpp-prose-pc3ch+xml": { "source": "iana" }, + "application/vnd.3gpp.access-transfer-events+xml": { + "source": "iana" + }, "application/vnd.3gpp.bsf+xml": { "source": "iana" }, @@ -1178,6 +1206,9 @@ "application/vnd.3gpp.sms": { "source": "iana" }, + "application/vnd.3gpp.srvcc-ext+xml": { + "source": "iana" + }, "application/vnd.3gpp.srvcc-info+xml": { "source": "iana" }, @@ -1842,6 +1873,9 @@ "application/vnd.ffsns": { "source": "iana" }, + "application/vnd.filmit.zfc": { + "source": "iana" + }, "application/vnd.fints": { "source": "iana" }, @@ -1974,6 +2008,18 @@ "source": "iana", "extensions": ["gmx"] }, + "application/vnd.google-apps.document": { + "compressible": false, + "extensions": ["gdoc"] + }, + "application/vnd.google-apps.presentation": { + "compressible": false, + "extensions": ["gslides"] + }, + "application/vnd.google-apps.spreadsheet": { + "compressible": false, + "extensions": ["gsheet"] + }, "application/vnd.google-earth.kml+xml": { "source": "iana", "compressible": true, @@ -2391,6 +2437,9 @@ "source": "iana", "extensions": ["portpkg"] }, + "application/vnd.mapbox-vector-tile": { + "source": "iana" + }, "application/vnd.marlin.drm.actiontoken+xml": { "source": "iana" }, @@ -2632,6 +2681,9 @@ "source": "iana", "extensions": ["potm"] }, + "application/vnd.ms-printdevicecapabilities+xml": { + "source": "iana" + }, "application/vnd.ms-printing.printticket+xml": { "source": "apache" }, @@ -2642,9 +2694,18 @@ "application/vnd.ms-tnef": { "source": "iana" }, + "application/vnd.ms-windows.devicepairing": { + "source": "iana" + }, + "application/vnd.ms-windows.nwprinting.oob": { + "source": "iana" + }, "application/vnd.ms-windows.printerpairing": { "source": "iana" }, + "application/vnd.ms-windows.wsd.oob": { + "source": "iana" + }, "application/vnd.ms-wmdrm.lic-chlg-req": { "source": "iana" }, @@ -3343,6 +3404,13 @@ "application/vnd.otps.ct-kip+xml": { "source": "iana" }, + "application/vnd.oxli.countgraph": { + "source": "iana" + }, + "application/vnd.pagerduty+json": { + "source": "iana", + "compressible": true + }, "application/vnd.palm": { "source": "iana", "extensions": ["pdb","pqa","oprc"] @@ -3796,6 +3864,9 @@ "application/vnd.tmd.mediaflex.api+xml": { "source": "iana" }, + "application/vnd.tml": { + "source": "iana" + }, "application/vnd.tmobile-livetv": { "source": "iana", "extensions": ["tmo"] @@ -4860,6 +4931,9 @@ "audio/evrcwb1": { "source": "iana" }, + "audio/evs": { + "source": "iana" + }, "audio/fwdred": { "source": "iana" }, @@ -6132,6 +6206,10 @@ "source": "apache", "extensions": ["sfv"] }, + "text/x-suse-ymp": { + "compressible": true, + "extensions": ["ymp"] + }, "text/x-uuencode": { "source": "apache", "extensions": ["uu"] diff --git a/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json b/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json index 2e3337b7cc981f..bb48d8cf5f291a 100644 --- a/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json +++ b/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json @@ -1,7 +1,40 @@ { - "name": "mime-db", - "description": "Media Type Database", - "version": "1.19.0", + "_args": [ + [ + "mime-db@~1.21.0", + "/Users/rebecca/code/npm/node_modules/request/node_modules/mime-types" + ] + ], + "_from": "mime-db@>=1.21.0 <1.22.0", + "_id": "mime-db@1.21.0", + "_inCache": true, + "_installable": true, + "_location": "/request/mime-types/mime-db", + "_npmUser": { + "email": "doug@somethingdoug.com", + "name": "dougwilson" + }, + "_npmVersion": "1.4.28", + "_phantomChildren": {}, + "_requested": { + "name": "mime-db", + "raw": "mime-db@~1.21.0", + "rawSpec": "~1.21.0", + "scope": null, + "spec": ">=1.21.0 <1.22.0", + "type": "range" + }, + "_requiredBy": [ + "/request/mime-types" + ], + "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.21.0.tgz", + "_shasum": "9b5239e3353cf6eb015a00d890261027c36d4bac", + "_shrinkwrap": null, + "_spec": "mime-db@~1.21.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/mime-types", + "bugs": { + "url": "https://github.com/jshttp/mime-db/issues" + }, "contributors": [ { "name": "Douglas Christopher Wilson", @@ -18,30 +51,26 @@ "url": "http://github.com/broofa" } ], - "license": "MIT", - "keywords": [ - "mime", - "db", - "type", - "types", - "database", - "charset", - "charsets" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/jshttp/mime-db.git" - }, + "dependencies": {}, + "description": "Media Type Database", "devDependencies": { - "bluebird": "2.10.0", + "bluebird": "3.1.1", "co": "4.6.0", "cogent": "1.0.1", - "csv-parse": "1.0.0", + "csv-parse": "1.0.1", "gnode": "0.1.1", - "istanbul": "0.3.20", + "istanbul": "0.4.1", "mocha": "1.21.5", - "raw-body": "2.1.3", - "stream-to-array": "2" + "raw-body": "2.1.5", + "stream-to-array": "2.2.0" + }, + "directories": {}, + "dist": { + "shasum": "9b5239e3353cf6eb015a00d890261027c36d4bac", + "tarball": "http://registry.npmjs.org/mime-db/-/mime-db-1.21.0.tgz" + }, + "engines": { + "node": ">= 0.6" }, "files": [ "HISTORY.md", @@ -50,30 +79,18 @@ "db.json", "index.js" ], - "engines": { - "node": ">= 0.6" - }, - "scripts": { - "build": "node scripts/build", - "fetch": "gnode scripts/fetch-apache && gnode scripts/fetch-iana && gnode scripts/fetch-nginx", - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", - "update": "npm run fetch && npm run build" - }, - "gitHead": "46a40f0524a01fb3075a7ecde92e8e04fc93d599", - "bugs": { - "url": "https://github.com/jshttp/mime-db/issues" - }, + "gitHead": "9ab92f0a912a602408a64db5741dfef6f82c597f", "homepage": "https://github.com/jshttp/mime-db", - "_id": "mime-db@1.19.0", - "_shasum": "496a18198a7ce8244534e25bb102b74fb420fd56", - "_from": "mime-db@>=1.19.0 <1.20.0", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "dougwilson", - "email": "doug@somethingdoug.com" - }, + "keywords": [ + "charset", + "charsets", + "database", + "db", + "mime", + "type", + "types" + ], + "license": "MIT", "maintainers": [ { "name": "jongleberry", @@ -84,11 +101,20 @@ "email": "doug@somethingdoug.com" } ], - "dist": { - "shasum": "496a18198a7ce8244534e25bb102b74fb420fd56", - "tarball": "http://registry.npmjs.org/mime-db/-/mime-db-1.19.0.tgz" + "name": "mime-db", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/mime-db.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.19.0.tgz", - "readme": "ERROR: No README data found!" + "scripts": { + "build": "node scripts/build", + "fetch": "gnode scripts/fetch-apache && gnode scripts/fetch-iana && gnode scripts/fetch-nginx", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", + "update": "npm run fetch && npm run build" + }, + "version": "1.21.0" } diff --git a/deps/npm/node_modules/request/node_modules/mime-types/package.json b/deps/npm/node_modules/request/node_modules/mime-types/package.json index 73e16dde1e0ee5..aba63f70e369dd 100644 --- a/deps/npm/node_modules/request/node_modules/mime-types/package.json +++ b/deps/npm/node_modules/request/node_modules/mime-types/package.json @@ -1,7 +1,41 @@ { - "name": "mime-types", - "description": "The ultimate javascript content-type utility.", - "version": "2.1.7", + "_args": [ + [ + "mime-types@~2.1.7", + "/Users/rebecca/code/npm/node_modules/request" + ] + ], + "_from": "mime-types@>=2.1.7 <2.2.0", + "_id": "mime-types@2.1.9", + "_inCache": true, + "_installable": true, + "_location": "/request/mime-types", + "_npmUser": { + "email": "doug@somethingdoug.com", + "name": "dougwilson" + }, + "_npmVersion": "1.4.28", + "_phantomChildren": {}, + "_requested": { + "name": "mime-types", + "raw": "mime-types@~2.1.7", + "rawSpec": "~2.1.7", + "scope": null, + "spec": ">=2.1.7 <2.2.0", + "type": "range" + }, + "_requiredBy": [ + "/request", + "/request/form-data" + ], + "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.9.tgz", + "_shasum": "dfb396764b5fdf75be34b1f4104bc3687fb635f8", + "_shrinkwrap": null, + "_spec": "mime-types@~2.1.7", + "_where": "/Users/rebecca/code/npm/node_modules/request", + "bugs": { + "url": "https://github.com/jshttp/mime-types/issues" + }, "contributors": [ { "name": "Douglas Christopher Wilson", @@ -18,48 +52,34 @@ "url": "http://jongleberry.com" } ], - "license": "MIT", - "keywords": [ - "mime", - "types" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/jshttp/mime-types.git" - }, "dependencies": { - "mime-db": "~1.19.0" + "mime-db": "~1.21.0" }, + "description": "The ultimate javascript content-type utility.", "devDependencies": { - "istanbul": "0.3.20", + "istanbul": "0.4.1", "mocha": "~1.21.5" }, + "directories": {}, + "dist": { + "shasum": "dfb396764b5fdf75be34b1f4104bc3687fb635f8", + "tarball": "http://registry.npmjs.org/mime-types/-/mime-types-2.1.9.tgz" + }, + "engines": { + "node": ">= 0.6" + }, "files": [ "HISTORY.md", "LICENSE", "index.js" ], - "engines": { - "node": ">= 0.6" - }, - "scripts": { - "test": "mocha --reporter spec test/test.js", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/test.js", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot test/test.js" - }, - "gitHead": "43f860c7df4a70246272194d601348865d550298", - "bugs": { - "url": "https://github.com/jshttp/mime-types/issues" - }, + "gitHead": "329f1c77e1a77c8fac59b15038e3808e9e314d96", "homepage": "https://github.com/jshttp/mime-types", - "_id": "mime-types@2.1.7", - "_shasum": "ff603970e3c731ef6f7f4df3c9a0f463a13c2755", - "_from": "mime-types@>=2.1.2 <2.2.0", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "dougwilson", - "email": "doug@somethingdoug.com" - }, + "keywords": [ + "mime", + "types" + ], + "license": "MIT", "maintainers": [ { "name": "jongleberry", @@ -74,11 +94,17 @@ "email": "doug@somethingdoug.com" } ], - "dist": { - "shasum": "ff603970e3c731ef6f7f4df3c9a0f463a13c2755", - "tarball": "http://registry.npmjs.org/mime-types/-/mime-types-2.1.7.tgz" + "name": "mime-types", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/mime-types.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.7.tgz", - "readme": "ERROR: No README data found!" + "scripts": { + "test": "mocha --reporter spec test/test.js", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/test.js", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot test/test.js" + }, + "version": "2.1.9" } diff --git a/deps/npm/node_modules/request/node_modules/node-uuid/.npmignore b/deps/npm/node_modules/request/node_modules/node-uuid/.npmignore index fd4f2b066b339e..8886139386e5da 100644 --- a/deps/npm/node_modules/request/node_modules/node-uuid/.npmignore +++ b/deps/npm/node_modules/request/node_modules/node-uuid/.npmignore @@ -1,2 +1,4 @@ node_modules .DS_Store +.nyc_output +coverage diff --git a/deps/npm/node_modules/request/node_modules/node-uuid/LICENSE.md b/deps/npm/node_modules/request/node_modules/node-uuid/LICENSE.md index 652609b37e009c..a43093bf321f2b 100644 --- a/deps/npm/node_modules/request/node_modules/node-uuid/LICENSE.md +++ b/deps/npm/node_modules/request/node_modules/node-uuid/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2010-2012 Robert Kieffer +Copyright (c) 2010-2012 Robert Kieffer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/deps/npm/node_modules/request/node_modules/node-uuid/README.md b/deps/npm/node_modules/request/node_modules/node-uuid/README.md index b7d04c94071085..5cd85550877331 100644 --- a/deps/npm/node_modules/request/node_modules/node-uuid/README.md +++ b/deps/npm/node_modules/request/node_modules/node-uuid/README.md @@ -7,7 +7,9 @@ Features: * Generate RFC4122 version 1 or version 4 UUIDs * Runs in node.js and all browsers. * Registered as a [ComponentJS](https://github.com/component/component) [component](https://github.com/component/component/wiki/Components) ('broofa/node-uuid'). -* Cryptographically strong random # generation on supporting platforms +* Cryptographically strong random # generation + * `crypto.randomBytes(n)` in node.js + * `window.crypto.getRandomValues(ta)` in [supported browsers](https://developer.mozilla.org/en-US/docs/Web/API/RandomSource/getRandomValues#Browser_Compatibility) * 1.1K minified and gzip'ed (Want something smaller? Check this [crazy shit](https://gist.github.com/982883) out! ) * [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html) * Comes with a Command Line Interface for generating uuids on the command line @@ -226,6 +228,15 @@ For browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid- ## Release notes +### 1.4.6 + +* Properly detect node crypto and whatwg crypto +* Workaround phantomjs/browserify bug +* Explicit check for `window` rather implicit this-global +* Issue warning if Math.random() is being used +* "use strict"; +* A few jshint / stylistic updates (=== and such) + ### 1.4.0 * Improved module context detection diff --git a/deps/npm/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu b/deps/npm/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu index a342fbbe04e9ac..fd597ab681ae10 100644 --- a/deps/npm/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu +++ b/deps/npm/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu @@ -1,14 +1,14 @@ #!/opt/local/bin/gnuplot -persist # -# +# # G N U P L O T # Version 4.4 patchlevel 3 # last modified March 2011 # System: Darwin 10.8.0 -# +# # Copyright (C) 1986-1993, 1998, 2004, 2007-2010 # Thomas Williams, Colin Kelley and many others -# +# # gnuplot home: http://www.gnuplot.info # faq, bugs, etc: type "help seeking-assistance" # immediate help: type "help" @@ -17,7 +17,7 @@ set terminal postscript eps noenhanced defaultplex \ leveldefault color colortext \ solid linewidth 1.2 butt noclip \ palfuncparam 2000,0.003 \ - "Helvetica" 14 + "Helvetica" 14 set output 'bench.eps' unset clip points set clip one @@ -38,7 +38,7 @@ set timefmt cb "%d/%m/%y,%H:%M" set boxwidth set style fill empty border set style rectangle back fc lt -3 fillstyle solid 1.00 border lt -1 -set style circle radius graph 0.02, first 0, 0 +set style circle radius graph 0.02, first 0, 0 set dummy x,y set format x "% g" set format y "% g" @@ -50,7 +50,7 @@ set angles radians unset grid set key title "" set key outside left top horizontal Right noreverse enhanced autotitles columnhead nobox -set key noinvert samplen 4 spacing 1 width 0 height 0 +set key noinvert samplen 4 spacing 1 width 0 height 0 set key maxcolumns 2 maxrows 0 unset label unset arrow @@ -107,10 +107,10 @@ set nox2tics set noy2tics set cbtics border in scale 1,0.5 mirror norotate offset character 0, 0, 0 set cbtics autofreq norangelimit -set title "" +set title "" set title offset character 0, 0, 0 font "" norotate -set timestamp bottom -set timestamp "" +set timestamp bottom +set timestamp "" set timestamp offset character 0, 0, 0 font "" norotate set rrange [ * : * ] noreverse nowriteback # (currently [8.98847e+307:-8.98847e+307] ) set autoscale rfixmin @@ -124,9 +124,9 @@ set autoscale ufixmax set vrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) set autoscale vfixmin set autoscale vfixmax -set xlabel "" +set xlabel "" set xlabel offset character 0, 0, 0 font "" textcolor lt -1 norotate -set x2label "" +set x2label "" set x2label offset character 0, 0, 0 font "" textcolor lt -1 norotate set xrange [ * : * ] noreverse nowriteback # (currently [-0.150000:3.15000] ) set autoscale xfixmin @@ -134,9 +134,9 @@ set autoscale xfixmax set x2range [ * : * ] noreverse nowriteback # (currently [0.00000:3.00000] ) set autoscale x2fixmin set autoscale x2fixmax -set ylabel "" +set ylabel "" set ylabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 -set y2label "" +set y2label "" set y2label offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 set yrange [ 0.00000 : 1.90000e+06 ] noreverse nowriteback # (currently [:] ) set autoscale yfixmin @@ -144,12 +144,12 @@ set autoscale yfixmax set y2range [ * : * ] noreverse nowriteback # (currently [0.00000:1.90000e+06] ) set autoscale y2fixmin set autoscale y2fixmax -set zlabel "" +set zlabel "" set zlabel offset character 0, 0, 0 font "" textcolor lt -1 norotate set zrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) set autoscale zfixmin set autoscale zfixmax -set cblabel "" +set cblabel "" set cblabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 set cbrange [ * : * ] noreverse nowriteback # (currently [8.98847e+307:-8.98847e+307] ) set autoscale cbfixmin @@ -162,12 +162,12 @@ set tmargin -1 set pm3d explicit at s set pm3d scansautomatic set pm3d interpolate 1,1 flush begin noftriangles nohidden3d corners2color mean -set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB +set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB set palette rgbformulae 7, 5, 15 set colorbox default set colorbox vertical origin screen 0.9, 0.2, 0 size screen 0.05, 0.6, 0 front bdefault -set loadpath -set fontpath +set loadpath +set fontpath set fit noerrorvariables GNUTERM = "aqua" plot 'bench_results.txt' using 2:xticlabel(1) w lp lw 2, '' using 3:xticlabel(1) w lp lw 2, '' using 4:xticlabel(1) w lp lw 2, '' using 5:xticlabel(1) w lp lw 2, '' using 6:xticlabel(1) w lp lw 2, '' using 7:xticlabel(1) w lp lw 2, '' using 8:xticlabel(1) w lp lw 2, '' using 9:xticlabel(1) w lp lw 2 diff --git a/deps/npm/node_modules/request/node_modules/node-uuid/bower.json b/deps/npm/node_modules/request/node_modules/node-uuid/bower.json index 1656dc8197a341..c0925e1906bd7c 100644 --- a/deps/npm/node_modules/request/node_modules/node-uuid/bower.json +++ b/deps/npm/node_modules/request/node_modules/node-uuid/bower.json @@ -1,6 +1,6 @@ { "name": "node-uuid", - "version": "1.4.3", + "version": "1.4.7", "homepage": "https://github.com/broofa/node-uuid", "authors": [ "Robert Kieffer " diff --git a/deps/npm/node_modules/request/node_modules/node-uuid/component.json b/deps/npm/node_modules/request/node_modules/node-uuid/component.json index 149f84b22bec4f..3ff463366e7818 100644 --- a/deps/npm/node_modules/request/node_modules/node-uuid/component.json +++ b/deps/npm/node_modules/request/node_modules/node-uuid/component.json @@ -2,12 +2,19 @@ "name": "node-uuid", "repo": "broofa/node-uuid", "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", - "version": "1.4.3", + "version": "1.4.7", "author": "Robert Kieffer ", "contributors": [ - {"name": "Christoph Tavan ", "github": "https://github.com/ctavan"} + { + "name": "Christoph Tavan ", + "github": "https://github.com/ctavan" + } + ], + "keywords": [ + "uuid", + "guid", + "rfc4122" ], - "keywords": ["uuid", "guid", "rfc4122"], "dependencies": {}, "development": {}, "main": "uuid.js", @@ -15,4 +22,4 @@ "uuid.js" ], "license": "MIT" -} +} \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/node-uuid/package.json b/deps/npm/node_modules/request/node_modules/node-uuid/package.json index 4aa75044ada392..44c585893f7f49 100644 --- a/deps/npm/node_modules/request/node_modules/node-uuid/package.json +++ b/deps/npm/node_modules/request/node_modules/node-uuid/package.json @@ -1,65 +1,105 @@ { - "name": "node-uuid", - "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", - "url": "http://github.com/broofa/node-uuid", - "keywords": [ - "uuid", - "guid", - "rfc4122" + "_args": [ + [ + "node-uuid@~1.4.7", + "/Users/ogd/Documents/projects/npm/npm/node_modules/request" + ] ], + "_from": "node-uuid@>=1.4.7 <1.5.0", + "_id": "node-uuid@1.4.7", + "_inCache": true, + "_installable": true, + "_location": "/request/node-uuid", + "_nodeVersion": "5.0.0", + "_npmUser": { + "email": "coolaj86@gmail.com", + "name": "coolaj86" + }, + "_npmVersion": "3.3.6", + "_phantomChildren": {}, + "_requested": { + "name": "node-uuid", + "raw": "node-uuid@~1.4.7", + "rawSpec": "~1.4.7", + "scope": null, + "spec": ">=1.4.7 <1.5.0", + "type": "range" + }, + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz", + "_shasum": "6da5a17668c4b3dd59623bda11cf7fa4c1f60a6f", + "_shrinkwrap": null, + "_spec": "node-uuid@~1.4.7", + "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request", "author": { - "name": "Robert Kieffer", - "email": "robert@broofa.com" + "email": "robert@broofa.com", + "name": "Robert Kieffer" + }, + "bin": { + "uuid": "./bin/uuid" + }, + "bugs": { + "url": "https://github.com/broofa/node-uuid/issues" }, "contributors": [ + { + "name": "AJ ONeal", + "email": "coolaj86@gmail.com" + }, { "name": "Christoph Tavan", "email": "dev@tavan.de" } ], - "bin": { - "uuid": "./bin/uuid" + "dependencies": {}, + "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", + "devDependencies": { + "nyc": "^2.2.0" }, - "scripts": { - "test": "node test/test.js" + "directories": {}, + "dist": { + "shasum": "6da5a17668c4b3dd59623bda11cf7fa4c1f60a6f", + "tarball": "http://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz" }, + "gitHead": "309512573ec1c60143c257157479a20f7f1f51cd", + "homepage": "https://github.com/broofa/node-uuid", + "installable": true, + "keywords": [ + "guid", + "rfc4122", + "uuid" + ], "lib": ".", - "main": "./uuid.js", - "repository": { - "type": "git", - "url": "git+https://github.com/broofa/node-uuid.git" - }, - "version": "1.4.3", "licenses": [ { "type": "MIT", "url": "https://raw.github.com/broofa/node-uuid/master/LICENSE.md" } ], - "gitHead": "886463c660a095dfebfa69603921a8d156fdb12c", - "bugs": { - "url": "https://github.com/broofa/node-uuid/issues" - }, - "homepage": "https://github.com/broofa/node-uuid", - "_id": "node-uuid@1.4.3", - "_shasum": "319bb7a56e7cb63f00b5c0cd7851cd4b4ddf1df9", - "_from": "node-uuid@>=1.4.0 <1.5.0", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "broofa", - "email": "robert@broofa.com" - }, + "main": "./uuid.js", "maintainers": [ { "name": "broofa", "email": "robert@broofa.com" + }, + { + "name": "coolaj86", + "email": "coolaj86@gmail.com" } ], - "dist": { - "shasum": "319bb7a56e7cb63f00b5c0cd7851cd4b4ddf1df9", - "tarball": "http://registry.npmjs.org/node-uuid/-/node-uuid-1.4.3.tgz" + "name": "node-uuid", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/broofa/node-uuid.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.3.tgz", - "readme": "ERROR: No README data found!" + "scripts": { + "coverage": "nyc npm test && nyc report", + "test": "node test/test.js" + }, + "url": "http://github.com/broofa/node-uuid", + "version": "1.4.7" } diff --git a/deps/npm/node_modules/request/node_modules/node-uuid/test/test.js b/deps/npm/node_modules/request/node_modules/node-uuid/test/test.js index 24692256161c4c..5f1113d85727ae 100644 --- a/deps/npm/node_modules/request/node_modules/node-uuid/test/test.js +++ b/deps/npm/node_modules/request/node_modules/node-uuid/test/test.js @@ -1,6 +1,9 @@ if (!this.uuid) { // node.js uuid = require('../uuid'); + if (!/_rb/.test(uuid._rng.toString())) { + throw new Error("should use crypto for node.js"); + } } // diff --git a/deps/npm/node_modules/request/node_modules/node-uuid/uuid.js b/deps/npm/node_modules/request/node_modules/node-uuid/uuid.js index 0a617697969af7..89c5b8fb613948 100644 --- a/deps/npm/node_modules/request/node_modules/node-uuid/uuid.js +++ b/deps/npm/node_modules/request/node_modules/node-uuid/uuid.js @@ -3,53 +3,74 @@ // Copyright (c) 2010-2012 Robert Kieffer // MIT License - http://opensource.org/licenses/mit-license.php -(function() { - var _global = this; +/*global window, require, define */ +(function(_window) { + 'use strict'; // Unique ID creation requires a high quality random # generator. We feature // detect to determine the best RNG source, normalizing to a function that // returns 128-bits of randomness, since that's what's usually required - var _rng; + var _rng, _mathRNG, _nodeRNG, _whatwgRNG, _previousRoot; + + function setupBrowser() { + // Allow for MSIE11 msCrypto + var _crypto = _window.crypto || _window.msCrypto; + + if (!_rng && _crypto && _crypto.getRandomValues) { + // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto + // + // Moderately fast, high quality + try { + var _rnds8 = new Uint8Array(16); + _whatwgRNG = _rng = function whatwgRNG() { + _crypto.getRandomValues(_rnds8); + return _rnds8; + }; + _rng(); + } catch(e) {} + } - // Node.js crypto-based RNG - http://nodejs.org/docs/v0.6.2/api/crypto.html - // - // Moderately fast, high quality - if (typeof(_global.require) == 'function') { - try { - var _rb = _global.require('crypto').randomBytes; - _rng = _rb && function() {return _rb(16);}; - } catch(e) {} + if (!_rng) { + // Math.random()-based (RNG) + // + // If all else fails, use Math.random(). It's fast, but is of unspecified + // quality. + var _rnds = new Array(16); + _mathRNG = _rng = function() { + for (var i = 0, r; i < 16; i++) { + if ((i & 0x03) === 0) { r = Math.random() * 0x100000000; } + _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff; + } + + return _rnds; + }; + if ('undefined' !== typeof console && console.warn) { + console.warn("[SECURITY] node-uuid: crypto not usable, falling back to insecure Math.random()"); + } + } } - if (!_rng && _global.crypto && crypto.getRandomValues) { - // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto + function setupNode() { + // Node.js crypto-based RNG - http://nodejs.org/docs/v0.6.2/api/crypto.html // // Moderately fast, high quality - var _rnds8 = new Uint8Array(16); - _rng = function whatwgRNG() { - crypto.getRandomValues(_rnds8); - return _rnds8; - }; + if ('function' === typeof require) { + try { + var _rb = require('crypto').randomBytes; + _nodeRNG = _rng = _rb && function() {return _rb(16);}; + _rng(); + } catch(e) {} + } } - if (!_rng) { - // Math.random()-based (RNG) - // - // If all else fails, use Math.random(). It's fast, but is of unspecified - // quality. - var _rnds = new Array(16); - _rng = function() { - for (var i = 0, r; i < 16; i++) { - if ((i & 0x03) === 0) r = Math.random() * 0x100000000; - _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff; - } - - return _rnds; - }; + if (_window) { + setupBrowser(); + } else { + setupNode(); } // Buffer class to use - var BufferClass = typeof(_global.Buffer) == 'function' ? _global.Buffer : Array; + var BufferClass = ('function' === typeof Buffer) ? Buffer : Array; // Maps for number <-> hex string conversion var _byteToHex = []; @@ -118,17 +139,17 @@ options = options || {}; - var clockseq = options.clockseq != null ? options.clockseq : _clockseq; + var clockseq = (options.clockseq != null) ? options.clockseq : _clockseq; // UUID timestamps are 100 nano-second units since the Gregorian epoch, // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. - var msecs = options.msecs != null ? options.msecs : new Date().getTime(); + var msecs = (options.msecs != null) ? options.msecs : new Date().getTime(); // Per 4.2.1.2, use count of uuid's generated during the current clock // cycle to simulate higher resolution clock - var nsecs = options.nsecs != null ? options.nsecs : _lastNSecs + 1; + var nsecs = (options.nsecs != null) ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; @@ -194,8 +215,8 @@ // Deprecated - 'format' argument, as supported in v1.2 var i = buf && offset || 0; - if (typeof(options) == 'string') { - buf = options == 'binary' ? new BufferClass(16) : null; + if (typeof(options) === 'string') { + buf = (options === 'binary') ? new BufferClass(16) : null; options = null; } options = options || {}; @@ -223,25 +244,29 @@ uuid.parse = parse; uuid.unparse = unparse; uuid.BufferClass = BufferClass; + uuid._rng = _rng; + uuid._mathRNG = _mathRNG; + uuid._nodeRNG = _nodeRNG; + uuid._whatwgRNG = _whatwgRNG; - if (typeof(module) != 'undefined' && module.exports) { + if (('undefined' !== typeof module) && module.exports) { // Publish as node.js module module.exports = uuid; - } else if (typeof define === 'function' && define.amd) { + } else if (typeof define === 'function' && define.amd) { // Publish as AMD module define(function() {return uuid;}); - + } else { // Publish as global (in browsers) - var _previousRoot = _global.uuid; + _previousRoot = _window.uuid; // **`noConflict()` - (browser only) to reset global 'uuid' var** uuid.noConflict = function() { - _global.uuid = _previousRoot; + _window.uuid = _previousRoot; return uuid; }; - _global.uuid = uuid; + _window.uuid = uuid; } -}).call(this); +})('undefined' !== typeof window ? window : null); diff --git a/deps/npm/node_modules/request/node_modules/oauth-sign/README.md b/deps/npm/node_modules/request/node_modules/oauth-sign/README.md index 34c4a85d2dde05..af496148e4815a 100644 --- a/deps/npm/node_modules/request/node_modules/oauth-sign/README.md +++ b/deps/npm/node_modules/request/node_modules/oauth-sign/README.md @@ -1,4 +1,4 @@ oauth-sign ========== -OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module. +OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module. diff --git a/deps/npm/node_modules/request/node_modules/oauth-sign/index.js b/deps/npm/node_modules/request/node_modules/oauth-sign/index.js index a587541dc577e6..5a70f3f8cdc43b 100644 --- a/deps/npm/node_modules/request/node_modules/oauth-sign/index.js +++ b/deps/npm/node_modules/request/node_modules/oauth-sign/index.js @@ -45,7 +45,7 @@ function compare (a, b) { } function generateBase (httpMethod, base_uri, params) { - // adapted from https://dev.twitter.com/docs/auth/oauth and + // adapted from https://dev.twitter.com/docs/auth/oauth and // https://dev.twitter.com/docs/auth/creating-signature // Parameter normalization diff --git a/deps/npm/node_modules/request/node_modules/oauth-sign/test.js b/deps/npm/node_modules/request/node_modules/oauth-sign/test.js index a8847270df5e3b..4cd02b8aa21967 100644 --- a/deps/npm/node_modules/request/node_modules/oauth-sign/test.js +++ b/deps/npm/node_modules/request/node_modules/oauth-sign/test.js @@ -6,7 +6,7 @@ var oauth = require('./index') // Tests from Twitter documentation https://dev.twitter.com/docs/auth/oauth -var reqsign = hmacsign('POST', 'https://api.twitter.com/oauth/request_token', +var reqsign = hmacsign('POST', 'https://api.twitter.com/oauth/request_token', { oauth_callback: 'http://localhost:3005/the_dance/process_callback?service_provider_id=11' , oauth_consumer_key: 'GDdmIQH6jhtmLUypg82g' , oauth_nonce: 'QP70eNmVz8jvdPevU3oJD2AfF7R7odC2XJcn4XlZJqk' @@ -28,12 +28,12 @@ var accsign = hmacsign('POST', 'https://api.twitter.com/oauth/access_token', , oauth_verifier: 'pDNg57prOHapMbhv25RNf75lVRd6JDsni1AJJIDYoTY' , oauth_version: '1.0' }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "x6qpRnlEmW9JbQn4PQVVeVG8ZLPEx6A0TOebgwcuA") - + console.log(accsign) console.log('PUw/dHA4fnlJYM6RhXk5IU/0fCc=') assert.equal(accsign, 'PUw/dHA4fnlJYM6RhXk5IU/0fCc=') -var upsign = hmacsign('POST', 'http://api.twitter.com/1/statuses/update.json', +var upsign = hmacsign('POST', 'http://api.twitter.com/1/statuses/update.json', { oauth_consumer_key: "GDdmIQH6jhtmLUypg82g" , oauth_nonce: "oElnnMTQIZvqvlfXM56aBLAf5noGD0AQR3Fmi7Q6Y" , oauth_signature_method: "HMAC-SHA1" diff --git a/deps/npm/node_modules/request/node_modules/qs/.travis.yml b/deps/npm/node_modules/request/node_modules/qs/.travis.yml index 7a64dd2210cb10..63bdc12bebd6b9 100644 --- a/deps/npm/node_modules/request/node_modules/qs/.travis.yml +++ b/deps/npm/node_modules/request/node_modules/qs/.travis.yml @@ -1,7 +1,69 @@ language: node_js - node_js: - - 0.10 - - 4.0 - + - "5.3" + - "5.2" + - "5.1" + - "5.0" + - "4.2" + - "4.1" + - "4.0" + - "iojs-v3.3" + - "iojs-v3.2" + - "iojs-v3.1" + - "iojs-v3.0" + - "iojs-v2.5" + - "iojs-v2.4" + - "iojs-v2.3" + - "iojs-v2.2" + - "iojs-v2.1" + - "iojs-v2.0" + - "iojs-v1.8" + - "iojs-v1.7" + - "iojs-v1.6" + - "iojs-v1.5" + - "iojs-v1.4" + - "iojs-v1.3" + - "iojs-v1.2" + - "iojs-v1.1" + - "iojs-v1.0" + - "0.12" + - "0.11" + - "0.10" + - "0.9" + - "0.8" + - "0.6" + - "0.4" +before_install: + - 'if [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi' + - 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then npm install -g npm; fi' +script: + - 'if [ "${TRAVIS_NODE_VERSION}" != "4.2" ]; then npm run tests-only ; else npm test ; fi' sudo: false +matrix: + fast_finish: true + allow_failures: + - node_js: "5.2" + - node_js: "5.1" + - node_js: "5.0" + - node_js: "4.1" + - node_js: "4.0" + - node_js: "iojs-v3.2" + - node_js: "iojs-v3.1" + - node_js: "iojs-v3.0" + - node_js: "iojs-v2.4" + - node_js: "iojs-v2.3" + - node_js: "iojs-v2.2" + - node_js: "iojs-v2.1" + - node_js: "iojs-v2.0" + - node_js: "iojs-v1.7" + - node_js: "iojs-v1.6" + - node_js: "iojs-v1.5" + - node_js: "iojs-v1.4" + - node_js: "iojs-v1.3" + - node_js: "iojs-v1.2" + - node_js: "iojs-v1.1" + - node_js: "iojs-v1.0" + - node_js: "0.11" + - node_js: "0.9" + - node_js: "0.6" + - node_js: "0.4" diff --git a/deps/npm/node_modules/request/node_modules/qs/CHANGELOG.md b/deps/npm/node_modules/request/node_modules/qs/CHANGELOG.md index e43b1aceb32920..2df5e9d3783b5b 100644 --- a/deps/npm/node_modules/request/node_modules/qs/CHANGELOG.md +++ b/deps/npm/node_modules/request/node_modules/qs/CHANGELOG.md @@ -1,99 +1,110 @@ +## [**6.0.2**](https://github.com/ljharb/qs/issues?milestone=33&state=closed) +- Revert ES6 requirement and restore support for node down to v0.8. -## [**5.1.0**](https://github.com/hapijs/qs/issues?milestone=29&state=open) -- [**#117**](https://github.com/hapijs/qs/issues/117) make URI encoding stringified results optional -- [**#106**](https://github.com/hapijs/qs/issues/106) Add flag `skipNulls` to optionally skip null values in stringify +## [**6.0.1**](https://github.com/ljharb/qs/issues?milestone=32&state=closed) +- [**#127**](https://github.com/ljharb/qs/pull/127) Fix engines definition in package.json -## [**5.0.0**](https://github.com/hapijs/qs/issues?milestone=28&state=closed) -- [**#114**](https://github.com/hapijs/qs/issues/114) default allowDots to false -- [**#100**](https://github.com/hapijs/qs/issues/100) include dist to npm +## [**6.0.0**](https://github.com/ljharb/qs/issues?milestone=31&state=closed) +- [**#124**](https://github.com/ljharb/qs/issues/124) Use ES6 and drop support for node < v4 -## [**4.0.0**](https://github.com/hapijs/qs/issues?milestone=26&state=closed) -- [**#98**](https://github.com/hapijs/qs/issues/98) make returning plain objects and allowing prototype overwriting properties optional +## [**5.2.0**](https://github.com/ljharb/qs/issues?milestone=30&state=closed) +- [**#64**](https://github.com/ljharb/qs/issues/64) Add option to sort object keys in the query string -## [**3.1.0**](https://github.com/hapijs/qs/issues?milestone=24&state=closed) -- [**#89**](https://github.com/hapijs/qs/issues/89) Add option to disable "Transform dot notation to bracket notation" +## [**5.1.0**](https://github.com/ljharb/qs/issues?milestone=29&state=closed) +- [**#117**](https://github.com/ljharb/qs/issues/117) make URI encoding stringified results optional +- [**#106**](https://github.com/ljharb/qs/issues/106) Add flag `skipNulls` to optionally skip null values in stringify -## [**3.0.0**](https://github.com/hapijs/qs/issues?milestone=23&state=closed) -- [**#80**](https://github.com/hapijs/qs/issues/80) qs.parse silently drops properties -- [**#77**](https://github.com/hapijs/qs/issues/77) Perf boost -- [**#60**](https://github.com/hapijs/qs/issues/60) Add explicit option to disable array parsing -- [**#74**](https://github.com/hapijs/qs/issues/74) Bad parse when turning array into object -- [**#81**](https://github.com/hapijs/qs/issues/81) Add a `filter` option -- [**#68**](https://github.com/hapijs/qs/issues/68) Fixed issue with recursion and passing strings into objects. -- [**#66**](https://github.com/hapijs/qs/issues/66) Add mixed array and object dot notation support Closes: #47 -- [**#76**](https://github.com/hapijs/qs/issues/76) RFC 3986 -- [**#85**](https://github.com/hapijs/qs/issues/85) No equal sign -- [**#84**](https://github.com/hapijs/qs/issues/84) update license attribute +## [**5.0.0**](https://github.com/ljharb/qs/issues?milestone=28&state=closed) +- [**#114**](https://github.com/ljharb/qs/issues/114) default allowDots to false +- [**#100**](https://github.com/ljharb/qs/issues/100) include dist to npm -## [**2.4.1**](https://github.com/hapijs/qs/issues?milestone=20&state=closed) -- [**#73**](https://github.com/hapijs/qs/issues/73) Property 'hasOwnProperty' of object # is not a function +## [**4.0.0**](https://github.com/ljharb/qs/issues?milestone=26&state=closed) +- [**#98**](https://github.com/ljharb/qs/issues/98) make returning plain objects and allowing prototype overwriting properties optional -## [**2.4.0**](https://github.com/hapijs/qs/issues?milestone=19&state=closed) -- [**#70**](https://github.com/hapijs/qs/issues/70) Add arrayFormat option +## [**3.1.0**](https://github.com/ljharb/qs/issues?milestone=24&state=closed) +- [**#89**](https://github.com/ljharb/qs/issues/89) Add option to disable "Transform dot notation to bracket notation" -## [**2.3.3**](https://github.com/hapijs/qs/issues?milestone=18&state=closed) -- [**#59**](https://github.com/hapijs/qs/issues/59) make sure array indexes are >= 0, closes #57 -- [**#58**](https://github.com/hapijs/qs/issues/58) make qs usable for browser loader +## [**3.0.0**](https://github.com/ljharb/qs/issues?milestone=23&state=closed) +- [**#80**](https://github.com/ljharb/qs/issues/80) qs.parse silently drops properties +- [**#77**](https://github.com/ljharb/qs/issues/77) Perf boost +- [**#60**](https://github.com/ljharb/qs/issues/60) Add explicit option to disable array parsing +- [**#74**](https://github.com/ljharb/qs/issues/74) Bad parse when turning array into object +- [**#81**](https://github.com/ljharb/qs/issues/81) Add a `filter` option +- [**#68**](https://github.com/ljharb/qs/issues/68) Fixed issue with recursion and passing strings into objects. +- [**#66**](https://github.com/ljharb/qs/issues/66) Add mixed array and object dot notation support Closes: #47 +- [**#76**](https://github.com/ljharb/qs/issues/76) RFC 3986 +- [**#85**](https://github.com/ljharb/qs/issues/85) No equal sign +- [**#84**](https://github.com/ljharb/qs/issues/84) update license attribute -## [**2.3.2**](https://github.com/hapijs/qs/issues?milestone=17&state=closed) -- [**#55**](https://github.com/hapijs/qs/issues/55) allow merging a string into an object +## [**2.4.1**](https://github.com/ljharb/qs/issues?milestone=20&state=closed) +- [**#73**](https://github.com/ljharb/qs/issues/73) Property 'hasOwnProperty' of object # is not a function -## [**2.3.1**](https://github.com/hapijs/qs/issues?milestone=16&state=closed) -- [**#52**](https://github.com/hapijs/qs/issues/52) Return "undefined" and "false" instead of throwing "TypeError". +## [**2.4.0**](https://github.com/ljharb/qs/issues?milestone=19&state=closed) +- [**#70**](https://github.com/ljharb/qs/issues/70) Add arrayFormat option -## [**2.3.0**](https://github.com/hapijs/qs/issues?milestone=15&state=closed) -- [**#50**](https://github.com/hapijs/qs/issues/50) add option to omit array indices, closes #46 +## [**2.3.3**](https://github.com/ljharb/qs/issues?milestone=18&state=closed) +- [**#59**](https://github.com/ljharb/qs/issues/59) make sure array indexes are >= 0, closes #57 +- [**#58**](https://github.com/ljharb/qs/issues/58) make qs usable for browser loader -## [**2.2.5**](https://github.com/hapijs/qs/issues?milestone=14&state=closed) -- [**#39**](https://github.com/hapijs/qs/issues/39) Is there an alternative to Buffer.isBuffer? -- [**#49**](https://github.com/hapijs/qs/issues/49) refactor utils.merge, fixes #45 -- [**#41**](https://github.com/hapijs/qs/issues/41) avoid browserifying Buffer, for #39 +## [**2.3.2**](https://github.com/ljharb/qs/issues?milestone=17&state=closed) +- [**#55**](https://github.com/ljharb/qs/issues/55) allow merging a string into an object -## [**2.2.4**](https://github.com/hapijs/qs/issues?milestone=13&state=closed) -- [**#38**](https://github.com/hapijs/qs/issues/38) how to handle object keys beginning with a number +## [**2.3.1**](https://github.com/ljharb/qs/issues?milestone=16&state=closed) +- [**#52**](https://github.com/ljharb/qs/issues/52) Return "undefined" and "false" instead of throwing "TypeError". -## [**2.2.3**](https://github.com/hapijs/qs/issues?milestone=12&state=closed) -- [**#37**](https://github.com/hapijs/qs/issues/37) parser discards first empty value in array -- [**#36**](https://github.com/hapijs/qs/issues/36) Update to lab 4.x +## [**2.3.0**](https://github.com/ljharb/qs/issues?milestone=15&state=closed) +- [**#50**](https://github.com/ljharb/qs/issues/50) add option to omit array indices, closes #46 -## [**2.2.2**](https://github.com/hapijs/qs/issues?milestone=11&state=closed) -- [**#33**](https://github.com/hapijs/qs/issues/33) Error when plain object in a value -- [**#34**](https://github.com/hapijs/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty -- [**#24**](https://github.com/hapijs/qs/issues/24) Changelog? Semver? +## [**2.2.5**](https://github.com/ljharb/qs/issues?milestone=14&state=closed) +- [**#39**](https://github.com/ljharb/qs/issues/39) Is there an alternative to Buffer.isBuffer? +- [**#49**](https://github.com/ljharb/qs/issues/49) refactor utils.merge, fixes #45 +- [**#41**](https://github.com/ljharb/qs/issues/41) avoid browserifying Buffer, for #39 -## [**2.2.1**](https://github.com/hapijs/qs/issues?milestone=10&state=closed) -- [**#32**](https://github.com/hapijs/qs/issues/32) account for circular references properly, closes #31 -- [**#31**](https://github.com/hapijs/qs/issues/31) qs.parse stackoverflow on circular objects +## [**2.2.4**](https://github.com/ljharb/qs/issues?milestone=13&state=closed) +- [**#38**](https://github.com/ljharb/qs/issues/38) how to handle object keys beginning with a number -## [**2.2.0**](https://github.com/hapijs/qs/issues?milestone=9&state=closed) -- [**#26**](https://github.com/hapijs/qs/issues/26) Don't use Buffer global if it's not present -- [**#30**](https://github.com/hapijs/qs/issues/30) Bug when merging non-object values into arrays -- [**#29**](https://github.com/hapijs/qs/issues/29) Don't call Utils.clone at the top of Utils.merge -- [**#23**](https://github.com/hapijs/qs/issues/23) Ability to not limit parameters? +## [**2.2.3**](https://github.com/ljharb/qs/issues?milestone=12&state=closed) +- [**#37**](https://github.com/ljharb/qs/issues/37) parser discards first empty value in array +- [**#36**](https://github.com/ljharb/qs/issues/36) Update to lab 4.x -## [**2.1.0**](https://github.com/hapijs/qs/issues?milestone=8&state=closed) -- [**#22**](https://github.com/hapijs/qs/issues/22) Enable using a RegExp as delimiter +## [**2.2.2**](https://github.com/ljharb/qs/issues?milestone=11&state=closed) +- [**#33**](https://github.com/ljharb/qs/issues/33) Error when plain object in a value +- [**#34**](https://github.com/ljharb/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty +- [**#24**](https://github.com/ljharb/qs/issues/24) Changelog? Semver? -## [**2.0.0**](https://github.com/hapijs/qs/issues?milestone=7&state=closed) -- [**#18**](https://github.com/hapijs/qs/issues/18) Why is there arrayLimit? -- [**#20**](https://github.com/hapijs/qs/issues/20) Configurable parametersLimit -- [**#21**](https://github.com/hapijs/qs/issues/21) make all limits optional, for #18, for #20 +## [**2.2.1**](https://github.com/ljharb/qs/issues?milestone=10&state=closed) +- [**#32**](https://github.com/ljharb/qs/issues/32) account for circular references properly, closes #31 +- [**#31**](https://github.com/ljharb/qs/issues/31) qs.parse stackoverflow on circular objects -## [**1.2.2**](https://github.com/hapijs/qs/issues?milestone=6&state=closed) -- [**#19**](https://github.com/hapijs/qs/issues/19) Don't overwrite null values +## [**2.2.0**](https://github.com/ljharb/qs/issues?milestone=9&state=closed) +- [**#26**](https://github.com/ljharb/qs/issues/26) Don't use Buffer global if it's not present +- [**#30**](https://github.com/ljharb/qs/issues/30) Bug when merging non-object values into arrays +- [**#29**](https://github.com/ljharb/qs/issues/29) Don't call Utils.clone at the top of Utils.merge +- [**#23**](https://github.com/ljharb/qs/issues/23) Ability to not limit parameters? -## [**1.2.1**](https://github.com/hapijs/qs/issues?milestone=5&state=closed) -- [**#16**](https://github.com/hapijs/qs/issues/16) ignore non-string delimiters -- [**#15**](https://github.com/hapijs/qs/issues/15) Close code block +## [**2.1.0**](https://github.com/ljharb/qs/issues?milestone=8&state=closed) +- [**#22**](https://github.com/ljharb/qs/issues/22) Enable using a RegExp as delimiter -## [**1.2.0**](https://github.com/hapijs/qs/issues?milestone=4&state=closed) -- [**#12**](https://github.com/hapijs/qs/issues/12) Add optional delim argument -- [**#13**](https://github.com/hapijs/qs/issues/13) fix #11: flattened keys in array are now correctly parsed +## [**2.0.0**](https://github.com/ljharb/qs/issues?milestone=7&state=closed) +- [**#18**](https://github.com/ljharb/qs/issues/18) Why is there arrayLimit? +- [**#20**](https://github.com/ljharb/qs/issues/20) Configurable parametersLimit +- [**#21**](https://github.com/ljharb/qs/issues/21) make all limits optional, for #18, for #20 -## [**1.1.0**](https://github.com/hapijs/qs/issues?milestone=3&state=closed) -- [**#7**](https://github.com/hapijs/qs/issues/7) Empty values of a POST array disappear after being submitted -- [**#9**](https://github.com/hapijs/qs/issues/9) Should not omit equals signs (=) when value is null -- [**#6**](https://github.com/hapijs/qs/issues/6) Minor grammar fix in README +## [**1.2.2**](https://github.com/ljharb/qs/issues?milestone=6&state=closed) +- [**#19**](https://github.com/ljharb/qs/issues/19) Don't overwrite null values -## [**1.0.2**](https://github.com/hapijs/qs/issues?milestone=2&state=closed) -- [**#5**](https://github.com/hapijs/qs/issues/5) array holes incorrectly copied into object on large index +## [**1.2.1**](https://github.com/ljharb/qs/issues?milestone=5&state=closed) +- [**#16**](https://github.com/ljharb/qs/issues/16) ignore non-string delimiters +- [**#15**](https://github.com/ljharb/qs/issues/15) Close code block + +## [**1.2.0**](https://github.com/ljharb/qs/issues?milestone=4&state=closed) +- [**#12**](https://github.com/ljharb/qs/issues/12) Add optional delim argument +- [**#13**](https://github.com/ljharb/qs/issues/13) fix #11: flattened keys in array are now correctly parsed + +## [**1.1.0**](https://github.com/ljharb/qs/issues?milestone=3&state=closed) +- [**#7**](https://github.com/ljharb/qs/issues/7) Empty values of a POST array disappear after being submitted +- [**#9**](https://github.com/ljharb/qs/issues/9) Should not omit equals signs (=) when value is null +- [**#6**](https://github.com/ljharb/qs/issues/6) Minor grammar fix in README + +## [**1.0.2**](https://github.com/ljharb/qs/issues?milestone=2&state=closed) +- [**#5**](https://github.com/ljharb/qs/issues/5) array holes incorrectly copied into object on large index diff --git a/deps/npm/node_modules/request/node_modules/qs/README.md b/deps/npm/node_modules/request/node_modules/qs/README.md new file mode 100644 index 00000000000000..335eafb4be5a72 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/qs/README.md @@ -0,0 +1,335 @@ +# qs + +A querystring parsing and stringifying library with some added security. + +[![Build Status](https://api.travis-ci.org/ljharb/qs.svg)](http://travis-ci.org/ljharb/qs) + +Lead Maintainer: [Jordan Harband](https://github.com/ljharb) + +The **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring). + +## Usage + +```javascript +var qs = require('qs'); +var assert = require('assert'); + +var obj = qs.parse('a=c'); +assert.deepEqual(obj, { a: 'c' }); + +var str = qs.stringify(obj); +assert.equal(str, 'a=c'); +``` + +### Parsing Objects + +[](#preventEval) +```javascript +qs.parse(string, [options]); +``` + +**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`. +For example, the string `'foo[bar]=baz'` converts to: + +```javascript +assert.deepEqual(qs.parse('foo[bar]=baz'), { + foo: { + bar: 'baz' + } +}); +``` + +When using the `plainObjects` option the parsed value is returned as a plain object, created via `Object.create(null)` and as such you should be aware that prototype methods will not exist on it and a user may set those names to whatever value they like: + +```javascript +var plainObject = qs.parse('a[hasOwnProperty]=b', { plainObjects: true }); +assert.deepEqual(plainObject, { a: { hasOwnProperty: 'b' } }); +``` + +By default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use `plainObjects` as mentioned above, or set `allowPrototypes` to `true` which will allow user input to overwrite those properties. *WARNING* It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. Always be careful with this option. + +```javascript +var protoObject = qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }); +assert.deepEqual(protoObject, { a: { hasOwnProperty: 'b' } }); +``` + +URI encoded strings work too: + +```javascript +assert.deepEqual(qs.parse('a%5Bb%5D=c'), { + a: { b: 'c' } +}); +``` + +You can also nest your objects, like `'foo[bar][baz]=foobarbaz'`: + +```javascript +assert.deepEqual(qs.parse('foo[bar][baz]=foobarbaz'), { + foo: { + bar: { + baz: 'foobarbaz' + } + } +}); +``` + +By default, when nesting objects **qs** will only parse up to 5 children deep. This means if you attempt to parse a string like +`'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be: + +```javascript +var expected = { + a: { + b: { + c: { + d: { + e: { + f: { + '[g][h][i]': 'j' + } + } + } + } + } + } +}; +var string = 'a[b][c][d][e][f][g][h][i]=j'; +assert.deepEqual(qs.parse(string), expected); +``` + +This depth can be overridden by passing a `depth` option to `qs.parse(string, [options])`: + +```javascript +var deep = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); +assert.deepEqual(deep, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }); +``` + +The depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number. + +For similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option: + +```javascript +var limited = qs.parse('a=b&c=d', { parameterLimit: 1 }); +assert.deepEqual(limited, { a: 'b' }); +``` + +An optional delimiter can also be passed: + +```javascript +var delimited = qs.parse('a=b;c=d', { delimiter: ';' }); +assert.deepEqual(delimited, { a: 'b', c: 'd' }); +``` + +Delimiters can be a regular expression too: + +```javascript +var regexed = qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ }); +assert.deepEqual(regexed, { a: 'b', c: 'd', e: 'f' }); +``` + +Option `allowDots` can be used to enable dot notation: + +```javascript +var withDots = qs.parse('a.b=c', { allowDots: true }); +assert.deepEqual(withDots, { a: { b: 'c' } }); +``` + +### Parsing Arrays + +**qs** can also parse arrays using a similar `[]` notation: + +```javascript +var withArray = qs.parse('a[]=b&a[]=c'); +assert.deepEqual(withArray, { a: ['b', 'c'] }); +``` + +You may specify an index as well: + +```javascript +var withIndexes = qs.parse('a[1]=c&a[0]=b'); +assert.deepEqual(withIndexes, { a: ['b', 'c'] }); +``` + +Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number +to create an array. When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving +their order: + +```javascript +var noSparse = qs.parse('a[1]=b&a[15]=c'); +assert.deepEqual(noSparse, { a: ['b', 'c'] }); +``` + +Note that an empty string is also a value, and will be preserved: + +```javascript +var withEmptyString = qs.parse('a[]=&a[]=b'); +assert.deepEqual(withEmptyString, { a: ['', 'b'] }); + +var withIndexedEmptyString = qs.parse('a[0]=b&a[1]=&a[2]=c'); +assert.deepEqual(withIndexedEmptyString, { a: ['b', '', 'c'] }); +``` + +**qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` will +instead be converted to an object with the index as the key: + +```javascript +var withMaxIndex = qs.parse('a[100]=b'); +assert.deepEqual(withMaxIndex, { a: { '100': 'b' } }); +``` + +This limit can be overridden by passing an `arrayLimit` option: + +```javascript +var withArrayLimit = qs.parse('a[1]=b', { arrayLimit: 0 }); +assert.deepEqual(withArrayLimit, { a: { '1': 'b' } }); +``` + +To disable array parsing entirely, set `parseArrays` to `false`. + +```javascript +var noParsingArrays = qs.parse('a[]=b', { parseArrays: false }); +assert.deepEqual(noParsingArrays, { a: { '0': 'b' } }); +``` + +If you mix notations, **qs** will merge the two items into an object: + +```javascript +var mixedNotation = qs.parse('a[0]=b&a[b]=c'); +assert.deepEqual(mixedNotation, { a: { '0': 'b', b: 'c' } }); +``` + +You can also create arrays of objects: + +```javascript +var arraysOfObjects = qs.parse('a[][b]=c'); +assert.deepEqual(arraysOfObjects, { a: [{ b: 'c' }] }); +``` + +### Stringifying + +[](#preventEval) +```javascript +qs.stringify(object, [options]); +``` + +When stringifying, **qs** by default URI encodes output. Objects are stringified as you would expect: + +```javascript +assert.equal(qs.stringify({ a: 'b' }), 'a=b'); +assert.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); +``` + +This encoding can be disabled by setting the `encode` option to `false`: + +```javascript +var unencoded = qs.stringify({ a: { b: 'c' } }, { encode: false }); +assert.equal(unencoded, 'a[b]=c'); +``` + +Examples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage. + +When arrays are stringified, by default they are given explicit indices: + +```javascript +qs.stringify({ a: ['b', 'c', 'd'] }); +// 'a[0]=b&a[1]=c&a[2]=d' +``` + +You may override this by setting the `indices` option to `false`: + +```javascript +qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }); +// 'a=b&a=c&a=d' +``` + +You may use the `arrayFormat` option to specify the format of the output array + +```javascript +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }) +// 'a[0]=b&a[1]=c' +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }) +// 'a[]=b&a[]=c' +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }) +// 'a=b&a=c' +``` + +Empty strings and null values will omit the value, but the equals sign (=) remains in place: + +```javascript +assert.equal(qs.stringify({ a: '' }), 'a='); +``` + +Properties that are set to `undefined` will be omitted entirely: + +```javascript +assert.equal(qs.stringify({ a: null, b: undefined }), 'a='); +``` + +The delimiter may be overridden with stringify as well: + +```javascript +assert.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d'); +``` + +Finally, you can use the `filter` option to restrict which keys will be included in the stringified output. +If you pass a function, it will be called for each key to obtain the replacement value. Otherwise, if you +pass an array, it will be used to select properties and array indices for stringification: + +```javascript +function filterFunc(prefix, value) { + if (prefix == 'b') { + // Return an `undefined` value to omit a property. + return; + } + if (prefix == 'e[f]') { + return value.getTime(); + } + if (prefix == 'e[g][0]') { + return value * 2; + } + return value; +} +qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: filterFunc }); +// 'a=b&c=d&e[f]=123&e[g][0]=4' +qs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] }); +// 'a=b&e=f' +qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] }); +// 'a[0]=b&a[2]=d' +``` + +### Handling of `null` values + +By default, `null` values are treated like empty strings: + +```javascript +var withNull = qs.stringify({ a: null, b: '' }); +assert.equal(withNull, 'a=&b='); +``` + +Parsing does not distinguish between parameters with and without equal signs. Both are converted to empty strings. + +```javascript +var equalsInsensitive = qs.parse('a&b='); +assert.deepEqual(equalsInsensitive, { a: '', b: '' }); +``` + +To distinguish between `null` values and empty strings use the `strictNullHandling` flag. In the result string the `null` +values have no `=` sign: + +```javascript +var strictNull = qs.stringify({ a: null, b: '' }, { strictNullHandling: true }); +assert.equal(strictNull, 'a&b='); +``` + +To parse values without `=` back to `null` use the `strictNullHandling` flag: + +```javascript +var parsedStrictNull = qs.parse('a&b=', { strictNullHandling: true }); +assert.deepEqual(parsedStrictNull, { a: null, b: '' }); +``` + +To completely skip rendering keys with `null` values, use the `skipNulls` flag: + +```javascript +var nullsSkipped = qs.stringify({ a: 'b', c: null}, { skipNulls: true }); +assert.equal(nullsSkipped, 'a=b'); +``` diff --git a/deps/npm/node_modules/request/node_modules/qs/Readme.md b/deps/npm/node_modules/request/node_modules/qs/Readme.md deleted file mode 100644 index 369f385672cff9..00000000000000 --- a/deps/npm/node_modules/request/node_modules/qs/Readme.md +++ /dev/null @@ -1,324 +0,0 @@ -# qs - -A querystring parsing and stringifying library with some added security. - -[![Build Status](https://secure.travis-ci.org/hapijs/qs.svg)](http://travis-ci.org/hapijs/qs) - -Lead Maintainer: [Nathan LaFreniere](https://github.com/nlf) - -The **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring). - -## Usage - -```javascript -var Qs = require('qs'); - -var obj = Qs.parse('a=c'); // { a: 'c' } -var str = Qs.stringify(obj); // 'a=c' -``` - -### Parsing Objects - -```javascript -Qs.parse(string, [options]); -``` - -**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`. -For example, the string `'foo[bar]=baz'` converts to: - -```javascript -{ - foo: { - bar: 'baz' - } -} -``` - -When using the `plainObjects` option the parsed value is returned as a plain object, created via `Object.create(null)` and as such you should be aware that prototype methods will not exist on it and a user may set those names to whatever value they like: - -```javascript -Qs.parse('a.hasOwnProperty=b', { plainObjects: true }); -// { a: { hasOwnProperty: 'b' } } -``` - -By default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use `plainObjects` as mentioned above, or set `allowPrototypes` to `true` which will allow user input to overwrite those properties. *WARNING* It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. Always be careful with this option. - -```javascript -Qs.parse('a.hasOwnProperty=b', { allowPrototypes: true }); -// { a: { hasOwnProperty: 'b' } } -``` - -URI encoded strings work too: - -```javascript -Qs.parse('a%5Bb%5D=c'); -// { a: { b: 'c' } } -``` - -You can also nest your objects, like `'foo[bar][baz]=foobarbaz'`: - -```javascript -{ - foo: { - bar: { - baz: 'foobarbaz' - } - } -} -``` - -By default, when nesting objects **qs** will only parse up to 5 children deep. This means if you attempt to parse a string like -`'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be: - -```javascript -{ - a: { - b: { - c: { - d: { - e: { - f: { - '[g][h][i]': 'j' - } - } - } - } - } - } -} -``` - -This depth can be overridden by passing a `depth` option to `Qs.parse(string, [options])`: - -```javascript -Qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); -// { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } } -``` - -The depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number. - -For similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option: - -```javascript -Qs.parse('a=b&c=d', { parameterLimit: 1 }); -// { a: 'b' } -``` - -An optional delimiter can also be passed: - -```javascript -Qs.parse('a=b;c=d', { delimiter: ';' }); -// { a: 'b', c: 'd' } -``` - -Delimiters can be a regular expression too: - -```javascript -Qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ }); -// { a: 'b', c: 'd', e: 'f' } -``` - -Option `allowDots` can be used to enable dot notation: - -```javascript -Qs.parse('a.b=c', { allowDots: true }); -// { a: { b: 'c' } } -``` - -### Parsing Arrays - -**qs** can also parse arrays using a similar `[]` notation: - -```javascript -Qs.parse('a[]=b&a[]=c'); -// { a: ['b', 'c'] } -``` - -You may specify an index as well: - -```javascript -Qs.parse('a[1]=c&a[0]=b'); -// { a: ['b', 'c'] } -``` - -Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number -to create an array. When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving -their order: - -```javascript -Qs.parse('a[1]=b&a[15]=c'); -// { a: ['b', 'c'] } -``` - -Note that an empty string is also a value, and will be preserved: - -```javascript -Qs.parse('a[]=&a[]=b'); -// { a: ['', 'b'] } -Qs.parse('a[0]=b&a[1]=&a[2]=c'); -// { a: ['b', '', 'c'] } -``` - -**qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` will -instead be converted to an object with the index as the key: - -```javascript -Qs.parse('a[100]=b'); -// { a: { '100': 'b' } } -``` - -This limit can be overridden by passing an `arrayLimit` option: - -```javascript -Qs.parse('a[1]=b', { arrayLimit: 0 }); -// { a: { '1': 'b' } } -``` - -To disable array parsing entirely, set `parseArrays` to `false`. - -```javascript -Qs.parse('a[]=b', { parseArrays: false }); -// { a: { '0': 'b' } } -``` - -If you mix notations, **qs** will merge the two items into an object: - -```javascript -Qs.parse('a[0]=b&a[b]=c'); -// { a: { '0': 'b', b: 'c' } } -``` - -You can also create arrays of objects: - -```javascript -Qs.parse('a[][b]=c'); -// { a: [{ b: 'c' }] } -``` - -### Stringifying - -```javascript -Qs.stringify(object, [options]); -``` - -When stringifying, **qs** always URI encodes output. Objects are stringified as you would expect: - -```javascript -Qs.stringify({ a: 'b' }); -// 'a=b' -Qs.stringify({ a: { b: 'c' } }); -// 'a%5Bb%5D=c' -``` - -Examples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage. - -When arrays are stringified, by default they are given explicit indices: - -```javascript -Qs.stringify({ a: ['b', 'c', 'd'] }); -// 'a[0]=b&a[1]=c&a[2]=d' -``` - -You may override this by setting the `indices` option to `false`: - -```javascript -Qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }); -// 'a=b&a=c&a=d' -``` - -You may use the `arrayFormat` option to specify the format of the output array - -```javascript -Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }) -// 'a[0]=b&a[1]=c' -Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }) -// 'a[]=b&a[]=c' -Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }) -// 'a=b&a=c' -``` - -Empty strings and null values will omit the value, but the equals sign (=) remains in place: - -```javascript -Qs.stringify({ a: '' }); -// 'a=' -``` - -Properties that are set to `undefined` will be omitted entirely: - -```javascript -Qs.stringify({ a: null, b: undefined }); -// 'a=' -``` - -The delimiter may be overridden with stringify as well: - -```javascript -Qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }); -// 'a=b;c=d' -``` - -Finally, you can use the `filter` option to restrict which keys will be included in the stringified output. -If you pass a function, it will be called for each key to obtain the replacement value. Otherwise, if you -pass an array, it will be used to select properties and array indices for stringification: - -```javascript -function filterFunc(prefix, value) { - if (prefix == 'b') { - // Return an `undefined` value to omit a property. - return; - } - if (prefix == 'e[f]') { - return value.getTime(); - } - if (prefix == 'e[g][0]') { - return value * 2; - } - return value; -} -Qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: filterFunc }) -// 'a=b&c=d&e[f]=123&e[g][0]=4' -Qs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] }) -// 'a=b&e=f' -Qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] }) -// 'a[0]=b&a[2]=d' -``` - -### Handling of `null` values - -By default, `null` values are treated like empty strings: - -```javascript -Qs.stringify({ a: null, b: '' }); -// 'a=&b=' -``` - -Parsing does not distinguish between parameters with and without equal signs. Both are converted to empty strings. - -```javascript -Qs.parse('a&b=') -// { a: '', b: '' } -``` - -To distinguish between `null` values and empty strings use the `strictNullHandling` flag. In the result string the `null` -values have no `=` sign: - -```javascript -Qs.stringify({ a: null, b: '' }, { strictNullHandling: true }); -// 'a&b=' -``` - -To parse values without `=` back to `null` use the `strictNullHandling` flag: - -```javascript -Qs.parse('a&b=', { strictNullHandling: true }); -// { a: null, b: '' } - -``` - -To completely skip rendering keys with `null` values, use the `skipNulls` flag: - -```javascript -qs.stringify({ a: 'b', c: null}, { skipNulls: true }) -// 'a=b' -``` diff --git a/deps/npm/node_modules/request/node_modules/qs/bower.json b/deps/npm/node_modules/request/node_modules/qs/bower.json index 53a70d0c94d733..8b21420a643286 100644 --- a/deps/npm/node_modules/request/node_modules/qs/bower.json +++ b/deps/npm/node_modules/request/node_modules/qs/bower.json @@ -1,7 +1,7 @@ { "name": "qs", "main": "dist/qs.js", - "version": "5.1.0", + "version": "5.2.0", "homepage": "https://github.com/hapijs/qs", "authors": [ "Nathan LaFreniere " diff --git a/deps/npm/node_modules/request/node_modules/qs/component.json b/deps/npm/node_modules/request/node_modules/qs/component.json index 1a1f72c7af3e86..fca856a631ae37 100644 --- a/deps/npm/node_modules/request/node_modules/qs/component.json +++ b/deps/npm/node_modules/request/node_modules/qs/component.json @@ -2,7 +2,7 @@ "name": "qs", "repository": "hapijs/qs", "description": "query-string parser / stringifier with nesting support", - "version": "5.1.0", + "version": "5.2.0", "keywords": ["querystring", "query", "parser"], "main": "lib/index.js", "scripts": [ diff --git a/deps/npm/node_modules/request/node_modules/qs/dist/qs.js b/deps/npm/node_modules/request/node_modules/qs/dist/qs.js index 2b9fec30183921..68433d45a8022d 100644 --- a/deps/npm/node_modules/request/node_modules/qs/dist/qs.js +++ b/deps/npm/node_modules/request/node_modules/qs/dist/qs.js @@ -1,28 +1,19 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Qs = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 0 && - (options.parseArrays && - index <= options.arrayLimit)) { - + (options.parseArrays && index <= options.arrayLimit) + ) { obj = []; obj[index] = internals.parseObject(chain, val, options); - } - else { + } else { obj[cleanRoot] = internals.parseObject(chain, val, options); } } @@ -104,18 +86,13 @@ internals.parseObject = function (chain, val, options) { return obj; }; - -internals.parseKeys = function (key, val, options) { - - if (!key) { +internals.parseKeys = function (givenKey, val, options) { + if (!givenKey) { return; } // Transform dot notation to bracket notation - - if (options.allowDots) { - key = key.replace(/\.([^\.\[]+)/g, '[$1]'); - } + var key = options.allowDots ? givenKey.replace(/\.([^\.\[]+)/g, '[$1]') : givenKey; // The regex chunks @@ -132,9 +109,7 @@ internals.parseKeys = function (key, val, options) { if (segment[1]) { // If we aren't using plain objects, optionally prefix keys // that would overwrite object prototype properties - if (!options.plainObjects && - Object.prototype.hasOwnProperty(segment[1])) { - + if (!options.plainObjects && Object.prototype.hasOwnProperty(segment[1])) { if (!options.allowPrototypes) { return; } @@ -147,11 +122,8 @@ internals.parseKeys = function (key, val, options) { var i = 0; while ((segment = child.exec(key)) !== null && i < options.depth) { - - ++i; - if (!options.plainObjects && - Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) { - + i += 1; + if (!options.plainObjects && Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) { if (!options.allowPrototypes) { continue; } @@ -168,10 +140,8 @@ internals.parseKeys = function (key, val, options) { return internals.parseObject(keys, val, options); }; - -module.exports = function (str, options) { - - options = options || {}; +module.exports = function (str, opts) { + var options = opts || {}; options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : internals.delimiter; options.depth = typeof options.depth === 'number' ? options.depth : internals.depth; options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : internals.arrayLimit; @@ -182,10 +152,11 @@ module.exports = function (str, options) { options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : internals.parameterLimit; options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling; - if (str === '' || + if ( + str === '' || str === null || - typeof str === 'undefined') { - + typeof str === 'undefined' + ) { return options.plainObjects ? Object.create(null) : {}; } @@ -195,7 +166,7 @@ module.exports = function (str, options) { // Iterate over the keys and setup the new object var keys = Object.keys(tempObj); - for (var i = 0, il = keys.length; i < il; ++i) { + for (var i = 0; i < keys.length; ++i) { var key = keys[i]; var newObj = internals.parseKeys(key, tempObj[key], options); obj = Utils.merge(obj, newObj, options); @@ -205,57 +176,49 @@ module.exports = function (str, options) { }; },{"./utils":4}],3:[function(require,module,exports){ -// Load modules +'use strict'; var Utils = require('./utils'); - -// Declare internals - var internals = { delimiter: '&', arrayPrefixGenerators: { - brackets: function (prefix, key) { - + brackets: function (prefix) { return prefix + '[]'; }, indices: function (prefix, key) { - return prefix + '[' + key + ']'; }, - repeat: function (prefix, key) { - + repeat: function (prefix) { return prefix; } }, - strictNullHandling: false + strictNullHandling: false, + skipNulls: false, + encode: true }; - -internals.stringify = function (obj, prefix, generateArrayPrefix, strictNullHandling, filter) { - +internals.stringify = function (object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort) { + var obj = object; if (typeof filter === 'function') { obj = filter(prefix, obj); - } - else if (Utils.isBuffer(obj)) { - obj = obj.toString(); - } - else if (obj instanceof Date) { + } else if (Utils.isBuffer(obj)) { + obj = String(obj); + } else if (obj instanceof Date) { obj = obj.toISOString(); - } - else if (obj === null) { + } else if (obj === null) { if (strictNullHandling) { - return Utils.encode(prefix); + return encode ? Utils.encode(prefix) : prefix; } obj = ''; } - if (typeof obj === 'string' || - typeof obj === 'number' || - typeof obj === 'boolean') { - - return [Utils.encode(prefix) + '=' + Utils.encode(obj)]; + if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean') { + if (encode) { + return [Utils.encode(prefix) + '=' + Utils.encode(obj)]; + } + return [prefix + '=' + obj]; } var values = []; @@ -264,53 +227,60 @@ internals.stringify = function (obj, prefix, generateArrayPrefix, strictNullHand return values; } - var objKeys = Array.isArray(filter) ? filter : Object.keys(obj); - for (var i = 0, il = objKeys.length; i < il; ++i) { + var objKeys; + if (Array.isArray(filter)) { + objKeys = filter; + } else { + var keys = Object.keys(obj); + objKeys = sort ? keys.sort(sort) : keys; + } + + for (var i = 0; i < objKeys.length; ++i) { var key = objKeys[i]; - if (Array.isArray(obj)) { - values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, filter)); + if (skipNulls && obj[key] === null) { + continue; } - else { - values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', generateArrayPrefix, strictNullHandling, filter)); + + if (Array.isArray(obj)) { + values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter)); + } else { + values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', generateArrayPrefix, strictNullHandling, skipNulls, encode, filter)); } } return values; }; - -module.exports = function (obj, options) { - - options = options || {}; +module.exports = function (object, opts) { + var obj = object; + var options = opts || {}; var delimiter = typeof options.delimiter === 'undefined' ? internals.delimiter : options.delimiter; var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling; + var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : internals.skipNulls; + var encode = typeof options.encode === 'boolean' ? options.encode : internals.encode; + var sort = typeof options.sort === 'function' ? options.sort : null; var objKeys; var filter; if (typeof options.filter === 'function') { filter = options.filter; obj = filter('', obj); - } - else if (Array.isArray(options.filter)) { + } else if (Array.isArray(options.filter)) { objKeys = filter = options.filter; } var keys = []; - if (typeof obj !== 'object' || - obj === null) { - + if (typeof obj !== 'object' || obj === null) { return ''; } var arrayFormat; if (options.arrayFormat in internals.arrayPrefixGenerators) { arrayFormat = options.arrayFormat; - } - else if ('indices' in options) { + } else if ('indices' in options) { arrayFormat = options.indices ? 'indices' : 'repeat'; - } - else { + } else { arrayFormat = 'indices'; } @@ -319,33 +289,40 @@ module.exports = function (obj, options) { if (!objKeys) { objKeys = Object.keys(obj); } - for (var i = 0, il = objKeys.length; i < il; ++i) { + + if (sort) { + objKeys.sort(sort); + } + + for (var i = 0; i < objKeys.length; ++i) { var key = objKeys[i]; - keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, filter)); + + if (skipNulls && obj[key] === null) { + continue; + } + + keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort)); } return keys.join(delimiter); }; },{"./utils":4}],4:[function(require,module,exports){ -// Load modules - +'use strict'; -// Declare internals - -var internals = {}; -internals.hexTable = new Array(256); -for (var h = 0; h < 256; ++h) { - internals.hexTable[h] = '%' + ((h < 16 ? '0' : '') + h.toString(16)).toUpperCase(); -} +var hexTable = (function () { + var array = new Array(256); + for (var i = 0; i < 256; ++i) { + array[i] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase(); + } + return array; +}()); exports.arrayToObject = function (source, options) { - var obj = options.plainObjects ? Object.create(null) : {}; - for (var i = 0, il = source.length; i < il; ++i) { + for (var i = 0; i < source.length; ++i) { if (typeof source[i] !== 'undefined') { - obj[i] = source[i]; } } @@ -353,9 +330,7 @@ exports.arrayToObject = function (source, options) { return obj; }; - exports.merge = function (target, source, options) { - if (!source) { return target; } @@ -363,47 +338,37 @@ exports.merge = function (target, source, options) { if (typeof source !== 'object') { if (Array.isArray(target)) { target.push(source); - } - else if (typeof target === 'object') { + } else if (typeof target === 'object') { target[source] = true; - } - else { - target = [target, source]; + } else { + return [target, source]; } return target; } if (typeof target !== 'object') { - target = [target].concat(source); - return target; + return [target].concat(source); } - if (Array.isArray(target) && - !Array.isArray(source)) { - - target = exports.arrayToObject(target, options); + var mergeTarget = target; + if (Array.isArray(target) && !Array.isArray(source)) { + mergeTarget = exports.arrayToObject(target, options); } - var keys = Object.keys(source); - for (var k = 0, kl = keys.length; k < kl; ++k) { - var key = keys[k]; + return Object.keys(source).reduce(function (acc, key) { var value = source[key]; - if (!Object.prototype.hasOwnProperty.call(target, key)) { - target[key] = value; - } - else { - target[key] = exports.merge(target[key], value, options); + if (Object.prototype.hasOwnProperty.call(acc, key)) { + acc[key] = exports.merge(acc[key], value, options); + } else { + acc[key] = value; } - } - - return target; + return acc; + }, mergeTarget); }; - exports.decode = function (str) { - try { return decodeURIComponent(str.replace(/\+/g, ' ')); } catch (e) { @@ -412,65 +377,60 @@ exports.decode = function (str) { }; exports.encode = function (str) { - // This code was originally written by Brian White (mscdex) for the io.js core querystring library. // It has been adapted here for stricter adherence to RFC 3986 if (str.length === 0) { return str; } - if (typeof str !== 'string') { - str = '' + str; - } + var string = typeof str === 'string' ? str : String(str); var out = ''; - for (var i = 0, il = str.length; i < il; ++i) { - var c = str.charCodeAt(i); + for (var i = 0; i < string.length; ++i) { + var c = string.charCodeAt(i); - if (c === 0x2D || // - + if ( + c === 0x2D || // - c === 0x2E || // . c === 0x5F || // _ c === 0x7E || // ~ (c >= 0x30 && c <= 0x39) || // 0-9 (c >= 0x41 && c <= 0x5A) || // a-z - (c >= 0x61 && c <= 0x7A)) { // A-Z - - out += str[i]; + (c >= 0x61 && c <= 0x7A) // A-Z + ) { + out += string.charAt(i); continue; } if (c < 0x80) { - out += internals.hexTable[c]; + out = out + hexTable[c]; continue; } if (c < 0x800) { - out += internals.hexTable[0xC0 | (c >> 6)] + internals.hexTable[0x80 | (c & 0x3F)]; + out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); continue; } if (c < 0xD800 || c >= 0xE000) { - out += internals.hexTable[0xE0 | (c >> 12)] + internals.hexTable[0x80 | ((c >> 6) & 0x3F)] + internals.hexTable[0x80 | (c & 0x3F)]; + out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); continue; } - ++i; - c = 0x10000 + (((c & 0x3FF) << 10) | (str.charCodeAt(i) & 0x3FF)); - out += internals.hexTable[0xF0 | (c >> 18)] + internals.hexTable[0x80 | ((c >> 12) & 0x3F)] + internals.hexTable[0x80 | ((c >> 6) & 0x3F)] + internals.hexTable[0x80 | (c & 0x3F)]; + i += 1; + c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); + out += (hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); } return out; }; -exports.compact = function (obj, refs) { - - if (typeof obj !== 'object' || - obj === null) { - +exports.compact = function (obj, references) { + if (typeof obj !== 'object' || obj === null) { return obj; } - refs = refs || []; + var refs = references || []; var lookup = refs.indexOf(obj); if (lookup !== -1) { return refs[lookup]; @@ -481,7 +441,7 @@ exports.compact = function (obj, refs) { if (Array.isArray(obj)) { var compacted = []; - for (var i = 0, il = obj.length; i < il; ++i) { + for (var i = 0; i < obj.length; ++i) { if (typeof obj[i] !== 'undefined') { compacted.push(obj[i]); } @@ -491,32 +451,24 @@ exports.compact = function (obj, refs) { } var keys = Object.keys(obj); - for (i = 0, il = keys.length; i < il; ++i) { - var key = keys[i]; + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; obj[key] = exports.compact(obj[key], refs); } return obj; }; - exports.isRegExp = function (obj) { - return Object.prototype.toString.call(obj) === '[object RegExp]'; }; - exports.isBuffer = function (obj) { - - if (obj === null || - typeof obj === 'undefined') { - + if (obj === null || typeof obj === 'undefined') { return false; } - return !!(obj.constructor && - obj.constructor.isBuffer && - obj.constructor.isBuffer(obj)); + return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); }; },{}]},{},[1])(1) diff --git a/deps/npm/node_modules/request/node_modules/qs/lib/index.js b/deps/npm/node_modules/request/node_modules/qs/lib/index.js old mode 100644 new mode 100755 index 0e094933d1bcd0..190195902a0cb0 --- a/deps/npm/node_modules/request/node_modules/qs/lib/index.js +++ b/deps/npm/node_modules/request/node_modules/qs/lib/index.js @@ -1,14 +1,8 @@ -// Load modules +'use strict'; var Stringify = require('./stringify'); var Parse = require('./parse'); - -// Declare internals - -var internals = {}; - - module.exports = { stringify: Stringify, parse: Parse diff --git a/deps/npm/node_modules/request/node_modules/qs/lib/parse.js b/deps/npm/node_modules/request/node_modules/qs/lib/parse.js old mode 100644 new mode 100755 index 4a2137efab7668..9b6cbd221987f0 --- a/deps/npm/node_modules/request/node_modules/qs/lib/parse.js +++ b/deps/npm/node_modules/request/node_modules/qs/lib/parse.js @@ -1,10 +1,7 @@ -// Load modules +'use strict'; var Utils = require('./utils'); - -// Declare internals - var internals = { delimiter: '&', depth: 5, @@ -16,13 +13,11 @@ var internals = { allowDots: false }; - internals.parseValues = function (str, options) { - var obj = {}; var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit); - for (var i = 0, il = parts.length; i < il; ++i) { + for (var i = 0; i < parts.length; ++i) { var part = parts[i]; var pos = part.indexOf(']=') === -1 ? part.indexOf('=') : part.indexOf(']=') + 1; @@ -32,16 +27,14 @@ internals.parseValues = function (str, options) { if (options.strictNullHandling) { obj[Utils.decode(part)] = null; } - } - else { + } else { var key = Utils.decode(part.slice(0, pos)); var val = Utils.decode(part.slice(pos + 1)); - if (!Object.prototype.hasOwnProperty.call(obj, key)) { - obj[key] = val; - } - else { + if (Object.prototype.hasOwnProperty.call(obj, key)) { obj[key] = [].concat(obj[key]).concat(val); + } else { + obj[key] = val; } } } @@ -49,9 +42,7 @@ internals.parseValues = function (str, options) { return obj; }; - internals.parseObject = function (chain, val, options) { - if (!chain.length) { return val; } @@ -62,23 +53,20 @@ internals.parseObject = function (chain, val, options) { if (root === '[]') { obj = []; obj = obj.concat(internals.parseObject(chain, val, options)); - } - else { + } else { obj = options.plainObjects ? Object.create(null) : {}; var cleanRoot = root[0] === '[' && root[root.length - 1] === ']' ? root.slice(1, root.length - 1) : root; var index = parseInt(cleanRoot, 10); - var indexString = '' + index; - if (!isNaN(index) && + if ( + !isNaN(index) && root !== cleanRoot && - indexString === cleanRoot && + String(index) === cleanRoot && index >= 0 && - (options.parseArrays && - index <= options.arrayLimit)) { - + (options.parseArrays && index <= options.arrayLimit) + ) { obj = []; obj[index] = internals.parseObject(chain, val, options); - } - else { + } else { obj[cleanRoot] = internals.parseObject(chain, val, options); } } @@ -86,18 +74,13 @@ internals.parseObject = function (chain, val, options) { return obj; }; - -internals.parseKeys = function (key, val, options) { - - if (!key) { +internals.parseKeys = function (givenKey, val, options) { + if (!givenKey) { return; } // Transform dot notation to bracket notation - - if (options.allowDots) { - key = key.replace(/\.([^\.\[]+)/g, '[$1]'); - } + var key = options.allowDots ? givenKey.replace(/\.([^\.\[]+)/g, '[$1]') : givenKey; // The regex chunks @@ -114,9 +97,7 @@ internals.parseKeys = function (key, val, options) { if (segment[1]) { // If we aren't using plain objects, optionally prefix keys // that would overwrite object prototype properties - if (!options.plainObjects && - Object.prototype.hasOwnProperty(segment[1])) { - + if (!options.plainObjects && Object.prototype.hasOwnProperty(segment[1])) { if (!options.allowPrototypes) { return; } @@ -129,11 +110,8 @@ internals.parseKeys = function (key, val, options) { var i = 0; while ((segment = child.exec(key)) !== null && i < options.depth) { - - ++i; - if (!options.plainObjects && - Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) { - + i += 1; + if (!options.plainObjects && Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) { if (!options.allowPrototypes) { continue; } @@ -150,10 +128,8 @@ internals.parseKeys = function (key, val, options) { return internals.parseObject(keys, val, options); }; - -module.exports = function (str, options) { - - options = options || {}; +module.exports = function (str, opts) { + var options = opts || {}; options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : internals.delimiter; options.depth = typeof options.depth === 'number' ? options.depth : internals.depth; options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : internals.arrayLimit; @@ -164,10 +140,11 @@ module.exports = function (str, options) { options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : internals.parameterLimit; options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling; - if (str === '' || + if ( + str === '' || str === null || - typeof str === 'undefined') { - + typeof str === 'undefined' + ) { return options.plainObjects ? Object.create(null) : {}; } @@ -177,7 +154,7 @@ module.exports = function (str, options) { // Iterate over the keys and setup the new object var keys = Object.keys(tempObj); - for (var i = 0, il = keys.length; i < il; ++i) { + for (var i = 0; i < keys.length; ++i) { var key = keys[i]; var newObj = internals.parseKeys(key, tempObj[key], options); obj = Utils.merge(obj, newObj, options); diff --git a/deps/npm/node_modules/request/node_modules/qs/lib/stringify.js b/deps/npm/node_modules/request/node_modules/qs/lib/stringify.js old mode 100644 new mode 100755 index 6a73004c4ceb3a..e7b669d3d58288 --- a/deps/npm/node_modules/request/node_modules/qs/lib/stringify.js +++ b/deps/npm/node_modules/request/node_modules/qs/lib/stringify.js @@ -1,23 +1,17 @@ -// Load modules +'use strict'; var Utils = require('./utils'); - -// Declare internals - var internals = { delimiter: '&', arrayPrefixGenerators: { - brackets: function (prefix, key) { - + brackets: function (prefix) { return prefix + '[]'; }, indices: function (prefix, key) { - return prefix + '[' + key + ']'; }, - repeat: function (prefix, key) { - + repeat: function (prefix) { return prefix; } }, @@ -26,19 +20,15 @@ var internals = { encode: true }; - -internals.stringify = function (obj, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter) { - +internals.stringify = function (object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort) { + var obj = object; if (typeof filter === 'function') { obj = filter(prefix, obj); - } - else if (Utils.isBuffer(obj)) { - obj = obj.toString(); - } - else if (obj instanceof Date) { + } else if (Utils.isBuffer(obj)) { + obj = String(obj); + } else if (obj instanceof Date) { obj = obj.toISOString(); - } - else if (obj === null) { + } else if (obj === null) { if (strictNullHandling) { return encode ? Utils.encode(prefix) : prefix; } @@ -46,10 +36,7 @@ internals.stringify = function (obj, prefix, generateArrayPrefix, strictNullHand obj = ''; } - if (typeof obj === 'string' || - typeof obj === 'number' || - typeof obj === 'boolean') { - + if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean') { if (encode) { return [Utils.encode(prefix) + '=' + Utils.encode(obj)]; } @@ -62,20 +49,24 @@ internals.stringify = function (obj, prefix, generateArrayPrefix, strictNullHand return values; } - var objKeys = Array.isArray(filter) ? filter : Object.keys(obj); - for (var i = 0, il = objKeys.length; i < il; ++i) { - var key = objKeys[i]; + var objKeys; + if (Array.isArray(filter)) { + objKeys = filter; + } else { + var keys = Object.keys(obj); + objKeys = sort ? keys.sort(sort) : keys; + } - if (skipNulls && - obj[key] === null) { + for (var i = 0; i < objKeys.length; ++i) { + var key = objKeys[i]; + if (skipNulls && obj[key] === null) { continue; } if (Array.isArray(obj)) { values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter)); - } - else { + } else { values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', generateArrayPrefix, strictNullHandling, skipNulls, encode, filter)); } } @@ -83,40 +74,35 @@ internals.stringify = function (obj, prefix, generateArrayPrefix, strictNullHand return values; }; - -module.exports = function (obj, options) { - - options = options || {}; +module.exports = function (object, opts) { + var obj = object; + var options = opts || {}; var delimiter = typeof options.delimiter === 'undefined' ? internals.delimiter : options.delimiter; var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling; var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : internals.skipNulls; var encode = typeof options.encode === 'boolean' ? options.encode : internals.encode; + var sort = typeof options.sort === 'function' ? options.sort : null; var objKeys; var filter; if (typeof options.filter === 'function') { filter = options.filter; obj = filter('', obj); - } - else if (Array.isArray(options.filter)) { + } else if (Array.isArray(options.filter)) { objKeys = filter = options.filter; } var keys = []; - if (typeof obj !== 'object' || - obj === null) { - + if (typeof obj !== 'object' || obj === null) { return ''; } var arrayFormat; if (options.arrayFormat in internals.arrayPrefixGenerators) { arrayFormat = options.arrayFormat; - } - else if ('indices' in options) { + } else if ('indices' in options) { arrayFormat = options.indices ? 'indices' : 'repeat'; - } - else { + } else { arrayFormat = 'indices'; } @@ -126,16 +112,18 @@ module.exports = function (obj, options) { objKeys = Object.keys(obj); } - for (var i = 0, il = objKeys.length; i < il; ++i) { - var key = objKeys[i]; + if (sort) { + objKeys.sort(sort); + } - if (skipNulls && - obj[key] === null) { + for (var i = 0; i < objKeys.length; ++i) { + var key = objKeys[i]; + if (skipNulls && obj[key] === null) { continue; } - keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter)); + keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort)); } return keys.join(delimiter); diff --git a/deps/npm/node_modules/request/node_modules/qs/lib/utils.js b/deps/npm/node_modules/request/node_modules/qs/lib/utils.js old mode 100644 new mode 100755 index 88f314732b7ee0..5d433560306849 --- a/deps/npm/node_modules/request/node_modules/qs/lib/utils.js +++ b/deps/npm/node_modules/request/node_modules/qs/lib/utils.js @@ -1,21 +1,18 @@ -// Load modules +'use strict'; +var hexTable = (function () { + var array = new Array(256); + for (var i = 0; i < 256; ++i) { + array[i] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase(); + } -// Declare internals - -var internals = {}; -internals.hexTable = new Array(256); -for (var h = 0; h < 256; ++h) { - internals.hexTable[h] = '%' + ((h < 16 ? '0' : '') + h.toString(16)).toUpperCase(); -} - + return array; +}()); exports.arrayToObject = function (source, options) { - var obj = options.plainObjects ? Object.create(null) : {}; - for (var i = 0, il = source.length; i < il; ++i) { + for (var i = 0; i < source.length; ++i) { if (typeof source[i] !== 'undefined') { - obj[i] = source[i]; } } @@ -23,9 +20,7 @@ exports.arrayToObject = function (source, options) { return obj; }; - exports.merge = function (target, source, options) { - if (!source) { return target; } @@ -33,47 +28,37 @@ exports.merge = function (target, source, options) { if (typeof source !== 'object') { if (Array.isArray(target)) { target.push(source); - } - else if (typeof target === 'object') { + } else if (typeof target === 'object') { target[source] = true; - } - else { - target = [target, source]; + } else { + return [target, source]; } return target; } if (typeof target !== 'object') { - target = [target].concat(source); - return target; + return [target].concat(source); } - if (Array.isArray(target) && - !Array.isArray(source)) { - - target = exports.arrayToObject(target, options); + var mergeTarget = target; + if (Array.isArray(target) && !Array.isArray(source)) { + mergeTarget = exports.arrayToObject(target, options); } - var keys = Object.keys(source); - for (var k = 0, kl = keys.length; k < kl; ++k) { - var key = keys[k]; + return Object.keys(source).reduce(function (acc, key) { var value = source[key]; - if (!Object.prototype.hasOwnProperty.call(target, key)) { - target[key] = value; - } - else { - target[key] = exports.merge(target[key], value, options); + if (Object.prototype.hasOwnProperty.call(acc, key)) { + acc[key] = exports.merge(acc[key], value, options); + } else { + acc[key] = value; } - } - - return target; + return acc; + }, mergeTarget); }; - exports.decode = function (str) { - try { return decodeURIComponent(str.replace(/\+/g, ' ')); } catch (e) { @@ -82,65 +67,60 @@ exports.decode = function (str) { }; exports.encode = function (str) { - // This code was originally written by Brian White (mscdex) for the io.js core querystring library. // It has been adapted here for stricter adherence to RFC 3986 if (str.length === 0) { return str; } - if (typeof str !== 'string') { - str = '' + str; - } + var string = typeof str === 'string' ? str : String(str); var out = ''; - for (var i = 0, il = str.length; i < il; ++i) { - var c = str.charCodeAt(i); + for (var i = 0; i < string.length; ++i) { + var c = string.charCodeAt(i); - if (c === 0x2D || // - + if ( + c === 0x2D || // - c === 0x2E || // . c === 0x5F || // _ c === 0x7E || // ~ (c >= 0x30 && c <= 0x39) || // 0-9 (c >= 0x41 && c <= 0x5A) || // a-z - (c >= 0x61 && c <= 0x7A)) { // A-Z - - out += str[i]; + (c >= 0x61 && c <= 0x7A) // A-Z + ) { + out += string.charAt(i); continue; } if (c < 0x80) { - out += internals.hexTable[c]; + out = out + hexTable[c]; continue; } if (c < 0x800) { - out += internals.hexTable[0xC0 | (c >> 6)] + internals.hexTable[0x80 | (c & 0x3F)]; + out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); continue; } if (c < 0xD800 || c >= 0xE000) { - out += internals.hexTable[0xE0 | (c >> 12)] + internals.hexTable[0x80 | ((c >> 6) & 0x3F)] + internals.hexTable[0x80 | (c & 0x3F)]; + out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); continue; } - ++i; - c = 0x10000 + (((c & 0x3FF) << 10) | (str.charCodeAt(i) & 0x3FF)); - out += internals.hexTable[0xF0 | (c >> 18)] + internals.hexTable[0x80 | ((c >> 12) & 0x3F)] + internals.hexTable[0x80 | ((c >> 6) & 0x3F)] + internals.hexTable[0x80 | (c & 0x3F)]; + i += 1; + c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); + out += (hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); } return out; }; -exports.compact = function (obj, refs) { - - if (typeof obj !== 'object' || - obj === null) { - +exports.compact = function (obj, references) { + if (typeof obj !== 'object' || obj === null) { return obj; } - refs = refs || []; + var refs = references || []; var lookup = refs.indexOf(obj); if (lookup !== -1) { return refs[lookup]; @@ -151,7 +131,7 @@ exports.compact = function (obj, refs) { if (Array.isArray(obj)) { var compacted = []; - for (var i = 0, il = obj.length; i < il; ++i) { + for (var i = 0; i < obj.length; ++i) { if (typeof obj[i] !== 'undefined') { compacted.push(obj[i]); } @@ -161,30 +141,22 @@ exports.compact = function (obj, refs) { } var keys = Object.keys(obj); - for (i = 0, il = keys.length; i < il; ++i) { - var key = keys[i]; + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; obj[key] = exports.compact(obj[key], refs); } return obj; }; - exports.isRegExp = function (obj) { - return Object.prototype.toString.call(obj) === '[object RegExp]'; }; - exports.isBuffer = function (obj) { - - if (obj === null || - typeof obj === 'undefined') { - + if (obj === null || typeof obj === 'undefined') { return false; } - return !!(obj.constructor && - obj.constructor.isBuffer && - obj.constructor.isBuffer(obj)); + return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); }; diff --git a/deps/npm/node_modules/request/node_modules/qs/package.json b/deps/npm/node_modules/request/node_modules/qs/package.json index 981aff4b78e153..ed0815b5b70542 100644 --- a/deps/npm/node_modules/request/node_modules/qs/package.json +++ b/deps/npm/node_modules/request/node_modules/qs/package.json @@ -1,59 +1,105 @@ { - "name": "qs", - "description": "A querystring parser that supports nesting and arrays, with a depth limit", - "homepage": "https://github.com/hapijs/qs", - "version": "5.1.0", - "repository": { - "type": "git", - "url": "git+https://github.com/hapijs/qs.git" - }, - "main": "lib/index.js", - "keywords": [ - "querystring", - "qs" + "_args": [ + [ + "qs@~6.0.2", + "/Users/rebecca/code/npm/node_modules/request" + ] ], - "engines": ">=0.10.40", - "dependencies": {}, - "devDependencies": { - "browserify": "^10.2.1", - "code": "1.x.x", - "lab": "5.x.x" + "_from": "qs@>=6.0.2 <6.1.0", + "_id": "qs@6.0.2", + "_inCache": true, + "_installable": true, + "_location": "/request/qs", + "_nodeVersion": "5.4.1", + "_npmUser": { + "email": "ljharb@gmail.com", + "name": "ljharb" }, - "scripts": { - "test": "lab -a code -t 100 -L", - "test-tap": "lab -a code -r tap -o tests.tap", - "test-cov-html": "lab -a code -r html -o coverage.html", - "dist": "browserify --standalone Qs lib/index.js > dist/qs.js" + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "name": "qs", + "raw": "qs@~6.0.2", + "rawSpec": "~6.0.2", + "scope": null, + "spec": ">=6.0.2 <6.1.0", + "type": "range" }, - "license": "BSD-3-Clause", - "gitHead": "9e9759ec5be2dd99ce90961bbff47075cd5a8160", + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.npmjs.org/qs/-/qs-6.0.2.tgz", + "_shasum": "88c68d590e8ed56c76c79f352c17b982466abfcd", + "_shrinkwrap": null, + "_spec": "qs@~6.0.2", + "_where": "/Users/rebecca/code/npm/node_modules/request", "bugs": { - "url": "https://github.com/hapijs/qs/issues" + "url": "https://github.com/ljharb/qs/issues" }, - "_id": "qs@5.1.0", - "_shasum": "4d932e5c7ea411cca76a312d39a606200fd50cd9", - "_from": "qs@>=5.1.0 <5.2.0", - "_npmVersion": "2.14.1", - "_nodeVersion": "0.12.7", - "_npmUser": { - "name": "nlf", - "email": "quitlahok@gmail.com" + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "dependencies": {}, + "description": "A querystring parser that supports nesting and arrays, with a depth limit", + "devDependencies": { + "@ljharb/eslint-config": "^1.6.1", + "browserify": "^12.0.1", + "covert": "^1.1.0", + "eslint": "^1.10.3", + "evalmd": "^0.0.16", + "mkdirp": "^0.5.1", + "parallelshell": "^2.0.0", + "tape": "^4.3.0" }, + "directories": {}, "dist": { - "shasum": "4d932e5c7ea411cca76a312d39a606200fd50cd9", - "tarball": "http://registry.npmjs.org/qs/-/qs-5.1.0.tgz" + "shasum": "88c68d590e8ed56c76c79f352c17b982466abfcd", + "tarball": "http://registry.npmjs.org/qs/-/qs-6.0.2.tgz" }, + "engines": { + "node": ">=0.6" + }, + "gitHead": "47dfbd6740b3cc1593847825701c8aa136f636e3", + "homepage": "https://github.com/ljharb/qs", + "keywords": [ + "qs", + "querystring" + ], + "license": "BSD-3-Clause", + "main": "lib/index.js", "maintainers": [ { - "name": "nlf", - "email": "quitlahok@gmail.com" + "name": "hueniverse", + "email": "eran@hammer.io" }, { - "name": "hueniverse", - "email": "eran@hueniverse.com" + "name": "ljharb", + "email": "ljharb@gmail.com" + }, + { + "name": "nlf", + "email": "quitlahok@gmail.com" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/qs/-/qs-5.1.0.tgz", - "readme": "ERROR: No README data found!" + "name": "qs", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/ljharb/qs.git" + }, + "scripts": { + "coverage": "covert test", + "dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js", + "lint": "eslint lib/*.js text/*.js", + "prepublish": "npm run dist", + "readme": "evalmd README.md", + "test": "parallelshell 'npm run readme' 'npm run lint' 'npm run coverage'", + "tests-only": "node test" + }, + "version": "6.0.2" } diff --git a/deps/npm/node_modules/request/node_modules/qs/test/index.js b/deps/npm/node_modules/request/node_modules/qs/test/index.js new file mode 100644 index 00000000000000..b6a7d9526a90b6 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/qs/test/index.js @@ -0,0 +1,5 @@ +require('./parse'); + +require('./stringify'); + +require('./utils'); diff --git a/deps/npm/node_modules/request/node_modules/qs/test/parse.js b/deps/npm/node_modules/request/node_modules/qs/test/parse.js old mode 100644 new mode 100755 index 679f19747af669..5665d074e95bd4 --- a/deps/npm/node_modules/request/node_modules/qs/test/parse.js +++ b/deps/npm/node_modules/request/node_modules/qs/test/parse.js @@ -1,478 +1,393 @@ -/* eslint no-extend-native:0 */ -// Load modules - -var Code = require('code'); -var Lab = require('lab'); -var Qs = require('../'); - - -// Declare internals - -var internals = {}; - - -// Test shortcuts - -var lab = exports.lab = Lab.script(); -var expect = Code.expect; -var describe = lab.experiment; -var it = lab.test; - - -describe('parse()', function () { - - it('parses a simple string', function (done) { - - expect(Qs.parse('0=foo')).to.deep.equal({ '0': 'foo' }); - expect(Qs.parse('foo=c++')).to.deep.equal({ foo: 'c ' }); - expect(Qs.parse('a[>=]=23')).to.deep.equal({ a: { '>=': '23' } }); - expect(Qs.parse('a[<=>]==23')).to.deep.equal({ a: { '<=>': '=23' } }); - expect(Qs.parse('a[==]=23')).to.deep.equal({ a: { '==': '23' } }); - expect(Qs.parse('foo', { strictNullHandling: true })).to.deep.equal({ foo: null }); - expect(Qs.parse('foo' )).to.deep.equal({ foo: '' }); - expect(Qs.parse('foo=')).to.deep.equal({ foo: '' }); - expect(Qs.parse('foo=bar')).to.deep.equal({ foo: 'bar' }); - expect(Qs.parse(' foo = bar = baz ')).to.deep.equal({ ' foo ': ' bar = baz ' }); - expect(Qs.parse('foo=bar=baz')).to.deep.equal({ foo: 'bar=baz' }); - expect(Qs.parse('foo=bar&bar=baz')).to.deep.equal({ foo: 'bar', bar: 'baz' }); - expect(Qs.parse('foo2=bar2&baz2=')).to.deep.equal({ foo2: 'bar2', baz2: '' }); - expect(Qs.parse('foo=bar&baz', { strictNullHandling: true })).to.deep.equal({ foo: 'bar', baz: null }); - expect(Qs.parse('foo=bar&baz')).to.deep.equal({ foo: 'bar', baz: '' }); - expect(Qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World')).to.deep.equal({ +'use strict'; + +var test = require('tape'); +var qs = require('../'); + +test('parse()', function (t) { + t.test('parses a simple string', function (st) { + st.deepEqual(qs.parse('0=foo'), { '0': 'foo' }); + st.deepEqual(qs.parse('foo=c++'), { foo: 'c ' }); + st.deepEqual(qs.parse('a[>=]=23'), { a: { '>=': '23' } }); + st.deepEqual(qs.parse('a[<=>]==23'), { a: { '<=>': '=23' } }); + st.deepEqual(qs.parse('a[==]=23'), { a: { '==': '23' } }); + st.deepEqual(qs.parse('foo', { strictNullHandling: true }), { foo: null }); + st.deepEqual(qs.parse('foo'), { foo: '' }); + st.deepEqual(qs.parse('foo='), { foo: '' }); + st.deepEqual(qs.parse('foo=bar'), { foo: 'bar' }); + st.deepEqual(qs.parse(' foo = bar = baz '), { ' foo ': ' bar = baz ' }); + st.deepEqual(qs.parse('foo=bar=baz'), { foo: 'bar=baz' }); + st.deepEqual(qs.parse('foo=bar&bar=baz'), { foo: 'bar', bar: 'baz' }); + st.deepEqual(qs.parse('foo2=bar2&baz2='), { foo2: 'bar2', baz2: '' }); + st.deepEqual(qs.parse('foo=bar&baz', { strictNullHandling: true }), { foo: 'bar', baz: null }); + st.deepEqual(qs.parse('foo=bar&baz'), { foo: 'bar', baz: '' }); + st.deepEqual(qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World'), { cht: 'p3', chd: 't:60,40', chs: '250x100', chl: 'Hello|World' }); - done(); + st.end(); }); - it('allows enabling dot notation', function (done) { - - expect(Qs.parse('a.b=c')).to.deep.equal({ 'a.b': 'c' }); - expect(Qs.parse('a.b=c', { allowDots: true })).to.deep.equal({ a: { b: 'c' } }); - done(); + t.test('allows enabling dot notation', function (st) { + st.deepEqual(qs.parse('a.b=c'), { 'a.b': 'c' }); + st.deepEqual(qs.parse('a.b=c', { allowDots: true }), { a: { b: 'c' } }); + st.end(); }); - it('parses a single nested string', function (done) { + t.deepEqual(qs.parse('a[b]=c'), { a: { b: 'c' } }, 'parses a single nested string'); + t.deepEqual(qs.parse('a[b][c]=d'), { a: { b: { c: 'd' } } }, 'parses a double nested string'); + t.deepEqual( + qs.parse('a[b][c][d][e][f][g][h]=i'), + { a: { b: { c: { d: { e: { f: { '[g][h]': 'i' } } } } } } }, + 'defaults to a depth of 5' + ); - expect(Qs.parse('a[b]=c')).to.deep.equal({ a: { b: 'c' } }); - done(); + t.test('only parses one level when depth = 1', function (st) { + st.deepEqual(qs.parse('a[b][c]=d', { depth: 1 }), { a: { b: { '[c]': 'd' } } }); + st.deepEqual(qs.parse('a[b][c][d]=e', { depth: 1 }), { a: { b: { '[c][d]': 'e' } } }); + st.end(); }); - it('parses a double nested string', function (done) { + t.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }, 'parses a simple array'); - expect(Qs.parse('a[b][c]=d')).to.deep.equal({ a: { b: { c: 'd' } } }); - done(); + t.test('parses an explicit array', function (st) { + st.deepEqual(qs.parse('a[]=b'), { a: ['b'] }); + st.deepEqual(qs.parse('a[]=b&a[]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[]=b&a[]=c&a[]=d'), { a: ['b', 'c', 'd'] }); + st.end(); }); - it('defaults to a depth of 5', function (done) { - - expect(Qs.parse('a[b][c][d][e][f][g][h]=i')).to.deep.equal({ a: { b: { c: { d: { e: { f: { '[g][h]': 'i' } } } } } } }); - done(); + t.test('parses a mix of simple and explicit arrays', function (st) { + st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[0]=b&a=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b&a[0]=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[1]=b&a=c'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a=b&a[1]=c'), { a: ['b', 'c'] }); + st.end(); }); - it('only parses one level when depth = 1', function (done) { - - expect(Qs.parse('a[b][c]=d', { depth: 1 })).to.deep.equal({ a: { b: { '[c]': 'd' } } }); - expect(Qs.parse('a[b][c][d]=e', { depth: 1 })).to.deep.equal({ a: { b: { '[c][d]': 'e' } } }); - done(); + t.test('parses a nested array', function (st) { + st.deepEqual(qs.parse('a[b][]=c&a[b][]=d'), { a: { b: ['c', 'd'] } }); + st.deepEqual(qs.parse('a[>=]=25'), { a: { '>=': '25' } }); + st.end(); }); - it('parses a simple array', function (done) { - - expect(Qs.parse('a=b&a=c')).to.deep.equal({ a: ['b', 'c'] }); - done(); + t.test('allows to specify array indices', function (st) { + st.deepEqual(qs.parse('a[1]=c&a[0]=b&a[2]=d'), { a: ['b', 'c', 'd'] }); + st.deepEqual(qs.parse('a[1]=c&a[0]=b'), { a: ['b', 'c'] }); + st.deepEqual(qs.parse('a[1]=c'), { a: ['c'] }); + st.end(); }); - it('parses an explicit array', function (done) { - - expect(Qs.parse('a[]=b')).to.deep.equal({ a: ['b'] }); - expect(Qs.parse('a[]=b&a[]=c')).to.deep.equal({ a: ['b', 'c'] }); - expect(Qs.parse('a[]=b&a[]=c&a[]=d')).to.deep.equal({ a: ['b', 'c', 'd'] }); - done(); + t.test('limits specific array indices to 20', function (st) { + st.deepEqual(qs.parse('a[20]=a'), { a: ['a'] }); + st.deepEqual(qs.parse('a[21]=a'), { a: { '21': 'a' } }); + st.end(); }); - it('parses a mix of simple and explicit arrays', function (done) { + t.deepEqual(qs.parse('a[12b]=c'), { a: { '12b': 'c' } }, 'supports keys that begin with a number'); - expect(Qs.parse('a=b&a[]=c')).to.deep.equal({ a: ['b', 'c'] }); - expect(Qs.parse('a[]=b&a=c')).to.deep.equal({ a: ['b', 'c'] }); - expect(Qs.parse('a[0]=b&a=c')).to.deep.equal({ a: ['b', 'c'] }); - expect(Qs.parse('a=b&a[0]=c')).to.deep.equal({ a: ['b', 'c'] }); - expect(Qs.parse('a[1]=b&a=c')).to.deep.equal({ a: ['b', 'c'] }); - expect(Qs.parse('a=b&a[1]=c')).to.deep.equal({ a: ['b', 'c'] }); - done(); + t.test('supports encoded = signs', function (st) { + st.deepEqual(qs.parse('he%3Dllo=th%3Dere'), { 'he=llo': 'th=ere' }); + st.end(); }); - it('parses a nested array', function (done) { - - expect(Qs.parse('a[b][]=c&a[b][]=d')).to.deep.equal({ a: { b: ['c', 'd'] } }); - expect(Qs.parse('a[>=]=25')).to.deep.equal({ a: { '>=': '25' } }); - done(); - }); - - it('allows to specify array indices', function (done) { - - expect(Qs.parse('a[1]=c&a[0]=b&a[2]=d')).to.deep.equal({ a: ['b', 'c', 'd'] }); - expect(Qs.parse('a[1]=c&a[0]=b')).to.deep.equal({ a: ['b', 'c'] }); - expect(Qs.parse('a[1]=c')).to.deep.equal({ a: ['c'] }); - done(); - }); - - it('limits specific array indices to 20', function (done) { - - expect(Qs.parse('a[20]=a')).to.deep.equal({ a: ['a'] }); - expect(Qs.parse('a[21]=a')).to.deep.equal({ a: { '21': 'a' } }); - done(); - }); - - it('supports keys that begin with a number', function (done) { - - expect(Qs.parse('a[12b]=c')).to.deep.equal({ a: { '12b': 'c' } }); - done(); - }); - - it('supports encoded = signs', function (done) { - - expect(Qs.parse('he%3Dllo=th%3Dere')).to.deep.equal({ 'he=llo': 'th=ere' }); - done(); - }); - - it('is ok with url encoded strings', function (done) { - - expect(Qs.parse('a[b%20c]=d')).to.deep.equal({ a: { 'b c': 'd' } }); - expect(Qs.parse('a[b]=c%20d')).to.deep.equal({ a: { b: 'c d' } }); - done(); - }); - - it('allows brackets in the value', function (done) { - - expect(Qs.parse('pets=["tobi"]')).to.deep.equal({ pets: '["tobi"]' }); - expect(Qs.parse('operators=[">=", "<="]')).to.deep.equal({ operators: '[">=", "<="]' }); - done(); + t.test('is ok with url encoded strings', function (st) { + st.deepEqual(qs.parse('a[b%20c]=d'), { a: { 'b c': 'd' } }); + st.deepEqual(qs.parse('a[b]=c%20d'), { a: { b: 'c d' } }); + st.end(); }); - it('allows empty values', function (done) { - - expect(Qs.parse('')).to.deep.equal({}); - expect(Qs.parse(null)).to.deep.equal({}); - expect(Qs.parse(undefined)).to.deep.equal({}); - done(); + t.test('allows brackets in the value', function (st) { + st.deepEqual(qs.parse('pets=["tobi"]'), { pets: '["tobi"]' }); + st.deepEqual(qs.parse('operators=[">=", "<="]'), { operators: '[">=", "<="]' }); + st.end(); }); - it('transforms arrays to objects', function (done) { - - expect(Qs.parse('foo[0]=bar&foo[bad]=baz')).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } }); - expect(Qs.parse('foo[bad]=baz&foo[0]=bar')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } }); - expect(Qs.parse('foo[bad]=baz&foo[]=bar')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } }); - expect(Qs.parse('foo[]=bar&foo[bad]=baz')).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } }); - expect(Qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar', '1': 'foo' } }); - expect(Qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb')).to.deep.equal({ foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); - expect(Qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c')).to.deep.equal({ a: { '0': 'b', t: 'u', c: true } }); - expect(Qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y')).to.deep.equal({ a: { '0': 'b', '1': 'c', x: 'y' } }); - done(); + t.test('allows empty values', function (st) { + st.deepEqual(qs.parse(''), {}); + st.deepEqual(qs.parse(null), {}); + st.deepEqual(qs.parse(undefined), {}); + st.end(); }); - it('transforms arrays to objects (dot notation)', function (done) { - - expect(Qs.parse('foo[0].baz=bar&fool.bad=baz', { allowDots: true })).to.deep.equal({ foo: [{ baz: 'bar' }], fool: { bad: 'baz' } }); - expect(Qs.parse('foo[0].baz=bar&fool.bad.boo=baz', { allowDots: true })).to.deep.equal({ foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } }); - expect(Qs.parse('foo[0][0].baz=bar&fool.bad=baz', { allowDots: true })).to.deep.equal({ foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } }); - expect(Qs.parse('foo[0].baz[0]=15&foo[0].bar=2', { allowDots: true })).to.deep.equal({ foo: [{ baz: ['15'], bar: '2' }] }); - expect(Qs.parse('foo[0].baz[0]=15&foo[0].baz[1]=16&foo[0].bar=2', { allowDots: true })).to.deep.equal({ foo: [{ baz: ['15', '16'], bar: '2' }] }); - expect(Qs.parse('foo.bad=baz&foo[0]=bar', { allowDots: true })).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } }); - expect(Qs.parse('foo.bad=baz&foo[]=bar', { allowDots: true })).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } }); - expect(Qs.parse('foo[]=bar&foo.bad=baz', { allowDots: true })).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } }); - expect(Qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo', { allowDots: true })).to.deep.equal({ foo: { bad: 'baz', '0': 'bar', '1': 'foo' } }); - expect(Qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb', { allowDots: true })).to.deep.equal({ foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); - done(); + t.test('transforms arrays to objects', function (st) { + st.deepEqual(qs.parse('foo[0]=bar&foo[bad]=baz'), { foo: { '0': 'bar', bad: 'baz' } }); + st.deepEqual(qs.parse('foo[bad]=baz&foo[0]=bar'), { foo: { bad: 'baz', '0': 'bar' } }); + st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar'), { foo: { bad: 'baz', '0': 'bar' } }); + st.deepEqual(qs.parse('foo[]=bar&foo[bad]=baz'), { foo: { '0': 'bar', bad: 'baz' } }); + st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo'), { foo: { bad: 'baz', '0': 'bar', '1': 'foo' } }); + st.deepEqual(qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb'), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); + st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c'), { a: { '0': 'b', t: 'u', c: true } }); + st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y'), { a: { '0': 'b', '1': 'c', x: 'y' } }); + st.end(); }); - it('can add keys to objects', function (done) { - - expect(Qs.parse('a[b]=c&a=d')).to.deep.equal({ a: { b: 'c', d: true } }); - done(); + t.test('transforms arrays to objects (dot notation)', function (st) { + st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: 'baz' } }); + st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad.boo=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } }); + st.deepEqual(qs.parse('foo[0][0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } }); + st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15'], bar: '2' }] }); + st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].baz[1]=16&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15', '16'], bar: '2' }] }); + st.deepEqual(qs.parse('foo.bad=baz&foo[0]=bar', { allowDots: true }), { foo: { bad: 'baz', '0': 'bar' } }); + st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar', { allowDots: true }), { foo: { bad: 'baz', '0': 'bar' } }); + st.deepEqual(qs.parse('foo[]=bar&foo.bad=baz', { allowDots: true }), { foo: { '0': 'bar', bad: 'baz' } }); + st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo', { allowDots: true }), { foo: { bad: 'baz', '0': 'bar', '1': 'foo' } }); + st.deepEqual(qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb', { allowDots: true }), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); + st.end(); }); - it('correctly prunes undefined values when converting an array to an object', function (done) { + t.deepEqual(qs.parse('a[b]=c&a=d'), { a: { b: 'c', d: true } }, 'can add keys to objects'); - expect(Qs.parse('a[2]=b&a[99999999]=c')).to.deep.equal({ a: { '2': 'b', '99999999': 'c' } }); - done(); + t.test('correctly prunes undefined values when converting an array to an object', function (st) { + st.deepEqual(qs.parse('a[2]=b&a[99999999]=c'), { a: { '2': 'b', '99999999': 'c' } }); + st.end(); }); - it('supports malformed uri characters', function (done) { - - expect(Qs.parse('{%:%}', { strictNullHandling: true })).to.deep.equal({ '{%:%}': null }); - expect(Qs.parse('{%:%}=')).to.deep.equal({ '{%:%}': '' }); - expect(Qs.parse('foo=%:%}')).to.deep.equal({ foo: '%:%}' }); - done(); + t.test('supports malformed uri characters', function (st) { + st.deepEqual(qs.parse('{%:%}', { strictNullHandling: true }), { '{%:%}': null }); + st.deepEqual(qs.parse('{%:%}='), { '{%:%}': '' }); + st.deepEqual(qs.parse('foo=%:%}'), { foo: '%:%}' }); + st.end(); }); - it('doesn\'t produce empty keys', function (done) { - - expect(Qs.parse('_r=1&')).to.deep.equal({ '_r': '1' }); - done(); + t.test('doesn\'t produce empty keys', function (st) { + st.deepEqual(qs.parse('_r=1&'), { '_r': '1' }); + st.end(); }); - it('cannot access Object prototype', function (done) { - - Qs.parse('constructor[prototype][bad]=bad'); - Qs.parse('bad[constructor][prototype][bad]=bad'); - expect(typeof Object.prototype.bad).to.equal('undefined'); - done(); + t.test('cannot access Object prototype', function (st) { + qs.parse('constructor[prototype][bad]=bad'); + qs.parse('bad[constructor][prototype][bad]=bad'); + st.equal(typeof Object.prototype.bad, 'undefined'); + st.end(); }); - it('parses arrays of objects', function (done) { - - expect(Qs.parse('a[][b]=c')).to.deep.equal({ a: [{ b: 'c' }] }); - expect(Qs.parse('a[0][b]=c')).to.deep.equal({ a: [{ b: 'c' }] }); - done(); + t.test('parses arrays of objects', function (st) { + st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] }); + st.deepEqual(qs.parse('a[0][b]=c'), { a: [{ b: 'c' }] }); + st.end(); }); - it('allows for empty strings in arrays', function (done) { - - expect(Qs.parse('a[]=b&a[]=&a[]=c')).to.deep.equal({ a: ['b', '', 'c'] }); - expect(Qs.parse('a[0]=b&a[1]&a[2]=c&a[19]=', { strictNullHandling: true })).to.deep.equal({ a: ['b', null, 'c', ''] }); - expect(Qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]', { strictNullHandling: true })).to.deep.equal({ a: ['b', '', 'c', null] }); - expect(Qs.parse('a[]=&a[]=b&a[]=c')).to.deep.equal({ a: ['', 'b', 'c'] }); - done(); + t.test('allows for empty strings in arrays', function (st) { + st.deepEqual(qs.parse('a[]=b&a[]=&a[]=c'), { a: ['b', '', 'c'] }); + st.deepEqual(qs.parse('a[0]=b&a[1]&a[2]=c&a[19]=', { strictNullHandling: true }), { a: ['b', null, 'c', ''] }); + st.deepEqual(qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]', { strictNullHandling: true }), { a: ['b', '', 'c', null] }); + st.deepEqual(qs.parse('a[]=&a[]=b&a[]=c'), { a: ['', 'b', 'c'] }); + st.end(); }); - it('compacts sparse arrays', function (done) { - - expect(Qs.parse('a[10]=1&a[2]=2')).to.deep.equal({ a: ['2', '1'] }); - done(); + t.test('compacts sparse arrays', function (st) { + st.deepEqual(qs.parse('a[10]=1&a[2]=2'), { a: ['2', '1'] }); + st.end(); }); - it('parses semi-parsed strings', function (done) { - - expect(Qs.parse({ 'a[b]': 'c' })).to.deep.equal({ a: { b: 'c' } }); - expect(Qs.parse({ 'a[b]': 'c', 'a[d]': 'e' })).to.deep.equal({ a: { b: 'c', d: 'e' } }); - done(); + t.test('parses semi-parsed strings', function (st) { + st.deepEqual(qs.parse({ 'a[b]': 'c' }), { a: { b: 'c' } }); + st.deepEqual(qs.parse({ 'a[b]': 'c', 'a[d]': 'e' }), { a: { b: 'c', d: 'e' } }); + st.end(); }); - it('parses buffers correctly', function (done) { - + t.test('parses buffers correctly', function (st) { var b = new Buffer('test'); - expect(Qs.parse({ a: b })).to.deep.equal({ a: b }); - done(); + st.deepEqual(qs.parse({ a: b }), { a: b }); + st.end(); }); - it('continues parsing when no parent is found', function (done) { - - expect(Qs.parse('[]=&a=b')).to.deep.equal({ '0': '', a: 'b' }); - expect(Qs.parse('[]&a=b', { strictNullHandling: true })).to.deep.equal({ '0': null, a: 'b' }); - expect(Qs.parse('[foo]=bar')).to.deep.equal({ foo: 'bar' }); - done(); + t.test('continues parsing when no parent is found', function (st) { + st.deepEqual(qs.parse('[]=&a=b'), { '0': '', a: 'b' }); + st.deepEqual(qs.parse('[]&a=b', { strictNullHandling: true }), { '0': null, a: 'b' }); + st.deepEqual(qs.parse('[foo]=bar'), { foo: 'bar' }); + st.end(); }); - it('does not error when parsing a very long array', function (done) { - + t.test('does not error when parsing a very long array', function (st) { var str = 'a[]=a'; while (Buffer.byteLength(str) < 128 * 1024) { - str += '&' + str; + str = str + '&' + str; } - expect(function () { + st.doesNotThrow(function () { qs.parse(str); }); - Qs.parse(str); - }).to.not.throw(); - - done(); + st.end(); }); - it('should not throw when a native prototype has an enumerable property', { parallel: false }, function (done) { - + t.test('should not throw when a native prototype has an enumerable property', { parallel: false }, function (st) { Object.prototype.crash = ''; Array.prototype.crash = ''; - expect(Qs.parse.bind(null, 'a=b')).to.not.throw(); - expect(Qs.parse('a=b')).to.deep.equal({ a: 'b' }); - expect(Qs.parse.bind(null, 'a[][b]=c')).to.not.throw(); - expect(Qs.parse('a[][b]=c')).to.deep.equal({ a: [{ b: 'c' }] }); + st.doesNotThrow(qs.parse.bind(null, 'a=b')); + st.deepEqual(qs.parse('a=b'), { a: 'b' }); + st.doesNotThrow(qs.parse.bind(null, 'a[][b]=c')); + st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] }); delete Object.prototype.crash; delete Array.prototype.crash; - done(); + st.end(); }); - it('parses a string with an alternative string delimiter', function (done) { - - expect(Qs.parse('a=b;c=d', { delimiter: ';' })).to.deep.equal({ a: 'b', c: 'd' }); - done(); + t.test('parses a string with an alternative string delimiter', function (st) { + st.deepEqual(qs.parse('a=b;c=d', { delimiter: ';' }), { a: 'b', c: 'd' }); + st.end(); }); - it('parses a string with an alternative RegExp delimiter', function (done) { - - expect(Qs.parse('a=b; c=d', { delimiter: /[;,] */ })).to.deep.equal({ a: 'b', c: 'd' }); - done(); + t.test('parses a string with an alternative RegExp delimiter', function (st) { + st.deepEqual(qs.parse('a=b; c=d', { delimiter: /[;,] */ }), { a: 'b', c: 'd' }); + st.end(); }); - it('does not use non-splittable objects as delimiters', function (done) { - - expect(Qs.parse('a=b&c=d', { delimiter: true })).to.deep.equal({ a: 'b', c: 'd' }); - done(); + t.test('does not use non-splittable objects as delimiters', function (st) { + st.deepEqual(qs.parse('a=b&c=d', { delimiter: true }), { a: 'b', c: 'd' }); + st.end(); }); - it('allows overriding parameter limit', function (done) { - - expect(Qs.parse('a=b&c=d', { parameterLimit: 1 })).to.deep.equal({ a: 'b' }); - done(); + t.test('allows overriding parameter limit', function (st) { + st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: 1 }), { a: 'b' }); + st.end(); }); - it('allows setting the parameter limit to Infinity', function (done) { - - expect(Qs.parse('a=b&c=d', { parameterLimit: Infinity })).to.deep.equal({ a: 'b', c: 'd' }); - done(); + t.test('allows setting the parameter limit to Infinity', function (st) { + st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: Infinity }), { a: 'b', c: 'd' }); + st.end(); }); - it('allows overriding array limit', function (done) { - - expect(Qs.parse('a[0]=b', { arrayLimit: -1 })).to.deep.equal({ a: { '0': 'b' } }); - expect(Qs.parse('a[-1]=b', { arrayLimit: -1 })).to.deep.equal({ a: { '-1': 'b' } }); - expect(Qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 })).to.deep.equal({ a: { '0': 'b', '1': 'c' } }); - done(); + t.test('allows overriding array limit', function (st) { + st.deepEqual(qs.parse('a[0]=b', { arrayLimit: -1 }), { a: { '0': 'b' } }); + st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: -1 }), { a: { '-1': 'b' } }); + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 }), { a: { '0': 'b', '1': 'c' } }); + st.end(); }); - it('allows disabling array parsing', function (done) { - - expect(Qs.parse('a[0]=b&a[1]=c', { parseArrays: false })).to.deep.equal({ a: { '0': 'b', '1': 'c' } }); - done(); + t.test('allows disabling array parsing', function (st) { + st.deepEqual(qs.parse('a[0]=b&a[1]=c', { parseArrays: false }), { a: { '0': 'b', '1': 'c' } }); + st.end(); }); - it('parses an object', function (done) { - + t.test('parses an object', function (st) { var input = { 'user[name]': { 'pop[bob]': 3 }, 'user[email]': null }; var expected = { - 'user': { - 'name': { 'pop[bob]': 3 }, - 'email': null + user: { + name: { 'pop[bob]': 3 }, + email: null } }; - var result = Qs.parse(input); + var result = qs.parse(input); - expect(result).to.deep.equal(expected); - done(); + st.deepEqual(result, expected); + st.end(); }); - it('parses an object in dot notation', function (done) { - + t.test('parses an object in dot notation', function (st) { var input = { 'user.name': { 'pop[bob]': 3 }, 'user.email.': null }; var expected = { - 'user': { - 'name': { 'pop[bob]': 3 }, - 'email': null + user: { + name: { 'pop[bob]': 3 }, + email: null } }; - var result = Qs.parse(input, { allowDots: true }); + var result = qs.parse(input, { allowDots: true }); - expect(result).to.deep.equal(expected); - done(); + st.deepEqual(result, expected); + st.end(); }); - it('parses an object and not child values', function (done) { - + t.test('parses an object and not child values', function (st) { var input = { 'user[name]': { 'pop[bob]': { 'test': 3 } }, 'user[email]': null }; var expected = { - 'user': { - 'name': { 'pop[bob]': { 'test': 3 } }, - 'email': null + user: { + name: { 'pop[bob]': { 'test': 3 } }, + email: null } }; - var result = Qs.parse(input); + var result = qs.parse(input); - expect(result).to.deep.equal(expected); - done(); + st.deepEqual(result, expected); + st.end(); }); - it('does not blow up when Buffer global is missing', function (done) { - + t.test('does not blow up when Buffer global is missing', function (st) { var tempBuffer = global.Buffer; delete global.Buffer; - var result = Qs.parse('a=b&c=d'); + var result = qs.parse('a=b&c=d'); global.Buffer = tempBuffer; - expect(result).to.deep.equal({ a: 'b', c: 'd' }); - done(); + st.deepEqual(result, { a: 'b', c: 'd' }); + st.end(); }); - it('does not crash when parsing circular references', function (done) { - + t.test('does not crash when parsing circular references', function (st) { var a = {}; a.b = a; var parsed; - expect(function () { - - parsed = Qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a }); - }).to.not.throw(); + st.doesNotThrow(function () { + parsed = qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a }); + }); - expect(parsed).to.contain('foo'); - expect(parsed.foo).to.contain('bar', 'baz'); - expect(parsed.foo.bar).to.equal('baz'); - expect(parsed.foo.baz).to.deep.equal(a); - done(); + st.equal('foo' in parsed, true, 'parsed has "foo" property'); + st.equal('bar' in parsed.foo, true); + st.equal('baz' in parsed.foo, true); + st.equal(parsed.foo.bar, 'baz'); + st.deepEqual(parsed.foo.baz, a); + st.end(); }); - it('parses plain objects correctly', function (done) { - + t.test('parses plain objects correctly', function (st) { var a = Object.create(null); a.b = 'c'; - expect(Qs.parse(a)).to.deep.equal({ b: 'c' }); - var result = Qs.parse({ a: a }); - expect(result).to.contain('a'); - expect(result.a).to.deep.equal(a); - done(); + st.deepEqual(qs.parse(a), { b: 'c' }); + var result = qs.parse({ a: a }); + st.equal('a' in result, true, 'result has "a" property'); + st.deepEqual(result.a, a); + st.end(); }); - it('parses dates correctly', function (done) { - + t.test('parses dates correctly', function (st) { var now = new Date(); - expect(Qs.parse({ a: now })).to.deep.equal({ a: now }); - done(); + st.deepEqual(qs.parse({ a: now }), { a: now }); + st.end(); }); - it('parses regular expressions correctly', function (done) { - + t.test('parses regular expressions correctly', function (st) { var re = /^test$/; - expect(Qs.parse({ a: re })).to.deep.equal({ a: re }); - done(); + st.deepEqual(qs.parse({ a: re }), { a: re }); + st.end(); }); - it('can allow overwriting prototype properties', function (done) { - - expect(Qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true })).to.deep.equal({ a: { hasOwnProperty: 'b' } }, { prototype: false }); - expect(Qs.parse('hasOwnProperty=b', { allowPrototypes: true })).to.deep.equal({ hasOwnProperty: 'b' }, { prototype: false }); - done(); + t.test('can allow overwriting prototype properties', function (st) { + st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }), { a: { hasOwnProperty: 'b' } }, { prototype: false }); + st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: true }), { hasOwnProperty: 'b' }, { prototype: false }); + st.end(); }); - it('can return plain objects', function (done) { - + t.test('can return plain objects', function (st) { var expected = Object.create(null); expected.a = Object.create(null); expected.a.b = 'c'; expected.a.hasOwnProperty = 'd'; - expect(Qs.parse('a[b]=c&a[hasOwnProperty]=d', { plainObjects: true })).to.deep.equal(expected); - expect(Qs.parse(null, { plainObjects: true })).to.deep.equal(Object.create(null)); + st.deepEqual(qs.parse('a[b]=c&a[hasOwnProperty]=d', { plainObjects: true }), expected); + st.deepEqual(qs.parse(null, { plainObjects: true }), Object.create(null)); var expectedArray = Object.create(null); expectedArray.a = Object.create(null); expectedArray.a['0'] = 'b'; expectedArray.a.c = 'd'; - expect(Qs.parse('a[]=b&a[c]=d', { plainObjects: true })).to.deep.equal(expectedArray); - done(); + st.deepEqual(qs.parse('a[]=b&a[c]=d', { plainObjects: true }), expectedArray); + st.end(); }); }); diff --git a/deps/npm/node_modules/request/node_modules/qs/test/stringify.js b/deps/npm/node_modules/request/node_modules/qs/test/stringify.js old mode 100644 new mode 100755 index 5163700f301ffe..88d22f25e932be --- a/deps/npm/node_modules/request/node_modules/qs/test/stringify.js +++ b/deps/npm/node_modules/request/node_modules/qs/test/stringify.js @@ -1,281 +1,235 @@ -/* eslint no-extend-native:0 */ -// Load modules +'use strict'; -var Code = require('code'); -var Lab = require('lab'); -var Qs = require('../'); +var test = require('tape'); +var qs = require('../'); - -// Declare internals - -var internals = {}; - - -// Test shortcuts - -var lab = exports.lab = Lab.script(); -var expect = Code.expect; -var describe = lab.experiment; -var it = lab.test; - - -describe('stringify()', function () { - - it('stringifies a querystring object', function (done) { - - expect(Qs.stringify({ a: 'b' })).to.equal('a=b'); - expect(Qs.stringify({ a: 1 })).to.equal('a=1'); - expect(Qs.stringify({ a: 1, b: 2 })).to.equal('a=1&b=2'); - expect(Qs.stringify({ a: 'A_Z' })).to.equal('a=A_Z'); - expect(Qs.stringify({ a: '€' })).to.equal('a=%E2%82%AC'); - expect(Qs.stringify({ a: '' })).to.equal('a=%EE%80%80'); - expect(Qs.stringify({ a: 'א' })).to.equal('a=%D7%90'); - expect(Qs.stringify({ a: '𐐷' })).to.equal('a=%F0%90%90%B7'); - done(); +test('stringify()', function (t) { + t.test('stringifies a querystring object', function (st) { + st.equal(qs.stringify({ a: 'b' }), 'a=b'); + st.equal(qs.stringify({ a: 1 }), 'a=1'); + st.equal(qs.stringify({ a: 1, b: 2 }), 'a=1&b=2'); + st.equal(qs.stringify({ a: 'A_Z' }), 'a=A_Z'); + st.equal(qs.stringify({ a: '€' }), 'a=%E2%82%AC'); + st.equal(qs.stringify({ a: '' }), 'a=%EE%80%80'); + st.equal(qs.stringify({ a: 'א' }), 'a=%D7%90'); + st.equal(qs.stringify({ a: '𐐷' }), 'a=%F0%90%90%B7'); + st.end(); }); - it('stringifies a nested object', function (done) { - - expect(Qs.stringify({ a: { b: 'c' } })).to.equal('a%5Bb%5D=c'); - expect(Qs.stringify({ a: { b: { c: { d: 'e' } } } })).to.equal('a%5Bb%5D%5Bc%5D%5Bd%5D=e'); - done(); + t.test('stringifies a nested object', function (st) { + st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); + st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }), 'a%5Bb%5D%5Bc%5D%5Bd%5D=e'); + st.end(); }); - it('stringifies an array value', function (done) { - - expect(Qs.stringify({ a: ['b', 'c', 'd'] })).to.equal('a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d'); - done(); + t.test('stringifies an array value', function (st) { + st.equal(qs.stringify({ a: ['b', 'c', 'd'] }), 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d'); + st.end(); }); - it('omits nulls when asked', function (done) { - - expect(Qs.stringify({ a: 'b', c: null }, { skipNulls: true })).to.equal('a=b'); - done(); + t.test('omits nulls when asked', function (st) { + st.equal(qs.stringify({ a: 'b', c: null }, { skipNulls: true }), 'a=b'); + st.end(); }); - it('omits nested nulls when asked', function (done) { - - expect(Qs.stringify({ a: { b: 'c', d: null } }, { skipNulls: true })).to.equal('a%5Bb%5D=c'); - done(); + t.test('omits nested nulls when asked', function (st) { + st.equal(qs.stringify({ a: { b: 'c', d: null } }, { skipNulls: true }), 'a%5Bb%5D=c'); + st.end(); }); - it('omits array indices when asked', function (done) { - - expect(Qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false })).to.equal('a=b&a=c&a=d'); - done(); + t.test('omits array indices when asked', function (st) { + st.equal(qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }), 'a=b&a=c&a=d'); + st.end(); }); - it('stringifies a nested array value', function (done) { - - expect(Qs.stringify({ a: { b: ['c', 'd'] } })).to.equal('a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d'); - done(); + t.test('stringifies a nested array value', function (st) { + st.equal(qs.stringify({ a: { b: ['c', 'd'] } }), 'a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d'); + st.end(); }); - it('stringifies an object inside an array', function (done) { - - expect(Qs.stringify({ a: [{ b: 'c' }] })).to.equal('a%5B0%5D%5Bb%5D=c'); - expect(Qs.stringify({ a: [{ b: { c: [1] } }] })).to.equal('a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1'); - done(); + t.test('stringifies an object inside an array', function (st) { + st.equal(qs.stringify({ a: [{ b: 'c' }] }), 'a%5B0%5D%5Bb%5D=c'); + st.equal(qs.stringify({ a: [{ b: { c: [1] } }] }), 'a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1'); + st.end(); }); - it('does not omit object keys when indices = false', function (done) { - - expect(Qs.stringify({ a: [{ b: 'c' }] }, { indices: false })).to.equal('a%5Bb%5D=c'); - done(); + t.test('does not omit object keys when indices = false', function (st) { + st.equal(qs.stringify({ a: [{ b: 'c' }] }, { indices: false }), 'a%5Bb%5D=c'); + st.end(); }); - it('uses indices notation for arrays when indices=true', function (done) { - - expect(Qs.stringify({ a: ['b', 'c'] }, { indices: true })).to.equal('a%5B0%5D=b&a%5B1%5D=c'); - done(); + t.test('uses indices notation for arrays when indices=true', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { indices: true }), 'a%5B0%5D=b&a%5B1%5D=c'); + st.end(); }); - it('uses indices notation for arrays when no arrayFormat is specified', function (done) { - - expect(Qs.stringify({ a: ['b', 'c'] })).to.equal('a%5B0%5D=b&a%5B1%5D=c'); - done(); + t.test('uses indices notation for arrays when no arrayFormat is specified', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }), 'a%5B0%5D=b&a%5B1%5D=c'); + st.end(); }); - it('uses indices notation for arrays when no arrayFormat=indices', function (done) { - - expect(Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' })).to.equal('a%5B0%5D=b&a%5B1%5D=c'); - done(); + t.test('uses indices notation for arrays when no arrayFormat=indices', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }), 'a%5B0%5D=b&a%5B1%5D=c'); + st.end(); }); - it('uses repeat notation for arrays when no arrayFormat=repeat', function (done) { - - expect(Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })).to.equal('a=b&a=c'); - done(); + t.test('uses repeat notation for arrays when no arrayFormat=repeat', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }), 'a=b&a=c'); + st.end(); }); - it('uses brackets notation for arrays when no arrayFormat=brackets', function (done) { - - expect(Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' })).to.equal('a%5B%5D=b&a%5B%5D=c'); - done(); + t.test('uses brackets notation for arrays when no arrayFormat=brackets', function (st) { + st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }), 'a%5B%5D=b&a%5B%5D=c'); + st.end(); }); - it('stringifies a complicated object', function (done) { - - expect(Qs.stringify({ a: { b: 'c', d: 'e' } })).to.equal('a%5Bb%5D=c&a%5Bd%5D=e'); - done(); + t.test('stringifies a complicated object', function (st) { + st.equal(qs.stringify({ a: { b: 'c', d: 'e' } }), 'a%5Bb%5D=c&a%5Bd%5D=e'); + st.end(); }); - it('stringifies an empty value', function (done) { - - expect(Qs.stringify({ a: '' })).to.equal('a='); - expect(Qs.stringify({ a: null }, { strictNullHandling: true })).to.equal('a'); + t.test('stringifies an empty value', function (st) { + st.equal(qs.stringify({ a: '' }), 'a='); + st.equal(qs.stringify({ a: null }, { strictNullHandling: true }), 'a'); - expect(Qs.stringify({ a: '', b: '' })).to.equal('a=&b='); - expect(Qs.stringify({ a: null, b: '' }, { strictNullHandling: true })).to.equal('a&b='); + st.equal(qs.stringify({ a: '', b: '' }), 'a=&b='); + st.equal(qs.stringify({ a: null, b: '' }, { strictNullHandling: true }), 'a&b='); - expect(Qs.stringify({ a: { b: '' } })).to.equal('a%5Bb%5D='); - expect(Qs.stringify({ a: { b: null } }, { strictNullHandling: true })).to.equal('a%5Bb%5D'); - expect(Qs.stringify({ a: { b: null } }, { strictNullHandling: false })).to.equal('a%5Bb%5D='); + st.equal(qs.stringify({ a: { b: '' } }), 'a%5Bb%5D='); + st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: true }), 'a%5Bb%5D'); + st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: false }), 'a%5Bb%5D='); - done(); + st.end(); }); - it('stringifies an empty object', function (done) { - + t.test('stringifies an empty object', function (st) { var obj = Object.create(null); obj.a = 'b'; - expect(Qs.stringify(obj)).to.equal('a=b'); - done(); + st.equal(qs.stringify(obj), 'a=b'); + st.end(); }); - it('returns an empty string for invalid input', function (done) { - - expect(Qs.stringify(undefined)).to.equal(''); - expect(Qs.stringify(false)).to.equal(''); - expect(Qs.stringify(null)).to.equal(''); - expect(Qs.stringify('')).to.equal(''); - done(); + t.test('returns an empty string for invalid input', function (st) { + st.equal(qs.stringify(undefined), ''); + st.equal(qs.stringify(false), ''); + st.equal(qs.stringify(null), ''); + st.equal(qs.stringify(''), ''); + st.end(); }); - it('stringifies an object with an empty object as a child', function (done) { - + t.test('stringifies an object with an empty object as a child', function (st) { var obj = { a: Object.create(null) }; obj.a.b = 'c'; - expect(Qs.stringify(obj)).to.equal('a%5Bb%5D=c'); - done(); + st.equal(qs.stringify(obj), 'a%5Bb%5D=c'); + st.end(); }); - it('drops keys with a value of undefined', function (done) { - - expect(Qs.stringify({ a: undefined })).to.equal(''); + t.test('drops keys with a value of undefined', function (st) { + st.equal(qs.stringify({ a: undefined }), ''); - expect(Qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true })).to.equal('a%5Bc%5D'); - expect(Qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false })).to.equal('a%5Bc%5D='); - expect(Qs.stringify({ a: { b: undefined, c: '' } })).to.equal('a%5Bc%5D='); - done(); + st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true }), 'a%5Bc%5D'); + st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false }), 'a%5Bc%5D='); + st.equal(qs.stringify({ a: { b: undefined, c: '' } }), 'a%5Bc%5D='); + st.end(); }); - it('url encodes values', function (done) { - - expect(Qs.stringify({ a: 'b c' })).to.equal('a=b%20c'); - done(); + t.test('url encodes values', function (st) { + st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c'); + st.end(); }); - it('stringifies a date', function (done) { - + t.test('stringifies a date', function (st) { var now = new Date(); var str = 'a=' + encodeURIComponent(now.toISOString()); - expect(Qs.stringify({ a: now })).to.equal(str); - done(); + st.equal(qs.stringify({ a: now }), str); + st.end(); }); - it('stringifies the weird object from qs', function (done) { - - expect(Qs.stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' })).to.equal('my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F'); - done(); + t.test('stringifies the weird object from qs', function (st) { + st.equal(qs.stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' }), 'my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F'); + st.end(); }); - it('skips properties that are part of the object prototype', function (done) { - + t.test('skips properties that are part of the object prototype', function (st) { Object.prototype.crash = 'test'; - expect(Qs.stringify({ a: 'b' })).to.equal('a=b'); - expect(Qs.stringify({ a: { b: 'c' } })).to.equal('a%5Bb%5D=c'); + st.equal(qs.stringify({ a: 'b' }), 'a=b'); + st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); delete Object.prototype.crash; - done(); + st.end(); }); - it('stringifies boolean values', function (done) { - - expect(Qs.stringify({ a: true })).to.equal('a=true'); - expect(Qs.stringify({ a: { b: true } })).to.equal('a%5Bb%5D=true'); - expect(Qs.stringify({ b: false })).to.equal('b=false'); - expect(Qs.stringify({ b: { c: false } })).to.equal('b%5Bc%5D=false'); - done(); + t.test('stringifies boolean values', function (st) { + st.equal(qs.stringify({ a: true }), 'a=true'); + st.equal(qs.stringify({ a: { b: true } }), 'a%5Bb%5D=true'); + st.equal(qs.stringify({ b: false }), 'b=false'); + st.equal(qs.stringify({ b: { c: false } }), 'b%5Bc%5D=false'); + st.end(); }); - it('stringifies buffer values', function (done) { - - expect(Qs.stringify({ a: new Buffer('test') })).to.equal('a=test'); - expect(Qs.stringify({ a: { b: new Buffer('test') } })).to.equal('a%5Bb%5D=test'); - done(); + t.test('stringifies buffer values', function (st) { + st.equal(qs.stringify({ a: new Buffer('test') }), 'a=test'); + st.equal(qs.stringify({ a: { b: new Buffer('test') } }), 'a%5Bb%5D=test'); + st.end(); }); - it('stringifies an object using an alternative delimiter', function (done) { - - expect(Qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' })).to.equal('a=b;c=d'); - done(); + t.test('stringifies an object using an alternative delimiter', function (st) { + st.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d'); + st.end(); }); - it('doesn\'t blow up when Buffer global is missing', function (done) { - + t.test('doesn\'t blow up when Buffer global is missing', function (st) { var tempBuffer = global.Buffer; delete global.Buffer; - var result = Qs.stringify({ a: 'b', c: 'd' }); + var result = qs.stringify({ a: 'b', c: 'd' }); global.Buffer = tempBuffer; - expect(result).to.equal('a=b&c=d'); - done(); + st.equal(result, 'a=b&c=d'); + st.end(); }); - it('selects properties when filter=array', function (done) { - - expect(Qs.stringify({ a: 'b' }, { filter: ['a'] })).to.equal('a=b'); - expect(Qs.stringify({ a: 1 }, { filter: [] })).to.equal(''); - expect(Qs.stringify({ a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, { filter: ['a', 'b', 0, 2] })).to.equal('a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3'); - done(); - + t.test('selects properties when filter=array', function (st) { + st.equal(qs.stringify({ a: 'b' }, { filter: ['a'] }), 'a=b'); + st.equal(qs.stringify({ a: 1 }, { filter: [] }), ''); + st.equal(qs.stringify({ a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, { filter: ['a', 'b', 0, 2] }), 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3'); + st.end(); }); - it('supports custom representations when filter=function', function (done) { - + t.test('supports custom representations when filter=function', function (st) { var calls = 0; var obj = { a: 'b', c: 'd', e: { f: new Date(1257894000000) } }; var filterFunc = function (prefix, value) { - calls++; if (calls === 1) { - expect(prefix).to.be.empty(); - expect(value).to.equal(obj); - } - else if (prefix === 'c') { + st.equal(prefix, '', 'prefix is empty'); + st.equal(value, obj); + } else if (prefix === 'c') { return; - } - else if (value instanceof Date) { - expect(prefix).to.equal('e[f]'); + } else if (value instanceof Date) { + st.equal(prefix, 'e[f]'); return value.getTime(); } return value; }; - expect(Qs.stringify(obj, { filter: filterFunc })).to.equal('a=b&e%5Bf%5D=1257894000000'); - expect(calls).to.equal(5); - done(); - + st.equal(qs.stringify(obj, { filter: filterFunc }), 'a=b&e%5Bf%5D=1257894000000'); + st.equal(calls, 5); + st.end(); }); - it('can disable uri encoding', function (done) { + t.test('can disable uri encoding', function (st) { + st.equal(qs.stringify({ a: 'b' }, { encode: false }), 'a=b'); + st.equal(qs.stringify({ a: { b: 'c' } }, { encode: false }), 'a[b]=c'); + st.equal(qs.stringify({ a: 'b', c: null }, { strictNullHandling: true, encode: false }), 'a=b&c'); + st.end(); + }); - expect(Qs.stringify({ a: 'b' }, { encode: false })).to.equal('a=b'); - expect(Qs.stringify({ a: { b: 'c' } }, { encode: false })).to.equal('a[b]=c'); - expect(Qs.stringify({ a: 'b', c: null }, { strictNullHandling: true, encode: false })).to.equal('a=b&c'); - done(); + t.test('can sort the keys', function (st) { + var sort = function (a, b) { return a.localeCompare(b); }; + st.equal(qs.stringify({ a: 'c', z: 'y', b: 'f' }, { sort: sort }), 'a=c&b=f&z=y'); + st.equal(qs.stringify({ a: 'c', z: { j: 'a', i: 'b' }, b: 'f' }, { sort: sort }), 'a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a'); + st.end(); }); }); diff --git a/deps/npm/node_modules/request/node_modules/qs/test/utils.js b/deps/npm/node_modules/request/node_modules/qs/test/utils.js old mode 100644 new mode 100755 index a9a6b520d6ed2c..4a8d8246c9995c --- a/deps/npm/node_modules/request/node_modules/qs/test/utils.js +++ b/deps/npm/node_modules/request/node_modules/qs/test/utils.js @@ -1,28 +1,9 @@ -// Load modules +'use strict'; -var Code = require('code'); -var Lab = require('lab'); -var Utils = require('../lib/utils'); +var test = require('tape'); +var utils = require('../lib/utils'); - -// Declare internals - -var internals = {}; - - -// Test shortcuts - -var lab = exports.lab = Lab.script(); -var expect = Code.expect; -var describe = lab.experiment; -var it = lab.test; - - -describe('merge()', function () { - - it('can merge two objects with the same key', function (done) { - - expect(Utils.merge({ a: 'b' }, { a: 'c' })).to.deep.equal({ a: ['b', 'c'] }); - done(); - }); +test('merge()', function (t) { + t.deepEqual(utils.merge({ a: 'b' }, { a: 'c' }), { a: ['b', 'c'] }, 'merges two objects with the same key'); + t.end(); }); diff --git a/deps/npm/node_modules/request/node_modules/stringstream/LICENSE.txt b/deps/npm/node_modules/request/node_modules/stringstream/LICENSE.txt index eac188156dc030..ab861acdc127bc 100644 --- a/deps/npm/node_modules/request/node_modules/stringstream/LICENSE.txt +++ b/deps/npm/node_modules/request/node_modules/stringstream/LICENSE.txt @@ -1,4 +1,22 @@ -Copyright 2012 Michael Hart (michael.hart.au@gmail.com) +Copyright (c) 2012 Michael Hart (michael.hart.au@gmail.com) -This project is free software released under the MIT license: -http://www.opensource.org/licenses/mit-license.php +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/request/node_modules/stringstream/package.json b/deps/npm/node_modules/request/node_modules/stringstream/package.json index 3b1373bb581d02..9ab3d820ddb754 100644 --- a/deps/npm/node_modules/request/node_modules/stringstream/package.json +++ b/deps/npm/node_modules/request/node_modules/stringstream/package.json @@ -1,48 +1,77 @@ { - "name": "stringstream", - "version": "0.0.4", - "description": "Encode and decode streams into string streams", + "_args": [ + [ + "stringstream@~0.0.4", + "/Users/ogd/Documents/projects/npm/npm/node_modules/request" + ] + ], + "_from": "stringstream@>=0.0.4 <0.1.0", + "_id": "stringstream@0.0.5", + "_inCache": true, + "_installable": true, + "_location": "/request/stringstream", + "_nodeVersion": "4.2.1", + "_npmUser": { + "email": "michael.hart.au@gmail.com", + "name": "hichaelmart" + }, + "_npmVersion": "2.14.8", + "_phantomChildren": {}, + "_requested": { + "name": "stringstream", + "raw": "stringstream@~0.0.4", + "rawSpec": "~0.0.4", + "scope": null, + "spec": ">=0.0.4 <0.1.0", + "type": "range" + }, + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "_shasum": "4e484cd4de5a0bbbee18e46307710a8a81621878", + "_shrinkwrap": null, + "_spec": "stringstream@~0.0.4", + "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request", "author": { - "name": "Michael Hart", "email": "michael.hart.au@gmail.com", + "name": "Michael Hart", "url": "http://github.com/mhart" }, - "main": "stringstream.js", + "bugs": { + "url": "https://github.com/mhart/StringStream/issues" + }, + "dependencies": {}, + "description": "Encode and decode streams into string streams", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "4e484cd4de5a0bbbee18e46307710a8a81621878", + "tarball": "http://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz" + }, + "gitHead": "1efe3bf507bf3a1161f8473908b60e881d41422b", + "homepage": "https://github.com/mhart/StringStream#readme", "keywords": [ - "string", - "stream", "base64", - "gzip" + "gzip", + "stream", + "string" ], - "repository": { - "type": "git", - "url": "git+https://github.com/mhart/StringStream.git" - }, "license": "MIT", - "readme": "# Decode streams into strings The Right Way(tm)\n\n```javascript\nvar fs = require('fs')\nvar zlib = require('zlib')\nvar strs = require('stringstream')\n\nvar utf8Stream = fs.createReadStream('massiveLogFile.gz')\n .pipe(zlib.createGunzip())\n .pipe(strs('utf8'))\n```\n\nNo need to deal with `setEncoding()` weirdness, just compose streams\nlike they were supposed to be!\n\nHandles input and output encoding:\n\n```javascript\n// Stream from utf8 to hex to base64... Why not, ay.\nvar hex64Stream = fs.createReadStream('myFile')\n .pipe(strs('utf8', 'hex'))\n .pipe(strs('hex', 'base64'))\n```\n\nAlso deals with `base64` output correctly by aligning each emitted data\nchunk so that there are no dangling `=` characters:\n\n```javascript\nvar stream = fs.createReadStream('myFile').pipe(strs('base64'))\n\nvar base64Str = ''\n\nstream.on('data', function(data) { base64Str += data })\nstream.on('end', function() {\n console.log('My base64 encoded file is: ' + base64Str) // Wouldn't work with setEncoding()\n console.log('Original file is: ' + new Buffer(base64Str, 'base64'))\n})\n```\n", - "readmeFilename": "README.md", - "_id": "stringstream@0.0.4", - "dist": { - "shasum": "0f0e3423f942960b5692ac324a57dd093bc41a92", - "tarball": "http://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz" - }, - "_npmVersion": "1.2.0", - "_npmUser": { - "name": "hichaelmart", - "email": "michael.hart.au@gmail.com" - }, + "main": "stringstream.js", "maintainers": [ { "name": "hichaelmart", "email": "michael.hart.au@gmail.com" } ], - "directories": {}, - "_shasum": "0f0e3423f942960b5692ac324a57dd093bc41a92", - "_resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz", - "_from": "stringstream@>=0.0.4 <0.1.0", - "bugs": { - "url": "https://github.com/mhart/StringStream/issues" + "name": "stringstream", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/mhart/StringStream.git" }, - "homepage": "https://github.com/mhart/StringStream#readme" + "scripts": {}, + "version": "0.0.5" } diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/.editorconfig b/deps/npm/node_modules/request/node_modules/tough-cookie/.editorconfig deleted file mode 100644 index e09b844f73b251..00000000000000 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -# This file is for unifying the coding style for different editors and IDEs -# editorconfig.org - -root = true - -[*] -end_of_line = lf -charset = utf-8 -insert_final_newline = true -trim_trailing_whitespace = true -indent_style = space -indent_size = 2 diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/.jshintrc b/deps/npm/node_modules/request/node_modules/tough-cookie/.jshintrc deleted file mode 100644 index fb11913a419c1a..00000000000000 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/.jshintrc +++ /dev/null @@ -1,70 +0,0 @@ -{ - "passfail" : false, - "maxerr" : 100, - - "browser" : false, - "node" : true, - "rhino" : false, - "couch" : false, - "wsh" : false, - - "jquery" : false, - "prototypejs" : false, - "mootools" : false, - "dojo" : false, - - "debug" : false, - "devel" : false, - - "esnext" : true, - "strict" : true, - "globalstrict" : true, - - "asi" : false, - "laxbreak" : false, - "bitwise" : true, - "boss" : false, - "curly" : true, - "eqeqeq" : false, - "eqnull" : true, - "evil" : false, - "expr" : false, - "forin" : false, - "immed" : true, - "lastsemic" : true, - "latedef" : false, - "loopfunc" : false, - "noarg" : true, - "regexp" : false, - "regexdash" : false, - "scripturl" : false, - "shadow" : false, - "supernew" : false, - "undef" : true, - "unused" : true, - - "newcap" : true, - "noempty" : true, - "nonew" : true, - "nomen" : false, - "onevar" : false, - "onecase" : true, - "plusplus" : false, - "proto" : false, - "sub" : true, - "trailing" : true, - "white" : false, - - "predef": [ - "describe", - "it", - "before", - "beforeEach", - "after", - "afterEach", - "expect", - "setTimeout", - "clearTimeout" - ], - "maxlen": 0 -} diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/.npmignore b/deps/npm/node_modules/request/node_modules/tough-cookie/.npmignore deleted file mode 100644 index 5a8d2d853e7285..00000000000000 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -.idea -node_modules/ -.*.sw[nmop] -npm-debug.log diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/.travis.yml b/deps/npm/node_modules/request/node_modules/tough-cookie/.travis.yml deleted file mode 100644 index 02059d0d51fd6a..00000000000000 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: node_js -node_js: -- "0.10" -- "0.12" -- iojs -matrix: - fast_finish: true - allow_failures: - - node_js: 0.11 diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/LICENSE b/deps/npm/node_modules/request/node_modules/tough-cookie/LICENSE index 84e0cad1706b71..1bc286fb579cd7 100644 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/LICENSE +++ b/deps/npm/node_modules/request/node_modules/tough-cookie/LICENSE @@ -17,58 +17,11 @@ The following exceptions apply: === -`pubSufTest()` of generate-pubsuffix.js is in the public domain. - - // Any copyright is dedicated to the Public Domain. - // http://creativecommons.org/publicdomain/zero/1.0/ - -=== - -`public-suffix.txt` was obtained from - -via . - -That file contains the usual Mozilla triple-license, for which this project uses it -under the terms of the MPL 1.1: - - // ***** BEGIN LICENSE BLOCK ***** - // Version: MPL 1.1/GPL 2.0/LGPL 2.1 - // - // The contents of this file are subject to the Mozilla Public License Version - // 1.1 (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.mozilla.org/MPL/ - // - // Software distributed under the License is distributed on an "AS IS" basis, - // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - // for the specific language governing rights and limitations under the - // License. - // - // The Original Code is the Public Suffix List. - // - // The Initial Developer of the Original Code is - // Jo Hermans . - // Portions created by the Initial Developer are Copyright (C) 2007 - // the Initial Developer. All Rights Reserved. - // - // Contributor(s): - // Ruben Arakelyan - // Gervase Markham - // Pamela Greene - // David Triendl - // Jothan Frakes - // The kind representatives of many TLD registries - // - // Alternatively, the contents of this file may be used under the terms of - // either the GNU General Public License Version 2 or later (the "GPL"), or - // the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - // in which case the provisions of the GPL or the LGPL are applicable instead - // of those above. If you wish to allow use of your version of this file only - // under the terms of either the GPL or the LGPL, and not to allow others to - // use your version of this file under the terms of the MPL, indicate your - // decision by deleting the provisions above and replace them with the notice - // and other provisions required by the GPL or the LGPL. If you do not delete - // the provisions above, a recipient may use your version of this file under - // the terms of any one of the MPL, the GPL or the LGPL. - // - // ***** END LICENSE BLOCK ***** +`public_suffix_list.dat` was obtained from + via +. The license for this file is MPL/2.0. The header of +that file reads as follows: + + // This Source Code Form is subject to the terms of the Mozilla Public + // License, v. 2.0. If a copy of the MPL was not distributed with this + // file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/README.md b/deps/npm/node_modules/request/node_modules/tough-cookie/README.md index 419dd48d580d63..9899dbf6eed156 100644 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/README.md +++ b/deps/npm/node_modules/request/node_modules/tough-cookie/README.md @@ -68,9 +68,9 @@ Answers "does the request-path path-match a given cookie-path?" as per RFC6265 S This is essentially a prefix-match where `cookiePath` is a prefix of `reqPath`. -### `parse(header)` +### `parse(cookieString[, options])` -alias for `Cookie.parse(header)` +alias for `Cookie.parse(cookieString[, options])` ### `fromJSON(string)` @@ -112,15 +112,21 @@ Generates a list of all possible paths that `pathMatch()` the parameter. May be Exported via `tough.Cookie`. -### `Cookie.parse(header)` +### `Cookie.parse(cookieString[, options])` Parses a single Cookie or Set-Cookie HTTP header into a `Cookie` object. Returns `undefined` if the string can't be parsed. +The options parameter is not required and currently has only one property: + + * _loose_ - boolean - if `true` enable parsing of key-less cookies like `=abc` and `=`, which are not RFC-compliant. + +If options is not an object, it is ignored, which means you can use `Array#map` with it. + Here's how to process the Set-Cookie header(s) on a node HTTP/HTTPS response: ``` javascript if (res.headers['set-cookie'] instanceof Array) - cookies = res.headers['set-cookie'].map(function (c) { return (Cookie.parse(c)); }); + cookies = res.headers['set-cookie'].map(Cookie.parse); else cookies = [Cookie.parse(res.headers['set-cookie'])]; ``` @@ -231,15 +237,15 @@ if (cookie.validate() === true) { Exported via `tough.CookieJar`. -### `CookieJar([store],[rejectPublicSuffixes])` +### `CookieJar([store],[options])` Simply use `new CookieJar()`. If you'd like to use a custom store, pass that to the constructor otherwise a `MemoryCookieStore` will be created and used. -### Properties - -CookieJar object properties: +The `options` object can be omitted and can have the following properties: - * _rejectPublicSuffixes_ - boolean - reject cookies with domains like "com" and "co.uk" (default: `true`) + * _rejectPublicSuffixes_ - boolean - default `true` - reject cookies with domains like "com" and "co.uk" + * _looseMode_ - boolean - default `false` - accept malformed cookies like `bar` and `=bar`, which have an implied empty name. + This is not in the standard, but is used sometimes on the web and is accepted by (most) browsers. Since eventually this module would like to support database/remote/etc. CookieJars, continuation passing style is used for CookieJar methods. @@ -450,7 +456,7 @@ A just-in-memory CookieJar synchronous store implementation, used by default. De # Copyright and License -(tl;dr: BSD-3-Clause with some MPL/1.1) +(tl;dr: BSD-3-Clause with some MPL/2.0) ```text Copyright (c) 2015, Salesforce.com, Inc. @@ -483,4 +489,4 @@ A just-in-memory CookieJar synchronous store implementation, used by default. De POSSIBILITY OF SUCH DAMAGE. ``` -Portions may be licensed under different licenses (in particular public-suffix.txt is MPL/1.1); please read the LICENSE file for full details. +Portions may be licensed under different licenses (in particular `public_suffix_list.dat` is MPL/2.0); please read that file and the LICENSE file for full details. diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js b/deps/npm/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js deleted file mode 100644 index ba054f4cb52c0c..00000000000000 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js +++ /dev/null @@ -1,293 +0,0 @@ -/*! - * Copyright (c) 2015, Salesforce.com, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Salesforce.com nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -'use strict'; -var fs = require('fs'); -var assert = require('assert'); -var punycode = require('punycode'); - -fs.readFile('./public-suffix.txt', 'utf8', function(err,string) { - if (err) { - throw err; - } - var lines = string.split("\n"); - process.nextTick(function() { - processList(lines); - }); -}); - -var index = {}; - -var COMMENT = new RegExp('//.+'); -function processList(lines) { - while (lines.length) { - var line = lines.shift(); - line = line.replace(COMMENT,'').trim(); - if (!line) { - continue; - } - addToIndex(index,line); - } - - pubSufTest(); - - var w = fs.createWriteStream('./lib/pubsuffix.js',{ - flags: 'w', - encoding: 'utf8', - mode: parseInt('644',8) - }); - w.on('end', process.exit); - w.write("/****************************************************\n"); - w.write(" * AUTOMATICALLY GENERATED by generate-pubsuffix.js *\n"); - w.write(" * DO NOT EDIT! *\n"); - w.write(" ****************************************************/\n\n"); - - w.write('"use strict";\n\n'); - w.write("var punycode = require('punycode');\n\n"); - - w.write("module.exports.getPublicSuffix = "); - w.write(getPublicSuffix.toString()); - w.write(";\n\n"); - - w.write("// The following generated structure is used under the MPL version 1.1\n"); - w.write("// See public-suffix.txt for more information\n\n"); - w.write("var index = module.exports.index = Object.freeze(\n"); - w.write(JSON.stringify(index)); - w.write(");\n\n"); - w.write("// END of automatically generated file\n"); - - w.end(); -} - -function addToIndex(index,line) { - var prefix = ''; - if (line.replace(/^(!|\*\.)/)) { - prefix = RegExp.$1; - line = line.slice(prefix.length); - } - line = prefix + punycode.toASCII(line); - - if (line.substr(0,1) == '!') { - index[line.substr(1)] = false; - } else { - index[line] = true; - } -} - -// include the licence in the function since it gets written to pubsuffix.js -function getPublicSuffix(domain) { - /*! - * Copyright (c) 2015, Salesforce.com, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Salesforce.com nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - if (!domain) { - return null; - } - if (domain.match(/^\./)) { - return null; - } - var asciiDomain = punycode.toASCII(domain); - var converted = false; - if (asciiDomain !== domain) { - domain = asciiDomain; - converted = true; - } - if (index[domain]) { - return null; - } - - domain = domain.toLowerCase(); - var parts = domain.split('.').reverse(); - - var suffix = ''; - var suffixLen = 0; - for (var i=0; i suffixLen) { - var publicSuffix = parts.slice(0,suffixLen+1).reverse().join('.'); - return converted ? punycode.toUnicode(publicSuffix) : publicSuffix; - } - - return null; -} - -function checkPublicSuffix(give,get) { - var got = getPublicSuffix(give); - assert.equal(got, get, give+' should be '+(get==null?'NULL':get)+' but got '+got); -} - -// pubSufTest() was converted to JavaScript from http://mxr.mozilla.org/mozilla-central/source/netwerk/test/unit/data/test_psl.txt?raw=1 -function pubSufTest() { - // For this function-scope and this function-scope ONLY: - // Any copyright is dedicated to the Public Domain. - // http://creativecommons.org/publicdomain/zero/1.0/ - - // NULL input. - checkPublicSuffix(null, null); - // Mixed case. - checkPublicSuffix('COM', null); - checkPublicSuffix('example.COM', 'example.com'); - checkPublicSuffix('WwW.example.COM', 'example.com'); - // Leading dot. - checkPublicSuffix('.com', null); - checkPublicSuffix('.example', null); - checkPublicSuffix('.example.com', null); - checkPublicSuffix('.example.example', null); - // Unlisted TLD. - checkPublicSuffix('example', null); - checkPublicSuffix('example.example', 'example.example'); - checkPublicSuffix('b.example.example', 'example.example'); - checkPublicSuffix('a.b.example.example', 'example.example'); - // Listed, but non-Internet, TLD. - //checkPublicSuffix('local', null); - //checkPublicSuffix('example.local', null); - //checkPublicSuffix('b.example.local', null); - //checkPublicSuffix('a.b.example.local', null); - // TLD with only 1 rule. - checkPublicSuffix('biz', null); - checkPublicSuffix('domain.biz', 'domain.biz'); - checkPublicSuffix('b.domain.biz', 'domain.biz'); - checkPublicSuffix('a.b.domain.biz', 'domain.biz'); - // TLD with some 2-level rules. - checkPublicSuffix('com', null); - checkPublicSuffix('example.com', 'example.com'); - checkPublicSuffix('b.example.com', 'example.com'); - checkPublicSuffix('a.b.example.com', 'example.com'); - checkPublicSuffix('uk.com', null); - checkPublicSuffix('example.uk.com', 'example.uk.com'); - checkPublicSuffix('b.example.uk.com', 'example.uk.com'); - checkPublicSuffix('a.b.example.uk.com', 'example.uk.com'); - checkPublicSuffix('test.ac', 'test.ac'); - // TLD with only 1 (wildcard) rule. - checkPublicSuffix('cy', null); - checkPublicSuffix('c.cy', null); - checkPublicSuffix('b.c.cy', 'b.c.cy'); - checkPublicSuffix('a.b.c.cy', 'b.c.cy'); - // More complex TLD. - checkPublicSuffix('jp', null); - checkPublicSuffix('test.jp', 'test.jp'); - checkPublicSuffix('www.test.jp', 'test.jp'); - checkPublicSuffix('ac.jp', null); - checkPublicSuffix('test.ac.jp', 'test.ac.jp'); - checkPublicSuffix('www.test.ac.jp', 'test.ac.jp'); - checkPublicSuffix('kyoto.jp', null); - checkPublicSuffix('test.kyoto.jp', 'test.kyoto.jp'); - checkPublicSuffix('ide.kyoto.jp', null); - checkPublicSuffix('b.ide.kyoto.jp', 'b.ide.kyoto.jp'); - checkPublicSuffix('a.b.ide.kyoto.jp', 'b.ide.kyoto.jp'); - checkPublicSuffix('c.kobe.jp', null); - checkPublicSuffix('b.c.kobe.jp', 'b.c.kobe.jp'); - checkPublicSuffix('a.b.c.kobe.jp', 'b.c.kobe.jp'); - checkPublicSuffix('city.kobe.jp', 'city.kobe.jp'); - checkPublicSuffix('www.city.kobe.jp', 'city.kobe.jp'); - // TLD with a wildcard rule and exceptions. - checkPublicSuffix('ck', null); - checkPublicSuffix('test.ck', null); - checkPublicSuffix('b.test.ck', 'b.test.ck'); - checkPublicSuffix('a.b.test.ck', 'b.test.ck'); - checkPublicSuffix('www.ck', 'www.ck'); - checkPublicSuffix('www.www.ck', 'www.ck'); - // US K12. - checkPublicSuffix('us', null); - checkPublicSuffix('test.us', 'test.us'); - checkPublicSuffix('www.test.us', 'test.us'); - checkPublicSuffix('ak.us', null); - checkPublicSuffix('test.ak.us', 'test.ak.us'); - checkPublicSuffix('www.test.ak.us', 'test.ak.us'); - checkPublicSuffix('k12.ak.us', null); - checkPublicSuffix('test.k12.ak.us', 'test.k12.ak.us'); - checkPublicSuffix('www.test.k12.ak.us', 'test.k12.ak.us'); - // IDN labels. - checkPublicSuffix('食狮.com.cn', '食狮.com.cn'); - checkPublicSuffix('食狮.公司.cn', '食狮.公司.cn'); - checkPublicSuffix('www.食狮.公司.cn', '食狮.公司.cn'); - checkPublicSuffix('shishi.公司.cn', 'shishi.公司.cn'); - checkPublicSuffix('公司.cn', null); - checkPublicSuffix('食狮.中国', '食狮.中国'); - checkPublicSuffix('www.食狮.中国', '食狮.中国'); - checkPublicSuffix('shishi.中国', 'shishi.中国'); - checkPublicSuffix('中国', null); - // Same as above, but punycoded. - checkPublicSuffix('xn--85x722f.com.cn', 'xn--85x722f.com.cn'); - checkPublicSuffix('xn--85x722f.xn--55qx5d.cn', 'xn--85x722f.xn--55qx5d.cn'); - checkPublicSuffix('www.xn--85x722f.xn--55qx5d.cn', 'xn--85x722f.xn--55qx5d.cn'); - checkPublicSuffix('shishi.xn--55qx5d.cn', 'shishi.xn--55qx5d.cn'); - checkPublicSuffix('xn--55qx5d.cn', null); - checkPublicSuffix('xn--85x722f.xn--fiqs8s', 'xn--85x722f.xn--fiqs8s'); - checkPublicSuffix('www.xn--85x722f.xn--fiqs8s', 'xn--85x722f.xn--fiqs8s'); - checkPublicSuffix('shishi.xn--fiqs8s', 'shishi.xn--fiqs8s'); - checkPublicSuffix('xn--fiqs8s', null); -} diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/lib/cookie.js b/deps/npm/node_modules/request/node_modules/tough-cookie/lib/cookie.js index 4f677c387875ab..0afe4a2a960c58 100644 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/lib/cookie.js +++ b/deps/npm/node_modules/request/node_modules/tough-cookie/lib/cookie.js @@ -49,14 +49,20 @@ var DATE_DELIM = /[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/; // From RFC6265 S4.1.1 // note that it excludes \x3B ";" var COOKIE_OCTET = /[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]/; -var COOKIE_OCTETS = new RegExp('^'+COOKIE_OCTET.source+'$'); +var COOKIE_OCTETS = new RegExp('^'+COOKIE_OCTET.source+'+$'); + +var CONTROL_CHARS = /[\x00-\x1F]/; // Double quotes are part of the value (see: S4.1.1). // '\r', '\n' and '\0' should be treated as a terminator in the "relaxed" mode // (see: https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L60) // '=' and ';' are attribute/values separators // (see: https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L64) -var COOKIE_PAIR = /^([^=;]+)\s*=\s*(("?)[^\n\r\0]*\3)/; +var COOKIE_PAIR = /^(([^=;]+))\s*=\s*(("?)[^\n\r\0]*\3)/ + +// Used to parse non-RFC-compliant cookies like '=abc' when given the `loose` +// option in Cookie.parse: +var LOOSE_COOKIE_PAIR = /^((?:=)?([^=;]*)\s*=\s*)?(("?)[^\n\r\0]*\3)/; // RFC6265 S4.1.1 defines path value as 'any CHAR except CTLs or ";"' // Note ';' is \x3B @@ -315,7 +321,10 @@ function defaultPath(path) { } -function parse(str) { +function parse(str, options) { + if (!options || typeof options !== 'object') { + options = {}; + } str = str.trim(); // S4.1.1 Trailing semi-colons are not part of the specification. @@ -326,7 +335,8 @@ function parse(str) { // We use a regex to parse the "name-value-pair" part of S5.2 var firstSemi = str.indexOf(';'); // S5.2 step 1 - var result = COOKIE_PAIR.exec(firstSemi === -1 ? str : str.substr(0,firstSemi)); + var pairRe = options.loose ? LOOSE_COOKIE_PAIR : COOKIE_PAIR; + var result = pairRe.exec(firstSemi === -1 ? str : str.substr(0,firstSemi)); // Rx satisfies the "the name string is empty" and "lacks a %x3D ("=")" // constraints as well as trimming any whitespace. @@ -335,8 +345,15 @@ function parse(str) { } var c = new Cookie(); - c.key = result[1].trim(); - c.value = result[2].trim(); + if (result[1]) { + c.key = result[2].trim(); + } else { + c.key = ''; + } + c.value = result[3].trim(); + if (CONTROL_CHARS.test(c.key) || CONTROL_CHARS.test(c.value)) { + return; + } if (firstSemi === -1) { return c; @@ -586,15 +603,15 @@ function getCookieContext(url) { return urlParse(url); } -function Cookie(opts) { - opts = opts || {}; +function Cookie(options) { + options = options || {}; - Object.keys(opts).forEach(function(prop) { + Object.keys(options).forEach(function(prop) { if (Cookie.prototype.hasOwnProperty(prop) && - Cookie.prototype[prop] !== opts[prop] && + Cookie.prototype[prop] !== options[prop] && prop.substr(0,1) !== '_') { - this[prop] = opts[prop]; + this[prop] = options[prop]; } }, this); @@ -745,6 +762,9 @@ Cookie.prototype.cookieString = function cookieString() { if (val == null) { val = ''; } + if (this.key === '') { + return val; + } return this.key+'='+val; }; @@ -858,9 +878,17 @@ Cookie.prototype.canonicalizedDomain = function canonicalizedDomain() { return canonicalDomain(this.domain); }; -function CookieJar(store, rejectPublicSuffixes) { - if (rejectPublicSuffixes != null) { - this.rejectPublicSuffixes = rejectPublicSuffixes; +function CookieJar(store, options) { + if (typeof options === "boolean") { + options = {rejectPublicSuffixes: options}; + } else if (options == null) { + options = {}; + } + if (options.rejectPublicSuffixes != null) { + this.rejectPublicSuffixes = options.rejectPublicSuffixes; + } + if (options.looseMode != null) { + this.enableLooseMode = options.looseMode; } if (!store) { @@ -870,6 +898,7 @@ function CookieJar(store, rejectPublicSuffixes) { } CookieJar.prototype.store = null; CookieJar.prototype.rejectPublicSuffixes = true; +CookieJar.prototype.enableLooseMode = false; var CAN_BE_SYNC = []; CAN_BE_SYNC.push('setCookie'); @@ -882,10 +911,14 @@ CookieJar.prototype.setCookie = function(cookie, url, options, cb) { } var host = canonicalDomain(context.hostname); + var loose = this.enableLooseMode; + if (options.loose != null) { + loose = options.loose; + } // S5.3 step 1 if (!(cookie instanceof Cookie)) { - cookie = Cookie.parse(cookie); + cookie = Cookie.parse(cookie, { loose: loose }); } if (!cookie) { err = new Error("Cookie failed to parse"); @@ -1232,7 +1265,6 @@ CookieJar.deserialize = function(strOrObj, store, cb) { }); }; -CookieJar.fromJSON = CookieJar.deserializeSync; CookieJar.deserializeSync = function(strOrObj, store) { var serialized = typeof strOrObj === 'string' ? JSON.parse(strOrObj) : strOrObj; @@ -1246,6 +1278,7 @@ CookieJar.deserializeSync = function(strOrObj, store) { jar._importCookiesSync(serialized); return jar; }; +CookieJar.fromJSON = CookieJar.deserializeSync; CAN_BE_SYNC.push('clone'); CookieJar.prototype.clone = function(newStore, cb) { diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js b/deps/npm/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js index f07aa2bf8ef957..62fd3da3ffaa4d 100644 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js +++ b/deps/npm/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js @@ -89,10 +89,10 @@ module.exports.getPublicSuffix = function getPublicSuffix(domain) { return null; }; -// The following generated structure is used under the MPL version 1.1 +// The following generated structure is used under the MPL version 2.0 // See public-suffix.txt for more information var index = module.exports.index = Object.freeze( -{"ac":true,"com.ac":true,"edu.ac":true,"gov.ac":true,"net.ac":true,"mil.ac":true,"org.ac":true,"ad":true,"nom.ad":true,"ae":true,"co.ae":true,"net.ae":true,"org.ae":true,"sch.ae":true,"ac.ae":true,"gov.ae":true,"mil.ae":true,"aero":true,"accident-investigation.aero":true,"accident-prevention.aero":true,"aerobatic.aero":true,"aeroclub.aero":true,"aerodrome.aero":true,"agents.aero":true,"aircraft.aero":true,"airline.aero":true,"airport.aero":true,"air-surveillance.aero":true,"airtraffic.aero":true,"air-traffic-control.aero":true,"ambulance.aero":true,"amusement.aero":true,"association.aero":true,"author.aero":true,"ballooning.aero":true,"broker.aero":true,"caa.aero":true,"cargo.aero":true,"catering.aero":true,"certification.aero":true,"championship.aero":true,"charter.aero":true,"civilaviation.aero":true,"club.aero":true,"conference.aero":true,"consultant.aero":true,"consulting.aero":true,"control.aero":true,"council.aero":true,"crew.aero":true,"design.aero":true,"dgca.aero":true,"educator.aero":true,"emergency.aero":true,"engine.aero":true,"engineer.aero":true,"entertainment.aero":true,"equipment.aero":true,"exchange.aero":true,"express.aero":true,"federation.aero":true,"flight.aero":true,"freight.aero":true,"fuel.aero":true,"gliding.aero":true,"government.aero":true,"groundhandling.aero":true,"group.aero":true,"hanggliding.aero":true,"homebuilt.aero":true,"insurance.aero":true,"journal.aero":true,"journalist.aero":true,"leasing.aero":true,"logistics.aero":true,"magazine.aero":true,"maintenance.aero":true,"marketplace.aero":true,"media.aero":true,"microlight.aero":true,"modelling.aero":true,"navigation.aero":true,"parachuting.aero":true,"paragliding.aero":true,"passenger-association.aero":true,"pilot.aero":true,"press.aero":true,"production.aero":true,"recreation.aero":true,"repbody.aero":true,"res.aero":true,"research.aero":true,"rotorcraft.aero":true,"safety.aero":true,"scientist.aero":true,"services.aero":true,"show.aero":true,"skydiving.aero":true,"software.aero":true,"student.aero":true,"taxi.aero":true,"trader.aero":true,"trading.aero":true,"trainer.aero":true,"union.aero":true,"workinggroup.aero":true,"works.aero":true,"af":true,"gov.af":true,"com.af":true,"org.af":true,"net.af":true,"edu.af":true,"ag":true,"com.ag":true,"org.ag":true,"net.ag":true,"co.ag":true,"nom.ag":true,"ai":true,"off.ai":true,"com.ai":true,"net.ai":true,"org.ai":true,"al":true,"com.al":true,"edu.al":true,"gov.al":true,"mil.al":true,"net.al":true,"org.al":true,"am":true,"an":true,"com.an":true,"net.an":true,"org.an":true,"edu.an":true,"ao":true,"ed.ao":true,"gv.ao":true,"og.ao":true,"co.ao":true,"pb.ao":true,"it.ao":true,"aq":true,"ar":true,"com.ar":true,"edu.ar":true,"gob.ar":true,"gov.ar":true,"int.ar":true,"mil.ar":true,"net.ar":true,"org.ar":true,"tur.ar":true,"arpa":true,"e164.arpa":true,"in-addr.arpa":true,"ip6.arpa":true,"iris.arpa":true,"uri.arpa":true,"urn.arpa":true,"as":true,"gov.as":true,"asia":true,"at":true,"ac.at":true,"co.at":true,"gv.at":true,"or.at":true,"au":true,"com.au":true,"net.au":true,"org.au":true,"edu.au":true,"gov.au":true,"asn.au":true,"id.au":true,"info.au":true,"conf.au":true,"oz.au":true,"act.au":true,"nsw.au":true,"nt.au":true,"qld.au":true,"sa.au":true,"tas.au":true,"vic.au":true,"wa.au":true,"act.edu.au":true,"nsw.edu.au":true,"nt.edu.au":true,"qld.edu.au":true,"sa.edu.au":true,"tas.edu.au":true,"vic.edu.au":true,"wa.edu.au":true,"qld.gov.au":true,"sa.gov.au":true,"tas.gov.au":true,"vic.gov.au":true,"wa.gov.au":true,"aw":true,"com.aw":true,"ax":true,"az":true,"com.az":true,"net.az":true,"int.az":true,"gov.az":true,"org.az":true,"edu.az":true,"info.az":true,"pp.az":true,"mil.az":true,"name.az":true,"pro.az":true,"biz.az":true,"ba":true,"org.ba":true,"net.ba":true,"edu.ba":true,"gov.ba":true,"mil.ba":true,"unsa.ba":true,"unbi.ba":true,"co.ba":true,"com.ba":true,"rs.ba":true,"bb":true,"biz.bb":true,"co.bb":true,"com.bb":true,"edu.bb":true,"gov.bb":true,"info.bb":true,"net.bb":true,"org.bb":true,"store.bb":true,"tv.bb":true,"*.bd":true,"be":true,"ac.be":true,"bf":true,"gov.bf":true,"bg":true,"a.bg":true,"b.bg":true,"c.bg":true,"d.bg":true,"e.bg":true,"f.bg":true,"g.bg":true,"h.bg":true,"i.bg":true,"j.bg":true,"k.bg":true,"l.bg":true,"m.bg":true,"n.bg":true,"o.bg":true,"p.bg":true,"q.bg":true,"r.bg":true,"s.bg":true,"t.bg":true,"u.bg":true,"v.bg":true,"w.bg":true,"x.bg":true,"y.bg":true,"z.bg":true,"0.bg":true,"1.bg":true,"2.bg":true,"3.bg":true,"4.bg":true,"5.bg":true,"6.bg":true,"7.bg":true,"8.bg":true,"9.bg":true,"bh":true,"com.bh":true,"edu.bh":true,"net.bh":true,"org.bh":true,"gov.bh":true,"bi":true,"co.bi":true,"com.bi":true,"edu.bi":true,"or.bi":true,"org.bi":true,"biz":true,"bj":true,"asso.bj":true,"barreau.bj":true,"gouv.bj":true,"bm":true,"com.bm":true,"edu.bm":true,"gov.bm":true,"net.bm":true,"org.bm":true,"*.bn":true,"bo":true,"com.bo":true,"edu.bo":true,"gov.bo":true,"gob.bo":true,"int.bo":true,"org.bo":true,"net.bo":true,"mil.bo":true,"tv.bo":true,"br":true,"adm.br":true,"adv.br":true,"agr.br":true,"am.br":true,"arq.br":true,"art.br":true,"ato.br":true,"b.br":true,"bio.br":true,"blog.br":true,"bmd.br":true,"cim.br":true,"cng.br":true,"cnt.br":true,"com.br":true,"coop.br":true,"ecn.br":true,"eco.br":true,"edu.br":true,"emp.br":true,"eng.br":true,"esp.br":true,"etc.br":true,"eti.br":true,"far.br":true,"flog.br":true,"fm.br":true,"fnd.br":true,"fot.br":true,"fst.br":true,"g12.br":true,"ggf.br":true,"gov.br":true,"imb.br":true,"ind.br":true,"inf.br":true,"jor.br":true,"jus.br":true,"leg.br":true,"lel.br":true,"mat.br":true,"med.br":true,"mil.br":true,"mp.br":true,"mus.br":true,"net.br":true,"*.nom.br":true,"not.br":true,"ntr.br":true,"odo.br":true,"org.br":true,"ppg.br":true,"pro.br":true,"psc.br":true,"psi.br":true,"qsl.br":true,"radio.br":true,"rec.br":true,"slg.br":true,"srv.br":true,"taxi.br":true,"teo.br":true,"tmp.br":true,"trd.br":true,"tur.br":true,"tv.br":true,"vet.br":true,"vlog.br":true,"wiki.br":true,"zlg.br":true,"bs":true,"com.bs":true,"net.bs":true,"org.bs":true,"edu.bs":true,"gov.bs":true,"bt":true,"com.bt":true,"edu.bt":true,"gov.bt":true,"net.bt":true,"org.bt":true,"bv":true,"bw":true,"co.bw":true,"org.bw":true,"by":true,"gov.by":true,"mil.by":true,"com.by":true,"of.by":true,"bz":true,"com.bz":true,"net.bz":true,"org.bz":true,"edu.bz":true,"gov.bz":true,"ca":true,"ab.ca":true,"bc.ca":true,"mb.ca":true,"nb.ca":true,"nf.ca":true,"nl.ca":true,"ns.ca":true,"nt.ca":true,"nu.ca":true,"on.ca":true,"pe.ca":true,"qc.ca":true,"sk.ca":true,"yk.ca":true,"gc.ca":true,"cat":true,"cc":true,"cd":true,"gov.cd":true,"cf":true,"cg":true,"ch":true,"ci":true,"org.ci":true,"or.ci":true,"com.ci":true,"co.ci":true,"edu.ci":true,"ed.ci":true,"ac.ci":true,"net.ci":true,"go.ci":true,"asso.ci":true,"xn--aroport-bya.ci":true,"int.ci":true,"presse.ci":true,"md.ci":true,"gouv.ci":true,"*.ck":true,"www.ck":false,"cl":true,"gov.cl":true,"gob.cl":true,"co.cl":true,"mil.cl":true,"cm":true,"co.cm":true,"com.cm":true,"gov.cm":true,"net.cm":true,"cn":true,"ac.cn":true,"com.cn":true,"edu.cn":true,"gov.cn":true,"net.cn":true,"org.cn":true,"mil.cn":true,"xn--55qx5d.cn":true,"xn--io0a7i.cn":true,"xn--od0alg.cn":true,"ah.cn":true,"bj.cn":true,"cq.cn":true,"fj.cn":true,"gd.cn":true,"gs.cn":true,"gz.cn":true,"gx.cn":true,"ha.cn":true,"hb.cn":true,"he.cn":true,"hi.cn":true,"hl.cn":true,"hn.cn":true,"jl.cn":true,"js.cn":true,"jx.cn":true,"ln.cn":true,"nm.cn":true,"nx.cn":true,"qh.cn":true,"sc.cn":true,"sd.cn":true,"sh.cn":true,"sn.cn":true,"sx.cn":true,"tj.cn":true,"xj.cn":true,"xz.cn":true,"yn.cn":true,"zj.cn":true,"hk.cn":true,"mo.cn":true,"tw.cn":true,"co":true,"arts.co":true,"com.co":true,"edu.co":true,"firm.co":true,"gov.co":true,"info.co":true,"int.co":true,"mil.co":true,"net.co":true,"nom.co":true,"org.co":true,"rec.co":true,"web.co":true,"com":true,"coop":true,"cr":true,"ac.cr":true,"co.cr":true,"ed.cr":true,"fi.cr":true,"go.cr":true,"or.cr":true,"sa.cr":true,"cu":true,"com.cu":true,"edu.cu":true,"org.cu":true,"net.cu":true,"gov.cu":true,"inf.cu":true,"cv":true,"cw":true,"com.cw":true,"edu.cw":true,"net.cw":true,"org.cw":true,"cx":true,"gov.cx":true,"*.cy":true,"cz":true,"de":true,"dj":true,"dk":true,"dm":true,"com.dm":true,"net.dm":true,"org.dm":true,"edu.dm":true,"gov.dm":true,"do":true,"art.do":true,"com.do":true,"edu.do":true,"gob.do":true,"gov.do":true,"mil.do":true,"net.do":true,"org.do":true,"sld.do":true,"web.do":true,"dz":true,"com.dz":true,"org.dz":true,"net.dz":true,"gov.dz":true,"edu.dz":true,"asso.dz":true,"pol.dz":true,"art.dz":true,"ec":true,"com.ec":true,"info.ec":true,"net.ec":true,"fin.ec":true,"k12.ec":true,"med.ec":true,"pro.ec":true,"org.ec":true,"edu.ec":true,"gov.ec":true,"gob.ec":true,"mil.ec":true,"edu":true,"ee":true,"edu.ee":true,"gov.ee":true,"riik.ee":true,"lib.ee":true,"med.ee":true,"com.ee":true,"pri.ee":true,"aip.ee":true,"org.ee":true,"fie.ee":true,"eg":true,"com.eg":true,"edu.eg":true,"eun.eg":true,"gov.eg":true,"mil.eg":true,"name.eg":true,"net.eg":true,"org.eg":true,"sci.eg":true,"*.er":true,"es":true,"com.es":true,"nom.es":true,"org.es":true,"gob.es":true,"edu.es":true,"et":true,"com.et":true,"gov.et":true,"org.et":true,"edu.et":true,"biz.et":true,"name.et":true,"info.et":true,"eu":true,"fi":true,"aland.fi":true,"*.fj":true,"*.fk":true,"fm":true,"fo":true,"fr":true,"com.fr":true,"asso.fr":true,"nom.fr":true,"prd.fr":true,"presse.fr":true,"tm.fr":true,"aeroport.fr":true,"assedic.fr":true,"avocat.fr":true,"avoues.fr":true,"cci.fr":true,"chambagri.fr":true,"chirurgiens-dentistes.fr":true,"experts-comptables.fr":true,"geometre-expert.fr":true,"gouv.fr":true,"greta.fr":true,"huissier-justice.fr":true,"medecin.fr":true,"notaires.fr":true,"pharmacien.fr":true,"port.fr":true,"veterinaire.fr":true,"ga":true,"gb":true,"gd":true,"ge":true,"com.ge":true,"edu.ge":true,"gov.ge":true,"org.ge":true,"mil.ge":true,"net.ge":true,"pvt.ge":true,"gf":true,"gg":true,"co.gg":true,"net.gg":true,"org.gg":true,"gh":true,"com.gh":true,"edu.gh":true,"gov.gh":true,"org.gh":true,"mil.gh":true,"gi":true,"com.gi":true,"ltd.gi":true,"gov.gi":true,"mod.gi":true,"edu.gi":true,"org.gi":true,"gl":true,"gm":true,"gn":true,"ac.gn":true,"com.gn":true,"edu.gn":true,"gov.gn":true,"org.gn":true,"net.gn":true,"gov":true,"gp":true,"com.gp":true,"net.gp":true,"mobi.gp":true,"edu.gp":true,"org.gp":true,"asso.gp":true,"gq":true,"gr":true,"com.gr":true,"edu.gr":true,"net.gr":true,"org.gr":true,"gov.gr":true,"gs":true,"gt":true,"com.gt":true,"edu.gt":true,"gob.gt":true,"ind.gt":true,"mil.gt":true,"net.gt":true,"org.gt":true,"*.gu":true,"gw":true,"gy":true,"co.gy":true,"com.gy":true,"net.gy":true,"hk":true,"com.hk":true,"edu.hk":true,"gov.hk":true,"idv.hk":true,"net.hk":true,"org.hk":true,"xn--55qx5d.hk":true,"xn--wcvs22d.hk":true,"xn--lcvr32d.hk":true,"xn--mxtq1m.hk":true,"xn--gmqw5a.hk":true,"xn--ciqpn.hk":true,"xn--gmq050i.hk":true,"xn--zf0avx.hk":true,"xn--io0a7i.hk":true,"xn--mk0axi.hk":true,"xn--od0alg.hk":true,"xn--od0aq3b.hk":true,"xn--tn0ag.hk":true,"xn--uc0atv.hk":true,"xn--uc0ay4a.hk":true,"hm":true,"hn":true,"com.hn":true,"edu.hn":true,"org.hn":true,"net.hn":true,"mil.hn":true,"gob.hn":true,"hr":true,"iz.hr":true,"from.hr":true,"name.hr":true,"com.hr":true,"ht":true,"com.ht":true,"shop.ht":true,"firm.ht":true,"info.ht":true,"adult.ht":true,"net.ht":true,"pro.ht":true,"org.ht":true,"med.ht":true,"art.ht":true,"coop.ht":true,"pol.ht":true,"asso.ht":true,"edu.ht":true,"rel.ht":true,"gouv.ht":true,"perso.ht":true,"hu":true,"co.hu":true,"info.hu":true,"org.hu":true,"priv.hu":true,"sport.hu":true,"tm.hu":true,"2000.hu":true,"agrar.hu":true,"bolt.hu":true,"casino.hu":true,"city.hu":true,"erotica.hu":true,"erotika.hu":true,"film.hu":true,"forum.hu":true,"games.hu":true,"hotel.hu":true,"ingatlan.hu":true,"jogasz.hu":true,"konyvelo.hu":true,"lakas.hu":true,"media.hu":true,"news.hu":true,"reklam.hu":true,"sex.hu":true,"shop.hu":true,"suli.hu":true,"szex.hu":true,"tozsde.hu":true,"utazas.hu":true,"video.hu":true,"id":true,"ac.id":true,"biz.id":true,"co.id":true,"desa.id":true,"go.id":true,"mil.id":true,"my.id":true,"net.id":true,"or.id":true,"sch.id":true,"web.id":true,"ie":true,"gov.ie":true,"*.il":true,"im":true,"ac.im":true,"co.im":true,"com.im":true,"ltd.co.im":true,"net.im":true,"org.im":true,"plc.co.im":true,"tt.im":true,"tv.im":true,"in":true,"co.in":true,"firm.in":true,"net.in":true,"org.in":true,"gen.in":true,"ind.in":true,"nic.in":true,"ac.in":true,"edu.in":true,"res.in":true,"gov.in":true,"mil.in":true,"info":true,"int":true,"eu.int":true,"io":true,"com.io":true,"iq":true,"gov.iq":true,"edu.iq":true,"mil.iq":true,"com.iq":true,"org.iq":true,"net.iq":true,"ir":true,"ac.ir":true,"co.ir":true,"gov.ir":true,"id.ir":true,"net.ir":true,"org.ir":true,"sch.ir":true,"xn--mgba3a4f16a.ir":true,"xn--mgba3a4fra.ir":true,"is":true,"net.is":true,"com.is":true,"edu.is":true,"gov.is":true,"org.is":true,"int.is":true,"it":true,"gov.it":true,"edu.it":true,"abr.it":true,"abruzzo.it":true,"aosta-valley.it":true,"aostavalley.it":true,"bas.it":true,"basilicata.it":true,"cal.it":true,"calabria.it":true,"cam.it":true,"campania.it":true,"emilia-romagna.it":true,"emiliaromagna.it":true,"emr.it":true,"friuli-v-giulia.it":true,"friuli-ve-giulia.it":true,"friuli-vegiulia.it":true,"friuli-venezia-giulia.it":true,"friuli-veneziagiulia.it":true,"friuli-vgiulia.it":true,"friuliv-giulia.it":true,"friulive-giulia.it":true,"friulivegiulia.it":true,"friulivenezia-giulia.it":true,"friuliveneziagiulia.it":true,"friulivgiulia.it":true,"fvg.it":true,"laz.it":true,"lazio.it":true,"lig.it":true,"liguria.it":true,"lom.it":true,"lombardia.it":true,"lombardy.it":true,"lucania.it":true,"mar.it":true,"marche.it":true,"mol.it":true,"molise.it":true,"piedmont.it":true,"piemonte.it":true,"pmn.it":true,"pug.it":true,"puglia.it":true,"sar.it":true,"sardegna.it":true,"sardinia.it":true,"sic.it":true,"sicilia.it":true,"sicily.it":true,"taa.it":true,"tos.it":true,"toscana.it":true,"trentino-a-adige.it":true,"trentino-aadige.it":true,"trentino-alto-adige.it":true,"trentino-altoadige.it":true,"trentino-s-tirol.it":true,"trentino-stirol.it":true,"trentino-sud-tirol.it":true,"trentino-sudtirol.it":true,"trentino-sued-tirol.it":true,"trentino-suedtirol.it":true,"trentinoa-adige.it":true,"trentinoaadige.it":true,"trentinoalto-adige.it":true,"trentinoaltoadige.it":true,"trentinos-tirol.it":true,"trentinostirol.it":true,"trentinosud-tirol.it":true,"trentinosudtirol.it":true,"trentinosued-tirol.it":true,"trentinosuedtirol.it":true,"tuscany.it":true,"umb.it":true,"umbria.it":true,"val-d-aosta.it":true,"val-daosta.it":true,"vald-aosta.it":true,"valdaosta.it":true,"valle-aosta.it":true,"valle-d-aosta.it":true,"valle-daosta.it":true,"valleaosta.it":true,"valled-aosta.it":true,"valledaosta.it":true,"vallee-aoste.it":true,"valleeaoste.it":true,"vao.it":true,"vda.it":true,"ven.it":true,"veneto.it":true,"ag.it":true,"agrigento.it":true,"al.it":true,"alessandria.it":true,"alto-adige.it":true,"altoadige.it":true,"an.it":true,"ancona.it":true,"andria-barletta-trani.it":true,"andria-trani-barletta.it":true,"andriabarlettatrani.it":true,"andriatranibarletta.it":true,"ao.it":true,"aosta.it":true,"aoste.it":true,"ap.it":true,"aq.it":true,"aquila.it":true,"ar.it":true,"arezzo.it":true,"ascoli-piceno.it":true,"ascolipiceno.it":true,"asti.it":true,"at.it":true,"av.it":true,"avellino.it":true,"ba.it":true,"balsan.it":true,"bari.it":true,"barletta-trani-andria.it":true,"barlettatraniandria.it":true,"belluno.it":true,"benevento.it":true,"bergamo.it":true,"bg.it":true,"bi.it":true,"biella.it":true,"bl.it":true,"bn.it":true,"bo.it":true,"bologna.it":true,"bolzano.it":true,"bozen.it":true,"br.it":true,"brescia.it":true,"brindisi.it":true,"bs.it":true,"bt.it":true,"bz.it":true,"ca.it":true,"cagliari.it":true,"caltanissetta.it":true,"campidano-medio.it":true,"campidanomedio.it":true,"campobasso.it":true,"carbonia-iglesias.it":true,"carboniaiglesias.it":true,"carrara-massa.it":true,"carraramassa.it":true,"caserta.it":true,"catania.it":true,"catanzaro.it":true,"cb.it":true,"ce.it":true,"cesena-forli.it":true,"cesenaforli.it":true,"ch.it":true,"chieti.it":true,"ci.it":true,"cl.it":true,"cn.it":true,"co.it":true,"como.it":true,"cosenza.it":true,"cr.it":true,"cremona.it":true,"crotone.it":true,"cs.it":true,"ct.it":true,"cuneo.it":true,"cz.it":true,"dell-ogliastra.it":true,"dellogliastra.it":true,"en.it":true,"enna.it":true,"fc.it":true,"fe.it":true,"fermo.it":true,"ferrara.it":true,"fg.it":true,"fi.it":true,"firenze.it":true,"florence.it":true,"fm.it":true,"foggia.it":true,"forli-cesena.it":true,"forlicesena.it":true,"fr.it":true,"frosinone.it":true,"ge.it":true,"genoa.it":true,"genova.it":true,"go.it":true,"gorizia.it":true,"gr.it":true,"grosseto.it":true,"iglesias-carbonia.it":true,"iglesiascarbonia.it":true,"im.it":true,"imperia.it":true,"is.it":true,"isernia.it":true,"kr.it":true,"la-spezia.it":true,"laquila.it":true,"laspezia.it":true,"latina.it":true,"lc.it":true,"le.it":true,"lecce.it":true,"lecco.it":true,"li.it":true,"livorno.it":true,"lo.it":true,"lodi.it":true,"lt.it":true,"lu.it":true,"lucca.it":true,"macerata.it":true,"mantova.it":true,"massa-carrara.it":true,"massacarrara.it":true,"matera.it":true,"mb.it":true,"mc.it":true,"me.it":true,"medio-campidano.it":true,"mediocampidano.it":true,"messina.it":true,"mi.it":true,"milan.it":true,"milano.it":true,"mn.it":true,"mo.it":true,"modena.it":true,"monza-brianza.it":true,"monza-e-della-brianza.it":true,"monza.it":true,"monzabrianza.it":true,"monzaebrianza.it":true,"monzaedellabrianza.it":true,"ms.it":true,"mt.it":true,"na.it":true,"naples.it":true,"napoli.it":true,"no.it":true,"novara.it":true,"nu.it":true,"nuoro.it":true,"og.it":true,"ogliastra.it":true,"olbia-tempio.it":true,"olbiatempio.it":true,"or.it":true,"oristano.it":true,"ot.it":true,"pa.it":true,"padova.it":true,"padua.it":true,"palermo.it":true,"parma.it":true,"pavia.it":true,"pc.it":true,"pd.it":true,"pe.it":true,"perugia.it":true,"pesaro-urbino.it":true,"pesarourbino.it":true,"pescara.it":true,"pg.it":true,"pi.it":true,"piacenza.it":true,"pisa.it":true,"pistoia.it":true,"pn.it":true,"po.it":true,"pordenone.it":true,"potenza.it":true,"pr.it":true,"prato.it":true,"pt.it":true,"pu.it":true,"pv.it":true,"pz.it":true,"ra.it":true,"ragusa.it":true,"ravenna.it":true,"rc.it":true,"re.it":true,"reggio-calabria.it":true,"reggio-emilia.it":true,"reggiocalabria.it":true,"reggioemilia.it":true,"rg.it":true,"ri.it":true,"rieti.it":true,"rimini.it":true,"rm.it":true,"rn.it":true,"ro.it":true,"roma.it":true,"rome.it":true,"rovigo.it":true,"sa.it":true,"salerno.it":true,"sassari.it":true,"savona.it":true,"si.it":true,"siena.it":true,"siracusa.it":true,"so.it":true,"sondrio.it":true,"sp.it":true,"sr.it":true,"ss.it":true,"suedtirol.it":true,"sv.it":true,"ta.it":true,"taranto.it":true,"te.it":true,"tempio-olbia.it":true,"tempioolbia.it":true,"teramo.it":true,"terni.it":true,"tn.it":true,"to.it":true,"torino.it":true,"tp.it":true,"tr.it":true,"trani-andria-barletta.it":true,"trani-barletta-andria.it":true,"traniandriabarletta.it":true,"tranibarlettaandria.it":true,"trapani.it":true,"trentino.it":true,"trento.it":true,"treviso.it":true,"trieste.it":true,"ts.it":true,"turin.it":true,"tv.it":true,"ud.it":true,"udine.it":true,"urbino-pesaro.it":true,"urbinopesaro.it":true,"va.it":true,"varese.it":true,"vb.it":true,"vc.it":true,"ve.it":true,"venezia.it":true,"venice.it":true,"verbania.it":true,"vercelli.it":true,"verona.it":true,"vi.it":true,"vibo-valentia.it":true,"vibovalentia.it":true,"vicenza.it":true,"viterbo.it":true,"vr.it":true,"vs.it":true,"vt.it":true,"vv.it":true,"je":true,"co.je":true,"net.je":true,"org.je":true,"*.jm":true,"jo":true,"com.jo":true,"org.jo":true,"net.jo":true,"edu.jo":true,"sch.jo":true,"gov.jo":true,"mil.jo":true,"name.jo":true,"jobs":true,"jp":true,"ac.jp":true,"ad.jp":true,"co.jp":true,"ed.jp":true,"go.jp":true,"gr.jp":true,"lg.jp":true,"ne.jp":true,"or.jp":true,"aichi.jp":true,"akita.jp":true,"aomori.jp":true,"chiba.jp":true,"ehime.jp":true,"fukui.jp":true,"fukuoka.jp":true,"fukushima.jp":true,"gifu.jp":true,"gunma.jp":true,"hiroshima.jp":true,"hokkaido.jp":true,"hyogo.jp":true,"ibaraki.jp":true,"ishikawa.jp":true,"iwate.jp":true,"kagawa.jp":true,"kagoshima.jp":true,"kanagawa.jp":true,"kochi.jp":true,"kumamoto.jp":true,"kyoto.jp":true,"mie.jp":true,"miyagi.jp":true,"miyazaki.jp":true,"nagano.jp":true,"nagasaki.jp":true,"nara.jp":true,"niigata.jp":true,"oita.jp":true,"okayama.jp":true,"okinawa.jp":true,"osaka.jp":true,"saga.jp":true,"saitama.jp":true,"shiga.jp":true,"shimane.jp":true,"shizuoka.jp":true,"tochigi.jp":true,"tokushima.jp":true,"tokyo.jp":true,"tottori.jp":true,"toyama.jp":true,"wakayama.jp":true,"yamagata.jp":true,"yamaguchi.jp":true,"yamanashi.jp":true,"xn--4pvxs.jp":true,"xn--vgu402c.jp":true,"xn--c3s14m.jp":true,"xn--f6qx53a.jp":true,"xn--8pvr4u.jp":true,"xn--uist22h.jp":true,"xn--djrs72d6uy.jp":true,"xn--mkru45i.jp":true,"xn--0trq7p7nn.jp":true,"xn--8ltr62k.jp":true,"xn--2m4a15e.jp":true,"xn--efvn9s.jp":true,"xn--32vp30h.jp":true,"xn--4it797k.jp":true,"xn--1lqs71d.jp":true,"xn--5rtp49c.jp":true,"xn--5js045d.jp":true,"xn--ehqz56n.jp":true,"xn--1lqs03n.jp":true,"xn--qqqt11m.jp":true,"xn--kbrq7o.jp":true,"xn--pssu33l.jp":true,"xn--ntsq17g.jp":true,"xn--uisz3g.jp":true,"xn--6btw5a.jp":true,"xn--1ctwo.jp":true,"xn--6orx2r.jp":true,"xn--rht61e.jp":true,"xn--rht27z.jp":true,"xn--djty4k.jp":true,"xn--nit225k.jp":true,"xn--rht3d.jp":true,"xn--klty5x.jp":true,"xn--kltx9a.jp":true,"xn--kltp7d.jp":true,"xn--uuwu58a.jp":true,"xn--zbx025d.jp":true,"xn--ntso0iqx3a.jp":true,"xn--elqq16h.jp":true,"xn--4it168d.jp":true,"xn--klt787d.jp":true,"xn--rny31h.jp":true,"xn--7t0a264c.jp":true,"xn--5rtq34k.jp":true,"xn--k7yn95e.jp":true,"xn--tor131o.jp":true,"xn--d5qv7z876c.jp":true,"*.kawasaki.jp":true,"*.kitakyushu.jp":true,"*.kobe.jp":true,"*.nagoya.jp":true,"*.sapporo.jp":true,"*.sendai.jp":true,"*.yokohama.jp":true,"city.kawasaki.jp":false,"city.kitakyushu.jp":false,"city.kobe.jp":false,"city.nagoya.jp":false,"city.sapporo.jp":false,"city.sendai.jp":false,"city.yokohama.jp":false,"aisai.aichi.jp":true,"ama.aichi.jp":true,"anjo.aichi.jp":true,"asuke.aichi.jp":true,"chiryu.aichi.jp":true,"chita.aichi.jp":true,"fuso.aichi.jp":true,"gamagori.aichi.jp":true,"handa.aichi.jp":true,"hazu.aichi.jp":true,"hekinan.aichi.jp":true,"higashiura.aichi.jp":true,"ichinomiya.aichi.jp":true,"inazawa.aichi.jp":true,"inuyama.aichi.jp":true,"isshiki.aichi.jp":true,"iwakura.aichi.jp":true,"kanie.aichi.jp":true,"kariya.aichi.jp":true,"kasugai.aichi.jp":true,"kira.aichi.jp":true,"kiyosu.aichi.jp":true,"komaki.aichi.jp":true,"konan.aichi.jp":true,"kota.aichi.jp":true,"mihama.aichi.jp":true,"miyoshi.aichi.jp":true,"nishio.aichi.jp":true,"nisshin.aichi.jp":true,"obu.aichi.jp":true,"oguchi.aichi.jp":true,"oharu.aichi.jp":true,"okazaki.aichi.jp":true,"owariasahi.aichi.jp":true,"seto.aichi.jp":true,"shikatsu.aichi.jp":true,"shinshiro.aichi.jp":true,"shitara.aichi.jp":true,"tahara.aichi.jp":true,"takahama.aichi.jp":true,"tobishima.aichi.jp":true,"toei.aichi.jp":true,"togo.aichi.jp":true,"tokai.aichi.jp":true,"tokoname.aichi.jp":true,"toyoake.aichi.jp":true,"toyohashi.aichi.jp":true,"toyokawa.aichi.jp":true,"toyone.aichi.jp":true,"toyota.aichi.jp":true,"tsushima.aichi.jp":true,"yatomi.aichi.jp":true,"akita.akita.jp":true,"daisen.akita.jp":true,"fujisato.akita.jp":true,"gojome.akita.jp":true,"hachirogata.akita.jp":true,"happou.akita.jp":true,"higashinaruse.akita.jp":true,"honjo.akita.jp":true,"honjyo.akita.jp":true,"ikawa.akita.jp":true,"kamikoani.akita.jp":true,"kamioka.akita.jp":true,"katagami.akita.jp":true,"kazuno.akita.jp":true,"kitaakita.akita.jp":true,"kosaka.akita.jp":true,"kyowa.akita.jp":true,"misato.akita.jp":true,"mitane.akita.jp":true,"moriyoshi.akita.jp":true,"nikaho.akita.jp":true,"noshiro.akita.jp":true,"odate.akita.jp":true,"oga.akita.jp":true,"ogata.akita.jp":true,"semboku.akita.jp":true,"yokote.akita.jp":true,"yurihonjo.akita.jp":true,"aomori.aomori.jp":true,"gonohe.aomori.jp":true,"hachinohe.aomori.jp":true,"hashikami.aomori.jp":true,"hiranai.aomori.jp":true,"hirosaki.aomori.jp":true,"itayanagi.aomori.jp":true,"kuroishi.aomori.jp":true,"misawa.aomori.jp":true,"mutsu.aomori.jp":true,"nakadomari.aomori.jp":true,"noheji.aomori.jp":true,"oirase.aomori.jp":true,"owani.aomori.jp":true,"rokunohe.aomori.jp":true,"sannohe.aomori.jp":true,"shichinohe.aomori.jp":true,"shingo.aomori.jp":true,"takko.aomori.jp":true,"towada.aomori.jp":true,"tsugaru.aomori.jp":true,"tsuruta.aomori.jp":true,"abiko.chiba.jp":true,"asahi.chiba.jp":true,"chonan.chiba.jp":true,"chosei.chiba.jp":true,"choshi.chiba.jp":true,"chuo.chiba.jp":true,"funabashi.chiba.jp":true,"futtsu.chiba.jp":true,"hanamigawa.chiba.jp":true,"ichihara.chiba.jp":true,"ichikawa.chiba.jp":true,"ichinomiya.chiba.jp":true,"inzai.chiba.jp":true,"isumi.chiba.jp":true,"kamagaya.chiba.jp":true,"kamogawa.chiba.jp":true,"kashiwa.chiba.jp":true,"katori.chiba.jp":true,"katsuura.chiba.jp":true,"kimitsu.chiba.jp":true,"kisarazu.chiba.jp":true,"kozaki.chiba.jp":true,"kujukuri.chiba.jp":true,"kyonan.chiba.jp":true,"matsudo.chiba.jp":true,"midori.chiba.jp":true,"mihama.chiba.jp":true,"minamiboso.chiba.jp":true,"mobara.chiba.jp":true,"mutsuzawa.chiba.jp":true,"nagara.chiba.jp":true,"nagareyama.chiba.jp":true,"narashino.chiba.jp":true,"narita.chiba.jp":true,"noda.chiba.jp":true,"oamishirasato.chiba.jp":true,"omigawa.chiba.jp":true,"onjuku.chiba.jp":true,"otaki.chiba.jp":true,"sakae.chiba.jp":true,"sakura.chiba.jp":true,"shimofusa.chiba.jp":true,"shirako.chiba.jp":true,"shiroi.chiba.jp":true,"shisui.chiba.jp":true,"sodegaura.chiba.jp":true,"sosa.chiba.jp":true,"tako.chiba.jp":true,"tateyama.chiba.jp":true,"togane.chiba.jp":true,"tohnosho.chiba.jp":true,"tomisato.chiba.jp":true,"urayasu.chiba.jp":true,"yachimata.chiba.jp":true,"yachiyo.chiba.jp":true,"yokaichiba.chiba.jp":true,"yokoshibahikari.chiba.jp":true,"yotsukaido.chiba.jp":true,"ainan.ehime.jp":true,"honai.ehime.jp":true,"ikata.ehime.jp":true,"imabari.ehime.jp":true,"iyo.ehime.jp":true,"kamijima.ehime.jp":true,"kihoku.ehime.jp":true,"kumakogen.ehime.jp":true,"masaki.ehime.jp":true,"matsuno.ehime.jp":true,"matsuyama.ehime.jp":true,"namikata.ehime.jp":true,"niihama.ehime.jp":true,"ozu.ehime.jp":true,"saijo.ehime.jp":true,"seiyo.ehime.jp":true,"shikokuchuo.ehime.jp":true,"tobe.ehime.jp":true,"toon.ehime.jp":true,"uchiko.ehime.jp":true,"uwajima.ehime.jp":true,"yawatahama.ehime.jp":true,"echizen.fukui.jp":true,"eiheiji.fukui.jp":true,"fukui.fukui.jp":true,"ikeda.fukui.jp":true,"katsuyama.fukui.jp":true,"mihama.fukui.jp":true,"minamiechizen.fukui.jp":true,"obama.fukui.jp":true,"ohi.fukui.jp":true,"ono.fukui.jp":true,"sabae.fukui.jp":true,"sakai.fukui.jp":true,"takahama.fukui.jp":true,"tsuruga.fukui.jp":true,"wakasa.fukui.jp":true,"ashiya.fukuoka.jp":true,"buzen.fukuoka.jp":true,"chikugo.fukuoka.jp":true,"chikuho.fukuoka.jp":true,"chikujo.fukuoka.jp":true,"chikushino.fukuoka.jp":true,"chikuzen.fukuoka.jp":true,"chuo.fukuoka.jp":true,"dazaifu.fukuoka.jp":true,"fukuchi.fukuoka.jp":true,"hakata.fukuoka.jp":true,"higashi.fukuoka.jp":true,"hirokawa.fukuoka.jp":true,"hisayama.fukuoka.jp":true,"iizuka.fukuoka.jp":true,"inatsuki.fukuoka.jp":true,"kaho.fukuoka.jp":true,"kasuga.fukuoka.jp":true,"kasuya.fukuoka.jp":true,"kawara.fukuoka.jp":true,"keisen.fukuoka.jp":true,"koga.fukuoka.jp":true,"kurate.fukuoka.jp":true,"kurogi.fukuoka.jp":true,"kurume.fukuoka.jp":true,"minami.fukuoka.jp":true,"miyako.fukuoka.jp":true,"miyama.fukuoka.jp":true,"miyawaka.fukuoka.jp":true,"mizumaki.fukuoka.jp":true,"munakata.fukuoka.jp":true,"nakagawa.fukuoka.jp":true,"nakama.fukuoka.jp":true,"nishi.fukuoka.jp":true,"nogata.fukuoka.jp":true,"ogori.fukuoka.jp":true,"okagaki.fukuoka.jp":true,"okawa.fukuoka.jp":true,"oki.fukuoka.jp":true,"omuta.fukuoka.jp":true,"onga.fukuoka.jp":true,"onojo.fukuoka.jp":true,"oto.fukuoka.jp":true,"saigawa.fukuoka.jp":true,"sasaguri.fukuoka.jp":true,"shingu.fukuoka.jp":true,"shinyoshitomi.fukuoka.jp":true,"shonai.fukuoka.jp":true,"soeda.fukuoka.jp":true,"sue.fukuoka.jp":true,"tachiarai.fukuoka.jp":true,"tagawa.fukuoka.jp":true,"takata.fukuoka.jp":true,"toho.fukuoka.jp":true,"toyotsu.fukuoka.jp":true,"tsuiki.fukuoka.jp":true,"ukiha.fukuoka.jp":true,"umi.fukuoka.jp":true,"usui.fukuoka.jp":true,"yamada.fukuoka.jp":true,"yame.fukuoka.jp":true,"yanagawa.fukuoka.jp":true,"yukuhashi.fukuoka.jp":true,"aizubange.fukushima.jp":true,"aizumisato.fukushima.jp":true,"aizuwakamatsu.fukushima.jp":true,"asakawa.fukushima.jp":true,"bandai.fukushima.jp":true,"date.fukushima.jp":true,"fukushima.fukushima.jp":true,"furudono.fukushima.jp":true,"futaba.fukushima.jp":true,"hanawa.fukushima.jp":true,"higashi.fukushima.jp":true,"hirata.fukushima.jp":true,"hirono.fukushima.jp":true,"iitate.fukushima.jp":true,"inawashiro.fukushima.jp":true,"ishikawa.fukushima.jp":true,"iwaki.fukushima.jp":true,"izumizaki.fukushima.jp":true,"kagamiishi.fukushima.jp":true,"kaneyama.fukushima.jp":true,"kawamata.fukushima.jp":true,"kitakata.fukushima.jp":true,"kitashiobara.fukushima.jp":true,"koori.fukushima.jp":true,"koriyama.fukushima.jp":true,"kunimi.fukushima.jp":true,"miharu.fukushima.jp":true,"mishima.fukushima.jp":true,"namie.fukushima.jp":true,"nango.fukushima.jp":true,"nishiaizu.fukushima.jp":true,"nishigo.fukushima.jp":true,"okuma.fukushima.jp":true,"omotego.fukushima.jp":true,"ono.fukushima.jp":true,"otama.fukushima.jp":true,"samegawa.fukushima.jp":true,"shimogo.fukushima.jp":true,"shirakawa.fukushima.jp":true,"showa.fukushima.jp":true,"soma.fukushima.jp":true,"sukagawa.fukushima.jp":true,"taishin.fukushima.jp":true,"tamakawa.fukushima.jp":true,"tanagura.fukushima.jp":true,"tenei.fukushima.jp":true,"yabuki.fukushima.jp":true,"yamato.fukushima.jp":true,"yamatsuri.fukushima.jp":true,"yanaizu.fukushima.jp":true,"yugawa.fukushima.jp":true,"anpachi.gifu.jp":true,"ena.gifu.jp":true,"gifu.gifu.jp":true,"ginan.gifu.jp":true,"godo.gifu.jp":true,"gujo.gifu.jp":true,"hashima.gifu.jp":true,"hichiso.gifu.jp":true,"hida.gifu.jp":true,"higashishirakawa.gifu.jp":true,"ibigawa.gifu.jp":true,"ikeda.gifu.jp":true,"kakamigahara.gifu.jp":true,"kani.gifu.jp":true,"kasahara.gifu.jp":true,"kasamatsu.gifu.jp":true,"kawaue.gifu.jp":true,"kitagata.gifu.jp":true,"mino.gifu.jp":true,"minokamo.gifu.jp":true,"mitake.gifu.jp":true,"mizunami.gifu.jp":true,"motosu.gifu.jp":true,"nakatsugawa.gifu.jp":true,"ogaki.gifu.jp":true,"sakahogi.gifu.jp":true,"seki.gifu.jp":true,"sekigahara.gifu.jp":true,"shirakawa.gifu.jp":true,"tajimi.gifu.jp":true,"takayama.gifu.jp":true,"tarui.gifu.jp":true,"toki.gifu.jp":true,"tomika.gifu.jp":true,"wanouchi.gifu.jp":true,"yamagata.gifu.jp":true,"yaotsu.gifu.jp":true,"yoro.gifu.jp":true,"annaka.gunma.jp":true,"chiyoda.gunma.jp":true,"fujioka.gunma.jp":true,"higashiagatsuma.gunma.jp":true,"isesaki.gunma.jp":true,"itakura.gunma.jp":true,"kanna.gunma.jp":true,"kanra.gunma.jp":true,"katashina.gunma.jp":true,"kawaba.gunma.jp":true,"kiryu.gunma.jp":true,"kusatsu.gunma.jp":true,"maebashi.gunma.jp":true,"meiwa.gunma.jp":true,"midori.gunma.jp":true,"minakami.gunma.jp":true,"naganohara.gunma.jp":true,"nakanojo.gunma.jp":true,"nanmoku.gunma.jp":true,"numata.gunma.jp":true,"oizumi.gunma.jp":true,"ora.gunma.jp":true,"ota.gunma.jp":true,"shibukawa.gunma.jp":true,"shimonita.gunma.jp":true,"shinto.gunma.jp":true,"showa.gunma.jp":true,"takasaki.gunma.jp":true,"takayama.gunma.jp":true,"tamamura.gunma.jp":true,"tatebayashi.gunma.jp":true,"tomioka.gunma.jp":true,"tsukiyono.gunma.jp":true,"tsumagoi.gunma.jp":true,"ueno.gunma.jp":true,"yoshioka.gunma.jp":true,"asaminami.hiroshima.jp":true,"daiwa.hiroshima.jp":true,"etajima.hiroshima.jp":true,"fuchu.hiroshima.jp":true,"fukuyama.hiroshima.jp":true,"hatsukaichi.hiroshima.jp":true,"higashihiroshima.hiroshima.jp":true,"hongo.hiroshima.jp":true,"jinsekikogen.hiroshima.jp":true,"kaita.hiroshima.jp":true,"kui.hiroshima.jp":true,"kumano.hiroshima.jp":true,"kure.hiroshima.jp":true,"mihara.hiroshima.jp":true,"miyoshi.hiroshima.jp":true,"naka.hiroshima.jp":true,"onomichi.hiroshima.jp":true,"osakikamijima.hiroshima.jp":true,"otake.hiroshima.jp":true,"saka.hiroshima.jp":true,"sera.hiroshima.jp":true,"seranishi.hiroshima.jp":true,"shinichi.hiroshima.jp":true,"shobara.hiroshima.jp":true,"takehara.hiroshima.jp":true,"abashiri.hokkaido.jp":true,"abira.hokkaido.jp":true,"aibetsu.hokkaido.jp":true,"akabira.hokkaido.jp":true,"akkeshi.hokkaido.jp":true,"asahikawa.hokkaido.jp":true,"ashibetsu.hokkaido.jp":true,"ashoro.hokkaido.jp":true,"assabu.hokkaido.jp":true,"atsuma.hokkaido.jp":true,"bibai.hokkaido.jp":true,"biei.hokkaido.jp":true,"bifuka.hokkaido.jp":true,"bihoro.hokkaido.jp":true,"biratori.hokkaido.jp":true,"chippubetsu.hokkaido.jp":true,"chitose.hokkaido.jp":true,"date.hokkaido.jp":true,"ebetsu.hokkaido.jp":true,"embetsu.hokkaido.jp":true,"eniwa.hokkaido.jp":true,"erimo.hokkaido.jp":true,"esan.hokkaido.jp":true,"esashi.hokkaido.jp":true,"fukagawa.hokkaido.jp":true,"fukushima.hokkaido.jp":true,"furano.hokkaido.jp":true,"furubira.hokkaido.jp":true,"haboro.hokkaido.jp":true,"hakodate.hokkaido.jp":true,"hamatonbetsu.hokkaido.jp":true,"hidaka.hokkaido.jp":true,"higashikagura.hokkaido.jp":true,"higashikawa.hokkaido.jp":true,"hiroo.hokkaido.jp":true,"hokuryu.hokkaido.jp":true,"hokuto.hokkaido.jp":true,"honbetsu.hokkaido.jp":true,"horokanai.hokkaido.jp":true,"horonobe.hokkaido.jp":true,"ikeda.hokkaido.jp":true,"imakane.hokkaido.jp":true,"ishikari.hokkaido.jp":true,"iwamizawa.hokkaido.jp":true,"iwanai.hokkaido.jp":true,"kamifurano.hokkaido.jp":true,"kamikawa.hokkaido.jp":true,"kamishihoro.hokkaido.jp":true,"kamisunagawa.hokkaido.jp":true,"kamoenai.hokkaido.jp":true,"kayabe.hokkaido.jp":true,"kembuchi.hokkaido.jp":true,"kikonai.hokkaido.jp":true,"kimobetsu.hokkaido.jp":true,"kitahiroshima.hokkaido.jp":true,"kitami.hokkaido.jp":true,"kiyosato.hokkaido.jp":true,"koshimizu.hokkaido.jp":true,"kunneppu.hokkaido.jp":true,"kuriyama.hokkaido.jp":true,"kuromatsunai.hokkaido.jp":true,"kushiro.hokkaido.jp":true,"kutchan.hokkaido.jp":true,"kyowa.hokkaido.jp":true,"mashike.hokkaido.jp":true,"matsumae.hokkaido.jp":true,"mikasa.hokkaido.jp":true,"minamifurano.hokkaido.jp":true,"mombetsu.hokkaido.jp":true,"moseushi.hokkaido.jp":true,"mukawa.hokkaido.jp":true,"muroran.hokkaido.jp":true,"naie.hokkaido.jp":true,"nakagawa.hokkaido.jp":true,"nakasatsunai.hokkaido.jp":true,"nakatombetsu.hokkaido.jp":true,"nanae.hokkaido.jp":true,"nanporo.hokkaido.jp":true,"nayoro.hokkaido.jp":true,"nemuro.hokkaido.jp":true,"niikappu.hokkaido.jp":true,"niki.hokkaido.jp":true,"nishiokoppe.hokkaido.jp":true,"noboribetsu.hokkaido.jp":true,"numata.hokkaido.jp":true,"obihiro.hokkaido.jp":true,"obira.hokkaido.jp":true,"oketo.hokkaido.jp":true,"okoppe.hokkaido.jp":true,"otaru.hokkaido.jp":true,"otobe.hokkaido.jp":true,"otofuke.hokkaido.jp":true,"otoineppu.hokkaido.jp":true,"oumu.hokkaido.jp":true,"ozora.hokkaido.jp":true,"pippu.hokkaido.jp":true,"rankoshi.hokkaido.jp":true,"rebun.hokkaido.jp":true,"rikubetsu.hokkaido.jp":true,"rishiri.hokkaido.jp":true,"rishirifuji.hokkaido.jp":true,"saroma.hokkaido.jp":true,"sarufutsu.hokkaido.jp":true,"shakotan.hokkaido.jp":true,"shari.hokkaido.jp":true,"shibecha.hokkaido.jp":true,"shibetsu.hokkaido.jp":true,"shikabe.hokkaido.jp":true,"shikaoi.hokkaido.jp":true,"shimamaki.hokkaido.jp":true,"shimizu.hokkaido.jp":true,"shimokawa.hokkaido.jp":true,"shinshinotsu.hokkaido.jp":true,"shintoku.hokkaido.jp":true,"shiranuka.hokkaido.jp":true,"shiraoi.hokkaido.jp":true,"shiriuchi.hokkaido.jp":true,"sobetsu.hokkaido.jp":true,"sunagawa.hokkaido.jp":true,"taiki.hokkaido.jp":true,"takasu.hokkaido.jp":true,"takikawa.hokkaido.jp":true,"takinoue.hokkaido.jp":true,"teshikaga.hokkaido.jp":true,"tobetsu.hokkaido.jp":true,"tohma.hokkaido.jp":true,"tomakomai.hokkaido.jp":true,"tomari.hokkaido.jp":true,"toya.hokkaido.jp":true,"toyako.hokkaido.jp":true,"toyotomi.hokkaido.jp":true,"toyoura.hokkaido.jp":true,"tsubetsu.hokkaido.jp":true,"tsukigata.hokkaido.jp":true,"urakawa.hokkaido.jp":true,"urausu.hokkaido.jp":true,"uryu.hokkaido.jp":true,"utashinai.hokkaido.jp":true,"wakkanai.hokkaido.jp":true,"wassamu.hokkaido.jp":true,"yakumo.hokkaido.jp":true,"yoichi.hokkaido.jp":true,"aioi.hyogo.jp":true,"akashi.hyogo.jp":true,"ako.hyogo.jp":true,"amagasaki.hyogo.jp":true,"aogaki.hyogo.jp":true,"asago.hyogo.jp":true,"ashiya.hyogo.jp":true,"awaji.hyogo.jp":true,"fukusaki.hyogo.jp":true,"goshiki.hyogo.jp":true,"harima.hyogo.jp":true,"himeji.hyogo.jp":true,"ichikawa.hyogo.jp":true,"inagawa.hyogo.jp":true,"itami.hyogo.jp":true,"kakogawa.hyogo.jp":true,"kamigori.hyogo.jp":true,"kamikawa.hyogo.jp":true,"kasai.hyogo.jp":true,"kasuga.hyogo.jp":true,"kawanishi.hyogo.jp":true,"miki.hyogo.jp":true,"minamiawaji.hyogo.jp":true,"nishinomiya.hyogo.jp":true,"nishiwaki.hyogo.jp":true,"ono.hyogo.jp":true,"sanda.hyogo.jp":true,"sannan.hyogo.jp":true,"sasayama.hyogo.jp":true,"sayo.hyogo.jp":true,"shingu.hyogo.jp":true,"shinonsen.hyogo.jp":true,"shiso.hyogo.jp":true,"sumoto.hyogo.jp":true,"taishi.hyogo.jp":true,"taka.hyogo.jp":true,"takarazuka.hyogo.jp":true,"takasago.hyogo.jp":true,"takino.hyogo.jp":true,"tamba.hyogo.jp":true,"tatsuno.hyogo.jp":true,"toyooka.hyogo.jp":true,"yabu.hyogo.jp":true,"yashiro.hyogo.jp":true,"yoka.hyogo.jp":true,"yokawa.hyogo.jp":true,"ami.ibaraki.jp":true,"asahi.ibaraki.jp":true,"bando.ibaraki.jp":true,"chikusei.ibaraki.jp":true,"daigo.ibaraki.jp":true,"fujishiro.ibaraki.jp":true,"hitachi.ibaraki.jp":true,"hitachinaka.ibaraki.jp":true,"hitachiomiya.ibaraki.jp":true,"hitachiota.ibaraki.jp":true,"ibaraki.ibaraki.jp":true,"ina.ibaraki.jp":true,"inashiki.ibaraki.jp":true,"itako.ibaraki.jp":true,"iwama.ibaraki.jp":true,"joso.ibaraki.jp":true,"kamisu.ibaraki.jp":true,"kasama.ibaraki.jp":true,"kashima.ibaraki.jp":true,"kasumigaura.ibaraki.jp":true,"koga.ibaraki.jp":true,"miho.ibaraki.jp":true,"mito.ibaraki.jp":true,"moriya.ibaraki.jp":true,"naka.ibaraki.jp":true,"namegata.ibaraki.jp":true,"oarai.ibaraki.jp":true,"ogawa.ibaraki.jp":true,"omitama.ibaraki.jp":true,"ryugasaki.ibaraki.jp":true,"sakai.ibaraki.jp":true,"sakuragawa.ibaraki.jp":true,"shimodate.ibaraki.jp":true,"shimotsuma.ibaraki.jp":true,"shirosato.ibaraki.jp":true,"sowa.ibaraki.jp":true,"suifu.ibaraki.jp":true,"takahagi.ibaraki.jp":true,"tamatsukuri.ibaraki.jp":true,"tokai.ibaraki.jp":true,"tomobe.ibaraki.jp":true,"tone.ibaraki.jp":true,"toride.ibaraki.jp":true,"tsuchiura.ibaraki.jp":true,"tsukuba.ibaraki.jp":true,"uchihara.ibaraki.jp":true,"ushiku.ibaraki.jp":true,"yachiyo.ibaraki.jp":true,"yamagata.ibaraki.jp":true,"yawara.ibaraki.jp":true,"yuki.ibaraki.jp":true,"anamizu.ishikawa.jp":true,"hakui.ishikawa.jp":true,"hakusan.ishikawa.jp":true,"kaga.ishikawa.jp":true,"kahoku.ishikawa.jp":true,"kanazawa.ishikawa.jp":true,"kawakita.ishikawa.jp":true,"komatsu.ishikawa.jp":true,"nakanoto.ishikawa.jp":true,"nanao.ishikawa.jp":true,"nomi.ishikawa.jp":true,"nonoichi.ishikawa.jp":true,"noto.ishikawa.jp":true,"shika.ishikawa.jp":true,"suzu.ishikawa.jp":true,"tsubata.ishikawa.jp":true,"tsurugi.ishikawa.jp":true,"uchinada.ishikawa.jp":true,"wajima.ishikawa.jp":true,"fudai.iwate.jp":true,"fujisawa.iwate.jp":true,"hanamaki.iwate.jp":true,"hiraizumi.iwate.jp":true,"hirono.iwate.jp":true,"ichinohe.iwate.jp":true,"ichinoseki.iwate.jp":true,"iwaizumi.iwate.jp":true,"iwate.iwate.jp":true,"joboji.iwate.jp":true,"kamaishi.iwate.jp":true,"kanegasaki.iwate.jp":true,"karumai.iwate.jp":true,"kawai.iwate.jp":true,"kitakami.iwate.jp":true,"kuji.iwate.jp":true,"kunohe.iwate.jp":true,"kuzumaki.iwate.jp":true,"miyako.iwate.jp":true,"mizusawa.iwate.jp":true,"morioka.iwate.jp":true,"ninohe.iwate.jp":true,"noda.iwate.jp":true,"ofunato.iwate.jp":true,"oshu.iwate.jp":true,"otsuchi.iwate.jp":true,"rikuzentakata.iwate.jp":true,"shiwa.iwate.jp":true,"shizukuishi.iwate.jp":true,"sumita.iwate.jp":true,"tanohata.iwate.jp":true,"tono.iwate.jp":true,"yahaba.iwate.jp":true,"yamada.iwate.jp":true,"ayagawa.kagawa.jp":true,"higashikagawa.kagawa.jp":true,"kanonji.kagawa.jp":true,"kotohira.kagawa.jp":true,"manno.kagawa.jp":true,"marugame.kagawa.jp":true,"mitoyo.kagawa.jp":true,"naoshima.kagawa.jp":true,"sanuki.kagawa.jp":true,"tadotsu.kagawa.jp":true,"takamatsu.kagawa.jp":true,"tonosho.kagawa.jp":true,"uchinomi.kagawa.jp":true,"utazu.kagawa.jp":true,"zentsuji.kagawa.jp":true,"akune.kagoshima.jp":true,"amami.kagoshima.jp":true,"hioki.kagoshima.jp":true,"isa.kagoshima.jp":true,"isen.kagoshima.jp":true,"izumi.kagoshima.jp":true,"kagoshima.kagoshima.jp":true,"kanoya.kagoshima.jp":true,"kawanabe.kagoshima.jp":true,"kinko.kagoshima.jp":true,"kouyama.kagoshima.jp":true,"makurazaki.kagoshima.jp":true,"matsumoto.kagoshima.jp":true,"minamitane.kagoshima.jp":true,"nakatane.kagoshima.jp":true,"nishinoomote.kagoshima.jp":true,"satsumasendai.kagoshima.jp":true,"soo.kagoshima.jp":true,"tarumizu.kagoshima.jp":true,"yusui.kagoshima.jp":true,"aikawa.kanagawa.jp":true,"atsugi.kanagawa.jp":true,"ayase.kanagawa.jp":true,"chigasaki.kanagawa.jp":true,"ebina.kanagawa.jp":true,"fujisawa.kanagawa.jp":true,"hadano.kanagawa.jp":true,"hakone.kanagawa.jp":true,"hiratsuka.kanagawa.jp":true,"isehara.kanagawa.jp":true,"kaisei.kanagawa.jp":true,"kamakura.kanagawa.jp":true,"kiyokawa.kanagawa.jp":true,"matsuda.kanagawa.jp":true,"minamiashigara.kanagawa.jp":true,"miura.kanagawa.jp":true,"nakai.kanagawa.jp":true,"ninomiya.kanagawa.jp":true,"odawara.kanagawa.jp":true,"oi.kanagawa.jp":true,"oiso.kanagawa.jp":true,"sagamihara.kanagawa.jp":true,"samukawa.kanagawa.jp":true,"tsukui.kanagawa.jp":true,"yamakita.kanagawa.jp":true,"yamato.kanagawa.jp":true,"yokosuka.kanagawa.jp":true,"yugawara.kanagawa.jp":true,"zama.kanagawa.jp":true,"zushi.kanagawa.jp":true,"aki.kochi.jp":true,"geisei.kochi.jp":true,"hidaka.kochi.jp":true,"higashitsuno.kochi.jp":true,"ino.kochi.jp":true,"kagami.kochi.jp":true,"kami.kochi.jp":true,"kitagawa.kochi.jp":true,"kochi.kochi.jp":true,"mihara.kochi.jp":true,"motoyama.kochi.jp":true,"muroto.kochi.jp":true,"nahari.kochi.jp":true,"nakamura.kochi.jp":true,"nankoku.kochi.jp":true,"nishitosa.kochi.jp":true,"niyodogawa.kochi.jp":true,"ochi.kochi.jp":true,"okawa.kochi.jp":true,"otoyo.kochi.jp":true,"otsuki.kochi.jp":true,"sakawa.kochi.jp":true,"sukumo.kochi.jp":true,"susaki.kochi.jp":true,"tosa.kochi.jp":true,"tosashimizu.kochi.jp":true,"toyo.kochi.jp":true,"tsuno.kochi.jp":true,"umaji.kochi.jp":true,"yasuda.kochi.jp":true,"yusuhara.kochi.jp":true,"amakusa.kumamoto.jp":true,"arao.kumamoto.jp":true,"aso.kumamoto.jp":true,"choyo.kumamoto.jp":true,"gyokuto.kumamoto.jp":true,"hitoyoshi.kumamoto.jp":true,"kamiamakusa.kumamoto.jp":true,"kashima.kumamoto.jp":true,"kikuchi.kumamoto.jp":true,"kosa.kumamoto.jp":true,"kumamoto.kumamoto.jp":true,"mashiki.kumamoto.jp":true,"mifune.kumamoto.jp":true,"minamata.kumamoto.jp":true,"minamioguni.kumamoto.jp":true,"nagasu.kumamoto.jp":true,"nishihara.kumamoto.jp":true,"oguni.kumamoto.jp":true,"ozu.kumamoto.jp":true,"sumoto.kumamoto.jp":true,"takamori.kumamoto.jp":true,"uki.kumamoto.jp":true,"uto.kumamoto.jp":true,"yamaga.kumamoto.jp":true,"yamato.kumamoto.jp":true,"yatsushiro.kumamoto.jp":true,"ayabe.kyoto.jp":true,"fukuchiyama.kyoto.jp":true,"higashiyama.kyoto.jp":true,"ide.kyoto.jp":true,"ine.kyoto.jp":true,"joyo.kyoto.jp":true,"kameoka.kyoto.jp":true,"kamo.kyoto.jp":true,"kita.kyoto.jp":true,"kizu.kyoto.jp":true,"kumiyama.kyoto.jp":true,"kyotamba.kyoto.jp":true,"kyotanabe.kyoto.jp":true,"kyotango.kyoto.jp":true,"maizuru.kyoto.jp":true,"minami.kyoto.jp":true,"minamiyamashiro.kyoto.jp":true,"miyazu.kyoto.jp":true,"muko.kyoto.jp":true,"nagaokakyo.kyoto.jp":true,"nakagyo.kyoto.jp":true,"nantan.kyoto.jp":true,"oyamazaki.kyoto.jp":true,"sakyo.kyoto.jp":true,"seika.kyoto.jp":true,"tanabe.kyoto.jp":true,"uji.kyoto.jp":true,"ujitawara.kyoto.jp":true,"wazuka.kyoto.jp":true,"yamashina.kyoto.jp":true,"yawata.kyoto.jp":true,"asahi.mie.jp":true,"inabe.mie.jp":true,"ise.mie.jp":true,"kameyama.mie.jp":true,"kawagoe.mie.jp":true,"kiho.mie.jp":true,"kisosaki.mie.jp":true,"kiwa.mie.jp":true,"komono.mie.jp":true,"kumano.mie.jp":true,"kuwana.mie.jp":true,"matsusaka.mie.jp":true,"meiwa.mie.jp":true,"mihama.mie.jp":true,"minamiise.mie.jp":true,"misugi.mie.jp":true,"miyama.mie.jp":true,"nabari.mie.jp":true,"shima.mie.jp":true,"suzuka.mie.jp":true,"tado.mie.jp":true,"taiki.mie.jp":true,"taki.mie.jp":true,"tamaki.mie.jp":true,"toba.mie.jp":true,"tsu.mie.jp":true,"udono.mie.jp":true,"ureshino.mie.jp":true,"watarai.mie.jp":true,"yokkaichi.mie.jp":true,"furukawa.miyagi.jp":true,"higashimatsushima.miyagi.jp":true,"ishinomaki.miyagi.jp":true,"iwanuma.miyagi.jp":true,"kakuda.miyagi.jp":true,"kami.miyagi.jp":true,"kawasaki.miyagi.jp":true,"kesennuma.miyagi.jp":true,"marumori.miyagi.jp":true,"matsushima.miyagi.jp":true,"minamisanriku.miyagi.jp":true,"misato.miyagi.jp":true,"murata.miyagi.jp":true,"natori.miyagi.jp":true,"ogawara.miyagi.jp":true,"ohira.miyagi.jp":true,"onagawa.miyagi.jp":true,"osaki.miyagi.jp":true,"rifu.miyagi.jp":true,"semine.miyagi.jp":true,"shibata.miyagi.jp":true,"shichikashuku.miyagi.jp":true,"shikama.miyagi.jp":true,"shiogama.miyagi.jp":true,"shiroishi.miyagi.jp":true,"tagajo.miyagi.jp":true,"taiwa.miyagi.jp":true,"tome.miyagi.jp":true,"tomiya.miyagi.jp":true,"wakuya.miyagi.jp":true,"watari.miyagi.jp":true,"yamamoto.miyagi.jp":true,"zao.miyagi.jp":true,"aya.miyazaki.jp":true,"ebino.miyazaki.jp":true,"gokase.miyazaki.jp":true,"hyuga.miyazaki.jp":true,"kadogawa.miyazaki.jp":true,"kawaminami.miyazaki.jp":true,"kijo.miyazaki.jp":true,"kitagawa.miyazaki.jp":true,"kitakata.miyazaki.jp":true,"kitaura.miyazaki.jp":true,"kobayashi.miyazaki.jp":true,"kunitomi.miyazaki.jp":true,"kushima.miyazaki.jp":true,"mimata.miyazaki.jp":true,"miyakonojo.miyazaki.jp":true,"miyazaki.miyazaki.jp":true,"morotsuka.miyazaki.jp":true,"nichinan.miyazaki.jp":true,"nishimera.miyazaki.jp":true,"nobeoka.miyazaki.jp":true,"saito.miyazaki.jp":true,"shiiba.miyazaki.jp":true,"shintomi.miyazaki.jp":true,"takaharu.miyazaki.jp":true,"takanabe.miyazaki.jp":true,"takazaki.miyazaki.jp":true,"tsuno.miyazaki.jp":true,"achi.nagano.jp":true,"agematsu.nagano.jp":true,"anan.nagano.jp":true,"aoki.nagano.jp":true,"asahi.nagano.jp":true,"azumino.nagano.jp":true,"chikuhoku.nagano.jp":true,"chikuma.nagano.jp":true,"chino.nagano.jp":true,"fujimi.nagano.jp":true,"hakuba.nagano.jp":true,"hara.nagano.jp":true,"hiraya.nagano.jp":true,"iida.nagano.jp":true,"iijima.nagano.jp":true,"iiyama.nagano.jp":true,"iizuna.nagano.jp":true,"ikeda.nagano.jp":true,"ikusaka.nagano.jp":true,"ina.nagano.jp":true,"karuizawa.nagano.jp":true,"kawakami.nagano.jp":true,"kiso.nagano.jp":true,"kisofukushima.nagano.jp":true,"kitaaiki.nagano.jp":true,"komagane.nagano.jp":true,"komoro.nagano.jp":true,"matsukawa.nagano.jp":true,"matsumoto.nagano.jp":true,"miasa.nagano.jp":true,"minamiaiki.nagano.jp":true,"minamimaki.nagano.jp":true,"minamiminowa.nagano.jp":true,"minowa.nagano.jp":true,"miyada.nagano.jp":true,"miyota.nagano.jp":true,"mochizuki.nagano.jp":true,"nagano.nagano.jp":true,"nagawa.nagano.jp":true,"nagiso.nagano.jp":true,"nakagawa.nagano.jp":true,"nakano.nagano.jp":true,"nozawaonsen.nagano.jp":true,"obuse.nagano.jp":true,"ogawa.nagano.jp":true,"okaya.nagano.jp":true,"omachi.nagano.jp":true,"omi.nagano.jp":true,"ookuwa.nagano.jp":true,"ooshika.nagano.jp":true,"otaki.nagano.jp":true,"otari.nagano.jp":true,"sakae.nagano.jp":true,"sakaki.nagano.jp":true,"saku.nagano.jp":true,"sakuho.nagano.jp":true,"shimosuwa.nagano.jp":true,"shinanomachi.nagano.jp":true,"shiojiri.nagano.jp":true,"suwa.nagano.jp":true,"suzaka.nagano.jp":true,"takagi.nagano.jp":true,"takamori.nagano.jp":true,"takayama.nagano.jp":true,"tateshina.nagano.jp":true,"tatsuno.nagano.jp":true,"togakushi.nagano.jp":true,"togura.nagano.jp":true,"tomi.nagano.jp":true,"ueda.nagano.jp":true,"wada.nagano.jp":true,"yamagata.nagano.jp":true,"yamanouchi.nagano.jp":true,"yasaka.nagano.jp":true,"yasuoka.nagano.jp":true,"chijiwa.nagasaki.jp":true,"futsu.nagasaki.jp":true,"goto.nagasaki.jp":true,"hasami.nagasaki.jp":true,"hirado.nagasaki.jp":true,"iki.nagasaki.jp":true,"isahaya.nagasaki.jp":true,"kawatana.nagasaki.jp":true,"kuchinotsu.nagasaki.jp":true,"matsuura.nagasaki.jp":true,"nagasaki.nagasaki.jp":true,"obama.nagasaki.jp":true,"omura.nagasaki.jp":true,"oseto.nagasaki.jp":true,"saikai.nagasaki.jp":true,"sasebo.nagasaki.jp":true,"seihi.nagasaki.jp":true,"shimabara.nagasaki.jp":true,"shinkamigoto.nagasaki.jp":true,"togitsu.nagasaki.jp":true,"tsushima.nagasaki.jp":true,"unzen.nagasaki.jp":true,"ando.nara.jp":true,"gose.nara.jp":true,"heguri.nara.jp":true,"higashiyoshino.nara.jp":true,"ikaruga.nara.jp":true,"ikoma.nara.jp":true,"kamikitayama.nara.jp":true,"kanmaki.nara.jp":true,"kashiba.nara.jp":true,"kashihara.nara.jp":true,"katsuragi.nara.jp":true,"kawai.nara.jp":true,"kawakami.nara.jp":true,"kawanishi.nara.jp":true,"koryo.nara.jp":true,"kurotaki.nara.jp":true,"mitsue.nara.jp":true,"miyake.nara.jp":true,"nara.nara.jp":true,"nosegawa.nara.jp":true,"oji.nara.jp":true,"ouda.nara.jp":true,"oyodo.nara.jp":true,"sakurai.nara.jp":true,"sango.nara.jp":true,"shimoichi.nara.jp":true,"shimokitayama.nara.jp":true,"shinjo.nara.jp":true,"soni.nara.jp":true,"takatori.nara.jp":true,"tawaramoto.nara.jp":true,"tenkawa.nara.jp":true,"tenri.nara.jp":true,"uda.nara.jp":true,"yamatokoriyama.nara.jp":true,"yamatotakada.nara.jp":true,"yamazoe.nara.jp":true,"yoshino.nara.jp":true,"aga.niigata.jp":true,"agano.niigata.jp":true,"gosen.niigata.jp":true,"itoigawa.niigata.jp":true,"izumozaki.niigata.jp":true,"joetsu.niigata.jp":true,"kamo.niigata.jp":true,"kariwa.niigata.jp":true,"kashiwazaki.niigata.jp":true,"minamiuonuma.niigata.jp":true,"mitsuke.niigata.jp":true,"muika.niigata.jp":true,"murakami.niigata.jp":true,"myoko.niigata.jp":true,"nagaoka.niigata.jp":true,"niigata.niigata.jp":true,"ojiya.niigata.jp":true,"omi.niigata.jp":true,"sado.niigata.jp":true,"sanjo.niigata.jp":true,"seiro.niigata.jp":true,"seirou.niigata.jp":true,"sekikawa.niigata.jp":true,"shibata.niigata.jp":true,"tagami.niigata.jp":true,"tainai.niigata.jp":true,"tochio.niigata.jp":true,"tokamachi.niigata.jp":true,"tsubame.niigata.jp":true,"tsunan.niigata.jp":true,"uonuma.niigata.jp":true,"yahiko.niigata.jp":true,"yoita.niigata.jp":true,"yuzawa.niigata.jp":true,"beppu.oita.jp":true,"bungoono.oita.jp":true,"bungotakada.oita.jp":true,"hasama.oita.jp":true,"hiji.oita.jp":true,"himeshima.oita.jp":true,"hita.oita.jp":true,"kamitsue.oita.jp":true,"kokonoe.oita.jp":true,"kuju.oita.jp":true,"kunisaki.oita.jp":true,"kusu.oita.jp":true,"oita.oita.jp":true,"saiki.oita.jp":true,"taketa.oita.jp":true,"tsukumi.oita.jp":true,"usa.oita.jp":true,"usuki.oita.jp":true,"yufu.oita.jp":true,"akaiwa.okayama.jp":true,"asakuchi.okayama.jp":true,"bizen.okayama.jp":true,"hayashima.okayama.jp":true,"ibara.okayama.jp":true,"kagamino.okayama.jp":true,"kasaoka.okayama.jp":true,"kibichuo.okayama.jp":true,"kumenan.okayama.jp":true,"kurashiki.okayama.jp":true,"maniwa.okayama.jp":true,"misaki.okayama.jp":true,"nagi.okayama.jp":true,"niimi.okayama.jp":true,"nishiawakura.okayama.jp":true,"okayama.okayama.jp":true,"satosho.okayama.jp":true,"setouchi.okayama.jp":true,"shinjo.okayama.jp":true,"shoo.okayama.jp":true,"soja.okayama.jp":true,"takahashi.okayama.jp":true,"tamano.okayama.jp":true,"tsuyama.okayama.jp":true,"wake.okayama.jp":true,"yakage.okayama.jp":true,"aguni.okinawa.jp":true,"ginowan.okinawa.jp":true,"ginoza.okinawa.jp":true,"gushikami.okinawa.jp":true,"haebaru.okinawa.jp":true,"higashi.okinawa.jp":true,"hirara.okinawa.jp":true,"iheya.okinawa.jp":true,"ishigaki.okinawa.jp":true,"ishikawa.okinawa.jp":true,"itoman.okinawa.jp":true,"izena.okinawa.jp":true,"kadena.okinawa.jp":true,"kin.okinawa.jp":true,"kitadaito.okinawa.jp":true,"kitanakagusuku.okinawa.jp":true,"kumejima.okinawa.jp":true,"kunigami.okinawa.jp":true,"minamidaito.okinawa.jp":true,"motobu.okinawa.jp":true,"nago.okinawa.jp":true,"naha.okinawa.jp":true,"nakagusuku.okinawa.jp":true,"nakijin.okinawa.jp":true,"nanjo.okinawa.jp":true,"nishihara.okinawa.jp":true,"ogimi.okinawa.jp":true,"okinawa.okinawa.jp":true,"onna.okinawa.jp":true,"shimoji.okinawa.jp":true,"taketomi.okinawa.jp":true,"tarama.okinawa.jp":true,"tokashiki.okinawa.jp":true,"tomigusuku.okinawa.jp":true,"tonaki.okinawa.jp":true,"urasoe.okinawa.jp":true,"uruma.okinawa.jp":true,"yaese.okinawa.jp":true,"yomitan.okinawa.jp":true,"yonabaru.okinawa.jp":true,"yonaguni.okinawa.jp":true,"zamami.okinawa.jp":true,"abeno.osaka.jp":true,"chihayaakasaka.osaka.jp":true,"chuo.osaka.jp":true,"daito.osaka.jp":true,"fujiidera.osaka.jp":true,"habikino.osaka.jp":true,"hannan.osaka.jp":true,"higashiosaka.osaka.jp":true,"higashisumiyoshi.osaka.jp":true,"higashiyodogawa.osaka.jp":true,"hirakata.osaka.jp":true,"ibaraki.osaka.jp":true,"ikeda.osaka.jp":true,"izumi.osaka.jp":true,"izumiotsu.osaka.jp":true,"izumisano.osaka.jp":true,"kadoma.osaka.jp":true,"kaizuka.osaka.jp":true,"kanan.osaka.jp":true,"kashiwara.osaka.jp":true,"katano.osaka.jp":true,"kawachinagano.osaka.jp":true,"kishiwada.osaka.jp":true,"kita.osaka.jp":true,"kumatori.osaka.jp":true,"matsubara.osaka.jp":true,"minato.osaka.jp":true,"minoh.osaka.jp":true,"misaki.osaka.jp":true,"moriguchi.osaka.jp":true,"neyagawa.osaka.jp":true,"nishi.osaka.jp":true,"nose.osaka.jp":true,"osakasayama.osaka.jp":true,"sakai.osaka.jp":true,"sayama.osaka.jp":true,"sennan.osaka.jp":true,"settsu.osaka.jp":true,"shijonawate.osaka.jp":true,"shimamoto.osaka.jp":true,"suita.osaka.jp":true,"tadaoka.osaka.jp":true,"taishi.osaka.jp":true,"tajiri.osaka.jp":true,"takaishi.osaka.jp":true,"takatsuki.osaka.jp":true,"tondabayashi.osaka.jp":true,"toyonaka.osaka.jp":true,"toyono.osaka.jp":true,"yao.osaka.jp":true,"ariake.saga.jp":true,"arita.saga.jp":true,"fukudomi.saga.jp":true,"genkai.saga.jp":true,"hamatama.saga.jp":true,"hizen.saga.jp":true,"imari.saga.jp":true,"kamimine.saga.jp":true,"kanzaki.saga.jp":true,"karatsu.saga.jp":true,"kashima.saga.jp":true,"kitagata.saga.jp":true,"kitahata.saga.jp":true,"kiyama.saga.jp":true,"kouhoku.saga.jp":true,"kyuragi.saga.jp":true,"nishiarita.saga.jp":true,"ogi.saga.jp":true,"omachi.saga.jp":true,"ouchi.saga.jp":true,"saga.saga.jp":true,"shiroishi.saga.jp":true,"taku.saga.jp":true,"tara.saga.jp":true,"tosu.saga.jp":true,"yoshinogari.saga.jp":true,"arakawa.saitama.jp":true,"asaka.saitama.jp":true,"chichibu.saitama.jp":true,"fujimi.saitama.jp":true,"fujimino.saitama.jp":true,"fukaya.saitama.jp":true,"hanno.saitama.jp":true,"hanyu.saitama.jp":true,"hasuda.saitama.jp":true,"hatogaya.saitama.jp":true,"hatoyama.saitama.jp":true,"hidaka.saitama.jp":true,"higashichichibu.saitama.jp":true,"higashimatsuyama.saitama.jp":true,"honjo.saitama.jp":true,"ina.saitama.jp":true,"iruma.saitama.jp":true,"iwatsuki.saitama.jp":true,"kamiizumi.saitama.jp":true,"kamikawa.saitama.jp":true,"kamisato.saitama.jp":true,"kasukabe.saitama.jp":true,"kawagoe.saitama.jp":true,"kawaguchi.saitama.jp":true,"kawajima.saitama.jp":true,"kazo.saitama.jp":true,"kitamoto.saitama.jp":true,"koshigaya.saitama.jp":true,"kounosu.saitama.jp":true,"kuki.saitama.jp":true,"kumagaya.saitama.jp":true,"matsubushi.saitama.jp":true,"minano.saitama.jp":true,"misato.saitama.jp":true,"miyashiro.saitama.jp":true,"miyoshi.saitama.jp":true,"moroyama.saitama.jp":true,"nagatoro.saitama.jp":true,"namegawa.saitama.jp":true,"niiza.saitama.jp":true,"ogano.saitama.jp":true,"ogawa.saitama.jp":true,"ogose.saitama.jp":true,"okegawa.saitama.jp":true,"omiya.saitama.jp":true,"otaki.saitama.jp":true,"ranzan.saitama.jp":true,"ryokami.saitama.jp":true,"saitama.saitama.jp":true,"sakado.saitama.jp":true,"satte.saitama.jp":true,"sayama.saitama.jp":true,"shiki.saitama.jp":true,"shiraoka.saitama.jp":true,"soka.saitama.jp":true,"sugito.saitama.jp":true,"toda.saitama.jp":true,"tokigawa.saitama.jp":true,"tokorozawa.saitama.jp":true,"tsurugashima.saitama.jp":true,"urawa.saitama.jp":true,"warabi.saitama.jp":true,"yashio.saitama.jp":true,"yokoze.saitama.jp":true,"yono.saitama.jp":true,"yorii.saitama.jp":true,"yoshida.saitama.jp":true,"yoshikawa.saitama.jp":true,"yoshimi.saitama.jp":true,"aisho.shiga.jp":true,"gamo.shiga.jp":true,"higashiomi.shiga.jp":true,"hikone.shiga.jp":true,"koka.shiga.jp":true,"konan.shiga.jp":true,"kosei.shiga.jp":true,"koto.shiga.jp":true,"kusatsu.shiga.jp":true,"maibara.shiga.jp":true,"moriyama.shiga.jp":true,"nagahama.shiga.jp":true,"nishiazai.shiga.jp":true,"notogawa.shiga.jp":true,"omihachiman.shiga.jp":true,"otsu.shiga.jp":true,"ritto.shiga.jp":true,"ryuoh.shiga.jp":true,"takashima.shiga.jp":true,"takatsuki.shiga.jp":true,"torahime.shiga.jp":true,"toyosato.shiga.jp":true,"yasu.shiga.jp":true,"akagi.shimane.jp":true,"ama.shimane.jp":true,"gotsu.shimane.jp":true,"hamada.shimane.jp":true,"higashiizumo.shimane.jp":true,"hikawa.shimane.jp":true,"hikimi.shimane.jp":true,"izumo.shimane.jp":true,"kakinoki.shimane.jp":true,"masuda.shimane.jp":true,"matsue.shimane.jp":true,"misato.shimane.jp":true,"nishinoshima.shimane.jp":true,"ohda.shimane.jp":true,"okinoshima.shimane.jp":true,"okuizumo.shimane.jp":true,"shimane.shimane.jp":true,"tamayu.shimane.jp":true,"tsuwano.shimane.jp":true,"unnan.shimane.jp":true,"yakumo.shimane.jp":true,"yasugi.shimane.jp":true,"yatsuka.shimane.jp":true,"arai.shizuoka.jp":true,"atami.shizuoka.jp":true,"fuji.shizuoka.jp":true,"fujieda.shizuoka.jp":true,"fujikawa.shizuoka.jp":true,"fujinomiya.shizuoka.jp":true,"fukuroi.shizuoka.jp":true,"gotemba.shizuoka.jp":true,"haibara.shizuoka.jp":true,"hamamatsu.shizuoka.jp":true,"higashiizu.shizuoka.jp":true,"ito.shizuoka.jp":true,"iwata.shizuoka.jp":true,"izu.shizuoka.jp":true,"izunokuni.shizuoka.jp":true,"kakegawa.shizuoka.jp":true,"kannami.shizuoka.jp":true,"kawanehon.shizuoka.jp":true,"kawazu.shizuoka.jp":true,"kikugawa.shizuoka.jp":true,"kosai.shizuoka.jp":true,"makinohara.shizuoka.jp":true,"matsuzaki.shizuoka.jp":true,"minamiizu.shizuoka.jp":true,"mishima.shizuoka.jp":true,"morimachi.shizuoka.jp":true,"nishiizu.shizuoka.jp":true,"numazu.shizuoka.jp":true,"omaezaki.shizuoka.jp":true,"shimada.shizuoka.jp":true,"shimizu.shizuoka.jp":true,"shimoda.shizuoka.jp":true,"shizuoka.shizuoka.jp":true,"susono.shizuoka.jp":true,"yaizu.shizuoka.jp":true,"yoshida.shizuoka.jp":true,"ashikaga.tochigi.jp":true,"bato.tochigi.jp":true,"haga.tochigi.jp":true,"ichikai.tochigi.jp":true,"iwafune.tochigi.jp":true,"kaminokawa.tochigi.jp":true,"kanuma.tochigi.jp":true,"karasuyama.tochigi.jp":true,"kuroiso.tochigi.jp":true,"mashiko.tochigi.jp":true,"mibu.tochigi.jp":true,"moka.tochigi.jp":true,"motegi.tochigi.jp":true,"nasu.tochigi.jp":true,"nasushiobara.tochigi.jp":true,"nikko.tochigi.jp":true,"nishikata.tochigi.jp":true,"nogi.tochigi.jp":true,"ohira.tochigi.jp":true,"ohtawara.tochigi.jp":true,"oyama.tochigi.jp":true,"sakura.tochigi.jp":true,"sano.tochigi.jp":true,"shimotsuke.tochigi.jp":true,"shioya.tochigi.jp":true,"takanezawa.tochigi.jp":true,"tochigi.tochigi.jp":true,"tsuga.tochigi.jp":true,"ujiie.tochigi.jp":true,"utsunomiya.tochigi.jp":true,"yaita.tochigi.jp":true,"aizumi.tokushima.jp":true,"anan.tokushima.jp":true,"ichiba.tokushima.jp":true,"itano.tokushima.jp":true,"kainan.tokushima.jp":true,"komatsushima.tokushima.jp":true,"matsushige.tokushima.jp":true,"mima.tokushima.jp":true,"minami.tokushima.jp":true,"miyoshi.tokushima.jp":true,"mugi.tokushima.jp":true,"nakagawa.tokushima.jp":true,"naruto.tokushima.jp":true,"sanagochi.tokushima.jp":true,"shishikui.tokushima.jp":true,"tokushima.tokushima.jp":true,"wajiki.tokushima.jp":true,"adachi.tokyo.jp":true,"akiruno.tokyo.jp":true,"akishima.tokyo.jp":true,"aogashima.tokyo.jp":true,"arakawa.tokyo.jp":true,"bunkyo.tokyo.jp":true,"chiyoda.tokyo.jp":true,"chofu.tokyo.jp":true,"chuo.tokyo.jp":true,"edogawa.tokyo.jp":true,"fuchu.tokyo.jp":true,"fussa.tokyo.jp":true,"hachijo.tokyo.jp":true,"hachioji.tokyo.jp":true,"hamura.tokyo.jp":true,"higashikurume.tokyo.jp":true,"higashimurayama.tokyo.jp":true,"higashiyamato.tokyo.jp":true,"hino.tokyo.jp":true,"hinode.tokyo.jp":true,"hinohara.tokyo.jp":true,"inagi.tokyo.jp":true,"itabashi.tokyo.jp":true,"katsushika.tokyo.jp":true,"kita.tokyo.jp":true,"kiyose.tokyo.jp":true,"kodaira.tokyo.jp":true,"koganei.tokyo.jp":true,"kokubunji.tokyo.jp":true,"komae.tokyo.jp":true,"koto.tokyo.jp":true,"kouzushima.tokyo.jp":true,"kunitachi.tokyo.jp":true,"machida.tokyo.jp":true,"meguro.tokyo.jp":true,"minato.tokyo.jp":true,"mitaka.tokyo.jp":true,"mizuho.tokyo.jp":true,"musashimurayama.tokyo.jp":true,"musashino.tokyo.jp":true,"nakano.tokyo.jp":true,"nerima.tokyo.jp":true,"ogasawara.tokyo.jp":true,"okutama.tokyo.jp":true,"ome.tokyo.jp":true,"oshima.tokyo.jp":true,"ota.tokyo.jp":true,"setagaya.tokyo.jp":true,"shibuya.tokyo.jp":true,"shinagawa.tokyo.jp":true,"shinjuku.tokyo.jp":true,"suginami.tokyo.jp":true,"sumida.tokyo.jp":true,"tachikawa.tokyo.jp":true,"taito.tokyo.jp":true,"tama.tokyo.jp":true,"toshima.tokyo.jp":true,"chizu.tottori.jp":true,"hino.tottori.jp":true,"kawahara.tottori.jp":true,"koge.tottori.jp":true,"kotoura.tottori.jp":true,"misasa.tottori.jp":true,"nanbu.tottori.jp":true,"nichinan.tottori.jp":true,"sakaiminato.tottori.jp":true,"tottori.tottori.jp":true,"wakasa.tottori.jp":true,"yazu.tottori.jp":true,"yonago.tottori.jp":true,"asahi.toyama.jp":true,"fuchu.toyama.jp":true,"fukumitsu.toyama.jp":true,"funahashi.toyama.jp":true,"himi.toyama.jp":true,"imizu.toyama.jp":true,"inami.toyama.jp":true,"johana.toyama.jp":true,"kamiichi.toyama.jp":true,"kurobe.toyama.jp":true,"nakaniikawa.toyama.jp":true,"namerikawa.toyama.jp":true,"nanto.toyama.jp":true,"nyuzen.toyama.jp":true,"oyabe.toyama.jp":true,"taira.toyama.jp":true,"takaoka.toyama.jp":true,"tateyama.toyama.jp":true,"toga.toyama.jp":true,"tonami.toyama.jp":true,"toyama.toyama.jp":true,"unazuki.toyama.jp":true,"uozu.toyama.jp":true,"yamada.toyama.jp":true,"arida.wakayama.jp":true,"aridagawa.wakayama.jp":true,"gobo.wakayama.jp":true,"hashimoto.wakayama.jp":true,"hidaka.wakayama.jp":true,"hirogawa.wakayama.jp":true,"inami.wakayama.jp":true,"iwade.wakayama.jp":true,"kainan.wakayama.jp":true,"kamitonda.wakayama.jp":true,"katsuragi.wakayama.jp":true,"kimino.wakayama.jp":true,"kinokawa.wakayama.jp":true,"kitayama.wakayama.jp":true,"koya.wakayama.jp":true,"koza.wakayama.jp":true,"kozagawa.wakayama.jp":true,"kudoyama.wakayama.jp":true,"kushimoto.wakayama.jp":true,"mihama.wakayama.jp":true,"misato.wakayama.jp":true,"nachikatsuura.wakayama.jp":true,"shingu.wakayama.jp":true,"shirahama.wakayama.jp":true,"taiji.wakayama.jp":true,"tanabe.wakayama.jp":true,"wakayama.wakayama.jp":true,"yuasa.wakayama.jp":true,"yura.wakayama.jp":true,"asahi.yamagata.jp":true,"funagata.yamagata.jp":true,"higashine.yamagata.jp":true,"iide.yamagata.jp":true,"kahoku.yamagata.jp":true,"kaminoyama.yamagata.jp":true,"kaneyama.yamagata.jp":true,"kawanishi.yamagata.jp":true,"mamurogawa.yamagata.jp":true,"mikawa.yamagata.jp":true,"murayama.yamagata.jp":true,"nagai.yamagata.jp":true,"nakayama.yamagata.jp":true,"nanyo.yamagata.jp":true,"nishikawa.yamagata.jp":true,"obanazawa.yamagata.jp":true,"oe.yamagata.jp":true,"oguni.yamagata.jp":true,"ohkura.yamagata.jp":true,"oishida.yamagata.jp":true,"sagae.yamagata.jp":true,"sakata.yamagata.jp":true,"sakegawa.yamagata.jp":true,"shinjo.yamagata.jp":true,"shirataka.yamagata.jp":true,"shonai.yamagata.jp":true,"takahata.yamagata.jp":true,"tendo.yamagata.jp":true,"tozawa.yamagata.jp":true,"tsuruoka.yamagata.jp":true,"yamagata.yamagata.jp":true,"yamanobe.yamagata.jp":true,"yonezawa.yamagata.jp":true,"yuza.yamagata.jp":true,"abu.yamaguchi.jp":true,"hagi.yamaguchi.jp":true,"hikari.yamaguchi.jp":true,"hofu.yamaguchi.jp":true,"iwakuni.yamaguchi.jp":true,"kudamatsu.yamaguchi.jp":true,"mitou.yamaguchi.jp":true,"nagato.yamaguchi.jp":true,"oshima.yamaguchi.jp":true,"shimonoseki.yamaguchi.jp":true,"shunan.yamaguchi.jp":true,"tabuse.yamaguchi.jp":true,"tokuyama.yamaguchi.jp":true,"toyota.yamaguchi.jp":true,"ube.yamaguchi.jp":true,"yuu.yamaguchi.jp":true,"chuo.yamanashi.jp":true,"doshi.yamanashi.jp":true,"fuefuki.yamanashi.jp":true,"fujikawa.yamanashi.jp":true,"fujikawaguchiko.yamanashi.jp":true,"fujiyoshida.yamanashi.jp":true,"hayakawa.yamanashi.jp":true,"hokuto.yamanashi.jp":true,"ichikawamisato.yamanashi.jp":true,"kai.yamanashi.jp":true,"kofu.yamanashi.jp":true,"koshu.yamanashi.jp":true,"kosuge.yamanashi.jp":true,"minami-alps.yamanashi.jp":true,"minobu.yamanashi.jp":true,"nakamichi.yamanashi.jp":true,"nanbu.yamanashi.jp":true,"narusawa.yamanashi.jp":true,"nirasaki.yamanashi.jp":true,"nishikatsura.yamanashi.jp":true,"oshino.yamanashi.jp":true,"otsuki.yamanashi.jp":true,"showa.yamanashi.jp":true,"tabayama.yamanashi.jp":true,"tsuru.yamanashi.jp":true,"uenohara.yamanashi.jp":true,"yamanakako.yamanashi.jp":true,"yamanashi.yamanashi.jp":true,"*.ke":true,"kg":true,"org.kg":true,"net.kg":true,"com.kg":true,"edu.kg":true,"gov.kg":true,"mil.kg":true,"*.kh":true,"ki":true,"edu.ki":true,"biz.ki":true,"net.ki":true,"org.ki":true,"gov.ki":true,"info.ki":true,"com.ki":true,"km":true,"org.km":true,"nom.km":true,"gov.km":true,"prd.km":true,"tm.km":true,"edu.km":true,"mil.km":true,"ass.km":true,"com.km":true,"coop.km":true,"asso.km":true,"presse.km":true,"medecin.km":true,"notaires.km":true,"pharmaciens.km":true,"veterinaire.km":true,"gouv.km":true,"kn":true,"net.kn":true,"org.kn":true,"edu.kn":true,"gov.kn":true,"kp":true,"com.kp":true,"edu.kp":true,"gov.kp":true,"org.kp":true,"rep.kp":true,"tra.kp":true,"kr":true,"ac.kr":true,"co.kr":true,"es.kr":true,"go.kr":true,"hs.kr":true,"kg.kr":true,"mil.kr":true,"ms.kr":true,"ne.kr":true,"or.kr":true,"pe.kr":true,"re.kr":true,"sc.kr":true,"busan.kr":true,"chungbuk.kr":true,"chungnam.kr":true,"daegu.kr":true,"daejeon.kr":true,"gangwon.kr":true,"gwangju.kr":true,"gyeongbuk.kr":true,"gyeonggi.kr":true,"gyeongnam.kr":true,"incheon.kr":true,"jeju.kr":true,"jeonbuk.kr":true,"jeonnam.kr":true,"seoul.kr":true,"ulsan.kr":true,"*.kw":true,"ky":true,"edu.ky":true,"gov.ky":true,"com.ky":true,"org.ky":true,"net.ky":true,"kz":true,"org.kz":true,"edu.kz":true,"net.kz":true,"gov.kz":true,"mil.kz":true,"com.kz":true,"la":true,"int.la":true,"net.la":true,"info.la":true,"edu.la":true,"gov.la":true,"per.la":true,"com.la":true,"org.la":true,"lb":true,"com.lb":true,"edu.lb":true,"gov.lb":true,"net.lb":true,"org.lb":true,"lc":true,"com.lc":true,"net.lc":true,"co.lc":true,"org.lc":true,"edu.lc":true,"gov.lc":true,"li":true,"lk":true,"gov.lk":true,"sch.lk":true,"net.lk":true,"int.lk":true,"com.lk":true,"org.lk":true,"edu.lk":true,"ngo.lk":true,"soc.lk":true,"web.lk":true,"ltd.lk":true,"assn.lk":true,"grp.lk":true,"hotel.lk":true,"lr":true,"com.lr":true,"edu.lr":true,"gov.lr":true,"org.lr":true,"net.lr":true,"ls":true,"co.ls":true,"org.ls":true,"lt":true,"gov.lt":true,"lu":true,"lv":true,"com.lv":true,"edu.lv":true,"gov.lv":true,"org.lv":true,"mil.lv":true,"id.lv":true,"net.lv":true,"asn.lv":true,"conf.lv":true,"ly":true,"com.ly":true,"net.ly":true,"gov.ly":true,"plc.ly":true,"edu.ly":true,"sch.ly":true,"med.ly":true,"org.ly":true,"id.ly":true,"ma":true,"co.ma":true,"net.ma":true,"gov.ma":true,"org.ma":true,"ac.ma":true,"press.ma":true,"mc":true,"tm.mc":true,"asso.mc":true,"md":true,"me":true,"co.me":true,"net.me":true,"org.me":true,"edu.me":true,"ac.me":true,"gov.me":true,"its.me":true,"priv.me":true,"mg":true,"org.mg":true,"nom.mg":true,"gov.mg":true,"prd.mg":true,"tm.mg":true,"edu.mg":true,"mil.mg":true,"com.mg":true,"mh":true,"mil":true,"mk":true,"com.mk":true,"org.mk":true,"net.mk":true,"edu.mk":true,"gov.mk":true,"inf.mk":true,"name.mk":true,"ml":true,"com.ml":true,"edu.ml":true,"gouv.ml":true,"gov.ml":true,"net.ml":true,"org.ml":true,"presse.ml":true,"*.mm":true,"mn":true,"gov.mn":true,"edu.mn":true,"org.mn":true,"mo":true,"com.mo":true,"net.mo":true,"org.mo":true,"edu.mo":true,"gov.mo":true,"mobi":true,"mp":true,"mq":true,"mr":true,"gov.mr":true,"ms":true,"com.ms":true,"edu.ms":true,"gov.ms":true,"net.ms":true,"org.ms":true,"mt":true,"com.mt":true,"edu.mt":true,"net.mt":true,"org.mt":true,"mu":true,"com.mu":true,"net.mu":true,"org.mu":true,"gov.mu":true,"ac.mu":true,"co.mu":true,"or.mu":true,"museum":true,"academy.museum":true,"agriculture.museum":true,"air.museum":true,"airguard.museum":true,"alabama.museum":true,"alaska.museum":true,"amber.museum":true,"ambulance.museum":true,"american.museum":true,"americana.museum":true,"americanantiques.museum":true,"americanart.museum":true,"amsterdam.museum":true,"and.museum":true,"annefrank.museum":true,"anthro.museum":true,"anthropology.museum":true,"antiques.museum":true,"aquarium.museum":true,"arboretum.museum":true,"archaeological.museum":true,"archaeology.museum":true,"architecture.museum":true,"art.museum":true,"artanddesign.museum":true,"artcenter.museum":true,"artdeco.museum":true,"arteducation.museum":true,"artgallery.museum":true,"arts.museum":true,"artsandcrafts.museum":true,"asmatart.museum":true,"assassination.museum":true,"assisi.museum":true,"association.museum":true,"astronomy.museum":true,"atlanta.museum":true,"austin.museum":true,"australia.museum":true,"automotive.museum":true,"aviation.museum":true,"axis.museum":true,"badajoz.museum":true,"baghdad.museum":true,"bahn.museum":true,"bale.museum":true,"baltimore.museum":true,"barcelona.museum":true,"baseball.museum":true,"basel.museum":true,"baths.museum":true,"bauern.museum":true,"beauxarts.museum":true,"beeldengeluid.museum":true,"bellevue.museum":true,"bergbau.museum":true,"berkeley.museum":true,"berlin.museum":true,"bern.museum":true,"bible.museum":true,"bilbao.museum":true,"bill.museum":true,"birdart.museum":true,"birthplace.museum":true,"bonn.museum":true,"boston.museum":true,"botanical.museum":true,"botanicalgarden.museum":true,"botanicgarden.museum":true,"botany.museum":true,"brandywinevalley.museum":true,"brasil.museum":true,"bristol.museum":true,"british.museum":true,"britishcolumbia.museum":true,"broadcast.museum":true,"brunel.museum":true,"brussel.museum":true,"brussels.museum":true,"bruxelles.museum":true,"building.museum":true,"burghof.museum":true,"bus.museum":true,"bushey.museum":true,"cadaques.museum":true,"california.museum":true,"cambridge.museum":true,"can.museum":true,"canada.museum":true,"capebreton.museum":true,"carrier.museum":true,"cartoonart.museum":true,"casadelamoneda.museum":true,"castle.museum":true,"castres.museum":true,"celtic.museum":true,"center.museum":true,"chattanooga.museum":true,"cheltenham.museum":true,"chesapeakebay.museum":true,"chicago.museum":true,"children.museum":true,"childrens.museum":true,"childrensgarden.museum":true,"chiropractic.museum":true,"chocolate.museum":true,"christiansburg.museum":true,"cincinnati.museum":true,"cinema.museum":true,"circus.museum":true,"civilisation.museum":true,"civilization.museum":true,"civilwar.museum":true,"clinton.museum":true,"clock.museum":true,"coal.museum":true,"coastaldefence.museum":true,"cody.museum":true,"coldwar.museum":true,"collection.museum":true,"colonialwilliamsburg.museum":true,"coloradoplateau.museum":true,"columbia.museum":true,"columbus.museum":true,"communication.museum":true,"communications.museum":true,"community.museum":true,"computer.museum":true,"computerhistory.museum":true,"xn--comunicaes-v6a2o.museum":true,"contemporary.museum":true,"contemporaryart.museum":true,"convent.museum":true,"copenhagen.museum":true,"corporation.museum":true,"xn--correios-e-telecomunicaes-ghc29a.museum":true,"corvette.museum":true,"costume.museum":true,"countryestate.museum":true,"county.museum":true,"crafts.museum":true,"cranbrook.museum":true,"creation.museum":true,"cultural.museum":true,"culturalcenter.museum":true,"culture.museum":true,"cyber.museum":true,"cymru.museum":true,"dali.museum":true,"dallas.museum":true,"database.museum":true,"ddr.museum":true,"decorativearts.museum":true,"delaware.museum":true,"delmenhorst.museum":true,"denmark.museum":true,"depot.museum":true,"design.museum":true,"detroit.museum":true,"dinosaur.museum":true,"discovery.museum":true,"dolls.museum":true,"donostia.museum":true,"durham.museum":true,"eastafrica.museum":true,"eastcoast.museum":true,"education.museum":true,"educational.museum":true,"egyptian.museum":true,"eisenbahn.museum":true,"elburg.museum":true,"elvendrell.museum":true,"embroidery.museum":true,"encyclopedic.museum":true,"england.museum":true,"entomology.museum":true,"environment.museum":true,"environmentalconservation.museum":true,"epilepsy.museum":true,"essex.museum":true,"estate.museum":true,"ethnology.museum":true,"exeter.museum":true,"exhibition.museum":true,"family.museum":true,"farm.museum":true,"farmequipment.museum":true,"farmers.museum":true,"farmstead.museum":true,"field.museum":true,"figueres.museum":true,"filatelia.museum":true,"film.museum":true,"fineart.museum":true,"finearts.museum":true,"finland.museum":true,"flanders.museum":true,"florida.museum":true,"force.museum":true,"fortmissoula.museum":true,"fortworth.museum":true,"foundation.museum":true,"francaise.museum":true,"frankfurt.museum":true,"franziskaner.museum":true,"freemasonry.museum":true,"freiburg.museum":true,"fribourg.museum":true,"frog.museum":true,"fundacio.museum":true,"furniture.museum":true,"gallery.museum":true,"garden.museum":true,"gateway.museum":true,"geelvinck.museum":true,"gemological.museum":true,"geology.museum":true,"georgia.museum":true,"giessen.museum":true,"glas.museum":true,"glass.museum":true,"gorge.museum":true,"grandrapids.museum":true,"graz.museum":true,"guernsey.museum":true,"halloffame.museum":true,"hamburg.museum":true,"handson.museum":true,"harvestcelebration.museum":true,"hawaii.museum":true,"health.museum":true,"heimatunduhren.museum":true,"hellas.museum":true,"helsinki.museum":true,"hembygdsforbund.museum":true,"heritage.museum":true,"histoire.museum":true,"historical.museum":true,"historicalsociety.museum":true,"historichouses.museum":true,"historisch.museum":true,"historisches.museum":true,"history.museum":true,"historyofscience.museum":true,"horology.museum":true,"house.museum":true,"humanities.museum":true,"illustration.museum":true,"imageandsound.museum":true,"indian.museum":true,"indiana.museum":true,"indianapolis.museum":true,"indianmarket.museum":true,"intelligence.museum":true,"interactive.museum":true,"iraq.museum":true,"iron.museum":true,"isleofman.museum":true,"jamison.museum":true,"jefferson.museum":true,"jerusalem.museum":true,"jewelry.museum":true,"jewish.museum":true,"jewishart.museum":true,"jfk.museum":true,"journalism.museum":true,"judaica.museum":true,"judygarland.museum":true,"juedisches.museum":true,"juif.museum":true,"karate.museum":true,"karikatur.museum":true,"kids.museum":true,"koebenhavn.museum":true,"koeln.museum":true,"kunst.museum":true,"kunstsammlung.museum":true,"kunstunddesign.museum":true,"labor.museum":true,"labour.museum":true,"lajolla.museum":true,"lancashire.museum":true,"landes.museum":true,"lans.museum":true,"xn--lns-qla.museum":true,"larsson.museum":true,"lewismiller.museum":true,"lincoln.museum":true,"linz.museum":true,"living.museum":true,"livinghistory.museum":true,"localhistory.museum":true,"london.museum":true,"losangeles.museum":true,"louvre.museum":true,"loyalist.museum":true,"lucerne.museum":true,"luxembourg.museum":true,"luzern.museum":true,"mad.museum":true,"madrid.museum":true,"mallorca.museum":true,"manchester.museum":true,"mansion.museum":true,"mansions.museum":true,"manx.museum":true,"marburg.museum":true,"maritime.museum":true,"maritimo.museum":true,"maryland.museum":true,"marylhurst.museum":true,"media.museum":true,"medical.museum":true,"medizinhistorisches.museum":true,"meeres.museum":true,"memorial.museum":true,"mesaverde.museum":true,"michigan.museum":true,"midatlantic.museum":true,"military.museum":true,"mill.museum":true,"miners.museum":true,"mining.museum":true,"minnesota.museum":true,"missile.museum":true,"missoula.museum":true,"modern.museum":true,"moma.museum":true,"money.museum":true,"monmouth.museum":true,"monticello.museum":true,"montreal.museum":true,"moscow.museum":true,"motorcycle.museum":true,"muenchen.museum":true,"muenster.museum":true,"mulhouse.museum":true,"muncie.museum":true,"museet.museum":true,"museumcenter.museum":true,"museumvereniging.museum":true,"music.museum":true,"national.museum":true,"nationalfirearms.museum":true,"nationalheritage.museum":true,"nativeamerican.museum":true,"naturalhistory.museum":true,"naturalhistorymuseum.museum":true,"naturalsciences.museum":true,"nature.museum":true,"naturhistorisches.museum":true,"natuurwetenschappen.museum":true,"naumburg.museum":true,"naval.museum":true,"nebraska.museum":true,"neues.museum":true,"newhampshire.museum":true,"newjersey.museum":true,"newmexico.museum":true,"newport.museum":true,"newspaper.museum":true,"newyork.museum":true,"niepce.museum":true,"norfolk.museum":true,"north.museum":true,"nrw.museum":true,"nuernberg.museum":true,"nuremberg.museum":true,"nyc.museum":true,"nyny.museum":true,"oceanographic.museum":true,"oceanographique.museum":true,"omaha.museum":true,"online.museum":true,"ontario.museum":true,"openair.museum":true,"oregon.museum":true,"oregontrail.museum":true,"otago.museum":true,"oxford.museum":true,"pacific.museum":true,"paderborn.museum":true,"palace.museum":true,"paleo.museum":true,"palmsprings.museum":true,"panama.museum":true,"paris.museum":true,"pasadena.museum":true,"pharmacy.museum":true,"philadelphia.museum":true,"philadelphiaarea.museum":true,"philately.museum":true,"phoenix.museum":true,"photography.museum":true,"pilots.museum":true,"pittsburgh.museum":true,"planetarium.museum":true,"plantation.museum":true,"plants.museum":true,"plaza.museum":true,"portal.museum":true,"portland.museum":true,"portlligat.museum":true,"posts-and-telecommunications.museum":true,"preservation.museum":true,"presidio.museum":true,"press.museum":true,"project.museum":true,"public.museum":true,"pubol.museum":true,"quebec.museum":true,"railroad.museum":true,"railway.museum":true,"research.museum":true,"resistance.museum":true,"riodejaneiro.museum":true,"rochester.museum":true,"rockart.museum":true,"roma.museum":true,"russia.museum":true,"saintlouis.museum":true,"salem.museum":true,"salvadordali.museum":true,"salzburg.museum":true,"sandiego.museum":true,"sanfrancisco.museum":true,"santabarbara.museum":true,"santacruz.museum":true,"santafe.museum":true,"saskatchewan.museum":true,"satx.museum":true,"savannahga.museum":true,"schlesisches.museum":true,"schoenbrunn.museum":true,"schokoladen.museum":true,"school.museum":true,"schweiz.museum":true,"science.museum":true,"scienceandhistory.museum":true,"scienceandindustry.museum":true,"sciencecenter.museum":true,"sciencecenters.museum":true,"science-fiction.museum":true,"sciencehistory.museum":true,"sciences.museum":true,"sciencesnaturelles.museum":true,"scotland.museum":true,"seaport.museum":true,"settlement.museum":true,"settlers.museum":true,"shell.museum":true,"sherbrooke.museum":true,"sibenik.museum":true,"silk.museum":true,"ski.museum":true,"skole.museum":true,"society.museum":true,"sologne.museum":true,"soundandvision.museum":true,"southcarolina.museum":true,"southwest.museum":true,"space.museum":true,"spy.museum":true,"square.museum":true,"stadt.museum":true,"stalbans.museum":true,"starnberg.museum":true,"state.museum":true,"stateofdelaware.museum":true,"station.museum":true,"steam.museum":true,"steiermark.museum":true,"stjohn.museum":true,"stockholm.museum":true,"stpetersburg.museum":true,"stuttgart.museum":true,"suisse.museum":true,"surgeonshall.museum":true,"surrey.museum":true,"svizzera.museum":true,"sweden.museum":true,"sydney.museum":true,"tank.museum":true,"tcm.museum":true,"technology.museum":true,"telekommunikation.museum":true,"television.museum":true,"texas.museum":true,"textile.museum":true,"theater.museum":true,"time.museum":true,"timekeeping.museum":true,"topology.museum":true,"torino.museum":true,"touch.museum":true,"town.museum":true,"transport.museum":true,"tree.museum":true,"trolley.museum":true,"trust.museum":true,"trustee.museum":true,"uhren.museum":true,"ulm.museum":true,"undersea.museum":true,"university.museum":true,"usa.museum":true,"usantiques.museum":true,"usarts.museum":true,"uscountryestate.museum":true,"usculture.museum":true,"usdecorativearts.museum":true,"usgarden.museum":true,"ushistory.museum":true,"ushuaia.museum":true,"uslivinghistory.museum":true,"utah.museum":true,"uvic.museum":true,"valley.museum":true,"vantaa.museum":true,"versailles.museum":true,"viking.museum":true,"village.museum":true,"virginia.museum":true,"virtual.museum":true,"virtuel.museum":true,"vlaanderen.museum":true,"volkenkunde.museum":true,"wales.museum":true,"wallonie.museum":true,"war.museum":true,"washingtondc.museum":true,"watchandclock.museum":true,"watch-and-clock.museum":true,"western.museum":true,"westfalen.museum":true,"whaling.museum":true,"wildlife.museum":true,"williamsburg.museum":true,"windmill.museum":true,"workshop.museum":true,"york.museum":true,"yorkshire.museum":true,"yosemite.museum":true,"youth.museum":true,"zoological.museum":true,"zoology.museum":true,"xn--9dbhblg6di.museum":true,"xn--h1aegh.museum":true,"mv":true,"aero.mv":true,"biz.mv":true,"com.mv":true,"coop.mv":true,"edu.mv":true,"gov.mv":true,"info.mv":true,"int.mv":true,"mil.mv":true,"museum.mv":true,"name.mv":true,"net.mv":true,"org.mv":true,"pro.mv":true,"mw":true,"ac.mw":true,"biz.mw":true,"co.mw":true,"com.mw":true,"coop.mw":true,"edu.mw":true,"gov.mw":true,"int.mw":true,"museum.mw":true,"net.mw":true,"org.mw":true,"mx":true,"com.mx":true,"org.mx":true,"gob.mx":true,"edu.mx":true,"net.mx":true,"my":true,"com.my":true,"net.my":true,"org.my":true,"gov.my":true,"edu.my":true,"mil.my":true,"name.my":true,"*.mz":true,"teledata.mz":false,"na":true,"info.na":true,"pro.na":true,"name.na":true,"school.na":true,"or.na":true,"dr.na":true,"us.na":true,"mx.na":true,"ca.na":true,"in.na":true,"cc.na":true,"tv.na":true,"ws.na":true,"mobi.na":true,"co.na":true,"com.na":true,"org.na":true,"name":true,"nc":true,"asso.nc":true,"ne":true,"net":true,"nf":true,"com.nf":true,"net.nf":true,"per.nf":true,"rec.nf":true,"web.nf":true,"arts.nf":true,"firm.nf":true,"info.nf":true,"other.nf":true,"store.nf":true,"ng":true,"com.ng":true,"edu.ng":true,"name.ng":true,"net.ng":true,"org.ng":true,"sch.ng":true,"gov.ng":true,"mil.ng":true,"mobi.ng":true,"*.ni":true,"nl":true,"bv.nl":true,"no":true,"fhs.no":true,"vgs.no":true,"fylkesbibl.no":true,"folkebibl.no":true,"museum.no":true,"idrett.no":true,"priv.no":true,"mil.no":true,"stat.no":true,"dep.no":true,"kommune.no":true,"herad.no":true,"aa.no":true,"ah.no":true,"bu.no":true,"fm.no":true,"hl.no":true,"hm.no":true,"jan-mayen.no":true,"mr.no":true,"nl.no":true,"nt.no":true,"of.no":true,"ol.no":true,"oslo.no":true,"rl.no":true,"sf.no":true,"st.no":true,"svalbard.no":true,"tm.no":true,"tr.no":true,"va.no":true,"vf.no":true,"gs.aa.no":true,"gs.ah.no":true,"gs.bu.no":true,"gs.fm.no":true,"gs.hl.no":true,"gs.hm.no":true,"gs.jan-mayen.no":true,"gs.mr.no":true,"gs.nl.no":true,"gs.nt.no":true,"gs.of.no":true,"gs.ol.no":true,"gs.oslo.no":true,"gs.rl.no":true,"gs.sf.no":true,"gs.st.no":true,"gs.svalbard.no":true,"gs.tm.no":true,"gs.tr.no":true,"gs.va.no":true,"gs.vf.no":true,"akrehamn.no":true,"xn--krehamn-dxa.no":true,"algard.no":true,"xn--lgrd-poac.no":true,"arna.no":true,"brumunddal.no":true,"bryne.no":true,"bronnoysund.no":true,"xn--brnnysund-m8ac.no":true,"drobak.no":true,"xn--drbak-wua.no":true,"egersund.no":true,"fetsund.no":true,"floro.no":true,"xn--flor-jra.no":true,"fredrikstad.no":true,"hokksund.no":true,"honefoss.no":true,"xn--hnefoss-q1a.no":true,"jessheim.no":true,"jorpeland.no":true,"xn--jrpeland-54a.no":true,"kirkenes.no":true,"kopervik.no":true,"krokstadelva.no":true,"langevag.no":true,"xn--langevg-jxa.no":true,"leirvik.no":true,"mjondalen.no":true,"xn--mjndalen-64a.no":true,"mo-i-rana.no":true,"mosjoen.no":true,"xn--mosjen-eya.no":true,"nesoddtangen.no":true,"orkanger.no":true,"osoyro.no":true,"xn--osyro-wua.no":true,"raholt.no":true,"xn--rholt-mra.no":true,"sandnessjoen.no":true,"xn--sandnessjen-ogb.no":true,"skedsmokorset.no":true,"slattum.no":true,"spjelkavik.no":true,"stathelle.no":true,"stavern.no":true,"stjordalshalsen.no":true,"xn--stjrdalshalsen-sqb.no":true,"tananger.no":true,"tranby.no":true,"vossevangen.no":true,"afjord.no":true,"xn--fjord-lra.no":true,"agdenes.no":true,"al.no":true,"xn--l-1fa.no":true,"alesund.no":true,"xn--lesund-hua.no":true,"alstahaug.no":true,"alta.no":true,"xn--lt-liac.no":true,"alaheadju.no":true,"xn--laheadju-7ya.no":true,"alvdal.no":true,"amli.no":true,"xn--mli-tla.no":true,"amot.no":true,"xn--mot-tla.no":true,"andebu.no":true,"andoy.no":true,"xn--andy-ira.no":true,"andasuolo.no":true,"ardal.no":true,"xn--rdal-poa.no":true,"aremark.no":true,"arendal.no":true,"xn--s-1fa.no":true,"aseral.no":true,"xn--seral-lra.no":true,"asker.no":true,"askim.no":true,"askvoll.no":true,"askoy.no":true,"xn--asky-ira.no":true,"asnes.no":true,"xn--snes-poa.no":true,"audnedaln.no":true,"aukra.no":true,"aure.no":true,"aurland.no":true,"aurskog-holand.no":true,"xn--aurskog-hland-jnb.no":true,"austevoll.no":true,"austrheim.no":true,"averoy.no":true,"xn--avery-yua.no":true,"balestrand.no":true,"ballangen.no":true,"balat.no":true,"xn--blt-elab.no":true,"balsfjord.no":true,"bahccavuotna.no":true,"xn--bhccavuotna-k7a.no":true,"bamble.no":true,"bardu.no":true,"beardu.no":true,"beiarn.no":true,"bajddar.no":true,"xn--bjddar-pta.no":true,"baidar.no":true,"xn--bidr-5nac.no":true,"berg.no":true,"bergen.no":true,"berlevag.no":true,"xn--berlevg-jxa.no":true,"bearalvahki.no":true,"xn--bearalvhki-y4a.no":true,"bindal.no":true,"birkenes.no":true,"bjarkoy.no":true,"xn--bjarky-fya.no":true,"bjerkreim.no":true,"bjugn.no":true,"bodo.no":true,"xn--bod-2na.no":true,"badaddja.no":true,"xn--bdddj-mrabd.no":true,"budejju.no":true,"bokn.no":true,"bremanger.no":true,"bronnoy.no":true,"xn--brnny-wuac.no":true,"bygland.no":true,"bykle.no":true,"barum.no":true,"xn--brum-voa.no":true,"bo.telemark.no":true,"xn--b-5ga.telemark.no":true,"bo.nordland.no":true,"xn--b-5ga.nordland.no":true,"bievat.no":true,"xn--bievt-0qa.no":true,"bomlo.no":true,"xn--bmlo-gra.no":true,"batsfjord.no":true,"xn--btsfjord-9za.no":true,"bahcavuotna.no":true,"xn--bhcavuotna-s4a.no":true,"dovre.no":true,"drammen.no":true,"drangedal.no":true,"dyroy.no":true,"xn--dyry-ira.no":true,"donna.no":true,"xn--dnna-gra.no":true,"eid.no":true,"eidfjord.no":true,"eidsberg.no":true,"eidskog.no":true,"eidsvoll.no":true,"eigersund.no":true,"elverum.no":true,"enebakk.no":true,"engerdal.no":true,"etne.no":true,"etnedal.no":true,"evenes.no":true,"evenassi.no":true,"xn--eveni-0qa01ga.no":true,"evje-og-hornnes.no":true,"farsund.no":true,"fauske.no":true,"fuossko.no":true,"fuoisku.no":true,"fedje.no":true,"fet.no":true,"finnoy.no":true,"xn--finny-yua.no":true,"fitjar.no":true,"fjaler.no":true,"fjell.no":true,"flakstad.no":true,"flatanger.no":true,"flekkefjord.no":true,"flesberg.no":true,"flora.no":true,"fla.no":true,"xn--fl-zia.no":true,"folldal.no":true,"forsand.no":true,"fosnes.no":true,"frei.no":true,"frogn.no":true,"froland.no":true,"frosta.no":true,"frana.no":true,"xn--frna-woa.no":true,"froya.no":true,"xn--frya-hra.no":true,"fusa.no":true,"fyresdal.no":true,"forde.no":true,"xn--frde-gra.no":true,"gamvik.no":true,"gangaviika.no":true,"xn--ggaviika-8ya47h.no":true,"gaular.no":true,"gausdal.no":true,"gildeskal.no":true,"xn--gildeskl-g0a.no":true,"giske.no":true,"gjemnes.no":true,"gjerdrum.no":true,"gjerstad.no":true,"gjesdal.no":true,"gjovik.no":true,"xn--gjvik-wua.no":true,"gloppen.no":true,"gol.no":true,"gran.no":true,"grane.no":true,"granvin.no":true,"gratangen.no":true,"grimstad.no":true,"grong.no":true,"kraanghke.no":true,"xn--kranghke-b0a.no":true,"grue.no":true,"gulen.no":true,"hadsel.no":true,"halden.no":true,"halsa.no":true,"hamar.no":true,"hamaroy.no":true,"habmer.no":true,"xn--hbmer-xqa.no":true,"hapmir.no":true,"xn--hpmir-xqa.no":true,"hammerfest.no":true,"hammarfeasta.no":true,"xn--hmmrfeasta-s4ac.no":true,"haram.no":true,"hareid.no":true,"harstad.no":true,"hasvik.no":true,"aknoluokta.no":true,"xn--koluokta-7ya57h.no":true,"hattfjelldal.no":true,"aarborte.no":true,"haugesund.no":true,"hemne.no":true,"hemnes.no":true,"hemsedal.no":true,"heroy.more-og-romsdal.no":true,"xn--hery-ira.xn--mre-og-romsdal-qqb.no":true,"heroy.nordland.no":true,"xn--hery-ira.nordland.no":true,"hitra.no":true,"hjartdal.no":true,"hjelmeland.no":true,"hobol.no":true,"xn--hobl-ira.no":true,"hof.no":true,"hol.no":true,"hole.no":true,"holmestrand.no":true,"holtalen.no":true,"xn--holtlen-hxa.no":true,"hornindal.no":true,"horten.no":true,"hurdal.no":true,"hurum.no":true,"hvaler.no":true,"hyllestad.no":true,"hagebostad.no":true,"xn--hgebostad-g3a.no":true,"hoyanger.no":true,"xn--hyanger-q1a.no":true,"hoylandet.no":true,"xn--hylandet-54a.no":true,"ha.no":true,"xn--h-2fa.no":true,"ibestad.no":true,"inderoy.no":true,"xn--indery-fya.no":true,"iveland.no":true,"jevnaker.no":true,"jondal.no":true,"jolster.no":true,"xn--jlster-bya.no":true,"karasjok.no":true,"karasjohka.no":true,"xn--krjohka-hwab49j.no":true,"karlsoy.no":true,"galsa.no":true,"xn--gls-elac.no":true,"karmoy.no":true,"xn--karmy-yua.no":true,"kautokeino.no":true,"guovdageaidnu.no":true,"klepp.no":true,"klabu.no":true,"xn--klbu-woa.no":true,"kongsberg.no":true,"kongsvinger.no":true,"kragero.no":true,"xn--krager-gya.no":true,"kristiansand.no":true,"kristiansund.no":true,"krodsherad.no":true,"xn--krdsherad-m8a.no":true,"kvalsund.no":true,"rahkkeravju.no":true,"xn--rhkkervju-01af.no":true,"kvam.no":true,"kvinesdal.no":true,"kvinnherad.no":true,"kviteseid.no":true,"kvitsoy.no":true,"xn--kvitsy-fya.no":true,"kvafjord.no":true,"xn--kvfjord-nxa.no":true,"giehtavuoatna.no":true,"kvanangen.no":true,"xn--kvnangen-k0a.no":true,"navuotna.no":true,"xn--nvuotna-hwa.no":true,"kafjord.no":true,"xn--kfjord-iua.no":true,"gaivuotna.no":true,"xn--givuotna-8ya.no":true,"larvik.no":true,"lavangen.no":true,"lavagis.no":true,"loabat.no":true,"xn--loabt-0qa.no":true,"lebesby.no":true,"davvesiida.no":true,"leikanger.no":true,"leirfjord.no":true,"leka.no":true,"leksvik.no":true,"lenvik.no":true,"leangaviika.no":true,"xn--leagaviika-52b.no":true,"lesja.no":true,"levanger.no":true,"lier.no":true,"lierne.no":true,"lillehammer.no":true,"lillesand.no":true,"lindesnes.no":true,"lindas.no":true,"xn--linds-pra.no":true,"lom.no":true,"loppa.no":true,"lahppi.no":true,"xn--lhppi-xqa.no":true,"lund.no":true,"lunner.no":true,"luroy.no":true,"xn--lury-ira.no":true,"luster.no":true,"lyngdal.no":true,"lyngen.no":true,"ivgu.no":true,"lardal.no":true,"lerdal.no":true,"xn--lrdal-sra.no":true,"lodingen.no":true,"xn--ldingen-q1a.no":true,"lorenskog.no":true,"xn--lrenskog-54a.no":true,"loten.no":true,"xn--lten-gra.no":true,"malvik.no":true,"masoy.no":true,"xn--msy-ula0h.no":true,"muosat.no":true,"xn--muost-0qa.no":true,"mandal.no":true,"marker.no":true,"marnardal.no":true,"masfjorden.no":true,"meland.no":true,"meldal.no":true,"melhus.no":true,"meloy.no":true,"xn--mely-ira.no":true,"meraker.no":true,"xn--merker-kua.no":true,"moareke.no":true,"xn--moreke-jua.no":true,"midsund.no":true,"midtre-gauldal.no":true,"modalen.no":true,"modum.no":true,"molde.no":true,"moskenes.no":true,"moss.no":true,"mosvik.no":true,"malselv.no":true,"xn--mlselv-iua.no":true,"malatvuopmi.no":true,"xn--mlatvuopmi-s4a.no":true,"namdalseid.no":true,"aejrie.no":true,"namsos.no":true,"namsskogan.no":true,"naamesjevuemie.no":true,"xn--nmesjevuemie-tcba.no":true,"laakesvuemie.no":true,"nannestad.no":true,"narvik.no":true,"narviika.no":true,"naustdal.no":true,"nedre-eiker.no":true,"nes.akershus.no":true,"nes.buskerud.no":true,"nesna.no":true,"nesodden.no":true,"nesseby.no":true,"unjarga.no":true,"xn--unjrga-rta.no":true,"nesset.no":true,"nissedal.no":true,"nittedal.no":true,"nord-aurdal.no":true,"nord-fron.no":true,"nord-odal.no":true,"norddal.no":true,"nordkapp.no":true,"davvenjarga.no":true,"xn--davvenjrga-y4a.no":true,"nordre-land.no":true,"nordreisa.no":true,"raisa.no":true,"xn--risa-5na.no":true,"nore-og-uvdal.no":true,"notodden.no":true,"naroy.no":true,"xn--nry-yla5g.no":true,"notteroy.no":true,"xn--nttery-byae.no":true,"odda.no":true,"oksnes.no":true,"xn--ksnes-uua.no":true,"oppdal.no":true,"oppegard.no":true,"xn--oppegrd-ixa.no":true,"orkdal.no":true,"orland.no":true,"xn--rland-uua.no":true,"orskog.no":true,"xn--rskog-uua.no":true,"orsta.no":true,"xn--rsta-fra.no":true,"os.hedmark.no":true,"os.hordaland.no":true,"osen.no":true,"osteroy.no":true,"xn--ostery-fya.no":true,"ostre-toten.no":true,"xn--stre-toten-zcb.no":true,"overhalla.no":true,"ovre-eiker.no":true,"xn--vre-eiker-k8a.no":true,"oyer.no":true,"xn--yer-zna.no":true,"oygarden.no":true,"xn--ygarden-p1a.no":true,"oystre-slidre.no":true,"xn--ystre-slidre-ujb.no":true,"porsanger.no":true,"porsangu.no":true,"xn--porsgu-sta26f.no":true,"porsgrunn.no":true,"radoy.no":true,"xn--rady-ira.no":true,"rakkestad.no":true,"rana.no":true,"ruovat.no":true,"randaberg.no":true,"rauma.no":true,"rendalen.no":true,"rennebu.no":true,"rennesoy.no":true,"xn--rennesy-v1a.no":true,"rindal.no":true,"ringebu.no":true,"ringerike.no":true,"ringsaker.no":true,"rissa.no":true,"risor.no":true,"xn--risr-ira.no":true,"roan.no":true,"rollag.no":true,"rygge.no":true,"ralingen.no":true,"xn--rlingen-mxa.no":true,"rodoy.no":true,"xn--rdy-0nab.no":true,"romskog.no":true,"xn--rmskog-bya.no":true,"roros.no":true,"xn--rros-gra.no":true,"rost.no":true,"xn--rst-0na.no":true,"royken.no":true,"xn--ryken-vua.no":true,"royrvik.no":true,"xn--ryrvik-bya.no":true,"rade.no":true,"xn--rde-ula.no":true,"salangen.no":true,"siellak.no":true,"saltdal.no":true,"salat.no":true,"xn--slt-elab.no":true,"xn--slat-5na.no":true,"samnanger.no":true,"sande.more-og-romsdal.no":true,"sande.xn--mre-og-romsdal-qqb.no":true,"sande.vestfold.no":true,"sandefjord.no":true,"sandnes.no":true,"sandoy.no":true,"xn--sandy-yua.no":true,"sarpsborg.no":true,"sauda.no":true,"sauherad.no":true,"sel.no":true,"selbu.no":true,"selje.no":true,"seljord.no":true,"sigdal.no":true,"siljan.no":true,"sirdal.no":true,"skaun.no":true,"skedsmo.no":true,"ski.no":true,"skien.no":true,"skiptvet.no":true,"skjervoy.no":true,"xn--skjervy-v1a.no":true,"skierva.no":true,"xn--skierv-uta.no":true,"skjak.no":true,"xn--skjk-soa.no":true,"skodje.no":true,"skanland.no":true,"xn--sknland-fxa.no":true,"skanit.no":true,"xn--sknit-yqa.no":true,"smola.no":true,"xn--smla-hra.no":true,"snillfjord.no":true,"snasa.no":true,"xn--snsa-roa.no":true,"snoasa.no":true,"snaase.no":true,"xn--snase-nra.no":true,"sogndal.no":true,"sokndal.no":true,"sola.no":true,"solund.no":true,"songdalen.no":true,"sortland.no":true,"spydeberg.no":true,"stange.no":true,"stavanger.no":true,"steigen.no":true,"steinkjer.no":true,"stjordal.no":true,"xn--stjrdal-s1a.no":true,"stokke.no":true,"stor-elvdal.no":true,"stord.no":true,"stordal.no":true,"storfjord.no":true,"omasvuotna.no":true,"strand.no":true,"stranda.no":true,"stryn.no":true,"sula.no":true,"suldal.no":true,"sund.no":true,"sunndal.no":true,"surnadal.no":true,"sveio.no":true,"svelvik.no":true,"sykkylven.no":true,"sogne.no":true,"xn--sgne-gra.no":true,"somna.no":true,"xn--smna-gra.no":true,"sondre-land.no":true,"xn--sndre-land-0cb.no":true,"sor-aurdal.no":true,"xn--sr-aurdal-l8a.no":true,"sor-fron.no":true,"xn--sr-fron-q1a.no":true,"sor-odal.no":true,"xn--sr-odal-q1a.no":true,"sor-varanger.no":true,"xn--sr-varanger-ggb.no":true,"matta-varjjat.no":true,"xn--mtta-vrjjat-k7af.no":true,"sorfold.no":true,"xn--srfold-bya.no":true,"sorreisa.no":true,"xn--srreisa-q1a.no":true,"sorum.no":true,"xn--srum-gra.no":true,"tana.no":true,"deatnu.no":true,"time.no":true,"tingvoll.no":true,"tinn.no":true,"tjeldsund.no":true,"dielddanuorri.no":true,"tjome.no":true,"xn--tjme-hra.no":true,"tokke.no":true,"tolga.no":true,"torsken.no":true,"tranoy.no":true,"xn--trany-yua.no":true,"tromso.no":true,"xn--troms-zua.no":true,"tromsa.no":true,"romsa.no":true,"trondheim.no":true,"troandin.no":true,"trysil.no":true,"trana.no":true,"xn--trna-woa.no":true,"trogstad.no":true,"xn--trgstad-r1a.no":true,"tvedestrand.no":true,"tydal.no":true,"tynset.no":true,"tysfjord.no":true,"divtasvuodna.no":true,"divttasvuotna.no":true,"tysnes.no":true,"tysvar.no":true,"xn--tysvr-vra.no":true,"tonsberg.no":true,"xn--tnsberg-q1a.no":true,"ullensaker.no":true,"ullensvang.no":true,"ulvik.no":true,"utsira.no":true,"vadso.no":true,"xn--vads-jra.no":true,"cahcesuolo.no":true,"xn--hcesuolo-7ya35b.no":true,"vaksdal.no":true,"valle.no":true,"vang.no":true,"vanylven.no":true,"vardo.no":true,"xn--vard-jra.no":true,"varggat.no":true,"xn--vrggt-xqad.no":true,"vefsn.no":true,"vaapste.no":true,"vega.no":true,"vegarshei.no":true,"xn--vegrshei-c0a.no":true,"vennesla.no":true,"verdal.no":true,"verran.no":true,"vestby.no":true,"vestnes.no":true,"vestre-slidre.no":true,"vestre-toten.no":true,"vestvagoy.no":true,"xn--vestvgy-ixa6o.no":true,"vevelstad.no":true,"vik.no":true,"vikna.no":true,"vindafjord.no":true,"volda.no":true,"voss.no":true,"varoy.no":true,"xn--vry-yla5g.no":true,"vagan.no":true,"xn--vgan-qoa.no":true,"voagat.no":true,"vagsoy.no":true,"xn--vgsy-qoa0j.no":true,"vaga.no":true,"xn--vg-yiab.no":true,"valer.ostfold.no":true,"xn--vler-qoa.xn--stfold-9xa.no":true,"valer.hedmark.no":true,"xn--vler-qoa.hedmark.no":true,"*.np":true,"nr":true,"biz.nr":true,"info.nr":true,"gov.nr":true,"edu.nr":true,"org.nr":true,"net.nr":true,"com.nr":true,"nu":true,"nz":true,"ac.nz":true,"co.nz":true,"cri.nz":true,"geek.nz":true,"gen.nz":true,"govt.nz":true,"health.nz":true,"iwi.nz":true,"kiwi.nz":true,"maori.nz":true,"mil.nz":true,"xn--mori-qsa.nz":true,"net.nz":true,"org.nz":true,"parliament.nz":true,"school.nz":true,"om":true,"co.om":true,"com.om":true,"edu.om":true,"gov.om":true,"med.om":true,"museum.om":true,"net.om":true,"org.om":true,"pro.om":true,"org":true,"pa":true,"ac.pa":true,"gob.pa":true,"com.pa":true,"org.pa":true,"sld.pa":true,"edu.pa":true,"net.pa":true,"ing.pa":true,"abo.pa":true,"med.pa":true,"nom.pa":true,"pe":true,"edu.pe":true,"gob.pe":true,"nom.pe":true,"mil.pe":true,"org.pe":true,"com.pe":true,"net.pe":true,"pf":true,"com.pf":true,"org.pf":true,"edu.pf":true,"*.pg":true,"ph":true,"com.ph":true,"net.ph":true,"org.ph":true,"gov.ph":true,"edu.ph":true,"ngo.ph":true,"mil.ph":true,"i.ph":true,"pk":true,"com.pk":true,"net.pk":true,"edu.pk":true,"org.pk":true,"fam.pk":true,"biz.pk":true,"web.pk":true,"gov.pk":true,"gob.pk":true,"gok.pk":true,"gon.pk":true,"gop.pk":true,"gos.pk":true,"info.pk":true,"pl":true,"com.pl":true,"net.pl":true,"org.pl":true,"info.pl":true,"waw.pl":true,"gov.pl":true,"aid.pl":true,"agro.pl":true,"atm.pl":true,"auto.pl":true,"biz.pl":true,"edu.pl":true,"gmina.pl":true,"gsm.pl":true,"mail.pl":true,"miasta.pl":true,"media.pl":true,"mil.pl":true,"nieruchomosci.pl":true,"nom.pl":true,"pc.pl":true,"powiat.pl":true,"priv.pl":true,"realestate.pl":true,"rel.pl":true,"sex.pl":true,"shop.pl":true,"sklep.pl":true,"sos.pl":true,"szkola.pl":true,"targi.pl":true,"tm.pl":true,"tourism.pl":true,"travel.pl":true,"turystyka.pl":true,"uw.gov.pl":true,"um.gov.pl":true,"ug.gov.pl":true,"upow.gov.pl":true,"starostwo.gov.pl":true,"so.gov.pl":true,"sr.gov.pl":true,"po.gov.pl":true,"pa.gov.pl":true,"augustow.pl":true,"babia-gora.pl":true,"bedzin.pl":true,"beskidy.pl":true,"bialowieza.pl":true,"bialystok.pl":true,"bielawa.pl":true,"bieszczady.pl":true,"boleslawiec.pl":true,"bydgoszcz.pl":true,"bytom.pl":true,"cieszyn.pl":true,"czeladz.pl":true,"czest.pl":true,"dlugoleka.pl":true,"elblag.pl":true,"elk.pl":true,"glogow.pl":true,"gniezno.pl":true,"gorlice.pl":true,"grajewo.pl":true,"ilawa.pl":true,"jaworzno.pl":true,"jelenia-gora.pl":true,"jgora.pl":true,"kalisz.pl":true,"kazimierz-dolny.pl":true,"karpacz.pl":true,"kartuzy.pl":true,"kaszuby.pl":true,"katowice.pl":true,"kepno.pl":true,"ketrzyn.pl":true,"klodzko.pl":true,"kobierzyce.pl":true,"kolobrzeg.pl":true,"konin.pl":true,"konskowola.pl":true,"kutno.pl":true,"lapy.pl":true,"lebork.pl":true,"legnica.pl":true,"lezajsk.pl":true,"limanowa.pl":true,"lomza.pl":true,"lowicz.pl":true,"lubin.pl":true,"lukow.pl":true,"malbork.pl":true,"malopolska.pl":true,"mazowsze.pl":true,"mazury.pl":true,"mielec.pl":true,"mielno.pl":true,"mragowo.pl":true,"naklo.pl":true,"nowaruda.pl":true,"nysa.pl":true,"olawa.pl":true,"olecko.pl":true,"olkusz.pl":true,"olsztyn.pl":true,"opoczno.pl":true,"opole.pl":true,"ostroda.pl":true,"ostroleka.pl":true,"ostrowiec.pl":true,"ostrowwlkp.pl":true,"pila.pl":true,"pisz.pl":true,"podhale.pl":true,"podlasie.pl":true,"polkowice.pl":true,"pomorze.pl":true,"pomorskie.pl":true,"prochowice.pl":true,"pruszkow.pl":true,"przeworsk.pl":true,"pulawy.pl":true,"radom.pl":true,"rawa-maz.pl":true,"rybnik.pl":true,"rzeszow.pl":true,"sanok.pl":true,"sejny.pl":true,"slask.pl":true,"slupsk.pl":true,"sosnowiec.pl":true,"stalowa-wola.pl":true,"skoczow.pl":true,"starachowice.pl":true,"stargard.pl":true,"suwalki.pl":true,"swidnica.pl":true,"swiebodzin.pl":true,"swinoujscie.pl":true,"szczecin.pl":true,"szczytno.pl":true,"tarnobrzeg.pl":true,"tgory.pl":true,"turek.pl":true,"tychy.pl":true,"ustka.pl":true,"walbrzych.pl":true,"warmia.pl":true,"warszawa.pl":true,"wegrow.pl":true,"wielun.pl":true,"wlocl.pl":true,"wloclawek.pl":true,"wodzislaw.pl":true,"wolomin.pl":true,"wroclaw.pl":true,"zachpomor.pl":true,"zagan.pl":true,"zarow.pl":true,"zgora.pl":true,"zgorzelec.pl":true,"pm":true,"pn":true,"gov.pn":true,"co.pn":true,"org.pn":true,"edu.pn":true,"net.pn":true,"post":true,"pr":true,"com.pr":true,"net.pr":true,"org.pr":true,"gov.pr":true,"edu.pr":true,"isla.pr":true,"pro.pr":true,"biz.pr":true,"info.pr":true,"name.pr":true,"est.pr":true,"prof.pr":true,"ac.pr":true,"pro":true,"aca.pro":true,"bar.pro":true,"cpa.pro":true,"jur.pro":true,"law.pro":true,"med.pro":true,"eng.pro":true,"ps":true,"edu.ps":true,"gov.ps":true,"sec.ps":true,"plo.ps":true,"com.ps":true,"org.ps":true,"net.ps":true,"pt":true,"net.pt":true,"gov.pt":true,"org.pt":true,"edu.pt":true,"int.pt":true,"publ.pt":true,"com.pt":true,"nome.pt":true,"pw":true,"co.pw":true,"ne.pw":true,"or.pw":true,"ed.pw":true,"go.pw":true,"belau.pw":true,"py":true,"com.py":true,"coop.py":true,"edu.py":true,"gov.py":true,"mil.py":true,"net.py":true,"org.py":true,"qa":true,"com.qa":true,"edu.qa":true,"gov.qa":true,"mil.qa":true,"name.qa":true,"net.qa":true,"org.qa":true,"sch.qa":true,"re":true,"com.re":true,"asso.re":true,"nom.re":true,"ro":true,"com.ro":true,"org.ro":true,"tm.ro":true,"nt.ro":true,"nom.ro":true,"info.ro":true,"rec.ro":true,"arts.ro":true,"firm.ro":true,"store.ro":true,"www.ro":true,"rs":true,"co.rs":true,"org.rs":true,"edu.rs":true,"ac.rs":true,"gov.rs":true,"in.rs":true,"ru":true,"ac.ru":true,"com.ru":true,"edu.ru":true,"int.ru":true,"net.ru":true,"org.ru":true,"pp.ru":true,"adygeya.ru":true,"altai.ru":true,"amur.ru":true,"arkhangelsk.ru":true,"astrakhan.ru":true,"bashkiria.ru":true,"belgorod.ru":true,"bir.ru":true,"bryansk.ru":true,"buryatia.ru":true,"cbg.ru":true,"chel.ru":true,"chelyabinsk.ru":true,"chita.ru":true,"chukotka.ru":true,"chuvashia.ru":true,"dagestan.ru":true,"dudinka.ru":true,"e-burg.ru":true,"grozny.ru":true,"irkutsk.ru":true,"ivanovo.ru":true,"izhevsk.ru":true,"jar.ru":true,"joshkar-ola.ru":true,"kalmykia.ru":true,"kaluga.ru":true,"kamchatka.ru":true,"karelia.ru":true,"kazan.ru":true,"kchr.ru":true,"kemerovo.ru":true,"khabarovsk.ru":true,"khakassia.ru":true,"khv.ru":true,"kirov.ru":true,"koenig.ru":true,"komi.ru":true,"kostroma.ru":true,"krasnoyarsk.ru":true,"kuban.ru":true,"kurgan.ru":true,"kursk.ru":true,"lipetsk.ru":true,"magadan.ru":true,"mari.ru":true,"mari-el.ru":true,"marine.ru":true,"mordovia.ru":true,"msk.ru":true,"murmansk.ru":true,"nalchik.ru":true,"nnov.ru":true,"nov.ru":true,"novosibirsk.ru":true,"nsk.ru":true,"omsk.ru":true,"orenburg.ru":true,"oryol.ru":true,"palana.ru":true,"penza.ru":true,"perm.ru":true,"ptz.ru":true,"rnd.ru":true,"ryazan.ru":true,"sakhalin.ru":true,"samara.ru":true,"saratov.ru":true,"simbirsk.ru":true,"smolensk.ru":true,"spb.ru":true,"stavropol.ru":true,"stv.ru":true,"surgut.ru":true,"tambov.ru":true,"tatarstan.ru":true,"tom.ru":true,"tomsk.ru":true,"tsaritsyn.ru":true,"tsk.ru":true,"tula.ru":true,"tuva.ru":true,"tver.ru":true,"tyumen.ru":true,"udm.ru":true,"udmurtia.ru":true,"ulan-ude.ru":true,"vladikavkaz.ru":true,"vladimir.ru":true,"vladivostok.ru":true,"volgograd.ru":true,"vologda.ru":true,"voronezh.ru":true,"vrn.ru":true,"vyatka.ru":true,"yakutia.ru":true,"yamal.ru":true,"yaroslavl.ru":true,"yekaterinburg.ru":true,"yuzhno-sakhalinsk.ru":true,"amursk.ru":true,"baikal.ru":true,"cmw.ru":true,"fareast.ru":true,"jamal.ru":true,"kms.ru":true,"k-uralsk.ru":true,"kustanai.ru":true,"kuzbass.ru":true,"magnitka.ru":true,"mytis.ru":true,"nakhodka.ru":true,"nkz.ru":true,"norilsk.ru":true,"oskol.ru":true,"pyatigorsk.ru":true,"rubtsovsk.ru":true,"snz.ru":true,"syzran.ru":true,"vdonsk.ru":true,"zgrad.ru":true,"gov.ru":true,"mil.ru":true,"test.ru":true,"rw":true,"gov.rw":true,"net.rw":true,"edu.rw":true,"ac.rw":true,"com.rw":true,"co.rw":true,"int.rw":true,"mil.rw":true,"gouv.rw":true,"sa":true,"com.sa":true,"net.sa":true,"org.sa":true,"gov.sa":true,"med.sa":true,"pub.sa":true,"edu.sa":true,"sch.sa":true,"sb":true,"com.sb":true,"edu.sb":true,"gov.sb":true,"net.sb":true,"org.sb":true,"sc":true,"com.sc":true,"gov.sc":true,"net.sc":true,"org.sc":true,"edu.sc":true,"sd":true,"com.sd":true,"net.sd":true,"org.sd":true,"edu.sd":true,"med.sd":true,"tv.sd":true,"gov.sd":true,"info.sd":true,"se":true,"a.se":true,"ac.se":true,"b.se":true,"bd.se":true,"brand.se":true,"c.se":true,"d.se":true,"e.se":true,"f.se":true,"fh.se":true,"fhsk.se":true,"fhv.se":true,"g.se":true,"h.se":true,"i.se":true,"k.se":true,"komforb.se":true,"kommunalforbund.se":true,"komvux.se":true,"l.se":true,"lanbib.se":true,"m.se":true,"n.se":true,"naturbruksgymn.se":true,"o.se":true,"org.se":true,"p.se":true,"parti.se":true,"pp.se":true,"press.se":true,"r.se":true,"s.se":true,"t.se":true,"tm.se":true,"u.se":true,"w.se":true,"x.se":true,"y.se":true,"z.se":true,"sg":true,"com.sg":true,"net.sg":true,"org.sg":true,"gov.sg":true,"edu.sg":true,"per.sg":true,"sh":true,"com.sh":true,"net.sh":true,"gov.sh":true,"org.sh":true,"mil.sh":true,"si":true,"sj":true,"sk":true,"sl":true,"com.sl":true,"net.sl":true,"edu.sl":true,"gov.sl":true,"org.sl":true,"sm":true,"sn":true,"art.sn":true,"com.sn":true,"edu.sn":true,"gouv.sn":true,"org.sn":true,"perso.sn":true,"univ.sn":true,"so":true,"com.so":true,"net.so":true,"org.so":true,"sr":true,"st":true,"co.st":true,"com.st":true,"consulado.st":true,"edu.st":true,"embaixada.st":true,"gov.st":true,"mil.st":true,"net.st":true,"org.st":true,"principe.st":true,"saotome.st":true,"store.st":true,"su":true,"adygeya.su":true,"arkhangelsk.su":true,"balashov.su":true,"bashkiria.su":true,"bryansk.su":true,"dagestan.su":true,"grozny.su":true,"ivanovo.su":true,"kalmykia.su":true,"kaluga.su":true,"karelia.su":true,"khakassia.su":true,"krasnodar.su":true,"kurgan.su":true,"lenug.su":true,"mordovia.su":true,"msk.su":true,"murmansk.su":true,"nalchik.su":true,"nov.su":true,"obninsk.su":true,"penza.su":true,"pokrovsk.su":true,"sochi.su":true,"spb.su":true,"togliatti.su":true,"troitsk.su":true,"tula.su":true,"tuva.su":true,"vladikavkaz.su":true,"vladimir.su":true,"vologda.su":true,"sv":true,"com.sv":true,"edu.sv":true,"gob.sv":true,"org.sv":true,"red.sv":true,"sx":true,"gov.sx":true,"sy":true,"edu.sy":true,"gov.sy":true,"net.sy":true,"mil.sy":true,"com.sy":true,"org.sy":true,"sz":true,"co.sz":true,"ac.sz":true,"org.sz":true,"tc":true,"td":true,"tel":true,"tf":true,"tg":true,"th":true,"ac.th":true,"co.th":true,"go.th":true,"in.th":true,"mi.th":true,"net.th":true,"or.th":true,"tj":true,"ac.tj":true,"biz.tj":true,"co.tj":true,"com.tj":true,"edu.tj":true,"go.tj":true,"gov.tj":true,"int.tj":true,"mil.tj":true,"name.tj":true,"net.tj":true,"nic.tj":true,"org.tj":true,"test.tj":true,"web.tj":true,"tk":true,"tl":true,"gov.tl":true,"tm":true,"com.tm":true,"co.tm":true,"org.tm":true,"net.tm":true,"nom.tm":true,"gov.tm":true,"mil.tm":true,"edu.tm":true,"tn":true,"com.tn":true,"ens.tn":true,"fin.tn":true,"gov.tn":true,"ind.tn":true,"intl.tn":true,"nat.tn":true,"net.tn":true,"org.tn":true,"info.tn":true,"perso.tn":true,"tourism.tn":true,"edunet.tn":true,"rnrt.tn":true,"rns.tn":true,"rnu.tn":true,"mincom.tn":true,"agrinet.tn":true,"defense.tn":true,"turen.tn":true,"to":true,"com.to":true,"gov.to":true,"net.to":true,"org.to":true,"edu.to":true,"mil.to":true,"tp":true,"tr":true,"com.tr":true,"info.tr":true,"biz.tr":true,"net.tr":true,"org.tr":true,"web.tr":true,"gen.tr":true,"tv.tr":true,"av.tr":true,"dr.tr":true,"bbs.tr":true,"name.tr":true,"tel.tr":true,"gov.tr":true,"bel.tr":true,"pol.tr":true,"mil.tr":true,"k12.tr":true,"edu.tr":true,"kep.tr":true,"nc.tr":true,"gov.nc.tr":true,"travel":true,"tt":true,"co.tt":true,"com.tt":true,"org.tt":true,"net.tt":true,"biz.tt":true,"info.tt":true,"pro.tt":true,"int.tt":true,"coop.tt":true,"jobs.tt":true,"mobi.tt":true,"travel.tt":true,"museum.tt":true,"aero.tt":true,"name.tt":true,"gov.tt":true,"edu.tt":true,"tv":true,"tw":true,"edu.tw":true,"gov.tw":true,"mil.tw":true,"com.tw":true,"net.tw":true,"org.tw":true,"idv.tw":true,"game.tw":true,"ebiz.tw":true,"club.tw":true,"xn--zf0ao64a.tw":true,"xn--uc0atv.tw":true,"xn--czrw28b.tw":true,"tz":true,"ac.tz":true,"co.tz":true,"go.tz":true,"hotel.tz":true,"info.tz":true,"me.tz":true,"mil.tz":true,"mobi.tz":true,"ne.tz":true,"or.tz":true,"sc.tz":true,"tv.tz":true,"ua":true,"com.ua":true,"edu.ua":true,"gov.ua":true,"in.ua":true,"net.ua":true,"org.ua":true,"cherkassy.ua":true,"cherkasy.ua":true,"chernigov.ua":true,"chernihiv.ua":true,"chernivtsi.ua":true,"chernovtsy.ua":true,"ck.ua":true,"cn.ua":true,"cr.ua":true,"crimea.ua":true,"cv.ua":true,"dn.ua":true,"dnepropetrovsk.ua":true,"dnipropetrovsk.ua":true,"dominic.ua":true,"donetsk.ua":true,"dp.ua":true,"if.ua":true,"ivano-frankivsk.ua":true,"kh.ua":true,"kharkiv.ua":true,"kharkov.ua":true,"kherson.ua":true,"khmelnitskiy.ua":true,"khmelnytskyi.ua":true,"kiev.ua":true,"kirovograd.ua":true,"km.ua":true,"kr.ua":true,"krym.ua":true,"ks.ua":true,"kv.ua":true,"kyiv.ua":true,"lg.ua":true,"lt.ua":true,"lugansk.ua":true,"lutsk.ua":true,"lv.ua":true,"lviv.ua":true,"mk.ua":true,"mykolaiv.ua":true,"nikolaev.ua":true,"od.ua":true,"odesa.ua":true,"odessa.ua":true,"pl.ua":true,"poltava.ua":true,"rivne.ua":true,"rovno.ua":true,"rv.ua":true,"sb.ua":true,"sebastopol.ua":true,"sevastopol.ua":true,"sm.ua":true,"sumy.ua":true,"te.ua":true,"ternopil.ua":true,"uz.ua":true,"uzhgorod.ua":true,"vinnica.ua":true,"vinnytsia.ua":true,"vn.ua":true,"volyn.ua":true,"yalta.ua":true,"zaporizhzhe.ua":true,"zaporizhzhia.ua":true,"zhitomir.ua":true,"zhytomyr.ua":true,"zp.ua":true,"zt.ua":true,"co.ua":true,"pp.ua":true,"ug":true,"co.ug":true,"or.ug":true,"ac.ug":true,"sc.ug":true,"go.ug":true,"ne.ug":true,"com.ug":true,"org.ug":true,"uk":true,"ac.uk":true,"co.uk":true,"gov.uk":true,"ltd.uk":true,"me.uk":true,"net.uk":true,"nhs.uk":true,"org.uk":true,"plc.uk":true,"police.uk":true,"*.sch.uk":true,"us":true,"dni.us":true,"fed.us":true,"isa.us":true,"kids.us":true,"nsn.us":true,"ak.us":true,"al.us":true,"ar.us":true,"as.us":true,"az.us":true,"ca.us":true,"co.us":true,"ct.us":true,"dc.us":true,"de.us":true,"fl.us":true,"ga.us":true,"gu.us":true,"hi.us":true,"ia.us":true,"id.us":true,"il.us":true,"in.us":true,"ks.us":true,"ky.us":true,"la.us":true,"ma.us":true,"md.us":true,"me.us":true,"mi.us":true,"mn.us":true,"mo.us":true,"ms.us":true,"mt.us":true,"nc.us":true,"nd.us":true,"ne.us":true,"nh.us":true,"nj.us":true,"nm.us":true,"nv.us":true,"ny.us":true,"oh.us":true,"ok.us":true,"or.us":true,"pa.us":true,"pr.us":true,"ri.us":true,"sc.us":true,"sd.us":true,"tn.us":true,"tx.us":true,"ut.us":true,"vi.us":true,"vt.us":true,"va.us":true,"wa.us":true,"wi.us":true,"wv.us":true,"wy.us":true,"k12.ak.us":true,"k12.al.us":true,"k12.ar.us":true,"k12.as.us":true,"k12.az.us":true,"k12.ca.us":true,"k12.co.us":true,"k12.ct.us":true,"k12.dc.us":true,"k12.de.us":true,"k12.fl.us":true,"k12.ga.us":true,"k12.gu.us":true,"k12.ia.us":true,"k12.id.us":true,"k12.il.us":true,"k12.in.us":true,"k12.ks.us":true,"k12.ky.us":true,"k12.la.us":true,"k12.ma.us":true,"k12.md.us":true,"k12.me.us":true,"k12.mi.us":true,"k12.mn.us":true,"k12.mo.us":true,"k12.ms.us":true,"k12.mt.us":true,"k12.nc.us":true,"k12.ne.us":true,"k12.nh.us":true,"k12.nj.us":true,"k12.nm.us":true,"k12.nv.us":true,"k12.ny.us":true,"k12.oh.us":true,"k12.ok.us":true,"k12.or.us":true,"k12.pa.us":true,"k12.pr.us":true,"k12.ri.us":true,"k12.sc.us":true,"k12.tn.us":true,"k12.tx.us":true,"k12.ut.us":true,"k12.vi.us":true,"k12.vt.us":true,"k12.va.us":true,"k12.wa.us":true,"k12.wi.us":true,"k12.wy.us":true,"cc.ak.us":true,"cc.al.us":true,"cc.ar.us":true,"cc.as.us":true,"cc.az.us":true,"cc.ca.us":true,"cc.co.us":true,"cc.ct.us":true,"cc.dc.us":true,"cc.de.us":true,"cc.fl.us":true,"cc.ga.us":true,"cc.gu.us":true,"cc.hi.us":true,"cc.ia.us":true,"cc.id.us":true,"cc.il.us":true,"cc.in.us":true,"cc.ks.us":true,"cc.ky.us":true,"cc.la.us":true,"cc.ma.us":true,"cc.md.us":true,"cc.me.us":true,"cc.mi.us":true,"cc.mn.us":true,"cc.mo.us":true,"cc.ms.us":true,"cc.mt.us":true,"cc.nc.us":true,"cc.nd.us":true,"cc.ne.us":true,"cc.nh.us":true,"cc.nj.us":true,"cc.nm.us":true,"cc.nv.us":true,"cc.ny.us":true,"cc.oh.us":true,"cc.ok.us":true,"cc.or.us":true,"cc.pa.us":true,"cc.pr.us":true,"cc.ri.us":true,"cc.sc.us":true,"cc.sd.us":true,"cc.tn.us":true,"cc.tx.us":true,"cc.ut.us":true,"cc.vi.us":true,"cc.vt.us":true,"cc.va.us":true,"cc.wa.us":true,"cc.wi.us":true,"cc.wv.us":true,"cc.wy.us":true,"lib.ak.us":true,"lib.al.us":true,"lib.ar.us":true,"lib.as.us":true,"lib.az.us":true,"lib.ca.us":true,"lib.co.us":true,"lib.ct.us":true,"lib.dc.us":true,"lib.de.us":true,"lib.fl.us":true,"lib.ga.us":true,"lib.gu.us":true,"lib.hi.us":true,"lib.ia.us":true,"lib.id.us":true,"lib.il.us":true,"lib.in.us":true,"lib.ks.us":true,"lib.ky.us":true,"lib.la.us":true,"lib.ma.us":true,"lib.md.us":true,"lib.me.us":true,"lib.mi.us":true,"lib.mn.us":true,"lib.mo.us":true,"lib.ms.us":true,"lib.mt.us":true,"lib.nc.us":true,"lib.nd.us":true,"lib.ne.us":true,"lib.nh.us":true,"lib.nj.us":true,"lib.nm.us":true,"lib.nv.us":true,"lib.ny.us":true,"lib.oh.us":true,"lib.ok.us":true,"lib.or.us":true,"lib.pa.us":true,"lib.pr.us":true,"lib.ri.us":true,"lib.sc.us":true,"lib.sd.us":true,"lib.tn.us":true,"lib.tx.us":true,"lib.ut.us":true,"lib.vi.us":true,"lib.vt.us":true,"lib.va.us":true,"lib.wa.us":true,"lib.wi.us":true,"lib.wy.us":true,"pvt.k12.ma.us":true,"chtr.k12.ma.us":true,"paroch.k12.ma.us":true,"uy":true,"com.uy":true,"edu.uy":true,"gub.uy":true,"mil.uy":true,"net.uy":true,"org.uy":true,"uz":true,"co.uz":true,"com.uz":true,"net.uz":true,"org.uz":true,"va":true,"vc":true,"com.vc":true,"net.vc":true,"org.vc":true,"gov.vc":true,"mil.vc":true,"edu.vc":true,"ve":true,"arts.ve":true,"co.ve":true,"com.ve":true,"e12.ve":true,"edu.ve":true,"firm.ve":true,"gob.ve":true,"gov.ve":true,"info.ve":true,"int.ve":true,"mil.ve":true,"net.ve":true,"org.ve":true,"rec.ve":true,"store.ve":true,"tec.ve":true,"web.ve":true,"vg":true,"vi":true,"co.vi":true,"com.vi":true,"k12.vi":true,"net.vi":true,"org.vi":true,"vn":true,"com.vn":true,"net.vn":true,"org.vn":true,"edu.vn":true,"gov.vn":true,"int.vn":true,"ac.vn":true,"biz.vn":true,"info.vn":true,"name.vn":true,"pro.vn":true,"health.vn":true,"vu":true,"com.vu":true,"edu.vu":true,"net.vu":true,"org.vu":true,"wf":true,"ws":true,"com.ws":true,"net.ws":true,"org.ws":true,"gov.ws":true,"edu.ws":true,"yt":true,"xn--mgbaam7a8h":true,"xn--54b7fta0cc":true,"xn--fiqs8s":true,"xn--fiqz9s":true,"xn--lgbbat1ad8j":true,"xn--wgbh1c":true,"xn--node":true,"xn--j6w193g":true,"xn--h2brj9c":true,"xn--mgbbh1a71e":true,"xn--fpcrj9c3d":true,"xn--gecrj9c":true,"xn--s9brj9c":true,"xn--45brj9c":true,"xn--xkc2dl3a5ee0h":true,"xn--mgba3a4f16a":true,"xn--mgba3a4fra":true,"xn--mgbayh7gpa":true,"xn--3e0b707e":true,"xn--80ao21a":true,"xn--fzc2c9e2c":true,"xn--xkc2al3hye2a":true,"xn--mgbc0a9azcg":true,"xn--l1acc":true,"xn--mgbx4cd0ab":true,"xn--mgb9awbf":true,"xn--ygbi2ammx":true,"xn--90a3ac":true,"xn--o1ac.xn--90a3ac":true,"xn--c1avg.xn--90a3ac":true,"xn--90azh.xn--90a3ac":true,"xn--d1at.xn--90a3ac":true,"xn--o1ach.xn--90a3ac":true,"xn--80au.xn--90a3ac":true,"xn--p1ai":true,"xn--wgbl6a":true,"xn--mgberp4a5d4ar":true,"xn--mgberp4a5d4a87g":true,"xn--mgbqly7c0a67fbc":true,"xn--mgbqly7cvafr":true,"xn--ogbpf8fl":true,"xn--mgbtf8fl":true,"xn--yfro4i67o":true,"xn--clchc0ea0b2g2a9gcd":true,"xn--o3cw4h":true,"xn--pgbs0dh":true,"xn--kpry57d":true,"xn--kprw13d":true,"xn--nnx388a":true,"xn--j1amh":true,"xn--mgb2ddes":true,"xxx":true,"*.ye":true,"*.za":true,"*.zm":true,"*.zw":true,"aaa":true,"abb":true,"abbott":true,"abogado":true,"academy":true,"accenture":true,"accountant":true,"accountants":true,"aco":true,"active":true,"actor":true,"ads":true,"adult":true,"aeg":true,"afl":true,"africa":true,"africamagic":true,"agency":true,"aig":true,"airforce":true,"airtel":true,"alibaba":true,"alipay":true,"allfinanz":true,"alsace":true,"amsterdam":true,"analytics":true,"android":true,"anquan":true,"apartments":true,"aquarelle":true,"aramco":true,"archi":true,"army":true,"arte":true,"associates":true,"attorney":true,"auction":true,"audio":true,"author":true,"auto":true,"autos":true,"avianca":true,"axa":true,"azure":true,"baidu":true,"band":true,"bank":true,"bar":true,"barcelona":true,"barclaycard":true,"barclays":true,"bargains":true,"bauhaus":true,"bayern":true,"bbc":true,"bbva":true,"bcg":true,"bcn":true,"beer":true,"bentley":true,"berlin":true,"best":true,"bharti":true,"bible":true,"bid":true,"bike":true,"bing":true,"bingo":true,"bio":true,"black":true,"blackfriday":true,"bloomberg":true,"blue":true,"bms":true,"bmw":true,"bnl":true,"bnpparibas":true,"boats":true,"bom":true,"bond":true,"boo":true,"boots":true,"bot":true,"boutique":true,"bradesco":true,"bridgestone":true,"broadway":true,"broker":true,"brother":true,"brussels":true,"budapest":true,"build":true,"builders":true,"business":true,"buy":true,"buzz":true,"bzh":true,"cab":true,"cafe":true,"cal":true,"call":true,"camera":true,"camp":true,"cancerresearch":true,"canon":true,"capetown":true,"capital":true,"car":true,"caravan":true,"cards":true,"care":true,"career":true,"careers":true,"cars":true,"cartier":true,"casa":true,"cash":true,"casino":true,"catering":true,"cba":true,"cbn":true,"center":true,"ceo":true,"cern":true,"cfa":true,"cfd":true,"channel":true,"chat":true,"cheap":true,"chloe":true,"christmas":true,"chrome":true,"church":true,"cipriani":true,"circle":true,"cisco":true,"citic":true,"city":true,"cityeats":true,"claims":true,"cleaning":true,"click":true,"clinic":true,"clothing":true,"club":true,"coach":true,"codes":true,"coffee":true,"college":true,"cologne":true,"commbank":true,"community":true,"company":true,"computer":true,"comsec":true,"condos":true,"construction":true,"consulting":true,"contact":true,"contractors":true,"cooking":true,"cool":true,"corsica":true,"country":true,"coupon":true,"coupons":true,"courses":true,"credit":true,"creditcard":true,"creditunion":true,"cricket":true,"crown":true,"crs":true,"cruises":true,"csc":true,"cuisinella":true,"cymru":true,"cyou":true,"dabur":true,"dad":true,"dance":true,"date":true,"dating":true,"datsun":true,"day":true,"dclk":true,"dealer":true,"deals":true,"degree":true,"delivery":true,"dell":true,"delta":true,"democrat":true,"dental":true,"dentist":true,"desi":true,"design":true,"dev":true,"diamonds":true,"diet":true,"digital":true,"direct":true,"directory":true,"discount":true,"dnp":true,"docs":true,"dog":true,"doha":true,"domains":true,"doosan":true,"download":true,"drive":true,"dstv":true,"dubai":true,"durban":true,"dvag":true,"earth":true,"eat":true,"edeka":true,"education":true,"email":true,"emerck":true,"energy":true,"engineer":true,"engineering":true,"enterprises":true,"epson":true,"equipment":true,"erni":true,"esq":true,"estate":true,"eurovision":true,"eus":true,"events":true,"everbank":true,"exchange":true,"expert":true,"exposed":true,"express":true,"fage":true,"fail":true,"fairwinds":true,"faith":true,"family":true,"fan":true,"fans":true,"farm":true,"fashion":true,"fast":true,"feedback":true,"ferrero":true,"film":true,"final":true,"finance":true,"financial":true,"firestone":true,"firmdale":true,"fish":true,"fishing":true,"fit":true,"fitness":true,"flickr":true,"flights":true,"florist":true,"flowers":true,"flsmidth":true,"fly":true,"foo":true,"football":true,"ford":true,"forex":true,"forsale":true,"forum":true,"foundation":true,"frl":true,"frogans":true,"frontier":true,"fund":true,"furniture":true,"futbol":true,"fyi":true,"gal":true,"gallery":true,"gallup":true,"garden":true,"gbiz":true,"gdn":true,"gea":true,"gent":true,"genting":true,"ggee":true,"gift":true,"gifts":true,"gives":true,"giving":true,"glass":true,"gle":true,"global":true,"globo":true,"gmail":true,"gmo":true,"gmx":true,"gold":true,"goldpoint":true,"golf":true,"goo":true,"goog":true,"google":true,"gop":true,"got":true,"gotv":true,"graphics":true,"gratis":true,"green":true,"gripe":true,"group":true,"gucci":true,"guge":true,"guide":true,"guitars":true,"guru":true,"hamburg":true,"hangout":true,"haus":true,"hdfcbank":true,"health":true,"healthcare":true,"help":true,"helsinki":true,"here":true,"hermes":true,"hiphop":true,"hitachi":true,"hiv":true,"hockey":true,"holdings":true,"holiday":true,"homedepot":true,"homes":true,"honda":true,"horse":true,"host":true,"hosting":true,"hoteles":true,"hotmail":true,"house":true,"how":true,"hsbc":true,"htc":true,"ibm":true,"icbc":true,"ice":true,"icu":true,"ifm":true,"iinet":true,"immo":true,"immobilien":true,"industries":true,"infiniti":true,"ing":true,"ink":true,"institute":true,"insurance":true,"insure":true,"international":true,"investments":true,"ipiranga":true,"irish":true,"iselect":true,"ist":true,"istanbul":true,"itau":true,"iwc":true,"jaguar":true,"java":true,"jcb":true,"jetzt":true,"jewelry":true,"jio":true,"jlc":true,"jll":true,"jmp":true,"joburg":true,"jot":true,"joy":true,"jprs":true,"juegos":true,"kaufen":true,"kddi":true,"kfh":true,"kim":true,"kinder":true,"kitchen":true,"kiwi":true,"koeln":true,"komatsu":true,"kpn":true,"krd":true,"kred":true,"kyknet":true,"kyoto":true,"lacaixa":true,"lancaster":true,"land":true,"landrover":true,"lasalle":true,"lat":true,"latrobe":true,"law":true,"lawyer":true,"lds":true,"lease":true,"leclerc":true,"legal":true,"lgbt":true,"liaison":true,"lidl":true,"life":true,"lifeinsurance":true,"lifestyle":true,"lighting":true,"like":true,"limited":true,"limo":true,"lincoln":true,"linde":true,"link":true,"live":true,"lixil":true,"loan":true,"loans":true,"lol":true,"london":true,"lotte":true,"lotto":true,"love":true,"ltd":true,"ltda":true,"lupin":true,"luxe":true,"luxury":true,"madrid":true,"maif":true,"maison":true,"makeup":true,"man":true,"management":true,"mango":true,"market":true,"marketing":true,"markets":true,"marriott":true,"mba":true,"media":true,"meet":true,"melbourne":true,"meme":true,"memorial":true,"men":true,"menu":true,"meo":true,"miami":true,"microsoft":true,"mini":true,"mma":true,"mnet":true,"mobily":true,"moda":true,"moe":true,"moi":true,"monash":true,"money":true,"montblanc":true,"mormon":true,"mortgage":true,"moscow":true,"motorcycles":true,"mov":true,"movie":true,"movistar":true,"mtn":true,"mtpc":true,"mtr":true,"multichoice":true,"mutual":true,"mzansimagic":true,"nadex":true,"nagoya":true,"naspers":true,"natura":true,"navy":true,"nec":true,"netbank":true,"network":true,"neustar":true,"new":true,"news":true,"nexus":true,"ngo":true,"nhk":true,"nico":true,"ninja":true,"nissan":true,"nokia":true,"norton":true,"nowruz":true,"nra":true,"nrw":true,"ntt":true,"nyc":true,"obi":true,"office":true,"okinawa":true,"omega":true,"one":true,"ong":true,"onl":true,"online":true,"ooo":true,"oracle":true,"orange":true,"organic":true,"orientexpress":true,"osaka":true,"otsuka":true,"ovh":true,"page":true,"pamperedchef":true,"panerai":true,"paris":true,"pars":true,"partners":true,"parts":true,"party":true,"passagens":true,"payu":true,"pharmacy":true,"philips":true,"photo":true,"photography":true,"photos":true,"physio":true,"piaget":true,"pics":true,"pictet":true,"pictures":true,"pid":true,"pin":true,"pink":true,"pizza":true,"place":true,"play":true,"plumbing":true,"plus":true,"pohl":true,"poker":true,"porn":true,"praxi":true,"press":true,"prod":true,"productions":true,"prof":true,"promo":true,"properties":true,"property":true,"pub":true,"qpon":true,"quebec":true,"quest":true,"racing":true,"read":true,"realtor":true,"realty":true,"recipes":true,"red":true,"redstone":true,"redumbrella":true,"rehab":true,"reise":true,"reisen":true,"reit":true,"reliance":true,"ren":true,"rent":true,"rentals":true,"repair":true,"report":true,"republican":true,"rest":true,"restaurant":true,"review":true,"reviews":true,"rich":true,"ricoh":true,"ril":true,"rio":true,"rip":true,"rocher":true,"rocks":true,"rodeo":true,"room":true,"rsvp":true,"ruhr":true,"run":true,"rwe":true,"ryukyu":true,"saarland":true,"safe":true,"safety":true,"sakura":true,"sale":true,"salon":true,"samsung":true,"sandvik":true,"sandvikcoromant":true,"sanofi":true,"sap":true,"sapo":true,"sarl":true,"sas":true,"saxo":true,"sbi":true,"sbs":true,"sca":true,"scb":true,"schmidt":true,"scholarships":true,"school":true,"schule":true,"schwarz":true,"science":true,"scor":true,"scot":true,"seat":true,"seek":true,"sener":true,"services":true,"sew":true,"sex":true,"sexy":true,"sharp":true,"shia":true,"shiksha":true,"shoes":true,"shouji":true,"show":true,"shriram":true,"sina":true,"singles":true,"site":true,"skin":true,"sky":true,"skype":true,"smile":true,"sncf":true,"soccer":true,"social":true,"software":true,"sohu":true,"solar":true,"solutions":true,"song":true,"sony":true,"soy":true,"space":true,"spiegel":true,"spot":true,"spreadbetting":true,"stada":true,"star":true,"starhub":true,"statebank":true,"statoil":true,"stc":true,"stcgroup":true,"stockholm":true,"storage":true,"studio":true,"study":true,"style":true,"sucks":true,"supersport":true,"supplies":true,"supply":true,"support":true,"surf":true,"surgery":true,"suzuki":true,"swatch":true,"swiss":true,"sydney":true,"symantec":true,"systems":true,"tab":true,"taipei":true,"taobao":true,"tatamotors":true,"tatar":true,"tattoo":true,"tax":true,"taxi":true,"tci":true,"team":true,"tech":true,"technology":true,"telecity":true,"telefonica":true,"temasek":true,"tennis":true,"thd":true,"theater":true,"tickets":true,"tienda":true,"tiffany":true,"tips":true,"tires":true,"tirol":true,"tmall":true,"today":true,"tokyo":true,"tools":true,"top":true,"toray":true,"toshiba":true,"tours":true,"town":true,"toys":true,"trade":true,"trading":true,"training":true,"travelers":true,"travelersinsurance":true,"trust":true,"trv":true,"tui":true,"tunes":true,"tushu":true,"tvs":true,"ubs":true,"university":true,"uno":true,"uol":true,"vacations":true,"vana":true,"vegas":true,"ventures":true,"versicherung":true,"vet":true,"viajes":true,"video":true,"viking":true,"villas":true,"vip":true,"virgin":true,"vision":true,"vista":true,"vistaprint":true,"viva":true,"vlaanderen":true,"vodka":true,"vote":true,"voting":true,"voto":true,"voyage":true,"vuelos":true,"wales":true,"walter":true,"wang":true,"wanggou":true,"watch":true,"watches":true,"weather":true,"weatherchannel":true,"webcam":true,"website":true,"wed":true,"wedding":true,"weibo":true,"weir":true,"whoswho":true,"wien":true,"wiki":true,"williamhill":true,"win":true,"windows":true,"wme":true,"work":true,"works":true,"world":true,"wtc":true,"wtf":true,"xbox":true,"xerox":true,"xihuan":true,"xin":true,"xn--11b4c3d":true,"xn--1ck2e1b":true,"xn--1qqw23a":true,"xn--30rr7y":true,"xn--3bst00m":true,"xn--3ds443g":true,"xn--3pxu8k":true,"xn--42c2d9a":true,"xn--45q11c":true,"xn--4gbrim":true,"xn--55qw42g":true,"xn--55qx5d":true,"xn--5tzm5g":true,"xn--6frz82g":true,"xn--6qq986b3xl":true,"xn--80adxhks":true,"xn--80asehdb":true,"xn--80aswg":true,"xn--8y0a063a":true,"xn--9dbq2a":true,"xn--9et52u":true,"xn--9krt00a":true,"xn--b4w605ferd":true,"xn--bck1b9a5dre4c":true,"xn--c1avg":true,"xn--c2br7g":true,"xn--cck2b3b":true,"xn--cg4bki":true,"xn--czr694b":true,"xn--czrs0t":true,"xn--czru2d":true,"xn--d1acj3b":true,"xn--eckvdtc9d":true,"xn--efvy88h":true,"xn--estv75g":true,"xn--fhbei":true,"xn--fiq228c5hs":true,"xn--fiq64b":true,"xn--fjq720a":true,"xn--flw351e":true,"xn--g2xx48c":true,"xn--gckr3f0f":true,"xn--hxt814e":true,"xn--i1b6b1a6a2e":true,"xn--imr513n":true,"xn--io0a7i":true,"xn--j1aef":true,"xn--jlq61u9w7b":true,"xn--jvr189m":true,"xn--kcrx77d1x4a":true,"xn--kpu716f":true,"xn--kput3i":true,"xn--mgba3a3ejt":true,"xn--mgbab2bd":true,"xn--mgbb9fbpob":true,"xn--mgbt3dhd":true,"xn--mk1bu44c":true,"xn--mxtq1m":true,"xn--ngbc5azd":true,"xn--ngbe9e0a":true,"xn--nqv7f":true,"xn--nqv7fs00ema":true,"xn--nyqy26a":true,"xn--p1acf":true,"xn--pbt977c":true,"xn--pssy2u":true,"xn--q9jyb4c":true,"xn--qcka1pmc":true,"xn--rhqv96g":true,"xn--rovu88b":true,"xn--ses554g":true,"xn--t60b56a":true,"xn--tckwe":true,"xn--unup4y":true,"xn--vermgensberater-ctb":true,"xn--vermgensberatung-pwb":true,"xn--vhquv":true,"xn--vuq861b":true,"xn--xhq521b":true,"xn--zfr164b":true,"xyz":true,"yachts":true,"yahoo":true,"yamaxun":true,"yandex":true,"yodobashi":true,"yoga":true,"yokohama":true,"youtube":true,"yun":true,"zara":true,"zero":true,"zip":true,"zone":true,"zuerich":true,"cloudfront.net":true,"ap-northeast-1.compute.amazonaws.com":true,"ap-southeast-1.compute.amazonaws.com":true,"ap-southeast-2.compute.amazonaws.com":true,"cn-north-1.compute.amazonaws.cn":true,"compute.amazonaws.cn":true,"compute.amazonaws.com":true,"compute-1.amazonaws.com":true,"eu-west-1.compute.amazonaws.com":true,"eu-central-1.compute.amazonaws.com":true,"sa-east-1.compute.amazonaws.com":true,"us-east-1.amazonaws.com":true,"us-gov-west-1.compute.amazonaws.com":true,"us-west-1.compute.amazonaws.com":true,"us-west-2.compute.amazonaws.com":true,"z-1.compute-1.amazonaws.com":true,"z-2.compute-1.amazonaws.com":true,"elasticbeanstalk.com":true,"elb.amazonaws.com":true,"s3.amazonaws.com":true,"s3-us-west-2.amazonaws.com":true,"s3-us-west-1.amazonaws.com":true,"s3-eu-west-1.amazonaws.com":true,"s3-ap-southeast-1.amazonaws.com":true,"s3-ap-southeast-2.amazonaws.com":true,"s3-ap-northeast-1.amazonaws.com":true,"s3-sa-east-1.amazonaws.com":true,"s3-us-gov-west-1.amazonaws.com":true,"s3-fips-us-gov-west-1.amazonaws.com":true,"s3-website-us-east-1.amazonaws.com":true,"s3-website-us-west-2.amazonaws.com":true,"s3-website-us-west-1.amazonaws.com":true,"s3-website-eu-west-1.amazonaws.com":true,"s3-website-ap-southeast-1.amazonaws.com":true,"s3-website-ap-southeast-2.amazonaws.com":true,"s3-website-ap-northeast-1.amazonaws.com":true,"s3-website-sa-east-1.amazonaws.com":true,"s3-website-us-gov-west-1.amazonaws.com":true,"betainabox.com":true,"ae.org":true,"ar.com":true,"br.com":true,"cn.com":true,"com.de":true,"com.se":true,"de.com":true,"eu.com":true,"gb.com":true,"gb.net":true,"hu.com":true,"hu.net":true,"jp.net":true,"jpn.com":true,"kr.com":true,"mex.com":true,"no.com":true,"qc.com":true,"ru.com":true,"sa.com":true,"se.com":true,"se.net":true,"uk.com":true,"uk.net":true,"us.com":true,"uy.com":true,"za.bz":true,"za.com":true,"africa.com":true,"gr.com":true,"in.net":true,"us.org":true,"co.com":true,"c.la":true,"cloudcontrolled.com":true,"cloudcontrolapp.com":true,"co.ca":true,"co.nl":true,"co.no":true,"*.platform.sh":true,"cupcake.is":true,"dreamhosters.com":true,"dyndns-at-home.com":true,"dyndns-at-work.com":true,"dyndns-blog.com":true,"dyndns-free.com":true,"dyndns-home.com":true,"dyndns-ip.com":true,"dyndns-mail.com":true,"dyndns-office.com":true,"dyndns-pics.com":true,"dyndns-remote.com":true,"dyndns-server.com":true,"dyndns-web.com":true,"dyndns-wiki.com":true,"dyndns-work.com":true,"dyndns.biz":true,"dyndns.info":true,"dyndns.org":true,"dyndns.tv":true,"at-band-camp.net":true,"ath.cx":true,"barrel-of-knowledge.info":true,"barrell-of-knowledge.info":true,"better-than.tv":true,"blogdns.com":true,"blogdns.net":true,"blogdns.org":true,"blogsite.org":true,"boldlygoingnowhere.org":true,"broke-it.net":true,"buyshouses.net":true,"cechire.com":true,"dnsalias.com":true,"dnsalias.net":true,"dnsalias.org":true,"dnsdojo.com":true,"dnsdojo.net":true,"dnsdojo.org":true,"does-it.net":true,"doesntexist.com":true,"doesntexist.org":true,"dontexist.com":true,"dontexist.net":true,"dontexist.org":true,"doomdns.com":true,"doomdns.org":true,"dvrdns.org":true,"dyn-o-saur.com":true,"dynalias.com":true,"dynalias.net":true,"dynalias.org":true,"dynathome.net":true,"dyndns.ws":true,"endofinternet.net":true,"endofinternet.org":true,"endoftheinternet.org":true,"est-a-la-maison.com":true,"est-a-la-masion.com":true,"est-le-patron.com":true,"est-mon-blogueur.com":true,"for-better.biz":true,"for-more.biz":true,"for-our.info":true,"for-some.biz":true,"for-the.biz":true,"forgot.her.name":true,"forgot.his.name":true,"from-ak.com":true,"from-al.com":true,"from-ar.com":true,"from-az.net":true,"from-ca.com":true,"from-co.net":true,"from-ct.com":true,"from-dc.com":true,"from-de.com":true,"from-fl.com":true,"from-ga.com":true,"from-hi.com":true,"from-ia.com":true,"from-id.com":true,"from-il.com":true,"from-in.com":true,"from-ks.com":true,"from-ky.com":true,"from-la.net":true,"from-ma.com":true,"from-md.com":true,"from-me.org":true,"from-mi.com":true,"from-mn.com":true,"from-mo.com":true,"from-ms.com":true,"from-mt.com":true,"from-nc.com":true,"from-nd.com":true,"from-ne.com":true,"from-nh.com":true,"from-nj.com":true,"from-nm.com":true,"from-nv.com":true,"from-ny.net":true,"from-oh.com":true,"from-ok.com":true,"from-or.com":true,"from-pa.com":true,"from-pr.com":true,"from-ri.com":true,"from-sc.com":true,"from-sd.com":true,"from-tn.com":true,"from-tx.com":true,"from-ut.com":true,"from-va.com":true,"from-vt.com":true,"from-wa.com":true,"from-wi.com":true,"from-wv.com":true,"from-wy.com":true,"ftpaccess.cc":true,"fuettertdasnetz.de":true,"game-host.org":true,"game-server.cc":true,"getmyip.com":true,"gets-it.net":true,"go.dyndns.org":true,"gotdns.com":true,"gotdns.org":true,"groks-the.info":true,"groks-this.info":true,"ham-radio-op.net":true,"here-for-more.info":true,"hobby-site.com":true,"hobby-site.org":true,"home.dyndns.org":true,"homedns.org":true,"homeftp.net":true,"homeftp.org":true,"homeip.net":true,"homelinux.com":true,"homelinux.net":true,"homelinux.org":true,"homeunix.com":true,"homeunix.net":true,"homeunix.org":true,"iamallama.com":true,"in-the-band.net":true,"is-a-anarchist.com":true,"is-a-blogger.com":true,"is-a-bookkeeper.com":true,"is-a-bruinsfan.org":true,"is-a-bulls-fan.com":true,"is-a-candidate.org":true,"is-a-caterer.com":true,"is-a-celticsfan.org":true,"is-a-chef.com":true,"is-a-chef.net":true,"is-a-chef.org":true,"is-a-conservative.com":true,"is-a-cpa.com":true,"is-a-cubicle-slave.com":true,"is-a-democrat.com":true,"is-a-designer.com":true,"is-a-doctor.com":true,"is-a-financialadvisor.com":true,"is-a-geek.com":true,"is-a-geek.net":true,"is-a-geek.org":true,"is-a-green.com":true,"is-a-guru.com":true,"is-a-hard-worker.com":true,"is-a-hunter.com":true,"is-a-knight.org":true,"is-a-landscaper.com":true,"is-a-lawyer.com":true,"is-a-liberal.com":true,"is-a-libertarian.com":true,"is-a-linux-user.org":true,"is-a-llama.com":true,"is-a-musician.com":true,"is-a-nascarfan.com":true,"is-a-nurse.com":true,"is-a-painter.com":true,"is-a-patsfan.org":true,"is-a-personaltrainer.com":true,"is-a-photographer.com":true,"is-a-player.com":true,"is-a-republican.com":true,"is-a-rockstar.com":true,"is-a-socialist.com":true,"is-a-soxfan.org":true,"is-a-student.com":true,"is-a-teacher.com":true,"is-a-techie.com":true,"is-a-therapist.com":true,"is-an-accountant.com":true,"is-an-actor.com":true,"is-an-actress.com":true,"is-an-anarchist.com":true,"is-an-artist.com":true,"is-an-engineer.com":true,"is-an-entertainer.com":true,"is-by.us":true,"is-certified.com":true,"is-found.org":true,"is-gone.com":true,"is-into-anime.com":true,"is-into-cars.com":true,"is-into-cartoons.com":true,"is-into-games.com":true,"is-leet.com":true,"is-lost.org":true,"is-not-certified.com":true,"is-saved.org":true,"is-slick.com":true,"is-uberleet.com":true,"is-very-bad.org":true,"is-very-evil.org":true,"is-very-good.org":true,"is-very-nice.org":true,"is-very-sweet.org":true,"is-with-theband.com":true,"isa-geek.com":true,"isa-geek.net":true,"isa-geek.org":true,"isa-hockeynut.com":true,"issmarterthanyou.com":true,"isteingeek.de":true,"istmein.de":true,"kicks-ass.net":true,"kicks-ass.org":true,"knowsitall.info":true,"land-4-sale.us":true,"lebtimnetz.de":true,"leitungsen.de":true,"likes-pie.com":true,"likescandy.com":true,"merseine.nu":true,"mine.nu":true,"misconfused.org":true,"mypets.ws":true,"myphotos.cc":true,"neat-url.com":true,"office-on-the.net":true,"on-the-web.tv":true,"podzone.net":true,"podzone.org":true,"readmyblog.org":true,"saves-the-whales.com":true,"scrapper-site.net":true,"scrapping.cc":true,"selfip.biz":true,"selfip.com":true,"selfip.info":true,"selfip.net":true,"selfip.org":true,"sells-for-less.com":true,"sells-for-u.com":true,"sells-it.net":true,"sellsyourhome.org":true,"servebbs.com":true,"servebbs.net":true,"servebbs.org":true,"serveftp.net":true,"serveftp.org":true,"servegame.org":true,"shacknet.nu":true,"simple-url.com":true,"space-to-rent.com":true,"stuff-4-sale.org":true,"stuff-4-sale.us":true,"teaches-yoga.com":true,"thruhere.net":true,"traeumtgerade.de":true,"webhop.biz":true,"webhop.info":true,"webhop.net":true,"webhop.org":true,"worse-than.tv":true,"writesthisblog.com":true,"a.ssl.fastly.net":true,"b.ssl.fastly.net":true,"global.ssl.fastly.net":true,"a.prod.fastly.net":true,"global.prod.fastly.net":true,"firebaseapp.com":true,"flynnhub.com":true,"service.gov.uk":true,"github.io":true,"githubusercontent.com":true,"ro.com":true,"appspot.com":true,"blogspot.ae":true,"blogspot.be":true,"blogspot.bj":true,"blogspot.ca":true,"blogspot.cf":true,"blogspot.ch":true,"blogspot.co.at":true,"blogspot.co.il":true,"blogspot.co.nz":true,"blogspot.co.uk":true,"blogspot.com":true,"blogspot.com.ar":true,"blogspot.com.au":true,"blogspot.com.br":true,"blogspot.com.es":true,"blogspot.com.tr":true,"blogspot.cv":true,"blogspot.cz":true,"blogspot.de":true,"blogspot.dk":true,"blogspot.fi":true,"blogspot.fr":true,"blogspot.gr":true,"blogspot.hk":true,"blogspot.hu":true,"blogspot.ie":true,"blogspot.in":true,"blogspot.it":true,"blogspot.jp":true,"blogspot.kr":true,"blogspot.mr":true,"blogspot.mx":true,"blogspot.nl":true,"blogspot.no":true,"blogspot.pt":true,"blogspot.re":true,"blogspot.ro":true,"blogspot.ru":true,"blogspot.se":true,"blogspot.sg":true,"blogspot.sk":true,"blogspot.td":true,"blogspot.tw":true,"codespot.com":true,"googleapis.com":true,"googlecode.com":true,"pagespeedmobilizer.com":true,"withgoogle.com":true,"herokuapp.com":true,"herokussl.com":true,"iki.fi":true,"biz.at":true,"info.at":true,"co.pl":true,"azurewebsites.net":true,"azure-mobile.net":true,"cloudapp.net":true,"nfshost.com":true,"nyc.mn":true,"nid.io":true,"operaunite.com":true,"outsystemscloud.com":true,"art.pl":true,"gliwice.pl":true,"krakow.pl":true,"poznan.pl":true,"wroc.pl":true,"zakopane.pl":true,"priv.at":true,"rhcloud.com":true,"sinaapp.com":true,"vipsinaapp.com":true,"1kapp.com":true,"gda.pl":true,"gdansk.pl":true,"gdynia.pl":true,"med.pl":true,"sopot.pl":true,"hk.com":true,"hk.org":true,"ltd.hk":true,"inc.hk":true,"yolasite.com":true,"za.net":true,"za.org":true}); +{"ac":true,"com.ac":true,"edu.ac":true,"gov.ac":true,"net.ac":true,"mil.ac":true,"org.ac":true,"ad":true,"nom.ad":true,"ae":true,"co.ae":true,"net.ae":true,"org.ae":true,"sch.ae":true,"ac.ae":true,"gov.ae":true,"mil.ae":true,"aero":true,"accident-investigation.aero":true,"accident-prevention.aero":true,"aerobatic.aero":true,"aeroclub.aero":true,"aerodrome.aero":true,"agents.aero":true,"aircraft.aero":true,"airline.aero":true,"airport.aero":true,"air-surveillance.aero":true,"airtraffic.aero":true,"air-traffic-control.aero":true,"ambulance.aero":true,"amusement.aero":true,"association.aero":true,"author.aero":true,"ballooning.aero":true,"broker.aero":true,"caa.aero":true,"cargo.aero":true,"catering.aero":true,"certification.aero":true,"championship.aero":true,"charter.aero":true,"civilaviation.aero":true,"club.aero":true,"conference.aero":true,"consultant.aero":true,"consulting.aero":true,"control.aero":true,"council.aero":true,"crew.aero":true,"design.aero":true,"dgca.aero":true,"educator.aero":true,"emergency.aero":true,"engine.aero":true,"engineer.aero":true,"entertainment.aero":true,"equipment.aero":true,"exchange.aero":true,"express.aero":true,"federation.aero":true,"flight.aero":true,"freight.aero":true,"fuel.aero":true,"gliding.aero":true,"government.aero":true,"groundhandling.aero":true,"group.aero":true,"hanggliding.aero":true,"homebuilt.aero":true,"insurance.aero":true,"journal.aero":true,"journalist.aero":true,"leasing.aero":true,"logistics.aero":true,"magazine.aero":true,"maintenance.aero":true,"marketplace.aero":true,"media.aero":true,"microlight.aero":true,"modelling.aero":true,"navigation.aero":true,"parachuting.aero":true,"paragliding.aero":true,"passenger-association.aero":true,"pilot.aero":true,"press.aero":true,"production.aero":true,"recreation.aero":true,"repbody.aero":true,"res.aero":true,"research.aero":true,"rotorcraft.aero":true,"safety.aero":true,"scientist.aero":true,"services.aero":true,"show.aero":true,"skydiving.aero":true,"software.aero":true,"student.aero":true,"taxi.aero":true,"trader.aero":true,"trading.aero":true,"trainer.aero":true,"union.aero":true,"workinggroup.aero":true,"works.aero":true,"af":true,"gov.af":true,"com.af":true,"org.af":true,"net.af":true,"edu.af":true,"ag":true,"com.ag":true,"org.ag":true,"net.ag":true,"co.ag":true,"nom.ag":true,"ai":true,"off.ai":true,"com.ai":true,"net.ai":true,"org.ai":true,"al":true,"com.al":true,"edu.al":true,"gov.al":true,"mil.al":true,"net.al":true,"org.al":true,"am":true,"an":true,"com.an":true,"net.an":true,"org.an":true,"edu.an":true,"ao":true,"ed.ao":true,"gv.ao":true,"og.ao":true,"co.ao":true,"pb.ao":true,"it.ao":true,"aq":true,"ar":true,"com.ar":true,"edu.ar":true,"gob.ar":true,"gov.ar":true,"int.ar":true,"mil.ar":true,"net.ar":true,"org.ar":true,"tur.ar":true,"arpa":true,"e164.arpa":true,"in-addr.arpa":true,"ip6.arpa":true,"iris.arpa":true,"uri.arpa":true,"urn.arpa":true,"as":true,"gov.as":true,"asia":true,"at":true,"ac.at":true,"co.at":true,"gv.at":true,"or.at":true,"au":true,"com.au":true,"net.au":true,"org.au":true,"edu.au":true,"gov.au":true,"asn.au":true,"id.au":true,"info.au":true,"conf.au":true,"oz.au":true,"act.au":true,"nsw.au":true,"nt.au":true,"qld.au":true,"sa.au":true,"tas.au":true,"vic.au":true,"wa.au":true,"act.edu.au":true,"nsw.edu.au":true,"nt.edu.au":true,"qld.edu.au":true,"sa.edu.au":true,"tas.edu.au":true,"vic.edu.au":true,"wa.edu.au":true,"qld.gov.au":true,"sa.gov.au":true,"tas.gov.au":true,"vic.gov.au":true,"wa.gov.au":true,"aw":true,"com.aw":true,"ax":true,"az":true,"com.az":true,"net.az":true,"int.az":true,"gov.az":true,"org.az":true,"edu.az":true,"info.az":true,"pp.az":true,"mil.az":true,"name.az":true,"pro.az":true,"biz.az":true,"ba":true,"org.ba":true,"net.ba":true,"edu.ba":true,"gov.ba":true,"mil.ba":true,"unsa.ba":true,"unbi.ba":true,"co.ba":true,"com.ba":true,"rs.ba":true,"bb":true,"biz.bb":true,"co.bb":true,"com.bb":true,"edu.bb":true,"gov.bb":true,"info.bb":true,"net.bb":true,"org.bb":true,"store.bb":true,"tv.bb":true,"*.bd":true,"be":true,"ac.be":true,"bf":true,"gov.bf":true,"bg":true,"a.bg":true,"b.bg":true,"c.bg":true,"d.bg":true,"e.bg":true,"f.bg":true,"g.bg":true,"h.bg":true,"i.bg":true,"j.bg":true,"k.bg":true,"l.bg":true,"m.bg":true,"n.bg":true,"o.bg":true,"p.bg":true,"q.bg":true,"r.bg":true,"s.bg":true,"t.bg":true,"u.bg":true,"v.bg":true,"w.bg":true,"x.bg":true,"y.bg":true,"z.bg":true,"0.bg":true,"1.bg":true,"2.bg":true,"3.bg":true,"4.bg":true,"5.bg":true,"6.bg":true,"7.bg":true,"8.bg":true,"9.bg":true,"bh":true,"com.bh":true,"edu.bh":true,"net.bh":true,"org.bh":true,"gov.bh":true,"bi":true,"co.bi":true,"com.bi":true,"edu.bi":true,"or.bi":true,"org.bi":true,"biz":true,"bj":true,"asso.bj":true,"barreau.bj":true,"gouv.bj":true,"bm":true,"com.bm":true,"edu.bm":true,"gov.bm":true,"net.bm":true,"org.bm":true,"*.bn":true,"bo":true,"com.bo":true,"edu.bo":true,"gov.bo":true,"gob.bo":true,"int.bo":true,"org.bo":true,"net.bo":true,"mil.bo":true,"tv.bo":true,"br":true,"adm.br":true,"adv.br":true,"agr.br":true,"am.br":true,"arq.br":true,"art.br":true,"ato.br":true,"b.br":true,"bio.br":true,"blog.br":true,"bmd.br":true,"cim.br":true,"cng.br":true,"cnt.br":true,"com.br":true,"coop.br":true,"ecn.br":true,"eco.br":true,"edu.br":true,"emp.br":true,"eng.br":true,"esp.br":true,"etc.br":true,"eti.br":true,"far.br":true,"flog.br":true,"fm.br":true,"fnd.br":true,"fot.br":true,"fst.br":true,"g12.br":true,"ggf.br":true,"gov.br":true,"imb.br":true,"ind.br":true,"inf.br":true,"jor.br":true,"jus.br":true,"leg.br":true,"lel.br":true,"mat.br":true,"med.br":true,"mil.br":true,"mp.br":true,"mus.br":true,"net.br":true,"*.nom.br":true,"not.br":true,"ntr.br":true,"odo.br":true,"org.br":true,"ppg.br":true,"pro.br":true,"psc.br":true,"psi.br":true,"qsl.br":true,"radio.br":true,"rec.br":true,"slg.br":true,"srv.br":true,"taxi.br":true,"teo.br":true,"tmp.br":true,"trd.br":true,"tur.br":true,"tv.br":true,"vet.br":true,"vlog.br":true,"wiki.br":true,"zlg.br":true,"bs":true,"com.bs":true,"net.bs":true,"org.bs":true,"edu.bs":true,"gov.bs":true,"bt":true,"com.bt":true,"edu.bt":true,"gov.bt":true,"net.bt":true,"org.bt":true,"bv":true,"bw":true,"co.bw":true,"org.bw":true,"by":true,"gov.by":true,"mil.by":true,"com.by":true,"of.by":true,"bz":true,"com.bz":true,"net.bz":true,"org.bz":true,"edu.bz":true,"gov.bz":true,"ca":true,"ab.ca":true,"bc.ca":true,"mb.ca":true,"nb.ca":true,"nf.ca":true,"nl.ca":true,"ns.ca":true,"nt.ca":true,"nu.ca":true,"on.ca":true,"pe.ca":true,"qc.ca":true,"sk.ca":true,"yk.ca":true,"gc.ca":true,"cat":true,"cc":true,"cd":true,"gov.cd":true,"cf":true,"cg":true,"ch":true,"ci":true,"org.ci":true,"or.ci":true,"com.ci":true,"co.ci":true,"edu.ci":true,"ed.ci":true,"ac.ci":true,"net.ci":true,"go.ci":true,"asso.ci":true,"xn--aroport-bya.ci":true,"int.ci":true,"presse.ci":true,"md.ci":true,"gouv.ci":true,"*.ck":true,"www.ck":false,"cl":true,"gov.cl":true,"gob.cl":true,"co.cl":true,"mil.cl":true,"cm":true,"co.cm":true,"com.cm":true,"gov.cm":true,"net.cm":true,"cn":true,"ac.cn":true,"com.cn":true,"edu.cn":true,"gov.cn":true,"net.cn":true,"org.cn":true,"mil.cn":true,"xn--55qx5d.cn":true,"xn--io0a7i.cn":true,"xn--od0alg.cn":true,"ah.cn":true,"bj.cn":true,"cq.cn":true,"fj.cn":true,"gd.cn":true,"gs.cn":true,"gz.cn":true,"gx.cn":true,"ha.cn":true,"hb.cn":true,"he.cn":true,"hi.cn":true,"hl.cn":true,"hn.cn":true,"jl.cn":true,"js.cn":true,"jx.cn":true,"ln.cn":true,"nm.cn":true,"nx.cn":true,"qh.cn":true,"sc.cn":true,"sd.cn":true,"sh.cn":true,"sn.cn":true,"sx.cn":true,"tj.cn":true,"xj.cn":true,"xz.cn":true,"yn.cn":true,"zj.cn":true,"hk.cn":true,"mo.cn":true,"tw.cn":true,"co":true,"arts.co":true,"com.co":true,"edu.co":true,"firm.co":true,"gov.co":true,"info.co":true,"int.co":true,"mil.co":true,"net.co":true,"nom.co":true,"org.co":true,"rec.co":true,"web.co":true,"com":true,"coop":true,"cr":true,"ac.cr":true,"co.cr":true,"ed.cr":true,"fi.cr":true,"go.cr":true,"or.cr":true,"sa.cr":true,"cu":true,"com.cu":true,"edu.cu":true,"org.cu":true,"net.cu":true,"gov.cu":true,"inf.cu":true,"cv":true,"cw":true,"com.cw":true,"edu.cw":true,"net.cw":true,"org.cw":true,"cx":true,"gov.cx":true,"ac.cy":true,"biz.cy":true,"com.cy":true,"ekloges.cy":true,"gov.cy":true,"ltd.cy":true,"name.cy":true,"net.cy":true,"org.cy":true,"parliament.cy":true,"press.cy":true,"pro.cy":true,"tm.cy":true,"cz":true,"de":true,"dj":true,"dk":true,"dm":true,"com.dm":true,"net.dm":true,"org.dm":true,"edu.dm":true,"gov.dm":true,"do":true,"art.do":true,"com.do":true,"edu.do":true,"gob.do":true,"gov.do":true,"mil.do":true,"net.do":true,"org.do":true,"sld.do":true,"web.do":true,"dz":true,"com.dz":true,"org.dz":true,"net.dz":true,"gov.dz":true,"edu.dz":true,"asso.dz":true,"pol.dz":true,"art.dz":true,"ec":true,"com.ec":true,"info.ec":true,"net.ec":true,"fin.ec":true,"k12.ec":true,"med.ec":true,"pro.ec":true,"org.ec":true,"edu.ec":true,"gov.ec":true,"gob.ec":true,"mil.ec":true,"edu":true,"ee":true,"edu.ee":true,"gov.ee":true,"riik.ee":true,"lib.ee":true,"med.ee":true,"com.ee":true,"pri.ee":true,"aip.ee":true,"org.ee":true,"fie.ee":true,"eg":true,"com.eg":true,"edu.eg":true,"eun.eg":true,"gov.eg":true,"mil.eg":true,"name.eg":true,"net.eg":true,"org.eg":true,"sci.eg":true,"*.er":true,"es":true,"com.es":true,"nom.es":true,"org.es":true,"gob.es":true,"edu.es":true,"et":true,"com.et":true,"gov.et":true,"org.et":true,"edu.et":true,"biz.et":true,"name.et":true,"info.et":true,"net.et":true,"eu":true,"fi":true,"aland.fi":true,"*.fj":true,"*.fk":true,"fm":true,"fo":true,"fr":true,"com.fr":true,"asso.fr":true,"nom.fr":true,"prd.fr":true,"presse.fr":true,"tm.fr":true,"aeroport.fr":true,"assedic.fr":true,"avocat.fr":true,"avoues.fr":true,"cci.fr":true,"chambagri.fr":true,"chirurgiens-dentistes.fr":true,"experts-comptables.fr":true,"geometre-expert.fr":true,"gouv.fr":true,"greta.fr":true,"huissier-justice.fr":true,"medecin.fr":true,"notaires.fr":true,"pharmacien.fr":true,"port.fr":true,"veterinaire.fr":true,"ga":true,"gb":true,"gd":true,"ge":true,"com.ge":true,"edu.ge":true,"gov.ge":true,"org.ge":true,"mil.ge":true,"net.ge":true,"pvt.ge":true,"gf":true,"gg":true,"co.gg":true,"net.gg":true,"org.gg":true,"gh":true,"com.gh":true,"edu.gh":true,"gov.gh":true,"org.gh":true,"mil.gh":true,"gi":true,"com.gi":true,"ltd.gi":true,"gov.gi":true,"mod.gi":true,"edu.gi":true,"org.gi":true,"gl":true,"co.gl":true,"com.gl":true,"edu.gl":true,"net.gl":true,"org.gl":true,"gm":true,"gn":true,"ac.gn":true,"com.gn":true,"edu.gn":true,"gov.gn":true,"org.gn":true,"net.gn":true,"gov":true,"gp":true,"com.gp":true,"net.gp":true,"mobi.gp":true,"edu.gp":true,"org.gp":true,"asso.gp":true,"gq":true,"gr":true,"com.gr":true,"edu.gr":true,"net.gr":true,"org.gr":true,"gov.gr":true,"gs":true,"gt":true,"com.gt":true,"edu.gt":true,"gob.gt":true,"ind.gt":true,"mil.gt":true,"net.gt":true,"org.gt":true,"*.gu":true,"gw":true,"gy":true,"co.gy":true,"com.gy":true,"net.gy":true,"hk":true,"com.hk":true,"edu.hk":true,"gov.hk":true,"idv.hk":true,"net.hk":true,"org.hk":true,"xn--55qx5d.hk":true,"xn--wcvs22d.hk":true,"xn--lcvr32d.hk":true,"xn--mxtq1m.hk":true,"xn--gmqw5a.hk":true,"xn--ciqpn.hk":true,"xn--gmq050i.hk":true,"xn--zf0avx.hk":true,"xn--io0a7i.hk":true,"xn--mk0axi.hk":true,"xn--od0alg.hk":true,"xn--od0aq3b.hk":true,"xn--tn0ag.hk":true,"xn--uc0atv.hk":true,"xn--uc0ay4a.hk":true,"hm":true,"hn":true,"com.hn":true,"edu.hn":true,"org.hn":true,"net.hn":true,"mil.hn":true,"gob.hn":true,"hr":true,"iz.hr":true,"from.hr":true,"name.hr":true,"com.hr":true,"ht":true,"com.ht":true,"shop.ht":true,"firm.ht":true,"info.ht":true,"adult.ht":true,"net.ht":true,"pro.ht":true,"org.ht":true,"med.ht":true,"art.ht":true,"coop.ht":true,"pol.ht":true,"asso.ht":true,"edu.ht":true,"rel.ht":true,"gouv.ht":true,"perso.ht":true,"hu":true,"co.hu":true,"info.hu":true,"org.hu":true,"priv.hu":true,"sport.hu":true,"tm.hu":true,"2000.hu":true,"agrar.hu":true,"bolt.hu":true,"casino.hu":true,"city.hu":true,"erotica.hu":true,"erotika.hu":true,"film.hu":true,"forum.hu":true,"games.hu":true,"hotel.hu":true,"ingatlan.hu":true,"jogasz.hu":true,"konyvelo.hu":true,"lakas.hu":true,"media.hu":true,"news.hu":true,"reklam.hu":true,"sex.hu":true,"shop.hu":true,"suli.hu":true,"szex.hu":true,"tozsde.hu":true,"utazas.hu":true,"video.hu":true,"id":true,"ac.id":true,"biz.id":true,"co.id":true,"desa.id":true,"go.id":true,"mil.id":true,"my.id":true,"net.id":true,"or.id":true,"sch.id":true,"web.id":true,"ie":true,"gov.ie":true,"il":true,"ac.il":true,"co.il":true,"gov.il":true,"idf.il":true,"k12.il":true,"muni.il":true,"net.il":true,"org.il":true,"im":true,"ac.im":true,"co.im":true,"com.im":true,"ltd.co.im":true,"net.im":true,"org.im":true,"plc.co.im":true,"tt.im":true,"tv.im":true,"in":true,"co.in":true,"firm.in":true,"net.in":true,"org.in":true,"gen.in":true,"ind.in":true,"nic.in":true,"ac.in":true,"edu.in":true,"res.in":true,"gov.in":true,"mil.in":true,"info":true,"int":true,"eu.int":true,"io":true,"com.io":true,"iq":true,"gov.iq":true,"edu.iq":true,"mil.iq":true,"com.iq":true,"org.iq":true,"net.iq":true,"ir":true,"ac.ir":true,"co.ir":true,"gov.ir":true,"id.ir":true,"net.ir":true,"org.ir":true,"sch.ir":true,"xn--mgba3a4f16a.ir":true,"xn--mgba3a4fra.ir":true,"is":true,"net.is":true,"com.is":true,"edu.is":true,"gov.is":true,"org.is":true,"int.is":true,"it":true,"gov.it":true,"edu.it":true,"abr.it":true,"abruzzo.it":true,"aosta-valley.it":true,"aostavalley.it":true,"bas.it":true,"basilicata.it":true,"cal.it":true,"calabria.it":true,"cam.it":true,"campania.it":true,"emilia-romagna.it":true,"emiliaromagna.it":true,"emr.it":true,"friuli-v-giulia.it":true,"friuli-ve-giulia.it":true,"friuli-vegiulia.it":true,"friuli-venezia-giulia.it":true,"friuli-veneziagiulia.it":true,"friuli-vgiulia.it":true,"friuliv-giulia.it":true,"friulive-giulia.it":true,"friulivegiulia.it":true,"friulivenezia-giulia.it":true,"friuliveneziagiulia.it":true,"friulivgiulia.it":true,"fvg.it":true,"laz.it":true,"lazio.it":true,"lig.it":true,"liguria.it":true,"lom.it":true,"lombardia.it":true,"lombardy.it":true,"lucania.it":true,"mar.it":true,"marche.it":true,"mol.it":true,"molise.it":true,"piedmont.it":true,"piemonte.it":true,"pmn.it":true,"pug.it":true,"puglia.it":true,"sar.it":true,"sardegna.it":true,"sardinia.it":true,"sic.it":true,"sicilia.it":true,"sicily.it":true,"taa.it":true,"tos.it":true,"toscana.it":true,"trentino-a-adige.it":true,"trentino-aadige.it":true,"trentino-alto-adige.it":true,"trentino-altoadige.it":true,"trentino-s-tirol.it":true,"trentino-stirol.it":true,"trentino-sud-tirol.it":true,"trentino-sudtirol.it":true,"trentino-sued-tirol.it":true,"trentino-suedtirol.it":true,"trentinoa-adige.it":true,"trentinoaadige.it":true,"trentinoalto-adige.it":true,"trentinoaltoadige.it":true,"trentinos-tirol.it":true,"trentinostirol.it":true,"trentinosud-tirol.it":true,"trentinosudtirol.it":true,"trentinosued-tirol.it":true,"trentinosuedtirol.it":true,"tuscany.it":true,"umb.it":true,"umbria.it":true,"val-d-aosta.it":true,"val-daosta.it":true,"vald-aosta.it":true,"valdaosta.it":true,"valle-aosta.it":true,"valle-d-aosta.it":true,"valle-daosta.it":true,"valleaosta.it":true,"valled-aosta.it":true,"valledaosta.it":true,"vallee-aoste.it":true,"valleeaoste.it":true,"vao.it":true,"vda.it":true,"ven.it":true,"veneto.it":true,"ag.it":true,"agrigento.it":true,"al.it":true,"alessandria.it":true,"alto-adige.it":true,"altoadige.it":true,"an.it":true,"ancona.it":true,"andria-barletta-trani.it":true,"andria-trani-barletta.it":true,"andriabarlettatrani.it":true,"andriatranibarletta.it":true,"ao.it":true,"aosta.it":true,"aoste.it":true,"ap.it":true,"aq.it":true,"aquila.it":true,"ar.it":true,"arezzo.it":true,"ascoli-piceno.it":true,"ascolipiceno.it":true,"asti.it":true,"at.it":true,"av.it":true,"avellino.it":true,"ba.it":true,"balsan.it":true,"bari.it":true,"barletta-trani-andria.it":true,"barlettatraniandria.it":true,"belluno.it":true,"benevento.it":true,"bergamo.it":true,"bg.it":true,"bi.it":true,"biella.it":true,"bl.it":true,"bn.it":true,"bo.it":true,"bologna.it":true,"bolzano.it":true,"bozen.it":true,"br.it":true,"brescia.it":true,"brindisi.it":true,"bs.it":true,"bt.it":true,"bz.it":true,"ca.it":true,"cagliari.it":true,"caltanissetta.it":true,"campidano-medio.it":true,"campidanomedio.it":true,"campobasso.it":true,"carbonia-iglesias.it":true,"carboniaiglesias.it":true,"carrara-massa.it":true,"carraramassa.it":true,"caserta.it":true,"catania.it":true,"catanzaro.it":true,"cb.it":true,"ce.it":true,"cesena-forli.it":true,"cesenaforli.it":true,"ch.it":true,"chieti.it":true,"ci.it":true,"cl.it":true,"cn.it":true,"co.it":true,"como.it":true,"cosenza.it":true,"cr.it":true,"cremona.it":true,"crotone.it":true,"cs.it":true,"ct.it":true,"cuneo.it":true,"cz.it":true,"dell-ogliastra.it":true,"dellogliastra.it":true,"en.it":true,"enna.it":true,"fc.it":true,"fe.it":true,"fermo.it":true,"ferrara.it":true,"fg.it":true,"fi.it":true,"firenze.it":true,"florence.it":true,"fm.it":true,"foggia.it":true,"forli-cesena.it":true,"forlicesena.it":true,"fr.it":true,"frosinone.it":true,"ge.it":true,"genoa.it":true,"genova.it":true,"go.it":true,"gorizia.it":true,"gr.it":true,"grosseto.it":true,"iglesias-carbonia.it":true,"iglesiascarbonia.it":true,"im.it":true,"imperia.it":true,"is.it":true,"isernia.it":true,"kr.it":true,"la-spezia.it":true,"laquila.it":true,"laspezia.it":true,"latina.it":true,"lc.it":true,"le.it":true,"lecce.it":true,"lecco.it":true,"li.it":true,"livorno.it":true,"lo.it":true,"lodi.it":true,"lt.it":true,"lu.it":true,"lucca.it":true,"macerata.it":true,"mantova.it":true,"massa-carrara.it":true,"massacarrara.it":true,"matera.it":true,"mb.it":true,"mc.it":true,"me.it":true,"medio-campidano.it":true,"mediocampidano.it":true,"messina.it":true,"mi.it":true,"milan.it":true,"milano.it":true,"mn.it":true,"mo.it":true,"modena.it":true,"monza-brianza.it":true,"monza-e-della-brianza.it":true,"monza.it":true,"monzabrianza.it":true,"monzaebrianza.it":true,"monzaedellabrianza.it":true,"ms.it":true,"mt.it":true,"na.it":true,"naples.it":true,"napoli.it":true,"no.it":true,"novara.it":true,"nu.it":true,"nuoro.it":true,"og.it":true,"ogliastra.it":true,"olbia-tempio.it":true,"olbiatempio.it":true,"or.it":true,"oristano.it":true,"ot.it":true,"pa.it":true,"padova.it":true,"padua.it":true,"palermo.it":true,"parma.it":true,"pavia.it":true,"pc.it":true,"pd.it":true,"pe.it":true,"perugia.it":true,"pesaro-urbino.it":true,"pesarourbino.it":true,"pescara.it":true,"pg.it":true,"pi.it":true,"piacenza.it":true,"pisa.it":true,"pistoia.it":true,"pn.it":true,"po.it":true,"pordenone.it":true,"potenza.it":true,"pr.it":true,"prato.it":true,"pt.it":true,"pu.it":true,"pv.it":true,"pz.it":true,"ra.it":true,"ragusa.it":true,"ravenna.it":true,"rc.it":true,"re.it":true,"reggio-calabria.it":true,"reggio-emilia.it":true,"reggiocalabria.it":true,"reggioemilia.it":true,"rg.it":true,"ri.it":true,"rieti.it":true,"rimini.it":true,"rm.it":true,"rn.it":true,"ro.it":true,"roma.it":true,"rome.it":true,"rovigo.it":true,"sa.it":true,"salerno.it":true,"sassari.it":true,"savona.it":true,"si.it":true,"siena.it":true,"siracusa.it":true,"so.it":true,"sondrio.it":true,"sp.it":true,"sr.it":true,"ss.it":true,"suedtirol.it":true,"sv.it":true,"ta.it":true,"taranto.it":true,"te.it":true,"tempio-olbia.it":true,"tempioolbia.it":true,"teramo.it":true,"terni.it":true,"tn.it":true,"to.it":true,"torino.it":true,"tp.it":true,"tr.it":true,"trani-andria-barletta.it":true,"trani-barletta-andria.it":true,"traniandriabarletta.it":true,"tranibarlettaandria.it":true,"trapani.it":true,"trentino.it":true,"trento.it":true,"treviso.it":true,"trieste.it":true,"ts.it":true,"turin.it":true,"tv.it":true,"ud.it":true,"udine.it":true,"urbino-pesaro.it":true,"urbinopesaro.it":true,"va.it":true,"varese.it":true,"vb.it":true,"vc.it":true,"ve.it":true,"venezia.it":true,"venice.it":true,"verbania.it":true,"vercelli.it":true,"verona.it":true,"vi.it":true,"vibo-valentia.it":true,"vibovalentia.it":true,"vicenza.it":true,"viterbo.it":true,"vr.it":true,"vs.it":true,"vt.it":true,"vv.it":true,"je":true,"co.je":true,"net.je":true,"org.je":true,"*.jm":true,"jo":true,"com.jo":true,"org.jo":true,"net.jo":true,"edu.jo":true,"sch.jo":true,"gov.jo":true,"mil.jo":true,"name.jo":true,"jobs":true,"jp":true,"ac.jp":true,"ad.jp":true,"co.jp":true,"ed.jp":true,"go.jp":true,"gr.jp":true,"lg.jp":true,"ne.jp":true,"or.jp":true,"aichi.jp":true,"akita.jp":true,"aomori.jp":true,"chiba.jp":true,"ehime.jp":true,"fukui.jp":true,"fukuoka.jp":true,"fukushima.jp":true,"gifu.jp":true,"gunma.jp":true,"hiroshima.jp":true,"hokkaido.jp":true,"hyogo.jp":true,"ibaraki.jp":true,"ishikawa.jp":true,"iwate.jp":true,"kagawa.jp":true,"kagoshima.jp":true,"kanagawa.jp":true,"kochi.jp":true,"kumamoto.jp":true,"kyoto.jp":true,"mie.jp":true,"miyagi.jp":true,"miyazaki.jp":true,"nagano.jp":true,"nagasaki.jp":true,"nara.jp":true,"niigata.jp":true,"oita.jp":true,"okayama.jp":true,"okinawa.jp":true,"osaka.jp":true,"saga.jp":true,"saitama.jp":true,"shiga.jp":true,"shimane.jp":true,"shizuoka.jp":true,"tochigi.jp":true,"tokushima.jp":true,"tokyo.jp":true,"tottori.jp":true,"toyama.jp":true,"wakayama.jp":true,"yamagata.jp":true,"yamaguchi.jp":true,"yamanashi.jp":true,"xn--4pvxs.jp":true,"xn--vgu402c.jp":true,"xn--c3s14m.jp":true,"xn--f6qx53a.jp":true,"xn--8pvr4u.jp":true,"xn--uist22h.jp":true,"xn--djrs72d6uy.jp":true,"xn--mkru45i.jp":true,"xn--0trq7p7nn.jp":true,"xn--8ltr62k.jp":true,"xn--2m4a15e.jp":true,"xn--efvn9s.jp":true,"xn--32vp30h.jp":true,"xn--4it797k.jp":true,"xn--1lqs71d.jp":true,"xn--5rtp49c.jp":true,"xn--5js045d.jp":true,"xn--ehqz56n.jp":true,"xn--1lqs03n.jp":true,"xn--qqqt11m.jp":true,"xn--kbrq7o.jp":true,"xn--pssu33l.jp":true,"xn--ntsq17g.jp":true,"xn--uisz3g.jp":true,"xn--6btw5a.jp":true,"xn--1ctwo.jp":true,"xn--6orx2r.jp":true,"xn--rht61e.jp":true,"xn--rht27z.jp":true,"xn--djty4k.jp":true,"xn--nit225k.jp":true,"xn--rht3d.jp":true,"xn--klty5x.jp":true,"xn--kltx9a.jp":true,"xn--kltp7d.jp":true,"xn--uuwu58a.jp":true,"xn--zbx025d.jp":true,"xn--ntso0iqx3a.jp":true,"xn--elqq16h.jp":true,"xn--4it168d.jp":true,"xn--klt787d.jp":true,"xn--rny31h.jp":true,"xn--7t0a264c.jp":true,"xn--5rtq34k.jp":true,"xn--k7yn95e.jp":true,"xn--tor131o.jp":true,"xn--d5qv7z876c.jp":true,"*.kawasaki.jp":true,"*.kitakyushu.jp":true,"*.kobe.jp":true,"*.nagoya.jp":true,"*.sapporo.jp":true,"*.sendai.jp":true,"*.yokohama.jp":true,"city.kawasaki.jp":false,"city.kitakyushu.jp":false,"city.kobe.jp":false,"city.nagoya.jp":false,"city.sapporo.jp":false,"city.sendai.jp":false,"city.yokohama.jp":false,"aisai.aichi.jp":true,"ama.aichi.jp":true,"anjo.aichi.jp":true,"asuke.aichi.jp":true,"chiryu.aichi.jp":true,"chita.aichi.jp":true,"fuso.aichi.jp":true,"gamagori.aichi.jp":true,"handa.aichi.jp":true,"hazu.aichi.jp":true,"hekinan.aichi.jp":true,"higashiura.aichi.jp":true,"ichinomiya.aichi.jp":true,"inazawa.aichi.jp":true,"inuyama.aichi.jp":true,"isshiki.aichi.jp":true,"iwakura.aichi.jp":true,"kanie.aichi.jp":true,"kariya.aichi.jp":true,"kasugai.aichi.jp":true,"kira.aichi.jp":true,"kiyosu.aichi.jp":true,"komaki.aichi.jp":true,"konan.aichi.jp":true,"kota.aichi.jp":true,"mihama.aichi.jp":true,"miyoshi.aichi.jp":true,"nishio.aichi.jp":true,"nisshin.aichi.jp":true,"obu.aichi.jp":true,"oguchi.aichi.jp":true,"oharu.aichi.jp":true,"okazaki.aichi.jp":true,"owariasahi.aichi.jp":true,"seto.aichi.jp":true,"shikatsu.aichi.jp":true,"shinshiro.aichi.jp":true,"shitara.aichi.jp":true,"tahara.aichi.jp":true,"takahama.aichi.jp":true,"tobishima.aichi.jp":true,"toei.aichi.jp":true,"togo.aichi.jp":true,"tokai.aichi.jp":true,"tokoname.aichi.jp":true,"toyoake.aichi.jp":true,"toyohashi.aichi.jp":true,"toyokawa.aichi.jp":true,"toyone.aichi.jp":true,"toyota.aichi.jp":true,"tsushima.aichi.jp":true,"yatomi.aichi.jp":true,"akita.akita.jp":true,"daisen.akita.jp":true,"fujisato.akita.jp":true,"gojome.akita.jp":true,"hachirogata.akita.jp":true,"happou.akita.jp":true,"higashinaruse.akita.jp":true,"honjo.akita.jp":true,"honjyo.akita.jp":true,"ikawa.akita.jp":true,"kamikoani.akita.jp":true,"kamioka.akita.jp":true,"katagami.akita.jp":true,"kazuno.akita.jp":true,"kitaakita.akita.jp":true,"kosaka.akita.jp":true,"kyowa.akita.jp":true,"misato.akita.jp":true,"mitane.akita.jp":true,"moriyoshi.akita.jp":true,"nikaho.akita.jp":true,"noshiro.akita.jp":true,"odate.akita.jp":true,"oga.akita.jp":true,"ogata.akita.jp":true,"semboku.akita.jp":true,"yokote.akita.jp":true,"yurihonjo.akita.jp":true,"aomori.aomori.jp":true,"gonohe.aomori.jp":true,"hachinohe.aomori.jp":true,"hashikami.aomori.jp":true,"hiranai.aomori.jp":true,"hirosaki.aomori.jp":true,"itayanagi.aomori.jp":true,"kuroishi.aomori.jp":true,"misawa.aomori.jp":true,"mutsu.aomori.jp":true,"nakadomari.aomori.jp":true,"noheji.aomori.jp":true,"oirase.aomori.jp":true,"owani.aomori.jp":true,"rokunohe.aomori.jp":true,"sannohe.aomori.jp":true,"shichinohe.aomori.jp":true,"shingo.aomori.jp":true,"takko.aomori.jp":true,"towada.aomori.jp":true,"tsugaru.aomori.jp":true,"tsuruta.aomori.jp":true,"abiko.chiba.jp":true,"asahi.chiba.jp":true,"chonan.chiba.jp":true,"chosei.chiba.jp":true,"choshi.chiba.jp":true,"chuo.chiba.jp":true,"funabashi.chiba.jp":true,"futtsu.chiba.jp":true,"hanamigawa.chiba.jp":true,"ichihara.chiba.jp":true,"ichikawa.chiba.jp":true,"ichinomiya.chiba.jp":true,"inzai.chiba.jp":true,"isumi.chiba.jp":true,"kamagaya.chiba.jp":true,"kamogawa.chiba.jp":true,"kashiwa.chiba.jp":true,"katori.chiba.jp":true,"katsuura.chiba.jp":true,"kimitsu.chiba.jp":true,"kisarazu.chiba.jp":true,"kozaki.chiba.jp":true,"kujukuri.chiba.jp":true,"kyonan.chiba.jp":true,"matsudo.chiba.jp":true,"midori.chiba.jp":true,"mihama.chiba.jp":true,"minamiboso.chiba.jp":true,"mobara.chiba.jp":true,"mutsuzawa.chiba.jp":true,"nagara.chiba.jp":true,"nagareyama.chiba.jp":true,"narashino.chiba.jp":true,"narita.chiba.jp":true,"noda.chiba.jp":true,"oamishirasato.chiba.jp":true,"omigawa.chiba.jp":true,"onjuku.chiba.jp":true,"otaki.chiba.jp":true,"sakae.chiba.jp":true,"sakura.chiba.jp":true,"shimofusa.chiba.jp":true,"shirako.chiba.jp":true,"shiroi.chiba.jp":true,"shisui.chiba.jp":true,"sodegaura.chiba.jp":true,"sosa.chiba.jp":true,"tako.chiba.jp":true,"tateyama.chiba.jp":true,"togane.chiba.jp":true,"tohnosho.chiba.jp":true,"tomisato.chiba.jp":true,"urayasu.chiba.jp":true,"yachimata.chiba.jp":true,"yachiyo.chiba.jp":true,"yokaichiba.chiba.jp":true,"yokoshibahikari.chiba.jp":true,"yotsukaido.chiba.jp":true,"ainan.ehime.jp":true,"honai.ehime.jp":true,"ikata.ehime.jp":true,"imabari.ehime.jp":true,"iyo.ehime.jp":true,"kamijima.ehime.jp":true,"kihoku.ehime.jp":true,"kumakogen.ehime.jp":true,"masaki.ehime.jp":true,"matsuno.ehime.jp":true,"matsuyama.ehime.jp":true,"namikata.ehime.jp":true,"niihama.ehime.jp":true,"ozu.ehime.jp":true,"saijo.ehime.jp":true,"seiyo.ehime.jp":true,"shikokuchuo.ehime.jp":true,"tobe.ehime.jp":true,"toon.ehime.jp":true,"uchiko.ehime.jp":true,"uwajima.ehime.jp":true,"yawatahama.ehime.jp":true,"echizen.fukui.jp":true,"eiheiji.fukui.jp":true,"fukui.fukui.jp":true,"ikeda.fukui.jp":true,"katsuyama.fukui.jp":true,"mihama.fukui.jp":true,"minamiechizen.fukui.jp":true,"obama.fukui.jp":true,"ohi.fukui.jp":true,"ono.fukui.jp":true,"sabae.fukui.jp":true,"sakai.fukui.jp":true,"takahama.fukui.jp":true,"tsuruga.fukui.jp":true,"wakasa.fukui.jp":true,"ashiya.fukuoka.jp":true,"buzen.fukuoka.jp":true,"chikugo.fukuoka.jp":true,"chikuho.fukuoka.jp":true,"chikujo.fukuoka.jp":true,"chikushino.fukuoka.jp":true,"chikuzen.fukuoka.jp":true,"chuo.fukuoka.jp":true,"dazaifu.fukuoka.jp":true,"fukuchi.fukuoka.jp":true,"hakata.fukuoka.jp":true,"higashi.fukuoka.jp":true,"hirokawa.fukuoka.jp":true,"hisayama.fukuoka.jp":true,"iizuka.fukuoka.jp":true,"inatsuki.fukuoka.jp":true,"kaho.fukuoka.jp":true,"kasuga.fukuoka.jp":true,"kasuya.fukuoka.jp":true,"kawara.fukuoka.jp":true,"keisen.fukuoka.jp":true,"koga.fukuoka.jp":true,"kurate.fukuoka.jp":true,"kurogi.fukuoka.jp":true,"kurume.fukuoka.jp":true,"minami.fukuoka.jp":true,"miyako.fukuoka.jp":true,"miyama.fukuoka.jp":true,"miyawaka.fukuoka.jp":true,"mizumaki.fukuoka.jp":true,"munakata.fukuoka.jp":true,"nakagawa.fukuoka.jp":true,"nakama.fukuoka.jp":true,"nishi.fukuoka.jp":true,"nogata.fukuoka.jp":true,"ogori.fukuoka.jp":true,"okagaki.fukuoka.jp":true,"okawa.fukuoka.jp":true,"oki.fukuoka.jp":true,"omuta.fukuoka.jp":true,"onga.fukuoka.jp":true,"onojo.fukuoka.jp":true,"oto.fukuoka.jp":true,"saigawa.fukuoka.jp":true,"sasaguri.fukuoka.jp":true,"shingu.fukuoka.jp":true,"shinyoshitomi.fukuoka.jp":true,"shonai.fukuoka.jp":true,"soeda.fukuoka.jp":true,"sue.fukuoka.jp":true,"tachiarai.fukuoka.jp":true,"tagawa.fukuoka.jp":true,"takata.fukuoka.jp":true,"toho.fukuoka.jp":true,"toyotsu.fukuoka.jp":true,"tsuiki.fukuoka.jp":true,"ukiha.fukuoka.jp":true,"umi.fukuoka.jp":true,"usui.fukuoka.jp":true,"yamada.fukuoka.jp":true,"yame.fukuoka.jp":true,"yanagawa.fukuoka.jp":true,"yukuhashi.fukuoka.jp":true,"aizubange.fukushima.jp":true,"aizumisato.fukushima.jp":true,"aizuwakamatsu.fukushima.jp":true,"asakawa.fukushima.jp":true,"bandai.fukushima.jp":true,"date.fukushima.jp":true,"fukushima.fukushima.jp":true,"furudono.fukushima.jp":true,"futaba.fukushima.jp":true,"hanawa.fukushima.jp":true,"higashi.fukushima.jp":true,"hirata.fukushima.jp":true,"hirono.fukushima.jp":true,"iitate.fukushima.jp":true,"inawashiro.fukushima.jp":true,"ishikawa.fukushima.jp":true,"iwaki.fukushima.jp":true,"izumizaki.fukushima.jp":true,"kagamiishi.fukushima.jp":true,"kaneyama.fukushima.jp":true,"kawamata.fukushima.jp":true,"kitakata.fukushima.jp":true,"kitashiobara.fukushima.jp":true,"koori.fukushima.jp":true,"koriyama.fukushima.jp":true,"kunimi.fukushima.jp":true,"miharu.fukushima.jp":true,"mishima.fukushima.jp":true,"namie.fukushima.jp":true,"nango.fukushima.jp":true,"nishiaizu.fukushima.jp":true,"nishigo.fukushima.jp":true,"okuma.fukushima.jp":true,"omotego.fukushima.jp":true,"ono.fukushima.jp":true,"otama.fukushima.jp":true,"samegawa.fukushima.jp":true,"shimogo.fukushima.jp":true,"shirakawa.fukushima.jp":true,"showa.fukushima.jp":true,"soma.fukushima.jp":true,"sukagawa.fukushima.jp":true,"taishin.fukushima.jp":true,"tamakawa.fukushima.jp":true,"tanagura.fukushima.jp":true,"tenei.fukushima.jp":true,"yabuki.fukushima.jp":true,"yamato.fukushima.jp":true,"yamatsuri.fukushima.jp":true,"yanaizu.fukushima.jp":true,"yugawa.fukushima.jp":true,"anpachi.gifu.jp":true,"ena.gifu.jp":true,"gifu.gifu.jp":true,"ginan.gifu.jp":true,"godo.gifu.jp":true,"gujo.gifu.jp":true,"hashima.gifu.jp":true,"hichiso.gifu.jp":true,"hida.gifu.jp":true,"higashishirakawa.gifu.jp":true,"ibigawa.gifu.jp":true,"ikeda.gifu.jp":true,"kakamigahara.gifu.jp":true,"kani.gifu.jp":true,"kasahara.gifu.jp":true,"kasamatsu.gifu.jp":true,"kawaue.gifu.jp":true,"kitagata.gifu.jp":true,"mino.gifu.jp":true,"minokamo.gifu.jp":true,"mitake.gifu.jp":true,"mizunami.gifu.jp":true,"motosu.gifu.jp":true,"nakatsugawa.gifu.jp":true,"ogaki.gifu.jp":true,"sakahogi.gifu.jp":true,"seki.gifu.jp":true,"sekigahara.gifu.jp":true,"shirakawa.gifu.jp":true,"tajimi.gifu.jp":true,"takayama.gifu.jp":true,"tarui.gifu.jp":true,"toki.gifu.jp":true,"tomika.gifu.jp":true,"wanouchi.gifu.jp":true,"yamagata.gifu.jp":true,"yaotsu.gifu.jp":true,"yoro.gifu.jp":true,"annaka.gunma.jp":true,"chiyoda.gunma.jp":true,"fujioka.gunma.jp":true,"higashiagatsuma.gunma.jp":true,"isesaki.gunma.jp":true,"itakura.gunma.jp":true,"kanna.gunma.jp":true,"kanra.gunma.jp":true,"katashina.gunma.jp":true,"kawaba.gunma.jp":true,"kiryu.gunma.jp":true,"kusatsu.gunma.jp":true,"maebashi.gunma.jp":true,"meiwa.gunma.jp":true,"midori.gunma.jp":true,"minakami.gunma.jp":true,"naganohara.gunma.jp":true,"nakanojo.gunma.jp":true,"nanmoku.gunma.jp":true,"numata.gunma.jp":true,"oizumi.gunma.jp":true,"ora.gunma.jp":true,"ota.gunma.jp":true,"shibukawa.gunma.jp":true,"shimonita.gunma.jp":true,"shinto.gunma.jp":true,"showa.gunma.jp":true,"takasaki.gunma.jp":true,"takayama.gunma.jp":true,"tamamura.gunma.jp":true,"tatebayashi.gunma.jp":true,"tomioka.gunma.jp":true,"tsukiyono.gunma.jp":true,"tsumagoi.gunma.jp":true,"ueno.gunma.jp":true,"yoshioka.gunma.jp":true,"asaminami.hiroshima.jp":true,"daiwa.hiroshima.jp":true,"etajima.hiroshima.jp":true,"fuchu.hiroshima.jp":true,"fukuyama.hiroshima.jp":true,"hatsukaichi.hiroshima.jp":true,"higashihiroshima.hiroshima.jp":true,"hongo.hiroshima.jp":true,"jinsekikogen.hiroshima.jp":true,"kaita.hiroshima.jp":true,"kui.hiroshima.jp":true,"kumano.hiroshima.jp":true,"kure.hiroshima.jp":true,"mihara.hiroshima.jp":true,"miyoshi.hiroshima.jp":true,"naka.hiroshima.jp":true,"onomichi.hiroshima.jp":true,"osakikamijima.hiroshima.jp":true,"otake.hiroshima.jp":true,"saka.hiroshima.jp":true,"sera.hiroshima.jp":true,"seranishi.hiroshima.jp":true,"shinichi.hiroshima.jp":true,"shobara.hiroshima.jp":true,"takehara.hiroshima.jp":true,"abashiri.hokkaido.jp":true,"abira.hokkaido.jp":true,"aibetsu.hokkaido.jp":true,"akabira.hokkaido.jp":true,"akkeshi.hokkaido.jp":true,"asahikawa.hokkaido.jp":true,"ashibetsu.hokkaido.jp":true,"ashoro.hokkaido.jp":true,"assabu.hokkaido.jp":true,"atsuma.hokkaido.jp":true,"bibai.hokkaido.jp":true,"biei.hokkaido.jp":true,"bifuka.hokkaido.jp":true,"bihoro.hokkaido.jp":true,"biratori.hokkaido.jp":true,"chippubetsu.hokkaido.jp":true,"chitose.hokkaido.jp":true,"date.hokkaido.jp":true,"ebetsu.hokkaido.jp":true,"embetsu.hokkaido.jp":true,"eniwa.hokkaido.jp":true,"erimo.hokkaido.jp":true,"esan.hokkaido.jp":true,"esashi.hokkaido.jp":true,"fukagawa.hokkaido.jp":true,"fukushima.hokkaido.jp":true,"furano.hokkaido.jp":true,"furubira.hokkaido.jp":true,"haboro.hokkaido.jp":true,"hakodate.hokkaido.jp":true,"hamatonbetsu.hokkaido.jp":true,"hidaka.hokkaido.jp":true,"higashikagura.hokkaido.jp":true,"higashikawa.hokkaido.jp":true,"hiroo.hokkaido.jp":true,"hokuryu.hokkaido.jp":true,"hokuto.hokkaido.jp":true,"honbetsu.hokkaido.jp":true,"horokanai.hokkaido.jp":true,"horonobe.hokkaido.jp":true,"ikeda.hokkaido.jp":true,"imakane.hokkaido.jp":true,"ishikari.hokkaido.jp":true,"iwamizawa.hokkaido.jp":true,"iwanai.hokkaido.jp":true,"kamifurano.hokkaido.jp":true,"kamikawa.hokkaido.jp":true,"kamishihoro.hokkaido.jp":true,"kamisunagawa.hokkaido.jp":true,"kamoenai.hokkaido.jp":true,"kayabe.hokkaido.jp":true,"kembuchi.hokkaido.jp":true,"kikonai.hokkaido.jp":true,"kimobetsu.hokkaido.jp":true,"kitahiroshima.hokkaido.jp":true,"kitami.hokkaido.jp":true,"kiyosato.hokkaido.jp":true,"koshimizu.hokkaido.jp":true,"kunneppu.hokkaido.jp":true,"kuriyama.hokkaido.jp":true,"kuromatsunai.hokkaido.jp":true,"kushiro.hokkaido.jp":true,"kutchan.hokkaido.jp":true,"kyowa.hokkaido.jp":true,"mashike.hokkaido.jp":true,"matsumae.hokkaido.jp":true,"mikasa.hokkaido.jp":true,"minamifurano.hokkaido.jp":true,"mombetsu.hokkaido.jp":true,"moseushi.hokkaido.jp":true,"mukawa.hokkaido.jp":true,"muroran.hokkaido.jp":true,"naie.hokkaido.jp":true,"nakagawa.hokkaido.jp":true,"nakasatsunai.hokkaido.jp":true,"nakatombetsu.hokkaido.jp":true,"nanae.hokkaido.jp":true,"nanporo.hokkaido.jp":true,"nayoro.hokkaido.jp":true,"nemuro.hokkaido.jp":true,"niikappu.hokkaido.jp":true,"niki.hokkaido.jp":true,"nishiokoppe.hokkaido.jp":true,"noboribetsu.hokkaido.jp":true,"numata.hokkaido.jp":true,"obihiro.hokkaido.jp":true,"obira.hokkaido.jp":true,"oketo.hokkaido.jp":true,"okoppe.hokkaido.jp":true,"otaru.hokkaido.jp":true,"otobe.hokkaido.jp":true,"otofuke.hokkaido.jp":true,"otoineppu.hokkaido.jp":true,"oumu.hokkaido.jp":true,"ozora.hokkaido.jp":true,"pippu.hokkaido.jp":true,"rankoshi.hokkaido.jp":true,"rebun.hokkaido.jp":true,"rikubetsu.hokkaido.jp":true,"rishiri.hokkaido.jp":true,"rishirifuji.hokkaido.jp":true,"saroma.hokkaido.jp":true,"sarufutsu.hokkaido.jp":true,"shakotan.hokkaido.jp":true,"shari.hokkaido.jp":true,"shibecha.hokkaido.jp":true,"shibetsu.hokkaido.jp":true,"shikabe.hokkaido.jp":true,"shikaoi.hokkaido.jp":true,"shimamaki.hokkaido.jp":true,"shimizu.hokkaido.jp":true,"shimokawa.hokkaido.jp":true,"shinshinotsu.hokkaido.jp":true,"shintoku.hokkaido.jp":true,"shiranuka.hokkaido.jp":true,"shiraoi.hokkaido.jp":true,"shiriuchi.hokkaido.jp":true,"sobetsu.hokkaido.jp":true,"sunagawa.hokkaido.jp":true,"taiki.hokkaido.jp":true,"takasu.hokkaido.jp":true,"takikawa.hokkaido.jp":true,"takinoue.hokkaido.jp":true,"teshikaga.hokkaido.jp":true,"tobetsu.hokkaido.jp":true,"tohma.hokkaido.jp":true,"tomakomai.hokkaido.jp":true,"tomari.hokkaido.jp":true,"toya.hokkaido.jp":true,"toyako.hokkaido.jp":true,"toyotomi.hokkaido.jp":true,"toyoura.hokkaido.jp":true,"tsubetsu.hokkaido.jp":true,"tsukigata.hokkaido.jp":true,"urakawa.hokkaido.jp":true,"urausu.hokkaido.jp":true,"uryu.hokkaido.jp":true,"utashinai.hokkaido.jp":true,"wakkanai.hokkaido.jp":true,"wassamu.hokkaido.jp":true,"yakumo.hokkaido.jp":true,"yoichi.hokkaido.jp":true,"aioi.hyogo.jp":true,"akashi.hyogo.jp":true,"ako.hyogo.jp":true,"amagasaki.hyogo.jp":true,"aogaki.hyogo.jp":true,"asago.hyogo.jp":true,"ashiya.hyogo.jp":true,"awaji.hyogo.jp":true,"fukusaki.hyogo.jp":true,"goshiki.hyogo.jp":true,"harima.hyogo.jp":true,"himeji.hyogo.jp":true,"ichikawa.hyogo.jp":true,"inagawa.hyogo.jp":true,"itami.hyogo.jp":true,"kakogawa.hyogo.jp":true,"kamigori.hyogo.jp":true,"kamikawa.hyogo.jp":true,"kasai.hyogo.jp":true,"kasuga.hyogo.jp":true,"kawanishi.hyogo.jp":true,"miki.hyogo.jp":true,"minamiawaji.hyogo.jp":true,"nishinomiya.hyogo.jp":true,"nishiwaki.hyogo.jp":true,"ono.hyogo.jp":true,"sanda.hyogo.jp":true,"sannan.hyogo.jp":true,"sasayama.hyogo.jp":true,"sayo.hyogo.jp":true,"shingu.hyogo.jp":true,"shinonsen.hyogo.jp":true,"shiso.hyogo.jp":true,"sumoto.hyogo.jp":true,"taishi.hyogo.jp":true,"taka.hyogo.jp":true,"takarazuka.hyogo.jp":true,"takasago.hyogo.jp":true,"takino.hyogo.jp":true,"tamba.hyogo.jp":true,"tatsuno.hyogo.jp":true,"toyooka.hyogo.jp":true,"yabu.hyogo.jp":true,"yashiro.hyogo.jp":true,"yoka.hyogo.jp":true,"yokawa.hyogo.jp":true,"ami.ibaraki.jp":true,"asahi.ibaraki.jp":true,"bando.ibaraki.jp":true,"chikusei.ibaraki.jp":true,"daigo.ibaraki.jp":true,"fujishiro.ibaraki.jp":true,"hitachi.ibaraki.jp":true,"hitachinaka.ibaraki.jp":true,"hitachiomiya.ibaraki.jp":true,"hitachiota.ibaraki.jp":true,"ibaraki.ibaraki.jp":true,"ina.ibaraki.jp":true,"inashiki.ibaraki.jp":true,"itako.ibaraki.jp":true,"iwama.ibaraki.jp":true,"joso.ibaraki.jp":true,"kamisu.ibaraki.jp":true,"kasama.ibaraki.jp":true,"kashima.ibaraki.jp":true,"kasumigaura.ibaraki.jp":true,"koga.ibaraki.jp":true,"miho.ibaraki.jp":true,"mito.ibaraki.jp":true,"moriya.ibaraki.jp":true,"naka.ibaraki.jp":true,"namegata.ibaraki.jp":true,"oarai.ibaraki.jp":true,"ogawa.ibaraki.jp":true,"omitama.ibaraki.jp":true,"ryugasaki.ibaraki.jp":true,"sakai.ibaraki.jp":true,"sakuragawa.ibaraki.jp":true,"shimodate.ibaraki.jp":true,"shimotsuma.ibaraki.jp":true,"shirosato.ibaraki.jp":true,"sowa.ibaraki.jp":true,"suifu.ibaraki.jp":true,"takahagi.ibaraki.jp":true,"tamatsukuri.ibaraki.jp":true,"tokai.ibaraki.jp":true,"tomobe.ibaraki.jp":true,"tone.ibaraki.jp":true,"toride.ibaraki.jp":true,"tsuchiura.ibaraki.jp":true,"tsukuba.ibaraki.jp":true,"uchihara.ibaraki.jp":true,"ushiku.ibaraki.jp":true,"yachiyo.ibaraki.jp":true,"yamagata.ibaraki.jp":true,"yawara.ibaraki.jp":true,"yuki.ibaraki.jp":true,"anamizu.ishikawa.jp":true,"hakui.ishikawa.jp":true,"hakusan.ishikawa.jp":true,"kaga.ishikawa.jp":true,"kahoku.ishikawa.jp":true,"kanazawa.ishikawa.jp":true,"kawakita.ishikawa.jp":true,"komatsu.ishikawa.jp":true,"nakanoto.ishikawa.jp":true,"nanao.ishikawa.jp":true,"nomi.ishikawa.jp":true,"nonoichi.ishikawa.jp":true,"noto.ishikawa.jp":true,"shika.ishikawa.jp":true,"suzu.ishikawa.jp":true,"tsubata.ishikawa.jp":true,"tsurugi.ishikawa.jp":true,"uchinada.ishikawa.jp":true,"wajima.ishikawa.jp":true,"fudai.iwate.jp":true,"fujisawa.iwate.jp":true,"hanamaki.iwate.jp":true,"hiraizumi.iwate.jp":true,"hirono.iwate.jp":true,"ichinohe.iwate.jp":true,"ichinoseki.iwate.jp":true,"iwaizumi.iwate.jp":true,"iwate.iwate.jp":true,"joboji.iwate.jp":true,"kamaishi.iwate.jp":true,"kanegasaki.iwate.jp":true,"karumai.iwate.jp":true,"kawai.iwate.jp":true,"kitakami.iwate.jp":true,"kuji.iwate.jp":true,"kunohe.iwate.jp":true,"kuzumaki.iwate.jp":true,"miyako.iwate.jp":true,"mizusawa.iwate.jp":true,"morioka.iwate.jp":true,"ninohe.iwate.jp":true,"noda.iwate.jp":true,"ofunato.iwate.jp":true,"oshu.iwate.jp":true,"otsuchi.iwate.jp":true,"rikuzentakata.iwate.jp":true,"shiwa.iwate.jp":true,"shizukuishi.iwate.jp":true,"sumita.iwate.jp":true,"tanohata.iwate.jp":true,"tono.iwate.jp":true,"yahaba.iwate.jp":true,"yamada.iwate.jp":true,"ayagawa.kagawa.jp":true,"higashikagawa.kagawa.jp":true,"kanonji.kagawa.jp":true,"kotohira.kagawa.jp":true,"manno.kagawa.jp":true,"marugame.kagawa.jp":true,"mitoyo.kagawa.jp":true,"naoshima.kagawa.jp":true,"sanuki.kagawa.jp":true,"tadotsu.kagawa.jp":true,"takamatsu.kagawa.jp":true,"tonosho.kagawa.jp":true,"uchinomi.kagawa.jp":true,"utazu.kagawa.jp":true,"zentsuji.kagawa.jp":true,"akune.kagoshima.jp":true,"amami.kagoshima.jp":true,"hioki.kagoshima.jp":true,"isa.kagoshima.jp":true,"isen.kagoshima.jp":true,"izumi.kagoshima.jp":true,"kagoshima.kagoshima.jp":true,"kanoya.kagoshima.jp":true,"kawanabe.kagoshima.jp":true,"kinko.kagoshima.jp":true,"kouyama.kagoshima.jp":true,"makurazaki.kagoshima.jp":true,"matsumoto.kagoshima.jp":true,"minamitane.kagoshima.jp":true,"nakatane.kagoshima.jp":true,"nishinoomote.kagoshima.jp":true,"satsumasendai.kagoshima.jp":true,"soo.kagoshima.jp":true,"tarumizu.kagoshima.jp":true,"yusui.kagoshima.jp":true,"aikawa.kanagawa.jp":true,"atsugi.kanagawa.jp":true,"ayase.kanagawa.jp":true,"chigasaki.kanagawa.jp":true,"ebina.kanagawa.jp":true,"fujisawa.kanagawa.jp":true,"hadano.kanagawa.jp":true,"hakone.kanagawa.jp":true,"hiratsuka.kanagawa.jp":true,"isehara.kanagawa.jp":true,"kaisei.kanagawa.jp":true,"kamakura.kanagawa.jp":true,"kiyokawa.kanagawa.jp":true,"matsuda.kanagawa.jp":true,"minamiashigara.kanagawa.jp":true,"miura.kanagawa.jp":true,"nakai.kanagawa.jp":true,"ninomiya.kanagawa.jp":true,"odawara.kanagawa.jp":true,"oi.kanagawa.jp":true,"oiso.kanagawa.jp":true,"sagamihara.kanagawa.jp":true,"samukawa.kanagawa.jp":true,"tsukui.kanagawa.jp":true,"yamakita.kanagawa.jp":true,"yamato.kanagawa.jp":true,"yokosuka.kanagawa.jp":true,"yugawara.kanagawa.jp":true,"zama.kanagawa.jp":true,"zushi.kanagawa.jp":true,"aki.kochi.jp":true,"geisei.kochi.jp":true,"hidaka.kochi.jp":true,"higashitsuno.kochi.jp":true,"ino.kochi.jp":true,"kagami.kochi.jp":true,"kami.kochi.jp":true,"kitagawa.kochi.jp":true,"kochi.kochi.jp":true,"mihara.kochi.jp":true,"motoyama.kochi.jp":true,"muroto.kochi.jp":true,"nahari.kochi.jp":true,"nakamura.kochi.jp":true,"nankoku.kochi.jp":true,"nishitosa.kochi.jp":true,"niyodogawa.kochi.jp":true,"ochi.kochi.jp":true,"okawa.kochi.jp":true,"otoyo.kochi.jp":true,"otsuki.kochi.jp":true,"sakawa.kochi.jp":true,"sukumo.kochi.jp":true,"susaki.kochi.jp":true,"tosa.kochi.jp":true,"tosashimizu.kochi.jp":true,"toyo.kochi.jp":true,"tsuno.kochi.jp":true,"umaji.kochi.jp":true,"yasuda.kochi.jp":true,"yusuhara.kochi.jp":true,"amakusa.kumamoto.jp":true,"arao.kumamoto.jp":true,"aso.kumamoto.jp":true,"choyo.kumamoto.jp":true,"gyokuto.kumamoto.jp":true,"hitoyoshi.kumamoto.jp":true,"kamiamakusa.kumamoto.jp":true,"kashima.kumamoto.jp":true,"kikuchi.kumamoto.jp":true,"kosa.kumamoto.jp":true,"kumamoto.kumamoto.jp":true,"mashiki.kumamoto.jp":true,"mifune.kumamoto.jp":true,"minamata.kumamoto.jp":true,"minamioguni.kumamoto.jp":true,"nagasu.kumamoto.jp":true,"nishihara.kumamoto.jp":true,"oguni.kumamoto.jp":true,"ozu.kumamoto.jp":true,"sumoto.kumamoto.jp":true,"takamori.kumamoto.jp":true,"uki.kumamoto.jp":true,"uto.kumamoto.jp":true,"yamaga.kumamoto.jp":true,"yamato.kumamoto.jp":true,"yatsushiro.kumamoto.jp":true,"ayabe.kyoto.jp":true,"fukuchiyama.kyoto.jp":true,"higashiyama.kyoto.jp":true,"ide.kyoto.jp":true,"ine.kyoto.jp":true,"joyo.kyoto.jp":true,"kameoka.kyoto.jp":true,"kamo.kyoto.jp":true,"kita.kyoto.jp":true,"kizu.kyoto.jp":true,"kumiyama.kyoto.jp":true,"kyotamba.kyoto.jp":true,"kyotanabe.kyoto.jp":true,"kyotango.kyoto.jp":true,"maizuru.kyoto.jp":true,"minami.kyoto.jp":true,"minamiyamashiro.kyoto.jp":true,"miyazu.kyoto.jp":true,"muko.kyoto.jp":true,"nagaokakyo.kyoto.jp":true,"nakagyo.kyoto.jp":true,"nantan.kyoto.jp":true,"oyamazaki.kyoto.jp":true,"sakyo.kyoto.jp":true,"seika.kyoto.jp":true,"tanabe.kyoto.jp":true,"uji.kyoto.jp":true,"ujitawara.kyoto.jp":true,"wazuka.kyoto.jp":true,"yamashina.kyoto.jp":true,"yawata.kyoto.jp":true,"asahi.mie.jp":true,"inabe.mie.jp":true,"ise.mie.jp":true,"kameyama.mie.jp":true,"kawagoe.mie.jp":true,"kiho.mie.jp":true,"kisosaki.mie.jp":true,"kiwa.mie.jp":true,"komono.mie.jp":true,"kumano.mie.jp":true,"kuwana.mie.jp":true,"matsusaka.mie.jp":true,"meiwa.mie.jp":true,"mihama.mie.jp":true,"minamiise.mie.jp":true,"misugi.mie.jp":true,"miyama.mie.jp":true,"nabari.mie.jp":true,"shima.mie.jp":true,"suzuka.mie.jp":true,"tado.mie.jp":true,"taiki.mie.jp":true,"taki.mie.jp":true,"tamaki.mie.jp":true,"toba.mie.jp":true,"tsu.mie.jp":true,"udono.mie.jp":true,"ureshino.mie.jp":true,"watarai.mie.jp":true,"yokkaichi.mie.jp":true,"furukawa.miyagi.jp":true,"higashimatsushima.miyagi.jp":true,"ishinomaki.miyagi.jp":true,"iwanuma.miyagi.jp":true,"kakuda.miyagi.jp":true,"kami.miyagi.jp":true,"kawasaki.miyagi.jp":true,"kesennuma.miyagi.jp":true,"marumori.miyagi.jp":true,"matsushima.miyagi.jp":true,"minamisanriku.miyagi.jp":true,"misato.miyagi.jp":true,"murata.miyagi.jp":true,"natori.miyagi.jp":true,"ogawara.miyagi.jp":true,"ohira.miyagi.jp":true,"onagawa.miyagi.jp":true,"osaki.miyagi.jp":true,"rifu.miyagi.jp":true,"semine.miyagi.jp":true,"shibata.miyagi.jp":true,"shichikashuku.miyagi.jp":true,"shikama.miyagi.jp":true,"shiogama.miyagi.jp":true,"shiroishi.miyagi.jp":true,"tagajo.miyagi.jp":true,"taiwa.miyagi.jp":true,"tome.miyagi.jp":true,"tomiya.miyagi.jp":true,"wakuya.miyagi.jp":true,"watari.miyagi.jp":true,"yamamoto.miyagi.jp":true,"zao.miyagi.jp":true,"aya.miyazaki.jp":true,"ebino.miyazaki.jp":true,"gokase.miyazaki.jp":true,"hyuga.miyazaki.jp":true,"kadogawa.miyazaki.jp":true,"kawaminami.miyazaki.jp":true,"kijo.miyazaki.jp":true,"kitagawa.miyazaki.jp":true,"kitakata.miyazaki.jp":true,"kitaura.miyazaki.jp":true,"kobayashi.miyazaki.jp":true,"kunitomi.miyazaki.jp":true,"kushima.miyazaki.jp":true,"mimata.miyazaki.jp":true,"miyakonojo.miyazaki.jp":true,"miyazaki.miyazaki.jp":true,"morotsuka.miyazaki.jp":true,"nichinan.miyazaki.jp":true,"nishimera.miyazaki.jp":true,"nobeoka.miyazaki.jp":true,"saito.miyazaki.jp":true,"shiiba.miyazaki.jp":true,"shintomi.miyazaki.jp":true,"takaharu.miyazaki.jp":true,"takanabe.miyazaki.jp":true,"takazaki.miyazaki.jp":true,"tsuno.miyazaki.jp":true,"achi.nagano.jp":true,"agematsu.nagano.jp":true,"anan.nagano.jp":true,"aoki.nagano.jp":true,"asahi.nagano.jp":true,"azumino.nagano.jp":true,"chikuhoku.nagano.jp":true,"chikuma.nagano.jp":true,"chino.nagano.jp":true,"fujimi.nagano.jp":true,"hakuba.nagano.jp":true,"hara.nagano.jp":true,"hiraya.nagano.jp":true,"iida.nagano.jp":true,"iijima.nagano.jp":true,"iiyama.nagano.jp":true,"iizuna.nagano.jp":true,"ikeda.nagano.jp":true,"ikusaka.nagano.jp":true,"ina.nagano.jp":true,"karuizawa.nagano.jp":true,"kawakami.nagano.jp":true,"kiso.nagano.jp":true,"kisofukushima.nagano.jp":true,"kitaaiki.nagano.jp":true,"komagane.nagano.jp":true,"komoro.nagano.jp":true,"matsukawa.nagano.jp":true,"matsumoto.nagano.jp":true,"miasa.nagano.jp":true,"minamiaiki.nagano.jp":true,"minamimaki.nagano.jp":true,"minamiminowa.nagano.jp":true,"minowa.nagano.jp":true,"miyada.nagano.jp":true,"miyota.nagano.jp":true,"mochizuki.nagano.jp":true,"nagano.nagano.jp":true,"nagawa.nagano.jp":true,"nagiso.nagano.jp":true,"nakagawa.nagano.jp":true,"nakano.nagano.jp":true,"nozawaonsen.nagano.jp":true,"obuse.nagano.jp":true,"ogawa.nagano.jp":true,"okaya.nagano.jp":true,"omachi.nagano.jp":true,"omi.nagano.jp":true,"ookuwa.nagano.jp":true,"ooshika.nagano.jp":true,"otaki.nagano.jp":true,"otari.nagano.jp":true,"sakae.nagano.jp":true,"sakaki.nagano.jp":true,"saku.nagano.jp":true,"sakuho.nagano.jp":true,"shimosuwa.nagano.jp":true,"shinanomachi.nagano.jp":true,"shiojiri.nagano.jp":true,"suwa.nagano.jp":true,"suzaka.nagano.jp":true,"takagi.nagano.jp":true,"takamori.nagano.jp":true,"takayama.nagano.jp":true,"tateshina.nagano.jp":true,"tatsuno.nagano.jp":true,"togakushi.nagano.jp":true,"togura.nagano.jp":true,"tomi.nagano.jp":true,"ueda.nagano.jp":true,"wada.nagano.jp":true,"yamagata.nagano.jp":true,"yamanouchi.nagano.jp":true,"yasaka.nagano.jp":true,"yasuoka.nagano.jp":true,"chijiwa.nagasaki.jp":true,"futsu.nagasaki.jp":true,"goto.nagasaki.jp":true,"hasami.nagasaki.jp":true,"hirado.nagasaki.jp":true,"iki.nagasaki.jp":true,"isahaya.nagasaki.jp":true,"kawatana.nagasaki.jp":true,"kuchinotsu.nagasaki.jp":true,"matsuura.nagasaki.jp":true,"nagasaki.nagasaki.jp":true,"obama.nagasaki.jp":true,"omura.nagasaki.jp":true,"oseto.nagasaki.jp":true,"saikai.nagasaki.jp":true,"sasebo.nagasaki.jp":true,"seihi.nagasaki.jp":true,"shimabara.nagasaki.jp":true,"shinkamigoto.nagasaki.jp":true,"togitsu.nagasaki.jp":true,"tsushima.nagasaki.jp":true,"unzen.nagasaki.jp":true,"ando.nara.jp":true,"gose.nara.jp":true,"heguri.nara.jp":true,"higashiyoshino.nara.jp":true,"ikaruga.nara.jp":true,"ikoma.nara.jp":true,"kamikitayama.nara.jp":true,"kanmaki.nara.jp":true,"kashiba.nara.jp":true,"kashihara.nara.jp":true,"katsuragi.nara.jp":true,"kawai.nara.jp":true,"kawakami.nara.jp":true,"kawanishi.nara.jp":true,"koryo.nara.jp":true,"kurotaki.nara.jp":true,"mitsue.nara.jp":true,"miyake.nara.jp":true,"nara.nara.jp":true,"nosegawa.nara.jp":true,"oji.nara.jp":true,"ouda.nara.jp":true,"oyodo.nara.jp":true,"sakurai.nara.jp":true,"sango.nara.jp":true,"shimoichi.nara.jp":true,"shimokitayama.nara.jp":true,"shinjo.nara.jp":true,"soni.nara.jp":true,"takatori.nara.jp":true,"tawaramoto.nara.jp":true,"tenkawa.nara.jp":true,"tenri.nara.jp":true,"uda.nara.jp":true,"yamatokoriyama.nara.jp":true,"yamatotakada.nara.jp":true,"yamazoe.nara.jp":true,"yoshino.nara.jp":true,"aga.niigata.jp":true,"agano.niigata.jp":true,"gosen.niigata.jp":true,"itoigawa.niigata.jp":true,"izumozaki.niigata.jp":true,"joetsu.niigata.jp":true,"kamo.niigata.jp":true,"kariwa.niigata.jp":true,"kashiwazaki.niigata.jp":true,"minamiuonuma.niigata.jp":true,"mitsuke.niigata.jp":true,"muika.niigata.jp":true,"murakami.niigata.jp":true,"myoko.niigata.jp":true,"nagaoka.niigata.jp":true,"niigata.niigata.jp":true,"ojiya.niigata.jp":true,"omi.niigata.jp":true,"sado.niigata.jp":true,"sanjo.niigata.jp":true,"seiro.niigata.jp":true,"seirou.niigata.jp":true,"sekikawa.niigata.jp":true,"shibata.niigata.jp":true,"tagami.niigata.jp":true,"tainai.niigata.jp":true,"tochio.niigata.jp":true,"tokamachi.niigata.jp":true,"tsubame.niigata.jp":true,"tsunan.niigata.jp":true,"uonuma.niigata.jp":true,"yahiko.niigata.jp":true,"yoita.niigata.jp":true,"yuzawa.niigata.jp":true,"beppu.oita.jp":true,"bungoono.oita.jp":true,"bungotakada.oita.jp":true,"hasama.oita.jp":true,"hiji.oita.jp":true,"himeshima.oita.jp":true,"hita.oita.jp":true,"kamitsue.oita.jp":true,"kokonoe.oita.jp":true,"kuju.oita.jp":true,"kunisaki.oita.jp":true,"kusu.oita.jp":true,"oita.oita.jp":true,"saiki.oita.jp":true,"taketa.oita.jp":true,"tsukumi.oita.jp":true,"usa.oita.jp":true,"usuki.oita.jp":true,"yufu.oita.jp":true,"akaiwa.okayama.jp":true,"asakuchi.okayama.jp":true,"bizen.okayama.jp":true,"hayashima.okayama.jp":true,"ibara.okayama.jp":true,"kagamino.okayama.jp":true,"kasaoka.okayama.jp":true,"kibichuo.okayama.jp":true,"kumenan.okayama.jp":true,"kurashiki.okayama.jp":true,"maniwa.okayama.jp":true,"misaki.okayama.jp":true,"nagi.okayama.jp":true,"niimi.okayama.jp":true,"nishiawakura.okayama.jp":true,"okayama.okayama.jp":true,"satosho.okayama.jp":true,"setouchi.okayama.jp":true,"shinjo.okayama.jp":true,"shoo.okayama.jp":true,"soja.okayama.jp":true,"takahashi.okayama.jp":true,"tamano.okayama.jp":true,"tsuyama.okayama.jp":true,"wake.okayama.jp":true,"yakage.okayama.jp":true,"aguni.okinawa.jp":true,"ginowan.okinawa.jp":true,"ginoza.okinawa.jp":true,"gushikami.okinawa.jp":true,"haebaru.okinawa.jp":true,"higashi.okinawa.jp":true,"hirara.okinawa.jp":true,"iheya.okinawa.jp":true,"ishigaki.okinawa.jp":true,"ishikawa.okinawa.jp":true,"itoman.okinawa.jp":true,"izena.okinawa.jp":true,"kadena.okinawa.jp":true,"kin.okinawa.jp":true,"kitadaito.okinawa.jp":true,"kitanakagusuku.okinawa.jp":true,"kumejima.okinawa.jp":true,"kunigami.okinawa.jp":true,"minamidaito.okinawa.jp":true,"motobu.okinawa.jp":true,"nago.okinawa.jp":true,"naha.okinawa.jp":true,"nakagusuku.okinawa.jp":true,"nakijin.okinawa.jp":true,"nanjo.okinawa.jp":true,"nishihara.okinawa.jp":true,"ogimi.okinawa.jp":true,"okinawa.okinawa.jp":true,"onna.okinawa.jp":true,"shimoji.okinawa.jp":true,"taketomi.okinawa.jp":true,"tarama.okinawa.jp":true,"tokashiki.okinawa.jp":true,"tomigusuku.okinawa.jp":true,"tonaki.okinawa.jp":true,"urasoe.okinawa.jp":true,"uruma.okinawa.jp":true,"yaese.okinawa.jp":true,"yomitan.okinawa.jp":true,"yonabaru.okinawa.jp":true,"yonaguni.okinawa.jp":true,"zamami.okinawa.jp":true,"abeno.osaka.jp":true,"chihayaakasaka.osaka.jp":true,"chuo.osaka.jp":true,"daito.osaka.jp":true,"fujiidera.osaka.jp":true,"habikino.osaka.jp":true,"hannan.osaka.jp":true,"higashiosaka.osaka.jp":true,"higashisumiyoshi.osaka.jp":true,"higashiyodogawa.osaka.jp":true,"hirakata.osaka.jp":true,"ibaraki.osaka.jp":true,"ikeda.osaka.jp":true,"izumi.osaka.jp":true,"izumiotsu.osaka.jp":true,"izumisano.osaka.jp":true,"kadoma.osaka.jp":true,"kaizuka.osaka.jp":true,"kanan.osaka.jp":true,"kashiwara.osaka.jp":true,"katano.osaka.jp":true,"kawachinagano.osaka.jp":true,"kishiwada.osaka.jp":true,"kita.osaka.jp":true,"kumatori.osaka.jp":true,"matsubara.osaka.jp":true,"minato.osaka.jp":true,"minoh.osaka.jp":true,"misaki.osaka.jp":true,"moriguchi.osaka.jp":true,"neyagawa.osaka.jp":true,"nishi.osaka.jp":true,"nose.osaka.jp":true,"osakasayama.osaka.jp":true,"sakai.osaka.jp":true,"sayama.osaka.jp":true,"sennan.osaka.jp":true,"settsu.osaka.jp":true,"shijonawate.osaka.jp":true,"shimamoto.osaka.jp":true,"suita.osaka.jp":true,"tadaoka.osaka.jp":true,"taishi.osaka.jp":true,"tajiri.osaka.jp":true,"takaishi.osaka.jp":true,"takatsuki.osaka.jp":true,"tondabayashi.osaka.jp":true,"toyonaka.osaka.jp":true,"toyono.osaka.jp":true,"yao.osaka.jp":true,"ariake.saga.jp":true,"arita.saga.jp":true,"fukudomi.saga.jp":true,"genkai.saga.jp":true,"hamatama.saga.jp":true,"hizen.saga.jp":true,"imari.saga.jp":true,"kamimine.saga.jp":true,"kanzaki.saga.jp":true,"karatsu.saga.jp":true,"kashima.saga.jp":true,"kitagata.saga.jp":true,"kitahata.saga.jp":true,"kiyama.saga.jp":true,"kouhoku.saga.jp":true,"kyuragi.saga.jp":true,"nishiarita.saga.jp":true,"ogi.saga.jp":true,"omachi.saga.jp":true,"ouchi.saga.jp":true,"saga.saga.jp":true,"shiroishi.saga.jp":true,"taku.saga.jp":true,"tara.saga.jp":true,"tosu.saga.jp":true,"yoshinogari.saga.jp":true,"arakawa.saitama.jp":true,"asaka.saitama.jp":true,"chichibu.saitama.jp":true,"fujimi.saitama.jp":true,"fujimino.saitama.jp":true,"fukaya.saitama.jp":true,"hanno.saitama.jp":true,"hanyu.saitama.jp":true,"hasuda.saitama.jp":true,"hatogaya.saitama.jp":true,"hatoyama.saitama.jp":true,"hidaka.saitama.jp":true,"higashichichibu.saitama.jp":true,"higashimatsuyama.saitama.jp":true,"honjo.saitama.jp":true,"ina.saitama.jp":true,"iruma.saitama.jp":true,"iwatsuki.saitama.jp":true,"kamiizumi.saitama.jp":true,"kamikawa.saitama.jp":true,"kamisato.saitama.jp":true,"kasukabe.saitama.jp":true,"kawagoe.saitama.jp":true,"kawaguchi.saitama.jp":true,"kawajima.saitama.jp":true,"kazo.saitama.jp":true,"kitamoto.saitama.jp":true,"koshigaya.saitama.jp":true,"kounosu.saitama.jp":true,"kuki.saitama.jp":true,"kumagaya.saitama.jp":true,"matsubushi.saitama.jp":true,"minano.saitama.jp":true,"misato.saitama.jp":true,"miyashiro.saitama.jp":true,"miyoshi.saitama.jp":true,"moroyama.saitama.jp":true,"nagatoro.saitama.jp":true,"namegawa.saitama.jp":true,"niiza.saitama.jp":true,"ogano.saitama.jp":true,"ogawa.saitama.jp":true,"ogose.saitama.jp":true,"okegawa.saitama.jp":true,"omiya.saitama.jp":true,"otaki.saitama.jp":true,"ranzan.saitama.jp":true,"ryokami.saitama.jp":true,"saitama.saitama.jp":true,"sakado.saitama.jp":true,"satte.saitama.jp":true,"sayama.saitama.jp":true,"shiki.saitama.jp":true,"shiraoka.saitama.jp":true,"soka.saitama.jp":true,"sugito.saitama.jp":true,"toda.saitama.jp":true,"tokigawa.saitama.jp":true,"tokorozawa.saitama.jp":true,"tsurugashima.saitama.jp":true,"urawa.saitama.jp":true,"warabi.saitama.jp":true,"yashio.saitama.jp":true,"yokoze.saitama.jp":true,"yono.saitama.jp":true,"yorii.saitama.jp":true,"yoshida.saitama.jp":true,"yoshikawa.saitama.jp":true,"yoshimi.saitama.jp":true,"aisho.shiga.jp":true,"gamo.shiga.jp":true,"higashiomi.shiga.jp":true,"hikone.shiga.jp":true,"koka.shiga.jp":true,"konan.shiga.jp":true,"kosei.shiga.jp":true,"koto.shiga.jp":true,"kusatsu.shiga.jp":true,"maibara.shiga.jp":true,"moriyama.shiga.jp":true,"nagahama.shiga.jp":true,"nishiazai.shiga.jp":true,"notogawa.shiga.jp":true,"omihachiman.shiga.jp":true,"otsu.shiga.jp":true,"ritto.shiga.jp":true,"ryuoh.shiga.jp":true,"takashima.shiga.jp":true,"takatsuki.shiga.jp":true,"torahime.shiga.jp":true,"toyosato.shiga.jp":true,"yasu.shiga.jp":true,"akagi.shimane.jp":true,"ama.shimane.jp":true,"gotsu.shimane.jp":true,"hamada.shimane.jp":true,"higashiizumo.shimane.jp":true,"hikawa.shimane.jp":true,"hikimi.shimane.jp":true,"izumo.shimane.jp":true,"kakinoki.shimane.jp":true,"masuda.shimane.jp":true,"matsue.shimane.jp":true,"misato.shimane.jp":true,"nishinoshima.shimane.jp":true,"ohda.shimane.jp":true,"okinoshima.shimane.jp":true,"okuizumo.shimane.jp":true,"shimane.shimane.jp":true,"tamayu.shimane.jp":true,"tsuwano.shimane.jp":true,"unnan.shimane.jp":true,"yakumo.shimane.jp":true,"yasugi.shimane.jp":true,"yatsuka.shimane.jp":true,"arai.shizuoka.jp":true,"atami.shizuoka.jp":true,"fuji.shizuoka.jp":true,"fujieda.shizuoka.jp":true,"fujikawa.shizuoka.jp":true,"fujinomiya.shizuoka.jp":true,"fukuroi.shizuoka.jp":true,"gotemba.shizuoka.jp":true,"haibara.shizuoka.jp":true,"hamamatsu.shizuoka.jp":true,"higashiizu.shizuoka.jp":true,"ito.shizuoka.jp":true,"iwata.shizuoka.jp":true,"izu.shizuoka.jp":true,"izunokuni.shizuoka.jp":true,"kakegawa.shizuoka.jp":true,"kannami.shizuoka.jp":true,"kawanehon.shizuoka.jp":true,"kawazu.shizuoka.jp":true,"kikugawa.shizuoka.jp":true,"kosai.shizuoka.jp":true,"makinohara.shizuoka.jp":true,"matsuzaki.shizuoka.jp":true,"minamiizu.shizuoka.jp":true,"mishima.shizuoka.jp":true,"morimachi.shizuoka.jp":true,"nishiizu.shizuoka.jp":true,"numazu.shizuoka.jp":true,"omaezaki.shizuoka.jp":true,"shimada.shizuoka.jp":true,"shimizu.shizuoka.jp":true,"shimoda.shizuoka.jp":true,"shizuoka.shizuoka.jp":true,"susono.shizuoka.jp":true,"yaizu.shizuoka.jp":true,"yoshida.shizuoka.jp":true,"ashikaga.tochigi.jp":true,"bato.tochigi.jp":true,"haga.tochigi.jp":true,"ichikai.tochigi.jp":true,"iwafune.tochigi.jp":true,"kaminokawa.tochigi.jp":true,"kanuma.tochigi.jp":true,"karasuyama.tochigi.jp":true,"kuroiso.tochigi.jp":true,"mashiko.tochigi.jp":true,"mibu.tochigi.jp":true,"moka.tochigi.jp":true,"motegi.tochigi.jp":true,"nasu.tochigi.jp":true,"nasushiobara.tochigi.jp":true,"nikko.tochigi.jp":true,"nishikata.tochigi.jp":true,"nogi.tochigi.jp":true,"ohira.tochigi.jp":true,"ohtawara.tochigi.jp":true,"oyama.tochigi.jp":true,"sakura.tochigi.jp":true,"sano.tochigi.jp":true,"shimotsuke.tochigi.jp":true,"shioya.tochigi.jp":true,"takanezawa.tochigi.jp":true,"tochigi.tochigi.jp":true,"tsuga.tochigi.jp":true,"ujiie.tochigi.jp":true,"utsunomiya.tochigi.jp":true,"yaita.tochigi.jp":true,"aizumi.tokushima.jp":true,"anan.tokushima.jp":true,"ichiba.tokushima.jp":true,"itano.tokushima.jp":true,"kainan.tokushima.jp":true,"komatsushima.tokushima.jp":true,"matsushige.tokushima.jp":true,"mima.tokushima.jp":true,"minami.tokushima.jp":true,"miyoshi.tokushima.jp":true,"mugi.tokushima.jp":true,"nakagawa.tokushima.jp":true,"naruto.tokushima.jp":true,"sanagochi.tokushima.jp":true,"shishikui.tokushima.jp":true,"tokushima.tokushima.jp":true,"wajiki.tokushima.jp":true,"adachi.tokyo.jp":true,"akiruno.tokyo.jp":true,"akishima.tokyo.jp":true,"aogashima.tokyo.jp":true,"arakawa.tokyo.jp":true,"bunkyo.tokyo.jp":true,"chiyoda.tokyo.jp":true,"chofu.tokyo.jp":true,"chuo.tokyo.jp":true,"edogawa.tokyo.jp":true,"fuchu.tokyo.jp":true,"fussa.tokyo.jp":true,"hachijo.tokyo.jp":true,"hachioji.tokyo.jp":true,"hamura.tokyo.jp":true,"higashikurume.tokyo.jp":true,"higashimurayama.tokyo.jp":true,"higashiyamato.tokyo.jp":true,"hino.tokyo.jp":true,"hinode.tokyo.jp":true,"hinohara.tokyo.jp":true,"inagi.tokyo.jp":true,"itabashi.tokyo.jp":true,"katsushika.tokyo.jp":true,"kita.tokyo.jp":true,"kiyose.tokyo.jp":true,"kodaira.tokyo.jp":true,"koganei.tokyo.jp":true,"kokubunji.tokyo.jp":true,"komae.tokyo.jp":true,"koto.tokyo.jp":true,"kouzushima.tokyo.jp":true,"kunitachi.tokyo.jp":true,"machida.tokyo.jp":true,"meguro.tokyo.jp":true,"minato.tokyo.jp":true,"mitaka.tokyo.jp":true,"mizuho.tokyo.jp":true,"musashimurayama.tokyo.jp":true,"musashino.tokyo.jp":true,"nakano.tokyo.jp":true,"nerima.tokyo.jp":true,"ogasawara.tokyo.jp":true,"okutama.tokyo.jp":true,"ome.tokyo.jp":true,"oshima.tokyo.jp":true,"ota.tokyo.jp":true,"setagaya.tokyo.jp":true,"shibuya.tokyo.jp":true,"shinagawa.tokyo.jp":true,"shinjuku.tokyo.jp":true,"suginami.tokyo.jp":true,"sumida.tokyo.jp":true,"tachikawa.tokyo.jp":true,"taito.tokyo.jp":true,"tama.tokyo.jp":true,"toshima.tokyo.jp":true,"chizu.tottori.jp":true,"hino.tottori.jp":true,"kawahara.tottori.jp":true,"koge.tottori.jp":true,"kotoura.tottori.jp":true,"misasa.tottori.jp":true,"nanbu.tottori.jp":true,"nichinan.tottori.jp":true,"sakaiminato.tottori.jp":true,"tottori.tottori.jp":true,"wakasa.tottori.jp":true,"yazu.tottori.jp":true,"yonago.tottori.jp":true,"asahi.toyama.jp":true,"fuchu.toyama.jp":true,"fukumitsu.toyama.jp":true,"funahashi.toyama.jp":true,"himi.toyama.jp":true,"imizu.toyama.jp":true,"inami.toyama.jp":true,"johana.toyama.jp":true,"kamiichi.toyama.jp":true,"kurobe.toyama.jp":true,"nakaniikawa.toyama.jp":true,"namerikawa.toyama.jp":true,"nanto.toyama.jp":true,"nyuzen.toyama.jp":true,"oyabe.toyama.jp":true,"taira.toyama.jp":true,"takaoka.toyama.jp":true,"tateyama.toyama.jp":true,"toga.toyama.jp":true,"tonami.toyama.jp":true,"toyama.toyama.jp":true,"unazuki.toyama.jp":true,"uozu.toyama.jp":true,"yamada.toyama.jp":true,"arida.wakayama.jp":true,"aridagawa.wakayama.jp":true,"gobo.wakayama.jp":true,"hashimoto.wakayama.jp":true,"hidaka.wakayama.jp":true,"hirogawa.wakayama.jp":true,"inami.wakayama.jp":true,"iwade.wakayama.jp":true,"kainan.wakayama.jp":true,"kamitonda.wakayama.jp":true,"katsuragi.wakayama.jp":true,"kimino.wakayama.jp":true,"kinokawa.wakayama.jp":true,"kitayama.wakayama.jp":true,"koya.wakayama.jp":true,"koza.wakayama.jp":true,"kozagawa.wakayama.jp":true,"kudoyama.wakayama.jp":true,"kushimoto.wakayama.jp":true,"mihama.wakayama.jp":true,"misato.wakayama.jp":true,"nachikatsuura.wakayama.jp":true,"shingu.wakayama.jp":true,"shirahama.wakayama.jp":true,"taiji.wakayama.jp":true,"tanabe.wakayama.jp":true,"wakayama.wakayama.jp":true,"yuasa.wakayama.jp":true,"yura.wakayama.jp":true,"asahi.yamagata.jp":true,"funagata.yamagata.jp":true,"higashine.yamagata.jp":true,"iide.yamagata.jp":true,"kahoku.yamagata.jp":true,"kaminoyama.yamagata.jp":true,"kaneyama.yamagata.jp":true,"kawanishi.yamagata.jp":true,"mamurogawa.yamagata.jp":true,"mikawa.yamagata.jp":true,"murayama.yamagata.jp":true,"nagai.yamagata.jp":true,"nakayama.yamagata.jp":true,"nanyo.yamagata.jp":true,"nishikawa.yamagata.jp":true,"obanazawa.yamagata.jp":true,"oe.yamagata.jp":true,"oguni.yamagata.jp":true,"ohkura.yamagata.jp":true,"oishida.yamagata.jp":true,"sagae.yamagata.jp":true,"sakata.yamagata.jp":true,"sakegawa.yamagata.jp":true,"shinjo.yamagata.jp":true,"shirataka.yamagata.jp":true,"shonai.yamagata.jp":true,"takahata.yamagata.jp":true,"tendo.yamagata.jp":true,"tozawa.yamagata.jp":true,"tsuruoka.yamagata.jp":true,"yamagata.yamagata.jp":true,"yamanobe.yamagata.jp":true,"yonezawa.yamagata.jp":true,"yuza.yamagata.jp":true,"abu.yamaguchi.jp":true,"hagi.yamaguchi.jp":true,"hikari.yamaguchi.jp":true,"hofu.yamaguchi.jp":true,"iwakuni.yamaguchi.jp":true,"kudamatsu.yamaguchi.jp":true,"mitou.yamaguchi.jp":true,"nagato.yamaguchi.jp":true,"oshima.yamaguchi.jp":true,"shimonoseki.yamaguchi.jp":true,"shunan.yamaguchi.jp":true,"tabuse.yamaguchi.jp":true,"tokuyama.yamaguchi.jp":true,"toyota.yamaguchi.jp":true,"ube.yamaguchi.jp":true,"yuu.yamaguchi.jp":true,"chuo.yamanashi.jp":true,"doshi.yamanashi.jp":true,"fuefuki.yamanashi.jp":true,"fujikawa.yamanashi.jp":true,"fujikawaguchiko.yamanashi.jp":true,"fujiyoshida.yamanashi.jp":true,"hayakawa.yamanashi.jp":true,"hokuto.yamanashi.jp":true,"ichikawamisato.yamanashi.jp":true,"kai.yamanashi.jp":true,"kofu.yamanashi.jp":true,"koshu.yamanashi.jp":true,"kosuge.yamanashi.jp":true,"minami-alps.yamanashi.jp":true,"minobu.yamanashi.jp":true,"nakamichi.yamanashi.jp":true,"nanbu.yamanashi.jp":true,"narusawa.yamanashi.jp":true,"nirasaki.yamanashi.jp":true,"nishikatsura.yamanashi.jp":true,"oshino.yamanashi.jp":true,"otsuki.yamanashi.jp":true,"showa.yamanashi.jp":true,"tabayama.yamanashi.jp":true,"tsuru.yamanashi.jp":true,"uenohara.yamanashi.jp":true,"yamanakako.yamanashi.jp":true,"yamanashi.yamanashi.jp":true,"*.ke":true,"kg":true,"org.kg":true,"net.kg":true,"com.kg":true,"edu.kg":true,"gov.kg":true,"mil.kg":true,"*.kh":true,"ki":true,"edu.ki":true,"biz.ki":true,"net.ki":true,"org.ki":true,"gov.ki":true,"info.ki":true,"com.ki":true,"km":true,"org.km":true,"nom.km":true,"gov.km":true,"prd.km":true,"tm.km":true,"edu.km":true,"mil.km":true,"ass.km":true,"com.km":true,"coop.km":true,"asso.km":true,"presse.km":true,"medecin.km":true,"notaires.km":true,"pharmaciens.km":true,"veterinaire.km":true,"gouv.km":true,"kn":true,"net.kn":true,"org.kn":true,"edu.kn":true,"gov.kn":true,"kp":true,"com.kp":true,"edu.kp":true,"gov.kp":true,"org.kp":true,"rep.kp":true,"tra.kp":true,"kr":true,"ac.kr":true,"co.kr":true,"es.kr":true,"go.kr":true,"hs.kr":true,"kg.kr":true,"mil.kr":true,"ms.kr":true,"ne.kr":true,"or.kr":true,"pe.kr":true,"re.kr":true,"sc.kr":true,"busan.kr":true,"chungbuk.kr":true,"chungnam.kr":true,"daegu.kr":true,"daejeon.kr":true,"gangwon.kr":true,"gwangju.kr":true,"gyeongbuk.kr":true,"gyeonggi.kr":true,"gyeongnam.kr":true,"incheon.kr":true,"jeju.kr":true,"jeonbuk.kr":true,"jeonnam.kr":true,"seoul.kr":true,"ulsan.kr":true,"*.kw":true,"ky":true,"edu.ky":true,"gov.ky":true,"com.ky":true,"org.ky":true,"net.ky":true,"kz":true,"org.kz":true,"edu.kz":true,"net.kz":true,"gov.kz":true,"mil.kz":true,"com.kz":true,"la":true,"int.la":true,"net.la":true,"info.la":true,"edu.la":true,"gov.la":true,"per.la":true,"com.la":true,"org.la":true,"lb":true,"com.lb":true,"edu.lb":true,"gov.lb":true,"net.lb":true,"org.lb":true,"lc":true,"com.lc":true,"net.lc":true,"co.lc":true,"org.lc":true,"edu.lc":true,"gov.lc":true,"li":true,"lk":true,"gov.lk":true,"sch.lk":true,"net.lk":true,"int.lk":true,"com.lk":true,"org.lk":true,"edu.lk":true,"ngo.lk":true,"soc.lk":true,"web.lk":true,"ltd.lk":true,"assn.lk":true,"grp.lk":true,"hotel.lk":true,"ac.lk":true,"lr":true,"com.lr":true,"edu.lr":true,"gov.lr":true,"org.lr":true,"net.lr":true,"ls":true,"co.ls":true,"org.ls":true,"lt":true,"gov.lt":true,"lu":true,"lv":true,"com.lv":true,"edu.lv":true,"gov.lv":true,"org.lv":true,"mil.lv":true,"id.lv":true,"net.lv":true,"asn.lv":true,"conf.lv":true,"ly":true,"com.ly":true,"net.ly":true,"gov.ly":true,"plc.ly":true,"edu.ly":true,"sch.ly":true,"med.ly":true,"org.ly":true,"id.ly":true,"ma":true,"co.ma":true,"net.ma":true,"gov.ma":true,"org.ma":true,"ac.ma":true,"press.ma":true,"mc":true,"tm.mc":true,"asso.mc":true,"md":true,"me":true,"co.me":true,"net.me":true,"org.me":true,"edu.me":true,"ac.me":true,"gov.me":true,"its.me":true,"priv.me":true,"mg":true,"org.mg":true,"nom.mg":true,"gov.mg":true,"prd.mg":true,"tm.mg":true,"edu.mg":true,"mil.mg":true,"com.mg":true,"co.mg":true,"mh":true,"mil":true,"mk":true,"com.mk":true,"org.mk":true,"net.mk":true,"edu.mk":true,"gov.mk":true,"inf.mk":true,"name.mk":true,"ml":true,"com.ml":true,"edu.ml":true,"gouv.ml":true,"gov.ml":true,"net.ml":true,"org.ml":true,"presse.ml":true,"*.mm":true,"mn":true,"gov.mn":true,"edu.mn":true,"org.mn":true,"mo":true,"com.mo":true,"net.mo":true,"org.mo":true,"edu.mo":true,"gov.mo":true,"mobi":true,"mp":true,"mq":true,"mr":true,"gov.mr":true,"ms":true,"com.ms":true,"edu.ms":true,"gov.ms":true,"net.ms":true,"org.ms":true,"mt":true,"com.mt":true,"edu.mt":true,"net.mt":true,"org.mt":true,"mu":true,"com.mu":true,"net.mu":true,"org.mu":true,"gov.mu":true,"ac.mu":true,"co.mu":true,"or.mu":true,"museum":true,"academy.museum":true,"agriculture.museum":true,"air.museum":true,"airguard.museum":true,"alabama.museum":true,"alaska.museum":true,"amber.museum":true,"ambulance.museum":true,"american.museum":true,"americana.museum":true,"americanantiques.museum":true,"americanart.museum":true,"amsterdam.museum":true,"and.museum":true,"annefrank.museum":true,"anthro.museum":true,"anthropology.museum":true,"antiques.museum":true,"aquarium.museum":true,"arboretum.museum":true,"archaeological.museum":true,"archaeology.museum":true,"architecture.museum":true,"art.museum":true,"artanddesign.museum":true,"artcenter.museum":true,"artdeco.museum":true,"arteducation.museum":true,"artgallery.museum":true,"arts.museum":true,"artsandcrafts.museum":true,"asmatart.museum":true,"assassination.museum":true,"assisi.museum":true,"association.museum":true,"astronomy.museum":true,"atlanta.museum":true,"austin.museum":true,"australia.museum":true,"automotive.museum":true,"aviation.museum":true,"axis.museum":true,"badajoz.museum":true,"baghdad.museum":true,"bahn.museum":true,"bale.museum":true,"baltimore.museum":true,"barcelona.museum":true,"baseball.museum":true,"basel.museum":true,"baths.museum":true,"bauern.museum":true,"beauxarts.museum":true,"beeldengeluid.museum":true,"bellevue.museum":true,"bergbau.museum":true,"berkeley.museum":true,"berlin.museum":true,"bern.museum":true,"bible.museum":true,"bilbao.museum":true,"bill.museum":true,"birdart.museum":true,"birthplace.museum":true,"bonn.museum":true,"boston.museum":true,"botanical.museum":true,"botanicalgarden.museum":true,"botanicgarden.museum":true,"botany.museum":true,"brandywinevalley.museum":true,"brasil.museum":true,"bristol.museum":true,"british.museum":true,"britishcolumbia.museum":true,"broadcast.museum":true,"brunel.museum":true,"brussel.museum":true,"brussels.museum":true,"bruxelles.museum":true,"building.museum":true,"burghof.museum":true,"bus.museum":true,"bushey.museum":true,"cadaques.museum":true,"california.museum":true,"cambridge.museum":true,"can.museum":true,"canada.museum":true,"capebreton.museum":true,"carrier.museum":true,"cartoonart.museum":true,"casadelamoneda.museum":true,"castle.museum":true,"castres.museum":true,"celtic.museum":true,"center.museum":true,"chattanooga.museum":true,"cheltenham.museum":true,"chesapeakebay.museum":true,"chicago.museum":true,"children.museum":true,"childrens.museum":true,"childrensgarden.museum":true,"chiropractic.museum":true,"chocolate.museum":true,"christiansburg.museum":true,"cincinnati.museum":true,"cinema.museum":true,"circus.museum":true,"civilisation.museum":true,"civilization.museum":true,"civilwar.museum":true,"clinton.museum":true,"clock.museum":true,"coal.museum":true,"coastaldefence.museum":true,"cody.museum":true,"coldwar.museum":true,"collection.museum":true,"colonialwilliamsburg.museum":true,"coloradoplateau.museum":true,"columbia.museum":true,"columbus.museum":true,"communication.museum":true,"communications.museum":true,"community.museum":true,"computer.museum":true,"computerhistory.museum":true,"xn--comunicaes-v6a2o.museum":true,"contemporary.museum":true,"contemporaryart.museum":true,"convent.museum":true,"copenhagen.museum":true,"corporation.museum":true,"xn--correios-e-telecomunicaes-ghc29a.museum":true,"corvette.museum":true,"costume.museum":true,"countryestate.museum":true,"county.museum":true,"crafts.museum":true,"cranbrook.museum":true,"creation.museum":true,"cultural.museum":true,"culturalcenter.museum":true,"culture.museum":true,"cyber.museum":true,"cymru.museum":true,"dali.museum":true,"dallas.museum":true,"database.museum":true,"ddr.museum":true,"decorativearts.museum":true,"delaware.museum":true,"delmenhorst.museum":true,"denmark.museum":true,"depot.museum":true,"design.museum":true,"detroit.museum":true,"dinosaur.museum":true,"discovery.museum":true,"dolls.museum":true,"donostia.museum":true,"durham.museum":true,"eastafrica.museum":true,"eastcoast.museum":true,"education.museum":true,"educational.museum":true,"egyptian.museum":true,"eisenbahn.museum":true,"elburg.museum":true,"elvendrell.museum":true,"embroidery.museum":true,"encyclopedic.museum":true,"england.museum":true,"entomology.museum":true,"environment.museum":true,"environmentalconservation.museum":true,"epilepsy.museum":true,"essex.museum":true,"estate.museum":true,"ethnology.museum":true,"exeter.museum":true,"exhibition.museum":true,"family.museum":true,"farm.museum":true,"farmequipment.museum":true,"farmers.museum":true,"farmstead.museum":true,"field.museum":true,"figueres.museum":true,"filatelia.museum":true,"film.museum":true,"fineart.museum":true,"finearts.museum":true,"finland.museum":true,"flanders.museum":true,"florida.museum":true,"force.museum":true,"fortmissoula.museum":true,"fortworth.museum":true,"foundation.museum":true,"francaise.museum":true,"frankfurt.museum":true,"franziskaner.museum":true,"freemasonry.museum":true,"freiburg.museum":true,"fribourg.museum":true,"frog.museum":true,"fundacio.museum":true,"furniture.museum":true,"gallery.museum":true,"garden.museum":true,"gateway.museum":true,"geelvinck.museum":true,"gemological.museum":true,"geology.museum":true,"georgia.museum":true,"giessen.museum":true,"glas.museum":true,"glass.museum":true,"gorge.museum":true,"grandrapids.museum":true,"graz.museum":true,"guernsey.museum":true,"halloffame.museum":true,"hamburg.museum":true,"handson.museum":true,"harvestcelebration.museum":true,"hawaii.museum":true,"health.museum":true,"heimatunduhren.museum":true,"hellas.museum":true,"helsinki.museum":true,"hembygdsforbund.museum":true,"heritage.museum":true,"histoire.museum":true,"historical.museum":true,"historicalsociety.museum":true,"historichouses.museum":true,"historisch.museum":true,"historisches.museum":true,"history.museum":true,"historyofscience.museum":true,"horology.museum":true,"house.museum":true,"humanities.museum":true,"illustration.museum":true,"imageandsound.museum":true,"indian.museum":true,"indiana.museum":true,"indianapolis.museum":true,"indianmarket.museum":true,"intelligence.museum":true,"interactive.museum":true,"iraq.museum":true,"iron.museum":true,"isleofman.museum":true,"jamison.museum":true,"jefferson.museum":true,"jerusalem.museum":true,"jewelry.museum":true,"jewish.museum":true,"jewishart.museum":true,"jfk.museum":true,"journalism.museum":true,"judaica.museum":true,"judygarland.museum":true,"juedisches.museum":true,"juif.museum":true,"karate.museum":true,"karikatur.museum":true,"kids.museum":true,"koebenhavn.museum":true,"koeln.museum":true,"kunst.museum":true,"kunstsammlung.museum":true,"kunstunddesign.museum":true,"labor.museum":true,"labour.museum":true,"lajolla.museum":true,"lancashire.museum":true,"landes.museum":true,"lans.museum":true,"xn--lns-qla.museum":true,"larsson.museum":true,"lewismiller.museum":true,"lincoln.museum":true,"linz.museum":true,"living.museum":true,"livinghistory.museum":true,"localhistory.museum":true,"london.museum":true,"losangeles.museum":true,"louvre.museum":true,"loyalist.museum":true,"lucerne.museum":true,"luxembourg.museum":true,"luzern.museum":true,"mad.museum":true,"madrid.museum":true,"mallorca.museum":true,"manchester.museum":true,"mansion.museum":true,"mansions.museum":true,"manx.museum":true,"marburg.museum":true,"maritime.museum":true,"maritimo.museum":true,"maryland.museum":true,"marylhurst.museum":true,"media.museum":true,"medical.museum":true,"medizinhistorisches.museum":true,"meeres.museum":true,"memorial.museum":true,"mesaverde.museum":true,"michigan.museum":true,"midatlantic.museum":true,"military.museum":true,"mill.museum":true,"miners.museum":true,"mining.museum":true,"minnesota.museum":true,"missile.museum":true,"missoula.museum":true,"modern.museum":true,"moma.museum":true,"money.museum":true,"monmouth.museum":true,"monticello.museum":true,"montreal.museum":true,"moscow.museum":true,"motorcycle.museum":true,"muenchen.museum":true,"muenster.museum":true,"mulhouse.museum":true,"muncie.museum":true,"museet.museum":true,"museumcenter.museum":true,"museumvereniging.museum":true,"music.museum":true,"national.museum":true,"nationalfirearms.museum":true,"nationalheritage.museum":true,"nativeamerican.museum":true,"naturalhistory.museum":true,"naturalhistorymuseum.museum":true,"naturalsciences.museum":true,"nature.museum":true,"naturhistorisches.museum":true,"natuurwetenschappen.museum":true,"naumburg.museum":true,"naval.museum":true,"nebraska.museum":true,"neues.museum":true,"newhampshire.museum":true,"newjersey.museum":true,"newmexico.museum":true,"newport.museum":true,"newspaper.museum":true,"newyork.museum":true,"niepce.museum":true,"norfolk.museum":true,"north.museum":true,"nrw.museum":true,"nuernberg.museum":true,"nuremberg.museum":true,"nyc.museum":true,"nyny.museum":true,"oceanographic.museum":true,"oceanographique.museum":true,"omaha.museum":true,"online.museum":true,"ontario.museum":true,"openair.museum":true,"oregon.museum":true,"oregontrail.museum":true,"otago.museum":true,"oxford.museum":true,"pacific.museum":true,"paderborn.museum":true,"palace.museum":true,"paleo.museum":true,"palmsprings.museum":true,"panama.museum":true,"paris.museum":true,"pasadena.museum":true,"pharmacy.museum":true,"philadelphia.museum":true,"philadelphiaarea.museum":true,"philately.museum":true,"phoenix.museum":true,"photography.museum":true,"pilots.museum":true,"pittsburgh.museum":true,"planetarium.museum":true,"plantation.museum":true,"plants.museum":true,"plaza.museum":true,"portal.museum":true,"portland.museum":true,"portlligat.museum":true,"posts-and-telecommunications.museum":true,"preservation.museum":true,"presidio.museum":true,"press.museum":true,"project.museum":true,"public.museum":true,"pubol.museum":true,"quebec.museum":true,"railroad.museum":true,"railway.museum":true,"research.museum":true,"resistance.museum":true,"riodejaneiro.museum":true,"rochester.museum":true,"rockart.museum":true,"roma.museum":true,"russia.museum":true,"saintlouis.museum":true,"salem.museum":true,"salvadordali.museum":true,"salzburg.museum":true,"sandiego.museum":true,"sanfrancisco.museum":true,"santabarbara.museum":true,"santacruz.museum":true,"santafe.museum":true,"saskatchewan.museum":true,"satx.museum":true,"savannahga.museum":true,"schlesisches.museum":true,"schoenbrunn.museum":true,"schokoladen.museum":true,"school.museum":true,"schweiz.museum":true,"science.museum":true,"scienceandhistory.museum":true,"scienceandindustry.museum":true,"sciencecenter.museum":true,"sciencecenters.museum":true,"science-fiction.museum":true,"sciencehistory.museum":true,"sciences.museum":true,"sciencesnaturelles.museum":true,"scotland.museum":true,"seaport.museum":true,"settlement.museum":true,"settlers.museum":true,"shell.museum":true,"sherbrooke.museum":true,"sibenik.museum":true,"silk.museum":true,"ski.museum":true,"skole.museum":true,"society.museum":true,"sologne.museum":true,"soundandvision.museum":true,"southcarolina.museum":true,"southwest.museum":true,"space.museum":true,"spy.museum":true,"square.museum":true,"stadt.museum":true,"stalbans.museum":true,"starnberg.museum":true,"state.museum":true,"stateofdelaware.museum":true,"station.museum":true,"steam.museum":true,"steiermark.museum":true,"stjohn.museum":true,"stockholm.museum":true,"stpetersburg.museum":true,"stuttgart.museum":true,"suisse.museum":true,"surgeonshall.museum":true,"surrey.museum":true,"svizzera.museum":true,"sweden.museum":true,"sydney.museum":true,"tank.museum":true,"tcm.museum":true,"technology.museum":true,"telekommunikation.museum":true,"television.museum":true,"texas.museum":true,"textile.museum":true,"theater.museum":true,"time.museum":true,"timekeeping.museum":true,"topology.museum":true,"torino.museum":true,"touch.museum":true,"town.museum":true,"transport.museum":true,"tree.museum":true,"trolley.museum":true,"trust.museum":true,"trustee.museum":true,"uhren.museum":true,"ulm.museum":true,"undersea.museum":true,"university.museum":true,"usa.museum":true,"usantiques.museum":true,"usarts.museum":true,"uscountryestate.museum":true,"usculture.museum":true,"usdecorativearts.museum":true,"usgarden.museum":true,"ushistory.museum":true,"ushuaia.museum":true,"uslivinghistory.museum":true,"utah.museum":true,"uvic.museum":true,"valley.museum":true,"vantaa.museum":true,"versailles.museum":true,"viking.museum":true,"village.museum":true,"virginia.museum":true,"virtual.museum":true,"virtuel.museum":true,"vlaanderen.museum":true,"volkenkunde.museum":true,"wales.museum":true,"wallonie.museum":true,"war.museum":true,"washingtondc.museum":true,"watchandclock.museum":true,"watch-and-clock.museum":true,"western.museum":true,"westfalen.museum":true,"whaling.museum":true,"wildlife.museum":true,"williamsburg.museum":true,"windmill.museum":true,"workshop.museum":true,"york.museum":true,"yorkshire.museum":true,"yosemite.museum":true,"youth.museum":true,"zoological.museum":true,"zoology.museum":true,"xn--9dbhblg6di.museum":true,"xn--h1aegh.museum":true,"mv":true,"aero.mv":true,"biz.mv":true,"com.mv":true,"coop.mv":true,"edu.mv":true,"gov.mv":true,"info.mv":true,"int.mv":true,"mil.mv":true,"museum.mv":true,"name.mv":true,"net.mv":true,"org.mv":true,"pro.mv":true,"mw":true,"ac.mw":true,"biz.mw":true,"co.mw":true,"com.mw":true,"coop.mw":true,"edu.mw":true,"gov.mw":true,"int.mw":true,"museum.mw":true,"net.mw":true,"org.mw":true,"mx":true,"com.mx":true,"org.mx":true,"gob.mx":true,"edu.mx":true,"net.mx":true,"my":true,"com.my":true,"net.my":true,"org.my":true,"gov.my":true,"edu.my":true,"mil.my":true,"name.my":true,"*.mz":true,"teledata.mz":false,"na":true,"info.na":true,"pro.na":true,"name.na":true,"school.na":true,"or.na":true,"dr.na":true,"us.na":true,"mx.na":true,"ca.na":true,"in.na":true,"cc.na":true,"tv.na":true,"ws.na":true,"mobi.na":true,"co.na":true,"com.na":true,"org.na":true,"name":true,"nc":true,"asso.nc":true,"ne":true,"net":true,"nf":true,"com.nf":true,"net.nf":true,"per.nf":true,"rec.nf":true,"web.nf":true,"arts.nf":true,"firm.nf":true,"info.nf":true,"other.nf":true,"store.nf":true,"ng":true,"com.ng":true,"edu.ng":true,"name.ng":true,"net.ng":true,"org.ng":true,"sch.ng":true,"gov.ng":true,"mil.ng":true,"mobi.ng":true,"*.ni":true,"nl":true,"bv.nl":true,"no":true,"fhs.no":true,"vgs.no":true,"fylkesbibl.no":true,"folkebibl.no":true,"museum.no":true,"idrett.no":true,"priv.no":true,"mil.no":true,"stat.no":true,"dep.no":true,"kommune.no":true,"herad.no":true,"aa.no":true,"ah.no":true,"bu.no":true,"fm.no":true,"hl.no":true,"hm.no":true,"jan-mayen.no":true,"mr.no":true,"nl.no":true,"nt.no":true,"of.no":true,"ol.no":true,"oslo.no":true,"rl.no":true,"sf.no":true,"st.no":true,"svalbard.no":true,"tm.no":true,"tr.no":true,"va.no":true,"vf.no":true,"gs.aa.no":true,"gs.ah.no":true,"gs.bu.no":true,"gs.fm.no":true,"gs.hl.no":true,"gs.hm.no":true,"gs.jan-mayen.no":true,"gs.mr.no":true,"gs.nl.no":true,"gs.nt.no":true,"gs.of.no":true,"gs.ol.no":true,"gs.oslo.no":true,"gs.rl.no":true,"gs.sf.no":true,"gs.st.no":true,"gs.svalbard.no":true,"gs.tm.no":true,"gs.tr.no":true,"gs.va.no":true,"gs.vf.no":true,"akrehamn.no":true,"xn--krehamn-dxa.no":true,"algard.no":true,"xn--lgrd-poac.no":true,"arna.no":true,"brumunddal.no":true,"bryne.no":true,"bronnoysund.no":true,"xn--brnnysund-m8ac.no":true,"drobak.no":true,"xn--drbak-wua.no":true,"egersund.no":true,"fetsund.no":true,"floro.no":true,"xn--flor-jra.no":true,"fredrikstad.no":true,"hokksund.no":true,"honefoss.no":true,"xn--hnefoss-q1a.no":true,"jessheim.no":true,"jorpeland.no":true,"xn--jrpeland-54a.no":true,"kirkenes.no":true,"kopervik.no":true,"krokstadelva.no":true,"langevag.no":true,"xn--langevg-jxa.no":true,"leirvik.no":true,"mjondalen.no":true,"xn--mjndalen-64a.no":true,"mo-i-rana.no":true,"mosjoen.no":true,"xn--mosjen-eya.no":true,"nesoddtangen.no":true,"orkanger.no":true,"osoyro.no":true,"xn--osyro-wua.no":true,"raholt.no":true,"xn--rholt-mra.no":true,"sandnessjoen.no":true,"xn--sandnessjen-ogb.no":true,"skedsmokorset.no":true,"slattum.no":true,"spjelkavik.no":true,"stathelle.no":true,"stavern.no":true,"stjordalshalsen.no":true,"xn--stjrdalshalsen-sqb.no":true,"tananger.no":true,"tranby.no":true,"vossevangen.no":true,"afjord.no":true,"xn--fjord-lra.no":true,"agdenes.no":true,"al.no":true,"xn--l-1fa.no":true,"alesund.no":true,"xn--lesund-hua.no":true,"alstahaug.no":true,"alta.no":true,"xn--lt-liac.no":true,"alaheadju.no":true,"xn--laheadju-7ya.no":true,"alvdal.no":true,"amli.no":true,"xn--mli-tla.no":true,"amot.no":true,"xn--mot-tla.no":true,"andebu.no":true,"andoy.no":true,"xn--andy-ira.no":true,"andasuolo.no":true,"ardal.no":true,"xn--rdal-poa.no":true,"aremark.no":true,"arendal.no":true,"xn--s-1fa.no":true,"aseral.no":true,"xn--seral-lra.no":true,"asker.no":true,"askim.no":true,"askvoll.no":true,"askoy.no":true,"xn--asky-ira.no":true,"asnes.no":true,"xn--snes-poa.no":true,"audnedaln.no":true,"aukra.no":true,"aure.no":true,"aurland.no":true,"aurskog-holand.no":true,"xn--aurskog-hland-jnb.no":true,"austevoll.no":true,"austrheim.no":true,"averoy.no":true,"xn--avery-yua.no":true,"balestrand.no":true,"ballangen.no":true,"balat.no":true,"xn--blt-elab.no":true,"balsfjord.no":true,"bahccavuotna.no":true,"xn--bhccavuotna-k7a.no":true,"bamble.no":true,"bardu.no":true,"beardu.no":true,"beiarn.no":true,"bajddar.no":true,"xn--bjddar-pta.no":true,"baidar.no":true,"xn--bidr-5nac.no":true,"berg.no":true,"bergen.no":true,"berlevag.no":true,"xn--berlevg-jxa.no":true,"bearalvahki.no":true,"xn--bearalvhki-y4a.no":true,"bindal.no":true,"birkenes.no":true,"bjarkoy.no":true,"xn--bjarky-fya.no":true,"bjerkreim.no":true,"bjugn.no":true,"bodo.no":true,"xn--bod-2na.no":true,"badaddja.no":true,"xn--bdddj-mrabd.no":true,"budejju.no":true,"bokn.no":true,"bremanger.no":true,"bronnoy.no":true,"xn--brnny-wuac.no":true,"bygland.no":true,"bykle.no":true,"barum.no":true,"xn--brum-voa.no":true,"bo.telemark.no":true,"xn--b-5ga.telemark.no":true,"bo.nordland.no":true,"xn--b-5ga.nordland.no":true,"bievat.no":true,"xn--bievt-0qa.no":true,"bomlo.no":true,"xn--bmlo-gra.no":true,"batsfjord.no":true,"xn--btsfjord-9za.no":true,"bahcavuotna.no":true,"xn--bhcavuotna-s4a.no":true,"dovre.no":true,"drammen.no":true,"drangedal.no":true,"dyroy.no":true,"xn--dyry-ira.no":true,"donna.no":true,"xn--dnna-gra.no":true,"eid.no":true,"eidfjord.no":true,"eidsberg.no":true,"eidskog.no":true,"eidsvoll.no":true,"eigersund.no":true,"elverum.no":true,"enebakk.no":true,"engerdal.no":true,"etne.no":true,"etnedal.no":true,"evenes.no":true,"evenassi.no":true,"xn--eveni-0qa01ga.no":true,"evje-og-hornnes.no":true,"farsund.no":true,"fauske.no":true,"fuossko.no":true,"fuoisku.no":true,"fedje.no":true,"fet.no":true,"finnoy.no":true,"xn--finny-yua.no":true,"fitjar.no":true,"fjaler.no":true,"fjell.no":true,"flakstad.no":true,"flatanger.no":true,"flekkefjord.no":true,"flesberg.no":true,"flora.no":true,"fla.no":true,"xn--fl-zia.no":true,"folldal.no":true,"forsand.no":true,"fosnes.no":true,"frei.no":true,"frogn.no":true,"froland.no":true,"frosta.no":true,"frana.no":true,"xn--frna-woa.no":true,"froya.no":true,"xn--frya-hra.no":true,"fusa.no":true,"fyresdal.no":true,"forde.no":true,"xn--frde-gra.no":true,"gamvik.no":true,"gangaviika.no":true,"xn--ggaviika-8ya47h.no":true,"gaular.no":true,"gausdal.no":true,"gildeskal.no":true,"xn--gildeskl-g0a.no":true,"giske.no":true,"gjemnes.no":true,"gjerdrum.no":true,"gjerstad.no":true,"gjesdal.no":true,"gjovik.no":true,"xn--gjvik-wua.no":true,"gloppen.no":true,"gol.no":true,"gran.no":true,"grane.no":true,"granvin.no":true,"gratangen.no":true,"grimstad.no":true,"grong.no":true,"kraanghke.no":true,"xn--kranghke-b0a.no":true,"grue.no":true,"gulen.no":true,"hadsel.no":true,"halden.no":true,"halsa.no":true,"hamar.no":true,"hamaroy.no":true,"habmer.no":true,"xn--hbmer-xqa.no":true,"hapmir.no":true,"xn--hpmir-xqa.no":true,"hammerfest.no":true,"hammarfeasta.no":true,"xn--hmmrfeasta-s4ac.no":true,"haram.no":true,"hareid.no":true,"harstad.no":true,"hasvik.no":true,"aknoluokta.no":true,"xn--koluokta-7ya57h.no":true,"hattfjelldal.no":true,"aarborte.no":true,"haugesund.no":true,"hemne.no":true,"hemnes.no":true,"hemsedal.no":true,"heroy.more-og-romsdal.no":true,"xn--hery-ira.xn--mre-og-romsdal-qqb.no":true,"heroy.nordland.no":true,"xn--hery-ira.nordland.no":true,"hitra.no":true,"hjartdal.no":true,"hjelmeland.no":true,"hobol.no":true,"xn--hobl-ira.no":true,"hof.no":true,"hol.no":true,"hole.no":true,"holmestrand.no":true,"holtalen.no":true,"xn--holtlen-hxa.no":true,"hornindal.no":true,"horten.no":true,"hurdal.no":true,"hurum.no":true,"hvaler.no":true,"hyllestad.no":true,"hagebostad.no":true,"xn--hgebostad-g3a.no":true,"hoyanger.no":true,"xn--hyanger-q1a.no":true,"hoylandet.no":true,"xn--hylandet-54a.no":true,"ha.no":true,"xn--h-2fa.no":true,"ibestad.no":true,"inderoy.no":true,"xn--indery-fya.no":true,"iveland.no":true,"jevnaker.no":true,"jondal.no":true,"jolster.no":true,"xn--jlster-bya.no":true,"karasjok.no":true,"karasjohka.no":true,"xn--krjohka-hwab49j.no":true,"karlsoy.no":true,"galsa.no":true,"xn--gls-elac.no":true,"karmoy.no":true,"xn--karmy-yua.no":true,"kautokeino.no":true,"guovdageaidnu.no":true,"klepp.no":true,"klabu.no":true,"xn--klbu-woa.no":true,"kongsberg.no":true,"kongsvinger.no":true,"kragero.no":true,"xn--krager-gya.no":true,"kristiansand.no":true,"kristiansund.no":true,"krodsherad.no":true,"xn--krdsherad-m8a.no":true,"kvalsund.no":true,"rahkkeravju.no":true,"xn--rhkkervju-01af.no":true,"kvam.no":true,"kvinesdal.no":true,"kvinnherad.no":true,"kviteseid.no":true,"kvitsoy.no":true,"xn--kvitsy-fya.no":true,"kvafjord.no":true,"xn--kvfjord-nxa.no":true,"giehtavuoatna.no":true,"kvanangen.no":true,"xn--kvnangen-k0a.no":true,"navuotna.no":true,"xn--nvuotna-hwa.no":true,"kafjord.no":true,"xn--kfjord-iua.no":true,"gaivuotna.no":true,"xn--givuotna-8ya.no":true,"larvik.no":true,"lavangen.no":true,"lavagis.no":true,"loabat.no":true,"xn--loabt-0qa.no":true,"lebesby.no":true,"davvesiida.no":true,"leikanger.no":true,"leirfjord.no":true,"leka.no":true,"leksvik.no":true,"lenvik.no":true,"leangaviika.no":true,"xn--leagaviika-52b.no":true,"lesja.no":true,"levanger.no":true,"lier.no":true,"lierne.no":true,"lillehammer.no":true,"lillesand.no":true,"lindesnes.no":true,"lindas.no":true,"xn--linds-pra.no":true,"lom.no":true,"loppa.no":true,"lahppi.no":true,"xn--lhppi-xqa.no":true,"lund.no":true,"lunner.no":true,"luroy.no":true,"xn--lury-ira.no":true,"luster.no":true,"lyngdal.no":true,"lyngen.no":true,"ivgu.no":true,"lardal.no":true,"lerdal.no":true,"xn--lrdal-sra.no":true,"lodingen.no":true,"xn--ldingen-q1a.no":true,"lorenskog.no":true,"xn--lrenskog-54a.no":true,"loten.no":true,"xn--lten-gra.no":true,"malvik.no":true,"masoy.no":true,"xn--msy-ula0h.no":true,"muosat.no":true,"xn--muost-0qa.no":true,"mandal.no":true,"marker.no":true,"marnardal.no":true,"masfjorden.no":true,"meland.no":true,"meldal.no":true,"melhus.no":true,"meloy.no":true,"xn--mely-ira.no":true,"meraker.no":true,"xn--merker-kua.no":true,"moareke.no":true,"xn--moreke-jua.no":true,"midsund.no":true,"midtre-gauldal.no":true,"modalen.no":true,"modum.no":true,"molde.no":true,"moskenes.no":true,"moss.no":true,"mosvik.no":true,"malselv.no":true,"xn--mlselv-iua.no":true,"malatvuopmi.no":true,"xn--mlatvuopmi-s4a.no":true,"namdalseid.no":true,"aejrie.no":true,"namsos.no":true,"namsskogan.no":true,"naamesjevuemie.no":true,"xn--nmesjevuemie-tcba.no":true,"laakesvuemie.no":true,"nannestad.no":true,"narvik.no":true,"narviika.no":true,"naustdal.no":true,"nedre-eiker.no":true,"nes.akershus.no":true,"nes.buskerud.no":true,"nesna.no":true,"nesodden.no":true,"nesseby.no":true,"unjarga.no":true,"xn--unjrga-rta.no":true,"nesset.no":true,"nissedal.no":true,"nittedal.no":true,"nord-aurdal.no":true,"nord-fron.no":true,"nord-odal.no":true,"norddal.no":true,"nordkapp.no":true,"davvenjarga.no":true,"xn--davvenjrga-y4a.no":true,"nordre-land.no":true,"nordreisa.no":true,"raisa.no":true,"xn--risa-5na.no":true,"nore-og-uvdal.no":true,"notodden.no":true,"naroy.no":true,"xn--nry-yla5g.no":true,"notteroy.no":true,"xn--nttery-byae.no":true,"odda.no":true,"oksnes.no":true,"xn--ksnes-uua.no":true,"oppdal.no":true,"oppegard.no":true,"xn--oppegrd-ixa.no":true,"orkdal.no":true,"orland.no":true,"xn--rland-uua.no":true,"orskog.no":true,"xn--rskog-uua.no":true,"orsta.no":true,"xn--rsta-fra.no":true,"os.hedmark.no":true,"os.hordaland.no":true,"osen.no":true,"osteroy.no":true,"xn--ostery-fya.no":true,"ostre-toten.no":true,"xn--stre-toten-zcb.no":true,"overhalla.no":true,"ovre-eiker.no":true,"xn--vre-eiker-k8a.no":true,"oyer.no":true,"xn--yer-zna.no":true,"oygarden.no":true,"xn--ygarden-p1a.no":true,"oystre-slidre.no":true,"xn--ystre-slidre-ujb.no":true,"porsanger.no":true,"porsangu.no":true,"xn--porsgu-sta26f.no":true,"porsgrunn.no":true,"radoy.no":true,"xn--rady-ira.no":true,"rakkestad.no":true,"rana.no":true,"ruovat.no":true,"randaberg.no":true,"rauma.no":true,"rendalen.no":true,"rennebu.no":true,"rennesoy.no":true,"xn--rennesy-v1a.no":true,"rindal.no":true,"ringebu.no":true,"ringerike.no":true,"ringsaker.no":true,"rissa.no":true,"risor.no":true,"xn--risr-ira.no":true,"roan.no":true,"rollag.no":true,"rygge.no":true,"ralingen.no":true,"xn--rlingen-mxa.no":true,"rodoy.no":true,"xn--rdy-0nab.no":true,"romskog.no":true,"xn--rmskog-bya.no":true,"roros.no":true,"xn--rros-gra.no":true,"rost.no":true,"xn--rst-0na.no":true,"royken.no":true,"xn--ryken-vua.no":true,"royrvik.no":true,"xn--ryrvik-bya.no":true,"rade.no":true,"xn--rde-ula.no":true,"salangen.no":true,"siellak.no":true,"saltdal.no":true,"salat.no":true,"xn--slt-elab.no":true,"xn--slat-5na.no":true,"samnanger.no":true,"sande.more-og-romsdal.no":true,"sande.xn--mre-og-romsdal-qqb.no":true,"sande.vestfold.no":true,"sandefjord.no":true,"sandnes.no":true,"sandoy.no":true,"xn--sandy-yua.no":true,"sarpsborg.no":true,"sauda.no":true,"sauherad.no":true,"sel.no":true,"selbu.no":true,"selje.no":true,"seljord.no":true,"sigdal.no":true,"siljan.no":true,"sirdal.no":true,"skaun.no":true,"skedsmo.no":true,"ski.no":true,"skien.no":true,"skiptvet.no":true,"skjervoy.no":true,"xn--skjervy-v1a.no":true,"skierva.no":true,"xn--skierv-uta.no":true,"skjak.no":true,"xn--skjk-soa.no":true,"skodje.no":true,"skanland.no":true,"xn--sknland-fxa.no":true,"skanit.no":true,"xn--sknit-yqa.no":true,"smola.no":true,"xn--smla-hra.no":true,"snillfjord.no":true,"snasa.no":true,"xn--snsa-roa.no":true,"snoasa.no":true,"snaase.no":true,"xn--snase-nra.no":true,"sogndal.no":true,"sokndal.no":true,"sola.no":true,"solund.no":true,"songdalen.no":true,"sortland.no":true,"spydeberg.no":true,"stange.no":true,"stavanger.no":true,"steigen.no":true,"steinkjer.no":true,"stjordal.no":true,"xn--stjrdal-s1a.no":true,"stokke.no":true,"stor-elvdal.no":true,"stord.no":true,"stordal.no":true,"storfjord.no":true,"omasvuotna.no":true,"strand.no":true,"stranda.no":true,"stryn.no":true,"sula.no":true,"suldal.no":true,"sund.no":true,"sunndal.no":true,"surnadal.no":true,"sveio.no":true,"svelvik.no":true,"sykkylven.no":true,"sogne.no":true,"xn--sgne-gra.no":true,"somna.no":true,"xn--smna-gra.no":true,"sondre-land.no":true,"xn--sndre-land-0cb.no":true,"sor-aurdal.no":true,"xn--sr-aurdal-l8a.no":true,"sor-fron.no":true,"xn--sr-fron-q1a.no":true,"sor-odal.no":true,"xn--sr-odal-q1a.no":true,"sor-varanger.no":true,"xn--sr-varanger-ggb.no":true,"matta-varjjat.no":true,"xn--mtta-vrjjat-k7af.no":true,"sorfold.no":true,"xn--srfold-bya.no":true,"sorreisa.no":true,"xn--srreisa-q1a.no":true,"sorum.no":true,"xn--srum-gra.no":true,"tana.no":true,"deatnu.no":true,"time.no":true,"tingvoll.no":true,"tinn.no":true,"tjeldsund.no":true,"dielddanuorri.no":true,"tjome.no":true,"xn--tjme-hra.no":true,"tokke.no":true,"tolga.no":true,"torsken.no":true,"tranoy.no":true,"xn--trany-yua.no":true,"tromso.no":true,"xn--troms-zua.no":true,"tromsa.no":true,"romsa.no":true,"trondheim.no":true,"troandin.no":true,"trysil.no":true,"trana.no":true,"xn--trna-woa.no":true,"trogstad.no":true,"xn--trgstad-r1a.no":true,"tvedestrand.no":true,"tydal.no":true,"tynset.no":true,"tysfjord.no":true,"divtasvuodna.no":true,"divttasvuotna.no":true,"tysnes.no":true,"tysvar.no":true,"xn--tysvr-vra.no":true,"tonsberg.no":true,"xn--tnsberg-q1a.no":true,"ullensaker.no":true,"ullensvang.no":true,"ulvik.no":true,"utsira.no":true,"vadso.no":true,"xn--vads-jra.no":true,"cahcesuolo.no":true,"xn--hcesuolo-7ya35b.no":true,"vaksdal.no":true,"valle.no":true,"vang.no":true,"vanylven.no":true,"vardo.no":true,"xn--vard-jra.no":true,"varggat.no":true,"xn--vrggt-xqad.no":true,"vefsn.no":true,"vaapste.no":true,"vega.no":true,"vegarshei.no":true,"xn--vegrshei-c0a.no":true,"vennesla.no":true,"verdal.no":true,"verran.no":true,"vestby.no":true,"vestnes.no":true,"vestre-slidre.no":true,"vestre-toten.no":true,"vestvagoy.no":true,"xn--vestvgy-ixa6o.no":true,"vevelstad.no":true,"vik.no":true,"vikna.no":true,"vindafjord.no":true,"volda.no":true,"voss.no":true,"varoy.no":true,"xn--vry-yla5g.no":true,"vagan.no":true,"xn--vgan-qoa.no":true,"voagat.no":true,"vagsoy.no":true,"xn--vgsy-qoa0j.no":true,"vaga.no":true,"xn--vg-yiab.no":true,"valer.ostfold.no":true,"xn--vler-qoa.xn--stfold-9xa.no":true,"valer.hedmark.no":true,"xn--vler-qoa.hedmark.no":true,"*.np":true,"nr":true,"biz.nr":true,"info.nr":true,"gov.nr":true,"edu.nr":true,"org.nr":true,"net.nr":true,"com.nr":true,"nu":true,"nz":true,"ac.nz":true,"co.nz":true,"cri.nz":true,"geek.nz":true,"gen.nz":true,"govt.nz":true,"health.nz":true,"iwi.nz":true,"kiwi.nz":true,"maori.nz":true,"mil.nz":true,"xn--mori-qsa.nz":true,"net.nz":true,"org.nz":true,"parliament.nz":true,"school.nz":true,"om":true,"co.om":true,"com.om":true,"edu.om":true,"gov.om":true,"med.om":true,"museum.om":true,"net.om":true,"org.om":true,"pro.om":true,"org":true,"pa":true,"ac.pa":true,"gob.pa":true,"com.pa":true,"org.pa":true,"sld.pa":true,"edu.pa":true,"net.pa":true,"ing.pa":true,"abo.pa":true,"med.pa":true,"nom.pa":true,"pe":true,"edu.pe":true,"gob.pe":true,"nom.pe":true,"mil.pe":true,"org.pe":true,"com.pe":true,"net.pe":true,"pf":true,"com.pf":true,"org.pf":true,"edu.pf":true,"*.pg":true,"ph":true,"com.ph":true,"net.ph":true,"org.ph":true,"gov.ph":true,"edu.ph":true,"ngo.ph":true,"mil.ph":true,"i.ph":true,"pk":true,"com.pk":true,"net.pk":true,"edu.pk":true,"org.pk":true,"fam.pk":true,"biz.pk":true,"web.pk":true,"gov.pk":true,"gob.pk":true,"gok.pk":true,"gon.pk":true,"gop.pk":true,"gos.pk":true,"info.pk":true,"pl":true,"com.pl":true,"net.pl":true,"org.pl":true,"aid.pl":true,"agro.pl":true,"atm.pl":true,"auto.pl":true,"biz.pl":true,"edu.pl":true,"gmina.pl":true,"gsm.pl":true,"info.pl":true,"mail.pl":true,"miasta.pl":true,"media.pl":true,"mil.pl":true,"nieruchomosci.pl":true,"nom.pl":true,"pc.pl":true,"powiat.pl":true,"priv.pl":true,"realestate.pl":true,"rel.pl":true,"sex.pl":true,"shop.pl":true,"sklep.pl":true,"sos.pl":true,"szkola.pl":true,"targi.pl":true,"tm.pl":true,"tourism.pl":true,"travel.pl":true,"turystyka.pl":true,"gov.pl":true,"ap.gov.pl":true,"ic.gov.pl":true,"is.gov.pl":true,"us.gov.pl":true,"kmpsp.gov.pl":true,"kppsp.gov.pl":true,"kwpsp.gov.pl":true,"psp.gov.pl":true,"wskr.gov.pl":true,"kwp.gov.pl":true,"mw.gov.pl":true,"ug.gov.pl":true,"um.gov.pl":true,"umig.gov.pl":true,"ugim.gov.pl":true,"upow.gov.pl":true,"uw.gov.pl":true,"starostwo.gov.pl":true,"pa.gov.pl":true,"po.gov.pl":true,"psse.gov.pl":true,"pup.gov.pl":true,"rzgw.gov.pl":true,"sa.gov.pl":true,"so.gov.pl":true,"sr.gov.pl":true,"wsa.gov.pl":true,"sko.gov.pl":true,"uzs.gov.pl":true,"wiih.gov.pl":true,"winb.gov.pl":true,"pinb.gov.pl":true,"wios.gov.pl":true,"witd.gov.pl":true,"wzmiuw.gov.pl":true,"piw.gov.pl":true,"wiw.gov.pl":true,"griw.gov.pl":true,"wif.gov.pl":true,"oum.gov.pl":true,"sdn.gov.pl":true,"zp.gov.pl":true,"uppo.gov.pl":true,"mup.gov.pl":true,"wuoz.gov.pl":true,"konsulat.gov.pl":true,"oirm.gov.pl":true,"augustow.pl":true,"babia-gora.pl":true,"bedzin.pl":true,"beskidy.pl":true,"bialowieza.pl":true,"bialystok.pl":true,"bielawa.pl":true,"bieszczady.pl":true,"boleslawiec.pl":true,"bydgoszcz.pl":true,"bytom.pl":true,"cieszyn.pl":true,"czeladz.pl":true,"czest.pl":true,"dlugoleka.pl":true,"elblag.pl":true,"elk.pl":true,"glogow.pl":true,"gniezno.pl":true,"gorlice.pl":true,"grajewo.pl":true,"ilawa.pl":true,"jaworzno.pl":true,"jelenia-gora.pl":true,"jgora.pl":true,"kalisz.pl":true,"kazimierz-dolny.pl":true,"karpacz.pl":true,"kartuzy.pl":true,"kaszuby.pl":true,"katowice.pl":true,"kepno.pl":true,"ketrzyn.pl":true,"klodzko.pl":true,"kobierzyce.pl":true,"kolobrzeg.pl":true,"konin.pl":true,"konskowola.pl":true,"kutno.pl":true,"lapy.pl":true,"lebork.pl":true,"legnica.pl":true,"lezajsk.pl":true,"limanowa.pl":true,"lomza.pl":true,"lowicz.pl":true,"lubin.pl":true,"lukow.pl":true,"malbork.pl":true,"malopolska.pl":true,"mazowsze.pl":true,"mazury.pl":true,"mielec.pl":true,"mielno.pl":true,"mragowo.pl":true,"naklo.pl":true,"nowaruda.pl":true,"nysa.pl":true,"olawa.pl":true,"olecko.pl":true,"olkusz.pl":true,"olsztyn.pl":true,"opoczno.pl":true,"opole.pl":true,"ostroda.pl":true,"ostroleka.pl":true,"ostrowiec.pl":true,"ostrowwlkp.pl":true,"pila.pl":true,"pisz.pl":true,"podhale.pl":true,"podlasie.pl":true,"polkowice.pl":true,"pomorze.pl":true,"pomorskie.pl":true,"prochowice.pl":true,"pruszkow.pl":true,"przeworsk.pl":true,"pulawy.pl":true,"radom.pl":true,"rawa-maz.pl":true,"rybnik.pl":true,"rzeszow.pl":true,"sanok.pl":true,"sejny.pl":true,"slask.pl":true,"slupsk.pl":true,"sosnowiec.pl":true,"stalowa-wola.pl":true,"skoczow.pl":true,"starachowice.pl":true,"stargard.pl":true,"suwalki.pl":true,"swidnica.pl":true,"swiebodzin.pl":true,"swinoujscie.pl":true,"szczecin.pl":true,"szczytno.pl":true,"tarnobrzeg.pl":true,"tgory.pl":true,"turek.pl":true,"tychy.pl":true,"ustka.pl":true,"walbrzych.pl":true,"warmia.pl":true,"warszawa.pl":true,"waw.pl":true,"wegrow.pl":true,"wielun.pl":true,"wlocl.pl":true,"wloclawek.pl":true,"wodzislaw.pl":true,"wolomin.pl":true,"wroclaw.pl":true,"zachpomor.pl":true,"zagan.pl":true,"zarow.pl":true,"zgora.pl":true,"zgorzelec.pl":true,"pm":true,"pn":true,"gov.pn":true,"co.pn":true,"org.pn":true,"edu.pn":true,"net.pn":true,"post":true,"pr":true,"com.pr":true,"net.pr":true,"org.pr":true,"gov.pr":true,"edu.pr":true,"isla.pr":true,"pro.pr":true,"biz.pr":true,"info.pr":true,"name.pr":true,"est.pr":true,"prof.pr":true,"ac.pr":true,"pro":true,"aca.pro":true,"bar.pro":true,"cpa.pro":true,"jur.pro":true,"law.pro":true,"med.pro":true,"eng.pro":true,"ps":true,"edu.ps":true,"gov.ps":true,"sec.ps":true,"plo.ps":true,"com.ps":true,"org.ps":true,"net.ps":true,"pt":true,"net.pt":true,"gov.pt":true,"org.pt":true,"edu.pt":true,"int.pt":true,"publ.pt":true,"com.pt":true,"nome.pt":true,"pw":true,"co.pw":true,"ne.pw":true,"or.pw":true,"ed.pw":true,"go.pw":true,"belau.pw":true,"py":true,"com.py":true,"coop.py":true,"edu.py":true,"gov.py":true,"mil.py":true,"net.py":true,"org.py":true,"qa":true,"com.qa":true,"edu.qa":true,"gov.qa":true,"mil.qa":true,"name.qa":true,"net.qa":true,"org.qa":true,"sch.qa":true,"re":true,"com.re":true,"asso.re":true,"nom.re":true,"ro":true,"com.ro":true,"org.ro":true,"tm.ro":true,"nt.ro":true,"nom.ro":true,"info.ro":true,"rec.ro":true,"arts.ro":true,"firm.ro":true,"store.ro":true,"www.ro":true,"rs":true,"co.rs":true,"org.rs":true,"edu.rs":true,"ac.rs":true,"gov.rs":true,"in.rs":true,"ru":true,"ac.ru":true,"com.ru":true,"edu.ru":true,"int.ru":true,"net.ru":true,"org.ru":true,"pp.ru":true,"adygeya.ru":true,"altai.ru":true,"amur.ru":true,"arkhangelsk.ru":true,"astrakhan.ru":true,"bashkiria.ru":true,"belgorod.ru":true,"bir.ru":true,"bryansk.ru":true,"buryatia.ru":true,"cbg.ru":true,"chel.ru":true,"chelyabinsk.ru":true,"chita.ru":true,"chukotka.ru":true,"chuvashia.ru":true,"dagestan.ru":true,"dudinka.ru":true,"e-burg.ru":true,"grozny.ru":true,"irkutsk.ru":true,"ivanovo.ru":true,"izhevsk.ru":true,"jar.ru":true,"joshkar-ola.ru":true,"kalmykia.ru":true,"kaluga.ru":true,"kamchatka.ru":true,"karelia.ru":true,"kazan.ru":true,"kchr.ru":true,"kemerovo.ru":true,"khabarovsk.ru":true,"khakassia.ru":true,"khv.ru":true,"kirov.ru":true,"koenig.ru":true,"komi.ru":true,"kostroma.ru":true,"krasnoyarsk.ru":true,"kuban.ru":true,"kurgan.ru":true,"kursk.ru":true,"lipetsk.ru":true,"magadan.ru":true,"mari.ru":true,"mari-el.ru":true,"marine.ru":true,"mordovia.ru":true,"msk.ru":true,"murmansk.ru":true,"nalchik.ru":true,"nnov.ru":true,"nov.ru":true,"novosibirsk.ru":true,"nsk.ru":true,"omsk.ru":true,"orenburg.ru":true,"oryol.ru":true,"palana.ru":true,"penza.ru":true,"perm.ru":true,"ptz.ru":true,"rnd.ru":true,"ryazan.ru":true,"sakhalin.ru":true,"samara.ru":true,"saratov.ru":true,"simbirsk.ru":true,"smolensk.ru":true,"spb.ru":true,"stavropol.ru":true,"stv.ru":true,"surgut.ru":true,"tambov.ru":true,"tatarstan.ru":true,"tom.ru":true,"tomsk.ru":true,"tsaritsyn.ru":true,"tsk.ru":true,"tula.ru":true,"tuva.ru":true,"tver.ru":true,"tyumen.ru":true,"udm.ru":true,"udmurtia.ru":true,"ulan-ude.ru":true,"vladikavkaz.ru":true,"vladimir.ru":true,"vladivostok.ru":true,"volgograd.ru":true,"vologda.ru":true,"voronezh.ru":true,"vrn.ru":true,"vyatka.ru":true,"yakutia.ru":true,"yamal.ru":true,"yaroslavl.ru":true,"yekaterinburg.ru":true,"yuzhno-sakhalinsk.ru":true,"amursk.ru":true,"baikal.ru":true,"cmw.ru":true,"fareast.ru":true,"jamal.ru":true,"kms.ru":true,"k-uralsk.ru":true,"kustanai.ru":true,"kuzbass.ru":true,"magnitka.ru":true,"mytis.ru":true,"nakhodka.ru":true,"nkz.ru":true,"norilsk.ru":true,"oskol.ru":true,"pyatigorsk.ru":true,"rubtsovsk.ru":true,"snz.ru":true,"syzran.ru":true,"vdonsk.ru":true,"zgrad.ru":true,"gov.ru":true,"mil.ru":true,"test.ru":true,"rw":true,"gov.rw":true,"net.rw":true,"edu.rw":true,"ac.rw":true,"com.rw":true,"co.rw":true,"int.rw":true,"mil.rw":true,"gouv.rw":true,"sa":true,"com.sa":true,"net.sa":true,"org.sa":true,"gov.sa":true,"med.sa":true,"pub.sa":true,"edu.sa":true,"sch.sa":true,"sb":true,"com.sb":true,"edu.sb":true,"gov.sb":true,"net.sb":true,"org.sb":true,"sc":true,"com.sc":true,"gov.sc":true,"net.sc":true,"org.sc":true,"edu.sc":true,"sd":true,"com.sd":true,"net.sd":true,"org.sd":true,"edu.sd":true,"med.sd":true,"tv.sd":true,"gov.sd":true,"info.sd":true,"se":true,"a.se":true,"ac.se":true,"b.se":true,"bd.se":true,"brand.se":true,"c.se":true,"d.se":true,"e.se":true,"f.se":true,"fh.se":true,"fhsk.se":true,"fhv.se":true,"g.se":true,"h.se":true,"i.se":true,"k.se":true,"komforb.se":true,"kommunalforbund.se":true,"komvux.se":true,"l.se":true,"lanbib.se":true,"m.se":true,"n.se":true,"naturbruksgymn.se":true,"o.se":true,"org.se":true,"p.se":true,"parti.se":true,"pp.se":true,"press.se":true,"r.se":true,"s.se":true,"t.se":true,"tm.se":true,"u.se":true,"w.se":true,"x.se":true,"y.se":true,"z.se":true,"sg":true,"com.sg":true,"net.sg":true,"org.sg":true,"gov.sg":true,"edu.sg":true,"per.sg":true,"sh":true,"com.sh":true,"net.sh":true,"gov.sh":true,"org.sh":true,"mil.sh":true,"si":true,"sj":true,"sk":true,"sl":true,"com.sl":true,"net.sl":true,"edu.sl":true,"gov.sl":true,"org.sl":true,"sm":true,"sn":true,"art.sn":true,"com.sn":true,"edu.sn":true,"gouv.sn":true,"org.sn":true,"perso.sn":true,"univ.sn":true,"so":true,"com.so":true,"net.so":true,"org.so":true,"sr":true,"st":true,"co.st":true,"com.st":true,"consulado.st":true,"edu.st":true,"embaixada.st":true,"gov.st":true,"mil.st":true,"net.st":true,"org.st":true,"principe.st":true,"saotome.st":true,"store.st":true,"su":true,"adygeya.su":true,"arkhangelsk.su":true,"balashov.su":true,"bashkiria.su":true,"bryansk.su":true,"dagestan.su":true,"grozny.su":true,"ivanovo.su":true,"kalmykia.su":true,"kaluga.su":true,"karelia.su":true,"khakassia.su":true,"krasnodar.su":true,"kurgan.su":true,"lenug.su":true,"mordovia.su":true,"msk.su":true,"murmansk.su":true,"nalchik.su":true,"nov.su":true,"obninsk.su":true,"penza.su":true,"pokrovsk.su":true,"sochi.su":true,"spb.su":true,"togliatti.su":true,"troitsk.su":true,"tula.su":true,"tuva.su":true,"vladikavkaz.su":true,"vladimir.su":true,"vologda.su":true,"sv":true,"com.sv":true,"edu.sv":true,"gob.sv":true,"org.sv":true,"red.sv":true,"sx":true,"gov.sx":true,"sy":true,"edu.sy":true,"gov.sy":true,"net.sy":true,"mil.sy":true,"com.sy":true,"org.sy":true,"sz":true,"co.sz":true,"ac.sz":true,"org.sz":true,"tc":true,"td":true,"tel":true,"tf":true,"tg":true,"th":true,"ac.th":true,"co.th":true,"go.th":true,"in.th":true,"mi.th":true,"net.th":true,"or.th":true,"tj":true,"ac.tj":true,"biz.tj":true,"co.tj":true,"com.tj":true,"edu.tj":true,"go.tj":true,"gov.tj":true,"int.tj":true,"mil.tj":true,"name.tj":true,"net.tj":true,"nic.tj":true,"org.tj":true,"test.tj":true,"web.tj":true,"tk":true,"tl":true,"gov.tl":true,"tm":true,"com.tm":true,"co.tm":true,"org.tm":true,"net.tm":true,"nom.tm":true,"gov.tm":true,"mil.tm":true,"edu.tm":true,"tn":true,"com.tn":true,"ens.tn":true,"fin.tn":true,"gov.tn":true,"ind.tn":true,"intl.tn":true,"nat.tn":true,"net.tn":true,"org.tn":true,"info.tn":true,"perso.tn":true,"tourism.tn":true,"edunet.tn":true,"rnrt.tn":true,"rns.tn":true,"rnu.tn":true,"mincom.tn":true,"agrinet.tn":true,"defense.tn":true,"turen.tn":true,"to":true,"com.to":true,"gov.to":true,"net.to":true,"org.to":true,"edu.to":true,"mil.to":true,"tp":true,"tr":true,"com.tr":true,"info.tr":true,"biz.tr":true,"net.tr":true,"org.tr":true,"web.tr":true,"gen.tr":true,"tv.tr":true,"av.tr":true,"dr.tr":true,"bbs.tr":true,"name.tr":true,"tel.tr":true,"gov.tr":true,"bel.tr":true,"pol.tr":true,"mil.tr":true,"k12.tr":true,"edu.tr":true,"kep.tr":true,"nc.tr":true,"gov.nc.tr":true,"travel":true,"tt":true,"co.tt":true,"com.tt":true,"org.tt":true,"net.tt":true,"biz.tt":true,"info.tt":true,"pro.tt":true,"int.tt":true,"coop.tt":true,"jobs.tt":true,"mobi.tt":true,"travel.tt":true,"museum.tt":true,"aero.tt":true,"name.tt":true,"gov.tt":true,"edu.tt":true,"tv":true,"tw":true,"edu.tw":true,"gov.tw":true,"mil.tw":true,"com.tw":true,"net.tw":true,"org.tw":true,"idv.tw":true,"game.tw":true,"ebiz.tw":true,"club.tw":true,"xn--zf0ao64a.tw":true,"xn--uc0atv.tw":true,"xn--czrw28b.tw":true,"tz":true,"ac.tz":true,"co.tz":true,"go.tz":true,"hotel.tz":true,"info.tz":true,"me.tz":true,"mil.tz":true,"mobi.tz":true,"ne.tz":true,"or.tz":true,"sc.tz":true,"tv.tz":true,"ua":true,"com.ua":true,"edu.ua":true,"gov.ua":true,"in.ua":true,"net.ua":true,"org.ua":true,"cherkassy.ua":true,"cherkasy.ua":true,"chernigov.ua":true,"chernihiv.ua":true,"chernivtsi.ua":true,"chernovtsy.ua":true,"ck.ua":true,"cn.ua":true,"cr.ua":true,"crimea.ua":true,"cv.ua":true,"dn.ua":true,"dnepropetrovsk.ua":true,"dnipropetrovsk.ua":true,"dominic.ua":true,"donetsk.ua":true,"dp.ua":true,"if.ua":true,"ivano-frankivsk.ua":true,"kh.ua":true,"kharkiv.ua":true,"kharkov.ua":true,"kherson.ua":true,"khmelnitskiy.ua":true,"khmelnytskyi.ua":true,"kiev.ua":true,"kirovograd.ua":true,"km.ua":true,"kr.ua":true,"krym.ua":true,"ks.ua":true,"kv.ua":true,"kyiv.ua":true,"lg.ua":true,"lt.ua":true,"lugansk.ua":true,"lutsk.ua":true,"lv.ua":true,"lviv.ua":true,"mk.ua":true,"mykolaiv.ua":true,"nikolaev.ua":true,"od.ua":true,"odesa.ua":true,"odessa.ua":true,"pl.ua":true,"poltava.ua":true,"rivne.ua":true,"rovno.ua":true,"rv.ua":true,"sb.ua":true,"sebastopol.ua":true,"sevastopol.ua":true,"sm.ua":true,"sumy.ua":true,"te.ua":true,"ternopil.ua":true,"uz.ua":true,"uzhgorod.ua":true,"vinnica.ua":true,"vinnytsia.ua":true,"vn.ua":true,"volyn.ua":true,"yalta.ua":true,"zaporizhzhe.ua":true,"zaporizhzhia.ua":true,"zhitomir.ua":true,"zhytomyr.ua":true,"zp.ua":true,"zt.ua":true,"ug":true,"co.ug":true,"or.ug":true,"ac.ug":true,"sc.ug":true,"go.ug":true,"ne.ug":true,"com.ug":true,"org.ug":true,"uk":true,"ac.uk":true,"co.uk":true,"gov.uk":true,"ltd.uk":true,"me.uk":true,"net.uk":true,"nhs.uk":true,"org.uk":true,"plc.uk":true,"police.uk":true,"*.sch.uk":true,"us":true,"dni.us":true,"fed.us":true,"isa.us":true,"kids.us":true,"nsn.us":true,"ak.us":true,"al.us":true,"ar.us":true,"as.us":true,"az.us":true,"ca.us":true,"co.us":true,"ct.us":true,"dc.us":true,"de.us":true,"fl.us":true,"ga.us":true,"gu.us":true,"hi.us":true,"ia.us":true,"id.us":true,"il.us":true,"in.us":true,"ks.us":true,"ky.us":true,"la.us":true,"ma.us":true,"md.us":true,"me.us":true,"mi.us":true,"mn.us":true,"mo.us":true,"ms.us":true,"mt.us":true,"nc.us":true,"nd.us":true,"ne.us":true,"nh.us":true,"nj.us":true,"nm.us":true,"nv.us":true,"ny.us":true,"oh.us":true,"ok.us":true,"or.us":true,"pa.us":true,"pr.us":true,"ri.us":true,"sc.us":true,"sd.us":true,"tn.us":true,"tx.us":true,"ut.us":true,"vi.us":true,"vt.us":true,"va.us":true,"wa.us":true,"wi.us":true,"wv.us":true,"wy.us":true,"k12.ak.us":true,"k12.al.us":true,"k12.ar.us":true,"k12.as.us":true,"k12.az.us":true,"k12.ca.us":true,"k12.co.us":true,"k12.ct.us":true,"k12.dc.us":true,"k12.de.us":true,"k12.fl.us":true,"k12.ga.us":true,"k12.gu.us":true,"k12.ia.us":true,"k12.id.us":true,"k12.il.us":true,"k12.in.us":true,"k12.ks.us":true,"k12.ky.us":true,"k12.la.us":true,"k12.ma.us":true,"k12.md.us":true,"k12.me.us":true,"k12.mi.us":true,"k12.mn.us":true,"k12.mo.us":true,"k12.ms.us":true,"k12.mt.us":true,"k12.nc.us":true,"k12.ne.us":true,"k12.nh.us":true,"k12.nj.us":true,"k12.nm.us":true,"k12.nv.us":true,"k12.ny.us":true,"k12.oh.us":true,"k12.ok.us":true,"k12.or.us":true,"k12.pa.us":true,"k12.pr.us":true,"k12.ri.us":true,"k12.sc.us":true,"k12.tn.us":true,"k12.tx.us":true,"k12.ut.us":true,"k12.vi.us":true,"k12.vt.us":true,"k12.va.us":true,"k12.wa.us":true,"k12.wi.us":true,"k12.wy.us":true,"cc.ak.us":true,"cc.al.us":true,"cc.ar.us":true,"cc.as.us":true,"cc.az.us":true,"cc.ca.us":true,"cc.co.us":true,"cc.ct.us":true,"cc.dc.us":true,"cc.de.us":true,"cc.fl.us":true,"cc.ga.us":true,"cc.gu.us":true,"cc.hi.us":true,"cc.ia.us":true,"cc.id.us":true,"cc.il.us":true,"cc.in.us":true,"cc.ks.us":true,"cc.ky.us":true,"cc.la.us":true,"cc.ma.us":true,"cc.md.us":true,"cc.me.us":true,"cc.mi.us":true,"cc.mn.us":true,"cc.mo.us":true,"cc.ms.us":true,"cc.mt.us":true,"cc.nc.us":true,"cc.nd.us":true,"cc.ne.us":true,"cc.nh.us":true,"cc.nj.us":true,"cc.nm.us":true,"cc.nv.us":true,"cc.ny.us":true,"cc.oh.us":true,"cc.ok.us":true,"cc.or.us":true,"cc.pa.us":true,"cc.pr.us":true,"cc.ri.us":true,"cc.sc.us":true,"cc.sd.us":true,"cc.tn.us":true,"cc.tx.us":true,"cc.ut.us":true,"cc.vi.us":true,"cc.vt.us":true,"cc.va.us":true,"cc.wa.us":true,"cc.wi.us":true,"cc.wv.us":true,"cc.wy.us":true,"lib.ak.us":true,"lib.al.us":true,"lib.ar.us":true,"lib.as.us":true,"lib.az.us":true,"lib.ca.us":true,"lib.co.us":true,"lib.ct.us":true,"lib.dc.us":true,"lib.de.us":true,"lib.fl.us":true,"lib.ga.us":true,"lib.gu.us":true,"lib.hi.us":true,"lib.ia.us":true,"lib.id.us":true,"lib.il.us":true,"lib.in.us":true,"lib.ks.us":true,"lib.ky.us":true,"lib.la.us":true,"lib.ma.us":true,"lib.md.us":true,"lib.me.us":true,"lib.mi.us":true,"lib.mn.us":true,"lib.mo.us":true,"lib.ms.us":true,"lib.mt.us":true,"lib.nc.us":true,"lib.nd.us":true,"lib.ne.us":true,"lib.nh.us":true,"lib.nj.us":true,"lib.nm.us":true,"lib.nv.us":true,"lib.ny.us":true,"lib.oh.us":true,"lib.ok.us":true,"lib.or.us":true,"lib.pa.us":true,"lib.pr.us":true,"lib.ri.us":true,"lib.sc.us":true,"lib.sd.us":true,"lib.tn.us":true,"lib.tx.us":true,"lib.ut.us":true,"lib.vi.us":true,"lib.vt.us":true,"lib.va.us":true,"lib.wa.us":true,"lib.wi.us":true,"lib.wy.us":true,"pvt.k12.ma.us":true,"chtr.k12.ma.us":true,"paroch.k12.ma.us":true,"uy":true,"com.uy":true,"edu.uy":true,"gub.uy":true,"mil.uy":true,"net.uy":true,"org.uy":true,"uz":true,"co.uz":true,"com.uz":true,"net.uz":true,"org.uz":true,"va":true,"vc":true,"com.vc":true,"net.vc":true,"org.vc":true,"gov.vc":true,"mil.vc":true,"edu.vc":true,"ve":true,"arts.ve":true,"co.ve":true,"com.ve":true,"e12.ve":true,"edu.ve":true,"firm.ve":true,"gob.ve":true,"gov.ve":true,"info.ve":true,"int.ve":true,"mil.ve":true,"net.ve":true,"org.ve":true,"rec.ve":true,"store.ve":true,"tec.ve":true,"web.ve":true,"vg":true,"vi":true,"co.vi":true,"com.vi":true,"k12.vi":true,"net.vi":true,"org.vi":true,"vn":true,"com.vn":true,"net.vn":true,"org.vn":true,"edu.vn":true,"gov.vn":true,"int.vn":true,"ac.vn":true,"biz.vn":true,"info.vn":true,"name.vn":true,"pro.vn":true,"health.vn":true,"vu":true,"com.vu":true,"edu.vu":true,"net.vu":true,"org.vu":true,"wf":true,"ws":true,"com.ws":true,"net.ws":true,"org.ws":true,"gov.ws":true,"edu.ws":true,"yt":true,"xn--mgbaam7a8h":true,"xn--y9a3aq":true,"xn--54b7fta0cc":true,"xn--90ais":true,"xn--fiqs8s":true,"xn--fiqz9s":true,"xn--lgbbat1ad8j":true,"xn--wgbh1c":true,"xn--node":true,"xn--qxam":true,"xn--j6w193g":true,"xn--h2brj9c":true,"xn--mgbbh1a71e":true,"xn--fpcrj9c3d":true,"xn--gecrj9c":true,"xn--s9brj9c":true,"xn--45brj9c":true,"xn--xkc2dl3a5ee0h":true,"xn--mgba3a4f16a":true,"xn--mgba3a4fra":true,"xn--mgbtx2b":true,"xn--mgbayh7gpa":true,"xn--3e0b707e":true,"xn--80ao21a":true,"xn--fzc2c9e2c":true,"xn--xkc2al3hye2a":true,"xn--mgbc0a9azcg":true,"xn--d1alf":true,"xn--l1acc":true,"xn--mix891f":true,"xn--mix082f":true,"xn--mgbx4cd0ab":true,"xn--mgb9awbf":true,"xn--mgbai9azgqp6j":true,"xn--mgbai9a5eva00b":true,"xn--ygbi2ammx":true,"xn--90a3ac":true,"xn--o1ac.xn--90a3ac":true,"xn--c1avg.xn--90a3ac":true,"xn--90azh.xn--90a3ac":true,"xn--d1at.xn--90a3ac":true,"xn--o1ach.xn--90a3ac":true,"xn--80au.xn--90a3ac":true,"xn--p1ai":true,"xn--wgbl6a":true,"xn--mgberp4a5d4ar":true,"xn--mgberp4a5d4a87g":true,"xn--mgbqly7c0a67fbc":true,"xn--mgbqly7cvafr":true,"xn--mgbpl2fh":true,"xn--yfro4i67o":true,"xn--clchc0ea0b2g2a9gcd":true,"xn--ogbpf8fl":true,"xn--mgbtf8fl":true,"xn--o3cw4h":true,"xn--pgbs0dh":true,"xn--kpry57d":true,"xn--kprw13d":true,"xn--nnx388a":true,"xn--j1amh":true,"xn--mgb2ddes":true,"xxx":true,"*.ye":true,"ac.za":true,"agrica.za":true,"alt.za":true,"co.za":true,"edu.za":true,"gov.za":true,"grondar.za":true,"law.za":true,"mil.za":true,"net.za":true,"ngo.za":true,"nis.za":true,"nom.za":true,"org.za":true,"school.za":true,"tm.za":true,"web.za":true,"*.zm":true,"*.zw":true,"aaa":true,"aarp":true,"abarth":true,"abb":true,"abbott":true,"abbvie":true,"abc":true,"able":true,"abogado":true,"abudhabi":true,"academy":true,"accenture":true,"accountant":true,"accountants":true,"aco":true,"active":true,"actor":true,"adac":true,"ads":true,"adult":true,"aeg":true,"aetna":true,"afamilycompany":true,"afl":true,"africa":true,"africamagic":true,"agakhan":true,"agency":true,"aig":true,"aigo":true,"airbus":true,"airforce":true,"airtel":true,"akdn":true,"alfaromeo":true,"alibaba":true,"alipay":true,"allfinanz":true,"allstate":true,"ally":true,"alsace":true,"alstom":true,"americanexpress":true,"americanfamily":true,"amex":true,"amfam":true,"amica":true,"amsterdam":true,"analytics":true,"android":true,"anquan":true,"anz":true,"aol":true,"apartments":true,"app":true,"apple":true,"aquarelle":true,"aramco":true,"archi":true,"army":true,"arte":true,"asda":true,"associates":true,"athleta":true,"attorney":true,"auction":true,"audi":true,"audible":true,"audio":true,"auspost":true,"author":true,"auto":true,"autos":true,"avianca":true,"aws":true,"axa":true,"azure":true,"baby":true,"baidu":true,"banamex":true,"bananarepublic":true,"band":true,"bank":true,"bar":true,"barcelona":true,"barclaycard":true,"barclays":true,"barefoot":true,"bargains":true,"basketball":true,"bauhaus":true,"bayern":true,"bbc":true,"bbt":true,"bbva":true,"bcg":true,"bcn":true,"beats":true,"beer":true,"bentley":true,"berlin":true,"best":true,"bestbuy":true,"bet":true,"bharti":true,"bible":true,"bid":true,"bike":true,"bing":true,"bingo":true,"bio":true,"black":true,"blackfriday":true,"blanco":true,"blockbuster":true,"blog":true,"bloomberg":true,"blue":true,"bms":true,"bmw":true,"bnl":true,"bnpparibas":true,"boats":true,"boehringer":true,"bofa":true,"bom":true,"bond":true,"boo":true,"book":true,"booking":true,"boots":true,"bosch":true,"bostik":true,"bot":true,"boutique":true,"bradesco":true,"bridgestone":true,"broadway":true,"broker":true,"brother":true,"brussels":true,"budapest":true,"bugatti":true,"build":true,"builders":true,"business":true,"buy":true,"buzz":true,"bzh":true,"cab":true,"cafe":true,"cal":true,"call":true,"calvinklein":true,"camera":true,"camp":true,"cancerresearch":true,"canon":true,"capetown":true,"capital":true,"capitalone":true,"car":true,"caravan":true,"cards":true,"care":true,"career":true,"careers":true,"cars":true,"cartier":true,"casa":true,"case":true,"caseih":true,"cash":true,"casino":true,"catering":true,"cba":true,"cbn":true,"cbre":true,"cbs":true,"ceb":true,"center":true,"ceo":true,"cern":true,"cfa":true,"cfd":true,"chanel":true,"channel":true,"chase":true,"chat":true,"cheap":true,"chintai":true,"chloe":true,"christmas":true,"chrome":true,"chrysler":true,"church":true,"cipriani":true,"circle":true,"cisco":true,"citadel":true,"citi":true,"citic":true,"city":true,"cityeats":true,"claims":true,"cleaning":true,"click":true,"clinic":true,"clothing":true,"cloud":true,"club":true,"clubmed":true,"coach":true,"codes":true,"coffee":true,"college":true,"cologne":true,"comcast":true,"commbank":true,"community":true,"company":true,"computer":true,"comsec":true,"condos":true,"construction":true,"consulting":true,"contact":true,"contractors":true,"cooking":true,"cookingchannel":true,"cool":true,"corsica":true,"country":true,"coupon":true,"coupons":true,"courses":true,"credit":true,"creditcard":true,"creditunion":true,"cricket":true,"crown":true,"crs":true,"cruises":true,"csc":true,"cuisinella":true,"cymru":true,"cyou":true,"dabur":true,"dad":true,"dance":true,"date":true,"dating":true,"datsun":true,"day":true,"dclk":true,"dds":true,"deal":true,"dealer":true,"deals":true,"degree":true,"delivery":true,"dell":true,"deloitte":true,"delta":true,"democrat":true,"dental":true,"dentist":true,"desi":true,"design":true,"dev":true,"dhl":true,"diamonds":true,"diet":true,"digital":true,"direct":true,"directory":true,"discount":true,"discover":true,"dish":true,"dnp":true,"docs":true,"dodge":true,"dog":true,"doha":true,"domains":true,"doosan":true,"dot":true,"download":true,"drive":true,"dstv":true,"dtv":true,"dubai":true,"duck":true,"dunlop":true,"duns":true,"dupont":true,"durban":true,"dvag":true,"dwg":true,"earth":true,"eat":true,"edeka":true,"education":true,"email":true,"emerck":true,"emerson":true,"energy":true,"engineer":true,"engineering":true,"enterprises":true,"epost":true,"epson":true,"equipment":true,"ericsson":true,"erni":true,"esq":true,"estate":true,"esurance":true,"etisalat":true,"eurovision":true,"eus":true,"events":true,"everbank":true,"exchange":true,"expert":true,"exposed":true,"express":true,"extraspace":true,"fage":true,"fail":true,"fairwinds":true,"faith":true,"family":true,"fan":true,"fans":true,"farm":true,"farmers":true,"fashion":true,"fast":true,"fedex":true,"feedback":true,"ferrari":true,"ferrero":true,"fiat":true,"fidelity":true,"fido":true,"film":true,"final":true,"finance":true,"financial":true,"fire":true,"firestone":true,"firmdale":true,"fish":true,"fishing":true,"fit":true,"fitness":true,"flickr":true,"flights":true,"flir":true,"florist":true,"flowers":true,"flsmidth":true,"fly":true,"foo":true,"foodnetwork":true,"football":true,"ford":true,"forex":true,"forsale":true,"forum":true,"foundation":true,"fox":true,"fresenius":true,"frl":true,"frogans":true,"frontdoor":true,"frontier":true,"ftr":true,"fujitsu":true,"fujixerox":true,"fund":true,"furniture":true,"futbol":true,"fyi":true,"gal":true,"gallery":true,"gallo":true,"gallup":true,"game":true,"games":true,"gap":true,"garden":true,"gbiz":true,"gdn":true,"gea":true,"gent":true,"genting":true,"george":true,"ggee":true,"gift":true,"gifts":true,"gives":true,"giving":true,"glade":true,"glass":true,"gle":true,"global":true,"globo":true,"gmail":true,"gmo":true,"gmx":true,"godaddy":true,"gold":true,"goldpoint":true,"golf":true,"goo":true,"goodhands":true,"goodyear":true,"goog":true,"google":true,"gop":true,"got":true,"gotv":true,"grainger":true,"graphics":true,"gratis":true,"green":true,"gripe":true,"group":true,"guardian":true,"gucci":true,"guge":true,"guide":true,"guitars":true,"guru":true,"hamburg":true,"hangout":true,"haus":true,"hbo":true,"hdfc":true,"hdfcbank":true,"health":true,"healthcare":true,"help":true,"helsinki":true,"here":true,"hermes":true,"hgtv":true,"hiphop":true,"hisamitsu":true,"hitachi":true,"hiv":true,"hkt":true,"hockey":true,"holdings":true,"holiday":true,"homedepot":true,"homegoods":true,"homes":true,"homesense":true,"honda":true,"honeywell":true,"horse":true,"host":true,"hosting":true,"hot":true,"hoteles":true,"hotmail":true,"house":true,"how":true,"hsbc":true,"htc":true,"hughes":true,"hyatt":true,"hyundai":true,"ibm":true,"icbc":true,"ice":true,"icu":true,"ieee":true,"ifm":true,"iinet":true,"ikano":true,"imamat":true,"imdb":true,"immo":true,"immobilien":true,"industries":true,"infiniti":true,"ing":true,"ink":true,"institute":true,"insurance":true,"insure":true,"intel":true,"international":true,"intuit":true,"investments":true,"ipiranga":true,"irish":true,"iselect":true,"ismaili":true,"ist":true,"istanbul":true,"itau":true,"itv":true,"iveco":true,"iwc":true,"jaguar":true,"java":true,"jcb":true,"jcp":true,"jeep":true,"jetzt":true,"jewelry":true,"jio":true,"jlc":true,"jll":true,"jmp":true,"jnj":true,"joburg":true,"jot":true,"joy":true,"jpmorgan":true,"jprs":true,"juegos":true,"juniper":true,"kaufen":true,"kddi":true,"kerryhotels":true,"kerrylogistics":true,"kerryproperties":true,"kfh":true,"kia":true,"kim":true,"kinder":true,"kindle":true,"kitchen":true,"kiwi":true,"koeln":true,"komatsu":true,"kosher":true,"kpmg":true,"kpn":true,"krd":true,"kred":true,"kuokgroup":true,"kyknet":true,"kyoto":true,"lacaixa":true,"ladbrokes":true,"lamborghini":true,"lancaster":true,"lancia":true,"lancome":true,"land":true,"landrover":true,"lanxess":true,"lasalle":true,"lat":true,"latino":true,"latrobe":true,"law":true,"lawyer":true,"lds":true,"lease":true,"leclerc":true,"lefrak":true,"legal":true,"lego":true,"lexus":true,"lgbt":true,"liaison":true,"lidl":true,"life":true,"lifeinsurance":true,"lifestyle":true,"lighting":true,"like":true,"lilly":true,"limited":true,"limo":true,"lincoln":true,"linde":true,"link":true,"lipsy":true,"live":true,"living":true,"lixil":true,"loan":true,"loans":true,"locker":true,"locus":true,"loft":true,"lol":true,"london":true,"lotte":true,"lotto":true,"love":true,"lpl":true,"lplfinancial":true,"ltd":true,"ltda":true,"lundbeck":true,"lupin":true,"luxe":true,"luxury":true,"macys":true,"madrid":true,"maif":true,"maison":true,"makeup":true,"man":true,"management":true,"mango":true,"market":true,"marketing":true,"markets":true,"marriott":true,"marshalls":true,"maserati":true,"mattel":true,"mba":true,"mcd":true,"mcdonalds":true,"mckinsey":true,"med":true,"media":true,"meet":true,"melbourne":true,"meme":true,"memorial":true,"men":true,"menu":true,"meo":true,"metlife":true,"miami":true,"microsoft":true,"mini":true,"mint":true,"mit":true,"mitsubishi":true,"mlb":true,"mls":true,"mma":true,"mnet":true,"mobily":true,"moda":true,"moe":true,"moi":true,"mom":true,"monash":true,"money":true,"monster":true,"montblanc":true,"mopar":true,"mormon":true,"mortgage":true,"moscow":true,"moto":true,"motorcycles":true,"mov":true,"movie":true,"movistar":true,"msd":true,"mtn":true,"mtpc":true,"mtr":true,"multichoice":true,"mutual":true,"mutuelle":true,"mzansimagic":true,"nab":true,"nadex":true,"nagoya":true,"naspers":true,"nationwide":true,"natura":true,"navy":true,"nba":true,"nec":true,"netbank":true,"netflix":true,"network":true,"neustar":true,"new":true,"newholland":true,"news":true,"next":true,"nextdirect":true,"nexus":true,"nfl":true,"ngo":true,"nhk":true,"nico":true,"nike":true,"nikon":true,"ninja":true,"nissan":true,"nokia":true,"northwesternmutual":true,"norton":true,"now":true,"nowruz":true,"nowtv":true,"nra":true,"nrw":true,"ntt":true,"nyc":true,"obi":true,"observer":true,"off":true,"office":true,"okinawa":true,"olayan":true,"olayangroup":true,"oldnavy":true,"ollo":true,"omega":true,"one":true,"ong":true,"onl":true,"online":true,"onyourside":true,"ooo":true,"open":true,"oracle":true,"orange":true,"organic":true,"orientexpress":true,"osaka":true,"otsuka":true,"ott":true,"ovh":true,"page":true,"pamperedchef":true,"panasonic":true,"panerai":true,"paris":true,"pars":true,"partners":true,"parts":true,"party":true,"passagens":true,"pay":true,"payu":true,"pccw":true,"pet":true,"pfizer":true,"pharmacy":true,"philips":true,"photo":true,"photography":true,"photos":true,"physio":true,"piaget":true,"pics":true,"pictet":true,"pictures":true,"pid":true,"pin":true,"ping":true,"pink":true,"pioneer":true,"pizza":true,"place":true,"play":true,"playstation":true,"plumbing":true,"plus":true,"pnc":true,"pohl":true,"poker":true,"politie":true,"porn":true,"pramerica":true,"praxi":true,"press":true,"prime":true,"prod":true,"productions":true,"prof":true,"progressive":true,"promo":true,"properties":true,"property":true,"protection":true,"pru":true,"prudential":true,"pub":true,"qpon":true,"quebec":true,"quest":true,"qvc":true,"racing":true,"raid":true,"read":true,"realestate":true,"realtor":true,"realty":true,"recipes":true,"red":true,"redstone":true,"redumbrella":true,"rehab":true,"reise":true,"reisen":true,"reit":true,"reliance":true,"ren":true,"rent":true,"rentals":true,"repair":true,"report":true,"republican":true,"rest":true,"restaurant":true,"review":true,"reviews":true,"rexroth":true,"rich":true,"richardli":true,"ricoh":true,"rightathome":true,"ril":true,"rio":true,"rip":true,"rocher":true,"rocks":true,"rodeo":true,"rogers":true,"room":true,"rsvp":true,"ruhr":true,"run":true,"rwe":true,"ryukyu":true,"saarland":true,"safe":true,"safety":true,"sakura":true,"sale":true,"salon":true,"samsclub":true,"samsung":true,"sandvik":true,"sandvikcoromant":true,"sanofi":true,"sap":true,"sapo":true,"sarl":true,"sas":true,"save":true,"saxo":true,"sbi":true,"sbs":true,"sca":true,"scb":true,"schaeffler":true,"schmidt":true,"scholarships":true,"school":true,"schule":true,"schwarz":true,"science":true,"scjohnson":true,"scor":true,"scot":true,"seat":true,"secure":true,"security":true,"seek":true,"sener":true,"services":true,"ses":true,"seven":true,"sew":true,"sex":true,"sexy":true,"sfr":true,"shangrila":true,"sharp":true,"shaw":true,"shell":true,"shia":true,"shiksha":true,"shoes":true,"shouji":true,"show":true,"showtime":true,"shriram":true,"silk":true,"sina":true,"singles":true,"site":true,"ski":true,"skin":true,"sky":true,"skype":true,"sling":true,"smart":true,"smile":true,"sncf":true,"soccer":true,"social":true,"softbank":true,"software":true,"sohu":true,"solar":true,"solutions":true,"song":true,"sony":true,"soy":true,"space":true,"spiegel":true,"spot":true,"spreadbetting":true,"srl":true,"srt":true,"stada":true,"staples":true,"star":true,"starhub":true,"statebank":true,"statefarm":true,"statoil":true,"stc":true,"stcgroup":true,"stockholm":true,"storage":true,"store":true,"studio":true,"study":true,"style":true,"sucks":true,"supersport":true,"supplies":true,"supply":true,"support":true,"surf":true,"surgery":true,"suzuki":true,"swatch":true,"swiftcover":true,"swiss":true,"sydney":true,"symantec":true,"systems":true,"tab":true,"taipei":true,"talk":true,"taobao":true,"target":true,"tatamotors":true,"tatar":true,"tattoo":true,"tax":true,"taxi":true,"tci":true,"tdk":true,"team":true,"tech":true,"technology":true,"telecity":true,"telefonica":true,"temasek":true,"tennis":true,"teva":true,"thd":true,"theater":true,"theatre":true,"theguardian":true,"tiaa":true,"tickets":true,"tienda":true,"tiffany":true,"tips":true,"tires":true,"tirol":true,"tjmaxx":true,"tjx":true,"tkmaxx":true,"tmall":true,"today":true,"tokyo":true,"tools":true,"top":true,"toray":true,"toshiba":true,"total":true,"tours":true,"town":true,"toyota":true,"toys":true,"trade":true,"trading":true,"training":true,"travelchannel":true,"travelers":true,"travelersinsurance":true,"trust":true,"trv":true,"tube":true,"tui":true,"tunes":true,"tushu":true,"tvs":true,"ubank":true,"ubs":true,"uconnect":true,"university":true,"uno":true,"uol":true,"ups":true,"vacations":true,"vana":true,"vanguard":true,"vegas":true,"ventures":true,"verisign":true,"versicherung":true,"vet":true,"viajes":true,"video":true,"vig":true,"viking":true,"villas":true,"vin":true,"vip":true,"virgin":true,"visa":true,"vision":true,"vista":true,"vistaprint":true,"viva":true,"vivo":true,"vlaanderen":true,"vodka":true,"volkswagen":true,"vote":true,"voting":true,"voto":true,"voyage":true,"vuelos":true,"wales":true,"walmart":true,"walter":true,"wang":true,"wanggou":true,"warman":true,"watch":true,"watches":true,"weather":true,"weatherchannel":true,"webcam":true,"weber":true,"website":true,"wed":true,"wedding":true,"weibo":true,"weir":true,"whoswho":true,"wien":true,"wiki":true,"williamhill":true,"win":true,"windows":true,"wine":true,"winners":true,"wme":true,"wolterskluwer":true,"woodside":true,"work":true,"works":true,"world":true,"wtc":true,"wtf":true,"xbox":true,"xerox":true,"xfinity":true,"xihuan":true,"xin":true,"xn--11b4c3d":true,"xn--1ck2e1b":true,"xn--1qqw23a":true,"xn--30rr7y":true,"xn--3bst00m":true,"xn--3ds443g":true,"xn--3oq18vl8pn36a":true,"xn--3pxu8k":true,"xn--42c2d9a":true,"xn--45q11c":true,"xn--4gbrim":true,"xn--4gq48lf9j":true,"xn--55qw42g":true,"xn--55qx5d":true,"xn--5su34j936bgsg":true,"xn--5tzm5g":true,"xn--6frz82g":true,"xn--6qq986b3xl":true,"xn--80adxhks":true,"xn--80asehdb":true,"xn--80aswg":true,"xn--8y0a063a":true,"xn--9dbq2a":true,"xn--9et52u":true,"xn--9krt00a":true,"xn--b4w605ferd":true,"xn--bck1b9a5dre4c":true,"xn--c1avg":true,"xn--c2br7g":true,"xn--cck2b3b":true,"xn--cg4bki":true,"xn--czr694b":true,"xn--czrs0t":true,"xn--czru2d":true,"xn--d1acj3b":true,"xn--eckvdtc9d":true,"xn--efvy88h":true,"xn--estv75g":true,"xn--fct429k":true,"xn--fhbei":true,"xn--fiq228c5hs":true,"xn--fiq64b":true,"xn--fjq720a":true,"xn--flw351e":true,"xn--fzys8d69uvgm":true,"xn--g2xx48c":true,"xn--gckr3f0f":true,"xn--hxt814e":true,"xn--i1b6b1a6a2e":true,"xn--imr513n":true,"xn--io0a7i":true,"xn--j1aef":true,"xn--jlq61u9w7b":true,"xn--jvr189m":true,"xn--kcrx77d1x4a":true,"xn--kpu716f":true,"xn--kput3i":true,"xn--mgba3a3ejt":true,"xn--mgba7c0bbn0a":true,"xn--mgbaakc7dvf":true,"xn--mgbab2bd":true,"xn--mgbb9fbpob":true,"xn--mgbca7dzdo":true,"xn--mgbt3dhd":true,"xn--mk1bu44c":true,"xn--mxtq1m":true,"xn--ngbc5azd":true,"xn--ngbe9e0a":true,"xn--nqv7f":true,"xn--nqv7fs00ema":true,"xn--nyqy26a":true,"xn--p1acf":true,"xn--pbt977c":true,"xn--pssy2u":true,"xn--q9jyb4c":true,"xn--qcka1pmc":true,"xn--rhqv96g":true,"xn--rovu88b":true,"xn--ses554g":true,"xn--t60b56a":true,"xn--tckwe":true,"xn--unup4y":true,"xn--vermgensberater-ctb":true,"xn--vermgensberatung-pwb":true,"xn--vhquv":true,"xn--vuq861b":true,"xn--w4r85el8fhu5dnra":true,"xn--w4rs40l":true,"xn--xhq521b":true,"xn--zfr164b":true,"xperia":true,"xyz":true,"yachts":true,"yahoo":true,"yamaxun":true,"yandex":true,"yodobashi":true,"yoga":true,"yokohama":true,"you":true,"youtube":true,"yun":true,"zappos":true,"zara":true,"zero":true,"zip":true,"zippo":true,"zone":true,"zuerich":true,"cloudfront.net":true,"ap-northeast-1.compute.amazonaws.com":true,"ap-southeast-1.compute.amazonaws.com":true,"ap-southeast-2.compute.amazonaws.com":true,"cn-north-1.compute.amazonaws.cn":true,"compute.amazonaws.cn":true,"compute.amazonaws.com":true,"compute-1.amazonaws.com":true,"eu-west-1.compute.amazonaws.com":true,"eu-central-1.compute.amazonaws.com":true,"sa-east-1.compute.amazonaws.com":true,"us-east-1.amazonaws.com":true,"us-gov-west-1.compute.amazonaws.com":true,"us-west-1.compute.amazonaws.com":true,"us-west-2.compute.amazonaws.com":true,"z-1.compute-1.amazonaws.com":true,"z-2.compute-1.amazonaws.com":true,"elasticbeanstalk.com":true,"elb.amazonaws.com":true,"s3.amazonaws.com":true,"s3-ap-northeast-1.amazonaws.com":true,"s3-ap-southeast-1.amazonaws.com":true,"s3-ap-southeast-2.amazonaws.com":true,"s3-external-1.amazonaws.com":true,"s3-external-2.amazonaws.com":true,"s3-fips-us-gov-west-1.amazonaws.com":true,"s3-eu-central-1.amazonaws.com":true,"s3-eu-west-1.amazonaws.com":true,"s3-sa-east-1.amazonaws.com":true,"s3-us-gov-west-1.amazonaws.com":true,"s3-us-west-1.amazonaws.com":true,"s3-us-west-2.amazonaws.com":true,"s3.cn-north-1.amazonaws.com.cn":true,"s3.eu-central-1.amazonaws.com":true,"betainabox.com":true,"ae.org":true,"ar.com":true,"br.com":true,"cn.com":true,"com.de":true,"com.se":true,"de.com":true,"eu.com":true,"gb.com":true,"gb.net":true,"hu.com":true,"hu.net":true,"jp.net":true,"jpn.com":true,"kr.com":true,"mex.com":true,"no.com":true,"qc.com":true,"ru.com":true,"sa.com":true,"se.com":true,"se.net":true,"uk.com":true,"uk.net":true,"us.com":true,"uy.com":true,"za.bz":true,"za.com":true,"africa.com":true,"gr.com":true,"in.net":true,"us.org":true,"co.com":true,"c.la":true,"cloudcontrolled.com":true,"cloudcontrolapp.com":true,"co.ca":true,"c.cdn77.org":true,"cdn77-ssl.net":true,"r.cdn77.net":true,"rsc.cdn77.org":true,"ssl.origin.cdn77-secure.org":true,"co.nl":true,"co.no":true,"*.platform.sh":true,"cupcake.is":true,"dreamhosters.com":true,"duckdns.org":true,"dyndns-at-home.com":true,"dyndns-at-work.com":true,"dyndns-blog.com":true,"dyndns-free.com":true,"dyndns-home.com":true,"dyndns-ip.com":true,"dyndns-mail.com":true,"dyndns-office.com":true,"dyndns-pics.com":true,"dyndns-remote.com":true,"dyndns-server.com":true,"dyndns-web.com":true,"dyndns-wiki.com":true,"dyndns-work.com":true,"dyndns.biz":true,"dyndns.info":true,"dyndns.org":true,"dyndns.tv":true,"at-band-camp.net":true,"ath.cx":true,"barrel-of-knowledge.info":true,"barrell-of-knowledge.info":true,"better-than.tv":true,"blogdns.com":true,"blogdns.net":true,"blogdns.org":true,"blogsite.org":true,"boldlygoingnowhere.org":true,"broke-it.net":true,"buyshouses.net":true,"cechire.com":true,"dnsalias.com":true,"dnsalias.net":true,"dnsalias.org":true,"dnsdojo.com":true,"dnsdojo.net":true,"dnsdojo.org":true,"does-it.net":true,"doesntexist.com":true,"doesntexist.org":true,"dontexist.com":true,"dontexist.net":true,"dontexist.org":true,"doomdns.com":true,"doomdns.org":true,"dvrdns.org":true,"dyn-o-saur.com":true,"dynalias.com":true,"dynalias.net":true,"dynalias.org":true,"dynathome.net":true,"dyndns.ws":true,"endofinternet.net":true,"endofinternet.org":true,"endoftheinternet.org":true,"est-a-la-maison.com":true,"est-a-la-masion.com":true,"est-le-patron.com":true,"est-mon-blogueur.com":true,"for-better.biz":true,"for-more.biz":true,"for-our.info":true,"for-some.biz":true,"for-the.biz":true,"forgot.her.name":true,"forgot.his.name":true,"from-ak.com":true,"from-al.com":true,"from-ar.com":true,"from-az.net":true,"from-ca.com":true,"from-co.net":true,"from-ct.com":true,"from-dc.com":true,"from-de.com":true,"from-fl.com":true,"from-ga.com":true,"from-hi.com":true,"from-ia.com":true,"from-id.com":true,"from-il.com":true,"from-in.com":true,"from-ks.com":true,"from-ky.com":true,"from-la.net":true,"from-ma.com":true,"from-md.com":true,"from-me.org":true,"from-mi.com":true,"from-mn.com":true,"from-mo.com":true,"from-ms.com":true,"from-mt.com":true,"from-nc.com":true,"from-nd.com":true,"from-ne.com":true,"from-nh.com":true,"from-nj.com":true,"from-nm.com":true,"from-nv.com":true,"from-ny.net":true,"from-oh.com":true,"from-ok.com":true,"from-or.com":true,"from-pa.com":true,"from-pr.com":true,"from-ri.com":true,"from-sc.com":true,"from-sd.com":true,"from-tn.com":true,"from-tx.com":true,"from-ut.com":true,"from-va.com":true,"from-vt.com":true,"from-wa.com":true,"from-wi.com":true,"from-wv.com":true,"from-wy.com":true,"ftpaccess.cc":true,"fuettertdasnetz.de":true,"game-host.org":true,"game-server.cc":true,"getmyip.com":true,"gets-it.net":true,"go.dyndns.org":true,"gotdns.com":true,"gotdns.org":true,"groks-the.info":true,"groks-this.info":true,"ham-radio-op.net":true,"here-for-more.info":true,"hobby-site.com":true,"hobby-site.org":true,"home.dyndns.org":true,"homedns.org":true,"homeftp.net":true,"homeftp.org":true,"homeip.net":true,"homelinux.com":true,"homelinux.net":true,"homelinux.org":true,"homeunix.com":true,"homeunix.net":true,"homeunix.org":true,"iamallama.com":true,"in-the-band.net":true,"is-a-anarchist.com":true,"is-a-blogger.com":true,"is-a-bookkeeper.com":true,"is-a-bruinsfan.org":true,"is-a-bulls-fan.com":true,"is-a-candidate.org":true,"is-a-caterer.com":true,"is-a-celticsfan.org":true,"is-a-chef.com":true,"is-a-chef.net":true,"is-a-chef.org":true,"is-a-conservative.com":true,"is-a-cpa.com":true,"is-a-cubicle-slave.com":true,"is-a-democrat.com":true,"is-a-designer.com":true,"is-a-doctor.com":true,"is-a-financialadvisor.com":true,"is-a-geek.com":true,"is-a-geek.net":true,"is-a-geek.org":true,"is-a-green.com":true,"is-a-guru.com":true,"is-a-hard-worker.com":true,"is-a-hunter.com":true,"is-a-knight.org":true,"is-a-landscaper.com":true,"is-a-lawyer.com":true,"is-a-liberal.com":true,"is-a-libertarian.com":true,"is-a-linux-user.org":true,"is-a-llama.com":true,"is-a-musician.com":true,"is-a-nascarfan.com":true,"is-a-nurse.com":true,"is-a-painter.com":true,"is-a-patsfan.org":true,"is-a-personaltrainer.com":true,"is-a-photographer.com":true,"is-a-player.com":true,"is-a-republican.com":true,"is-a-rockstar.com":true,"is-a-socialist.com":true,"is-a-soxfan.org":true,"is-a-student.com":true,"is-a-teacher.com":true,"is-a-techie.com":true,"is-a-therapist.com":true,"is-an-accountant.com":true,"is-an-actor.com":true,"is-an-actress.com":true,"is-an-anarchist.com":true,"is-an-artist.com":true,"is-an-engineer.com":true,"is-an-entertainer.com":true,"is-by.us":true,"is-certified.com":true,"is-found.org":true,"is-gone.com":true,"is-into-anime.com":true,"is-into-cars.com":true,"is-into-cartoons.com":true,"is-into-games.com":true,"is-leet.com":true,"is-lost.org":true,"is-not-certified.com":true,"is-saved.org":true,"is-slick.com":true,"is-uberleet.com":true,"is-very-bad.org":true,"is-very-evil.org":true,"is-very-good.org":true,"is-very-nice.org":true,"is-very-sweet.org":true,"is-with-theband.com":true,"isa-geek.com":true,"isa-geek.net":true,"isa-geek.org":true,"isa-hockeynut.com":true,"issmarterthanyou.com":true,"isteingeek.de":true,"istmein.de":true,"kicks-ass.net":true,"kicks-ass.org":true,"knowsitall.info":true,"land-4-sale.us":true,"lebtimnetz.de":true,"leitungsen.de":true,"likes-pie.com":true,"likescandy.com":true,"merseine.nu":true,"mine.nu":true,"misconfused.org":true,"mypets.ws":true,"myphotos.cc":true,"neat-url.com":true,"office-on-the.net":true,"on-the-web.tv":true,"podzone.net":true,"podzone.org":true,"readmyblog.org":true,"saves-the-whales.com":true,"scrapper-site.net":true,"scrapping.cc":true,"selfip.biz":true,"selfip.com":true,"selfip.info":true,"selfip.net":true,"selfip.org":true,"sells-for-less.com":true,"sells-for-u.com":true,"sells-it.net":true,"sellsyourhome.org":true,"servebbs.com":true,"servebbs.net":true,"servebbs.org":true,"serveftp.net":true,"serveftp.org":true,"servegame.org":true,"shacknet.nu":true,"simple-url.com":true,"space-to-rent.com":true,"stuff-4-sale.org":true,"stuff-4-sale.us":true,"teaches-yoga.com":true,"thruhere.net":true,"traeumtgerade.de":true,"webhop.biz":true,"webhop.info":true,"webhop.net":true,"webhop.org":true,"worse-than.tv":true,"writesthisblog.com":true,"eu.org":true,"al.eu.org":true,"asso.eu.org":true,"at.eu.org":true,"au.eu.org":true,"be.eu.org":true,"bg.eu.org":true,"ca.eu.org":true,"cd.eu.org":true,"ch.eu.org":true,"cn.eu.org":true,"cy.eu.org":true,"cz.eu.org":true,"de.eu.org":true,"dk.eu.org":true,"edu.eu.org":true,"ee.eu.org":true,"es.eu.org":true,"fi.eu.org":true,"fr.eu.org":true,"gr.eu.org":true,"hr.eu.org":true,"hu.eu.org":true,"ie.eu.org":true,"il.eu.org":true,"in.eu.org":true,"int.eu.org":true,"is.eu.org":true,"it.eu.org":true,"jp.eu.org":true,"kr.eu.org":true,"lt.eu.org":true,"lu.eu.org":true,"lv.eu.org":true,"mc.eu.org":true,"me.eu.org":true,"mk.eu.org":true,"mt.eu.org":true,"my.eu.org":true,"net.eu.org":true,"ng.eu.org":true,"nl.eu.org":true,"no.eu.org":true,"nz.eu.org":true,"paris.eu.org":true,"pl.eu.org":true,"pt.eu.org":true,"q-a.eu.org":true,"ro.eu.org":true,"ru.eu.org":true,"se.eu.org":true,"si.eu.org":true,"sk.eu.org":true,"tr.eu.org":true,"uk.eu.org":true,"us.eu.org":true,"a.ssl.fastly.net":true,"b.ssl.fastly.net":true,"global.ssl.fastly.net":true,"a.prod.fastly.net":true,"global.prod.fastly.net":true,"firebaseapp.com":true,"flynnhub.com":true,"service.gov.uk":true,"github.io":true,"githubusercontent.com":true,"ro.com":true,"appspot.com":true,"blogspot.ae":true,"blogspot.al":true,"blogspot.am":true,"blogspot.ba":true,"blogspot.be":true,"blogspot.bg":true,"blogspot.bj":true,"blogspot.ca":true,"blogspot.cf":true,"blogspot.ch":true,"blogspot.cl":true,"blogspot.co.at":true,"blogspot.co.id":true,"blogspot.co.il":true,"blogspot.co.ke":true,"blogspot.co.nz":true,"blogspot.co.uk":true,"blogspot.co.za":true,"blogspot.com":true,"blogspot.com.ar":true,"blogspot.com.au":true,"blogspot.com.br":true,"blogspot.com.by":true,"blogspot.com.co":true,"blogspot.com.cy":true,"blogspot.com.ee":true,"blogspot.com.eg":true,"blogspot.com.es":true,"blogspot.com.mt":true,"blogspot.com.ng":true,"blogspot.com.tr":true,"blogspot.com.uy":true,"blogspot.cv":true,"blogspot.cz":true,"blogspot.de":true,"blogspot.dk":true,"blogspot.fi":true,"blogspot.fr":true,"blogspot.gr":true,"blogspot.hk":true,"blogspot.hr":true,"blogspot.hu":true,"blogspot.ie":true,"blogspot.in":true,"blogspot.is":true,"blogspot.it":true,"blogspot.jp":true,"blogspot.kr":true,"blogspot.li":true,"blogspot.lt":true,"blogspot.lu":true,"blogspot.md":true,"blogspot.mk":true,"blogspot.mr":true,"blogspot.mx":true,"blogspot.my":true,"blogspot.nl":true,"blogspot.no":true,"blogspot.pe":true,"blogspot.pt":true,"blogspot.qa":true,"blogspot.re":true,"blogspot.ro":true,"blogspot.rs":true,"blogspot.ru":true,"blogspot.se":true,"blogspot.sg":true,"blogspot.si":true,"blogspot.sk":true,"blogspot.sn":true,"blogspot.td":true,"blogspot.tw":true,"blogspot.ug":true,"blogspot.vn":true,"codespot.com":true,"googleapis.com":true,"googlecode.com":true,"pagespeedmobilizer.com":true,"withgoogle.com":true,"withyoutube.com":true,"herokuapp.com":true,"herokussl.com":true,"iki.fi":true,"biz.at":true,"info.at":true,"co.pl":true,"azurewebsites.net":true,"azure-mobile.net":true,"cloudapp.net":true,"bmoattachments.org":true,"4u.com":true,"nfshost.com":true,"nyc.mn":true,"nid.io":true,"operaunite.com":true,"outsystemscloud.com":true,"art.pl":true,"gliwice.pl":true,"krakow.pl":true,"poznan.pl":true,"wroc.pl":true,"zakopane.pl":true,"pantheon.io":true,"gotpantheon.com":true,"priv.at":true,"qa2.com":true,"rhcloud.com":true,"sandcats.io":true,"biz.ua":true,"co.ua":true,"pp.ua":true,"sinaapp.com":true,"vipsinaapp.com":true,"1kapp.com":true,"gda.pl":true,"gdansk.pl":true,"gdynia.pl":true,"med.pl":true,"sopot.pl":true,"hk.com":true,"hk.org":true,"ltd.hk":true,"inc.hk":true,"yolasite.com":true,"za.net":true,"za.org":true}); // END of automatically generated file diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/package.json b/deps/npm/node_modules/request/node_modules/tough-cookie/package.json index 55605b3ee689b5..24c18e2ecbd9f9 100644 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/package.json +++ b/deps/npm/node_modules/request/node_modules/tough-cookie/package.json @@ -1,55 +1,96 @@ { - "author": { - "name": "Jeremy Stashewsky", - "email": "jstashewsky@salesforce.com" + "_args": [ + [ + "tough-cookie@~2.2.0", + "/Users/ogd/Documents/projects/npm/npm/node_modules/request" + ] + ], + "_from": "tough-cookie@>=2.2.0 <2.3.0", + "_id": "tough-cookie@2.2.1", + "_inCache": true, + "_installable": true, + "_location": "/request/tough-cookie", + "_nodeVersion": "0.12.5", + "_npmUser": { + "email": "jstash@gmail.com", + "name": "jstash" }, - "license": "BSD-3-Clause", - "name": "tough-cookie", - "description": "RFC6265 Cookies and Cookie Jar for node.js", - "keywords": [ - "HTTP", - "cookie", - "cookies", - "set-cookie", - "cookiejar", - "jar", - "RFC6265", - "RFC2965" + "_npmVersion": "2.11.2", + "_phantomChildren": {}, + "_requested": { + "name": "tough-cookie", + "raw": "tough-cookie@~2.2.0", + "rawSpec": "~2.2.0", + "scope": null, + "spec": ">=2.2.0 <2.3.0", + "type": "range" + }, + "_requiredBy": [ + "/request" ], - "version": "2.0.0", - "homepage": "https://github.com/SalesforceEng/tough-cookie", - "repository": { - "type": "git", - "url": "git://github.com/SalesforceEng/tough-cookie.git" + "_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.1.tgz", + "_shasum": "3b0516b799e70e8164436a1446e7e5877fda118e", + "_shrinkwrap": null, + "_spec": "tough-cookie@~2.2.0", + "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request", + "author": { + "email": "jstashewsky@salesforce.com", + "name": "Jeremy Stashewsky" }, "bugs": { "url": "https://github.com/SalesforceEng/tough-cookie/issues" }, - "main": "./lib/cookie", - "scripts": { - "test": "vows test/*_test.js" - }, - "engines": { - "node": ">=0.10.0" - }, + "contributors": [ + { + "name": "Alexander Savin" + }, + { + "name": "Ian Livingstone" + }, + { + "name": "Ivan Nikulin" + }, + { + "name": "Lalit Kapoor" + }, + { + "name": "Sam Thompson" + }, + { + "name": "Sebastian Mayr" + } + ], + "dependencies": {}, + "description": "RFC6265 Cookies and Cookie Jar for node.js", "devDependencies": { - "vows": "0.7.0", - "async": ">=0.1.12" - }, - "gitHead": "a3af6104da7787c23bb98910109b0e0e8a10153c", - "_id": "tough-cookie@2.0.0", - "_shasum": "41ce08720b35cf90beb044dd2609fb19e928718f", - "_from": "tough-cookie@>=0.12.0", - "_npmVersion": "2.7.4", - "_nodeVersion": "0.12.2", - "_npmUser": { - "name": "jstash", - "email": "jstash@gmail.com" + "async": "^1.4.2", + "vows": "^0.8.1" }, + "directories": {}, "dist": { - "shasum": "41ce08720b35cf90beb044dd2609fb19e928718f", - "tarball": "http://registry.npmjs.org/tough-cookie/-/tough-cookie-2.0.0.tgz" + "shasum": "3b0516b799e70e8164436a1446e7e5877fda118e", + "tarball": "http://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.1.tgz" }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "lib" + ], + "gitHead": "f1055655ea56c85bd384aaf7d5b740b916700b6f", + "homepage": "https://github.com/SalesforceEng/tough-cookie", + "keywords": [ + "HTTP", + "RFC2965", + "RFC6265", + "cookie", + "cookiejar", + "cookies", + "jar", + "set-cookie" + ], + "license": "BSD-3-Clause", + "main": "./lib/cookie", "maintainers": [ { "name": "jstash", @@ -60,7 +101,16 @@ "email": "services@goinstant.com" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.0.0.tgz", - "readme": "ERROR: No README data found!" + "name": "tough-cookie", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/SalesforceEng/tough-cookie.git" + }, + "scripts": { + "suffixup": "curl -o public_suffix_list.dat https://publicsuffix.org/list/public_suffix_list.dat && ./generate-pubsuffix.js", + "test": "vows test/*_test.js" + }, + "version": "2.2.1" } diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/public-suffix.txt b/deps/npm/node_modules/request/node_modules/tough-cookie/public-suffix.txt deleted file mode 100644 index d5c9924ed549fa..00000000000000 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/public-suffix.txt +++ /dev/null @@ -1,10309 +0,0 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -// ===BEGIN ICANN DOMAINS=== - -// ac : http://en.wikipedia.org/wiki/.ac -ac -com.ac -edu.ac -gov.ac -net.ac -mil.ac -org.ac - -// ad : http://en.wikipedia.org/wiki/.ad -ad -nom.ad - -// ae : http://en.wikipedia.org/wiki/.ae -// see also: "Domain Name Eligibility Policy" at http://www.aeda.ae/eng/aepolicy.php -ae -co.ae -net.ae -org.ae -sch.ae -ac.ae -gov.ae -mil.ae - -// aero : see http://www.information.aero/index.php?id=66 -aero -accident-investigation.aero -accident-prevention.aero -aerobatic.aero -aeroclub.aero -aerodrome.aero -agents.aero -aircraft.aero -airline.aero -airport.aero -air-surveillance.aero -airtraffic.aero -air-traffic-control.aero -ambulance.aero -amusement.aero -association.aero -author.aero -ballooning.aero -broker.aero -caa.aero -cargo.aero -catering.aero -certification.aero -championship.aero -charter.aero -civilaviation.aero -club.aero -conference.aero -consultant.aero -consulting.aero -control.aero -council.aero -crew.aero -design.aero -dgca.aero -educator.aero -emergency.aero -engine.aero -engineer.aero -entertainment.aero -equipment.aero -exchange.aero -express.aero -federation.aero -flight.aero -freight.aero -fuel.aero -gliding.aero -government.aero -groundhandling.aero -group.aero -hanggliding.aero -homebuilt.aero -insurance.aero -journal.aero -journalist.aero -leasing.aero -logistics.aero -magazine.aero -maintenance.aero -marketplace.aero -media.aero -microlight.aero -modelling.aero -navigation.aero -parachuting.aero -paragliding.aero -passenger-association.aero -pilot.aero -press.aero -production.aero -recreation.aero -repbody.aero -res.aero -research.aero -rotorcraft.aero -safety.aero -scientist.aero -services.aero -show.aero -skydiving.aero -software.aero -student.aero -taxi.aero -trader.aero -trading.aero -trainer.aero -union.aero -workinggroup.aero -works.aero - -// af : http://www.nic.af/help.jsp -af -gov.af -com.af -org.af -net.af -edu.af - -// ag : http://www.nic.ag/prices.htm -ag -com.ag -org.ag -net.ag -co.ag -nom.ag - -// ai : http://nic.com.ai/ -ai -off.ai -com.ai -net.ai -org.ai - -// al : http://www.ert.gov.al/ert_alb/faq_det.html?Id=31 -al -com.al -edu.al -gov.al -mil.al -net.al -org.al - -// am : http://en.wikipedia.org/wiki/.am -am - -// an : http://www.una.an/an_domreg/default.asp -an -com.an -net.an -org.an -edu.an - -// ao : http://en.wikipedia.org/wiki/.ao -// http://www.dns.ao/REGISTR.DOC -ao -ed.ao -gv.ao -og.ao -co.ao -pb.ao -it.ao - -// aq : http://en.wikipedia.org/wiki/.aq -aq - -// ar : https://nic.ar/normativa-vigente.xhtml -ar -com.ar -edu.ar -gob.ar -gov.ar -int.ar -mil.ar -net.ar -org.ar -tur.ar - -// arpa : http://en.wikipedia.org/wiki/.arpa -// Confirmed by registry 2008-06-18 -arpa -e164.arpa -in-addr.arpa -ip6.arpa -iris.arpa -uri.arpa -urn.arpa - -// as : http://en.wikipedia.org/wiki/.as -as -gov.as - -// asia : http://en.wikipedia.org/wiki/.asia -asia - -// at : http://en.wikipedia.org/wiki/.at -// Confirmed by registry 2008-06-17 -at -ac.at -co.at -gv.at -or.at - -// au : http://en.wikipedia.org/wiki/.au -// http://www.auda.org.au/ -au -// 2LDs -com.au -net.au -org.au -edu.au -gov.au -asn.au -id.au -// Historic 2LDs (closed to new registration, but sites still exist) -info.au -conf.au -oz.au -// CGDNs - http://www.cgdn.org.au/ -act.au -nsw.au -nt.au -qld.au -sa.au -tas.au -vic.au -wa.au -// 3LDs -act.edu.au -nsw.edu.au -nt.edu.au -qld.edu.au -sa.edu.au -tas.edu.au -vic.edu.au -wa.edu.au -// act.gov.au Bug 984824 - Removed at request of Greg Tankard -// nsw.gov.au Bug 547985 - Removed at request of -// nt.gov.au Bug 940478 - Removed at request of Greg Connors -qld.gov.au -sa.gov.au -tas.gov.au -vic.gov.au -wa.gov.au - -// aw : http://en.wikipedia.org/wiki/.aw -aw -com.aw - -// ax : http://en.wikipedia.org/wiki/.ax -ax - -// az : http://en.wikipedia.org/wiki/.az -az -com.az -net.az -int.az -gov.az -org.az -edu.az -info.az -pp.az -mil.az -name.az -pro.az -biz.az - -// ba : http://en.wikipedia.org/wiki/.ba -ba -org.ba -net.ba -edu.ba -gov.ba -mil.ba -unsa.ba -unbi.ba -co.ba -com.ba -rs.ba - -// bb : http://en.wikipedia.org/wiki/.bb -bb -biz.bb -co.bb -com.bb -edu.bb -gov.bb -info.bb -net.bb -org.bb -store.bb -tv.bb - -// bd : http://en.wikipedia.org/wiki/.bd -*.bd - -// be : http://en.wikipedia.org/wiki/.be -// Confirmed by registry 2008-06-08 -be -ac.be - -// bf : http://en.wikipedia.org/wiki/.bf -bf -gov.bf - -// bg : http://en.wikipedia.org/wiki/.bg -// https://www.register.bg/user/static/rules/en/index.html -bg -a.bg -b.bg -c.bg -d.bg -e.bg -f.bg -g.bg -h.bg -i.bg -j.bg -k.bg -l.bg -m.bg -n.bg -o.bg -p.bg -q.bg -r.bg -s.bg -t.bg -u.bg -v.bg -w.bg -x.bg -y.bg -z.bg -0.bg -1.bg -2.bg -3.bg -4.bg -5.bg -6.bg -7.bg -8.bg -9.bg - -// bh : http://en.wikipedia.org/wiki/.bh -bh -com.bh -edu.bh -net.bh -org.bh -gov.bh - -// bi : http://en.wikipedia.org/wiki/.bi -// http://whois.nic.bi/ -bi -co.bi -com.bi -edu.bi -or.bi -org.bi - -// biz : http://en.wikipedia.org/wiki/.biz -biz - -// bj : http://en.wikipedia.org/wiki/.bj -bj -asso.bj -barreau.bj -gouv.bj - -// bm : http://www.bermudanic.bm/dnr-text.txt -bm -com.bm -edu.bm -gov.bm -net.bm -org.bm - -// bn : http://en.wikipedia.org/wiki/.bn -*.bn - -// bo : http://www.nic.bo/ -bo -com.bo -edu.bo -gov.bo -gob.bo -int.bo -org.bo -net.bo -mil.bo -tv.bo - -// br : http://registro.br/dominio/categoria.html -// Submitted by registry 2014-08-11 -br -adm.br -adv.br -agr.br -am.br -arq.br -art.br -ato.br -b.br -bio.br -blog.br -bmd.br -cim.br -cng.br -cnt.br -com.br -coop.br -ecn.br -eco.br -edu.br -emp.br -eng.br -esp.br -etc.br -eti.br -far.br -flog.br -fm.br -fnd.br -fot.br -fst.br -g12.br -ggf.br -gov.br -imb.br -ind.br -inf.br -jor.br -jus.br -leg.br -lel.br -mat.br -med.br -mil.br -mp.br -mus.br -net.br -*.nom.br -not.br -ntr.br -odo.br -org.br -ppg.br -pro.br -psc.br -psi.br -qsl.br -radio.br -rec.br -slg.br -srv.br -taxi.br -teo.br -tmp.br -trd.br -tur.br -tv.br -vet.br -vlog.br -wiki.br -zlg.br - -// bs : http://www.nic.bs/rules.html -bs -com.bs -net.bs -org.bs -edu.bs -gov.bs - -// bt : http://en.wikipedia.org/wiki/.bt -bt -com.bt -edu.bt -gov.bt -net.bt -org.bt - -// bv : No registrations at this time. -// Submitted by registry 2006-06-16 -bv - -// bw : http://en.wikipedia.org/wiki/.bw -// http://www.gobin.info/domainname/bw.doc -// list of other 2nd level tlds ? -bw -co.bw -org.bw - -// by : http://en.wikipedia.org/wiki/.by -// http://tld.by/rules_2006_en.html -// list of other 2nd level tlds ? -by -gov.by -mil.by -// Official information does not indicate that com.by is a reserved -// second-level domain, but it's being used as one (see www.google.com.by and -// www.yahoo.com.by, for example), so we list it here for safety's sake. -com.by - -// http://hoster.by/ -of.by - -// bz : http://en.wikipedia.org/wiki/.bz -// http://www.belizenic.bz/ -bz -com.bz -net.bz -org.bz -edu.bz -gov.bz - -// ca : http://en.wikipedia.org/wiki/.ca -ca -// ca geographical names -ab.ca -bc.ca -mb.ca -nb.ca -nf.ca -nl.ca -ns.ca -nt.ca -nu.ca -on.ca -pe.ca -qc.ca -sk.ca -yk.ca -// gc.ca: http://en.wikipedia.org/wiki/.gc.ca -// see also: http://registry.gc.ca/en/SubdomainFAQ -gc.ca - -// cat : http://en.wikipedia.org/wiki/.cat -cat - -// cc : http://en.wikipedia.org/wiki/.cc -cc - -// cd : http://en.wikipedia.org/wiki/.cd -// see also: https://www.nic.cd/domain/insertDomain_2.jsp?act=1 -cd -gov.cd - -// cf : http://en.wikipedia.org/wiki/.cf -cf - -// cg : http://en.wikipedia.org/wiki/.cg -cg - -// ch : http://en.wikipedia.org/wiki/.ch -ch - -// ci : http://en.wikipedia.org/wiki/.ci -// http://www.nic.ci/index.php?page=charte -ci -org.ci -or.ci -com.ci -co.ci -edu.ci -ed.ci -ac.ci -net.ci -go.ci -asso.ci -aéroport.ci -int.ci -presse.ci -md.ci -gouv.ci - -// ck : http://en.wikipedia.org/wiki/.ck -*.ck -!www.ck - -// cl : http://en.wikipedia.org/wiki/.cl -cl -gov.cl -gob.cl -co.cl -mil.cl - -// cm : http://en.wikipedia.org/wiki/.cm plus bug 981927 -cm -co.cm -com.cm -gov.cm -net.cm - -// cn : http://en.wikipedia.org/wiki/.cn -// Submitted by registry 2008-06-11 -cn -ac.cn -com.cn -edu.cn -gov.cn -net.cn -org.cn -mil.cn -公司.cn -网络.cn -網絡.cn -// cn geographic names -ah.cn -bj.cn -cq.cn -fj.cn -gd.cn -gs.cn -gz.cn -gx.cn -ha.cn -hb.cn -he.cn -hi.cn -hl.cn -hn.cn -jl.cn -js.cn -jx.cn -ln.cn -nm.cn -nx.cn -qh.cn -sc.cn -sd.cn -sh.cn -sn.cn -sx.cn -tj.cn -xj.cn -xz.cn -yn.cn -zj.cn -hk.cn -mo.cn -tw.cn - -// co : http://en.wikipedia.org/wiki/.co -// Submitted by registry 2008-06-11 -co -arts.co -com.co -edu.co -firm.co -gov.co -info.co -int.co -mil.co -net.co -nom.co -org.co -rec.co -web.co - -// com : http://en.wikipedia.org/wiki/.com -com - -// coop : http://en.wikipedia.org/wiki/.coop -coop - -// cr : http://www.nic.cr/niccr_publico/showRegistroDominiosScreen.do -cr -ac.cr -co.cr -ed.cr -fi.cr -go.cr -or.cr -sa.cr - -// cu : http://en.wikipedia.org/wiki/.cu -cu -com.cu -edu.cu -org.cu -net.cu -gov.cu -inf.cu - -// cv : http://en.wikipedia.org/wiki/.cv -cv - -// cw : http://www.una.cw/cw_registry/ -// Confirmed by registry 2013-03-26 -cw -com.cw -edu.cw -net.cw -org.cw - -// cx : http://en.wikipedia.org/wiki/.cx -// list of other 2nd level tlds ? -cx -gov.cx - -// cy : http://en.wikipedia.org/wiki/.cy -*.cy - -// cz : http://en.wikipedia.org/wiki/.cz -cz - -// de : http://en.wikipedia.org/wiki/.de -// Confirmed by registry (with technical -// reservations) 2008-07-01 -de - -// dj : http://en.wikipedia.org/wiki/.dj -dj - -// dk : http://en.wikipedia.org/wiki/.dk -// Confirmed by registry 2008-06-17 -dk - -// dm : http://en.wikipedia.org/wiki/.dm -dm -com.dm -net.dm -org.dm -edu.dm -gov.dm - -// do : http://en.wikipedia.org/wiki/.do -do -art.do -com.do -edu.do -gob.do -gov.do -mil.do -net.do -org.do -sld.do -web.do - -// dz : http://en.wikipedia.org/wiki/.dz -dz -com.dz -org.dz -net.dz -gov.dz -edu.dz -asso.dz -pol.dz -art.dz - -// ec : http://www.nic.ec/reg/paso1.asp -// Submitted by registry 2008-07-04 -ec -com.ec -info.ec -net.ec -fin.ec -k12.ec -med.ec -pro.ec -org.ec -edu.ec -gov.ec -gob.ec -mil.ec - -// edu : http://en.wikipedia.org/wiki/.edu -edu - -// ee : http://www.eenet.ee/EENet/dom_reeglid.html#lisa_B -ee -edu.ee -gov.ee -riik.ee -lib.ee -med.ee -com.ee -pri.ee -aip.ee -org.ee -fie.ee - -// eg : http://en.wikipedia.org/wiki/.eg -eg -com.eg -edu.eg -eun.eg -gov.eg -mil.eg -name.eg -net.eg -org.eg -sci.eg - -// er : http://en.wikipedia.org/wiki/.er -*.er - -// es : https://www.nic.es/site_ingles/ingles/dominios/index.html -es -com.es -nom.es -org.es -gob.es -edu.es - -// et : http://en.wikipedia.org/wiki/.et -et -com.et -gov.et -org.et -edu.et -biz.et -name.et -info.et -net.et - -// eu : http://en.wikipedia.org/wiki/.eu -eu - -// fi : http://en.wikipedia.org/wiki/.fi -fi -// aland.fi : http://en.wikipedia.org/wiki/.ax -// This domain is being phased out in favor of .ax. As there are still many -// domains under aland.fi, we still keep it on the list until aland.fi is -// completely removed. -// TODO: Check for updates (expected to be phased out around Q1/2009) -aland.fi - -// fj : http://en.wikipedia.org/wiki/.fj -*.fj - -// fk : http://en.wikipedia.org/wiki/.fk -*.fk - -// fm : http://en.wikipedia.org/wiki/.fm -fm - -// fo : http://en.wikipedia.org/wiki/.fo -fo - -// fr : http://www.afnic.fr/ -// domaines descriptifs : http://www.afnic.fr/obtenir/chartes/nommage-fr/annexe-descriptifs -fr -com.fr -asso.fr -nom.fr -prd.fr -presse.fr -tm.fr -// domaines sectoriels : http://www.afnic.fr/obtenir/chartes/nommage-fr/annexe-sectoriels -aeroport.fr -assedic.fr -avocat.fr -avoues.fr -cci.fr -chambagri.fr -chirurgiens-dentistes.fr -experts-comptables.fr -geometre-expert.fr -gouv.fr -greta.fr -huissier-justice.fr -medecin.fr -notaires.fr -pharmacien.fr -port.fr -veterinaire.fr - -// ga : http://en.wikipedia.org/wiki/.ga -ga - -// gb : This registry is effectively dormant -// Submitted by registry 2008-06-12 -gb - -// gd : http://en.wikipedia.org/wiki/.gd -gd - -// ge : http://www.nic.net.ge/policy_en.pdf -ge -com.ge -edu.ge -gov.ge -org.ge -mil.ge -net.ge -pvt.ge - -// gf : http://en.wikipedia.org/wiki/.gf -gf - -// gg : http://www.channelisles.net/register-domains/ -// Confirmed by registry 2013-11-28 -gg -co.gg -net.gg -org.gg - -// gh : http://en.wikipedia.org/wiki/.gh -// see also: http://www.nic.gh/reg_now.php -// Although domains directly at second level are not possible at the moment, -// they have been possible for some time and may come back. -gh -com.gh -edu.gh -gov.gh -org.gh -mil.gh - -// gi : http://www.nic.gi/rules.html -gi -com.gi -ltd.gi -gov.gi -mod.gi -edu.gi -org.gi - -// gl : http://en.wikipedia.org/wiki/.gl -// http://nic.gl -gl -co.gl -com.gl -edu.gl -net.gl -org.gl - -// gm : http://www.nic.gm/htmlpages%5Cgm-policy.htm -gm - -// gn : http://psg.com/dns/gn/gn.txt -// Submitted by registry 2008-06-17 -gn -ac.gn -com.gn -edu.gn -gov.gn -org.gn -net.gn - -// gov : http://en.wikipedia.org/wiki/.gov -gov - -// gp : http://www.nic.gp/index.php?lang=en -gp -com.gp -net.gp -mobi.gp -edu.gp -org.gp -asso.gp - -// gq : http://en.wikipedia.org/wiki/.gq -gq - -// gr : https://grweb.ics.forth.gr/english/1617-B-2005.html -// Submitted by registry 2008-06-09 -gr -com.gr -edu.gr -net.gr -org.gr -gov.gr - -// gs : http://en.wikipedia.org/wiki/.gs -gs - -// gt : http://www.gt/politicas_de_registro.html -gt -com.gt -edu.gt -gob.gt -ind.gt -mil.gt -net.gt -org.gt - -// gu : http://gadao.gov.gu/registration.txt -*.gu - -// gw : http://en.wikipedia.org/wiki/.gw -gw - -// gy : http://en.wikipedia.org/wiki/.gy -// http://registry.gy/ -gy -co.gy -com.gy -net.gy - -// hk : https://www.hkdnr.hk -// Submitted by registry 2008-06-11 -hk -com.hk -edu.hk -gov.hk -idv.hk -net.hk -org.hk -公司.hk -教育.hk -敎育.hk -政府.hk -個人.hk -个人.hk -箇人.hk -網络.hk -网络.hk -组織.hk -網絡.hk -网絡.hk -组织.hk -組織.hk -組织.hk - -// hm : http://en.wikipedia.org/wiki/.hm -hm - -// hn : http://www.nic.hn/politicas/ps02,,05.html -hn -com.hn -edu.hn -org.hn -net.hn -mil.hn -gob.hn - -// hr : http://www.dns.hr/documents/pdf/HRTLD-regulations.pdf -hr -iz.hr -from.hr -name.hr -com.hr - -// ht : http://www.nic.ht/info/charte.cfm -ht -com.ht -shop.ht -firm.ht -info.ht -adult.ht -net.ht -pro.ht -org.ht -med.ht -art.ht -coop.ht -pol.ht -asso.ht -edu.ht -rel.ht -gouv.ht -perso.ht - -// hu : http://www.domain.hu/domain/English/sld.html -// Confirmed by registry 2008-06-12 -hu -co.hu -info.hu -org.hu -priv.hu -sport.hu -tm.hu -2000.hu -agrar.hu -bolt.hu -casino.hu -city.hu -erotica.hu -erotika.hu -film.hu -forum.hu -games.hu -hotel.hu -ingatlan.hu -jogasz.hu -konyvelo.hu -lakas.hu -media.hu -news.hu -reklam.hu -sex.hu -shop.hu -suli.hu -szex.hu -tozsde.hu -utazas.hu -video.hu - -// id : https://register.pandi.or.id/ -id -ac.id -biz.id -co.id -desa.id -go.id -mil.id -my.id -net.id -or.id -sch.id -web.id - -// ie : http://en.wikipedia.org/wiki/.ie -ie -gov.ie - -// il : http://en.wikipedia.org/wiki/.il -*.il - -// im : https://www.nic.im/ -// Submitted by registry 2013-11-15 -im -ac.im -co.im -com.im -ltd.co.im -net.im -org.im -plc.co.im -tt.im -tv.im - -// in : http://en.wikipedia.org/wiki/.in -// see also: https://registry.in/Policies -// Please note, that nic.in is not an offical eTLD, but used by most -// government institutions. -in -co.in -firm.in -net.in -org.in -gen.in -ind.in -nic.in -ac.in -edu.in -res.in -gov.in -mil.in - -// info : http://en.wikipedia.org/wiki/.info -info - -// int : http://en.wikipedia.org/wiki/.int -// Confirmed by registry 2008-06-18 -int -eu.int - -// io : http://www.nic.io/rules.html -// list of other 2nd level tlds ? -io -com.io - -// iq : http://www.cmc.iq/english/iq/iqregister1.htm -iq -gov.iq -edu.iq -mil.iq -com.iq -org.iq -net.iq - -// ir : http://www.nic.ir/Terms_and_Conditions_ir,_Appendix_1_Domain_Rules -// Also see http://www.nic.ir/Internationalized_Domain_Names -// Two .ir entries added at request of , 2010-04-16 -ir -ac.ir -co.ir -gov.ir -id.ir -net.ir -org.ir -sch.ir -// xn--mgba3a4f16a.ir (.ir, Persian YEH) -ایران.ir -// xn--mgba3a4fra.ir (.ir, Arabic YEH) -ايران.ir - -// is : http://www.isnic.is/domain/rules.php -// Confirmed by registry 2008-12-06 -is -net.is -com.is -edu.is -gov.is -org.is -int.is - -// it : http://en.wikipedia.org/wiki/.it -it -gov.it -edu.it -// Reserved geo-names: -// http://www.nic.it/documenti/regolamenti-e-linee-guida/regolamento-assegnazione-versione-6.0.pdf -// There is also a list of reserved geo-names corresponding to Italian municipalities -// http://www.nic.it/documenti/appendice-c.pdf, but it is not included here. -// Regions -abr.it -abruzzo.it -aosta-valley.it -aostavalley.it -bas.it -basilicata.it -cal.it -calabria.it -cam.it -campania.it -emilia-romagna.it -emiliaromagna.it -emr.it -friuli-v-giulia.it -friuli-ve-giulia.it -friuli-vegiulia.it -friuli-venezia-giulia.it -friuli-veneziagiulia.it -friuli-vgiulia.it -friuliv-giulia.it -friulive-giulia.it -friulivegiulia.it -friulivenezia-giulia.it -friuliveneziagiulia.it -friulivgiulia.it -fvg.it -laz.it -lazio.it -lig.it -liguria.it -lom.it -lombardia.it -lombardy.it -lucania.it -mar.it -marche.it -mol.it -molise.it -piedmont.it -piemonte.it -pmn.it -pug.it -puglia.it -sar.it -sardegna.it -sardinia.it -sic.it -sicilia.it -sicily.it -taa.it -tos.it -toscana.it -trentino-a-adige.it -trentino-aadige.it -trentino-alto-adige.it -trentino-altoadige.it -trentino-s-tirol.it -trentino-stirol.it -trentino-sud-tirol.it -trentino-sudtirol.it -trentino-sued-tirol.it -trentino-suedtirol.it -trentinoa-adige.it -trentinoaadige.it -trentinoalto-adige.it -trentinoaltoadige.it -trentinos-tirol.it -trentinostirol.it -trentinosud-tirol.it -trentinosudtirol.it -trentinosued-tirol.it -trentinosuedtirol.it -tuscany.it -umb.it -umbria.it -val-d-aosta.it -val-daosta.it -vald-aosta.it -valdaosta.it -valle-aosta.it -valle-d-aosta.it -valle-daosta.it -valleaosta.it -valled-aosta.it -valledaosta.it -vallee-aoste.it -valleeaoste.it -vao.it -vda.it -ven.it -veneto.it -// Provinces -ag.it -agrigento.it -al.it -alessandria.it -alto-adige.it -altoadige.it -an.it -ancona.it -andria-barletta-trani.it -andria-trani-barletta.it -andriabarlettatrani.it -andriatranibarletta.it -ao.it -aosta.it -aoste.it -ap.it -aq.it -aquila.it -ar.it -arezzo.it -ascoli-piceno.it -ascolipiceno.it -asti.it -at.it -av.it -avellino.it -ba.it -balsan.it -bari.it -barletta-trani-andria.it -barlettatraniandria.it -belluno.it -benevento.it -bergamo.it -bg.it -bi.it -biella.it -bl.it -bn.it -bo.it -bologna.it -bolzano.it -bozen.it -br.it -brescia.it -brindisi.it -bs.it -bt.it -bz.it -ca.it -cagliari.it -caltanissetta.it -campidano-medio.it -campidanomedio.it -campobasso.it -carbonia-iglesias.it -carboniaiglesias.it -carrara-massa.it -carraramassa.it -caserta.it -catania.it -catanzaro.it -cb.it -ce.it -cesena-forli.it -cesenaforli.it -ch.it -chieti.it -ci.it -cl.it -cn.it -co.it -como.it -cosenza.it -cr.it -cremona.it -crotone.it -cs.it -ct.it -cuneo.it -cz.it -dell-ogliastra.it -dellogliastra.it -en.it -enna.it -fc.it -fe.it -fermo.it -ferrara.it -fg.it -fi.it -firenze.it -florence.it -fm.it -foggia.it -forli-cesena.it -forlicesena.it -fr.it -frosinone.it -ge.it -genoa.it -genova.it -go.it -gorizia.it -gr.it -grosseto.it -iglesias-carbonia.it -iglesiascarbonia.it -im.it -imperia.it -is.it -isernia.it -kr.it -la-spezia.it -laquila.it -laspezia.it -latina.it -lc.it -le.it -lecce.it -lecco.it -li.it -livorno.it -lo.it -lodi.it -lt.it -lu.it -lucca.it -macerata.it -mantova.it -massa-carrara.it -massacarrara.it -matera.it -mb.it -mc.it -me.it -medio-campidano.it -mediocampidano.it -messina.it -mi.it -milan.it -milano.it -mn.it -mo.it -modena.it -monza-brianza.it -monza-e-della-brianza.it -monza.it -monzabrianza.it -monzaebrianza.it -monzaedellabrianza.it -ms.it -mt.it -na.it -naples.it -napoli.it -no.it -novara.it -nu.it -nuoro.it -og.it -ogliastra.it -olbia-tempio.it -olbiatempio.it -or.it -oristano.it -ot.it -pa.it -padova.it -padua.it -palermo.it -parma.it -pavia.it -pc.it -pd.it -pe.it -perugia.it -pesaro-urbino.it -pesarourbino.it -pescara.it -pg.it -pi.it -piacenza.it -pisa.it -pistoia.it -pn.it -po.it -pordenone.it -potenza.it -pr.it -prato.it -pt.it -pu.it -pv.it -pz.it -ra.it -ragusa.it -ravenna.it -rc.it -re.it -reggio-calabria.it -reggio-emilia.it -reggiocalabria.it -reggioemilia.it -rg.it -ri.it -rieti.it -rimini.it -rm.it -rn.it -ro.it -roma.it -rome.it -rovigo.it -sa.it -salerno.it -sassari.it -savona.it -si.it -siena.it -siracusa.it -so.it -sondrio.it -sp.it -sr.it -ss.it -suedtirol.it -sv.it -ta.it -taranto.it -te.it -tempio-olbia.it -tempioolbia.it -teramo.it -terni.it -tn.it -to.it -torino.it -tp.it -tr.it -trani-andria-barletta.it -trani-barletta-andria.it -traniandriabarletta.it -tranibarlettaandria.it -trapani.it -trentino.it -trento.it -treviso.it -trieste.it -ts.it -turin.it -tv.it -ud.it -udine.it -urbino-pesaro.it -urbinopesaro.it -va.it -varese.it -vb.it -vc.it -ve.it -venezia.it -venice.it -verbania.it -vercelli.it -verona.it -vi.it -vibo-valentia.it -vibovalentia.it -vicenza.it -viterbo.it -vr.it -vs.it -vt.it -vv.it - -// je : http://www.channelisles.net/register-domains/ -// Confirmed by registry 2013-11-28 -je -co.je -net.je -org.je - -// jm : http://www.com.jm/register.html -*.jm - -// jo : http://www.dns.jo/Registration_policy.aspx -jo -com.jo -org.jo -net.jo -edu.jo -sch.jo -gov.jo -mil.jo -name.jo - -// jobs : http://en.wikipedia.org/wiki/.jobs -jobs - -// jp : http://en.wikipedia.org/wiki/.jp -// http://jprs.co.jp/en/jpdomain.html -// Submitted by registry 2014-10-30 -jp -// jp organizational type names -ac.jp -ad.jp -co.jp -ed.jp -go.jp -gr.jp -lg.jp -ne.jp -or.jp -// jp prefecture type names -aichi.jp -akita.jp -aomori.jp -chiba.jp -ehime.jp -fukui.jp -fukuoka.jp -fukushima.jp -gifu.jp -gunma.jp -hiroshima.jp -hokkaido.jp -hyogo.jp -ibaraki.jp -ishikawa.jp -iwate.jp -kagawa.jp -kagoshima.jp -kanagawa.jp -kochi.jp -kumamoto.jp -kyoto.jp -mie.jp -miyagi.jp -miyazaki.jp -nagano.jp -nagasaki.jp -nara.jp -niigata.jp -oita.jp -okayama.jp -okinawa.jp -osaka.jp -saga.jp -saitama.jp -shiga.jp -shimane.jp -shizuoka.jp -tochigi.jp -tokushima.jp -tokyo.jp -tottori.jp -toyama.jp -wakayama.jp -yamagata.jp -yamaguchi.jp -yamanashi.jp -栃木.jp -愛知.jp -愛媛.jp -兵庫.jp -熊本.jp -茨城.jp -北海道.jp -千葉.jp -和歌山.jp -長崎.jp -長野.jp -新潟.jp -青森.jp -静岡.jp -東京.jp -石川.jp -埼玉.jp -三重.jp -京都.jp -佐賀.jp -大分.jp -大阪.jp -奈良.jp -宮城.jp -宮崎.jp -富山.jp -山口.jp -山形.jp -山梨.jp -岩手.jp -岐阜.jp -岡山.jp -島根.jp -広島.jp -徳島.jp -沖縄.jp -滋賀.jp -神奈川.jp -福井.jp -福岡.jp -福島.jp -秋田.jp -群馬.jp -香川.jp -高知.jp -鳥取.jp -鹿児島.jp -// jp geographic type names -// http://jprs.jp/doc/rule/saisoku-1.html -*.kawasaki.jp -*.kitakyushu.jp -*.kobe.jp -*.nagoya.jp -*.sapporo.jp -*.sendai.jp -*.yokohama.jp -!city.kawasaki.jp -!city.kitakyushu.jp -!city.kobe.jp -!city.nagoya.jp -!city.sapporo.jp -!city.sendai.jp -!city.yokohama.jp -// 4th level registration -aisai.aichi.jp -ama.aichi.jp -anjo.aichi.jp -asuke.aichi.jp -chiryu.aichi.jp -chita.aichi.jp -fuso.aichi.jp -gamagori.aichi.jp -handa.aichi.jp -hazu.aichi.jp -hekinan.aichi.jp -higashiura.aichi.jp -ichinomiya.aichi.jp -inazawa.aichi.jp -inuyama.aichi.jp -isshiki.aichi.jp -iwakura.aichi.jp -kanie.aichi.jp -kariya.aichi.jp -kasugai.aichi.jp -kira.aichi.jp -kiyosu.aichi.jp -komaki.aichi.jp -konan.aichi.jp -kota.aichi.jp -mihama.aichi.jp -miyoshi.aichi.jp -nishio.aichi.jp -nisshin.aichi.jp -obu.aichi.jp -oguchi.aichi.jp -oharu.aichi.jp -okazaki.aichi.jp -owariasahi.aichi.jp -seto.aichi.jp -shikatsu.aichi.jp -shinshiro.aichi.jp -shitara.aichi.jp -tahara.aichi.jp -takahama.aichi.jp -tobishima.aichi.jp -toei.aichi.jp -togo.aichi.jp -tokai.aichi.jp -tokoname.aichi.jp -toyoake.aichi.jp -toyohashi.aichi.jp -toyokawa.aichi.jp -toyone.aichi.jp -toyota.aichi.jp -tsushima.aichi.jp -yatomi.aichi.jp -akita.akita.jp -daisen.akita.jp -fujisato.akita.jp -gojome.akita.jp -hachirogata.akita.jp -happou.akita.jp -higashinaruse.akita.jp -honjo.akita.jp -honjyo.akita.jp -ikawa.akita.jp -kamikoani.akita.jp -kamioka.akita.jp -katagami.akita.jp -kazuno.akita.jp -kitaakita.akita.jp -kosaka.akita.jp -kyowa.akita.jp -misato.akita.jp -mitane.akita.jp -moriyoshi.akita.jp -nikaho.akita.jp -noshiro.akita.jp -odate.akita.jp -oga.akita.jp -ogata.akita.jp -semboku.akita.jp -yokote.akita.jp -yurihonjo.akita.jp -aomori.aomori.jp -gonohe.aomori.jp -hachinohe.aomori.jp -hashikami.aomori.jp -hiranai.aomori.jp -hirosaki.aomori.jp -itayanagi.aomori.jp -kuroishi.aomori.jp -misawa.aomori.jp -mutsu.aomori.jp -nakadomari.aomori.jp -noheji.aomori.jp -oirase.aomori.jp -owani.aomori.jp -rokunohe.aomori.jp -sannohe.aomori.jp -shichinohe.aomori.jp -shingo.aomori.jp -takko.aomori.jp -towada.aomori.jp -tsugaru.aomori.jp -tsuruta.aomori.jp -abiko.chiba.jp -asahi.chiba.jp -chonan.chiba.jp -chosei.chiba.jp -choshi.chiba.jp -chuo.chiba.jp -funabashi.chiba.jp -futtsu.chiba.jp -hanamigawa.chiba.jp -ichihara.chiba.jp -ichikawa.chiba.jp -ichinomiya.chiba.jp -inzai.chiba.jp -isumi.chiba.jp -kamagaya.chiba.jp -kamogawa.chiba.jp -kashiwa.chiba.jp -katori.chiba.jp -katsuura.chiba.jp -kimitsu.chiba.jp -kisarazu.chiba.jp -kozaki.chiba.jp -kujukuri.chiba.jp -kyonan.chiba.jp -matsudo.chiba.jp -midori.chiba.jp -mihama.chiba.jp -minamiboso.chiba.jp -mobara.chiba.jp -mutsuzawa.chiba.jp -nagara.chiba.jp -nagareyama.chiba.jp -narashino.chiba.jp -narita.chiba.jp -noda.chiba.jp -oamishirasato.chiba.jp -omigawa.chiba.jp -onjuku.chiba.jp -otaki.chiba.jp -sakae.chiba.jp -sakura.chiba.jp -shimofusa.chiba.jp -shirako.chiba.jp -shiroi.chiba.jp -shisui.chiba.jp -sodegaura.chiba.jp -sosa.chiba.jp -tako.chiba.jp -tateyama.chiba.jp -togane.chiba.jp -tohnosho.chiba.jp -tomisato.chiba.jp -urayasu.chiba.jp -yachimata.chiba.jp -yachiyo.chiba.jp -yokaichiba.chiba.jp -yokoshibahikari.chiba.jp -yotsukaido.chiba.jp -ainan.ehime.jp -honai.ehime.jp -ikata.ehime.jp -imabari.ehime.jp -iyo.ehime.jp -kamijima.ehime.jp -kihoku.ehime.jp -kumakogen.ehime.jp -masaki.ehime.jp -matsuno.ehime.jp -matsuyama.ehime.jp -namikata.ehime.jp -niihama.ehime.jp -ozu.ehime.jp -saijo.ehime.jp -seiyo.ehime.jp -shikokuchuo.ehime.jp -tobe.ehime.jp -toon.ehime.jp -uchiko.ehime.jp -uwajima.ehime.jp -yawatahama.ehime.jp -echizen.fukui.jp -eiheiji.fukui.jp -fukui.fukui.jp -ikeda.fukui.jp -katsuyama.fukui.jp -mihama.fukui.jp -minamiechizen.fukui.jp -obama.fukui.jp -ohi.fukui.jp -ono.fukui.jp -sabae.fukui.jp -sakai.fukui.jp -takahama.fukui.jp -tsuruga.fukui.jp -wakasa.fukui.jp -ashiya.fukuoka.jp -buzen.fukuoka.jp -chikugo.fukuoka.jp -chikuho.fukuoka.jp -chikujo.fukuoka.jp -chikushino.fukuoka.jp -chikuzen.fukuoka.jp -chuo.fukuoka.jp -dazaifu.fukuoka.jp -fukuchi.fukuoka.jp -hakata.fukuoka.jp -higashi.fukuoka.jp -hirokawa.fukuoka.jp -hisayama.fukuoka.jp -iizuka.fukuoka.jp -inatsuki.fukuoka.jp -kaho.fukuoka.jp -kasuga.fukuoka.jp -kasuya.fukuoka.jp -kawara.fukuoka.jp -keisen.fukuoka.jp -koga.fukuoka.jp -kurate.fukuoka.jp -kurogi.fukuoka.jp -kurume.fukuoka.jp -minami.fukuoka.jp -miyako.fukuoka.jp -miyama.fukuoka.jp -miyawaka.fukuoka.jp -mizumaki.fukuoka.jp -munakata.fukuoka.jp -nakagawa.fukuoka.jp -nakama.fukuoka.jp -nishi.fukuoka.jp -nogata.fukuoka.jp -ogori.fukuoka.jp -okagaki.fukuoka.jp -okawa.fukuoka.jp -oki.fukuoka.jp -omuta.fukuoka.jp -onga.fukuoka.jp -onojo.fukuoka.jp -oto.fukuoka.jp -saigawa.fukuoka.jp -sasaguri.fukuoka.jp -shingu.fukuoka.jp -shinyoshitomi.fukuoka.jp -shonai.fukuoka.jp -soeda.fukuoka.jp -sue.fukuoka.jp -tachiarai.fukuoka.jp -tagawa.fukuoka.jp -takata.fukuoka.jp -toho.fukuoka.jp -toyotsu.fukuoka.jp -tsuiki.fukuoka.jp -ukiha.fukuoka.jp -umi.fukuoka.jp -usui.fukuoka.jp -yamada.fukuoka.jp -yame.fukuoka.jp -yanagawa.fukuoka.jp -yukuhashi.fukuoka.jp -aizubange.fukushima.jp -aizumisato.fukushima.jp -aizuwakamatsu.fukushima.jp -asakawa.fukushima.jp -bandai.fukushima.jp -date.fukushima.jp -fukushima.fukushima.jp -furudono.fukushima.jp -futaba.fukushima.jp -hanawa.fukushima.jp -higashi.fukushima.jp -hirata.fukushima.jp -hirono.fukushima.jp -iitate.fukushima.jp -inawashiro.fukushima.jp -ishikawa.fukushima.jp -iwaki.fukushima.jp -izumizaki.fukushima.jp -kagamiishi.fukushima.jp -kaneyama.fukushima.jp -kawamata.fukushima.jp -kitakata.fukushima.jp -kitashiobara.fukushima.jp -koori.fukushima.jp -koriyama.fukushima.jp -kunimi.fukushima.jp -miharu.fukushima.jp -mishima.fukushima.jp -namie.fukushima.jp -nango.fukushima.jp -nishiaizu.fukushima.jp -nishigo.fukushima.jp -okuma.fukushima.jp -omotego.fukushima.jp -ono.fukushima.jp -otama.fukushima.jp -samegawa.fukushima.jp -shimogo.fukushima.jp -shirakawa.fukushima.jp -showa.fukushima.jp -soma.fukushima.jp -sukagawa.fukushima.jp -taishin.fukushima.jp -tamakawa.fukushima.jp -tanagura.fukushima.jp -tenei.fukushima.jp -yabuki.fukushima.jp -yamato.fukushima.jp -yamatsuri.fukushima.jp -yanaizu.fukushima.jp -yugawa.fukushima.jp -anpachi.gifu.jp -ena.gifu.jp -gifu.gifu.jp -ginan.gifu.jp -godo.gifu.jp -gujo.gifu.jp -hashima.gifu.jp -hichiso.gifu.jp -hida.gifu.jp -higashishirakawa.gifu.jp -ibigawa.gifu.jp -ikeda.gifu.jp -kakamigahara.gifu.jp -kani.gifu.jp -kasahara.gifu.jp -kasamatsu.gifu.jp -kawaue.gifu.jp -kitagata.gifu.jp -mino.gifu.jp -minokamo.gifu.jp -mitake.gifu.jp -mizunami.gifu.jp -motosu.gifu.jp -nakatsugawa.gifu.jp -ogaki.gifu.jp -sakahogi.gifu.jp -seki.gifu.jp -sekigahara.gifu.jp -shirakawa.gifu.jp -tajimi.gifu.jp -takayama.gifu.jp -tarui.gifu.jp -toki.gifu.jp -tomika.gifu.jp -wanouchi.gifu.jp -yamagata.gifu.jp -yaotsu.gifu.jp -yoro.gifu.jp -annaka.gunma.jp -chiyoda.gunma.jp -fujioka.gunma.jp -higashiagatsuma.gunma.jp -isesaki.gunma.jp -itakura.gunma.jp -kanna.gunma.jp -kanra.gunma.jp -katashina.gunma.jp -kawaba.gunma.jp -kiryu.gunma.jp -kusatsu.gunma.jp -maebashi.gunma.jp -meiwa.gunma.jp -midori.gunma.jp -minakami.gunma.jp -naganohara.gunma.jp -nakanojo.gunma.jp -nanmoku.gunma.jp -numata.gunma.jp -oizumi.gunma.jp -ora.gunma.jp -ota.gunma.jp -shibukawa.gunma.jp -shimonita.gunma.jp -shinto.gunma.jp -showa.gunma.jp -takasaki.gunma.jp -takayama.gunma.jp -tamamura.gunma.jp -tatebayashi.gunma.jp -tomioka.gunma.jp -tsukiyono.gunma.jp -tsumagoi.gunma.jp -ueno.gunma.jp -yoshioka.gunma.jp -asaminami.hiroshima.jp -daiwa.hiroshima.jp -etajima.hiroshima.jp -fuchu.hiroshima.jp -fukuyama.hiroshima.jp -hatsukaichi.hiroshima.jp -higashihiroshima.hiroshima.jp -hongo.hiroshima.jp -jinsekikogen.hiroshima.jp -kaita.hiroshima.jp -kui.hiroshima.jp -kumano.hiroshima.jp -kure.hiroshima.jp -mihara.hiroshima.jp -miyoshi.hiroshima.jp -naka.hiroshima.jp -onomichi.hiroshima.jp -osakikamijima.hiroshima.jp -otake.hiroshima.jp -saka.hiroshima.jp -sera.hiroshima.jp -seranishi.hiroshima.jp -shinichi.hiroshima.jp -shobara.hiroshima.jp -takehara.hiroshima.jp -abashiri.hokkaido.jp -abira.hokkaido.jp -aibetsu.hokkaido.jp -akabira.hokkaido.jp -akkeshi.hokkaido.jp -asahikawa.hokkaido.jp -ashibetsu.hokkaido.jp -ashoro.hokkaido.jp -assabu.hokkaido.jp -atsuma.hokkaido.jp -bibai.hokkaido.jp -biei.hokkaido.jp -bifuka.hokkaido.jp -bihoro.hokkaido.jp -biratori.hokkaido.jp -chippubetsu.hokkaido.jp -chitose.hokkaido.jp -date.hokkaido.jp -ebetsu.hokkaido.jp -embetsu.hokkaido.jp -eniwa.hokkaido.jp -erimo.hokkaido.jp -esan.hokkaido.jp -esashi.hokkaido.jp -fukagawa.hokkaido.jp -fukushima.hokkaido.jp -furano.hokkaido.jp -furubira.hokkaido.jp -haboro.hokkaido.jp -hakodate.hokkaido.jp -hamatonbetsu.hokkaido.jp -hidaka.hokkaido.jp -higashikagura.hokkaido.jp -higashikawa.hokkaido.jp -hiroo.hokkaido.jp -hokuryu.hokkaido.jp -hokuto.hokkaido.jp -honbetsu.hokkaido.jp -horokanai.hokkaido.jp -horonobe.hokkaido.jp -ikeda.hokkaido.jp -imakane.hokkaido.jp -ishikari.hokkaido.jp -iwamizawa.hokkaido.jp -iwanai.hokkaido.jp -kamifurano.hokkaido.jp -kamikawa.hokkaido.jp -kamishihoro.hokkaido.jp -kamisunagawa.hokkaido.jp -kamoenai.hokkaido.jp -kayabe.hokkaido.jp -kembuchi.hokkaido.jp -kikonai.hokkaido.jp -kimobetsu.hokkaido.jp -kitahiroshima.hokkaido.jp -kitami.hokkaido.jp -kiyosato.hokkaido.jp -koshimizu.hokkaido.jp -kunneppu.hokkaido.jp -kuriyama.hokkaido.jp -kuromatsunai.hokkaido.jp -kushiro.hokkaido.jp -kutchan.hokkaido.jp -kyowa.hokkaido.jp -mashike.hokkaido.jp -matsumae.hokkaido.jp -mikasa.hokkaido.jp -minamifurano.hokkaido.jp -mombetsu.hokkaido.jp -moseushi.hokkaido.jp -mukawa.hokkaido.jp -muroran.hokkaido.jp -naie.hokkaido.jp -nakagawa.hokkaido.jp -nakasatsunai.hokkaido.jp -nakatombetsu.hokkaido.jp -nanae.hokkaido.jp -nanporo.hokkaido.jp -nayoro.hokkaido.jp -nemuro.hokkaido.jp -niikappu.hokkaido.jp -niki.hokkaido.jp -nishiokoppe.hokkaido.jp -noboribetsu.hokkaido.jp -numata.hokkaido.jp -obihiro.hokkaido.jp -obira.hokkaido.jp -oketo.hokkaido.jp -okoppe.hokkaido.jp -otaru.hokkaido.jp -otobe.hokkaido.jp -otofuke.hokkaido.jp -otoineppu.hokkaido.jp -oumu.hokkaido.jp -ozora.hokkaido.jp -pippu.hokkaido.jp -rankoshi.hokkaido.jp -rebun.hokkaido.jp -rikubetsu.hokkaido.jp -rishiri.hokkaido.jp -rishirifuji.hokkaido.jp -saroma.hokkaido.jp -sarufutsu.hokkaido.jp -shakotan.hokkaido.jp -shari.hokkaido.jp -shibecha.hokkaido.jp -shibetsu.hokkaido.jp -shikabe.hokkaido.jp -shikaoi.hokkaido.jp -shimamaki.hokkaido.jp -shimizu.hokkaido.jp -shimokawa.hokkaido.jp -shinshinotsu.hokkaido.jp -shintoku.hokkaido.jp -shiranuka.hokkaido.jp -shiraoi.hokkaido.jp -shiriuchi.hokkaido.jp -sobetsu.hokkaido.jp -sunagawa.hokkaido.jp -taiki.hokkaido.jp -takasu.hokkaido.jp -takikawa.hokkaido.jp -takinoue.hokkaido.jp -teshikaga.hokkaido.jp -tobetsu.hokkaido.jp -tohma.hokkaido.jp -tomakomai.hokkaido.jp -tomari.hokkaido.jp -toya.hokkaido.jp -toyako.hokkaido.jp -toyotomi.hokkaido.jp -toyoura.hokkaido.jp -tsubetsu.hokkaido.jp -tsukigata.hokkaido.jp -urakawa.hokkaido.jp -urausu.hokkaido.jp -uryu.hokkaido.jp -utashinai.hokkaido.jp -wakkanai.hokkaido.jp -wassamu.hokkaido.jp -yakumo.hokkaido.jp -yoichi.hokkaido.jp -aioi.hyogo.jp -akashi.hyogo.jp -ako.hyogo.jp -amagasaki.hyogo.jp -aogaki.hyogo.jp -asago.hyogo.jp -ashiya.hyogo.jp -awaji.hyogo.jp -fukusaki.hyogo.jp -goshiki.hyogo.jp -harima.hyogo.jp -himeji.hyogo.jp -ichikawa.hyogo.jp -inagawa.hyogo.jp -itami.hyogo.jp -kakogawa.hyogo.jp -kamigori.hyogo.jp -kamikawa.hyogo.jp -kasai.hyogo.jp -kasuga.hyogo.jp -kawanishi.hyogo.jp -miki.hyogo.jp -minamiawaji.hyogo.jp -nishinomiya.hyogo.jp -nishiwaki.hyogo.jp -ono.hyogo.jp -sanda.hyogo.jp -sannan.hyogo.jp -sasayama.hyogo.jp -sayo.hyogo.jp -shingu.hyogo.jp -shinonsen.hyogo.jp -shiso.hyogo.jp -sumoto.hyogo.jp -taishi.hyogo.jp -taka.hyogo.jp -takarazuka.hyogo.jp -takasago.hyogo.jp -takino.hyogo.jp -tamba.hyogo.jp -tatsuno.hyogo.jp -toyooka.hyogo.jp -yabu.hyogo.jp -yashiro.hyogo.jp -yoka.hyogo.jp -yokawa.hyogo.jp -ami.ibaraki.jp -asahi.ibaraki.jp -bando.ibaraki.jp -chikusei.ibaraki.jp -daigo.ibaraki.jp -fujishiro.ibaraki.jp -hitachi.ibaraki.jp -hitachinaka.ibaraki.jp -hitachiomiya.ibaraki.jp -hitachiota.ibaraki.jp -ibaraki.ibaraki.jp -ina.ibaraki.jp -inashiki.ibaraki.jp -itako.ibaraki.jp -iwama.ibaraki.jp -joso.ibaraki.jp -kamisu.ibaraki.jp -kasama.ibaraki.jp -kashima.ibaraki.jp -kasumigaura.ibaraki.jp -koga.ibaraki.jp -miho.ibaraki.jp -mito.ibaraki.jp -moriya.ibaraki.jp -naka.ibaraki.jp -namegata.ibaraki.jp -oarai.ibaraki.jp -ogawa.ibaraki.jp -omitama.ibaraki.jp -ryugasaki.ibaraki.jp -sakai.ibaraki.jp -sakuragawa.ibaraki.jp -shimodate.ibaraki.jp -shimotsuma.ibaraki.jp -shirosato.ibaraki.jp -sowa.ibaraki.jp -suifu.ibaraki.jp -takahagi.ibaraki.jp -tamatsukuri.ibaraki.jp -tokai.ibaraki.jp -tomobe.ibaraki.jp -tone.ibaraki.jp -toride.ibaraki.jp -tsuchiura.ibaraki.jp -tsukuba.ibaraki.jp -uchihara.ibaraki.jp -ushiku.ibaraki.jp -yachiyo.ibaraki.jp -yamagata.ibaraki.jp -yawara.ibaraki.jp -yuki.ibaraki.jp -anamizu.ishikawa.jp -hakui.ishikawa.jp -hakusan.ishikawa.jp -kaga.ishikawa.jp -kahoku.ishikawa.jp -kanazawa.ishikawa.jp -kawakita.ishikawa.jp -komatsu.ishikawa.jp -nakanoto.ishikawa.jp -nanao.ishikawa.jp -nomi.ishikawa.jp -nonoichi.ishikawa.jp -noto.ishikawa.jp -shika.ishikawa.jp -suzu.ishikawa.jp -tsubata.ishikawa.jp -tsurugi.ishikawa.jp -uchinada.ishikawa.jp -wajima.ishikawa.jp -fudai.iwate.jp -fujisawa.iwate.jp -hanamaki.iwate.jp -hiraizumi.iwate.jp -hirono.iwate.jp -ichinohe.iwate.jp -ichinoseki.iwate.jp -iwaizumi.iwate.jp -iwate.iwate.jp -joboji.iwate.jp -kamaishi.iwate.jp -kanegasaki.iwate.jp -karumai.iwate.jp -kawai.iwate.jp -kitakami.iwate.jp -kuji.iwate.jp -kunohe.iwate.jp -kuzumaki.iwate.jp -miyako.iwate.jp -mizusawa.iwate.jp -morioka.iwate.jp -ninohe.iwate.jp -noda.iwate.jp -ofunato.iwate.jp -oshu.iwate.jp -otsuchi.iwate.jp -rikuzentakata.iwate.jp -shiwa.iwate.jp -shizukuishi.iwate.jp -sumita.iwate.jp -tanohata.iwate.jp -tono.iwate.jp -yahaba.iwate.jp -yamada.iwate.jp -ayagawa.kagawa.jp -higashikagawa.kagawa.jp -kanonji.kagawa.jp -kotohira.kagawa.jp -manno.kagawa.jp -marugame.kagawa.jp -mitoyo.kagawa.jp -naoshima.kagawa.jp -sanuki.kagawa.jp -tadotsu.kagawa.jp -takamatsu.kagawa.jp -tonosho.kagawa.jp -uchinomi.kagawa.jp -utazu.kagawa.jp -zentsuji.kagawa.jp -akune.kagoshima.jp -amami.kagoshima.jp -hioki.kagoshima.jp -isa.kagoshima.jp -isen.kagoshima.jp -izumi.kagoshima.jp -kagoshima.kagoshima.jp -kanoya.kagoshima.jp -kawanabe.kagoshima.jp -kinko.kagoshima.jp -kouyama.kagoshima.jp -makurazaki.kagoshima.jp -matsumoto.kagoshima.jp -minamitane.kagoshima.jp -nakatane.kagoshima.jp -nishinoomote.kagoshima.jp -satsumasendai.kagoshima.jp -soo.kagoshima.jp -tarumizu.kagoshima.jp -yusui.kagoshima.jp -aikawa.kanagawa.jp -atsugi.kanagawa.jp -ayase.kanagawa.jp -chigasaki.kanagawa.jp -ebina.kanagawa.jp -fujisawa.kanagawa.jp -hadano.kanagawa.jp -hakone.kanagawa.jp -hiratsuka.kanagawa.jp -isehara.kanagawa.jp -kaisei.kanagawa.jp -kamakura.kanagawa.jp -kiyokawa.kanagawa.jp -matsuda.kanagawa.jp -minamiashigara.kanagawa.jp -miura.kanagawa.jp -nakai.kanagawa.jp -ninomiya.kanagawa.jp -odawara.kanagawa.jp -oi.kanagawa.jp -oiso.kanagawa.jp -sagamihara.kanagawa.jp -samukawa.kanagawa.jp -tsukui.kanagawa.jp -yamakita.kanagawa.jp -yamato.kanagawa.jp -yokosuka.kanagawa.jp -yugawara.kanagawa.jp -zama.kanagawa.jp -zushi.kanagawa.jp -aki.kochi.jp -geisei.kochi.jp -hidaka.kochi.jp -higashitsuno.kochi.jp -ino.kochi.jp -kagami.kochi.jp -kami.kochi.jp -kitagawa.kochi.jp -kochi.kochi.jp -mihara.kochi.jp -motoyama.kochi.jp -muroto.kochi.jp -nahari.kochi.jp -nakamura.kochi.jp -nankoku.kochi.jp -nishitosa.kochi.jp -niyodogawa.kochi.jp -ochi.kochi.jp -okawa.kochi.jp -otoyo.kochi.jp -otsuki.kochi.jp -sakawa.kochi.jp -sukumo.kochi.jp -susaki.kochi.jp -tosa.kochi.jp -tosashimizu.kochi.jp -toyo.kochi.jp -tsuno.kochi.jp -umaji.kochi.jp -yasuda.kochi.jp -yusuhara.kochi.jp -amakusa.kumamoto.jp -arao.kumamoto.jp -aso.kumamoto.jp -choyo.kumamoto.jp -gyokuto.kumamoto.jp -hitoyoshi.kumamoto.jp -kamiamakusa.kumamoto.jp -kashima.kumamoto.jp -kikuchi.kumamoto.jp -kosa.kumamoto.jp -kumamoto.kumamoto.jp -mashiki.kumamoto.jp -mifune.kumamoto.jp -minamata.kumamoto.jp -minamioguni.kumamoto.jp -nagasu.kumamoto.jp -nishihara.kumamoto.jp -oguni.kumamoto.jp -ozu.kumamoto.jp -sumoto.kumamoto.jp -takamori.kumamoto.jp -uki.kumamoto.jp -uto.kumamoto.jp -yamaga.kumamoto.jp -yamato.kumamoto.jp -yatsushiro.kumamoto.jp -ayabe.kyoto.jp -fukuchiyama.kyoto.jp -higashiyama.kyoto.jp -ide.kyoto.jp -ine.kyoto.jp -joyo.kyoto.jp -kameoka.kyoto.jp -kamo.kyoto.jp -kita.kyoto.jp -kizu.kyoto.jp -kumiyama.kyoto.jp -kyotamba.kyoto.jp -kyotanabe.kyoto.jp -kyotango.kyoto.jp -maizuru.kyoto.jp -minami.kyoto.jp -minamiyamashiro.kyoto.jp -miyazu.kyoto.jp -muko.kyoto.jp -nagaokakyo.kyoto.jp -nakagyo.kyoto.jp -nantan.kyoto.jp -oyamazaki.kyoto.jp -sakyo.kyoto.jp -seika.kyoto.jp -tanabe.kyoto.jp -uji.kyoto.jp -ujitawara.kyoto.jp -wazuka.kyoto.jp -yamashina.kyoto.jp -yawata.kyoto.jp -asahi.mie.jp -inabe.mie.jp -ise.mie.jp -kameyama.mie.jp -kawagoe.mie.jp -kiho.mie.jp -kisosaki.mie.jp -kiwa.mie.jp -komono.mie.jp -kumano.mie.jp -kuwana.mie.jp -matsusaka.mie.jp -meiwa.mie.jp -mihama.mie.jp -minamiise.mie.jp -misugi.mie.jp -miyama.mie.jp -nabari.mie.jp -shima.mie.jp -suzuka.mie.jp -tado.mie.jp -taiki.mie.jp -taki.mie.jp -tamaki.mie.jp -toba.mie.jp -tsu.mie.jp -udono.mie.jp -ureshino.mie.jp -watarai.mie.jp -yokkaichi.mie.jp -furukawa.miyagi.jp -higashimatsushima.miyagi.jp -ishinomaki.miyagi.jp -iwanuma.miyagi.jp -kakuda.miyagi.jp -kami.miyagi.jp -kawasaki.miyagi.jp -kesennuma.miyagi.jp -marumori.miyagi.jp -matsushima.miyagi.jp -minamisanriku.miyagi.jp -misato.miyagi.jp -murata.miyagi.jp -natori.miyagi.jp -ogawara.miyagi.jp -ohira.miyagi.jp -onagawa.miyagi.jp -osaki.miyagi.jp -rifu.miyagi.jp -semine.miyagi.jp -shibata.miyagi.jp -shichikashuku.miyagi.jp -shikama.miyagi.jp -shiogama.miyagi.jp -shiroishi.miyagi.jp -tagajo.miyagi.jp -taiwa.miyagi.jp -tome.miyagi.jp -tomiya.miyagi.jp -wakuya.miyagi.jp -watari.miyagi.jp -yamamoto.miyagi.jp -zao.miyagi.jp -aya.miyazaki.jp -ebino.miyazaki.jp -gokase.miyazaki.jp -hyuga.miyazaki.jp -kadogawa.miyazaki.jp -kawaminami.miyazaki.jp -kijo.miyazaki.jp -kitagawa.miyazaki.jp -kitakata.miyazaki.jp -kitaura.miyazaki.jp -kobayashi.miyazaki.jp -kunitomi.miyazaki.jp -kushima.miyazaki.jp -mimata.miyazaki.jp -miyakonojo.miyazaki.jp -miyazaki.miyazaki.jp -morotsuka.miyazaki.jp -nichinan.miyazaki.jp -nishimera.miyazaki.jp -nobeoka.miyazaki.jp -saito.miyazaki.jp -shiiba.miyazaki.jp -shintomi.miyazaki.jp -takaharu.miyazaki.jp -takanabe.miyazaki.jp -takazaki.miyazaki.jp -tsuno.miyazaki.jp -achi.nagano.jp -agematsu.nagano.jp -anan.nagano.jp -aoki.nagano.jp -asahi.nagano.jp -azumino.nagano.jp -chikuhoku.nagano.jp -chikuma.nagano.jp -chino.nagano.jp -fujimi.nagano.jp -hakuba.nagano.jp -hara.nagano.jp -hiraya.nagano.jp -iida.nagano.jp -iijima.nagano.jp -iiyama.nagano.jp -iizuna.nagano.jp -ikeda.nagano.jp -ikusaka.nagano.jp -ina.nagano.jp -karuizawa.nagano.jp -kawakami.nagano.jp -kiso.nagano.jp -kisofukushima.nagano.jp -kitaaiki.nagano.jp -komagane.nagano.jp -komoro.nagano.jp -matsukawa.nagano.jp -matsumoto.nagano.jp -miasa.nagano.jp -minamiaiki.nagano.jp -minamimaki.nagano.jp -minamiminowa.nagano.jp -minowa.nagano.jp -miyada.nagano.jp -miyota.nagano.jp -mochizuki.nagano.jp -nagano.nagano.jp -nagawa.nagano.jp -nagiso.nagano.jp -nakagawa.nagano.jp -nakano.nagano.jp -nozawaonsen.nagano.jp -obuse.nagano.jp -ogawa.nagano.jp -okaya.nagano.jp -omachi.nagano.jp -omi.nagano.jp -ookuwa.nagano.jp -ooshika.nagano.jp -otaki.nagano.jp -otari.nagano.jp -sakae.nagano.jp -sakaki.nagano.jp -saku.nagano.jp -sakuho.nagano.jp -shimosuwa.nagano.jp -shinanomachi.nagano.jp -shiojiri.nagano.jp -suwa.nagano.jp -suzaka.nagano.jp -takagi.nagano.jp -takamori.nagano.jp -takayama.nagano.jp -tateshina.nagano.jp -tatsuno.nagano.jp -togakushi.nagano.jp -togura.nagano.jp -tomi.nagano.jp -ueda.nagano.jp -wada.nagano.jp -yamagata.nagano.jp -yamanouchi.nagano.jp -yasaka.nagano.jp -yasuoka.nagano.jp -chijiwa.nagasaki.jp -futsu.nagasaki.jp -goto.nagasaki.jp -hasami.nagasaki.jp -hirado.nagasaki.jp -iki.nagasaki.jp -isahaya.nagasaki.jp -kawatana.nagasaki.jp -kuchinotsu.nagasaki.jp -matsuura.nagasaki.jp -nagasaki.nagasaki.jp -obama.nagasaki.jp -omura.nagasaki.jp -oseto.nagasaki.jp -saikai.nagasaki.jp -sasebo.nagasaki.jp -seihi.nagasaki.jp -shimabara.nagasaki.jp -shinkamigoto.nagasaki.jp -togitsu.nagasaki.jp -tsushima.nagasaki.jp -unzen.nagasaki.jp -ando.nara.jp -gose.nara.jp -heguri.nara.jp -higashiyoshino.nara.jp -ikaruga.nara.jp -ikoma.nara.jp -kamikitayama.nara.jp -kanmaki.nara.jp -kashiba.nara.jp -kashihara.nara.jp -katsuragi.nara.jp -kawai.nara.jp -kawakami.nara.jp -kawanishi.nara.jp -koryo.nara.jp -kurotaki.nara.jp -mitsue.nara.jp -miyake.nara.jp -nara.nara.jp -nosegawa.nara.jp -oji.nara.jp -ouda.nara.jp -oyodo.nara.jp -sakurai.nara.jp -sango.nara.jp -shimoichi.nara.jp -shimokitayama.nara.jp -shinjo.nara.jp -soni.nara.jp -takatori.nara.jp -tawaramoto.nara.jp -tenkawa.nara.jp -tenri.nara.jp -uda.nara.jp -yamatokoriyama.nara.jp -yamatotakada.nara.jp -yamazoe.nara.jp -yoshino.nara.jp -aga.niigata.jp -agano.niigata.jp -gosen.niigata.jp -itoigawa.niigata.jp -izumozaki.niigata.jp -joetsu.niigata.jp -kamo.niigata.jp -kariwa.niigata.jp -kashiwazaki.niigata.jp -minamiuonuma.niigata.jp -mitsuke.niigata.jp -muika.niigata.jp -murakami.niigata.jp -myoko.niigata.jp -nagaoka.niigata.jp -niigata.niigata.jp -ojiya.niigata.jp -omi.niigata.jp -sado.niigata.jp -sanjo.niigata.jp -seiro.niigata.jp -seirou.niigata.jp -sekikawa.niigata.jp -shibata.niigata.jp -tagami.niigata.jp -tainai.niigata.jp -tochio.niigata.jp -tokamachi.niigata.jp -tsubame.niigata.jp -tsunan.niigata.jp -uonuma.niigata.jp -yahiko.niigata.jp -yoita.niigata.jp -yuzawa.niigata.jp -beppu.oita.jp -bungoono.oita.jp -bungotakada.oita.jp -hasama.oita.jp -hiji.oita.jp -himeshima.oita.jp -hita.oita.jp -kamitsue.oita.jp -kokonoe.oita.jp -kuju.oita.jp -kunisaki.oita.jp -kusu.oita.jp -oita.oita.jp -saiki.oita.jp -taketa.oita.jp -tsukumi.oita.jp -usa.oita.jp -usuki.oita.jp -yufu.oita.jp -akaiwa.okayama.jp -asakuchi.okayama.jp -bizen.okayama.jp -hayashima.okayama.jp -ibara.okayama.jp -kagamino.okayama.jp -kasaoka.okayama.jp -kibichuo.okayama.jp -kumenan.okayama.jp -kurashiki.okayama.jp -maniwa.okayama.jp -misaki.okayama.jp -nagi.okayama.jp -niimi.okayama.jp -nishiawakura.okayama.jp -okayama.okayama.jp -satosho.okayama.jp -setouchi.okayama.jp -shinjo.okayama.jp -shoo.okayama.jp -soja.okayama.jp -takahashi.okayama.jp -tamano.okayama.jp -tsuyama.okayama.jp -wake.okayama.jp -yakage.okayama.jp -aguni.okinawa.jp -ginowan.okinawa.jp -ginoza.okinawa.jp -gushikami.okinawa.jp -haebaru.okinawa.jp -higashi.okinawa.jp -hirara.okinawa.jp -iheya.okinawa.jp -ishigaki.okinawa.jp -ishikawa.okinawa.jp -itoman.okinawa.jp -izena.okinawa.jp -kadena.okinawa.jp -kin.okinawa.jp -kitadaito.okinawa.jp -kitanakagusuku.okinawa.jp -kumejima.okinawa.jp -kunigami.okinawa.jp -minamidaito.okinawa.jp -motobu.okinawa.jp -nago.okinawa.jp -naha.okinawa.jp -nakagusuku.okinawa.jp -nakijin.okinawa.jp -nanjo.okinawa.jp -nishihara.okinawa.jp -ogimi.okinawa.jp -okinawa.okinawa.jp -onna.okinawa.jp -shimoji.okinawa.jp -taketomi.okinawa.jp -tarama.okinawa.jp -tokashiki.okinawa.jp -tomigusuku.okinawa.jp -tonaki.okinawa.jp -urasoe.okinawa.jp -uruma.okinawa.jp -yaese.okinawa.jp -yomitan.okinawa.jp -yonabaru.okinawa.jp -yonaguni.okinawa.jp -zamami.okinawa.jp -abeno.osaka.jp -chihayaakasaka.osaka.jp -chuo.osaka.jp -daito.osaka.jp -fujiidera.osaka.jp -habikino.osaka.jp -hannan.osaka.jp -higashiosaka.osaka.jp -higashisumiyoshi.osaka.jp -higashiyodogawa.osaka.jp -hirakata.osaka.jp -ibaraki.osaka.jp -ikeda.osaka.jp -izumi.osaka.jp -izumiotsu.osaka.jp -izumisano.osaka.jp -kadoma.osaka.jp -kaizuka.osaka.jp -kanan.osaka.jp -kashiwara.osaka.jp -katano.osaka.jp -kawachinagano.osaka.jp -kishiwada.osaka.jp -kita.osaka.jp -kumatori.osaka.jp -matsubara.osaka.jp -minato.osaka.jp -minoh.osaka.jp -misaki.osaka.jp -moriguchi.osaka.jp -neyagawa.osaka.jp -nishi.osaka.jp -nose.osaka.jp -osakasayama.osaka.jp -sakai.osaka.jp -sayama.osaka.jp -sennan.osaka.jp -settsu.osaka.jp -shijonawate.osaka.jp -shimamoto.osaka.jp -suita.osaka.jp -tadaoka.osaka.jp -taishi.osaka.jp -tajiri.osaka.jp -takaishi.osaka.jp -takatsuki.osaka.jp -tondabayashi.osaka.jp -toyonaka.osaka.jp -toyono.osaka.jp -yao.osaka.jp -ariake.saga.jp -arita.saga.jp -fukudomi.saga.jp -genkai.saga.jp -hamatama.saga.jp -hizen.saga.jp -imari.saga.jp -kamimine.saga.jp -kanzaki.saga.jp -karatsu.saga.jp -kashima.saga.jp -kitagata.saga.jp -kitahata.saga.jp -kiyama.saga.jp -kouhoku.saga.jp -kyuragi.saga.jp -nishiarita.saga.jp -ogi.saga.jp -omachi.saga.jp -ouchi.saga.jp -saga.saga.jp -shiroishi.saga.jp -taku.saga.jp -tara.saga.jp -tosu.saga.jp -yoshinogari.saga.jp -arakawa.saitama.jp -asaka.saitama.jp -chichibu.saitama.jp -fujimi.saitama.jp -fujimino.saitama.jp -fukaya.saitama.jp -hanno.saitama.jp -hanyu.saitama.jp -hasuda.saitama.jp -hatogaya.saitama.jp -hatoyama.saitama.jp -hidaka.saitama.jp -higashichichibu.saitama.jp -higashimatsuyama.saitama.jp -honjo.saitama.jp -ina.saitama.jp -iruma.saitama.jp -iwatsuki.saitama.jp -kamiizumi.saitama.jp -kamikawa.saitama.jp -kamisato.saitama.jp -kasukabe.saitama.jp -kawagoe.saitama.jp -kawaguchi.saitama.jp -kawajima.saitama.jp -kazo.saitama.jp -kitamoto.saitama.jp -koshigaya.saitama.jp -kounosu.saitama.jp -kuki.saitama.jp -kumagaya.saitama.jp -matsubushi.saitama.jp -minano.saitama.jp -misato.saitama.jp -miyashiro.saitama.jp -miyoshi.saitama.jp -moroyama.saitama.jp -nagatoro.saitama.jp -namegawa.saitama.jp -niiza.saitama.jp -ogano.saitama.jp -ogawa.saitama.jp -ogose.saitama.jp -okegawa.saitama.jp -omiya.saitama.jp -otaki.saitama.jp -ranzan.saitama.jp -ryokami.saitama.jp -saitama.saitama.jp -sakado.saitama.jp -satte.saitama.jp -sayama.saitama.jp -shiki.saitama.jp -shiraoka.saitama.jp -soka.saitama.jp -sugito.saitama.jp -toda.saitama.jp -tokigawa.saitama.jp -tokorozawa.saitama.jp -tsurugashima.saitama.jp -urawa.saitama.jp -warabi.saitama.jp -yashio.saitama.jp -yokoze.saitama.jp -yono.saitama.jp -yorii.saitama.jp -yoshida.saitama.jp -yoshikawa.saitama.jp -yoshimi.saitama.jp -aisho.shiga.jp -gamo.shiga.jp -higashiomi.shiga.jp -hikone.shiga.jp -koka.shiga.jp -konan.shiga.jp -kosei.shiga.jp -koto.shiga.jp -kusatsu.shiga.jp -maibara.shiga.jp -moriyama.shiga.jp -nagahama.shiga.jp -nishiazai.shiga.jp -notogawa.shiga.jp -omihachiman.shiga.jp -otsu.shiga.jp -ritto.shiga.jp -ryuoh.shiga.jp -takashima.shiga.jp -takatsuki.shiga.jp -torahime.shiga.jp -toyosato.shiga.jp -yasu.shiga.jp -akagi.shimane.jp -ama.shimane.jp -gotsu.shimane.jp -hamada.shimane.jp -higashiizumo.shimane.jp -hikawa.shimane.jp -hikimi.shimane.jp -izumo.shimane.jp -kakinoki.shimane.jp -masuda.shimane.jp -matsue.shimane.jp -misato.shimane.jp -nishinoshima.shimane.jp -ohda.shimane.jp -okinoshima.shimane.jp -okuizumo.shimane.jp -shimane.shimane.jp -tamayu.shimane.jp -tsuwano.shimane.jp -unnan.shimane.jp -yakumo.shimane.jp -yasugi.shimane.jp -yatsuka.shimane.jp -arai.shizuoka.jp -atami.shizuoka.jp -fuji.shizuoka.jp -fujieda.shizuoka.jp -fujikawa.shizuoka.jp -fujinomiya.shizuoka.jp -fukuroi.shizuoka.jp -gotemba.shizuoka.jp -haibara.shizuoka.jp -hamamatsu.shizuoka.jp -higashiizu.shizuoka.jp -ito.shizuoka.jp -iwata.shizuoka.jp -izu.shizuoka.jp -izunokuni.shizuoka.jp -kakegawa.shizuoka.jp -kannami.shizuoka.jp -kawanehon.shizuoka.jp -kawazu.shizuoka.jp -kikugawa.shizuoka.jp -kosai.shizuoka.jp -makinohara.shizuoka.jp -matsuzaki.shizuoka.jp -minamiizu.shizuoka.jp -mishima.shizuoka.jp -morimachi.shizuoka.jp -nishiizu.shizuoka.jp -numazu.shizuoka.jp -omaezaki.shizuoka.jp -shimada.shizuoka.jp -shimizu.shizuoka.jp -shimoda.shizuoka.jp -shizuoka.shizuoka.jp -susono.shizuoka.jp -yaizu.shizuoka.jp -yoshida.shizuoka.jp -ashikaga.tochigi.jp -bato.tochigi.jp -haga.tochigi.jp -ichikai.tochigi.jp -iwafune.tochigi.jp -kaminokawa.tochigi.jp -kanuma.tochigi.jp -karasuyama.tochigi.jp -kuroiso.tochigi.jp -mashiko.tochigi.jp -mibu.tochigi.jp -moka.tochigi.jp -motegi.tochigi.jp -nasu.tochigi.jp -nasushiobara.tochigi.jp -nikko.tochigi.jp -nishikata.tochigi.jp -nogi.tochigi.jp -ohira.tochigi.jp -ohtawara.tochigi.jp -oyama.tochigi.jp -sakura.tochigi.jp -sano.tochigi.jp -shimotsuke.tochigi.jp -shioya.tochigi.jp -takanezawa.tochigi.jp -tochigi.tochigi.jp -tsuga.tochigi.jp -ujiie.tochigi.jp -utsunomiya.tochigi.jp -yaita.tochigi.jp -aizumi.tokushima.jp -anan.tokushima.jp -ichiba.tokushima.jp -itano.tokushima.jp -kainan.tokushima.jp -komatsushima.tokushima.jp -matsushige.tokushima.jp -mima.tokushima.jp -minami.tokushima.jp -miyoshi.tokushima.jp -mugi.tokushima.jp -nakagawa.tokushima.jp -naruto.tokushima.jp -sanagochi.tokushima.jp -shishikui.tokushima.jp -tokushima.tokushima.jp -wajiki.tokushima.jp -adachi.tokyo.jp -akiruno.tokyo.jp -akishima.tokyo.jp -aogashima.tokyo.jp -arakawa.tokyo.jp -bunkyo.tokyo.jp -chiyoda.tokyo.jp -chofu.tokyo.jp -chuo.tokyo.jp -edogawa.tokyo.jp -fuchu.tokyo.jp -fussa.tokyo.jp -hachijo.tokyo.jp -hachioji.tokyo.jp -hamura.tokyo.jp -higashikurume.tokyo.jp -higashimurayama.tokyo.jp -higashiyamato.tokyo.jp -hino.tokyo.jp -hinode.tokyo.jp -hinohara.tokyo.jp -inagi.tokyo.jp -itabashi.tokyo.jp -katsushika.tokyo.jp -kita.tokyo.jp -kiyose.tokyo.jp -kodaira.tokyo.jp -koganei.tokyo.jp -kokubunji.tokyo.jp -komae.tokyo.jp -koto.tokyo.jp -kouzushima.tokyo.jp -kunitachi.tokyo.jp -machida.tokyo.jp -meguro.tokyo.jp -minato.tokyo.jp -mitaka.tokyo.jp -mizuho.tokyo.jp -musashimurayama.tokyo.jp -musashino.tokyo.jp -nakano.tokyo.jp -nerima.tokyo.jp -ogasawara.tokyo.jp -okutama.tokyo.jp -ome.tokyo.jp -oshima.tokyo.jp -ota.tokyo.jp -setagaya.tokyo.jp -shibuya.tokyo.jp -shinagawa.tokyo.jp -shinjuku.tokyo.jp -suginami.tokyo.jp -sumida.tokyo.jp -tachikawa.tokyo.jp -taito.tokyo.jp -tama.tokyo.jp -toshima.tokyo.jp -chizu.tottori.jp -hino.tottori.jp -kawahara.tottori.jp -koge.tottori.jp -kotoura.tottori.jp -misasa.tottori.jp -nanbu.tottori.jp -nichinan.tottori.jp -sakaiminato.tottori.jp -tottori.tottori.jp -wakasa.tottori.jp -yazu.tottori.jp -yonago.tottori.jp -asahi.toyama.jp -fuchu.toyama.jp -fukumitsu.toyama.jp -funahashi.toyama.jp -himi.toyama.jp -imizu.toyama.jp -inami.toyama.jp -johana.toyama.jp -kamiichi.toyama.jp -kurobe.toyama.jp -nakaniikawa.toyama.jp -namerikawa.toyama.jp -nanto.toyama.jp -nyuzen.toyama.jp -oyabe.toyama.jp -taira.toyama.jp -takaoka.toyama.jp -tateyama.toyama.jp -toga.toyama.jp -tonami.toyama.jp -toyama.toyama.jp -unazuki.toyama.jp -uozu.toyama.jp -yamada.toyama.jp -arida.wakayama.jp -aridagawa.wakayama.jp -gobo.wakayama.jp -hashimoto.wakayama.jp -hidaka.wakayama.jp -hirogawa.wakayama.jp -inami.wakayama.jp -iwade.wakayama.jp -kainan.wakayama.jp -kamitonda.wakayama.jp -katsuragi.wakayama.jp -kimino.wakayama.jp -kinokawa.wakayama.jp -kitayama.wakayama.jp -koya.wakayama.jp -koza.wakayama.jp -kozagawa.wakayama.jp -kudoyama.wakayama.jp -kushimoto.wakayama.jp -mihama.wakayama.jp -misato.wakayama.jp -nachikatsuura.wakayama.jp -shingu.wakayama.jp -shirahama.wakayama.jp -taiji.wakayama.jp -tanabe.wakayama.jp -wakayama.wakayama.jp -yuasa.wakayama.jp -yura.wakayama.jp -asahi.yamagata.jp -funagata.yamagata.jp -higashine.yamagata.jp -iide.yamagata.jp -kahoku.yamagata.jp -kaminoyama.yamagata.jp -kaneyama.yamagata.jp -kawanishi.yamagata.jp -mamurogawa.yamagata.jp -mikawa.yamagata.jp -murayama.yamagata.jp -nagai.yamagata.jp -nakayama.yamagata.jp -nanyo.yamagata.jp -nishikawa.yamagata.jp -obanazawa.yamagata.jp -oe.yamagata.jp -oguni.yamagata.jp -ohkura.yamagata.jp -oishida.yamagata.jp -sagae.yamagata.jp -sakata.yamagata.jp -sakegawa.yamagata.jp -shinjo.yamagata.jp -shirataka.yamagata.jp -shonai.yamagata.jp -takahata.yamagata.jp -tendo.yamagata.jp -tozawa.yamagata.jp -tsuruoka.yamagata.jp -yamagata.yamagata.jp -yamanobe.yamagata.jp -yonezawa.yamagata.jp -yuza.yamagata.jp -abu.yamaguchi.jp -hagi.yamaguchi.jp -hikari.yamaguchi.jp -hofu.yamaguchi.jp -iwakuni.yamaguchi.jp -kudamatsu.yamaguchi.jp -mitou.yamaguchi.jp -nagato.yamaguchi.jp -oshima.yamaguchi.jp -shimonoseki.yamaguchi.jp -shunan.yamaguchi.jp -tabuse.yamaguchi.jp -tokuyama.yamaguchi.jp -toyota.yamaguchi.jp -ube.yamaguchi.jp -yuu.yamaguchi.jp -chuo.yamanashi.jp -doshi.yamanashi.jp -fuefuki.yamanashi.jp -fujikawa.yamanashi.jp -fujikawaguchiko.yamanashi.jp -fujiyoshida.yamanashi.jp -hayakawa.yamanashi.jp -hokuto.yamanashi.jp -ichikawamisato.yamanashi.jp -kai.yamanashi.jp -kofu.yamanashi.jp -koshu.yamanashi.jp -kosuge.yamanashi.jp -minami-alps.yamanashi.jp -minobu.yamanashi.jp -nakamichi.yamanashi.jp -nanbu.yamanashi.jp -narusawa.yamanashi.jp -nirasaki.yamanashi.jp -nishikatsura.yamanashi.jp -oshino.yamanashi.jp -otsuki.yamanashi.jp -showa.yamanashi.jp -tabayama.yamanashi.jp -tsuru.yamanashi.jp -uenohara.yamanashi.jp -yamanakako.yamanashi.jp -yamanashi.yamanashi.jp - -// ke : http://www.kenic.or.ke/index.php?option=com_content&task=view&id=117&Itemid=145 -*.ke - -// kg : http://www.domain.kg/dmn_n.html -kg -org.kg -net.kg -com.kg -edu.kg -gov.kg -mil.kg - -// kh : http://www.mptc.gov.kh/dns_registration.htm -*.kh - -// ki : http://www.ki/dns/index.html -ki -edu.ki -biz.ki -net.ki -org.ki -gov.ki -info.ki -com.ki - -// km : http://en.wikipedia.org/wiki/.km -// http://www.domaine.km/documents/charte.doc -km -org.km -nom.km -gov.km -prd.km -tm.km -edu.km -mil.km -ass.km -com.km -// These are only mentioned as proposed suggestions at domaine.km, but -// http://en.wikipedia.org/wiki/.km says they're available for registration: -coop.km -asso.km -presse.km -medecin.km -notaires.km -pharmaciens.km -veterinaire.km -gouv.km - -// kn : http://en.wikipedia.org/wiki/.kn -// http://www.dot.kn/domainRules.html -kn -net.kn -org.kn -edu.kn -gov.kn - -// kp : http://www.kcce.kp/en_index.php -kp -com.kp -edu.kp -gov.kp -org.kp -rep.kp -tra.kp - -// kr : http://en.wikipedia.org/wiki/.kr -// see also: http://domain.nida.or.kr/eng/registration.jsp -kr -ac.kr -co.kr -es.kr -go.kr -hs.kr -kg.kr -mil.kr -ms.kr -ne.kr -or.kr -pe.kr -re.kr -sc.kr -// kr geographical names -busan.kr -chungbuk.kr -chungnam.kr -daegu.kr -daejeon.kr -gangwon.kr -gwangju.kr -gyeongbuk.kr -gyeonggi.kr -gyeongnam.kr -incheon.kr -jeju.kr -jeonbuk.kr -jeonnam.kr -seoul.kr -ulsan.kr - -// kw : http://en.wikipedia.org/wiki/.kw -*.kw - -// ky : http://www.icta.ky/da_ky_reg_dom.php -// Confirmed by registry 2008-06-17 -ky -edu.ky -gov.ky -com.ky -org.ky -net.ky - -// kz : http://en.wikipedia.org/wiki/.kz -// see also: http://www.nic.kz/rules/index.jsp -kz -org.kz -edu.kz -net.kz -gov.kz -mil.kz -com.kz - -// la : http://en.wikipedia.org/wiki/.la -// Submitted by registry 2008-06-10 -la -int.la -net.la -info.la -edu.la -gov.la -per.la -com.la -org.la - -// lb : http://en.wikipedia.org/wiki/.lb -// Submitted by registry 2008-06-17 -lb -com.lb -edu.lb -gov.lb -net.lb -org.lb - -// lc : http://en.wikipedia.org/wiki/.lc -// see also: http://www.nic.lc/rules.htm -lc -com.lc -net.lc -co.lc -org.lc -edu.lc -gov.lc - -// li : http://en.wikipedia.org/wiki/.li -li - -// lk : http://www.nic.lk/seclevpr.html -lk -gov.lk -sch.lk -net.lk -int.lk -com.lk -org.lk -edu.lk -ngo.lk -soc.lk -web.lk -ltd.lk -assn.lk -grp.lk -hotel.lk -ac.lk - -// lr : http://psg.com/dns/lr/lr.txt -// Submitted by registry 2008-06-17 -lr -com.lr -edu.lr -gov.lr -org.lr -net.lr - -// ls : http://en.wikipedia.org/wiki/.ls -ls -co.ls -org.ls - -// lt : http://en.wikipedia.org/wiki/.lt -lt -// gov.lt : http://www.gov.lt/index_en.php -gov.lt - -// lu : http://www.dns.lu/en/ -lu - -// lv : http://www.nic.lv/DNS/En/generic.php -lv -com.lv -edu.lv -gov.lv -org.lv -mil.lv -id.lv -net.lv -asn.lv -conf.lv - -// ly : http://www.nic.ly/regulations.php -ly -com.ly -net.ly -gov.ly -plc.ly -edu.ly -sch.ly -med.ly -org.ly -id.ly - -// ma : http://en.wikipedia.org/wiki/.ma -// http://www.anrt.ma/fr/admin/download/upload/file_fr782.pdf -ma -co.ma -net.ma -gov.ma -org.ma -ac.ma -press.ma - -// mc : http://www.nic.mc/ -mc -tm.mc -asso.mc - -// md : http://en.wikipedia.org/wiki/.md -md - -// me : http://en.wikipedia.org/wiki/.me -me -co.me -net.me -org.me -edu.me -ac.me -gov.me -its.me -priv.me - -// mg : http://www.nic.mg/tarif.htm -mg -org.mg -nom.mg -gov.mg -prd.mg -tm.mg -edu.mg -mil.mg -com.mg - -// mh : http://en.wikipedia.org/wiki/.mh -mh - -// mil : http://en.wikipedia.org/wiki/.mil -mil - -// mk : http://en.wikipedia.org/wiki/.mk -// see also: http://dns.marnet.net.mk/postapka.php -mk -com.mk -org.mk -net.mk -edu.mk -gov.mk -inf.mk -name.mk - -// ml : http://www.gobin.info/domainname/ml-template.doc -// see also: http://en.wikipedia.org/wiki/.ml -ml -com.ml -edu.ml -gouv.ml -gov.ml -net.ml -org.ml -presse.ml - -// mm : http://en.wikipedia.org/wiki/.mm -*.mm - -// mn : http://en.wikipedia.org/wiki/.mn -mn -gov.mn -edu.mn -org.mn - -// mo : http://www.monic.net.mo/ -mo -com.mo -net.mo -org.mo -edu.mo -gov.mo - -// mobi : http://en.wikipedia.org/wiki/.mobi -mobi - -// mp : http://www.dot.mp/ -// Confirmed by registry 2008-06-17 -mp - -// mq : http://en.wikipedia.org/wiki/.mq -mq - -// mr : http://en.wikipedia.org/wiki/.mr -mr -gov.mr - -// ms : http://www.nic.ms/pdf/MS_Domain_Name_Rules.pdf -ms -com.ms -edu.ms -gov.ms -net.ms -org.ms - -// mt : https://www.nic.org.mt/go/policy -// Submitted by registry 2013-11-19 -mt -com.mt -edu.mt -net.mt -org.mt - -// mu : http://en.wikipedia.org/wiki/.mu -mu -com.mu -net.mu -org.mu -gov.mu -ac.mu -co.mu -or.mu - -// museum : http://about.museum/naming/ -// http://index.museum/ -museum -academy.museum -agriculture.museum -air.museum -airguard.museum -alabama.museum -alaska.museum -amber.museum -ambulance.museum -american.museum -americana.museum -americanantiques.museum -americanart.museum -amsterdam.museum -and.museum -annefrank.museum -anthro.museum -anthropology.museum -antiques.museum -aquarium.museum -arboretum.museum -archaeological.museum -archaeology.museum -architecture.museum -art.museum -artanddesign.museum -artcenter.museum -artdeco.museum -arteducation.museum -artgallery.museum -arts.museum -artsandcrafts.museum -asmatart.museum -assassination.museum -assisi.museum -association.museum -astronomy.museum -atlanta.museum -austin.museum -australia.museum -automotive.museum -aviation.museum -axis.museum -badajoz.museum -baghdad.museum -bahn.museum -bale.museum -baltimore.museum -barcelona.museum -baseball.museum -basel.museum -baths.museum -bauern.museum -beauxarts.museum -beeldengeluid.museum -bellevue.museum -bergbau.museum -berkeley.museum -berlin.museum -bern.museum -bible.museum -bilbao.museum -bill.museum -birdart.museum -birthplace.museum -bonn.museum -boston.museum -botanical.museum -botanicalgarden.museum -botanicgarden.museum -botany.museum -brandywinevalley.museum -brasil.museum -bristol.museum -british.museum -britishcolumbia.museum -broadcast.museum -brunel.museum -brussel.museum -brussels.museum -bruxelles.museum -building.museum -burghof.museum -bus.museum -bushey.museum -cadaques.museum -california.museum -cambridge.museum -can.museum -canada.museum -capebreton.museum -carrier.museum -cartoonart.museum -casadelamoneda.museum -castle.museum -castres.museum -celtic.museum -center.museum -chattanooga.museum -cheltenham.museum -chesapeakebay.museum -chicago.museum -children.museum -childrens.museum -childrensgarden.museum -chiropractic.museum -chocolate.museum -christiansburg.museum -cincinnati.museum -cinema.museum -circus.museum -civilisation.museum -civilization.museum -civilwar.museum -clinton.museum -clock.museum -coal.museum -coastaldefence.museum -cody.museum -coldwar.museum -collection.museum -colonialwilliamsburg.museum -coloradoplateau.museum -columbia.museum -columbus.museum -communication.museum -communications.museum -community.museum -computer.museum -computerhistory.museum -comunicações.museum -contemporary.museum -contemporaryart.museum -convent.museum -copenhagen.museum -corporation.museum -correios-e-telecomunicações.museum -corvette.museum -costume.museum -countryestate.museum -county.museum -crafts.museum -cranbrook.museum -creation.museum -cultural.museum -culturalcenter.museum -culture.museum -cyber.museum -cymru.museum -dali.museum -dallas.museum -database.museum -ddr.museum -decorativearts.museum -delaware.museum -delmenhorst.museum -denmark.museum -depot.museum -design.museum -detroit.museum -dinosaur.museum -discovery.museum -dolls.museum -donostia.museum -durham.museum -eastafrica.museum -eastcoast.museum -education.museum -educational.museum -egyptian.museum -eisenbahn.museum -elburg.museum -elvendrell.museum -embroidery.museum -encyclopedic.museum -england.museum -entomology.museum -environment.museum -environmentalconservation.museum -epilepsy.museum -essex.museum -estate.museum -ethnology.museum -exeter.museum -exhibition.museum -family.museum -farm.museum -farmequipment.museum -farmers.museum -farmstead.museum -field.museum -figueres.museum -filatelia.museum -film.museum -fineart.museum -finearts.museum -finland.museum -flanders.museum -florida.museum -force.museum -fortmissoula.museum -fortworth.museum -foundation.museum -francaise.museum -frankfurt.museum -franziskaner.museum -freemasonry.museum -freiburg.museum -fribourg.museum -frog.museum -fundacio.museum -furniture.museum -gallery.museum -garden.museum -gateway.museum -geelvinck.museum -gemological.museum -geology.museum -georgia.museum -giessen.museum -glas.museum -glass.museum -gorge.museum -grandrapids.museum -graz.museum -guernsey.museum -halloffame.museum -hamburg.museum -handson.museum -harvestcelebration.museum -hawaii.museum -health.museum -heimatunduhren.museum -hellas.museum -helsinki.museum -hembygdsforbund.museum -heritage.museum -histoire.museum -historical.museum -historicalsociety.museum -historichouses.museum -historisch.museum -historisches.museum -history.museum -historyofscience.museum -horology.museum -house.museum -humanities.museum -illustration.museum -imageandsound.museum -indian.museum -indiana.museum -indianapolis.museum -indianmarket.museum -intelligence.museum -interactive.museum -iraq.museum -iron.museum -isleofman.museum -jamison.museum -jefferson.museum -jerusalem.museum -jewelry.museum -jewish.museum -jewishart.museum -jfk.museum -journalism.museum -judaica.museum -judygarland.museum -juedisches.museum -juif.museum -karate.museum -karikatur.museum -kids.museum -koebenhavn.museum -koeln.museum -kunst.museum -kunstsammlung.museum -kunstunddesign.museum -labor.museum -labour.museum -lajolla.museum -lancashire.museum -landes.museum -lans.museum -läns.museum -larsson.museum -lewismiller.museum -lincoln.museum -linz.museum -living.museum -livinghistory.museum -localhistory.museum -london.museum -losangeles.museum -louvre.museum -loyalist.museum -lucerne.museum -luxembourg.museum -luzern.museum -mad.museum -madrid.museum -mallorca.museum -manchester.museum -mansion.museum -mansions.museum -manx.museum -marburg.museum -maritime.museum -maritimo.museum -maryland.museum -marylhurst.museum -media.museum -medical.museum -medizinhistorisches.museum -meeres.museum -memorial.museum -mesaverde.museum -michigan.museum -midatlantic.museum -military.museum -mill.museum -miners.museum -mining.museum -minnesota.museum -missile.museum -missoula.museum -modern.museum -moma.museum -money.museum -monmouth.museum -monticello.museum -montreal.museum -moscow.museum -motorcycle.museum -muenchen.museum -muenster.museum -mulhouse.museum -muncie.museum -museet.museum -museumcenter.museum -museumvereniging.museum -music.museum -national.museum -nationalfirearms.museum -nationalheritage.museum -nativeamerican.museum -naturalhistory.museum -naturalhistorymuseum.museum -naturalsciences.museum -nature.museum -naturhistorisches.museum -natuurwetenschappen.museum -naumburg.museum -naval.museum -nebraska.museum -neues.museum -newhampshire.museum -newjersey.museum -newmexico.museum -newport.museum -newspaper.museum -newyork.museum -niepce.museum -norfolk.museum -north.museum -nrw.museum -nuernberg.museum -nuremberg.museum -nyc.museum -nyny.museum -oceanographic.museum -oceanographique.museum -omaha.museum -online.museum -ontario.museum -openair.museum -oregon.museum -oregontrail.museum -otago.museum -oxford.museum -pacific.museum -paderborn.museum -palace.museum -paleo.museum -palmsprings.museum -panama.museum -paris.museum -pasadena.museum -pharmacy.museum -philadelphia.museum -philadelphiaarea.museum -philately.museum -phoenix.museum -photography.museum -pilots.museum -pittsburgh.museum -planetarium.museum -plantation.museum -plants.museum -plaza.museum -portal.museum -portland.museum -portlligat.museum -posts-and-telecommunications.museum -preservation.museum -presidio.museum -press.museum -project.museum -public.museum -pubol.museum -quebec.museum -railroad.museum -railway.museum -research.museum -resistance.museum -riodejaneiro.museum -rochester.museum -rockart.museum -roma.museum -russia.museum -saintlouis.museum -salem.museum -salvadordali.museum -salzburg.museum -sandiego.museum -sanfrancisco.museum -santabarbara.museum -santacruz.museum -santafe.museum -saskatchewan.museum -satx.museum -savannahga.museum -schlesisches.museum -schoenbrunn.museum -schokoladen.museum -school.museum -schweiz.museum -science.museum -scienceandhistory.museum -scienceandindustry.museum -sciencecenter.museum -sciencecenters.museum -science-fiction.museum -sciencehistory.museum -sciences.museum -sciencesnaturelles.museum -scotland.museum -seaport.museum -settlement.museum -settlers.museum -shell.museum -sherbrooke.museum -sibenik.museum -silk.museum -ski.museum -skole.museum -society.museum -sologne.museum -soundandvision.museum -southcarolina.museum -southwest.museum -space.museum -spy.museum -square.museum -stadt.museum -stalbans.museum -starnberg.museum -state.museum -stateofdelaware.museum -station.museum -steam.museum -steiermark.museum -stjohn.museum -stockholm.museum -stpetersburg.museum -stuttgart.museum -suisse.museum -surgeonshall.museum -surrey.museum -svizzera.museum -sweden.museum -sydney.museum -tank.museum -tcm.museum -technology.museum -telekommunikation.museum -television.museum -texas.museum -textile.museum -theater.museum -time.museum -timekeeping.museum -topology.museum -torino.museum -touch.museum -town.museum -transport.museum -tree.museum -trolley.museum -trust.museum -trustee.museum -uhren.museum -ulm.museum -undersea.museum -university.museum -usa.museum -usantiques.museum -usarts.museum -uscountryestate.museum -usculture.museum -usdecorativearts.museum -usgarden.museum -ushistory.museum -ushuaia.museum -uslivinghistory.museum -utah.museum -uvic.museum -valley.museum -vantaa.museum -versailles.museum -viking.museum -village.museum -virginia.museum -virtual.museum -virtuel.museum -vlaanderen.museum -volkenkunde.museum -wales.museum -wallonie.museum -war.museum -washingtondc.museum -watchandclock.museum -watch-and-clock.museum -western.museum -westfalen.museum -whaling.museum -wildlife.museum -williamsburg.museum -windmill.museum -workshop.museum -york.museum -yorkshire.museum -yosemite.museum -youth.museum -zoological.museum -zoology.museum -ירושלים.museum -иком.museum - -// mv : http://en.wikipedia.org/wiki/.mv -// "mv" included because, contra Wikipedia, google.mv exists. -mv -aero.mv -biz.mv -com.mv -coop.mv -edu.mv -gov.mv -info.mv -int.mv -mil.mv -museum.mv -name.mv -net.mv -org.mv -pro.mv - -// mw : http://www.registrar.mw/ -mw -ac.mw -biz.mw -co.mw -com.mw -coop.mw -edu.mw -gov.mw -int.mw -museum.mw -net.mw -org.mw - -// mx : http://www.nic.mx/ -// Submitted by registry 2008-06-19 -mx -com.mx -org.mx -gob.mx -edu.mx -net.mx - -// my : http://www.mynic.net.my/ -my -com.my -net.my -org.my -gov.my -edu.my -mil.my -name.my - -// mz : http://www.gobin.info/domainname/mz-template.doc -*.mz -!teledata.mz - -// na : http://www.na-nic.com.na/ -// http://www.info.na/domain/ -na -info.na -pro.na -name.na -school.na -or.na -dr.na -us.na -mx.na -ca.na -in.na -cc.na -tv.na -ws.na -mobi.na -co.na -com.na -org.na - -// name : has 2nd-level tlds, but there's no list of them -name - -// nc : http://www.cctld.nc/ -nc -asso.nc - -// ne : http://en.wikipedia.org/wiki/.ne -ne - -// net : http://en.wikipedia.org/wiki/.net -net - -// nf : http://en.wikipedia.org/wiki/.nf -nf -com.nf -net.nf -per.nf -rec.nf -web.nf -arts.nf -firm.nf -info.nf -other.nf -store.nf - -// ng : http://psg.com/dns/ng/ -ng -com.ng -edu.ng -name.ng -net.ng -org.ng -sch.ng -gov.ng -mil.ng -mobi.ng - -// ni : http://www.nic.ni/dominios.htm -*.ni - -// nl : http://en.wikipedia.org/wiki/.nl -// https://www.sidn.nl/ -// ccTLD for the Netherlands -nl - -// BV.nl will be a registry for dutch BV's (besloten vennootschap) -bv.nl - -// no : http://www.norid.no/regelverk/index.en.html -// The Norwegian registry has declined to notify us of updates. The web pages -// referenced below are the official source of the data. There is also an -// announce mailing list: -// https://postlister.uninett.no/sympa/info/norid-diskusjon -no -// Norid generic domains : http://www.norid.no/regelverk/vedlegg-c.en.html -fhs.no -vgs.no -fylkesbibl.no -folkebibl.no -museum.no -idrett.no -priv.no -// Non-Norid generic domains : http://www.norid.no/regelverk/vedlegg-d.en.html -mil.no -stat.no -dep.no -kommune.no -herad.no -// no geographical names : http://www.norid.no/regelverk/vedlegg-b.en.html -// counties -aa.no -ah.no -bu.no -fm.no -hl.no -hm.no -jan-mayen.no -mr.no -nl.no -nt.no -of.no -ol.no -oslo.no -rl.no -sf.no -st.no -svalbard.no -tm.no -tr.no -va.no -vf.no -// primary and lower secondary schools per county -gs.aa.no -gs.ah.no -gs.bu.no -gs.fm.no -gs.hl.no -gs.hm.no -gs.jan-mayen.no -gs.mr.no -gs.nl.no -gs.nt.no -gs.of.no -gs.ol.no -gs.oslo.no -gs.rl.no -gs.sf.no -gs.st.no -gs.svalbard.no -gs.tm.no -gs.tr.no -gs.va.no -gs.vf.no -// cities -akrehamn.no -åkrehamn.no -algard.no -ålgård.no -arna.no -brumunddal.no -bryne.no -bronnoysund.no -brønnøysund.no -drobak.no -drøbak.no -egersund.no -fetsund.no -floro.no -florø.no -fredrikstad.no -hokksund.no -honefoss.no -hønefoss.no -jessheim.no -jorpeland.no -jørpeland.no -kirkenes.no -kopervik.no -krokstadelva.no -langevag.no -langevåg.no -leirvik.no -mjondalen.no -mjøndalen.no -mo-i-rana.no -mosjoen.no -mosjøen.no -nesoddtangen.no -orkanger.no -osoyro.no -osøyro.no -raholt.no -råholt.no -sandnessjoen.no -sandnessjøen.no -skedsmokorset.no -slattum.no -spjelkavik.no -stathelle.no -stavern.no -stjordalshalsen.no -stjørdalshalsen.no -tananger.no -tranby.no -vossevangen.no -// communities -afjord.no -åfjord.no -agdenes.no -al.no -ål.no -alesund.no -ålesund.no -alstahaug.no -alta.no -áltá.no -alaheadju.no -álaheadju.no -alvdal.no -amli.no -åmli.no -amot.no -åmot.no -andebu.no -andoy.no -andøy.no -andasuolo.no -ardal.no -årdal.no -aremark.no -arendal.no -ås.no -aseral.no -åseral.no -asker.no -askim.no -askvoll.no -askoy.no -askøy.no -asnes.no -åsnes.no -audnedaln.no -aukra.no -aure.no -aurland.no -aurskog-holand.no -aurskog-høland.no -austevoll.no -austrheim.no -averoy.no -averøy.no -balestrand.no -ballangen.no -balat.no -bálát.no -balsfjord.no -bahccavuotna.no -báhccavuotna.no -bamble.no -bardu.no -beardu.no -beiarn.no -bajddar.no -bájddar.no -baidar.no -báidár.no -berg.no -bergen.no -berlevag.no -berlevåg.no -bearalvahki.no -bearalváhki.no -bindal.no -birkenes.no -bjarkoy.no -bjarkøy.no -bjerkreim.no -bjugn.no -bodo.no -bodø.no -badaddja.no -bådåddjå.no -budejju.no -bokn.no -bremanger.no -bronnoy.no -brønnøy.no -bygland.no -bykle.no -barum.no -bærum.no -bo.telemark.no -bø.telemark.no -bo.nordland.no -bø.nordland.no -bievat.no -bievát.no -bomlo.no -bømlo.no -batsfjord.no -båtsfjord.no -bahcavuotna.no -báhcavuotna.no -dovre.no -drammen.no -drangedal.no -dyroy.no -dyrøy.no -donna.no -dønna.no -eid.no -eidfjord.no -eidsberg.no -eidskog.no -eidsvoll.no -eigersund.no -elverum.no -enebakk.no -engerdal.no -etne.no -etnedal.no -evenes.no -evenassi.no -evenášši.no -evje-og-hornnes.no -farsund.no -fauske.no -fuossko.no -fuoisku.no -fedje.no -fet.no -finnoy.no -finnøy.no -fitjar.no -fjaler.no -fjell.no -flakstad.no -flatanger.no -flekkefjord.no -flesberg.no -flora.no -fla.no -flå.no -folldal.no -forsand.no -fosnes.no -frei.no -frogn.no -froland.no -frosta.no -frana.no -fræna.no -froya.no -frøya.no -fusa.no -fyresdal.no -forde.no -førde.no -gamvik.no -gangaviika.no -gáŋgaviika.no -gaular.no -gausdal.no -gildeskal.no -gildeskål.no -giske.no -gjemnes.no -gjerdrum.no -gjerstad.no -gjesdal.no -gjovik.no -gjøvik.no -gloppen.no -gol.no -gran.no -grane.no -granvin.no -gratangen.no -grimstad.no -grong.no -kraanghke.no -kråanghke.no -grue.no -gulen.no -hadsel.no -halden.no -halsa.no -hamar.no -hamaroy.no -habmer.no -hábmer.no -hapmir.no -hápmir.no -hammerfest.no -hammarfeasta.no -hámmárfeasta.no -haram.no -hareid.no -harstad.no -hasvik.no -aknoluokta.no -ákŋoluokta.no -hattfjelldal.no -aarborte.no -haugesund.no -hemne.no -hemnes.no -hemsedal.no -heroy.more-og-romsdal.no -herøy.møre-og-romsdal.no -heroy.nordland.no -herøy.nordland.no -hitra.no -hjartdal.no -hjelmeland.no -hobol.no -hobøl.no -hof.no -hol.no -hole.no -holmestrand.no -holtalen.no -holtålen.no -hornindal.no -horten.no -hurdal.no -hurum.no -hvaler.no -hyllestad.no -hagebostad.no -hægebostad.no -hoyanger.no -høyanger.no -hoylandet.no -høylandet.no -ha.no -hå.no -ibestad.no -inderoy.no -inderøy.no -iveland.no -jevnaker.no -jondal.no -jolster.no -jølster.no -karasjok.no -karasjohka.no -kárášjohka.no -karlsoy.no -galsa.no -gálsá.no -karmoy.no -karmøy.no -kautokeino.no -guovdageaidnu.no -klepp.no -klabu.no -klæbu.no -kongsberg.no -kongsvinger.no -kragero.no -kragerø.no -kristiansand.no -kristiansund.no -krodsherad.no -krødsherad.no -kvalsund.no -rahkkeravju.no -ráhkkerávju.no -kvam.no -kvinesdal.no -kvinnherad.no -kviteseid.no -kvitsoy.no -kvitsøy.no -kvafjord.no -kvæfjord.no -giehtavuoatna.no -kvanangen.no -kvænangen.no -navuotna.no -návuotna.no -kafjord.no -kåfjord.no -gaivuotna.no -gáivuotna.no -larvik.no -lavangen.no -lavagis.no -loabat.no -loabát.no -lebesby.no -davvesiida.no -leikanger.no -leirfjord.no -leka.no -leksvik.no -lenvik.no -leangaviika.no -leaŋgaviika.no -lesja.no -levanger.no -lier.no -lierne.no -lillehammer.no -lillesand.no -lindesnes.no -lindas.no -lindås.no -lom.no -loppa.no -lahppi.no -láhppi.no -lund.no -lunner.no -luroy.no -lurøy.no -luster.no -lyngdal.no -lyngen.no -ivgu.no -lardal.no -lerdal.no -lærdal.no -lodingen.no -lødingen.no -lorenskog.no -lørenskog.no -loten.no -løten.no -malvik.no -masoy.no -måsøy.no -muosat.no -muosát.no -mandal.no -marker.no -marnardal.no -masfjorden.no -meland.no -meldal.no -melhus.no -meloy.no -meløy.no -meraker.no -meråker.no -moareke.no -moåreke.no -midsund.no -midtre-gauldal.no -modalen.no -modum.no -molde.no -moskenes.no -moss.no -mosvik.no -malselv.no -målselv.no -malatvuopmi.no -málatvuopmi.no -namdalseid.no -aejrie.no -namsos.no -namsskogan.no -naamesjevuemie.no -nååmesjevuemie.no -laakesvuemie.no -nannestad.no -narvik.no -narviika.no -naustdal.no -nedre-eiker.no -nes.akershus.no -nes.buskerud.no -nesna.no -nesodden.no -nesseby.no -unjarga.no -unjárga.no -nesset.no -nissedal.no -nittedal.no -nord-aurdal.no -nord-fron.no -nord-odal.no -norddal.no -nordkapp.no -davvenjarga.no -davvenjárga.no -nordre-land.no -nordreisa.no -raisa.no -ráisa.no -nore-og-uvdal.no -notodden.no -naroy.no -nærøy.no -notteroy.no -nøtterøy.no -odda.no -oksnes.no -øksnes.no -oppdal.no -oppegard.no -oppegård.no -orkdal.no -orland.no -ørland.no -orskog.no -ørskog.no -orsta.no -ørsta.no -os.hedmark.no -os.hordaland.no -osen.no -osteroy.no -osterøy.no -ostre-toten.no -østre-toten.no -overhalla.no -ovre-eiker.no -øvre-eiker.no -oyer.no -øyer.no -oygarden.no -øygarden.no -oystre-slidre.no -øystre-slidre.no -porsanger.no -porsangu.no -porsáŋgu.no -porsgrunn.no -radoy.no -radøy.no -rakkestad.no -rana.no -ruovat.no -randaberg.no -rauma.no -rendalen.no -rennebu.no -rennesoy.no -rennesøy.no -rindal.no -ringebu.no -ringerike.no -ringsaker.no -rissa.no -risor.no -risør.no -roan.no -rollag.no -rygge.no -ralingen.no -rælingen.no -rodoy.no -rødøy.no -romskog.no -rømskog.no -roros.no -røros.no -rost.no -røst.no -royken.no -røyken.no -royrvik.no -røyrvik.no -rade.no -råde.no -salangen.no -siellak.no -saltdal.no -salat.no -sálát.no -sálat.no -samnanger.no -sande.more-og-romsdal.no -sande.møre-og-romsdal.no -sande.vestfold.no -sandefjord.no -sandnes.no -sandoy.no -sandøy.no -sarpsborg.no -sauda.no -sauherad.no -sel.no -selbu.no -selje.no -seljord.no -sigdal.no -siljan.no -sirdal.no -skaun.no -skedsmo.no -ski.no -skien.no -skiptvet.no -skjervoy.no -skjervøy.no -skierva.no -skiervá.no -skjak.no -skjåk.no -skodje.no -skanland.no -skånland.no -skanit.no -skánit.no -smola.no -smøla.no -snillfjord.no -snasa.no -snåsa.no -snoasa.no -snaase.no -snåase.no -sogndal.no -sokndal.no -sola.no -solund.no -songdalen.no -sortland.no -spydeberg.no -stange.no -stavanger.no -steigen.no -steinkjer.no -stjordal.no -stjørdal.no -stokke.no -stor-elvdal.no -stord.no -stordal.no -storfjord.no -omasvuotna.no -strand.no -stranda.no -stryn.no -sula.no -suldal.no -sund.no -sunndal.no -surnadal.no -sveio.no -svelvik.no -sykkylven.no -sogne.no -søgne.no -somna.no -sømna.no -sondre-land.no -søndre-land.no -sor-aurdal.no -sør-aurdal.no -sor-fron.no -sør-fron.no -sor-odal.no -sør-odal.no -sor-varanger.no -sør-varanger.no -matta-varjjat.no -mátta-várjjat.no -sorfold.no -sørfold.no -sorreisa.no -sørreisa.no -sorum.no -sørum.no -tana.no -deatnu.no -time.no -tingvoll.no -tinn.no -tjeldsund.no -dielddanuorri.no -tjome.no -tjøme.no -tokke.no -tolga.no -torsken.no -tranoy.no -tranøy.no -tromso.no -tromsø.no -tromsa.no -romsa.no -trondheim.no -troandin.no -trysil.no -trana.no -træna.no -trogstad.no -trøgstad.no -tvedestrand.no -tydal.no -tynset.no -tysfjord.no -divtasvuodna.no -divttasvuotna.no -tysnes.no -tysvar.no -tysvær.no -tonsberg.no -tønsberg.no -ullensaker.no -ullensvang.no -ulvik.no -utsira.no -vadso.no -vadsø.no -cahcesuolo.no -čáhcesuolo.no -vaksdal.no -valle.no -vang.no -vanylven.no -vardo.no -vardø.no -varggat.no -várggát.no -vefsn.no -vaapste.no -vega.no -vegarshei.no -vegårshei.no -vennesla.no -verdal.no -verran.no -vestby.no -vestnes.no -vestre-slidre.no -vestre-toten.no -vestvagoy.no -vestvågøy.no -vevelstad.no -vik.no -vikna.no -vindafjord.no -volda.no -voss.no -varoy.no -værøy.no -vagan.no -vågan.no -voagat.no -vagsoy.no -vågsøy.no -vaga.no -vågå.no -valer.ostfold.no -våler.østfold.no -valer.hedmark.no -våler.hedmark.no - -// np : http://www.mos.com.np/register.html -*.np - -// nr : http://cenpac.net.nr/dns/index.html -// Confirmed by registry 2008-06-17 -nr -biz.nr -info.nr -gov.nr -edu.nr -org.nr -net.nr -com.nr - -// nu : http://en.wikipedia.org/wiki/.nu -nu - -// nz : http://en.wikipedia.org/wiki/.nz -// Confirmed by registry 2014-05-19 -nz -ac.nz -co.nz -cri.nz -geek.nz -gen.nz -govt.nz -health.nz -iwi.nz -kiwi.nz -maori.nz -mil.nz -māori.nz -net.nz -org.nz -parliament.nz -school.nz - -// om : http://en.wikipedia.org/wiki/.om -om -co.om -com.om -edu.om -gov.om -med.om -museum.om -net.om -org.om -pro.om - -// org : http://en.wikipedia.org/wiki/.org -org - -// pa : http://www.nic.pa/ -// Some additional second level "domains" resolve directly as hostnames, such as -// pannet.pa, so we add a rule for "pa". -pa -ac.pa -gob.pa -com.pa -org.pa -sld.pa -edu.pa -net.pa -ing.pa -abo.pa -med.pa -nom.pa - -// pe : https://www.nic.pe/InformeFinalComision.pdf -pe -edu.pe -gob.pe -nom.pe -mil.pe -org.pe -com.pe -net.pe - -// pf : http://www.gobin.info/domainname/formulaire-pf.pdf -pf -com.pf -org.pf -edu.pf - -// pg : http://en.wikipedia.org/wiki/.pg -*.pg - -// ph : http://www.domains.ph/FAQ2.asp -// Submitted by registry 2008-06-13 -ph -com.ph -net.ph -org.ph -gov.ph -edu.ph -ngo.ph -mil.ph -i.ph - -// pk : http://pk5.pknic.net.pk/pk5/msgNamepk.PK -pk -com.pk -net.pk -edu.pk -org.pk -fam.pk -biz.pk -web.pk -gov.pk -gob.pk -gok.pk -gon.pk -gop.pk -gos.pk -info.pk - -// pl http://www.dns.pl/english/index.html -// updated by .PL registry on 2015-04-28 -pl -com.pl -net.pl -org.pl -// pl functional domains (http://www.dns.pl/english/index.html) -aid.pl -agro.pl -atm.pl -auto.pl -biz.pl -edu.pl -gmina.pl -gsm.pl -info.pl -mail.pl -miasta.pl -media.pl -mil.pl -nieruchomosci.pl -nom.pl -pc.pl -powiat.pl -priv.pl -realestate.pl -rel.pl -sex.pl -shop.pl -sklep.pl -sos.pl -szkola.pl -targi.pl -tm.pl -tourism.pl -travel.pl -turystyka.pl -// Government domains -gov.pl -ap.gov.pl -ic.gov.pl -is.gov.pl -us.gov.pl -kmpsp.gov.pl -kppsp.gov.pl -kwpsp.gov.pl -psp.gov.pl -wskr.gov.pl -kwp.gov.pl -mw.gov.pl -ug.gov.pl -um.gov.pl -umig.gov.pl -ugim.gov.pl -upow.gov.pl -uw.gov.pl -starostwo.gov.pl -pa.gov.pl -po.gov.pl -psse.gov.pl -pup.gov.pl -rzgw.gov.pl -sa.gov.pl -so.gov.pl -sr.gov.pl -wsa.gov.pl -sko.gov.pl -uzs.gov.pl -wiih.gov.pl -winb.gov.pl -pinb.gov.pl -wios.gov.pl -witd.gov.pl -wzmiuw.gov.pl -piw.gov.pl -wiw.gov.pl -griw.gov.pl -wif.gov.pl -oum.gov.pl -sdn.gov.pl -zp.gov.pl -uppo.gov.pl -mup.gov.pl -wuoz.gov.pl -konsulat.gov.pl -oirm.gov.pl -// pl regional domains (http://www.dns.pl/english/index.html) -augustow.pl -babia-gora.pl -bedzin.pl -beskidy.pl -bialowieza.pl -bialystok.pl -bielawa.pl -bieszczady.pl -boleslawiec.pl -bydgoszcz.pl -bytom.pl -cieszyn.pl -czeladz.pl -czest.pl -dlugoleka.pl -elblag.pl -elk.pl -glogow.pl -gniezno.pl -gorlice.pl -grajewo.pl -ilawa.pl -jaworzno.pl -jelenia-gora.pl -jgora.pl -kalisz.pl -kazimierz-dolny.pl -karpacz.pl -kartuzy.pl -kaszuby.pl -katowice.pl -kepno.pl -ketrzyn.pl -klodzko.pl -kobierzyce.pl -kolobrzeg.pl -konin.pl -konskowola.pl -kutno.pl -lapy.pl -lebork.pl -legnica.pl -lezajsk.pl -limanowa.pl -lomza.pl -lowicz.pl -lubin.pl -lukow.pl -malbork.pl -malopolska.pl -mazowsze.pl -mazury.pl -mielec.pl -mielno.pl -mragowo.pl -naklo.pl -nowaruda.pl -nysa.pl -olawa.pl -olecko.pl -olkusz.pl -olsztyn.pl -opoczno.pl -opole.pl -ostroda.pl -ostroleka.pl -ostrowiec.pl -ostrowwlkp.pl -pila.pl -pisz.pl -podhale.pl -podlasie.pl -polkowice.pl -pomorze.pl -pomorskie.pl -prochowice.pl -pruszkow.pl -przeworsk.pl -pulawy.pl -radom.pl -rawa-maz.pl -rybnik.pl -rzeszow.pl -sanok.pl -sejny.pl -slask.pl -slupsk.pl -sosnowiec.pl -stalowa-wola.pl -skoczow.pl -starachowice.pl -stargard.pl -suwalki.pl -swidnica.pl -swiebodzin.pl -swinoujscie.pl -szczecin.pl -szczytno.pl -tarnobrzeg.pl -tgory.pl -turek.pl -tychy.pl -ustka.pl -walbrzych.pl -warmia.pl -warszawa.pl -waw.pl -wegrow.pl -wielun.pl -wlocl.pl -wloclawek.pl -wodzislaw.pl -wolomin.pl -wroclaw.pl -zachpomor.pl -zagan.pl -zarow.pl -zgora.pl -zgorzelec.pl - -// pm : http://www.afnic.fr/medias/documents/AFNIC-naming-policy2012.pdf -pm - -// pn : http://www.government.pn/PnRegistry/policies.htm -pn -gov.pn -co.pn -org.pn -edu.pn -net.pn - -// post : http://en.wikipedia.org/wiki/.post -post - -// pr : http://www.nic.pr/index.asp?f=1 -pr -com.pr -net.pr -org.pr -gov.pr -edu.pr -isla.pr -pro.pr -biz.pr -info.pr -name.pr -// these aren't mentioned on nic.pr, but on http://en.wikipedia.org/wiki/.pr -est.pr -prof.pr -ac.pr - -// pro : http://www.nic.pro/support_faq.htm -pro -aca.pro -bar.pro -cpa.pro -jur.pro -law.pro -med.pro -eng.pro - -// ps : http://en.wikipedia.org/wiki/.ps -// http://www.nic.ps/registration/policy.html#reg -ps -edu.ps -gov.ps -sec.ps -plo.ps -com.ps -org.ps -net.ps - -// pt : http://online.dns.pt/dns/start_dns -pt -net.pt -gov.pt -org.pt -edu.pt -int.pt -publ.pt -com.pt -nome.pt - -// pw : http://en.wikipedia.org/wiki/.pw -pw -co.pw -ne.pw -or.pw -ed.pw -go.pw -belau.pw - -// py : http://www.nic.py/pautas.html#seccion_9 -// Confirmed by registry 2012-10-03 -py -com.py -coop.py -edu.py -gov.py -mil.py -net.py -org.py - -// qa : http://domains.qa/en/ -qa -com.qa -edu.qa -gov.qa -mil.qa -name.qa -net.qa -org.qa -sch.qa - -// re : http://www.afnic.re/obtenir/chartes/nommage-re/annexe-descriptifs -re -com.re -asso.re -nom.re - -// ro : http://www.rotld.ro/ -ro -com.ro -org.ro -tm.ro -nt.ro -nom.ro -info.ro -rec.ro -arts.ro -firm.ro -store.ro -www.ro - -// rs : http://en.wikipedia.org/wiki/.rs -rs -co.rs -org.rs -edu.rs -ac.rs -gov.rs -in.rs - -// ru : http://www.cctld.ru/ru/docs/aktiv_8.php -// Industry domains -ru -ac.ru -com.ru -edu.ru -int.ru -net.ru -org.ru -pp.ru -// Geographical domains -adygeya.ru -altai.ru -amur.ru -arkhangelsk.ru -astrakhan.ru -bashkiria.ru -belgorod.ru -bir.ru -bryansk.ru -buryatia.ru -cbg.ru -chel.ru -chelyabinsk.ru -chita.ru -chukotka.ru -chuvashia.ru -dagestan.ru -dudinka.ru -e-burg.ru -grozny.ru -irkutsk.ru -ivanovo.ru -izhevsk.ru -jar.ru -joshkar-ola.ru -kalmykia.ru -kaluga.ru -kamchatka.ru -karelia.ru -kazan.ru -kchr.ru -kemerovo.ru -khabarovsk.ru -khakassia.ru -khv.ru -kirov.ru -koenig.ru -komi.ru -kostroma.ru -krasnoyarsk.ru -kuban.ru -kurgan.ru -kursk.ru -lipetsk.ru -magadan.ru -mari.ru -mari-el.ru -marine.ru -mordovia.ru -// mosreg.ru Bug 1090800 - removed at request of Aleksey Konstantinov -msk.ru -murmansk.ru -nalchik.ru -nnov.ru -nov.ru -novosibirsk.ru -nsk.ru -omsk.ru -orenburg.ru -oryol.ru -palana.ru -penza.ru -perm.ru -ptz.ru -rnd.ru -ryazan.ru -sakhalin.ru -samara.ru -saratov.ru -simbirsk.ru -smolensk.ru -spb.ru -stavropol.ru -stv.ru -surgut.ru -tambov.ru -tatarstan.ru -tom.ru -tomsk.ru -tsaritsyn.ru -tsk.ru -tula.ru -tuva.ru -tver.ru -tyumen.ru -udm.ru -udmurtia.ru -ulan-ude.ru -vladikavkaz.ru -vladimir.ru -vladivostok.ru -volgograd.ru -vologda.ru -voronezh.ru -vrn.ru -vyatka.ru -yakutia.ru -yamal.ru -yaroslavl.ru -yekaterinburg.ru -yuzhno-sakhalinsk.ru -// More geographical domains -amursk.ru -baikal.ru -cmw.ru -fareast.ru -jamal.ru -kms.ru -k-uralsk.ru -kustanai.ru -kuzbass.ru -magnitka.ru -mytis.ru -nakhodka.ru -nkz.ru -norilsk.ru -oskol.ru -pyatigorsk.ru -rubtsovsk.ru -snz.ru -syzran.ru -vdonsk.ru -zgrad.ru -// State domains -gov.ru -mil.ru -// Technical domains -test.ru - -// rw : http://www.nic.rw/cgi-bin/policy.pl -rw -gov.rw -net.rw -edu.rw -ac.rw -com.rw -co.rw -int.rw -mil.rw -gouv.rw - -// sa : http://www.nic.net.sa/ -sa -com.sa -net.sa -org.sa -gov.sa -med.sa -pub.sa -edu.sa -sch.sa - -// sb : http://www.sbnic.net.sb/ -// Submitted by registry 2008-06-08 -sb -com.sb -edu.sb -gov.sb -net.sb -org.sb - -// sc : http://www.nic.sc/ -sc -com.sc -gov.sc -net.sc -org.sc -edu.sc - -// sd : http://www.isoc.sd/sudanic.isoc.sd/billing_pricing.htm -// Submitted by registry 2008-06-17 -sd -com.sd -net.sd -org.sd -edu.sd -med.sd -tv.sd -gov.sd -info.sd - -// se : http://en.wikipedia.org/wiki/.se -// Submitted by registry 2014-03-18 -se -a.se -ac.se -b.se -bd.se -brand.se -c.se -d.se -e.se -f.se -fh.se -fhsk.se -fhv.se -g.se -h.se -i.se -k.se -komforb.se -kommunalforbund.se -komvux.se -l.se -lanbib.se -m.se -n.se -naturbruksgymn.se -o.se -org.se -p.se -parti.se -pp.se -press.se -r.se -s.se -t.se -tm.se -u.se -w.se -x.se -y.se -z.se - -// sg : http://www.nic.net.sg/page/registration-policies-procedures-and-guidelines -sg -com.sg -net.sg -org.sg -gov.sg -edu.sg -per.sg - -// sh : http://www.nic.sh/registrar.html -sh -com.sh -net.sh -gov.sh -org.sh -mil.sh - -// si : http://en.wikipedia.org/wiki/.si -si - -// sj : No registrations at this time. -// Submitted by registry 2008-06-16 -sj - -// sk : http://en.wikipedia.org/wiki/.sk -// list of 2nd level domains ? -sk - -// sl : http://www.nic.sl -// Submitted by registry 2008-06-12 -sl -com.sl -net.sl -edu.sl -gov.sl -org.sl - -// sm : http://en.wikipedia.org/wiki/.sm -sm - -// sn : http://en.wikipedia.org/wiki/.sn -sn -art.sn -com.sn -edu.sn -gouv.sn -org.sn -perso.sn -univ.sn - -// so : http://www.soregistry.com/ -so -com.so -net.so -org.so - -// sr : http://en.wikipedia.org/wiki/.sr -sr - -// st : http://www.nic.st/html/policyrules/ -st -co.st -com.st -consulado.st -edu.st -embaixada.st -gov.st -mil.st -net.st -org.st -principe.st -saotome.st -store.st - -// su : http://en.wikipedia.org/wiki/.su -su -adygeya.su -arkhangelsk.su -balashov.su -bashkiria.su -bryansk.su -dagestan.su -grozny.su -ivanovo.su -kalmykia.su -kaluga.su -karelia.su -khakassia.su -krasnodar.su -kurgan.su -lenug.su -mordovia.su -msk.su -murmansk.su -nalchik.su -nov.su -obninsk.su -penza.su -pokrovsk.su -sochi.su -spb.su -togliatti.su -troitsk.su -tula.su -tuva.su -vladikavkaz.su -vladimir.su -vologda.su - -// sv : http://www.svnet.org.sv/niveldos.pdf -sv -com.sv -edu.sv -gob.sv -org.sv -red.sv - -// sx : http://en.wikipedia.org/wiki/.sx -// Confirmed by registry 2012-05-31 -sx -gov.sx - -// sy : http://en.wikipedia.org/wiki/.sy -// see also: http://www.gobin.info/domainname/sy.doc -sy -edu.sy -gov.sy -net.sy -mil.sy -com.sy -org.sy - -// sz : http://en.wikipedia.org/wiki/.sz -// http://www.sispa.org.sz/ -sz -co.sz -ac.sz -org.sz - -// tc : http://en.wikipedia.org/wiki/.tc -tc - -// td : http://en.wikipedia.org/wiki/.td -td - -// tel: http://en.wikipedia.org/wiki/.tel -// http://www.telnic.org/ -tel - -// tf : http://en.wikipedia.org/wiki/.tf -tf - -// tg : http://en.wikipedia.org/wiki/.tg -// http://www.nic.tg/ -tg - -// th : http://en.wikipedia.org/wiki/.th -// Submitted by registry 2008-06-17 -th -ac.th -co.th -go.th -in.th -mi.th -net.th -or.th - -// tj : http://www.nic.tj/policy.html -tj -ac.tj -biz.tj -co.tj -com.tj -edu.tj -go.tj -gov.tj -int.tj -mil.tj -name.tj -net.tj -nic.tj -org.tj -test.tj -web.tj - -// tk : http://en.wikipedia.org/wiki/.tk -tk - -// tl : http://en.wikipedia.org/wiki/.tl -tl -gov.tl - -// tm : http://www.nic.tm/local.html -tm -com.tm -co.tm -org.tm -net.tm -nom.tm -gov.tm -mil.tm -edu.tm - -// tn : http://en.wikipedia.org/wiki/.tn -// http://whois.ati.tn/ -tn -com.tn -ens.tn -fin.tn -gov.tn -ind.tn -intl.tn -nat.tn -net.tn -org.tn -info.tn -perso.tn -tourism.tn -edunet.tn -rnrt.tn -rns.tn -rnu.tn -mincom.tn -agrinet.tn -defense.tn -turen.tn - -// to : http://en.wikipedia.org/wiki/.to -// Submitted by registry 2008-06-17 -to -com.to -gov.to -net.to -org.to -edu.to -mil.to - -// tp : No registrations at this time. -// Submitted by Ryan Sleevi 2014-01-03 -tp - -// subTLDs: https://www.nic.tr/forms/eng/policies.pdf -// and: https://www.nic.tr/forms/politikalar.pdf -// Submitted by 2014-07-19 -tr -com.tr -info.tr -biz.tr -net.tr -org.tr -web.tr -gen.tr -tv.tr -av.tr -dr.tr -bbs.tr -name.tr -tel.tr -gov.tr -bel.tr -pol.tr -mil.tr -k12.tr -edu.tr -kep.tr - -// Used by Northern Cyprus -nc.tr - -// Used by government agencies of Northern Cyprus -gov.nc.tr - -// travel : http://en.wikipedia.org/wiki/.travel -travel - -// tt : http://www.nic.tt/ -tt -co.tt -com.tt -org.tt -net.tt -biz.tt -info.tt -pro.tt -int.tt -coop.tt -jobs.tt -mobi.tt -travel.tt -museum.tt -aero.tt -name.tt -gov.tt -edu.tt - -// tv : http://en.wikipedia.org/wiki/.tv -// Not listing any 2LDs as reserved since none seem to exist in practice, -// Wikipedia notwithstanding. -tv - -// tw : http://en.wikipedia.org/wiki/.tw -tw -edu.tw -gov.tw -mil.tw -com.tw -net.tw -org.tw -idv.tw -game.tw -ebiz.tw -club.tw -網路.tw -組織.tw -商業.tw - -// tz : http://www.tznic.or.tz/index.php/domains -// Confirmed by registry 2013-01-22 -tz -ac.tz -co.tz -go.tz -hotel.tz -info.tz -me.tz -mil.tz -mobi.tz -ne.tz -or.tz -sc.tz -tv.tz - -// ua : https://hostmaster.ua/policy/?ua -// Submitted by registry 2012-04-27 -ua -// ua 2LD -com.ua -edu.ua -gov.ua -in.ua -net.ua -org.ua -// ua geographic names -// https://hostmaster.ua/2ld/ -cherkassy.ua -cherkasy.ua -chernigov.ua -chernihiv.ua -chernivtsi.ua -chernovtsy.ua -ck.ua -cn.ua -cr.ua -crimea.ua -cv.ua -dn.ua -dnepropetrovsk.ua -dnipropetrovsk.ua -dominic.ua -donetsk.ua -dp.ua -if.ua -ivano-frankivsk.ua -kh.ua -kharkiv.ua -kharkov.ua -kherson.ua -khmelnitskiy.ua -khmelnytskyi.ua -kiev.ua -kirovograd.ua -km.ua -kr.ua -krym.ua -ks.ua -kv.ua -kyiv.ua -lg.ua -lt.ua -lugansk.ua -lutsk.ua -lv.ua -lviv.ua -mk.ua -mykolaiv.ua -nikolaev.ua -od.ua -odesa.ua -odessa.ua -pl.ua -poltava.ua -rivne.ua -rovno.ua -rv.ua -sb.ua -sebastopol.ua -sevastopol.ua -sm.ua -sumy.ua -te.ua -ternopil.ua -uz.ua -uzhgorod.ua -vinnica.ua -vinnytsia.ua -vn.ua -volyn.ua -yalta.ua -zaporizhzhe.ua -zaporizhzhia.ua -zhitomir.ua -zhytomyr.ua -zp.ua -zt.ua - -// Private registries in .ua -co.ua -pp.ua - -// ug : https://www.registry.co.ug/ -ug -co.ug -or.ug -ac.ug -sc.ug -go.ug -ne.ug -com.ug -org.ug - -// uk : http://en.wikipedia.org/wiki/.uk -// Submitted by registry -uk -ac.uk -co.uk -gov.uk -ltd.uk -me.uk -net.uk -nhs.uk -org.uk -plc.uk -police.uk -*.sch.uk - -// us : http://en.wikipedia.org/wiki/.us -us -dni.us -fed.us -isa.us -kids.us -nsn.us -// us geographic names -ak.us -al.us -ar.us -as.us -az.us -ca.us -co.us -ct.us -dc.us -de.us -fl.us -ga.us -gu.us -hi.us -ia.us -id.us -il.us -in.us -ks.us -ky.us -la.us -ma.us -md.us -me.us -mi.us -mn.us -mo.us -ms.us -mt.us -nc.us -nd.us -ne.us -nh.us -nj.us -nm.us -nv.us -ny.us -oh.us -ok.us -or.us -pa.us -pr.us -ri.us -sc.us -sd.us -tn.us -tx.us -ut.us -vi.us -vt.us -va.us -wa.us -wi.us -wv.us -wy.us -// The registrar notes several more specific domains available in each state, -// such as state.*.us, dst.*.us, etc., but resolution of these is somewhat -// haphazard; in some states these domains resolve as addresses, while in others -// only subdomains are available, or even nothing at all. We include the -// most common ones where it's clear that different sites are different -// entities. -k12.ak.us -k12.al.us -k12.ar.us -k12.as.us -k12.az.us -k12.ca.us -k12.co.us -k12.ct.us -k12.dc.us -k12.de.us -k12.fl.us -k12.ga.us -k12.gu.us -// k12.hi.us Bug 614565 - Hawaii has a state-wide DOE login -k12.ia.us -k12.id.us -k12.il.us -k12.in.us -k12.ks.us -k12.ky.us -k12.la.us -k12.ma.us -k12.md.us -k12.me.us -k12.mi.us -k12.mn.us -k12.mo.us -k12.ms.us -k12.mt.us -k12.nc.us -// k12.nd.us Bug 1028347 - Removed at request of Travis Rosso -k12.ne.us -k12.nh.us -k12.nj.us -k12.nm.us -k12.nv.us -k12.ny.us -k12.oh.us -k12.ok.us -k12.or.us -k12.pa.us -k12.pr.us -k12.ri.us -k12.sc.us -// k12.sd.us Bug 934131 - Removed at request of James Booze -k12.tn.us -k12.tx.us -k12.ut.us -k12.vi.us -k12.vt.us -k12.va.us -k12.wa.us -k12.wi.us -// k12.wv.us Bug 947705 - Removed at request of Verne Britton -k12.wy.us -cc.ak.us -cc.al.us -cc.ar.us -cc.as.us -cc.az.us -cc.ca.us -cc.co.us -cc.ct.us -cc.dc.us -cc.de.us -cc.fl.us -cc.ga.us -cc.gu.us -cc.hi.us -cc.ia.us -cc.id.us -cc.il.us -cc.in.us -cc.ks.us -cc.ky.us -cc.la.us -cc.ma.us -cc.md.us -cc.me.us -cc.mi.us -cc.mn.us -cc.mo.us -cc.ms.us -cc.mt.us -cc.nc.us -cc.nd.us -cc.ne.us -cc.nh.us -cc.nj.us -cc.nm.us -cc.nv.us -cc.ny.us -cc.oh.us -cc.ok.us -cc.or.us -cc.pa.us -cc.pr.us -cc.ri.us -cc.sc.us -cc.sd.us -cc.tn.us -cc.tx.us -cc.ut.us -cc.vi.us -cc.vt.us -cc.va.us -cc.wa.us -cc.wi.us -cc.wv.us -cc.wy.us -lib.ak.us -lib.al.us -lib.ar.us -lib.as.us -lib.az.us -lib.ca.us -lib.co.us -lib.ct.us -lib.dc.us -lib.de.us -lib.fl.us -lib.ga.us -lib.gu.us -lib.hi.us -lib.ia.us -lib.id.us -lib.il.us -lib.in.us -lib.ks.us -lib.ky.us -lib.la.us -lib.ma.us -lib.md.us -lib.me.us -lib.mi.us -lib.mn.us -lib.mo.us -lib.ms.us -lib.mt.us -lib.nc.us -lib.nd.us -lib.ne.us -lib.nh.us -lib.nj.us -lib.nm.us -lib.nv.us -lib.ny.us -lib.oh.us -lib.ok.us -lib.or.us -lib.pa.us -lib.pr.us -lib.ri.us -lib.sc.us -lib.sd.us -lib.tn.us -lib.tx.us -lib.ut.us -lib.vi.us -lib.vt.us -lib.va.us -lib.wa.us -lib.wi.us -// lib.wv.us Bug 941670 - Removed at request of Larry W Arnold -lib.wy.us -// k12.ma.us contains school districts in Massachusetts. The 4LDs are -// managed indepedently except for private (PVT), charter (CHTR) and -// parochial (PAROCH) schools. Those are delegated dorectly to the -// 5LD operators. -pvt.k12.ma.us -chtr.k12.ma.us -paroch.k12.ma.us - -// uy : http://www.nic.org.uy/ -uy -com.uy -edu.uy -gub.uy -mil.uy -net.uy -org.uy - -// uz : http://www.reg.uz/ -uz -co.uz -com.uz -net.uz -org.uz - -// va : http://en.wikipedia.org/wiki/.va -va - -// vc : http://en.wikipedia.org/wiki/.vc -// Submitted by registry 2008-06-13 -vc -com.vc -net.vc -org.vc -gov.vc -mil.vc -edu.vc - -// ve : https://registro.nic.ve/ -// Confirmed by registry 2012-10-04 -// Updated 2014-05-20 - Bug 940478 -ve -arts.ve -co.ve -com.ve -e12.ve -edu.ve -firm.ve -gob.ve -gov.ve -info.ve -int.ve -mil.ve -net.ve -org.ve -rec.ve -store.ve -tec.ve -web.ve - -// vg : http://en.wikipedia.org/wiki/.vg -vg - -// vi : http://www.nic.vi/newdomainform.htm -// http://www.nic.vi/Domain_Rules/body_domain_rules.html indicates some other -// TLDs are "reserved", such as edu.vi and gov.vi, but doesn't actually say they -// are available for registration (which they do not seem to be). -vi -co.vi -com.vi -k12.vi -net.vi -org.vi - -// vn : https://www.dot.vn/vnnic/vnnic/domainregistration.jsp -vn -com.vn -net.vn -org.vn -edu.vn -gov.vn -int.vn -ac.vn -biz.vn -info.vn -name.vn -pro.vn -health.vn - -// vu : http://en.wikipedia.org/wiki/.vu -// http://www.vunic.vu/ -vu -com.vu -edu.vu -net.vu -org.vu - -// wf : http://www.afnic.fr/medias/documents/AFNIC-naming-policy2012.pdf -wf - -// ws : http://en.wikipedia.org/wiki/.ws -// http://samoanic.ws/index.dhtml -ws -com.ws -net.ws -org.ws -gov.ws -edu.ws - -// yt : http://www.afnic.fr/medias/documents/AFNIC-naming-policy2012.pdf -yt - -// IDN ccTLDs -// When submitting patches, please maintain a sort by ISO 3166 ccTLD, then -// U-label, and follow this format: -// // A-Label ("", [, variant info]) : -// // [sponsoring org] -// U-Label - -// xn--mgbaam7a8h ("Emerat", Arabic) : AE -// http://nic.ae/english/arabicdomain/rules.jsp -امارات - -// xn--y9a3aq ("hye", Armenian) : AM -// ISOC AM (operated by .am Registry) -հայ - -// xn--54b7fta0cc ("Bangla", Bangla) : BD -বাংলা - -// xn--90ais ("bel", Belarusian/Russian Cyrillic) : BY -// Operated by .by registry -бел - -// xn--fiqs8s ("Zhongguo/China", Chinese, Simplified) : CN -// CNNIC -// http://cnnic.cn/html/Dir/2005/10/11/3218.htm -中国 - -// xn--fiqz9s ("Zhongguo/China", Chinese, Traditional) : CN -// CNNIC -// http://cnnic.cn/html/Dir/2005/10/11/3218.htm -中國 - -// xn--lgbbat1ad8j ("Algeria/Al Jazair", Arabic) : DZ -الجزائر - -// xn--wgbh1c ("Egypt/Masr", Arabic) : EG -// http://www.dotmasr.eg/ -مصر - -// xn--node ("ge", Georgian Mkhedruli) : GE -გე - -// xn--qxam ("el", Greek) : GR -// Hellenic Ministry of Infrastructure, Transport, and Networks -ελ - -// xn--j6w193g ("Hong Kong", Chinese) : HK -// https://www2.hkirc.hk/register/rules.jsp -香港 - -// xn--h2brj9c ("Bharat", Devanagari) : IN -// India -भारत - -// xn--mgbbh1a71e ("Bharat", Arabic) : IN -// India -بھارت - -// xn--fpcrj9c3d ("Bharat", Telugu) : IN -// India -భారత్ - -// xn--gecrj9c ("Bharat", Gujarati) : IN -// India -ભારત - -// xn--s9brj9c ("Bharat", Gurmukhi) : IN -// India -ਭਾਰਤ - -// xn--45brj9c ("Bharat", Bengali) : IN -// India -ভারত - -// xn--xkc2dl3a5ee0h ("India", Tamil) : IN -// India -இந்தியா - -// xn--mgba3a4f16a ("Iran", Persian) : IR -ایران - -// xn--mgba3a4fra ("Iran", Arabic) : IR -ايران - -// xn--mgbtx2b ("Iraq", Arabic) : IQ -// Communications and Media Commission -عراق - -// xn--mgbayh7gpa ("al-Ordon", Arabic) : JO -// National Information Technology Center (NITC) -// Royal Scientific Society, Al-Jubeiha -الاردن - -// xn--3e0b707e ("Republic of Korea", Hangul) : KR -한국 - -// xn--80ao21a ("Kaz", Kazakh) : KZ -қаз - -// xn--fzc2c9e2c ("Lanka", Sinhalese-Sinhala) : LK -// http://nic.lk -ලංකා - -// xn--xkc2al3hye2a ("Ilangai", Tamil) : LK -// http://nic.lk -இலங்கை - -// xn--mgbc0a9azcg ("Morocco/al-Maghrib", Arabic) : MA -المغرب - -// xn--d1alf ("mkd", Macedonian) : MK -// MARnet -мкд - -// xn--l1acc ("mon", Mongolian) : MN -мон - -// xn--mix891f ("Macao", Chinese, Traditional) : MO -// MONIC / HNET Asia (Registry Operator for .mo) -澳門 - -// xn--mix082f ("Macao", Chinese, Simplified) : MO -澳门 - -// xn--mgbx4cd0ab ("Malaysia", Malay) : MY -مليسيا - -// xn--mgb9awbf ("Oman", Arabic) : OM -عمان - -// xn--mgbai9azgqp6j ("Pakistan", Urdu/Arabic) : PK -پاکستان - -// xn--mgbai9a5eva00b ("Pakistan", Urdu/Arabic, variant) : PK -پاكستان - -// xn--ygbi2ammx ("Falasteen", Arabic) : PS -// The Palestinian National Internet Naming Authority (PNINA) -// http://www.pnina.ps -فلسطين - -// xn--90a3ac ("srb", Cyrillic) : RS -// http://www.rnids.rs/en/the-.срб-domain -срб -пр.срб -орг.срб -обр.срб -од.срб -упр.срб -ак.срб - -// xn--p1ai ("rf", Russian-Cyrillic) : RU -// http://www.cctld.ru/en/docs/rulesrf.php -рф - -// xn--wgbl6a ("Qatar", Arabic) : QA -// http://www.ict.gov.qa/ -قطر - -// xn--mgberp4a5d4ar ("AlSaudiah", Arabic) : SA -// http://www.nic.net.sa/ -السعودية - -// xn--mgberp4a5d4a87g ("AlSaudiah", Arabic, variant) : SA -السعودیة - -// xn--mgbqly7c0a67fbc ("AlSaudiah", Arabic, variant) : SA -السعودیۃ - -// xn--mgbqly7cvafr ("AlSaudiah", Arabic, variant) : SA -السعوديه - -// xn--mgbpl2fh ("sudan", Arabic) : SD -// Operated by .sd registry -سودان - -// xn--yfro4i67o Singapore ("Singapore", Chinese) : SG -新加坡 - -// xn--clchc0ea0b2g2a9gcd ("Singapore", Tamil) : SG -சிங்கப்பூர் - -// xn--ogbpf8fl ("Syria", Arabic) : SY -سورية - -// xn--mgbtf8fl ("Syria", Arabic, variant) : SY -سوريا - -// xn--o3cw4h ("Thai", Thai) : TH -// http://www.thnic.co.th -ไทย - -// xn--pgbs0dh ("Tunisia", Arabic) : TN -// http://nic.tn -تونس - -// xn--kpry57d ("Taiwan", Chinese, Traditional) : TW -// http://www.twnic.net/english/dn/dn_07a.htm -台灣 - -// xn--kprw13d ("Taiwan", Chinese, Simplified) : TW -// http://www.twnic.net/english/dn/dn_07a.htm -台湾 - -// xn--nnx388a ("Taiwan", Chinese, variant) : TW -臺灣 - -// xn--j1amh ("ukr", Cyrillic) : UA -укр - -// xn--mgb2ddes ("AlYemen", Arabic) : YE -اليمن - -// xxx : http://icmregistry.com -xxx - -// ye : http://www.y.net.ye/services/domain_name.htm -*.ye - -// za : http://www.zadna.org.za/slds.html -*.za - -// zm : http://en.wikipedia.org/wiki/.zm -*.zm - -// zw : http://en.wikipedia.org/wiki/.zw -*.zw - - -// List of new gTLDs imported from https://newgtlds.icann.org/newgtlds.csv on 2015-05-06T09:31:08Z - -// aaa : 2015-02-26 American Automobile Association, Inc. -aaa - -// abb : 2014-10-24 ABB Ltd -abb - -// abbott : 2014-07-24 Abbott Laboratories, Inc. -abbott - -// abogado : 2014-04-24 Top Level Domain Holdings Limited -abogado - -// academy : 2013-11-07 Half Oaks, LLC -academy - -// accenture : 2014-08-15 Accenture plc -accenture - -// accountant : 2014-11-20 dot Accountant Limited -accountant - -// accountants : 2014-03-20 Knob Town, LLC -accountants - -// aco : 2015-01-08 ACO Severin Ahlmann GmbH & Co. KG -aco - -// active : 2014-05-01 The Active Network, Inc -active - -// actor : 2013-12-12 United TLD Holdco Ltd. -actor - -// ads : 2014-12-04 Charleston Road Registry Inc. -ads - -// adult : 2014-10-16 ICM Registry AD LLC -adult - -// aeg : 2015-03-19 Aktiebolaget Electrolux -aeg - -// afl : 2014-10-02 Australian Football League -afl - -// africa : 2014-03-24 ZA Central Registry NPC trading as Registry.Africa -africa - -// africamagic : 2015-03-05 Electronic Media Network (Pty) Ltd -africamagic - -// agakhan : 2015-04-23 Fondation Aga Khan (Aga Khan Foundation) -agakhan - -// agency : 2013-11-14 Steel Falls, LLC -agency - -// aig : 2014-12-18 American International Group, Inc. -aig - -// airforce : 2014-03-06 United TLD Holdco Ltd. -airforce - -// airtel : 2014-10-24 Bharti Airtel Limited -airtel - -// akdn : 2015-04-23 Fondation Aga Khan (Aga Khan Foundation) -akdn - -// alibaba : 2015-01-15 Alibaba Group Holding Limited -alibaba - -// alipay : 2015-01-15 Alibaba Group Holding Limited -alipay - -// allfinanz : 2014-07-03 Allfinanz Deutsche Vermögensberatung Aktiengesellschaft -allfinanz - -// alsace : 2014-07-02 REGION D ALSACE -alsace - -// amsterdam : 2014-07-24 Gemeente Amsterdam -amsterdam - -// analytics : 2014-12-18 Campus IP LLC -analytics - -// android : 2014-08-07 Charleston Road Registry Inc. -android - -// anquan : 2015-01-08 QIHOO 360 TECHNOLOGY CO. LTD. -anquan - -// apartments : 2014-12-11 June Maple, LLC -apartments - -// aquarelle : 2014-07-24 Aquarelle.com -aquarelle - -// aramco : 2014-11-20 Aramco Services Company -aramco - -// archi : 2014-02-06 STARTING DOT LIMITED -archi - -// army : 2014-03-06 United TLD Holdco Ltd. -army - -// arte : 2014-12-11 Association Relative à la Télévision Européenne G.E.I.E. -arte - -// associates : 2014-03-06 Baxter Hill, LLC -associates - -// attorney : 2014-03-20 -attorney - -// auction : 2014-03-20 -auction - -// audio : 2014-03-20 Uniregistry, Corp. -audio - -// author : 2014-12-18 Amazon EU S.à r.l. -author - -// auto : 2014-11-13 Uniregistry, Corp. -auto - -// autos : 2014-01-09 DERAutos, LLC -autos - -// avianca : 2015-01-08 Aerovias del Continente Americano S.A. Avianca -avianca - -// axa : 2013-12-19 AXA SA -axa - -// azure : 2014-12-18 Microsoft Corporation -azure - -// baby : 2015-04-09 Johnson & Johnson Services, Inc. -baby - -// baidu : 2015-01-08 Baidu, Inc. -baidu - -// band : 2014-06-12 -band - -// bank : 2014-09-25 fTLD Registry Services LLC -bank - -// bar : 2013-12-12 Punto 2012 Sociedad Anonima Promotora de Inversion de Capital Variable -bar - -// barcelona : 2014-07-24 Municipi de Barcelona -barcelona - -// barclaycard : 2014-11-20 Barclays Bank PLC -barclaycard - -// barclays : 2014-11-20 Barclays Bank PLC -barclays - -// bargains : 2013-11-14 Half Hallow, LLC -bargains - -// bauhaus : 2014-04-17 Werkhaus GmbH -bauhaus - -// bayern : 2014-01-23 Bayern Connect GmbH -bayern - -// bbc : 2014-12-18 British Broadcasting Corporation -bbc - -// bbva : 2014-10-02 BANCO BILBAO VIZCAYA ARGENTARIA, S.A. -bbva - -// bcg : 2015-04-02 The Boston Consulting Group, Inc. -bcg - -// bcn : 2014-07-24 Municipi de Barcelona -bcn - -// beer : 2014-01-09 Top Level Domain Holdings Limited -beer - -// bentley : 2014-12-18 Bentley Motors Limited -bentley - -// berlin : 2013-10-31 dotBERLIN GmbH & Co. KG -berlin - -// best : 2013-12-19 BestTLD Pty Ltd -best - -// bharti : 2014-01-09 Bharti Enterprises (Holding) Private Limited -bharti - -// bible : 2014-06-19 American Bible Society -bible - -// bid : 2013-12-19 dot Bid Limited -bid - -// bike : 2013-08-27 Grand Hollow, LLC -bike - -// bing : 2014-12-18 Microsoft Corporation -bing - -// bingo : 2014-12-04 Sand Cedar, LLC -bingo - -// bio : 2014-03-06 STARTING DOT LIMITED -bio - -// black : 2014-01-16 Afilias Limited -black - -// blackfriday : 2014-01-16 Uniregistry, Corp. -blackfriday - -// bloomberg : 2014-07-17 Bloomberg IP Holdings LLC -bloomberg - -// blue : 2013-11-07 Afilias Limited -blue - -// bms : 2014-10-30 Bristol-Myers Squibb Company -bms - -// bmw : 2014-01-09 Bayerische Motoren Werke Aktiengesellschaft -bmw - -// bnl : 2014-07-24 Banca Nazionale del Lavoro -bnl - -// bnpparibas : 2014-05-29 BNP Paribas -bnpparibas - -// boats : 2014-12-04 DERBoats, LLC -boats - -// bom : 2014-10-16 Núcleo de Informação e Coordenação do Ponto BR - NIC.br -bom - -// bond : 2014-06-05 Bond University Limited -bond - -// boo : 2014-01-30 Charleston Road Registry Inc. -boo - -// boots : 2015-01-08 THE BOOTS COMPANY PLC -boots - -// bot : 2014-12-18 Amazon EU S.à r.l. -bot - -// boutique : 2013-11-14 Over Galley, LLC -boutique - -// bradesco : 2014-12-18 Banco Bradesco S.A. -bradesco - -// bridgestone : 2014-12-18 Bridgestone Corporation -bridgestone - -// broadway : 2014-12-22 Celebrate Broadway, Inc. -broadway - -// broker : 2014-12-11 IG Group Holdings PLC -broker - -// brother : 2015-01-29 Brother Industries, Ltd. -brother - -// brussels : 2014-02-06 DNS.be vzw -brussels - -// budapest : 2013-11-21 Top Level Domain Holdings Limited -budapest - -// build : 2013-11-07 Plan Bee LLC -build - -// builders : 2013-11-07 Atomic Madison, LLC -builders - -// business : 2013-11-07 Spring Cross, LLC -business - -// buy : 2014-12-18 Amazon EU S.à r.l. -buy - -// buzz : 2013-10-02 DOTSTRATEGY CO. -buzz - -// bzh : 2014-02-27 Association www.bzh -bzh - -// cab : 2013-10-24 Half Sunset, LLC -cab - -// cafe : 2015-02-11 Pioneer Canyon, LLC -cafe - -// cal : 2014-07-24 Charleston Road Registry Inc. -cal - -// call : 2014-12-18 Amazon EU S.à r.l. -call - -// camera : 2013-08-27 Atomic Maple, LLC -camera - -// camp : 2013-11-07 Delta Dynamite, LLC -camp - -// cancerresearch : 2014-05-15 Australian Cancer Research Foundation -cancerresearch - -// canon : 2014-09-12 Canon Inc. -canon - -// capetown : 2014-03-24 ZA Central Registry NPC trading as ZA Central Registry -capetown - -// capital : 2014-03-06 Delta Mill, LLC -capital - -// car : 2015-01-22 Charleston Road Registry Inc. -car - -// caravan : 2013-12-12 Caravan International, Inc. -caravan - -// cards : 2013-12-05 Foggy Hollow, LLC -cards - -// care : 2014-03-06 Goose Cross -care - -// career : 2013-10-09 dotCareer LLC -career - -// careers : 2013-10-02 Wild Corner, LLC -careers - -// cars : 2014-11-13 Uniregistry, Corp. -cars - -// cartier : 2014-06-23 Richemont DNS Inc. -cartier - -// casa : 2013-11-21 Top Level Domain Holdings Limited -casa - -// cash : 2014-03-06 Delta Lake, LLC -cash - -// casino : 2014-12-18 Binky Sky, LLC -casino - -// catering : 2013-12-05 New Falls. LLC -catering - -// cba : 2014-06-26 COMMONWEALTH BANK OF AUSTRALIA -cba - -// cbn : 2014-08-22 The Christian Broadcasting Network, Inc. -cbn - -// ceb : 2015-04-09 The Corporate Executive Board Company -ceb - -// center : 2013-11-07 Tin Mill, LLC -center - -// ceo : 2013-11-07 CEOTLD Pty Ltd -ceo - -// cern : 2014-06-05 European Organization for Nuclear Research ("CERN") -cern - -// cfa : 2014-08-28 CFA Institute -cfa - -// cfd : 2014-12-11 IG Group Holdings PLC -cfd - -// chanel : 2015-04-09 Chanel International B.V. -chanel - -// channel : 2014-05-08 Charleston Road Registry Inc. -channel - -// chase : 2015-04-30 JPMorgan Chase & Co. -chase - -// chat : 2014-12-04 Sand Fields, LLC -chat - -// cheap : 2013-11-14 Sand Cover, LLC -cheap - -// chloe : 2014-10-16 Richemont DNS Inc. -chloe - -// christmas : 2013-11-21 Uniregistry, Corp. -christmas - -// chrome : 2014-07-24 Charleston Road Registry Inc. -chrome - -// church : 2014-02-06 Holly Fields, LLC -church - -// cipriani : 2015-02-19 Hotel Cipriani Srl -cipriani - -// circle : 2014-12-18 Amazon EU S.à r.l. -circle - -// cisco : 2014-12-22 Cisco Technology, Inc. -cisco - -// citic : 2014-01-09 CITIC Group Corporation -citic - -// city : 2014-05-29 Snow Sky, LLC -city - -// cityeats : 2014-12-11 Lifestyle Domain Holdings, Inc. -cityeats - -// claims : 2014-03-20 Black Corner, LLC -claims - -// cleaning : 2013-12-05 Fox Shadow, LLC -cleaning - -// click : 2014-06-05 Uniregistry, Corp. -click - -// clinic : 2014-03-20 Goose Park, LLC -clinic - -// clothing : 2013-08-27 Steel Lake, LLC -clothing - -// cloud : 2015-04-16 ARUBA S.p.A. -cloud - -// club : 2013-11-08 .CLUB DOMAINS, LLC -club - -// coach : 2014-10-09 Koko Island, LLC -coach - -// codes : 2013-10-31 Puff Willow, LLC -codes - -// coffee : 2013-10-17 Trixy Cover, LLC -coffee - -// college : 2014-01-16 XYZ.COM LLC -college - -// cologne : 2014-02-05 NetCologne Gesellschaft für Telekommunikation mbH -cologne - -// commbank : 2014-06-26 COMMONWEALTH BANK OF AUSTRALIA -commbank - -// community : 2013-12-05 Fox Orchard, LLC -community - -// company : 2013-11-07 Silver Avenue, LLC -company - -// computer : 2013-10-24 Pine Mill, LLC -computer - -// comsec : 2015-01-08 VeriSign, Inc. -comsec - -// condos : 2013-12-05 Pine House, LLC -condos - -// construction : 2013-09-16 Fox Dynamite, LLC -construction - -// consulting : 2013-12-05 -consulting - -// contact : 2015-01-08 Top Level Spectrum, Inc. -contact - -// contractors : 2013-09-10 Magic Woods, LLC -contractors - -// cooking : 2013-11-21 Top Level Domain Holdings Limited -cooking - -// cool : 2013-11-14 Koko Lake, LLC -cool - -// corsica : 2014-09-25 Collectivité Territoriale de Corse -corsica - -// country : 2013-12-19 Top Level Domain Holdings Limited -country - -// coupon : 2015-02-26 Amazon EU S.à r.l. -coupon - -// coupons : 2015-03-26 Black Island, LLC -coupons - -// courses : 2014-12-04 OPEN UNIVERSITIES AUSTRALIA PTY LTD -courses - -// credit : 2014-03-20 Snow Shadow, LLC -credit - -// creditcard : 2014-03-20 Binky Frostbite, LLC -creditcard - -// creditunion : 2015-01-22 CUNA Performance Resources, LLC -creditunion - -// cricket : 2014-10-09 dot Cricket Limited -cricket - -// crown : 2014-10-24 Crown Equipment Corporation -crown - -// crs : 2014-04-03 Federated Co-operatives Limited -crs - -// cruises : 2013-12-05 Spring Way, LLC -cruises - -// csc : 2014-09-25 Alliance-One Services, Inc. -csc - -// cuisinella : 2014-04-03 SALM S.A.S. -cuisinella - -// cymru : 2014-05-08 Nominet UK -cymru - -// cyou : 2015-01-22 Beijing Gamease Age Digital Technology Co., Ltd. -cyou - -// dabur : 2014-02-06 Dabur India Limited -dabur - -// dad : 2014-01-23 Charleston Road Registry Inc. -dad - -// dance : 2013-10-24 United TLD Holdco Ltd. -dance - -// date : 2014-11-20 dot Date Limited -date - -// dating : 2013-12-05 Pine Fest, LLC -dating - -// datsun : 2014-03-27 NISSAN MOTOR CO., LTD. -datsun - -// day : 2014-01-30 Charleston Road Registry Inc. -day - -// dclk : 2014-11-20 Charleston Road Registry Inc. -dclk - -// dealer : 2014-12-22 Dealer Dot Com, Inc. -dealer - -// deals : 2014-05-22 Sand Sunset, LLC -deals - -// degree : 2014-03-06 -degree - -// delivery : 2014-09-11 Steel Station, LLC -delivery - -// dell : 2014-10-24 Dell Inc. -dell - -// delta : 2015-02-19 Delta Air Lines, Inc. -delta - -// democrat : 2013-10-24 United TLD Holdco Ltd. -democrat - -// dental : 2014-03-20 Tin Birch, LLC -dental - -// dentist : 2014-03-20 -dentist - -// desi : 2013-11-14 Desi Networks LLC -desi - -// design : 2014-11-07 Top Level Design, LLC -design - -// dev : 2014-10-16 Charleston Road Registry Inc. -dev - -// diamonds : 2013-09-22 John Edge, LLC -diamonds - -// diet : 2014-06-26 Uniregistry, Corp. -diet - -// digital : 2014-03-06 Dash Park, LLC -digital - -// direct : 2014-04-10 Half Trail, LLC -direct - -// directory : 2013-09-20 Extra Madison, LLC -directory - -// discount : 2014-03-06 Holly Hill, LLC -discount - -// dnp : 2013-12-13 Dai Nippon Printing Co., Ltd. -dnp - -// docs : 2014-10-16 Charleston Road Registry Inc. -docs - -// dog : 2014-12-04 Koko Mill, LLC -dog - -// doha : 2014-09-18 Communications Regulatory Authority (CRA) -doha - -// domains : 2013-10-17 Sugar Cross, LLC -domains - -// doosan : 2014-04-03 Doosan Corporation -doosan - -// download : 2014-11-20 dot Support Limited -download - -// drive : 2015-03-05 Charleston Road Registry Inc. -drive - -// dstv : 2015-03-12 MultiChoice (Proprietary) Limited -dstv - -// dubai : 2015-01-01 Dubai Smart Government Department -dubai - -// durban : 2014-03-24 ZA Central Registry NPC trading as ZA Central Registry -durban - -// dvag : 2014-06-23 Deutsche Vermögensberatung Aktiengesellschaft DVAG -dvag - -// earth : 2014-12-04 Interlink Co., Ltd. -earth - -// eat : 2014-01-23 Charleston Road Registry Inc. -eat - -// edeka : 2014-12-18 EDEKA Verband kaufmännischer Genossenschaften e.V. -edeka - -// education : 2013-11-07 Brice Way, LLC -education - -// email : 2013-10-31 Spring Madison, LLC -email - -// emerck : 2014-04-03 Merck KGaA -emerck - -// energy : 2014-09-11 Binky Birch, LLC -energy - -// engineer : 2014-03-06 United TLD Holdco Ltd. -engineer - -// engineering : 2014-03-06 Romeo Canyon -engineering - -// enterprises : 2013-09-20 Snow Oaks, LLC -enterprises - -// epson : 2014-12-04 Seiko Epson Corporation -epson - -// equipment : 2013-08-27 Corn Station, LLC -equipment - -// erni : 2014-04-03 ERNI Group Holding AG -erni - -// esq : 2014-05-08 Charleston Road Registry Inc. -esq - -// estate : 2013-08-27 Trixy Park, LLC -estate - -// eurovision : 2014-04-24 European Broadcasting Union (EBU) -eurovision - -// eus : 2013-12-12 Puntueus Fundazioa -eus - -// events : 2013-12-05 Pioneer Maple, LLC -events - -// everbank : 2014-05-15 EverBank -everbank - -// exchange : 2014-03-06 Spring Falls, LLC -exchange - -// expert : 2013-11-21 Magic Pass, LLC -expert - -// exposed : 2013-12-05 Victor Beach, LLC -exposed - -// express : 2015-02-11 Sea Sunset, LLC -express - -// fage : 2014-12-18 Fage International S.A. -fage - -// fail : 2014-03-06 Atomic Pipe, LLC -fail - -// fairwinds : 2014-11-13 FairWinds Partners, LLC -fairwinds - -// faith : 2014-11-20 dot Faith Limited -faith - -// family : 2015-04-02 Bitter Galley, LLC -family - -// fan : 2014-03-06 -fan - -// fans : 2014-11-07 Asiamix Digital Limited -fans - -// farm : 2013-11-07 Just Maple, LLC -farm - -// fashion : 2014-07-03 Top Level Domain Holdings Limited -fashion - -// fast : 2014-12-18 Amazon EU S.à r.l. -fast - -// feedback : 2013-12-19 Top Level Spectrum, Inc. -feedback - -// ferrero : 2014-12-18 Ferrero Trading Lux S.A. -ferrero - -// film : 2015-01-08 Motion Picture Domain Registry Pty Ltd -film - -// final : 2014-10-16 Núcleo de Informação e Coordenação do Ponto BR - NIC.br -final - -// finance : 2014-03-20 Cotton Cypress, LLC -finance - -// financial : 2014-03-06 Just Cover, LLC -financial - -// firestone : 2014-12-18 Bridgestone Corporation -firestone - -// firmdale : 2014-03-27 Firmdale Holdings Limited -firmdale - -// fish : 2013-12-12 Fox Woods, LLC -fish - -// fishing : 2013-11-21 Top Level Domain Holdings Limited -fishing - -// fit : 2014-11-07 Top Level Domain Holdings Limited -fit - -// fitness : 2014-03-06 Brice Orchard, LLC -fitness - -// flickr : 2015-04-02 Yahoo! Domain Services Inc. -flickr - -// flights : 2013-12-05 Fox Station, LLC -flights - -// florist : 2013-11-07 Half Cypress, LLC -florist - -// flowers : 2014-10-09 Uniregistry, Corp. -flowers - -// flsmidth : 2014-07-24 FLSmidth A/S -flsmidth - -// fly : 2014-05-08 Charleston Road Registry Inc. -fly - -// foo : 2014-01-23 Charleston Road Registry Inc. -foo - -// football : 2014-12-18 Foggy Farms, LLC -football - -// ford : 2014-11-13 Ford Motor Company -ford - -// forex : 2014-12-11 IG Group Holdings PLC -forex - -// forsale : 2014-05-22 -forsale - -// forum : 2015-04-02 Fegistry, LLC -forum - -// foundation : 2013-12-05 John Dale, LLC -foundation - -// frl : 2014-05-15 FRLregistry B.V. -frl - -// frogans : 2013-12-19 OP3FT -frogans - -// frontier : 2015-02-05 Frontier Communications Corporation -frontier - -// fund : 2014-03-20 John Castle, LLC -fund - -// furniture : 2014-03-20 Lone Fields, LLC -furniture - -// futbol : 2013-09-20 -futbol - -// fyi : 2015-04-02 Silver Tigers, LLC -fyi - -// gal : 2013-11-07 Asociación puntoGAL -gal - -// gallery : 2013-09-13 Sugar House, LLC -gallery - -// gallup : 2015-02-19 Gallup, Inc. -gallup - -// garden : 2014-06-26 Top Level Domain Holdings Limited -garden - -// gbiz : 2014-07-17 Charleston Road Registry Inc. -gbiz - -// gdn : 2014-07-31 Joint Stock Company "Navigation-information systems" -gdn - -// gea : 2014-12-04 GEA Group Aktiengesellschaft -gea - -// gent : 2014-01-23 COMBELL GROUP NV/SA -gent - -// genting : 2015-03-12 Resorts World Inc Pte. Ltd. -genting - -// ggee : 2014-01-09 GMO Internet, Inc. -ggee - -// gift : 2013-10-17 Uniregistry, Corp. -gift - -// gifts : 2014-07-03 Goose Sky, LLC -gifts - -// gives : 2014-03-06 United TLD Holdco Ltd. -gives - -// giving : 2014-11-13 Giving Limited -giving - -// glass : 2013-11-07 Black Cover, LLC -glass - -// gle : 2014-07-24 Charleston Road Registry Inc. -gle - -// global : 2014-04-17 Dot GLOBAL AS -global - -// globo : 2013-12-19 Globo Comunicação e Participações S.A -globo - -// gmail : 2014-05-01 Charleston Road Registry Inc. -gmail - -// gmo : 2014-01-09 GMO Internet, Inc. -gmo - -// gmx : 2014-04-24 1&1 Mail & Media GmbH -gmx - -// gold : 2015-01-22 June Edge, LLC -gold - -// goldpoint : 2014-11-20 YODOBASHI CAMERA CO.,LTD. -goldpoint - -// golf : 2014-12-18 Lone falls, LLC -golf - -// goo : 2014-12-18 NTT Resonant Inc. -goo - -// goog : 2014-11-20 Charleston Road Registry Inc. -goog - -// google : 2014-07-24 Charleston Road Registry Inc. -google - -// gop : 2014-01-16 Republican State Leadership Committee, Inc. -gop - -// got : 2014-12-18 Amazon EU S.à r.l. -got - -// gotv : 2015-03-12 MultiChoice (Proprietary) Limited -gotv - -// graphics : 2013-09-13 Over Madison, LLC -graphics - -// gratis : 2014-03-20 Pioneer Tigers, LLC -gratis - -// green : 2014-05-08 Afilias Limited -green - -// gripe : 2014-03-06 Corn Sunset, LLC -gripe - -// group : 2014-08-15 Romeo Town, LLC -group - -// gucci : 2014-11-13 Guccio Gucci S.p.a. -gucci - -// guge : 2014-08-28 Charleston Road Registry Inc. -guge - -// guide : 2013-09-13 Snow Moon, LLC -guide - -// guitars : 2013-11-14 Uniregistry, Corp. -guitars - -// guru : 2013-08-27 Pioneer Cypress, LLC -guru - -// hamburg : 2014-02-20 Hamburg Top-Level-Domain GmbH -hamburg - -// hangout : 2014-11-13 Charleston Road Registry Inc. -hangout - -// haus : 2013-12-05 -haus - -// hdfcbank : 2015-02-12 HDFC Bank Limited -hdfcbank - -// health : 2015-02-11 DotHealth, LLC -health - -// healthcare : 2014-06-12 Silver Glen, LLC -healthcare - -// help : 2014-06-26 Uniregistry, Corp. -help - -// helsinki : 2015-02-05 City of Helsinki -helsinki - -// here : 2014-02-06 Charleston Road Registry Inc. -here - -// hermes : 2014-07-10 HERMES INTERNATIONAL -hermes - -// hiphop : 2014-03-06 Uniregistry, Corp. -hiphop - -// hitachi : 2014-10-31 Hitachi, Ltd. -hitachi - -// hiv : 2014-03-13 dotHIV gemeinnuetziger e.V. -hiv - -// hockey : 2015-03-19 Half Willow, LLC -hockey - -// holdings : 2013-08-27 John Madison, LLC -holdings - -// holiday : 2013-11-07 Goose Woods, LLC -holiday - -// homedepot : 2015-04-02 Homer TLC, Inc. -homedepot - -// homes : 2014-01-09 DERHomes, LLC -homes - -// honda : 2014-12-18 Honda Motor Co., Ltd. -honda - -// horse : 2013-11-21 Top Level Domain Holdings Limited -horse - -// host : 2014-04-17 DotHost Inc. -host - -// hosting : 2014-05-29 Uniregistry, Corp. -hosting - -// hoteles : 2015-03-05 Travel Reservations SRL -hoteles - -// hotmail : 2014-12-18 Microsoft Corporation -hotmail - -// house : 2013-11-07 Sugar Park, LLC -house - -// how : 2014-01-23 Charleston Road Registry Inc. -how - -// hsbc : 2014-10-24 HSBC Holdings PLC -hsbc - -// htc : 2015-04-02 HTC corporation -htc - -// ibm : 2014-07-31 International Business Machines Corporation -ibm - -// icbc : 2015-02-19 Industrial and Commercial Bank of China Limited -icbc - -// ice : 2014-10-30 IntercontinentalExchange, Inc. -ice - -// icu : 2015-01-08 One.com A/S -icu - -// ifm : 2014-01-30 ifm electronic gmbh -ifm - -// iinet : 2014-07-03 Connect West Pty. Ltd. -iinet - -// immo : 2014-07-10 Auburn Bloom, LLC -immo - -// immobilien : 2013-11-07 United TLD Holdco Ltd. -immobilien - -// industries : 2013-12-05 Outer House, LLC -industries - -// infiniti : 2014-03-27 NISSAN MOTOR CO., LTD. -infiniti - -// ing : 2014-01-23 Charleston Road Registry Inc. -ing - -// ink : 2013-12-05 Top Level Design, LLC -ink - -// institute : 2013-11-07 Outer Maple, LLC -institute - -// insurance : 2015-02-19 fTLD Registry Services LLC -insurance - -// insure : 2014-03-20 Pioneer Willow, LLC -insure - -// international : 2013-11-07 Wild Way, LLC -international - -// investments : 2014-03-20 Holly Glen, LLC -investments - -// ipiranga : 2014-08-28 Ipiranga Produtos de Petroleo S.A. -ipiranga - -// irish : 2014-08-07 Dot-Irish LLC -irish - -// iselect : 2015-02-11 iSelect Ltd -iselect - -// ist : 2014-08-28 Istanbul Metropolitan Municipality -ist - -// istanbul : 2014-08-28 Istanbul Metropolitan Municipality -istanbul - -// itau : 2014-10-02 Itau Unibanco Holding S.A. -itau - -// iwc : 2014-06-23 Richemont DNS Inc. -iwc - -// jaguar : 2014-11-13 Jaguar Land Rover Ltd -jaguar - -// java : 2014-06-19 Oracle Corporation -java - -// jcb : 2014-11-20 JCB Co., Ltd. -jcb - -// jcp : 2015-04-23 JCP Media, Inc. -jcp - -// jetzt : 2014-01-09 New TLD Company AB -jetzt - -// jewelry : 2015-03-05 Wild Bloom, LLC -jewelry - -// jio : 2015-04-02 Affinity Names, Inc. -jio - -// jlc : 2014-12-04 Richemont DNS Inc. -jlc - -// jll : 2015-04-02 Jones Lang LaSalle Incorporated -jll - -// jmp : 2015-03-26 Matrix IP LLC -jmp - -// joburg : 2014-03-24 ZA Central Registry NPC trading as ZA Central Registry -joburg - -// jot : 2014-12-18 Amazon EU S.à r.l. -jot - -// joy : 2014-12-18 Amazon EU S.à r.l. -joy - -// jpmorgan : 2015-04-30 JPMorgan Chase & Co. -jpmorgan - -// jprs : 2014-09-18 Japan Registry Services Co., Ltd. -jprs - -// juegos : 2014-03-20 Uniregistry, Corp. -juegos - -// kaufen : 2013-11-07 United TLD Holdco Ltd. -kaufen - -// kddi : 2014-09-12 KDDI CORPORATION -kddi - -// kerryhotels : 2015-04-30 Kerry Trading Co. Limited -kerryhotels - -// kerrylogistics : 2015-04-09 Kerry Trading Co. Limited -kerrylogistics - -// kerryproperties : 2015-04-09 Kerry Trading Co. Limited -kerryproperties - -// kfh : 2014-12-04 Kuwait Finance House -kfh - -// kim : 2013-09-23 Afilias Limited -kim - -// kinder : 2014-11-07 Ferrero Trading Lux S.A. -kinder - -// kitchen : 2013-09-20 Just Goodbye, LLC -kitchen - -// kiwi : 2013-09-20 DOT KIWI LIMITED -kiwi - -// koeln : 2014-01-09 NetCologne Gesellschaft für Telekommunikation mbH -koeln - -// komatsu : 2015-01-08 Komatsu Ltd. -komatsu - -// kpmg : 2015-04-23 KPMG International Cooperative (KPMG International Genossenschaft) -kpmg - -// kpn : 2015-01-08 Koninklijke KPN N.V. -kpn - -// krd : 2013-12-05 KRG Department of Information Technology -krd - -// kred : 2013-12-19 KredTLD Pty Ltd -kred - -// kuokgroup : 2015-04-09 Kerry Trading Co. Limited -kuokgroup - -// kyknet : 2015-03-05 Electronic Media Network (Pty) Ltd -kyknet - -// kyoto : 2014-11-07 Academic Institution: Kyoto Jyoho Gakuen -kyoto - -// lacaixa : 2014-01-09 CAIXA D'ESTALVIS I PENSIONS DE BARCELONA -lacaixa - -// lancaster : 2015-02-12 LANCASTER -lancaster - -// land : 2013-09-10 Pine Moon, LLC -land - -// landrover : 2014-11-13 Jaguar Land Rover Ltd -landrover - -// lasalle : 2015-04-02 Jones Lang LaSalle Incorporated -lasalle - -// lat : 2014-10-16 ECOM-LAC Federaciòn de Latinoamèrica y el Caribe para Internet y el Comercio Electrònico -lat - -// latrobe : 2014-06-16 La Trobe University -latrobe - -// law : 2015-01-22 Minds + Machines Group Limited -law - -// lawyer : 2014-03-20 -lawyer - -// lds : 2014-03-20 IRI Domain Management, LLC ("Applicant") -lds - -// lease : 2014-03-06 Victor Trail, LLC -lease - -// leclerc : 2014-08-07 A.C.D. LEC Association des Centres Distributeurs Edouard Leclerc -leclerc - -// legal : 2014-10-16 Blue Falls, LLC -legal - -// lexus : 2015-04-23 TOYOTA MOTOR CORPORATION -lexus - -// lgbt : 2014-05-08 Afilias Limited -lgbt - -// liaison : 2014-10-02 Liaison Technologies, Incorporated -liaison - -// lidl : 2014-09-18 Schwarz Domains und Services GmbH & Co. KG -lidl - -// life : 2014-02-06 Trixy Oaks, LLC -life - -// lifeinsurance : 2015-01-15 American Council of Life Insurers -lifeinsurance - -// lifestyle : 2014-12-11 Lifestyle Domain Holdings, Inc. -lifestyle - -// lighting : 2013-08-27 John McCook, LLC -lighting - -// like : 2014-12-18 Amazon EU S.à r.l. -like - -// limited : 2014-03-06 Big Fest, LLC -limited - -// limo : 2013-10-17 Hidden Frostbite, LLC -limo - -// lincoln : 2014-11-13 Ford Motor Company -lincoln - -// linde : 2014-12-04 Linde Aktiengesellschaft -linde - -// link : 2013-11-14 Uniregistry, Corp. -link - -// live : 2014-12-04 Half Woods, LLC -live - -// lixil : 2015-03-19 LIXIL Group Corporation -lixil - -// loan : 2014-11-20 dot Loan Limited -loan - -// loans : 2014-03-20 June Woods, LLC -loans - -// lol : 2015-01-30 Uniregistry, Corp. -lol - -// london : 2013-11-14 Dot London Domains Limited -london - -// lotte : 2014-11-07 Lotte Holdings Co., Ltd. -lotte - -// lotto : 2014-04-10 Afilias Limited -lotto - -// love : 2014-12-22 Merchant Law Group LLP -love - -// ltd : 2014-09-25 Over Corner, LLC -ltd - -// ltda : 2014-04-17 DOMAIN ROBOT SERVICOS DE HOSPEDAGEM NA INTERNET LTDA -ltda - -// lupin : 2014-11-07 LUPIN LIMITED -lupin - -// luxe : 2014-01-09 Top Level Domain Holdings Limited -luxe - -// luxury : 2013-10-17 Luxury Partners, LLC -luxury - -// madrid : 2014-05-01 Comunidad de Madrid -madrid - -// maif : 2014-10-02 Mutuelle Assurance Instituteur France (MAIF) -maif - -// maison : 2013-12-05 Victor Frostbite, LLC -maison - -// makeup : 2015-01-15 L'Oréal -makeup - -// man : 2014-12-04 MAN SE -man - -// management : 2013-11-07 John Goodbye, LLC -management - -// mango : 2013-10-24 PUNTO FA S.L. -mango - -// market : 2014-03-06 -market - -// marketing : 2013-11-07 Fern Pass, LLC -marketing - -// markets : 2014-12-11 IG Group Holdings PLC -markets - -// marriott : 2014-10-09 Marriott Worldwide Corporation -marriott - -// mba : 2015-04-02 Lone Hollow, LLC -mba - -// media : 2014-03-06 Grand Glen, LLC -media - -// meet : 2014-01-16 -meet - -// melbourne : 2014-05-29 The Crown in right of the State of Victoria, represented by its Department of State Development, Business and Innovation -melbourne - -// meme : 2014-01-30 Charleston Road Registry Inc. -meme - -// memorial : 2014-10-16 Dog Beach, LLC -memorial - -// men : 2015-02-26 Exclusive Registry Limited -men - -// menu : 2013-09-11 Wedding TLD2, LLC -menu - -// meo : 2014-11-07 PT Comunicacoes S.A. -meo - -// miami : 2013-12-19 Top Level Domain Holdings Limited -miami - -// microsoft : 2014-12-18 Microsoft Corporation -microsoft - -// mini : 2014-01-09 Bayerische Motoren Werke Aktiengesellschaft -mini - -// mls : 2015-04-23 The Canadian Real Estate Association -mls - -// mma : 2014-11-07 MMA IARD -mma - -// mnet : 2015-03-05 Electronic Media Network (Pty) Ltd -mnet - -// mobily : 2014-12-18 GreenTech Consultancy Company W.L.L. -mobily - -// moda : 2013-11-07 United TLD Holdco Ltd. -moda - -// moe : 2013-11-13 Interlink Co., Ltd. -moe - -// moi : 2014-12-18 Amazon EU S.à r.l. -moi - -// mom : 2015-04-16 Uniregistry, Corp. -mom - -// monash : 2013-09-30 Monash University -monash - -// money : 2014-10-16 Outer McCook, LLC -money - -// montblanc : 2014-06-23 Richemont DNS Inc. -montblanc - -// mormon : 2013-12-05 IRI Domain Management, LLC ("Applicant") -mormon - -// mortgage : 2014-03-20 -mortgage - -// moscow : 2013-12-19 Foundation for Assistance for Internet Technologies and Infrastructure Development (FAITID) -moscow - -// motorcycles : 2014-01-09 DERMotorcycles, LLC -motorcycles - -// mov : 2014-01-30 Charleston Road Registry Inc. -mov - -// movie : 2015-02-05 New Frostbite, LLC -movie - -// movistar : 2014-10-16 Telefónica S.A. -movistar - -// mtn : 2014-12-04 MTN Dubai Limited -mtn - -// mtpc : 2014-11-20 Mitsubishi Tanabe Pharma Corporation -mtpc - -// mtr : 2015-03-12 MTR Corporation Limited -mtr - -// multichoice : 2015-03-12 MultiChoice (Proprietary) Limited -multichoice - -// mutual : 2015-04-02 Northwestern Mutual MU TLD Registry, LLC -mutual - -// mzansimagic : 2015-03-05 Electronic Media Network (Pty) Ltd -mzansimagic - -// nadex : 2014-12-11 IG Group Holdings PLC -nadex - -// nagoya : 2013-10-24 GMO Registry, Inc. -nagoya - -// naspers : 2015-02-12 Intelprop (Proprietary) Limited -naspers - -// natura : 2015-03-12 NATURA COSMÉTICOS S.A. -natura - -// navy : 2014-03-06 United TLD Holdco Ltd. -navy - -// nec : 2015-01-08 NEC Corporation -nec - -// netbank : 2014-06-26 COMMONWEALTH BANK OF AUSTRALIA -netbank - -// network : 2013-11-14 Trixy Manor, LLC -network - -// neustar : 2013-12-05 NeuStar, Inc. -neustar - -// new : 2014-01-30 Charleston Road Registry Inc. -new - -// news : 2014-12-18 -news - -// nexus : 2014-07-24 Charleston Road Registry Inc. -nexus - -// ngo : 2014-03-06 Public Interest Registry -ngo - -// nhk : 2014-02-13 Japan Broadcasting Corporation (NHK) -nhk - -// nico : 2014-12-04 DWANGO Co., Ltd. -nico - -// ninja : 2013-11-07 United TLD Holdco Ltd. -ninja - -// nissan : 2014-03-27 NISSAN MOTOR CO., LTD. -nissan - -// nokia : 2015-01-08 Nokia Corporation -nokia - -// norton : 2014-12-04 Symantec Corporation -norton - -// nowruz : 2014-09-04 Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. -nowruz - -// nra : 2014-05-22 NRA Holdings Company, INC. -nra - -// nrw : 2013-11-21 Minds + Machines GmbH -nrw - -// ntt : 2014-10-31 NIPPON TELEGRAPH AND TELEPHONE CORPORATION -ntt - -// nyc : 2014-01-23 The City of New York by and through the New York City Department of Information Technology & Telecommunications -nyc - -// obi : 2014-09-25 OBI Group Holding SE & Co. KGaA -obi - -// observer : 2015-04-30 Guardian News and Media Limited -observer - -// office : 2015-03-12 Microsoft Corporation -office - -// okinawa : 2013-12-05 BusinessRalliart Inc. -okinawa - -// omega : 2015-01-08 The Swatch Group Ltd -omega - -// one : 2014-11-07 One.com A/S -one - -// ong : 2014-03-06 Public Interest Registry -ong - -// onl : 2013-09-16 I-Registry Ltd. -onl - -// online : 2015-01-15 DotOnline Inc. -online - -// ooo : 2014-01-09 INFIBEAM INCORPORATION LIMITED -ooo - -// oracle : 2014-06-19 Oracle Corporation -oracle - -// orange : 2015-03-12 Orange Brand Services Limited -orange - -// organic : 2014-03-27 Afilias Limited -organic - -// orientexpress : 2015-02-05 Belmond Ltd. -orientexpress - -// osaka : 2014-09-04 Interlink Co., Ltd. -osaka - -// otsuka : 2013-10-11 Otsuka Holdings Co., Ltd. -otsuka - -// ovh : 2014-01-16 OVH SAS -ovh - -// page : 2014-12-04 Charleston Road Registry Inc. -page - -// pamperedchef : 2015-02-05 The Pampered Chef, Ltd. -pamperedchef - -// panerai : 2014-11-07 Richemont DNS Inc. -panerai - -// paris : 2014-01-30 City of Paris -paris - -// pars : 2014-09-04 Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. -pars - -// partners : 2013-12-05 Magic Glen, LLC -partners - -// parts : 2013-12-05 Sea Goodbye, LLC -parts - -// party : 2014-09-11 Blue Sky Registry Limited -party - -// passagens : 2015-03-05 Travel Reservations SRL -passagens - -// payu : 2015-02-12 MIH PayU B.V. -payu - -// pharmacy : 2014-06-19 National Association of Boards of Pharmacy -pharmacy - -// philips : 2014-11-07 Koninklijke Philips N.V. -philips - -// photo : 2013-11-14 Uniregistry, Corp. -photo - -// photography : 2013-09-20 Sugar Glen, LLC -photography - -// photos : 2013-10-17 Sea Corner, LLC -photos - -// physio : 2014-05-01 PhysBiz Pty Ltd -physio - -// piaget : 2014-10-16 Richemont DNS Inc. -piaget - -// pics : 2013-11-14 Uniregistry, Corp. -pics - -// pictet : 2014-06-26 Pictet Europe S.A. -pictet - -// pictures : 2014-03-06 Foggy Sky, LLC -pictures - -// pid : 2015-01-08 Top Level Spectrum, Inc. -pid - -// pin : 2014-12-18 Amazon EU S.à r.l. -pin - -// pink : 2013-10-01 Afilias Limited -pink - -// pizza : 2014-06-26 Foggy Moon, LLC -pizza - -// place : 2014-04-24 Snow Galley, LLC -place - -// play : 2015-03-05 Charleston Road Registry Inc. -play - -// plumbing : 2013-09-10 Spring Tigers, LLC -plumbing - -// plus : 2015-02-05 Sugar Mill, LLC -plus - -// pohl : 2014-06-23 Deutsche Vermögensberatung Aktiengesellschaft DVAG -pohl - -// poker : 2014-07-03 Afilias Domains No. 5 Limited -poker - -// porn : 2014-10-16 ICM Registry PN LLC -porn - -// praxi : 2013-12-05 Praxi S.p.A. -praxi - -// press : 2014-04-03 DotPress Inc. -press - -// prod : 2014-01-23 Charleston Road Registry Inc. -prod - -// productions : 2013-12-05 Magic Birch, LLC -productions - -// prof : 2014-07-24 Charleston Road Registry Inc. -prof - -// promo : 2014-12-18 Play.PROMO Oy -promo - -// properties : 2013-12-05 Big Pass, LLC -properties - -// property : 2014-05-22 Uniregistry, Corp. -property - -// protection : 2015-04-23 Symantec Corporation -protection - -// pub : 2013-12-12 United TLD Holdco Ltd. -pub - -// qpon : 2013-11-14 dotCOOL, Inc. -qpon - -// quebec : 2013-12-19 PointQuébec Inc -quebec - -// quest : 2015-03-26 Quest ION Limited -quest - -// racing : 2014-12-04 Premier Registry Limited -racing - -// read : 2014-12-18 Amazon EU S.à r.l. -read - -// realtor : 2014-05-29 Real Estate Domains LLC -realtor - -// realty : 2015-03-19 Fegistry, LLC -realty - -// recipes : 2013-10-17 Grand Island, LLC -recipes - -// red : 2013-11-07 Afilias Limited -red - -// redstone : 2014-10-31 Redstone Haute Couture Co., Ltd. -redstone - -// redumbrella : 2015-03-26 Travelers TLD, LLC -redumbrella - -// rehab : 2014-03-06 United TLD Holdco Ltd. -rehab - -// reise : 2014-03-13 dotreise GmbH -reise - -// reisen : 2014-03-06 New Cypress, LLC -reisen - -// reit : 2014-09-04 National Association of Real Estate Investment Trusts, Inc. -reit - -// reliance : 2015-04-02 Reliance Industries Limited -reliance - -// ren : 2013-12-12 Beijing Qianxiang Wangjing Technology Development Co., Ltd. -ren - -// rent : 2014-12-04 DERRent, LLC -rent - -// rentals : 2013-12-05 Big Hollow,LLC -rentals - -// repair : 2013-11-07 Lone Sunset, LLC -repair - -// report : 2013-12-05 Binky Glen, LLC -report - -// republican : 2014-03-20 United TLD Holdco Ltd. -republican - -// rest : 2013-12-19 Punto 2012 Sociedad Anonima Promotora de Inversion de Capital Variable -rest - -// restaurant : 2014-07-03 Snow Avenue, LLC -restaurant - -// review : 2014-11-20 dot Review Limited -review - -// reviews : 2013-09-13 -reviews - -// rich : 2013-11-21 I-Registry Ltd. -rich - -// ricoh : 2014-11-20 Ricoh Company, Ltd. -ricoh - -// ril : 2015-04-02 Reliance Industries Limited -ril - -// rio : 2014-02-27 Empresa Municipal de Informática SA - IPLANRIO -rio - -// rip : 2014-07-10 United TLD Holdco Ltd. -rip - -// rocher : 2014-12-18 Ferrero Trading Lux S.A. -rocher - -// rocks : 2013-11-14 -rocks - -// rodeo : 2013-12-19 Top Level Domain Holdings Limited -rodeo - -// room : 2014-12-18 Amazon EU S.à r.l. -room - -// rsvp : 2014-05-08 Charleston Road Registry Inc. -rsvp - -// ruhr : 2013-10-02 regiodot GmbH & Co. KG -ruhr - -// run : 2015-03-19 Snow Park, LLC -run - -// rwe : 2015-04-02 RWE AG -rwe - -// ryukyu : 2014-01-09 BusinessRalliart Inc. -ryukyu - -// saarland : 2013-12-12 dotSaarland GmbH -saarland - -// safe : 2014-12-18 Amazon EU S.à r.l. -safe - -// safety : 2015-01-08 Safety Registry Services, LLC. -safety - -// sakura : 2014-12-18 SAKURA Internet Inc. -sakura - -// sale : 2014-10-16 -sale - -// salon : 2014-12-11 Outer Orchard, LLC -salon - -// samsung : 2014-04-03 SAMSUNG SDS CO., LTD -samsung - -// sandvik : 2014-11-13 Sandvik AB -sandvik - -// sandvikcoromant : 2014-11-07 Sandvik AB -sandvikcoromant - -// sanofi : 2014-10-09 Sanofi -sanofi - -// sap : 2014-03-27 SAP AG -sap - -// sapo : 2014-11-07 PT Comunicacoes S.A. -sapo - -// sarl : 2014-07-03 Delta Orchard, LLC -sarl - -// sas : 2015-04-02 Research IP LLC -sas - -// saxo : 2014-10-31 Saxo Bank A/S -saxo - -// sbi : 2015-03-12 STATE BANK OF INDIA -sbi - -// sbs : 2014-11-07 SPECIAL BROADCASTING SERVICE CORPORATION -sbs - -// sca : 2014-03-13 SVENSKA CELLULOSA AKTIEBOLAGET SCA (publ) -sca - -// scb : 2014-02-20 The Siam Commercial Bank Public Company Limited ("SCB") -scb - -// schmidt : 2014-04-03 SALM S.A.S. -schmidt - -// scholarships : 2014-04-24 Scholarships.com, LLC -scholarships - -// school : 2014-12-18 Little Galley, LLC -school - -// schule : 2014-03-06 Outer Moon, LLC -schule - -// schwarz : 2014-09-18 Schwarz Domains und Services GmbH & Co. KG -schwarz - -// science : 2014-09-11 dot Science Limited -science - -// scor : 2014-10-31 SCOR SE -scor - -// scot : 2014-01-23 Dot Scot Registry Limited -scot - -// seat : 2014-05-22 SEAT, S.A. (Sociedad Unipersonal) -seat - -// seek : 2014-12-04 Seek Limited -seek - -// sener : 2014-10-24 Sener Ingeniería y Sistemas, S.A. -sener - -// services : 2014-02-27 Fox Castle, LLC -services - -// sew : 2014-07-17 SEW-EURODRIVE GmbH & Co KG -sew - -// sex : 2014-11-13 ICM Registry SX LLC -sex - -// sexy : 2013-09-11 Uniregistry, Corp. -sexy - -// sharp : 2014-05-01 Sharp Corporation -sharp - -// shaw : 2015-04-23 Shaw Cablesystems G.P. -shaw - -// shia : 2014-09-04 Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. -shia - -// shiksha : 2013-11-14 Afilias Limited -shiksha - -// shoes : 2013-10-02 Binky Galley, LLC -shoes - -// shouji : 2015-01-08 QIHOO 360 TECHNOLOGY CO. LTD. -shouji - -// show : 2015-03-05 Snow Beach, LLC -show - -// shriram : 2014-01-23 Shriram Capital Ltd. -shriram - -// sina : 2015-03-12 Sina Corporation -sina - -// singles : 2013-08-27 Fern Madison, LLC -singles - -// site : 2015-01-15 DotSite Inc. -site - -// ski : 2015-04-09 STARTING DOT LIMITED -ski - -// skin : 2015-01-15 L'Oréal -skin - -// sky : 2014-06-19 Sky IP International Ltd, a company incorporated in England and Wales, operating via its registered Swiss branch -sky - -// skype : 2014-12-18 Microsoft Corporation -skype - -// smile : 2014-12-18 Amazon EU S.à r.l. -smile - -// sncf : 2015-02-19 Société Nationale des Chemins de fer Francais S N C F -sncf - -// soccer : 2015-03-26 Foggy Shadow, LLC -soccer - -// social : 2013-11-07 United TLD Holdco Ltd. -social - -// software : 2014-03-20 -software - -// sohu : 2013-12-19 Sohu.com Limited -sohu - -// solar : 2013-11-07 Ruby Town, LLC -solar - -// solutions : 2013-11-07 Silver Cover, LLC -solutions - -// song : 2015-02-26 Amazon EU S.à r.l. -song - -// sony : 2015-01-08 Sony Corporation -sony - -// soy : 2014-01-23 Charleston Road Registry Inc. -soy - -// space : 2014-04-03 DotSpace Inc. -space - -// spiegel : 2014-02-05 SPIEGEL-Verlag Rudolf Augstein GmbH & Co. KG -spiegel - -// spot : 2015-02-26 Amazon EU S.à r.l. -spot - -// spreadbetting : 2014-12-11 IG Group Holdings PLC -spreadbetting - -// stada : 2014-11-13 STADA Arzneimittel AG -stada - -// star : 2015-01-08 Star India Private Limited -star - -// starhub : 2015-02-05 StarHub Limited -starhub - -// statebank : 2015-03-12 STATE BANK OF INDIA -statebank - -// statoil : 2014-12-04 Statoil ASA -statoil - -// stc : 2014-10-09 Saudi Telecom Company -stc - -// stcgroup : 2014-10-09 Saudi Telecom Company -stcgroup - -// stockholm : 2014-12-18 Stockholms kommun -stockholm - -// storage : 2014-12-22 Self Storage Company LLC -storage - -// store : 2015-04-09 DotStore Inc. -store - -// studio : 2015-02-11 Spring Goodbye, LLC -studio - -// study : 2014-12-11 OPEN UNIVERSITIES AUSTRALIA PTY LTD -study - -// style : 2014-12-04 Binky Moon, LLC -style - -// sucks : 2014-12-22 Vox Populi Registry Inc. -sucks - -// supersport : 2015-03-05 SuperSport International Holdings Proprietary Limited -supersport - -// supplies : 2013-12-19 Atomic Fields, LLC -supplies - -// supply : 2013-12-19 Half Falls, LLC -supply - -// support : 2013-10-24 Grand Orchard, LLC -support - -// surf : 2014-01-09 Top Level Domain Holdings Limited -surf - -// surgery : 2014-03-20 Tin Avenue, LLC -surgery - -// suzuki : 2014-02-20 SUZUKI MOTOR CORPORATION -suzuki - -// swatch : 2015-01-08 The Swatch Group Ltd -swatch - -// swiss : 2014-10-16 Swiss Confederation -swiss - -// sydney : 2014-09-18 State of New South Wales, Department of Premier and Cabinet -sydney - -// symantec : 2014-12-04 Symantec Corporation -symantec - -// systems : 2013-11-07 Dash Cypress, LLC -systems - -// tab : 2014-12-04 Tabcorp Holdings Limited -tab - -// taipei : 2014-07-10 Taipei City Government -taipei - -// talk : 2015-04-09 Amazon EU S.à r.l. -talk - -// taobao : 2015-01-15 Alibaba Group Holding Limited -taobao - -// tatamotors : 2015-03-12 Tata Motors Ltd -tatamotors - -// tatar : 2014-04-24 Limited Liability Company "Coordination Center of Regional Domain of Tatarstan Republic" -tatar - -// tattoo : 2013-08-30 Uniregistry, Corp. -tattoo - -// tax : 2014-03-20 Storm Orchard, LLC -tax - -// taxi : 2015-03-19 Pine Falls, LLC -taxi - -// tci : 2014-09-12 Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. -tci - -// team : 2015-03-05 Atomic Lake, LLC -team - -// tech : 2015-01-30 Dot Tech LLC -tech - -// technology : 2013-09-13 Auburn Falls -technology - -// telecity : 2015-02-19 TelecityGroup International Limited -telecity - -// telefonica : 2014-10-16 Telefónica S.A. -telefonica - -// temasek : 2014-08-07 Temasek Holdings (Private) Limited -temasek - -// tennis : 2014-12-04 Cotton Bloom, LLC -tennis - -// thd : 2015-04-02 Homer TLC, Inc. -thd - -// theater : 2015-03-19 Blue Tigers, LLC -theater - -// theguardian : 2015-04-30 Guardian News and Media Limited -theguardian - -// tickets : 2015-02-05 Accent Media Limited -tickets - -// tienda : 2013-11-14 Victor Manor, LLC -tienda - -// tiffany : 2015-01-30 Tiffany and Company -tiffany - -// tips : 2013-09-20 Corn Willow, LLC -tips - -// tires : 2014-11-07 Dog Edge, LLC -tires - -// tirol : 2014-04-24 punkt Tirol GmbH -tirol - -// tmall : 2015-01-15 Alibaba Group Holding Limited -tmall - -// today : 2013-09-20 Pearl Woods, LLC -today - -// tokyo : 2013-11-13 GMO Registry, Inc. -tokyo - -// tools : 2013-11-21 Pioneer North, LLC -tools - -// top : 2014-03-20 Jiangsu Bangning Science & Technology Co.,Ltd. -top - -// toray : 2014-12-18 Toray Industries, Inc. -toray - -// toshiba : 2014-04-10 TOSHIBA Corporation -toshiba - -// tours : 2015-01-22 Sugar Station, LLC -tours - -// town : 2014-03-06 Koko Moon, LLC -town - -// toyota : 2015-04-23 TOYOTA MOTOR CORPORATION -toyota - -// toys : 2014-03-06 Pioneer Orchard, LLC -toys - -// trade : 2014-01-23 Elite Registry Limited -trade - -// trading : 2014-12-11 IG Group Holdings PLC -trading - -// training : 2013-11-07 Wild Willow, LLC -training - -// travelers : 2015-03-26 Travelers TLD, LLC -travelers - -// travelersinsurance : 2015-03-26 Travelers TLD, LLC -travelersinsurance - -// trust : 2014-10-16 -trust - -// trv : 2015-03-26 Travelers TLD, LLC -trv - -// tui : 2014-07-03 TUI AG -tui - -// tunes : 2015-02-26 Amazon EU S.à r.l. -tunes - -// tushu : 2014-12-18 Amazon EU S.à r.l. -tushu - -// tvs : 2015-02-19 T V SUNDRAM IYENGAR & SONS LIMITED -tvs - -// ubs : 2014-12-11 UBS AG -ubs - -// university : 2014-03-06 Little Station, LLC -university - -// uno : 2013-09-11 Dot Latin LLC -uno - -// uol : 2014-05-01 UBN INTERNET LTDA. -uol - -// vacations : 2013-12-05 Atomic Tigers, LLC -vacations - -// vana : 2014-12-11 Lifestyle Domain Holdings, Inc. -vana - -// vegas : 2014-01-16 Dot Vegas, Inc. -vegas - -// ventures : 2013-08-27 Binky Lake, LLC -ventures - -// versicherung : 2014-03-20 dotversicherung-registry GmbH -versicherung - -// vet : 2014-03-06 -vet - -// viajes : 2013-10-17 Black Madison, LLC -viajes - -// video : 2014-10-16 -video - -// viking : 2015-04-02 Viking River Cruises (Bermuda) Ltd. -viking - -// villas : 2013-12-05 New Sky, LLC -villas - -// vip : 2015-01-22 Minds + Machines Group Limited -vip - -// virgin : 2014-09-25 Virgin Enterprises Limited -virgin - -// vision : 2013-12-05 Koko Station, LLC -vision - -// vista : 2014-09-18 Vistaprint Limited -vista - -// vistaprint : 2014-09-18 Vistaprint Limited -vistaprint - -// viva : 2014-11-07 Saudi Telecom Company -viva - -// vlaanderen : 2014-02-06 DNS.be vzw -vlaanderen - -// vodka : 2013-12-19 Top Level Domain Holdings Limited -vodka - -// vote : 2013-11-21 Monolith Registry LLC -vote - -// voting : 2013-11-13 Valuetainment Corp. -voting - -// voto : 2013-11-21 Monolith Registry LLC -voto - -// voyage : 2013-08-27 Ruby House, LLC -voyage - -// vuelos : 2015-03-05 Travel Reservations SRL -vuelos - -// wales : 2014-05-08 Nominet UK -wales - -// walter : 2014-11-13 Sandvik AB -walter - -// wang : 2013-10-24 Zodiac Leo Limited -wang - -// wanggou : 2014-12-18 Amazon EU S.à r.l. -wanggou - -// watch : 2013-11-14 Sand Shadow, LLC -watch - -// watches : 2014-12-22 Richemont DNS Inc. -watches - -// weather : 2015-01-08 The Weather Channel, LLC -weather - -// weatherchannel : 2015-03-12 The Weather Channel, LLC -weatherchannel - -// webcam : 2014-01-23 dot Webcam Limited -webcam - -// website : 2014-04-03 DotWebsite Inc. -website - -// wed : 2013-10-01 Atgron, Inc. -wed - -// wedding : 2014-04-24 Top Level Domain Holdings Limited -wedding - -// weibo : 2015-03-05 Sina Corporation -weibo - -// weir : 2015-01-29 Weir Group IP Limited -weir - -// whoswho : 2014-02-20 Who's Who Registry -whoswho - -// wien : 2013-10-28 punkt.wien GmbH -wien - -// wiki : 2013-11-07 Top Level Design, LLC -wiki - -// williamhill : 2014-03-13 William Hill Organization Limited -williamhill - -// win : 2014-11-20 First Registry Limited -win - -// windows : 2014-12-18 Microsoft Corporation -windows - -// wme : 2014-02-13 William Morris Endeavor Entertainment, LLC -wme - -// work : 2013-12-19 Top Level Domain Holdings Limited -work - -// works : 2013-11-14 Little Dynamite, LLC -works - -// world : 2014-06-12 Bitter Fields, LLC -world - -// wtc : 2013-12-19 World Trade Centers Association, Inc. -wtc - -// wtf : 2014-03-06 Hidden Way, LLC -wtf - -// xbox : 2014-12-18 Microsoft Corporation -xbox - -// xerox : 2014-10-24 Xerox DNHC LLC -xerox - -// xihuan : 2015-01-08 QIHOO 360 TECHNOLOGY CO. LTD. -xihuan - -// xin : 2014-12-11 Elegant Leader Limited -xin - -// xn--11b4c3d : 2015-01-15 VeriSign Sarl -कॉम - -// xn--1ck2e1b : 2015-02-26 Amazon EU S.à r.l. -セール - -// xn--1qqw23a : 2014-01-09 Guangzhou YU Wei Information Technology Co., Ltd. -佛山 - -// xn--30rr7y : 2014-06-12 Excellent First Limited -慈善 - -// xn--3bst00m : 2013-09-13 Eagle Horizon Limited -集团 - -// xn--3ds443g : 2013-09-08 TLD REGISTRY LIMITED -在线 - -// xn--3pxu8k : 2015-01-15 VeriSign Sarl -点看 - -// xn--42c2d9a : 2015-01-15 VeriSign Sarl -คอม - -// xn--45q11c : 2013-11-21 Zodiac Scorpio Limited -八卦 - -// xn--4gbrim : 2013-10-04 Suhub Electronic Establishment -موقع - -// xn--55qw42g : 2013-11-08 China Organizational Name Administration Center -公益 - -// xn--55qx5d : 2013-11-14 Computer Network Information Center of Chinese Academy of Sciences (China Internet Network Information Center) -公司 - -// xn--5tzm5g : 2014-12-22 Global Website TLD Asia Limited -网站 - -// xn--6frz82g : 2013-09-23 Afilias Limited -移动 - -// xn--6qq986b3xl : 2013-09-13 Tycoon Treasure Limited -我爱你 - -// xn--80adxhks : 2013-12-19 Foundation for Assistance for Internet Technologies and Infrastructure Development (FAITID) -москва - -// xn--80asehdb : 2013-07-14 CORE Association -онлайн - -// xn--80aswg : 2013-07-14 CORE Association -сайт - -// xn--8y0a063a : 2015-03-26 China United Network Communications Corporation Limited -联通 - -// xn--9dbq2a : 2015-01-15 VeriSign Sarl -קום - -// xn--9et52u : 2014-06-12 RISE VICTORY LIMITED -时尚 - -// xn--9krt00a : 2015-03-12 Sina Corporation -微博 - -// xn--b4w605ferd : 2014-08-07 Temasek Holdings (Private) Limited -淡马锡 - -// xn--bck1b9a5dre4c : 2015-02-26 Amazon EU S.à r.l. -ファッション - -// xn--c1avg : 2013-11-14 Public Interest Registry -орг - -// xn--c2br7g : 2015-01-15 VeriSign Sarl -नेट - -// xn--cck2b3b : 2015-02-26 Amazon EU S.à r.l. -ストア - -// xn--cg4bki : 2013-09-27 SAMSUNG SDS CO., LTD -삼성 - -// xn--czr694b : 2014-01-16 HU YI GLOBAL INFORMATION RESOURCES (HOLDING) COMPANY.HONGKONG LIMITED -商标 - -// xn--czrs0t : 2013-12-19 Wild Island, LLC -商店 - -// xn--czru2d : 2013-11-21 Zodiac Capricorn Limited -商城 - -// xn--d1acj3b : 2013-11-20 The Foundation for Network Initiatives “The Smart Internet” -дети - -// xn--eckvdtc9d : 2014-12-18 Amazon EU S.à r.l. -ポイント - -// xn--efvy88h : 2014-08-22 Xinhua News Agency Guangdong Branch 新华通讯社广东分社 -新闻 - -// xn--estv75g : 2015-02-19 Industrial and Commercial Bank of China Limited -工行 - -// xn--fct429k : 2015-04-09 Amazon EU S.à r.l. -家電 - -// xn--fhbei : 2015-01-15 VeriSign Sarl -كوم - -// xn--fiq228c5hs : 2013-09-08 TLD REGISTRY LIMITED -中文网 - -// xn--fiq64b : 2013-10-14 CITIC Group Corporation -中信 - -// xn--fjq720a : 2014-05-22 Will Bloom, LLC -娱乐 - -// xn--flw351e : 2014-07-31 Charleston Road Registry Inc. -谷歌 - -// xn--g2xx48c : 2015-01-30 Minds + Machines Group Limited -购物 - -// xn--gckr3f0f : 2015-02-26 Amazon EU S.à r.l. -クラウド - -// xn--hxt814e : 2014-05-15 Zodiac Libra Limited -网店 - -// xn--i1b6b1a6a2e : 2013-11-14 Public Interest Registry -संगठन - -// xn--imr513n : 2014-12-11 HU YI GLOBAL INFORMATION RESOURCES (HOLDING) COMPANY. HONGKONG LIMITED -餐厅 - -// xn--io0a7i : 2013-11-14 Computer Network Information Center of Chinese Academy of Sciences (China Internet Network Information Center) -网络 - -// xn--j1aef : 2015-01-15 VeriSign Sarl -ком - -// xn--jlq61u9w7b : 2015-01-08 Nokia Corporation -诺基亚 - -// xn--jvr189m : 2015-02-26 Amazon EU S.à r.l. -食品 - -// xn--kcrx77d1x4a : 2014-11-07 Koninklijke Philips N.V. -飞利浦 - -// xn--kpu716f : 2014-12-22 Richemont DNS Inc. -手表 - -// xn--kput3i : 2014-02-13 Beijing RITT-Net Technology Development Co., Ltd -手机 - -// xn--mgba3a3ejt : 2014-11-20 Aramco Services Company -ارامكو - -// xn--mgbab2bd : 2013-10-31 CORE Association -بازار - -// xn--mgbb9fbpob : 2014-12-18 GreenTech Consultancy Company W.L.L. -موبايلي - -// xn--mgbt3dhd : 2014-09-04 Asia Green IT System Bilgisayar San. ve Tic. Ltd. Sti. -همراه - -// xn--mk1bu44c : 2015-01-15 VeriSign Sarl -닷컴 - -// xn--mxtq1m : 2014-03-06 Net-Chinese Co., Ltd. -政府 - -// xn--ngbc5azd : 2013-07-13 International Domain Registry Pty. Ltd. -شبكة - -// xn--ngbe9e0a : 2014-12-04 Kuwait Finance House -بيتك - -// xn--nqv7f : 2013-11-14 Public Interest Registry -机构 - -// xn--nqv7fs00ema : 2013-11-14 Public Interest Registry -组织机构 - -// xn--nyqy26a : 2014-11-07 Stable Tone Limited -健康 - -// xn--p1acf : 2013-12-12 Rusnames Limited -рус - -// xn--pbt977c : 2014-12-22 Richemont DNS Inc. -珠宝 - -// xn--pssy2u : 2015-01-15 VeriSign Sarl -大拿 - -// xn--q9jyb4c : 2013-09-17 Charleston Road Registry Inc. -みんな - -// xn--qcka1pmc : 2014-07-31 Charleston Road Registry Inc. -グーグル - -// xn--rhqv96g : 2013-09-11 Stable Tone Limited -世界 - -// xn--rovu88b : 2015-02-26 Amazon EU S.à r.l. -書籍 - -// xn--ses554g : 2014-01-16 -网址 - -// xn--t60b56a : 2015-01-15 VeriSign Sarl -닷넷 - -// xn--tckwe : 2015-01-15 VeriSign Sarl -コム - -// xn--unup4y : 2013-07-14 Spring Fields, LLC -游戏 - -// xn--vermgensberater-ctb : 2014-06-23 Deutsche Vermögensberatung Aktiengesellschaft DVAG -vermögensberater - -// xn--vermgensberatung-pwb : 2014-06-23 Deutsche Vermögensberatung Aktiengesellschaft DVAG -vermögensberatung - -// xn--vhquv : 2013-08-27 Dash McCook, LLC -企业 - -// xn--vuq861b : 2014-10-16 Beijing Tele-info Network Technology Co., Ltd. -信息 - -// xn--w4r85el8fhu5dnra : 2015-04-30 Kerry Trading Co. Limited -嘉里大酒店 - -// xn--xhq521b : 2013-11-14 Guangzhou YU Wei Information Technology Co., Ltd. -广东 - -// xn--zfr164b : 2013-11-08 China Organizational Name Administration Center -政务 - -// xyz : 2013-12-05 XYZ.COM LLC -xyz - -// yachts : 2014-01-09 DERYachts, LLC -yachts - -// yahoo : 2015-04-02 Yahoo! Domain Services Inc. -yahoo - -// yamaxun : 2014-12-18 Amazon EU S.à r.l. -yamaxun - -// yandex : 2014-04-10 YANDEX, LLC -yandex - -// yodobashi : 2014-11-20 YODOBASHI CAMERA CO.,LTD. -yodobashi - -// yoga : 2014-05-29 Top Level Domain Holdings Limited -yoga - -// yokohama : 2013-12-12 GMO Registry, Inc. -yokohama - -// you : 2015-04-09 Amazon EU S.à r.l. -you - -// youtube : 2014-05-01 Charleston Road Registry Inc. -youtube - -// yun : 2015-01-08 QIHOO 360 TECHNOLOGY CO. LTD. -yun - -// zara : 2014-11-07 Industria de Diseño Textil, S.A. (INDITEX, S.A.) -zara - -// zero : 2014-12-18 Amazon EU S.à r.l. -zero - -// zip : 2014-05-08 Charleston Road Registry Inc. -zip - -// zone : 2013-11-14 Outer Falls, LLC -zone - -// zuerich : 2014-11-07 Kanton Zürich (Canton of Zurich) -zuerich - - -// ===END ICANN DOMAINS=== -// ===BEGIN PRIVATE DOMAINS=== -// (Note: these are in alphabetical order by company name) - -// Amazon CloudFront : https://aws.amazon.com/cloudfront/ -// Submitted by Donavan Miller 2013-03-22 -cloudfront.net - -// Amazon Elastic Compute Cloud: https://aws.amazon.com/ec2/ -// Submitted by Osman Surkatty 2014-12-16 -ap-northeast-1.compute.amazonaws.com -ap-southeast-1.compute.amazonaws.com -ap-southeast-2.compute.amazonaws.com -cn-north-1.compute.amazonaws.cn -compute.amazonaws.cn -compute.amazonaws.com -compute-1.amazonaws.com -eu-west-1.compute.amazonaws.com -eu-central-1.compute.amazonaws.com -sa-east-1.compute.amazonaws.com -us-east-1.amazonaws.com -us-gov-west-1.compute.amazonaws.com -us-west-1.compute.amazonaws.com -us-west-2.compute.amazonaws.com -z-1.compute-1.amazonaws.com -z-2.compute-1.amazonaws.com - -// Amazon Elastic Beanstalk : https://aws.amazon.com/elasticbeanstalk/ -// Submitted by Adam Stein 2013-04-02 -elasticbeanstalk.com - -// Amazon Elastic Load Balancing : https://aws.amazon.com/elasticloadbalancing/ -// Submitted by Scott Vidmar 2013-03-27 -elb.amazonaws.com - -// Amazon S3 : https://aws.amazon.com/s3/ -// Submitted by Courtney Eckhardt 2013-03-22 -s3.amazonaws.com -s3-us-west-2.amazonaws.com -s3-us-west-1.amazonaws.com -s3-eu-west-1.amazonaws.com -s3-ap-southeast-1.amazonaws.com -s3-ap-southeast-2.amazonaws.com -s3-ap-northeast-1.amazonaws.com -s3-sa-east-1.amazonaws.com -s3-us-gov-west-1.amazonaws.com -s3-fips-us-gov-west-1.amazonaws.com -s3-website-us-east-1.amazonaws.com -s3-website-us-west-2.amazonaws.com -s3-website-us-west-1.amazonaws.com -s3-website-eu-west-1.amazonaws.com -s3-website-ap-southeast-1.amazonaws.com -s3-website-ap-southeast-2.amazonaws.com -s3-website-ap-northeast-1.amazonaws.com -s3-website-sa-east-1.amazonaws.com -s3-website-us-gov-west-1.amazonaws.com - -// BetaInABox -// Submitted by adrian@betainabox.com 2012-09-13 -betainabox.com - -// CentralNic : http://www.centralnic.com/names/domains -// Submitted by registry 2012-09-27 -ae.org -ar.com -br.com -cn.com -com.de -com.se -de.com -eu.com -gb.com -gb.net -hu.com -hu.net -jp.net -jpn.com -kr.com -mex.com -no.com -qc.com -ru.com -sa.com -se.com -se.net -uk.com -uk.net -us.com -uy.com -za.bz -za.com - -// Africa.com Web Solutions Ltd : https://registry.africa.com -// Submitted by Gavin Brown 2014-02-04 -africa.com - -// iDOT Services Limited : http://www.domain.gr.com -// Submitted by Gavin Brown 2014-02-04 -gr.com - -// Radix FZC : http://domains.in.net -// Submitted by Gavin Brown 2014-02-04 -in.net - -// US REGISTRY LLC : http://us.org -// Submitted by Gavin Brown 2014-02-04 -us.org - -// co.com Registry, LLC : https://registry.co.com -// Submitted by Gavin Brown 2014-02-04 -co.com - -// c.la : http://www.c.la/ -c.la - -// cloudControl : https://www.cloudcontrol.com/ -// Submitted by Tobias Wilken 2013-07-23 -cloudcontrolled.com -cloudcontrolapp.com - -// co.ca : http://registry.co.ca/ -co.ca - -// CoDNS B.V. -co.nl -co.no - -// Commerce Guys, SAS -// Submitted by Damien Tournoud 2015-01-22 -*.platform.sh - -// Cupcake : https://cupcake.io/ -// Submitted by Jonathan Rudenberg 2013-10-08 -cupcake.is - -// DreamHost : http://www.dreamhost.com/ -// Submitted by Andrew Farmer 2012-10-02 -dreamhosters.com - -// DynDNS.com : http://www.dyndns.com/services/dns/dyndns/ -dyndns-at-home.com -dyndns-at-work.com -dyndns-blog.com -dyndns-free.com -dyndns-home.com -dyndns-ip.com -dyndns-mail.com -dyndns-office.com -dyndns-pics.com -dyndns-remote.com -dyndns-server.com -dyndns-web.com -dyndns-wiki.com -dyndns-work.com -dyndns.biz -dyndns.info -dyndns.org -dyndns.tv -at-band-camp.net -ath.cx -barrel-of-knowledge.info -barrell-of-knowledge.info -better-than.tv -blogdns.com -blogdns.net -blogdns.org -blogsite.org -boldlygoingnowhere.org -broke-it.net -buyshouses.net -cechire.com -dnsalias.com -dnsalias.net -dnsalias.org -dnsdojo.com -dnsdojo.net -dnsdojo.org -does-it.net -doesntexist.com -doesntexist.org -dontexist.com -dontexist.net -dontexist.org -doomdns.com -doomdns.org -dvrdns.org -dyn-o-saur.com -dynalias.com -dynalias.net -dynalias.org -dynathome.net -dyndns.ws -endofinternet.net -endofinternet.org -endoftheinternet.org -est-a-la-maison.com -est-a-la-masion.com -est-le-patron.com -est-mon-blogueur.com -for-better.biz -for-more.biz -for-our.info -for-some.biz -for-the.biz -forgot.her.name -forgot.his.name -from-ak.com -from-al.com -from-ar.com -from-az.net -from-ca.com -from-co.net -from-ct.com -from-dc.com -from-de.com -from-fl.com -from-ga.com -from-hi.com -from-ia.com -from-id.com -from-il.com -from-in.com -from-ks.com -from-ky.com -from-la.net -from-ma.com -from-md.com -from-me.org -from-mi.com -from-mn.com -from-mo.com -from-ms.com -from-mt.com -from-nc.com -from-nd.com -from-ne.com -from-nh.com -from-nj.com -from-nm.com -from-nv.com -from-ny.net -from-oh.com -from-ok.com -from-or.com -from-pa.com -from-pr.com -from-ri.com -from-sc.com -from-sd.com -from-tn.com -from-tx.com -from-ut.com -from-va.com -from-vt.com -from-wa.com -from-wi.com -from-wv.com -from-wy.com -ftpaccess.cc -fuettertdasnetz.de -game-host.org -game-server.cc -getmyip.com -gets-it.net -go.dyndns.org -gotdns.com -gotdns.org -groks-the.info -groks-this.info -ham-radio-op.net -here-for-more.info -hobby-site.com -hobby-site.org -home.dyndns.org -homedns.org -homeftp.net -homeftp.org -homeip.net -homelinux.com -homelinux.net -homelinux.org -homeunix.com -homeunix.net -homeunix.org -iamallama.com -in-the-band.net -is-a-anarchist.com -is-a-blogger.com -is-a-bookkeeper.com -is-a-bruinsfan.org -is-a-bulls-fan.com -is-a-candidate.org -is-a-caterer.com -is-a-celticsfan.org -is-a-chef.com -is-a-chef.net -is-a-chef.org -is-a-conservative.com -is-a-cpa.com -is-a-cubicle-slave.com -is-a-democrat.com -is-a-designer.com -is-a-doctor.com -is-a-financialadvisor.com -is-a-geek.com -is-a-geek.net -is-a-geek.org -is-a-green.com -is-a-guru.com -is-a-hard-worker.com -is-a-hunter.com -is-a-knight.org -is-a-landscaper.com -is-a-lawyer.com -is-a-liberal.com -is-a-libertarian.com -is-a-linux-user.org -is-a-llama.com -is-a-musician.com -is-a-nascarfan.com -is-a-nurse.com -is-a-painter.com -is-a-patsfan.org -is-a-personaltrainer.com -is-a-photographer.com -is-a-player.com -is-a-republican.com -is-a-rockstar.com -is-a-socialist.com -is-a-soxfan.org -is-a-student.com -is-a-teacher.com -is-a-techie.com -is-a-therapist.com -is-an-accountant.com -is-an-actor.com -is-an-actress.com -is-an-anarchist.com -is-an-artist.com -is-an-engineer.com -is-an-entertainer.com -is-by.us -is-certified.com -is-found.org -is-gone.com -is-into-anime.com -is-into-cars.com -is-into-cartoons.com -is-into-games.com -is-leet.com -is-lost.org -is-not-certified.com -is-saved.org -is-slick.com -is-uberleet.com -is-very-bad.org -is-very-evil.org -is-very-good.org -is-very-nice.org -is-very-sweet.org -is-with-theband.com -isa-geek.com -isa-geek.net -isa-geek.org -isa-hockeynut.com -issmarterthanyou.com -isteingeek.de -istmein.de -kicks-ass.net -kicks-ass.org -knowsitall.info -land-4-sale.us -lebtimnetz.de -leitungsen.de -likes-pie.com -likescandy.com -merseine.nu -mine.nu -misconfused.org -mypets.ws -myphotos.cc -neat-url.com -office-on-the.net -on-the-web.tv -podzone.net -podzone.org -readmyblog.org -saves-the-whales.com -scrapper-site.net -scrapping.cc -selfip.biz -selfip.com -selfip.info -selfip.net -selfip.org -sells-for-less.com -sells-for-u.com -sells-it.net -sellsyourhome.org -servebbs.com -servebbs.net -servebbs.org -serveftp.net -serveftp.org -servegame.org -shacknet.nu -simple-url.com -space-to-rent.com -stuff-4-sale.org -stuff-4-sale.us -teaches-yoga.com -thruhere.net -traeumtgerade.de -webhop.biz -webhop.info -webhop.net -webhop.org -worse-than.tv -writesthisblog.com - -// EU.org https://eu.org/ -// Submitted by Pierre Beyssac 2015-04-17 - -eu.org -al.eu.org -asso.eu.org -at.eu.org -au.eu.org -be.eu.org -bg.eu.org -ca.eu.org -cd.eu.org -ch.eu.org -cn.eu.org -cy.eu.org -cz.eu.org -de.eu.org -dk.eu.org -edu.eu.org -ee.eu.org -es.eu.org -fi.eu.org -fr.eu.org -gr.eu.org -hr.eu.org -hu.eu.org -ie.eu.org -il.eu.org -in.eu.org -int.eu.org -is.eu.org -it.eu.org -jp.eu.org -kr.eu.org -lt.eu.org -lu.eu.org -lv.eu.org -mc.eu.org -me.eu.org -mk.eu.org -mt.eu.org -my.eu.org -net.eu.org -ng.eu.org -nl.eu.org -no.eu.org -nz.eu.org -paris.eu.org -pl.eu.org -pt.eu.org -q-a.eu.org -ro.eu.org -ru.eu.org -se.eu.org -si.eu.org -sk.eu.org -tr.eu.org -uk.eu.org -us.eu.org - -// Fastly Inc. http://www.fastly.com/ -// Submitted by Vladimir Vuksan 2013-05-31 -a.ssl.fastly.net -b.ssl.fastly.net -global.ssl.fastly.net -a.prod.fastly.net -global.prod.fastly.net - -// Firebase, Inc. -// Submitted by Chris Raynor 2014-01-21 -firebaseapp.com - -// Flynn : https://flynn.io -// Submitted by Jonathan Rudenberg 2014-07-12 -flynnhub.com - -// GDS : https://www.gov.uk/service-manual/operations/operating-servicegovuk-subdomains -// Submitted by David Illsley 2014-08-28 -service.gov.uk - -// GitHub, Inc. -// Submitted by Ben Toews 2014-02-06 -github.io -githubusercontent.com - -// GlobeHosting, Inc. -// Submitted by Zoltan Egresi 2013-07-12 -ro.com - -// Google, Inc. -// Submitted by Eduardo Vela 2014-12-19 -appspot.com -blogspot.ae -blogspot.be -blogspot.bj -blogspot.ca -blogspot.cf -blogspot.ch -blogspot.co.at -blogspot.co.il -blogspot.co.nz -blogspot.co.uk -blogspot.com -blogspot.com.ar -blogspot.com.au -blogspot.com.br -blogspot.com.es -blogspot.com.tr -blogspot.cv -blogspot.cz -blogspot.de -blogspot.dk -blogspot.fi -blogspot.fr -blogspot.gr -blogspot.hk -blogspot.hu -blogspot.ie -blogspot.in -blogspot.it -blogspot.jp -blogspot.kr -blogspot.mr -blogspot.mx -blogspot.nl -blogspot.no -blogspot.pt -blogspot.re -blogspot.ro -blogspot.ru -blogspot.se -blogspot.sg -blogspot.sk -blogspot.td -blogspot.tw -codespot.com -googleapis.com -googlecode.com -pagespeedmobilizer.com -withgoogle.com - -// Heroku : https://www.heroku.com/ -// Submitted by Tom Maher 2013-05-02 -herokuapp.com -herokussl.com - -// iki.fi -// Submitted by Hannu Aronsson 2009-11-05 -iki.fi - -// info.at : http://www.info.at/ -biz.at -info.at - -// Michau Enterprises Limited : http://www.co.pl/ -co.pl - -// Microsoft : http://microsoft.com -// Submitted by Barry Dorrans 2014-01-24 -azurewebsites.net -azure-mobile.net -cloudapp.net - -// Neustar Inc. -// Submitted by Trung Tran 2015-04-23 -4u.com - -// NFSN, Inc. : https://www.NearlyFreeSpeech.NET/ -// Submitted by Jeff Wheelhouse 2014-02-02 -nfshost.com - -// NYC.mn : http://www.information.nyc.mn -// Submitted by Matthew Brown 2013-03-11 -nyc.mn - -// One Fold Media : http://www.onefoldmedia.com/ -// Submitted by Eddie Jones 2014-06-10 -nid.io - -// Opera Software, A.S.A. -// Submitted by Yngve Pettersen 2009-11-26 -operaunite.com - -// OutSystems -// Submitted by Duarte Santos 2014-03-11 -outsystemscloud.com - -// .pl domains (grandfathered) -art.pl -gliwice.pl -krakow.pl -poznan.pl -wroc.pl -zakopane.pl - -// priv.at : http://www.nic.priv.at/ -// Submitted by registry 2008-06-09 -priv.at - -// Red Hat, Inc. OpenShift : https://openshift.redhat.com/ -// Submitted by Tim Kramer 2012-10-24 -rhcloud.com - -// SinaAppEngine : http://sae.sina.com.cn/ -// Submitted by SinaAppEngine 2015-02-02 -sinaapp.com -vipsinaapp.com -1kapp.com - -// TASK geographical domains (www.task.gda.pl/uslugi/dns) -gda.pl -gdansk.pl -gdynia.pl -med.pl -sopot.pl - -// UDR Limited : http://www.udr.hk.com -// Submitted by registry 2014-11-07 -hk.com -hk.org -ltd.hk -inc.hk - -// Yola : https://www.yola.com/ -// Submitted by Stefano Rivera 2014-07-09 -yolasite.com - -// ZaNiC : http://www.za.net/ -// Submitted by registry 2009-10-03 -za.net -za.org - -// ===END PRIVATE DOMAINS=== diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/test/api_test.js b/deps/npm/node_modules/request/node_modules/tough-cookie/test/api_test.js deleted file mode 100644 index b21326cdf0efcf..00000000000000 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/test/api_test.js +++ /dev/null @@ -1,372 +0,0 @@ -/*! - * Copyright (c) 2015, Salesforce.com, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Salesforce.com nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -'use strict'; -var vows = require('vows'); -var assert = require('assert'); -var async = require('async'); -var tough = require('../lib/cookie'); -var Cookie = tough.Cookie; -var CookieJar = tough.CookieJar; - - -var atNow = Date.now(); - -function at(offset) { - return {now: new Date(atNow + offset)}; -} - -vows - .describe('API') - .addBatch({ - "All defined": function () { - assert.ok(Cookie); - assert.ok(CookieJar); - } - }) - .addBatch({ - "Constructor": { - topic: function () { - return new Cookie({ - key: 'test', - value: 'b', - maxAge: 60 - }); - }, - 'check for key property': function (c) { - assert.ok(c); - assert.equal(c.key, 'test'); - }, - 'check for value property': function (c) { - assert.equal(c.value, 'b'); - }, - 'check for maxAge': function (c) { - assert.equal(c.maxAge, 60); - }, - 'check for default values for unspecified properties': function (c) { - assert.equal(c.expires, "Infinity"); - assert.equal(c.secure, false); - assert.equal(c.httpOnly, false); - } - } - }) - .addBatch({ - "expiry option": { - topic: function () { - var cb = this.callback; - var cj = new CookieJar(); - cj.setCookie('near=expiry; Domain=example.com; Path=/; Max-Age=1', 'http://www.example.com', at(-1), function (err, cookie) { - - cb(err, {cj: cj, cookie: cookie}); - }); - }, - "set the cookie": function (t) { - assert.ok(t.cookie, "didn't set?!"); - assert.equal(t.cookie.key, 'near'); - }, - "then, retrieving": { - topic: function (t) { - var cb = this.callback; - setTimeout(function () { - t.cj.getCookies('http://www.example.com', {http: true, expire: false}, function (err, cookies) { - t.cookies = cookies; - cb(err, t); - }); - }, 2000); - }, - "got the cookie": function (t) { - assert.lengthOf(t.cookies, 1); - assert.equal(t.cookies[0].key, 'near'); - } - } - } - }) - .addBatch({ - "allPaths option": { - topic: function () { - var cj = new CookieJar(); - var tasks = []; - tasks.push(cj.setCookie.bind(cj, 'nopath_dom=qq; Path=/; Domain=example.com', 'http://example.com', {})); - tasks.push(cj.setCookie.bind(cj, 'path_dom=qq; Path=/foo; Domain=example.com', 'http://example.com', {})); - tasks.push(cj.setCookie.bind(cj, 'nopath_host=qq; Path=/', 'http://www.example.com', {})); - tasks.push(cj.setCookie.bind(cj, 'path_host=qq; Path=/foo', 'http://www.example.com', {})); - tasks.push(cj.setCookie.bind(cj, 'other=qq; Path=/', 'http://other.example.com/', {})); - tasks.push(cj.setCookie.bind(cj, 'other2=qq; Path=/foo', 'http://other.example.com/foo', {})); - var cb = this.callback; - async.parallel(tasks, function (err, results) { - cb(err, {cj: cj, cookies: results}); - }); - }, - "all set": function (t) { - assert.equal(t.cookies.length, 6); - assert.ok(t.cookies.every(function (c) { - return !!c - })); - }, - "getting without allPaths": { - topic: function (t) { - var cb = this.callback; - var cj = t.cj; - cj.getCookies('http://www.example.com/', {}, function (err, cookies) { - cb(err, {cj: cj, cookies: cookies}); - }); - }, - "found just two cookies": function (t) { - assert.equal(t.cookies.length, 2); - }, - "all are path=/": function (t) { - assert.ok(t.cookies.every(function (c) { - return c.path === '/' - })); - }, - "no 'other' cookies": function (t) { - assert.ok(!t.cookies.some(function (c) { - return (/^other/).test(c.name) - })); - } - }, - "getting without allPaths for /foo": { - topic: function (t) { - var cb = this.callback; - var cj = t.cj; - cj.getCookies('http://www.example.com/foo', {}, function (err, cookies) { - cb(err, {cj: cj, cookies: cookies}); - }); - }, - "found four cookies": function (t) { - assert.equal(t.cookies.length, 4); - }, - "no 'other' cookies": function (t) { - assert.ok(!t.cookies.some(function (c) { - return (/^other/).test(c.name) - })); - } - }, - "getting with allPaths:true": { - topic: function (t) { - var cb = this.callback; - var cj = t.cj; - cj.getCookies('http://www.example.com/', {allPaths: true}, function (err, cookies) { - cb(err, {cj: cj, cookies: cookies}); - }); - }, - "found four cookies": function (t) { - assert.equal(t.cookies.length, 4); - }, - "no 'other' cookies": function (t) { - assert.ok(!t.cookies.some(function (c) { - return (/^other/).test(c.name) - })); - } - } - } - }) - .addBatch({ - "Remove cookies": { - topic: function () { - var jar = new CookieJar(); - var cookie = Cookie.parse("a=b; Domain=example.com; Path=/"); - var cookie2 = Cookie.parse("a=b; Domain=foo.com; Path=/"); - var cookie3 = Cookie.parse("foo=bar; Domain=foo.com; Path=/"); - jar.setCookie(cookie, 'http://example.com/index.html', function () { - }); - jar.setCookie(cookie2, 'http://foo.com/index.html', function () { - }); - jar.setCookie(cookie3, 'http://foo.com/index.html', function () { - }); - return jar; - }, - "all from matching domain": function (jar) { - jar.store.removeCookies('example.com', null, function (err) { - assert(err == null); - - jar.store.findCookies('example.com', null, function (err, cookies) { - assert(err == null); - assert(cookies != null); - assert(cookies.length === 0, 'cookie was not removed'); - }); - - jar.store.findCookies('foo.com', null, function (err, cookies) { - assert(err == null); - assert(cookies != null); - assert(cookies.length === 2, 'cookies should not have been removed'); - }); - }); - }, - "from cookie store matching domain and key": function (jar) { - jar.store.removeCookie('foo.com', '/', 'foo', function (err) { - assert(err == null); - - jar.store.findCookies('foo.com', null, function (err, cookies) { - assert(err == null); - assert(cookies != null); - assert(cookies.length === 1, 'cookie was not removed correctly'); - assert(cookies[0].key === 'a', 'wrong cookie was removed'); - }); - }); - } - } - }) - .addBatch({ - "Synchronous CookieJar": { - "setCookieSync": { - topic: function () { - var jar = new CookieJar(); - var cookie = Cookie.parse("a=b; Domain=example.com; Path=/"); - cookie = jar.setCookieSync(cookie, 'http://example.com/index.html'); - return cookie; - }, - "returns a copy of the cookie": function (cookie) { - assert.instanceOf(cookie, Cookie); - } - }, - "getCookiesSync": { - topic: function () { - var jar = new CookieJar(); - var url = 'http://example.com/index.html'; - jar.setCookieSync("a=b; Domain=example.com; Path=/", url); - jar.setCookieSync("c=d; Domain=example.com; Path=/", url); - return jar.getCookiesSync(url); - }, - "returns the cookie array": function (err, cookies) { - assert.ok(!err); - assert.ok(Array.isArray(cookies)); - assert.lengthOf(cookies, 2); - cookies.forEach(function (cookie) { - assert.instanceOf(cookie, Cookie); - }); - } - }, - - "getCookieStringSync": { - topic: function () { - var jar = new CookieJar(); - var url = 'http://example.com/index.html'; - jar.setCookieSync("a=b; Domain=example.com; Path=/", url); - jar.setCookieSync("c=d; Domain=example.com; Path=/", url); - return jar.getCookieStringSync(url); - }, - "returns the cookie header string": function (err, str) { - assert.ok(!err); - assert.typeOf(str, 'string'); - } - }, - - "getSetCookieStringsSync": { - topic: function () { - var jar = new CookieJar(); - var url = 'http://example.com/index.html'; - jar.setCookieSync("a=b; Domain=example.com; Path=/", url); - jar.setCookieSync("c=d; Domain=example.com; Path=/", url); - return jar.getSetCookieStringsSync(url); - }, - "returns the cookie header string": function (err, headers) { - assert.ok(!err); - assert.ok(Array.isArray(headers)); - assert.lengthOf(headers, 2); - headers.forEach(function (header) { - assert.typeOf(header, 'string'); - }); - } - } - } - }) - .addBatch({ - "Synchronous API on async CookieJar": { - topic: function () { - return new tough.Store(); - }, - "setCookieSync": { - topic: function (store) { - var jar = new CookieJar(store); - try { - jar.setCookieSync("a=b", 'http://example.com/index.html'); - return false; - } catch (e) { - return e; - } - }, - "fails": function (err) { - assert.instanceOf(err, Error); - assert.equal(err.message, - 'CookieJar store is not synchronous; use async API instead.'); - } - }, - "getCookiesSync": { - topic: function (store) { - var jar = new CookieJar(store); - try { - jar.getCookiesSync('http://example.com/index.html'); - return false; - } catch (e) { - return e; - } - }, - "fails": function (err) { - assert.instanceOf(err, Error); - assert.equal(err.message, - 'CookieJar store is not synchronous; use async API instead.'); - } - }, - "getCookieStringSync": { - topic: function (store) { - var jar = new CookieJar(store); - try { - jar.getCookieStringSync('http://example.com/index.html'); - return false; - } catch (e) { - return e; - } - }, - "fails": function (err) { - assert.instanceOf(err, Error); - assert.equal(err.message, - 'CookieJar store is not synchronous; use async API instead.'); - } - }, - "getSetCookieStringsSync": { - topic: function (store) { - var jar = new CookieJar(store); - try { - jar.getSetCookieStringsSync('http://example.com/index.html'); - return false; - } catch (e) { - return e; - } - }, - "fails": function (err) { - assert.instanceOf(err, Error); - assert.equal(err.message, - 'CookieJar store is not synchronous; use async API instead.'); - } - } - } - }) - .export(module); diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/test/cookie_jar_test.js b/deps/npm/node_modules/request/node_modules/tough-cookie/test/cookie_jar_test.js deleted file mode 100644 index 689407b0b17e8e..00000000000000 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/test/cookie_jar_test.js +++ /dev/null @@ -1,468 +0,0 @@ -/*! - * Copyright (c) 2015, Salesforce.com, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Salesforce.com nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -'use strict'; -var vows = require('vows'); -var assert = require('assert'); -var async = require('async'); -var tough = require('../lib/cookie'); -var Cookie = tough.Cookie; -var CookieJar = tough.CookieJar; - -var atNow = Date.now(); - -function at(offset) { - return {now: new Date(atNow + offset)}; -} - -vows - .describe('CookieJar') - .addBatch({ - "Setting a basic cookie": { - topic: function () { - var cj = new CookieJar(); - var c = Cookie.parse("a=b; Domain=example.com; Path=/"); - assert.strictEqual(c.hostOnly, null); - assert.instanceOf(c.creation, Date); - assert.strictEqual(c.lastAccessed, null); - c.creation = new Date(Date.now() - 10000); - cj.setCookie(c, 'http://example.com/index.html', this.callback); - }, - "works": function (c) { - assert.instanceOf(c, Cookie) - }, // C is for Cookie, good enough for me - "gets timestamped": function (c) { - assert.ok(c.creation); - assert.ok(Date.now() - c.creation.getTime() < 5000); // recently stamped - assert.ok(c.lastAccessed); - assert.equal(c.creation, c.lastAccessed); - assert.equal(c.TTL(), Infinity); - assert.ok(!c.isPersistent()); - } - }, - "Setting a no-path cookie": { - topic: function () { - var cj = new CookieJar(); - var c = Cookie.parse("a=b; Domain=example.com"); - assert.strictEqual(c.hostOnly, null); - assert.instanceOf(c.creation, Date); - assert.strictEqual(c.lastAccessed, null); - c.creation = new Date(Date.now() - 10000); - cj.setCookie(c, 'http://example.com/index.html', this.callback); - }, - "domain": function (c) { - assert.equal(c.domain, 'example.com') - }, - "path is /": function (c) { - assert.equal(c.path, '/') - }, - "path was derived": function (c) { - assert.strictEqual(c.pathIsDefault, true) - } - }, - "Setting a cookie already marked as host-only": { - topic: function () { - var cj = new CookieJar(); - var c = Cookie.parse("a=b; Domain=example.com"); - assert.strictEqual(c.hostOnly, null); - assert.instanceOf(c.creation, Date); - assert.strictEqual(c.lastAccessed, null); - c.creation = new Date(Date.now() - 10000); - c.hostOnly = true; - cj.setCookie(c, 'http://example.com/index.html', this.callback); - }, - "domain": function (c) { - assert.equal(c.domain, 'example.com') - }, - "still hostOnly": function (c) { - assert.strictEqual(c.hostOnly, true) - } - }, - "Setting a session cookie": { - topic: function () { - var cj = new CookieJar(); - var c = Cookie.parse("a=b"); - assert.strictEqual(c.path, null); - cj.setCookie(c, 'http://www.example.com/dir/index.html', this.callback); - }, - "works": function (c) { - assert.instanceOf(c, Cookie) - }, - "gets the domain": function (c) { - assert.equal(c.domain, 'www.example.com') - }, - "gets the default path": function (c) { - assert.equal(c.path, '/dir') - }, - "is 'hostOnly'": function (c) { - assert.ok(c.hostOnly) - } - }, - "Setting wrong domain cookie": { - topic: function () { - var cj = new CookieJar(); - var c = Cookie.parse("a=b; Domain=fooxample.com; Path=/"); - cj.setCookie(c, 'http://example.com/index.html', this.callback); - }, - "fails": function (err, c) { - assert.ok(err.message.match(/domain/i)); - assert.ok(!c); - } - }, - "Setting sub-domain cookie": { - topic: function () { - var cj = new CookieJar(); - var c = Cookie.parse("a=b; Domain=www.example.com; Path=/"); - cj.setCookie(c, 'http://example.com/index.html', this.callback); - }, - "fails": function (err, c) { - assert.ok(err.message.match(/domain/i)); - assert.ok(!c); - } - }, - "Setting super-domain cookie": { - topic: function () { - var cj = new CookieJar(); - var c = Cookie.parse("a=b; Domain=example.com; Path=/"); - cj.setCookie(c, 'http://www.app.example.com/index.html', this.callback); - }, - "success": function (err, c) { - assert.ok(!err); - assert.equal(c.domain, 'example.com'); - } - }, - "Setting a sub-path cookie on a super-domain": { - topic: function () { - var cj = new CookieJar(); - var c = Cookie.parse("a=b; Domain=example.com; Path=/subpath"); - assert.strictEqual(c.hostOnly, null); - assert.instanceOf(c.creation, Date); - assert.strictEqual(c.lastAccessed, null); - c.creation = new Date(Date.now() - 10000); - cj.setCookie(c, 'http://www.example.com/index.html', this.callback); - }, - "domain is super-domain": function (c) { - assert.equal(c.domain, 'example.com') - }, - "path is /subpath": function (c) { - assert.equal(c.path, '/subpath') - }, - "path was NOT derived": function (c) { - assert.strictEqual(c.pathIsDefault, null) - } - }, - "Setting HttpOnly cookie over non-HTTP API": { - topic: function () { - var cj = new CookieJar(); - var c = Cookie.parse("a=b; Domain=example.com; Path=/; HttpOnly"); - cj.setCookie(c, 'http://example.com/index.html', {http: false}, this.callback); - }, - "fails": function (err, c) { - assert.match(err.message, /HttpOnly/i); - assert.ok(!c); - } - } - }) - .addBatch({ - "Store eight cookies": { - topic: function () { - var cj = new CookieJar(); - var ex = 'http://example.com/index.html'; - var tasks = []; - tasks.push(function (next) { - cj.setCookie('a=1; Domain=example.com; Path=/', ex, at(0), next); - }); - tasks.push(function (next) { - cj.setCookie('b=2; Domain=example.com; Path=/; HttpOnly', ex, at(1000), next); - }); - tasks.push(function (next) { - cj.setCookie('c=3; Domain=example.com; Path=/; Secure', ex, at(2000), next); - }); - tasks.push(function (next) { // path - cj.setCookie('d=4; Domain=example.com; Path=/foo', ex, at(3000), next); - }); - tasks.push(function (next) { // host only - cj.setCookie('e=5', ex, at(4000), next); - }); - tasks.push(function (next) { // other domain - cj.setCookie('f=6; Domain=nodejs.org; Path=/', 'http://nodejs.org', at(5000), next); - }); - tasks.push(function (next) { // expired - cj.setCookie('g=7; Domain=example.com; Path=/; Expires=Tue, 18 Oct 2011 00:00:00 GMT', ex, at(6000), next); - }); - tasks.push(function (next) { // expired via Max-Age - cj.setCookie('h=8; Domain=example.com; Path=/; Max-Age=1', ex, next); - }); - var cb = this.callback; - async.parallel(tasks, function (err, results) { - setTimeout(function () { - cb(err, cj, results); - }, 2000); // so that 'h=8' expires - }); - }, - "setup ok": function (err, cj, results) { - assert.ok(!err); - assert.ok(cj); - assert.ok(results); - }, - "then retrieving for http://nodejs.org": { - topic: function (cj, oldResults) { - assert.ok(oldResults); - cj.getCookies('http://nodejs.org', this.callback); - }, - "get a nodejs cookie": function (cookies) { - assert.lengthOf(cookies, 1); - var cookie = cookies[0]; - assert.equal(cookie.domain, 'nodejs.org'); - } - }, - "then retrieving for https://example.com": { - topic: function (cj, oldResults) { - assert.ok(oldResults); - cj.getCookies('https://example.com', {secure: true}, this.callback); - }, - "get a secure example cookie with others": function (cookies) { - var names = cookies.map(function (c) { - return c.key - }); - assert.deepEqual(names, ['a', 'b', 'c', 'e']); - } - }, - "then retrieving for https://example.com (missing options)": { - topic: function (cj, oldResults) { - assert.ok(oldResults); - cj.getCookies('https://example.com', this.callback); - }, - "get a secure example cookie with others": function (cookies) { - var names = cookies.map(function (c) { - return c.key - }); - assert.deepEqual(names, ['a', 'b', 'c', 'e']); - } - }, - "then retrieving for http://example.com": { - topic: function (cj, oldResults) { - assert.ok(oldResults); - cj.getCookies('http://example.com', this.callback); - }, - "get a bunch of cookies": function (cookies) { - var names = cookies.map(function (c) { - return c.key - }); - assert.deepEqual(names, ['a', 'b', 'e']); - } - }, - "then retrieving for http://EXAMPlE.com": { - topic: function (cj, oldResults) { - assert.ok(oldResults); - cj.getCookies('http://EXAMPlE.com', this.callback); - }, - "get a bunch of cookies": function (cookies) { - var names = cookies.map(function (c) { - return c.key - }); - assert.deepEqual(names, ['a', 'b', 'e']); - } - }, - "then retrieving for http://example.com, non-HTTP": { - topic: function (cj, oldResults) { - assert.ok(oldResults); - cj.getCookies('http://example.com', {http: false}, this.callback); - }, - "get a bunch of cookies": function (cookies) { - var names = cookies.map(function (c) { - return c.key - }); - assert.deepEqual(names, ['a', 'e']); - } - }, - "then retrieving for http://example.com/foo/bar": { - topic: function (cj, oldResults) { - assert.ok(oldResults); - cj.getCookies('http://example.com/foo/bar', this.callback); - }, - "get a bunch of cookies": function (cookies) { - var names = cookies.map(function (c) { - return c.key - }); - assert.deepEqual(names, ['d', 'a', 'b', 'e']); - } - }, - "then retrieving for http://example.com as a string": { - topic: function (cj, oldResults) { - assert.ok(oldResults); - cj.getCookieString('http://example.com', this.callback); - }, - "get a single string": function (cookieHeader) { - assert.equal(cookieHeader, "a=1; b=2; e=5"); - } - }, - "then retrieving for http://example.com as a set-cookie header": { - topic: function (cj, oldResults) { - assert.ok(oldResults); - cj.getSetCookieStrings('http://example.com', this.callback); - }, - "get a single string": function (cookieHeaders) { - assert.lengthOf(cookieHeaders, 3); - assert.equal(cookieHeaders[0], "a=1; Domain=example.com; Path=/"); - assert.equal(cookieHeaders[1], "b=2; Domain=example.com; Path=/; HttpOnly"); - assert.equal(cookieHeaders[2], "e=5; Path=/"); - } - }, - "then retrieving for http://www.example.com/": { - topic: function (cj, oldResults) { - assert.ok(oldResults); - cj.getCookies('http://www.example.com/foo/bar', this.callback); - }, - "get a bunch of cookies": function (cookies) { - var names = cookies.map(function (c) { - return c.key - }); - assert.deepEqual(names, ['d', 'a', 'b']); // note lack of 'e' - } - } - } - }) - .addBatch({ - "Repeated names": { - topic: function () { - var cb = this.callback; - var cj = new CookieJar(); - var ex = 'http://www.example.com/'; - var sc = cj.setCookie; - var tasks = []; - var now = Date.now(); - tasks.push(sc.bind(cj, 'aaaa=xxxx', ex, at(0))); - tasks.push(sc.bind(cj, 'aaaa=1111; Domain=www.example.com', ex, at(1000))); - tasks.push(sc.bind(cj, 'aaaa=2222; Domain=example.com', ex, at(2000))); - tasks.push(sc.bind(cj, 'aaaa=3333; Domain=www.example.com; Path=/pathA', ex, at(3000))); - async.series(tasks, function (err, results) { - results = results.filter(function (e) { - return e !== undefined - }); - cb(err, {cj: cj, cookies: results, now: now}); - }); - }, - "all got set": function (err, t) { - assert.lengthOf(t.cookies, 4); - }, - "then getting 'em back": { - topic: function (t) { - var cj = t.cj; - cj.getCookies('http://www.example.com/pathA', this.callback); - }, - "there's just three": function (err, cookies) { - var vals = cookies.map(function (c) { - return c.value - }); - // may break with sorting; sorting should put 3333 first due to longest path: - assert.deepEqual(vals, ['3333', '1111', '2222']); - } - } - } - }) - .addBatch({ - "CookieJar setCookie errors": { - "public-suffix domain": { - topic: function () { - var cj = new CookieJar(); - cj.setCookie('i=9; Domain=kyoto.jp; Path=/', 'kyoto.jp', this.callback); - }, - "errors": function (err, cookie) { - assert.ok(err); - assert.ok(!cookie); - assert.match(err.message, /public suffix/i); - } - }, - "wrong domain": { - topic: function () { - var cj = new CookieJar(); - cj.setCookie('j=10; Domain=google.com; Path=/', 'http://google.ca', this.callback); - }, - "errors": function (err, cookie) { - assert.ok(err); - assert.ok(!cookie); - assert.match(err.message, /not in this host's domain/i); - } - }, - "old cookie is HttpOnly": { - topic: function () { - var cb = this.callback; - var next = function (err, c) { - c = null; - return cb(err, cj); - }; - var cj = new CookieJar(); - cj.setCookie('k=11; Domain=example.ca; Path=/; HttpOnly', 'http://example.ca', {http: true}, next); - }, - "initial cookie is set": function (err, cj) { - assert.ok(!err); - assert.ok(cj); - }, - "but when trying to overwrite": { - topic: function (cj) { - var cb = this.callback; - var next = function (err, c) { - c = null; - cb(null, err); - }; - cj.setCookie('k=12; Domain=example.ca; Path=/', 'http://example.ca', {http: false}, next); - }, - "it's an error": function (err) { - assert.ok(err); - }, - "then, checking the original": { - topic: function (ignored, cj) { - assert.ok(cj instanceof CookieJar); - cj.getCookies('http://example.ca', {http: true}, this.callback); - }, - "cookie has original value": function (err, cookies) { - assert.equal(err, null); - assert.lengthOf(cookies, 1); - assert.equal(cookies[0].value, 11); - } - } - } - }, - "similar to public suffix": { - topic: function () { - var cj = new CookieJar(); - var url = 'http://www.foonet.net'; - assert.isTrue(cj.rejectPublicSuffixes); - cj.setCookie('l=13; Domain=foonet.net; Path=/', url, this.callback); - }, - "doesn't error": function (err, cookie) { - assert.ok(!err); - assert.ok(cookie); - } - } - } - }) - .export(module); diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/test/cookie_sorting_test.js b/deps/npm/node_modules/request/node_modules/tough-cookie/test/cookie_sorting_test.js deleted file mode 100644 index 826562a2b26f53..00000000000000 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/test/cookie_sorting_test.js +++ /dev/null @@ -1,156 +0,0 @@ -/*! - * Copyright (c) 2015, Salesforce.com, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Salesforce.com nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -'use strict'; -var vows = require('vows'); -var assert = require('assert'); -var tough = require('../lib/cookie'); -var Cookie = tough.Cookie; -var CookieJar = tough.CookieJar; - -function toKeyArray(cookies) { - return cookies.map(function (c) { - return c.key - }); -} - -vows - .describe('Cookie sorting') - .addBatch({ - "Assumptions:": { - ".creationIndex is set during construction": function() { - var now = new Date(); - var c1 = new Cookie(); - var c2 = new Cookie(); - assert.isNumber(c1.creationIndex); - assert.isNumber(c2.creationIndex); - assert(c1.creationIndex < c2.creationIndex, - 'creationIndex should increase with each construction'); - }, - - ".creationIndex is set during construction (forced ctime)": function() { - var now = new Date(); - var c1 = new Cookie({creation: now}); - var c2 = new Cookie({creation: now}); - assert.strictEqual(c1.creation, c2.creation); - assert.isNumber(c1.creationIndex); - assert.isNumber(c2.creationIndex); - assert(c1.creationIndex < c2.creationIndex, - 'creationIndex should increase with each construction'); - }, - - ".creationIndex is left alone during new setCookie": function() { - var jar = new CookieJar(); - var c = new Cookie({key:'k', value:'v', domain:'example.com'}); - var now = new Date(); - var beforeDate = c.creation; - assert.instanceOf(beforeDate, Date); - assert.notStrictEqual(now, beforeDate); - var beforeIndex = c.creationIndex; - assert.isNumber(c.creationIndex); - - jar.setCookieSync(c, 'http://example.com/', {now: now}); - - assert.strictEqual(c.creation, now); - assert.strictEqual(c.creationIndex, beforeIndex); - }, - - ".creationIndex is preserved during update setCookie": function() { - var jar = new CookieJar(); - - var thisMs = Date.now(); - var t1 = new Date(thisMs); - var t2 = new Date(thisMs); - assert.notStrictEqual(t1, t2); // Date objects are distinct - - var c = new Cookie({key:'k', value:'v1', domain:'example.com'}); - jar.setCookieSync(c, 'http://example.com/', {now: t1}); - var originalIndex = c.creationIndex; - - assert.strictEqual(c.creation, t1); - assert.strictEqual(c.lastAccessed, t1); - - c = new Cookie({key:'k', value:'v2', domain:'example.com'}); - assert.notStrictEqual(c.creation, t1); // new timestamp assigned - - jar.setCookieSync(c, 'http://example.com/', {now: t2}); - - assert.strictEqual(c.creation, t1); // retained - assert.strictEqual(c.lastAccessed, t2); // updated - assert.strictEqual(c.creationIndex, originalIndex); // retained - }, - } - }) - .addBatch({ - "Cookie Sorting": { - topic: function () { - var cookies = []; - cookies.push(Cookie.parse("a=0; Domain=example.com")); - cookies.push(Cookie.parse("b=1; Domain=www.example.com")); - cookies.push(Cookie.parse("c=2; Domain=example.com; Path=/pathA")); - cookies.push(Cookie.parse("d=3; Domain=www.example.com; Path=/pathA")); - cookies.push(Cookie.parse("e=4; Domain=example.com; Path=/pathA/pathB")); - cookies.push(Cookie.parse("f=5; Domain=www.example.com; Path=/pathA/pathB")); - - // weak shuffle: - cookies = cookies.sort(function () { - return Math.random() - 0.5 - }); - - cookies = cookies.sort(tough.cookieCompare); - return cookies; - }, - "got": function (cookies) { - assert.lengthOf(cookies, 6); - assert.deepEqual(toKeyArray(cookies), ['e', 'f', 'c', 'd', 'a', 'b']); - } - } - }) - .addBatch({ - "Changing creation date affects sorting": { - topic: function () { - var cookies = []; - var now = Date.now(); - cookies.push(Cookie.parse("a=0;")); - cookies.push(Cookie.parse("b=1;")); - cookies.push(Cookie.parse("c=2;")); - - cookies.forEach(function (cookie, idx) { - cookie.creation = new Date(now - 100 * idx); - }); - - return cookies.sort(tough.cookieCompare); - }, - "got": function (cookies) { - assert.deepEqual(toKeyArray(cookies), ['c', 'b', 'a']); - } - } - }) - .export(module); diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/test/cookie_to_json_test.js b/deps/npm/node_modules/request/node_modules/tough-cookie/test/cookie_to_json_test.js deleted file mode 100644 index 94a23d46eb1fbe..00000000000000 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/test/cookie_to_json_test.js +++ /dev/null @@ -1,164 +0,0 @@ -/*! - * Copyright (c) 2015, Salesforce.com, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Salesforce.com nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -'use strict'; -var vows = require('vows'); -var assert = require('assert'); -var tough = require('../lib/cookie'); -var Cookie = tough.Cookie; - -vows - .describe('Cookie.toJSON()') - .addBatch({ - "JSON": { - "serialization": { - topic: function() { - var c = Cookie.parse('alpha=beta; Domain=example.com; Path=/foo; Expires=Tue, 19 Jan 2038 03:14:07 GMT; HttpOnly'); - return JSON.stringify(c); - }, - "gives a string": function(str) { - assert.equal(typeof str, "string"); - }, - "date is in ISO format": function(str) { - assert.match(str, /"expires":"2038-01-19T03:14:07\.000Z"/, 'expires is in ISO format'); - } - }, - "deserialization": { - topic: function() { - var json = '{"key":"alpha","value":"beta","domain":"example.com","path":"/foo","expires":"2038-01-19T03:14:07.000Z","httpOnly":true,"lastAccessed":2000000000123}'; - return Cookie.fromJSON(json); - }, - "works": function(c) { - assert.ok(c); - }, - "key": function(c) { assert.equal(c.key, "alpha") }, - "value": function(c) { assert.equal(c.value, "beta") }, - "domain": function(c) { assert.equal(c.domain, "example.com") }, - "path": function(c) { assert.equal(c.path, "/foo") }, - "httpOnly": function(c) { assert.strictEqual(c.httpOnly, true) }, - "secure": function(c) { assert.strictEqual(c.secure, false) }, - "hostOnly": function(c) { assert.strictEqual(c.hostOnly, null) }, - "expires is a date object": function(c) { - assert.equal(c.expires.getTime(), 2147483647000); - }, - "lastAccessed is a date object": function(c) { - assert.equal(c.lastAccessed.getTime(), 2000000000123); - }, - "creation defaulted": function(c) { - assert.ok(c.creation.getTime()); - } - }, - "null deserialization": { - topic: function() { - return Cookie.fromJSON(null); - }, - "is null": function(cookie) { - assert.equal(cookie,null); - } - } - }, - "expiry deserialization": { - "Infinity": { - topic: Cookie.fromJSON.bind(null, '{"expires":"Infinity"}'), - "is infinite": function(c) { - assert.strictEqual(c.expires, "Infinity"); - assert.equal(c.expires, Infinity); - } - } - }, - "maxAge serialization": { - topic: function() { - return function(toSet) { - var c = new Cookie(); - c.key = 'foo'; c.value = 'bar'; - c.setMaxAge(toSet); - return JSON.stringify(c); - }; - }, - "zero": { - topic: function(f) { return f(0) }, - "looks good": function(str) { - assert.match(str, /"maxAge":0/); - } - }, - "Infinity": { - topic: function(f) { return f(Infinity) }, - "looks good": function(str) { - assert.match(str, /"maxAge":"Infinity"/); - } - }, - "-Infinity": { - topic: function(f) { return f(-Infinity) }, - "looks good": function(str) { - assert.match(str, /"maxAge":"-Infinity"/); - } - }, - "null": { - topic: function(f) { return f(null) }, - "absent": function(str) { - assert.match(str, /(?!"maxAge":null)/); // NB: negative RegExp - } - } - }, - "maxAge deserialization": { - "number": { - topic: Cookie.fromJSON.bind(null,'{"key":"foo","value":"bar","maxAge":123}'), - "is the number": function(c) { - assert.strictEqual(c.maxAge, 123); - } - }, - "null": { - topic: Cookie.fromJSON.bind(null,'{"key":"foo","value":"bar","maxAge":null}'), - "is null": function(c) { - assert.strictEqual(c.maxAge, null); - } - }, - "less than zero": { - topic: Cookie.fromJSON.bind(null,'{"key":"foo","value":"bar","maxAge":-123}'), - "is -123": function(c) { - assert.strictEqual(c.maxAge, -123); - } - }, - "Infinity": { - topic: Cookie.fromJSON.bind(null,'{"key":"foo","value":"bar","maxAge":"Infinity"}'), - "is inf-as-string": function(c) { - assert.strictEqual(c.maxAge, "Infinity"); - } - }, - "-Infinity": { - topic: Cookie.fromJSON.bind(null,'{"key":"foo","value":"bar","maxAge":"-Infinity"}'), - "is inf-as-string": function(c) { - assert.strictEqual(c.maxAge, "-Infinity"); - } - } - } - }) - .export(module); diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/test/cookie_to_string_test.js b/deps/npm/node_modules/request/node_modules/tough-cookie/test/cookie_to_string_test.js deleted file mode 100644 index b7ad10da1c37ca..00000000000000 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/test/cookie_to_string_test.js +++ /dev/null @@ -1,162 +0,0 @@ -/*! - * Copyright (c) 2015, Salesforce.com, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Salesforce.com nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -'use strict'; -var vows = require('vows'); -var assert = require('assert'); -var tough = require('../lib/cookie'); -var Cookie = tough.Cookie; - -vows - .describe('Cookie.toString()') - .addBatch({ - "a simple cookie": { - topic: function () { - var c = new Cookie(); - c.key = 'a'; - c.value = 'b'; - return c; - }, - "validates": function (c) { - assert.ok(c.validate()); - }, - "to string": function (c) { - assert.equal(c.toString(), 'a=b'); - } - }, - "a cookie with spaces in the value": { - topic: function () { - var c = new Cookie(); - c.key = 'a'; - c.value = 'beta gamma'; - return c; - }, - "doesn't validate": function (c) { - assert.ok(!c.validate()); - }, - "'garbage in, garbage out'": function (c) { - assert.equal(c.toString(), 'a=beta gamma'); - } - }, - "with an empty value and HttpOnly": { - topic: function () { - var c = new Cookie(); - c.key = 'a'; - c.httpOnly = true; - return c; - }, - "to string": function (c) { - assert.equal(c.toString(), 'a=; HttpOnly'); - } - }, - "with an expiry": { - topic: function () { - var c = new Cookie(); - c.key = 'a'; - c.value = 'b'; - c.setExpires("Oct 18 2011 07:05:03 GMT"); - return c; - }, - "validates": function (c) { - assert.ok(c.validate()); - }, - "to string": function (c) { - assert.equal(c.toString(), 'a=b; Expires=Tue, 18 Oct 2011 07:05:03 GMT'); - }, - "to short string": function (c) { - assert.equal(c.cookieString(), 'a=b'); - } - }, - "with a max-age": { - topic: function () { - var c = new Cookie(); - c.key = 'a'; - c.value = 'b'; - c.setExpires("Oct 18 2011 07:05:03 GMT"); - c.maxAge = 12345; - return c; - }, - "validates": function (c) { - assert.ok(c.validate()); // mabe this one *shouldn't*? - }, - "to string": function (c) { - assert.equal(c.toString(), 'a=b; Expires=Tue, 18 Oct 2011 07:05:03 GMT; Max-Age=12345'); - } - }, - "with a bunch of things": function () { - var c = new Cookie(); - c.key = 'a'; - c.value = 'b'; - c.setExpires("Oct 18 2011 07:05:03 GMT"); - c.maxAge = 12345; - c.domain = 'example.com'; - c.path = '/foo'; - c.secure = true; - c.httpOnly = true; - c.extensions = ['MyExtension']; - assert.equal(c.toString(), 'a=b; Expires=Tue, 18 Oct 2011 07:05:03 GMT; Max-Age=12345; Domain=example.com; Path=/foo; Secure; HttpOnly; MyExtension'); - }, - "a host-only cookie": { - topic: function () { - var c = new Cookie(); - c.key = 'a'; - c.value = 'b'; - c.hostOnly = true; - c.domain = 'shouldnt-stringify.example.com'; - c.path = '/should-stringify'; - return c; - }, - "validates": function (c) { - assert.ok(c.validate()); - }, - "to string": function (c) { - assert.equal(c.toString(), 'a=b; Path=/should-stringify'); - } - }, - "minutes are '10'": { - topic: function () { - var c = new Cookie(); - c.key = 'a'; - c.value = 'b'; - c.expires = new Date(1284113410000); - return c; - }, - "validates": function (c) { - assert.ok(c.validate()); - }, - "to string": function (c) { - var str = c.toString(); - assert.notEqual(str, 'a=b; Expires=Fri, 010 Sep 2010 010:010:010 GMT'); - assert.equal(str, 'a=b; Expires=Fri, 10 Sep 2010 10:10:10 GMT'); - } - } - }) - .export(module); diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/test/date_test.js b/deps/npm/node_modules/request/node_modules/tough-cookie/test/date_test.js deleted file mode 100644 index afd989c5478cf5..00000000000000 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/test/date_test.js +++ /dev/null @@ -1,79 +0,0 @@ -/*! - * Copyright (c) 2015, Salesforce.com, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Salesforce.com nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -'use strict'; -var vows = require('vows'); -var assert = require('assert'); -var tough = require('../lib/cookie'); - -function dateVows(table) { - var theVows = {}; - Object.keys(table).forEach(function (date) { - var expect = table[date]; - theVows[date] = function () { - var got = tough.parseDate(date) ? 'valid' : 'invalid'; - assert.equal(got, expect ? 'valid' : 'invalid'); - }; - }); - return {"date parsing": theVows}; -} - -vows - .describe('Date') - .addBatch(dateVows({ - "Wed, 09 Jun 2021 10:18:14 GMT": true, - "Wed, 09 Jun 2021 22:18:14 GMT": true, - "Tue, 18 Oct 2011 07:42:42.123 GMT": true, - "18 Oct 2011 07:42:42 GMT": true, - "8 Oct 2011 7:42:42 GMT": true, - "8 Oct 2011 7:2:42 GMT": true, - "Oct 18 2011 07:42:42 GMT": true, - "Tue Oct 18 2011 07:05:03 GMT+0000 (GMT)": true, - "09 Jun 2021 10:18:14 GMT": true, - "99 Jix 3038 48:86:72 ZMT": false, - '01 Jan 1970 00:00:00 GMT': true, - '01 Jan 1600 00:00:00 GMT': false, // before 1601 - '01 Jan 1601 00:00:00 GMT': true, - '10 Feb 81 13:00:00 GMT': true, // implicit year - 'Thu, 17-Apr-2014 02:12:29 GMT': true, // dashes - 'Thu, 17-Apr-2014 02:12:29 UTC': true // dashes and UTC - })) - .addBatch({ - "strict date parse of Thu, 01 Jan 1970 00:00:010 GMT": { - topic: function () { - return tough.parseDate('Thu, 01 Jan 1970 00:00:010 GMT', true) ? true : false; - }, - "invalid": function (date) { - assert.equal(date, false); - } - } - }) - .export(module); diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/test/domain_and_path_test.js b/deps/npm/node_modules/request/node_modules/tough-cookie/test/domain_and_path_test.js deleted file mode 100644 index 175fa9f70b2b6c..00000000000000 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/test/domain_and_path_test.js +++ /dev/null @@ -1,200 +0,0 @@ -/*! - * Copyright (c) 2015, Salesforce.com, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Salesforce.com nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -'use strict'; -var vows = require('vows'); -var assert = require('assert'); -var tough = require('../lib/cookie'); -var Cookie = tough.Cookie; - -function matchVows(func, table) { - var theVows = {}; - table.forEach(function (item) { - var str = item[0]; - var dom = item[1]; - var expect = item[2]; - var label = str + (expect ? " matches " : " doesn't match ") + dom; - theVows[label] = function () { - assert.equal(func(str, dom), expect); - }; - }); - return theVows; -} - -function defaultPathVows(table) { - var theVows = {}; - table.forEach(function (item) { - var str = item[0]; - var expect = item[1]; - var label = str + " gives " + expect; - theVows[label] = function () { - assert.equal(tough.defaultPath(str), expect); - }; - }); - return theVows; -} - -vows - .describe('Domain and Path') - .addBatch({ - "domain normalization": { - "simple": function () { - var c = new Cookie(); - c.domain = "EXAMPLE.com"; - assert.equal(c.canonicalizedDomain(), "example.com"); - }, - "extra dots": function () { - var c = new Cookie(); - c.domain = ".EXAMPLE.com"; - assert.equal(c.cdomain(), "example.com"); - }, - "weird trailing dot": function () { - var c = new Cookie(); - c.domain = "EXAMPLE.ca."; - assert.equal(c.canonicalizedDomain(), "example.ca."); - }, - "weird internal dots": function () { - var c = new Cookie(); - c.domain = "EXAMPLE...ca."; - assert.equal(c.canonicalizedDomain(), "example...ca."); - }, - "IDN": function () { - var c = new Cookie(); - c.domain = "δοκιμή.δοκιμή"; // "test.test" in greek - assert.equal(c.canonicalizedDomain(), "xn--jxalpdlp.xn--jxalpdlp"); - } - } - }) - .addBatch({ - "Domain Match": matchVows(tough.domainMatch, [ - // str, dom, expect - ["example.com", "example.com", true], - ["eXaMpLe.cOm", "ExAmPlE.CoM", true], - ["no.ca", "yes.ca", false], - ["wwwexample.com", "example.com", false], - ["www.example.com", "example.com", true], - ["example.com", "www.example.com", false], - ["www.subdom.example.com", "example.com", true], - ["www.subdom.example.com", "subdom.example.com", true], - ["example.com", "example.com.", false], // RFC6265 S4.1.2.3 - ["192.168.0.1", "168.0.1", false], // S5.1.3 "The string is a host name" - [null, "example.com", null], - ["example.com", null, null], - [null, null, null], - [undefined, undefined, null], - ]) - }) - - .addBatch({ - "default-path": defaultPathVows([ - [null, "/"], - ["/", "/"], - ["/file", "/"], - ["/dir/file", "/dir"], - ["noslash", "/"], - ]) - }) - .addBatch({ - "Path-Match": matchVows(tough.pathMatch, [ - // request, cookie, match - ["/", "/", true], - ["/dir", "/", true], - ["/", "/dir", false], - ["/dir/", "/dir/", true], - ["/dir/file", "/dir/", true], - ["/dir/file", "/dir", true], - ["/directory", "/dir", false], - ]) - }) - .addBatch({ - "permuteDomain": { - "base case": { - topic: tough.permuteDomain.bind(null, 'example.com'), - "got the domain": function (list) { - assert.deepEqual(list, ['example.com']); - } - }, - "two levels": { - topic: tough.permuteDomain.bind(null, 'foo.bar.example.com'), - "got three things": function (list) { - assert.deepEqual(list, ['example.com', 'bar.example.com', 'foo.bar.example.com']); - } - }, - "local domain": { - topic: tough.permuteDomain.bind(null, 'foo.bar.example.localduhmain'), - "got three things": function (list) { - assert.deepEqual(list, ['example.localduhmain', 'bar.example.localduhmain', 'foo.bar.example.localduhmain']); - } - } - }, - "permutePath": { - "base case": { - topic: tough.permutePath.bind(null, '/'), - "just slash": function (list) { - assert.deepEqual(list, ['/']); - } - }, - "single case": { - topic: tough.permutePath.bind(null, '/foo'), - "two things": function (list) { - assert.deepEqual(list, ['/foo', '/']); - }, - "path matching": function (list) { - list.forEach(function (e) { - assert.ok(tough.pathMatch('/foo', e)); - }); - } - }, - "double case": { - topic: tough.permutePath.bind(null, '/foo/bar'), - "four things": function (list) { - assert.deepEqual(list, ['/foo/bar', '/foo', '/']); - }, - "path matching": function (list) { - list.forEach(function (e) { - assert.ok(tough.pathMatch('/foo/bar', e)); - }); - } - }, - "trailing slash": { - topic: tough.permutePath.bind(null, '/foo/bar/'), - "three things": function (list) { - assert.deepEqual(list, ['/foo/bar', '/foo', '/']); - }, - "path matching": function (list) { - list.forEach(function (e) { - assert.ok(tough.pathMatch('/foo/bar/', e)); - }); - } - } - } - }) - .export(module); diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/test/ietf_data/dates/bsd-examples.json b/deps/npm/node_modules/request/node_modules/tough-cookie/test/ietf_data/dates/bsd-examples.json deleted file mode 100644 index bc43160da15ad2..00000000000000 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/test/ietf_data/dates/bsd-examples.json +++ /dev/null @@ -1,168 +0,0 @@ -[ - { - "test": "Sat, 15-Apr-17 21:01:22 GMT", - "expected": "Sat, 15 Apr 2017 21:01:22 GMT" - }, { - "test": "Thu, 19-Apr-2007 16:00:00 GMT", - "expected": "Thu, 19 Apr 2007 16:00:00 GMT" - }, { - "test": "Wed, 25 Apr 2007 21:02:13 GMT", - "expected": "Wed, 25 Apr 2007 21:02:13 GMT" - }, { - "test": "Thu, 19/Apr\\2007 16:00:00 GMT", - "expected": "Thu, 19 Apr 2007 16:00:00 GMT" - }, { - "test": "Fri, 1 Jan 2010 01:01:50 GMT", - "expected": "Fri, 01 Jan 2010 01:01:50 GMT" - }, { - "test": "Wednesday, 1-Jan-2003 00:00:00 GMT", - "expected": "Wed, 01 Jan 2003 00:00:00 GMT" - }, { - "test": ", 1-Jan-2003 00:00:00 GMT", - "expected": "Wed, 01 Jan 2003 00:00:00 GMT" - }, { - "test": " 1-Jan-2003 00:00:00 GMT", - "expected": "Wed, 01 Jan 2003 00:00:00 GMT" - }, { - "test": "1-Jan-2003 00:00:00 GMT", - "expected": "Wed, 01 Jan 2003 00:00:00 GMT" - }, { - "test": "Wed,18-Apr-07 22:50:12 GMT", - "expected": "Wed, 18 Apr 2007 22:50:12 GMT" - }, { - "test": "WillyWonka , 18-Apr-07 22:50:12 GMT", - "expected": "Wed, 18 Apr 2007 22:50:12 GMT" - }, { - "test": "WillyWonka , 18-Apr-07 22:50:12", - "expected": "Wed, 18 Apr 2007 22:50:12 GMT" - }, { - "test": "WillyWonka , 18-apr-07 22:50:12", - "expected": "Wed, 18 Apr 2007 22:50:12 GMT" - }, { - "test": "Mon, 18-Apr-1977 22:50:13 GMT", - "expected": "Mon, 18 Apr 1977 22:50:13 GMT" - }, { - "test": "Mon, 18-Apr-77 22:50:13 GMT", - "expected": "Mon, 18 Apr 1977 22:50:13 GMT" - }, { - "test": "\"Sat, 15-Apr-17\\\"21:01:22\\\"GMT\"", - "expected": "Sat, 15 Apr 2017 21:01:22 GMT" - }, { - "test": "Partyday, 18- April-07 22:50:12", - "expected": "Wed, 18 Apr 2007 22:50:12 GMT" - }, { - "test": "Partyday, 18 - Apri-07 22:50:12", - "expected": "Wed, 18 Apr 2007 22:50:12 GMT" - }, { - "test": "Wednes, 1-Januar-2003 00:00:00 GMT", - "expected": "Wed, 01 Jan 2003 00:00:00 GMT" - }, { - "test": "Sat, 15-Apr-17 21:01:22", - "expected": "Sat, 15 Apr 2017 21:01:22 GMT" - }, { - "test": "Sat, 15-Apr-17 21:01:22 GMT-2", - "expected": "Sat, 15 Apr 2017 21:01:22 GMT" - }, { - "test": "Sat, 15-Apr-17 21:01:22 GMT BLAH", - "expected": "Sat, 15 Apr 2017 21:01:22 GMT" - }, { - "test": "Sat, 15-Apr-17 21:01:22 GMT-0400", - "expected": "Sat, 15 Apr 2017 21:01:22 GMT" - }, { - "test": "Sat, 15-Apr-17 21:01:22 GMT-0400 (EDT)", - "expected": "Sat, 15 Apr 2017 21:01:22 GMT" - }, { - "test": "Sat, 15-Apr-17 21:01:22 DST", - "expected": "Sat, 15 Apr 2017 21:01:22 GMT" - }, { - "test": "Sat, 15-Apr-17 21:01:22 -0400", - "expected": "Sat, 15 Apr 2017 21:01:22 GMT" - }, { - "test": "Sat, 15-Apr-17 21:01:22 (hello there)", - "expected": "Sat, 15 Apr 2017 21:01:22 GMT" - }, { - "test": "Sat, 15-Apr-17 21:01:22 11:22:33", - "expected": "Sat, 15 Apr 2017 21:01:22 GMT" - }, { - "test": "Sat, 15-Apr-17 ::00 21:01:22", - "expected": "Sat, 15 Apr 2017 21:01:22 GMT" - }, { - "test": "Sat, 15-Apr-17 boink:z 21:01:22", - "expected": "Sat, 15 Apr 2017 21:01:22 GMT" - }, { - "test": "Sat, 15-Apr-17 91:22:33 21:01:22", - "expected": null - }, { - "test": "Thu Apr 18 22:50:12 2007 GMT", - "expected": "Wed, 18 Apr 2007 22:50:12 GMT" - }, { - "test": "22:50:12 Thu Apr 18 2007 GMT", - "expected": "Wed, 18 Apr 2007 22:50:12 GMT" - }, { - "test": "Thu 22:50:12 Apr 18 2007 GMT", - "expected": "Wed, 18 Apr 2007 22:50:12 GMT" - }, { - "test": "Thu Apr 22:50:12 18 2007 GMT", - "expected": "Wed, 18 Apr 2007 22:50:12 GMT" - }, { - "test": "Thu Apr 18 22:50:12 2007 GMT", - "expected": "Wed, 18 Apr 2007 22:50:12 GMT" - }, { - "test": "Thu Apr 18 2007 22:50:12 GMT", - "expected": "Wed, 18 Apr 2007 22:50:12 GMT" - }, { - "test": "Thu Apr 18 2007 GMT 22:50:12", - "expected": "Wed, 18 Apr 2007 22:50:12 GMT" - }, { - "test": "Sat, 15-Apr-17 21:01:22 GMT", - "expected": "Sat, 15 Apr 2017 21:01:22 GMT" - }, { - "test": "15-Sat, Apr-17 21:01:22 GMT", - "expected": "Sat, 15 Apr 2017 21:01:22 GMT" - }, { - "test": "15-Sat, Apr 21:01:22 GMT 17", - "expected": "Sat, 15 Apr 2017 21:01:22 GMT" - }, { - "test": "15-Sat, Apr 21:01:22 GMT 2017", - "expected": "Sat, 15 Apr 2017 21:01:22 GMT" - }, { - "test": "15 Apr 21:01:22 2017", - "expected": "Sat, 15 Apr 2017 21:01:22 GMT" - }, { - "test": "15 17 Apr 21:01:22", - "expected": "Sat, 15 Apr 2017 21:01:22 GMT" - }, { - "test": "Apr 15 17 21:01:22", - "expected": "Sat, 15 Apr 2017 21:01:22 GMT" - }, { - "test": "Apr 15 21:01:22 17", - "expected": "Sat, 15 Apr 2017 21:01:22 GMT" - }, { - "test": "2017 April 15 21:01:22", - "expected": "Sat, 15 Apr 2017 21:01:22 GMT" - }, { - "test": "15 April 2017 21:01:22", - "expected": "Sat, 15 Apr 2017 21:01:22 GMT" - }, { - "test": "98 April 17 21:01:22", - "expected": null - }, { - "test": "Thu, 012-Aug-2008 20:49:07 GMT", - "expected": null - }, { - "test": "Thu, 12-Aug-31841 20:49:07 GMT", - "expected": null - }, { - "test": "Thu, 12-Aug-9999999999 20:49:07 GMT", - "expected": null - }, { - "test": "Thu, 999999999999-Aug-2007 20:49:07 GMT", - "expected": null - }, { - "test": "Thu, 12-Aug-2007 20:61:99999999999 GMT", - "expected": null - }, { - "test": "IAintNoDateFool", - "expected": null - } -] diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/test/ietf_data/dates/examples.json b/deps/npm/node_modules/request/node_modules/tough-cookie/test/ietf_data/dates/examples.json deleted file mode 100644 index 61e674d4477123..00000000000000 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/test/ietf_data/dates/examples.json +++ /dev/null @@ -1,48 +0,0 @@ -[ - { - "test": "Mon, 10-Dec-2007 17:02:24 GMT", - "expected": "Mon, 10 Dec 2007 17:02:24 GMT" - }, { - "test": "Wed, 09 Dec 2009 16:27:23 GMT", - "expected": "Wed, 09 Dec 2009 16:27:23 GMT" - }, { - "test": "Thursday, 01-Jan-1970 00:00:00 GMT", - "expected": "Thu, 01 Jan 1970 00:00:00 GMT" - }, { - "test": "Mon Dec 10 16:32:30 2007 GMT", - "expected": "Mon, 10 Dec 2007 16:32:30 GMT" - }, { - "test": "Wednesday, 01-Jan-10 00:00:00 GMT", - "expected": "Fri, 01 Jan 2010 00:00:00 GMT" - }, { - "test": "Mon, 10-Dec-07 20:35:03 GMT", - "expected": "Mon, 10 Dec 2007 20:35:03 GMT" - }, { - "test": "Wed, 1 Jan 2020 00:00:00 GMT", - "expected": "Wed, 01 Jan 2020 00:00:00 GMT" - }, { - "test": "Saturday, 8-Dec-2012 21:24:09 GMT", - "expected": "Sat, 08 Dec 2012 21:24:09 GMT" - }, { - "test": "Thu, 31 Dec 23:55:55 2037 GMT", - "expected": "Thu, 31 Dec 2037 23:55:55 GMT" - }, { - "test": "Sun, 9 Dec 2012 13:42:05 GMT", - "expected": "Sun, 09 Dec 2012 13:42:05 GMT" - }, { - "test": "Wed Dec 12 2007 08:44:07 GMT-0500 (EST)", - "expected": "Wed, 12 Dec 2007 08:44:07 GMT" - }, { - "test": "Mon, 01-Jan-2011 00: 00:00 GMT", - "expected": null - }, { - "test": "Sun, 1-Jan-1995 00:00:00 GMT", - "expected": "Sun, 01 Jan 1995 00:00:00 GMT" - }, { - "test": "Wednesday, 01-Jan-10 0:0:00 GMT", - "expected": "Fri, 01 Jan 2010 00:00:00 GMT" - }, { - "test": "Thu, 10 Dec 2009 13:57:2 GMT", - "expected": "Thu, 10 Dec 2009 13:57:02 GMT" - } -] diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/test/ietf_data/parser.json b/deps/npm/node_modules/request/node_modules/tough-cookie/test/ietf_data/parser.json deleted file mode 100644 index 783f660bfa62f4..00000000000000 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/test/ietf_data/parser.json +++ /dev/null @@ -1,1959 +0,0 @@ -[ - { - "test": "0001", - "received": [ - "foo=bar" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "0002", - "received": [ - "foo=bar; Expires=Fri, 07 Aug 2019 08:04:19 GMT" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "0003", - "received": [ - "foo=bar; Expires=Fri, 07 Aug 2007 08:04:19 GMT", - "foo2=bar2; Expires=Fri, 07 Aug 2017 08:04:19 GMT" - ], - "sent": [ - { "name": "foo2", "value": "bar2" } - ] - }, - { - "test": "0004", - "received": [ - "foo" - ], - "sent": [] - }, - { - "test": "0005", - "received": [ - "foo=bar; max-age=10000;" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "0006", - "received": [ - "foo=bar; max-age=0;" - ], - "sent": [] - }, - { - "test": "0007", - "received": [ - "foo=bar; version=1;" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "0008", - "received": [ - "foo=bar; version=1000;" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "0009", - "received": [ - "foo=bar; customvalue=1000;" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "0010", - "received": [ - "foo=bar; secure;" - ], - "sent": [] - }, - { - "test": "0011", - "received": [ - "foo=bar; customvalue=\"1000 or more\";" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "0012", - "received": [ - "foo=bar; customvalue=\"no trailing semicolon\"" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "0013", - "received": [ - "foo=bar", - "foo=qux" - ], - "sent": [ - { "name": "foo", "value": "qux" } - ] - }, - { - "test": "0014", - "received": [ - "foo1=bar", - "foo2=qux" - ], - "sent": [ - { "name": "foo1", "value": "bar" }, - { "name": "foo2", "value": "qux" } - ] - }, - { - "test": "0015", - "received": [ - "a=b", - "z=y" - ], - "sent": [ - { "name": "a", "value": "b" }, - { "name": "z", "value": "y" } - ] - }, - { - "test": "0016", - "received": [ - "z=y", - "a=b" - ], - "sent": [ - { "name": "z", "value": "y" }, - { "name": "a", "value": "b" } - ] - }, - { - "test": "0017", - "received": [ - "z=y, a=b" - ], - "sent": [ - { "name": "z", "value": "y, a=b" } - ] - }, - { - "test": "0018", - "received": [ - "z=y; foo=bar, a=b" - ], - "sent": [ - { "name": "z", "value": "y" } - ] - }, - { - "test": "0019", - "received": [ - "foo=b;max-age=3600, c=d;path=/" - ], - "sent": [ - { "name": "foo", "value": "b" } - ] - }, - { - "test": "0020", - "received": [ - "a=b", - "=", - "c=d" - ], - "sent": [ - { "name": "a", "value": "b" }, - { "name": "c", "value": "d" } - ] - }, - { - "test": "0021", - "received": [ - "a=b", - "=x", - "c=d" - ], - "sent": [ - { "name": "a", "value": "b" }, - { "name": "c", "value": "d" } - ] - }, - { - "test": "0022", - "received": [ - "a=b", - "x=", - "c=d" - ], - "sent": [ - { "name": "a", "value": "b" }, - { "name": "x", "value": "" }, - { "name": "c", "value": "d" } - ] - }, - { - "test": "0023", - "received": [ - "foo", - "" - ], - "sent": [] - }, - { - "test": "0024", - "received": [ - "foo", - "=" - ], - "sent": [] - }, - { - "test": "0025", - "received": [ - "foo", - "; bar" - ], - "sent": [] - }, - { - "test": "0026", - "received": [ - "foo", - " " - ], - "sent": [] - }, - { - "test": "0027", - "received": [ - "foo", - "bar" - ], - "sent": [] - }, - { - "test": "0028", - "received": [ - "foo", - "\t" - ], - "sent": [] - }, - { - "test": "ATTRIBUTE0001", - "received": [ - "foo=bar; Secure" - ], - "sent": [] - }, - { - "test": "ATTRIBUTE0002", - "received": [ - "foo=bar; seCURe" - ], - "sent": [] - }, - { - "test": "ATTRIBUTE0003", - "received": [ - "foo=bar; \"Secure\"" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "ATTRIBUTE0004", - "received": [ - "foo=bar; Secure=" - ], - "sent": [] - }, - { - "test": "ATTRIBUTE0005", - "received": [ - "foo=bar; Secure=aaaa" - ], - "sent": [] - }, - { - "test": "ATTRIBUTE0006", - "received": [ - "foo=bar; Secure qux" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "ATTRIBUTE0007", - "received": [ - "foo=bar; Secure =aaaaa" - ], - "sent": [] - }, - { - "test": "ATTRIBUTE0008", - "received": [ - "foo=bar; Secure= aaaaa" - ], - "sent": [] - }, - { - "test": "ATTRIBUTE0009", - "received": [ - "foo=bar; Secure; qux" - ], - "sent": [] - }, - { - "test": "ATTRIBUTE0010", - "received": [ - "foo=bar; Secure;qux" - ], - "sent": [] - }, - { - "test": "ATTRIBUTE0011", - "received": [ - "foo=bar; Secure ; qux" - ], - "sent": [] - }, - { - "test": "ATTRIBUTE0012", - "received": [ - "foo=bar; Secure" - ], - "sent": [] - }, - { - "test": "ATTRIBUTE0013", - "received": [ - "foo=bar; Secure ;" - ], - "sent": [] - }, - { - "test": "ATTRIBUTE0014", - "received": [ - "foo=bar; Path" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "ATTRIBUTE0015", - "received": [ - "foo=bar; Path=" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "ATTRIBUTE0016", - "received": [ - "foo=bar; Path=/" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "ATTRIBUTE0017", - "received": [ - "foo=bar; Path=/qux" - ], - "sent": [] - }, - { - "test": "ATTRIBUTE0018", - "received": [ - "foo=bar; Path =/qux" - ], - "sent": [] - }, - { - "test": "ATTRIBUTE0019", - "received": [ - "foo=bar; Path= /qux" - ], - "sent": [] - }, - { - "test": "ATTRIBUTE0020", - "received": [ - "foo=bar; Path=/qux ; taz" - ], - "sent": [] - }, - { - "test": "ATTRIBUTE0021", - "received": [ - "foo=bar; Path=/qux; Path=/" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "ATTRIBUTE0022", - "received": [ - "foo=bar; Path=/; Path=/qux" - ], - "sent": [] - }, - { - "test": "ATTRIBUTE0023", - "received": [ - "foo=bar; Path=/qux; Path=/cookie-parser-result" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "ATTRIBUTE0024", - "received": [ - "foo=bar; Path=/cookie-parser-result; Path=/qux" - ], - "sent": [] - }, - { - "test": "ATTRIBUTE0025", - "received": [ - "foo=bar; qux; Secure" - ], - "sent": [] - }, - { - "test": "ATTRIBUTE0026", - "received": [ - "foo=bar; qux=\"aaa;bbb\"; Secure" - ], - "sent": [] - }, - { - "test": "CHARSET0001", - "received": [ - "foo=\u6625\u8282\u56de\u5bb6\u8def\u00b7\u6625\u8fd0\u5b8c\u5168\u624b\u518c" - ], - "sent": [ - { "name": "foo", "value": "\u6625\u8282\u56de\u5bb6\u8def\u00b7\u6625\u8fd0\u5b8c\u5168\u624b\u518c" } - ] - }, - { - "test": "CHARSET0002", - "received": [ - "\u6625\u8282\u56de=\u5bb6\u8def\u00b7\u6625\u8fd0\u5b8c\u5168\u624b\u518c" - ], - "sent": [ - { "name": "\u6625\u8282\u56de", "value": "\u5bb6\u8def\u00b7\u6625\u8fd0\u5b8c\u5168\u624b\u518c" } - ] - }, - { - "test": "CHARSET0003", - "received": [ - "\u6625\u8282\u56de=\u5bb6\u8def\u00b7\u6625\u8fd0; \u5b8c\u5168\u624b\u518c" - ], - "sent": [ - { "name": "\u6625\u8282\u56de", "value": "\u5bb6\u8def\u00b7\u6625\u8fd0" } - ] - }, - { - "test": "CHARSET0004", - "received": [ - "foo=\"\u6625\u8282\u56de\u5bb6\u8def\u00b7\u6625\u8fd0\u5b8c\u5168\u624b\u518c\"" - ], - "sent": [ - { "name": "foo", "value": "\"\u6625\u8282\u56de\u5bb6\u8def\u00b7\u6625\u8fd0\u5b8c\u5168\u624b\u518c\"" } - ] - }, - { - "test": "CHROMIUM0001", - "received": [ - "a=b" - ], - "sent": [ - { "name": "a", "value": "b" } - ] - }, - { - "test": "CHROMIUM0002", - "received": [ - "aBc=\"zzz \" ;" - ], - "sent": [ - { "name": "aBc", "value": "\"zzz \"" } - ] - }, - { - "test": "CHROMIUM0003", - "received": [ - "aBc=\"zzz \" ;" - ], - "sent": [ - { "name": "aBc", "value": "\"zzz \"" } - ] - }, - { - "test": "CHROMIUM0004", - "received": [ - "aBc=\"zz;pp\" ; ;" - ], - "sent": [ - { "name": "aBc", "value": "\"zz" } - ] - }, - { - "test": "CHROMIUM0005", - "received": [ - "aBc=\"zz ;" - ], - "sent": [ - { "name": "aBc", "value": "\"zz" } - ] - }, - { - "test": "CHROMIUM0006", - "received": [ - "aBc=\"zzz \" \"ppp\" ;" - ], - "sent": [ - { "name": "aBc", "value": "\"zzz \" \"ppp\"" } - ] - }, - { - "test": "CHROMIUM0007", - "received": [ - "aBc=\"zzz \" \"ppp\" ;" - ], - "sent": [ - { "name": "aBc", "value": "\"zzz \" \"ppp\"" } - ] - }, - { - "test": "CHROMIUM0008", - "received": [ - "aBc=A\"B ;" - ], - "sent": [ - { "name": "aBc", "value": "A\"B" } - ] - }, - { - "test": "CHROMIUM0009", - "received": [ - "BLAHHH; path=/;" - ], - "sent": [] - }, - { - "test": "CHROMIUM0010", - "received": [ - "\"BLA\\\"HHH\"; path=/;" - ], - "sent": [] - }, - { - "test": "CHROMIUM0011", - "received": [ - "a=\"B" - ], - "sent": [ - { "name": "a", "value": "\"B" } - ] - }, - { - "test": "CHROMIUM0012", - "received": [ - "=ABC" - ], - "sent": [] - }, - { - "test": "CHROMIUM0013", - "received": [ - "ABC=; path = /" - ], - "sent": [ - { "name": "ABC", "value": "" } - ] - }, - { - "test": "CHROMIUM0014", - "received": [ - " A = BC ;foo;;; bar" - ], - "sent": [ - { "name": "A", "value": "BC" } - ] - }, - { - "test": "CHROMIUM0015", - "received": [ - " A=== BC ;foo;;; bar" - ], - "sent": [ - { "name": "A", "value": "== BC" } - ] - }, - { - "test": "CHROMIUM0016", - "received": [ - "foo=\"zohNumRKgI0oxyhSsV3Z7D\" ; expires=Sun, 18-Apr-2027 21:06:29 GMT ; path=/ ; " - ], - "sent": [ - { "name": "foo", "value": "\"zohNumRKgI0oxyhSsV3Z7D\"" } - ] - }, - { - "test": "CHROMIUM0017", - "received": [ - "foo=zohNumRKgI0oxyhSsV3Z7D ; expires=Sun, 18-Apr-2027 21:06:29 GMT ; path=/ ; " - ], - "sent": [ - { "name": "foo", "value": "zohNumRKgI0oxyhSsV3Z7D" } - ] - }, - { - "test": "CHROMIUM0018", - "received": [ - " " - ], - "sent": [] - }, - { - "test": "CHROMIUM0019", - "received": [ - "a=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - ], - "sent": [ - { "name": "a", "value": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } - ] - }, - { - "test": "CHROMIUM0021", - "received": [ - "" - ], - "sent": [] - }, - { - "test": "COMMA0001", - "received": [ - "foo=bar, baz=qux" - ], - "sent": [ - { "name": "foo", "value": "bar, baz=qux" } - ] - }, - { - "test": "COMMA0002", - "received": [ - "foo=\"bar, baz=qux\"" - ], - "sent": [ - { "name": "foo", "value": "\"bar, baz=qux\"" } - ] - }, - { - "test": "COMMA0003", - "received": [ - "foo=bar; b,az=qux" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "COMMA0004", - "received": [ - "foo=bar; baz=q,ux" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "COMMA0005", - "received": [ - "foo=bar; Max-Age=50,399" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "COMMA0006", - "received": [ - "foo=bar; Expires=Fri, 07 Aug 2019 08:04:19 GMT" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "COMMA0007", - "received": [ - "foo=bar; Expires=Fri 07 Aug 2019 08:04:19 GMT, baz=qux" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "DISABLED_CHROMIUM0020", - "received": [ - "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - ], - "sent": [] - }, - { - "test": "DISABLED_CHROMIUM0022", - "received": [ - "AAA=BB\u0000ZYX" - ], - "sent": [ - { "name": "AAA", "value": "BB" } - ] - }, - { - "test": "DISABLED_CHROMIUM0023", - "received": [ - "AAA=BB\rZYX" - ], - "sent": [ - { "name": "AAA", "value": "BB" } - ] - }, - { - "test": "DISABLED_PATH0029", - "received": [ - "foo=bar; path=/cookie-parser-result/foo/bar" - ], - "sent-to": "/cookie-parser-result/f%6Fo/bar?disabled-path0029", - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "DOMAIN0001", - "received": [ - "foo=bar; domain=home.example.org" - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0001", - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "DOMAIN0002", - "received": [ - "foo=bar; domain=home.example.org" - ], - "sent-to": "http://sibling.example.org:8888/cookie-parser-result?domain0002", - "sent": [] - }, - { - "test": "DOMAIN0003", - "received": [ - "foo=bar; domain=.home.example.org" - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0003", - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "DOMAIN0004", - "received": [ - "foo=bar; domain=home.example.org" - ], - "sent-to": "http://subdomain.home.example.org:8888/cookie-parser-result?domain0004", - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "DOMAIN0005", - "received": [ - "foo=bar; domain=.home.example.org" - ], - "sent-to": "http://subdomain.home.example.org:8888/cookie-parser-result?domain0005", - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "DOMAIN0006", - "received": [ - "foo=bar; domain=.home.example.org" - ], - "sent-to": "http://sibling.example.org:8888/cookie-parser-result?domain0006", - "sent": [] - }, - { - "test": "DOMAIN0007", - "received": [ - "foo=bar; domain=sibling.example.org" - ], - "sent-to": "http://sibling.example.org:8888/cookie-parser-result?domain0007", - "sent": [] - }, - { - "test": "DOMAIN0008", - "received": [ - "foo=bar; domain=.example.org" - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0008", - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "DOMAIN0009", - "received": [ - "foo=bar; domain=example.org" - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0009", - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "DOMAIN0010", - "received": [ - "foo=bar; domain=..home.example.org" - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0010", - "sent": [] - }, - { - "test": "DOMAIN0011", - "received": [ - "foo=bar; domain=home..example.org" - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0011", - "sent": [] - }, - { - "test": "DOMAIN0012", - "received": [ - "foo=bar; domain= .home.example.org" - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0012", - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "DOMAIN0013", - "received": [ - "foo=bar; domain= . home.example.org" - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0013", - "sent": [] - }, - { - "test": "DOMAIN0014", - "received": [ - "foo=bar; domain=home.example.org." - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0014", - "sent": [] - }, - { - "test": "DOMAIN0015", - "received": [ - "foo=bar; domain=home.example.org.." - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0015", - "sent": [] - }, - { - "test": "DOMAIN0016", - "received": [ - "foo=bar; domain=home.example.org ." - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0016", - "sent": [] - }, - { - "test": "DOMAIN0017", - "received": [ - "foo=bar; domain=.org" - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0017", - "sent": [] - }, - { - "test": "DOMAIN0018", - "received": [ - "foo=bar; domain=.org." - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0018", - "sent": [] - }, - { - "test": "DOMAIN0019", - "received": [ - "foo=bar; domain=home.example.org", - "foo2=bar2; domain=.home.example.org" - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0019", - "sent": [ - { "name": "foo", "value": "bar" }, - { "name": "foo2", "value": "bar2" } - ] - }, - { - "test": "DOMAIN0020", - "received": [ - "foo2=bar2; domain=.home.example.org", - "foo=bar; domain=home.example.org" - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0020", - "sent": [ - { "name": "foo2", "value": "bar2" }, - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "DOMAIN0021", - "received": [ - "foo=bar; domain=\"home.example.org\"" - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0021", - "sent": [] - }, - { - "test": "DOMAIN0022", - "received": [ - "foo=bar; domain=home.example.org", - "foo2=bar2; domain=.example.org" - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0022", - "sent": [ - { "name": "foo", "value": "bar" }, - { "name": "foo2", "value": "bar2" } - ] - }, - { - "test": "DOMAIN0023", - "received": [ - "foo2=bar2; domain=.example.org", - "foo=bar; domain=home.example.org" - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0023", - "sent": [ - { "name": "foo2", "value": "bar2" }, - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "DOMAIN0024", - "received": [ - "foo=bar; domain=.example.org; domain=home.example.org" - ], - "sent-to": "http://sibling.example.org:8888/cookie-parser-result?domain0024", - "sent": [] - }, - { - "test": "DOMAIN0025", - "received": [ - "foo=bar; domain=home.example.org; domain=.example.org" - ], - "sent-to": "http://sibling.example.org:8888/cookie-parser-result?domain0025", - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "DOMAIN0026", - "received": [ - "foo=bar; domain=home.eXaMpLe.org" - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0026", - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "DOMAIN0027", - "received": [ - "foo=bar; domain=home.example.org:8888" - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0027", - "sent": [] - }, - { - "test": "DOMAIN0028", - "received": [ - "foo=bar; domain=subdomain.home.example.org" - ], - "sent-to": "http://subdomain.home.example.org:8888/cookie-parser-result?domain0028", - "sent": [] - }, - { - "test": "DOMAIN0029", - "received": [ - "foo=bar" - ], - "sent-to": "http://subdomain.home.example.org:8888/cookie-parser-result?domain0029", - "sent": [] - }, - { - "test": "DOMAIN0031", - "received": [ - "foo=bar; domain=home.example.org; domain=.example.org" - ], - "sent-to": "http://sibling.example.org:8888/cookie-parser-result?domain0031", - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "DOMAIN0033", - "received": [ - "foo=bar; domain=home.example.org" - ], - "sent-to": "http://hoMe.eXaMplE.org:8888/cookie-parser-result?domain0033", - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "DOMAIN0034", - "received": [ - "foo=bar; domain=home.example.org; domain=home.example.com" - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0034", - "sent": [] - }, - { - "test": "DOMAIN0035", - "received": [ - "foo=bar; domain=home.example.com; domain=home.example.org" - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0035", - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "DOMAIN0036", - "received": [ - "foo=bar; domain=home.example.org; domain=home.example.com; domain=home.example.org" - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0036", - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "DOMAIN0037", - "received": [ - "foo=bar; domain=home.example.com; domain=home.example.org; domain=home.example.com" - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0037", - "sent": [] - }, - { - "test": "DOMAIN0038", - "received": [ - "foo=bar; domain=home.example.org; domain=home.example.org" - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0038", - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "DOMAIN0039", - "received": [ - "foo=bar; domain=home.example.org; domain=example.org" - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0039", - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "DOMAIN0040", - "received": [ - "foo=bar; domain=example.org; domain=home.example.org" - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?domain0040", - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "DOMAIN0041", - "received": [ - "foo=bar; domain=.sibling.example.org" - ], - "sent-to": "http://sibling.example.org:8888/cookie-parser-result?domain0041", - "sent": [] - }, - { - "test": "DOMAIN0042", - "received": [ - "foo=bar; domain=.sibling.home.example.org" - ], - "sent-to": "http://sibling.home.example.org:8888/cookie-parser-result?domain0042", - "sent": [] - }, - { - "test": "MOZILLA0001", - "received": [ - "foo=bar; max-age=-1" - ], - "sent": [] - }, - { - "test": "MOZILLA0002", - "received": [ - "foo=bar; max-age=0" - ], - "sent": [] - }, - { - "test": "MOZILLA0003", - "received": [ - "foo=bar; expires=Thu, 10 Apr 1980 16:33:12 GMT" - ], - "sent": [] - }, - { - "test": "MOZILLA0004", - "received": [ - "foo=bar; max-age=60" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "MOZILLA0005", - "received": [ - "foo=bar; max-age=-20" - ], - "sent": [] - }, - { - "test": "MOZILLA0006", - "received": [ - "foo=bar; max-age=60" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "MOZILLA0007", - "received": [ - "foo=bar; expires=Thu, 10 Apr 1980 16:33:12 GMT" - ], - "sent": [] - }, - { - "test": "MOZILLA0008", - "received": [ - "foo=bar; max-age=60", - "foo1=bar; max-age=60" - ], - "sent": [ - { "name": "foo", "value": "bar" }, - { "name": "foo1", "value": "bar" } - ] - }, - { - "test": "MOZILLA0009", - "received": [ - "foo=bar; max-age=60", - "foo1=bar; max-age=60", - "foo=differentvalue; max-age=0" - ], - "sent": [ - { "name": "foo1", "value": "bar" } - ] - }, - { - "test": "MOZILLA0010", - "received": [ - "foo=bar; max-age=60", - "foo1=bar; max-age=60", - "foo=differentvalue; max-age=0", - "foo2=evendifferentvalue; max-age=0" - ], - "sent": [ - { "name": "foo1", "value": "bar" } - ] - }, - { - "test": "MOZILLA0011", - "received": [ - "test=parser; domain=.parser.test; ;; ;=; ,,, ===,abc,=; abracadabra! max-age=20;=;;" - ], - "sent": [] - }, - { - "test": "MOZILLA0012", - "received": [ - "test=\"fubar! = foo;bar\\\";\" parser; max-age=6", - "five; max-age=2.63," - ], - "sent": [ - { "name": "test", "value": "\"fubar! = foo" } - ] - }, - { - "test": "MOZILLA0013", - "received": [ - "test=kill; max-age=0", - "five; max-age=0" - ], - "sent": [] - }, - { - "test": "MOZILLA0014", - "received": [ - "six" - ], - "sent": [] - }, - { - "test": "MOZILLA0015", - "received": [ - "six", - "seven" - ], - "sent": [] - }, - { - "test": "MOZILLA0016", - "received": [ - "six", - "seven", - " =eight" - ], - "sent": [] - }, - { - "test": "MOZILLA0017", - "received": [ - "six", - "seven", - " =eight", - "test=six" - ], - "sent": [ - { "name": "test", "value": "six" } - ] - }, - { - "test": "NAME0001", - "received": [ - "a=bar" - ], - "sent": [ - { "name": "a", "value": "bar" } - ] - }, - { - "test": "NAME0002", - "received": [ - "1=bar" - ], - "sent": [ - { "name": "1", "value": "bar" } - ] - }, - { - "test": "NAME0003", - "received": [ - "$=bar" - ], - "sent": [ - { "name": "$", "value": "bar" } - ] - }, - { - "test": "NAME0004", - "received": [ - "!a=bar" - ], - "sent": [ - { "name": "!a", "value": "bar" } - ] - }, - { - "test": "NAME0005", - "received": [ - "@a=bar" - ], - "sent": [ - { "name": "@a", "value": "bar" } - ] - }, - { - "test": "NAME0006", - "received": [ - "#a=bar" - ], - "sent": [ - { "name": "#a", "value": "bar" } - ] - }, - { - "test": "NAME0007", - "received": [ - "$a=bar" - ], - "sent": [ - { "name": "$a", "value": "bar" } - ] - }, - { - "test": "NAME0008", - "received": [ - "%a=bar" - ], - "sent": [ - { "name": "%a", "value": "bar" } - ] - }, - { - "test": "NAME0009", - "received": [ - "^a=bar" - ], - "sent": [ - { "name": "^a", "value": "bar" } - ] - }, - { - "test": "NAME0010", - "received": [ - "&a=bar" - ], - "sent": [ - { "name": "&a", "value": "bar" } - ] - }, - { - "test": "NAME0011", - "received": [ - "*a=bar" - ], - "sent": [ - { "name": "*a", "value": "bar" } - ] - }, - { - "test": "NAME0012", - "received": [ - "(a=bar" - ], - "sent": [ - { "name": "(a", "value": "bar" } - ] - }, - { - "test": "NAME0013", - "received": [ - ")a=bar" - ], - "sent": [ - { "name": ")a", "value": "bar" } - ] - }, - { - "test": "NAME0014", - "received": [ - "-a=bar" - ], - "sent": [ - { "name": "-a", "value": "bar" } - ] - }, - { - "test": "NAME0015", - "received": [ - "_a=bar" - ], - "sent": [ - { "name": "_a", "value": "bar" } - ] - }, - { - "test": "NAME0016", - "received": [ - "+=bar" - ], - "sent": [ - { "name": "+", "value": "bar" } - ] - }, - { - "test": "NAME0017", - "received": [ - "=a=bar" - ], - "sent": [] - }, - { - "test": "NAME0018", - "received": [ - "a =bar" - ], - "sent": [ - { "name": "a", "value": "bar" } - ] - }, - { - "test": "NAME0019", - "received": [ - "\"a=bar" - ], - "sent": [ - { "name": "\"a", "value": "bar" } - ] - }, - { - "test": "NAME0020", - "received": [ - "\"a=b\"=bar" - ], - "sent": [ - { "name": "\"a", "value": "b\"=bar" } - ] - }, - { - "test": "NAME0021", - "received": [ - "\"a=b\"=bar", - "\"a=qux" - ], - "sent": [ - { "name": "\"a", "value": "qux" } - ] - }, - { - "test": "NAME0022", - "received": [ - " foo=bar" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "NAME0023", - "received": [ - "foo;bar=baz" - ], - "sent": [] - }, - { - "test": "NAME0024", - "received": [ - "$Version=1; foo=bar" - ], - "sent": [ - { "name": "$Version", "value": "1" } - ] - }, - { - "test": "NAME0025", - "received": [ - "===a=bar" - ], - "sent": [] - }, - { - "test": "NAME0026", - "received": [ - "foo=bar " - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "NAME0027", - "received": [ - "foo=bar ;" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "NAME0028", - "received": [ - "=a" - ], - "sent": [] - }, - { - "test": "NAME0029", - "received": [ - "=" - ], - "sent": [] - }, - { - "test": "NAME0030", - "received": [ - "foo bar=baz" - ], - "sent": [ - { "name": "foo bar", "value": "baz" } - ] - }, - { - "test": "NAME0031", - "received": [ - "\"foo;bar\"=baz" - ], - "sent": [] - }, - { - "test": "NAME0032", - "received": [ - "\"foo\\\"bar;baz\"=qux" - ], - "sent": [] - }, - { - "test": "NAME0033", - "received": [ - "=foo=bar", - "aaa" - ], - "sent": [] - }, - { - "test": "OPTIONAL_DOMAIN0030", - "received": [ - "foo=bar; domain=" - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?optional-domain0030", - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "OPTIONAL_DOMAIN0041", - "received": [ - "foo=bar; domain=example.org; domain=" - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?optional-domain0041", - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "OPTIONAL_DOMAIN0042", - "received": [ - "foo=bar; domain=foo.example.org; domain=" - ], - "sent-to": "http://home.example.org:8888/cookie-parser-result?optional-domain0042", - "sent": [] - }, - { - "test": "OPTIONAL_DOMAIN0043", - "received": [ - "foo=bar; domain=foo.example.org; domain=" - ], - "sent-to": "http://subdomain.home.example.org:8888/cookie-parser-result?optional-domain0043", - "sent": [] - }, - { - "test": "ORDERING0001", - "received": [ - "key=val0;", - "key=val1; path=/cookie-parser-result", - "key=val2; path=/", - "key=val3; path=/bar", - "key=val4; domain=.example.org", - "key=val5; domain=.example.org; path=/cookie-parser-result/foo" - ], - "sent-to": "/cookie-parser-result/foo/baz?ordering0001", - "sent": [ - { "name": "key", "value": "val5" }, - { "name": "key", "value": "val1" }, - { "name": "key", "value": "val2" }, - { "name": "key", "value": "val4" } - ] - }, - { - "test": "PATH0001", - "received": [ - "a=b; path=/", - "x=y; path=/cookie-parser-result" - ], - "sent": [ - { "name": "x", "value": "y" }, - { "name": "a", "value": "b" } - ] - }, - { - "test": "PATH0002", - "received": [ - "a=b; path=/cookie-parser-result", - "x=y; path=/" - ], - "sent": [ - { "name": "a", "value": "b" }, - { "name": "x", "value": "y" } - ] - }, - { - "test": "PATH0003", - "received": [ - "x=y; path=/", - "a=b; path=/cookie-parser-result" - ], - "sent": [ - { "name": "a", "value": "b" }, - { "name": "x", "value": "y" } - ] - }, - { - "test": "PATH0004", - "received": [ - "x=y; path=/cookie-parser-result", - "a=b; path=/" - ], - "sent": [ - { "name": "x", "value": "y" }, - { "name": "a", "value": "b" } - ] - }, - { - "test": "PATH0005", - "received": [ - "foo=bar; path=/cookie-parser-result/foo" - ], - "sent": [] - }, - { - "test": "PATH0006", - "received": [ - "foo=bar", - "foo=qux; path=/cookie-parser-result/foo" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "PATH0007", - "received": [ - "foo=bar; path=/cookie-parser-result/foo" - ], - "sent-to": "/cookie-parser-result/foo?path0007", - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "PATH0008", - "received": [ - "foo=bar; path=/cookie-parser-result/foo" - ], - "sent-to": "/cookie-parser-result/bar?path0008", - "sent": [] - }, - { - "test": "PATH0009", - "received": [ - "foo=bar; path=/cookie-parser-result/foo/qux" - ], - "sent-to": "/cookie-parser-result/foo?path0009", - "sent": [] - }, - { - "test": "PATH0010", - "received": [ - "foo=bar; path=/cookie-parser-result/foo/qux" - ], - "sent-to": "/cookie-parser-result/foo/qux?path0010", - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "PATH0011", - "received": [ - "foo=bar; path=/cookie-parser-result/foo/qux" - ], - "sent-to": "/cookie-parser-result/bar/qux?path0011", - "sent": [] - }, - { - "test": "PATH0012", - "received": [ - "foo=bar; path=/cookie-parser-result/foo/qux" - ], - "sent-to": "/cookie-parser-result/foo/baz?path0012", - "sent": [] - }, - { - "test": "PATH0013", - "received": [ - "foo=bar; path=/cookie-parser-result/foo/qux/" - ], - "sent-to": "/cookie-parser-result/foo/baz?path0013", - "sent": [] - }, - { - "test": "PATH0014", - "received": [ - "foo=bar; path=/cookie-parser-result/foo/qux/" - ], - "sent-to": "/cookie-parser-result/foo/qux?path0014", - "sent": [] - }, - { - "test": "PATH0015", - "received": [ - "foo=bar; path=/cookie-parser-result/foo/qux/" - ], - "sent-to": "/cookie-parser-result/foo/qux/?path0015", - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "PATH0016", - "received": [ - "foo=bar; path=/cookie-parser-result/foo/" - ], - "sent-to": "/cookie-parser-result/foo/qux?path0016", - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "PATH0017", - "received": [ - "foo=bar; path=/cookie-parser-result/foo/" - ], - "sent-to": "/cookie-parser-result/foo//qux?path0017", - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "PATH0018", - "received": [ - "foo=bar; path=/cookie-parser-result/foo/" - ], - "sent-to": "/cookie-parser-result/fooqux?path0018", - "sent": [] - }, - { - "test": "PATH0019", - "received": [ - "foo=bar; path" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "PATH0020", - "received": [ - "foo=bar; path=" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "PATH0021", - "received": [ - "foo=bar; path=/" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "PATH0022", - "received": [ - "foo=bar; path= /" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "PATH0023", - "received": [ - "foo=bar; Path=/cookie-PARSER-result" - ], - "sent": [] - }, - { - "test": "PATH0024", - "received": [ - "foo=bar; path=/cookie-parser-result/foo/qux?" - ], - "sent-to": "/cookie-parser-result/foo/qux?path0024", - "sent": [] - }, - { - "test": "PATH0025", - "received": [ - "foo=bar; path=/cookie-parser-result/foo/qux#" - ], - "sent-to": "/cookie-parser-result/foo/qux?path0025", - "sent": [] - }, - { - "test": "PATH0026", - "received": [ - "foo=bar; path=/cookie-parser-result/foo/qux;" - ], - "sent-to": "/cookie-parser-result/foo/qux?path0026", - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "PATH0027", - "received": [ - "foo=bar; path=\"/cookie-parser-result/foo/qux;\"" - ], - "sent-to": "/cookie-parser-result/foo/qux?path0027", - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "PATH0028", - "received": [ - "foo=bar; path=/cookie-parser-result/f%6Fo/bar" - ], - "sent-to": "/cookie-parser-result/foo/bar?path0028", - "sent": [] - }, - { - "test": "PATH0029", - "received": [ - "a=b; \tpath\t=\t/cookie-parser-result\t", - "x=y; \tpath\t=\t/book\t" - ], - "sent": [ - { "name": "a", "value": "b" } - ] - }, - { - "test": "PATH0030", - "received": [ - "foo=bar; path=/dog; path=" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "PATH0031", - "received": [ - "foo=bar; path=; path=/dog" - ], - "sent": [] - }, - { - "test": "PATH0032", - "received": [ - "foo=bar; path=/cookie-parser-result", - "foo=qux; path=/cookie-parser-result/" - ], - "sent-to": "/cookie-parser-result/dog?path0032", - "sent": [ - { "name": "foo", "value": "qux" }, - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "VALUE0001", - "received": [ - "foo= bar" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - }, - { - "test": "VALUE0002", - "received": [ - "foo=\"bar\"" - ], - "sent": [ - { "name": "foo", "value": "\"bar\"" } - ] - }, - { - "test": "VALUE0003", - "received": [ - "foo=\" bar \"" - ], - "sent": [ - { "name": "foo", "value": "\" bar \"" } - ] - }, - { - "test": "VALUE0004", - "received": [ - "foo=\"bar;baz\"" - ], - "sent": [ - { "name": "foo", "value": "\"bar" } - ] - }, - { - "test": "VALUE0005", - "received": [ - "foo=\"bar=baz\"" - ], - "sent": [ - { "name": "foo", "value": "\"bar=baz\"" } - ] - }, - { - "test": "VALUE0006", - "received": [ - "\tfoo\t=\tbar\t \t;\tttt" - ], - "sent": [ - { "name": "foo", "value": "bar" } - ] - } -] diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/test/ietf_test.js b/deps/npm/node_modules/request/node_modules/tough-cookie/test/ietf_test.js deleted file mode 100644 index 8bd41dd6542d8e..00000000000000 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/test/ietf_test.js +++ /dev/null @@ -1,105 +0,0 @@ -/*! - * Copyright (c) 2015, Salesforce.com, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Salesforce.com nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -'use strict'; -var vows = require('vows'); -var assert = require('assert'); -var fs = require('fs'); -var path = require('path'); -var url = require('url'); -var tough = require('../lib/cookie'); -var Cookie = tough.Cookie; -var CookieJar = tough.CookieJar; - -function readJson(filePath) { - filePath = path.join(__dirname, filePath); - return JSON.parse(fs.readFileSync(filePath).toString()); -} - -function setGetCookieVows() { - var theVows = {}; - var data = readJson('./ietf_data/parser.json'); - - data.forEach(function (testCase) { - theVows[testCase.test] = function () { - var jar = new CookieJar(); - var expected = testCase['sent'] - var sentFrom = 'http://home.example.org/cookie-parser?' + testCase.test; - var sentTo = testCase['sent-to'] ? - url.resolve('http://home.example.org', testCase['sent-to']) : - 'http://home.example.org/cookie-parser-result?' + testCase.test; - - testCase['received'].forEach(function (cookieStr) { - jar.setCookieSync(cookieStr, sentFrom, {ignoreError: true}); - }); - - var actual = jar.getCookiesSync(sentTo,{sort:true}); - - assert.strictEqual(actual.length, expected.length); - - actual.forEach(function (actualCookie, idx) { - var expectedCookie = expected[idx]; - assert.strictEqual(actualCookie.key, expectedCookie.name); - assert.strictEqual(actualCookie.value, expectedCookie.value); - }); - }; - }); - - return {'Set/get cookie tests': theVows}; -} - -function dateVows() { - var theVows = {}; - - [ - './ietf_data/dates/bsd-examples.json', - './ietf_data/dates/examples.json' - ].forEach(function (filePath) { - var data = readJson(filePath); - var fileName = path.basename(filePath); - - data.forEach(function (testCase) { - theVows[fileName + ' : ' + testCase.test] = function () { - var actual = tough.parseDate(testCase.test); - actual = actual ? actual.toUTCString() : null; - assert.strictEqual(actual, testCase.expected); - }; - }); - }); - - return {'Date': theVows}; -} - -vows - .describe('IETF http state tests') - .addBatch(setGetCookieVows()) - .addBatch(dateVows()) - .export(module); diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/test/jar_serialization_test.js b/deps/npm/node_modules/request/node_modules/tough-cookie/test/jar_serialization_test.js deleted file mode 100644 index 277c90c8f49185..00000000000000 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/test/jar_serialization_test.js +++ /dev/null @@ -1,348 +0,0 @@ -/*! - * Copyright (c) 2015, Salesforce.com, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Salesforce.com nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -'use strict'; -var vows = require('vows'); -var assert = require('assert'); -var tough = require('../lib/cookie'); -var Cookie = tough.Cookie; -var CookieJar = tough.CookieJar; -var Store = tough.Store; -var MemoryCookieStore = tough.MemoryCookieStore; -var VERSION = require('../package.json').version; - -var domains = ['example.com','www.example.com','example.net']; -var paths = ['/','/foo','/foo/bar']; - -var isInteger = Number.isInteger || function(value) { - // Node 0.10 (still supported) doesn't have Number.isInteger - // from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger - return typeof value === "number" && - isFinite(value) && - Math.floor(value) === value; -}; - -function setUp(context) { - context.now = new Date(); - context.nowISO = context.now.toISOString(); - context.expires = new Date(context.now.getTime() + 86400000); - - var c, domain; - context.jar = new CookieJar(); - - context.totalCookies = 0; - - // Do paths first since the MemoryCookieStore index is domain at the top - // level. This should cause the preservation of creation order in - // getAllCookies to be exercised. - for (var i = 0; i=0.4.1 <0.5.0", + "_id": "tunnel-agent@0.4.2", + "_inCache": true, + "_installable": true, + "_location": "/request/tunnel-agent", + "_nodeVersion": "5.0.0", + "_npmUser": { + "email": "simeonvelichkov@gmail.com", + "name": "simov" + }, + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "name": "tunnel-agent", + "raw": "tunnel-agent@~0.4.1", + "rawSpec": "~0.4.1", + "scope": null, + "spec": ">=0.4.1 <0.5.0", + "type": "range" + }, + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.2.tgz", + "_shasum": "1104e3f36ac87125c287270067d582d18133bfee", + "_shrinkwrap": null, + "_spec": "tunnel-agent@~0.4.1", + "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request", "author": { - "name": "Mikeal Rogers", "email": "mikeal.rogers@gmail.com", + "name": "Mikeal Rogers", "url": "http://www.futurealoof.com" }, - "name": "tunnel-agent", - "description": "HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.", - "version": "0.4.1", - "repository": { - "url": "git+https://github.com/mikeal/tunnel-agent.git" + "bugs": { + "url": "https://github.com/mikeal/tunnel-agent/issues" }, - "main": "index.js", "dependencies": {}, + "description": "HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.", "devDependencies": {}, - "optionalDependencies": {}, + "directories": {}, + "dist": { + "shasum": "1104e3f36ac87125c287270067d582d18133bfee", + "tarball": "http://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.2.tgz" + }, "engines": { "node": "*" }, - "gitHead": "912a7a6d00e10ec76baf9c9369de280fa5badef3", - "bugs": { - "url": "https://github.com/mikeal/tunnel-agent/issues" - }, + "gitHead": "449634d1054949f9f145f4925985a8dea0f46b0f", "homepage": "https://github.com/mikeal/tunnel-agent#readme", - "_id": "tunnel-agent@0.4.1", - "scripts": {}, - "_shasum": "bbeecff4d679ce753db9462761a88dfcec3c5ab3", - "_from": "tunnel-agent@>=0.4.0 <0.5.0", - "_npmVersion": "2.11.2", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "simov", - "email": "simeonvelichkov@gmail.com" - }, - "dist": { - "shasum": "bbeecff4d679ce753db9462761a88dfcec3c5ab3", - "tarball": "http://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.1.tgz" - }, + "license": "Apache-2.0", + "main": "index.js", "maintainers": [ { "name": "mikeal", @@ -54,7 +74,12 @@ "email": "simeonvelichkov@gmail.com" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.1.tgz", - "readme": "ERROR: No README data found!" + "name": "tunnel-agent", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "url": "git+https://github.com/mikeal/tunnel-agent.git" + }, + "scripts": {}, + "version": "0.4.2" } diff --git a/deps/npm/node_modules/request/package.json b/deps/npm/node_modules/request/package.json index 0700cd724f0ef3..f3f8cf4907efd2 100644 --- a/deps/npm/node_modules/request/package.json +++ b/deps/npm/node_modules/request/package.json @@ -1,89 +1,108 @@ { - "name": "request", - "description": "Simplified HTTP request client.", - "tags": [ - "http", - "simple", - "util", - "utility" + "_args": [ + [ + "request@latest", + "/Users/rebecca/code/npm" + ] ], - "version": "2.64.0", - "author": { - "name": "Mikeal Rogers", - "email": "mikeal.rogers@gmail.com" + "_from": "request@latest", + "_id": "request@2.69.0", + "_inCache": true, + "_installable": true, + "_location": "/request", + "_nodeVersion": "4.1.2", + "_npmUser": { + "email": "mikeal.rogers@gmail.com", + "name": "mikeal" }, - "repository": { - "type": "git", - "url": "git+https://github.com/request/request.git" + "_npmVersion": "2.14.4", + "_phantomChildren": { + "ansi-regex": "2.0.0", + "readable-stream": "2.0.5", + "strip-ansi": "3.0.0" + }, + "_requested": { + "name": "request", + "raw": "request@latest", + "rawSpec": "latest", + "scope": null, + "spec": "latest", + "type": "tag" + }, + "_requiredBy": [ + "/", + "/node-gyp", + "/npm-registry-client" + ], + "_resolved": "https://registry.npmjs.org/request/-/request-2.69.0.tgz", + "_shasum": "cf91d2e000752b1217155c005241911991a2346a", + "_shrinkwrap": null, + "_spec": "request@latest", + "_where": "/Users/rebecca/code/npm", + "author": { + "email": "mikeal.rogers@gmail.com", + "name": "Mikeal Rogers" }, "bugs": { "url": "http://github.com/request/request/issues" }, - "license": "Apache-2.0", - "engines": { - "node": ">=0.8.0" - }, - "main": "index.js", "dependencies": { + "aws-sign2": "~0.6.0", + "aws4": "^1.2.1", "bl": "~1.0.0", "caseless": "~0.11.0", + "combined-stream": "~1.0.5", "extend": "~3.0.0", - "forever-agent": "~0.6.0", - "form-data": "~1.0.0-rc1", - "json-stringify-safe": "~5.0.0", - "mime-types": "~2.1.2", - "node-uuid": "~1.4.0", - "qs": "~5.1.0", - "tunnel-agent": "~0.4.0", - "tough-cookie": ">=0.12.0", - "http-signature": "~0.11.0", - "oauth-sign": "~0.8.0", + "forever-agent": "~0.6.1", + "form-data": "~1.0.0-rc3", + "har-validator": "~2.0.6", "hawk": "~3.1.0", - "aws-sign2": "~0.5.0", + "http-signature": "~1.1.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.7", + "node-uuid": "~1.4.7", + "oauth-sign": "~0.8.0", + "qs": "~6.0.2", "stringstream": "~0.0.4", - "combined-stream": "~1.0.1", - "isstream": "~0.1.1", - "har-validator": "^1.6.1" - }, - "scripts": { - "test": "npm run lint && npm run test-ci && npm run test-browser", - "test-ci": "taper tests/test-*.js", - "test-cov": "istanbul cover tape tests/test-*.js", - "test-browser": "node tests/browser/start.js", - "lint": "eslint lib/ *.js tests/ && echo Lint passed." + "tough-cookie": "~2.2.0", + "tunnel-agent": "~0.4.1" }, + "description": "Simplified HTTP request client.", "devDependencies": { - "browserify": "~5.9.1", - "browserify-istanbul": "~0.1.3", - "buffer-equal": "0.0.1", - "codecov.io": "~0.1.2", - "coveralls": "~2.11.2", - "eslint": "0.18.0", - "function-bind": "~1.0.0", - "istanbul": "~0.3.2", - "karma": "~0.12.21", - "karma-browserify": "~3.0.1", - "karma-cli": "0.0.4", - "karma-coverage": "0.2.6", - "karma-phantomjs-launcher": "~0.1.4", - "karma-tap": "~1.0.1", - "rimraf": "~2.2.8", - "server-destroy": "~1.0.0", - "tape": "~3.0.0", - "taper": "~0.4.0", - "bluebird": "~2.9.21" + "bluebird": "^3.0.2", + "browserify": "^13.0.0", + "browserify-istanbul": "^0.1.5", + "buffer-equal": "^1.0.0", + "codecov.io": "^0.1.6", + "coveralls": "^2.11.4", + "eslint": "1.10.3", + "function-bind": "^1.0.2", + "istanbul": "^0.4.0", + "karma": "^0.13.10", + "karma-browserify": "^4.4.0", + "karma-cli": "^0.1.1", + "karma-coverage": "^0.5.3", + "karma-phantomjs-launcher": "^0.1.4", + "karma-tap": "^1.0.3", + "rimraf": "^2.2.8", + "server-destroy": "^1.0.1", + "tape": "^4.2.0", + "taper": "^0.4.0" }, - "gitHead": "ca364485249f13c4810bb9b3952fb0fb886a93ee", - "homepage": "https://github.com/request/request#readme", - "_id": "request@2.64.0", - "_shasum": "96a582423ce9b4b5c34e9b232e480173f14ba608", - "_from": "request@2.64.0", - "_npmVersion": "2.14.3", - "_nodeVersion": "4.1.0", - "_npmUser": { - "name": "simov", - "email": "simeonvelichkov@gmail.com" + "directories": {}, + "dist": { + "shasum": "cf91d2e000752b1217155c005241911991a2346a", + "tarball": "http://registry.npmjs.org/request/-/request-2.69.0.tgz" + }, + "engines": { + "node": ">=0.8.0" }, + "gitHead": "1c2fb40c74efb4f706f350a78dbd5e58fe913af3", + "homepage": "https://github.com/request/request#readme", + "license": "Apache-2.0", + "main": "index.js", "maintainers": [ { "name": "mikeal", @@ -102,11 +121,25 @@ "email": "simeonvelichkov@gmail.com" } ], - "dist": { - "shasum": "96a582423ce9b4b5c34e9b232e480173f14ba608", - "tarball": "http://registry.npmjs.org/request/-/request-2.64.0.tgz" + "name": "request", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/request/request.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/request/-/request-2.64.0.tgz", - "readme": "ERROR: No README data found!" + "scripts": { + "lint": "eslint lib/ *.js tests/ && echo Lint passed.", + "test": "npm run lint && npm run test-ci && npm run test-browser", + "test-browser": "node tests/browser/start.js", + "test-ci": "taper tests/test-*.js", + "test-cov": "istanbul cover tape tests/test-*.js" + }, + "tags": [ + "http", + "simple", + "util", + "utility" + ], + "version": "2.69.0" } diff --git a/deps/npm/node_modules/request/request.js b/deps/npm/node_modules/request/request.js index af91a11d3b64d8..441db80f5a009c 100644 --- a/deps/npm/node_modules/request/request.js +++ b/deps/npm/node_modules/request/request.js @@ -8,13 +8,15 @@ var http = require('http') , zlib = require('zlib') , bl = require('bl') , hawk = require('hawk') - , aws = require('aws-sign2') + , aws2 = require('aws-sign2') , httpSignature = require('http-signature') , mime = require('mime-types') , stringstream = require('stringstream') , caseless = require('caseless') , ForeverAgent = require('forever-agent') , FormData = require('form-data') + , extend = require('extend') + , isTypedArray = require('is-typedarray').strict , helpers = require('./lib/helpers') , cookies = require('./lib/cookies') , getProxyFromURI = require('./lib/getProxyFromURI') @@ -122,8 +124,7 @@ function Request (options) { var reserved = Object.keys(Request.prototype) var nonReserved = filterForNonReserved(reserved, options) - stream.Stream.call(self) - util._extend(self, nonReserved) + extend(self, nonReserved) options = filterOutReservedFunctions(reserved, options) self.readable = true @@ -249,6 +250,11 @@ Request.prototype.init = function (options) { self.uri = url.parse(self.uri) } + // Some URL objects are not from a URL parsed string and need href added + if (!self.uri.href) { + self.uri.href = url.format(self.uri) + } + // DEPRECATED: Warning for users of the old Unix Sockets URL Scheme if (self.uri.protocol === 'unix:') { return self.emit('error', new Error('`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`')) @@ -277,6 +283,7 @@ Request.prototype.init = function (options) { message += '. This can be caused by a crappy redirection.' } // This error was fatal + self.abort() return self.emit('error', new Error(message)) } @@ -284,7 +291,7 @@ Request.prototype.init = function (options) { self.proxy = getProxyFromURI(self.uri) } - self.tunnel = self._tunnel.isEnabled(options) + self.tunnel = self._tunnel.isEnabled() if (self.proxy) { self._tunnel.setup(options) } @@ -422,6 +429,10 @@ Request.prototype.init = function (options) { } function setContentLength () { + if (isTypedArray(self.body)) { + self.body = new Buffer(self.body) + } + if (!self.hasHeader('content-length')) { var length if (typeof self.body === 'string') { @@ -569,7 +580,7 @@ Request.prototype.init = function (options) { // Before ending the request, we had to compute the length of the whole form, asyncly self.setHeader(self._form.getHeaders(), true) self._form.getLength(function (err, length) { - if (!err) { + if (!err && !isNaN(length)) { self.setHeader('content-length', length) } end() @@ -583,63 +594,6 @@ Request.prototype.init = function (options) { } -// Must call this when following a redirect from https to http or vice versa -// Attempts to keep everything as identical as possible, but update the -// httpModule, Tunneling agent, and/or Forever Agent in use. -Request.prototype._updateProtocol = function () { - var self = this - var protocol = self.uri.protocol - - if (protocol === 'https:' || self.tunnel) { - // previously was doing http, now doing https - // if it's https, then we might need to tunnel now. - if (self.proxy) { - if (self._tunnel.setup()) { - return - } - } - - self.httpModule = https - switch (self.agentClass) { - case ForeverAgent: - self.agentClass = ForeverAgent.SSL - break - case http.Agent: - self.agentClass = https.Agent - break - default: - // nothing we can do. Just hope for the best. - return - } - - // if there's an agent, we need to get a new one. - if (self.agent) { - self.agent = self.getNewAgent() - } - - } else { - // previously was doing https, now doing http - self.httpModule = http - switch (self.agentClass) { - case ForeverAgent.SSL: - self.agentClass = ForeverAgent - break - case https.Agent: - self.agentClass = http.Agent - break - default: - // nothing we can do. just hope for the best - return - } - - // if there's an agent, then get a new one. - if (self.agent) { - self.agent = null - self.agent = self.getNewAgent() - } - } -} - Request.prototype.getNewAgent = function () { var self = this var Agent = self.agentClass @@ -1014,54 +968,7 @@ Request.prototype.onRequestResponse = function (response) { responseContent.on('close', function () {self.emit('close')}) if (self.callback) { - var buffer = bl() - , strings = [] - - self.on('data', function (chunk) { - if (Buffer.isBuffer(chunk)) { - buffer.append(chunk) - } else { - strings.push(chunk) - } - }) - self.on('end', function () { - debug('end event', self.uri.href) - if (self._aborted) { - debug('aborted', self.uri.href) - return - } - - if (buffer.length) { - debug('has body', self.uri.href, buffer.length) - if (self.encoding === null) { - // response.body = buffer - // can't move to this until https://github.com/rvagg/bl/issues/13 - response.body = buffer.slice() - } else { - response.body = buffer.toString(self.encoding) - } - } else if (strings.length) { - // The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation. - // Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse(). - if (self.encoding === 'utf8' && strings[0].length > 0 && strings[0][0] === '\uFEFF') { - strings[0] = strings[0].substring(1) - } - response.body = strings.join('') - } - - if (self._json) { - try { - response.body = JSON.parse(response.body, self._jsonReviver) - } catch (e) { - debug('invalid JSON received', self.uri.href) - } - } - debug('emitting complete', self.uri.href) - if (typeof response.body === 'undefined' && !self._json) { - response.body = self.encoding === null ? new Buffer(0) : '' - } - self.emit('complete', response, response.body) - }) + self.readResponseBody(response) } //if no callback else { @@ -1077,6 +984,59 @@ Request.prototype.onRequestResponse = function (response) { debug('finish init function', self.uri.href) } +Request.prototype.readResponseBody = function (response) { + var self = this + debug('reading response\'s body') + var buffer = bl() + , strings = [] + + self.on('data', function (chunk) { + if (Buffer.isBuffer(chunk)) { + buffer.append(chunk) + } else { + strings.push(chunk) + } + }) + self.on('end', function () { + debug('end event', self.uri.href) + if (self._aborted) { + debug('aborted', self.uri.href) + return + } + + if (buffer.length) { + debug('has body', self.uri.href, buffer.length) + if (self.encoding === null) { + // response.body = buffer + // can't move to this until https://github.com/rvagg/bl/issues/13 + response.body = buffer.slice() + } else { + response.body = buffer.toString(self.encoding) + } + } else if (strings.length) { + // The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation. + // Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse(). + if (self.encoding === 'utf8' && strings[0].length > 0 && strings[0][0] === '\uFEFF') { + strings[0] = strings[0].substring(1) + } + response.body = strings.join('') + } + + if (self._json) { + try { + response.body = JSON.parse(response.body, self._jsonReviver) + } catch (e) { + debug('invalid JSON received', self.uri.href) + } + } + debug('emitting complete', self.uri.href) + if (typeof response.body === 'undefined' && !self._json) { + response.body = self.encoding === null ? new Buffer(0) : '' + } + self.emit('complete', response, response.body) + }) +} + Request.prototype.abort = function () { var self = this self._aborted = true @@ -1085,7 +1045,7 @@ Request.prototype.abort = function () { self.req.abort() } else if (self.response) { - self.response.abort() + self.response.destroy() } self.emit('abort') @@ -1143,12 +1103,12 @@ Request.prototype.qs = function (q, clobber) { base[i] = q[i] } - if (self._qs.stringify(base) === '') { + var qs = self._qs.stringify(base) + + if (qs === '') { return self } - var qs = self._qs.stringify(base) - self.uri = url.parse(self.uri.href.split('?')[0] + '?' + qs) self.url = self.uri self.path = self.uri.path @@ -1269,29 +1229,52 @@ Request.prototype.aws = function (opts, now) { self._aws = opts return self } - var date = new Date() - self.setHeader('date', date.toUTCString()) - var auth = - { key: opts.key - , secret: opts.secret - , verb: self.method.toUpperCase() - , date: date - , contentType: self.getHeader('content-type') || '' - , md5: self.getHeader('content-md5') || '' - , amazonHeaders: aws.canonicalizeHeaders(self.headers) + + if (opts.sign_version == 4 || opts.sign_version == '4') { + var aws4 = require('aws4') + // use aws4 + var options = { + host: self.uri.host, + path: self.uri.path, + method: self.method, + headers: { + 'content-type': self.getHeader('content-type') || '' + }, + body: self.body + } + var signRes = aws4.sign(options, { + accessKeyId: opts.key, + secretAccessKey: opts.secret + }) + self.setHeader('authorization', signRes.headers.Authorization) + self.setHeader('x-amz-date', signRes.headers['X-Amz-Date']) + } + else { + // default: use aws-sign2 + var date = new Date() + self.setHeader('date', date.toUTCString()) + var auth = + { key: opts.key + , secret: opts.secret + , verb: self.method.toUpperCase() + , date: date + , contentType: self.getHeader('content-type') || '' + , md5: self.getHeader('content-md5') || '' + , amazonHeaders: aws2.canonicalizeHeaders(self.headers) + } + var path = self.uri.path + if (opts.bucket && path) { + auth.resource = '/' + opts.bucket + path + } else if (opts.bucket && !path) { + auth.resource = '/' + opts.bucket + } else if (!opts.bucket && path) { + auth.resource = path + } else if (!opts.bucket && !path) { + auth.resource = '/' } - var path = self.uri.path - if (opts.bucket && path) { - auth.resource = '/' + opts.bucket + path - } else if (opts.bucket && !path) { - auth.resource = '/' + opts.bucket - } else if (!opts.bucket && path) { - auth.resource = path - } else if (!opts.bucket && !path) { - auth.resource = '/' - } - auth.resource = aws.canonicalizeResource(auth.resource) - self.setHeader('authorization', aws.authorization(auth)) + auth.resource = aws2.canonicalizeResource(auth.resource) + self.setHeader('authorization', aws2.authorization(auth)) + } return self } @@ -1380,6 +1363,8 @@ Request.prototype.pipe = function (dest, opts) { } Request.prototype.write = function () { var self = this + if (self._aborted) {return} + if (!self._started) { self.start() } @@ -1387,6 +1372,8 @@ Request.prototype.write = function () { } Request.prototype.end = function (chunk) { var self = this + if (self._aborted) {return} + if (chunk) { self.write(chunk) } diff --git a/deps/npm/node_modules/retry/Readme.md b/deps/npm/node_modules/retry/Readme.md index 09d9c8a81bf121..26e50a3a7f3c6a 100644 --- a/deps/npm/node_modules/retry/Readme.md +++ b/deps/npm/node_modules/retry/Readme.md @@ -57,8 +57,10 @@ var operation = retry.operation({ ### retry.operation([options]) -Creates a new `RetryOperation` object. See the `retry.timeouts()` function -below for available `options`. +Creates a new `RetryOperation` object. `options` is the same as `retry.timeouts()`'s `options`, with two additions: + +* `forever`: Whether to retry forever, defaults to `false`. +* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. ### retry.timeouts([options]) @@ -126,11 +128,19 @@ retry.wrap(obj, {retries: 3}, ['method1', 'method2']); ``` The `options` object can take any options that the usual call to `retry.operation` can take. -### new RetryOperation(timeouts) +### new RetryOperation(timeouts, [options]) Creates a new `RetryOperation` where `timeouts` is an array where each value is a timeout given in milliseconds. +Available options: +* `forever`: Whether to retry forever, defaults to `false`. +* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. + +If `forever` is true, the following changes happen: +* `RetryOperation.errors()` will only output an array of one item: the last error. +* `RetryOperation` will repeatedly use the last item in the `timeouts` array. + #### retryOperation.errors() Returns an array of all errors that have been passed to @@ -157,11 +167,11 @@ Whenever your retry operation takes longer than `timeout` to execute, the timeou #### retryOperation.try(fn) -This is an alias for `retryOperation.attempt(fn)`. This is deprecated. +This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead. #### retryOperation.start(fn) -This is an alias for `retryOperation.attempt(fn)`. This is deprecated. +This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead. #### retryOperation.retry(error) @@ -180,13 +190,15 @@ Returns an int representing the number of attempts it took to call `fn` before i retry is licensed under the MIT license. -#Changelog +# Changelog + +0.8.0 Implementing retry.wrap. -0.7.0 Some bugfixes and made retry.createTimeout() public. Fixed issues [#10](https://github.com/tim-kos/node-retry/issues/10), [#12](https://github.com/tim-kos/node-retry/issues/12), and [#13](https://github.com/tim-kos/node-retry/issues/13). +0.7.0 Some bug fixes and made retry.createTimeout() public. Fixed issues [#10](https://github.com/tim-kos/node-retry/issues/10), [#12](https://github.com/tim-kos/node-retry/issues/12), and [#13](https://github.com/tim-kos/node-retry/issues/13). -0.6.0 Introduced optional timeOps parameter for the attempt() function which is an object having a property timeout in miliseconds and a property cb callback function. Whenever your retry operation takes longer than timeout to execute, the timeout callback function cb is called. +0.6.0 Introduced optional timeOps parameter for the attempt() function which is an object having a property timeout in milliseconds and a property cb callback function. Whenever your retry operation takes longer than timeout to execute, the timeout callback function cb is called. -0.5.0 Some minor refactorings. +0.5.0 Some minor refactoring. 0.4.0 Changed retryOperation.try() to retryOperation.attempt(). Deprecated the aliases start() and try() for it. diff --git a/deps/npm/node_modules/retry/lib/retry.js b/deps/npm/node_modules/retry/lib/retry.js index 94685652c426fd..02ab14729bd8b7 100644 --- a/deps/npm/node_modules/retry/lib/retry.js +++ b/deps/npm/node_modules/retry/lib/retry.js @@ -1,10 +1,11 @@ var RetryOperation = require('./retry_operation'); exports.operation = function(options) { - var retryForever = false; - if (options && options.forever === true) retryForever = true; var timeouts = exports.timeouts(options); - return new RetryOperation(timeouts, retryForever); + return new RetryOperation(timeouts, { + forever: options && options.forever, + unref: options && options.unref + }); }; exports.timeouts = function(options) { diff --git a/deps/npm/node_modules/retry/lib/retry_operation.js b/deps/npm/node_modules/retry/lib/retry_operation.js index 52b895544e6a58..ad96efbdf3b02d 100644 --- a/deps/npm/node_modules/retry/lib/retry_operation.js +++ b/deps/npm/node_modules/retry/lib/retry_operation.js @@ -1,5 +1,11 @@ -function RetryOperation(timeouts, retryForever) { +function RetryOperation(timeouts, options) { + // Compatibility for the old (timeouts, retryForever) signature + if (typeof options === 'boolean') { + options = { forever: options }; + } + this._timeouts = timeouts; + this._options = options || {}; this._fn = null; this._errors = []; this._attempts = 1; @@ -7,7 +13,7 @@ function RetryOperation(timeouts, retryForever) { this._operationTimeoutCb = null; this._timeout = null; - if (!!retryForever) { + if (this._options.forever) { this._cachedTimeouts = this._timeouts.slice(0); } } @@ -37,18 +43,26 @@ RetryOperation.prototype.retry = function(err) { } var self = this; - setTimeout(function() { + var timer = setTimeout(function() { self._attempts++; if (self._operationTimeoutCb) { self._timeout = setTimeout(function() { self._operationTimeoutCb(self._attempts); }, self._operationTimeout); + + if (this._options.unref) { + self._timeout.unref(); + } } self._fn(self._attempts); }, timeout); + if (this._options.unref) { + timer.unref(); + } + return true; }; diff --git a/deps/npm/node_modules/retry/package.json b/deps/npm/node_modules/retry/package.json index 75b9680d5a9d66..9d2283a3986e54 100644 --- a/deps/npm/node_modules/retry/package.json +++ b/deps/npm/node_modules/retry/package.json @@ -1,53 +1,79 @@ { - "author": { - "name": "Tim Koschützki", + "_args": [ + [ + "retry@latest", + "/Users/rebecca/code/npm" + ] + ], + "_from": "retry@latest", + "_id": "retry@0.9.0", + "_inCache": true, + "_installable": true, + "_location": "/retry", + "_nodeVersion": "4.2.1", + "_npmUser": { "email": "tim@debuggable.com", - "url": "http://debuggable.com/" + "name": "tim-kos" }, - "name": "retry", - "description": "Abstraction for exponential and custom retry strategies for failed operations.", - "license": "MIT", - "version": "0.8.0", - "homepage": "https://github.com/tim-kos/node-retry", - "repository": { - "type": "git", - "url": "git://github.com/tim-kos/node-retry.git" + "_npmVersion": "2.1.7", + "_phantomChildren": {}, + "_requested": { + "name": "retry", + "raw": "retry@latest", + "rawSpec": "latest", + "scope": null, + "spec": "latest", + "type": "tag" }, - "directories": { - "lib": "./lib" + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/retry/-/retry-0.9.0.tgz", + "_shasum": "6f697e50a0e4ddc8c8f7fb547a9b60dead43678d", + "_shrinkwrap": null, + "_spec": "retry@latest", + "_where": "/Users/rebecca/code/npm", + "author": { + "email": "tim@debuggable.com", + "name": "Tim Koschützki", + "url": "http://debuggable.com/" }, - "main": "index", - "engines": { - "node": "*" + "bugs": { + "url": "https://github.com/tim-kos/node-retry/issues" }, "dependencies": {}, + "description": "Abstraction for exponential and custom retry strategies for failed operations.", "devDependencies": { "fake": "0.2.0", "far": "0.0.1" }, - "gitHead": "9446e803d6a41ae08732a4a215ae5bf1ff1ccfdd", - "bugs": { - "url": "https://github.com/tim-kos/node-retry/issues" + "directories": { + "lib": "./lib" }, - "_id": "retry@0.8.0", - "scripts": {}, - "_shasum": "2367628dc0edb247b1eab649dc53ac8628ac2d5f", - "_from": "retry@0.8.0", - "_npmVersion": "2.1.7", - "_nodeVersion": "0.10.33", - "_npmUser": { - "name": "tim-kos", - "email": "tim@debuggable.com" + "dist": { + "shasum": "6f697e50a0e4ddc8c8f7fb547a9b60dead43678d", + "tarball": "http://registry.npmjs.org/retry/-/retry-0.9.0.tgz" }, + "engines": { + "node": "*" + }, + "gitHead": "1b621cf499ef7647d005e3650006b93a8dbeb986", + "homepage": "https://github.com/tim-kos/node-retry", + "license": "MIT", + "main": "index", "maintainers": [ { "name": "tim-kos", "email": "tim@debuggable.com" } ], - "dist": { - "shasum": "2367628dc0edb247b1eab649dc53ac8628ac2d5f", - "tarball": "http://registry.npmjs.org/retry/-/retry-0.8.0.tgz" + "name": "retry", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/tim-kos/node-retry.git" }, - "_resolved": "https://registry.npmjs.org/retry/-/retry-0.8.0.tgz" + "scripts": {}, + "version": "0.9.0" } diff --git a/deps/npm/node_modules/rimraf/README.md b/deps/npm/node_modules/rimraf/README.md index 18659f67fa3205..423b8cf854ad3e 100644 --- a/deps/npm/node_modules/rimraf/README.md +++ b/deps/npm/node_modules/rimraf/README.md @@ -1,12 +1,17 @@ [![Build Status](https://travis-ci.org/isaacs/rimraf.svg?branch=master)](https://travis-ci.org/isaacs/rimraf) [![Dependency Status](https://david-dm.org/isaacs/rimraf.svg)](https://david-dm.org/isaacs/rimraf) [![devDependency Status](https://david-dm.org/isaacs/rimraf/dev-status.svg)](https://david-dm.org/isaacs/rimraf#info=devDependencies) -The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node. +The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node. Install with `npm install rimraf`, or just drop rimraf.js somewhere. ## API -`rimraf(f, callback)` +`rimraf(f, [opts], callback)` + +The first parameter will be interpreted as a globbing pattern for files. If you +want to disable globbing you can do so with `opts.disableGlob` (defaults to +`false`). This might be handy, for instance, if you have filenames that contain +globbing wildcard characters. The callback will be called with an error if there is one. Certain errors are handled for you: @@ -22,6 +27,64 @@ errors are handled for you: async case, rimraf will gradually back off with timeouts up to `opts.emfileWait` ms, which defaults to 1000. +## options + +* unlink, chmod, stat, lstat, rmdir, readdir, + unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync + + In order to use a custom file system library, you can override + specific fs functions on the options object. + + If any of these functions are present on the options object, then + the supplied function will be used instead of the default fs + method. + + Sync methods are only relevant for `rimraf.sync()`, of course. + + For example: + + ```javascript + var myCustomFS = require('some-custom-fs') + + rimraf('some-thing', myCustomFS, callback) + ``` + +* maxBusyTries + + If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error code is encountered + on Windows systems, then rimraf will retry with a linear backoff + wait of 100ms longer on each try. The default maxBusyTries is 3. + + Only relevant for async usage. + +* emfileWait + + If an `EMFILE` error is encountered, then rimraf will retry + repeatedly with a linear backoff of 1ms longer on each try, until + the timeout counter hits this max. The default limit is 1000. + + If you repeatedly encounter `EMFILE` errors, then consider using + [graceful-fs](http://npm.im/graceful-fs) in your program. + + Only relevant for async usage. + +* glob + + Set to `false` to disable [glob](http://npm.im/glob) pattern + matching. + + Set to an object to pass options to the glob module. The default + glob options are `{ nosort: true, silent: true }`. + + Glob version 6 is used in this module. + + Relevant for both sync and async usage. + +* disableGlob + + Set to any non-falsey value to disable globbing entirely. + (Equivalent to setting `glob: false`.) + ## rimraf.sync It can remove stuff synchronously, too. But that's not so good. Use diff --git a/deps/npm/node_modules/rimraf/package.json b/deps/npm/node_modules/rimraf/package.json index 7576f528f72db2..ccc09c5afd7a47 100644 --- a/deps/npm/node_modules/rimraf/package.json +++ b/deps/npm/node_modules/rimraf/package.json @@ -1,26 +1,73 @@ { - "name": "rimraf", - "version": "2.4.3", - "main": "rimraf.js", - "description": "A deep deletion module for node (like `rm -rf`)", - "author": { - "name": "Isaac Z. Schlueter", + "_args": [ + [ + "rimraf@~2.5.1", + "/Users/rebecca/code/npm" + ] + ], + "_from": "rimraf@>=2.5.1 <2.6.0", + "_id": "rimraf@2.5.2", + "_inCache": true, + "_installable": true, + "_location": "/rimraf", + "_nodeVersion": "5.6.0", + "_npmOperationalInternal": { + "host": "packages-6-west.internal.npmjs.com", + "tmp": "tmp/rimraf-2.5.2.tgz_1455346499772_0.9326622514054179" + }, + "_npmUser": { "email": "i@izs.me", - "url": "http://blog.izs.me/" + "name": "isaacs" }, - "license": "ISC", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/rimraf.git" + "_npmVersion": "3.7.0", + "_phantomChildren": {}, + "_requested": { + "name": "rimraf", + "raw": "rimraf@~2.5.1", + "rawSpec": "~2.5.1", + "scope": null, + "spec": ">=2.5.1 <2.6.0", + "type": "range" }, - "scripts": { - "test": "tap test/*.js" + "_requiredBy": [ + "/", + "/fs-vacuum", + "/fstream", + "/node-gyp", + "/npm-registry-client", + "/standard/standard-engine/eslint/file-entry-cache/flat-cache/del", + "/tacks", + "/tap/nyc", + "/tap/nyc/spawn-wrap" + ], + "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.2.tgz", + "_shasum": "62ba947fa4c0b4363839aefecd4f0fbad6059726", + "_shrinkwrap": null, + "_spec": "rimraf@~2.5.1", + "_where": "/Users/rebecca/code/npm", + "author": { + "email": "i@izs.me", + "name": "Isaac Z. Schlueter", + "url": "http://blog.izs.me/" }, "bin": { "rimraf": "./bin.js" }, + "bugs": { + "url": "https://github.com/isaacs/rimraf/issues" + }, "dependencies": { - "glob": "^5.0.14" + "glob": "^7.0.0" + }, + "description": "A deep deletion module for node (like `rm -rf`)", + "devDependencies": { + "mkdirp": "^0.5.1", + "tap": "^5.1.1" + }, + "directories": {}, + "dist": { + "shasum": "62ba947fa4c0b4363839aefecd4f0fbad6059726", + "tarball": "http://registry.npmjs.org/rimraf/-/rimraf-2.5.2.tgz" }, "files": [ "LICENSE", @@ -28,34 +75,25 @@ "bin.js", "rimraf.js" ], - "devDependencies": { - "mkdirp": "^0.5.1", - "tap": "^1.3.1" - }, - "gitHead": "ec7050f8ca14c931b847414f18466e601ca7c02e", - "bugs": { - "url": "https://github.com/isaacs/rimraf/issues" - }, + "gitHead": "f414f87021f88d004ac487eebc8d07ce6a152721", "homepage": "https://github.com/isaacs/rimraf#readme", - "_id": "rimraf@2.4.3", - "_shasum": "e5b51c9437a4c582adb955e9f28cf8d945e272af", - "_from": "rimraf@2.4.3", - "_npmVersion": "3.2.2", - "_nodeVersion": "2.2.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "e5b51c9437a4c582adb955e9f28cf8d945e272af", - "tarball": "http://registry.npmjs.org/rimraf/-/rimraf-2.4.3.tgz" - }, + "license": "ISC", + "main": "rimraf.js", "maintainers": [ { - "name": "isaacs", - "email": "i@izs.me" + "email": "i@izs.me", + "name": "isaacs" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.3.tgz" + "name": "rimraf", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/rimraf.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "2.5.2" } diff --git a/deps/npm/node_modules/rimraf/rimraf.js b/deps/npm/node_modules/rimraf/rimraf.js index 7771b530caa3e3..c01d13b200cc5e 100644 --- a/deps/npm/node_modules/rimraf/rimraf.js +++ b/deps/npm/node_modules/rimraf/rimraf.js @@ -6,10 +6,8 @@ var path = require("path") var fs = require("fs") var glob = require("glob") -var globOpts = { +var defaultGlobOpts = { nosort: true, - nocomment: true, - nonegate: true, silent: true } @@ -35,7 +33,11 @@ function defaults (options) { options.maxBusyTries = options.maxBusyTries || 3 options.emfileWait = options.emfileWait || 1000 + if (options.glob === false) { + options.disableGlob = true + } options.disableGlob = options.disableGlob || false + options.glob = options.glob || defaultGlobOpts } function rimraf (p, options, cb) { @@ -63,7 +65,7 @@ function rimraf (p, options, cb) { if (!er) return afterGlob(null, [p]) - glob(p, globOpts, afterGlob) + glob(p, options.glob, afterGlob) }) function next (er) { @@ -270,7 +272,7 @@ function rimrafSync (p, options) { fs.lstatSync(p) results = [p] } catch (er) { - results = glob.sync(p, globOpts) + results = glob.sync(p, options.glob) } } diff --git a/deps/npm/node_modules/semver/README.md b/deps/npm/node_modules/semver/README.md index b5e35ff0b5bd95..0b14a7e8103b07 100644 --- a/deps/npm/node_modules/semver/README.md +++ b/deps/npm/node_modules/semver/README.md @@ -107,7 +107,7 @@ The method `.inc` takes an additional `identifier` string argument that will append the value of the string as a prerelease identifier: ```javascript -> semver.inc('1.2.3', 'pre', 'beta') +> semver.inc('1.2.3', 'prerelease', 'beta') '1.2.4-beta.0' ``` @@ -228,6 +228,30 @@ zero. * `^1.x` := `>=1.0.0 <2.0.0` * `^0.x` := `>=0.0.0 <1.0.0` +### Range Grammar + +Putting all this together, here is a Backus-Naur grammar for ranges, +for the benefit of parser authors: + +```bnf +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | ['1'-'9']['0'-'9']+ +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ +``` + ## Functions All methods and classes take a final `loose` boolean argument that, if diff --git a/deps/npm/node_modules/semver/package.json b/deps/npm/node_modules/semver/package.json index b3a540c1643bb5..b1dfe4040c7bac 100644 --- a/deps/npm/node_modules/semver/package.json +++ b/deps/npm/node_modules/semver/package.json @@ -1,40 +1,65 @@ { - "name": "semver", - "version": "5.0.3", - "description": "The semantic version parser used by npm.", - "main": "semver.js", - "scripts": { - "test": "tap test/*.js" - }, - "devDependencies": { - "tap": "^1.3.4" + "_args": [ + [ + "semver@~5.1.0", + "/Users/ogd/Documents/projects/npm/npm" + ] + ], + "_from": "semver@>=5.1.0 <5.2.0", + "_id": "semver@5.1.0", + "_inCache": true, + "_installable": true, + "_location": "/semver", + "_nodeVersion": "4.0.0", + "_npmUser": { + "email": "i@izs.me", + "name": "isaacs" }, - "license": "ISC", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/node-semver.git" + "_npmVersion": "3.3.2", + "_phantomChildren": {}, + "_requested": { + "name": "semver", + "raw": "semver@~5.1.0", + "rawSpec": "~5.1.0", + "scope": null, + "spec": ">=5.1.0 <5.2.0", + "type": "range" }, + "_requiredBy": [ + "/", + "/init-package-json", + "/node-gyp", + "/normalize-package-data", + "/npm-install-checks", + "/npm-package-arg", + "/npm-registry-client", + "/read-installed" + ], + "_resolved": "https://registry.npmjs.org/semver/-/semver-5.1.0.tgz", + "_shasum": "85f2cf8550465c4df000cf7d86f6b054106ab9e5", + "_shrinkwrap": null, + "_spec": "semver@~5.1.0", + "_where": "/Users/ogd/Documents/projects/npm/npm", "bin": { "semver": "./bin/semver" }, - "gitHead": "5f89ecbe78145ad0b501cf6279f602a23c89738d", "bugs": { "url": "https://github.com/npm/node-semver/issues" }, - "homepage": "https://github.com/npm/node-semver#readme", - "_id": "semver@5.0.3", - "_shasum": "77466de589cd5d3c95f138aa78bc569a3cb5d27a", - "_from": "semver@5.0.3", - "_npmVersion": "3.3.2", - "_nodeVersion": "4.0.0", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" + "dependencies": {}, + "description": "The semantic version parser used by npm.", + "devDependencies": { + "tap": "^2.0.0" }, + "directories": {}, "dist": { - "shasum": "77466de589cd5d3c95f138aa78bc569a3cb5d27a", - "tarball": "http://registry.npmjs.org/semver/-/semver-5.0.3.tgz" + "shasum": "85f2cf8550465c4df000cf7d86f6b054106ab9e5", + "tarball": "http://registry.npmjs.org/semver/-/semver-5.1.0.tgz" }, + "gitHead": "8e33a30e62e40e4983d1c5f55e794331b861aadc", + "homepage": "https://github.com/npm/node-semver#readme", + "license": "ISC", + "main": "semver.js", "maintainers": [ { "name": "isaacs", @@ -45,6 +70,15 @@ "email": "ogd@aoaioxxysz.net" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/semver/-/semver-5.0.3.tgz" + "name": "semver", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/node-semver.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "5.1.0" } diff --git a/deps/npm/node_modules/semver/range.bnf b/deps/npm/node_modules/semver/range.bnf new file mode 100644 index 00000000000000..000df923a6963f --- /dev/null +++ b/deps/npm/node_modules/semver/range.bnf @@ -0,0 +1,16 @@ +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | ['1'-'9']['0'-'9']+ +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ diff --git a/deps/npm/node_modules/semver/semver.js b/deps/npm/node_modules/semver/semver.js index 19392d8ff9fc7d..71795f6f0720ae 100644 --- a/deps/npm/node_modules/semver/semver.js +++ b/deps/npm/node_modules/semver/semver.js @@ -332,10 +332,6 @@ SemVer.prototype.format = function() { return this.version; }; -SemVer.prototype.inspect = function() { - return ''; -}; - SemVer.prototype.toString = function() { return this.version; }; @@ -692,10 +688,6 @@ Comparator.prototype.parse = function(comp) { this.semver = new SemVer(m[2], this.loose); }; -Comparator.prototype.inspect = function() { - return ''; -}; - Comparator.prototype.toString = function() { return this.value; }; @@ -739,10 +731,6 @@ function Range(range, loose) { this.format(); } -Range.prototype.inspect = function() { - return ''; -}; - Range.prototype.format = function() { this.range = this.set.map(function(comps) { return comps.join(' ').trim(); diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/.npmignore b/deps/npm/node_modules/sha/node_modules/readable-stream/.npmignore deleted file mode 100644 index 38344f87a62766..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -build/ -test/ -examples/ -fs.js -zlib.js \ No newline at end of file diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/.travis.yml b/deps/npm/node_modules/sha/node_modules/readable-stream/.travis.yml deleted file mode 100644 index a2870dfb162343..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/.travis.yml +++ /dev/null @@ -1,39 +0,0 @@ -sudo: false -language: node_js -before_install: - - npm install -g npm -notifications: - email: false -matrix: - include: - - node_js: '0.8' - env: TASK=test - - node_js: '0.10' - env: TASK=test - - node_js: '0.11' - env: TASK=test - - node_js: '0.12' - env: TASK=test - - node_js: 'iojs' - env: TASK=test - - node_js: 'iojs' - env: TASK=browser BROWSER_NAME=opera BROWSER_VERSION="11..latest" - - node_js: 'iojs' - env: TASK=browser BROWSER_NAME=ie BROWSER_VERSION="9..latest" - - node_js: 'iojs' - env: TASK=browser BROWSER_NAME=chrome BROWSER_VERSION="39..beta" - - node_js: 'iojs' - env: TASK=browser BROWSER_NAME=firefox BROWSER_VERSION="34..beta" - - node_js: 'iojs' - env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="6.0..latest" - - node_js: 'iojs' - env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="6.0..latest" - - node_js: 'iojs' - env: TASK=browser BROWSER_NAME=safari BROWSER_VERSION="5..latest" - - node_js: 'iojs' - env: TASK=browser BROWSER_NAME=android BROWSER_VERSION="4.0..latest" -script: "npm run $TASK" -env: - global: - - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= - - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/.zuul.yml b/deps/npm/node_modules/sha/node_modules/readable-stream/.zuul.yml deleted file mode 100644 index 96d9cfbd38662f..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/.zuul.yml +++ /dev/null @@ -1 +0,0 @@ -ui: tape diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/LICENSE b/deps/npm/node_modules/sha/node_modules/readable-stream/LICENSE deleted file mode 100644 index e3d4e695a4cff2..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/README.md b/deps/npm/node_modules/sha/node_modules/readable-stream/README.md deleted file mode 100644 index 77fafa3da15f9f..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# readable-stream - -***Node-core streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) - - -[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) -[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) - - -[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) - -```bash -npm install --save readable-stream -``` - -***Node-core streams for userland*** - -This package is a mirror of the Streams2 and Streams3 implementations in -Node-core, including [documentation](doc/stream.markdown). - -If you want to guarantee a stable streams base, regardless of what version of -Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). - -As of version 2.0.0 **readable-stream** uses semantic versioning. - -# Streams WG Team Members - -* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> - - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B -* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> - - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 -* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> - - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D -* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> -* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> -* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/doc/stream.markdown b/deps/npm/node_modules/sha/node_modules/readable-stream/doc/stream.markdown deleted file mode 100644 index a2270c88057950..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/doc/stream.markdown +++ /dev/null @@ -1,1651 +0,0 @@ -# Stream - - Stability: 2 - Stable - -A stream is an abstract interface implemented by various objects in -io.js. For example a [request to an HTTP -server](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_http_incomingmessage) is a stream, as is -[stdout][]. Streams are readable, writable, or both. All streams are -instances of [EventEmitter][] - -You can load the Stream base classes by doing `require('stream')`. -There are base classes provided for [Readable][] streams, [Writable][] -streams, [Duplex][] streams, and [Transform][] streams. - -This document is split up into 3 sections. The first explains the -parts of the API that you need to be aware of to use streams in your -programs. If you never implement a streaming API yourself, you can -stop there. - -The second section explains the parts of the API that you need to use -if you implement your own custom streams yourself. The API is -designed to make this easy for you to do. - -The third section goes into more depth about how streams work, -including some of the internal mechanisms and functions that you -should probably not modify unless you definitely know what you are -doing. - - -## API for Stream Consumers - - - -Streams can be either [Readable][], [Writable][], or both ([Duplex][]). - -All streams are EventEmitters, but they also have other custom methods -and properties depending on whether they are Readable, Writable, or -Duplex. - -If a stream is both Readable and Writable, then it implements all of -the methods and events below. So, a [Duplex][] or [Transform][] stream is -fully described by this API, though their implementation may be -somewhat different. - -It is not necessary to implement Stream interfaces in order to consume -streams in your programs. If you **are** implementing streaming -interfaces in your own program, please also refer to -[API for Stream Implementors][] below. - -Almost all io.js programs, no matter how simple, use Streams in some -way. Here is an example of using Streams in an io.js program: - -```javascript -var http = require('http'); - -var server = http.createServer(function (req, res) { - // req is an http.IncomingMessage, which is a Readable Stream - // res is an http.ServerResponse, which is a Writable Stream - - var body = ''; - // we want to get the data as utf8 strings - // If you don't set an encoding, then you'll get Buffer objects - req.setEncoding('utf8'); - - // Readable streams emit 'data' events once a listener is added - req.on('data', function (chunk) { - body += chunk; - }); - - // the end event tells you that you have entire body - req.on('end', function () { - try { - var data = JSON.parse(body); - } catch (er) { - // uh oh! bad json! - res.statusCode = 400; - return res.end('error: ' + er.message); - } - - // write back something interesting to the user: - res.write(typeof data); - res.end(); - }); -}); - -server.listen(1337); - -// $ curl localhost:1337 -d '{}' -// object -// $ curl localhost:1337 -d '"foo"' -// string -// $ curl localhost:1337 -d 'not json' -// error: Unexpected token o -``` - -### Class: stream.Readable - - - -The Readable stream interface is the abstraction for a *source* of -data that you are reading from. In other words, data comes *out* of a -Readable stream. - -A Readable stream will not start emitting data until you indicate that -you are ready to receive it. - -Readable streams have two "modes": a **flowing mode** and a **paused -mode**. When in flowing mode, data is read from the underlying system -and provided to your program as fast as possible. In paused mode, you -must explicitly call `stream.read()` to get chunks of data out. -Streams start out in paused mode. - -**Note**: If no data event handlers are attached, and there are no -[`pipe()`][] destinations, and the stream is switched into flowing -mode, then data will be lost. - -You can switch to flowing mode by doing any of the following: - -* Adding a [`'data'` event][] handler to listen for data. -* Calling the [`resume()`][] method to explicitly open the flow. -* Calling the [`pipe()`][] method to send the data to a [Writable][]. - -You can switch back to paused mode by doing either of the following: - -* If there are no pipe destinations, by calling the [`pause()`][] - method. -* If there are pipe destinations, by removing any [`'data'` event][] - handlers, and removing all pipe destinations by calling the - [`unpipe()`][] method. - -Note that, for backwards compatibility reasons, removing `'data'` -event handlers will **not** automatically pause the stream. Also, if -there are piped destinations, then calling `pause()` will not -guarantee that the stream will *remain* paused once those -destinations drain and ask for more data. - -Examples of readable streams include: - -* [http responses, on the client](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_http_incomingmessage) -* [http requests, on the server](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_http_incomingmessage) -* [fs read streams](https://iojs.org/dist/v2.3.0/doc/api/fs.html#fs_class_fs_readstream) -* [zlib streams][] -* [crypto streams][] -* [tcp sockets][] -* [child process stdout and stderr][] -* [process.stdin][] - -#### Event: 'readable' - -When a chunk of data can be read from the stream, it will emit a -`'readable'` event. - -In some cases, listening for a `'readable'` event will cause some data -to be read into the internal buffer from the underlying system, if it -hadn't already. - -```javascript -var readable = getReadableStreamSomehow(); -readable.on('readable', function() { - // there is some data to read now -}); -``` - -Once the internal buffer is drained, a `readable` event will fire -again when more data is available. - -#### Event: 'data' - -* `chunk` {Buffer | String} The chunk of data. - -Attaching a `data` event listener to a stream that has not been -explicitly paused will switch the stream into flowing mode. Data will -then be passed as soon as it is available. - -If you just want to get all the data out of the stream as fast as -possible, this is the best way to do so. - -```javascript -var readable = getReadableStreamSomehow(); -readable.on('data', function(chunk) { - console.log('got %d bytes of data', chunk.length); -}); -``` - -#### Event: 'end' - -This event fires when there will be no more data to read. - -Note that the `end` event **will not fire** unless the data is -completely consumed. This can be done by switching into flowing mode, -or by calling `read()` repeatedly until you get to the end. - -```javascript -var readable = getReadableStreamSomehow(); -readable.on('data', function(chunk) { - console.log('got %d bytes of data', chunk.length); -}); -readable.on('end', function() { - console.log('there will be no more data.'); -}); -``` - -#### Event: 'close' - -Emitted when the underlying resource (for example, the backing file -descriptor) has been closed. Not all streams will emit this. - -#### Event: 'error' - -* {Error Object} - -Emitted if there was an error receiving data. - -#### readable.read([size]) - -* `size` {Number} Optional argument to specify how much data to read. -* Return {String | Buffer | null} - -The `read()` method pulls some data out of the internal buffer and -returns it. If there is no data available, then it will return -`null`. - -If you pass in a `size` argument, then it will return that many -bytes. If `size` bytes are not available, then it will return `null`. - -If you do not specify a `size` argument, then it will return all the -data in the internal buffer. - -This method should only be called in paused mode. In flowing mode, -this method is called automatically until the internal buffer is -drained. - -```javascript -var readable = getReadableStreamSomehow(); -readable.on('readable', function() { - var chunk; - while (null !== (chunk = readable.read())) { - console.log('got %d bytes of data', chunk.length); - } -}); -``` - -If this method returns a data chunk, then it will also trigger the -emission of a [`'data'` event][]. - -#### readable.setEncoding(encoding) - -* `encoding` {String} The encoding to use. -* Return: `this` - -Call this function to cause the stream to return strings of the -specified encoding instead of Buffer objects. For example, if you do -`readable.setEncoding('utf8')`, then the output data will be -interpreted as UTF-8 data, and returned as strings. If you do -`readable.setEncoding('hex')`, then the data will be encoded in -hexadecimal string format. - -This properly handles multi-byte characters that would otherwise be -potentially mangled if you simply pulled the Buffers directly and -called `buf.toString(encoding)` on them. If you want to read the data -as strings, always use this method. - -```javascript -var readable = getReadableStreamSomehow(); -readable.setEncoding('utf8'); -readable.on('data', function(chunk) { - assert.equal(typeof chunk, 'string'); - console.log('got %d characters of string data', chunk.length); -}); -``` - -#### readable.resume() - -* Return: `this` - -This method will cause the readable stream to resume emitting `data` -events. - -This method will switch the stream into flowing mode. If you do *not* -want to consume the data from a stream, but you *do* want to get to -its `end` event, you can call [`readable.resume()`][] to open the flow of -data. - -```javascript -var readable = getReadableStreamSomehow(); -readable.resume(); -readable.on('end', function() { - console.log('got to the end, but did not read anything'); -}); -``` - -#### readable.pause() - -* Return: `this` - -This method will cause a stream in flowing mode to stop emitting -`data` events, switching out of flowing mode. Any data that becomes -available will remain in the internal buffer. - -```javascript -var readable = getReadableStreamSomehow(); -readable.on('data', function(chunk) { - console.log('got %d bytes of data', chunk.length); - readable.pause(); - console.log('there will be no more data for 1 second'); - setTimeout(function() { - console.log('now data will start flowing again'); - readable.resume(); - }, 1000); -}); -``` - -#### readable.isPaused() - -* Return: `Boolean` - -This method returns whether or not the `readable` has been **explicitly** -paused by client code (using `readable.pause()` without a corresponding -`readable.resume()`). - -```javascript -var readable = new stream.Readable - -readable.isPaused() // === false -readable.pause() -readable.isPaused() // === true -readable.resume() -readable.isPaused() // === false -``` - -#### readable.pipe(destination[, options]) - -* `destination` {[Writable][] Stream} The destination for writing data -* `options` {Object} Pipe options - * `end` {Boolean} End the writer when the reader ends. Default = `true` - -This method pulls all the data out of a readable stream, and writes it -to the supplied destination, automatically managing the flow so that -the destination is not overwhelmed by a fast readable stream. - -Multiple destinations can be piped to safely. - -```javascript -var readable = getReadableStreamSomehow(); -var writable = fs.createWriteStream('file.txt'); -// All the data from readable goes into 'file.txt' -readable.pipe(writable); -``` - -This function returns the destination stream, so you can set up pipe -chains like so: - -```javascript -var r = fs.createReadStream('file.txt'); -var z = zlib.createGzip(); -var w = fs.createWriteStream('file.txt.gz'); -r.pipe(z).pipe(w); -``` - -For example, emulating the Unix `cat` command: - -```javascript -process.stdin.pipe(process.stdout); -``` - -By default [`end()`][] is called on the destination when the source stream -emits `end`, so that `destination` is no longer writable. Pass `{ end: -false }` as `options` to keep the destination stream open. - -This keeps `writer` open so that "Goodbye" can be written at the -end. - -```javascript -reader.pipe(writer, { end: false }); -reader.on('end', function() { - writer.end('Goodbye\n'); -}); -``` - -Note that `process.stderr` and `process.stdout` are never closed until -the process exits, regardless of the specified options. - -#### readable.unpipe([destination]) - -* `destination` {[Writable][] Stream} Optional specific stream to unpipe - -This method will remove the hooks set up for a previous `pipe()` call. - -If the destination is not specified, then all pipes are removed. - -If the destination is specified, but no pipe is set up for it, then -this is a no-op. - -```javascript -var readable = getReadableStreamSomehow(); -var writable = fs.createWriteStream('file.txt'); -// All the data from readable goes into 'file.txt', -// but only for the first second -readable.pipe(writable); -setTimeout(function() { - console.log('stop writing to file.txt'); - readable.unpipe(writable); - console.log('manually close the file stream'); - writable.end(); -}, 1000); -``` - -#### readable.unshift(chunk) - -* `chunk` {Buffer | String} Chunk of data to unshift onto the read queue - -This is useful in certain cases where a stream is being consumed by a -parser, which needs to "un-consume" some data that it has -optimistically pulled out of the source, so that the stream can be -passed on to some other party. - -If you find that you must often call `stream.unshift(chunk)` in your -programs, consider implementing a [Transform][] stream instead. (See API -for Stream Implementors, below.) - -```javascript -// Pull off a header delimited by \n\n -// use unshift() if we get too much -// Call the callback with (error, header, stream) -var StringDecoder = require('string_decoder').StringDecoder; -function parseHeader(stream, callback) { - stream.on('error', callback); - stream.on('readable', onReadable); - var decoder = new StringDecoder('utf8'); - var header = ''; - function onReadable() { - var chunk; - while (null !== (chunk = stream.read())) { - var str = decoder.write(chunk); - if (str.match(/\n\n/)) { - // found the header boundary - var split = str.split(/\n\n/); - header += split.shift(); - var remaining = split.join('\n\n'); - var buf = new Buffer(remaining, 'utf8'); - if (buf.length) - stream.unshift(buf); - stream.removeListener('error', callback); - stream.removeListener('readable', onReadable); - // now the body of the message can be read from the stream. - callback(null, header, stream); - } else { - // still reading the header. - header += str; - } - } - } -} -``` - -#### readable.wrap(stream) - -* `stream` {Stream} An "old style" readable stream - -Versions of Node.js prior to v0.10 had streams that did not implement the -entire Streams API as it is today. (See "Compatibility" below for -more information.) - -If you are using an older io.js library that emits `'data'` events and -has a [`pause()`][] method that is advisory only, then you can use the -`wrap()` method to create a [Readable][] stream that uses the old stream -as its data source. - -You will very rarely ever need to call this function, but it exists -as a convenience for interacting with old io.js programs and libraries. - -For example: - -```javascript -var OldReader = require('./old-api-module.js').OldReader; -var oreader = new OldReader; -var Readable = require('stream').Readable; -var myReader = new Readable().wrap(oreader); - -myReader.on('readable', function() { - myReader.read(); // etc. -}); -``` - - -### Class: stream.Writable - - - -The Writable stream interface is an abstraction for a *destination* -that you are writing data *to*. - -Examples of writable streams include: - -* [http requests, on the client](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_class_http_clientrequest) -* [http responses, on the server](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_class_http_serverresponse) -* [fs write streams](https://iojs.org/dist/v2.3.0/doc/api/fs.html#fs_class_fs_writestream) -* [zlib streams][] -* [crypto streams][] -* [tcp sockets][] -* [child process stdin](https://iojs.org/dist/v2.3.0/doc/api/child_process.html#child_process_child_stdin) -* [process.stdout][], [process.stderr][] - -#### writable.write(chunk[, encoding][, callback]) - -* `chunk` {String | Buffer} The data to write -* `encoding` {String} The encoding, if `chunk` is a String -* `callback` {Function} Callback for when this chunk of data is flushed -* Returns: {Boolean} True if the data was handled completely. - -This method writes some data to the underlying system, and calls the -supplied callback once the data has been fully handled. - -The return value indicates if you should continue writing right now. -If the data had to be buffered internally, then it will return -`false`. Otherwise, it will return `true`. - -This return value is strictly advisory. You MAY continue to write, -even if it returns `false`. However, writes will be buffered in -memory, so it is best not to do this excessively. Instead, wait for -the `drain` event before writing more data. - -#### Event: 'drain' - -If a [`writable.write(chunk)`][] call returns false, then the `drain` -event will indicate when it is appropriate to begin writing more data -to the stream. - -```javascript -// Write the data to the supplied writable stream 1MM times. -// Be attentive to back-pressure. -function writeOneMillionTimes(writer, data, encoding, callback) { - var i = 1000000; - write(); - function write() { - var ok = true; - do { - i -= 1; - if (i === 0) { - // last time! - writer.write(data, encoding, callback); - } else { - // see if we should continue, or wait - // don't pass the callback, because we're not done yet. - ok = writer.write(data, encoding); - } - } while (i > 0 && ok); - if (i > 0) { - // had to stop early! - // write some more once it drains - writer.once('drain', write); - } - } -} -``` - -#### writable.cork() - -Forces buffering of all writes. - -Buffered data will be flushed either at `.uncork()` or at `.end()` call. - -#### writable.uncork() - -Flush all data, buffered since `.cork()` call. - -#### writable.setDefaultEncoding(encoding) - -* `encoding` {String} The new default encoding - -Sets the default encoding for a writable stream. - -#### writable.end([chunk][, encoding][, callback]) - -* `chunk` {String | Buffer} Optional data to write -* `encoding` {String} The encoding, if `chunk` is a String -* `callback` {Function} Optional callback for when the stream is finished - -Call this method when no more data will be written to the stream. If -supplied, the callback is attached as a listener on the `finish` event. - -Calling [`write()`][] after calling [`end()`][] will raise an error. - -```javascript -// write 'hello, ' and then end with 'world!' -var file = fs.createWriteStream('example.txt'); -file.write('hello, '); -file.end('world!'); -// writing more now is not allowed! -``` - -#### Event: 'finish' - -When the [`end()`][] method has been called, and all data has been flushed -to the underlying system, this event is emitted. - -```javascript -var writer = getWritableStreamSomehow(); -for (var i = 0; i < 100; i ++) { - writer.write('hello, #' + i + '!\n'); -} -writer.end('this is the end\n'); -writer.on('finish', function() { - console.error('all writes are now complete.'); -}); -``` - -#### Event: 'pipe' - -* `src` {[Readable][] Stream} source stream that is piping to this writable - -This is emitted whenever the `pipe()` method is called on a readable -stream, adding this writable to its set of destinations. - -```javascript -var writer = getWritableStreamSomehow(); -var reader = getReadableStreamSomehow(); -writer.on('pipe', function(src) { - console.error('something is piping into the writer'); - assert.equal(src, reader); -}); -reader.pipe(writer); -``` - -#### Event: 'unpipe' - -* `src` {[Readable][] Stream} The source stream that [unpiped][] this writable - -This is emitted whenever the [`unpipe()`][] method is called on a -readable stream, removing this writable from its set of destinations. - -```javascript -var writer = getWritableStreamSomehow(); -var reader = getReadableStreamSomehow(); -writer.on('unpipe', function(src) { - console.error('something has stopped piping into the writer'); - assert.equal(src, reader); -}); -reader.pipe(writer); -reader.unpipe(writer); -``` - -#### Event: 'error' - -* {Error object} - -Emitted if there was an error when writing or piping data. - -### Class: stream.Duplex - -Duplex streams are streams that implement both the [Readable][] and -[Writable][] interfaces. See above for usage. - -Examples of Duplex streams include: - -* [tcp sockets][] -* [zlib streams][] -* [crypto streams][] - - -### Class: stream.Transform - -Transform streams are [Duplex][] streams where the output is in some way -computed from the input. They implement both the [Readable][] and -[Writable][] interfaces. See above for usage. - -Examples of Transform streams include: - -* [zlib streams][] -* [crypto streams][] - - -## API for Stream Implementors - - - -To implement any sort of stream, the pattern is the same: - -1. Extend the appropriate parent class in your own subclass. (The - [`util.inherits`][] method is particularly helpful for this.) -2. Call the appropriate parent class constructor in your constructor, - to be sure that the internal mechanisms are set up properly. -2. Implement one or more specific methods, as detailed below. - -The class to extend and the method(s) to implement depend on the sort -of stream class you are writing: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      -

      Use-case

      -
      -

      Class

      -
      -

      Method(s) to implement

      -
      -

      Reading only

      -
      -

      [Readable](#stream_class_stream_readable_1)

      -
      -

      [_read][]

      -
      -

      Writing only

      -
      -

      [Writable](#stream_class_stream_writable_1)

      -
      -

      [_write][], _writev

      -
      -

      Reading and writing

      -
      -

      [Duplex](#stream_class_stream_duplex_1)

      -
      -

      [_read][], [_write][], _writev

      -
      -

      Operate on written data, then read the result

      -
      -

      [Transform](#stream_class_stream_transform_1)

      -
      -

      _transform, _flush

      -
      - -In your implementation code, it is very important to never call the -methods described in [API for Stream Consumers][] above. Otherwise, you -can potentially cause adverse side effects in programs that consume -your streaming interfaces. - -### Class: stream.Readable - - - -`stream.Readable` is an abstract class designed to be extended with an -underlying implementation of the [`_read(size)`][] method. - -Please see above under [API for Stream Consumers][] for how to consume -streams in your programs. What follows is an explanation of how to -implement Readable streams in your programs. - -#### Example: A Counting Stream - - - -This is a basic example of a Readable stream. It emits the numerals -from 1 to 1,000,000 in ascending order, and then ends. - -```javascript -var Readable = require('stream').Readable; -var util = require('util'); -util.inherits(Counter, Readable); - -function Counter(opt) { - Readable.call(this, opt); - this._max = 1000000; - this._index = 1; -} - -Counter.prototype._read = function() { - var i = this._index++; - if (i > this._max) - this.push(null); - else { - var str = '' + i; - var buf = new Buffer(str, 'ascii'); - this.push(buf); - } -}; -``` - -#### Example: SimpleProtocol v1 (Sub-optimal) - -This is similar to the `parseHeader` function described above, but -implemented as a custom stream. Also, note that this implementation -does not convert the incoming data to a string. - -However, this would be better implemented as a [Transform][] stream. See -below for a better implementation. - -```javascript -// A parser for a simple data protocol. -// The "header" is a JSON object, followed by 2 \n characters, and -// then a message body. -// -// NOTE: This can be done more simply as a Transform stream! -// Using Readable directly for this is sub-optimal. See the -// alternative example below under the Transform section. - -var Readable = require('stream').Readable; -var util = require('util'); - -util.inherits(SimpleProtocol, Readable); - -function SimpleProtocol(source, options) { - if (!(this instanceof SimpleProtocol)) - return new SimpleProtocol(source, options); - - Readable.call(this, options); - this._inBody = false; - this._sawFirstCr = false; - - // source is a readable stream, such as a socket or file - this._source = source; - - var self = this; - source.on('end', function() { - self.push(null); - }); - - // give it a kick whenever the source is readable - // read(0) will not consume any bytes - source.on('readable', function() { - self.read(0); - }); - - this._rawHeader = []; - this.header = null; -} - -SimpleProtocol.prototype._read = function(n) { - if (!this._inBody) { - var chunk = this._source.read(); - - // if the source doesn't have data, we don't have data yet. - if (chunk === null) - return this.push(''); - - // check if the chunk has a \n\n - var split = -1; - for (var i = 0; i < chunk.length; i++) { - if (chunk[i] === 10) { // '\n' - if (this._sawFirstCr) { - split = i; - break; - } else { - this._sawFirstCr = true; - } - } else { - this._sawFirstCr = false; - } - } - - if (split === -1) { - // still waiting for the \n\n - // stash the chunk, and try again. - this._rawHeader.push(chunk); - this.push(''); - } else { - this._inBody = true; - var h = chunk.slice(0, split); - this._rawHeader.push(h); - var header = Buffer.concat(this._rawHeader).toString(); - try { - this.header = JSON.parse(header); - } catch (er) { - this.emit('error', new Error('invalid simple protocol data')); - return; - } - // now, because we got some extra data, unshift the rest - // back into the read queue so that our consumer will see it. - var b = chunk.slice(split); - this.unshift(b); - - // and let them know that we are done parsing the header. - this.emit('header', this.header); - } - } else { - // from there on, just provide the data to our consumer. - // careful not to push(null), since that would indicate EOF. - var chunk = this._source.read(); - if (chunk) this.push(chunk); - } -}; - -// Usage: -// var parser = new SimpleProtocol(source); -// Now parser is a readable stream that will emit 'header' -// with the parsed header data. -``` - - -#### new stream.Readable([options]) - -* `options` {Object} - * `highWaterMark` {Number} The maximum number of bytes to store in - the internal buffer before ceasing to read from the underlying - resource. Default=16kb, or 16 for `objectMode` streams - * `encoding` {String} If specified, then buffers will be decoded to - strings using the specified encoding. Default=null - * `objectMode` {Boolean} Whether this stream should behave - as a stream of objects. Meaning that stream.read(n) returns - a single value instead of a Buffer of size n. Default=false - -In classes that extend the Readable class, make sure to call the -Readable constructor so that the buffering settings can be properly -initialized. - -#### readable.\_read(size) - -* `size` {Number} Number of bytes to read asynchronously - -Note: **Implement this function, but do NOT call it directly.** - -This function should NOT be called directly. It should be implemented -by child classes, and only called by the internal Readable class -methods. - -All Readable stream implementations must provide a `_read` method to -fetch data from the underlying resource. - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -When data is available, put it into the read queue by calling -`readable.push(chunk)`. If `push` returns false, then you should stop -reading. When `_read` is called again, you should start pushing more -data. - -The `size` argument is advisory. Implementations where a "read" is a -single call that returns data can use this to know how much data to -fetch. Implementations where that is not relevant, such as TCP or -TLS, may ignore this argument, and simply provide data whenever it -becomes available. There is no need, for example to "wait" until -`size` bytes are available before calling [`stream.push(chunk)`][]. - -#### readable.push(chunk[, encoding]) - -* `chunk` {Buffer | null | String} Chunk of data to push into the read queue -* `encoding` {String} Encoding of String chunks. Must be a valid - Buffer encoding, such as `'utf8'` or `'ascii'` -* return {Boolean} Whether or not more pushes should be performed - -Note: **This function should be called by Readable implementors, NOT -by consumers of Readable streams.** - -The `_read()` function will not be called again until at least one -`push(chunk)` call is made. - -The `Readable` class works by putting data into a read queue to be -pulled out later by calling the `read()` method when the `'readable'` -event fires. - -The `push()` method will explicitly insert some data into the read -queue. If it is called with `null` then it will signal the end of the -data (EOF). - -This API is designed to be as flexible as possible. For example, -you may be wrapping a lower-level source which has some sort of -pause/resume mechanism, and a data callback. In those cases, you -could wrap the low-level source object by doing something like this: - -```javascript -// source is an object with readStop() and readStart() methods, -// and an `ondata` member that gets called when it has data, and -// an `onend` member that gets called when the data is over. - -util.inherits(SourceWrapper, Readable); - -function SourceWrapper(options) { - Readable.call(this, options); - - this._source = getLowlevelSourceObject(); - var self = this; - - // Every time there's data, we push it into the internal buffer. - this._source.ondata = function(chunk) { - // if push() returns false, then we need to stop reading from source - if (!self.push(chunk)) - self._source.readStop(); - }; - - // When the source ends, we push the EOF-signaling `null` chunk - this._source.onend = function() { - self.push(null); - }; -} - -// _read will be called when the stream wants to pull more data in -// the advisory size argument is ignored in this case. -SourceWrapper.prototype._read = function(size) { - this._source.readStart(); -}; -``` - - -### Class: stream.Writable - - - -`stream.Writable` is an abstract class designed to be extended with an -underlying implementation of the [`_write(chunk, encoding, callback)`][] method. - -Please see above under [API for Stream Consumers][] for how to consume -writable streams in your programs. What follows is an explanation of -how to implement Writable streams in your programs. - -#### new stream.Writable([options]) - -* `options` {Object} - * `highWaterMark` {Number} Buffer level when [`write()`][] starts - returning false. Default=16kb, or 16 for `objectMode` streams - * `decodeStrings` {Boolean} Whether or not to decode strings into - Buffers before passing them to [`_write()`][]. Default=true - * `objectMode` {Boolean} Whether or not the `write(anyObj)` is - a valid operation. If set you can write arbitrary data instead - of only `Buffer` / `String` data. Default=false - -In classes that extend the Writable class, make sure to call the -constructor so that the buffering settings can be properly -initialized. - -#### writable.\_write(chunk, encoding, callback) - -* `chunk` {Buffer | String} The chunk to be written. Will **always** - be a buffer unless the `decodeStrings` option was set to `false`. -* `encoding` {String} If the chunk is a string, then this is the - encoding type. If chunk is a buffer, then this is the special - value - 'buffer', ignore it in this case. -* `callback` {Function} Call this function (optionally with an error - argument) when you are done processing the supplied chunk. - -All Writable stream implementations must provide a [`_write()`][] -method to send data to the underlying resource. - -Note: **This function MUST NOT be called directly.** It should be -implemented by child classes, and called by the internal Writable -class methods only. - -Call the callback using the standard `callback(error)` pattern to -signal that the write completed successfully or with an error. - -If the `decodeStrings` flag is set in the constructor options, then -`chunk` may be a string rather than a Buffer, and `encoding` will -indicate the sort of string that it is. This is to support -implementations that have an optimized handling for certain string -data encodings. If you do not explicitly set the `decodeStrings` -option to `false`, then you can safely ignore the `encoding` argument, -and assume that `chunk` will always be a Buffer. - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -#### writable.\_writev(chunks, callback) - -* `chunks` {Array} The chunks to be written. Each chunk has following - format: `{ chunk: ..., encoding: ... }`. -* `callback` {Function} Call this function (optionally with an error - argument) when you are done processing the supplied chunks. - -Note: **This function MUST NOT be called directly.** It may be -implemented by child classes, and called by the internal Writable -class methods only. - -This function is completely optional to implement. In most cases it is -unnecessary. If implemented, it will be called with all the chunks -that are buffered in the write queue. - - -### Class: stream.Duplex - - - -A "duplex" stream is one that is both Readable and Writable, such as a -TCP socket connection. - -Note that `stream.Duplex` is an abstract class designed to be extended -with an underlying implementation of the `_read(size)` and -[`_write(chunk, encoding, callback)`][] methods as you would with a -Readable or Writable stream class. - -Since JavaScript doesn't have multiple prototypal inheritance, this -class prototypally inherits from Readable, and then parasitically from -Writable. It is thus up to the user to implement both the lowlevel -`_read(n)` method as well as the lowlevel -[`_write(chunk, encoding, callback)`][] method on extension duplex classes. - -#### new stream.Duplex(options) - -* `options` {Object} Passed to both Writable and Readable - constructors. Also has the following fields: - * `allowHalfOpen` {Boolean} Default=true. If set to `false`, then - the stream will automatically end the readable side when the - writable side ends and vice versa. - * `readableObjectMode` {Boolean} Default=false. Sets `objectMode` - for readable side of the stream. Has no effect if `objectMode` - is `true`. - * `writableObjectMode` {Boolean} Default=false. Sets `objectMode` - for writable side of the stream. Has no effect if `objectMode` - is `true`. - -In classes that extend the Duplex class, make sure to call the -constructor so that the buffering settings can be properly -initialized. - - -### Class: stream.Transform - -A "transform" stream is a duplex stream where the output is causally -connected in some way to the input, such as a [zlib][] stream or a -[crypto][] stream. - -There is no requirement that the output be the same size as the input, -the same number of chunks, or arrive at the same time. For example, a -Hash stream will only ever have a single chunk of output which is -provided when the input is ended. A zlib stream will produce output -that is either much smaller or much larger than its input. - -Rather than implement the [`_read()`][] and [`_write()`][] methods, Transform -classes must implement the `_transform()` method, and may optionally -also implement the `_flush()` method. (See below.) - -#### new stream.Transform([options]) - -* `options` {Object} Passed to both Writable and Readable - constructors. - -In classes that extend the Transform class, make sure to call the -constructor so that the buffering settings can be properly -initialized. - -#### transform.\_transform(chunk, encoding, callback) - -* `chunk` {Buffer | String} The chunk to be transformed. Will **always** - be a buffer unless the `decodeStrings` option was set to `false`. -* `encoding` {String} If the chunk is a string, then this is the - encoding type. If chunk is a buffer, then this is the special - value - 'buffer', ignore it in this case. -* `callback` {Function} Call this function (optionally with an error - argument and data) when you are done processing the supplied chunk. - -Note: **This function MUST NOT be called directly.** It should be -implemented by child classes, and called by the internal Transform -class methods only. - -All Transform stream implementations must provide a `_transform` -method to accept input and produce output. - -`_transform` should do whatever has to be done in this specific -Transform class, to handle the bytes being written, and pass them off -to the readable portion of the interface. Do asynchronous I/O, -process things, and so on. - -Call `transform.push(outputChunk)` 0 or more times to generate output -from this input chunk, depending on how much data you want to output -as a result of this chunk. - -Call the callback function only when the current chunk is completely -consumed. Note that there may or may not be output as a result of any -particular input chunk. If you supply output as the second argument to the -callback, it will be passed to push method, in other words the following are -equivalent: - -```javascript -transform.prototype._transform = function (data, encoding, callback) { - this.push(data); - callback(); -} - -transform.prototype._transform = function (data, encoding, callback) { - callback(null, data); -} -``` - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -#### transform.\_flush(callback) - -* `callback` {Function} Call this function (optionally with an error - argument) when you are done flushing any remaining data. - -Note: **This function MUST NOT be called directly.** It MAY be implemented -by child classes, and if so, will be called by the internal Transform -class methods only. - -In some cases, your transform operation may need to emit a bit more -data at the end of the stream. For example, a `Zlib` compression -stream will store up some internal state so that it can optimally -compress the output. At the end, however, it needs to do the best it -can with what is left, so that the data will be complete. - -In those cases, you can implement a `_flush` method, which will be -called at the very end, after all the written data is consumed, but -before emitting `end` to signal the end of the readable side. Just -like with `_transform`, call `transform.push(chunk)` zero or more -times, as appropriate, and call `callback` when the flush operation is -complete. - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -#### Events: 'finish' and 'end' - -The [`finish`][] and [`end`][] events are from the parent Writable -and Readable classes respectively. The `finish` event is fired after -`.end()` is called and all chunks have been processed by `_transform`, -`end` is fired after all data has been output which is after the callback -in `_flush` has been called. - -#### Example: `SimpleProtocol` parser v2 - -The example above of a simple protocol parser can be implemented -simply by using the higher level [Transform][] stream class, similar to -the `parseHeader` and `SimpleProtocol v1` examples above. - -In this example, rather than providing the input as an argument, it -would be piped into the parser, which is a more idiomatic io.js stream -approach. - -```javascript -var util = require('util'); -var Transform = require('stream').Transform; -util.inherits(SimpleProtocol, Transform); - -function SimpleProtocol(options) { - if (!(this instanceof SimpleProtocol)) - return new SimpleProtocol(options); - - Transform.call(this, options); - this._inBody = false; - this._sawFirstCr = false; - this._rawHeader = []; - this.header = null; -} - -SimpleProtocol.prototype._transform = function(chunk, encoding, done) { - if (!this._inBody) { - // check if the chunk has a \n\n - var split = -1; - for (var i = 0; i < chunk.length; i++) { - if (chunk[i] === 10) { // '\n' - if (this._sawFirstCr) { - split = i; - break; - } else { - this._sawFirstCr = true; - } - } else { - this._sawFirstCr = false; - } - } - - if (split === -1) { - // still waiting for the \n\n - // stash the chunk, and try again. - this._rawHeader.push(chunk); - } else { - this._inBody = true; - var h = chunk.slice(0, split); - this._rawHeader.push(h); - var header = Buffer.concat(this._rawHeader).toString(); - try { - this.header = JSON.parse(header); - } catch (er) { - this.emit('error', new Error('invalid simple protocol data')); - return; - } - // and let them know that we are done parsing the header. - this.emit('header', this.header); - - // now, because we got some extra data, emit this first. - this.push(chunk.slice(split)); - } - } else { - // from there on, just provide the data to our consumer as-is. - this.push(chunk); - } - done(); -}; - -// Usage: -// var parser = new SimpleProtocol(); -// source.pipe(parser) -// Now parser is a readable stream that will emit 'header' -// with the parsed header data. -``` - - -### Class: stream.PassThrough - -This is a trivial implementation of a [Transform][] stream that simply -passes the input bytes across to the output. Its purpose is mainly -for examples and testing, but there are occasionally use cases where -it can come in handy as a building block for novel sorts of streams. - - -## Simplified Constructor API - - - -In simple cases there is now the added benefit of being able to construct a stream without inheritance. - -This can be done by passing the appropriate methods as constructor options: - -Examples: - -### Readable -```javascript -var readable = new stream.Readable({ - read: function(n) { - // sets this._read under the hood - } -}); -``` - -### Writable -```javascript -var writable = new stream.Writable({ - write: function(chunk, encoding, next) { - // sets this._write under the hood - } -}); - -// or - -var writable = new stream.Writable({ - writev: function(chunks, next) { - // sets this._writev under the hood - } -}); -``` - -### Duplex -```javascript -var duplex = new stream.Duplex({ - read: function(n) { - // sets this._read under the hood - }, - write: function(chunk, encoding, next) { - // sets this._write under the hood - } -}); - -// or - -var duplex = new stream.Duplex({ - read: function(n) { - // sets this._read under the hood - }, - writev: function(chunks, next) { - // sets this._writev under the hood - } -}); -``` - -### Transform -```javascript -var transform = new stream.Transform({ - transform: function(chunk, encoding, next) { - // sets this._transform under the hood - }, - flush: function(done) { - // sets this._flush under the hood - } -}); -``` - -## Streams: Under the Hood - - - -### Buffering - - - -Both Writable and Readable streams will buffer data on an internal -object called `_writableState.buffer` or `_readableState.buffer`, -respectively. - -The amount of data that will potentially be buffered depends on the -`highWaterMark` option which is passed into the constructor. - -Buffering in Readable streams happens when the implementation calls -[`stream.push(chunk)`][]. If the consumer of the Stream does not call -`stream.read()`, then the data will sit in the internal queue until it -is consumed. - -Buffering in Writable streams happens when the user calls -[`stream.write(chunk)`][] repeatedly, even when `write()` returns `false`. - -The purpose of streams, especially with the `pipe()` method, is to -limit the buffering of data to acceptable levels, so that sources and -destinations of varying speed will not overwhelm the available memory. - -### `stream.read(0)` - -There are some cases where you want to trigger a refresh of the -underlying readable stream mechanisms, without actually consuming any -data. In that case, you can call `stream.read(0)`, which will always -return null. - -If the internal read buffer is below the `highWaterMark`, and the -stream is not currently reading, then calling `read(0)` will trigger -a low-level `_read` call. - -There is almost never a need to do this. However, you will see some -cases in io.js's internals where this is done, particularly in the -Readable stream class internals. - -### `stream.push('')` - -Pushing a zero-byte string or Buffer (when not in [Object mode][]) has an -interesting side effect. Because it *is* a call to -[`stream.push()`][], it will end the `reading` process. However, it -does *not* add any data to the readable buffer, so there's nothing for -a user to consume. - -Very rarely, there are cases where you have no data to provide now, -but the consumer of your stream (or, perhaps, another bit of your own -code) will know when to check again, by calling `stream.read(0)`. In -those cases, you *may* call `stream.push('')`. - -So far, the only use case for this functionality is in the -[tls.CryptoStream][] class, which is deprecated in io.js v1.0. If you -find that you have to use `stream.push('')`, please consider another -approach, because it almost certainly indicates that something is -horribly wrong. - -### Compatibility with Older Node.js Versions - - - -In versions of Node.js prior to v0.10, the Readable stream interface was -simpler, but also less powerful and less useful. - -* Rather than waiting for you to call the `read()` method, `'data'` - events would start emitting immediately. If you needed to do some - I/O to decide how to handle data, then you had to store the chunks - in some kind of buffer so that they would not be lost. -* The [`pause()`][] method was advisory, rather than guaranteed. This - meant that you still had to be prepared to receive `'data'` events - even when the stream was in a paused state. - -In io.js v1.0 and Node.js v0.10, the Readable class described below was added. -For backwards compatibility with older Node.js programs, Readable streams -switch into "flowing mode" when a `'data'` event handler is added, or -when the [`resume()`][] method is called. The effect is that, even if -you are not using the new `read()` method and `'readable'` event, you -no longer have to worry about losing `'data'` chunks. - -Most programs will continue to function normally. However, this -introduces an edge case in the following conditions: - -* No [`'data'` event][] handler is added. -* The [`resume()`][] method is never called. -* The stream is not piped to any writable destination. - -For example, consider the following code: - -```javascript -// WARNING! BROKEN! -net.createServer(function(socket) { - - // we add an 'end' method, but never consume the data - socket.on('end', function() { - // It will never get here. - socket.end('I got your message (but didnt read it)\n'); - }); - -}).listen(1337); -``` - -In versions of Node.js prior to v0.10, the incoming message data would be -simply discarded. However, in io.js v1.0 and Node.js v0.10 and beyond, -the socket will remain paused forever. - -The workaround in this situation is to call the `resume()` method to -start the flow of data: - -```javascript -// Workaround -net.createServer(function(socket) { - - socket.on('end', function() { - socket.end('I got your message (but didnt read it)\n'); - }); - - // start the flow of data, discarding it. - socket.resume(); - -}).listen(1337); -``` - -In addition to new Readable streams switching into flowing mode, -pre-v0.10 style streams can be wrapped in a Readable class using the -`wrap()` method. - - -### Object Mode - - - -Normally, Streams operate on Strings and Buffers exclusively. - -Streams that are in **object mode** can emit generic JavaScript values -other than Buffers and Strings. - -A Readable stream in object mode will always return a single item from -a call to `stream.read(size)`, regardless of what the size argument -is. - -A Writable stream in object mode will always ignore the `encoding` -argument to `stream.write(data, encoding)`. - -The special value `null` still retains its special value for object -mode streams. That is, for object mode readable streams, `null` as a -return value from `stream.read()` indicates that there is no more -data, and [`stream.push(null)`][] will signal the end of stream data -(`EOF`). - -No streams in io.js core are object mode streams. This pattern is only -used by userland streaming libraries. - -You should set `objectMode` in your stream child class constructor on -the options object. Setting `objectMode` mid-stream is not safe. - -For Duplex streams `objectMode` can be set exclusively for readable or -writable side with `readableObjectMode` and `writableObjectMode` -respectively. These options can be used to implement parsers and -serializers with Transform streams. - -```javascript -var util = require('util'); -var StringDecoder = require('string_decoder').StringDecoder; -var Transform = require('stream').Transform; -util.inherits(JSONParseStream, Transform); - -// Gets \n-delimited JSON string data, and emits the parsed objects -function JSONParseStream() { - if (!(this instanceof JSONParseStream)) - return new JSONParseStream(); - - Transform.call(this, { readableObjectMode : true }); - - this._buffer = ''; - this._decoder = new StringDecoder('utf8'); -} - -JSONParseStream.prototype._transform = function(chunk, encoding, cb) { - this._buffer += this._decoder.write(chunk); - // split on newlines - var lines = this._buffer.split(/\r?\n/); - // keep the last partial line buffered - this._buffer = lines.pop(); - for (var l = 0; l < lines.length; l++) { - var line = lines[l]; - try { - var obj = JSON.parse(line); - } catch (er) { - this.emit('error', er); - return; - } - // push the parsed object out to the readable consumer - this.push(obj); - } - cb(); -}; - -JSONParseStream.prototype._flush = function(cb) { - // Just handle any leftover - var rem = this._buffer.trim(); - if (rem) { - try { - var obj = JSON.parse(rem); - } catch (er) { - this.emit('error', er); - return; - } - // push the parsed object out to the readable consumer - this.push(obj); - } - cb(); -}; -``` - - -[EventEmitter]: https://iojs.org/dist/v2.3.0/doc/api/events.html#events_class_events_eventemitter -[Object mode]: #stream_object_mode -[`stream.push(chunk)`]: #stream_readable_push_chunk_encoding -[`stream.push(null)`]: #stream_readable_push_chunk_encoding -[`stream.push()`]: #stream_readable_push_chunk_encoding -[`unpipe()`]: #stream_readable_unpipe_destination -[unpiped]: #stream_readable_unpipe_destination -[tcp sockets]: https://iojs.org/dist/v2.3.0/doc/api/net.html#net_class_net_socket -[zlib streams]: zlib.html -[zlib]: zlib.html -[crypto streams]: crypto.html -[crypto]: crypto.html -[tls.CryptoStream]: https://iojs.org/dist/v2.3.0/doc/api/tls.html#tls_class_cryptostream -[process.stdin]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stdin -[stdout]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stdout -[process.stdout]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stdout -[process.stderr]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stderr -[child process stdout and stderr]: https://iojs.org/dist/v2.3.0/doc/api/child_process.html#child_process_child_stdout -[API for Stream Consumers]: #stream_api_for_stream_consumers -[API for Stream Implementors]: #stream_api_for_stream_implementors -[Readable]: #stream_class_stream_readable -[Writable]: #stream_class_stream_writable -[Duplex]: #stream_class_stream_duplex -[Transform]: #stream_class_stream_transform -[`end`]: #stream_event_end -[`finish`]: #stream_event_finish -[`_read(size)`]: #stream_readable_read_size_1 -[`_read()`]: #stream_readable_read_size_1 -[_read]: #stream_readable_read_size_1 -[`writable.write(chunk)`]: #stream_writable_write_chunk_encoding_callback -[`write(chunk, encoding, callback)`]: #stream_writable_write_chunk_encoding_callback -[`write()`]: #stream_writable_write_chunk_encoding_callback -[`stream.write(chunk)`]: #stream_writable_write_chunk_encoding_callback -[`_write(chunk, encoding, callback)`]: #stream_writable_write_chunk_encoding_callback_1 -[`_write()`]: #stream_writable_write_chunk_encoding_callback_1 -[_write]: #stream_writable_write_chunk_encoding_callback_1 -[`util.inherits`]: https://iojs.org/dist/v2.3.0/doc/api/util.html#util_util_inherits_constructor_superconstructor -[`end()`]: #stream_writable_end_chunk_encoding_callback -[`'data'` event]: #stream_event_data -[`resume()`]: #stream_readable_resume -[`readable.resume()`]: #stream_readable_resume -[`pause()`]: #stream_readable_pause -[`unpipe()`]: #stream_readable_unpipe_destination -[`pipe()`]: #stream_readable_pipe_destination_options diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/sha/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md deleted file mode 100644 index c141a99c26c638..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +++ /dev/null @@ -1,58 +0,0 @@ -# streams WG Meeting 2015-01-30 - -## Links - -* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg -* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 -* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ - -## Agenda - -Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. - -* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) -* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) -* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) -* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) - -## Minutes - -### adopt a charter - -* group: +1's all around - -### What versioning scheme should be adopted? -* group: +1’s 3.0.0 -* domenic+group: pulling in patches from other sources where appropriate -* mikeal: version independently, suggesting versions for io.js -* mikeal+domenic: work with TC to notify in advance of changes -simpler stream creation - -### streamline creation of streams -* sam: streamline creation of streams -* domenic: nice simple solution posted - but, we lose the opportunity to change the model - may not be backwards incompatible (double check keys) - - **action item:** domenic will check - -### remove implicit flowing of streams on(‘data’) -* add isFlowing / isPaused -* mikeal: worrying that we’re documenting polyfill methods – confuses users -* domenic: more reflective API is probably good, with warning labels for users -* new section for mad scientists (reflective stream access) -* calvin: name the “third state” -* mikeal: maybe borrow the name from whatwg? -* domenic: we’re missing the “third state” -* consensus: kind of difficult to name the third state -* mikeal: figure out differences in states / compat -* mathias: always flow on data – eliminates third state - * explore what it breaks - -**action items:** -* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) -* ask rod/build for infrastructure -* **chris**: explore the “flow on data” approach -* add isPaused/isFlowing -* add new docs section -* move isPaused to that section diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/duplex.js b/deps/npm/node_modules/sha/node_modules/readable-stream/duplex.js deleted file mode 100644 index ca807af87620dd..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/duplex.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_duplex.js") diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_duplex.js deleted file mode 100644 index 69558af037cd66..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_duplex.js +++ /dev/null @@ -1,82 +0,0 @@ -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - -'use strict'; - -/**/ -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) keys.push(key); - return keys; -} -/**/ - - -module.exports = Duplex; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - - - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var Readable = require('./_stream_readable'); -var Writable = require('./_stream_writable'); - -util.inherits(Duplex, Readable); - -var keys = objectKeys(Writable.prototype); -for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) - Duplex.prototype[method] = Writable.prototype[method]; -} - -function Duplex(options) { - if (!(this instanceof Duplex)) - return new Duplex(options); - - Readable.call(this, options); - Writable.call(this, options); - - if (options && options.readable === false) - this.readable = false; - - if (options && options.writable === false) - this.writable = false; - - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) - this.allowHalfOpen = false; - - this.once('end', onend); -} - -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) - return; - - // no more data can be written. - // But allow more writes to happen in this tick. - processNextTick(onEndNT, this); -} - -function onEndNT(self) { - self.end(); -} - -function forEach (xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_passthrough.js deleted file mode 100644 index bddfdd01537a40..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_passthrough.js +++ /dev/null @@ -1,27 +0,0 @@ -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. - -'use strict'; - -module.exports = PassThrough; - -var Transform = require('./_stream_transform'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) - return new PassThrough(options); - - Transform.call(this, options); -} - -PassThrough.prototype._transform = function(chunk, encoding, cb) { - cb(null, chunk); -}; diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_readable.js deleted file mode 100644 index eef3d825d7a084..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_readable.js +++ /dev/null @@ -1,959 +0,0 @@ -'use strict'; - -module.exports = Readable; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - - -/**/ -var isArray = require('isarray'); -/**/ - - -/**/ -var Buffer = require('buffer').Buffer; -/**/ - -Readable.ReadableState = ReadableState; - -var EE = require('events').EventEmitter; - -/**/ -if (!EE.listenerCount) EE.listenerCount = function(emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - - - -/**/ -var Stream; -(function (){try{ - Stream = require('st' + 'ream'); -}catch(_){}finally{ - if (!Stream) - Stream = require('events').EventEmitter; -}}()) -/**/ - -var Buffer = require('buffer').Buffer; - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - - - -/**/ -var debug = require('util'); -if (debug && debug.debuglog) { - debug = debug.debuglog('stream'); -} else { - debug = function () {}; -} -/**/ - -var StringDecoder; - -util.inherits(Readable, Stream); - -function ReadableState(options, stream) { - var Duplex = require('./_stream_duplex'); - - options = options || {}; - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - - if (stream instanceof Duplex) - this.objectMode = this.objectMode || !!options.readableObjectMode; - - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; - - // cast to ints. - this.highWaterMark = ~~this.highWaterMark; - - this.buffer = []; - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // when piping, we only care about 'readable' events that happen - // after read()ing all the bytes and not getting any pushback. - this.ranOut = false; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) - StringDecoder = require('string_decoder/').StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} - -function Readable(options) { - var Duplex = require('./_stream_duplex'); - - if (!(this instanceof Readable)) - return new Readable(options); - - this._readableState = new ReadableState(options, this); - - // legacy - this.readable = true; - - if (options && typeof options.read === 'function') - this._read = options.read; - - Stream.call(this); -} - -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function(chunk, encoding) { - var state = this._readableState; - - if (!state.objectMode && typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = new Buffer(chunk, encoding); - encoding = ''; - } - } - - return readableAddChunk(this, state, chunk, encoding, false); -}; - -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function(chunk) { - var state = this._readableState; - return readableAddChunk(this, state, chunk, '', true); -}; - -Readable.prototype.isPaused = function() { - return this._readableState.flowing === false; -}; - -function readableAddChunk(stream, state, chunk, encoding, addToFront) { - var er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (state.ended && !addToFront) { - var e = new Error('stream.push() after EOF'); - stream.emit('error', e); - } else if (state.endEmitted && addToFront) { - var e = new Error('stream.unshift() after end event'); - stream.emit('error', e); - } else { - if (state.decoder && !addToFront && !encoding) - chunk = state.decoder.write(chunk); - - if (!addToFront) - state.reading = false; - - // if we want the data now, just emit it. - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) - state.buffer.unshift(chunk); - else - state.buffer.push(chunk); - - if (state.needReadable) - emitReadable(stream); - } - - maybeReadMore(stream, state); - } - } else if (!addToFront) { - state.reading = false; - } - - return needMoreData(state); -} - - - -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && - (state.needReadable || - state.length < state.highWaterMark || - state.length === 0); -} - -// backwards compatibility. -Readable.prototype.setEncoding = function(enc) { - if (!StringDecoder) - StringDecoder = require('string_decoder/').StringDecoder; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; -}; - -// Don't raise the hwm > 128MB -var MAX_HWM = 0x800000; -function roundUpToNextPowerOf2(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 - n--; - for (var p = 1; p < 32; p <<= 1) n |= n >> p; - n++; - } - return n; -} - -function howMuchToRead(n, state) { - if (state.length === 0 && state.ended) - return 0; - - if (state.objectMode) - return n === 0 ? 0 : 1; - - if (n === null || isNaN(n)) { - // only flow one buffer at a time - if (state.flowing && state.buffer.length) - return state.buffer[0].length; - else - return state.length; - } - - if (n <= 0) - return 0; - - // If we're asking for more than the target buffer level, - // then raise the water mark. Bump up to the next highest - // power of 2, to prevent increasing it excessively in tiny - // amounts. - if (n > state.highWaterMark) - state.highWaterMark = roundUpToNextPowerOf2(n); - - // don't have that much. return null, unless we've ended. - if (n > state.length) { - if (!state.ended) { - state.needReadable = true; - return 0; - } else { - return state.length; - } - } - - return n; -} - -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function(n) { - debug('read', n); - var state = this._readableState; - var nOrig = n; - - if (typeof n !== 'number' || n > 0) - state.emittedReadable = false; - - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && - state.needReadable && - (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) - endReadable(this); - else - emitReadable(this); - return null; - } - - n = howMuchToRead(n, state); - - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) - endReadable(this); - return null; - } - - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); - - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } - - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } - - if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) - state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - } - - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (doRead && !state.reading) - n = howMuchToRead(nOrig, state); - - var ret; - if (n > 0) - ret = fromList(n, state); - else - ret = null; - - if (ret === null) { - state.needReadable = true; - n = 0; - } - - state.length -= n; - - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (state.length === 0 && !state.ended) - state.needReadable = true; - - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended && state.length === 0) - endReadable(this); - - if (ret !== null) - this.emit('data', ret); - - return ret; -}; - -function chunkInvalid(state, chunk) { - var er = null; - if (!(Buffer.isBuffer(chunk)) && - typeof chunk !== 'string' && - chunk !== null && - chunk !== undefined && - !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} - - -function onEofChunk(stream, state) { - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); -} - -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) - processNextTick(emitReadable_, stream); - else - emitReadable_(stream); - } -} - -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); -} - - -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - processNextTick(maybeReadMore_, stream, state); - } -} - -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && - state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break; - else - len = state.length; - } - state.readingMore = false; -} - -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function(n) { - this.emit('error', new Error('not implemented')); -}; - -Readable.prototype.pipe = function(dest, pipeOpts) { - var src = this; - var state = this._readableState; - - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - - var doEnd = (!pipeOpts || pipeOpts.end !== false) && - dest !== process.stdout && - dest !== process.stderr; - - var endFn = doEnd ? onend : cleanup; - if (state.endEmitted) - processNextTick(endFn); - else - src.once('end', endFn); - - dest.on('unpipe', onunpipe); - function onunpipe(readable) { - debug('onunpipe'); - if (readable === src) { - cleanup(); - } - } - - function onend() { - debug('onend'); - dest.end(); - } - - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', cleanup); - src.removeListener('data', ondata); - - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && - (!dest._writableState || dest._writableState.needDrain)) - ondrain(); - } - - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - var ret = dest.write(chunk); - if (false === ret) { - debug('false write response, pause', - src._readableState.awaitDrain); - src._readableState.awaitDrain++; - src.pause(); - } - } - - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EE.listenerCount(dest, 'error') === 0) - dest.emit('error', er); - } - // This is a brutally ugly hack to make sure that our error handler - // is attached before any userland ones. NEVER DO THIS. - if (!dest._events || !dest._events.error) - dest.on('error', onerror); - else if (isArray(dest._events.error)) - dest._events.error.unshift(onerror); - else - dest._events.error = [onerror, dest._events.error]; - - - - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); - - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } - - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } - - return dest; -}; - -function pipeOnDrain(src) { - return function() { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) - state.awaitDrain--; - if (state.awaitDrain === 0 && EE.listenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; -} - - -Readable.prototype.unpipe = function(dest) { - var state = this._readableState; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) - return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) - return this; - - if (!dest) - dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) - dest.emit('unpipe', this); - return this; - } - - // slow case. multiple pipe destinations. - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - - for (var i = 0; i < len; i++) - dests[i].emit('unpipe', this); - return this; - } - - // try to find the right one. - var i = indexOf(state.pipes, dest); - if (i === -1) - return this; - - state.pipes.splice(i, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) - state.pipes = state.pipes[0]; - - dest.emit('unpipe', this); - - return this; -}; - -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function(ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - - // If listening to data, and it has not explicitly been paused, - // then call resume to start the flow of data on the next tick. - if (ev === 'data' && false !== this._readableState.flowing) { - this.resume(); - } - - if (ev === 'readable' && this.readable) { - var state = this._readableState; - if (!state.readableListening) { - state.readableListening = true; - state.emittedReadable = false; - state.needReadable = true; - if (!state.reading) { - processNextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this, state); - } - } - } - - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; - -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} - -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function() { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - resume(this, state); - } - return this; -}; - -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - processNextTick(resume_, stream, state); - } -} - -function resume_(stream, state) { - if (!state.reading) { - debug('resume read 0'); - stream.read(0); - } - - state.resumeScheduled = false; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) - stream.read(0); -} - -Readable.prototype.pause = function() { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - return this; -}; - -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - if (state.flowing) { - do { - var chunk = stream.read(); - } while (null !== chunk && state.flowing); - } -} - -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function(stream) { - var state = this._readableState; - var paused = false; - - var self = this; - stream.on('end', function() { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) - self.push(chunk); - } - - self.push(null); - }); - - stream.on('data', function(chunk) { - debug('wrapped data'); - if (state.decoder) - chunk = state.decoder.write(chunk); - - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) - return; - else if (!state.objectMode && (!chunk || !chunk.length)) - return; - - var ret = self.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); - - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function(method) { return function() { - return stream[method].apply(stream, arguments); - }; }(i); - } - } - - // proxy certain important events. - var events = ['error', 'close', 'destroy', 'pause', 'resume']; - forEach(events, function(ev) { - stream.on(ev, self.emit.bind(self, ev)); - }); - - // when we try to consume some more bytes, simply unpause the - // underlying stream. - self._read = function(n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); - } - }; - - return self; -}; - - - -// exposed for testing purposes only. -Readable._fromList = fromList; - -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -function fromList(n, state) { - var list = state.buffer; - var length = state.length; - var stringMode = !!state.decoder; - var objectMode = !!state.objectMode; - var ret; - - // nothing in the list, definitely empty. - if (list.length === 0) - return null; - - if (length === 0) - ret = null; - else if (objectMode) - ret = list.shift(); - else if (!n || n >= length) { - // read it all, truncate the array. - if (stringMode) - ret = list.join(''); - else - ret = Buffer.concat(list, length); - list.length = 0; - } else { - // read just some of it. - if (n < list[0].length) { - // just take a part of the first list item. - // slice is the same for buffers and strings. - var buf = list[0]; - ret = buf.slice(0, n); - list[0] = buf.slice(n); - } else if (n === list[0].length) { - // first list is a perfect match - ret = list.shift(); - } else { - // complex case. - // we have enough to cover it, but it spans past the first buffer. - if (stringMode) - ret = ''; - else - ret = new Buffer(n); - - var c = 0; - for (var i = 0, l = list.length; i < l && c < n; i++) { - var buf = list[0]; - var cpy = Math.min(n - c, buf.length); - - if (stringMode) - ret += buf.slice(0, cpy); - else - buf.copy(ret, c, 0, cpy); - - if (cpy < buf.length) - list[0] = buf.slice(cpy); - else - list.shift(); - - c += cpy; - } - } - } - - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) - throw new Error('endReadable called on non-empty stream'); - - if (!state.endEmitted) { - state.ended = true; - processNextTick(endReadableNT, state, stream); - } -} - -function endReadableNT(state, stream) { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } -} - -function forEach (xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} - -function indexOf (xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - return -1; -} diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_transform.js deleted file mode 100644 index 3675d18d915610..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_transform.js +++ /dev/null @@ -1,197 +0,0 @@ -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. - -'use strict'; - -module.exports = Transform; - -var Duplex = require('./_stream_duplex'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(Transform, Duplex); - - -function TransformState(stream) { - this.afterTransform = function(er, data) { - return afterTransform(stream, er, data); - }; - - this.needTransform = false; - this.transforming = false; - this.writecb = null; - this.writechunk = null; -} - -function afterTransform(stream, er, data) { - var ts = stream._transformState; - ts.transforming = false; - - var cb = ts.writecb; - - if (!cb) - return stream.emit('error', new Error('no writecb in Transform class')); - - ts.writechunk = null; - ts.writecb = null; - - if (data !== null && data !== undefined) - stream.push(data); - - if (cb) - cb(er); - - var rs = stream._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - stream._read(rs.highWaterMark); - } -} - - -function Transform(options) { - if (!(this instanceof Transform)) - return new Transform(options); - - Duplex.call(this, options); - - this._transformState = new TransformState(this); - - // when the writable side finishes, then flush out anything remaining. - var stream = this; - - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; - - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; - - if (options) { - if (typeof options.transform === 'function') - this._transform = options.transform; - - if (typeof options.flush === 'function') - this._flush = options.flush; - } - - this.once('prefinish', function() { - if (typeof this._flush === 'function') - this._flush(function(er) { - done(stream, er); - }); - else - done(stream); - }); -} - -Transform.prototype.push = function(chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; - -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function(chunk, encoding, cb) { - throw new Error('not implemented'); -}; - -Transform.prototype._write = function(chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || - rs.needReadable || - rs.length < rs.highWaterMark) - this._read(rs.highWaterMark); - } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function(n) { - var ts = this._transformState; - - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; - - -function done(stream, er) { - if (er) - return stream.emit('error', er); - - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - var ws = stream._writableState; - var ts = stream._transformState; - - if (ws.length) - throw new Error('calling transform done when ws.length != 0'); - - if (ts.transforming) - throw new Error('calling transform done when still transforming'); - - return stream.push(null); -} diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js deleted file mode 100644 index b232952016a9c1..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js +++ /dev/null @@ -1,520 +0,0 @@ -// A bit simpler than readable streams. -// Implement an async ._write(chunk, cb), and it'll handle all -// the drain event emission and buffering. - -'use strict'; - -module.exports = Writable; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - - -/**/ -var Buffer = require('buffer').Buffer; -/**/ - -Writable.WritableState = WritableState; - - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - - - -/**/ -var Stream; -(function (){try{ - Stream = require('st' + 'ream'); -}catch(_){}finally{ - if (!Stream) - Stream = require('events').EventEmitter; -}}()) -/**/ - -var Buffer = require('buffer').Buffer; - -util.inherits(Writable, Stream); - -function nop() {} - -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} - -function WritableState(options, stream) { - var Duplex = require('./_stream_duplex'); - - options = options || {}; - - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; - - if (stream instanceof Duplex) - this.objectMode = this.objectMode || !!options.writableObjectMode; - - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; - - // cast to ints. - this.highWaterMark = ~~this.highWaterMark; - - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; - - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; - - // a flag to see when we're in the middle of a write. - this.writing = false; - - // when true all writes will be buffered until .uncork() call - this.corked = 0; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; - - // the callback that's passed to _write(chunk,cb) - this.onwrite = function(er) { - onwrite(stream, er); - }; - - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; - - this.bufferedRequest = null; - this.lastBufferedRequest = null; - - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; - - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; - - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; -} - -WritableState.prototype.getBuffer = function writableStateGetBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; - } - return out; -}; - -(function (){try { -Object.defineProperty(WritableState.prototype, 'buffer', { - get: require('util-deprecate')(function() { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use ' + - '_writableState.getBuffer() instead.') -}); -}catch(_){}}()); - - -function Writable(options) { - var Duplex = require('./_stream_duplex'); - - // Writable ctor is applied to Duplexes, though they're not - // instanceof Writable, they're instanceof Readable. - if (!(this instanceof Writable) && !(this instanceof Duplex)) - return new Writable(options); - - this._writableState = new WritableState(options, this); - - // legacy. - this.writable = true; - - if (options) { - if (typeof options.write === 'function') - this._write = options.write; - - if (typeof options.writev === 'function') - this._writev = options.writev; - } - - Stream.call(this); -} - -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function() { - this.emit('error', new Error('Cannot pipe. Not readable.')); -}; - - -function writeAfterEnd(stream, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - processNextTick(cb, er); -} - -// If we get something that is not a buffer, string, null, or undefined, -// and we're not in objectMode, then that's an error. -// Otherwise stream chunks are all considered to be of length=1, and the -// watermarks determine how many objects to keep in the buffer, rather than -// how many bytes or characters. -function validChunk(stream, state, chunk, cb) { - var valid = true; - - if (!(Buffer.isBuffer(chunk)) && - typeof chunk !== 'string' && - chunk !== null && - chunk !== undefined && - !state.objectMode) { - var er = new TypeError('Invalid non-string/buffer chunk'); - stream.emit('error', er); - processNextTick(cb, er); - valid = false; - } - return valid; -} - -Writable.prototype.write = function(chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (Buffer.isBuffer(chunk)) - encoding = 'buffer'; - else if (!encoding) - encoding = state.defaultEncoding; - - if (typeof cb !== 'function') - cb = nop; - - if (state.ended) - writeAfterEnd(this, cb); - else if (validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, chunk, encoding, cb); - } - - return ret; -}; - -Writable.prototype.cork = function() { - var state = this._writableState; - - state.corked++; -}; - -Writable.prototype.uncork = function() { - var state = this._writableState; - - if (state.corked) { - state.corked--; - - if (!state.writing && - !state.corked && - !state.finished && - !state.bufferProcessing && - state.bufferedRequest) - clearBuffer(this, state); - } -}; - -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') - encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', -'ucs2', 'ucs-2','utf16le', 'utf-16le', 'raw'] -.indexOf((encoding + '').toLowerCase()) > -1)) - throw new TypeError('Unknown encoding: ' + encoding); - this._writableState.defaultEncoding = encoding; -}; - -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && - state.decodeStrings !== false && - typeof chunk === 'string') { - chunk = new Buffer(chunk, encoding); - } - return chunk; -} - -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, chunk, encoding, cb) { - chunk = decodeChunk(state, chunk, encoding); - - if (Buffer.isBuffer(chunk)) - encoding = 'buffer'; - var len = state.objectMode ? 1 : chunk.length; - - state.length += len; - - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) - state.needDrain = true; - - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - - return ret; -} - -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) - stream._writev(chunk, state.onwrite); - else - stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} - -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - if (sync) - processNextTick(cb, er); - else - cb(er); - - stream._writableState.errorEmitted = true; - stream.emit('error', er); -} - -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} - -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - - onwriteStateUpdate(state); - - if (er) - onwriteError(stream, state, sync, er, cb); - else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state); - - if (!finished && - !state.corked && - !state.bufferProcessing && - state.bufferedRequest) { - clearBuffer(stream, state); - } - - if (sync) { - processNextTick(afterWrite, stream, state, finished, cb); - } else { - afterWrite(stream, state, finished, cb); - } - } -} - -function afterWrite(stream, state, finished, cb) { - if (!finished) - onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} - -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} - - -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var buffer = []; - var cbs = []; - while (entry) { - cbs.push(entry.callback); - buffer.push(entry); - entry = entry.next; - } - - // count the one we are adding, as well. - // TODO(isaacs) clean this up - state.pendingcb++; - state.lastBufferedRequest = null; - doWrite(stream, state, true, state.length, buffer, '', function(err) { - for (var i = 0; i < cbs.length; i++) { - state.pendingcb--; - cbs[i](err); - } - }); - - // Clear buffer - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } - } - - if (entry === null) - state.lastBufferedRequest = null; - } - state.bufferedRequest = entry; - state.bufferProcessing = false; -} - -Writable.prototype._write = function(chunk, encoding, cb) { - cb(new Error('not implemented')); -}; - -Writable.prototype._writev = null; - -Writable.prototype.end = function(chunk, encoding, cb) { - var state = this._writableState; - - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (chunk !== null && chunk !== undefined) - this.write(chunk, encoding); - - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); - } - - // ignore unnecessary end() calls. - if (!state.ending && !state.finished) - endWritable(this, state, cb); -}; - - -function needFinish(state) { - return (state.ending && - state.length === 0 && - state.bufferedRequest === null && - !state.finished && - !state.writing); -} - -function prefinish(stream, state) { - if (!state.prefinished) { - state.prefinished = true; - stream.emit('prefinish'); - } -} - -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - if (state.pendingcb === 0) { - prefinish(stream, state); - state.finished = true; - stream.emit('finish'); - } else { - prefinish(stream, state); - } - } - return need; -} - -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) - processNextTick(cb); - else - stream.once('finish', cb); - } - state.ended = true; -} diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/README.md b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/README.md deleted file mode 100644 index 5a76b4149c5eb5..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# core-util-is - -The `util.is*` functions introduced in Node v0.12. diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/float.patch b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/float.patch deleted file mode 100644 index a06d5c05f75fd5..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/float.patch +++ /dev/null @@ -1,604 +0,0 @@ -diff --git a/lib/util.js b/lib/util.js -index a03e874..9074e8e 100644 ---- a/lib/util.js -+++ b/lib/util.js -@@ -19,430 +19,6 @@ - // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - // USE OR OTHER DEALINGS IN THE SOFTWARE. - --var formatRegExp = /%[sdj%]/g; --exports.format = function(f) { -- if (!isString(f)) { -- var objects = []; -- for (var i = 0; i < arguments.length; i++) { -- objects.push(inspect(arguments[i])); -- } -- return objects.join(' '); -- } -- -- var i = 1; -- var args = arguments; -- var len = args.length; -- var str = String(f).replace(formatRegExp, function(x) { -- if (x === '%%') return '%'; -- if (i >= len) return x; -- switch (x) { -- case '%s': return String(args[i++]); -- case '%d': return Number(args[i++]); -- case '%j': -- try { -- return JSON.stringify(args[i++]); -- } catch (_) { -- return '[Circular]'; -- } -- default: -- return x; -- } -- }); -- for (var x = args[i]; i < len; x = args[++i]) { -- if (isNull(x) || !isObject(x)) { -- str += ' ' + x; -- } else { -- str += ' ' + inspect(x); -- } -- } -- return str; --}; -- -- --// Mark that a method should not be used. --// Returns a modified function which warns once by default. --// If --no-deprecation is set, then it is a no-op. --exports.deprecate = function(fn, msg) { -- // Allow for deprecating things in the process of starting up. -- if (isUndefined(global.process)) { -- return function() { -- return exports.deprecate(fn, msg).apply(this, arguments); -- }; -- } -- -- if (process.noDeprecation === true) { -- return fn; -- } -- -- var warned = false; -- function deprecated() { -- if (!warned) { -- if (process.throwDeprecation) { -- throw new Error(msg); -- } else if (process.traceDeprecation) { -- console.trace(msg); -- } else { -- console.error(msg); -- } -- warned = true; -- } -- return fn.apply(this, arguments); -- } -- -- return deprecated; --}; -- -- --var debugs = {}; --var debugEnviron; --exports.debuglog = function(set) { -- if (isUndefined(debugEnviron)) -- debugEnviron = process.env.NODE_DEBUG || ''; -- set = set.toUpperCase(); -- if (!debugs[set]) { -- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { -- var pid = process.pid; -- debugs[set] = function() { -- var msg = exports.format.apply(exports, arguments); -- console.error('%s %d: %s', set, pid, msg); -- }; -- } else { -- debugs[set] = function() {}; -- } -- } -- return debugs[set]; --}; -- -- --/** -- * Echos the value of a value. Trys to print the value out -- * in the best way possible given the different types. -- * -- * @param {Object} obj The object to print out. -- * @param {Object} opts Optional options object that alters the output. -- */ --/* legacy: obj, showHidden, depth, colors*/ --function inspect(obj, opts) { -- // default options -- var ctx = { -- seen: [], -- stylize: stylizeNoColor -- }; -- // legacy... -- if (arguments.length >= 3) ctx.depth = arguments[2]; -- if (arguments.length >= 4) ctx.colors = arguments[3]; -- if (isBoolean(opts)) { -- // legacy... -- ctx.showHidden = opts; -- } else if (opts) { -- // got an "options" object -- exports._extend(ctx, opts); -- } -- // set default options -- if (isUndefined(ctx.showHidden)) ctx.showHidden = false; -- if (isUndefined(ctx.depth)) ctx.depth = 2; -- if (isUndefined(ctx.colors)) ctx.colors = false; -- if (isUndefined(ctx.customInspect)) ctx.customInspect = true; -- if (ctx.colors) ctx.stylize = stylizeWithColor; -- return formatValue(ctx, obj, ctx.depth); --} --exports.inspect = inspect; -- -- --// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics --inspect.colors = { -- 'bold' : [1, 22], -- 'italic' : [3, 23], -- 'underline' : [4, 24], -- 'inverse' : [7, 27], -- 'white' : [37, 39], -- 'grey' : [90, 39], -- 'black' : [30, 39], -- 'blue' : [34, 39], -- 'cyan' : [36, 39], -- 'green' : [32, 39], -- 'magenta' : [35, 39], -- 'red' : [31, 39], -- 'yellow' : [33, 39] --}; -- --// Don't use 'blue' not visible on cmd.exe --inspect.styles = { -- 'special': 'cyan', -- 'number': 'yellow', -- 'boolean': 'yellow', -- 'undefined': 'grey', -- 'null': 'bold', -- 'string': 'green', -- 'date': 'magenta', -- // "name": intentionally not styling -- 'regexp': 'red' --}; -- -- --function stylizeWithColor(str, styleType) { -- var style = inspect.styles[styleType]; -- -- if (style) { -- return '\u001b[' + inspect.colors[style][0] + 'm' + str + -- '\u001b[' + inspect.colors[style][1] + 'm'; -- } else { -- return str; -- } --} -- -- --function stylizeNoColor(str, styleType) { -- return str; --} -- -- --function arrayToHash(array) { -- var hash = {}; -- -- array.forEach(function(val, idx) { -- hash[val] = true; -- }); -- -- return hash; --} -- -- --function formatValue(ctx, value, recurseTimes) { -- // Provide a hook for user-specified inspect functions. -- // Check that value is an object with an inspect function on it -- if (ctx.customInspect && -- value && -- isFunction(value.inspect) && -- // Filter out the util module, it's inspect function is special -- value.inspect !== exports.inspect && -- // Also filter out any prototype objects using the circular check. -- !(value.constructor && value.constructor.prototype === value)) { -- var ret = value.inspect(recurseTimes, ctx); -- if (!isString(ret)) { -- ret = formatValue(ctx, ret, recurseTimes); -- } -- return ret; -- } -- -- // Primitive types cannot have properties -- var primitive = formatPrimitive(ctx, value); -- if (primitive) { -- return primitive; -- } -- -- // Look up the keys of the object. -- var keys = Object.keys(value); -- var visibleKeys = arrayToHash(keys); -- -- if (ctx.showHidden) { -- keys = Object.getOwnPropertyNames(value); -- } -- -- // Some type of object without properties can be shortcutted. -- if (keys.length === 0) { -- if (isFunction(value)) { -- var name = value.name ? ': ' + value.name : ''; -- return ctx.stylize('[Function' + name + ']', 'special'); -- } -- if (isRegExp(value)) { -- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); -- } -- if (isDate(value)) { -- return ctx.stylize(Date.prototype.toString.call(value), 'date'); -- } -- if (isError(value)) { -- return formatError(value); -- } -- } -- -- var base = '', array = false, braces = ['{', '}']; -- -- // Make Array say that they are Array -- if (isArray(value)) { -- array = true; -- braces = ['[', ']']; -- } -- -- // Make functions say that they are functions -- if (isFunction(value)) { -- var n = value.name ? ': ' + value.name : ''; -- base = ' [Function' + n + ']'; -- } -- -- // Make RegExps say that they are RegExps -- if (isRegExp(value)) { -- base = ' ' + RegExp.prototype.toString.call(value); -- } -- -- // Make dates with properties first say the date -- if (isDate(value)) { -- base = ' ' + Date.prototype.toUTCString.call(value); -- } -- -- // Make error with message first say the error -- if (isError(value)) { -- base = ' ' + formatError(value); -- } -- -- if (keys.length === 0 && (!array || value.length == 0)) { -- return braces[0] + base + braces[1]; -- } -- -- if (recurseTimes < 0) { -- if (isRegExp(value)) { -- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); -- } else { -- return ctx.stylize('[Object]', 'special'); -- } -- } -- -- ctx.seen.push(value); -- -- var output; -- if (array) { -- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); -- } else { -- output = keys.map(function(key) { -- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); -- }); -- } -- -- ctx.seen.pop(); -- -- return reduceToSingleString(output, base, braces); --} -- -- --function formatPrimitive(ctx, value) { -- if (isUndefined(value)) -- return ctx.stylize('undefined', 'undefined'); -- if (isString(value)) { -- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') -- .replace(/'/g, "\\'") -- .replace(/\\"/g, '"') + '\''; -- return ctx.stylize(simple, 'string'); -- } -- if (isNumber(value)) { -- // Format -0 as '-0'. Strict equality won't distinguish 0 from -0, -- // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 . -- if (value === 0 && 1 / value < 0) -- return ctx.stylize('-0', 'number'); -- return ctx.stylize('' + value, 'number'); -- } -- if (isBoolean(value)) -- return ctx.stylize('' + value, 'boolean'); -- // For some reason typeof null is "object", so special case here. -- if (isNull(value)) -- return ctx.stylize('null', 'null'); --} -- -- --function formatError(value) { -- return '[' + Error.prototype.toString.call(value) + ']'; --} -- -- --function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { -- var output = []; -- for (var i = 0, l = value.length; i < l; ++i) { -- if (hasOwnProperty(value, String(i))) { -- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, -- String(i), true)); -- } else { -- output.push(''); -- } -- } -- keys.forEach(function(key) { -- if (!key.match(/^\d+$/)) { -- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, -- key, true)); -- } -- }); -- return output; --} -- -- --function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { -- var name, str, desc; -- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; -- if (desc.get) { -- if (desc.set) { -- str = ctx.stylize('[Getter/Setter]', 'special'); -- } else { -- str = ctx.stylize('[Getter]', 'special'); -- } -- } else { -- if (desc.set) { -- str = ctx.stylize('[Setter]', 'special'); -- } -- } -- if (!hasOwnProperty(visibleKeys, key)) { -- name = '[' + key + ']'; -- } -- if (!str) { -- if (ctx.seen.indexOf(desc.value) < 0) { -- if (isNull(recurseTimes)) { -- str = formatValue(ctx, desc.value, null); -- } else { -- str = formatValue(ctx, desc.value, recurseTimes - 1); -- } -- if (str.indexOf('\n') > -1) { -- if (array) { -- str = str.split('\n').map(function(line) { -- return ' ' + line; -- }).join('\n').substr(2); -- } else { -- str = '\n' + str.split('\n').map(function(line) { -- return ' ' + line; -- }).join('\n'); -- } -- } -- } else { -- str = ctx.stylize('[Circular]', 'special'); -- } -- } -- if (isUndefined(name)) { -- if (array && key.match(/^\d+$/)) { -- return str; -- } -- name = JSON.stringify('' + key); -- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { -- name = name.substr(1, name.length - 2); -- name = ctx.stylize(name, 'name'); -- } else { -- name = name.replace(/'/g, "\\'") -- .replace(/\\"/g, '"') -- .replace(/(^"|"$)/g, "'"); -- name = ctx.stylize(name, 'string'); -- } -- } -- -- return name + ': ' + str; --} -- -- --function reduceToSingleString(output, base, braces) { -- var numLinesEst = 0; -- var length = output.reduce(function(prev, cur) { -- numLinesEst++; -- if (cur.indexOf('\n') >= 0) numLinesEst++; -- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; -- }, 0); -- -- if (length > 60) { -- return braces[0] + -- (base === '' ? '' : base + '\n ') + -- ' ' + -- output.join(',\n ') + -- ' ' + -- braces[1]; -- } -- -- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; --} -- -- - // NOTE: These type checking functions intentionally don't use `instanceof` - // because it is fragile and can be easily faked with `Object.create()`. - function isArray(ar) { -@@ -522,166 +98,10 @@ function isPrimitive(arg) { - exports.isPrimitive = isPrimitive; - - function isBuffer(arg) { -- return arg instanceof Buffer; -+ return Buffer.isBuffer(arg); - } - exports.isBuffer = isBuffer; - - function objectToString(o) { - return Object.prototype.toString.call(o); --} -- -- --function pad(n) { -- return n < 10 ? '0' + n.toString(10) : n.toString(10); --} -- -- --var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', -- 'Oct', 'Nov', 'Dec']; -- --// 26 Feb 16:19:34 --function timestamp() { -- var d = new Date(); -- var time = [pad(d.getHours()), -- pad(d.getMinutes()), -- pad(d.getSeconds())].join(':'); -- return [d.getDate(), months[d.getMonth()], time].join(' '); --} -- -- --// log is just a thin wrapper to console.log that prepends a timestamp --exports.log = function() { -- console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); --}; -- -- --/** -- * Inherit the prototype methods from one constructor into another. -- * -- * The Function.prototype.inherits from lang.js rewritten as a standalone -- * function (not on Function.prototype). NOTE: If this file is to be loaded -- * during bootstrapping this function needs to be rewritten using some native -- * functions as prototype setup using normal JavaScript does not work as -- * expected during bootstrapping (see mirror.js in r114903). -- * -- * @param {function} ctor Constructor function which needs to inherit the -- * prototype. -- * @param {function} superCtor Constructor function to inherit prototype from. -- */ --exports.inherits = function(ctor, superCtor) { -- ctor.super_ = superCtor; -- ctor.prototype = Object.create(superCtor.prototype, { -- constructor: { -- value: ctor, -- enumerable: false, -- writable: true, -- configurable: true -- } -- }); --}; -- --exports._extend = function(origin, add) { -- // Don't do anything if add isn't an object -- if (!add || !isObject(add)) return origin; -- -- var keys = Object.keys(add); -- var i = keys.length; -- while (i--) { -- origin[keys[i]] = add[keys[i]]; -- } -- return origin; --}; -- --function hasOwnProperty(obj, prop) { -- return Object.prototype.hasOwnProperty.call(obj, prop); --} -- -- --// Deprecated old stuff. -- --exports.p = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- console.error(exports.inspect(arguments[i])); -- } --}, 'util.p: Use console.error() instead'); -- -- --exports.exec = exports.deprecate(function() { -- return require('child_process').exec.apply(this, arguments); --}, 'util.exec is now called `child_process.exec`.'); -- -- --exports.print = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stdout.write(String(arguments[i])); -- } --}, 'util.print: Use console.log instead'); -- -- --exports.puts = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stdout.write(arguments[i] + '\n'); -- } --}, 'util.puts: Use console.log instead'); -- -- --exports.debug = exports.deprecate(function(x) { -- process.stderr.write('DEBUG: ' + x + '\n'); --}, 'util.debug: Use console.error instead'); -- -- --exports.error = exports.deprecate(function(x) { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stderr.write(arguments[i] + '\n'); -- } --}, 'util.error: Use console.error instead'); -- -- --exports.pump = exports.deprecate(function(readStream, writeStream, callback) { -- var callbackCalled = false; -- -- function call(a, b, c) { -- if (callback && !callbackCalled) { -- callback(a, b, c); -- callbackCalled = true; -- } -- } -- -- readStream.addListener('data', function(chunk) { -- if (writeStream.write(chunk) === false) readStream.pause(); -- }); -- -- writeStream.addListener('drain', function() { -- readStream.resume(); -- }); -- -- readStream.addListener('end', function() { -- writeStream.end(); -- }); -- -- readStream.addListener('close', function() { -- call(); -- }); -- -- readStream.addListener('error', function(err) { -- writeStream.end(); -- call(err); -- }); -- -- writeStream.addListener('error', function(err) { -- readStream.destroy(); -- call(err); -- }); --}, 'util.pump(): Use readableStream.pipe() instead'); -- -- --var uv; --exports._errnoException = function(err, syscall) { -- if (isUndefined(uv)) uv = process.binding('uv'); -- var errname = uv.errname(err); -- var e = new Error(syscall + ' ' + errname); -- e.code = errname; -- e.errno = errname; -- e.syscall = syscall; -- return e; --}; -+} \ No newline at end of file diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/lib/util.js deleted file mode 100644 index 9074e8ebcb61e9..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/lib/util.js +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. -function isArray(ar) { - return Array.isArray(ar); -} -exports.isArray = isArray; - -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; - -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; - -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; - -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; - -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; - -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; - -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return isObject(re) && objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return isObject(d) && objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; - -function isError(e) { - return isObject(e) && - (objectToString(e) === '[object Error]' || e instanceof Error); -} -exports.isError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; - -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -function isBuffer(arg) { - return Buffer.isBuffer(arg); -} -exports.isBuffer = isBuffer; - -function objectToString(o) { - return Object.prototype.toString.call(o); -} \ No newline at end of file diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/package.json b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/package.json deleted file mode 100644 index 466dfdfe0139b3..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "core-util-is", - "version": "1.0.1", - "description": "The `util.is*` functions introduced in Node v0.12.", - "main": "lib/util.js", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/core-util-is.git" - }, - "keywords": [ - "util", - "isBuffer", - "isArray", - "isNumber", - "isString", - "isRegExp", - "isThis", - "isThat", - "polyfill" - ], - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/isaacs/core-util-is/issues" - }, - "readme": "# core-util-is\n\nThe `util.is*` functions introduced in Node v0.12.\n", - "readmeFilename": "README.md", - "homepage": "https://github.com/isaacs/core-util-is", - "_id": "core-util-is@1.0.1", - "dist": { - "shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538", - "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" - }, - "_from": "core-util-is@>=1.0.0 <1.1.0", - "_npmVersion": "1.3.23", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, - "_shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538", - "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" -} diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/util.js b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/util.js deleted file mode 100644 index 007fa10575636d..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/util.js +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. -function isArray(ar) { - return Array.isArray(ar); -} -exports.isArray = isArray; - -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; - -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; - -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; - -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; - -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; - -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; - -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return isObject(re) && objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return isObject(d) && objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; - -function isError(e) { - return isObject(e) && objectToString(e) === '[object Error]'; -} -exports.isError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; - -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -function isBuffer(arg) { - return arg instanceof Buffer; -} -exports.isBuffer = isBuffer; - -function objectToString(o) { - return Object.prototype.toString.call(o); -} diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/README.md b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/README.md deleted file mode 100644 index 052a62b8d7b7ae..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -# isarray - -`Array#isArray` for older browsers. - -## Usage - -```js -var isArray = require('isarray'); - -console.log(isArray([])); // => true -console.log(isArray({})); // => false -``` - -## Installation - -With [npm](http://npmjs.org) do - -```bash -$ npm install isarray -``` - -Then bundle for the browser with -[browserify](https://github.com/substack/browserify). - -With [component](http://component.io) do - -```bash -$ component install juliangruber/isarray -``` - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/build/build.js b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/build/build.js deleted file mode 100644 index e1856ef0943728..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/build/build.js +++ /dev/null @@ -1,208 +0,0 @@ - -/** - * Require the given path. - * - * @param {String} path - * @return {Object} exports - * @api public - */ - -function require(path, parent, orig) { - var resolved = require.resolve(path); - - // lookup failed - if (null == resolved) { - orig = orig || path; - parent = parent || 'root'; - var err = new Error('Failed to require "' + orig + '" from "' + parent + '"'); - err.path = orig; - err.parent = parent; - err.require = true; - throw err; - } - - var module = require.modules[resolved]; - - // perform real require() - // by invoking the module's - // registered function - if (!module.exports) { - module.exports = {}; - module.client = module.component = true; - module.call(this, module.exports, require.relative(resolved), module); - } - - return module.exports; -} - -/** - * Registered modules. - */ - -require.modules = {}; - -/** - * Registered aliases. - */ - -require.aliases = {}; - -/** - * Resolve `path`. - * - * Lookup: - * - * - PATH/index.js - * - PATH.js - * - PATH - * - * @param {String} path - * @return {String} path or null - * @api private - */ - -require.resolve = function(path) { - if (path.charAt(0) === '/') path = path.slice(1); - var index = path + '/index.js'; - - var paths = [ - path, - path + '.js', - path + '.json', - path + '/index.js', - path + '/index.json' - ]; - - for (var i = 0; i < paths.length; i++) { - var path = paths[i]; - if (require.modules.hasOwnProperty(path)) return path; - } - - if (require.aliases.hasOwnProperty(index)) { - return require.aliases[index]; - } -}; - -/** - * Normalize `path` relative to the current path. - * - * @param {String} curr - * @param {String} path - * @return {String} - * @api private - */ - -require.normalize = function(curr, path) { - var segs = []; - - if ('.' != path.charAt(0)) return path; - - curr = curr.split('/'); - path = path.split('/'); - - for (var i = 0; i < path.length; ++i) { - if ('..' == path[i]) { - curr.pop(); - } else if ('.' != path[i] && '' != path[i]) { - segs.push(path[i]); - } - } - - return curr.concat(segs).join('/'); -}; - -/** - * Register module at `path` with callback `definition`. - * - * @param {String} path - * @param {Function} definition - * @api private - */ - -require.register = function(path, definition) { - require.modules[path] = definition; -}; - -/** - * Alias a module definition. - * - * @param {String} from - * @param {String} to - * @api private - */ - -require.alias = function(from, to) { - if (!require.modules.hasOwnProperty(from)) { - throw new Error('Failed to alias "' + from + '", it does not exist'); - } - require.aliases[to] = from; -}; - -/** - * Return a require function relative to the `parent` path. - * - * @param {String} parent - * @return {Function} - * @api private - */ - -require.relative = function(parent) { - var p = require.normalize(parent, '..'); - - /** - * lastIndexOf helper. - */ - - function lastIndexOf(arr, obj) { - var i = arr.length; - while (i--) { - if (arr[i] === obj) return i; - } - return -1; - } - - /** - * The relative require() itself. - */ - - function localRequire(path) { - var resolved = localRequire.resolve(path); - return require(resolved, parent, path); - } - - /** - * Resolve relative to the parent. - */ - - localRequire.resolve = function(path) { - var c = path.charAt(0); - if ('/' == c) return path.slice(1); - if ('.' == c) return require.normalize(p, path); - - // resolve deps by returning - // the dep in the nearest "deps" - // directory - var segs = parent.split('/'); - var i = lastIndexOf(segs, 'deps') + 1; - if (!i) i = 0; - path = segs.slice(0, i + 1).join('/') + '/deps/' + path; - return path; - }; - - /** - * Check if module is defined at `path`. - */ - - localRequire.exists = function(path) { - return require.modules.hasOwnProperty(localRequire.resolve(path)); - }; - - return localRequire; -}; -require.register("isarray/index.js", function(exports, require, module){ -module.exports = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; -}; - -}); -require.alias("isarray/index.js", "isarray/index.js"); diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/component.json b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/component.json deleted file mode 100644 index 9e31b683889015..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name" : "isarray", - "description" : "Array#isArray for older browsers", - "version" : "0.0.1", - "repository" : "juliangruber/isarray", - "homepage": "https://github.com/juliangruber/isarray", - "main" : "index.js", - "scripts" : [ - "index.js" - ], - "dependencies" : {}, - "keywords": ["browser","isarray","array"], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT" -} diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/index.js b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/index.js deleted file mode 100644 index 5f5ad45d46dda9..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/index.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; -}; diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/package.json b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/package.json deleted file mode 100644 index 19228ab6fdcaaf..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "isarray", - "description": "Array#isArray for older browsers", - "version": "0.0.1", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/isarray.git" - }, - "homepage": "https://github.com/juliangruber/isarray", - "main": "index.js", - "scripts": { - "test": "tap test/*.js" - }, - "dependencies": {}, - "devDependencies": { - "tap": "*" - }, - "keywords": [ - "browser", - "isarray", - "array" - ], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT", - "_id": "isarray@0.0.1", - "dist": { - "shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", - "tarball": "http://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" - }, - "_from": "isarray@0.0.1", - "_npmVersion": "1.2.18", - "_npmUser": { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - "maintainers": [ - { - "name": "juliangruber", - "email": "julian@juliangruber.com" - } - ], - "directories": {}, - "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", - "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "bugs": { - "url": "https://github.com/juliangruber/isarray/issues" - }, - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml deleted file mode 100644 index 5ac98855343cee..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" - - "0.11" - - "0.12" - - "iojs" diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/index.js b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/index.js deleted file mode 100644 index 049521cad7ba1b..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/index.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; -module.exports = nextTick; - -function nextTick(fn) { - var args = new Array(arguments.length - 1); - var i = 0; - while (i < args.length) { - args[i++] = arguments[i]; - } - process.nextTick(function afterTick() { - fn.apply(null, args); - }); -} diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/license.md b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/license.md deleted file mode 100644 index c67e3532b54245..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/license.md +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2015 Calvin Metcalf - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -**THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE.** diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/package.json b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/package.json deleted file mode 100644 index 087586e8f8cedd..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "process-nextick-args", - "version": "1.0.3", - "description": "process.nextTick but always with args", - "main": "index.js", - "scripts": { - "test": "node test.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/calvinmetcalf/process-nextick-args.git" - }, - "author": "", - "license": "MIT", - "bugs": { - "url": "https://github.com/calvinmetcalf/process-nextick-args/issues" - }, - "homepage": "https://github.com/calvinmetcalf/process-nextick-args", - "devDependencies": { - "tap": "~0.2.6" - }, - "gitHead": "e855846a69662b9489f1ad3dde1ebf2ccc4370b8", - "_id": "process-nextick-args@1.0.3", - "_shasum": "e272eed825d5e9f4ea74d8d73b1fe311c3beb630", - "_from": "process-nextick-args@>=1.0.0 <1.1.0", - "_npmVersion": "2.9.0", - "_nodeVersion": "2.5.0", - "_npmUser": { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - }, - "dist": { - "shasum": "e272eed825d5e9f4ea74d8d73b1fe311c3beb630", - "tarball": "http://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.3.tgz" - }, - "maintainers": [ - { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.3.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/readme.md b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/readme.md deleted file mode 100644 index 78e7cfaeb7acde..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/readme.md +++ /dev/null @@ -1,18 +0,0 @@ -process-nextick-args -===== - -[![Build Status](https://travis-ci.org/calvinmetcalf/process-nextick-args.svg?branch=master)](https://travis-ci.org/calvinmetcalf/process-nextick-args) - -```bash -npm install --save process-nextick-args -``` - -Always be able to pass arguments to process.nextTick, no matter the platform - -```js -var nextTick = require('process-nextick-args'); - -nextTick(function (a, b, c) { - console.log(a, b, c); -}, 'step', 3, 'profit'); -``` diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/test.js b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/test.js deleted file mode 100644 index ef15721584ac99..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/test.js +++ /dev/null @@ -1,24 +0,0 @@ -var test = require("tap").test; -var nextTick = require('./'); - -test('should work', function (t) { - t.plan(5); - nextTick(function (a) { - t.ok(a); - nextTick(function (thing) { - t.equals(thing, 7); - }, 7); - }, true); - nextTick(function (a, b, c) { - t.equals(a, 'step'); - t.equals(b, 3); - t.equals(c, 'profit'); - }, 'step', 3, 'profit'); -}); - -test('correct number of arguments', function (t) { - t.plan(1); - nextTick(function () { - t.equals(2, arguments.length, 'correct number'); - }, 1, 2); -}); diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/.npmignore b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/.npmignore deleted file mode 100644 index 206320cc1d21b9..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -build -test diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/LICENSE b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/LICENSE deleted file mode 100644 index 6de584a48f5c89..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright Joyent, Inc. and other Node contributors. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to permit -persons to whom the Software is furnished to do so, subject to the -following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/README.md b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/README.md deleted file mode 100644 index 4d2aa001501107..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/README.md +++ /dev/null @@ -1,7 +0,0 @@ -**string_decoder.js** (`require('string_decoder')`) from Node.js core - -Copyright Joyent, Inc. and other Node contributors. See LICENCE file for details. - -Version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.** - -The *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version. \ No newline at end of file diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/index.js b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/index.js deleted file mode 100644 index b00e54fb790982..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/index.js +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -var Buffer = require('buffer').Buffer; - -var isBufferEncoding = Buffer.isEncoding - || function(encoding) { - switch (encoding && encoding.toLowerCase()) { - case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; - default: return false; - } - } - - -function assertEncoding(encoding) { - if (encoding && !isBufferEncoding(encoding)) { - throw new Error('Unknown encoding: ' + encoding); - } -} - -// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. CESU-8 is handled as part of the UTF-8 encoding. -// -// @TODO Handling all encodings inside a single object makes it very difficult -// to reason about this code, so it should be split up in the future. -// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code -// points as used by CESU-8. -var StringDecoder = exports.StringDecoder = function(encoding) { - this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); - assertEncoding(encoding); - switch (this.encoding) { - case 'utf8': - // CESU-8 represents each of Surrogate Pair by 3-bytes - this.surrogateSize = 3; - break; - case 'ucs2': - case 'utf16le': - // UTF-16 represents each of Surrogate Pair by 2-bytes - this.surrogateSize = 2; - this.detectIncompleteChar = utf16DetectIncompleteChar; - break; - case 'base64': - // Base-64 stores 3 bytes in 4 chars, and pads the remainder. - this.surrogateSize = 3; - this.detectIncompleteChar = base64DetectIncompleteChar; - break; - default: - this.write = passThroughWrite; - return; - } - - // Enough space to store all bytes of a single character. UTF-8 needs 4 - // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). - this.charBuffer = new Buffer(6); - // Number of bytes received for the current incomplete multi-byte character. - this.charReceived = 0; - // Number of bytes expected for the current incomplete multi-byte character. - this.charLength = 0; -}; - - -// write decodes the given buffer and returns it as JS string that is -// guaranteed to not contain any partial multi-byte characters. Any partial -// character found at the end of the buffer is buffered up, and will be -// returned when calling write again with the remaining bytes. -// -// Note: Converting a Buffer containing an orphan surrogate to a String -// currently works, but converting a String to a Buffer (via `new Buffer`, or -// Buffer#write) will replace incomplete surrogates with the unicode -// replacement character. See https://codereview.chromium.org/121173009/ . -StringDecoder.prototype.write = function(buffer) { - var charStr = ''; - // if our last write ended with an incomplete multibyte character - while (this.charLength) { - // determine how many remaining bytes this buffer has to offer for this char - var available = (buffer.length >= this.charLength - this.charReceived) ? - this.charLength - this.charReceived : - buffer.length; - - // add the new bytes to the char buffer - buffer.copy(this.charBuffer, this.charReceived, 0, available); - this.charReceived += available; - - if (this.charReceived < this.charLength) { - // still not enough chars in this buffer? wait for more ... - return ''; - } - - // remove bytes belonging to the current character from the buffer - buffer = buffer.slice(available, buffer.length); - - // get the character that was split - charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); - - // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - var charCode = charStr.charCodeAt(charStr.length - 1); - if (charCode >= 0xD800 && charCode <= 0xDBFF) { - this.charLength += this.surrogateSize; - charStr = ''; - continue; - } - this.charReceived = this.charLength = 0; - - // if there are no more bytes in this buffer, just emit our char - if (buffer.length === 0) { - return charStr; - } - break; - } - - // determine and set charLength / charReceived - this.detectIncompleteChar(buffer); - - var end = buffer.length; - if (this.charLength) { - // buffer the incomplete character bytes we got - buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); - end -= this.charReceived; - } - - charStr += buffer.toString(this.encoding, 0, end); - - var end = charStr.length - 1; - var charCode = charStr.charCodeAt(end); - // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - if (charCode >= 0xD800 && charCode <= 0xDBFF) { - var size = this.surrogateSize; - this.charLength += size; - this.charReceived += size; - this.charBuffer.copy(this.charBuffer, size, 0, size); - buffer.copy(this.charBuffer, 0, 0, size); - return charStr.substring(0, end); - } - - // or just emit the charStr - return charStr; -}; - -// detectIncompleteChar determines if there is an incomplete UTF-8 character at -// the end of the given buffer. If so, it sets this.charLength to the byte -// length that character, and sets this.charReceived to the number of bytes -// that are available for this character. -StringDecoder.prototype.detectIncompleteChar = function(buffer) { - // determine how many bytes we have to check at the end of this buffer - var i = (buffer.length >= 3) ? 3 : buffer.length; - - // Figure out if one of the last i bytes of our buffer announces an - // incomplete char. - for (; i > 0; i--) { - var c = buffer[buffer.length - i]; - - // See http://en.wikipedia.org/wiki/UTF-8#Description - - // 110XXXXX - if (i == 1 && c >> 5 == 0x06) { - this.charLength = 2; - break; - } - - // 1110XXXX - if (i <= 2 && c >> 4 == 0x0E) { - this.charLength = 3; - break; - } - - // 11110XXX - if (i <= 3 && c >> 3 == 0x1E) { - this.charLength = 4; - break; - } - } - this.charReceived = i; -}; - -StringDecoder.prototype.end = function(buffer) { - var res = ''; - if (buffer && buffer.length) - res = this.write(buffer); - - if (this.charReceived) { - var cr = this.charReceived; - var buf = this.charBuffer; - var enc = this.encoding; - res += buf.slice(0, cr).toString(enc); - } - - return res; -}; - -function passThroughWrite(buffer) { - return buffer.toString(this.encoding); -} - -function utf16DetectIncompleteChar(buffer) { - this.charReceived = buffer.length % 2; - this.charLength = this.charReceived ? 2 : 0; -} - -function base64DetectIncompleteChar(buffer) { - this.charReceived = buffer.length % 3; - this.charLength = this.charReceived ? 3 : 0; -} diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/package.json b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/package.json deleted file mode 100644 index 0364d54ba46af6..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "string_decoder", - "version": "0.10.31", - "description": "The string_decoder module from Node core", - "main": "index.js", - "dependencies": {}, - "devDependencies": { - "tap": "~0.4.8" - }, - "scripts": { - "test": "tap test/simple/*.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/rvagg/string_decoder.git" - }, - "homepage": "https://github.com/rvagg/string_decoder", - "keywords": [ - "string", - "decoder", - "browser", - "browserify" - ], - "license": "MIT", - "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0", - "bugs": { - "url": "https://github.com/rvagg/string_decoder/issues" - }, - "_id": "string_decoder@0.10.31", - "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "_from": "string_decoder@>=0.10.0 <0.11.0", - "_npmVersion": "1.4.23", - "_npmUser": { - "name": "rvagg", - "email": "rod@vagg.org" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - }, - { - "name": "rvagg", - "email": "rod@vagg.org" - } - ], - "dist": { - "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/History.md b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/History.md deleted file mode 100644 index ec010299b1b259..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/History.md +++ /dev/null @@ -1,11 +0,0 @@ - -1.0.1 / 2014-11-25 -================== - - * browser: use `console.warn()` for deprecation calls - * browser: more jsdocs - -1.0.0 / 2014-04-30 -================== - - * initial commit diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/LICENSE b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/LICENSE deleted file mode 100644 index 6a60e8c225c9ba..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Nathan Rajlich - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/README.md b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/README.md deleted file mode 100644 index 75622fa7c250a6..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/README.md +++ /dev/null @@ -1,53 +0,0 @@ -util-deprecate -============== -### The Node.js `util.deprecate()` function with browser support - -In Node.js, this module simply re-exports the `util.deprecate()` function. - -In the web browser (i.e. via browserify), a browser-specific implementation -of the `util.deprecate()` function is used. - - -## API - -A `deprecate()` function is the only thing exposed by this module. - -``` javascript -// setup: -exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead'); - - -// users see: -foo(); -// foo() is deprecated, use bar() instead -foo(); -foo(); -``` - - -## License - -(The MIT License) - -Copyright (c) 2014 Nathan Rajlich - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/browser.js b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/browser.js deleted file mode 100644 index 55fa5a4bc6056a..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/browser.js +++ /dev/null @@ -1,62 +0,0 @@ - -/** - * Module exports. - */ - -module.exports = deprecate; - -/** - * Mark that a method should not be used. - * Returns a modified function which warns once by default. - * - * If `localStorage.noDeprecation = true` is set, then it is a no-op. - * - * If `localStorage.throwDeprecation = true` is set, then deprecated functions - * will throw an Error when invoked. - * - * If `localStorage.traceDeprecation = true` is set, then deprecated functions - * will invoke `console.trace()` instead of `console.error()`. - * - * @param {Function} fn - the function to deprecate - * @param {String} msg - the string to print to the console when `fn` is invoked - * @returns {Function} a new "deprecated" version of `fn` - * @api public - */ - -function deprecate (fn, msg) { - if (config('noDeprecation')) { - return fn; - } - - var warned = false; - function deprecated() { - if (!warned) { - if (config('throwDeprecation')) { - throw new Error(msg); - } else if (config('traceDeprecation')) { - console.trace(msg); - } else { - console.warn(msg); - } - warned = true; - } - return fn.apply(this, arguments); - } - - return deprecated; -} - -/** - * Checks `localStorage` for boolean values for the given `name`. - * - * @param {String} name - * @returns {Boolean} - * @api private - */ - -function config (name) { - if (!global.localStorage) return false; - var val = global.localStorage[name]; - if (null == val) return false; - return String(val).toLowerCase() === 'true'; -} diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/node.js b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/node.js deleted file mode 100644 index 5e6fcff5ddd3fb..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/node.js +++ /dev/null @@ -1,6 +0,0 @@ - -/** - * For Node.js, simply re-export the core `util.deprecate` function. - */ - -module.exports = require('util').deprecate; diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/package.json b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/package.json deleted file mode 100644 index ea487da0e43000..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "util-deprecate", - "version": "1.0.1", - "description": "The Node.js `util.deprecate()` function with browser support", - "main": "node.js", - "browser": "browser.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/util-deprecate.git" - }, - "keywords": [ - "util", - "deprecate", - "browserify", - "browser", - "node" - ], - "author": { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://n8.io/" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/TooTallNate/util-deprecate/issues" - }, - "homepage": "https://github.com/TooTallNate/util-deprecate", - "gitHead": "6e923f7d98a0afbe5b9c7db9d0f0029c1936746c", - "_id": "util-deprecate@1.0.1", - "_shasum": "3556a3d13c4c6aa7983d7e2425478197199b7881", - "_from": "util-deprecate@>=1.0.1 <1.1.0", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - }, - "maintainers": [ - { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - } - ], - "dist": { - "shasum": "3556a3d13c4c6aa7983d7e2425478197199b7881", - "tarball": "http://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/package.json b/deps/npm/node_modules/sha/node_modules/readable-stream/package.json deleted file mode 100644 index 7a333a98a324e1..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "readable-stream", - "version": "2.0.2", - "description": "Streams3, a user-land copy of the stream library from iojs v2.x", - "main": "readable.js", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "process-nextick-args": "~1.0.0", - "string_decoder": "~0.10.x", - "util-deprecate": "~1.0.1" - }, - "devDependencies": { - "tap": "~0.2.6", - "tape": "~4.0.0", - "zuul": "~3.0.0" - }, - "scripts": { - "test": "tap test/parallel/*.js", - "browser": "zuul --browser-name $BROWSER_NAME --browser-version $BROWSER_VERSION -- test/browser.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/nodejs/readable-stream.git" - }, - "keywords": [ - "readable", - "stream", - "pipe" - ], - "browser": { - "util": false - }, - "license": "MIT", - "gitHead": "1a70134a71196eeabb5e27bc7580faaa68d30513", - "bugs": { - "url": "https://github.com/nodejs/readable-stream/issues" - }, - "homepage": "https://github.com/nodejs/readable-stream#readme", - "_id": "readable-stream@2.0.2", - "_shasum": "bec81beae8cf455168bc2e5b2b31f5bcfaed9b1b", - "_from": "readable-stream@>=2.0.2 <3.0.0", - "_npmVersion": "2.11.1", - "_nodeVersion": "2.3.0", - "_npmUser": { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - }, - "dist": { - "shasum": "bec81beae8cf455168bc2e5b2b31f5bcfaed9b1b", - "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.2.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - }, - { - "name": "rvagg", - "email": "rod@vagg.org" - }, - { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.2.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/passthrough.js b/deps/npm/node_modules/sha/node_modules/readable-stream/passthrough.js deleted file mode 100644 index 27e8d8a55165f9..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/passthrough.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_passthrough.js") diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/readable.js b/deps/npm/node_modules/sha/node_modules/readable-stream/readable.js deleted file mode 100644 index 6222a579864dd2..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/readable.js +++ /dev/null @@ -1,12 +0,0 @@ -var Stream = (function (){ - try { - return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify - } catch(_){} -}()); -exports = module.exports = require('./lib/_stream_readable.js'); -exports.Stream = Stream || exports; -exports.Readable = exports; -exports.Writable = require('./lib/_stream_writable.js'); -exports.Duplex = require('./lib/_stream_duplex.js'); -exports.Transform = require('./lib/_stream_transform.js'); -exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/transform.js b/deps/npm/node_modules/sha/node_modules/readable-stream/transform.js deleted file mode 100644 index 5d482f0780e993..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/transform.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_transform.js") diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/writable.js b/deps/npm/node_modules/sha/node_modules/readable-stream/writable.js deleted file mode 100644 index e1e9efdf3c12e9..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/writable.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_writable.js") diff --git a/deps/npm/node_modules/sha/package.json b/deps/npm/node_modules/sha/package.json index 95e55e138946a6..05903c8b9a8f23 100644 --- a/deps/npm/node_modules/sha/package.json +++ b/deps/npm/node_modules/sha/package.json @@ -24,7 +24,7 @@ "homepage": "https://github.com/ForbesLindesay/sha", "_id": "sha@2.0.1", "_shasum": "6030822fbd2c9823949f8f72ed6411ee5cf25aae", - "_from": "sha@2.0.1", + "_from": "sha@>=2.0.1 <2.1.0", "_npmVersion": "2.7.1", "_nodeVersion": "1.6.2", "_npmUser": { diff --git a/deps/npm/node_modules/slide/package.json b/deps/npm/node_modules/slide/package.json index 1c0b30bf2a96e8..8b6aa2b7080129 100644 --- a/deps/npm/node_modules/slide/package.json +++ b/deps/npm/node_modules/slide/package.json @@ -50,5 +50,6 @@ "tarball": "http://registry.npmjs.org/slide/-/slide-1.1.6.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz" + "_resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/sorted-object/LICENSE.txt b/deps/npm/node_modules/sorted-object/LICENSE.txt index a92a60b824eb52..4a323deb518f3a 100644 --- a/deps/npm/node_modules/sorted-object/LICENSE.txt +++ b/deps/npm/node_modules/sorted-object/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright © 2014 Domenic Denicola +Copyright © 2014–2016 Domenic Denicola This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, diff --git a/deps/npm/node_modules/sorted-object/lib/sorted-object.js b/deps/npm/node_modules/sorted-object/lib/sorted-object.js index 26ebd500a35710..1b3fe81a6be930 100644 --- a/deps/npm/node_modules/sorted-object/lib/sorted-object.js +++ b/deps/npm/node_modules/sorted-object/lib/sorted-object.js @@ -1,7 +1,7 @@ "use strict"; module.exports = function (input) { - var output = Object.create(null); + var output = {}; Object.keys(input).sort().forEach(function (key) { output[key] = input[key]; diff --git a/deps/npm/node_modules/sorted-object/package.json b/deps/npm/node_modules/sorted-object/package.json index 5bd814207aa352..60a8356bac177b 100644 --- a/deps/npm/node_modules/sorted-object/package.json +++ b/deps/npm/node_modules/sorted-object/package.json @@ -1,37 +1,89 @@ { - "name": "sorted-object", + "_args": [ + [ + "sorted-object@latest", + "/Users/rebecca/code/npm" + ] + ], + "_from": "sorted-object@latest", + "_id": "sorted-object@2.0.0", + "_inCache": true, + "_installable": true, + "_location": "/sorted-object", + "_nodeVersion": "5.7.1", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/sorted-object-2.0.0.tgz_1457910693572_0.6718082851730287" + }, + "_npmUser": { + "email": "d@domenic.me", + "name": "domenic" + }, + "_npmVersion": "3.6.0", + "_phantomChildren": {}, + "_requested": { + "name": "sorted-object", + "raw": "sorted-object@latest", + "rawSpec": "latest", + "scope": null, + "spec": "latest", + "type": "tag" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/sorted-object/-/sorted-object-2.0.0.tgz", + "_shasum": "1cfea981609047d8043807a490a9d99b317faf7f", + "_shrinkwrap": null, + "_spec": "sorted-object@latest", + "_where": "/Users/rebecca/code/npm", + "author": { + "email": "d@domenic.me", + "name": "Domenic Denicola", + "url": "https://domenic.me/" + }, + "bugs": { + "url": "https://github.com/domenic/sorted-object/issues" + }, + "dependencies": {}, "description": "Returns a copy of an object with its keys sorted", + "devDependencies": { + "eslint": "^2.4.0", + "tape": "^4.5.1" + }, + "directories": {}, + "dist": { + "shasum": "1cfea981609047d8043807a490a9d99b317faf7f", + "tarball": "http://registry.npmjs.org/sorted-object/-/sorted-object-2.0.0.tgz" + }, + "files": [ + "lib/" + ], + "gitHead": "3cbdde212c8ceef219fbb8fa7805bfc38b94aa90", + "homepage": "https://github.com/domenic/sorted-object#readme", "keywords": [ "sort", "keys", "object" ], - "version": "1.0.0", - "author": { - "name": "Domenic Denicola", - "email": "domenic@domenicdenicola.com", - "url": "http://domenic.me/" - }, "license": "WTFPL", + "main": "lib/sorted-object.js", + "maintainers": [ + { + "email": "domenic@domenicdenicola.com", + "name": "domenic" + } + ], + "name": "sorted-object", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", "repository": { "type": "git", - "url": "git://github.com/domenic/sorted-object.git" - }, - "bugs": { - "url": "http://github.com/domenic/sorted-object/issues" + "url": "git+https://github.com/domenic/sorted-object.git" }, - "main": "lib/sorted-object.js", "scripts": { - "test": "tape test/tests.js", - "lint": "jshint lib && jshint test" + "lint": "eslint .", + "test": "tape test/tests.js" }, - "devDependencies": { - "jshint": "~2.4.3", - "tape": "~2.4.2" - }, - "readme": "# Get a Version of an Object with Sorted Keys\n\nAlthough objects in JavaScript are theoretically unsorted, in practice most engines use insertion order—at least, ignoring numeric keys. This manifests itself most prominently when dealing with an object's JSON serialization.\n\nSo, for example, you might be trying to serialize some object to a JSON file. But every time you write it, it ends up being output in a different order, depending on how you created it in the first place! This makes for some ugly diffs.\n\n**sorted-object** gives you the answer. Just use this package to create a version of your object with its keys sorted before serializing, and you'll get a consistent order every time.\n\n```js\nvar sortedObject = require(\"sorted-object\");\n\nvar objectToSerialize = generateStuffNondeterministically();\n\n// Before:\nfs.writeFileSync(\"dest.json\", JSON.stringify(objectToSerialize));\n\n// After:\nvar sortedVersion = sortedObject(objectToSerialize);\nfs.writeFileSync(\"dest.json\", JSON.stringify(sortedVersion));\n```\n", - "readmeFilename": "README.md", - "homepage": "https://github.com/domenic/sorted-object", - "_id": "sorted-object@1.0.0", - "_from": "sorted-object@" + "version": "2.0.0" } diff --git a/deps/npm/node_modules/spdx/LICENSE.md b/deps/npm/node_modules/spdx/LICENSE.md deleted file mode 100644 index 2180a8c1a3676e..00000000000000 --- a/deps/npm/node_modules/spdx/LICENSE.md +++ /dev/null @@ -1,7 +0,0 @@ -Copyright Kyle E. Mitchell - -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 - -Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. diff --git a/deps/npm/node_modules/spdx/README.md b/deps/npm/node_modules/spdx/README.md deleted file mode 100644 index f373262474e8bb..00000000000000 --- a/deps/npm/node_modules/spdx/README.md +++ /dev/null @@ -1,145 +0,0 @@ -spdx.js -======= - -[![npm version](https://img.shields.io/npm/v/spdx.svg)](https://www.npmjs.com/package/spdx) -[![SPDX License Expression Syntax version](https://img.shields.io/badge/SPDX-2.0-blue.svg)](http://spdx.org/SPDX-specifications/spdx-version-2.0) -[![license](https://img.shields.io/badge/license-Apache--2.0-303284.svg)](http://www.apache.org/licenses/LICENSE-2.0) -[![build status](https://img.shields.io/travis/kemitchell/spdx.js.svg)](http://travis-ci.org/kemitchell/spdx.js) - -SPDX License Expression Syntax parser - - - -Simple License Expressions --------------------------- -```js -spdx.valid('Invalid-Identifier'); // => null -spdx.valid('GPL-2.0'); // => true -spdx.valid('GPL-2.0+'); // => true -spdx.valid('LicenseRef-23'); // => true -spdx.valid('LicenseRef-MIT-Style-1'); // => true -spdx.valid('DocumentRef-spdx-tool-1.2:LicenseRef-MIT-Style-2'); // => true -``` - -Composite License Expressions ------------------------------ - -### Disjunctive `OR` Operator -```js -spdx.valid('(LGPL-2.1 OR MIT)'); // => true -spdx.valid('(LGPL-2.1 OR MIT OR BSD-3-Clause)'); // => true -``` - -### Conjunctive `AND` Operator -```js -spdx.valid('(LGPL-2.1 AND MIT)'); // => true -spdx.valid('(LGPL-2.1 AND MIT AND BSD-2-Clause)'); // => true -``` - -### Exception `WITH` Operator -```js -spdx.valid('(GPL-2.0+ WITH Bison-exception-2.2)'); // => true -``` - -### Order of Precedence and Parentheses -```js -var firstAST = { - left: {license: 'LGPL-2.1'}, - conjunction: 'or', - right: { - left: {license: 'BSD-3-Clause'}, - conjunction: 'and', - right: {license: 'MIT'} - } -}; -spdx.parse('(LGPL-2.1 OR BSD-3-Clause AND MIT)'); // => firstAST - -var secondAST = { - left: {license: 'MIT'}, - conjunction: 'and', - right: { - left: {license: 'LGPL-2.1', plus: true}, - conjunction: 'and', - right: {license: 'BSD-3-Clause'} - } -}; -spdx.parse('(MIT AND (LGPL-2.1+ AND BSD-3-Clause))'); // => secondAST -``` - -Strict Whitespace Rules ------------------------ -```js -spdx.valid('MIT '); // => false -spdx.valid(' MIT'); // => false -spdx.valid('MIT AND BSD-3-Clause'); // => false -``` - -Identifier Lists ----------------- -```js -Array.isArray(spdx.licenses); // => true -spdx.licenses.indexOf('ISC') > -1; // => true -spdx.licenses.indexOf('Apache-1.7') > -1; // => false -spdx.licenses.every(function(element) { - return typeof element === 'string'; -}); // => true - -Array.isArray(spdx.exceptions); // => true -spdx.exceptions.indexOf('GCC-exception-3.1') > -1; // => true -spdx.exceptions.every(function(element) { - return typeof element === 'string'; -}); // => true -``` - -Comparison ----------- -```js -spdx.gt('GPL-3.0', 'GPL-2.0'); // => true -spdx.lt('MPL-1.0', 'MPL-2.0'); // => true - -spdx.gt('LPPL-1.3a', 'LPPL-1.0'); // => true -spdx.gt('LPPL-1.3c', 'LPPL-1.3a'); // => true -spdx.gt('MIT', 'ISC'); // => false -spdx.gt('OSL-1.0', 'OPL-1.0'); // => false -spdx.gt('AGPL-3.0', 'AGPL-1.0'); // => true - -try { - spdx.gt('(MIT OR ISC)', 'GPL-3.0'); -} catch (error) { - error.message; // => '"(MIT OR ISC)" is not a simple license identifier' -} - -spdx.satisfies('MIT', 'MIT'); // => true -spdx.satisfies('MIT', '(ISC OR MIT)'); // => true -spdx.satisfies('Zlib', '(ISC OR (MIT OR Zlib))'); // => true -spdx.satisfies('GPL-3.0', '(ISC OR MIT)'); // => false -spdx.satisfies('GPL-2.0', 'GPL-2.0+'); // => true -spdx.satisfies('GPL-3.0', 'GPL-2.0+'); // => true -spdx.satisfies('GPL-1.0', 'GPL-2.0+'); // => false - -spdx.satisfies('GPL-2.0', 'GPL-2.0+ WITH Bison-exception-2.2'); // => false -spdx.satisfies( - 'GPL-3.0 WITH Bison-exception-2.2', 'GPL-2.0+ WITH Bison-exception-2.2' -); // => true - -spdx.satisfies('(MIT OR GPL-2.0)', '(ISC OR MIT)'); // => true -spdx.satisfies('(MIT AND GPL-2.0)', '(MIT OR GPL-2.0)'); // => true -spdx.satisfies('(MIT AND GPL-2.0)', '(ISC OR GPL-2.0)'); // => false -``` - -Version Metadata ----------------- -```js -spdx.specificationVersion; // => '2.0' -spdx.implementationVersion; // => package.version -``` - -The Specification ------------------ -[The Software Package Data Exchange (SPDX) specification](http://spdx.org) is the work of the [Linux Foundation](http://www.linuxfoundation.org) and its contributors, and is licensed under the terms of [the Creative Commons Attribution License 3.0 Unported (SPDX: "CC-BY-3.0")](http://spdx.org/licenses/CC-BY-3.0). "SPDX" is a United States federally registered trademark of the Linux Foundation. diff --git a/deps/npm/node_modules/spdx/node_modules/spdx-license-ids/LICENSE b/deps/npm/node_modules/spdx/node_modules/spdx-license-ids/LICENSE deleted file mode 100644 index 68a49daad8ff7e..00000000000000 --- a/deps/npm/node_modules/spdx/node_modules/spdx-license-ids/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -This is free and unencumbered software released into the public domain. - -Anyone is free to copy, modify, publish, use, compile, sell, or -distribute this software, either in source code form or as a compiled -binary, for any purpose, commercial or non-commercial, and by any -means. - -In jurisdictions that recognize copyright laws, the author or authors -of this software dedicate any and all copyright interest in the -software to the public domain. We make this dedication for the benefit -of the public at large and to the detriment of our heirs and -successors. We intend this dedication to be an overt act of -relinquishment in perpetuity of all present and future rights to this -software under copyright law. - -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 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. - -For more information, please refer to diff --git a/deps/npm/node_modules/spdx/node_modules/spdx-license-ids/README.md b/deps/npm/node_modules/spdx/node_modules/spdx-license-ids/README.md deleted file mode 100755 index 7ea6092d6cb3df..00000000000000 --- a/deps/npm/node_modules/spdx/node_modules/spdx-license-ids/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# spdx-license-ids - -A list of [SPDX license](http://spdx.org/licenses/) identifiers - -[**Download JSON**](https://raw.githubusercontent.com/shinnn/spdx-license-ids/master/spdx-license-ids.json) - -## Use as a JavaScript Library - -[![NPM version](https://img.shields.io/npm/v/spdx-license-ids.svg)](https://www.npmjs.org/package/spdx-license-ids) -[![Bower version](https://img.shields.io/bower/v/spdx-license-ids.svg)](https://github.com/shinnn/spdx-license-ids/releases) -[![Build Status](https://travis-ci.org/shinnn/spdx-license-ids.svg?branch=master)](https://travis-ci.org/shinnn/spdx-license-ids) -[![Coverage Status](https://img.shields.io/coveralls/shinnn/spdx-license-ids.svg)](https://coveralls.io/r/shinnn/spdx-license-ids) -[![devDependency Status](https://david-dm.org/shinnn/spdx-license-ids/dev-status.svg)](https://david-dm.org/shinnn/spdx-license-ids#info=devDependencies) - -### Installation - -#### Package managers - -##### [npm](https://www.npmjs.com/) - -```sh -npm install spdx-license-ids -``` - -##### [bower](http://bower.io/) - -```sh -bower install spdx-license-ids -``` - -##### [Duo](http://duojs.org/) - -```javascript -var spdxLicenseIds = require('shinnn/spdx-license-ids'); -``` - -#### Standalone - -[Download the script file directly.](https://raw.githubusercontent.com/shinnn/spdx-license-ids/master/spdx-license-ids-browser.js) - -### API - -#### spdxLicenseIds - -Type: `Array` of `String` - -It returns an array of SPDX license identifiers. - -```javascript -var spdxLicenseIds = require('spdx-license-ids'); //=> ['Glide', 'Abstyles', 'AFL-1.1', ... ] -``` - -## License - -[The Unlicense](./LICENSE). diff --git a/deps/npm/node_modules/spdx/node_modules/spdx-license-ids/package.json b/deps/npm/node_modules/spdx/node_modules/spdx-license-ids/package.json deleted file mode 100644 index e6e341b111d03a..00000000000000 --- a/deps/npm/node_modules/spdx/node_modules/spdx-license-ids/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "name": "spdx-license-ids", - "version": "1.0.1", - "description": "A list of SPDX license identifiers", - "repository": { - "type": "git", - "url": "git+https://github.com/shinnn/spdx-license-ids.git" - }, - "author": { - "name": "Shinnosuke Watanabe", - "url": "https://github.com/shinnn" - }, - "scripts": { - "build": "node --harmony_arrow_functions build.js", - "lint": "eslint --config node_modules/@shinnn/eslintrc/rc.json --ignore-path .gitignore .", - "pretest": "${npm_package_scripts_build} && ${npm_package_scripts_lint}", - "test": "node --harmony_arrow_functions test.js", - "coverage": "node --harmony_arrow_functions node_modules/.bin/istanbul cover test.js", - "coveralls": "${npm_package_scripts_coverage} && istanbul-coveralls" - }, - "license": "Unlicense", - "main": "spdx-license-ids.json", - "files": [ - "spdx-license-ids.json" - ], - "keywords": [ - "spdx", - "license", - "licenses", - "id", - "identifier", - "identifiers", - "json", - "array", - "oss", - "browser", - "client-side" - ], - "devDependencies": { - "@shinnn/eslintrc": "^1.0.0", - "each-async": "^1.1.1", - "eslint": "^0.21.2", - "got": "^3.2.0", - "istanbul": "^0.3.14", - "istanbul-coveralls": "^1.0.2", - "require-bower-files": "^2.0.0", - "rm-rf": "^0.1.0", - "stringify-object": "^2.0.0", - "tape": "^4.0.0" - }, - "gitHead": "05c7466fcd62c8642006ef354c95064fcade3a03", - "bugs": { - "url": "https://github.com/shinnn/spdx-license-ids/issues" - }, - "homepage": "https://github.com/shinnn/spdx-license-ids#readme", - "_id": "spdx-license-ids@1.0.1", - "_shasum": "8f7d365fbeb056f82d21d0c0e9c1ebbd676e6af4", - "_from": "spdx-license-ids@>=1.0.0 <2.0.0", - "_npmVersion": "2.10.1", - "_nodeVersion": "2.0.2", - "_npmUser": { - "name": "shinnn", - "email": "snnskwtnb@gmail.com" - }, - "maintainers": [ - { - "name": "shinnn", - "email": "snnskwtnb@gmail.com" - } - ], - "dist": { - "shasum": "8f7d365fbeb056f82d21d0c0e9c1ebbd676e6af4", - "tarball": "http://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.0.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.0.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/spdx/node_modules/spdx-license-ids/spdx-license-ids.json b/deps/npm/node_modules/spdx/node_modules/spdx-license-ids/spdx-license-ids.json deleted file mode 100644 index 3c5bdfcd0fc2dd..00000000000000 --- a/deps/npm/node_modules/spdx/node_modules/spdx-license-ids/spdx-license-ids.json +++ /dev/null @@ -1,296 +0,0 @@ -[ - "Glide", - "Abstyles", - "AFL-1.1", - "AFL-1.2", - "AFL-2.0", - "AFL-2.1", - "AFL-3.0", - "AMPAS", - "APL-1.0", - "Adobe-Glyph", - "APAFML", - "Adobe-2006", - "AGPL-1.0", - "Afmparse", - "Aladdin", - "ADSL", - "AMDPLPA", - "ANTLR-PD", - "Apache-1.0", - "Apache-1.1", - "Apache-2.0", - "AML", - "APSL-1.0", - "APSL-1.1", - "APSL-1.2", - "APSL-2.0", - "Artistic-1.0", - "Artistic-1.0-Perl", - "Artistic-1.0-cl8", - "Artistic-2.0", - "AAL", - "Bahyph", - "Barr", - "Beerware", - "BitTorrent-1.0", - "BitTorrent-1.1", - "BSL-1.0", - "Borceux", - "BSD-2-Clause", - "BSD-2-Clause-FreeBSD", - "BSD-2-Clause-NetBSD", - "BSD-3-Clause", - "BSD-3-Clause-Clear", - "BSD-4-Clause", - "BSD-Protection", - "BSD-3-Clause-Attribution", - "BSD-4-Clause-UC", - "bzip2-1.0.5", - "bzip2-1.0.6", - "Caldera", - "CECILL-1.0", - "CECILL-1.1", - "CECILL-2.0", - "CECILL-B", - "CECILL-C", - "ClArtistic", - "MIT-CMU", - "CNRI-Python", - "CNRI-Python-GPL-Compatible", - "CPOL-1.02", - "CDDL-1.0", - "CDDL-1.1", - "CPAL-1.0", - "CPL-1.0", - "CATOSL-1.1", - "Condor-1.1", - "CC-BY-1.0", - "CC-BY-2.0", - "CC-BY-2.5", - "CC-BY-3.0", - "CC-BY-4.0", - "CC-BY-ND-1.0", - "CC-BY-ND-2.0", - "CC-BY-ND-2.5", - "CC-BY-ND-3.0", - "CC-BY-ND-4.0", - "CC-BY-NC-1.0", - "CC-BY-NC-2.0", - "CC-BY-NC-2.5", - "CC-BY-NC-3.0", - "CC-BY-NC-4.0", - "CC-BY-NC-ND-1.0", - "CC-BY-NC-ND-2.0", - "CC-BY-NC-ND-2.5", - "CC-BY-NC-ND-3.0", - "CC-BY-NC-ND-4.0", - "CC-BY-NC-SA-1.0", - "CC-BY-NC-SA-2.0", - "CC-BY-NC-SA-2.5", - "CC-BY-NC-SA-3.0", - "CC-BY-NC-SA-4.0", - "CC-BY-SA-1.0", - "CC-BY-SA-2.0", - "CC-BY-SA-2.5", - "CC-BY-SA-3.0", - "CC-BY-SA-4.0", - "CC0-1.0", - "Crossword", - "CUA-OPL-1.0", - "Cube", - "D-FSL-1.0", - "diffmark", - "WTFPL", - "DOC", - "Dotseqn", - "DSDP", - "dvipdfm", - "EPL-1.0", - "ECL-1.0", - "ECL-2.0", - "eGenix", - "EFL-1.0", - "EFL-2.0", - "MIT-advertising", - "MIT-enna", - "Entessa", - "ErlPL-1.1", - "EUDatagrid", - "EUPL-1.0", - "EUPL-1.1", - "Eurosym", - "Fair", - "MIT-feh", - "Frameworx-1.0", - "FreeImage", - "FTL", - "FSFUL", - "FSFULLR", - "Giftware", - "GL2PS", - "Glulxe", - "AGPL-3.0", - "GFDL-1.1", - "GFDL-1.2", - "GFDL-1.3", - "GPL-1.0", - "GPL-2.0", - "GPL-3.0", - "LGPL-2.1", - "LGPL-3.0", - "LGPL-2.0", - "gnuplot", - "gSOAP-1.3b", - "HaskellReport", - "HPND", - "IBM-pibs", - "IPL-1.0", - "ImageMagick", - "iMatix", - "Imlib2", - "IJG", - "Intel-ACPI", - "Intel", - "IPA", - "ISC", - "JasPer-2.0", - "JSON", - "LPPL-1.3a", - "LPPL-1.0", - "LPPL-1.1", - "LPPL-1.2", - "LPPL-1.3c", - "Latex2e", - "BSD-3-Clause-LBNL", - "Leptonica", - "Libpng", - "libtiff", - "LPL-1.02", - "LPL-1.0", - "MakeIndex", - "MTLL", - "MS-PL", - "MS-RL", - "MirOS", - "MITNFA", - "MIT", - "Motosoto", - "MPL-1.0", - "MPL-1.1", - "MPL-2.0", - "MPL-2.0-no-copyleft-exception", - "mpich2", - "Multics", - "Mup", - "NASA-1.3", - "Naumen", - "NBPL-1.0", - "NetCDF", - "NGPL", - "NOSL", - "NPL-1.0", - "NPL-1.1", - "Newsletr", - "NLPL", - "Nokia", - "NPOSL-3.0", - "Noweb", - "NRL", - "NTP", - "Nunit", - "OCLC-2.0", - "ODbL-1.0", - "PDDL-1.0", - "OGTSL", - "OLDAP-2.2.2", - "OLDAP-1.1", - "OLDAP-1.2", - "OLDAP-1.3", - "OLDAP-1.4", - "OLDAP-2.0", - "OLDAP-2.0.1", - "OLDAP-2.1", - "OLDAP-2.2", - "OLDAP-2.2.1", - "OLDAP-2.3", - "OLDAP-2.4", - "OLDAP-2.5", - "OLDAP-2.6", - "OLDAP-2.7", - "OLDAP-2.8", - "OML", - "OPL-1.0", - "OSL-1.0", - "OSL-1.1", - "OSL-2.0", - "OSL-2.1", - "OSL-3.0", - "OpenSSL", - "PHP-3.0", - "PHP-3.01", - "Plexus", - "PostgreSQL", - "psfrag", - "psutils", - "Python-2.0", - "QPL-1.0", - "Qhull", - "Rdisc", - "RPSL-1.0", - "RPL-1.1", - "RPL-1.5", - "RHeCos-1.1", - "RSCPL", - "Ruby", - "SAX-PD", - "Saxpath", - "SCEA", - "SWL", - "SGI-B-1.0", - "SGI-B-1.1", - "SGI-B-2.0", - "OFL-1.0", - "OFL-1.1", - "SimPL-2.0", - "Sleepycat", - "SNIA", - "SMLNJ", - "SugarCRM-1.1.3", - "SISSL", - "SISSL-1.2", - "SPL-1.0", - "Watcom-1.0", - "TCL", - "Unlicense", - "TMate", - "TORQUE-1.1", - "TOSL", - "Unicode-TOU", - "NCSA", - "Vim", - "VOSTROM", - "VSL-1.0", - "W3C", - "W3C-19980720", - "Wsuipa", - "Xnet", - "X11", - "Xerox", - "XFree86-1.1", - "xinetd", - "xpp", - "XSkat", - "YPL-1.0", - "YPL-1.1", - "Zed", - "Zend-2.0", - "Zimbra-1.3", - "Zimbra-1.4", - "Zlib", - "zlib-acknowledgement", - "ZPL-1.1", - "ZPL-2.0", - "ZPL-2.1", - "ICU" -] diff --git a/deps/npm/node_modules/spdx/package.json b/deps/npm/node_modules/spdx/package.json deleted file mode 100644 index d1601c60119e82..00000000000000 --- a/deps/npm/node_modules/spdx/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "spdx", - "description": "SPDX License Expression Syntax parser", - "version": "0.4.1", - "author": { - "name": "Kyle E. Mitchell", - "email": "kyle@kemitchell.com", - "url": "http://kemitchell.com" - }, - "bugs": { - "url": "https://github.com/kemitchell/spdx.js/issues" - }, - "dependencies": { - "spdx-license-ids": "^1.0.0" - }, - "devDependencies": { - "docco": "^0.7.0", - "fixpack": "^2.2.0", - "jison": "^0.4.15", - "jscs": "^1.12.0", - "jshint": "^2.7.0", - "jsmd": "^0.3.0" - }, - "homepage": "https://github.com/kemitchell/spdx.js", - "keywords": [ - "SPDX", - "law", - "legal", - "license", - "metadata", - "package", - "package.json", - "standards" - ], - "license": "Apache-2.0", - "main": "source/spdx.js", - "repository": { - "type": "git", - "url": "git+https://github.com/kemitchell/spdx.js.git" - }, - "scripts": { - "build": "node build/parser.js > source/parser.generated.js", - "doc": "docco --output documentation source/spdx.js", - "lint": "fixpack && jshint build source/spdx.js && jscs build source/spdx.js", - "precommit": "npm run lint && npm run test", - "prepublish": "npm run build", - "pretest": "npm run build", - "test": "jsmd README.md" - }, - "gitHead": "e98233f7ebfa27ceec7d9f9bd77d7eb003ca3210", - "_id": "spdx@0.4.1", - "_shasum": "eb43a2d83483e7073d24184b5ca0d00f33e184ff", - "_from": "spdx@>=0.4.0 <0.5.0", - "_npmVersion": "2.11.0", - "_nodeVersion": "2.2.1", - "_npmUser": { - "name": "kemitchell", - "email": "kyle@kemitchell.com" - }, - "maintainers": [ - { - "name": "kemitchell", - "email": "kyle@kemitchell.com" - } - ], - "dist": { - "shasum": "eb43a2d83483e7073d24184b5ca0d00f33e184ff", - "tarball": "http://registry.npmjs.org/spdx/-/spdx-0.4.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/spdx/-/spdx-0.4.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/spdx/source/exceptions.json b/deps/npm/node_modules/spdx/source/exceptions.json deleted file mode 100644 index d588a1af7e11f8..00000000000000 --- a/deps/npm/node_modules/spdx/source/exceptions.json +++ /dev/null @@ -1,11 +0,0 @@ -[ - "Autoconf-exception-2.0", - "Autoconf-exception-3.0", - "Bison-exception-2.2", - "Classpath-exception-2.0", - "eCos-exception-2.0", - "Font-exception-2.0", - "GCC-exception-2.0", - "GCC-exception-3.1", - "WxWindows-exception-3.1" -] diff --git a/deps/npm/node_modules/spdx/source/parser.generated.js b/deps/npm/node_modules/spdx/source/parser.generated.js deleted file mode 100644 index 380609339cd77a..00000000000000 --- a/deps/npm/node_modules/spdx/source/parser.generated.js +++ /dev/null @@ -1,1255 +0,0 @@ -/* parser generated by jison 0.4.15 */ -/* - Returns a Parser object of the following structure: - - Parser: { - yy: {} - } - - Parser.prototype: { - yy: {}, - trace: function(), - symbols_: {associative list: name ==> number}, - terminals_: {associative list: number ==> name}, - productions_: [...], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), - table: [...], - defaultActions: {...}, - parseError: function(str, hash), - parse: function(input), - - lexer: { - EOF: 1, - parseError: function(str, hash), - setInput: function(input), - input: function(), - unput: function(str), - more: function(), - less: function(n), - pastInput: function(), - upcomingInput: function(), - showPosition: function(), - test_match: function(regex_match_array, rule_index), - next: function(), - lex: function(), - begin: function(condition), - popState: function(), - _currentRules: function(), - topState: function(), - pushState: function(condition), - - options: { - ranges: boolean (optional: true ==> token location info will include a .range[] member) - flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) - backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) - }, - - performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), - rules: [...], - conditions: {associative list: name ==> set}, - } - } - - - token location info (@$, _$, etc.): { - first_line: n, - last_line: n, - first_column: n, - last_column: n, - range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) - } - - - the parseError function receives a 'hash' object with these members for lexer and parser errors: { - text: (matched text) - token: (the produced terminal token, if any) - line: (yylineno) - } - while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { - loc: (yylloc) - expected: (string describing the set of expected tokens) - recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) - } -*/ -var spdxparse = (function(){ -var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,5],$V1=[1,6],$V2=[1,7],$V3=[1,4],$V4=[1,9],$V5=[1,10],$V6=[5,14,15,17],$V7=[5,12,14,15,17]; -var parser = {trace: function trace() { }, -yy: {}, -symbols_: {"error":2,"start":3,"expression":4,"EOS":5,"simpleExpression":6,"LICENSE":7,"PLUS":8,"LICENSEREF":9,"DOCUMENTREF":10,"COLON":11,"WITH":12,"EXCEPTION":13,"AND":14,"OR":15,"OPEN":16,"CLOSE":17,"$accept":0,"$end":1}, -terminals_: {2:"error",5:"EOS",7:"LICENSE",8:"PLUS",9:"LICENSEREF",10:"DOCUMENTREF",11:"COLON",12:"WITH",13:"EXCEPTION",14:"AND",15:"OR",16:"OPEN",17:"CLOSE"}, -productions_: [0,[3,2],[6,1],[6,2],[6,1],[6,3],[4,1],[4,3],[4,3],[4,3],[4,3]], -performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { -/* this == yyval */ - -var $0 = $$.length - 1; -switch (yystate) { -case 1: -return this.$ = $$[$0-1]; -break; -case 2: case 4: case 5: -this.$ = { license: yytext }; -break; -case 3: -this.$ = { license: $$[$0-1], plus: true }; -break; -case 6: -this.$ = $$[$0]; -break; -case 7: -this.$ = { exception: $$[$0] }; -this.$.license = $$[$0-2].license; -if ($$[$0-2].hasOwnProperty('plus')) { - this.$.plus = $$[$0-2].plus; -} -break; -case 8: -this.$ = { conjunction: 'and', left: $$[$0-2], right: $$[$0] }; -break; -case 9: -this.$ = { conjunction: 'or', left: $$[$0-2], right: $$[$0] }; -break; -case 10: -this.$ = $$[$0-1] -break; -} -}, -table: [{3:1,4:2,6:3,7:$V0,9:$V1,10:$V2,16:$V3},{1:[3]},{5:[1,8],14:$V4,15:$V5},o($V6,[2,6],{12:[1,11]}),{4:12,6:3,7:$V0,9:$V1,10:$V2,16:$V3},o($V7,[2,2],{8:[1,13]}),o($V7,[2,4]),{11:[1,14]},{1:[2,1]},{4:15,6:3,7:$V0,9:$V1,10:$V2,16:$V3},{4:16,6:3,7:$V0,9:$V1,10:$V2,16:$V3},{13:[1,17]},{14:$V4,15:$V5,17:[1,18]},o($V7,[2,3]),{9:[1,19]},o($V6,[2,8]),o([5,15,17],[2,9],{14:$V4}),o($V6,[2,7]),o($V6,[2,10]),o($V7,[2,5])], -defaultActions: {8:[2,1]}, -parseError: function parseError(str, hash) { - if (hash.recoverable) { - this.trace(str); - } else { - throw new Error(str); - } -}, -parse: function parse(input) { - var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer; - sharedState.yy.parser = this; - if (typeof lexer.yylloc == 'undefined') { - lexer.yylloc = {}; - } - var yyloc = lexer.yylloc; - lstack.push(yyloc); - var ranges = lexer.options && lexer.options.ranges; - if (typeof sharedState.yy.parseError === 'function') { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; - } - function popStack(n) { - stack.length = stack.length - 2 * n; - vstack.length = vstack.length - n; - lstack.length = lstack.length - n; - } - _token_stack: - function lex() { - var token; - token = lexer.lex() || EOF; - if (typeof token !== 'number') { - token = self.symbols_[token] || token; - } - return token; - } - var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; - while (true) { - state = stack[stack.length - 1]; - if (this.defaultActions[state]) { - action = this.defaultActions[state]; - } else { - if (symbol === null || typeof symbol == 'undefined') { - symbol = lex(); - } - action = table[state] && table[state][symbol]; - } - if (typeof action === 'undefined' || !action.length || !action[0]) { - var errStr = ''; - expected = []; - for (p in table[state]) { - if (this.terminals_[p] && p > TERROR) { - expected.push('\'' + this.terminals_[p] + '\''); - } - } - if (lexer.showPosition) { - errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; - } else { - errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); - } - this.parseError(errStr, { - text: lexer.match, - token: this.terminals_[symbol] || symbol, - line: lexer.yylineno, - loc: yyloc, - expected: expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer.yytext); - lstack.push(lexer.yylloc); - stack.push(action[1]); - symbol = null; - if (!preErrorSymbol) { - yyleng = lexer.yyleng; - yytext = lexer.yytext; - yylineno = lexer.yylineno; - yyloc = lexer.yylloc; - if (recovering > 0) { - recovering--; - } - } else { - symbol = preErrorSymbol; - preErrorSymbol = null; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== 'undefined') { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; - } - } - return true; -}}; -/* generated by jison-lex 0.3.4 */ -var lexer = (function(){ -var lexer = ({ - -EOF:1, - -parseError:function parseError(str, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str, hash); - } else { - throw new Error(str); - } - }, - -// resets the lexer, sets new input -setInput:function (input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ''; - this.conditionStack = ['INITIAL']; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0,0]; - } - this.offset = 0; - return this; - }, - -// consumes and returns one char from the input -input:function () { - var ch = this._input[0]; - this.yytext += ch; - this.yyleng++; - this.offset++; - this.match += ch; - this.matched += ch; - var lines = ch.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) { - this.yylloc.range[1]++; - } - - this._input = this._input.slice(1); - return ch; - }, - -// unshifts one char (or a string) into the input -unput:function (ch) { - var len = ch.length; - var lines = ch.split(/(?:\r\n?|\n)/g); - - this._input = ch + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - //this.yyleng -= len; - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? - (lines.length === oldLines.length ? this.yylloc.first_column : 0) - + oldLines[oldLines.length - lines.length].length - lines[0].length : - this.yylloc.first_column - len - }; - - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - this.yyleng = this.yytext.length; - return this; - }, - -// When called from action, caches matched text and appends it on next action -more:function () { - this._more = true; - return this; - }, - -// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. -reject:function () { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - - } - return this; - }, - -// retain first n characters of the match -less:function (n) { - this.unput(this.match.slice(n)); - }, - -// displays already matched input, i.e. for error messages -pastInput:function () { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); - }, - -// displays upcoming input, i.e. for error messages -upcomingInput:function () { - var next = this.match; - if (next.length < 20) { - next += this._input.substr(0, 20-next.length); - } - return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); - }, - -// displays the character position where the lexing error occurred, i.e. for error messages -showPosition:function () { - var pre = this.pastInput(); - var c = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c + "^"; - }, - -// test the lexed token: return FALSE when not a match, otherwise return token -test_match:function (match, indexed_rule) { - var token, - lines, - backup; - - if (this.options.backtrack_lexer) { - // save context - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); - } - } - - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; - } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? - lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : - this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token) { - return token; - } else if (this._backtrack) { - // recover context - for (var k in backup) { - this[k] = backup[k]; - } - return false; // rule action called reject() implying the next rule should be tested instead. - } - return false; - }, - -// return next match in input -next:function () { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - - var token, - match, - tempMatch, - index; - if (!this._more) { - this.yytext = ''; - this.match = ''; - } - var rules = this._currentRules(); - for (var i = 0; i < rules.length; i++) { - tempMatch = this._input.match(this.rules[rules[i]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = i; - if (this.options.backtrack_lexer) { - token = this.test_match(tempMatch, rules[i]); - if (token !== false) { - return token; - } else if (this._backtrack) { - match = false; - continue; // rule action called reject() implying a rule MISmatch. - } else { - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - } else if (!this.options.flex) { - break; - } - } - } - if (match) { - token = this.test_match(match, rules[index]); - if (token !== false) { - return token; - } - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - }, - -// return next match that has a token -lex:function lex() { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); - } - }, - -// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) -begin:function begin(condition) { - this.conditionStack.push(condition); - }, - -// pop the previously active lexer condition state off the condition stack -popState:function popState() { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; - } - }, - -// produce the lexer rule set which is active for the currently active lexer condition state -_currentRules:function _currentRules() { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; - } - }, - -// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available -topState:function topState(n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; - } - }, - -// alias for begin(condition) -pushState:function pushState(condition) { - this.begin(condition); - }, - -// return the number of states currently on the stack -stateStackSize:function stateStackSize() { - return this.conditionStack.length; - }, -options: {}, -performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { -var YYSTATE=YY_START; -switch($avoiding_name_collisions) { -case 0:return 5; -break; -case 1:/* skip whitespace */ -break; -case 2:return 8; -break; -case 3:return 16; -break; -case 4:return 17; -break; -case 5:return 11; -break; -case 6:return 10; -break; -case 7:return 9; -break; -case 8:return 14; -break; -case 9:return 15; -break; -case 10:return 12; -break; -case 11:return 7; -break; -case 12:return 7; -break; -case 13:return 7; -break; -case 14:return 7; -break; -case 15:return 7; -break; -case 16:return 7; -break; -case 17:return 7; -break; -case 18:return 7; -break; -case 19:return 7; -break; -case 20:return 7; -break; -case 21:return 7; -break; -case 22:return 7; -break; -case 23:return 7; -break; -case 24:return 7; -break; -case 25:return 7; -break; -case 26:return 7; -break; -case 27:return 7; -break; -case 28:return 7; -break; -case 29:return 7; -break; -case 30:return 7; -break; -case 31:return 7; -break; -case 32:return 7; -break; -case 33:return 7; -break; -case 34:return 7; -break; -case 35:return 7; -break; -case 36:return 7; -break; -case 37:return 7; -break; -case 38:return 7; -break; -case 39:return 7; -break; -case 40:return 7; -break; -case 41:return 7; -break; -case 42:return 7; -break; -case 43:return 7; -break; -case 44:return 7; -break; -case 45:return 7; -break; -case 46:return 7; -break; -case 47:return 7; -break; -case 48:return 7; -break; -case 49:return 7; -break; -case 50:return 7; -break; -case 51:return 7; -break; -case 52:return 7; -break; -case 53:return 7; -break; -case 54:return 7; -break; -case 55:return 7; -break; -case 56:return 7; -break; -case 57:return 7; -break; -case 58:return 7; -break; -case 59:return 7; -break; -case 60:return 7; -break; -case 61:return 7; -break; -case 62:return 7; -break; -case 63:return 7; -break; -case 64:return 7; -break; -case 65:return 7; -break; -case 66:return 7; -break; -case 67:return 7; -break; -case 68:return 7; -break; -case 69:return 7; -break; -case 70:return 7; -break; -case 71:return 7; -break; -case 72:return 7; -break; -case 73:return 7; -break; -case 74:return 7; -break; -case 75:return 7; -break; -case 76:return 7; -break; -case 77:return 7; -break; -case 78:return 7; -break; -case 79:return 7; -break; -case 80:return 7; -break; -case 81:return 7; -break; -case 82:return 7; -break; -case 83:return 7; -break; -case 84:return 7; -break; -case 85:return 7; -break; -case 86:return 7; -break; -case 87:return 7; -break; -case 88:return 7; -break; -case 89:return 7; -break; -case 90:return 7; -break; -case 91:return 7; -break; -case 92:return 7; -break; -case 93:return 7; -break; -case 94:return 7; -break; -case 95:return 7; -break; -case 96:return 7; -break; -case 97:return 7; -break; -case 98:return 7; -break; -case 99:return 7; -break; -case 100:return 7; -break; -case 101:return 7; -break; -case 102:return 7; -break; -case 103:return 7; -break; -case 104:return 7; -break; -case 105:return 7; -break; -case 106:return 7; -break; -case 107:return 7; -break; -case 108:return 7; -break; -case 109:return 7; -break; -case 110:return 7; -break; -case 111:return 7; -break; -case 112:return 7; -break; -case 113:return 7; -break; -case 114:return 7; -break; -case 115:return 7; -break; -case 116:return 7; -break; -case 117:return 7; -break; -case 118:return 7; -break; -case 119:return 7; -break; -case 120:return 7; -break; -case 121:return 7; -break; -case 122:return 7; -break; -case 123:return 7; -break; -case 124:return 7; -break; -case 125:return 7; -break; -case 126:return 7; -break; -case 127:return 7; -break; -case 128:return 7; -break; -case 129:return 7; -break; -case 130:return 7; -break; -case 131:return 7; -break; -case 132:return 7; -break; -case 133:return 7; -break; -case 134:return 7; -break; -case 135:return 7; -break; -case 136:return 7; -break; -case 137:return 7; -break; -case 138:return 7; -break; -case 139:return 7; -break; -case 140:return 7; -break; -case 141:return 7; -break; -case 142:return 7; -break; -case 143:return 7; -break; -case 144:return 7; -break; -case 145:return 7; -break; -case 146:return 7; -break; -case 147:return 7; -break; -case 148:return 7; -break; -case 149:return 7; -break; -case 150:return 7; -break; -case 151:return 7; -break; -case 152:return 7; -break; -case 153:return 7; -break; -case 154:return 7; -break; -case 155:return 7; -break; -case 156:return 7; -break; -case 157:return 7; -break; -case 158:return 7; -break; -case 159:return 7; -break; -case 160:return 7; -break; -case 161:return 7; -break; -case 162:return 7; -break; -case 163:return 7; -break; -case 164:return 7; -break; -case 165:return 7; -break; -case 166:return 7; -break; -case 167:return 7; -break; -case 168:return 7; -break; -case 169:return 7; -break; -case 170:return 7; -break; -case 171:return 7; -break; -case 172:return 7; -break; -case 173:return 7; -break; -case 174:return 7; -break; -case 175:return 7; -break; -case 176:return 7; -break; -case 177:return 7; -break; -case 178:return 7; -break; -case 179:return 7; -break; -case 180:return 7; -break; -case 181:return 7; -break; -case 182:return 7; -break; -case 183:return 7; -break; -case 184:return 7; -break; -case 185:return 7; -break; -case 186:return 7; -break; -case 187:return 7; -break; -case 188:return 7; -break; -case 189:return 7; -break; -case 190:return 7; -break; -case 191:return 7; -break; -case 192:return 7; -break; -case 193:return 7; -break; -case 194:return 7; -break; -case 195:return 7; -break; -case 196:return 7; -break; -case 197:return 7; -break; -case 198:return 7; -break; -case 199:return 7; -break; -case 200:return 7; -break; -case 201:return 7; -break; -case 202:return 7; -break; -case 203:return 7; -break; -case 204:return 7; -break; -case 205:return 7; -break; -case 206:return 7; -break; -case 207:return 7; -break; -case 208:return 7; -break; -case 209:return 7; -break; -case 210:return 7; -break; -case 211:return 7; -break; -case 212:return 7; -break; -case 213:return 7; -break; -case 214:return 7; -break; -case 215:return 7; -break; -case 216:return 7; -break; -case 217:return 7; -break; -case 218:return 7; -break; -case 219:return 7; -break; -case 220:return 7; -break; -case 221:return 7; -break; -case 222:return 7; -break; -case 223:return 7; -break; -case 224:return 7; -break; -case 225:return 7; -break; -case 226:return 7; -break; -case 227:return 7; -break; -case 228:return 7; -break; -case 229:return 7; -break; -case 230:return 7; -break; -case 231:return 7; -break; -case 232:return 7; -break; -case 233:return 7; -break; -case 234:return 7; -break; -case 235:return 7; -break; -case 236:return 7; -break; -case 237:return 7; -break; -case 238:return 7; -break; -case 239:return 7; -break; -case 240:return 7; -break; -case 241:return 7; -break; -case 242:return 7; -break; -case 243:return 7; -break; -case 244:return 7; -break; -case 245:return 7; -break; -case 246:return 7; -break; -case 247:return 7; -break; -case 248:return 7; -break; -case 249:return 7; -break; -case 250:return 7; -break; -case 251:return 7; -break; -case 252:return 7; -break; -case 253:return 7; -break; -case 254:return 7; -break; -case 255:return 7; -break; -case 256:return 7; -break; -case 257:return 7; -break; -case 258:return 7; -break; -case 259:return 7; -break; -case 260:return 7; -break; -case 261:return 7; -break; -case 262:return 7; -break; -case 263:return 7; -break; -case 264:return 7; -break; -case 265:return 7; -break; -case 266:return 7; -break; -case 267:return 7; -break; -case 268:return 7; -break; -case 269:return 7; -break; -case 270:return 7; -break; -case 271:return 7; -break; -case 272:return 7; -break; -case 273:return 7; -break; -case 274:return 7; -break; -case 275:return 7; -break; -case 276:return 7; -break; -case 277:return 7; -break; -case 278:return 7; -break; -case 279:return 7; -break; -case 280:return 7; -break; -case 281:return 7; -break; -case 282:return 7; -break; -case 283:return 7; -break; -case 284:return 7; -break; -case 285:return 7; -break; -case 286:return 7; -break; -case 287:return 7; -break; -case 288:return 7; -break; -case 289:return 7; -break; -case 290:return 7; -break; -case 291:return 7; -break; -case 292:return 7; -break; -case 293:return 7; -break; -case 294:return 7; -break; -case 295:return 7; -break; -case 296:return 7; -break; -case 297:return 7; -break; -case 298:return 7; -break; -case 299:return 7; -break; -case 300:return 7; -break; -case 301:return 7; -break; -case 302:return 7; -break; -case 303:return 7; -break; -case 304:return 7; -break; -case 305:return 7; -break; -case 306:return 7; -break; -case 307:return 7; -break; -case 308:return 13; -break; -case 309:return 13; -break; -case 310:return 13; -break; -case 311:return 13; -break; -case 312:return 13; -break; -case 313:return 13; -break; -case 314:return 13; -break; -case 315:return 13; -break; -case 316:return 13; -break; -} -}, -rules: [/^(?:$)/,/^(?:\s+)/,/^(?:\+)/,/^(?:\()/,/^(?:\))/,/^(?::)/,/^(?:DocumentRef-([0-9A-Za-z-+.]+))/,/^(?:LicenseRef-([0-9A-Za-z-+.]+))/,/^(?:AND)/,/^(?:OR)/,/^(?:WITH)/,/^(?:Glide)/,/^(?:Abstyles)/,/^(?:AFL-1.1)/,/^(?:AFL-1.2)/,/^(?:AFL-2.0)/,/^(?:AFL-2.1)/,/^(?:AFL-3.0)/,/^(?:AMPAS)/,/^(?:APL-1.0)/,/^(?:Adobe-Glyph)/,/^(?:APAFML)/,/^(?:Adobe-2006)/,/^(?:AGPL-1.0)/,/^(?:Afmparse)/,/^(?:Aladdin)/,/^(?:ADSL)/,/^(?:AMDPLPA)/,/^(?:ANTLR-PD)/,/^(?:Apache-1.0)/,/^(?:Apache-1.1)/,/^(?:Apache-2.0)/,/^(?:AML)/,/^(?:APSL-1.0)/,/^(?:APSL-1.1)/,/^(?:APSL-1.2)/,/^(?:APSL-2.0)/,/^(?:Artistic-1.0)/,/^(?:Artistic-1.0-Perl)/,/^(?:Artistic-1.0-cl8)/,/^(?:Artistic-2.0)/,/^(?:AAL)/,/^(?:Bahyph)/,/^(?:Barr)/,/^(?:Beerware)/,/^(?:BitTorrent-1.0)/,/^(?:BitTorrent-1.1)/,/^(?:BSL-1.0)/,/^(?:Borceux)/,/^(?:BSD-2-Clause)/,/^(?:BSD-2-Clause-FreeBSD)/,/^(?:BSD-2-Clause-NetBSD)/,/^(?:BSD-3-Clause)/,/^(?:BSD-3-Clause-Clear)/,/^(?:BSD-4-Clause)/,/^(?:BSD-Protection)/,/^(?:BSD-3-Clause-Attribution)/,/^(?:BSD-4-Clause-UC)/,/^(?:bzip2-1.0.5)/,/^(?:bzip2-1.0.6)/,/^(?:Caldera)/,/^(?:CECILL-1.0)/,/^(?:CECILL-1.1)/,/^(?:CECILL-2.0)/,/^(?:CECILL-B)/,/^(?:CECILL-C)/,/^(?:ClArtistic)/,/^(?:MIT-CMU)/,/^(?:CNRI-Jython)/,/^(?:CNRI-Python)/,/^(?:CNRI-Python-GPL-Compatible)/,/^(?:CPOL-1.02)/,/^(?:CDDL-1.0)/,/^(?:CDDL-1.1)/,/^(?:CPAL-1.0)/,/^(?:CPL-1.0)/,/^(?:CATOSL-1.1)/,/^(?:Condor-1.1)/,/^(?:CC-BY-1.0)/,/^(?:CC-BY-2.0)/,/^(?:CC-BY-2.5)/,/^(?:CC-BY-3.0)/,/^(?:CC-BY-4.0)/,/^(?:CC-BY-ND-1.0)/,/^(?:CC-BY-ND-2.0)/,/^(?:CC-BY-ND-2.5)/,/^(?:CC-BY-ND-3.0)/,/^(?:CC-BY-ND-4.0)/,/^(?:CC-BY-NC-1.0)/,/^(?:CC-BY-NC-2.0)/,/^(?:CC-BY-NC-2.5)/,/^(?:CC-BY-NC-3.0)/,/^(?:CC-BY-NC-4.0)/,/^(?:CC-BY-NC-ND-1.0)/,/^(?:CC-BY-NC-ND-2.0)/,/^(?:CC-BY-NC-ND-2.5)/,/^(?:CC-BY-NC-ND-3.0)/,/^(?:CC-BY-NC-ND-4.0)/,/^(?:CC-BY-NC-SA-1.0)/,/^(?:CC-BY-NC-SA-2.0)/,/^(?:CC-BY-NC-SA-2.5)/,/^(?:CC-BY-NC-SA-3.0)/,/^(?:CC-BY-NC-SA-4.0)/,/^(?:CC-BY-SA-1.0)/,/^(?:CC-BY-SA-2.0)/,/^(?:CC-BY-SA-2.5)/,/^(?:CC-BY-SA-3.0)/,/^(?:CC-BY-SA-4.0)/,/^(?:CC0-1.0)/,/^(?:Crossword)/,/^(?:CUA-OPL-1.0)/,/^(?:Cube)/,/^(?:D-FSL-1.0)/,/^(?:diffmark)/,/^(?:WTFPL)/,/^(?:DOC)/,/^(?:Dotseqn)/,/^(?:DSDP)/,/^(?:dvipdfm)/,/^(?:EPL-1.0)/,/^(?:ECL-1.0)/,/^(?:ECL-2.0)/,/^(?:eGenix)/,/^(?:EFL-1.0)/,/^(?:EFL-2.0)/,/^(?:MIT-advertising)/,/^(?:MIT-enna)/,/^(?:Entessa)/,/^(?:ErlPL-1.1)/,/^(?:EUDatagrid)/,/^(?:EUPL-1.0)/,/^(?:EUPL-1.1)/,/^(?:Eurosym)/,/^(?:Fair)/,/^(?:MIT-feh)/,/^(?:Frameworx-1.0)/,/^(?:FreeImage)/,/^(?:FTL)/,/^(?:FSFUL)/,/^(?:FSFULLR)/,/^(?:Giftware)/,/^(?:GL2PS)/,/^(?:Glulxe)/,/^(?:AGPL-3.0)/,/^(?:GFDL-1.1)/,/^(?:GFDL-1.2)/,/^(?:GFDL-1.3)/,/^(?:GPL-1.0)/,/^(?:GPL-2.0)/,/^(?:GPL-3.0)/,/^(?:LGPL-2.1)/,/^(?:LGPL-3.0)/,/^(?:LGPL-2.0)/,/^(?:gnuplot)/,/^(?:gSOAP-1.3b)/,/^(?:HaskellReport)/,/^(?:HPND)/,/^(?:IBM-pibs)/,/^(?:IPL-1.0)/,/^(?:ICU)/,/^(?:ImageMagick)/,/^(?:iMatix)/,/^(?:Imlib2)/,/^(?:IJG)/,/^(?:Intel-ACPI)/,/^(?:Intel)/,/^(?:IPA)/,/^(?:ISC)/,/^(?:JasPer-2.0)/,/^(?:JSON)/,/^(?:LPPL-1.3a)/,/^(?:LPPL-1.0)/,/^(?:LPPL-1.1)/,/^(?:LPPL-1.2)/,/^(?:LPPL-1.3c)/,/^(?:Latex2e)/,/^(?:BSD-3-Clause-LBNL)/,/^(?:Leptonica)/,/^(?:Libpng)/,/^(?:libtiff)/,/^(?:LPL-1.02)/,/^(?:LPL-1.0)/,/^(?:MakeIndex)/,/^(?:MTLL)/,/^(?:MS-PL)/,/^(?:MS-RL)/,/^(?:MirOS)/,/^(?:MITNFA)/,/^(?:MIT)/,/^(?:Motosoto)/,/^(?:MPL-1.0)/,/^(?:MPL-1.1)/,/^(?:MPL-2.0)/,/^(?:MPL-2.0-no-copyleft-exception)/,/^(?:mpich2)/,/^(?:Multics)/,/^(?:Mup)/,/^(?:NASA-1.3)/,/^(?:Naumen)/,/^(?:NBPL-1.0)/,/^(?:NetCDF)/,/^(?:NGPL)/,/^(?:NOSL)/,/^(?:NPL-1.0)/,/^(?:NPL-1.1)/,/^(?:Newsletr)/,/^(?:NLPL)/,/^(?:Nokia)/,/^(?:NPOSL-3.0)/,/^(?:Noweb)/,/^(?:NRL)/,/^(?:NTP)/,/^(?:Nunit)/,/^(?:OCLC-2.0)/,/^(?:ODbL-1.0)/,/^(?:PDDL-1.0)/,/^(?:OGTSL)/,/^(?:OLDAP-2.2.2)/,/^(?:OLDAP-1.1)/,/^(?:OLDAP-1.2)/,/^(?:OLDAP-1.3)/,/^(?:OLDAP-1.4)/,/^(?:OLDAP-2.0)/,/^(?:OLDAP-2.0.1)/,/^(?:OLDAP-2.1)/,/^(?:OLDAP-2.2)/,/^(?:OLDAP-2.2.1)/,/^(?:OLDAP-2.3)/,/^(?:OLDAP-2.4)/,/^(?:OLDAP-2.5)/,/^(?:OLDAP-2.6)/,/^(?:OLDAP-2.7)/,/^(?:OLDAP-2.8)/,/^(?:OML)/,/^(?:OPL-1.0)/,/^(?:OSL-1.0)/,/^(?:OSL-1.1)/,/^(?:OSL-2.0)/,/^(?:OSL-2.1)/,/^(?:OSL-3.0)/,/^(?:OpenSSL)/,/^(?:PHP-3.0)/,/^(?:PHP-3.01)/,/^(?:Plexus)/,/^(?:PostgreSQL)/,/^(?:psfrag)/,/^(?:psutils)/,/^(?:Python-2.0)/,/^(?:QPL-1.0)/,/^(?:Qhull)/,/^(?:Rdisc)/,/^(?:RPSL-1.0)/,/^(?:RPL-1.1)/,/^(?:RPL-1.5)/,/^(?:RHeCos-1.1)/,/^(?:RSCPL)/,/^(?:RSA-MD)/,/^(?:Ruby)/,/^(?:SAX-PD)/,/^(?:Saxpath)/,/^(?:SCEA)/,/^(?:SWL)/,/^(?:SGI-B-1.0)/,/^(?:SGI-B-1.1)/,/^(?:SGI-B-2.0)/,/^(?:OFL-1.0)/,/^(?:OFL-1.1)/,/^(?:SimPL-2.0)/,/^(?:Sleepycat)/,/^(?:SNIA)/,/^(?:SMLNJ)/,/^(?:SugarCRM-1.1.3)/,/^(?:SISSL)/,/^(?:SISSL-1.2)/,/^(?:SPL-1.0)/,/^(?:Watcom-1.0)/,/^(?:TCL)/,/^(?:Unlicense)/,/^(?:TMate)/,/^(?:TORQUE-1.1)/,/^(?:TOSL)/,/^(?:Unicode-TOU)/,/^(?:UPL-1.0)/,/^(?:NCSA)/,/^(?:Vim)/,/^(?:VOSTROM)/,/^(?:VSL-1.0)/,/^(?:W3C-19980720)/,/^(?:W3C)/,/^(?:Wsuipa)/,/^(?:Xnet)/,/^(?:X11)/,/^(?:Xerox)/,/^(?:XFree86-1.1)/,/^(?:xinetd)/,/^(?:xpp)/,/^(?:XSkat)/,/^(?:YPL-1.0)/,/^(?:YPL-1.1)/,/^(?:Zed)/,/^(?:Zend-2.0)/,/^(?:Zimbra-1.3)/,/^(?:Zimbra-1.4)/,/^(?:Zlib)/,/^(?:zlib-acknowledgement)/,/^(?:ZPL-1.1)/,/^(?:ZPL-2.0)/,/^(?:ZPL-2.1)/,/^(?:Autoconf-exception-2.0)/,/^(?:Autoconf-exception-3.0)/,/^(?:Bison-exception-2.2)/,/^(?:Classpath-exception-2.0)/,/^(?:eCos-exception-2.0)/,/^(?:Font-exception-2.0)/,/^(?:GCC-exception-2.0)/,/^(?:GCC-exception-3.1)/,/^(?:WxWindows-exception-3.1)/], -conditions: {"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316],"inclusive":true}} -}); -return lexer; -})(); -parser.lexer = lexer; -function Parser () { - this.yy = {}; -} -Parser.prototype = parser;parser.Parser = Parser; -return new Parser; -})(); - - -if (typeof require !== 'undefined' && typeof exports !== 'undefined') { -exports.parser = spdxparse; -exports.Parser = spdxparse.Parser; -exports.parse = function () { return spdxparse.parse.apply(spdxparse, arguments); }; -exports.main = function commonjsMain(args) { - if (!args[1]) { - console.log('Usage: '+args[0]+' FILE'); - process.exit(1); - } - var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8"); - return exports.parser.parse(source); -}; -if (typeof module !== 'undefined' && require.main === module) { - exports.main(process.argv.slice(1)); -} -} diff --git a/deps/npm/node_modules/spdx/source/ranges.json b/deps/npm/node_modules/spdx/source/ranges.json deleted file mode 100644 index 1f3c52b3e194dd..00000000000000 --- a/deps/npm/node_modules/spdx/source/ranges.json +++ /dev/null @@ -1,194 +0,0 @@ -[ - [ - "AFL-1.1", - "AFL-1.2", - "AFL-2.0", - "AFL-2.1", - "AFL-3.0" - ], - [ - "AGPL-1.0", - "AGPL-3.0" - ], - [ - "Apache-1.0", - "Apache-1.1", - "Apache-2.0" - ], - [ - "APSL-1.0", - "APSL-1.1", - "APSL-1.2", - "APSL-2.0" - ], - [ - "Artistic-1.0", - "Artistic-2.0" - ], - [ - "BitTorrent-1.0", - "BitTorrent-1.1" - ], - [ - "CC-BY-1.0", - "CC-BY-2.0", - "CC-BY-2.5", - "CC-BY-3.0", - "CC-BY-4.0" - ], - [ - "CC-BY-NC-1.0", - "CC-BY-NC-2.0", - "CC-BY-NC-2.5", - "CC-BY-NC-3.0", - "CC-BY-NC-4.0" - ], - [ - "CC-BY-NC-ND-1.0", - "CC-BY-NC-ND-2.0", - "CC-BY-NC-ND-2.5", - "CC-BY-NC-ND-3.0", - "CC-BY-NC-ND-4.0" - ], - [ - "CC-BY-NC-SA-1.0", - "CC-BY-NC-SA-2.0", - "CC-BY-NC-SA-2.5", - "CC-BY-NC-SA-3.0", - "CC-BY-NC-SA-4.0" - ], - [ - "CC-BY-ND-1.0", - "CC-BY-ND-2.0", - "CC-BY-ND-2.5", - "CC-BY-ND-3.0", - "CC-BY-ND-4.0" - ], - [ - "CC-BY-SA-1.0", - "CC-BY-SA-2.0", - "CC-BY-SA-2.5", - "CC-BY-SA-3.0", - "CC-BY-SA-4.0" - ], - [ - "CDDL-1.0", - "CDDL-1.1" - ], - [ - "CECILL-1.0", - "CECILL-1.1", - "CECILL-2.0" - ], - [ - "ECL-1.0", - "ECL-2.0" - ], - [ - "EFL-1.0", - "EFL-2.0" - ], - [ - "EUPL-1.0", - "EUPL-1.1" - ], - [ - "GFDL-1.1", - "GFDL-1.2", - "GFDL-1.3" - ], - [ - "GPL-1.0", - "GPL-2.0", - "GPL-3.0" - ], - [ - "LGPL-2.0", - "LGPL-2.1", - "LGPL-3.0" - ], - [ - "LPL-1.0", - "LPL-1.02" - ], - [ - "LPPL-1.0", - "LPPL-1.1", - "LPPL-1.2", - "LPPL-1.3a", - "LPPL-1.3c" - ], - [ - "MPL-1.0", - "MPL-1.1", - "MPL-2.0" - ], - [ - "MPL-1.0", - "MPL-1.1", - "MPL-2.0-no-copyleft-exception" - ], - [ - "NPL-1.0", - "NPL-1.1" - ], - [ - "OFL-1.0", - "OFL-1.1" - ], - [ - "OLDAP-1.1", - "OLDAP-1.2", - "OLDAP-1.3", - "OLDAP-1.4", - "OLDAP-2.0", - "OLDAP-2.0.1", - "OLDAP-2.1", - "OLDAP-2.2", - "OLDAP-2.2.1", - "OLDAP-2.2.2", - "OLDAP-2.3", - "OLDAP-2.4", - "OLDAP-2.5", - "OLDAP-2.6", - "OLDAP-2.7", - "OLDAP-2.8" - ], - [ - "OSL-1.0", - "OSL-1.1", - "OSL-2.0", - "OSL-2.1", - "OSL-3.0" - ], - [ - "PHP-3.0", - "PHP-3.01" - ], - [ - "RPL-1.1", - "RPL-1.5" - ], - [ - "SGI-B-1.0", - "SGI-B-1.1", - "SGI-B-2.0" - ], - [ - "YPL-1.0", - "YPL-1.1" - ], - [ - "ZPL-1.1", - "ZPL-2.0", - "ZPL-2.1" - ], - [ - "Zimbra-1.3", - "Zimbra-1.4" - ], - [ - "bzip2-1.0.5", - "bzip2-1.0.6" - ] -] diff --git a/deps/npm/node_modules/spdx/source/spdx.js b/deps/npm/node_modules/spdx/source/spdx.js deleted file mode 100644 index 5aece3d5437511..00000000000000 --- a/deps/npm/node_modules/spdx/source/spdx.js +++ /dev/null @@ -1,161 +0,0 @@ -// spdx.js -// ======= -// SPDX License Expression Syntax parser - -// Validation -// ---------- - -// Require the generated parser. -var parser = require('./parser.generated.js').parser; - -exports.parse = function(argument) { - return parser.parse(argument); -}; - -var containsRepeatedSpace = /\s{2,}/; - -exports.valid = function(argument) { - if ( - argument.trim() !== argument || - containsRepeatedSpace.test(argument) - ) { - return false; - } - try { - parser.parse(argument); - return true; - } catch (e) { - // jison generates parsers that throw errors, while this function - // mimics `semver.valid` by returning null. - return null; - } -}; - -// Comparison -// ---------- - -var ranges = require('./ranges.json'); - -var notALicenseIdentifier = ' is not a simple license identifier'; - -var rangeComparison = function(comparison) { - return function(first, second) { - var firstAST = exports.parse(first); - if (!firstAST.hasOwnProperty('license')) { - throw new Error('"' + first + '"' + notALicenseIdentifier); - } - var secondAST = exports.parse(second); - if (!secondAST.hasOwnProperty('license')) { - throw new Error('"' + second + '"' + notALicenseIdentifier); - } - return ranges.some(function(range) { - var indexOfFirst = range.indexOf(firstAST.license); - if (indexOfFirst < 0) { - return false; - } - var indexOfSecond = range.indexOf(secondAST.license); - if (indexOfSecond < 0) { - return false; - } - return comparison(indexOfFirst, indexOfSecond); - }); - }; -}; - -exports.gt = rangeComparison(function(first, second) { - return first > second; -}); - -exports.lt = rangeComparison(function(first, second) { - return first < second; -}); - -exports.satisfies = (function() { - var rangesAreCompatible = function(first, second) { - return ( - first.license === second.license || - ranges.some(function(range) { - return ( - range.indexOf(first.license) > -1 && - range.indexOf(second.license) - ); - }) - ); - }; - - var identifierInRange = function(identifier, range) { - return ( - identifier.license === range.license || - exports.gt(identifier.license, range.license) - ); - }; - - var licensesAreCompatible = function(first, second) { - if (first.exception !== second.exception) { - return false; - } else if (second.hasOwnProperty('license')) { - if (second.hasOwnProperty('plus')) { - if (first.hasOwnProperty('plus')) { - // first+, second+ - return rangesAreCompatible(first, second); - } else { - // first, second+ - return identifierInRange(first, second); - } - } else { - if (first.hasOwnProperty('plus')) { - // first+, second - return identifierInRange(second, first); - } else { - // first, second - return first.license === second.license; - } - } - } - }; - - var recurseLeftAndRight = function(first, second) { - var firstConjunction = first.conjunction; - if (firstConjunction === 'and') { - return ( - recurse(first.left, second) && - recurse(first.right, second) - ); - } else if (firstConjunction === 'or') { - return ( - recurse(first.left, second) || - recurse(first.right, second) - ); - } - }; - - var recurse = function(first, second) { - if (first.hasOwnProperty('conjunction')) { - return recurseLeftAndRight(first, second); - } else if (second.hasOwnProperty('conjunction')) { - return recurseLeftAndRight(second, first); - } else { - return licensesAreCompatible(first, second); - } - }; - - return function(first, second) { - return recurse(parser.parse(first), parser.parse(second)); - }; -})(); - -// Reference Data -// -------------- - -// Require the same license and exception data used by the parser. -exports.licenses = require('spdx-license-ids'); -exports.exceptions = require('./exceptions.json'); - -// Version Metadata -// ---------------- - -// The License Expression Syntax version -exports.specificationVersion = '2.0'; - -// This module's semantic version -exports.implementationVersion = '0.4.1'; diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/index.js b/deps/npm/node_modules/strip-ansi/index.js similarity index 100% rename from deps/npm/node_modules/columnify/node_modules/strip-ansi/index.js rename to deps/npm/node_modules/strip-ansi/index.js diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/license b/deps/npm/node_modules/strip-ansi/license similarity index 100% rename from deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/license rename to deps/npm/node_modules/strip-ansi/license diff --git a/deps/npm/node_modules/strip-ansi/package.json b/deps/npm/node_modules/strip-ansi/package.json new file mode 100644 index 00000000000000..9f7df7bf9abfab --- /dev/null +++ b/deps/npm/node_modules/strip-ansi/package.json @@ -0,0 +1,125 @@ +{ + "_args": [ + [ + "strip-ansi@*", + "/Users/rebecca/code/npm" + ] + ], + "_from": "strip-ansi@*", + "_id": "strip-ansi@3.0.1", + "_inCache": true, + "_installable": true, + "_location": "/strip-ansi", + "_nodeVersion": "0.12.7", + "_npmOperationalInternal": { + "host": "packages-9-west.internal.npmjs.com", + "tmp": "tmp/strip-ansi-3.0.1.tgz_1456057278183_0.28958667791448534" + }, + "_npmUser": { + "email": "jappelman@xebia.com", + "name": "jbnicolai" + }, + "_npmVersion": "2.11.3", + "_phantomChildren": {}, + "_requested": { + "name": "strip-ansi", + "raw": "strip-ansi@*", + "rawSpec": "*", + "scope": null, + "spec": "*", + "type": "range" + }, + "_requiredBy": [ + "/", + "/columnify", + "/request/har-validator/chalk", + "/standard/standard-engine/eslint/chalk", + "/standard/standard-engine/eslint/inquirer", + "/standard/standard-engine/eslint/inquirer/string-width", + "/standard/standard-format/esformatter-jsx/babel-core/chalk", + "/tap/coveralls/request/har-validator/chalk", + "/tap/nyc/yargs/cliui", + "/tap/nyc/yargs/string-width", + "/tap/tap-mocha-reporter/unicode-length/chalk" + ], + "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "_shasum": "6a385fb8853d952d5ff05d0e8aaf94278dc63dcf", + "_shrinkwrap": null, + "_spec": "strip-ansi@*", + "_where": "/Users/rebecca/code/npm", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/strip-ansi/issues" + }, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "description": "Strip ANSI escape codes", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "6a385fb8853d952d5ff05d0e8aaf94278dc63dcf", + "tarball": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "8270705c704956da865623e564eba4875c3ea17f", + "homepage": "https://github.com/chalk/strip-ansi", + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "maintainers": [ + { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + { + "email": "jappelman@xebia.com", + "name": "jbnicolai" + } + ], + "name": "strip-ansi", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/strip-ansi.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "3.0.1" +} diff --git a/deps/npm/node_modules/strip-ansi/readme.md b/deps/npm/node_modules/strip-ansi/readme.md new file mode 100644 index 00000000000000..cb7d9ff7ee403d --- /dev/null +++ b/deps/npm/node_modules/strip-ansi/readme.md @@ -0,0 +1,33 @@ +# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) + +> Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install --save strip-ansi +``` + + +## Usage + +```js +var stripAnsi = require('strip-ansi'); + +stripAnsi('\u001b[4mcake\u001b[0m'); +//=> 'cake' +``` + + +## Related + +- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module +- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes +- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/block-stream/LICENCE b/deps/npm/node_modules/tar/node_modules/block-stream/LICENCE similarity index 100% rename from deps/npm/node_modules/block-stream/LICENCE rename to deps/npm/node_modules/tar/node_modules/block-stream/LICENCE diff --git a/deps/npm/node_modules/tar/node_modules/block-stream/LICENSE b/deps/npm/node_modules/tar/node_modules/block-stream/LICENSE new file mode 100644 index 00000000000000..19129e315fe593 --- /dev/null +++ b/deps/npm/node_modules/tar/node_modules/block-stream/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/block-stream/README.md b/deps/npm/node_modules/tar/node_modules/block-stream/README.md similarity index 100% rename from deps/npm/node_modules/block-stream/README.md rename to deps/npm/node_modules/tar/node_modules/block-stream/README.md diff --git a/deps/npm/node_modules/block-stream/bench/block-stream-pause.js b/deps/npm/node_modules/tar/node_modules/block-stream/bench/block-stream-pause.js similarity index 100% rename from deps/npm/node_modules/block-stream/bench/block-stream-pause.js rename to deps/npm/node_modules/tar/node_modules/block-stream/bench/block-stream-pause.js diff --git a/deps/npm/node_modules/block-stream/bench/block-stream.js b/deps/npm/node_modules/tar/node_modules/block-stream/bench/block-stream.js similarity index 100% rename from deps/npm/node_modules/block-stream/bench/block-stream.js rename to deps/npm/node_modules/tar/node_modules/block-stream/bench/block-stream.js diff --git a/deps/npm/node_modules/block-stream/bench/dropper-pause.js b/deps/npm/node_modules/tar/node_modules/block-stream/bench/dropper-pause.js similarity index 100% rename from deps/npm/node_modules/block-stream/bench/dropper-pause.js rename to deps/npm/node_modules/tar/node_modules/block-stream/bench/dropper-pause.js diff --git a/deps/npm/node_modules/block-stream/bench/dropper.js b/deps/npm/node_modules/tar/node_modules/block-stream/bench/dropper.js similarity index 100% rename from deps/npm/node_modules/block-stream/bench/dropper.js rename to deps/npm/node_modules/tar/node_modules/block-stream/bench/dropper.js diff --git a/deps/npm/node_modules/block-stream/block-stream.js b/deps/npm/node_modules/tar/node_modules/block-stream/block-stream.js similarity index 100% rename from deps/npm/node_modules/block-stream/block-stream.js rename to deps/npm/node_modules/tar/node_modules/block-stream/block-stream.js diff --git a/deps/npm/node_modules/tar/node_modules/block-stream/package.json b/deps/npm/node_modules/tar/node_modules/block-stream/package.json new file mode 100644 index 00000000000000..97d9d42abaf911 --- /dev/null +++ b/deps/npm/node_modules/tar/node_modules/block-stream/package.json @@ -0,0 +1,55 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "name": "block-stream", + "description": "a stream of blocks", + "version": "0.0.8", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/block-stream.git" + }, + "engines": { + "node": "0.4 || >=0.5.8" + }, + "main": "block-stream.js", + "dependencies": { + "inherits": "~2.0.0" + }, + "devDependencies": { + "tap": "0.x" + }, + "scripts": { + "test": "tap test/" + }, + "license": "ISC", + "gitHead": "b35520314f4763af0788d65a846bb43d9c0a8f02", + "bugs": { + "url": "https://github.com/isaacs/block-stream/issues" + }, + "homepage": "https://github.com/isaacs/block-stream#readme", + "_id": "block-stream@0.0.8", + "_shasum": "0688f46da2bbf9cff0c4f68225a0cb95cbe8a46b", + "_from": "block-stream@*", + "_npmVersion": "2.10.0", + "_nodeVersion": "2.0.1", + "_npmUser": { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + "dist": { + "shasum": "0688f46da2bbf9cff0c4f68225a0cb95cbe8a46b", + "tarball": "http://registry.npmjs.org/block-stream/-/block-stream-0.0.8.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.8.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/block-stream/test/basic.js b/deps/npm/node_modules/tar/node_modules/block-stream/test/basic.js similarity index 100% rename from deps/npm/node_modules/block-stream/test/basic.js rename to deps/npm/node_modules/tar/node_modules/block-stream/test/basic.js diff --git a/deps/npm/node_modules/block-stream/test/nopad-thorough.js b/deps/npm/node_modules/tar/node_modules/block-stream/test/nopad-thorough.js similarity index 100% rename from deps/npm/node_modules/block-stream/test/nopad-thorough.js rename to deps/npm/node_modules/tar/node_modules/block-stream/test/nopad-thorough.js diff --git a/deps/npm/node_modules/block-stream/test/nopad.js b/deps/npm/node_modules/tar/node_modules/block-stream/test/nopad.js similarity index 100% rename from deps/npm/node_modules/block-stream/test/nopad.js rename to deps/npm/node_modules/tar/node_modules/block-stream/test/nopad.js diff --git a/deps/npm/node_modules/block-stream/test/pause-resume.js b/deps/npm/node_modules/tar/node_modules/block-stream/test/pause-resume.js similarity index 100% rename from deps/npm/node_modules/block-stream/test/pause-resume.js rename to deps/npm/node_modules/tar/node_modules/block-stream/test/pause-resume.js diff --git a/deps/npm/node_modules/block-stream/test/thorough.js b/deps/npm/node_modules/tar/node_modules/block-stream/test/thorough.js similarity index 100% rename from deps/npm/node_modules/block-stream/test/thorough.js rename to deps/npm/node_modules/tar/node_modules/block-stream/test/thorough.js diff --git a/deps/npm/node_modules/block-stream/test/two-stream.js b/deps/npm/node_modules/tar/node_modules/block-stream/test/two-stream.js similarity index 96% rename from deps/npm/node_modules/block-stream/test/two-stream.js rename to deps/npm/node_modules/tar/node_modules/block-stream/test/two-stream.js index c6db79a43d91d7..b0f5d82546823e 100644 --- a/deps/npm/node_modules/block-stream/test/two-stream.js +++ b/deps/npm/node_modules/tar/node_modules/block-stream/test/two-stream.js @@ -10,10 +10,10 @@ stack = new Buffer( tsize ); for ( ; i < tsize; i++) stack[i] = "x".charCodeAt(0); isize = 1 * 1024; // <- initial packet size with 4K no bug! -fsize = 2 * 1024 ; // <- first block-stream size +fsize = 2 * 1024 ; // <- first block-stream size psize = Math.ceil( isize / 6 ); // <- second block-stream size -fexpected = Math.ceil( tsize / fsize ); // <- packets expected for first +fexpected = Math.ceil( tsize / fsize ); // <- packets expected for first pexpected = Math.ceil( tsize / psize ); // <- packets expected for second diff --git a/deps/npm/node_modules/tar/package.json b/deps/npm/node_modules/tar/package.json index 2d0846a1fde27b..23921a83e5bdca 100644 --- a/deps/npm/node_modules/tar/package.json +++ b/deps/npm/node_modules/tar/package.json @@ -27,8 +27,6 @@ "mkdirp": "^0.5.0" }, "license": "ISC", - "readme": "# node-tar\n\nTar for Node.js.\n\n[![NPM](https://nodei.co/npm/tar.png)](https://nodei.co/npm/tar/)\n\n## API\n\nSee `examples/` for usage examples.\n\n### var tar = require('tar')\n\nReturns an object with `.Pack`, `.Extract` and `.Parse` methods.\n\n### tar.Pack([properties])\n\nReturns a through stream. Use\n[fstream](https://npmjs.org/package/fstream) to write files into the\npack stream and you will receive tar archive data from the pack\nstream.\n\nThis only works with directories, it does not work with individual files.\n\nThe optional `properties` object are used to set properties in the tar\n'Global Extended Header'. If the `fromBase` property is set to true,\nthe tar will contain files relative to the path passed, and not with\nthe path included.\n\n### tar.Extract([options])\n\nReturns a through stream. Write tar data to the stream and the files\nin the tarball will be extracted onto the filesystem.\n\n`options` can be:\n\n```js\n{\n path: '/path/to/extract/tar/into',\n strip: 0, // how many path segments to strip from the root when extracting\n}\n```\n\n`options` also get passed to the `fstream.Writer` instance that `tar`\nuses internally.\n\n### tar.Parse()\n\nReturns a writable stream. Write tar data to it and it will emit\n`entry` events for each entry parsed from the tarball. This is used by\n`tar.Extract`.\n", - "readmeFilename": "README.md", "gitHead": "52237e39d2eb68d22a32d9a98f1d762189fe6a3d", "bugs": { "url": "https://github.com/isaacs/node-tar/issues" @@ -36,5 +34,36 @@ "homepage": "https://github.com/isaacs/node-tar#readme", "_id": "tar@2.2.1", "_shasum": "8e4d2a256c0e2185c6b18ad694aec968b83cb1d1", - "_from": "tar@2.2.1" + "_from": "tar@>=2.2.1 <2.3.0", + "_npmVersion": "2.14.3", + "_nodeVersion": "2.2.2", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "8e4d2a256c0e2185c6b18ad694aec968b83cb1d1", + "tarball": "http://registry.npmjs.org/tar/-/tar-2.2.1.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "soldair", + "email": "soldair@gmail.com" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/text-table/package.json b/deps/npm/node_modules/text-table/package.json index 1eacd78e222a4b..3fbc997c79f3e6 100644 --- a/deps/npm/node_modules/text-table/package.json +++ b/deps/npm/node_modules/text-table/package.json @@ -48,5 +48,7 @@ "url": "https://github.com/substack/text-table/issues" }, "_id": "text-table@0.2.0", - "_from": "text-table@~0.2.0" + "_shasum": "7f5ee823ae805207c00af2df4a84ec3fcfa570b4", + "_resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "_from": "text-table@>=0.2.0 <0.3.0" } diff --git a/deps/npm/node_modules/uid-number/package.json b/deps/npm/node_modules/uid-number/package.json index 8d416235f86da8..a83a479f469868 100644 --- a/deps/npm/node_modules/uid-number/package.json +++ b/deps/npm/node_modules/uid-number/package.json @@ -27,7 +27,7 @@ "_id": "uid-number@0.0.6", "scripts": {}, "_shasum": "0ea10e8035e8eb5b8e4449f06da1c730663baa81", - "_from": "uid-number@>=0.0.6 <0.1.0", + "_from": "uid-number@0.0.6", "_npmVersion": "2.1.3", "_nodeVersion": "0.10.31", "_npmUser": { diff --git a/deps/npm/node_modules/unique-filename/.npmignore b/deps/npm/node_modules/unique-filename/.npmignore new file mode 100644 index 00000000000000..1ab9fa63f542db --- /dev/null +++ b/deps/npm/node_modules/unique-filename/.npmignore @@ -0,0 +1,5 @@ +*~ +.#* +DEADJOE + +node_modules diff --git a/deps/npm/node_modules/unique-filename/README.md b/deps/npm/node_modules/unique-filename/README.md new file mode 100644 index 00000000000000..4b5b241eb9acfd --- /dev/null +++ b/deps/npm/node_modules/unique-filename/README.md @@ -0,0 +1,33 @@ +unique-filename +=============== + +Generate a unique filename for use in temporary directories or caches. + +``` +var uniqueFilename = require('unique-filename') + +// returns something like: /tmp/912ec803b2ce49e4a541068d495ab570 +var randomTmpfile = uniqueFilename(os.tmpdir()) + +// returns something like: /tmp/my-test-912ec803b2ce49e4a541068d495ab570 +var randomPrefixedTmpfile = uniqueFilename(os.tmpdir(), 'my-test') + +var uniqueTmpfile = uniqueFilename('/tmp', 'testing', '/my/thing/to/uniq/on') +``` + +### uniqueFilename(*dir*, *fileprefix*, *uniqstr*) → String + +Returns the full path of a unique filename that looks like: +`dir/prefix-912ec803b2ce49e4a541068d495ab570` +or `dir/912ec803b2ce49e4a541068d495ab570` + +*dir* – The path you want the filename in. `os.tmpdir()` is a good choice for this. + +*fileprefix* – A string to append prior to the unique part of the filename. +The parameter is required if *uniqstr* is also passed in but is otherwise +optional and can be `undefined`/`null`/`''`. If present and not empty +then this string plus a hyphen are prepended to the unique part. + +*uniqstr* – Optional, if not passed the unique part of the resulting +filename will be random. If passed in it will be generated from this string +in a reproducable way. diff --git a/deps/npm/node_modules/unique-filename/index.js b/deps/npm/node_modules/unique-filename/index.js new file mode 100644 index 00000000000000..02bf1e273143c1 --- /dev/null +++ b/deps/npm/node_modules/unique-filename/index.js @@ -0,0 +1,8 @@ +'use strict' +var path = require('path') + +var uniqueSlug = require('unique-slug') + +module.exports = function (filepath, prefix, uniq) { + return path.join(filepath, (prefix ? prefix + '-' : '') + uniqueSlug(uniq)) +} diff --git a/deps/npm/node_modules/unique-filename/node_modules/unique-slug/.npmignore b/deps/npm/node_modules/unique-filename/node_modules/unique-slug/.npmignore new file mode 100644 index 00000000000000..2833ae874dea64 --- /dev/null +++ b/deps/npm/node_modules/unique-filename/node_modules/unique-slug/.npmignore @@ -0,0 +1,6 @@ +*~ +.#* +DEADJOE + +node_modules +.nyc_output/ diff --git a/deps/npm/node_modules/unique-filename/node_modules/unique-slug/.travis.yml b/deps/npm/node_modules/unique-filename/node_modules/unique-slug/.travis.yml new file mode 100644 index 00000000000000..3bc5d90c5666ca --- /dev/null +++ b/deps/npm/node_modules/unique-filename/node_modules/unique-slug/.travis.yml @@ -0,0 +1,11 @@ +language: node_js +sudo: false +before_install: + - "npm -g install npm" +node_js: + - "0.8" + - "0.10" + - "0.12" + - "iojs" + - "4" + - "5" diff --git a/deps/npm/node_modules/unique-filename/node_modules/unique-slug/README.md b/deps/npm/node_modules/unique-filename/node_modules/unique-slug/README.md new file mode 100644 index 00000000000000..08f7a7b48fcd24 --- /dev/null +++ b/deps/npm/node_modules/unique-filename/node_modules/unique-slug/README.md @@ -0,0 +1,19 @@ +unique-slug +=========== + +Generate a unique character string suitible for use in files and URLs. + +``` +var uniqueSlug = require('unique-slug') + +var randomSlug = uniqueSlug() +var fileSlug = uniqueSlug('/etc/passwd') +``` + +### uniqueSlug(*str*) → String (8 chars) + +If *str* is passed in then the return value will be its murmur hash in +hex. + +If *str* is not passed in, it will be 4 bytes coverted into 8 hex +characters, generated by `crypto.pseudoRandomBytes`. diff --git a/deps/npm/node_modules/unique-filename/node_modules/unique-slug/index.js b/deps/npm/node_modules/unique-filename/node_modules/unique-slug/index.js new file mode 100644 index 00000000000000..7c5d6c751c5cd0 --- /dev/null +++ b/deps/npm/node_modules/unique-filename/node_modules/unique-slug/index.js @@ -0,0 +1,19 @@ +'use strict' +var crypto = require('crypto') +var MurmurHash3 = require('imurmurhash') + +module.exports = function (uniq) { + if (uniq) { + var hash = new MurmurHash3(uniq) + return ('00000000' + hash.result().toString(16)).substr(-8) + } else { + // Called without a callback, because this interface should neither block + // nor error (by contrast with randomBytes which will throw an exception + // without enough entropy). + // + // However, due to a change in Node 0.10.27+, pseudoRandomBytes is now the + // same as randomBytes, and may in fact block in situations where + // insufficent entropy is available. + return crypto.pseudoRandomBytes(4).toString('hex') + } +} diff --git a/deps/npm/node_modules/unique-filename/node_modules/unique-slug/package.json b/deps/npm/node_modules/unique-filename/node_modules/unique-slug/package.json new file mode 100644 index 00000000000000..1460ebce27a348 --- /dev/null +++ b/deps/npm/node_modules/unique-filename/node_modules/unique-slug/package.json @@ -0,0 +1,82 @@ +{ + "_args": [ + [ + "unique-slug@^2.0.0", + "/Users/ogd/Documents/projects/npm/npm/node_modules/unique-filename" + ] + ], + "_from": "unique-slug@>=2.0.0 <3.0.0", + "_id": "unique-slug@2.0.0", + "_inCache": true, + "_installable": true, + "_location": "/unique-filename/unique-slug", + "_nodeVersion": "5.1.0", + "_npmUser": { + "email": "ogd@aoaioxxysz.net", + "name": "othiym23" + }, + "_npmVersion": "3.5.1", + "_phantomChildren": {}, + "_requested": { + "name": "unique-slug", + "raw": "unique-slug@^2.0.0", + "rawSpec": "^2.0.0", + "scope": null, + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/unique-filename" + ], + "_shasum": "db6676e7c7cc0629878ff196097c78855ae9f4ab", + "_shrinkwrap": null, + "_spec": "unique-slug@^2.0.0", + "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/unique-filename", + "author": { + "email": "me@re-becca.org", + "name": "Rebecca Turner", + "url": "http://re-becca.org" + }, + "bugs": { + "url": "https://github.com/iarna/unique-slug/issues" + }, + "dependencies": { + "imurmurhash": "^0.1.4" + }, + "description": "Generate a unique character string suitible for use in files and URLs.", + "devDependencies": { + "standard": "^5.4.1", + "tap": "^2.3.1" + }, + "directories": {}, + "dist": { + "shasum": "db6676e7c7cc0629878ff196097c78855ae9f4ab", + "tarball": "http://registry.npmjs.org/unique-slug/-/unique-slug-2.0.0.tgz" + }, + "gitHead": "b1d9d082ee5bd381961a2011a9aa3d9988e83ca7", + "homepage": "https://github.com/iarna/unique-slug#readme", + "keywords": [], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + } + ], + "name": "unique-slug", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/iarna/unique-slug.git" + }, + "scripts": { + "test": "standard && tap --coverage test" + }, + "version": "2.0.0" +} diff --git a/deps/npm/node_modules/unique-filename/node_modules/unique-slug/test/index.js b/deps/npm/node_modules/unique-filename/node_modules/unique-slug/test/index.js new file mode 100644 index 00000000000000..0f4ccad04af6fd --- /dev/null +++ b/deps/npm/node_modules/unique-filename/node_modules/unique-slug/test/index.js @@ -0,0 +1,13 @@ +'use strict' +var t = require('tap') +var uniqueSlug = require('../index.js') + +t.plan(5) +var slugA = uniqueSlug() +t.is(slugA.length, 8, 'random slugs are 8 chars') +t.notEqual(slugA, uniqueSlug(), "two slugs aren't the same") +var base = '/path/to/thingy' +var slugB = uniqueSlug(base) +t.is(slugB.length, 8, 'string based slugs are 8 chars') +t.is(slugB, uniqueSlug(base), 'two string based slugs, from the same string are the same') +t.notEqual(slugB, uniqueSlug(slugA), 'two string based slongs, from diff strings are different') diff --git a/deps/npm/node_modules/unique-filename/package.json b/deps/npm/node_modules/unique-filename/package.json new file mode 100644 index 00000000000000..12a351ae934ab2 --- /dev/null +++ b/deps/npm/node_modules/unique-filename/package.json @@ -0,0 +1,81 @@ +{ + "_args": [ + [ + "unique-filename@^1.1.0", + "/Users/ogd/Documents/projects/npm/npm" + ] + ], + "_from": "unique-filename@>=1.1.0 <2.0.0", + "_id": "unique-filename@1.1.0", + "_inCache": true, + "_installable": true, + "_location": "/unique-filename", + "_nodeVersion": "4.2.2", + "_npmUser": { + "email": "me@re-becca.org", + "name": "iarna" + }, + "_npmVersion": "2.14.13", + "_phantomChildren": { + "imurmurhash": "0.1.4" + }, + "_requested": { + "name": "unique-filename", + "raw": "unique-filename@^1.1.0", + "rawSpec": "^1.1.0", + "scope": null, + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.0.tgz", + "_shasum": "d05f2fe4032560871f30e93cbe735eea201514f3", + "_shrinkwrap": null, + "_spec": "unique-filename@^1.1.0", + "_where": "/Users/ogd/Documents/projects/npm/npm", + "author": { + "email": "me@re-becca.org", + "name": "Rebecca Turner", + "url": "http://re-becca.org/" + }, + "bugs": { + "url": "https://github.com/iarna/unique-filename/issues" + }, + "dependencies": { + "unique-slug": "^2.0.0" + }, + "description": "Generate a unique filename for use in temporary directories or caches.", + "devDependencies": { + "standard": "^5.4.1", + "tap": "^2.3.1" + }, + "directories": {}, + "dist": { + "shasum": "d05f2fe4032560871f30e93cbe735eea201514f3", + "tarball": "http://registry.npmjs.org/unique-filename/-/unique-filename-1.1.0.tgz" + }, + "gitHead": "cb31644c71f842258a8019e0e6ef8f2b8533a5c0", + "homepage": "https://github.com/iarna/unique-filename", + "keywords": [], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "unique-filename", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/unique-filename.git" + }, + "scripts": { + "test": "standard && tap test" + }, + "version": "1.1.0" +} diff --git a/deps/npm/node_modules/unique-filename/test/index.js b/deps/npm/node_modules/unique-filename/test/index.js new file mode 100644 index 00000000000000..105b4e52e8b407 --- /dev/null +++ b/deps/npm/node_modules/unique-filename/test/index.js @@ -0,0 +1,23 @@ +'sue strict' +var t = require('tap') +var uniqueFilename = require('../index.js') + +t.plan(6) + +var randomTmpfile = uniqueFilename('tmp') +t.like(randomTmpfile, /^tmp.[a-f0-9]{8}$/, 'random tmp file') + +var randomAgain = uniqueFilename('tmp') +t.notEqual(randomAgain, randomTmpfile, 'random tmp files are not the same') + +var randomPrefixedTmpfile = uniqueFilename('tmp', 'my-test') +t.like(randomPrefixedTmpfile, /^tmp.my-test-[a-f0-9]{8}$/, 'random prefixed tmp file') + +var randomPrefixedAgain = uniqueFilename('tmp', 'my-test') +t.notEqual(randomPrefixedAgain, randomPrefixedTmpfile, 'random prefixed tmp files are not the same') + +var uniqueTmpfile = uniqueFilename('tmp', 'testing', '/my/thing/to/uniq/on') +t.like(uniqueTmpfile, /^tmp.testing-7ddd44c0$/, 'unique filename') + +var uniqueAgain = uniqueFilename('tmp', 'testing', '/my/thing/to/uniq/on') +t.is(uniqueTmpfile, uniqueAgain, 'same unique string component produces same filename') diff --git a/deps/npm/node_modules/unpipe/HISTORY.md b/deps/npm/node_modules/unpipe/HISTORY.md new file mode 100644 index 00000000000000..85e0f8d747dc2a --- /dev/null +++ b/deps/npm/node_modules/unpipe/HISTORY.md @@ -0,0 +1,4 @@ +1.0.0 / 2015-06-14 +================== + + * Initial release diff --git a/deps/npm/node_modules/unpipe/LICENSE b/deps/npm/node_modules/unpipe/LICENSE new file mode 100644 index 00000000000000..aed0138278a940 --- /dev/null +++ b/deps/npm/node_modules/unpipe/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/unpipe/README.md b/deps/npm/node_modules/unpipe/README.md new file mode 100644 index 00000000000000..e536ad2c045bba --- /dev/null +++ b/deps/npm/node_modules/unpipe/README.md @@ -0,0 +1,43 @@ +# unpipe + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Unpipe a stream from all destinations. + +## Installation + +```sh +$ npm install unpipe +``` + +## API + +```js +var unpipe = require('unpipe') +``` + +### unpipe(stream) + +Unpipes all destinations from a given stream. With stream 2+, this is +equivalent to `stream.unpipe()`. When used with streams 1 style streams +(typically Node.js 0.8 and below), this module attempts to undo the +actions done in `stream.pipe(dest)`. + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/unpipe.svg +[npm-url]: https://npmjs.org/package/unpipe +[node-image]: https://img.shields.io/node/v/unpipe.svg +[node-url]: http://nodejs.org/download/ +[travis-image]: https://img.shields.io/travis/stream-utils/unpipe.svg +[travis-url]: https://travis-ci.org/stream-utils/unpipe +[coveralls-image]: https://img.shields.io/coveralls/stream-utils/unpipe.svg +[coveralls-url]: https://coveralls.io/r/stream-utils/unpipe?branch=master +[downloads-image]: https://img.shields.io/npm/dm/unpipe.svg +[downloads-url]: https://npmjs.org/package/unpipe diff --git a/deps/npm/node_modules/unpipe/index.js b/deps/npm/node_modules/unpipe/index.js new file mode 100644 index 00000000000000..15c3d97a12b484 --- /dev/null +++ b/deps/npm/node_modules/unpipe/index.js @@ -0,0 +1,69 @@ +/*! + * unpipe + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = unpipe + +/** + * Determine if there are Node.js pipe-like data listeners. + * @private + */ + +function hasPipeDataListeners(stream) { + var listeners = stream.listeners('data') + + for (var i = 0; i < listeners.length; i++) { + if (listeners[i].name === 'ondata') { + return true + } + } + + return false +} + +/** + * Unpipe a stream from all destinations. + * + * @param {object} stream + * @public + */ + +function unpipe(stream) { + if (!stream) { + throw new TypeError('argument stream is required') + } + + if (typeof stream.unpipe === 'function') { + // new-style + stream.unpipe() + return + } + + // Node.js 0.8 hack + if (!hasPipeDataListeners(stream)) { + return + } + + var listener + var listeners = stream.listeners('close') + + for (var i = 0; i < listeners.length; i++) { + listener = listeners[i] + + if (listener.name !== 'cleanup' && listener.name !== 'onclose') { + continue + } + + // invoke the listener + listener.call(stream) + } +} diff --git a/deps/npm/node_modules/unpipe/package.json b/deps/npm/node_modules/unpipe/package.json new file mode 100644 index 00000000000000..25fbed73a049f7 --- /dev/null +++ b/deps/npm/node_modules/unpipe/package.json @@ -0,0 +1,43 @@ +{ + "name": "unpipe", + "description": "Unpipe a stream from all destinations", + "version": "1.0.0", + "author": { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/stream-utils/unpipe.git" + }, + "devDependencies": { + "istanbul": "0.3.15", + "mocha": "2.2.5", + "readable-stream": "1.1.13" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + }, + "readme": "# unpipe\n\n[![NPM Version][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n[![Node.js Version][node-image]][node-url]\n[![Build Status][travis-image]][travis-url]\n[![Test Coverage][coveralls-image]][coveralls-url]\n\nUnpipe a stream from all destinations.\n\n## Installation\n\n```sh\n$ npm install unpipe\n```\n\n## API\n\n```js\nvar unpipe = require('unpipe')\n```\n\n### unpipe(stream)\n\nUnpipes all destinations from a given stream. With stream 2+, this is\nequivalent to `stream.unpipe()`. When used with streams 1 style streams\n(typically Node.js 0.8 and below), this module attempts to undo the\nactions done in `stream.pipe(dest)`.\n\n## License\n\n[MIT](LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/unpipe.svg\n[npm-url]: https://npmjs.org/package/unpipe\n[node-image]: https://img.shields.io/node/v/unpipe.svg\n[node-url]: http://nodejs.org/download/\n[travis-image]: https://img.shields.io/travis/stream-utils/unpipe.svg\n[travis-url]: https://travis-ci.org/stream-utils/unpipe\n[coveralls-image]: https://img.shields.io/coveralls/stream-utils/unpipe.svg\n[coveralls-url]: https://coveralls.io/r/stream-utils/unpipe?branch=master\n[downloads-image]: https://img.shields.io/npm/dm/unpipe.svg\n[downloads-url]: https://npmjs.org/package/unpipe\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/stream-utils/unpipe/issues" + }, + "homepage": "https://github.com/stream-utils/unpipe#readme", + "_id": "unpipe@1.0.0", + "_shasum": "b2bf4ee8514aae6165b4817829d21b2ef49904ec", + "_resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "_from": "unpipe@>=1.0.0 <1.1.0" +} diff --git a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/LICENSE b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/LICENSE new file mode 100644 index 00000000000000..4b54239b2e6f94 --- /dev/null +++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/LICENSE @@ -0,0 +1,57 @@ +SPDX:Apache-2.0 + +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: + +(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + +(b) You must cause any modified files to carry prominent notices stating that You changed the files; and + +(c) 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 + +(d) 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. diff --git a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/node_modules/spdx-license-ids/package.json b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/node_modules/spdx-license-ids/package.json index 62c5c37ba96261..bf563e74a44810 100644 --- a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/node_modules/spdx-license-ids/package.json +++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/node_modules/spdx-license-ids/package.json @@ -1,77 +1,103 @@ { - "name": "spdx-license-ids", - "version": "1.0.2", - "description": "A list of SPDX license identifiers", - "repository": { - "type": "git", - "url": "git+https://github.com/shinnn/spdx-license-ids.git" + "_args": [ + [ + "spdx-license-ids@^1.0.2", + "/Users/rebecca/code/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct" + ] + ], + "_from": "spdx-license-ids@>=1.0.2 <2.0.0", + "_id": "spdx-license-ids@1.2.0", + "_inCache": true, + "_installable": true, + "_location": "/validate-npm-package-license/spdx-correct/spdx-license-ids", + "_nodeVersion": "5.4.0", + "_npmUser": { + "email": "snnskwtnb@gmail.com", + "name": "shinnn" }, + "_npmVersion": "3.5.2", + "_phantomChildren": {}, + "_requested": { + "name": "spdx-license-ids", + "raw": "spdx-license-ids@^1.0.2", + "rawSpec": "^1.0.2", + "scope": null, + "spec": ">=1.0.2 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/validate-npm-package-license/spdx-correct" + ], + "_resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.0.tgz", + "_shasum": "b549dd0f63dcb745a17e2ea3a07402e0e332d1e2", + "_shrinkwrap": null, + "_spec": "spdx-license-ids@^1.0.2", + "_where": "/Users/rebecca/code/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct", "author": { "name": "Shinnosuke Watanabe", "url": "https://github.com/shinnn" }, - "scripts": { - "build": "node --harmony_arrow_functions build.js", - "lint": "eslint --config node_modules/@shinnn/eslintrc/rc.json --ignore-path .gitignore .", - "pretest": "${npm_package_scripts_build} && ${npm_package_scripts_lint}", - "test": "node --harmony_arrow_functions test.js", - "coverage": "node --harmony_arrow_functions node_modules/.bin/istanbul cover test.js", - "coveralls": "${npm_package_scripts_coverage} && istanbul-coveralls" + "bugs": { + "url": "https://github.com/shinnn/spdx-license-ids/issues" }, - "license": "Unlicense", - "main": "spdx-license-ids.json", - "files": [ - "spdx-license-ids.json" - ], - "keywords": [ - "spdx", - "license", - "licenses", - "id", - "identifier", - "identifiers", - "json", - "array", - "oss", - "browser", - "client-side" - ], + "dependencies": {}, + "description": "A list of SPDX license identifiers", "devDependencies": { "@shinnn/eslintrc": "^1.0.0", "each-async": "^1.1.1", "eslint": "^0.24.0", "got": "^3.3.0", "istanbul": "^0.3.17", - "istanbul-coveralls": "^1.0.3", "require-bower-files": "^2.0.0", "rimraf": "^2.4.1", "stringify-object": "^2.2.0", "tape": "^4.0.0" }, - "gitHead": "df183ecdf1738f77b1e8e41f686ee56206a40693", - "bugs": { - "url": "https://github.com/shinnn/spdx-license-ids/issues" + "directories": {}, + "dist": { + "shasum": "b549dd0f63dcb745a17e2ea3a07402e0e332d1e2", + "tarball": "http://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.0.tgz" }, + "files": [ + "spdx-license-ids.json" + ], + "gitHead": "f74a7a16ca05540e0e97f1bbb61da07829b5d9ab", "homepage": "https://github.com/shinnn/spdx-license-ids#readme", - "_id": "spdx-license-ids@1.0.2", - "_shasum": "0674e9c9a230f980016b5b073a10aa165701677c", - "_from": "spdx-license-ids@>=1.0.0 <2.0.0", - "_npmVersion": "2.12.1", - "_nodeVersion": "2.3.3", - "_npmUser": { - "name": "shinnn", - "email": "snnskwtnb@gmail.com" - }, + "keywords": [ + "array", + "browser", + "client-side", + "id", + "identifier", + "identifiers", + "json", + "license", + "licenses", + "oss", + "spdx" + ], + "license": "Unlicense", + "main": "spdx-license-ids.json", "maintainers": [ { "name": "shinnn", "email": "snnskwtnb@gmail.com" } ], - "dist": { - "shasum": "0674e9c9a230f980016b5b073a10aa165701677c", - "tarball": "http://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.0.2.tgz" + "name": "spdx-license-ids", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/shinnn/spdx-license-ids.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.0.2.tgz" + "scripts": { + "build": "node --harmony_arrow_functions build.js", + "coverage": "node --harmony_arrow_functions node_modules/.bin/istanbul cover test.js", + "coveralls": "${npm_package_scripts_coverage} && istanbul-coveralls", + "lint": "eslint --config node_modules/@shinnn/eslintrc/rc.json --ignore-path .gitignore .", + "pretest": "${npm_package_scripts_build} && ${npm_package_scripts_lint}", + "test": "node --harmony_arrow_functions test.js" + }, + "version": "1.2.0" } diff --git a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/node_modules/spdx-license-ids/spdx-license-ids.json b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/node_modules/spdx-license-ids/spdx-license-ids.json index 2a4a78f549f06e..8d23a650ef49f5 100644 --- a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/node_modules/spdx-license-ids/spdx-license-ids.json +++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/node_modules/spdx-license-ids/spdx-license-ids.json @@ -45,6 +45,7 @@ "BSD-4-Clause", "BSD-Protection", "BSD-3-Clause-Attribution", + "0BSD", "BSD-4-Clause-UC", "bzip2-1.0.5", "bzip2-1.0.6", @@ -52,6 +53,7 @@ "CECILL-1.0", "CECILL-1.1", "CECILL-2.0", + "CECILL-2.1", "CECILL-B", "CECILL-C", "ClArtistic", @@ -98,8 +100,10 @@ "CC-BY-SA-4.0", "CC0-1.0", "Crossword", + "CrystalStacker", "CUA-OPL-1.0", "Cube", + "curl", "D-FSL-1.0", "diffmark", "WTFPL", @@ -152,16 +156,18 @@ "iMatix", "Imlib2", "IJG", + "Info-ZIP", "Intel-ACPI", "Intel", + "Interbase-1.0", "IPA", "ISC", "JasPer-2.0", "JSON", - "LPPL-1.3a", "LPPL-1.0", "LPPL-1.1", "LPPL-1.2", + "LPPL-1.3a", "LPPL-1.3c", "Latex2e", "BSD-3-Clause-LBNL", @@ -205,6 +211,7 @@ "OCLC-2.0", "ODbL-1.0", "PDDL-1.0", + "OCCT-PL", "OGTSL", "OLDAP-2.2.2", "OLDAP-1.1", @@ -251,6 +258,7 @@ "Saxpath", "SCEA", "SWL", + "Sendmail", "SGI-B-1.0", "SGI-B-1.1", "SGI-B-2.0", @@ -299,5 +307,15 @@ "zlib-acknowledgement", "ZPL-1.1", "ZPL-2.0", - "ZPL-2.1" + "ZPL-2.1", + "eCos-2.0", + "GPL-2.0-with-autoconf-exception", + "GPL-2.0-with-bison-exception", + "GPL-2.0-with-classpath-exception", + "GPL-2.0-with-font-exception", + "GPL-2.0-with-GCC-exception", + "GPL-3.0-with-autoconf-exception", + "GPL-3.0-with-GCC-exception", + "StandardML-NJ", + "WXwindows" ] diff --git a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/package.json b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/package.json index f1a85e2ea38e0c..36bd1e01d051c9 100644 --- a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/package.json +++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/package.json @@ -1,21 +1,63 @@ { - "name": "spdx-correct", - "description": "correct invalid SPDX identifiers", - "version": "1.0.1", + "_args": [ + [ + "spdx-correct@~1.0.0", + "/Users/rebecca/code/npm/node_modules/validate-npm-package-license" + ] + ], + "_from": "spdx-correct@>=1.0.0 <1.1.0", + "_id": "spdx-correct@1.0.2", + "_inCache": true, + "_installable": true, + "_location": "/validate-npm-package-license/spdx-correct", + "_nodeVersion": "4.2.1", + "_npmUser": { + "email": "kyle@kemitchell.com", + "name": "kemitchell" + }, + "_npmVersion": "3.3.6", + "_phantomChildren": {}, + "_requested": { + "name": "spdx-correct", + "raw": "spdx-correct@~1.0.0", + "rawSpec": "~1.0.0", + "scope": null, + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/validate-npm-package-license" + ], + "_resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", + "_shasum": "4b3073d933ff51f3912f03ac5519498a4150db40", + "_shrinkwrap": null, + "_spec": "spdx-correct@~1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/validate-npm-package-license", "author": { - "name": "Kyle E. Mitchell", "email": "kyle@kemitchell.com", + "name": "Kyle E. Mitchell", "url": "https://kemitchell.com" }, + "bugs": { + "url": "https://github.com/kemitchell/spdx-correct.js/issues" + }, "dependencies": { "spdx-license-ids": "^1.0.2" }, + "description": "correct invalid SPDX identifiers", "devDependencies": { "defence-cli": "^1.0.1", "replace-require-self": "^1.0.0", "spdx-expression-parse": "^1.0.0", "tape": "~4.0.0" }, + "directories": {}, + "dist": { + "shasum": "4b3073d933ff51f3912f03ac5519498a4150db40", + "tarball": "http://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz" + }, + "gitHead": "8430a3ad521e1455208db33faafcb79c7b074236", + "homepage": "https://github.com/kemitchell/spdx-correct.js#readme", "keywords": [ "SPDX", "law", @@ -24,31 +66,6 @@ "metadata" ], "license": "Apache-2.0", - "repository": { - "type": "git", - "url": "git+https://github.com/kemitchell/spdx-correct.js.git" - }, - "scripts": { - "test": "defence README.md | replace-require-self | node && tape *.test.js" - }, - "gitHead": "f3581dea1529d975851ceab7f86e646d8220608a", - "bugs": { - "url": "https://github.com/kemitchell/spdx-correct.js/issues" - }, - "homepage": "https://github.com/kemitchell/spdx-correct.js#readme", - "_id": "spdx-correct@1.0.1", - "_shasum": "ac075f5f2f6a06c0bfdd1c847eb3dde3dd8221ea", - "_from": "spdx-correct@>=1.0.0 <1.1.0", - "_npmVersion": "2.13.5", - "_nodeVersion": "0.12.7", - "_npmUser": { - "name": "kemitchell", - "email": "kyle@kemitchell.com" - }, - "dist": { - "shasum": "ac075f5f2f6a06c0bfdd1c847eb3dde3dd8221ea", - "tarball": "http://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.1.tgz" - }, "maintainers": [ { "name": "kemitchell", @@ -59,6 +76,15 @@ "email": "ogd@aoaioxxysz.net" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.1.tgz" + "name": "spdx-correct", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/kemitchell/spdx-correct.js.git" + }, + "scripts": { + "test": "defence README.md | replace-require-self | node && tape *.test.js" + }, + "version": "1.0.2" } diff --git a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/LICENSE b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/LICENSE index 442142822dd18a..51a8d6bf05d26c 100644 --- a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/LICENSE +++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/LICENSE @@ -1,11 +1,9 @@ -SPDX:MIT +The MIT License -MIT License +Copyright (c) 2015 Kyle E. Mitchell and other contributors -Copyright (c) 2015 Kyle E. Mitchell - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the +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 @@ -15,8 +13,8 @@ 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 +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, diff --git a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/README.md b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/README.md index 897aa43f33eda4..4b96d3e2a9e97d 100644 --- a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/README.md +++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/README.md @@ -1,5 +1,5 @@ ```javascript -var parse = require('./') +var parse = require('spdx-expression-parse') var assert = require('assert') var firstAST = { @@ -27,6 +27,16 @@ var secondAST = { assert.deepEqual( parse('(MIT AND (LGPL-2.1+ AND BSD-3-Clause))'), secondAST) + +// We handle all the bare SPDX license and exception ids as well. +require('spdx-license-ids').forEach(function(id) { + assert.deepEqual( + parse(id), + { license: id }) + require('spdx-exceptions').forEach(function(e) { + assert.deepEqual( + parse(id + ' WITH ' + e), + { license: id, exception: e }) }) }) ``` --- diff --git a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/.npmignore b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/.npmignore deleted file mode 100644 index 5825067776c896..00000000000000 --- a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -.npmiginore -.travis.yml diff --git a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/LICENSE.md b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/LICENSE.md deleted file mode 100644 index 6c255589566ffe..00000000000000 --- a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/LICENSE.md +++ /dev/null @@ -1,9 +0,0 @@ -The MIT License - -Copyright (c) 2015 Kyle E. Mitchell - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/README.md b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/README.md index ef377325ee1e74..43a663723df002 100644 --- a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/README.md +++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/README.md @@ -1,13 +1 @@ -```javascript -var assert = require('assert') -var spdxExceptions = require('spdx-exceptions') - -assert(Array.isArray(spdxExceptions)) - -assert(spdxExceptions.length > 0) - -function isString(x) { - return typeof x === 'string' } - -assert(spdxExceptions.every(isString)) -``` +The package exports an array of strings. diff --git a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/index.json b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/index.json index dd9277891ec266..3b84277baad0c8 100644 --- a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/index.json +++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/index.json @@ -1,24 +1,24 @@ [ "389-exception", - "Autoconf-exception-2.0 ", - "Autoconf-exception-3.0 ", + "Autoconf-exception-2.0", + "Autoconf-exception-3.0", "Bison-exception-2.2", "CLISP-exception-2.0", "Classpath-exception-2.0", - "FLTK-exception ", - "FLTK-exception-2.0 ", - "Font-exception-2.0 ", + "FLTK-exception", + "FLTK-exception-2.0", + "Font-exception-2.0", "GCC-exception-2.0", "GCC-exception-3.1", - "LZMA-exception ", + "LZMA-exception", "Libtool-exception", - "Nokia-Qt-exception-1.1 ", + "Nokia-Qt-exception-1.1", "Qwt-exception-1.0", "WxWindows-exception-3.1", - "eCos-exception-2.0 ", - "freertos-exception-2.0 ", - "gnu-javamail-exception ", - "i2p-gpl-java-exception ", + "eCos-exception-2.0", + "freertos-exception-2.0", + "gnu-javamail-exception", + "i2p-gpl-java-exception", "mif-exception", - "u-boot-exception-2.0 " + "u-boot-exception-2.0" ] diff --git a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/package.json b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/package.json index 08249989340112..4e71051d56e406 100644 --- a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/package.json +++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/package.json @@ -1,10 +1,44 @@ { - "name": "spdx-exceptions", - "description": "list of SPDX standard license exceptions", - "version": "1.0.2", + "_args": [ + [ + "spdx-exceptions@^1.0.4", + "/Users/rebecca/code/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse" + ] + ], + "_from": "spdx-exceptions@>=1.0.4 <2.0.0", + "_id": "spdx-exceptions@1.0.4", + "_inCache": true, + "_installable": true, + "_location": "/validate-npm-package-license/spdx-expression-parse/spdx-exceptions", + "_nodeVersion": "5.0.0", + "_npmUser": { + "email": "kyle@kemitchell.com", + "name": "kemitchell" + }, + "_npmVersion": "3.3.6", + "_phantomChildren": {}, + "_requested": { + "name": "spdx-exceptions", + "raw": "spdx-exceptions@^1.0.4", + "rawSpec": "^1.0.4", + "scope": null, + "spec": ">=1.0.4 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/validate-npm-package-license/spdx-expression-parse" + ], + "_resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-1.0.4.tgz", + "_shasum": "220b84239119ae9045a892db81a83f4ce16f80fd", + "_shrinkwrap": null, + "_spec": "spdx-exceptions@^1.0.4", + "_where": "/Users/rebecca/code/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse", "author": { "name": "The Linux Foundation" }, + "bugs": { + "url": "https://github.com/kemitchell/spdx-exceptions.json/issues" + }, "contributors": [ { "name": "Kyle E. Mitchell", @@ -12,41 +46,30 @@ "url": "https://kemitchell.com/" } ], - "devDependencies": { - "defence-cli": "^1.0.1" - }, - "license": "CC-BY-3.0", - "repository": { - "type": "git", - "url": "git+https://github.com/kemitchell/spdx-exceptions.js.git" - }, - "scripts": { - "test": "defence -i javascript README.md | sed 's!spdx-exceptions!./!' | node" - }, - "gitHead": "a1e7b0595efee0e4436e9807dd36280791e44c82", - "bugs": { - "url": "https://github.com/kemitchell/spdx-exceptions.js/issues" - }, - "homepage": "https://github.com/kemitchell/spdx-exceptions.js#readme", - "_id": "spdx-exceptions@1.0.2", - "_shasum": "c584a2875a1db1c8743266990af6e0c82e143a5b", - "_from": "spdx-exceptions@>=1.0.0 <2.0.0", - "_npmVersion": "2.13.3", - "_nodeVersion": "0.12.7", - "_npmUser": { - "name": "kemitchell", - "email": "kyle@kemitchell.com" - }, + "dependencies": {}, + "description": "list of SPDX standard license exceptions", + "devDependencies": {}, + "directories": {}, "dist": { - "shasum": "c584a2875a1db1c8743266990af6e0c82e143a5b", - "tarball": "http://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-1.0.2.tgz" + "shasum": "220b84239119ae9045a892db81a83f4ce16f80fd", + "tarball": "http://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-1.0.4.tgz" }, + "gitHead": "770316d6c946417ab6efa8533b82d0b61779092b", + "homepage": "https://github.com/kemitchell/spdx-exceptions.json#readme", + "license": "CC-BY-3.0", "maintainers": [ { "name": "kemitchell", "email": "kyle@kemitchell.com" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-1.0.2.tgz" + "name": "spdx-exceptions", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/kemitchell/spdx-exceptions.json.git" + }, + "scripts": {}, + "version": "1.0.4" } diff --git a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-license-ids/package.json b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-license-ids/package.json index 62c5c37ba96261..3068a90fa005bc 100644 --- a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-license-ids/package.json +++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-license-ids/package.json @@ -1,77 +1,105 @@ { - "name": "spdx-license-ids", - "version": "1.0.2", - "description": "A list of SPDX license identifiers", - "repository": { - "type": "git", - "url": "git+https://github.com/shinnn/spdx-license-ids.git" + "_args": [ + [ + "spdx-license-ids@^1.0.0", + "/Users/rebecca/code/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse" + ], + [ + "spdx-license-ids@^1.0.2", + "/Users/rebecca/code/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct" + ] + ], + "_from": "spdx-license-ids@>=1.0.0 <2.0.0", + "_id": "spdx-license-ids@1.2.0", + "_inCache": true, + "_installable": true, + "_location": "/validate-npm-package-license/spdx-expression-parse/spdx-license-ids", + "_nodeVersion": "5.4.0", + "_npmUser": { + "email": "snnskwtnb@gmail.com", + "name": "shinnn" + }, + "_npmVersion": "3.5.2", + "_phantomChildren": {}, + "_requested": { + "name": "spdx-license-ids", + "raw": "spdx-license-ids@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" }, + "_requiredBy": [ + "/validate-npm-package-license/spdx-expression-parse" + ], + "_shrinkwrap": null, + "_spec": "spdx-license-ids@^1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse", "author": { "name": "Shinnosuke Watanabe", "url": "https://github.com/shinnn" }, - "scripts": { - "build": "node --harmony_arrow_functions build.js", - "lint": "eslint --config node_modules/@shinnn/eslintrc/rc.json --ignore-path .gitignore .", - "pretest": "${npm_package_scripts_build} && ${npm_package_scripts_lint}", - "test": "node --harmony_arrow_functions test.js", - "coverage": "node --harmony_arrow_functions node_modules/.bin/istanbul cover test.js", - "coveralls": "${npm_package_scripts_coverage} && istanbul-coveralls" + "bugs": { + "url": "https://github.com/shinnn/spdx-license-ids/issues" }, - "license": "Unlicense", - "main": "spdx-license-ids.json", - "files": [ - "spdx-license-ids.json" - ], - "keywords": [ - "spdx", - "license", - "licenses", - "id", - "identifier", - "identifiers", - "json", - "array", - "oss", - "browser", - "client-side" - ], + "dependencies": {}, + "description": "A list of SPDX license identifiers", "devDependencies": { "@shinnn/eslintrc": "^1.0.0", "each-async": "^1.1.1", "eslint": "^0.24.0", "got": "^3.3.0", "istanbul": "^0.3.17", - "istanbul-coveralls": "^1.0.3", "require-bower-files": "^2.0.0", "rimraf": "^2.4.1", "stringify-object": "^2.2.0", "tape": "^4.0.0" }, - "gitHead": "df183ecdf1738f77b1e8e41f686ee56206a40693", - "bugs": { - "url": "https://github.com/shinnn/spdx-license-ids/issues" + "directories": {}, + "dist": { + "shasum": "b549dd0f63dcb745a17e2ea3a07402e0e332d1e2", + "tarball": "http://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.0.tgz" }, + "files": [ + "spdx-license-ids.json" + ], + "gitHead": "f74a7a16ca05540e0e97f1bbb61da07829b5d9ab", "homepage": "https://github.com/shinnn/spdx-license-ids#readme", - "_id": "spdx-license-ids@1.0.2", - "_shasum": "0674e9c9a230f980016b5b073a10aa165701677c", - "_from": "spdx-license-ids@>=1.0.0 <2.0.0", - "_npmVersion": "2.12.1", - "_nodeVersion": "2.3.3", - "_npmUser": { - "name": "shinnn", - "email": "snnskwtnb@gmail.com" - }, + "keywords": [ + "array", + "browser", + "client-side", + "id", + "identifier", + "identifiers", + "json", + "license", + "licenses", + "oss", + "spdx" + ], + "license": "Unlicense", + "main": "spdx-license-ids.json", "maintainers": [ { "name": "shinnn", "email": "snnskwtnb@gmail.com" } ], - "dist": { - "shasum": "0674e9c9a230f980016b5b073a10aa165701677c", - "tarball": "http://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.0.2.tgz" + "name": "spdx-license-ids", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/shinnn/spdx-license-ids.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.0.2.tgz" + "scripts": { + "build": "node --harmony_arrow_functions build.js", + "coverage": "node --harmony_arrow_functions node_modules/.bin/istanbul cover test.js", + "coveralls": "${npm_package_scripts_coverage} && istanbul-coveralls", + "lint": "eslint --config node_modules/@shinnn/eslintrc/rc.json --ignore-path .gitignore .", + "pretest": "${npm_package_scripts_build} && ${npm_package_scripts_lint}", + "test": "node --harmony_arrow_functions test.js" + }, + "version": "1.2.0" } diff --git a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-license-ids/spdx-license-ids.json b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-license-ids/spdx-license-ids.json index 2a4a78f549f06e..8d23a650ef49f5 100644 --- a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-license-ids/spdx-license-ids.json +++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-license-ids/spdx-license-ids.json @@ -45,6 +45,7 @@ "BSD-4-Clause", "BSD-Protection", "BSD-3-Clause-Attribution", + "0BSD", "BSD-4-Clause-UC", "bzip2-1.0.5", "bzip2-1.0.6", @@ -52,6 +53,7 @@ "CECILL-1.0", "CECILL-1.1", "CECILL-2.0", + "CECILL-2.1", "CECILL-B", "CECILL-C", "ClArtistic", @@ -98,8 +100,10 @@ "CC-BY-SA-4.0", "CC0-1.0", "Crossword", + "CrystalStacker", "CUA-OPL-1.0", "Cube", + "curl", "D-FSL-1.0", "diffmark", "WTFPL", @@ -152,16 +156,18 @@ "iMatix", "Imlib2", "IJG", + "Info-ZIP", "Intel-ACPI", "Intel", + "Interbase-1.0", "IPA", "ISC", "JasPer-2.0", "JSON", - "LPPL-1.3a", "LPPL-1.0", "LPPL-1.1", "LPPL-1.2", + "LPPL-1.3a", "LPPL-1.3c", "Latex2e", "BSD-3-Clause-LBNL", @@ -205,6 +211,7 @@ "OCLC-2.0", "ODbL-1.0", "PDDL-1.0", + "OCCT-PL", "OGTSL", "OLDAP-2.2.2", "OLDAP-1.1", @@ -251,6 +258,7 @@ "Saxpath", "SCEA", "SWL", + "Sendmail", "SGI-B-1.0", "SGI-B-1.1", "SGI-B-2.0", @@ -299,5 +307,15 @@ "zlib-acknowledgement", "ZPL-1.1", "ZPL-2.0", - "ZPL-2.1" + "ZPL-2.1", + "eCos-2.0", + "GPL-2.0-with-autoconf-exception", + "GPL-2.0-with-bison-exception", + "GPL-2.0-with-classpath-exception", + "GPL-2.0-with-font-exception", + "GPL-2.0-with-GCC-exception", + "GPL-3.0-with-autoconf-exception", + "GPL-3.0-with-GCC-exception", + "StandardML-NJ", + "WXwindows" ] diff --git a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/package.json b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/package.json index e38d0b5a9671c1..10bf00aeda094d 100644 --- a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/package.json +++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/package.json @@ -1,20 +1,64 @@ { - "name": "spdx-expression-parse", - "description": "parse SPDX license expressions", - "version": "1.0.0", + "_args": [ + [ + "spdx-expression-parse@~1.0.0", + "/Users/rebecca/code/npm/node_modules/validate-npm-package-license" + ] + ], + "_from": "spdx-expression-parse@>=1.0.0 <1.1.0", + "_id": "spdx-expression-parse@1.0.2", + "_inCache": true, + "_installable": true, + "_location": "/validate-npm-package-license/spdx-expression-parse", + "_nodeVersion": "5.0.0", + "_npmUser": { + "email": "kyle@kemitchell.com", + "name": "kemitchell" + }, + "_npmVersion": "3.3.6", + "_phantomChildren": {}, + "_requested": { + "name": "spdx-expression-parse", + "raw": "spdx-expression-parse@~1.0.0", + "rawSpec": "~1.0.0", + "scope": null, + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/validate-npm-package-license" + ], + "_resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.2.tgz", + "_shasum": "d52b14b5e9670771440af225bcb563122ac452f6", + "_shrinkwrap": null, + "_spec": "spdx-expression-parse@~1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/validate-npm-package-license", "author": { - "name": "Kyle E. Mitchell", "email": "kyle@kemitchell.com", + "name": "Kyle E. Mitchell", "url": "http://kemitchell.com" }, + "bugs": { + "url": "https://github.com/kemitchell/spdx-expression-parse.js/issues" + }, "dependencies": { - "spdx-exceptions": "^1.0.0", + "spdx-exceptions": "^1.0.4", "spdx-license-ids": "^1.0.0" }, + "description": "parse SPDX license expressions", "devDependencies": { "defence-cli": "^1.0.1", - "jison": "^0.4.15" + "jison": "^0.4.15", + "replace-require-self": "^1.0.0", + "uglify-js": "^2.4.24" + }, + "directories": {}, + "dist": { + "shasum": "d52b14b5e9670771440af225bcb563122ac452f6", + "tarball": "http://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.2.tgz" }, + "gitHead": "ffe2fa7272ebf640b18286fc561f17a844d4f06b", + "homepage": "https://github.com/kemitchell/spdx-expression-parse.js#readme", "keywords": [ "SPDX", "law", @@ -26,40 +70,23 @@ "standards" ], "license": "(MIT AND CC-BY-3.0)", - "repository": { - "type": "git", - "url": "git+https://github.com/kemitchell/spdx-expression-parse.js.git" - }, - "scripts": { - "generate": "node generate-parser.js > parser.generated.js", - "prepublish": "npm run generate", - "pretest": "npm run generate", - "test": "defence -i javascript README.md | node" - }, - "gitHead": "213bc03808f709a4ceaadb8466740a8c96c1e896", - "bugs": { - "url": "https://github.com/kemitchell/spdx-expression-parse.js/issues" - }, - "homepage": "https://github.com/kemitchell/spdx-expression-parse.js#readme", - "_id": "spdx-expression-parse@1.0.0", - "_shasum": "4fbb7e738c9e98fa0b0914dfd961ac6629fbcdef", - "_from": "spdx-expression-parse@>=1.0.0 <1.1.0", - "_npmVersion": "2.13.3", - "_nodeVersion": "0.12.7", - "_npmUser": { - "name": "kemitchell", - "email": "kyle@kemitchell.com" - }, - "dist": { - "shasum": "4fbb7e738c9e98fa0b0914dfd961ac6629fbcdef", - "tarball": "http://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.0.tgz" - }, "maintainers": [ { "name": "kemitchell", "email": "kyle@kemitchell.com" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.0.tgz" + "name": "spdx-expression-parse", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/kemitchell/spdx-expression-parse.js.git" + }, + "scripts": { + "prepublish": "node generate-parser.js | uglifyjs > parser.generated.js", + "pretest": "npm run prepublish", + "test": "defence -i javascript README.md | replace-require-self | node" + }, + "version": "1.0.2" } diff --git a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/parser.generated.js b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/parser.generated.js index 59747a3cf8735c..7d9665a86b2d28 100644 --- a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/parser.generated.js +++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/parser.generated.js @@ -1,1289 +1 @@ -/* parser generated by jison 0.4.15 */ -/* - Returns a Parser object of the following structure: - - Parser: { - yy: {} - } - - Parser.prototype: { - yy: {}, - trace: function(), - symbols_: {associative list: name ==> number}, - terminals_: {associative list: number ==> name}, - productions_: [...], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), - table: [...], - defaultActions: {...}, - parseError: function(str, hash), - parse: function(input), - - lexer: { - EOF: 1, - parseError: function(str, hash), - setInput: function(input), - input: function(), - unput: function(str), - more: function(), - less: function(n), - pastInput: function(), - upcomingInput: function(), - showPosition: function(), - test_match: function(regex_match_array, rule_index), - next: function(), - lex: function(), - begin: function(condition), - popState: function(), - _currentRules: function(), - topState: function(), - pushState: function(condition), - - options: { - ranges: boolean (optional: true ==> token location info will include a .range[] member) - flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) - backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) - }, - - performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), - rules: [...], - conditions: {associative list: name ==> set}, - } - } - - - token location info (@$, _$, etc.): { - first_line: n, - last_line: n, - first_column: n, - last_column: n, - range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) - } - - - the parseError function receives a 'hash' object with these members for lexer and parser errors: { - text: (matched text) - token: (the produced terminal token, if any) - line: (yylineno) - } - while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { - loc: (yylloc) - expected: (string describing the set of expected tokens) - recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) - } -*/ -var spdxparse = (function(){ -var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,5],$V1=[1,6],$V2=[1,7],$V3=[1,4],$V4=[1,9],$V5=[1,10],$V6=[5,14,15,17],$V7=[5,12,14,15,17]; -var parser = {trace: function trace() { }, -yy: {}, -symbols_: {"error":2,"start":3,"expression":4,"EOS":5,"simpleExpression":6,"LICENSE":7,"PLUS":8,"LICENSEREF":9,"DOCUMENTREF":10,"COLON":11,"WITH":12,"EXCEPTION":13,"AND":14,"OR":15,"OPEN":16,"CLOSE":17,"$accept":0,"$end":1}, -terminals_: {2:"error",5:"EOS",7:"LICENSE",8:"PLUS",9:"LICENSEREF",10:"DOCUMENTREF",11:"COLON",12:"WITH",13:"EXCEPTION",14:"AND",15:"OR",16:"OPEN",17:"CLOSE"}, -productions_: [0,[3,2],[6,1],[6,2],[6,1],[6,3],[4,1],[4,3],[4,3],[4,3],[4,3]], -performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { -/* this == yyval */ - -var $0 = $$.length - 1; -switch (yystate) { -case 1: -return this.$ = $$[$0-1]; -break; -case 2: case 4: case 5: -this.$ = { license: yytext }; -break; -case 3: -this.$ = { license: $$[$0-1], plus: true }; -break; -case 6: -this.$ = $$[$0]; -break; -case 7: -this.$ = { exception: $$[$0] }; -this.$.license = $$[$0-2].license; -if ($$[$0-2].hasOwnProperty('plus')) { - this.$.plus = $$[$0-2].plus; -} -break; -case 8: -this.$ = { conjunction: 'and', left: $$[$0-2], right: $$[$0] }; -break; -case 9: -this.$ = { conjunction: 'or', left: $$[$0-2], right: $$[$0] }; -break; -case 10: -this.$ = $$[$0-1] -break; -} -}, -table: [{3:1,4:2,6:3,7:$V0,9:$V1,10:$V2,16:$V3},{1:[3]},{5:[1,8],14:$V4,15:$V5},o($V6,[2,6],{12:[1,11]}),{4:12,6:3,7:$V0,9:$V1,10:$V2,16:$V3},o($V7,[2,2],{8:[1,13]}),o($V7,[2,4]),{11:[1,14]},{1:[2,1]},{4:15,6:3,7:$V0,9:$V1,10:$V2,16:$V3},{4:16,6:3,7:$V0,9:$V1,10:$V2,16:$V3},{13:[1,17]},{14:$V4,15:$V5,17:[1,18]},o($V7,[2,3]),{9:[1,19]},o($V6,[2,8]),o([5,15,17],[2,9],{14:$V4}),o($V6,[2,7]),o($V6,[2,10]),o($V7,[2,5])], -defaultActions: {8:[2,1]}, -parseError: function parseError(str, hash) { - if (hash.recoverable) { - this.trace(str); - } else { - throw new Error(str); - } -}, -parse: function parse(input) { - var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer; - sharedState.yy.parser = this; - if (typeof lexer.yylloc == 'undefined') { - lexer.yylloc = {}; - } - var yyloc = lexer.yylloc; - lstack.push(yyloc); - var ranges = lexer.options && lexer.options.ranges; - if (typeof sharedState.yy.parseError === 'function') { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; - } - function popStack(n) { - stack.length = stack.length - 2 * n; - vstack.length = vstack.length - n; - lstack.length = lstack.length - n; - } - _token_stack: - function lex() { - var token; - token = lexer.lex() || EOF; - if (typeof token !== 'number') { - token = self.symbols_[token] || token; - } - return token; - } - var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected; - while (true) { - state = stack[stack.length - 1]; - if (this.defaultActions[state]) { - action = this.defaultActions[state]; - } else { - if (symbol === null || typeof symbol == 'undefined') { - symbol = lex(); - } - action = table[state] && table[state][symbol]; - } - if (typeof action === 'undefined' || !action.length || !action[0]) { - var errStr = ''; - expected = []; - for (p in table[state]) { - if (this.terminals_[p] && p > TERROR) { - expected.push('\'' + this.terminals_[p] + '\''); - } - } - if (lexer.showPosition) { - errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; - } else { - errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); - } - this.parseError(errStr, { - text: lexer.match, - token: this.terminals_[symbol] || symbol, - line: lexer.yylineno, - loc: yyloc, - expected: expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer.yytext); - lstack.push(lexer.yylloc); - stack.push(action[1]); - symbol = null; - if (!preErrorSymbol) { - yyleng = lexer.yyleng; - yytext = lexer.yytext; - yylineno = lexer.yylineno; - yyloc = lexer.yylloc; - if (recovering > 0) { - recovering--; - } - } else { - symbol = preErrorSymbol; - preErrorSymbol = null; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== 'undefined') { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; - } - } - return true; -}}; -/* generated by jison-lex 0.3.4 */ -var lexer = (function(){ -var lexer = ({ - -EOF:1, - -parseError:function parseError(str, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str, hash); - } else { - throw new Error(str); - } - }, - -// resets the lexer, sets new input -setInput:function (input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ''; - this.conditionStack = ['INITIAL']; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0,0]; - } - this.offset = 0; - return this; - }, - -// consumes and returns one char from the input -input:function () { - var ch = this._input[0]; - this.yytext += ch; - this.yyleng++; - this.offset++; - this.match += ch; - this.matched += ch; - var lines = ch.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) { - this.yylloc.range[1]++; - } - - this._input = this._input.slice(1); - return ch; - }, - -// unshifts one char (or a string) into the input -unput:function (ch) { - var len = ch.length; - var lines = ch.split(/(?:\r\n?|\n)/g); - - this._input = ch + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - //this.yyleng -= len; - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? - (lines.length === oldLines.length ? this.yylloc.first_column : 0) - + oldLines[oldLines.length - lines.length].length - lines[0].length : - this.yylloc.first_column - len - }; - - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - this.yyleng = this.yytext.length; - return this; - }, - -// When called from action, caches matched text and appends it on next action -more:function () { - this._more = true; - return this; - }, - -// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. -reject:function () { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - - } - return this; - }, - -// retain first n characters of the match -less:function (n) { - this.unput(this.match.slice(n)); - }, - -// displays already matched input, i.e. for error messages -pastInput:function () { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); - }, - -// displays upcoming input, i.e. for error messages -upcomingInput:function () { - var next = this.match; - if (next.length < 20) { - next += this._input.substr(0, 20-next.length); - } - return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); - }, - -// displays the character position where the lexing error occurred, i.e. for error messages -showPosition:function () { - var pre = this.pastInput(); - var c = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c + "^"; - }, - -// test the lexed token: return FALSE when not a match, otherwise return token -test_match:function (match, indexed_rule) { - var token, - lines, - backup; - - if (this.options.backtrack_lexer) { - // save context - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); - } - } - - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; - } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? - lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : - this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token) { - return token; - } else if (this._backtrack) { - // recover context - for (var k in backup) { - this[k] = backup[k]; - } - return false; // rule action called reject() implying the next rule should be tested instead. - } - return false; - }, - -// return next match in input -next:function () { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - - var token, - match, - tempMatch, - index; - if (!this._more) { - this.yytext = ''; - this.match = ''; - } - var rules = this._currentRules(); - for (var i = 0; i < rules.length; i++) { - tempMatch = this._input.match(this.rules[rules[i]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = i; - if (this.options.backtrack_lexer) { - token = this.test_match(tempMatch, rules[i]); - if (token !== false) { - return token; - } else if (this._backtrack) { - match = false; - continue; // rule action called reject() implying a rule MISmatch. - } else { - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - } else if (!this.options.flex) { - break; - } - } - } - if (match) { - token = this.test_match(match, rules[index]); - if (token !== false) { - return token; - } - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - }, - -// return next match that has a token -lex:function lex() { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); - } - }, - -// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) -begin:function begin(condition) { - this.conditionStack.push(condition); - }, - -// pop the previously active lexer condition state off the condition stack -popState:function popState() { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; - } - }, - -// produce the lexer rule set which is active for the currently active lexer condition state -_currentRules:function _currentRules() { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; - } - }, - -// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available -topState:function topState(n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; - } - }, - -// alias for begin(condition) -pushState:function pushState(condition) { - this.begin(condition); - }, - -// return the number of states currently on the stack -stateStackSize:function stateStackSize() { - return this.conditionStack.length; - }, -options: {}, -performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { -var YYSTATE=YY_START; -switch($avoiding_name_collisions) { -case 0:return 5; -break; -case 1:/* skip whitespace */ -break; -case 2:return 8; -break; -case 3:return 16; -break; -case 4:return 17; -break; -case 5:return 11; -break; -case 6:return 10; -break; -case 7:return 9; -break; -case 8:return 14; -break; -case 9:return 15; -break; -case 10:return 12; -break; -case 11:return 7 -break; -case 12:return 7 -break; -case 13:return 7 -break; -case 14:return 7 -break; -case 15:return 7 -break; -case 16:return 7 -break; -case 17:return 7 -break; -case 18:return 7 -break; -case 19:return 7 -break; -case 20:return 7 -break; -case 21:return 7 -break; -case 22:return 7 -break; -case 23:return 7 -break; -case 24:return 7 -break; -case 25:return 7 -break; -case 26:return 7 -break; -case 27:return 7 -break; -case 28:return 7 -break; -case 29:return 7 -break; -case 30:return 7 -break; -case 31:return 7 -break; -case 32:return 7 -break; -case 33:return 7 -break; -case 34:return 7 -break; -case 35:return 7 -break; -case 36:return 7 -break; -case 37:return 7 -break; -case 38:return 7 -break; -case 39:return 7 -break; -case 40:return 7 -break; -case 41:return 7 -break; -case 42:return 7 -break; -case 43:return 7 -break; -case 44:return 7 -break; -case 45:return 7 -break; -case 46:return 7 -break; -case 47:return 7 -break; -case 48:return 7 -break; -case 49:return 7 -break; -case 50:return 7 -break; -case 51:return 7 -break; -case 52:return 7 -break; -case 53:return 7 -break; -case 54:return 7 -break; -case 55:return 7 -break; -case 56:return 7 -break; -case 57:return 7 -break; -case 58:return 7 -break; -case 59:return 7 -break; -case 60:return 7 -break; -case 61:return 7 -break; -case 62:return 7 -break; -case 63:return 7 -break; -case 64:return 7 -break; -case 65:return 7 -break; -case 66:return 7 -break; -case 67:return 7 -break; -case 68:return 7 -break; -case 69:return 7 -break; -case 70:return 7 -break; -case 71:return 7 -break; -case 72:return 7 -break; -case 73:return 7 -break; -case 74:return 7 -break; -case 75:return 7 -break; -case 76:return 7 -break; -case 77:return 7 -break; -case 78:return 7 -break; -case 79:return 7 -break; -case 80:return 7 -break; -case 81:return 7 -break; -case 82:return 7 -break; -case 83:return 7 -break; -case 84:return 7 -break; -case 85:return 7 -break; -case 86:return 7 -break; -case 87:return 7 -break; -case 88:return 7 -break; -case 89:return 7 -break; -case 90:return 7 -break; -case 91:return 7 -break; -case 92:return 7 -break; -case 93:return 7 -break; -case 94:return 7 -break; -case 95:return 7 -break; -case 96:return 7 -break; -case 97:return 7 -break; -case 98:return 7 -break; -case 99:return 7 -break; -case 100:return 7 -break; -case 101:return 7 -break; -case 102:return 7 -break; -case 103:return 7 -break; -case 104:return 7 -break; -case 105:return 7 -break; -case 106:return 7 -break; -case 107:return 7 -break; -case 108:return 7 -break; -case 109:return 7 -break; -case 110:return 7 -break; -case 111:return 7 -break; -case 112:return 7 -break; -case 113:return 7 -break; -case 114:return 7 -break; -case 115:return 7 -break; -case 116:return 7 -break; -case 117:return 7 -break; -case 118:return 7 -break; -case 119:return 7 -break; -case 120:return 7 -break; -case 121:return 7 -break; -case 122:return 7 -break; -case 123:return 7 -break; -case 124:return 7 -break; -case 125:return 7 -break; -case 126:return 7 -break; -case 127:return 7 -break; -case 128:return 7 -break; -case 129:return 7 -break; -case 130:return 7 -break; -case 131:return 7 -break; -case 132:return 7 -break; -case 133:return 7 -break; -case 134:return 7 -break; -case 135:return 7 -break; -case 136:return 7 -break; -case 137:return 7 -break; -case 138:return 7 -break; -case 139:return 7 -break; -case 140:return 7 -break; -case 141:return 7 -break; -case 142:return 7 -break; -case 143:return 7 -break; -case 144:return 7 -break; -case 145:return 7 -break; -case 146:return 7 -break; -case 147:return 7 -break; -case 148:return 7 -break; -case 149:return 7 -break; -case 150:return 7 -break; -case 151:return 7 -break; -case 152:return 7 -break; -case 153:return 7 -break; -case 154:return 7 -break; -case 155:return 7 -break; -case 156:return 7 -break; -case 157:return 7 -break; -case 158:return 7 -break; -case 159:return 7 -break; -case 160:return 7 -break; -case 161:return 7 -break; -case 162:return 7 -break; -case 163:return 7 -break; -case 164:return 7 -break; -case 165:return 7 -break; -case 166:return 7 -break; -case 167:return 7 -break; -case 168:return 7 -break; -case 169:return 7 -break; -case 170:return 7 -break; -case 171:return 7 -break; -case 172:return 7 -break; -case 173:return 7 -break; -case 174:return 7 -break; -case 175:return 7 -break; -case 176:return 7 -break; -case 177:return 7 -break; -case 178:return 7 -break; -case 179:return 7 -break; -case 180:return 7 -break; -case 181:return 7 -break; -case 182:return 7 -break; -case 183:return 7 -break; -case 184:return 7 -break; -case 185:return 7 -break; -case 186:return 7 -break; -case 187:return 7 -break; -case 188:return 7 -break; -case 189:return 7 -break; -case 190:return 7 -break; -case 191:return 7 -break; -case 192:return 7 -break; -case 193:return 7 -break; -case 194:return 7 -break; -case 195:return 7 -break; -case 196:return 7 -break; -case 197:return 7 -break; -case 198:return 7 -break; -case 199:return 7 -break; -case 200:return 7 -break; -case 201:return 7 -break; -case 202:return 7 -break; -case 203:return 7 -break; -case 204:return 7 -break; -case 205:return 7 -break; -case 206:return 7 -break; -case 207:return 7 -break; -case 208:return 7 -break; -case 209:return 7 -break; -case 210:return 7 -break; -case 211:return 7 -break; -case 212:return 7 -break; -case 213:return 7 -break; -case 214:return 7 -break; -case 215:return 7 -break; -case 216:return 7 -break; -case 217:return 7 -break; -case 218:return 7 -break; -case 219:return 7 -break; -case 220:return 7 -break; -case 221:return 7 -break; -case 222:return 7 -break; -case 223:return 7 -break; -case 224:return 7 -break; -case 225:return 7 -break; -case 226:return 7 -break; -case 227:return 7 -break; -case 228:return 7 -break; -case 229:return 7 -break; -case 230:return 7 -break; -case 231:return 7 -break; -case 232:return 7 -break; -case 233:return 7 -break; -case 234:return 7 -break; -case 235:return 7 -break; -case 236:return 7 -break; -case 237:return 7 -break; -case 238:return 7 -break; -case 239:return 7 -break; -case 240:return 7 -break; -case 241:return 7 -break; -case 242:return 7 -break; -case 243:return 7 -break; -case 244:return 7 -break; -case 245:return 7 -break; -case 246:return 7 -break; -case 247:return 7 -break; -case 248:return 7 -break; -case 249:return 7 -break; -case 250:return 7 -break; -case 251:return 7 -break; -case 252:return 7 -break; -case 253:return 7 -break; -case 254:return 7 -break; -case 255:return 7 -break; -case 256:return 7 -break; -case 257:return 7 -break; -case 258:return 7 -break; -case 259:return 7 -break; -case 260:return 7 -break; -case 261:return 7 -break; -case 262:return 7 -break; -case 263:return 7 -break; -case 264:return 7 -break; -case 265:return 7 -break; -case 266:return 7 -break; -case 267:return 7 -break; -case 268:return 7 -break; -case 269:return 7 -break; -case 270:return 7 -break; -case 271:return 7 -break; -case 272:return 7 -break; -case 273:return 7 -break; -case 274:return 7 -break; -case 275:return 7 -break; -case 276:return 7 -break; -case 277:return 7 -break; -case 278:return 7 -break; -case 279:return 7 -break; -case 280:return 7 -break; -case 281:return 7 -break; -case 282:return 7 -break; -case 283:return 7 -break; -case 284:return 7 -break; -case 285:return 7 -break; -case 286:return 7 -break; -case 287:return 7 -break; -case 288:return 7 -break; -case 289:return 7 -break; -case 290:return 7 -break; -case 291:return 7 -break; -case 292:return 7 -break; -case 293:return 7 -break; -case 294:return 7 -break; -case 295:return 7 -break; -case 296:return 7 -break; -case 297:return 7 -break; -case 298:return 7 -break; -case 299:return 7 -break; -case 300:return 7 -break; -case 301:return 7 -break; -case 302:return 7 -break; -case 303:return 7 -break; -case 304:return 7 -break; -case 305:return 7 -break; -case 306:return 7 -break; -case 307:return 7 -break; -case 308:return 7 -break; -case 309:return 7 -break; -case 310:return 7 -break; -case 311:return 7 -break; -case 312:return 13 -break; -case 313:return 13 -break; -case 314:return 13 -break; -case 315:return 13 -break; -case 316:return 13 -break; -case 317:return 13 -break; -case 318:return 13 -break; -case 319:return 13 -break; -case 320:return 13 -break; -case 321:return 13 -break; -case 322:return 13 -break; -case 323:return 13 -break; -case 324:return 13 -break; -case 325:return 13 -break; -case 326:return 13 -break; -case 327:return 13 -break; -case 328:return 13 -break; -case 329:return 13 -break; -case 330:return 13 -break; -case 331:return 13 -break; -case 332:return 13 -break; -case 333:return 13 -break; -} -}, -rules: [/^(?:$)/,/^(?:\s+)/,/^(?:\+)/,/^(?:\()/,/^(?:\))/,/^(?::)/,/^(?:DocumentRef-([0-9A-Za-z-+.]+))/,/^(?:LicenseRef-([0-9A-Za-z-+.]+))/,/^(?:AND)/,/^(?:OR)/,/^(?:WITH)/,/^(?:Glide)/,/^(?:Abstyles)/,/^(?:AFL-1.1)/,/^(?:AFL-1.2)/,/^(?:AFL-2.0)/,/^(?:AFL-2.1)/,/^(?:AFL-3.0)/,/^(?:AMPAS)/,/^(?:APL-1.0)/,/^(?:Adobe-Glyph)/,/^(?:APAFML)/,/^(?:Adobe-2006)/,/^(?:AGPL-1.0)/,/^(?:Afmparse)/,/^(?:Aladdin)/,/^(?:ADSL)/,/^(?:AMDPLPA)/,/^(?:ANTLR-PD)/,/^(?:Apache-1.0)/,/^(?:Apache-1.1)/,/^(?:Apache-2.0)/,/^(?:AML)/,/^(?:APSL-1.0)/,/^(?:APSL-1.1)/,/^(?:APSL-1.2)/,/^(?:APSL-2.0)/,/^(?:Artistic-1.0)/,/^(?:Artistic-1.0-Perl)/,/^(?:Artistic-1.0-cl8)/,/^(?:Artistic-2.0)/,/^(?:AAL)/,/^(?:Bahyph)/,/^(?:Barr)/,/^(?:Beerware)/,/^(?:BitTorrent-1.0)/,/^(?:BitTorrent-1.1)/,/^(?:BSL-1.0)/,/^(?:Borceux)/,/^(?:BSD-2-Clause)/,/^(?:BSD-2-Clause-FreeBSD)/,/^(?:BSD-2-Clause-NetBSD)/,/^(?:BSD-3-Clause)/,/^(?:BSD-3-Clause-Clear)/,/^(?:BSD-4-Clause)/,/^(?:BSD-Protection)/,/^(?:BSD-3-Clause-Attribution)/,/^(?:BSD-4-Clause-UC)/,/^(?:bzip2-1.0.5)/,/^(?:bzip2-1.0.6)/,/^(?:Caldera)/,/^(?:CECILL-1.0)/,/^(?:CECILL-1.1)/,/^(?:CECILL-2.0)/,/^(?:CECILL-B)/,/^(?:CECILL-C)/,/^(?:ClArtistic)/,/^(?:MIT-CMU)/,/^(?:CNRI-Jython)/,/^(?:CNRI-Python)/,/^(?:CNRI-Python-GPL-Compatible)/,/^(?:CPOL-1.02)/,/^(?:CDDL-1.0)/,/^(?:CDDL-1.1)/,/^(?:CPAL-1.0)/,/^(?:CPL-1.0)/,/^(?:CATOSL-1.1)/,/^(?:Condor-1.1)/,/^(?:CC-BY-1.0)/,/^(?:CC-BY-2.0)/,/^(?:CC-BY-2.5)/,/^(?:CC-BY-3.0)/,/^(?:CC-BY-4.0)/,/^(?:CC-BY-ND-1.0)/,/^(?:CC-BY-ND-2.0)/,/^(?:CC-BY-ND-2.5)/,/^(?:CC-BY-ND-3.0)/,/^(?:CC-BY-ND-4.0)/,/^(?:CC-BY-NC-1.0)/,/^(?:CC-BY-NC-2.0)/,/^(?:CC-BY-NC-2.5)/,/^(?:CC-BY-NC-3.0)/,/^(?:CC-BY-NC-4.0)/,/^(?:CC-BY-NC-ND-1.0)/,/^(?:CC-BY-NC-ND-2.0)/,/^(?:CC-BY-NC-ND-2.5)/,/^(?:CC-BY-NC-ND-3.0)/,/^(?:CC-BY-NC-ND-4.0)/,/^(?:CC-BY-NC-SA-1.0)/,/^(?:CC-BY-NC-SA-2.0)/,/^(?:CC-BY-NC-SA-2.5)/,/^(?:CC-BY-NC-SA-3.0)/,/^(?:CC-BY-NC-SA-4.0)/,/^(?:CC-BY-SA-1.0)/,/^(?:CC-BY-SA-2.0)/,/^(?:CC-BY-SA-2.5)/,/^(?:CC-BY-SA-3.0)/,/^(?:CC-BY-SA-4.0)/,/^(?:CC0-1.0)/,/^(?:Crossword)/,/^(?:CUA-OPL-1.0)/,/^(?:Cube)/,/^(?:D-FSL-1.0)/,/^(?:diffmark)/,/^(?:WTFPL)/,/^(?:DOC)/,/^(?:Dotseqn)/,/^(?:DSDP)/,/^(?:dvipdfm)/,/^(?:EPL-1.0)/,/^(?:ECL-1.0)/,/^(?:ECL-2.0)/,/^(?:eGenix)/,/^(?:EFL-1.0)/,/^(?:EFL-2.0)/,/^(?:MIT-advertising)/,/^(?:MIT-enna)/,/^(?:Entessa)/,/^(?:ErlPL-1.1)/,/^(?:EUDatagrid)/,/^(?:EUPL-1.0)/,/^(?:EUPL-1.1)/,/^(?:Eurosym)/,/^(?:Fair)/,/^(?:MIT-feh)/,/^(?:Frameworx-1.0)/,/^(?:FreeImage)/,/^(?:FTL)/,/^(?:FSFUL)/,/^(?:FSFULLR)/,/^(?:Giftware)/,/^(?:GL2PS)/,/^(?:Glulxe)/,/^(?:AGPL-3.0)/,/^(?:GFDL-1.1)/,/^(?:GFDL-1.2)/,/^(?:GFDL-1.3)/,/^(?:GPL-1.0)/,/^(?:GPL-2.0)/,/^(?:GPL-3.0)/,/^(?:LGPL-2.1)/,/^(?:LGPL-3.0)/,/^(?:LGPL-2.0)/,/^(?:gnuplot)/,/^(?:gSOAP-1.3b)/,/^(?:HaskellReport)/,/^(?:HPND)/,/^(?:IBM-pibs)/,/^(?:IPL-1.0)/,/^(?:ICU)/,/^(?:ImageMagick)/,/^(?:iMatix)/,/^(?:Imlib2)/,/^(?:IJG)/,/^(?:Intel-ACPI)/,/^(?:Intel)/,/^(?:IPA)/,/^(?:ISC)/,/^(?:JasPer-2.0)/,/^(?:JSON)/,/^(?:LPPL-1.3a)/,/^(?:LPPL-1.0)/,/^(?:LPPL-1.1)/,/^(?:LPPL-1.2)/,/^(?:LPPL-1.3c)/,/^(?:Latex2e)/,/^(?:BSD-3-Clause-LBNL)/,/^(?:Leptonica)/,/^(?:LGPLLR)/,/^(?:Libpng)/,/^(?:libtiff)/,/^(?:LPL-1.02)/,/^(?:LPL-1.0)/,/^(?:MakeIndex)/,/^(?:MTLL)/,/^(?:MS-PL)/,/^(?:MS-RL)/,/^(?:MirOS)/,/^(?:MITNFA)/,/^(?:MIT)/,/^(?:Motosoto)/,/^(?:MPL-1.0)/,/^(?:MPL-1.1)/,/^(?:MPL-2.0)/,/^(?:MPL-2.0-no-copyleft-exception)/,/^(?:mpich2)/,/^(?:Multics)/,/^(?:Mup)/,/^(?:NASA-1.3)/,/^(?:Naumen)/,/^(?:NBPL-1.0)/,/^(?:NetCDF)/,/^(?:NGPL)/,/^(?:NOSL)/,/^(?:NPL-1.0)/,/^(?:NPL-1.1)/,/^(?:Newsletr)/,/^(?:NLPL)/,/^(?:Nokia)/,/^(?:NPOSL-3.0)/,/^(?:Noweb)/,/^(?:NRL)/,/^(?:NTP)/,/^(?:Nunit)/,/^(?:OCLC-2.0)/,/^(?:ODbL-1.0)/,/^(?:PDDL-1.0)/,/^(?:OGTSL)/,/^(?:OLDAP-2.2.2)/,/^(?:OLDAP-1.1)/,/^(?:OLDAP-1.2)/,/^(?:OLDAP-1.3)/,/^(?:OLDAP-1.4)/,/^(?:OLDAP-2.0)/,/^(?:OLDAP-2.0.1)/,/^(?:OLDAP-2.1)/,/^(?:OLDAP-2.2)/,/^(?:OLDAP-2.2.1)/,/^(?:OLDAP-2.3)/,/^(?:OLDAP-2.4)/,/^(?:OLDAP-2.5)/,/^(?:OLDAP-2.6)/,/^(?:OLDAP-2.7)/,/^(?:OLDAP-2.8)/,/^(?:OML)/,/^(?:OPL-1.0)/,/^(?:OSL-1.0)/,/^(?:OSL-1.1)/,/^(?:OSL-2.0)/,/^(?:OSL-2.1)/,/^(?:OSL-3.0)/,/^(?:OpenSSL)/,/^(?:PHP-3.0)/,/^(?:PHP-3.01)/,/^(?:Plexus)/,/^(?:PostgreSQL)/,/^(?:psfrag)/,/^(?:psutils)/,/^(?:Python-2.0)/,/^(?:QPL-1.0)/,/^(?:Qhull)/,/^(?:Rdisc)/,/^(?:RPSL-1.0)/,/^(?:RPL-1.1)/,/^(?:RPL-1.5)/,/^(?:RHeCos-1.1)/,/^(?:RSCPL)/,/^(?:RSA-MD)/,/^(?:Ruby)/,/^(?:SAX-PD)/,/^(?:Saxpath)/,/^(?:SCEA)/,/^(?:SWL)/,/^(?:SGI-B-1.0)/,/^(?:SGI-B-1.1)/,/^(?:SGI-B-2.0)/,/^(?:OFL-1.0)/,/^(?:OFL-1.1)/,/^(?:SimPL-2.0)/,/^(?:Sleepycat)/,/^(?:SNIA)/,/^(?:Spencer-86)/,/^(?:Spencer-94)/,/^(?:Spencer-99)/,/^(?:SMLNJ)/,/^(?:SugarCRM-1.1.3)/,/^(?:SISSL)/,/^(?:SISSL-1.2)/,/^(?:SPL-1.0)/,/^(?:Watcom-1.0)/,/^(?:TCL)/,/^(?:Unlicense)/,/^(?:TMate)/,/^(?:TORQUE-1.1)/,/^(?:TOSL)/,/^(?:Unicode-TOU)/,/^(?:UPL-1.0)/,/^(?:NCSA)/,/^(?:Vim)/,/^(?:VOSTROM)/,/^(?:VSL-1.0)/,/^(?:W3C-19980720)/,/^(?:W3C)/,/^(?:Wsuipa)/,/^(?:Xnet)/,/^(?:X11)/,/^(?:Xerox)/,/^(?:XFree86-1.1)/,/^(?:xinetd)/,/^(?:xpp)/,/^(?:XSkat)/,/^(?:YPL-1.0)/,/^(?:YPL-1.1)/,/^(?:Zed)/,/^(?:Zend-2.0)/,/^(?:Zimbra-1.3)/,/^(?:Zimbra-1.4)/,/^(?:Zlib)/,/^(?:zlib-acknowledgement)/,/^(?:ZPL-1.1)/,/^(?:ZPL-2.0)/,/^(?:ZPL-2.1)/,/^(?:389-exception)/,/^(?:Autoconf-exception-2.0 )/,/^(?:Autoconf-exception-3.0 )/,/^(?:Bison-exception-2.2)/,/^(?:CLISP-exception-2.0)/,/^(?:Classpath-exception-2.0)/,/^(?:FLTK-exception )/,/^(?:FLTK-exception-2.0 )/,/^(?:Font-exception-2.0 )/,/^(?:GCC-exception-2.0)/,/^(?:GCC-exception-3.1)/,/^(?:LZMA-exception )/,/^(?:Libtool-exception)/,/^(?:Nokia-Qt-exception-1.1 )/,/^(?:Qwt-exception-1.0)/,/^(?:WxWindows-exception-3.1)/,/^(?:eCos-exception-2.0 )/,/^(?:freertos-exception-2.0 )/,/^(?:gnu-javamail-exception )/,/^(?:i2p-gpl-java-exception )/,/^(?:mif-exception)/,/^(?:u-boot-exception-2.0 )/], -conditions: {"INITIAL":{"rules":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333],"inclusive":true}} -}); -return lexer; -})(); -parser.lexer = lexer; -function Parser () { - this.yy = {}; -} -Parser.prototype = parser;parser.Parser = Parser; -return new Parser; -})(); - - -if (typeof require !== 'undefined' && typeof exports !== 'undefined') { -exports.parser = spdxparse; -exports.Parser = spdxparse.Parser; -exports.parse = function () { return spdxparse.parse.apply(spdxparse, arguments); }; -exports.main = function commonjsMain(args) { - if (!args[1]) { - console.log('Usage: '+args[0]+' FILE'); - process.exit(1); - } - var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8"); - return exports.parser.parse(source); -}; -if (typeof module !== 'undefined' && require.main === module) { - exports.main(process.argv.slice(1)); -} -} +var spdxparse=function(){var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,5],$V1=[1,6],$V2=[1,7],$V3=[1,4],$V4=[1,9],$V5=[1,10],$V6=[5,14,15,17],$V7=[5,12,14,15,17];var parser={trace:function trace(){},yy:{},symbols_:{error:2,start:3,expression:4,EOS:5,simpleExpression:6,LICENSE:7,PLUS:8,LICENSEREF:9,DOCUMENTREF:10,COLON:11,WITH:12,EXCEPTION:13,AND:14,OR:15,OPEN:16,CLOSE:17,$accept:0,$end:1},terminals_:{2:"error",5:"EOS",7:"LICENSE",8:"PLUS",9:"LICENSEREF",10:"DOCUMENTREF",11:"COLON",12:"WITH",13:"EXCEPTION",14:"AND",15:"OR",16:"OPEN",17:"CLOSE"},productions_:[0,[3,2],[6,1],[6,2],[6,1],[6,3],[4,1],[4,3],[4,3],[4,3],[4,3]],performAction:function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$){var $0=$$.length-1;switch(yystate){case 1:return this.$=$$[$0-1];break;case 2:case 4:case 5:this.$={license:yytext};break;case 3:this.$={license:$$[$0-1],plus:true};break;case 6:this.$=$$[$0];break;case 7:this.$={exception:$$[$0]};this.$.license=$$[$0-2].license;if($$[$0-2].hasOwnProperty("plus")){this.$.plus=$$[$0-2].plus}break;case 8:this.$={conjunction:"and",left:$$[$0-2],right:$$[$0]};break;case 9:this.$={conjunction:"or",left:$$[$0-2],right:$$[$0]};break;case 10:this.$=$$[$0-1];break}},table:[{3:1,4:2,6:3,7:$V0,9:$V1,10:$V2,16:$V3},{1:[3]},{5:[1,8],14:$V4,15:$V5},o($V6,[2,6],{12:[1,11]}),{4:12,6:3,7:$V0,9:$V1,10:$V2,16:$V3},o($V7,[2,2],{8:[1,13]}),o($V7,[2,4]),{11:[1,14]},{1:[2,1]},{4:15,6:3,7:$V0,9:$V1,10:$V2,16:$V3},{4:16,6:3,7:$V0,9:$V1,10:$V2,16:$V3},{13:[1,17]},{14:$V4,15:$V5,17:[1,18]},o($V7,[2,3]),{9:[1,19]},o($V6,[2,8]),o([5,15,17],[2,9],{14:$V4}),o($V6,[2,7]),o($V6,[2,10]),o($V7,[2,5])],defaultActions:{8:[2,1]},parseError:function parseError(str,hash){if(hash.recoverable){this.trace(str)}else{throw new Error(str)}},parse:function parse(input){var self=this,stack=[0],tstack=[],vstack=[null],lstack=[],table=this.table,yytext="",yylineno=0,yyleng=0,recovering=0,TERROR=2,EOF=1;var args=lstack.slice.call(arguments,1);var lexer=Object.create(this.lexer);var sharedState={yy:{}};for(var k in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,k)){sharedState.yy[k]=this.yy[k]}}lexer.setInput(input,sharedState.yy);sharedState.yy.lexer=lexer;sharedState.yy.parser=this;if(typeof lexer.yylloc=="undefined"){lexer.yylloc={}}var yyloc=lexer.yylloc;lstack.push(yyloc);var ranges=lexer.options&&lexer.options.ranges;if(typeof sharedState.yy.parseError==="function"){this.parseError=sharedState.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function popStack(n){stack.length=stack.length-2*n;vstack.length=vstack.length-n;lstack.length=lstack.length-n}_token_stack:function lex(){var token;token=lexer.lex()||EOF;if(typeof token!=="number"){token=self.symbols_[token]||token}return token}var symbol,preErrorSymbol,state,action,a,r,yyval={},p,len,newState,expected;while(true){state=stack[stack.length-1];if(this.defaultActions[state]){action=this.defaultActions[state]}else{if(symbol===null||typeof symbol=="undefined"){symbol=lex()}action=table[state]&&table[state][symbol]}if(typeof action==="undefined"||!action.length||!action[0]){var errStr="";expected=[];for(p in table[state]){if(this.terminals_[p]&&p>TERROR){expected.push("'"+this.terminals_[p]+"'")}}if(lexer.showPosition){errStr="Parse error on line "+(yylineno+1)+":\n"+lexer.showPosition()+"\nExpecting "+expected.join(", ")+", got '"+(this.terminals_[symbol]||symbol)+"'"}else{errStr="Parse error on line "+(yylineno+1)+": Unexpected "+(symbol==EOF?"end of input":"'"+(this.terminals_[symbol]||symbol)+"'")}this.parseError(errStr,{text:lexer.match,token:this.terminals_[symbol]||symbol,line:lexer.yylineno,loc:yyloc,expected:expected})}if(action[0]instanceof Array&&action.length>1){throw new Error("Parse Error: multiple actions possible at state: "+state+", token: "+symbol)}switch(action[0]){case 1:stack.push(symbol);vstack.push(lexer.yytext);lstack.push(lexer.yylloc);stack.push(action[1]);symbol=null;if(!preErrorSymbol){yyleng=lexer.yyleng;yytext=lexer.yytext;yylineno=lexer.yylineno;yyloc=lexer.yylloc;if(recovering>0){recovering--}}else{symbol=preErrorSymbol;preErrorSymbol=null}break;case 2:len=this.productions_[action[1]][1];yyval.$=vstack[vstack.length-len];yyval._$={first_line:lstack[lstack.length-(len||1)].first_line,last_line:lstack[lstack.length-1].last_line,first_column:lstack[lstack.length-(len||1)].first_column,last_column:lstack[lstack.length-1].last_column};if(ranges){yyval._$.range=[lstack[lstack.length-(len||1)].range[0],lstack[lstack.length-1].range[1]]}r=this.performAction.apply(yyval,[yytext,yyleng,yylineno,sharedState.yy,action[1],vstack,lstack].concat(args));if(typeof r!=="undefined"){return r}if(len){stack=stack.slice(0,-1*len*2);vstack=vstack.slice(0,-1*len);lstack=lstack.slice(0,-1*len)}stack.push(this.productions_[action[1]][0]);vstack.push(yyval.$);lstack.push(yyval._$);newState=table[stack[stack.length-2]][stack[stack.length-1]];stack.push(newState);break;case 3:return true}}return true}};var lexer=function(){var lexer={EOF:1,parseError:function parseError(str,hash){if(this.yy.parser){this.yy.parser.parseError(str,hash)}else{throw new Error(str)}},setInput:function(input,yy){this.yy=yy||this.yy||{};this._input=input;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this},input:function(){var ch=this._input[0];this.yytext+=ch;this.yyleng++;this.offset++;this.match+=ch;this.matched+=ch;var lines=ch.match(/(?:\r\n?|\n).*/g);if(lines){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return ch},unput:function(ch){var len=ch.length;var lines=ch.split(/(?:\r\n?|\n)/g);this._input=ch+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-len);this.offset-=len;var oldLines=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(lines.length-1){this.yylineno-=lines.length-1}var r=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:lines?(lines.length===oldLines.length?this.yylloc.first_column:0)+oldLines[oldLines.length-lines.length].length-lines[0].length:this.yylloc.first_column-len};if(this.options.ranges){this.yylloc.range=[r[0],r[0]+this.yyleng-len]}this.yyleng=this.yytext.length;return this},more:function(){this._more=true;return this},reject:function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this},less:function(n){this.unput(this.match.slice(n))},pastInput:function(){var past=this.matched.substr(0,this.matched.length-this.match.length);return(past.length>20?"...":"")+past.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var next=this.match;if(next.length<20){next+=this._input.substr(0,20-next.length)}return(next.substr(0,20)+(next.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var pre=this.pastInput();var c=new Array(pre.length+1).join("-");return pre+this.upcomingInput()+"\n"+c+"^"},test_match:function(match,indexed_rule){var token,lines,backup;if(this.options.backtrack_lexer){backup={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){backup.yylloc.range=this.yylloc.range.slice(0)}}lines=match[0].match(/(?:\r\n?|\n).*/g);if(lines){this.yylineno+=lines.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:lines?lines[lines.length-1].length-lines[lines.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+match[0].length};this.yytext+=match[0];this.match+=match[0];this.matches=match;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(match[0].length);this.matched+=match[0];token=this.performAction.call(this,this.yy,this,indexed_rule,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(token){return token}else if(this._backtrack){for(var k in backup){this[k]=backup[k]}return false}return false},next:function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var token,match,tempMatch,index;if(!this._more){this.yytext="";this.match=""}var rules=this._currentRules();for(var i=0;imatch[0].length)){match=tempMatch;index=i;if(this.options.backtrack_lexer){token=this.test_match(tempMatch,rules[i]);if(token!==false){return token}else if(this._backtrack){match=false;continue}else{return false}}else if(!this.options.flex){break}}}if(match){token=this.test_match(match,rules[index]);if(token!==false){return token}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},lex:function lex(){var r=this.next();if(r){return r}else{return this.lex()}},begin:function begin(condition){this.conditionStack.push(condition)},popState:function popState(){var n=this.conditionStack.length-1;if(n>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}},_currentRules:function _currentRules(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}},topState:function topState(n){n=this.conditionStack.length-1-Math.abs(n||0);if(n>=0){return this.conditionStack[n]}else{return"INITIAL"}},pushState:function pushState(condition){this.begin(condition)},stateStackSize:function stateStackSize(){return this.conditionStack.length},options:{},performAction:function anonymous(yy,yy_,$avoiding_name_collisions,YY_START){var YYSTATE=YY_START;switch($avoiding_name_collisions){case 0:return 5;break;case 1:break;case 2:return 8;break;case 3:return 16;break;case 4:return 17;break;case 5:return 11;break;case 6:return 10;break;case 7:return 9;break;case 8:return 14;break;case 9:return 15;break;case 10:return 12;break;case 11:return 7;break;case 12:return 7;break;case 13:return 7;break;case 14:return 13;break;case 15:return 13;break;case 16:return 13;break;case 17:return 13;break;case 18:return 13;break;case 19:return 13;break;case 20:return 13;break;case 21:return 13;break;case 22:return 7;break;case 23:return 7;break;case 24:return 13;break;case 25:return 13;break;case 26:return 13;break;case 27:return 7;break;case 28:return 13;break;case 29:return 13;break;case 30:return 13;break;case 31:return 7;break;case 32:return 7;break;case 33:return 13;break;case 34:return 13;break;case 35:return 13;break;case 36:return 7;break;case 37:return 13;break;case 38:return 7;break;case 39:return 7;break;case 40:return 7;break;case 41:return 7;break;case 42:return 7;break;case 43:return 7;break;case 44:return 7;break;case 45:return 7;break;case 46:return 7;break;case 47:return 7;break;case 48:return 7;break;case 49:return 7;break;case 50:return 7;break;case 51:return 13;break;case 52:return 7;break;case 53:return 7;break;case 54:return 7;break;case 55:return 13;break;case 56:return 7;break;case 57:return 7;break;case 58:return 7;break;case 59:return 13;break;case 60:return 7;break;case 61:return 13;break;case 62:return 7;break;case 63:return 7;break;case 64:return 7;break;case 65:return 7;break;case 66:return 7;break;case 67:return 7;break;case 68:return 7;break;case 69:return 7;break;case 70:return 7;break;case 71:return 7;break;case 72:return 7;break;case 73:return 7;break;case 74:return 7;break;case 75:return 7;break;case 76:return 7;break;case 77:return 7;break;case 78:return 7;break;case 79:return 7;break;case 80:return 7;break;case 81:return 7;break;case 82:return 7;break;case 83:return 7;break;case 84:return 7;break;case 85:return 7;break;case 86:return 7;break;case 87:return 7;break;case 88:return 7;break;case 89:return 7;break;case 90:return 7;break;case 91:return 7;break;case 92:return 7;break;case 93:return 7;break;case 94:return 7;break;case 95:return 7;break;case 96:return 7;break;case 97:return 7;break;case 98:return 7;break;case 99:return 7;break;case 100:return 7;break;case 101:return 7;break;case 102:return 7;break;case 103:return 7;break;case 104:return 7;break;case 105:return 7;break;case 106:return 7;break;case 107:return 7;break;case 108:return 7;break;case 109:return 7;break;case 110:return 7;break;case 111:return 7;break;case 112:return 7;break;case 113:return 7;break;case 114:return 7;break;case 115:return 7;break;case 116:return 7;break;case 117:return 7;break;case 118:return 7;break;case 119:return 7;break;case 120:return 7;break;case 121:return 7;break;case 122:return 7;break;case 123:return 7;break;case 124:return 7;break;case 125:return 7;break;case 126:return 7;break;case 127:return 7;break;case 128:return 7;break;case 129:return 7;break;case 130:return 7;break;case 131:return 7;break;case 132:return 7;break;case 133:return 7;break;case 134:return 7;break;case 135:return 7;break;case 136:return 7;break;case 137:return 7;break;case 138:return 7;break;case 139:return 7;break;case 140:return 7;break;case 141:return 7;break;case 142:return 7;break;case 143:return 7;break;case 144:return 7;break;case 145:return 7;break;case 146:return 7;break;case 147:return 7;break;case 148:return 7;break;case 149:return 7;break;case 150:return 7;break;case 151:return 7;break;case 152:return 7;break;case 153:return 7;break;case 154:return 7;break;case 155:return 7;break;case 156:return 7;break;case 157:return 7;break;case 158:return 7;break;case 159:return 7;break;case 160:return 7;break;case 161:return 7;break;case 162:return 7;break;case 163:return 7;break;case 164:return 7;break;case 165:return 7;break;case 166:return 7;break;case 167:return 7;break;case 168:return 7;break;case 169:return 7;break;case 170:return 7;break;case 171:return 7;break;case 172:return 7;break;case 173:return 7;break;case 174:return 7;break;case 175:return 7;break;case 176:return 7;break;case 177:return 7;break;case 178:return 7;break;case 179:return 7;break;case 180:return 7;break;case 181:return 7;break;case 182:return 7;break;case 183:return 7;break;case 184:return 7;break;case 185:return 7;break;case 186:return 7;break;case 187:return 7;break;case 188:return 7;break;case 189:return 7;break;case 190:return 7;break;case 191:return 7;break;case 192:return 7;break;case 193:return 7;break;case 194:return 7;break;case 195:return 7;break;case 196:return 7;break;case 197:return 7;break;case 198:return 7;break;case 199:return 7;break;case 200:return 7;break;case 201:return 7;break;case 202:return 7;break;case 203:return 7;break;case 204:return 7;break;case 205:return 7;break;case 206:return 7;break;case 207:return 7;break;case 208:return 7;break;case 209:return 7;break;case 210:return 7;break;case 211:return 7;break;case 212:return 7;break;case 213:return 7;break;case 214:return 7;break;case 215:return 7;break;case 216:return 7;break;case 217:return 7;break;case 218:return 7;break;case 219:return 7;break;case 220:return 7;break;case 221:return 7;break;case 222:return 7;break;case 223:return 7;break;case 224:return 7;break;case 225:return 7;break;case 226:return 7;break;case 227:return 7;break;case 228:return 7;break;case 229:return 7;break;case 230:return 7;break;case 231:return 7;break;case 232:return 7;break;case 233:return 7;break;case 234:return 7;break;case 235:return 7;break;case 236:return 7;break;case 237:return 7;break;case 238:return 7;break;case 239:return 7;break;case 240:return 7;break;case 241:return 7;break;case 242:return 7;break;case 243:return 7;break;case 244:return 7;break;case 245:return 7;break;case 246:return 7;break;case 247:return 7;break;case 248:return 7;break;case 249:return 7;break;case 250:return 7;break;case 251:return 7;break;case 252:return 7;break;case 253:return 7;break;case 254:return 7;break;case 255:return 7;break;case 256:return 7;break;case 257:return 7;break;case 258:return 7;break;case 259:return 7;break;case 260:return 7;break;case 261:return 7;break;case 262:return 7;break;case 263:return 7;break;case 264:return 7;break;case 265:return 7;break;case 266:return 7;break;case 267:return 7;break;case 268:return 7;break;case 269:return 7;break;case 270:return 7;break;case 271:return 7;break;case 272:return 7;break;case 273:return 7;break;case 274:return 7;break;case 275:return 7;break;case 276:return 7;break;case 277:return 7;break;case 278:return 7;break;case 279:return 7;break;case 280:return 7;break;case 281:return 7;break;case 282:return 7;break;case 283:return 7;break;case 284:return 7;break;case 285:return 7;break;case 286:return 7;break;case 287:return 7;break;case 288:return 7;break;case 289:return 7;break;case 290:return 7;break;case 291:return 7;break;case 292:return 7;break;case 293:return 7;break;case 294:return 7;break;case 295:return 7;break;case 296:return 7;break;case 297:return 7;break;case 298:return 7;break;case 299:return 7;break;case 300:return 7;break;case 301:return 7;break;case 302:return 7;break;case 303:return 7;break;case 304:return 7;break;case 305:return 7;break;case 306:return 7;break;case 307:return 7;break;case 308:return 7;break;case 309:return 7;break;case 310:return 7;break;case 311:return 7;break;case 312:return 7;break;case 313:return 7;break;case 314:return 7;break;case 315:return 7;break;case 316:return 7;break;case 317:return 7;break;case 318:return 7;break;case 319:return 7;break;case 320:return 7;break;case 321:return 7;break;case 322:return 7;break;case 323:return 7;break;case 324:return 7;break;case 325:return 7;break;case 326:return 7;break;case 327:return 7;break;case 328:return 7;break;case 329:return 7;break;case 330:return 7;break;case 331:return 7;break;case 332:return 7;break;case 333:return 7;break;case 334:return 7;break;case 335:return 7;break;case 336:return 7;break;case 337:return 7;break;case 338:return 7;break}},rules:[/^(?:$)/,/^(?:\s+)/,/^(?:\+)/,/^(?:\()/,/^(?:\))/,/^(?::)/,/^(?:DocumentRef-([0-9A-Za-z-+.]+))/,/^(?:LicenseRef-([0-9A-Za-z-+.]+))/,/^(?:AND)/,/^(?:OR)/,/^(?:WITH)/,/^(?:MPL-2\.0-no-copyleft-exception)/,/^(?:CNRI-Python-GPL-Compatible)/,/^(?:BSD-3-Clause-Attribution)/,/^(?:WxWindows-exception-3\.1)/,/^(?:Classpath-exception-2\.0)/,/^(?:gnu-javamail-exception)/,/^(?:freertos-exception-2\.0)/,/^(?:i2p-gpl-java-exception)/,/^(?:Autoconf-exception-2\.0)/,/^(?:Nokia-Qt-exception-1\.1)/,/^(?:Autoconf-exception-3\.0)/,/^(?:zlib-acknowledgement)/,/^(?:BSD-2-Clause-FreeBSD)/,/^(?:u-boot-exception-2\.0)/,/^(?:Bison-exception-2\.2)/,/^(?:CLISP-exception-2\.0)/,/^(?:BSD-2-Clause-NetBSD)/,/^(?:FLTK-exception-2\.0)/,/^(?:eCos-exception-2\.0)/,/^(?:Font-exception-2\.0)/,/^(?:BSD-3-Clause-Clear)/,/^(?:BSD-3-Clause-LBNL)/,/^(?:GCC-exception-3\.1)/,/^(?:Qwt-exception-1\.0)/,/^(?:GCC-exception-2\.0)/,/^(?:Artistic-1\.0-Perl)/,/^(?:Libtool-exception)/,/^(?:Artistic-1\.0-cl8)/,/^(?:CC-BY-NC-SA-4\.0)/,/^(?:CC-BY-NC-SA-1\.0)/,/^(?:CC-BY-NC-ND-4\.0)/,/^(?:CC-BY-NC-SA-3\.0)/,/^(?:CC-BY-NC-ND-3\.0)/,/^(?:CC-BY-NC-SA-2\.5)/,/^(?:CC-BY-NC-ND-2\.0)/,/^(?:CC-BY-NC-ND-1\.0)/,/^(?:CC-BY-NC-SA-2\.0)/,/^(?:MIT-advertising)/,/^(?:BSD-4-Clause-UC)/,/^(?:CC-BY-NC-ND-2\.5)/,/^(?:FLTK-exception)/,/^(?:SugarCRM-1\.1\.3)/,/^(?:CrystalStacker)/,/^(?:BSD-Protection)/,/^(?:LZMA-exception)/,/^(?:BitTorrent-1\.1)/,/^(?:BitTorrent-1\.0)/,/^(?:Frameworx-1\.0)/,/^(?:mif-exception)/,/^(?:Interbase-1\.0)/,/^(?:389-exception)/,/^(?:HaskellReport)/,/^(?:CC-BY-NC-3\.0)/,/^(?:CC-BY-ND-4\.0)/,/^(?:CC-BY-NC-1\.0)/,/^(?:CC-BY-NC-2\.0)/,/^(?:CC-BY-NC-2\.5)/,/^(?:CC-BY-SA-4\.0)/,/^(?:CC-BY-NC-4\.0)/,/^(?:W3C-19980720)/,/^(?:BSD-4-Clause)/,/^(?:Artistic-1\.0)/,/^(?:BSD-3-Clause)/,/^(?:CC-BY-ND-1\.0)/,/^(?:BSD-2-Clause)/,/^(?:CC-BY-ND-2\.0)/,/^(?:CC-BY-ND-2\.5)/,/^(?:CC-BY-ND-3\.0)/,/^(?:Artistic-2\.0)/,/^(?:CC-BY-SA-1\.0)/,/^(?:CC-BY-SA-2\.0)/,/^(?:CC-BY-SA-2\.5)/,/^(?:CC-BY-SA-3\.0)/,/^(?:XFree86-1\.1)/,/^(?:OLDAP-2\.0\.1)/,/^(?:bzip2-1\.0\.6)/,/^(?:OLDAP-2\.2\.1)/,/^(?:ImageMagick)/,/^(?:Unicode-TOU)/,/^(?:Adobe-Glyph)/,/^(?:CUA-OPL-1\.0)/,/^(?:CNRI-Jython)/,/^(?:CNRI-Python)/,/^(?:bzip2-1\.0\.5)/,/^(?:OLDAP-2\.2\.2)/,/^(?:PostgreSQL)/,/^(?:Apache-1\.1)/,/^(?:CECILL-1\.0)/,/^(?:Apache-2\.0)/,/^(?:Zimbra-1\.4)/,/^(?:CECILL-1\.1)/,/^(?:Zimbra-1\.3)/,/^(?:Adobe-2006)/,/^(?:JasPer-2\.0)/,/^(?:CECILL-2\.0)/,/^(?:TORQUE-1\.1)/,/^(?:CECILL-2\.1)/,/^(?:Watcom-1\.0)/,/^(?:Intel-ACPI)/,/^(?:ClArtistic)/,/^(?:Spencer-99)/,/^(?:Condor-1\.1)/,/^(?:Spencer-94)/,/^(?:gSOAP-1\.3b)/,/^(?:EUDatagrid)/,/^(?:Spencer-86)/,/^(?:Python-2\.0)/,/^(?:RHeCos-1\.1)/,/^(?:CATOSL-1\.1)/,/^(?:Apache-1\.0)/,/^(?:FreeImage)/,/^(?:SGI-B-1\.1)/,/^(?:SGI-B-1\.0)/,/^(?:SimPL-2\.0)/,/^(?:Sleepycat)/,/^(?:Crossword)/,/^(?:ErlPL-1\.1)/,/^(?:CPOL-1\.02)/,/^(?:OLDAP-2\.8)/,/^(?:OLDAP-2\.7)/,/^(?:OLDAP-2\.6)/,/^(?:CC-BY-1\.0)/,/^(?:OLDAP-2\.5)/,/^(?:OLDAP-2\.4)/,/^(?:OLDAP-2\.3)/,/^(?:SISSL-1\.2)/,/^(?:Unlicense)/,/^(?:SGI-B-2\.0)/,/^(?:OLDAP-2\.2)/,/^(?:OLDAP-2\.1)/,/^(?:CC-BY-2\.5)/,/^(?:D-FSL-1\.0)/,/^(?:LPPL-1\.3a)/,/^(?:LPPL-1\.3c)/,/^(?:OLDAP-2\.0)/,/^(?:CC-BY-3\.0)/,/^(?:Leptonica)/,/^(?:OLDAP-1\.4)/,/^(?:OLDAP-1\.3)/,/^(?:OLDAP-1\.2)/,/^(?:OLDAP-1\.1)/,/^(?:MakeIndex)/,/^(?:CC-BY-4\.0)/,/^(?:NPOSL-3\.0)/,/^(?:CC-BY-2\.0)/,/^(?:PHP-3\.01)/,/^(?:ANTLR-PD)/,/^(?:APSL-1\.0)/,/^(?:MIT-enna)/,/^(?:IBM-pibs)/,/^(?:APSL-1\.1)/,/^(?:APSL-1\.2)/,/^(?:Beerware)/,/^(?:EUPL-1\.0)/,/^(?:EUPL-1\.1)/,/^(?:diffmark)/,/^(?:CDDL-1\.0)/,/^(?:Zend-2\.0)/,/^(?:CDDL-1\.1)/,/^(?:CPAL-1\.0)/,/^(?:APSL-2\.0)/,/^(?:LPPL-1\.0)/,/^(?:AGPL-1\.0)/,/^(?:Giftware)/,/^(?:Abstyles)/,/^(?:LPPL-1\.1)/,/^(?:LPPL-1\.2)/,/^(?:Sendmail)/,/^(?:CECILL-B)/,/^(?:AGPL-3\.0)/,/^(?:GFDL-1\.1)/,/^(?:GFDL-1\.2)/,/^(?:GFDL-1\.3)/,/^(?:RPSL-1\.0)/,/^(?:LPL-1\.02)/,/^(?:CECILL-C)/,/^(?:Afmparse)/,/^(?:LGPL-2\.1)/,/^(?:PDDL-1\.0)/,/^(?:ODbL-1\.0)/,/^(?:OCLC-2\.0)/,/^(?:LGPL-3\.0)/,/^(?:Newsletr)/,/^(?:Motosoto)/,/^(?:NBPL-1\.0)/,/^(?:NASA-1\.3)/,/^(?:LGPL-2\.0)/,/^(?:FSFULLR)/,/^(?:MPL-2\.0)/,/^(?:Multics)/,/^(?:AFL-1\.1)/,/^(?:MPL-1\.1)/,/^(?:AFL-1\.2)/,/^(?:MPL-1\.0)/,/^(?:AFL-2\.0)/,/^(?:AFL-2\.1)/,/^(?:AFL-3\.0)/,/^(?:NPL-1\.0)/,/^(?:NPL-1\.1)/,/^(?:APL-1\.0)/,/^(?:Aladdin)/,/^(?:AMDPLPA)/,/^(?:BSL-1\.0)/,/^(?:Borceux)/,/^(?:Caldera)/,/^(?:MIT-CMU)/,/^(?:CPL-1\.0)/,/^(?:ZPL-2\.1)/,/^(?:ZPL-2\.0)/,/^(?:ZPL-1\.1)/,/^(?:CC0-1\.0)/,/^(?:YPL-1\.1)/,/^(?:LPL-1\.0)/,/^(?:libtiff)/,/^(?:YPL-1\.0)/,/^(?:Dotseqn)/,/^(?:Latex2e)/,/^(?:VSL-1\.0)/,/^(?:VOSTROM)/,/^(?:UPL-1\.0)/,/^(?:dvipdfm)/,/^(?:EPL-1\.0)/,/^(?:ECL-1\.0)/,/^(?:ECL-2\.0)/,/^(?:SPL-1\.0)/,/^(?:IPL-1\.0)/,/^(?:EFL-1\.0)/,/^(?:EFL-2\.0)/,/^(?:OPL-1\.0)/,/^(?:OSL-1\.0)/,/^(?:OSL-1\.1)/,/^(?:OSL-2\.0)/,/^(?:OSL-2\.1)/,/^(?:OSL-3\.0)/,/^(?:OpenSSL)/,/^(?:PHP-3\.0)/,/^(?:gnuplot)/,/^(?:Entessa)/,/^(?:GPL-3\.0)/,/^(?:Eurosym)/,/^(?:psutils)/,/^(?:GPL-2\.0)/,/^(?:QPL-1\.0)/,/^(?:MIT-feh)/,/^(?:OFL-1\.1)/,/^(?:GPL-1\.0)/,/^(?:RPL-1\.1)/,/^(?:RPL-1\.5)/,/^(?:OFL-1\.0)/,/^(?:Saxpath)/,/^(?:Bahyph)/,/^(?:RSA-MD)/,/^(?:Naumen)/,/^(?:NetCDF)/,/^(?:mpich2)/,/^(?:Glulxe)/,/^(?:APAFML)/,/^(?:psfrag)/,/^(?:Plexus)/,/^(?:SAX-PD)/,/^(?:MITNFA)/,/^(?:eGenix)/,/^(?:iMatix)/,/^(?:Imlib2)/,/^(?:Libpng)/,/^(?:xinetd)/,/^(?:LGPLLR)/,/^(?:Wsuipa)/,/^(?:SMLNJ)/,/^(?:RSCPL)/,/^(?:SISSL)/,/^(?:Rdisc)/,/^(?:Noweb)/,/^(?:Qhull)/,/^(?:Nunit)/,/^(?:GL2PS)/,/^(?:TMate)/,/^(?:MirOS)/,/^(?:MS-RL)/,/^(?:Intel)/,/^(?:MS-PL)/,/^(?:OGTSL)/,/^(?:WTFPL)/,/^(?:Nokia)/,/^(?:XSkat)/,/^(?:Glide)/,/^(?:FSFUL)/,/^(?:AMPAS)/,/^(?:Xerox)/,/^(?:0BSD)/,/^(?:Ruby)/,/^(?:JSON)/,/^(?:MTLL)/,/^(?:Cube)/,/^(?:Zlib)/,/^(?:NCSA)/,/^(?:TOSL)/,/^(?:Xnet)/,/^(?:DSDP)/,/^(?:HPND)/,/^(?:Barr)/,/^(?:SNIA)/,/^(?:ADSL)/,/^(?:NLPL)/,/^(?:Fair)/,/^(?:NOSL)/,/^(?:NGPL)/,/^(?:SCEA)/,/^(?:Zed)/,/^(?:DOC)/,/^(?:ICU)/,/^(?:Vim)/,/^(?:xpp)/,/^(?:OML)/,/^(?:AAL)/,/^(?:AML)/,/^(?:W3C)/,/^(?:ISC)/,/^(?:IPA)/,/^(?:X11)/,/^(?:MIT)/,/^(?:FTL)/,/^(?:IJG)/,/^(?:TCL)/,/^(?:SWL)/,/^(?:NTP)/,/^(?:Mup)/,/^(?:NRL)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338],inclusive:true}}};return lexer}();parser.lexer=lexer;function Parser(){this.yy={}}Parser.prototype=parser;parser.Parser=Parser;return new Parser}();if(typeof require!=="undefined"&&typeof exports!=="undefined"){exports.parser=spdxparse;exports.Parser=spdxparse.Parser;exports.parse=function(){return spdxparse.parse.apply(spdxparse,arguments)};exports.main=function commonjsMain(args){if(!args[1]){console.log("Usage: "+args[0]+" FILE");process.exit(1)}var source=require("fs").readFileSync(require("path").normalize(args[1]),"utf8");return exports.parser.parse(source)};if(typeof module!=="undefined"&&require.main===module){exports.main(process.argv.slice(1))}} diff --git a/deps/npm/node_modules/validate-npm-package-license/package.json b/deps/npm/node_modules/validate-npm-package-license/package.json index 00006cc3904b90..cb54e620f0ed9e 100644 --- a/deps/npm/node_modules/validate-npm-package-license/package.json +++ b/deps/npm/node_modules/validate-npm-package-license/package.json @@ -58,5 +58,6 @@ } ], "directories": {}, - "_resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz" + "_resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/validate-npm-package-name/node_modules/builtins/package.json b/deps/npm/node_modules/validate-npm-package-name/node_modules/builtins/package.json index 32b8c350692db4..c5ec77f136b8a2 100644 --- a/deps/npm/node_modules/validate-npm-package-name/node_modules/builtins/package.json +++ b/deps/npm/node_modules/validate-npm-package-name/node_modules/builtins/package.json @@ -4,7 +4,7 @@ "description": "List of node.js builtin modules", "repository": { "type": "git", - "url": "git+https://github.com/juliangruber/builtins.git" + "url": "git://github.com/juliangruber/builtins.git" }, "license": "MIT", "main": "builtins.json", @@ -14,12 +14,33 @@ "scripts": { "test": "node -e \"require('./builtins.json')\"" }, - "readme": "\n# builtins\n\n List of node.js [builtin modules](http://nodejs.org/api/).\n\n [![build status](https://secure.travis-ci.org/juliangruber/builtins.svg)](http://travis-ci.org/juliangruber/builtins)\n\n## Example\n\n```js\nvar builtins = require('builtins');\n\nassert(builtins.indexOf('http') > -1);\n```\n\n## License\n\n MIT\n", - "readmeFilename": "Readme.md", "bugs": { "url": "https://github.com/juliangruber/builtins/issues" }, "homepage": "https://github.com/juliangruber/builtins", "_id": "builtins@0.0.7", - "_from": "builtins@0.0.7" + "dist": { + "shasum": "355219cd6cf18dbe7c01cc7fd2dce765cfdc549a", + "tarball": "http://registry.npmjs.org/builtins/-/builtins-0.0.7.tgz" + }, + "_from": "builtins@0.0.7", + "_npmVersion": "1.3.22", + "_npmUser": { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + { + "name": "segment", + "email": "tj@segment.io" + } + ], + "directories": {}, + "_shasum": "355219cd6cf18dbe7c01cc7fd2dce765cfdc549a", + "_resolved": "https://registry.npmjs.org/builtins/-/builtins-0.0.7.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/validate-npm-package-name/package.json b/deps/npm/node_modules/validate-npm-package-name/package.json index b2a6104af58c6e..5b706da2d6d077 100644 --- a/deps/npm/node_modules/validate-npm-package-name/package.json +++ b/deps/npm/node_modules/validate-npm-package-name/package.json @@ -33,10 +33,34 @@ "url": "https://github.com/npm/validate-npm-package-name/issues" }, "homepage": "https://github.com/npm/validate-npm-package-name", - "readme": "# validate-npm-package-name\n\nGive me a string and I'll tell you if it's a valid `npm` package name.\n\nThis package exports a single synchronous function that takes a `string` as\ninput and returns an object with two properties:\n\n- `validForNewPackages` :: `Boolean`\n- `validForOldPackages` :: `Boolean`\n\n## Contents\n\n- [Naming rules](#naming-rules)\n- [Examples](#examples)\n + [Valid Names](#valid-names)\n + [Invalid Names](#invalid-names)\n- [Legacy Names](#legacy-names)\n- [Tests](#tests)\n- [License](#license)\n\n## Naming Rules\n\nBelow is a list of rules that valid `npm` package name should conform to.\n\n- package name length should be greater than zero\n- all the characters in the package name must be lowercase i.e., no uppercase or mixed case names are allowed\n- package name *can* consist of hyphens\n- package name must *not* contain any non-url-safe characters (since name ends up being part of a URL)\n- package name should not start with `.` or `_`\n- package name should *not* contain any leading or trailing spaces\n- package name *cannot* be the same as a node.js/io.js core module nor a reserved/blacklisted name. For example, the following names are invalid:\n + http\n + stream\n + node_modules\n + favicon.ico\n- package name length cannot exceed 214\n\n\n## Examples\n\n### Valid Names\n\n```js\nvar validate = require(\"validate-npm-package-name\")\n\nvalidate(\"some-package\")\nvalidate(\"example.com\")\nvalidate(\"under_score\")\nvalidate(\"123numeric\")\nvalidate(\"crazy!\")\nvalidate(\"@npm/thingy\")\nvalidate(\"@jane/foo.js\")\n```\n\nAll of the above names are valid, so you'll get this object back:\n\n```js\n{\n validForNewPackages: true,\n validForOldPackages: true\n}\n```\n\n### Invalid Names\n\n```js\nvalidate(\" leading-space:and:weirdchars\")\n```\n\nThat was never a valid package name, so you get this:\n\n```js\n{\n validForNewPackages: false,\n validForOldPackages: false,\n errors: [\n 'name cannot contain leading or trailing spaces',\n 'name can only contain URL-friendly characters'\n ]\n}\n```\n\n## Legacy Names\n\nIn the old days of npm, package names were wild. They could have capital\nletters in them. They could be really long. They could be the name of an\nexisting module in node core.\n\nIf you give this function a package name that **used to be valid**, you'll see\na change in the value of `validForNewPackages` property, and a warnings array\nwill be present:\n\n```js\nvalidate(\"cRaZY-paCkAgE-with-mixed-case-and-more-than-214-characters-----------------------------------------------------------------------------------------------------------------------------------------------------------\")\n```\n\nreturns:\n\n```js\n{\n validForNewPackages: false,\n validForOldPackages: true,\n warnings: [\n \"name can no longer contain capital letters\",\n \"name can no longer contain more than 214 characters\"\n ]\n}\n```\n\n## Tests\n\n```sh\nnpm install\nnpm test\n```\n\n## License\n\nISC\n", - "readmeFilename": "README.md", "gitHead": "3af92c881549f1b96f05ab6bfb5768bba94ad72d", "_id": "validate-npm-package-name@2.2.2", "_shasum": "f65695b22f7324442019a3c7fa39a6e7fd299085", - "_from": "validate-npm-package-name@2.2.2" + "_from": "validate-npm-package-name@>=2.2.2 <2.3.0", + "_npmVersion": "3.0.0", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "f65695b22f7324442019a3c7fa39a6e7fd299085", + "tarball": "http://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-2.2.2.tgz" + }, + "maintainers": [ + { + "name": "zeke", + "email": "zeke@sikelianos.com" + }, + { + "name": "bcoe", + "email": "ben@npmjs.com" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "_resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-2.2.2.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/which/.npmignore b/deps/npm/node_modules/which/.npmignore new file mode 100644 index 00000000000000..0ac606ffcbed0a --- /dev/null +++ b/deps/npm/node_modules/which/.npmignore @@ -0,0 +1,3 @@ +.nyc_output/ +coverage/ +node_modules/ diff --git a/deps/npm/node_modules/which/.travis.yml b/deps/npm/node_modules/which/.travis.yml index 4af02b3d17e64c..7f22ad5a13250d 100644 --- a/deps/npm/node_modules/which/.travis.yml +++ b/deps/npm/node_modules/which/.travis.yml @@ -1,8 +1,6 @@ +sudo: false language: node_js node_js: - - '0.8' - '0.10' - '0.12' - - 'iojs' -before_install: - - npm install -g npm@latest + - '4' diff --git a/deps/npm/node_modules/which/README.md b/deps/npm/node_modules/which/README.md index d5571528af303d..7f679d595c28c2 100644 --- a/deps/npm/node_modules/which/README.md +++ b/deps/npm/node_modules/which/README.md @@ -29,6 +29,20 @@ which('node', { path: someOtherPath }, function (er, resolved) { }) ``` +## CLI USAGE + +Same as the BSD `which(1)` binary. + +``` +usage: which [-as] program ... +``` + ## OPTIONS -If you pass in options, then `path` and `pathExt` are relevant. +You may pass an options object as the second argument. + +- `path`: Use instead of the `PATH` environment variable. +- `pathExt`: Use instead of the `PATHEXT` environment variable. +- `all`: Return all matches, instead of just the first one. Note that + this means the function returns an array of strings instead of a + single string. diff --git a/deps/npm/node_modules/which/bin/which b/deps/npm/node_modules/which/bin/which index 8432ce2f6da509..7cee3729eebdd0 100755 --- a/deps/npm/node_modules/which/bin/which +++ b/deps/npm/node_modules/which/bin/which @@ -1,14 +1,52 @@ #!/usr/bin/env node var which = require("../") -if (process.argv.length < 3) { - console.error("Usage: which ") +if (process.argv.length < 3) + usage() + +function usage () { + console.error('usage: which [-as] program ...') process.exit(1) } -which(process.argv[2], function (er, thing) { - if (er) { - console.error(er.message) - process.exit(er.errno || 127) +var all = false +var silent = false +var dashdash = false +var args = process.argv.slice(2).filter(function (arg) { + if (dashdash || !/^-/.test(arg)) + return true + + if (arg === '--') { + dashdash = true + return false + } + + var flags = arg.substr(1).split('') + for (var f = 0; f < flags.length; f++) { + var flag = flags[f] + switch (flag) { + case 's': + silent = true + break + case 'a': + all = true + break + default: + console.error('which: illegal option -- ' + flag) + usage() + } } - console.log(thing) + return false }) + +process.exit(args.reduce(function (pv, current) { + try { + var f = which.sync(current, { all: all }) + if (all) + f = f.join('\n') + if (!silent) + console.log(f) + return pv; + } catch (e) { + return 1; + } +}, 0)) diff --git a/deps/npm/node_modules/which/node_modules/isexe/.npmignore b/deps/npm/node_modules/which/node_modules/isexe/.npmignore new file mode 100644 index 00000000000000..c1cb757acf58a4 --- /dev/null +++ b/deps/npm/node_modules/which/node_modules/isexe/.npmignore @@ -0,0 +1,2 @@ +.nyc_output/ +coverage/ diff --git a/deps/npm/node_modules/which/node_modules/isexe/README.md b/deps/npm/node_modules/which/node_modules/isexe/README.md new file mode 100644 index 00000000000000..30995ad7df9c87 --- /dev/null +++ b/deps/npm/node_modules/which/node_modules/isexe/README.md @@ -0,0 +1,51 @@ +# isexe + +Minimal module to check if a file is executable. + +Uses `fs.access` if available, and tests against the `PATHEXT` +environment variable on Windows. + +## USAGE + +```javascript +var isexe = require('isexe') +isexe('some-file-name', function (err, isExe) { + if (err) { + console.error('probably file does not exist or something', err) + } else if (isExe) { + console.error('this thing can be run') + } else { + console.error('cannot be run') + } +}) + +// same thing but synchronous, throws errors +var isExe = isexe.sync('some-file-name') + +// treat errors as just "not executable" +isexe('maybe-missing-file', { ignoreErrors: true }, callback) +var isExe = isexe.sync('maybe-missing-file', { ignoreErrors: true }) +``` + +## API + +### `isexe(path, [options], [callback])` + +Check if the path is executable. If no callback provided, and a +global `Promise` object is available, then a Promise will be returned. + +Will raise whatever errors may be raised by `fs.access` or `fs.stat`, +unless `options.ignoreErrors` is set to true. + +### `isexe.sync(path, [options])` + +Same as `isexe` but returns the value and throws any errors raised. + +### Options + +* `ignoreErrors` Treat all errors as "no, this is not executable", but + don't raise them. +* `uid` Number to use as the user id when using the `mode` approach. +* `gid` Number to use as the group id when using the `mode` approach. +* `pathExt` List of path extensions to use instead of `PATHEXT` + environment variable on Windows. diff --git a/deps/npm/node_modules/which/node_modules/isexe/access.js b/deps/npm/node_modules/which/node_modules/isexe/access.js new file mode 100644 index 00000000000000..e67b28bd6f6c6f --- /dev/null +++ b/deps/npm/node_modules/which/node_modules/isexe/access.js @@ -0,0 +1,15 @@ +module.exports = isexe +isexe.sync = sync + +var fs = require('fs') + +function isexe (path, _, cb) { + fs.access(path, fs.X_OK, function (er) { + cb(er, !er) + }) +} + +function sync (path, _) { + fs.accessSync(path, fs.X_OK) + return true +} diff --git a/deps/npm/node_modules/which/node_modules/isexe/index.js b/deps/npm/node_modules/which/node_modules/isexe/index.js new file mode 100644 index 00000000000000..ff8ef113b89229 --- /dev/null +++ b/deps/npm/node_modules/which/node_modules/isexe/index.js @@ -0,0 +1,59 @@ +var fs = require('fs') +var core +if (process.platform === 'win32' || global.TESTING_WINDOWS) { + core = require('./windows.js') +} else if (typeof fs.access === 'function') { + core = require('./access.js') +} else { + core = require('./mode.js') +} + +module.exports = isexe +isexe.sync = sync + +function isexe (path, options, cb) { + if (typeof options === 'function') { + cb = options + options = {} + } + + if (!cb) { + if (typeof Promise !== 'function') { + throw new TypeError('callback not provided') + } + + return new Promise(function (resolve, reject) { + isexe(path, options || {}, function (er, is) { + if (er) { + reject(er) + } else { + resolve(is) + } + }) + }) + } + + core(path, options || {}, function (er, is) { + // ignore EACCES because that just means we aren't allowed to run it + if (er) { + if (er.code === 'EACCES' || options && options.ignoreErrors) { + er = null + is = false + } + } + cb(er, is) + }) +} + +function sync (path, options) { + // my kingdom for a filtered catch + try { + return core.sync(path, options || {}) + } catch (er) { + if (options && options.ignoreErrors || er.code === 'EACCES') { + return false + } else { + throw er + } + } +} diff --git a/deps/npm/node_modules/which/node_modules/isexe/mode.js b/deps/npm/node_modules/which/node_modules/isexe/mode.js new file mode 100644 index 00000000000000..204428072801c9 --- /dev/null +++ b/deps/npm/node_modules/which/node_modules/isexe/mode.js @@ -0,0 +1,37 @@ +module.exports = isexe +isexe.sync = sync + +var fs = require('fs') + +function isexe (path, options, cb) { + fs.stat(path, function (er, st) { + cb(er, er ? false : checkMode(st, options)) + }) +} + +function sync (path, options) { + return checkMode(fs.statSync(path), options) +} + +function checkMode (stat, options) { + var mod = stat.mode + var uid = stat.uid + var gid = stat.gid + + var myUid = options.uid !== undefined ? + options.uid : process.getuid && process.getuid() + var myGid = options.gid !== undefined ? + options.gid : process.getgid && process.getgid() + + var u = parseInt('100', 8) + var g = parseInt('010', 8) + var o = parseInt('001', 8) + var ug = u | g + + var ret = (mod & o) || + (mod & g) && gid === myGid || + (mod & u) && uid === myUid || + (mod & ug) && myUid === 0 + + return ret +} diff --git a/deps/npm/node_modules/which/node_modules/isexe/package.json b/deps/npm/node_modules/which/node_modules/isexe/package.json new file mode 100644 index 00000000000000..49aeeab2a3df7b --- /dev/null +++ b/deps/npm/node_modules/which/node_modules/isexe/package.json @@ -0,0 +1,80 @@ +{ + "_args": [ + [ + "isexe@^1.1.1", + "/Users/rebecca/code/npm/node_modules/which" + ] + ], + "_from": "isexe@>=1.1.1 <2.0.0", + "_id": "isexe@1.1.1", + "_inCache": true, + "_installable": true, + "_location": "/which/isexe", + "_nodeVersion": "4.0.0", + "_npmUser": { + "email": "i@izs.me", + "name": "isaacs" + }, + "_npmVersion": "2.14.15", + "_phantomChildren": {}, + "_requested": { + "name": "isexe", + "raw": "isexe@^1.1.1", + "rawSpec": "^1.1.1", + "scope": null, + "spec": ">=1.1.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/which" + ], + "_resolved": "https://registry.npmjs.org/isexe/-/isexe-1.1.1.tgz", + "_shasum": "f0d4793ed2fb5c46bfdeab760bbb965f4485a66c", + "_shrinkwrap": null, + "_spec": "isexe@^1.1.1", + "_where": "/Users/rebecca/code/npm/node_modules/which", + "author": { + "email": "i@izs.me", + "name": "Isaac Z. Schlueter", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/isexe/issues" + }, + "dependencies": {}, + "description": "Minimal module to check if a file is executable.", + "devDependencies": { + "mkdirp": "^0.5.1", + "rimraf": "^2.5.0", + "tap": "^5.1.2" + }, + "directories": { + "test": "test" + }, + "dist": { + "shasum": "f0d4793ed2fb5c46bfdeab760bbb965f4485a66c", + "tarball": "http://registry.npmjs.org/isexe/-/isexe-1.1.1.tgz" + }, + "gitHead": "af83031caed58654ad9d20b98eb710d383618ad7", + "homepage": "https://github.com/isaacs/isexe#readme", + "keywords": [], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "isexe", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/isexe.git" + }, + "scripts": { + "test": "tap test/*.js --branches=100 --statements=100 --functions=100 --lines=100" + }, + "version": "1.1.1" +} diff --git a/deps/npm/node_modules/which/node_modules/isexe/test/basic.js b/deps/npm/node_modules/which/node_modules/isexe/test/basic.js new file mode 100644 index 00000000000000..969fc9a0a3f68e --- /dev/null +++ b/deps/npm/node_modules/which/node_modules/isexe/test/basic.js @@ -0,0 +1,211 @@ +var t = require('tap') +var fs = require('fs') +var path = require('path') +var fixture = path.resolve(__dirname, 'fixtures') +var meow = fixture + '/meow.cat' +var mine = fixture + '/mine.cat' +var ours = fixture + '/ours.cat' +var fail = fixture + '/fail.false' +var noent = fixture + '/enoent.exe' +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') + +var isWindows = process.platform === 'win32' +var hasAccess = typeof fs.access === 'function' +var winSkip = isWindows && 'windows' +var accessSkip = !hasAccess && 'no fs.access function' +var hasPromise = typeof Promise === 'function' +var promiseSkip = !hasPromise && 'no global Promise' + +function reset () { + delete require.cache[require.resolve('../')] + return require('../') +} + +t.test('setup fixtures', function (t) { + rimraf.sync(fixture) + mkdirp.sync(fixture) + fs.writeFileSync(meow, '#!/usr/bin/env cat\nmeow\n') + fs.chmodSync(meow, parseInt('0755', 8)) + fs.writeFileSync(fail, '#!/usr/bin/env false\n') + fs.chmodSync(fail, parseInt('0644', 8)) + fs.writeFileSync(mine, '#!/usr/bin/env cat\nmine\n') + fs.chmodSync(mine, parseInt('0744', 8)) + fs.writeFileSync(ours, '#!/usr/bin/env cat\nours\n') + fs.chmodSync(ours, parseInt('0754', 8)) + t.end() +}) + +t.test('promise', { skip: promiseSkip }, function (t) { + var isexe = reset() + t.test('meow async', function (t) { + isexe(meow).then(function (is) { + t.ok(is) + t.end() + }) + }) + t.test('fail async', function (t) { + isexe(fail).then(function (is) { + t.notOk(is) + t.end() + }) + }) + t.test('noent async', function (t) { + isexe(noent).catch(function (er) { + t.ok(er) + t.end() + }) + }) + t.test('noent ignore async', function (t) { + isexe(noent, { ignoreErrors: true }).then(function (is) { + t.notOk(is) + t.end() + }) + }) + t.end() +}) + +t.test('no promise', function (t) { + global.Promise = null + var isexe = reset() + t.throws('try to meow a promise', function () { + isexe(meow) + }) + t.end() +}) + +t.test('access', { skip: accessSkip || winSkip }, function (t) { + runTest(t) +}) + +t.test('mode', { skip: winSkip }, function (t) { + delete fs.access + delete fs.accessSync + var isexe = reset() + t.ok(isexe.sync(ours, { uid: 0, gid: 0 })) + t.ok(isexe.sync(mine, { uid: 0, gid: 0 })) + runTest(t) +}) + +t.test('windows', function (t) { + global.TESTING_WINDOWS = true + var pathExt = '.EXE;.CAT;.CMD;.COM' + t.test('pathExt option', function (t) { + runTest(t, { pathExt: '.EXE;.CAT;.CMD;.COM' }) + }) + t.test('pathExt env', function (t) { + process.env.PATHEXT = pathExt + runTest(t) + }) + t.test('no pathExt', function (t) { + // with a pathExt of '', any filename is fine. + // so the "fail" one would still pass. + runTest(t, { pathExt: '', skipFail: true }) + }) + t.test('pathext with empty entry', function (t) { + // with a pathExt of '', any filename is fine. + // so the "fail" one would still pass. + runTest(t, { pathExt: ';' + pathExt, skipFail: true }) + }) + t.end() +}) + +t.test('cleanup', function (t) { + rimraf.sync(fixture) + t.end() +}) + +function runTest (t, options) { + var isexe = reset() + + var optionsIgnore = Object.create(options || {}) + optionsIgnore.ignoreErrors = true + + if (!options || !options.skipFail) { + t.notOk(isexe.sync(fail, options)) + } + t.notOk(isexe.sync(noent, optionsIgnore)) + if (!options) { + t.ok(isexe.sync(meow)) + } else { + t.ok(isexe.sync(meow, options)) + } + + t.ok(isexe.sync(mine, options)) + t.ok(isexe.sync(ours, options)) + t.throws(function () { + isexe.sync(noent, options) + }) + + t.test('meow async', function (t) { + if (!options) { + isexe(meow, function (er, is) { + if (er) { + throw er + } + t.ok(is) + t.end() + }) + } else { + isexe(meow, options, function (er, is) { + if (er) { + throw er + } + t.ok(is) + t.end() + }) + } + }) + + t.test('mine async', function (t) { + isexe(mine, options, function (er, is) { + if (er) { + throw er + } + t.ok(is) + t.end() + }) + }) + + t.test('ours async', function (t) { + isexe(ours, options, function (er, is) { + if (er) { + throw er + } + t.ok(is) + t.end() + }) + }) + + if (!options || !options.skipFail) { + t.test('fail async', function (t) { + isexe(fail, options, function (er, is) { + if (er) { + throw er + } + t.notOk(is) + t.end() + }) + }) + } + + t.test('noent async', function (t) { + isexe(noent, options, function (er, is) { + t.ok(er) + t.notOk(is) + t.end() + }) + }) + + t.test('noent ignore async', function (t) { + isexe(noent, optionsIgnore, function (er, is) { + if (er) { + throw er + } + t.notOk(is) + t.end() + }) + }) + + t.end() +} diff --git a/deps/npm/node_modules/which/node_modules/isexe/windows.js b/deps/npm/node_modules/which/node_modules/isexe/windows.js new file mode 100644 index 00000000000000..aba8561f3b0b12 --- /dev/null +++ b/deps/npm/node_modules/which/node_modules/isexe/windows.js @@ -0,0 +1,36 @@ +module.exports = isexe +isexe.sync = sync + +var fs = require('fs') + +function checkPathExt (path, options) { + var pathext = options.pathExt !== undefined ? + options.pathExt : process.env.PATHEXT + + if (!pathext) { + return true + } + + pathext = pathext.split(';') + if (pathext.indexOf('') !== -1) { + return true + } + for (var i = 0; i < pathext.length; i++) { + var p = pathext[i].toLowerCase() + if (p && path.substr(-p.length).toLowerCase() === p) { + return true + } + } + return false +} + +function isexe (path, options, cb) { + fs.stat(path, function (er, st) { + cb(er, er ? false : checkPathExt(path, options)) + }) +} + +function sync (path, options) { + fs.statSync(path) + return checkPathExt(path, options) +} diff --git a/deps/npm/node_modules/which/package.json b/deps/npm/node_modules/which/package.json index 0213e184e7b746..04f90fa687a0e5 100644 --- a/deps/npm/node_modules/which/package.json +++ b/deps/npm/node_modules/which/package.json @@ -1,57 +1,87 @@ { + "_args": [ + [ + "which@~1.2.1", + "/Users/rebecca/code/npm" + ] + ], + "_from": "which@>=1.2.1 <1.3.0", + "_id": "which@1.2.4", + "_inCache": true, + "_installable": true, + "_location": "/which", + "_nodeVersion": "4.0.0", + "_npmUser": { + "email": "i@izs.me", + "name": "isaacs" + }, + "_npmVersion": "2.14.15", + "_phantomChildren": {}, + "_requested": { + "name": "which", + "raw": "which@~1.2.1", + "rawSpec": "~1.2.1", + "scope": null, + "spec": ">=1.2.1 <1.3.0", + "type": "range" + }, + "_requiredBy": [ + "/", + "/node-gyp", + "/standard/standard-format/esformatter/npm-run/npm-path", + "/tap/foreground-child/cross-spawn-async", + "/tap/nyc/istanbul" + ], + "_resolved": "https://registry.npmjs.org/which/-/which-1.2.4.tgz", + "_shasum": "1557f96080604e5b11b3599eb9f45b50a9efd722", + "_shrinkwrap": null, + "_spec": "which@~1.2.1", + "_where": "/Users/rebecca/code/npm", "author": { - "name": "Isaac Z. Schlueter", "email": "i@izs.me", + "name": "Isaac Z. Schlueter", "url": "http://blog.izs.me" }, - "name": "which", - "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", - "version": "1.1.2", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-which.git" - }, - "main": "which.js", "bin": { "which": "./bin/which" }, - "license": "ISC", + "bugs": { + "url": "https://github.com/isaacs/node-which/issues" + }, "dependencies": { - "is-absolute": "^0.1.7" + "is-absolute": "^0.1.7", + "isexe": "^1.1.1" }, + "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", "devDependencies": { "mkdirp": "^0.5.0", "rimraf": "^2.3.3", - "tap": "^1.0.2" - }, - "scripts": { - "test": "tap test/*.js" - }, - "gitHead": "e576e42f0c377571884f844eec58b3ca4a331681", - "bugs": { - "url": "https://github.com/isaacs/node-which/issues" - }, - "homepage": "https://github.com/isaacs/node-which#readme", - "_id": "which@1.1.2", - "_shasum": "486c48af6dfecc7a7dcf9c655acf108d2dcbdf3d", - "_from": "which@1.1.2", - "_npmVersion": "3.3.1", - "_nodeVersion": "2.5.0", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" + "tap": "^5.1.1" }, + "directories": {}, "dist": { - "shasum": "486c48af6dfecc7a7dcf9c655acf108d2dcbdf3d", - "tarball": "http://registry.npmjs.org/which/-/which-1.1.2.tgz" + "shasum": "1557f96080604e5b11b3599eb9f45b50a9efd722", + "tarball": "http://registry.npmjs.org/which/-/which-1.2.4.tgz" }, + "gitHead": "1375684d40af9de2ecc527d1ab9b87b537d7a1cc", + "homepage": "https://github.com/isaacs/node-which#readme", + "license": "ISC", + "main": "which.js", "maintainers": [ { "name": "isaacs", "email": "i@izs.me" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/which/-/which-1.1.2.tgz", - "readme": "ERROR: No README data found!" + "name": "which", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-which.git" + }, + "scripts": { + "test": "tap test/*.js --cov" + }, + "version": "1.2.4" } diff --git a/deps/npm/node_modules/which/test/basic.js b/deps/npm/node_modules/which/test/basic.js index 80e9e96b2366ab..54c8d2384dc27f 100644 --- a/deps/npm/node_modules/which/test/basic.js +++ b/deps/npm/node_modules/which/test/basic.js @@ -51,17 +51,16 @@ t.test('make executable', function (t) { }) t.test('find when executable', function (t) { - t.plan(4) var opt = { pathExt: '.sh' } var expect = path.resolve(fixture, 'foo.sh').toLowerCase() - var PATH = process.env.PATH + var PATH = process.env.PATH || process.env.Path t.test('absolute', function (t) { runTest(fixture + '/foo.sh', t) }) t.test('with process.env.PATH', function (t) { - process.env.PATH = fixture + process.env.PATH = process.env.Path = fixture runTest('foo.sh', t) }) @@ -73,6 +72,25 @@ t.test('find when executable', function (t) { runTest('foo.sh', t) }) + t.test('with pathExt', { + skip: isWindows ? false : 'Only for Windows' + }, function (t) { + var pe = process.env.PATHEXT + process.env.PATHEXT = '.SH' + + t.test('foo.sh', function (t) { + runTest('foo.sh', t) + }) + t.test('foo', function (t) { + runTest('foo', t) + }) + t.test('replace', function (t) { + process.env.PATHEXT = pe + t.end() + }) + t.end() + }) + t.test('with path opt', function (t) { opt.path = fixture runTest('foo.sh', t) @@ -80,17 +98,20 @@ t.test('find when executable', function (t) { function runTest(exec, t) { t.plan(2) + + var found = which.sync(exec, opt).toLowerCase() + t.equal(found, expect) + which(exec, opt, function (er, found) { if (er) throw er t.equal(found.toLowerCase(), expect) + t.end() process.env.PATH = PATH }) - - var found = which.sync(exec, opt).toLowerCase() - t.equal(found, expect) } + t.end() }) t.test('clean', function (t) { diff --git a/deps/npm/node_modules/which/test/bin.js b/deps/npm/node_modules/which/test/bin.js new file mode 100644 index 00000000000000..ff7eb530c7fcc2 --- /dev/null +++ b/deps/npm/node_modules/which/test/bin.js @@ -0,0 +1,119 @@ +var t = require('tap') +var spawn = require('child_process').spawn +var node = process.execPath +var bin = require.resolve('../bin/which') + +function which (args, extraPath, cb) { + if (typeof extraPath === 'function') + cb = extraPath, extraPath = null + + var options = {} + if (extraPath) { + var sep = process.platform === 'win32' ? ';' : ':' + var p = process.env.PATH + sep + extraPath + options.env = Object.keys(process.env).reduce(function (env, k) { + if (!k.match(/^path$/i)) + env[k] = process.env[k] + return env + }, { PATH: p }) + } + + var out = '' + var err = '' + var child = spawn(node, [bin].concat(args), options) + child.stdout.on('data', function (c) { + out += c + }) + child.stderr.on('data', function (c) { + err += c + }) + child.on('close', function (code, signal) { + cb(code, signal, out.trim(), err.trim()) + }) +} + +t.test('finds node', function (t) { + which('node', function (code, signal, out, err) { + t.equal(signal, null) + t.equal(code, 0) + t.equal(err, '') + t.match(out, /[\\\/]node(\.exe)?$/) + t.end() + }) +}) + +t.test('does not find flergyderp', function (t) { + which('flergyderp', function (code, signal, out, err) { + t.equal(signal, null) + t.equal(code, 1) + t.equal(err, '') + t.match(out, '') + t.end() + }) +}) + +t.test('finds node and tap', function (t) { + which(['node', 'tap'], function (code, signal, out, err) { + t.equal(signal, null) + t.equal(code, 0) + t.equal(err, '') + t.match(out.split(/\n/), [ + /[\\\/]node(\.exe)?$/, + /[\\\/]tap(\.cmd)?$/ + ]) + t.end() + }) +}) + +t.test('finds node and tap, but not flergyderp', function (t) { + which(['node', 'flergyderp', 'tap'], function (code, signal, out, err) { + t.equal(signal, null) + t.equal(code, 1) + t.equal(err, '') + t.match(out.split(/\n/), [ + /[\\\/]node(\.exe)?$/, + /[\\\/]tap(\.cmd)?$/ + ]) + t.end() + }) +}) + +t.test('cli flags', function (t) { + var p = require('path').dirname(bin) + var cases = [ '-a', '-s', '-as', '-sa' ] + t.plan(cases.length) + cases.forEach(function (c) { + t.test(c, function (t) { + which(['which', c], p, function (code, signal, out, err) { + t.equal(signal, null) + t.equal(code, 0) + t.equal(err, '') + if (/s/.test(c)) + t.equal(out, '', 'should be silent') + else if (/a/.test(c)) + t.ok(out.split(/\n/).length > 1, 'should have more than 1 result') + t.end() + }) + }) + }) +}) + +t.test('shows usage', function (t) { + which([], function (code, signal, out, err) { + t.equal(signal, null) + t.equal(code, 1) + t.equal(err, 'usage: which [-as] program ...') + t.equal(out, '') + t.end() + }) +}) + +t.test('complains about unknown flag', function (t) { + which(['node', '-sax'], function (code, signal, out, err) { + t.equal(signal, null) + t.equal(code, 1) + t.equal(out, '') + t.equal(err, 'which: illegal option -- x\nusage: which [-as] program ...') + t.end() + }) +}) diff --git a/deps/npm/node_modules/which/test/windows.js b/deps/npm/node_modules/which/test/windows.js new file mode 100644 index 00000000000000..1d5e4294a69357 --- /dev/null +++ b/deps/npm/node_modules/which/test/windows.js @@ -0,0 +1,10 @@ +// pretend to be Windows. +if (process.platform === 'win32') { + var t = require('tap') + t.plan(0, 'already on windows') + process.exit(0) +} + +process.env.Path = process.env.PATH.split(':').join(';') +process.env.OSTYPE = 'cygwin' +require('./basic.js') diff --git a/deps/npm/node_modules/which/which.js b/deps/npm/node_modules/which/which.js index 97579de8ac88aa..5cf0124d7899b5 100644 --- a/deps/npm/node_modules/which/which.js +++ b/deps/npm/node_modules/which/which.js @@ -7,46 +7,26 @@ var isWindows = process.platform === 'win32' || var path = require('path') var COLON = isWindows ? ';' : ':' -var isExe +var isexe = require('isexe') var fs = require('fs') var isAbsolute = require('is-absolute') -var G = parseInt('0010', 8) -var U = parseInt('0100', 8) -var UG = parseInt('0110', 8) - -if (isWindows) { - // On windows, there is no good way to check that a file is executable - isExe = function isExe () { return true } -} else { - isExe = function isExe (mod, uid, gid) { - var ret = (mod & 1) - || (mod & U) && process.getgid && gid === process.getgid() - || (mod & G) && process.getuid && uid === process.getuid() - || (mod & UG) && process.getuid && 0 === process.getuid() - - if (!ret && process.getgroups && (mod & G)) { - var groups = process.getgroups() - for (var g = 0; g < groups.length; g++) { - if (groups[g] === gid) - return true - } - } - - return ret - } -} - function getPathInfo(cmd, opt) { var colon = opt.colon || COLON - var pathEnv = opt.path || process.env.PATH || '' + var pathEnv = opt.path || process.env.Path || process.env.PATH || '' var pathExt = [''] pathEnv = pathEnv.split(colon) + var pathExtExe = '' if (isWindows) { pathEnv.unshift(process.cwd()) - pathExt = (opt.pathExt || process.env.PATHEXT || '.EXE').split(colon) + pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM') + pathExt = pathExtExe.split(colon) + + + // Always test the cmd itself first. isexe will check to make sure + // it's found in the pathExt set. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '') pathExt.unshift('') } @@ -56,7 +36,11 @@ function getPathInfo(cmd, opt) { if (isAbsolute(cmd)) pathEnv = [''] - return {env: pathEnv, ext: pathExt} + return { + env: pathEnv, + ext: pathExt, + extExe: pathExtExe + } } function which (cmd, opt, cb) { @@ -68,18 +52,31 @@ function which (cmd, opt, cb) { var info = getPathInfo(cmd, opt) var pathEnv = info.env var pathExt = info.ext + var pathExtExe = info.extExe + var found = [] ;(function F (i, l) { - if (i === l) return cb(new Error('not found: '+cmd)) - var p = path.resolve(pathEnv[i], cmd) + if (i === l) { + if (opt.all && found.length) + return cb(null, found) + else + return cb(new Error('not found: '+cmd)) + } + + var pathPart = pathEnv[i] + if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') + pathPart = pathPart.slice(1, -1) + + var p = path.resolve(pathPart, cmd) ;(function E (ii, ll) { if (ii === ll) return F(i + 1, l) var ext = pathExt[ii] - fs.stat(p + ext, function (er, stat) { - if (!er && - stat.isFile() && - isExe(stat.mode, stat.uid, stat.gid)) { - return cb(null, p + ext) + isexe(p + ext, { pathExt: pathExtExe }, function (er, is) { + if (!er && is) { + if (opt.all) + found.push(p + ext) + else + return cb(null, p + ext) } return E(ii + 1, ll) }) @@ -93,19 +90,32 @@ function whichSync (cmd, opt) { var info = getPathInfo(cmd, opt) var pathEnv = info.env var pathExt = info.ext + var pathExtExe = info.extExe + var found = [] for (var i = 0, l = pathEnv.length; i < l; i ++) { - var p = path.join(pathEnv[i], cmd) + var pathPart = pathEnv[i] + if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"') + pathPart = pathPart.slice(1, -1) + + var p = path.join(pathPart, cmd) for (var j = 0, ll = pathExt.length; j < ll; j ++) { var cur = p + pathExt[j] - var stat + var is try { - stat = fs.statSync(cur) - if (stat.isFile() && isExe(stat.mode, stat.uid, stat.gid)) - return cur + is = isexe.sync(cur, { pathExt: pathExtExe }) + if (is) { + if (opt.all) + found.push(cur) + else + return cur + } } catch (ex) {} } } + if (opt.all && found.length) + return found + throw new Error('not found: '+cmd) } diff --git a/deps/npm/node_modules/wrappy/package.json b/deps/npm/node_modules/wrappy/package.json index b88e66283290ba..a617a72bb24187 100644 --- a/deps/npm/node_modules/wrappy/package.json +++ b/deps/npm/node_modules/wrappy/package.json @@ -15,7 +15,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/npm/wrappy" + "url": "git+https://github.com/npm/wrappy.git" }, "author": { "name": "Isaac Z. Schlueter", @@ -27,26 +27,10 @@ "url": "https://github.com/npm/wrappy/issues" }, "homepage": "https://github.com/npm/wrappy", - "gitHead": "006a8cbac6b99988315834c207896eed71fd069a", + "readme": "# wrappy\n\nCallback wrapping utility\n\n## USAGE\n\n```javascript\nvar wrappy = require(\"wrappy\")\n\n// var wrapper = wrappy(wrapperFunction)\n\n// make sure a cb is called only once\n// See also: http://npm.im/once for this specific use case\nvar once = wrappy(function (cb) {\n var called = false\n return function () {\n if (called) return\n called = true\n return cb.apply(this, arguments)\n }\n})\n\nfunction printBoo () {\n console.log('boo')\n}\n// has some rando property\nprintBoo.iAmBooPrinter = true\n\nvar onlyPrintOnce = once(printBoo)\n\nonlyPrintOnce() // prints 'boo'\nonlyPrintOnce() // does nothing\n\n// random property is retained!\nassert.equal(onlyPrintOnce.iAmBooPrinter, true)\n```\n", + "readmeFilename": "README.md", "_id": "wrappy@1.0.1", "_shasum": "1e65969965ccbc2db4548c6b84a6f2c5aedd4739", - "_from": "wrappy@1.0.1", - "_npmVersion": "2.0.0", - "_nodeVersion": "0.10.31", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "dist": { - "shasum": "1e65969965ccbc2db4548c6b84a6f2c5aedd4739", - "tarball": "http://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz" - }, "_resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz", - "readme": "ERROR: No README data found!" + "_from": "wrappy@>=1.0.1 <1.1.0" } diff --git a/deps/npm/node_modules/write-file-atomic/.travis.yml b/deps/npm/node_modules/write-file-atomic/.travis.yml new file mode 100644 index 00000000000000..3bc5d90c5666ca --- /dev/null +++ b/deps/npm/node_modules/write-file-atomic/.travis.yml @@ -0,0 +1,11 @@ +language: node_js +sudo: false +before_install: + - "npm -g install npm" +node_js: + - "0.8" + - "0.10" + - "0.12" + - "iojs" + - "4" + - "5" diff --git a/deps/npm/node_modules/write-file-atomic/index.js b/deps/npm/node_modules/write-file-atomic/index.js index f61a17038bd156..797e571779f9d8 100644 --- a/deps/npm/node_modules/write-file-atomic/index.js +++ b/deps/npm/node_modules/write-file-atomic/index.js @@ -1,45 +1,44 @@ 'use strict' -var fs = require('graceful-fs'); -var chain = require('slide').chain; -var crypto = require('crypto'); +var fs = require('graceful-fs') +var chain = require('slide').chain +var MurmurHash3 = require('imurmurhash') -var md5hex = function () { - var hash = crypto.createHash('md5'); - for (var ii=0; ii=1.1.4 <2.0.0", + "_id": "write-file-atomic@1.1.4", + "_inCache": true, + "_installable": true, + "_location": "/write-file-atomic", + "_nodeVersion": "5.1.0", + "_npmUser": { + "email": "ogd@aoaioxxysz.net", + "name": "othiym23" }, - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/iarna/write-file-atomic.git" + "_npmVersion": "3.5.1", + "_phantomChildren": {}, + "_requested": { + "name": "write-file-atomic", + "raw": "write-file-atomic@^1.1.4", + "rawSpec": "^1.1.4", + "scope": null, + "spec": ">=1.1.4 <2.0.0", + "type": "range" }, - "keywords": [ - "writeFile", - "atomic" + "_requiredBy": [ + "/" ], + "_shasum": "b1f52dc2e8dc0e3cb04d187a25f758a38a90ca3b", + "_shrinkwrap": null, + "_spec": "write-file-atomic@^1.1.4", + "_where": "/Users/ogd/Documents/projects/npm/npm", "author": { - "name": "Rebecca Turner", "email": "me@re-becca.org", + "name": "Rebecca Turner", "url": "http://re-becca.org" }, - "license": "ISC", "bugs": { "url": "https://github.com/iarna/write-file-atomic/issues" }, - "homepage": "https://github.com/iarna/write-file-atomic", "dependencies": { "graceful-fs": "^4.1.2", + "imurmurhash": "^0.1.4", "slide": "^1.1.5" }, + "description": "Write files in an atomic fashion w/configurable ownership", "devDependencies": { "require-inject": "^1.1.0", - "tap": "^0.4.12" - }, - "gitHead": "65a1e2e156c0d0bfb7acac2e039b943d6ec9876d", - "_id": "write-file-atomic@1.1.3", - "_shasum": "60eaca258a0b559b37aca82b21d64a293b4b90d0", - "_from": "write-file-atomic@1.1.3", - "_npmVersion": "3.3.0", - "_nodeVersion": "3.1.0", - "_npmUser": { - "name": "iarna", - "email": "me@re-becca.org" + "standard": "^5.4.1", + "tap": "^2.3.1" }, + "directories": {}, "dist": { - "shasum": "60eaca258a0b559b37aca82b21d64a293b4b90d0", - "tarball": "http://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.1.3.tgz" + "shasum": "b1f52dc2e8dc0e3cb04d187a25f758a38a90ca3b", + "tarball": "http://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.1.4.tgz" }, + "gitHead": "42dc04a17af96ac045f4979c8c951ee5a14a8b8b", + "homepage": "https://github.com/iarna/write-file-atomic", + "keywords": [ + "atomic", + "writeFile" + ], + "license": "ISC", + "main": "index.js", "maintainers": [ { "name": "iarna", "email": "me@re-becca.org" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.1.3.tgz" + "name": "write-file-atomic", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/iarna/write-file-atomic.git" + }, + "scripts": { + "test": "standard && tap --coverage test/*.js" + }, + "version": "1.1.4" } diff --git a/deps/npm/node_modules/write-file-atomic/test/basic.js b/deps/npm/node_modules/write-file-atomic/test/basic.js index a3227eaa1de40d..13b971973321d2 100644 --- a/deps/npm/node_modules/write-file-atomic/test/basic.js +++ b/deps/npm/node_modules/write-file-atomic/test/basic.js @@ -1,97 +1,97 @@ -"use strict"; -var test = require('tap').test; -var requireInject = require('require-inject'); +'use strict' +var test = require('tap').test +var requireInject = require('require-inject') var writeFileAtomic = requireInject('../index', { - 'graceful-fs': { - writeFile: function (tmpfile, data, options, cb) { - if (/nowrite/.test(tmpfile)) return cb('ENOWRITE'); - cb(); - }, - chown: function (tmpfile, uid, gid, cb) { - if (/nochown/.test(tmpfile)) return cb('ENOCHOWN'); - cb(); - }, - rename: function (tmpfile, filename, cb) { - if (/norename/.test(tmpfile)) return cb('ENORENAME'); - cb(); - }, - unlink: function (tmpfile, cb) { - if (/nounlink/.test(tmpfile)) return cb('ENOUNLINK'); - cb(); - }, - writeFileSync: function (tmpfile, data, options) { - if (/nowrite/.test(tmpfile)) throw 'ENOWRITE'; - }, - chownSync: function (tmpfile, uid, gid) { - if (/nochown/.test(tmpfile)) throw 'ENOCHOWN'; - }, - renameSync: function (tmpfile, filename) { - if (/norename/.test(tmpfile)) throw 'ENORENAME'; - }, - unlinkSync: function (tmpfile) { - if (/nounlink/.test(tmpfile)) throw 'ENOUNLINK'; - }, + 'graceful-fs': { + writeFile: function (tmpfile, data, options, cb) { + if (/nowrite/.test(tmpfile)) return cb(new Error('ENOWRITE')) + cb() + }, + chown: function (tmpfile, uid, gid, cb) { + if (/nochown/.test(tmpfile)) return cb(new Error('ENOCHOWN')) + cb() + }, + rename: function (tmpfile, filename, cb) { + if (/norename/.test(tmpfile)) return cb(new Error('ENORENAME')) + cb() + }, + unlink: function (tmpfile, cb) { + if (/nounlink/.test(tmpfile)) return cb(new Error('ENOUNLINK')) + cb() + }, + writeFileSync: function (tmpfile, data, options) { + if (/nowrite/.test(tmpfile)) throw new Error('ENOWRITE') + }, + chownSync: function (tmpfile, uid, gid) { + if (/nochown/.test(tmpfile)) throw new Error('ENOCHOWN') + }, + renameSync: function (tmpfile, filename) { + if (/norename/.test(tmpfile)) throw new Error('ENORENAME') + }, + unlinkSync: function (tmpfile) { + if (/nounlink/.test(tmpfile)) throw new Error('ENOUNLINK') } -}); -var writeFileAtomicSync = writeFileAtomic.sync; + } +}) +var writeFileAtomicSync = writeFileAtomic.sync test('async tests', function (t) { - t.plan(7); - writeFileAtomic('good', 'test', {mode: '0777'}, function (err) { - t.notOk(err, 'No errors occur when passing in options'); - }); - writeFileAtomic('good', 'test', function (err) { - t.notOk(err, 'No errors occur when NOT passing in options'); - }); - writeFileAtomic('nowrite', 'test', function (err) { - t.is(err, 'ENOWRITE', 'writeFile failures propagate'); - }); - writeFileAtomic('nochown', 'test', {chown: {uid:100,gid:100}}, function (err) { - t.is(err, 'ENOCHOWN', 'Chown failures propagate'); - }); - writeFileAtomic('nochown', 'test', function (err) { - t.notOk(err, 'No attempt to chown when no uid/gid passed in'); - }); - writeFileAtomic('norename', 'test', function (err) { - t.is(err, 'ENORENAME', 'Rename errors propagate'); - }); - writeFileAtomic('norename nounlink', 'test', function (err) { - t.is(err, 'ENORENAME', 'Failure to unlink the temp file does not clobber the original error'); - }); -}); + t.plan(7) + writeFileAtomic('good', 'test', {mode: '0777'}, function (err) { + t.notOk(err, 'No errors occur when passing in options') + }) + writeFileAtomic('good', 'test', function (err) { + t.notOk(err, 'No errors occur when NOT passing in options') + }) + writeFileAtomic('nowrite', 'test', function (err) { + t.is(err.message, 'ENOWRITE', 'writeFile failures propagate') + }) + writeFileAtomic('nochown', 'test', {chown: {uid: 100, gid: 100}}, function (err) { + t.is(err.message, 'ENOCHOWN', 'Chown failures propagate') + }) + writeFileAtomic('nochown', 'test', function (err) { + t.notOk(err, 'No attempt to chown when no uid/gid passed in') + }) + writeFileAtomic('norename', 'test', function (err) { + t.is(err.message, 'ENORENAME', 'Rename errors propagate') + }) + writeFileAtomic('norename nounlink', 'test', function (err) { + t.is(err.message, 'ENORENAME', 'Failure to unlink the temp file does not clobber the original error') + }) +}) test('sync tests', function (t) { - t.plan(7); - var throws = function (shouldthrow, msg, todo) { - var err; - try { todo() } catch (e) { err = e } - t.is(shouldthrow,err,msg); - } - var noexception = function (msg, todo) { - var err; - try { todo() } catch (e) { err = e } - t.notOk(err,msg); - } + t.plan(7) + var throws = function (shouldthrow, msg, todo) { + var err + try { todo() } catch (e) { err = e } + t.is(shouldthrow, err.message, msg) + } + var noexception = function (msg, todo) { + var err + try { todo() } catch (e) { err = e } + t.notOk(err, msg) + } - noexception('No errors occur when passing in options',function (){ - writeFileAtomicSync('good', 'test', {mode: '0777'}); - }) - noexception('No errors occur when NOT passing in options',function (){ - writeFileAtomicSync('good', 'test'); - }); - throws('ENOWRITE', 'writeFile failures propagate', function () { - writeFileAtomicSync('nowrite', 'test'); - }); - throws('ENOCHOWN', 'Chown failures propagate', function () { - writeFileAtomicSync('nochown', 'test', {chown: {uid:100,gid:100}}); - }); - noexception('No attempt to chown when no uid/gid passed in', function (){ - writeFileAtomicSync('nochown', 'test'); - }); - throws('ENORENAME', 'Rename errors propagate', function (){ - writeFileAtomicSync('norename', 'test'); - }); - throws('ENORENAME', 'Failure to unlink the temp file does not clobber the original error', function (){ - writeFileAtomicSync('norename nounlink', 'test'); - }); -}); + noexception('No errors occur when passing in options', function () { + writeFileAtomicSync('good', 'test', {mode: '0777'}) + }) + noexception('No errors occur when NOT passing in options', function () { + writeFileAtomicSync('good', 'test') + }) + throws('ENOWRITE', 'writeFile failures propagate', function () { + writeFileAtomicSync('nowrite', 'test') + }) + throws('ENOCHOWN', 'Chown failures propagate', function () { + writeFileAtomicSync('nochown', 'test', {chown: {uid: 100, gid: 100}}) + }) + noexception('No attempt to chown when no uid/gid passed in', function () { + writeFileAtomicSync('nochown', 'test') + }) + throws('ENORENAME', 'Rename errors propagate', function () { + writeFileAtomicSync('norename', 'test') + }) + throws('ENORENAME', 'Failure to unlink the temp file does not clobber the original error', function () { + writeFileAtomicSync('norename nounlink', 'test') + }) +}) diff --git a/deps/npm/package.json b/deps/npm/package.json index 6d2f755d383dd5..ec38da222ff146 100644 --- a/deps/npm/package.json +++ b/deps/npm/package.json @@ -1,11 +1,11 @@ { - "version": "2.14.7", + "version": "3.8.6", "name": "npm", "description": "a package manager for JavaScript", "keywords": [ - "package manager", - "modules", "install", + "modules", + "package manager", "package.json" ], "preferGlobal": true, @@ -19,118 +19,132 @@ "url": "https://github.com/npm/npm" }, "bugs": { - "url": "http://github.com/npm/npm/issues" + "url": "https://github.com/npm/npm/issues" }, "directories": { + "bin": "./bin", "doc": "./doc", - "man": "./man", "lib": "./lib", - "bin": "./bin" + "man": "./man" }, "main": "./lib/npm.js", "bin": "./bin/npm-cli.js", "dependencies": { "abbrev": "~1.0.7", - "ansi": "~0.3.0", "ansicolors": "~0.3.2", "ansistyles": "~0.1.3", + "aproba": "~1.0.1", "archy": "~1.0.0", - "async-some": "~1.0.2", - "block-stream": "0.0.8", - "char-spinner": "~1.0.1", - "chmodr": "~1.0.1", "chownr": "~1.0.1", - "cmd-shim": "~2.0.1", - "columnify": "~1.5.2", - "config-chain": "~1.1.9", + "cmd-shim": "~2.0.2", + "columnify": "~1.5.4", + "config-chain": "~1.1.10", "dezalgo": "~1.0.3", "editor": "~1.0.0", "fs-vacuum": "~1.2.7", - "fs-write-stream-atomic": "~1.0.4", + "fs-write-stream-atomic": "~1.0.8", "fstream": "~1.0.8", - "fstream-npm": "~1.0.5", - "github-url-from-git": "~1.4.0", - "github-url-from-username-repo": "~1.0.2", - "glob": "~5.0.15", - "graceful-fs": "~4.1.2", + "fstream-npm": "~1.0.7", + "glob": "~7.0.3", + "graceful-fs": "~4.1.3", + "has-unicode": "~2.0.0", "hosted-git-info": "~2.1.4", + "iferr": "~0.1.5", "inflight": "~1.0.4", "inherits": "~2.0.1", "ini": "~1.3.4", - "init-package-json": "~1.9.1", + "init-package-json": "~1.9.3", "lockfile": "~1.0.1", - "lru-cache": "~2.7.0", - "minimatch": "~2.0.10", + "lodash._baseuniq": "~4.5.1", + "lodash.clonedeep": "~4.3.2", + "lodash.isarray": "~4.0.0", + "lodash.keys": "~4.0.5", + "lodash.union": "~4.2.1", + "lodash.uniq": "~4.2.1", + "lodash.without": "~4.1.2", "mkdirp": "~0.5.1", - "node-gyp": "~3.0.3", - "nopt": "~3.0.4", + "node-gyp": "~3.3.1", + "nopt": "~3.0.6", "normalize-git-url": "~3.0.1", - "normalize-package-data": "~2.3.4", + "normalize-package-data": "~2.3.5", "npm-cache-filename": "~1.0.2", - "npm-install-checks": "~1.0.6", - "npm-package-arg": "~4.0.2", - "npm-registry-client": "~7.0.7", + "npm-install-checks": "~3.0.0", + "npm-package-arg": "~4.1.0", + "npm-registry-client": "~7.1.0", "npm-user-validate": "~0.1.2", - "npmlog": "~1.2.1", - "once": "~1.3.2", + "npmlog": "~2.0.3", + "once": "~1.3.3", "opener": "~1.4.1", "osenv": "~0.1.3", - "path-is-inside": "~1.0.0", + "path-is-inside": "~1.0.1", "read": "~1.0.7", + "read-cmd-shim": "~1.0.1", "read-installed": "~4.0.3", - "read-package-json": "~2.0.1", - "readable-stream": "~1.1.13", + "read-package-json": "~2.0.3", + "read-package-tree": "~5.1.2", + "readable-stream": "~2.0.6", "realize-package-specifier": "~3.0.1", - "request": "~2.64.0", - "retry": "~0.8.0", - "rimraf": "~2.4.3", - "semver": "~5.0.3", + "request": "~2.69.0", + "retry": "~0.9.0", + "rimraf": "~2.5.2", + "semver": "~5.1.0", "sha": "~2.0.1", "slide": "~1.1.6", - "sorted-object": "~1.0.0", - "spdx": "~0.4.1", + "sorted-object": "~2.0.0", + "strip-ansi": "~3.0.1", "tar": "~2.2.1", "text-table": "~0.2.0", "uid-number": "0.0.6", "umask": "~1.1.0", - "validate-npm-package-license": "~3.0.1", + "unique-filename": "~1.1.0", + "unpipe": "~1.0.0", "validate-npm-package-name": "~2.2.2", - "which": "~1.1.2", + "which": "~1.2.4", "wrappy": "~1.0.1", - "write-file-atomic": "~1.1.3" + "write-file-atomic": "~1.1.4" }, "bundleDependencies": [ "abbrev", - "ansi", + "ansi-regex", "ansicolors", "ansistyles", + "aproba", "archy", - "async-some", - "block-stream", - "char-spinner", - "chmodr", "chownr", "cmd-shim", "columnify", "config-chain", + "debuglog", "dezalgo", "editor", "fs-vacuum", "fs-write-stream-atomic", "fstream", "fstream-npm", - "github-url-from-git", - "github-url-from-username-repo", "glob", "graceful-fs", + "has-unicode", "hosted-git-info", + "iferr", + "imurmurhash", "inflight", "inherits", "ini", "init-package-json", "lockfile", - "lru-cache", - "minimatch", + "lodash._baseindexof", + "lodash._baseuniq", + "lodash._bindcallback", + "lodash._cacheindexof", + "lodash._createcache", + "lodash._getnative", + "lodash.clonedeep", + "lodash.isarray", + "lodash.keys", + "lodash.restparam", + "lodash.union", + "lodash.uniq", + "lodash.without", "mkdirp", "node-gyp", "nopt", @@ -147,9 +161,12 @@ "osenv", "path-is-inside", "read", + "read-cmd-shim", "read-installed", "read-package-json", + "read-package-tree", "readable-stream", + "readdir-scoped-modules", "realize-package-specifier", "request", "retry", @@ -158,11 +175,13 @@ "sha", "slide", "sorted-object", - "spdx", + "strip-ansi", "tar", "text-table", "uid-number", "umask", + "unique-filename", + "unpipe", "validate-npm-package-license", "validate-npm-package-name", "which", @@ -171,24 +190,24 @@ ], "devDependencies": { "deep-equal": "~1.0.1", - "marked": "~0.3.3", + "marked": "~0.3.5", "marked-man": "~0.1.5", - "nock": "~2.13.0", - "npm-registry-couchapp": "~2.6.7", - "npm-registry-mock": "~1.0.0", - "require-inject": "~1.2.0", - "sprintf-js": "~1.0.2", - "tap": "~1.4.1" + "npm-registry-couchapp": "~2.6.12", + "npm-registry-mock": "~1.0.1", + "require-inject": "~1.3.1", + "sprintf-js": "~1.0.3", + "standard": "~5.4.1", + "tacks": "~1.0.9", + "tap": "~5.7.0" }, "scripts": { "dumpconf": "env | grep npm | sort | uniq", - "prepublish": "node bin/npm-cli.js prune --prefix=. --no-global && rimraf test/*/*/node_modules && make -j4 doc", + "prepublish": "node bin/npm-cli.js prune --prefix=. --no-global && rimraf test/*/*/node_modules && make doc-clean && make -j4 doc", "preversion": "bash scripts/update-authors.sh && git add AUTHORS && git commit -m \"update AUTHORS\" || true", "tap": "tap --timeout 240", - "test": "npm run test-tap", - "test-all": "npm run test-legacy && npm run test-tap", - "test-legacy": "node ./test/run.js", - "test-tap": "npm run tap -- \"test/tap/*.js\"" + "test": "standard && npm run test-tap", + "test-tap": "npm run tap -- \"test/tap/*.js\"", + "test-node": "\"$NODE\" \"node_modules/.bin/tap\" --timeout 240 \"test/tap/*.js\"" }, "license": "Artistic-2.0" } diff --git a/deps/npm/scripts/changelog.js b/deps/npm/scripts/changelog.js new file mode 100644 index 00000000000000..35685ffc6031b3 --- /dev/null +++ b/deps/npm/scripts/changelog.js @@ -0,0 +1,95 @@ +'use strict' +/* +Usage: + +node scripts/changelog.js [comittish] + +Generates changelog entries in our format as best as its able based on +commits starting at comittish, or if that's not passed, master. + +Ordinarily this is run via the gen-changelog shell script, which appends +the result to the changelog. + +*/ +const execSync = require('child_process').execSync +const branch = process.argv[2] || 'master' +const log = execSync(`git log --pretty='format:%h %H%d %s (%aN)%n%b%n---%n' ${branch}...`).toString().split(/\n/) +const authormap = { + 'Rebecca Turner': 'iarna', + 'Forrest L Norvell': 'othiym23', + 'Kyle Mitchell': 'kemitchell', + 'Chris Rebert': 'cvrebert', + 'Kat Marchán': 'zkat' +} + +main() + +function print_commit (c) { + let m + console.log(`* [\`${c.shortid}\`](https://github.com/npm/npm/commit/${c.fullid})`) + if (c.fixes) { + console.log(` [#${c.fixes}](https://github.com/npm/npm/issues/${c.fixes})`) + } else if (c.prurl && (m = c.prurl.match(/https:\/\/github.com\/([^/]+\/[^/]+)\/pull\/(\d+)/))) { + let repo = m[1] + let prid = m[2] + if (repo !== 'npm/npm') { + console.log(` [${repo}#${prid}](${c.prurl})`) + } else { + console.log(` [#${prid}](${c.prurl})`) + } + } else if (c.prurl) { + console.log(` [#](${c.prurl})`) + } + let msg = c.message + .replace(/^\s+/mg, '') + .replace(/^[-a-z]+: /, '') + .replace(/^/mg, ' ') + .replace(/\n$/, '') + // backtickify package@version + .replace(/^(\s*[^@\s]+@\d+[.]\d+[.]\d+)(\s*\S)/g, '$1:$2') + .replace(/\b([^@\s]+@\d+[.]\d+[.]\d+)\b/g, '`$1`') + // linkify commitids + .replace(/\b([a-f0-9]{7,8})\b/g, '[`$1`](https://github.com/npm/npm/commit/$1)') + .replace(/\b#(\d+)\b/g, '[#$1](https://github.com/npm/npm/issues/$1)') + console.log(msg) + if (c.credit) { + c.credit.forEach(function (credit) { + console.log(` ([@${credit}](https://github.com/${credit}))`) + }) + } else { + console.log(` ([@${c.author}](https://github.com/${c.author}))`) + } +} + +function main () { + let commit + log.forEach(function (line) { + let m + /*eslint no-cond-assign:0*/ + if (/^---$/.test(line)) { + print_commit(commit) + } else if (m = line.match(/^([a-f0-9]{7}) ([a-f0-9]+) (?:[(]([^)]+)[)] )?(.*?) [(](.*?)[)]/)) { + commit = { + shortid: m[1], + fullid: m[2], + branch: m[3], + message: m[4], + author: authormap[m[5]] || m[5], + prurl: null, + fixes: null, + credit: null + } + } else if (m = line.match(/^PR-URL: (.*)/)) { + commit.prurl = m[1] + } else if (m = line.match(/^Credit: @(.*)/)) { + if (!commit.credit) commit.credit = [] + commit.credit.push(m[1]) + } else if (m = line.match(/^Fixes: #(.*)/)) { + commit.fixes = m[1] + } else if (m = line.match(/^Reviewed-By: @(.*)/)) { + commit.reviewed = m[1] + } else if (/\S/.test(line)) { + commit.message += `\n${line}` + } + }) +} diff --git a/deps/npm/scripts/gen-changelog b/deps/npm/scripts/gen-changelog new file mode 100755 index 00000000000000..efec4d54e7bcc6 --- /dev/null +++ b/deps/npm/scripts/gen-changelog @@ -0,0 +1,7 @@ +#!/bin/sh +# Usage: gen-changelog [comittish] +# Reads all the commits since comittish and produces changelog entries in +# our style as best as it can, appendning them to CHANGELOG.md. If it +# encounters a git error it won't modify CHANGELOG.md +# @iarna uses this as the first step in producing changelogs for a release. +(node $(npm prefix)/scripts/changelog.js "$@"; cat CHANGELOG.md) > new.md && mv new.md CHANGELOG.md diff --git a/deps/npm/scripts/index-build.js b/deps/npm/scripts/index-build.js index 21297cc93ec1d3..058bc74019fe9b 100755 --- a/deps/npm/scripts/index-build.js +++ b/deps/npm/scripts/index-build.js @@ -1,63 +1,58 @@ #!/usr/bin/env node -var fs = require("fs") - , path = require("path") - , root = path.resolve(__dirname, "..") - , glob = require("glob") - , conversion = { "cli": 1, "api": 3, "files": 5, "misc": 7 } - -glob(root + "/{README.md,doc/*/*.md}", function (er, files) { - if (er) - throw er +var fs = require('fs') +var path = require('path') +var root = path.resolve(__dirname, '..') +var glob = require('glob') +var conversion = { 'cli': 1, 'api': 3, 'files': 5, 'misc': 7 } + +glob(root + '/{README.md,doc/*/*.md}', function (er, files) { + if (er) throw er + output(files.map(function (f) { var b = path.basename(f) - if (b === "README.md") - return [0, b] - if (b === "index.md") - return null + if (b === 'README.md') return [0, b] + if (b === 'index.md') return null var s = conversion[path.basename(path.dirname(f))] return [s, f] }).filter(function (f) { return f }).sort(function (a, b) { return (a[0] === b[0]) - ? ( path.basename(a[1]) === "npm.md" ? -1 - : path.basename(b[1]) === "npm.md" ? 1 - : a[1] > b[1] ? 1 : -1 ) - : a[0] - b[0] + ? (path.basename(a[1]) === 'npm.md' ? -1 + : path.basename(b[1]) === 'npm.md' ? 1 + : a[1] > b[1] ? 1 : -1) + : a[0] - b[0] })) }) -return - function output (files) { console.log( - "npm-index(7) -- Index of all npm documentation\n" + - "==============================================\n") + 'npm-index(7) -- Index of all npm documentation\n' + + '==============================================\n') writeLines(files, 0) - writeLines(files, 1, "Command Line Documentation", "Using npm on the command line") - writeLines(files, 3, "API Documentation", "Using npm in your Node programs") - writeLines(files, 5, "Files", "File system structures npm uses") - writeLines(files, 7, "Misc", "Various other bits and bobs") + writeLines(files, 1, 'Command Line Documentation', 'Using npm on the command line') + writeLines(files, 3, 'API Documentation', 'Using npm in your Node programs') + writeLines(files, 5, 'Files', 'File system structures npm uses') + writeLines(files, 7, 'Misc', 'Various other bits and bobs') } function writeLines (files, sxn, heading, desc) { if (heading) { - console.log("## %s\n\n%s\n", heading, desc) + console.log('## %s\n\n%s\n', heading, desc) } files.filter(function (f) { return f[0] === sxn }).forEach(writeLine) } - function writeLine (sd) { var sxn = sd[0] || 1 - , doc = sd[1] - , d = path.basename(doc, ".md") + var doc = sd[1] + var d = path.basename(doc, '.md') - var content = fs.readFileSync(doc, "utf8").split("\n")[0].split("-- ")[1] + var content = fs.readFileSync(doc, 'utf8').split('\n')[0].split('-- ')[1] - console.log("### %s(%d)\n", d, sxn) - console.log(content + "\n") + console.log('### %s(%d)\n', d, sxn) + console.log(content + '\n') } diff --git a/deps/npm/scripts/publish-tag.js b/deps/npm/scripts/publish-tag.js index 046ec9888109c4..d0c04556e1b322 100644 --- a/deps/npm/scripts/publish-tag.js +++ b/deps/npm/scripts/publish-tag.js @@ -1,3 +1,3 @@ -var semver = require("semver") -var version = semver.parse(require("../package.json").version) +var semver = require('semver') +var version = semver.parse(require('../package.json').version) console.log('v%s.%s-next', version.major, version.minor) diff --git a/deps/npm/test/common-tap.js b/deps/npm/test/common-tap.js index 3537df68761aa6..d7e9c8f7d09afc 100644 --- a/deps/npm/test/common-tap.js +++ b/deps/npm/test/common-tap.js @@ -12,12 +12,17 @@ var path = require('path') var port = exports.port = 1337 exports.registry = 'http://localhost:' + port process.env.npm_config_loglevel = 'error' +process.env.npm_config_progress = 'false' var npm_config_cache = path.resolve(__dirname, 'npm_cache') process.env.npm_config_cache = exports.npm_config_cache = npm_config_cache process.env.npm_config_userconfig = exports.npm_config_userconfig = path.join(__dirname, 'fixtures', 'config', 'userconfig') process.env.npm_config_globalconfig = exports.npm_config_globalconfig = path.join(__dirname, 'fixtures', 'config', 'globalconfig') +process.env.npm_config_global_style = 'false' +process.env.npm_config_legacy_bundling = 'false' process.env.random_env_var = 'foo' +// suppress warnings about using a prerelease version of node +process.env.npm_config_node_version = process.version.replace(/-.*$/, '') var bin = exports.bin = require.resolve('../bin/npm-cli.js') var chain = require('slide').chain @@ -68,7 +73,7 @@ exports.makeGitRepo = function (params, cb) { var added = params.added || ['package.json'] var message = params.message || 'stub repo' - var opts = { cwd: root, env: { PATH: process.env.PATH }} + var opts = { cwd: root, env: { PATH: process.env.PATH } } var commands = [ git.chainableExec(['init'], opts), git.chainableExec(['config', 'user.name', user], opts), diff --git a/deps/npm/test/common.js b/deps/npm/test/common.js deleted file mode 100644 index 2755056b1b491c..00000000000000 --- a/deps/npm/test/common.js +++ /dev/null @@ -1,7 +0,0 @@ - -// whatever, it's just tests. -;["util","assert"].forEach(function (thing) { - thing = require("thing") - for (var i in thing) global[i] = thing[i] -} - diff --git a/deps/npm/test/disabled/bundlerecurs/package.json b/deps/npm/test/disabled/bundlerecurs/package.json deleted file mode 100644 index d870411706c048..00000000000000 --- a/deps/npm/test/disabled/bundlerecurs/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ "name" : "bundletest" -, "version" : "1.0.0" -, "dependencies" : { "bundletest" : "*" } -} diff --git a/deps/npm/test/disabled/change-bin-1/bin/foo b/deps/npm/test/disabled/change-bin-1/bin/foo deleted file mode 100644 index fb16c2b23cc059..00000000000000 --- a/deps/npm/test/disabled/change-bin-1/bin/foo +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -echo "foo" diff --git a/deps/npm/test/disabled/change-bin-1/package.json b/deps/npm/test/disabled/change-bin-1/package.json deleted file mode 100644 index 0d82f3afa3b59a..00000000000000 --- a/deps/npm/test/disabled/change-bin-1/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{"name":"npm-test-change-bin" -,"version":"1.2.3" -,"directories":{"bin":"./bin"}} diff --git a/deps/npm/test/disabled/change-bin-2/bin/bar b/deps/npm/test/disabled/change-bin-2/bin/bar deleted file mode 100644 index fb16c2b23cc059..00000000000000 --- a/deps/npm/test/disabled/change-bin-2/bin/bar +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -echo "foo" diff --git a/deps/npm/test/disabled/change-bin-2/package.json b/deps/npm/test/disabled/change-bin-2/package.json deleted file mode 100644 index 3fdc538fa2698f..00000000000000 --- a/deps/npm/test/disabled/change-bin-2/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{"name":"npm-test-change-bin" -,"version":"2.3.4" -,"directories":{"bin":"./bin"}} diff --git a/deps/npm/test/disabled/failer/package.json b/deps/npm/test/disabled/failer/package.json deleted file mode 100644 index ff596d158ba7aa..00000000000000 --- a/deps/npm/test/disabled/failer/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ "name" : "npm-test-failer" -, "version" : "9999.999.99" -, "dependencies" : { "base64" : "*" } -, "scripts" : { "install" : "exit 1", "test": "echo 'This is where the test output would go'; echo 'more test output'; echo 'MOAR MOAR MoAR'; exit 1" } -} diff --git a/deps/npm/test/disabled/fast/package.json b/deps/npm/test/disabled/fast/package.json deleted file mode 100644 index fbf26e9b14d956..00000000000000 --- a/deps/npm/test/disabled/fast/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ "name" : "fast" -, "description" : "does nothing, and not very fast" -, "version" : "1.2.3" -, "scripts" : -{ "preinstall" : "sleep 1 && echo fast 1 $(date +%s) && echo fast 2" -, "install" : "sleep 1 && echo fast 2 $(date +%s) && echo fast 3" -, "postinstall" : "sleep 1 && echo fast 3 $(date +%s) && echo fast 4" -} -} diff --git a/deps/npm/test/disabled/package-bar/package.json b/deps/npm/test/disabled/package-bar/package.json deleted file mode 100644 index f9a278010f6dfb..00000000000000 --- a/deps/npm/test/disabled/package-bar/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "package-bar", - "version": "0.5.0", - "dependencies": { - "package-foo": "*" - } -} diff --git a/deps/npm/test/disabled/package-config/package.json b/deps/npm/test/disabled/package-config/package.json deleted file mode 100644 index 7ec97d3805375f..00000000000000 --- a/deps/npm/test/disabled/package-config/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{"name":"package-config" -,"version":"1.2.3" -,"config":{"foo":"bar"} -,"scripts":{"test":"./test.js"}} diff --git a/deps/npm/test/disabled/package-config/test.js b/deps/npm/test/disabled/package-config/test.js deleted file mode 100755 index 7337b237b5f4fb..00000000000000 --- a/deps/npm/test/disabled/package-config/test.js +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env node - -var env = process.env - , orig = require(process.env.npm_package_name+"/package.json").config - , assert = require("assert") - -console.log("Before running this test, do:\n" - +" npm config set package-config:foo boo\n" - +"or else it's about to fail.") -assert.equal(env.npm_package_config_foo, "boo", "foo != boo") -assert.equal(orig.foo, "bar", "original foo != bar") -assert.equal(env["npm_config_package-config:foo"], "boo", - "package-config:foo != boo") -console.log({ foo: env.npm_package_config_foo - , orig_foo: orig.foo - , "package-config:foo": env["npm_config_package-config:foo"] - }) diff --git a/deps/npm/test/disabled/package-foo/package.json b/deps/npm/test/disabled/package-foo/package.json deleted file mode 100644 index 31e791f646f15a..00000000000000 --- a/deps/npm/test/disabled/package-foo/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "package-foo", - "version": "0.5.0" -} diff --git a/deps/npm/test/disabled/slow/package.json b/deps/npm/test/disabled/slow/package.json deleted file mode 100644 index ba6be42fa9502b..00000000000000 --- a/deps/npm/test/disabled/slow/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ "name" : "slow" -, "description" : "just like fast, but even slower" -, "version" : "1.2.3" -, "scripts" : - { "preinstall" : "sleep 1 && echo slow 1 $(date +%s) && sleep 1 && echo slow 2 $(date +%s)" - , "install" : "sleep 1 && echo slow 2 $(date +%s) && sleep 1 && echo slow 3 $(date +%s)" - , "postinstall" : "sleep 1 && echo slow 3 $(date +%s) && sleep 1 && echo slow 4 $(date +%s)" - } -} diff --git a/deps/npm/test/fixtures/onload.js b/deps/npm/test/fixtures/onload.js new file mode 100644 index 00000000000000..90c1a3aa55e77a --- /dev/null +++ b/deps/npm/test/fixtures/onload.js @@ -0,0 +1 @@ +console.error('called onload') diff --git a/deps/npm/test/packages/npm-test-array-bin/README b/deps/npm/test/packages/npm-test-array-bin/README deleted file mode 100644 index 8848f0786872f2..00000000000000 --- a/deps/npm/test/packages/npm-test-array-bin/README +++ /dev/null @@ -1 +0,0 @@ -just an npm test diff --git a/deps/npm/test/packages/npm-test-array-bin/bin/array-bin b/deps/npm/test/packages/npm-test-array-bin/bin/array-bin deleted file mode 100644 index 9558516aad0c79..00000000000000 --- a/deps/npm/test/packages/npm-test-array-bin/bin/array-bin +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -console.log('ok') diff --git a/deps/npm/test/packages/npm-test-array-bin/package.json b/deps/npm/test/packages/npm-test-array-bin/package.json deleted file mode 100644 index 45e22efc41c9e0..00000000000000 --- a/deps/npm/test/packages/npm-test-array-bin/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ "name":"npm-test-array-bin" -, "version":"1.2.5" -, "bin": [ "bin/array-bin" ] -, "scripts": { "test": "node test.js" } } diff --git a/deps/npm/test/packages/npm-test-array-bin/test.js b/deps/npm/test/packages/npm-test-array-bin/test.js deleted file mode 100644 index 984bedb47f4306..00000000000000 --- a/deps/npm/test/packages/npm-test-array-bin/test.js +++ /dev/null @@ -1,4 +0,0 @@ -require('child_process').exec('array-bin', { env: process.env }, - function (err) { - if (err && err.code) throw new Error('exited badly with code = ' + err.code) -}) diff --git a/deps/npm/test/packages/npm-test-blerg/README b/deps/npm/test/packages/npm-test-blerg/README deleted file mode 100644 index 8848f0786872f2..00000000000000 --- a/deps/npm/test/packages/npm-test-blerg/README +++ /dev/null @@ -1 +0,0 @@ -just an npm test diff --git a/deps/npm/test/packages/npm-test-blerg/package.json b/deps/npm/test/packages/npm-test-blerg/package.json deleted file mode 100644 index 04e3338918716f..00000000000000 --- a/deps/npm/test/packages/npm-test-blerg/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ "name":"npm-test-blerg" -, "version" : "0.0.2" -, "scripts" : { "test" : "node test.js" } -, "publishConfig": {"tag": "foo"} -} diff --git a/deps/npm/test/packages/npm-test-blerg/test.js b/deps/npm/test/packages/npm-test-blerg/test.js deleted file mode 100644 index f548458ac042c5..00000000000000 --- a/deps/npm/test/packages/npm-test-blerg/test.js +++ /dev/null @@ -1,5 +0,0 @@ - -var assert = require("assert") -assert.equal(undefined, process.env.npm_config__password, "password exposed!") -assert.equal(undefined, process.env.npm_config__auth, "auth exposed!") -assert.equal(undefined, process.env.npm_config__authCrypt, "authCrypt exposed!") diff --git a/deps/npm/test/packages/npm-test-blerg3/README b/deps/npm/test/packages/npm-test-blerg3/README deleted file mode 100644 index 8848f0786872f2..00000000000000 --- a/deps/npm/test/packages/npm-test-blerg3/README +++ /dev/null @@ -1 +0,0 @@ -just an npm test diff --git a/deps/npm/test/packages/npm-test-blerg3/package.json b/deps/npm/test/packages/npm-test-blerg3/package.json deleted file mode 100644 index 87b5bbb96e54ec..00000000000000 --- a/deps/npm/test/packages/npm-test-blerg3/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ "name":"npm-test-blerg3" -, "homepage": "https://github.com/npm/npm/issues/2658" -, "version" : "0.0.0" -, "scripts" : { "test" : "node test.js" } -} diff --git a/deps/npm/test/packages/npm-test-blerg3/test.js b/deps/npm/test/packages/npm-test-blerg3/test.js deleted file mode 100644 index f548458ac042c5..00000000000000 --- a/deps/npm/test/packages/npm-test-blerg3/test.js +++ /dev/null @@ -1,5 +0,0 @@ - -var assert = require("assert") -assert.equal(undefined, process.env.npm_config__password, "password exposed!") -assert.equal(undefined, process.env.npm_config__auth, "auth exposed!") -assert.equal(undefined, process.env.npm_config__authCrypt, "authCrypt exposed!") diff --git a/deps/npm/test/packages/npm-test-bundled-git/README b/deps/npm/test/packages/npm-test-bundled-git/README deleted file mode 100644 index 8848f0786872f2..00000000000000 --- a/deps/npm/test/packages/npm-test-bundled-git/README +++ /dev/null @@ -1 +0,0 @@ -just an npm test diff --git a/deps/npm/test/packages/npm-test-bundled-git/minimatch-expected.json b/deps/npm/test/packages/npm-test-bundled-git/minimatch-expected.json deleted file mode 100644 index 62b20d698ee61a..00000000000000 --- a/deps/npm/test/packages/npm-test-bundled-git/minimatch-expected.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "author": "Isaac Z. Schlueter (http://blog.izs.me)", - "name": "minimatch", - "description": "a glob matcher in javascript", - "version": "0.2.1", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "test": "tap test" - }, - "engines": { - "node": "*" - }, - "dependencies": { - "lru-cache": "~1.0.5" - }, - "devDependencies": { - "tap": "~0.1.3" - }, - "licenses" : [ - { - "type" : "MIT", - "url" : "http://github.com/isaacs/minimatch/raw/master/LICENSE" - } - ] -} diff --git a/deps/npm/test/packages/npm-test-bundled-git/package.json b/deps/npm/test/packages/npm-test-bundled-git/package.json deleted file mode 100644 index 69e0eb7a8b2d0f..00000000000000 --- a/deps/npm/test/packages/npm-test-bundled-git/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{"name":"npm-test-bundled-git" -,"scripts":{"test":"node test.js"} -,"version":"1.2.5" -,"dependencies":{"glob":"git://github.com/isaacs/node-glob.git#npm-test"} -,"bundledDependencies":["glob"]} diff --git a/deps/npm/test/packages/npm-test-bundled-git/test.js b/deps/npm/test/packages/npm-test-bundled-git/test.js deleted file mode 100644 index 4fcc54cafe4b34..00000000000000 --- a/deps/npm/test/packages/npm-test-bundled-git/test.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = require("./node_modules/glob/node_modules/minimatch/package.json") -var e = require("./minimatch-expected.json") -var assert = require("assert") -assert.deepEqual(a, e, "didn't get expected minimatch/package.json") diff --git a/deps/npm/test/packages/npm-test-dir-bin/README b/deps/npm/test/packages/npm-test-dir-bin/README deleted file mode 100644 index 8848f0786872f2..00000000000000 --- a/deps/npm/test/packages/npm-test-dir-bin/README +++ /dev/null @@ -1 +0,0 @@ -just an npm test diff --git a/deps/npm/test/packages/npm-test-dir-bin/bin/dir-bin b/deps/npm/test/packages/npm-test-dir-bin/bin/dir-bin deleted file mode 100644 index 9558516aad0c79..00000000000000 --- a/deps/npm/test/packages/npm-test-dir-bin/bin/dir-bin +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -console.log('ok') diff --git a/deps/npm/test/packages/npm-test-dir-bin/package.json b/deps/npm/test/packages/npm-test-dir-bin/package.json deleted file mode 100644 index 1ea26323fdbd3f..00000000000000 --- a/deps/npm/test/packages/npm-test-dir-bin/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ "name":"npm-test-dir-bin" -, "version":"1.2.5" -, "directories": { "bin": "./bin" } -, "scripts": { "test": "node test.js" } } diff --git a/deps/npm/test/packages/npm-test-dir-bin/test.js b/deps/npm/test/packages/npm-test-dir-bin/test.js deleted file mode 100644 index c59ec92da702ee..00000000000000 --- a/deps/npm/test/packages/npm-test-dir-bin/test.js +++ /dev/null @@ -1,4 +0,0 @@ -require('child_process').exec('dir-bin', { stdio: 'pipe', - env: process.env }, function (err) { - if (err && err.code) throw new Error('exited badly with code = ' + err.code) -}) diff --git a/deps/npm/test/packages/npm-test-env-reader/README b/deps/npm/test/packages/npm-test-env-reader/README deleted file mode 100644 index 8848f0786872f2..00000000000000 --- a/deps/npm/test/packages/npm-test-env-reader/README +++ /dev/null @@ -1 +0,0 @@ -just an npm test diff --git a/deps/npm/test/packages/npm-test-env-reader/package.json b/deps/npm/test/packages/npm-test-env-reader/package.json deleted file mode 100644 index 99d7fc93070284..00000000000000 --- a/deps/npm/test/packages/npm-test-env-reader/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ "name":"npm-test-env-reader" -, "version" : "1.2.3" -, "scripts" : - { "install" : "node test.js" - , "preinstall" : "node test.js" - , "preuninstall" : "node test.js" - , "postuninstall" : "node test.js" - , "test" : "node test.js" - , "stop" : "node test.js" - , "start" : "node test.js" - , "restart" : "node test.js" - , "foo" : "node test.js" - } -} diff --git a/deps/npm/test/packages/npm-test-env-reader/test.js b/deps/npm/test/packages/npm-test-env-reader/test.js deleted file mode 100755 index d6cb7893a70f7a..00000000000000 --- a/deps/npm/test/packages/npm-test-env-reader/test.js +++ /dev/null @@ -1,9 +0,0 @@ -var envs = [] -for (var e in process.env) { - if (e.match(/npm|^path$/i)) envs.push(e + '=' + process.env[e]) -} -envs.sort(function (a, b) { - return a === b ? 0 : a > b ? -1 : 1 -}).forEach(function (e) { - console.log(e) -}) diff --git a/deps/npm/test/packages/npm-test-files/.npmignore b/deps/npm/test/packages/npm-test-files/.npmignore deleted file mode 100644 index c7d927d0a2fd51..00000000000000 --- a/deps/npm/test/packages/npm-test-files/.npmignore +++ /dev/null @@ -1,7 +0,0 @@ -/sub/ignore1 -./sub/include2 -ignore3 -./include4 -ignoredir1 -ignoredir2/ -*.tgz diff --git a/deps/npm/test/packages/npm-test-files/package.json b/deps/npm/test/packages/npm-test-files/package.json deleted file mode 100644 index 2afa12dc560fc0..00000000000000 --- a/deps/npm/test/packages/npm-test-files/package.json +++ /dev/null @@ -1,10 +0,0 @@ -{ "name":"npm-test-files" -, "version":"1.2.5" -, "files": - [ "include4" - , "sub/include" - , "sub/include2" - , "sub/include4" - , "test.sh" - , ".npmignore" ] -, "scripts":{"test":"bash test.sh"}} diff --git a/deps/npm/test/packages/npm-test-files/sub/include4 b/deps/npm/test/packages/npm-test-files/sub/include4 deleted file mode 100644 index d16969cd189673..00000000000000 --- a/deps/npm/test/packages/npm-test-files/sub/include4 +++ /dev/null @@ -1 +0,0 @@ -This file should be in the package. diff --git a/deps/npm/test/packages/npm-test-files/test.sh b/deps/npm/test/packages/npm-test-files/test.sh deleted file mode 100644 index cdf47f211a86b8..00000000000000 --- a/deps/npm/test/packages/npm-test-files/test.sh +++ /dev/null @@ -1,27 +0,0 @@ -x=`find . | grep ignore | grep -v npmignore` -if [ "$x" != "" ]; then - echo "ignored files included: $x" - exit 1 -fi - -x=`find . | grep -v ignore | sort` -y=". -./include4 -./package.json -./sub -./sub/include -./sub/include2 -./sub/include4 -./test.sh" -if [ "$x" != "$y" ]; then - echo "missing included files" - echo "got:" - echo "===" - echo "$x" - echo "===" - echo "wanted:" - echo "===" - echo "$y" - echo "===" - exit 1 -fi diff --git a/deps/npm/test/packages/npm-test-ignore-nested-nm/README b/deps/npm/test/packages/npm-test-ignore-nested-nm/README deleted file mode 100644 index 8848f0786872f2..00000000000000 --- a/deps/npm/test/packages/npm-test-ignore-nested-nm/README +++ /dev/null @@ -1 +0,0 @@ -just an npm test diff --git a/deps/npm/test/packages/npm-test-ignore-nested-nm/lib/node_modules/foo b/deps/npm/test/packages/npm-test-ignore-nested-nm/lib/node_modules/foo deleted file mode 100644 index 2c9d06aff6f62c..00000000000000 --- a/deps/npm/test/packages/npm-test-ignore-nested-nm/lib/node_modules/foo +++ /dev/null @@ -1 +0,0 @@ -I WILL NOT BE IGNORED! diff --git a/deps/npm/test/packages/npm-test-ignore-nested-nm/package.json b/deps/npm/test/packages/npm-test-ignore-nested-nm/package.json deleted file mode 100644 index 177dbfb01d61b7..00000000000000 --- a/deps/npm/test/packages/npm-test-ignore-nested-nm/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{"name":"npm-test-ignore-nested-nm" -,"version":"1.2.5" -,"scripts":{"test":"node test.js"}} diff --git a/deps/npm/test/packages/npm-test-ignore-nested-nm/test.js b/deps/npm/test/packages/npm-test-ignore-nested-nm/test.js deleted file mode 100644 index 308c66b500be99..00000000000000 --- a/deps/npm/test/packages/npm-test-ignore-nested-nm/test.js +++ /dev/null @@ -1,2 +0,0 @@ -fs = require('fs') -fs.statSync(__dirname + '/lib/node_modules/foo') diff --git a/deps/npm/test/packages/npm-test-ignore/.npmignore b/deps/npm/test/packages/npm-test-ignore/.npmignore deleted file mode 100644 index c7d927d0a2fd51..00000000000000 --- a/deps/npm/test/packages/npm-test-ignore/.npmignore +++ /dev/null @@ -1,7 +0,0 @@ -/sub/ignore1 -./sub/include2 -ignore3 -./include4 -ignoredir1 -ignoredir2/ -*.tgz diff --git a/deps/npm/test/packages/npm-test-ignore/README b/deps/npm/test/packages/npm-test-ignore/README deleted file mode 100644 index 8848f0786872f2..00000000000000 --- a/deps/npm/test/packages/npm-test-ignore/README +++ /dev/null @@ -1 +0,0 @@ -just an npm test diff --git a/deps/npm/test/packages/npm-test-ignore/package.json b/deps/npm/test/packages/npm-test-ignore/package.json deleted file mode 100644 index 6d492de78063ae..00000000000000 --- a/deps/npm/test/packages/npm-test-ignore/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ "name":"npm-test-ignore" -, "version":"1.2.5" -, "scripts":{"test":"bash test.sh"}} diff --git a/deps/npm/test/packages/npm-test-ignore/sub/include4 b/deps/npm/test/packages/npm-test-ignore/sub/include4 deleted file mode 100644 index d16969cd189673..00000000000000 --- a/deps/npm/test/packages/npm-test-ignore/sub/include4 +++ /dev/null @@ -1 +0,0 @@ -This file should be in the package. diff --git a/deps/npm/test/packages/npm-test-ignore/test.sh b/deps/npm/test/packages/npm-test-ignore/test.sh deleted file mode 100644 index 05fbaf169973bf..00000000000000 --- a/deps/npm/test/packages/npm-test-ignore/test.sh +++ /dev/null @@ -1,29 +0,0 @@ -x=`find . | grep ignore | grep -v npmignore` -if [ "$x" != "" ]; then - echo "ignored files included: $x" - exit 1 -fi - -x=`find . | grep -v ignore | sort` -y=". -./include4 -./package.json -./README -./sub -./sub/include -./sub/include2 -./sub/include4 -./test.sh" -y="`echo "$y" | sort`" -if [ "$x" != "$y" ]; then - echo "missing included files" - echo "got:" - echo "===" - echo "$x" - echo "===" - echo "wanted:" - echo "===" - echo "$y" - echo "===" - exit 1 -fi diff --git a/deps/npm/test/packages/npm-test-missing-bindir/README b/deps/npm/test/packages/npm-test-missing-bindir/README deleted file mode 100644 index 8848f0786872f2..00000000000000 --- a/deps/npm/test/packages/npm-test-missing-bindir/README +++ /dev/null @@ -1 +0,0 @@ -just an npm test diff --git a/deps/npm/test/packages/npm-test-missing-bindir/package.json b/deps/npm/test/packages/npm-test-missing-bindir/package.json deleted file mode 100644 index 49e26742df58f0..00000000000000 --- a/deps/npm/test/packages/npm-test-missing-bindir/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ "name":"npm-test-missing-bindir" -, "version" : "0.0.0" -, "scripts" : { "test" : "node test.js" } -, "directories": { "bin" : "./not-found" } } diff --git a/deps/npm/test/packages/npm-test-missing-bindir/test.js b/deps/npm/test/packages/npm-test-missing-bindir/test.js deleted file mode 100644 index f548458ac042c5..00000000000000 --- a/deps/npm/test/packages/npm-test-missing-bindir/test.js +++ /dev/null @@ -1,5 +0,0 @@ - -var assert = require("assert") -assert.equal(undefined, process.env.npm_config__password, "password exposed!") -assert.equal(undefined, process.env.npm_config__auth, "auth exposed!") -assert.equal(undefined, process.env.npm_config__authCrypt, "authCrypt exposed!") diff --git a/deps/npm/test/packages/npm-test-optional-deps/README b/deps/npm/test/packages/npm-test-optional-deps/README deleted file mode 100644 index 8848f0786872f2..00000000000000 --- a/deps/npm/test/packages/npm-test-optional-deps/README +++ /dev/null @@ -1 +0,0 @@ -just an npm test diff --git a/deps/npm/test/packages/npm-test-optional-deps/package.json b/deps/npm/test/packages/npm-test-optional-deps/package.json deleted file mode 100644 index 67545ca9da1391..00000000000000 --- a/deps/npm/test/packages/npm-test-optional-deps/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ "name": "npm-test-optional-deps" -, "version": "1.2.5" -, "scripts": { "test": "node test.js" } -, "optionalDependencies": - { "npm-test-foobarzaaakakaka": "http://example.com/" - , "dnode": "10.999.14234" - , "sax": "0.3.5" - , "glob": "some invalid version 99 #! $$ x y z" - , "npm-test-failer":"*" - } -} diff --git a/deps/npm/test/packages/npm-test-optional-deps/test.js b/deps/npm/test/packages/npm-test-optional-deps/test.js deleted file mode 100644 index 2232906d64711b..00000000000000 --- a/deps/npm/test/packages/npm-test-optional-deps/test.js +++ /dev/null @@ -1,9 +0,0 @@ -var fs = require("fs") -var assert = require("assert") -var path = require("path") - -// sax should be the only dep that ends up installed - -var dir = path.resolve(__dirname, "node_modules") -assert.deepEqual(fs.readdirSync(dir), ["sax"]) -assert.equal(require("sax/package.json").version, "0.3.5") diff --git a/deps/npm/test/packages/npm-test-platform-all/README b/deps/npm/test/packages/npm-test-platform-all/README deleted file mode 100644 index 8848f0786872f2..00000000000000 --- a/deps/npm/test/packages/npm-test-platform-all/README +++ /dev/null @@ -1 +0,0 @@ -just an npm test diff --git a/deps/npm/test/packages/npm-test-platform-all/package.json b/deps/npm/test/packages/npm-test-platform-all/package.json deleted file mode 100644 index 07624363e6e996..00000000000000 --- a/deps/npm/test/packages/npm-test-platform-all/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{"name":"npm-test-platform-all" -,"version":"9.9.9-9" -,"homepage":"http://www.zombo.com/" -,"os":["darwin","linux","win32","solaris","haiku","sunos","freebsd","openbsd","netbsd"] -,"cpu":["arm","mips","ia32","x64","sparc"]} diff --git a/deps/npm/test/packages/npm-test-platform/README b/deps/npm/test/packages/npm-test-platform/README deleted file mode 100644 index 8848f0786872f2..00000000000000 --- a/deps/npm/test/packages/npm-test-platform/README +++ /dev/null @@ -1 +0,0 @@ -just an npm test diff --git a/deps/npm/test/packages/npm-test-platform/package.json b/deps/npm/test/packages/npm-test-platform/package.json deleted file mode 100644 index d6c3e09e1d9091..00000000000000 --- a/deps/npm/test/packages/npm-test-platform/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{"name":"npm-test-platform" -,"version":"9.9.9-9" -,"homepage":"http://www.youtube.com/watch?v=dQw4w9WgXcQ" -,"os":["!this_is_not_a_real_os", "!neither_is_this"] -,"cpu":["!this_is_not_a_real_cpu","!this_isnt_either"]} diff --git a/deps/npm/test/packages/npm-test-private/README b/deps/npm/test/packages/npm-test-private/README deleted file mode 100644 index 8848f0786872f2..00000000000000 --- a/deps/npm/test/packages/npm-test-private/README +++ /dev/null @@ -1 +0,0 @@ -just an npm test diff --git a/deps/npm/test/packages/npm-test-private/package.json b/deps/npm/test/packages/npm-test-private/package.json deleted file mode 100644 index 3d95a37af14b45..00000000000000 --- a/deps/npm/test/packages/npm-test-private/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{"name":"npm-test-private" -,"version":"9.9.9-9" -,"homepage":"http://www.youtube.com/watch?v=1MLry6Cn_D4" -,"private":"true"} diff --git a/deps/npm/test/packages/npm-test-shrinkwrap/README b/deps/npm/test/packages/npm-test-shrinkwrap/README deleted file mode 100644 index 8848f0786872f2..00000000000000 --- a/deps/npm/test/packages/npm-test-shrinkwrap/README +++ /dev/null @@ -1 +0,0 @@ -just an npm test diff --git a/deps/npm/test/packages/npm-test-shrinkwrap/npm-shrinkwrap.json b/deps/npm/test/packages/npm-test-shrinkwrap/npm-shrinkwrap.json deleted file mode 100644 index 09a034141f7f6e..00000000000000 --- a/deps/npm/test/packages/npm-test-shrinkwrap/npm-shrinkwrap.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "npm-test-shrinkwrap", - "version": "0.0.0", - "dependencies": { - "npm-test-single-file": { - "version": "1.2.3", - "resolved": "https://gist.github.com/isaacs/1837112/raw/9ef57a59fc22aeb1d1ca346b68826dcb638b8416/index.js" - }, - "glob": { - "version": "3.1.5", - "resolved": "git://github.com/isaacs/node-glob.git#67bda227fd7a559cca5620307c7d30a6732a792f", - "dependencies": { - "minimatch": { - "version": "0.2.1", - "dependencies": { - "lru-cache": { - "version": "1.0.5" - } - } - }, - "graceful-fs": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.1.5.tgz", - "dependencies": { - "fast-list": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/fast-list/-/fast-list-1.0.2.tgz" - } - } - }, - "inherits": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.0.tgz" - } - } - }, - "minimatch": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.1.5.tgz", - "dependencies": { - "lru-cache": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-1.0.5.tgz" - } - } - } - } -} diff --git a/deps/npm/test/packages/npm-test-shrinkwrap/package.json b/deps/npm/test/packages/npm-test-shrinkwrap/package.json deleted file mode 100644 index a5d446e2d11681..00000000000000 --- a/deps/npm/test/packages/npm-test-shrinkwrap/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "name": "npm-test-shrinkwrap", - "version": "0.0.0", - "dependencies": { - "npm-test-single-file": "https://gist.github.com/isaacs/1837112/raw/9ef57a59fc22aeb1d1ca346b68826dcb638b8416/index.js", - "glob": "git://github.com/isaacs/node-glob.git#npm-test", - "minimatch": "~0.1.0" - }, - "scripts": { - "test": "node test.js" - } -} diff --git a/deps/npm/test/packages/npm-test-shrinkwrap/test.js b/deps/npm/test/packages/npm-test-shrinkwrap/test.js deleted file mode 100644 index fba90ec6516311..00000000000000 --- a/deps/npm/test/packages/npm-test-shrinkwrap/test.js +++ /dev/null @@ -1,35 +0,0 @@ -var path = require("path") -var assert = require("assert") - -process.env.npm_config_prefix = process.cwd() -delete process.env.npm_config_global -delete process.env.npm_config_depth - -var npm = process.env.npm_execpath - -require("child_process").execFile(process.execPath, [npm, "ls", "--json"], { - stdio: "pipe", env: process.env, cwd: process.cwd() }, - function (err, stdout, stderr) { - if (err) throw err - - var actual = JSON.parse(stdout) - var expected = require("./npm-shrinkwrap.json") - rmFrom(actual) - actual = actual.dependencies - rmFrom(expected) - expected = expected.dependencies - console.error(JSON.stringify(actual, null, 2)) - console.error(JSON.stringify(expected, null, 2)) - - assert.deepEqual(actual, expected) -}) - -function rmFrom (obj) { - for (var i in obj) { - if (i === "from") - delete obj[i] - else if (i === "dependencies") - for (var j in obj[i]) - rmFrom(obj[i][j]) - } -} diff --git a/deps/npm/test/packages/npm-test-test-package/README b/deps/npm/test/packages/npm-test-test-package/README deleted file mode 100644 index 8848f0786872f2..00000000000000 --- a/deps/npm/test/packages/npm-test-test-package/README +++ /dev/null @@ -1 +0,0 @@ -just an npm test diff --git a/deps/npm/test/packages/npm-test-test-package/package.json b/deps/npm/test/packages/npm-test-test-package/package.json deleted file mode 100644 index c5c5aeabc1e56f..00000000000000 --- a/deps/npm/test/packages/npm-test-test-package/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ "name":"npm-test-test-package" -, "author" : "Testy McMock" -, "version" : "1.2.3-99-b" -, "description" : "This is a test package used for debugging. It has some random data and that's all." -} diff --git a/deps/npm/test/packages/npm-test-url-dep/README b/deps/npm/test/packages/npm-test-url-dep/README deleted file mode 100644 index 8848f0786872f2..00000000000000 --- a/deps/npm/test/packages/npm-test-url-dep/README +++ /dev/null @@ -1 +0,0 @@ -just an npm test diff --git a/deps/npm/test/packages/npm-test-url-dep/package.json b/deps/npm/test/packages/npm-test-url-dep/package.json deleted file mode 100644 index f1949d8388154c..00000000000000 --- a/deps/npm/test/packages/npm-test-url-dep/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ "name":"npm-test-url-dep" -, "version" : "1.2.3" -, "dependencies" : - { "jsonify" : "https://github.com/substack/jsonify/tarball/master" - , "sax": "isaacs/sax-js" - , "canonical-host": "git://github.com/isaacs/canonical-host" - } } diff --git a/deps/npm/test/run.js b/deps/npm/test/run.js deleted file mode 100644 index 5b33e68ab47a77..00000000000000 --- a/deps/npm/test/run.js +++ /dev/null @@ -1,193 +0,0 @@ -// Everything in this file uses child processes, because we're -// testing a command line utility. - -var chain = require("slide").chain -var child_process = require("child_process") -var path = require("path") - , testdir = __dirname - , fs = require("graceful-fs") - , npmpkg = path.dirname(testdir) - , npmcli = path.resolve(npmpkg, "bin", "npm-cli.js") - -var temp = process.env.TMPDIR - || process.env.TMP - || process.env.TEMP - || ( process.platform === "win32" - ? "c:\\windows\\temp" - : "/tmp" ) - -temp = path.resolve(temp, "npm-test-" + process.pid) - -var root = path.resolve(temp, "root") - , cache = path.resolve(temp, "npm_cache") - -var failures = 0 - , mkdir = require("mkdirp") - , rimraf = require("rimraf") - -var pathEnvSplit = process.platform === "win32" ? ";" : ":" - , pathEnv = process.env.PATH.split(pathEnvSplit) - , npmPath = process.platform === "win32" ? root : path.join(root, "bin") - -pathEnv.unshift(npmPath, path.join(root, "node_modules", ".bin")) - -// lastly, make sure that we get the same node that is being used to do -// run this script. That's very important, especially when running this -// test file from in the node source folder. -pathEnv.unshift(path.dirname(process.execPath)) - -// the env for all the test installs etc. -var env = {} -Object.keys(process.env).forEach(function (i) { - env[i] = process.env[i] -}) -env.npm_config_prefix = root -env.npm_config_color = "always" -env.npm_config_global = "true" -// have to set this to false, or it'll try to test itself forever -env.npm_config_npat = "false" -env.PATH = pathEnv.join(pathEnvSplit) -env.NODE_PATH = path.join(root, "node_modules") -env.npm_config_cache = cache - - - -function cleanup (cb) { - if (failures !== 0) return - rimraf(root, function (er) { - if (er) cb(er) - mkdir(root, 0755, cb) - }) -} - -function prefix (content, pref) { - return pref + (content.trim().split(/\r?\n/).join("\n" + pref)) -} - -var execCount = 0 -function exec (cmd, cwd, shouldFail, cb) { - if (typeof shouldFail === "function") { - cb = shouldFail, shouldFail = false - } - console.error("\n+"+cmd + (shouldFail ? " (expect failure)" : "")) - - // special: replace 'node' with the current execPath, - // and 'npm' with the thing we installed. - var cmdShow = cmd - var npmReplace = path.resolve(npmPath, "npm") - var nodeReplace = process.execPath - if (process.platform === "win32") { - npmReplace = '"' + npmReplace + '"' - nodeReplace = '"' + nodeReplace + '"' - } - cmd = cmd.replace(/^npm /, npmReplace + " ") - cmd = cmd.replace(/^node /, nodeReplace + " ") - - console.error("$$$$$$ cd %s; PATH=%s %s", cwd, env.PATH, cmd) - - child_process.exec(cmd, {cwd: cwd, env: env}, function (er, stdout, stderr) { - console.error("$$$$$$ after command", cmd, cwd) - if (stdout) { - console.error(prefix(stdout, " 1> ")) - } - if (stderr) { - console.error(prefix(stderr, " 2> ")) - } - - execCount ++ - if (!shouldFail && !er || shouldFail && er) { - // stdout = (""+stdout).trim() - console.log("ok " + execCount + " " + cmdShow) - return cb() - } else { - console.log("not ok " + execCount + " " + cmdShow) - cb(new Error("failed "+cmdShow)) - } - }) -} - -function execChain (cmds, cb) { - chain(cmds.map(function (args) { - return [exec].concat(args) - }), cb) -} - -function flatten (arr) { - return arr.reduce(function (l, r) { - return l.concat(r) - }, []) -} - -function setup (cb) { - cleanup(function (er) { - if (er) return cb(er) - exec("node \""+npmcli+"\" install \""+npmpkg+"\"", root, false, cb) - }) -} - -function main (cb) { - console.log("# testing in %s", temp) - console.log("# global prefix = %s", root) - - - - failures = 0 - - process.chdir(testdir) - var base = path.resolve(root, path.join("lib", "node_modules")) - - // get the list of packages - var packages = fs.readdirSync(path.resolve(testdir, "packages")) - packages = packages.filter(function (p) { - return p && !p.match(/^\./) - }) - - installAllThenTestAll() - - function installAllThenTestAll () { - var packagesToRm = packages.slice(0) - if (process.platform !== "win32") { - // Windows can't handle npm rm npm due to file-in-use issues. - packagesToRm.push("npm") - } - - chain( - [ setup - , [ exec, "npm install "+npmpkg, testdir ] - , [ execChain, packages.map(function (p) { - return [ "npm install packages/"+p, testdir ] - }) ] - , [ execChain, packages.map(function (p) { - return [ "npm test -ddd", path.resolve(base, p) ] - }) ] - , [ execChain, packagesToRm.map(function (p) { - return [ "npm rm "+p, root ] - }) ] - , installAndTestEach - ] - , cb - ) - } - - function installAndTestEach (cb) { - var thingsToChain = [ - setup - , [ execChain, flatten(packages.map(function (p) { - return [ [ "npm install packages/"+p, testdir ] - , [ "npm test", path.resolve(base, p) ] - , [ "npm rm "+p, root ] ] - })) ] - ] - if (process.platform !== "win32") { - // Windows can't handle npm rm npm due to file-in-use issues. - thingsToChain.push([exec, "npm rm npm", testdir]) - } - - chain(thingsToChain, cb) - } -} - -main(function (er) { - console.log("1.." + execCount) - if (er) throw er -}) diff --git a/deps/npm/test/tap/00-check-mock-dep.js b/deps/npm/test/tap/00-check-mock-dep.js index 1c862317c9a971..cdc7af852b344c 100644 --- a/deps/npm/test/tap/00-check-mock-dep.js +++ b/deps/npm/test/tap/00-check-mock-dep.js @@ -1,17 +1,17 @@ -console.log("TAP Version 13") +console.log('TAP Version 13') -process.on("uncaughtException", function (er) { +process.on('uncaughtException', function (er) { if (er) { throw er } - console.log("not ok - Failed checking mock registry dep. Expect much fail!") - console.log("1..1") + console.log('not ok - Failed checking mock registry dep. Expect much fail!') + console.log('1..1') process.exit(1) }) -var assert = require("assert") -var semver = require("semver") -var mock = require("npm-registry-mock/package.json").version -var req = require("../../package.json").devDependencies["npm-registry-mock"] +var assert = require('assert') +var semver = require('semver') +var mock = require('npm-registry-mock/package.json').version +var req = require('../../package.json').devDependencies['npm-registry-mock'] assert(semver.satisfies(mock, req)) -console.log("ok") -console.log("1..1") +console.log('ok') +console.log('1..1') diff --git a/deps/npm/test/tap/00-config-setup.js b/deps/npm/test/tap/00-config-setup.js index 0daf0decd6a546..0310f48d5c89a2 100644 --- a/deps/npm/test/tap/00-config-setup.js +++ b/deps/npm/test/tap/00-config-setup.js @@ -1,33 +1,33 @@ -var fs = require("graceful-fs") -var path = require("path") -var userconfigSrc = path.resolve(__dirname, "..", "fixtures", "config", "userconfig") -exports.userconfig = userconfigSrc + "-with-gc" -exports.globalconfig = path.resolve(__dirname, "..", "fixtures", "config", "globalconfig") -exports.builtin = path.resolve(__dirname, "..", "fixtures", "config", "builtin") -exports.malformed = path.resolve(__dirname, "..", "fixtures", "config", "malformed") +var fs = require('graceful-fs') +var path = require('path') +var userconfigSrc = path.resolve(__dirname, '..', 'fixtures', 'config', 'userconfig') +exports.userconfig = userconfigSrc + '-with-gc' +exports.globalconfig = path.resolve(__dirname, '..', 'fixtures', 'config', 'globalconfig') +exports.builtin = path.resolve(__dirname, '..', 'fixtures', 'config', 'builtin') +exports.malformed = path.resolve(__dirname, '..', 'fixtures', 'config', 'malformed') exports.ucData = { globalconfig: exports.globalconfig, - email: "i@izs.me", - "env-thing": "asdf", - "init.author.name": "Isaac Z. Schlueter", - "init.author.email": "i@izs.me", - "init.author.url": "http://blog.izs.me/", - "init.version": "1.2.3", - "proprietary-attribs": false, - "npm:publishtest": true, - "_npmjs.org:couch": "https://admin:password@localhost:5984/registry", - "npm-www:nocache": "1", - nodedir: "/Users/isaacs/dev/js/node-v0.8", - "sign-git-tag": true, - message: "v%s", - "strict-ssl": false, - "tmp": process.env.HOME + "/.tmp", - _auth: "dXNlcm5hbWU6cGFzc3dvcmQ=", + email: 'i@izs.me', + 'env-thing': 'asdf', + 'init.author.name': 'Isaac Z. Schlueter', + 'init.author.email': 'i@izs.me', + 'init.author.url': 'http://blog.izs.me/', + 'init.version': '1.2.3', + 'proprietary-attribs': false, + 'npm:publishtest': true, + '_npmjs.org:couch': 'https://admin:password@localhost:5984/registry', + 'npm-www:nocache': '1', + nodedir: '/Users/isaacs/dev/js/node-v0.8', + 'sign-git-tag': true, + message: 'v%s', + 'strict-ssl': false, + 'tmp': process.env.HOME + '/.tmp', + _auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', _token: - { AuthSession: "yabba-dabba-doodle", - version: "1", - expires: "1345001053415", - path: "/", + { AuthSession: 'yabba-dabba-doodle', + version: '1', + expires: '1345001053415', + path: '/', httponly: true } } // set the userconfig in the env @@ -39,21 +39,21 @@ Object.keys(process.env).forEach(function (k) { }) process.env.npm_config_userconfig = exports.userconfig process.env.npm_config_other_env_thing = 1000 -process.env.random_env_var = "asdf" -process.env.npm_config__underbar_env_thing = "underful" +process.env.random_env_var = 'asdf' +process.env.npm_config__underbar_env_thing = 'underful' process.env.NPM_CONFIG_UPPERCASE_ENV_THING = 42 exports.envData = { userconfig: exports.userconfig, - "_underbar-env-thing": "underful", - "uppercase-env-thing": "42", - "other-env-thing": "1000" + '_underbar-env-thing': 'underful', + 'uppercase-env-thing': '42', + 'other-env-thing': '1000' } exports.envDataFix = { userconfig: exports.userconfig, - "_underbar-env-thing": "underful", - "uppercase-env-thing": 42, - "other-env-thing": 1000 + '_underbar-env-thing': 'underful', + 'uppercase-env-thing': 42, + 'other-env-thing': 1000 } var projectConf = path.resolve(__dirname, '..', '..', '.npmrc') @@ -61,7 +61,11 @@ try { fs.statSync(projectConf) } catch (er) { // project conf not found, probably working with packed npm - fs.writeFileSync(projectConf, 'save-prefix = ~\nproprietary-attribs = false\n') + fs.writeFileSync(projectConf, function () {/* +save-prefix = ~ +proprietary-attribs = false +legacy-bundling = true + */}.toString().split('\n').slice(1, -1).join('\n')) } var projectRc = path.join(__dirname, '..', 'fixtures', 'config', '.npmrc') @@ -75,9 +79,9 @@ try { if (module === require.main) { // set the globalconfig in the userconfig var uc = fs.readFileSync(userconfigSrc) - var gcini = "globalconfig = " + exports.globalconfig + "\n" + var gcini = 'globalconfig = ' + exports.globalconfig + '\n' fs.writeFileSync(exports.userconfig, gcini + uc) - console.log("1..1") - console.log("ok 1 setup done") + console.log('1..1') + console.log('ok 1 setup done') } diff --git a/deps/npm/test/tap/00-verify-bundle-deps.js b/deps/npm/test/tap/00-verify-bundle-deps.js index 9d16b2d3b1220b..75ea81c593e76f 100644 --- a/deps/npm/test/tap/00-verify-bundle-deps.js +++ b/deps/npm/test/tap/00-verify-bundle-deps.js @@ -1,27 +1,16 @@ -var fs = require("fs") -var path = require("path") -var test = require("tap").test +var test = require('tap').test -var manifest = require("../../package.json") +var manifest = require('../../package.json') var deps = Object.keys(manifest.dependencies) -var dev = Object.keys(manifest.devDependencies) var bundled = manifest.bundleDependencies -test("all deps are bundled deps or dev deps", function (t) { +test('all deps are bundled deps or dev deps', function (t) { deps.forEach(function (name) { t.assert( bundled.indexOf(name) !== -1, - name + " is in bundledDependencies" + name + ' is in bundledDependencies' ) }) - t.same( - fs.readdirSync(path.resolve(__dirname, "../../node_modules")).filter(function (name) { - return (dev.indexOf(name) === -1) && (name !== ".bin") - }).sort(), - bundled.sort(), - "bundleDependencies matches what's in node_modules" - ) - t.end() }) diff --git a/deps/npm/test/tap/00-verify-ls-ok.js b/deps/npm/test/tap/00-verify-ls-ok.js index aa6acdbc56f8ac..2d20e500b71cd8 100644 --- a/deps/npm/test/tap/00-verify-ls-ok.js +++ b/deps/npm/test/tap/00-verify-ls-ok.js @@ -1,18 +1,18 @@ -var common = require("../common-tap") -var test = require("tap").test -var path = require("path") -var cwd = path.resolve(__dirname, "..", "..") -var fs = require("fs") +var common = require('../common-tap') +var test = require('tap').test +var path = require('path') +var cwd = path.resolve(__dirname, '..', '..') +var fs = require('fs') -test("npm ls in npm", function (t) { - t.ok(fs.existsSync(cwd), "ensure that the path we are calling ls within exists") +test('npm ls in npm', function (t) { + t.ok(fs.existsSync(cwd), 'ensure that the path we are calling ls within exists') var files = fs.readdirSync(cwd) - t.notEqual(files.length, 0, "ensure there are files in the directory we are to ls") + t.notEqual(files.length, 0, 'ensure there are files in the directory we are to ls') - var opt = { cwd: cwd, stdio: [ "ignore", "ignore", 2 ] } - common.npm(["ls"], opt, function (err, code) { - t.ifError(err, "error should not exist") - t.equal(code, 0, "npm ls exited with code") + var opt = { cwd: cwd, stdio: [ 'ignore', 'ignore', 2 ] } + common.npm(['ls'], opt, function (err, code) { + t.ifError(err, 'error should not exist') + t.equal(code, 0, 'npm ls exited with code') t.end() }) }) diff --git a/deps/npm/test/tap/404-parent.js b/deps/npm/test/tap/404-parent.js index eb8ae9bb150d8b..a8bd951636e888 100644 --- a/deps/npm/test/tap/404-parent.js +++ b/deps/npm/test/tap/404-parent.js @@ -1,54 +1,57 @@ -var common = require("../common-tap.js") -var test = require("tap").test -var npm = require("../../") -var osenv = require("osenv") -var path = require("path") -var fs = require("fs") -var rimraf = require("rimraf") -var mkdirp = require("mkdirp") -var pkg = path.resolve(__dirname, "404-parent") -var mr = require("npm-registry-mock") +var common = require('../common-tap.js') +var test = require('tap').test +var npm = require('../../') +var osenv = require('osenv') +var path = require('path') +var fs = require('fs') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var pkg = path.resolve(__dirname, '404-parent') +var mr = require('npm-registry-mock') -test("404-parent: if parent exists, specify parent in error message", function (t) { +test('404-parent: if parent exists, specify parent in error message', function (t) { setup() - rimraf.sync(path.resolve(pkg, "node_modules")) + rimraf.sync(path.resolve(pkg, 'node_modules')) performInstall(function (err) { - t.ok(err instanceof Error, "error was returned") - t.ok(err.parent === "404-parent-test", "error's parent set") + t.ok(err instanceof Error, 'error was returned') + t.ok(err.parent === '404-parent-test', "error's parent set") t.end() }) }) -test("cleanup", function (t) { +test('cleanup', function (t) { process.chdir(osenv.tmpdir()) rimraf.sync(pkg) t.end() }) -function setup() { +function setup () { mkdirp.sync(pkg) - mkdirp.sync(path.resolve(pkg, "cache")) - fs.writeFileSync(path.resolve(pkg, "package.json"), JSON.stringify({ - author: "Evan Lucas", - name: "404-parent-test", - version: "0.0.0", - description: "Test for 404-parent", + mkdirp.sync(path.resolve(pkg, 'cache')) + fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({ + author: 'Evan Lucas', + name: '404-parent-test', + version: '0.0.0', + description: 'Test for 404-parent', dependencies: { - "test-npm-404-parent-test": "*" + 'test-npm-404-parent-test': '*' } - }), "utf8") + }), 'utf8') process.chdir(pkg) } function plugin (server) { - server.get("/test-npm-404-parent-test") - .reply(404, {"error": "version not found"}) + server.get('/test-npm-404-parent-test') + .reply(404, {'error': 'version not found'}) } function performInstall (cb) { - mr({port : common.port, plugin : plugin}, function (er, s) { // create mock registry. + mr({port: common.port, plugin: plugin}, function (er, s) { // create mock registry. npm.load({registry: common.registry}, function () { - npm.commands.install(pkg, [], function (err) { + var pwd = process.cwd() + process.chdir(pkg) + npm.commands.install([], function (err) { + process.chdir(pwd) cb(err) s.close() // shutdown mock npm server. }) diff --git a/deps/npm/test/tap/404-private-registry-scoped.js b/deps/npm/test/tap/404-private-registry-scoped.js index 681fff05e8ec5f..84251b113c2a9c 100644 --- a/deps/npm/test/tap/404-private-registry-scoped.js +++ b/deps/npm/test/tap/404-private-registry-scoped.js @@ -1,22 +1,38 @@ -var nock = require('nock') var test = require('tap').test -var npm = require('../../') -var addNamed = require('../../lib/cache/add-named') +var common = require('../common-tap.js') +var mr = require('npm-registry-mock') +var server -test('scoped package names not mangled on error with non-root registry', function test404 (t) { - nock('http://localhost:1337') - .get('/registry/@scope%2ffoo') - .reply(404, { - error: 'not_found', - reason: 'document not found' - }) +test('setup', function (t) { + mr({port: common.port, throwOnUnmatched: true}, function (err, s) { + t.ifError(err, 'registry mocked successfully') + server = s + t.end() + }) +}) - npm.load({registry: 'http://localhost:1337/registry', global: true}, function () { - addNamed('@scope/foo', '*', null, function checkError (err) { - t.ok(err, 'should error') - t.equal(err.message, '404 Not Found: @scope/foo', 'should have package name in error') - t.equal(err.pkgid, '@scope/foo', 'err.pkgid should match package name') +test('scoped package names not mangled on error with non-root registry', function (t) { + common.npm( + [ + 'cache', + 'add', + '@scope/foo@*', + '--force' + ], + {}, + function (er, code, stdout, stderr) { + t.ifError(er, 'correctly handled 404') + t.equal(code, 1, 'exited with error') + t.match(stderr, /404 Not found/, 'should notify the sort of error as a 404') + t.match(stderr, /@scope\/foo/, 'should have package name in error') t.end() - }) - }) + } + ) +}) + +test('cleanup', function (t) { + t.pass('cleaned up') + server.done() + server.close() + t.end() }) diff --git a/deps/npm/test/tap/404-private-registry.js b/deps/npm/test/tap/404-private-registry.js index 698f5b86133d35..a30f61432a4d91 100644 --- a/deps/npm/test/tap/404-private-registry.js +++ b/deps/npm/test/tap/404-private-registry.js @@ -1,25 +1,40 @@ -var nock = require('nock') +require('../common-tap') var test = require('tap').test var path = require('path') -var npm = require('../../') -var addNamed = require('../../lib/cache/add-named') +var common = require('../common-tap.js') +var mr = require('npm-registry-mock') +var server -var packageName = path.basename(__filename,'.js') +var packageName = path.basename(__filename, '.js') -test('package names not mangled on error with non-root registry', function test404 (t) { - nock('http://localhost:1337') - .get('/registry/' + packageName) - .reply(404, { - error: 'not_found', - reason: 'document not found' - }) +test('setup', function (t) { + mr({port: common.port, throwOnUnmatched: true}, function (err, s) { + t.ifError(err, 'registry mocked successfully') + server = s + t.end() + }) +}) - npm.load({registry: 'http://localhost:1337/registry', global: true}, function () { - addNamed(packageName, '*', null, function checkError (err) { - t.ok(err, 'should error') - t.equal(err.message, '404 Not Found: ' + packageName, 'should have package name in error') - t.equal(err.pkgid, packageName, 'err.pkgid should match package name') +test('package names not mangled on error with non-root registry', function (t) { + common.npm( + [ + 'cache', + 'add', + packageName + '@*' + ], + {}, + function (er, code, stdout, stderr) { + t.ifError(er, 'correctly handled 404') + t.equal(code, 1, 'exited with error') + t.match(stderr, packageName, 'should have package name in error') t.end() - }) - }) + } + ) +}) + +test('cleanup', function (t) { + t.pass('cleaned up') + server.done() + server.close() + t.end() }) diff --git a/deps/npm/test/tap/access.js b/deps/npm/test/tap/access.js index c72ea5c8986c5f..4bed4b4b257972 100644 --- a/deps/npm/test/tap/access.js +++ b/deps/npm/test/tap/access.js @@ -15,10 +15,6 @@ var scoped = { version: '1.1.1' } -var body = { - access: 'public' -} - test('setup', function (t) { mkdirp(pkg, function (er) { t.ifError(er, pkg + ' made successfully') @@ -45,44 +41,90 @@ test('npm access public on current package', function (t) { })).reply(200, { accessChanged: true }) + common.npm( + [ + 'access', + 'public', + '--registry', common.registry, + '--loglevel', 'silent' + ], { + cwd: pkg + }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access') + t.equal(code, 0, 'exited OK') + t.equal(stderr, '', 'no error output') + t.end() + } + ) +}) + +test('npm access public when no package passed and no package.json', function (t) { + // need to simulate a missing package.json + var missing = path.join(__dirname, 'access-public-missing-guard') + mkdirp.sync(path.join(missing, 'node_modules')) + common.npm([ 'access', 'public', - '--registry', common.registry, - '--loglevel', 'silent' + '--registry', common.registry ], { - cwd: pkg + cwd: missing }, function (er, code, stdout, stderr) { t.ifError(er, 'npm access') - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') + t.match(stderr, /no package name passed to command and no package.json found/) + rimraf.sync(missing) t.end() }) }) -test('npm access restricted on current package', function (t) { - server.post('/-/package/%40scoped%2Fpkg/access', JSON.stringify({ - access: 'restricted' - })).reply(200, { - accessChanged: true - }) +test('npm access public when no package passed and invalid package.json', function (t) { + // need to simulate a missing package.json + var invalid = path.join(__dirname, 'access-public-invalid-package') + mkdirp.sync(path.join(invalid, 'node_modules')) + // it's hard to force `read-package-json` to break w/o ENOENT, but this will do it + fs.writeFileSync(path.join(invalid, 'package.json'), '{\n') + common.npm([ 'access', - 'restricted', - '--registry', common.registry, - '--loglevel', 'silent' + 'public', + '--registry', common.registry ], { - cwd: pkg + cwd: invalid }, function (er, code, stdout, stderr) { t.ifError(er, 'npm access') - t.equal(code, 0, 'exited OK') - t.equal(stderr, '', 'no error output') + t.match(stderr, /Failed to parse json/) + rimraf.sync(invalid) t.end() }) }) +test('npm access restricted on current package', function (t) { + server.post('/-/package/%40scoped%2Fpkg/access', JSON.stringify({ + access: 'restricted' + })).reply(200, { + accessChanged: true + }) + common.npm( + [ + 'access', + 'restricted', + '--registry', common.registry, + '--loglevel', 'silent' + ], { + cwd: pkg + }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access') + t.equal(code, 0, 'exited OK') + t.equal(stderr, '', 'no error output') + t.end() + } + ) +}) + test('npm access on named package', function (t) { server.post('/-/package/%40scoped%2Fanother/access', { access: 'public' @@ -214,6 +256,33 @@ test('npm access revoke', function (t) { ) }) +test('npm access ls-packages with no team', function (t) { + var serverPackages = { + '@foo/bar': 'write', + '@foo/util': 'read' + } + var clientPackages = { + '@foo/bar': 'read-write', + '@foo/util': 'read-only' + } + server.get( + '/-/org/username/package?format=cli' + ).reply(200, serverPackages) + common.npm( + [ + 'access', + 'ls-packages', + '--registry', common.registry + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access ls-packages') + t.same(JSON.parse(stdout), clientPackages) + t.end() + } + ) +}) + test('npm access ls-packages on team', function (t) { var serverPackages = { '@foo/bar': 'write', @@ -301,6 +370,42 @@ test('npm access ls-packages on user', function (t) { ) }) +test('npm access ls-packages with no package specified or package.json', function (t) { + // need to simulate a missing package.json + var missing = path.join(__dirname, 'access-missing-guard') + mkdirp.sync(path.join(missing, 'node_modules')) + + var serverPackages = { + '@foo/bar': 'write', + '@foo/util': 'read' + } + var clientPackages = { + '@foo/bar': 'read-write', + '@foo/util': 'read-only' + } + server.get( + '/-/org/myorg/package?format=cli' + ).reply(404, {error: 'nope'}) + server.get( + '/-/user/myorg/package?format=cli' + ).reply(200, serverPackages) + common.npm( + [ + 'access', + 'ls-packages', + 'myorg', + '--registry', common.registry + ], + { cwd: missing }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access ls-packages') + t.same(JSON.parse(stdout), clientPackages) + rimraf.sync(missing) + t.end() + } + ) +}) + test('npm access ls-collaborators on current', function (t) { var serverCollaborators = { 'myorg:myteam': 'write', @@ -385,7 +490,6 @@ test('npm access ls-collaborators on current w/user filter', function (t) { ) }) - test('npm access edit', function (t) { common.npm( [ diff --git a/deps/npm/test/tap/add-named-update-protocol-port.js b/deps/npm/test/tap/add-named-update-protocol-port.js index 52832db0c257a1..78130e2f89ccc4 100644 --- a/deps/npm/test/tap/add-named-update-protocol-port.js +++ b/deps/npm/test/tap/add-named-update-protocol-port.js @@ -1,9 +1,10 @@ 'use strict' var path = require('path') -var nock = require('nock') var test = require('tap').test -var npm = require('../../') -var addNamed = require('../../lib/cache/add-named') +var common = require('../common-tap') +var mr = require('npm-registry-mock') +var server1 +var server2 var packageName = path.basename(__filename, '.js') @@ -36,46 +37,76 @@ var fooiPkg = { } } -test('tarball paths should update port if updating protocol', function (t) { - nock('http://localhost:1337/registry') - .get('/' + packageName) - .reply(200, fooPkg) - - nock('http://localhost:1337/registry') - .get('/' + packageName + '/-/' + packageName + '-0.0.0.tgz') - .reply(200, '1') - - nock('http://localhost:1338/registry') - .get('/' + packageName + '/-/' + packageName + '-0.0.0.tgz') - .reply(404) - - npm.load({registry: 'http://localhost:1337/registry', global: true}, function () { - addNamed(packageName, '0.0.0', null, function checkPath (err, pkg) { - t.ifError(err, 'addNamed worked') +test('setup', function (t) { + mr({ + port: 1337, + throwOnUnmatched: true + }, function (err, s) { + t.ifError(err, 'registry mocked successfully') + server1 = s + mr({ + port: 1338, + throwOnUnmatched: true + }, function (err, s) { + t.ifError(err, 'registry mocked successfully') + server2 = s t.end() }) }) - }) -test('tarball paths should NOT update if different hostname', function (t) { - nock('http://localhost:1337/registry') - .get('/' + iPackageName) - .reply(200, fooiPkg) +test('tarball paths should update port if updating protocol', function (t) { + server1.get('/registry/' + packageName).reply(200, fooPkg) + server1.get( + '/registry/' + packageName + '/-/' + packageName + '-0.0.0.tgz' + ).reply(200, '1') - nock('http://127.0.0.1:1338/registry') - .get('/' + iPackageName + '/-/' + iPackageName + '-0.0.0.tgz') - .reply(200, '1') + common.npm( + [ + 'cache', + 'add', + packageName + '@0.0.0', + '--registry', + 'http://localhost:1337/registry' + ], + {}, + function (er, code, stdout, stderr) { + if (er) { throw er } + t.equal(code, 0, 'addNamed worked') + server1.done() + t.end() + } + ) +}) - nock('http://127.0.0.1:1337/registry') - .get('/' + iPackageName + '/-/' + iPackageName + '-0.0.0.tgz') - .reply(404) +test('tarball paths should NOT update if different hostname', function (t) { + server1.get('/registry/' + iPackageName).reply(200, fooiPkg) + server2.get( + '/registry/' + iPackageName + '/-/' + iPackageName + '-0.0.0.tgz' + ).reply(200, '1') - npm.load({registry: 'http://localhost:1337/registry', global: true}, function () { - addNamed(iPackageName, '0.0.0', null, function checkPath (err, pkg) { - t.ifError(err, 'addNamed worked') + common.npm( + [ + 'cache', + 'add', + iPackageName + '@0.0.0', + '--registry', + 'http://localhost:1337/registry' + ], + {}, + function (er, code, stdout, stderr) { + if (er) { throw er } + t.equal(code, 0, 'addNamed worked') + server1.done() + server2.done() t.end() - }) - }) + } + ) +}) +test('cleanup', function (t) { + t.pass('cleaned up') + server1.close() + server2.close() + t.end() }) diff --git a/deps/npm/test/tap/add-remote-git-fake-windows.js b/deps/npm/test/tap/add-remote-git-fake-windows.js index c9c9dd446b9e1a..24175c5455fa38 100644 --- a/deps/npm/test/tap/add-remote-git-fake-windows.js +++ b/deps/npm/test/tap/add-remote-git-fake-windows.js @@ -20,7 +20,7 @@ var pjParent = JSON.stringify({ name: 'parent', version: '1.2.3', dependencies: { - child: 'git://localhost:1233/child.git' + child: 'git://localhost:1234/child.git' } }, null, 2) + '\n' @@ -29,7 +29,6 @@ var pjChild = JSON.stringify({ version: '1.0.3' }, null, 2) + '\n' - test('setup', function (t) { bootstrap() setup(function (er, r) { @@ -93,7 +92,8 @@ function setup (cb) { '--listen=localhost', '--export-all', '--base-path=.', - '--port=1233' + '--reuseaddr', + '--port=1234' ], { cwd: pkg, diff --git a/deps/npm/test/tap/add-remote-git-file.js b/deps/npm/test/tap/add-remote-git-file.js index 673be4c2854ef4..eff4a62e2ffbb4 100644 --- a/deps/npm/test/tap/add-remote-git-file.js +++ b/deps/npm/test/tap/add-remote-git-file.js @@ -45,6 +45,29 @@ test('cache from repo', function (t) { }) }) +test('save install', function (t) { + process.chdir(pkg) + fs.writeFileSync('package.json', JSON.stringify({ + name: 'parent', + version: '5.4.3' + }, null, 2) + '\n') + var prev = npm.config.get('save') + npm.config.set('save', true) + npm.commands.install('.', [cloneURL], function (er) { + npm.config.set('save', prev) + t.ifError(er, 'npm installed via git') + var pj = JSON.parse(fs.readFileSync('package.json', 'utf-8')) + var dep = pj.dependencies.child + t.equal( + url.parse(dep).protocol, + 'git+file:', + 'npm didn\'t strip the git+ from git+file://' + ) + + t.end() + }) +}) + test('clean', function (t) { cleanup() t.end() diff --git a/deps/npm/test/tap/add-remote-git-get-resolved.js b/deps/npm/test/tap/add-remote-git-get-resolved.js index 0bd0f29eb11aeb..dab51d16ef287c 100644 --- a/deps/npm/test/tap/add-remote-git-get-resolved.js +++ b/deps/npm/test/tap/add-remote-git-get-resolved.js @@ -11,7 +11,7 @@ var getResolved = null * Note: This is here because `normalizeGitUrl` is usually called * before getResolved is, and receives *that* URL. */ -function tryGetResolved(uri, treeish) { +function tryGetResolved (uri, treeish) { return getResolved(normalizeGitUrl(uri).url, treeish) } @@ -83,7 +83,6 @@ test('add-remote-git#get-resolved HTTPS', function (t) { }) test('add-remote-git#get-resolved edge cases', function (t) { - t.equal( tryGetResolved('git+ssh://user@bananaboat.com:galbi/blah.git', 'decadacefadabade'), 'git+ssh://user@bananaboat.com:galbi/blah.git#decadacefadabade', diff --git a/deps/npm/test/tap/add-remote-git-shrinkwrap.js b/deps/npm/test/tap/add-remote-git-shrinkwrap.js index f2982355e14b12..b79405c2b89481 100644 --- a/deps/npm/test/tap/add-remote-git-shrinkwrap.js +++ b/deps/npm/test/tap/add-remote-git-shrinkwrap.js @@ -20,7 +20,7 @@ var pjParent = JSON.stringify({ name: 'parent', version: '1.2.3', dependencies: { - 'child': 'git://localhost:1235/child.git#master' + 'child': 'git://localhost:1234/child.git#master' } }, null, 2) + '\n' @@ -61,14 +61,14 @@ test('shrinkwrap gets correct _from and _resolved (#7121)', function (t) { { cwd: pkg }, function (er, code, stdout, stderr) { t.ifError(er, 'npm shrinkwrapped without errors') - t.notOk(code, '`npm shrinkwrap` exited with 0') + t.is(code, 0, '`npm shrinkwrap` exited ok') t.equal(stdout.trim(), 'wrote npm-shrinkwrap.json') - t.notOk(stderr, 'no error output on successful shrinkwrap') + t.equal(stderr.trim(), '', 'no error output on successful shrinkwrap') var shrinkwrap = require(resolve(pkg, 'npm-shrinkwrap.json')) t.equal( shrinkwrap.dependencies.child.from, - 'git://localhost:1235/child.git#master', + 'git://localhost:1234/child.git#master', 'npm shrinkwrapped from correctly' ) @@ -82,7 +82,7 @@ test('shrinkwrap gets correct _from and _resolved (#7121)', function (t) { t.equal( shrinkwrap.dependencies.child.resolved, - 'git://localhost:1235/child.git#' + treeish, + 'git://localhost:1234/child.git#' + treeish, 'npm shrinkwrapped resolved correctly' ) @@ -121,7 +121,8 @@ function setup (cb) { '--listen=localhost', '--export-all', '--base-path=.', - '--port=1235' + '--reuseaddr', + '--port=1234' ], { cwd: pkg, diff --git a/deps/npm/test/tap/add-remote-git-submodule.js b/deps/npm/test/tap/add-remote-git-submodule.js new file mode 100644 index 00000000000000..f4a51b4f6cdcc7 --- /dev/null +++ b/deps/npm/test/tap/add-remote-git-submodule.js @@ -0,0 +1,145 @@ +var fs = require('fs') +var resolve = require('path').resolve + +var osenv = require('osenv') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test + +var npm = require('../../lib/npm.js') +var common = require('../common-tap.js') + +var pkg = resolve(__dirname, 'add-remote-git-submodule') +var repos = resolve(__dirname, 'add-remote-git-submodule-repos') +var subwt = resolve(repos, 'subwt') +var topwt = resolve(repos, 'topwt') +var suburl = 'git://localhost:1234/sub.git' +var topurl = 'git://localhost:1234/top.git' + +var daemon +var daemonPID +var git + +var pjParent = JSON.stringify({ + name: 'parent', + version: '1.2.3', + dependencies: { + child: topurl + } +}, null, 2) + '\n' + +var pjChild = JSON.stringify({ + name: 'child', + version: '1.0.3' +}, null, 2) + '\n' + +test('setup', function (t) { + setup(function (er, r) { + t.ifError(er, 'git started up successfully') + t.end() + }) +}) + +test('install from repo', function (t) { + bootstrap(t) + npm.commands.install('.', [], function (er) { + t.ifError(er, 'npm installed via git') + t.end() + }) +}) + +test('has file in submodule', function (t) { + bootstrap(t) + npm.commands.install('.', [], function (er) { + t.ifError(er, 'npm installed via git') + var fooPath = resolve('node_modules', 'child', 'subpath', 'foo.txt') + fs.stat(fooPath, function (er) { + t.ifError(er, 'file in submodule exists') + t.end() + }) + }) +}) + +test('clean', function (t) { + daemon.on('close', function () { + cleanup() + t.end() + }) + process.kill(daemonPID) +}) + +function bootstrap (t) { + mkdirp.sync(pkg) + process.chdir(pkg) + fs.writeFileSync('package.json', pjParent) + t.tearDown(function () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) + }) +} + +function setup (cb) { + mkdirp.sync(topwt) + fs.writeFileSync(resolve(topwt, 'package.json'), pjChild) + mkdirp.sync(subwt) + fs.writeFileSync(resolve(subwt, 'foo.txt'), 'This is provided by submodule') + npm.load({ registry: common.registry, loglevel: 'silent' }, function () { + git = require('../../lib/utils/git.js') + + function startDaemon (cb) { + // start git server + var d = git.spawn( + [ + 'daemon', + '--verbose', + '--listen=localhost', + '--export-all', + '--base-path=.', + '--reuseaddr', + '--port=1234' + ], + { + cwd: repos, + env: process.env, + stdio: ['pipe', 'pipe', 'pipe'] + } + ) + d.stderr.on('data', childFinder) + + function childFinder (c) { + var cpid = c.toString().match(/^\[(\d+)\]/) + if (cpid[1]) { + this.removeListener('data', childFinder) + daemon = d + daemonPID = cpid[1] + cb(null) + } + } + } + + var env = { PATH: process.env.PATH } + var topopt = { cwd: topwt, env: env } + var reposopt = { cwd: repos, env: env } + common.makeGitRepo({ + path: subwt, + added: ['foo.txt'], + commands: [ + git.chainableExec(['clone', '--bare', subwt, 'sub.git'], reposopt), + startDaemon, + [common.makeGitRepo, { + path: topwt, + commands: [ + git.chainableExec(['submodule', 'add', suburl, 'subpath'], topopt), + git.chainableExec(['commit', '-m', 'added submodule'], topopt), + git.chainableExec(['clone', '--bare', topwt, 'top.git'], reposopt) + ] + }] + ] + }, cb) + }) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(repos) +} diff --git a/deps/npm/test/tap/add-remote-git.js b/deps/npm/test/tap/add-remote-git.js index e33d09c1a13473..24abf33a773fd2 100644 --- a/deps/npm/test/tap/add-remote-git.js +++ b/deps/npm/test/tap/add-remote-git.js @@ -80,6 +80,7 @@ function setup (cb) { '--listen=localhost', '--export-all', '--base-path=.', + '--reuseaddr', '--port=1234' ], { diff --git a/deps/npm/test/tap/adduser-always-auth.js b/deps/npm/test/tap/adduser-always-auth.js index 6a451b451c3c62..375c3ab262eeed 100644 --- a/deps/npm/test/tap/adduser-always-auth.js +++ b/deps/npm/test/tap/adduser-always-auth.js @@ -1,142 +1,263 @@ -var fs = require("fs") -var path = require("path") -var rimraf = require("rimraf") -var mr = require("npm-registry-mock") +var fs = require('fs') +var path = require('path') +var rimraf = require('rimraf') +var mr = require('npm-registry-mock') -var test = require("tap").test -var common = require("../common-tap.js") +var test = require('tap').test +var common = require('../common-tap.js') -var opts = {cwd : __dirname} -var outfile = path.resolve(__dirname, "_npmrc") +var opts = {cwd: __dirname} +var outfile = path.resolve(__dirname, '_npmrc') var responses = { - "Username" : "u\n", - "Password" : "p\n", - "Email" : "u@p.me\n" + 'Username': 'u\n', + 'Password': 'p\n', + 'Email': 'u@p.me\n' } -function mocks(server) { +function verifyStdout (runner, successMessage, t) { + var remaining = Object.keys(responses).length + return function (chunk) { + if (remaining > 0) { + remaining-- + + var label = chunk.toString('utf8').split(':')[0] + runner.stdin.write(responses[label]) + + if (remaining === 0) runner.stdin.end() + } else { + var message = chunk.toString('utf8').trim() + t.equal(message, successMessage) + } + } +} + +function mocks (server) { server.filteringRequestBody(function (r) { if (r.match(/\"_id\":\"org\.couchdb\.user:u\"/)) { - return "auth" + return 'auth' } }) - server.put("/-/user/org.couchdb.user:u", "auth") - .reply(201, {username : "u", password : "p", email : "u@p.me"}) + server.put('/-/user/org.couchdb.user:u', 'auth') + .reply(201, { username: 'u', password: 'p', email: 'u@p.me' }) } -test("npm login", function (t) { - mr({port : common.port, plugin : mocks}, function (er, s) { +test('npm login', function (t) { + mr({ port: common.port, plugin: mocks }, function (er, s) { var runner = common.npm( - [ - "login", - "--registry", common.registry, - "--loglevel", "silent", - "--userconfig", outfile - ], + [ + 'login', + '--registry', common.registry, + '--loglevel', 'silent', + '--userconfig', outfile + ], opts, function (err, code) { - t.notOk(code, "exited OK") - t.notOk(err, "no error output") - var config = fs.readFileSync(outfile, "utf8") - t.like(config, /:always-auth=false/, "always-auth is scoped and false (by default)") + t.notOk(code, 'exited OK') + t.notOk(err, 'no error output') + var config = fs.readFileSync(outfile, 'utf8') + t.like(config, /:always-auth=false/, 'always-auth is scoped and false (by default)') s.close() rimraf(outfile, function (err) { - t.ifError(err, "removed config file OK") + t.ifError(err, 'removed config file OK') t.end() }) }) - var o = "", e = "", remaining = Object.keys(responses).length - runner.stdout.on("data", function (chunk) { - remaining-- - o += chunk + var message = 'Logged in as u on ' + common.registry + '/.' + runner.stdout.on('data', verifyStdout(runner, message, t)) + }) +}) - var label = chunk.toString("utf8").split(":")[0] - runner.stdin.write(responses[label]) +test('npm login --scope uses :registry as its URI', function (t) { + var port = common.port + 1 + var uri = 'http://localhost:' + port + '/' + var scope = '@myco' + common.npm( + [ + 'config', + '--userconfig', outfile, + 'set', + scope + ':registry', + uri + ], + opts, + function (err, code) { + t.notOk(code, 'exited OK') + t.notOk(err, 'no error output') - if (remaining === 0) runner.stdin.end() + mr({ port: port, plugin: mocks }, function (er, s) { + var runner = common.npm( + [ + 'login', + '--loglevel', 'silent', + '--userconfig', outfile, + '--scope', scope + ], + opts, + function (err, code) { + t.notOk(code, 'exited OK') + t.notOk(err, 'no error output') + var config = fs.readFileSync(outfile, 'utf8') + t.like(config, new RegExp(scope + ':registry=' + uri), 'scope:registry is set') + s.close() + rimraf(outfile, function (err) { + t.ifError(err, 'removed config file OK') + t.end() + }) + }) + + var message = 'Logged in as u to scope ' + scope + ' on ' + uri + '.' + runner.stdout.on('data', verifyStdout(runner, message, t)) }) - runner.stderr.on("data", function (chunk) { e += chunk }) }) }) -test("npm login --always-auth", function (t) { - mr({port : common.port, plugin : mocks}, function (er, s) { - var runner = common.npm( +test('npm login --scope makes sure is prefixed by an @', function (t) { + var port = common.port + 1 + var uri = 'http://localhost:' + port + '/' + var scope = 'myco' + var prefixedScope = '@' + scope + common.npm( [ - "login", - "--registry", common.registry, - "--loglevel", "silent", - "--userconfig", outfile, - "--always-auth" + '--userconfig', outfile, + 'config', + 'set', + prefixedScope + ':registry', + uri ], - opts, - function (err, code) { - t.notOk(code, "exited OK") - t.notOk(err, "no error output") - var config = fs.readFileSync(outfile, "utf8") - t.like(config, /:always-auth=true/, "always-auth is scoped and true") - s.close() - rimraf(outfile, function (err) { - t.ifError(err, "removed config file OK") - t.end() + opts, + function (err, code) { + t.notOk(code, 'exited OK') + t.notOk(err, 'no error output') + + mr({ port: port, plugin: mocks }, function (er, s) { + var runner = common.npm( + [ + 'login', + '--loglevel', 'silent', + '--userconfig', outfile, + '--scope', scope + ], + opts, + function (err, code) { + t.notOk(code, 'exited OK') + t.notOk(err, 'no error output') + var config = fs.readFileSync(outfile, 'utf8') + t.like(config, new RegExp(prefixedScope + ':registry=' + uri), 'scope:registry is set') + s.close() + rimraf(outfile, function (err) { + t.ifError(err, 'removed config file OK') + t.end() + }) }) + + var message = 'Logged in as u to scope ' + prefixedScope + ' on ' + uri + '.' + runner.stdout.on('data', verifyStdout(runner, message, t)) }) + }) +}) - var o = "", e = "", remaining = Object.keys(responses).length - runner.stdout.on("data", function (chunk) { - remaining-- - o += chunk +test('npm login --scope --registry uses as its URI', function (t) { + var scope = '@myco' + common.npm( + [ + '--userconfig', outfile, + 'config', + 'set', + scope + ':registry', + 'invalidurl' + ], + opts, + function (err, code) { + t.notOk(code, 'exited OK') + t.notOk(err, 'no error output') - var label = chunk.toString("utf8").split(":")[0] - runner.stdin.write(responses[label]) + mr({ port: common.port, plugin: mocks }, function (er, s) { + var runner = common.npm( + [ + 'login', + '--registry', common.registry, + '--loglevel', 'silent', + '--userconfig', outfile, + '--scope', scope + ], + opts, + function (err, code) { + t.notOk(code, 'exited OK') + t.notOk(err, 'no error output') + var config = fs.readFileSync(outfile, 'utf8') + t.like(config, new RegExp(scope + ':registry=' + common.registry), 'scope:registry is set') + s.close() + rimraf(outfile, function (err) { + t.ifError(err, 'removed config file OK') + t.end() + }) + }) - if (remaining === 0) runner.stdin.end() + var message = 'Logged in as u to scope ' + scope + ' on ' + common.registry + '/.' + runner.stdout.on('data', verifyStdout(runner, message, t)) }) - runner.stderr.on("data", function (chunk) { e += chunk }) }) }) -test("npm login --no-always-auth", function (t) { - mr({port : common.port, plugin : mocks}, function (er, s) { +test('npm login --always-auth', function (t) { + mr({ port: common.port, plugin: mocks }, function (er, s) { var runner = common.npm( - [ - "login", - "--registry", common.registry, - "--loglevel", "silent", - "--userconfig", outfile, - "--no-always-auth" - ], + [ + 'login', + '--registry', common.registry, + '--loglevel', 'silent', + '--userconfig', outfile, + '--always-auth' + ], opts, function (err, code) { - t.notOk(code, "exited OK") - t.notOk(err, "no error output") - var config = fs.readFileSync(outfile, "utf8") - t.like(config, /:always-auth=false/, "always-auth is scoped and false") + t.notOk(code, 'exited OK') + t.notOk(err, 'no error output') + var config = fs.readFileSync(outfile, 'utf8') + t.like(config, /:always-auth=true/, 'always-auth is scoped and true') s.close() rimraf(outfile, function (err) { - t.ifError(err, "removed config file OK") + t.ifError(err, 'removed config file OK') t.end() }) }) - var o = "", e = "", remaining = Object.keys(responses).length - runner.stdout.on("data", function (chunk) { - remaining-- - o += chunk - - var label = chunk.toString("utf8").split(":")[0] - runner.stdin.write(responses[label]) + var message = 'Logged in as u on ' + common.registry + '/.' + runner.stdout.on('data', verifyStdout(runner, message, t)) + }) +}) - if (remaining === 0) runner.stdin.end() +test('npm login --no-always-auth', function (t) { + mr({ port: common.port, plugin: mocks }, function (er, s) { + var runner = common.npm( + [ + 'login', + '--registry', common.registry, + '--loglevel', 'silent', + '--userconfig', outfile, + '--no-always-auth' + ], + opts, + function (err, code) { + t.notOk(code, 'exited OK') + t.notOk(err, 'no error output') + var config = fs.readFileSync(outfile, 'utf8') + t.like(config, /:always-auth=false/, 'always-auth is scoped and false') + s.close() + rimraf(outfile, function (err) { + t.ifError(err, 'removed config file OK') + t.end() + }) }) - runner.stderr.on("data", function (chunk) { e += chunk }) + + var message = 'Logged in as u on ' + common.registry + '/.' + runner.stdout.on('data', verifyStdout(runner, message, t)) }) }) - -test("cleanup", function (t) { +test('cleanup', function (t) { rimraf.sync(outfile) - t.pass("cleaned up") + t.pass('cleaned up') t.end() }) diff --git a/deps/npm/test/tap/adduser-legacy-auth.js b/deps/npm/test/tap/adduser-legacy-auth.js index f9829c618ac7e8..1fc1210edb40bd 100644 --- a/deps/npm/test/tap/adduser-legacy-auth.js +++ b/deps/npm/test/tap/adduser-legacy-auth.js @@ -53,37 +53,41 @@ test('setup', function (t) { test('npm login', function (t) { mr({ port: common.port, plugin: mocks }, function (er, s) { var runner = common.npm( - [ - 'login', - '--registry', common.registry, - '--loglevel', 'silent', - '--userconfig', outfile - ], - opts, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm ran without issue') - t.notOk(code, 'exited OK') - t.notOk(stderr, 'no error output') - var config = fs.readFileSync(outfile, 'utf8') - t.like(config, /:always-auth=false/, 'always-auth is scoped and false (by default)') - s.close() - rimraf(outfile, function (err) { - t.ifError(err, 'removed config file OK') - t.end() - }) - }) + [ + 'login', + '--registry', common.registry, + '--loglevel', 'silent', + '--userconfig', outfile + ], + opts, + function (err, code, stdout, stderr) { + t.ifError(err, 'npm ran without issue') + t.notOk(code, 'exited OK') + t.notOk(stderr, 'no error output') + var config = fs.readFileSync(outfile, 'utf8') + t.like(config, /:always-auth=false/, 'always-auth is scoped and false (by default)') + s.close() + rimraf(outfile, function (err) { + t.ifError(err, 'removed config file OK') + t.end() + }) + } + ) - var o = '', e = '', remaining = Object.keys(responses).length + var remaining = Object.keys(responses).length runner.stdout.on('data', function (chunk) { - remaining-- - o += chunk + if (remaining > 0) { + remaining-- - var label = chunk.toString('utf8').split(':')[0] - runner.stdin.write(responses[label]) + var label = chunk.toString('utf8').split(':')[0] + runner.stdin.write(responses[label]) - if (remaining === 0) runner.stdin.end() + if (remaining === 0) runner.stdin.end() + } else { + var message = chunk.toString('utf8').trim() + t.equal(message, 'Logged in as u on ' + common.registry + '/.') + } }) - runner.stderr.on('data', function (chunk) { e += chunk }) }) }) diff --git a/deps/npm/test/tap/bearer-token-check.js b/deps/npm/test/tap/bearer-token-check.js new file mode 100644 index 00000000000000..8ddbec29a4cb17 --- /dev/null +++ b/deps/npm/test/tap/bearer-token-check.js @@ -0,0 +1,118 @@ +var resolve = require('path').resolve +var writeFileSync = require('graceful-fs').writeFileSync + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') +var toNerfDart = require('../../lib/config/nerf-dart.js') + +var pkg = resolve(__dirname, 'install-bearer-check') +var outfile = resolve(pkg, '_npmrc') +var modules = resolve(pkg, 'node_modules') +var tarballPath = '/scoped-underscore/-/scoped-underscore-1.3.1.tgz' +// needs to be a different hostname to verify tokens (not) being sent correctly +var tarballURL = 'http://lvh.me:' + common.port + tarballPath +var tarball = resolve(__dirname, '../fixtures/scoped-underscore-1.3.1.tgz') + +var server + +var EXEC_OPTS = { cwd: pkg } + +function mocks (server) { + var auth = 'Bearer 0xabad1dea' + server.get(tarballPath, { authorization: auth }).reply(403, { + error: 'token leakage', + reason: 'This token should not be sent.' + }) + server.get(tarballPath).replyWithFile(200, tarball) +} + +test('setup', function (t) { + mr({ port: common.port, plugin: mocks }, function (er, s) { + server = s + t.ok(s, 'set up mock registry') + setup() + t.end() + }) +}) + +test('authed npm install with tarball not on registry', function (t) { + common.npm( + [ + 'install', + '--loglevel', 'silent', + '--json', + '--fetch-retries', 0, + '--userconfig', outfile + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, 'test runner executed without error') + t.equal(code, 0, 'npm install exited OK') + t.notOk(stderr, 'no output on stderr') + try { + var results = JSON.parse(stdout) + } catch (ex) { + console.error('#', ex) + t.ifError(ex, 'stdout was valid JSON') + } + + if (results) { + var installedversion = { + 'version': '1.3.1', + 'from': '>=1.3.1 <2', + 'resolved': 'http://lvh.me:1337/scoped-underscore/-/scoped-underscore-1.3.1.tgz' + } + t.isDeeply(results.dependencies['@scoped/underscore'], installedversion, '@scoped/underscore installed') + } + + t.end() + } + ) +}) + +test('cleanup', function (t) { + server.close() + cleanup() + t.end() +}) + +var contents = '@scoped:registry=' + common.registry + '\n' + + toNerfDart(common.registry) + ':_authToken=0xabad1dea\n' + +var json = { + name: 'test-package-install', + version: '1.0.0' +} + +var shrinkwrap = { + name: 'test-package-install', + version: '1.0.0', + dependencies: { + '@scoped/underscore': { + resolved: tarballURL, + from: '>=1.3.1 <2', + version: '1.3.1' + } + } +} + +function setup () { + cleanup() + mkdirp.sync(modules) + writeFileSync(resolve(pkg, 'package.json'), JSON.stringify(json, null, 2) + '\n') + writeFileSync(outfile, contents) + writeFileSync( + resolve(pkg, 'npm-shrinkwrap.json'), + JSON.stringify(shrinkwrap, null, 2) + '\n' + ) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/deps/npm/test/tap/bin.js b/deps/npm/test/tap/bin.js index ee4e1ff28c4827..33320bc21f59a1 100644 --- a/deps/npm/test/tap/bin.js +++ b/deps/npm/test/tap/bin.js @@ -1,17 +1,23 @@ -var path = require("path") -var test = require("tap").test -var common = require("../common-tap.js") +var path = require('path') +var test = require('tap').test +var rimraf = require('rimraf') +var common = require('../common-tap.js') var opts = { cwd: __dirname } -var binDir = "../../node_modules/.bin" +var binDir = '../../node_modules/.bin' var fixture = path.resolve(__dirname, binDir) +test('setup', function (t) { + rimraf.sync(path.join(__dirname, 'node_modules')) + t.end() +}) + test('npm bin', function (t) { - common.npm(["bin"], opts, function (err, code, stdout, stderr) { - t.ifError(err, "bin ran without issue") - t.notOk(stderr, "should have no stderr") - t.equal(code, 0, "exit ok") + common.npm(['bin'], opts, function (err, code, stdout, stderr) { + t.ifError(err, 'bin ran without issue') + t.notOk(stderr, 'should have no stderr') + t.equal(code, 0, 'exit ok') var res = path.resolve(stdout) - t.equal(res, fixture + "\n") + t.equal(res, fixture + '\n') t.end() }) }) diff --git a/deps/npm/test/tap/bitbucket-https-url-with-creds.js b/deps/npm/test/tap/bitbucket-https-url-with-creds.js index 3f39e3be45a3b5..4e9d14d7e01a17 100644 --- a/deps/npm/test/tap/bitbucket-https-url-with-creds.js +++ b/deps/npm/test/tap/bitbucket-https-url-with-creds.js @@ -38,7 +38,7 @@ test('bitbucket-https-url-with-creds', function (t) { } else { t.fail('too many attempts to clone') } - cb(new Error()) + cb(new Error('execFile mock fails on purpose')) }) } } diff --git a/deps/npm/test/tap/bitbucket-shortcut-package.js b/deps/npm/test/tap/bitbucket-shortcut-package.js index bc38bd02fe571c..69cfe6c2059203 100644 --- a/deps/npm/test/tap/bitbucket-shortcut-package.js +++ b/deps/npm/test/tap/bitbucket-shortcut-package.js @@ -27,8 +27,8 @@ test('setup', function (t) { test('bitbucket-shortcut', function (t) { var cloneUrls = [ - ['git@bitbucket.org:foo/private.git', 'Bitbucket shortcuts try SSH first'], - ['https://bitbucket.org/foo/private.git', 'Bitbucket shortcuts try HTTPS URLs second'] + ['https://bitbucket.org/foo/private.git', 'Bitbucket shortcuts try HTTPS URLs first'], + ['git@bitbucket.org:foo/private.git', 'Bitbucket shortcuts try SSH second'] ] var npm = requireInject.installGlobally('../../lib/npm.js', { diff --git a/deps/npm/test/tap/bitbucket-shortcut.js b/deps/npm/test/tap/bitbucket-shortcut.js index 51afe19926d947..a9b60f8b56818a 100644 --- a/deps/npm/test/tap/bitbucket-shortcut.js +++ b/deps/npm/test/tap/bitbucket-shortcut.js @@ -24,8 +24,8 @@ test('setup', function (t) { test('bitbucket-shortcut', function (t) { var cloneUrls = [ - ['git@bitbucket.org:foo/private.git', 'Bitbucket shortcuts try SSH first'], - ['https://bitbucket.org/foo/private.git', 'Bitbucket shortcuts try HTTPS URLs second'] + ['https://bitbucket.org/foo/private.git', 'Bitbucket shortcuts try HTTPS URLs first'], + ['git@bitbucket.org:foo/private.git', 'Bitbucket shortcuts try SSH second'] ] var npm = requireInject.installGlobally('../../lib/npm.js', { @@ -39,7 +39,7 @@ test('bitbucket-shortcut', function (t) { } else { t.fail('too many attempts to clone') } - cb(new Error()) + cb(new Error('execFile mock fails on purpose')) }) } } diff --git a/deps/npm/test/tap/bugs.js b/deps/npm/test/tap/bugs.js index 51ba5d3fe1efbb..090c2b9cb21add 100644 --- a/deps/npm/test/tap/bugs.js +++ b/deps/npm/test/tap/bugs.js @@ -1,151 +1,175 @@ -if (process.platform === "win32") { - console.error("skipping test, because windows and shebangs") - return +if (process.platform === 'win32') { + console.error('skipping test, because windows and shebangs') + process.exit(0) } -var common = require("../common-tap.js") -var mr = require("npm-registry-mock") +var common = require('../common-tap.js') +var mr = require('npm-registry-mock') -var test = require("tap").test -var rimraf = require("rimraf") -var fs = require("fs") -var path = require("path") +var test = require('tap').test +var rimraf = require('rimraf') +var fs = require('fs') +var path = require('path') var join = path.join -var outFile = path.join(__dirname, "/_output") +var outFile = path.join(__dirname, '/_output') var opts = { cwd: __dirname } -test("setup", function (t) { - var s = "#!/usr/bin/env bash\n" + - "echo \"$@\" > " + JSON.stringify(__dirname) + "/_output\n" - fs.writeFileSync(join(__dirname, "/_script.sh"), s, "ascii") - fs.chmodSync(join(__dirname, "/_script.sh"), "0755") - t.pass("made script") +test('setup', function (t) { + var s = '#!/usr/bin/env bash\n' + + 'echo \"$@\" > ' + JSON.stringify(__dirname) + '/_output\n' + fs.writeFileSync(join(__dirname, '/_script.sh'), s, 'ascii') + fs.chmodSync(join(__dirname, '/_script.sh'), '0755') + t.pass('made script') t.end() }) -test("npm bugs underscore", function (t) { - mr({port : common.port}, function (er, s) { - common.npm([ - "bugs", "underscore", - "--registry=" + common.registry, - "--loglevel=silent", - "--browser=" + join(__dirname, "/_script.sh") - ], opts, function (err, code, stdout, stderr) { - t.ifError(err, "bugs ran without issue") - t.notOk(stderr, "should have no stderr") - t.equal(code, 0, "exit ok") - var res = fs.readFileSync(outFile, "ascii") - s.close() - t.equal(res, "https://github.com/jashkenas/underscore/issues\n") - rimraf.sync(outFile) - t.end() - }) +test('npm bugs underscore', function (t) { + mr({ port: common.port }, function (er, s) { + common.npm( + [ + 'bugs', 'underscore', + '--registry=' + common.registry, + '--loglevel=silent', + '--browser=' + join(__dirname, '/_script.sh') + ], + opts, + function (err, code, stdout, stderr) { + t.ifError(err, 'bugs ran without issue') + t.notOk(stderr, 'should have no stderr') + t.equal(code, 0, 'exit ok') + var res = fs.readFileSync(outFile, 'ascii') + s.close() + t.equal(res, 'https://github.com/jashkenas/underscore/issues\n') + rimraf.sync(outFile) + t.end() + } + ) }) }) -test("npm bugs optimist - github (https://)", function (t) { - mr({port : common.port}, function (er, s) { - common.npm([ - "bugs", "optimist", - "--registry=" + common.registry, - "--loglevel=silent", - "--browser=" + join(__dirname, "/_script.sh") - ], opts, function (err, code, stdout, stderr) { - t.ifError(err, "bugs ran without issue") - t.notOk(stderr, "should have no stderr") - t.equal(code, 0, "exit ok") - var res = fs.readFileSync(outFile, "ascii") - s.close() - t.equal(res, "https://github.com/substack/node-optimist/issues\n") - rimraf.sync(outFile) - t.end() - }) +test('npm bugs optimist - github (https://)', function (t) { + mr({ port: common.port }, function (er, s) { + common.npm( + [ + 'bugs', 'optimist', + '--registry=' + common.registry, + '--loglevel=silent', + '--browser=' + join(__dirname, '/_script.sh') + ], + opts, + function (err, code, stdout, stderr) { + t.ifError(err, 'bugs ran without issue') + t.notOk(stderr, 'should have no stderr') + t.equal(code, 0, 'exit ok') + var res = fs.readFileSync(outFile, 'ascii') + s.close() + t.equal(res, 'https://github.com/substack/node-optimist/issues\n') + rimraf.sync(outFile) + t.end() + } + ) }) }) -test("npm bugs npm-test-peer-deps - no repo", function (t) { - mr({port : common.port}, function (er, s) { - common.npm([ - "bugs", "npm-test-peer-deps", - "--registry=" + common.registry, - "--loglevel=silent", - "--browser=" + join(__dirname, "/_script.sh") - ], opts, function (err, code, stdout, stderr) { - t.ifError(err, "bugs ran without issue") - t.notOk(stderr, "should have no stderr") - t.equal(code, 0, "exit ok") - var res = fs.readFileSync(outFile, "ascii") - s.close() - t.equal(res, "https://www.npmjs.org/package/npm-test-peer-deps\n") - rimraf.sync(outFile) - t.end() - }) +test('npm bugs npm-test-peer-deps - no repo', function (t) { + mr({ port: common.port }, function (er, s) { + common.npm( + [ + 'bugs', 'npm-test-peer-deps', + '--registry=' + common.registry, + '--loglevel=silent', + '--browser=' + join(__dirname, '/_script.sh') + ], + opts, + function (err, code, stdout, stderr) { + t.ifError(err, 'bugs ran without issue') + t.notOk(stderr, 'should have no stderr') + t.equal(code, 0, 'exit ok') + var res = fs.readFileSync(outFile, 'ascii') + s.close() + t.equal(res, 'https://www.npmjs.org/package/npm-test-peer-deps\n') + rimraf.sync(outFile) + t.end() + } + ) }) }) -test("npm bugs test-repo-url-http - non-github (http://)", function (t) { - mr({port : common.port}, function (er, s) { - common.npm([ - "bugs", "test-repo-url-http", - "--registry=" + common.registry, - "--loglevel=silent", - "--browser=" + join(__dirname, "/_script.sh") - ], opts, function (err, code, stdout, stderr) { - t.ifError(err, "bugs ran without issue") - t.notOk(stderr, "should have no stderr") - t.equal(code, 0, "exit ok") - var res = fs.readFileSync(outFile, "ascii") - s.close() - t.equal(res, "https://www.npmjs.org/package/test-repo-url-http\n") - rimraf.sync(outFile) - t.end() - }) +test('npm bugs test-repo-url-http - non-github (http://)', function (t) { + mr({ port: common.port }, function (er, s) { + common.npm( + [ + 'bugs', 'test-repo-url-http', + '--registry=' + common.registry, + '--loglevel=silent', + '--browser=' + join(__dirname, '/_script.sh') + ], + opts, + function (err, code, stdout, stderr) { + t.ifError(err, 'bugs ran without issue') + t.notOk(stderr, 'should have no stderr') + t.equal(code, 0, 'exit ok') + var res = fs.readFileSync(outFile, 'ascii') + s.close() + t.equal(res, 'https://www.npmjs.org/package/test-repo-url-http\n') + rimraf.sync(outFile) + t.end() + } + ) }) }) -test("npm bugs test-repo-url-https - non-github (https://)", function (t) { - mr({port : common.port}, function (er, s) { - common.npm([ - "bugs", "test-repo-url-https", - "--registry=" + common.registry, - "--loglevel=silent", - "--browser=" + join(__dirname, "/_script.sh") - ], opts, function (err, code, stdout, stderr) { - t.ifError(err, "bugs ran without issue") - t.notOk(stderr, "should have no stderr") - t.equal(code, 0, "exit ok") - var res = fs.readFileSync(outFile, "ascii") - s.close() - t.equal(res, "https://www.npmjs.org/package/test-repo-url-https\n") - rimraf.sync(outFile) - t.end() - }) +test('npm bugs test-repo-url-https - gitlab (https://)', function (t) { + mr({ port: common.port }, function (er, s) { + common.npm( + [ + 'bugs', 'test-repo-url-https', + '--registry=' + common.registry, + '--loglevel=silent', + '--browser=' + join(__dirname, '/_script.sh') + ], + opts, + function (err, code, stdout, stderr) { + t.ifError(err, 'bugs ran without issue') + t.notOk(stderr, 'should have no stderr') + t.equal(code, 0, 'exit ok') + var res = fs.readFileSync(outFile, 'ascii') + s.close() + t.equal(res, 'https://gitlab.com/evanlucas/test-repo-url-https/issues\n') + rimraf.sync(outFile) + t.end() + } + ) }) }) -test("npm bugs test-repo-url-ssh - non-github (ssh://)", function (t) { - mr({port : common.port}, function (er, s) { - common.npm([ - "bugs", "test-repo-url-ssh", - "--registry=" + common.registry, - "--loglevel=silent", - "--browser=" + join(__dirname, "/_script.sh") - ], opts, function (err, code, stdout, stderr) { - t.ifError(err, "bugs ran without issue") - t.notOk(stderr, "should have no stderr") - t.equal(code, 0, "exit ok") - var res = fs.readFileSync(outFile, "ascii") - s.close() - t.equal(res, "https://www.npmjs.org/package/test-repo-url-ssh\n") - rimraf.sync(outFile) - t.end() - }) +test('npm bugs test-repo-url-ssh - gitlab (ssh://)', function (t) { + mr({ port: common.port }, function (er, s) { + common.npm( + [ + 'bugs', 'test-repo-url-ssh', + '--registry=' + common.registry, + '--loglevel=silent', + '--browser=' + join(__dirname, '/_script.sh') + ], + opts, + function (err, code, stdout, stderr) { + t.ifError(err, 'bugs ran without issue') + t.notOk(stderr, 'should have no stderr') + t.equal(code, 0, 'exit ok') + var res = fs.readFileSync(outFile, 'ascii') + s.close() + t.equal(res, 'https://gitlab.com/evanlucas/test-repo-url-ssh/issues\n') + rimraf.sync(outFile) + t.end() + } + ) }) }) -test("cleanup", function (t) { - fs.unlinkSync(join(__dirname, "/_script.sh")) - t.pass("cleaned up") +test('cleanup', function (t) { + fs.unlinkSync(join(__dirname, '/_script.sh')) + t.pass('cleaned up') t.end() }) diff --git a/deps/npm/test/tap/build-already-built.js b/deps/npm/test/tap/build-already-built.js index 8e5546fe4dd2b9..8a66f66e69f933 100644 --- a/deps/npm/test/tap/build-already-built.js +++ b/deps/npm/test/tap/build-already-built.js @@ -1,64 +1,62 @@ // if "npm rebuild" is run with bundled dependencies, // message "already built" should not be error -var test = require("tap").test -var path = require("path") -var osenv = require("osenv") -var rimraf = require("rimraf") -var npmlog = require("npmlog") -var mkdirp = require("mkdirp") -var requireInject = require("require-inject") +var test = require('tap').test +var path = require('path') +var osenv = require('osenv') +var rimraf = require('rimraf') +var npmlog = require('npmlog') +var mkdirp = require('mkdirp') +var requireInject = require('require-inject') -var npm = require("../../lib/npm.js") +var npm = require('../../lib/npm.js') -var PKG_DIR = path.resolve(__dirname, "build-already-built") -var fakePkg = "foo" +var PKG_DIR = path.resolve(__dirname, 'build-already-built') +var fakePkg = 'foo' -test("setup", function (t) { +test('setup', function (t) { cleanup() t.end() }) test("issue #6735 build 'already built' message", function (t) { - npm.load({loglevel : "warn"}, function () { + npm.load({ loglevel: 'warn' }, function () { // capture log messages with level - var log = "" - npmlog.on("log", function (chunk) { - log += chunk.level + " " + chunk.message + "\n" + var log = '' + npmlog.on('log', function (chunk) { + log += chunk.level + ' ' + chunk.message + '\n' }) mkdirp.sync(fakePkg) var folder = path.resolve(fakePkg) - var global = npm.config.get("global") + var global = npm.config.get('global') - var build = requireInject("../../lib/build", { + var build = requireInject('../../lib/build', { }) - t.test("pin previous behavior", function (t) { - + t.test('pin previous behavior', function (t) { build([fakePkg], global, false, false, function (err) { - t.ok(err, "build failed as expected") - t.similar(err.message, /package.json/, "missing package.json as expected") - t.notSimilar(log, /already built/, "no already built message written") + t.ok(err, 'build failed as expected') + t.similar(err.message, /package.json/, 'missing package.json as expected') + t.notSimilar(log, /already built/, 'no already built message written') t.end() }) }) - t.test("simulate rebuild of bundledDependency", function (t) { - - log = "" + t.test('simulate rebuild of bundledDependency', function (t) { + log = '' build._didBuild[folder] = true build([fakePkg], global, false, false, function (err) { - t.ok(err, "build failed as expected") - t.similar(err.message, /package.json/, "missing package.json as expected") + t.ok(err, 'build failed as expected') + t.similar(err.message, /package.json/, 'missing package.json as expected') - t.similar(log, /already built/, "already built message written") - t.notSimilar(log, /ERR! already built/, "already built message written is not error") - t.similar(log, /info already built/, "already built message written is info") + t.similar(log, /already built/, 'already built message written') + t.notSimilar(log, /ERR! already built/, 'already built message written is not error') + t.similar(log, /info already built/, 'already built message written is info') t.end() }) @@ -68,8 +66,7 @@ test("issue #6735 build 'already built' message", function (t) { }) }) - -test("cleanup", function (t) { +test('cleanup', function (t) { cleanup() t.end() diff --git a/deps/npm/test/tap/builtin-config.js b/deps/npm/test/tap/builtin-config.js index d92551ed6ea227..bb08767c563ff6 100644 --- a/deps/npm/test/tap/builtin-config.js +++ b/deps/npm/test/tap/builtin-config.js @@ -1,126 +1,134 @@ -var fs = require("fs") +var fs = require('fs') -if (process.argv[2] === "write-builtin") { +if (process.argv[2] === 'write-builtin') { var pid = process.argv[3] - fs.writeFileSync("npmrc", "foo=bar\npid=" + pid + "\n") - return + fs.writeFileSync('npmrc', 'foo=bar\npid=' + pid + '\n') + process.exit(0) } -var rcdata = "foo=bar\npid=" + process.pid + "\n" -var common = require("../common-tap.js") -var path = require("path") -var rimraf = require("rimraf") -var mkdirp = require("mkdirp") -var folder = path.resolve(__dirname, "builtin-config") -var test = require("tap").test -var npm = path.resolve(__dirname, "../..") -var spawn = require("child_process").spawn +var common = require('../common-tap.js') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var folder = path.resolve(__dirname, 'builtin-config') +var test = require('tap').test +var npm = path.resolve(__dirname, '../..') +var spawn = require('child_process').spawn var node = process.execPath -test("setup", function (t) { +test('setup', function (t) { + t.plan(1) rimraf.sync(folder) - mkdirp.sync(folder + "/first") - mkdirp.sync(folder + "/second") - mkdirp.sync(folder + "/cache") - mkdirp.sync(folder + "/tmp") + mkdirp.sync(folder + '/first') + mkdirp.sync(folder + '/second') + mkdirp.sync(folder + '/cache') + mkdirp.sync(folder + '/tmp') - t.pass("finished setup") + t.pass('finished setup') t.end() }) - -test("install npm into first folder", function (t) { - var args = ["install", npm, "-g", - "--prefix=" + folder + "/first", - "--ignore-scripts", - "--cache=" + folder + "/cache", - "--no-spin", - "--loglevel=silent", - "--tmp=" + folder + "/tmp"] - common.npm(args, {stdio: "inherit"}, function (er, code) { +test('install npm into first folder', function (t) { + t.plan(1) + var args = ['install', npm, '-g', + '--prefix=' + folder + '/first', + '--ignore-scripts', + '--cache=' + folder + '/cache', + '--loglevel=silent', + '--tmp=' + folder + '/tmp'] + common.npm(args, {stdio: 'inherit'}, function (er, code) { if (er) throw er t.equal(code, 0) t.end() }) }) -test("write npmrc file", function (t) { - common.npm(["explore", "npm", "-g", - "--prefix=" + folder + "/first", - "--cache=" + folder + "/cache", - "--tmp=" + folder + "/tmp", - "--no-spin", - "--", - node, __filename, "write-builtin", process.pid +test('write npmrc file', function (t) { + t.plan(1) + common.npm(['explore', 'npm', '-g', + '--prefix=' + folder + '/first', + '--cache=' + folder + '/cache', + '--tmp=' + folder + '/tmp', + '--', + node, __filename, 'write-builtin', process.pid ], - {"stdio": "inherit"}, + {'stdio': 'inherit'}, function (er, code) { - if (er) throw er - t.equal(code, 0) - t.end() - }) + if (er) throw er + t.equal(code, 0) + t.end() + }) }) -test("use first npm to install second npm", function (t) { +test('use first npm to install second npm', function (t) { + t.plan(3) // get the root location - common.npm([ "root", "-g", - "--prefix=" + folder + "/first", - "--cache=" + folder + "/cache", - "--tmp=" + folder + "/tmp", - "--no-spin" - ], {}, function (er, code, so) { - if (er) throw er - t.equal(code, 0) - var root = so.trim() - t.ok(fs.statSync(root).isDirectory()) - - var bin = path.resolve(root, "npm/bin/npm-cli.js") - spawn( node - , [ bin - , "install", npm - , "-g" - , "--prefix=" + folder + "/second" - , "--cache=" + folder + "/cache" - , "--tmp=" + folder + "/tmp" - , "--no-spin" - ]) - .on("error", function (er) { throw er }) - .on("close", function (code) { - t.equal(code, 0, "code is zero") - t.end() - }) - }) -}) - -test("verify that the builtin config matches", function (t) { - common.npm([ "root", "-g", - "--prefix=" + folder + "/first", - "--cache=" + folder + "/cache", - "--tmp=" + folder + "/tmp" - ], {}, function (er, code, so) { - if (er) throw er - t.equal(code, 0) - var firstRoot = so.trim() - common.npm([ "root", "-g", - "--prefix=" + folder + "/second", - "--cache=" + folder + "/cache", - "--tmp=" + folder + "/tmp" - ], {}, function (er, code, so) { + common.npm( + [ + 'root', '-g', + '--prefix=' + folder + '/first', + '--cache=' + folder + '/cache', + '--tmp=' + folder + '/tmp' + ], + {}, + function (er, code, so) { if (er) throw er t.equal(code, 0) - var secondRoot = so.trim() - var firstRc = path.resolve(firstRoot, "npm", "npmrc") - var secondRc = path.resolve(secondRoot, "npm", "npmrc") - var firstData = fs.readFileSync(firstRc, "utf8") - var secondData = fs.readFileSync(secondRc, "utf8") - t.equal(firstData, secondData) - t.end() - }) - }) + var root = so.trim() + t.ok(fs.statSync(root).isDirectory()) + + var bin = path.resolve(root, 'npm/bin/npm-cli.js') + spawn( + node, + [ + bin, + 'install', npm, + '-g', + '--prefix=' + folder + '/second', + '--cache=' + folder + '/cache', + '--tmp=' + folder + '/tmp' + ] + ) + .on('error', function (er) { throw er }) + .on('close', function (code) { + t.equal(code, 0, 'code is zero') + t.end() + }) + } + ) }) +test('verify that the builtin config matches', function (t) { + t.plan(3) + common.npm([ 'root', '-g', + '--prefix=' + folder + '/first', + '--cache=' + folder + '/cache', + '--tmp=' + folder + '/tmp' + ], {}, + function (er, code, so) { + if (er) throw er + t.equal(code, 0) + var firstRoot = so.trim() + common.npm([ 'root', '-g', + '--prefix=' + folder + '/second', + '--cache=' + folder + '/cache', + '--tmp=' + folder + '/tmp' + ], {}, + function (er, code, so) { + if (er) throw er + t.equal(code, 0) + var secondRoot = so.trim() + var firstRc = path.resolve(firstRoot, 'npm', 'npmrc') + var secondRc = path.resolve(secondRoot, 'npm', 'npmrc') + var firstData = fs.readFileSync(firstRc, 'utf8') + var secondData = fs.readFileSync(secondRc, 'utf8') + t.equal(firstData, secondData) + t.end() + }) + }) +}) -test("clean", function (t) { +test('clean', function (t) { rimraf.sync(folder) t.end() }) diff --git a/deps/npm/test/tap/bundled-dependencies-nonarray.js b/deps/npm/test/tap/bundled-dependencies-nonarray.js index bff0522d03122e..2a082720084ab7 100644 --- a/deps/npm/test/tap/bundled-dependencies-nonarray.js +++ b/deps/npm/test/tap/bundled-dependencies-nonarray.js @@ -1,12 +1,10 @@ var fs = require('graceful-fs') var path = require('path') -var osenv = require('osenv') var mkdirp = require('mkdirp') var rimraf = require('rimraf') var test = require('tap').test -var npm = require('../../lib/npm.js') var common = require('../common-tap.js') var dir = path.resolve(__dirname, 'bundleddependencies') @@ -36,24 +34,19 @@ test('setup', function (t) { test('errors on non-array bundleddependencies', function (t) { t.plan(6) - process.chdir(pkg) - npm.load({}, - function () { - common.npm(['install'], { cwd: pkg }, function (err, code, stdout, stderr) { - t.ifError(err, 'npm install ran without issue') - t.notOk(code, 'exited with a non-error code') - t.notOk(stderr, 'no error output') + common.npm(['install'], { cwd: pkg }, function (err, code, stdout, stderr) { + t.ifError(err, 'npm install ran without issue') + t.is(code, 0, 'exited with a non-error code') + t.is(stderr, '', 'no error output') - common.npm(['install', './pkg-with-bundled'], { cwd: dir }, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm install ran without issue') - t.ok(code, 'exited with a error code') - t.ok(stderr.indexOf('be an array') > -1, 'nice error output') - } - ) - }) - } - ) + common.npm(['install', './pkg-with-bundled'], { cwd: dir }, + function (err, code, stdout, stderr) { + t.ifError(err, 'npm install ran without issue') + t.notEqual(code, 0, 'exited with a error code') + t.like(stderr, /be an array/, 'nice error output') + } + ) + }) }) test('cleanup', function (t) { @@ -62,7 +55,9 @@ test('cleanup', function (t) { }) function bootstrap () { + cleanup() mkdirp.sync(dir) + mkdirp.sync(path.join(dir, 'node_modules')) mkdirp.sync(pkg) fs.writeFileSync(path.resolve(pkg, 'package.json'), pj) @@ -72,6 +67,5 @@ function bootstrap () { } function cleanup () { - process.chdir(osenv.tmpdir()) rimraf.sync(dir) } diff --git a/deps/npm/test/tap/cache-add-localdir-fallback.js b/deps/npm/test/tap/cache-add-localdir-fallback.js index facd95c3ad483b..2845d11ec06c43 100644 --- a/deps/npm/test/tap/cache-add-localdir-fallback.js +++ b/deps/npm/test/tap/cache-add-localdir-fallback.js @@ -1,84 +1,84 @@ -var path = require("path") -var test = require("tap").test -var npm = require("../../lib/npm.js") -var requireInject = require("require-inject") +var path = require('path') +var test = require('tap').test +var npm = require('../../lib/npm.js') +var requireInject = require('require-inject') -var realizePackageSpecifier = requireInject("realize-package-specifier", { - "fs": { +var realizePackageSpecifier = requireInject('realize-package-specifier', { + 'fs': { stat: function (file, cb) { process.nextTick(function () { switch (file) { - case path.resolve("named"): - cb(new Error("ENOENT")) - break - case path.resolve("file.tgz"): - cb(null, { isDirectory: function () { return false } }) - break - case path.resolve("dir-no-package"): - cb(null, { isDirectory: function () { return true } }) - break - case path.resolve("dir-no-package/package.json"): - cb(new Error("ENOENT")) - break - case path.resolve("dir-with-package"): - cb(null, { isDirectory: function () { return true } }) - break - case path.resolve("dir-with-package/package.json"): - cb(null, {}) - break - case path.resolve(__dirname, "dir-with-package"): - cb(null, { isDirectory: function () { return true } }) - break - case path.join(__dirname, "dir-with-package", "package.json"): - cb(null, {}) - break - case path.resolve(__dirname, "file.tgz"): - cb(null, { isDirectory: function () { return false } }) - break - default: - throw new Error("Unknown test file passed to stat: " + file) + case path.resolve('named'): + cb(new Error('ENOENT')) + break + case path.resolve('file.tgz'): + cb(null, { isDirectory: function () { return false } }) + break + case path.resolve('dir-no-package'): + cb(null, { isDirectory: function () { return true } }) + break + case path.resolve('dir-no-package/package.json'): + cb(new Error('ENOENT')) + break + case path.resolve('dir-with-package'): + cb(null, { isDirectory: function () { return true } }) + break + case path.resolve('dir-with-package/package.json'): + cb(null, {}) + break + case path.resolve(__dirname, 'dir-with-package'): + cb(null, { isDirectory: function () { return true } }) + break + case path.join(__dirname, 'dir-with-package', 'package.json'): + cb(null, {}) + break + case path.resolve(__dirname, 'file.tgz'): + cb(null, { isDirectory: function () { return false } }) + break + default: + throw new Error('Unknown test file passed to stat: ' + file) } }) } } }) -npm.load({loglevel : "silent"}, function () { - var cache = requireInject("../../lib/cache.js", { - "realize-package-specifier": realizePackageSpecifier, - "../../lib/cache/add-named.js": function addNamed (name, version, data, cb) { - cb(null, "addNamed") +npm.load({ loglevel: 'silent' }, function () { + var cache = requireInject('../../lib/cache.js', { + 'realize-package-specifier': realizePackageSpecifier, + '../../lib/cache/add-named.js': function addNamed (name, version, data, cb) { + cb(null, 'addNamed') }, - "../../lib/cache/add-local.js": function addLocal (name, data, cb) { - cb(null, "addLocal") + '../../lib/cache/add-local.js': function addLocal (name, data, cb) { + cb(null, 'addLocal') } }) - test("npm install localdir fallback", function (t) { + test('npm install localdir fallback', function (t) { t.plan(12) - cache.add("named", null, null, false, function (er, which) { - t.ifError(er, "named was cached") - t.is(which, "addNamed", "registry package name") + cache.add('named', null, null, false, function (er, which) { + t.ifError(er, 'named was cached') + t.is(which, 'addNamed', 'registry package name') }) - cache.add("file.tgz", null, null, false, function (er, which) { - t.ifError(er, "file.tgz was cached") - t.is(which, "addLocal", "local file") + cache.add('file.tgz', null, null, false, function (er, which) { + t.ifError(er, 'file.tgz was cached') + t.is(which, 'addLocal', 'local file') }) - cache.add("dir-no-package", null, null, false, function (er, which) { - t.ifError(er, "local directory was cached") - t.is(which, "addNamed", "local directory w/o package.json") + cache.add('dir-no-package', null, null, false, function (er, which) { + t.ifError(er, 'local directory was cached') + t.is(which, 'addNamed', 'local directory w/o package.json') }) - cache.add("dir-with-package", null, null, false, function (er, which) { - t.ifError(er, "local directory with package was cached") - t.is(which,"addLocal", "local directory with package.json") + cache.add('dir-with-package', null, null, false, function (er, which) { + t.ifError(er, 'local directory with package was cached') + t.is(which, 'addLocal', 'local directory with package.json') }) - cache.add("file:./dir-with-package", null, __dirname, false, function (er, which) { - t.ifError(er, "local directory (as URI) with package was cached") - t.is(which, "addLocal", "file: URI to local directory with package.json") + cache.add('file:./dir-with-package', null, __dirname, false, function (er, which) { + t.ifError(er, 'local directory (as URI) with package was cached') + t.is(which, 'addLocal', 'file: URI to local directory with package.json') }) - cache.add("file:./file.tgz", null, __dirname, false, function (er, which) { - t.ifError(er, "local file (as URI) with package was cached") - t.is(which, "addLocal", "file: URI to local file with package.json") + cache.add('file:./file.tgz', null, __dirname, false, function (er, which) { + t.ifError(er, 'local file (as URI) with package was cached') + t.is(which, 'addLocal', 'file: URI to local file with package.json') }) }) }) diff --git a/deps/npm/test/tap/cache-add-unpublished.js b/deps/npm/test/tap/cache-add-unpublished.js index fe26929fce23ff..0d39ad815a2bb5 100644 --- a/deps/npm/test/tap/cache-add-unpublished.js +++ b/deps/npm/test/tap/cache-add-unpublished.js @@ -1,32 +1,35 @@ -var common = require("../common-tap.js") -var test = require("tap").test -var mr = require("npm-registry-mock") +var common = require('../common-tap.js') +var test = require('tap').test -test("cache add", function (t) { +test('cache add', function (t) { setup(function (er, s) { if (er) { throw er } - common.npm([ - "cache", - "add", - "superfoo", - "--registry=http://localhost:1337/" - ], {}, function (er, c, so, se) { - if (er) throw er - t.ok(c, "got non-zero exit code") - t.equal(so, "", "nothing printed to stdout") - t.similar(se, /404 Not Found: superfoo/, "got expected error") - s.close() - t.end() - }) + common.npm( + [ + 'cache', + 'add', + 'superfoo', + '--registry=http://localhost:1337/' + ], + {}, + function (er, c, so, se) { + if (er) throw er + t.ok(c, 'got non-zero exit code') + t.equal(so, '', 'nothing printed to stdout') + t.similar(se, /404 Not Found: superfoo/, 'got expected error') + s.close() + t.end() + } + ) }) }) function setup (cb) { - var s = require("http").createServer(function (req, res) { + var s = require('http').createServer(function (req, res) { res.statusCode = 404 - res.end("{\"error\":\"not_found\"}\n") + res.end('{\"error\":\"not_found\"}\n') }) s.listen(1337, function () { cb(null, s) diff --git a/deps/npm/test/tap/cache-shasum-fork.js b/deps/npm/test/tap/cache-shasum-fork.js index f16404cb213392..01c2f68fb7df83 100644 --- a/deps/npm/test/tap/cache-shasum-fork.js +++ b/deps/npm/test/tap/cache-shasum-fork.js @@ -18,6 +18,9 @@ var pkg = path.resolve(__dirname, 'cache-shasum-fork') var cache = path.join(pkg, 'cache') var server +var installed_output = path.join(__dirname, 'cache-shasum-fork') + + '\n`-- underscore@1.5.1 \n\n' + test('setup', function (t) { setup() t.comment('test for https://github.com/npm/npm/issues/3265') @@ -44,7 +47,7 @@ test('npm cache - install from fork', function (t) { t.notOk(stderr, 'Should not get data on stderr: ' + stderr) t.equal(code, 0, 'install finished successfully') - t.equal(stdout, 'underscore@1.5.1 node_modules/underscore\n') + t.equal(stdout, installed_output) var index = fs.readFileSync( path.join(pkg, 'node_modules', 'underscore', 'index.js'), 'utf8' @@ -72,7 +75,7 @@ test('npm cache - install from origin', function (t) { t.ifErr(err, 'install finished without error') t.equal(code, 0, 'install finished successfully') t.notOk(stderr, 'Should not get data on stderr: ' + stderr) - t.equal(stdout, 'underscore@1.5.1 node_modules/underscore\n') + t.equal(stdout, installed_output) var index = fs.readFileSync( path.join(pkg, 'node_modules', 'underscore', 'index.js'), 'utf8' diff --git a/deps/npm/test/tap/cache-shasum.js b/deps/npm/test/tap/cache-shasum.js index f86037cc80cd4b..90915ed850a7c3 100644 --- a/deps/npm/test/tap/cache-shasum.js +++ b/deps/npm/test/tap/cache-shasum.js @@ -1,58 +1,57 @@ -var npm = require.resolve("../../") -var test = require("tap").test -var path = require("path") -var rimraf = require("rimraf") -var mkdirp = require("mkdirp") -var mr = require("npm-registry-mock") -var common = require("../common-tap.js") -var cache = path.resolve(__dirname, "cache-shasum") -var spawn = require("child_process").spawn -var sha = require("sha") +var npm = require.resolve('../../') +var test = require('tap').test +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var common = require('../common-tap.js') +var cache = path.resolve(__dirname, 'cache-shasum') +var spawn = require('child_process').spawn +var sha = require('sha') var server -test("mock reg", function (t) { +test('mock reg', function (t) { rimraf.sync(cache) mkdirp.sync(cache) - mr({port : common.port}, function (er, s) { + mr({ port: common.port }, function (er, s) { server = s - t.pass("ok") + t.pass('ok') t.end() }) }) -test("npm cache add request", function (t) { +test('npm cache add request', function (t) { var c = spawn(process.execPath, [ - npm, "cache", "add", "request@2.27.0", - "--cache=" + cache, - "--registry=" + common.registry, - "--loglevel=quiet" + npm, 'cache', 'add', 'request@2.27.0', + '--cache=' + cache, + '--registry=' + common.registry, + '--loglevel=quiet' ]) c.stderr.pipe(process.stderr) - c.stdout.on("data", function (d) { - t.fail("Should not get data on stdout: " + d) + c.stdout.on('data', function (d) { + t.fail('Should not get data on stdout: ' + d) }) - c.on("close", function (code) { - t.notOk(code, "exit ok") + c.on('close', function (code) { + t.notOk(code, 'exit ok') t.end() }) }) -test("compare", function (t) { - var d = path.resolve(__dirname, "cache-shasum/request") - var p = path.resolve(d, "2.27.0/package.tgz") - var r = require("./cache-shasum/localhost_1337/request/.cache.json") - var rshasum = r.versions["2.27.0"].dist.shasum +test('compare', function (t) { + var d = path.resolve(__dirname, 'cache-shasum/request') + var p = path.resolve(d, '2.27.0/package.tgz') + var r = require('./cache-shasum/localhost_1337/request/.cache.json') + var rshasum = r.versions['2.27.0'].dist.shasum sha.get(p, function (er, pshasum) { - if (er) - throw er + if (er) throw er t.equal(pshasum, rshasum) t.end() }) }) -test("cleanup", function (t) { +test('cleanup', function (t) { server.close() rimraf.sync(cache) t.end() diff --git a/deps/npm/test/tap/check-cpu-reqs.js b/deps/npm/test/tap/check-cpu-reqs.js new file mode 100644 index 00000000000000..4d8c3dc6551c4b --- /dev/null +++ b/deps/npm/test/tap/check-cpu-reqs.js @@ -0,0 +1,63 @@ +'use strict' +var path = require('path') +var fs = require('fs') +var test = require('tap').test +var osenv = require('osenv') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var common = require('../common-tap.js') + +var base = path.join(__dirname, path.basename(__filename, '.js')) +var installFrom = path.join(base, 'from') +var installIn = path.join(base, 'in') + +var json = { + name: 'check-cpu-reqs', + version: '0.0.1', + description: 'fixture', + cpu: ['fake-cpu'] +} + +test('setup', function (t) { + setup() + t.end() +}) + +var INSTALL_OPTS = ['--loglevel', 'silly'] +var EXEC_OPTS = {cwd: installIn} + +test('install bad cpu', function (t) { + common.npm(['install', installFrom].concat(INSTALL_OPTS), EXEC_OPTS, function (err, code) { + t.ifError(err, 'npm ran without issue') + t.is(code, 1, 'npm install refused to install a package in itself') + t.end() + }) +}) +test('force install bad cpu', function (t) { + common.npm(['install', '--force', installFrom].concat(INSTALL_OPTS), EXEC_OPTS, function (err, code) { + t.ifError(err, 'npm ran without issue') + t.is(code, 0, 'npm install happily installed a package in itself with --force') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(base) +} + +function setup () { + cleanup() + mkdirp.sync(path.resolve(installFrom, 'node_modules')) + fs.writeFileSync( + path.join(installFrom, 'package.json'), + JSON.stringify(json, null, 2) + ) + mkdirp.sync(path.resolve(installIn, 'node_modules')) + process.chdir(base) +} diff --git a/deps/npm/test/tap/check-engine-reqs.js b/deps/npm/test/tap/check-engine-reqs.js new file mode 100644 index 00000000000000..8dd9b8231fb5ed --- /dev/null +++ b/deps/npm/test/tap/check-engine-reqs.js @@ -0,0 +1,65 @@ +'use strict' +var path = require('path') +var fs = require('fs') +var test = require('tap').test +var osenv = require('osenv') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var common = require('../common-tap.js') + +var base = path.join(__dirname, path.basename(__filename, '.js')) +var installFrom = path.join(base, 'from') +var installIn = path.join(base, 'in') + +var json = { + name: 'check-engine-reqs', + version: '0.0.1', + description: 'fixture', + engines: { + node: '1.0.0-not-a-real-version' + } +} + +test('setup', function (t) { + setup() + t.end() +}) + +var INSTALL_OPTS = ['--loglevel', 'silly'] +var EXEC_OPTS = {cwd: installIn} + +test('install bad engine', function (t) { + common.npm(['install', '--engine-strict', installFrom].concat(INSTALL_OPTS), EXEC_OPTS, function (err, code) { + t.ifError(err, 'npm ran without issue') + t.is(code, 1, 'npm install refused to install a package in itself') + t.end() + }) +}) +test('force install bad engine', function (t) { + common.npm(['install', '--engine-strict', '--force', installFrom].concat(INSTALL_OPTS), EXEC_OPTS, function (err, code) { + t.ifError(err, 'npm ran without issue') + t.is(code, 0, 'npm install happily installed a package in itself with --force') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(base) +} + +function setup () { + cleanup() + mkdirp.sync(path.resolve(installFrom, 'node_modules')) + fs.writeFileSync( + path.join(installFrom, 'package.json'), + JSON.stringify(json, null, 2) + ) + mkdirp.sync(path.resolve(installIn, 'node_modules')) + process.chdir(base) +} diff --git a/deps/npm/test/tap/check-install-self.js b/deps/npm/test/tap/check-install-self.js new file mode 100644 index 00000000000000..821d8eb4d4994c --- /dev/null +++ b/deps/npm/test/tap/check-install-self.js @@ -0,0 +1,66 @@ +'use strict' +var path = require('path') +var fs = require('fs') +var test = require('tap').test +var osenv = require('osenv') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var common = require('../common-tap.js') + +var base = path.join(__dirname, path.basename(__filename, '.js')) +var installFrom = path.join(base, 'from') +var installIn = path.join(base, 'in') + +var json = { + name: 'check-install-self', + version: '0.0.1', + description: 'fixture' +} + +test('setup', function (t) { + setup() + t.end() +}) + +var INSTALL_OPTS = ['--loglevel', 'silent'] +var EXEC_OPTS = {cwd: installIn} + +test('install self', function (t) { + common.npm(['install', installFrom].concat(INSTALL_OPTS), EXEC_OPTS, function (err, code) { + t.ifError(err, 'npm ran without issue') + t.is(code, 1, 'npm install refused to install a package in itself') + t.end() + }) +}) +test('force install self', function (t) { + common.npm(['install', '--force', installFrom].concat(INSTALL_OPTS), EXEC_OPTS, function (err, code) { + t.ifError(err, 'npm ran without issue') + t.is(code, 0, 'npm install happily installed a package in itself with --force') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(base) +} + +function setup () { + cleanup() + mkdirp.sync(path.resolve(installFrom, 'node_modules')) + fs.writeFileSync( + path.join(installFrom, 'package.json'), + JSON.stringify(json, null, 2) + ) + mkdirp.sync(path.resolve(installIn, 'node_modules')) + fs.writeFileSync( + path.join(installIn, 'package.json'), + JSON.stringify(json, null, 2) + ) + process.chdir(base) +} diff --git a/deps/npm/test/tap/check-os-reqs.js b/deps/npm/test/tap/check-os-reqs.js new file mode 100644 index 00000000000000..5d0c1ecf78b07c --- /dev/null +++ b/deps/npm/test/tap/check-os-reqs.js @@ -0,0 +1,63 @@ +'use strict' +var path = require('path') +var fs = require('fs') +var test = require('tap').test +var osenv = require('osenv') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var common = require('../common-tap.js') + +var base = path.join(__dirname, path.basename(__filename, '.js')) +var installFrom = path.join(base, 'from') +var installIn = path.join(base, 'in') + +var json = { + name: 'check-os-reqs', + version: '0.0.1', + description: 'fixture', + os: ['fake-os'] +} + +test('setup', function (t) { + setup() + t.end() +}) + +var INSTALL_OPTS = ['--loglevel', 'silly'] +var EXEC_OPTS = {cwd: installIn} + +test('install bad os', function (t) { + common.npm(['install', installFrom].concat(INSTALL_OPTS), EXEC_OPTS, function (err, code) { + t.ifError(err, 'npm ran without issue') + t.is(code, 1, 'npm install refused to install a package in itself') + t.end() + }) +}) +test('force install bad os', function (t) { + common.npm(['install', '--force', installFrom].concat(INSTALL_OPTS), EXEC_OPTS, function (err, code) { + t.ifError(err, 'npm ran without issue') + t.is(code, 0, 'npm install happily installed a package in itself with --force') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(base) +} + +function setup () { + cleanup() + mkdirp.sync(path.resolve(installFrom, 'node_modules')) + fs.writeFileSync( + path.join(installFrom, 'package.json'), + JSON.stringify(json, null, 2) + ) + mkdirp.sync(path.resolve(installIn, 'node_modules')) + process.chdir(base) +} diff --git a/deps/npm/test/tap/check-permissions.js b/deps/npm/test/tap/check-permissions.js new file mode 100644 index 00000000000000..d3c0c6da25032f --- /dev/null +++ b/deps/npm/test/tap/check-permissions.js @@ -0,0 +1,88 @@ +'use strict' +var fs = require('fs') +var path = require('path') +var test = require('tap').test +var rimraf = require('rimraf') +var writable = require('../../lib/install/writable.js').fsAccessImplementation +var writableFallback = require('../../lib/install/writable.js').fsOpenImplementation +var exists = require('../../lib/install/exists.js').fsAccessImplementation +var existsFallback = require('../../lib/install/exists.js').fsStatImplementation + +var testBase = path.resolve(__dirname, 'check-permissions') +var existingDir = path.resolve(testBase, 'exists') +var nonExistingDir = path.resolve(testBase, 'does-not-exist') +var writableDir = path.resolve(testBase, 'writable') +var nonWritableDir = path.resolve(testBase, 'non-writable') + +test('setup', function (t) { + cleanup() + setup() + t.end() +}) + +test('exists', function (t) { + t.plan(2) + // fs.access first introduced in node 0.12 / io.js + if (fs.access) { + existsTests(t, exists) + } else { + t.pass('# skip fs.access not available in this version') + t.pass('# skip fs.access not available in this version') + } +}) + +test('exists-fallback', function (t) { + t.plan(2) + existsTests(t, existsFallback) +}) + +test('writable', function (t) { + t.plan(2) + // fs.access first introduced in node 0.12 / io.js + if (fs.access) { + writableTests(t, writable) + } else { + t.pass('# skip fs.access not available in this version') + t.pass('# skip fs.access not available in this version') + } +}) + +test('writable-fallback', function (t) { + t.plan(2) + writableTests(t, writableFallback) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup () { + fs.mkdirSync(testBase) + fs.mkdirSync(existingDir) + fs.mkdirSync(writableDir) + fs.mkdirSync(nonWritableDir) + fs.chmodSync(nonWritableDir, '555') +} + +function existsTests (t, exists) { + exists(existingDir, function (er) { + t.error(er, 'exists dir is exists') + }) + exists(nonExistingDir, function (er) { + t.ok(er, 'non-existing dir resulted in an error') + }) +} + +function writableTests (t, writable) { + writable(writableDir, function (er) { + t.error(er, 'writable dir is writable') + }) + writable(nonWritableDir, function (er) { + t.ok(er, 'non-writable dir resulted in an error') + }) +} + +function cleanup () { + rimraf.sync(testBase) +} diff --git a/deps/npm/test/tap/circular-dep.js b/deps/npm/test/tap/circular-dep.js index 002b30cd7856d3..d7f66eacef1ac9 100644 --- a/deps/npm/test/tap/circular-dep.js +++ b/deps/npm/test/tap/circular-dep.js @@ -61,7 +61,10 @@ test('installing a package that depends on the current package', function (t) { t.ok(existsSync(path.resolve( minimist, - 'node_modules', 'optimist', + 'node_modules', 'optimist' + )), 'optimist in place') + t.ok(existsSync(path.resolve( + minimist, 'node_modules', 'minimist' )), 'circular dependency uncircled') t.end() diff --git a/deps/npm/test/tap/config-basic.js b/deps/npm/test/tap/config-basic.js index d5a950a8e5a00a..ff3318147028f5 100644 --- a/deps/npm/test/tap/config-basic.js +++ b/deps/npm/test/tap/config-basic.js @@ -1,66 +1,69 @@ -var test = require("tap").test -var npmconf = require("../../lib/config/core.js") -var common = require("./00-config-setup.js") -var path = require("path") +var test = require('tap').test +var npmconf = require('../../lib/config/core.js') +var common = require('./00-config-setup.js') +var path = require('path') var projectData = { - "save-prefix": "~", - "proprietary-attribs": false + 'save-prefix': '~', + 'proprietary-attribs': false, + 'legacy-bundling': true } var ucData = common.ucData var envData = common.envData var envDataFix = common.envDataFix -var gcData = { "package-config:foo": "boo" } +var gcData = { 'package-config:foo': 'boo' } var biData = {} -var cli = { foo: "bar", umask: 022 } +var cli = { foo: 'bar', umask: parseInt('022', 8) } -var expectList = -[ cli, +var expectList = [ + cli, envDataFix, projectData, ucData, gcData, - biData ] + biData +] var expectSources = { cli: { data: cli }, env: { data: envDataFix, source: envData, - prefix: "" + prefix: '' }, project: { - path: path.resolve(__dirname, "..", "..", ".npmrc"), - type: "ini", + path: path.resolve(__dirname, '..', '..', '.npmrc'), + type: 'ini', data: projectData }, user: { path: common.userconfig, - type: "ini", + type: 'ini', data: ucData }, global: { path: common.globalconfig, - type: "ini", + type: 'ini', data: gcData }, builtin: { data: biData } } -test("no builtin", function (t) { +test('no builtin', function (t) { + t.comment(process.env) npmconf.load(cli, function (er, conf) { if (er) throw er - t.same(conf.list, expectList) - t.same(conf.sources, expectSources) - t.same(npmconf.rootConf.list, []) - t.equal(npmconf.rootConf.root, npmconf.defs.defaults) - t.equal(conf.root, npmconf.defs.defaults) - t.equal(conf.get("umask"), 022) - t.equal(conf.get("heading"), "npm") + t.same(conf.list, expectList, 'config properties in list format match expected') + t.same(conf.sources, expectSources, 'config by source matches expected') + t.same(npmconf.rootConf.list, [], 'root configuration is empty') + t.equal(npmconf.rootConf.root, npmconf.defs.defaults, 'defaults match up') + t.equal(conf.root, npmconf.defs.defaults, 'current root config matches defaults') + t.equal(conf.get('umask'), parseInt('022', 8), 'umask is as expected') + t.equal(conf.get('heading'), 'npm', 'config name is as expected') t.end() }) }) diff --git a/deps/npm/test/tap/config-builtin.js b/deps/npm/test/tap/config-builtin.js index 5a1589ff6a224b..cb1e4eb20fbab0 100644 --- a/deps/npm/test/tap/config-builtin.js +++ b/deps/npm/test/tap/config-builtin.js @@ -1,22 +1,23 @@ -var test = require("tap").test -var npmconf = require("../../lib/config/core.js") -var common = require("./00-config-setup.js") -var path = require("path") +var test = require('tap').test +var npmconf = require('../../lib/config/core.js') +var common = require('./00-config-setup.js') +var path = require('path') var ucData = common.ucData var envData = common.envData var envDataFix = common.envDataFix -var gcData = { "package-config:foo": "boo" } +var gcData = { 'package-config:foo': 'boo' } -var biData = { "builtin-config": true } +var biData = { 'builtin-config': true } -var cli = { foo: "bar", heading: "foo", "git-tag-version": false } +var cli = { foo: 'bar', heading: 'foo', 'git-tag-version': false } var projectData = { - "save-prefix": "~", - "proprietary-attribs": false + 'save-prefix': '~', + 'proprietary-attribs': false, + 'legacy-bundling': true } var expectList = [ @@ -33,27 +34,27 @@ var expectSources = { env: { data: envDataFix, source: envData, - prefix: "" + prefix: '' }, project: { - path: path.resolve(__dirname, "..", "..", ".npmrc"), - type: "ini", + path: path.resolve(__dirname, '..', '..', '.npmrc'), + type: 'ini', data: projectData }, user: { path: common.userconfig, - type: "ini", + type: 'ini', data: ucData }, global: { path: common.globalconfig, - type: "ini", + type: 'ini', data: gcData }, builtin: { data: biData } } -test("with builtin", function (t) { +test('with builtin', function (t) { npmconf.load(cli, common.builtin, function (er, conf) { if (er) throw er t.same(conf.list, expectList) @@ -61,8 +62,8 @@ test("with builtin", function (t) { t.same(npmconf.rootConf.list, []) t.equal(npmconf.rootConf.root, npmconf.defs.defaults) t.equal(conf.root, npmconf.defs.defaults) - t.equal(conf.get("heading"), "foo") - t.equal(conf.get("git-tag-version"), false) + t.equal(conf.get('heading'), 'foo') + t.equal(conf.get('git-tag-version'), false) t.end() }) }) diff --git a/deps/npm/test/tap/config-certfile.js b/deps/npm/test/tap/config-certfile.js index 25de9963a9fc96..223ff34196f5eb 100644 --- a/deps/npm/test/tap/config-certfile.js +++ b/deps/npm/test/tap/config-certfile.js @@ -1,18 +1,18 @@ -require("./00-config-setup.js") +require('./00-config-setup.js') -var path = require("path") -var fs = require("fs") -var test = require("tap").test -var npmconf = require("../../lib/config/core.js") +var path = require('path') +var fs = require('fs') +var test = require('tap').test +var npmconf = require('../../lib/config/core.js') -test("cafile loads as ca", function (t) { - var cafile = path.join(__dirname, "..", "fixtures", "config", "multi-ca") +test('cafile loads as ca', function (t) { + var cafile = path.join(__dirname, '..', 'fixtures', 'config', 'multi-ca') npmconf.load({cafile: cafile}, function (er, conf) { if (er) throw er - t.same(conf.get("cafile"), cafile) - t.same(conf.get("ca").join("\n"), fs.readFileSync(cafile, "utf8").trim()) + t.same(conf.get('cafile'), cafile) + t.same(conf.get('ca').join('\n'), fs.readFileSync(cafile, 'utf8').trim()) t.end() }) }) diff --git a/deps/npm/test/tap/config-credentials.js b/deps/npm/test/tap/config-credentials.js index 1cb2a7eb410c59..f6f00ee0e65183 100644 --- a/deps/npm/test/tap/config-credentials.js +++ b/deps/npm/test/tap/config-credentials.js @@ -1,350 +1,350 @@ -var test = require("tap").test +var test = require('tap').test -var npmconf = require("../../lib/config/core.js") -var common = require("./00-config-setup.js") +var npmconf = require('../../lib/config/core.js') +var common = require('./00-config-setup.js') -var URI = "https://registry.lvh.me:8661/" +var URI = 'https://registry.lvh.me:8661/' -test("getting scope with no credentials set", function (t) { +test('getting scope with no credentials set', function (t) { npmconf.load({}, function (er, conf) { - t.ifError(er, "configuration loaded") + t.ifError(er, 'configuration loaded') var basic = conf.getCredentialsByURI(URI) - t.equal(basic.scope, "//registry.lvh.me:8661/", "nerfed URL extracted") + t.equal(basic.scope, '//registry.lvh.me:8661/', 'nerfed URL extracted') t.end() }) }) -test("trying to set credentials with no URI", function (t) { +test('trying to set credentials with no URI', function (t) { npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, "configuration loaded") + t.ifError(er, 'configuration loaded') t.throws(function () { conf.setCredentialsByURI() - }, "enforced missing URI") + }, 'enforced missing URI') t.end() }) }) -test("trying to clear credentials with no URI", function (t) { +test('trying to clear credentials with no URI', function (t) { npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, "configuration loaded") + t.ifError(er, 'configuration loaded') t.throws(function () { conf.clearCredentialsByURI() - }, "enforced missing URI") + }, 'enforced missing URI') t.end() }) }) -test("set with missing credentials object", function (t) { +test('set with missing credentials object', function (t) { npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, "configuration loaded") + t.ifError(er, 'configuration loaded') t.throws(function () { conf.setCredentialsByURI(URI) - }, "enforced missing credentials") + }, 'enforced missing credentials') t.end() }) }) -test("set with empty credentials object", function (t) { +test('set with empty credentials object', function (t) { npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, "configuration loaded") + t.ifError(er, 'configuration loaded') t.throws(function () { conf.setCredentialsByURI(URI, {}) - }, "enforced missing credentials") + }, 'enforced missing credentials') t.end() }) }) -test("set with token", function (t) { +test('set with token', function (t) { npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, "configuration loaded") + t.ifError(er, 'configuration loaded') t.doesNotThrow(function () { - conf.setCredentialsByURI(URI, {token : "simple-token"}) - }, "needs only token") + conf.setCredentialsByURI(URI, { token: 'simple-token' }) + }, 'needs only token') var expected = { - scope : "//registry.lvh.me:8661/", - token : "simple-token", - username : undefined, - password : undefined, - email : undefined, - auth : undefined, - alwaysAuth : undefined + scope: '//registry.lvh.me:8661/', + token: 'simple-token', + username: undefined, + password: undefined, + email: undefined, + auth: undefined, + alwaysAuth: false } - t.same(conf.getCredentialsByURI(URI), expected, "got bearer token and scope") + t.same(conf.getCredentialsByURI(URI), expected, 'got bearer token and scope') t.end() }) }) -test("clear with token", function (t) { +test('clear with token', function (t) { npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, "configuration loaded") + t.ifError(er, 'configuration loaded') t.doesNotThrow(function () { - conf.setCredentialsByURI(URI, {token : "simple-token"}) - }, "needs only token") + conf.setCredentialsByURI(URI, { token: 'simple-token' }) + }, 'needs only token') t.doesNotThrow(function () { conf.clearCredentialsByURI(URI) - }, "needs only URI") + }, 'needs only URI') - t.notOk(conf.getCredentialsByURI(URI).token, "token all gone") + t.notOk(conf.getCredentialsByURI(URI).token, 'token all gone') t.end() }) }) -test("set with missing username", function (t) { +test('set with missing username', function (t) { npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, "configuration loaded") + t.ifError(er, 'configuration loaded') var credentials = { - password : "password", - email : "ogd@aoaioxxysz.net" + password: 'password', + email: 'ogd@aoaioxxysz.net' } t.throws(function () { conf.setCredentialsByURI(URI, credentials) - }, "enforced missing email") + }, 'enforced missing email') t.end() }) }) -test("set with missing password", function (t) { +test('set with missing password', function (t) { npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, "configuration loaded") + t.ifError(er, 'configuration loaded') var credentials = { - username : "username", - email : "ogd@aoaioxxysz.net" + username: 'username', + email: 'ogd@aoaioxxysz.net' } t.throws(function () { conf.setCredentialsByURI(URI, credentials) - }, "enforced missing email") + }, 'enforced missing email') t.end() }) }) -test("set with missing email", function (t) { +test('set with missing email', function (t) { npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, "configuration loaded") + t.ifError(er, 'configuration loaded') var credentials = { - username : "username", - password : "password" + username: 'username', + password: 'password' } t.throws(function () { conf.setCredentialsByURI(URI, credentials) - }, "enforced missing email") + }, 'enforced missing email') t.end() }) }) -test("set with old-style credentials", function (t) { +test('set with old-style credentials', function (t) { npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, "configuration loaded") + t.ifError(er, 'configuration loaded') var credentials = { - username : "username", - password : "password", - email : "ogd@aoaioxxysz.net" + username: 'username', + password: 'password', + email: 'ogd@aoaioxxysz.net' } t.doesNotThrow(function () { conf.setCredentialsByURI(URI, credentials) - }, "requires all of username, password, and email") + }, 'requires all of username, password, and email') var expected = { - scope : "//registry.lvh.me:8661/", - token : undefined, - username : "username", - password : "password", - email : "ogd@aoaioxxysz.net", - auth : "dXNlcm5hbWU6cGFzc3dvcmQ=", - alwaysAuth : false + scope: '//registry.lvh.me:8661/', + token: undefined, + username: 'username', + password: 'password', + email: 'ogd@aoaioxxysz.net', + auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', + alwaysAuth: false } - t.same(conf.getCredentialsByURI(URI), expected, "got credentials") + t.same(conf.getCredentialsByURI(URI), expected, 'got credentials') t.end() }) }) -test("clear with old-style credentials", function (t) { +test('clear with old-style credentials', function (t) { npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, "configuration loaded") + t.ifError(er, 'configuration loaded') var credentials = { - username : "username", - password : "password", - email : "ogd@aoaioxxysz.net" + username: 'username', + password: 'password', + email: 'ogd@aoaioxxysz.net' } t.doesNotThrow(function () { conf.setCredentialsByURI(URI, credentials) - }, "requires all of username, password, and email") + }, 'requires all of username, password, and email') t.doesNotThrow(function () { conf.clearCredentialsByURI(URI) - }, "clearing only required URI") + }, 'clearing only required URI') - t.notOk(conf.getCredentialsByURI(URI).username, "username cleared") - t.notOk(conf.getCredentialsByURI(URI).password, "password cleared") + t.notOk(conf.getCredentialsByURI(URI).username, 'username cleared') + t.notOk(conf.getCredentialsByURI(URI).password, 'password cleared') t.end() }) }) -test("get old-style credentials for default registry", function (t) { +test('get old-style credentials for default registry', function (t) { npmconf.load(common.builtin, function (er, conf) { - var actual = conf.getCredentialsByURI(conf.get("registry")) + var actual = conf.getCredentialsByURI(conf.get('registry')) var expected = { - scope : "//registry.npmjs.org/", - token : undefined, - password : "password", - username : "username", - email : "i@izs.me", - auth : "dXNlcm5hbWU6cGFzc3dvcmQ=", - alwaysAuth : false + scope: '//registry.npmjs.org/', + token: undefined, + password: 'password', + username: 'username', + email: 'i@izs.me', + auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', + alwaysAuth: false } t.same(actual, expected) t.end() }) }) -test("set with always-auth enabled", function (t) { +test('set with always-auth enabled', function (t) { npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, "configuration loaded") + t.ifError(er, 'configuration loaded') var credentials = { - username : "username", - password : "password", - email : "ogd@aoaioxxysz.net", - alwaysAuth : true + username: 'username', + password: 'password', + email: 'ogd@aoaioxxysz.net', + alwaysAuth: true } conf.setCredentialsByURI(URI, credentials) var expected = { - scope : "//registry.lvh.me:8661/", - token : undefined, - username : "username", - password : "password", - email : "ogd@aoaioxxysz.net", - auth : "dXNlcm5hbWU6cGFzc3dvcmQ=", - alwaysAuth : true + scope: '//registry.lvh.me:8661/', + token: undefined, + username: 'username', + password: 'password', + email: 'ogd@aoaioxxysz.net', + auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', + alwaysAuth: true } - t.same(conf.getCredentialsByURI(URI), expected, "got credentials") + t.same(conf.getCredentialsByURI(URI), expected, 'got credentials') t.end() }) }) -test("set with always-auth disabled", function (t) { +test('set with always-auth disabled', function (t) { npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, "configuration loaded") + t.ifError(er, 'configuration loaded') var credentials = { - username : "username", - password : "password", - email : "ogd@aoaioxxysz.net", - alwaysAuth : false + username: 'username', + password: 'password', + email: 'ogd@aoaioxxysz.net', + alwaysAuth: false } conf.setCredentialsByURI(URI, credentials) var expected = { - scope : "//registry.lvh.me:8661/", - token : undefined, - username : "username", - password : "password", - email : "ogd@aoaioxxysz.net", - auth : "dXNlcm5hbWU6cGFzc3dvcmQ=", - alwaysAuth : false + scope: '//registry.lvh.me:8661/', + token: undefined, + username: 'username', + password: 'password', + email: 'ogd@aoaioxxysz.net', + auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', + alwaysAuth: false } - t.same(conf.getCredentialsByURI(URI), expected, "got credentials") + t.same(conf.getCredentialsByURI(URI), expected, 'got credentials') t.end() }) }) -test("set with global always-auth enabled", function (t) { +test('set with global always-auth enabled', function (t) { npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, "configuration loaded") - var original = conf.get("always-auth") - conf.set("always-auth", true) + t.ifError(er, 'configuration loaded') + var original = conf.get('always-auth') + conf.set('always-auth', true) var credentials = { - username : "username", - password : "password", - email : "ogd@aoaioxxysz.net" + username: 'username', + password: 'password', + email: 'ogd@aoaioxxysz.net' } conf.setCredentialsByURI(URI, credentials) var expected = { - scope : "//registry.lvh.me:8661/", - token : undefined, - username : "username", - password : "password", - email : "ogd@aoaioxxysz.net", - auth : "dXNlcm5hbWU6cGFzc3dvcmQ=", - alwaysAuth : true + scope: '//registry.lvh.me:8661/', + token: undefined, + username: 'username', + password: 'password', + email: 'ogd@aoaioxxysz.net', + auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', + alwaysAuth: true } - t.same(conf.getCredentialsByURI(URI), expected, "got credentials") + t.same(conf.getCredentialsByURI(URI), expected, 'got credentials') - conf.set("always-auth", original) + conf.set('always-auth', original) t.end() }) }) -test("set with global always-auth disabled", function (t) { +test('set with global always-auth disabled', function (t) { npmconf.load(common.builtin, function (er, conf) { - t.ifError(er, "configuration loaded") - var original = conf.get("always-auth") - conf.set("always-auth", false) + t.ifError(er, 'configuration loaded') + var original = conf.get('always-auth') + conf.set('always-auth', false) var credentials = { - username : "username", - password : "password", - email : "ogd@aoaioxxysz.net" + username: 'username', + password: 'password', + email: 'ogd@aoaioxxysz.net' } conf.setCredentialsByURI(URI, credentials) var expected = { - scope : "//registry.lvh.me:8661/", - token : undefined, - username : "username", - password : "password", - email : "ogd@aoaioxxysz.net", - auth : "dXNlcm5hbWU6cGFzc3dvcmQ=", - alwaysAuth : false + scope: '//registry.lvh.me:8661/', + token: undefined, + username: 'username', + password: 'password', + email: 'ogd@aoaioxxysz.net', + auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', + alwaysAuth: false } - t.same(conf.getCredentialsByURI(URI), expected, "got credentials") + t.same(conf.getCredentialsByURI(URI), expected, 'got credentials') - conf.set("always-auth", original) + conf.set('always-auth', original) t.end() }) }) diff --git a/deps/npm/test/tap/config-edit.js b/deps/npm/test/tap/config-edit.js index 97a54d2ece58da..f9e09aba3a74a3 100644 --- a/deps/npm/test/tap/config-edit.js +++ b/deps/npm/test/tap/config-edit.js @@ -1,39 +1,39 @@ -var fs = require("fs") -var path = require("path") +var fs = require('fs') +var path = require('path') -var mkdirp = require("mkdirp") -var rimraf = require("rimraf") -var test = require("tap").test -var common = require("../common-tap.js") +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test +var common = require('../common-tap.js') -var pkg = path.resolve(__dirname, "npm-global-edit") +var pkg = path.resolve(__dirname, 'npm-global-edit') var editorSrc = function () {/* #!/usr/bin/env node -var fs = require("fs") +var fs = require('fs') if (fs.existsSync(process.argv[2])) { - console.log("success") + console.log('success') } else { - console.log("error") + console.log('error') process.exit(1) } -*/}.toString().split("\n").slice(1, -1).join("\n") -var editorPath = path.join(pkg, "editor") +*/}.toString().split('\n').slice(1, -1).join('\n') +var editorPath = path.join(pkg, 'editor') -test("setup", function (t) { +test('setup', function (t) { cleanup(function (er) { - t.ifError(er, "old directory removed") + t.ifError(er, 'old directory removed') - mkdirp(pkg, "0777", function (er) { + mkdirp(pkg, '0777', function (er) { fs.writeFileSync(editorPath, editorSrc) - fs.chmodSync(editorPath, "0777") - t.ifError(er, "created package directory correctly") + fs.chmodSync(editorPath, '0777') + t.ifError(er, 'created package directory correctly') t.end() }) }) }) -test("saving configs", function (t) { +test('saving configs', function (t) { var opts = { cwd: pkg, env: { @@ -43,26 +43,26 @@ test("saving configs", function (t) { } common.npm( [ - "config", - "--prefix", pkg, - "--global", - "edit" + 'config', + '--prefix', pkg, + '--global', + 'edit' ], opts, function (err, code, stdout, stderr) { - t.ifError(err, "command ran without issue") + t.ifError(err, 'command ran without issue') - t.equal(stderr, "", "got nothing on stderr") - t.equal(code, 0, "exit ok") - t.equal(stdout, "success\n", "got success message") + t.equal(stderr, '', 'got nothing on stderr') + t.equal(code, 0, 'exit ok') + t.equal(stdout, 'success\n', 'got success message') t.end() } ) }) -test("cleanup", function (t) { +test('cleanup', function (t) { cleanup(function (er) { - t.ifError(er, "test directory removed OK") + t.ifError(er, 'test directory removed OK') t.end() }) }) diff --git a/deps/npm/test/tap/config-list.js b/deps/npm/test/tap/config-list.js new file mode 100644 index 00000000000000..1c42b64c2e52ac --- /dev/null +++ b/deps/npm/test/tap/config-list.js @@ -0,0 +1,43 @@ +var fs = require('fs') +var path = require('path') +var test = require('tap').test +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'config-list') +var opts = { cwd: pkg } +var npmrc = path.resolve(pkg, '.npmrc') + +test('setup', function (t) { + rimraf.sync(pkg) + mkdirp.sync(pkg) + t.end() +}) + +test('config list includes project config', function (t) { + // Write per-project conf file + fs.writeFileSync(npmrc, 'foo=1234', 'utf8') + + // Create empty package.json to indicate project root + fs.writeFileSync(path.resolve(pkg, 'package.json'), '{}', 'utf8') + + common.npm( + ['config', 'list'], + opts, + function (err, code, stdout, stderr) { + t.ifError(err) + t.equal(stderr, '', 'stderr is empty') + var expected = '; project config ' + npmrc + '\nfoo = "1234"' + t.match(stdout, expected, 'contains project config') + t.end() + } + ) +}) + +// TODO: test cases for other configuration types (cli, env, user, global) + +test('clean', function (t) { + rimraf.sync(pkg) + t.end() +}) diff --git a/deps/npm/test/tap/config-malformed.js b/deps/npm/test/tap/config-malformed.js index 0450221462193f..4f74ea5387e59c 100644 --- a/deps/npm/test/tap/config-malformed.js +++ b/deps/npm/test/tap/config-malformed.js @@ -1,7 +1,7 @@ var test = require('tap').test -var npmconf = require("../../lib/config/core.js") -var common = require("./00-config-setup.js") +var npmconf = require('../../lib/config/core.js') +var common = require('./00-config-setup.js') test('with malformed', function (t) { npmconf.load({}, common.malformed, function (er, conf) { diff --git a/deps/npm/test/tap/config-meta.js b/deps/npm/test/tap/config-meta.js index 3da27a872b3183..bb40e2038d6555 100644 --- a/deps/npm/test/tap/config-meta.js +++ b/deps/npm/test/tap/config-meta.js @@ -4,34 +4,34 @@ // b) Documented // c) Defined in the `npmconf` package. -var test = require("tap").test -var fs = require("fs") -var path = require("path") -var root = path.resolve(__dirname, "..", "..") -var lib = path.resolve(root, "lib") -var nm = path.resolve(root, "node_modules") -var doc = path.resolve(root, "doc/misc/npm-config.md") +var test = require('tap').test +var fs = require('fs') +var path = require('path') +var root = path.resolve(__dirname, '..', '..') +var lib = path.resolve(root, 'lib') +var nm = path.resolve(root, 'node_modules') +var doc = path.resolve(root, 'doc/misc/npm-config.md') var FILES = [] var CONFS = {} var DOC = {} var exceptions = [ - path.resolve(lib, "adduser.js"), - path.resolve(lib, "config.js"), - path.resolve(lib, "publish.js"), - path.resolve(lib, "utils", "lifecycle.js"), - path.resolve(lib, "utils", "map-to-registry.js"), - path.resolve(nm, "npm-registry-client", "lib", "publish.js"), - path.resolve(nm, "npm-registry-client", "lib", "request.js") + path.resolve(lib, 'adduser.js'), + path.resolve(lib, 'config.js'), + path.resolve(lib, 'publish.js'), + path.resolve(lib, 'utils', 'lifecycle.js'), + path.resolve(lib, 'utils', 'map-to-registry.js'), + path.resolve(nm, 'npm-registry-client', 'lib', 'publish.js'), + path.resolve(nm, 'npm-registry-client', 'lib', 'request.js') ] -test("get files", function (t) { +test('get files', function (t) { walk(nm) walk(lib) - t.pass("got files") + t.pass('got files') t.end() - function walk(lib) { + function walk (lib) { var files = fs.readdirSync(lib).map(function (f) { return path.resolve(lib, f) }) @@ -41,86 +41,89 @@ test("get files", function (t) { } catch (er) { return } - if (s.isDirectory()) + if (s.isDirectory()) { walk(f) - else if (f.match(/\.js$/)) + } else if (f.match(/\.js$/)) { FILES.push(f) + } }) } }) -test("get lines", function (t) { +test('get lines', function (t) { FILES.forEach(function (f) { - var lines = fs.readFileSync(f, "utf8").split(/\r|\n/) + var lines = fs.readFileSync(f, 'utf8').split(/\r|\n/) lines.forEach(function (l, i) { var matches = l.split(/conf(?:ig)?\.get\(/g) matches.shift() matches.forEach(function (m) { - m = m.split(")").shift() - var literal = m.match(/^['"].+?['"]/) + m = m.split(')').shift() + var literal = m.match(/^[''].+?['']/) if (literal) { m = literal[0].slice(1, -1) - if (!m.match(/^\_/) && m !== "argv") + if (!m.match(/^\_/) && m !== 'argv') { CONFS[m] = { file: f, line: i } + } } else if (exceptions.indexOf(f) === -1) { - t.fail("non-string-literal config used in " + f + ":" + i) + t.fail('non-string-literal config used in ' + f + ':' + i) } }) }) }) - t.pass("got lines") + t.pass('got lines') t.end() }) -test("get docs", function (t) { - var d = fs.readFileSync(doc, "utf8").split(/\r|\n/) - // walk down until the "## Config Settings" section - for (var i = 0; i < d.length && d[i] !== "## Config Settings"; i++); +test('get docs', function (t) { + var d = fs.readFileSync(doc, 'utf8').split(/\r|\n/) + // walk down until the '## Config Settings' section + for (var i = 0; i < d.length && d[i] !== '## Config Settings'; i++); i++ // now gather up all the ^###\s lines until the next ^##\s for (; i < d.length && !d[i].match(/^## /); i++) { - if (d[i].match(/^### /)) - DOC[ d[i].replace(/^### /, "").trim() ] = true + if (d[i].match(/^### /)) { + DOC[ d[i].replace(/^### /, '').trim() ] = true + } } - t.pass("read the docs") + t.pass('read the docs') t.end() }) -test("check configs", function (t) { - var defs = require("../../lib/config/defaults.js") +test('check configs', function (t) { + var defs = require('../../lib/config/defaults.js') var types = Object.keys(defs.types) var defaults = Object.keys(defs.defaults) for (var c1 in CONFS) { if (CONFS[c1].file.indexOf(lib) === 0) { - t.ok(DOC[c1], "should be documented " + c1 + " " - + CONFS[c1].file + ":" + CONFS[c1].line) - t.ok(types.indexOf(c1) !== -1, "should be defined in npmconf " + c1) - t.ok(defaults.indexOf(c1) !== -1, "should have default in npmconf " + c1) + t.ok(DOC[c1], 'should be documented ' + c1 + ' ' + + CONFS[c1].file + ':' + CONFS[c1].line) + t.ok(types.indexOf(c1) !== -1, 'should be defined in npmconf ' + c1) + t.ok(defaults.indexOf(c1) !== -1, 'should have default in npmconf ' + c1) } } for (var c2 in DOC) { - if (c2 !== "versions" && c2 !== "version" && c2 !== "init.version") { - t.ok(CONFS[c2], "config in doc should be used somewhere " + c2) - t.ok(types.indexOf(c2) !== -1, "should be defined in npmconf " + c2) - t.ok(defaults.indexOf(c2) !== -1, "should have default in npmconf " + c2) + if (c2 !== 'versions' && c2 !== 'version' && c2 !== 'init.version') { + t.ok(CONFS[c2], 'config in doc should be used somewhere ' + c2) + t.ok(types.indexOf(c2) !== -1, 'should be defined in npmconf ' + c2) + t.ok(defaults.indexOf(c2) !== -1, 'should have default in npmconf ' + c2) } } types.forEach(function (c) { - if (!c.match(/^\_/) && c !== "argv" && !c.match(/^versions?$/)) { - t.ok(DOC[c], "defined type should be documented " + c) - t.ok(CONFS[c], "defined type should be used " + c) + if (!c.match(/^\_/) && c !== 'argv' && !c.match(/^versions?$/)) { + t.ok(DOC[c], 'defined type should be documented ' + c) + t.ok(CONFS[c], 'defined type should be used ' + c) } }) defaults.forEach(function (c) { - if (!c.match(/^\_/) && c !== "argv" && !c.match(/^versions?$/)) { - t.ok(DOC[c], "defaulted type should be documented " + c) - t.ok(CONFS[c], "defaulted type should be used " + c) + if (!c.match(/^\_/) && c !== 'argv' && !c.match(/^versions?$/)) { + t.ok(DOC[c], 'defaulted type should be documented ' + c) + t.ok(CONFS[c], 'defaulted type should be used ' + c) } }) diff --git a/deps/npm/test/tap/config-private.js b/deps/npm/test/tap/config-private.js index 37e283eec321e4..91582921e6dffa 100644 --- a/deps/npm/test/tap/config-private.js +++ b/deps/npm/test/tap/config-private.js @@ -1,81 +1,83 @@ -var fs = require("fs") -var path = require("path") -var test = require("tap").test -var rimraf = require("rimraf") -var mkdirp = require("mkdirp") -var common = require("../common-tap.js") +var fs = require('fs') +var path = require('path') +var test = require('tap').test +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var common = require('../common-tap.js') -var pkg = path.resolve(__dirname, "config-private") +var pkg = path.resolve(__dirname, 'config-private') var opts = { cwd: pkg } -test("setup", function (t) { +test('setup', function (t) { rimraf.sync(pkg) mkdirp.sync(pkg) t.end() }) -test("config get private var (old auth)", function (t) { - common.npm([ - "config", - "get", - "_auth" +test('config get private var (old auth)', function (t) { + common.npm( + [ + 'config', + 'get', + '_auth' ], opts, function (err, code, stdout, stderr) { t.ifError(err) - t.similar(stderr, /sekretz/, "password blocked on stderr") - t.equal(stdout, "", "no output") + t.similar(stderr, /sekretz/, 'password blocked on stderr') + t.equal(stdout, '', 'no output') t.end() } ) }) -test("config get private var (new auth)", function (t) { - common.npm([ - "config", - "get", - "//registry.npmjs.org/:_password" +test('config get private var (new auth)', function (t) { + common.npm( + [ + 'config', + 'get', + '//registry.npmjs.org/:_password' ], opts, function (err, code, stdout, stderr) { t.ifError(err) - t.similar(stderr, /sekretz/, "password blocked on stderr") - t.equal(stdout, "", "no output") + t.similar(stderr, /sekretz/, 'password blocked on stderr') + t.equal(stdout, '', 'no output') t.end() } ) }) -test("config get public var (new username)", function (t) { - var FIXTURE_PATH = path.resolve(pkg, "fixture_npmrc") - var s = "//registry.lvh.me/:username = wombat\n" + - "//registry.lvh.me/:_password = YmFkIHBhc3N3b3Jk\n" + - "//registry.lvh.me/:email = lindsay@wdu.org.au\n" - fs.writeFileSync(FIXTURE_PATH, s, "ascii") - fs.chmodSync(FIXTURE_PATH, "0444") +test('config get public var (new username)', function (t) { + var FIXTURE_PATH = path.resolve(pkg, 'fixture_npmrc') + var s = '//registry.lvh.me/:username = wombat\n' + + '//registry.lvh.me/:_password = YmFkIHBhc3N3b3Jk\n' + + '//registry.lvh.me/:email = lindsay@wdu.org.au\n' + fs.writeFileSync(FIXTURE_PATH, s, 'ascii') + fs.chmodSync(FIXTURE_PATH, '0444') common.npm( [ - "config", - "get", - "//registry.lvh.me/:username", - "--userconfig=" + FIXTURE_PATH, - "--registry=http://registry.lvh.me/" + 'config', + 'get', + '//registry.lvh.me/:username', + '--userconfig=' + FIXTURE_PATH, + '--registry=http://registry.lvh.me/' ], opts, function (err, code, stdout, stderr) { t.ifError(err) - t.equal(stderr, "", "stderr is empty") - t.equal(stdout, "wombat\n", "got usename is output") + t.equal(stderr, '', 'stderr is empty') + t.equal(stdout, 'wombat\n', 'got usename is output') t.end() } ) }) -test("clean", function (t) { +test('clean', function (t) { rimraf.sync(pkg) t.end() }) diff --git a/deps/npm/test/tap/config-project.js b/deps/npm/test/tap/config-project.js index 337355bf286c16..b9e8b7ac04a2ef 100644 --- a/deps/npm/test/tap/config-project.js +++ b/deps/npm/test/tap/config-project.js @@ -1,21 +1,21 @@ -var test = require("tap").test -var path = require("path") -var fix = path.resolve(__dirname, "..", "fixtures", "config") -var projectRc = path.resolve(fix, ".npmrc") -var npmconf = require("../../lib/config/core.js") -var common = require("./00-config-setup.js") +var test = require('tap').test +var path = require('path') +var fix = path.resolve(__dirname, '..', 'fixtures', 'config') +var projectRc = path.resolve(fix, '.npmrc') +var npmconf = require('../../lib/config/core.js') +var common = require('./00-config-setup.js') -var projectData = { just: "testing" } +var projectData = { just: 'testing' } var ucData = common.ucData var envData = common.envData var envDataFix = common.envDataFix -var gcData = { "package-config:foo": "boo" } +var gcData = { 'package-config:foo': 'boo' } var biData = {} -var cli = { foo: "bar", umask: 022, prefix: fix } +var cli = { foo: 'bar', umask: parseInt('022', 8), prefix: fix } var expectList = [ cli, @@ -31,27 +31,27 @@ var expectSources = { env: { data: envDataFix, source: envData, - prefix: "" + prefix: '' }, project: { path: projectRc, - type: "ini", + type: 'ini', data: projectData }, user: { path: common.userconfig, - type: "ini", + type: 'ini', data: ucData }, global: { path: common.globalconfig, - type: "ini", + type: 'ini', data: gcData }, builtin: { data: biData } } -test("no builtin", function (t) { +test('no builtin', function (t) { npmconf.load(cli, function (er, conf) { if (er) throw er t.same(conf.list, expectList) @@ -59,8 +59,8 @@ test("no builtin", function (t) { t.same(npmconf.rootConf.list, []) t.equal(npmconf.rootConf.root, npmconf.defs.defaults) t.equal(conf.root, npmconf.defs.defaults) - t.equal(conf.get("umask"), 022) - t.equal(conf.get("heading"), "npm") + t.equal(conf.get('umask'), parseInt('022', 8)) + t.equal(conf.get('heading'), 'npm') t.end() }) }) diff --git a/deps/npm/test/tap/config-save.js b/deps/npm/test/tap/config-save.js index 88526a38af8b87..903bac7ae3a4a2 100644 --- a/deps/npm/test/tap/config-save.js +++ b/deps/npm/test/tap/config-save.js @@ -1,88 +1,87 @@ -var fs = require("fs") -var ini = require("ini") -var test = require("tap").test -var npmconf = require("../../lib/config/core.js") -var common = require("./00-config-setup.js") +var fs = require('fs') +var ini = require('ini') +var test = require('tap').test +var npmconf = require('../../lib/config/core.js') +var common = require('./00-config-setup.js') var expectConf = [ - "globalconfig = " + common.globalconfig, - "email = i@izs.me", - "env-thing = asdf", - "init.author.name = Isaac Z. Schlueter", - "init.author.email = i@izs.me", - "init.author.url = http://blog.izs.me/", - "init.version = 1.2.3", - "proprietary-attribs = false", - "npm:publishtest = true", - "_npmjs.org:couch = https://admin:password@localhost:5984/registry", - "npm-www:nocache = 1", - "sign-git-tag = false", - "message = v%s", - "strict-ssl = false", - "_auth = dXNlcm5hbWU6cGFzc3dvcmQ=", - "", - "[_token]", - "AuthSession = yabba-dabba-doodle", - "version = 1", - "expires = 1345001053415", - "path = /", - "httponly = true", - "" -].join("\n") + 'globalconfig = ' + common.globalconfig, + 'email = i@izs.me', + 'env-thing = asdf', + 'init.author.name = Isaac Z. Schlueter', + 'init.author.email = i@izs.me', + 'init.author.url = http://blog.izs.me/', + 'init.version = 1.2.3', + 'proprietary-attribs = false', + 'npm:publishtest = true', + '_npmjs.org:couch = https://admin:password@localhost:5984/registry', + 'npm-www:nocache = 1', + 'sign-git-tag = false', + 'message = v%s', + 'strict-ssl = false', + '_auth = dXNlcm5hbWU6cGFzc3dvcmQ=', + '', + '[_token]', + 'AuthSession = yabba-dabba-doodle', + 'version = 1', + 'expires = 1345001053415', + 'path = /', + 'httponly = true', + '' +].join('\n') var expectFile = [ - "globalconfig = " + common.globalconfig, - "email = i@izs.me", - "env-thing = asdf", - "init.author.name = Isaac Z. Schlueter", - "init.author.email = i@izs.me", - "init.author.url = http://blog.izs.me/", - "init.version = 1.2.3", - "proprietary-attribs = false", - "npm:publishtest = true", - "_npmjs.org:couch = https://admin:password@localhost:5984/registry", - "npm-www:nocache = 1", - "sign-git-tag = false", - "message = v%s", - "strict-ssl = false", - "_auth = dXNlcm5hbWU6cGFzc3dvcmQ=", - "", - "[_token]", - "AuthSession = yabba-dabba-doodle", - "version = 1", - "expires = 1345001053415", - "path = /", - "httponly = true", - "" -].join("\n") + 'globalconfig = ' + common.globalconfig, + 'email = i@izs.me', + 'env-thing = asdf', + 'init.author.name = Isaac Z. Schlueter', + 'init.author.email = i@izs.me', + 'init.author.url = http://blog.izs.me/', + 'init.version = 1.2.3', + 'proprietary-attribs = false', + 'npm:publishtest = true', + '_npmjs.org:couch = https://admin:password@localhost:5984/registry', + 'npm-www:nocache = 1', + 'sign-git-tag = false', + 'message = v%s', + 'strict-ssl = false', + '_auth = dXNlcm5hbWU6cGFzc3dvcmQ=', + '', + '[_token]', + 'AuthSession = yabba-dabba-doodle', + 'version = 1', + 'expires = 1345001053415', + 'path = /', + 'httponly = true', + '' +].join('\n') -test("saving configs", function (t) { +test('saving configs', function (t) { npmconf.load(function (er, conf) { - if (er) - throw er - conf.set("sign-git-tag", false, "user") - conf.del("nodedir") - conf.del("tmp") + if (er) throw er + + conf.set('sign-git-tag', false, 'user') + conf.del('nodedir') + conf.del('tmp') var foundConf = ini.stringify(conf.sources.user.data) t.same(ini.parse(foundConf), ini.parse(expectConf)) fs.unlinkSync(common.userconfig) - conf.save("user", function (er) { - if (er) - throw er - var uc = fs.readFileSync(conf.get("userconfig"), "utf8") + conf.save('user', function (er) { + if (er) throw er + + var uc = fs.readFileSync(conf.get('userconfig'), 'utf8') t.same(ini.parse(uc), ini.parse(expectFile)) t.end() }) }) }) -test("setting prefix", function (t) { +test('setting prefix', function (t) { npmconf.load(function (er, conf) { - if (er) - throw er + if (er) throw er - conf.prefix = "newvalue" - t.same(conf.prefix, "newvalue") + conf.prefix = 'newvalue' + t.same(conf.prefix, 'newvalue') t.end() }) }) diff --git a/deps/npm/test/tap/correct-mkdir.js b/deps/npm/test/tap/correct-mkdir.js new file mode 100644 index 00000000000000..4bfc6b1c977614 --- /dev/null +++ b/deps/npm/test/tap/correct-mkdir.js @@ -0,0 +1,58 @@ +var test = require('tap').test +var assert = require('assert') +var path = require('path') +var requireInject = require('require-inject') +var cache_dir = path.resolve(__dirname, 'correct-mkdir') + +test('correct-mkdir: no race conditions', function (t) { + var mock_fs = {} + var did_hook = false + mock_fs.stat = function (path, cb) { + if (path === cache_dir) { + // Return a non-matching owner + cb(null, { + uid: +process.uid + 1, + isDirectory: function () { + return true + } + }) + if (!did_hook) { + did_hook = true + doHook() + } + } else { + assert.ok(false, 'Unhandled stat path: ' + path) + } + } + var chown_in_progress = 0 + var mock_chownr = function (path, uid, gid, cb) { + ++chown_in_progress + process.nextTick(function () { + --chown_in_progress + cb(null) + }) + } + var mocks = { + 'graceful-fs': mock_fs, + 'chownr': mock_chownr + } + var correctMkdir = requireInject('../../lib/utils/correct-mkdir.js', mocks) + + var calls_in_progress = 3 + function handleCallFinish () { + t.equal(chown_in_progress, 0, 'should not return while chown still in progress') + if (!--calls_in_progress) { + t.end() + } + } + function doHook () { + // This is fired during the first correctMkdir call, after the stat has finished + // but before the chownr has finished + // Buggy old code will fail and return a cached value before initial call is done + correctMkdir(cache_dir, handleCallFinish) + } + // Initial call + correctMkdir(cache_dir, handleCallFinish) + // Immediate call again in case of race condition there + correctMkdir(cache_dir, handleCallFinish) +}) diff --git a/deps/npm/test/tap/cruft-test.js b/deps/npm/test/tap/cruft-test.js new file mode 100644 index 00000000000000..0cbcc6f56c61d6 --- /dev/null +++ b/deps/npm/test/tap/cruft-test.js @@ -0,0 +1,43 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') +var mkdirpSync = require('mkdirp').sync +var rimraf = require('rimraf') +var test = require('tap').test +var common = require('../common-tap.js') + +var base = path.join(__dirname, path.basename(__filename, '.js')) +var cruft = path.join(base, 'node_modules', 'cruuuft') +var pkg = { + name: 'example', + version: '1.0.0', + dependencies: {} +} + +function setup () { + mkdirpSync(path.dirname(cruft)) + fs.writeFileSync(cruft, 'this is some cruft for sure') + fs.writeFileSync(path.join(base, 'package.json'), JSON.stringify(pkg)) +} + +function cleanup () { + rimraf.sync(base) +} + +test('setup', function (t) { + cleanup() + setup() + t.done() +}) + +test('cruft', function (t) { + common.npm(['ls'], {cwd: base}, function (er, code, stdout, stderr) { + t.is(stderr, '', 'no warnings or errors from ls') + t.done() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) diff --git a/deps/npm/test/tap/dedupe-scoped.js b/deps/npm/test/tap/dedupe-scoped.js index a093e1f8c064bf..bc352356d43d04 100644 --- a/deps/npm/test/tap/dedupe-scoped.js +++ b/deps/npm/test/tap/dedupe-scoped.js @@ -11,12 +11,11 @@ var modules = join(pkg, 'node_modules') var EXEC_OPTS = { cwd: pkg } -var prolog = 'dedupe@0.0.0 ' + pkg var body = function () {/* -├─┬ first@1.0.0 -│ └── @scope/shared@2.1.6 -└─┬ second@2.0.0 - └── @scope/shared@2.1.6 +@scope/shared@2.1.6 node_modules/first/node_modules/@scope/shared -> node_modules/@scope/shared +firstUnique@0.6.0 node_modules/first/node_modules/firstUnique -> node_modules/firstUnique +secondUnique@1.2.0 node_modules/second/node_modules/secondUnique -> node_modules/secondUnique +- @scope/shared@2.1.6 node_modules/second/node_modules/@scope/shared */}.toString().split('\n').slice(1, -1) var deduper = { @@ -61,7 +60,6 @@ var secondUnique = { 'version': '1.2.0' } - test('setup', function (t) { setup() t.end() @@ -82,7 +80,7 @@ test('dedupe finds the common scoped modules and moves it up one level', functio t.notOk(stderr, 'npm printed no errors') t.same( stdout.trim().split('\n').map(ltrimm), - [prolog].concat(body).map(ltrimm), + body.map(ltrimm), 'got expected output' ) diff --git a/deps/npm/test/tap/dedupe.js b/deps/npm/test/tap/dedupe.js index 7b80102b33458c..bdda3474ac5cd0 100644 --- a/deps/npm/test/tap/dedupe.js +++ b/deps/npm/test/tap/dedupe.js @@ -24,6 +24,32 @@ var json = { } } +var shrinkwrap = { + name: 'dedupe', + version: '0.0.0', + dependencies: { + clean: { + version: '2.1.6', + dependencies: { + checker: { + version: '0.5.2', + dependencies: { + async: { version: '0.2.10' } + } + }, + minimist: { version: '0.0.5' } + } + }, + optimist: { + version: '0.6.0', + dependencies: { + wordwrap: { version: '0.0.2' }, + minimist: { version: '0.0.5' } + } + } + } +} + test('setup', function (t) { t.comment('test for https://github.com/npm/npm/issues/4675') setup(function () { @@ -32,8 +58,7 @@ test('setup', function (t) { }) test('dedupe finds the common module and moves it up one level', function (t) { - common.npm( - [ + common.npm([ '--registry', common.registry, 'install', '.' ], @@ -50,9 +75,15 @@ test('dedupe finds the common module and moves it up one level', function (t) { t.ifError(err, 'successfully deduped against previous install') t.notOk(code, 'npm dedupe exited with code') - t.ok(existsSync(path.join(pkg, 'node_modules', 'minimist'))) - t.notOk(existsSync(path.join(pkg, 'node_modules', 'checker'))) - + t.ok(existsSync(path.join(pkg, 'node_modules', 'minimist')), 'minimist module exists') + t.notOk( + existsSync(path.join(pkg, 'node_modules', 'clean', 'node_modules', 'minimist')), + 'no clean/minimist' + ) + t.notOk( + existsSync(path.join(pkg, 'node_modules', 'optimist', 'node_modules', 'minimist')), + 'no optmist/minimist' + ) t.end() } ) @@ -72,11 +103,15 @@ function cleanup () { function setup (cb) { cleanup() - mkdirp.sync(path.join(pkg, 'node_modules')) + mkdirp.sync(pkg) fs.writeFileSync( path.join(pkg, 'package.json'), JSON.stringify(json, null, 2) ) + fs.writeFileSync( + path.join(pkg, 'npm-shrinkwrap.json'), + JSON.stringify(shrinkwrap, null, 2) + ) process.chdir(pkg) mr({ port: common.port }, function (er, s) { diff --git a/deps/npm/test/tap/deprecate.js b/deps/npm/test/tap/deprecate.js index 0c46453559609d..987acb80afd409 100644 --- a/deps/npm/test/tap/deprecate.js +++ b/deps/npm/test/tap/deprecate.js @@ -1,14 +1,8 @@ -var fs = require('fs') -var path = require('path') -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') var mr = require('npm-registry-mock') -var semver = require('semver') var test = require('tap').test var common = require('../common-tap.js') -var pkg = path.resolve(__dirname, 'deprecate') var server var cache = { @@ -132,6 +126,30 @@ test('npm deprecate bad semver range', function (t) { }) }) +test('npm deprecate a package with no semver range', function (t) { + var deprecated = JSON.parse(JSON.stringify(cache)) + deprecated.versions = { + '0.0.0': { deprecated: 'make it dead' }, + '0.0.1': { deprecated: 'make it dead' }, + '0.0.2': { deprecated: 'make it dead' } + } + server.get('/cond?write=true').reply(200, cache) + server.put('/cond', deprecated).reply(201, { deprecated: true }) + common.npm([ + 'deprecate', + 'cond', + 'make it dead', + '--registry', common.registry, + '--loglevel', 'silent' + ], {}, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm deprecate') + t.equal(stderr, '', 'no error output') + t.equal(code, 0, 'exited OK') + t.end() + }) +}) + test('cleanup', function (t) { server.close() t.ok(true) diff --git a/deps/npm/test/tap/dist-tag.js b/deps/npm/test/tap/dist-tag.js index 08a5ca438c6e40..62ecab2c0a5301 100644 --- a/deps/npm/test/tap/dist-tag.js +++ b/deps/npm/test/tap/dist-tag.js @@ -1,62 +1,62 @@ -var fs = require("fs") -var path = require("path") -var mkdirp = require("mkdirp") -var rimraf = require("rimraf") -var mr = require("npm-registry-mock") +var fs = require('fs') +var path = require('path') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var mr = require('npm-registry-mock') -var test = require("tap").test -var common = require("../common-tap.js") +var test = require('tap').test +var common = require('../common-tap.js') -var pkg = path.resolve(__dirname, "dist-tag") +var pkg = path.resolve(__dirname, 'dist-tag') var server var scoped = { - name : "@scoped/pkg", - version : "1.1.1" + name: '@scoped/pkg', + version: '1.1.1' } function mocks (server) { // ls current package - server.get("/-/package/@scoped%2fpkg/dist-tags") - .reply(200, { latest : "1.0.0", a : "0.0.1", b : "0.5.0" }) + server.get('/-/package/@scoped%2fpkg/dist-tags') + .reply(200, { latest: '1.0.0', a: '0.0.1', b: '0.5.0' }) // ls named package - server.get("/-/package/@scoped%2fanother/dist-tags") - .reply(200, { latest : "2.0.0", a : "0.0.2", b : "0.6.0" }) + server.get('/-/package/@scoped%2fanother/dist-tags') + .reply(200, { latest: '2.0.0', a: '0.0.2', b: '0.6.0' }) // add c - server.get("/-/package/@scoped%2fanother/dist-tags") - .reply(200, { latest : "2.0.0", a : "0.0.2", b : "0.6.0" }) - server.put("/-/package/@scoped%2fanother/dist-tags/c", "\"7.7.7\"") - .reply(200, { latest : "7.7.7", a : "0.0.2", b : "0.6.0", c : "7.7.7" }) + server.get('/-/package/@scoped%2fanother/dist-tags') + .reply(200, { latest: '2.0.0', a: '0.0.2', b: '0.6.0' }) + server.put('/-/package/@scoped%2fanother/dist-tags/c', '\"7.7.7\"') + .reply(200, { latest: '7.7.7', a: '0.0.2', b: '0.6.0', c: '7.7.7' }) // set same version - server.get("/-/package/@scoped%2fanother/dist-tags") - .reply(200, { latest : "2.0.0", b : "0.6.0" }) + server.get('/-/package/@scoped%2fanother/dist-tags') + .reply(200, { latest: '2.0.0', b: '0.6.0' }) // rm - server.get("/-/package/@scoped%2fanother/dist-tags") - .reply(200, { latest : "2.0.0", a : "0.0.2", b : "0.6.0", c : "7.7.7" }) - server.delete("/-/package/@scoped%2fanother/dist-tags/c") - .reply(200, { c : "7.7.7" }) + server.get('/-/package/@scoped%2fanother/dist-tags') + .reply(200, { latest: '2.0.0', a: '0.0.2', b: '0.6.0', c: '7.7.7' }) + server.delete('/-/package/@scoped%2fanother/dist-tags/c') + .reply(200, { c: '7.7.7' }) // rm - server.get("/-/package/@scoped%2fanother/dist-tags") - .reply(200, { latest : "4.0.0" }) + server.get('/-/package/@scoped%2fanother/dist-tags') + .reply(200, { latest: '4.0.0' }) } -test("setup", function (t) { +test('setup', function (t) { mkdirp(pkg, function (er) { - t.ifError(er, pkg + " made successfully") + t.ifError(er, pkg + ' made successfully') - mr({port : common.port, plugin : mocks}, function (er, s) { + mr({ port: common.port, plugin: mocks }, function (er, s) { server = s fs.writeFile( - path.join(pkg, "package.json"), + path.join(pkg, 'package.json'), JSON.stringify(scoped), function (er) { - t.ifError(er, "wrote package.json") + t.ifError(er, 'wrote package.json') t.end() } ) @@ -64,131 +64,131 @@ test("setup", function (t) { }) }) -test("npm dist-tags ls in current package", function (t) { +test('npm dist-tags ls in current package', function (t) { common.npm( [ - "dist-tags", "ls", - "--registry", common.registry, - "--loglevel", "silent" + 'dist-tags', 'ls', + '--registry', common.registry, + '--loglevel', 'silent' ], - { cwd : pkg }, + { cwd: pkg }, function (er, code, stdout, stderr) { - t.ifError(er, "npm access") - t.notOk(code, "exited OK") - t.notOk(stderr, "no error output") - t.equal(stdout, "a: 0.0.1\nb: 0.5.0\nlatest: 1.0.0\n") + t.ifError(er, 'npm access') + t.notOk(code, 'exited OK') + t.notOk(stderr, 'no error output') + t.equal(stdout, 'a: 0.0.1\nb: 0.5.0\nlatest: 1.0.0\n') t.end() } ) }) -test("npm dist-tags ls on named package", function (t) { +test('npm dist-tags ls on named package', function (t) { common.npm( [ - "dist-tags", - "ls", "@scoped/another", - "--registry", common.registry, - "--loglevel", "silent" + 'dist-tags', + 'ls', '@scoped/another', + '--registry', common.registry, + '--loglevel', 'silent' ], - { cwd : pkg }, + { cwd: pkg }, function (er, code, stdout, stderr) { - t.ifError(er, "npm access") - t.notOk(code, "exited OK") - t.notOk(stderr, "no error output") - t.equal(stdout, "a: 0.0.2\nb: 0.6.0\nlatest: 2.0.0\n") + t.ifError(er, 'npm access') + t.notOk(code, 'exited OK') + t.notOk(stderr, 'no error output') + t.equal(stdout, 'a: 0.0.2\nb: 0.6.0\nlatest: 2.0.0\n') t.end() } ) }) -test("npm dist-tags add @scoped/another@7.7.7 c", function (t) { +test('npm dist-tags add @scoped/another@7.7.7 c', function (t) { common.npm( [ - "dist-tags", - "add", "@scoped/another@7.7.7", "c", - "--registry", common.registry, - "--loglevel", "silent" + 'dist-tags', + 'add', '@scoped/another@7.7.7', 'c', + '--registry', common.registry, + '--loglevel', 'silent' ], - { cwd : pkg }, + { cwd: pkg }, function (er, code, stdout, stderr) { - t.ifError(er, "npm access") - t.notOk(code, "exited OK") - t.notOk(stderr, "no error output") - t.equal(stdout, "+c: @scoped/another@7.7.7\n") + t.ifError(er, 'npm access') + t.notOk(code, 'exited OK') + t.notOk(stderr, 'no error output') + t.equal(stdout, '+c: @scoped/another@7.7.7\n') t.end() } ) }) -test("npm dist-tags set same version", function (t) { +test('npm dist-tags set same version', function (t) { common.npm( [ - "dist-tag", - "set", "@scoped/another@0.6.0", "b", - "--registry", common.registry, - "--loglevel", "warn" + 'dist-tag', + 'set', '@scoped/another@0.6.0', 'b', + '--registry', common.registry, + '--loglevel', 'warn' ], - { cwd : pkg }, + { cwd: pkg }, function (er, code, stdout, stderr) { - t.ifError(er, "npm access") - t.notOk(code, "exited OK") + t.ifError(er, 'npm access') + t.notOk(code, 'exited OK') t.equal( stderr, - "npm WARN dist-tag add b is already set to version 0.6.0\n", - "warned about setting same version" + 'npm WARN dist-tag add b is already set to version 0.6.0\n', + 'warned about setting same version' ) - t.notOk(stdout, "only expecting warning message") + t.notOk(stdout, 'only expecting warning message') t.end() } ) }) -test("npm dist-tags rm @scoped/another c", function (t) { +test('npm dist-tags rm @scoped/another c', function (t) { common.npm( [ - "dist-tags", - "rm", "@scoped/another", "c", - "--registry", common.registry, - "--loglevel", "silent" + 'dist-tags', + 'rm', '@scoped/another', 'c', + '--registry', common.registry, + '--loglevel', 'silent' ], - { cwd : pkg }, + { cwd: pkg }, function (er, code, stdout, stderr) { - t.ifError(er, "npm access") - t.notOk(code, "exited OK") - t.notOk(stderr, "no error output") - t.equal(stdout, "-c: @scoped/another@7.7.7\n") + t.ifError(er, 'npm access') + t.notOk(code, 'exited OK') + t.notOk(stderr, 'no error output') + t.equal(stdout, '-c: @scoped/another@7.7.7\n') t.end() } ) }) -test("npm dist-tags rm @scoped/another nonexistent", function (t) { +test('npm dist-tags rm @scoped/another nonexistent', function (t) { common.npm( [ - "dist-tags", - "rm", "@scoped/another", "nonexistent", - "--registry", common.registry, - "--loglevel", "silent" + 'dist-tags', + 'rm', '@scoped/another', 'nonexistent', + '--registry', common.registry, + '--loglevel', 'silent' ], - { cwd : pkg }, + { cwd: pkg }, function (er, code, stdout, stderr) { - t.ifError(er, "npm dist-tag") - t.ok(code, "expecting nonzero exit code") - t.notOk(stderr, "no error output") - t.notOk(stdout, "not expecting output") + t.ifError(er, 'npm dist-tag') + t.ok(code, 'expecting nonzero exit code') + t.notOk(stderr, 'no error output') + t.notOk(stdout, 'not expecting output') t.end() } ) }) -test("cleanup", function (t) { - t.pass("cleaned up") +test('cleanup', function (t) { + t.pass('cleaned up') rimraf.sync(pkg) server.close() t.end() diff --git a/deps/npm/test/tap/do-not-remove-other-bins.js b/deps/npm/test/tap/do-not-remove-other-bins.js new file mode 100644 index 00000000000000..af6de62305469b --- /dev/null +++ b/deps/npm/test/tap/do-not-remove-other-bins.js @@ -0,0 +1,131 @@ +'use strict' +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap') + +var base = path.resolve(__dirname, path.basename(__filename, '.js')) +var installPath = path.resolve(base, 'install') +var installBin = path.resolve(installPath, 'node_modules', '.bin') +var packageApath = path.resolve(base, 'packageA') +var packageBpath = path.resolve(base, 'packageB') + +var packageA = { + name: 'a', + version: '1.0.0', + description: 'x', + repository: 'x', + license: 'MIT', + bin: { + testbin: './testbin.js' + } +} +var packageB = { + name: 'b', + version: '1.0.0', + description: 'x', + repository: 'x', + license: 'MIT', + bin: { + testbin: './testbin.js' + } +} + +var EXEC_OPTS = { + cwd: installPath +} + +test('setup', function (t) { + cleanup() + mkdirp.sync(path.join(installPath, 'node_modules')) + mkdirp.sync(packageApath) + fs.writeFileSync( + path.join(packageApath, 'package.json'), + JSON.stringify(packageA, null, 2) + ) + fs.writeFileSync( + path.join(packageApath, packageA.bin.testbin), + '' + ) + mkdirp.sync(packageBpath) + fs.writeFileSync( + path.join(packageBpath, 'package.json'), + JSON.stringify(packageB, null, 2) + ) + fs.writeFileSync( + path.join(packageBpath, packageB.bin.testbin), + '' + ) + t.end() +}) + +test('npm install A', function (t) { + process.chdir(installPath) + common.npm([ + 'install', packageApath + ], EXEC_OPTS, function (err, code, stdout, stderr) { + console.log(stdout, stderr) + t.ifErr(err, 'install finished successfully') + t.notOk(code, 'exit ok') + t.notOk(stderr, 'Should not get data on stderr: ' + stderr) + t.end() + }) +}) + +test('npm install B', function (t) { + process.chdir(installPath) + common.npm([ + 'install', packageBpath + ], EXEC_OPTS, function (err, code, stdout, stderr) { + t.ifErr(err, 'install finished successfully') + t.notOk(code, 'exit ok') + t.notOk(stderr, 'Should not get data on stderr: ' + stderr) + t.end() + }) +}) + +test('verify bins', function (t) { + var bin = path.dirname( + path.resolve( + installBin, + fs.readlinkSync(path.join(installBin, 'testbin')))) + t.is(bin, path.join(installPath, 'node_modules', 'b')) + t.end() +}) + +test('rm install A', function (t) { + process.chdir(installPath) + common.npm([ + 'rm', packageApath + ], EXEC_OPTS, function (err, code, stdout, stderr) { + t.ifErr(err, 'install finished successfully') + t.notOk(code, 'exit ok') + t.notOk(stderr, 'Should not get data on stderr: ' + stderr) + t.end() + }) +}) + +test('verify postremoval bins', function (t) { + var bin = path.dirname( + path.resolve( + installBin, + fs.readlinkSync(path.join(installBin, 'testbin')))) + t.is(bin, path.join(installPath, 'node_modules', 'b')) + t.end() +}) + +test('cleanup', function (t) { + cleanup() + t.pass('cleaned up') + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(base) +} diff --git a/deps/npm/test/tap/extraneous-dep-cycle-ls-ok.js b/deps/npm/test/tap/extraneous-dep-cycle-ls-ok.js new file mode 100644 index 00000000000000..23b75193613152 --- /dev/null +++ b/deps/npm/test/tap/extraneous-dep-cycle-ls-ok.js @@ -0,0 +1,70 @@ +'use strict' +var fs = require('fs') +var path = require('path') + +var test = require('tap').test +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') + +var common = require('../common-tap') + +var pkg = path.resolve(__dirname, path.basename(__filename, '.js')) +var pathModA = path.join(pkg, 'node_modules', 'moduleA') +var pathModB = path.join(pkg, 'node_modules', 'moduleB') + +var modA = { + name: 'moduleA', + version: '1.0.0', + _requiredBy: [ '#USER', '/moduleB' ], + dependencies: { + moduleB: '1.0.0' + } +} +var modB = { + name: 'moduleB', + version: '1.0.0', + _requiredBy: [ '/moduleA' ], + dependencies: { + moduleA: '1.0.0' + } +} + +function setup () { + mkdirp.sync(pathModA) + fs.writeFileSync( + path.join(pathModA, 'package.json'), + JSON.stringify(modA, null, 2) + ) + mkdirp.sync(pathModB) + fs.writeFileSync( + path.join(pathModB, 'package.json'), + JSON.stringify(modB, null, 2) + ) +} + +function cleanup () { + rimraf.sync(pkg) +} + +test('setup', function (t) { + cleanup() + setup() + t.end() +}) + +var expected = pkg + '\n' + + '└─┬ moduleA@1.0.0\n' + + ' └── moduleB@1.0.0\n\n' + +test('extraneous-dep-cycle', function (t) { + common.npm(['ls'], {cwd: pkg}, function (er, code, stdout, stderr) { + t.ifErr(er, 'install finished successfully') + t.is(stdout, expected, 'ls output shows module') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) diff --git a/deps/npm/test/tap/false-name.js b/deps/npm/test/tap/false-name.js index c98a5103b272bf..1e2a4d43ddbb93 100644 --- a/deps/npm/test/tap/false-name.js +++ b/deps/npm/test/tap/false-name.js @@ -54,11 +54,14 @@ test('not every pkg.name can be required', function (t) { function (err, code) { t.ifErr(err, 'install finished without error') t.equal(code, 0, 'install exited ok') - t.ok(existsSync(path.join( - pkg, - 'node_modules/test-package-with-one-dep', - 'node_modules/test-package' - )), 'package installed OK') + t.ok( + existsSync(path.join(pkg, 'node_modules', 'test-package-with-one-dep')), + 'test-package-with-one-dep installed OK' + ) + t.ok( + existsSync(path.join(pkg, 'node_modules', 'test-package')), + 'test-pacakge subdep installed OK' + ) t.end() } ) diff --git a/deps/npm/test/tap/files-and-ignores.js b/deps/npm/test/tap/files-and-ignores.js new file mode 100644 index 00000000000000..02371cfe3eab78 --- /dev/null +++ b/deps/npm/test/tap/files-and-ignores.js @@ -0,0 +1,558 @@ +'use strict' +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var fs = require('graceful-fs') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixturepath = path.resolve(basepath, 'npm-test-files') +var modulepath = path.resolve(basepath, 'node_modules') +var installedpath = path.resolve(modulepath, 'npm-test-files') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +test('basic file inclusion', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5', + files: [ + 'include', + 'sub/include' + ] + }), + include: File(''), + sub: Dir({ include: File('') }), + notincluded: File('') + }) + ) + withFixture(t, fixture, function (done) { + t.ok(fileExists('include'), 'toplevel file included') + t.ok(fileExists('sub/include'), 'nested file included') + t.notOk(fileExists('notincluded'), 'unspecified file not included') + done() + }) +}) + +test('basic file exclusion', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5' + }), + '.npmignore': File( + 'ignore\n' + + 'sub/ignore\n' + ), + include: File(''), + ignore: File(''), + sub: Dir({ ignore: File('') }) + }) + ) + withFixture(t, fixture, function (done) { + t.notOk(fileExists('ignore'), 'toplevel file excluded') + t.notOk(fileExists('sub/ignore'), 'nested file excluded') + t.ok(fileExists('include'), 'unignored file included') + done() + }) +}) + +test('toplevel-only and blanket ignores', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5' + }), + '.npmignore': File( + './shallow1\n' + + '/shallow2\n' + + '/sub/onelevel\n' + + 'deep\n' + + '' + ), + shallow1: File(''), + shallow2: File(''), + deep: File(''), + sub: Dir({ + shallow1: File(''), + shallow2: File(''), + onelevel: File(''), + deep: File(''), + sub: Dir({ + deep: File(''), + onelevel: File('') + }) + }) + }) + ) + withFixture(t, fixture, function (done) { + t.notOk(fileExists('shallow2'), '/ file excluded') + t.ok(fileExists('sub/shallow1'), 'nested ./ file included') + t.ok(fileExists('sub/shallow2'), 'nested / file included') + t.ok(fileExists('sub/sub/onelevel'), 'double-nested file included') + t.notOk(fileExists('sub/onelevel'), 'nested / file excluded') + t.notOk(fileExists('deep'), 'deep file excluded') + t.notOk(fileExists('sub/deep'), 'nested deep file excluded') + t.notOk(fileExists('sub/sub/deep'), 'double-nested deep file excluded') + t.ok(fileExists('shallow1'), './ file included') + done() + }) +}) + +test('.npmignore works for nested directories recursively', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5' + }), + '.npmignore': File( + '/ignore\n' + + 'deep\n' + ), + include: File(''), + ignore: File(''), + deep: File(''), + sub: Dir({ + ignore: File(''), + include: File(''), + deep: File(''), + sub: Dir({ + '.npmignore': File( + '/ignore\n' + ), + ignore: File(''), + include: File(''), + deep: File('') + }) + }) + }) + ) + withFixture(t, fixture, function (done) { + t.notOk(fileExists('ignore'), 'toplevel file excluded') + t.ok(fileExists('include'), 'unignored file included') + t.ok(fileExists('sub/ignore'), 'same-name file in nested dir included') + t.ok(fileExists('sub/include'), 'unignored nested dir file included') + t.notOk(fileExists('sub/sub/ignore'), 'sub-sub-directory file excluded') + t.ok(fileExists('sub/sub/include'), 'sub-sube-directory file included') + t.notOk(fileExists('deep'), 'deep file excluded') + t.notOk(fileExists('sub/deep'), 'sub-dir deep file excluded') + t.notOk(fileExists('sub/sub/deep'), 'sub-sub-dir deep file excluded') + done() + }) +}) + +test('.gitignore should have identical semantics', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5' + }), + '.gitignore': File( + './shallow1\n' + + '/shallow2\n' + + '/sub/onelevel\n' + + 'deep\n' + + '' + ), + shallow1: File(''), + shallow2: File(''), + deep: File(''), + sub: Dir({ + shallow1: File(''), + shallow2: File(''), + onelevel: File(''), + deep: File(''), + sub: Dir({ + deep: File(''), + onelevel: File('') + }) + }) + }) + ) + withFixture(t, fixture, function (done) { + t.notOk(fileExists('shallow2'), '/ file excluded') + t.ok(fileExists('sub/shallow1'), 'nested ./ file included') + t.ok(fileExists('sub/shallow2'), 'nested / file included') + t.ok(fileExists('sub/sub/onelevel'), 'double-nested file included') + t.notOk(fileExists('sub/onelevel'), 'nested / file excluded') + t.notOk(fileExists('deep'), 'deep file excluded') + t.notOk(fileExists('sub/deep'), 'nested deep file excluded') + t.notOk(fileExists('sub/sub/deep'), 'double-nested deep file excluded') + t.ok(fileExists('shallow1'), './ file included') + done() + }) +}) + +test('.npmignore should always be overridden by files array', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5', + files: [ + 'include', + 'sub' + ] + }), + '.npmignore': File( + 'include\n' + + 'ignore\n' + + 'sub/included\n' + ), + include: File(''), + ignore: File(''), + sub: Dir({ + include: File('') + }) + }) + ) + withFixture(t, fixture, function (done) { + t.notOk(fileExists('ignore'), 'toplevel file excluded') + t.ok(fileExists('include'), 'unignored file included') + t.ok(fileExists('sub/include'), 'nested file included') + done() + }) +}) + +test('.gitignore supported for ignores', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5' + }), + '.gitignore': File( + 'ignore\n' + + 'sub/ignore\n' + ), + include: File(''), + ignore: File(''), + sub: Dir({ ignore: File('') }) + }) + ) + withFixture(t, fixture, function (done) { + t.notOk(fileExists('ignore'), 'toplevel file excluded') + t.notOk(fileExists('sub/ignore'), 'nested file excluded') + t.ok(fileExists('include'), 'unignored file included') + done() + }) +}) + +test('.npmignore completely overrides .gitignore', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5' + }), + '.npmignore': File( + 'ignore\n' + + 'sub/ignore\n' + ), + '.gitignore': File( + 'include\n' + + 'sub/include\n' + + 'extra\n' + ), + include: File(''), + sub: Dir({ include: File('') }), + extra: File('') + }) + ) + withFixture(t, fixture, function (done) { + t.ok(fileExists('include'), 'gitignored toplevel file included') + t.ok(fileExists('extra'), 'gitignored extra toplevel file included') + t.ok(fileExists('sub/include'), 'gitignored nested file included') + t.notOk(fileExists('ignore'), 'toplevel file excluded') + t.notOk(fileExists('sub/ignore'), 'nested file excluded') + done() + }) +}) + +test('files array overrides .npmignore', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5', + files: [ + 'include', + 'sub/include' + ] + }), + '.npmignore': File( + 'include\n' + + 'sub/include\n' + ), + include: File(''), + sub: Dir({ include: File('') }) + }) + ) + withFixture(t, fixture, function (done) { + t.ok(fileExists('include'), 'toplevel file included') + t.ok(fileExists('sub/include'), 'nested file included') + done() + }) +}) + +test('includes files regardless of emptiness', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5', + files: [ + 'full', + 'empty' + ] + }), + full: File('This file has contents~'), + empty: File('') + }) + ) + withFixture(t, fixture, function (done) { + t.ok(fileExists('full'), 'contentful file included') + t.ok(fileExists('empty'), 'empty file included') + done() + }) +}) + +test('.npmignore itself gets included', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5', + files: [ + '.npmignore' + ] + }), + '.npmignore': File('') + }) + ) + withFixture(t, fixture, function (done) { + t.ok(fileExists('.npmignore'), '.npmignore included') + done() + }) +}) + +test('include default files when missing files spec', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5' + }), + 'index.js': File(''), + foo: File(''), + node_modules: Dir({foo: Dir({bar: File('')})}) + }) + ) + withFixture(t, fixture, function (done) { + t.ok(fileExists('index.js'), 'index.js included') + t.ok(fileExists('foo'), 'foo included') + t.notOk(fileExists('node_modules'), 'node_modules not included') + done() + }) +}) + +test('include main file', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5', + main: 'foo.js', + files: [] + }), + 'index.js': File(''), + 'foo.js': File('') + }) + ) + withFixture(t, fixture, function (done) { + t.ok(fileExists('foo.js'), 'foo.js included because of main') + t.notOk(fileExists('index.js'), 'index.js not included') + done() + }) +}) + +test('certain files ignored unconditionally', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5', + files: [ + '.git', + '.svn', + 'CVS', + '.hg', + '.lock-wscript', + '.wafpickle-0', + '.wafpickle-5', + '.wafpickle-50', + 'build/config.gypi', + 'npm-debug.log', + '.npmrc', + '.foo.swp', + '.DS_Store', + '._ohno' + ] + }), + '.git': Dir({foo: File('')}), + '.svn': Dir({foo: File('')}), + 'CVS': Dir({foo: File('')}), + '.hg': Dir({foo: File('')}), + '.lock-wscript': File(''), + '.wafpickle-0': File(''), + '.wafpickle-5': File(''), + '.wafpickle-50': File(''), + 'build': Dir({'config.gypi': File('')}), + 'npm-debug.log': File(''), + '.npmrc': File(''), + '.foo.swp': File(''), + '.DS_Store': Dir({foo: File('')}), + '._ohno': File(''), + '._ohnoes': Dir({noes: File('')}) + }) + ) + withFixture(t, fixture, function (done) { + t.notOk(fileExists('.git'), '.git not included') + t.notOk(fileExists('.svn'), '.svn not included') + t.notOk(fileExists('CVS'), 'CVS not included') + t.notOk(fileExists('.hg'), '.hg not included') + t.notOk(fileExists('.lock-wscript'), '.lock-wscript not included') + t.notOk(fileExists('.wafpickle-0'), '.wafpickle-0 not included') + t.notOk(fileExists('.wafpickle-5'), '.wafpickle-5 not included') + t.notOk(fileExists('.wafpickle-50'), '.wafpickle-50 not included') + t.notOk(fileExists('build/config.gypi'), 'build/config.gypi not included') + t.notOk(fileExists('npm-debug.log'), 'npm-debug.log not included') + t.notOk(fileExists('.npmrc'), '.npmrc not included') + t.notOk(fileExists('.foo.swp'), '.foo.swp not included') + t.notOk(fileExists('.DS_Store'), '.DS_Store not included') + t.notOk(fileExists('._ohno'), '._ohno not included') + t.notOk(fileExists('._ohnoes'), '._ohnoes not included') + done() + }) +}) + +test('certain files included unconditionally', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5' + }), + '.npmignore': File( + 'package.json', + 'README', + 'Readme', + 'readme.md', + 'readme.randomext', + 'changelog', + 'CHAngelog', + 'ChangeLOG.txt', + 'license', + 'licence', + 'LICENSE', + 'LICENCE' + ), + 'README': File(''), + 'Readme': File(''), + 'readme.md': File(''), + 'readme.randomext': File(''), + 'changelog': File(''), + 'CHAngelog': File(''), + 'ChangeLOG.txt': File(''), + 'license': File(''), + 'licence': File(''), + 'LICENSE': File(''), + 'LICENCE': File('') + }) + ) + withFixture(t, fixture, function (done) { + t.ok(fileExists('package.json'), 'package.json included') + t.ok(fileExists('README'), 'README included') + t.ok(fileExists('Readme'), 'Readme included') + t.ok(fileExists('readme.md'), 'readme.md included') + t.ok(fileExists('readme.randomext'), 'readme.randomext included') + t.ok(fileExists('changelog'), 'changelog included') + t.ok(fileExists('CHAngelog'), 'CHAngelog included') + t.ok(fileExists('ChangeLOG.txt'), 'ChangeLOG.txt included') + t.ok(fileExists('license'), 'license included') + t.ok(fileExists('licence'), 'licence included') + t.ok(fileExists('LICENSE'), 'LICENSE included') + t.ok(fileExists('LICENCE'), 'LICENCE included') + done() + }) +}) + +test('folder-based inclusion works', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5', + files: [ + 'sub1/sub', + 'sub2' + ] + }), + sub1: Dir({ + sub: Dir({ + include1: File(''), + include2: File('') + }), + ignored: File('') + }), + sub2: Dir({ + include1: File(''), + include2: File(''), + empty: Dir({}) + }) + }) + ) + withFixture(t, fixture, function (done) { + t.ok(fileExists('sub1/sub/include1'), 'nested dir included') + t.ok(fileExists('sub1/sub/include2'), 'nested dir included') + t.notOk(fileExists('sub1/ignored'), 'unspecified file not included') + + t.ok(fileExists('sub2/include1'), 'dir contents included') + t.ok(fileExists('sub2/include2'), 'dir contents included') + t.notOk(fileExists('sub2/empty'), 'empty dir not included') + + done() + }) +}) + +function fileExists (file) { + try { + return !!fs.statSync(path.resolve(installedpath, file)) + } catch (_) { + return false + } +} + +function withFixture (t, fixture, tester) { + fixture.create(fixturepath) + mkdirp.sync(modulepath) + common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) + function installCheckAndTest (err, code) { + if (err) throw err + t.is(code, 0, 'install went ok') + tester(removeAndDone) + } + function removeAndDone (err) { + if (err) throw err + fixture.remove(fixturepath) + rimraf.sync(basepath) + t.done() + } +} diff --git a/deps/npm/test/tap/full-warning-messages.js b/deps/npm/test/tap/full-warning-messages.js new file mode 100644 index 00000000000000..3c74c61d0cd4e8 --- /dev/null +++ b/deps/npm/test/tap/full-warning-messages.js @@ -0,0 +1,108 @@ +'use strict' +var test = require('tap').test +var path = require('path') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var fs = require('graceful-fs') +var common = require('../common-tap') + +var base = path.resolve(__dirname, path.basename(__filename, '.js')) +var modA = path.resolve(base, 'modA') +var modB = path.resolve(base, 'modB') + +var json = { + 'name': 'test-full-warning-messages', + 'version': '1.0.0', + 'description': 'abc', + 'repository': 'git://abc/', + 'license': 'ISC', + 'dependencies': { + 'modA': modA + } +} + +var modAJson = { + 'name': 'modA', + 'version': '1.0.0', + 'optionalDependencies': { + 'modB': modB + } +} + +var modBJson = { + 'name': 'modB', + 'version': '1.0.0', + 'os': ['nope'], + 'cpu': 'invalid' +} + +function modJoin () { + var modules = Array.prototype.slice.call(arguments) + return modules.reduce(function (a, b) { + return path.resolve(a, 'node_modules', b) + }) +} + +function writeJson (mod, data) { + fs.writeFileSync(path.resolve(mod, 'package.json'), JSON.stringify(data)) +} + +function setup () { + cleanup() + ;[modA, modB].forEach(function (mod) { mkdirp.sync(mod) }) + writeJson(base, json) + writeJson(modA, modAJson) + writeJson(modB, modBJson) +} + +function cleanup () { + rimraf.sync(base) +} + +test('setup', function (t) { + setup() + t.end() +}) + +function exists (t, filepath, msg) { + try { + fs.statSync(filepath) + t.pass(msg) + return true + } catch (ex) { + t.fail(msg, {found: null, wanted: 'exists', compare: 'fs.stat(' + filepath + ')'}) + return false + } +} + +function notExists (t, filepath, msg) { + try { + fs.statSync(filepath) + t.fail(msg, {found: 'exists', wanted: null, compare: 'fs.stat(' + filepath + ')'}) + return true + } catch (ex) { + t.pass(msg) + return false + } +} + +test('tree-style', function (t) { + common.npm(['install', '--loglevel=warn'], {cwd: base}, function (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'result code') + t.match(stdout, /modA@1.0.0/, 'modA got installed') + t.notMatch(stdout, /modB/, 'modB not installed') + var stderrlines = stderr.trim().split(/\n/) + t.is(stderrlines.length, 2, 'two lines of warnings') + t.match(stderr, /Skipping failed optional dependency/, 'expected optional failure warning') + t.match(stderr, /Not compatible with your operating system or architecture/, 'reason for optional failure') + exists(t, modJoin(base, 'modA'), 'module A') + notExists(t, modJoin(base, 'modB'), 'module B') + t.done() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) diff --git a/deps/npm/test/tap/gently-rm-cmdshims.js b/deps/npm/test/tap/gently-rm-cmdshims.js new file mode 100644 index 00000000000000..ea1f47a0dd0f27 --- /dev/null +++ b/deps/npm/test/tap/gently-rm-cmdshims.js @@ -0,0 +1,159 @@ +'use strict' +var path = require('path') +var fs = require('graceful-fs') +var test = require('tap').test +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var npm = require('../../lib/npm.js') + +var work = path.join(__dirname, path.basename(__filename, '.js')) +var doremove = path.join(work, 'doremove') +var dontremove = path.join(work, 'dontremove') +var example_json = { + name: 'example', + version: '1.0.0', + bin: { + 'example': 'example.js' + } +} +var example_bin = + '#!/usr/bin/env node\n' + + 'true\n' + +// NOTE: if this were actually produced on windows it would be \ not / of +// course, buuut, path.resolve doesn't understand \ outside of windows =/ +var do_example_cmd = + '@IF EXIST "%~dp0\\node.exe" (\n' + + ' "%~dp0\\node.exe" "%~dp0\\../example/example.js" %*\n' + + ') ELSE (\n' + + ' @SETLOCAL\n' + + ' @SET PATHEXT=%PATHEXT:;.JS;=;%\n' + + ' node "%~dp0\\../example/example.js" %*\n' + + ')\n' + +var do_example_cygwin = + '#!/bin/sh\n' + + 'basedir=`dirname "$0"`\n' + + '\n' + + 'case `uname` in\n' + + ' *CYGWIN*) basedir=`cygpath -w "$basedir"`;;\n' + + 'esac\n' + + '\n' + + 'if [ -x "$basedir/node" ]; then\n' + + ' "$basedir/node" "$basedir/../example/example.js" "$@"\n' + + ' ret=$?\n' + + 'else\n' + + ' node "$basedir/../example/example.js" "$@"\n' + + ' ret=$?\n' + + 'fi\n' + + 'exit $ret\n' + +var dont_example_cmd = + '@IF EXIST "%~dp0\\node.exe" (\n' + + ' "%~dp0\\node.exe" "%~dp0\\../example-other/example.js" %*\n' + + ') ELSE (\n' + + ' @SETLOCAL\n' + + ' @SET PATHEXT=%PATHEXT:;.JS;=;%\n' + + ' node "%~dp0\\../example-other/example.js" %*\n' + + ')\n' + +var dont_example_cygwin = + '#!/bin/sh\n' + + 'basedir=`dirname "$0"`\n' + + '\n' + + 'case `uname` in\n' + + ' *CYGWIN*) basedir=`cygpath -w "$basedir"`;;\n' + + 'esac\n' + + '\n' + + 'if [ -x "$basedir/node" ]; then\n' + + ' "$basedir/node" "$basedir/../example-other/example.js" "$@"\n' + + ' ret=$?\n' + + 'else\n' + + ' node "$basedir/../example-other/example.js" "$@"\n' + + ' ret=$?\n' + + 'fi\n' + + 'exit $ret\n' + +function cleanup () { + rimraf.sync(work) +} + +var doremove_module = path.join(doremove, 'node_modules', 'example') +var doremove_example_cmd = path.join(doremove, 'node_modules', '.bin', 'example.cmd') +var doremove_example_cygwin = path.join(doremove, 'node_modules', '.bin', 'example') +var dontremove_module = path.join(dontremove, 'node_modules', 'example') +var dontremove_example_cmd = path.join(dontremove, 'node_modules', '.bin', 'example.cmd') +var dontremove_example_cygwin = path.join(dontremove, 'node_modules', '.bin', 'example') + +function setup () { + mkdirp.sync(doremove_module) + mkdirp.sync(path.join(doremove, 'node_modules', '.bin')) + fs.writeFileSync(path.join(doremove, 'node_modules', 'example', 'package.json'), JSON.stringify(example_json)) + fs.writeFileSync(path.join(doremove, 'node_modules', 'example', 'example.js'), JSON.stringify(example_bin)) + fs.writeFileSync(doremove_example_cmd, do_example_cmd) + fs.writeFileSync(doremove_example_cygwin, do_example_cygwin) + + mkdirp.sync(dontremove_module) + mkdirp.sync(path.join(dontremove, 'node_modules', '.bin')) + fs.writeFileSync(path.join(dontremove, 'node_modules', 'example', 'package.json'), JSON.stringify(example_json)) + fs.writeFileSync(path.join(dontremove, 'node_modules', 'example', 'example.js'), JSON.stringify(example_bin)) + fs.writeFileSync(dontremove_example_cmd, dont_example_cmd) + fs.writeFileSync(dontremove_example_cygwin, dont_example_cygwin) +} + +test('setup', function (t) { + cleanup() + setup() + npm.load({}, function () { + t.done() + }) +}) + +// Like slide.chain, but runs all commands even if they have errors, also +// throws away results. +function runAll (cmds, done) { + runNext() + function runNext () { + if (cmds.length === 0) return done() + var cmdline = cmds.shift() + var cmd = cmdline.shift() + cmdline.push(runNext) + cmd.apply(null, cmdline) + } +} + +test('remove-cmd-shims', function (t) { + t.plan(2) + + var gentlyRm = require('../../lib/utils/gently-rm.js') + runAll([ [gentlyRm, doremove_example_cmd, true, doremove_module], + [gentlyRm, doremove_example_cygwin, true, doremove_module] ], + function () { + fs.stat(doremove_example_cmd, function (er) { + t.is(er && er.code, 'ENOENT', 'cmd-shim was removed') + }) + fs.stat(doremove_example_cygwin, function (er) { + t.is(er && er.code, 'ENOENT', 'cmd-shim cygwin script was removed') + }) + }) +}) + +test('dont-remove-cmd-shims', function (t) { + t.plan(2) + var gentlyRm = require('../../lib/utils/gently-rm.js') + runAll([ [gentlyRm, dontremove_example_cmd, true, dontremove_module], + [gentlyRm, dontremove_example_cygwin, true, dontremove_module] ], + function () { + fs.stat(dontremove_example_cmd, function (er) { + t.is(er, null, 'cmd-shim was not removed') + }) + fs.stat(dontremove_example_cygwin, function (er) { + t.is(er, null, 'cmd-shim cygwin script was not removed') + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) diff --git a/deps/npm/test/tap/gently-rm-linked-module.js b/deps/npm/test/tap/gently-rm-linked-module.js new file mode 100644 index 00000000000000..1ffe7a820801d9 --- /dev/null +++ b/deps/npm/test/tap/gently-rm-linked-module.js @@ -0,0 +1,106 @@ +var basename = require('path').basename +var resolve = require('path').resolve +var fs = require('graceful-fs') +var test = require('tap').test +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') + +var common = require('../common-tap.js') + +var base = resolve(__dirname, basename(__filename, '.js')) +var pkg = resolve(base, 'gently-rm-linked') +var dep = resolve(base, 'test-linked') +var glb = resolve(base, 'test-global') +var lnk = resolve(base, 'test-global-link') + +var EXEC_OPTS = { cwd: pkg } + +var index = "module.exports = function () { console.log('whoop whoop') }" + +var fixture = { + name: '@test/linked', + version: '1.0.0', + bin: { + linked: './index.js' + } +} + +test('setup', function (t) { + cleanup() + setup() + + t.end() +}) + +test('install and link', function (t) { + // link our test module into the global folder + common.npm( + [ + '--prefix', lnk, + '--loglevel', 'error', + 'link', + dep + ], + EXEC_OPTS, + function (er, code, stdout, stderr) { + if (er) throw er + t.is(code, 0, 'link succeeded') + t.is(stderr, '', 'no log output') + t.ok(doesModuleExist(), 'installed ok') + + // and try removing it and make sure that succeeds + common.npm( + [ + '--global', + '--prefix', lnk, + '--loglevel', 'error', + 'rm', '@test/linked' + ], + EXEC_OPTS, + function (er, code, stdout, stderr) { + if (er) throw er + t.is(code, 0, 'rm succeeded') + t.is(stderr, '', 'no log output') + t.notOk(doesModuleExist(), 'removed ok') + t.end() + } + ) + } + ) +}) + +test('cleanup', function (t) { + cleanup() + + t.end() +}) + +function doesModuleExist () { + var binPath = resolve(lnk, 'bin', 'linked') + var pkgPath = resolve(lnk, 'lib', 'node_modules', '@test', 'linked') + try { + fs.statSync(binPath) + fs.statSync(pkgPath) + return true + } catch (ex) { + return false + } +} + +function cleanup () { + rimraf.sync(pkg) + rimraf.sync(dep) + rimraf.sync(lnk) + rimraf.sync(glb) +} + +function setup () { + mkdirp.sync(pkg) + mkdirp.sync(glb) + fs.symlinkSync(glb, lnk) + // so it doesn't try to install into npm's own node_modules + mkdirp.sync(resolve(pkg, 'node_modules')) + mkdirp.sync(dep) + fs.writeFileSync(resolve(dep, 'package.json'), JSON.stringify(fixture)) + fs.writeFileSync(resolve(dep, 'index.js'), index) +} diff --git a/deps/npm/test/tap/gently-rm-overeager.js b/deps/npm/test/tap/gently-rm-overeager.js index 35f46cc2195280..c266f1c4dc1202 100644 --- a/deps/npm/test/tap/gently-rm-overeager.js +++ b/deps/npm/test/tap/gently-rm-overeager.js @@ -1,53 +1,50 @@ -var resolve = require("path").resolve -var fs = require("graceful-fs") -var test = require("tap").test -var mkdirp = require("mkdirp") -var rimraf = require("rimraf") +var resolve = require('path').resolve +var fs = require('graceful-fs') +var test = require('tap').test +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') -var common = require("../common-tap.js") +var common = require('../common-tap.js') -var pkg = resolve(__dirname, "gently-rm-overeager") -var dep = resolve(__dirname, "test-whoops") +var pkg = resolve(__dirname, 'gently-rm-overeager') +var dep = resolve(__dirname, 'test-whoops') -var EXEC_OPTS = { - cwd : pkg -} +var EXEC_OPTS = { cwd: pkg } var fixture = { - name: "@test/whoops", - version: "1.0.0", + name: '@test/whoops', + version: '1.0.0', scripts: { - postinstall: "echo \"nope\" && exit 1" + postinstall: 'echo \'nope\' && exit 1' } } -test("setup", function (t) { +test('setup', function (t) { cleanup() setup() t.end() }) -test("cache add", function (t) { - common.npm(["install", "../test-whoops"], EXEC_OPTS, function (er, c) { +test('cache add', function (t) { + common.npm(['install', '../test-whoops'], EXEC_OPTS, function (er, c) { t.ifError(er, "test-whoops install didn't explode") - t.ok(c, "test-whoops install also failed") + t.ok(c, 'test-whoops install also failed') fs.readdir(pkg, function (er, files) { - t.ifError(er, "package directory is still there") - t.deepEqual(files, ["npm-debug.log"], "only debug log remains") + t.ifError(er, 'package directory is still there') + t.deepEqual(files, ['npm-debug.log'], 'only debug log remains') t.end() }) }) }) -test("cleanup", function (t) { +test('cleanup', function (t) { cleanup() t.end() }) - function cleanup () { rimraf.sync(pkg) rimraf.sync(dep) @@ -56,7 +53,7 @@ function cleanup () { function setup () { mkdirp.sync(pkg) // so it doesn't try to install into npm's own node_modules - mkdirp.sync(resolve(pkg, "node_modules")) + mkdirp.sync(resolve(pkg, 'node_modules')) mkdirp.sync(dep) - fs.writeFileSync(resolve(dep, "package.json"), JSON.stringify(fixture)) + fs.writeFileSync(resolve(dep, 'package.json'), JSON.stringify(fixture)) } diff --git a/deps/npm/test/tap/gently-rm-symlink.js b/deps/npm/test/tap/gently-rm-symlink.js deleted file mode 100644 index d69b62e5b271bd..00000000000000 --- a/deps/npm/test/tap/gently-rm-symlink.js +++ /dev/null @@ -1,113 +0,0 @@ -var resolve = require("path").resolve -var fs = require("graceful-fs") -var test = require("tap").test -var mkdirp = require("mkdirp") -var rimraf = require("rimraf") - -var common = require("../common-tap.js") - -var pkg = resolve(__dirname, "gently-rm-linked") -var dep = resolve(__dirname, "test-linked") -var glb = resolve(__dirname, "test-global") -var lnk = resolve(__dirname, "test-global-link") - -var EXEC_OPTS = { - cwd : pkg -} - - -var index = "module.exports = function () { console.log('whoop whoop') }" - -var fixture = { - name: "@test/linked", - version: "1.0.0", - bin: { - linked: "./index.js" - } -} - -test("setup", function (t) { - cleanup() - setup() - - t.end() -}) - -test("install and link", function (t) { - common.npm( - [ - "--global", - "--prefix", lnk, - "--loglevel", "silent", - "install", "../test-linked" - ], - EXEC_OPTS, - function (er, code, stdout, stderr) { - t.ifError(er, "test-linked install didn't explode") - t.notOk(code, "test-linked install also failed") - t.notOk(stderr, "no log output") - - verify(t, stdout) - - // again, to make sure unlinking works properlyt - common.npm( - [ - "--global", - "--prefix", lnk, - "--loglevel", "silent", - "install", "../test-linked" - ], - EXEC_OPTS, - function (er, code, stdout, stderr) { - t.ifError(er, "test-linked install didn't explode") - t.notOk(code, "test-linked install also failed") - t.notOk(stderr, "no log output") - - verify(t, stdout) - - fs.readdir(pkg, function (er, files) { - t.ifError(er, "package directory is still there") - t.deepEqual(files, ["node_modules"], "only stub modules dir remains") - - t.end() - }) - } - ) - } - ) -}) - -test("cleanup", function (t) { - cleanup() - - t.end() -}) - -function verify (t, stdout) { - var binPath = resolve(lnk, "bin", "linked") - var pkgPath = resolve(lnk, "lib", "node_modules", "@test", "linked") - var trgPath = resolve(pkgPath, "index.js") - t.equal( - stdout, - binPath+" -> "+trgPath+"\n@test/linked@1.0.0 "+pkgPath+"\n", - "got expected install output" - ) -} - -function cleanup () { - rimraf.sync(pkg) - rimraf.sync(dep) - rimraf.sync(lnk) - rimraf.sync(glb) -} - -function setup () { - mkdirp.sync(pkg) - mkdirp.sync(glb) - fs.symlinkSync(glb, lnk) - // so it doesn't try to install into npm's own node_modules - mkdirp.sync(resolve(pkg, "node_modules")) - mkdirp.sync(dep) - fs.writeFileSync(resolve(dep, "package.json"), JSON.stringify(fixture)) - fs.writeFileSync(resolve(dep, "index.js"), index) -} diff --git a/deps/npm/test/tap/gently-rm-symlinked-global-dir.js b/deps/npm/test/tap/gently-rm-symlinked-global-dir.js new file mode 100644 index 00000000000000..93ed3edaa45899 --- /dev/null +++ b/deps/npm/test/tap/gently-rm-symlinked-global-dir.js @@ -0,0 +1,117 @@ +var resolve = require('path').resolve +var fs = require('graceful-fs') +var test = require('tap').test +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') + +var common = require('../common-tap.js') + +var pkg = resolve(__dirname, 'gently-rm-linked') +var dep = resolve(__dirname, 'test-linked') +var glb = resolve(__dirname, 'test-global') +var lnk = resolve(__dirname, 'test-global-link') + +var EXEC_OPTS = { cwd: pkg } + +var index = "module.exports = function () { console.log('whoop whoop') }" + +var fixture = { + name: '@test/linked', + version: '1.0.0', + bin: { + linked: './index.js' + } +} + +test('setup', function (t) { + cleanup() + setup() + + t.end() +}) + +test('install and link', function (t) { + common.npm( + [ + '--global', + '--prefix', lnk, + '--loglevel', 'silent', + 'install', '../test-linked' + ], + EXEC_OPTS, + function (er, code, stdout, stderr) { + t.ifError(er, "test-linked install didn't explode") + t.notOk(code, 'test-linked install also failed') + t.notOk(stderr, 'no log output') + + verify(t, stdout) + + // again, to make sure unlinking works properlyt + common.npm( + [ + '--global', + '--prefix', lnk, + '--loglevel', 'silent', + 'install', '../test-linked' + ], + EXEC_OPTS, + function (er, code, stdout, stderr) { + t.ifError(er, "test-linked install didn't explode") + t.notOk(code, 'test-linked install also failed') + t.notOk(stderr, 'no log output') + + verify(t, stdout) + + fs.readdir(pkg, function (er, files) { + t.ifError(er, 'package directory is still there') + t.deepEqual(files, ['node_modules'], 'only stub modules dir remains') + + t.end() + }) + } + ) + } + ) +}) + +test('cleanup', function (t) { + cleanup() + + t.end() +}) + +function removeBlank (line) { + return line !== '' +} + +function verify (t, stdout) { + var binPath = resolve(lnk, 'bin', 'linked') + var pkgPath = resolve(lnk, 'lib', 'node_modules', '@test', 'linked') + var trgPath = resolve(pkgPath, 'index.js') + t.deepEqual( + stdout.split('\n').filter(removeBlank), + [ binPath + ' -> ' + trgPath, + resolve(lnk, 'lib'), + '└── @test/linked@1.0.0 ' + ], + 'got expected install output' + ) +} + +function cleanup () { + rimraf.sync(pkg) + rimraf.sync(dep) + rimraf.sync(lnk) + rimraf.sync(glb) +} + +function setup () { + mkdirp.sync(pkg) + mkdirp.sync(glb) + fs.symlinkSync(glb, lnk) + // so it doesn't try to install into npm's own node_modules + mkdirp.sync(resolve(pkg, 'node_modules')) + mkdirp.sync(dep) + fs.writeFileSync(resolve(dep, 'package.json'), JSON.stringify(fixture)) + fs.writeFileSync(resolve(dep, 'index.js'), index) +} diff --git a/deps/npm/test/tap/get.js b/deps/npm/test/tap/get.js index 983243025b274d..62bb05fda7622e 100644 --- a/deps/npm/test/tap/get.js +++ b/deps/npm/test/tap/get.js @@ -1,52 +1,50 @@ -var common = require("../common-tap.js") -var test = require("tap").test -var cacheFile = require("npm-cache-filename") -var npm = require("../../") -var mkdirp = require("mkdirp") -var rimraf = require("rimraf") -var path = require("path") -var mr = require("npm-registry-mock") -var fs = require("graceful-fs") +var common = require('../common-tap.js') +var test = require('tap').test +var cacheFile = require('npm-cache-filename') +var npm = require('../../') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var path = require('path') +var mr = require('npm-registry-mock') +var fs = require('graceful-fs') function nop () {} -var URI = "https://npm.registry:8043/rewrite" -var TIMEOUT = 3600 -var FOLLOW = false +var URI = 'https://npm.registry:8043/rewrite' +var TIMEOUT = 3600 +var FOLLOW = false var STALE_OK = true -var TOKEN = "lolbutts" -var AUTH = { - token : TOKEN +var TOKEN = 'lolbutts' +var AUTH = { token: TOKEN } +var PARAMS = { + timeout: TIMEOUT, + follow: FOLLOW, + staleOk: STALE_OK, + auth: AUTH } -var PARAMS = { - timeout : TIMEOUT, - follow : FOLLOW, - staleOk : STALE_OK, - auth : AUTH -} -var PKG_DIR = path.resolve(__dirname, "get-basic") -var CACHE_DIR = path.resolve(PKG_DIR, "cache") +var PKG_DIR = path.resolve(__dirname, 'get-basic') +var CACHE_DIR = path.resolve(PKG_DIR, 'cache') var BIGCO_SAMPLE = { - name : "@bigco/sample", - version : "1.2.3" + name: '@bigco/sample', + version: '1.2.3' } // mock server reference var server var mocks = { - "get": { - "/@bigco%2fsample/1.2.3" : [200, BIGCO_SAMPLE] + 'get': { + '/@bigco%2fsample/1.2.3': [200, BIGCO_SAMPLE] } } var mapper = cacheFile(CACHE_DIR) function getCachePath (uri) { - return path.join(mapper(uri), ".cache.json") + return path.join(mapper(uri), '.cache.json') } -test("setup", function (t) { +test('setup', function (t) { mkdirp.sync(CACHE_DIR) mr({port: common.port, mocks: mocks}, function (er, s) { @@ -59,66 +57,66 @@ test("setup", function (t) { }) }) -test("get call contract", function (t) { +test('get call contract', function (t) { t.throws(function () { npm.registry.get(undefined, PARAMS, nop) - }, "requires a URI") + }, 'requires a URI') t.throws(function () { npm.registry.get([], PARAMS, nop) - }, "requires URI to be a string") + }, 'requires URI to be a string') t.throws(function () { npm.registry.get(URI, undefined, nop) - }, "requires params object") + }, 'requires params object') t.throws(function () { - npm.registry.get(URI, "", nop) - }, "params must be object") + npm.registry.get(URI, '', nop) + }, 'params must be object') t.throws(function () { npm.registry.get(URI, PARAMS, undefined) - }, "requires callback") + }, 'requires callback') t.throws(function () { - npm.registry.get(URI, PARAMS, "callback") - }, "callback must be function") + npm.registry.get(URI, PARAMS, 'callback') + }, 'callback must be function') t.end() }) -test("basic request", function (t) { +test('basic request', function (t) { t.plan(9) - var versioned = common.registry + "/underscore/1.3.3" + var versioned = common.registry + '/underscore/1.3.3' npm.registry.get(versioned, PARAMS, function (er, data) { - t.ifError(er, "loaded specified version underscore data") - t.equal(data.version, "1.3.3") + t.ifError(er, 'loaded specified version underscore data') + t.equal(data.version, '1.3.3') fs.stat(getCachePath(versioned), function (er) { - t.ifError(er, "underscore 1.3.3 cache data written") + t.ifError(er, 'underscore 1.3.3 cache data written') }) }) - var rollup = common.registry + "/underscore" + var rollup = common.registry + '/underscore' npm.registry.get(rollup, PARAMS, function (er, data) { - t.ifError(er, "loaded all metadata") - t.deepEqual(data.name, "underscore") + t.ifError(er, 'loaded all metadata') + t.deepEqual(data.name, 'underscore') fs.stat(getCachePath(rollup), function (er) { - t.ifError(er, "underscore rollup cache data written") + t.ifError(er, 'underscore rollup cache data written') }) }) - var scoped = common.registry + "/@bigco%2fsample/1.2.3" + var scoped = common.registry + '/@bigco%2fsample/1.2.3' npm.registry.get(scoped, PARAMS, function (er, data) { - t.ifError(er, "loaded all metadata") - t.equal(data.name, "@bigco/sample") + t.ifError(er, 'loaded all metadata') + t.equal(data.name, '@bigco/sample') fs.stat(getCachePath(scoped), function (er) { - t.ifError(er, "scoped cache data written") + t.ifError(er, 'scoped cache data written') }) }) }) -test("cleanup", function (t) { +test('cleanup', function (t) { server.close() rimraf.sync(PKG_DIR) diff --git a/deps/npm/test/tap/gist-short-shortcut.js b/deps/npm/test/tap/gist-short-shortcut.js index 57f2006b7a3f51..58dcf78e8d2229 100644 --- a/deps/npm/test/tap/gist-short-shortcut.js +++ b/deps/npm/test/tap/gist-short-shortcut.js @@ -39,7 +39,7 @@ test('gist-shortcut', function (t) { } else { t.fail('too many attempts to clone') } - cb(new Error()) + cb(new Error('execFile mock fails on purpose')) }) } } diff --git a/deps/npm/test/tap/git-cache-no-hooks.js b/deps/npm/test/tap/git-cache-no-hooks.js index 32731fa1b0164f..cfc2d1dc62f011 100644 --- a/deps/npm/test/tap/git-cache-no-hooks.js +++ b/deps/npm/test/tap/git-cache-no-hooks.js @@ -1,63 +1,62 @@ -var test = require("tap").test - , fs = require("fs") - , path = require("path") - , rimraf = require("rimraf") - , mkdirp = require("mkdirp") - , spawn = require("child_process").spawn - , npmCli = require.resolve("../../bin/npm-cli.js") - , node = process.execPath - , pkg = path.resolve(__dirname, "git-cache-no-hooks") - , tmp = path.join(pkg, "tmp") - , cache = path.join(pkg, "cache") - - -test("setup", function (t) { +var test = require('tap').test +var fs = require('fs') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var spawn = require('child_process').spawn +var npmCli = require.resolve('../../bin/npm-cli.js') +var node = process.execPath +var pkg = path.resolve(__dirname, 'git-cache-no-hooks') +var tmp = path.join(pkg, 'tmp') +var cache = path.join(pkg, 'cache') + +test('setup', function (t) { rimraf.sync(pkg) mkdirp.sync(pkg) mkdirp.sync(cache) mkdirp.sync(tmp) - mkdirp.sync(path.resolve(pkg, "node_modules")) + mkdirp.sync(path.resolve(pkg, 'node_modules')) t.end() }) -test("git-cache-no-hooks: install a git dependency", function (t) { - +test('git-cache-no-hooks: install a git dependency', function (t) { // disable git integration tests on Travis. if (process.env.TRAVIS) return t.end() - var command = [ npmCli - , "install" - , "git://github.com/nigelzor/npm-4503-a.git" - ] + var command = [ + npmCli, + 'install', + 'git://github.com/nigelzor/npm-4503-a.git' + ] var child = spawn(node, command, { cwd: pkg, env: { - "npm_config_cache" : cache, - "npm_config_tmp" : tmp, - "npm_config_prefix" : pkg, - "npm_config_global" : "false", - "npm_config_umask" : "00", - HOME : process.env.HOME, - Path : process.env.PATH, - PATH : process.env.PATH + 'npm_config_cache': cache, + 'npm_config_tmp': tmp, + 'npm_config_prefix': pkg, + 'npm_config_global': 'false', + 'npm_config_umask': '00', + HOME: process.env.HOME, + Path: process.env.PATH, + PATH: process.env.PATH }, - stdio: "inherit" + stdio: 'inherit' }) - child.on("close", function (code) { - t.equal(code, 0, "npm install should succeed") + child.on('close', function (code) { + t.equal(code, 0, 'npm install should succeed') // verify permissions on git hooks - var repoDir = "git-github.1485827954.workers.dev-nigelzor-npm-4503-a-git-40c5cb24" - var hooksPath = path.join(cache, "_git-remotes", repoDir, "hooks") + var repoDir = 'git-github.1485827954.workers.dev-nigelzor-npm-4503-a-git-40c5cb24' + var hooksPath = path.join(cache, '_git-remotes', repoDir, 'hooks') fs.readdir(hooksPath, function (err) { - t.equal(err && err.code, "ENOENT", "hooks are not brought along with repo") + t.equal(err && err.code, 'ENOENT', 'hooks are not brought along with repo') t.end() }) }) }) -test("cleanup", function (t) { +test('cleanup', function (t) { rimraf.sync(pkg) t.end() }) diff --git a/deps/npm/test/tap/git-dependency-install-link.js b/deps/npm/test/tap/git-dependency-install-link.js index cbb256d983d0f0..8af1b853ad4a6e 100644 --- a/deps/npm/test/tap/git-dependency-install-link.js +++ b/deps/npm/test/tap/git-dependency-install-link.js @@ -39,7 +39,6 @@ var pjChild = JSON.stringify({ version: '1.0.3' }, null, 2) + '\n' - test('setup', function (t) { bootstrap() setup(function (er, r) { @@ -124,47 +123,48 @@ function setup (cb) { prefix: pkg, loglevel: 'silent' }, function () { - git = require('../../lib/utils/git.js') - - function startDaemon (cb) { - // start git server - var d = git.spawn( - [ - 'daemon', - '--verbose', - '--listen=localhost', - '--export-all', - '--base-path=.', - '--port=1234' - ], - { - cwd: pkg, - env: process.env, - stdio: ['pipe', 'pipe', 'pipe'] - } - ) - d.stderr.on('data', childFinder) - - function childFinder (c) { - var cpid = c.toString().match(/^\[(\d+)\]/) - if (cpid[1]) { - this.removeListener('data', childFinder) - cb(null, [d, cpid[1]]) - } + git = require('../../lib/utils/git.js') + + function startDaemon (cb) { + // start git server + var d = git.spawn( + [ + 'daemon', + '--verbose', + '--listen=localhost', + '--export-all', + '--base-path=.', + '--reuseaddr', + '--port=1234' + ], + { + cwd: pkg, + env: process.env, + stdio: ['pipe', 'pipe', 'pipe'] + } + ) + d.stderr.on('data', childFinder) + + function childFinder (c) { + var cpid = c.toString().match(/^\[(\d+)\]/) + if (cpid[1]) { + this.removeListener('data', childFinder) + cb(null, [d, cpid[1]]) } } + } - common.makeGitRepo({ - path: repo, - commands: [ - git.chainableExec( - ['clone', '--bare', repo, 'child.git'], - { cwd: pkg, env: process.env } - ), - startDaemon - ] - }, cb) - }) + common.makeGitRepo({ + path: repo, + commands: [ + git.chainableExec( + ['clone', '--bare', repo, 'child.git'], + { cwd: pkg, env: process.env } + ), + startDaemon + ] + }, cb) + }) } function cleanup () { diff --git a/deps/npm/test/tap/git-npmignore.js b/deps/npm/test/tap/git-npmignore.js index 5e915a706faea7..4cd98987225f4b 100644 --- a/deps/npm/test/tap/git-npmignore.js +++ b/deps/npm/test/tap/git-npmignore.js @@ -1,62 +1,59 @@ -var cat = require("graceful-fs").writeFileSync -var exec = require("child_process").exec -var readdir = require("graceful-fs").readdirSync -var resolve = require("path").resolve - -var mkdirp = require("mkdirp") -var rimraf = require("rimraf") -var test = require("tap").test -var tmpdir = require("osenv").tmpdir -var which = require("which") - -var common = require("../common-tap.js") - -var pkg = resolve(__dirname, "git-npmignore") -var dep = resolve(pkg, "deps", "gitch") -var packname = "gitch-1.0.0.tgz" +var cat = require('graceful-fs').writeFileSync +var exec = require('child_process').exec +var readdir = require('graceful-fs').readdirSync +var resolve = require('path').resolve + +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test +var tmpdir = require('osenv').tmpdir +var which = require('which') + +var common = require('../common-tap.js') + +var pkg = resolve(__dirname, 'git-npmignore') +var dep = resolve(pkg, 'deps', 'gitch') +var packname = 'gitch-1.0.0.tgz' var packed = resolve(pkg, packname) -var modules = resolve(pkg, "node_modules") -var installed = resolve(modules, "gitch") +var modules = resolve(pkg, 'node_modules') +var installed = resolve(modules, 'gitch') var expected = [ - "a.js", - "package.json", - ".npmignore" + 'a.js', + 'package.json', + '.npmignore' ].sort() -var EXEC_OPTS = { - cwd : pkg -} +var EXEC_OPTS = { cwd: pkg } -var gitignore = "node_modules/\n" -var npmignore = "t.js\n" +var gitignore = 'node_modules/\n' +var npmignore = 't.js\n' var a = "console.log('hi');" var t = "require('tap').test(function (t) { t.pass('I am a test!'); t.end(); });" var fixture = { - "name" : "gitch", - "version" : "1.0.0", - "private" : true, - "main" : "a.js" + 'name': 'gitch', + 'version': '1.0.0', + 'private': true, + 'main': 'a.js' } - -test("setup", function (t) { +test('setup', function (t) { setup(function (er) { - t.ifError(er, "setup ran OK") + t.ifError(er, 'setup ran OK') t.end() }) }) -test("npm pack directly from directory", function (t) { +test('npm pack directly from directory', function (t) { packInstallTest(dep, t) }) -test("npm pack via git", function (t) { - packInstallTest("git+file://"+dep, t) +test('npm pack via git', function (t) { + packInstallTest('git+file://' + dep, t) }) -test("cleanup", function (t) { +test('cleanup', function (t) { cleanup() t.end() @@ -65,29 +62,29 @@ test("cleanup", function (t) { function packInstallTest (spec, t) { common.npm( [ - "--loglevel", "silent", - "pack", spec + '--loglevel', 'silent', + 'pack', spec ], EXEC_OPTS, function (err, code, stdout, stderr) { - t.ifError(err, "npm pack ran without error") - t.notOk(code, "npm pack exited cleanly") - t.notOk(stderr, "npm pack ran silently") - t.equal(stdout.trim(), packname, "got expected package name") + t.ifError(err, 'npm pack ran without error') + t.notOk(code, 'npm pack exited cleanly') + t.notOk(stderr, 'npm pack ran silently') + t.equal(stdout.trim(), packname, 'got expected package name') common.npm( [ - "--loglevel", "silent", - "install", packed + '--loglevel', 'silent', + 'install', packed ], EXEC_OPTS, function (err, code, stdout, stderr) { - t.ifError(err, "npm install ran without error") - t.notOk(code, "npm install exited cleanly") - t.notOk(stderr, "npm install ran silently") + t.ifError(err, 'npm install ran without error') + t.notOk(code, 'npm install exited cleanly') + t.notOk(stderr, 'npm install ran silently') var actual = readdir(installed).sort() - t.same(actual, expected, "no unexpected files in packed directory") + t.same(actual, expected, 'no unexpected files in packed directory') rimraf(packed, function () { t.end() @@ -111,59 +108,59 @@ function setup (cb) { process.chdir(dep) - cat(resolve(dep, ".npmignore"), npmignore) - cat(resolve(dep, ".gitignore"), gitignore) - cat(resolve(dep, "a.js"), a) - cat(resolve(dep, "t.js"), t) - cat(resolve(dep, "package.json"), JSON.stringify(fixture)) + cat(resolve(dep, '.npmignore'), npmignore) + cat(resolve(dep, '.gitignore'), gitignore) + cat(resolve(dep, 'a.js'), a) + cat(resolve(dep, 't.js'), t) + cat(resolve(dep, 'package.json'), JSON.stringify(fixture)) common.npm( [ - "--loglevel", "silent", - "cache", "clean" + '--loglevel', 'silent', + 'cache', 'clean' ], EXEC_OPTS, function (er, code, _, stderr) { if (er) return cb(er) - if (code) return cb(new Error("npm cache nonzero exit: "+code)) - if (stderr) return cb(new Error("npm cache clean error: "+stderr)) + if (code) return cb(new Error('npm cache nonzero exit: ' + code)) + if (stderr) return cb(new Error('npm cache clean error: ' + stderr)) - which("git", function found (er, git) { + which('git', function found (er, git) { if (er) return cb(er) - exec(git+" init", init) + exec(git + ' init', init) function init (er, _, stderr) { if (er) return cb(er) - if (stderr) return cb(new Error("git init error: "+stderr)) + if (stderr) return cb(new Error('git init error: ' + stderr)) - exec(git+" config user.name 'Phantom Faker'", user) + exec(git + " config user.name 'Phantom Faker'", user) } function user (er, _, stderr) { if (er) return cb(er) - if (stderr) return cb(new Error("git config error: "+stderr)) + if (stderr) return cb(new Error('git config error: ' + stderr)) - exec(git+" config user.email nope@not.real", email) + exec(git + ' config user.email nope@not.real', email) } function email (er, _, stderr) { if (er) return cb(er) - if (stderr) return cb(new Error("git config error: "+stderr)) + if (stderr) return cb(new Error('git config error: ' + stderr)) - exec(git+" add .", addAll) + exec(git + ' add .', addAll) } function addAll (er, _, stderr) { if (er) return cb(er) - if (stderr) return cb(new Error("git add . error: "+stderr)) + if (stderr) return cb(new Error('git add . error: ' + stderr)) - exec(git+" commit -m boot", commit) + exec(git + ' commit -m boot', commit) } function commit (er, _, stderr) { if (er) return cb(er) - if (stderr) return cb(new Error("git commit error: "+stderr)) + if (stderr) return cb(new Error('git commit error: ' + stderr)) cb() } diff --git a/deps/npm/test/tap/github-shortcut.js b/deps/npm/test/tap/github-shortcut.js index 598aa686446c9b..1b01de4cff1db9 100644 --- a/deps/npm/test/tap/github-shortcut.js +++ b/deps/npm/test/tap/github-shortcut.js @@ -25,8 +25,8 @@ test('setup', function (t) { test('github-shortcut', function (t) { var cloneUrls = [ ['git://github.com/foo/private.git', 'GitHub shortcuts try git URLs first'], - ['https://github.com/foo/private.git', 'GitHub shortcuts try HTTPS URLs third'], - ['git@github.com:foo/private.git', 'GitHub shortcuts try SSH second'] + ['https://github.com/foo/private.git', 'GitHub shortcuts try HTTPS URLs second'], + ['git@github.com:foo/private.git', 'GitHub shortcuts try SSH third'] ] var npm = requireInject.installGlobally('../../lib/npm.js', { 'child_process': { @@ -39,7 +39,7 @@ test('github-shortcut', function (t) { } else { t.fail('too many attempts to clone') } - cb(new Error()) + cb(new Error('execFile mock fails on purpose')) }) } } @@ -51,10 +51,10 @@ test('github-shortcut', function (t) { registry: common.registry, loglevel: 'silent' } + t.plan(1 + cloneUrls.length) npm.load(opts, function (er) { t.ifError(er, 'npm loaded without error') npm.commands.install(['foo/private'], function (er, result) { - t.ok(er, 'mocked install failed as expected') t.end() }) }) diff --git a/deps/npm/test/tap/gitlab-shortcut-package.js b/deps/npm/test/tap/gitlab-shortcut-package.js index 657808447174cf..76cd7f911bb277 100644 --- a/deps/npm/test/tap/gitlab-shortcut-package.js +++ b/deps/npm/test/tap/gitlab-shortcut-package.js @@ -27,8 +27,8 @@ test('setup', function (t) { test('gitlab-shortcut-package', function (t) { var cloneUrls = [ - ['git@gitlab.com:foo/private.git', 'GitLab shortcuts try SSH first'], - ['https://gitlab.com/foo/private.git', 'GitLab shortcuts try HTTPS URLs second'] + ['https://gitlab.com/foo/private.git', 'GitLab shortcuts try HTTPS URLs second'], + ['git@gitlab.com:foo/private.git', 'GitLab shortcuts try SSH first'] ] var npm = requireInject.installGlobally('../../lib/npm.js', { 'child_process': { diff --git a/deps/npm/test/tap/gitlab-shortcut.js b/deps/npm/test/tap/gitlab-shortcut.js index 4a1e2b0bb17144..96da268ee03c05 100644 --- a/deps/npm/test/tap/gitlab-shortcut.js +++ b/deps/npm/test/tap/gitlab-shortcut.js @@ -24,8 +24,8 @@ test('setup', function (t) { test('gitlab-shortcut', function (t) { var cloneUrls = [ - ['git@gitlab.com:foo/private.git', 'GitLab shortcuts try SSH first'], - ['https://gitlab.com/foo/private.git', 'GitLab shortcuts try HTTPS URLs second'] + ['https://gitlab.com/foo/private.git', 'GitLab shortcuts try HTTPS URLs second'], + ['git@gitlab.com:foo/private.git', 'GitLab shortcuts try SSH first'] ] var npm = requireInject.installGlobally('../../lib/npm.js', { 'child_process': { @@ -38,7 +38,7 @@ test('gitlab-shortcut', function (t) { } else { t.fail('too many attempts to clone') } - cb(new Error()) + cb(new Error('execFile mock fails on purpose')) }) } } diff --git a/deps/npm/test/tap/global-prefix-set-in-userconfig.js b/deps/npm/test/tap/global-prefix-set-in-userconfig.js index f820a27727d8ef..422bcb2477ec63 100644 --- a/deps/npm/test/tap/global-prefix-set-in-userconfig.js +++ b/deps/npm/test/tap/global-prefix-set-in-userconfig.js @@ -1,36 +1,36 @@ -var common = require("../common-tap.js") -var test = require("tap").test -var rimraf = require("rimraf") -var prefix = __filename.replace(/\.js$/, "") -var rcfile = __filename.replace(/\.js$/, ".npmrc") -var fs = require("fs") -var conf = "prefix = " + prefix + "\n" +var common = require('../common-tap.js') +var test = require('tap').test +var rimraf = require('rimraf') +var prefix = __filename.replace(/\.js$/, '') +var rcfile = __filename.replace(/\.js$/, '.npmrc') +var fs = require('fs') +var conf = 'prefix = ' + prefix + '\n' -test("setup", function (t) { +test('setup', function (t) { rimraf.sync(prefix) fs.writeFileSync(rcfile, conf) - t.pass("ready") + t.pass('ready') t.end() }) -test("run command", function (t) { - var args = ["prefix", "-g", "--userconfig=" + rcfile] +test('run command', function (t) { + var args = ['prefix', '-g', '--userconfig=' + rcfile] common.npm(args, {env: {}}, function (er, code, so) { if (er) throw er - t.notOk(code, "npm prefix exited with code 0") + t.notOk(code, 'npm prefix exited with code 0') t.equal(so.trim(), prefix) t.end() }) }) -test("made dir", function (t) { +test('made dir', function (t) { t.ok(fs.statSync(prefix).isDirectory()) t.end() }) -test("cleanup", function (t) { +test('cleanup', function (t) { rimraf.sync(prefix) rimraf.sync(rcfile) - t.pass("clean") + t.pass('clean') t.end() }) diff --git a/deps/npm/test/tap/graceful-restart.js b/deps/npm/test/tap/graceful-restart.js index 53264748056507..21da0d99042d5e 100644 --- a/deps/npm/test/tap/graceful-restart.js +++ b/deps/npm/test/tap/graceful-restart.js @@ -107,8 +107,9 @@ function createChild (args, cb) { 'npm_config_loglevel': 'silent' } - if (process.platform === 'win32') + if (process.platform === 'win32') { env.npm_config_cache = '%APPDATA%\\npm-cache' + } return common.npm(args, { cwd: pkg, diff --git a/deps/npm/test/tap/ignore-install-link.js b/deps/npm/test/tap/ignore-install-link.js index 45db51d30f7bbf..684c6a05b24c09 100644 --- a/deps/npm/test/tap/ignore-install-link.js +++ b/deps/npm/test/tap/ignore-install-link.js @@ -1,68 +1,73 @@ -if (process.platform === "win32") { - console.log("ok - symlinks are weird on windows, skip this test") - return +if (process.platform === 'win32') { + console.log('ok - symlinks are weird on windows, skip this test') + process.exit(0) } -var common = require("../common-tap.js") -var test = require("tap").test -var path = require("path") -var fs = require("fs") -var rimraf = require("rimraf") -var mkdirp = require("mkdirp") +var common = require('../common-tap.js') +var test = require('tap').test +var path = require('path') +var fs = require('fs') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') -var root = path.resolve(__dirname, "ignore-install-link") -var pkg = path.resolve(root, "pkg") -var dep = path.resolve(root, "dep") -var target = path.resolve(pkg, "node_modules", "dep") -var cache = path.resolve(root, "cache") -var globalPath = path.resolve(root, "global") +var root = path.resolve(__dirname, 'ignore-install-link') +var pkg = path.resolve(root, 'pkg') +var dep = path.resolve(root, 'dep') +var target = path.resolve(pkg, 'node_modules', 'dep') +var cache = path.resolve(root, 'cache') +var globalPath = path.resolve(root, 'global') -var pkgj = { "name":"pkg", "version": "1.2.3" - , "dependencies": { "dep": "1.2.3" } } -var depj = { "name": "dep", "version": "1.2.3" } +var pkgj = { + 'name': 'pkg', + 'version': '1.2.3', + 'dependencies': { + 'dep': '1.2.3' + } +} +var depj = { 'name': 'dep', 'version': '1.2.3' } -var myreg = require("http").createServer(function (q, s) { +var myreg = require('http').createServer(function (q, s) { s.statusCode = 403 - s.end(JSON.stringify({"error":"forbidden"}) + "\n") + s.end(JSON.stringify({'error': 'forbidden'}) + '\n') }).listen(common.port) -test("setup", function (t) { +test('setup', function (t) { rimraf.sync(root) mkdirp.sync(root) - mkdirp.sync(path.resolve(pkg, "node_modules")) + mkdirp.sync(path.resolve(pkg, 'node_modules')) mkdirp.sync(dep) mkdirp.sync(cache) mkdirp.sync(globalPath) - fs.writeFileSync(path.resolve(pkg, "package.json"), JSON.stringify(pkgj)) - fs.writeFileSync(path.resolve(dep, "package.json"), JSON.stringify(depj)) - fs.symlinkSync(dep, target, "dir") + fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify(pkgj)) + fs.writeFileSync(path.resolve(dep, 'package.json'), JSON.stringify(depj)) + fs.symlinkSync(dep, target, 'dir') t.end() }) -test("ignore install if package is linked", function (t) { - common.npm(["install"], { +test('ignore install if package is linked', function (t) { + common.npm(['install'], { cwd: pkg, env: { PATH: process.env.PATH || process.env.Path, HOME: process.env.HOME, - "npm_config_prefix": globalPath, - "npm_config_cache": cache, - "npm_config_registry": common.registry, - "npm_config_loglevel": "silent" + 'npm_config_prefix': globalPath, + 'npm_config_cache': cache, + 'npm_config_registry': common.registry, + 'npm_config_loglevel': 'silent' }, - stdio: "inherit" + stdio: 'inherit' }, function (er, code) { if (er) throw er - t.equal(code, 0, "npm install exited with code") + t.equal(code, 0, 'npm install exited with code') t.end() }) }) -test("still a symlink", function (t) { +test('still a symlink', function (t) { t.equal(true, fs.lstatSync(target).isSymbolicLink()) t.end() }) -test("cleanup", function (t) { +test('cleanup', function (t) { rimraf.sync(root) myreg.close() t.end() diff --git a/deps/npm/test/tap/init-interrupt.js b/deps/npm/test/tap/init-interrupt.js index 962ab72444747b..799ff07164675c 100644 --- a/deps/npm/test/tap/init-interrupt.js +++ b/deps/npm/test/tap/init-interrupt.js @@ -1,52 +1,51 @@ -// if "npm init" is interrupted with ^C, don't report -// "init written successfully" -var test = require("tap").test -var path = require("path") -var osenv = require("osenv") -var rimraf = require("rimraf") -var npmlog = require("npmlog") -var requireInject = require("require-inject") +// if 'npm init' is interrupted with ^C, don't report +// 'init written successfully' +var test = require('tap').test +var path = require('path') +var osenv = require('osenv') +var rimraf = require('rimraf') +var npmlog = require('npmlog') +var requireInject = require('require-inject') -var npm = require("../../lib/npm.js") +var npm = require('../../lib/npm.js') -var PKG_DIR = path.resolve(__dirname, "init-interrupt") +var PKG_DIR = path.resolve(__dirname, 'init-interrupt') -test("setup", function (t) { +test('setup', function (t) { cleanup() t.end() }) -test("issue #6684 remove confusing message", function (t) { - +test('issue #6684 remove confusing message', function (t) { var initJsonMock = function (dir, input, config, cb) { process.nextTick(function () { - cb({message : "canceled"}) + cb({ message: 'canceled' }) }) } initJsonMock.yes = function () { return true } - npm.load({loglevel : "silent"}, function () { - var log = "" - var init = requireInject("../../lib/init", { - "init-package-json": initJsonMock + npm.load({ loglevel: 'silent' }, function () { + var log = '' + var init = requireInject('../../lib/init', { + 'init-package-json': initJsonMock }) // capture log messages - npmlog.on("log", function (chunk) { log += chunk.message + "\n" } ) + npmlog.on('log', function (chunk) { log += chunk.message + '\n' }) init([], function (err, code) { - t.ifError(err, "init ran successfully") - t.notOk(code, "exited without issue") - t.notSimilar(log, /written successfully/, "no success message written") - t.similar(log, /canceled/, "alerted that init was canceled") + t.ifError(err, 'init ran successfully') + t.notOk(code, 'exited without issue') + t.notSimilar(log, /written successfully/, 'no success message written') + t.similar(log, /canceled/, 'alerted that init was canceled') t.end() }) }) }) -test("cleanup", function (t) { +test('cleanup', function (t) { cleanup() t.end() diff --git a/deps/npm/test/tap/install-actions.js b/deps/npm/test/tap/install-actions.js new file mode 100644 index 00000000000000..c71b0044e1d603 --- /dev/null +++ b/deps/npm/test/tap/install-actions.js @@ -0,0 +1,108 @@ +'use strict' +var npm = require('../../lib/npm.js') +var log = require('npmlog') +var test = require('tap').test + +var mockLog = { + finish: function () {}, + silly: function () {} +} + +var actions +test('setup', function (t) { + npm.load(function () { + log.disableProgress() + actions = require('../../lib/install/actions.js').actions + t.end() + }) +}) + +test('->optdep:a->dep:b', function (t) { + var moduleA = { + name: 'a', + path: '/', + package: { + scripts: { + postinstall: 'false' + }, + dependencies: { + b: '*' + } + } + } + var moduleB = { + name: 'b', + path: '/', + package: {}, + requires: [], + requiredBy: [moduleA] + } + moduleA.requires = [moduleB] + + var tree = { + path: '/', + package: { + optionalDependencies: { + a: '*' + } + }, + children: [moduleA, moduleB], + requires: [moduleA] + } + moduleA.requiredBy = [tree] + + t.plan(3) + actions.postinstall('/', '/', moduleA, mockLog, function (er) { + t.ok(er && er.code === 'ELIFECYCLE', 'Lifecycle failed') + t.ok(moduleA.failed, 'moduleA (optional dep) is marked failed') + t.ok(moduleB.failed, 'moduleB (direct dep of moduleA) is marked as failed') + t.end() + }) +}) + +test('->dep:b,->optdep:a->dep:b', function (t) { + var moduleA = { + name: 'a', + path: '/', + package: { + scripts: { + postinstall: 'false' + }, + dependencies: { + b: '*' + } + } + } + var moduleB = { + name: 'b', + path: '/', + package: {}, + requires: [], + requiredBy: [moduleA] + } + moduleA.requires = [moduleB] + + var tree = { + path: '/', + package: { + dependencies: { + b: '*' + }, + optionalDependencies: { + a: '*' + } + }, + children: [moduleA, moduleB], + requires: [moduleA, moduleB] + } + moduleA.requiredBy = [tree] + moduleB.requiredBy.push(tree) + + t.plan(3) + actions.postinstall('/', '/', moduleA, mockLog, function (er) { + t.ok(er && er.code === 'ELIFECYCLE', 'Lifecycle failed') + t.ok(moduleA.failed, 'moduleA (optional dep) is marked failed') + t.ok(!moduleB.failed, 'moduleB (direct dep of moduleA) is marked as failed') + t.end() + }) +}) diff --git a/deps/npm/test/tap/install-at-locally.js b/deps/npm/test/tap/install-at-locally.js index 9c5d85980cb325..8745c4d60ecfe8 100644 --- a/deps/npm/test/tap/install-at-locally.js +++ b/deps/npm/test/tap/install-at-locally.js @@ -13,7 +13,7 @@ var pkg = path.join(__dirname, 'install-at-locally') var EXEC_OPTS = { cwd: pkg } var json = { - name: 'install-at-locally', + name: 'install-at-locally-mock', version: '0.0.0' } @@ -25,8 +25,8 @@ test('setup', function (t) { test('\'npm install ./package@1.2.3\' should install local pkg', function (t) { var target = './package@1.2.3' setup(target) - common.npm(['install', target], EXEC_OPTS, function (err, code) { - var p = path.resolve(pkg, 'node_modules/install-at-locally/package.json') + common.npm(['install', '--loglevel=silent', target], EXEC_OPTS, function (err, code) { + var p = path.resolve(pkg, 'node_modules/install-at-locally-mock/package.json') t.ifError(err, 'install local package successful') t.equal(code, 0, 'npm install exited with code') t.ok(JSON.parse(fs.readFileSync(p, 'utf8'))) @@ -38,7 +38,7 @@ test('\'npm install install/at/locally@./package@1.2.3\' should install local pk var target = 'install/at/locally@./package@1.2.3' setup(target) common.npm(['install', target], EXEC_OPTS, function (err, code) { - var p = path.resolve(pkg, 'node_modules/install-at-locally/package.json') + var p = path.resolve(pkg, 'node_modules/install-at-locally-mock/package.json') t.ifError(err, 'install local package in explicit directory successful') t.equal(code, 0, 'npm install exited with code') t.ok(JSON.parse(fs.readFileSync(p, 'utf8'))) diff --git a/deps/npm/test/tap/install-bad-dep-format.js b/deps/npm/test/tap/install-bad-dep-format.js new file mode 100644 index 00000000000000..01d253c9e53e52 --- /dev/null +++ b/deps/npm/test/tap/install-bad-dep-format.js @@ -0,0 +1,58 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var json = { + author: 'John Foo', + name: 'bad-dep-format', + version: '0.0.0', + dependencies: { + 'not-legit': 'npm:not-legit@1.0' + } +} + +test('invalid url format returns appropriate error', function (t) { + setup(json) + common.npm(['install'], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'install ran without error') + t.equals(code, 1, 'inall exited with code 1') + t.match(stderr, + /ERR.*Unsupported URL Type/, + 'Error should report that invalid url-style formats are used') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup (json) { + cleanup() + process.chdir(mkPkg(json)) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + var pkgs = [json] + pkgs.forEach(function (json) { + rimraf.sync(path.resolve(__dirname, json.name)) + }) +} + +function mkPkg (json) { + var pkgPath = path.resolve(__dirname, json.name) + mkdirp.sync(pkgPath) + fs.writeFileSync( + path.join(pkgPath, 'package.json'), + JSON.stringify(json, null, 2) + ) + return pkgPath +} diff --git a/deps/npm/test/tap/install-bad-man.js b/deps/npm/test/tap/install-bad-man.js index 9ec8a84734b755..756b4a5902c151 100644 --- a/deps/npm/test/tap/install-bad-man.js +++ b/deps/npm/test/tap/install-bad-man.js @@ -1,53 +1,52 @@ -var fs = require("fs") -var resolve = require("path").resolve +var fs = require('fs') +var resolve = require('path').resolve -var osenv = require("osenv") -var mkdirp = require("mkdirp") -var rimraf = require("rimraf") -var test = require("tap").test +var osenv = require('osenv') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test -var common = require("../common-tap.js") +var common = require('../common-tap.js') -var pkg = resolve(__dirname, "install-bad-man") -var target = resolve(__dirname, "install-bad-man-target") +var pkg = resolve(__dirname, 'install-bad-man') +var target = resolve(__dirname, 'install-bad-man-target') var EXEC_OPTS = { cwd: target } var json = { - name : "install-bad-man", - version : "1.2.3", - man : [ "./install-bad-man.1.lol" ] + name: 'install-bad-man', + version: '1.2.3', + man: [ './install-bad-man.1.lol' ] } - -test("setup", function (t) { +test('setup', function (t) { setup() - t.pass("setup ran") + t.pass('setup ran') t.end() }) test("install from repo on 'OS X'", function (t) { common.npm( [ - "install", - "--prefix", target, - "--global", + 'install', + '--prefix', target, + '--global', pkg ], EXEC_OPTS, function (err, code, stdout, stderr) { - t.ifError(err, "npm command ran from test") - t.equals(code, 1, "install exited with failure (1)") - t.notOk(stdout, "no output indicating success") + t.ifError(err, 'npm command ran from test') + t.equals(code, 1, 'install exited with failure (1)') + t.notOk(stdout, 'no output indicating success') t.notOk( stderr.match(/Cannot read property '1' of null/), - "no longer has cryptic error output" + 'no longer has cryptic error output' ) t.ok( stderr.match(/install-bad-man\.1\.lol is not a valid name/), - "got expected error output" + 'got expected error output' ) t.end() @@ -55,9 +54,9 @@ test("install from repo on 'OS X'", function (t) { ) }) -test("clean", function (t) { +test('clean', function (t) { cleanup() - t.pass("cleaned up") + t.pass('cleaned up') t.end() }) @@ -65,12 +64,12 @@ function setup () { cleanup() mkdirp.sync(pkg) // make sure it installs locally - mkdirp.sync(resolve(target, "node_modules")) + mkdirp.sync(resolve(target, 'node_modules')) fs.writeFileSync( - resolve(pkg, "package.json"), - JSON.stringify(json, null, 2)+"\n" + resolve(pkg, 'package.json'), + JSON.stringify(json, null, 2) + '\n' ) - fs.writeFileSync(resolve(pkg, "install-bad-man.1.lol"), "lol\n") + fs.writeFileSync(resolve(pkg, 'install-bad-man.1.lol'), 'lol\n') } function cleanup () { diff --git a/deps/npm/test/tap/install-cli-only-development.js b/deps/npm/test/tap/install-cli-only-development.js new file mode 100644 index 00000000000000..ff9d05f547f26a --- /dev/null +++ b/deps/npm/test/tap/install-cli-only-development.js @@ -0,0 +1,115 @@ +var fs = require('graceful-fs') +var path = require('path') +var existsSync = fs.existsSync || path.existsSync + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.join(__dirname, 'install-cli-development') + +var EXEC_OPTS = { cwd: pkg } + +var json = { + name: 'install-cli-development', + description: 'fixture', + version: '0.0.0', + dependencies: { + dependency: 'file:./dependency' + }, + devDependencies: { + 'dev-dependency': 'file:./dev-dependency' + } +} + +var dependency = { + name: 'dependency', + description: 'fixture', + version: '0.0.0' +} + +var devDependency = { + name: 'dev-dependency', + description: 'fixture', + version: '0.0.0' +} + +test('setup', function (t) { + setup() + t.pass('setup ran') + t.end() +}) + +test('\'npm install --only=development\' should only install devDependencies', function (t) { + common.npm(['install', '--only=development'], EXEC_OPTS, function (err, code) { + t.ifError(err, 'install development successful') + t.equal(code, 0, 'npm install did not raise error code') + t.ok( + JSON.parse(fs.readFileSync( + path.resolve(pkg, 'node_modules/dev-dependency/package.json'), 'utf8') + ), + 'devDependency was installed' + ) + t.notOk( + existsSync(path.resolve(pkg, 'node_modules/dependency/package.json')), + 'dependency was NOT installed' + ) + t.end() + }) +}) + +test('\'npm install --only=development\' should only install devDependencies regardless of npm.config.get(\'production\')', function (t) { + cleanup() + setup() + + common.npm(['install', '--only=development', '--production'], EXEC_OPTS, function (err, code) { + t.ifError(err, 'install development successful') + t.equal(code, 0, 'npm install did not raise error code') + t.ok( + JSON.parse(fs.readFileSync( + path.resolve(pkg, 'node_modules/dev-dependency/package.json'), 'utf8') + ), + 'devDependency was installed' + ) + t.notOk( + existsSync(path.resolve(pkg, 'node_modules/dependency/package.json')), + 'dependency was NOT installed' + ) + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.pass('cleaned up') + t.end() +}) + +function setup () { + mkdirp.sync(path.join(pkg, 'dependency')) + fs.writeFileSync( + path.join(pkg, 'dependency', 'package.json'), + JSON.stringify(dependency, null, 2) + ) + + mkdirp.sync(path.join(pkg, 'dev-dependency')) + fs.writeFileSync( + path.join(pkg, 'dev-dependency', 'package.json'), + JSON.stringify(devDependency, null, 2) + ) + + mkdirp.sync(path.join(pkg, 'node_modules')) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + process.chdir(pkg) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/deps/npm/test/tap/install-cli-only-production.js b/deps/npm/test/tap/install-cli-only-production.js new file mode 100644 index 00000000000000..7f46a23e15df89 --- /dev/null +++ b/deps/npm/test/tap/install-cli-only-production.js @@ -0,0 +1,88 @@ +var fs = require('graceful-fs') +var path = require('path') +var existsSync = fs.existsSync || path.existsSync + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.join(__dirname, 'install-cli-only-production') + +var EXEC_OPTS = { cwd: pkg } + +var json = { + name: 'install-cli-only-production', + description: 'fixture', + version: '0.0.0', + scripts: { + prepublish: 'exit 123' + }, + dependencies: { + dependency: 'file:./dependency' + }, + devDependencies: { + 'dev-dependency': 'file:./dev-dependency' + } +} + +var dependency = { + name: 'dependency', + description: 'fixture', + version: '0.0.0' +} + +var devDependency = { + name: 'dev-dependency', + description: 'fixture', + version: '0.0.0' +} + +test('setup', function (t) { + mkdirp.sync(path.join(pkg, 'dependency')) + fs.writeFileSync( + path.join(pkg, 'dependency', 'package.json'), + JSON.stringify(dependency, null, 2) + ) + + mkdirp.sync(path.join(pkg, 'devDependency')) + fs.writeFileSync( + path.join(pkg, 'devDependency', 'package.json'), + JSON.stringify(devDependency, null, 2) + ) + + mkdirp.sync(path.join(pkg, 'node_modules')) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + + process.chdir(pkg) + t.end() +}) + +test('\'npm install --only=production\' should only install dependencies', function (t) { + common.npm(['install', '--only=production'], EXEC_OPTS, function (err, code) { + t.ifError(err, 'install production successful') + t.equal(code, 0, 'npm install did not raise error code') + t.ok( + JSON.parse(fs.readFileSync( + path.resolve(pkg, 'node_modules/dependency/package.json'), 'utf8') + ), + 'dependency was installed' + ) + t.notOk( + existsSync(path.resolve(pkg, 'node_modules/dev-dependency/package.json')), + 'devDependency was NOT installed' + ) + t.end() + }) +}) + +test('cleanup', function (t) { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) + t.end() +}) diff --git a/deps/npm/test/tap/install-cli-production-nosave.js b/deps/npm/test/tap/install-cli-production-nosave.js new file mode 100644 index 00000000000000..cf69ad3fae05db --- /dev/null +++ b/deps/npm/test/tap/install-cli-production-nosave.js @@ -0,0 +1,69 @@ +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') +var server + +var pkg = path.join(__dirname, 'install-cli-production-nosave') + +var EXEC_OPTS = { cwd: pkg } + +var PACKAGE_JSON1 = { + name: 'install-cli-production-nosave', + version: '0.0.1', + dependencies: { + } +} + +test('setup', function (t) { + setup() + mr({ port: common.port }, function (er, s) { + t.ifError(er, 'started mock registry') + server = s + t.end() + }) +}) + +test('install --production without --save exits successfully', function (t) { + common.npm( + [ + '--registry', common.registry, + '--loglevel', 'silent', + 'install', '--production', 'underscore' + ], + EXEC_OPTS, + function (err, code) { + t.ifError(err, 'npm install ran without issue') + t.notOk(code, 'npm install exited with code 0') + t.end() + } + ) +}) + +test('cleanup', function (t) { + server.close() + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} + +function setup () { + cleanup() + mkdirp.sync(path.resolve(pkg, 'node_modules')) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(PACKAGE_JSON1, null, 2) + ) + + process.chdir(pkg) +} diff --git a/deps/npm/test/tap/install-cli-production.js b/deps/npm/test/tap/install-cli-production.js index fbaf23afb48195..a1fdac6e880d5a 100644 --- a/deps/npm/test/tap/install-cli-production.js +++ b/deps/npm/test/tap/install-cli-production.js @@ -47,9 +47,9 @@ test('setup', function (t) { JSON.stringify(dependency, null, 2) ) - mkdirp.sync(path.join(pkg, 'devDependency')) + mkdirp.sync(path.join(pkg, 'dev-dependency')) fs.writeFileSync( - path.join(pkg, 'devDependency', 'package.json'), + path.join(pkg, 'dev-dependency', 'package.json'), JSON.stringify(devDependency, null, 2) ) diff --git a/deps/npm/test/tap/install-into-likenamed-folder.js b/deps/npm/test/tap/install-into-likenamed-folder.js new file mode 100644 index 00000000000000..187d5fbf11bca9 --- /dev/null +++ b/deps/npm/test/tap/install-into-likenamed-folder.js @@ -0,0 +1,44 @@ +'use strict' +var path = require('path') +var fs = require('graceful-fs') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test +var common = require('../common-tap.js') + +var base = path.join(__dirname, path.basename(__filename, '.js')) +var moduleDir = path.join(base, 'example-src') +var destDir = path.join(base, 'example') +var moduleJson = { + name: 'example', + version: '1.0.0' +} + +function setup () { + cleanup() + mkdirp.sync(moduleDir) + mkdirp.sync(path.join(destDir, 'node_modules')) + fs.writeFileSync(path.join(moduleDir, 'package.json'), JSON.stringify(moduleJson)) +} + +function cleanup () { + rimraf.sync(base) +} + +test('setup', function (t) { + setup() + t.end() +}) + +test('like-named', function (t) { + common.npm(['install', '../example-src'], {cwd: destDir}, function (er, code, stdout, stderr) { + t.is(code, 0, 'no error code') + t.is(stderr, '', 'no error output') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) diff --git a/deps/npm/test/tap/install-link-scripts.js b/deps/npm/test/tap/install-link-scripts.js index bd8b9a3e37b858..5ad2feafe85b74 100644 --- a/deps/npm/test/tap/install-link-scripts.js +++ b/deps/npm/test/tap/install-link-scripts.js @@ -122,7 +122,8 @@ function setup () { path.join(dep, 'package.json'), JSON.stringify(dependency, null, 2) ) - fs.writeFileSync(path.join(dep, 'bin', 'foo'), foo, { mode: '0755' }) + fs.writeFileSync(path.join(dep, 'bin', 'foo'), foo) + fs.chmod(path.join(dep, 'bin', 'foo'), '0755') } function cleanup () { diff --git a/deps/npm/test/tap/install-local-dep-cycle.js b/deps/npm/test/tap/install-local-dep-cycle.js new file mode 100644 index 00000000000000..1f76ad9598a2d0 --- /dev/null +++ b/deps/npm/test/tap/install-local-dep-cycle.js @@ -0,0 +1,79 @@ +'use strict' +var path = require('path') +var fs = require('graceful-fs') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test +var common = require('../common-tap.js') + +var base = path.join(__dirname, path.basename(__filename, '.js')) + +var baseJSON = { + name: 'base', + version: '1.0.0', + dependencies: { + a: 'file:a/', + b: 'file:b/' + } +} + +var aPath = path.join(base, 'a') +var aJSON = { + name: 'a', + version: '1.0.0', + dependencies: { + b: 'file:../b', + c: 'file:../c' + } +} + +var bPath = path.join(base, 'b') +var bJSON = { + name: 'b', + version: '1.0.0' +} + +var cPath = path.join(base, 'c') +var cJSON = { + name: 'c', + version: '1.0.0', + dependencies: { + b: 'file:../b' + } +} + +test('setup', function (t) { + cleanup() + setup() + t.end() +}) + +test('install', function (t) { + common.npm(['install'], {cwd: base}, function (er, code, stdout, stderr) { + t.ifError(er, 'npm config ran without issue') + t.is(code, 0, 'exited with a non-error code') + t.is(stderr, '', 'Ran without errors') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function saveJson (pkgPath, json) { + mkdirp.sync(pkgPath) + fs.writeFileSync(path.join(pkgPath, 'package.json'), JSON.stringify(json, null, 2)) +} + +function setup () { + saveJson(base, baseJSON) + saveJson(aPath, aJSON) + saveJson(bPath, bJSON) + saveJson(cPath, cJSON) +} + +function cleanup () { + rimraf.sync(base) +} diff --git a/deps/npm/test/tap/install-man.js b/deps/npm/test/tap/install-man.js index ebba5d87b01100..d309788b25515e 100644 --- a/deps/npm/test/tap/install-man.js +++ b/deps/npm/test/tap/install-man.js @@ -1,48 +1,48 @@ -var fs = require("fs") -var resolve = require("path").resolve +var fs = require('fs') +var resolve = require('path').resolve -var osenv = require("osenv") -var mkdirp = require("mkdirp") -var rimraf = require("rimraf") -var test = require("tap").test +var osenv = require('osenv') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test -var common = require("../common-tap.js") +var common = require('../common-tap.js') -var pkg = resolve(__dirname, "install-man") -var target = resolve(__dirname, "install-man-target") +var pkg = resolve(__dirname, 'install-man') +var target = resolve(__dirname, 'install-man-target') var EXEC_OPTS = { cwd: target } var json = { - name : "install-man", - version : "1.2.3", - man : [ "./install-man.1" ] + name: 'install-man', + version: '1.2.3', + man: [ './install-man.1' ] } -test("setup", function (t) { +test('setup', function (t) { setup() - t.pass("setup ran") + t.pass('setup ran') t.end() }) -test("install man page", function (t) { +test('install man page', function (t) { common.npm( [ - "install", - "--prefix", target, - "--global", + 'install', + '--prefix', target, + '--global', pkg ], EXEC_OPTS, function (err, code, stdout, stderr) { - t.ifError(err, "npm command ran from test") - t.equals(code, 0, "install exited with success (0)") - t.ok(stdout, "output indicating success") + t.ifError(err, 'npm command ran from test') + t.equals(code, 0, 'install exited with success (0)') + t.ok(stdout, 'output indicating success') t.ok( - fs.existsSync(resolve(target, "share", "man", "man1", "install-man.1")), - "man page link was created" + fs.existsSync(resolve(target, 'share', 'man', 'man1', 'install-man.1')), + 'man page link was created' ) t.end() @@ -50,9 +50,9 @@ test("install man page", function (t) { ) }) -test("clean", function (t) { +test('clean', function (t) { cleanup() - t.pass("cleaned up") + t.pass('cleaned up') t.end() }) @@ -60,12 +60,12 @@ function setup () { cleanup() mkdirp.sync(pkg) // make sure it installs locally - mkdirp.sync(resolve(target, "node_modules")) + mkdirp.sync(resolve(target, 'node_modules')) fs.writeFileSync( - resolve(pkg, "package.json"), - JSON.stringify(json, null, 2)+"\n" + resolve(pkg, 'package.json'), + JSON.stringify(json, null, 2) + '\n' ) - fs.writeFileSync(resolve(pkg, "install-man.1"), "THIS IS A MANPAGE\n") + fs.writeFileSync(resolve(pkg, 'install-man.1'), 'THIS IS A MANPAGE\n') } function cleanup () { diff --git a/deps/npm/test/tap/install-order.js b/deps/npm/test/tap/install-order.js new file mode 100644 index 00000000000000..c1c4e9dca61f9f --- /dev/null +++ b/deps/npm/test/tap/install-order.js @@ -0,0 +1,37 @@ +'use strict' +var test = require('tap').test +var sortActions = require('../../lib/install/diff-trees.js').sortActions + +var a = { + package: {_location: '/a', _requiredBy: []} +} +var b = { + package: {_location: '/b', _requiredBy: []} +} +var c = { + package: {_location: '/c', _requiredBy: ['/a', '/b']} +} + +test('install-order when installing deps', function (t) { + var plain = [ + ['add', a], + ['add', b], + ['add', c]] + var sorted = [ + ['add', c], + ['add', a], + ['add', b]] + t.isDeeply(sortActions(plain), sorted) + t.end() +}) + +test('install-order when not installing deps', function (t) { + var plain = [ + ['add', a], + ['add', b]] + var sorted = [ + ['add', a], + ['add', b]] + t.isDeeply(sortActions(plain), sorted) + t.end() +}) diff --git a/deps/npm/test/tap/install-package-json-order.js b/deps/npm/test/tap/install-package-json-order.js new file mode 100644 index 00000000000000..93977c6c3dc441 --- /dev/null +++ b/deps/npm/test/tap/install-package-json-order.js @@ -0,0 +1,62 @@ +var test = require('tap').test +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var spawn = require('child_process').spawn +var npm = require.resolve('../../bin/npm-cli.js') +var node = process.execPath +var pkg = path.resolve(__dirname, 'install-package-json-order') +var workdir = path.join(pkg, 'workdir') +var tmp = path.join(pkg, 'tmp') +var cache = path.join(pkg, 'cache') +var fs = require('fs') +var osenv = require('osenv') + +test('package.json sorting after install', function (t) { + var packageJson = path.resolve(pkg, 'package.json') + var installedPackage = path.resolve(workdir, + 'node_modules/install-package-json-order/package.json') + + cleanup() + mkdirp.sync(cache) + mkdirp.sync(tmp) + mkdirp.sync(workdir) + setup() + + var before = JSON.parse(fs.readFileSync(packageJson).toString()) + var child = spawn(node, [npm, 'install', pkg], { cwd: workdir }) + + child.on('close', function (code) { + t.equal(code, 0, 'npm install exited with code') + var result = fs.readFileSync(installedPackage, 'utf8') + var resultAsJson = JSON.parse(result) + t.same(resultAsJson.array, before.array) + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.pass('cleaned up') + t.end() +}) + +function setup () { + mkdirp.sync(pkg) + + fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({ + 'name': 'install-package-json-order', + 'version': '0.0.0', + 'array': [ 'one', 'two', 'three' ] + }, null, 2), 'utf8') + fs.writeFileSync(path.resolve(workdir, 'package.json'), JSON.stringify({ + 'name': 'install-package-json-order-work', + 'version': '0.0.0' + }, null, 2), 'utf8') +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(cache) + rimraf.sync(pkg) +} diff --git a/deps/npm/test/tap/install-report-just-installed.js b/deps/npm/test/tap/install-report-just-installed.js new file mode 100644 index 00000000000000..fb3bc65dbdbe44 --- /dev/null +++ b/deps/npm/test/tap/install-report-just-installed.js @@ -0,0 +1,76 @@ +'use strict' +var path = require('path') +var test = require('tap').test +var Tacks = require('tacks') +var Dir = Tacks.Dir +var File = Tacks.File +var common = require('../common-tap.js') + +var testdir = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixture = new Tacks(Dir({ + node_modules: Dir({ + a: Dir({ + 'package.json': File({ + name: 'a', + version: '1.0.0', + dependencies: { + b: '1.0.0' + } + }), + node_modules: Dir({ + b: Dir({ + 'package.json': File({ + name: 'b', + version: '1.0.0' + }) + }) + }) + }) + }), + 'b-src': Dir({ + 'package.json': File({ + name: 'b', + version: '1.0.0' + }) + }) +})) + +function setup () { + cleanup() + fixture.create(testdir) +} + +function cleanup () { + fixture.remove(testdir) +} + +test('setup', function (t) { + setup() + t.end() +}) + +test('install-report', function (t) { + common.npm(['install', '--json', 'b-src'], {cwd: testdir}, function (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'installed successfully') + t.is(stderr, '', 'no warnings') + try { + var report = JSON.parse(stdout) + t.pass('stdout was json') + } catch (ex) { + t.fail('stdout was json') + console.error(ex) + t.skip(2) + return t.end() + } + var depNames = Object.keys(report.dependencies) + t.is(depNames.length, 1, 'one dependency reported as installed') + t.ok(report.dependencies.b, 'that dependency was `b`') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) diff --git a/deps/npm/test/tap/install-save-local.js b/deps/npm/test/tap/install-save-local.js index 33a1c613f19412..a9de5ba1941823 100644 --- a/deps/npm/test/tap/install-save-local.js +++ b/deps/npm/test/tap/install-save-local.js @@ -51,9 +51,9 @@ test('\'npm install --save ../local/path\' should save to package.json', functio t.ok(JSON.parse(fs.readFileSync(dependencyPackageJson, 'utf8'))) var pkgJson = JSON.parse(fs.readFileSync(pkg + '/package.json', 'utf8')) - t.deepEqual( - pkgJson.dependencies, - { 'package-local-dependency': 'file:../package-local-dependency' }, + t.is(Object.keys(pkgJson.dependencies).length, 1, 'only one dep') + t.ok( + /file:.*?[/]package-local-dependency$/.test(pkgJson.dependencies['package-local-dependency']), 'local package saved correctly' ) t.end() @@ -80,9 +80,9 @@ test('\'npm install --save-dev ../local/path\' should save to package.json', fun t.ok(JSON.parse(fs.readFileSync(dependencyPackageJson, 'utf8'))) var pkgJson = JSON.parse(fs.readFileSync(pkg + '/package.json', 'utf8')) - t.deepEqual( - pkgJson.devDependencies, - { 'package-local-dev-dependency': 'file:../package-local-dev-dependency' }, + t.is(Object.keys(pkgJson.devDependencies).length, 1, 'only one dep') + t.ok( + /file:.*?[/]package-local-dev-dependency$/.test(pkgJson.devDependencies['package-local-dev-dependency']), 'local package saved correctly' ) diff --git a/deps/npm/test/tap/install-scoped-already-installed.js b/deps/npm/test/tap/install-scoped-already-installed.js index 1446897d442261..f3c191ddb00dd8 100644 --- a/deps/npm/test/tap/install-scoped-already-installed.js +++ b/deps/npm/test/tap/install-scoped-already-installed.js @@ -31,7 +31,7 @@ var localDependency = { } var scopedDependency = { - name: '@scoped/package', + name: '@scoped/package-scoped-dependency', version: '0.0.0', description: 'Test for local installs' } @@ -64,6 +64,7 @@ test('installing already installed local scoped package', function (t) { common.npm( [ '--loglevel', 'silent', + '--parseable', 'install' ], EXEC_OPTS, @@ -71,14 +72,13 @@ test('installing already installed local scoped package', function (t) { var installed = parseNpmInstallOutput(stdout) t.ifError(err, 'install ran to completion without error') t.notOk(code, 'npm install exited with code 0') - t.ok( - existsSync(path.join(modules, '@scoped', 'package', 'package.json')), + existsSync(path.join(modules, '@scoped', 'package-scoped-dependency', 'package.json')), 'package installed' ) t.ok( - contains(installed, 'node_modules/@scoped/package'), - 'installed @scoped/package' + contains(installed, 'node_modules/@scoped/package-scoped-dependency'), + 'installed @scoped/package-scoped-dependency' ) t.ok( contains(installed, 'node_modules/package-local-dependency'), @@ -88,6 +88,7 @@ test('installing already installed local scoped package', function (t) { common.npm( [ '--loglevel', 'silent', + '--parseable', 'install' ], EXEC_OPTS, @@ -98,13 +99,13 @@ test('installing already installed local scoped package', function (t) { installed = parseNpmInstallOutput(stdout) t.ok( - existsSync(path.join(modules, '@scoped', 'package', 'package.json')), + existsSync(path.join(modules, '@scoped', 'package-scoped-dependency', 'package.json')), 'package installed' ) t.notOk( - contains(installed, 'node_modules/@scoped/package'), - 'did not reinstall @scoped/package' + contains(installed, 'node_modules/@scoped/package-scoped-dependency'), + 'did not reinstall @scoped/package-scoped-dependency' ) t.notOk( contains(installed, 'node_modules/package-local-dependency'), @@ -124,8 +125,9 @@ test('cleanup', function (t) { }) function contains (list, element) { + var matcher = new RegExp(element + '$') for (var i = 0; i < list.length; ++i) { - if (list[i] === element) { + if (matcher.test(list[i])) { return true } } diff --git a/deps/npm/test/tap/install-scoped-with-peer-dependency.js b/deps/npm/test/tap/install-scoped-with-peer-dependency.js index 3a54b9a11f2daf..71584b115a9fe6 100644 --- a/deps/npm/test/tap/install-scoped-with-peer-dependency.js +++ b/deps/npm/test/tap/install-scoped-with-peer-dependency.js @@ -27,13 +27,12 @@ test('setup', function (t) { }) test('it should install peerDependencies in same tree level as the parent package', function (t) { - common.npm(['install', './package'], EXEC_OPTS, function (err, code, stdout, stderr) { + common.npm(['install', '--loglevel=warn', './package'], EXEC_OPTS, function (err, code, stdout, stderr) { t.ifError(err, 'install local package successful') t.equal(code, 0, 'npm install exited with code') - t.notOk(stderr, 'npm install exited without any error output') + t.match(stderr, /npm WARN @scope[/]package@0[.]0[.]0 requires a peer of underscore@[*] but none was installed[.]\n/, + 'npm install warned about unresolved peer dep') - var p = path.resolve(pkg, 'node_modules/underscore/package.json') - t.ok(JSON.parse(fs.readFileSync(p, 'utf8'))) t.end() }) }) diff --git a/deps/npm/test/tap/install-with-dev-dep-duplicate.js b/deps/npm/test/tap/install-with-dev-dep-duplicate.js index 19ad0c2bf47da6..41eb8233114962 100644 --- a/deps/npm/test/tap/install-with-dev-dep-duplicate.js +++ b/deps/npm/test/tap/install-with-dev-dep-duplicate.js @@ -31,7 +31,8 @@ var expected = { underscore: { version: '1.5.1', from: 'underscore@1.5.1', - resolved: common.registry + '/underscore/-/underscore-1.5.1.tgz' + resolved: common.registry + '/underscore/-/underscore-1.5.1.tgz', + invalid: true } } } @@ -49,6 +50,10 @@ test('prefers version from dependencies over devDependencies', function (t) { npm.commands.ls([], true, function (err, _, results) { if (err) return t.fail(err) + // these contain full paths so we can't do an exact match + // with them + delete results.problems + delete results.dependencies.underscore.problems t.deepEqual(results, expected) s.close() t.end() diff --git a/deps/npm/test/tap/invalid-cmd-exit-code.js b/deps/npm/test/tap/invalid-cmd-exit-code.js index c9918e5a79d8b6..f4bb444a179690 100644 --- a/deps/npm/test/tap/invalid-cmd-exit-code.js +++ b/deps/npm/test/tap/invalid-cmd-exit-code.js @@ -1,28 +1,28 @@ -var test = require("tap").test -var common = require("../common-tap.js") +var test = require('tap').test +var common = require('../common-tap.js') var opts = { cwd: process.cwd() } -test("npm asdf should return exit code 1", function (t) { - common.npm(["asdf"], opts, function (er, c) { +test('npm asdf should return exit code 1', function (t) { + common.npm(['asdf'], opts, function (er, c) { if (er) throw er - t.ok(c, "exit code should not be zero") + t.ok(c, 'exit code should not be zero') t.end() }) }) -test("npm help should return exit code 0", function (t) { - common.npm(["help"], opts, function (er, c) { +test('npm help should return exit code 0', function (t) { + common.npm(['help'], opts, function (er, c) { if (er) throw er - t.equal(c, 0, "exit code should be 0") + t.equal(c, 0, 'exit code should be 0') t.end() }) }) -test("npm help fadf should return exit code 0", function (t) { - common.npm(["help", "fadf"], opts, function (er, c) { +test('npm help fadf should return exit code 0', function (t) { + common.npm(['help', 'fadf'], opts, function (er, c) { if (er) throw er - t.equal(c, 0, "exit code should be 0") + t.equal(c, 0, 'exit code should be 0') t.end() }) }) diff --git a/deps/npm/test/tap/is-fs-access-available.js b/deps/npm/test/tap/is-fs-access-available.js new file mode 100644 index 00000000000000..3c1b30ed0435d3 --- /dev/null +++ b/deps/npm/test/tap/is-fs-access-available.js @@ -0,0 +1,56 @@ +'use strict' +var fs = require('fs') +var test = require('tap').test +var requireInject = require('require-inject') +var semver = require('semver') +var extend = Object.assign || require('util')._extend + +var globalProcess = global.process + +function loadIsFsAccessAvailable (newProcess, newFs) { + global.process = extend(extend({}, global.process), newProcess) + var mocks = {fs: extend(extend({}, fs), newFs)} + var isFsAccessAvailable = requireInject('../../lib/install/is-fs-access-available.js', mocks) + global.process = globalProcess + return isFsAccessAvailable +} + +var fsWithAccess = {access: function () {}} +var fsWithoutAccess = {access: undefined} + +if (semver.lt(process.version, '0.12.0')) { + test('skipping', function (t) { + t.pass('skipping all tests on < 0.12.0 due to process not being injectable') + t.end() + }) +} else { + test('mac + !fs.access', function (t) { + var isFsAccessAvailable = loadIsFsAccessAvailable({platform: 'darwin'}, fsWithoutAccess) + t.is(isFsAccessAvailable, false, 'not available') + t.end() + }) + + test('mac + fs.access', function (t) { + var isFsAccessAvailable = loadIsFsAccessAvailable({platform: 'darwin'}, fsWithAccess) + t.is(isFsAccessAvailable, true, 'available') + t.end() + }) + + test('windows + !fs.access', function (t) { + var isFsAccessAvailable = loadIsFsAccessAvailable({platform: 'win32'}, fsWithoutAccess) + t.is(isFsAccessAvailable, false, 'not available') + t.end() + }) + + test('windows + fs.access + node 0.12.7', function (t) { + var isFsAccessAvailable = loadIsFsAccessAvailable({platform: 'win32', version: '0.12.7'}, fsWithAccess) + t.is(isFsAccessAvailable, false, 'not available') + t.end() + }) + + test('windows + fs.access + node 2.4.0', function (t) { + var isFsAccessAvailable = loadIsFsAccessAvailable({platform: 'win32', version: '2.4.0'}, fsWithAccess) + t.is(isFsAccessAvailable, true, 'available') + t.end() + }) +} diff --git a/deps/npm/test/tap/it.js b/deps/npm/test/tap/it.js new file mode 100644 index 00000000000000..6fc2a6fd49092c --- /dev/null +++ b/deps/npm/test/tap/it.js @@ -0,0 +1,77 @@ +var join = require('path').join +var statSync = require('graceful-fs').statSync +var writeFileSync = require('graceful-fs').writeFileSync + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap') + +var pkg = join(__dirname, 'run-script') +var installed = join(pkg, 'node_modules', 'underscore', 'package.json') + +var json = { + name: 'npm-it-test', + dependencies: { + underscore: '1.5.1' + }, + scripts: { + test: 'echo hax' + } +} + +var server + +test('run up the mock registry', function (t) { + mr({ port: common.port }, function (err, s) { + if (err) throw err + server = s + t.end() + }) +}) + +test('npm install-test', function (t) { + setup() + common.npm('install-test', { cwd: pkg }, function (err, code, stdout, stderr) { + if (err) throw err + t.equal(code, 0, 'command ran without error') + t.ok(statSync(installed), 'package was installed') + t.equal(require(installed).version, '1.5.1', 'underscore got installed as expected') + t.match(stdout, /hax/, 'found expected test output') + t.notOk(stderr, 'stderr should be empty') + t.end() + }) +}) + +test('npm it (the form most people will use)', function (t) { + setup() + common.npm('it', { cwd: pkg }, function (err, code, stdout, stderr) { + if (err) throw err + t.equal(code, 0, 'command ran without error') + t.ok(statSync(installed), 'package was installed') + t.equal(require(installed).version, '1.5.1', 'underscore got installed as expected') + t.match(stdout, /hax/, 'found expected test output') + t.notOk(stderr, 'stderr should be empty') + t.end() + }) +}) + +test('cleanup', function (t) { + process.chdir(osenv.tmpdir()) + server.close() + cleanup() + t.end() +}) + +function cleanup () { + rimraf.sync(pkg) +} + +function setup () { + cleanup() + mkdirp.sync(pkg) + writeFileSync(join(pkg, 'package.json'), JSON.stringify(json, null, 2)) +} diff --git a/deps/npm/test/tap/legacy-array-bin.js b/deps/npm/test/tap/legacy-array-bin.js new file mode 100644 index 00000000000000..3e421ee23e3ff0 --- /dev/null +++ b/deps/npm/test/tap/legacy-array-bin.js @@ -0,0 +1,80 @@ +'use strict' +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixturepath = path.resolve(basepath, 'npm-test-array-bin') +var modulepath = path.resolve(basepath, 'node_modules') +var installedpath = path.resolve(modulepath, 'npm-test-array-bin') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir +var fixture = new Tacks( + Dir({ + bin: Dir({ + 'array-bin': File( + '#!/usr/bin/env node\n' + + "console.log('test ran ok')\n" + ) + }), + 'package.json': File({ + name: 'npm-test-array-bin', + version: '1.2.5', + bin: [ + 'bin/array-bin' + ], + scripts: { + test: 'node test.js' + } + }), + 'test.js': File( + "require('child_process').exec('array-bin', { env: process.env },\n" + + ' function (err, stdout, stderr) {\n' + + " if (err && err.code) throw new Error('exited badly with code = ' + err.code)\n" + + ' console.log(stdout)\n' + + ' console.error(stderr)\n' + + ' }\n' + + ')\n' + ) + }) +) +test('setup', function (t) { + setup() + t.done() +}) +test('array-bin', function (t) { + common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) + function installCheckAndTest (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'install went ok') + t.equal(stderr, '', 'no error output') + common.npm(['test'], {cwd: installedpath}, testCheckAndRemove) + } + function testCheckAndRemove (err, code, stdout, stderr) { + t.ifError(err, 'npm test on array bin') + t.equal(code, 0, 'exited OK') + t.equal(stderr.trim(), '', 'no error output') + t.match(stdout, /test ran ok/, 'child script ran properly') + common.npm(['rm', fixturepath], {cwd: basepath}, removeCheckAndDone) + } + function removeCheckAndDone (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'remove went ok') + t.done() + } +}) +test('cleanup', function (t) { + cleanup() + t.done() +}) +function setup () { + cleanup() + fixture.create(fixturepath) + mkdirp.sync(modulepath) +} +function cleanup () { + fixture.remove(fixturepath) + rimraf.sync(basepath) +} diff --git a/deps/npm/test/tap/legacy-bundled-git.js b/deps/npm/test/tap/legacy-bundled-git.js new file mode 100644 index 00000000000000..355f9467c151fb --- /dev/null +++ b/deps/npm/test/tap/legacy-bundled-git.js @@ -0,0 +1,103 @@ +'use strict' +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixturepath = path.resolve(basepath, 'npm-test-bundled-git') +var modulepath = path.resolve(basepath, 'node_modules') +var installedpath = path.resolve(modulepath, 'npm-test-bundled-git') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +var minimatchExpected = { + name: 'minimatch', + description: 'a glob matcher in javascript', + version: '0.2.1', + repository: { + type: 'git', + url: 'git://github.com/isaacs/minimatch.git' + }, + main: 'minimatch.js', + scripts: { + test: 'tap test' + }, + engines: { + node: '*' + }, + dependencies: { + 'lru-cache': '~1.0.5' + }, + devDependencies: { + tap: '~0.1.3' + }, + licenses: [ + { + type: 'MIT', + url: 'http://github.com/isaacs/minimatch/raw/master/LICENSE' + } + ] +} + +var fixture = new Tacks( + Dir({ + README: File( + 'just an npm test\n' + ), + 'package.json': File({ + name: 'npm-test-bundled-git', + scripts: { + test: 'node test.js' + }, + version: '1.2.5', + dependencies: { + glob: 'git://github.com/isaacs/node-glob.git#npm-test' + }, + bundledDependencies: [ + 'glob' + ] + }) + }) +) +test('setup', function (t) { + setup() + t.done() +}) +test('bundled-git', function (t) { + common.npm(['install', '--global-style', fixturepath], {cwd: basepath}, installCheckAndTest) + function installCheckAndTest (err, code, stdout, stderr) { + if (err) throw err + console.error(stderr) + console.log(stdout) + t.is(code, 0, 'install went ok') + + var actual = require(path.resolve(installedpath, 'node_modules/glob/node_modules/minimatch/package.json')) + Object.keys(minimatchExpected).forEach(function (key) { + t.isDeeply(actual[key], minimatchExpected[key], key + ' set to the right value') + }) + + common.npm(['rm', fixturepath], {cwd: basepath}, removeCheckAndDone) + } + function removeCheckAndDone (err, code, stdout, stderr) { + if (err) throw err + console.error(stderr) + console.log(stdout) + t.is(code, 0, 'remove went ok') + t.done() + } +}) +test('cleanup', function (t) { + cleanup() + t.done() +}) +function setup () { + cleanup() + fixture.create(fixturepath) + mkdirp.sync(modulepath) +} +function cleanup () { + fixture.remove(fixturepath) + rimraf.sync(basepath) +} diff --git a/deps/npm/test/tap/legacy-dir-bin.js b/deps/npm/test/tap/legacy-dir-bin.js new file mode 100644 index 00000000000000..e9e6bdfe1320f6 --- /dev/null +++ b/deps/npm/test/tap/legacy-dir-bin.js @@ -0,0 +1,79 @@ +'use strict' +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixturepath = path.resolve(basepath, 'npm-test-dir-bin') +var modulepath = path.resolve(basepath, 'node_modules') +var installedpath = path.resolve(modulepath, 'npm-test-dir-bin') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir +var fixture = new Tacks( + Dir({ + bin: Dir({ + 'dir-bin': File( + '#!/usr/bin/env node\n' + + "console.log('test ran ok')\n" + ) + }), + 'package.json': File({ + name: 'npm-test-dir-bin', + version: '1.2.5', + directories: { + bin: './bin' + }, + scripts: { + test: 'node test.js' + } + }), + 'test.js': File( + "require('child_process').exec('dir-bin', { env: process.env },\n" + + ' function (err, stdout, stderr) {\n' + + " if (err && err.code) throw new Error('exited badly with code = ' + err.code)\n" + + ' console.log(stdout)\n' + + ' console.error(stderr)\n' + + ' }\n' + + ')\n' + ) + }) +) +test('setup', function (t) { + setup() + t.done() +}) +test('dir-bin', function (t) { + common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) + function installCheckAndTest (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'install went ok') + common.npm(['test'], {cwd: installedpath}, testCheckAndRemove) + } + function testCheckAndRemove (err, code, stdout, stderr) { + t.ifError(err, 'npm test on array bin') + t.equal(code, 0, 'exited OK') + t.equal(stderr.trim(), '', 'no error output') + t.match(stdout, /test ran ok/, 'child script ran properly') + common.npm(['rm', fixturepath], {cwd: basepath}, removeCheckAndDone) + } + function removeCheckAndDone (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'remove went ok') + t.done() + } +}) +test('cleanup', function (t) { + cleanup() + t.done() +}) +function setup () { + cleanup() + fixture.create(fixturepath) + mkdirp.sync(modulepath) +} +function cleanup () { + fixture.remove(fixturepath) + rimraf.sync(basepath) +} diff --git a/deps/npm/test/tap/legacy-ignore-nested-nm.js b/deps/npm/test/tap/legacy-ignore-nested-nm.js new file mode 100644 index 00000000000000..095c41efa146ba --- /dev/null +++ b/deps/npm/test/tap/legacy-ignore-nested-nm.js @@ -0,0 +1,64 @@ +'use strict' +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixturepath = path.resolve(basepath, 'npm-test-ignore-nested-nm') +var modulepath = path.resolve(basepath, 'node_modules') +var installedpath = path.resolve(modulepath, 'npm-test-ignore-nested-nm') +var fs = require('graceful-fs') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +var fileData = 'I WILL NOT BE IGNORED!\n' +var fixture = new Tacks( + Dir({ + lib: Dir({ + node_modules: Dir({ + foo: File(fileData) + }) + }), + 'package.json': File({ + name: 'npm-test-ignore-nested-nm', + version: '1.2.5' + }) + }) +) +test('setup', function (t) { + setup() + t.done() +}) +test('ignore-nested-nm', function (t) { + common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) + function installCheckAndTest (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'install went ok') + var foopath = path.resolve(installedpath, 'lib/node_modules/foo') + fs.readFile(foopath, function (err, data) { + t.ifError(err, 'file read successfully') + t.equal(data.toString(), fileData) + common.npm(['rm', fixturepath], {cwd: basepath}, removeCheckAndDone) + }) + } + function removeCheckAndDone (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'remove went ok') + t.done() + } +}) +test('cleanup', function (t) { + cleanup() + t.done() +}) +function setup () { + cleanup() + fixture.create(fixturepath) + mkdirp.sync(modulepath) +} +function cleanup () { + fixture.remove(fixturepath) + rimraf.sync(basepath) +} diff --git a/deps/npm/test/tap/legacy-missing-bindir.js b/deps/npm/test/tap/legacy-missing-bindir.js new file mode 100644 index 00000000000000..a55703bebdb7cc --- /dev/null +++ b/deps/npm/test/tap/legacy-missing-bindir.js @@ -0,0 +1,82 @@ +'use strict' +var path = require('path') +var fs = require('fs') +var test = require('tap').test +var common = require('../common-tap.js') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixturepath = path.resolve(basepath, 'npm-test-missing-bindir') +var modulepath = path.resolve(basepath, 'node_modules') +var installedpath = path.resolve(modulepath, 'npm-test-missing-bindir') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +var fixture = new Tacks( + Dir({ + README: File( + 'just an npm test\n' + ), + 'package.json': File({ + name: 'npm-test-missing-bindir', + version: '0.0.0', + directories: { + bin: './not-found' + } + }) + }) +) + +test('setup', function (t) { + setup() + t.done() +}) + +function installedExists (filename) { + try { + fs.statSync(path.resolve(installedpath, filename)) + return true + } catch (ex) { + console.log(ex) + return false + } +} + +test('missing-bindir', function (t) { + common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) + + function installCheckAndTest (err, code, stdout, stderr) { + if (err) throw err + if (stderr) console.error(stderr) + console.log(stdout) + t.is(code, 0, 'install went ok') + t.is(installedExists('README'), true, 'README') + t.is(installedExists('package.json'), true, 'package.json') + common.npm(['rm', fixturepath], {cwd: basepath}, removeCheckAndDone) + } + + function removeCheckAndDone (err, code, stdout, stderr) { + if (err) throw err + console.error(stderr) + console.log(stdout) + t.is(code, 0, 'remove went ok') + t.done() + } +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) + +function setup () { + cleanup() + fixture.create(fixturepath) + mkdirp.sync(modulepath) +} + +function cleanup () { + fixture.remove(fixturepath) + rimraf.sync(basepath) +} diff --git a/deps/npm/test/tap/legacy-no-auth-leak.js b/deps/npm/test/tap/legacy-no-auth-leak.js new file mode 100644 index 00000000000000..f837239250222b --- /dev/null +++ b/deps/npm/test/tap/legacy-no-auth-leak.js @@ -0,0 +1,75 @@ +'use strict' +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +var fixture = new Tacks( + Dir({ + README: File( + 'just an npm test\n' + ), + 'package.json': File({ + name: 'npm-test-no-auth-leak', + version: '0.0.0', + scripts: { + test: 'node test.js' + } + }), + '.npmrc': File( + 'auth=abc', + 'authCrypt=def', + 'password=xyz', + '//registry.npmjs.org/:_authToken=nopenope' + ), + 'test.js': File( + 'var authTokenKeys = Object.keys(process.env)\n' + + ' .filter(function (key) { return /authToken/.test(key) })\n' + + 'console.log(JSON.stringify({\n' + + ' password: process.env.npm_config__password || null,\n' + + ' auth: process.env.npm_config__auth || null,\n' + + ' authCrypt: process.env.npm_config__authCrypt || null ,\n' + + ' authToken: authTokenKeys && process.env[authTokenKeys[0]] || null\n' + + '}))' + ) + }) +) + +test('setup', function (t) { + setup() + t.done() +}) + +test('no-auth-leak', function (t) { + common.npm(['test'], {cwd: basepath}, function (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'test ran ok') + if (stderr) console.log(stderr) + var matchResult = /^[^{]*(\{(?:.|\n)*\})[^}]*$/ + t.like(stdout, matchResult, 'got results with a JSON chunk in them') + var stripped = stdout.replace(matchResult, '$1') + var result = JSON.parse(stripped) + t.is(result.password, null, 'password') + t.is(result.auth, null, 'auth') + t.is(result.authCrypt, null, 'authCrypt') + t.is(result.authToken, null, 'authToken') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) + +function setup () { + cleanup() + fixture.create(basepath) +} + +function cleanup () { + fixture.remove(basepath) +} diff --git a/deps/npm/test/tap/legacy-npm-self-install.js b/deps/npm/test/tap/legacy-npm-self-install.js new file mode 100644 index 00000000000000..313c0594935a0d --- /dev/null +++ b/deps/npm/test/tap/legacy-npm-self-install.js @@ -0,0 +1,107 @@ +'use strict' +var test = require('tap').test +var fs = require('graceful-fs') +var common = require('../common-tap.js') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var npmpath = path.resolve(__dirname, '../..') +var basepath = path.resolve(osenv.tmpdir(), path.basename(__filename, '.js')) +var globalpath = path.resolve(basepath, 'global') +var extend = Object.assign || require('util')._extend +var isWin32 = process.platform === 'win32' + +test('setup', function (t) { + setup() + t.done() +}) + +var tarball + +test('build-tarball', function (t) { + common.npm(['pack'], {cwd: npmpath, stdio: ['ignore', 'pipe', process.stderr]}, function (err, code, stdout) { + if (err) throw err + t.is(code, 0, 'pack went ok') + tarball = path.resolve(npmpath, stdout.trim().replace(/^(?:.|\n)*(?:^|\n)(.*?[.]tgz)$/, '$1')) + t.match(tarball, /[.]tgz$/, 'got a tarball') + t.done() + }) +}) + +function exists () { + try { + fs.statSync(path.resolve.apply(null, arguments)) + return true + } catch (ex) { + return false + } +} + +test('npm-self-install', function (t) { + if (!tarball) return t.done() + + var env = extend({}, process.env) + var pathsep = isWin32 ? ';' : ':' + env.npm_config_prefix = globalpath + env.npm_config_global = 'true' + env.npm_config_npat = 'false' + env.NODE_PATH = null + env.npm_config_user_agent = null + env.npm_config_color = 'always' + env.npm_config_progress = 'always' + var PATH = env.PATH.split(pathsep) + var binpath = isWin32 ? globalpath : path.join(globalpath, 'bin') + var cmdname = isWin32 ? 'npm.cmd' : 'npm' + PATH.unshift(binpath) + env.PATH = PATH.join(pathsep) + + var opts = {cwd: basepath, env: env, stdio: ['ignore', 'ignore', process.stderr]} + + common.npm(['install', '--ignore-scripts', tarball], opts, installCheckAndTest) + function installCheckAndTest (err, code) { + if (err) throw err + t.is(code, 0, 'install went ok') + t.is(exists(binpath, cmdname), true, 'binary was installed') + t.is(exists(globalpath, 'lib', 'node_modules', 'npm'), true, 'module path exists') + common.npm(['ls', '--json', '--depth=0'], {cwd: basepath, env: env}, lsCheckAndRemove) + } + function lsCheckAndRemove (err, code, stdout, stderr) { + t.ifError(err, 'npm test on array bin') + t.equal(code, 0, 'exited OK') + t.equal(stderr.trim(), '', 'no error output') + var installed = JSON.parse(stdout.trim()) + t.is(Object.keys(installed.dependencies).length, 1, 'one thing installed') + t.is(path.resolve(globalpath, installed.dependencies.npm.from), tarball, 'and it was our npm tarball') + common.npm(['rm', 'npm'], {cwd: basepath, env: env, stdio: 'inherit'}, removeCheck) + } + function removeCheck (err, code) { + if (err) throw err + t.is(code, 0, 'remove went ok') + common.npm(['ls', '--json', '--depth=0'], {cwd: basepath, env: env}, andDone) + } + function andDone (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'remove went ok') + t.equal(stderr.trim(), '', 'no error output') + var installed = JSON.parse(stdout.trim()) + t.ok(!installed.dependencies || installed.dependencies.length === 0, 'nothing left') + t.is(exists(binpath, cmdname), false, 'binary was removed') + t.is(exists(globalpath, 'lib', 'node_modules', 'npm'), false, 'module was entirely removed') + t.done() + } +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) + +function setup () { + cleanup() + mkdirp.sync(globalpath) +} + +function cleanup () { + rimraf.sync(basepath) +} diff --git a/deps/npm/test/tap/legacy-optional-deps.js b/deps/npm/test/tap/legacy-optional-deps.js new file mode 100644 index 00000000000000..80ad7cc47eea6c --- /dev/null +++ b/deps/npm/test/tap/legacy-optional-deps.js @@ -0,0 +1,79 @@ +'use strict' +var path = require('path') +var fs = require('fs') +var test = require('tap').test +var common = require('../common-tap.js') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixturepath = path.resolve(basepath, 'npm-test-optional-deps') +var modulepath = path.resolve(basepath, 'node_modules') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +var fixture = new Tacks( + Dir({ + README: File( + 'just an npm test\n' + ), + 'package.json': File({ + name: 'npm-test-optional-deps', + version: '1.2.5', + optionalDependencies: { + 'npm-test-foobarzaaakakaka': 'http://example.com/', + async: '10.999.14234', + mkdirp: '0.3.5', + optimist: 'some invalid version 99 #! $$ x y z', + 'npm-test-failer': '*' + } + }) + }) +) + +var server + +test('setup', function (t) { + setup() + mr({port: common.port}, function (err, s) { + if (err) throw err + server = s + t.done() + }) +}) + +test('optional-deps', function (t) { + server.get('/npm-test-failer').reply(404, {error: 'nope'}) + + var opts = ['--registry=' + common.registry, '--timeout=100'] + common.npm(opts.concat(['install', fixturepath]), {cwd: basepath}, installCheckAndTest) + + function installCheckAndTest (err, code, stdout, stderr) { + if (err) throw err + if (stderr) console.error(stderr) + server.done() + t.is(code, 0, 'install went ok') + var dir = fs.readdirSync(modulepath).sort() + t.isDeeply(dir, ['mkdirp', 'npm-test-optional-deps'], 'only one optional dep should be there') + t.is(require(path.resolve(modulepath, 'mkdirp', 'package.json')).version, '0.3.5', 'mkdirp version right') + t.done() + } +}) + +test('cleanup', function (t) { + cleanup() + server.close() + t.done() +}) + +function setup () { + cleanup() + fixture.create(fixturepath) + mkdirp.sync(modulepath) +} + +function cleanup () { + fixture.remove(fixturepath) + rimraf.sync(basepath) +} diff --git a/deps/npm/test/tap/legacy-platform-all.js b/deps/npm/test/tap/legacy-platform-all.js new file mode 100644 index 00000000000000..2bfb19a45782bd --- /dev/null +++ b/deps/npm/test/tap/legacy-platform-all.js @@ -0,0 +1,73 @@ +'use strict' +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixturepath = path.resolve(basepath, 'npm-test-platform-all') +var modulepath = path.resolve(basepath, 'node_modules') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +var fixture = new Tacks( + Dir({ + README: File( + 'just an npm test\n' + ), + 'package.json': File({ + name: 'npm-test-platform-all', + version: '9.9.9-9', + homepage: 'http://www.zombo.com/', + os: [ + 'darwin', + 'linux', + 'win32', + 'solaris', + 'haiku', + 'sunos', + 'freebsd', + 'openbsd', + 'netbsd' + ], + cpu: [ + 'arm', + 'mips', + 'ia32', + 'x64', + 'sparc' + ] + }) + }) +) + +test('setup', function (t) { + setup() + t.done() +}) + +test('platform-all', function (t) { + common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) + function installCheckAndTest (err, code, stdout, stderr) { + if (err) throw err + t.is(stderr, '', 'no error messages') + t.is(code, 0, 'install went ok') + t.done() + } +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) + +function setup () { + cleanup() + fixture.create(fixturepath) + mkdirp.sync(modulepath) +} +function cleanup () { + fixture.remove(fixturepath) + rimraf.sync(basepath) +} diff --git a/deps/npm/test/tap/legacy-platform.js b/deps/npm/test/tap/legacy-platform.js new file mode 100644 index 00000000000000..4e94148b213097 --- /dev/null +++ b/deps/npm/test/tap/legacy-platform.js @@ -0,0 +1,64 @@ +'use strict' +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixturepath = path.resolve(basepath, 'npm-test-platform') +var modulepath = path.resolve(basepath, 'node_modules') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +var fixture = new Tacks( + Dir({ + README: File( + 'just an npm test\n' + ), + 'package.json': File({ + name: 'npm-test-platform', + version: '9.9.9-9', + homepage: 'http://www.youtube.com/watch?v=dQw4w9WgXcQ', + os: [ + '!this_is_not_a_real_os', + '!neither_is_this' + ], + cpu: [ + '!this_is_not_a_real_cpu', + '!this_isnt_either' + ] + }) + }) +) + +test('setup', function (t) { + setup() + t.done() +}) + +test('platform', function (t) { + common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) + function installCheckAndTest (err, code, stdout, stderr) { + if (err) throw err + console.error(stderr) + t.is(code, 0, 'install went ok') + t.done() + } +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) + +function setup () { + cleanup() + fixture.create(fixturepath) + mkdirp.sync(modulepath) +} + +function cleanup () { + fixture.remove(fixturepath) + rimraf.sync(basepath) +} diff --git a/deps/npm/test/tap/legacy-private.js b/deps/npm/test/tap/legacy-private.js new file mode 100644 index 00000000000000..5e7817bf6a13a7 --- /dev/null +++ b/deps/npm/test/tap/legacy-private.js @@ -0,0 +1,58 @@ +'use strict' +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixturepath = path.resolve(basepath, 'npm-test-private') +var modulepath = path.resolve(basepath, 'node_modules') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +var fixture = new Tacks( + Dir({ + README: File( + 'just an npm test\n' + ), + 'package.json': File({ + name: 'npm-test-private', + version: '9.9.9-9', + homepage: 'http://www.youtube.com/watch?v=1MLry6Cn_D4', + private: 'true' + }) + }) +) + +test('setup', function (t) { + setup() + t.done() +}) + +test('private', function (t) { + common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) + function installCheckAndTest (err, code, stdout, stderr) { + if (err) throw err + console.error(stderr) + console.log(stdout) + t.is(code, 0, 'install went ok') + t.done() + } +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) + +function setup () { + cleanup() + fixture.create(fixturepath) + mkdirp.sync(modulepath) +} + +function cleanup () { + fixture.remove(fixturepath) + rimraf.sync(basepath) +} diff --git a/deps/npm/test/tap/legacy-shrinkwrap.js b/deps/npm/test/tap/legacy-shrinkwrap.js new file mode 100644 index 00000000000000..6f5303037707a0 --- /dev/null +++ b/deps/npm/test/tap/legacy-shrinkwrap.js @@ -0,0 +1,132 @@ +'use strict' +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +var fixture = new Tacks( + Dir({ + README: File( + 'just an npm test\n' + ), + 'npm-shrinkwrap.json': File({ + name: 'npm-test-shrinkwrap', + version: '0.0.0', + dependencies: { + glob: { + version: '3.1.5', + from: 'git://github.com/isaacs/node-glob.git#npm-test', + resolved: 'git://github.com/isaacs/node-glob.git#67bda227fd7a559cca5620307c7d30a6732a792f', + dependencies: { + 'graceful-fs': { + version: '1.1.5', + resolved: 'https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.1.5.tgz', + dependencies: { + 'fast-list': { + version: '1.0.2', + resolved: 'https://registry.npmjs.org/fast-list/-/fast-list-1.0.2.tgz' + } + } + }, + inherits: { + version: '1.0.0', + resolved: 'https://registry.npmjs.org/inherits/-/inherits-1.0.0.tgz' + }, + minimatch: { + version: '0.2.1', + dependencies: { + 'lru-cache': { + version: '1.0.5' + } + } + } + } + }, + minimatch: { + version: '0.1.5', + resolved: 'https://registry.npmjs.org/minimatch/-/minimatch-0.1.5.tgz', + dependencies: { + 'lru-cache': { + version: '1.0.5', + resolved: 'https://registry.npmjs.org/lru-cache/-/lru-cache-1.0.5.tgz' + } + } + }, + 'npm-test-single-file': { + version: '1.2.3', + resolved: 'https://gist.github.com/isaacs/1837112/raw/9ef57a59fc22aeb1d1ca346b68826dcb638b8416/index.js' + } + } + }), + 'package.json': File({ + author: 'Isaac Z. Schlueter (http://blog.izs.me/)', + name: 'npm-test-shrinkwrap', + version: '0.0.0', + dependencies: { + 'npm-test-single-file': 'https://gist.github.com/isaacs/1837112/raw/9ef57a59fc22aeb1d1ca346b68826dcb638b8416/index.js', + glob: 'git://github.com/isaacs/node-glob.git#npm-test', + minimatch: '~0.1.0' + }, + scripts: { + test: 'node test.js' + } + }) + }) +) + +test('setup', function (t) { + setup() + t.done() +}) + +test('shrinkwrap', function (t) { + common.npm(['install'], {cwd: basepath}, installCheckAndTest) + + function installCheckAndTest (err, code, stdout, stderr) { + if (err) throw err + console.error(stderr) + t.is(code, 0, 'install went ok') + + common.npm(['ls', '--json'], {cwd: basepath}, verifyLsMatchesShrinkwrap) + } + + function verifyLsMatchesShrinkwrap (err, code, stdout, stderr) { + if (err) throw err + console.error(stderr) + t.is(code, 0, 'ls went ok') + var actual = JSON.parse(stdout) + var expected = require(path.resolve(basepath, 'npm-shrinkwrap.json')) + // from is expected to vary + t.isDeeply(rmFrom(actual), rmFrom(expected)) + t.done() + } + + function rmFrom (obj) { + for (var i in obj) { + if (i === 'from') { + delete obj[i] + } else if (i === 'dependencies') { + for (var j in obj[i]) { + rmFrom(obj[i][j]) + } + } + } + } +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) + +function setup () { + cleanup() + fixture.create(basepath) +} + +function cleanup () { + fixture.remove(basepath) +} diff --git a/deps/npm/test/tap/legacy-test-package.js b/deps/npm/test/tap/legacy-test-package.js new file mode 100644 index 00000000000000..b0cbaa01a5cb62 --- /dev/null +++ b/deps/npm/test/tap/legacy-test-package.js @@ -0,0 +1,76 @@ +'use strict' +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixturepath = path.resolve(basepath, 'npm-test-test-package') +var modulepath = path.resolve(basepath, 'node_modules') +var installedpath = path.resolve(modulepath, 'npm-test-test-package') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +var fixture = new Tacks( + Dir({ + README: File( + 'just an npm test\n' + ), + 'package.json': File({ + name: 'npm-test-test-package', + author: 'Testy McMock', + version: '1.2.3-99-b', + description: "This is a test package used for debugging. It has some random data and that's all." + }) + }) +) + +test('setup', function (t) { + setup() + t.done() +}) + +test('test-package', function (t) { + common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) + + function installCheckAndTest (err, code, stdout, stderr) { + if (err) throw err + console.error(stderr) + console.log(stdout) + t.is(code, 0, 'install went ok') + common.npm(['test'], {cwd: installedpath}, testCheckAndRemove) + } + + function testCheckAndRemove (err, code, stdout, stderr) { + if (err) throw err + console.error(stderr) + console.log(stdout) + t.is(code, 0, 'npm test w/o test is ok') + common.npm(['rm', fixturepath], {cwd: basepath}, removeCheckAndDone) + } + + function removeCheckAndDone (err, code, stdout, stderr) { + if (err) throw err + console.error(stderr) + console.log(stdout) + t.is(code, 0, 'remove went ok') + t.done() + } +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) + +function setup () { + cleanup() + fixture.create(fixturepath) + mkdirp.sync(modulepath) +} + +function cleanup () { + fixture.remove(fixturepath) + rimraf.sync(basepath) +} diff --git a/deps/npm/test/tap/legacy-url-dep.js b/deps/npm/test/tap/legacy-url-dep.js new file mode 100644 index 00000000000000..9807d6916a4e44 --- /dev/null +++ b/deps/npm/test/tap/legacy-url-dep.js @@ -0,0 +1,61 @@ +'use strict' +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixturepath = path.resolve(basepath, 'npm-test-url-dep') +var modulepath = path.resolve(basepath, 'node_modules') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +var fixture = new Tacks( + Dir({ + README: File( + 'just an npm test\n' + ), + 'package.json': File({ + name: 'npm-test-url-dep', + version: '1.2.3', + dependencies: { + jsonify: 'https://github.com/substack/jsonify/tarball/master', + sax: 'isaacs/sax-js', + 'canonical-host': 'git://github.com/isaacs/canonical-host' + } + }) + }) +) + +test('setup', function (t) { + setup() + t.done() +}) + +test('url-dep', function (t) { + common.npm(['install', fixturepath], {cwd: basepath}, installCheckAndTest) + function installCheckAndTest (err, code, stdout, stderr) { + if (err) throw err + console.error(stderr) + console.log(stdout) + t.is(code, 0, 'install went ok') + t.done() + } +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) + +function setup () { + cleanup() + fixture.create(fixturepath) + mkdirp.sync(modulepath) +} + +function cleanup () { + fixture.remove(fixturepath) + rimraf.sync(basepath) +} diff --git a/deps/npm/test/tap/lifecycle-path.js b/deps/npm/test/tap/lifecycle-path.js index fae6fcc83f71e3..39761b48d7533e 100644 --- a/deps/npm/test/tap/lifecycle-path.js +++ b/deps/npm/test/tap/lifecycle-path.js @@ -67,7 +67,8 @@ test('make sure the path is correct', function (t) { // get the ones we tacked on, then the system-specific requirements var expect = [ '{{ROOT}}/bin/node-gyp-bin', - '{{ROOT}}/test/tap/lifecycle-path/node_modules/.bin' + '{{ROOT}}/test/tap/lifecycle-path/node_modules/.bin', + path.dirname(process.execPath) ].concat(PATH.split(pathSplit).map(function (p) { return p.replace(/\\/g, '/') })) diff --git a/deps/npm/test/tap/lifecycle-signal.js b/deps/npm/test/tap/lifecycle-signal.js index e28caf72f8948b..4c41a9e98af19d 100644 --- a/deps/npm/test/tap/lifecycle-signal.js +++ b/deps/npm/test/tap/lifecycle-signal.js @@ -16,7 +16,8 @@ var json = { name: 'lifecycle-signal', version: '1.2.5', scripts: { - preinstall: 'node -e "process.kill(process.pid,\'SIGSEGV\')"' + preinstall: 'node -e "process.kill(process.pid,\'SIGSEGV\')"', + forever: 'node -e "console.error(process.pid);setInterval(function(){},1000)"' } } @@ -46,6 +47,31 @@ test('lifecycle signal abort', function (t) { }) }) +test('lifecycle propagate signal term to child', function (t) { + // windows does not use lifecycle signals, abort + if (process.platform === 'win32' || process.env.TRAVIS) return t.end() + + var innerChildPid + var child = spawn(npm, ['run', 'forever'], { + cwd: pkg + }) + child.stderr.on('data', function (data) { + innerChildPid = Number.parseInt(data.toString(), 10) + t.doesNotThrow(function () { + process.kill(innerChildPid, 0) // inner child should be running + }) + child.kill() // send SIGTERM to npm + }) + child.on('exit', function (code, signal) { + t.equal(code, null) + t.equal(signal, 'SIGTERM') + t.throws(function () { + process.kill(innerChildPid, 0) // SIGTERM should have reached inner child + }) + t.end() + }) +}) + test('cleanup', function (t) { cleanup() t.end() diff --git a/deps/npm/test/tap/lifecycle.js b/deps/npm/test/tap/lifecycle.js index aa0efc52669f2c..1a98bf3db75802 100644 --- a/deps/npm/test/tap/lifecycle.js +++ b/deps/npm/test/tap/lifecycle.js @@ -1,12 +1,44 @@ -var test = require("tap").test -var npm = require("../../") -var lifecycle = require("../../lib/utils/lifecycle") +var test = require('tap').test +var npm = require('../../') +var lifecycle = require('../../lib/utils/lifecycle') -test("lifecycle: make env correctly", function (t) { +test('lifecycle: make env correctly', function (t) { npm.load({enteente: Infinity}, function () { var env = lifecycle.makeEnv({}, null, process.env) - t.equal("Infinity", env.npm_config_enteente) + t.equal('Infinity', env.npm_config_enteente) + t.end() + }) +}) + +test('lifecycle : accepts wd for package that matches project\'s name', function (t) { + npm.load({}, function () { + var wd = '/opt/my-time/node_modules/time' + var pkg = {name: 'time'} + + t.equal(lifecycle._incorrectWorkingDirectory(wd, pkg), false) + t.end() + }) +}) + +test('lifecycle : accepts wd for package that doesn\'t match project\'s name', function (t) { + npm.load({}, function () { + var wd = '/opt/my-project/node_modules/time' + var pkg = {name: 'time'} + + t.equal(lifecycle._incorrectWorkingDirectory(wd, pkg), false) + t.end() + }) +}) + +test('lifecycle : rejects wd for ', function (t) { + npm.load({}, function () { + var wd = '/opt/my-time/node_modules/time/invalid' + var pkg = { + name: 'time' + } + + t.equal(lifecycle._incorrectWorkingDirectory(wd, pkg), true) t.end() }) }) diff --git a/deps/npm/test/tap/link.js b/deps/npm/test/tap/link.js index ea47e8296a15c5..e2f545520024fc 100644 --- a/deps/npm/test/tap/link.js +++ b/deps/npm/test/tap/link.js @@ -3,12 +3,15 @@ var osenv = require('osenv') var path = require('path') var rimraf = require('rimraf') var test = require('tap').test +var lstatSync = require('fs').lstatSync var writeFileSync = require('fs').writeFileSync var common = require('../common-tap.js') var link = path.join(__dirname, 'link') +var linkScoped = path.join(__dirname, 'link-scoped') var linkInstall = path.join(__dirname, 'link-install') +var linkInside = path.join(linkInstall, 'node_modules', 'inside') var linkRoot = path.join(__dirname, 'link-root') var config = 'prefix = ' + linkRoot @@ -32,6 +35,18 @@ var readJSON = { license: 'ISC' } +var readScopedJSON = { + name: '@scope/foo', + version: '1.0.0', + description: '', + main: 'index.js', + scripts: { + test: 'echo \"Error: no test specified\" && exit 1' + }, + author: '', + license: 'ISC' +} + var installJSON = { name: 'bar', version: '1.0.0', @@ -44,6 +59,17 @@ var installJSON = { license: 'ISC' } +var insideInstallJSON = { + name: 'inside', + version: '1.0.0', + description: '', + main: 'index.js', + scripts: { + test: 'echo \"Error: no test specified\" && exit 1' + }, + author: '', + license: 'ISC' +} test('setup', function (t) { setup() @@ -55,7 +81,7 @@ test('setup', function (t) { }) }) -test('creates global link', function (t) { +test('create global link', function (t) { process.chdir(link) common.npm(['link'], OPTS, function (err, c, out) { t.ifError(err, 'link has no error') @@ -69,6 +95,34 @@ test('creates global link', function (t) { }) }) +test('create global inside link', function (t) { + process.chdir(linkInside) + common.npm(['link'], OPTS, function (err, c, out) { + t.ifError(err, 'link has no error') + common.npm(['ls', '-g'], OPTS, function (err, c, out, stderr) { + t.ifError(err) + t.equal(c, 0) + t.equal(stderr, '', 'got expected stderr') + t.has(out, /inside@1.0.0/, 'creates global inside link ok') + t.end() + }) + }) +}) + +test('create scoped global link', function (t) { + process.chdir(linkScoped) + common.npm(['link'], OPTS, function (err, c, out) { + t.ifError(err, 'link has no error') + common.npm(['ls', '-g'], OPTS, function (err, c, out, stderr) { + t.ifError(err) + t.equal(c, 0) + t.equal(stderr, '', 'got expected stderr') + t.has(out, /@scope[/]foo@1.0.0/, 'creates global link ok') + t.end() + }) + }) +}) + test('link-install the package', function (t) { process.chdir(linkInstall) common.npm(['link', 'foo'], OPTS, function (err) { @@ -82,6 +136,30 @@ test('link-install the package', function (t) { }) }) +test('link-inside-install fails', function (t) { + process.chdir(linkInstall) + t.notOk(lstatSync(linkInside).isSymbolicLink(), 'directory for linked package is not a symlink to begin with') + common.npm(['link', 'inside'], OPTS, function (err, code) { + t.ifError(err, 'npm removed the linked package without error') + t.notEqual(code, 0, 'link operation failed') + t.notOk(lstatSync(linkInside).isSymbolicLink(), 'directory for linked package has not turned into a symlink') + t.end() + }) +}) + +test('link-install the scoped package', function (t) { + process.chdir(linkInstall) + common.npm(['link', linkScoped], OPTS, function (err) { + t.ifError(err, 'link-install has no error') + common.npm(['ls'], OPTS, function (err, c, out) { + t.ifError(err) + t.equal(c, 1) + t.has(out, /@scope[/]foo@1.0.0/, 'link-install ok') + t.end() + }) + }) +}) + test('cleanup', function (t) { process.chdir(osenv.tmpdir()) common.npm(['rm', 'foo'], OPTS, function (err, code) { @@ -100,7 +178,9 @@ test('cleanup', function (t) { function cleanup () { rimraf.sync(linkRoot) rimraf.sync(link) + rimraf.sync(linkScoped) rimraf.sync(linkInstall) + rimraf.sync(linkInside) } function setup () { @@ -111,10 +191,20 @@ function setup () { path.join(link, 'package.json'), JSON.stringify(readJSON, null, 2) ) + mkdirp.sync(linkScoped) + writeFileSync( + path.join(linkScoped, 'package.json'), + JSON.stringify(readScopedJSON, null, 2) + ) mkdirp.sync(linkInstall) writeFileSync( path.join(linkInstall, 'package.json'), JSON.stringify(installJSON, null, 2) ) + mkdirp.sync(linkInside) + writeFileSync( + path.join(linkInside, 'package.json'), + JSON.stringify(insideInstallJSON, null, 2) + ) writeFileSync(configPath, config) } diff --git a/deps/npm/test/tap/locker.js b/deps/npm/test/tap/locker.js index bc43c30e95e653..8c548095f7f54a 100644 --- a/deps/npm/test/tap/locker.js +++ b/deps/npm/test/tap/locker.js @@ -1,54 +1,54 @@ -var test = require("tap").test - , path = require("path") - , fs = require("graceful-fs") - , crypto = require("crypto") - , rimraf = require("rimraf") - , osenv = require("osenv") - , mkdirp = require("mkdirp") - , npm = require("../../") - , locker = require("../../lib/utils/locker.js") - , lock = locker.lock - , unlock = locker.unlock +var test = require('tap').test +var path = require('path') +var fs = require('graceful-fs') +var crypto = require('crypto') +var rimraf = require('rimraf') +var osenv = require('osenv') +var mkdirp = require('mkdirp') +var npm = require('../../') +var locker = require('../../lib/utils/locker.js') +var lock = locker.lock +var unlock = locker.unlock -var pkg = path.join(__dirname, "/locker") - , cache = path.join(pkg, "/cache") - , tmp = path.join(pkg, "/tmp") - , nm = path.join(pkg, "/node_modules") +var pkg = path.join(__dirname, '/locker') +var cache = path.join(pkg, '/cache') +var tmp = path.join(pkg, '/tmp') +var nm = path.join(pkg, '/node_modules') function cleanup () { process.chdir(osenv.tmpdir()) rimraf.sync(pkg) } -test("setup", function (t) { +test('setup', function (t) { cleanup() mkdirp.sync(cache) mkdirp.sync(tmp) t.end() }) -test("locking file puts lock in correct place", function (t) { +test('locking file puts lock in correct place', function (t) { npm.load({cache: cache, tmpdir: tmp}, function (er) { - t.ifError(er, "npm bootstrapped OK") + t.ifError(er, 'npm bootstrapped OK') - var n = "correct" - , c = n.replace(/[^a-zA-Z0-9]+/g, "-").replace(/^-+|-+$/g, "") - , p = path.resolve(nm, n) - , h = crypto.createHash("sha1").update(p).digest("hex") - , l = c.substr(0, 24)+"-"+h.substr(0, 16)+".lock" - , v = path.join(cache, "_locks", l) + var n = 'correct' + var c = n.replace(/[^a-zA-Z0-9]+/g, '-').replace(/^-+|-+$/g, '') + var p = path.resolve(nm, n) + var h = crypto.createHash('sha1').update(p).digest('hex') + var l = c.substr(0, 24) + '-' + h.substr(0, 16) + '.lock' + var v = path.join(cache, '_locks', l) lock(nm, n, function (er) { - t.ifError(er, "locked path") + t.ifError(er, 'locked path') fs.exists(v, function (found) { - t.ok(found, "lock found OK") + t.ok(found, 'lock found OK') unlock(nm, n, function (er) { - t.ifError(er, "unlocked path") + t.ifError(er, 'unlocked path') fs.exists(v, function (found) { - t.notOk(found, "lock deleted OK") + t.notOk(found, 'lock deleted OK') t.end() }) }) @@ -57,33 +57,33 @@ test("locking file puts lock in correct place", function (t) { }) }) -test("unlocking out of order errors out", function (t) { +test('unlocking out of order errors out', function (t) { npm.load({cache: cache, tmpdir: tmp}, function (er) { - t.ifError(er, "npm bootstrapped OK") + t.ifError(er, 'npm bootstrapped OK') - var n = "busted" - , c = n.replace(/[^a-zA-Z0-9]+/g, "-").replace(/^-+|-+$/g, "") - , p = path.resolve(nm, n) - , h = crypto.createHash("sha1").update(p).digest("hex") - , l = c.substr(0, 24)+"-"+h.substr(0, 16)+".lock" - , v = path.join(cache, "_locks", l) + var n = 'busted' + var c = n.replace(/[^a-zA-Z0-9]+/g, '-').replace(/^-+|-+$/g, '') + var p = path.resolve(nm, n) + var h = crypto.createHash('sha1').update(p).digest('hex') + var l = c.substr(0, 24) + '-' + h.substr(0, 16) + '.lock' + var v = path.join(cache, '_locks', l) fs.exists(v, function (found) { - t.notOk(found, "no lock to unlock") + t.notOk(found, 'no lock to unlock') t.throws(function () { unlock(nm, n, function () { t.fail("shouldn't get here") t.end() }) - }, "blew up as expected") + }, 'blew up as expected') t.end() }) }) }) -test("cleanup", function (t) { +test('cleanup', function (t) { cleanup() t.end() }) diff --git a/deps/npm/test/tap/logout-scoped.js b/deps/npm/test/tap/logout-scoped.js new file mode 100644 index 00000000000000..1323a4d32e76a7 --- /dev/null +++ b/deps/npm/test/tap/logout-scoped.js @@ -0,0 +1,70 @@ +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'logout') +var outfile = path.join(pkg, '_npmrc') +var opts = { cwd: pkg } + +var contents = function () {/* +foo=boo +@bar:registry=http://localhost:1337 +//localhost:1337/:_authToken=glarb +*/}.toString().split('\n').slice(1, -1).join('\n') + +function mocks (server) { + server.delete('/-/user/token/glarb') + .reply(200, {}) +} + +test('setup', function (t) { + cleanup() + setup() + t.end() +}) + +test('npm logout', function (t) { + mr({ port: common.port, plugin: mocks }, function (err, s) { + if (err) throw err + + common.npm( + [ + 'logout', + '--registry', common.registry, + '--scope', '@bar', + '--loglevel', 'silent', + '--userconfig', outfile + ], + opts, + function (err, code) { + t.ifError(err, 'no error output') + t.notOk(code, 'exited OK') + + var config = fs.readFileSync(outfile, 'utf8') + t.equal(config, 'foo=boo\n', 'creds gone') + s.close() + t.end() + } + ) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup () { + mkdirp.sync(pkg) + fs.writeFileSync(outfile, contents) +} + +function cleanup () { + rimraf.sync(pkg) +} diff --git a/deps/npm/test/tap/logout.js b/deps/npm/test/tap/logout.js index 1d9392ad16ae65..ebe0f51ba1b852 100644 --- a/deps/npm/test/tap/logout.js +++ b/deps/npm/test/tap/logout.js @@ -1,58 +1,59 @@ -var fs = require("fs") -var path = require("path") +var fs = require('fs') +var path = require('path') -var mkdirp = require("mkdirp") -var mr = require("npm-registry-mock") -var rimraf = require("rimraf") -var test = require("tap").test +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var rimraf = require('rimraf') +var test = require('tap').test -var common = require("../common-tap.js") +var common = require('../common-tap.js') -var pkg = path.resolve(__dirname, "logout") -var outfile = path.join(pkg, "_npmrc") +var pkg = path.resolve(__dirname, 'logout') +var outfile = path.join(pkg, '_npmrc') var opts = { cwd: pkg } var contents = function () {/* foo=boo //localhost:1337/:_authToken=glarb -*/}.toString().split("\n").slice(1, -1).join("\n") +*/}.toString().split('\n').slice(1, -1).join('\n') function mocks (server) { - server.delete("/-/user/token/glarb") + server.delete('/-/user/token/glarb') .reply(200, {}) } -test("setup", function (t) { +test('setup', function (t) { cleanup() setup() t.end() }) -test("npm logout", function (t) { +test('npm logout', function (t) { mr({ port: common.port, plugin: mocks }, function (err, s) { if (err) throw err common.npm( - [ - "logout", - "--registry", common.registry, - "--loglevel", "silent", - "--userconfig", outfile - ], - opts, - function (err, code) { - t.ifError(err, "no error output") - t.notOk(code, "exited OK") + [ + 'logout', + '--registry', common.registry, + '--loglevel', 'silent', + '--userconfig', outfile + ], + opts, + function (err, code) { + t.ifError(err, 'no error output') + t.notOk(code, 'exited OK') - var config = fs.readFileSync(outfile, "utf8") - t.equal(config, "foo=boo\n", "creds gone") - s.close() - t.end() - }) + var config = fs.readFileSync(outfile, 'utf8') + t.equal(config, 'foo=boo\n', 'creds gone') + s.close() + t.end() + } + ) }) }) -test("cleanup", function (t) { +test('cleanup', function (t) { cleanup() t.end() }) diff --git a/deps/npm/test/tap/ls-depth-cli.js b/deps/npm/test/tap/ls-depth-cli.js index 77689cbc54d70f..87eafced2c084c 100644 --- a/deps/npm/test/tap/ls-depth-cli.js +++ b/deps/npm/test/tap/ls-depth-cli.js @@ -113,6 +113,96 @@ test('npm ls --depth=Infinity', function (t) { ) }) +test('npm ls --depth=0 --json', function (t) { + common.npm( + ['ls', '--depth=0', '--json'], + EXEC_OPTS, + function (er, c, out) { + t.ifError(er, 'npm ls ran without issue') + t.equal(c, 0, 'ls ran without raising error code') + t.has( + out, + /test-package-with-one-dep@0\.0\.0/, + 'output contains test-package-with-one-dep@0.0.0' + ) + t.doesNotHave( + out, + /test-package@0\.0\.0/, + 'output not contains test-package@0.0.0' + ) + t.end() + } + ) +}) + +test('npm ls --depth=Infinity --json', function (t) { + // travis has a preconfigured depth=0, in general we can not depend + // on the default value in all environments, so explictly set it here + common.npm( + ['ls', '--depth=Infinity', '--json'], + EXEC_OPTS, + function (er, c, out) { + t.ifError(er, 'npm ls ran without issue') + t.equal(c, 0, 'ls ran without raising error code') + t.has( + out, + /test-package-with-one-dep@0\.0\.0/, + 'output contains test-package-with-one-dep@0.0.0' + ) + t.has( + out, + /test-package@0\.0\.0/, + 'output contains test-package@0.0.0' + ) + t.end() + } + ) +}) + +test('npm ls --depth=0 --parseable --long', function (t) { + common.npm( + ['ls', '--depth=0', '--parseable', '--long'], + EXEC_OPTS, + function (er, c, out) { + t.ifError(er, 'npm ls ran without issue') + t.equal(c, 0, 'ls ran without raising error code') + t.has( + out, + /.*test-package-with-one-dep@0\.0\.0/, + 'output contains test-package-with-one-dep' + ) + t.doesNotHave( + out, + /.*test-package@0\.0\.0/, + 'output not contains test-package' + ) + t.end() + } + ) +}) + +test('npm ls --depth=1 --parseable --long', function (t) { + common.npm( + ['ls', '--depth=1', '--parseable', '--long'], + EXEC_OPTS, + function (er, c, out) { + t.ifError(er, 'npm ls ran without issue') + t.equal(c, 0, 'ls ran without raising error code') + t.has( + out, + /.*test-package-with-one-dep@0\.0\.0/, + 'output contains test-package-with-one-dep' + ) + t.has( + out, + /.*test-package@0\.0\.0/, + 'output not contains test-package' + ) + t.end() + } + ) +}) + test('cleanup', function (t) { cleanup() t.end() diff --git a/deps/npm/test/tap/ls-env.js b/deps/npm/test/tap/ls-env.js index 30039b5b30819f..29058d9245836f 100644 --- a/deps/npm/test/tap/ls-env.js +++ b/deps/npm/test/tap/ls-env.js @@ -54,6 +54,24 @@ test('npm ls --dev', function (t) { }) }) +test('npm ls --only=development', function (t) { + common.npm(['ls', '--only=development'], EXEC_OPTS, function (er, code, stdout) { + t.ifError(er, 'ls --only=development ran without issue') + t.equal(code, 0) + t.has(stdout, /(empty)/, 'output contains (empty)') + t.end() + }) +}) + +test('npm ls --only=dev', function (t) { + common.npm(['ls', '--only=dev'], EXEC_OPTS, function (er, code, stdout) { + t.ifError(er, 'ls --only=dev ran without issue') + t.equal(code, 0) + t.has(stdout, /(empty)/, 'output contains (empty)') + t.end() + }) +}) + test('npm ls --production', function (t) { common.npm(['ls', '--production'], EXEC_OPTS, function (er, code, stdout) { t.ifError(er, 'ls --production ran without issue') @@ -80,6 +98,32 @@ test('npm ls --prod', function (t) { }) }) +test('npm ls --only=production', function (t) { + common.npm(['ls', '--only=production'], EXEC_OPTS, function (er, code, stdout) { + t.ifError(er, 'ls --only=production ran without issue') + t.notOk(code, 'npm exited ok') + t.has( + stdout, + /test-package-with-one-dep@0\.0\.0/, + 'output contains test-package-with-one-dep@0.0.0' + ) + t.end() + }) +}) + +test('npm ls --only=prod', function (t) { + common.npm(['ls', '--only=prod'], EXEC_OPTS, function (er, code, stdout) { + t.ifError(er, 'ls --only=prod ran without issue') + t.notOk(code, 'npm exited ok') + t.has( + stdout, + /test-package-with-one-dep@0\.0\.0/, + 'output contains test-package-with-one-dep@0.0.0' + ) + t.end() + }) +}) + test('cleanup', function (t) { cleanup() t.end() diff --git a/deps/npm/test/tap/ls-l-depth-0.js b/deps/npm/test/tap/ls-l-depth-0.js index 3b5ae4d20234cd..24fa0629087829 100644 --- a/deps/npm/test/tap/ls-l-depth-0.js +++ b/deps/npm/test/tap/ls-l-depth-0.js @@ -62,7 +62,9 @@ test('#6311: npm ll --depth=0 duplicates listing', function (t) { t.notOk(stderr, 'npm install ran silently') t.equal( stdout.trim(), - 'glock@1.8.7 node_modules/glock\n└── underscore@1.5.1', + resolve(__dirname, 'ls-l-depth-0') + + '\n└─┬ glock@1.8.7 ' + + '\n └── underscore@1.5.1', 'got expected install output' ) @@ -75,7 +77,7 @@ test('#6311: npm ll --depth=0 duplicates listing', function (t) { EXEC_OPTS, function (err, code, stdout, stderr) { t.ifError(err, 'npm ll ran without error') - t.notOk(code, 'npm ll exited cleanly') + t.is(code, 0, 'npm ll exited cleanly') t.notOk(stderr, 'npm ll ran silently') t.equal( stdout, diff --git a/deps/npm/test/tap/ls-no-results.js b/deps/npm/test/tap/ls-no-results.js index 10f3ce00145c35..9792774c69b296 100644 --- a/deps/npm/test/tap/ls-no-results.js +++ b/deps/npm/test/tap/ls-no-results.js @@ -1,11 +1,11 @@ -var test = require("tap").test -var spawn = require("child_process").spawn +var test = require('tap').test +var spawn = require('child_process').spawn var node = process.execPath -var npm = require.resolve("../../") -var args = [ npm, "ls", "ceci n’est pas une package" ] -test("ls exits non-zero when nothing found", function (t) { +var npm = require.resolve('../../') +var args = [ npm, 'ls', 'ceci n’est pas une package' ] +test('ls exits non-zero when nothing found', function (t) { var child = spawn(node, args) - child.on("exit", function (code) { + child.on('exit', function (code) { t.notEqual(code, 0) t.end() }) diff --git a/deps/npm/test/tap/ls-production-and-dev.js b/deps/npm/test/tap/ls-production-and-dev.js new file mode 100644 index 00000000000000..80d67ea5e55ecf --- /dev/null +++ b/deps/npm/test/tap/ls-production-and-dev.js @@ -0,0 +1,172 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap') + +var pkg = path.resolve(__dirname, 'ls-depth') + +var EXEC_OPTS = { cwd: pkg } + +var json = { + name: 'ls-env', + version: '0.0.0', + dependencies: { + 'test-package-with-one-dep': '0.0.0', + 'test-repo-url-ssh': '0.0.1' + }, + devDependencies: { + 'test-package-with-one-dep': '0.0.0', + 'test-repo-url-https': '0.0.1' + } +} + +test('setup', function (t) { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + mr({port: common.port}, function (er, s) { + common.npm( + [ + '--registry', common.registry, + 'install' + ], + EXEC_OPTS, + function (er, c) { + t.ifError(er, 'install ran without issue') + t.equal(c, 0) + s.close() + t.end() + } + ) + }) +}) + +test('npm ls --dev', function (t) { + common.npm(['ls', '--dev'], EXEC_OPTS, function (er, code, stdout) { + t.ifError(er, 'ls --dev ran without issue') + t.equal(code, 0) + t.has( + stdout, + /test-package-with-one-dep@0\.0\.0/, + 'output contains test-package-with-one-dep@0.0.0' + ) + t.has( + stdout, + /test-repo-url-https@0\.0\.1/, + 'output contains test-repo-url-https@0.0.1' + ) + t.doesNotHave( + stdout, + /test-repo-url-ssh@0\.0\.1/, + 'output does NOT contain test-repo-url-ssh@0.0.1' + ) + t.end() + }) +}) + +test('npm ls --only=development', function (t) { + common.npm(['ls', '--only=development'], EXEC_OPTS, function (er, code, stdout) { + t.ifError(er, 'ls --only=development ran without issue') + t.equal(code, 0) + t.has( + stdout, + /test-package-with-one-dep@0\.0\.0/, + 'output contains test-package-with-one-dep@0.0.0' + ) + t.end() + }) +}) + +test('npm ls --only=dev', function (t) { + common.npm(['ls', '--only=dev'], EXEC_OPTS, function (er, code, stdout) { + t.ifError(er, 'ls --only=dev ran without issue') + t.equal(code, 0) + t.has( + stdout, + /test-package-with-one-dep@0\.0\.0/, + 'output contains test-package-with-one-dep@0.0.0' + ) + t.end() + }) +}) + +test('npm ls --production', function (t) { + common.npm(['ls', '--production'], EXEC_OPTS, function (er, code, stdout) { + t.ifError(er, 'ls --production ran without issue') + t.notOk(code, 'npm exited ok') + t.has( + stdout, + /test-package-with-one-dep@0\.0\.0/, + 'output contains test-package-with-one-dep@0.0.0' + ) + t.has( + stdout, + /test-repo-url-ssh@0\.0\.1/, + 'output contains test-repo-url-ssh@0.0.1' + ) + t.doesNotHave( + stdout, + /test-repo-url-https@0\.0\.1/, + 'output does NOT contain test-repo-url-https@0.0.1' + ) + t.end() + }) +}) + +test('npm ls --prod', function (t) { + common.npm(['ls', '--prod'], EXEC_OPTS, function (er, code, stdout) { + t.ifError(er, 'ls --prod ran without issue') + t.notOk(code, 'npm exited ok') + t.has( + stdout, + /test-package-with-one-dep@0\.0\.0/, + 'output contains test-package-with-one-dep@0.0.0' + ) + t.end() + }) +}) + +test('npm ls --only=production', function (t) { + common.npm(['ls', '--only=production'], EXEC_OPTS, function (er, code, stdout) { + t.ifError(er, 'ls --only=production ran without issue') + t.notOk(code, 'npm exited ok') + t.has( + stdout, + /test-package-with-one-dep@0\.0\.0/, + 'output contains test-package-with-one-dep@0.0.0' + ) + t.end() + }) +}) + +test('npm ls --only=prod', function (t) { + common.npm(['ls', '--only=prod'], EXEC_OPTS, function (er, code, stdout) { + t.ifError(er, 'ls --only=prod ran without issue') + t.notOk(code, 'npm exited ok') + t.has( + stdout, + /test-package-with-one-dep@0\.0\.0/, + 'output contains test-package-with-one-dep@0.0.0' + ) + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/deps/npm/test/tap/ls-top-errors.js b/deps/npm/test/tap/ls-top-errors.js new file mode 100644 index 00000000000000..69b8b299c81710 --- /dev/null +++ b/deps/npm/test/tap/ls-top-errors.js @@ -0,0 +1,71 @@ +'use strict' +var fs = require('fs') +var path = require('path') + +var test = require('tap').test +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') + +var common = require('../common-tap') + +var pkg = path.resolve(__dirname, path.basename(__filename, '.js')) +var pathModA = path.join(pkg, 'node_modules', 'moduleA') +var pathModB = path.join(pkg, 'node_modules', 'moduleB') + +var modA = { + name: 'moduleA', + version: '1.0.0', + _requiredBy: [ '#USER', '/moduleB' ], + dependencies: { + moduleB: '1.0.0' + } +} +var modB = { + name: 'moduleB', + version: '1.0.0', + _requiredBy: [ '/moduleA' ], + dependencies: { + moduleA: '1.0.0' + } +} + +function setup () { + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + '{broken json' + ) + mkdirp.sync(pathModA) + fs.writeFileSync( + path.join(pathModA, 'package.json'), + JSON.stringify(modA, null, 2) + ) + mkdirp.sync(pathModB) + fs.writeFileSync( + path.join(pathModB, 'package.json'), + JSON.stringify(modB, null, 2) + ) +} + +function cleanup () { + rimraf.sync(pkg) +} + +test('setup', function (t) { + cleanup() + setup() + t.end() +}) + +test('ls-top-errors', function (t) { + common.npm(['ls'], {cwd: pkg}, function (er, code, stdout, stderr) { + t.ifErr(er, 'install finished successfully') + t.match(stderr, /Failed to parse json/) + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) diff --git a/deps/npm/test/tap/map-to-registry.js b/deps/npm/test/tap/map-to-registry.js index 9f6673b92c0d6c..d9677bd7e0fceb 100644 --- a/deps/npm/test/tap/map-to-registry.js +++ b/deps/npm/test/tap/map-to-registry.js @@ -48,7 +48,7 @@ test('mapRegistryToURI', function (t) { password: undefined, email: undefined, auth: undefined, - alwaysAuth: undefined + alwaysAuth: false }) t.equal(registry, 'http://reg.npm/design/-/rewrite/') }) @@ -66,7 +66,7 @@ test('mapRegistryToURI', function (t) { password: undefined, email: undefined, auth: undefined, - alwaysAuth: undefined + alwaysAuth: false }) t.equal(registry, 'http://reg.npm/-/rewrite/') }) @@ -84,8 +84,83 @@ test('mapRegistryToURI', function (t) { password: undefined, email: undefined, auth: undefined, - alwaysAuth: undefined + alwaysAuth: false }) t.equal(registry, 'http://reg.npm/design/-/rewrite/relative/') }) }) + +test('mapToRegistry token scoping', function (t) { + npm.config.set('scope', '') + npm.config.set('registry', 'https://reg.npm/') + npm.config.set('//reg.npm/:_authToken', 'r-token') + + t.test('pass token to registry host', function (t) { + mapRegistry( + 'https://reg.npm/packages/e/easy-1.0.0.tgz', + npm.config, + function (er, uri, auth, registry) { + t.ifError(er, 'mapRegistryToURI worked') + t.equal(uri, 'https://reg.npm/packages/e/easy-1.0.0.tgz') + t.deepEqual(auth, { + scope: '//reg.npm/', + token: 'r-token', + username: undefined, + password: undefined, + email: undefined, + auth: undefined, + alwaysAuth: false + }) + t.equal(registry, 'https://reg.npm/') + } + ) + t.end() + }) + + t.test("don't pass token to non-registry host", function (t) { + mapRegistry( + 'https://butts.lol/packages/e/easy-1.0.0.tgz', + npm.config, + function (er, uri, auth, registry) { + t.ifError(er, 'mapRegistryToURI worked') + t.equal(uri, 'https://butts.lol/packages/e/easy-1.0.0.tgz') + t.deepEqual(auth, { + scope: '//reg.npm/', + token: undefined, + username: undefined, + password: undefined, + email: undefined, + auth: undefined, + alwaysAuth: false + }) + t.equal(registry, 'https://reg.npm/') + } + ) + t.end() + }) + + t.test('pass token to non-registry host with always-auth', function (t) { + npm.config.set('always-auth', true) + mapRegistry( + 'https://butts.lol/packages/e/easy-1.0.0.tgz', + npm.config, + function (er, uri, auth, registry) { + t.ifError(er, 'mapRegistryToURI worked') + t.equal(uri, 'https://butts.lol/packages/e/easy-1.0.0.tgz') + t.deepEqual(auth, { + scope: '//reg.npm/', + token: 'r-token', + username: undefined, + password: undefined, + email: undefined, + auth: undefined, + alwaysAuth: true + }) + t.equal(registry, 'https://reg.npm/') + } + ) + t.end() + }) + + t.end() +}) diff --git a/deps/npm/test/tap/nerf-dart.js b/deps/npm/test/tap/nerf-dart.js index 157f6c7dfe4b5d..a6df7272c304af 100644 --- a/deps/npm/test/tap/nerf-dart.js +++ b/deps/npm/test/tap/nerf-dart.js @@ -1,32 +1,32 @@ // taken from https://raw.githubusercontent.com/indexzero/npm/bd3cad01fbd3ab481d2f5da441b9eead16029123/test/tap/config-nerf-dart.js // originally written by Charlie Robbins, https://github.com/indexzero -var test = require("tap").test -var toNerfDart = require("../../lib/config/nerf-dart.js") +var test = require('tap').test +var toNerfDart = require('../../lib/config/nerf-dart.js') function validNerfDart (uri, valid) { - if (!valid) valid = "//registry.npmjs.org/" + if (!valid) valid = '//registry.npmjs.org/' test(uri, function (t) { t.equal(toNerfDart(uri), valid) t.end() }) } -validNerfDart("http://registry.npmjs.org") -validNerfDart("http://registry.npmjs.org/some-package") -validNerfDart("http://registry.npmjs.org/some-package?write=true") -validNerfDart("http://user:pass@registry.npmjs.org/some-package?write=true") -validNerfDart("http://registry.npmjs.org/#random-hash") -validNerfDart("http://registry.npmjs.org/some-package#random-hash") +validNerfDart('http://registry.npmjs.org') +validNerfDart('http://registry.npmjs.org/some-package') +validNerfDart('http://registry.npmjs.org/some-package?write=true') +validNerfDart('http://user:pass@registry.npmjs.org/some-package?write=true') +validNerfDart('http://registry.npmjs.org/#random-hash') +validNerfDart('http://registry.npmjs.org/some-package#random-hash') validNerfDart( - "http://relative.couchapp.npm/design/-/rewrite/", - "//relative.couchapp.npm/design/-/rewrite/" + 'http://relative.couchapp.npm/design/-/rewrite/', + '//relative.couchapp.npm/design/-/rewrite/' ) validNerfDart( - "http://relative.couchapp.npm:8080/design/-/rewrite/", - "//relative.couchapp.npm:8080/design/-/rewrite/" + 'http://relative.couchapp.npm:8080/design/-/rewrite/', + '//relative.couchapp.npm:8080/design/-/rewrite/' ) validNerfDart( - "http://relative.couchapp.npm:8080/design/-/rewrite/some-package", - "//relative.couchapp.npm:8080/design/-/rewrite/" + 'http://relative.couchapp.npm:8080/design/-/rewrite/some-package', + '//relative.couchapp.npm:8080/design/-/rewrite/' ) diff --git a/deps/npm/test/tap/nested-extraneous.js b/deps/npm/test/tap/nested-extraneous.js index fcba0418e6869b..99d4bea5b9b1c5 100644 --- a/deps/npm/test/tap/nested-extraneous.js +++ b/deps/npm/test/tap/nested-extraneous.js @@ -1,42 +1,42 @@ -var common = require("../common-tap.js") -var test = require("tap").test -var mkdirp = require("mkdirp") -var fs = require("fs") -var rimraf = require("rimraf") -var path = require("path") +var common = require('../common-tap.js') +var test = require('tap').test +var mkdirp = require('mkdirp') +var fs = require('fs') +var rimraf = require('rimraf') +var path = require('path') -var pkg = path.resolve(__dirname, "nested-extraneous") +var pkg = path.resolve(__dirname, 'nested-extraneous') var pj = { - name: "nested-extraneous", - version: "1.2.3" + name: 'nested-extraneous', + version: '1.2.3' } -var dep = path.resolve(pkg, "node_modules", "dep") +var dep = path.resolve(pkg, 'node_modules', 'dep') var deppj = { - name: "nested-extraneous-dep", - version: "1.2.3", + name: 'nested-extraneous-dep', + version: '1.2.3', dependencies: { - "nested-extra-depdep": "*" + 'nested-extra-depdep': '*' } } -var depdep = path.resolve(dep, "node_modules", "depdep") +var depdep = path.resolve(dep, 'node_modules', 'depdep') var depdeppj = { - name: "nested-extra-depdep", - version: "1.2.3" + name: 'nested-extra-depdep', + version: '1.2.3' } -test("setup", function (t) { +test('setup', function (t) { rimraf.sync(pkg) mkdirp.sync(depdep) - fs.writeFileSync(path.resolve(pkg, "package.json"), JSON.stringify(pj)) - fs.writeFileSync(path.resolve(dep, "package.json"), JSON.stringify(deppj)) - fs.writeFileSync(path.resolve(depdep, "package.json"), JSON.stringify(depdeppj)) + fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify(pj)) + fs.writeFileSync(path.resolve(dep, 'package.json'), JSON.stringify(deppj)) + fs.writeFileSync(path.resolve(depdep, 'package.json'), JSON.stringify(depdeppj)) t.end() }) -test("test", function (t) { - common.npm(["ls"], { +test('test', function (t) { + common.npm(['ls'], { cwd: pkg }, function (er, code, sto, ste) { if (er) throw er @@ -47,7 +47,7 @@ test("test", function (t) { }) }) -test("clean", function (t) { +test('clean', function (t) { rimraf.sync(pkg) t.end() }) diff --git a/deps/npm/test/tap/no-global-warns.js b/deps/npm/test/tap/no-global-warns.js new file mode 100644 index 00000000000000..2d831eaae9f465 --- /dev/null +++ b/deps/npm/test/tap/no-global-warns.js @@ -0,0 +1,69 @@ +'use strict' +var path = require('path') +var test = require('tap').test +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var writeFileSync = require('fs').writeFileSync +var common = require('../common-tap.js') + +var base = path.join(__dirname, path.basename(__filename, '.js')) +var mockGlobal = path.join(base, 'global') +var toInstall = path.join(base, 'to-install') + +var config = 'prefix = ' + base +var configPath = path.join(base, '_npmrc') + +var extend = Object.assign || require('util')._extend + +var OPTS = { + env: extend({ + 'npm_config_userconfig': configPath + }, process.env) +} + +var installJSON = { + name: 'to-install', + version: '1.0.0', + description: '', + main: 'index.js', + scripts: { + test: 'echo \"Error: no test specified\" && exit 1' + }, + author: '', + license: 'ISC' +} + +test('setup', function (t) { + setup() + t.end() +}) + +test('no-global-warns', function (t) { + common.npm(['install', '-g', toInstall], OPTS, function (err, code, stdout, stderr) { + t.ifError(err, 'installed w/o error') + t.is(stderr, '', 'no warnings printed to stderr') + t.end() + }) +}) + +test('cleanup', function (t) { + process.chdir(osenv.tmpdir()) + cleanup() + t.end() +}) + +function cleanup () { + rimraf.sync(base) +} + +function setup () { + cleanup() + mkdirp.sync(mockGlobal) + mkdirp.sync(toInstall) + writeFileSync( + path.join(toInstall, 'package.json'), + JSON.stringify(installJSON, null, 2) + ) + writeFileSync(configPath, config) +} diff --git a/deps/npm/test/tap/no-scan-full-global-dir.js b/deps/npm/test/tap/no-scan-full-global-dir.js new file mode 100644 index 00000000000000..ca051fc6287c6c --- /dev/null +++ b/deps/npm/test/tap/no-scan-full-global-dir.js @@ -0,0 +1,100 @@ +'use strict' +var fs = require('fs') +var path = require('path') +var test = require('tap').test +var requireInject = require('require-inject') +var osenv = require('osenv') +var inherits = require('inherits') +var npm = require('../../lib/npm.js') + +var packages = { + test: {package: {name: 'test'}, path: __dirname, children: ['abc', 'def', 'ghi', 'jkl']}, + abc: {package: {name: 'abc'}, path: path.join(__dirname, 'node_modules', 'abc')}, + def: {package: {name: 'def'}, path: path.join(__dirname, 'node_modules', 'def')}, + ghi: {package: {name: 'ghi'}, path: path.join(__dirname, 'node_modules', 'ghi')}, + jkl: {package: {name: 'jkl'}, path: path.join(__dirname, 'node_modules', 'jkl')} +} +var dirs = {} +var files = {} +Object.keys(packages).forEach(function (name) { + dirs[path.join(packages[name].path, 'node_modules')] = packages[name].children || [] + files[path.join(packages[name].path, 'package.json')] = packages[name].package +}) + +process.chdir(osenv.tmpdir()) + +var mockReaddir = function (name, cb) { + if (dirs[name]) return cb(null, dirs[name]) + var er = new Error('No such mock: ' + name) + er.code = 'ENOENT' + cb(er) +} +var mockReadPackageJson = function (file, cb) { + if (files[file]) return cb(null, files[file]) + var er = new Error('No such mock: ' + file) + er.code = 'ENOENT' + cb(er) +} +var mockFs = Object.create(fs) +mockFs.realpath = function (dir, cb) { + return cb(null, dir) +} + +test('setup', function (t) { + npm.load(function () { + t.pass('npm loaded') + t.end() + }) +}) + +function loadArgMetadata (cb) { + this.args = this.args.map(function (arg) { return {name: arg} }) + cb() +} + +test('installer', function (t) { + t.plan(1) + var installer = requireInject('../../lib/install.js', { + 'fs': mockFs, + 'readdir-scoped-modules': mockReaddir, + 'read-package-json': mockReadPackageJson + }) + + var Installer = installer.Installer + var TestInstaller = function () { + Installer.apply(this, arguments) + this.global = true + } + inherits(TestInstaller, Installer) + TestInstaller.prototype.loadArgMetadata = loadArgMetadata + + var inst = new TestInstaller(__dirname, false, ['def', 'abc']) + inst.loadCurrentTree(function () { + var kids = inst.currentTree.children.map(function (child) { return child.package.name }) + t.isDeeply(kids, ['abc', 'def']) + t.end() + }) +}) + +test('uninstaller', function (t) { + t.plan(1) + var uninstaller = requireInject('../../lib/uninstall.js', { + 'fs': mockFs, + 'readdir-scoped-modules': mockReaddir, + 'read-package-json': mockReadPackageJson + }) + + var Uninstaller = uninstaller.Uninstaller + var TestUninstaller = function () { + Uninstaller.apply(this, arguments) + this.global = true + } + inherits(TestUninstaller, Uninstaller) + + var uninst = new TestUninstaller(__dirname, false, ['ghi', 'jkl']) + uninst.loadCurrentTree(function () { + var kids = uninst.currentTree.children.map(function (child) { return child.package.name }) + t.isDeeply(kids, ['ghi', 'jkl']) + t.end() + }) +}) diff --git a/deps/npm/test/tap/noargs-install-config-save.js b/deps/npm/test/tap/noargs-install-config-save.js index b6900b431740d2..074d5e848df38f 100644 --- a/deps/npm/test/tap/noargs-install-config-save.js +++ b/deps/npm/test/tap/noargs-install-config-save.js @@ -1,82 +1,78 @@ -var common = require("../common-tap.js") -var test = require("tap").test -var npm = require.resolve("../../bin/npm-cli.js") -var path = require("path") -var fs = require("fs") -var rimraf = require("rimraf") -var mkdirp = require("mkdirp") +var common = require('../common-tap.js') +var test = require('tap').test +var path = require('path') +var fs = require('fs') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') -var mr = require("npm-registry-mock") +var mr = require('npm-registry-mock') -var spawn = require("child_process").spawn -var node = process.execPath +var pkg = path.resolve(process.env.npm_config_tmp || '/tmp', + 'noargs-install-config-save') -var pkg = path.resolve(process.env.npm_config_tmp || "/tmp", - "noargs-install-config-save") - -function writePackageJson() { +function writePackageJson () { rimraf.sync(pkg) mkdirp.sync(pkg) - mkdirp.sync(pkg + "/cache") + mkdirp.sync(pkg + '/cache') - fs.writeFileSync(pkg + "/package.json", JSON.stringify({ - "author": "Rocko Artischocko", - "name": "noargs", - "version": "0.0.0", - "devDependencies": { - "underscore": "1.3.1" + fs.writeFileSync(pkg + '/package.json', JSON.stringify({ + 'author': 'Rocko Artischocko', + 'name': 'noargs', + 'version': '0.0.0', + 'devDependencies': { + 'underscore': '1.3.1' } - }), "utf8") + }), 'utf8') } -function createChild (args) { - var env = { - "npm_config_save": true, - "npm_config_registry": common.registry, - "npm_config_cache": pkg + "/cache", - HOME: process.env.HOME, - Path: process.env.PATH, - PATH: process.env.PATH - } - - if (process.platform === "win32") - env.npm_config_cache = "%APPDATA%\\npm-cache" - - return spawn(node, args, { - cwd: pkg, - env: env - }) +var env = { + 'npm_config_save': true, + 'npm_config_registry': common.registry, + 'npm_config_cache': pkg + '/cache', + HOME: process.env.HOME, + Path: process.env.PATH, + PATH: process.env.PATH +} +var OPTS = { + cwd: pkg, + env: env } -test("does not update the package.json with empty arguments", function (t) { +test('does not update the package.json with empty arguments', function (t) { writePackageJson() - t.plan(1) + t.plan(2) - mr({port : common.port}, function (er, s) { - var child = createChild([npm, "install"]) - child.on("close", function () { - var text = JSON.stringify(fs.readFileSync(pkg + "/package.json", "utf8")) + mr({ port: common.port }, function (er, s) { + common.npm('install', OPTS, function (er, code, stdout, stderr) { + if (er) throw er + t.is(code, 0) + if (code !== 0) { + console.error('#', stdout) + console.error('#', stderr) + } + var text = JSON.stringify(fs.readFileSync(pkg + '/package.json', 'utf8')) s.close() - t.ok(text.indexOf("\"dependencies") === -1) + t.equal(text.indexOf('"dependencies'), -1, 'dependencies do not exist in file') }) }) }) -test("updates the package.json (adds dependencies) with an argument", function (t) { +test('updates the package.json (adds dependencies) with an argument', function (t) { writePackageJson() - t.plan(1) + t.plan(2) - mr({port : common.port}, function (er, s) { - var child = createChild([npm, "install", "underscore"]) - child.on("close", function () { + mr({ port: common.port }, function (er, s) { + common.npm(['install', 'underscore'], OPTS, function (er, code, stdout, stderr) { + if (er) throw er + t.is(code, 0) s.close() - var text = JSON.stringify(fs.readFileSync(pkg + "/package.json", "utf8")) - t.ok(text.indexOf("\"dependencies") !== -1) + var text = JSON.stringify(fs.readFileSync(pkg + '/package.json', 'utf8')) + t.notEqual(text.indexOf('"dependencies'), -1, 'dependencies exist in file') }) }) }) -test("cleanup", function (t) { - rimraf.sync(pkg + "/cache") +test('cleanup', function (t) { + rimraf.sync(pkg + '/cache') t.end() }) diff --git a/deps/npm/test/tap/normalize-package-explode.js b/deps/npm/test/tap/normalize-package-explode.js new file mode 100644 index 00000000000000..57faec8b60250d --- /dev/null +++ b/deps/npm/test/tap/normalize-package-explode.js @@ -0,0 +1,26 @@ +'use strict' +var test = require('tap').test +var log = require('npmlog') +var npm = require('../../lib/npm.js') + +var idealTree = { + package: { + name: 'a b c', + version: '3.what' + }, + children: [], + warnings: [] +} + +test('setup', function (t) { + npm.load({}, t.end) +}) + +test('validate-tree', function (t) { + log.disableProgress() + var validateTree = require('../../lib/install/validate-tree.js') + validateTree(idealTree, log.newGroup('validate'), function (er) { + t.pass("we didn't crash") + t.end() + }) +}) diff --git a/deps/npm/test/tap/npm-api-not-loaded-error.js b/deps/npm/test/tap/npm-api-not-loaded-error.js index afedfbcd076f50..48b71e5213a7c8 100644 --- a/deps/npm/test/tap/npm-api-not-loaded-error.js +++ b/deps/npm/test/tap/npm-api-not-loaded-error.js @@ -1,47 +1,47 @@ -var test = require("tap").test -var npm = require("../..") -var path = require("path") -var rimraf = require("rimraf") -var npmrc = path.join(__dirname, "npmrc") -var fs = require("fs") +var test = require('tap').test +var npm = require('../..') +var path = require('path') +var rimraf = require('rimraf') +var npmrc = path.join(__dirname, 'npmrc') +var fs = require('fs') -test("setup", function (t) { - fs.writeFileSync(npmrc, "foo = bar\n", "ascii") +test('setup', function (t) { + fs.writeFileSync(npmrc, 'foo = bar\n', 'ascii') t.end() }) -test("calling set/get on config pre-load should throw", function (t) { +test('calling set/get on config pre-load should throw', function (t) { var threw = true try { - npm.config.get("foo") + npm.config.get('foo') threw = false } catch (er) { - t.equal(er.message, "npm.load() required") + t.equal(er.message, 'npm.load() required') } finally { - t.ok(threw, "get before load should throw") + t.ok(threw, 'get before load should throw') } threw = true try { - npm.config.set("foo", "bar") + npm.config.set('foo', 'bar') threw = false } catch (er) { - t.equal(er.message, "npm.load() required") + t.equal(er.message, 'npm.load() required') } finally { - t.ok(threw, "set before load should throw") + t.ok(threw, 'set before load should throw') } npm.load({ userconfig: npmrc }, function (er) { - if (er) - throw er - t.equal(npm.config.get("foo"), "bar") - npm.config.set("foo", "baz") - t.equal(npm.config.get("foo"), "baz") + if (er) throw er + + t.equal(npm.config.get('foo'), 'bar') + npm.config.set('foo', 'baz') + t.equal(npm.config.get('foo'), 'baz') t.end() }) }) -test("cleanup", function (t) { +test('cleanup', function (t) { rimraf.sync(npmrc) t.end() }) diff --git a/deps/npm/test/tap/onload.js b/deps/npm/test/tap/onload.js new file mode 100644 index 00000000000000..8d2b6c743bab8e --- /dev/null +++ b/deps/npm/test/tap/onload.js @@ -0,0 +1,39 @@ +var path = require('path') +var test = require('tap').test +var rimraf = require('rimraf') +var common = require('../common-tap.js') +var opts = { cwd: __dirname } +var binDir = '../../node_modules/.bin' +var fixture = path.resolve(__dirname, binDir) +var onload = path.resolve(__dirname, '../fixtures/onload.js') + +test('setup', function (t) { + rimraf.sync(path.join(__dirname, 'node_modules')) + t.end() +}) + +test('npm bin with valid onload script', function (t) { + var args = ['--onload', onload, 'bin'] + common.npm(args, opts, function (err, code, stdout, stderr) { + t.ifError(err, 'bin ran without issue') + t.equal(stderr.trim(), 'called onload') + t.equal(code, 0, 'exit ok') + t.equal(stdout, fixture + '\n') + t.end() + }) +}) + +test('npm bin with invalid onload script', function (t) { + var onloadScript = onload + 'jsfd' + var args = ['--onload', onloadScript, '--loglevel=warn', 'bin'] + common.npm(args, opts, function (err, code, stdout, stderr) { + t.ifError(err, 'bin ran without issue') + t.match(stderr, /npm WARN onload-script failed to require onload script/) + t.match(stderr, /MODULE_NOT_FOUND/) + t.notEqual(stderr.indexOf(onloadScript), -1) + t.equal(code, 0, 'exit ok') + var res = path.resolve(stdout) + t.equal(res, fixture + '\n') + t.end() + }) +}) diff --git a/deps/npm/test/tap/optional-metadep-rollback-collision.js b/deps/npm/test/tap/optional-metadep-rollback-collision.js index 4b21f965ed12fc..d5116f30fc32cf 100644 --- a/deps/npm/test/tap/optional-metadep-rollback-collision.js +++ b/deps/npm/test/tap/optional-metadep-rollback-collision.js @@ -10,7 +10,7 @@ var common = require('../common-tap.js') var pkg = path.resolve(__dirname, 'optional-metadep-rollback-collision') var deps = path.resolve(pkg, 'deps') -var nm = path.resolve(pkg, 'node_modules') +var opdep = path.resolve(pkg, 'node_modules', 'opdep') var cache = path.resolve(pkg, 'cache') var pidfile = path.resolve(pkg, 'child.pid') @@ -49,7 +49,7 @@ var d2 = { } } -var opdep = { +var opdep_json = { name: 'opdep', version: '1.0.0', description: 'To explode, of course!', @@ -63,7 +63,6 @@ var opdep = { } } - var badServer = function () {/* var createServer = require('http').createServer var spawn = require('child_process').spawn @@ -179,7 +178,7 @@ test('setup', function (t) { mkdirp.sync(path.join(deps, 'opdep')) fs.writeFileSync( path.join(deps, 'opdep', 'package.json'), - JSON.stringify(opdep, null, 2) + JSON.stringify(opdep_json, null, 2) ) fs.writeFileSync(path.join(deps, 'opdep', 'bad-server.js'), badServer) @@ -205,9 +204,12 @@ test('go go test racer', function (t) { }, function (er, code, stdout, stderr) { t.ifError(er, 'install ran to completion without error') - t.notOk(code, 'npm install exited with code 0') + t.is(code, 0, 'npm install exited with code 0') + t.is(stderr, '') - t.equal(stdout, 'ok\nok\n') + // stdout should be empty, because we only have one, optional, dep and + // if it fails we shouldn't try installing anything + t.equal(stdout, '') t.notOk(/not ok/.test(stdout), 'should not contain the string \'not ok\'') t.end() } @@ -216,7 +218,7 @@ test('go go test racer', function (t) { test('verify results', function (t) { t.throws(function () { - fs.statSync(nm) + fs.statSync(opdep) }) t.end() }) diff --git a/deps/npm/test/tap/outdated-color.js b/deps/npm/test/tap/outdated-color.js index b35070c4503421..a0da3370261fbb 100644 --- a/deps/npm/test/tap/outdated-color.js +++ b/deps/npm/test/tap/outdated-color.js @@ -50,10 +50,10 @@ test('does not use ansi styling', function (t) { t.plan(4) mr({ port: common.port }, function (er, s) { // create mock registry. common.npm( - [ - '--registry', common.registry, - 'outdated', 'underscore' - ], + [ + '--registry', common.registry, + 'outdated', 'underscore' + ], EXEC_OPTS, function (err, code, stdout) { t.ifError(err) diff --git a/deps/npm/test/tap/outdated-depth-deep.js b/deps/npm/test/tap/outdated-depth-deep.js index c208669b377877..27c5f3e9fcaa2a 100644 --- a/deps/npm/test/tap/outdated-depth-deep.js +++ b/deps/npm/test/tap/outdated-depth-deep.js @@ -1,26 +1,26 @@ -var common = require("../common-tap") - , path = require("path") - , test = require("tap").test - , rimraf = require("rimraf") - , npm = require("../../") - , mr = require("npm-registry-mock") - , pkg = path.resolve(__dirname, "outdated-depth-deep") - , cache = path.resolve(pkg, "cache") +var common = require('../common-tap') +var path = require('path') +var test = require('tap').test +var rimraf = require('rimraf') +var npm = require('../../') +var mr = require('npm-registry-mock') +var pkg = path.resolve(__dirname, 'outdated-depth-deep') +var cache = path.resolve(pkg, 'cache') -var osenv = require("osenv") -var mkdirp = require("mkdirp") -var fs = require("fs") +var osenv = require('osenv') +var mkdirp = require('mkdirp') +var fs = require('fs') var pj = JSON.stringify({ - "name": "whatever", - "description": "yeah idk", - "version": "1.2.3", - "main": "index.js", - "dependencies": { - "underscore": "1.3.1", - "npm-test-peer-deps": "0.0.0" + 'name': 'whatever', + 'description': 'yeah idk', + 'version': '1.2.3', + 'main': 'index.js', + 'dependencies': { + 'underscore': '1.3.1', + 'npm-test-peer-deps': '0.0.0' }, - "repository": "git://github.com/luk-/whatever" + 'repository': 'git://github.com/luk-/whatever' }, null, 2) function cleanup () { @@ -31,33 +31,37 @@ function cleanup () { function setup () { mkdirp.sync(pkg) process.chdir(pkg) - fs.writeFileSync(path.resolve(pkg, "package.json"), pj) + fs.writeFileSync(path.resolve(pkg, 'package.json'), pj) } -test("setup", function (t) { +test('setup', function (t) { cleanup() setup() t.end() }) -test("outdated depth deep (9999)", function (t) { - var underscoreOutdated = ["underscore", "1.3.1", "1.3.1", "1.5.1", "1.3.1"] - var childPkg = path.resolve(pkg, "node_modules", "npm-test-peer-deps") +test('outdated depth deep (9999)', function (t) { + var underscoreOutdated = ['underscore', '1.3.1', '1.3.1', '1.5.1', '1.3.1'] + var childPkg = path.resolve(pkg, 'node_modules', 'npm-test-peer-deps') - var expected = [ [pkg].concat(underscoreOutdated), - [childPkg].concat(underscoreOutdated) ] + var expected = [ [childPkg].concat(underscoreOutdated).concat([null]), + [pkg].concat(underscoreOutdated).concat([null]) ] process.chdir(pkg) - mr({port : common.port}, function (er, s) { + mr({ port: common.port }, function (er, s) { npm.load({ - cache: cache - , loglevel: "silent" - , registry: common.registry - , depth: 9999 - } - , function () { - npm.install(".", function (er) { + cache: cache, + loglevel: 'silent', + registry: common.registry, + depth: 9999 + }, + function () { + npm.install('.', function (er) { + if (er) throw new Error(er) + var nodepath = process.env.npm_node_execpath || process.env.NODE || process.execPath + var clibin = path.resolve(__dirname, '../../bin/npm-cli.js') + npm.explore('npm-test-peer-deps', nodepath, clibin, 'install', 'underscore', function (er) { if (er) throw new Error(er) npm.outdated(function (err, d) { if (err) throw new Error(err) @@ -66,13 +70,12 @@ test("outdated depth deep (9999)", function (t) { t.end() }) }) - } - ) + }) + }) }) }) - -test("cleanup", function (t) { +test('cleanup', function (t) { cleanup() t.end() }) diff --git a/deps/npm/test/tap/outdated-depth-integer.js b/deps/npm/test/tap/outdated-depth-integer.js index 485e84e30f2631..a1fc2b99d290f4 100644 --- a/deps/npm/test/tap/outdated-depth-integer.js +++ b/deps/npm/test/tap/outdated-depth-integer.js @@ -1,24 +1,24 @@ var common = require('../common-tap') - , test = require('tap').test - , rimraf = require('rimraf') - , npm = require('../../') - , mr = require('npm-registry-mock') - , pkg = __dirname + '/outdated-depth-integer' +var test = require('tap').test +var rimraf = require('rimraf') +var npm = require('../../') +var mr = require('npm-registry-mock') +var pkg = __dirname + '/outdated-depth-integer' -var osenv = require("osenv") -var mkdirp = require("mkdirp") -var fs = require("fs") +var osenv = require('osenv') +var mkdirp = require('mkdirp') +var fs = require('fs') var pj = JSON.stringify({ - "name": "whatever", - "description": "yeah idk", - "version": "1.2.3", - "main": "index.js", - "dependencies": { - "underscore": "1.3.1" + 'name': 'whatever', + 'description': 'yeah idk', + 'version': '1.2.3', + 'main': 'index.js', + 'dependencies': { + 'underscore': '1.3.1' }, - "repository": "git://github.com/luk-/whatever" -}, null, 2); + 'repository': 'git://github.com/luk-/whatever' +}, null, 2) function cleanup () { process.chdir(osenv.tmpdir()) @@ -28,10 +28,10 @@ function cleanup () { function setup () { mkdirp.sync(pkg) process.chdir(pkg) - fs.writeFileSync("package.json", pj) + fs.writeFileSync('package.json', pj) } -test("setup", function (t) { +test('setup', function (t) { cleanup() setup() t.end() @@ -46,32 +46,32 @@ test('outdated depth integer', function (t) { undefined, // no version installed '1.3.1', // wanted '1.5.1', // latest - '1.3.1' + '1.3.1', + null ]] - mr({port : common.port}, function (er, s) { + mr({ port: common.port }, function (er, s) { npm.load({ - cache: pkg + '/cache' - , loglevel: 'silent' - , registry: common.registry - , depth: 5 + cache: pkg + '/cache', + loglevel: 'silent', + registry: common.registry, + depth: 5 } , function () { - npm.install('request@0.9.0', function (er) { - if (er) throw new Error(er) - npm.outdated(function (err, d) { - if (err) throw new Error(err) - t.deepEqual(d, expected) - s.close() - t.end() - }) + npm.install('request@0.9.0', function (er) { + if (er) throw new Error(er) + npm.outdated(function (err, d) { + if (err) throw new Error(err) + t.deepEqual(d, expected) + s.close() + t.end() }) - } - ) + }) + }) }) }) -test("cleanup", function (t) { +test('cleanup', function (t) { cleanup() t.end() }) diff --git a/deps/npm/test/tap/outdated-depth.js b/deps/npm/test/tap/outdated-depth.js index 2f06127917446d..13220dfa7bf6cb 100644 --- a/deps/npm/test/tap/outdated-depth.js +++ b/deps/npm/test/tap/outdated-depth.js @@ -40,7 +40,8 @@ test('outdated depth zero', function (t) { '1.3.1', '1.3.1', '1.5.1', - '1.3.1' + '1.3.1', + null ] mr({ port: common.port }, function (er, s) { diff --git a/deps/npm/test/tap/outdated-git.js b/deps/npm/test/tap/outdated-git.js index 2162c743c142eb..1a61a0c4d2719f 100644 --- a/deps/npm/test/tap/outdated-git.js +++ b/deps/npm/test/tap/outdated-git.js @@ -2,7 +2,7 @@ var path = require('path') var test = require('tap').test var mkdirp = require('mkdirp') -var fs = require("graceful-fs") +var fs = require('graceful-fs') var rimraf = require('rimraf') var common = require('../common-tap.js') diff --git a/deps/npm/test/tap/outdated-local.js b/deps/npm/test/tap/outdated-local.js index f9b8af4420f861..067696ca903510 100644 --- a/deps/npm/test/tap/outdated-local.js +++ b/deps/npm/test/tap/outdated-local.js @@ -65,7 +65,6 @@ var pjLocalOptimistBumped = JSON.stringify({ version: '0.5.0' }, null, 2) + '\n' - function mocks (server) { server.get('/local-module') .reply(404) diff --git a/deps/npm/test/tap/outdated-notarget.js b/deps/npm/test/tap/outdated-notarget.js index 6058ddee422fcc..14388a80bc2922 100644 --- a/deps/npm/test/tap/outdated-notarget.js +++ b/deps/npm/test/tap/outdated-notarget.js @@ -1,23 +1,23 @@ // Fixes Issue #1770 -var common = require("../common-tap.js") -var test = require("tap").test -var npm = require("../../") -var osenv = require("osenv") -var path = require("path") -var fs = require("fs") -var rimraf = require("rimraf") -var mkdirp = require("mkdirp") -var pkg = path.resolve(__dirname, "outdated-notarget") -var cache = path.resolve(pkg, "cache") -var mr = require("npm-registry-mock") +var common = require('../common-tap.js') +var test = require('tap').test +var npm = require('../../') +var osenv = require('osenv') +var path = require('path') +var fs = require('fs') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var pkg = path.resolve(__dirname, 'outdated-notarget') +var cache = path.resolve(pkg, 'cache') +var mr = require('npm-registry-mock') -test("outdated-target: if no viable version is found, show error", function (t) { +test('outdated-target: if no viable version is found, show error', function (t) { t.plan(1) setup() - mr({port : common.port}, function (er, s) { - npm.load({ cache: cache, registry: common.registry}, function () { + mr({ port: common.port }, function (er, s) { + npm.load({ cache: cache, registry: common.registry }, function () { npm.commands.update(function (er) { - t.equal(er.code, "ETARGET") + t.equal(er.code, 'ETARGET') s.close() t.end() }) @@ -25,23 +25,23 @@ test("outdated-target: if no viable version is found, show error", function (t) }) }) -test("cleanup", function (t) { +test('cleanup', function (t) { process.chdir(osenv.tmpdir()) rimraf.sync(pkg) t.end() }) -function setup() { +function setup () { mkdirp.sync(pkg) mkdirp.sync(cache) - fs.writeFileSync(path.resolve(pkg, "package.json"), JSON.stringify({ - author: "Evan Lucas", - name: "outdated-notarget", - version: "0.0.0", - description: "Test for outdated-target", + fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({ + author: 'Evan Lucas', + name: 'outdated-notarget', + version: '0.0.0', + description: 'Test for outdated-target', dependencies: { - underscore: "~199.7.1" + underscore: '~199.7.1' } - }), "utf8") + }), 'utf8') process.chdir(pkg) } diff --git a/deps/npm/test/tap/outdated-private.js b/deps/npm/test/tap/outdated-private.js index 882d7d9479cf4c..1d5e460c6eab6c 100644 --- a/deps/npm/test/tap/outdated-private.js +++ b/deps/npm/test/tap/outdated-private.js @@ -1,79 +1,80 @@ -var common = require("../common-tap.js") -var test = require("tap").test -var npm = require("../../") -var rimraf = require("rimraf") -var path = require("path") -var mr = require("npm-registry-mock") -var osenv = require("osenv") -var mkdirp = require("mkdirp") -var fs = require("graceful-fs") +var common = require('../common-tap.js') +var test = require('tap').test +var npm = require('../../') +var rimraf = require('rimraf') +var path = require('path') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var mkdirp = require('mkdirp') +var fs = require('graceful-fs') -var pkg = path.resolve(__dirname, "outdated-private") -var pkgLocalPrivate = path.resolve(pkg, "local-private") -var pkgScopedLocalPrivate = path.resolve(pkg, "another-local-private") -var pkgLocalUnderscore = path.resolve(pkg, "underscore") +var pkg = path.resolve(__dirname, 'outdated-private') +var pkgLocalPrivate = path.resolve(pkg, 'local-private') +var pkgScopedLocalPrivate = path.resolve(pkg, 'another-local-private') +var pkgLocalUnderscore = path.resolve(pkg, 'underscore') var pjParent = JSON.stringify({ - name : "outdated-private", - version : "1.0.0", - dependencies : { - "local-private" : "file:local-private", - "@scoped/another-local-private" : "file:another-local-private", - "underscore" : "file:underscore" + name: 'outdated-private', + version: '1.0.0', + dependencies: { + 'local-private': 'file:local-private', + '@scoped/another-local-private': 'file:another-local-private', + 'underscore': 'file:underscore' } -}, null, 2) + "\n" +}, null, 2) + '\n' var pjLocalPrivate = JSON.stringify({ - name : "local-private", - version : "1.0.0", - private : true -}, null, 2) + "\n" + name: 'local-private', + version: '1.0.0', + 'private': true +}, null, 2) + '\n' var pjLocalPrivateBumped = JSON.stringify({ - name : "local-private", - version : "1.1.0", - private : true -}, null, 2) + "\n" + name: 'local-private', + version: '1.1.0', + 'private': true +}, null, 2) + '\n' var pjScopedLocalPrivate = JSON.stringify({ - name : "@scoped/another-local-private", - version : "1.0.0", - private : true -}, null, 2) + "\n" + name: '@scoped/another-local-private', + version: '1.0.0', + 'private': true +}, null, 2) + '\n' var pjLocalUnderscore = JSON.stringify({ - name : "underscore", - version : "1.3.1" -}, null, 2) + "\n" + name: 'underscore', + version: '1.3.1' +}, null, 2) + '\n' -test("setup", function (t) { +test('setup', function (t) { bootstrap() t.end() }) -test("outdated ignores private modules", function (t) { +test('outdated ignores private modules', function (t) { t.plan(3) process.chdir(pkg) - mr({ port : common.port }, function (err, s) { + mr({ port: common.port }, function (er, s) { npm.load( { - loglevel : "silent", - parseable : true, - registry : common.registry + loglevel: 'silent', + parseable: true, + registry: common.registry }, function () { - npm.install(".", function (err) { - t.ifError(err, "install success") + npm.install('.', function (err) { + t.ifError(err, 'install success') bumpLocalPrivate() npm.outdated(function (er, d) { - t.ifError(er, "outdated success") + t.ifError(er, 'outdated success') t.deepEqual(d, [[ - path.resolve(__dirname, "outdated-private"), - "underscore", - "1.3.1", - "1.5.1", - "1.5.1", - "underscore@1.5.1" + path.resolve(__dirname, 'outdated-private'), + 'underscore', + '1.3.1', + '1.5.1', + '1.5.1', + 'underscore@1.5.1', + null ]]) s.close() }) @@ -83,27 +84,27 @@ test("outdated ignores private modules", function (t) { }) }) -test("cleanup", function (t) { +test('cleanup', function (t) { cleanup() t.end() }) function bootstrap () { mkdirp.sync(pkg) - fs.writeFileSync(path.resolve(pkg, "package.json"), pjParent) + fs.writeFileSync(path.resolve(pkg, 'package.json'), pjParent) mkdirp.sync(pkgLocalPrivate) - fs.writeFileSync(path.resolve(pkgLocalPrivate, "package.json"), pjLocalPrivate) + fs.writeFileSync(path.resolve(pkgLocalPrivate, 'package.json'), pjLocalPrivate) mkdirp.sync(pkgScopedLocalPrivate) - fs.writeFileSync(path.resolve(pkgScopedLocalPrivate, "package.json"), pjScopedLocalPrivate) + fs.writeFileSync(path.resolve(pkgScopedLocalPrivate, 'package.json'), pjScopedLocalPrivate) mkdirp.sync(pkgLocalUnderscore) - fs.writeFileSync(path.resolve(pkgLocalUnderscore, "package.json"), pjLocalUnderscore) + fs.writeFileSync(path.resolve(pkgLocalUnderscore, 'package.json'), pjLocalUnderscore) } function bumpLocalPrivate () { - fs.writeFileSync(path.resolve(pkgLocalPrivate, "package.json"), pjLocalPrivateBumped) + fs.writeFileSync(path.resolve(pkgLocalPrivate, 'package.json'), pjLocalPrivateBumped) } function cleanup () { diff --git a/deps/npm/test/tap/outdated-symlink.js b/deps/npm/test/tap/outdated-symlink.js new file mode 100644 index 00000000000000..a5ebea0d2ead5b --- /dev/null +++ b/deps/npm/test/tap/outdated-symlink.js @@ -0,0 +1,96 @@ +var fs = require('graceful-fs') +var path = require('path') +var osenv = require('osenv') +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'outdated-symlink') +var cache = path.resolve(pkg, 'cache') +var originalLog + +var fakeRoot = path.join(__dirname, 'fakeRoot') +var OPTS = { + env: { + 'npm_config_prefix': fakeRoot + } +} + +var json = { + name: 'my-local-package', + description: 'fixture', + version: '1.0.0' +} + +test('setup', function (t) { + cleanup() + originalLog = console.log + mkdirp.sync(cache) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + process.chdir(pkg) + common.npm(['install', '-g', 'async@0.2.9', 'underscore@1.3.1'], OPTS, function (err, c, out) { + t.ifError(err, 'global install did not error') + common.npm(['link'], OPTS, function (err, c, out) { + t.ifError(err, 'link did not error') + common.npm(['ls', '-g'], OPTS, function (err, c, out, stderr) { + t.ifError(err) + t.equal(c, 0) + t.equal(stderr, '', 'got expected stderr') + t.has(out, /my-local-package@1.0.0/, 'creates global link ok') + t.end() + }) + }) + }) +}) + +test('when outdated is called linked packages should be displayed as such', function (t) { + var regOutLinked = /my-local-package\s*1.0.0\s*linked\s*linked\n/ + var regOutInstallOne = /async\s*0.2.9\s*0.2.9\s*0.2.10\n/ + var regOutInstallTwo = /underscore\s*1.3.1\s*1.3.1\s*1.5.1\n/ + + console.log = function () {} + mr({ port: common.port }, function (er, s) { + common.npm( + [ + '--registry', common.registry, + 'outdated', '-g' + ], + OPTS, + function (err, c, out, stderr) { + t.ifError(err) + t.ok(out.match(regOutLinked), 'Global Link format as expected') + t.ok(out.match(regOutInstallOne), 'Global Install format as expected') + t.ok(out.match(regOutInstallTwo), 'Global Install format as expected') + s.close() + t.end() + } + ) + }) +}) + +test('cleanup', function (t) { + process.chdir(osenv.tmpdir()) + common.npm(['rm', 'outdated'], OPTS, function (err, code) { + t.ifError(err, 'npm removed the linked package without error') + t.equal(code, 0, 'cleanup outdated in local ok') + common.npm(['rm', '-g', 'outdated', 'async', 'underscore'], OPTS, function (err, code) { + t.ifError(err, 'npm removed the global package without error') + t.equal(code, 0, 'cleanup outdated in global ok') + + console.log = originalLog + cleanup() + t.end() + }) + }) +}) + +function cleanup () { + rimraf.sync(pkg) + rimraf.sync(fakeRoot) +} diff --git a/deps/npm/test/tap/outdated.js b/deps/npm/test/tap/outdated.js index 146c2007a37330..c5ce8d182f476d 100644 --- a/deps/npm/test/tap/outdated.js +++ b/deps/npm/test/tap/outdated.js @@ -64,7 +64,8 @@ test('it should not throw', function (t) { '0.2.9', '0.2.9', '0.2.10', - '0.2.9' + '0.2.9', + null ], [ pkg, @@ -72,7 +73,8 @@ test('it should not throw', function (t) { '0.5.1', '0.5.1', '0.5.2', - '0.5.1' + '0.5.1', + null ], [ pkg, @@ -80,7 +82,8 @@ test('it should not throw', function (t) { '1.3.1', '1.3.1', '1.5.1', - '1.3.1' + '1.3.1', + null ] ] diff --git a/deps/npm/test/tap/override-bundled.js b/deps/npm/test/tap/override-bundled.js new file mode 100644 index 00000000000000..e23c8255c49cbd --- /dev/null +++ b/deps/npm/test/tap/override-bundled.js @@ -0,0 +1,158 @@ +'use strict' +var test = require('tap').test +var fs = require('fs') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var path = require('path') +var common = require('../common-tap.js') + +var testname = path.basename(__filename, '.js') +var testdir = path.resolve(__dirname, testname) +var testmod = path.resolve(testdir, 'top-test') + +var bundleupdatesrc = path.resolve(testmod, 'bundle-update') +var bundleupdateNEW = path.resolve(bundleupdatesrc, 'NEW') +var bundleupdateNEWpostinstall = path.resolve(testdir, 'node_modules', 'top-test', 'node_modules', 'bundle-update', 'NEW') +var bundleupdatebad = path.resolve(testmod, 'node_modules', 'bundle-update') + +var bundlekeepsrc = path.resolve(testmod, 'bundle-keep') +var bundlekeep = path.resolve(testmod, 'node_modules', 'bundle-keep') +var bundlekeepOLD = path.resolve(bundlekeep, 'OLD') +var bundlekeepOLDpostinstall = path.resolve(testdir, 'node_modules', 'top-test', 'node_modules', 'bundle-keep', 'OLD') + +var bundledeepsrc = path.resolve(testmod, 'bundle-deep') +var bundledeep = path.resolve(testmod, 'node_modules', 'bundle-deep') +var bundledeepOLD = path.resolve(bundledeep, 'OLD') +var bundledeepOLDpostinstall = path.resolve(testdir, 'node_modules', 'top-test', 'node_modules', 'bundle-deep', 'OLD') + +var bundledeepupdatesrc = path.resolve(testmod, 'bundle-deep-update') +var bundledeepupdate = path.resolve(bundledeep, 'node_modules', 'bundle-deep-update') +var bundledeepupdateNEW = path.resolve(bundledeepupdatesrc, 'NEW') +var bundledeepupdateNEWpostinstall = path.resolve(testdir, 'node_modules', 'top-test', + 'node_modules', 'bundle-deep', 'node_modules', 'bundle-deep-update', 'NEW') + +var testjson = { + dependencies: {'top-test': 'file:top-test/'} +} + +var testmodjson = { + name: 'top-test', + version: '1.0.0', + dependencies: { + 'bundle-update': bundleupdatesrc, + 'bundle-keep': bundlekeepsrc, + 'bundle-deep': bundledeepsrc + }, + bundledDependencies: ['bundle-update', 'bundle-keep', 'bundle-deep'] +} +var bundlejson = { + name: 'bundle-update', + version: '1.0.0' +} + +var bundlekeepjson = { + name: 'bundle-keep', + version: '1.0.0', + _requested: { + rawSpec: bundlekeepsrc + } +} +var bundledeepjson = { + name: 'bundle-deep', + version: '1.0.0', + dependencies: { + 'bundle-deep-update': bundledeepupdatesrc + }, + _requested: { + rawSpec: bundledeepsrc + } +} + +var bundledeepupdatejson = { + version: '1.0.0', + name: 'bundle-deep-update' +} + +function writepjs (dir, content) { + fs.writeFileSync(path.join(dir, 'package.json'), JSON.stringify(content, null, 2)) +} + +function setup () { + mkdirp.sync(testdir) + writepjs(testdir, testjson) + mkdirp.sync(testmod) + writepjs(testmod, testmodjson) + + mkdirp.sync(bundleupdatesrc) + writepjs(bundleupdatesrc, bundlejson) + fs.writeFileSync(bundleupdateNEW, '') + mkdirp.sync(bundleupdatebad) + writepjs(bundleupdatebad, bundlejson) + + mkdirp.sync(bundlekeepsrc) + writepjs(bundlekeepsrc, bundlekeepjson) + mkdirp.sync(bundlekeep) + writepjs(bundlekeep, bundlekeepjson) + fs.writeFileSync(bundlekeepOLD, '') + + mkdirp.sync(bundledeepsrc) + writepjs(bundledeepsrc, bundledeepjson) + mkdirp.sync(bundledeep) + writepjs(bundledeep, bundledeepjson) + fs.writeFileSync(bundledeepOLD, '') + + mkdirp.sync(bundledeepupdatesrc) + writepjs(bundledeepupdatesrc, bundledeepupdatejson) + mkdirp.sync(bundledeepupdate) + writepjs(bundledeepupdate, bundledeepupdatejson) + fs.writeFileSync(bundledeepupdateNEW, '') +} + +function cleanup () { + rimraf.sync(testdir) +} + +test('setup', function (t) { + cleanup() + setup() + t.end() +}) + +test('bundled', function (t) { + common.npm(['install', '--loglevel=warn'], {cwd: testdir}, function (err, code, stdout, stderr) { + if (err) throw err + t.plan(8) + t.is(code, 0, 'npm itself completed ok') + + // This tests that after the install we have a freshly installed version + // of `bundle-update` (in alignment with the package.json), instead of the + // version that was bundled with `top-test`. + // If npm doesn't do this, and selects the bundled version, things go very + // wrong because npm thinks it has a different module (with different + // metadata) installed in that location and will go off and try to do + // _things_ to it. Things like chmod in particular, which in turn results + // in the dreaded ENOENT errors. + t.like(stderr, new RegExp('npm WARN ' + testname), "didn't stomp on other warnings") + t.like(stderr, /npm WARN.*bundle-update/, 'included update warning about bundled dep') + t.like(stderr, /npm WARN.*bundle-deep-update/, 'included update warning about deeply bundled dep') + fs.stat(bundleupdateNEWpostinstall, function (missing) { + t.ok(!missing, 'package.json overrode bundle') + }) + fs.stat(bundledeepupdateNEWpostinstall, function (missing) { + t.ok(!missing, 'deep package.json overrode bundle') + }) + // Relatedly, when upgrading, if a bundled module is replacing an existing + // module we want to choose the bundled version, not the version we're replacing. + fs.stat(bundlekeepOLDpostinstall, function (missing) { + t.ok(!missing, 'no override when package.json matches') + }) + fs.stat(bundledeepOLDpostinstall, function (missing) { + t.ok(!missing, 'deep no override when package.json matches') + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) diff --git a/deps/npm/test/tap/owner.js b/deps/npm/test/tap/owner.js index 938c2166572c39..4bef1a0d87b259 100644 --- a/deps/npm/test/tap/owner.js +++ b/deps/npm/test/tap/owner.js @@ -1,79 +1,79 @@ -var mr = require("npm-registry-mock") -var test = require("tap").test +var mr = require('npm-registry-mock') +var test = require('tap').test -var common = require("../common-tap.js") +var common = require('../common-tap.js') var server var EXEC_OPTS = {} var jashkenas = { - name : "jashkenas", - email : "jashkenas@gmail.com" + name: 'jashkenas', + email: 'jashkenas@gmail.com' } var othiym23 = { - name : "othiym23", - email : "forrest@npmjs.com" + name: 'othiym23', + email: 'forrest@npmjs.com' } var bcoe = { - name : "bcoe", - email : "ben@npmjs.com" + name: 'bcoe', + email: 'ben@npmjs.com' } function shrt (user) { - return user.name+" <"+user.email+">\n" + return user.name + ' <' + user.email + '>\n' } function mocks (server) { - server.get("/-/user/org.couchdb.user:othiym23") + server.get('/-/user/org.couchdb.user:othiym23') .many().reply(200, othiym23) // test 1 - server.get("/underscore") - .reply(200, {_id:"underscore",_rev:1,maintainers:[jashkenas]}) + server.get('/underscore') + .reply(200, { _id: 'underscore', _rev: 1, maintainers: [jashkenas] }) server.put( - "/underscore/-rev/1", - {_id:"underscore",_rev:1,maintainers:[jashkenas,othiym23]}, + '/underscore/-rev/1', + { _id: 'underscore', _rev: 1, maintainers: [jashkenas, othiym23] }, {} - ).reply(200, {_id:"underscore",_rev:2,maintainers:[jashkenas,othiym23]}) + ).reply(200, { _id: 'underscore', _rev: 2, maintainers: [jashkenas, othiym23] }) // test 2 - server.get("/@xxx%2fscoped") - .reply(200, {_id:"@xxx/scoped",_rev:1,maintainers:[bcoe]}) + server.get('/@xxx%2fscoped') + .reply(200, { _id: '@xxx/scoped', _rev: 1, maintainers: [bcoe] }) server.put( - "/@xxx%2fscoped/-rev/1", - {_id:"@xxx/scoped",_rev:1,maintainers:[bcoe,othiym23]}, + '/@xxx%2fscoped/-rev/1', + { _id: '@xxx/scoped', _rev: 1, maintainers: [bcoe, othiym23] }, {} - ).reply(200, {_id:"@xxx/scoped",_rev:2,maintainers:[bcoe,othiym23]}) + ).reply(200, { _id: '@xxx/scoped', _rev: 2, maintainers: [bcoe, othiym23] }) // test 3 - server.get("/underscore") - .reply(200, {_id:"underscore",_rev:2,maintainers:[jashkenas,othiym23]}) + server.get('/underscore') + .reply(200, { _id: 'underscore', _rev: 2, maintainers: [jashkenas, othiym23] }) // test 4 - server.get("/underscore") - .reply(200, {_id:"underscore",_rev:2,maintainers:[jashkenas,othiym23]}) + server.get('/underscore') + .reply(200, { _id: 'underscore', _rev: 2, maintainers: [jashkenas, othiym23] }) server.put( - "/underscore/-rev/2", - {_id:"underscore",_rev:2,maintainers:[jashkenas]}, + '/underscore/-rev/2', + { _id: 'underscore', _rev: 2, maintainers: [jashkenas] }, {} - ).reply(200, {_id:"underscore",_rev:3,maintainers:[jashkenas]}) + ).reply(200, { _id: 'underscore', _rev: 3, maintainers: [jashkenas] }) } -test("setup", function (t) { +test('setup', function (t) { common.npm( [ - "--loglevel", "silent", - "cache", "clean" + '--loglevel', 'silent', + 'cache', 'clean' ], EXEC_OPTS, function (err, code) { - t.ifError(err, "npm cache clean ran without error") - t.notOk(code, "npm cache clean exited cleanly") + t.ifError(err, 'npm cache clean ran without error') + t.notOk(code, 'npm cache clean exited cleanly') - mr({ port : common.port, plugin : mocks }, function (err, s) { + mr({ port: common.port, plugin: mocks }, function (er, s) { server = s t.end() }) @@ -81,83 +81,83 @@ test("setup", function (t) { ) }) -test("npm owner add", function (t) { +test('npm owner add', function (t) { common.npm( [ - "--loglevel", "silent", - "--registry", common.registry, - "owner", "add", "othiym23", "underscore" + '--loglevel', 'silent', + '--registry', common.registry, + 'owner', 'add', 'othiym23', 'underscore' ], EXEC_OPTS, function (err, code, stdout, stderr) { - t.ifError(err, "npm owner add ran without error") - t.notOk(code, "npm owner add exited cleanly") - t.notOk(stderr, "npm owner add ran silently") - t.equal(stdout, "+ othiym23 (underscore)\n", "got expected add output") + t.ifError(err, 'npm owner add ran without error') + t.notOk(code, 'npm owner add exited cleanly') + t.notOk(stderr, 'npm owner add ran silently') + t.equal(stdout, '+ othiym23 (underscore)\n', 'got expected add output') t.end() } ) }) -test("npm owner add (scoped)", function (t) { +test('npm owner add (scoped)', function (t) { common.npm( [ - "--loglevel", "silent", - "--registry", common.registry, - "owner", "add", "othiym23", "@xxx/scoped" + '--loglevel', 'silent', + '--registry', common.registry, + 'owner', 'add', 'othiym23', '@xxx/scoped' ], EXEC_OPTS, function (err, code, stdout, stderr) { - t.ifError(err, "npm owner add (scoped) ran without error") - t.notOk(code, "npm owner add (scoped) exited cleanly") - t.notOk(stderr, "npm owner add (scoped) ran silently") - t.equal(stdout, "+ othiym23 (@xxx/scoped)\n", "got expected scoped add output") + t.ifError(err, 'npm owner add (scoped) ran without error') + t.notOk(code, 'npm owner add (scoped) exited cleanly') + t.notOk(stderr, 'npm owner add (scoped) ran silently') + t.equal(stdout, '+ othiym23 (@xxx/scoped)\n', 'got expected scoped add output') t.end() } ) }) -test("npm owner ls", function (t) { +test('npm owner ls', function (t) { common.npm( [ - "--loglevel", "silent", - "--registry", common.registry, - "owner", "ls", "underscore" + '--loglevel', 'silent', + '--registry', common.registry, + 'owner', 'ls', 'underscore' ], EXEC_OPTS, function (err, code, stdout, stderr) { - t.ifError(err, "npm owner ls ran without error") - t.notOk(code, "npm owner ls exited cleanly") - t.notOk(stderr, "npm owner ls ran silently") - t.equal(stdout, shrt(jashkenas)+shrt(othiym23), "got expected ls output") + t.ifError(err, 'npm owner ls ran without error') + t.notOk(code, 'npm owner ls exited cleanly') + t.notOk(stderr, 'npm owner ls ran silently') + t.equal(stdout, shrt(jashkenas) + shrt(othiym23), 'got expected ls output') t.end() } ) }) -test("npm owner rm", function (t) { +test('npm owner rm', function (t) { common.npm( [ - "--loglevel", "silent", - "--registry", common.registry, - "owner", "rm", "othiym23", "underscore" + '--loglevel', 'silent', + '--registry', common.registry, + 'owner', 'rm', 'othiym23', 'underscore' ], EXEC_OPTS, function (err, code, stdout, stderr) { - t.ifError(err, "npm owner rm ran without error") - t.notOk(code, "npm owner rm exited cleanly") - t.notOk(stderr, "npm owner rm ran silently") - t.equal(stdout, "- othiym23 (underscore)\n", "got expected rm output") + t.ifError(err, 'npm owner rm ran without error') + t.notOk(code, 'npm owner rm exited cleanly') + t.notOk(stderr, 'npm owner rm ran silently') + t.equal(stdout, '- othiym23 (underscore)\n', 'got expected rm output') t.end() } ) }) -test("cleanup", function (t) { +test('cleanup', function (t) { server.close() t.end() }) diff --git a/deps/npm/test/tap/pack-scoped.js b/deps/npm/test/tap/pack-scoped.js index 5c351339cb61c6..05b9d12a833192 100644 --- a/deps/npm/test/tap/pack-scoped.js +++ b/deps/npm/test/tap/pack-scoped.js @@ -1,29 +1,29 @@ // verify that prepublish runs on pack and publish -var test = require("tap").test -var common = require("../common-tap") -var fs = require("graceful-fs") -var join = require("path").join -var mkdirp = require("mkdirp") -var rimraf = require("rimraf") +var test = require('tap').test +var common = require('../common-tap') +var fs = require('graceful-fs') +var join = require('path').join +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') -var pkg = join(__dirname, "scoped_package") -var manifest = join(pkg, "package.json") -var tmp = join(pkg, "tmp") -var cache = join(pkg, "cache") +var pkg = join(__dirname, 'scoped_package') +var manifest = join(pkg, 'package.json') +var tmp = join(pkg, 'tmp') +var cache = join(pkg, 'cache') var data = { - name : "@scope/generic-package", - version : "90000.100001.5" + name: '@scope/generic-package', + version: '90000.100001.5' } -test("setup", function (t) { +test('setup', function (t) { var n = 0 rimraf.sync(pkg) - mkdirp(pkg, then()) + mkdirp(pkg, then()) mkdirp(cache, then()) - mkdirp(tmp, then()) + mkdirp(tmp, then()) function then () { n++ @@ -34,23 +34,23 @@ test("setup", function (t) { } function next () { - fs.writeFile(manifest, JSON.stringify(data), "ascii", done) + fs.writeFile(manifest, JSON.stringify(data), 'ascii', done) } function done (er) { t.ifError(er) - t.pass("setup done") + t.pass('setup done') t.end() } }) -test("test", function (t) { +test('test', function (t) { var env = { - "npm_config_cache" : cache, - "npm_config_tmp" : tmp, - "npm_config_prefix" : pkg, - "npm_config_global" : "false" + 'npm_config_cache': cache, + 'npm_config_tmp': tmp, + 'npm_config_prefix': pkg, + 'npm_config_global': 'false' } for (var i in process.env) { @@ -58,24 +58,24 @@ test("test", function (t) { } common.npm([ - "pack", - "--loglevel", "warn" + 'pack', + '--loglevel', 'warn' ], { cwd: pkg, env: env - }, function(err, code, stdout, stderr) { - t.ifErr(err, "npm pack finished without error") - t.equal(code, 0, "npm pack exited ok") - t.notOk(stderr, "got stderr data: " + JSON.stringify("" + stderr)) + }, function (err, code, stdout, stderr) { + t.ifErr(err, 'npm pack finished without error') + t.equal(code, 0, 'npm pack exited ok') + t.notOk(stderr, 'got stderr data: ' + JSON.stringify('' + stderr)) stdout = stdout.trim() - var regex = new RegExp("scope-generic-package-90000.100001.5.tgz", "ig") - t.ok(stdout.match(regex), "found package") + var regex = new RegExp('scope-generic-package-90000.100001.5.tgz', 'ig') + t.ok(stdout.match(regex), 'found package') t.end() }) }) -test("cleanup", function (t) { +test('cleanup', function (t) { rimraf.sync(pkg) - t.pass("cleaned up") + t.pass('cleaned up') t.end() }) diff --git a/deps/npm/test/tap/peer-deps-invalid.js b/deps/npm/test/tap/peer-deps-invalid.js index 453f9617f38e34..39ad612e5a9bef 100644 --- a/deps/npm/test/tap/peer-deps-invalid.js +++ b/deps/npm/test/tap/peer-deps-invalid.js @@ -69,25 +69,23 @@ test('installing dependencies that have conflicting peerDependencies', function '/invalid.js': [200, path.join(pkg, 'file-fail.js')] } } - mr({port: common.port, mocks: customMocks}, function (err, s) { // create mock registry. + mr({port: common.port, mocks: customMocks}, function (err, s) { t.ifError(err, 'mock registry started') - npm.load({ - cache: pkg + "/cache", - registry: common.registry - }, function () { - npm.commands.install([], function (err) { - if (!err) { - t.fail("No error!") - } else { - t.equal(err.code, "EPEERINVALID") - t.equal(err.packageName, "underscore") - t.equal(err.packageVersion, "1.3.3") - t.equal(err.message, "The package underscore@1.3.3 does not satisfy its siblings' peerDependencies requirements!") - } - s.close() // shutdown mock registry. - t.end() - }) - }) + npm.load( + { + cache: cache, + registry: common.registry + }, + function () { + npm.commands.install([], function (err, additions, tree) { + t.error(err) + var invalid = tree.warnings.filter(function (warning) { return warning.code === 'EPEERINVALID' }) + t.is(invalid.length, 2) + s.close() + t.end() + }) + } + ) }) }) diff --git a/deps/npm/test/tap/peer-deps-toplevel.js b/deps/npm/test/tap/peer-deps-toplevel.js index 5b5e29b06ea991..1c95867301a19f 100644 --- a/deps/npm/test/tap/peer-deps-toplevel.js +++ b/deps/npm/test/tap/peer-deps-toplevel.js @@ -15,6 +15,10 @@ var pkg = path.resolve(__dirname, 'peer-deps-toplevel') var expected = { name: 'npm-test-peer-deps-toplevel', version: '0.0.0', + problems: [ + 'peer dep missing: mkdirp@*, required by npm-test-peer-deps-toplevel@0.0.0', + 'peer dep missing: request@0.9.x, required by npm-test-peer-deps@0.0.0' + ], dependencies: { 'npm-test-peer-deps': { version: '0.0.0', @@ -29,14 +33,28 @@ var expected = { } }, mkdirp: { - version: '0.3.5', - from: 'mkdirp@*', - resolved: common.registry + '/mkdirp/-/mkdirp-0.3.5.tgz' + peerMissing: true, + required: { + _id: 'mkdirp@*', + name: 'mkdirp', + version: '*', + peerMissing: [ + {requiredBy: 'npm-test-peer-deps-toplevel@0.0.0', requires: 'mkdirp@*'} + ], + dependencies: {} + } }, request: { - version: '0.9.5', - from: 'request@>=0.9.0 <0.10.0', - resolved: common.registry + '/request/-/request-0.9.5.tgz' + peerMissing: true, + required: { + _id: 'request@0.9.x', + dependencies: {}, + name: 'request', + peerMissing: [ + {requiredBy: 'npm-test-peer-deps@0.0.0', requires: 'request@0.9.x'} + ], + version: '0.9.x' + } } } } @@ -87,7 +105,7 @@ function setup (cb) { ) process.chdir(pkg) - var opts = { cache: path.resolve(pkg, 'cache'), registry: common.registry} + var opts = { cache: path.resolve(pkg, 'cache'), registry: common.registry } npm.load(opts, cb) } diff --git a/deps/npm/test/tap/peer-deps-without-package-json.js b/deps/npm/test/tap/peer-deps-without-package-json.js index 08322eefaa5035..ad863e9f974f31 100644 --- a/deps/npm/test/tap/peer-deps-without-package-json.js +++ b/deps/npm/test/tap/peer-deps-without-package-json.js @@ -51,17 +51,15 @@ test('installing a peerDeps-using package without package.json', function (t) { registry: common.registry, cache: cache }, function () { - npm.install(common.registry + '/ok.js', function (err) { + npm.install(common.registry + '/ok.js', function (err, additions, result) { t.ifError(err, 'installed ok.js') t.ok( fs.existsSync(path.join(nodeModules, 'npm-test-peer-deps-file')), 'passive peer dep installed' ) - t.ok( - fs.existsSync(path.join(nodeModules, 'underscore')), - 'underscore installed' - ) + var invalid = result.warnings.filter(function (warning) { return warning.code === 'EPEERINVALID' }) + t.is(invalid.length, 1, 'got a warning for a missing/invalid peer dep') t.end() s.close() // shutdown mock registry. diff --git a/deps/npm/test/tap/peer-deps.js b/deps/npm/test/tap/peer-deps.js index 48023d7ac77cca..c319c32e480605 100644 --- a/deps/npm/test/tap/peer-deps.js +++ b/deps/npm/test/tap/peer-deps.js @@ -12,29 +12,7 @@ var npm = npm = require('../../') var pkg = path.resolve(__dirname, 'peer-deps') -var expected = { - name: 'npm-test-peer-deps-installer', - version: '0.0.0', - dependencies: { - 'npm-test-peer-deps': { - version: '0.0.0', - from: 'npm-test-peer-deps@*', - resolved: common.registry + '/npm-test-peer-deps/-/npm-test-peer-deps-0.0.0.tgz', - dependencies: { - underscore: { - version: '1.3.1', - from: 'underscore@1.3.1', - resolved: common.registry + '/underscore/-/underscore-1.3.1.tgz' - } - } - }, - request: { - version: '0.9.5', - from: 'request@>=0.9.0 <0.10.0', - resolved: common.registry + '/request/-/request-0.9.5.tgz' - } - } -} +var expected = [ 'peer dep missing: request@0.9.x, required by npm-test-peer-deps@0.0.0' ] var json = { author: 'Domenic Denicola', @@ -56,7 +34,7 @@ test('installs the peer dependency directory structure', function (t) { npm.commands.ls([], true, function (err, _, results) { if (err) return t.fail(err) - t.deepEqual(results, expected) + t.deepEqual(results.problems, expected) s.close() t.end() }) @@ -79,7 +57,7 @@ function setup (cb) { ) process.chdir(pkg) - var opts = { cache: path.resolve(pkg, 'cache'), registry: common.registry} + var opts = { cache: path.resolve(pkg, 'cache'), registry: common.registry } npm.load(opts, cb) } diff --git a/deps/npm/test/tap/prepublish.js b/deps/npm/test/tap/prepublish.js index 36391beeb340fa..556d01ebb0dfce 100644 --- a/deps/npm/test/tap/prepublish.js +++ b/deps/npm/test/tap/prepublish.js @@ -1,16 +1,16 @@ // verify that prepublish runs on pack and publish -var common = require("../common-tap") -var test = require("tap").test -var fs = require("graceful-fs") -var join = require("path").join -var mkdirp = require("mkdirp") -var rimraf = require("rimraf") +var common = require('../common-tap') +var test = require('tap').test +var fs = require('graceful-fs') +var join = require('path').join +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') -var pkg = join(__dirname, "prepublish_package") -var tmp = join(pkg, "tmp") -var cache = join(pkg, "cache") +var pkg = join(__dirname, 'prepublish_package') +var tmp = join(pkg, 'tmp') +var cache = join(pkg, 'cache') -test("setup", function (t) { +test('setup', function (t) { var n = 0 cleanup() mkdirp(pkg, then()) @@ -25,58 +25,60 @@ test("setup", function (t) { } function next () { - fs.writeFile(join(pkg, "package.json"), JSON.stringify({ - name: "npm-test-prepublish", - version: "1.2.5", - scripts: { prepublish: "echo ok" } - }), "ascii", function (er) { + fs.writeFile(join(pkg, 'package.json'), JSON.stringify({ + name: 'npm-test-prepublish', + version: '1.2.5', + scripts: { prepublish: 'echo ok' } + }), 'ascii', function (er) { if (er) throw er - t.pass("setup done") + t.pass('setup done') t.end() }) } }) -test("test", function (t) { +test('test', function (t) { var env = { - "npm_config_cache" : cache, - "npm_config_tmp" : tmp, - "npm_config_prefix" : pkg, - "npm_config_global" : "false" + 'npm_config_cache': cache, + 'npm_config_tmp': tmp, + 'npm_config_prefix': pkg, + 'npm_config_global': 'false' } + for (var i in process.env) { - if (!/^npm_config_/.test(i)) + if (!/^npm_config_/.test(i)) { env[i] = process.env[i] + } } common.npm([ - "pack", - "--loglevel", "warn" - ], { cwd: pkg, env: env }, function(err, code, stdout, stderr) { - t.equal(code, 0, "pack finished successfully") - t.ifErr(err, "pack finished successfully") + 'pack', + '--loglevel', 'warn' + ], { cwd: pkg, env: env }, function (err, code, stdout, stderr) { + t.equal(code, 0, 'pack finished successfully') + t.ifErr(err, 'pack finished successfully') - t.notOk(stderr, "got stderr data:" + JSON.stringify("" + stderr)) + t.notOk(stderr, 'got stderr data:' + JSON.stringify('' + stderr)) var c = stdout.trim() - var regex = new RegExp("" + - "> npm-test-prepublish@1.2.5 prepublish [^\\r\\n]+\\r?\\n" + - "> echo ok\\r?\\n" + - "\\r?\\n" + - "ok\\r?\\n" + - "npm-test-prepublish-1.2.5.tgz", "ig") + var regex = new RegExp('' + + '> npm-test-prepublish@1.2.5 prepublish [^\\r\\n]+\\r?\\n' + + '> echo ok\\r?\\n' + + '\\r?\\n' + + 'ok\\r?\\n' + + 'npm-test-prepublish-1.2.5.tgz', 'ig') t.ok(c.match(regex)) t.end() }) }) -test("cleanup", function (t) { +test('cleanup', function (t) { cleanup() - t.pass("cleaned up") + t.pass('cleaned up') t.end() }) -function cleanup() { +function cleanup () { rimraf.sync(pkg) } diff --git a/deps/npm/test/tap/progress-config.js b/deps/npm/test/tap/progress-config.js new file mode 100644 index 00000000000000..acddc0d07b9137 --- /dev/null +++ b/deps/npm/test/tap/progress-config.js @@ -0,0 +1,80 @@ +'use strict' +var test = require('tap').test +var log = require('npmlog') + +// We use requireInject to get a fresh copy of +// the npm singleton each time we require it. +// If we didn't, we'd have shared state between +// these various tests. +var requireInject = require('require-inject') + +// Make sure existing environment vars don't muck up the test +process.env = {} + +function hasOnlyAscii (s) { + return /^[\000-\177]*$/.test(s) +} + +test('disabled', function (t) { + t.plan(1) + var npm = requireInject('../../lib/npm.js', {}) + npm.load({progress: false}, function () { + t.is(log.progressEnabled, false, 'should be disabled') + }) +}) + +test('enabled', function (t) { + t.plan(1) + var npm = requireInject('../../lib/npm.js', {}) + npm.load({progress: true}, function () { + t.is(log.progressEnabled, true, 'should be enabled') + }) +}) + +test('default', function (t) { + t.plan(1) + var npm = requireInject('../../lib/npm.js', {}) + npm.load({}, function () { + t.is(log.progressEnabled, true, 'should be enabled') + }) +}) + +test('default-travis', function (t) { + t.plan(1) + global.process.env.TRAVIS = 'true' + var npm = requireInject('../../lib/npm.js', {}) + npm.load({}, function () { + t.is(log.progressEnabled, false, 'should be disabled') + delete global.process.env.TRAVIS + }) +}) + +test('default-ci', function (t) { + t.plan(1) + global.process.env.CI = 'true' + var npm = requireInject('../../lib/npm.js', {}) + npm.load({}, function () { + t.is(log.progressEnabled, false, 'should be disabled') + delete global.process.env.CI + }) +}) + +test('unicode-true', function (t) { + t.plan(6) + var npm = requireInject('../../lib/npm.js', {}) + npm.load({unicode: true}, function () { + Object.keys(log.gauge.theme).forEach(function (key) { + t.notOk(hasOnlyAscii(log.gauge.theme[key]), 'only unicode') + }) + }) +}) + +test('unicode-false', function (t) { + t.plan(6) + var npm = requireInject('../../lib/npm.js', {}) + npm.load({unicode: false}, function () { + Object.keys(log.gauge.theme).forEach(function (key) { + t.ok(hasOnlyAscii(log.gauge.theme[key]), 'only ASCII') + }) + }) +}) diff --git a/deps/npm/test/tap/publish-access-scoped.js b/deps/npm/test/tap/publish-access-scoped.js index e734ebfd783193..17339cedfda338 100644 --- a/deps/npm/test/tap/publish-access-scoped.js +++ b/deps/npm/test/tap/publish-access-scoped.js @@ -1,81 +1,70 @@ -var fs = require("fs") -var path = require("path") - -var test = require("tap").test -var mkdirp = require("mkdirp") -var rimraf = require("rimraf") -var nock = require("nock") - -var npm = require("../../") -var common = require("../common-tap.js") - -var pkg = path.join(__dirname, "publish-access") - -// TODO: nock uses setImmediate, breaks 0.8: replace with mockRegistry -if (!global.setImmediate) { - global.setImmediate = function () { - var args = [arguments[0], 0].concat([].slice.call(arguments, 1)) - setTimeout.apply(this, args) - } -} - -test("setup", function (t) { - mkdirp(path.join(pkg, "cache"), function () { - var configuration = { - cache : path.join(pkg, "cache"), - loglevel : "silent", - registry : common.registry - } - - npm.load(configuration, next) +var fs = require('fs') +var path = require('path') + +var test = require('tap').test +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var mr = require('npm-registry-mock') +var common = require('../common-tap') +var server + +var pkg = path.join(__dirname, 'publish-access') + +test('setup', function (t) { + mr({port: common.port, throwOnUnmatched: true}, function (err, s) { + t.ifError(err, 'registry mocked successfully') + t.pass('setup done') + server = s + t.end() }) +}) - function next (er) { - t.ifError(er, "npm loaded successfully") +test('scoped packages pass public access if set', function (t) { + server.filteringRequestBody(function (body) { + t.doesNotThrow(function () { + var parsed = JSON.parse(body) + t.equal(parsed.access, 'public', 'access level is correct') + }, 'converted body back into object') + return true + }).put('/@bigco%2fpublish-access', true).reply(201, {ok: true}) - process.chdir(pkg) + mkdirp(path.join(pkg, 'cache'), function () { fs.writeFile( - path.join(pkg, "package.json"), + path.join(pkg, 'package.json'), JSON.stringify({ - name: "@bigco/publish-access", - version: "1.2.5" + name: '@bigco/publish-access', + version: '1.2.5', + public: true }), - "ascii", + 'ascii', function (er) { - t.ifError(er) - - t.pass("setup done") - t.end() + t.ifError(er, 'package file written') + common.npm( + [ + 'publish', + '--access', 'public', + '--cache', path.join(pkg, 'cache'), + '--loglevel', 'silly', + '--registry', common.registry + ], + { + cwd: pkg + }, + function (er) { + t.ifError(er, 'published without error') + + server.done() + t.end() + } + ) } ) - } -}) - -test("scoped packages pass public access if set", function (t) { - var put = nock(common.registry) - .put("/@bigco%2fpublish-access") - .reply(201, verify) - - npm.config.set("access", "public") - npm.commands.publish([], false, function (er) { - t.ifError(er, "published without error") - - put.done() - t.end() }) - - function verify (_, body) { - t.doesNotThrow(function () { - var parsed = JSON.parse(body) - t.equal(parsed.access, "public", "access level is correct") - }, "converted body back into object") - - return {ok: true} - } }) -test("cleanup", function (t) { +test('cleanup', function (t) { process.chdir(__dirname) + server.close() rimraf(pkg, function (er) { t.ifError(er) diff --git a/deps/npm/test/tap/publish-access-unscoped-restricted-fails.js b/deps/npm/test/tap/publish-access-unscoped-restricted-fails.js index 4d39b00b16702d..4c7fce7351e560 100644 --- a/deps/npm/test/tap/publish-access-unscoped-restricted-fails.js +++ b/deps/npm/test/tap/publish-access-unscoped-restricted-fails.js @@ -1,66 +1,58 @@ -var fs = require("fs") -var path = require("path") +var fs = require('fs') +var path = require('path') -var test = require("tap").test -var mkdirp = require("mkdirp") -var rimraf = require("rimraf") +var test = require('tap').test +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') -var npm = require("../../") -var common = require("../common-tap.js") +var npm = require('../../') +var common = require('../common-tap.js') -var pkg = path.join(__dirname, "publish-access-unscoped") +var pkg = path.join(__dirname, 'publish-access-unscoped') -// TODO: nock uses setImmediate, breaks 0.8: replace with mockRegistry -if (!global.setImmediate) { - global.setImmediate = function () { - var args = [arguments[0], 0].concat([].slice.call(arguments, 1)) - setTimeout.apply(this, args) - } -} - -test("setup", function (t) { - mkdirp(path.join(pkg, "cache"), function () { +test('setup', function (t) { + mkdirp(path.join(pkg, 'cache'), function () { var configuration = { - cache : path.join(pkg, "cache"), - loglevel : "silent", - registry : common.registry + cache: path.join(pkg, 'cache'), + loglevel: 'silent', + registry: common.registry } npm.load(configuration, next) }) function next (er) { - t.ifError(er, "npm loaded successfully") + t.ifError(er, 'npm loaded successfully') process.chdir(pkg) fs.writeFile( - path.join(pkg, "package.json"), + path.join(pkg, 'package.json'), JSON.stringify({ - name: "publish-access", - version: "1.2.5" + name: 'publish-access', + version: '1.2.5' }), - "ascii", + 'ascii', function (er) { t.ifError(er) - t.pass("setup done") + t.pass('setup done') t.end() } ) } }) -test("unscoped packages cannot be restricted", function (t) { - npm.config.set("access", "restricted") +test('unscoped packages cannot be restricted', function (t) { + npm.config.set('access', 'restricted') npm.commands.publish([], false, function (er) { - t.ok(er, "got an error back") + t.ok(er, 'got an error back') t.equal(er.message, "Can't restrict access to unscoped packages.") t.end() }) }) -test("cleanup", function (t) { +test('cleanup', function (t) { process.chdir(__dirname) rimraf(pkg, function (er) { t.ifError(er) diff --git a/deps/npm/test/tap/publish-access-unscoped.js b/deps/npm/test/tap/publish-access-unscoped.js index 023bfba5f2dd82..1766f61f4f93d5 100644 --- a/deps/npm/test/tap/publish-access-unscoped.js +++ b/deps/npm/test/tap/publish-access-unscoped.js @@ -1,81 +1,70 @@ -var fs = require("fs") -var path = require("path") - -var test = require("tap").test -var mkdirp = require("mkdirp") -var rimraf = require("rimraf") -var nock = require("nock") - -var npm = require("../../") -var common = require("../common-tap.js") - -var pkg = path.join(__dirname, "publish-access-unscoped") - -// TODO: nock uses setImmediate, breaks 0.8: replace with mockRegistry -if (!global.setImmediate) { - global.setImmediate = function () { - var args = [arguments[0], 0].concat([].slice.call(arguments, 1)) - setTimeout.apply(this, args) - } -} - -test("setup", function (t) { - mkdirp(path.join(pkg, "cache"), function () { - var configuration = { - cache : path.join(pkg, "cache"), - loglevel : "silent", - registry : common.registry - } - - npm.load(configuration, next) +var fs = require('fs') +var path = require('path') + +var test = require('tap').test +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var mr = require('npm-registry-mock') +var common = require('../common-tap') +var server + +var pkg = path.join(__dirname, 'publish-access-unscoped') + +test('setup', function (t) { + mr({port: common.port, throwOnUnmatched: true}, function (err, s) { + t.ifError(err, 'registry mocked successfully') + t.pass('setup done') + server = s + t.end() }) +}) - function next (er) { - t.ifError(er, "npm loaded successfully") +test('unscoped packages can be explicitly set as public', function (t) { + server.filteringRequestBody(function (body) { + t.doesNotThrow(function () { + var parsed = JSON.parse(body) + t.equal(parsed.access, 'public', 'access level is correct') + }, 'converted body back into object') + return true + }).put('/publish-access', true).reply(201, {ok: true}) - process.chdir(pkg) + mkdirp(path.join(pkg, 'cache'), function () { fs.writeFile( - path.join(pkg, "package.json"), + path.join(pkg, 'package.json'), JSON.stringify({ - name: "publish-access", - version: "1.2.5" + name: 'publish-access', + version: '1.2.5', + public: true }), - "ascii", + 'ascii', function (er) { - t.ifError(er) - - t.pass("setup done") - t.end() + t.ifError(er, 'package file written') + common.npm( + [ + 'publish', + '--access', 'public', + '--cache', path.join(pkg, 'cache'), + '--loglevel', 'silly', + '--registry', common.registry + ], + { + cwd: pkg + }, + function (er) { + t.ifError(er, 'published without error') + + server.done() + t.end() + } + ) } ) - } -}) - -test("unscoped packages can be explicitly set as public", function (t) { - var put = nock(common.registry) - .put("/publish-access") - .reply(201, verify) - - npm.config.set("access", "public") - npm.commands.publish([], false, function (er) { - t.ifError(er, "published without error") - - put.done() - t.end() }) - - function verify (_, body) { - t.doesNotThrow(function () { - var parsed = JSON.parse(body) - t.equal(parsed.access, "public", "access level is correct") - }, "converted body back into object") - - return {ok: true} - } }) -test("cleanup", function (t) { +test('cleanup', function (t) { process.chdir(__dirname) + server.close() rimraf(pkg, function (er) { t.ifError(er) diff --git a/deps/npm/test/tap/publish-config.js b/deps/npm/test/tap/publish-config.js index 1d063535b84987..57070f78ba4c59 100644 --- a/deps/npm/test/tap/publish-config.js +++ b/deps/npm/test/tap/publish-config.js @@ -1,37 +1,37 @@ -var common = require("../common-tap.js") -var test = require("tap").test -var fs = require("fs") -var osenv = require("osenv") -var pkg = process.env.npm_config_tmp || "/tmp" -pkg += "/npm-test-publish-config" +var common = require('../common-tap.js') +var test = require('tap').test +var fs = require('fs') +var osenv = require('osenv') +var pkg = process.env.npm_config_tmp || '/tmp' +pkg += '/npm-test-publish-config' -require("mkdirp").sync(pkg) +require('mkdirp').sync(pkg) -fs.writeFileSync(pkg + "/package.json", JSON.stringify({ - name: "npm-test-publish-config", - version: "1.2.3", +fs.writeFileSync(pkg + '/package.json', JSON.stringify({ + name: 'npm-test-publish-config', + version: '1.2.3', publishConfig: { registry: common.registry } -}), "utf8") +}), 'utf8') -fs.writeFileSync(pkg + "/fixture_npmrc", - "//localhost:1337/:email = fancy@feast.net\n" + - "//localhost:1337/:username = fancy\n" + - "//localhost:1337/:_password = " + new Buffer("feast").toString("base64") + "\n" + - "registry = http://localhost:1337/") +fs.writeFileSync(pkg + '/fixture_npmrc', + '//localhost:1337/:email = fancy@feast.net\n' + + '//localhost:1337/:username = fancy\n' + + '//localhost:1337/:_password = ' + new Buffer('feast').toString('base64') + '\n' + + 'registry = http://localhost:1337/') test(function (t) { var child t.plan(4) - require("http").createServer(function (req, res) { - t.pass("got request on the fakey fake registry") + require('http').createServer(function (req, res) { + t.pass('got request on the fakey fake registry') this.close() res.statusCode = 500 res.end(JSON.stringify({ - error: "sshhh. naptime nao. \\^O^/ <(YAWWWWN!)" + error: 'sshhh. naptime nao. \\^O^/ <(YAWWWWN!)' })) child.kill('SIGHUP') }).listen(common.port, function () { - t.pass("server is listening") + t.pass('server is listening') // don't much care about listening to the child's results // just wanna make sure it hits the server we just set up. @@ -40,20 +40,20 @@ test(function (t) { // itself functions normally. // // Make sure that we don't sit around waiting for lock files - child = common.npm(["publish", "--userconfig=" + pkg + "/fixture_npmrc"], { + child = common.npm(['publish', '--userconfig=' + pkg + '/fixture_npmrc'], { cwd: pkg, - stdio: "inherit", + stdio: 'inherit', env: { - "npm_config_cache_lock_stale": 1000, - "npm_config_cache_lock_wait": 1000, + 'npm_config_cache_lock_stale': 1000, + 'npm_config_cache_lock_wait': 1000, HOME: process.env.HOME, Path: process.env.PATH, PATH: process.env.PATH, USERPROFILE: osenv.home() } }, function (err, code) { - t.ifError(err, "publish command finished successfully") - t.notOk(code, "npm install exited with code 0") + t.ifError(err, 'publish command finished successfully') + t.notOk(code, 'npm install exited with code 0') }) }) }) diff --git a/deps/npm/test/tap/publish-invalid-semver-tag.js b/deps/npm/test/tap/publish-invalid-semver-tag.js index 1a741d348db6e8..21543869a5ca66 100644 --- a/deps/npm/test/tap/publish-invalid-semver-tag.js +++ b/deps/npm/test/tap/publish-invalid-semver-tag.js @@ -39,11 +39,11 @@ test('setup', function (t) { registry: common.registry, cwd: PKG_DIR }, function (err) { - t.ifError(err, 'started server') - mockServer = server + t.ifError(err, 'started server') + mockServer = server - t.end() - }) + t.end() + }) }) }) diff --git a/deps/npm/test/tap/publish-scoped.js b/deps/npm/test/tap/publish-scoped.js index f74ca2e6160f60..c2a8301b77eb3a 100644 --- a/deps/npm/test/tap/publish-scoped.js +++ b/deps/npm/test/tap/publish-scoped.js @@ -1,93 +1,91 @@ -var fs = require("fs") -var path = require("path") - -var test = require("tap").test -var mkdirp = require("mkdirp") -var rimraf = require("rimraf") -var nock = require("nock") - -var npm = require("../../") -var common = require("../common-tap.js") - -var pkg = path.join(__dirname, "prepublish_package") - -test("setup", function (t) { - mkdirp(path.join(pkg, "cache"), next) - - function next () { - process.chdir(pkg) - fs.writeFile( - path.join(pkg, "package.json"), - JSON.stringify({ - name: "@bigco/publish-organized", - version: "1.2.5" - }), - "ascii", - function (er) { - t.ifError(er) - - t.pass("setup done") - t.end() - } - ) - } +var fs = require('fs') +var path = require('path') + +var test = require('tap').test +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var common = require('../common-tap') +var mr = require('npm-registry-mock') + +var pkg = path.join(__dirname, 'prepublish_package') + +var server + +function setup () { + cleanup() + mkdirp.sync(path.join(pkg, 'cache')) + + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify({ + name: '@bigco/publish-organized', + version: '1.2.5' + }, null, 2), + 'ascii') +} + +test('setup', function (t) { + setup() + mr({port: common.port, throwOnUnmatched: true}, function (err, s) { + t.ifError(err, 'registry mocked successfully') + server = s + t.end() + }) }) -test("npm publish should honor scoping", function (t) { - var put = nock(common.registry) - .put("/@bigco%2fpublish-organized") - .reply(201, verify) - - var configuration = { - cache : path.join(pkg, "cache"), - loglevel : "silent", - registry : "http://nonexistent.lvh.me", - "//localhost:1337/:username" : "username", - "//localhost:1337/:_password" : new Buffer("password").toString("base64"), - "//localhost:1337/:email" : "ogd@aoaioxxysz.net" - } - - npm.load(configuration, onload) - - function onload (er) { - t.ifError(er, "npm bootstrapped successfully") - - npm.config.set("@bigco:registry", common.registry) - npm.commands.publish([], false, function (er) { - t.ifError(er, "published without error") - - put.done() - - t.end() - }) - } +test('npm publish should honor scoping', function (t) { + server.filteringRequestBody(verify) + .put('/@bigco%2fpublish-organized', true) + .reply(201, {ok: true}) + + var configuration = [ + 'progress=false', + 'cache=' + path.join(pkg, 'cache'), + 'registry=http://nonexistent.lvh.me', + '//localhost:1337/:username=username', + '//localhost:1337/:_password=' + new Buffer('password').toString('base64'), + '//localhost:1337/:email=' + 'ogd@aoaioxxysz.net', + '@bigco:registry=' + common.registry + ] + var configFile = path.join(pkg, '.npmrc') + + fs.writeFileSync(configFile, configuration.join('\n') + '\n') + + common.npm(['publish'], {'cwd': pkg}, function (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'published without error') + server.done() + t.end() + }) - function verify (_, body) { + function verify (body) { t.doesNotThrow(function () { var parsed = JSON.parse(body) - var current = parsed.versions["1.2.5"] + var current = parsed.versions['1.2.5'] t.equal( current._npmVersion, - require(path.resolve(__dirname, "../../package.json")).version, - "npm version is correct" + require(path.resolve(__dirname, '../../package.json')).version, + 'npm version is correct' ) t.equal( current._nodeVersion, process.versions.node, - "node version is correct" + 'node version is correct' ) - }, "converted body back into object") + }, 'converted body back into object') - return {ok: true} + return true } }) -test("cleanup", function (t) { - process.chdir(__dirname) - rimraf(pkg, function (er) { - t.ifError(er) - - t.end() - }) +test('cleanup', function (t) { + server.close() + t.end() + cleanup() }) + +function cleanup () { + process.chdir(__dirname) + rimraf.sync(pkg) +} diff --git a/deps/npm/test/tap/pwd-prefix.js b/deps/npm/test/tap/pwd-prefix.js index 237096e0a2c2a6..1b59f5c838cc85 100644 --- a/deps/npm/test/tap/pwd-prefix.js +++ b/deps/npm/test/tap/pwd-prefix.js @@ -2,31 +2,31 @@ // thing when the cwd is where package.json is, and when // the package.json is one level up. -var test = require("tap").test -var common = require("../common-tap.js") -var path = require("path") -var root = path.resolve(__dirname, "../..") -var lib = path.resolve(root, "lib") -var commands = ["run", "version"] +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var root = path.resolve(__dirname, '../..') +var lib = path.resolve(root, 'lib') +var commands = ['run', 'version'] commands.forEach(function (cmd) { // Should get the same stdout and stderr each time var stdout, stderr - test(cmd + " in root", function (t) { + test(cmd + ' in root', function (t) { common.npm([cmd], {cwd: root}, function (er, code, so, se) { if (er) throw er - t.notOk(code, "npm " + cmd + " exited with code 0") + t.notOk(code, 'npm ' + cmd + ' exited with code 0') stdout = so stderr = se t.end() }) }) - test(cmd + " in lib", function (t) { + test(cmd + ' in lib', function (t) { common.npm([cmd], {cwd: lib}, function (er, code, so, se) { if (er) throw er - t.notOk(code, "npm " + cmd + " exited with code 0") + t.notOk(code, 'npm ' + cmd + ' exited with code 0') t.equal(so, stdout) t.equal(se, stderr) t.end() diff --git a/deps/npm/test/tap/referer.js b/deps/npm/test/tap/referer.js index c1b173d9765969..8c3dbed72c319d 100644 --- a/deps/npm/test/tap/referer.js +++ b/deps/npm/test/tap/referer.js @@ -1,16 +1,16 @@ -var common = require("../common-tap.js") -var test = require("tap").test -var http = require("http") +var common = require('../common-tap.js') +var test = require('tap').test +var http = require('http') -test("should send referer http header", function (t) { +test('should send referer http header', function (t) { http.createServer(function (q, s) { - t.equal(q.headers.referer, "install foo") + t.equal(q.headers.referer, 'install foo') s.statusCode = 404 - s.end(JSON.stringify({error: "whatever"})) + s.end(JSON.stringify({error: 'whatever'})) this.close() }).listen(common.port, function () { - var reg = "http://localhost:" + common.port - var args = [ "install", "foo", "--registry", reg ] + var reg = 'http://localhost:' + common.port + var args = [ 'install', 'foo', '--registry', reg ] common.npm(args, {}, function (er, code) { if (er) { throw er diff --git a/deps/npm/test/tap/registry.js b/deps/npm/test/tap/registry.js index 060d9b67b67fcc..7b17192f66507b 100644 --- a/deps/npm/test/tap/registry.js +++ b/deps/npm/test/tap/registry.js @@ -1,71 +1,68 @@ // Run all the tests in the `npm-registry-couchapp` suite // This verifies that the server-side stuff still works. -var common = require("../common-tap") -var test = require("tap").test +var common = require('../common-tap') +var test = require('tap').test -var npmExec = require.resolve("../../bin/npm-cli.js") -var path = require("path") -var ca = path.resolve(__dirname, "../../node_modules/npm-registry-couchapp") +var npmExec = require.resolve('../../bin/npm-cli.js') +var path = require('path') +var ca = path.resolve(__dirname, '../../node_modules/npm-registry-couchapp') -var which = require("which") +var which = require('which') -var v = process.versions.node.split(".").map(function (n) { return parseInt(n, 10) }) +var v = process.versions.node.split('.').map(function (n) { return parseInt(n, 10) }) if (v[0] === 0 && v[1] < 10) { console.error( - "WARNING: need a recent Node for npm-registry-couchapp tests to run, have", + 'WARNING: need a recent Node for npm-registry-couchapp tests to run, have', process.versions.node ) -} -else { - which("couchdb", function (er) { +} else { + which('couchdb', function (er) { if (er) { - console.error("WARNING: need couch to run test: " + er.message) - } - else { + console.error('WARNING: need couch to run test: ' + er.message) + } else { runTests() } }) } +var extend = Object.assign || require('util')._extend function runTests () { - var env = { TAP: 1 } - for (var i in process.env) env[i] = process.env[i] + var env = extend({ TAP: 1 }, process.env) env.npm = npmExec var opts = { cwd: ca, - stdio: "inherit" + stdio: 'inherit' } - common.npm(["install"], opts, function (err, code) { + common.npm(['install'], opts, function (err, code) { if (err) { throw err } if (code) { - return test("need install to work", function (t) { - t.fail("install failed with: " + code) + return test('need install to work', function (t) { + t.fail('install failed with: ' + code) t.end() }) - } else { opts = { cwd: ca, env: env, - stdio: "inherit" + stdio: 'inherit' } - common.npm(["test", "--", "-Rtap"], opts, function (err, code) { + common.npm(['test', '--', '-Rtap'], opts, function (err, code) { if (err) { throw err } if (code) { - return test("need test to work", function (t) { - t.fail("test failed with: " + code) + return test('need test to work', function (t) { + t.fail('test failed with: ' + code) t.end() }) } opts = { cwd: ca, env: env, - stdio: "inherit" + stdio: 'inherit' } - common.npm(["prune", "--production"], opts, function (err, code) { + common.npm(['prune', '--production'], opts, function (err, code) { if (err) { throw err } process.exit(code || 0) }) diff --git a/deps/npm/test/tap/repo.js b/deps/npm/test/tap/repo.js index 565842b9a61625..292415705ef4f2 100644 --- a/deps/npm/test/tap/repo.js +++ b/deps/npm/test/tap/repo.js @@ -1,76 +1,75 @@ -if (process.platform === "win32") { - console.error("skipping test, because windows and shebangs") - return +if (process.platform === 'win32') { + console.error('skipping test, because windows and shebangs') + process.exit(0) } -var common = require("../common-tap.js") -var mr = require("npm-registry-mock") +var common = require('../common-tap.js') +var mr = require('npm-registry-mock') -var test = require("tap").test -var npm = require.resolve("../../bin/npm-cli.js") -var node = process.execPath -var rimraf = require("rimraf") -var spawn = require("child_process").spawn -var fs = require("fs") +var test = require('tap').test +var rimraf = require('rimraf') +var fs = require('fs') var path = require('path') var outFile = path.join(__dirname, '/_output') var opts = { cwd: __dirname } -test("setup", function (t) { - var s = "#!/usr/bin/env bash\n" + - "echo \"$@\" > " + JSON.stringify(__dirname) + "/_output\n" - fs.writeFileSync(__dirname + "/_script.sh", s, "ascii") - fs.chmodSync(__dirname + "/_script.sh", "0755") - t.pass("made script") +test('setup', function (t) { + var s = '#!/usr/bin/env bash\n' + + 'echo \"$@\" > ' + JSON.stringify(__dirname) + '/_output\n' + fs.writeFileSync(__dirname + '/_script.sh', s, 'ascii') + fs.chmodSync(__dirname + '/_script.sh', '0755') + t.pass('made script') t.end() }) -test("npm repo underscore", function (t) { - mr({port : common.port}, function (er, s) { +test('npm repo underscore', function (t) { + mr({ port: common.port }, function (er, s) { common.npm([ 'repo', 'underscore', '--registry=' + common.registry, '--loglevel=silent', '--browser=' + __dirname + '/_script.sh' ], opts, function (err, code, stdout, stderr) { + t.ifError(err, 'repo command ran without error') t.equal(code, 0, 'exit ok') var res = fs.readFileSync(outFile, 'ascii') s.close() - t.equal(res, "https://github.com/jashkenas/underscore\n") + t.equal(res, 'https://github.com/jashkenas/underscore\n') rimraf.sync(outFile) t.end() }) }) }) - test('npm repo optimist - github (https://)', function (t) { - mr({port : common.port}, function (er, s) { + mr({ port: common.port }, function (er, s) { common.npm([ 'repo', 'optimist', '--registry=' + common.registry, '--loglevel=silent', '--browser=' + __dirname + '/_script.sh' ], opts, function (err, code, stdout, stderr) { + t.ifError(err, 'repo command ran without error') t.equal(code, 0, 'exit ok') var res = fs.readFileSync(outFile, 'ascii') s.close() - t.equal(res, "https://github.com/substack/node-optimist\n") + t.equal(res, 'https://github.com/substack/node-optimist\n') rimraf.sync(outFile) t.end() }) }) }) -test("npm repo npm-test-peer-deps - no repo", function (t) { - mr({port : common.port}, function (er, s) { +test('npm repo npm-test-peer-deps - no repo', function (t) { + mr({ port: common.port }, function (er, s) { common.npm([ 'repo', 'npm-test-peer-deps', '--registry=' + common.registry, '--loglevel=silent', '--browser=' + __dirname + '/_script.sh' ], opts, function (err, code, stdout, stderr) { + t.ifError(err, 'repo command ran without error') t.equal(code, 1, 'exit not ok') s.close() t.end() @@ -78,62 +77,65 @@ test("npm repo npm-test-peer-deps - no repo", function (t) { }) }) -test("npm repo test-repo-url-http - non-github (http://)", function (t) { - mr({port : common.port}, function (er, s) { +test('npm repo test-repo-url-http - non-github (http://)', function (t) { + mr({ port: common.port }, function (er, s) { common.npm([ 'repo', 'test-repo-url-http', '--registry=' + common.registry, '--loglevel=silent', '--browser=' + __dirname + '/_script.sh' ], opts, function (err, code, stdout, stderr) { + t.ifError(err, 'repo command ran without error') t.equal(code, 0, 'exit ok') var res = fs.readFileSync(outFile, 'ascii') s.close() - t.equal(res, "http://gitlab.com/evanlucas/test-repo-url-http\n") + t.equal(res, 'http://gitlab.com/evanlucas/test-repo-url-http\n') rimraf.sync(outFile) t.end() }) }) }) -test("npm repo test-repo-url-https - non-github (https://)", function (t) { - mr({port : common.port}, function (er, s) { +test('npm repo test-repo-url-https - non-github (https://)', function (t) { + mr({ port: common.port }, function (er, s) { common.npm([ 'repo', 'test-repo-url-https', '--registry=' + common.registry, '--loglevel=silent', '--browser=' + __dirname + '/_script.sh' ], opts, function (err, code, stdout, stderr) { + t.ifError(err, 'repo command ran without error') t.equal(code, 0, 'exit ok') var res = fs.readFileSync(outFile, 'ascii') s.close() - t.equal(res, "https://gitlab.com/evanlucas/test-repo-url-https\n") + t.equal(res, 'https://gitlab.com/evanlucas/test-repo-url-https\n') rimraf.sync(outFile) t.end() }) }) }) -test("npm repo test-repo-url-ssh - non-github (ssh://)", function (t) { - mr({port : common.port}, function (er, s) { +test('npm repo test-repo-url-ssh - non-github (ssh://)', function (t) { + mr({ port: common.port }, function (er, s) { common.npm([ 'repo', 'test-repo-url-ssh', '--registry=' + common.registry, '--loglevel=silent', '--browser=' + __dirname + '/_script.sh' ], opts, function (err, code, stdout, stderr) { + t.ifError(err, 'repo command ran without error') t.equal(code, 0, 'exit ok') var res = fs.readFileSync(outFile, 'ascii') s.close() - t.equal(res, "http://gitlab.com/evanlucas/test-repo-url-ssh\n") + t.equal(res, 'https://gitlab.com/evanlucas/test-repo-url-ssh\n') rimraf.sync(outFile) t.end() }) }) }) -test("cleanup", function (t) { - fs.unlinkSync(__dirname + "/_script.sh") - t.pass("cleaned up") +test('cleanup', function (t) { + fs.unlinkSync(__dirname + '/_script.sh') + t.pass('cleaned up') t.end() }) diff --git a/deps/npm/test/tap/rm-linked.js b/deps/npm/test/tap/rm-linked.js new file mode 100644 index 00000000000000..cd46c013adf13d --- /dev/null +++ b/deps/npm/test/tap/rm-linked.js @@ -0,0 +1,136 @@ +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var path = require('path') +var rimraf = require('rimraf') +var test = require('tap').test +var writeFileSync = require('fs').writeFileSync + +var common = require('../common-tap.js') + +var link = path.join(__dirname, 'rmlinked') +var linkDep = path.join(link, 'node_modules', 'baz') +var linkInstall = path.join(__dirname, 'rmlinked-install') +var linkRoot = path.join(__dirname, 'rmlinked-root') + +var config = 'prefix = ' + linkRoot +var configPath = path.join(link, '_npmrc') + +var OPTS = { + env: { + 'npm_config_userconfig': configPath + } +} + +var linkedJSON = { + name: 'foo', + version: '1.0.0', + description: '', + main: 'index.js', + scripts: { + test: 'echo \"Error: no test specified\" && exit 1' + }, + dependencies: { + 'baz': '1.0.0' + }, + author: '', + license: 'ISC' +} + +var linkedDepJSON = { + name: 'baz', + version: '1.0.0', + description: '', + main: 'index.js', + scripts: { + test: 'echo \"Error: no test specified\" && exit 1' + }, + author: '', + license: 'ISC' +} + +var installJSON = { + name: 'bar', + version: '1.0.0', + description: '', + main: 'index.js', + scripts: { + test: 'echo \"Error: no test specified\" && exit 1' + }, + dependencies: { + 'foo': '1.0.0' + }, + author: '', + license: 'ISC' +} + +test('setup', function (t) { + setup() + common.npm(['ls', '-g', '--depth=0'], OPTS, function (err, c, out) { + t.ifError(err) + t.equal(c, 0, 'set up ok') + t.notOk(out.match(/UNMET DEPENDENCY foo@/), "foo isn't in global") + t.end() + }) +}) + +test('creates global link', function (t) { + process.chdir(link) + common.npm(['link'], OPTS, function (err, c, out) { + t.ifError(err, 'link has no error') + common.npm(['ls', '-g'], OPTS, function (err, c, out, stderr) { + t.ifError(err) + t.equal(c, 0) + t.equal(stderr, '', 'got expected stderr') + t.has(out, /foo@1.0.0/, 'creates global link ok') + t.end() + }) + }) +}) + +test('uninstall the global linked package', function (t) { + process.chdir(osenv.tmpdir()) + common.npm(['uninstall', '-g', 'foo'], OPTS, function (err) { + t.ifError(err, 'uninstall has no error') + process.chdir(link) + common.npm(['ls'], OPTS, function (err, c, out) { + t.ifError(err) + t.equal(c, 0) + t.has(out, /baz@1.0.0/, "uninstall didn't remove dep") + t.end() + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + try { rimraf.sync(linkRoot) } catch (e) { } + try { rimraf.sync(linkDep) } catch (e) { } + try { rimraf.sync(link) } catch (e) { } + try { rimraf.sync(linkInstall) } catch (e) { } +} + +function setup () { + cleanup() + mkdirp.sync(linkRoot) + mkdirp.sync(link) + writeFileSync( + path.join(link, 'package.json'), + JSON.stringify(linkedJSON, null, 2) + ) + mkdirp.sync(linkDep) + writeFileSync( + path.join(linkDep, 'package.json'), + JSON.stringify(linkedDepJSON, null, 2) + ) + mkdirp.sync(linkInstall) + writeFileSync( + path.join(linkInstall, 'package.json'), + JSON.stringify(installJSON, null, 2) + ) + writeFileSync(configPath, config) +} diff --git a/deps/npm/test/tap/run-script.js b/deps/npm/test/tap/run-script.js index 5d414d8e9249f9..3892337cee9f76 100644 --- a/deps/npm/test/tap/run-script.js +++ b/deps/npm/test/tap/run-script.js @@ -25,8 +25,13 @@ var fullyPopulated = { 'prewith-both': 'node -e "console.log(process.argv[1] || \'pre\')"', 'with-both': 'node -e "console.log(process.argv[1] || \'main\')"', 'postwith-both': 'node -e "console.log(process.argv[1] || \'post\')"', - 'stop': 'node -e "console.log(process.argv[1] || \'stop\')"' - } + 'stop': 'node -e "console.log(process.argv[1] || \'stop\')"', + 'env-vars': 'node -e "console.log(process.env.run_script_foo_var)"', + 'npm-env-vars': 'node -e "console.log(process.env.npm_run_script_foo_var)"', + 'package-env-vars': 'node -e "console.log(process.env.run_script_foo_var)"', + 'prefixed-package-env-vars': 'node -e "console.log(process.env.npm_package_run_script_foo_var)"' + }, + 'run_script_foo_var': 'run_script_test_foo_val' } var lifecycleOnly = { @@ -62,15 +67,14 @@ var preversionOnly = { } } - function testOutput (t, command, er, code, stdout, stderr) { var lines - if (er) - throw er + if (er) throw er - if (stderr) + if (stderr) { throw new Error('npm ' + command + ' stderr: ' + stderr.toString()) + } lines = stdout.trim().split('\n') stdout = lines.filter(function (line) { @@ -181,6 +185,64 @@ test('npm run-script nonexistent-script with --if-present flag', function (t) { }) }) +test('npm run-script env vars accessible', function (t) { + process.env.run_script_foo_var = 'run_script_test_foo_val' + common.npm(['run-script', 'env-vars'], { + cwd: pkg + }, function (err, code, stdout, stderr) { + t.ifError(err, 'ran run-script without crashing') + t.equal(code, 0, 'exited normally') + t.equal(stderr, '', 'no error output') + t.match(stdout, + new RegExp(process.env.run_script_foo_var), + 'script had env access') + t.end() + }) +}) + +test('npm run-script package.json vars injected', function (t) { + common.npm(['run-script', 'package-env-vars'], { + cwd: pkg + }, function (err, code, stdout, stderr) { + t.ifError(err, 'ran run-script without crashing') + t.equal(code, 0, 'exited normally') + t.equal(stderr, '', 'no error output') + t.match(stdout, + new RegExp(fullyPopulated.run_script_foo_var), + 'script injected package.json value') + t.end() + }) +}) + +test('npm run-script package.json vars injected with prefix', function (t) { + common.npm(['run-script', 'prefixed-package-env-vars'], { + cwd: pkg + }, function (err, code, stdout, stderr) { + t.ifError(err, 'ran run-script without crashing') + t.equal(code, 0, 'exited normally') + t.equal(stderr, '', 'no error output') + t.match(stdout, + new RegExp(fullyPopulated.run_script_foo_var), + 'script injected npm_package-prefixed package.json value') + t.end() + }) +}) + +test('npm run-script env vars stripped npm-prefixed', function (t) { + process.env.npm_run_script_foo_var = 'run_script_test_foo_val' + common.npm(['run-script', 'npm-env-vars'], { + cwd: pkg + }, function (err, code, stdout, stderr) { + t.ifError(err, 'ran run-script without crashing') + t.equal(code, 0, 'exited normally') + t.equal(stderr, '', 'no error output') + t.notMatch(stdout, + new RegExp(process.env.npm_run_script_foo_var), + 'script stripped npm-prefixed env var') + t.end() + }) +}) + test('npm run-script no-params (lifecycle only)', function (t) { var expected = [ 'Lifecycle scripts included in scripted:', diff --git a/deps/npm/test/tap/scripts-whitespace-windows.js b/deps/npm/test/tap/scripts-whitespace-windows.js index f23f0625716fbb..bff0e534ef37df 100644 --- a/deps/npm/test/tap/scripts-whitespace-windows.js +++ b/deps/npm/test/tap/scripts-whitespace-windows.js @@ -35,6 +35,8 @@ var dependency = { bin: [ 'bin/foo' ] } +var extend = Object.assign || require('util')._extend + var foo = function () {/* #!/usr/bin/env node @@ -63,12 +65,12 @@ test('setup', function (t) { common.npm(['i', dep], { cwd: pkg, - env: { + env: extend({ npm_config_cache: cache, npm_config_tmp: tmp, npm_config_prefix: pkg, npm_config_global: 'false' - } + }, process.env) }, function (err, code, stdout, stderr) { t.ifErr(err, 'npm i ' + dep + ' finished without error') t.equal(code, 0, 'npm i ' + dep + ' exited ok') @@ -99,4 +101,3 @@ function cleanup () { process.chdir(osenv.tmpdir()) rimraf.sync(pkg) } - diff --git a/deps/npm/test/tap/search.js b/deps/npm/test/tap/search.js index 0412e1755d62e2..138517c3bd13c4 100644 --- a/deps/npm/test/tap/search.js +++ b/deps/npm/test/tap/search.js @@ -74,6 +74,20 @@ test('No previous cache, init cache triggered by first search', function (t) { }) }) +test('no arguments provided should error', function (t) { + common.npm(['search'], [], function (err, code, stdout, stderr) { + if (err) throw err + t.equal(code, 1, 'search finished unsuccessfully') + + t.match( + stderr, + /search must be called with arguments/, + 'should have correct error message' + ) + t.end() + }) +}) + test('previous cache, _updated set, should trigger since request', function (t) { setupCache() @@ -180,97 +194,97 @@ function stringifyUpdated (time) { var allMock = { '_updated': timeMock.all, 'generator-frontcow': { - 'name': 'generator-frontcow', - 'description': 'f36b6a6123da50959741e2ce4d634f96ec668c56 This is a fake description to ensure we do not accidentally search the real npm registry or use some kind of cache', - 'dist-tags': { - 'latest': '0.1.19' - }, - 'maintainers': [ - { - 'name': 'bcabanes', - 'email': 'contact@benjamincabanes.com' - } - ], - 'homepage': 'https://github.com/bcabanes/generator-frontcow', - 'keywords': [ - 'sass', - 'frontend', - 'yeoman-generator', - 'atomic', - 'design', - 'sass', - 'foundation', - 'foundation5', - 'atomic design', - 'bourbon', - 'polyfill', - 'font awesome' - ], - 'repository': { - 'type': 'git', - 'url': 'https://github.com/bcabanes/generator-frontcow' - }, - 'author': { - 'name': 'ben', - 'email': 'contact@benjamincabanes.com', - 'url': 'https://github.com/bcabanes' - }, - 'bugs': { - 'url': 'https://github.com/bcabanes/generator-frontcow/issues' - }, - 'license': 'MIT', - 'readmeFilename': 'README.md', - 'time': { - 'modified': '2014-10-03T02:26:18.406Z' - }, - 'versions': { - '0.1.19': 'latest' + 'name': 'generator-frontcow', + 'description': 'f36b6a6123da50959741e2ce4d634f96ec668c56 This is a fake description to ensure we do not accidentally search the real npm registry or use some kind of cache', + 'dist-tags': { + 'latest': '0.1.19' + }, + 'maintainers': [ + { + 'name': 'bcabanes', + 'email': 'contact@benjamincabanes.com' } + ], + 'homepage': 'https://github.com/bcabanes/generator-frontcow', + 'keywords': [ + 'sass', + 'frontend', + 'yeoman-generator', + 'atomic', + 'design', + 'sass', + 'foundation', + 'foundation5', + 'atomic design', + 'bourbon', + 'polyfill', + 'font awesome' + ], + 'repository': { + 'type': 'git', + 'url': 'https://github.com/bcabanes/generator-frontcow' + }, + 'author': { + 'name': 'ben', + 'email': 'contact@benjamincabanes.com', + 'url': 'https://github.com/bcabanes' + }, + 'bugs': { + 'url': 'https://github.com/bcabanes/generator-frontcow/issues' + }, + 'license': 'MIT', + 'readmeFilename': 'README.md', + 'time': { + 'modified': '2014-10-03T02:26:18.406Z' + }, + 'versions': { + '0.1.19': 'latest' + } }, 'marko': { - 'name': 'marko', - 'description': 'Marko is an extensible, streaming, asynchronous, high performance, HTML-based templating language that can be used in Node.js or in the browser.', - 'dist-tags': { - 'latest': '1.2.16' - }, - 'maintainers': [ - { - 'name': 'pnidem', - 'email': 'pnidem@gmail.com' - }, - { - 'name': 'philidem', - 'email': 'phillip.idem@gmail.com' - } - ], - 'homepage': 'https://github.com/raptorjs/marko', - 'keywords': [ - 'templating', - 'template', - 'async', - 'streaming' - ], - 'repository': { - 'type': 'git', - 'url': 'https://github.com/raptorjs/marko.git' - }, - 'author': { - 'name': 'Patrick Steele-Idem', - 'email': 'pnidem@gmail.com' + 'name': 'marko', + 'description': 'Marko is an extensible, streaming, asynchronous, high performance, HTML-based templating language that can be used in Node.js or in the browser.', + 'dist-tags': { + 'latest': '1.2.16' + }, + 'maintainers': [ + { + 'name': 'pnidem', + 'email': 'pnidem@gmail.com' }, - 'bugs': { - 'url': 'https://github.com/raptorjs/marko/issues' - }, - 'license': 'Apache License v2.0', - 'readmeFilename': 'README.md', - 'users': { - 'pnidem': true - }, - 'time': { - 'modified': '2014-10-03T02:27:31.775Z' - }, - 'versions': { - '1.2.16': 'latest' + { + 'name': 'philidem', + 'email': 'phillip.idem@gmail.com' } + ], + 'homepage': 'https://github.com/raptorjs/marko', + 'keywords': [ + 'templating', + 'template', + 'async', + 'streaming' + ], + 'repository': { + 'type': 'git', + 'url': 'https://github.com/raptorjs/marko.git' + }, + 'author': { + 'name': 'Patrick Steele-Idem', + 'email': 'pnidem@gmail.com' + }, + 'bugs': { + 'url': 'https://github.com/raptorjs/marko/issues' + }, + 'license': 'Apache License v2.0', + 'readmeFilename': 'README.md', + 'users': { + 'pnidem': true + }, + 'time': { + 'modified': '2014-10-03T02:27:31.775Z' + }, + 'versions': { + '1.2.16': 'latest' + } } } diff --git a/deps/npm/test/tap/semver-doc.js b/deps/npm/test/tap/semver-doc.js index 963cace101fbdd..31c75fffd8ad7b 100644 --- a/deps/npm/test/tap/semver-doc.js +++ b/deps/npm/test/tap/semver-doc.js @@ -1,12 +1,12 @@ -var test = require("tap").test +var test = require('tap').test -test("semver doc is up to date", function (t) { - var path = require("path") - var moddoc = path.join(__dirname, "../../node_modules/semver/README.md") - var mydoc = path.join(__dirname, "../../doc/misc/semver.md") - var fs = require("fs") - var mod = fs.readFileSync(moddoc, "utf8").replace(/semver\(1\)/, "semver(7)") - var my = fs.readFileSync(mydoc, "utf8") +test('semver doc is up to date', function (t) { + var path = require('path') + var moddoc = path.join(__dirname, '../../node_modules/semver/README.md') + var mydoc = path.join(__dirname, '../../doc/misc/semver.md') + var fs = require('fs') + var mod = fs.readFileSync(moddoc, 'utf8').replace(/semver\(1\)/, 'semver(7)') + var my = fs.readFileSync(mydoc, 'utf8') t.equal(my, mod) t.end() }) diff --git a/deps/npm/test/tap/semver-tag.js b/deps/npm/test/tap/semver-tag.js index 03dcdf85b6466f..b4feb75176c4ac 100644 --- a/deps/npm/test/tap/semver-tag.js +++ b/deps/npm/test/tap/semver-tag.js @@ -1,11 +1,11 @@ // should not allow tagging with a valid semver range -var common = require("../common-tap.js") -var test = require("tap").test +var common = require('../common-tap.js') +var test = require('tap').test -test("try to tag with semver range as tag name", function (t) { - var cmd = ["tag", "zzzz@1.2.3", "v2.x", "--registry=http://localhost"] +test('try to tag with semver range as tag name', function (t) { + var cmd = ['tag', 'zzzz@1.2.3', 'v2.x', '--registry=http://localhost'] common.npm(cmd, { - stdio: "pipe" + stdio: 'pipe' }, function (er, code, so, se) { if (er) throw er t.similar(se, /Tag name must not be a valid SemVer range: v2.x\n/) diff --git a/deps/npm/test/tap/shrinkwrap-dev-dependency.js b/deps/npm/test/tap/shrinkwrap-dev-dependency.js index a124c2b7fe6ba6..0a239e97ce43af 100644 --- a/deps/npm/test/tap/shrinkwrap-dev-dependency.js +++ b/deps/npm/test/tap/shrinkwrap-dev-dependency.js @@ -77,9 +77,7 @@ function setup (cb) { var opts = { cache: path.resolve(pkg, 'cache'), - registry: common.registry, - // important to make sure devDependencies don't get stripped - dev: true + registry: common.registry } npm.load(opts, cb) } diff --git a/deps/npm/test/tap/shrinkwrap-empty-deps.js b/deps/npm/test/tap/shrinkwrap-empty-deps.js index 32cbd5eb40d21e..cf7e9a6e80427a 100644 --- a/deps/npm/test/tap/shrinkwrap-empty-deps.js +++ b/deps/npm/test/tap/shrinkwrap-empty-deps.js @@ -51,8 +51,7 @@ test('returns a list of removed items', function (t) { t.same( { 'name': 'shrinkwrap-empty-deps', - 'version': '0.0.0', - 'dependencies': {} + 'version': '0.0.0' }, JSON.parse(desired), 'shrinkwrap handled empty deps without exploding' diff --git a/deps/npm/test/tap/shrinkwrap-local-dependency.js b/deps/npm/test/tap/shrinkwrap-local-dependency.js index ffbde6574ee86a..8d7c0712f9ae58 100644 --- a/deps/npm/test/tap/shrinkwrap-local-dependency.js +++ b/deps/npm/test/tap/shrinkwrap-local-dependency.js @@ -1,63 +1,62 @@ -var test = require("tap").test -var path = require("path") -var fs = require("fs") -var osenv = require("osenv") -var rimraf = require("rimraf") -var mkdirp = require("mkdirp") -var common = require("../common-tap.js") - -var PKG_DIR = path.resolve(__dirname, "shrinkwrap-local-dependency") -var CACHE_DIR = path.resolve(PKG_DIR, "cache") -var DEP_DIR = path.resolve(PKG_DIR, "dep") +var test = require('tap').test +var path = require('path') +var fs = require('fs') +var osenv = require('osenv') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var common = require('../common-tap.js') + +var PKG_DIR = path.resolve(__dirname, 'shrinkwrap-local-dependency') +var CACHE_DIR = path.resolve(PKG_DIR, 'cache') +var DEP_DIR = path.resolve(PKG_DIR, 'dep') var desired = { - "name": "npm-test-shrinkwrap-local-dependency", - "version": "0.0.0", - "dependencies": { - "npm-test-shrinkwrap-local-dependency-dep": { - "version": "0.0.0", - "from": "dep", - "resolved": "file:dep" + 'name': 'npm-test-shrinkwrap-local-dependency', + 'version': '0.0.0', + 'dependencies': { + 'npm-test-shrinkwrap-local-dependency-dep': { + 'version': '0.0.0', + 'from': 'dep', + 'resolved': 'file:dep' } } } var root = { - "author": "Thomas Torp", - "name": "npm-test-shrinkwrap-local-dependency", - "version": "0.0.0", - "dependencies": { - "npm-test-shrinkwrap-local-dependency-dep": "file:./dep" + 'author': 'Thomas Torp', + 'name': 'npm-test-shrinkwrap-local-dependency', + 'version': '0.0.0', + 'dependencies': { + 'npm-test-shrinkwrap-local-dependency-dep': 'file:./dep' } } var dependency = { - "author": "Thomas Torp", - "name": "npm-test-shrinkwrap-local-dependency-dep", - "version": "0.0.0" + 'author': 'Thomas Torp', + 'name': 'npm-test-shrinkwrap-local-dependency-dep', + 'version': '0.0.0' } - -test("shrinkwrap uses resolved with file: on local deps", function(t) { +test('shrinkwrap uses resolved with file: on local deps', function (t) { setup() common.npm( - ["--cache="+CACHE_DIR, "--loglevel=silent", "install", "."], + ['--cache=' + CACHE_DIR, '--loglevel=silent', 'install', '.'], {}, function (err, code) { - t.ifError(err, "npm install worked") - t.equal(code, 0, "npm exited normally") + t.ifError(err, 'npm install worked') + t.equal(code, 0, 'npm exited normally') common.npm( - ["--cache="+CACHE_DIR, "--loglevel=silent", "shrinkwrap"], + ['--cache=' + CACHE_DIR, '--loglevel=silent', 'shrinkwrap'], {}, function (err, code) { - t.ifError(err, "npm shrinkwrap worked") - t.equal(code, 0, "npm exited normally") + t.ifError(err, 'npm shrinkwrap worked') + t.equal(code, 0, 'npm exited normally') - fs.readFile("npm-shrinkwrap.json", { encoding : "utf8" }, function (err, data) { - t.ifError(err, "read file correctly") - t.deepEqual(JSON.parse(data), desired, "shrinkwrap looks correct") + fs.readFile('npm-shrinkwrap.json', { encoding: 'utf8' }, function (err, data) { + t.ifError(err, 'read file correctly') + t.deepEqual(JSON.parse(data), desired, 'shrinkwrap looks correct') t.end() }) @@ -67,22 +66,22 @@ test("shrinkwrap uses resolved with file: on local deps", function(t) { ) }) -test('"npm install" should install local packages from shrinkwrap', function (t) { +test("'npm install' should install local packages from shrinkwrap", function (t) { cleanNodeModules() common.npm( - ["--cache="+CACHE_DIR, "--loglevel=silent", "install", "."], + ['--cache=' + CACHE_DIR, '--loglevel=silent', 'install', '.'], {}, function (err, code) { - t.ifError(err, "install ran correctly") - t.notOk(code, "npm install exited with code 0") + t.ifError(err, 'install ran correctly') + t.notOk(code, 'npm install exited with code 0') var dependencyPackageJson = path.resolve( PKG_DIR, - "node_modules/npm-test-shrinkwrap-local-dependency-dep/package.json" + 'node_modules/npm-test-shrinkwrap-local-dependency-dep/package.json' ) t.ok( - JSON.parse(fs.readFileSync(dependencyPackageJson, "utf8")), - "package with local dependency installed from shrinkwrap" + JSON.parse(fs.readFileSync(dependencyPackageJson, 'utf8')), + 'package with local dependency installed from shrinkwrap' ) t.end() @@ -90,32 +89,32 @@ test('"npm install" should install local packages from shrinkwrap', function (t) ) }) -test("cleanup", function(t) { +test('cleanup', function (t) { cleanup() t.end() }) -function setup() { +function setup () { cleanup() mkdirp.sync(PKG_DIR) mkdirp.sync(CACHE_DIR) mkdirp.sync(DEP_DIR) fs.writeFileSync( - path.resolve(PKG_DIR, "package.json"), + path.resolve(PKG_DIR, 'package.json'), JSON.stringify(root, null, 2) ) fs.writeFileSync( - path.resolve(DEP_DIR, "package.json"), + path.resolve(DEP_DIR, 'package.json'), JSON.stringify(dependency, null, 2) ) process.chdir(PKG_DIR) } -function cleanNodeModules() { - rimraf.sync(path.resolve(PKG_DIR, "node_modules")) +function cleanNodeModules () { + rimraf.sync(path.resolve(PKG_DIR, 'node_modules')) } -function cleanup() { +function cleanup () { process.chdir(osenv.tmpdir()) cleanNodeModules() rimraf.sync(PKG_DIR) diff --git a/deps/npm/test/tap/shrinkwrap-optional-dependency.js b/deps/npm/test/tap/shrinkwrap-optional-dependency.js new file mode 100644 index 00000000000000..ee44b9a7b05d69 --- /dev/null +++ b/deps/npm/test/tap/shrinkwrap-optional-dependency.js @@ -0,0 +1,101 @@ +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') +var npm = npm = require('../../') + +var pkg = path.resolve(__dirname, 'shrinkwrap-optional-dependency') + +test('shrinkwrap does not fail on missing optional dependency', function (t) { + t.plan(1) + + var mocks = { + get: { + '/random-package': [404, {}] + } + } + + mr({port: common.port, mocks: mocks}, function (er, s) { + function fail (err) { + s.close() // Close on failure to allow node to exit + t.fail(err) + } + + setup(function (err) { + if (err) return fail(err) + + // Install without the optional dependency + npm.install('.', function (err) { + if (err) return fail(err) + + // Pretend the optional dependency was specified, but somehow failed to load: + json.optionalDependencies = { + 'random-package': '0.0.0' + } + writePackage() + + npm.commands.shrinkwrap([], true, function (err, results) { + if (err) return fail(err) + + t.deepEqual(results, desired) + s.close() + t.end() + }) + }) + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +var desired = { + name: 'npm-test-shrinkwrap-optional-dependency', + version: '0.0.0', + dependencies: { + 'test-package': { + version: '0.0.0', + from: 'test-package@0.0.0', + resolved: common.registry + '/test-package/-/test-package-0.0.0.tgz' + } + } +} + +var json = { + author: 'Maximilian Antoni', + name: 'npm-test-shrinkwrap-optional-dependency', + version: '0.0.0', + dependencies: { + 'test-package': '0.0.0' + } +} + +function writePackage () { + fs.writeFileSync(path.join(pkg, 'package.json'), JSON.stringify(json, null, 2)) +} + +function setup (cb) { + cleanup() + mkdirp.sync(pkg) + writePackage() + process.chdir(pkg) + + var opts = { + cache: path.resolve(pkg, 'cache'), + registry: common.registry + } + npm.load(opts, cb) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/deps/npm/test/tap/shrinkwrap-prod-dependency-also.js b/deps/npm/test/tap/shrinkwrap-prod-dependency-also.js new file mode 100644 index 00000000000000..5bcae6d2f58d1d --- /dev/null +++ b/deps/npm/test/tap/shrinkwrap-prod-dependency-also.js @@ -0,0 +1,93 @@ +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var npm = npm = require('../../') + +var common = require('../common-tap.js') +var pkg = path.resolve(__dirname, 'shrinkwrap-prod-dependency') + +test("shrinkwrap --also=development doesn't strip out prod dependencies", function (t) { + t.plan(1) + + mr({port: common.port}, function (er, s) { + setup({}, function (err) { + if (err) return t.fail(err) + + npm.install('.', function (err) { + if (err) return t.fail(err) + + npm.config.set('also', 'development') + npm.commands.shrinkwrap([], true, function (err, results) { + if (err) return t.fail(err) + + t.deepEqual(results, desired) + s.close() + t.end() + }) + }) + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +var desired = { + name: 'npm-test-shrinkwrap-prod-dependency', + version: '0.0.0', + dependencies: { + request: { + version: '0.9.0', + from: 'request@0.9.0', + resolved: common.registry + '/request/-/request-0.9.0.tgz' + }, + underscore: { + version: '1.5.1', + from: 'underscore@1.5.1', + resolved: common.registry + '/underscore/-/underscore-1.5.1.tgz' + } + } +} + +var json = { + author: 'Domenic Denicola', + name: 'npm-test-shrinkwrap-prod-dependency', + version: '0.0.0', + dependencies: { + request: '0.9.0' + }, + devDependencies: { + underscore: '1.5.1' + } +} + +function setup (opts, cb) { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync(path.join(pkg, 'package.json'), JSON.stringify(json, null, 2)) + process.chdir(pkg) + + var allOpts = { + cache: path.resolve(pkg, 'cache'), + registry: common.registry + } + + for (var key in opts) { + allOpts[key] = opts[key] + } + + npm.load(allOpts, cb) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/deps/npm/test/tap/shrinkwrap-save-with-existing-dev-deps.js b/deps/npm/test/tap/shrinkwrap-save-with-existing-dev-deps.js new file mode 100644 index 00000000000000..fa8895577a4cc9 --- /dev/null +++ b/deps/npm/test/tap/shrinkwrap-save-with-existing-dev-deps.js @@ -0,0 +1,87 @@ +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var base = path.resolve(__dirname, path.basename(__filename, '.js')) +var installme = path.join(base, 'installme') +var installme_pkg = path.join(installme, 'package.json') +var example = path.join(base, 'example') +var example_shrinkwrap = path.join(example, 'npm-shrinkwrap.json') +var example_pkg = path.join(example, 'package.json') +var installed = path.join(example, 'node_modules', 'installed') +var installed_pkg = path.join(installed, 'package.json') + +var EXEC_OPTS = { cwd: example } + +var installme_pkg_json = { + name: 'installme', + version: '1.0.0', + dependencies: {} +} + +var example_pkg_json = { + name: 'example', + version: '1.0.0', + dependencies: {}, + devDependencies: { + 'installed': '1.0' + } +} + +var example_shrinkwrap_json = { + name: 'example', + version: '1.0.0', + dependencies: { + installed: { + version: '1.0.0' + } + } +} + +var installed_pkg_json = { + _id: 'installed@1.0.0', + name: 'installed', + version: '1.0.0' +} + +function writeJson (filename, obj) { + mkdirp.sync(path.dirname(filename)) + fs.writeFileSync(filename, JSON.stringify(obj, null, 2)) +} + +test('setup', function (t) { + cleanup() + writeJson(installme_pkg, installme_pkg_json) + writeJson(example_pkg, example_pkg_json) + writeJson(example_shrinkwrap, example_shrinkwrap_json) + writeJson(installed_pkg, installed_pkg_json) + t.end() +}) + +test('install --save leaves dev deps alone', function (t) { + common.npm(['install', '--save', 'file://' + installme], EXEC_OPTS, function (er, code, stdout, stderr) { + t.ifError(er, "spawn didn't catch fire") + t.is(code, 0, 'install completed ok') + t.is(stderr, '', 'install completed without error output') + var shrinkwrap = JSON.parse(fs.readFileSync(example_shrinkwrap)) + t.ok(shrinkwrap.dependencies.installed, "save new install didn't remove dev dep") + t.ok(shrinkwrap.dependencies.installme, 'save new install DID add new dep') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(base) +} diff --git a/deps/npm/test/tap/shrinkwrap-scoped-auth.js b/deps/npm/test/tap/shrinkwrap-scoped-auth.js index 79414ccd22b937..63fd08cb07165f 100644 --- a/deps/npm/test/tap/shrinkwrap-scoped-auth.js +++ b/deps/npm/test/tap/shrinkwrap-scoped-auth.js @@ -1,92 +1,101 @@ -var resolve = require("path").resolve -var writeFileSync = require("graceful-fs").writeFileSync - -var mkdirp = require("mkdirp") -var mr = require("npm-registry-mock") -var osenv = require("osenv") -var rimraf = require("rimraf") -var test = require("tap").test - -var common = require("../common-tap.js") -var toNerfDart = require("../../lib/config/nerf-dart.js") - -var pkg = resolve(__dirname, "shrinkwrap-scoped-auth") -var outfile = resolve(pkg, "_npmrc") -var modules = resolve(pkg, "node_modules") -var tarballPath = "/scoped-underscore/-/scoped-underscore-1.3.1.tgz" +var resolve = require('path').resolve +var writeFileSync = require('graceful-fs').writeFileSync + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') +var toNerfDart = require('../../lib/config/nerf-dart.js') + +var pkg = resolve(__dirname, 'shrinkwrap-scoped-auth') +var outfile = resolve(pkg, '_npmrc') +var modules = resolve(pkg, 'node_modules') +var tarballPath = '/scoped-underscore/-/scoped-underscore-1.3.1.tgz' var tarballURL = common.registry + tarballPath -var tarball = resolve(__dirname, "../fixtures/scoped-underscore-1.3.1.tgz") +var tarball = resolve(__dirname, '../fixtures/scoped-underscore-1.3.1.tgz') var server -var EXEC_OPTS = { - cwd : pkg -} +var EXEC_OPTS = { cwd: pkg } function mocks (server) { - var auth = "Bearer 0xabad1dea" - server.get(tarballPath, { authorization : auth }).replyWithFile(200, tarball) + var auth = 'Bearer 0xabad1dea' + server.get(tarballPath, { authorization: auth }).replyWithFile(200, tarball) server.get(tarballPath).reply(401, { - error : "unauthorized", - reason : "You are not authorized to access this db." + error: 'unauthorized', + reason: 'You are not authorized to access this db.' }) } -test("setup", function (t) { - mr({ port : common.port, plugin : mocks }, function (err, s) { +test('setup', function (t) { + mr({ port: common.port, plugin: mocks }, function (er, s) { server = s - t.ok(s, "set up mock registry") + t.ok(s, 'set up mock registry') setup() t.end() }) }) -test("authed npm install with shrinkwrapped scoped package", function (t) { +test('authed npm install with shrinkwrapped scoped package', function (t) { common.npm( [ - "install", - "--loglevel", "silent", - "--fetch-retries", 0, - "--userconfig", outfile + 'install', + '--loglevel', 'silent', + '--json', + '--fetch-retries', 0, + '--userconfig', outfile ], EXEC_OPTS, function (err, code, stdout, stderr) { - t.ifError(err, "test runner executed without error") - t.equal(code, 0, "npm install exited OK") - t.notOk(stderr, "no output on stderr") - t.equal( - stdout, - "@scoped/underscore@1.3.1 node_modules/@scoped/underscore\n", - "module installed where expected" - ) + t.ifError(err, 'test runner executed without error') + t.equal(code, 0, 'npm install exited OK') + t.notOk(stderr, 'no output on stderr') + try { + var results = JSON.parse(stdout) + } catch (ex) { + console.error('#', ex) + t.ifError(ex, 'stdout was valid JSON') + } + + if (results) { + var installedversion = { + 'version': '1.3.1', + 'from': '>=1.3.1 <2', + 'resolved': 'http://localhost:1337/scoped-underscore/-/scoped-underscore-1.3.1.tgz' + } + t.isDeeply(results.dependencies['@scoped/underscore'], installedversion, '@scoped/underscore installed') + } t.end() } ) }) -test("cleanup", function (t) { +test('cleanup', function (t) { server.close() cleanup() t.end() }) -var contents = "@scoped:registry="+common.registry+"\n" + - toNerfDart(common.registry)+":_authToken=0xabad1dea\n" +var contents = '@scoped:registry=' + common.registry + '\n' + + toNerfDart(common.registry) + ':_authToken=0xabad1dea\n' var json = { - name : "test-package-install", - version : "1.0.0" + name: 'test-package-install', + version: '1.0.0' } var shrinkwrap = { - name : "test-package-install", - version : "1.0.0", - dependencies : { - "@scoped/underscore" : { - resolved : tarballURL, - from : ">=1.3.1 <2", - version : "1.3.1" + name: 'test-package-install', + version: '1.0.0', + dependencies: { + '@scoped/underscore': { + resolved: tarballURL, + from: '>=1.3.1 <2', + version: '1.3.1' } } } @@ -94,15 +103,15 @@ var shrinkwrap = { function setup () { cleanup() mkdirp.sync(modules) - writeFileSync(resolve(pkg, "package.json"), JSON.stringify(json, null, 2)+"\n") + writeFileSync(resolve(pkg, 'package.json'), JSON.stringify(json, null, 2) + '\n') writeFileSync(outfile, contents) writeFileSync( - resolve(pkg, "npm-shrinkwrap.json"), - JSON.stringify(shrinkwrap, null, 2)+"\n" + resolve(pkg, 'npm-shrinkwrap.json'), + JSON.stringify(shrinkwrap, null, 2) + '\n' ) } -function cleanup() { +function cleanup () { process.chdir(osenv.tmpdir()) rimraf.sync(pkg) } diff --git a/deps/npm/test/tap/shrinkwrap-version-match.js b/deps/npm/test/tap/shrinkwrap-version-match.js new file mode 100644 index 00000000000000..cb4e9255049080 --- /dev/null +++ b/deps/npm/test/tap/shrinkwrap-version-match.js @@ -0,0 +1,120 @@ +'use strict' +var test = require('tap').test +var fs = require('fs') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var path = require('path') +var common = require('../common-tap.js') + +var testdir = path.resolve(__dirname, path.basename(__filename, '.js')) +var modAdir = path.resolve(testdir, 'modA') +var modB1dir = path.resolve(testdir, 'modB@1') +var modB2dir = path.resolve(testdir, 'modB@2') +var modCdir = path.resolve(testdir, 'modC') +var testjson = { + dependencies: { + modA: 'file://' + modAdir, + modC: 'file://' + modCdir + } +} +var testshrinkwrap = { + dependencies: { + modA: { + version: '1.0.0', + from: 'modA', + resolved: 'file://' + modAdir + }, + modB: { + version: '1.0.0', + from: 'modB@1', + resolved: 'file://' + modB1dir + } + } +} +var modAjson = { + name: 'modA', + version: '1.0.0', + dependencies: { + 'modB': 'file://' + modB1dir + } +} +var modCjson = { + name: 'modC', + version: '1.0.0', + dependencies: { + 'modB': 'file://' + modB2dir + } +} +var modB1json = { + name: 'modB', + version: '1.0.0' +} +var modB2json = { + name: 'modB', + version: '2.0.0' +} + +function writepjson (dir, content) { + writejson(dir, 'package.json', content) +} +function writejson (dir, file, content) { + writefile(dir, file, JSON.stringify(content, null, 2)) +} +function writefile (dir, file, content) { + fs.writeFileSync(path.join(dir, file), content) +} + +function setup () { + mkdirp.sync(testdir) + writepjson(testdir, testjson) + writejson(testdir, 'npm-shrinkwrap.json', testshrinkwrap) + mkdirp.sync(modAdir) + writepjson(modAdir, modAjson) + mkdirp.sync(modB1dir) + writepjson(modB1dir, modB1json) + writefile(modB1dir, 'B1', '') + mkdirp.sync(modB2dir) + writepjson(modB2dir, modB2json) + writefile(modB2dir, 'B2', '') + mkdirp.sync(modCdir) + writepjson(modCdir, modCjson) +} + +function cleanup () { + rimraf.sync(testdir) +} + +test('setup', function (t) { + cleanup() + setup() + t.end() +}) + +// Shrinkwraps need to let you override dependency versions specified in +// package.json files. Indeed, this was already supported, but it was a bit +// to keen on this. Previously, if you had a dep in your shrinkwrap then +// anything that required that dependency would count as a match, regardless +// of version. + +// This test ensures that the broad matching is not done when the matched +// module is not a direct child of the module doing the requiring. + +test('bundled', function (t) { + common.npm(['install'], {cwd: testdir}, function (err, code, out, stderr) { + t.is(err, null, 'No fatal errors running npm') + t.is(code, 0, 'npm itself completed ok') + // Specifically, if B2 exists (or the modB directory under modC at all) + // that means modC was given its own copy of modB. Without the patch + // that went with this test, it wouldn't have been installed because npm + // would have consider modB@1 to have fulfilled modC's requirement. + fs.stat(path.join(testdir, 'node_modules', 'modC', 'node_modules', 'modB', 'B2'), function (missing) { + t.ok(!missing, 'modC got the right version of modB') + t.end() + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) diff --git a/deps/npm/test/tap/sorted-package-json.js b/deps/npm/test/tap/sorted-package-json.js index 6853cf3020637d..427212ff56298f 100644 --- a/deps/npm/test/tap/sorted-package-json.js +++ b/deps/npm/test/tap/sorted-package-json.js @@ -1,21 +1,20 @@ -var test = require("tap").test - , path = require("path") - , rimraf = require("rimraf") - , mkdirp = require("mkdirp") - , spawn = require("child_process").spawn - , npm = require.resolve("../../bin/npm-cli.js") - , node = process.execPath - , pkg = path.resolve(__dirname, "sorted-package-json") - , tmp = path.join(pkg, "tmp") - , cache = path.join(pkg, "cache") - , fs = require("fs") - , common = require("../common-tap.js") - , mr = require("npm-registry-mock") - , osenv = require("osenv") +var test = require('tap').test +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var spawn = require('child_process').spawn +var npm = require.resolve('../../bin/npm-cli.js') +var node = process.execPath +var pkg = path.resolve(__dirname, 'sorted-package-json') +var tmp = path.join(pkg, 'tmp') +var cache = path.join(pkg, 'cache') +var fs = require('fs') +var common = require('../common-tap.js') +var mr = require('npm-registry-mock') +var osenv = require('osenv') - -test("sorting dependencies", function (t) { - var packageJson = path.resolve(pkg, "package.json") +test('sorting dependencies', function (t) { + var packageJson = path.resolve(pkg, 'package.json') cleanup() mkdirp.sync(cache) @@ -24,27 +23,28 @@ test("sorting dependencies", function (t) { var before = JSON.parse(fs.readFileSync(packageJson).toString()) - mr({port : common.port}, function (er, s) { + mr({ port: common.port }, function (er, s) { // underscore is already in the package.json, // but --save will trigger a rewrite with sort - var child = spawn(node, [npm, "install", "--save", "underscore@1.3.3"], { + var child = spawn(node, [npm, 'install', '--save', 'underscore@1.3.3', '--no-progress', '--loglevel=error'], { cwd: pkg, env: { - "npm_config_registry": common.registry, - "npm_config_cache": cache, - "npm_config_tmp": tmp, - "npm_config_prefix": pkg, - "npm_config_global": "false", + 'npm_config_registry': common.registry, + 'npm_config_cache': cache, + 'npm_config_tmp': tmp, + 'npm_config_prefix': pkg, + 'npm_config_global': 'false', HOME: process.env.HOME, Path: process.env.PATH, PATH: process.env.PATH - } + }, + stdio: ['ignore', 'ignore', process.stderr] }) - child.on("close", function (code) { - t.equal(code, 0, "npm install exited with code") + child.on('close', function (code) { + t.equal(code, 0, 'npm install exited with code') var result = fs.readFileSync(packageJson).toString() - , resultAsJson = JSON.parse(result) + var resultAsJson = JSON.parse(result) s.close() @@ -61,33 +61,33 @@ test("sorting dependencies", function (t) { }) }) -test("cleanup", function (t) { +test('cleanup', function (t) { cleanup() - t.pass("cleaned up") + t.pass('cleaned up') t.end() }) -function setup() { +function setup () { mkdirp.sync(pkg) - fs.writeFileSync(path.resolve(pkg, "package.json"), JSON.stringify({ - "name": "sorted-package-json", - "version": "0.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({ + 'name': 'sorted-package-json', + 'version': '0.0.0', + 'description': '', + 'main': 'index.js', + 'scripts': { + 'test': 'echo \'Error: no test specified\' && exit 1' }, - "author": "Rocko Artischocko", - "license": "ISC", - "dependencies": { - "underscore": "^1.3.3", - "request": "^0.9.0" + 'author': 'Rocko Artischocko', + 'license': 'ISC', + 'dependencies': { + 'underscore': '^1.3.3', + 'request': '^0.9.0' } - }, null, 2), "utf8") + }, null, 2), 'utf8') } -function cleanup() { +function cleanup () { process.chdir(osenv.tmpdir()) rimraf.sync(cache) rimraf.sync(pkg) diff --git a/deps/npm/test/tap/spawn-enoent-help.js b/deps/npm/test/tap/spawn-enoent-help.js index 70fb078faf77e8..716f6ebd1537fe 100644 --- a/deps/npm/test/tap/spawn-enoent-help.js +++ b/deps/npm/test/tap/spawn-enoent-help.js @@ -1,25 +1,25 @@ -var path = require("path") -var test = require("tap").test -var rimraf = require("rimraf") -var mkdirp = require("mkdirp") -var common = require("../common-tap.js") +var path = require('path') +var test = require('tap').test +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var common = require('../common-tap.js') -var pkg = path.resolve(__dirname, "spawn-enoent-help") +var pkg = path.resolve(__dirname, 'spawn-enoent-help') -test("setup", function (t) { +test('setup', function (t) { rimraf.sync(pkg) mkdirp.sync(pkg) t.end() }) -test("enoent help", function (t) { - common.npm(["help", "config"], { +test('enoent help', function (t) { + common.npm(['help', 'config'], { cwd: pkg, env: { - PATH: "", - Path: "", - "npm_config_loglevel": "warn", - "npm_config_viewer": "woman" + PATH: '', + Path: '', + 'npm_config_loglevel': 'warn', + 'npm_config_viewer': 'woman' } }, function (er, code, sout, serr) { t.similar(serr, /Check if the file 'emacsclient' is present./) @@ -28,7 +28,7 @@ test("enoent help", function (t) { }) }) -test("clean", function (t) { +test('clean', function (t) { rimraf.sync(pkg) t.end() }) diff --git a/deps/npm/test/tap/spawn-enoent.js b/deps/npm/test/tap/spawn-enoent.js index 29b70f6f8ac19e..320e477e0ec4e0 100644 --- a/deps/npm/test/tap/spawn-enoent.js +++ b/deps/npm/test/tap/spawn-enoent.js @@ -1,32 +1,31 @@ -var path = require("path") -var test = require("tap").test -var fs = require("fs") -var rimraf = require("rimraf") -var mkdirp = require("mkdirp") -var common = require("../common-tap.js") +var path = require('path') +var test = require('tap').test +var fs = require('fs') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var common = require('../common-tap.js') -var pkg = path.resolve(__dirname, "spawn-enoent") +var pkg = path.resolve(__dirname, 'spawn-enoent') var pj = JSON.stringify({ - name:"x", - version: "1.2.3", - scripts: { start: "wharble-garble-blorst" } -}, null, 2) + "\n" + name: 'x', + version: '1.2.3', + scripts: { start: 'wharble-garble-blorst' } +}, null, 2) + '\n' - -test("setup", function (t) { +test('setup', function (t) { rimraf.sync(pkg) mkdirp.sync(pkg) - fs.writeFileSync(pkg + "/package.json", pj) + fs.writeFileSync(pkg + '/package.json', pj) t.end() }) -test("enoent script", function (t) { - common.npm(["start"], { +test('enoent script', function (t) { + common.npm(['start'], { cwd: pkg, env: { PATH: process.env.PATH, Path: process.env.Path, - "npm_config_loglevel": "warn" + 'npm_config_loglevel': 'warn' } }, function (er, code, sout, serr) { t.similar(serr, /npm ERR! Failed at the x@1\.2\.3 start script 'wharble-garble-blorst'\./) @@ -34,7 +33,7 @@ test("enoent script", function (t) { }) }) -test("clean", function (t) { +test('clean', function (t) { rimraf.sync(pkg) t.end() }) diff --git a/deps/npm/test/tap/splat-with-only-prerelease-to-latest.js b/deps/npm/test/tap/splat-with-only-prerelease-to-latest.js index d402bed2961866..2598d5578620f9 100644 --- a/deps/npm/test/tap/splat-with-only-prerelease-to-latest.js +++ b/deps/npm/test/tap/splat-with-only-prerelease-to-latest.js @@ -1,7 +1,6 @@ 'use strict' var test = require('tap').test var npm = require('../../lib/npm') -var log = require('npmlog') var stream = require('readable-stream') var moduleName = 'xyzzy-wibble' @@ -42,23 +41,23 @@ var testModule = { shasum: 'da39a3ee5e6b4b0d3255bfef95601890afd80709', tarball: 'http://registry.npmjs.org/aproba/-/xyzzy-wibble-1.3.0-a.tgz' } - }, - }, + } + } } var lastFetched test('setup', function (t) { - npm.load(function(){ + npm.load(function () { npm.config.set('loglevel', 'silly') npm.registry = { get: function (uri, opts, cb) { - setImmediate(function () { + setTimeout(function () { cb(null, testModule, null, {statusCode: 200}) }) }, fetch: function (u, opts, cb) { lastFetched = u - setImmediate(function () { + setTimeout(function () { var empty = new stream.Readable() empty.push(null) cb(null, empty) @@ -69,13 +68,13 @@ test('setup', function (t) { }) }) - test('splat', function (t) { - t.plan(3) + t.plan(4) var addNamed = require('../../lib/cache/add-named.js') addNamed('xyzzy-wibble', '*', testModule, function (err, pkg) { t.error(err, 'Succesfully resolved a splat package') t.is(pkg.name, moduleName) t.is(pkg.version, testModule['dist-tags'].latest) + t.is(lastFetched, 'https://registry.npmjs.org/aproba/-/xyzzy-wibble-1.3.0-a.tgz') }) }) diff --git a/deps/npm/test/tap/symlink-cycle.js b/deps/npm/test/tap/symlink-cycle.js new file mode 100644 index 00000000000000..b09b25acc8676f --- /dev/null +++ b/deps/npm/test/tap/symlink-cycle.js @@ -0,0 +1,61 @@ +'use strict' +var fs = require('fs') +var path = require('path') +var test = require('tap').test +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var writeFileSync = require('fs').writeFileSync +var common = require('../common-tap.js') + +var base = path.join(__dirname, path.basename(__filename, '.js')) +var cycle = path.join(base, 'cycle') + +var cycleJSON = { + name: 'cycle', + version: '1.0.0', + description: '', + main: 'index.js', + scripts: { + test: 'echo \"Error: no test specified\" && exit 1' + }, + dependencies: { + 'cycle': '*' + }, + author: '', + license: 'ISC' +} + +test('setup', function (t) { + setup() + t.end() +}) + +test('ls', function (t) { + process.chdir(cycle) + common.npm(['ls'], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'installed w/o error') + t.is(stderr, '', 'no warnings printed to stderr') + t.end() + }) +}) + +test('cleanup', function (t) { + process.chdir(osenv.tmpdir()) + cleanup() + t.end() +}) + +function cleanup () { + rimraf.sync(base) +} + +function setup () { + cleanup() + mkdirp.sync(path.join(cycle, 'node_modules')) + writeFileSync( + path.join(cycle, 'package.json'), + JSON.stringify(cycleJSON, null, 2) + ) + fs.symlinkSync(cycle, path.join(cycle, 'node_modules', 'cycle')) +} diff --git a/deps/npm/test/tap/tag-version-prefix.js b/deps/npm/test/tap/tag-version-prefix.js index f4ba32b1255618..9035e9fbdd5a0b 100644 --- a/deps/npm/test/tap/tag-version-prefix.js +++ b/deps/npm/test/tap/tag-version-prefix.js @@ -25,49 +25,48 @@ test('npm version with message config', function (t) { var git = require('../../lib/utils/git.js') common.makeGitRepo({ path: pkg }, function (er) { - t.ifErr(er, 'git bootstrap ran without error') - - common.npm( - [ - '--userconfig', npmrc, - 'config', - 'set', - 'tag-version-prefix', - 'q' - ], - { cwd: pkg, env: { PATH: process.env.PATH } }, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm config ran without issue') - t.notOk(code, 'exited with a non-error code') - t.notOk(stderr, 'no error output') - - common.npm( - [ - 'version', - 'patch', - '--loglevel', 'silent' - // package config is picked up from env - ], - { cwd: pkg, env: { PATH: process.env.PATH } }, - function (err, code, stdout, stderr) { - t.ifError(err, 'npm version ran without issue') - t.notOk(code, 'exited with a non-error code') - t.notOk(stderr, 'no error output') - - git.whichAndExec( - ['tag'], - { cwd: pkg, env: process.env }, - function (er, tags, stderr) { - t.ok(tags.match(/q0\.1\.3/g), 'tag was created by version' + tags) - t.end() - } - ) - } - ) - } - ) - } - ) + t.ifErr(er, 'git bootstrap ran without error') + + common.npm( + [ + '--userconfig', npmrc, + 'config', + 'set', + 'tag-version-prefix', + 'q' + ], + { cwd: pkg, env: { PATH: process.env.PATH } }, + function (err, code, stdout, stderr) { + t.ifError(err, 'npm config ran without issue') + t.notOk(code, 'exited with a non-error code') + t.notOk(stderr, 'no error output') + + common.npm( + [ + 'version', + 'patch', + '--loglevel', 'silent' + // package config is picked up from env + ], + { cwd: pkg, env: { PATH: process.env.PATH } }, + function (err, code, stdout, stderr) { + t.ifError(err, 'npm version ran without issue') + t.notOk(code, 'exited with a non-error code') + t.notOk(stderr, 'no error output') + + git.whichAndExec( + ['tag'], + { cwd: pkg, env: process.env }, + function (er, tags, stderr) { + t.ok(tags.match(/q0\.1\.3/g), 'tag was created by version' + tags) + t.end() + } + ) + } + ) + } + ) + }) }) }) diff --git a/deps/npm/test/tap/team.js b/deps/npm/test/tap/team.js index 4bfcbaddb2d90b..b13fa86e8b8df0 100644 --- a/deps/npm/test/tap/team.js +++ b/deps/npm/test/tap/team.js @@ -1,6 +1,3 @@ -var fs = require('fs') -var path = require('path') -var rimraf = require('rimraf') var mr = require('npm-registry-mock') var test = require('tap').test diff --git a/deps/npm/test/tap/test-run-ls.js b/deps/npm/test/tap/test-run-ls.js index 252c6e8f931e6e..ea495879f31025 100644 --- a/deps/npm/test/tap/test-run-ls.js +++ b/deps/npm/test/tap/test-run-ls.js @@ -1,30 +1,30 @@ -var common = require("../common-tap.js") -var test = require("tap").test -var path = require("path") -var cwd = path.resolve(__dirname, "..", "..") -var testscript = require("../../package.json").scripts.test -var tsregexp = testscript.replace(/([\[\.\*\]])/g, "\\$1") +var common = require('../common-tap.js') +var test = require('tap').test +var path = require('path') +var cwd = path.resolve(__dirname, '..', '..') +var testscript = require('../../package.json').scripts.test +var tsregexp = testscript.replace(/([\[\.\*\]])/g, '\\$1') -test("default", function (t) { - common.npm(["run"], { cwd: cwd }, function (er, code, so) { +test('default', function (t) { + common.npm(['run'], { cwd: cwd }, function (er, code, so) { if (er) throw er t.notOk(code) - t.similar(so, new RegExp("\\n test\\n " + tsregexp + "\\n")) + t.similar(so, new RegExp('\\n test\\n ' + tsregexp + '\\n')) t.end() }) }) -test("parseable", function (t) { - common.npm(["run", "-p"], { cwd: cwd }, function (er, code, so) { +test('parseable', function (t) { + common.npm(['run', '-p'], { cwd: cwd }, function (er, code, so) { if (er) throw er t.notOk(code) - t.similar(so, new RegExp("\\ntest:" + tsregexp + "\\n")) + t.similar(so, new RegExp('\\ntest:' + tsregexp + '\\n')) t.end() }) }) -test("parseable", function (t) { - common.npm(["run", "--json"], { cwd: cwd }, function (er, code, so) { +test('parseable', function (t) { + common.npm(['run', '--json'], { cwd: cwd }, function (er, code, so) { if (er) throw er t.notOk(code) t.equal(JSON.parse(so).test, testscript) diff --git a/deps/npm/test/tap/tree-style.js b/deps/npm/test/tap/tree-style.js new file mode 100644 index 00000000000000..b2bf0ce709f4e8 --- /dev/null +++ b/deps/npm/test/tap/tree-style.js @@ -0,0 +1,116 @@ +'use strict' +var test = require('tap').test +var path = require('path') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var fs = require('graceful-fs') +var common = require('../common-tap') + +var base = path.resolve(__dirname, path.basename(__filename, '.js')) +var modA = path.resolve(base, 'modA') +var modB = path.resolve(base, 'modB') +var modC = path.resolve(base, 'modC') +var testNormal = path.resolve(base, 'testNormal') +var testGlobal = path.resolve(base, 'testGlobal') +var testLegacy = path.resolve(base, 'testLegacy') + +var json = { + 'name': 'test-tree-style', + 'version': '1.0.0', + 'dependencies': { + 'modA': modA + } +} + +var modAJson = { + 'name': 'modA', + 'version': '1.0.0', + 'dependencies': { + 'modB': modB + } +} + +var modBJson = { + 'name': 'modB', + 'version': '1.0.0', + 'dependencies': { + 'modC': modC + } +} + +var modCJson = { + 'name': 'modC', + 'version': '1.0.0' +} + +function modJoin () { + var modules = Array.prototype.slice.call(arguments) + return modules.reduce(function (a, b) { + return path.resolve(a, 'node_modules', b) + }) +} + +function writeJson (mod, data) { + fs.writeFileSync(path.resolve(mod, 'package.json'), JSON.stringify(data)) +} + +function setup () { + cleanup() + ;[modA, modB, modC, testNormal, testGlobal, testLegacy].forEach(function (mod) { + mkdirp.sync(mod) + }) + writeJson(modA, modAJson) + writeJson(modB, modBJson) + writeJson(modC, modCJson) + ;[testNormal, testGlobal, testLegacy].forEach(function (mod) { writeJson(mod, json) }) +} + +function cleanup () { + rimraf.sync(base) +} + +test('setup', function (t) { + setup() + t.end() +}) + +function exists (t, filepath, msg) { + try { + fs.statSync(filepath) + t.pass(msg) + return true + } catch (ex) { + t.fail(msg, {found: null, wanted: 'exists', compare: 'fs.stat(' + filepath + ')'}) + return false + } +} + +test('tree-style', function (t) { + t.plan(12) + common.npm(['install'], {cwd: testNormal}, function (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'normal install; result code') + t.is(stderr, '', 'normal install; no errors') + exists(t, modJoin(testNormal, 'modA'), 'normal install; module A') + exists(t, modJoin(testNormal, 'modB'), 'normal install; module B') + exists(t, modJoin(testNormal, 'modC'), 'normal install; module C') + }) + common.npm(['install', '--global-style'], {cwd: testGlobal}, function (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'global-style install; result code') + t.is(stderr, '', 'global-style install; no errors') + exists(t, modJoin(testGlobal, 'modA', 'modB'), 'global-style install; module B') + exists(t, modJoin(testGlobal, 'modA', 'modC'), 'global-style install; module C') + }) + common.npm(['install', '--legacy-bundling'], {cwd: testLegacy}, function (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'legacy-bundling install; result code') + t.is(stderr, '', 'legacy-bundling install; no errors') + exists(t, modJoin(testLegacy, 'modA', 'modB', 'modC'), 'legacy-bundling install; module C') + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) diff --git a/deps/npm/test/tap/uninstall-in-reverse.js b/deps/npm/test/tap/uninstall-in-reverse.js new file mode 100644 index 00000000000000..2d8fe2bcfccfb9 --- /dev/null +++ b/deps/npm/test/tap/uninstall-in-reverse.js @@ -0,0 +1,38 @@ +'use strict' +var test = require('tap').test +var requireInject = require('require-inject') +var log = require('npmlog') + +/* +The remove actions need to happen in the opposite of their normally defined +order. That is, they need to go shallow -> deep. +*/ + +var removed = [] +var npm = requireInject.installGlobally('../../lib/npm.js', { + '../../lib/install/action/remove.js': function (top, buildpath, pkg, log, next) { + removed.push(pkg.package.name) + next() + } +}) + +test('setup', function (t) { + npm.load(function () { + t.pass('npm loaded') + t.end() + }) +}) + +test('abc', function (t) { + var Installer = require('../../lib/install.js').Installer + var inst = new Installer(__dirname, false, []) + inst.progress = {executeActions: log} + inst.todo = [ + ['remove', {package: {name: 'first'}}], + ['remove', {package: {name: 'second'}}] + ] + inst.executeActions(function () { + t.isDeeply(removed, ['second', 'first']) + t.end() + }) +}) diff --git a/deps/npm/test/tap/uninstall-link-clean.js b/deps/npm/test/tap/uninstall-link-clean.js new file mode 100644 index 00000000000000..eccdac8b26badf --- /dev/null +++ b/deps/npm/test/tap/uninstall-link-clean.js @@ -0,0 +1,117 @@ +var fs = require('graceful-fs') +var path = require('path') +var existsSync = fs.existsSync || path.existsSync + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.join(__dirname, 'uninstall-link-clean') +var dep = path.join(__dirname, 'dep') +var work = path.join(__dirname, 'uninstall-link-clean-TEST') +var modules = path.join(work, 'node_modules') + +var EXEC_OPTS = { cwd: work } + +var world = 'console.log("hello blrbld")\n' + +var json = { + name: 'package', + version: '0.0.0', + bin: { + hello: './world.js' + }, + dependencies: { + 'dep': 'file:../dep' + } +} + +var pjDep = { + name: 'dep', + version: '0.0.0', + bin: { + hello: './world.js' + } +} + +test('setup', function (t) { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + fs.writeFileSync(path.join(pkg, 'world.js'), world) + + mkdirp.sync(dep) + fs.writeFileSync( + path.join(dep, 'package.json'), + JSON.stringify(pjDep, null, 2) + ) + fs.writeFileSync(path.join(dep, 'world.js'), world) + + mkdirp.sync(modules) + process.chdir(work) + + t.end() +}) + +test('installing package with links', function (t) { + common.npm( + [ + '--loglevel', 'silent', + 'install', pkg + ], + EXEC_OPTS, + function (err, code) { + t.ifError(err, 'install ran to completion without error') + t.notOk(code, 'npm install exited with code 0') + + t.ok( + existsSync(path.join(modules, 'package', 'package.json')), + 'package installed' + ) + t.ok(existsSync(path.join(modules, '.bin')), 'binary link directory exists') + t.ok(existsSync(path.join(modules, 'package', 'node_modules', '.bin')), + 'nested binary link directory exists') + + t.end() + } + ) +}) + +test('uninstalling package with links', function (t) { + common.npm( + [ + '--loglevel', 'silent', + 'uninstall', 'package' + ], + EXEC_OPTS, + function (err, code) { + t.ifError(err, 'uninstall ran to completion without error') + t.notOk(code, 'npm uninstall exited with code 0') + + t.notOk(existsSync(path.join(modules, 'package')), + 'package directory no longer exists') + t.notOk(existsSync(path.join(modules, 'package', 'node_modules', '.bin')), + 'nested binary link directory no longer exists') + + t.end() + } + ) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(dep) + rimraf.sync(work) + rimraf.sync(pkg) +} diff --git a/deps/npm/test/tap/uninstall-package.js b/deps/npm/test/tap/uninstall-package.js index 6e86df531aacb7..549b403ccfd556 100644 --- a/deps/npm/test/tap/uninstall-package.js +++ b/deps/npm/test/tap/uninstall-package.js @@ -56,8 +56,8 @@ test('returns a list of removed items', function (t) { function (err, code, stdout, stderr) { t.ifError(err, 'uninstall ran without issue') t.notOk(code, 'uninstall ran without raising error code') - t.has(stdout, /unbuild underscore@1.3.3/, 'underscore uninstalled') - t.has(stdout, /unbuild request@0.9.5/, 'request uninstalled') + t.has(stdout, /- underscore@1.3.3/, 'underscore uninstalled') + t.has(stdout, /- request@0.9.5/, 'request uninstalled') s.close() t.end() diff --git a/deps/npm/test/tap/uninstall-save.js b/deps/npm/test/tap/uninstall-save.js new file mode 100644 index 00000000000000..c097659d22066d --- /dev/null +++ b/deps/npm/test/tap/uninstall-save.js @@ -0,0 +1,110 @@ +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') +var server + +var pkg = path.join(__dirname, 'uninstall-save') + +var EXEC_OPTS = { cwd: pkg } + +var json = { + name: 'uninstall-save', + version: '0.0.1' +} + +test('setup', function (t) { + setup() + mr({ port: common.port }, function (er, s) { + t.ifError(er, 'started mock registry') + server = s + t.end() + }) +}) + +test('uninstall --save removes rm-ed package from package.json', function (t) { + common.npm( + [ + '--registry', common.registry, + '--loglevel', 'silent', + '--save-prefix', '^', + '--save', + 'install', 'underscore@latest' + ], + EXEC_OPTS, + function (err, code) { + t.ifError(err, 'npm install ran without issue') + t.notOk(code, 'npm install exited with code 0') + + var p = path.join(pkg, 'node_modules', 'underscore', 'package.json') + t.ok(JSON.parse(fs.readFileSync(p))) + + var pkgJson = JSON.parse(fs.readFileSync( + path.join(pkg, 'package.json'), + 'utf8' + )) + t.deepEqual( + pkgJson.dependencies, + { 'underscore': '^1.5.1' }, + 'got expected save prefix and version of 1.5.1' + ) + + var installed = path.join(pkg, 'node_modules', 'underscore') + rimraf.sync(installed) + + common.npm( + [ + '--registry', common.registry, + '--loglevel', 'debug', + '--save', + 'uninstall', 'underscore' + ], + EXEC_OPTS, + function (err, code) { + t.ifError(err, 'npm uninstall ran without issue') + + var pkgJson = JSON.parse(fs.readFileSync( + path.join(pkg, 'package.json'), + 'utf8' + )) + + t.deepEqual( + pkgJson.dependencies, + { }, + 'dependency removed as expected' + ) + + t.end() + } + ) + } + ) +}) + +test('cleanup', function (t) { + server.close() + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} + +function setup () { + cleanup() + mkdirp.sync(path.resolve(pkg, 'node_modules')) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + + process.chdir(pkg) +} diff --git a/deps/npm/test/tap/unit-child-path.js b/deps/npm/test/tap/unit-child-path.js new file mode 100644 index 00000000000000..5e9b452a381a89 --- /dev/null +++ b/deps/npm/test/tap/unit-child-path.js @@ -0,0 +1,9 @@ +'use strict' +var test = require('tap').test +var childPath = require('../../lib/utils/child-path.js') + +test('childPath', function (t) { + t.is(childPath('/path/to', {name: 'abc'}), '/path/to/node_modules/abc', 'basic use') + t.is(childPath('/path/to', {package: {name: '@zed/abc'}}), '/path/to/node_modules/@zed/abc', 'scoped use') + t.end() +}) diff --git a/deps/npm/test/tap/unit-deps-removeObsoleteDep.js b/deps/npm/test/tap/unit-deps-removeObsoleteDep.js new file mode 100644 index 00000000000000..2e34fd730f2b6f --- /dev/null +++ b/deps/npm/test/tap/unit-deps-removeObsoleteDep.js @@ -0,0 +1,41 @@ +'use strict' +var test = require('tap').test +var requireInject = require('require-inject') + +// we're just mocking to avoid having to call `npm.load` +var deps = requireInject('../../lib/install/deps.js', { + '../../lib/npm.js': { + config: { + get: function () { return 'mock' } + } + } +}) + +var removeObsoleteDep = deps._removeObsoleteDep + +test('removeObsoleteDep', function (t) { + var child1 = {requiredBy: []} + var test1 = { + removed: true, + requires: [ child1 ] + } + removeObsoleteDep(test1) + t.is(child1.removed, undefined, 'no recursion on deps flagged as removed already') + + var child2 = {requiredBy: []} + var test2 = { + requires: [ child2 ] + } + child2.requiredBy.push(test2) + removeObsoleteDep(test2) + t.is(child2.removed, true, 'required by no other modules, removing') + + var child3 = {requiredBy: ['NOTEMPTY']} + var test3 = { + requires: [ child3 ] + } + child3.requiredBy.push(test3) + removeObsoleteDep(test3) + t.is(child3.removed, undefined, 'required by other modules, keeping') + t.done() +}) diff --git a/deps/npm/test/tap/unit-deps-replaceModule.js b/deps/npm/test/tap/unit-deps-replaceModule.js new file mode 100644 index 00000000000000..d38aa9985d7fed --- /dev/null +++ b/deps/npm/test/tap/unit-deps-replaceModule.js @@ -0,0 +1,50 @@ +'use strict' +var test = require('tap').test +var npm = require('../../lib/npm') + +test('setup', function (t) { + npm.load({}, t.done) +}) + +test('replaceModule', function (t) { + var replaceModule = require('../../lib/install/deps')._replaceModule + var mods = [] + for (var ii = 0; ii < 10; ++ii) { + mods.push({package: {name: ii}}) + } + + var test = {} + test.A = mods.slice(0, 4) + replaceModule(test, 'A', mods[2]) + t.isDeeply(test.A, mods.slice(0, 4), 'replacing an existing module leaves the order alone') + replaceModule(test, 'A', mods[7]) + t.isDeeply(test.A, mods.slice(0, 4).concat(mods[7]), 'replacing a new module appends') + + test.B = mods.slice(0, 4) + var replacement = {package: {name: 1}, isReplacement: true} + replaceModule(test, 'B', replacement) + t.isDeeply(test.B, [mods[0], replacement, mods[2], mods[3]], 'replacing existing module swaps out for the new version') + + replaceModule(test, 'C', mods[7]) + t.isDeeply(test.C, [mods[7]], 'replacing when the key does not exist yet, causes its creation') + t.end() +}) + +test('replaceModuleName', function (t) { + var replaceModuleName = require('../../lib/install/deps')._replaceModuleName + var mods = [] + for (var ii = 0; ii < 10; ++ii) { + mods.push('pkg' + ii) + } + + var test = {} + test.A = mods.slice(0, 4) + replaceModuleName(test, 'A', mods[2]) + t.isDeeply(test.A, mods.slice(0, 4), 'replacing an existing module leaves the order alone') + replaceModuleName(test, 'A', mods[7]) + t.isDeeply(test.A, mods.slice(0, 4).concat(mods[7]), 'replacing a new module appends') + + replaceModuleName(test, 'C', mods[7]) + t.isDeeply(test.C, [mods[7]], 'replacing when the key does not exist yet, causes its creation') + t.end() +}) diff --git a/deps/npm/test/tap/unit-gentlyrm.js b/deps/npm/test/tap/unit-gentlyrm.js new file mode 100644 index 00000000000000..8e61be19647f3c --- /dev/null +++ b/deps/npm/test/tap/unit-gentlyrm.js @@ -0,0 +1,337 @@ +'use strict' +var test = require('tap').test +var requireInject = require('require-inject') + +function error (code) { + var er = new Error() + er.code = code + return er +} + +function mockWith (fixture) { + return { + '../../lib/npm.js': {}, + 'graceful-fs': { + lstat: function (path, cb) { + var entry = fixture[path] + if (!entry) return cb(error('ENOENT')) + cb(null, { + isDirectory: function () { return entry.type === 'directory' }, + isSymbolicLink: function () { return entry.type === 'symlink' }, + isFile: function () { return entry.type === 'file' || entry.type === 'cmdshim' || entry.type === 'error' } + }) + }, + readlink: function (path, cb) { + var entry = fixture[path] + if (!entry) return cb(error('ENOENT')) + if (entry.type !== 'symlink') return cb(error('EINVAL')) + cb(null, entry.dest) + } + }, + 'read-cmd-shim': function (path, cb) { + var entry = fixture[path] + if (!entry) return cb(error('ENOENT')) + if (entry.type === 'directory') return cb(error('EISDIR')) + if (entry.type === 'error') return cb(error(entry.code)) + if (entry.type !== 'cmdshim') return cb(error('ENOTASHIM')) + cb(null, entry.dest) + } + } +} + +test('readLinkOrShim', function (t) { + t.plan(10) + + var mocks = mockWith({ + '/path/to/directory': { type: 'directory' }, + '/path/to/link': { type: 'symlink', dest: '../to/file' }, + '/path/to/file': { type: 'file' }, + '/path/to/cmdshim': { type: 'cmdshim', dest: '../to/file' }, + '/path/to/invalid': { type: 'error', code: 'EINVAL' } + }) + + var gentlyRm = requireInject('../../lib/utils/gently-rm.js', mocks) + var readLinkOrShim = gentlyRm._readLinkOrShim + + readLinkOrShim('/path/to/nowhere', function (er, path) { + t.is(er && er.code, 'ENOENT', 'missing files are errors') + }) + readLinkOrShim('/path/to/invalid', function (er, path) { + t.is(er && er.code, 'EINVAL', 'other errors pass through too') + }) + readLinkOrShim('/path/to/directory', function (er, path) { + t.ifError(er, "reading dirs isn't an error") + t.is(path, null, 'reading non links/cmdshims gives us null') + }) + readLinkOrShim('/path/to/file', function (er, path) { + t.ifError(er, "reading non-cmdshim files isn't an error") + t.is(path, null, 'reading non links/cmdshims gives us null') + }) + readLinkOrShim('/path/to/link', function (er, path) { + t.ifError(er, "reading links isn't an error") + t.is(path, '../to/file', 'reading links works') + }) + readLinkOrShim('/path/to/cmdshim', function (er, path) { + t.ifError(er, "reading cmdshims isn't an error") + t.is(path, '../to/file', 'reading cmdshims works') + }) + t.done() +}) + +test('resolveSymlink', function (t) { + t.plan(9) + + var mocks = mockWith({ + '/path/to/directory': { type: 'directory' }, + '/path/to/link': { type: 'symlink', dest: '../to/file' }, + '/path/to/file': { type: 'file' }, + '/path/to/cmdshim': { type: 'cmdshim', dest: '../to/file' } + }) + + var gentlyRm = requireInject('../../lib/utils/gently-rm.js', mocks) + var resolveSymlink = gentlyRm._resolveSymlink + + resolveSymlink('/path/to/nowhere', function (er, path) { + t.is(er && er.code, 'ENOENT', 'missing files are errors') + }) + resolveSymlink('/path/to/directory', function (er, path) { + t.ifError(er, "reading dirs isn't an error") + t.is(path, '/path/to/directory', 'reading non links/cmdshims gives us path we passed in') + }) + resolveSymlink('/path/to/file', function (er, path) { + t.ifError(er, "reading non-cmdshim files isn't an error") + t.is(path, '/path/to/file', 'reading non links/cmdshims gives us the path we passed in') + }) + resolveSymlink('/path/to/link', function (er, path) { + t.ifError(er, "reading links isn't an error") + t.is(path, '/path/to/file', 'reading links works') + }) + resolveSymlink('/path/to/cmdshim', function (er, path) { + t.ifError(er, "reading cmdshims isn't an error") + t.is(path, '/path/to/file', 'reading cmdshims works') + }) + t.done() +}) + +test('readAllLinks', function (t) { + t.plan(16) + + var mocks = mockWith({ + '/path/to/directory': { type: 'directory' }, + '/path/to/link': { type: 'symlink', dest: '../to/file' }, + '/path/to/file': { type: 'file' }, + '/path/to/cmdshim': { type: 'cmdshim', dest: '../to/file' }, + '/path/to/linktolink': { type: 'symlink', dest: 'link' }, + '/path/to/linktolink^2': { type: 'symlink', dest: 'linktolink' }, + '/path/to/linktocmdshim': { type: 'symlink', dest: 'cmdshim' }, + '/path/to/linktobad': { type: 'symlink', dest: '/does/not/exist' } + }) + + var gentlyRm = requireInject('../../lib/utils/gently-rm.js', mocks) + var readAllLinks = gentlyRm._readAllLinks + + readAllLinks('/path/to/nowhere', function (er, path) { + t.is(er && er.code, 'ENOENT', 'missing files are errors') + }) + readAllLinks('/path/to/directory', function (er, path) { + t.ifError(er, "reading dirs isn't an error") + t.isDeeply(path, ['/path/to/directory'], 'reading non links/cmdshims gives us path we passed in') + }) + readAllLinks('/path/to/file', function (er, path) { + t.ifError(er, "reading non-cmdshim files isn't an error") + t.isDeeply(path, ['/path/to/file'], 'reading non links/cmdshims gives us the path we passed in') + }) + readAllLinks('/path/to/linktobad', function (er, path) { + t.is(er && er.code, 'ENOENT', 'links to missing files are errors') + }) + readAllLinks('/path/to/link', function (er, path) { + t.ifError(er, "reading links isn't an error") + t.isDeeply(path, ['/path/to/link', '/path/to/file'], 'reading links works') + }) + readAllLinks('/path/to/cmdshim', function (er, path) { + t.ifError(er, "reading cmdshims isn't an error") + t.isDeeply(path, ['/path/to/cmdshim', '/path/to/file'], 'reading cmdshims works') + }) + readAllLinks('/path/to/linktolink', function (er, path) { + t.ifError(er, "reading link to link isn't an error") + t.isDeeply(path, ['/path/to/linktolink', '/path/to/link', '/path/to/file'], 'reading link to link works') + }) + readAllLinks('/path/to/linktolink^2', function (er, path) { + t.ifError(er, "reading link to link to link isn't an error") + t.isDeeply(path, ['/path/to/linktolink^2', '/path/to/linktolink', '/path/to/link', '/path/to/file'], 'reading link to link to link works') + }) + readAllLinks('/path/to/linktocmdshim', function (er, path) { + t.ifError(er, "reading link to cmdshim isn't an error") + t.isDeeply(path, ['/path/to/linktocmdshim', '/path/to/cmdshim', '/path/to/file'], 'reading link to cmdshim works') + }) + t.done() +}) + +test('areAnyInsideAny', function (t) { + var gentlyRm = requireInject('../../lib/utils/gently-rm.js', mockWith({})) + var areAnyInsideAny = gentlyRm._areAnyInsideAny + + var noneOneToOne = areAnyInsideAny(['/abc'], ['/xyz']) + t.is(noneOneToOne, false, 'none inside: one to one') + var noneOneToMany = areAnyInsideAny(['/abc'], ['/rst', '/uvw', '/xyz']) + t.is(noneOneToMany, false, 'none inside: one to many') + var noneManyToOne = areAnyInsideAny(['/abc', '/def', '/ghi'], ['/xyz']) + t.is(noneManyToOne, false, 'none inside: many to one') + var noneManyToMany = areAnyInsideAny(['/abc', '/def', '/ghi'], ['/rst', '/uvw', '/xyz']) + t.is(noneManyToMany, false, 'none inside: many to many') + + var oneToOne = areAnyInsideAny(['/one/toOne'], ['/one']) + t.isDeeply(oneToOne, {target: '/one/toOne', path: '/one'}, 'first: one to one') + + var firstOneToMany = areAnyInsideAny(['/abc/def'], ['/abc', '/def', '/ghi']) + t.isDeeply(firstOneToMany, {target: '/abc/def', path: '/abc'}, 'first: one to many') + var secondOneToMany = areAnyInsideAny(['/def/ghi'], ['/abc', '/def', '/ghi']) + t.isDeeply(secondOneToMany, {target: '/def/ghi', path: '/def'}, 'second: one to many') + var lastOneToMany = areAnyInsideAny(['/ghi/jkl'], ['/abc', '/def', '/ghi']) + t.isDeeply(lastOneToMany, {target: '/ghi/jkl', path: '/ghi'}, 'last: one to many') + + var firstManyToOne = areAnyInsideAny(['/abc/def', '/uvw/def', '/xyz/def'], ['/abc']) + t.isDeeply(firstManyToOne, {target: '/abc/def', path: '/abc'}, 'first: many to one') + var secondManyToOne = areAnyInsideAny(['/abc/def', '/uvw/def', '/xyz/def'], ['/uvw']) + t.isDeeply(secondManyToOne, {target: '/uvw/def', path: '/uvw'}, 'second: many to one') + var lastManyToOne = areAnyInsideAny(['/abc/def', '/uvw/def', '/xyz/def'], ['/xyz']) + t.isDeeply(lastManyToOne, {target: '/xyz/def', path: '/xyz'}, 'last: many to one') + + var firstToFirst = areAnyInsideAny(['/abc/def', '/uvw/def', '/xyz/def'], ['/abc', '/uvw', '/xyz']) + t.isDeeply(firstToFirst, {target: '/abc/def', path: '/abc'}, 'first to first: many to many') + var firstToSecond = areAnyInsideAny(['/abc/def', '/uvw/def', '/xyz/def'], ['/nope', '/abc', '/xyz']) + t.isDeeply(firstToSecond, {target: '/abc/def', path: '/abc'}, 'first to second: many to many') + var firstToLast = areAnyInsideAny(['/abc/def', '/uvw/def', '/xyz/def'], ['/nope', '/nooo', '/abc']) + t.isDeeply(firstToLast, {target: '/abc/def', path: '/abc'}, 'first to last: many to many') + + var secondToFirst = areAnyInsideAny(['/!!!', '/abc/def', '/xyz/def'], ['/abc', '/uvw', '/xyz']) + t.isDeeply(secondToFirst, {target: '/abc/def', path: '/abc'}, 'second to first: many to many') + var secondToSecond = areAnyInsideAny(['/!!!', '/abc/def', '/xyz/def'], ['/nope', '/abc', '/xyz']) + t.isDeeply(secondToSecond, {target: '/abc/def', path: '/abc'}, 'second to second: many to many') + var secondToLast = areAnyInsideAny(['/!!!', '/abc/def', '/uvw/def'], ['/nope', '/nooo', '/abc']) + t.isDeeply(secondToLast, {target: '/abc/def', path: '/abc'}, 'second to last: many to many') + + var lastToFirst = areAnyInsideAny(['/!!!', '/???', '/abc/def'], ['/abc', '/uvw', '/xyz']) + t.isDeeply(lastToFirst, {target: '/abc/def', path: '/abc'}, 'last to first: many to many') + var lastToSecond = areAnyInsideAny(['/!!!', '/???', '/abc/def'], ['/nope', '/abc', '/xyz']) + t.isDeeply(lastToSecond, {target: '/abc/def', path: '/abc'}, 'last to second: many to many') + var lastToLast = areAnyInsideAny(['/!!!', '/???', '/abc/def'], ['/nope', '/nooo', '/abc']) + t.isDeeply(lastToLast, {target: '/abc/def', path: '/abc'}, 'last to last: many to many') + + t.done() +}) + +test('isEverInside', function (t) { + t.plan(15) + + var mocks = mockWith({ + '/path/other/link': { type: 'symlink', dest: '../to/file' }, + '/path/to/file': { type: 'file' }, + '/path/to': { type: 'directory' }, + '/linkpath': { type: 'symlink', dest: '../path/to' }, + '/path/to/invalid': { type: 'error', code: 'EINVAL' } + }) + + var gentlyRm = requireInject('../../lib/utils/gently-rm.js', mocks) + var isEverInside = gentlyRm._isEverInside + + isEverInside('/path/to/file', ['/path/to', '/path/to/invalid'], function (er, inside) { + t.ifError(er) + t.isDeeply(inside, {target: '/path/to/file', path: '/path/to'}, 'bad paths are ignored if something matches') + }) + + isEverInside('/path/to/invalid', ['/path/to/invalid'], function (er, inside) { + t.is(er && er.code, 'EINVAL', 'errors bubble out') + }) + + isEverInside('/path/to/file', ['/ten'], function (er, inside) { + t.ifError(er) + t.is(inside, false, 'not inside') + }) + isEverInside('/path/to/nowhere', ['/ten'], function (er, inside) { + t.ifError(er) + t.is(inside, false, 'missing target') + }) + + isEverInside('/path/to/file', ['/path/to'], function (er, inside) { + t.ifError(er) + t.isDeeply(inside, {target: '/path/to/file', path: '/path/to'}, 'plain file in plain path') + }) + isEverInside('/path/other/link', ['/path/to'], function (er, inside) { + t.ifError(er) + t.isDeeply(inside, {target: '/path/to/file', path: '/path/to'}, 'link in plain path') + }) + + isEverInside('/path/to/file', ['/linkpath'], function (er, inside) { + t.ifError(er) + t.isDeeply(inside, {target: '/path/to/file', path: '/path/to'}, 'plain file in link path') + }) + isEverInside('/path/other/link', ['/linkpath'], function (er, inside) { + t.ifError(er) + t.isDeeply(inside, {target: '/path/to/file', path: '/path/to'}, 'link in link path') + }) + + t.done() +}) + +test('isSafeToRm', function (t) { + var gentlyRm = requireInject('../../lib/utils/gently-rm.js', mockWith({})) + var isSafeToRm = gentlyRm._isSafeToRm + + t.plan(12) + + function testIsSafeToRm (t, parent, target, shouldPath, shouldBase, msg) { + isSafeToRm(parent, target, function (er, path, base) { + t.ifError(er, msg + ' no error') + t.is(path, shouldPath, msg + ' path') + t.is(base, shouldBase, msg + ' base') + }) + } + + function testNotIsSafeToRm (t, parent, target, msg) { + isSafeToRm(parent, target, function (er) { + t.is(er && er.code, 'EEXIST', msg + ' error') + }) + } + + var unmanagedParent = {path: '/foo', managed: false} + var managedParent = {path: '/foo', managed: true} + var targetInParent = { + path: '/foo/bar/baz', + inParent: { + target: '/foo/bar/baz', + path: '/foo' + } + } + var targetLinkInParent = { + path: '/foo/bar/baz', + inParent: { + target: '/other/area/baz', + path: '/other/area' + } + } + var targetManagedLinkNotInParent = { + path: '/foo/bar/baz', + managed: true, + inParent: false, + symlink: '/foo/bar/bark' + } + var targetUnmanagedLink = { + path: '/not/managed/baz', + managed: false, + inParent: false, + symlink: '/not/managed/foo' + } + var targetUnmanagedFile = { + path: '/not/managed/baz', + managed: false, + inParent: false, + symlink: false + } + testNotIsSafeToRm(t, unmanagedParent, targetInParent, 'unmanaged parent') + testIsSafeToRm(t, managedParent, targetInParent, '/foo/bar/baz', '/foo', 'path is in parent') + testIsSafeToRm(t, managedParent, targetLinkInParent, '/foo/bar/baz', '/foo/bar', 'path links to parent') + testIsSafeToRm(t, managedParent, targetManagedLinkNotInParent, undefined, undefined, 'managed but not owned by package') + testNotIsSafeToRm(t, managedParent, targetUnmanagedLink, 'unmanaged link') + testNotIsSafeToRm(t, managedParent, targetUnmanagedFile, 'unmanaged file') +}) diff --git a/deps/npm/test/tap/unit-module-name.js b/deps/npm/test/tap/unit-module-name.js new file mode 100644 index 00000000000000..59d4b44f0b36c7 --- /dev/null +++ b/deps/npm/test/tap/unit-module-name.js @@ -0,0 +1,40 @@ +'use strict' +var test = require('tap').test +var moduleName = require('../../lib/utils/module-name.js') + +test('pathToPackageName', function (t) { + var pathToPackageName = moduleName.test.pathToPackageName + t.is(pathToPackageName('/foo/bar/baz/bark'), 'bark', 'simple module name') + t.is(pathToPackageName('/foo/bar/@baz/bark'), '@baz/bark', 'scoped module name') + t.is(pathToPackageName('/foo'), 'foo', 'module at top') + t.is(pathToPackageName('/@foo'), '@foo', 'invalid module at top') + t.is(pathToPackageName('/'), '', 'root, empty result') + t.is(pathToPackageName(''), '', 'empty, empty') + t.is(pathToPackageName(undefined), '', 'undefined is empty') + t.is(pathToPackageName(null), '', 'null is empty') + t.done() +}) + +test('isNotEmpty', function (t) { + var isNotEmpty = moduleName.test.isNotEmpty + t.is(isNotEmpty('abc'), true, 'string is not empty') + t.is(isNotEmpty(''), false, 'empty string is empty') + t.is(isNotEmpty(null), false, 'null is empty') + t.is(isNotEmpty(undefined), false, 'undefined is empty') + t.is(isNotEmpty(0), true, 'zero is not empty') + t.is(isNotEmpty(true), true, 'true is not empty') + t.is(isNotEmpty([]), true, 'empty array is not empty') + t.is(isNotEmpty({}), true, 'object is not empty') + t.done() +}) + +test('moduleName', function (t) { + t.is(moduleName({package: {name: 'foo'}}), 'foo', 'package named') + t.is(moduleName({name: 'foo'}), 'foo', 'package named, no tree') + t.is(moduleName({path: '/foo/bar'}), 'bar', 'path named') + t.is(moduleName({}), '!invalid#1', 'no named') + t.is(moduleName({path: '/'}), '!invalid#2', 'invalid named') + var obj = {} + t.is(moduleName(obj), moduleName(obj), 'once computed, an invalid module name will not change') + t.done() +}) diff --git a/deps/npm/test/tap/unit-package-id.js b/deps/npm/test/tap/unit-package-id.js new file mode 100644 index 00000000000000..19590d82efee7f --- /dev/null +++ b/deps/npm/test/tap/unit-package-id.js @@ -0,0 +1,17 @@ +'use strict' +var test = require('tap').test +var packageId = require('../../lib/utils/package-id.js') + +test('packageId', function (t) { + t.is(packageId({package: {_id: 'abc@123'}}), 'abc@123', 'basic') + t.is(packageId({_id: 'abc@123'}), 'abc@123', 'basic no tree') + t.is(packageId({package: {name: 'abc', version: '123'}}), 'abc@123', 'computed') + t.is(packageId({package: {_id: '@', name: 'abc', version: '123'}}), 'abc@123', 'computed, ignore invalid id') + t.is(packageId({package: {name: 'abc'}}), 'abc', 'no version') + t.is(packageId({package: {version: '123'}}), '!invalid#1@123', 'version, no name') + t.is(packageId({package: {version: '123'}, path: '/path/to/abc'}), 'abc@123', 'version path-name') + t.is(packageId({package: {version: '123'}, path: '/path/@to/abc'}), '@to/abc@123', 'version scoped-path-name') + t.is(packageId({path: '/path/to/abc'}), 'abc', 'path name, no version') + t.is(packageId({}), '!invalid#2', 'nothing') + t.done() +}) diff --git a/deps/npm/test/tap/update-examples.js b/deps/npm/test/tap/update-examples.js index 633713d9d7a8cf..54844789556a51 100644 --- a/deps/npm/test/tap/update-examples.js +++ b/deps/npm/test/tap/update-examples.js @@ -1,6 +1,5 @@ var common = require('../common-tap.js') var test = require('tap').test -var npm = require('../../lib/npm.js') var mkdirp = require('mkdirp') var rimraf = require('rimraf') var path = require('path') @@ -29,9 +28,19 @@ var DEP_PKG = { } var INSTALLED = { - dependencies: { - 'dep1': '1.1.1' - } + path: '/mock/root', + realpath: '/mock/root', + isLink: false, + package: DEFAULT_PKG, + children: [ + { + path: '/mock/root/node_modules/dep1', + realpath: '/mock/root/node_modules/dep1', + isLink: false, + package: DEP_PKG, + children: [] + } + ] } var DEP1_REGISTRY = { name: 'dep1', @@ -87,16 +96,18 @@ function resetPackage (options) { if (options.wanted) { mockParentJson.dependencies.dep1 = options.wanted + mockInstalled.package.dependencies.dep1 = options.wanted mockDepJson._from = options.wanted } if (options.installed) { - mockInstalled.dependencies.dep1 = options.installed + mockInstalled.package.dependencies.dep1 = options.installed + mockInstalled.children[0].package.version = options.installed mockDepJson.version = options.installed } } -function mockReadInstalled (dir, opts, cb) { +function mockReadPackageTree (dir, cb) { cb(null, mockInstalled) } @@ -109,41 +120,59 @@ function mockCommand (npm, name, fn) { npm.commands[name] = fn } +function mockInstaller (where, dryrun, what) { + installAskedFor = what[0] +} +mockInstaller.prototype = {} +mockInstaller.prototype.run = function (cb) { + cb() +} + +var npm = requireInject.installGlobally('../../lib/npm.js', { + 'read-package-tree': mockReadPackageTree, + 'read-package-json': mockReadJson, + '../../lib/install': { + Installer: mockInstaller + } +}) + test('setup', function (t) { + t.plan(5) process.chdir(osenv.tmpdir()) mkdirp.sync(PKG_DIR) process.chdir(PKG_DIR) + t.pass('made ' + PKG_DIR) resetPackage({}) mr({ port: common.port, mocks: registryMocks }, function (er, server) { + t.pass('mock registry active') npm.load({ cache: CACHE_DIR, registry: common.registry, cwd: PKG_DIR }, function (err) { - t.ifError(err, 'started server') - mockServer = server + t.ifError(err, 'started server') + mockServer = server - mockCommand(npm, 'install', function mockInstall (where, what, cb) { - installAskedFor = what - cb(null) - }) + t.pass('npm.load complete') - mockCommand(npm, 'outdated', requireInject('../../lib/outdated', { - 'read-installed': mockReadInstalled, - 'read-package-json': mockReadJson - })) - - t.end() + mockCommand(npm, 'install', function mockInstall (where, what, cb) { + installAskedFor = what + cb(null) }) + + t.pass('mocks configured') + t.end() + }) }) }) test('update caret dependency to latest', function (t) { resetPackage({ wanted: '^1.1.1' }) + npm.config.set('loglevel', 'silly') npm.commands.update([], function (err) { t.ifError(err) - t.equal('dep1@1.2.2', installAskedFor, 'should want to install dep@1.2.2') + t.equal(installAskedFor, 'dep1@1.2.2', 'should want to install dep@1.2.2') t.end() }) }) @@ -153,7 +182,7 @@ test('update tilde dependency to latest', function (t) { npm.commands.update([], function (err) { t.ifError(err) - t.equal('dep1@1.1.2', installAskedFor, 'should want to install dep@1.1.2') + t.equal(installAskedFor, 'dep1@1.1.2', 'should want to install dep@1.1.2') t.end() }) }) @@ -173,7 +202,7 @@ test('update old caret dependency with no newer', function (t) { npm.commands.update([], function (err) { t.ifError(err) - t.equal('dep1@0.2.0', installAskedFor, 'should want to install dep@0.2.0') + t.equal(installAskedFor, 'dep1@0.2.0', 'should want to install dep@0.2.0') t.end() }) }) @@ -183,7 +212,7 @@ test('update old caret dependency with newer', function (t) { npm.commands.update([], function (err) { t.ifError(err) - t.equal('dep1@0.4.1', installAskedFor, 'should want to install dep@0.4.1') + t.equal(installAskedFor, 'dep1@0.4.1', 'should want to install dep@0.4.1') t.end() }) }) diff --git a/deps/npm/test/tap/update-index.js b/deps/npm/test/tap/update-index.js index fe4244c308b650..91b2f787810bd6 100644 --- a/deps/npm/test/tap/update-index.js +++ b/deps/npm/test/tap/update-index.js @@ -31,98 +31,98 @@ var mocks = { var allMock = { '_updated': 1411727900 + 25, 'generator-frontcow': { - 'name': 'generator-frontcow', - 'description': 'f36b6a6123da50959741e2ce4d634f96ec668c56 This is a fake description to ensure we do not accidentally search the real npm registry or use some kind of cache', - 'dist-tags': { - 'latest': '0.1.19' - }, - 'maintainers': [ - { - 'name': 'bcabanes', - 'email': 'contact@benjamincabanes.com' - } - ], - 'homepage': 'https://github.com/bcabanes/generator-frontcow', - 'keywords': [ - 'sass', - 'frontend', - 'yeoman-generator', - 'atomic', - 'design', - 'sass', - 'foundation', - 'foundation5', - 'atomic design', - 'bourbon', - 'polyfill', - 'font awesome' - ], - 'repository': { - 'type': 'git', - 'url': 'https://github.com/bcabanes/generator-frontcow' - }, - 'author': { - 'name': 'ben', - 'email': 'contact@benjamincabanes.com', - 'url': 'https://github.com/bcabanes' - }, - 'bugs': { - 'url': 'https://github.com/bcabanes/generator-frontcow/issues' - }, - 'license': 'MIT', - 'readmeFilename': 'README.md', - 'time': { - 'modified': '2014-10-03T02:26:18.406Z' - }, - 'versions': { - '0.1.19': 'latest' + 'name': 'generator-frontcow', + 'description': 'f36b6a6123da50959741e2ce4d634f96ec668c56 This is a fake description to ensure we do not accidentally search the real npm registry or use some kind of cache', + 'dist-tags': { + 'latest': '0.1.19' + }, + 'maintainers': [ + { + 'name': 'bcabanes', + 'email': 'contact@benjamincabanes.com' } + ], + 'homepage': 'https://github.com/bcabanes/generator-frontcow', + 'keywords': [ + 'sass', + 'frontend', + 'yeoman-generator', + 'atomic', + 'design', + 'sass', + 'foundation', + 'foundation5', + 'atomic design', + 'bourbon', + 'polyfill', + 'font awesome' + ], + 'repository': { + 'type': 'git', + 'url': 'https://github.com/bcabanes/generator-frontcow' + }, + 'author': { + 'name': 'ben', + 'email': 'contact@benjamincabanes.com', + 'url': 'https://github.com/bcabanes' + }, + 'bugs': { + 'url': 'https://github.com/bcabanes/generator-frontcow/issues' + }, + 'license': 'MIT', + 'readmeFilename': 'README.md', + 'time': { + 'modified': '2014-10-03T02:26:18.406Z' + }, + 'versions': { + '0.1.19': 'latest' + } }, 'marko': { - 'name': 'marko', - 'description': 'Marko is an extensible, streaming, asynchronous, high performance, HTML-based templating language that can be used in Node.js or in the browser.', - 'dist-tags': { - 'latest': '1.2.16' - }, - 'maintainers': [ - { - 'name': 'pnidem', - 'email': 'pnidem@gmail.com' - }, - { - 'name': 'philidem', - 'email': 'phillip.idem@gmail.com' - } - ], - 'homepage': 'https://github.com/raptorjs/marko', - 'keywords': [ - 'templating', - 'template', - 'async', - 'streaming' - ], - 'repository': { - 'type': 'git', - 'url': 'https://github.com/raptorjs/marko.git' - }, - 'author': { - 'name': 'Patrick Steele-Idem', - 'email': 'pnidem@gmail.com' - }, - 'bugs': { - 'url': 'https://github.com/raptorjs/marko/issues' - }, - 'license': 'Apache License v2.0', - 'readmeFilename': 'README.md', - 'users': { - 'pnidem': true - }, - 'time': { - 'modified': '2014-10-03T02:27:31.775Z' + 'name': 'marko', + 'description': 'Marko is an extensible, streaming, asynchronous, high performance, HTML-based templating language that can be used in Node.js or in the browser.', + 'dist-tags': { + 'latest': '1.2.16' + }, + 'maintainers': [ + { + 'name': 'pnidem', + 'email': 'pnidem@gmail.com' }, - 'versions': { - '1.2.16': 'latest' + { + 'name': 'philidem', + 'email': 'phillip.idem@gmail.com' } + ], + 'homepage': 'https://github.com/raptorjs/marko', + 'keywords': [ + 'templating', + 'template', + 'async', + 'streaming' + ], + 'repository': { + 'type': 'git', + 'url': 'https://github.com/raptorjs/marko.git' + }, + 'author': { + 'name': 'Patrick Steele-Idem', + 'email': 'pnidem@gmail.com' + }, + 'bugs': { + 'url': 'https://github.com/raptorjs/marko/issues' + }, + 'license': 'Apache License v2.0', + 'readmeFilename': 'README.md', + 'users': { + 'pnidem': true + }, + 'time': { + 'modified': '2014-10-03T02:27:31.775Z' + }, + 'versions': { + '1.2.16': 'latest' + } } } diff --git a/deps/npm/test/tap/update-path.js b/deps/npm/test/tap/update-path.js new file mode 100644 index 00000000000000..1578669a253fb9 --- /dev/null +++ b/deps/npm/test/tap/update-path.js @@ -0,0 +1,35 @@ +'use strict' +var test = require('tap').test +var requireInject = require('require-inject') + +var mockNpm = { + config: { + get: function (key) { + return false + } + }, + commands: { + outdated: function (args, silent, cb) { + cb(null, [ + [{path: '/incorrect', parent: {path: '/correct'}}, 'abc', '1.0.0', '1.1.0', '1.1.0', '^1.1.0'] + ]) + } + } +} + +// What we're testing here is that updates use the parent module's path to +// install from. +test('update', function (t) { + var update = requireInject('../../lib/update.js', { + '../../lib/npm.js': mockNpm, + '../../lib/install.js': { + 'Installer': function (where, dryrun, args) { + t.is(where, '/correct', 'We should be installing to the parent of the modules being updated') + this.run = function (cb) { cb() } + } + } + }) + update(['abc'], function () { + t.end() + }) +}) diff --git a/deps/npm/test/tap/update-symlink.js b/deps/npm/test/tap/update-symlink.js new file mode 100644 index 00000000000000..1447fde628a945 --- /dev/null +++ b/deps/npm/test/tap/update-symlink.js @@ -0,0 +1,91 @@ +var fs = require('graceful-fs') +var path = require('path') +var osenv = require('osenv') +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, 'update-symlink') +var originalLog + +var fakeRoot = path.join(__dirname, 'fakeRoot') +var OPTS = { + env: { + 'npm_config_prefix': fakeRoot + } +} + +var jsonLocal = { + name: 'my-local-package', + description: 'fixture', + version: '1.0.0', + dependencies: { + 'async': '*', + 'underscore': '*' + } +} + +test('setup', function (t) { + cleanup() + originalLog = console.log + mkdirp.sync(pkg) + common.npm(['install', '-g', 'underscore@1.3.1'], OPTS, function (err, c, out) { + t.ifError(err, 'global install did not error') + process.chdir(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(jsonLocal, null, 2) + ) + common.npm(['link', 'underscore'], OPTS, function (err, c, out) { + t.ifError(err, 'link did not error') + common.npm(['install', 'async@0.2.9'], OPTS, function (err, c, out) { + t.ifError(err, 'local install did not error') + common.npm(['ls'], OPTS, function (err, c, out, stderr) { + t.ifError(err) + t.equal(c, 0) + t.equal(stderr, '', 'got expected stderr') + t.has(out, /async@0.2.9/, 'installed ok') + t.has(out, /underscore@1.3.1/, 'creates local link ok') + t.end() + }) + }) + }) + }) +}) + +test('when update is called linked packages should be excluded', function (t) { + console.log = function () {} + mr({ port: common.port }, function (er, s) { + common.npm(['update'], OPTS, function (err, c, out, stderr) { + t.ifError(err) + t.has(out, /async@1.5.2/, 'updated ok') + t.doesNotHave(stderr, /ERR!/, 'no errors in stderr') + s.close() + t.end() + }) + }) +}) + +test('cleanup', function (t) { + common.npm(['rm', 'underscore', 'async'], OPTS, function (err, code) { + t.ifError(err, 'npm removed the linked package without error') + t.equal(code, 0, 'cleanup in local ok') + process.chdir(osenv.tmpdir()) + common.npm(['rm', '-g', 'underscore'], OPTS, function (err, code) { + t.ifError(err, 'npm removed the global package without error') + t.equal(code, 0, 'cleanup in global ok') + + console.log = originalLog + cleanup() + t.end() + }) + }) +}) + +function cleanup () { + rimraf.sync(pkg) + rimraf.sync(fakeRoot) +} diff --git a/deps/npm/test/tap/verify-no-lifecycle-on-repo.js b/deps/npm/test/tap/verify-no-lifecycle-on-repo.js new file mode 100644 index 00000000000000..29f79e29833bab --- /dev/null +++ b/deps/npm/test/tap/verify-no-lifecycle-on-repo.js @@ -0,0 +1,54 @@ +'use strict' +var path = require('path') +var fs = require('graceful-fs') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test +var common = require('../common-tap.js') + +var base = path.join(__dirname, path.basename(__filename, '.js')) + +var baseJSON = { + name: 'base', + version: '1.0.0', + repository: { + type: 'git', + url: 'http://example.com' + }, + scripts: { + prepublish: 'false' + } +} + +test('setup', function (t) { + cleanup() + setup() + t.end() +}) + +test('repo', function (t) { + common.npm(['repo', '--browser=echo'], {cwd: base}, function (er, code, stdout, stderr) { + t.ifError(er, 'npm config ran without issue') + t.is(code, 0, 'exited with a non-error code') + t.is(stderr, '', 'Ran without errors') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function saveJson (pkgPath, json) { + mkdirp.sync(pkgPath) + fs.writeFileSync(path.join(pkgPath, 'package.json'), JSON.stringify(json, null, 2)) +} + +function setup () { + saveJson(base, baseJSON) +} + +function cleanup () { + rimraf.sync(base) +} diff --git a/deps/npm/test/tap/version-from-git.js b/deps/npm/test/tap/version-from-git.js new file mode 100644 index 00000000000000..6f2c794ce2b9d3 --- /dev/null +++ b/deps/npm/test/tap/version-from-git.js @@ -0,0 +1,224 @@ +var common = require('../common-tap.js') +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var npm = require('../../lib/npm.js') + +var pkg = path.resolve(__dirname, 'version-from-git') +var packagePath = path.resolve(pkg, 'package.json') +var cache = path.resolve(pkg, 'cache') + +var json = { name: 'cat', version: '0.1.2' } + +test('npm version from-git with a valid tag creates a new commit', function (t) { + var version = '1.2.3' + setup() + createTag(t, version, runVersion) + + function runVersion (er) { + t.ifError(er, 'git tag ran without error') + npm.config.set('sign-git-tag', false) + npm.commands.version(['from-git'], checkVersion) + } + + function checkVersion (er) { + var git = require('../../lib/utils/git.js') + t.ifError(er, 'version command ran without error') + git.whichAndExec( + ['log'], + { cwd: pkg, env: process.env }, + checkCommit + ) + } + + function checkCommit (er, log, stderr) { + t.ifError(er, 'git log ran without issue') + t.notOk(stderr, 'no error output') + t.ok(log.indexOf(version) !== -1, 'commit was created') + t.end() + } +}) + +test('npm version from-git with a valid tag updates the package.json version', function (t) { + var version = '1.2.3' + setup() + createTag(t, version, runVersion) + + function runVersion (er) { + t.ifError(er, 'git tag ran without error') + npm.config.set('sign-git-tag', false) + npm.commands.version(['from-git'], checkManifest) + } + + function checkManifest (er) { + t.ifError(er, 'npm run version ran without error') + fs.readFile(path.resolve(pkg, 'package.json'), 'utf8', function (er, data) { + t.ifError(er, 'read manifest without error') + var manifest = JSON.parse(data) + t.equal(manifest.version, version, 'updated the package.json version') + t.done() + }) + } +}) + +test('npm version from-git strips tag-version-prefix', function (t) { + var version = '1.2.3' + var prefix = 'custom-' + var tag = prefix + version + setup() + createTag(t, tag, runVersion) + + function runVersion (er) { + t.ifError(er, 'git tag ran without error') + npm.config.set('sign-git-tag', false) + npm.config.set('tag-version-prefix', prefix) + npm.commands.version(['from-git'], checkVersion) + } + + function checkVersion (er) { + var git = require('../../lib/utils/git.js') + t.ifError(er, 'version command ran without error') + git.whichAndExec( + ['log', '--pretty=medium'], + { cwd: pkg, env: process.env }, + checkCommit + ) + } + + function checkCommit (er, log, stderr) { + t.ifError(er, 'git log ran without issue') + t.notOk(stderr, 'no error output') + t.ok(log.indexOf(tag) === -1, 'commit should not include prefix') + t.ok(log.indexOf(version) !== -1, 'commit should include version') + t.end() + } +}) + +test('npm version from-git only strips tag-version-prefix if it is a prefix', function (t) { + var prefix = 'test' + var version = '1.2.3-' + prefix + setup() + createTag(t, version, runVersion) + + function runVersion (er) { + t.ifError(er, 'git tag ran without error') + npm.config.set('sign-git-tag', false) + npm.config.set('tag-version-prefix', prefix) + npm.commands.version(['from-git'], checkVersion) + } + + function checkVersion (er) { + var git = require('../../lib/utils/git.js') + t.ifError(er, 'version command ran without error') + git.whichAndExec( + ['log'], + { cwd: pkg, env: process.env }, + checkCommit + ) + } + + function checkCommit (er, log, stderr) { + t.ifError(er, 'git log ran without issue') + t.notOk(stderr, 'no error output') + t.ok(log.indexOf(version) !== -1, 'commit should include the full version') + t.end() + } +}) + +test('npm version from-git with an existing version', function (t) { + var tag = 'v' + json.version + setup() + createTag(t, tag, runVersion) + + function runVersion (er) { + t.ifError(er, 'git tag ran without error') + npm.config.set('sign-git-tag', false) + npm.commands.version(['from-git'], checkVersion) + } + + function checkVersion (er) { + t.equal(er.message, 'Version not changed') + t.done() + } +}) + +test('npm version from-git with an invalid version tag', function (t) { + var tag = 'invalidversion' + setup() + createTag(t, tag, runVersion) + + function runVersion (er) { + t.ifError(er, 'git tag ran without error') + npm.config.set('sign-git-tag', false) + npm.commands.version(['from-git'], checkVersion) + } + + function checkVersion (er) { + t.equal(er.message, tag + ' is not a valid version') + t.done() + } +}) + +test('npm version from-git without any versions', function (t) { + setup() + createGitRepo(t, runVersion) + + function runVersion (er) { + t.ifError(er, 'created git repo without errors') + npm.config.set('sign-git-tag', false) + npm.commands.version(['from-git'], checkVersion) + } + + function checkVersion (er) { + t.equal(er.message, 'No tags found') + t.done() + } +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + // windows fix for locked files + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} + +function setup () { + cleanup() + mkdirp.sync(cache) + process.chdir(pkg) + fs.writeFileSync(packagePath, JSON.stringify(json), 'utf8') +} + +function createGitRepo (t, cb) { + npm.load({ cache: cache }, function (er) { + t.ifError(er, 'npm load ran without issue') + common.makeGitRepo({ + path: pkg, + added: ['package.json'] + }, cb) + }) +} + +function createTag (t, tag, cb) { + var opts = { cwd: pkg, env: { PATH: process.env.PATH } } + npm.load({ cache: cache }, function (er) { + t.ifError(er, 'npm load ran without issue') + + // git must be called after npm.load because it uses config + var git = require('../../lib/utils/git.js') + common.makeGitRepo({ + path: pkg, + added: ['package.json'], + commands: [git.chainableExec(['tag', tag, '-am', tag], opts)] + }, cb) + }) +} diff --git a/deps/npm/test/tap/version-no-git.js b/deps/npm/test/tap/version-no-git.js index 0acd0ab6a56a04..0a859c7af2170a 100644 --- a/deps/npm/test/tap/version-no-git.js +++ b/deps/npm/test/tap/version-no-git.js @@ -1,54 +1,54 @@ -var common = require("../common-tap.js") -var test = require("tap").test -var npm = require("../../") -var osenv = require("osenv") -var path = require("path") -var fs = require("fs") -var mkdirp = require("mkdirp") -var rimraf = require("rimraf") -var requireInject = require("require-inject") +var common = require('../common-tap.js') +var test = require('tap').test +var npm = require('../../') +var osenv = require('osenv') +var path = require('path') +var fs = require('fs') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var requireInject = require('require-inject') -var pkg = path.resolve(__dirname, "version-no-git") -var cache = path.resolve(pkg, "cache") -var gitDir = path.resolve(pkg, ".git") +var pkg = path.resolve(__dirname, 'version-no-git') +var cache = path.resolve(pkg, 'cache') +var gitDir = path.resolve(pkg, '.git') -test("npm version in a git repo without the git binary", function(t) { +test('npm version in a git repo without the git binary', function (t) { setup() - npm.load({cache: cache, registry: common.registry}, function() { - var version = requireInject("../../lib/version", { - which: function(cmd, cb) { - process.nextTick(function() { + npm.load({cache: cache, registry: common.registry}, function () { + var version = requireInject('../../lib/version', { + which: function (cmd, cb) { + process.nextTick(function () { cb(new Error('ENOGIT!')) }) } }) - version(["patch"], function(err) { - if (! t.error(err)) return t.end() - var p = path.resolve(pkg, "package") + version(['patch'], function (err) { + if (!t.error(err)) return t.end() + var p = path.resolve(pkg, 'package') var testPkg = require(p) - t.equal("0.0.1", testPkg.version, "\"" + testPkg.version+"\" === \"0.0.1\"") + t.equal('0.0.1', testPkg.version, '\'' + testPkg.version + '\' === \'0.0.1\'') t.end() }) }) }) -test("cleanup", function(t) { +test('cleanup', function (t) { process.chdir(osenv.tmpdir()) rimraf.sync(pkg) t.end() }) -function setup() { +function setup () { mkdirp.sync(pkg) mkdirp.sync(cache) mkdirp.sync(gitDir) - fs.writeFileSync(path.resolve(pkg, "package.json"), JSON.stringify({ - author: "Terin Stock", - name: "version-no-git-test", - version: "0.0.0", + fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({ + author: 'Terin Stock', + name: 'version-no-git-test', + version: '0.0.0', description: "Test for npm version if git binary doesn't exist" - }), "utf8") + }), 'utf8') process.chdir(pkg) } diff --git a/deps/npm/test/tap/version-no-package.js b/deps/npm/test/tap/version-no-package.js index 539f53feb72ca9..e4eeda0eebda0f 100644 --- a/deps/npm/test/tap/version-no-package.js +++ b/deps/npm/test/tap/version-no-package.js @@ -1,45 +1,44 @@ -var common = require("../common-tap.js") -var test = require("tap").test -var osenv = require("osenv") -var path = require("path") -var mkdirp = require("mkdirp") -var rimraf = require("rimraf") +var common = require('../common-tap.js') +var test = require('tap').test +var osenv = require('osenv') +var path = require('path') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') -var pkg = path.resolve(__dirname, "version-no-package") +var pkg = path.resolve(__dirname, 'version-no-package') -test("setup", function (t) { +test('setup', function (t) { setup() t.end() }) -test("npm version in a prefix with no package.json", function(t) { +test('npm version in a prefix with no package.json', function (t) { setup() common.npm( - ["version", "--json", "--prefix", pkg], - { cwd : pkg }, + ['version', '--json', '--prefix', pkg], + { cwd: pkg }, function (er, code, stdout, stderr) { t.ifError(er, "npm version doesn't care that there's no package.json") - t.notOk(code, "npm version ran without barfing") - t.ok(stdout, "got version output") - t.notOk(stderr, "no error output") + t.notOk(code, 'npm version ran without barfing') + t.ok(stdout, 'got version output') + t.notOk(stderr, 'no error output') t.doesNotThrow(function () { var metadata = JSON.parse(stdout) - t.equal(metadata.node, process.versions.node, "node versions match") - - t.end() - }, "able to reconstitute version object from stdout") + t.equal(metadata.node, process.versions.node, 'node versions match') + }, 'able to reconstitute version object from stdout') + t.end() } ) }) -test("cleanup", function(t) { +test('cleanup', function (t) { process.chdir(osenv.tmpdir()) rimraf.sync(pkg) t.end() }) -function setup() { +function setup () { mkdirp.sync(pkg) process.chdir(pkg) } diff --git a/deps/npm/test/tap/version-no-tags.js b/deps/npm/test/tap/version-no-tags.js index cb6f195f8ba599..755e640c0b31ea 100644 --- a/deps/npm/test/tap/version-no-tags.js +++ b/deps/npm/test/tap/version-no-tags.js @@ -1,47 +1,47 @@ -var common = require("../common-tap.js") -var test = require("tap").test -var npm = require("../../") -var osenv = require("osenv") -var path = require("path") -var fs = require("fs") -var rimraf = require("rimraf") -var mkdirp = require("mkdirp") -var which = require("which") -var spawn = require("child_process").spawn +var common = require('../common-tap.js') +var test = require('tap').test +var npm = require('../../') +var osenv = require('osenv') +var path = require('path') +var fs = require('fs') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var which = require('which') +var spawn = require('child_process').spawn -var pkg = path.resolve(__dirname, "version-no-tags") -var cache = path.resolve(pkg, "cache") +var pkg = path.resolve(__dirname, 'version-no-tags') +var cache = path.resolve(pkg, 'cache') -test("npm version without git tag", function (t) { +test('npm version without git tag', function (t) { setup() - npm.load({ cache: cache, registry: common.registry}, function () { - which("git", function (err, git) { - t.ifError(err, "git found on system") - function tagExists(tag, _cb) { - var child1 = spawn(git, ["tag", "-l", tag]) - var out = "" - child1.stdout.on("data", function (d) { + npm.load({ cache: cache, registry: common.registry }, function () { + which('git', function (err, git) { + t.ifError(err, 'git found on system') + function tagExists (tag, _cb) { + var child1 = spawn(git, ['tag', '-l', tag]) + var out = '' + child1.stdout.on('data', function (d) { out += d.toString() }) - child1.on("exit", function () { + child1.on('exit', function () { return _cb(null, Boolean(~out.indexOf(tag))) }) } - var child2 = spawn(git, ["init"]) + var child2 = spawn(git, ['init']) child2.stdout.pipe(process.stdout) - child2.on("exit", function () { - npm.config.set("git-tag-version", false) - npm.commands.version(["patch"], function (err) { - if (err) return t.fail("Error perform version patch") - var p = path.resolve(pkg, "package") + child2.on('exit', function () { + npm.config.set('git-tag-version', false) + npm.commands.version(['patch'], function (err) { + if (err) return t.fail('Error perform version patch') + var p = path.resolve(pkg, 'package') var testPkg = require(p) - if (testPkg.version !== "0.0.1") t.fail(testPkg.version+" !== \"0.0.1\"") - t.equal("0.0.1", testPkg.version) - tagExists("v0.0.1", function (err, exists) { - t.ifError(err, "tag found to exist") - t.equal(exists, false, "git tag DOES exist") - t.pass("git tag does not exist") + if (testPkg.version !== '0.0.1') t.fail(testPkg.version + ' !== \'0.0.1\'') + t.equal('0.0.1', testPkg.version) + tagExists('v0.0.1', function (err, exists) { + t.ifError(err, 'tag found to exist') + t.equal(exists, false, 'git tag DOES exist') + t.pass('git tag does not exist') t.end() }) }) @@ -50,7 +50,7 @@ test("npm version without git tag", function (t) { }) }) -test("cleanup", function (t) { +test('cleanup', function (t) { // windows fix for locked files process.chdir(osenv.tmpdir()) @@ -58,14 +58,14 @@ test("cleanup", function (t) { t.end() }) -function setup() { +function setup () { mkdirp.sync(pkg) mkdirp.sync(cache) - fs.writeFileSync(path.resolve(pkg, "package.json"), JSON.stringify({ - author: "Evan Lucas", - name: "version-no-tags-test", - version: "0.0.0", - description: "Test for git-tag-version flag" - }), "utf8") + fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({ + author: 'Evan Lucas', + name: 'version-no-tags-test', + version: '0.0.0', + description: 'Test for git-tag-version flag' + }), 'utf8') process.chdir(pkg) } diff --git a/deps/npm/test/tap/version-sub-directory.js b/deps/npm/test/tap/version-sub-directory.js new file mode 100644 index 00000000000000..52074a18e7a2b6 --- /dev/null +++ b/deps/npm/test/tap/version-sub-directory.js @@ -0,0 +1,74 @@ +var common = require('../common-tap.js') +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var npm = require('../../lib/npm.js') + +var pkg = path.resolve(__dirname, 'version-sub-directory') +var subDirectory = path.resolve(pkg, 'sub-directory') +var packagePath = path.resolve(pkg, 'package.json') +var cache = path.resolve(pkg, 'cache') + +var json = { name: 'cat', version: '0.1.2' } + +test('npm version from a subdirectory', function (t) { + setup() + npmLoad() + + function npmLoad () { + npm.load({ cache: cache }, function () { + common.makeGitRepo({ + path: pkg, + added: ['package.json'] + }, version) + }) + } + + function version (er, stdout, stderr) { + t.ifError(er, 'git repo initialized without issue') + t.notOk(stderr, 'no error output') + npm.config.set('sign-git-tag', false) + npm.commands.version(['patch'], checkVersion) + } + + function checkVersion (er) { + var git = require('../../lib/utils/git.js') + t.ifError(er, 'version command ran without error') + git.whichAndExec( + ['log'], + { cwd: pkg, env: process.env }, + checkCommit + ) + } + + function checkCommit (er, log, stderr) { + t.ifError(er, 'git log ran without issue') + t.notOk(stderr, 'no error output') + t.ok(log.match(/0\.1\.3/g), 'commited from subdirectory') + t.end() + } +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + // windows fix for locked files + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} + +function setup () { + cleanup() + mkdirp.sync(cache) + mkdirp.sync(subDirectory) + process.chdir(subDirectory) + fs.writeFileSync(packagePath, JSON.stringify(json), 'utf8') +} diff --git a/deps/npm/test/tap/version-update-shrinkwrap.js b/deps/npm/test/tap/version-update-shrinkwrap.js index acf6cca8e5679d..c51ab2cb0d2c99 100644 --- a/deps/npm/test/tap/version-update-shrinkwrap.js +++ b/deps/npm/test/tap/version-update-shrinkwrap.js @@ -48,7 +48,7 @@ test('npm version updates git works with no shrinkwrap', function (t) { var shrinkwrap = require(path.resolve(pkg, 'npm-shrinkwrap.json')) t.equal(shrinkwrap.version, '0.0.1', 'got expected version') - var opts = { cwd: pkg, env: { PATH: process.env.PATH }} + var opts = { cwd: pkg, env: { PATH: process.env.PATH } } var git = require('../../lib/utils/git.js') git.whichAndExec( ['show', 'HEAD', '--name-only'], @@ -91,7 +91,7 @@ test('npm version updates shrinkwrap and updates git', function (t) { t.equal(shrinkwrap.version, '0.0.1', 'got expected version') var git = require('../../lib/utils/git.js') - var opts = { cwd: pkg, env: { PATH: process.env.PATH }} + var opts = { cwd: pkg, env: { PATH: process.env.PATH } } git.whichAndExec( ['show', 'HEAD', '--name-only'], opts, diff --git a/deps/npm/test/tap/view.js b/deps/npm/test/tap/view.js index dcfd2810115d3a..8c5c901ab2381f 100644 --- a/deps/npm/test/tap/view.js +++ b/deps/npm/test/tap/view.js @@ -1,97 +1,97 @@ -var common = require("../common-tap.js") -var test = require("tap").test -var osenv = require("osenv") -var path = require("path") -var fs = require("fs") -var rimraf = require("rimraf") -var mkdirp = require("mkdirp") +var common = require('../common-tap.js') +var test = require('tap').test +var osenv = require('osenv') +var path = require('path') +var fs = require('fs') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') var tmp = osenv.tmpdir() -var t1dir = path.resolve(tmp, "view-local-no-pkg") -var t2dir = path.resolve(tmp, "view-local-notmine") -var t3dir = path.resolve(tmp, "view-local-mine") -var mr = require("npm-registry-mock") +var t1dir = path.resolve(tmp, 'view-local-no-pkg') +var t2dir = path.resolve(tmp, 'view-local-notmine') +var t3dir = path.resolve(tmp, 'view-local-mine') +var mr = require('npm-registry-mock') -test("setup", function (t) { +test('setup', function (t) { mkdirp.sync(t1dir) mkdirp.sync(t2dir) mkdirp.sync(t3dir) - fs.writeFileSync(t2dir + "/package.json", JSON.stringify({ - author: "Evan Lucas" - , name: "test-repo-url-https" - , version: "0.0.1" - }), "utf8") + fs.writeFileSync(t2dir + '/package.json', JSON.stringify({ + author: 'Evan Lucas', + name: 'test-repo-url-https', + version: '0.0.1' + }), 'utf8') - fs.writeFileSync(t3dir + "/package.json", JSON.stringify({ - author: "Evan Lucas" - , name: "biscuits" - , version: "0.0.1" - }), "utf8") + fs.writeFileSync(t3dir + '/package.json', JSON.stringify({ + author: 'Evan Lucas', + name: 'biscuits', + version: '0.0.1' + }), 'utf8') - t.pass("created fixtures") + t.pass('created fixtures') t.end() }) function plugin (server) { server - .get("/biscuits") + .get('/biscuits') .many() - .reply(404, {"error": "version not found"}) + .reply(404, {'error': 'version not found'}) } -test("npm view . in global mode", function (t) { +test('npm view . in global mode', function (t) { process.chdir(t1dir) common.npm([ - "view" - , "." - , "--registry=" + common.registry - , "--global" + 'view', + '.', + '--registry=' + common.registry, + '--global' ], { cwd: t1dir }, function (err, code, stdout, stderr) { - t.ifError(err, "view command finished successfully") - t.equal(code, 1, "exit not ok") + t.ifError(err, 'view command finished successfully') + t.equal(code, 1, 'exit not ok') t.similar(stderr, /Cannot use view command in global mode./m) t.end() }) }) -test("npm view --global", function(t) { +test('npm view --global', function (t) { process.chdir(t1dir) common.npm([ - "view" - , "--registry=" + common.registry - , "--global" - ], { cwd: t1dir }, function(err, code, stdout, stderr) { - t.ifError(err, "view command finished successfully") - t.equal(code, 1, "exit not ok") + 'view', + '--registry=' + common.registry, + '--global' + ], { cwd: t1dir }, function (err, code, stdout, stderr) { + t.ifError(err, 'view command finished successfully') + t.equal(code, 1, 'exit not ok') t.similar(stderr, /Cannot use view command in global mode./m) t.end() }) }) -test("npm view . with no package.json", function(t) { +test('npm view . with no package.json', function (t) { process.chdir(t1dir) common.npm([ - "view" - , "." - , "--registry=" + common.registry + 'view', + '.', + '--registry=' + common.registry ], { cwd: t1dir }, function (err, code, stdout, stderr) { - t.ifError(err, "view command finished successfully") - t.equal(code, 1, "exit not ok") + t.ifError(err, 'view command finished successfully') + t.equal(code, 1, 'exit not ok') t.similar(stderr, /Invalid package.json/m) t.end() }) }) -test("npm view . with no published package", function (t) { +test('npm view . with no published package', function (t) { process.chdir(t3dir) - mr({port : common.port, plugin : plugin}, function (er, s) { + mr({ port: common.port, plugin: plugin }, function (er, s) { common.npm([ - "view" - , "." - , "--registry=" + common.registry + 'view', + '.', + '--registry=' + common.registry ], { cwd: t3dir }, function (err, code, stdout, stderr) { - t.ifError(err, "view command finished successfully") - t.equal(code, 1, "exit not ok") + t.ifError(err, 'view command finished successfully') + t.equal(code, 1, 'exit not ok') t.similar(stderr, /version not found/m) s.close() t.end() @@ -99,16 +99,16 @@ test("npm view . with no published package", function (t) { }) }) -test("npm view .", function (t) { +test('npm view .', function (t) { process.chdir(t2dir) - mr({port : common.port, plugin : plugin}, function (er, s) { + mr({ port: common.port, plugin: plugin }, function (er, s) { common.npm([ - "view" - , "." - , "--registry=" + common.registry + 'view', + '.', + '--registry=' + common.registry ], { cwd: t2dir }, function (err, code, stdout) { - t.ifError(err, "view command finished successfully") - t.equal(code, 0, "exit ok") + t.ifError(err, 'view command finished successfully') + t.equal(code, 0, 'exit ok') var re = new RegExp("name: 'test-repo-url-https'") t.similar(stdout, re) s.close() @@ -117,161 +117,212 @@ test("npm view .", function (t) { }) }) -test("npm view . select fields", function (t) { +test('npm view . select fields', function (t) { + process.chdir(t2dir) + mr({ port: common.port, plugin: plugin }, function (er, s) { + common.npm([ + 'view', + '.', + 'main', + '--registry=' + common.registry + ], { cwd: t2dir }, function (err, code, stdout) { + t.ifError(err, 'view command finished successfully') + t.equal(code, 0, 'exit ok') + t.equal(stdout.trim(), 'index.js', 'should print `index.js`') + s.close() + t.end() + }) + }) +}) + +test('npm view .@', function (t) { process.chdir(t2dir) - mr({port : common.port, plugin : plugin}, function (er, s) { + mr({ port: common.port, plugin: plugin }, function (er, s) { common.npm([ - "view" - , "." - , "main" - , "--registry=" + common.registry + 'view', + '.@0.0.0', + 'version', + '--registry=' + common.registry ], { cwd: t2dir }, function (err, code, stdout) { - t.ifError(err, "view command finished successfully") - t.equal(code, 0, "exit ok") - t.equal(stdout.trim(), "index.js", "should print `index.js`") + t.ifError(err, 'view command finished successfully') + t.equal(code, 0, 'exit ok') + t.equal(stdout.trim(), '0.0.0', 'should print `0.0.0`') s.close() t.end() }) }) }) -test("npm view .@", function (t) { +test('npm view .@ version --json', function (t) { process.chdir(t2dir) - mr({port : common.port, plugin : plugin}, function (er, s) { + mr({ port: common.port, plugin: plugin }, function (er, s) { common.npm([ - "view" - , ".@0.0.0" - , "version" - , "--registry=" + common.registry + 'view', + '.@0.0.0', + 'version', + '--json', + '--registry=' + common.registry ], { cwd: t2dir }, function (err, code, stdout) { - t.ifError(err, "view command finished successfully") - t.equal(code, 0, "exit ok") - t.equal(stdout.trim(), "0.0.0", "should print `0.0.0`") + t.ifError(err, 'view command finished successfully') + t.equal(code, 0, 'exit ok') + t.equal(stdout.trim(), '"0.0.0"', 'should print `"0.0.0"`') s.close() t.end() }) }) }) -test("npm view .@ --json", function (t) { +test('npm view . --json author name version', function (t) { process.chdir(t2dir) - mr({port : common.port, plugin : plugin}, function (er, s) { + mr({ port: common.port, plugin: plugin }, function (er, s) { common.npm([ - "view" - , ".@0.0.0" - , "version" - , "--json" - , "--registry=" + common.registry + 'view', + '.', + 'author', + 'name', + 'version', + '--json', + '--registry=' + common.registry ], { cwd: t2dir }, function (err, code, stdout) { - t.ifError(err, "view command finished successfully") - t.equal(code, 0, "exit ok") - t.equal(stdout.trim(), "\"0.0.0\"", "should print `\"0.0.0\"`") + var expected = JSON.stringify({ + author: 'Evan Lucas ', + name: 'test-repo-url-https', + version: '0.0.1' + }, null, 2) + t.ifError(err, 'view command finished successfully') + t.equal(code, 0, 'exit ok') + t.equal(stdout.trim(), expected, 'should print ' + expected) s.close() t.end() }) }) }) -test("npm view ", function (t) { - mr({port : common.port, plugin : plugin}, function (er, s) { +test('npm view .@ --json author name version', function (t) { + process.chdir(t2dir) + mr({ port: common.port, plugin: plugin }, function (er, s) { common.npm([ - "view" - , "underscore" - , "--registry=" + common.registry + 'view', + '.@0.0.0', + 'author', + 'name', + 'version', + '--json', + '--registry=' + common.registry ], { cwd: t2dir }, function (err, code, stdout) { - t.ifError(err, "view command finished successfully") - t.equal(code, 0, "exit ok") + var expected = JSON.stringify({ + author: 'Evan Lucas ', + name: 'test-repo-url-https', + version: '0.0.0' + }, null, 2) + t.ifError(err, 'view command finished successfully') + t.equal(code, 0, 'exit ok') + t.equal(stdout.trim(), expected, 'should print ' + expected) + s.close() + t.end() + }) + }) +}) + +test('npm view ', function (t) { + mr({ port: common.port, plugin: plugin }, function (er, s) { + common.npm([ + 'view', + 'underscore', + '--registry=' + common.registry + ], { cwd: t2dir }, function (err, code, stdout) { + t.ifError(err, 'view command finished successfully') + t.equal(code, 0, 'exit ok') var re = new RegExp("name: 'underscore'") - t.similar(stdout, re, "should have name `underscore`") + t.similar(stdout, re, 'should have name `underscore`') s.close() t.end() }) }) }) -test("npm view --global", function(t) { - mr({port : common.port, plugin : plugin}, function (er, s) { +test('npm view --global', function (t) { + mr({ port: common.port, plugin: plugin }, function (er, s) { common.npm([ - "view" - , "underscore" - , "--global" - , "--registry=" + common.registry - ], { cwd: t2dir }, function(err, code, stdout) { - t.ifError(err, "view command finished successfully") - t.equal(code, 0, "exit ok") + 'view', + 'underscore', + '--global', + '--registry=' + common.registry + ], { cwd: t2dir }, function (err, code, stdout) { + t.ifError(err, 'view command finished successfully') + t.equal(code, 0, 'exit ok') var re = new RegExp("name: 'underscore'") - t.similar(stdout, re, "should have name `underscore`") + t.similar(stdout, re, 'should have name `underscore`') s.close() t.end() }) }) }) -test("npm view --json", function(t) { +test('npm view --json', function (t) { t.plan(3) - mr({port : common.port, plugin : plugin}, function (er, s) { + mr({ port: common.port, plugin: plugin }, function (er, s) { common.npm([ - "view" - , "underscore" - , "--json" - , "--registry=" + common.registry + 'view', + 'underscore', + '--json', + '--registry=' + common.registry ], { cwd: t2dir }, function (err, code, stdout) { - t.ifError(err, "view command finished successfully") - t.equal(code, 0, "exit ok") + t.ifError(err, 'view command finished successfully') + t.equal(code, 0, 'exit ok') s.close() try { var out = JSON.parse(stdout.trim()) t.similar(out, { - maintainers: "jashkenas " - }, "should have the same maintainer") - } - catch (er) { - t.fail("Unable to parse JSON") + maintainers: ['jashkenas '] + }, 'should have the same maintainer') + } catch (er) { + t.fail('Unable to parse JSON') } }) }) }) -test("npm view ", function (t) { - mr({port : common.port, plugin : plugin}, function (er, s) { +test('npm view ', function (t) { + mr({ port: common.port, plugin: plugin }, function (er, s) { common.npm([ - "view" - , "underscore" - , "homepage" - , "--registry=" + common.registry + 'view', + 'underscore', + 'homepage', + '--registry=' + common.registry ], { cwd: t2dir }, function (err, code, stdout) { - t.ifError(err, "view command finished successfully") - t.equal(code, 0, "exit ok") - t.equal(stdout.trim(), "http://underscorejs.org", - "homepage should equal `http://underscorejs.org`") + t.ifError(err, 'view command finished successfully') + t.equal(code, 0, 'exit ok') + t.equal(stdout.trim(), 'http://underscorejs.org', + 'homepage should equal `http://underscorejs.org`') s.close() t.end() }) }) }) -test("npm view with invalid package name", function (t) { - var invalidName = "InvalidPackage" - obj = {} - obj["/" + invalidName] = [404, {"error": "not found"}] +test('npm view with invalid package name', function (t) { + var invalidName = 'InvalidPackage' + var obj = {} + obj['/' + invalidName] = [404, {'error': 'not found'}] - mr({port : common.port, mocks: {"get": obj}}, function (er, s) { + mr({ port: common.port, mocks: { 'get': obj } }, function (er, s) { common.npm([ - "view" - , invalidName - , "--registry=" + common.registry + 'view', + invalidName, + '--registry=' + common.registry ], {}, function (err, code, stdout, stderr) { - t.ifError(err, "view command finished successfully") - t.equal(code, 1, "exit not ok") + t.ifError(err, 'view command finished successfully') + t.equal(code, 1, 'exit not ok') - t.similar(stderr, new RegExp("is not in the npm registry"), - "Package should NOT be found") + t.similar(stderr, new RegExp('is not in the npm registry'), + 'Package should NOT be found') - t.dissimilar(stderr, new RegExp("use the name yourself!"), - "Suggestion should not be there") + t.dissimilar(stderr, new RegExp('use the name yourself!'), + 'Suggestion should not be there') - t.similar(stderr, new RegExp("name can no longer contain capital letters"), - "Suggestion about Capital letter should be there") + t.similar(stderr, new RegExp('name can no longer contain capital letters'), + 'Suggestion about Capital letter should be there') s.close() t.end() @@ -279,27 +330,26 @@ test("npm view with invalid package name", function (t) { }) }) - -test("npm view with valid but non existent package name", function (t) { - mr({port : common.port, mocks: { - "get": { - "/valid-but-non-existent-package" : [404, {"error": "not found"}] - } +test('npm view with valid but non existent package name', function (t) { + mr({ port: common.port, mocks: { + 'get': { + '/valid-but-non-existent-package': [404, {'error': 'not found'}] + } }}, function (er, s) { common.npm([ - "view" - , "valid-but-non-existent-package" - , "--registry=" + common.registry + 'view', + 'valid-but-non-existent-package', + '--registry=' + common.registry ], {}, function (err, code, stdout, stderr) { - t.ifError(err, "view command finished successfully") - t.equal(code, 1, "exit not ok") + t.ifError(err, 'view command finished successfully') + t.equal(code, 1, 'exit not ok') t.similar(stderr, new RegExp("'valid-but-non-existent-package' is not in the npm registry\."), - "Package should NOT be found") + 'Package should NOT be found') - t.similar(stderr, new RegExp("use the name yourself!"), - "Suggestion should be there") + t.similar(stderr, new RegExp('use the name yourself!'), + 'Suggestion should be there') s.close() t.end() @@ -307,11 +357,11 @@ test("npm view with valid but non existent package name", function (t) { }) }) -test("cleanup", function (t) { +test('cleanup', function (t) { process.chdir(osenv.tmpdir()) rimraf.sync(t1dir) rimraf.sync(t2dir) rimraf.sync(t3dir) - t.pass("cleaned up") + t.pass('cleaned up') t.end() }) diff --git a/deps/npm/test/tap/whoami.js b/deps/npm/test/tap/whoami.js index 558d0db9aefeb1..268e0f94feb095 100644 --- a/deps/npm/test/tap/whoami.js +++ b/deps/npm/test/tap/whoami.js @@ -1,55 +1,55 @@ -var common = require("../common-tap.js") +var common = require('../common-tap.js') -var fs = require("fs") -var path = require("path") -var createServer = require("http").createServer +var fs = require('fs') +var path = require('path') +var createServer = require('http').createServer -var test = require("tap").test -var rimraf = require("rimraf") +var test = require('tap').test +var rimraf = require('rimraf') var opts = { cwd: __dirname } -var FIXTURE_PATH = path.resolve(__dirname, "fixture_npmrc") +var FIXTURE_PATH = path.resolve(__dirname, 'fixture_npmrc') -test("npm whoami with basic auth", function (t) { - var s = "//registry.lvh.me/:username = wombat\n" + - "//registry.lvh.me/:_password = YmFkIHBhc3N3b3Jk\n" + - "//registry.lvh.me/:email = lindsay@wdu.org.au\n" - fs.writeFileSync(FIXTURE_PATH, s, "ascii") - fs.chmodSync(FIXTURE_PATH, "0444") +test('npm whoami with basic auth', function (t) { + var s = '//registry.lvh.me/:username = wombat\n' + + '//registry.lvh.me/:_password = YmFkIHBhc3N3b3Jk\n' + + '//registry.lvh.me/:email = lindsay@wdu.org.au\n' + fs.writeFileSync(FIXTURE_PATH, s, 'ascii') + fs.chmodSync(FIXTURE_PATH, '0444') common.npm( [ - "whoami", - "--userconfig=" + FIXTURE_PATH, - "--registry=http://registry.lvh.me/" + 'whoami', + '--userconfig=' + FIXTURE_PATH, + '--registry=http://registry.lvh.me/' ], opts, function (err, code, stdout, stderr) { t.ifError(err) - t.equal(stderr, "", "got nothing on stderr") - t.equal(code, 0, "exit ok") - t.equal(stdout, "wombat\n", "got username") + t.equal(stderr, '', 'got nothing on stderr') + t.equal(code, 0, 'exit ok') + t.equal(stdout, 'wombat\n', 'got username') rimraf.sync(FIXTURE_PATH) t.end() } ) }) -test("npm whoami with bearer auth", {timeout : 2 * 1000}, function (t) { - var s = "//localhost:" + common.port + - "/:_authToken = wombat-developers-union\n" - fs.writeFileSync(FIXTURE_PATH, s, "ascii") - fs.chmodSync(FIXTURE_PATH, "0444") +test('npm whoami with bearer auth', { timeout: 2 * 1000 }, function (t) { + var s = '//localhost:' + common.port + + '/:_authToken = wombat-developers-union\n' + fs.writeFileSync(FIXTURE_PATH, s, 'ascii') + fs.chmodSync(FIXTURE_PATH, '0444') - function verify(req, res) { - t.equal(req.method, "GET") - t.equal(req.url, "/-/whoami") + function verify (req, res) { + t.equal(req.method, 'GET') + t.equal(req.url, '/-/whoami') - res.setHeader("content-type", "application/json") + res.setHeader('content-type', 'application/json') res.writeHeader(200) - res.end(JSON.stringify({username : "wombat"}), "utf8") + res.end(JSON.stringify({ username: 'wombat' }), 'utf8') } var server = createServer(verify) @@ -57,17 +57,17 @@ test("npm whoami with bearer auth", {timeout : 2 * 1000}, function (t) { server.listen(common.port, function () { common.npm( [ - "whoami", - "--userconfig=" + FIXTURE_PATH, - "--registry=http://localhost:" + common.port + "/" + 'whoami', + '--userconfig=' + FIXTURE_PATH, + '--registry=http://localhost:' + common.port + '/' ], opts, function (err, code, stdout, stderr) { t.ifError(err) - t.equal(stderr, "", "got nothing on stderr") - t.equal(code, 0, "exit ok") - t.equal(stdout, "wombat\n", "got username") + t.equal(stderr, '', 'got nothing on stderr') + t.equal(code, 0, 'exit ok') + t.equal(stdout, 'wombat\n', 'got username') rimraf.sync(FIXTURE_PATH) server.close() t.end() diff --git a/deps/npm/test/tap/zz-cleanup.js b/deps/npm/test/tap/zz-cleanup.js index c491cbf0711f1c..e1020aa3b11b51 100644 --- a/deps/npm/test/tap/zz-cleanup.js +++ b/deps/npm/test/tap/zz-cleanup.js @@ -1,8 +1,8 @@ -var common = require("../common-tap") -var test = require("tap").test -var rimraf = require("rimraf") +var common = require('../common-tap') +var test = require('tap').test +var rimraf = require('rimraf') -test("cleanup", function (t) { +test('cleanup', function (t) { rimraf.sync(common.npm_config_cache) t.end() }) diff --git a/deps/npm/test/update-test.sh b/deps/npm/test/update-test.sh deleted file mode 100755 index f72c90dd98efc4..00000000000000 --- a/deps/npm/test/update-test.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash - -SELF_PATH="$0" -if [ "${SELF_PATH:0:1}" != "." ] && [ "${SELF_PATH:0:1}" != "/" ]; then - SELF_PATH=./"$SELF_PATH" -fi -SELF_PATH=$( cd -P -- "$(dirname -- "$SELF_PATH")" \ - && pwd -P \ - ) && SELF_PATH=$SELF_PATH/$(basename -- "$0") - -# resolve symlinks -while [ -h "$SELF_PATH" ]; do - DIR=$(dirname -- "$SELF_PATH") - SYM=$(readlink -- "$SELF_PATH") - SELF_PATH=$( cd -- "$DIR" \ - && cd -- $(dirname -- "$SYM") \ - && pwd \ - )/$(basename -- "$SYM") -done -DIR=$( dirname -- "$SELF_PATH" ) - -export npm_config_root=$DIR/root -export npm_config_binroot=$DIR/bin - -rm -rf $DIR/{root,bin} -mkdir -p $DIR/root -mkdir -p $DIR/bin -npm ls installed 2>/dev/null | grep -v npm | awk '{print $1}' | xargs npm rm &>/dev/null -npm install \ - base64@1.0.0 \ - eyes@0.1.1 \ - vows@0.2.5 \ - websocket-server@1.0.5 &>/dev/null -npm install ./test/packages/blerg &>/dev/null -npm install vows@0.3.0 &>/dev/null - -echo "" -echo "##" -echo "## starting update" -echo "##" -echo "" - -npm update - -echo "" -echo "##" -echo "## update done, all should be 'latest'" -echo "##" -echo "" - -list=$( npm ls installed remote 2>/dev/null ) -echo "$list" -notlatest=$( echo "$list" | grep -v latest ) -if [ "$notlatest" != "" ]; then - echo "Failed: not latest" - echo $notlatest -else - echo "ok" -fi diff --git a/deps/npm/wercker.yml b/deps/npm/wercker.yml deleted file mode 100644 index f944a9552174a2..00000000000000 --- a/deps/npm/wercker.yml +++ /dev/null @@ -1,22 +0,0 @@ -box: wercker/nodejs -# Build definition -build: - # The steps that will be executed on build - steps: - # A step that executes `npm install` command - - npm-install - # A step that executes `npm test` command - - npm-test - - # A custom script step, name value is used in the UI - # and the code value contains the command that get executed - - script: - name: echo nodejs information - code: | - echo "node version $(node -v) running" - echo "npm version $(npm -v) running" - after-steps: - - sherzberg/slack-notify: - subdomain: npm-inc - token: $SLACK_TOKEN - channel: github-commits diff --git a/deps/openssl/asm/arm-void-gas/bn/armv4-gf2m.S b/deps/openssl/asm/arm-void-gas/bn/armv4-gf2m.S index 32610558ac5853..ad71aa0b667d94 100644 --- a/deps/openssl/asm/arm-void-gas/bn/armv4-gf2m.S +++ b/deps/openssl/asm/arm-void-gas/bn/armv4-gf2m.S @@ -98,7 +98,7 @@ bn_GF2m_mul_2x2: mov r12,#7<<2 sub sp,sp,#32 @ allocate tab[8] - bl mul_1x1_ialu @ a1�b1 + bl mul_1x1_ialu @ a1·b1 str r5,[r10,#8] str r4,[r10,#12] @@ -108,13 +108,13 @@ bn_GF2m_mul_2x2: eor r2,r2,r1 eor r0,r0,r3 eor r1,r1,r2 - bl mul_1x1_ialu @ a0�b0 + bl mul_1x1_ialu @ a0·b0 str r5,[r10] str r4,[r10,#4] eor r1,r1,r2 eor r0,r0,r3 - bl mul_1x1_ialu @ (a1+a0)�(b1+b0) + bl mul_1x1_ialu @ (a1+a0)·(b1+b0) ldmia r10,{r6-r9} eor r5,r5,r4 eor r4,r4,r7 diff --git a/deps/openssl/asm/arm-void-gas/modes/ghash-armv4.S b/deps/openssl/asm/arm-void-gas/modes/ghash-armv4.S index c54f5149974c6f..6f699dbd870818 100644 --- a/deps/openssl/asm/arm-void-gas/modes/ghash-armv4.S +++ b/deps/openssl/asm/arm-void-gas/modes/ghash-armv4.S @@ -3,6 +3,11 @@ .text .code 32 +#ifdef __clang__ +#define ldrplb ldrbpl +#define ldrneb ldrbne +#endif + .type rem_4bit,%object .align 5 rem_4bit: diff --git a/deps/openssl/asm/arm-void-gas/modes/ghashv8-armx.S b/deps/openssl/asm/arm-void-gas/modes/ghashv8-armx.S index 269574945fa6a2..9aaea13f9197db 100644 --- a/deps/openssl/asm/arm-void-gas/modes/ghashv8-armx.S +++ b/deps/openssl/asm/arm-void-gas/modes/ghashv8-armx.S @@ -66,10 +66,10 @@ gcm_gmult_v8: #endif vext.8 q3,q9,q9,#8 - .byte 0x86,0x0e,0xa8,0xf2 @ pmull q0,q12,q3 @ H.lo�Xi.lo + .byte 0x86,0x0e,0xa8,0xf2 @ pmull q0,q12,q3 @ H.lo·Xi.lo veor q9,q9,q3 @ Karatsuba pre-processing - .byte 0x87,0x4e,0xa9,0xf2 @ pmull2 q2,q12,q3 @ H.hi�Xi.hi - .byte 0xa2,0x2e,0xaa,0xf2 @ pmull q1,q13,q9 @ (H.lo+H.hi)�(Xi.lo+Xi.hi) + .byte 0x87,0x4e,0xa9,0xf2 @ pmull2 q2,q12,q3 @ H.hi·Xi.hi + .byte 0xa2,0x2e,0xaa,0xf2 @ pmull q1,q13,q9 @ (H.lo+H.hi)·(Xi.lo+Xi.hi) vext.8 q9,q0,q2,#8 @ Karatsuba post-processing veor q10,q0,q2 @@ -134,7 +134,7 @@ gcm_ghash_v8: #endif vext.8 q7,q9,q9,#8 veor q3,q3,q0 @ I[i]^=Xi - .byte 0x8e,0x8e,0xa8,0xf2 @ pmull q4,q12,q7 @ H�Ii+1 + .byte 0x8e,0x8e,0xa8,0xf2 @ pmull q4,q12,q7 @ H·Ii+1 veor q9,q9,q7 @ Karatsuba pre-processing .byte 0x8f,0xce,0xa9,0xf2 @ pmull2 q6,q12,q7 b .Loop_mod2x_v8 @@ -143,14 +143,14 @@ gcm_ghash_v8: .Loop_mod2x_v8: vext.8 q10,q3,q3,#8 subs r3,r3,#32 @ is there more data? - .byte 0x86,0x0e,0xac,0xf2 @ pmull q0,q14,q3 @ H^2.lo�Xi.lo + .byte 0x86,0x0e,0xac,0xf2 @ pmull q0,q14,q3 @ H^2.lo·Xi.lo movlo r12,#0 @ is it time to zero r12? .byte 0xa2,0xae,0xaa,0xf2 @ pmull q5,q13,q9 veor q10,q10,q3 @ Karatsuba pre-processing - .byte 0x87,0x4e,0xad,0xf2 @ pmull2 q2,q14,q3 @ H^2.hi�Xi.hi + .byte 0x87,0x4e,0xad,0xf2 @ pmull2 q2,q14,q3 @ H^2.hi·Xi.hi veor q0,q0,q4 @ accumulate - .byte 0xa5,0x2e,0xab,0xf2 @ pmull2 q1,q13,q10 @ (H^2.lo+H^2.hi)�(Xi.lo+Xi.hi) + .byte 0xa5,0x2e,0xab,0xf2 @ pmull2 q1,q13,q10 @ (H^2.lo+H^2.hi)·(Xi.lo+Xi.hi) vld1.64 {q8},[r2],r12 @ load [rotated] I[i+2] veor q2,q2,q6 @@ -175,7 +175,7 @@ gcm_ghash_v8: vext.8 q7,q9,q9,#8 vext.8 q3,q8,q8,#8 veor q0,q1,q10 - .byte 0x8e,0x8e,0xa8,0xf2 @ pmull q4,q12,q7 @ H�Ii+1 + .byte 0x8e,0x8e,0xa8,0xf2 @ pmull q4,q12,q7 @ H·Ii+1 veor q3,q3,q2 @ accumulate q3 early vext.8 q10,q0,q0,#8 @ 2nd phase of reduction @@ -196,10 +196,10 @@ gcm_ghash_v8: veor q3,q3,q0 @ inp^=Xi veor q9,q8,q10 @ q9 is rotated inp^Xi - .byte 0x86,0x0e,0xa8,0xf2 @ pmull q0,q12,q3 @ H.lo�Xi.lo + .byte 0x86,0x0e,0xa8,0xf2 @ pmull q0,q12,q3 @ H.lo·Xi.lo veor q9,q9,q3 @ Karatsuba pre-processing - .byte 0x87,0x4e,0xa9,0xf2 @ pmull2 q2,q12,q3 @ H.hi�Xi.hi - .byte 0xa2,0x2e,0xaa,0xf2 @ pmull q1,q13,q9 @ (H.lo+H.hi)�(Xi.lo+Xi.hi) + .byte 0x87,0x4e,0xa9,0xf2 @ pmull2 q2,q12,q3 @ H.hi·Xi.hi + .byte 0xa2,0x2e,0xaa,0xf2 @ pmull q1,q13,q9 @ (H.lo+H.hi)·(Xi.lo+Xi.hi) vext.8 q9,q0,q2,#8 @ Karatsuba post-processing veor q10,q0,q2 diff --git a/deps/openssl/asm/arm64-linux64-gas/modes/ghashv8-armx.S b/deps/openssl/asm/arm64-linux64-gas/modes/ghashv8-armx.S index 479007dc54dfab..fc3dadd08a17a9 100644 --- a/deps/openssl/asm/arm64-linux64-gas/modes/ghashv8-armx.S +++ b/deps/openssl/asm/arm64-linux64-gas/modes/ghashv8-armx.S @@ -65,10 +65,10 @@ gcm_gmult_v8: #endif ext v3.16b,v17.16b,v17.16b,#8 - pmull v0.1q,v20.1d,v3.1d //H.lo�Xi.lo + pmull v0.1q,v20.1d,v3.1d //H.lo·Xi.lo eor v17.16b,v17.16b,v3.16b //Karatsuba pre-processing - pmull2 v2.1q,v20.2d,v3.2d //H.hi�Xi.hi - pmull v1.1q,v21.1d,v17.1d //(H.lo+H.hi)�(Xi.lo+Xi.hi) + pmull2 v2.1q,v20.2d,v3.2d //H.hi·Xi.hi + pmull v1.1q,v21.1d,v17.1d //(H.lo+H.hi)·(Xi.lo+Xi.hi) ext v17.16b,v0.16b,v2.16b,#8 //Karatsuba post-processing eor v18.16b,v0.16b,v2.16b @@ -132,7 +132,7 @@ gcm_ghash_v8: #endif ext v7.16b,v17.16b,v17.16b,#8 eor v3.16b,v3.16b,v0.16b //I[i]^=Xi - pmull v4.1q,v20.1d,v7.1d //H�Ii+1 + pmull v4.1q,v20.1d,v7.1d //H·Ii+1 eor v17.16b,v17.16b,v7.16b //Karatsuba pre-processing pmull2 v6.1q,v20.2d,v7.2d b .Loop_mod2x_v8 @@ -141,14 +141,14 @@ gcm_ghash_v8: .Loop_mod2x_v8: ext v18.16b,v3.16b,v3.16b,#8 subs x3,x3,#32 //is there more data? - pmull v0.1q,v22.1d,v3.1d //H^2.lo�Xi.lo + pmull v0.1q,v22.1d,v3.1d //H^2.lo·Xi.lo csel x12,xzr,x12,lo //is it time to zero x12? pmull v5.1q,v21.1d,v17.1d eor v18.16b,v18.16b,v3.16b //Karatsuba pre-processing - pmull2 v2.1q,v22.2d,v3.2d //H^2.hi�Xi.hi + pmull2 v2.1q,v22.2d,v3.2d //H^2.hi·Xi.hi eor v0.16b,v0.16b,v4.16b //accumulate - pmull2 v1.1q,v21.2d,v18.2d //(H^2.lo+H^2.hi)�(Xi.lo+Xi.hi) + pmull2 v1.1q,v21.2d,v18.2d //(H^2.lo+H^2.hi)·(Xi.lo+Xi.hi) ld1 {v16.2d},[x2],x12 //load [rotated] I[i+2] eor v2.16b,v2.16b,v6.16b @@ -173,7 +173,7 @@ gcm_ghash_v8: ext v7.16b,v17.16b,v17.16b,#8 ext v3.16b,v16.16b,v16.16b,#8 eor v0.16b,v1.16b,v18.16b - pmull v4.1q,v20.1d,v7.1d //H�Ii+1 + pmull v4.1q,v20.1d,v7.1d //H·Ii+1 eor v3.16b,v3.16b,v2.16b //accumulate v3.16b early ext v18.16b,v0.16b,v0.16b,#8 //2nd phase of reduction @@ -194,10 +194,10 @@ gcm_ghash_v8: eor v3.16b,v3.16b,v0.16b //inp^=Xi eor v17.16b,v16.16b,v18.16b //v17.16b is rotated inp^Xi - pmull v0.1q,v20.1d,v3.1d //H.lo�Xi.lo + pmull v0.1q,v20.1d,v3.1d //H.lo·Xi.lo eor v17.16b,v17.16b,v3.16b //Karatsuba pre-processing - pmull2 v2.1q,v20.2d,v3.2d //H.hi�Xi.hi - pmull v1.1q,v21.1d,v17.1d //(H.lo+H.hi)�(Xi.lo+Xi.hi) + pmull2 v2.1q,v20.2d,v3.2d //H.hi·Xi.hi + pmull v1.1q,v21.1d,v17.1d //(H.lo+H.hi)·(Xi.lo+Xi.hi) ext v17.16b,v0.16b,v2.16b,#8 //Karatsuba post-processing eor v18.16b,v0.16b,v2.16b diff --git a/deps/openssl/asm/x64-elf-gas/aes/aesni-mb-x86_64.s b/deps/openssl/asm/x64-elf-gas/aes/aesni-mb-x86_64.s index 543b58831656cb..b0467f2f9f2995 100644 --- a/deps/openssl/asm/x64-elf-gas/aes/aesni-mb-x86_64.s +++ b/deps/openssl/asm/x64-elf-gas/aes/aesni-mb-x86_64.s @@ -6,14 +6,6 @@ .type aesni_multi_cbc_encrypt,@function .align 32 aesni_multi_cbc_encrypt: - cmpl $2,%edx - jb .Lenc_non_avx - movl OPENSSL_ia32cap_P+4(%rip),%ecx - testl $268435456,%ecx - jnz _avx_cbc_enc_shortcut - jmp .Lenc_non_avx -.align 16 -.Lenc_non_avx: movq %rsp,%rax pushq %rbx pushq %rbp @@ -270,14 +262,6 @@ aesni_multi_cbc_encrypt: .type aesni_multi_cbc_decrypt,@function .align 32 aesni_multi_cbc_decrypt: - cmpl $2,%edx - jb .Ldec_non_avx - movl OPENSSL_ia32cap_P+4(%rip),%ecx - testl $268435456,%ecx - jnz _avx_cbc_dec_shortcut - jmp .Ldec_non_avx -.align 16 -.Ldec_non_avx: movq %rsp,%rax pushq %rbx pushq %rbp @@ -520,916 +504,3 @@ aesni_multi_cbc_decrypt: .Ldec4x_epilogue: .byte 0xf3,0xc3 .size aesni_multi_cbc_decrypt,.-aesni_multi_cbc_decrypt -.type aesni_multi_cbc_encrypt_avx,@function -.align 32 -aesni_multi_cbc_encrypt_avx: -_avx_cbc_enc_shortcut: - movq %rsp,%rax - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - - - - - - - - - subq $192,%rsp - andq $-128,%rsp - movq %rax,16(%rsp) - -.Lenc8x_body: - vzeroupper - vmovdqu (%rsi),%xmm15 - leaq 120(%rsi),%rsi - leaq 160(%rdi),%rdi - shrl $1,%edx - -.Lenc8x_loop_grande: - - xorl %edx,%edx - movl -144(%rdi),%ecx - movq -160(%rdi),%r8 - cmpl %edx,%ecx - movq -152(%rdi),%rbx - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu -136(%rdi),%xmm2 - movl %ecx,32(%rsp) - cmovleq %rsp,%r8 - subq %r8,%rbx - movq %rbx,64(%rsp) - movl -104(%rdi),%ecx - movq -120(%rdi),%r9 - cmpl %edx,%ecx - movq -112(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu -96(%rdi),%xmm3 - movl %ecx,36(%rsp) - cmovleq %rsp,%r9 - subq %r9,%rbp - movq %rbp,72(%rsp) - movl -64(%rdi),%ecx - movq -80(%rdi),%r10 - cmpl %edx,%ecx - movq -72(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu -56(%rdi),%xmm4 - movl %ecx,40(%rsp) - cmovleq %rsp,%r10 - subq %r10,%rbp - movq %rbp,80(%rsp) - movl -24(%rdi),%ecx - movq -40(%rdi),%r11 - cmpl %edx,%ecx - movq -32(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu -16(%rdi),%xmm5 - movl %ecx,44(%rsp) - cmovleq %rsp,%r11 - subq %r11,%rbp - movq %rbp,88(%rsp) - movl 16(%rdi),%ecx - movq 0(%rdi),%r12 - cmpl %edx,%ecx - movq 8(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu 24(%rdi),%xmm6 - movl %ecx,48(%rsp) - cmovleq %rsp,%r12 - subq %r12,%rbp - movq %rbp,96(%rsp) - movl 56(%rdi),%ecx - movq 40(%rdi),%r13 - cmpl %edx,%ecx - movq 48(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu 64(%rdi),%xmm7 - movl %ecx,52(%rsp) - cmovleq %rsp,%r13 - subq %r13,%rbp - movq %rbp,104(%rsp) - movl 96(%rdi),%ecx - movq 80(%rdi),%r14 - cmpl %edx,%ecx - movq 88(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu 104(%rdi),%xmm8 - movl %ecx,56(%rsp) - cmovleq %rsp,%r14 - subq %r14,%rbp - movq %rbp,112(%rsp) - movl 136(%rdi),%ecx - movq 120(%rdi),%r15 - cmpl %edx,%ecx - movq 128(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu 144(%rdi),%xmm9 - movl %ecx,60(%rsp) - cmovleq %rsp,%r15 - subq %r15,%rbp - movq %rbp,120(%rsp) - testl %edx,%edx - jz .Lenc8x_done - - vmovups 16-120(%rsi),%xmm1 - vmovups 32-120(%rsi),%xmm0 - movl 240-120(%rsi),%eax - - vpxor (%r8),%xmm15,%xmm10 - leaq 128(%rsp),%rbp - vpxor (%r9),%xmm15,%xmm11 - vpxor (%r10),%xmm15,%xmm12 - vpxor (%r11),%xmm15,%xmm13 - vpxor %xmm10,%xmm2,%xmm2 - vpxor (%r12),%xmm15,%xmm10 - vpxor %xmm11,%xmm3,%xmm3 - vpxor (%r13),%xmm15,%xmm11 - vpxor %xmm12,%xmm4,%xmm4 - vpxor (%r14),%xmm15,%xmm12 - vpxor %xmm13,%xmm5,%xmm5 - vpxor (%r15),%xmm15,%xmm13 - vpxor %xmm10,%xmm6,%xmm6 - movl $1,%ecx - vpxor %xmm11,%xmm7,%xmm7 - vpxor %xmm12,%xmm8,%xmm8 - vpxor %xmm13,%xmm9,%xmm9 - jmp .Loop_enc8x - -.align 32 -.Loop_enc8x: - vaesenc %xmm1,%xmm2,%xmm2 - cmpl 32+0(%rsp),%ecx - vaesenc %xmm1,%xmm3,%xmm3 - prefetcht0 31(%r8) - vaesenc %xmm1,%xmm4,%xmm4 - vaesenc %xmm1,%xmm5,%xmm5 - leaq (%r8,%rbx,1),%rbx - cmovgeq %rsp,%r8 - vaesenc %xmm1,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesenc %xmm1,%xmm7,%xmm7 - subq %r8,%rbx - vaesenc %xmm1,%xmm8,%xmm8 - vpxor 16(%r8),%xmm15,%xmm10 - movq %rbx,64+0(%rsp) - vaesenc %xmm1,%xmm9,%xmm9 - vmovups -72(%rsi),%xmm1 - leaq 16(%r8,%rbx,1),%r8 - vmovdqu %xmm10,0(%rbp) - vaesenc %xmm0,%xmm2,%xmm2 - cmpl 32+4(%rsp),%ecx - movq 64+8(%rsp),%rbx - vaesenc %xmm0,%xmm3,%xmm3 - prefetcht0 31(%r9) - vaesenc %xmm0,%xmm4,%xmm4 - vaesenc %xmm0,%xmm5,%xmm5 - leaq (%r9,%rbx,1),%rbx - cmovgeq %rsp,%r9 - vaesenc %xmm0,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesenc %xmm0,%xmm7,%xmm7 - subq %r9,%rbx - vaesenc %xmm0,%xmm8,%xmm8 - vpxor 16(%r9),%xmm15,%xmm11 - movq %rbx,64+8(%rsp) - vaesenc %xmm0,%xmm9,%xmm9 - vmovups -56(%rsi),%xmm0 - leaq 16(%r9,%rbx,1),%r9 - vmovdqu %xmm11,16(%rbp) - vaesenc %xmm1,%xmm2,%xmm2 - cmpl 32+8(%rsp),%ecx - movq 64+16(%rsp),%rbx - vaesenc %xmm1,%xmm3,%xmm3 - prefetcht0 31(%r10) - vaesenc %xmm1,%xmm4,%xmm4 - prefetcht0 15(%r8) - vaesenc %xmm1,%xmm5,%xmm5 - leaq (%r10,%rbx,1),%rbx - cmovgeq %rsp,%r10 - vaesenc %xmm1,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesenc %xmm1,%xmm7,%xmm7 - subq %r10,%rbx - vaesenc %xmm1,%xmm8,%xmm8 - vpxor 16(%r10),%xmm15,%xmm12 - movq %rbx,64+16(%rsp) - vaesenc %xmm1,%xmm9,%xmm9 - vmovups -40(%rsi),%xmm1 - leaq 16(%r10,%rbx,1),%r10 - vmovdqu %xmm12,32(%rbp) - vaesenc %xmm0,%xmm2,%xmm2 - cmpl 32+12(%rsp),%ecx - movq 64+24(%rsp),%rbx - vaesenc %xmm0,%xmm3,%xmm3 - prefetcht0 31(%r11) - vaesenc %xmm0,%xmm4,%xmm4 - prefetcht0 15(%r9) - vaesenc %xmm0,%xmm5,%xmm5 - leaq (%r11,%rbx,1),%rbx - cmovgeq %rsp,%r11 - vaesenc %xmm0,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesenc %xmm0,%xmm7,%xmm7 - subq %r11,%rbx - vaesenc %xmm0,%xmm8,%xmm8 - vpxor 16(%r11),%xmm15,%xmm13 - movq %rbx,64+24(%rsp) - vaesenc %xmm0,%xmm9,%xmm9 - vmovups -24(%rsi),%xmm0 - leaq 16(%r11,%rbx,1),%r11 - vmovdqu %xmm13,48(%rbp) - vaesenc %xmm1,%xmm2,%xmm2 - cmpl 32+16(%rsp),%ecx - movq 64+32(%rsp),%rbx - vaesenc %xmm1,%xmm3,%xmm3 - prefetcht0 31(%r12) - vaesenc %xmm1,%xmm4,%xmm4 - prefetcht0 15(%r10) - vaesenc %xmm1,%xmm5,%xmm5 - leaq (%r12,%rbx,1),%rbx - cmovgeq %rsp,%r12 - vaesenc %xmm1,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesenc %xmm1,%xmm7,%xmm7 - subq %r12,%rbx - vaesenc %xmm1,%xmm8,%xmm8 - vpxor 16(%r12),%xmm15,%xmm10 - movq %rbx,64+32(%rsp) - vaesenc %xmm1,%xmm9,%xmm9 - vmovups -8(%rsi),%xmm1 - leaq 16(%r12,%rbx,1),%r12 - vaesenc %xmm0,%xmm2,%xmm2 - cmpl 32+20(%rsp),%ecx - movq 64+40(%rsp),%rbx - vaesenc %xmm0,%xmm3,%xmm3 - prefetcht0 31(%r13) - vaesenc %xmm0,%xmm4,%xmm4 - prefetcht0 15(%r11) - vaesenc %xmm0,%xmm5,%xmm5 - leaq (%rbx,%r13,1),%rbx - cmovgeq %rsp,%r13 - vaesenc %xmm0,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesenc %xmm0,%xmm7,%xmm7 - subq %r13,%rbx - vaesenc %xmm0,%xmm8,%xmm8 - vpxor 16(%r13),%xmm15,%xmm11 - movq %rbx,64+40(%rsp) - vaesenc %xmm0,%xmm9,%xmm9 - vmovups 8(%rsi),%xmm0 - leaq 16(%r13,%rbx,1),%r13 - vaesenc %xmm1,%xmm2,%xmm2 - cmpl 32+24(%rsp),%ecx - movq 64+48(%rsp),%rbx - vaesenc %xmm1,%xmm3,%xmm3 - prefetcht0 31(%r14) - vaesenc %xmm1,%xmm4,%xmm4 - prefetcht0 15(%r12) - vaesenc %xmm1,%xmm5,%xmm5 - leaq (%r14,%rbx,1),%rbx - cmovgeq %rsp,%r14 - vaesenc %xmm1,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesenc %xmm1,%xmm7,%xmm7 - subq %r14,%rbx - vaesenc %xmm1,%xmm8,%xmm8 - vpxor 16(%r14),%xmm15,%xmm12 - movq %rbx,64+48(%rsp) - vaesenc %xmm1,%xmm9,%xmm9 - vmovups 24(%rsi),%xmm1 - leaq 16(%r14,%rbx,1),%r14 - vaesenc %xmm0,%xmm2,%xmm2 - cmpl 32+28(%rsp),%ecx - movq 64+56(%rsp),%rbx - vaesenc %xmm0,%xmm3,%xmm3 - prefetcht0 31(%r15) - vaesenc %xmm0,%xmm4,%xmm4 - prefetcht0 15(%r13) - vaesenc %xmm0,%xmm5,%xmm5 - leaq (%r15,%rbx,1),%rbx - cmovgeq %rsp,%r15 - vaesenc %xmm0,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesenc %xmm0,%xmm7,%xmm7 - subq %r15,%rbx - vaesenc %xmm0,%xmm8,%xmm8 - vpxor 16(%r15),%xmm15,%xmm13 - movq %rbx,64+56(%rsp) - vaesenc %xmm0,%xmm9,%xmm9 - vmovups 40(%rsi),%xmm0 - leaq 16(%r15,%rbx,1),%r15 - vmovdqu 32(%rsp),%xmm14 - prefetcht0 15(%r14) - prefetcht0 15(%r15) - cmpl $11,%eax - jb .Lenc8x_tail - - vaesenc %xmm1,%xmm2,%xmm2 - vaesenc %xmm1,%xmm3,%xmm3 - vaesenc %xmm1,%xmm4,%xmm4 - vaesenc %xmm1,%xmm5,%xmm5 - vaesenc %xmm1,%xmm6,%xmm6 - vaesenc %xmm1,%xmm7,%xmm7 - vaesenc %xmm1,%xmm8,%xmm8 - vaesenc %xmm1,%xmm9,%xmm9 - vmovups 176-120(%rsi),%xmm1 - - vaesenc %xmm0,%xmm2,%xmm2 - vaesenc %xmm0,%xmm3,%xmm3 - vaesenc %xmm0,%xmm4,%xmm4 - vaesenc %xmm0,%xmm5,%xmm5 - vaesenc %xmm0,%xmm6,%xmm6 - vaesenc %xmm0,%xmm7,%xmm7 - vaesenc %xmm0,%xmm8,%xmm8 - vaesenc %xmm0,%xmm9,%xmm9 - vmovups 192-120(%rsi),%xmm0 - je .Lenc8x_tail - - vaesenc %xmm1,%xmm2,%xmm2 - vaesenc %xmm1,%xmm3,%xmm3 - vaesenc %xmm1,%xmm4,%xmm4 - vaesenc %xmm1,%xmm5,%xmm5 - vaesenc %xmm1,%xmm6,%xmm6 - vaesenc %xmm1,%xmm7,%xmm7 - vaesenc %xmm1,%xmm8,%xmm8 - vaesenc %xmm1,%xmm9,%xmm9 - vmovups 208-120(%rsi),%xmm1 - - vaesenc %xmm0,%xmm2,%xmm2 - vaesenc %xmm0,%xmm3,%xmm3 - vaesenc %xmm0,%xmm4,%xmm4 - vaesenc %xmm0,%xmm5,%xmm5 - vaesenc %xmm0,%xmm6,%xmm6 - vaesenc %xmm0,%xmm7,%xmm7 - vaesenc %xmm0,%xmm8,%xmm8 - vaesenc %xmm0,%xmm9,%xmm9 - vmovups 224-120(%rsi),%xmm0 - -.Lenc8x_tail: - vaesenc %xmm1,%xmm2,%xmm2 - vpxor %xmm15,%xmm15,%xmm15 - vaesenc %xmm1,%xmm3,%xmm3 - vaesenc %xmm1,%xmm4,%xmm4 - vpcmpgtd %xmm15,%xmm14,%xmm15 - vaesenc %xmm1,%xmm5,%xmm5 - vaesenc %xmm1,%xmm6,%xmm6 - vpaddd %xmm14,%xmm15,%xmm15 - vmovdqu 48(%rsp),%xmm14 - vaesenc %xmm1,%xmm7,%xmm7 - movq 64(%rsp),%rbx - vaesenc %xmm1,%xmm8,%xmm8 - vaesenc %xmm1,%xmm9,%xmm9 - vmovups 16-120(%rsi),%xmm1 - - vaesenclast %xmm0,%xmm2,%xmm2 - vmovdqa %xmm15,32(%rsp) - vpxor %xmm15,%xmm15,%xmm15 - vaesenclast %xmm0,%xmm3,%xmm3 - vaesenclast %xmm0,%xmm4,%xmm4 - vpcmpgtd %xmm15,%xmm14,%xmm15 - vaesenclast %xmm0,%xmm5,%xmm5 - vaesenclast %xmm0,%xmm6,%xmm6 - vpaddd %xmm15,%xmm14,%xmm14 - vmovdqu -120(%rsi),%xmm15 - vaesenclast %xmm0,%xmm7,%xmm7 - vaesenclast %xmm0,%xmm8,%xmm8 - vmovdqa %xmm14,48(%rsp) - vaesenclast %xmm0,%xmm9,%xmm9 - vmovups 32-120(%rsi),%xmm0 - - vmovups %xmm2,-16(%r8) - subq %rbx,%r8 - vpxor 0(%rbp),%xmm2,%xmm2 - vmovups %xmm3,-16(%r9) - subq 72(%rsp),%r9 - vpxor 16(%rbp),%xmm3,%xmm3 - vmovups %xmm4,-16(%r10) - subq 80(%rsp),%r10 - vpxor 32(%rbp),%xmm4,%xmm4 - vmovups %xmm5,-16(%r11) - subq 88(%rsp),%r11 - vpxor 48(%rbp),%xmm5,%xmm5 - vmovups %xmm6,-16(%r12) - subq 96(%rsp),%r12 - vpxor %xmm10,%xmm6,%xmm6 - vmovups %xmm7,-16(%r13) - subq 104(%rsp),%r13 - vpxor %xmm11,%xmm7,%xmm7 - vmovups %xmm8,-16(%r14) - subq 112(%rsp),%r14 - vpxor %xmm12,%xmm8,%xmm8 - vmovups %xmm9,-16(%r15) - subq 120(%rsp),%r15 - vpxor %xmm13,%xmm9,%xmm9 - - decl %edx - jnz .Loop_enc8x - - movq 16(%rsp),%rax - - - - - -.Lenc8x_done: - vzeroupper - movq -48(%rax),%r15 - movq -40(%rax),%r14 - movq -32(%rax),%r13 - movq -24(%rax),%r12 - movq -16(%rax),%rbp - movq -8(%rax),%rbx - leaq (%rax),%rsp -.Lenc8x_epilogue: - .byte 0xf3,0xc3 -.size aesni_multi_cbc_encrypt_avx,.-aesni_multi_cbc_encrypt_avx - -.type aesni_multi_cbc_decrypt_avx,@function -.align 32 -aesni_multi_cbc_decrypt_avx: -_avx_cbc_dec_shortcut: - movq %rsp,%rax - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - - - - - - - - - - subq $256,%rsp - andq $-256,%rsp - subq $192,%rsp - movq %rax,16(%rsp) - -.Ldec8x_body: - vzeroupper - vmovdqu (%rsi),%xmm15 - leaq 120(%rsi),%rsi - leaq 160(%rdi),%rdi - shrl $1,%edx - -.Ldec8x_loop_grande: - - xorl %edx,%edx - movl -144(%rdi),%ecx - movq -160(%rdi),%r8 - cmpl %edx,%ecx - movq -152(%rdi),%rbx - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu -136(%rdi),%xmm2 - movl %ecx,32(%rsp) - cmovleq %rsp,%r8 - subq %r8,%rbx - movq %rbx,64(%rsp) - vmovdqu %xmm2,192(%rsp) - movl -104(%rdi),%ecx - movq -120(%rdi),%r9 - cmpl %edx,%ecx - movq -112(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu -96(%rdi),%xmm3 - movl %ecx,36(%rsp) - cmovleq %rsp,%r9 - subq %r9,%rbp - movq %rbp,72(%rsp) - vmovdqu %xmm3,208(%rsp) - movl -64(%rdi),%ecx - movq -80(%rdi),%r10 - cmpl %edx,%ecx - movq -72(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu -56(%rdi),%xmm4 - movl %ecx,40(%rsp) - cmovleq %rsp,%r10 - subq %r10,%rbp - movq %rbp,80(%rsp) - vmovdqu %xmm4,224(%rsp) - movl -24(%rdi),%ecx - movq -40(%rdi),%r11 - cmpl %edx,%ecx - movq -32(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu -16(%rdi),%xmm5 - movl %ecx,44(%rsp) - cmovleq %rsp,%r11 - subq %r11,%rbp - movq %rbp,88(%rsp) - vmovdqu %xmm5,240(%rsp) - movl 16(%rdi),%ecx - movq 0(%rdi),%r12 - cmpl %edx,%ecx - movq 8(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu 24(%rdi),%xmm6 - movl %ecx,48(%rsp) - cmovleq %rsp,%r12 - subq %r12,%rbp - movq %rbp,96(%rsp) - vmovdqu %xmm6,256(%rsp) - movl 56(%rdi),%ecx - movq 40(%rdi),%r13 - cmpl %edx,%ecx - movq 48(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu 64(%rdi),%xmm7 - movl %ecx,52(%rsp) - cmovleq %rsp,%r13 - subq %r13,%rbp - movq %rbp,104(%rsp) - vmovdqu %xmm7,272(%rsp) - movl 96(%rdi),%ecx - movq 80(%rdi),%r14 - cmpl %edx,%ecx - movq 88(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu 104(%rdi),%xmm8 - movl %ecx,56(%rsp) - cmovleq %rsp,%r14 - subq %r14,%rbp - movq %rbp,112(%rsp) - vmovdqu %xmm8,288(%rsp) - movl 136(%rdi),%ecx - movq 120(%rdi),%r15 - cmpl %edx,%ecx - movq 128(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu 144(%rdi),%xmm9 - movl %ecx,60(%rsp) - cmovleq %rsp,%r15 - subq %r15,%rbp - movq %rbp,120(%rsp) - vmovdqu %xmm9,304(%rsp) - testl %edx,%edx - jz .Ldec8x_done - - vmovups 16-120(%rsi),%xmm1 - vmovups 32-120(%rsi),%xmm0 - movl 240-120(%rsi),%eax - leaq 192+128(%rsp),%rbp - - vmovdqu (%r8),%xmm2 - vmovdqu (%r9),%xmm3 - vmovdqu (%r10),%xmm4 - vmovdqu (%r11),%xmm5 - vmovdqu (%r12),%xmm6 - vmovdqu (%r13),%xmm7 - vmovdqu (%r14),%xmm8 - vmovdqu (%r15),%xmm9 - vmovdqu %xmm2,0(%rbp) - vpxor %xmm15,%xmm2,%xmm2 - vmovdqu %xmm3,16(%rbp) - vpxor %xmm15,%xmm3,%xmm3 - vmovdqu %xmm4,32(%rbp) - vpxor %xmm15,%xmm4,%xmm4 - vmovdqu %xmm5,48(%rbp) - vpxor %xmm15,%xmm5,%xmm5 - vmovdqu %xmm6,64(%rbp) - vpxor %xmm15,%xmm6,%xmm6 - vmovdqu %xmm7,80(%rbp) - vpxor %xmm15,%xmm7,%xmm7 - vmovdqu %xmm8,96(%rbp) - vpxor %xmm15,%xmm8,%xmm8 - vmovdqu %xmm9,112(%rbp) - vpxor %xmm15,%xmm9,%xmm9 - xorq $128,%rbp - movl $1,%ecx - jmp .Loop_dec8x - -.align 32 -.Loop_dec8x: - vaesdec %xmm1,%xmm2,%xmm2 - cmpl 32+0(%rsp),%ecx - vaesdec %xmm1,%xmm3,%xmm3 - prefetcht0 31(%r8) - vaesdec %xmm1,%xmm4,%xmm4 - vaesdec %xmm1,%xmm5,%xmm5 - leaq (%r8,%rbx,1),%rbx - cmovgeq %rsp,%r8 - vaesdec %xmm1,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesdec %xmm1,%xmm7,%xmm7 - subq %r8,%rbx - vaesdec %xmm1,%xmm8,%xmm8 - vmovdqu 16(%r8),%xmm10 - movq %rbx,64+0(%rsp) - vaesdec %xmm1,%xmm9,%xmm9 - vmovups -72(%rsi),%xmm1 - leaq 16(%r8,%rbx,1),%r8 - vmovdqu %xmm10,128(%rsp) - vaesdec %xmm0,%xmm2,%xmm2 - cmpl 32+4(%rsp),%ecx - movq 64+8(%rsp),%rbx - vaesdec %xmm0,%xmm3,%xmm3 - prefetcht0 31(%r9) - vaesdec %xmm0,%xmm4,%xmm4 - vaesdec %xmm0,%xmm5,%xmm5 - leaq (%r9,%rbx,1),%rbx - cmovgeq %rsp,%r9 - vaesdec %xmm0,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesdec %xmm0,%xmm7,%xmm7 - subq %r9,%rbx - vaesdec %xmm0,%xmm8,%xmm8 - vmovdqu 16(%r9),%xmm11 - movq %rbx,64+8(%rsp) - vaesdec %xmm0,%xmm9,%xmm9 - vmovups -56(%rsi),%xmm0 - leaq 16(%r9,%rbx,1),%r9 - vmovdqu %xmm11,144(%rsp) - vaesdec %xmm1,%xmm2,%xmm2 - cmpl 32+8(%rsp),%ecx - movq 64+16(%rsp),%rbx - vaesdec %xmm1,%xmm3,%xmm3 - prefetcht0 31(%r10) - vaesdec %xmm1,%xmm4,%xmm4 - prefetcht0 15(%r8) - vaesdec %xmm1,%xmm5,%xmm5 - leaq (%r10,%rbx,1),%rbx - cmovgeq %rsp,%r10 - vaesdec %xmm1,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesdec %xmm1,%xmm7,%xmm7 - subq %r10,%rbx - vaesdec %xmm1,%xmm8,%xmm8 - vmovdqu 16(%r10),%xmm12 - movq %rbx,64+16(%rsp) - vaesdec %xmm1,%xmm9,%xmm9 - vmovups -40(%rsi),%xmm1 - leaq 16(%r10,%rbx,1),%r10 - vmovdqu %xmm12,160(%rsp) - vaesdec %xmm0,%xmm2,%xmm2 - cmpl 32+12(%rsp),%ecx - movq 64+24(%rsp),%rbx - vaesdec %xmm0,%xmm3,%xmm3 - prefetcht0 31(%r11) - vaesdec %xmm0,%xmm4,%xmm4 - prefetcht0 15(%r9) - vaesdec %xmm0,%xmm5,%xmm5 - leaq (%r11,%rbx,1),%rbx - cmovgeq %rsp,%r11 - vaesdec %xmm0,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesdec %xmm0,%xmm7,%xmm7 - subq %r11,%rbx - vaesdec %xmm0,%xmm8,%xmm8 - vmovdqu 16(%r11),%xmm13 - movq %rbx,64+24(%rsp) - vaesdec %xmm0,%xmm9,%xmm9 - vmovups -24(%rsi),%xmm0 - leaq 16(%r11,%rbx,1),%r11 - vmovdqu %xmm13,176(%rsp) - vaesdec %xmm1,%xmm2,%xmm2 - cmpl 32+16(%rsp),%ecx - movq 64+32(%rsp),%rbx - vaesdec %xmm1,%xmm3,%xmm3 - prefetcht0 31(%r12) - vaesdec %xmm1,%xmm4,%xmm4 - prefetcht0 15(%r10) - vaesdec %xmm1,%xmm5,%xmm5 - leaq (%r12,%rbx,1),%rbx - cmovgeq %rsp,%r12 - vaesdec %xmm1,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesdec %xmm1,%xmm7,%xmm7 - subq %r12,%rbx - vaesdec %xmm1,%xmm8,%xmm8 - vmovdqu 16(%r12),%xmm10 - movq %rbx,64+32(%rsp) - vaesdec %xmm1,%xmm9,%xmm9 - vmovups -8(%rsi),%xmm1 - leaq 16(%r12,%rbx,1),%r12 - vaesdec %xmm0,%xmm2,%xmm2 - cmpl 32+20(%rsp),%ecx - movq 64+40(%rsp),%rbx - vaesdec %xmm0,%xmm3,%xmm3 - prefetcht0 31(%r13) - vaesdec %xmm0,%xmm4,%xmm4 - prefetcht0 15(%r11) - vaesdec %xmm0,%xmm5,%xmm5 - leaq (%rbx,%r13,1),%rbx - cmovgeq %rsp,%r13 - vaesdec %xmm0,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesdec %xmm0,%xmm7,%xmm7 - subq %r13,%rbx - vaesdec %xmm0,%xmm8,%xmm8 - vmovdqu 16(%r13),%xmm11 - movq %rbx,64+40(%rsp) - vaesdec %xmm0,%xmm9,%xmm9 - vmovups 8(%rsi),%xmm0 - leaq 16(%r13,%rbx,1),%r13 - vaesdec %xmm1,%xmm2,%xmm2 - cmpl 32+24(%rsp),%ecx - movq 64+48(%rsp),%rbx - vaesdec %xmm1,%xmm3,%xmm3 - prefetcht0 31(%r14) - vaesdec %xmm1,%xmm4,%xmm4 - prefetcht0 15(%r12) - vaesdec %xmm1,%xmm5,%xmm5 - leaq (%r14,%rbx,1),%rbx - cmovgeq %rsp,%r14 - vaesdec %xmm1,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesdec %xmm1,%xmm7,%xmm7 - subq %r14,%rbx - vaesdec %xmm1,%xmm8,%xmm8 - vmovdqu 16(%r14),%xmm12 - movq %rbx,64+48(%rsp) - vaesdec %xmm1,%xmm9,%xmm9 - vmovups 24(%rsi),%xmm1 - leaq 16(%r14,%rbx,1),%r14 - vaesdec %xmm0,%xmm2,%xmm2 - cmpl 32+28(%rsp),%ecx - movq 64+56(%rsp),%rbx - vaesdec %xmm0,%xmm3,%xmm3 - prefetcht0 31(%r15) - vaesdec %xmm0,%xmm4,%xmm4 - prefetcht0 15(%r13) - vaesdec %xmm0,%xmm5,%xmm5 - leaq (%r15,%rbx,1),%rbx - cmovgeq %rsp,%r15 - vaesdec %xmm0,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesdec %xmm0,%xmm7,%xmm7 - subq %r15,%rbx - vaesdec %xmm0,%xmm8,%xmm8 - vmovdqu 16(%r15),%xmm13 - movq %rbx,64+56(%rsp) - vaesdec %xmm0,%xmm9,%xmm9 - vmovups 40(%rsi),%xmm0 - leaq 16(%r15,%rbx,1),%r15 - vmovdqu 32(%rsp),%xmm14 - prefetcht0 15(%r14) - prefetcht0 15(%r15) - cmpl $11,%eax - jb .Ldec8x_tail - - vaesdec %xmm1,%xmm2,%xmm2 - vaesdec %xmm1,%xmm3,%xmm3 - vaesdec %xmm1,%xmm4,%xmm4 - vaesdec %xmm1,%xmm5,%xmm5 - vaesdec %xmm1,%xmm6,%xmm6 - vaesdec %xmm1,%xmm7,%xmm7 - vaesdec %xmm1,%xmm8,%xmm8 - vaesdec %xmm1,%xmm9,%xmm9 - vmovups 176-120(%rsi),%xmm1 - - vaesdec %xmm0,%xmm2,%xmm2 - vaesdec %xmm0,%xmm3,%xmm3 - vaesdec %xmm0,%xmm4,%xmm4 - vaesdec %xmm0,%xmm5,%xmm5 - vaesdec %xmm0,%xmm6,%xmm6 - vaesdec %xmm0,%xmm7,%xmm7 - vaesdec %xmm0,%xmm8,%xmm8 - vaesdec %xmm0,%xmm9,%xmm9 - vmovups 192-120(%rsi),%xmm0 - je .Ldec8x_tail - - vaesdec %xmm1,%xmm2,%xmm2 - vaesdec %xmm1,%xmm3,%xmm3 - vaesdec %xmm1,%xmm4,%xmm4 - vaesdec %xmm1,%xmm5,%xmm5 - vaesdec %xmm1,%xmm6,%xmm6 - vaesdec %xmm1,%xmm7,%xmm7 - vaesdec %xmm1,%xmm8,%xmm8 - vaesdec %xmm1,%xmm9,%xmm9 - vmovups 208-120(%rsi),%xmm1 - - vaesdec %xmm0,%xmm2,%xmm2 - vaesdec %xmm0,%xmm3,%xmm3 - vaesdec %xmm0,%xmm4,%xmm4 - vaesdec %xmm0,%xmm5,%xmm5 - vaesdec %xmm0,%xmm6,%xmm6 - vaesdec %xmm0,%xmm7,%xmm7 - vaesdec %xmm0,%xmm8,%xmm8 - vaesdec %xmm0,%xmm9,%xmm9 - vmovups 224-120(%rsi),%xmm0 - -.Ldec8x_tail: - vaesdec %xmm1,%xmm2,%xmm2 - vpxor %xmm15,%xmm15,%xmm15 - vaesdec %xmm1,%xmm3,%xmm3 - vaesdec %xmm1,%xmm4,%xmm4 - vpcmpgtd %xmm15,%xmm14,%xmm15 - vaesdec %xmm1,%xmm5,%xmm5 - vaesdec %xmm1,%xmm6,%xmm6 - vpaddd %xmm14,%xmm15,%xmm15 - vmovdqu 48(%rsp),%xmm14 - vaesdec %xmm1,%xmm7,%xmm7 - movq 64(%rsp),%rbx - vaesdec %xmm1,%xmm8,%xmm8 - vaesdec %xmm1,%xmm9,%xmm9 - vmovups 16-120(%rsi),%xmm1 - - vaesdeclast %xmm0,%xmm2,%xmm2 - vmovdqa %xmm15,32(%rsp) - vpxor %xmm15,%xmm15,%xmm15 - vaesdeclast %xmm0,%xmm3,%xmm3 - vpxor 0(%rbp),%xmm2,%xmm2 - vaesdeclast %xmm0,%xmm4,%xmm4 - vpxor 16(%rbp),%xmm3,%xmm3 - vpcmpgtd %xmm15,%xmm14,%xmm15 - vaesdeclast %xmm0,%xmm5,%xmm5 - vpxor 32(%rbp),%xmm4,%xmm4 - vaesdeclast %xmm0,%xmm6,%xmm6 - vpxor 48(%rbp),%xmm5,%xmm5 - vpaddd %xmm15,%xmm14,%xmm14 - vmovdqu -120(%rsi),%xmm15 - vaesdeclast %xmm0,%xmm7,%xmm7 - vpxor 64(%rbp),%xmm6,%xmm6 - vaesdeclast %xmm0,%xmm8,%xmm8 - vpxor 80(%rbp),%xmm7,%xmm7 - vmovdqa %xmm14,48(%rsp) - vaesdeclast %xmm0,%xmm9,%xmm9 - vpxor 96(%rbp),%xmm8,%xmm8 - vmovups 32-120(%rsi),%xmm0 - - vmovups %xmm2,-16(%r8) - subq %rbx,%r8 - vmovdqu 128+0(%rsp),%xmm2 - vpxor 112(%rbp),%xmm9,%xmm9 - vmovups %xmm3,-16(%r9) - subq 72(%rsp),%r9 - vmovdqu %xmm2,0(%rbp) - vpxor %xmm15,%xmm2,%xmm2 - vmovdqu 128+16(%rsp),%xmm3 - vmovups %xmm4,-16(%r10) - subq 80(%rsp),%r10 - vmovdqu %xmm3,16(%rbp) - vpxor %xmm15,%xmm3,%xmm3 - vmovdqu 128+32(%rsp),%xmm4 - vmovups %xmm5,-16(%r11) - subq 88(%rsp),%r11 - vmovdqu %xmm4,32(%rbp) - vpxor %xmm15,%xmm4,%xmm4 - vmovdqu 128+48(%rsp),%xmm5 - vmovups %xmm6,-16(%r12) - subq 96(%rsp),%r12 - vmovdqu %xmm5,48(%rbp) - vpxor %xmm15,%xmm5,%xmm5 - vmovdqu %xmm10,64(%rbp) - vpxor %xmm10,%xmm15,%xmm6 - vmovups %xmm7,-16(%r13) - subq 104(%rsp),%r13 - vmovdqu %xmm11,80(%rbp) - vpxor %xmm11,%xmm15,%xmm7 - vmovups %xmm8,-16(%r14) - subq 112(%rsp),%r14 - vmovdqu %xmm12,96(%rbp) - vpxor %xmm12,%xmm15,%xmm8 - vmovups %xmm9,-16(%r15) - subq 120(%rsp),%r15 - vmovdqu %xmm13,112(%rbp) - vpxor %xmm13,%xmm15,%xmm9 - - xorq $128,%rbp - decl %edx - jnz .Loop_dec8x - - movq 16(%rsp),%rax - - - - - -.Ldec8x_done: - vzeroupper - movq -48(%rax),%r15 - movq -40(%rax),%r14 - movq -32(%rax),%r13 - movq -24(%rax),%r12 - movq -16(%rax),%rbp - movq -8(%rax),%rbx - leaq (%rax),%rsp -.Ldec8x_epilogue: - .byte 0xf3,0xc3 -.size aesni_multi_cbc_decrypt_avx,.-aesni_multi_cbc_decrypt_avx diff --git a/deps/openssl/asm/x64-elf-gas/aes/aesni-sha1-x86_64.s b/deps/openssl/asm/x64-elf-gas/aes/aesni-sha1-x86_64.s index 88042248685372..edbd5cb343c327 100644 --- a/deps/openssl/asm/x64-elf-gas/aes/aesni-sha1-x86_64.s +++ b/deps/openssl/asm/x64-elf-gas/aes/aesni-sha1-x86_64.s @@ -10,11 +10,6 @@ aesni_cbc_sha1_enc: movq OPENSSL_ia32cap_P+4(%rip),%r11 btq $61,%r11 jc aesni_cbc_sha1_enc_shaext - andl $268435456,%r11d - andl $1073741824,%r10d - orl %r11d,%r10d - cmpl $1342177280,%r10d - je aesni_cbc_sha1_enc_avx jmp aesni_cbc_sha1_enc_ssse3 .byte 0xf3,0xc3 .size aesni_cbc_sha1_enc,.-aesni_cbc_sha1_enc @@ -1372,1304 +1367,6 @@ aesni_cbc_sha1_enc_ssse3: .Lepilogue_ssse3: .byte 0xf3,0xc3 .size aesni_cbc_sha1_enc_ssse3,.-aesni_cbc_sha1_enc_ssse3 -.type aesni_cbc_sha1_enc_avx,@function -.align 32 -aesni_cbc_sha1_enc_avx: - movq 8(%rsp),%r10 - - - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - leaq -104(%rsp),%rsp - - - vzeroall - movq %rdi,%r12 - movq %rsi,%r13 - movq %rdx,%r14 - leaq 112(%rcx),%r15 - vmovdqu (%r8),%xmm12 - movq %r8,88(%rsp) - shlq $6,%r14 - subq %r12,%r13 - movl 240-112(%r15),%r8d - addq %r10,%r14 - - leaq K_XX_XX(%rip),%r11 - movl 0(%r9),%eax - movl 4(%r9),%ebx - movl 8(%r9),%ecx - movl 12(%r9),%edx - movl %ebx,%esi - movl 16(%r9),%ebp - movl %ecx,%edi - xorl %edx,%edi - andl %edi,%esi - - vmovdqa 64(%r11),%xmm6 - vmovdqa 0(%r11),%xmm10 - vmovdqu 0(%r10),%xmm0 - vmovdqu 16(%r10),%xmm1 - vmovdqu 32(%r10),%xmm2 - vmovdqu 48(%r10),%xmm3 - vpshufb %xmm6,%xmm0,%xmm0 - addq $64,%r10 - vpshufb %xmm6,%xmm1,%xmm1 - vpshufb %xmm6,%xmm2,%xmm2 - vpshufb %xmm6,%xmm3,%xmm3 - vpaddd %xmm10,%xmm0,%xmm4 - vpaddd %xmm10,%xmm1,%xmm5 - vpaddd %xmm10,%xmm2,%xmm6 - vmovdqa %xmm4,0(%rsp) - vmovdqa %xmm5,16(%rsp) - vmovdqa %xmm6,32(%rsp) - vmovups -112(%r15),%xmm15 - vmovups 16-112(%r15),%xmm14 - jmp .Loop_avx -.align 32 -.Loop_avx: - shrdl $2,%ebx,%ebx - vmovdqu 0(%r12),%xmm13 - vpxor %xmm15,%xmm13,%xmm13 - vpxor %xmm13,%xmm12,%xmm12 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups -80(%r15),%xmm15 - xorl %edx,%esi - vpalignr $8,%xmm0,%xmm1,%xmm4 - movl %eax,%edi - addl 0(%rsp),%ebp - vpaddd %xmm3,%xmm10,%xmm9 - xorl %ecx,%ebx - shldl $5,%eax,%eax - vpsrldq $4,%xmm3,%xmm8 - addl %esi,%ebp - andl %ebx,%edi - vpxor %xmm0,%xmm4,%xmm4 - xorl %ecx,%ebx - addl %eax,%ebp - vpxor %xmm2,%xmm8,%xmm8 - shrdl $7,%eax,%eax - xorl %ecx,%edi - movl %ebp,%esi - addl 4(%rsp),%edx - vpxor %xmm8,%xmm4,%xmm4 - xorl %ebx,%eax - shldl $5,%ebp,%ebp - vmovdqa %xmm9,48(%rsp) - addl %edi,%edx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups -64(%r15),%xmm14 - andl %eax,%esi - vpsrld $31,%xmm4,%xmm8 - xorl %ebx,%eax - addl %ebp,%edx - shrdl $7,%ebp,%ebp - xorl %ebx,%esi - vpslldq $12,%xmm4,%xmm9 - vpaddd %xmm4,%xmm4,%xmm4 - movl %edx,%edi - addl 8(%rsp),%ecx - xorl %eax,%ebp - shldl $5,%edx,%edx - vpor %xmm8,%xmm4,%xmm4 - vpsrld $30,%xmm9,%xmm8 - addl %esi,%ecx - andl %ebp,%edi - xorl %eax,%ebp - addl %edx,%ecx - vpslld $2,%xmm9,%xmm9 - vpxor %xmm8,%xmm4,%xmm4 - shrdl $7,%edx,%edx - xorl %eax,%edi - movl %ecx,%esi - addl 12(%rsp),%ebx - vaesenc %xmm14,%xmm12,%xmm12 - vmovups -48(%r15),%xmm15 - vpxor %xmm9,%xmm4,%xmm4 - xorl %ebp,%edx - shldl $5,%ecx,%ecx - addl %edi,%ebx - andl %edx,%esi - xorl %ebp,%edx - addl %ecx,%ebx - shrdl $7,%ecx,%ecx - xorl %ebp,%esi - vpalignr $8,%xmm1,%xmm2,%xmm5 - movl %ebx,%edi - addl 16(%rsp),%eax - vpaddd %xmm4,%xmm10,%xmm9 - xorl %edx,%ecx - shldl $5,%ebx,%ebx - vpsrldq $4,%xmm4,%xmm8 - addl %esi,%eax - andl %ecx,%edi - vpxor %xmm1,%xmm5,%xmm5 - xorl %edx,%ecx - addl %ebx,%eax - vpxor %xmm3,%xmm8,%xmm8 - shrdl $7,%ebx,%ebx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups -32(%r15),%xmm14 - xorl %edx,%edi - movl %eax,%esi - addl 20(%rsp),%ebp - vpxor %xmm8,%xmm5,%xmm5 - xorl %ecx,%ebx - shldl $5,%eax,%eax - vmovdqa %xmm9,0(%rsp) - addl %edi,%ebp - andl %ebx,%esi - vpsrld $31,%xmm5,%xmm8 - xorl %ecx,%ebx - addl %eax,%ebp - shrdl $7,%eax,%eax - xorl %ecx,%esi - vpslldq $12,%xmm5,%xmm9 - vpaddd %xmm5,%xmm5,%xmm5 - movl %ebp,%edi - addl 24(%rsp),%edx - xorl %ebx,%eax - shldl $5,%ebp,%ebp - vpor %xmm8,%xmm5,%xmm5 - vpsrld $30,%xmm9,%xmm8 - addl %esi,%edx - vaesenc %xmm14,%xmm12,%xmm12 - vmovups -16(%r15),%xmm15 - andl %eax,%edi - xorl %ebx,%eax - addl %ebp,%edx - vpslld $2,%xmm9,%xmm9 - vpxor %xmm8,%xmm5,%xmm5 - shrdl $7,%ebp,%ebp - xorl %ebx,%edi - movl %edx,%esi - addl 28(%rsp),%ecx - vpxor %xmm9,%xmm5,%xmm5 - xorl %eax,%ebp - shldl $5,%edx,%edx - vmovdqa 16(%r11),%xmm10 - addl %edi,%ecx - andl %ebp,%esi - xorl %eax,%ebp - addl %edx,%ecx - shrdl $7,%edx,%edx - xorl %eax,%esi - vpalignr $8,%xmm2,%xmm3,%xmm6 - movl %ecx,%edi - addl 32(%rsp),%ebx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 0(%r15),%xmm14 - vpaddd %xmm5,%xmm10,%xmm9 - xorl %ebp,%edx - shldl $5,%ecx,%ecx - vpsrldq $4,%xmm5,%xmm8 - addl %esi,%ebx - andl %edx,%edi - vpxor %xmm2,%xmm6,%xmm6 - xorl %ebp,%edx - addl %ecx,%ebx - vpxor %xmm4,%xmm8,%xmm8 - shrdl $7,%ecx,%ecx - xorl %ebp,%edi - movl %ebx,%esi - addl 36(%rsp),%eax - vpxor %xmm8,%xmm6,%xmm6 - xorl %edx,%ecx - shldl $5,%ebx,%ebx - vmovdqa %xmm9,16(%rsp) - addl %edi,%eax - andl %ecx,%esi - vpsrld $31,%xmm6,%xmm8 - xorl %edx,%ecx - addl %ebx,%eax - shrdl $7,%ebx,%ebx - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 16(%r15),%xmm15 - xorl %edx,%esi - vpslldq $12,%xmm6,%xmm9 - vpaddd %xmm6,%xmm6,%xmm6 - movl %eax,%edi - addl 40(%rsp),%ebp - xorl %ecx,%ebx - shldl $5,%eax,%eax - vpor %xmm8,%xmm6,%xmm6 - vpsrld $30,%xmm9,%xmm8 - addl %esi,%ebp - andl %ebx,%edi - xorl %ecx,%ebx - addl %eax,%ebp - vpslld $2,%xmm9,%xmm9 - vpxor %xmm8,%xmm6,%xmm6 - shrdl $7,%eax,%eax - xorl %ecx,%edi - movl %ebp,%esi - addl 44(%rsp),%edx - vpxor %xmm9,%xmm6,%xmm6 - xorl %ebx,%eax - shldl $5,%ebp,%ebp - addl %edi,%edx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 32(%r15),%xmm14 - andl %eax,%esi - xorl %ebx,%eax - addl %ebp,%edx - shrdl $7,%ebp,%ebp - xorl %ebx,%esi - vpalignr $8,%xmm3,%xmm4,%xmm7 - movl %edx,%edi - addl 48(%rsp),%ecx - vpaddd %xmm6,%xmm10,%xmm9 - xorl %eax,%ebp - shldl $5,%edx,%edx - vpsrldq $4,%xmm6,%xmm8 - addl %esi,%ecx - andl %ebp,%edi - vpxor %xmm3,%xmm7,%xmm7 - xorl %eax,%ebp - addl %edx,%ecx - vpxor %xmm5,%xmm8,%xmm8 - shrdl $7,%edx,%edx - xorl %eax,%edi - movl %ecx,%esi - addl 52(%rsp),%ebx - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 48(%r15),%xmm15 - vpxor %xmm8,%xmm7,%xmm7 - xorl %ebp,%edx - shldl $5,%ecx,%ecx - vmovdqa %xmm9,32(%rsp) - addl %edi,%ebx - andl %edx,%esi - vpsrld $31,%xmm7,%xmm8 - xorl %ebp,%edx - addl %ecx,%ebx - shrdl $7,%ecx,%ecx - xorl %ebp,%esi - vpslldq $12,%xmm7,%xmm9 - vpaddd %xmm7,%xmm7,%xmm7 - movl %ebx,%edi - addl 56(%rsp),%eax - xorl %edx,%ecx - shldl $5,%ebx,%ebx - vpor %xmm8,%xmm7,%xmm7 - vpsrld $30,%xmm9,%xmm8 - addl %esi,%eax - andl %ecx,%edi - xorl %edx,%ecx - addl %ebx,%eax - vpslld $2,%xmm9,%xmm9 - vpxor %xmm8,%xmm7,%xmm7 - shrdl $7,%ebx,%ebx - cmpl $11,%r8d - jb .Lvaesenclast6 - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 64(%r15),%xmm14 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 80(%r15),%xmm15 - je .Lvaesenclast6 - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 96(%r15),%xmm14 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 112(%r15),%xmm15 -.Lvaesenclast6: - vaesenclast %xmm15,%xmm12,%xmm12 - vmovups -112(%r15),%xmm15 - vmovups 16-112(%r15),%xmm14 - xorl %edx,%edi - movl %eax,%esi - addl 60(%rsp),%ebp - vpxor %xmm9,%xmm7,%xmm7 - xorl %ecx,%ebx - shldl $5,%eax,%eax - addl %edi,%ebp - andl %ebx,%esi - xorl %ecx,%ebx - addl %eax,%ebp - vpalignr $8,%xmm6,%xmm7,%xmm8 - vpxor %xmm4,%xmm0,%xmm0 - shrdl $7,%eax,%eax - xorl %ecx,%esi - movl %ebp,%edi - addl 0(%rsp),%edx - vpxor %xmm1,%xmm0,%xmm0 - xorl %ebx,%eax - shldl $5,%ebp,%ebp - vpaddd %xmm7,%xmm10,%xmm9 - addl %esi,%edx - vmovdqu 16(%r12),%xmm13 - vpxor %xmm15,%xmm13,%xmm13 - vmovups %xmm12,0(%r12,%r13,1) - vpxor %xmm13,%xmm12,%xmm12 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups -80(%r15),%xmm15 - andl %eax,%edi - vpxor %xmm8,%xmm0,%xmm0 - xorl %ebx,%eax - addl %ebp,%edx - shrdl $7,%ebp,%ebp - xorl %ebx,%edi - vpsrld $30,%xmm0,%xmm8 - vmovdqa %xmm9,48(%rsp) - movl %edx,%esi - addl 4(%rsp),%ecx - xorl %eax,%ebp - shldl $5,%edx,%edx - vpslld $2,%xmm0,%xmm0 - addl %edi,%ecx - andl %ebp,%esi - xorl %eax,%ebp - addl %edx,%ecx - shrdl $7,%edx,%edx - xorl %eax,%esi - movl %ecx,%edi - addl 8(%rsp),%ebx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups -64(%r15),%xmm14 - vpor %xmm8,%xmm0,%xmm0 - xorl %ebp,%edx - shldl $5,%ecx,%ecx - addl %esi,%ebx - andl %edx,%edi - xorl %ebp,%edx - addl %ecx,%ebx - addl 12(%rsp),%eax - xorl %ebp,%edi - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %edi,%eax - xorl %edx,%esi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vpalignr $8,%xmm7,%xmm0,%xmm8 - vpxor %xmm5,%xmm1,%xmm1 - addl 16(%rsp),%ebp - vaesenc %xmm14,%xmm12,%xmm12 - vmovups -48(%r15),%xmm15 - xorl %ecx,%esi - movl %eax,%edi - shldl $5,%eax,%eax - vpxor %xmm2,%xmm1,%xmm1 - addl %esi,%ebp - xorl %ecx,%edi - vpaddd %xmm0,%xmm10,%xmm9 - shrdl $7,%ebx,%ebx - addl %eax,%ebp - vpxor %xmm8,%xmm1,%xmm1 - addl 20(%rsp),%edx - xorl %ebx,%edi - movl %ebp,%esi - shldl $5,%ebp,%ebp - vpsrld $30,%xmm1,%xmm8 - vmovdqa %xmm9,0(%rsp) - addl %edi,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %ebp,%edx - vpslld $2,%xmm1,%xmm1 - addl 24(%rsp),%ecx - xorl %eax,%esi - movl %edx,%edi - shldl $5,%edx,%edx - addl %esi,%ecx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups -32(%r15),%xmm14 - xorl %eax,%edi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - vpor %xmm8,%xmm1,%xmm1 - addl 28(%rsp),%ebx - xorl %ebp,%edi - movl %ecx,%esi - shldl $5,%ecx,%ecx - addl %edi,%ebx - xorl %ebp,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - vpalignr $8,%xmm0,%xmm1,%xmm8 - vpxor %xmm6,%xmm2,%xmm2 - addl 32(%rsp),%eax - xorl %edx,%esi - movl %ebx,%edi - shldl $5,%ebx,%ebx - vpxor %xmm3,%xmm2,%xmm2 - addl %esi,%eax - xorl %edx,%edi - vpaddd %xmm1,%xmm10,%xmm9 - vmovdqa 32(%r11),%xmm10 - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vpxor %xmm8,%xmm2,%xmm2 - addl 36(%rsp),%ebp - vaesenc %xmm14,%xmm12,%xmm12 - vmovups -16(%r15),%xmm15 - xorl %ecx,%edi - movl %eax,%esi - shldl $5,%eax,%eax - vpsrld $30,%xmm2,%xmm8 - vmovdqa %xmm9,16(%rsp) - addl %edi,%ebp - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - vpslld $2,%xmm2,%xmm2 - addl 40(%rsp),%edx - xorl %ebx,%esi - movl %ebp,%edi - shldl $5,%ebp,%ebp - addl %esi,%edx - xorl %ebx,%edi - shrdl $7,%eax,%eax - addl %ebp,%edx - vpor %xmm8,%xmm2,%xmm2 - addl 44(%rsp),%ecx - xorl %eax,%edi - movl %edx,%esi - shldl $5,%edx,%edx - addl %edi,%ecx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 0(%r15),%xmm14 - xorl %eax,%esi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - vpalignr $8,%xmm1,%xmm2,%xmm8 - vpxor %xmm7,%xmm3,%xmm3 - addl 48(%rsp),%ebx - xorl %ebp,%esi - movl %ecx,%edi - shldl $5,%ecx,%ecx - vpxor %xmm4,%xmm3,%xmm3 - addl %esi,%ebx - xorl %ebp,%edi - vpaddd %xmm2,%xmm10,%xmm9 - shrdl $7,%edx,%edx - addl %ecx,%ebx - vpxor %xmm8,%xmm3,%xmm3 - addl 52(%rsp),%eax - xorl %edx,%edi - movl %ebx,%esi - shldl $5,%ebx,%ebx - vpsrld $30,%xmm3,%xmm8 - vmovdqa %xmm9,32(%rsp) - addl %edi,%eax - xorl %edx,%esi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vpslld $2,%xmm3,%xmm3 - addl 56(%rsp),%ebp - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 16(%r15),%xmm15 - xorl %ecx,%esi - movl %eax,%edi - shldl $5,%eax,%eax - addl %esi,%ebp - xorl %ecx,%edi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - vpor %xmm8,%xmm3,%xmm3 - addl 60(%rsp),%edx - xorl %ebx,%edi - movl %ebp,%esi - shldl $5,%ebp,%ebp - addl %edi,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %ebp,%edx - vpalignr $8,%xmm2,%xmm3,%xmm8 - vpxor %xmm0,%xmm4,%xmm4 - addl 0(%rsp),%ecx - xorl %eax,%esi - movl %edx,%edi - shldl $5,%edx,%edx - vpxor %xmm5,%xmm4,%xmm4 - addl %esi,%ecx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 32(%r15),%xmm14 - xorl %eax,%edi - vpaddd %xmm3,%xmm10,%xmm9 - shrdl $7,%ebp,%ebp - addl %edx,%ecx - vpxor %xmm8,%xmm4,%xmm4 - addl 4(%rsp),%ebx - xorl %ebp,%edi - movl %ecx,%esi - shldl $5,%ecx,%ecx - vpsrld $30,%xmm4,%xmm8 - vmovdqa %xmm9,48(%rsp) - addl %edi,%ebx - xorl %ebp,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - vpslld $2,%xmm4,%xmm4 - addl 8(%rsp),%eax - xorl %edx,%esi - movl %ebx,%edi - shldl $5,%ebx,%ebx - addl %esi,%eax - xorl %edx,%edi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vpor %xmm8,%xmm4,%xmm4 - addl 12(%rsp),%ebp - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 48(%r15),%xmm15 - xorl %ecx,%edi - movl %eax,%esi - shldl $5,%eax,%eax - addl %edi,%ebp - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - vpalignr $8,%xmm3,%xmm4,%xmm8 - vpxor %xmm1,%xmm5,%xmm5 - addl 16(%rsp),%edx - xorl %ebx,%esi - movl %ebp,%edi - shldl $5,%ebp,%ebp - vpxor %xmm6,%xmm5,%xmm5 - addl %esi,%edx - xorl %ebx,%edi - vpaddd %xmm4,%xmm10,%xmm9 - shrdl $7,%eax,%eax - addl %ebp,%edx - vpxor %xmm8,%xmm5,%xmm5 - addl 20(%rsp),%ecx - xorl %eax,%edi - movl %edx,%esi - shldl $5,%edx,%edx - vpsrld $30,%xmm5,%xmm8 - vmovdqa %xmm9,0(%rsp) - addl %edi,%ecx - cmpl $11,%r8d - jb .Lvaesenclast7 - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 64(%r15),%xmm14 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 80(%r15),%xmm15 - je .Lvaesenclast7 - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 96(%r15),%xmm14 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 112(%r15),%xmm15 -.Lvaesenclast7: - vaesenclast %xmm15,%xmm12,%xmm12 - vmovups -112(%r15),%xmm15 - vmovups 16-112(%r15),%xmm14 - xorl %eax,%esi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - vpslld $2,%xmm5,%xmm5 - addl 24(%rsp),%ebx - xorl %ebp,%esi - movl %ecx,%edi - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %ebp,%edi - shrdl $7,%edx,%edx - addl %ecx,%ebx - vpor %xmm8,%xmm5,%xmm5 - addl 28(%rsp),%eax - shrdl $7,%ecx,%ecx - movl %ebx,%esi - xorl %edx,%edi - shldl $5,%ebx,%ebx - addl %edi,%eax - xorl %ecx,%esi - xorl %edx,%ecx - addl %ebx,%eax - vpalignr $8,%xmm4,%xmm5,%xmm8 - vpxor %xmm2,%xmm6,%xmm6 - addl 32(%rsp),%ebp - vmovdqu 32(%r12),%xmm13 - vpxor %xmm15,%xmm13,%xmm13 - vmovups %xmm12,16(%r13,%r12,1) - vpxor %xmm13,%xmm12,%xmm12 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups -80(%r15),%xmm15 - andl %ecx,%esi - xorl %edx,%ecx - shrdl $7,%ebx,%ebx - vpxor %xmm7,%xmm6,%xmm6 - movl %eax,%edi - xorl %ecx,%esi - vpaddd %xmm5,%xmm10,%xmm9 - shldl $5,%eax,%eax - addl %esi,%ebp - vpxor %xmm8,%xmm6,%xmm6 - xorl %ebx,%edi - xorl %ecx,%ebx - addl %eax,%ebp - addl 36(%rsp),%edx - vpsrld $30,%xmm6,%xmm8 - vmovdqa %xmm9,16(%rsp) - andl %ebx,%edi - xorl %ecx,%ebx - shrdl $7,%eax,%eax - movl %ebp,%esi - vpslld $2,%xmm6,%xmm6 - xorl %ebx,%edi - shldl $5,%ebp,%ebp - addl %edi,%edx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups -64(%r15),%xmm14 - xorl %eax,%esi - xorl %ebx,%eax - addl %ebp,%edx - addl 40(%rsp),%ecx - andl %eax,%esi - vpor %xmm8,%xmm6,%xmm6 - xorl %ebx,%eax - shrdl $7,%ebp,%ebp - movl %edx,%edi - xorl %eax,%esi - shldl $5,%edx,%edx - addl %esi,%ecx - xorl %ebp,%edi - xorl %eax,%ebp - addl %edx,%ecx - addl 44(%rsp),%ebx - andl %ebp,%edi - xorl %eax,%ebp - shrdl $7,%edx,%edx - vaesenc %xmm14,%xmm12,%xmm12 - vmovups -48(%r15),%xmm15 - movl %ecx,%esi - xorl %ebp,%edi - shldl $5,%ecx,%ecx - addl %edi,%ebx - xorl %edx,%esi - xorl %ebp,%edx - addl %ecx,%ebx - vpalignr $8,%xmm5,%xmm6,%xmm8 - vpxor %xmm3,%xmm7,%xmm7 - addl 48(%rsp),%eax - andl %edx,%esi - xorl %ebp,%edx - shrdl $7,%ecx,%ecx - vpxor %xmm0,%xmm7,%xmm7 - movl %ebx,%edi - xorl %edx,%esi - vpaddd %xmm6,%xmm10,%xmm9 - vmovdqa 48(%r11),%xmm10 - shldl $5,%ebx,%ebx - addl %esi,%eax - vpxor %xmm8,%xmm7,%xmm7 - xorl %ecx,%edi - xorl %edx,%ecx - addl %ebx,%eax - addl 52(%rsp),%ebp - vaesenc %xmm15,%xmm12,%xmm12 - vmovups -32(%r15),%xmm14 - vpsrld $30,%xmm7,%xmm8 - vmovdqa %xmm9,32(%rsp) - andl %ecx,%edi - xorl %edx,%ecx - shrdl $7,%ebx,%ebx - movl %eax,%esi - vpslld $2,%xmm7,%xmm7 - xorl %ecx,%edi - shldl $5,%eax,%eax - addl %edi,%ebp - xorl %ebx,%esi - xorl %ecx,%ebx - addl %eax,%ebp - addl 56(%rsp),%edx - andl %ebx,%esi - vpor %xmm8,%xmm7,%xmm7 - xorl %ecx,%ebx - shrdl $7,%eax,%eax - movl %ebp,%edi - xorl %ebx,%esi - shldl $5,%ebp,%ebp - addl %esi,%edx - vaesenc %xmm14,%xmm12,%xmm12 - vmovups -16(%r15),%xmm15 - xorl %eax,%edi - xorl %ebx,%eax - addl %ebp,%edx - addl 60(%rsp),%ecx - andl %eax,%edi - xorl %ebx,%eax - shrdl $7,%ebp,%ebp - movl %edx,%esi - xorl %eax,%edi - shldl $5,%edx,%edx - addl %edi,%ecx - xorl %ebp,%esi - xorl %eax,%ebp - addl %edx,%ecx - vpalignr $8,%xmm6,%xmm7,%xmm8 - vpxor %xmm4,%xmm0,%xmm0 - addl 0(%rsp),%ebx - andl %ebp,%esi - xorl %eax,%ebp - shrdl $7,%edx,%edx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 0(%r15),%xmm14 - vpxor %xmm1,%xmm0,%xmm0 - movl %ecx,%edi - xorl %ebp,%esi - vpaddd %xmm7,%xmm10,%xmm9 - shldl $5,%ecx,%ecx - addl %esi,%ebx - vpxor %xmm8,%xmm0,%xmm0 - xorl %edx,%edi - xorl %ebp,%edx - addl %ecx,%ebx - addl 4(%rsp),%eax - vpsrld $30,%xmm0,%xmm8 - vmovdqa %xmm9,48(%rsp) - andl %edx,%edi - xorl %ebp,%edx - shrdl $7,%ecx,%ecx - movl %ebx,%esi - vpslld $2,%xmm0,%xmm0 - xorl %edx,%edi - shldl $5,%ebx,%ebx - addl %edi,%eax - xorl %ecx,%esi - xorl %edx,%ecx - addl %ebx,%eax - addl 8(%rsp),%ebp - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 16(%r15),%xmm15 - andl %ecx,%esi - vpor %xmm8,%xmm0,%xmm0 - xorl %edx,%ecx - shrdl $7,%ebx,%ebx - movl %eax,%edi - xorl %ecx,%esi - shldl $5,%eax,%eax - addl %esi,%ebp - xorl %ebx,%edi - xorl %ecx,%ebx - addl %eax,%ebp - addl 12(%rsp),%edx - andl %ebx,%edi - xorl %ecx,%ebx - shrdl $7,%eax,%eax - movl %ebp,%esi - xorl %ebx,%edi - shldl $5,%ebp,%ebp - addl %edi,%edx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 32(%r15),%xmm14 - xorl %eax,%esi - xorl %ebx,%eax - addl %ebp,%edx - vpalignr $8,%xmm7,%xmm0,%xmm8 - vpxor %xmm5,%xmm1,%xmm1 - addl 16(%rsp),%ecx - andl %eax,%esi - xorl %ebx,%eax - shrdl $7,%ebp,%ebp - vpxor %xmm2,%xmm1,%xmm1 - movl %edx,%edi - xorl %eax,%esi - vpaddd %xmm0,%xmm10,%xmm9 - shldl $5,%edx,%edx - addl %esi,%ecx - vpxor %xmm8,%xmm1,%xmm1 - xorl %ebp,%edi - xorl %eax,%ebp - addl %edx,%ecx - addl 20(%rsp),%ebx - vpsrld $30,%xmm1,%xmm8 - vmovdqa %xmm9,0(%rsp) - andl %ebp,%edi - xorl %eax,%ebp - shrdl $7,%edx,%edx - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 48(%r15),%xmm15 - movl %ecx,%esi - vpslld $2,%xmm1,%xmm1 - xorl %ebp,%edi - shldl $5,%ecx,%ecx - addl %edi,%ebx - xorl %edx,%esi - xorl %ebp,%edx - addl %ecx,%ebx - addl 24(%rsp),%eax - andl %edx,%esi - vpor %xmm8,%xmm1,%xmm1 - xorl %ebp,%edx - shrdl $7,%ecx,%ecx - movl %ebx,%edi - xorl %edx,%esi - shldl $5,%ebx,%ebx - addl %esi,%eax - xorl %ecx,%edi - xorl %edx,%ecx - addl %ebx,%eax - addl 28(%rsp),%ebp - cmpl $11,%r8d - jb .Lvaesenclast8 - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 64(%r15),%xmm14 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 80(%r15),%xmm15 - je .Lvaesenclast8 - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 96(%r15),%xmm14 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 112(%r15),%xmm15 -.Lvaesenclast8: - vaesenclast %xmm15,%xmm12,%xmm12 - vmovups -112(%r15),%xmm15 - vmovups 16-112(%r15),%xmm14 - andl %ecx,%edi - xorl %edx,%ecx - shrdl $7,%ebx,%ebx - movl %eax,%esi - xorl %ecx,%edi - shldl $5,%eax,%eax - addl %edi,%ebp - xorl %ebx,%esi - xorl %ecx,%ebx - addl %eax,%ebp - vpalignr $8,%xmm0,%xmm1,%xmm8 - vpxor %xmm6,%xmm2,%xmm2 - addl 32(%rsp),%edx - andl %ebx,%esi - xorl %ecx,%ebx - shrdl $7,%eax,%eax - vpxor %xmm3,%xmm2,%xmm2 - movl %ebp,%edi - xorl %ebx,%esi - vpaddd %xmm1,%xmm10,%xmm9 - shldl $5,%ebp,%ebp - addl %esi,%edx - vmovdqu 48(%r12),%xmm13 - vpxor %xmm15,%xmm13,%xmm13 - vmovups %xmm12,32(%r13,%r12,1) - vpxor %xmm13,%xmm12,%xmm12 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups -80(%r15),%xmm15 - vpxor %xmm8,%xmm2,%xmm2 - xorl %eax,%edi - xorl %ebx,%eax - addl %ebp,%edx - addl 36(%rsp),%ecx - vpsrld $30,%xmm2,%xmm8 - vmovdqa %xmm9,16(%rsp) - andl %eax,%edi - xorl %ebx,%eax - shrdl $7,%ebp,%ebp - movl %edx,%esi - vpslld $2,%xmm2,%xmm2 - xorl %eax,%edi - shldl $5,%edx,%edx - addl %edi,%ecx - xorl %ebp,%esi - xorl %eax,%ebp - addl %edx,%ecx - addl 40(%rsp),%ebx - andl %ebp,%esi - vpor %xmm8,%xmm2,%xmm2 - xorl %eax,%ebp - shrdl $7,%edx,%edx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups -64(%r15),%xmm14 - movl %ecx,%edi - xorl %ebp,%esi - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %edx,%edi - xorl %ebp,%edx - addl %ecx,%ebx - addl 44(%rsp),%eax - andl %edx,%edi - xorl %ebp,%edx - shrdl $7,%ecx,%ecx - movl %ebx,%esi - xorl %edx,%edi - shldl $5,%ebx,%ebx - addl %edi,%eax - xorl %edx,%esi - addl %ebx,%eax - vpalignr $8,%xmm1,%xmm2,%xmm8 - vpxor %xmm7,%xmm3,%xmm3 - addl 48(%rsp),%ebp - vaesenc %xmm14,%xmm12,%xmm12 - vmovups -48(%r15),%xmm15 - xorl %ecx,%esi - movl %eax,%edi - shldl $5,%eax,%eax - vpxor %xmm4,%xmm3,%xmm3 - addl %esi,%ebp - xorl %ecx,%edi - vpaddd %xmm2,%xmm10,%xmm9 - shrdl $7,%ebx,%ebx - addl %eax,%ebp - vpxor %xmm8,%xmm3,%xmm3 - addl 52(%rsp),%edx - xorl %ebx,%edi - movl %ebp,%esi - shldl $5,%ebp,%ebp - vpsrld $30,%xmm3,%xmm8 - vmovdqa %xmm9,32(%rsp) - addl %edi,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %ebp,%edx - vpslld $2,%xmm3,%xmm3 - addl 56(%rsp),%ecx - xorl %eax,%esi - movl %edx,%edi - shldl $5,%edx,%edx - addl %esi,%ecx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups -32(%r15),%xmm14 - xorl %eax,%edi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - vpor %xmm8,%xmm3,%xmm3 - addl 60(%rsp),%ebx - xorl %ebp,%edi - movl %ecx,%esi - shldl $5,%ecx,%ecx - addl %edi,%ebx - xorl %ebp,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 0(%rsp),%eax - vpaddd %xmm3,%xmm10,%xmm9 - xorl %edx,%esi - movl %ebx,%edi - shldl $5,%ebx,%ebx - addl %esi,%eax - vmovdqa %xmm9,48(%rsp) - xorl %edx,%edi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 4(%rsp),%ebp - vaesenc %xmm14,%xmm12,%xmm12 - vmovups -16(%r15),%xmm15 - xorl %ecx,%edi - movl %eax,%esi - shldl $5,%eax,%eax - addl %edi,%ebp - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - addl 8(%rsp),%edx - xorl %ebx,%esi - movl %ebp,%edi - shldl $5,%ebp,%ebp - addl %esi,%edx - xorl %ebx,%edi - shrdl $7,%eax,%eax - addl %ebp,%edx - addl 12(%rsp),%ecx - xorl %eax,%edi - movl %edx,%esi - shldl $5,%edx,%edx - addl %edi,%ecx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 0(%r15),%xmm14 - xorl %eax,%esi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - cmpq %r14,%r10 - je .Ldone_avx - vmovdqa 64(%r11),%xmm9 - vmovdqa 0(%r11),%xmm10 - vmovdqu 0(%r10),%xmm0 - vmovdqu 16(%r10),%xmm1 - vmovdqu 32(%r10),%xmm2 - vmovdqu 48(%r10),%xmm3 - vpshufb %xmm9,%xmm0,%xmm0 - addq $64,%r10 - addl 16(%rsp),%ebx - xorl %ebp,%esi - vpshufb %xmm9,%xmm1,%xmm1 - movl %ecx,%edi - shldl $5,%ecx,%ecx - vpaddd %xmm10,%xmm0,%xmm8 - addl %esi,%ebx - xorl %ebp,%edi - shrdl $7,%edx,%edx - addl %ecx,%ebx - vmovdqa %xmm8,0(%rsp) - addl 20(%rsp),%eax - xorl %edx,%edi - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %edi,%eax - xorl %edx,%esi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 24(%rsp),%ebp - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 16(%r15),%xmm15 - xorl %ecx,%esi - movl %eax,%edi - shldl $5,%eax,%eax - addl %esi,%ebp - xorl %ecx,%edi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - addl 28(%rsp),%edx - xorl %ebx,%edi - movl %ebp,%esi - shldl $5,%ebp,%ebp - addl %edi,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %ebp,%edx - addl 32(%rsp),%ecx - xorl %eax,%esi - vpshufb %xmm9,%xmm2,%xmm2 - movl %edx,%edi - shldl $5,%edx,%edx - vpaddd %xmm10,%xmm1,%xmm8 - addl %esi,%ecx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 32(%r15),%xmm14 - xorl %eax,%edi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - vmovdqa %xmm8,16(%rsp) - addl 36(%rsp),%ebx - xorl %ebp,%edi - movl %ecx,%esi - shldl $5,%ecx,%ecx - addl %edi,%ebx - xorl %ebp,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 40(%rsp),%eax - xorl %edx,%esi - movl %ebx,%edi - shldl $5,%ebx,%ebx - addl %esi,%eax - xorl %edx,%edi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 44(%rsp),%ebp - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 48(%r15),%xmm15 - xorl %ecx,%edi - movl %eax,%esi - shldl $5,%eax,%eax - addl %edi,%ebp - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - addl 48(%rsp),%edx - xorl %ebx,%esi - vpshufb %xmm9,%xmm3,%xmm3 - movl %ebp,%edi - shldl $5,%ebp,%ebp - vpaddd %xmm10,%xmm2,%xmm8 - addl %esi,%edx - xorl %ebx,%edi - shrdl $7,%eax,%eax - addl %ebp,%edx - vmovdqa %xmm8,32(%rsp) - addl 52(%rsp),%ecx - xorl %eax,%edi - movl %edx,%esi - shldl $5,%edx,%edx - addl %edi,%ecx - cmpl $11,%r8d - jb .Lvaesenclast9 - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 64(%r15),%xmm14 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 80(%r15),%xmm15 - je .Lvaesenclast9 - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 96(%r15),%xmm14 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 112(%r15),%xmm15 -.Lvaesenclast9: - vaesenclast %xmm15,%xmm12,%xmm12 - vmovups -112(%r15),%xmm15 - vmovups 16-112(%r15),%xmm14 - xorl %eax,%esi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - addl 56(%rsp),%ebx - xorl %ebp,%esi - movl %ecx,%edi - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %ebp,%edi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 60(%rsp),%eax - xorl %edx,%edi - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %edi,%eax - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vmovups %xmm12,48(%r13,%r12,1) - leaq 64(%r12),%r12 - - addl 0(%r9),%eax - addl 4(%r9),%esi - addl 8(%r9),%ecx - addl 12(%r9),%edx - movl %eax,0(%r9) - addl 16(%r9),%ebp - movl %esi,4(%r9) - movl %esi,%ebx - movl %ecx,8(%r9) - movl %ecx,%edi - movl %edx,12(%r9) - xorl %edx,%edi - movl %ebp,16(%r9) - andl %edi,%esi - jmp .Loop_avx - -.Ldone_avx: - addl 16(%rsp),%ebx - xorl %ebp,%esi - movl %ecx,%edi - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %ebp,%edi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 20(%rsp),%eax - xorl %edx,%edi - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %edi,%eax - xorl %edx,%esi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 24(%rsp),%ebp - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 16(%r15),%xmm15 - xorl %ecx,%esi - movl %eax,%edi - shldl $5,%eax,%eax - addl %esi,%ebp - xorl %ecx,%edi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - addl 28(%rsp),%edx - xorl %ebx,%edi - movl %ebp,%esi - shldl $5,%ebp,%ebp - addl %edi,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %ebp,%edx - addl 32(%rsp),%ecx - xorl %eax,%esi - movl %edx,%edi - shldl $5,%edx,%edx - addl %esi,%ecx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 32(%r15),%xmm14 - xorl %eax,%edi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - addl 36(%rsp),%ebx - xorl %ebp,%edi - movl %ecx,%esi - shldl $5,%ecx,%ecx - addl %edi,%ebx - xorl %ebp,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 40(%rsp),%eax - xorl %edx,%esi - movl %ebx,%edi - shldl $5,%ebx,%ebx - addl %esi,%eax - xorl %edx,%edi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 44(%rsp),%ebp - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 48(%r15),%xmm15 - xorl %ecx,%edi - movl %eax,%esi - shldl $5,%eax,%eax - addl %edi,%ebp - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - addl 48(%rsp),%edx - xorl %ebx,%esi - movl %ebp,%edi - shldl $5,%ebp,%ebp - addl %esi,%edx - xorl %ebx,%edi - shrdl $7,%eax,%eax - addl %ebp,%edx - addl 52(%rsp),%ecx - xorl %eax,%edi - movl %edx,%esi - shldl $5,%edx,%edx - addl %edi,%ecx - cmpl $11,%r8d - jb .Lvaesenclast10 - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 64(%r15),%xmm14 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 80(%r15),%xmm15 - je .Lvaesenclast10 - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 96(%r15),%xmm14 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 112(%r15),%xmm15 -.Lvaesenclast10: - vaesenclast %xmm15,%xmm12,%xmm12 - vmovups -112(%r15),%xmm15 - vmovups 16-112(%r15),%xmm14 - xorl %eax,%esi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - addl 56(%rsp),%ebx - xorl %ebp,%esi - movl %ecx,%edi - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %ebp,%edi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 60(%rsp),%eax - xorl %edx,%edi - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %edi,%eax - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vmovups %xmm12,48(%r13,%r12,1) - movq 88(%rsp),%r8 - - addl 0(%r9),%eax - addl 4(%r9),%esi - addl 8(%r9),%ecx - movl %eax,0(%r9) - addl 12(%r9),%edx - movl %esi,4(%r9) - addl 16(%r9),%ebp - movl %ecx,8(%r9) - movl %edx,12(%r9) - movl %ebp,16(%r9) - vmovups %xmm12,(%r8) - vzeroall - leaq 104(%rsp),%rsi - movq 0(%rsi),%r15 - movq 8(%rsi),%r14 - movq 16(%rsi),%r13 - movq 24(%rsi),%r12 - movq 32(%rsi),%rbp - movq 40(%rsi),%rbx - leaq 48(%rsi),%rsp -.Lepilogue_avx: - .byte 0xf3,0xc3 -.size aesni_cbc_sha1_enc_avx,.-aesni_cbc_sha1_enc_avx .align 64 K_XX_XX: .long 0x5a827999,0x5a827999,0x5a827999,0x5a827999 @@ -2695,8 +1392,8 @@ aesni_cbc_sha1_enc_shaext: movups 16(%rcx),%xmm0 leaq 112(%rcx),%rcx - pshufd $27,%xmm8,%xmm8 - pshufd $27,%xmm9,%xmm9 + pshufd $0b00011011,%xmm8,%xmm8 + pshufd $0b00011011,%xmm9,%xmm9 jmp .Loop_shaext .align 16 @@ -2759,17 +1456,17 @@ aesni_cbc_sha1_enc_shaext: pxor %xmm3,%xmm5 .byte 15,56,201,243 cmpl $11,%r11d - jb .Laesenclast11 + jb .Laesenclast6 movups 64(%rcx),%xmm0 .byte 102,15,56,220,209 movups 80(%rcx),%xmm1 .byte 102,15,56,220,208 - je .Laesenclast11 + je .Laesenclast6 movups 96(%rcx),%xmm0 .byte 102,15,56,220,209 movups 112(%rcx),%xmm1 .byte 102,15,56,220,208 -.Laesenclast11: +.Laesenclast6: .byte 102,15,56,221,209 movups 16-112(%rcx),%xmm0 movdqa %xmm8,%xmm10 @@ -2825,17 +1522,17 @@ aesni_cbc_sha1_enc_shaext: pxor %xmm4,%xmm6 .byte 15,56,201,220 cmpl $11,%r11d - jb .Laesenclast12 + jb .Laesenclast7 movups 64(%rcx),%xmm0 .byte 102,15,56,220,209 movups 80(%rcx),%xmm1 .byte 102,15,56,220,208 - je .Laesenclast12 + je .Laesenclast7 movups 96(%rcx),%xmm0 .byte 102,15,56,220,209 movups 112(%rcx),%xmm1 .byte 102,15,56,220,208 -.Laesenclast12: +.Laesenclast7: .byte 102,15,56,221,209 movups 16-112(%rcx),%xmm0 movdqa %xmm8,%xmm9 @@ -2891,17 +1588,17 @@ aesni_cbc_sha1_enc_shaext: pxor %xmm5,%xmm3 .byte 15,56,201,229 cmpl $11,%r11d - jb .Laesenclast13 + jb .Laesenclast8 movups 64(%rcx),%xmm0 .byte 102,15,56,220,209 movups 80(%rcx),%xmm1 .byte 102,15,56,220,208 - je .Laesenclast13 + je .Laesenclast8 movups 96(%rcx),%xmm0 .byte 102,15,56,220,209 movups 112(%rcx),%xmm1 .byte 102,15,56,220,208 -.Laesenclast13: +.Laesenclast8: .byte 102,15,56,221,209 movups 16-112(%rcx),%xmm0 movdqa %xmm8,%xmm10 @@ -2955,17 +1652,17 @@ aesni_cbc_sha1_enc_shaext: movups 48(%rcx),%xmm1 .byte 102,15,56,220,208 cmpl $11,%r11d - jb .Laesenclast14 + jb .Laesenclast9 movups 64(%rcx),%xmm0 .byte 102,15,56,220,209 movups 80(%rcx),%xmm1 .byte 102,15,56,220,208 - je .Laesenclast14 + je .Laesenclast9 movups 96(%rcx),%xmm0 .byte 102,15,56,220,209 movups 112(%rcx),%xmm1 .byte 102,15,56,220,208 -.Laesenclast14: +.Laesenclast9: .byte 102,15,56,221,209 movups 16-112(%rcx),%xmm0 decq %rdx @@ -2975,8 +1672,8 @@ aesni_cbc_sha1_enc_shaext: leaq 64(%rdi),%rdi jnz .Loop_shaext - pshufd $27,%xmm8,%xmm8 - pshufd $27,%xmm9,%xmm9 + pshufd $0b00011011,%xmm8,%xmm8 + pshufd $0b00011011,%xmm9,%xmm9 movups %xmm2,(%r8) movdqu %xmm8,(%r9) movd %xmm9,16(%r9) diff --git a/deps/openssl/asm/x64-elf-gas/aes/aesni-sha256-x86_64.s b/deps/openssl/asm/x64-elf-gas/aes/aesni-sha256-x86_64.s index 14c1f7a7e2660c..2c85f62495fe5e 100644 --- a/deps/openssl/asm/x64-elf-gas/aes/aesni-sha256-x86_64.s +++ b/deps/openssl/asm/x64-elf-gas/aes/aesni-sha256-x86_64.s @@ -5,28 +5,6 @@ .type aesni_cbc_sha256_enc,@function .align 16 aesni_cbc_sha256_enc: - leaq OPENSSL_ia32cap_P(%rip),%r11 - movl $1,%eax - cmpq $0,%rdi - je .Lprobe - movl 0(%r11),%eax - movq 4(%r11),%r10 - btq $61,%r10 - jc aesni_cbc_sha256_enc_shaext - movq %r10,%r11 - shrq $32,%r11 - - testl $2048,%r10d - jnz aesni_cbc_sha256_enc_xop - andl $296,%r11d - cmpl $296,%r11d - je aesni_cbc_sha256_enc_avx2 - andl $1073741824,%eax - andl $268435968,%r10d - orl %eax,%r10d - cmpl $1342177792,%r10d - je aesni_cbc_sha256_enc_avx - ud2 xorl %eax,%eax cmpq $0,%rdi je .Lprobe @@ -77,4281 +55,3 @@ K256: .long 0,0,0,0, 0,0,0,0 .byte 65,69,83,78,73,45,67,66,67,43,83,72,65,50,53,54,32,115,116,105,116,99,104,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 .align 64 -.type aesni_cbc_sha256_enc_xop,@function -.align 64 -aesni_cbc_sha256_enc_xop: -.Lxop_shortcut: - movq 8(%rsp),%r10 - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - movq %rsp,%r11 - subq $128,%rsp - andq $-64,%rsp - - shlq $6,%rdx - subq %rdi,%rsi - subq %rdi,%r10 - addq %rdi,%rdx - - - movq %rsi,64+8(%rsp) - movq %rdx,64+16(%rsp) - - movq %r8,64+32(%rsp) - movq %r9,64+40(%rsp) - movq %r10,64+48(%rsp) - movq %r11,64+56(%rsp) -.Lprologue_xop: - vzeroall - - movq %rdi,%r12 - leaq 128(%rcx),%rdi - leaq K256+544(%rip),%r13 - movl 240-128(%rdi),%r14d - movq %r9,%r15 - movq %r10,%rsi - vmovdqu (%r8),%xmm8 - subq $9,%r14 - - movl 0(%r15),%eax - movl 4(%r15),%ebx - movl 8(%r15),%ecx - movl 12(%r15),%edx - movl 16(%r15),%r8d - movl 20(%r15),%r9d - movl 24(%r15),%r10d - movl 28(%r15),%r11d - - vmovdqa 0(%r13,%r14,8),%xmm14 - vmovdqa 16(%r13,%r14,8),%xmm13 - vmovdqa 32(%r13,%r14,8),%xmm12 - vmovdqu 0-128(%rdi),%xmm10 - jmp .Lloop_xop -.align 16 -.Lloop_xop: - vmovdqa K256+512(%rip),%xmm7 - vmovdqu 0(%rsi,%r12,1),%xmm0 - vmovdqu 16(%rsi,%r12,1),%xmm1 - vmovdqu 32(%rsi,%r12,1),%xmm2 - vmovdqu 48(%rsi,%r12,1),%xmm3 - vpshufb %xmm7,%xmm0,%xmm0 - leaq K256(%rip),%rbp - vpshufb %xmm7,%xmm1,%xmm1 - vpshufb %xmm7,%xmm2,%xmm2 - vpaddd 0(%rbp),%xmm0,%xmm4 - vpshufb %xmm7,%xmm3,%xmm3 - vpaddd 32(%rbp),%xmm1,%xmm5 - vpaddd 64(%rbp),%xmm2,%xmm6 - vpaddd 96(%rbp),%xmm3,%xmm7 - vmovdqa %xmm4,0(%rsp) - movl %eax,%r14d - vmovdqa %xmm5,16(%rsp) - movl %ebx,%esi - vmovdqa %xmm6,32(%rsp) - xorl %ecx,%esi - vmovdqa %xmm7,48(%rsp) - movl %r8d,%r13d - jmp .Lxop_00_47 - -.align 16 -.Lxop_00_47: - subq $-32*4,%rbp - vmovdqu (%r12),%xmm9 - movq %r12,64+0(%rsp) - vpalignr $4,%xmm0,%xmm1,%xmm4 - rorl $14,%r13d - movl %r14d,%eax - vpalignr $4,%xmm2,%xmm3,%xmm7 - movl %r9d,%r12d - xorl %r8d,%r13d -.byte 143,232,120,194,236,14 - rorl $9,%r14d - xorl %r10d,%r12d - vpsrld $3,%xmm4,%xmm4 - rorl $5,%r13d - xorl %eax,%r14d - vpaddd %xmm7,%xmm0,%xmm0 - andl %r8d,%r12d - vpxor %xmm10,%xmm9,%xmm9 - vmovdqu 16-128(%rdi),%xmm10 - xorl %r8d,%r13d - addl 0(%rsp),%r11d - movl %eax,%r15d -.byte 143,232,120,194,245,11 - rorl $11,%r14d - xorl %r10d,%r12d - vpxor %xmm5,%xmm4,%xmm4 - xorl %ebx,%r15d - rorl $6,%r13d - addl %r12d,%r11d - andl %r15d,%esi -.byte 143,232,120,194,251,13 - xorl %eax,%r14d - addl %r13d,%r11d - vpxor %xmm6,%xmm4,%xmm4 - xorl %ebx,%esi - addl %r11d,%edx - vpsrld $10,%xmm3,%xmm6 - rorl $2,%r14d - addl %esi,%r11d - vpaddd %xmm4,%xmm0,%xmm0 - movl %edx,%r13d - addl %r11d,%r14d -.byte 143,232,120,194,239,2 - rorl $14,%r13d - movl %r14d,%r11d - vpxor %xmm6,%xmm7,%xmm7 - movl %r8d,%r12d - xorl %edx,%r13d - rorl $9,%r14d - xorl %r9d,%r12d - vpxor %xmm5,%xmm7,%xmm7 - rorl $5,%r13d - xorl %r11d,%r14d - andl %edx,%r12d - vpxor %xmm8,%xmm9,%xmm9 - xorl %edx,%r13d - vpsrldq $8,%xmm7,%xmm7 - addl 4(%rsp),%r10d - movl %r11d,%esi - rorl $11,%r14d - xorl %r9d,%r12d - vpaddd %xmm7,%xmm0,%xmm0 - xorl %eax,%esi - rorl $6,%r13d - addl %r12d,%r10d - andl %esi,%r15d -.byte 143,232,120,194,248,13 - xorl %r11d,%r14d - addl %r13d,%r10d - vpsrld $10,%xmm0,%xmm6 - xorl %eax,%r15d - addl %r10d,%ecx -.byte 143,232,120,194,239,2 - rorl $2,%r14d - addl %r15d,%r10d - vpxor %xmm6,%xmm7,%xmm7 - movl %ecx,%r13d - addl %r10d,%r14d - rorl $14,%r13d - movl %r14d,%r10d - vpxor %xmm5,%xmm7,%xmm7 - movl %edx,%r12d - xorl %ecx,%r13d - rorl $9,%r14d - xorl %r8d,%r12d - vpslldq $8,%xmm7,%xmm7 - rorl $5,%r13d - xorl %r10d,%r14d - andl %ecx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 32-128(%rdi),%xmm10 - xorl %ecx,%r13d - vpaddd %xmm7,%xmm0,%xmm0 - addl 8(%rsp),%r9d - movl %r10d,%r15d - rorl $11,%r14d - xorl %r8d,%r12d - vpaddd 0(%rbp),%xmm0,%xmm6 - xorl %r11d,%r15d - rorl $6,%r13d - addl %r12d,%r9d - andl %r15d,%esi - xorl %r10d,%r14d - addl %r13d,%r9d - xorl %r11d,%esi - addl %r9d,%ebx - rorl $2,%r14d - addl %esi,%r9d - movl %ebx,%r13d - addl %r9d,%r14d - rorl $14,%r13d - movl %r14d,%r9d - movl %ecx,%r12d - xorl %ebx,%r13d - rorl $9,%r14d - xorl %edx,%r12d - rorl $5,%r13d - xorl %r9d,%r14d - andl %ebx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 48-128(%rdi),%xmm10 - xorl %ebx,%r13d - addl 12(%rsp),%r8d - movl %r9d,%esi - rorl $11,%r14d - xorl %edx,%r12d - xorl %r10d,%esi - rorl $6,%r13d - addl %r12d,%r8d - andl %esi,%r15d - xorl %r9d,%r14d - addl %r13d,%r8d - xorl %r10d,%r15d - addl %r8d,%eax - rorl $2,%r14d - addl %r15d,%r8d - movl %eax,%r13d - addl %r8d,%r14d - vmovdqa %xmm6,0(%rsp) - vpalignr $4,%xmm1,%xmm2,%xmm4 - rorl $14,%r13d - movl %r14d,%r8d - vpalignr $4,%xmm3,%xmm0,%xmm7 - movl %ebx,%r12d - xorl %eax,%r13d -.byte 143,232,120,194,236,14 - rorl $9,%r14d - xorl %ecx,%r12d - vpsrld $3,%xmm4,%xmm4 - rorl $5,%r13d - xorl %r8d,%r14d - vpaddd %xmm7,%xmm1,%xmm1 - andl %eax,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 64-128(%rdi),%xmm10 - xorl %eax,%r13d - addl 16(%rsp),%edx - movl %r8d,%r15d -.byte 143,232,120,194,245,11 - rorl $11,%r14d - xorl %ecx,%r12d - vpxor %xmm5,%xmm4,%xmm4 - xorl %r9d,%r15d - rorl $6,%r13d - addl %r12d,%edx - andl %r15d,%esi -.byte 143,232,120,194,248,13 - xorl %r8d,%r14d - addl %r13d,%edx - vpxor %xmm6,%xmm4,%xmm4 - xorl %r9d,%esi - addl %edx,%r11d - vpsrld $10,%xmm0,%xmm6 - rorl $2,%r14d - addl %esi,%edx - vpaddd %xmm4,%xmm1,%xmm1 - movl %r11d,%r13d - addl %edx,%r14d -.byte 143,232,120,194,239,2 - rorl $14,%r13d - movl %r14d,%edx - vpxor %xmm6,%xmm7,%xmm7 - movl %eax,%r12d - xorl %r11d,%r13d - rorl $9,%r14d - xorl %ebx,%r12d - vpxor %xmm5,%xmm7,%xmm7 - rorl $5,%r13d - xorl %edx,%r14d - andl %r11d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 80-128(%rdi),%xmm10 - xorl %r11d,%r13d - vpsrldq $8,%xmm7,%xmm7 - addl 20(%rsp),%ecx - movl %edx,%esi - rorl $11,%r14d - xorl %ebx,%r12d - vpaddd %xmm7,%xmm1,%xmm1 - xorl %r8d,%esi - rorl $6,%r13d - addl %r12d,%ecx - andl %esi,%r15d -.byte 143,232,120,194,249,13 - xorl %edx,%r14d - addl %r13d,%ecx - vpsrld $10,%xmm1,%xmm6 - xorl %r8d,%r15d - addl %ecx,%r10d -.byte 143,232,120,194,239,2 - rorl $2,%r14d - addl %r15d,%ecx - vpxor %xmm6,%xmm7,%xmm7 - movl %r10d,%r13d - addl %ecx,%r14d - rorl $14,%r13d - movl %r14d,%ecx - vpxor %xmm5,%xmm7,%xmm7 - movl %r11d,%r12d - xorl %r10d,%r13d - rorl $9,%r14d - xorl %eax,%r12d - vpslldq $8,%xmm7,%xmm7 - rorl $5,%r13d - xorl %ecx,%r14d - andl %r10d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 96-128(%rdi),%xmm10 - xorl %r10d,%r13d - vpaddd %xmm7,%xmm1,%xmm1 - addl 24(%rsp),%ebx - movl %ecx,%r15d - rorl $11,%r14d - xorl %eax,%r12d - vpaddd 32(%rbp),%xmm1,%xmm6 - xorl %edx,%r15d - rorl $6,%r13d - addl %r12d,%ebx - andl %r15d,%esi - xorl %ecx,%r14d - addl %r13d,%ebx - xorl %edx,%esi - addl %ebx,%r9d - rorl $2,%r14d - addl %esi,%ebx - movl %r9d,%r13d - addl %ebx,%r14d - rorl $14,%r13d - movl %r14d,%ebx - movl %r10d,%r12d - xorl %r9d,%r13d - rorl $9,%r14d - xorl %r11d,%r12d - rorl $5,%r13d - xorl %ebx,%r14d - andl %r9d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 112-128(%rdi),%xmm10 - xorl %r9d,%r13d - addl 28(%rsp),%eax - movl %ebx,%esi - rorl $11,%r14d - xorl %r11d,%r12d - xorl %ecx,%esi - rorl $6,%r13d - addl %r12d,%eax - andl %esi,%r15d - xorl %ebx,%r14d - addl %r13d,%eax - xorl %ecx,%r15d - addl %eax,%r8d - rorl $2,%r14d - addl %r15d,%eax - movl %r8d,%r13d - addl %eax,%r14d - vmovdqa %xmm6,16(%rsp) - vpalignr $4,%xmm2,%xmm3,%xmm4 - rorl $14,%r13d - movl %r14d,%eax - vpalignr $4,%xmm0,%xmm1,%xmm7 - movl %r9d,%r12d - xorl %r8d,%r13d -.byte 143,232,120,194,236,14 - rorl $9,%r14d - xorl %r10d,%r12d - vpsrld $3,%xmm4,%xmm4 - rorl $5,%r13d - xorl %eax,%r14d - vpaddd %xmm7,%xmm2,%xmm2 - andl %r8d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 128-128(%rdi),%xmm10 - xorl %r8d,%r13d - addl 32(%rsp),%r11d - movl %eax,%r15d -.byte 143,232,120,194,245,11 - rorl $11,%r14d - xorl %r10d,%r12d - vpxor %xmm5,%xmm4,%xmm4 - xorl %ebx,%r15d - rorl $6,%r13d - addl %r12d,%r11d - andl %r15d,%esi -.byte 143,232,120,194,249,13 - xorl %eax,%r14d - addl %r13d,%r11d - vpxor %xmm6,%xmm4,%xmm4 - xorl %ebx,%esi - addl %r11d,%edx - vpsrld $10,%xmm1,%xmm6 - rorl $2,%r14d - addl %esi,%r11d - vpaddd %xmm4,%xmm2,%xmm2 - movl %edx,%r13d - addl %r11d,%r14d -.byte 143,232,120,194,239,2 - rorl $14,%r13d - movl %r14d,%r11d - vpxor %xmm6,%xmm7,%xmm7 - movl %r8d,%r12d - xorl %edx,%r13d - rorl $9,%r14d - xorl %r9d,%r12d - vpxor %xmm5,%xmm7,%xmm7 - rorl $5,%r13d - xorl %r11d,%r14d - andl %edx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 144-128(%rdi),%xmm10 - xorl %edx,%r13d - vpsrldq $8,%xmm7,%xmm7 - addl 36(%rsp),%r10d - movl %r11d,%esi - rorl $11,%r14d - xorl %r9d,%r12d - vpaddd %xmm7,%xmm2,%xmm2 - xorl %eax,%esi - rorl $6,%r13d - addl %r12d,%r10d - andl %esi,%r15d -.byte 143,232,120,194,250,13 - xorl %r11d,%r14d - addl %r13d,%r10d - vpsrld $10,%xmm2,%xmm6 - xorl %eax,%r15d - addl %r10d,%ecx -.byte 143,232,120,194,239,2 - rorl $2,%r14d - addl %r15d,%r10d - vpxor %xmm6,%xmm7,%xmm7 - movl %ecx,%r13d - addl %r10d,%r14d - rorl $14,%r13d - movl %r14d,%r10d - vpxor %xmm5,%xmm7,%xmm7 - movl %edx,%r12d - xorl %ecx,%r13d - rorl $9,%r14d - xorl %r8d,%r12d - vpslldq $8,%xmm7,%xmm7 - rorl $5,%r13d - xorl %r10d,%r14d - andl %ecx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 160-128(%rdi),%xmm10 - xorl %ecx,%r13d - vpaddd %xmm7,%xmm2,%xmm2 - addl 40(%rsp),%r9d - movl %r10d,%r15d - rorl $11,%r14d - xorl %r8d,%r12d - vpaddd 64(%rbp),%xmm2,%xmm6 - xorl %r11d,%r15d - rorl $6,%r13d - addl %r12d,%r9d - andl %r15d,%esi - xorl %r10d,%r14d - addl %r13d,%r9d - xorl %r11d,%esi - addl %r9d,%ebx - rorl $2,%r14d - addl %esi,%r9d - movl %ebx,%r13d - addl %r9d,%r14d - rorl $14,%r13d - movl %r14d,%r9d - movl %ecx,%r12d - xorl %ebx,%r13d - rorl $9,%r14d - xorl %edx,%r12d - rorl $5,%r13d - xorl %r9d,%r14d - andl %ebx,%r12d - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 176-128(%rdi),%xmm10 - xorl %ebx,%r13d - addl 44(%rsp),%r8d - movl %r9d,%esi - rorl $11,%r14d - xorl %edx,%r12d - xorl %r10d,%esi - rorl $6,%r13d - addl %r12d,%r8d - andl %esi,%r15d - xorl %r9d,%r14d - addl %r13d,%r8d - xorl %r10d,%r15d - addl %r8d,%eax - rorl $2,%r14d - addl %r15d,%r8d - movl %eax,%r13d - addl %r8d,%r14d - vmovdqa %xmm6,32(%rsp) - vpalignr $4,%xmm3,%xmm0,%xmm4 - rorl $14,%r13d - movl %r14d,%r8d - vpalignr $4,%xmm1,%xmm2,%xmm7 - movl %ebx,%r12d - xorl %eax,%r13d -.byte 143,232,120,194,236,14 - rorl $9,%r14d - xorl %ecx,%r12d - vpsrld $3,%xmm4,%xmm4 - rorl $5,%r13d - xorl %r8d,%r14d - vpaddd %xmm7,%xmm3,%xmm3 - andl %eax,%r12d - vpand %xmm12,%xmm11,%xmm8 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 192-128(%rdi),%xmm10 - xorl %eax,%r13d - addl 48(%rsp),%edx - movl %r8d,%r15d -.byte 143,232,120,194,245,11 - rorl $11,%r14d - xorl %ecx,%r12d - vpxor %xmm5,%xmm4,%xmm4 - xorl %r9d,%r15d - rorl $6,%r13d - addl %r12d,%edx - andl %r15d,%esi -.byte 143,232,120,194,250,13 - xorl %r8d,%r14d - addl %r13d,%edx - vpxor %xmm6,%xmm4,%xmm4 - xorl %r9d,%esi - addl %edx,%r11d - vpsrld $10,%xmm2,%xmm6 - rorl $2,%r14d - addl %esi,%edx - vpaddd %xmm4,%xmm3,%xmm3 - movl %r11d,%r13d - addl %edx,%r14d -.byte 143,232,120,194,239,2 - rorl $14,%r13d - movl %r14d,%edx - vpxor %xmm6,%xmm7,%xmm7 - movl %eax,%r12d - xorl %r11d,%r13d - rorl $9,%r14d - xorl %ebx,%r12d - vpxor %xmm5,%xmm7,%xmm7 - rorl $5,%r13d - xorl %edx,%r14d - andl %r11d,%r12d - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 208-128(%rdi),%xmm10 - xorl %r11d,%r13d - vpsrldq $8,%xmm7,%xmm7 - addl 52(%rsp),%ecx - movl %edx,%esi - rorl $11,%r14d - xorl %ebx,%r12d - vpaddd %xmm7,%xmm3,%xmm3 - xorl %r8d,%esi - rorl $6,%r13d - addl %r12d,%ecx - andl %esi,%r15d -.byte 143,232,120,194,251,13 - xorl %edx,%r14d - addl %r13d,%ecx - vpsrld $10,%xmm3,%xmm6 - xorl %r8d,%r15d - addl %ecx,%r10d -.byte 143,232,120,194,239,2 - rorl $2,%r14d - addl %r15d,%ecx - vpxor %xmm6,%xmm7,%xmm7 - movl %r10d,%r13d - addl %ecx,%r14d - rorl $14,%r13d - movl %r14d,%ecx - vpxor %xmm5,%xmm7,%xmm7 - movl %r11d,%r12d - xorl %r10d,%r13d - rorl $9,%r14d - xorl %eax,%r12d - vpslldq $8,%xmm7,%xmm7 - rorl $5,%r13d - xorl %ecx,%r14d - andl %r10d,%r12d - vpand %xmm13,%xmm11,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 224-128(%rdi),%xmm10 - xorl %r10d,%r13d - vpaddd %xmm7,%xmm3,%xmm3 - addl 56(%rsp),%ebx - movl %ecx,%r15d - rorl $11,%r14d - xorl %eax,%r12d - vpaddd 96(%rbp),%xmm3,%xmm6 - xorl %edx,%r15d - rorl $6,%r13d - addl %r12d,%ebx - andl %r15d,%esi - xorl %ecx,%r14d - addl %r13d,%ebx - xorl %edx,%esi - addl %ebx,%r9d - rorl $2,%r14d - addl %esi,%ebx - movl %r9d,%r13d - addl %ebx,%r14d - rorl $14,%r13d - movl %r14d,%ebx - movl %r10d,%r12d - xorl %r9d,%r13d - rorl $9,%r14d - xorl %r11d,%r12d - rorl $5,%r13d - xorl %ebx,%r14d - andl %r9d,%r12d - vpor %xmm11,%xmm8,%xmm8 - vaesenclast %xmm10,%xmm9,%xmm11 - vmovdqu 0-128(%rdi),%xmm10 - xorl %r9d,%r13d - addl 60(%rsp),%eax - movl %ebx,%esi - rorl $11,%r14d - xorl %r11d,%r12d - xorl %ecx,%esi - rorl $6,%r13d - addl %r12d,%eax - andl %esi,%r15d - xorl %ebx,%r14d - addl %r13d,%eax - xorl %ecx,%r15d - addl %eax,%r8d - rorl $2,%r14d - addl %r15d,%eax - movl %r8d,%r13d - addl %eax,%r14d - vmovdqa %xmm6,48(%rsp) - movq 64+0(%rsp),%r12 - vpand %xmm14,%xmm11,%xmm11 - movq 64+8(%rsp),%r15 - vpor %xmm11,%xmm8,%xmm8 - vmovdqu %xmm8,(%r15,%r12,1) - leaq 16(%r12),%r12 - cmpb $0,131(%rbp) - jne .Lxop_00_47 - vmovdqu (%r12),%xmm9 - movq %r12,64+0(%rsp) - rorl $14,%r13d - movl %r14d,%eax - movl %r9d,%r12d - xorl %r8d,%r13d - rorl $9,%r14d - xorl %r10d,%r12d - rorl $5,%r13d - xorl %eax,%r14d - andl %r8d,%r12d - vpxor %xmm10,%xmm9,%xmm9 - vmovdqu 16-128(%rdi),%xmm10 - xorl %r8d,%r13d - addl 0(%rsp),%r11d - movl %eax,%r15d - rorl $11,%r14d - xorl %r10d,%r12d - xorl %ebx,%r15d - rorl $6,%r13d - addl %r12d,%r11d - andl %r15d,%esi - xorl %eax,%r14d - addl %r13d,%r11d - xorl %ebx,%esi - addl %r11d,%edx - rorl $2,%r14d - addl %esi,%r11d - movl %edx,%r13d - addl %r11d,%r14d - rorl $14,%r13d - movl %r14d,%r11d - movl %r8d,%r12d - xorl %edx,%r13d - rorl $9,%r14d - xorl %r9d,%r12d - rorl $5,%r13d - xorl %r11d,%r14d - andl %edx,%r12d - vpxor %xmm8,%xmm9,%xmm9 - xorl %edx,%r13d - addl 4(%rsp),%r10d - movl %r11d,%esi - rorl $11,%r14d - xorl %r9d,%r12d - xorl %eax,%esi - rorl $6,%r13d - addl %r12d,%r10d - andl %esi,%r15d - xorl %r11d,%r14d - addl %r13d,%r10d - xorl %eax,%r15d - addl %r10d,%ecx - rorl $2,%r14d - addl %r15d,%r10d - movl %ecx,%r13d - addl %r10d,%r14d - rorl $14,%r13d - movl %r14d,%r10d - movl %edx,%r12d - xorl %ecx,%r13d - rorl $9,%r14d - xorl %r8d,%r12d - rorl $5,%r13d - xorl %r10d,%r14d - andl %ecx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 32-128(%rdi),%xmm10 - xorl %ecx,%r13d - addl 8(%rsp),%r9d - movl %r10d,%r15d - rorl $11,%r14d - xorl %r8d,%r12d - xorl %r11d,%r15d - rorl $6,%r13d - addl %r12d,%r9d - andl %r15d,%esi - xorl %r10d,%r14d - addl %r13d,%r9d - xorl %r11d,%esi - addl %r9d,%ebx - rorl $2,%r14d - addl %esi,%r9d - movl %ebx,%r13d - addl %r9d,%r14d - rorl $14,%r13d - movl %r14d,%r9d - movl %ecx,%r12d - xorl %ebx,%r13d - rorl $9,%r14d - xorl %edx,%r12d - rorl $5,%r13d - xorl %r9d,%r14d - andl %ebx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 48-128(%rdi),%xmm10 - xorl %ebx,%r13d - addl 12(%rsp),%r8d - movl %r9d,%esi - rorl $11,%r14d - xorl %edx,%r12d - xorl %r10d,%esi - rorl $6,%r13d - addl %r12d,%r8d - andl %esi,%r15d - xorl %r9d,%r14d - addl %r13d,%r8d - xorl %r10d,%r15d - addl %r8d,%eax - rorl $2,%r14d - addl %r15d,%r8d - movl %eax,%r13d - addl %r8d,%r14d - rorl $14,%r13d - movl %r14d,%r8d - movl %ebx,%r12d - xorl %eax,%r13d - rorl $9,%r14d - xorl %ecx,%r12d - rorl $5,%r13d - xorl %r8d,%r14d - andl %eax,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 64-128(%rdi),%xmm10 - xorl %eax,%r13d - addl 16(%rsp),%edx - movl %r8d,%r15d - rorl $11,%r14d - xorl %ecx,%r12d - xorl %r9d,%r15d - rorl $6,%r13d - addl %r12d,%edx - andl %r15d,%esi - xorl %r8d,%r14d - addl %r13d,%edx - xorl %r9d,%esi - addl %edx,%r11d - rorl $2,%r14d - addl %esi,%edx - movl %r11d,%r13d - addl %edx,%r14d - rorl $14,%r13d - movl %r14d,%edx - movl %eax,%r12d - xorl %r11d,%r13d - rorl $9,%r14d - xorl %ebx,%r12d - rorl $5,%r13d - xorl %edx,%r14d - andl %r11d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 80-128(%rdi),%xmm10 - xorl %r11d,%r13d - addl 20(%rsp),%ecx - movl %edx,%esi - rorl $11,%r14d - xorl %ebx,%r12d - xorl %r8d,%esi - rorl $6,%r13d - addl %r12d,%ecx - andl %esi,%r15d - xorl %edx,%r14d - addl %r13d,%ecx - xorl %r8d,%r15d - addl %ecx,%r10d - rorl $2,%r14d - addl %r15d,%ecx - movl %r10d,%r13d - addl %ecx,%r14d - rorl $14,%r13d - movl %r14d,%ecx - movl %r11d,%r12d - xorl %r10d,%r13d - rorl $9,%r14d - xorl %eax,%r12d - rorl $5,%r13d - xorl %ecx,%r14d - andl %r10d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 96-128(%rdi),%xmm10 - xorl %r10d,%r13d - addl 24(%rsp),%ebx - movl %ecx,%r15d - rorl $11,%r14d - xorl %eax,%r12d - xorl %edx,%r15d - rorl $6,%r13d - addl %r12d,%ebx - andl %r15d,%esi - xorl %ecx,%r14d - addl %r13d,%ebx - xorl %edx,%esi - addl %ebx,%r9d - rorl $2,%r14d - addl %esi,%ebx - movl %r9d,%r13d - addl %ebx,%r14d - rorl $14,%r13d - movl %r14d,%ebx - movl %r10d,%r12d - xorl %r9d,%r13d - rorl $9,%r14d - xorl %r11d,%r12d - rorl $5,%r13d - xorl %ebx,%r14d - andl %r9d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 112-128(%rdi),%xmm10 - xorl %r9d,%r13d - addl 28(%rsp),%eax - movl %ebx,%esi - rorl $11,%r14d - xorl %r11d,%r12d - xorl %ecx,%esi - rorl $6,%r13d - addl %r12d,%eax - andl %esi,%r15d - xorl %ebx,%r14d - addl %r13d,%eax - xorl %ecx,%r15d - addl %eax,%r8d - rorl $2,%r14d - addl %r15d,%eax - movl %r8d,%r13d - addl %eax,%r14d - rorl $14,%r13d - movl %r14d,%eax - movl %r9d,%r12d - xorl %r8d,%r13d - rorl $9,%r14d - xorl %r10d,%r12d - rorl $5,%r13d - xorl %eax,%r14d - andl %r8d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 128-128(%rdi),%xmm10 - xorl %r8d,%r13d - addl 32(%rsp),%r11d - movl %eax,%r15d - rorl $11,%r14d - xorl %r10d,%r12d - xorl %ebx,%r15d - rorl $6,%r13d - addl %r12d,%r11d - andl %r15d,%esi - xorl %eax,%r14d - addl %r13d,%r11d - xorl %ebx,%esi - addl %r11d,%edx - rorl $2,%r14d - addl %esi,%r11d - movl %edx,%r13d - addl %r11d,%r14d - rorl $14,%r13d - movl %r14d,%r11d - movl %r8d,%r12d - xorl %edx,%r13d - rorl $9,%r14d - xorl %r9d,%r12d - rorl $5,%r13d - xorl %r11d,%r14d - andl %edx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 144-128(%rdi),%xmm10 - xorl %edx,%r13d - addl 36(%rsp),%r10d - movl %r11d,%esi - rorl $11,%r14d - xorl %r9d,%r12d - xorl %eax,%esi - rorl $6,%r13d - addl %r12d,%r10d - andl %esi,%r15d - xorl %r11d,%r14d - addl %r13d,%r10d - xorl %eax,%r15d - addl %r10d,%ecx - rorl $2,%r14d - addl %r15d,%r10d - movl %ecx,%r13d - addl %r10d,%r14d - rorl $14,%r13d - movl %r14d,%r10d - movl %edx,%r12d - xorl %ecx,%r13d - rorl $9,%r14d - xorl %r8d,%r12d - rorl $5,%r13d - xorl %r10d,%r14d - andl %ecx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 160-128(%rdi),%xmm10 - xorl %ecx,%r13d - addl 40(%rsp),%r9d - movl %r10d,%r15d - rorl $11,%r14d - xorl %r8d,%r12d - xorl %r11d,%r15d - rorl $6,%r13d - addl %r12d,%r9d - andl %r15d,%esi - xorl %r10d,%r14d - addl %r13d,%r9d - xorl %r11d,%esi - addl %r9d,%ebx - rorl $2,%r14d - addl %esi,%r9d - movl %ebx,%r13d - addl %r9d,%r14d - rorl $14,%r13d - movl %r14d,%r9d - movl %ecx,%r12d - xorl %ebx,%r13d - rorl $9,%r14d - xorl %edx,%r12d - rorl $5,%r13d - xorl %r9d,%r14d - andl %ebx,%r12d - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 176-128(%rdi),%xmm10 - xorl %ebx,%r13d - addl 44(%rsp),%r8d - movl %r9d,%esi - rorl $11,%r14d - xorl %edx,%r12d - xorl %r10d,%esi - rorl $6,%r13d - addl %r12d,%r8d - andl %esi,%r15d - xorl %r9d,%r14d - addl %r13d,%r8d - xorl %r10d,%r15d - addl %r8d,%eax - rorl $2,%r14d - addl %r15d,%r8d - movl %eax,%r13d - addl %r8d,%r14d - rorl $14,%r13d - movl %r14d,%r8d - movl %ebx,%r12d - xorl %eax,%r13d - rorl $9,%r14d - xorl %ecx,%r12d - rorl $5,%r13d - xorl %r8d,%r14d - andl %eax,%r12d - vpand %xmm12,%xmm11,%xmm8 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 192-128(%rdi),%xmm10 - xorl %eax,%r13d - addl 48(%rsp),%edx - movl %r8d,%r15d - rorl $11,%r14d - xorl %ecx,%r12d - xorl %r9d,%r15d - rorl $6,%r13d - addl %r12d,%edx - andl %r15d,%esi - xorl %r8d,%r14d - addl %r13d,%edx - xorl %r9d,%esi - addl %edx,%r11d - rorl $2,%r14d - addl %esi,%edx - movl %r11d,%r13d - addl %edx,%r14d - rorl $14,%r13d - movl %r14d,%edx - movl %eax,%r12d - xorl %r11d,%r13d - rorl $9,%r14d - xorl %ebx,%r12d - rorl $5,%r13d - xorl %edx,%r14d - andl %r11d,%r12d - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 208-128(%rdi),%xmm10 - xorl %r11d,%r13d - addl 52(%rsp),%ecx - movl %edx,%esi - rorl $11,%r14d - xorl %ebx,%r12d - xorl %r8d,%esi - rorl $6,%r13d - addl %r12d,%ecx - andl %esi,%r15d - xorl %edx,%r14d - addl %r13d,%ecx - xorl %r8d,%r15d - addl %ecx,%r10d - rorl $2,%r14d - addl %r15d,%ecx - movl %r10d,%r13d - addl %ecx,%r14d - rorl $14,%r13d - movl %r14d,%ecx - movl %r11d,%r12d - xorl %r10d,%r13d - rorl $9,%r14d - xorl %eax,%r12d - rorl $5,%r13d - xorl %ecx,%r14d - andl %r10d,%r12d - vpand %xmm13,%xmm11,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 224-128(%rdi),%xmm10 - xorl %r10d,%r13d - addl 56(%rsp),%ebx - movl %ecx,%r15d - rorl $11,%r14d - xorl %eax,%r12d - xorl %edx,%r15d - rorl $6,%r13d - addl %r12d,%ebx - andl %r15d,%esi - xorl %ecx,%r14d - addl %r13d,%ebx - xorl %edx,%esi - addl %ebx,%r9d - rorl $2,%r14d - addl %esi,%ebx - movl %r9d,%r13d - addl %ebx,%r14d - rorl $14,%r13d - movl %r14d,%ebx - movl %r10d,%r12d - xorl %r9d,%r13d - rorl $9,%r14d - xorl %r11d,%r12d - rorl $5,%r13d - xorl %ebx,%r14d - andl %r9d,%r12d - vpor %xmm11,%xmm8,%xmm8 - vaesenclast %xmm10,%xmm9,%xmm11 - vmovdqu 0-128(%rdi),%xmm10 - xorl %r9d,%r13d - addl 60(%rsp),%eax - movl %ebx,%esi - rorl $11,%r14d - xorl %r11d,%r12d - xorl %ecx,%esi - rorl $6,%r13d - addl %r12d,%eax - andl %esi,%r15d - xorl %ebx,%r14d - addl %r13d,%eax - xorl %ecx,%r15d - addl %eax,%r8d - rorl $2,%r14d - addl %r15d,%eax - movl %r8d,%r13d - addl %eax,%r14d - movq 64+0(%rsp),%r12 - movq 64+8(%rsp),%r13 - movq 64+40(%rsp),%r15 - movq 64+48(%rsp),%rsi - - vpand %xmm14,%xmm11,%xmm11 - movl %r14d,%eax - vpor %xmm11,%xmm8,%xmm8 - vmovdqu %xmm8,(%r12,%r13,1) - leaq 16(%r12),%r12 - - addl 0(%r15),%eax - addl 4(%r15),%ebx - addl 8(%r15),%ecx - addl 12(%r15),%edx - addl 16(%r15),%r8d - addl 20(%r15),%r9d - addl 24(%r15),%r10d - addl 28(%r15),%r11d - - cmpq 64+16(%rsp),%r12 - - movl %eax,0(%r15) - movl %ebx,4(%r15) - movl %ecx,8(%r15) - movl %edx,12(%r15) - movl %r8d,16(%r15) - movl %r9d,20(%r15) - movl %r10d,24(%r15) - movl %r11d,28(%r15) - - jb .Lloop_xop - - movq 64+32(%rsp),%r8 - movq 64+56(%rsp),%rsi - vmovdqu %xmm8,(%r8) - vzeroall - movq (%rsi),%r15 - movq 8(%rsi),%r14 - movq 16(%rsi),%r13 - movq 24(%rsi),%r12 - movq 32(%rsi),%rbp - movq 40(%rsi),%rbx - leaq 48(%rsi),%rsp -.Lepilogue_xop: - .byte 0xf3,0xc3 -.size aesni_cbc_sha256_enc_xop,.-aesni_cbc_sha256_enc_xop -.type aesni_cbc_sha256_enc_avx,@function -.align 64 -aesni_cbc_sha256_enc_avx: -.Lavx_shortcut: - movq 8(%rsp),%r10 - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - movq %rsp,%r11 - subq $128,%rsp - andq $-64,%rsp - - shlq $6,%rdx - subq %rdi,%rsi - subq %rdi,%r10 - addq %rdi,%rdx - - - movq %rsi,64+8(%rsp) - movq %rdx,64+16(%rsp) - - movq %r8,64+32(%rsp) - movq %r9,64+40(%rsp) - movq %r10,64+48(%rsp) - movq %r11,64+56(%rsp) -.Lprologue_avx: - vzeroall - - movq %rdi,%r12 - leaq 128(%rcx),%rdi - leaq K256+544(%rip),%r13 - movl 240-128(%rdi),%r14d - movq %r9,%r15 - movq %r10,%rsi - vmovdqu (%r8),%xmm8 - subq $9,%r14 - - movl 0(%r15),%eax - movl 4(%r15),%ebx - movl 8(%r15),%ecx - movl 12(%r15),%edx - movl 16(%r15),%r8d - movl 20(%r15),%r9d - movl 24(%r15),%r10d - movl 28(%r15),%r11d - - vmovdqa 0(%r13,%r14,8),%xmm14 - vmovdqa 16(%r13,%r14,8),%xmm13 - vmovdqa 32(%r13,%r14,8),%xmm12 - vmovdqu 0-128(%rdi),%xmm10 - jmp .Lloop_avx -.align 16 -.Lloop_avx: - vmovdqa K256+512(%rip),%xmm7 - vmovdqu 0(%rsi,%r12,1),%xmm0 - vmovdqu 16(%rsi,%r12,1),%xmm1 - vmovdqu 32(%rsi,%r12,1),%xmm2 - vmovdqu 48(%rsi,%r12,1),%xmm3 - vpshufb %xmm7,%xmm0,%xmm0 - leaq K256(%rip),%rbp - vpshufb %xmm7,%xmm1,%xmm1 - vpshufb %xmm7,%xmm2,%xmm2 - vpaddd 0(%rbp),%xmm0,%xmm4 - vpshufb %xmm7,%xmm3,%xmm3 - vpaddd 32(%rbp),%xmm1,%xmm5 - vpaddd 64(%rbp),%xmm2,%xmm6 - vpaddd 96(%rbp),%xmm3,%xmm7 - vmovdqa %xmm4,0(%rsp) - movl %eax,%r14d - vmovdqa %xmm5,16(%rsp) - movl %ebx,%esi - vmovdqa %xmm6,32(%rsp) - xorl %ecx,%esi - vmovdqa %xmm7,48(%rsp) - movl %r8d,%r13d - jmp .Lavx_00_47 - -.align 16 -.Lavx_00_47: - subq $-32*4,%rbp - vmovdqu (%r12),%xmm9 - movq %r12,64+0(%rsp) - vpalignr $4,%xmm0,%xmm1,%xmm4 - shrdl $14,%r13d,%r13d - movl %r14d,%eax - movl %r9d,%r12d - vpalignr $4,%xmm2,%xmm3,%xmm7 - xorl %r8d,%r13d - shrdl $9,%r14d,%r14d - xorl %r10d,%r12d - vpsrld $7,%xmm4,%xmm6 - shrdl $5,%r13d,%r13d - xorl %eax,%r14d - andl %r8d,%r12d - vpaddd %xmm7,%xmm0,%xmm0 - vpxor %xmm10,%xmm9,%xmm9 - vmovdqu 16-128(%rdi),%xmm10 - xorl %r8d,%r13d - addl 0(%rsp),%r11d - movl %eax,%r15d - vpsrld $3,%xmm4,%xmm7 - shrdl $11,%r14d,%r14d - xorl %r10d,%r12d - xorl %ebx,%r15d - vpslld $14,%xmm4,%xmm5 - shrdl $6,%r13d,%r13d - addl %r12d,%r11d - andl %r15d,%esi - vpxor %xmm6,%xmm7,%xmm4 - xorl %eax,%r14d - addl %r13d,%r11d - xorl %ebx,%esi - vpshufd $250,%xmm3,%xmm7 - addl %r11d,%edx - shrdl $2,%r14d,%r14d - addl %esi,%r11d - vpsrld $11,%xmm6,%xmm6 - movl %edx,%r13d - addl %r11d,%r14d - shrdl $14,%r13d,%r13d - vpxor %xmm5,%xmm4,%xmm4 - movl %r14d,%r11d - movl %r8d,%r12d - xorl %edx,%r13d - vpslld $11,%xmm5,%xmm5 - shrdl $9,%r14d,%r14d - xorl %r9d,%r12d - shrdl $5,%r13d,%r13d - vpxor %xmm6,%xmm4,%xmm4 - xorl %r11d,%r14d - andl %edx,%r12d - vpxor %xmm8,%xmm9,%xmm9 - xorl %edx,%r13d - vpsrld $10,%xmm7,%xmm6 - addl 4(%rsp),%r10d - movl %r11d,%esi - shrdl $11,%r14d,%r14d - vpxor %xmm5,%xmm4,%xmm4 - xorl %r9d,%r12d - xorl %eax,%esi - shrdl $6,%r13d,%r13d - vpsrlq $17,%xmm7,%xmm7 - addl %r12d,%r10d - andl %esi,%r15d - xorl %r11d,%r14d - vpaddd %xmm4,%xmm0,%xmm0 - addl %r13d,%r10d - xorl %eax,%r15d - addl %r10d,%ecx - vpxor %xmm7,%xmm6,%xmm6 - shrdl $2,%r14d,%r14d - addl %r15d,%r10d - movl %ecx,%r13d - vpsrlq $2,%xmm7,%xmm7 - addl %r10d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r10d - vpxor %xmm7,%xmm6,%xmm6 - movl %edx,%r12d - xorl %ecx,%r13d - shrdl $9,%r14d,%r14d - vpshufd $132,%xmm6,%xmm6 - xorl %r8d,%r12d - shrdl $5,%r13d,%r13d - xorl %r10d,%r14d - vpsrldq $8,%xmm6,%xmm6 - andl %ecx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 32-128(%rdi),%xmm10 - xorl %ecx,%r13d - addl 8(%rsp),%r9d - vpaddd %xmm6,%xmm0,%xmm0 - movl %r10d,%r15d - shrdl $11,%r14d,%r14d - xorl %r8d,%r12d - vpshufd $80,%xmm0,%xmm7 - xorl %r11d,%r15d - shrdl $6,%r13d,%r13d - addl %r12d,%r9d - vpsrld $10,%xmm7,%xmm6 - andl %r15d,%esi - xorl %r10d,%r14d - addl %r13d,%r9d - vpsrlq $17,%xmm7,%xmm7 - xorl %r11d,%esi - addl %r9d,%ebx - shrdl $2,%r14d,%r14d - vpxor %xmm7,%xmm6,%xmm6 - addl %esi,%r9d - movl %ebx,%r13d - addl %r9d,%r14d - vpsrlq $2,%xmm7,%xmm7 - shrdl $14,%r13d,%r13d - movl %r14d,%r9d - movl %ecx,%r12d - vpxor %xmm7,%xmm6,%xmm6 - xorl %ebx,%r13d - shrdl $9,%r14d,%r14d - xorl %edx,%r12d - vpshufd $232,%xmm6,%xmm6 - shrdl $5,%r13d,%r13d - xorl %r9d,%r14d - andl %ebx,%r12d - vpslldq $8,%xmm6,%xmm6 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 48-128(%rdi),%xmm10 - xorl %ebx,%r13d - addl 12(%rsp),%r8d - movl %r9d,%esi - vpaddd %xmm6,%xmm0,%xmm0 - shrdl $11,%r14d,%r14d - xorl %edx,%r12d - xorl %r10d,%esi - vpaddd 0(%rbp),%xmm0,%xmm6 - shrdl $6,%r13d,%r13d - addl %r12d,%r8d - andl %esi,%r15d - xorl %r9d,%r14d - addl %r13d,%r8d - xorl %r10d,%r15d - addl %r8d,%eax - shrdl $2,%r14d,%r14d - addl %r15d,%r8d - movl %eax,%r13d - addl %r8d,%r14d - vmovdqa %xmm6,0(%rsp) - vpalignr $4,%xmm1,%xmm2,%xmm4 - shrdl $14,%r13d,%r13d - movl %r14d,%r8d - movl %ebx,%r12d - vpalignr $4,%xmm3,%xmm0,%xmm7 - xorl %eax,%r13d - shrdl $9,%r14d,%r14d - xorl %ecx,%r12d - vpsrld $7,%xmm4,%xmm6 - shrdl $5,%r13d,%r13d - xorl %r8d,%r14d - andl %eax,%r12d - vpaddd %xmm7,%xmm1,%xmm1 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 64-128(%rdi),%xmm10 - xorl %eax,%r13d - addl 16(%rsp),%edx - movl %r8d,%r15d - vpsrld $3,%xmm4,%xmm7 - shrdl $11,%r14d,%r14d - xorl %ecx,%r12d - xorl %r9d,%r15d - vpslld $14,%xmm4,%xmm5 - shrdl $6,%r13d,%r13d - addl %r12d,%edx - andl %r15d,%esi - vpxor %xmm6,%xmm7,%xmm4 - xorl %r8d,%r14d - addl %r13d,%edx - xorl %r9d,%esi - vpshufd $250,%xmm0,%xmm7 - addl %edx,%r11d - shrdl $2,%r14d,%r14d - addl %esi,%edx - vpsrld $11,%xmm6,%xmm6 - movl %r11d,%r13d - addl %edx,%r14d - shrdl $14,%r13d,%r13d - vpxor %xmm5,%xmm4,%xmm4 - movl %r14d,%edx - movl %eax,%r12d - xorl %r11d,%r13d - vpslld $11,%xmm5,%xmm5 - shrdl $9,%r14d,%r14d - xorl %ebx,%r12d - shrdl $5,%r13d,%r13d - vpxor %xmm6,%xmm4,%xmm4 - xorl %edx,%r14d - andl %r11d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 80-128(%rdi),%xmm10 - xorl %r11d,%r13d - vpsrld $10,%xmm7,%xmm6 - addl 20(%rsp),%ecx - movl %edx,%esi - shrdl $11,%r14d,%r14d - vpxor %xmm5,%xmm4,%xmm4 - xorl %ebx,%r12d - xorl %r8d,%esi - shrdl $6,%r13d,%r13d - vpsrlq $17,%xmm7,%xmm7 - addl %r12d,%ecx - andl %esi,%r15d - xorl %edx,%r14d - vpaddd %xmm4,%xmm1,%xmm1 - addl %r13d,%ecx - xorl %r8d,%r15d - addl %ecx,%r10d - vpxor %xmm7,%xmm6,%xmm6 - shrdl $2,%r14d,%r14d - addl %r15d,%ecx - movl %r10d,%r13d - vpsrlq $2,%xmm7,%xmm7 - addl %ecx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%ecx - vpxor %xmm7,%xmm6,%xmm6 - movl %r11d,%r12d - xorl %r10d,%r13d - shrdl $9,%r14d,%r14d - vpshufd $132,%xmm6,%xmm6 - xorl %eax,%r12d - shrdl $5,%r13d,%r13d - xorl %ecx,%r14d - vpsrldq $8,%xmm6,%xmm6 - andl %r10d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 96-128(%rdi),%xmm10 - xorl %r10d,%r13d - addl 24(%rsp),%ebx - vpaddd %xmm6,%xmm1,%xmm1 - movl %ecx,%r15d - shrdl $11,%r14d,%r14d - xorl %eax,%r12d - vpshufd $80,%xmm1,%xmm7 - xorl %edx,%r15d - shrdl $6,%r13d,%r13d - addl %r12d,%ebx - vpsrld $10,%xmm7,%xmm6 - andl %r15d,%esi - xorl %ecx,%r14d - addl %r13d,%ebx - vpsrlq $17,%xmm7,%xmm7 - xorl %edx,%esi - addl %ebx,%r9d - shrdl $2,%r14d,%r14d - vpxor %xmm7,%xmm6,%xmm6 - addl %esi,%ebx - movl %r9d,%r13d - addl %ebx,%r14d - vpsrlq $2,%xmm7,%xmm7 - shrdl $14,%r13d,%r13d - movl %r14d,%ebx - movl %r10d,%r12d - vpxor %xmm7,%xmm6,%xmm6 - xorl %r9d,%r13d - shrdl $9,%r14d,%r14d - xorl %r11d,%r12d - vpshufd $232,%xmm6,%xmm6 - shrdl $5,%r13d,%r13d - xorl %ebx,%r14d - andl %r9d,%r12d - vpslldq $8,%xmm6,%xmm6 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 112-128(%rdi),%xmm10 - xorl %r9d,%r13d - addl 28(%rsp),%eax - movl %ebx,%esi - vpaddd %xmm6,%xmm1,%xmm1 - shrdl $11,%r14d,%r14d - xorl %r11d,%r12d - xorl %ecx,%esi - vpaddd 32(%rbp),%xmm1,%xmm6 - shrdl $6,%r13d,%r13d - addl %r12d,%eax - andl %esi,%r15d - xorl %ebx,%r14d - addl %r13d,%eax - xorl %ecx,%r15d - addl %eax,%r8d - shrdl $2,%r14d,%r14d - addl %r15d,%eax - movl %r8d,%r13d - addl %eax,%r14d - vmovdqa %xmm6,16(%rsp) - vpalignr $4,%xmm2,%xmm3,%xmm4 - shrdl $14,%r13d,%r13d - movl %r14d,%eax - movl %r9d,%r12d - vpalignr $4,%xmm0,%xmm1,%xmm7 - xorl %r8d,%r13d - shrdl $9,%r14d,%r14d - xorl %r10d,%r12d - vpsrld $7,%xmm4,%xmm6 - shrdl $5,%r13d,%r13d - xorl %eax,%r14d - andl %r8d,%r12d - vpaddd %xmm7,%xmm2,%xmm2 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 128-128(%rdi),%xmm10 - xorl %r8d,%r13d - addl 32(%rsp),%r11d - movl %eax,%r15d - vpsrld $3,%xmm4,%xmm7 - shrdl $11,%r14d,%r14d - xorl %r10d,%r12d - xorl %ebx,%r15d - vpslld $14,%xmm4,%xmm5 - shrdl $6,%r13d,%r13d - addl %r12d,%r11d - andl %r15d,%esi - vpxor %xmm6,%xmm7,%xmm4 - xorl %eax,%r14d - addl %r13d,%r11d - xorl %ebx,%esi - vpshufd $250,%xmm1,%xmm7 - addl %r11d,%edx - shrdl $2,%r14d,%r14d - addl %esi,%r11d - vpsrld $11,%xmm6,%xmm6 - movl %edx,%r13d - addl %r11d,%r14d - shrdl $14,%r13d,%r13d - vpxor %xmm5,%xmm4,%xmm4 - movl %r14d,%r11d - movl %r8d,%r12d - xorl %edx,%r13d - vpslld $11,%xmm5,%xmm5 - shrdl $9,%r14d,%r14d - xorl %r9d,%r12d - shrdl $5,%r13d,%r13d - vpxor %xmm6,%xmm4,%xmm4 - xorl %r11d,%r14d - andl %edx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 144-128(%rdi),%xmm10 - xorl %edx,%r13d - vpsrld $10,%xmm7,%xmm6 - addl 36(%rsp),%r10d - movl %r11d,%esi - shrdl $11,%r14d,%r14d - vpxor %xmm5,%xmm4,%xmm4 - xorl %r9d,%r12d - xorl %eax,%esi - shrdl $6,%r13d,%r13d - vpsrlq $17,%xmm7,%xmm7 - addl %r12d,%r10d - andl %esi,%r15d - xorl %r11d,%r14d - vpaddd %xmm4,%xmm2,%xmm2 - addl %r13d,%r10d - xorl %eax,%r15d - addl %r10d,%ecx - vpxor %xmm7,%xmm6,%xmm6 - shrdl $2,%r14d,%r14d - addl %r15d,%r10d - movl %ecx,%r13d - vpsrlq $2,%xmm7,%xmm7 - addl %r10d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r10d - vpxor %xmm7,%xmm6,%xmm6 - movl %edx,%r12d - xorl %ecx,%r13d - shrdl $9,%r14d,%r14d - vpshufd $132,%xmm6,%xmm6 - xorl %r8d,%r12d - shrdl $5,%r13d,%r13d - xorl %r10d,%r14d - vpsrldq $8,%xmm6,%xmm6 - andl %ecx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 160-128(%rdi),%xmm10 - xorl %ecx,%r13d - addl 40(%rsp),%r9d - vpaddd %xmm6,%xmm2,%xmm2 - movl %r10d,%r15d - shrdl $11,%r14d,%r14d - xorl %r8d,%r12d - vpshufd $80,%xmm2,%xmm7 - xorl %r11d,%r15d - shrdl $6,%r13d,%r13d - addl %r12d,%r9d - vpsrld $10,%xmm7,%xmm6 - andl %r15d,%esi - xorl %r10d,%r14d - addl %r13d,%r9d - vpsrlq $17,%xmm7,%xmm7 - xorl %r11d,%esi - addl %r9d,%ebx - shrdl $2,%r14d,%r14d - vpxor %xmm7,%xmm6,%xmm6 - addl %esi,%r9d - movl %ebx,%r13d - addl %r9d,%r14d - vpsrlq $2,%xmm7,%xmm7 - shrdl $14,%r13d,%r13d - movl %r14d,%r9d - movl %ecx,%r12d - vpxor %xmm7,%xmm6,%xmm6 - xorl %ebx,%r13d - shrdl $9,%r14d,%r14d - xorl %edx,%r12d - vpshufd $232,%xmm6,%xmm6 - shrdl $5,%r13d,%r13d - xorl %r9d,%r14d - andl %ebx,%r12d - vpslldq $8,%xmm6,%xmm6 - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 176-128(%rdi),%xmm10 - xorl %ebx,%r13d - addl 44(%rsp),%r8d - movl %r9d,%esi - vpaddd %xmm6,%xmm2,%xmm2 - shrdl $11,%r14d,%r14d - xorl %edx,%r12d - xorl %r10d,%esi - vpaddd 64(%rbp),%xmm2,%xmm6 - shrdl $6,%r13d,%r13d - addl %r12d,%r8d - andl %esi,%r15d - xorl %r9d,%r14d - addl %r13d,%r8d - xorl %r10d,%r15d - addl %r8d,%eax - shrdl $2,%r14d,%r14d - addl %r15d,%r8d - movl %eax,%r13d - addl %r8d,%r14d - vmovdqa %xmm6,32(%rsp) - vpalignr $4,%xmm3,%xmm0,%xmm4 - shrdl $14,%r13d,%r13d - movl %r14d,%r8d - movl %ebx,%r12d - vpalignr $4,%xmm1,%xmm2,%xmm7 - xorl %eax,%r13d - shrdl $9,%r14d,%r14d - xorl %ecx,%r12d - vpsrld $7,%xmm4,%xmm6 - shrdl $5,%r13d,%r13d - xorl %r8d,%r14d - andl %eax,%r12d - vpaddd %xmm7,%xmm3,%xmm3 - vpand %xmm12,%xmm11,%xmm8 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 192-128(%rdi),%xmm10 - xorl %eax,%r13d - addl 48(%rsp),%edx - movl %r8d,%r15d - vpsrld $3,%xmm4,%xmm7 - shrdl $11,%r14d,%r14d - xorl %ecx,%r12d - xorl %r9d,%r15d - vpslld $14,%xmm4,%xmm5 - shrdl $6,%r13d,%r13d - addl %r12d,%edx - andl %r15d,%esi - vpxor %xmm6,%xmm7,%xmm4 - xorl %r8d,%r14d - addl %r13d,%edx - xorl %r9d,%esi - vpshufd $250,%xmm2,%xmm7 - addl %edx,%r11d - shrdl $2,%r14d,%r14d - addl %esi,%edx - vpsrld $11,%xmm6,%xmm6 - movl %r11d,%r13d - addl %edx,%r14d - shrdl $14,%r13d,%r13d - vpxor %xmm5,%xmm4,%xmm4 - movl %r14d,%edx - movl %eax,%r12d - xorl %r11d,%r13d - vpslld $11,%xmm5,%xmm5 - shrdl $9,%r14d,%r14d - xorl %ebx,%r12d - shrdl $5,%r13d,%r13d - vpxor %xmm6,%xmm4,%xmm4 - xorl %edx,%r14d - andl %r11d,%r12d - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 208-128(%rdi),%xmm10 - xorl %r11d,%r13d - vpsrld $10,%xmm7,%xmm6 - addl 52(%rsp),%ecx - movl %edx,%esi - shrdl $11,%r14d,%r14d - vpxor %xmm5,%xmm4,%xmm4 - xorl %ebx,%r12d - xorl %r8d,%esi - shrdl $6,%r13d,%r13d - vpsrlq $17,%xmm7,%xmm7 - addl %r12d,%ecx - andl %esi,%r15d - xorl %edx,%r14d - vpaddd %xmm4,%xmm3,%xmm3 - addl %r13d,%ecx - xorl %r8d,%r15d - addl %ecx,%r10d - vpxor %xmm7,%xmm6,%xmm6 - shrdl $2,%r14d,%r14d - addl %r15d,%ecx - movl %r10d,%r13d - vpsrlq $2,%xmm7,%xmm7 - addl %ecx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%ecx - vpxor %xmm7,%xmm6,%xmm6 - movl %r11d,%r12d - xorl %r10d,%r13d - shrdl $9,%r14d,%r14d - vpshufd $132,%xmm6,%xmm6 - xorl %eax,%r12d - shrdl $5,%r13d,%r13d - xorl %ecx,%r14d - vpsrldq $8,%xmm6,%xmm6 - andl %r10d,%r12d - vpand %xmm13,%xmm11,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 224-128(%rdi),%xmm10 - xorl %r10d,%r13d - addl 56(%rsp),%ebx - vpaddd %xmm6,%xmm3,%xmm3 - movl %ecx,%r15d - shrdl $11,%r14d,%r14d - xorl %eax,%r12d - vpshufd $80,%xmm3,%xmm7 - xorl %edx,%r15d - shrdl $6,%r13d,%r13d - addl %r12d,%ebx - vpsrld $10,%xmm7,%xmm6 - andl %r15d,%esi - xorl %ecx,%r14d - addl %r13d,%ebx - vpsrlq $17,%xmm7,%xmm7 - xorl %edx,%esi - addl %ebx,%r9d - shrdl $2,%r14d,%r14d - vpxor %xmm7,%xmm6,%xmm6 - addl %esi,%ebx - movl %r9d,%r13d - addl %ebx,%r14d - vpsrlq $2,%xmm7,%xmm7 - shrdl $14,%r13d,%r13d - movl %r14d,%ebx - movl %r10d,%r12d - vpxor %xmm7,%xmm6,%xmm6 - xorl %r9d,%r13d - shrdl $9,%r14d,%r14d - xorl %r11d,%r12d - vpshufd $232,%xmm6,%xmm6 - shrdl $5,%r13d,%r13d - xorl %ebx,%r14d - andl %r9d,%r12d - vpslldq $8,%xmm6,%xmm6 - vpor %xmm11,%xmm8,%xmm8 - vaesenclast %xmm10,%xmm9,%xmm11 - vmovdqu 0-128(%rdi),%xmm10 - xorl %r9d,%r13d - addl 60(%rsp),%eax - movl %ebx,%esi - vpaddd %xmm6,%xmm3,%xmm3 - shrdl $11,%r14d,%r14d - xorl %r11d,%r12d - xorl %ecx,%esi - vpaddd 96(%rbp),%xmm3,%xmm6 - shrdl $6,%r13d,%r13d - addl %r12d,%eax - andl %esi,%r15d - xorl %ebx,%r14d - addl %r13d,%eax - xorl %ecx,%r15d - addl %eax,%r8d - shrdl $2,%r14d,%r14d - addl %r15d,%eax - movl %r8d,%r13d - addl %eax,%r14d - vmovdqa %xmm6,48(%rsp) - movq 64+0(%rsp),%r12 - vpand %xmm14,%xmm11,%xmm11 - movq 64+8(%rsp),%r15 - vpor %xmm11,%xmm8,%xmm8 - vmovdqu %xmm8,(%r15,%r12,1) - leaq 16(%r12),%r12 - cmpb $0,131(%rbp) - jne .Lavx_00_47 - vmovdqu (%r12),%xmm9 - movq %r12,64+0(%rsp) - shrdl $14,%r13d,%r13d - movl %r14d,%eax - movl %r9d,%r12d - xorl %r8d,%r13d - shrdl $9,%r14d,%r14d - xorl %r10d,%r12d - shrdl $5,%r13d,%r13d - xorl %eax,%r14d - andl %r8d,%r12d - vpxor %xmm10,%xmm9,%xmm9 - vmovdqu 16-128(%rdi),%xmm10 - xorl %r8d,%r13d - addl 0(%rsp),%r11d - movl %eax,%r15d - shrdl $11,%r14d,%r14d - xorl %r10d,%r12d - xorl %ebx,%r15d - shrdl $6,%r13d,%r13d - addl %r12d,%r11d - andl %r15d,%esi - xorl %eax,%r14d - addl %r13d,%r11d - xorl %ebx,%esi - addl %r11d,%edx - shrdl $2,%r14d,%r14d - addl %esi,%r11d - movl %edx,%r13d - addl %r11d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r11d - movl %r8d,%r12d - xorl %edx,%r13d - shrdl $9,%r14d,%r14d - xorl %r9d,%r12d - shrdl $5,%r13d,%r13d - xorl %r11d,%r14d - andl %edx,%r12d - vpxor %xmm8,%xmm9,%xmm9 - xorl %edx,%r13d - addl 4(%rsp),%r10d - movl %r11d,%esi - shrdl $11,%r14d,%r14d - xorl %r9d,%r12d - xorl %eax,%esi - shrdl $6,%r13d,%r13d - addl %r12d,%r10d - andl %esi,%r15d - xorl %r11d,%r14d - addl %r13d,%r10d - xorl %eax,%r15d - addl %r10d,%ecx - shrdl $2,%r14d,%r14d - addl %r15d,%r10d - movl %ecx,%r13d - addl %r10d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r10d - movl %edx,%r12d - xorl %ecx,%r13d - shrdl $9,%r14d,%r14d - xorl %r8d,%r12d - shrdl $5,%r13d,%r13d - xorl %r10d,%r14d - andl %ecx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 32-128(%rdi),%xmm10 - xorl %ecx,%r13d - addl 8(%rsp),%r9d - movl %r10d,%r15d - shrdl $11,%r14d,%r14d - xorl %r8d,%r12d - xorl %r11d,%r15d - shrdl $6,%r13d,%r13d - addl %r12d,%r9d - andl %r15d,%esi - xorl %r10d,%r14d - addl %r13d,%r9d - xorl %r11d,%esi - addl %r9d,%ebx - shrdl $2,%r14d,%r14d - addl %esi,%r9d - movl %ebx,%r13d - addl %r9d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r9d - movl %ecx,%r12d - xorl %ebx,%r13d - shrdl $9,%r14d,%r14d - xorl %edx,%r12d - shrdl $5,%r13d,%r13d - xorl %r9d,%r14d - andl %ebx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 48-128(%rdi),%xmm10 - xorl %ebx,%r13d - addl 12(%rsp),%r8d - movl %r9d,%esi - shrdl $11,%r14d,%r14d - xorl %edx,%r12d - xorl %r10d,%esi - shrdl $6,%r13d,%r13d - addl %r12d,%r8d - andl %esi,%r15d - xorl %r9d,%r14d - addl %r13d,%r8d - xorl %r10d,%r15d - addl %r8d,%eax - shrdl $2,%r14d,%r14d - addl %r15d,%r8d - movl %eax,%r13d - addl %r8d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r8d - movl %ebx,%r12d - xorl %eax,%r13d - shrdl $9,%r14d,%r14d - xorl %ecx,%r12d - shrdl $5,%r13d,%r13d - xorl %r8d,%r14d - andl %eax,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 64-128(%rdi),%xmm10 - xorl %eax,%r13d - addl 16(%rsp),%edx - movl %r8d,%r15d - shrdl $11,%r14d,%r14d - xorl %ecx,%r12d - xorl %r9d,%r15d - shrdl $6,%r13d,%r13d - addl %r12d,%edx - andl %r15d,%esi - xorl %r8d,%r14d - addl %r13d,%edx - xorl %r9d,%esi - addl %edx,%r11d - shrdl $2,%r14d,%r14d - addl %esi,%edx - movl %r11d,%r13d - addl %edx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%edx - movl %eax,%r12d - xorl %r11d,%r13d - shrdl $9,%r14d,%r14d - xorl %ebx,%r12d - shrdl $5,%r13d,%r13d - xorl %edx,%r14d - andl %r11d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 80-128(%rdi),%xmm10 - xorl %r11d,%r13d - addl 20(%rsp),%ecx - movl %edx,%esi - shrdl $11,%r14d,%r14d - xorl %ebx,%r12d - xorl %r8d,%esi - shrdl $6,%r13d,%r13d - addl %r12d,%ecx - andl %esi,%r15d - xorl %edx,%r14d - addl %r13d,%ecx - xorl %r8d,%r15d - addl %ecx,%r10d - shrdl $2,%r14d,%r14d - addl %r15d,%ecx - movl %r10d,%r13d - addl %ecx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%ecx - movl %r11d,%r12d - xorl %r10d,%r13d - shrdl $9,%r14d,%r14d - xorl %eax,%r12d - shrdl $5,%r13d,%r13d - xorl %ecx,%r14d - andl %r10d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 96-128(%rdi),%xmm10 - xorl %r10d,%r13d - addl 24(%rsp),%ebx - movl %ecx,%r15d - shrdl $11,%r14d,%r14d - xorl %eax,%r12d - xorl %edx,%r15d - shrdl $6,%r13d,%r13d - addl %r12d,%ebx - andl %r15d,%esi - xorl %ecx,%r14d - addl %r13d,%ebx - xorl %edx,%esi - addl %ebx,%r9d - shrdl $2,%r14d,%r14d - addl %esi,%ebx - movl %r9d,%r13d - addl %ebx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%ebx - movl %r10d,%r12d - xorl %r9d,%r13d - shrdl $9,%r14d,%r14d - xorl %r11d,%r12d - shrdl $5,%r13d,%r13d - xorl %ebx,%r14d - andl %r9d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 112-128(%rdi),%xmm10 - xorl %r9d,%r13d - addl 28(%rsp),%eax - movl %ebx,%esi - shrdl $11,%r14d,%r14d - xorl %r11d,%r12d - xorl %ecx,%esi - shrdl $6,%r13d,%r13d - addl %r12d,%eax - andl %esi,%r15d - xorl %ebx,%r14d - addl %r13d,%eax - xorl %ecx,%r15d - addl %eax,%r8d - shrdl $2,%r14d,%r14d - addl %r15d,%eax - movl %r8d,%r13d - addl %eax,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%eax - movl %r9d,%r12d - xorl %r8d,%r13d - shrdl $9,%r14d,%r14d - xorl %r10d,%r12d - shrdl $5,%r13d,%r13d - xorl %eax,%r14d - andl %r8d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 128-128(%rdi),%xmm10 - xorl %r8d,%r13d - addl 32(%rsp),%r11d - movl %eax,%r15d - shrdl $11,%r14d,%r14d - xorl %r10d,%r12d - xorl %ebx,%r15d - shrdl $6,%r13d,%r13d - addl %r12d,%r11d - andl %r15d,%esi - xorl %eax,%r14d - addl %r13d,%r11d - xorl %ebx,%esi - addl %r11d,%edx - shrdl $2,%r14d,%r14d - addl %esi,%r11d - movl %edx,%r13d - addl %r11d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r11d - movl %r8d,%r12d - xorl %edx,%r13d - shrdl $9,%r14d,%r14d - xorl %r9d,%r12d - shrdl $5,%r13d,%r13d - xorl %r11d,%r14d - andl %edx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 144-128(%rdi),%xmm10 - xorl %edx,%r13d - addl 36(%rsp),%r10d - movl %r11d,%esi - shrdl $11,%r14d,%r14d - xorl %r9d,%r12d - xorl %eax,%esi - shrdl $6,%r13d,%r13d - addl %r12d,%r10d - andl %esi,%r15d - xorl %r11d,%r14d - addl %r13d,%r10d - xorl %eax,%r15d - addl %r10d,%ecx - shrdl $2,%r14d,%r14d - addl %r15d,%r10d - movl %ecx,%r13d - addl %r10d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r10d - movl %edx,%r12d - xorl %ecx,%r13d - shrdl $9,%r14d,%r14d - xorl %r8d,%r12d - shrdl $5,%r13d,%r13d - xorl %r10d,%r14d - andl %ecx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 160-128(%rdi),%xmm10 - xorl %ecx,%r13d - addl 40(%rsp),%r9d - movl %r10d,%r15d - shrdl $11,%r14d,%r14d - xorl %r8d,%r12d - xorl %r11d,%r15d - shrdl $6,%r13d,%r13d - addl %r12d,%r9d - andl %r15d,%esi - xorl %r10d,%r14d - addl %r13d,%r9d - xorl %r11d,%esi - addl %r9d,%ebx - shrdl $2,%r14d,%r14d - addl %esi,%r9d - movl %ebx,%r13d - addl %r9d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r9d - movl %ecx,%r12d - xorl %ebx,%r13d - shrdl $9,%r14d,%r14d - xorl %edx,%r12d - shrdl $5,%r13d,%r13d - xorl %r9d,%r14d - andl %ebx,%r12d - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 176-128(%rdi),%xmm10 - xorl %ebx,%r13d - addl 44(%rsp),%r8d - movl %r9d,%esi - shrdl $11,%r14d,%r14d - xorl %edx,%r12d - xorl %r10d,%esi - shrdl $6,%r13d,%r13d - addl %r12d,%r8d - andl %esi,%r15d - xorl %r9d,%r14d - addl %r13d,%r8d - xorl %r10d,%r15d - addl %r8d,%eax - shrdl $2,%r14d,%r14d - addl %r15d,%r8d - movl %eax,%r13d - addl %r8d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r8d - movl %ebx,%r12d - xorl %eax,%r13d - shrdl $9,%r14d,%r14d - xorl %ecx,%r12d - shrdl $5,%r13d,%r13d - xorl %r8d,%r14d - andl %eax,%r12d - vpand %xmm12,%xmm11,%xmm8 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 192-128(%rdi),%xmm10 - xorl %eax,%r13d - addl 48(%rsp),%edx - movl %r8d,%r15d - shrdl $11,%r14d,%r14d - xorl %ecx,%r12d - xorl %r9d,%r15d - shrdl $6,%r13d,%r13d - addl %r12d,%edx - andl %r15d,%esi - xorl %r8d,%r14d - addl %r13d,%edx - xorl %r9d,%esi - addl %edx,%r11d - shrdl $2,%r14d,%r14d - addl %esi,%edx - movl %r11d,%r13d - addl %edx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%edx - movl %eax,%r12d - xorl %r11d,%r13d - shrdl $9,%r14d,%r14d - xorl %ebx,%r12d - shrdl $5,%r13d,%r13d - xorl %edx,%r14d - andl %r11d,%r12d - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 208-128(%rdi),%xmm10 - xorl %r11d,%r13d - addl 52(%rsp),%ecx - movl %edx,%esi - shrdl $11,%r14d,%r14d - xorl %ebx,%r12d - xorl %r8d,%esi - shrdl $6,%r13d,%r13d - addl %r12d,%ecx - andl %esi,%r15d - xorl %edx,%r14d - addl %r13d,%ecx - xorl %r8d,%r15d - addl %ecx,%r10d - shrdl $2,%r14d,%r14d - addl %r15d,%ecx - movl %r10d,%r13d - addl %ecx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%ecx - movl %r11d,%r12d - xorl %r10d,%r13d - shrdl $9,%r14d,%r14d - xorl %eax,%r12d - shrdl $5,%r13d,%r13d - xorl %ecx,%r14d - andl %r10d,%r12d - vpand %xmm13,%xmm11,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 224-128(%rdi),%xmm10 - xorl %r10d,%r13d - addl 56(%rsp),%ebx - movl %ecx,%r15d - shrdl $11,%r14d,%r14d - xorl %eax,%r12d - xorl %edx,%r15d - shrdl $6,%r13d,%r13d - addl %r12d,%ebx - andl %r15d,%esi - xorl %ecx,%r14d - addl %r13d,%ebx - xorl %edx,%esi - addl %ebx,%r9d - shrdl $2,%r14d,%r14d - addl %esi,%ebx - movl %r9d,%r13d - addl %ebx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%ebx - movl %r10d,%r12d - xorl %r9d,%r13d - shrdl $9,%r14d,%r14d - xorl %r11d,%r12d - shrdl $5,%r13d,%r13d - xorl %ebx,%r14d - andl %r9d,%r12d - vpor %xmm11,%xmm8,%xmm8 - vaesenclast %xmm10,%xmm9,%xmm11 - vmovdqu 0-128(%rdi),%xmm10 - xorl %r9d,%r13d - addl 60(%rsp),%eax - movl %ebx,%esi - shrdl $11,%r14d,%r14d - xorl %r11d,%r12d - xorl %ecx,%esi - shrdl $6,%r13d,%r13d - addl %r12d,%eax - andl %esi,%r15d - xorl %ebx,%r14d - addl %r13d,%eax - xorl %ecx,%r15d - addl %eax,%r8d - shrdl $2,%r14d,%r14d - addl %r15d,%eax - movl %r8d,%r13d - addl %eax,%r14d - movq 64+0(%rsp),%r12 - movq 64+8(%rsp),%r13 - movq 64+40(%rsp),%r15 - movq 64+48(%rsp),%rsi - - vpand %xmm14,%xmm11,%xmm11 - movl %r14d,%eax - vpor %xmm11,%xmm8,%xmm8 - vmovdqu %xmm8,(%r12,%r13,1) - leaq 16(%r12),%r12 - - addl 0(%r15),%eax - addl 4(%r15),%ebx - addl 8(%r15),%ecx - addl 12(%r15),%edx - addl 16(%r15),%r8d - addl 20(%r15),%r9d - addl 24(%r15),%r10d - addl 28(%r15),%r11d - - cmpq 64+16(%rsp),%r12 - - movl %eax,0(%r15) - movl %ebx,4(%r15) - movl %ecx,8(%r15) - movl %edx,12(%r15) - movl %r8d,16(%r15) - movl %r9d,20(%r15) - movl %r10d,24(%r15) - movl %r11d,28(%r15) - jb .Lloop_avx - - movq 64+32(%rsp),%r8 - movq 64+56(%rsp),%rsi - vmovdqu %xmm8,(%r8) - vzeroall - movq (%rsi),%r15 - movq 8(%rsi),%r14 - movq 16(%rsi),%r13 - movq 24(%rsi),%r12 - movq 32(%rsi),%rbp - movq 40(%rsi),%rbx - leaq 48(%rsi),%rsp -.Lepilogue_avx: - .byte 0xf3,0xc3 -.size aesni_cbc_sha256_enc_avx,.-aesni_cbc_sha256_enc_avx -.type aesni_cbc_sha256_enc_avx2,@function -.align 64 -aesni_cbc_sha256_enc_avx2: -.Lavx2_shortcut: - movq 8(%rsp),%r10 - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - movq %rsp,%r11 - subq $576,%rsp - andq $-1024,%rsp - addq $448,%rsp - - shlq $6,%rdx - subq %rdi,%rsi - subq %rdi,%r10 - addq %rdi,%rdx - - - - movq %rdx,64+16(%rsp) - - movq %r8,64+32(%rsp) - movq %r9,64+40(%rsp) - movq %r10,64+48(%rsp) - movq %r11,64+56(%rsp) -.Lprologue_avx2: - vzeroall - - movq %rdi,%r13 - vpinsrq $1,%rsi,%xmm15,%xmm15 - leaq 128(%rcx),%rdi - leaq K256+544(%rip),%r12 - movl 240-128(%rdi),%r14d - movq %r9,%r15 - movq %r10,%rsi - vmovdqu (%r8),%xmm8 - leaq -9(%r14),%r14 - - vmovdqa 0(%r12,%r14,8),%xmm14 - vmovdqa 16(%r12,%r14,8),%xmm13 - vmovdqa 32(%r12,%r14,8),%xmm12 - - subq $-64,%r13 - movl 0(%r15),%eax - leaq (%rsi,%r13,1),%r12 - movl 4(%r15),%ebx - cmpq %rdx,%r13 - movl 8(%r15),%ecx - cmoveq %rsp,%r12 - movl 12(%r15),%edx - movl 16(%r15),%r8d - movl 20(%r15),%r9d - movl 24(%r15),%r10d - movl 28(%r15),%r11d - vmovdqu 0-128(%rdi),%xmm10 - jmp .Loop_avx2 -.align 16 -.Loop_avx2: - vmovdqa K256+512(%rip),%ymm7 - vmovdqu -64+0(%rsi,%r13,1),%xmm0 - vmovdqu -64+16(%rsi,%r13,1),%xmm1 - vmovdqu -64+32(%rsi,%r13,1),%xmm2 - vmovdqu -64+48(%rsi,%r13,1),%xmm3 - - vinserti128 $1,(%r12),%ymm0,%ymm0 - vinserti128 $1,16(%r12),%ymm1,%ymm1 - vpshufb %ymm7,%ymm0,%ymm0 - vinserti128 $1,32(%r12),%ymm2,%ymm2 - vpshufb %ymm7,%ymm1,%ymm1 - vinserti128 $1,48(%r12),%ymm3,%ymm3 - - leaq K256(%rip),%rbp - vpshufb %ymm7,%ymm2,%ymm2 - leaq -64(%r13),%r13 - vpaddd 0(%rbp),%ymm0,%ymm4 - vpshufb %ymm7,%ymm3,%ymm3 - vpaddd 32(%rbp),%ymm1,%ymm5 - vpaddd 64(%rbp),%ymm2,%ymm6 - vpaddd 96(%rbp),%ymm3,%ymm7 - vmovdqa %ymm4,0(%rsp) - xorl %r14d,%r14d - vmovdqa %ymm5,32(%rsp) - leaq -64(%rsp),%rsp - movl %ebx,%esi - vmovdqa %ymm6,0(%rsp) - xorl %ecx,%esi - vmovdqa %ymm7,32(%rsp) - movl %r9d,%r12d - subq $-32*4,%rbp - jmp .Lavx2_00_47 - -.align 16 -.Lavx2_00_47: - vmovdqu (%r13),%xmm9 - vpinsrq $0,%r13,%xmm15,%xmm15 - leaq -64(%rsp),%rsp - vpalignr $4,%ymm0,%ymm1,%ymm4 - addl 0+128(%rsp),%r11d - andl %r8d,%r12d - rorxl $25,%r8d,%r13d - vpalignr $4,%ymm2,%ymm3,%ymm7 - rorxl $11,%r8d,%r15d - leal (%rax,%r14,1),%eax - leal (%r11,%r12,1),%r11d - vpsrld $7,%ymm4,%ymm6 - andnl %r10d,%r8d,%r12d - xorl %r15d,%r13d - rorxl $6,%r8d,%r14d - vpaddd %ymm7,%ymm0,%ymm0 - leal (%r11,%r12,1),%r11d - xorl %r14d,%r13d - movl %eax,%r15d - vpsrld $3,%ymm4,%ymm7 - rorxl $22,%eax,%r12d - leal (%r11,%r13,1),%r11d - xorl %ebx,%r15d - vpslld $14,%ymm4,%ymm5 - rorxl $13,%eax,%r14d - rorxl $2,%eax,%r13d - leal (%rdx,%r11,1),%edx - vpxor %ymm6,%ymm7,%ymm4 - andl %r15d,%esi - vpxor %xmm10,%xmm9,%xmm9 - vmovdqu 16-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %ebx,%esi - vpshufd $250,%ymm3,%ymm7 - xorl %r13d,%r14d - leal (%r11,%rsi,1),%r11d - movl %r8d,%r12d - vpsrld $11,%ymm6,%ymm6 - addl 4+128(%rsp),%r10d - andl %edx,%r12d - rorxl $25,%edx,%r13d - vpxor %ymm5,%ymm4,%ymm4 - rorxl $11,%edx,%esi - leal (%r11,%r14,1),%r11d - leal (%r10,%r12,1),%r10d - vpslld $11,%ymm5,%ymm5 - andnl %r9d,%edx,%r12d - xorl %esi,%r13d - rorxl $6,%edx,%r14d - vpxor %ymm6,%ymm4,%ymm4 - leal (%r10,%r12,1),%r10d - xorl %r14d,%r13d - movl %r11d,%esi - vpsrld $10,%ymm7,%ymm6 - rorxl $22,%r11d,%r12d - leal (%r10,%r13,1),%r10d - xorl %eax,%esi - vpxor %ymm5,%ymm4,%ymm4 - rorxl $13,%r11d,%r14d - rorxl $2,%r11d,%r13d - leal (%rcx,%r10,1),%ecx - vpsrlq $17,%ymm7,%ymm7 - andl %esi,%r15d - vpxor %xmm8,%xmm9,%xmm9 - xorl %r12d,%r14d - xorl %eax,%r15d - vpaddd %ymm4,%ymm0,%ymm0 - xorl %r13d,%r14d - leal (%r10,%r15,1),%r10d - movl %edx,%r12d - vpxor %ymm7,%ymm6,%ymm6 - addl 8+128(%rsp),%r9d - andl %ecx,%r12d - rorxl $25,%ecx,%r13d - vpsrlq $2,%ymm7,%ymm7 - rorxl $11,%ecx,%r15d - leal (%r10,%r14,1),%r10d - leal (%r9,%r12,1),%r9d - vpxor %ymm7,%ymm6,%ymm6 - andnl %r8d,%ecx,%r12d - xorl %r15d,%r13d - rorxl $6,%ecx,%r14d - vpshufd $132,%ymm6,%ymm6 - leal (%r9,%r12,1),%r9d - xorl %r14d,%r13d - movl %r10d,%r15d - vpsrldq $8,%ymm6,%ymm6 - rorxl $22,%r10d,%r12d - leal (%r9,%r13,1),%r9d - xorl %r11d,%r15d - vpaddd %ymm6,%ymm0,%ymm0 - rorxl $13,%r10d,%r14d - rorxl $2,%r10d,%r13d - leal (%rbx,%r9,1),%ebx - vpshufd $80,%ymm0,%ymm7 - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 32-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r11d,%esi - vpsrld $10,%ymm7,%ymm6 - xorl %r13d,%r14d - leal (%r9,%rsi,1),%r9d - movl %ecx,%r12d - vpsrlq $17,%ymm7,%ymm7 - addl 12+128(%rsp),%r8d - andl %ebx,%r12d - rorxl $25,%ebx,%r13d - vpxor %ymm7,%ymm6,%ymm6 - rorxl $11,%ebx,%esi - leal (%r9,%r14,1),%r9d - leal (%r8,%r12,1),%r8d - vpsrlq $2,%ymm7,%ymm7 - andnl %edx,%ebx,%r12d - xorl %esi,%r13d - rorxl $6,%ebx,%r14d - vpxor %ymm7,%ymm6,%ymm6 - leal (%r8,%r12,1),%r8d - xorl %r14d,%r13d - movl %r9d,%esi - vpshufd $232,%ymm6,%ymm6 - rorxl $22,%r9d,%r12d - leal (%r8,%r13,1),%r8d - xorl %r10d,%esi - vpslldq $8,%ymm6,%ymm6 - rorxl $13,%r9d,%r14d - rorxl $2,%r9d,%r13d - leal (%rax,%r8,1),%eax - vpaddd %ymm6,%ymm0,%ymm0 - andl %esi,%r15d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 48-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r10d,%r15d - vpaddd 0(%rbp),%ymm0,%ymm6 - xorl %r13d,%r14d - leal (%r8,%r15,1),%r8d - movl %ebx,%r12d - vmovdqa %ymm6,0(%rsp) - vpalignr $4,%ymm1,%ymm2,%ymm4 - addl 32+128(%rsp),%edx - andl %eax,%r12d - rorxl $25,%eax,%r13d - vpalignr $4,%ymm3,%ymm0,%ymm7 - rorxl $11,%eax,%r15d - leal (%r8,%r14,1),%r8d - leal (%rdx,%r12,1),%edx - vpsrld $7,%ymm4,%ymm6 - andnl %ecx,%eax,%r12d - xorl %r15d,%r13d - rorxl $6,%eax,%r14d - vpaddd %ymm7,%ymm1,%ymm1 - leal (%rdx,%r12,1),%edx - xorl %r14d,%r13d - movl %r8d,%r15d - vpsrld $3,%ymm4,%ymm7 - rorxl $22,%r8d,%r12d - leal (%rdx,%r13,1),%edx - xorl %r9d,%r15d - vpslld $14,%ymm4,%ymm5 - rorxl $13,%r8d,%r14d - rorxl $2,%r8d,%r13d - leal (%r11,%rdx,1),%r11d - vpxor %ymm6,%ymm7,%ymm4 - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 64-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r9d,%esi - vpshufd $250,%ymm0,%ymm7 - xorl %r13d,%r14d - leal (%rdx,%rsi,1),%edx - movl %eax,%r12d - vpsrld $11,%ymm6,%ymm6 - addl 36+128(%rsp),%ecx - andl %r11d,%r12d - rorxl $25,%r11d,%r13d - vpxor %ymm5,%ymm4,%ymm4 - rorxl $11,%r11d,%esi - leal (%rdx,%r14,1),%edx - leal (%rcx,%r12,1),%ecx - vpslld $11,%ymm5,%ymm5 - andnl %ebx,%r11d,%r12d - xorl %esi,%r13d - rorxl $6,%r11d,%r14d - vpxor %ymm6,%ymm4,%ymm4 - leal (%rcx,%r12,1),%ecx - xorl %r14d,%r13d - movl %edx,%esi - vpsrld $10,%ymm7,%ymm6 - rorxl $22,%edx,%r12d - leal (%rcx,%r13,1),%ecx - xorl %r8d,%esi - vpxor %ymm5,%ymm4,%ymm4 - rorxl $13,%edx,%r14d - rorxl $2,%edx,%r13d - leal (%r10,%rcx,1),%r10d - vpsrlq $17,%ymm7,%ymm7 - andl %esi,%r15d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 80-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r8d,%r15d - vpaddd %ymm4,%ymm1,%ymm1 - xorl %r13d,%r14d - leal (%rcx,%r15,1),%ecx - movl %r11d,%r12d - vpxor %ymm7,%ymm6,%ymm6 - addl 40+128(%rsp),%ebx - andl %r10d,%r12d - rorxl $25,%r10d,%r13d - vpsrlq $2,%ymm7,%ymm7 - rorxl $11,%r10d,%r15d - leal (%rcx,%r14,1),%ecx - leal (%rbx,%r12,1),%ebx - vpxor %ymm7,%ymm6,%ymm6 - andnl %eax,%r10d,%r12d - xorl %r15d,%r13d - rorxl $6,%r10d,%r14d - vpshufd $132,%ymm6,%ymm6 - leal (%rbx,%r12,1),%ebx - xorl %r14d,%r13d - movl %ecx,%r15d - vpsrldq $8,%ymm6,%ymm6 - rorxl $22,%ecx,%r12d - leal (%rbx,%r13,1),%ebx - xorl %edx,%r15d - vpaddd %ymm6,%ymm1,%ymm1 - rorxl $13,%ecx,%r14d - rorxl $2,%ecx,%r13d - leal (%r9,%rbx,1),%r9d - vpshufd $80,%ymm1,%ymm7 - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 96-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %edx,%esi - vpsrld $10,%ymm7,%ymm6 - xorl %r13d,%r14d - leal (%rbx,%rsi,1),%ebx - movl %r10d,%r12d - vpsrlq $17,%ymm7,%ymm7 - addl 44+128(%rsp),%eax - andl %r9d,%r12d - rorxl $25,%r9d,%r13d - vpxor %ymm7,%ymm6,%ymm6 - rorxl $11,%r9d,%esi - leal (%rbx,%r14,1),%ebx - leal (%rax,%r12,1),%eax - vpsrlq $2,%ymm7,%ymm7 - andnl %r11d,%r9d,%r12d - xorl %esi,%r13d - rorxl $6,%r9d,%r14d - vpxor %ymm7,%ymm6,%ymm6 - leal (%rax,%r12,1),%eax - xorl %r14d,%r13d - movl %ebx,%esi - vpshufd $232,%ymm6,%ymm6 - rorxl $22,%ebx,%r12d - leal (%rax,%r13,1),%eax - xorl %ecx,%esi - vpslldq $8,%ymm6,%ymm6 - rorxl $13,%ebx,%r14d - rorxl $2,%ebx,%r13d - leal (%r8,%rax,1),%r8d - vpaddd %ymm6,%ymm1,%ymm1 - andl %esi,%r15d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 112-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %ecx,%r15d - vpaddd 32(%rbp),%ymm1,%ymm6 - xorl %r13d,%r14d - leal (%rax,%r15,1),%eax - movl %r9d,%r12d - vmovdqa %ymm6,32(%rsp) - leaq -64(%rsp),%rsp - vpalignr $4,%ymm2,%ymm3,%ymm4 - addl 0+128(%rsp),%r11d - andl %r8d,%r12d - rorxl $25,%r8d,%r13d - vpalignr $4,%ymm0,%ymm1,%ymm7 - rorxl $11,%r8d,%r15d - leal (%rax,%r14,1),%eax - leal (%r11,%r12,1),%r11d - vpsrld $7,%ymm4,%ymm6 - andnl %r10d,%r8d,%r12d - xorl %r15d,%r13d - rorxl $6,%r8d,%r14d - vpaddd %ymm7,%ymm2,%ymm2 - leal (%r11,%r12,1),%r11d - xorl %r14d,%r13d - movl %eax,%r15d - vpsrld $3,%ymm4,%ymm7 - rorxl $22,%eax,%r12d - leal (%r11,%r13,1),%r11d - xorl %ebx,%r15d - vpslld $14,%ymm4,%ymm5 - rorxl $13,%eax,%r14d - rorxl $2,%eax,%r13d - leal (%rdx,%r11,1),%edx - vpxor %ymm6,%ymm7,%ymm4 - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 128-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %ebx,%esi - vpshufd $250,%ymm1,%ymm7 - xorl %r13d,%r14d - leal (%r11,%rsi,1),%r11d - movl %r8d,%r12d - vpsrld $11,%ymm6,%ymm6 - addl 4+128(%rsp),%r10d - andl %edx,%r12d - rorxl $25,%edx,%r13d - vpxor %ymm5,%ymm4,%ymm4 - rorxl $11,%edx,%esi - leal (%r11,%r14,1),%r11d - leal (%r10,%r12,1),%r10d - vpslld $11,%ymm5,%ymm5 - andnl %r9d,%edx,%r12d - xorl %esi,%r13d - rorxl $6,%edx,%r14d - vpxor %ymm6,%ymm4,%ymm4 - leal (%r10,%r12,1),%r10d - xorl %r14d,%r13d - movl %r11d,%esi - vpsrld $10,%ymm7,%ymm6 - rorxl $22,%r11d,%r12d - leal (%r10,%r13,1),%r10d - xorl %eax,%esi - vpxor %ymm5,%ymm4,%ymm4 - rorxl $13,%r11d,%r14d - rorxl $2,%r11d,%r13d - leal (%rcx,%r10,1),%ecx - vpsrlq $17,%ymm7,%ymm7 - andl %esi,%r15d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 144-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %eax,%r15d - vpaddd %ymm4,%ymm2,%ymm2 - xorl %r13d,%r14d - leal (%r10,%r15,1),%r10d - movl %edx,%r12d - vpxor %ymm7,%ymm6,%ymm6 - addl 8+128(%rsp),%r9d - andl %ecx,%r12d - rorxl $25,%ecx,%r13d - vpsrlq $2,%ymm7,%ymm7 - rorxl $11,%ecx,%r15d - leal (%r10,%r14,1),%r10d - leal (%r9,%r12,1),%r9d - vpxor %ymm7,%ymm6,%ymm6 - andnl %r8d,%ecx,%r12d - xorl %r15d,%r13d - rorxl $6,%ecx,%r14d - vpshufd $132,%ymm6,%ymm6 - leal (%r9,%r12,1),%r9d - xorl %r14d,%r13d - movl %r10d,%r15d - vpsrldq $8,%ymm6,%ymm6 - rorxl $22,%r10d,%r12d - leal (%r9,%r13,1),%r9d - xorl %r11d,%r15d - vpaddd %ymm6,%ymm2,%ymm2 - rorxl $13,%r10d,%r14d - rorxl $2,%r10d,%r13d - leal (%rbx,%r9,1),%ebx - vpshufd $80,%ymm2,%ymm7 - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 160-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r11d,%esi - vpsrld $10,%ymm7,%ymm6 - xorl %r13d,%r14d - leal (%r9,%rsi,1),%r9d - movl %ecx,%r12d - vpsrlq $17,%ymm7,%ymm7 - addl 12+128(%rsp),%r8d - andl %ebx,%r12d - rorxl $25,%ebx,%r13d - vpxor %ymm7,%ymm6,%ymm6 - rorxl $11,%ebx,%esi - leal (%r9,%r14,1),%r9d - leal (%r8,%r12,1),%r8d - vpsrlq $2,%ymm7,%ymm7 - andnl %edx,%ebx,%r12d - xorl %esi,%r13d - rorxl $6,%ebx,%r14d - vpxor %ymm7,%ymm6,%ymm6 - leal (%r8,%r12,1),%r8d - xorl %r14d,%r13d - movl %r9d,%esi - vpshufd $232,%ymm6,%ymm6 - rorxl $22,%r9d,%r12d - leal (%r8,%r13,1),%r8d - xorl %r10d,%esi - vpslldq $8,%ymm6,%ymm6 - rorxl $13,%r9d,%r14d - rorxl $2,%r9d,%r13d - leal (%rax,%r8,1),%eax - vpaddd %ymm6,%ymm2,%ymm2 - andl %esi,%r15d - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 176-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r10d,%r15d - vpaddd 64(%rbp),%ymm2,%ymm6 - xorl %r13d,%r14d - leal (%r8,%r15,1),%r8d - movl %ebx,%r12d - vmovdqa %ymm6,0(%rsp) - vpalignr $4,%ymm3,%ymm0,%ymm4 - addl 32+128(%rsp),%edx - andl %eax,%r12d - rorxl $25,%eax,%r13d - vpalignr $4,%ymm1,%ymm2,%ymm7 - rorxl $11,%eax,%r15d - leal (%r8,%r14,1),%r8d - leal (%rdx,%r12,1),%edx - vpsrld $7,%ymm4,%ymm6 - andnl %ecx,%eax,%r12d - xorl %r15d,%r13d - rorxl $6,%eax,%r14d - vpaddd %ymm7,%ymm3,%ymm3 - leal (%rdx,%r12,1),%edx - xorl %r14d,%r13d - movl %r8d,%r15d - vpsrld $3,%ymm4,%ymm7 - rorxl $22,%r8d,%r12d - leal (%rdx,%r13,1),%edx - xorl %r9d,%r15d - vpslld $14,%ymm4,%ymm5 - rorxl $13,%r8d,%r14d - rorxl $2,%r8d,%r13d - leal (%r11,%rdx,1),%r11d - vpxor %ymm6,%ymm7,%ymm4 - andl %r15d,%esi - vpand %xmm12,%xmm11,%xmm8 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 192-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r9d,%esi - vpshufd $250,%ymm2,%ymm7 - xorl %r13d,%r14d - leal (%rdx,%rsi,1),%edx - movl %eax,%r12d - vpsrld $11,%ymm6,%ymm6 - addl 36+128(%rsp),%ecx - andl %r11d,%r12d - rorxl $25,%r11d,%r13d - vpxor %ymm5,%ymm4,%ymm4 - rorxl $11,%r11d,%esi - leal (%rdx,%r14,1),%edx - leal (%rcx,%r12,1),%ecx - vpslld $11,%ymm5,%ymm5 - andnl %ebx,%r11d,%r12d - xorl %esi,%r13d - rorxl $6,%r11d,%r14d - vpxor %ymm6,%ymm4,%ymm4 - leal (%rcx,%r12,1),%ecx - xorl %r14d,%r13d - movl %edx,%esi - vpsrld $10,%ymm7,%ymm6 - rorxl $22,%edx,%r12d - leal (%rcx,%r13,1),%ecx - xorl %r8d,%esi - vpxor %ymm5,%ymm4,%ymm4 - rorxl $13,%edx,%r14d - rorxl $2,%edx,%r13d - leal (%r10,%rcx,1),%r10d - vpsrlq $17,%ymm7,%ymm7 - andl %esi,%r15d - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 208-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r8d,%r15d - vpaddd %ymm4,%ymm3,%ymm3 - xorl %r13d,%r14d - leal (%rcx,%r15,1),%ecx - movl %r11d,%r12d - vpxor %ymm7,%ymm6,%ymm6 - addl 40+128(%rsp),%ebx - andl %r10d,%r12d - rorxl $25,%r10d,%r13d - vpsrlq $2,%ymm7,%ymm7 - rorxl $11,%r10d,%r15d - leal (%rcx,%r14,1),%ecx - leal (%rbx,%r12,1),%ebx - vpxor %ymm7,%ymm6,%ymm6 - andnl %eax,%r10d,%r12d - xorl %r15d,%r13d - rorxl $6,%r10d,%r14d - vpshufd $132,%ymm6,%ymm6 - leal (%rbx,%r12,1),%ebx - xorl %r14d,%r13d - movl %ecx,%r15d - vpsrldq $8,%ymm6,%ymm6 - rorxl $22,%ecx,%r12d - leal (%rbx,%r13,1),%ebx - xorl %edx,%r15d - vpaddd %ymm6,%ymm3,%ymm3 - rorxl $13,%ecx,%r14d - rorxl $2,%ecx,%r13d - leal (%r9,%rbx,1),%r9d - vpshufd $80,%ymm3,%ymm7 - andl %r15d,%esi - vpand %xmm13,%xmm11,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 224-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %edx,%esi - vpsrld $10,%ymm7,%ymm6 - xorl %r13d,%r14d - leal (%rbx,%rsi,1),%ebx - movl %r10d,%r12d - vpsrlq $17,%ymm7,%ymm7 - addl 44+128(%rsp),%eax - andl %r9d,%r12d - rorxl $25,%r9d,%r13d - vpxor %ymm7,%ymm6,%ymm6 - rorxl $11,%r9d,%esi - leal (%rbx,%r14,1),%ebx - leal (%rax,%r12,1),%eax - vpsrlq $2,%ymm7,%ymm7 - andnl %r11d,%r9d,%r12d - xorl %esi,%r13d - rorxl $6,%r9d,%r14d - vpxor %ymm7,%ymm6,%ymm6 - leal (%rax,%r12,1),%eax - xorl %r14d,%r13d - movl %ebx,%esi - vpshufd $232,%ymm6,%ymm6 - rorxl $22,%ebx,%r12d - leal (%rax,%r13,1),%eax - xorl %ecx,%esi - vpslldq $8,%ymm6,%ymm6 - rorxl $13,%ebx,%r14d - rorxl $2,%ebx,%r13d - leal (%r8,%rax,1),%r8d - vpaddd %ymm6,%ymm3,%ymm3 - andl %esi,%r15d - vpor %xmm11,%xmm8,%xmm8 - vaesenclast %xmm10,%xmm9,%xmm11 - vmovdqu 0-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %ecx,%r15d - vpaddd 96(%rbp),%ymm3,%ymm6 - xorl %r13d,%r14d - leal (%rax,%r15,1),%eax - movl %r9d,%r12d - vmovdqa %ymm6,32(%rsp) - vmovq %xmm15,%r13 - vpextrq $1,%xmm15,%r15 - vpand %xmm14,%xmm11,%xmm11 - vpor %xmm11,%xmm8,%xmm8 - vmovdqu %xmm8,(%r15,%r13,1) - leaq 16(%r13),%r13 - leaq 128(%rbp),%rbp - cmpb $0,3(%rbp) - jne .Lavx2_00_47 - vmovdqu (%r13),%xmm9 - vpinsrq $0,%r13,%xmm15,%xmm15 - addl 0+64(%rsp),%r11d - andl %r8d,%r12d - rorxl $25,%r8d,%r13d - rorxl $11,%r8d,%r15d - leal (%rax,%r14,1),%eax - leal (%r11,%r12,1),%r11d - andnl %r10d,%r8d,%r12d - xorl %r15d,%r13d - rorxl $6,%r8d,%r14d - leal (%r11,%r12,1),%r11d - xorl %r14d,%r13d - movl %eax,%r15d - rorxl $22,%eax,%r12d - leal (%r11,%r13,1),%r11d - xorl %ebx,%r15d - rorxl $13,%eax,%r14d - rorxl $2,%eax,%r13d - leal (%rdx,%r11,1),%edx - andl %r15d,%esi - vpxor %xmm10,%xmm9,%xmm9 - vmovdqu 16-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %ebx,%esi - xorl %r13d,%r14d - leal (%r11,%rsi,1),%r11d - movl %r8d,%r12d - addl 4+64(%rsp),%r10d - andl %edx,%r12d - rorxl $25,%edx,%r13d - rorxl $11,%edx,%esi - leal (%r11,%r14,1),%r11d - leal (%r10,%r12,1),%r10d - andnl %r9d,%edx,%r12d - xorl %esi,%r13d - rorxl $6,%edx,%r14d - leal (%r10,%r12,1),%r10d - xorl %r14d,%r13d - movl %r11d,%esi - rorxl $22,%r11d,%r12d - leal (%r10,%r13,1),%r10d - xorl %eax,%esi - rorxl $13,%r11d,%r14d - rorxl $2,%r11d,%r13d - leal (%rcx,%r10,1),%ecx - andl %esi,%r15d - vpxor %xmm8,%xmm9,%xmm9 - xorl %r12d,%r14d - xorl %eax,%r15d - xorl %r13d,%r14d - leal (%r10,%r15,1),%r10d - movl %edx,%r12d - addl 8+64(%rsp),%r9d - andl %ecx,%r12d - rorxl $25,%ecx,%r13d - rorxl $11,%ecx,%r15d - leal (%r10,%r14,1),%r10d - leal (%r9,%r12,1),%r9d - andnl %r8d,%ecx,%r12d - xorl %r15d,%r13d - rorxl $6,%ecx,%r14d - leal (%r9,%r12,1),%r9d - xorl %r14d,%r13d - movl %r10d,%r15d - rorxl $22,%r10d,%r12d - leal (%r9,%r13,1),%r9d - xorl %r11d,%r15d - rorxl $13,%r10d,%r14d - rorxl $2,%r10d,%r13d - leal (%rbx,%r9,1),%ebx - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 32-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r11d,%esi - xorl %r13d,%r14d - leal (%r9,%rsi,1),%r9d - movl %ecx,%r12d - addl 12+64(%rsp),%r8d - andl %ebx,%r12d - rorxl $25,%ebx,%r13d - rorxl $11,%ebx,%esi - leal (%r9,%r14,1),%r9d - leal (%r8,%r12,1),%r8d - andnl %edx,%ebx,%r12d - xorl %esi,%r13d - rorxl $6,%ebx,%r14d - leal (%r8,%r12,1),%r8d - xorl %r14d,%r13d - movl %r9d,%esi - rorxl $22,%r9d,%r12d - leal (%r8,%r13,1),%r8d - xorl %r10d,%esi - rorxl $13,%r9d,%r14d - rorxl $2,%r9d,%r13d - leal (%rax,%r8,1),%eax - andl %esi,%r15d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 48-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r10d,%r15d - xorl %r13d,%r14d - leal (%r8,%r15,1),%r8d - movl %ebx,%r12d - addl 32+64(%rsp),%edx - andl %eax,%r12d - rorxl $25,%eax,%r13d - rorxl $11,%eax,%r15d - leal (%r8,%r14,1),%r8d - leal (%rdx,%r12,1),%edx - andnl %ecx,%eax,%r12d - xorl %r15d,%r13d - rorxl $6,%eax,%r14d - leal (%rdx,%r12,1),%edx - xorl %r14d,%r13d - movl %r8d,%r15d - rorxl $22,%r8d,%r12d - leal (%rdx,%r13,1),%edx - xorl %r9d,%r15d - rorxl $13,%r8d,%r14d - rorxl $2,%r8d,%r13d - leal (%r11,%rdx,1),%r11d - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 64-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r9d,%esi - xorl %r13d,%r14d - leal (%rdx,%rsi,1),%edx - movl %eax,%r12d - addl 36+64(%rsp),%ecx - andl %r11d,%r12d - rorxl $25,%r11d,%r13d - rorxl $11,%r11d,%esi - leal (%rdx,%r14,1),%edx - leal (%rcx,%r12,1),%ecx - andnl %ebx,%r11d,%r12d - xorl %esi,%r13d - rorxl $6,%r11d,%r14d - leal (%rcx,%r12,1),%ecx - xorl %r14d,%r13d - movl %edx,%esi - rorxl $22,%edx,%r12d - leal (%rcx,%r13,1),%ecx - xorl %r8d,%esi - rorxl $13,%edx,%r14d - rorxl $2,%edx,%r13d - leal (%r10,%rcx,1),%r10d - andl %esi,%r15d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 80-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r8d,%r15d - xorl %r13d,%r14d - leal (%rcx,%r15,1),%ecx - movl %r11d,%r12d - addl 40+64(%rsp),%ebx - andl %r10d,%r12d - rorxl $25,%r10d,%r13d - rorxl $11,%r10d,%r15d - leal (%rcx,%r14,1),%ecx - leal (%rbx,%r12,1),%ebx - andnl %eax,%r10d,%r12d - xorl %r15d,%r13d - rorxl $6,%r10d,%r14d - leal (%rbx,%r12,1),%ebx - xorl %r14d,%r13d - movl %ecx,%r15d - rorxl $22,%ecx,%r12d - leal (%rbx,%r13,1),%ebx - xorl %edx,%r15d - rorxl $13,%ecx,%r14d - rorxl $2,%ecx,%r13d - leal (%r9,%rbx,1),%r9d - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 96-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %edx,%esi - xorl %r13d,%r14d - leal (%rbx,%rsi,1),%ebx - movl %r10d,%r12d - addl 44+64(%rsp),%eax - andl %r9d,%r12d - rorxl $25,%r9d,%r13d - rorxl $11,%r9d,%esi - leal (%rbx,%r14,1),%ebx - leal (%rax,%r12,1),%eax - andnl %r11d,%r9d,%r12d - xorl %esi,%r13d - rorxl $6,%r9d,%r14d - leal (%rax,%r12,1),%eax - xorl %r14d,%r13d - movl %ebx,%esi - rorxl $22,%ebx,%r12d - leal (%rax,%r13,1),%eax - xorl %ecx,%esi - rorxl $13,%ebx,%r14d - rorxl $2,%ebx,%r13d - leal (%r8,%rax,1),%r8d - andl %esi,%r15d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 112-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %ecx,%r15d - xorl %r13d,%r14d - leal (%rax,%r15,1),%eax - movl %r9d,%r12d - addl 0(%rsp),%r11d - andl %r8d,%r12d - rorxl $25,%r8d,%r13d - rorxl $11,%r8d,%r15d - leal (%rax,%r14,1),%eax - leal (%r11,%r12,1),%r11d - andnl %r10d,%r8d,%r12d - xorl %r15d,%r13d - rorxl $6,%r8d,%r14d - leal (%r11,%r12,1),%r11d - xorl %r14d,%r13d - movl %eax,%r15d - rorxl $22,%eax,%r12d - leal (%r11,%r13,1),%r11d - xorl %ebx,%r15d - rorxl $13,%eax,%r14d - rorxl $2,%eax,%r13d - leal (%rdx,%r11,1),%edx - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 128-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %ebx,%esi - xorl %r13d,%r14d - leal (%r11,%rsi,1),%r11d - movl %r8d,%r12d - addl 4(%rsp),%r10d - andl %edx,%r12d - rorxl $25,%edx,%r13d - rorxl $11,%edx,%esi - leal (%r11,%r14,1),%r11d - leal (%r10,%r12,1),%r10d - andnl %r9d,%edx,%r12d - xorl %esi,%r13d - rorxl $6,%edx,%r14d - leal (%r10,%r12,1),%r10d - xorl %r14d,%r13d - movl %r11d,%esi - rorxl $22,%r11d,%r12d - leal (%r10,%r13,1),%r10d - xorl %eax,%esi - rorxl $13,%r11d,%r14d - rorxl $2,%r11d,%r13d - leal (%rcx,%r10,1),%ecx - andl %esi,%r15d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 144-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %eax,%r15d - xorl %r13d,%r14d - leal (%r10,%r15,1),%r10d - movl %edx,%r12d - addl 8(%rsp),%r9d - andl %ecx,%r12d - rorxl $25,%ecx,%r13d - rorxl $11,%ecx,%r15d - leal (%r10,%r14,1),%r10d - leal (%r9,%r12,1),%r9d - andnl %r8d,%ecx,%r12d - xorl %r15d,%r13d - rorxl $6,%ecx,%r14d - leal (%r9,%r12,1),%r9d - xorl %r14d,%r13d - movl %r10d,%r15d - rorxl $22,%r10d,%r12d - leal (%r9,%r13,1),%r9d - xorl %r11d,%r15d - rorxl $13,%r10d,%r14d - rorxl $2,%r10d,%r13d - leal (%rbx,%r9,1),%ebx - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 160-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r11d,%esi - xorl %r13d,%r14d - leal (%r9,%rsi,1),%r9d - movl %ecx,%r12d - addl 12(%rsp),%r8d - andl %ebx,%r12d - rorxl $25,%ebx,%r13d - rorxl $11,%ebx,%esi - leal (%r9,%r14,1),%r9d - leal (%r8,%r12,1),%r8d - andnl %edx,%ebx,%r12d - xorl %esi,%r13d - rorxl $6,%ebx,%r14d - leal (%r8,%r12,1),%r8d - xorl %r14d,%r13d - movl %r9d,%esi - rorxl $22,%r9d,%r12d - leal (%r8,%r13,1),%r8d - xorl %r10d,%esi - rorxl $13,%r9d,%r14d - rorxl $2,%r9d,%r13d - leal (%rax,%r8,1),%eax - andl %esi,%r15d - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 176-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r10d,%r15d - xorl %r13d,%r14d - leal (%r8,%r15,1),%r8d - movl %ebx,%r12d - addl 32(%rsp),%edx - andl %eax,%r12d - rorxl $25,%eax,%r13d - rorxl $11,%eax,%r15d - leal (%r8,%r14,1),%r8d - leal (%rdx,%r12,1),%edx - andnl %ecx,%eax,%r12d - xorl %r15d,%r13d - rorxl $6,%eax,%r14d - leal (%rdx,%r12,1),%edx - xorl %r14d,%r13d - movl %r8d,%r15d - rorxl $22,%r8d,%r12d - leal (%rdx,%r13,1),%edx - xorl %r9d,%r15d - rorxl $13,%r8d,%r14d - rorxl $2,%r8d,%r13d - leal (%r11,%rdx,1),%r11d - andl %r15d,%esi - vpand %xmm12,%xmm11,%xmm8 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 192-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r9d,%esi - xorl %r13d,%r14d - leal (%rdx,%rsi,1),%edx - movl %eax,%r12d - addl 36(%rsp),%ecx - andl %r11d,%r12d - rorxl $25,%r11d,%r13d - rorxl $11,%r11d,%esi - leal (%rdx,%r14,1),%edx - leal (%rcx,%r12,1),%ecx - andnl %ebx,%r11d,%r12d - xorl %esi,%r13d - rorxl $6,%r11d,%r14d - leal (%rcx,%r12,1),%ecx - xorl %r14d,%r13d - movl %edx,%esi - rorxl $22,%edx,%r12d - leal (%rcx,%r13,1),%ecx - xorl %r8d,%esi - rorxl $13,%edx,%r14d - rorxl $2,%edx,%r13d - leal (%r10,%rcx,1),%r10d - andl %esi,%r15d - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 208-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r8d,%r15d - xorl %r13d,%r14d - leal (%rcx,%r15,1),%ecx - movl %r11d,%r12d - addl 40(%rsp),%ebx - andl %r10d,%r12d - rorxl $25,%r10d,%r13d - rorxl $11,%r10d,%r15d - leal (%rcx,%r14,1),%ecx - leal (%rbx,%r12,1),%ebx - andnl %eax,%r10d,%r12d - xorl %r15d,%r13d - rorxl $6,%r10d,%r14d - leal (%rbx,%r12,1),%ebx - xorl %r14d,%r13d - movl %ecx,%r15d - rorxl $22,%ecx,%r12d - leal (%rbx,%r13,1),%ebx - xorl %edx,%r15d - rorxl $13,%ecx,%r14d - rorxl $2,%ecx,%r13d - leal (%r9,%rbx,1),%r9d - andl %r15d,%esi - vpand %xmm13,%xmm11,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 224-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %edx,%esi - xorl %r13d,%r14d - leal (%rbx,%rsi,1),%ebx - movl %r10d,%r12d - addl 44(%rsp),%eax - andl %r9d,%r12d - rorxl $25,%r9d,%r13d - rorxl $11,%r9d,%esi - leal (%rbx,%r14,1),%ebx - leal (%rax,%r12,1),%eax - andnl %r11d,%r9d,%r12d - xorl %esi,%r13d - rorxl $6,%r9d,%r14d - leal (%rax,%r12,1),%eax - xorl %r14d,%r13d - movl %ebx,%esi - rorxl $22,%ebx,%r12d - leal (%rax,%r13,1),%eax - xorl %ecx,%esi - rorxl $13,%ebx,%r14d - rorxl $2,%ebx,%r13d - leal (%r8,%rax,1),%r8d - andl %esi,%r15d - vpor %xmm11,%xmm8,%xmm8 - vaesenclast %xmm10,%xmm9,%xmm11 - vmovdqu 0-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %ecx,%r15d - xorl %r13d,%r14d - leal (%rax,%r15,1),%eax - movl %r9d,%r12d - vpextrq $1,%xmm15,%r12 - vmovq %xmm15,%r13 - movq 552(%rsp),%r15 - addl %r14d,%eax - leaq 448(%rsp),%rbp - - vpand %xmm14,%xmm11,%xmm11 - vpor %xmm11,%xmm8,%xmm8 - vmovdqu %xmm8,(%r12,%r13,1) - leaq 16(%r13),%r13 - - addl 0(%r15),%eax - addl 4(%r15),%ebx - addl 8(%r15),%ecx - addl 12(%r15),%edx - addl 16(%r15),%r8d - addl 20(%r15),%r9d - addl 24(%r15),%r10d - addl 28(%r15),%r11d - - movl %eax,0(%r15) - movl %ebx,4(%r15) - movl %ecx,8(%r15) - movl %edx,12(%r15) - movl %r8d,16(%r15) - movl %r9d,20(%r15) - movl %r10d,24(%r15) - movl %r11d,28(%r15) - - cmpq 80(%rbp),%r13 - je .Ldone_avx2 - - xorl %r14d,%r14d - movl %ebx,%esi - movl %r9d,%r12d - xorl %ecx,%esi - jmp .Lower_avx2 -.align 16 -.Lower_avx2: - vmovdqu (%r13),%xmm9 - vpinsrq $0,%r13,%xmm15,%xmm15 - addl 0+16(%rbp),%r11d - andl %r8d,%r12d - rorxl $25,%r8d,%r13d - rorxl $11,%r8d,%r15d - leal (%rax,%r14,1),%eax - leal (%r11,%r12,1),%r11d - andnl %r10d,%r8d,%r12d - xorl %r15d,%r13d - rorxl $6,%r8d,%r14d - leal (%r11,%r12,1),%r11d - xorl %r14d,%r13d - movl %eax,%r15d - rorxl $22,%eax,%r12d - leal (%r11,%r13,1),%r11d - xorl %ebx,%r15d - rorxl $13,%eax,%r14d - rorxl $2,%eax,%r13d - leal (%rdx,%r11,1),%edx - andl %r15d,%esi - vpxor %xmm10,%xmm9,%xmm9 - vmovdqu 16-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %ebx,%esi - xorl %r13d,%r14d - leal (%r11,%rsi,1),%r11d - movl %r8d,%r12d - addl 4+16(%rbp),%r10d - andl %edx,%r12d - rorxl $25,%edx,%r13d - rorxl $11,%edx,%esi - leal (%r11,%r14,1),%r11d - leal (%r10,%r12,1),%r10d - andnl %r9d,%edx,%r12d - xorl %esi,%r13d - rorxl $6,%edx,%r14d - leal (%r10,%r12,1),%r10d - xorl %r14d,%r13d - movl %r11d,%esi - rorxl $22,%r11d,%r12d - leal (%r10,%r13,1),%r10d - xorl %eax,%esi - rorxl $13,%r11d,%r14d - rorxl $2,%r11d,%r13d - leal (%rcx,%r10,1),%ecx - andl %esi,%r15d - vpxor %xmm8,%xmm9,%xmm9 - xorl %r12d,%r14d - xorl %eax,%r15d - xorl %r13d,%r14d - leal (%r10,%r15,1),%r10d - movl %edx,%r12d - addl 8+16(%rbp),%r9d - andl %ecx,%r12d - rorxl $25,%ecx,%r13d - rorxl $11,%ecx,%r15d - leal (%r10,%r14,1),%r10d - leal (%r9,%r12,1),%r9d - andnl %r8d,%ecx,%r12d - xorl %r15d,%r13d - rorxl $6,%ecx,%r14d - leal (%r9,%r12,1),%r9d - xorl %r14d,%r13d - movl %r10d,%r15d - rorxl $22,%r10d,%r12d - leal (%r9,%r13,1),%r9d - xorl %r11d,%r15d - rorxl $13,%r10d,%r14d - rorxl $2,%r10d,%r13d - leal (%rbx,%r9,1),%ebx - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 32-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r11d,%esi - xorl %r13d,%r14d - leal (%r9,%rsi,1),%r9d - movl %ecx,%r12d - addl 12+16(%rbp),%r8d - andl %ebx,%r12d - rorxl $25,%ebx,%r13d - rorxl $11,%ebx,%esi - leal (%r9,%r14,1),%r9d - leal (%r8,%r12,1),%r8d - andnl %edx,%ebx,%r12d - xorl %esi,%r13d - rorxl $6,%ebx,%r14d - leal (%r8,%r12,1),%r8d - xorl %r14d,%r13d - movl %r9d,%esi - rorxl $22,%r9d,%r12d - leal (%r8,%r13,1),%r8d - xorl %r10d,%esi - rorxl $13,%r9d,%r14d - rorxl $2,%r9d,%r13d - leal (%rax,%r8,1),%eax - andl %esi,%r15d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 48-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r10d,%r15d - xorl %r13d,%r14d - leal (%r8,%r15,1),%r8d - movl %ebx,%r12d - addl 32+16(%rbp),%edx - andl %eax,%r12d - rorxl $25,%eax,%r13d - rorxl $11,%eax,%r15d - leal (%r8,%r14,1),%r8d - leal (%rdx,%r12,1),%edx - andnl %ecx,%eax,%r12d - xorl %r15d,%r13d - rorxl $6,%eax,%r14d - leal (%rdx,%r12,1),%edx - xorl %r14d,%r13d - movl %r8d,%r15d - rorxl $22,%r8d,%r12d - leal (%rdx,%r13,1),%edx - xorl %r9d,%r15d - rorxl $13,%r8d,%r14d - rorxl $2,%r8d,%r13d - leal (%r11,%rdx,1),%r11d - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 64-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r9d,%esi - xorl %r13d,%r14d - leal (%rdx,%rsi,1),%edx - movl %eax,%r12d - addl 36+16(%rbp),%ecx - andl %r11d,%r12d - rorxl $25,%r11d,%r13d - rorxl $11,%r11d,%esi - leal (%rdx,%r14,1),%edx - leal (%rcx,%r12,1),%ecx - andnl %ebx,%r11d,%r12d - xorl %esi,%r13d - rorxl $6,%r11d,%r14d - leal (%rcx,%r12,1),%ecx - xorl %r14d,%r13d - movl %edx,%esi - rorxl $22,%edx,%r12d - leal (%rcx,%r13,1),%ecx - xorl %r8d,%esi - rorxl $13,%edx,%r14d - rorxl $2,%edx,%r13d - leal (%r10,%rcx,1),%r10d - andl %esi,%r15d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 80-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r8d,%r15d - xorl %r13d,%r14d - leal (%rcx,%r15,1),%ecx - movl %r11d,%r12d - addl 40+16(%rbp),%ebx - andl %r10d,%r12d - rorxl $25,%r10d,%r13d - rorxl $11,%r10d,%r15d - leal (%rcx,%r14,1),%ecx - leal (%rbx,%r12,1),%ebx - andnl %eax,%r10d,%r12d - xorl %r15d,%r13d - rorxl $6,%r10d,%r14d - leal (%rbx,%r12,1),%ebx - xorl %r14d,%r13d - movl %ecx,%r15d - rorxl $22,%ecx,%r12d - leal (%rbx,%r13,1),%ebx - xorl %edx,%r15d - rorxl $13,%ecx,%r14d - rorxl $2,%ecx,%r13d - leal (%r9,%rbx,1),%r9d - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 96-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %edx,%esi - xorl %r13d,%r14d - leal (%rbx,%rsi,1),%ebx - movl %r10d,%r12d - addl 44+16(%rbp),%eax - andl %r9d,%r12d - rorxl $25,%r9d,%r13d - rorxl $11,%r9d,%esi - leal (%rbx,%r14,1),%ebx - leal (%rax,%r12,1),%eax - andnl %r11d,%r9d,%r12d - xorl %esi,%r13d - rorxl $6,%r9d,%r14d - leal (%rax,%r12,1),%eax - xorl %r14d,%r13d - movl %ebx,%esi - rorxl $22,%ebx,%r12d - leal (%rax,%r13,1),%eax - xorl %ecx,%esi - rorxl $13,%ebx,%r14d - rorxl $2,%ebx,%r13d - leal (%r8,%rax,1),%r8d - andl %esi,%r15d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 112-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %ecx,%r15d - xorl %r13d,%r14d - leal (%rax,%r15,1),%eax - movl %r9d,%r12d - leaq -64(%rbp),%rbp - addl 0+16(%rbp),%r11d - andl %r8d,%r12d - rorxl $25,%r8d,%r13d - rorxl $11,%r8d,%r15d - leal (%rax,%r14,1),%eax - leal (%r11,%r12,1),%r11d - andnl %r10d,%r8d,%r12d - xorl %r15d,%r13d - rorxl $6,%r8d,%r14d - leal (%r11,%r12,1),%r11d - xorl %r14d,%r13d - movl %eax,%r15d - rorxl $22,%eax,%r12d - leal (%r11,%r13,1),%r11d - xorl %ebx,%r15d - rorxl $13,%eax,%r14d - rorxl $2,%eax,%r13d - leal (%rdx,%r11,1),%edx - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 128-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %ebx,%esi - xorl %r13d,%r14d - leal (%r11,%rsi,1),%r11d - movl %r8d,%r12d - addl 4+16(%rbp),%r10d - andl %edx,%r12d - rorxl $25,%edx,%r13d - rorxl $11,%edx,%esi - leal (%r11,%r14,1),%r11d - leal (%r10,%r12,1),%r10d - andnl %r9d,%edx,%r12d - xorl %esi,%r13d - rorxl $6,%edx,%r14d - leal (%r10,%r12,1),%r10d - xorl %r14d,%r13d - movl %r11d,%esi - rorxl $22,%r11d,%r12d - leal (%r10,%r13,1),%r10d - xorl %eax,%esi - rorxl $13,%r11d,%r14d - rorxl $2,%r11d,%r13d - leal (%rcx,%r10,1),%ecx - andl %esi,%r15d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 144-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %eax,%r15d - xorl %r13d,%r14d - leal (%r10,%r15,1),%r10d - movl %edx,%r12d - addl 8+16(%rbp),%r9d - andl %ecx,%r12d - rorxl $25,%ecx,%r13d - rorxl $11,%ecx,%r15d - leal (%r10,%r14,1),%r10d - leal (%r9,%r12,1),%r9d - andnl %r8d,%ecx,%r12d - xorl %r15d,%r13d - rorxl $6,%ecx,%r14d - leal (%r9,%r12,1),%r9d - xorl %r14d,%r13d - movl %r10d,%r15d - rorxl $22,%r10d,%r12d - leal (%r9,%r13,1),%r9d - xorl %r11d,%r15d - rorxl $13,%r10d,%r14d - rorxl $2,%r10d,%r13d - leal (%rbx,%r9,1),%ebx - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 160-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r11d,%esi - xorl %r13d,%r14d - leal (%r9,%rsi,1),%r9d - movl %ecx,%r12d - addl 12+16(%rbp),%r8d - andl %ebx,%r12d - rorxl $25,%ebx,%r13d - rorxl $11,%ebx,%esi - leal (%r9,%r14,1),%r9d - leal (%r8,%r12,1),%r8d - andnl %edx,%ebx,%r12d - xorl %esi,%r13d - rorxl $6,%ebx,%r14d - leal (%r8,%r12,1),%r8d - xorl %r14d,%r13d - movl %r9d,%esi - rorxl $22,%r9d,%r12d - leal (%r8,%r13,1),%r8d - xorl %r10d,%esi - rorxl $13,%r9d,%r14d - rorxl $2,%r9d,%r13d - leal (%rax,%r8,1),%eax - andl %esi,%r15d - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 176-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r10d,%r15d - xorl %r13d,%r14d - leal (%r8,%r15,1),%r8d - movl %ebx,%r12d - addl 32+16(%rbp),%edx - andl %eax,%r12d - rorxl $25,%eax,%r13d - rorxl $11,%eax,%r15d - leal (%r8,%r14,1),%r8d - leal (%rdx,%r12,1),%edx - andnl %ecx,%eax,%r12d - xorl %r15d,%r13d - rorxl $6,%eax,%r14d - leal (%rdx,%r12,1),%edx - xorl %r14d,%r13d - movl %r8d,%r15d - rorxl $22,%r8d,%r12d - leal (%rdx,%r13,1),%edx - xorl %r9d,%r15d - rorxl $13,%r8d,%r14d - rorxl $2,%r8d,%r13d - leal (%r11,%rdx,1),%r11d - andl %r15d,%esi - vpand %xmm12,%xmm11,%xmm8 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 192-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r9d,%esi - xorl %r13d,%r14d - leal (%rdx,%rsi,1),%edx - movl %eax,%r12d - addl 36+16(%rbp),%ecx - andl %r11d,%r12d - rorxl $25,%r11d,%r13d - rorxl $11,%r11d,%esi - leal (%rdx,%r14,1),%edx - leal (%rcx,%r12,1),%ecx - andnl %ebx,%r11d,%r12d - xorl %esi,%r13d - rorxl $6,%r11d,%r14d - leal (%rcx,%r12,1),%ecx - xorl %r14d,%r13d - movl %edx,%esi - rorxl $22,%edx,%r12d - leal (%rcx,%r13,1),%ecx - xorl %r8d,%esi - rorxl $13,%edx,%r14d - rorxl $2,%edx,%r13d - leal (%r10,%rcx,1),%r10d - andl %esi,%r15d - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 208-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r8d,%r15d - xorl %r13d,%r14d - leal (%rcx,%r15,1),%ecx - movl %r11d,%r12d - addl 40+16(%rbp),%ebx - andl %r10d,%r12d - rorxl $25,%r10d,%r13d - rorxl $11,%r10d,%r15d - leal (%rcx,%r14,1),%ecx - leal (%rbx,%r12,1),%ebx - andnl %eax,%r10d,%r12d - xorl %r15d,%r13d - rorxl $6,%r10d,%r14d - leal (%rbx,%r12,1),%ebx - xorl %r14d,%r13d - movl %ecx,%r15d - rorxl $22,%ecx,%r12d - leal (%rbx,%r13,1),%ebx - xorl %edx,%r15d - rorxl $13,%ecx,%r14d - rorxl $2,%ecx,%r13d - leal (%r9,%rbx,1),%r9d - andl %r15d,%esi - vpand %xmm13,%xmm11,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 224-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %edx,%esi - xorl %r13d,%r14d - leal (%rbx,%rsi,1),%ebx - movl %r10d,%r12d - addl 44+16(%rbp),%eax - andl %r9d,%r12d - rorxl $25,%r9d,%r13d - rorxl $11,%r9d,%esi - leal (%rbx,%r14,1),%ebx - leal (%rax,%r12,1),%eax - andnl %r11d,%r9d,%r12d - xorl %esi,%r13d - rorxl $6,%r9d,%r14d - leal (%rax,%r12,1),%eax - xorl %r14d,%r13d - movl %ebx,%esi - rorxl $22,%ebx,%r12d - leal (%rax,%r13,1),%eax - xorl %ecx,%esi - rorxl $13,%ebx,%r14d - rorxl $2,%ebx,%r13d - leal (%r8,%rax,1),%r8d - andl %esi,%r15d - vpor %xmm11,%xmm8,%xmm8 - vaesenclast %xmm10,%xmm9,%xmm11 - vmovdqu 0-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %ecx,%r15d - xorl %r13d,%r14d - leal (%rax,%r15,1),%eax - movl %r9d,%r12d - vmovq %xmm15,%r13 - vpextrq $1,%xmm15,%r15 - vpand %xmm14,%xmm11,%xmm11 - vpor %xmm11,%xmm8,%xmm8 - leaq -64(%rbp),%rbp - vmovdqu %xmm8,(%r15,%r13,1) - leaq 16(%r13),%r13 - cmpq %rsp,%rbp - jae .Lower_avx2 - - movq 552(%rsp),%r15 - leaq 64(%r13),%r13 - movq 560(%rsp),%rsi - addl %r14d,%eax - leaq 448(%rsp),%rsp - - addl 0(%r15),%eax - addl 4(%r15),%ebx - addl 8(%r15),%ecx - addl 12(%r15),%edx - addl 16(%r15),%r8d - addl 20(%r15),%r9d - addl 24(%r15),%r10d - leaq (%rsi,%r13,1),%r12 - addl 28(%r15),%r11d - - cmpq 64+16(%rsp),%r13 - - movl %eax,0(%r15) - cmoveq %rsp,%r12 - movl %ebx,4(%r15) - movl %ecx,8(%r15) - movl %edx,12(%r15) - movl %r8d,16(%r15) - movl %r9d,20(%r15) - movl %r10d,24(%r15) - movl %r11d,28(%r15) - - jbe .Loop_avx2 - leaq (%rsp),%rbp - -.Ldone_avx2: - leaq (%rbp),%rsp - movq 64+32(%rsp),%r8 - movq 64+56(%rsp),%rsi - vmovdqu %xmm8,(%r8) - vzeroall - movq (%rsi),%r15 - movq 8(%rsi),%r14 - movq 16(%rsi),%r13 - movq 24(%rsi),%r12 - movq 32(%rsi),%rbp - movq 40(%rsi),%rbx - leaq 48(%rsi),%rsp -.Lepilogue_avx2: - .byte 0xf3,0xc3 -.size aesni_cbc_sha256_enc_avx2,.-aesni_cbc_sha256_enc_avx2 -.type aesni_cbc_sha256_enc_shaext,@function -.align 32 -aesni_cbc_sha256_enc_shaext: - movq 8(%rsp),%r10 - leaq K256+128(%rip),%rax - movdqu (%r9),%xmm1 - movdqu 16(%r9),%xmm2 - movdqa 512-128(%rax),%xmm3 - - movl 240(%rcx),%r11d - subq %rdi,%rsi - movups (%rcx),%xmm15 - movups 16(%rcx),%xmm4 - leaq 112(%rcx),%rcx - - pshufd $27,%xmm1,%xmm0 - pshufd $177,%xmm1,%xmm1 - pshufd $27,%xmm2,%xmm2 - movdqa %xmm3,%xmm7 -.byte 102,15,58,15,202,8 - punpcklqdq %xmm0,%xmm2 - - jmp .Loop_shaext - -.align 16 -.Loop_shaext: - movdqu (%r10),%xmm10 - movdqu 16(%r10),%xmm11 - movdqu 32(%r10),%xmm12 -.byte 102,68,15,56,0,211 - movdqu 48(%r10),%xmm13 - - movdqa 0-128(%rax),%xmm0 - paddd %xmm10,%xmm0 -.byte 102,68,15,56,0,219 - movdqa %xmm2,%xmm9 - movdqa %xmm1,%xmm8 - movups 0(%rdi),%xmm14 - xorps %xmm15,%xmm14 - xorps %xmm14,%xmm6 - movups -80(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movups -64(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,202 - - movdqa 32-128(%rax),%xmm0 - paddd %xmm11,%xmm0 -.byte 102,68,15,56,0,227 - leaq 64(%r10),%r10 - movups -48(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movups -32(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,202 - - movdqa 64-128(%rax),%xmm0 - paddd %xmm12,%xmm0 -.byte 102,68,15,56,0,235 -.byte 69,15,56,204,211 - movups -16(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movdqa %xmm13,%xmm3 -.byte 102,65,15,58,15,220,4 - paddd %xmm3,%xmm10 - movups 0(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,202 - - movdqa 96-128(%rax),%xmm0 - paddd %xmm13,%xmm0 -.byte 69,15,56,205,213 -.byte 69,15,56,204,220 - movups 16(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movups 32(%rcx),%xmm4 - aesenc %xmm5,%xmm6 - movdqa %xmm10,%xmm3 -.byte 102,65,15,58,15,221,4 - paddd %xmm3,%xmm11 -.byte 15,56,203,202 - movdqa 128-128(%rax),%xmm0 - paddd %xmm10,%xmm0 -.byte 69,15,56,205,218 -.byte 69,15,56,204,229 - movups 48(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movdqa %xmm11,%xmm3 -.byte 102,65,15,58,15,218,4 - paddd %xmm3,%xmm12 - cmpl $11,%r11d - jb .Laesenclast1 - movups 64(%rcx),%xmm4 - aesenc %xmm5,%xmm6 - movups 80(%rcx),%xmm5 - aesenc %xmm4,%xmm6 - je .Laesenclast1 - movups 96(%rcx),%xmm4 - aesenc %xmm5,%xmm6 - movups 112(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.Laesenclast1: - aesenclast %xmm5,%xmm6 - movups 16-112(%rcx),%xmm4 - nop -.byte 15,56,203,202 - movups 16(%rdi),%xmm14 - xorps %xmm15,%xmm14 - movups %xmm6,0(%rsi,%rdi,1) - xorps %xmm14,%xmm6 - movups -80(%rcx),%xmm5 - aesenc %xmm4,%xmm6 - movdqa 160-128(%rax),%xmm0 - paddd %xmm11,%xmm0 -.byte 69,15,56,205,227 -.byte 69,15,56,204,234 - movups -64(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movdqa %xmm12,%xmm3 -.byte 102,65,15,58,15,219,4 - paddd %xmm3,%xmm13 - movups -48(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,202 - movdqa 192-128(%rax),%xmm0 - paddd %xmm12,%xmm0 -.byte 69,15,56,205,236 -.byte 69,15,56,204,211 - movups -32(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movdqa %xmm13,%xmm3 -.byte 102,65,15,58,15,220,4 - paddd %xmm3,%xmm10 - movups -16(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,202 - movdqa 224-128(%rax),%xmm0 - paddd %xmm13,%xmm0 -.byte 69,15,56,205,213 -.byte 69,15,56,204,220 - movups 0(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movdqa %xmm10,%xmm3 -.byte 102,65,15,58,15,221,4 - paddd %xmm3,%xmm11 - movups 16(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,202 - movdqa 256-128(%rax),%xmm0 - paddd %xmm10,%xmm0 -.byte 69,15,56,205,218 -.byte 69,15,56,204,229 - movups 32(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movdqa %xmm11,%xmm3 -.byte 102,65,15,58,15,218,4 - paddd %xmm3,%xmm12 - movups 48(%rcx),%xmm5 - aesenc %xmm4,%xmm6 - cmpl $11,%r11d - jb .Laesenclast2 - movups 64(%rcx),%xmm4 - aesenc %xmm5,%xmm6 - movups 80(%rcx),%xmm5 - aesenc %xmm4,%xmm6 - je .Laesenclast2 - movups 96(%rcx),%xmm4 - aesenc %xmm5,%xmm6 - movups 112(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.Laesenclast2: - aesenclast %xmm5,%xmm6 - movups 16-112(%rcx),%xmm4 - nop -.byte 15,56,203,202 - movups 32(%rdi),%xmm14 - xorps %xmm15,%xmm14 - movups %xmm6,16(%rsi,%rdi,1) - xorps %xmm14,%xmm6 - movups -80(%rcx),%xmm5 - aesenc %xmm4,%xmm6 - movdqa 288-128(%rax),%xmm0 - paddd %xmm11,%xmm0 -.byte 69,15,56,205,227 -.byte 69,15,56,204,234 - movups -64(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movdqa %xmm12,%xmm3 -.byte 102,65,15,58,15,219,4 - paddd %xmm3,%xmm13 - movups -48(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,202 - movdqa 320-128(%rax),%xmm0 - paddd %xmm12,%xmm0 -.byte 69,15,56,205,236 -.byte 69,15,56,204,211 - movups -32(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movdqa %xmm13,%xmm3 -.byte 102,65,15,58,15,220,4 - paddd %xmm3,%xmm10 - movups -16(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,202 - movdqa 352-128(%rax),%xmm0 - paddd %xmm13,%xmm0 -.byte 69,15,56,205,213 -.byte 69,15,56,204,220 - movups 0(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movdqa %xmm10,%xmm3 -.byte 102,65,15,58,15,221,4 - paddd %xmm3,%xmm11 - movups 16(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,202 - movdqa 384-128(%rax),%xmm0 - paddd %xmm10,%xmm0 -.byte 69,15,56,205,218 -.byte 69,15,56,204,229 - movups 32(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movdqa %xmm11,%xmm3 -.byte 102,65,15,58,15,218,4 - paddd %xmm3,%xmm12 - movups 48(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,202 - movdqa 416-128(%rax),%xmm0 - paddd %xmm11,%xmm0 -.byte 69,15,56,205,227 -.byte 69,15,56,204,234 - cmpl $11,%r11d - jb .Laesenclast3 - movups 64(%rcx),%xmm4 - aesenc %xmm5,%xmm6 - movups 80(%rcx),%xmm5 - aesenc %xmm4,%xmm6 - je .Laesenclast3 - movups 96(%rcx),%xmm4 - aesenc %xmm5,%xmm6 - movups 112(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.Laesenclast3: - aesenclast %xmm5,%xmm6 - movups 16-112(%rcx),%xmm4 - nop -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movdqa %xmm12,%xmm3 -.byte 102,65,15,58,15,219,4 - paddd %xmm3,%xmm13 - movups 48(%rdi),%xmm14 - xorps %xmm15,%xmm14 - movups %xmm6,32(%rsi,%rdi,1) - xorps %xmm14,%xmm6 - movups -80(%rcx),%xmm5 - aesenc %xmm4,%xmm6 - movups -64(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,202 - - movdqa 448-128(%rax),%xmm0 - paddd %xmm12,%xmm0 -.byte 69,15,56,205,236 - movdqa %xmm7,%xmm3 - movups -48(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movups -32(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,202 - - movdqa 480-128(%rax),%xmm0 - paddd %xmm13,%xmm0 - movups -16(%rcx),%xmm5 - aesenc %xmm4,%xmm6 - movups 0(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movups 16(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,202 - - movups 32(%rcx),%xmm4 - aesenc %xmm5,%xmm6 - movups 48(%rcx),%xmm5 - aesenc %xmm4,%xmm6 - cmpl $11,%r11d - jb .Laesenclast4 - movups 64(%rcx),%xmm4 - aesenc %xmm5,%xmm6 - movups 80(%rcx),%xmm5 - aesenc %xmm4,%xmm6 - je .Laesenclast4 - movups 96(%rcx),%xmm4 - aesenc %xmm5,%xmm6 - movups 112(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.Laesenclast4: - aesenclast %xmm5,%xmm6 - movups 16-112(%rcx),%xmm4 - nop - - paddd %xmm9,%xmm2 - paddd %xmm8,%xmm1 - - decq %rdx - movups %xmm6,48(%rsi,%rdi,1) - leaq 64(%rdi),%rdi - jnz .Loop_shaext - - pshufd $177,%xmm2,%xmm2 - pshufd $27,%xmm1,%xmm3 - pshufd $177,%xmm1,%xmm1 - punpckhqdq %xmm2,%xmm1 -.byte 102,15,58,15,211,8 - - movups %xmm6,(%r8) - movdqu %xmm1,(%r9) - movdqu %xmm2,16(%r9) - .byte 0xf3,0xc3 -.size aesni_cbc_sha256_enc_shaext,.-aesni_cbc_sha256_enc_shaext diff --git a/deps/openssl/asm/x64-elf-gas/bn/rsaz-avx2.s b/deps/openssl/asm/x64-elf-gas/bn/rsaz-avx2.s index 8f356fc3d51a4e..d8b8bd8de5a4b3 100644 --- a/deps/openssl/asm/x64-elf-gas/bn/rsaz-avx2.s +++ b/deps/openssl/asm/x64-elf-gas/bn/rsaz-avx2.s @@ -1,1632 +1,25 @@ .text +.globl rsaz_avx2_eligible +.type rsaz_avx2_eligible,@function +rsaz_avx2_eligible: + xorl %eax,%eax + .byte 0xf3,0xc3 +.size rsaz_avx2_eligible,.-rsaz_avx2_eligible + .globl rsaz_1024_sqr_avx2 +.globl rsaz_1024_mul_avx2 +.globl rsaz_1024_norm2red_avx2 +.globl rsaz_1024_red2norm_avx2 +.globl rsaz_1024_scatter5_avx2 +.globl rsaz_1024_gather5_avx2 .type rsaz_1024_sqr_avx2,@function -.align 64 rsaz_1024_sqr_avx2: - leaq (%rsp),%rax - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - vzeroupper - movq %rax,%rbp - movq %rdx,%r13 - subq $832,%rsp - movq %r13,%r15 - subq $-128,%rdi - subq $-128,%rsi - subq $-128,%r13 - - andq $4095,%r15 - addq $320,%r15 - shrq $12,%r15 - vpxor %ymm9,%ymm9,%ymm9 - jz .Lsqr_1024_no_n_copy - - - - - - subq $320,%rsp - vmovdqu 0-128(%r13),%ymm0 - andq $-2048,%rsp - vmovdqu 32-128(%r13),%ymm1 - vmovdqu 64-128(%r13),%ymm2 - vmovdqu 96-128(%r13),%ymm3 - vmovdqu 128-128(%r13),%ymm4 - vmovdqu 160-128(%r13),%ymm5 - vmovdqu 192-128(%r13),%ymm6 - vmovdqu 224-128(%r13),%ymm7 - vmovdqu 256-128(%r13),%ymm8 - leaq 832+128(%rsp),%r13 - vmovdqu %ymm0,0-128(%r13) - vmovdqu %ymm1,32-128(%r13) - vmovdqu %ymm2,64-128(%r13) - vmovdqu %ymm3,96-128(%r13) - vmovdqu %ymm4,128-128(%r13) - vmovdqu %ymm5,160-128(%r13) - vmovdqu %ymm6,192-128(%r13) - vmovdqu %ymm7,224-128(%r13) - vmovdqu %ymm8,256-128(%r13) - vmovdqu %ymm9,288-128(%r13) - -.Lsqr_1024_no_n_copy: - andq $-1024,%rsp - - vmovdqu 32-128(%rsi),%ymm1 - vmovdqu 64-128(%rsi),%ymm2 - vmovdqu 96-128(%rsi),%ymm3 - vmovdqu 128-128(%rsi),%ymm4 - vmovdqu 160-128(%rsi),%ymm5 - vmovdqu 192-128(%rsi),%ymm6 - vmovdqu 224-128(%rsi),%ymm7 - vmovdqu 256-128(%rsi),%ymm8 - - leaq 192(%rsp),%rbx - vpbroadcastq .Land_mask(%rip),%ymm15 - jmp .LOOP_GRANDE_SQR_1024 - -.align 32 -.LOOP_GRANDE_SQR_1024: - leaq 576+128(%rsp),%r9 - leaq 448(%rsp),%r12 - - - - - vpaddq %ymm1,%ymm1,%ymm1 - vpbroadcastq 0-128(%rsi),%ymm10 - vpaddq %ymm2,%ymm2,%ymm2 - vmovdqa %ymm1,0-128(%r9) - vpaddq %ymm3,%ymm3,%ymm3 - vmovdqa %ymm2,32-128(%r9) - vpaddq %ymm4,%ymm4,%ymm4 - vmovdqa %ymm3,64-128(%r9) - vpaddq %ymm5,%ymm5,%ymm5 - vmovdqa %ymm4,96-128(%r9) - vpaddq %ymm6,%ymm6,%ymm6 - vmovdqa %ymm5,128-128(%r9) - vpaddq %ymm7,%ymm7,%ymm7 - vmovdqa %ymm6,160-128(%r9) - vpaddq %ymm8,%ymm8,%ymm8 - vmovdqa %ymm7,192-128(%r9) - vpxor %ymm9,%ymm9,%ymm9 - vmovdqa %ymm8,224-128(%r9) - - vpmuludq 0-128(%rsi),%ymm10,%ymm0 - vpbroadcastq 32-128(%rsi),%ymm11 - vmovdqu %ymm9,288-192(%rbx) - vpmuludq %ymm10,%ymm1,%ymm1 - vmovdqu %ymm9,320-448(%r12) - vpmuludq %ymm10,%ymm2,%ymm2 - vmovdqu %ymm9,352-448(%r12) - vpmuludq %ymm10,%ymm3,%ymm3 - vmovdqu %ymm9,384-448(%r12) - vpmuludq %ymm10,%ymm4,%ymm4 - vmovdqu %ymm9,416-448(%r12) - vpmuludq %ymm10,%ymm5,%ymm5 - vmovdqu %ymm9,448-448(%r12) - vpmuludq %ymm10,%ymm6,%ymm6 - vmovdqu %ymm9,480-448(%r12) - vpmuludq %ymm10,%ymm7,%ymm7 - vmovdqu %ymm9,512-448(%r12) - vpmuludq %ymm10,%ymm8,%ymm8 - vpbroadcastq 64-128(%rsi),%ymm10 - vmovdqu %ymm9,544-448(%r12) - - movq %rsi,%r15 - movl $4,%r14d - jmp .Lsqr_entry_1024 -.align 32 -.LOOP_SQR_1024: - vpbroadcastq 32-128(%r15),%ymm11 - vpmuludq 0-128(%rsi),%ymm10,%ymm0 - vpaddq 0-192(%rbx),%ymm0,%ymm0 - vpmuludq 0-128(%r9),%ymm10,%ymm1 - vpaddq 32-192(%rbx),%ymm1,%ymm1 - vpmuludq 32-128(%r9),%ymm10,%ymm2 - vpaddq 64-192(%rbx),%ymm2,%ymm2 - vpmuludq 64-128(%r9),%ymm10,%ymm3 - vpaddq 96-192(%rbx),%ymm3,%ymm3 - vpmuludq 96-128(%r9),%ymm10,%ymm4 - vpaddq 128-192(%rbx),%ymm4,%ymm4 - vpmuludq 128-128(%r9),%ymm10,%ymm5 - vpaddq 160-192(%rbx),%ymm5,%ymm5 - vpmuludq 160-128(%r9),%ymm10,%ymm6 - vpaddq 192-192(%rbx),%ymm6,%ymm6 - vpmuludq 192-128(%r9),%ymm10,%ymm7 - vpaddq 224-192(%rbx),%ymm7,%ymm7 - vpmuludq 224-128(%r9),%ymm10,%ymm8 - vpbroadcastq 64-128(%r15),%ymm10 - vpaddq 256-192(%rbx),%ymm8,%ymm8 -.Lsqr_entry_1024: - vmovdqu %ymm0,0-192(%rbx) - vmovdqu %ymm1,32-192(%rbx) - - vpmuludq 32-128(%rsi),%ymm11,%ymm12 - vpaddq %ymm12,%ymm2,%ymm2 - vpmuludq 32-128(%r9),%ymm11,%ymm14 - vpaddq %ymm14,%ymm3,%ymm3 - vpmuludq 64-128(%r9),%ymm11,%ymm13 - vpaddq %ymm13,%ymm4,%ymm4 - vpmuludq 96-128(%r9),%ymm11,%ymm12 - vpaddq %ymm12,%ymm5,%ymm5 - vpmuludq 128-128(%r9),%ymm11,%ymm14 - vpaddq %ymm14,%ymm6,%ymm6 - vpmuludq 160-128(%r9),%ymm11,%ymm13 - vpaddq %ymm13,%ymm7,%ymm7 - vpmuludq 192-128(%r9),%ymm11,%ymm12 - vpaddq %ymm12,%ymm8,%ymm8 - vpmuludq 224-128(%r9),%ymm11,%ymm0 - vpbroadcastq 96-128(%r15),%ymm11 - vpaddq 288-192(%rbx),%ymm0,%ymm0 - - vmovdqu %ymm2,64-192(%rbx) - vmovdqu %ymm3,96-192(%rbx) - - vpmuludq 64-128(%rsi),%ymm10,%ymm13 - vpaddq %ymm13,%ymm4,%ymm4 - vpmuludq 64-128(%r9),%ymm10,%ymm12 - vpaddq %ymm12,%ymm5,%ymm5 - vpmuludq 96-128(%r9),%ymm10,%ymm14 - vpaddq %ymm14,%ymm6,%ymm6 - vpmuludq 128-128(%r9),%ymm10,%ymm13 - vpaddq %ymm13,%ymm7,%ymm7 - vpmuludq 160-128(%r9),%ymm10,%ymm12 - vpaddq %ymm12,%ymm8,%ymm8 - vpmuludq 192-128(%r9),%ymm10,%ymm14 - vpaddq %ymm14,%ymm0,%ymm0 - vpmuludq 224-128(%r9),%ymm10,%ymm1 - vpbroadcastq 128-128(%r15),%ymm10 - vpaddq 320-448(%r12),%ymm1,%ymm1 - - vmovdqu %ymm4,128-192(%rbx) - vmovdqu %ymm5,160-192(%rbx) - - vpmuludq 96-128(%rsi),%ymm11,%ymm12 - vpaddq %ymm12,%ymm6,%ymm6 - vpmuludq 96-128(%r9),%ymm11,%ymm14 - vpaddq %ymm14,%ymm7,%ymm7 - vpmuludq 128-128(%r9),%ymm11,%ymm13 - vpaddq %ymm13,%ymm8,%ymm8 - vpmuludq 160-128(%r9),%ymm11,%ymm12 - vpaddq %ymm12,%ymm0,%ymm0 - vpmuludq 192-128(%r9),%ymm11,%ymm14 - vpaddq %ymm14,%ymm1,%ymm1 - vpmuludq 224-128(%r9),%ymm11,%ymm2 - vpbroadcastq 160-128(%r15),%ymm11 - vpaddq 352-448(%r12),%ymm2,%ymm2 - - vmovdqu %ymm6,192-192(%rbx) - vmovdqu %ymm7,224-192(%rbx) - - vpmuludq 128-128(%rsi),%ymm10,%ymm12 - vpaddq %ymm12,%ymm8,%ymm8 - vpmuludq 128-128(%r9),%ymm10,%ymm14 - vpaddq %ymm14,%ymm0,%ymm0 - vpmuludq 160-128(%r9),%ymm10,%ymm13 - vpaddq %ymm13,%ymm1,%ymm1 - vpmuludq 192-128(%r9),%ymm10,%ymm12 - vpaddq %ymm12,%ymm2,%ymm2 - vpmuludq 224-128(%r9),%ymm10,%ymm3 - vpbroadcastq 192-128(%r15),%ymm10 - vpaddq 384-448(%r12),%ymm3,%ymm3 - - vmovdqu %ymm8,256-192(%rbx) - vmovdqu %ymm0,288-192(%rbx) - leaq 8(%rbx),%rbx - - vpmuludq 160-128(%rsi),%ymm11,%ymm13 - vpaddq %ymm13,%ymm1,%ymm1 - vpmuludq 160-128(%r9),%ymm11,%ymm12 - vpaddq %ymm12,%ymm2,%ymm2 - vpmuludq 192-128(%r9),%ymm11,%ymm14 - vpaddq %ymm14,%ymm3,%ymm3 - vpmuludq 224-128(%r9),%ymm11,%ymm4 - vpbroadcastq 224-128(%r15),%ymm11 - vpaddq 416-448(%r12),%ymm4,%ymm4 - - vmovdqu %ymm1,320-448(%r12) - vmovdqu %ymm2,352-448(%r12) - - vpmuludq 192-128(%rsi),%ymm10,%ymm12 - vpaddq %ymm12,%ymm3,%ymm3 - vpmuludq 192-128(%r9),%ymm10,%ymm14 - vpbroadcastq 256-128(%r15),%ymm0 - vpaddq %ymm14,%ymm4,%ymm4 - vpmuludq 224-128(%r9),%ymm10,%ymm5 - vpbroadcastq 0+8-128(%r15),%ymm10 - vpaddq 448-448(%r12),%ymm5,%ymm5 - - vmovdqu %ymm3,384-448(%r12) - vmovdqu %ymm4,416-448(%r12) - leaq 8(%r15),%r15 - - vpmuludq 224-128(%rsi),%ymm11,%ymm12 - vpaddq %ymm12,%ymm5,%ymm5 - vpmuludq 224-128(%r9),%ymm11,%ymm6 - vpaddq 480-448(%r12),%ymm6,%ymm6 - - vpmuludq 256-128(%rsi),%ymm0,%ymm7 - vmovdqu %ymm5,448-448(%r12) - vpaddq 512-448(%r12),%ymm7,%ymm7 - vmovdqu %ymm6,480-448(%r12) - vmovdqu %ymm7,512-448(%r12) - leaq 8(%r12),%r12 - - decl %r14d - jnz .LOOP_SQR_1024 - - vmovdqu 256(%rsp),%ymm8 - vmovdqu 288(%rsp),%ymm1 - vmovdqu 320(%rsp),%ymm2 - leaq 192(%rsp),%rbx - - vpsrlq $29,%ymm8,%ymm14 - vpand %ymm15,%ymm8,%ymm8 - vpsrlq $29,%ymm1,%ymm11 - vpand %ymm15,%ymm1,%ymm1 - - vpermq $147,%ymm14,%ymm14 - vpxor %ymm9,%ymm9,%ymm9 - vpermq $147,%ymm11,%ymm11 - - vpblendd $3,%ymm9,%ymm14,%ymm10 - vpblendd $3,%ymm14,%ymm11,%ymm14 - vpaddq %ymm10,%ymm8,%ymm8 - vpblendd $3,%ymm11,%ymm9,%ymm11 - vpaddq %ymm14,%ymm1,%ymm1 - vpaddq %ymm11,%ymm2,%ymm2 - vmovdqu %ymm1,288-192(%rbx) - vmovdqu %ymm2,320-192(%rbx) - - movq (%rsp),%rax - movq 8(%rsp),%r10 - movq 16(%rsp),%r11 - movq 24(%rsp),%r12 - vmovdqu 32(%rsp),%ymm1 - vmovdqu 64-192(%rbx),%ymm2 - vmovdqu 96-192(%rbx),%ymm3 - vmovdqu 128-192(%rbx),%ymm4 - vmovdqu 160-192(%rbx),%ymm5 - vmovdqu 192-192(%rbx),%ymm6 - vmovdqu 224-192(%rbx),%ymm7 - - movq %rax,%r9 - imull %ecx,%eax - andl $536870911,%eax - vmovd %eax,%xmm12 - - movq %rax,%rdx - imulq -128(%r13),%rax - vpbroadcastq %xmm12,%ymm12 - addq %rax,%r9 - movq %rdx,%rax - imulq 8-128(%r13),%rax - shrq $29,%r9 - addq %rax,%r10 - movq %rdx,%rax - imulq 16-128(%r13),%rax - addq %r9,%r10 - addq %rax,%r11 - imulq 24-128(%r13),%rdx - addq %rdx,%r12 - - movq %r10,%rax - imull %ecx,%eax - andl $536870911,%eax - - movl $9,%r14d - jmp .LOOP_REDUCE_1024 - -.align 32 -.LOOP_REDUCE_1024: - vmovd %eax,%xmm13 - vpbroadcastq %xmm13,%ymm13 - - vpmuludq 32-128(%r13),%ymm12,%ymm10 - movq %rax,%rdx - imulq -128(%r13),%rax - vpaddq %ymm10,%ymm1,%ymm1 - addq %rax,%r10 - vpmuludq 64-128(%r13),%ymm12,%ymm14 - movq %rdx,%rax - imulq 8-128(%r13),%rax - vpaddq %ymm14,%ymm2,%ymm2 - vpmuludq 96-128(%r13),%ymm12,%ymm11 -.byte 0x67 - addq %rax,%r11 -.byte 0x67 - movq %rdx,%rax - imulq 16-128(%r13),%rax - shrq $29,%r10 - vpaddq %ymm11,%ymm3,%ymm3 - vpmuludq 128-128(%r13),%ymm12,%ymm10 - addq %rax,%r12 - addq %r10,%r11 - vpaddq %ymm10,%ymm4,%ymm4 - vpmuludq 160-128(%r13),%ymm12,%ymm14 - movq %r11,%rax - imull %ecx,%eax - vpaddq %ymm14,%ymm5,%ymm5 - vpmuludq 192-128(%r13),%ymm12,%ymm11 - andl $536870911,%eax - vpaddq %ymm11,%ymm6,%ymm6 - vpmuludq 224-128(%r13),%ymm12,%ymm10 - vpaddq %ymm10,%ymm7,%ymm7 - vpmuludq 256-128(%r13),%ymm12,%ymm14 - vmovd %eax,%xmm12 - - vpaddq %ymm14,%ymm8,%ymm8 - - vpbroadcastq %xmm12,%ymm12 - - vpmuludq 32-8-128(%r13),%ymm13,%ymm11 - vmovdqu 96-8-128(%r13),%ymm14 - movq %rax,%rdx - imulq -128(%r13),%rax - vpaddq %ymm11,%ymm1,%ymm1 - vpmuludq 64-8-128(%r13),%ymm13,%ymm10 - vmovdqu 128-8-128(%r13),%ymm11 - addq %rax,%r11 - movq %rdx,%rax - imulq 8-128(%r13),%rax - vpaddq %ymm10,%ymm2,%ymm2 - addq %r12,%rax - shrq $29,%r11 - vpmuludq %ymm13,%ymm14,%ymm14 - vmovdqu 160-8-128(%r13),%ymm10 - addq %r11,%rax - vpaddq %ymm14,%ymm3,%ymm3 - vpmuludq %ymm13,%ymm11,%ymm11 - vmovdqu 192-8-128(%r13),%ymm14 -.byte 0x67 - movq %rax,%r12 - imull %ecx,%eax - vpaddq %ymm11,%ymm4,%ymm4 - vpmuludq %ymm13,%ymm10,%ymm10 -.byte 0xc4,0x41,0x7e,0x6f,0x9d,0x58,0x00,0x00,0x00 - andl $536870911,%eax - vpaddq %ymm10,%ymm5,%ymm5 - vpmuludq %ymm13,%ymm14,%ymm14 - vmovdqu 256-8-128(%r13),%ymm10 - vpaddq %ymm14,%ymm6,%ymm6 - vpmuludq %ymm13,%ymm11,%ymm11 - vmovdqu 288-8-128(%r13),%ymm9 - vmovd %eax,%xmm0 - imulq -128(%r13),%rax - vpaddq %ymm11,%ymm7,%ymm7 - vpmuludq %ymm13,%ymm10,%ymm10 - vmovdqu 32-16-128(%r13),%ymm14 - vpbroadcastq %xmm0,%ymm0 - vpaddq %ymm10,%ymm8,%ymm8 - vpmuludq %ymm13,%ymm9,%ymm9 - vmovdqu 64-16-128(%r13),%ymm11 - addq %rax,%r12 - - vmovdqu 32-24-128(%r13),%ymm13 - vpmuludq %ymm12,%ymm14,%ymm14 - vmovdqu 96-16-128(%r13),%ymm10 - vpaddq %ymm14,%ymm1,%ymm1 - vpmuludq %ymm0,%ymm13,%ymm13 - vpmuludq %ymm12,%ymm11,%ymm11 -.byte 0xc4,0x41,0x7e,0x6f,0xb5,0xf0,0xff,0xff,0xff - vpaddq %ymm1,%ymm13,%ymm13 - vpaddq %ymm11,%ymm2,%ymm2 - vpmuludq %ymm12,%ymm10,%ymm10 - vmovdqu 160-16-128(%r13),%ymm11 -.byte 0x67 - vmovq %xmm13,%rax - vmovdqu %ymm13,(%rsp) - vpaddq %ymm10,%ymm3,%ymm3 - vpmuludq %ymm12,%ymm14,%ymm14 - vmovdqu 192-16-128(%r13),%ymm10 - vpaddq %ymm14,%ymm4,%ymm4 - vpmuludq %ymm12,%ymm11,%ymm11 - vmovdqu 224-16-128(%r13),%ymm14 - vpaddq %ymm11,%ymm5,%ymm5 - vpmuludq %ymm12,%ymm10,%ymm10 - vmovdqu 256-16-128(%r13),%ymm11 - vpaddq %ymm10,%ymm6,%ymm6 - vpmuludq %ymm12,%ymm14,%ymm14 - shrq $29,%r12 - vmovdqu 288-16-128(%r13),%ymm10 - addq %r12,%rax - vpaddq %ymm14,%ymm7,%ymm7 - vpmuludq %ymm12,%ymm11,%ymm11 - - movq %rax,%r9 - imull %ecx,%eax - vpaddq %ymm11,%ymm8,%ymm8 - vpmuludq %ymm12,%ymm10,%ymm10 - andl $536870911,%eax - vmovd %eax,%xmm12 - vmovdqu 96-24-128(%r13),%ymm11 -.byte 0x67 - vpaddq %ymm10,%ymm9,%ymm9 - vpbroadcastq %xmm12,%ymm12 - - vpmuludq 64-24-128(%r13),%ymm0,%ymm14 - vmovdqu 128-24-128(%r13),%ymm10 - movq %rax,%rdx - imulq -128(%r13),%rax - movq 8(%rsp),%r10 - vpaddq %ymm14,%ymm2,%ymm1 - vpmuludq %ymm0,%ymm11,%ymm11 - vmovdqu 160-24-128(%r13),%ymm14 - addq %rax,%r9 - movq %rdx,%rax - imulq 8-128(%r13),%rax -.byte 0x67 - shrq $29,%r9 - movq 16(%rsp),%r11 - vpaddq %ymm11,%ymm3,%ymm2 - vpmuludq %ymm0,%ymm10,%ymm10 - vmovdqu 192-24-128(%r13),%ymm11 - addq %rax,%r10 - movq %rdx,%rax - imulq 16-128(%r13),%rax - vpaddq %ymm10,%ymm4,%ymm3 - vpmuludq %ymm0,%ymm14,%ymm14 - vmovdqu 224-24-128(%r13),%ymm10 - imulq 24-128(%r13),%rdx - addq %rax,%r11 - leaq (%r9,%r10,1),%rax - vpaddq %ymm14,%ymm5,%ymm4 - vpmuludq %ymm0,%ymm11,%ymm11 - vmovdqu 256-24-128(%r13),%ymm14 - movq %rax,%r10 - imull %ecx,%eax - vpmuludq %ymm0,%ymm10,%ymm10 - vpaddq %ymm11,%ymm6,%ymm5 - vmovdqu 288-24-128(%r13),%ymm11 - andl $536870911,%eax - vpaddq %ymm10,%ymm7,%ymm6 - vpmuludq %ymm0,%ymm14,%ymm14 - addq 24(%rsp),%rdx - vpaddq %ymm14,%ymm8,%ymm7 - vpmuludq %ymm0,%ymm11,%ymm11 - vpaddq %ymm11,%ymm9,%ymm8 - vmovq %r12,%xmm9 - movq %rdx,%r12 - - decl %r14d - jnz .LOOP_REDUCE_1024 - leaq 448(%rsp),%r12 - vpaddq %ymm9,%ymm13,%ymm0 - vpxor %ymm9,%ymm9,%ymm9 - - vpaddq 288-192(%rbx),%ymm0,%ymm0 - vpaddq 320-448(%r12),%ymm1,%ymm1 - vpaddq 352-448(%r12),%ymm2,%ymm2 - vpaddq 384-448(%r12),%ymm3,%ymm3 - vpaddq 416-448(%r12),%ymm4,%ymm4 - vpaddq 448-448(%r12),%ymm5,%ymm5 - vpaddq 480-448(%r12),%ymm6,%ymm6 - vpaddq 512-448(%r12),%ymm7,%ymm7 - vpaddq 544-448(%r12),%ymm8,%ymm8 - - vpsrlq $29,%ymm0,%ymm14 - vpand %ymm15,%ymm0,%ymm0 - vpsrlq $29,%ymm1,%ymm11 - vpand %ymm15,%ymm1,%ymm1 - vpsrlq $29,%ymm2,%ymm12 - vpermq $147,%ymm14,%ymm14 - vpand %ymm15,%ymm2,%ymm2 - vpsrlq $29,%ymm3,%ymm13 - vpermq $147,%ymm11,%ymm11 - vpand %ymm15,%ymm3,%ymm3 - vpermq $147,%ymm12,%ymm12 - - vpblendd $3,%ymm9,%ymm14,%ymm10 - vpermq $147,%ymm13,%ymm13 - vpblendd $3,%ymm14,%ymm11,%ymm14 - vpaddq %ymm10,%ymm0,%ymm0 - vpblendd $3,%ymm11,%ymm12,%ymm11 - vpaddq %ymm14,%ymm1,%ymm1 - vpblendd $3,%ymm12,%ymm13,%ymm12 - vpaddq %ymm11,%ymm2,%ymm2 - vpblendd $3,%ymm13,%ymm9,%ymm13 - vpaddq %ymm12,%ymm3,%ymm3 - vpaddq %ymm13,%ymm4,%ymm4 - - vpsrlq $29,%ymm0,%ymm14 - vpand %ymm15,%ymm0,%ymm0 - vpsrlq $29,%ymm1,%ymm11 - vpand %ymm15,%ymm1,%ymm1 - vpsrlq $29,%ymm2,%ymm12 - vpermq $147,%ymm14,%ymm14 - vpand %ymm15,%ymm2,%ymm2 - vpsrlq $29,%ymm3,%ymm13 - vpermq $147,%ymm11,%ymm11 - vpand %ymm15,%ymm3,%ymm3 - vpermq $147,%ymm12,%ymm12 - - vpblendd $3,%ymm9,%ymm14,%ymm10 - vpermq $147,%ymm13,%ymm13 - vpblendd $3,%ymm14,%ymm11,%ymm14 - vpaddq %ymm10,%ymm0,%ymm0 - vpblendd $3,%ymm11,%ymm12,%ymm11 - vpaddq %ymm14,%ymm1,%ymm1 - vmovdqu %ymm0,0-128(%rdi) - vpblendd $3,%ymm12,%ymm13,%ymm12 - vpaddq %ymm11,%ymm2,%ymm2 - vmovdqu %ymm1,32-128(%rdi) - vpblendd $3,%ymm13,%ymm9,%ymm13 - vpaddq %ymm12,%ymm3,%ymm3 - vmovdqu %ymm2,64-128(%rdi) - vpaddq %ymm13,%ymm4,%ymm4 - vmovdqu %ymm3,96-128(%rdi) - vpsrlq $29,%ymm4,%ymm14 - vpand %ymm15,%ymm4,%ymm4 - vpsrlq $29,%ymm5,%ymm11 - vpand %ymm15,%ymm5,%ymm5 - vpsrlq $29,%ymm6,%ymm12 - vpermq $147,%ymm14,%ymm14 - vpand %ymm15,%ymm6,%ymm6 - vpsrlq $29,%ymm7,%ymm13 - vpermq $147,%ymm11,%ymm11 - vpand %ymm15,%ymm7,%ymm7 - vpsrlq $29,%ymm8,%ymm0 - vpermq $147,%ymm12,%ymm12 - vpand %ymm15,%ymm8,%ymm8 - vpermq $147,%ymm13,%ymm13 - - vpblendd $3,%ymm9,%ymm14,%ymm10 - vpermq $147,%ymm0,%ymm0 - vpblendd $3,%ymm14,%ymm11,%ymm14 - vpaddq %ymm10,%ymm4,%ymm4 - vpblendd $3,%ymm11,%ymm12,%ymm11 - vpaddq %ymm14,%ymm5,%ymm5 - vpblendd $3,%ymm12,%ymm13,%ymm12 - vpaddq %ymm11,%ymm6,%ymm6 - vpblendd $3,%ymm13,%ymm0,%ymm13 - vpaddq %ymm12,%ymm7,%ymm7 - vpaddq %ymm13,%ymm8,%ymm8 - - vpsrlq $29,%ymm4,%ymm14 - vpand %ymm15,%ymm4,%ymm4 - vpsrlq $29,%ymm5,%ymm11 - vpand %ymm15,%ymm5,%ymm5 - vpsrlq $29,%ymm6,%ymm12 - vpermq $147,%ymm14,%ymm14 - vpand %ymm15,%ymm6,%ymm6 - vpsrlq $29,%ymm7,%ymm13 - vpermq $147,%ymm11,%ymm11 - vpand %ymm15,%ymm7,%ymm7 - vpsrlq $29,%ymm8,%ymm0 - vpermq $147,%ymm12,%ymm12 - vpand %ymm15,%ymm8,%ymm8 - vpermq $147,%ymm13,%ymm13 - - vpblendd $3,%ymm9,%ymm14,%ymm10 - vpermq $147,%ymm0,%ymm0 - vpblendd $3,%ymm14,%ymm11,%ymm14 - vpaddq %ymm10,%ymm4,%ymm4 - vpblendd $3,%ymm11,%ymm12,%ymm11 - vpaddq %ymm14,%ymm5,%ymm5 - vmovdqu %ymm4,128-128(%rdi) - vpblendd $3,%ymm12,%ymm13,%ymm12 - vpaddq %ymm11,%ymm6,%ymm6 - vmovdqu %ymm5,160-128(%rdi) - vpblendd $3,%ymm13,%ymm0,%ymm13 - vpaddq %ymm12,%ymm7,%ymm7 - vmovdqu %ymm6,192-128(%rdi) - vpaddq %ymm13,%ymm8,%ymm8 - vmovdqu %ymm7,224-128(%rdi) - vmovdqu %ymm8,256-128(%rdi) - - movq %rdi,%rsi - decl %r8d - jne .LOOP_GRANDE_SQR_1024 - - vzeroall - movq %rbp,%rax - movq -48(%rax),%r15 - movq -40(%rax),%r14 - movq -32(%rax),%r13 - movq -24(%rax),%r12 - movq -16(%rax),%rbp - movq -8(%rax),%rbx - leaq (%rax),%rsp -.Lsqr_1024_epilogue: - .byte 0xf3,0xc3 -.size rsaz_1024_sqr_avx2,.-rsaz_1024_sqr_avx2 -.globl rsaz_1024_mul_avx2 -.type rsaz_1024_mul_avx2,@function -.align 64 rsaz_1024_mul_avx2: - leaq (%rsp),%rax - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - movq %rax,%rbp - vzeroall - movq %rdx,%r13 - subq $64,%rsp - - - - - - -.byte 0x67,0x67 - movq %rsi,%r15 - andq $4095,%r15 - addq $320,%r15 - shrq $12,%r15 - movq %rsi,%r15 - cmovnzq %r13,%rsi - cmovnzq %r15,%r13 - - movq %rcx,%r15 - subq $-128,%rsi - subq $-128,%rcx - subq $-128,%rdi - - andq $4095,%r15 - addq $320,%r15 -.byte 0x67,0x67 - shrq $12,%r15 - jz .Lmul_1024_no_n_copy - - - - - - subq $320,%rsp - vmovdqu 0-128(%rcx),%ymm0 - andq $-512,%rsp - vmovdqu 32-128(%rcx),%ymm1 - vmovdqu 64-128(%rcx),%ymm2 - vmovdqu 96-128(%rcx),%ymm3 - vmovdqu 128-128(%rcx),%ymm4 - vmovdqu 160-128(%rcx),%ymm5 - vmovdqu 192-128(%rcx),%ymm6 - vmovdqu 224-128(%rcx),%ymm7 - vmovdqu 256-128(%rcx),%ymm8 - leaq 64+128(%rsp),%rcx - vmovdqu %ymm0,0-128(%rcx) - vpxor %ymm0,%ymm0,%ymm0 - vmovdqu %ymm1,32-128(%rcx) - vpxor %ymm1,%ymm1,%ymm1 - vmovdqu %ymm2,64-128(%rcx) - vpxor %ymm2,%ymm2,%ymm2 - vmovdqu %ymm3,96-128(%rcx) - vpxor %ymm3,%ymm3,%ymm3 - vmovdqu %ymm4,128-128(%rcx) - vpxor %ymm4,%ymm4,%ymm4 - vmovdqu %ymm5,160-128(%rcx) - vpxor %ymm5,%ymm5,%ymm5 - vmovdqu %ymm6,192-128(%rcx) - vpxor %ymm6,%ymm6,%ymm6 - vmovdqu %ymm7,224-128(%rcx) - vpxor %ymm7,%ymm7,%ymm7 - vmovdqu %ymm8,256-128(%rcx) - vmovdqa %ymm0,%ymm8 - vmovdqu %ymm9,288-128(%rcx) -.Lmul_1024_no_n_copy: - andq $-64,%rsp - - movq (%r13),%rbx - vpbroadcastq (%r13),%ymm10 - vmovdqu %ymm0,(%rsp) - xorq %r9,%r9 -.byte 0x67 - xorq %r10,%r10 - xorq %r11,%r11 - xorq %r12,%r12 - - vmovdqu .Land_mask(%rip),%ymm15 - movl $9,%r14d - vmovdqu %ymm9,288-128(%rdi) - jmp .Loop_mul_1024 - -.align 32 -.Loop_mul_1024: - vpsrlq $29,%ymm3,%ymm9 - movq %rbx,%rax - imulq -128(%rsi),%rax - addq %r9,%rax - movq %rbx,%r10 - imulq 8-128(%rsi),%r10 - addq 8(%rsp),%r10 - - movq %rax,%r9 - imull %r8d,%eax - andl $536870911,%eax - - movq %rbx,%r11 - imulq 16-128(%rsi),%r11 - addq 16(%rsp),%r11 - - movq %rbx,%r12 - imulq 24-128(%rsi),%r12 - addq 24(%rsp),%r12 - vpmuludq 32-128(%rsi),%ymm10,%ymm0 - vmovd %eax,%xmm11 - vpaddq %ymm0,%ymm1,%ymm1 - vpmuludq 64-128(%rsi),%ymm10,%ymm12 - vpbroadcastq %xmm11,%ymm11 - vpaddq %ymm12,%ymm2,%ymm2 - vpmuludq 96-128(%rsi),%ymm10,%ymm13 - vpand %ymm15,%ymm3,%ymm3 - vpaddq %ymm13,%ymm3,%ymm3 - vpmuludq 128-128(%rsi),%ymm10,%ymm0 - vpaddq %ymm0,%ymm4,%ymm4 - vpmuludq 160-128(%rsi),%ymm10,%ymm12 - vpaddq %ymm12,%ymm5,%ymm5 - vpmuludq 192-128(%rsi),%ymm10,%ymm13 - vpaddq %ymm13,%ymm6,%ymm6 - vpmuludq 224-128(%rsi),%ymm10,%ymm0 - vpermq $147,%ymm9,%ymm9 - vpaddq %ymm0,%ymm7,%ymm7 - vpmuludq 256-128(%rsi),%ymm10,%ymm12 - vpbroadcastq 8(%r13),%ymm10 - vpaddq %ymm12,%ymm8,%ymm8 - - movq %rax,%rdx - imulq -128(%rcx),%rax - addq %rax,%r9 - movq %rdx,%rax - imulq 8-128(%rcx),%rax - addq %rax,%r10 - movq %rdx,%rax - imulq 16-128(%rcx),%rax - addq %rax,%r11 - shrq $29,%r9 - imulq 24-128(%rcx),%rdx - addq %rdx,%r12 - addq %r9,%r10 - - vpmuludq 32-128(%rcx),%ymm11,%ymm13 - vmovq %xmm10,%rbx - vpaddq %ymm13,%ymm1,%ymm1 - vpmuludq 64-128(%rcx),%ymm11,%ymm0 - vpaddq %ymm0,%ymm2,%ymm2 - vpmuludq 96-128(%rcx),%ymm11,%ymm12 - vpaddq %ymm12,%ymm3,%ymm3 - vpmuludq 128-128(%rcx),%ymm11,%ymm13 - vpaddq %ymm13,%ymm4,%ymm4 - vpmuludq 160-128(%rcx),%ymm11,%ymm0 - vpaddq %ymm0,%ymm5,%ymm5 - vpmuludq 192-128(%rcx),%ymm11,%ymm12 - vpaddq %ymm12,%ymm6,%ymm6 - vpmuludq 224-128(%rcx),%ymm11,%ymm13 - vpblendd $3,%ymm14,%ymm9,%ymm9 - vpaddq %ymm13,%ymm7,%ymm7 - vpmuludq 256-128(%rcx),%ymm11,%ymm0 - vpaddq %ymm9,%ymm3,%ymm3 - vpaddq %ymm0,%ymm8,%ymm8 - - movq %rbx,%rax - imulq -128(%rsi),%rax - addq %rax,%r10 - vmovdqu -8+32-128(%rsi),%ymm12 - movq %rbx,%rax - imulq 8-128(%rsi),%rax - addq %rax,%r11 - vmovdqu -8+64-128(%rsi),%ymm13 - - movq %r10,%rax - imull %r8d,%eax - andl $536870911,%eax - - imulq 16-128(%rsi),%rbx - addq %rbx,%r12 - vpmuludq %ymm10,%ymm12,%ymm12 - vmovd %eax,%xmm11 - vmovdqu -8+96-128(%rsi),%ymm0 - vpaddq %ymm12,%ymm1,%ymm1 - vpmuludq %ymm10,%ymm13,%ymm13 - vpbroadcastq %xmm11,%ymm11 - vmovdqu -8+128-128(%rsi),%ymm12 - vpaddq %ymm13,%ymm2,%ymm2 - vpmuludq %ymm10,%ymm0,%ymm0 - vmovdqu -8+160-128(%rsi),%ymm13 - vpaddq %ymm0,%ymm3,%ymm3 - vpmuludq %ymm10,%ymm12,%ymm12 - vmovdqu -8+192-128(%rsi),%ymm0 - vpaddq %ymm12,%ymm4,%ymm4 - vpmuludq %ymm10,%ymm13,%ymm13 - vmovdqu -8+224-128(%rsi),%ymm12 - vpaddq %ymm13,%ymm5,%ymm5 - vpmuludq %ymm10,%ymm0,%ymm0 - vmovdqu -8+256-128(%rsi),%ymm13 - vpaddq %ymm0,%ymm6,%ymm6 - vpmuludq %ymm10,%ymm12,%ymm12 - vmovdqu -8+288-128(%rsi),%ymm9 - vpaddq %ymm12,%ymm7,%ymm7 - vpmuludq %ymm10,%ymm13,%ymm13 - vpaddq %ymm13,%ymm8,%ymm8 - vpmuludq %ymm10,%ymm9,%ymm9 - vpbroadcastq 16(%r13),%ymm10 - - movq %rax,%rdx - imulq -128(%rcx),%rax - addq %rax,%r10 - vmovdqu -8+32-128(%rcx),%ymm0 - movq %rdx,%rax - imulq 8-128(%rcx),%rax - addq %rax,%r11 - vmovdqu -8+64-128(%rcx),%ymm12 - shrq $29,%r10 - imulq 16-128(%rcx),%rdx - addq %rdx,%r12 - addq %r10,%r11 - - vpmuludq %ymm11,%ymm0,%ymm0 - vmovq %xmm10,%rbx - vmovdqu -8+96-128(%rcx),%ymm13 - vpaddq %ymm0,%ymm1,%ymm1 - vpmuludq %ymm11,%ymm12,%ymm12 - vmovdqu -8+128-128(%rcx),%ymm0 - vpaddq %ymm12,%ymm2,%ymm2 - vpmuludq %ymm11,%ymm13,%ymm13 - vmovdqu -8+160-128(%rcx),%ymm12 - vpaddq %ymm13,%ymm3,%ymm3 - vpmuludq %ymm11,%ymm0,%ymm0 - vmovdqu -8+192-128(%rcx),%ymm13 - vpaddq %ymm0,%ymm4,%ymm4 - vpmuludq %ymm11,%ymm12,%ymm12 - vmovdqu -8+224-128(%rcx),%ymm0 - vpaddq %ymm12,%ymm5,%ymm5 - vpmuludq %ymm11,%ymm13,%ymm13 - vmovdqu -8+256-128(%rcx),%ymm12 - vpaddq %ymm13,%ymm6,%ymm6 - vpmuludq %ymm11,%ymm0,%ymm0 - vmovdqu -8+288-128(%rcx),%ymm13 - vpaddq %ymm0,%ymm7,%ymm7 - vpmuludq %ymm11,%ymm12,%ymm12 - vpaddq %ymm12,%ymm8,%ymm8 - vpmuludq %ymm11,%ymm13,%ymm13 - vpaddq %ymm13,%ymm9,%ymm9 - - vmovdqu -16+32-128(%rsi),%ymm0 - movq %rbx,%rax - imulq -128(%rsi),%rax - addq %r11,%rax - - vmovdqu -16+64-128(%rsi),%ymm12 - movq %rax,%r11 - imull %r8d,%eax - andl $536870911,%eax - - imulq 8-128(%rsi),%rbx - addq %rbx,%r12 - vpmuludq %ymm10,%ymm0,%ymm0 - vmovd %eax,%xmm11 - vmovdqu -16+96-128(%rsi),%ymm13 - vpaddq %ymm0,%ymm1,%ymm1 - vpmuludq %ymm10,%ymm12,%ymm12 - vpbroadcastq %xmm11,%ymm11 - vmovdqu -16+128-128(%rsi),%ymm0 - vpaddq %ymm12,%ymm2,%ymm2 - vpmuludq %ymm10,%ymm13,%ymm13 - vmovdqu -16+160-128(%rsi),%ymm12 - vpaddq %ymm13,%ymm3,%ymm3 - vpmuludq %ymm10,%ymm0,%ymm0 - vmovdqu -16+192-128(%rsi),%ymm13 - vpaddq %ymm0,%ymm4,%ymm4 - vpmuludq %ymm10,%ymm12,%ymm12 - vmovdqu -16+224-128(%rsi),%ymm0 - vpaddq %ymm12,%ymm5,%ymm5 - vpmuludq %ymm10,%ymm13,%ymm13 - vmovdqu -16+256-128(%rsi),%ymm12 - vpaddq %ymm13,%ymm6,%ymm6 - vpmuludq %ymm10,%ymm0,%ymm0 - vmovdqu -16+288-128(%rsi),%ymm13 - vpaddq %ymm0,%ymm7,%ymm7 - vpmuludq %ymm10,%ymm12,%ymm12 - vpaddq %ymm12,%ymm8,%ymm8 - vpmuludq %ymm10,%ymm13,%ymm13 - vpbroadcastq 24(%r13),%ymm10 - vpaddq %ymm13,%ymm9,%ymm9 - - vmovdqu -16+32-128(%rcx),%ymm0 - movq %rax,%rdx - imulq -128(%rcx),%rax - addq %rax,%r11 - vmovdqu -16+64-128(%rcx),%ymm12 - imulq 8-128(%rcx),%rdx - addq %rdx,%r12 - shrq $29,%r11 - - vpmuludq %ymm11,%ymm0,%ymm0 - vmovq %xmm10,%rbx - vmovdqu -16+96-128(%rcx),%ymm13 - vpaddq %ymm0,%ymm1,%ymm1 - vpmuludq %ymm11,%ymm12,%ymm12 - vmovdqu -16+128-128(%rcx),%ymm0 - vpaddq %ymm12,%ymm2,%ymm2 - vpmuludq %ymm11,%ymm13,%ymm13 - vmovdqu -16+160-128(%rcx),%ymm12 - vpaddq %ymm13,%ymm3,%ymm3 - vpmuludq %ymm11,%ymm0,%ymm0 - vmovdqu -16+192-128(%rcx),%ymm13 - vpaddq %ymm0,%ymm4,%ymm4 - vpmuludq %ymm11,%ymm12,%ymm12 - vmovdqu -16+224-128(%rcx),%ymm0 - vpaddq %ymm12,%ymm5,%ymm5 - vpmuludq %ymm11,%ymm13,%ymm13 - vmovdqu -16+256-128(%rcx),%ymm12 - vpaddq %ymm13,%ymm6,%ymm6 - vpmuludq %ymm11,%ymm0,%ymm0 - vmovdqu -16+288-128(%rcx),%ymm13 - vpaddq %ymm0,%ymm7,%ymm7 - vpmuludq %ymm11,%ymm12,%ymm12 - vmovdqu -24+32-128(%rsi),%ymm0 - vpaddq %ymm12,%ymm8,%ymm8 - vpmuludq %ymm11,%ymm13,%ymm13 - vmovdqu -24+64-128(%rsi),%ymm12 - vpaddq %ymm13,%ymm9,%ymm9 - - addq %r11,%r12 - imulq -128(%rsi),%rbx - addq %rbx,%r12 - - movq %r12,%rax - imull %r8d,%eax - andl $536870911,%eax - - vpmuludq %ymm10,%ymm0,%ymm0 - vmovd %eax,%xmm11 - vmovdqu -24+96-128(%rsi),%ymm13 - vpaddq %ymm0,%ymm1,%ymm1 - vpmuludq %ymm10,%ymm12,%ymm12 - vpbroadcastq %xmm11,%ymm11 - vmovdqu -24+128-128(%rsi),%ymm0 - vpaddq %ymm12,%ymm2,%ymm2 - vpmuludq %ymm10,%ymm13,%ymm13 - vmovdqu -24+160-128(%rsi),%ymm12 - vpaddq %ymm13,%ymm3,%ymm3 - vpmuludq %ymm10,%ymm0,%ymm0 - vmovdqu -24+192-128(%rsi),%ymm13 - vpaddq %ymm0,%ymm4,%ymm4 - vpmuludq %ymm10,%ymm12,%ymm12 - vmovdqu -24+224-128(%rsi),%ymm0 - vpaddq %ymm12,%ymm5,%ymm5 - vpmuludq %ymm10,%ymm13,%ymm13 - vmovdqu -24+256-128(%rsi),%ymm12 - vpaddq %ymm13,%ymm6,%ymm6 - vpmuludq %ymm10,%ymm0,%ymm0 - vmovdqu -24+288-128(%rsi),%ymm13 - vpaddq %ymm0,%ymm7,%ymm7 - vpmuludq %ymm10,%ymm12,%ymm12 - vpaddq %ymm12,%ymm8,%ymm8 - vpmuludq %ymm10,%ymm13,%ymm13 - vpbroadcastq 32(%r13),%ymm10 - vpaddq %ymm13,%ymm9,%ymm9 - addq $32,%r13 - - vmovdqu -24+32-128(%rcx),%ymm0 - imulq -128(%rcx),%rax - addq %rax,%r12 - shrq $29,%r12 - - vmovdqu -24+64-128(%rcx),%ymm12 - vpmuludq %ymm11,%ymm0,%ymm0 - vmovq %xmm10,%rbx - vmovdqu -24+96-128(%rcx),%ymm13 - vpaddq %ymm0,%ymm1,%ymm0 - vpmuludq %ymm11,%ymm12,%ymm12 - vmovdqu %ymm0,(%rsp) - vpaddq %ymm12,%ymm2,%ymm1 - vmovdqu -24+128-128(%rcx),%ymm0 - vpmuludq %ymm11,%ymm13,%ymm13 - vmovdqu -24+160-128(%rcx),%ymm12 - vpaddq %ymm13,%ymm3,%ymm2 - vpmuludq %ymm11,%ymm0,%ymm0 - vmovdqu -24+192-128(%rcx),%ymm13 - vpaddq %ymm0,%ymm4,%ymm3 - vpmuludq %ymm11,%ymm12,%ymm12 - vmovdqu -24+224-128(%rcx),%ymm0 - vpaddq %ymm12,%ymm5,%ymm4 - vpmuludq %ymm11,%ymm13,%ymm13 - vmovdqu -24+256-128(%rcx),%ymm12 - vpaddq %ymm13,%ymm6,%ymm5 - vpmuludq %ymm11,%ymm0,%ymm0 - vmovdqu -24+288-128(%rcx),%ymm13 - movq %r12,%r9 - vpaddq %ymm0,%ymm7,%ymm6 - vpmuludq %ymm11,%ymm12,%ymm12 - addq (%rsp),%r9 - vpaddq %ymm12,%ymm8,%ymm7 - vpmuludq %ymm11,%ymm13,%ymm13 - vmovq %r12,%xmm12 - vpaddq %ymm13,%ymm9,%ymm8 - - decl %r14d - jnz .Loop_mul_1024 - vpermq $0,%ymm15,%ymm15 - vpaddq (%rsp),%ymm12,%ymm0 - - vpsrlq $29,%ymm0,%ymm12 - vpand %ymm15,%ymm0,%ymm0 - vpsrlq $29,%ymm1,%ymm13 - vpand %ymm15,%ymm1,%ymm1 - vpsrlq $29,%ymm2,%ymm10 - vpermq $147,%ymm12,%ymm12 - vpand %ymm15,%ymm2,%ymm2 - vpsrlq $29,%ymm3,%ymm11 - vpermq $147,%ymm13,%ymm13 - vpand %ymm15,%ymm3,%ymm3 - - vpblendd $3,%ymm14,%ymm12,%ymm9 - vpermq $147,%ymm10,%ymm10 - vpblendd $3,%ymm12,%ymm13,%ymm12 - vpermq $147,%ymm11,%ymm11 - vpaddq %ymm9,%ymm0,%ymm0 - vpblendd $3,%ymm13,%ymm10,%ymm13 - vpaddq %ymm12,%ymm1,%ymm1 - vpblendd $3,%ymm10,%ymm11,%ymm10 - vpaddq %ymm13,%ymm2,%ymm2 - vpblendd $3,%ymm11,%ymm14,%ymm11 - vpaddq %ymm10,%ymm3,%ymm3 - vpaddq %ymm11,%ymm4,%ymm4 - - vpsrlq $29,%ymm0,%ymm12 - vpand %ymm15,%ymm0,%ymm0 - vpsrlq $29,%ymm1,%ymm13 - vpand %ymm15,%ymm1,%ymm1 - vpsrlq $29,%ymm2,%ymm10 - vpermq $147,%ymm12,%ymm12 - vpand %ymm15,%ymm2,%ymm2 - vpsrlq $29,%ymm3,%ymm11 - vpermq $147,%ymm13,%ymm13 - vpand %ymm15,%ymm3,%ymm3 - vpermq $147,%ymm10,%ymm10 - - vpblendd $3,%ymm14,%ymm12,%ymm9 - vpermq $147,%ymm11,%ymm11 - vpblendd $3,%ymm12,%ymm13,%ymm12 - vpaddq %ymm9,%ymm0,%ymm0 - vpblendd $3,%ymm13,%ymm10,%ymm13 - vpaddq %ymm12,%ymm1,%ymm1 - vpblendd $3,%ymm10,%ymm11,%ymm10 - vpaddq %ymm13,%ymm2,%ymm2 - vpblendd $3,%ymm11,%ymm14,%ymm11 - vpaddq %ymm10,%ymm3,%ymm3 - vpaddq %ymm11,%ymm4,%ymm4 - - vmovdqu %ymm0,0-128(%rdi) - vmovdqu %ymm1,32-128(%rdi) - vmovdqu %ymm2,64-128(%rdi) - vmovdqu %ymm3,96-128(%rdi) - vpsrlq $29,%ymm4,%ymm12 - vpand %ymm15,%ymm4,%ymm4 - vpsrlq $29,%ymm5,%ymm13 - vpand %ymm15,%ymm5,%ymm5 - vpsrlq $29,%ymm6,%ymm10 - vpermq $147,%ymm12,%ymm12 - vpand %ymm15,%ymm6,%ymm6 - vpsrlq $29,%ymm7,%ymm11 - vpermq $147,%ymm13,%ymm13 - vpand %ymm15,%ymm7,%ymm7 - vpsrlq $29,%ymm8,%ymm0 - vpermq $147,%ymm10,%ymm10 - vpand %ymm15,%ymm8,%ymm8 - vpermq $147,%ymm11,%ymm11 - - vpblendd $3,%ymm14,%ymm12,%ymm9 - vpermq $147,%ymm0,%ymm0 - vpblendd $3,%ymm12,%ymm13,%ymm12 - vpaddq %ymm9,%ymm4,%ymm4 - vpblendd $3,%ymm13,%ymm10,%ymm13 - vpaddq %ymm12,%ymm5,%ymm5 - vpblendd $3,%ymm10,%ymm11,%ymm10 - vpaddq %ymm13,%ymm6,%ymm6 - vpblendd $3,%ymm11,%ymm0,%ymm11 - vpaddq %ymm10,%ymm7,%ymm7 - vpaddq %ymm11,%ymm8,%ymm8 - - vpsrlq $29,%ymm4,%ymm12 - vpand %ymm15,%ymm4,%ymm4 - vpsrlq $29,%ymm5,%ymm13 - vpand %ymm15,%ymm5,%ymm5 - vpsrlq $29,%ymm6,%ymm10 - vpermq $147,%ymm12,%ymm12 - vpand %ymm15,%ymm6,%ymm6 - vpsrlq $29,%ymm7,%ymm11 - vpermq $147,%ymm13,%ymm13 - vpand %ymm15,%ymm7,%ymm7 - vpsrlq $29,%ymm8,%ymm0 - vpermq $147,%ymm10,%ymm10 - vpand %ymm15,%ymm8,%ymm8 - vpermq $147,%ymm11,%ymm11 - - vpblendd $3,%ymm14,%ymm12,%ymm9 - vpermq $147,%ymm0,%ymm0 - vpblendd $3,%ymm12,%ymm13,%ymm12 - vpaddq %ymm9,%ymm4,%ymm4 - vpblendd $3,%ymm13,%ymm10,%ymm13 - vpaddq %ymm12,%ymm5,%ymm5 - vpblendd $3,%ymm10,%ymm11,%ymm10 - vpaddq %ymm13,%ymm6,%ymm6 - vpblendd $3,%ymm11,%ymm0,%ymm11 - vpaddq %ymm10,%ymm7,%ymm7 - vpaddq %ymm11,%ymm8,%ymm8 - - vmovdqu %ymm4,128-128(%rdi) - vmovdqu %ymm5,160-128(%rdi) - vmovdqu %ymm6,192-128(%rdi) - vmovdqu %ymm7,224-128(%rdi) - vmovdqu %ymm8,256-128(%rdi) - vzeroupper - - movq %rbp,%rax - movq -48(%rax),%r15 - movq -40(%rax),%r14 - movq -32(%rax),%r13 - movq -24(%rax),%r12 - movq -16(%rax),%rbp - movq -8(%rax),%rbx - leaq (%rax),%rsp -.Lmul_1024_epilogue: - .byte 0xf3,0xc3 -.size rsaz_1024_mul_avx2,.-rsaz_1024_mul_avx2 -.globl rsaz_1024_red2norm_avx2 -.type rsaz_1024_red2norm_avx2,@function -.align 32 -rsaz_1024_red2norm_avx2: - subq $-128,%rsi - xorq %rax,%rax - movq -128(%rsi),%r8 - movq -120(%rsi),%r9 - movq -112(%rsi),%r10 - shlq $0,%r8 - shlq $29,%r9 - movq %r10,%r11 - shlq $58,%r10 - shrq $6,%r11 - addq %r8,%rax - addq %r9,%rax - addq %r10,%rax - adcq $0,%r11 - movq %rax,0(%rdi) - movq %r11,%rax - movq -104(%rsi),%r8 - movq -96(%rsi),%r9 - shlq $23,%r8 - movq %r9,%r10 - shlq $52,%r9 - shrq $12,%r10 - addq %r8,%rax - addq %r9,%rax - adcq $0,%r10 - movq %rax,8(%rdi) - movq %r10,%rax - movq -88(%rsi),%r11 - movq -80(%rsi),%r8 - shlq $17,%r11 - movq %r8,%r9 - shlq $46,%r8 - shrq $18,%r9 - addq %r11,%rax - addq %r8,%rax - adcq $0,%r9 - movq %rax,16(%rdi) - movq %r9,%rax - movq -72(%rsi),%r10 - movq -64(%rsi),%r11 - shlq $11,%r10 - movq %r11,%r8 - shlq $40,%r11 - shrq $24,%r8 - addq %r10,%rax - addq %r11,%rax - adcq $0,%r8 - movq %rax,24(%rdi) - movq %r8,%rax - movq -56(%rsi),%r9 - movq -48(%rsi),%r10 - movq -40(%rsi),%r11 - shlq $5,%r9 - shlq $34,%r10 - movq %r11,%r8 - shlq $63,%r11 - shrq $1,%r8 - addq %r9,%rax - addq %r10,%rax - addq %r11,%rax - adcq $0,%r8 - movq %rax,32(%rdi) - movq %r8,%rax - movq -32(%rsi),%r9 - movq -24(%rsi),%r10 - shlq $28,%r9 - movq %r10,%r11 - shlq $57,%r10 - shrq $7,%r11 - addq %r9,%rax - addq %r10,%rax - adcq $0,%r11 - movq %rax,40(%rdi) - movq %r11,%rax - movq -16(%rsi),%r8 - movq -8(%rsi),%r9 - shlq $22,%r8 - movq %r9,%r10 - shlq $51,%r9 - shrq $13,%r10 - addq %r8,%rax - addq %r9,%rax - adcq $0,%r10 - movq %rax,48(%rdi) - movq %r10,%rax - movq 0(%rsi),%r11 - movq 8(%rsi),%r8 - shlq $16,%r11 - movq %r8,%r9 - shlq $45,%r8 - shrq $19,%r9 - addq %r11,%rax - addq %r8,%rax - adcq $0,%r9 - movq %rax,56(%rdi) - movq %r9,%rax - movq 16(%rsi),%r10 - movq 24(%rsi),%r11 - shlq $10,%r10 - movq %r11,%r8 - shlq $39,%r11 - shrq $25,%r8 - addq %r10,%rax - addq %r11,%rax - adcq $0,%r8 - movq %rax,64(%rdi) - movq %r8,%rax - movq 32(%rsi),%r9 - movq 40(%rsi),%r10 - movq 48(%rsi),%r11 - shlq $4,%r9 - shlq $33,%r10 - movq %r11,%r8 - shlq $62,%r11 - shrq $2,%r8 - addq %r9,%rax - addq %r10,%rax - addq %r11,%rax - adcq $0,%r8 - movq %rax,72(%rdi) - movq %r8,%rax - movq 56(%rsi),%r9 - movq 64(%rsi),%r10 - shlq $27,%r9 - movq %r10,%r11 - shlq $56,%r10 - shrq $8,%r11 - addq %r9,%rax - addq %r10,%rax - adcq $0,%r11 - movq %rax,80(%rdi) - movq %r11,%rax - movq 72(%rsi),%r8 - movq 80(%rsi),%r9 - shlq $21,%r8 - movq %r9,%r10 - shlq $50,%r9 - shrq $14,%r10 - addq %r8,%rax - addq %r9,%rax - adcq $0,%r10 - movq %rax,88(%rdi) - movq %r10,%rax - movq 88(%rsi),%r11 - movq 96(%rsi),%r8 - shlq $15,%r11 - movq %r8,%r9 - shlq $44,%r8 - shrq $20,%r9 - addq %r11,%rax - addq %r8,%rax - adcq $0,%r9 - movq %rax,96(%rdi) - movq %r9,%rax - movq 104(%rsi),%r10 - movq 112(%rsi),%r11 - shlq $9,%r10 - movq %r11,%r8 - shlq $38,%r11 - shrq $26,%r8 - addq %r10,%rax - addq %r11,%rax - adcq $0,%r8 - movq %rax,104(%rdi) - movq %r8,%rax - movq 120(%rsi),%r9 - movq 128(%rsi),%r10 - movq 136(%rsi),%r11 - shlq $3,%r9 - shlq $32,%r10 - movq %r11,%r8 - shlq $61,%r11 - shrq $3,%r8 - addq %r9,%rax - addq %r10,%rax - addq %r11,%rax - adcq $0,%r8 - movq %rax,112(%rdi) - movq %r8,%rax - movq 144(%rsi),%r9 - movq 152(%rsi),%r10 - shlq $26,%r9 - movq %r10,%r11 - shlq $55,%r10 - shrq $9,%r11 - addq %r9,%rax - addq %r10,%rax - adcq $0,%r11 - movq %rax,120(%rdi) - movq %r11,%rax - .byte 0xf3,0xc3 -.size rsaz_1024_red2norm_avx2,.-rsaz_1024_red2norm_avx2 - -.globl rsaz_1024_norm2red_avx2 -.type rsaz_1024_norm2red_avx2,@function -.align 32 rsaz_1024_norm2red_avx2: - subq $-128,%rdi - movq (%rsi),%r8 - movl $536870911,%eax - movq 8(%rsi),%r9 - movq %r8,%r11 - shrq $0,%r11 - andq %rax,%r11 - movq %r11,-128(%rdi) - movq %r8,%r10 - shrq $29,%r10 - andq %rax,%r10 - movq %r10,-120(%rdi) - shrdq $58,%r9,%r8 - andq %rax,%r8 - movq %r8,-112(%rdi) - movq 16(%rsi),%r10 - movq %r9,%r8 - shrq $23,%r8 - andq %rax,%r8 - movq %r8,-104(%rdi) - shrdq $52,%r10,%r9 - andq %rax,%r9 - movq %r9,-96(%rdi) - movq 24(%rsi),%r11 - movq %r10,%r9 - shrq $17,%r9 - andq %rax,%r9 - movq %r9,-88(%rdi) - shrdq $46,%r11,%r10 - andq %rax,%r10 - movq %r10,-80(%rdi) - movq 32(%rsi),%r8 - movq %r11,%r10 - shrq $11,%r10 - andq %rax,%r10 - movq %r10,-72(%rdi) - shrdq $40,%r8,%r11 - andq %rax,%r11 - movq %r11,-64(%rdi) - movq 40(%rsi),%r9 - movq %r8,%r11 - shrq $5,%r11 - andq %rax,%r11 - movq %r11,-56(%rdi) - movq %r8,%r10 - shrq $34,%r10 - andq %rax,%r10 - movq %r10,-48(%rdi) - shrdq $63,%r9,%r8 - andq %rax,%r8 - movq %r8,-40(%rdi) - movq 48(%rsi),%r10 - movq %r9,%r8 - shrq $28,%r8 - andq %rax,%r8 - movq %r8,-32(%rdi) - shrdq $57,%r10,%r9 - andq %rax,%r9 - movq %r9,-24(%rdi) - movq 56(%rsi),%r11 - movq %r10,%r9 - shrq $22,%r9 - andq %rax,%r9 - movq %r9,-16(%rdi) - shrdq $51,%r11,%r10 - andq %rax,%r10 - movq %r10,-8(%rdi) - movq 64(%rsi),%r8 - movq %r11,%r10 - shrq $16,%r10 - andq %rax,%r10 - movq %r10,0(%rdi) - shrdq $45,%r8,%r11 - andq %rax,%r11 - movq %r11,8(%rdi) - movq 72(%rsi),%r9 - movq %r8,%r11 - shrq $10,%r11 - andq %rax,%r11 - movq %r11,16(%rdi) - shrdq $39,%r9,%r8 - andq %rax,%r8 - movq %r8,24(%rdi) - movq 80(%rsi),%r10 - movq %r9,%r8 - shrq $4,%r8 - andq %rax,%r8 - movq %r8,32(%rdi) - movq %r9,%r11 - shrq $33,%r11 - andq %rax,%r11 - movq %r11,40(%rdi) - shrdq $62,%r10,%r9 - andq %rax,%r9 - movq %r9,48(%rdi) - movq 88(%rsi),%r11 - movq %r10,%r9 - shrq $27,%r9 - andq %rax,%r9 - movq %r9,56(%rdi) - shrdq $56,%r11,%r10 - andq %rax,%r10 - movq %r10,64(%rdi) - movq 96(%rsi),%r8 - movq %r11,%r10 - shrq $21,%r10 - andq %rax,%r10 - movq %r10,72(%rdi) - shrdq $50,%r8,%r11 - andq %rax,%r11 - movq %r11,80(%rdi) - movq 104(%rsi),%r9 - movq %r8,%r11 - shrq $15,%r11 - andq %rax,%r11 - movq %r11,88(%rdi) - shrdq $44,%r9,%r8 - andq %rax,%r8 - movq %r8,96(%rdi) - movq 112(%rsi),%r10 - movq %r9,%r8 - shrq $9,%r8 - andq %rax,%r8 - movq %r8,104(%rdi) - shrdq $38,%r10,%r9 - andq %rax,%r9 - movq %r9,112(%rdi) - movq 120(%rsi),%r11 - movq %r10,%r9 - shrq $3,%r9 - andq %rax,%r9 - movq %r9,120(%rdi) - movq %r10,%r8 - shrq $32,%r8 - andq %rax,%r8 - movq %r8,128(%rdi) - shrdq $61,%r11,%r10 - andq %rax,%r10 - movq %r10,136(%rdi) - xorq %r8,%r8 - movq %r11,%r10 - shrq $26,%r10 - andq %rax,%r10 - movq %r10,144(%rdi) - shrdq $55,%r8,%r11 - andq %rax,%r11 - movq %r11,152(%rdi) - movq %r8,160(%rdi) - movq %r8,168(%rdi) - movq %r8,176(%rdi) - movq %r8,184(%rdi) - .byte 0xf3,0xc3 -.size rsaz_1024_norm2red_avx2,.-rsaz_1024_norm2red_avx2 -.globl rsaz_1024_scatter5_avx2 -.type rsaz_1024_scatter5_avx2,@function -.align 32 +rsaz_1024_red2norm_avx2: rsaz_1024_scatter5_avx2: - vzeroupper - vmovdqu .Lscatter_permd(%rip),%ymm5 - shll $4,%edx - leaq (%rdi,%rdx,1),%rdi - movl $9,%eax - jmp .Loop_scatter_1024 - -.align 32 -.Loop_scatter_1024: - vmovdqu (%rsi),%ymm0 - leaq 32(%rsi),%rsi - vpermd %ymm0,%ymm5,%ymm0 - vmovdqu %xmm0,(%rdi) - leaq 512(%rdi),%rdi - decl %eax - jnz .Loop_scatter_1024 - - vzeroupper - .byte 0xf3,0xc3 -.size rsaz_1024_scatter5_avx2,.-rsaz_1024_scatter5_avx2 - -.globl rsaz_1024_gather5_avx2 -.type rsaz_1024_gather5_avx2,@function -.align 32 rsaz_1024_gather5_avx2: - leaq .Lgather_table(%rip),%r11 - movl %edx,%eax - andl $3,%edx - shrl $2,%eax - shll $4,%edx - - vmovdqu -32(%r11),%ymm7 - vpbroadcastb 8(%r11,%rax,1),%xmm8 - vpbroadcastb 7(%r11,%rax,1),%xmm9 - vpbroadcastb 6(%r11,%rax,1),%xmm10 - vpbroadcastb 5(%r11,%rax,1),%xmm11 - vpbroadcastb 4(%r11,%rax,1),%xmm12 - vpbroadcastb 3(%r11,%rax,1),%xmm13 - vpbroadcastb 2(%r11,%rax,1),%xmm14 - vpbroadcastb 1(%r11,%rax,1),%xmm15 - - leaq 64(%rsi,%rdx,1),%rsi - movq $64,%r11 - movl $9,%eax - jmp .Loop_gather_1024 - -.align 32 -.Loop_gather_1024: - vpand -64(%rsi),%xmm8,%xmm0 - vpand (%rsi),%xmm9,%xmm1 - vpand 64(%rsi),%xmm10,%xmm2 - vpand (%rsi,%r11,2),%xmm11,%xmm3 - vpor %xmm0,%xmm1,%xmm1 - vpand 64(%rsi,%r11,2),%xmm12,%xmm4 - vpor %xmm2,%xmm3,%xmm3 - vpand (%rsi,%r11,4),%xmm13,%xmm5 - vpor %xmm1,%xmm3,%xmm3 - vpand 64(%rsi,%r11,4),%xmm14,%xmm6 - vpor %xmm4,%xmm5,%xmm5 - vpand -128(%rsi,%r11,8),%xmm15,%xmm2 - leaq (%rsi,%r11,8),%rsi - vpor %xmm3,%xmm5,%xmm5 - vpor %xmm2,%xmm6,%xmm6 - vpor %xmm5,%xmm6,%xmm6 - vpermd %ymm6,%ymm7,%ymm6 - vmovdqu %ymm6,(%rdi) - leaq 32(%rdi),%rdi - decl %eax - jnz .Loop_gather_1024 - - vpxor %ymm0,%ymm0,%ymm0 - vmovdqu %ymm0,(%rdi) - vzeroupper +.byte 0x0f,0x0b .byte 0xf3,0xc3 -.size rsaz_1024_gather5_avx2,.-rsaz_1024_gather5_avx2 - -.globl rsaz_avx2_eligible -.type rsaz_avx2_eligible,@function -.align 32 -rsaz_avx2_eligible: - movl OPENSSL_ia32cap_P+8(%rip),%eax - movl $524544,%ecx - movl $0,%edx - andl %eax,%ecx - cmpl $524544,%ecx - cmovel %edx,%eax - andl $32,%eax - shrl $5,%eax - .byte 0xf3,0xc3 -.size rsaz_avx2_eligible,.-rsaz_avx2_eligible - -.align 64 -.Land_mask: -.quad 0x1fffffff,0x1fffffff,0x1fffffff,-1 -.Lscatter_permd: -.long 0,2,4,6,7,7,7,7 -.Lgather_permd: -.long 0,7,1,7,2,7,3,7 -.Lgather_table: -.byte 0,0,0,0,0,0,0,0, 0xff,0,0,0,0,0,0,0 -.align 64 +.size rsaz_1024_sqr_avx2,.-rsaz_1024_sqr_avx2 diff --git a/deps/openssl/asm/x64-elf-gas/bn/rsaz-x86_64.s b/deps/openssl/asm/x64-elf-gas/bn/rsaz-x86_64.s index f42075571e66b8..4a1211329c67ea 100644 --- a/deps/openssl/asm/x64-elf-gas/bn/rsaz-x86_64.s +++ b/deps/openssl/asm/x64-elf-gas/bn/rsaz-x86_64.s @@ -19,10 +19,6 @@ rsaz_512_sqr: movq (%rsi),%rdx movq 8(%rsi),%rax movq %rcx,128(%rsp) - movl $524544,%r11d - andl OPENSSL_ia32cap_P+8(%rip),%r11d - cmpl $524544,%r11d - je .Loop_sqrx jmp .Loop_sqr .align 32 @@ -386,276 +382,6 @@ rsaz_512_sqr: decl %r8d jnz .Loop_sqr - jmp .Lsqr_tail - -.align 32 -.Loop_sqrx: - movl %r8d,128+8(%rsp) -.byte 102,72,15,110,199 -.byte 102,72,15,110,205 - - mulxq %rax,%r8,%r9 - - mulxq 16(%rsi),%rcx,%r10 - xorq %rbp,%rbp - - mulxq 24(%rsi),%rax,%r11 - adcxq %rcx,%r9 - - mulxq 32(%rsi),%rcx,%r12 - adcxq %rax,%r10 - - mulxq 40(%rsi),%rax,%r13 - adcxq %rcx,%r11 - -.byte 0xc4,0x62,0xf3,0xf6,0xb6,0x30,0x00,0x00,0x00 - adcxq %rax,%r12 - adcxq %rcx,%r13 - -.byte 0xc4,0x62,0xfb,0xf6,0xbe,0x38,0x00,0x00,0x00 - adcxq %rax,%r14 - adcxq %rbp,%r15 - - movq %r9,%rcx - shldq $1,%r8,%r9 - shlq $1,%r8 - - xorl %ebp,%ebp - mulxq %rdx,%rax,%rdx - adcxq %rdx,%r8 - movq 8(%rsi),%rdx - adcxq %rbp,%r9 - - movq %rax,(%rsp) - movq %r8,8(%rsp) - - - mulxq 16(%rsi),%rax,%rbx - adoxq %rax,%r10 - adcxq %rbx,%r11 - -.byte 0xc4,0x62,0xc3,0xf6,0x86,0x18,0x00,0x00,0x00 - adoxq %rdi,%r11 - adcxq %r8,%r12 - - mulxq 32(%rsi),%rax,%rbx - adoxq %rax,%r12 - adcxq %rbx,%r13 - - mulxq 40(%rsi),%rdi,%r8 - adoxq %rdi,%r13 - adcxq %r8,%r14 - -.byte 0xc4,0xe2,0xfb,0xf6,0x9e,0x30,0x00,0x00,0x00 - adoxq %rax,%r14 - adcxq %rbx,%r15 - -.byte 0xc4,0x62,0xc3,0xf6,0x86,0x38,0x00,0x00,0x00 - adoxq %rdi,%r15 - adcxq %rbp,%r8 - adoxq %rbp,%r8 - - movq %r11,%rbx - shldq $1,%r10,%r11 - shldq $1,%rcx,%r10 - - xorl %ebp,%ebp - mulxq %rdx,%rax,%rcx - movq 16(%rsi),%rdx - adcxq %rax,%r9 - adcxq %rcx,%r10 - adcxq %rbp,%r11 - - movq %r9,16(%rsp) -.byte 0x4c,0x89,0x94,0x24,0x18,0x00,0x00,0x00 - - -.byte 0xc4,0x62,0xc3,0xf6,0x8e,0x18,0x00,0x00,0x00 - adoxq %rdi,%r12 - adcxq %r9,%r13 - - mulxq 32(%rsi),%rax,%rcx - adoxq %rax,%r13 - adcxq %rcx,%r14 - - mulxq 40(%rsi),%rdi,%r9 - adoxq %rdi,%r14 - adcxq %r9,%r15 - -.byte 0xc4,0xe2,0xfb,0xf6,0x8e,0x30,0x00,0x00,0x00 - adoxq %rax,%r15 - adcxq %rcx,%r8 - -.byte 0xc4,0x62,0xc3,0xf6,0x8e,0x38,0x00,0x00,0x00 - adoxq %rdi,%r8 - adcxq %rbp,%r9 - adoxq %rbp,%r9 - - movq %r13,%rcx - shldq $1,%r12,%r13 - shldq $1,%rbx,%r12 - - xorl %ebp,%ebp - mulxq %rdx,%rax,%rdx - adcxq %rax,%r11 - adcxq %rdx,%r12 - movq 24(%rsi),%rdx - adcxq %rbp,%r13 - - movq %r11,32(%rsp) -.byte 0x4c,0x89,0xa4,0x24,0x28,0x00,0x00,0x00 - - -.byte 0xc4,0xe2,0xfb,0xf6,0x9e,0x20,0x00,0x00,0x00 - adoxq %rax,%r14 - adcxq %rbx,%r15 - - mulxq 40(%rsi),%rdi,%r10 - adoxq %rdi,%r15 - adcxq %r10,%r8 - - mulxq 48(%rsi),%rax,%rbx - adoxq %rax,%r8 - adcxq %rbx,%r9 - - mulxq 56(%rsi),%rdi,%r10 - adoxq %rdi,%r9 - adcxq %rbp,%r10 - adoxq %rbp,%r10 - -.byte 0x66 - movq %r15,%rbx - shldq $1,%r14,%r15 - shldq $1,%rcx,%r14 - - xorl %ebp,%ebp - mulxq %rdx,%rax,%rdx - adcxq %rax,%r13 - adcxq %rdx,%r14 - movq 32(%rsi),%rdx - adcxq %rbp,%r15 - - movq %r13,48(%rsp) - movq %r14,56(%rsp) - - -.byte 0xc4,0x62,0xc3,0xf6,0x9e,0x28,0x00,0x00,0x00 - adoxq %rdi,%r8 - adcxq %r11,%r9 - - mulxq 48(%rsi),%rax,%rcx - adoxq %rax,%r9 - adcxq %rcx,%r10 - - mulxq 56(%rsi),%rdi,%r11 - adoxq %rdi,%r10 - adcxq %rbp,%r11 - adoxq %rbp,%r11 - - movq %r9,%rcx - shldq $1,%r8,%r9 - shldq $1,%rbx,%r8 - - xorl %ebp,%ebp - mulxq %rdx,%rax,%rdx - adcxq %rax,%r15 - adcxq %rdx,%r8 - movq 40(%rsi),%rdx - adcxq %rbp,%r9 - - movq %r15,64(%rsp) - movq %r8,72(%rsp) - - -.byte 0xc4,0xe2,0xfb,0xf6,0x9e,0x30,0x00,0x00,0x00 - adoxq %rax,%r10 - adcxq %rbx,%r11 - -.byte 0xc4,0x62,0xc3,0xf6,0xa6,0x38,0x00,0x00,0x00 - adoxq %rdi,%r11 - adcxq %rbp,%r12 - adoxq %rbp,%r12 - - movq %r11,%rbx - shldq $1,%r10,%r11 - shldq $1,%rcx,%r10 - - xorl %ebp,%ebp - mulxq %rdx,%rax,%rdx - adcxq %rax,%r9 - adcxq %rdx,%r10 - movq 48(%rsi),%rdx - adcxq %rbp,%r11 - - movq %r9,80(%rsp) - movq %r10,88(%rsp) - - -.byte 0xc4,0x62,0xfb,0xf6,0xae,0x38,0x00,0x00,0x00 - adoxq %rax,%r12 - adoxq %rbp,%r13 - - xorq %r14,%r14 - shldq $1,%r13,%r14 - shldq $1,%r12,%r13 - shldq $1,%rbx,%r12 - - xorl %ebp,%ebp - mulxq %rdx,%rax,%rdx - adcxq %rax,%r11 - adcxq %rdx,%r12 - movq 56(%rsi),%rdx - adcxq %rbp,%r13 - -.byte 0x4c,0x89,0x9c,0x24,0x60,0x00,0x00,0x00 -.byte 0x4c,0x89,0xa4,0x24,0x68,0x00,0x00,0x00 - - - mulxq %rdx,%rax,%rdx - adoxq %rax,%r13 - adoxq %rbp,%rdx - -.byte 0x66 - addq %rdx,%r14 - - movq %r13,112(%rsp) - movq %r14,120(%rsp) -.byte 102,72,15,126,199 -.byte 102,72,15,126,205 - - movq 128(%rsp),%rdx - movq (%rsp),%r8 - movq 8(%rsp),%r9 - movq 16(%rsp),%r10 - movq 24(%rsp),%r11 - movq 32(%rsp),%r12 - movq 40(%rsp),%r13 - movq 48(%rsp),%r14 - movq 56(%rsp),%r15 - - call __rsaz_512_reducex - - addq 64(%rsp),%r8 - adcq 72(%rsp),%r9 - adcq 80(%rsp),%r10 - adcq 88(%rsp),%r11 - adcq 96(%rsp),%r12 - adcq 104(%rsp),%r13 - adcq 112(%rsp),%r14 - adcq 120(%rsp),%r15 - sbbq %rcx,%rcx - - call __rsaz_512_subtract - - movq %r8,%rdx - movq %r9,%rax - movl 128+8(%rsp),%r8d - movq %rdi,%rsi - - decl %r8d - jnz .Loop_sqrx - -.Lsqr_tail: leaq 128+24+48(%rsp),%rax movq -48(%rax),%r15 @@ -684,10 +410,6 @@ rsaz_512_mul: .byte 102,72,15,110,199 .byte 102,72,15,110,201 movq %r8,128(%rsp) - movl $524544,%r11d - andl OPENSSL_ia32cap_P+8(%rip),%r11d - cmpl $524544,%r11d - je .Lmulx movq (%rdx),%rbx movq %rdx,%rbp call __rsaz_512_mul @@ -705,29 +427,6 @@ rsaz_512_mul: movq 56(%rsp),%r15 call __rsaz_512_reduce - jmp .Lmul_tail - -.align 32 -.Lmulx: - movq %rdx,%rbp - movq (%rdx),%rdx - call __rsaz_512_mulx - -.byte 102,72,15,126,199 -.byte 102,72,15,126,205 - - movq 128(%rsp),%rdx - movq (%rsp),%r8 - movq 8(%rsp),%r9 - movq 16(%rsp),%r10 - movq 24(%rsp),%r11 - movq 32(%rsp),%r12 - movq 40(%rsp),%r13 - movq 48(%rsp),%r14 - movq 56(%rsp),%r15 - - call __rsaz_512_reducex -.Lmul_tail: addq 64(%rsp),%r8 adcq 72(%rsp),%r9 adcq 80(%rsp),%r10 @@ -762,52 +461,94 @@ rsaz_512_mul_gather4: pushq %r14 pushq %r15 - movl %r9d,%r9d - subq $128+24,%rsp + subq $152,%rsp .Lmul_gather4_body: - movl $524544,%r11d - andl OPENSSL_ia32cap_P+8(%rip),%r11d - cmpl $524544,%r11d - je .Lmulx_gather - movl 64(%rdx,%r9,4),%eax -.byte 102,72,15,110,199 - movl (%rdx,%r9,4),%ebx -.byte 102,72,15,110,201 + movd %r9d,%xmm8 + movdqa .Linc+16(%rip),%xmm1 + movdqa .Linc(%rip),%xmm0 + + pshufd $0,%xmm8,%xmm8 + movdqa %xmm1,%xmm7 + movdqa %xmm1,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm8,%xmm0 + movdqa %xmm7,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm8,%xmm1 + movdqa %xmm7,%xmm4 + paddd %xmm2,%xmm3 + pcmpeqd %xmm8,%xmm2 + movdqa %xmm7,%xmm5 + paddd %xmm3,%xmm4 + pcmpeqd %xmm8,%xmm3 + movdqa %xmm7,%xmm6 + paddd %xmm4,%xmm5 + pcmpeqd %xmm8,%xmm4 + paddd %xmm5,%xmm6 + pcmpeqd %xmm8,%xmm5 + paddd %xmm6,%xmm7 + pcmpeqd %xmm8,%xmm6 + pcmpeqd %xmm8,%xmm7 + + movdqa 0(%rdx),%xmm8 + movdqa 16(%rdx),%xmm9 + movdqa 32(%rdx),%xmm10 + movdqa 48(%rdx),%xmm11 + pand %xmm0,%xmm8 + movdqa 64(%rdx),%xmm12 + pand %xmm1,%xmm9 + movdqa 80(%rdx),%xmm13 + pand %xmm2,%xmm10 + movdqa 96(%rdx),%xmm14 + pand %xmm3,%xmm11 + movdqa 112(%rdx),%xmm15 + leaq 128(%rdx),%rbp + pand %xmm4,%xmm12 + pand %xmm5,%xmm13 + pand %xmm6,%xmm14 + pand %xmm7,%xmm15 + por %xmm10,%xmm8 + por %xmm11,%xmm9 + por %xmm12,%xmm8 + por %xmm13,%xmm9 + por %xmm14,%xmm8 + por %xmm15,%xmm9 + + por %xmm9,%xmm8 + pshufd $0x4e,%xmm8,%xmm9 + por %xmm9,%xmm8 +.byte 102,76,15,126,195 + movq %r8,128(%rsp) + movq %rdi,128+8(%rsp) + movq %rcx,128+16(%rsp) - shlq $32,%rax - orq %rax,%rbx movq (%rsi),%rax movq 8(%rsi),%rcx - leaq 128(%rdx,%r9,4),%rbp mulq %rbx movq %rax,(%rsp) movq %rcx,%rax movq %rdx,%r8 mulq %rbx - movd (%rbp),%xmm4 addq %rax,%r8 movq 16(%rsi),%rax movq %rdx,%r9 adcq $0,%r9 mulq %rbx - movd 64(%rbp),%xmm5 addq %rax,%r9 movq 24(%rsi),%rax movq %rdx,%r10 adcq $0,%r10 mulq %rbx - pslldq $4,%xmm5 addq %rax,%r10 movq 32(%rsi),%rax movq %rdx,%r11 adcq $0,%r11 mulq %rbx - por %xmm5,%xmm4 addq %rax,%r11 movq 40(%rsi),%rax movq %rdx,%r12 @@ -820,14 +561,12 @@ rsaz_512_mul_gather4: adcq $0,%r13 mulq %rbx - leaq 128(%rbp),%rbp addq %rax,%r13 movq 56(%rsi),%rax movq %rdx,%r14 adcq $0,%r14 mulq %rbx -.byte 102,72,15,126,227 addq %rax,%r14 movq (%rsi),%rax movq %rdx,%r15 @@ -839,6 +578,35 @@ rsaz_512_mul_gather4: .align 32 .Loop_mul_gather: + movdqa 0(%rbp),%xmm8 + movdqa 16(%rbp),%xmm9 + movdqa 32(%rbp),%xmm10 + movdqa 48(%rbp),%xmm11 + pand %xmm0,%xmm8 + movdqa 64(%rbp),%xmm12 + pand %xmm1,%xmm9 + movdqa 80(%rbp),%xmm13 + pand %xmm2,%xmm10 + movdqa 96(%rbp),%xmm14 + pand %xmm3,%xmm11 + movdqa 112(%rbp),%xmm15 + leaq 128(%rbp),%rbp + pand %xmm4,%xmm12 + pand %xmm5,%xmm13 + pand %xmm6,%xmm14 + pand %xmm7,%xmm15 + por %xmm10,%xmm8 + por %xmm11,%xmm9 + por %xmm12,%xmm8 + por %xmm13,%xmm9 + por %xmm14,%xmm8 + por %xmm15,%xmm9 + + por %xmm9,%xmm8 + pshufd $0x4e,%xmm8,%xmm9 + por %xmm9,%xmm8 +.byte 102,76,15,126,195 + mulq %rbx addq %rax,%r8 movq 8(%rsi),%rax @@ -847,7 +615,6 @@ rsaz_512_mul_gather4: adcq $0,%r8 mulq %rbx - movd (%rbp),%xmm4 addq %rax,%r9 movq 16(%rsi),%rax adcq $0,%rdx @@ -856,7 +623,6 @@ rsaz_512_mul_gather4: adcq $0,%r9 mulq %rbx - movd 64(%rbp),%xmm5 addq %rax,%r10 movq 24(%rsi),%rax adcq $0,%rdx @@ -865,7 +631,6 @@ rsaz_512_mul_gather4: adcq $0,%r10 mulq %rbx - pslldq $4,%xmm5 addq %rax,%r11 movq 32(%rsi),%rax adcq $0,%rdx @@ -874,7 +639,6 @@ rsaz_512_mul_gather4: adcq $0,%r11 mulq %rbx - por %xmm5,%xmm4 addq %rax,%r12 movq 40(%rsi),%rax adcq $0,%rdx @@ -899,7 +663,6 @@ rsaz_512_mul_gather4: adcq $0,%r14 mulq %rbx -.byte 102,72,15,126,227 addq %rax,%r15 movq (%rsi),%rax adcq $0,%rdx @@ -907,7 +670,6 @@ rsaz_512_mul_gather4: movq %rdx,%r15 adcq $0,%r15 - leaq 128(%rbp),%rbp leaq 8(%rdi),%rdi decl %ecx @@ -922,8 +684,8 @@ rsaz_512_mul_gather4: movq %r14,48(%rdi) movq %r15,56(%rdi) -.byte 102,72,15,126,199 -.byte 102,72,15,126,205 + movq 128+8(%rsp),%rdi + movq 128+16(%rsp),%rbp movq (%rsp),%r8 movq 8(%rsp),%r9 @@ -935,126 +697,6 @@ rsaz_512_mul_gather4: movq 56(%rsp),%r15 call __rsaz_512_reduce - jmp .Lmul_gather_tail - -.align 32 -.Lmulx_gather: - movl 64(%rdx,%r9,4),%eax -.byte 102,72,15,110,199 - leaq 128(%rdx,%r9,4),%rbp - movl (%rdx,%r9,4),%edx -.byte 102,72,15,110,201 - movq %r8,128(%rsp) - - shlq $32,%rax - orq %rax,%rdx - mulxq (%rsi),%rbx,%r8 - movq %rbx,(%rsp) - xorl %edi,%edi - - mulxq 8(%rsi),%rax,%r9 - movd (%rbp),%xmm4 - - mulxq 16(%rsi),%rbx,%r10 - movd 64(%rbp),%xmm5 - adcxq %rax,%r8 - - mulxq 24(%rsi),%rax,%r11 - pslldq $4,%xmm5 - adcxq %rbx,%r9 - - mulxq 32(%rsi),%rbx,%r12 - por %xmm5,%xmm4 - adcxq %rax,%r10 - - mulxq 40(%rsi),%rax,%r13 - adcxq %rbx,%r11 - - mulxq 48(%rsi),%rbx,%r14 - leaq 128(%rbp),%rbp - adcxq %rax,%r12 - - mulxq 56(%rsi),%rax,%r15 -.byte 102,72,15,126,226 - adcxq %rbx,%r13 - adcxq %rax,%r14 - movq %r8,%rbx - adcxq %rdi,%r15 - - movq $-7,%rcx - jmp .Loop_mulx_gather - -.align 32 -.Loop_mulx_gather: - mulxq (%rsi),%rax,%r8 - adcxq %rax,%rbx - adoxq %r9,%r8 - - mulxq 8(%rsi),%rax,%r9 -.byte 0x66,0x0f,0x6e,0xa5,0x00,0x00,0x00,0x00 - adcxq %rax,%r8 - adoxq %r10,%r9 - - mulxq 16(%rsi),%rax,%r10 - movd 64(%rbp),%xmm5 - leaq 128(%rbp),%rbp - adcxq %rax,%r9 - adoxq %r11,%r10 - -.byte 0xc4,0x62,0xfb,0xf6,0x9e,0x18,0x00,0x00,0x00 - pslldq $4,%xmm5 - por %xmm5,%xmm4 - adcxq %rax,%r10 - adoxq %r12,%r11 - - mulxq 32(%rsi),%rax,%r12 - adcxq %rax,%r11 - adoxq %r13,%r12 - - mulxq 40(%rsi),%rax,%r13 - adcxq %rax,%r12 - adoxq %r14,%r13 - -.byte 0xc4,0x62,0xfb,0xf6,0xb6,0x30,0x00,0x00,0x00 - adcxq %rax,%r13 - adoxq %r15,%r14 - - mulxq 56(%rsi),%rax,%r15 -.byte 102,72,15,126,226 - movq %rbx,64(%rsp,%rcx,8) - adcxq %rax,%r14 - adoxq %rdi,%r15 - movq %r8,%rbx - adcxq %rdi,%r15 - - incq %rcx - jnz .Loop_mulx_gather - - movq %r8,64(%rsp) - movq %r9,64+8(%rsp) - movq %r10,64+16(%rsp) - movq %r11,64+24(%rsp) - movq %r12,64+32(%rsp) - movq %r13,64+40(%rsp) - movq %r14,64+48(%rsp) - movq %r15,64+56(%rsp) - -.byte 102,72,15,126,199 -.byte 102,72,15,126,205 - - movq 128(%rsp),%rdx - movq (%rsp),%r8 - movq 8(%rsp),%r9 - movq 16(%rsp),%r10 - movq 24(%rsp),%r11 - movq 32(%rsp),%r12 - movq 40(%rsp),%r13 - movq 48(%rsp),%r14 - movq 56(%rsp),%r15 - - call __rsaz_512_reducex - -.Lmul_gather_tail: addq 64(%rsp),%r8 adcq 72(%rsp),%r9 adcq 80(%rsp),%r10 @@ -1092,17 +734,13 @@ rsaz_512_mul_scatter4: movl %r9d,%r9d subq $128+24,%rsp .Lmul_scatter4_body: - leaq (%r8,%r9,4),%r8 + leaq (%r8,%r9,8),%r8 .byte 102,72,15,110,199 .byte 102,72,15,110,202 .byte 102,73,15,110,208 movq %rcx,128(%rsp) movq %rdi,%rbp - movl $524544,%r11d - andl OPENSSL_ia32cap_P+8(%rip),%r11d - cmpl $524544,%r11d - je .Lmulx_scatter movq (%rdi),%rbx call __rsaz_512_mul @@ -1119,29 +757,6 @@ rsaz_512_mul_scatter4: movq 56(%rsp),%r15 call __rsaz_512_reduce - jmp .Lmul_scatter_tail - -.align 32 -.Lmulx_scatter: - movq (%rdi),%rdx - call __rsaz_512_mulx - -.byte 102,72,15,126,199 -.byte 102,72,15,126,205 - - movq 128(%rsp),%rdx - movq (%rsp),%r8 - movq 8(%rsp),%r9 - movq 16(%rsp),%r10 - movq 24(%rsp),%r11 - movq 32(%rsp),%r12 - movq 40(%rsp),%r13 - movq 48(%rsp),%r14 - movq 56(%rsp),%r15 - - call __rsaz_512_reducex - -.Lmul_scatter_tail: addq 64(%rsp),%r8 adcq 72(%rsp),%r9 adcq 80(%rsp),%r10 @@ -1155,30 +770,14 @@ rsaz_512_mul_scatter4: call __rsaz_512_subtract - movl %r8d,0(%rsi) - shrq $32,%r8 - movl %r9d,128(%rsi) - shrq $32,%r9 - movl %r10d,256(%rsi) - shrq $32,%r10 - movl %r11d,384(%rsi) - shrq $32,%r11 - movl %r12d,512(%rsi) - shrq $32,%r12 - movl %r13d,640(%rsi) - shrq $32,%r13 - movl %r14d,768(%rsi) - shrq $32,%r14 - movl %r15d,896(%rsi) - shrq $32,%r15 - movl %r8d,64(%rsi) - movl %r9d,192(%rsi) - movl %r10d,320(%rsi) - movl %r11d,448(%rsi) - movl %r12d,576(%rsi) - movl %r13d,704(%rsi) - movl %r14d,832(%rsi) - movl %r15d,960(%rsi) + movq %r8,0(%rsi) + movq %r9,128(%rsi) + movq %r10,256(%rsi) + movq %r11,384(%rsi) + movq %r12,512(%rsi) + movq %r13,640(%rsi) + movq %r14,768(%rsi) + movq %r15,896(%rsi) leaq 128+24+48(%rsp),%rax movq -48(%rax),%r15 @@ -1204,7 +803,6 @@ rsaz_512_mul_by_one: subq $128+24,%rsp .Lmul_by_one_body: - movl OPENSSL_ia32cap_P+8(%rip),%eax movq %rdx,%rbp movq %rcx,128(%rsp) @@ -1225,16 +823,7 @@ rsaz_512_mul_by_one: movdqa %xmm0,64(%rsp) movdqa %xmm0,80(%rsp) movdqa %xmm0,96(%rsp) - andl $524544,%eax - cmpl $524544,%eax - je .Lby_one_callx call __rsaz_512_reduce - jmp .Lby_one_tail -.align 32 -.Lby_one_callx: - movq 128(%rsp),%rdx - call __rsaz_512_reducex -.Lby_one_tail: movq %r8,(%rdi) movq %r9,8(%rdi) movq %r10,16(%rdi) @@ -1338,62 +927,6 @@ __rsaz_512_reduce: .byte 0xf3,0xc3 .size __rsaz_512_reduce,.-__rsaz_512_reduce -.type __rsaz_512_reducex,@function -.align 32 -__rsaz_512_reducex: - - imulq %r8,%rdx - xorq %rsi,%rsi - movl $8,%ecx - jmp .Lreduction_loopx - -.align 32 -.Lreduction_loopx: - movq %r8,%rbx - mulxq 0(%rbp),%rax,%r8 - adcxq %rbx,%rax - adoxq %r9,%r8 - - mulxq 8(%rbp),%rax,%r9 - adcxq %rax,%r8 - adoxq %r10,%r9 - - mulxq 16(%rbp),%rbx,%r10 - adcxq %rbx,%r9 - adoxq %r11,%r10 - - mulxq 24(%rbp),%rbx,%r11 - adcxq %rbx,%r10 - adoxq %r12,%r11 - -.byte 0xc4,0x62,0xe3,0xf6,0xa5,0x20,0x00,0x00,0x00 - movq %rdx,%rax - movq %r8,%rdx - adcxq %rbx,%r11 - adoxq %r13,%r12 - - mulxq 128+8(%rsp),%rbx,%rdx - movq %rax,%rdx - - mulxq 40(%rbp),%rax,%r13 - adcxq %rax,%r12 - adoxq %r14,%r13 - -.byte 0xc4,0x62,0xfb,0xf6,0xb5,0x30,0x00,0x00,0x00 - adcxq %rax,%r13 - adoxq %r15,%r14 - - mulxq 56(%rbp),%rax,%r15 - movq %rbx,%rdx - adcxq %rax,%r14 - adoxq %rsi,%r15 - adcxq %rsi,%r15 - - decl %ecx - jne .Lreduction_loopx - - .byte 0xf3,0xc3 -.size __rsaz_512_reducex,.-__rsaz_512_reducex .type __rsaz_512_subtract,@function .align 32 __rsaz_512_subtract: @@ -1593,140 +1126,18 @@ __rsaz_512_mul: .byte 0xf3,0xc3 .size __rsaz_512_mul,.-__rsaz_512_mul -.type __rsaz_512_mulx,@function -.align 32 -__rsaz_512_mulx: - mulxq (%rsi),%rbx,%r8 - movq $-6,%rcx - - mulxq 8(%rsi),%rax,%r9 - movq %rbx,8(%rsp) - - mulxq 16(%rsi),%rbx,%r10 - adcq %rax,%r8 - - mulxq 24(%rsi),%rax,%r11 - adcq %rbx,%r9 - - mulxq 32(%rsi),%rbx,%r12 - adcq %rax,%r10 - - mulxq 40(%rsi),%rax,%r13 - adcq %rbx,%r11 - - mulxq 48(%rsi),%rbx,%r14 - adcq %rax,%r12 - - mulxq 56(%rsi),%rax,%r15 - movq 8(%rbp),%rdx - adcq %rbx,%r13 - adcq %rax,%r14 - adcq $0,%r15 - - xorq %rdi,%rdi - jmp .Loop_mulx - -.align 32 -.Loop_mulx: - movq %r8,%rbx - mulxq (%rsi),%rax,%r8 - adcxq %rax,%rbx - adoxq %r9,%r8 - - mulxq 8(%rsi),%rax,%r9 - adcxq %rax,%r8 - adoxq %r10,%r9 - - mulxq 16(%rsi),%rax,%r10 - adcxq %rax,%r9 - adoxq %r11,%r10 - - mulxq 24(%rsi),%rax,%r11 - adcxq %rax,%r10 - adoxq %r12,%r11 - -.byte 0x3e,0xc4,0x62,0xfb,0xf6,0xa6,0x20,0x00,0x00,0x00 - adcxq %rax,%r11 - adoxq %r13,%r12 - - mulxq 40(%rsi),%rax,%r13 - adcxq %rax,%r12 - adoxq %r14,%r13 - - mulxq 48(%rsi),%rax,%r14 - adcxq %rax,%r13 - adoxq %r15,%r14 - - mulxq 56(%rsi),%rax,%r15 - movq 64(%rbp,%rcx,8),%rdx - movq %rbx,8+64-8(%rsp,%rcx,8) - adcxq %rax,%r14 - adoxq %rdi,%r15 - adcxq %rdi,%r15 - - incq %rcx - jnz .Loop_mulx - - movq %r8,%rbx - mulxq (%rsi),%rax,%r8 - adcxq %rax,%rbx - adoxq %r9,%r8 - -.byte 0xc4,0x62,0xfb,0xf6,0x8e,0x08,0x00,0x00,0x00 - adcxq %rax,%r8 - adoxq %r10,%r9 - -.byte 0xc4,0x62,0xfb,0xf6,0x96,0x10,0x00,0x00,0x00 - adcxq %rax,%r9 - adoxq %r11,%r10 - - mulxq 24(%rsi),%rax,%r11 - adcxq %rax,%r10 - adoxq %r12,%r11 - - mulxq 32(%rsi),%rax,%r12 - adcxq %rax,%r11 - adoxq %r13,%r12 - - mulxq 40(%rsi),%rax,%r13 - adcxq %rax,%r12 - adoxq %r14,%r13 - -.byte 0xc4,0x62,0xfb,0xf6,0xb6,0x30,0x00,0x00,0x00 - adcxq %rax,%r13 - adoxq %r15,%r14 - -.byte 0xc4,0x62,0xfb,0xf6,0xbe,0x38,0x00,0x00,0x00 - adcxq %rax,%r14 - adoxq %rdi,%r15 - adcxq %rdi,%r15 - - movq %rbx,8+64-8(%rsp) - movq %r8,8+64(%rsp) - movq %r9,8+64+8(%rsp) - movq %r10,8+64+16(%rsp) - movq %r11,8+64+24(%rsp) - movq %r12,8+64+32(%rsp) - movq %r13,8+64+40(%rsp) - movq %r14,8+64+48(%rsp) - movq %r15,8+64+56(%rsp) - - .byte 0xf3,0xc3 -.size __rsaz_512_mulx,.-__rsaz_512_mulx .globl rsaz_512_scatter4 .type rsaz_512_scatter4,@function .align 16 rsaz_512_scatter4: - leaq (%rdi,%rdx,4),%rdi + leaq (%rdi,%rdx,8),%rdi movl $8,%r9d jmp .Loop_scatter .align 16 .Loop_scatter: movq (%rsi),%rax leaq 8(%rsi),%rsi - movl %eax,(%rdi) - shrq $32,%rax - movl %eax,64(%rdi) + movq %rax,(%rdi) leaq 128(%rdi),%rdi decl %r9d jnz .Loop_scatter @@ -1737,19 +1148,72 @@ rsaz_512_scatter4: .type rsaz_512_gather4,@function .align 16 rsaz_512_gather4: - leaq (%rsi,%rdx,4),%rsi + movd %edx,%xmm8 + movdqa .Linc+16(%rip),%xmm1 + movdqa .Linc(%rip),%xmm0 + + pshufd $0,%xmm8,%xmm8 + movdqa %xmm1,%xmm7 + movdqa %xmm1,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm8,%xmm0 + movdqa %xmm7,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm8,%xmm1 + movdqa %xmm7,%xmm4 + paddd %xmm2,%xmm3 + pcmpeqd %xmm8,%xmm2 + movdqa %xmm7,%xmm5 + paddd %xmm3,%xmm4 + pcmpeqd %xmm8,%xmm3 + movdqa %xmm7,%xmm6 + paddd %xmm4,%xmm5 + pcmpeqd %xmm8,%xmm4 + paddd %xmm5,%xmm6 + pcmpeqd %xmm8,%xmm5 + paddd %xmm6,%xmm7 + pcmpeqd %xmm8,%xmm6 + pcmpeqd %xmm8,%xmm7 movl $8,%r9d jmp .Loop_gather .align 16 .Loop_gather: - movl (%rsi),%eax - movl 64(%rsi),%r8d + movdqa 0(%rsi),%xmm8 + movdqa 16(%rsi),%xmm9 + movdqa 32(%rsi),%xmm10 + movdqa 48(%rsi),%xmm11 + pand %xmm0,%xmm8 + movdqa 64(%rsi),%xmm12 + pand %xmm1,%xmm9 + movdqa 80(%rsi),%xmm13 + pand %xmm2,%xmm10 + movdqa 96(%rsi),%xmm14 + pand %xmm3,%xmm11 + movdqa 112(%rsi),%xmm15 leaq 128(%rsi),%rsi - shlq $32,%r8 - orq %r8,%rax - movq %rax,(%rdi) + pand %xmm4,%xmm12 + pand %xmm5,%xmm13 + pand %xmm6,%xmm14 + pand %xmm7,%xmm15 + por %xmm10,%xmm8 + por %xmm11,%xmm9 + por %xmm12,%xmm8 + por %xmm13,%xmm9 + por %xmm14,%xmm8 + por %xmm15,%xmm9 + + por %xmm9,%xmm8 + pshufd $0x4e,%xmm8,%xmm9 + por %xmm9,%xmm8 + movq %xmm8,(%rdi) leaq 8(%rdi),%rdi decl %r9d jnz .Loop_gather .byte 0xf3,0xc3 +.LSEH_end_rsaz_512_gather4: .size rsaz_512_gather4,.-rsaz_512_gather4 + +.align 64 +.Linc: +.long 0,0, 1,1 +.long 2,2, 2,2 diff --git a/deps/openssl/asm/x64-elf-gas/bn/x86_64-gf2m.s b/deps/openssl/asm/x64-elf-gas/bn/x86_64-gf2m.s index eed057ad6a1a8a..f4e5337565bbc7 100644 --- a/deps/openssl/asm/x64-elf-gas/bn/x86_64-gf2m.s +++ b/deps/openssl/asm/x64-elf-gas/bn/x86_64-gf2m.s @@ -242,7 +242,7 @@ bn_GF2m_mul_2x2: movq %rcx,56(%rsp) movq %r8,64(%rsp) - movq $15,%r8 + movq $0xf,%r8 movq %rsi,%rax movq %rcx,%rbp call _mul_1x1 diff --git a/deps/openssl/asm/x64-elf-gas/bn/x86_64-mont.s b/deps/openssl/asm/x64-elf-gas/bn/x86_64-mont.s index 45d19cd8b5fc2e..9e0019c163771c 100644 --- a/deps/openssl/asm/x64-elf-gas/bn/x86_64-mont.s +++ b/deps/openssl/asm/x64-elf-gas/bn/x86_64-mont.s @@ -10,7 +10,6 @@ bn_mul_mont: jnz .Lmul_enter cmpl $8,%r9d jb .Lmul_enter - movl OPENSSL_ia32cap_P+8(%rip),%r11d cmpq %rsi,%rdx jne .Lmul4x_enter testl $7,%r9d @@ -216,9 +215,6 @@ bn_mul_mont: .align 16 bn_mul4x_mont: .Lmul4x_enter: - andl $524544,%r11d - cmpl $524544,%r11d - je .Lmulx4x_enter pushq %rbx pushq %rbp pushq %r12 @@ -615,7 +611,6 @@ bn_mul4x_mont: .size bn_mul4x_mont,.-bn_mul4x_mont - .type bn_sqr8x_mont,@function .align 32 bn_sqr8x_mont: @@ -638,20 +633,20 @@ bn_sqr8x_mont: - leaq -64(%rsp,%r9,4),%r11 + leaq -64(%rsp,%r9,2),%r11 movq (%r8),%r8 subq %rsi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb .Lsqr8x_sp_alt subq %r11,%rsp - leaq -64(%rsp,%r9,4),%rsp + leaq -64(%rsp,%r9,2),%rsp jmp .Lsqr8x_sp_done .align 32 .Lsqr8x_sp_alt: - leaq 4096-64(,%r9,4),%r10 - leaq -64(%rsp,%r9,4),%rsp + leaq 4096-64(,%r9,2),%r10 + leaq -64(%rsp,%r9,2),%rsp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 @@ -661,385 +656,81 @@ bn_sqr8x_mont: movq %r9,%r10 negq %r9 - leaq 64(%rsp,%r9,2),%r11 movq %r8,32(%rsp) movq %rax,40(%rsp) .Lsqr8x_body: - movq %r9,%rbp -.byte 102,73,15,110,211 - shrq $3+2,%rbp - movl OPENSSL_ia32cap_P+8(%rip),%eax - jmp .Lsqr8x_copy_n - -.align 32 -.Lsqr8x_copy_n: - movq 0(%rcx),%xmm0 - movq 8(%rcx),%xmm1 - movq 16(%rcx),%xmm3 - movq 24(%rcx),%xmm4 - leaq 32(%rcx),%rcx - movdqa %xmm0,0(%r11) - movdqa %xmm1,16(%r11) - movdqa %xmm3,32(%r11) - movdqa %xmm4,48(%r11) - leaq 64(%r11),%r11 - decq %rbp - jnz .Lsqr8x_copy_n - +.byte 102,72,15,110,209 pxor %xmm0,%xmm0 .byte 102,72,15,110,207 .byte 102,73,15,110,218 - andl $524544,%eax - cmpl $524544,%eax - jne .Lsqr8x_nox - - call bn_sqrx8x_internal - - pxor %xmm0,%xmm0 - leaq 48(%rsp),%rax - leaq 64(%rsp,%r9,2),%rdx - shrq $3+2,%r9 - movq 40(%rsp),%rsi - jmp .Lsqr8x_zero - -.align 32 -.Lsqr8x_nox: call bn_sqr8x_internal - pxor %xmm0,%xmm0 - leaq 48(%rsp),%rax - leaq 64(%rsp,%r9,2),%rdx - shrq $3+2,%r9 - movq 40(%rsp),%rsi - jmp .Lsqr8x_zero - -.align 32 -.Lsqr8x_zero: - movdqa %xmm0,0(%rax) - movdqa %xmm0,16(%rax) - movdqa %xmm0,32(%rax) - movdqa %xmm0,48(%rax) - leaq 64(%rax),%rax - movdqa %xmm0,0(%rdx) - movdqa %xmm0,16(%rdx) - movdqa %xmm0,32(%rdx) - movdqa %xmm0,48(%rdx) - leaq 64(%rdx),%rdx - decq %r9 - jnz .Lsqr8x_zero - - movq $1,%rax - movq -48(%rsi),%r15 - movq -40(%rsi),%r14 - movq -32(%rsi),%r13 - movq -24(%rsi),%r12 - movq -16(%rsi),%rbp - movq -8(%rsi),%rbx - leaq (%rsi),%rsp -.Lsqr8x_epilogue: - .byte 0xf3,0xc3 -.size bn_sqr8x_mont,.-bn_sqr8x_mont -.type bn_mulx4x_mont,@function -.align 32 -bn_mulx4x_mont: -.Lmulx4x_enter: - movq %rsp,%rax - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - - shll $3,%r9d -.byte 0x67 - xorq %r10,%r10 - subq %r9,%r10 - movq (%r8),%r8 - leaq -72(%rsp,%r10,1),%rsp - leaq (%rdx,%r9,1),%r10 - andq $-128,%rsp - - - - - - - - - - movq %r9,0(%rsp) - shrq $5,%r9 - movq %r10,16(%rsp) - subq $1,%r9 - movq %r8,24(%rsp) - movq %rdi,32(%rsp) - movq %rax,40(%rsp) - movq %r9,48(%rsp) - jmp .Lmulx4x_body - -.align 32 -.Lmulx4x_body: - leaq 8(%rdx),%rdi - movq (%rdx),%rdx - leaq 64+32(%rsp),%rbx - movq %rdx,%r9 - - mulxq 0(%rsi),%r8,%rax - mulxq 8(%rsi),%r11,%r14 - addq %rax,%r11 - movq %rdi,8(%rsp) - mulxq 16(%rsi),%r12,%r13 - adcq %r14,%r12 - adcq $0,%r13 - - movq %r8,%rdi - imulq 24(%rsp),%r8 - xorq %rbp,%rbp - - mulxq 24(%rsi),%rax,%r14 - movq %r8,%rdx - leaq 32(%rsi),%rsi - adcxq %rax,%r13 - adcxq %rbp,%r14 - - mulxq 0(%rcx),%rax,%r10 - adcxq %rax,%rdi - adoxq %r11,%r10 - mulxq 8(%rcx),%rax,%r11 - adcxq %rax,%r10 - adoxq %r12,%r11 -.byte 0xc4,0x62,0xfb,0xf6,0xa1,0x10,0x00,0x00,0x00 - movq 48(%rsp),%rdi - movq %r10,-32(%rbx) - adcxq %rax,%r11 - adoxq %r13,%r12 - mulxq 24(%rcx),%rax,%r15 - movq %r9,%rdx - movq %r11,-24(%rbx) - adcxq %rax,%r12 - adoxq %rbp,%r15 - leaq 32(%rcx),%rcx - movq %r12,-16(%rbx) - - jmp .Lmulx4x_1st - -.align 32 -.Lmulx4x_1st: - adcxq %rbp,%r15 - mulxq 0(%rsi),%r10,%rax - adcxq %r14,%r10 - mulxq 8(%rsi),%r11,%r14 - adcxq %rax,%r11 - mulxq 16(%rsi),%r12,%rax - adcxq %r14,%r12 - mulxq 24(%rsi),%r13,%r14 -.byte 0x67,0x67 - movq %r8,%rdx - adcxq %rax,%r13 - adcxq %rbp,%r14 - leaq 32(%rsi),%rsi - leaq 32(%rbx),%rbx - - adoxq %r15,%r10 - mulxq 0(%rcx),%rax,%r15 - adcxq %rax,%r10 - adoxq %r15,%r11 - mulxq 8(%rcx),%rax,%r15 - adcxq %rax,%r11 - adoxq %r15,%r12 - mulxq 16(%rcx),%rax,%r15 - movq %r10,-40(%rbx) - adcxq %rax,%r12 - movq %r11,-32(%rbx) - adoxq %r15,%r13 - mulxq 24(%rcx),%rax,%r15 - movq %r9,%rdx - movq %r12,-24(%rbx) - adcxq %rax,%r13 - adoxq %rbp,%r15 - leaq 32(%rcx),%rcx - movq %r13,-16(%rbx) - - decq %rdi - jnz .Lmulx4x_1st - - movq 0(%rsp),%rax - movq 8(%rsp),%rdi - adcq %rbp,%r15 - addq %r15,%r14 - sbbq %r15,%r15 - movq %r14,-8(%rbx) - jmp .Lmulx4x_outer - -.align 32 -.Lmulx4x_outer: - movq (%rdi),%rdx - leaq 8(%rdi),%rdi - subq %rax,%rsi - movq %r15,(%rbx) - leaq 64+32(%rsp),%rbx - subq %rax,%rcx - - mulxq 0(%rsi),%r8,%r11 - xorl %ebp,%ebp - movq %rdx,%r9 - mulxq 8(%rsi),%r14,%r12 - adoxq -32(%rbx),%r8 - adcxq %r14,%r11 - mulxq 16(%rsi),%r15,%r13 - adoxq -24(%rbx),%r11 - adcxq %r15,%r12 - adoxq %rbp,%r12 - adcxq %rbp,%r13 - - movq %rdi,8(%rsp) -.byte 0x67 - movq %r8,%r15 - imulq 24(%rsp),%r8 - xorl %ebp,%ebp - - mulxq 24(%rsi),%rax,%r14 - movq %r8,%rdx - adoxq -16(%rbx),%r12 - adcxq %rax,%r13 - adoxq -8(%rbx),%r13 - adcxq %rbp,%r14 - leaq 32(%rsi),%rsi - adoxq %rbp,%r14 - - mulxq 0(%rcx),%rax,%r10 - adcxq %rax,%r15 - adoxq %r11,%r10 - mulxq 8(%rcx),%rax,%r11 - adcxq %rax,%r10 - adoxq %r12,%r11 - mulxq 16(%rcx),%rax,%r12 - movq %r10,-32(%rbx) - adcxq %rax,%r11 - adoxq %r13,%r12 - mulxq 24(%rcx),%rax,%r15 + leaq (%rdi,%r9,1),%rbx + movq %r9,%rcx movq %r9,%rdx - movq %r11,-24(%rbx) - leaq 32(%rcx),%rcx - adcxq %rax,%r12 - adoxq %rbp,%r15 - movq 48(%rsp),%rdi - movq %r12,-16(%rbx) - - jmp .Lmulx4x_inner +.byte 102,72,15,126,207 + sarq $3+2,%rcx + jmp .Lsqr8x_sub .align 32 -.Lmulx4x_inner: - mulxq 0(%rsi),%r10,%rax - adcxq %rbp,%r15 - adoxq %r14,%r10 - mulxq 8(%rsi),%r11,%r14 - adcxq 0(%rbx),%r10 - adoxq %rax,%r11 - mulxq 16(%rsi),%r12,%rax - adcxq 8(%rbx),%r11 - adoxq %r14,%r12 - mulxq 24(%rsi),%r13,%r14 - movq %r8,%rdx - adcxq 16(%rbx),%r12 - adoxq %rax,%r13 - adcxq 24(%rbx),%r13 - adoxq %rbp,%r14 - leaq 32(%rsi),%rsi +.Lsqr8x_sub: + movq 0(%rbx),%r12 + movq 8(%rbx),%r13 + movq 16(%rbx),%r14 + movq 24(%rbx),%r15 leaq 32(%rbx),%rbx - adcxq %rbp,%r14 - - adoxq %r15,%r10 - mulxq 0(%rcx),%rax,%r15 - adcxq %rax,%r10 - adoxq %r15,%r11 - mulxq 8(%rcx),%rax,%r15 - adcxq %rax,%r11 - adoxq %r15,%r12 - mulxq 16(%rcx),%rax,%r15 - movq %r10,-40(%rbx) - adcxq %rax,%r12 - adoxq %r15,%r13 - mulxq 24(%rcx),%rax,%r15 - movq %r9,%rdx - movq %r11,-32(%rbx) - movq %r12,-24(%rbx) - adcxq %rax,%r13 - adoxq %rbp,%r15 - leaq 32(%rcx),%rcx - movq %r13,-16(%rbx) - - decq %rdi - jnz .Lmulx4x_inner + sbbq 0(%rbp),%r12 + sbbq 8(%rbp),%r13 + sbbq 16(%rbp),%r14 + sbbq 24(%rbp),%r15 + leaq 32(%rbp),%rbp + movq %r12,0(%rdi) + movq %r13,8(%rdi) + movq %r14,16(%rdi) + movq %r15,24(%rdi) + leaq 32(%rdi),%rdi + incq %rcx + jnz .Lsqr8x_sub - movq 0(%rsp),%rax - movq 8(%rsp),%rdi - adcq %rbp,%r15 - subq 0(%rbx),%rbp - adcq %r15,%r14 - movq -8(%rcx),%r8 - sbbq %r15,%r15 - movq %r14,-8(%rbx) - - cmpq 16(%rsp),%rdi - jne .Lmulx4x_outer - - subq %r14,%r8 - sbbq %r8,%r8 - orq %r8,%r15 - - negq %rax - xorq %rdx,%rdx - movq 32(%rsp),%rdi - leaq 64(%rsp),%rbx + sbbq $0,%rax + leaq (%rbx,%r9,1),%rbx + leaq (%rdi,%r9,1),%rdi +.byte 102,72,15,110,200 pxor %xmm0,%xmm0 - movq 0(%rcx,%rax,1),%r8 - movq 8(%rcx,%rax,1),%r9 - negq %r8 - jmp .Lmulx4x_sub_entry + pshufd $0,%xmm1,%xmm1 + movq 40(%rsp),%rsi + jmp .Lsqr8x_cond_copy .align 32 -.Lmulx4x_sub: - movq 0(%rcx,%rax,1),%r8 - movq 8(%rcx,%rax,1),%r9 - notq %r8 -.Lmulx4x_sub_entry: - movq 16(%rcx,%rax,1),%r10 - notq %r9 - andq %r15,%r8 - movq 24(%rcx,%rax,1),%r11 - notq %r10 - andq %r15,%r9 - notq %r11 - andq %r15,%r10 - andq %r15,%r11 - - negq %rdx - adcq 0(%rbx),%r8 - adcq 8(%rbx),%r9 - movdqa %xmm0,(%rbx) - adcq 16(%rbx),%r10 - adcq 24(%rbx),%r11 - movdqa %xmm0,16(%rbx) +.Lsqr8x_cond_copy: + movdqa 0(%rbx),%xmm2 + movdqa 16(%rbx),%xmm3 leaq 32(%rbx),%rbx - sbbq %rdx,%rdx - - movq %r8,0(%rdi) - movq %r9,8(%rdi) - movq %r10,16(%rdi) - movq %r11,24(%rdi) + movdqu 0(%rdi),%xmm4 + movdqu 16(%rdi),%xmm5 leaq 32(%rdi),%rdi + movdqa %xmm0,-32(%rbx) + movdqa %xmm0,-16(%rbx) + movdqa %xmm0,-32(%rbx,%rdx,1) + movdqa %xmm0,-16(%rbx,%rdx,1) + pcmpeqd %xmm1,%xmm0 + pand %xmm1,%xmm2 + pand %xmm1,%xmm3 + pand %xmm0,%xmm4 + pand %xmm0,%xmm5 + pxor %xmm0,%xmm0 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqu %xmm4,-32(%rdi) + movdqu %xmm5,-16(%rdi) + addq $32,%r9 + jnz .Lsqr8x_cond_copy - addq $32,%rax - jnz .Lmulx4x_sub - - movq 40(%rsp),%rsi movq $1,%rax movq -48(%rsi),%r15 movq -40(%rsi),%r14 @@ -1048,8 +739,8 @@ bn_mulx4x_mont: movq -16(%rsi),%rbp movq -8(%rsi),%rbx leaq (%rsi),%rsp -.Lmulx4x_epilogue: +.Lsqr8x_epilogue: .byte 0xf3,0xc3 -.size bn_mulx4x_mont,.-bn_mulx4x_mont +.size bn_sqr8x_mont,.-bn_sqr8x_mont .byte 77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105,112,108,105,99,97,116,105,111,110,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 .align 16 diff --git a/deps/openssl/asm/x64-elf-gas/bn/x86_64-mont5.s b/deps/openssl/asm/x64-elf-gas/bn/x86_64-mont5.s index db3fe399abd495..8afe2496952006 100644 --- a/deps/openssl/asm/x64-elf-gas/bn/x86_64-mont5.s +++ b/deps/openssl/asm/x64-elf-gas/bn/x86_64-mont5.s @@ -8,53 +8,157 @@ bn_mul_mont_gather5: testl $7,%r9d jnz .Lmul_enter - movl OPENSSL_ia32cap_P+8(%rip),%r11d jmp .Lmul4x_enter .align 16 .Lmul_enter: movl %r9d,%r9d movq %rsp,%rax - movl 8(%rsp),%r10d + movd 8(%rsp),%xmm5 + leaq .Linc(%rip),%r10 pushq %rbx pushq %rbp pushq %r12 pushq %r13 pushq %r14 pushq %r15 + leaq 2(%r9),%r11 negq %r11 - leaq (%rsp,%r11,8),%rsp + leaq -264(%rsp,%r11,8),%rsp andq $-1024,%rsp movq %rax,8(%rsp,%r9,8) .Lmul_body: - movq %rdx,%r12 - movq %r10,%r11 - shrq $3,%r10 - andq $7,%r11 - notq %r10 - leaq .Lmagic_masks(%rip),%rax - andq $3,%r10 - leaq 96(%r12,%r11,8),%r12 - movq 0(%rax,%r10,8),%xmm4 - movq 8(%rax,%r10,8),%xmm5 - movq 16(%rax,%r10,8),%xmm6 - movq 24(%rax,%r10,8),%xmm7 - - movq -96(%r12),%xmm0 - movq -32(%r12),%xmm1 - pand %xmm4,%xmm0 - movq 32(%r12),%xmm2 - pand %xmm5,%xmm1 - movq 96(%r12),%xmm3 - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 + leaq 128(%rdx),%r12 + movdqa 0(%r10),%xmm0 + movdqa 16(%r10),%xmm1 + leaq 24-112(%rsp,%r9,8),%r10 + andq $-16,%r10 + + pshufd $0,%xmm5,%xmm5 + movdqa %xmm1,%xmm4 + movdqa %xmm1,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 +.byte 0x67 + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,112(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,128(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,144(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,160(%r10) + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,176(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,192(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,208(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,224(%r10) + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,240(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,256(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,272(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,288(%r10) + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,304(%r10) + + paddd %xmm2,%xmm3 +.byte 0x67 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,320(%r10) + + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,336(%r10) + pand 64(%r12),%xmm0 + + pand 80(%r12),%xmm1 + pand 96(%r12),%xmm2 + movdqa %xmm3,352(%r10) + pand 112(%r12),%xmm3 por %xmm2,%xmm0 + por %xmm3,%xmm1 + movdqa -128(%r12),%xmm4 + movdqa -112(%r12),%xmm5 + movdqa -96(%r12),%xmm2 + pand 112(%r10),%xmm4 + movdqa -80(%r12),%xmm3 + pand 128(%r10),%xmm5 + por %xmm4,%xmm0 + pand 144(%r10),%xmm2 + por %xmm5,%xmm1 + pand 160(%r10),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + movdqa -64(%r12),%xmm4 + movdqa -48(%r12),%xmm5 + movdqa -32(%r12),%xmm2 + pand 176(%r10),%xmm4 + movdqa -16(%r12),%xmm3 + pand 192(%r10),%xmm5 + por %xmm4,%xmm0 + pand 208(%r10),%xmm2 + por %xmm5,%xmm1 + pand 224(%r10),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + movdqa 0(%r12),%xmm4 + movdqa 16(%r12),%xmm5 + movdqa 32(%r12),%xmm2 + pand 240(%r10),%xmm4 + movdqa 48(%r12),%xmm3 + pand 256(%r10),%xmm5 + por %xmm4,%xmm0 + pand 272(%r10),%xmm2 + por %xmm5,%xmm1 + pand 288(%r10),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + por %xmm1,%xmm0 + pshufd $0x4e,%xmm0,%xmm1 + por %xmm1,%xmm0 leaq 256(%r12),%r12 - por %xmm3,%xmm0 - .byte 102,72,15,126,195 movq (%r8),%r8 @@ -63,29 +167,14 @@ bn_mul_mont_gather5: xorq %r14,%r14 xorq %r15,%r15 - movq -96(%r12),%xmm0 - movq -32(%r12),%xmm1 - pand %xmm4,%xmm0 - movq 32(%r12),%xmm2 - pand %xmm5,%xmm1 - movq %r8,%rbp mulq %rbx movq %rax,%r10 movq (%rcx),%rax - movq 96(%r12),%xmm3 - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 - imulq %r10,%rbp movq %rdx,%r11 - por %xmm2,%xmm0 - leaq 256(%r12),%r12 - por %xmm3,%xmm0 - mulq %rbp addq %rax,%r10 movq 8(%rsi),%rax @@ -118,14 +207,12 @@ bn_mul_mont_gather5: cmpq %r9,%r15 jne .L1st -.byte 102,72,15,126,195 addq %rax,%r13 - movq (%rsi),%rax adcq $0,%rdx addq %r11,%r13 adcq $0,%rdx - movq %r13,-16(%rsp,%r15,8) + movq %r13,-16(%rsp,%r9,8) movq %rdx,%r13 movq %r10,%r11 @@ -139,33 +226,78 @@ bn_mul_mont_gather5: jmp .Louter .align 16 .Louter: + leaq 24+128(%rsp,%r9,8),%rdx + andq $-16,%rdx + pxor %xmm4,%xmm4 + pxor %xmm5,%xmm5 + movdqa -128(%r12),%xmm0 + movdqa -112(%r12),%xmm1 + movdqa -96(%r12),%xmm2 + movdqa -80(%r12),%xmm3 + pand -128(%rdx),%xmm0 + pand -112(%rdx),%xmm1 + por %xmm0,%xmm4 + pand -96(%rdx),%xmm2 + por %xmm1,%xmm5 + pand -80(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa -64(%r12),%xmm0 + movdqa -48(%r12),%xmm1 + movdqa -32(%r12),%xmm2 + movdqa -16(%r12),%xmm3 + pand -64(%rdx),%xmm0 + pand -48(%rdx),%xmm1 + por %xmm0,%xmm4 + pand -32(%rdx),%xmm2 + por %xmm1,%xmm5 + pand -16(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa 0(%r12),%xmm0 + movdqa 16(%r12),%xmm1 + movdqa 32(%r12),%xmm2 + movdqa 48(%r12),%xmm3 + pand 0(%rdx),%xmm0 + pand 16(%rdx),%xmm1 + por %xmm0,%xmm4 + pand 32(%rdx),%xmm2 + por %xmm1,%xmm5 + pand 48(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa 64(%r12),%xmm0 + movdqa 80(%r12),%xmm1 + movdqa 96(%r12),%xmm2 + movdqa 112(%r12),%xmm3 + pand 64(%rdx),%xmm0 + pand 80(%rdx),%xmm1 + por %xmm0,%xmm4 + pand 96(%rdx),%xmm2 + por %xmm1,%xmm5 + pand 112(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + por %xmm5,%xmm4 + pshufd $0x4e,%xmm4,%xmm0 + por %xmm4,%xmm0 + leaq 256(%r12),%r12 + + movq (%rsi),%rax +.byte 102,72,15,126,195 + xorq %r15,%r15 movq %r8,%rbp movq (%rsp),%r10 - movq -96(%r12),%xmm0 - movq -32(%r12),%xmm1 - pand %xmm4,%xmm0 - movq 32(%r12),%xmm2 - pand %xmm5,%xmm1 - mulq %rbx addq %rax,%r10 movq (%rcx),%rax adcq $0,%rdx - movq 96(%r12),%xmm3 - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 - imulq %r10,%rbp movq %rdx,%r11 - por %xmm2,%xmm0 - leaq 256(%r12),%r12 - por %xmm3,%xmm0 - mulq %rbp addq %rax,%r10 movq 8(%rsi),%rax @@ -201,15 +333,12 @@ bn_mul_mont_gather5: cmpq %r9,%r15 jne .Linner -.byte 102,72,15,126,195 - addq %rax,%r13 - movq (%rsi),%rax adcq $0,%rdx addq %r10,%r13 - movq (%rsp,%r15,8),%r10 + movq (%rsp,%r9,8),%r10 adcq $0,%rdx - movq %r13,-16(%rsp,%r15,8) + movq %r13,-16(%rsp,%r9,8) movq %rdx,%r13 xorq %rdx,%rdx @@ -256,6 +385,7 @@ bn_mul_mont_gather5: movq 8(%rsp,%r9,8),%rsi movq $1,%rax + movq -48(%rsi),%r15 movq -40(%rsi),%r14 movq -32(%rsi),%r13 @@ -270,9 +400,6 @@ bn_mul_mont_gather5: .align 32 bn_mul4x_mont_gather5: .Lmul4x_enter: - andl $524544,%r11d - cmpl $524544,%r11d - je .Lmulx4x_enter .byte 0x67 movq %rsp,%rax pushq %rbx @@ -281,10 +408,10 @@ bn_mul4x_mont_gather5: pushq %r13 pushq %r14 pushq %r15 + .byte 0x67 - movl %r9d,%r10d shll $3,%r9d - shll $3+2,%r10d + leaq (%r9,%r9,2),%r10 negq %r9 @@ -294,19 +421,21 @@ bn_mul4x_mont_gather5: - leaq -64(%rsp,%r9,2),%r11 - subq %rsi,%r11 + + + leaq -320(%rsp,%r9,2),%r11 + subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb .Lmul4xsp_alt subq %r11,%rsp - leaq -64(%rsp,%r9,2),%rsp + leaq -320(%rsp,%r9,2),%rsp jmp .Lmul4xsp_done .align 32 .Lmul4xsp_alt: - leaq 4096-64(,%r9,2),%r10 - leaq -64(%rsp,%r9,2),%rsp + leaq 4096-320(,%r9,2),%r10 + leaq -320(%rsp,%r9,2),%rsp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 @@ -322,6 +451,7 @@ bn_mul4x_mont_gather5: movq 40(%rsp),%rsi movq $1,%rax + movq -48(%rsi),%r15 movq -40(%rsi),%r14 movq -32(%rsi),%r13 @@ -337,47 +467,141 @@ bn_mul4x_mont_gather5: .align 32 mul4x_internal: shlq $5,%r9 - movl 8(%rax),%r10d - leaq 256(%rdx,%r9,1),%r13 + movd 8(%rax),%xmm5 + leaq .Linc(%rip),%rax + leaq 128(%rdx,%r9,1),%r13 shrq $5,%r9 - movq %r10,%r11 - shrq $3,%r10 - andq $7,%r11 - notq %r10 - leaq .Lmagic_masks(%rip),%rax - andq $3,%r10 - leaq 96(%rdx,%r11,8),%r12 - movq 0(%rax,%r10,8),%xmm4 - movq 8(%rax,%r10,8),%xmm5 - addq $7,%r11 - movq 16(%rax,%r10,8),%xmm6 - movq 24(%rax,%r10,8),%xmm7 - andq $7,%r11 - - movq -96(%r12),%xmm0 - leaq 256(%r12),%r14 - movq -32(%r12),%xmm1 - pand %xmm4,%xmm0 - movq 32(%r12),%xmm2 - pand %xmm5,%xmm1 - movq 96(%r12),%xmm3 - pand %xmm6,%xmm2 -.byte 0x67 - por %xmm1,%xmm0 - movq -96(%r14),%xmm1 -.byte 0x67 - pand %xmm7,%xmm3 -.byte 0x67 - por %xmm2,%xmm0 - movq -32(%r14),%xmm2 + movdqa 0(%rax),%xmm0 + movdqa 16(%rax),%xmm1 + leaq 88-112(%rsp,%r9,1),%r10 + leaq 128(%rdx),%r12 + + pshufd $0,%xmm5,%xmm5 + movdqa %xmm1,%xmm4 +.byte 0x67,0x67 + movdqa %xmm1,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 .byte 0x67 - pand %xmm4,%xmm1 + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,112(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,128(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,144(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,160(%r10) + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,176(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,192(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,208(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,224(%r10) + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,240(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,256(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,272(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,288(%r10) + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,304(%r10) + + paddd %xmm2,%xmm3 .byte 0x67 - por %xmm3,%xmm0 - movq 32(%r14),%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,320(%r10) + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,336(%r10) + pand 64(%r12),%xmm0 + + pand 80(%r12),%xmm1 + pand 96(%r12),%xmm2 + movdqa %xmm3,352(%r10) + pand 112(%r12),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + movdqa -128(%r12),%xmm4 + movdqa -112(%r12),%xmm5 + movdqa -96(%r12),%xmm2 + pand 112(%r10),%xmm4 + movdqa -80(%r12),%xmm3 + pand 128(%r10),%xmm5 + por %xmm4,%xmm0 + pand 144(%r10),%xmm2 + por %xmm5,%xmm1 + pand 160(%r10),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + movdqa -64(%r12),%xmm4 + movdqa -48(%r12),%xmm5 + movdqa -32(%r12),%xmm2 + pand 176(%r10),%xmm4 + movdqa -16(%r12),%xmm3 + pand 192(%r10),%xmm5 + por %xmm4,%xmm0 + pand 208(%r10),%xmm2 + por %xmm5,%xmm1 + pand 224(%r10),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + movdqa 0(%r12),%xmm4 + movdqa 16(%r12),%xmm5 + movdqa 32(%r12),%xmm2 + pand 240(%r10),%xmm4 + movdqa 48(%r12),%xmm3 + pand 256(%r10),%xmm5 + por %xmm4,%xmm0 + pand 272(%r10),%xmm2 + por %xmm5,%xmm1 + pand 288(%r10),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + por %xmm1,%xmm0 + pshufd $0x4e,%xmm0,%xmm1 + por %xmm1,%xmm0 + leaq 256(%r12),%r12 .byte 102,72,15,126,195 - movq 96(%r14),%xmm0 + movq %r13,16+8(%rsp) movq %rdi,56+8(%rsp) @@ -391,26 +615,10 @@ mul4x_internal: movq %rax,%r10 movq (%rcx),%rax - pand %xmm5,%xmm2 - pand %xmm6,%xmm3 - por %xmm2,%xmm1 - imulq %r10,%rbp - - - - - - - - leaq 64+8(%rsp,%r11,8),%r14 + leaq 64+8(%rsp),%r14 movq %rdx,%r11 - pand %xmm7,%xmm0 - por %xmm3,%xmm1 - leaq 512(%r12),%r12 - por %xmm1,%xmm0 - mulq %rbp addq %rax,%r10 movq 8(%rsi,%r9,1),%rax @@ -419,7 +627,7 @@ mul4x_internal: mulq %rbx addq %rax,%r11 - movq 16(%rcx),%rax + movq 8(%rcx),%rax adcq $0,%rdx movq %rdx,%r10 @@ -429,7 +637,7 @@ mul4x_internal: adcq $0,%rdx addq %r11,%rdi leaq 32(%r9),%r15 - leaq 64(%rcx),%rcx + leaq 32(%rcx),%rcx adcq $0,%rdx movq %rdi,(%r14) movq %rdx,%r13 @@ -439,7 +647,7 @@ mul4x_internal: .L1st4x: mulq %rbx addq %rax,%r10 - movq -32(%rcx),%rax + movq -16(%rcx),%rax leaq 32(%r14),%r14 adcq $0,%rdx movq %rdx,%r11 @@ -455,7 +663,7 @@ mul4x_internal: mulq %rbx addq %rax,%r11 - movq -16(%rcx),%rax + movq -8(%rcx),%rax adcq $0,%rdx movq %rdx,%r10 @@ -485,7 +693,7 @@ mul4x_internal: mulq %rbx addq %rax,%r11 - movq 16(%rcx),%rax + movq 8(%rcx),%rax adcq $0,%rdx movq %rdx,%r10 @@ -494,7 +702,7 @@ mul4x_internal: movq 16(%rsi,%r15,1),%rax adcq $0,%rdx addq %r11,%rdi - leaq 64(%rcx),%rcx + leaq 32(%rcx),%rcx adcq $0,%rdx movq %rdi,(%r14) movq %rdx,%r13 @@ -504,7 +712,7 @@ mul4x_internal: mulq %rbx addq %rax,%r10 - movq -32(%rcx),%rax + movq -16(%rcx),%rax leaq 32(%r14),%r14 adcq $0,%rdx movq %rdx,%r11 @@ -520,7 +728,7 @@ mul4x_internal: mulq %rbx addq %rax,%r11 - movq -16(%rcx),%rax + movq -8(%rcx),%rax adcq $0,%rdx movq %rdx,%r10 @@ -533,8 +741,7 @@ mul4x_internal: movq %rdi,-16(%r14) movq %rdx,%r13 -.byte 102,72,15,126,195 - leaq (%rcx,%r9,2),%rcx + leaq (%rcx,%r9,1),%rcx xorq %rdi,%rdi addq %r10,%r13 @@ -545,6 +752,63 @@ mul4x_internal: .align 32 .Louter4x: + leaq 16+128(%r14),%rdx + pxor %xmm4,%xmm4 + pxor %xmm5,%xmm5 + movdqa -128(%r12),%xmm0 + movdqa -112(%r12),%xmm1 + movdqa -96(%r12),%xmm2 + movdqa -80(%r12),%xmm3 + pand -128(%rdx),%xmm0 + pand -112(%rdx),%xmm1 + por %xmm0,%xmm4 + pand -96(%rdx),%xmm2 + por %xmm1,%xmm5 + pand -80(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa -64(%r12),%xmm0 + movdqa -48(%r12),%xmm1 + movdqa -32(%r12),%xmm2 + movdqa -16(%r12),%xmm3 + pand -64(%rdx),%xmm0 + pand -48(%rdx),%xmm1 + por %xmm0,%xmm4 + pand -32(%rdx),%xmm2 + por %xmm1,%xmm5 + pand -16(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa 0(%r12),%xmm0 + movdqa 16(%r12),%xmm1 + movdqa 32(%r12),%xmm2 + movdqa 48(%r12),%xmm3 + pand 0(%rdx),%xmm0 + pand 16(%rdx),%xmm1 + por %xmm0,%xmm4 + pand 32(%rdx),%xmm2 + por %xmm1,%xmm5 + pand 48(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa 64(%r12),%xmm0 + movdqa 80(%r12),%xmm1 + movdqa 96(%r12),%xmm2 + movdqa 112(%r12),%xmm3 + pand 64(%rdx),%xmm0 + pand 80(%rdx),%xmm1 + por %xmm0,%xmm4 + pand 96(%rdx),%xmm2 + por %xmm1,%xmm5 + pand 112(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + por %xmm5,%xmm4 + pshufd $0x4e,%xmm4,%xmm0 + por %xmm4,%xmm0 + leaq 256(%r12),%r12 +.byte 102,72,15,126,195 + movq (%r14,%r9,1),%r10 movq %r8,%rbp mulq %rbx @@ -552,25 +816,11 @@ mul4x_internal: movq (%rcx),%rax adcq $0,%rdx - movq -96(%r12),%xmm0 - movq -32(%r12),%xmm1 - pand %xmm4,%xmm0 - movq 32(%r12),%xmm2 - pand %xmm5,%xmm1 - movq 96(%r12),%xmm3 - imulq %r10,%rbp -.byte 0x67 movq %rdx,%r11 movq %rdi,(%r14) - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 - por %xmm2,%xmm0 leaq (%r14,%r9,1),%r14 - leaq 256(%r12),%r12 - por %xmm3,%xmm0 mulq %rbp addq %rax,%r10 @@ -580,7 +830,7 @@ mul4x_internal: mulq %rbx addq %rax,%r11 - movq 16(%rcx),%rax + movq 8(%rcx),%rax adcq $0,%rdx addq 8(%r14),%r11 adcq $0,%rdx @@ -592,7 +842,7 @@ mul4x_internal: adcq $0,%rdx addq %r11,%rdi leaq 32(%r9),%r15 - leaq 64(%rcx),%rcx + leaq 32(%rcx),%rcx adcq $0,%rdx movq %rdx,%r13 jmp .Linner4x @@ -601,7 +851,7 @@ mul4x_internal: .Linner4x: mulq %rbx addq %rax,%r10 - movq -32(%rcx),%rax + movq -16(%rcx),%rax adcq $0,%rdx addq 16(%r14),%r10 leaq 32(%r14),%r14 @@ -619,7 +869,7 @@ mul4x_internal: mulq %rbx addq %rax,%r11 - movq -16(%rcx),%rax + movq -8(%rcx),%rax adcq $0,%rdx addq -8(%r14),%r11 adcq $0,%rdx @@ -653,7 +903,7 @@ mul4x_internal: mulq %rbx addq %rax,%r11 - movq 16(%rcx),%rax + movq 8(%rcx),%rax adcq $0,%rdx addq 8(%r14),%r11 adcq $0,%rdx @@ -664,7 +914,7 @@ mul4x_internal: movq 16(%rsi,%r15,1),%rax adcq $0,%rdx addq %r11,%rdi - leaq 64(%rcx),%rcx + leaq 32(%rcx),%rcx adcq $0,%rdx movq %r13,-8(%r14) movq %rdx,%r13 @@ -674,7 +924,7 @@ mul4x_internal: mulq %rbx addq %rax,%r10 - movq -32(%rcx),%rax + movq -16(%rcx),%rax adcq $0,%rdx addq 16(%r14),%r10 leaq 32(%r14),%r14 @@ -693,7 +943,7 @@ mul4x_internal: mulq %rbx addq %rax,%r11 movq %rbp,%rax - movq -16(%rcx),%rbp + movq -8(%rcx),%rbp adcq $0,%rdx addq -8(%r14),%r11 adcq $0,%rdx @@ -708,9 +958,8 @@ mul4x_internal: movq %r13,-24(%r14) movq %rdx,%r13 -.byte 102,72,15,126,195 movq %rdi,-16(%r14) - leaq (%rcx,%r9,2),%rcx + leaq (%rcx,%r9,1),%rcx xorq %rdi,%rdi addq %r10,%r13 @@ -721,25 +970,28 @@ mul4x_internal: cmpq 16+8(%rsp),%r12 jb .Louter4x + xorq %rax,%rax subq %r13,%rbp adcq %r15,%r15 orq %r15,%rdi - xorq $1,%rdi + subq %rdi,%rax leaq (%r14,%r9,1),%rbx - leaq (%rcx,%rdi,8),%rbp + movq (%rcx),%r12 + leaq (%rcx),%rbp movq %r9,%rcx sarq $3+2,%rcx movq 56+8(%rsp),%rdi - jmp .Lsqr4x_sub + decq %r12 + xorq %r10,%r10 + movq 8(%rbp),%r13 + movq 16(%rbp),%r14 + movq 24(%rbp),%r15 + jmp .Lsqr4x_sub_entry .size mul4x_internal,.-mul4x_internal .globl bn_power5 .type bn_power5,@function .align 32 bn_power5: - movl OPENSSL_ia32cap_P+8(%rip),%r11d - andl $524544,%r11d - cmpl $524544,%r11d - je .Lpowerx5_enter movq %rsp,%rax pushq %rbx pushq %rbp @@ -747,9 +999,9 @@ bn_power5: pushq %r13 pushq %r14 pushq %r15 - movl %r9d,%r10d + shll $3,%r9d - shll $3+2,%r10d + leal (%r9,%r9,2),%r10d negq %r9 movq (%r8),%r8 @@ -759,19 +1011,20 @@ bn_power5: - leaq -64(%rsp,%r9,2),%r11 - subq %rsi,%r11 + + leaq -320(%rsp,%r9,2),%r11 + subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb .Lpwr_sp_alt subq %r11,%rsp - leaq -64(%rsp,%r9,2),%rsp + leaq -320(%rsp,%r9,2),%rsp jmp .Lpwr_sp_done .align 32 .Lpwr_sp_alt: - leaq 4096-64(,%r9,2),%r10 - leaq -64(%rsp,%r9,2),%rsp + leaq 4096-320(,%r9,2),%r10 + leaq -320(%rsp,%r9,2),%rsp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 @@ -799,10 +1052,15 @@ bn_power5: .byte 102,72,15,110,226 call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal .byte 102,72,15,126,209 .byte 102,72,15,126,226 @@ -1346,9 +1604,9 @@ __bn_sqr8x_internal: movq %rbx,-16(%rdi) movq %r8,-8(%rdi) .byte 102,72,15,126,213 -sqr8x_reduction: +__bn_sqr8x_reduction: xorq %rax,%rax - leaq (%rbp,%r9,2),%rcx + leaq (%r9,%rbp,1),%rcx leaq 48+8(%rsp,%r9,2),%rdx movq %rcx,0+8(%rsp) leaq 48+8(%rsp,%r9,1),%rdi @@ -1381,14 +1639,14 @@ sqr8x_reduction: .align 32 .L8x_reduce: mulq %rbx - movq 16(%rbp),%rax + movq 8(%rbp),%rax negq %r8 movq %rdx,%r8 adcq $0,%r8 mulq %rbx addq %rax,%r9 - movq 32(%rbp),%rax + movq 16(%rbp),%rax adcq $0,%rdx addq %r9,%r8 movq %rbx,48-8+8(%rsp,%rcx,8) @@ -1397,7 +1655,7 @@ sqr8x_reduction: mulq %rbx addq %rax,%r10 - movq 48(%rbp),%rax + movq 24(%rbp),%rax adcq $0,%rdx addq %r10,%r9 movq 32+8(%rsp),%rsi @@ -1406,7 +1664,7 @@ sqr8x_reduction: mulq %rbx addq %rax,%r11 - movq 64(%rbp),%rax + movq 32(%rbp),%rax adcq $0,%rdx imulq %r8,%rsi addq %r11,%r10 @@ -1415,7 +1673,7 @@ sqr8x_reduction: mulq %rbx addq %rax,%r12 - movq 80(%rbp),%rax + movq 40(%rbp),%rax adcq $0,%rdx addq %r12,%r11 movq %rdx,%r12 @@ -1423,7 +1681,7 @@ sqr8x_reduction: mulq %rbx addq %rax,%r13 - movq 96(%rbp),%rax + movq 48(%rbp),%rax adcq $0,%rdx addq %r13,%r12 movq %rdx,%r13 @@ -1431,7 +1689,7 @@ sqr8x_reduction: mulq %rbx addq %rax,%r14 - movq 112(%rbp),%rax + movq 56(%rbp),%rax adcq $0,%rdx addq %r14,%r13 movq %rdx,%r14 @@ -1449,7 +1707,7 @@ sqr8x_reduction: decl %ecx jnz .L8x_reduce - leaq 128(%rbp),%rbp + leaq 64(%rbp),%rbp xorq %rax,%rax movq 8+8(%rsp),%rdx cmpq 0+8(%rsp),%rbp @@ -1475,14 +1733,14 @@ sqr8x_reduction: .L8x_tail: mulq %rbx addq %rax,%r8 - movq 16(%rbp),%rax + movq 8(%rbp),%rax movq %r8,(%rdi) movq %rdx,%r8 adcq $0,%r8 mulq %rbx addq %rax,%r9 - movq 32(%rbp),%rax + movq 16(%rbp),%rax adcq $0,%rdx addq %r9,%r8 leaq 8(%rdi),%rdi @@ -1491,7 +1749,7 @@ sqr8x_reduction: mulq %rbx addq %rax,%r10 - movq 48(%rbp),%rax + movq 24(%rbp),%rax adcq $0,%rdx addq %r10,%r9 movq %rdx,%r10 @@ -1499,7 +1757,7 @@ sqr8x_reduction: mulq %rbx addq %rax,%r11 - movq 64(%rbp),%rax + movq 32(%rbp),%rax adcq $0,%rdx addq %r11,%r10 movq %rdx,%r11 @@ -1507,7 +1765,7 @@ sqr8x_reduction: mulq %rbx addq %rax,%r12 - movq 80(%rbp),%rax + movq 40(%rbp),%rax adcq $0,%rdx addq %r12,%r11 movq %rdx,%r12 @@ -1515,7 +1773,7 @@ sqr8x_reduction: mulq %rbx addq %rax,%r13 - movq 96(%rbp),%rax + movq 48(%rbp),%rax adcq $0,%rdx addq %r13,%r12 movq %rdx,%r13 @@ -1523,7 +1781,7 @@ sqr8x_reduction: mulq %rbx addq %rax,%r14 - movq 112(%rbp),%rax + movq 56(%rbp),%rax adcq $0,%rdx addq %r14,%r13 movq %rdx,%r14 @@ -1541,7 +1799,7 @@ sqr8x_reduction: decl %ecx jnz .L8x_tail - leaq 128(%rbp),%rbp + leaq 64(%rbp),%rbp movq 8+8(%rsp),%rdx cmpq 0+8(%rsp),%rbp jae .L8x_tail_done @@ -1565,6 +1823,15 @@ sqr8x_reduction: .align 32 .L8x_tail_done: addq (%rdx),%r8 + adcq $0,%r9 + adcq $0,%r10 + adcq $0,%r11 + adcq $0,%r12 + adcq $0,%r13 + adcq $0,%r14 + adcq $0,%r15 + + xorq %rax,%rax negq %rsi @@ -1578,7 +1845,7 @@ sqr8x_reduction: adcq 48(%rdi),%r14 adcq 56(%rdi),%r15 adcq $0,%rax - movq -16(%rbp),%rcx + movq -8(%rbp),%rcx xorq %rsi,%rsi .byte 102,72,15,126,213 @@ -1596,44 +1863,62 @@ sqr8x_reduction: cmpq %rdx,%rdi jb .L8x_reduction_loop - - subq %r15,%rcx + .byte 0xf3,0xc3 +.size bn_sqr8x_internal,.-bn_sqr8x_internal +.type __bn_post4x_internal,@function +.align 32 +__bn_post4x_internal: + movq 0(%rbp),%r12 leaq (%rdi,%r9,1),%rbx - adcq %rsi,%rsi movq %r9,%rcx - orq %rsi,%rax .byte 102,72,15,126,207 - xorq $1,%rax + negq %rax .byte 102,72,15,126,206 - leaq (%rbp,%rax,8),%rbp sarq $3+2,%rcx - jmp .Lsqr4x_sub + decq %r12 + xorq %r10,%r10 + movq 8(%rbp),%r13 + movq 16(%rbp),%r14 + movq 24(%rbp),%r15 + jmp .Lsqr4x_sub_entry -.align 32 +.align 16 .Lsqr4x_sub: -.byte 0x66 - movq 0(%rbx),%r12 - movq 8(%rbx),%r13 - sbbq 0(%rbp),%r12 - movq 16(%rbx),%r14 - sbbq 16(%rbp),%r13 - movq 24(%rbx),%r15 - leaq 32(%rbx),%rbx - sbbq 32(%rbp),%r14 + movq 0(%rbp),%r12 + movq 8(%rbp),%r13 + movq 16(%rbp),%r14 + movq 24(%rbp),%r15 +.Lsqr4x_sub_entry: + leaq 32(%rbp),%rbp + notq %r12 + notq %r13 + notq %r14 + notq %r15 + andq %rax,%r12 + andq %rax,%r13 + andq %rax,%r14 + andq %rax,%r15 + + negq %r10 + adcq 0(%rbx),%r12 + adcq 8(%rbx),%r13 + adcq 16(%rbx),%r14 + adcq 24(%rbx),%r15 movq %r12,0(%rdi) - sbbq 48(%rbp),%r15 - leaq 64(%rbp),%rbp + leaq 32(%rbx),%rbx movq %r13,8(%rdi) + sbbq %r10,%r10 movq %r14,16(%rdi) movq %r15,24(%rdi) leaq 32(%rdi),%rdi incq %rcx jnz .Lsqr4x_sub + movq %r9,%r10 negq %r9 .byte 0xf3,0xc3 -.size bn_sqr8x_internal,.-bn_sqr8x_internal +.size __bn_post4x_internal,.-__bn_post4x_internal .globl bn_from_montgomery .type bn_from_montgomery,@function .align 32 @@ -1655,10 +1940,9 @@ bn_from_mont8x: pushq %r13 pushq %r14 pushq %r15 -.byte 0x67 - movl %r9d,%r10d + shll $3,%r9d - shll $3+2,%r10d + leaq (%r9,%r9,2),%r10 negq %r9 movq (%r8),%r8 @@ -1668,19 +1952,20 @@ bn_from_mont8x: - leaq -64(%rsp,%r9,2),%r11 - subq %rsi,%r11 + + leaq -320(%rsp,%r9,2),%r11 + subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb .Lfrom_sp_alt subq %r11,%rsp - leaq -64(%rsp,%r9,2),%rsp + leaq -320(%rsp,%r9,2),%rsp jmp .Lfrom_sp_done .align 32 .Lfrom_sp_alt: - leaq 4096-64(,%r9,2),%r10 - leaq -64(%rsp,%r9,2),%rsp + leaq 4096-320(,%r9,2),%r10 + leaq -320(%rsp,%r9,2),%rsp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 @@ -1731,22 +2016,8 @@ bn_from_mont8x: .byte 0x67 movq %rcx,%rbp .byte 102,73,15,110,218 - movl OPENSSL_ia32cap_P+8(%rip),%r11d - andl $524544,%r11d - cmpl $524544,%r11d - jne .Lfrom_mont_nox - - leaq (%rax,%r9,1),%rdi - call sqrx8x_reduction - - pxor %xmm0,%xmm0 - leaq 48(%rsp),%rax - movq 40(%rsp),%rsi - jmp .Lfrom_mont_zero - -.align 32 -.Lfrom_mont_nox: - call sqr8x_reduction + call __bn_sqr8x_reduction + call __bn_post4x_internal pxor %xmm0,%xmm0 leaq 48(%rsp),%rax @@ -1774,1190 +2045,208 @@ bn_from_mont8x: .Lfrom_epilogue: .byte 0xf3,0xc3 .size bn_from_mont8x,.-bn_from_mont8x -.type bn_mulx4x_mont_gather5,@function -.align 32 -bn_mulx4x_mont_gather5: -.Lmulx4x_enter: -.byte 0x67 - movq %rsp,%rax - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 -.byte 0x67 - movl %r9d,%r10d - shll $3,%r9d - shll $3+2,%r10d - negq %r9 - movq (%r8),%r8 - - - - - - - - - leaq -64(%rsp,%r9,2),%r11 - subq %rsi,%r11 - andq $4095,%r11 - cmpq %r11,%r10 - jb .Lmulx4xsp_alt - subq %r11,%rsp - leaq -64(%rsp,%r9,2),%rsp - jmp .Lmulx4xsp_done - -.align 32 -.Lmulx4xsp_alt: - leaq 4096-64(,%r9,2),%r10 - leaq -64(%rsp,%r9,2),%rsp - subq %r10,%r11 - movq $0,%r10 - cmovcq %r10,%r11 - subq %r11,%rsp -.Lmulx4xsp_done: - andq $-64,%rsp - - - - - - - - - - - - - movq %r8,32(%rsp) - movq %rax,40(%rsp) -.Lmulx4x_body: - call mulx4x_internal +.globl bn_get_bits5 +.type bn_get_bits5,@function +.align 16 +bn_get_bits5: + leaq 0(%rdi),%r10 + leaq 1(%rdi),%r11 + movl %esi,%ecx + shrl $4,%esi + andl $15,%ecx + leal -8(%rcx),%eax + cmpl $11,%ecx + cmovaq %r11,%r10 + cmoval %eax,%ecx + movzwl (%r10,%rsi,2),%eax + shrl %cl,%eax + andl $31,%eax + .byte 0xf3,0xc3 +.size bn_get_bits5,.-bn_get_bits5 - movq 40(%rsp),%rsi - movq $1,%rax - movq -48(%rsi),%r15 - movq -40(%rsi),%r14 - movq -32(%rsi),%r13 - movq -24(%rsi),%r12 - movq -16(%rsi),%rbp - movq -8(%rsi),%rbx - leaq (%rsi),%rsp -.Lmulx4x_epilogue: +.globl bn_scatter5 +.type bn_scatter5,@function +.align 16 +bn_scatter5: + cmpl $0,%esi + jz .Lscatter_epilogue + leaq (%rdx,%rcx,8),%rdx +.Lscatter: + movq (%rdi),%rax + leaq 8(%rdi),%rdi + movq %rax,(%rdx) + leaq 256(%rdx),%rdx + subl $1,%esi + jnz .Lscatter +.Lscatter_epilogue: .byte 0xf3,0xc3 -.size bn_mulx4x_mont_gather5,.-bn_mulx4x_mont_gather5 +.size bn_scatter5,.-bn_scatter5 -.type mulx4x_internal,@function +.globl bn_gather5 +.type bn_gather5,@function .align 32 -mulx4x_internal: -.byte 0x4c,0x89,0x8c,0x24,0x08,0x00,0x00,0x00 -.byte 0x67 - negq %r9 - shlq $5,%r9 - leaq 256(%rdx,%r9,1),%r13 - shrq $5+5,%r9 - movl 8(%rax),%r10d - subq $1,%r9 - movq %r13,16+8(%rsp) - movq %r9,24+8(%rsp) - movq %rdi,56+8(%rsp) - movq %r10,%r11 - shrq $3,%r10 - andq $7,%r11 - notq %r10 - leaq .Lmagic_masks(%rip),%rax - andq $3,%r10 - leaq 96(%rdx,%r11,8),%rdi - movq 0(%rax,%r10,8),%xmm4 - movq 8(%rax,%r10,8),%xmm5 - addq $7,%r11 - movq 16(%rax,%r10,8),%xmm6 - movq 24(%rax,%r10,8),%xmm7 - andq $7,%r11 - - movq -96(%rdi),%xmm0 - leaq 256(%rdi),%rbx - movq -32(%rdi),%xmm1 - pand %xmm4,%xmm0 - movq 32(%rdi),%xmm2 - pand %xmm5,%xmm1 - movq 96(%rdi),%xmm3 - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - movq -96(%rbx),%xmm1 - pand %xmm7,%xmm3 - por %xmm2,%xmm0 - movq -32(%rbx),%xmm2 - por %xmm3,%xmm0 -.byte 0x67,0x67 - pand %xmm4,%xmm1 - movq 32(%rbx),%xmm3 - -.byte 102,72,15,126,194 - movq 96(%rbx),%xmm0 - leaq 512(%rdi),%rdi - pand %xmm5,%xmm2 -.byte 0x67,0x67 - pand %xmm6,%xmm3 - - - - - - - - leaq 64+32+8(%rsp,%r11,8),%rbx - - movq %rdx,%r9 - mulxq 0(%rsi),%r8,%rax - mulxq 8(%rsi),%r11,%r12 - addq %rax,%r11 - mulxq 16(%rsi),%rax,%r13 - adcq %rax,%r12 - adcq $0,%r13 - mulxq 24(%rsi),%rax,%r14 - - movq %r8,%r15 - imulq 32+8(%rsp),%r8 - xorq %rbp,%rbp - movq %r8,%rdx - - por %xmm2,%xmm1 - pand %xmm7,%xmm0 - por %xmm3,%xmm1 - movq %rdi,8+8(%rsp) - por %xmm1,%xmm0 - -.byte 0x48,0x8d,0xb6,0x20,0x00,0x00,0x00 - adcxq %rax,%r13 - adcxq %rbp,%r14 - - mulxq 0(%rcx),%rax,%r10 - adcxq %rax,%r15 - adoxq %r11,%r10 - mulxq 16(%rcx),%rax,%r11 - adcxq %rax,%r10 - adoxq %r12,%r11 - mulxq 32(%rcx),%rax,%r12 - movq 24+8(%rsp),%rdi -.byte 0x66 - movq %r10,-32(%rbx) - adcxq %rax,%r11 - adoxq %r13,%r12 - mulxq 48(%rcx),%rax,%r15 -.byte 0x67,0x67 - movq %r9,%rdx - movq %r11,-24(%rbx) - adcxq %rax,%r12 - adoxq %rbp,%r15 -.byte 0x48,0x8d,0x89,0x40,0x00,0x00,0x00 - movq %r12,-16(%rbx) - +bn_gather5: +.LSEH_begin_bn_gather5: + +.byte 0x4c,0x8d,0x14,0x24 +.byte 0x48,0x81,0xec,0x08,0x01,0x00,0x00 + leaq .Linc(%rip),%rax + andq $-16,%rsp + + movd %ecx,%xmm5 + movdqa 0(%rax),%xmm0 + movdqa 16(%rax),%xmm1 + leaq 128(%rdx),%r11 + leaq 128(%rsp),%rax + + pshufd $0,%xmm5,%xmm5 + movdqa %xmm1,%xmm4 + movdqa %xmm1,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm4,%xmm3 + + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,-128(%rax) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,-112(%rax) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,-96(%rax) + movdqa %xmm4,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,-80(%rax) + movdqa %xmm4,%xmm3 + + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,-64(%rax) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,-48(%rax) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,-32(%rax) + movdqa %xmm4,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,-16(%rax) + movdqa %xmm4,%xmm3 + + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,0(%rax) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,16(%rax) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,32(%rax) + movdqa %xmm4,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,48(%rax) + movdqa %xmm4,%xmm3 + + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,64(%rax) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,80(%rax) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,96(%rax) + movdqa %xmm4,%xmm2 + movdqa %xmm3,112(%rax) + jmp .Lgather .align 32 -.Lmulx4x_1st: - adcxq %rbp,%r15 - mulxq 0(%rsi),%r10,%rax - adcxq %r14,%r10 - mulxq 8(%rsi),%r11,%r14 - adcxq %rax,%r11 - mulxq 16(%rsi),%r12,%rax - adcxq %r14,%r12 - mulxq 24(%rsi),%r13,%r14 -.byte 0x67,0x67 - movq %r8,%rdx - adcxq %rax,%r13 - adcxq %rbp,%r14 - leaq 32(%rsi),%rsi - leaq 32(%rbx),%rbx - - adoxq %r15,%r10 - mulxq 0(%rcx),%rax,%r15 - adcxq %rax,%r10 - adoxq %r15,%r11 - mulxq 16(%rcx),%rax,%r15 - adcxq %rax,%r11 - adoxq %r15,%r12 - mulxq 32(%rcx),%rax,%r15 - movq %r10,-40(%rbx) - adcxq %rax,%r12 - movq %r11,-32(%rbx) - adoxq %r15,%r13 - mulxq 48(%rcx),%rax,%r15 - movq %r9,%rdx - movq %r12,-24(%rbx) - adcxq %rax,%r13 - adoxq %rbp,%r15 - leaq 64(%rcx),%rcx - movq %r13,-16(%rbx) - - decq %rdi - jnz .Lmulx4x_1st - - movq 8(%rsp),%rax -.byte 102,72,15,126,194 - adcq %rbp,%r15 - leaq (%rsi,%rax,1),%rsi - addq %r15,%r14 - movq 8+8(%rsp),%rdi - adcq %rbp,%rbp - movq %r14,-8(%rbx) - jmp .Lmulx4x_outer - -.align 32 -.Lmulx4x_outer: - movq %rbp,(%rbx) - leaq 32(%rbx,%rax,1),%rbx - mulxq 0(%rsi),%r8,%r11 - xorq %rbp,%rbp - movq %rdx,%r9 - mulxq 8(%rsi),%r14,%r12 - adoxq -32(%rbx),%r8 - adcxq %r14,%r11 - mulxq 16(%rsi),%r15,%r13 - adoxq -24(%rbx),%r11 - adcxq %r15,%r12 - mulxq 24(%rsi),%rdx,%r14 - adoxq -16(%rbx),%r12 - adcxq %rdx,%r13 - leaq (%rcx,%rax,2),%rcx - leaq 32(%rsi),%rsi - adoxq -8(%rbx),%r13 - adcxq %rbp,%r14 - adoxq %rbp,%r14 - -.byte 0x67 - movq %r8,%r15 - imulq 32+8(%rsp),%r8 - - movq -96(%rdi),%xmm0 -.byte 0x67,0x67 - movq %r8,%rdx - movq -32(%rdi),%xmm1 -.byte 0x67 - pand %xmm4,%xmm0 - movq 32(%rdi),%xmm2 -.byte 0x67 - pand %xmm5,%xmm1 - movq 96(%rdi),%xmm3 - addq $256,%rdi -.byte 0x67 - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 - xorq %rbp,%rbp - movq %rdi,8+8(%rsp) - - mulxq 0(%rcx),%rax,%r10 - adcxq %rax,%r15 - adoxq %r11,%r10 - mulxq 16(%rcx),%rax,%r11 - adcxq %rax,%r10 - adoxq %r12,%r11 - mulxq 32(%rcx),%rax,%r12 - adcxq %rax,%r11 - adoxq %r13,%r12 - mulxq 48(%rcx),%rax,%r15 - movq %r9,%rdx - por %xmm2,%xmm0 - movq 24+8(%rsp),%rdi - movq %r10,-32(%rbx) - por %xmm3,%xmm0 - adcxq %rax,%r12 - movq %r11,-24(%rbx) - adoxq %rbp,%r15 - movq %r12,-16(%rbx) - leaq 64(%rcx),%rcx - jmp .Lmulx4x_inner - -.align 32 -.Lmulx4x_inner: - mulxq 0(%rsi),%r10,%rax - adcxq %rbp,%r15 - adoxq %r14,%r10 - mulxq 8(%rsi),%r11,%r14 - adcxq 0(%rbx),%r10 - adoxq %rax,%r11 - mulxq 16(%rsi),%r12,%rax - adcxq 8(%rbx),%r11 - adoxq %r14,%r12 - mulxq 24(%rsi),%r13,%r14 - movq %r8,%rdx - adcxq 16(%rbx),%r12 - adoxq %rax,%r13 - adcxq 24(%rbx),%r13 - adoxq %rbp,%r14 - leaq 32(%rsi),%rsi - leaq 32(%rbx),%rbx - adcxq %rbp,%r14 - - adoxq %r15,%r10 - mulxq 0(%rcx),%rax,%r15 - adcxq %rax,%r10 - adoxq %r15,%r11 - mulxq 16(%rcx),%rax,%r15 - adcxq %rax,%r11 - adoxq %r15,%r12 - mulxq 32(%rcx),%rax,%r15 - movq %r10,-40(%rbx) - adcxq %rax,%r12 - adoxq %r15,%r13 - movq %r11,-32(%rbx) - mulxq 48(%rcx),%rax,%r15 - movq %r9,%rdx - leaq 64(%rcx),%rcx - movq %r12,-24(%rbx) - adcxq %rax,%r13 - adoxq %rbp,%r15 - movq %r13,-16(%rbx) - - decq %rdi - jnz .Lmulx4x_inner - - movq 0+8(%rsp),%rax -.byte 102,72,15,126,194 - adcq %rbp,%r15 - subq 0(%rbx),%rdi - movq 8+8(%rsp),%rdi - movq 16+8(%rsp),%r10 - adcq %r15,%r14 - leaq (%rsi,%rax,1),%rsi - adcq %rbp,%rbp - movq %r14,-8(%rbx) - - cmpq %r10,%rdi - jb .Lmulx4x_outer - - movq -16(%rcx),%r10 - xorq %r15,%r15 - subq %r14,%r10 - adcq %r15,%r15 - orq %r15,%rbp - xorq $1,%rbp - leaq (%rbx,%rax,1),%rdi - leaq (%rcx,%rax,2),%rcx -.byte 0x67,0x67 - sarq $3+2,%rax - leaq (%rcx,%rbp,8),%rbp - movq 56+8(%rsp),%rdx - movq %rax,%rcx - jmp .Lsqrx4x_sub -.size mulx4x_internal,.-mulx4x_internal -.type bn_powerx5,@function -.align 32 -bn_powerx5: -.Lpowerx5_enter: -.byte 0x67 - movq %rsp,%rax - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 -.byte 0x67 - movl %r9d,%r10d - shll $3,%r9d - shll $3+2,%r10d - negq %r9 - movq (%r8),%r8 - - - - - - - - leaq -64(%rsp,%r9,2),%r11 - subq %rsi,%r11 - andq $4095,%r11 - cmpq %r11,%r10 - jb .Lpwrx_sp_alt - subq %r11,%rsp - leaq -64(%rsp,%r9,2),%rsp - jmp .Lpwrx_sp_done - -.align 32 -.Lpwrx_sp_alt: - leaq 4096-64(,%r9,2),%r10 - leaq -64(%rsp,%r9,2),%rsp - subq %r10,%r11 - movq $0,%r10 - cmovcq %r10,%r11 - subq %r11,%rsp -.Lpwrx_sp_done: - andq $-64,%rsp - movq %r9,%r10 - negq %r9 - - - - - - - - - - - - - pxor %xmm0,%xmm0 -.byte 102,72,15,110,207 -.byte 102,72,15,110,209 -.byte 102,73,15,110,218 -.byte 102,72,15,110,226 - movq %r8,32(%rsp) - movq %rax,40(%rsp) -.Lpowerx5_body: - - call __bn_sqrx8x_internal - call __bn_sqrx8x_internal - call __bn_sqrx8x_internal - call __bn_sqrx8x_internal - call __bn_sqrx8x_internal - - movq %r10,%r9 - movq %rsi,%rdi -.byte 102,72,15,126,209 -.byte 102,72,15,126,226 - movq 40(%rsp),%rax - - call mulx4x_internal - - movq 40(%rsp),%rsi - movq $1,%rax - movq -48(%rsi),%r15 - movq -40(%rsi),%r14 - movq -32(%rsi),%r13 - movq -24(%rsi),%r12 - movq -16(%rsi),%rbp - movq -8(%rsi),%rbx - leaq (%rsi),%rsp -.Lpowerx5_epilogue: - .byte 0xf3,0xc3 -.size bn_powerx5,.-bn_powerx5 - -.globl bn_sqrx8x_internal -.hidden bn_sqrx8x_internal -.type bn_sqrx8x_internal,@function -.align 32 -bn_sqrx8x_internal: -__bn_sqrx8x_internal: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - leaq 48+8(%rsp),%rdi - leaq (%rsi,%r9,1),%rbp - movq %r9,0+8(%rsp) - movq %rbp,8+8(%rsp) - jmp .Lsqr8x_zero_start - -.align 32 -.byte 0x66,0x66,0x66,0x2e,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00 -.Lsqrx8x_zero: -.byte 0x3e - movdqa %xmm0,0(%rdi) - movdqa %xmm0,16(%rdi) - movdqa %xmm0,32(%rdi) - movdqa %xmm0,48(%rdi) -.Lsqr8x_zero_start: - movdqa %xmm0,64(%rdi) - movdqa %xmm0,80(%rdi) - movdqa %xmm0,96(%rdi) - movdqa %xmm0,112(%rdi) - leaq 128(%rdi),%rdi - subq $64,%r9 - jnz .Lsqrx8x_zero - - movq 0(%rsi),%rdx - - xorq %r10,%r10 - xorq %r11,%r11 - xorq %r12,%r12 - xorq %r13,%r13 - xorq %r14,%r14 - xorq %r15,%r15 - leaq 48+8(%rsp),%rdi - xorq %rbp,%rbp - jmp .Lsqrx8x_outer_loop - -.align 32 -.Lsqrx8x_outer_loop: - mulxq 8(%rsi),%r8,%rax - adcxq %r9,%r8 - adoxq %rax,%r10 - mulxq 16(%rsi),%r9,%rax - adcxq %r10,%r9 - adoxq %rax,%r11 -.byte 0xc4,0xe2,0xab,0xf6,0x86,0x18,0x00,0x00,0x00 - adcxq %r11,%r10 - adoxq %rax,%r12 -.byte 0xc4,0xe2,0xa3,0xf6,0x86,0x20,0x00,0x00,0x00 - adcxq %r12,%r11 - adoxq %rax,%r13 - mulxq 40(%rsi),%r12,%rax - adcxq %r13,%r12 - adoxq %rax,%r14 - mulxq 48(%rsi),%r13,%rax - adcxq %r14,%r13 - adoxq %r15,%rax - mulxq 56(%rsi),%r14,%r15 - movq 8(%rsi),%rdx - adcxq %rax,%r14 - adoxq %rbp,%r15 - adcq 64(%rdi),%r15 - movq %r8,8(%rdi) - movq %r9,16(%rdi) - sbbq %rcx,%rcx - xorq %rbp,%rbp - - - mulxq 16(%rsi),%r8,%rbx - mulxq 24(%rsi),%r9,%rax - adcxq %r10,%r8 - adoxq %rbx,%r9 - mulxq 32(%rsi),%r10,%rbx - adcxq %r11,%r9 - adoxq %rax,%r10 -.byte 0xc4,0xe2,0xa3,0xf6,0x86,0x28,0x00,0x00,0x00 - adcxq %r12,%r10 - adoxq %rbx,%r11 -.byte 0xc4,0xe2,0x9b,0xf6,0x9e,0x30,0x00,0x00,0x00 - adcxq %r13,%r11 - adoxq %r14,%r12 -.byte 0xc4,0x62,0x93,0xf6,0xb6,0x38,0x00,0x00,0x00 - movq 16(%rsi),%rdx - adcxq %rax,%r12 - adoxq %rbx,%r13 - adcxq %r15,%r13 - adoxq %rbp,%r14 - adcxq %rbp,%r14 - - movq %r8,24(%rdi) - movq %r9,32(%rdi) - - mulxq 24(%rsi),%r8,%rbx - mulxq 32(%rsi),%r9,%rax - adcxq %r10,%r8 - adoxq %rbx,%r9 - mulxq 40(%rsi),%r10,%rbx - adcxq %r11,%r9 - adoxq %rax,%r10 -.byte 0xc4,0xe2,0xa3,0xf6,0x86,0x30,0x00,0x00,0x00 - adcxq %r12,%r10 - adoxq %r13,%r11 -.byte 0xc4,0x62,0x9b,0xf6,0xae,0x38,0x00,0x00,0x00 -.byte 0x3e - movq 24(%rsi),%rdx - adcxq %rbx,%r11 - adoxq %rax,%r12 - adcxq %r14,%r12 - movq %r8,40(%rdi) - movq %r9,48(%rdi) - mulxq 32(%rsi),%r8,%rax - adoxq %rbp,%r13 - adcxq %rbp,%r13 - - mulxq 40(%rsi),%r9,%rbx - adcxq %r10,%r8 - adoxq %rax,%r9 - mulxq 48(%rsi),%r10,%rax - adcxq %r11,%r9 - adoxq %r12,%r10 - mulxq 56(%rsi),%r11,%r12 - movq 32(%rsi),%rdx - movq 40(%rsi),%r14 - adcxq %rbx,%r10 - adoxq %rax,%r11 - movq 48(%rsi),%r15 - adcxq %r13,%r11 - adoxq %rbp,%r12 - adcxq %rbp,%r12 - - movq %r8,56(%rdi) - movq %r9,64(%rdi) - - mulxq %r14,%r9,%rax - movq 56(%rsi),%r8 - adcxq %r10,%r9 - mulxq %r15,%r10,%rbx - adoxq %rax,%r10 - adcxq %r11,%r10 - mulxq %r8,%r11,%rax - movq %r14,%rdx - adoxq %rbx,%r11 - adcxq %r12,%r11 - - adcxq %rbp,%rax - - mulxq %r15,%r14,%rbx - mulxq %r8,%r12,%r13 - movq %r15,%rdx - leaq 64(%rsi),%rsi - adcxq %r14,%r11 - adoxq %rbx,%r12 - adcxq %rax,%r12 - adoxq %rbp,%r13 - -.byte 0x67,0x67 - mulxq %r8,%r8,%r14 - adcxq %r8,%r13 - adcxq %rbp,%r14 - - cmpq 8+8(%rsp),%rsi - je .Lsqrx8x_outer_break - - negq %rcx - movq $-8,%rcx - movq %rbp,%r15 - movq 64(%rdi),%r8 - adcxq 72(%rdi),%r9 - adcxq 80(%rdi),%r10 - adcxq 88(%rdi),%r11 - adcq 96(%rdi),%r12 - adcq 104(%rdi),%r13 - adcq 112(%rdi),%r14 - adcq 120(%rdi),%r15 - leaq (%rsi),%rbp - leaq 128(%rdi),%rdi - sbbq %rax,%rax - - movq -64(%rsi),%rdx - movq %rax,16+8(%rsp) - movq %rdi,24+8(%rsp) - - - xorl %eax,%eax - jmp .Lsqrx8x_loop - -.align 32 -.Lsqrx8x_loop: - movq %r8,%rbx - mulxq 0(%rbp),%rax,%r8 - adcxq %rax,%rbx - adoxq %r9,%r8 - - mulxq 8(%rbp),%rax,%r9 - adcxq %rax,%r8 - adoxq %r10,%r9 - - mulxq 16(%rbp),%rax,%r10 - adcxq %rax,%r9 - adoxq %r11,%r10 - - mulxq 24(%rbp),%rax,%r11 - adcxq %rax,%r10 - adoxq %r12,%r11 - -.byte 0xc4,0x62,0xfb,0xf6,0xa5,0x20,0x00,0x00,0x00 - adcxq %rax,%r11 - adoxq %r13,%r12 - - mulxq 40(%rbp),%rax,%r13 - adcxq %rax,%r12 - adoxq %r14,%r13 - - mulxq 48(%rbp),%rax,%r14 - movq %rbx,(%rdi,%rcx,8) - movl $0,%ebx - adcxq %rax,%r13 - adoxq %r15,%r14 - -.byte 0xc4,0x62,0xfb,0xf6,0xbd,0x38,0x00,0x00,0x00 - movq 8(%rsi,%rcx,8),%rdx - adcxq %rax,%r14 - adoxq %rbx,%r15 - adcxq %rbx,%r15 - -.byte 0x67 - incq %rcx - jnz .Lsqrx8x_loop - - leaq 64(%rbp),%rbp - movq $-8,%rcx - cmpq 8+8(%rsp),%rbp - je .Lsqrx8x_break - - subq 16+8(%rsp),%rbx -.byte 0x66 - movq -64(%rsi),%rdx - adcxq 0(%rdi),%r8 - adcxq 8(%rdi),%r9 - adcq 16(%rdi),%r10 - adcq 24(%rdi),%r11 - adcq 32(%rdi),%r12 - adcq 40(%rdi),%r13 - adcq 48(%rdi),%r14 - adcq 56(%rdi),%r15 - leaq 64(%rdi),%rdi -.byte 0x67 - sbbq %rax,%rax - xorl %ebx,%ebx - movq %rax,16+8(%rsp) - jmp .Lsqrx8x_loop - -.align 32 -.Lsqrx8x_break: - subq 16+8(%rsp),%r8 - movq 24+8(%rsp),%rcx - movq 0(%rsi),%rdx - xorl %ebp,%ebp - movq %r8,0(%rdi) - cmpq %rcx,%rdi - je .Lsqrx8x_outer_loop - - movq %r9,8(%rdi) - movq 8(%rcx),%r9 - movq %r10,16(%rdi) - movq 16(%rcx),%r10 - movq %r11,24(%rdi) - movq 24(%rcx),%r11 - movq %r12,32(%rdi) - movq 32(%rcx),%r12 - movq %r13,40(%rdi) - movq 40(%rcx),%r13 - movq %r14,48(%rdi) - movq 48(%rcx),%r14 - movq %r15,56(%rdi) - movq 56(%rcx),%r15 - movq %rcx,%rdi - jmp .Lsqrx8x_outer_loop - -.align 32 -.Lsqrx8x_outer_break: - movq %r9,72(%rdi) -.byte 102,72,15,126,217 - movq %r10,80(%rdi) - movq %r11,88(%rdi) - movq %r12,96(%rdi) - movq %r13,104(%rdi) - movq %r14,112(%rdi) - leaq 48+8(%rsp),%rdi - movq (%rsi,%rcx,1),%rdx - - movq 8(%rdi),%r11 - xorq %r10,%r10 - movq 0+8(%rsp),%r9 - adoxq %r11,%r11 - movq 16(%rdi),%r12 - movq 24(%rdi),%r13 - - -.align 32 -.Lsqrx4x_shift_n_add: - mulxq %rdx,%rax,%rbx - adoxq %r12,%r12 - adcxq %r10,%rax -.byte 0x48,0x8b,0x94,0x0e,0x08,0x00,0x00,0x00 -.byte 0x4c,0x8b,0x97,0x20,0x00,0x00,0x00 - adoxq %r13,%r13 - adcxq %r11,%rbx - movq 40(%rdi),%r11 - movq %rax,0(%rdi) - movq %rbx,8(%rdi) - - mulxq %rdx,%rax,%rbx - adoxq %r10,%r10 - adcxq %r12,%rax - movq 16(%rsi,%rcx,1),%rdx - movq 48(%rdi),%r12 - adoxq %r11,%r11 - adcxq %r13,%rbx - movq 56(%rdi),%r13 - movq %rax,16(%rdi) - movq %rbx,24(%rdi) - - mulxq %rdx,%rax,%rbx - adoxq %r12,%r12 - adcxq %r10,%rax - movq 24(%rsi,%rcx,1),%rdx - leaq 32(%rcx),%rcx - movq 64(%rdi),%r10 - adoxq %r13,%r13 - adcxq %r11,%rbx - movq 72(%rdi),%r11 - movq %rax,32(%rdi) - movq %rbx,40(%rdi) - - mulxq %rdx,%rax,%rbx - adoxq %r10,%r10 - adcxq %r12,%rax - jrcxz .Lsqrx4x_shift_n_add_break -.byte 0x48,0x8b,0x94,0x0e,0x00,0x00,0x00,0x00 - adoxq %r11,%r11 - adcxq %r13,%rbx - movq 80(%rdi),%r12 - movq 88(%rdi),%r13 - movq %rax,48(%rdi) - movq %rbx,56(%rdi) - leaq 64(%rdi),%rdi - nop - jmp .Lsqrx4x_shift_n_add - -.align 32 -.Lsqrx4x_shift_n_add_break: - adcxq %r13,%rbx - movq %rax,48(%rdi) - movq %rbx,56(%rdi) - leaq 64(%rdi),%rdi -.byte 102,72,15,126,213 -sqrx8x_reduction: - xorl %eax,%eax - movq 32+8(%rsp),%rbx - movq 48+8(%rsp),%rdx - leaq -128(%rbp,%r9,2),%rcx - - movq %rcx,0+8(%rsp) - movq %rdi,8+8(%rsp) - - leaq 48+8(%rsp),%rdi - jmp .Lsqrx8x_reduction_loop - -.align 32 -.Lsqrx8x_reduction_loop: - movq 8(%rdi),%r9 - movq 16(%rdi),%r10 - movq 24(%rdi),%r11 - movq 32(%rdi),%r12 - movq %rdx,%r8 - imulq %rbx,%rdx - movq 40(%rdi),%r13 - movq 48(%rdi),%r14 - movq 56(%rdi),%r15 - movq %rax,24+8(%rsp) - - leaq 64(%rdi),%rdi - xorq %rsi,%rsi - movq $-8,%rcx - jmp .Lsqrx8x_reduce - -.align 32 -.Lsqrx8x_reduce: - movq %r8,%rbx - mulxq 0(%rbp),%rax,%r8 - adcxq %rbx,%rax - adoxq %r9,%r8 - - mulxq 16(%rbp),%rbx,%r9 - adcxq %rbx,%r8 - adoxq %r10,%r9 - - mulxq 32(%rbp),%rbx,%r10 - adcxq %rbx,%r9 - adoxq %r11,%r10 - - mulxq 48(%rbp),%rbx,%r11 - adcxq %rbx,%r10 - adoxq %r12,%r11 - -.byte 0xc4,0x62,0xe3,0xf6,0xa5,0x40,0x00,0x00,0x00 - movq %rdx,%rax - movq %r8,%rdx - adcxq %rbx,%r11 - adoxq %r13,%r12 - - mulxq 32+8(%rsp),%rbx,%rdx - movq %rax,%rdx - movq %rax,64+48+8(%rsp,%rcx,8) - - mulxq 80(%rbp),%rax,%r13 - adcxq %rax,%r12 - adoxq %r14,%r13 - - mulxq 96(%rbp),%rax,%r14 - adcxq %rax,%r13 - adoxq %r15,%r14 - - mulxq 112(%rbp),%rax,%r15 - movq %rbx,%rdx - adcxq %rax,%r14 - adoxq %rsi,%r15 - adcxq %rsi,%r15 - -.byte 0x67,0x67,0x67 - incq %rcx - jnz .Lsqrx8x_reduce - - movq %rsi,%rax - cmpq 0+8(%rsp),%rbp - jae .Lsqrx8x_no_tail - - movq 48+8(%rsp),%rdx - addq 0(%rdi),%r8 - leaq 128(%rbp),%rbp - movq $-8,%rcx - adcxq 8(%rdi),%r9 - adcxq 16(%rdi),%r10 - adcq 24(%rdi),%r11 - adcq 32(%rdi),%r12 - adcq 40(%rdi),%r13 - adcq 48(%rdi),%r14 - adcq 56(%rdi),%r15 - leaq 64(%rdi),%rdi - sbbq %rax,%rax - - xorq %rsi,%rsi - movq %rax,16+8(%rsp) - jmp .Lsqrx8x_tail - -.align 32 -.Lsqrx8x_tail: - movq %r8,%rbx - mulxq 0(%rbp),%rax,%r8 - adcxq %rax,%rbx - adoxq %r9,%r8 - - mulxq 16(%rbp),%rax,%r9 - adcxq %rax,%r8 - adoxq %r10,%r9 - - mulxq 32(%rbp),%rax,%r10 - adcxq %rax,%r9 - adoxq %r11,%r10 - - mulxq 48(%rbp),%rax,%r11 - adcxq %rax,%r10 - adoxq %r12,%r11 - -.byte 0xc4,0x62,0xfb,0xf6,0xa5,0x40,0x00,0x00,0x00 - adcxq %rax,%r11 - adoxq %r13,%r12 - - mulxq 80(%rbp),%rax,%r13 - adcxq %rax,%r12 - adoxq %r14,%r13 - - mulxq 96(%rbp),%rax,%r14 - adcxq %rax,%r13 - adoxq %r15,%r14 - - mulxq 112(%rbp),%rax,%r15 - movq 72+48+8(%rsp,%rcx,8),%rdx - adcxq %rax,%r14 - adoxq %rsi,%r15 - movq %rbx,(%rdi,%rcx,8) - movq %r8,%rbx - adcxq %rsi,%r15 - - incq %rcx - jnz .Lsqrx8x_tail - - cmpq 0+8(%rsp),%rbp - jae .Lsqrx8x_tail_done - - subq 16+8(%rsp),%rsi - movq 48+8(%rsp),%rdx - leaq 128(%rbp),%rbp - adcq 0(%rdi),%r8 - adcq 8(%rdi),%r9 - adcq 16(%rdi),%r10 - adcq 24(%rdi),%r11 - adcq 32(%rdi),%r12 - adcq 40(%rdi),%r13 - adcq 48(%rdi),%r14 - adcq 56(%rdi),%r15 - leaq 64(%rdi),%rdi - sbbq %rax,%rax - subq $8,%rcx - - xorq %rsi,%rsi - movq %rax,16+8(%rsp) - jmp .Lsqrx8x_tail - -.align 32 -.Lsqrx8x_tail_done: - addq 24+8(%rsp),%r8 - movq %rsi,%rax - - subq 16+8(%rsp),%rsi -.Lsqrx8x_no_tail: - adcq 0(%rdi),%r8 -.byte 102,72,15,126,217 - adcq 8(%rdi),%r9 - movq 112(%rbp),%rsi -.byte 102,72,15,126,213 - adcq 16(%rdi),%r10 - adcq 24(%rdi),%r11 - adcq 32(%rdi),%r12 - adcq 40(%rdi),%r13 - adcq 48(%rdi),%r14 - adcq 56(%rdi),%r15 - adcq %rax,%rax - - movq 32+8(%rsp),%rbx - movq 64(%rdi,%rcx,1),%rdx - - movq %r8,0(%rdi) - leaq 64(%rdi),%r8 - movq %r9,8(%rdi) - movq %r10,16(%rdi) - movq %r11,24(%rdi) - movq %r12,32(%rdi) - movq %r13,40(%rdi) - movq %r14,48(%rdi) - movq %r15,56(%rdi) - - leaq 64(%rdi,%rcx,1),%rdi - cmpq 8+8(%rsp),%r8 - jb .Lsqrx8x_reduction_loop - xorq %rbx,%rbx - subq %r15,%rsi - adcq %rbx,%rbx - movq %rcx,%r10 -.byte 0x67 - orq %rbx,%rax -.byte 0x67 - movq %rcx,%r9 - xorq $1,%rax - sarq $3+2,%rcx - - leaq (%rbp,%rax,8),%rbp -.byte 102,72,15,126,202 -.byte 102,72,15,126,206 - jmp .Lsqrx4x_sub - -.align 32 -.Lsqrx4x_sub: -.byte 0x66 - movq 0(%rdi),%r12 - movq 8(%rdi),%r13 - sbbq 0(%rbp),%r12 - movq 16(%rdi),%r14 - sbbq 16(%rbp),%r13 - movq 24(%rdi),%r15 - leaq 32(%rdi),%rdi - sbbq 32(%rbp),%r14 - movq %r12,0(%rdx) - sbbq 48(%rbp),%r15 - leaq 64(%rbp),%rbp - movq %r13,8(%rdx) - movq %r14,16(%rdx) - movq %r15,24(%rdx) - leaq 32(%rdx),%rdx - - incq %rcx - jnz .Lsqrx4x_sub - negq %r9 - - .byte 0xf3,0xc3 -.size bn_sqrx8x_internal,.-bn_sqrx8x_internal -.globl bn_get_bits5 -.type bn_get_bits5,@function -.align 16 -bn_get_bits5: - leaq 0(%rdi),%r10 - leaq 1(%rdi),%r11 - movl %esi,%ecx - shrl $4,%esi - andl $15,%ecx - leal -8(%rcx),%eax - cmpl $11,%ecx - cmovaq %r11,%r10 - cmoval %eax,%ecx - movzwl (%r10,%rsi,2),%eax - shrl %cl,%eax - andl $31,%eax - .byte 0xf3,0xc3 -.size bn_get_bits5,.-bn_get_bits5 - -.globl bn_scatter5 -.type bn_scatter5,@function -.align 16 -bn_scatter5: - cmpl $0,%esi - jz .Lscatter_epilogue - leaq (%rdx,%rcx,8),%rdx -.Lscatter: - movq (%rdi),%rax - leaq 8(%rdi),%rdi - movq %rax,(%rdx) - leaq 256(%rdx),%rdx - subl $1,%esi - jnz .Lscatter -.Lscatter_epilogue: - .byte 0xf3,0xc3 -.size bn_scatter5,.-bn_scatter5 - -.globl bn_gather5 -.type bn_gather5,@function -.align 16 -bn_gather5: - movl %ecx,%r11d - shrl $3,%ecx - andq $7,%r11 - notl %ecx - leaq .Lmagic_masks(%rip),%rax - andl $3,%ecx - leaq 128(%rdx,%r11,8),%rdx - movq 0(%rax,%rcx,8),%xmm4 - movq 8(%rax,%rcx,8),%xmm5 - movq 16(%rax,%rcx,8),%xmm6 - movq 24(%rax,%rcx,8),%xmm7 - jmp .Lgather -.align 16 .Lgather: - movq -128(%rdx),%xmm0 - movq -64(%rdx),%xmm1 - pand %xmm4,%xmm0 - movq 0(%rdx),%xmm2 - pand %xmm5,%xmm1 - movq 64(%rdx),%xmm3 - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 -.byte 0x67,0x67 - por %xmm2,%xmm0 - leaq 256(%rdx),%rdx - por %xmm3,%xmm0 - + pxor %xmm4,%xmm4 + pxor %xmm5,%xmm5 + movdqa -128(%r11),%xmm0 + movdqa -112(%r11),%xmm1 + movdqa -96(%r11),%xmm2 + pand -128(%rax),%xmm0 + movdqa -80(%r11),%xmm3 + pand -112(%rax),%xmm1 + por %xmm0,%xmm4 + pand -96(%rax),%xmm2 + por %xmm1,%xmm5 + pand -80(%rax),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa -64(%r11),%xmm0 + movdqa -48(%r11),%xmm1 + movdqa -32(%r11),%xmm2 + pand -64(%rax),%xmm0 + movdqa -16(%r11),%xmm3 + pand -48(%rax),%xmm1 + por %xmm0,%xmm4 + pand -32(%rax),%xmm2 + por %xmm1,%xmm5 + pand -16(%rax),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa 0(%r11),%xmm0 + movdqa 16(%r11),%xmm1 + movdqa 32(%r11),%xmm2 + pand 0(%rax),%xmm0 + movdqa 48(%r11),%xmm3 + pand 16(%rax),%xmm1 + por %xmm0,%xmm4 + pand 32(%rax),%xmm2 + por %xmm1,%xmm5 + pand 48(%rax),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa 64(%r11),%xmm0 + movdqa 80(%r11),%xmm1 + movdqa 96(%r11),%xmm2 + pand 64(%rax),%xmm0 + movdqa 112(%r11),%xmm3 + pand 80(%rax),%xmm1 + por %xmm0,%xmm4 + pand 96(%rax),%xmm2 + por %xmm1,%xmm5 + pand 112(%rax),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + por %xmm5,%xmm4 + leaq 256(%r11),%r11 + pshufd $0x4e,%xmm4,%xmm0 + por %xmm4,%xmm0 movq %xmm0,(%rdi) leaq 8(%rdi),%rdi subl $1,%esi jnz .Lgather + + leaq (%r10),%rsp .byte 0xf3,0xc3 .LSEH_end_bn_gather5: .size bn_gather5,.-bn_gather5 .align 64 -.Lmagic_masks: -.long 0,0, 0,0, 0,0, -1,-1 -.long 0,0, 0,0, 0,0, 0,0 +.Linc: +.long 0,0, 1,1 +.long 2,2, 2,2 .byte 77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105,112,108,105,99,97,116,105,111,110,32,119,105,116,104,32,115,99,97,116,116,101,114,47,103,97,116,104,101,114,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 diff --git a/deps/openssl/asm/x64-elf-gas/ec/ecp_nistz256-x86_64.s b/deps/openssl/asm/x64-elf-gas/ec/ecp_nistz256-x86_64.s index 3a999664c74dc6..7876e382994517 100644 --- a/deps/openssl/asm/x64-elf-gas/ec/ecp_nistz256-x86_64.s +++ b/deps/openssl/asm/x64-elf-gas/ec/ecp_nistz256-x86_64.s @@ -332,8 +332,6 @@ ecp_nistz256_neg: .type ecp_nistz256_to_mont,@function .align 32 ecp_nistz256_to_mont: - movl $524544,%ecx - andl OPENSSL_ia32cap_P+8(%rip),%ecx leaq .LRR(%rip),%rdx jmp .Lmul_mont .size ecp_nistz256_to_mont,.-ecp_nistz256_to_mont @@ -348,8 +346,6 @@ ecp_nistz256_to_mont: .type ecp_nistz256_mul_mont,@function .align 32 ecp_nistz256_mul_mont: - movl $524544,%ecx - andl OPENSSL_ia32cap_P+8(%rip),%ecx .Lmul_mont: pushq %rbp pushq %rbx @@ -357,8 +353,6 @@ ecp_nistz256_mul_mont: pushq %r13 pushq %r14 pushq %r15 - cmpl $524544,%ecx - je .Lmul_montx movq %rdx,%rbx movq 0(%rdx),%rax movq 0(%rsi),%r9 @@ -367,19 +361,6 @@ ecp_nistz256_mul_mont: movq 24(%rsi),%r12 call __ecp_nistz256_mul_montq - jmp .Lmul_mont_done - -.align 32 -.Lmul_montx: - movq %rdx,%rbx - movq 0(%rdx),%rdx - movq 0(%rsi),%r9 - movq 8(%rsi),%r10 - movq 16(%rsi),%r11 - movq 24(%rsi),%r12 - leaq -128(%rsi),%rsi - - call __ecp_nistz256_mul_montx .Lmul_mont_done: popq %r15 popq %r14 @@ -617,33 +598,18 @@ __ecp_nistz256_mul_montq: .type ecp_nistz256_sqr_mont,@function .align 32 ecp_nistz256_sqr_mont: - movl $524544,%ecx - andl OPENSSL_ia32cap_P+8(%rip),%ecx pushq %rbp pushq %rbx pushq %r12 pushq %r13 pushq %r14 pushq %r15 - cmpl $524544,%ecx - je .Lsqr_montx movq 0(%rsi),%rax movq 8(%rsi),%r14 movq 16(%rsi),%r15 movq 24(%rsi),%r8 call __ecp_nistz256_sqr_montq - jmp .Lsqr_mont_done - -.align 32 -.Lsqr_montx: - movq 0(%rsi),%rdx - movq 8(%rsi),%r14 - movq 16(%rsi),%r15 - movq 24(%rsi),%r8 - leaq -128(%rsi),%rsi - - call __ecp_nistz256_sqr_montx .Lsqr_mont_done: popq %r15 popq %r14 @@ -815,304 +781,6 @@ __ecp_nistz256_sqr_montq: .byte 0xf3,0xc3 .size __ecp_nistz256_sqr_montq,.-__ecp_nistz256_sqr_montq -.type __ecp_nistz256_mul_montx,@function -.align 32 -__ecp_nistz256_mul_montx: - - - mulxq %r9,%r8,%r9 - mulxq %r10,%rcx,%r10 - movq $32,%r14 - xorq %r13,%r13 - mulxq %r11,%rbp,%r11 - movq .Lpoly+24(%rip),%r15 - adcq %rcx,%r9 - mulxq %r12,%rcx,%r12 - movq %r8,%rdx - adcq %rbp,%r10 - shlxq %r14,%r8,%rbp - adcq %rcx,%r11 - shrxq %r14,%r8,%rcx - adcq $0,%r12 - - - - addq %rbp,%r9 - adcq %rcx,%r10 - - mulxq %r15,%rcx,%rbp - movq 8(%rbx),%rdx - adcq %rcx,%r11 - adcq %rbp,%r12 - adcq $0,%r13 - xorq %r8,%r8 - - - - mulxq 0+128(%rsi),%rcx,%rbp - adcxq %rcx,%r9 - adoxq %rbp,%r10 - - mulxq 8+128(%rsi),%rcx,%rbp - adcxq %rcx,%r10 - adoxq %rbp,%r11 - - mulxq 16+128(%rsi),%rcx,%rbp - adcxq %rcx,%r11 - adoxq %rbp,%r12 - - mulxq 24+128(%rsi),%rcx,%rbp - movq %r9,%rdx - adcxq %rcx,%r12 - shlxq %r14,%r9,%rcx - adoxq %rbp,%r13 - shrxq %r14,%r9,%rbp - - adcxq %r8,%r13 - adoxq %r8,%r8 - adcq $0,%r8 - - - - addq %rcx,%r10 - adcq %rbp,%r11 - - mulxq %r15,%rcx,%rbp - movq 16(%rbx),%rdx - adcq %rcx,%r12 - adcq %rbp,%r13 - adcq $0,%r8 - xorq %r9,%r9 - - - - mulxq 0+128(%rsi),%rcx,%rbp - adcxq %rcx,%r10 - adoxq %rbp,%r11 - - mulxq 8+128(%rsi),%rcx,%rbp - adcxq %rcx,%r11 - adoxq %rbp,%r12 - - mulxq 16+128(%rsi),%rcx,%rbp - adcxq %rcx,%r12 - adoxq %rbp,%r13 - - mulxq 24+128(%rsi),%rcx,%rbp - movq %r10,%rdx - adcxq %rcx,%r13 - shlxq %r14,%r10,%rcx - adoxq %rbp,%r8 - shrxq %r14,%r10,%rbp - - adcxq %r9,%r8 - adoxq %r9,%r9 - adcq $0,%r9 - - - - addq %rcx,%r11 - adcq %rbp,%r12 - - mulxq %r15,%rcx,%rbp - movq 24(%rbx),%rdx - adcq %rcx,%r13 - adcq %rbp,%r8 - adcq $0,%r9 - xorq %r10,%r10 - - - - mulxq 0+128(%rsi),%rcx,%rbp - adcxq %rcx,%r11 - adoxq %rbp,%r12 - - mulxq 8+128(%rsi),%rcx,%rbp - adcxq %rcx,%r12 - adoxq %rbp,%r13 - - mulxq 16+128(%rsi),%rcx,%rbp - adcxq %rcx,%r13 - adoxq %rbp,%r8 - - mulxq 24+128(%rsi),%rcx,%rbp - movq %r11,%rdx - adcxq %rcx,%r8 - shlxq %r14,%r11,%rcx - adoxq %rbp,%r9 - shrxq %r14,%r11,%rbp - - adcxq %r10,%r9 - adoxq %r10,%r10 - adcq $0,%r10 - - - - addq %rcx,%r12 - adcq %rbp,%r13 - - mulxq %r15,%rcx,%rbp - movq %r12,%rbx - movq .Lpoly+8(%rip),%r14 - adcq %rcx,%r8 - movq %r13,%rdx - adcq %rbp,%r9 - adcq $0,%r10 - - - - xorl %eax,%eax - movq %r8,%rcx - sbbq $-1,%r12 - sbbq %r14,%r13 - sbbq $0,%r8 - movq %r9,%rbp - sbbq %r15,%r9 - sbbq $0,%r10 - - cmovcq %rbx,%r12 - cmovcq %rdx,%r13 - movq %r12,0(%rdi) - cmovcq %rcx,%r8 - movq %r13,8(%rdi) - cmovcq %rbp,%r9 - movq %r8,16(%rdi) - movq %r9,24(%rdi) - - .byte 0xf3,0xc3 -.size __ecp_nistz256_mul_montx,.-__ecp_nistz256_mul_montx - -.type __ecp_nistz256_sqr_montx,@function -.align 32 -__ecp_nistz256_sqr_montx: - mulxq %r14,%r9,%r10 - mulxq %r15,%rcx,%r11 - xorl %eax,%eax - adcq %rcx,%r10 - mulxq %r8,%rbp,%r12 - movq %r14,%rdx - adcq %rbp,%r11 - adcq $0,%r12 - xorq %r13,%r13 - - - mulxq %r15,%rcx,%rbp - adcxq %rcx,%r11 - adoxq %rbp,%r12 - - mulxq %r8,%rcx,%rbp - movq %r15,%rdx - adcxq %rcx,%r12 - adoxq %rbp,%r13 - adcq $0,%r13 - - - mulxq %r8,%rcx,%r14 - movq 0+128(%rsi),%rdx - xorq %r15,%r15 - adcxq %r9,%r9 - adoxq %rcx,%r13 - adcxq %r10,%r10 - adoxq %r15,%r14 - - mulxq %rdx,%r8,%rbp - movq 8+128(%rsi),%rdx - adcxq %r11,%r11 - adoxq %rbp,%r9 - adcxq %r12,%r12 - mulxq %rdx,%rcx,%rax - movq 16+128(%rsi),%rdx - adcxq %r13,%r13 - adoxq %rcx,%r10 - adcxq %r14,%r14 -.byte 0x67 - mulxq %rdx,%rcx,%rbp - movq 24+128(%rsi),%rdx - adoxq %rax,%r11 - adcxq %r15,%r15 - adoxq %rcx,%r12 - movq $32,%rsi - adoxq %rbp,%r13 -.byte 0x67,0x67 - mulxq %rdx,%rcx,%rax - movq %r8,%rdx - adoxq %rcx,%r14 - shlxq %rsi,%r8,%rcx - adoxq %rax,%r15 - shrxq %rsi,%r8,%rax - movq .Lpoly+24(%rip),%rbp - - - addq %rcx,%r9 - adcq %rax,%r10 - - mulxq %rbp,%rcx,%r8 - movq %r9,%rdx - adcq %rcx,%r11 - shlxq %rsi,%r9,%rcx - adcq $0,%r8 - shrxq %rsi,%r9,%rax - - - addq %rcx,%r10 - adcq %rax,%r11 - - mulxq %rbp,%rcx,%r9 - movq %r10,%rdx - adcq %rcx,%r8 - shlxq %rsi,%r10,%rcx - adcq $0,%r9 - shrxq %rsi,%r10,%rax - - - addq %rcx,%r11 - adcq %rax,%r8 - - mulxq %rbp,%rcx,%r10 - movq %r11,%rdx - adcq %rcx,%r9 - shlxq %rsi,%r11,%rcx - adcq $0,%r10 - shrxq %rsi,%r11,%rax - - - addq %rcx,%r8 - adcq %rax,%r9 - - mulxq %rbp,%rcx,%r11 - adcq %rcx,%r10 - adcq $0,%r11 - - xorq %rdx,%rdx - adcq %r8,%r12 - movq .Lpoly+8(%rip),%rsi - adcq %r9,%r13 - movq %r12,%r8 - adcq %r10,%r14 - adcq %r11,%r15 - movq %r13,%r9 - adcq $0,%rdx - - xorl %eax,%eax - sbbq $-1,%r12 - movq %r14,%r10 - sbbq %rsi,%r13 - sbbq $0,%r14 - movq %r15,%r11 - sbbq %rbp,%r15 - sbbq $0,%rdx - - cmovcq %r8,%r12 - cmovcq %r9,%r13 - movq %r12,0(%rdi) - cmovcq %r10,%r14 - movq %r13,8(%rdi) - cmovcq %r11,%r15 - movq %r14,16(%rdi) - movq %r15,24(%rdi) - - .byte 0xf3,0xc3 -.size __ecp_nistz256_sqr_montx,.-__ecp_nistz256_sqr_montx @@ -1215,9 +883,6 @@ ecp_nistz256_from_mont: .type ecp_nistz256_select_w5,@function .align 32 ecp_nistz256_select_w5: - movl OPENSSL_ia32cap_P+8(%rip),%eax - testl $32,%eax - jnz .Lavx2_select_w5 movdqa .LOne(%rip),%xmm0 movd %edx,%xmm1 @@ -1277,9 +942,6 @@ ecp_nistz256_select_w5: .type ecp_nistz256_select_w7,@function .align 32 ecp_nistz256_select_w7: - movl OPENSSL_ia32cap_P+8(%rip),%eax - testl $32,%eax - jnz .Lavx2_select_w7 movdqa .LOne(%rip),%xmm8 movd %edx,%xmm1 @@ -1321,141 +983,11 @@ ecp_nistz256_select_w7: movdqu %xmm5,48(%rdi) .byte 0xf3,0xc3 .size ecp_nistz256_select_w7,.-ecp_nistz256_select_w7 - - -.type ecp_nistz256_avx2_select_w5,@function -.align 32 -ecp_nistz256_avx2_select_w5: -.Lavx2_select_w5: - vzeroupper - vmovdqa .LTwo(%rip),%ymm0 - - vpxor %ymm2,%ymm2,%ymm2 - vpxor %ymm3,%ymm3,%ymm3 - vpxor %ymm4,%ymm4,%ymm4 - - vmovdqa .LOne(%rip),%ymm5 - vmovdqa .LTwo(%rip),%ymm10 - - vmovd %edx,%xmm1 - vpermd %ymm1,%ymm2,%ymm1 - - movq $8,%rax -.Lselect_loop_avx2_w5: - - vmovdqa 0(%rsi),%ymm6 - vmovdqa 32(%rsi),%ymm7 - vmovdqa 64(%rsi),%ymm8 - - vmovdqa 96(%rsi),%ymm11 - vmovdqa 128(%rsi),%ymm12 - vmovdqa 160(%rsi),%ymm13 - - vpcmpeqd %ymm1,%ymm5,%ymm9 - vpcmpeqd %ymm1,%ymm10,%ymm14 - - vpaddd %ymm0,%ymm5,%ymm5 - vpaddd %ymm0,%ymm10,%ymm10 - leaq 192(%rsi),%rsi - - vpand %ymm9,%ymm6,%ymm6 - vpand %ymm9,%ymm7,%ymm7 - vpand %ymm9,%ymm8,%ymm8 - vpand %ymm14,%ymm11,%ymm11 - vpand %ymm14,%ymm12,%ymm12 - vpand %ymm14,%ymm13,%ymm13 - - vpxor %ymm6,%ymm2,%ymm2 - vpxor %ymm7,%ymm3,%ymm3 - vpxor %ymm8,%ymm4,%ymm4 - vpxor %ymm11,%ymm2,%ymm2 - vpxor %ymm12,%ymm3,%ymm3 - vpxor %ymm13,%ymm4,%ymm4 - - decq %rax - jnz .Lselect_loop_avx2_w5 - - vmovdqu %ymm2,0(%rdi) - vmovdqu %ymm3,32(%rdi) - vmovdqu %ymm4,64(%rdi) - vzeroupper - .byte 0xf3,0xc3 -.size ecp_nistz256_avx2_select_w5,.-ecp_nistz256_avx2_select_w5 - - - .globl ecp_nistz256_avx2_select_w7 .type ecp_nistz256_avx2_select_w7,@function .align 32 ecp_nistz256_avx2_select_w7: -.Lavx2_select_w7: - vzeroupper - vmovdqa .LThree(%rip),%ymm0 - - vpxor %ymm2,%ymm2,%ymm2 - vpxor %ymm3,%ymm3,%ymm3 - - vmovdqa .LOne(%rip),%ymm4 - vmovdqa .LTwo(%rip),%ymm8 - vmovdqa .LThree(%rip),%ymm12 - - vmovd %edx,%xmm1 - vpermd %ymm1,%ymm2,%ymm1 - - - movq $21,%rax -.Lselect_loop_avx2_w7: - - vmovdqa 0(%rsi),%ymm5 - vmovdqa 32(%rsi),%ymm6 - - vmovdqa 64(%rsi),%ymm9 - vmovdqa 96(%rsi),%ymm10 - - vmovdqa 128(%rsi),%ymm13 - vmovdqa 160(%rsi),%ymm14 - - vpcmpeqd %ymm1,%ymm4,%ymm7 - vpcmpeqd %ymm1,%ymm8,%ymm11 - vpcmpeqd %ymm1,%ymm12,%ymm15 - - vpaddd %ymm0,%ymm4,%ymm4 - vpaddd %ymm0,%ymm8,%ymm8 - vpaddd %ymm0,%ymm12,%ymm12 - leaq 192(%rsi),%rsi - - vpand %ymm7,%ymm5,%ymm5 - vpand %ymm7,%ymm6,%ymm6 - vpand %ymm11,%ymm9,%ymm9 - vpand %ymm11,%ymm10,%ymm10 - vpand %ymm15,%ymm13,%ymm13 - vpand %ymm15,%ymm14,%ymm14 - - vpxor %ymm5,%ymm2,%ymm2 - vpxor %ymm6,%ymm3,%ymm3 - vpxor %ymm9,%ymm2,%ymm2 - vpxor %ymm10,%ymm3,%ymm3 - vpxor %ymm13,%ymm2,%ymm2 - vpxor %ymm14,%ymm3,%ymm3 - - decq %rax - jnz .Lselect_loop_avx2_w7 - - - vmovdqa 0(%rsi),%ymm5 - vmovdqa 32(%rsi),%ymm6 - - vpcmpeqd %ymm1,%ymm4,%ymm7 - - vpand %ymm7,%ymm5,%ymm5 - vpand %ymm7,%ymm6,%ymm6 - - vpxor %ymm5,%ymm2,%ymm2 - vpxor %ymm6,%ymm3,%ymm3 - - vmovdqu %ymm2,0(%rdi) - vmovdqu %ymm3,32(%rdi) - vzeroupper +.byte 0x0f,0x0b .byte 0xf3,0xc3 .size ecp_nistz256_avx2_select_w7,.-ecp_nistz256_avx2_select_w7 .type __ecp_nistz256_add_toq,@function @@ -1581,10 +1113,6 @@ __ecp_nistz256_mul_by_2q: .type ecp_nistz256_point_double,@function .align 32 ecp_nistz256_point_double: - movl $524544,%ecx - andl OPENSSL_ia32cap_P+8(%rip),%ecx - cmpl $524544,%ecx - je .Lpoint_doublex pushq %rbp pushq %rbx pushq %r12 @@ -1593,6 +1121,7 @@ ecp_nistz256_point_double: pushq %r15 subq $160+8,%rsp +.Lpoint_double_shortcutq: movdqu 0(%rsi),%xmm0 movq %rsi,%rbx movdqu 16(%rsi),%xmm1 @@ -1786,10 +1315,6 @@ ecp_nistz256_point_double: .type ecp_nistz256_point_add,@function .align 32 ecp_nistz256_point_add: - movl $524544,%ecx - andl OPENSSL_ia32cap_P+8(%rip),%ecx - cmpl $524544,%ecx - je .Lpoint_addx pushq %rbp pushq %rbx pushq %r12 @@ -1817,7 +1342,7 @@ ecp_nistz256_point_add: por %xmm1,%xmm3 movdqu 0(%rsi),%xmm0 - pshufd $177,%xmm3,%xmm5 + pshufd $0xb1,%xmm3,%xmm5 movdqu 16(%rsi),%xmm1 movdqu 32(%rsi),%xmm2 por %xmm3,%xmm5 @@ -1827,7 +1352,7 @@ ecp_nistz256_point_add: movq 64+16(%rsi),%r15 movq 64+24(%rsi),%r8 movdqa %xmm0,480(%rsp) - pshufd $30,%xmm5,%xmm4 + pshufd $0x1e,%xmm5,%xmm4 movdqa %xmm1,480+16(%rsp) por %xmm0,%xmm1 .byte 102,72,15,110,199 @@ -1847,10 +1372,10 @@ ecp_nistz256_point_add: call __ecp_nistz256_sqr_montq pcmpeqd %xmm4,%xmm5 - pshufd $177,%xmm3,%xmm4 + pshufd $0xb1,%xmm3,%xmm4 por %xmm3,%xmm4 pshufd $0,%xmm5,%xmm5 - pshufd $30,%xmm4,%xmm3 + pshufd $0x1e,%xmm4,%xmm3 por %xmm3,%xmm4 pxor %xmm3,%xmm3 pcmpeqd %xmm3,%xmm4 @@ -1859,6 +1384,7 @@ ecp_nistz256_point_add: movq 64+8(%rbx),%r14 movq 64+16(%rbx),%r15 movq 64+24(%rbx),%r8 +.byte 102,72,15,110,203 leaq 64-0(%rbx),%rsi leaq 32(%rsp),%rdi @@ -1950,7 +1476,7 @@ ecp_nistz256_point_add: testq %r8,%r8 jnz .Ladd_proceedq testq %r9,%r9 - jz .Ladd_proceedq + jz .Ladd_doubleq .byte 102,72,15,126,199 pxor %xmm0,%xmm0 @@ -1962,6 +1488,13 @@ ecp_nistz256_point_add: movdqu %xmm0,80(%rdi) jmp .Ladd_doneq +.align 32 +.Ladd_doubleq: +.byte 102,72,15,126,206 +.byte 102,72,15,126,199 + addq $416,%rsp + jmp .Lpoint_double_shortcutq + .align 32 .Ladd_proceedq: movq 0+64(%rsp),%rax @@ -2179,10 +1712,6 @@ ecp_nistz256_point_add: .type ecp_nistz256_point_add_affine,@function .align 32 ecp_nistz256_point_add_affine: - movl $524544,%ecx - andl OPENSSL_ia32cap_P+8(%rip),%ecx - cmpl $524544,%ecx - je .Lpoint_add_affinex pushq %rbp pushq %rbx pushq %r12 @@ -2213,13 +1742,13 @@ ecp_nistz256_point_add_affine: por %xmm1,%xmm3 movdqu 0(%rbx),%xmm0 - pshufd $177,%xmm3,%xmm5 + pshufd $0xb1,%xmm3,%xmm5 movdqu 16(%rbx),%xmm1 movdqu 32(%rbx),%xmm2 por %xmm3,%xmm5 movdqu 48(%rbx),%xmm3 movdqa %xmm0,416(%rsp) - pshufd $30,%xmm5,%xmm4 + pshufd $0x1e,%xmm5,%xmm4 movdqa %xmm1,416+16(%rsp) por %xmm0,%xmm1 .byte 102,72,15,110,199 @@ -2235,13 +1764,13 @@ ecp_nistz256_point_add_affine: call __ecp_nistz256_sqr_montq pcmpeqd %xmm4,%xmm5 - pshufd $177,%xmm3,%xmm4 + pshufd $0xb1,%xmm3,%xmm4 movq 0(%rbx),%rax movq %r12,%r9 por %xmm3,%xmm4 pshufd $0,%xmm5,%xmm5 - pshufd $30,%xmm4,%xmm3 + pshufd $0x1e,%xmm4,%xmm3 movq %r13,%r10 por %xmm3,%xmm4 pxor %xmm3,%xmm3 @@ -2482,1023 +2011,3 @@ ecp_nistz256_point_add_affine: popq %rbp .byte 0xf3,0xc3 .size ecp_nistz256_point_add_affine,.-ecp_nistz256_point_add_affine -.type __ecp_nistz256_add_tox,@function -.align 32 -__ecp_nistz256_add_tox: - xorq %r11,%r11 - adcq 0(%rbx),%r12 - adcq 8(%rbx),%r13 - movq %r12,%rax - adcq 16(%rbx),%r8 - adcq 24(%rbx),%r9 - movq %r13,%rbp - adcq $0,%r11 - - xorq %r10,%r10 - sbbq $-1,%r12 - movq %r8,%rcx - sbbq %r14,%r13 - sbbq $0,%r8 - movq %r9,%r10 - sbbq %r15,%r9 - - btq $0,%r11 - cmovncq %rax,%r12 - cmovncq %rbp,%r13 - movq %r12,0(%rdi) - cmovncq %rcx,%r8 - movq %r13,8(%rdi) - cmovncq %r10,%r9 - movq %r8,16(%rdi) - movq %r9,24(%rdi) - - .byte 0xf3,0xc3 -.size __ecp_nistz256_add_tox,.-__ecp_nistz256_add_tox - -.type __ecp_nistz256_sub_fromx,@function -.align 32 -__ecp_nistz256_sub_fromx: - xorq %r11,%r11 - sbbq 0(%rbx),%r12 - sbbq 8(%rbx),%r13 - movq %r12,%rax - sbbq 16(%rbx),%r8 - sbbq 24(%rbx),%r9 - movq %r13,%rbp - sbbq $0,%r11 - - xorq %r10,%r10 - adcq $-1,%r12 - movq %r8,%rcx - adcq %r14,%r13 - adcq $0,%r8 - movq %r9,%r10 - adcq %r15,%r9 - - btq $0,%r11 - cmovncq %rax,%r12 - cmovncq %rbp,%r13 - movq %r12,0(%rdi) - cmovncq %rcx,%r8 - movq %r13,8(%rdi) - cmovncq %r10,%r9 - movq %r8,16(%rdi) - movq %r9,24(%rdi) - - .byte 0xf3,0xc3 -.size __ecp_nistz256_sub_fromx,.-__ecp_nistz256_sub_fromx - -.type __ecp_nistz256_subx,@function -.align 32 -__ecp_nistz256_subx: - xorq %r11,%r11 - sbbq %r12,%rax - sbbq %r13,%rbp - movq %rax,%r12 - sbbq %r8,%rcx - sbbq %r9,%r10 - movq %rbp,%r13 - sbbq $0,%r11 - - xorq %r9,%r9 - adcq $-1,%rax - movq %rcx,%r8 - adcq %r14,%rbp - adcq $0,%rcx - movq %r10,%r9 - adcq %r15,%r10 - - btq $0,%r11 - cmovcq %rax,%r12 - cmovcq %rbp,%r13 - cmovcq %rcx,%r8 - cmovcq %r10,%r9 - - .byte 0xf3,0xc3 -.size __ecp_nistz256_subx,.-__ecp_nistz256_subx - -.type __ecp_nistz256_mul_by_2x,@function -.align 32 -__ecp_nistz256_mul_by_2x: - xorq %r11,%r11 - adcq %r12,%r12 - adcq %r13,%r13 - movq %r12,%rax - adcq %r8,%r8 - adcq %r9,%r9 - movq %r13,%rbp - adcq $0,%r11 - - xorq %r10,%r10 - sbbq $-1,%r12 - movq %r8,%rcx - sbbq %r14,%r13 - sbbq $0,%r8 - movq %r9,%r10 - sbbq %r15,%r9 - - btq $0,%r11 - cmovncq %rax,%r12 - cmovncq %rbp,%r13 - movq %r12,0(%rdi) - cmovncq %rcx,%r8 - movq %r13,8(%rdi) - cmovncq %r10,%r9 - movq %r8,16(%rdi) - movq %r9,24(%rdi) - - .byte 0xf3,0xc3 -.size __ecp_nistz256_mul_by_2x,.-__ecp_nistz256_mul_by_2x -.type ecp_nistz256_point_doublex,@function -.align 32 -ecp_nistz256_point_doublex: -.Lpoint_doublex: - pushq %rbp - pushq %rbx - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - subq $160+8,%rsp - - movdqu 0(%rsi),%xmm0 - movq %rsi,%rbx - movdqu 16(%rsi),%xmm1 - movq 32+0(%rsi),%r12 - movq 32+8(%rsi),%r13 - movq 32+16(%rsi),%r8 - movq 32+24(%rsi),%r9 - movq .Lpoly+8(%rip),%r14 - movq .Lpoly+24(%rip),%r15 - movdqa %xmm0,96(%rsp) - movdqa %xmm1,96+16(%rsp) - leaq 32(%rdi),%r10 - leaq 64(%rdi),%r11 -.byte 102,72,15,110,199 -.byte 102,73,15,110,202 -.byte 102,73,15,110,211 - - leaq 0(%rsp),%rdi - call __ecp_nistz256_mul_by_2x - - movq 64+0(%rsi),%rdx - movq 64+8(%rsi),%r14 - movq 64+16(%rsi),%r15 - movq 64+24(%rsi),%r8 - leaq 64-128(%rsi),%rsi - leaq 64(%rsp),%rdi - call __ecp_nistz256_sqr_montx - - movq 0+0(%rsp),%rdx - movq 8+0(%rsp),%r14 - leaq -128+0(%rsp),%rsi - movq 16+0(%rsp),%r15 - movq 24+0(%rsp),%r8 - leaq 0(%rsp),%rdi - call __ecp_nistz256_sqr_montx - - movq 32(%rbx),%rdx - movq 64+0(%rbx),%r9 - movq 64+8(%rbx),%r10 - movq 64+16(%rbx),%r11 - movq 64+24(%rbx),%r12 - leaq 64-128(%rbx),%rsi - leaq 32(%rbx),%rbx -.byte 102,72,15,126,215 - call __ecp_nistz256_mul_montx - call __ecp_nistz256_mul_by_2x - - movq 96+0(%rsp),%r12 - movq 96+8(%rsp),%r13 - leaq 64(%rsp),%rbx - movq 96+16(%rsp),%r8 - movq 96+24(%rsp),%r9 - leaq 32(%rsp),%rdi - call __ecp_nistz256_add_tox - - movq 96+0(%rsp),%r12 - movq 96+8(%rsp),%r13 - leaq 64(%rsp),%rbx - movq 96+16(%rsp),%r8 - movq 96+24(%rsp),%r9 - leaq 64(%rsp),%rdi - call __ecp_nistz256_sub_fromx - - movq 0+0(%rsp),%rdx - movq 8+0(%rsp),%r14 - leaq -128+0(%rsp),%rsi - movq 16+0(%rsp),%r15 - movq 24+0(%rsp),%r8 -.byte 102,72,15,126,207 - call __ecp_nistz256_sqr_montx - xorq %r9,%r9 - movq %r12,%rax - addq $-1,%r12 - movq %r13,%r10 - adcq %rsi,%r13 - movq %r14,%rcx - adcq $0,%r14 - movq %r15,%r8 - adcq %rbp,%r15 - adcq $0,%r9 - xorq %rsi,%rsi - testq $1,%rax - - cmovzq %rax,%r12 - cmovzq %r10,%r13 - cmovzq %rcx,%r14 - cmovzq %r8,%r15 - cmovzq %rsi,%r9 - - movq %r13,%rax - shrq $1,%r12 - shlq $63,%rax - movq %r14,%r10 - shrq $1,%r13 - orq %rax,%r12 - shlq $63,%r10 - movq %r15,%rcx - shrq $1,%r14 - orq %r10,%r13 - shlq $63,%rcx - movq %r12,0(%rdi) - shrq $1,%r15 - movq %r13,8(%rdi) - shlq $63,%r9 - orq %rcx,%r14 - orq %r9,%r15 - movq %r14,16(%rdi) - movq %r15,24(%rdi) - movq 64(%rsp),%rdx - leaq 64(%rsp),%rbx - movq 0+32(%rsp),%r9 - movq 8+32(%rsp),%r10 - leaq -128+32(%rsp),%rsi - movq 16+32(%rsp),%r11 - movq 24+32(%rsp),%r12 - leaq 32(%rsp),%rdi - call __ecp_nistz256_mul_montx - - leaq 128(%rsp),%rdi - call __ecp_nistz256_mul_by_2x - - leaq 32(%rsp),%rbx - leaq 32(%rsp),%rdi - call __ecp_nistz256_add_tox - - movq 96(%rsp),%rdx - leaq 96(%rsp),%rbx - movq 0+0(%rsp),%r9 - movq 8+0(%rsp),%r10 - leaq -128+0(%rsp),%rsi - movq 16+0(%rsp),%r11 - movq 24+0(%rsp),%r12 - leaq 0(%rsp),%rdi - call __ecp_nistz256_mul_montx - - leaq 128(%rsp),%rdi - call __ecp_nistz256_mul_by_2x - - movq 0+32(%rsp),%rdx - movq 8+32(%rsp),%r14 - leaq -128+32(%rsp),%rsi - movq 16+32(%rsp),%r15 - movq 24+32(%rsp),%r8 -.byte 102,72,15,126,199 - call __ecp_nistz256_sqr_montx - - leaq 128(%rsp),%rbx - movq %r14,%r8 - movq %r15,%r9 - movq %rsi,%r14 - movq %rbp,%r15 - call __ecp_nistz256_sub_fromx - - movq 0+0(%rsp),%rax - movq 0+8(%rsp),%rbp - movq 0+16(%rsp),%rcx - movq 0+24(%rsp),%r10 - leaq 0(%rsp),%rdi - call __ecp_nistz256_subx - - movq 32(%rsp),%rdx - leaq 32(%rsp),%rbx - movq %r12,%r14 - xorl %ecx,%ecx - movq %r12,0+0(%rsp) - movq %r13,%r10 - movq %r13,0+8(%rsp) - cmovzq %r8,%r11 - movq %r8,0+16(%rsp) - leaq 0-128(%rsp),%rsi - cmovzq %r9,%r12 - movq %r9,0+24(%rsp) - movq %r14,%r9 - leaq 0(%rsp),%rdi - call __ecp_nistz256_mul_montx - -.byte 102,72,15,126,203 -.byte 102,72,15,126,207 - call __ecp_nistz256_sub_fromx - - addq $160+8,%rsp - popq %r15 - popq %r14 - popq %r13 - popq %r12 - popq %rbx - popq %rbp - .byte 0xf3,0xc3 -.size ecp_nistz256_point_doublex,.-ecp_nistz256_point_doublex -.type ecp_nistz256_point_addx,@function -.align 32 -ecp_nistz256_point_addx: -.Lpoint_addx: - pushq %rbp - pushq %rbx - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - subq $576+8,%rsp - - movdqu 0(%rsi),%xmm0 - movdqu 16(%rsi),%xmm1 - movdqu 32(%rsi),%xmm2 - movdqu 48(%rsi),%xmm3 - movdqu 64(%rsi),%xmm4 - movdqu 80(%rsi),%xmm5 - movq %rsi,%rbx - movq %rdx,%rsi - movdqa %xmm0,384(%rsp) - movdqa %xmm1,384+16(%rsp) - por %xmm0,%xmm1 - movdqa %xmm2,416(%rsp) - movdqa %xmm3,416+16(%rsp) - por %xmm2,%xmm3 - movdqa %xmm4,448(%rsp) - movdqa %xmm5,448+16(%rsp) - por %xmm1,%xmm3 - - movdqu 0(%rsi),%xmm0 - pshufd $177,%xmm3,%xmm5 - movdqu 16(%rsi),%xmm1 - movdqu 32(%rsi),%xmm2 - por %xmm3,%xmm5 - movdqu 48(%rsi),%xmm3 - movq 64+0(%rsi),%rdx - movq 64+8(%rsi),%r14 - movq 64+16(%rsi),%r15 - movq 64+24(%rsi),%r8 - movdqa %xmm0,480(%rsp) - pshufd $30,%xmm5,%xmm4 - movdqa %xmm1,480+16(%rsp) - por %xmm0,%xmm1 -.byte 102,72,15,110,199 - movdqa %xmm2,512(%rsp) - movdqa %xmm3,512+16(%rsp) - por %xmm2,%xmm3 - por %xmm4,%xmm5 - pxor %xmm4,%xmm4 - por %xmm1,%xmm3 - - leaq 64-128(%rsi),%rsi - movq %rdx,544+0(%rsp) - movq %r14,544+8(%rsp) - movq %r15,544+16(%rsp) - movq %r8,544+24(%rsp) - leaq 96(%rsp),%rdi - call __ecp_nistz256_sqr_montx - - pcmpeqd %xmm4,%xmm5 - pshufd $177,%xmm3,%xmm4 - por %xmm3,%xmm4 - pshufd $0,%xmm5,%xmm5 - pshufd $30,%xmm4,%xmm3 - por %xmm3,%xmm4 - pxor %xmm3,%xmm3 - pcmpeqd %xmm3,%xmm4 - pshufd $0,%xmm4,%xmm4 - movq 64+0(%rbx),%rdx - movq 64+8(%rbx),%r14 - movq 64+16(%rbx),%r15 - movq 64+24(%rbx),%r8 - - leaq 64-128(%rbx),%rsi - leaq 32(%rsp),%rdi - call __ecp_nistz256_sqr_montx - - movq 544(%rsp),%rdx - leaq 544(%rsp),%rbx - movq 0+96(%rsp),%r9 - movq 8+96(%rsp),%r10 - leaq -128+96(%rsp),%rsi - movq 16+96(%rsp),%r11 - movq 24+96(%rsp),%r12 - leaq 224(%rsp),%rdi - call __ecp_nistz256_mul_montx - - movq 448(%rsp),%rdx - leaq 448(%rsp),%rbx - movq 0+32(%rsp),%r9 - movq 8+32(%rsp),%r10 - leaq -128+32(%rsp),%rsi - movq 16+32(%rsp),%r11 - movq 24+32(%rsp),%r12 - leaq 256(%rsp),%rdi - call __ecp_nistz256_mul_montx - - movq 416(%rsp),%rdx - leaq 416(%rsp),%rbx - movq 0+224(%rsp),%r9 - movq 8+224(%rsp),%r10 - leaq -128+224(%rsp),%rsi - movq 16+224(%rsp),%r11 - movq 24+224(%rsp),%r12 - leaq 224(%rsp),%rdi - call __ecp_nistz256_mul_montx - - movq 512(%rsp),%rdx - leaq 512(%rsp),%rbx - movq 0+256(%rsp),%r9 - movq 8+256(%rsp),%r10 - leaq -128+256(%rsp),%rsi - movq 16+256(%rsp),%r11 - movq 24+256(%rsp),%r12 - leaq 256(%rsp),%rdi - call __ecp_nistz256_mul_montx - - leaq 224(%rsp),%rbx - leaq 64(%rsp),%rdi - call __ecp_nistz256_sub_fromx - - orq %r13,%r12 - movdqa %xmm4,%xmm2 - orq %r8,%r12 - orq %r9,%r12 - por %xmm5,%xmm2 -.byte 102,73,15,110,220 - - movq 384(%rsp),%rdx - leaq 384(%rsp),%rbx - movq 0+96(%rsp),%r9 - movq 8+96(%rsp),%r10 - leaq -128+96(%rsp),%rsi - movq 16+96(%rsp),%r11 - movq 24+96(%rsp),%r12 - leaq 160(%rsp),%rdi - call __ecp_nistz256_mul_montx - - movq 480(%rsp),%rdx - leaq 480(%rsp),%rbx - movq 0+32(%rsp),%r9 - movq 8+32(%rsp),%r10 - leaq -128+32(%rsp),%rsi - movq 16+32(%rsp),%r11 - movq 24+32(%rsp),%r12 - leaq 192(%rsp),%rdi - call __ecp_nistz256_mul_montx - - leaq 160(%rsp),%rbx - leaq 0(%rsp),%rdi - call __ecp_nistz256_sub_fromx - - orq %r13,%r12 - orq %r8,%r12 - orq %r9,%r12 - -.byte 0x3e - jnz .Ladd_proceedx -.byte 102,73,15,126,208 -.byte 102,73,15,126,217 - testq %r8,%r8 - jnz .Ladd_proceedx - testq %r9,%r9 - jz .Ladd_proceedx - -.byte 102,72,15,126,199 - pxor %xmm0,%xmm0 - movdqu %xmm0,0(%rdi) - movdqu %xmm0,16(%rdi) - movdqu %xmm0,32(%rdi) - movdqu %xmm0,48(%rdi) - movdqu %xmm0,64(%rdi) - movdqu %xmm0,80(%rdi) - jmp .Ladd_donex - -.align 32 -.Ladd_proceedx: - movq 0+64(%rsp),%rdx - movq 8+64(%rsp),%r14 - leaq -128+64(%rsp),%rsi - movq 16+64(%rsp),%r15 - movq 24+64(%rsp),%r8 - leaq 96(%rsp),%rdi - call __ecp_nistz256_sqr_montx - - movq 448(%rsp),%rdx - leaq 448(%rsp),%rbx - movq 0+0(%rsp),%r9 - movq 8+0(%rsp),%r10 - leaq -128+0(%rsp),%rsi - movq 16+0(%rsp),%r11 - movq 24+0(%rsp),%r12 - leaq 352(%rsp),%rdi - call __ecp_nistz256_mul_montx - - movq 0+0(%rsp),%rdx - movq 8+0(%rsp),%r14 - leaq -128+0(%rsp),%rsi - movq 16+0(%rsp),%r15 - movq 24+0(%rsp),%r8 - leaq 32(%rsp),%rdi - call __ecp_nistz256_sqr_montx - - movq 544(%rsp),%rdx - leaq 544(%rsp),%rbx - movq 0+352(%rsp),%r9 - movq 8+352(%rsp),%r10 - leaq -128+352(%rsp),%rsi - movq 16+352(%rsp),%r11 - movq 24+352(%rsp),%r12 - leaq 352(%rsp),%rdi - call __ecp_nistz256_mul_montx - - movq 0(%rsp),%rdx - leaq 0(%rsp),%rbx - movq 0+32(%rsp),%r9 - movq 8+32(%rsp),%r10 - leaq -128+32(%rsp),%rsi - movq 16+32(%rsp),%r11 - movq 24+32(%rsp),%r12 - leaq 128(%rsp),%rdi - call __ecp_nistz256_mul_montx - - movq 160(%rsp),%rdx - leaq 160(%rsp),%rbx - movq 0+32(%rsp),%r9 - movq 8+32(%rsp),%r10 - leaq -128+32(%rsp),%rsi - movq 16+32(%rsp),%r11 - movq 24+32(%rsp),%r12 - leaq 192(%rsp),%rdi - call __ecp_nistz256_mul_montx - - - - - addq %r12,%r12 - leaq 96(%rsp),%rsi - adcq %r13,%r13 - movq %r12,%rax - adcq %r8,%r8 - adcq %r9,%r9 - movq %r13,%rbp - sbbq %r11,%r11 - - subq $-1,%r12 - movq %r8,%rcx - sbbq %r14,%r13 - sbbq $0,%r8 - movq %r9,%r10 - sbbq %r15,%r9 - testq %r11,%r11 - - cmovzq %rax,%r12 - movq 0(%rsi),%rax - cmovzq %rbp,%r13 - movq 8(%rsi),%rbp - cmovzq %rcx,%r8 - movq 16(%rsi),%rcx - cmovzq %r10,%r9 - movq 24(%rsi),%r10 - - call __ecp_nistz256_subx - - leaq 128(%rsp),%rbx - leaq 288(%rsp),%rdi - call __ecp_nistz256_sub_fromx - - movq 192+0(%rsp),%rax - movq 192+8(%rsp),%rbp - movq 192+16(%rsp),%rcx - movq 192+24(%rsp),%r10 - leaq 320(%rsp),%rdi - - call __ecp_nistz256_subx - - movq %r12,0(%rdi) - movq %r13,8(%rdi) - movq %r8,16(%rdi) - movq %r9,24(%rdi) - movq 128(%rsp),%rdx - leaq 128(%rsp),%rbx - movq 0+224(%rsp),%r9 - movq 8+224(%rsp),%r10 - leaq -128+224(%rsp),%rsi - movq 16+224(%rsp),%r11 - movq 24+224(%rsp),%r12 - leaq 256(%rsp),%rdi - call __ecp_nistz256_mul_montx - - movq 320(%rsp),%rdx - leaq 320(%rsp),%rbx - movq 0+64(%rsp),%r9 - movq 8+64(%rsp),%r10 - leaq -128+64(%rsp),%rsi - movq 16+64(%rsp),%r11 - movq 24+64(%rsp),%r12 - leaq 320(%rsp),%rdi - call __ecp_nistz256_mul_montx - - leaq 256(%rsp),%rbx - leaq 320(%rsp),%rdi - call __ecp_nistz256_sub_fromx - -.byte 102,72,15,126,199 - - movdqa %xmm5,%xmm0 - movdqa %xmm5,%xmm1 - pandn 352(%rsp),%xmm0 - movdqa %xmm5,%xmm2 - pandn 352+16(%rsp),%xmm1 - movdqa %xmm5,%xmm3 - pand 544(%rsp),%xmm2 - pand 544+16(%rsp),%xmm3 - por %xmm0,%xmm2 - por %xmm1,%xmm3 - - movdqa %xmm4,%xmm0 - movdqa %xmm4,%xmm1 - pandn %xmm2,%xmm0 - movdqa %xmm4,%xmm2 - pandn %xmm3,%xmm1 - movdqa %xmm4,%xmm3 - pand 448(%rsp),%xmm2 - pand 448+16(%rsp),%xmm3 - por %xmm0,%xmm2 - por %xmm1,%xmm3 - movdqu %xmm2,64(%rdi) - movdqu %xmm3,80(%rdi) - - movdqa %xmm5,%xmm0 - movdqa %xmm5,%xmm1 - pandn 288(%rsp),%xmm0 - movdqa %xmm5,%xmm2 - pandn 288+16(%rsp),%xmm1 - movdqa %xmm5,%xmm3 - pand 480(%rsp),%xmm2 - pand 480+16(%rsp),%xmm3 - por %xmm0,%xmm2 - por %xmm1,%xmm3 - - movdqa %xmm4,%xmm0 - movdqa %xmm4,%xmm1 - pandn %xmm2,%xmm0 - movdqa %xmm4,%xmm2 - pandn %xmm3,%xmm1 - movdqa %xmm4,%xmm3 - pand 384(%rsp),%xmm2 - pand 384+16(%rsp),%xmm3 - por %xmm0,%xmm2 - por %xmm1,%xmm3 - movdqu %xmm2,0(%rdi) - movdqu %xmm3,16(%rdi) - - movdqa %xmm5,%xmm0 - movdqa %xmm5,%xmm1 - pandn 320(%rsp),%xmm0 - movdqa %xmm5,%xmm2 - pandn 320+16(%rsp),%xmm1 - movdqa %xmm5,%xmm3 - pand 512(%rsp),%xmm2 - pand 512+16(%rsp),%xmm3 - por %xmm0,%xmm2 - por %xmm1,%xmm3 - - movdqa %xmm4,%xmm0 - movdqa %xmm4,%xmm1 - pandn %xmm2,%xmm0 - movdqa %xmm4,%xmm2 - pandn %xmm3,%xmm1 - movdqa %xmm4,%xmm3 - pand 416(%rsp),%xmm2 - pand 416+16(%rsp),%xmm3 - por %xmm0,%xmm2 - por %xmm1,%xmm3 - movdqu %xmm2,32(%rdi) - movdqu %xmm3,48(%rdi) - -.Ladd_donex: - addq $576+8,%rsp - popq %r15 - popq %r14 - popq %r13 - popq %r12 - popq %rbx - popq %rbp - .byte 0xf3,0xc3 -.size ecp_nistz256_point_addx,.-ecp_nistz256_point_addx -.type ecp_nistz256_point_add_affinex,@function -.align 32 -ecp_nistz256_point_add_affinex: -.Lpoint_add_affinex: - pushq %rbp - pushq %rbx - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - subq $480+8,%rsp - - movdqu 0(%rsi),%xmm0 - movq %rdx,%rbx - movdqu 16(%rsi),%xmm1 - movdqu 32(%rsi),%xmm2 - movdqu 48(%rsi),%xmm3 - movdqu 64(%rsi),%xmm4 - movdqu 80(%rsi),%xmm5 - movq 64+0(%rsi),%rdx - movq 64+8(%rsi),%r14 - movq 64+16(%rsi),%r15 - movq 64+24(%rsi),%r8 - movdqa %xmm0,320(%rsp) - movdqa %xmm1,320+16(%rsp) - por %xmm0,%xmm1 - movdqa %xmm2,352(%rsp) - movdqa %xmm3,352+16(%rsp) - por %xmm2,%xmm3 - movdqa %xmm4,384(%rsp) - movdqa %xmm5,384+16(%rsp) - por %xmm1,%xmm3 - - movdqu 0(%rbx),%xmm0 - pshufd $177,%xmm3,%xmm5 - movdqu 16(%rbx),%xmm1 - movdqu 32(%rbx),%xmm2 - por %xmm3,%xmm5 - movdqu 48(%rbx),%xmm3 - movdqa %xmm0,416(%rsp) - pshufd $30,%xmm5,%xmm4 - movdqa %xmm1,416+16(%rsp) - por %xmm0,%xmm1 -.byte 102,72,15,110,199 - movdqa %xmm2,448(%rsp) - movdqa %xmm3,448+16(%rsp) - por %xmm2,%xmm3 - por %xmm4,%xmm5 - pxor %xmm4,%xmm4 - por %xmm1,%xmm3 - - leaq 64-128(%rsi),%rsi - leaq 32(%rsp),%rdi - call __ecp_nistz256_sqr_montx - - pcmpeqd %xmm4,%xmm5 - pshufd $177,%xmm3,%xmm4 - movq 0(%rbx),%rdx - - movq %r12,%r9 - por %xmm3,%xmm4 - pshufd $0,%xmm5,%xmm5 - pshufd $30,%xmm4,%xmm3 - movq %r13,%r10 - por %xmm3,%xmm4 - pxor %xmm3,%xmm3 - movq %r14,%r11 - pcmpeqd %xmm3,%xmm4 - pshufd $0,%xmm4,%xmm4 - - leaq 32-128(%rsp),%rsi - movq %r15,%r12 - leaq 0(%rsp),%rdi - call __ecp_nistz256_mul_montx - - leaq 320(%rsp),%rbx - leaq 64(%rsp),%rdi - call __ecp_nistz256_sub_fromx - - movq 384(%rsp),%rdx - leaq 384(%rsp),%rbx - movq 0+32(%rsp),%r9 - movq 8+32(%rsp),%r10 - leaq -128+32(%rsp),%rsi - movq 16+32(%rsp),%r11 - movq 24+32(%rsp),%r12 - leaq 32(%rsp),%rdi - call __ecp_nistz256_mul_montx - - movq 384(%rsp),%rdx - leaq 384(%rsp),%rbx - movq 0+64(%rsp),%r9 - movq 8+64(%rsp),%r10 - leaq -128+64(%rsp),%rsi - movq 16+64(%rsp),%r11 - movq 24+64(%rsp),%r12 - leaq 288(%rsp),%rdi - call __ecp_nistz256_mul_montx - - movq 448(%rsp),%rdx - leaq 448(%rsp),%rbx - movq 0+32(%rsp),%r9 - movq 8+32(%rsp),%r10 - leaq -128+32(%rsp),%rsi - movq 16+32(%rsp),%r11 - movq 24+32(%rsp),%r12 - leaq 32(%rsp),%rdi - call __ecp_nistz256_mul_montx - - leaq 352(%rsp),%rbx - leaq 96(%rsp),%rdi - call __ecp_nistz256_sub_fromx - - movq 0+64(%rsp),%rdx - movq 8+64(%rsp),%r14 - leaq -128+64(%rsp),%rsi - movq 16+64(%rsp),%r15 - movq 24+64(%rsp),%r8 - leaq 128(%rsp),%rdi - call __ecp_nistz256_sqr_montx - - movq 0+96(%rsp),%rdx - movq 8+96(%rsp),%r14 - leaq -128+96(%rsp),%rsi - movq 16+96(%rsp),%r15 - movq 24+96(%rsp),%r8 - leaq 192(%rsp),%rdi - call __ecp_nistz256_sqr_montx - - movq 128(%rsp),%rdx - leaq 128(%rsp),%rbx - movq 0+64(%rsp),%r9 - movq 8+64(%rsp),%r10 - leaq -128+64(%rsp),%rsi - movq 16+64(%rsp),%r11 - movq 24+64(%rsp),%r12 - leaq 160(%rsp),%rdi - call __ecp_nistz256_mul_montx - - movq 320(%rsp),%rdx - leaq 320(%rsp),%rbx - movq 0+128(%rsp),%r9 - movq 8+128(%rsp),%r10 - leaq -128+128(%rsp),%rsi - movq 16+128(%rsp),%r11 - movq 24+128(%rsp),%r12 - leaq 0(%rsp),%rdi - call __ecp_nistz256_mul_montx - - - - - addq %r12,%r12 - leaq 192(%rsp),%rsi - adcq %r13,%r13 - movq %r12,%rax - adcq %r8,%r8 - adcq %r9,%r9 - movq %r13,%rbp - sbbq %r11,%r11 - - subq $-1,%r12 - movq %r8,%rcx - sbbq %r14,%r13 - sbbq $0,%r8 - movq %r9,%r10 - sbbq %r15,%r9 - testq %r11,%r11 - - cmovzq %rax,%r12 - movq 0(%rsi),%rax - cmovzq %rbp,%r13 - movq 8(%rsi),%rbp - cmovzq %rcx,%r8 - movq 16(%rsi),%rcx - cmovzq %r10,%r9 - movq 24(%rsi),%r10 - - call __ecp_nistz256_subx - - leaq 160(%rsp),%rbx - leaq 224(%rsp),%rdi - call __ecp_nistz256_sub_fromx - - movq 0+0(%rsp),%rax - movq 0+8(%rsp),%rbp - movq 0+16(%rsp),%rcx - movq 0+24(%rsp),%r10 - leaq 64(%rsp),%rdi - - call __ecp_nistz256_subx - - movq %r12,0(%rdi) - movq %r13,8(%rdi) - movq %r8,16(%rdi) - movq %r9,24(%rdi) - movq 352(%rsp),%rdx - leaq 352(%rsp),%rbx - movq 0+160(%rsp),%r9 - movq 8+160(%rsp),%r10 - leaq -128+160(%rsp),%rsi - movq 16+160(%rsp),%r11 - movq 24+160(%rsp),%r12 - leaq 32(%rsp),%rdi - call __ecp_nistz256_mul_montx - - movq 96(%rsp),%rdx - leaq 96(%rsp),%rbx - movq 0+64(%rsp),%r9 - movq 8+64(%rsp),%r10 - leaq -128+64(%rsp),%rsi - movq 16+64(%rsp),%r11 - movq 24+64(%rsp),%r12 - leaq 64(%rsp),%rdi - call __ecp_nistz256_mul_montx - - leaq 32(%rsp),%rbx - leaq 256(%rsp),%rdi - call __ecp_nistz256_sub_fromx - -.byte 102,72,15,126,199 - - movdqa %xmm5,%xmm0 - movdqa %xmm5,%xmm1 - pandn 288(%rsp),%xmm0 - movdqa %xmm5,%xmm2 - pandn 288+16(%rsp),%xmm1 - movdqa %xmm5,%xmm3 - pand .LONE_mont(%rip),%xmm2 - pand .LONE_mont+16(%rip),%xmm3 - por %xmm0,%xmm2 - por %xmm1,%xmm3 - - movdqa %xmm4,%xmm0 - movdqa %xmm4,%xmm1 - pandn %xmm2,%xmm0 - movdqa %xmm4,%xmm2 - pandn %xmm3,%xmm1 - movdqa %xmm4,%xmm3 - pand 384(%rsp),%xmm2 - pand 384+16(%rsp),%xmm3 - por %xmm0,%xmm2 - por %xmm1,%xmm3 - movdqu %xmm2,64(%rdi) - movdqu %xmm3,80(%rdi) - - movdqa %xmm5,%xmm0 - movdqa %xmm5,%xmm1 - pandn 224(%rsp),%xmm0 - movdqa %xmm5,%xmm2 - pandn 224+16(%rsp),%xmm1 - movdqa %xmm5,%xmm3 - pand 416(%rsp),%xmm2 - pand 416+16(%rsp),%xmm3 - por %xmm0,%xmm2 - por %xmm1,%xmm3 - - movdqa %xmm4,%xmm0 - movdqa %xmm4,%xmm1 - pandn %xmm2,%xmm0 - movdqa %xmm4,%xmm2 - pandn %xmm3,%xmm1 - movdqa %xmm4,%xmm3 - pand 320(%rsp),%xmm2 - pand 320+16(%rsp),%xmm3 - por %xmm0,%xmm2 - por %xmm1,%xmm3 - movdqu %xmm2,0(%rdi) - movdqu %xmm3,16(%rdi) - - movdqa %xmm5,%xmm0 - movdqa %xmm5,%xmm1 - pandn 256(%rsp),%xmm0 - movdqa %xmm5,%xmm2 - pandn 256+16(%rsp),%xmm1 - movdqa %xmm5,%xmm3 - pand 448(%rsp),%xmm2 - pand 448+16(%rsp),%xmm3 - por %xmm0,%xmm2 - por %xmm1,%xmm3 - - movdqa %xmm4,%xmm0 - movdqa %xmm4,%xmm1 - pandn %xmm2,%xmm0 - movdqa %xmm4,%xmm2 - pandn %xmm3,%xmm1 - movdqa %xmm4,%xmm3 - pand 352(%rsp),%xmm2 - pand 352+16(%rsp),%xmm3 - por %xmm0,%xmm2 - por %xmm1,%xmm3 - movdqu %xmm2,32(%rdi) - movdqu %xmm3,48(%rdi) - - addq $480+8,%rsp - popq %r15 - popq %r14 - popq %r13 - popq %r12 - popq %rbx - popq %rbp - .byte 0xf3,0xc3 -.size ecp_nistz256_point_add_affinex,.-ecp_nistz256_point_add_affinex diff --git a/deps/openssl/asm/x64-elf-gas/modes/aesni-gcm-x86_64.s b/deps/openssl/asm/x64-elf-gas/modes/aesni-gcm-x86_64.s index 4e82736a3eaf3a..35ebd9b4e09076 100644 --- a/deps/openssl/asm/x64-elf-gas/modes/aesni-gcm-x86_64.s +++ b/deps/openssl/asm/x64-elf-gas/modes/aesni-gcm-x86_64.s @@ -1,753 +1,15 @@ .text -.type _aesni_ctr32_ghash_6x,@function -.align 32 -_aesni_ctr32_ghash_6x: - vmovdqu 32(%r11),%xmm2 - subq $6,%rdx - vpxor %xmm4,%xmm4,%xmm4 - vmovdqu 0-128(%rcx),%xmm15 - vpaddb %xmm2,%xmm1,%xmm10 - vpaddb %xmm2,%xmm10,%xmm11 - vpaddb %xmm2,%xmm11,%xmm12 - vpaddb %xmm2,%xmm12,%xmm13 - vpaddb %xmm2,%xmm13,%xmm14 - vpxor %xmm15,%xmm1,%xmm9 - vmovdqu %xmm4,16+8(%rsp) - jmp .Loop6x - -.align 32 -.Loop6x: - addl $100663296,%ebx - jc .Lhandle_ctr32 - vmovdqu 0-32(%r9),%xmm3 - vpaddb %xmm2,%xmm14,%xmm1 - vpxor %xmm15,%xmm10,%xmm10 - vpxor %xmm15,%xmm11,%xmm11 - -.Lresume_ctr32: - vmovdqu %xmm1,(%r8) - vpclmulqdq $16,%xmm3,%xmm7,%xmm5 - vpxor %xmm15,%xmm12,%xmm12 - vmovups 16-128(%rcx),%xmm2 - vpclmulqdq $1,%xmm3,%xmm7,%xmm6 - xorq %r12,%r12 - cmpq %r14,%r15 - - vaesenc %xmm2,%xmm9,%xmm9 - vmovdqu 48+8(%rsp),%xmm0 - vpxor %xmm15,%xmm13,%xmm13 - vpclmulqdq $0,%xmm3,%xmm7,%xmm1 - vaesenc %xmm2,%xmm10,%xmm10 - vpxor %xmm15,%xmm14,%xmm14 - setnc %r12b - vpclmulqdq $17,%xmm3,%xmm7,%xmm7 - vaesenc %xmm2,%xmm11,%xmm11 - vmovdqu 16-32(%r9),%xmm3 - negq %r12 - vaesenc %xmm2,%xmm12,%xmm12 - vpxor %xmm5,%xmm6,%xmm6 - vpclmulqdq $0,%xmm3,%xmm0,%xmm5 - vpxor %xmm4,%xmm8,%xmm8 - vaesenc %xmm2,%xmm13,%xmm13 - vpxor %xmm5,%xmm1,%xmm4 - andq $96,%r12 - vmovups 32-128(%rcx),%xmm15 - vpclmulqdq $16,%xmm3,%xmm0,%xmm1 - vaesenc %xmm2,%xmm14,%xmm14 - - vpclmulqdq $1,%xmm3,%xmm0,%xmm2 - leaq (%r14,%r12,1),%r14 - vaesenc %xmm15,%xmm9,%xmm9 - vpxor 16+8(%rsp),%xmm8,%xmm8 - vpclmulqdq $17,%xmm3,%xmm0,%xmm3 - vmovdqu 64+8(%rsp),%xmm0 - vaesenc %xmm15,%xmm10,%xmm10 - movbeq 88(%r14),%r13 - vaesenc %xmm15,%xmm11,%xmm11 - movbeq 80(%r14),%r12 - vaesenc %xmm15,%xmm12,%xmm12 - movq %r13,32+8(%rsp) - vaesenc %xmm15,%xmm13,%xmm13 - movq %r12,40+8(%rsp) - vmovdqu 48-32(%r9),%xmm5 - vaesenc %xmm15,%xmm14,%xmm14 - - vmovups 48-128(%rcx),%xmm15 - vpxor %xmm1,%xmm6,%xmm6 - vpclmulqdq $0,%xmm5,%xmm0,%xmm1 - vaesenc %xmm15,%xmm9,%xmm9 - vpxor %xmm2,%xmm6,%xmm6 - vpclmulqdq $16,%xmm5,%xmm0,%xmm2 - vaesenc %xmm15,%xmm10,%xmm10 - vpxor %xmm3,%xmm7,%xmm7 - vpclmulqdq $1,%xmm5,%xmm0,%xmm3 - vaesenc %xmm15,%xmm11,%xmm11 - vpclmulqdq $17,%xmm5,%xmm0,%xmm5 - vmovdqu 80+8(%rsp),%xmm0 - vaesenc %xmm15,%xmm12,%xmm12 - vaesenc %xmm15,%xmm13,%xmm13 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqu 64-32(%r9),%xmm1 - vaesenc %xmm15,%xmm14,%xmm14 - - vmovups 64-128(%rcx),%xmm15 - vpxor %xmm2,%xmm6,%xmm6 - vpclmulqdq $0,%xmm1,%xmm0,%xmm2 - vaesenc %xmm15,%xmm9,%xmm9 - vpxor %xmm3,%xmm6,%xmm6 - vpclmulqdq $16,%xmm1,%xmm0,%xmm3 - vaesenc %xmm15,%xmm10,%xmm10 - movbeq 72(%r14),%r13 - vpxor %xmm5,%xmm7,%xmm7 - vpclmulqdq $1,%xmm1,%xmm0,%xmm5 - vaesenc %xmm15,%xmm11,%xmm11 - movbeq 64(%r14),%r12 - vpclmulqdq $17,%xmm1,%xmm0,%xmm1 - vmovdqu 96+8(%rsp),%xmm0 - vaesenc %xmm15,%xmm12,%xmm12 - movq %r13,48+8(%rsp) - vaesenc %xmm15,%xmm13,%xmm13 - movq %r12,56+8(%rsp) - vpxor %xmm2,%xmm4,%xmm4 - vmovdqu 96-32(%r9),%xmm2 - vaesenc %xmm15,%xmm14,%xmm14 - - vmovups 80-128(%rcx),%xmm15 - vpxor %xmm3,%xmm6,%xmm6 - vpclmulqdq $0,%xmm2,%xmm0,%xmm3 - vaesenc %xmm15,%xmm9,%xmm9 - vpxor %xmm5,%xmm6,%xmm6 - vpclmulqdq $16,%xmm2,%xmm0,%xmm5 - vaesenc %xmm15,%xmm10,%xmm10 - movbeq 56(%r14),%r13 - vpxor %xmm1,%xmm7,%xmm7 - vpclmulqdq $1,%xmm2,%xmm0,%xmm1 - vpxor 112+8(%rsp),%xmm8,%xmm8 - vaesenc %xmm15,%xmm11,%xmm11 - movbeq 48(%r14),%r12 - vpclmulqdq $17,%xmm2,%xmm0,%xmm2 - vaesenc %xmm15,%xmm12,%xmm12 - movq %r13,64+8(%rsp) - vaesenc %xmm15,%xmm13,%xmm13 - movq %r12,72+8(%rsp) - vpxor %xmm3,%xmm4,%xmm4 - vmovdqu 112-32(%r9),%xmm3 - vaesenc %xmm15,%xmm14,%xmm14 - - vmovups 96-128(%rcx),%xmm15 - vpxor %xmm5,%xmm6,%xmm6 - vpclmulqdq $16,%xmm3,%xmm8,%xmm5 - vaesenc %xmm15,%xmm9,%xmm9 - vpxor %xmm1,%xmm6,%xmm6 - vpclmulqdq $1,%xmm3,%xmm8,%xmm1 - vaesenc %xmm15,%xmm10,%xmm10 - movbeq 40(%r14),%r13 - vpxor %xmm2,%xmm7,%xmm7 - vpclmulqdq $0,%xmm3,%xmm8,%xmm2 - vaesenc %xmm15,%xmm11,%xmm11 - movbeq 32(%r14),%r12 - vpclmulqdq $17,%xmm3,%xmm8,%xmm8 - vaesenc %xmm15,%xmm12,%xmm12 - movq %r13,80+8(%rsp) - vaesenc %xmm15,%xmm13,%xmm13 - movq %r12,88+8(%rsp) - vpxor %xmm5,%xmm6,%xmm6 - vaesenc %xmm15,%xmm14,%xmm14 - vpxor %xmm1,%xmm6,%xmm6 - - vmovups 112-128(%rcx),%xmm15 - vpslldq $8,%xmm6,%xmm5 - vpxor %xmm2,%xmm4,%xmm4 - vmovdqu 16(%r11),%xmm3 - - vaesenc %xmm15,%xmm9,%xmm9 - vpxor %xmm8,%xmm7,%xmm7 - vaesenc %xmm15,%xmm10,%xmm10 - vpxor %xmm5,%xmm4,%xmm4 - movbeq 24(%r14),%r13 - vaesenc %xmm15,%xmm11,%xmm11 - movbeq 16(%r14),%r12 - vpalignr $8,%xmm4,%xmm4,%xmm0 - vpclmulqdq $16,%xmm3,%xmm4,%xmm4 - movq %r13,96+8(%rsp) - vaesenc %xmm15,%xmm12,%xmm12 - movq %r12,104+8(%rsp) - vaesenc %xmm15,%xmm13,%xmm13 - vmovups 128-128(%rcx),%xmm1 - vaesenc %xmm15,%xmm14,%xmm14 - - vaesenc %xmm1,%xmm9,%xmm9 - vmovups 144-128(%rcx),%xmm15 - vaesenc %xmm1,%xmm10,%xmm10 - vpsrldq $8,%xmm6,%xmm6 - vaesenc %xmm1,%xmm11,%xmm11 - vpxor %xmm6,%xmm7,%xmm7 - vaesenc %xmm1,%xmm12,%xmm12 - vpxor %xmm0,%xmm4,%xmm4 - movbeq 8(%r14),%r13 - vaesenc %xmm1,%xmm13,%xmm13 - movbeq 0(%r14),%r12 - vaesenc %xmm1,%xmm14,%xmm14 - vmovups 160-128(%rcx),%xmm1 - cmpl $11,%ebp - jb .Lenc_tail - - vaesenc %xmm15,%xmm9,%xmm9 - vaesenc %xmm15,%xmm10,%xmm10 - vaesenc %xmm15,%xmm11,%xmm11 - vaesenc %xmm15,%xmm12,%xmm12 - vaesenc %xmm15,%xmm13,%xmm13 - vaesenc %xmm15,%xmm14,%xmm14 - - vaesenc %xmm1,%xmm9,%xmm9 - vaesenc %xmm1,%xmm10,%xmm10 - vaesenc %xmm1,%xmm11,%xmm11 - vaesenc %xmm1,%xmm12,%xmm12 - vaesenc %xmm1,%xmm13,%xmm13 - vmovups 176-128(%rcx),%xmm15 - vaesenc %xmm1,%xmm14,%xmm14 - vmovups 192-128(%rcx),%xmm1 - je .Lenc_tail - - vaesenc %xmm15,%xmm9,%xmm9 - vaesenc %xmm15,%xmm10,%xmm10 - vaesenc %xmm15,%xmm11,%xmm11 - vaesenc %xmm15,%xmm12,%xmm12 - vaesenc %xmm15,%xmm13,%xmm13 - vaesenc %xmm15,%xmm14,%xmm14 - - vaesenc %xmm1,%xmm9,%xmm9 - vaesenc %xmm1,%xmm10,%xmm10 - vaesenc %xmm1,%xmm11,%xmm11 - vaesenc %xmm1,%xmm12,%xmm12 - vaesenc %xmm1,%xmm13,%xmm13 - vmovups 208-128(%rcx),%xmm15 - vaesenc %xmm1,%xmm14,%xmm14 - vmovups 224-128(%rcx),%xmm1 - jmp .Lenc_tail - -.align 32 -.Lhandle_ctr32: - vmovdqu (%r11),%xmm0 - vpshufb %xmm0,%xmm1,%xmm6 - vmovdqu 48(%r11),%xmm5 - vpaddd 64(%r11),%xmm6,%xmm10 - vpaddd %xmm5,%xmm6,%xmm11 - vmovdqu 0-32(%r9),%xmm3 - vpaddd %xmm5,%xmm10,%xmm12 - vpshufb %xmm0,%xmm10,%xmm10 - vpaddd %xmm5,%xmm11,%xmm13 - vpshufb %xmm0,%xmm11,%xmm11 - vpxor %xmm15,%xmm10,%xmm10 - vpaddd %xmm5,%xmm12,%xmm14 - vpshufb %xmm0,%xmm12,%xmm12 - vpxor %xmm15,%xmm11,%xmm11 - vpaddd %xmm5,%xmm13,%xmm1 - vpshufb %xmm0,%xmm13,%xmm13 - vpshufb %xmm0,%xmm14,%xmm14 - vpshufb %xmm0,%xmm1,%xmm1 - jmp .Lresume_ctr32 - -.align 32 -.Lenc_tail: - vaesenc %xmm15,%xmm9,%xmm9 - vmovdqu %xmm7,16+8(%rsp) - vpalignr $8,%xmm4,%xmm4,%xmm8 - vaesenc %xmm15,%xmm10,%xmm10 - vpclmulqdq $16,%xmm3,%xmm4,%xmm4 - vpxor 0(%rdi),%xmm1,%xmm2 - vaesenc %xmm15,%xmm11,%xmm11 - vpxor 16(%rdi),%xmm1,%xmm0 - vaesenc %xmm15,%xmm12,%xmm12 - vpxor 32(%rdi),%xmm1,%xmm5 - vaesenc %xmm15,%xmm13,%xmm13 - vpxor 48(%rdi),%xmm1,%xmm6 - vaesenc %xmm15,%xmm14,%xmm14 - vpxor 64(%rdi),%xmm1,%xmm7 - vpxor 80(%rdi),%xmm1,%xmm3 - vmovdqu (%r8),%xmm1 - - vaesenclast %xmm2,%xmm9,%xmm9 - vmovdqu 32(%r11),%xmm2 - vaesenclast %xmm0,%xmm10,%xmm10 - vpaddb %xmm2,%xmm1,%xmm0 - movq %r13,112+8(%rsp) - leaq 96(%rdi),%rdi - vaesenclast %xmm5,%xmm11,%xmm11 - vpaddb %xmm2,%xmm0,%xmm5 - movq %r12,120+8(%rsp) - leaq 96(%rsi),%rsi - vmovdqu 0-128(%rcx),%xmm15 - vaesenclast %xmm6,%xmm12,%xmm12 - vpaddb %xmm2,%xmm5,%xmm6 - vaesenclast %xmm7,%xmm13,%xmm13 - vpaddb %xmm2,%xmm6,%xmm7 - vaesenclast %xmm3,%xmm14,%xmm14 - vpaddb %xmm2,%xmm7,%xmm3 - - addq $96,%r10 - subq $6,%rdx - jc .L6x_done - - vmovups %xmm9,-96(%rsi) - vpxor %xmm15,%xmm1,%xmm9 - vmovups %xmm10,-80(%rsi) - vmovdqa %xmm0,%xmm10 - vmovups %xmm11,-64(%rsi) - vmovdqa %xmm5,%xmm11 - vmovups %xmm12,-48(%rsi) - vmovdqa %xmm6,%xmm12 - vmovups %xmm13,-32(%rsi) - vmovdqa %xmm7,%xmm13 - vmovups %xmm14,-16(%rsi) - vmovdqa %xmm3,%xmm14 - vmovdqu 32+8(%rsp),%xmm7 - jmp .Loop6x - -.L6x_done: - vpxor 16+8(%rsp),%xmm8,%xmm8 - vpxor %xmm4,%xmm8,%xmm8 - +.globl aesni_gcm_encrypt +.type aesni_gcm_encrypt,@function +aesni_gcm_encrypt: + xorl %eax,%eax .byte 0xf3,0xc3 -.size _aesni_ctr32_ghash_6x,.-_aesni_ctr32_ghash_6x +.size aesni_gcm_encrypt,.-aesni_gcm_encrypt + .globl aesni_gcm_decrypt .type aesni_gcm_decrypt,@function -.align 32 aesni_gcm_decrypt: - xorq %r10,%r10 - cmpq $96,%rdx - jb .Lgcm_dec_abort - - leaq (%rsp),%rax - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - vzeroupper - - vmovdqu (%r8),%xmm1 - addq $-128,%rsp - movl 12(%r8),%ebx - leaq .Lbswap_mask(%rip),%r11 - leaq -128(%rcx),%r14 - movq $3968,%r15 - vmovdqu (%r9),%xmm8 - andq $-128,%rsp - vmovdqu (%r11),%xmm0 - leaq 128(%rcx),%rcx - leaq 32+32(%r9),%r9 - movl 240-128(%rcx),%ebp - vpshufb %xmm0,%xmm8,%xmm8 - - andq %r15,%r14 - andq %rsp,%r15 - subq %r14,%r15 - jc .Ldec_no_key_aliasing - cmpq $768,%r15 - jnc .Ldec_no_key_aliasing - subq %r15,%rsp -.Ldec_no_key_aliasing: - - vmovdqu 80(%rdi),%xmm7 - leaq (%rdi),%r14 - vmovdqu 64(%rdi),%xmm4 - leaq -192(%rdi,%rdx,1),%r15 - vmovdqu 48(%rdi),%xmm5 - shrq $4,%rdx - xorq %r10,%r10 - vmovdqu 32(%rdi),%xmm6 - vpshufb %xmm0,%xmm7,%xmm7 - vmovdqu 16(%rdi),%xmm2 - vpshufb %xmm0,%xmm4,%xmm4 - vmovdqu (%rdi),%xmm3 - vpshufb %xmm0,%xmm5,%xmm5 - vmovdqu %xmm4,48(%rsp) - vpshufb %xmm0,%xmm6,%xmm6 - vmovdqu %xmm5,64(%rsp) - vpshufb %xmm0,%xmm2,%xmm2 - vmovdqu %xmm6,80(%rsp) - vpshufb %xmm0,%xmm3,%xmm3 - vmovdqu %xmm2,96(%rsp) - vmovdqu %xmm3,112(%rsp) - - call _aesni_ctr32_ghash_6x - - vmovups %xmm9,-96(%rsi) - vmovups %xmm10,-80(%rsi) - vmovups %xmm11,-64(%rsi) - vmovups %xmm12,-48(%rsi) - vmovups %xmm13,-32(%rsi) - vmovups %xmm14,-16(%rsi) - - vpshufb (%r11),%xmm8,%xmm8 - vmovdqu %xmm8,-64(%r9) - - vzeroupper - movq -48(%rax),%r15 - movq -40(%rax),%r14 - movq -32(%rax),%r13 - movq -24(%rax),%r12 - movq -16(%rax),%rbp - movq -8(%rax),%rbx - leaq (%rax),%rsp -.Lgcm_dec_abort: - movq %r10,%rax + xorl %eax,%eax .byte 0xf3,0xc3 .size aesni_gcm_decrypt,.-aesni_gcm_decrypt -.type _aesni_ctr32_6x,@function -.align 32 -_aesni_ctr32_6x: - vmovdqu 0-128(%rcx),%xmm4 - vmovdqu 32(%r11),%xmm2 - leaq -1(%rbp),%r13 - vmovups 16-128(%rcx),%xmm15 - leaq 32-128(%rcx),%r12 - vpxor %xmm4,%xmm1,%xmm9 - addl $100663296,%ebx - jc .Lhandle_ctr32_2 - vpaddb %xmm2,%xmm1,%xmm10 - vpaddb %xmm2,%xmm10,%xmm11 - vpxor %xmm4,%xmm10,%xmm10 - vpaddb %xmm2,%xmm11,%xmm12 - vpxor %xmm4,%xmm11,%xmm11 - vpaddb %xmm2,%xmm12,%xmm13 - vpxor %xmm4,%xmm12,%xmm12 - vpaddb %xmm2,%xmm13,%xmm14 - vpxor %xmm4,%xmm13,%xmm13 - vpaddb %xmm2,%xmm14,%xmm1 - vpxor %xmm4,%xmm14,%xmm14 - jmp .Loop_ctr32 - -.align 16 -.Loop_ctr32: - vaesenc %xmm15,%xmm9,%xmm9 - vaesenc %xmm15,%xmm10,%xmm10 - vaesenc %xmm15,%xmm11,%xmm11 - vaesenc %xmm15,%xmm12,%xmm12 - vaesenc %xmm15,%xmm13,%xmm13 - vaesenc %xmm15,%xmm14,%xmm14 - vmovups (%r12),%xmm15 - leaq 16(%r12),%r12 - decl %r13d - jnz .Loop_ctr32 - - vmovdqu (%r12),%xmm3 - vaesenc %xmm15,%xmm9,%xmm9 - vpxor 0(%rdi),%xmm3,%xmm4 - vaesenc %xmm15,%xmm10,%xmm10 - vpxor 16(%rdi),%xmm3,%xmm5 - vaesenc %xmm15,%xmm11,%xmm11 - vpxor 32(%rdi),%xmm3,%xmm6 - vaesenc %xmm15,%xmm12,%xmm12 - vpxor 48(%rdi),%xmm3,%xmm8 - vaesenc %xmm15,%xmm13,%xmm13 - vpxor 64(%rdi),%xmm3,%xmm2 - vaesenc %xmm15,%xmm14,%xmm14 - vpxor 80(%rdi),%xmm3,%xmm3 - leaq 96(%rdi),%rdi - - vaesenclast %xmm4,%xmm9,%xmm9 - vaesenclast %xmm5,%xmm10,%xmm10 - vaesenclast %xmm6,%xmm11,%xmm11 - vaesenclast %xmm8,%xmm12,%xmm12 - vaesenclast %xmm2,%xmm13,%xmm13 - vaesenclast %xmm3,%xmm14,%xmm14 - vmovups %xmm9,0(%rsi) - vmovups %xmm10,16(%rsi) - vmovups %xmm11,32(%rsi) - vmovups %xmm12,48(%rsi) - vmovups %xmm13,64(%rsi) - vmovups %xmm14,80(%rsi) - leaq 96(%rsi),%rsi - - .byte 0xf3,0xc3 -.align 32 -.Lhandle_ctr32_2: - vpshufb %xmm0,%xmm1,%xmm6 - vmovdqu 48(%r11),%xmm5 - vpaddd 64(%r11),%xmm6,%xmm10 - vpaddd %xmm5,%xmm6,%xmm11 - vpaddd %xmm5,%xmm10,%xmm12 - vpshufb %xmm0,%xmm10,%xmm10 - vpaddd %xmm5,%xmm11,%xmm13 - vpshufb %xmm0,%xmm11,%xmm11 - vpxor %xmm4,%xmm10,%xmm10 - vpaddd %xmm5,%xmm12,%xmm14 - vpshufb %xmm0,%xmm12,%xmm12 - vpxor %xmm4,%xmm11,%xmm11 - vpaddd %xmm5,%xmm13,%xmm1 - vpshufb %xmm0,%xmm13,%xmm13 - vpxor %xmm4,%xmm12,%xmm12 - vpshufb %xmm0,%xmm14,%xmm14 - vpxor %xmm4,%xmm13,%xmm13 - vpshufb %xmm0,%xmm1,%xmm1 - vpxor %xmm4,%xmm14,%xmm14 - jmp .Loop_ctr32 -.size _aesni_ctr32_6x,.-_aesni_ctr32_6x - -.globl aesni_gcm_encrypt -.type aesni_gcm_encrypt,@function -.align 32 -aesni_gcm_encrypt: - xorq %r10,%r10 - cmpq $288,%rdx - jb .Lgcm_enc_abort - - leaq (%rsp),%rax - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - vzeroupper - - vmovdqu (%r8),%xmm1 - addq $-128,%rsp - movl 12(%r8),%ebx - leaq .Lbswap_mask(%rip),%r11 - leaq -128(%rcx),%r14 - movq $3968,%r15 - leaq 128(%rcx),%rcx - vmovdqu (%r11),%xmm0 - andq $-128,%rsp - movl 240-128(%rcx),%ebp - - andq %r15,%r14 - andq %rsp,%r15 - subq %r14,%r15 - jc .Lenc_no_key_aliasing - cmpq $768,%r15 - jnc .Lenc_no_key_aliasing - subq %r15,%rsp -.Lenc_no_key_aliasing: - - leaq (%rsi),%r14 - leaq -192(%rsi,%rdx,1),%r15 - shrq $4,%rdx - - call _aesni_ctr32_6x - vpshufb %xmm0,%xmm9,%xmm8 - vpshufb %xmm0,%xmm10,%xmm2 - vmovdqu %xmm8,112(%rsp) - vpshufb %xmm0,%xmm11,%xmm4 - vmovdqu %xmm2,96(%rsp) - vpshufb %xmm0,%xmm12,%xmm5 - vmovdqu %xmm4,80(%rsp) - vpshufb %xmm0,%xmm13,%xmm6 - vmovdqu %xmm5,64(%rsp) - vpshufb %xmm0,%xmm14,%xmm7 - vmovdqu %xmm6,48(%rsp) - - call _aesni_ctr32_6x - - vmovdqu (%r9),%xmm8 - leaq 32+32(%r9),%r9 - subq $12,%rdx - movq $192,%r10 - vpshufb %xmm0,%xmm8,%xmm8 - - call _aesni_ctr32_ghash_6x - vmovdqu 32(%rsp),%xmm7 - vmovdqu (%r11),%xmm0 - vmovdqu 0-32(%r9),%xmm3 - vpunpckhqdq %xmm7,%xmm7,%xmm1 - vmovdqu 32-32(%r9),%xmm15 - vmovups %xmm9,-96(%rsi) - vpshufb %xmm0,%xmm9,%xmm9 - vpxor %xmm7,%xmm1,%xmm1 - vmovups %xmm10,-80(%rsi) - vpshufb %xmm0,%xmm10,%xmm10 - vmovups %xmm11,-64(%rsi) - vpshufb %xmm0,%xmm11,%xmm11 - vmovups %xmm12,-48(%rsi) - vpshufb %xmm0,%xmm12,%xmm12 - vmovups %xmm13,-32(%rsi) - vpshufb %xmm0,%xmm13,%xmm13 - vmovups %xmm14,-16(%rsi) - vpshufb %xmm0,%xmm14,%xmm14 - vmovdqu %xmm9,16(%rsp) - vmovdqu 48(%rsp),%xmm6 - vmovdqu 16-32(%r9),%xmm0 - vpunpckhqdq %xmm6,%xmm6,%xmm2 - vpclmulqdq $0,%xmm3,%xmm7,%xmm5 - vpxor %xmm6,%xmm2,%xmm2 - vpclmulqdq $17,%xmm3,%xmm7,%xmm7 - vpclmulqdq $0,%xmm15,%xmm1,%xmm1 - - vmovdqu 64(%rsp),%xmm9 - vpclmulqdq $0,%xmm0,%xmm6,%xmm4 - vmovdqu 48-32(%r9),%xmm3 - vpxor %xmm5,%xmm4,%xmm4 - vpunpckhqdq %xmm9,%xmm9,%xmm5 - vpclmulqdq $17,%xmm0,%xmm6,%xmm6 - vpxor %xmm9,%xmm5,%xmm5 - vpxor %xmm7,%xmm6,%xmm6 - vpclmulqdq $16,%xmm15,%xmm2,%xmm2 - vmovdqu 80-32(%r9),%xmm15 - vpxor %xmm1,%xmm2,%xmm2 - - vmovdqu 80(%rsp),%xmm1 - vpclmulqdq $0,%xmm3,%xmm9,%xmm7 - vmovdqu 64-32(%r9),%xmm0 - vpxor %xmm4,%xmm7,%xmm7 - vpunpckhqdq %xmm1,%xmm1,%xmm4 - vpclmulqdq $17,%xmm3,%xmm9,%xmm9 - vpxor %xmm1,%xmm4,%xmm4 - vpxor %xmm6,%xmm9,%xmm9 - vpclmulqdq $0,%xmm15,%xmm5,%xmm5 - vpxor %xmm2,%xmm5,%xmm5 - - vmovdqu 96(%rsp),%xmm2 - vpclmulqdq $0,%xmm0,%xmm1,%xmm6 - vmovdqu 96-32(%r9),%xmm3 - vpxor %xmm7,%xmm6,%xmm6 - vpunpckhqdq %xmm2,%xmm2,%xmm7 - vpclmulqdq $17,%xmm0,%xmm1,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpxor %xmm9,%xmm1,%xmm1 - vpclmulqdq $16,%xmm15,%xmm4,%xmm4 - vmovdqu 128-32(%r9),%xmm15 - vpxor %xmm5,%xmm4,%xmm4 - - vpxor 112(%rsp),%xmm8,%xmm8 - vpclmulqdq $0,%xmm3,%xmm2,%xmm5 - vmovdqu 112-32(%r9),%xmm0 - vpunpckhqdq %xmm8,%xmm8,%xmm9 - vpxor %xmm6,%xmm5,%xmm5 - vpclmulqdq $17,%xmm3,%xmm2,%xmm2 - vpxor %xmm8,%xmm9,%xmm9 - vpxor %xmm1,%xmm2,%xmm2 - vpclmulqdq $0,%xmm15,%xmm7,%xmm7 - vpxor %xmm4,%xmm7,%xmm4 - - vpclmulqdq $0,%xmm0,%xmm8,%xmm6 - vmovdqu 0-32(%r9),%xmm3 - vpunpckhqdq %xmm14,%xmm14,%xmm1 - vpclmulqdq $17,%xmm0,%xmm8,%xmm8 - vpxor %xmm14,%xmm1,%xmm1 - vpxor %xmm5,%xmm6,%xmm5 - vpclmulqdq $16,%xmm15,%xmm9,%xmm9 - vmovdqu 32-32(%r9),%xmm15 - vpxor %xmm2,%xmm8,%xmm7 - vpxor %xmm4,%xmm9,%xmm6 - - vmovdqu 16-32(%r9),%xmm0 - vpxor %xmm5,%xmm7,%xmm9 - vpclmulqdq $0,%xmm3,%xmm14,%xmm4 - vpxor %xmm9,%xmm6,%xmm6 - vpunpckhqdq %xmm13,%xmm13,%xmm2 - vpclmulqdq $17,%xmm3,%xmm14,%xmm14 - vpxor %xmm13,%xmm2,%xmm2 - vpslldq $8,%xmm6,%xmm9 - vpclmulqdq $0,%xmm15,%xmm1,%xmm1 - vpxor %xmm9,%xmm5,%xmm8 - vpsrldq $8,%xmm6,%xmm6 - vpxor %xmm6,%xmm7,%xmm7 - - vpclmulqdq $0,%xmm0,%xmm13,%xmm5 - vmovdqu 48-32(%r9),%xmm3 - vpxor %xmm4,%xmm5,%xmm5 - vpunpckhqdq %xmm12,%xmm12,%xmm9 - vpclmulqdq $17,%xmm0,%xmm13,%xmm13 - vpxor %xmm12,%xmm9,%xmm9 - vpxor %xmm14,%xmm13,%xmm13 - vpalignr $8,%xmm8,%xmm8,%xmm14 - vpclmulqdq $16,%xmm15,%xmm2,%xmm2 - vmovdqu 80-32(%r9),%xmm15 - vpxor %xmm1,%xmm2,%xmm2 - - vpclmulqdq $0,%xmm3,%xmm12,%xmm4 - vmovdqu 64-32(%r9),%xmm0 - vpxor %xmm5,%xmm4,%xmm4 - vpunpckhqdq %xmm11,%xmm11,%xmm1 - vpclmulqdq $17,%xmm3,%xmm12,%xmm12 - vpxor %xmm11,%xmm1,%xmm1 - vpxor %xmm13,%xmm12,%xmm12 - vxorps 16(%rsp),%xmm7,%xmm7 - vpclmulqdq $0,%xmm15,%xmm9,%xmm9 - vpxor %xmm2,%xmm9,%xmm9 - - vpclmulqdq $16,16(%r11),%xmm8,%xmm8 - vxorps %xmm14,%xmm8,%xmm8 - - vpclmulqdq $0,%xmm0,%xmm11,%xmm5 - vmovdqu 96-32(%r9),%xmm3 - vpxor %xmm4,%xmm5,%xmm5 - vpunpckhqdq %xmm10,%xmm10,%xmm2 - vpclmulqdq $17,%xmm0,%xmm11,%xmm11 - vpxor %xmm10,%xmm2,%xmm2 - vpalignr $8,%xmm8,%xmm8,%xmm14 - vpxor %xmm12,%xmm11,%xmm11 - vpclmulqdq $16,%xmm15,%xmm1,%xmm1 - vmovdqu 128-32(%r9),%xmm15 - vpxor %xmm9,%xmm1,%xmm1 - - vxorps %xmm7,%xmm14,%xmm14 - vpclmulqdq $16,16(%r11),%xmm8,%xmm8 - vxorps %xmm14,%xmm8,%xmm8 - - vpclmulqdq $0,%xmm3,%xmm10,%xmm4 - vmovdqu 112-32(%r9),%xmm0 - vpxor %xmm5,%xmm4,%xmm4 - vpunpckhqdq %xmm8,%xmm8,%xmm9 - vpclmulqdq $17,%xmm3,%xmm10,%xmm10 - vpxor %xmm8,%xmm9,%xmm9 - vpxor %xmm11,%xmm10,%xmm10 - vpclmulqdq $0,%xmm15,%xmm2,%xmm2 - vpxor %xmm1,%xmm2,%xmm2 - - vpclmulqdq $0,%xmm0,%xmm8,%xmm5 - vpclmulqdq $17,%xmm0,%xmm8,%xmm7 - vpxor %xmm4,%xmm5,%xmm5 - vpclmulqdq $16,%xmm15,%xmm9,%xmm6 - vpxor %xmm10,%xmm7,%xmm7 - vpxor %xmm2,%xmm6,%xmm6 - - vpxor %xmm5,%xmm7,%xmm4 - vpxor %xmm4,%xmm6,%xmm6 - vpslldq $8,%xmm6,%xmm1 - vmovdqu 16(%r11),%xmm3 - vpsrldq $8,%xmm6,%xmm6 - vpxor %xmm1,%xmm5,%xmm8 - vpxor %xmm6,%xmm7,%xmm7 - - vpalignr $8,%xmm8,%xmm8,%xmm2 - vpclmulqdq $16,%xmm3,%xmm8,%xmm8 - vpxor %xmm2,%xmm8,%xmm8 - - vpalignr $8,%xmm8,%xmm8,%xmm2 - vpclmulqdq $16,%xmm3,%xmm8,%xmm8 - vpxor %xmm7,%xmm2,%xmm2 - vpxor %xmm2,%xmm8,%xmm8 - vpshufb (%r11),%xmm8,%xmm8 - vmovdqu %xmm8,-64(%r9) - - vzeroupper - movq -48(%rax),%r15 - movq -40(%rax),%r14 - movq -32(%rax),%r13 - movq -24(%rax),%r12 - movq -16(%rax),%rbp - movq -8(%rax),%rbx - leaq (%rax),%rsp -.Lgcm_enc_abort: - movq %r10,%rax - .byte 0xf3,0xc3 -.size aesni_gcm_encrypt,.-aesni_gcm_encrypt -.align 64 -.Lbswap_mask: -.byte 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 -.Lpoly: -.byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xc2 -.Lone_msb: -.byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 -.Ltwo_lsb: -.byte 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -.Lone_lsb: -.byte 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -.byte 65,69,83,45,78,73,32,71,67,77,32,109,111,100,117,108,101,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 -.align 64 diff --git a/deps/openssl/asm/x64-elf-gas/modes/ghash-x86_64.s b/deps/openssl/asm/x64-elf-gas/modes/ghash-x86_64.s index 1cfe19cb55ecf5..e9ffdc2de2ea85 100644 --- a/deps/openssl/asm/x64-elf-gas/modes/ghash-x86_64.s +++ b/deps/openssl/asm/x64-elf-gas/modes/ghash-x86_64.s @@ -20,14 +20,14 @@ gcm_gmult_4bit: movq $14,%rcx movq 8(%rsi,%rax,1),%r8 movq (%rsi,%rax,1),%r9 - andb $240,%bl + andb $0xf0,%bl movq %r8,%rdx jmp .Loop1 .align 16 .Loop1: shrq $4,%r8 - andq $15,%rdx + andq $0xf,%rdx movq %r9,%r10 movb (%rdi,%rcx,1),%al shrq $4,%r9 @@ -43,13 +43,13 @@ gcm_gmult_4bit: js .Lbreak1 shrq $4,%r8 - andq $15,%rdx + andq $0xf,%rdx movq %r9,%r10 shrq $4,%r9 xorq 8(%rsi,%rax,1),%r8 shlq $60,%r10 xorq (%rsi,%rax,1),%r9 - andb $240,%bl + andb $0xf0,%bl xorq (%r11,%rdx,8),%r9 movq %r8,%rdx xorq %r10,%r8 @@ -58,19 +58,19 @@ gcm_gmult_4bit: .align 16 .Lbreak1: shrq $4,%r8 - andq $15,%rdx + andq $0xf,%rdx movq %r9,%r10 shrq $4,%r9 xorq 8(%rsi,%rax,1),%r8 shlq $60,%r10 xorq (%rsi,%rax,1),%r9 - andb $240,%bl + andb $0xf0,%bl xorq (%r11,%rdx,8),%r9 movq %r8,%rdx xorq %r10,%r8 shrq $4,%r8 - andq $15,%rdx + andq $0xf,%rdx movq %r9,%r10 shrq $4,%r9 xorq 8(%rsi,%rbx,1),%r8 @@ -661,10 +661,10 @@ gcm_ghash_4bit: gcm_init_clmul: .L_init_clmul: movdqu (%rsi),%xmm2 - pshufd $78,%xmm2,%xmm2 + pshufd $0b01001110,%xmm2,%xmm2 - pshufd $255,%xmm2,%xmm4 + pshufd $0b11111111,%xmm2,%xmm4 movdqa %xmm2,%xmm3 psllq $1,%xmm2 pxor %xmm5,%xmm5 @@ -678,11 +678,11 @@ gcm_init_clmul: pxor %xmm5,%xmm2 - pshufd $78,%xmm2,%xmm6 + pshufd $0b01001110,%xmm2,%xmm6 movdqa %xmm2,%xmm0 pxor %xmm2,%xmm6 movdqa %xmm0,%xmm1 - pshufd $78,%xmm0,%xmm3 + pshufd $0b01001110,%xmm0,%xmm3 pxor %xmm0,%xmm3 .byte 102,15,58,68,194,0 .byte 102,15,58,68,202,17 @@ -718,8 +718,8 @@ gcm_init_clmul: pxor %xmm4,%xmm0 psrlq $1,%xmm0 pxor %xmm1,%xmm0 - pshufd $78,%xmm2,%xmm3 - pshufd $78,%xmm0,%xmm4 + pshufd $0b01001110,%xmm2,%xmm3 + pshufd $0b01001110,%xmm0,%xmm4 pxor %xmm2,%xmm3 movdqu %xmm2,0(%rdi) pxor %xmm0,%xmm4 @@ -727,7 +727,7 @@ gcm_init_clmul: .byte 102,15,58,15,227,8 movdqu %xmm4,32(%rdi) movdqa %xmm0,%xmm1 - pshufd $78,%xmm0,%xmm3 + pshufd $0b01001110,%xmm0,%xmm3 pxor %xmm0,%xmm3 .byte 102,15,58,68,194,0 .byte 102,15,58,68,202,17 @@ -765,7 +765,7 @@ gcm_init_clmul: pxor %xmm1,%xmm0 movdqa %xmm0,%xmm5 movdqa %xmm0,%xmm1 - pshufd $78,%xmm0,%xmm3 + pshufd $0b01001110,%xmm0,%xmm3 pxor %xmm0,%xmm3 .byte 102,15,58,68,194,0 .byte 102,15,58,68,202,17 @@ -801,8 +801,8 @@ gcm_init_clmul: pxor %xmm4,%xmm0 psrlq $1,%xmm0 pxor %xmm1,%xmm0 - pshufd $78,%xmm5,%xmm3 - pshufd $78,%xmm0,%xmm4 + pshufd $0b01001110,%xmm5,%xmm3 + pshufd $0b01001110,%xmm0,%xmm4 pxor %xmm5,%xmm3 movdqu %xmm5,48(%rdi) pxor %xmm0,%xmm4 @@ -822,7 +822,7 @@ gcm_gmult_clmul: movdqu 32(%rsi),%xmm4 .byte 102,15,56,0,197 movdqa %xmm0,%xmm1 - pshufd $78,%xmm0,%xmm3 + pshufd $0b01001110,%xmm0,%xmm3 pxor %xmm0,%xmm3 .byte 102,15,58,68,194,0 .byte 102,15,58,68,202,17 @@ -874,20 +874,20 @@ gcm_ghash_clmul: movdqu 32(%rsi),%xmm7 .byte 102,65,15,56,0,194 - subq $16,%rcx + subq $0x10,%rcx jz .Lodd_tail movdqu 16(%rsi),%xmm6 movl OPENSSL_ia32cap_P+4(%rip),%eax - cmpq $48,%rcx + cmpq $0x30,%rcx jb .Lskip4x andl $71303168,%eax cmpl $4194304,%eax je .Lskip4x - subq $48,%rcx - movq $11547335547999543296,%rax + subq $0x30,%rcx + movq $0xA040608020C0E000,%rax movdqu 48(%rsi),%xmm14 movdqu 64(%rsi),%xmm15 @@ -899,14 +899,14 @@ gcm_ghash_clmul: .byte 102,65,15,56,0,218 .byte 102,69,15,56,0,218 movdqa %xmm3,%xmm5 - pshufd $78,%xmm3,%xmm4 + pshufd $0b01001110,%xmm3,%xmm4 pxor %xmm3,%xmm4 .byte 102,15,58,68,218,0 .byte 102,15,58,68,234,17 .byte 102,15,58,68,231,0 movdqa %xmm11,%xmm13 - pshufd $78,%xmm11,%xmm12 + pshufd $0b01001110,%xmm11,%xmm12 pxor %xmm11,%xmm12 .byte 102,68,15,58,68,222,0 .byte 102,68,15,58,68,238,17 @@ -921,12 +921,12 @@ gcm_ghash_clmul: .byte 102,69,15,56,0,218 .byte 102,69,15,56,0,194 movdqa %xmm11,%xmm13 - pshufd $78,%xmm11,%xmm12 + pshufd $0b01001110,%xmm11,%xmm12 pxor %xmm8,%xmm0 pxor %xmm11,%xmm12 .byte 102,69,15,58,68,222,0 movdqa %xmm0,%xmm1 - pshufd $78,%xmm0,%xmm8 + pshufd $0b01001110,%xmm0,%xmm8 pxor %xmm0,%xmm8 .byte 102,69,15,58,68,238,17 .byte 102,68,15,58,68,231,0 @@ -934,7 +934,7 @@ gcm_ghash_clmul: xorps %xmm13,%xmm5 leaq 64(%rdx),%rdx - subq $64,%rcx + subq $0x40,%rcx jc .Ltail4x jmp .Lmod4_loop @@ -949,14 +949,14 @@ gcm_ghash_clmul: movdqu 32(%rdx),%xmm3 movdqa %xmm11,%xmm13 .byte 102,68,15,58,68,199,16 - pshufd $78,%xmm11,%xmm12 + pshufd $0b01001110,%xmm11,%xmm12 xorps %xmm5,%xmm1 pxor %xmm11,%xmm12 .byte 102,65,15,56,0,218 movups 32(%rsi),%xmm7 xorps %xmm4,%xmm8 .byte 102,68,15,58,68,218,0 - pshufd $78,%xmm3,%xmm4 + pshufd $0b01001110,%xmm3,%xmm4 pxor %xmm0,%xmm8 movdqa %xmm3,%xmm5 @@ -1000,7 +1000,7 @@ gcm_ghash_clmul: movdqa %xmm11,%xmm13 pxor %xmm12,%xmm4 - pshufd $78,%xmm11,%xmm12 + pshufd $0b01001110,%xmm11,%xmm12 pxor %xmm9,%xmm0 pxor %xmm8,%xmm1 pxor %xmm11,%xmm12 @@ -1010,14 +1010,14 @@ gcm_ghash_clmul: movdqa %xmm0,%xmm1 .byte 102,69,15,58,68,238,17 xorps %xmm11,%xmm3 - pshufd $78,%xmm0,%xmm8 + pshufd $0b01001110,%xmm0,%xmm8 pxor %xmm0,%xmm8 .byte 102,68,15,58,68,231,0 xorps %xmm13,%xmm5 leaq 64(%rdx),%rdx - subq $64,%rcx + subq $0x40,%rcx jnc .Lmod4_loop .Ltail4x: @@ -1061,10 +1061,10 @@ gcm_ghash_clmul: pxor %xmm4,%xmm0 psrlq $1,%xmm0 pxor %xmm1,%xmm0 - addq $64,%rcx + addq $0x40,%rcx jz .Ldone movdqu 32(%rsi),%xmm7 - subq $16,%rcx + subq $0x10,%rcx jz .Lodd_tail .Lskip4x: @@ -1079,7 +1079,7 @@ gcm_ghash_clmul: pxor %xmm8,%xmm0 movdqa %xmm3,%xmm5 - pshufd $78,%xmm3,%xmm4 + pshufd $0b01001110,%xmm3,%xmm4 pxor %xmm3,%xmm4 .byte 102,15,58,68,218,0 .byte 102,15,58,68,234,17 @@ -1087,7 +1087,7 @@ gcm_ghash_clmul: leaq 32(%rdx),%rdx nop - subq $32,%rcx + subq $0x20,%rcx jbe .Leven_tail nop jmp .Lmod_loop @@ -1096,7 +1096,7 @@ gcm_ghash_clmul: .Lmod_loop: movdqa %xmm0,%xmm1 movdqa %xmm4,%xmm8 - pshufd $78,%xmm0,%xmm4 + pshufd $0b01001110,%xmm0,%xmm4 pxor %xmm0,%xmm4 .byte 102,15,58,68,198,0 @@ -1134,7 +1134,7 @@ gcm_ghash_clmul: pslldq $8,%xmm0 psrldq $8,%xmm8 pxor %xmm9,%xmm0 - pshufd $78,%xmm5,%xmm4 + pshufd $0b01001110,%xmm5,%xmm4 pxor %xmm8,%xmm1 pxor %xmm5,%xmm4 @@ -1150,13 +1150,13 @@ gcm_ghash_clmul: .byte 102,15,58,68,231,0 pxor %xmm1,%xmm0 - subq $32,%rcx + subq $0x20,%rcx ja .Lmod_loop .Leven_tail: movdqa %xmm0,%xmm1 movdqa %xmm4,%xmm8 - pshufd $78,%xmm0,%xmm4 + pshufd $0b01001110,%xmm0,%xmm4 pxor %xmm0,%xmm4 .byte 102,15,58,68,198,0 @@ -1204,7 +1204,7 @@ gcm_ghash_clmul: .byte 102,69,15,56,0,194 pxor %xmm8,%xmm0 movdqa %xmm0,%xmm1 - pshufd $78,%xmm0,%xmm3 + pshufd $0b01001110,%xmm0,%xmm3 pxor %xmm0,%xmm3 .byte 102,15,58,68,194,0 .byte 102,15,58,68,202,17 @@ -1249,108 +1249,7 @@ gcm_ghash_clmul: .type gcm_init_avx,@function .align 32 gcm_init_avx: - vzeroupper - - vmovdqu (%rsi),%xmm2 - vpshufd $78,%xmm2,%xmm2 - - - vpshufd $255,%xmm2,%xmm4 - vpsrlq $63,%xmm2,%xmm3 - vpsllq $1,%xmm2,%xmm2 - vpxor %xmm5,%xmm5,%xmm5 - vpcmpgtd %xmm4,%xmm5,%xmm5 - vpslldq $8,%xmm3,%xmm3 - vpor %xmm3,%xmm2,%xmm2 - - - vpand .L0x1c2_polynomial(%rip),%xmm5,%xmm5 - vpxor %xmm5,%xmm2,%xmm2 - - vpunpckhqdq %xmm2,%xmm2,%xmm6 - vmovdqa %xmm2,%xmm0 - vpxor %xmm2,%xmm6,%xmm6 - movq $4,%r10 - jmp .Linit_start_avx -.align 32 -.Linit_loop_avx: - vpalignr $8,%xmm3,%xmm4,%xmm5 - vmovdqu %xmm5,-16(%rdi) - vpunpckhqdq %xmm0,%xmm0,%xmm3 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $17,%xmm2,%xmm0,%xmm1 - vpclmulqdq $0,%xmm2,%xmm0,%xmm0 - vpclmulqdq $0,%xmm6,%xmm3,%xmm3 - vpxor %xmm0,%xmm1,%xmm4 - vpxor %xmm4,%xmm3,%xmm3 - - vpslldq $8,%xmm3,%xmm4 - vpsrldq $8,%xmm3,%xmm3 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm3,%xmm1,%xmm1 - vpsllq $57,%xmm0,%xmm3 - vpsllq $62,%xmm0,%xmm4 - vpxor %xmm3,%xmm4,%xmm4 - vpsllq $63,%xmm0,%xmm3 - vpxor %xmm3,%xmm4,%xmm4 - vpslldq $8,%xmm4,%xmm3 - vpsrldq $8,%xmm4,%xmm4 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm4,%xmm1,%xmm1 - - vpsrlq $1,%xmm0,%xmm4 - vpxor %xmm0,%xmm1,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpsrlq $5,%xmm4,%xmm4 - vpxor %xmm4,%xmm0,%xmm0 - vpsrlq $1,%xmm0,%xmm0 - vpxor %xmm1,%xmm0,%xmm0 -.Linit_start_avx: - vmovdqa %xmm0,%xmm5 - vpunpckhqdq %xmm0,%xmm0,%xmm3 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $17,%xmm2,%xmm0,%xmm1 - vpclmulqdq $0,%xmm2,%xmm0,%xmm0 - vpclmulqdq $0,%xmm6,%xmm3,%xmm3 - vpxor %xmm0,%xmm1,%xmm4 - vpxor %xmm4,%xmm3,%xmm3 - - vpslldq $8,%xmm3,%xmm4 - vpsrldq $8,%xmm3,%xmm3 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm3,%xmm1,%xmm1 - vpsllq $57,%xmm0,%xmm3 - vpsllq $62,%xmm0,%xmm4 - vpxor %xmm3,%xmm4,%xmm4 - vpsllq $63,%xmm0,%xmm3 - vpxor %xmm3,%xmm4,%xmm4 - vpslldq $8,%xmm4,%xmm3 - vpsrldq $8,%xmm4,%xmm4 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm4,%xmm1,%xmm1 - - vpsrlq $1,%xmm0,%xmm4 - vpxor %xmm0,%xmm1,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpsrlq $5,%xmm4,%xmm4 - vpxor %xmm4,%xmm0,%xmm0 - vpsrlq $1,%xmm0,%xmm0 - vpxor %xmm1,%xmm0,%xmm0 - vpshufd $78,%xmm5,%xmm3 - vpshufd $78,%xmm0,%xmm4 - vpxor %xmm5,%xmm3,%xmm3 - vmovdqu %xmm5,0(%rdi) - vpxor %xmm0,%xmm4,%xmm4 - vmovdqu %xmm0,16(%rdi) - leaq 48(%rdi),%rdi - subq $1,%r10 - jnz .Linit_loop_avx - - vpalignr $8,%xmm4,%xmm3,%xmm5 - vmovdqu %xmm5,-16(%rdi) - - vzeroupper - .byte 0xf3,0xc3 + jmp .L_init_clmul .size gcm_init_avx,.-gcm_init_avx .globl gcm_gmult_avx .type gcm_gmult_avx,@function @@ -1362,377 +1261,7 @@ gcm_gmult_avx: .type gcm_ghash_avx,@function .align 32 gcm_ghash_avx: - vzeroupper - - vmovdqu (%rdi),%xmm10 - leaq .L0x1c2_polynomial(%rip),%r10 - leaq 64(%rsi),%rsi - vmovdqu .Lbswap_mask(%rip),%xmm13 - vpshufb %xmm13,%xmm10,%xmm10 - cmpq $128,%rcx - jb .Lshort_avx - subq $128,%rcx - - vmovdqu 112(%rdx),%xmm14 - vmovdqu 0-64(%rsi),%xmm6 - vpshufb %xmm13,%xmm14,%xmm14 - vmovdqu 32-64(%rsi),%xmm7 - - vpunpckhqdq %xmm14,%xmm14,%xmm9 - vmovdqu 96(%rdx),%xmm15 - vpclmulqdq $0,%xmm6,%xmm14,%xmm0 - vpxor %xmm14,%xmm9,%xmm9 - vpshufb %xmm13,%xmm15,%xmm15 - vpclmulqdq $17,%xmm6,%xmm14,%xmm1 - vmovdqu 16-64(%rsi),%xmm6 - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vmovdqu 80(%rdx),%xmm14 - vpclmulqdq $0,%xmm7,%xmm9,%xmm2 - vpxor %xmm15,%xmm8,%xmm8 - - vpshufb %xmm13,%xmm14,%xmm14 - vpclmulqdq $0,%xmm6,%xmm15,%xmm3 - vpunpckhqdq %xmm14,%xmm14,%xmm9 - vpclmulqdq $17,%xmm6,%xmm15,%xmm4 - vmovdqu 48-64(%rsi),%xmm6 - vpxor %xmm14,%xmm9,%xmm9 - vmovdqu 64(%rdx),%xmm15 - vpclmulqdq $16,%xmm7,%xmm8,%xmm5 - vmovdqu 80-64(%rsi),%xmm7 - - vpshufb %xmm13,%xmm15,%xmm15 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $0,%xmm6,%xmm14,%xmm0 - vpxor %xmm1,%xmm4,%xmm4 - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vpclmulqdq $17,%xmm6,%xmm14,%xmm1 - vmovdqu 64-64(%rsi),%xmm6 - vpxor %xmm2,%xmm5,%xmm5 - vpclmulqdq $0,%xmm7,%xmm9,%xmm2 - vpxor %xmm15,%xmm8,%xmm8 - - vmovdqu 48(%rdx),%xmm14 - vpxor %xmm3,%xmm0,%xmm0 - vpclmulqdq $0,%xmm6,%xmm15,%xmm3 - vpxor %xmm4,%xmm1,%xmm1 - vpshufb %xmm13,%xmm14,%xmm14 - vpclmulqdq $17,%xmm6,%xmm15,%xmm4 - vmovdqu 96-64(%rsi),%xmm6 - vpxor %xmm5,%xmm2,%xmm2 - vpunpckhqdq %xmm14,%xmm14,%xmm9 - vpclmulqdq $16,%xmm7,%xmm8,%xmm5 - vmovdqu 128-64(%rsi),%xmm7 - vpxor %xmm14,%xmm9,%xmm9 - - vmovdqu 32(%rdx),%xmm15 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $0,%xmm6,%xmm14,%xmm0 - vpxor %xmm1,%xmm4,%xmm4 - vpshufb %xmm13,%xmm15,%xmm15 - vpclmulqdq $17,%xmm6,%xmm14,%xmm1 - vmovdqu 112-64(%rsi),%xmm6 - vpxor %xmm2,%xmm5,%xmm5 - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vpclmulqdq $0,%xmm7,%xmm9,%xmm2 - vpxor %xmm15,%xmm8,%xmm8 - - vmovdqu 16(%rdx),%xmm14 - vpxor %xmm3,%xmm0,%xmm0 - vpclmulqdq $0,%xmm6,%xmm15,%xmm3 - vpxor %xmm4,%xmm1,%xmm1 - vpshufb %xmm13,%xmm14,%xmm14 - vpclmulqdq $17,%xmm6,%xmm15,%xmm4 - vmovdqu 144-64(%rsi),%xmm6 - vpxor %xmm5,%xmm2,%xmm2 - vpunpckhqdq %xmm14,%xmm14,%xmm9 - vpclmulqdq $16,%xmm7,%xmm8,%xmm5 - vmovdqu 176-64(%rsi),%xmm7 - vpxor %xmm14,%xmm9,%xmm9 - - vmovdqu (%rdx),%xmm15 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $0,%xmm6,%xmm14,%xmm0 - vpxor %xmm1,%xmm4,%xmm4 - vpshufb %xmm13,%xmm15,%xmm15 - vpclmulqdq $17,%xmm6,%xmm14,%xmm1 - vmovdqu 160-64(%rsi),%xmm6 - vpxor %xmm2,%xmm5,%xmm5 - vpclmulqdq $16,%xmm7,%xmm9,%xmm2 - - leaq 128(%rdx),%rdx - cmpq $128,%rcx - jb .Ltail_avx - - vpxor %xmm10,%xmm15,%xmm15 - subq $128,%rcx - jmp .Loop8x_avx - -.align 32 -.Loop8x_avx: - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vmovdqu 112(%rdx),%xmm14 - vpxor %xmm0,%xmm3,%xmm3 - vpxor %xmm15,%xmm8,%xmm8 - vpclmulqdq $0,%xmm6,%xmm15,%xmm10 - vpshufb %xmm13,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vpclmulqdq $17,%xmm6,%xmm15,%xmm11 - vmovdqu 0-64(%rsi),%xmm6 - vpunpckhqdq %xmm14,%xmm14,%xmm9 - vpxor %xmm2,%xmm5,%xmm5 - vpclmulqdq $0,%xmm7,%xmm8,%xmm12 - vmovdqu 32-64(%rsi),%xmm7 - vpxor %xmm14,%xmm9,%xmm9 - - vmovdqu 96(%rdx),%xmm15 - vpclmulqdq $0,%xmm6,%xmm14,%xmm0 - vpxor %xmm3,%xmm10,%xmm10 - vpshufb %xmm13,%xmm15,%xmm15 - vpclmulqdq $17,%xmm6,%xmm14,%xmm1 - vxorps %xmm4,%xmm11,%xmm11 - vmovdqu 16-64(%rsi),%xmm6 - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vpclmulqdq $0,%xmm7,%xmm9,%xmm2 - vpxor %xmm5,%xmm12,%xmm12 - vxorps %xmm15,%xmm8,%xmm8 - - vmovdqu 80(%rdx),%xmm14 - vpxor %xmm10,%xmm12,%xmm12 - vpclmulqdq $0,%xmm6,%xmm15,%xmm3 - vpxor %xmm11,%xmm12,%xmm12 - vpslldq $8,%xmm12,%xmm9 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $17,%xmm6,%xmm15,%xmm4 - vpsrldq $8,%xmm12,%xmm12 - vpxor %xmm9,%xmm10,%xmm10 - vmovdqu 48-64(%rsi),%xmm6 - vpshufb %xmm13,%xmm14,%xmm14 - vxorps %xmm12,%xmm11,%xmm11 - vpxor %xmm1,%xmm4,%xmm4 - vpunpckhqdq %xmm14,%xmm14,%xmm9 - vpclmulqdq $16,%xmm7,%xmm8,%xmm5 - vmovdqu 80-64(%rsi),%xmm7 - vpxor %xmm14,%xmm9,%xmm9 - vpxor %xmm2,%xmm5,%xmm5 - - vmovdqu 64(%rdx),%xmm15 - vpalignr $8,%xmm10,%xmm10,%xmm12 - vpclmulqdq $0,%xmm6,%xmm14,%xmm0 - vpshufb %xmm13,%xmm15,%xmm15 - vpxor %xmm3,%xmm0,%xmm0 - vpclmulqdq $17,%xmm6,%xmm14,%xmm1 - vmovdqu 64-64(%rsi),%xmm6 - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vpxor %xmm4,%xmm1,%xmm1 - vpclmulqdq $0,%xmm7,%xmm9,%xmm2 - vxorps %xmm15,%xmm8,%xmm8 - vpxor %xmm5,%xmm2,%xmm2 - - vmovdqu 48(%rdx),%xmm14 - vpclmulqdq $16,(%r10),%xmm10,%xmm10 - vpclmulqdq $0,%xmm6,%xmm15,%xmm3 - vpshufb %xmm13,%xmm14,%xmm14 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $17,%xmm6,%xmm15,%xmm4 - vmovdqu 96-64(%rsi),%xmm6 - vpunpckhqdq %xmm14,%xmm14,%xmm9 - vpxor %xmm1,%xmm4,%xmm4 - vpclmulqdq $16,%xmm7,%xmm8,%xmm5 - vmovdqu 128-64(%rsi),%xmm7 - vpxor %xmm14,%xmm9,%xmm9 - vpxor %xmm2,%xmm5,%xmm5 - - vmovdqu 32(%rdx),%xmm15 - vpclmulqdq $0,%xmm6,%xmm14,%xmm0 - vpshufb %xmm13,%xmm15,%xmm15 - vpxor %xmm3,%xmm0,%xmm0 - vpclmulqdq $17,%xmm6,%xmm14,%xmm1 - vmovdqu 112-64(%rsi),%xmm6 - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vpxor %xmm4,%xmm1,%xmm1 - vpclmulqdq $0,%xmm7,%xmm9,%xmm2 - vpxor %xmm15,%xmm8,%xmm8 - vpxor %xmm5,%xmm2,%xmm2 - vxorps %xmm12,%xmm10,%xmm10 - - vmovdqu 16(%rdx),%xmm14 - vpalignr $8,%xmm10,%xmm10,%xmm12 - vpclmulqdq $0,%xmm6,%xmm15,%xmm3 - vpshufb %xmm13,%xmm14,%xmm14 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $17,%xmm6,%xmm15,%xmm4 - vmovdqu 144-64(%rsi),%xmm6 - vpclmulqdq $16,(%r10),%xmm10,%xmm10 - vxorps %xmm11,%xmm12,%xmm12 - vpunpckhqdq %xmm14,%xmm14,%xmm9 - vpxor %xmm1,%xmm4,%xmm4 - vpclmulqdq $16,%xmm7,%xmm8,%xmm5 - vmovdqu 176-64(%rsi),%xmm7 - vpxor %xmm14,%xmm9,%xmm9 - vpxor %xmm2,%xmm5,%xmm5 - - vmovdqu (%rdx),%xmm15 - vpclmulqdq $0,%xmm6,%xmm14,%xmm0 - vpshufb %xmm13,%xmm15,%xmm15 - vpclmulqdq $17,%xmm6,%xmm14,%xmm1 - vmovdqu 160-64(%rsi),%xmm6 - vpxor %xmm12,%xmm15,%xmm15 - vpclmulqdq $16,%xmm7,%xmm9,%xmm2 - vpxor %xmm10,%xmm15,%xmm15 - - leaq 128(%rdx),%rdx - subq $128,%rcx - jnc .Loop8x_avx - - addq $128,%rcx - jmp .Ltail_no_xor_avx - -.align 32 -.Lshort_avx: - vmovdqu -16(%rdx,%rcx,1),%xmm14 - leaq (%rdx,%rcx,1),%rdx - vmovdqu 0-64(%rsi),%xmm6 - vmovdqu 32-64(%rsi),%xmm7 - vpshufb %xmm13,%xmm14,%xmm15 - - vmovdqa %xmm0,%xmm3 - vmovdqa %xmm1,%xmm4 - vmovdqa %xmm2,%xmm5 - subq $16,%rcx - jz .Ltail_avx - - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $0,%xmm6,%xmm15,%xmm0 - vpxor %xmm15,%xmm8,%xmm8 - vmovdqu -32(%rdx),%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vpclmulqdq $17,%xmm6,%xmm15,%xmm1 - vmovdqu 16-64(%rsi),%xmm6 - vpshufb %xmm13,%xmm14,%xmm15 - vpxor %xmm2,%xmm5,%xmm5 - vpclmulqdq $0,%xmm7,%xmm8,%xmm2 - vpsrldq $8,%xmm7,%xmm7 - subq $16,%rcx - jz .Ltail_avx - - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $0,%xmm6,%xmm15,%xmm0 - vpxor %xmm15,%xmm8,%xmm8 - vmovdqu -48(%rdx),%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vpclmulqdq $17,%xmm6,%xmm15,%xmm1 - vmovdqu 48-64(%rsi),%xmm6 - vpshufb %xmm13,%xmm14,%xmm15 - vpxor %xmm2,%xmm5,%xmm5 - vpclmulqdq $0,%xmm7,%xmm8,%xmm2 - vmovdqu 80-64(%rsi),%xmm7 - subq $16,%rcx - jz .Ltail_avx - - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $0,%xmm6,%xmm15,%xmm0 - vpxor %xmm15,%xmm8,%xmm8 - vmovdqu -64(%rdx),%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vpclmulqdq $17,%xmm6,%xmm15,%xmm1 - vmovdqu 64-64(%rsi),%xmm6 - vpshufb %xmm13,%xmm14,%xmm15 - vpxor %xmm2,%xmm5,%xmm5 - vpclmulqdq $0,%xmm7,%xmm8,%xmm2 - vpsrldq $8,%xmm7,%xmm7 - subq $16,%rcx - jz .Ltail_avx - - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $0,%xmm6,%xmm15,%xmm0 - vpxor %xmm15,%xmm8,%xmm8 - vmovdqu -80(%rdx),%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vpclmulqdq $17,%xmm6,%xmm15,%xmm1 - vmovdqu 96-64(%rsi),%xmm6 - vpshufb %xmm13,%xmm14,%xmm15 - vpxor %xmm2,%xmm5,%xmm5 - vpclmulqdq $0,%xmm7,%xmm8,%xmm2 - vmovdqu 128-64(%rsi),%xmm7 - subq $16,%rcx - jz .Ltail_avx - - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $0,%xmm6,%xmm15,%xmm0 - vpxor %xmm15,%xmm8,%xmm8 - vmovdqu -96(%rdx),%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vpclmulqdq $17,%xmm6,%xmm15,%xmm1 - vmovdqu 112-64(%rsi),%xmm6 - vpshufb %xmm13,%xmm14,%xmm15 - vpxor %xmm2,%xmm5,%xmm5 - vpclmulqdq $0,%xmm7,%xmm8,%xmm2 - vpsrldq $8,%xmm7,%xmm7 - subq $16,%rcx - jz .Ltail_avx - - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $0,%xmm6,%xmm15,%xmm0 - vpxor %xmm15,%xmm8,%xmm8 - vmovdqu -112(%rdx),%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vpclmulqdq $17,%xmm6,%xmm15,%xmm1 - vmovdqu 144-64(%rsi),%xmm6 - vpshufb %xmm13,%xmm14,%xmm15 - vpxor %xmm2,%xmm5,%xmm5 - vpclmulqdq $0,%xmm7,%xmm8,%xmm2 - vmovq 184-64(%rsi),%xmm7 - subq $16,%rcx - jmp .Ltail_avx - -.align 32 -.Ltail_avx: - vpxor %xmm10,%xmm15,%xmm15 -.Ltail_no_xor_avx: - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $0,%xmm6,%xmm15,%xmm0 - vpxor %xmm15,%xmm8,%xmm8 - vpxor %xmm1,%xmm4,%xmm4 - vpclmulqdq $17,%xmm6,%xmm15,%xmm1 - vpxor %xmm2,%xmm5,%xmm5 - vpclmulqdq $0,%xmm7,%xmm8,%xmm2 - - vmovdqu (%r10),%xmm12 - - vpxor %xmm0,%xmm3,%xmm10 - vpxor %xmm1,%xmm4,%xmm11 - vpxor %xmm2,%xmm5,%xmm5 - - vpxor %xmm10,%xmm5,%xmm5 - vpxor %xmm11,%xmm5,%xmm5 - vpslldq $8,%xmm5,%xmm9 - vpsrldq $8,%xmm5,%xmm5 - vpxor %xmm9,%xmm10,%xmm10 - vpxor %xmm5,%xmm11,%xmm11 - - vpclmulqdq $16,%xmm12,%xmm10,%xmm9 - vpalignr $8,%xmm10,%xmm10,%xmm10 - vpxor %xmm9,%xmm10,%xmm10 - - vpclmulqdq $16,%xmm12,%xmm10,%xmm9 - vpalignr $8,%xmm10,%xmm10,%xmm10 - vpxor %xmm11,%xmm10,%xmm10 - vpxor %xmm9,%xmm10,%xmm10 - - cmpq $0,%rcx - jne .Lshort_avx - - vpshufb %xmm13,%xmm10,%xmm10 - vmovdqu %xmm10,(%rdi) - vzeroupper - .byte 0xf3,0xc3 + jmp .L_ghash_clmul .size gcm_ghash_avx,.-gcm_ghash_avx .align 64 .Lbswap_mask: diff --git a/deps/openssl/asm/x64-elf-gas/sha/sha1-mb-x86_64.s b/deps/openssl/asm/x64-elf-gas/sha/sha1-mb-x86_64.s index 8da489ea45f931..4d25c99cf65bd3 100644 --- a/deps/openssl/asm/x64-elf-gas/sha/sha1-mb-x86_64.s +++ b/deps/openssl/asm/x64-elf-gas/sha/sha1-mb-x86_64.s @@ -9,8 +9,6 @@ sha1_multi_block: movq OPENSSL_ia32cap_P+4(%rip),%rcx btq $61,%rcx jc _shaext_shortcut - testl $268435456,%ecx - jnz _avx_shortcut movq %rsp,%rax pushq %rbx pushq %rbp @@ -2601,10 +2599,10 @@ _shaext_shortcut: punpcklqdq %xmm5,%xmm0 punpckhqdq %xmm5,%xmm8 - pshufd $63,%xmm7,%xmm1 - pshufd $127,%xmm7,%xmm9 - pshufd $27,%xmm0,%xmm0 - pshufd $27,%xmm8,%xmm8 + pshufd $0b00111111,%xmm7,%xmm1 + pshufd $0b01111111,%xmm7,%xmm9 + pshufd $0b00011011,%xmm0,%xmm0 + pshufd $0b00011011,%xmm8,%xmm8 jmp .Loop_shaext .align 32 @@ -2859,8 +2857,8 @@ _shaext_shortcut: .byte 69,15,58,204,193,3 .byte 69,15,56,200,214 - pshufd $0,%xmm6,%xmm11 - pshufd $85,%xmm6,%xmm12 + pshufd $0x00,%xmm6,%xmm11 + pshufd $0x55,%xmm6,%xmm12 movdqa %xmm6,%xmm7 pcmpgtd %xmm4,%xmm11 pcmpgtd %xmm4,%xmm12 @@ -2890,8 +2888,8 @@ _shaext_shortcut: movl 280(%rsp),%edx - pshufd $27,%xmm0,%xmm0 - pshufd $27,%xmm8,%xmm8 + pshufd $0b00011011,%xmm0,%xmm0 + pshufd $0b00011011,%xmm8,%xmm8 movdqa %xmm0,%xmm6 punpckldq %xmm8,%xmm0 @@ -2919,4291 +2917,6 @@ _shaext_shortcut: .Lepilogue_shaext: .byte 0xf3,0xc3 .size sha1_multi_block_shaext,.-sha1_multi_block_shaext -.type sha1_multi_block_avx,@function -.align 32 -sha1_multi_block_avx: -_avx_shortcut: - shrq $32,%rcx - cmpl $2,%edx - jb .Lavx - testl $32,%ecx - jnz _avx2_shortcut - jmp .Lavx -.align 32 -.Lavx: - movq %rsp,%rax - pushq %rbx - pushq %rbp - subq $288,%rsp - andq $-256,%rsp - movq %rax,272(%rsp) -.Lbody_avx: - leaq K_XX_XX(%rip),%rbp - leaq 256(%rsp),%rbx - - vzeroupper -.Loop_grande_avx: - movl %edx,280(%rsp) - xorl %edx,%edx - movq 0(%rsi),%r8 - movl 8(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,0(%rbx) - cmovleq %rbp,%r8 - movq 16(%rsi),%r9 - movl 24(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,4(%rbx) - cmovleq %rbp,%r9 - movq 32(%rsi),%r10 - movl 40(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,8(%rbx) - cmovleq %rbp,%r10 - movq 48(%rsi),%r11 - movl 56(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,12(%rbx) - cmovleq %rbp,%r11 - testl %edx,%edx - jz .Ldone_avx - - vmovdqu 0(%rdi),%xmm10 - leaq 128(%rsp),%rax - vmovdqu 32(%rdi),%xmm11 - vmovdqu 64(%rdi),%xmm12 - vmovdqu 96(%rdi),%xmm13 - vmovdqu 128(%rdi),%xmm14 - vmovdqu 96(%rbp),%xmm5 - jmp .Loop_avx - -.align 32 -.Loop_avx: - vmovdqa -32(%rbp),%xmm15 - vmovd (%r8),%xmm0 - leaq 64(%r8),%r8 - vmovd (%r9),%xmm2 - leaq 64(%r9),%r9 - vpinsrd $1,(%r10),%xmm0,%xmm0 - leaq 64(%r10),%r10 - vpinsrd $1,(%r11),%xmm2,%xmm2 - leaq 64(%r11),%r11 - vmovd -60(%r8),%xmm1 - vpunpckldq %xmm2,%xmm0,%xmm0 - vmovd -60(%r9),%xmm9 - vpshufb %xmm5,%xmm0,%xmm0 - vpinsrd $1,-60(%r10),%xmm1,%xmm1 - vpinsrd $1,-60(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm14,%xmm14 - vpslld $5,%xmm10,%xmm8 - vpandn %xmm13,%xmm11,%xmm7 - vpand %xmm12,%xmm11,%xmm6 - - vmovdqa %xmm0,0-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpunpckldq %xmm9,%xmm1,%xmm1 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -56(%r8),%xmm2 - - vpslld $30,%xmm11,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -56(%r9),%xmm9 - vpaddd %xmm6,%xmm14,%xmm14 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpshufb %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpinsrd $1,-56(%r10),%xmm2,%xmm2 - vpinsrd $1,-56(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm13,%xmm13 - vpslld $5,%xmm14,%xmm8 - vpandn %xmm12,%xmm10,%xmm7 - vpand %xmm11,%xmm10,%xmm6 - - vmovdqa %xmm1,16-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpunpckldq %xmm9,%xmm2,%xmm2 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -52(%r8),%xmm3 - - vpslld $30,%xmm10,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -52(%r9),%xmm9 - vpaddd %xmm6,%xmm13,%xmm13 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpshufb %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpinsrd $1,-52(%r10),%xmm3,%xmm3 - vpinsrd $1,-52(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm12,%xmm12 - vpslld $5,%xmm13,%xmm8 - vpandn %xmm11,%xmm14,%xmm7 - vpand %xmm10,%xmm14,%xmm6 - - vmovdqa %xmm2,32-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpunpckldq %xmm9,%xmm3,%xmm3 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -48(%r8),%xmm4 - - vpslld $30,%xmm14,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -48(%r9),%xmm9 - vpaddd %xmm6,%xmm12,%xmm12 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpshufb %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpinsrd $1,-48(%r10),%xmm4,%xmm4 - vpinsrd $1,-48(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm11,%xmm11 - vpslld $5,%xmm12,%xmm8 - vpandn %xmm10,%xmm13,%xmm7 - vpand %xmm14,%xmm13,%xmm6 - - vmovdqa %xmm3,48-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpunpckldq %xmm9,%xmm4,%xmm4 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -44(%r8),%xmm0 - - vpslld $30,%xmm13,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -44(%r9),%xmm9 - vpaddd %xmm6,%xmm11,%xmm11 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpshufb %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpinsrd $1,-44(%r10),%xmm0,%xmm0 - vpinsrd $1,-44(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm10,%xmm10 - vpslld $5,%xmm11,%xmm8 - vpandn %xmm14,%xmm12,%xmm7 - vpand %xmm13,%xmm12,%xmm6 - - vmovdqa %xmm4,64-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpunpckldq %xmm9,%xmm0,%xmm0 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -40(%r8),%xmm1 - - vpslld $30,%xmm12,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -40(%r9),%xmm9 - vpaddd %xmm6,%xmm10,%xmm10 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpshufb %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vpinsrd $1,-40(%r10),%xmm1,%xmm1 - vpinsrd $1,-40(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm14,%xmm14 - vpslld $5,%xmm10,%xmm8 - vpandn %xmm13,%xmm11,%xmm7 - vpand %xmm12,%xmm11,%xmm6 - - vmovdqa %xmm0,80-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpunpckldq %xmm9,%xmm1,%xmm1 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -36(%r8),%xmm2 - - vpslld $30,%xmm11,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -36(%r9),%xmm9 - vpaddd %xmm6,%xmm14,%xmm14 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpshufb %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpinsrd $1,-36(%r10),%xmm2,%xmm2 - vpinsrd $1,-36(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm13,%xmm13 - vpslld $5,%xmm14,%xmm8 - vpandn %xmm12,%xmm10,%xmm7 - vpand %xmm11,%xmm10,%xmm6 - - vmovdqa %xmm1,96-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpunpckldq %xmm9,%xmm2,%xmm2 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -32(%r8),%xmm3 - - vpslld $30,%xmm10,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -32(%r9),%xmm9 - vpaddd %xmm6,%xmm13,%xmm13 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpshufb %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpinsrd $1,-32(%r10),%xmm3,%xmm3 - vpinsrd $1,-32(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm12,%xmm12 - vpslld $5,%xmm13,%xmm8 - vpandn %xmm11,%xmm14,%xmm7 - vpand %xmm10,%xmm14,%xmm6 - - vmovdqa %xmm2,112-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpunpckldq %xmm9,%xmm3,%xmm3 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -28(%r8),%xmm4 - - vpslld $30,%xmm14,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -28(%r9),%xmm9 - vpaddd %xmm6,%xmm12,%xmm12 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpshufb %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpinsrd $1,-28(%r10),%xmm4,%xmm4 - vpinsrd $1,-28(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm11,%xmm11 - vpslld $5,%xmm12,%xmm8 - vpandn %xmm10,%xmm13,%xmm7 - vpand %xmm14,%xmm13,%xmm6 - - vmovdqa %xmm3,128-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpunpckldq %xmm9,%xmm4,%xmm4 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -24(%r8),%xmm0 - - vpslld $30,%xmm13,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -24(%r9),%xmm9 - vpaddd %xmm6,%xmm11,%xmm11 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpshufb %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpinsrd $1,-24(%r10),%xmm0,%xmm0 - vpinsrd $1,-24(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm10,%xmm10 - vpslld $5,%xmm11,%xmm8 - vpandn %xmm14,%xmm12,%xmm7 - vpand %xmm13,%xmm12,%xmm6 - - vmovdqa %xmm4,144-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpunpckldq %xmm9,%xmm0,%xmm0 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -20(%r8),%xmm1 - - vpslld $30,%xmm12,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -20(%r9),%xmm9 - vpaddd %xmm6,%xmm10,%xmm10 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpshufb %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vpinsrd $1,-20(%r10),%xmm1,%xmm1 - vpinsrd $1,-20(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm14,%xmm14 - vpslld $5,%xmm10,%xmm8 - vpandn %xmm13,%xmm11,%xmm7 - vpand %xmm12,%xmm11,%xmm6 - - vmovdqa %xmm0,160-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpunpckldq %xmm9,%xmm1,%xmm1 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -16(%r8),%xmm2 - - vpslld $30,%xmm11,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -16(%r9),%xmm9 - vpaddd %xmm6,%xmm14,%xmm14 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpshufb %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpinsrd $1,-16(%r10),%xmm2,%xmm2 - vpinsrd $1,-16(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm13,%xmm13 - vpslld $5,%xmm14,%xmm8 - vpandn %xmm12,%xmm10,%xmm7 - vpand %xmm11,%xmm10,%xmm6 - - vmovdqa %xmm1,176-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpunpckldq %xmm9,%xmm2,%xmm2 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -12(%r8),%xmm3 - - vpslld $30,%xmm10,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -12(%r9),%xmm9 - vpaddd %xmm6,%xmm13,%xmm13 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpshufb %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpinsrd $1,-12(%r10),%xmm3,%xmm3 - vpinsrd $1,-12(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm12,%xmm12 - vpslld $5,%xmm13,%xmm8 - vpandn %xmm11,%xmm14,%xmm7 - vpand %xmm10,%xmm14,%xmm6 - - vmovdqa %xmm2,192-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpunpckldq %xmm9,%xmm3,%xmm3 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -8(%r8),%xmm4 - - vpslld $30,%xmm14,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -8(%r9),%xmm9 - vpaddd %xmm6,%xmm12,%xmm12 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpshufb %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpinsrd $1,-8(%r10),%xmm4,%xmm4 - vpinsrd $1,-8(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm11,%xmm11 - vpslld $5,%xmm12,%xmm8 - vpandn %xmm10,%xmm13,%xmm7 - vpand %xmm14,%xmm13,%xmm6 - - vmovdqa %xmm3,208-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpunpckldq %xmm9,%xmm4,%xmm4 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -4(%r8),%xmm0 - - vpslld $30,%xmm13,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -4(%r9),%xmm9 - vpaddd %xmm6,%xmm11,%xmm11 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpshufb %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vmovdqa 0-128(%rax),%xmm1 - vpinsrd $1,-4(%r10),%xmm0,%xmm0 - vpinsrd $1,-4(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm10,%xmm10 - prefetcht0 63(%r8) - vpslld $5,%xmm11,%xmm8 - vpandn %xmm14,%xmm12,%xmm7 - vpand %xmm13,%xmm12,%xmm6 - - vmovdqa %xmm4,224-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpunpckldq %xmm9,%xmm0,%xmm0 - vpsrld $27,%xmm11,%xmm9 - prefetcht0 63(%r9) - vpxor %xmm7,%xmm6,%xmm6 - - vpslld $30,%xmm12,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - prefetcht0 63(%r10) - vpaddd %xmm6,%xmm10,%xmm10 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - prefetcht0 63(%r11) - vpshufb %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vmovdqa 16-128(%rax),%xmm2 - vpxor %xmm3,%xmm1,%xmm1 - vmovdqa 32-128(%rax),%xmm3 - - vpaddd %xmm15,%xmm14,%xmm14 - vpslld $5,%xmm10,%xmm8 - vpandn %xmm13,%xmm11,%xmm7 - - vpand %xmm12,%xmm11,%xmm6 - - vmovdqa %xmm0,240-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpxor 128-128(%rax),%xmm1,%xmm1 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vpxor %xmm3,%xmm1,%xmm1 - - - vpslld $30,%xmm11,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm14,%xmm14 - - vpsrld $31,%xmm1,%xmm5 - vpaddd %xmm1,%xmm1,%xmm1 - - vpsrld $2,%xmm11,%xmm11 - - vpaddd %xmm8,%xmm14,%xmm14 - vpor %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpxor %xmm4,%xmm2,%xmm2 - vmovdqa 48-128(%rax),%xmm4 - - vpaddd %xmm15,%xmm13,%xmm13 - vpslld $5,%xmm14,%xmm8 - vpandn %xmm12,%xmm10,%xmm7 - - vpand %xmm11,%xmm10,%xmm6 - - vmovdqa %xmm1,0-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpxor 144-128(%rax),%xmm2,%xmm2 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vpxor %xmm4,%xmm2,%xmm2 - - - vpslld $30,%xmm10,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm13,%xmm13 - - vpsrld $31,%xmm2,%xmm5 - vpaddd %xmm2,%xmm2,%xmm2 - - vpsrld $2,%xmm10,%xmm10 - - vpaddd %xmm8,%xmm13,%xmm13 - vpor %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpxor %xmm0,%xmm3,%xmm3 - vmovdqa 64-128(%rax),%xmm0 - - vpaddd %xmm15,%xmm12,%xmm12 - vpslld $5,%xmm13,%xmm8 - vpandn %xmm11,%xmm14,%xmm7 - - vpand %xmm10,%xmm14,%xmm6 - - vmovdqa %xmm2,16-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpxor 160-128(%rax),%xmm3,%xmm3 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vpxor %xmm0,%xmm3,%xmm3 - - - vpslld $30,%xmm14,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm12,%xmm12 - - vpsrld $31,%xmm3,%xmm5 - vpaddd %xmm3,%xmm3,%xmm3 - - vpsrld $2,%xmm14,%xmm14 - - vpaddd %xmm8,%xmm12,%xmm12 - vpor %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqa 80-128(%rax),%xmm1 - - vpaddd %xmm15,%xmm11,%xmm11 - vpslld $5,%xmm12,%xmm8 - vpandn %xmm10,%xmm13,%xmm7 - - vpand %xmm14,%xmm13,%xmm6 - - vmovdqa %xmm3,32-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpxor 176-128(%rax),%xmm4,%xmm4 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm4 - - - vpslld $30,%xmm13,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm11,%xmm11 - - vpsrld $31,%xmm4,%xmm5 - vpaddd %xmm4,%xmm4,%xmm4 - - vpsrld $2,%xmm13,%xmm13 - - vpaddd %xmm8,%xmm11,%xmm11 - vpor %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpxor %xmm2,%xmm0,%xmm0 - vmovdqa 96-128(%rax),%xmm2 - - vpaddd %xmm15,%xmm10,%xmm10 - vpslld $5,%xmm11,%xmm8 - vpandn %xmm14,%xmm12,%xmm7 - - vpand %xmm13,%xmm12,%xmm6 - - vmovdqa %xmm4,48-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpxor 192-128(%rax),%xmm0,%xmm0 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vpxor %xmm2,%xmm0,%xmm0 - - - vpslld $30,%xmm12,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm10,%xmm10 - - vpsrld $31,%xmm0,%xmm5 - vpaddd %xmm0,%xmm0,%xmm0 - - vpsrld $2,%xmm12,%xmm12 - - vpaddd %xmm8,%xmm10,%xmm10 - vpor %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vmovdqa 0(%rbp),%xmm15 - vpxor %xmm3,%xmm1,%xmm1 - vmovdqa 112-128(%rax),%xmm3 - - vpslld $5,%xmm10,%xmm8 - vpaddd %xmm15,%xmm14,%xmm14 - vpxor %xmm11,%xmm13,%xmm6 - vmovdqa %xmm0,64-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpxor 208-128(%rax),%xmm1,%xmm1 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm12,%xmm6,%xmm6 - vpxor %xmm3,%xmm1,%xmm1 - - vpslld $30,%xmm11,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm14,%xmm14 - vpsrld $31,%xmm1,%xmm5 - vpaddd %xmm1,%xmm1,%xmm1 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpor %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpxor %xmm4,%xmm2,%xmm2 - vmovdqa 128-128(%rax),%xmm4 - - vpslld $5,%xmm14,%xmm8 - vpaddd %xmm15,%xmm13,%xmm13 - vpxor %xmm10,%xmm12,%xmm6 - vmovdqa %xmm1,80-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpxor 224-128(%rax),%xmm2,%xmm2 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm11,%xmm6,%xmm6 - vpxor %xmm4,%xmm2,%xmm2 - - vpslld $30,%xmm10,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm13,%xmm13 - vpsrld $31,%xmm2,%xmm5 - vpaddd %xmm2,%xmm2,%xmm2 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpor %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpxor %xmm0,%xmm3,%xmm3 - vmovdqa 144-128(%rax),%xmm0 - - vpslld $5,%xmm13,%xmm8 - vpaddd %xmm15,%xmm12,%xmm12 - vpxor %xmm14,%xmm11,%xmm6 - vmovdqa %xmm2,96-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpxor 240-128(%rax),%xmm3,%xmm3 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm10,%xmm6,%xmm6 - vpxor %xmm0,%xmm3,%xmm3 - - vpslld $30,%xmm14,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm12,%xmm12 - vpsrld $31,%xmm3,%xmm5 - vpaddd %xmm3,%xmm3,%xmm3 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpor %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqa 160-128(%rax),%xmm1 - - vpslld $5,%xmm12,%xmm8 - vpaddd %xmm15,%xmm11,%xmm11 - vpxor %xmm13,%xmm10,%xmm6 - vmovdqa %xmm3,112-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpxor 0-128(%rax),%xmm4,%xmm4 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm14,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm4 - - vpslld $30,%xmm13,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm11,%xmm11 - vpsrld $31,%xmm4,%xmm5 - vpaddd %xmm4,%xmm4,%xmm4 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpor %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpxor %xmm2,%xmm0,%xmm0 - vmovdqa 176-128(%rax),%xmm2 - - vpslld $5,%xmm11,%xmm8 - vpaddd %xmm15,%xmm10,%xmm10 - vpxor %xmm12,%xmm14,%xmm6 - vmovdqa %xmm4,128-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpxor 16-128(%rax),%xmm0,%xmm0 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm13,%xmm6,%xmm6 - vpxor %xmm2,%xmm0,%xmm0 - - vpslld $30,%xmm12,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm10,%xmm10 - vpsrld $31,%xmm0,%xmm5 - vpaddd %xmm0,%xmm0,%xmm0 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpor %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vpxor %xmm3,%xmm1,%xmm1 - vmovdqa 192-128(%rax),%xmm3 - - vpslld $5,%xmm10,%xmm8 - vpaddd %xmm15,%xmm14,%xmm14 - vpxor %xmm11,%xmm13,%xmm6 - vmovdqa %xmm0,144-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpxor 32-128(%rax),%xmm1,%xmm1 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm12,%xmm6,%xmm6 - vpxor %xmm3,%xmm1,%xmm1 - - vpslld $30,%xmm11,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm14,%xmm14 - vpsrld $31,%xmm1,%xmm5 - vpaddd %xmm1,%xmm1,%xmm1 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpor %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpxor %xmm4,%xmm2,%xmm2 - vmovdqa 208-128(%rax),%xmm4 - - vpslld $5,%xmm14,%xmm8 - vpaddd %xmm15,%xmm13,%xmm13 - vpxor %xmm10,%xmm12,%xmm6 - vmovdqa %xmm1,160-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpxor 48-128(%rax),%xmm2,%xmm2 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm11,%xmm6,%xmm6 - vpxor %xmm4,%xmm2,%xmm2 - - vpslld $30,%xmm10,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm13,%xmm13 - vpsrld $31,%xmm2,%xmm5 - vpaddd %xmm2,%xmm2,%xmm2 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpor %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpxor %xmm0,%xmm3,%xmm3 - vmovdqa 224-128(%rax),%xmm0 - - vpslld $5,%xmm13,%xmm8 - vpaddd %xmm15,%xmm12,%xmm12 - vpxor %xmm14,%xmm11,%xmm6 - vmovdqa %xmm2,176-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpxor 64-128(%rax),%xmm3,%xmm3 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm10,%xmm6,%xmm6 - vpxor %xmm0,%xmm3,%xmm3 - - vpslld $30,%xmm14,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm12,%xmm12 - vpsrld $31,%xmm3,%xmm5 - vpaddd %xmm3,%xmm3,%xmm3 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpor %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqa 240-128(%rax),%xmm1 - - vpslld $5,%xmm12,%xmm8 - vpaddd %xmm15,%xmm11,%xmm11 - vpxor %xmm13,%xmm10,%xmm6 - vmovdqa %xmm3,192-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpxor 80-128(%rax),%xmm4,%xmm4 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm14,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm4 - - vpslld $30,%xmm13,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm11,%xmm11 - vpsrld $31,%xmm4,%xmm5 - vpaddd %xmm4,%xmm4,%xmm4 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpor %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpxor %xmm2,%xmm0,%xmm0 - vmovdqa 0-128(%rax),%xmm2 - - vpslld $5,%xmm11,%xmm8 - vpaddd %xmm15,%xmm10,%xmm10 - vpxor %xmm12,%xmm14,%xmm6 - vmovdqa %xmm4,208-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpxor 96-128(%rax),%xmm0,%xmm0 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm13,%xmm6,%xmm6 - vpxor %xmm2,%xmm0,%xmm0 - - vpslld $30,%xmm12,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm10,%xmm10 - vpsrld $31,%xmm0,%xmm5 - vpaddd %xmm0,%xmm0,%xmm0 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpor %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vpxor %xmm3,%xmm1,%xmm1 - vmovdqa 16-128(%rax),%xmm3 - - vpslld $5,%xmm10,%xmm8 - vpaddd %xmm15,%xmm14,%xmm14 - vpxor %xmm11,%xmm13,%xmm6 - vmovdqa %xmm0,224-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpxor 112-128(%rax),%xmm1,%xmm1 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm12,%xmm6,%xmm6 - vpxor %xmm3,%xmm1,%xmm1 - - vpslld $30,%xmm11,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm14,%xmm14 - vpsrld $31,%xmm1,%xmm5 - vpaddd %xmm1,%xmm1,%xmm1 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpor %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpxor %xmm4,%xmm2,%xmm2 - vmovdqa 32-128(%rax),%xmm4 - - vpslld $5,%xmm14,%xmm8 - vpaddd %xmm15,%xmm13,%xmm13 - vpxor %xmm10,%xmm12,%xmm6 - vmovdqa %xmm1,240-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpxor 128-128(%rax),%xmm2,%xmm2 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm11,%xmm6,%xmm6 - vpxor %xmm4,%xmm2,%xmm2 - - vpslld $30,%xmm10,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm13,%xmm13 - vpsrld $31,%xmm2,%xmm5 - vpaddd %xmm2,%xmm2,%xmm2 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpor %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpxor %xmm0,%xmm3,%xmm3 - vmovdqa 48-128(%rax),%xmm0 - - vpslld $5,%xmm13,%xmm8 - vpaddd %xmm15,%xmm12,%xmm12 - vpxor %xmm14,%xmm11,%xmm6 - vmovdqa %xmm2,0-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpxor 144-128(%rax),%xmm3,%xmm3 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm10,%xmm6,%xmm6 - vpxor %xmm0,%xmm3,%xmm3 - - vpslld $30,%xmm14,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm12,%xmm12 - vpsrld $31,%xmm3,%xmm5 - vpaddd %xmm3,%xmm3,%xmm3 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpor %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqa 64-128(%rax),%xmm1 - - vpslld $5,%xmm12,%xmm8 - vpaddd %xmm15,%xmm11,%xmm11 - vpxor %xmm13,%xmm10,%xmm6 - vmovdqa %xmm3,16-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpxor 160-128(%rax),%xmm4,%xmm4 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm14,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm4 - - vpslld $30,%xmm13,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm11,%xmm11 - vpsrld $31,%xmm4,%xmm5 - vpaddd %xmm4,%xmm4,%xmm4 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpor %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpxor %xmm2,%xmm0,%xmm0 - vmovdqa 80-128(%rax),%xmm2 - - vpslld $5,%xmm11,%xmm8 - vpaddd %xmm15,%xmm10,%xmm10 - vpxor %xmm12,%xmm14,%xmm6 - vmovdqa %xmm4,32-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpxor 176-128(%rax),%xmm0,%xmm0 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm13,%xmm6,%xmm6 - vpxor %xmm2,%xmm0,%xmm0 - - vpslld $30,%xmm12,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm10,%xmm10 - vpsrld $31,%xmm0,%xmm5 - vpaddd %xmm0,%xmm0,%xmm0 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpor %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vpxor %xmm3,%xmm1,%xmm1 - vmovdqa 96-128(%rax),%xmm3 - - vpslld $5,%xmm10,%xmm8 - vpaddd %xmm15,%xmm14,%xmm14 - vpxor %xmm11,%xmm13,%xmm6 - vmovdqa %xmm0,48-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpxor 192-128(%rax),%xmm1,%xmm1 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm12,%xmm6,%xmm6 - vpxor %xmm3,%xmm1,%xmm1 - - vpslld $30,%xmm11,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm14,%xmm14 - vpsrld $31,%xmm1,%xmm5 - vpaddd %xmm1,%xmm1,%xmm1 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpor %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpxor %xmm4,%xmm2,%xmm2 - vmovdqa 112-128(%rax),%xmm4 - - vpslld $5,%xmm14,%xmm8 - vpaddd %xmm15,%xmm13,%xmm13 - vpxor %xmm10,%xmm12,%xmm6 - vmovdqa %xmm1,64-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpxor 208-128(%rax),%xmm2,%xmm2 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm11,%xmm6,%xmm6 - vpxor %xmm4,%xmm2,%xmm2 - - vpslld $30,%xmm10,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm13,%xmm13 - vpsrld $31,%xmm2,%xmm5 - vpaddd %xmm2,%xmm2,%xmm2 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpor %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpxor %xmm0,%xmm3,%xmm3 - vmovdqa 128-128(%rax),%xmm0 - - vpslld $5,%xmm13,%xmm8 - vpaddd %xmm15,%xmm12,%xmm12 - vpxor %xmm14,%xmm11,%xmm6 - vmovdqa %xmm2,80-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpxor 224-128(%rax),%xmm3,%xmm3 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm10,%xmm6,%xmm6 - vpxor %xmm0,%xmm3,%xmm3 - - vpslld $30,%xmm14,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm12,%xmm12 - vpsrld $31,%xmm3,%xmm5 - vpaddd %xmm3,%xmm3,%xmm3 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpor %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqa 144-128(%rax),%xmm1 - - vpslld $5,%xmm12,%xmm8 - vpaddd %xmm15,%xmm11,%xmm11 - vpxor %xmm13,%xmm10,%xmm6 - vmovdqa %xmm3,96-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpxor 240-128(%rax),%xmm4,%xmm4 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm14,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm4 - - vpslld $30,%xmm13,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm11,%xmm11 - vpsrld $31,%xmm4,%xmm5 - vpaddd %xmm4,%xmm4,%xmm4 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpor %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpxor %xmm2,%xmm0,%xmm0 - vmovdqa 160-128(%rax),%xmm2 - - vpslld $5,%xmm11,%xmm8 - vpaddd %xmm15,%xmm10,%xmm10 - vpxor %xmm12,%xmm14,%xmm6 - vmovdqa %xmm4,112-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpxor 0-128(%rax),%xmm0,%xmm0 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm13,%xmm6,%xmm6 - vpxor %xmm2,%xmm0,%xmm0 - - vpslld $30,%xmm12,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm10,%xmm10 - vpsrld $31,%xmm0,%xmm5 - vpaddd %xmm0,%xmm0,%xmm0 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpor %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vmovdqa 32(%rbp),%xmm15 - vpxor %xmm3,%xmm1,%xmm1 - vmovdqa 176-128(%rax),%xmm3 - - vpaddd %xmm15,%xmm14,%xmm14 - vpslld $5,%xmm10,%xmm8 - vpand %xmm12,%xmm13,%xmm7 - vpxor 16-128(%rax),%xmm1,%xmm1 - - vpaddd %xmm7,%xmm14,%xmm14 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm12,%xmm13,%xmm6 - vpxor %xmm3,%xmm1,%xmm1 - - vmovdqu %xmm0,128-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm1,%xmm5 - vpand %xmm11,%xmm6,%xmm6 - vpaddd %xmm1,%xmm1,%xmm1 - - vpslld $30,%xmm11,%xmm7 - vpaddd %xmm6,%xmm14,%xmm14 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpor %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpxor %xmm4,%xmm2,%xmm2 - vmovdqa 192-128(%rax),%xmm4 - - vpaddd %xmm15,%xmm13,%xmm13 - vpslld $5,%xmm14,%xmm8 - vpand %xmm11,%xmm12,%xmm7 - vpxor 32-128(%rax),%xmm2,%xmm2 - - vpaddd %xmm7,%xmm13,%xmm13 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm11,%xmm12,%xmm6 - vpxor %xmm4,%xmm2,%xmm2 - - vmovdqu %xmm1,144-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm2,%xmm5 - vpand %xmm10,%xmm6,%xmm6 - vpaddd %xmm2,%xmm2,%xmm2 - - vpslld $30,%xmm10,%xmm7 - vpaddd %xmm6,%xmm13,%xmm13 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpor %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpxor %xmm0,%xmm3,%xmm3 - vmovdqa 208-128(%rax),%xmm0 - - vpaddd %xmm15,%xmm12,%xmm12 - vpslld $5,%xmm13,%xmm8 - vpand %xmm10,%xmm11,%xmm7 - vpxor 48-128(%rax),%xmm3,%xmm3 - - vpaddd %xmm7,%xmm12,%xmm12 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm10,%xmm11,%xmm6 - vpxor %xmm0,%xmm3,%xmm3 - - vmovdqu %xmm2,160-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm3,%xmm5 - vpand %xmm14,%xmm6,%xmm6 - vpaddd %xmm3,%xmm3,%xmm3 - - vpslld $30,%xmm14,%xmm7 - vpaddd %xmm6,%xmm12,%xmm12 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpor %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqa 224-128(%rax),%xmm1 - - vpaddd %xmm15,%xmm11,%xmm11 - vpslld $5,%xmm12,%xmm8 - vpand %xmm14,%xmm10,%xmm7 - vpxor 64-128(%rax),%xmm4,%xmm4 - - vpaddd %xmm7,%xmm11,%xmm11 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm14,%xmm10,%xmm6 - vpxor %xmm1,%xmm4,%xmm4 - - vmovdqu %xmm3,176-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm4,%xmm5 - vpand %xmm13,%xmm6,%xmm6 - vpaddd %xmm4,%xmm4,%xmm4 - - vpslld $30,%xmm13,%xmm7 - vpaddd %xmm6,%xmm11,%xmm11 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpor %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpxor %xmm2,%xmm0,%xmm0 - vmovdqa 240-128(%rax),%xmm2 - - vpaddd %xmm15,%xmm10,%xmm10 - vpslld $5,%xmm11,%xmm8 - vpand %xmm13,%xmm14,%xmm7 - vpxor 80-128(%rax),%xmm0,%xmm0 - - vpaddd %xmm7,%xmm10,%xmm10 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm13,%xmm14,%xmm6 - vpxor %xmm2,%xmm0,%xmm0 - - vmovdqu %xmm4,192-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm0,%xmm5 - vpand %xmm12,%xmm6,%xmm6 - vpaddd %xmm0,%xmm0,%xmm0 - - vpslld $30,%xmm12,%xmm7 - vpaddd %xmm6,%xmm10,%xmm10 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpor %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vpxor %xmm3,%xmm1,%xmm1 - vmovdqa 0-128(%rax),%xmm3 - - vpaddd %xmm15,%xmm14,%xmm14 - vpslld $5,%xmm10,%xmm8 - vpand %xmm12,%xmm13,%xmm7 - vpxor 96-128(%rax),%xmm1,%xmm1 - - vpaddd %xmm7,%xmm14,%xmm14 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm12,%xmm13,%xmm6 - vpxor %xmm3,%xmm1,%xmm1 - - vmovdqu %xmm0,208-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm1,%xmm5 - vpand %xmm11,%xmm6,%xmm6 - vpaddd %xmm1,%xmm1,%xmm1 - - vpslld $30,%xmm11,%xmm7 - vpaddd %xmm6,%xmm14,%xmm14 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpor %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpxor %xmm4,%xmm2,%xmm2 - vmovdqa 16-128(%rax),%xmm4 - - vpaddd %xmm15,%xmm13,%xmm13 - vpslld $5,%xmm14,%xmm8 - vpand %xmm11,%xmm12,%xmm7 - vpxor 112-128(%rax),%xmm2,%xmm2 - - vpaddd %xmm7,%xmm13,%xmm13 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm11,%xmm12,%xmm6 - vpxor %xmm4,%xmm2,%xmm2 - - vmovdqu %xmm1,224-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm2,%xmm5 - vpand %xmm10,%xmm6,%xmm6 - vpaddd %xmm2,%xmm2,%xmm2 - - vpslld $30,%xmm10,%xmm7 - vpaddd %xmm6,%xmm13,%xmm13 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpor %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpxor %xmm0,%xmm3,%xmm3 - vmovdqa 32-128(%rax),%xmm0 - - vpaddd %xmm15,%xmm12,%xmm12 - vpslld $5,%xmm13,%xmm8 - vpand %xmm10,%xmm11,%xmm7 - vpxor 128-128(%rax),%xmm3,%xmm3 - - vpaddd %xmm7,%xmm12,%xmm12 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm10,%xmm11,%xmm6 - vpxor %xmm0,%xmm3,%xmm3 - - vmovdqu %xmm2,240-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm3,%xmm5 - vpand %xmm14,%xmm6,%xmm6 - vpaddd %xmm3,%xmm3,%xmm3 - - vpslld $30,%xmm14,%xmm7 - vpaddd %xmm6,%xmm12,%xmm12 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpor %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqa 48-128(%rax),%xmm1 - - vpaddd %xmm15,%xmm11,%xmm11 - vpslld $5,%xmm12,%xmm8 - vpand %xmm14,%xmm10,%xmm7 - vpxor 144-128(%rax),%xmm4,%xmm4 - - vpaddd %xmm7,%xmm11,%xmm11 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm14,%xmm10,%xmm6 - vpxor %xmm1,%xmm4,%xmm4 - - vmovdqu %xmm3,0-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm4,%xmm5 - vpand %xmm13,%xmm6,%xmm6 - vpaddd %xmm4,%xmm4,%xmm4 - - vpslld $30,%xmm13,%xmm7 - vpaddd %xmm6,%xmm11,%xmm11 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpor %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpxor %xmm2,%xmm0,%xmm0 - vmovdqa 64-128(%rax),%xmm2 - - vpaddd %xmm15,%xmm10,%xmm10 - vpslld $5,%xmm11,%xmm8 - vpand %xmm13,%xmm14,%xmm7 - vpxor 160-128(%rax),%xmm0,%xmm0 - - vpaddd %xmm7,%xmm10,%xmm10 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm13,%xmm14,%xmm6 - vpxor %xmm2,%xmm0,%xmm0 - - vmovdqu %xmm4,16-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm0,%xmm5 - vpand %xmm12,%xmm6,%xmm6 - vpaddd %xmm0,%xmm0,%xmm0 - - vpslld $30,%xmm12,%xmm7 - vpaddd %xmm6,%xmm10,%xmm10 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpor %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vpxor %xmm3,%xmm1,%xmm1 - vmovdqa 80-128(%rax),%xmm3 - - vpaddd %xmm15,%xmm14,%xmm14 - vpslld $5,%xmm10,%xmm8 - vpand %xmm12,%xmm13,%xmm7 - vpxor 176-128(%rax),%xmm1,%xmm1 - - vpaddd %xmm7,%xmm14,%xmm14 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm12,%xmm13,%xmm6 - vpxor %xmm3,%xmm1,%xmm1 - - vmovdqu %xmm0,32-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm1,%xmm5 - vpand %xmm11,%xmm6,%xmm6 - vpaddd %xmm1,%xmm1,%xmm1 - - vpslld $30,%xmm11,%xmm7 - vpaddd %xmm6,%xmm14,%xmm14 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpor %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpxor %xmm4,%xmm2,%xmm2 - vmovdqa 96-128(%rax),%xmm4 - - vpaddd %xmm15,%xmm13,%xmm13 - vpslld $5,%xmm14,%xmm8 - vpand %xmm11,%xmm12,%xmm7 - vpxor 192-128(%rax),%xmm2,%xmm2 - - vpaddd %xmm7,%xmm13,%xmm13 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm11,%xmm12,%xmm6 - vpxor %xmm4,%xmm2,%xmm2 - - vmovdqu %xmm1,48-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm2,%xmm5 - vpand %xmm10,%xmm6,%xmm6 - vpaddd %xmm2,%xmm2,%xmm2 - - vpslld $30,%xmm10,%xmm7 - vpaddd %xmm6,%xmm13,%xmm13 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpor %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpxor %xmm0,%xmm3,%xmm3 - vmovdqa 112-128(%rax),%xmm0 - - vpaddd %xmm15,%xmm12,%xmm12 - vpslld $5,%xmm13,%xmm8 - vpand %xmm10,%xmm11,%xmm7 - vpxor 208-128(%rax),%xmm3,%xmm3 - - vpaddd %xmm7,%xmm12,%xmm12 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm10,%xmm11,%xmm6 - vpxor %xmm0,%xmm3,%xmm3 - - vmovdqu %xmm2,64-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm3,%xmm5 - vpand %xmm14,%xmm6,%xmm6 - vpaddd %xmm3,%xmm3,%xmm3 - - vpslld $30,%xmm14,%xmm7 - vpaddd %xmm6,%xmm12,%xmm12 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpor %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqa 128-128(%rax),%xmm1 - - vpaddd %xmm15,%xmm11,%xmm11 - vpslld $5,%xmm12,%xmm8 - vpand %xmm14,%xmm10,%xmm7 - vpxor 224-128(%rax),%xmm4,%xmm4 - - vpaddd %xmm7,%xmm11,%xmm11 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm14,%xmm10,%xmm6 - vpxor %xmm1,%xmm4,%xmm4 - - vmovdqu %xmm3,80-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm4,%xmm5 - vpand %xmm13,%xmm6,%xmm6 - vpaddd %xmm4,%xmm4,%xmm4 - - vpslld $30,%xmm13,%xmm7 - vpaddd %xmm6,%xmm11,%xmm11 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpor %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpxor %xmm2,%xmm0,%xmm0 - vmovdqa 144-128(%rax),%xmm2 - - vpaddd %xmm15,%xmm10,%xmm10 - vpslld $5,%xmm11,%xmm8 - vpand %xmm13,%xmm14,%xmm7 - vpxor 240-128(%rax),%xmm0,%xmm0 - - vpaddd %xmm7,%xmm10,%xmm10 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm13,%xmm14,%xmm6 - vpxor %xmm2,%xmm0,%xmm0 - - vmovdqu %xmm4,96-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm0,%xmm5 - vpand %xmm12,%xmm6,%xmm6 - vpaddd %xmm0,%xmm0,%xmm0 - - vpslld $30,%xmm12,%xmm7 - vpaddd %xmm6,%xmm10,%xmm10 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpor %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vpxor %xmm3,%xmm1,%xmm1 - vmovdqa 160-128(%rax),%xmm3 - - vpaddd %xmm15,%xmm14,%xmm14 - vpslld $5,%xmm10,%xmm8 - vpand %xmm12,%xmm13,%xmm7 - vpxor 0-128(%rax),%xmm1,%xmm1 - - vpaddd %xmm7,%xmm14,%xmm14 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm12,%xmm13,%xmm6 - vpxor %xmm3,%xmm1,%xmm1 - - vmovdqu %xmm0,112-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm1,%xmm5 - vpand %xmm11,%xmm6,%xmm6 - vpaddd %xmm1,%xmm1,%xmm1 - - vpslld $30,%xmm11,%xmm7 - vpaddd %xmm6,%xmm14,%xmm14 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpor %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpxor %xmm4,%xmm2,%xmm2 - vmovdqa 176-128(%rax),%xmm4 - - vpaddd %xmm15,%xmm13,%xmm13 - vpslld $5,%xmm14,%xmm8 - vpand %xmm11,%xmm12,%xmm7 - vpxor 16-128(%rax),%xmm2,%xmm2 - - vpaddd %xmm7,%xmm13,%xmm13 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm11,%xmm12,%xmm6 - vpxor %xmm4,%xmm2,%xmm2 - - vmovdqu %xmm1,128-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm2,%xmm5 - vpand %xmm10,%xmm6,%xmm6 - vpaddd %xmm2,%xmm2,%xmm2 - - vpslld $30,%xmm10,%xmm7 - vpaddd %xmm6,%xmm13,%xmm13 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpor %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpxor %xmm0,%xmm3,%xmm3 - vmovdqa 192-128(%rax),%xmm0 - - vpaddd %xmm15,%xmm12,%xmm12 - vpslld $5,%xmm13,%xmm8 - vpand %xmm10,%xmm11,%xmm7 - vpxor 32-128(%rax),%xmm3,%xmm3 - - vpaddd %xmm7,%xmm12,%xmm12 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm10,%xmm11,%xmm6 - vpxor %xmm0,%xmm3,%xmm3 - - vmovdqu %xmm2,144-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm3,%xmm5 - vpand %xmm14,%xmm6,%xmm6 - vpaddd %xmm3,%xmm3,%xmm3 - - vpslld $30,%xmm14,%xmm7 - vpaddd %xmm6,%xmm12,%xmm12 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpor %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqa 208-128(%rax),%xmm1 - - vpaddd %xmm15,%xmm11,%xmm11 - vpslld $5,%xmm12,%xmm8 - vpand %xmm14,%xmm10,%xmm7 - vpxor 48-128(%rax),%xmm4,%xmm4 - - vpaddd %xmm7,%xmm11,%xmm11 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm14,%xmm10,%xmm6 - vpxor %xmm1,%xmm4,%xmm4 - - vmovdqu %xmm3,160-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm4,%xmm5 - vpand %xmm13,%xmm6,%xmm6 - vpaddd %xmm4,%xmm4,%xmm4 - - vpslld $30,%xmm13,%xmm7 - vpaddd %xmm6,%xmm11,%xmm11 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpor %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpxor %xmm2,%xmm0,%xmm0 - vmovdqa 224-128(%rax),%xmm2 - - vpaddd %xmm15,%xmm10,%xmm10 - vpslld $5,%xmm11,%xmm8 - vpand %xmm13,%xmm14,%xmm7 - vpxor 64-128(%rax),%xmm0,%xmm0 - - vpaddd %xmm7,%xmm10,%xmm10 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm13,%xmm14,%xmm6 - vpxor %xmm2,%xmm0,%xmm0 - - vmovdqu %xmm4,176-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm0,%xmm5 - vpand %xmm12,%xmm6,%xmm6 - vpaddd %xmm0,%xmm0,%xmm0 - - vpslld $30,%xmm12,%xmm7 - vpaddd %xmm6,%xmm10,%xmm10 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpor %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vmovdqa 64(%rbp),%xmm15 - vpxor %xmm3,%xmm1,%xmm1 - vmovdqa 240-128(%rax),%xmm3 - - vpslld $5,%xmm10,%xmm8 - vpaddd %xmm15,%xmm14,%xmm14 - vpxor %xmm11,%xmm13,%xmm6 - vmovdqa %xmm0,192-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpxor 80-128(%rax),%xmm1,%xmm1 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm12,%xmm6,%xmm6 - vpxor %xmm3,%xmm1,%xmm1 - - vpslld $30,%xmm11,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm14,%xmm14 - vpsrld $31,%xmm1,%xmm5 - vpaddd %xmm1,%xmm1,%xmm1 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpor %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpxor %xmm4,%xmm2,%xmm2 - vmovdqa 0-128(%rax),%xmm4 - - vpslld $5,%xmm14,%xmm8 - vpaddd %xmm15,%xmm13,%xmm13 - vpxor %xmm10,%xmm12,%xmm6 - vmovdqa %xmm1,208-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpxor 96-128(%rax),%xmm2,%xmm2 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm11,%xmm6,%xmm6 - vpxor %xmm4,%xmm2,%xmm2 - - vpslld $30,%xmm10,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm13,%xmm13 - vpsrld $31,%xmm2,%xmm5 - vpaddd %xmm2,%xmm2,%xmm2 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpor %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpxor %xmm0,%xmm3,%xmm3 - vmovdqa 16-128(%rax),%xmm0 - - vpslld $5,%xmm13,%xmm8 - vpaddd %xmm15,%xmm12,%xmm12 - vpxor %xmm14,%xmm11,%xmm6 - vmovdqa %xmm2,224-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpxor 112-128(%rax),%xmm3,%xmm3 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm10,%xmm6,%xmm6 - vpxor %xmm0,%xmm3,%xmm3 - - vpslld $30,%xmm14,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm12,%xmm12 - vpsrld $31,%xmm3,%xmm5 - vpaddd %xmm3,%xmm3,%xmm3 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpor %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqa 32-128(%rax),%xmm1 - - vpslld $5,%xmm12,%xmm8 - vpaddd %xmm15,%xmm11,%xmm11 - vpxor %xmm13,%xmm10,%xmm6 - vmovdqa %xmm3,240-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpxor 128-128(%rax),%xmm4,%xmm4 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm14,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm4 - - vpslld $30,%xmm13,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm11,%xmm11 - vpsrld $31,%xmm4,%xmm5 - vpaddd %xmm4,%xmm4,%xmm4 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpor %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpxor %xmm2,%xmm0,%xmm0 - vmovdqa 48-128(%rax),%xmm2 - - vpslld $5,%xmm11,%xmm8 - vpaddd %xmm15,%xmm10,%xmm10 - vpxor %xmm12,%xmm14,%xmm6 - vmovdqa %xmm4,0-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpxor 144-128(%rax),%xmm0,%xmm0 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm13,%xmm6,%xmm6 - vpxor %xmm2,%xmm0,%xmm0 - - vpslld $30,%xmm12,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm10,%xmm10 - vpsrld $31,%xmm0,%xmm5 - vpaddd %xmm0,%xmm0,%xmm0 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpor %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vpxor %xmm3,%xmm1,%xmm1 - vmovdqa 64-128(%rax),%xmm3 - - vpslld $5,%xmm10,%xmm8 - vpaddd %xmm15,%xmm14,%xmm14 - vpxor %xmm11,%xmm13,%xmm6 - vmovdqa %xmm0,16-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpxor 160-128(%rax),%xmm1,%xmm1 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm12,%xmm6,%xmm6 - vpxor %xmm3,%xmm1,%xmm1 - - vpslld $30,%xmm11,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm14,%xmm14 - vpsrld $31,%xmm1,%xmm5 - vpaddd %xmm1,%xmm1,%xmm1 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpor %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpxor %xmm4,%xmm2,%xmm2 - vmovdqa 80-128(%rax),%xmm4 - - vpslld $5,%xmm14,%xmm8 - vpaddd %xmm15,%xmm13,%xmm13 - vpxor %xmm10,%xmm12,%xmm6 - vmovdqa %xmm1,32-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpxor 176-128(%rax),%xmm2,%xmm2 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm11,%xmm6,%xmm6 - vpxor %xmm4,%xmm2,%xmm2 - - vpslld $30,%xmm10,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm13,%xmm13 - vpsrld $31,%xmm2,%xmm5 - vpaddd %xmm2,%xmm2,%xmm2 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpor %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpxor %xmm0,%xmm3,%xmm3 - vmovdqa 96-128(%rax),%xmm0 - - vpslld $5,%xmm13,%xmm8 - vpaddd %xmm15,%xmm12,%xmm12 - vpxor %xmm14,%xmm11,%xmm6 - vmovdqa %xmm2,48-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpxor 192-128(%rax),%xmm3,%xmm3 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm10,%xmm6,%xmm6 - vpxor %xmm0,%xmm3,%xmm3 - - vpslld $30,%xmm14,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm12,%xmm12 - vpsrld $31,%xmm3,%xmm5 - vpaddd %xmm3,%xmm3,%xmm3 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpor %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqa 112-128(%rax),%xmm1 - - vpslld $5,%xmm12,%xmm8 - vpaddd %xmm15,%xmm11,%xmm11 - vpxor %xmm13,%xmm10,%xmm6 - vmovdqa %xmm3,64-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpxor 208-128(%rax),%xmm4,%xmm4 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm14,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm4 - - vpslld $30,%xmm13,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm11,%xmm11 - vpsrld $31,%xmm4,%xmm5 - vpaddd %xmm4,%xmm4,%xmm4 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpor %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpxor %xmm2,%xmm0,%xmm0 - vmovdqa 128-128(%rax),%xmm2 - - vpslld $5,%xmm11,%xmm8 - vpaddd %xmm15,%xmm10,%xmm10 - vpxor %xmm12,%xmm14,%xmm6 - vmovdqa %xmm4,80-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpxor 224-128(%rax),%xmm0,%xmm0 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm13,%xmm6,%xmm6 - vpxor %xmm2,%xmm0,%xmm0 - - vpslld $30,%xmm12,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm10,%xmm10 - vpsrld $31,%xmm0,%xmm5 - vpaddd %xmm0,%xmm0,%xmm0 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpor %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vpxor %xmm3,%xmm1,%xmm1 - vmovdqa 144-128(%rax),%xmm3 - - vpslld $5,%xmm10,%xmm8 - vpaddd %xmm15,%xmm14,%xmm14 - vpxor %xmm11,%xmm13,%xmm6 - vmovdqa %xmm0,96-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpxor 240-128(%rax),%xmm1,%xmm1 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm12,%xmm6,%xmm6 - vpxor %xmm3,%xmm1,%xmm1 - - vpslld $30,%xmm11,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm14,%xmm14 - vpsrld $31,%xmm1,%xmm5 - vpaddd %xmm1,%xmm1,%xmm1 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpor %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpxor %xmm4,%xmm2,%xmm2 - vmovdqa 160-128(%rax),%xmm4 - - vpslld $5,%xmm14,%xmm8 - vpaddd %xmm15,%xmm13,%xmm13 - vpxor %xmm10,%xmm12,%xmm6 - vmovdqa %xmm1,112-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpxor 0-128(%rax),%xmm2,%xmm2 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm11,%xmm6,%xmm6 - vpxor %xmm4,%xmm2,%xmm2 - - vpslld $30,%xmm10,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm13,%xmm13 - vpsrld $31,%xmm2,%xmm5 - vpaddd %xmm2,%xmm2,%xmm2 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpor %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpxor %xmm0,%xmm3,%xmm3 - vmovdqa 176-128(%rax),%xmm0 - - vpslld $5,%xmm13,%xmm8 - vpaddd %xmm15,%xmm12,%xmm12 - vpxor %xmm14,%xmm11,%xmm6 - vpaddd %xmm2,%xmm12,%xmm12 - vpxor 16-128(%rax),%xmm3,%xmm3 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm10,%xmm6,%xmm6 - vpxor %xmm0,%xmm3,%xmm3 - - vpslld $30,%xmm14,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm12,%xmm12 - vpsrld $31,%xmm3,%xmm5 - vpaddd %xmm3,%xmm3,%xmm3 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpor %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqa 192-128(%rax),%xmm1 - - vpslld $5,%xmm12,%xmm8 - vpaddd %xmm15,%xmm11,%xmm11 - vpxor %xmm13,%xmm10,%xmm6 - vpaddd %xmm3,%xmm11,%xmm11 - vpxor 32-128(%rax),%xmm4,%xmm4 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm14,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm4 - - vpslld $30,%xmm13,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm11,%xmm11 - vpsrld $31,%xmm4,%xmm5 - vpaddd %xmm4,%xmm4,%xmm4 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpor %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpxor %xmm2,%xmm0,%xmm0 - vmovdqa 208-128(%rax),%xmm2 - - vpslld $5,%xmm11,%xmm8 - vpaddd %xmm15,%xmm10,%xmm10 - vpxor %xmm12,%xmm14,%xmm6 - vpaddd %xmm4,%xmm10,%xmm10 - vpxor 48-128(%rax),%xmm0,%xmm0 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm13,%xmm6,%xmm6 - vpxor %xmm2,%xmm0,%xmm0 - - vpslld $30,%xmm12,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm10,%xmm10 - vpsrld $31,%xmm0,%xmm5 - vpaddd %xmm0,%xmm0,%xmm0 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpor %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vpxor %xmm3,%xmm1,%xmm1 - vmovdqa 224-128(%rax),%xmm3 - - vpslld $5,%xmm10,%xmm8 - vpaddd %xmm15,%xmm14,%xmm14 - vpxor %xmm11,%xmm13,%xmm6 - vpaddd %xmm0,%xmm14,%xmm14 - vpxor 64-128(%rax),%xmm1,%xmm1 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm12,%xmm6,%xmm6 - vpxor %xmm3,%xmm1,%xmm1 - - vpslld $30,%xmm11,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm14,%xmm14 - vpsrld $31,%xmm1,%xmm5 - vpaddd %xmm1,%xmm1,%xmm1 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpor %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpxor %xmm4,%xmm2,%xmm2 - vmovdqa 240-128(%rax),%xmm4 - - vpslld $5,%xmm14,%xmm8 - vpaddd %xmm15,%xmm13,%xmm13 - vpxor %xmm10,%xmm12,%xmm6 - vpaddd %xmm1,%xmm13,%xmm13 - vpxor 80-128(%rax),%xmm2,%xmm2 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm11,%xmm6,%xmm6 - vpxor %xmm4,%xmm2,%xmm2 - - vpslld $30,%xmm10,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm13,%xmm13 - vpsrld $31,%xmm2,%xmm5 - vpaddd %xmm2,%xmm2,%xmm2 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpor %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpxor %xmm0,%xmm3,%xmm3 - vmovdqa 0-128(%rax),%xmm0 - - vpslld $5,%xmm13,%xmm8 - vpaddd %xmm15,%xmm12,%xmm12 - vpxor %xmm14,%xmm11,%xmm6 - vpaddd %xmm2,%xmm12,%xmm12 - vpxor 96-128(%rax),%xmm3,%xmm3 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm10,%xmm6,%xmm6 - vpxor %xmm0,%xmm3,%xmm3 - - vpslld $30,%xmm14,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm12,%xmm12 - vpsrld $31,%xmm3,%xmm5 - vpaddd %xmm3,%xmm3,%xmm3 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpor %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqa 16-128(%rax),%xmm1 - - vpslld $5,%xmm12,%xmm8 - vpaddd %xmm15,%xmm11,%xmm11 - vpxor %xmm13,%xmm10,%xmm6 - vpaddd %xmm3,%xmm11,%xmm11 - vpxor 112-128(%rax),%xmm4,%xmm4 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm14,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm4 - - vpslld $30,%xmm13,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm11,%xmm11 - vpsrld $31,%xmm4,%xmm5 - vpaddd %xmm4,%xmm4,%xmm4 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpor %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpslld $5,%xmm11,%xmm8 - vpaddd %xmm15,%xmm10,%xmm10 - vpxor %xmm12,%xmm14,%xmm6 - - vpsrld $27,%xmm11,%xmm9 - vpaddd %xmm4,%xmm10,%xmm10 - vpxor %xmm13,%xmm6,%xmm6 - - vpslld $30,%xmm12,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm10,%xmm10 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpor %xmm7,%xmm12,%xmm12 - movl $1,%ecx - cmpl 0(%rbx),%ecx - cmovgeq %rbp,%r8 - cmpl 4(%rbx),%ecx - cmovgeq %rbp,%r9 - cmpl 8(%rbx),%ecx - cmovgeq %rbp,%r10 - cmpl 12(%rbx),%ecx - cmovgeq %rbp,%r11 - vmovdqu (%rbx),%xmm6 - vpxor %xmm8,%xmm8,%xmm8 - vmovdqa %xmm6,%xmm7 - vpcmpgtd %xmm8,%xmm7,%xmm7 - vpaddd %xmm7,%xmm6,%xmm6 - - vpand %xmm7,%xmm10,%xmm10 - vpand %xmm7,%xmm11,%xmm11 - vpaddd 0(%rdi),%xmm10,%xmm10 - vpand %xmm7,%xmm12,%xmm12 - vpaddd 32(%rdi),%xmm11,%xmm11 - vpand %xmm7,%xmm13,%xmm13 - vpaddd 64(%rdi),%xmm12,%xmm12 - vpand %xmm7,%xmm14,%xmm14 - vpaddd 96(%rdi),%xmm13,%xmm13 - vpaddd 128(%rdi),%xmm14,%xmm14 - vmovdqu %xmm10,0(%rdi) - vmovdqu %xmm11,32(%rdi) - vmovdqu %xmm12,64(%rdi) - vmovdqu %xmm13,96(%rdi) - vmovdqu %xmm14,128(%rdi) - - vmovdqu %xmm6,(%rbx) - vmovdqu 96(%rbp),%xmm5 - decl %edx - jnz .Loop_avx - - movl 280(%rsp),%edx - leaq 16(%rdi),%rdi - leaq 64(%rsi),%rsi - decl %edx - jnz .Loop_grande_avx - -.Ldone_avx: - movq 272(%rsp),%rax - vzeroupper - movq -16(%rax),%rbp - movq -8(%rax),%rbx - leaq (%rax),%rsp -.Lepilogue_avx: - .byte 0xf3,0xc3 -.size sha1_multi_block_avx,.-sha1_multi_block_avx -.type sha1_multi_block_avx2,@function -.align 32 -sha1_multi_block_avx2: -_avx2_shortcut: - movq %rsp,%rax - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - subq $576,%rsp - andq $-256,%rsp - movq %rax,544(%rsp) -.Lbody_avx2: - leaq K_XX_XX(%rip),%rbp - shrl $1,%edx - - vzeroupper -.Loop_grande_avx2: - movl %edx,552(%rsp) - xorl %edx,%edx - leaq 512(%rsp),%rbx - movq 0(%rsi),%r12 - movl 8(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,0(%rbx) - cmovleq %rbp,%r12 - movq 16(%rsi),%r13 - movl 24(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,4(%rbx) - cmovleq %rbp,%r13 - movq 32(%rsi),%r14 - movl 40(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,8(%rbx) - cmovleq %rbp,%r14 - movq 48(%rsi),%r15 - movl 56(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,12(%rbx) - cmovleq %rbp,%r15 - movq 64(%rsi),%r8 - movl 72(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,16(%rbx) - cmovleq %rbp,%r8 - movq 80(%rsi),%r9 - movl 88(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,20(%rbx) - cmovleq %rbp,%r9 - movq 96(%rsi),%r10 - movl 104(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,24(%rbx) - cmovleq %rbp,%r10 - movq 112(%rsi),%r11 - movl 120(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,28(%rbx) - cmovleq %rbp,%r11 - vmovdqu 0(%rdi),%ymm0 - leaq 128(%rsp),%rax - vmovdqu 32(%rdi),%ymm1 - leaq 256+128(%rsp),%rbx - vmovdqu 64(%rdi),%ymm2 - vmovdqu 96(%rdi),%ymm3 - vmovdqu 128(%rdi),%ymm4 - vmovdqu 96(%rbp),%ymm9 - jmp .Loop_avx2 - -.align 32 -.Loop_avx2: - vmovdqa -32(%rbp),%ymm15 - vmovd (%r12),%xmm10 - leaq 64(%r12),%r12 - vmovd (%r8),%xmm12 - leaq 64(%r8),%r8 - vmovd (%r13),%xmm7 - leaq 64(%r13),%r13 - vmovd (%r9),%xmm6 - leaq 64(%r9),%r9 - vpinsrd $1,(%r14),%xmm10,%xmm10 - leaq 64(%r14),%r14 - vpinsrd $1,(%r10),%xmm12,%xmm12 - leaq 64(%r10),%r10 - vpinsrd $1,(%r15),%xmm7,%xmm7 - leaq 64(%r15),%r15 - vpunpckldq %ymm7,%ymm10,%ymm10 - vpinsrd $1,(%r11),%xmm6,%xmm6 - leaq 64(%r11),%r11 - vpunpckldq %ymm6,%ymm12,%ymm12 - vmovd -60(%r12),%xmm11 - vinserti128 $1,%xmm12,%ymm10,%ymm10 - vmovd -60(%r8),%xmm8 - vpshufb %ymm9,%ymm10,%ymm10 - vmovd -60(%r13),%xmm7 - vmovd -60(%r9),%xmm6 - vpinsrd $1,-60(%r14),%xmm11,%xmm11 - vpinsrd $1,-60(%r10),%xmm8,%xmm8 - vpinsrd $1,-60(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm11,%ymm11 - vpinsrd $1,-60(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm4,%ymm4 - vpslld $5,%ymm0,%ymm7 - vpandn %ymm3,%ymm1,%ymm6 - vpand %ymm2,%ymm1,%ymm5 - - vmovdqa %ymm10,0-128(%rax) - vpaddd %ymm10,%ymm4,%ymm4 - vinserti128 $1,%xmm8,%ymm11,%ymm11 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -56(%r12),%xmm12 - - vpslld $30,%ymm1,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -56(%r8),%xmm8 - vpaddd %ymm5,%ymm4,%ymm4 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpshufb %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vmovd -56(%r13),%xmm7 - vmovd -56(%r9),%xmm6 - vpinsrd $1,-56(%r14),%xmm12,%xmm12 - vpinsrd $1,-56(%r10),%xmm8,%xmm8 - vpinsrd $1,-56(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm12,%ymm12 - vpinsrd $1,-56(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm3,%ymm3 - vpslld $5,%ymm4,%ymm7 - vpandn %ymm2,%ymm0,%ymm6 - vpand %ymm1,%ymm0,%ymm5 - - vmovdqa %ymm11,32-128(%rax) - vpaddd %ymm11,%ymm3,%ymm3 - vinserti128 $1,%xmm8,%ymm12,%ymm12 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -52(%r12),%xmm13 - - vpslld $30,%ymm0,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -52(%r8),%xmm8 - vpaddd %ymm5,%ymm3,%ymm3 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpshufb %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vmovd -52(%r13),%xmm7 - vmovd -52(%r9),%xmm6 - vpinsrd $1,-52(%r14),%xmm13,%xmm13 - vpinsrd $1,-52(%r10),%xmm8,%xmm8 - vpinsrd $1,-52(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm13,%ymm13 - vpinsrd $1,-52(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm2,%ymm2 - vpslld $5,%ymm3,%ymm7 - vpandn %ymm1,%ymm4,%ymm6 - vpand %ymm0,%ymm4,%ymm5 - - vmovdqa %ymm12,64-128(%rax) - vpaddd %ymm12,%ymm2,%ymm2 - vinserti128 $1,%xmm8,%ymm13,%ymm13 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -48(%r12),%xmm14 - - vpslld $30,%ymm4,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -48(%r8),%xmm8 - vpaddd %ymm5,%ymm2,%ymm2 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpshufb %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vmovd -48(%r13),%xmm7 - vmovd -48(%r9),%xmm6 - vpinsrd $1,-48(%r14),%xmm14,%xmm14 - vpinsrd $1,-48(%r10),%xmm8,%xmm8 - vpinsrd $1,-48(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm14,%ymm14 - vpinsrd $1,-48(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm1,%ymm1 - vpslld $5,%ymm2,%ymm7 - vpandn %ymm0,%ymm3,%ymm6 - vpand %ymm4,%ymm3,%ymm5 - - vmovdqa %ymm13,96-128(%rax) - vpaddd %ymm13,%ymm1,%ymm1 - vinserti128 $1,%xmm8,%ymm14,%ymm14 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -44(%r12),%xmm10 - - vpslld $30,%ymm3,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -44(%r8),%xmm8 - vpaddd %ymm5,%ymm1,%ymm1 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpshufb %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vmovd -44(%r13),%xmm7 - vmovd -44(%r9),%xmm6 - vpinsrd $1,-44(%r14),%xmm10,%xmm10 - vpinsrd $1,-44(%r10),%xmm8,%xmm8 - vpinsrd $1,-44(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm10,%ymm10 - vpinsrd $1,-44(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm0,%ymm0 - vpslld $5,%ymm1,%ymm7 - vpandn %ymm4,%ymm2,%ymm6 - vpand %ymm3,%ymm2,%ymm5 - - vmovdqa %ymm14,128-128(%rax) - vpaddd %ymm14,%ymm0,%ymm0 - vinserti128 $1,%xmm8,%ymm10,%ymm10 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -40(%r12),%xmm11 - - vpslld $30,%ymm2,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -40(%r8),%xmm8 - vpaddd %ymm5,%ymm0,%ymm0 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpshufb %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vmovd -40(%r13),%xmm7 - vmovd -40(%r9),%xmm6 - vpinsrd $1,-40(%r14),%xmm11,%xmm11 - vpinsrd $1,-40(%r10),%xmm8,%xmm8 - vpinsrd $1,-40(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm11,%ymm11 - vpinsrd $1,-40(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm4,%ymm4 - vpslld $5,%ymm0,%ymm7 - vpandn %ymm3,%ymm1,%ymm6 - vpand %ymm2,%ymm1,%ymm5 - - vmovdqa %ymm10,160-128(%rax) - vpaddd %ymm10,%ymm4,%ymm4 - vinserti128 $1,%xmm8,%ymm11,%ymm11 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -36(%r12),%xmm12 - - vpslld $30,%ymm1,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -36(%r8),%xmm8 - vpaddd %ymm5,%ymm4,%ymm4 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpshufb %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vmovd -36(%r13),%xmm7 - vmovd -36(%r9),%xmm6 - vpinsrd $1,-36(%r14),%xmm12,%xmm12 - vpinsrd $1,-36(%r10),%xmm8,%xmm8 - vpinsrd $1,-36(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm12,%ymm12 - vpinsrd $1,-36(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm3,%ymm3 - vpslld $5,%ymm4,%ymm7 - vpandn %ymm2,%ymm0,%ymm6 - vpand %ymm1,%ymm0,%ymm5 - - vmovdqa %ymm11,192-128(%rax) - vpaddd %ymm11,%ymm3,%ymm3 - vinserti128 $1,%xmm8,%ymm12,%ymm12 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -32(%r12),%xmm13 - - vpslld $30,%ymm0,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -32(%r8),%xmm8 - vpaddd %ymm5,%ymm3,%ymm3 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpshufb %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vmovd -32(%r13),%xmm7 - vmovd -32(%r9),%xmm6 - vpinsrd $1,-32(%r14),%xmm13,%xmm13 - vpinsrd $1,-32(%r10),%xmm8,%xmm8 - vpinsrd $1,-32(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm13,%ymm13 - vpinsrd $1,-32(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm2,%ymm2 - vpslld $5,%ymm3,%ymm7 - vpandn %ymm1,%ymm4,%ymm6 - vpand %ymm0,%ymm4,%ymm5 - - vmovdqa %ymm12,224-128(%rax) - vpaddd %ymm12,%ymm2,%ymm2 - vinserti128 $1,%xmm8,%ymm13,%ymm13 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -28(%r12),%xmm14 - - vpslld $30,%ymm4,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -28(%r8),%xmm8 - vpaddd %ymm5,%ymm2,%ymm2 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpshufb %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vmovd -28(%r13),%xmm7 - vmovd -28(%r9),%xmm6 - vpinsrd $1,-28(%r14),%xmm14,%xmm14 - vpinsrd $1,-28(%r10),%xmm8,%xmm8 - vpinsrd $1,-28(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm14,%ymm14 - vpinsrd $1,-28(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm1,%ymm1 - vpslld $5,%ymm2,%ymm7 - vpandn %ymm0,%ymm3,%ymm6 - vpand %ymm4,%ymm3,%ymm5 - - vmovdqa %ymm13,256-256-128(%rbx) - vpaddd %ymm13,%ymm1,%ymm1 - vinserti128 $1,%xmm8,%ymm14,%ymm14 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -24(%r12),%xmm10 - - vpslld $30,%ymm3,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -24(%r8),%xmm8 - vpaddd %ymm5,%ymm1,%ymm1 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpshufb %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vmovd -24(%r13),%xmm7 - vmovd -24(%r9),%xmm6 - vpinsrd $1,-24(%r14),%xmm10,%xmm10 - vpinsrd $1,-24(%r10),%xmm8,%xmm8 - vpinsrd $1,-24(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm10,%ymm10 - vpinsrd $1,-24(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm0,%ymm0 - vpslld $5,%ymm1,%ymm7 - vpandn %ymm4,%ymm2,%ymm6 - vpand %ymm3,%ymm2,%ymm5 - - vmovdqa %ymm14,288-256-128(%rbx) - vpaddd %ymm14,%ymm0,%ymm0 - vinserti128 $1,%xmm8,%ymm10,%ymm10 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -20(%r12),%xmm11 - - vpslld $30,%ymm2,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -20(%r8),%xmm8 - vpaddd %ymm5,%ymm0,%ymm0 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpshufb %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vmovd -20(%r13),%xmm7 - vmovd -20(%r9),%xmm6 - vpinsrd $1,-20(%r14),%xmm11,%xmm11 - vpinsrd $1,-20(%r10),%xmm8,%xmm8 - vpinsrd $1,-20(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm11,%ymm11 - vpinsrd $1,-20(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm4,%ymm4 - vpslld $5,%ymm0,%ymm7 - vpandn %ymm3,%ymm1,%ymm6 - vpand %ymm2,%ymm1,%ymm5 - - vmovdqa %ymm10,320-256-128(%rbx) - vpaddd %ymm10,%ymm4,%ymm4 - vinserti128 $1,%xmm8,%ymm11,%ymm11 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -16(%r12),%xmm12 - - vpslld $30,%ymm1,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -16(%r8),%xmm8 - vpaddd %ymm5,%ymm4,%ymm4 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpshufb %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vmovd -16(%r13),%xmm7 - vmovd -16(%r9),%xmm6 - vpinsrd $1,-16(%r14),%xmm12,%xmm12 - vpinsrd $1,-16(%r10),%xmm8,%xmm8 - vpinsrd $1,-16(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm12,%ymm12 - vpinsrd $1,-16(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm3,%ymm3 - vpslld $5,%ymm4,%ymm7 - vpandn %ymm2,%ymm0,%ymm6 - vpand %ymm1,%ymm0,%ymm5 - - vmovdqa %ymm11,352-256-128(%rbx) - vpaddd %ymm11,%ymm3,%ymm3 - vinserti128 $1,%xmm8,%ymm12,%ymm12 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -12(%r12),%xmm13 - - vpslld $30,%ymm0,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -12(%r8),%xmm8 - vpaddd %ymm5,%ymm3,%ymm3 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpshufb %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vmovd -12(%r13),%xmm7 - vmovd -12(%r9),%xmm6 - vpinsrd $1,-12(%r14),%xmm13,%xmm13 - vpinsrd $1,-12(%r10),%xmm8,%xmm8 - vpinsrd $1,-12(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm13,%ymm13 - vpinsrd $1,-12(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm2,%ymm2 - vpslld $5,%ymm3,%ymm7 - vpandn %ymm1,%ymm4,%ymm6 - vpand %ymm0,%ymm4,%ymm5 - - vmovdqa %ymm12,384-256-128(%rbx) - vpaddd %ymm12,%ymm2,%ymm2 - vinserti128 $1,%xmm8,%ymm13,%ymm13 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -8(%r12),%xmm14 - - vpslld $30,%ymm4,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -8(%r8),%xmm8 - vpaddd %ymm5,%ymm2,%ymm2 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpshufb %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vmovd -8(%r13),%xmm7 - vmovd -8(%r9),%xmm6 - vpinsrd $1,-8(%r14),%xmm14,%xmm14 - vpinsrd $1,-8(%r10),%xmm8,%xmm8 - vpinsrd $1,-8(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm14,%ymm14 - vpinsrd $1,-8(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm1,%ymm1 - vpslld $5,%ymm2,%ymm7 - vpandn %ymm0,%ymm3,%ymm6 - vpand %ymm4,%ymm3,%ymm5 - - vmovdqa %ymm13,416-256-128(%rbx) - vpaddd %ymm13,%ymm1,%ymm1 - vinserti128 $1,%xmm8,%ymm14,%ymm14 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -4(%r12),%xmm10 - - vpslld $30,%ymm3,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -4(%r8),%xmm8 - vpaddd %ymm5,%ymm1,%ymm1 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpshufb %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vmovdqa 0-128(%rax),%ymm11 - vmovd -4(%r13),%xmm7 - vmovd -4(%r9),%xmm6 - vpinsrd $1,-4(%r14),%xmm10,%xmm10 - vpinsrd $1,-4(%r10),%xmm8,%xmm8 - vpinsrd $1,-4(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm10,%ymm10 - vpinsrd $1,-4(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm0,%ymm0 - prefetcht0 63(%r12) - vpslld $5,%ymm1,%ymm7 - vpandn %ymm4,%ymm2,%ymm6 - vpand %ymm3,%ymm2,%ymm5 - - vmovdqa %ymm14,448-256-128(%rbx) - vpaddd %ymm14,%ymm0,%ymm0 - vinserti128 $1,%xmm8,%ymm10,%ymm10 - vpsrld $27,%ymm1,%ymm8 - prefetcht0 63(%r13) - vpxor %ymm6,%ymm5,%ymm5 - - vpslld $30,%ymm2,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - prefetcht0 63(%r14) - vpaddd %ymm5,%ymm0,%ymm0 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - prefetcht0 63(%r15) - vpshufb %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vmovdqa 32-128(%rax),%ymm12 - vpxor %ymm13,%ymm11,%ymm11 - vmovdqa 64-128(%rax),%ymm13 - - vpaddd %ymm15,%ymm4,%ymm4 - vpslld $5,%ymm0,%ymm7 - vpandn %ymm3,%ymm1,%ymm6 - prefetcht0 63(%r8) - vpand %ymm2,%ymm1,%ymm5 - - vmovdqa %ymm10,480-256-128(%rbx) - vpaddd %ymm10,%ymm4,%ymm4 - vpxor 256-256-128(%rbx),%ymm11,%ymm11 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vpxor %ymm13,%ymm11,%ymm11 - prefetcht0 63(%r9) - - vpslld $30,%ymm1,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm4,%ymm4 - prefetcht0 63(%r10) - vpsrld $31,%ymm11,%ymm9 - vpaddd %ymm11,%ymm11,%ymm11 - - vpsrld $2,%ymm1,%ymm1 - prefetcht0 63(%r11) - vpaddd %ymm7,%ymm4,%ymm4 - vpor %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vpxor %ymm14,%ymm12,%ymm12 - vmovdqa 96-128(%rax),%ymm14 - - vpaddd %ymm15,%ymm3,%ymm3 - vpslld $5,%ymm4,%ymm7 - vpandn %ymm2,%ymm0,%ymm6 - - vpand %ymm1,%ymm0,%ymm5 - - vmovdqa %ymm11,0-128(%rax) - vpaddd %ymm11,%ymm3,%ymm3 - vpxor 288-256-128(%rbx),%ymm12,%ymm12 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vpxor %ymm14,%ymm12,%ymm12 - - - vpslld $30,%ymm0,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm3,%ymm3 - - vpsrld $31,%ymm12,%ymm9 - vpaddd %ymm12,%ymm12,%ymm12 - - vpsrld $2,%ymm0,%ymm0 - - vpaddd %ymm7,%ymm3,%ymm3 - vpor %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vpxor %ymm10,%ymm13,%ymm13 - vmovdqa 128-128(%rax),%ymm10 - - vpaddd %ymm15,%ymm2,%ymm2 - vpslld $5,%ymm3,%ymm7 - vpandn %ymm1,%ymm4,%ymm6 - - vpand %ymm0,%ymm4,%ymm5 - - vmovdqa %ymm12,32-128(%rax) - vpaddd %ymm12,%ymm2,%ymm2 - vpxor 320-256-128(%rbx),%ymm13,%ymm13 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vpxor %ymm10,%ymm13,%ymm13 - - - vpslld $30,%ymm4,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm2,%ymm2 - - vpsrld $31,%ymm13,%ymm9 - vpaddd %ymm13,%ymm13,%ymm13 - - vpsrld $2,%ymm4,%ymm4 - - vpaddd %ymm7,%ymm2,%ymm2 - vpor %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vpxor %ymm11,%ymm14,%ymm14 - vmovdqa 160-128(%rax),%ymm11 - - vpaddd %ymm15,%ymm1,%ymm1 - vpslld $5,%ymm2,%ymm7 - vpandn %ymm0,%ymm3,%ymm6 - - vpand %ymm4,%ymm3,%ymm5 - - vmovdqa %ymm13,64-128(%rax) - vpaddd %ymm13,%ymm1,%ymm1 - vpxor 352-256-128(%rbx),%ymm14,%ymm14 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vpxor %ymm11,%ymm14,%ymm14 - - - vpslld $30,%ymm3,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm1,%ymm1 - - vpsrld $31,%ymm14,%ymm9 - vpaddd %ymm14,%ymm14,%ymm14 - - vpsrld $2,%ymm3,%ymm3 - - vpaddd %ymm7,%ymm1,%ymm1 - vpor %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vpxor %ymm12,%ymm10,%ymm10 - vmovdqa 192-128(%rax),%ymm12 - - vpaddd %ymm15,%ymm0,%ymm0 - vpslld $5,%ymm1,%ymm7 - vpandn %ymm4,%ymm2,%ymm6 - - vpand %ymm3,%ymm2,%ymm5 - - vmovdqa %ymm14,96-128(%rax) - vpaddd %ymm14,%ymm0,%ymm0 - vpxor 384-256-128(%rbx),%ymm10,%ymm10 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vpxor %ymm12,%ymm10,%ymm10 - - - vpslld $30,%ymm2,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm0,%ymm0 - - vpsrld $31,%ymm10,%ymm9 - vpaddd %ymm10,%ymm10,%ymm10 - - vpsrld $2,%ymm2,%ymm2 - - vpaddd %ymm7,%ymm0,%ymm0 - vpor %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vmovdqa 0(%rbp),%ymm15 - vpxor %ymm13,%ymm11,%ymm11 - vmovdqa 224-128(%rax),%ymm13 - - vpslld $5,%ymm0,%ymm7 - vpaddd %ymm15,%ymm4,%ymm4 - vpxor %ymm1,%ymm3,%ymm5 - vmovdqa %ymm10,128-128(%rax) - vpaddd %ymm10,%ymm4,%ymm4 - vpxor 416-256-128(%rbx),%ymm11,%ymm11 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm2,%ymm5,%ymm5 - vpxor %ymm13,%ymm11,%ymm11 - - vpslld $30,%ymm1,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm4,%ymm4 - vpsrld $31,%ymm11,%ymm9 - vpaddd %ymm11,%ymm11,%ymm11 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpor %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vpxor %ymm14,%ymm12,%ymm12 - vmovdqa 256-256-128(%rbx),%ymm14 - - vpslld $5,%ymm4,%ymm7 - vpaddd %ymm15,%ymm3,%ymm3 - vpxor %ymm0,%ymm2,%ymm5 - vmovdqa %ymm11,160-128(%rax) - vpaddd %ymm11,%ymm3,%ymm3 - vpxor 448-256-128(%rbx),%ymm12,%ymm12 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm1,%ymm5,%ymm5 - vpxor %ymm14,%ymm12,%ymm12 - - vpslld $30,%ymm0,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm3,%ymm3 - vpsrld $31,%ymm12,%ymm9 - vpaddd %ymm12,%ymm12,%ymm12 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpor %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vpxor %ymm10,%ymm13,%ymm13 - vmovdqa 288-256-128(%rbx),%ymm10 - - vpslld $5,%ymm3,%ymm7 - vpaddd %ymm15,%ymm2,%ymm2 - vpxor %ymm4,%ymm1,%ymm5 - vmovdqa %ymm12,192-128(%rax) - vpaddd %ymm12,%ymm2,%ymm2 - vpxor 480-256-128(%rbx),%ymm13,%ymm13 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm0,%ymm5,%ymm5 - vpxor %ymm10,%ymm13,%ymm13 - - vpslld $30,%ymm4,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm2,%ymm2 - vpsrld $31,%ymm13,%ymm9 - vpaddd %ymm13,%ymm13,%ymm13 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpor %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vpxor %ymm11,%ymm14,%ymm14 - vmovdqa 320-256-128(%rbx),%ymm11 - - vpslld $5,%ymm2,%ymm7 - vpaddd %ymm15,%ymm1,%ymm1 - vpxor %ymm3,%ymm0,%ymm5 - vmovdqa %ymm13,224-128(%rax) - vpaddd %ymm13,%ymm1,%ymm1 - vpxor 0-128(%rax),%ymm14,%ymm14 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm4,%ymm5,%ymm5 - vpxor %ymm11,%ymm14,%ymm14 - - vpslld $30,%ymm3,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm1,%ymm1 - vpsrld $31,%ymm14,%ymm9 - vpaddd %ymm14,%ymm14,%ymm14 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpor %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vpxor %ymm12,%ymm10,%ymm10 - vmovdqa 352-256-128(%rbx),%ymm12 - - vpslld $5,%ymm1,%ymm7 - vpaddd %ymm15,%ymm0,%ymm0 - vpxor %ymm2,%ymm4,%ymm5 - vmovdqa %ymm14,256-256-128(%rbx) - vpaddd %ymm14,%ymm0,%ymm0 - vpxor 32-128(%rax),%ymm10,%ymm10 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm3,%ymm5,%ymm5 - vpxor %ymm12,%ymm10,%ymm10 - - vpslld $30,%ymm2,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm0,%ymm0 - vpsrld $31,%ymm10,%ymm9 - vpaddd %ymm10,%ymm10,%ymm10 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpor %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vpxor %ymm13,%ymm11,%ymm11 - vmovdqa 384-256-128(%rbx),%ymm13 - - vpslld $5,%ymm0,%ymm7 - vpaddd %ymm15,%ymm4,%ymm4 - vpxor %ymm1,%ymm3,%ymm5 - vmovdqa %ymm10,288-256-128(%rbx) - vpaddd %ymm10,%ymm4,%ymm4 - vpxor 64-128(%rax),%ymm11,%ymm11 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm2,%ymm5,%ymm5 - vpxor %ymm13,%ymm11,%ymm11 - - vpslld $30,%ymm1,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm4,%ymm4 - vpsrld $31,%ymm11,%ymm9 - vpaddd %ymm11,%ymm11,%ymm11 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpor %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vpxor %ymm14,%ymm12,%ymm12 - vmovdqa 416-256-128(%rbx),%ymm14 - - vpslld $5,%ymm4,%ymm7 - vpaddd %ymm15,%ymm3,%ymm3 - vpxor %ymm0,%ymm2,%ymm5 - vmovdqa %ymm11,320-256-128(%rbx) - vpaddd %ymm11,%ymm3,%ymm3 - vpxor 96-128(%rax),%ymm12,%ymm12 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm1,%ymm5,%ymm5 - vpxor %ymm14,%ymm12,%ymm12 - - vpslld $30,%ymm0,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm3,%ymm3 - vpsrld $31,%ymm12,%ymm9 - vpaddd %ymm12,%ymm12,%ymm12 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpor %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vpxor %ymm10,%ymm13,%ymm13 - vmovdqa 448-256-128(%rbx),%ymm10 - - vpslld $5,%ymm3,%ymm7 - vpaddd %ymm15,%ymm2,%ymm2 - vpxor %ymm4,%ymm1,%ymm5 - vmovdqa %ymm12,352-256-128(%rbx) - vpaddd %ymm12,%ymm2,%ymm2 - vpxor 128-128(%rax),%ymm13,%ymm13 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm0,%ymm5,%ymm5 - vpxor %ymm10,%ymm13,%ymm13 - - vpslld $30,%ymm4,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm2,%ymm2 - vpsrld $31,%ymm13,%ymm9 - vpaddd %ymm13,%ymm13,%ymm13 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpor %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vpxor %ymm11,%ymm14,%ymm14 - vmovdqa 480-256-128(%rbx),%ymm11 - - vpslld $5,%ymm2,%ymm7 - vpaddd %ymm15,%ymm1,%ymm1 - vpxor %ymm3,%ymm0,%ymm5 - vmovdqa %ymm13,384-256-128(%rbx) - vpaddd %ymm13,%ymm1,%ymm1 - vpxor 160-128(%rax),%ymm14,%ymm14 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm4,%ymm5,%ymm5 - vpxor %ymm11,%ymm14,%ymm14 - - vpslld $30,%ymm3,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm1,%ymm1 - vpsrld $31,%ymm14,%ymm9 - vpaddd %ymm14,%ymm14,%ymm14 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpor %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vpxor %ymm12,%ymm10,%ymm10 - vmovdqa 0-128(%rax),%ymm12 - - vpslld $5,%ymm1,%ymm7 - vpaddd %ymm15,%ymm0,%ymm0 - vpxor %ymm2,%ymm4,%ymm5 - vmovdqa %ymm14,416-256-128(%rbx) - vpaddd %ymm14,%ymm0,%ymm0 - vpxor 192-128(%rax),%ymm10,%ymm10 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm3,%ymm5,%ymm5 - vpxor %ymm12,%ymm10,%ymm10 - - vpslld $30,%ymm2,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm0,%ymm0 - vpsrld $31,%ymm10,%ymm9 - vpaddd %ymm10,%ymm10,%ymm10 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpor %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vpxor %ymm13,%ymm11,%ymm11 - vmovdqa 32-128(%rax),%ymm13 - - vpslld $5,%ymm0,%ymm7 - vpaddd %ymm15,%ymm4,%ymm4 - vpxor %ymm1,%ymm3,%ymm5 - vmovdqa %ymm10,448-256-128(%rbx) - vpaddd %ymm10,%ymm4,%ymm4 - vpxor 224-128(%rax),%ymm11,%ymm11 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm2,%ymm5,%ymm5 - vpxor %ymm13,%ymm11,%ymm11 - - vpslld $30,%ymm1,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm4,%ymm4 - vpsrld $31,%ymm11,%ymm9 - vpaddd %ymm11,%ymm11,%ymm11 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpor %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vpxor %ymm14,%ymm12,%ymm12 - vmovdqa 64-128(%rax),%ymm14 - - vpslld $5,%ymm4,%ymm7 - vpaddd %ymm15,%ymm3,%ymm3 - vpxor %ymm0,%ymm2,%ymm5 - vmovdqa %ymm11,480-256-128(%rbx) - vpaddd %ymm11,%ymm3,%ymm3 - vpxor 256-256-128(%rbx),%ymm12,%ymm12 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm1,%ymm5,%ymm5 - vpxor %ymm14,%ymm12,%ymm12 - - vpslld $30,%ymm0,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm3,%ymm3 - vpsrld $31,%ymm12,%ymm9 - vpaddd %ymm12,%ymm12,%ymm12 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpor %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vpxor %ymm10,%ymm13,%ymm13 - vmovdqa 96-128(%rax),%ymm10 - - vpslld $5,%ymm3,%ymm7 - vpaddd %ymm15,%ymm2,%ymm2 - vpxor %ymm4,%ymm1,%ymm5 - vmovdqa %ymm12,0-128(%rax) - vpaddd %ymm12,%ymm2,%ymm2 - vpxor 288-256-128(%rbx),%ymm13,%ymm13 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm0,%ymm5,%ymm5 - vpxor %ymm10,%ymm13,%ymm13 - - vpslld $30,%ymm4,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm2,%ymm2 - vpsrld $31,%ymm13,%ymm9 - vpaddd %ymm13,%ymm13,%ymm13 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpor %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vpxor %ymm11,%ymm14,%ymm14 - vmovdqa 128-128(%rax),%ymm11 - - vpslld $5,%ymm2,%ymm7 - vpaddd %ymm15,%ymm1,%ymm1 - vpxor %ymm3,%ymm0,%ymm5 - vmovdqa %ymm13,32-128(%rax) - vpaddd %ymm13,%ymm1,%ymm1 - vpxor 320-256-128(%rbx),%ymm14,%ymm14 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm4,%ymm5,%ymm5 - vpxor %ymm11,%ymm14,%ymm14 - - vpslld $30,%ymm3,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm1,%ymm1 - vpsrld $31,%ymm14,%ymm9 - vpaddd %ymm14,%ymm14,%ymm14 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpor %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vpxor %ymm12,%ymm10,%ymm10 - vmovdqa 160-128(%rax),%ymm12 - - vpslld $5,%ymm1,%ymm7 - vpaddd %ymm15,%ymm0,%ymm0 - vpxor %ymm2,%ymm4,%ymm5 - vmovdqa %ymm14,64-128(%rax) - vpaddd %ymm14,%ymm0,%ymm0 - vpxor 352-256-128(%rbx),%ymm10,%ymm10 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm3,%ymm5,%ymm5 - vpxor %ymm12,%ymm10,%ymm10 - - vpslld $30,%ymm2,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm0,%ymm0 - vpsrld $31,%ymm10,%ymm9 - vpaddd %ymm10,%ymm10,%ymm10 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpor %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vpxor %ymm13,%ymm11,%ymm11 - vmovdqa 192-128(%rax),%ymm13 - - vpslld $5,%ymm0,%ymm7 - vpaddd %ymm15,%ymm4,%ymm4 - vpxor %ymm1,%ymm3,%ymm5 - vmovdqa %ymm10,96-128(%rax) - vpaddd %ymm10,%ymm4,%ymm4 - vpxor 384-256-128(%rbx),%ymm11,%ymm11 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm2,%ymm5,%ymm5 - vpxor %ymm13,%ymm11,%ymm11 - - vpslld $30,%ymm1,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm4,%ymm4 - vpsrld $31,%ymm11,%ymm9 - vpaddd %ymm11,%ymm11,%ymm11 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpor %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vpxor %ymm14,%ymm12,%ymm12 - vmovdqa 224-128(%rax),%ymm14 - - vpslld $5,%ymm4,%ymm7 - vpaddd %ymm15,%ymm3,%ymm3 - vpxor %ymm0,%ymm2,%ymm5 - vmovdqa %ymm11,128-128(%rax) - vpaddd %ymm11,%ymm3,%ymm3 - vpxor 416-256-128(%rbx),%ymm12,%ymm12 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm1,%ymm5,%ymm5 - vpxor %ymm14,%ymm12,%ymm12 - - vpslld $30,%ymm0,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm3,%ymm3 - vpsrld $31,%ymm12,%ymm9 - vpaddd %ymm12,%ymm12,%ymm12 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpor %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vpxor %ymm10,%ymm13,%ymm13 - vmovdqa 256-256-128(%rbx),%ymm10 - - vpslld $5,%ymm3,%ymm7 - vpaddd %ymm15,%ymm2,%ymm2 - vpxor %ymm4,%ymm1,%ymm5 - vmovdqa %ymm12,160-128(%rax) - vpaddd %ymm12,%ymm2,%ymm2 - vpxor 448-256-128(%rbx),%ymm13,%ymm13 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm0,%ymm5,%ymm5 - vpxor %ymm10,%ymm13,%ymm13 - - vpslld $30,%ymm4,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm2,%ymm2 - vpsrld $31,%ymm13,%ymm9 - vpaddd %ymm13,%ymm13,%ymm13 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpor %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vpxor %ymm11,%ymm14,%ymm14 - vmovdqa 288-256-128(%rbx),%ymm11 - - vpslld $5,%ymm2,%ymm7 - vpaddd %ymm15,%ymm1,%ymm1 - vpxor %ymm3,%ymm0,%ymm5 - vmovdqa %ymm13,192-128(%rax) - vpaddd %ymm13,%ymm1,%ymm1 - vpxor 480-256-128(%rbx),%ymm14,%ymm14 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm4,%ymm5,%ymm5 - vpxor %ymm11,%ymm14,%ymm14 - - vpslld $30,%ymm3,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm1,%ymm1 - vpsrld $31,%ymm14,%ymm9 - vpaddd %ymm14,%ymm14,%ymm14 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpor %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vpxor %ymm12,%ymm10,%ymm10 - vmovdqa 320-256-128(%rbx),%ymm12 - - vpslld $5,%ymm1,%ymm7 - vpaddd %ymm15,%ymm0,%ymm0 - vpxor %ymm2,%ymm4,%ymm5 - vmovdqa %ymm14,224-128(%rax) - vpaddd %ymm14,%ymm0,%ymm0 - vpxor 0-128(%rax),%ymm10,%ymm10 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm3,%ymm5,%ymm5 - vpxor %ymm12,%ymm10,%ymm10 - - vpslld $30,%ymm2,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm0,%ymm0 - vpsrld $31,%ymm10,%ymm9 - vpaddd %ymm10,%ymm10,%ymm10 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpor %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vmovdqa 32(%rbp),%ymm15 - vpxor %ymm13,%ymm11,%ymm11 - vmovdqa 352-256-128(%rbx),%ymm13 - - vpaddd %ymm15,%ymm4,%ymm4 - vpslld $5,%ymm0,%ymm7 - vpand %ymm2,%ymm3,%ymm6 - vpxor 32-128(%rax),%ymm11,%ymm11 - - vpaddd %ymm6,%ymm4,%ymm4 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm2,%ymm3,%ymm5 - vpxor %ymm13,%ymm11,%ymm11 - - vmovdqu %ymm10,256-256-128(%rbx) - vpaddd %ymm10,%ymm4,%ymm4 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm11,%ymm9 - vpand %ymm1,%ymm5,%ymm5 - vpaddd %ymm11,%ymm11,%ymm11 - - vpslld $30,%ymm1,%ymm6 - vpaddd %ymm5,%ymm4,%ymm4 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpor %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vpxor %ymm14,%ymm12,%ymm12 - vmovdqa 384-256-128(%rbx),%ymm14 - - vpaddd %ymm15,%ymm3,%ymm3 - vpslld $5,%ymm4,%ymm7 - vpand %ymm1,%ymm2,%ymm6 - vpxor 64-128(%rax),%ymm12,%ymm12 - - vpaddd %ymm6,%ymm3,%ymm3 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm1,%ymm2,%ymm5 - vpxor %ymm14,%ymm12,%ymm12 - - vmovdqu %ymm11,288-256-128(%rbx) - vpaddd %ymm11,%ymm3,%ymm3 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm12,%ymm9 - vpand %ymm0,%ymm5,%ymm5 - vpaddd %ymm12,%ymm12,%ymm12 - - vpslld $30,%ymm0,%ymm6 - vpaddd %ymm5,%ymm3,%ymm3 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpor %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vpxor %ymm10,%ymm13,%ymm13 - vmovdqa 416-256-128(%rbx),%ymm10 - - vpaddd %ymm15,%ymm2,%ymm2 - vpslld $5,%ymm3,%ymm7 - vpand %ymm0,%ymm1,%ymm6 - vpxor 96-128(%rax),%ymm13,%ymm13 - - vpaddd %ymm6,%ymm2,%ymm2 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm0,%ymm1,%ymm5 - vpxor %ymm10,%ymm13,%ymm13 - - vmovdqu %ymm12,320-256-128(%rbx) - vpaddd %ymm12,%ymm2,%ymm2 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm13,%ymm9 - vpand %ymm4,%ymm5,%ymm5 - vpaddd %ymm13,%ymm13,%ymm13 - - vpslld $30,%ymm4,%ymm6 - vpaddd %ymm5,%ymm2,%ymm2 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpor %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vpxor %ymm11,%ymm14,%ymm14 - vmovdqa 448-256-128(%rbx),%ymm11 - - vpaddd %ymm15,%ymm1,%ymm1 - vpslld $5,%ymm2,%ymm7 - vpand %ymm4,%ymm0,%ymm6 - vpxor 128-128(%rax),%ymm14,%ymm14 - - vpaddd %ymm6,%ymm1,%ymm1 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm4,%ymm0,%ymm5 - vpxor %ymm11,%ymm14,%ymm14 - - vmovdqu %ymm13,352-256-128(%rbx) - vpaddd %ymm13,%ymm1,%ymm1 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm14,%ymm9 - vpand %ymm3,%ymm5,%ymm5 - vpaddd %ymm14,%ymm14,%ymm14 - - vpslld $30,%ymm3,%ymm6 - vpaddd %ymm5,%ymm1,%ymm1 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpor %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vpxor %ymm12,%ymm10,%ymm10 - vmovdqa 480-256-128(%rbx),%ymm12 - - vpaddd %ymm15,%ymm0,%ymm0 - vpslld $5,%ymm1,%ymm7 - vpand %ymm3,%ymm4,%ymm6 - vpxor 160-128(%rax),%ymm10,%ymm10 - - vpaddd %ymm6,%ymm0,%ymm0 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm3,%ymm4,%ymm5 - vpxor %ymm12,%ymm10,%ymm10 - - vmovdqu %ymm14,384-256-128(%rbx) - vpaddd %ymm14,%ymm0,%ymm0 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm10,%ymm9 - vpand %ymm2,%ymm5,%ymm5 - vpaddd %ymm10,%ymm10,%ymm10 - - vpslld $30,%ymm2,%ymm6 - vpaddd %ymm5,%ymm0,%ymm0 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpor %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vpxor %ymm13,%ymm11,%ymm11 - vmovdqa 0-128(%rax),%ymm13 - - vpaddd %ymm15,%ymm4,%ymm4 - vpslld $5,%ymm0,%ymm7 - vpand %ymm2,%ymm3,%ymm6 - vpxor 192-128(%rax),%ymm11,%ymm11 - - vpaddd %ymm6,%ymm4,%ymm4 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm2,%ymm3,%ymm5 - vpxor %ymm13,%ymm11,%ymm11 - - vmovdqu %ymm10,416-256-128(%rbx) - vpaddd %ymm10,%ymm4,%ymm4 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm11,%ymm9 - vpand %ymm1,%ymm5,%ymm5 - vpaddd %ymm11,%ymm11,%ymm11 - - vpslld $30,%ymm1,%ymm6 - vpaddd %ymm5,%ymm4,%ymm4 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpor %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vpxor %ymm14,%ymm12,%ymm12 - vmovdqa 32-128(%rax),%ymm14 - - vpaddd %ymm15,%ymm3,%ymm3 - vpslld $5,%ymm4,%ymm7 - vpand %ymm1,%ymm2,%ymm6 - vpxor 224-128(%rax),%ymm12,%ymm12 - - vpaddd %ymm6,%ymm3,%ymm3 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm1,%ymm2,%ymm5 - vpxor %ymm14,%ymm12,%ymm12 - - vmovdqu %ymm11,448-256-128(%rbx) - vpaddd %ymm11,%ymm3,%ymm3 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm12,%ymm9 - vpand %ymm0,%ymm5,%ymm5 - vpaddd %ymm12,%ymm12,%ymm12 - - vpslld $30,%ymm0,%ymm6 - vpaddd %ymm5,%ymm3,%ymm3 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpor %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vpxor %ymm10,%ymm13,%ymm13 - vmovdqa 64-128(%rax),%ymm10 - - vpaddd %ymm15,%ymm2,%ymm2 - vpslld $5,%ymm3,%ymm7 - vpand %ymm0,%ymm1,%ymm6 - vpxor 256-256-128(%rbx),%ymm13,%ymm13 - - vpaddd %ymm6,%ymm2,%ymm2 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm0,%ymm1,%ymm5 - vpxor %ymm10,%ymm13,%ymm13 - - vmovdqu %ymm12,480-256-128(%rbx) - vpaddd %ymm12,%ymm2,%ymm2 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm13,%ymm9 - vpand %ymm4,%ymm5,%ymm5 - vpaddd %ymm13,%ymm13,%ymm13 - - vpslld $30,%ymm4,%ymm6 - vpaddd %ymm5,%ymm2,%ymm2 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpor %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vpxor %ymm11,%ymm14,%ymm14 - vmovdqa 96-128(%rax),%ymm11 - - vpaddd %ymm15,%ymm1,%ymm1 - vpslld $5,%ymm2,%ymm7 - vpand %ymm4,%ymm0,%ymm6 - vpxor 288-256-128(%rbx),%ymm14,%ymm14 - - vpaddd %ymm6,%ymm1,%ymm1 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm4,%ymm0,%ymm5 - vpxor %ymm11,%ymm14,%ymm14 - - vmovdqu %ymm13,0-128(%rax) - vpaddd %ymm13,%ymm1,%ymm1 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm14,%ymm9 - vpand %ymm3,%ymm5,%ymm5 - vpaddd %ymm14,%ymm14,%ymm14 - - vpslld $30,%ymm3,%ymm6 - vpaddd %ymm5,%ymm1,%ymm1 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpor %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vpxor %ymm12,%ymm10,%ymm10 - vmovdqa 128-128(%rax),%ymm12 - - vpaddd %ymm15,%ymm0,%ymm0 - vpslld $5,%ymm1,%ymm7 - vpand %ymm3,%ymm4,%ymm6 - vpxor 320-256-128(%rbx),%ymm10,%ymm10 - - vpaddd %ymm6,%ymm0,%ymm0 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm3,%ymm4,%ymm5 - vpxor %ymm12,%ymm10,%ymm10 - - vmovdqu %ymm14,32-128(%rax) - vpaddd %ymm14,%ymm0,%ymm0 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm10,%ymm9 - vpand %ymm2,%ymm5,%ymm5 - vpaddd %ymm10,%ymm10,%ymm10 - - vpslld $30,%ymm2,%ymm6 - vpaddd %ymm5,%ymm0,%ymm0 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpor %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vpxor %ymm13,%ymm11,%ymm11 - vmovdqa 160-128(%rax),%ymm13 - - vpaddd %ymm15,%ymm4,%ymm4 - vpslld $5,%ymm0,%ymm7 - vpand %ymm2,%ymm3,%ymm6 - vpxor 352-256-128(%rbx),%ymm11,%ymm11 - - vpaddd %ymm6,%ymm4,%ymm4 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm2,%ymm3,%ymm5 - vpxor %ymm13,%ymm11,%ymm11 - - vmovdqu %ymm10,64-128(%rax) - vpaddd %ymm10,%ymm4,%ymm4 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm11,%ymm9 - vpand %ymm1,%ymm5,%ymm5 - vpaddd %ymm11,%ymm11,%ymm11 - - vpslld $30,%ymm1,%ymm6 - vpaddd %ymm5,%ymm4,%ymm4 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpor %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vpxor %ymm14,%ymm12,%ymm12 - vmovdqa 192-128(%rax),%ymm14 - - vpaddd %ymm15,%ymm3,%ymm3 - vpslld $5,%ymm4,%ymm7 - vpand %ymm1,%ymm2,%ymm6 - vpxor 384-256-128(%rbx),%ymm12,%ymm12 - - vpaddd %ymm6,%ymm3,%ymm3 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm1,%ymm2,%ymm5 - vpxor %ymm14,%ymm12,%ymm12 - - vmovdqu %ymm11,96-128(%rax) - vpaddd %ymm11,%ymm3,%ymm3 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm12,%ymm9 - vpand %ymm0,%ymm5,%ymm5 - vpaddd %ymm12,%ymm12,%ymm12 - - vpslld $30,%ymm0,%ymm6 - vpaddd %ymm5,%ymm3,%ymm3 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpor %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vpxor %ymm10,%ymm13,%ymm13 - vmovdqa 224-128(%rax),%ymm10 - - vpaddd %ymm15,%ymm2,%ymm2 - vpslld $5,%ymm3,%ymm7 - vpand %ymm0,%ymm1,%ymm6 - vpxor 416-256-128(%rbx),%ymm13,%ymm13 - - vpaddd %ymm6,%ymm2,%ymm2 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm0,%ymm1,%ymm5 - vpxor %ymm10,%ymm13,%ymm13 - - vmovdqu %ymm12,128-128(%rax) - vpaddd %ymm12,%ymm2,%ymm2 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm13,%ymm9 - vpand %ymm4,%ymm5,%ymm5 - vpaddd %ymm13,%ymm13,%ymm13 - - vpslld $30,%ymm4,%ymm6 - vpaddd %ymm5,%ymm2,%ymm2 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpor %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vpxor %ymm11,%ymm14,%ymm14 - vmovdqa 256-256-128(%rbx),%ymm11 - - vpaddd %ymm15,%ymm1,%ymm1 - vpslld $5,%ymm2,%ymm7 - vpand %ymm4,%ymm0,%ymm6 - vpxor 448-256-128(%rbx),%ymm14,%ymm14 - - vpaddd %ymm6,%ymm1,%ymm1 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm4,%ymm0,%ymm5 - vpxor %ymm11,%ymm14,%ymm14 - - vmovdqu %ymm13,160-128(%rax) - vpaddd %ymm13,%ymm1,%ymm1 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm14,%ymm9 - vpand %ymm3,%ymm5,%ymm5 - vpaddd %ymm14,%ymm14,%ymm14 - - vpslld $30,%ymm3,%ymm6 - vpaddd %ymm5,%ymm1,%ymm1 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpor %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vpxor %ymm12,%ymm10,%ymm10 - vmovdqa 288-256-128(%rbx),%ymm12 - - vpaddd %ymm15,%ymm0,%ymm0 - vpslld $5,%ymm1,%ymm7 - vpand %ymm3,%ymm4,%ymm6 - vpxor 480-256-128(%rbx),%ymm10,%ymm10 - - vpaddd %ymm6,%ymm0,%ymm0 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm3,%ymm4,%ymm5 - vpxor %ymm12,%ymm10,%ymm10 - - vmovdqu %ymm14,192-128(%rax) - vpaddd %ymm14,%ymm0,%ymm0 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm10,%ymm9 - vpand %ymm2,%ymm5,%ymm5 - vpaddd %ymm10,%ymm10,%ymm10 - - vpslld $30,%ymm2,%ymm6 - vpaddd %ymm5,%ymm0,%ymm0 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpor %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vpxor %ymm13,%ymm11,%ymm11 - vmovdqa 320-256-128(%rbx),%ymm13 - - vpaddd %ymm15,%ymm4,%ymm4 - vpslld $5,%ymm0,%ymm7 - vpand %ymm2,%ymm3,%ymm6 - vpxor 0-128(%rax),%ymm11,%ymm11 - - vpaddd %ymm6,%ymm4,%ymm4 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm2,%ymm3,%ymm5 - vpxor %ymm13,%ymm11,%ymm11 - - vmovdqu %ymm10,224-128(%rax) - vpaddd %ymm10,%ymm4,%ymm4 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm11,%ymm9 - vpand %ymm1,%ymm5,%ymm5 - vpaddd %ymm11,%ymm11,%ymm11 - - vpslld $30,%ymm1,%ymm6 - vpaddd %ymm5,%ymm4,%ymm4 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpor %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vpxor %ymm14,%ymm12,%ymm12 - vmovdqa 352-256-128(%rbx),%ymm14 - - vpaddd %ymm15,%ymm3,%ymm3 - vpslld $5,%ymm4,%ymm7 - vpand %ymm1,%ymm2,%ymm6 - vpxor 32-128(%rax),%ymm12,%ymm12 - - vpaddd %ymm6,%ymm3,%ymm3 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm1,%ymm2,%ymm5 - vpxor %ymm14,%ymm12,%ymm12 - - vmovdqu %ymm11,256-256-128(%rbx) - vpaddd %ymm11,%ymm3,%ymm3 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm12,%ymm9 - vpand %ymm0,%ymm5,%ymm5 - vpaddd %ymm12,%ymm12,%ymm12 - - vpslld $30,%ymm0,%ymm6 - vpaddd %ymm5,%ymm3,%ymm3 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpor %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vpxor %ymm10,%ymm13,%ymm13 - vmovdqa 384-256-128(%rbx),%ymm10 - - vpaddd %ymm15,%ymm2,%ymm2 - vpslld $5,%ymm3,%ymm7 - vpand %ymm0,%ymm1,%ymm6 - vpxor 64-128(%rax),%ymm13,%ymm13 - - vpaddd %ymm6,%ymm2,%ymm2 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm0,%ymm1,%ymm5 - vpxor %ymm10,%ymm13,%ymm13 - - vmovdqu %ymm12,288-256-128(%rbx) - vpaddd %ymm12,%ymm2,%ymm2 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm13,%ymm9 - vpand %ymm4,%ymm5,%ymm5 - vpaddd %ymm13,%ymm13,%ymm13 - - vpslld $30,%ymm4,%ymm6 - vpaddd %ymm5,%ymm2,%ymm2 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpor %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vpxor %ymm11,%ymm14,%ymm14 - vmovdqa 416-256-128(%rbx),%ymm11 - - vpaddd %ymm15,%ymm1,%ymm1 - vpslld $5,%ymm2,%ymm7 - vpand %ymm4,%ymm0,%ymm6 - vpxor 96-128(%rax),%ymm14,%ymm14 - - vpaddd %ymm6,%ymm1,%ymm1 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm4,%ymm0,%ymm5 - vpxor %ymm11,%ymm14,%ymm14 - - vmovdqu %ymm13,320-256-128(%rbx) - vpaddd %ymm13,%ymm1,%ymm1 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm14,%ymm9 - vpand %ymm3,%ymm5,%ymm5 - vpaddd %ymm14,%ymm14,%ymm14 - - vpslld $30,%ymm3,%ymm6 - vpaddd %ymm5,%ymm1,%ymm1 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpor %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vpxor %ymm12,%ymm10,%ymm10 - vmovdqa 448-256-128(%rbx),%ymm12 - - vpaddd %ymm15,%ymm0,%ymm0 - vpslld $5,%ymm1,%ymm7 - vpand %ymm3,%ymm4,%ymm6 - vpxor 128-128(%rax),%ymm10,%ymm10 - - vpaddd %ymm6,%ymm0,%ymm0 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm3,%ymm4,%ymm5 - vpxor %ymm12,%ymm10,%ymm10 - - vmovdqu %ymm14,352-256-128(%rbx) - vpaddd %ymm14,%ymm0,%ymm0 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm10,%ymm9 - vpand %ymm2,%ymm5,%ymm5 - vpaddd %ymm10,%ymm10,%ymm10 - - vpslld $30,%ymm2,%ymm6 - vpaddd %ymm5,%ymm0,%ymm0 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpor %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vmovdqa 64(%rbp),%ymm15 - vpxor %ymm13,%ymm11,%ymm11 - vmovdqa 480-256-128(%rbx),%ymm13 - - vpslld $5,%ymm0,%ymm7 - vpaddd %ymm15,%ymm4,%ymm4 - vpxor %ymm1,%ymm3,%ymm5 - vmovdqa %ymm10,384-256-128(%rbx) - vpaddd %ymm10,%ymm4,%ymm4 - vpxor 160-128(%rax),%ymm11,%ymm11 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm2,%ymm5,%ymm5 - vpxor %ymm13,%ymm11,%ymm11 - - vpslld $30,%ymm1,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm4,%ymm4 - vpsrld $31,%ymm11,%ymm9 - vpaddd %ymm11,%ymm11,%ymm11 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpor %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vpxor %ymm14,%ymm12,%ymm12 - vmovdqa 0-128(%rax),%ymm14 - - vpslld $5,%ymm4,%ymm7 - vpaddd %ymm15,%ymm3,%ymm3 - vpxor %ymm0,%ymm2,%ymm5 - vmovdqa %ymm11,416-256-128(%rbx) - vpaddd %ymm11,%ymm3,%ymm3 - vpxor 192-128(%rax),%ymm12,%ymm12 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm1,%ymm5,%ymm5 - vpxor %ymm14,%ymm12,%ymm12 - - vpslld $30,%ymm0,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm3,%ymm3 - vpsrld $31,%ymm12,%ymm9 - vpaddd %ymm12,%ymm12,%ymm12 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpor %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vpxor %ymm10,%ymm13,%ymm13 - vmovdqa 32-128(%rax),%ymm10 - - vpslld $5,%ymm3,%ymm7 - vpaddd %ymm15,%ymm2,%ymm2 - vpxor %ymm4,%ymm1,%ymm5 - vmovdqa %ymm12,448-256-128(%rbx) - vpaddd %ymm12,%ymm2,%ymm2 - vpxor 224-128(%rax),%ymm13,%ymm13 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm0,%ymm5,%ymm5 - vpxor %ymm10,%ymm13,%ymm13 - - vpslld $30,%ymm4,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm2,%ymm2 - vpsrld $31,%ymm13,%ymm9 - vpaddd %ymm13,%ymm13,%ymm13 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpor %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vpxor %ymm11,%ymm14,%ymm14 - vmovdqa 64-128(%rax),%ymm11 - - vpslld $5,%ymm2,%ymm7 - vpaddd %ymm15,%ymm1,%ymm1 - vpxor %ymm3,%ymm0,%ymm5 - vmovdqa %ymm13,480-256-128(%rbx) - vpaddd %ymm13,%ymm1,%ymm1 - vpxor 256-256-128(%rbx),%ymm14,%ymm14 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm4,%ymm5,%ymm5 - vpxor %ymm11,%ymm14,%ymm14 - - vpslld $30,%ymm3,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm1,%ymm1 - vpsrld $31,%ymm14,%ymm9 - vpaddd %ymm14,%ymm14,%ymm14 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpor %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vpxor %ymm12,%ymm10,%ymm10 - vmovdqa 96-128(%rax),%ymm12 - - vpslld $5,%ymm1,%ymm7 - vpaddd %ymm15,%ymm0,%ymm0 - vpxor %ymm2,%ymm4,%ymm5 - vmovdqa %ymm14,0-128(%rax) - vpaddd %ymm14,%ymm0,%ymm0 - vpxor 288-256-128(%rbx),%ymm10,%ymm10 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm3,%ymm5,%ymm5 - vpxor %ymm12,%ymm10,%ymm10 - - vpslld $30,%ymm2,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm0,%ymm0 - vpsrld $31,%ymm10,%ymm9 - vpaddd %ymm10,%ymm10,%ymm10 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpor %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vpxor %ymm13,%ymm11,%ymm11 - vmovdqa 128-128(%rax),%ymm13 - - vpslld $5,%ymm0,%ymm7 - vpaddd %ymm15,%ymm4,%ymm4 - vpxor %ymm1,%ymm3,%ymm5 - vmovdqa %ymm10,32-128(%rax) - vpaddd %ymm10,%ymm4,%ymm4 - vpxor 320-256-128(%rbx),%ymm11,%ymm11 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm2,%ymm5,%ymm5 - vpxor %ymm13,%ymm11,%ymm11 - - vpslld $30,%ymm1,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm4,%ymm4 - vpsrld $31,%ymm11,%ymm9 - vpaddd %ymm11,%ymm11,%ymm11 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpor %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vpxor %ymm14,%ymm12,%ymm12 - vmovdqa 160-128(%rax),%ymm14 - - vpslld $5,%ymm4,%ymm7 - vpaddd %ymm15,%ymm3,%ymm3 - vpxor %ymm0,%ymm2,%ymm5 - vmovdqa %ymm11,64-128(%rax) - vpaddd %ymm11,%ymm3,%ymm3 - vpxor 352-256-128(%rbx),%ymm12,%ymm12 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm1,%ymm5,%ymm5 - vpxor %ymm14,%ymm12,%ymm12 - - vpslld $30,%ymm0,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm3,%ymm3 - vpsrld $31,%ymm12,%ymm9 - vpaddd %ymm12,%ymm12,%ymm12 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpor %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vpxor %ymm10,%ymm13,%ymm13 - vmovdqa 192-128(%rax),%ymm10 - - vpslld $5,%ymm3,%ymm7 - vpaddd %ymm15,%ymm2,%ymm2 - vpxor %ymm4,%ymm1,%ymm5 - vmovdqa %ymm12,96-128(%rax) - vpaddd %ymm12,%ymm2,%ymm2 - vpxor 384-256-128(%rbx),%ymm13,%ymm13 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm0,%ymm5,%ymm5 - vpxor %ymm10,%ymm13,%ymm13 - - vpslld $30,%ymm4,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm2,%ymm2 - vpsrld $31,%ymm13,%ymm9 - vpaddd %ymm13,%ymm13,%ymm13 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpor %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vpxor %ymm11,%ymm14,%ymm14 - vmovdqa 224-128(%rax),%ymm11 - - vpslld $5,%ymm2,%ymm7 - vpaddd %ymm15,%ymm1,%ymm1 - vpxor %ymm3,%ymm0,%ymm5 - vmovdqa %ymm13,128-128(%rax) - vpaddd %ymm13,%ymm1,%ymm1 - vpxor 416-256-128(%rbx),%ymm14,%ymm14 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm4,%ymm5,%ymm5 - vpxor %ymm11,%ymm14,%ymm14 - - vpslld $30,%ymm3,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm1,%ymm1 - vpsrld $31,%ymm14,%ymm9 - vpaddd %ymm14,%ymm14,%ymm14 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpor %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vpxor %ymm12,%ymm10,%ymm10 - vmovdqa 256-256-128(%rbx),%ymm12 - - vpslld $5,%ymm1,%ymm7 - vpaddd %ymm15,%ymm0,%ymm0 - vpxor %ymm2,%ymm4,%ymm5 - vmovdqa %ymm14,160-128(%rax) - vpaddd %ymm14,%ymm0,%ymm0 - vpxor 448-256-128(%rbx),%ymm10,%ymm10 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm3,%ymm5,%ymm5 - vpxor %ymm12,%ymm10,%ymm10 - - vpslld $30,%ymm2,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm0,%ymm0 - vpsrld $31,%ymm10,%ymm9 - vpaddd %ymm10,%ymm10,%ymm10 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpor %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vpxor %ymm13,%ymm11,%ymm11 - vmovdqa 288-256-128(%rbx),%ymm13 - - vpslld $5,%ymm0,%ymm7 - vpaddd %ymm15,%ymm4,%ymm4 - vpxor %ymm1,%ymm3,%ymm5 - vmovdqa %ymm10,192-128(%rax) - vpaddd %ymm10,%ymm4,%ymm4 - vpxor 480-256-128(%rbx),%ymm11,%ymm11 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm2,%ymm5,%ymm5 - vpxor %ymm13,%ymm11,%ymm11 - - vpslld $30,%ymm1,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm4,%ymm4 - vpsrld $31,%ymm11,%ymm9 - vpaddd %ymm11,%ymm11,%ymm11 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpor %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vpxor %ymm14,%ymm12,%ymm12 - vmovdqa 320-256-128(%rbx),%ymm14 - - vpslld $5,%ymm4,%ymm7 - vpaddd %ymm15,%ymm3,%ymm3 - vpxor %ymm0,%ymm2,%ymm5 - vmovdqa %ymm11,224-128(%rax) - vpaddd %ymm11,%ymm3,%ymm3 - vpxor 0-128(%rax),%ymm12,%ymm12 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm1,%ymm5,%ymm5 - vpxor %ymm14,%ymm12,%ymm12 - - vpslld $30,%ymm0,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm3,%ymm3 - vpsrld $31,%ymm12,%ymm9 - vpaddd %ymm12,%ymm12,%ymm12 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpor %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vpxor %ymm10,%ymm13,%ymm13 - vmovdqa 352-256-128(%rbx),%ymm10 - - vpslld $5,%ymm3,%ymm7 - vpaddd %ymm15,%ymm2,%ymm2 - vpxor %ymm4,%ymm1,%ymm5 - vpaddd %ymm12,%ymm2,%ymm2 - vpxor 32-128(%rax),%ymm13,%ymm13 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm0,%ymm5,%ymm5 - vpxor %ymm10,%ymm13,%ymm13 - - vpslld $30,%ymm4,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm2,%ymm2 - vpsrld $31,%ymm13,%ymm9 - vpaddd %ymm13,%ymm13,%ymm13 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpor %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vpxor %ymm11,%ymm14,%ymm14 - vmovdqa 384-256-128(%rbx),%ymm11 - - vpslld $5,%ymm2,%ymm7 - vpaddd %ymm15,%ymm1,%ymm1 - vpxor %ymm3,%ymm0,%ymm5 - vpaddd %ymm13,%ymm1,%ymm1 - vpxor 64-128(%rax),%ymm14,%ymm14 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm4,%ymm5,%ymm5 - vpxor %ymm11,%ymm14,%ymm14 - - vpslld $30,%ymm3,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm1,%ymm1 - vpsrld $31,%ymm14,%ymm9 - vpaddd %ymm14,%ymm14,%ymm14 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpor %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vpxor %ymm12,%ymm10,%ymm10 - vmovdqa 416-256-128(%rbx),%ymm12 - - vpslld $5,%ymm1,%ymm7 - vpaddd %ymm15,%ymm0,%ymm0 - vpxor %ymm2,%ymm4,%ymm5 - vpaddd %ymm14,%ymm0,%ymm0 - vpxor 96-128(%rax),%ymm10,%ymm10 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm3,%ymm5,%ymm5 - vpxor %ymm12,%ymm10,%ymm10 - - vpslld $30,%ymm2,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm0,%ymm0 - vpsrld $31,%ymm10,%ymm9 - vpaddd %ymm10,%ymm10,%ymm10 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpor %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vpxor %ymm13,%ymm11,%ymm11 - vmovdqa 448-256-128(%rbx),%ymm13 - - vpslld $5,%ymm0,%ymm7 - vpaddd %ymm15,%ymm4,%ymm4 - vpxor %ymm1,%ymm3,%ymm5 - vpaddd %ymm10,%ymm4,%ymm4 - vpxor 128-128(%rax),%ymm11,%ymm11 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm2,%ymm5,%ymm5 - vpxor %ymm13,%ymm11,%ymm11 - - vpslld $30,%ymm1,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm4,%ymm4 - vpsrld $31,%ymm11,%ymm9 - vpaddd %ymm11,%ymm11,%ymm11 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpor %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vpxor %ymm14,%ymm12,%ymm12 - vmovdqa 480-256-128(%rbx),%ymm14 - - vpslld $5,%ymm4,%ymm7 - vpaddd %ymm15,%ymm3,%ymm3 - vpxor %ymm0,%ymm2,%ymm5 - vpaddd %ymm11,%ymm3,%ymm3 - vpxor 160-128(%rax),%ymm12,%ymm12 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm1,%ymm5,%ymm5 - vpxor %ymm14,%ymm12,%ymm12 - - vpslld $30,%ymm0,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm3,%ymm3 - vpsrld $31,%ymm12,%ymm9 - vpaddd %ymm12,%ymm12,%ymm12 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpor %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vpxor %ymm10,%ymm13,%ymm13 - vmovdqa 0-128(%rax),%ymm10 - - vpslld $5,%ymm3,%ymm7 - vpaddd %ymm15,%ymm2,%ymm2 - vpxor %ymm4,%ymm1,%ymm5 - vpaddd %ymm12,%ymm2,%ymm2 - vpxor 192-128(%rax),%ymm13,%ymm13 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm0,%ymm5,%ymm5 - vpxor %ymm10,%ymm13,%ymm13 - - vpslld $30,%ymm4,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm2,%ymm2 - vpsrld $31,%ymm13,%ymm9 - vpaddd %ymm13,%ymm13,%ymm13 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpor %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vpxor %ymm11,%ymm14,%ymm14 - vmovdqa 32-128(%rax),%ymm11 - - vpslld $5,%ymm2,%ymm7 - vpaddd %ymm15,%ymm1,%ymm1 - vpxor %ymm3,%ymm0,%ymm5 - vpaddd %ymm13,%ymm1,%ymm1 - vpxor 224-128(%rax),%ymm14,%ymm14 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm4,%ymm5,%ymm5 - vpxor %ymm11,%ymm14,%ymm14 - - vpslld $30,%ymm3,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm1,%ymm1 - vpsrld $31,%ymm14,%ymm9 - vpaddd %ymm14,%ymm14,%ymm14 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpor %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vpslld $5,%ymm1,%ymm7 - vpaddd %ymm15,%ymm0,%ymm0 - vpxor %ymm2,%ymm4,%ymm5 - - vpsrld $27,%ymm1,%ymm8 - vpaddd %ymm14,%ymm0,%ymm0 - vpxor %ymm3,%ymm5,%ymm5 - - vpslld $30,%ymm2,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm0,%ymm0 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpor %ymm6,%ymm2,%ymm2 - movl $1,%ecx - leaq 512(%rsp),%rbx - cmpl 0(%rbx),%ecx - cmovgeq %rbp,%r12 - cmpl 4(%rbx),%ecx - cmovgeq %rbp,%r13 - cmpl 8(%rbx),%ecx - cmovgeq %rbp,%r14 - cmpl 12(%rbx),%ecx - cmovgeq %rbp,%r15 - cmpl 16(%rbx),%ecx - cmovgeq %rbp,%r8 - cmpl 20(%rbx),%ecx - cmovgeq %rbp,%r9 - cmpl 24(%rbx),%ecx - cmovgeq %rbp,%r10 - cmpl 28(%rbx),%ecx - cmovgeq %rbp,%r11 - vmovdqu (%rbx),%ymm5 - vpxor %ymm7,%ymm7,%ymm7 - vmovdqa %ymm5,%ymm6 - vpcmpgtd %ymm7,%ymm6,%ymm6 - vpaddd %ymm6,%ymm5,%ymm5 - - vpand %ymm6,%ymm0,%ymm0 - vpand %ymm6,%ymm1,%ymm1 - vpaddd 0(%rdi),%ymm0,%ymm0 - vpand %ymm6,%ymm2,%ymm2 - vpaddd 32(%rdi),%ymm1,%ymm1 - vpand %ymm6,%ymm3,%ymm3 - vpaddd 64(%rdi),%ymm2,%ymm2 - vpand %ymm6,%ymm4,%ymm4 - vpaddd 96(%rdi),%ymm3,%ymm3 - vpaddd 128(%rdi),%ymm4,%ymm4 - vmovdqu %ymm0,0(%rdi) - vmovdqu %ymm1,32(%rdi) - vmovdqu %ymm2,64(%rdi) - vmovdqu %ymm3,96(%rdi) - vmovdqu %ymm4,128(%rdi) - - vmovdqu %ymm5,(%rbx) - leaq 256+128(%rsp),%rbx - vmovdqu 96(%rbp),%ymm9 - decl %edx - jnz .Loop_avx2 - - - - - - - -.Ldone_avx2: - movq 544(%rsp),%rax - vzeroupper - movq -48(%rax),%r15 - movq -40(%rax),%r14 - movq -32(%rax),%r13 - movq -24(%rax),%r12 - movq -16(%rax),%rbp - movq -8(%rax),%rbx - leaq (%rax),%rsp -.Lepilogue_avx2: - .byte 0xf3,0xc3 -.size sha1_multi_block_avx2,.-sha1_multi_block_avx2 .align 256 .long 0x5a827999,0x5a827999,0x5a827999,0x5a827999 diff --git a/deps/openssl/asm/x64-elf-gas/sha/sha1-x86_64.s b/deps/openssl/asm/x64-elf-gas/sha/sha1-x86_64.s index 22a031f368e505..38e9956cb68384 100644 --- a/deps/openssl/asm/x64-elf-gas/sha/sha1-x86_64.s +++ b/deps/openssl/asm/x64-elf-gas/sha/sha1-x86_64.s @@ -12,14 +12,6 @@ sha1_block_data_order: jz .Lialu testl $536870912,%r10d jnz _shaext_shortcut - andl $296,%r10d - cmpl $296,%r10d - je _avx2_shortcut - andl $268435456,%r8d - andl $1073741824,%r9d - orl %r9d,%r8d - cmpl $1342177280,%r8d - je _avx_shortcut jmp _ssse3_shortcut .align 16 @@ -1248,9 +1240,9 @@ _shaext_shortcut: movdqa K_XX_XX+160(%rip),%xmm3 movdqu (%rsi),%xmm4 - pshufd $27,%xmm0,%xmm0 + pshufd $0b00011011,%xmm0,%xmm0 movdqu 16(%rsi),%xmm5 - pshufd $27,%xmm1,%xmm1 + pshufd $0b00011011,%xmm1,%xmm1 movdqu 32(%rsi),%xmm6 .byte 102,15,56,0,227 movdqu 48(%rsi),%xmm7 @@ -1400,8 +1392,8 @@ _shaext_shortcut: jnz .Loop_shaext - pshufd $27,%xmm0,%xmm0 - pshufd $27,%xmm1,%xmm1 + pshufd $0b00011011,%xmm0,%xmm0 + pshufd $0b00011011,%xmm1,%xmm1 movdqu %xmm0,(%rdi) movd %xmm1,16(%rdi) .byte 0xf3,0xc3 @@ -2582,2803 +2574,6 @@ _ssse3_shortcut: .Lepilogue_ssse3: .byte 0xf3,0xc3 .size sha1_block_data_order_ssse3,.-sha1_block_data_order_ssse3 -.type sha1_block_data_order_avx,@function -.align 16 -sha1_block_data_order_avx: -_avx_shortcut: - movq %rsp,%rax - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - leaq -64(%rsp),%rsp - vzeroupper - movq %rax,%r14 - andq $-64,%rsp - movq %rdi,%r8 - movq %rsi,%r9 - movq %rdx,%r10 - - shlq $6,%r10 - addq %r9,%r10 - leaq K_XX_XX+64(%rip),%r11 - - movl 0(%r8),%eax - movl 4(%r8),%ebx - movl 8(%r8),%ecx - movl 12(%r8),%edx - movl %ebx,%esi - movl 16(%r8),%ebp - movl %ecx,%edi - xorl %edx,%edi - andl %edi,%esi - - vmovdqa 64(%r11),%xmm6 - vmovdqa -64(%r11),%xmm11 - vmovdqu 0(%r9),%xmm0 - vmovdqu 16(%r9),%xmm1 - vmovdqu 32(%r9),%xmm2 - vmovdqu 48(%r9),%xmm3 - vpshufb %xmm6,%xmm0,%xmm0 - addq $64,%r9 - vpshufb %xmm6,%xmm1,%xmm1 - vpshufb %xmm6,%xmm2,%xmm2 - vpshufb %xmm6,%xmm3,%xmm3 - vpaddd %xmm11,%xmm0,%xmm4 - vpaddd %xmm11,%xmm1,%xmm5 - vpaddd %xmm11,%xmm2,%xmm6 - vmovdqa %xmm4,0(%rsp) - vmovdqa %xmm5,16(%rsp) - vmovdqa %xmm6,32(%rsp) - jmp .Loop_avx -.align 16 -.Loop_avx: - shrdl $2,%ebx,%ebx - xorl %edx,%esi - vpalignr $8,%xmm0,%xmm1,%xmm4 - movl %eax,%edi - addl 0(%rsp),%ebp - vpaddd %xmm3,%xmm11,%xmm9 - xorl %ecx,%ebx - shldl $5,%eax,%eax - vpsrldq $4,%xmm3,%xmm8 - addl %esi,%ebp - andl %ebx,%edi - vpxor %xmm0,%xmm4,%xmm4 - xorl %ecx,%ebx - addl %eax,%ebp - vpxor %xmm2,%xmm8,%xmm8 - shrdl $7,%eax,%eax - xorl %ecx,%edi - movl %ebp,%esi - addl 4(%rsp),%edx - vpxor %xmm8,%xmm4,%xmm4 - xorl %ebx,%eax - shldl $5,%ebp,%ebp - vmovdqa %xmm9,48(%rsp) - addl %edi,%edx - andl %eax,%esi - vpsrld $31,%xmm4,%xmm8 - xorl %ebx,%eax - addl %ebp,%edx - shrdl $7,%ebp,%ebp - xorl %ebx,%esi - vpslldq $12,%xmm4,%xmm10 - vpaddd %xmm4,%xmm4,%xmm4 - movl %edx,%edi - addl 8(%rsp),%ecx - xorl %eax,%ebp - shldl $5,%edx,%edx - vpsrld $30,%xmm10,%xmm9 - vpor %xmm8,%xmm4,%xmm4 - addl %esi,%ecx - andl %ebp,%edi - xorl %eax,%ebp - addl %edx,%ecx - vpslld $2,%xmm10,%xmm10 - vpxor %xmm9,%xmm4,%xmm4 - shrdl $7,%edx,%edx - xorl %eax,%edi - movl %ecx,%esi - addl 12(%rsp),%ebx - vpxor %xmm10,%xmm4,%xmm4 - xorl %ebp,%edx - shldl $5,%ecx,%ecx - addl %edi,%ebx - andl %edx,%esi - xorl %ebp,%edx - addl %ecx,%ebx - shrdl $7,%ecx,%ecx - xorl %ebp,%esi - vpalignr $8,%xmm1,%xmm2,%xmm5 - movl %ebx,%edi - addl 16(%rsp),%eax - vpaddd %xmm4,%xmm11,%xmm9 - xorl %edx,%ecx - shldl $5,%ebx,%ebx - vpsrldq $4,%xmm4,%xmm8 - addl %esi,%eax - andl %ecx,%edi - vpxor %xmm1,%xmm5,%xmm5 - xorl %edx,%ecx - addl %ebx,%eax - vpxor %xmm3,%xmm8,%xmm8 - shrdl $7,%ebx,%ebx - xorl %edx,%edi - movl %eax,%esi - addl 20(%rsp),%ebp - vpxor %xmm8,%xmm5,%xmm5 - xorl %ecx,%ebx - shldl $5,%eax,%eax - vmovdqa %xmm9,0(%rsp) - addl %edi,%ebp - andl %ebx,%esi - vpsrld $31,%xmm5,%xmm8 - xorl %ecx,%ebx - addl %eax,%ebp - shrdl $7,%eax,%eax - xorl %ecx,%esi - vpslldq $12,%xmm5,%xmm10 - vpaddd %xmm5,%xmm5,%xmm5 - movl %ebp,%edi - addl 24(%rsp),%edx - xorl %ebx,%eax - shldl $5,%ebp,%ebp - vpsrld $30,%xmm10,%xmm9 - vpor %xmm8,%xmm5,%xmm5 - addl %esi,%edx - andl %eax,%edi - xorl %ebx,%eax - addl %ebp,%edx - vpslld $2,%xmm10,%xmm10 - vpxor %xmm9,%xmm5,%xmm5 - shrdl $7,%ebp,%ebp - xorl %ebx,%edi - movl %edx,%esi - addl 28(%rsp),%ecx - vpxor %xmm10,%xmm5,%xmm5 - xorl %eax,%ebp - shldl $5,%edx,%edx - vmovdqa -32(%r11),%xmm11 - addl %edi,%ecx - andl %ebp,%esi - xorl %eax,%ebp - addl %edx,%ecx - shrdl $7,%edx,%edx - xorl %eax,%esi - vpalignr $8,%xmm2,%xmm3,%xmm6 - movl %ecx,%edi - addl 32(%rsp),%ebx - vpaddd %xmm5,%xmm11,%xmm9 - xorl %ebp,%edx - shldl $5,%ecx,%ecx - vpsrldq $4,%xmm5,%xmm8 - addl %esi,%ebx - andl %edx,%edi - vpxor %xmm2,%xmm6,%xmm6 - xorl %ebp,%edx - addl %ecx,%ebx - vpxor %xmm4,%xmm8,%xmm8 - shrdl $7,%ecx,%ecx - xorl %ebp,%edi - movl %ebx,%esi - addl 36(%rsp),%eax - vpxor %xmm8,%xmm6,%xmm6 - xorl %edx,%ecx - shldl $5,%ebx,%ebx - vmovdqa %xmm9,16(%rsp) - addl %edi,%eax - andl %ecx,%esi - vpsrld $31,%xmm6,%xmm8 - xorl %edx,%ecx - addl %ebx,%eax - shrdl $7,%ebx,%ebx - xorl %edx,%esi - vpslldq $12,%xmm6,%xmm10 - vpaddd %xmm6,%xmm6,%xmm6 - movl %eax,%edi - addl 40(%rsp),%ebp - xorl %ecx,%ebx - shldl $5,%eax,%eax - vpsrld $30,%xmm10,%xmm9 - vpor %xmm8,%xmm6,%xmm6 - addl %esi,%ebp - andl %ebx,%edi - xorl %ecx,%ebx - addl %eax,%ebp - vpslld $2,%xmm10,%xmm10 - vpxor %xmm9,%xmm6,%xmm6 - shrdl $7,%eax,%eax - xorl %ecx,%edi - movl %ebp,%esi - addl 44(%rsp),%edx - vpxor %xmm10,%xmm6,%xmm6 - xorl %ebx,%eax - shldl $5,%ebp,%ebp - addl %edi,%edx - andl %eax,%esi - xorl %ebx,%eax - addl %ebp,%edx - shrdl $7,%ebp,%ebp - xorl %ebx,%esi - vpalignr $8,%xmm3,%xmm4,%xmm7 - movl %edx,%edi - addl 48(%rsp),%ecx - vpaddd %xmm6,%xmm11,%xmm9 - xorl %eax,%ebp - shldl $5,%edx,%edx - vpsrldq $4,%xmm6,%xmm8 - addl %esi,%ecx - andl %ebp,%edi - vpxor %xmm3,%xmm7,%xmm7 - xorl %eax,%ebp - addl %edx,%ecx - vpxor %xmm5,%xmm8,%xmm8 - shrdl $7,%edx,%edx - xorl %eax,%edi - movl %ecx,%esi - addl 52(%rsp),%ebx - vpxor %xmm8,%xmm7,%xmm7 - xorl %ebp,%edx - shldl $5,%ecx,%ecx - vmovdqa %xmm9,32(%rsp) - addl %edi,%ebx - andl %edx,%esi - vpsrld $31,%xmm7,%xmm8 - xorl %ebp,%edx - addl %ecx,%ebx - shrdl $7,%ecx,%ecx - xorl %ebp,%esi - vpslldq $12,%xmm7,%xmm10 - vpaddd %xmm7,%xmm7,%xmm7 - movl %ebx,%edi - addl 56(%rsp),%eax - xorl %edx,%ecx - shldl $5,%ebx,%ebx - vpsrld $30,%xmm10,%xmm9 - vpor %xmm8,%xmm7,%xmm7 - addl %esi,%eax - andl %ecx,%edi - xorl %edx,%ecx - addl %ebx,%eax - vpslld $2,%xmm10,%xmm10 - vpxor %xmm9,%xmm7,%xmm7 - shrdl $7,%ebx,%ebx - xorl %edx,%edi - movl %eax,%esi - addl 60(%rsp),%ebp - vpxor %xmm10,%xmm7,%xmm7 - xorl %ecx,%ebx - shldl $5,%eax,%eax - addl %edi,%ebp - andl %ebx,%esi - xorl %ecx,%ebx - addl %eax,%ebp - vpalignr $8,%xmm6,%xmm7,%xmm8 - vpxor %xmm4,%xmm0,%xmm0 - shrdl $7,%eax,%eax - xorl %ecx,%esi - movl %ebp,%edi - addl 0(%rsp),%edx - vpxor %xmm1,%xmm0,%xmm0 - xorl %ebx,%eax - shldl $5,%ebp,%ebp - vpaddd %xmm7,%xmm11,%xmm9 - addl %esi,%edx - andl %eax,%edi - vpxor %xmm8,%xmm0,%xmm0 - xorl %ebx,%eax - addl %ebp,%edx - shrdl $7,%ebp,%ebp - xorl %ebx,%edi - vpsrld $30,%xmm0,%xmm8 - vmovdqa %xmm9,48(%rsp) - movl %edx,%esi - addl 4(%rsp),%ecx - xorl %eax,%ebp - shldl $5,%edx,%edx - vpslld $2,%xmm0,%xmm0 - addl %edi,%ecx - andl %ebp,%esi - xorl %eax,%ebp - addl %edx,%ecx - shrdl $7,%edx,%edx - xorl %eax,%esi - movl %ecx,%edi - addl 8(%rsp),%ebx - vpor %xmm8,%xmm0,%xmm0 - xorl %ebp,%edx - shldl $5,%ecx,%ecx - addl %esi,%ebx - andl %edx,%edi - xorl %ebp,%edx - addl %ecx,%ebx - addl 12(%rsp),%eax - xorl %ebp,%edi - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %edi,%eax - xorl %edx,%esi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vpalignr $8,%xmm7,%xmm0,%xmm8 - vpxor %xmm5,%xmm1,%xmm1 - addl 16(%rsp),%ebp - xorl %ecx,%esi - movl %eax,%edi - shldl $5,%eax,%eax - vpxor %xmm2,%xmm1,%xmm1 - addl %esi,%ebp - xorl %ecx,%edi - vpaddd %xmm0,%xmm11,%xmm9 - shrdl $7,%ebx,%ebx - addl %eax,%ebp - vpxor %xmm8,%xmm1,%xmm1 - addl 20(%rsp),%edx - xorl %ebx,%edi - movl %ebp,%esi - shldl $5,%ebp,%ebp - vpsrld $30,%xmm1,%xmm8 - vmovdqa %xmm9,0(%rsp) - addl %edi,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %ebp,%edx - vpslld $2,%xmm1,%xmm1 - addl 24(%rsp),%ecx - xorl %eax,%esi - movl %edx,%edi - shldl $5,%edx,%edx - addl %esi,%ecx - xorl %eax,%edi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - vpor %xmm8,%xmm1,%xmm1 - addl 28(%rsp),%ebx - xorl %ebp,%edi - movl %ecx,%esi - shldl $5,%ecx,%ecx - addl %edi,%ebx - xorl %ebp,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - vpalignr $8,%xmm0,%xmm1,%xmm8 - vpxor %xmm6,%xmm2,%xmm2 - addl 32(%rsp),%eax - xorl %edx,%esi - movl %ebx,%edi - shldl $5,%ebx,%ebx - vpxor %xmm3,%xmm2,%xmm2 - addl %esi,%eax - xorl %edx,%edi - vpaddd %xmm1,%xmm11,%xmm9 - vmovdqa 0(%r11),%xmm11 - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vpxor %xmm8,%xmm2,%xmm2 - addl 36(%rsp),%ebp - xorl %ecx,%edi - movl %eax,%esi - shldl $5,%eax,%eax - vpsrld $30,%xmm2,%xmm8 - vmovdqa %xmm9,16(%rsp) - addl %edi,%ebp - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - vpslld $2,%xmm2,%xmm2 - addl 40(%rsp),%edx - xorl %ebx,%esi - movl %ebp,%edi - shldl $5,%ebp,%ebp - addl %esi,%edx - xorl %ebx,%edi - shrdl $7,%eax,%eax - addl %ebp,%edx - vpor %xmm8,%xmm2,%xmm2 - addl 44(%rsp),%ecx - xorl %eax,%edi - movl %edx,%esi - shldl $5,%edx,%edx - addl %edi,%ecx - xorl %eax,%esi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - vpalignr $8,%xmm1,%xmm2,%xmm8 - vpxor %xmm7,%xmm3,%xmm3 - addl 48(%rsp),%ebx - xorl %ebp,%esi - movl %ecx,%edi - shldl $5,%ecx,%ecx - vpxor %xmm4,%xmm3,%xmm3 - addl %esi,%ebx - xorl %ebp,%edi - vpaddd %xmm2,%xmm11,%xmm9 - shrdl $7,%edx,%edx - addl %ecx,%ebx - vpxor %xmm8,%xmm3,%xmm3 - addl 52(%rsp),%eax - xorl %edx,%edi - movl %ebx,%esi - shldl $5,%ebx,%ebx - vpsrld $30,%xmm3,%xmm8 - vmovdqa %xmm9,32(%rsp) - addl %edi,%eax - xorl %edx,%esi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vpslld $2,%xmm3,%xmm3 - addl 56(%rsp),%ebp - xorl %ecx,%esi - movl %eax,%edi - shldl $5,%eax,%eax - addl %esi,%ebp - xorl %ecx,%edi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - vpor %xmm8,%xmm3,%xmm3 - addl 60(%rsp),%edx - xorl %ebx,%edi - movl %ebp,%esi - shldl $5,%ebp,%ebp - addl %edi,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %ebp,%edx - vpalignr $8,%xmm2,%xmm3,%xmm8 - vpxor %xmm0,%xmm4,%xmm4 - addl 0(%rsp),%ecx - xorl %eax,%esi - movl %edx,%edi - shldl $5,%edx,%edx - vpxor %xmm5,%xmm4,%xmm4 - addl %esi,%ecx - xorl %eax,%edi - vpaddd %xmm3,%xmm11,%xmm9 - shrdl $7,%ebp,%ebp - addl %edx,%ecx - vpxor %xmm8,%xmm4,%xmm4 - addl 4(%rsp),%ebx - xorl %ebp,%edi - movl %ecx,%esi - shldl $5,%ecx,%ecx - vpsrld $30,%xmm4,%xmm8 - vmovdqa %xmm9,48(%rsp) - addl %edi,%ebx - xorl %ebp,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - vpslld $2,%xmm4,%xmm4 - addl 8(%rsp),%eax - xorl %edx,%esi - movl %ebx,%edi - shldl $5,%ebx,%ebx - addl %esi,%eax - xorl %edx,%edi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vpor %xmm8,%xmm4,%xmm4 - addl 12(%rsp),%ebp - xorl %ecx,%edi - movl %eax,%esi - shldl $5,%eax,%eax - addl %edi,%ebp - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - vpalignr $8,%xmm3,%xmm4,%xmm8 - vpxor %xmm1,%xmm5,%xmm5 - addl 16(%rsp),%edx - xorl %ebx,%esi - movl %ebp,%edi - shldl $5,%ebp,%ebp - vpxor %xmm6,%xmm5,%xmm5 - addl %esi,%edx - xorl %ebx,%edi - vpaddd %xmm4,%xmm11,%xmm9 - shrdl $7,%eax,%eax - addl %ebp,%edx - vpxor %xmm8,%xmm5,%xmm5 - addl 20(%rsp),%ecx - xorl %eax,%edi - movl %edx,%esi - shldl $5,%edx,%edx - vpsrld $30,%xmm5,%xmm8 - vmovdqa %xmm9,0(%rsp) - addl %edi,%ecx - xorl %eax,%esi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - vpslld $2,%xmm5,%xmm5 - addl 24(%rsp),%ebx - xorl %ebp,%esi - movl %ecx,%edi - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %ebp,%edi - shrdl $7,%edx,%edx - addl %ecx,%ebx - vpor %xmm8,%xmm5,%xmm5 - addl 28(%rsp),%eax - shrdl $7,%ecx,%ecx - movl %ebx,%esi - xorl %edx,%edi - shldl $5,%ebx,%ebx - addl %edi,%eax - xorl %ecx,%esi - xorl %edx,%ecx - addl %ebx,%eax - vpalignr $8,%xmm4,%xmm5,%xmm8 - vpxor %xmm2,%xmm6,%xmm6 - addl 32(%rsp),%ebp - andl %ecx,%esi - xorl %edx,%ecx - shrdl $7,%ebx,%ebx - vpxor %xmm7,%xmm6,%xmm6 - movl %eax,%edi - xorl %ecx,%esi - vpaddd %xmm5,%xmm11,%xmm9 - shldl $5,%eax,%eax - addl %esi,%ebp - vpxor %xmm8,%xmm6,%xmm6 - xorl %ebx,%edi - xorl %ecx,%ebx - addl %eax,%ebp - addl 36(%rsp),%edx - vpsrld $30,%xmm6,%xmm8 - vmovdqa %xmm9,16(%rsp) - andl %ebx,%edi - xorl %ecx,%ebx - shrdl $7,%eax,%eax - movl %ebp,%esi - vpslld $2,%xmm6,%xmm6 - xorl %ebx,%edi - shldl $5,%ebp,%ebp - addl %edi,%edx - xorl %eax,%esi - xorl %ebx,%eax - addl %ebp,%edx - addl 40(%rsp),%ecx - andl %eax,%esi - vpor %xmm8,%xmm6,%xmm6 - xorl %ebx,%eax - shrdl $7,%ebp,%ebp - movl %edx,%edi - xorl %eax,%esi - shldl $5,%edx,%edx - addl %esi,%ecx - xorl %ebp,%edi - xorl %eax,%ebp - addl %edx,%ecx - addl 44(%rsp),%ebx - andl %ebp,%edi - xorl %eax,%ebp - shrdl $7,%edx,%edx - movl %ecx,%esi - xorl %ebp,%edi - shldl $5,%ecx,%ecx - addl %edi,%ebx - xorl %edx,%esi - xorl %ebp,%edx - addl %ecx,%ebx - vpalignr $8,%xmm5,%xmm6,%xmm8 - vpxor %xmm3,%xmm7,%xmm7 - addl 48(%rsp),%eax - andl %edx,%esi - xorl %ebp,%edx - shrdl $7,%ecx,%ecx - vpxor %xmm0,%xmm7,%xmm7 - movl %ebx,%edi - xorl %edx,%esi - vpaddd %xmm6,%xmm11,%xmm9 - vmovdqa 32(%r11),%xmm11 - shldl $5,%ebx,%ebx - addl %esi,%eax - vpxor %xmm8,%xmm7,%xmm7 - xorl %ecx,%edi - xorl %edx,%ecx - addl %ebx,%eax - addl 52(%rsp),%ebp - vpsrld $30,%xmm7,%xmm8 - vmovdqa %xmm9,32(%rsp) - andl %ecx,%edi - xorl %edx,%ecx - shrdl $7,%ebx,%ebx - movl %eax,%esi - vpslld $2,%xmm7,%xmm7 - xorl %ecx,%edi - shldl $5,%eax,%eax - addl %edi,%ebp - xorl %ebx,%esi - xorl %ecx,%ebx - addl %eax,%ebp - addl 56(%rsp),%edx - andl %ebx,%esi - vpor %xmm8,%xmm7,%xmm7 - xorl %ecx,%ebx - shrdl $7,%eax,%eax - movl %ebp,%edi - xorl %ebx,%esi - shldl $5,%ebp,%ebp - addl %esi,%edx - xorl %eax,%edi - xorl %ebx,%eax - addl %ebp,%edx - addl 60(%rsp),%ecx - andl %eax,%edi - xorl %ebx,%eax - shrdl $7,%ebp,%ebp - movl %edx,%esi - xorl %eax,%edi - shldl $5,%edx,%edx - addl %edi,%ecx - xorl %ebp,%esi - xorl %eax,%ebp - addl %edx,%ecx - vpalignr $8,%xmm6,%xmm7,%xmm8 - vpxor %xmm4,%xmm0,%xmm0 - addl 0(%rsp),%ebx - andl %ebp,%esi - xorl %eax,%ebp - shrdl $7,%edx,%edx - vpxor %xmm1,%xmm0,%xmm0 - movl %ecx,%edi - xorl %ebp,%esi - vpaddd %xmm7,%xmm11,%xmm9 - shldl $5,%ecx,%ecx - addl %esi,%ebx - vpxor %xmm8,%xmm0,%xmm0 - xorl %edx,%edi - xorl %ebp,%edx - addl %ecx,%ebx - addl 4(%rsp),%eax - vpsrld $30,%xmm0,%xmm8 - vmovdqa %xmm9,48(%rsp) - andl %edx,%edi - xorl %ebp,%edx - shrdl $7,%ecx,%ecx - movl %ebx,%esi - vpslld $2,%xmm0,%xmm0 - xorl %edx,%edi - shldl $5,%ebx,%ebx - addl %edi,%eax - xorl %ecx,%esi - xorl %edx,%ecx - addl %ebx,%eax - addl 8(%rsp),%ebp - andl %ecx,%esi - vpor %xmm8,%xmm0,%xmm0 - xorl %edx,%ecx - shrdl $7,%ebx,%ebx - movl %eax,%edi - xorl %ecx,%esi - shldl $5,%eax,%eax - addl %esi,%ebp - xorl %ebx,%edi - xorl %ecx,%ebx - addl %eax,%ebp - addl 12(%rsp),%edx - andl %ebx,%edi - xorl %ecx,%ebx - shrdl $7,%eax,%eax - movl %ebp,%esi - xorl %ebx,%edi - shldl $5,%ebp,%ebp - addl %edi,%edx - xorl %eax,%esi - xorl %ebx,%eax - addl %ebp,%edx - vpalignr $8,%xmm7,%xmm0,%xmm8 - vpxor %xmm5,%xmm1,%xmm1 - addl 16(%rsp),%ecx - andl %eax,%esi - xorl %ebx,%eax - shrdl $7,%ebp,%ebp - vpxor %xmm2,%xmm1,%xmm1 - movl %edx,%edi - xorl %eax,%esi - vpaddd %xmm0,%xmm11,%xmm9 - shldl $5,%edx,%edx - addl %esi,%ecx - vpxor %xmm8,%xmm1,%xmm1 - xorl %ebp,%edi - xorl %eax,%ebp - addl %edx,%ecx - addl 20(%rsp),%ebx - vpsrld $30,%xmm1,%xmm8 - vmovdqa %xmm9,0(%rsp) - andl %ebp,%edi - xorl %eax,%ebp - shrdl $7,%edx,%edx - movl %ecx,%esi - vpslld $2,%xmm1,%xmm1 - xorl %ebp,%edi - shldl $5,%ecx,%ecx - addl %edi,%ebx - xorl %edx,%esi - xorl %ebp,%edx - addl %ecx,%ebx - addl 24(%rsp),%eax - andl %edx,%esi - vpor %xmm8,%xmm1,%xmm1 - xorl %ebp,%edx - shrdl $7,%ecx,%ecx - movl %ebx,%edi - xorl %edx,%esi - shldl $5,%ebx,%ebx - addl %esi,%eax - xorl %ecx,%edi - xorl %edx,%ecx - addl %ebx,%eax - addl 28(%rsp),%ebp - andl %ecx,%edi - xorl %edx,%ecx - shrdl $7,%ebx,%ebx - movl %eax,%esi - xorl %ecx,%edi - shldl $5,%eax,%eax - addl %edi,%ebp - xorl %ebx,%esi - xorl %ecx,%ebx - addl %eax,%ebp - vpalignr $8,%xmm0,%xmm1,%xmm8 - vpxor %xmm6,%xmm2,%xmm2 - addl 32(%rsp),%edx - andl %ebx,%esi - xorl %ecx,%ebx - shrdl $7,%eax,%eax - vpxor %xmm3,%xmm2,%xmm2 - movl %ebp,%edi - xorl %ebx,%esi - vpaddd %xmm1,%xmm11,%xmm9 - shldl $5,%ebp,%ebp - addl %esi,%edx - vpxor %xmm8,%xmm2,%xmm2 - xorl %eax,%edi - xorl %ebx,%eax - addl %ebp,%edx - addl 36(%rsp),%ecx - vpsrld $30,%xmm2,%xmm8 - vmovdqa %xmm9,16(%rsp) - andl %eax,%edi - xorl %ebx,%eax - shrdl $7,%ebp,%ebp - movl %edx,%esi - vpslld $2,%xmm2,%xmm2 - xorl %eax,%edi - shldl $5,%edx,%edx - addl %edi,%ecx - xorl %ebp,%esi - xorl %eax,%ebp - addl %edx,%ecx - addl 40(%rsp),%ebx - andl %ebp,%esi - vpor %xmm8,%xmm2,%xmm2 - xorl %eax,%ebp - shrdl $7,%edx,%edx - movl %ecx,%edi - xorl %ebp,%esi - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %edx,%edi - xorl %ebp,%edx - addl %ecx,%ebx - addl 44(%rsp),%eax - andl %edx,%edi - xorl %ebp,%edx - shrdl $7,%ecx,%ecx - movl %ebx,%esi - xorl %edx,%edi - shldl $5,%ebx,%ebx - addl %edi,%eax - xorl %edx,%esi - addl %ebx,%eax - vpalignr $8,%xmm1,%xmm2,%xmm8 - vpxor %xmm7,%xmm3,%xmm3 - addl 48(%rsp),%ebp - xorl %ecx,%esi - movl %eax,%edi - shldl $5,%eax,%eax - vpxor %xmm4,%xmm3,%xmm3 - addl %esi,%ebp - xorl %ecx,%edi - vpaddd %xmm2,%xmm11,%xmm9 - shrdl $7,%ebx,%ebx - addl %eax,%ebp - vpxor %xmm8,%xmm3,%xmm3 - addl 52(%rsp),%edx - xorl %ebx,%edi - movl %ebp,%esi - shldl $5,%ebp,%ebp - vpsrld $30,%xmm3,%xmm8 - vmovdqa %xmm9,32(%rsp) - addl %edi,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %ebp,%edx - vpslld $2,%xmm3,%xmm3 - addl 56(%rsp),%ecx - xorl %eax,%esi - movl %edx,%edi - shldl $5,%edx,%edx - addl %esi,%ecx - xorl %eax,%edi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - vpor %xmm8,%xmm3,%xmm3 - addl 60(%rsp),%ebx - xorl %ebp,%edi - movl %ecx,%esi - shldl $5,%ecx,%ecx - addl %edi,%ebx - xorl %ebp,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 0(%rsp),%eax - vpaddd %xmm3,%xmm11,%xmm9 - xorl %edx,%esi - movl %ebx,%edi - shldl $5,%ebx,%ebx - addl %esi,%eax - vmovdqa %xmm9,48(%rsp) - xorl %edx,%edi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 4(%rsp),%ebp - xorl %ecx,%edi - movl %eax,%esi - shldl $5,%eax,%eax - addl %edi,%ebp - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - addl 8(%rsp),%edx - xorl %ebx,%esi - movl %ebp,%edi - shldl $5,%ebp,%ebp - addl %esi,%edx - xorl %ebx,%edi - shrdl $7,%eax,%eax - addl %ebp,%edx - addl 12(%rsp),%ecx - xorl %eax,%edi - movl %edx,%esi - shldl $5,%edx,%edx - addl %edi,%ecx - xorl %eax,%esi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - cmpq %r10,%r9 - je .Ldone_avx - vmovdqa 64(%r11),%xmm6 - vmovdqa -64(%r11),%xmm11 - vmovdqu 0(%r9),%xmm0 - vmovdqu 16(%r9),%xmm1 - vmovdqu 32(%r9),%xmm2 - vmovdqu 48(%r9),%xmm3 - vpshufb %xmm6,%xmm0,%xmm0 - addq $64,%r9 - addl 16(%rsp),%ebx - xorl %ebp,%esi - vpshufb %xmm6,%xmm1,%xmm1 - movl %ecx,%edi - shldl $5,%ecx,%ecx - vpaddd %xmm11,%xmm0,%xmm4 - addl %esi,%ebx - xorl %ebp,%edi - shrdl $7,%edx,%edx - addl %ecx,%ebx - vmovdqa %xmm4,0(%rsp) - addl 20(%rsp),%eax - xorl %edx,%edi - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %edi,%eax - xorl %edx,%esi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 24(%rsp),%ebp - xorl %ecx,%esi - movl %eax,%edi - shldl $5,%eax,%eax - addl %esi,%ebp - xorl %ecx,%edi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - addl 28(%rsp),%edx - xorl %ebx,%edi - movl %ebp,%esi - shldl $5,%ebp,%ebp - addl %edi,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %ebp,%edx - addl 32(%rsp),%ecx - xorl %eax,%esi - vpshufb %xmm6,%xmm2,%xmm2 - movl %edx,%edi - shldl $5,%edx,%edx - vpaddd %xmm11,%xmm1,%xmm5 - addl %esi,%ecx - xorl %eax,%edi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - vmovdqa %xmm5,16(%rsp) - addl 36(%rsp),%ebx - xorl %ebp,%edi - movl %ecx,%esi - shldl $5,%ecx,%ecx - addl %edi,%ebx - xorl %ebp,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 40(%rsp),%eax - xorl %edx,%esi - movl %ebx,%edi - shldl $5,%ebx,%ebx - addl %esi,%eax - xorl %edx,%edi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 44(%rsp),%ebp - xorl %ecx,%edi - movl %eax,%esi - shldl $5,%eax,%eax - addl %edi,%ebp - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - addl 48(%rsp),%edx - xorl %ebx,%esi - vpshufb %xmm6,%xmm3,%xmm3 - movl %ebp,%edi - shldl $5,%ebp,%ebp - vpaddd %xmm11,%xmm2,%xmm6 - addl %esi,%edx - xorl %ebx,%edi - shrdl $7,%eax,%eax - addl %ebp,%edx - vmovdqa %xmm6,32(%rsp) - addl 52(%rsp),%ecx - xorl %eax,%edi - movl %edx,%esi - shldl $5,%edx,%edx - addl %edi,%ecx - xorl %eax,%esi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - addl 56(%rsp),%ebx - xorl %ebp,%esi - movl %ecx,%edi - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %ebp,%edi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 60(%rsp),%eax - xorl %edx,%edi - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %edi,%eax - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 0(%r8),%eax - addl 4(%r8),%esi - addl 8(%r8),%ecx - addl 12(%r8),%edx - movl %eax,0(%r8) - addl 16(%r8),%ebp - movl %esi,4(%r8) - movl %esi,%ebx - movl %ecx,8(%r8) - movl %ecx,%edi - movl %edx,12(%r8) - xorl %edx,%edi - movl %ebp,16(%r8) - andl %edi,%esi - jmp .Loop_avx - -.align 16 -.Ldone_avx: - addl 16(%rsp),%ebx - xorl %ebp,%esi - movl %ecx,%edi - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %ebp,%edi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 20(%rsp),%eax - xorl %edx,%edi - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %edi,%eax - xorl %edx,%esi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 24(%rsp),%ebp - xorl %ecx,%esi - movl %eax,%edi - shldl $5,%eax,%eax - addl %esi,%ebp - xorl %ecx,%edi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - addl 28(%rsp),%edx - xorl %ebx,%edi - movl %ebp,%esi - shldl $5,%ebp,%ebp - addl %edi,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %ebp,%edx - addl 32(%rsp),%ecx - xorl %eax,%esi - movl %edx,%edi - shldl $5,%edx,%edx - addl %esi,%ecx - xorl %eax,%edi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - addl 36(%rsp),%ebx - xorl %ebp,%edi - movl %ecx,%esi - shldl $5,%ecx,%ecx - addl %edi,%ebx - xorl %ebp,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 40(%rsp),%eax - xorl %edx,%esi - movl %ebx,%edi - shldl $5,%ebx,%ebx - addl %esi,%eax - xorl %edx,%edi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 44(%rsp),%ebp - xorl %ecx,%edi - movl %eax,%esi - shldl $5,%eax,%eax - addl %edi,%ebp - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - addl 48(%rsp),%edx - xorl %ebx,%esi - movl %ebp,%edi - shldl $5,%ebp,%ebp - addl %esi,%edx - xorl %ebx,%edi - shrdl $7,%eax,%eax - addl %ebp,%edx - addl 52(%rsp),%ecx - xorl %eax,%edi - movl %edx,%esi - shldl $5,%edx,%edx - addl %edi,%ecx - xorl %eax,%esi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - addl 56(%rsp),%ebx - xorl %ebp,%esi - movl %ecx,%edi - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %ebp,%edi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 60(%rsp),%eax - xorl %edx,%edi - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %edi,%eax - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vzeroupper - - addl 0(%r8),%eax - addl 4(%r8),%esi - addl 8(%r8),%ecx - movl %eax,0(%r8) - addl 12(%r8),%edx - movl %esi,4(%r8) - addl 16(%r8),%ebp - movl %ecx,8(%r8) - movl %edx,12(%r8) - movl %ebp,16(%r8) - leaq (%r14),%rsi - movq -40(%rsi),%r14 - movq -32(%rsi),%r13 - movq -24(%rsi),%r12 - movq -16(%rsi),%rbp - movq -8(%rsi),%rbx - leaq (%rsi),%rsp -.Lepilogue_avx: - .byte 0xf3,0xc3 -.size sha1_block_data_order_avx,.-sha1_block_data_order_avx -.type sha1_block_data_order_avx2,@function -.align 16 -sha1_block_data_order_avx2: -_avx2_shortcut: - movq %rsp,%rax - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - vzeroupper - movq %rax,%r14 - movq %rdi,%r8 - movq %rsi,%r9 - movq %rdx,%r10 - - leaq -640(%rsp),%rsp - shlq $6,%r10 - leaq 64(%r9),%r13 - andq $-128,%rsp - addq %r9,%r10 - leaq K_XX_XX+64(%rip),%r11 - - movl 0(%r8),%eax - cmpq %r10,%r13 - cmovaeq %r9,%r13 - movl 4(%r8),%ebp - movl 8(%r8),%ecx - movl 12(%r8),%edx - movl 16(%r8),%esi - vmovdqu 64(%r11),%ymm6 - - vmovdqu (%r9),%xmm0 - vmovdqu 16(%r9),%xmm1 - vmovdqu 32(%r9),%xmm2 - vmovdqu 48(%r9),%xmm3 - leaq 64(%r9),%r9 - vinserti128 $1,(%r13),%ymm0,%ymm0 - vinserti128 $1,16(%r13),%ymm1,%ymm1 - vpshufb %ymm6,%ymm0,%ymm0 - vinserti128 $1,32(%r13),%ymm2,%ymm2 - vpshufb %ymm6,%ymm1,%ymm1 - vinserti128 $1,48(%r13),%ymm3,%ymm3 - vpshufb %ymm6,%ymm2,%ymm2 - vmovdqu -64(%r11),%ymm11 - vpshufb %ymm6,%ymm3,%ymm3 - - vpaddd %ymm11,%ymm0,%ymm4 - vpaddd %ymm11,%ymm1,%ymm5 - vmovdqu %ymm4,0(%rsp) - vpaddd %ymm11,%ymm2,%ymm6 - vmovdqu %ymm5,32(%rsp) - vpaddd %ymm11,%ymm3,%ymm7 - vmovdqu %ymm6,64(%rsp) - vmovdqu %ymm7,96(%rsp) - vpalignr $8,%ymm0,%ymm1,%ymm4 - vpsrldq $4,%ymm3,%ymm8 - vpxor %ymm0,%ymm4,%ymm4 - vpxor %ymm2,%ymm8,%ymm8 - vpxor %ymm8,%ymm4,%ymm4 - vpsrld $31,%ymm4,%ymm8 - vpslldq $12,%ymm4,%ymm10 - vpaddd %ymm4,%ymm4,%ymm4 - vpsrld $30,%ymm10,%ymm9 - vpor %ymm8,%ymm4,%ymm4 - vpslld $2,%ymm10,%ymm10 - vpxor %ymm9,%ymm4,%ymm4 - vpxor %ymm10,%ymm4,%ymm4 - vpaddd %ymm11,%ymm4,%ymm9 - vmovdqu %ymm9,128(%rsp) - vpalignr $8,%ymm1,%ymm2,%ymm5 - vpsrldq $4,%ymm4,%ymm8 - vpxor %ymm1,%ymm5,%ymm5 - vpxor %ymm3,%ymm8,%ymm8 - vpxor %ymm8,%ymm5,%ymm5 - vpsrld $31,%ymm5,%ymm8 - vmovdqu -32(%r11),%ymm11 - vpslldq $12,%ymm5,%ymm10 - vpaddd %ymm5,%ymm5,%ymm5 - vpsrld $30,%ymm10,%ymm9 - vpor %ymm8,%ymm5,%ymm5 - vpslld $2,%ymm10,%ymm10 - vpxor %ymm9,%ymm5,%ymm5 - vpxor %ymm10,%ymm5,%ymm5 - vpaddd %ymm11,%ymm5,%ymm9 - vmovdqu %ymm9,160(%rsp) - vpalignr $8,%ymm2,%ymm3,%ymm6 - vpsrldq $4,%ymm5,%ymm8 - vpxor %ymm2,%ymm6,%ymm6 - vpxor %ymm4,%ymm8,%ymm8 - vpxor %ymm8,%ymm6,%ymm6 - vpsrld $31,%ymm6,%ymm8 - vpslldq $12,%ymm6,%ymm10 - vpaddd %ymm6,%ymm6,%ymm6 - vpsrld $30,%ymm10,%ymm9 - vpor %ymm8,%ymm6,%ymm6 - vpslld $2,%ymm10,%ymm10 - vpxor %ymm9,%ymm6,%ymm6 - vpxor %ymm10,%ymm6,%ymm6 - vpaddd %ymm11,%ymm6,%ymm9 - vmovdqu %ymm9,192(%rsp) - vpalignr $8,%ymm3,%ymm4,%ymm7 - vpsrldq $4,%ymm6,%ymm8 - vpxor %ymm3,%ymm7,%ymm7 - vpxor %ymm5,%ymm8,%ymm8 - vpxor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm7,%ymm8 - vpslldq $12,%ymm7,%ymm10 - vpaddd %ymm7,%ymm7,%ymm7 - vpsrld $30,%ymm10,%ymm9 - vpor %ymm8,%ymm7,%ymm7 - vpslld $2,%ymm10,%ymm10 - vpxor %ymm9,%ymm7,%ymm7 - vpxor %ymm10,%ymm7,%ymm7 - vpaddd %ymm11,%ymm7,%ymm9 - vmovdqu %ymm9,224(%rsp) - leaq 128(%rsp),%r13 - jmp .Loop_avx2 -.align 32 -.Loop_avx2: - rorxl $2,%ebp,%ebx - andnl %edx,%ebp,%edi - andl %ecx,%ebp - xorl %edi,%ebp - jmp .Lalign32_1 -.align 32 -.Lalign32_1: - vpalignr $8,%ymm6,%ymm7,%ymm8 - vpxor %ymm4,%ymm0,%ymm0 - addl -128(%r13),%esi - andnl %ecx,%eax,%edi - vpxor %ymm1,%ymm0,%ymm0 - addl %ebp,%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - vpxor %ymm8,%ymm0,%ymm0 - andl %ebx,%eax - addl %r12d,%esi - xorl %edi,%eax - vpsrld $30,%ymm0,%ymm8 - vpslld $2,%ymm0,%ymm0 - addl -124(%r13),%edx - andnl %ebx,%esi,%edi - addl %eax,%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - andl %ebp,%esi - vpor %ymm8,%ymm0,%ymm0 - addl %r12d,%edx - xorl %edi,%esi - addl -120(%r13),%ecx - andnl %ebp,%edx,%edi - vpaddd %ymm11,%ymm0,%ymm9 - addl %esi,%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - andl %eax,%edx - vmovdqu %ymm9,256(%rsp) - addl %r12d,%ecx - xorl %edi,%edx - addl -116(%r13),%ebx - andnl %eax,%ecx,%edi - addl %edx,%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - andl %esi,%ecx - addl %r12d,%ebx - xorl %edi,%ecx - addl -96(%r13),%ebp - andnl %esi,%ebx,%edi - addl %ecx,%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - andl %edx,%ebx - addl %r12d,%ebp - xorl %edi,%ebx - vpalignr $8,%ymm7,%ymm0,%ymm8 - vpxor %ymm5,%ymm1,%ymm1 - addl -92(%r13),%eax - andnl %edx,%ebp,%edi - vpxor %ymm2,%ymm1,%ymm1 - addl %ebx,%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - vpxor %ymm8,%ymm1,%ymm1 - andl %ecx,%ebp - addl %r12d,%eax - xorl %edi,%ebp - vpsrld $30,%ymm1,%ymm8 - vpslld $2,%ymm1,%ymm1 - addl -88(%r13),%esi - andnl %ecx,%eax,%edi - addl %ebp,%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - andl %ebx,%eax - vpor %ymm8,%ymm1,%ymm1 - addl %r12d,%esi - xorl %edi,%eax - addl -84(%r13),%edx - andnl %ebx,%esi,%edi - vpaddd %ymm11,%ymm1,%ymm9 - addl %eax,%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - andl %ebp,%esi - vmovdqu %ymm9,288(%rsp) - addl %r12d,%edx - xorl %edi,%esi - addl -64(%r13),%ecx - andnl %ebp,%edx,%edi - addl %esi,%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - andl %eax,%edx - addl %r12d,%ecx - xorl %edi,%edx - addl -60(%r13),%ebx - andnl %eax,%ecx,%edi - addl %edx,%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - andl %esi,%ecx - addl %r12d,%ebx - xorl %edi,%ecx - vpalignr $8,%ymm0,%ymm1,%ymm8 - vpxor %ymm6,%ymm2,%ymm2 - addl -56(%r13),%ebp - andnl %esi,%ebx,%edi - vpxor %ymm3,%ymm2,%ymm2 - vmovdqu 0(%r11),%ymm11 - addl %ecx,%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - vpxor %ymm8,%ymm2,%ymm2 - andl %edx,%ebx - addl %r12d,%ebp - xorl %edi,%ebx - vpsrld $30,%ymm2,%ymm8 - vpslld $2,%ymm2,%ymm2 - addl -52(%r13),%eax - andnl %edx,%ebp,%edi - addl %ebx,%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - andl %ecx,%ebp - vpor %ymm8,%ymm2,%ymm2 - addl %r12d,%eax - xorl %edi,%ebp - addl -32(%r13),%esi - andnl %ecx,%eax,%edi - vpaddd %ymm11,%ymm2,%ymm9 - addl %ebp,%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - andl %ebx,%eax - vmovdqu %ymm9,320(%rsp) - addl %r12d,%esi - xorl %edi,%eax - addl -28(%r13),%edx - andnl %ebx,%esi,%edi - addl %eax,%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - andl %ebp,%esi - addl %r12d,%edx - xorl %edi,%esi - addl -24(%r13),%ecx - andnl %ebp,%edx,%edi - addl %esi,%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - andl %eax,%edx - addl %r12d,%ecx - xorl %edi,%edx - vpalignr $8,%ymm1,%ymm2,%ymm8 - vpxor %ymm7,%ymm3,%ymm3 - addl -20(%r13),%ebx - andnl %eax,%ecx,%edi - vpxor %ymm4,%ymm3,%ymm3 - addl %edx,%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - vpxor %ymm8,%ymm3,%ymm3 - andl %esi,%ecx - addl %r12d,%ebx - xorl %edi,%ecx - vpsrld $30,%ymm3,%ymm8 - vpslld $2,%ymm3,%ymm3 - addl 0(%r13),%ebp - andnl %esi,%ebx,%edi - addl %ecx,%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - andl %edx,%ebx - vpor %ymm8,%ymm3,%ymm3 - addl %r12d,%ebp - xorl %edi,%ebx - addl 4(%r13),%eax - andnl %edx,%ebp,%edi - vpaddd %ymm11,%ymm3,%ymm9 - addl %ebx,%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - andl %ecx,%ebp - vmovdqu %ymm9,352(%rsp) - addl %r12d,%eax - xorl %edi,%ebp - addl 8(%r13),%esi - andnl %ecx,%eax,%edi - addl %ebp,%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - andl %ebx,%eax - addl %r12d,%esi - xorl %edi,%eax - addl 12(%r13),%edx - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - xorl %ebx,%esi - vpalignr $8,%ymm2,%ymm3,%ymm8 - vpxor %ymm0,%ymm4,%ymm4 - addl 32(%r13),%ecx - leal (%rcx,%rsi,1),%ecx - vpxor %ymm5,%ymm4,%ymm4 - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - vpxor %ymm8,%ymm4,%ymm4 - addl %r12d,%ecx - xorl %ebp,%edx - addl 36(%r13),%ebx - vpsrld $30,%ymm4,%ymm8 - vpslld $2,%ymm4,%ymm4 - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - xorl %eax,%ecx - vpor %ymm8,%ymm4,%ymm4 - addl 40(%r13),%ebp - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - vpaddd %ymm11,%ymm4,%ymm9 - xorl %edx,%ebx - addl %r12d,%ebp - xorl %esi,%ebx - addl 44(%r13),%eax - vmovdqu %ymm9,384(%rsp) - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - xorl %edx,%ebp - addl 64(%r13),%esi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - xorl %ecx,%eax - vpalignr $8,%ymm3,%ymm4,%ymm8 - vpxor %ymm1,%ymm5,%ymm5 - addl 68(%r13),%edx - leal (%rdx,%rax,1),%edx - vpxor %ymm6,%ymm5,%ymm5 - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - vpxor %ymm8,%ymm5,%ymm5 - addl %r12d,%edx - xorl %ebx,%esi - addl 72(%r13),%ecx - vpsrld $30,%ymm5,%ymm8 - vpslld $2,%ymm5,%ymm5 - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - addl %r12d,%ecx - xorl %ebp,%edx - vpor %ymm8,%ymm5,%ymm5 - addl 76(%r13),%ebx - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - vpaddd %ymm11,%ymm5,%ymm9 - xorl %esi,%ecx - addl %r12d,%ebx - xorl %eax,%ecx - addl 96(%r13),%ebp - vmovdqu %ymm9,416(%rsp) - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - xorl %esi,%ebx - addl 100(%r13),%eax - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - xorl %edx,%ebp - vpalignr $8,%ymm4,%ymm5,%ymm8 - vpxor %ymm2,%ymm6,%ymm6 - addl 104(%r13),%esi - leal (%rsi,%rbp,1),%esi - vpxor %ymm7,%ymm6,%ymm6 - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - vpxor %ymm8,%ymm6,%ymm6 - addl %r12d,%esi - xorl %ecx,%eax - addl 108(%r13),%edx - leaq 256(%r13),%r13 - vpsrld $30,%ymm6,%ymm8 - vpslld $2,%ymm6,%ymm6 - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - xorl %ebx,%esi - vpor %ymm8,%ymm6,%ymm6 - addl -128(%r13),%ecx - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - vpaddd %ymm11,%ymm6,%ymm9 - xorl %eax,%edx - addl %r12d,%ecx - xorl %ebp,%edx - addl -124(%r13),%ebx - vmovdqu %ymm9,448(%rsp) - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - xorl %eax,%ecx - addl -120(%r13),%ebp - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - xorl %esi,%ebx - vpalignr $8,%ymm5,%ymm6,%ymm8 - vpxor %ymm3,%ymm7,%ymm7 - addl -116(%r13),%eax - leal (%rax,%rbx,1),%eax - vpxor %ymm0,%ymm7,%ymm7 - vmovdqu 32(%r11),%ymm11 - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - vpxor %ymm8,%ymm7,%ymm7 - addl %r12d,%eax - xorl %edx,%ebp - addl -96(%r13),%esi - vpsrld $30,%ymm7,%ymm8 - vpslld $2,%ymm7,%ymm7 - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - xorl %ecx,%eax - vpor %ymm8,%ymm7,%ymm7 - addl -92(%r13),%edx - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - vpaddd %ymm11,%ymm7,%ymm9 - xorl %ebp,%esi - addl %r12d,%edx - xorl %ebx,%esi - addl -88(%r13),%ecx - vmovdqu %ymm9,480(%rsp) - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - addl %r12d,%ecx - xorl %ebp,%edx - addl -84(%r13),%ebx - movl %esi,%edi - xorl %eax,%edi - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - andl %edi,%ecx - jmp .Lalign32_2 -.align 32 -.Lalign32_2: - vpalignr $8,%ymm6,%ymm7,%ymm8 - vpxor %ymm4,%ymm0,%ymm0 - addl -64(%r13),%ebp - xorl %esi,%ecx - vpxor %ymm1,%ymm0,%ymm0 - movl %edx,%edi - xorl %esi,%edi - leal (%rcx,%rbp,1),%ebp - vpxor %ymm8,%ymm0,%ymm0 - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - vpsrld $30,%ymm0,%ymm8 - vpslld $2,%ymm0,%ymm0 - addl %r12d,%ebp - andl %edi,%ebx - addl -60(%r13),%eax - xorl %edx,%ebx - movl %ecx,%edi - xorl %edx,%edi - vpor %ymm8,%ymm0,%ymm0 - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - vpaddd %ymm11,%ymm0,%ymm9 - addl %r12d,%eax - andl %edi,%ebp - addl -56(%r13),%esi - xorl %ecx,%ebp - vmovdqu %ymm9,512(%rsp) - movl %ebx,%edi - xorl %ecx,%edi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - andl %edi,%eax - addl -52(%r13),%edx - xorl %ebx,%eax - movl %ebp,%edi - xorl %ebx,%edi - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - andl %edi,%esi - addl -32(%r13),%ecx - xorl %ebp,%esi - movl %eax,%edi - xorl %ebp,%edi - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - addl %r12d,%ecx - andl %edi,%edx - vpalignr $8,%ymm7,%ymm0,%ymm8 - vpxor %ymm5,%ymm1,%ymm1 - addl -28(%r13),%ebx - xorl %eax,%edx - vpxor %ymm2,%ymm1,%ymm1 - movl %esi,%edi - xorl %eax,%edi - leal (%rbx,%rdx,1),%ebx - vpxor %ymm8,%ymm1,%ymm1 - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - vpsrld $30,%ymm1,%ymm8 - vpslld $2,%ymm1,%ymm1 - addl %r12d,%ebx - andl %edi,%ecx - addl -24(%r13),%ebp - xorl %esi,%ecx - movl %edx,%edi - xorl %esi,%edi - vpor %ymm8,%ymm1,%ymm1 - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - vpaddd %ymm11,%ymm1,%ymm9 - addl %r12d,%ebp - andl %edi,%ebx - addl -20(%r13),%eax - xorl %edx,%ebx - vmovdqu %ymm9,544(%rsp) - movl %ecx,%edi - xorl %edx,%edi - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - andl %edi,%ebp - addl 0(%r13),%esi - xorl %ecx,%ebp - movl %ebx,%edi - xorl %ecx,%edi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - andl %edi,%eax - addl 4(%r13),%edx - xorl %ebx,%eax - movl %ebp,%edi - xorl %ebx,%edi - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - andl %edi,%esi - vpalignr $8,%ymm0,%ymm1,%ymm8 - vpxor %ymm6,%ymm2,%ymm2 - addl 8(%r13),%ecx - xorl %ebp,%esi - vpxor %ymm3,%ymm2,%ymm2 - movl %eax,%edi - xorl %ebp,%edi - leal (%rcx,%rsi,1),%ecx - vpxor %ymm8,%ymm2,%ymm2 - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - vpsrld $30,%ymm2,%ymm8 - vpslld $2,%ymm2,%ymm2 - addl %r12d,%ecx - andl %edi,%edx - addl 12(%r13),%ebx - xorl %eax,%edx - movl %esi,%edi - xorl %eax,%edi - vpor %ymm8,%ymm2,%ymm2 - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - vpaddd %ymm11,%ymm2,%ymm9 - addl %r12d,%ebx - andl %edi,%ecx - addl 32(%r13),%ebp - xorl %esi,%ecx - vmovdqu %ymm9,576(%rsp) - movl %edx,%edi - xorl %esi,%edi - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - andl %edi,%ebx - addl 36(%r13),%eax - xorl %edx,%ebx - movl %ecx,%edi - xorl %edx,%edi - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - andl %edi,%ebp - addl 40(%r13),%esi - xorl %ecx,%ebp - movl %ebx,%edi - xorl %ecx,%edi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - andl %edi,%eax - vpalignr $8,%ymm1,%ymm2,%ymm8 - vpxor %ymm7,%ymm3,%ymm3 - addl 44(%r13),%edx - xorl %ebx,%eax - vpxor %ymm4,%ymm3,%ymm3 - movl %ebp,%edi - xorl %ebx,%edi - leal (%rdx,%rax,1),%edx - vpxor %ymm8,%ymm3,%ymm3 - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - vpsrld $30,%ymm3,%ymm8 - vpslld $2,%ymm3,%ymm3 - addl %r12d,%edx - andl %edi,%esi - addl 64(%r13),%ecx - xorl %ebp,%esi - movl %eax,%edi - xorl %ebp,%edi - vpor %ymm8,%ymm3,%ymm3 - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - vpaddd %ymm11,%ymm3,%ymm9 - addl %r12d,%ecx - andl %edi,%edx - addl 68(%r13),%ebx - xorl %eax,%edx - vmovdqu %ymm9,608(%rsp) - movl %esi,%edi - xorl %eax,%edi - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - andl %edi,%ecx - addl 72(%r13),%ebp - xorl %esi,%ecx - movl %edx,%edi - xorl %esi,%edi - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - andl %edi,%ebx - addl 76(%r13),%eax - xorl %edx,%ebx - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - xorl %edx,%ebp - addl 96(%r13),%esi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - xorl %ecx,%eax - addl 100(%r13),%edx - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - xorl %ebx,%esi - addl 104(%r13),%ecx - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - addl %r12d,%ecx - xorl %ebp,%edx - addl 108(%r13),%ebx - leaq 256(%r13),%r13 - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - xorl %eax,%ecx - addl -128(%r13),%ebp - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - xorl %esi,%ebx - addl -124(%r13),%eax - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - xorl %edx,%ebp - addl -120(%r13),%esi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - xorl %ecx,%eax - addl -116(%r13),%edx - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - xorl %ebx,%esi - addl -96(%r13),%ecx - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - addl %r12d,%ecx - xorl %ebp,%edx - addl -92(%r13),%ebx - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - xorl %eax,%ecx - addl -88(%r13),%ebp - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - xorl %esi,%ebx - addl -84(%r13),%eax - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - xorl %edx,%ebp - addl -64(%r13),%esi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - xorl %ecx,%eax - addl -60(%r13),%edx - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - xorl %ebx,%esi - addl -56(%r13),%ecx - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - addl %r12d,%ecx - xorl %ebp,%edx - addl -52(%r13),%ebx - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - xorl %eax,%ecx - addl -32(%r13),%ebp - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - xorl %esi,%ebx - addl -28(%r13),%eax - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - xorl %edx,%ebp - addl -24(%r13),%esi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - xorl %ecx,%eax - addl -20(%r13),%edx - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - addl %r12d,%edx - leaq 128(%r9),%r13 - leaq 128(%r9),%rdi - cmpq %r10,%r13 - cmovaeq %r9,%r13 - - - addl 0(%r8),%edx - addl 4(%r8),%esi - addl 8(%r8),%ebp - movl %edx,0(%r8) - addl 12(%r8),%ebx - movl %esi,4(%r8) - movl %edx,%eax - addl 16(%r8),%ecx - movl %ebp,%r12d - movl %ebp,8(%r8) - movl %ebx,%edx - - movl %ebx,12(%r8) - movl %esi,%ebp - movl %ecx,16(%r8) - - movl %ecx,%esi - movl %r12d,%ecx - - - cmpq %r10,%r9 - je .Ldone_avx2 - vmovdqu 64(%r11),%ymm6 - cmpq %r10,%rdi - ja .Last_avx2 - - vmovdqu -64(%rdi),%xmm0 - vmovdqu -48(%rdi),%xmm1 - vmovdqu -32(%rdi),%xmm2 - vmovdqu -16(%rdi),%xmm3 - vinserti128 $1,0(%r13),%ymm0,%ymm0 - vinserti128 $1,16(%r13),%ymm1,%ymm1 - vinserti128 $1,32(%r13),%ymm2,%ymm2 - vinserti128 $1,48(%r13),%ymm3,%ymm3 - jmp .Last_avx2 - -.align 32 -.Last_avx2: - leaq 128+16(%rsp),%r13 - rorxl $2,%ebp,%ebx - andnl %edx,%ebp,%edi - andl %ecx,%ebp - xorl %edi,%ebp - subq $-128,%r9 - addl -128(%r13),%esi - andnl %ecx,%eax,%edi - addl %ebp,%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - andl %ebx,%eax - addl %r12d,%esi - xorl %edi,%eax - addl -124(%r13),%edx - andnl %ebx,%esi,%edi - addl %eax,%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - andl %ebp,%esi - addl %r12d,%edx - xorl %edi,%esi - addl -120(%r13),%ecx - andnl %ebp,%edx,%edi - addl %esi,%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - andl %eax,%edx - addl %r12d,%ecx - xorl %edi,%edx - addl -116(%r13),%ebx - andnl %eax,%ecx,%edi - addl %edx,%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - andl %esi,%ecx - addl %r12d,%ebx - xorl %edi,%ecx - addl -96(%r13),%ebp - andnl %esi,%ebx,%edi - addl %ecx,%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - andl %edx,%ebx - addl %r12d,%ebp - xorl %edi,%ebx - addl -92(%r13),%eax - andnl %edx,%ebp,%edi - addl %ebx,%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - andl %ecx,%ebp - addl %r12d,%eax - xorl %edi,%ebp - addl -88(%r13),%esi - andnl %ecx,%eax,%edi - addl %ebp,%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - andl %ebx,%eax - addl %r12d,%esi - xorl %edi,%eax - addl -84(%r13),%edx - andnl %ebx,%esi,%edi - addl %eax,%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - andl %ebp,%esi - addl %r12d,%edx - xorl %edi,%esi - addl -64(%r13),%ecx - andnl %ebp,%edx,%edi - addl %esi,%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - andl %eax,%edx - addl %r12d,%ecx - xorl %edi,%edx - addl -60(%r13),%ebx - andnl %eax,%ecx,%edi - addl %edx,%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - andl %esi,%ecx - addl %r12d,%ebx - xorl %edi,%ecx - addl -56(%r13),%ebp - andnl %esi,%ebx,%edi - addl %ecx,%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - andl %edx,%ebx - addl %r12d,%ebp - xorl %edi,%ebx - addl -52(%r13),%eax - andnl %edx,%ebp,%edi - addl %ebx,%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - andl %ecx,%ebp - addl %r12d,%eax - xorl %edi,%ebp - addl -32(%r13),%esi - andnl %ecx,%eax,%edi - addl %ebp,%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - andl %ebx,%eax - addl %r12d,%esi - xorl %edi,%eax - addl -28(%r13),%edx - andnl %ebx,%esi,%edi - addl %eax,%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - andl %ebp,%esi - addl %r12d,%edx - xorl %edi,%esi - addl -24(%r13),%ecx - andnl %ebp,%edx,%edi - addl %esi,%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - andl %eax,%edx - addl %r12d,%ecx - xorl %edi,%edx - addl -20(%r13),%ebx - andnl %eax,%ecx,%edi - addl %edx,%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - andl %esi,%ecx - addl %r12d,%ebx - xorl %edi,%ecx - addl 0(%r13),%ebp - andnl %esi,%ebx,%edi - addl %ecx,%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - andl %edx,%ebx - addl %r12d,%ebp - xorl %edi,%ebx - addl 4(%r13),%eax - andnl %edx,%ebp,%edi - addl %ebx,%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - andl %ecx,%ebp - addl %r12d,%eax - xorl %edi,%ebp - addl 8(%r13),%esi - andnl %ecx,%eax,%edi - addl %ebp,%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - andl %ebx,%eax - addl %r12d,%esi - xorl %edi,%eax - addl 12(%r13),%edx - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - xorl %ebx,%esi - addl 32(%r13),%ecx - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - addl %r12d,%ecx - xorl %ebp,%edx - addl 36(%r13),%ebx - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - xorl %eax,%ecx - addl 40(%r13),%ebp - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - xorl %esi,%ebx - addl 44(%r13),%eax - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - xorl %edx,%ebp - addl 64(%r13),%esi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - xorl %ecx,%eax - vmovdqu -64(%r11),%ymm11 - vpshufb %ymm6,%ymm0,%ymm0 - addl 68(%r13),%edx - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - xorl %ebx,%esi - addl 72(%r13),%ecx - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - addl %r12d,%ecx - xorl %ebp,%edx - addl 76(%r13),%ebx - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - xorl %eax,%ecx - addl 96(%r13),%ebp - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - xorl %esi,%ebx - addl 100(%r13),%eax - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - xorl %edx,%ebp - vpshufb %ymm6,%ymm1,%ymm1 - vpaddd %ymm11,%ymm0,%ymm8 - addl 104(%r13),%esi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - xorl %ecx,%eax - addl 108(%r13),%edx - leaq 256(%r13),%r13 - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - xorl %ebx,%esi - addl -128(%r13),%ecx - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - addl %r12d,%ecx - xorl %ebp,%edx - addl -124(%r13),%ebx - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - xorl %eax,%ecx - addl -120(%r13),%ebp - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - xorl %esi,%ebx - vmovdqu %ymm8,0(%rsp) - vpshufb %ymm6,%ymm2,%ymm2 - vpaddd %ymm11,%ymm1,%ymm9 - addl -116(%r13),%eax - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - xorl %edx,%ebp - addl -96(%r13),%esi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - xorl %ecx,%eax - addl -92(%r13),%edx - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - xorl %ebx,%esi - addl -88(%r13),%ecx - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - addl %r12d,%ecx - xorl %ebp,%edx - addl -84(%r13),%ebx - movl %esi,%edi - xorl %eax,%edi - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - andl %edi,%ecx - vmovdqu %ymm9,32(%rsp) - vpshufb %ymm6,%ymm3,%ymm3 - vpaddd %ymm11,%ymm2,%ymm6 - addl -64(%r13),%ebp - xorl %esi,%ecx - movl %edx,%edi - xorl %esi,%edi - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - andl %edi,%ebx - addl -60(%r13),%eax - xorl %edx,%ebx - movl %ecx,%edi - xorl %edx,%edi - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - andl %edi,%ebp - addl -56(%r13),%esi - xorl %ecx,%ebp - movl %ebx,%edi - xorl %ecx,%edi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - andl %edi,%eax - addl -52(%r13),%edx - xorl %ebx,%eax - movl %ebp,%edi - xorl %ebx,%edi - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - andl %edi,%esi - addl -32(%r13),%ecx - xorl %ebp,%esi - movl %eax,%edi - xorl %ebp,%edi - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - addl %r12d,%ecx - andl %edi,%edx - jmp .Lalign32_3 -.align 32 -.Lalign32_3: - vmovdqu %ymm6,64(%rsp) - vpaddd %ymm11,%ymm3,%ymm7 - addl -28(%r13),%ebx - xorl %eax,%edx - movl %esi,%edi - xorl %eax,%edi - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - andl %edi,%ecx - addl -24(%r13),%ebp - xorl %esi,%ecx - movl %edx,%edi - xorl %esi,%edi - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - andl %edi,%ebx - addl -20(%r13),%eax - xorl %edx,%ebx - movl %ecx,%edi - xorl %edx,%edi - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - andl %edi,%ebp - addl 0(%r13),%esi - xorl %ecx,%ebp - movl %ebx,%edi - xorl %ecx,%edi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - andl %edi,%eax - addl 4(%r13),%edx - xorl %ebx,%eax - movl %ebp,%edi - xorl %ebx,%edi - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - andl %edi,%esi - vmovdqu %ymm7,96(%rsp) - addl 8(%r13),%ecx - xorl %ebp,%esi - movl %eax,%edi - xorl %ebp,%edi - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - addl %r12d,%ecx - andl %edi,%edx - addl 12(%r13),%ebx - xorl %eax,%edx - movl %esi,%edi - xorl %eax,%edi - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - andl %edi,%ecx - addl 32(%r13),%ebp - xorl %esi,%ecx - movl %edx,%edi - xorl %esi,%edi - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - andl %edi,%ebx - addl 36(%r13),%eax - xorl %edx,%ebx - movl %ecx,%edi - xorl %edx,%edi - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - andl %edi,%ebp - addl 40(%r13),%esi - xorl %ecx,%ebp - movl %ebx,%edi - xorl %ecx,%edi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - andl %edi,%eax - vpalignr $8,%ymm0,%ymm1,%ymm4 - addl 44(%r13),%edx - xorl %ebx,%eax - movl %ebp,%edi - xorl %ebx,%edi - vpsrldq $4,%ymm3,%ymm8 - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - vpxor %ymm0,%ymm4,%ymm4 - vpxor %ymm2,%ymm8,%ymm8 - xorl %ebp,%esi - addl %r12d,%edx - vpxor %ymm8,%ymm4,%ymm4 - andl %edi,%esi - addl 64(%r13),%ecx - xorl %ebp,%esi - movl %eax,%edi - vpsrld $31,%ymm4,%ymm8 - xorl %ebp,%edi - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - vpslldq $12,%ymm4,%ymm10 - vpaddd %ymm4,%ymm4,%ymm4 - rorxl $2,%edx,%esi - xorl %eax,%edx - vpsrld $30,%ymm10,%ymm9 - vpor %ymm8,%ymm4,%ymm4 - addl %r12d,%ecx - andl %edi,%edx - vpslld $2,%ymm10,%ymm10 - vpxor %ymm9,%ymm4,%ymm4 - addl 68(%r13),%ebx - xorl %eax,%edx - vpxor %ymm10,%ymm4,%ymm4 - movl %esi,%edi - xorl %eax,%edi - leal (%rbx,%rdx,1),%ebx - vpaddd %ymm11,%ymm4,%ymm9 - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - vmovdqu %ymm9,128(%rsp) - addl %r12d,%ebx - andl %edi,%ecx - addl 72(%r13),%ebp - xorl %esi,%ecx - movl %edx,%edi - xorl %esi,%edi - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - andl %edi,%ebx - addl 76(%r13),%eax - xorl %edx,%ebx - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - xorl %edx,%ebp - vpalignr $8,%ymm1,%ymm2,%ymm5 - addl 96(%r13),%esi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - vpsrldq $4,%ymm4,%ymm8 - xorl %ebx,%eax - addl %r12d,%esi - xorl %ecx,%eax - vpxor %ymm1,%ymm5,%ymm5 - vpxor %ymm3,%ymm8,%ymm8 - addl 100(%r13),%edx - leal (%rdx,%rax,1),%edx - vpxor %ymm8,%ymm5,%ymm5 - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - vpsrld $31,%ymm5,%ymm8 - vmovdqu -32(%r11),%ymm11 - xorl %ebx,%esi - addl 104(%r13),%ecx - leal (%rcx,%rsi,1),%ecx - vpslldq $12,%ymm5,%ymm10 - vpaddd %ymm5,%ymm5,%ymm5 - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - vpsrld $30,%ymm10,%ymm9 - vpor %ymm8,%ymm5,%ymm5 - xorl %eax,%edx - addl %r12d,%ecx - vpslld $2,%ymm10,%ymm10 - vpxor %ymm9,%ymm5,%ymm5 - xorl %ebp,%edx - addl 108(%r13),%ebx - leaq 256(%r13),%r13 - vpxor %ymm10,%ymm5,%ymm5 - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - vpaddd %ymm11,%ymm5,%ymm9 - xorl %esi,%ecx - addl %r12d,%ebx - xorl %eax,%ecx - vmovdqu %ymm9,160(%rsp) - addl -128(%r13),%ebp - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - xorl %esi,%ebx - vpalignr $8,%ymm2,%ymm3,%ymm6 - addl -124(%r13),%eax - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - vpsrldq $4,%ymm5,%ymm8 - xorl %ecx,%ebp - addl %r12d,%eax - xorl %edx,%ebp - vpxor %ymm2,%ymm6,%ymm6 - vpxor %ymm4,%ymm8,%ymm8 - addl -120(%r13),%esi - leal (%rsi,%rbp,1),%esi - vpxor %ymm8,%ymm6,%ymm6 - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - vpsrld $31,%ymm6,%ymm8 - xorl %ecx,%eax - addl -116(%r13),%edx - leal (%rdx,%rax,1),%edx - vpslldq $12,%ymm6,%ymm10 - vpaddd %ymm6,%ymm6,%ymm6 - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - vpsrld $30,%ymm10,%ymm9 - vpor %ymm8,%ymm6,%ymm6 - xorl %ebp,%esi - addl %r12d,%edx - vpslld $2,%ymm10,%ymm10 - vpxor %ymm9,%ymm6,%ymm6 - xorl %ebx,%esi - addl -96(%r13),%ecx - vpxor %ymm10,%ymm6,%ymm6 - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - vpaddd %ymm11,%ymm6,%ymm9 - xorl %eax,%edx - addl %r12d,%ecx - xorl %ebp,%edx - vmovdqu %ymm9,192(%rsp) - addl -92(%r13),%ebx - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - xorl %eax,%ecx - vpalignr $8,%ymm3,%ymm4,%ymm7 - addl -88(%r13),%ebp - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - vpsrldq $4,%ymm6,%ymm8 - xorl %edx,%ebx - addl %r12d,%ebp - xorl %esi,%ebx - vpxor %ymm3,%ymm7,%ymm7 - vpxor %ymm5,%ymm8,%ymm8 - addl -84(%r13),%eax - leal (%rax,%rbx,1),%eax - vpxor %ymm8,%ymm7,%ymm7 - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - vpsrld $31,%ymm7,%ymm8 - xorl %edx,%ebp - addl -64(%r13),%esi - leal (%rsi,%rbp,1),%esi - vpslldq $12,%ymm7,%ymm10 - vpaddd %ymm7,%ymm7,%ymm7 - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - vpsrld $30,%ymm10,%ymm9 - vpor %ymm8,%ymm7,%ymm7 - xorl %ebx,%eax - addl %r12d,%esi - vpslld $2,%ymm10,%ymm10 - vpxor %ymm9,%ymm7,%ymm7 - xorl %ecx,%eax - addl -60(%r13),%edx - vpxor %ymm10,%ymm7,%ymm7 - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - vpaddd %ymm11,%ymm7,%ymm9 - xorl %ebp,%esi - addl %r12d,%edx - xorl %ebx,%esi - vmovdqu %ymm9,224(%rsp) - addl -56(%r13),%ecx - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - addl %r12d,%ecx - xorl %ebp,%edx - addl -52(%r13),%ebx - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - xorl %eax,%ecx - addl -32(%r13),%ebp - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - xorl %esi,%ebx - addl -28(%r13),%eax - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - xorl %edx,%ebp - addl -24(%r13),%esi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - xorl %ecx,%eax - addl -20(%r13),%edx - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - addl %r12d,%edx - leaq 128(%rsp),%r13 - - - addl 0(%r8),%edx - addl 4(%r8),%esi - addl 8(%r8),%ebp - movl %edx,0(%r8) - addl 12(%r8),%ebx - movl %esi,4(%r8) - movl %edx,%eax - addl 16(%r8),%ecx - movl %ebp,%r12d - movl %ebp,8(%r8) - movl %ebx,%edx - - movl %ebx,12(%r8) - movl %esi,%ebp - movl %ecx,16(%r8) - - movl %ecx,%esi - movl %r12d,%ecx - - - cmpq %r10,%r9 - jbe .Loop_avx2 - -.Ldone_avx2: - vzeroupper - leaq (%r14),%rsi - movq -40(%rsi),%r14 - movq -32(%rsi),%r13 - movq -24(%rsi),%r12 - movq -16(%rsi),%rbp - movq -8(%rsi),%rbx - leaq (%rsi),%rsp -.Lepilogue_avx2: - .byte 0xf3,0xc3 -.size sha1_block_data_order_avx2,.-sha1_block_data_order_avx2 .align 64 K_XX_XX: .long 0x5a827999,0x5a827999,0x5a827999,0x5a827999 diff --git a/deps/openssl/asm/x64-elf-gas/sha/sha256-mb-x86_64.s b/deps/openssl/asm/x64-elf-gas/sha/sha256-mb-x86_64.s index 0c06094084e48a..7655283b9885b9 100644 --- a/deps/openssl/asm/x64-elf-gas/sha/sha256-mb-x86_64.s +++ b/deps/openssl/asm/x64-elf-gas/sha/sha256-mb-x86_64.s @@ -9,8 +9,6 @@ sha256_multi_block: movq OPENSSL_ia32cap_P+4(%rip),%rcx btq $61,%rcx jc _shaext_shortcut - testl $268435456,%ecx - jnz _avx_shortcut movq %rsp,%rax pushq %rbx pushq %rbp @@ -2679,10 +2677,10 @@ _shaext_shortcut: punpckhqdq %xmm8,%xmm14 punpckhqdq %xmm10,%xmm15 - pshufd $27,%xmm12,%xmm12 - pshufd $27,%xmm13,%xmm13 - pshufd $27,%xmm14,%xmm14 - pshufd $27,%xmm15,%xmm15 + pshufd $0b00011011,%xmm12,%xmm12 + pshufd $0b00011011,%xmm13,%xmm13 + pshufd $0b00011011,%xmm14,%xmm14 + pshufd $0b00011011,%xmm15,%xmm15 jmp .Loop_shaext .align 32 @@ -2714,11 +2712,11 @@ _shaext_shortcut: movdqa %xmm2,%xmm0 movdqa %xmm15,112(%rsp) .byte 69,15,56,203,254 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 pxor %xmm12,%xmm4 movdqa %xmm12,64(%rsp) .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 pxor %xmm14,%xmm8 movdqa %xmm14,96(%rsp) movdqa 16-128(%rbp),%xmm1 @@ -2736,11 +2734,11 @@ _shaext_shortcut: .byte 102,68,15,56,0,211 prefetcht0 127(%r9) .byte 69,15,56,203,254 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 .byte 102,68,15,56,0,219 .byte 15,56,204,229 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 32-128(%rbp),%xmm1 paddd %xmm6,%xmm1 .byte 69,15,56,203,247 @@ -2753,14 +2751,14 @@ _shaext_shortcut: movdqa %xmm2,%xmm0 movdqa %xmm7,%xmm3 .byte 69,15,56,203,254 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 .byte 102,15,58,15,222,4 paddd %xmm3,%xmm4 movdqa %xmm11,%xmm3 .byte 102,65,15,58,15,218,4 .byte 15,56,204,238 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 48-128(%rbp),%xmm1 paddd %xmm7,%xmm1 .byte 69,15,56,203,247 @@ -2777,13 +2775,13 @@ _shaext_shortcut: .byte 102,15,58,15,223,4 .byte 69,15,56,203,254 .byte 69,15,56,205,195 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm5 movdqa %xmm8,%xmm3 .byte 102,65,15,58,15,219,4 .byte 15,56,204,247 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 64-128(%rbp),%xmm1 paddd %xmm4,%xmm1 .byte 69,15,56,203,247 @@ -2799,13 +2797,13 @@ _shaext_shortcut: .byte 102,15,58,15,220,4 .byte 69,15,56,203,254 .byte 69,15,56,205,200 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm6 movdqa %xmm9,%xmm3 .byte 102,65,15,58,15,216,4 .byte 15,56,204,252 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 80-128(%rbp),%xmm1 paddd %xmm5,%xmm1 .byte 69,15,56,203,247 @@ -2821,13 +2819,13 @@ _shaext_shortcut: .byte 102,15,58,15,221,4 .byte 69,15,56,203,254 .byte 69,15,56,205,209 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm7 movdqa %xmm10,%xmm3 .byte 102,65,15,58,15,217,4 .byte 15,56,204,229 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 96-128(%rbp),%xmm1 paddd %xmm6,%xmm1 .byte 69,15,56,203,247 @@ -2843,13 +2841,13 @@ _shaext_shortcut: .byte 102,15,58,15,222,4 .byte 69,15,56,203,254 .byte 69,15,56,205,218 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm4 movdqa %xmm11,%xmm3 .byte 102,65,15,58,15,218,4 .byte 15,56,204,238 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 112-128(%rbp),%xmm1 paddd %xmm7,%xmm1 .byte 69,15,56,203,247 @@ -2865,13 +2863,13 @@ _shaext_shortcut: .byte 102,15,58,15,223,4 .byte 69,15,56,203,254 .byte 69,15,56,205,195 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm5 movdqa %xmm8,%xmm3 .byte 102,65,15,58,15,219,4 .byte 15,56,204,247 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 128-128(%rbp),%xmm1 paddd %xmm4,%xmm1 .byte 69,15,56,203,247 @@ -2887,13 +2885,13 @@ _shaext_shortcut: .byte 102,15,58,15,220,4 .byte 69,15,56,203,254 .byte 69,15,56,205,200 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm6 movdqa %xmm9,%xmm3 .byte 102,65,15,58,15,216,4 .byte 15,56,204,252 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 144-128(%rbp),%xmm1 paddd %xmm5,%xmm1 .byte 69,15,56,203,247 @@ -2909,13 +2907,13 @@ _shaext_shortcut: .byte 102,15,58,15,221,4 .byte 69,15,56,203,254 .byte 69,15,56,205,209 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm7 movdqa %xmm10,%xmm3 .byte 102,65,15,58,15,217,4 .byte 15,56,204,229 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 160-128(%rbp),%xmm1 paddd %xmm6,%xmm1 .byte 69,15,56,203,247 @@ -2931,13 +2929,13 @@ _shaext_shortcut: .byte 102,15,58,15,222,4 .byte 69,15,56,203,254 .byte 69,15,56,205,218 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm4 movdqa %xmm11,%xmm3 .byte 102,65,15,58,15,218,4 .byte 15,56,204,238 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 176-128(%rbp),%xmm1 paddd %xmm7,%xmm1 .byte 69,15,56,203,247 @@ -2953,13 +2951,13 @@ _shaext_shortcut: .byte 102,15,58,15,223,4 .byte 69,15,56,203,254 .byte 69,15,56,205,195 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm5 movdqa %xmm8,%xmm3 .byte 102,65,15,58,15,219,4 .byte 15,56,204,247 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 192-128(%rbp),%xmm1 paddd %xmm4,%xmm1 .byte 69,15,56,203,247 @@ -2975,13 +2973,13 @@ _shaext_shortcut: .byte 102,15,58,15,220,4 .byte 69,15,56,203,254 .byte 69,15,56,205,200 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm6 movdqa %xmm9,%xmm3 .byte 102,65,15,58,15,216,4 .byte 15,56,204,252 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 208-128(%rbp),%xmm1 paddd %xmm5,%xmm1 .byte 69,15,56,203,247 @@ -2997,13 +2995,13 @@ _shaext_shortcut: .byte 102,15,58,15,221,4 .byte 69,15,56,203,254 .byte 69,15,56,205,209 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm7 movdqa %xmm10,%xmm3 .byte 102,65,15,58,15,217,4 nop .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 224-128(%rbp),%xmm1 paddd %xmm6,%xmm1 .byte 69,15,56,203,247 @@ -3020,13 +3018,13 @@ _shaext_shortcut: pxor %xmm6,%xmm6 .byte 69,15,56,203,254 .byte 69,15,56,205,218 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 movdqa 240-128(%rbp),%xmm1 paddd %xmm7,%xmm1 movq (%rbx),%xmm7 nop .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 240-128(%rbp),%xmm2 paddd %xmm11,%xmm2 .byte 69,15,56,203,247 @@ -3036,17 +3034,17 @@ _shaext_shortcut: cmovgeq %rsp,%r8 cmpl 4(%rbx),%ecx cmovgeq %rsp,%r9 - pshufd $0,%xmm7,%xmm9 + pshufd $0x00,%xmm7,%xmm9 .byte 69,15,56,203,236 movdqa %xmm2,%xmm0 - pshufd $85,%xmm7,%xmm10 + pshufd $0x55,%xmm7,%xmm10 movdqa %xmm7,%xmm11 .byte 69,15,56,203,254 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 pcmpgtd %xmm6,%xmm9 pcmpgtd %xmm6,%xmm10 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 pcmpgtd %xmm6,%xmm11 movdqa K256_shaext-16(%rip),%xmm3 .byte 69,15,56,203,247 @@ -3068,10 +3066,10 @@ _shaext_shortcut: movl 280(%rsp),%edx - pshufd $27,%xmm12,%xmm12 - pshufd $27,%xmm13,%xmm13 - pshufd $27,%xmm14,%xmm14 - pshufd $27,%xmm15,%xmm15 + pshufd $0b00011011,%xmm12,%xmm12 + pshufd $0b00011011,%xmm13,%xmm13 + pshufd $0b00011011,%xmm14,%xmm14 + pshufd $0b00011011,%xmm15,%xmm15 movdqa %xmm12,%xmm5 movdqa %xmm13,%xmm6 @@ -3107,4648 +3105,6 @@ _shaext_shortcut: .Lepilogue_shaext: .byte 0xf3,0xc3 .size sha256_multi_block_shaext,.-sha256_multi_block_shaext -.type sha256_multi_block_avx,@function -.align 32 -sha256_multi_block_avx: -_avx_shortcut: - shrq $32,%rcx - cmpl $2,%edx - jb .Lavx - testl $32,%ecx - jnz _avx2_shortcut - jmp .Lavx -.align 32 -.Lavx: - movq %rsp,%rax - pushq %rbx - pushq %rbp - subq $288,%rsp - andq $-256,%rsp - movq %rax,272(%rsp) -.Lbody_avx: - leaq K256+128(%rip),%rbp - leaq 256(%rsp),%rbx - leaq 128(%rdi),%rdi - -.Loop_grande_avx: - movl %edx,280(%rsp) - xorl %edx,%edx - movq 0(%rsi),%r8 - movl 8(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,0(%rbx) - cmovleq %rbp,%r8 - movq 16(%rsi),%r9 - movl 24(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,4(%rbx) - cmovleq %rbp,%r9 - movq 32(%rsi),%r10 - movl 40(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,8(%rbx) - cmovleq %rbp,%r10 - movq 48(%rsi),%r11 - movl 56(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,12(%rbx) - cmovleq %rbp,%r11 - testl %edx,%edx - jz .Ldone_avx - - vmovdqu 0-128(%rdi),%xmm8 - leaq 128(%rsp),%rax - vmovdqu 32-128(%rdi),%xmm9 - vmovdqu 64-128(%rdi),%xmm10 - vmovdqu 96-128(%rdi),%xmm11 - vmovdqu 128-128(%rdi),%xmm12 - vmovdqu 160-128(%rdi),%xmm13 - vmovdqu 192-128(%rdi),%xmm14 - vmovdqu 224-128(%rdi),%xmm15 - vmovdqu .Lpbswap(%rip),%xmm6 - jmp .Loop_avx - -.align 32 -.Loop_avx: - vpxor %xmm9,%xmm10,%xmm4 - vmovd 0(%r8),%xmm5 - vmovd 0(%r9),%xmm0 - vpinsrd $1,0(%r10),%xmm5,%xmm5 - vpinsrd $1,0(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm12,%xmm7 - vpslld $26,%xmm12,%xmm2 - vmovdqu %xmm5,0-128(%rax) - vpaddd %xmm15,%xmm5,%xmm5 - - vpsrld $11,%xmm12,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm12,%xmm2 - vpaddd -128(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm12,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm12,%xmm2 - vpandn %xmm14,%xmm12,%xmm0 - vpand %xmm13,%xmm12,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm8,%xmm15 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm8,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm8,%xmm9,%xmm3 - - vpxor %xmm1,%xmm15,%xmm15 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm8,%xmm1 - - vpslld $19,%xmm8,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm15,%xmm7 - - vpsrld $22,%xmm8,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm8,%xmm2 - vpxor %xmm4,%xmm9,%xmm15 - vpaddd %xmm5,%xmm11,%xmm11 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm15,%xmm15 - vpaddd %xmm7,%xmm15,%xmm15 - vmovd 4(%r8),%xmm5 - vmovd 4(%r9),%xmm0 - vpinsrd $1,4(%r10),%xmm5,%xmm5 - vpinsrd $1,4(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm11,%xmm7 - vpslld $26,%xmm11,%xmm2 - vmovdqu %xmm5,16-128(%rax) - vpaddd %xmm14,%xmm5,%xmm5 - - vpsrld $11,%xmm11,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm11,%xmm2 - vpaddd -96(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm11,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm11,%xmm2 - vpandn %xmm13,%xmm11,%xmm0 - vpand %xmm12,%xmm11,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm15,%xmm14 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm15,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm15,%xmm8,%xmm4 - - vpxor %xmm1,%xmm14,%xmm14 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm15,%xmm1 - - vpslld $19,%xmm15,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm14,%xmm7 - - vpsrld $22,%xmm15,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm15,%xmm2 - vpxor %xmm3,%xmm8,%xmm14 - vpaddd %xmm5,%xmm10,%xmm10 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm14,%xmm14 - vpaddd %xmm7,%xmm14,%xmm14 - vmovd 8(%r8),%xmm5 - vmovd 8(%r9),%xmm0 - vpinsrd $1,8(%r10),%xmm5,%xmm5 - vpinsrd $1,8(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm10,%xmm7 - vpslld $26,%xmm10,%xmm2 - vmovdqu %xmm5,32-128(%rax) - vpaddd %xmm13,%xmm5,%xmm5 - - vpsrld $11,%xmm10,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm10,%xmm2 - vpaddd -64(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm10,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm10,%xmm2 - vpandn %xmm12,%xmm10,%xmm0 - vpand %xmm11,%xmm10,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm14,%xmm13 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm14,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm14,%xmm15,%xmm3 - - vpxor %xmm1,%xmm13,%xmm13 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm14,%xmm1 - - vpslld $19,%xmm14,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm13,%xmm7 - - vpsrld $22,%xmm14,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm14,%xmm2 - vpxor %xmm4,%xmm15,%xmm13 - vpaddd %xmm5,%xmm9,%xmm9 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm13,%xmm13 - vpaddd %xmm7,%xmm13,%xmm13 - vmovd 12(%r8),%xmm5 - vmovd 12(%r9),%xmm0 - vpinsrd $1,12(%r10),%xmm5,%xmm5 - vpinsrd $1,12(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm9,%xmm7 - vpslld $26,%xmm9,%xmm2 - vmovdqu %xmm5,48-128(%rax) - vpaddd %xmm12,%xmm5,%xmm5 - - vpsrld $11,%xmm9,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm9,%xmm2 - vpaddd -32(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm9,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm9,%xmm2 - vpandn %xmm11,%xmm9,%xmm0 - vpand %xmm10,%xmm9,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm13,%xmm12 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm13,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm13,%xmm14,%xmm4 - - vpxor %xmm1,%xmm12,%xmm12 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm13,%xmm1 - - vpslld $19,%xmm13,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm12,%xmm7 - - vpsrld $22,%xmm13,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm13,%xmm2 - vpxor %xmm3,%xmm14,%xmm12 - vpaddd %xmm5,%xmm8,%xmm8 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm12,%xmm12 - vpaddd %xmm7,%xmm12,%xmm12 - vmovd 16(%r8),%xmm5 - vmovd 16(%r9),%xmm0 - vpinsrd $1,16(%r10),%xmm5,%xmm5 - vpinsrd $1,16(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm8,%xmm7 - vpslld $26,%xmm8,%xmm2 - vmovdqu %xmm5,64-128(%rax) - vpaddd %xmm11,%xmm5,%xmm5 - - vpsrld $11,%xmm8,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm8,%xmm2 - vpaddd 0(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm8,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm8,%xmm2 - vpandn %xmm10,%xmm8,%xmm0 - vpand %xmm9,%xmm8,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm12,%xmm11 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm12,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm12,%xmm13,%xmm3 - - vpxor %xmm1,%xmm11,%xmm11 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm12,%xmm1 - - vpslld $19,%xmm12,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm11,%xmm7 - - vpsrld $22,%xmm12,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm12,%xmm2 - vpxor %xmm4,%xmm13,%xmm11 - vpaddd %xmm5,%xmm15,%xmm15 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm11,%xmm11 - vpaddd %xmm7,%xmm11,%xmm11 - vmovd 20(%r8),%xmm5 - vmovd 20(%r9),%xmm0 - vpinsrd $1,20(%r10),%xmm5,%xmm5 - vpinsrd $1,20(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm15,%xmm7 - vpslld $26,%xmm15,%xmm2 - vmovdqu %xmm5,80-128(%rax) - vpaddd %xmm10,%xmm5,%xmm5 - - vpsrld $11,%xmm15,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm15,%xmm2 - vpaddd 32(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm15,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm15,%xmm2 - vpandn %xmm9,%xmm15,%xmm0 - vpand %xmm8,%xmm15,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm11,%xmm10 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm11,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm11,%xmm12,%xmm4 - - vpxor %xmm1,%xmm10,%xmm10 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm11,%xmm1 - - vpslld $19,%xmm11,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm10,%xmm7 - - vpsrld $22,%xmm11,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm11,%xmm2 - vpxor %xmm3,%xmm12,%xmm10 - vpaddd %xmm5,%xmm14,%xmm14 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm10,%xmm10 - vpaddd %xmm7,%xmm10,%xmm10 - vmovd 24(%r8),%xmm5 - vmovd 24(%r9),%xmm0 - vpinsrd $1,24(%r10),%xmm5,%xmm5 - vpinsrd $1,24(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm14,%xmm7 - vpslld $26,%xmm14,%xmm2 - vmovdqu %xmm5,96-128(%rax) - vpaddd %xmm9,%xmm5,%xmm5 - - vpsrld $11,%xmm14,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm14,%xmm2 - vpaddd 64(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm14,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm14,%xmm2 - vpandn %xmm8,%xmm14,%xmm0 - vpand %xmm15,%xmm14,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm10,%xmm9 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm10,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm10,%xmm11,%xmm3 - - vpxor %xmm1,%xmm9,%xmm9 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm10,%xmm1 - - vpslld $19,%xmm10,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm9,%xmm7 - - vpsrld $22,%xmm10,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm10,%xmm2 - vpxor %xmm4,%xmm11,%xmm9 - vpaddd %xmm5,%xmm13,%xmm13 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm9,%xmm9 - vpaddd %xmm7,%xmm9,%xmm9 - vmovd 28(%r8),%xmm5 - vmovd 28(%r9),%xmm0 - vpinsrd $1,28(%r10),%xmm5,%xmm5 - vpinsrd $1,28(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm13,%xmm7 - vpslld $26,%xmm13,%xmm2 - vmovdqu %xmm5,112-128(%rax) - vpaddd %xmm8,%xmm5,%xmm5 - - vpsrld $11,%xmm13,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm13,%xmm2 - vpaddd 96(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm13,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm13,%xmm2 - vpandn %xmm15,%xmm13,%xmm0 - vpand %xmm14,%xmm13,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm9,%xmm8 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm9,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm9,%xmm10,%xmm4 - - vpxor %xmm1,%xmm8,%xmm8 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm9,%xmm1 - - vpslld $19,%xmm9,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm8,%xmm7 - - vpsrld $22,%xmm9,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm9,%xmm2 - vpxor %xmm3,%xmm10,%xmm8 - vpaddd %xmm5,%xmm12,%xmm12 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm8,%xmm8 - vpaddd %xmm7,%xmm8,%xmm8 - addq $256,%rbp - vmovd 32(%r8),%xmm5 - vmovd 32(%r9),%xmm0 - vpinsrd $1,32(%r10),%xmm5,%xmm5 - vpinsrd $1,32(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm12,%xmm7 - vpslld $26,%xmm12,%xmm2 - vmovdqu %xmm5,128-128(%rax) - vpaddd %xmm15,%xmm5,%xmm5 - - vpsrld $11,%xmm12,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm12,%xmm2 - vpaddd -128(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm12,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm12,%xmm2 - vpandn %xmm14,%xmm12,%xmm0 - vpand %xmm13,%xmm12,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm8,%xmm15 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm8,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm8,%xmm9,%xmm3 - - vpxor %xmm1,%xmm15,%xmm15 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm8,%xmm1 - - vpslld $19,%xmm8,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm15,%xmm7 - - vpsrld $22,%xmm8,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm8,%xmm2 - vpxor %xmm4,%xmm9,%xmm15 - vpaddd %xmm5,%xmm11,%xmm11 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm15,%xmm15 - vpaddd %xmm7,%xmm15,%xmm15 - vmovd 36(%r8),%xmm5 - vmovd 36(%r9),%xmm0 - vpinsrd $1,36(%r10),%xmm5,%xmm5 - vpinsrd $1,36(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm11,%xmm7 - vpslld $26,%xmm11,%xmm2 - vmovdqu %xmm5,144-128(%rax) - vpaddd %xmm14,%xmm5,%xmm5 - - vpsrld $11,%xmm11,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm11,%xmm2 - vpaddd -96(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm11,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm11,%xmm2 - vpandn %xmm13,%xmm11,%xmm0 - vpand %xmm12,%xmm11,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm15,%xmm14 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm15,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm15,%xmm8,%xmm4 - - vpxor %xmm1,%xmm14,%xmm14 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm15,%xmm1 - - vpslld $19,%xmm15,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm14,%xmm7 - - vpsrld $22,%xmm15,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm15,%xmm2 - vpxor %xmm3,%xmm8,%xmm14 - vpaddd %xmm5,%xmm10,%xmm10 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm14,%xmm14 - vpaddd %xmm7,%xmm14,%xmm14 - vmovd 40(%r8),%xmm5 - vmovd 40(%r9),%xmm0 - vpinsrd $1,40(%r10),%xmm5,%xmm5 - vpinsrd $1,40(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm10,%xmm7 - vpslld $26,%xmm10,%xmm2 - vmovdqu %xmm5,160-128(%rax) - vpaddd %xmm13,%xmm5,%xmm5 - - vpsrld $11,%xmm10,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm10,%xmm2 - vpaddd -64(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm10,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm10,%xmm2 - vpandn %xmm12,%xmm10,%xmm0 - vpand %xmm11,%xmm10,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm14,%xmm13 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm14,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm14,%xmm15,%xmm3 - - vpxor %xmm1,%xmm13,%xmm13 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm14,%xmm1 - - vpslld $19,%xmm14,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm13,%xmm7 - - vpsrld $22,%xmm14,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm14,%xmm2 - vpxor %xmm4,%xmm15,%xmm13 - vpaddd %xmm5,%xmm9,%xmm9 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm13,%xmm13 - vpaddd %xmm7,%xmm13,%xmm13 - vmovd 44(%r8),%xmm5 - vmovd 44(%r9),%xmm0 - vpinsrd $1,44(%r10),%xmm5,%xmm5 - vpinsrd $1,44(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm9,%xmm7 - vpslld $26,%xmm9,%xmm2 - vmovdqu %xmm5,176-128(%rax) - vpaddd %xmm12,%xmm5,%xmm5 - - vpsrld $11,%xmm9,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm9,%xmm2 - vpaddd -32(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm9,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm9,%xmm2 - vpandn %xmm11,%xmm9,%xmm0 - vpand %xmm10,%xmm9,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm13,%xmm12 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm13,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm13,%xmm14,%xmm4 - - vpxor %xmm1,%xmm12,%xmm12 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm13,%xmm1 - - vpslld $19,%xmm13,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm12,%xmm7 - - vpsrld $22,%xmm13,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm13,%xmm2 - vpxor %xmm3,%xmm14,%xmm12 - vpaddd %xmm5,%xmm8,%xmm8 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm12,%xmm12 - vpaddd %xmm7,%xmm12,%xmm12 - vmovd 48(%r8),%xmm5 - vmovd 48(%r9),%xmm0 - vpinsrd $1,48(%r10),%xmm5,%xmm5 - vpinsrd $1,48(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm8,%xmm7 - vpslld $26,%xmm8,%xmm2 - vmovdqu %xmm5,192-128(%rax) - vpaddd %xmm11,%xmm5,%xmm5 - - vpsrld $11,%xmm8,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm8,%xmm2 - vpaddd 0(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm8,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm8,%xmm2 - vpandn %xmm10,%xmm8,%xmm0 - vpand %xmm9,%xmm8,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm12,%xmm11 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm12,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm12,%xmm13,%xmm3 - - vpxor %xmm1,%xmm11,%xmm11 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm12,%xmm1 - - vpslld $19,%xmm12,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm11,%xmm7 - - vpsrld $22,%xmm12,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm12,%xmm2 - vpxor %xmm4,%xmm13,%xmm11 - vpaddd %xmm5,%xmm15,%xmm15 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm11,%xmm11 - vpaddd %xmm7,%xmm11,%xmm11 - vmovd 52(%r8),%xmm5 - vmovd 52(%r9),%xmm0 - vpinsrd $1,52(%r10),%xmm5,%xmm5 - vpinsrd $1,52(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm15,%xmm7 - vpslld $26,%xmm15,%xmm2 - vmovdqu %xmm5,208-128(%rax) - vpaddd %xmm10,%xmm5,%xmm5 - - vpsrld $11,%xmm15,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm15,%xmm2 - vpaddd 32(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm15,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm15,%xmm2 - vpandn %xmm9,%xmm15,%xmm0 - vpand %xmm8,%xmm15,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm11,%xmm10 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm11,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm11,%xmm12,%xmm4 - - vpxor %xmm1,%xmm10,%xmm10 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm11,%xmm1 - - vpslld $19,%xmm11,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm10,%xmm7 - - vpsrld $22,%xmm11,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm11,%xmm2 - vpxor %xmm3,%xmm12,%xmm10 - vpaddd %xmm5,%xmm14,%xmm14 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm10,%xmm10 - vpaddd %xmm7,%xmm10,%xmm10 - vmovd 56(%r8),%xmm5 - vmovd 56(%r9),%xmm0 - vpinsrd $1,56(%r10),%xmm5,%xmm5 - vpinsrd $1,56(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm14,%xmm7 - vpslld $26,%xmm14,%xmm2 - vmovdqu %xmm5,224-128(%rax) - vpaddd %xmm9,%xmm5,%xmm5 - - vpsrld $11,%xmm14,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm14,%xmm2 - vpaddd 64(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm14,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm14,%xmm2 - vpandn %xmm8,%xmm14,%xmm0 - vpand %xmm15,%xmm14,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm10,%xmm9 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm10,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm10,%xmm11,%xmm3 - - vpxor %xmm1,%xmm9,%xmm9 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm10,%xmm1 - - vpslld $19,%xmm10,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm9,%xmm7 - - vpsrld $22,%xmm10,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm10,%xmm2 - vpxor %xmm4,%xmm11,%xmm9 - vpaddd %xmm5,%xmm13,%xmm13 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm9,%xmm9 - vpaddd %xmm7,%xmm9,%xmm9 - vmovd 60(%r8),%xmm5 - leaq 64(%r8),%r8 - vmovd 60(%r9),%xmm0 - leaq 64(%r9),%r9 - vpinsrd $1,60(%r10),%xmm5,%xmm5 - leaq 64(%r10),%r10 - vpinsrd $1,60(%r11),%xmm0,%xmm0 - leaq 64(%r11),%r11 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm13,%xmm7 - vpslld $26,%xmm13,%xmm2 - vmovdqu %xmm5,240-128(%rax) - vpaddd %xmm8,%xmm5,%xmm5 - - vpsrld $11,%xmm13,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm13,%xmm2 - vpaddd 96(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm13,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - prefetcht0 63(%r8) - vpslld $7,%xmm13,%xmm2 - vpandn %xmm15,%xmm13,%xmm0 - vpand %xmm14,%xmm13,%xmm4 - prefetcht0 63(%r9) - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm9,%xmm8 - vpxor %xmm2,%xmm7,%xmm7 - prefetcht0 63(%r10) - vpslld $30,%xmm9,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm9,%xmm10,%xmm4 - prefetcht0 63(%r11) - vpxor %xmm1,%xmm8,%xmm8 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm9,%xmm1 - - vpslld $19,%xmm9,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm8,%xmm7 - - vpsrld $22,%xmm9,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm9,%xmm2 - vpxor %xmm3,%xmm10,%xmm8 - vpaddd %xmm5,%xmm12,%xmm12 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm8,%xmm8 - vpaddd %xmm7,%xmm8,%xmm8 - addq $256,%rbp - vmovdqu 0-128(%rax),%xmm5 - movl $3,%ecx - jmp .Loop_16_xx_avx -.align 32 -.Loop_16_xx_avx: - vmovdqu 16-128(%rax),%xmm6 - vpaddd 144-128(%rax),%xmm5,%xmm5 - - vpsrld $3,%xmm6,%xmm7 - vpsrld $7,%xmm6,%xmm1 - vpslld $25,%xmm6,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm6,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm6,%xmm2 - vmovdqu 224-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm5,%xmm5 - vpxor %xmm1,%xmm3,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm5,%xmm5 - vpsrld $6,%xmm12,%xmm7 - vpslld $26,%xmm12,%xmm2 - vmovdqu %xmm5,0-128(%rax) - vpaddd %xmm15,%xmm5,%xmm5 - - vpsrld $11,%xmm12,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm12,%xmm2 - vpaddd -128(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm12,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm12,%xmm2 - vpandn %xmm14,%xmm12,%xmm0 - vpand %xmm13,%xmm12,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm8,%xmm15 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm8,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm8,%xmm9,%xmm3 - - vpxor %xmm1,%xmm15,%xmm15 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm8,%xmm1 - - vpslld $19,%xmm8,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm15,%xmm7 - - vpsrld $22,%xmm8,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm8,%xmm2 - vpxor %xmm4,%xmm9,%xmm15 - vpaddd %xmm5,%xmm11,%xmm11 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm15,%xmm15 - vpaddd %xmm7,%xmm15,%xmm15 - vmovdqu 32-128(%rax),%xmm5 - vpaddd 160-128(%rax),%xmm6,%xmm6 - - vpsrld $3,%xmm5,%xmm7 - vpsrld $7,%xmm5,%xmm1 - vpslld $25,%xmm5,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm5,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm5,%xmm2 - vmovdqu 240-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm6,%xmm6 - vpsrld $6,%xmm11,%xmm7 - vpslld $26,%xmm11,%xmm2 - vmovdqu %xmm6,16-128(%rax) - vpaddd %xmm14,%xmm6,%xmm6 - - vpsrld $11,%xmm11,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm11,%xmm2 - vpaddd -96(%rbp),%xmm6,%xmm6 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm11,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm11,%xmm2 - vpandn %xmm13,%xmm11,%xmm0 - vpand %xmm12,%xmm11,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm15,%xmm14 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm15,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm15,%xmm8,%xmm4 - - vpxor %xmm1,%xmm14,%xmm14 - vpaddd %xmm7,%xmm6,%xmm6 - - vpsrld $13,%xmm15,%xmm1 - - vpslld $19,%xmm15,%xmm2 - vpaddd %xmm0,%xmm6,%xmm6 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm14,%xmm7 - - vpsrld $22,%xmm15,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm15,%xmm2 - vpxor %xmm3,%xmm8,%xmm14 - vpaddd %xmm6,%xmm10,%xmm10 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm6,%xmm14,%xmm14 - vpaddd %xmm7,%xmm14,%xmm14 - vmovdqu 48-128(%rax),%xmm6 - vpaddd 176-128(%rax),%xmm5,%xmm5 - - vpsrld $3,%xmm6,%xmm7 - vpsrld $7,%xmm6,%xmm1 - vpslld $25,%xmm6,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm6,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm6,%xmm2 - vmovdqu 0-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm5,%xmm5 - vpxor %xmm1,%xmm3,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm5,%xmm5 - vpsrld $6,%xmm10,%xmm7 - vpslld $26,%xmm10,%xmm2 - vmovdqu %xmm5,32-128(%rax) - vpaddd %xmm13,%xmm5,%xmm5 - - vpsrld $11,%xmm10,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm10,%xmm2 - vpaddd -64(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm10,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm10,%xmm2 - vpandn %xmm12,%xmm10,%xmm0 - vpand %xmm11,%xmm10,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm14,%xmm13 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm14,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm14,%xmm15,%xmm3 - - vpxor %xmm1,%xmm13,%xmm13 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm14,%xmm1 - - vpslld $19,%xmm14,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm13,%xmm7 - - vpsrld $22,%xmm14,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm14,%xmm2 - vpxor %xmm4,%xmm15,%xmm13 - vpaddd %xmm5,%xmm9,%xmm9 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm13,%xmm13 - vpaddd %xmm7,%xmm13,%xmm13 - vmovdqu 64-128(%rax),%xmm5 - vpaddd 192-128(%rax),%xmm6,%xmm6 - - vpsrld $3,%xmm5,%xmm7 - vpsrld $7,%xmm5,%xmm1 - vpslld $25,%xmm5,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm5,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm5,%xmm2 - vmovdqu 16-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm6,%xmm6 - vpsrld $6,%xmm9,%xmm7 - vpslld $26,%xmm9,%xmm2 - vmovdqu %xmm6,48-128(%rax) - vpaddd %xmm12,%xmm6,%xmm6 - - vpsrld $11,%xmm9,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm9,%xmm2 - vpaddd -32(%rbp),%xmm6,%xmm6 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm9,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm9,%xmm2 - vpandn %xmm11,%xmm9,%xmm0 - vpand %xmm10,%xmm9,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm13,%xmm12 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm13,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm13,%xmm14,%xmm4 - - vpxor %xmm1,%xmm12,%xmm12 - vpaddd %xmm7,%xmm6,%xmm6 - - vpsrld $13,%xmm13,%xmm1 - - vpslld $19,%xmm13,%xmm2 - vpaddd %xmm0,%xmm6,%xmm6 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm12,%xmm7 - - vpsrld $22,%xmm13,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm13,%xmm2 - vpxor %xmm3,%xmm14,%xmm12 - vpaddd %xmm6,%xmm8,%xmm8 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm6,%xmm12,%xmm12 - vpaddd %xmm7,%xmm12,%xmm12 - vmovdqu 80-128(%rax),%xmm6 - vpaddd 208-128(%rax),%xmm5,%xmm5 - - vpsrld $3,%xmm6,%xmm7 - vpsrld $7,%xmm6,%xmm1 - vpslld $25,%xmm6,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm6,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm6,%xmm2 - vmovdqu 32-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm5,%xmm5 - vpxor %xmm1,%xmm3,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm5,%xmm5 - vpsrld $6,%xmm8,%xmm7 - vpslld $26,%xmm8,%xmm2 - vmovdqu %xmm5,64-128(%rax) - vpaddd %xmm11,%xmm5,%xmm5 - - vpsrld $11,%xmm8,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm8,%xmm2 - vpaddd 0(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm8,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm8,%xmm2 - vpandn %xmm10,%xmm8,%xmm0 - vpand %xmm9,%xmm8,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm12,%xmm11 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm12,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm12,%xmm13,%xmm3 - - vpxor %xmm1,%xmm11,%xmm11 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm12,%xmm1 - - vpslld $19,%xmm12,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm11,%xmm7 - - vpsrld $22,%xmm12,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm12,%xmm2 - vpxor %xmm4,%xmm13,%xmm11 - vpaddd %xmm5,%xmm15,%xmm15 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm11,%xmm11 - vpaddd %xmm7,%xmm11,%xmm11 - vmovdqu 96-128(%rax),%xmm5 - vpaddd 224-128(%rax),%xmm6,%xmm6 - - vpsrld $3,%xmm5,%xmm7 - vpsrld $7,%xmm5,%xmm1 - vpslld $25,%xmm5,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm5,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm5,%xmm2 - vmovdqu 48-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm6,%xmm6 - vpsrld $6,%xmm15,%xmm7 - vpslld $26,%xmm15,%xmm2 - vmovdqu %xmm6,80-128(%rax) - vpaddd %xmm10,%xmm6,%xmm6 - - vpsrld $11,%xmm15,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm15,%xmm2 - vpaddd 32(%rbp),%xmm6,%xmm6 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm15,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm15,%xmm2 - vpandn %xmm9,%xmm15,%xmm0 - vpand %xmm8,%xmm15,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm11,%xmm10 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm11,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm11,%xmm12,%xmm4 - - vpxor %xmm1,%xmm10,%xmm10 - vpaddd %xmm7,%xmm6,%xmm6 - - vpsrld $13,%xmm11,%xmm1 - - vpslld $19,%xmm11,%xmm2 - vpaddd %xmm0,%xmm6,%xmm6 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm10,%xmm7 - - vpsrld $22,%xmm11,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm11,%xmm2 - vpxor %xmm3,%xmm12,%xmm10 - vpaddd %xmm6,%xmm14,%xmm14 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm6,%xmm10,%xmm10 - vpaddd %xmm7,%xmm10,%xmm10 - vmovdqu 112-128(%rax),%xmm6 - vpaddd 240-128(%rax),%xmm5,%xmm5 - - vpsrld $3,%xmm6,%xmm7 - vpsrld $7,%xmm6,%xmm1 - vpslld $25,%xmm6,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm6,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm6,%xmm2 - vmovdqu 64-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm5,%xmm5 - vpxor %xmm1,%xmm3,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm5,%xmm5 - vpsrld $6,%xmm14,%xmm7 - vpslld $26,%xmm14,%xmm2 - vmovdqu %xmm5,96-128(%rax) - vpaddd %xmm9,%xmm5,%xmm5 - - vpsrld $11,%xmm14,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm14,%xmm2 - vpaddd 64(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm14,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm14,%xmm2 - vpandn %xmm8,%xmm14,%xmm0 - vpand %xmm15,%xmm14,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm10,%xmm9 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm10,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm10,%xmm11,%xmm3 - - vpxor %xmm1,%xmm9,%xmm9 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm10,%xmm1 - - vpslld $19,%xmm10,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm9,%xmm7 - - vpsrld $22,%xmm10,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm10,%xmm2 - vpxor %xmm4,%xmm11,%xmm9 - vpaddd %xmm5,%xmm13,%xmm13 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm9,%xmm9 - vpaddd %xmm7,%xmm9,%xmm9 - vmovdqu 128-128(%rax),%xmm5 - vpaddd 0-128(%rax),%xmm6,%xmm6 - - vpsrld $3,%xmm5,%xmm7 - vpsrld $7,%xmm5,%xmm1 - vpslld $25,%xmm5,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm5,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm5,%xmm2 - vmovdqu 80-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm6,%xmm6 - vpsrld $6,%xmm13,%xmm7 - vpslld $26,%xmm13,%xmm2 - vmovdqu %xmm6,112-128(%rax) - vpaddd %xmm8,%xmm6,%xmm6 - - vpsrld $11,%xmm13,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm13,%xmm2 - vpaddd 96(%rbp),%xmm6,%xmm6 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm13,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm13,%xmm2 - vpandn %xmm15,%xmm13,%xmm0 - vpand %xmm14,%xmm13,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm9,%xmm8 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm9,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm9,%xmm10,%xmm4 - - vpxor %xmm1,%xmm8,%xmm8 - vpaddd %xmm7,%xmm6,%xmm6 - - vpsrld $13,%xmm9,%xmm1 - - vpslld $19,%xmm9,%xmm2 - vpaddd %xmm0,%xmm6,%xmm6 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm8,%xmm7 - - vpsrld $22,%xmm9,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm9,%xmm2 - vpxor %xmm3,%xmm10,%xmm8 - vpaddd %xmm6,%xmm12,%xmm12 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm6,%xmm8,%xmm8 - vpaddd %xmm7,%xmm8,%xmm8 - addq $256,%rbp - vmovdqu 144-128(%rax),%xmm6 - vpaddd 16-128(%rax),%xmm5,%xmm5 - - vpsrld $3,%xmm6,%xmm7 - vpsrld $7,%xmm6,%xmm1 - vpslld $25,%xmm6,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm6,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm6,%xmm2 - vmovdqu 96-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm5,%xmm5 - vpxor %xmm1,%xmm3,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm5,%xmm5 - vpsrld $6,%xmm12,%xmm7 - vpslld $26,%xmm12,%xmm2 - vmovdqu %xmm5,128-128(%rax) - vpaddd %xmm15,%xmm5,%xmm5 - - vpsrld $11,%xmm12,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm12,%xmm2 - vpaddd -128(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm12,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm12,%xmm2 - vpandn %xmm14,%xmm12,%xmm0 - vpand %xmm13,%xmm12,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm8,%xmm15 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm8,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm8,%xmm9,%xmm3 - - vpxor %xmm1,%xmm15,%xmm15 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm8,%xmm1 - - vpslld $19,%xmm8,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm15,%xmm7 - - vpsrld $22,%xmm8,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm8,%xmm2 - vpxor %xmm4,%xmm9,%xmm15 - vpaddd %xmm5,%xmm11,%xmm11 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm15,%xmm15 - vpaddd %xmm7,%xmm15,%xmm15 - vmovdqu 160-128(%rax),%xmm5 - vpaddd 32-128(%rax),%xmm6,%xmm6 - - vpsrld $3,%xmm5,%xmm7 - vpsrld $7,%xmm5,%xmm1 - vpslld $25,%xmm5,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm5,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm5,%xmm2 - vmovdqu 112-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm6,%xmm6 - vpsrld $6,%xmm11,%xmm7 - vpslld $26,%xmm11,%xmm2 - vmovdqu %xmm6,144-128(%rax) - vpaddd %xmm14,%xmm6,%xmm6 - - vpsrld $11,%xmm11,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm11,%xmm2 - vpaddd -96(%rbp),%xmm6,%xmm6 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm11,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm11,%xmm2 - vpandn %xmm13,%xmm11,%xmm0 - vpand %xmm12,%xmm11,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm15,%xmm14 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm15,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm15,%xmm8,%xmm4 - - vpxor %xmm1,%xmm14,%xmm14 - vpaddd %xmm7,%xmm6,%xmm6 - - vpsrld $13,%xmm15,%xmm1 - - vpslld $19,%xmm15,%xmm2 - vpaddd %xmm0,%xmm6,%xmm6 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm14,%xmm7 - - vpsrld $22,%xmm15,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm15,%xmm2 - vpxor %xmm3,%xmm8,%xmm14 - vpaddd %xmm6,%xmm10,%xmm10 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm6,%xmm14,%xmm14 - vpaddd %xmm7,%xmm14,%xmm14 - vmovdqu 176-128(%rax),%xmm6 - vpaddd 48-128(%rax),%xmm5,%xmm5 - - vpsrld $3,%xmm6,%xmm7 - vpsrld $7,%xmm6,%xmm1 - vpslld $25,%xmm6,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm6,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm6,%xmm2 - vmovdqu 128-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm5,%xmm5 - vpxor %xmm1,%xmm3,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm5,%xmm5 - vpsrld $6,%xmm10,%xmm7 - vpslld $26,%xmm10,%xmm2 - vmovdqu %xmm5,160-128(%rax) - vpaddd %xmm13,%xmm5,%xmm5 - - vpsrld $11,%xmm10,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm10,%xmm2 - vpaddd -64(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm10,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm10,%xmm2 - vpandn %xmm12,%xmm10,%xmm0 - vpand %xmm11,%xmm10,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm14,%xmm13 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm14,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm14,%xmm15,%xmm3 - - vpxor %xmm1,%xmm13,%xmm13 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm14,%xmm1 - - vpslld $19,%xmm14,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm13,%xmm7 - - vpsrld $22,%xmm14,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm14,%xmm2 - vpxor %xmm4,%xmm15,%xmm13 - vpaddd %xmm5,%xmm9,%xmm9 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm13,%xmm13 - vpaddd %xmm7,%xmm13,%xmm13 - vmovdqu 192-128(%rax),%xmm5 - vpaddd 64-128(%rax),%xmm6,%xmm6 - - vpsrld $3,%xmm5,%xmm7 - vpsrld $7,%xmm5,%xmm1 - vpslld $25,%xmm5,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm5,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm5,%xmm2 - vmovdqu 144-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm6,%xmm6 - vpsrld $6,%xmm9,%xmm7 - vpslld $26,%xmm9,%xmm2 - vmovdqu %xmm6,176-128(%rax) - vpaddd %xmm12,%xmm6,%xmm6 - - vpsrld $11,%xmm9,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm9,%xmm2 - vpaddd -32(%rbp),%xmm6,%xmm6 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm9,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm9,%xmm2 - vpandn %xmm11,%xmm9,%xmm0 - vpand %xmm10,%xmm9,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm13,%xmm12 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm13,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm13,%xmm14,%xmm4 - - vpxor %xmm1,%xmm12,%xmm12 - vpaddd %xmm7,%xmm6,%xmm6 - - vpsrld $13,%xmm13,%xmm1 - - vpslld $19,%xmm13,%xmm2 - vpaddd %xmm0,%xmm6,%xmm6 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm12,%xmm7 - - vpsrld $22,%xmm13,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm13,%xmm2 - vpxor %xmm3,%xmm14,%xmm12 - vpaddd %xmm6,%xmm8,%xmm8 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm6,%xmm12,%xmm12 - vpaddd %xmm7,%xmm12,%xmm12 - vmovdqu 208-128(%rax),%xmm6 - vpaddd 80-128(%rax),%xmm5,%xmm5 - - vpsrld $3,%xmm6,%xmm7 - vpsrld $7,%xmm6,%xmm1 - vpslld $25,%xmm6,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm6,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm6,%xmm2 - vmovdqu 160-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm5,%xmm5 - vpxor %xmm1,%xmm3,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm5,%xmm5 - vpsrld $6,%xmm8,%xmm7 - vpslld $26,%xmm8,%xmm2 - vmovdqu %xmm5,192-128(%rax) - vpaddd %xmm11,%xmm5,%xmm5 - - vpsrld $11,%xmm8,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm8,%xmm2 - vpaddd 0(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm8,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm8,%xmm2 - vpandn %xmm10,%xmm8,%xmm0 - vpand %xmm9,%xmm8,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm12,%xmm11 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm12,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm12,%xmm13,%xmm3 - - vpxor %xmm1,%xmm11,%xmm11 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm12,%xmm1 - - vpslld $19,%xmm12,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm11,%xmm7 - - vpsrld $22,%xmm12,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm12,%xmm2 - vpxor %xmm4,%xmm13,%xmm11 - vpaddd %xmm5,%xmm15,%xmm15 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm11,%xmm11 - vpaddd %xmm7,%xmm11,%xmm11 - vmovdqu 224-128(%rax),%xmm5 - vpaddd 96-128(%rax),%xmm6,%xmm6 - - vpsrld $3,%xmm5,%xmm7 - vpsrld $7,%xmm5,%xmm1 - vpslld $25,%xmm5,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm5,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm5,%xmm2 - vmovdqu 176-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm6,%xmm6 - vpsrld $6,%xmm15,%xmm7 - vpslld $26,%xmm15,%xmm2 - vmovdqu %xmm6,208-128(%rax) - vpaddd %xmm10,%xmm6,%xmm6 - - vpsrld $11,%xmm15,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm15,%xmm2 - vpaddd 32(%rbp),%xmm6,%xmm6 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm15,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm15,%xmm2 - vpandn %xmm9,%xmm15,%xmm0 - vpand %xmm8,%xmm15,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm11,%xmm10 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm11,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm11,%xmm12,%xmm4 - - vpxor %xmm1,%xmm10,%xmm10 - vpaddd %xmm7,%xmm6,%xmm6 - - vpsrld $13,%xmm11,%xmm1 - - vpslld $19,%xmm11,%xmm2 - vpaddd %xmm0,%xmm6,%xmm6 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm10,%xmm7 - - vpsrld $22,%xmm11,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm11,%xmm2 - vpxor %xmm3,%xmm12,%xmm10 - vpaddd %xmm6,%xmm14,%xmm14 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm6,%xmm10,%xmm10 - vpaddd %xmm7,%xmm10,%xmm10 - vmovdqu 240-128(%rax),%xmm6 - vpaddd 112-128(%rax),%xmm5,%xmm5 - - vpsrld $3,%xmm6,%xmm7 - vpsrld $7,%xmm6,%xmm1 - vpslld $25,%xmm6,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm6,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm6,%xmm2 - vmovdqu 192-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm5,%xmm5 - vpxor %xmm1,%xmm3,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm5,%xmm5 - vpsrld $6,%xmm14,%xmm7 - vpslld $26,%xmm14,%xmm2 - vmovdqu %xmm5,224-128(%rax) - vpaddd %xmm9,%xmm5,%xmm5 - - vpsrld $11,%xmm14,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm14,%xmm2 - vpaddd 64(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm14,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm14,%xmm2 - vpandn %xmm8,%xmm14,%xmm0 - vpand %xmm15,%xmm14,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm10,%xmm9 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm10,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm10,%xmm11,%xmm3 - - vpxor %xmm1,%xmm9,%xmm9 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm10,%xmm1 - - vpslld $19,%xmm10,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm9,%xmm7 - - vpsrld $22,%xmm10,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm10,%xmm2 - vpxor %xmm4,%xmm11,%xmm9 - vpaddd %xmm5,%xmm13,%xmm13 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm9,%xmm9 - vpaddd %xmm7,%xmm9,%xmm9 - vmovdqu 0-128(%rax),%xmm5 - vpaddd 128-128(%rax),%xmm6,%xmm6 - - vpsrld $3,%xmm5,%xmm7 - vpsrld $7,%xmm5,%xmm1 - vpslld $25,%xmm5,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm5,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm5,%xmm2 - vmovdqu 208-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm6,%xmm6 - vpsrld $6,%xmm13,%xmm7 - vpslld $26,%xmm13,%xmm2 - vmovdqu %xmm6,240-128(%rax) - vpaddd %xmm8,%xmm6,%xmm6 - - vpsrld $11,%xmm13,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm13,%xmm2 - vpaddd 96(%rbp),%xmm6,%xmm6 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm13,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm13,%xmm2 - vpandn %xmm15,%xmm13,%xmm0 - vpand %xmm14,%xmm13,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm9,%xmm8 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm9,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm9,%xmm10,%xmm4 - - vpxor %xmm1,%xmm8,%xmm8 - vpaddd %xmm7,%xmm6,%xmm6 - - vpsrld $13,%xmm9,%xmm1 - - vpslld $19,%xmm9,%xmm2 - vpaddd %xmm0,%xmm6,%xmm6 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm8,%xmm7 - - vpsrld $22,%xmm9,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm9,%xmm2 - vpxor %xmm3,%xmm10,%xmm8 - vpaddd %xmm6,%xmm12,%xmm12 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm6,%xmm8,%xmm8 - vpaddd %xmm7,%xmm8,%xmm8 - addq $256,%rbp - decl %ecx - jnz .Loop_16_xx_avx - - movl $1,%ecx - leaq K256+128(%rip),%rbp - cmpl 0(%rbx),%ecx - cmovgeq %rbp,%r8 - cmpl 4(%rbx),%ecx - cmovgeq %rbp,%r9 - cmpl 8(%rbx),%ecx - cmovgeq %rbp,%r10 - cmpl 12(%rbx),%ecx - cmovgeq %rbp,%r11 - vmovdqa (%rbx),%xmm7 - vpxor %xmm0,%xmm0,%xmm0 - vmovdqa %xmm7,%xmm6 - vpcmpgtd %xmm0,%xmm6,%xmm6 - vpaddd %xmm6,%xmm7,%xmm7 - - vmovdqu 0-128(%rdi),%xmm0 - vpand %xmm6,%xmm8,%xmm8 - vmovdqu 32-128(%rdi),%xmm1 - vpand %xmm6,%xmm9,%xmm9 - vmovdqu 64-128(%rdi),%xmm2 - vpand %xmm6,%xmm10,%xmm10 - vmovdqu 96-128(%rdi),%xmm5 - vpand %xmm6,%xmm11,%xmm11 - vpaddd %xmm0,%xmm8,%xmm8 - vmovdqu 128-128(%rdi),%xmm0 - vpand %xmm6,%xmm12,%xmm12 - vpaddd %xmm1,%xmm9,%xmm9 - vmovdqu 160-128(%rdi),%xmm1 - vpand %xmm6,%xmm13,%xmm13 - vpaddd %xmm2,%xmm10,%xmm10 - vmovdqu 192-128(%rdi),%xmm2 - vpand %xmm6,%xmm14,%xmm14 - vpaddd %xmm5,%xmm11,%xmm11 - vmovdqu 224-128(%rdi),%xmm5 - vpand %xmm6,%xmm15,%xmm15 - vpaddd %xmm0,%xmm12,%xmm12 - vpaddd %xmm1,%xmm13,%xmm13 - vmovdqu %xmm8,0-128(%rdi) - vpaddd %xmm2,%xmm14,%xmm14 - vmovdqu %xmm9,32-128(%rdi) - vpaddd %xmm5,%xmm15,%xmm15 - vmovdqu %xmm10,64-128(%rdi) - vmovdqu %xmm11,96-128(%rdi) - vmovdqu %xmm12,128-128(%rdi) - vmovdqu %xmm13,160-128(%rdi) - vmovdqu %xmm14,192-128(%rdi) - vmovdqu %xmm15,224-128(%rdi) - - vmovdqu %xmm7,(%rbx) - vmovdqu .Lpbswap(%rip),%xmm6 - decl %edx - jnz .Loop_avx - - movl 280(%rsp),%edx - leaq 16(%rdi),%rdi - leaq 64(%rsi),%rsi - decl %edx - jnz .Loop_grande_avx - -.Ldone_avx: - movq 272(%rsp),%rax - vzeroupper - movq -16(%rax),%rbp - movq -8(%rax),%rbx - leaq (%rax),%rsp -.Lepilogue_avx: - .byte 0xf3,0xc3 -.size sha256_multi_block_avx,.-sha256_multi_block_avx -.type sha256_multi_block_avx2,@function -.align 32 -sha256_multi_block_avx2: -_avx2_shortcut: - movq %rsp,%rax - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - subq $576,%rsp - andq $-256,%rsp - movq %rax,544(%rsp) -.Lbody_avx2: - leaq K256+128(%rip),%rbp - leaq 128(%rdi),%rdi - -.Loop_grande_avx2: - movl %edx,552(%rsp) - xorl %edx,%edx - leaq 512(%rsp),%rbx - movq 0(%rsi),%r12 - movl 8(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,0(%rbx) - cmovleq %rbp,%r12 - movq 16(%rsi),%r13 - movl 24(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,4(%rbx) - cmovleq %rbp,%r13 - movq 32(%rsi),%r14 - movl 40(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,8(%rbx) - cmovleq %rbp,%r14 - movq 48(%rsi),%r15 - movl 56(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,12(%rbx) - cmovleq %rbp,%r15 - movq 64(%rsi),%r8 - movl 72(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,16(%rbx) - cmovleq %rbp,%r8 - movq 80(%rsi),%r9 - movl 88(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,20(%rbx) - cmovleq %rbp,%r9 - movq 96(%rsi),%r10 - movl 104(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,24(%rbx) - cmovleq %rbp,%r10 - movq 112(%rsi),%r11 - movl 120(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,28(%rbx) - cmovleq %rbp,%r11 - vmovdqu 0-128(%rdi),%ymm8 - leaq 128(%rsp),%rax - vmovdqu 32-128(%rdi),%ymm9 - leaq 256+128(%rsp),%rbx - vmovdqu 64-128(%rdi),%ymm10 - vmovdqu 96-128(%rdi),%ymm11 - vmovdqu 128-128(%rdi),%ymm12 - vmovdqu 160-128(%rdi),%ymm13 - vmovdqu 192-128(%rdi),%ymm14 - vmovdqu 224-128(%rdi),%ymm15 - vmovdqu .Lpbswap(%rip),%ymm6 - jmp .Loop_avx2 - -.align 32 -.Loop_avx2: - vpxor %ymm9,%ymm10,%ymm4 - vmovd 0(%r12),%xmm5 - vmovd 0(%r8),%xmm0 - vmovd 0(%r13),%xmm1 - vmovd 0(%r9),%xmm2 - vpinsrd $1,0(%r14),%xmm5,%xmm5 - vpinsrd $1,0(%r10),%xmm0,%xmm0 - vpinsrd $1,0(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,0(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm12,%ymm7 - vpslld $26,%ymm12,%ymm2 - vmovdqu %ymm5,0-128(%rax) - vpaddd %ymm15,%ymm5,%ymm5 - - vpsrld $11,%ymm12,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm12,%ymm2 - vpaddd -128(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm12,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm12,%ymm2 - vpandn %ymm14,%ymm12,%ymm0 - vpand %ymm13,%ymm12,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm8,%ymm15 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm8,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm8,%ymm9,%ymm3 - - vpxor %ymm1,%ymm15,%ymm15 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm8,%ymm1 - - vpslld $19,%ymm8,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm15,%ymm7 - - vpsrld $22,%ymm8,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm8,%ymm2 - vpxor %ymm4,%ymm9,%ymm15 - vpaddd %ymm5,%ymm11,%ymm11 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm15,%ymm15 - vpaddd %ymm7,%ymm15,%ymm15 - vmovd 4(%r12),%xmm5 - vmovd 4(%r8),%xmm0 - vmovd 4(%r13),%xmm1 - vmovd 4(%r9),%xmm2 - vpinsrd $1,4(%r14),%xmm5,%xmm5 - vpinsrd $1,4(%r10),%xmm0,%xmm0 - vpinsrd $1,4(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,4(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm11,%ymm7 - vpslld $26,%ymm11,%ymm2 - vmovdqu %ymm5,32-128(%rax) - vpaddd %ymm14,%ymm5,%ymm5 - - vpsrld $11,%ymm11,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm11,%ymm2 - vpaddd -96(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm11,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm11,%ymm2 - vpandn %ymm13,%ymm11,%ymm0 - vpand %ymm12,%ymm11,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm15,%ymm14 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm15,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm15,%ymm8,%ymm4 - - vpxor %ymm1,%ymm14,%ymm14 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm15,%ymm1 - - vpslld $19,%ymm15,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm14,%ymm7 - - vpsrld $22,%ymm15,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm15,%ymm2 - vpxor %ymm3,%ymm8,%ymm14 - vpaddd %ymm5,%ymm10,%ymm10 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm14,%ymm14 - vpaddd %ymm7,%ymm14,%ymm14 - vmovd 8(%r12),%xmm5 - vmovd 8(%r8),%xmm0 - vmovd 8(%r13),%xmm1 - vmovd 8(%r9),%xmm2 - vpinsrd $1,8(%r14),%xmm5,%xmm5 - vpinsrd $1,8(%r10),%xmm0,%xmm0 - vpinsrd $1,8(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,8(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm10,%ymm7 - vpslld $26,%ymm10,%ymm2 - vmovdqu %ymm5,64-128(%rax) - vpaddd %ymm13,%ymm5,%ymm5 - - vpsrld $11,%ymm10,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm10,%ymm2 - vpaddd -64(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm10,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm10,%ymm2 - vpandn %ymm12,%ymm10,%ymm0 - vpand %ymm11,%ymm10,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm14,%ymm13 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm14,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm14,%ymm15,%ymm3 - - vpxor %ymm1,%ymm13,%ymm13 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm14,%ymm1 - - vpslld $19,%ymm14,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm13,%ymm7 - - vpsrld $22,%ymm14,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm14,%ymm2 - vpxor %ymm4,%ymm15,%ymm13 - vpaddd %ymm5,%ymm9,%ymm9 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm13,%ymm13 - vpaddd %ymm7,%ymm13,%ymm13 - vmovd 12(%r12),%xmm5 - vmovd 12(%r8),%xmm0 - vmovd 12(%r13),%xmm1 - vmovd 12(%r9),%xmm2 - vpinsrd $1,12(%r14),%xmm5,%xmm5 - vpinsrd $1,12(%r10),%xmm0,%xmm0 - vpinsrd $1,12(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,12(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm9,%ymm7 - vpslld $26,%ymm9,%ymm2 - vmovdqu %ymm5,96-128(%rax) - vpaddd %ymm12,%ymm5,%ymm5 - - vpsrld $11,%ymm9,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm9,%ymm2 - vpaddd -32(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm9,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm9,%ymm2 - vpandn %ymm11,%ymm9,%ymm0 - vpand %ymm10,%ymm9,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm13,%ymm12 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm13,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm13,%ymm14,%ymm4 - - vpxor %ymm1,%ymm12,%ymm12 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm13,%ymm1 - - vpslld $19,%ymm13,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm12,%ymm7 - - vpsrld $22,%ymm13,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm13,%ymm2 - vpxor %ymm3,%ymm14,%ymm12 - vpaddd %ymm5,%ymm8,%ymm8 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm12,%ymm12 - vpaddd %ymm7,%ymm12,%ymm12 - vmovd 16(%r12),%xmm5 - vmovd 16(%r8),%xmm0 - vmovd 16(%r13),%xmm1 - vmovd 16(%r9),%xmm2 - vpinsrd $1,16(%r14),%xmm5,%xmm5 - vpinsrd $1,16(%r10),%xmm0,%xmm0 - vpinsrd $1,16(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,16(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm8,%ymm7 - vpslld $26,%ymm8,%ymm2 - vmovdqu %ymm5,128-128(%rax) - vpaddd %ymm11,%ymm5,%ymm5 - - vpsrld $11,%ymm8,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm8,%ymm2 - vpaddd 0(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm8,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm8,%ymm2 - vpandn %ymm10,%ymm8,%ymm0 - vpand %ymm9,%ymm8,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm12,%ymm11 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm12,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm12,%ymm13,%ymm3 - - vpxor %ymm1,%ymm11,%ymm11 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm12,%ymm1 - - vpslld $19,%ymm12,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm11,%ymm7 - - vpsrld $22,%ymm12,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm12,%ymm2 - vpxor %ymm4,%ymm13,%ymm11 - vpaddd %ymm5,%ymm15,%ymm15 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm11,%ymm11 - vpaddd %ymm7,%ymm11,%ymm11 - vmovd 20(%r12),%xmm5 - vmovd 20(%r8),%xmm0 - vmovd 20(%r13),%xmm1 - vmovd 20(%r9),%xmm2 - vpinsrd $1,20(%r14),%xmm5,%xmm5 - vpinsrd $1,20(%r10),%xmm0,%xmm0 - vpinsrd $1,20(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,20(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm15,%ymm7 - vpslld $26,%ymm15,%ymm2 - vmovdqu %ymm5,160-128(%rax) - vpaddd %ymm10,%ymm5,%ymm5 - - vpsrld $11,%ymm15,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm15,%ymm2 - vpaddd 32(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm15,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm15,%ymm2 - vpandn %ymm9,%ymm15,%ymm0 - vpand %ymm8,%ymm15,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm11,%ymm10 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm11,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm11,%ymm12,%ymm4 - - vpxor %ymm1,%ymm10,%ymm10 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm11,%ymm1 - - vpslld $19,%ymm11,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm10,%ymm7 - - vpsrld $22,%ymm11,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm11,%ymm2 - vpxor %ymm3,%ymm12,%ymm10 - vpaddd %ymm5,%ymm14,%ymm14 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm10,%ymm10 - vpaddd %ymm7,%ymm10,%ymm10 - vmovd 24(%r12),%xmm5 - vmovd 24(%r8),%xmm0 - vmovd 24(%r13),%xmm1 - vmovd 24(%r9),%xmm2 - vpinsrd $1,24(%r14),%xmm5,%xmm5 - vpinsrd $1,24(%r10),%xmm0,%xmm0 - vpinsrd $1,24(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,24(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm14,%ymm7 - vpslld $26,%ymm14,%ymm2 - vmovdqu %ymm5,192-128(%rax) - vpaddd %ymm9,%ymm5,%ymm5 - - vpsrld $11,%ymm14,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm14,%ymm2 - vpaddd 64(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm14,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm14,%ymm2 - vpandn %ymm8,%ymm14,%ymm0 - vpand %ymm15,%ymm14,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm10,%ymm9 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm10,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm10,%ymm11,%ymm3 - - vpxor %ymm1,%ymm9,%ymm9 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm10,%ymm1 - - vpslld $19,%ymm10,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm9,%ymm7 - - vpsrld $22,%ymm10,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm10,%ymm2 - vpxor %ymm4,%ymm11,%ymm9 - vpaddd %ymm5,%ymm13,%ymm13 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm9,%ymm9 - vpaddd %ymm7,%ymm9,%ymm9 - vmovd 28(%r12),%xmm5 - vmovd 28(%r8),%xmm0 - vmovd 28(%r13),%xmm1 - vmovd 28(%r9),%xmm2 - vpinsrd $1,28(%r14),%xmm5,%xmm5 - vpinsrd $1,28(%r10),%xmm0,%xmm0 - vpinsrd $1,28(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,28(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm13,%ymm7 - vpslld $26,%ymm13,%ymm2 - vmovdqu %ymm5,224-128(%rax) - vpaddd %ymm8,%ymm5,%ymm5 - - vpsrld $11,%ymm13,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm13,%ymm2 - vpaddd 96(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm13,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm13,%ymm2 - vpandn %ymm15,%ymm13,%ymm0 - vpand %ymm14,%ymm13,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm9,%ymm8 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm9,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm9,%ymm10,%ymm4 - - vpxor %ymm1,%ymm8,%ymm8 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm9,%ymm1 - - vpslld $19,%ymm9,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm8,%ymm7 - - vpsrld $22,%ymm9,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm9,%ymm2 - vpxor %ymm3,%ymm10,%ymm8 - vpaddd %ymm5,%ymm12,%ymm12 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm8,%ymm8 - vpaddd %ymm7,%ymm8,%ymm8 - addq $256,%rbp - vmovd 32(%r12),%xmm5 - vmovd 32(%r8),%xmm0 - vmovd 32(%r13),%xmm1 - vmovd 32(%r9),%xmm2 - vpinsrd $1,32(%r14),%xmm5,%xmm5 - vpinsrd $1,32(%r10),%xmm0,%xmm0 - vpinsrd $1,32(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,32(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm12,%ymm7 - vpslld $26,%ymm12,%ymm2 - vmovdqu %ymm5,256-256-128(%rbx) - vpaddd %ymm15,%ymm5,%ymm5 - - vpsrld $11,%ymm12,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm12,%ymm2 - vpaddd -128(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm12,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm12,%ymm2 - vpandn %ymm14,%ymm12,%ymm0 - vpand %ymm13,%ymm12,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm8,%ymm15 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm8,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm8,%ymm9,%ymm3 - - vpxor %ymm1,%ymm15,%ymm15 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm8,%ymm1 - - vpslld $19,%ymm8,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm15,%ymm7 - - vpsrld $22,%ymm8,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm8,%ymm2 - vpxor %ymm4,%ymm9,%ymm15 - vpaddd %ymm5,%ymm11,%ymm11 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm15,%ymm15 - vpaddd %ymm7,%ymm15,%ymm15 - vmovd 36(%r12),%xmm5 - vmovd 36(%r8),%xmm0 - vmovd 36(%r13),%xmm1 - vmovd 36(%r9),%xmm2 - vpinsrd $1,36(%r14),%xmm5,%xmm5 - vpinsrd $1,36(%r10),%xmm0,%xmm0 - vpinsrd $1,36(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,36(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm11,%ymm7 - vpslld $26,%ymm11,%ymm2 - vmovdqu %ymm5,288-256-128(%rbx) - vpaddd %ymm14,%ymm5,%ymm5 - - vpsrld $11,%ymm11,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm11,%ymm2 - vpaddd -96(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm11,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm11,%ymm2 - vpandn %ymm13,%ymm11,%ymm0 - vpand %ymm12,%ymm11,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm15,%ymm14 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm15,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm15,%ymm8,%ymm4 - - vpxor %ymm1,%ymm14,%ymm14 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm15,%ymm1 - - vpslld $19,%ymm15,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm14,%ymm7 - - vpsrld $22,%ymm15,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm15,%ymm2 - vpxor %ymm3,%ymm8,%ymm14 - vpaddd %ymm5,%ymm10,%ymm10 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm14,%ymm14 - vpaddd %ymm7,%ymm14,%ymm14 - vmovd 40(%r12),%xmm5 - vmovd 40(%r8),%xmm0 - vmovd 40(%r13),%xmm1 - vmovd 40(%r9),%xmm2 - vpinsrd $1,40(%r14),%xmm5,%xmm5 - vpinsrd $1,40(%r10),%xmm0,%xmm0 - vpinsrd $1,40(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,40(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm10,%ymm7 - vpslld $26,%ymm10,%ymm2 - vmovdqu %ymm5,320-256-128(%rbx) - vpaddd %ymm13,%ymm5,%ymm5 - - vpsrld $11,%ymm10,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm10,%ymm2 - vpaddd -64(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm10,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm10,%ymm2 - vpandn %ymm12,%ymm10,%ymm0 - vpand %ymm11,%ymm10,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm14,%ymm13 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm14,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm14,%ymm15,%ymm3 - - vpxor %ymm1,%ymm13,%ymm13 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm14,%ymm1 - - vpslld $19,%ymm14,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm13,%ymm7 - - vpsrld $22,%ymm14,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm14,%ymm2 - vpxor %ymm4,%ymm15,%ymm13 - vpaddd %ymm5,%ymm9,%ymm9 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm13,%ymm13 - vpaddd %ymm7,%ymm13,%ymm13 - vmovd 44(%r12),%xmm5 - vmovd 44(%r8),%xmm0 - vmovd 44(%r13),%xmm1 - vmovd 44(%r9),%xmm2 - vpinsrd $1,44(%r14),%xmm5,%xmm5 - vpinsrd $1,44(%r10),%xmm0,%xmm0 - vpinsrd $1,44(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,44(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm9,%ymm7 - vpslld $26,%ymm9,%ymm2 - vmovdqu %ymm5,352-256-128(%rbx) - vpaddd %ymm12,%ymm5,%ymm5 - - vpsrld $11,%ymm9,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm9,%ymm2 - vpaddd -32(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm9,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm9,%ymm2 - vpandn %ymm11,%ymm9,%ymm0 - vpand %ymm10,%ymm9,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm13,%ymm12 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm13,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm13,%ymm14,%ymm4 - - vpxor %ymm1,%ymm12,%ymm12 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm13,%ymm1 - - vpslld $19,%ymm13,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm12,%ymm7 - - vpsrld $22,%ymm13,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm13,%ymm2 - vpxor %ymm3,%ymm14,%ymm12 - vpaddd %ymm5,%ymm8,%ymm8 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm12,%ymm12 - vpaddd %ymm7,%ymm12,%ymm12 - vmovd 48(%r12),%xmm5 - vmovd 48(%r8),%xmm0 - vmovd 48(%r13),%xmm1 - vmovd 48(%r9),%xmm2 - vpinsrd $1,48(%r14),%xmm5,%xmm5 - vpinsrd $1,48(%r10),%xmm0,%xmm0 - vpinsrd $1,48(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,48(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm8,%ymm7 - vpslld $26,%ymm8,%ymm2 - vmovdqu %ymm5,384-256-128(%rbx) - vpaddd %ymm11,%ymm5,%ymm5 - - vpsrld $11,%ymm8,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm8,%ymm2 - vpaddd 0(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm8,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm8,%ymm2 - vpandn %ymm10,%ymm8,%ymm0 - vpand %ymm9,%ymm8,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm12,%ymm11 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm12,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm12,%ymm13,%ymm3 - - vpxor %ymm1,%ymm11,%ymm11 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm12,%ymm1 - - vpslld $19,%ymm12,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm11,%ymm7 - - vpsrld $22,%ymm12,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm12,%ymm2 - vpxor %ymm4,%ymm13,%ymm11 - vpaddd %ymm5,%ymm15,%ymm15 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm11,%ymm11 - vpaddd %ymm7,%ymm11,%ymm11 - vmovd 52(%r12),%xmm5 - vmovd 52(%r8),%xmm0 - vmovd 52(%r13),%xmm1 - vmovd 52(%r9),%xmm2 - vpinsrd $1,52(%r14),%xmm5,%xmm5 - vpinsrd $1,52(%r10),%xmm0,%xmm0 - vpinsrd $1,52(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,52(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm15,%ymm7 - vpslld $26,%ymm15,%ymm2 - vmovdqu %ymm5,416-256-128(%rbx) - vpaddd %ymm10,%ymm5,%ymm5 - - vpsrld $11,%ymm15,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm15,%ymm2 - vpaddd 32(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm15,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm15,%ymm2 - vpandn %ymm9,%ymm15,%ymm0 - vpand %ymm8,%ymm15,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm11,%ymm10 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm11,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm11,%ymm12,%ymm4 - - vpxor %ymm1,%ymm10,%ymm10 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm11,%ymm1 - - vpslld $19,%ymm11,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm10,%ymm7 - - vpsrld $22,%ymm11,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm11,%ymm2 - vpxor %ymm3,%ymm12,%ymm10 - vpaddd %ymm5,%ymm14,%ymm14 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm10,%ymm10 - vpaddd %ymm7,%ymm10,%ymm10 - vmovd 56(%r12),%xmm5 - vmovd 56(%r8),%xmm0 - vmovd 56(%r13),%xmm1 - vmovd 56(%r9),%xmm2 - vpinsrd $1,56(%r14),%xmm5,%xmm5 - vpinsrd $1,56(%r10),%xmm0,%xmm0 - vpinsrd $1,56(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,56(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm14,%ymm7 - vpslld $26,%ymm14,%ymm2 - vmovdqu %ymm5,448-256-128(%rbx) - vpaddd %ymm9,%ymm5,%ymm5 - - vpsrld $11,%ymm14,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm14,%ymm2 - vpaddd 64(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm14,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm14,%ymm2 - vpandn %ymm8,%ymm14,%ymm0 - vpand %ymm15,%ymm14,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm10,%ymm9 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm10,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm10,%ymm11,%ymm3 - - vpxor %ymm1,%ymm9,%ymm9 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm10,%ymm1 - - vpslld $19,%ymm10,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm9,%ymm7 - - vpsrld $22,%ymm10,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm10,%ymm2 - vpxor %ymm4,%ymm11,%ymm9 - vpaddd %ymm5,%ymm13,%ymm13 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm9,%ymm9 - vpaddd %ymm7,%ymm9,%ymm9 - vmovd 60(%r12),%xmm5 - leaq 64(%r12),%r12 - vmovd 60(%r8),%xmm0 - leaq 64(%r8),%r8 - vmovd 60(%r13),%xmm1 - leaq 64(%r13),%r13 - vmovd 60(%r9),%xmm2 - leaq 64(%r9),%r9 - vpinsrd $1,60(%r14),%xmm5,%xmm5 - leaq 64(%r14),%r14 - vpinsrd $1,60(%r10),%xmm0,%xmm0 - leaq 64(%r10),%r10 - vpinsrd $1,60(%r15),%xmm1,%xmm1 - leaq 64(%r15),%r15 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,60(%r11),%xmm2,%xmm2 - leaq 64(%r11),%r11 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm13,%ymm7 - vpslld $26,%ymm13,%ymm2 - vmovdqu %ymm5,480-256-128(%rbx) - vpaddd %ymm8,%ymm5,%ymm5 - - vpsrld $11,%ymm13,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm13,%ymm2 - vpaddd 96(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm13,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - prefetcht0 63(%r12) - vpslld $7,%ymm13,%ymm2 - vpandn %ymm15,%ymm13,%ymm0 - vpand %ymm14,%ymm13,%ymm4 - prefetcht0 63(%r13) - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm9,%ymm8 - vpxor %ymm2,%ymm7,%ymm7 - prefetcht0 63(%r14) - vpslld $30,%ymm9,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm9,%ymm10,%ymm4 - prefetcht0 63(%r15) - vpxor %ymm1,%ymm8,%ymm8 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm9,%ymm1 - prefetcht0 63(%r8) - vpslld $19,%ymm9,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm4,%ymm3,%ymm3 - prefetcht0 63(%r9) - vpxor %ymm1,%ymm8,%ymm7 - - vpsrld $22,%ymm9,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - prefetcht0 63(%r10) - vpslld $10,%ymm9,%ymm2 - vpxor %ymm3,%ymm10,%ymm8 - vpaddd %ymm5,%ymm12,%ymm12 - prefetcht0 63(%r11) - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm8,%ymm8 - vpaddd %ymm7,%ymm8,%ymm8 - addq $256,%rbp - vmovdqu 0-128(%rax),%ymm5 - movl $3,%ecx - jmp .Loop_16_xx_avx2 -.align 32 -.Loop_16_xx_avx2: - vmovdqu 32-128(%rax),%ymm6 - vpaddd 288-256-128(%rbx),%ymm5,%ymm5 - - vpsrld $3,%ymm6,%ymm7 - vpsrld $7,%ymm6,%ymm1 - vpslld $25,%ymm6,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm6,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm6,%ymm2 - vmovdqu 448-256-128(%rbx),%ymm0 - vpsrld $10,%ymm0,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm5,%ymm5 - vpxor %ymm1,%ymm3,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm5,%ymm5 - vpsrld $6,%ymm12,%ymm7 - vpslld $26,%ymm12,%ymm2 - vmovdqu %ymm5,0-128(%rax) - vpaddd %ymm15,%ymm5,%ymm5 - - vpsrld $11,%ymm12,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm12,%ymm2 - vpaddd -128(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm12,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm12,%ymm2 - vpandn %ymm14,%ymm12,%ymm0 - vpand %ymm13,%ymm12,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm8,%ymm15 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm8,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm8,%ymm9,%ymm3 - - vpxor %ymm1,%ymm15,%ymm15 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm8,%ymm1 - - vpslld $19,%ymm8,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm15,%ymm7 - - vpsrld $22,%ymm8,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm8,%ymm2 - vpxor %ymm4,%ymm9,%ymm15 - vpaddd %ymm5,%ymm11,%ymm11 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm15,%ymm15 - vpaddd %ymm7,%ymm15,%ymm15 - vmovdqu 64-128(%rax),%ymm5 - vpaddd 320-256-128(%rbx),%ymm6,%ymm6 - - vpsrld $3,%ymm5,%ymm7 - vpsrld $7,%ymm5,%ymm1 - vpslld $25,%ymm5,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm5,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm5,%ymm2 - vmovdqu 480-256-128(%rbx),%ymm0 - vpsrld $10,%ymm0,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm6,%ymm6 - vpxor %ymm1,%ymm4,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm6,%ymm6 - vpsrld $6,%ymm11,%ymm7 - vpslld $26,%ymm11,%ymm2 - vmovdqu %ymm6,32-128(%rax) - vpaddd %ymm14,%ymm6,%ymm6 - - vpsrld $11,%ymm11,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm11,%ymm2 - vpaddd -96(%rbp),%ymm6,%ymm6 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm11,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm11,%ymm2 - vpandn %ymm13,%ymm11,%ymm0 - vpand %ymm12,%ymm11,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm15,%ymm14 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm15,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm15,%ymm8,%ymm4 - - vpxor %ymm1,%ymm14,%ymm14 - vpaddd %ymm7,%ymm6,%ymm6 - - vpsrld $13,%ymm15,%ymm1 - - vpslld $19,%ymm15,%ymm2 - vpaddd %ymm0,%ymm6,%ymm6 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm14,%ymm7 - - vpsrld $22,%ymm15,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm15,%ymm2 - vpxor %ymm3,%ymm8,%ymm14 - vpaddd %ymm6,%ymm10,%ymm10 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm6,%ymm14,%ymm14 - vpaddd %ymm7,%ymm14,%ymm14 - vmovdqu 96-128(%rax),%ymm6 - vpaddd 352-256-128(%rbx),%ymm5,%ymm5 - - vpsrld $3,%ymm6,%ymm7 - vpsrld $7,%ymm6,%ymm1 - vpslld $25,%ymm6,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm6,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm6,%ymm2 - vmovdqu 0-128(%rax),%ymm0 - vpsrld $10,%ymm0,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm5,%ymm5 - vpxor %ymm1,%ymm3,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm5,%ymm5 - vpsrld $6,%ymm10,%ymm7 - vpslld $26,%ymm10,%ymm2 - vmovdqu %ymm5,64-128(%rax) - vpaddd %ymm13,%ymm5,%ymm5 - - vpsrld $11,%ymm10,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm10,%ymm2 - vpaddd -64(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm10,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm10,%ymm2 - vpandn %ymm12,%ymm10,%ymm0 - vpand %ymm11,%ymm10,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm14,%ymm13 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm14,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm14,%ymm15,%ymm3 - - vpxor %ymm1,%ymm13,%ymm13 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm14,%ymm1 - - vpslld $19,%ymm14,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm13,%ymm7 - - vpsrld $22,%ymm14,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm14,%ymm2 - vpxor %ymm4,%ymm15,%ymm13 - vpaddd %ymm5,%ymm9,%ymm9 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm13,%ymm13 - vpaddd %ymm7,%ymm13,%ymm13 - vmovdqu 128-128(%rax),%ymm5 - vpaddd 384-256-128(%rbx),%ymm6,%ymm6 - - vpsrld $3,%ymm5,%ymm7 - vpsrld $7,%ymm5,%ymm1 - vpslld $25,%ymm5,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm5,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm5,%ymm2 - vmovdqu 32-128(%rax),%ymm0 - vpsrld $10,%ymm0,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm6,%ymm6 - vpxor %ymm1,%ymm4,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm6,%ymm6 - vpsrld $6,%ymm9,%ymm7 - vpslld $26,%ymm9,%ymm2 - vmovdqu %ymm6,96-128(%rax) - vpaddd %ymm12,%ymm6,%ymm6 - - vpsrld $11,%ymm9,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm9,%ymm2 - vpaddd -32(%rbp),%ymm6,%ymm6 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm9,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm9,%ymm2 - vpandn %ymm11,%ymm9,%ymm0 - vpand %ymm10,%ymm9,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm13,%ymm12 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm13,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm13,%ymm14,%ymm4 - - vpxor %ymm1,%ymm12,%ymm12 - vpaddd %ymm7,%ymm6,%ymm6 - - vpsrld $13,%ymm13,%ymm1 - - vpslld $19,%ymm13,%ymm2 - vpaddd %ymm0,%ymm6,%ymm6 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm12,%ymm7 - - vpsrld $22,%ymm13,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm13,%ymm2 - vpxor %ymm3,%ymm14,%ymm12 - vpaddd %ymm6,%ymm8,%ymm8 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm6,%ymm12,%ymm12 - vpaddd %ymm7,%ymm12,%ymm12 - vmovdqu 160-128(%rax),%ymm6 - vpaddd 416-256-128(%rbx),%ymm5,%ymm5 - - vpsrld $3,%ymm6,%ymm7 - vpsrld $7,%ymm6,%ymm1 - vpslld $25,%ymm6,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm6,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm6,%ymm2 - vmovdqu 64-128(%rax),%ymm0 - vpsrld $10,%ymm0,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm5,%ymm5 - vpxor %ymm1,%ymm3,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm5,%ymm5 - vpsrld $6,%ymm8,%ymm7 - vpslld $26,%ymm8,%ymm2 - vmovdqu %ymm5,128-128(%rax) - vpaddd %ymm11,%ymm5,%ymm5 - - vpsrld $11,%ymm8,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm8,%ymm2 - vpaddd 0(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm8,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm8,%ymm2 - vpandn %ymm10,%ymm8,%ymm0 - vpand %ymm9,%ymm8,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm12,%ymm11 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm12,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm12,%ymm13,%ymm3 - - vpxor %ymm1,%ymm11,%ymm11 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm12,%ymm1 - - vpslld $19,%ymm12,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm11,%ymm7 - - vpsrld $22,%ymm12,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm12,%ymm2 - vpxor %ymm4,%ymm13,%ymm11 - vpaddd %ymm5,%ymm15,%ymm15 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm11,%ymm11 - vpaddd %ymm7,%ymm11,%ymm11 - vmovdqu 192-128(%rax),%ymm5 - vpaddd 448-256-128(%rbx),%ymm6,%ymm6 - - vpsrld $3,%ymm5,%ymm7 - vpsrld $7,%ymm5,%ymm1 - vpslld $25,%ymm5,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm5,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm5,%ymm2 - vmovdqu 96-128(%rax),%ymm0 - vpsrld $10,%ymm0,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm6,%ymm6 - vpxor %ymm1,%ymm4,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm6,%ymm6 - vpsrld $6,%ymm15,%ymm7 - vpslld $26,%ymm15,%ymm2 - vmovdqu %ymm6,160-128(%rax) - vpaddd %ymm10,%ymm6,%ymm6 - - vpsrld $11,%ymm15,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm15,%ymm2 - vpaddd 32(%rbp),%ymm6,%ymm6 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm15,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm15,%ymm2 - vpandn %ymm9,%ymm15,%ymm0 - vpand %ymm8,%ymm15,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm11,%ymm10 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm11,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm11,%ymm12,%ymm4 - - vpxor %ymm1,%ymm10,%ymm10 - vpaddd %ymm7,%ymm6,%ymm6 - - vpsrld $13,%ymm11,%ymm1 - - vpslld $19,%ymm11,%ymm2 - vpaddd %ymm0,%ymm6,%ymm6 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm10,%ymm7 - - vpsrld $22,%ymm11,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm11,%ymm2 - vpxor %ymm3,%ymm12,%ymm10 - vpaddd %ymm6,%ymm14,%ymm14 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm6,%ymm10,%ymm10 - vpaddd %ymm7,%ymm10,%ymm10 - vmovdqu 224-128(%rax),%ymm6 - vpaddd 480-256-128(%rbx),%ymm5,%ymm5 - - vpsrld $3,%ymm6,%ymm7 - vpsrld $7,%ymm6,%ymm1 - vpslld $25,%ymm6,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm6,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm6,%ymm2 - vmovdqu 128-128(%rax),%ymm0 - vpsrld $10,%ymm0,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm5,%ymm5 - vpxor %ymm1,%ymm3,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm5,%ymm5 - vpsrld $6,%ymm14,%ymm7 - vpslld $26,%ymm14,%ymm2 - vmovdqu %ymm5,192-128(%rax) - vpaddd %ymm9,%ymm5,%ymm5 - - vpsrld $11,%ymm14,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm14,%ymm2 - vpaddd 64(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm14,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm14,%ymm2 - vpandn %ymm8,%ymm14,%ymm0 - vpand %ymm15,%ymm14,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm10,%ymm9 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm10,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm10,%ymm11,%ymm3 - - vpxor %ymm1,%ymm9,%ymm9 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm10,%ymm1 - - vpslld $19,%ymm10,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm9,%ymm7 - - vpsrld $22,%ymm10,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm10,%ymm2 - vpxor %ymm4,%ymm11,%ymm9 - vpaddd %ymm5,%ymm13,%ymm13 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm9,%ymm9 - vpaddd %ymm7,%ymm9,%ymm9 - vmovdqu 256-256-128(%rbx),%ymm5 - vpaddd 0-128(%rax),%ymm6,%ymm6 - - vpsrld $3,%ymm5,%ymm7 - vpsrld $7,%ymm5,%ymm1 - vpslld $25,%ymm5,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm5,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm5,%ymm2 - vmovdqu 160-128(%rax),%ymm0 - vpsrld $10,%ymm0,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm6,%ymm6 - vpxor %ymm1,%ymm4,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm6,%ymm6 - vpsrld $6,%ymm13,%ymm7 - vpslld $26,%ymm13,%ymm2 - vmovdqu %ymm6,224-128(%rax) - vpaddd %ymm8,%ymm6,%ymm6 - - vpsrld $11,%ymm13,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm13,%ymm2 - vpaddd 96(%rbp),%ymm6,%ymm6 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm13,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm13,%ymm2 - vpandn %ymm15,%ymm13,%ymm0 - vpand %ymm14,%ymm13,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm9,%ymm8 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm9,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm9,%ymm10,%ymm4 - - vpxor %ymm1,%ymm8,%ymm8 - vpaddd %ymm7,%ymm6,%ymm6 - - vpsrld $13,%ymm9,%ymm1 - - vpslld $19,%ymm9,%ymm2 - vpaddd %ymm0,%ymm6,%ymm6 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm8,%ymm7 - - vpsrld $22,%ymm9,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm9,%ymm2 - vpxor %ymm3,%ymm10,%ymm8 - vpaddd %ymm6,%ymm12,%ymm12 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm6,%ymm8,%ymm8 - vpaddd %ymm7,%ymm8,%ymm8 - addq $256,%rbp - vmovdqu 288-256-128(%rbx),%ymm6 - vpaddd 32-128(%rax),%ymm5,%ymm5 - - vpsrld $3,%ymm6,%ymm7 - vpsrld $7,%ymm6,%ymm1 - vpslld $25,%ymm6,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm6,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm6,%ymm2 - vmovdqu 192-128(%rax),%ymm0 - vpsrld $10,%ymm0,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm5,%ymm5 - vpxor %ymm1,%ymm3,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm5,%ymm5 - vpsrld $6,%ymm12,%ymm7 - vpslld $26,%ymm12,%ymm2 - vmovdqu %ymm5,256-256-128(%rbx) - vpaddd %ymm15,%ymm5,%ymm5 - - vpsrld $11,%ymm12,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm12,%ymm2 - vpaddd -128(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm12,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm12,%ymm2 - vpandn %ymm14,%ymm12,%ymm0 - vpand %ymm13,%ymm12,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm8,%ymm15 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm8,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm8,%ymm9,%ymm3 - - vpxor %ymm1,%ymm15,%ymm15 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm8,%ymm1 - - vpslld $19,%ymm8,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm15,%ymm7 - - vpsrld $22,%ymm8,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm8,%ymm2 - vpxor %ymm4,%ymm9,%ymm15 - vpaddd %ymm5,%ymm11,%ymm11 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm15,%ymm15 - vpaddd %ymm7,%ymm15,%ymm15 - vmovdqu 320-256-128(%rbx),%ymm5 - vpaddd 64-128(%rax),%ymm6,%ymm6 - - vpsrld $3,%ymm5,%ymm7 - vpsrld $7,%ymm5,%ymm1 - vpslld $25,%ymm5,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm5,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm5,%ymm2 - vmovdqu 224-128(%rax),%ymm0 - vpsrld $10,%ymm0,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm6,%ymm6 - vpxor %ymm1,%ymm4,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm6,%ymm6 - vpsrld $6,%ymm11,%ymm7 - vpslld $26,%ymm11,%ymm2 - vmovdqu %ymm6,288-256-128(%rbx) - vpaddd %ymm14,%ymm6,%ymm6 - - vpsrld $11,%ymm11,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm11,%ymm2 - vpaddd -96(%rbp),%ymm6,%ymm6 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm11,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm11,%ymm2 - vpandn %ymm13,%ymm11,%ymm0 - vpand %ymm12,%ymm11,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm15,%ymm14 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm15,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm15,%ymm8,%ymm4 - - vpxor %ymm1,%ymm14,%ymm14 - vpaddd %ymm7,%ymm6,%ymm6 - - vpsrld $13,%ymm15,%ymm1 - - vpslld $19,%ymm15,%ymm2 - vpaddd %ymm0,%ymm6,%ymm6 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm14,%ymm7 - - vpsrld $22,%ymm15,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm15,%ymm2 - vpxor %ymm3,%ymm8,%ymm14 - vpaddd %ymm6,%ymm10,%ymm10 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm6,%ymm14,%ymm14 - vpaddd %ymm7,%ymm14,%ymm14 - vmovdqu 352-256-128(%rbx),%ymm6 - vpaddd 96-128(%rax),%ymm5,%ymm5 - - vpsrld $3,%ymm6,%ymm7 - vpsrld $7,%ymm6,%ymm1 - vpslld $25,%ymm6,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm6,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm6,%ymm2 - vmovdqu 256-256-128(%rbx),%ymm0 - vpsrld $10,%ymm0,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm5,%ymm5 - vpxor %ymm1,%ymm3,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm5,%ymm5 - vpsrld $6,%ymm10,%ymm7 - vpslld $26,%ymm10,%ymm2 - vmovdqu %ymm5,320-256-128(%rbx) - vpaddd %ymm13,%ymm5,%ymm5 - - vpsrld $11,%ymm10,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm10,%ymm2 - vpaddd -64(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm10,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm10,%ymm2 - vpandn %ymm12,%ymm10,%ymm0 - vpand %ymm11,%ymm10,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm14,%ymm13 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm14,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm14,%ymm15,%ymm3 - - vpxor %ymm1,%ymm13,%ymm13 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm14,%ymm1 - - vpslld $19,%ymm14,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm13,%ymm7 - - vpsrld $22,%ymm14,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm14,%ymm2 - vpxor %ymm4,%ymm15,%ymm13 - vpaddd %ymm5,%ymm9,%ymm9 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm13,%ymm13 - vpaddd %ymm7,%ymm13,%ymm13 - vmovdqu 384-256-128(%rbx),%ymm5 - vpaddd 128-128(%rax),%ymm6,%ymm6 - - vpsrld $3,%ymm5,%ymm7 - vpsrld $7,%ymm5,%ymm1 - vpslld $25,%ymm5,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm5,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm5,%ymm2 - vmovdqu 288-256-128(%rbx),%ymm0 - vpsrld $10,%ymm0,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm6,%ymm6 - vpxor %ymm1,%ymm4,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm6,%ymm6 - vpsrld $6,%ymm9,%ymm7 - vpslld $26,%ymm9,%ymm2 - vmovdqu %ymm6,352-256-128(%rbx) - vpaddd %ymm12,%ymm6,%ymm6 - - vpsrld $11,%ymm9,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm9,%ymm2 - vpaddd -32(%rbp),%ymm6,%ymm6 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm9,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm9,%ymm2 - vpandn %ymm11,%ymm9,%ymm0 - vpand %ymm10,%ymm9,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm13,%ymm12 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm13,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm13,%ymm14,%ymm4 - - vpxor %ymm1,%ymm12,%ymm12 - vpaddd %ymm7,%ymm6,%ymm6 - - vpsrld $13,%ymm13,%ymm1 - - vpslld $19,%ymm13,%ymm2 - vpaddd %ymm0,%ymm6,%ymm6 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm12,%ymm7 - - vpsrld $22,%ymm13,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm13,%ymm2 - vpxor %ymm3,%ymm14,%ymm12 - vpaddd %ymm6,%ymm8,%ymm8 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm6,%ymm12,%ymm12 - vpaddd %ymm7,%ymm12,%ymm12 - vmovdqu 416-256-128(%rbx),%ymm6 - vpaddd 160-128(%rax),%ymm5,%ymm5 - - vpsrld $3,%ymm6,%ymm7 - vpsrld $7,%ymm6,%ymm1 - vpslld $25,%ymm6,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm6,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm6,%ymm2 - vmovdqu 320-256-128(%rbx),%ymm0 - vpsrld $10,%ymm0,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm5,%ymm5 - vpxor %ymm1,%ymm3,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm5,%ymm5 - vpsrld $6,%ymm8,%ymm7 - vpslld $26,%ymm8,%ymm2 - vmovdqu %ymm5,384-256-128(%rbx) - vpaddd %ymm11,%ymm5,%ymm5 - - vpsrld $11,%ymm8,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm8,%ymm2 - vpaddd 0(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm8,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm8,%ymm2 - vpandn %ymm10,%ymm8,%ymm0 - vpand %ymm9,%ymm8,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm12,%ymm11 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm12,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm12,%ymm13,%ymm3 - - vpxor %ymm1,%ymm11,%ymm11 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm12,%ymm1 - - vpslld $19,%ymm12,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm11,%ymm7 - - vpsrld $22,%ymm12,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm12,%ymm2 - vpxor %ymm4,%ymm13,%ymm11 - vpaddd %ymm5,%ymm15,%ymm15 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm11,%ymm11 - vpaddd %ymm7,%ymm11,%ymm11 - vmovdqu 448-256-128(%rbx),%ymm5 - vpaddd 192-128(%rax),%ymm6,%ymm6 - - vpsrld $3,%ymm5,%ymm7 - vpsrld $7,%ymm5,%ymm1 - vpslld $25,%ymm5,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm5,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm5,%ymm2 - vmovdqu 352-256-128(%rbx),%ymm0 - vpsrld $10,%ymm0,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm6,%ymm6 - vpxor %ymm1,%ymm4,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm6,%ymm6 - vpsrld $6,%ymm15,%ymm7 - vpslld $26,%ymm15,%ymm2 - vmovdqu %ymm6,416-256-128(%rbx) - vpaddd %ymm10,%ymm6,%ymm6 - - vpsrld $11,%ymm15,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm15,%ymm2 - vpaddd 32(%rbp),%ymm6,%ymm6 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm15,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm15,%ymm2 - vpandn %ymm9,%ymm15,%ymm0 - vpand %ymm8,%ymm15,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm11,%ymm10 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm11,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm11,%ymm12,%ymm4 - - vpxor %ymm1,%ymm10,%ymm10 - vpaddd %ymm7,%ymm6,%ymm6 - - vpsrld $13,%ymm11,%ymm1 - - vpslld $19,%ymm11,%ymm2 - vpaddd %ymm0,%ymm6,%ymm6 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm10,%ymm7 - - vpsrld $22,%ymm11,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm11,%ymm2 - vpxor %ymm3,%ymm12,%ymm10 - vpaddd %ymm6,%ymm14,%ymm14 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm6,%ymm10,%ymm10 - vpaddd %ymm7,%ymm10,%ymm10 - vmovdqu 480-256-128(%rbx),%ymm6 - vpaddd 224-128(%rax),%ymm5,%ymm5 - - vpsrld $3,%ymm6,%ymm7 - vpsrld $7,%ymm6,%ymm1 - vpslld $25,%ymm6,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm6,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm6,%ymm2 - vmovdqu 384-256-128(%rbx),%ymm0 - vpsrld $10,%ymm0,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm5,%ymm5 - vpxor %ymm1,%ymm3,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm5,%ymm5 - vpsrld $6,%ymm14,%ymm7 - vpslld $26,%ymm14,%ymm2 - vmovdqu %ymm5,448-256-128(%rbx) - vpaddd %ymm9,%ymm5,%ymm5 - - vpsrld $11,%ymm14,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm14,%ymm2 - vpaddd 64(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm14,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm14,%ymm2 - vpandn %ymm8,%ymm14,%ymm0 - vpand %ymm15,%ymm14,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm10,%ymm9 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm10,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm10,%ymm11,%ymm3 - - vpxor %ymm1,%ymm9,%ymm9 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm10,%ymm1 - - vpslld $19,%ymm10,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm9,%ymm7 - - vpsrld $22,%ymm10,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm10,%ymm2 - vpxor %ymm4,%ymm11,%ymm9 - vpaddd %ymm5,%ymm13,%ymm13 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm9,%ymm9 - vpaddd %ymm7,%ymm9,%ymm9 - vmovdqu 0-128(%rax),%ymm5 - vpaddd 256-256-128(%rbx),%ymm6,%ymm6 - - vpsrld $3,%ymm5,%ymm7 - vpsrld $7,%ymm5,%ymm1 - vpslld $25,%ymm5,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm5,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm5,%ymm2 - vmovdqu 416-256-128(%rbx),%ymm0 - vpsrld $10,%ymm0,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm6,%ymm6 - vpxor %ymm1,%ymm4,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm6,%ymm6 - vpsrld $6,%ymm13,%ymm7 - vpslld $26,%ymm13,%ymm2 - vmovdqu %ymm6,480-256-128(%rbx) - vpaddd %ymm8,%ymm6,%ymm6 - - vpsrld $11,%ymm13,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm13,%ymm2 - vpaddd 96(%rbp),%ymm6,%ymm6 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm13,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm13,%ymm2 - vpandn %ymm15,%ymm13,%ymm0 - vpand %ymm14,%ymm13,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm9,%ymm8 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm9,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm9,%ymm10,%ymm4 - - vpxor %ymm1,%ymm8,%ymm8 - vpaddd %ymm7,%ymm6,%ymm6 - - vpsrld $13,%ymm9,%ymm1 - - vpslld $19,%ymm9,%ymm2 - vpaddd %ymm0,%ymm6,%ymm6 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm8,%ymm7 - - vpsrld $22,%ymm9,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm9,%ymm2 - vpxor %ymm3,%ymm10,%ymm8 - vpaddd %ymm6,%ymm12,%ymm12 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm6,%ymm8,%ymm8 - vpaddd %ymm7,%ymm8,%ymm8 - addq $256,%rbp - decl %ecx - jnz .Loop_16_xx_avx2 - - movl $1,%ecx - leaq 512(%rsp),%rbx - leaq K256+128(%rip),%rbp - cmpl 0(%rbx),%ecx - cmovgeq %rbp,%r12 - cmpl 4(%rbx),%ecx - cmovgeq %rbp,%r13 - cmpl 8(%rbx),%ecx - cmovgeq %rbp,%r14 - cmpl 12(%rbx),%ecx - cmovgeq %rbp,%r15 - cmpl 16(%rbx),%ecx - cmovgeq %rbp,%r8 - cmpl 20(%rbx),%ecx - cmovgeq %rbp,%r9 - cmpl 24(%rbx),%ecx - cmovgeq %rbp,%r10 - cmpl 28(%rbx),%ecx - cmovgeq %rbp,%r11 - vmovdqa (%rbx),%ymm7 - vpxor %ymm0,%ymm0,%ymm0 - vmovdqa %ymm7,%ymm6 - vpcmpgtd %ymm0,%ymm6,%ymm6 - vpaddd %ymm6,%ymm7,%ymm7 - - vmovdqu 0-128(%rdi),%ymm0 - vpand %ymm6,%ymm8,%ymm8 - vmovdqu 32-128(%rdi),%ymm1 - vpand %ymm6,%ymm9,%ymm9 - vmovdqu 64-128(%rdi),%ymm2 - vpand %ymm6,%ymm10,%ymm10 - vmovdqu 96-128(%rdi),%ymm5 - vpand %ymm6,%ymm11,%ymm11 - vpaddd %ymm0,%ymm8,%ymm8 - vmovdqu 128-128(%rdi),%ymm0 - vpand %ymm6,%ymm12,%ymm12 - vpaddd %ymm1,%ymm9,%ymm9 - vmovdqu 160-128(%rdi),%ymm1 - vpand %ymm6,%ymm13,%ymm13 - vpaddd %ymm2,%ymm10,%ymm10 - vmovdqu 192-128(%rdi),%ymm2 - vpand %ymm6,%ymm14,%ymm14 - vpaddd %ymm5,%ymm11,%ymm11 - vmovdqu 224-128(%rdi),%ymm5 - vpand %ymm6,%ymm15,%ymm15 - vpaddd %ymm0,%ymm12,%ymm12 - vpaddd %ymm1,%ymm13,%ymm13 - vmovdqu %ymm8,0-128(%rdi) - vpaddd %ymm2,%ymm14,%ymm14 - vmovdqu %ymm9,32-128(%rdi) - vpaddd %ymm5,%ymm15,%ymm15 - vmovdqu %ymm10,64-128(%rdi) - vmovdqu %ymm11,96-128(%rdi) - vmovdqu %ymm12,128-128(%rdi) - vmovdqu %ymm13,160-128(%rdi) - vmovdqu %ymm14,192-128(%rdi) - vmovdqu %ymm15,224-128(%rdi) - - vmovdqu %ymm7,(%rbx) - leaq 256+128(%rsp),%rbx - vmovdqu .Lpbswap(%rip),%ymm6 - decl %edx - jnz .Loop_avx2 - - - - - - - -.Ldone_avx2: - movq 544(%rsp),%rax - vzeroupper - movq -48(%rax),%r15 - movq -40(%rax),%r14 - movq -32(%rax),%r13 - movq -24(%rax),%r12 - movq -16(%rax),%rbp - movq -8(%rax),%rbx - leaq (%rax),%rsp -.Lepilogue_avx2: - .byte 0xf3,0xc3 -.size sha256_multi_block_avx2,.-sha256_multi_block_avx2 .align 256 K256: .long 1116352408,1116352408,1116352408,1116352408 diff --git a/deps/openssl/asm/x64-elf-gas/sha/sha256-x86_64.s b/deps/openssl/asm/x64-elf-gas/sha/sha256-x86_64.s index a2fbedaf8c6b9e..ab16a7b618820c 100644 --- a/deps/openssl/asm/x64-elf-gas/sha/sha256-x86_64.s +++ b/deps/openssl/asm/x64-elf-gas/sha/sha256-x86_64.s @@ -11,14 +11,6 @@ sha256_block_data_order: movl 8(%r11),%r11d testl $536870912,%r11d jnz _shaext_shortcut - andl $296,%r11d - cmpl $296,%r11d - je .Lavx2_shortcut - andl $1073741824,%r9d - andl $268435968,%r10d - orl %r9d,%r10d - cmpl $1342177792,%r10d - je .Lavx_shortcut testl $512,%r10d jnz .Lssse3_shortcut pushq %rbx @@ -1762,9 +1754,9 @@ _shaext_shortcut: movdqu 16(%rdi),%xmm2 movdqa 512-128(%rcx),%xmm7 - pshufd $27,%xmm1,%xmm0 - pshufd $177,%xmm1,%xmm1 - pshufd $27,%xmm2,%xmm2 + pshufd $0x1b,%xmm1,%xmm0 + pshufd $0xb1,%xmm1,%xmm1 + pshufd $0x1b,%xmm2,%xmm2 movdqa %xmm7,%xmm8 .byte 102,15,58,15,202,8 punpcklqdq %xmm0,%xmm2 @@ -1783,7 +1775,7 @@ _shaext_shortcut: .byte 102,15,56,0,231 movdqa %xmm2,%xmm10 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 nop movdqa %xmm1,%xmm9 .byte 15,56,203,202 @@ -1792,7 +1784,7 @@ _shaext_shortcut: paddd %xmm4,%xmm0 .byte 102,15,56,0,239 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 leaq 64(%rsi),%rsi .byte 15,56,204,220 .byte 15,56,203,202 @@ -1801,7 +1793,7 @@ _shaext_shortcut: paddd %xmm5,%xmm0 .byte 102,15,56,0,247 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm6,%xmm7 .byte 102,15,58,15,253,4 nop @@ -1813,7 +1805,7 @@ _shaext_shortcut: paddd %xmm6,%xmm0 .byte 15,56,205,222 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm3,%xmm7 .byte 102,15,58,15,254,4 nop @@ -1824,7 +1816,7 @@ _shaext_shortcut: paddd %xmm3,%xmm0 .byte 15,56,205,227 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm4,%xmm7 .byte 102,15,58,15,251,4 nop @@ -1835,7 +1827,7 @@ _shaext_shortcut: paddd %xmm4,%xmm0 .byte 15,56,205,236 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm5,%xmm7 .byte 102,15,58,15,252,4 nop @@ -1846,7 +1838,7 @@ _shaext_shortcut: paddd %xmm5,%xmm0 .byte 15,56,205,245 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm6,%xmm7 .byte 102,15,58,15,253,4 nop @@ -1857,7 +1849,7 @@ _shaext_shortcut: paddd %xmm6,%xmm0 .byte 15,56,205,222 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm3,%xmm7 .byte 102,15,58,15,254,4 nop @@ -1868,7 +1860,7 @@ _shaext_shortcut: paddd %xmm3,%xmm0 .byte 15,56,205,227 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm4,%xmm7 .byte 102,15,58,15,251,4 nop @@ -1879,7 +1871,7 @@ _shaext_shortcut: paddd %xmm4,%xmm0 .byte 15,56,205,236 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm5,%xmm7 .byte 102,15,58,15,252,4 nop @@ -1890,7 +1882,7 @@ _shaext_shortcut: paddd %xmm5,%xmm0 .byte 15,56,205,245 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm6,%xmm7 .byte 102,15,58,15,253,4 nop @@ -1901,7 +1893,7 @@ _shaext_shortcut: paddd %xmm6,%xmm0 .byte 15,56,205,222 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm3,%xmm7 .byte 102,15,58,15,254,4 nop @@ -1912,7 +1904,7 @@ _shaext_shortcut: paddd %xmm3,%xmm0 .byte 15,56,205,227 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm4,%xmm7 .byte 102,15,58,15,251,4 nop @@ -1923,7 +1915,7 @@ _shaext_shortcut: paddd %xmm4,%xmm0 .byte 15,56,205,236 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm5,%xmm7 .byte 102,15,58,15,252,4 .byte 15,56,203,202 @@ -1932,7 +1924,7 @@ _shaext_shortcut: movdqa 448-128(%rcx),%xmm0 paddd %xmm5,%xmm0 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 .byte 15,56,205,245 movdqa %xmm8,%xmm7 .byte 15,56,203,202 @@ -1941,7 +1933,7 @@ _shaext_shortcut: paddd %xmm6,%xmm0 nop .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 decq %rdx nop .byte 15,56,203,202 @@ -1950,9 +1942,9 @@ _shaext_shortcut: paddd %xmm9,%xmm1 jnz .Loop_shaext - pshufd $177,%xmm2,%xmm2 - pshufd $27,%xmm1,%xmm7 - pshufd $177,%xmm1,%xmm1 + pshufd $0xb1,%xmm2,%xmm2 + pshufd $0x1b,%xmm1,%xmm7 + pshufd $0xb1,%xmm1,%xmm1 punpckhqdq %xmm2,%xmm1 .byte 102,15,58,15,215,8 @@ -3055,2304 +3047,3 @@ sha256_block_data_order_ssse3: .Lepilogue_ssse3: .byte 0xf3,0xc3 .size sha256_block_data_order_ssse3,.-sha256_block_data_order_ssse3 -.type sha256_block_data_order_avx,@function -.align 64 -sha256_block_data_order_avx: -.Lavx_shortcut: - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - movq %rsp,%r11 - shlq $4,%rdx - subq $96,%rsp - leaq (%rsi,%rdx,4),%rdx - andq $-64,%rsp - movq %rdi,64+0(%rsp) - movq %rsi,64+8(%rsp) - movq %rdx,64+16(%rsp) - movq %r11,64+24(%rsp) -.Lprologue_avx: - - vzeroupper - movl 0(%rdi),%eax - movl 4(%rdi),%ebx - movl 8(%rdi),%ecx - movl 12(%rdi),%edx - movl 16(%rdi),%r8d - movl 20(%rdi),%r9d - movl 24(%rdi),%r10d - movl 28(%rdi),%r11d - vmovdqa K256+512+32(%rip),%xmm8 - vmovdqa K256+512+64(%rip),%xmm9 - jmp .Lloop_avx -.align 16 -.Lloop_avx: - vmovdqa K256+512(%rip),%xmm7 - vmovdqu 0(%rsi),%xmm0 - vmovdqu 16(%rsi),%xmm1 - vmovdqu 32(%rsi),%xmm2 - vmovdqu 48(%rsi),%xmm3 - vpshufb %xmm7,%xmm0,%xmm0 - leaq K256(%rip),%rbp - vpshufb %xmm7,%xmm1,%xmm1 - vpshufb %xmm7,%xmm2,%xmm2 - vpaddd 0(%rbp),%xmm0,%xmm4 - vpshufb %xmm7,%xmm3,%xmm3 - vpaddd 32(%rbp),%xmm1,%xmm5 - vpaddd 64(%rbp),%xmm2,%xmm6 - vpaddd 96(%rbp),%xmm3,%xmm7 - vmovdqa %xmm4,0(%rsp) - movl %eax,%r14d - vmovdqa %xmm5,16(%rsp) - movl %ebx,%edi - vmovdqa %xmm6,32(%rsp) - xorl %ecx,%edi - vmovdqa %xmm7,48(%rsp) - movl %r8d,%r13d - jmp .Lavx_00_47 - -.align 16 -.Lavx_00_47: - subq $-128,%rbp - vpalignr $4,%xmm0,%xmm1,%xmm4 - shrdl $14,%r13d,%r13d - movl %r14d,%eax - movl %r9d,%r12d - vpalignr $4,%xmm2,%xmm3,%xmm7 - shrdl $9,%r14d,%r14d - xorl %r8d,%r13d - xorl %r10d,%r12d - vpsrld $7,%xmm4,%xmm6 - shrdl $5,%r13d,%r13d - xorl %eax,%r14d - andl %r8d,%r12d - vpaddd %xmm7,%xmm0,%xmm0 - xorl %r8d,%r13d - addl 0(%rsp),%r11d - movl %eax,%r15d - vpsrld $3,%xmm4,%xmm7 - xorl %r10d,%r12d - shrdl $11,%r14d,%r14d - xorl %ebx,%r15d - vpslld $14,%xmm4,%xmm5 - addl %r12d,%r11d - shrdl $6,%r13d,%r13d - andl %r15d,%edi - vpxor %xmm6,%xmm7,%xmm4 - xorl %eax,%r14d - addl %r13d,%r11d - xorl %ebx,%edi - vpshufd $250,%xmm3,%xmm7 - shrdl $2,%r14d,%r14d - addl %r11d,%edx - addl %edi,%r11d - vpsrld $11,%xmm6,%xmm6 - movl %edx,%r13d - addl %r11d,%r14d - shrdl $14,%r13d,%r13d - vpxor %xmm5,%xmm4,%xmm4 - movl %r14d,%r11d - movl %r8d,%r12d - shrdl $9,%r14d,%r14d - vpslld $11,%xmm5,%xmm5 - xorl %edx,%r13d - xorl %r9d,%r12d - shrdl $5,%r13d,%r13d - vpxor %xmm6,%xmm4,%xmm4 - xorl %r11d,%r14d - andl %edx,%r12d - xorl %edx,%r13d - vpsrld $10,%xmm7,%xmm6 - addl 4(%rsp),%r10d - movl %r11d,%edi - xorl %r9d,%r12d - vpxor %xmm5,%xmm4,%xmm4 - shrdl $11,%r14d,%r14d - xorl %eax,%edi - addl %r12d,%r10d - vpsrlq $17,%xmm7,%xmm7 - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %r11d,%r14d - vpaddd %xmm4,%xmm0,%xmm0 - addl %r13d,%r10d - xorl %eax,%r15d - shrdl $2,%r14d,%r14d - vpxor %xmm7,%xmm6,%xmm6 - addl %r10d,%ecx - addl %r15d,%r10d - movl %ecx,%r13d - vpsrlq $2,%xmm7,%xmm7 - addl %r10d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r10d - vpxor %xmm7,%xmm6,%xmm6 - movl %edx,%r12d - shrdl $9,%r14d,%r14d - xorl %ecx,%r13d - vpshufb %xmm8,%xmm6,%xmm6 - xorl %r8d,%r12d - shrdl $5,%r13d,%r13d - xorl %r10d,%r14d - vpaddd %xmm6,%xmm0,%xmm0 - andl %ecx,%r12d - xorl %ecx,%r13d - addl 8(%rsp),%r9d - vpshufd $80,%xmm0,%xmm7 - movl %r10d,%r15d - xorl %r8d,%r12d - shrdl $11,%r14d,%r14d - vpsrld $10,%xmm7,%xmm6 - xorl %r11d,%r15d - addl %r12d,%r9d - shrdl $6,%r13d,%r13d - vpsrlq $17,%xmm7,%xmm7 - andl %r15d,%edi - xorl %r10d,%r14d - addl %r13d,%r9d - vpxor %xmm7,%xmm6,%xmm6 - xorl %r11d,%edi - shrdl $2,%r14d,%r14d - addl %r9d,%ebx - vpsrlq $2,%xmm7,%xmm7 - addl %edi,%r9d - movl %ebx,%r13d - addl %r9d,%r14d - vpxor %xmm7,%xmm6,%xmm6 - shrdl $14,%r13d,%r13d - movl %r14d,%r9d - movl %ecx,%r12d - vpshufb %xmm9,%xmm6,%xmm6 - shrdl $9,%r14d,%r14d - xorl %ebx,%r13d - xorl %edx,%r12d - vpaddd %xmm6,%xmm0,%xmm0 - shrdl $5,%r13d,%r13d - xorl %r9d,%r14d - andl %ebx,%r12d - vpaddd 0(%rbp),%xmm0,%xmm6 - xorl %ebx,%r13d - addl 12(%rsp),%r8d - movl %r9d,%edi - xorl %edx,%r12d - shrdl $11,%r14d,%r14d - xorl %r10d,%edi - addl %r12d,%r8d - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %r9d,%r14d - addl %r13d,%r8d - xorl %r10d,%r15d - shrdl $2,%r14d,%r14d - addl %r8d,%eax - addl %r15d,%r8d - movl %eax,%r13d - addl %r8d,%r14d - vmovdqa %xmm6,0(%rsp) - vpalignr $4,%xmm1,%xmm2,%xmm4 - shrdl $14,%r13d,%r13d - movl %r14d,%r8d - movl %ebx,%r12d - vpalignr $4,%xmm3,%xmm0,%xmm7 - shrdl $9,%r14d,%r14d - xorl %eax,%r13d - xorl %ecx,%r12d - vpsrld $7,%xmm4,%xmm6 - shrdl $5,%r13d,%r13d - xorl %r8d,%r14d - andl %eax,%r12d - vpaddd %xmm7,%xmm1,%xmm1 - xorl %eax,%r13d - addl 16(%rsp),%edx - movl %r8d,%r15d - vpsrld $3,%xmm4,%xmm7 - xorl %ecx,%r12d - shrdl $11,%r14d,%r14d - xorl %r9d,%r15d - vpslld $14,%xmm4,%xmm5 - addl %r12d,%edx - shrdl $6,%r13d,%r13d - andl %r15d,%edi - vpxor %xmm6,%xmm7,%xmm4 - xorl %r8d,%r14d - addl %r13d,%edx - xorl %r9d,%edi - vpshufd $250,%xmm0,%xmm7 - shrdl $2,%r14d,%r14d - addl %edx,%r11d - addl %edi,%edx - vpsrld $11,%xmm6,%xmm6 - movl %r11d,%r13d - addl %edx,%r14d - shrdl $14,%r13d,%r13d - vpxor %xmm5,%xmm4,%xmm4 - movl %r14d,%edx - movl %eax,%r12d - shrdl $9,%r14d,%r14d - vpslld $11,%xmm5,%xmm5 - xorl %r11d,%r13d - xorl %ebx,%r12d - shrdl $5,%r13d,%r13d - vpxor %xmm6,%xmm4,%xmm4 - xorl %edx,%r14d - andl %r11d,%r12d - xorl %r11d,%r13d - vpsrld $10,%xmm7,%xmm6 - addl 20(%rsp),%ecx - movl %edx,%edi - xorl %ebx,%r12d - vpxor %xmm5,%xmm4,%xmm4 - shrdl $11,%r14d,%r14d - xorl %r8d,%edi - addl %r12d,%ecx - vpsrlq $17,%xmm7,%xmm7 - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %edx,%r14d - vpaddd %xmm4,%xmm1,%xmm1 - addl %r13d,%ecx - xorl %r8d,%r15d - shrdl $2,%r14d,%r14d - vpxor %xmm7,%xmm6,%xmm6 - addl %ecx,%r10d - addl %r15d,%ecx - movl %r10d,%r13d - vpsrlq $2,%xmm7,%xmm7 - addl %ecx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%ecx - vpxor %xmm7,%xmm6,%xmm6 - movl %r11d,%r12d - shrdl $9,%r14d,%r14d - xorl %r10d,%r13d - vpshufb %xmm8,%xmm6,%xmm6 - xorl %eax,%r12d - shrdl $5,%r13d,%r13d - xorl %ecx,%r14d - vpaddd %xmm6,%xmm1,%xmm1 - andl %r10d,%r12d - xorl %r10d,%r13d - addl 24(%rsp),%ebx - vpshufd $80,%xmm1,%xmm7 - movl %ecx,%r15d - xorl %eax,%r12d - shrdl $11,%r14d,%r14d - vpsrld $10,%xmm7,%xmm6 - xorl %edx,%r15d - addl %r12d,%ebx - shrdl $6,%r13d,%r13d - vpsrlq $17,%xmm7,%xmm7 - andl %r15d,%edi - xorl %ecx,%r14d - addl %r13d,%ebx - vpxor %xmm7,%xmm6,%xmm6 - xorl %edx,%edi - shrdl $2,%r14d,%r14d - addl %ebx,%r9d - vpsrlq $2,%xmm7,%xmm7 - addl %edi,%ebx - movl %r9d,%r13d - addl %ebx,%r14d - vpxor %xmm7,%xmm6,%xmm6 - shrdl $14,%r13d,%r13d - movl %r14d,%ebx - movl %r10d,%r12d - vpshufb %xmm9,%xmm6,%xmm6 - shrdl $9,%r14d,%r14d - xorl %r9d,%r13d - xorl %r11d,%r12d - vpaddd %xmm6,%xmm1,%xmm1 - shrdl $5,%r13d,%r13d - xorl %ebx,%r14d - andl %r9d,%r12d - vpaddd 32(%rbp),%xmm1,%xmm6 - xorl %r9d,%r13d - addl 28(%rsp),%eax - movl %ebx,%edi - xorl %r11d,%r12d - shrdl $11,%r14d,%r14d - xorl %ecx,%edi - addl %r12d,%eax - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %ebx,%r14d - addl %r13d,%eax - xorl %ecx,%r15d - shrdl $2,%r14d,%r14d - addl %eax,%r8d - addl %r15d,%eax - movl %r8d,%r13d - addl %eax,%r14d - vmovdqa %xmm6,16(%rsp) - vpalignr $4,%xmm2,%xmm3,%xmm4 - shrdl $14,%r13d,%r13d - movl %r14d,%eax - movl %r9d,%r12d - vpalignr $4,%xmm0,%xmm1,%xmm7 - shrdl $9,%r14d,%r14d - xorl %r8d,%r13d - xorl %r10d,%r12d - vpsrld $7,%xmm4,%xmm6 - shrdl $5,%r13d,%r13d - xorl %eax,%r14d - andl %r8d,%r12d - vpaddd %xmm7,%xmm2,%xmm2 - xorl %r8d,%r13d - addl 32(%rsp),%r11d - movl %eax,%r15d - vpsrld $3,%xmm4,%xmm7 - xorl %r10d,%r12d - shrdl $11,%r14d,%r14d - xorl %ebx,%r15d - vpslld $14,%xmm4,%xmm5 - addl %r12d,%r11d - shrdl $6,%r13d,%r13d - andl %r15d,%edi - vpxor %xmm6,%xmm7,%xmm4 - xorl %eax,%r14d - addl %r13d,%r11d - xorl %ebx,%edi - vpshufd $250,%xmm1,%xmm7 - shrdl $2,%r14d,%r14d - addl %r11d,%edx - addl %edi,%r11d - vpsrld $11,%xmm6,%xmm6 - movl %edx,%r13d - addl %r11d,%r14d - shrdl $14,%r13d,%r13d - vpxor %xmm5,%xmm4,%xmm4 - movl %r14d,%r11d - movl %r8d,%r12d - shrdl $9,%r14d,%r14d - vpslld $11,%xmm5,%xmm5 - xorl %edx,%r13d - xorl %r9d,%r12d - shrdl $5,%r13d,%r13d - vpxor %xmm6,%xmm4,%xmm4 - xorl %r11d,%r14d - andl %edx,%r12d - xorl %edx,%r13d - vpsrld $10,%xmm7,%xmm6 - addl 36(%rsp),%r10d - movl %r11d,%edi - xorl %r9d,%r12d - vpxor %xmm5,%xmm4,%xmm4 - shrdl $11,%r14d,%r14d - xorl %eax,%edi - addl %r12d,%r10d - vpsrlq $17,%xmm7,%xmm7 - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %r11d,%r14d - vpaddd %xmm4,%xmm2,%xmm2 - addl %r13d,%r10d - xorl %eax,%r15d - shrdl $2,%r14d,%r14d - vpxor %xmm7,%xmm6,%xmm6 - addl %r10d,%ecx - addl %r15d,%r10d - movl %ecx,%r13d - vpsrlq $2,%xmm7,%xmm7 - addl %r10d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r10d - vpxor %xmm7,%xmm6,%xmm6 - movl %edx,%r12d - shrdl $9,%r14d,%r14d - xorl %ecx,%r13d - vpshufb %xmm8,%xmm6,%xmm6 - xorl %r8d,%r12d - shrdl $5,%r13d,%r13d - xorl %r10d,%r14d - vpaddd %xmm6,%xmm2,%xmm2 - andl %ecx,%r12d - xorl %ecx,%r13d - addl 40(%rsp),%r9d - vpshufd $80,%xmm2,%xmm7 - movl %r10d,%r15d - xorl %r8d,%r12d - shrdl $11,%r14d,%r14d - vpsrld $10,%xmm7,%xmm6 - xorl %r11d,%r15d - addl %r12d,%r9d - shrdl $6,%r13d,%r13d - vpsrlq $17,%xmm7,%xmm7 - andl %r15d,%edi - xorl %r10d,%r14d - addl %r13d,%r9d - vpxor %xmm7,%xmm6,%xmm6 - xorl %r11d,%edi - shrdl $2,%r14d,%r14d - addl %r9d,%ebx - vpsrlq $2,%xmm7,%xmm7 - addl %edi,%r9d - movl %ebx,%r13d - addl %r9d,%r14d - vpxor %xmm7,%xmm6,%xmm6 - shrdl $14,%r13d,%r13d - movl %r14d,%r9d - movl %ecx,%r12d - vpshufb %xmm9,%xmm6,%xmm6 - shrdl $9,%r14d,%r14d - xorl %ebx,%r13d - xorl %edx,%r12d - vpaddd %xmm6,%xmm2,%xmm2 - shrdl $5,%r13d,%r13d - xorl %r9d,%r14d - andl %ebx,%r12d - vpaddd 64(%rbp),%xmm2,%xmm6 - xorl %ebx,%r13d - addl 44(%rsp),%r8d - movl %r9d,%edi - xorl %edx,%r12d - shrdl $11,%r14d,%r14d - xorl %r10d,%edi - addl %r12d,%r8d - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %r9d,%r14d - addl %r13d,%r8d - xorl %r10d,%r15d - shrdl $2,%r14d,%r14d - addl %r8d,%eax - addl %r15d,%r8d - movl %eax,%r13d - addl %r8d,%r14d - vmovdqa %xmm6,32(%rsp) - vpalignr $4,%xmm3,%xmm0,%xmm4 - shrdl $14,%r13d,%r13d - movl %r14d,%r8d - movl %ebx,%r12d - vpalignr $4,%xmm1,%xmm2,%xmm7 - shrdl $9,%r14d,%r14d - xorl %eax,%r13d - xorl %ecx,%r12d - vpsrld $7,%xmm4,%xmm6 - shrdl $5,%r13d,%r13d - xorl %r8d,%r14d - andl %eax,%r12d - vpaddd %xmm7,%xmm3,%xmm3 - xorl %eax,%r13d - addl 48(%rsp),%edx - movl %r8d,%r15d - vpsrld $3,%xmm4,%xmm7 - xorl %ecx,%r12d - shrdl $11,%r14d,%r14d - xorl %r9d,%r15d - vpslld $14,%xmm4,%xmm5 - addl %r12d,%edx - shrdl $6,%r13d,%r13d - andl %r15d,%edi - vpxor %xmm6,%xmm7,%xmm4 - xorl %r8d,%r14d - addl %r13d,%edx - xorl %r9d,%edi - vpshufd $250,%xmm2,%xmm7 - shrdl $2,%r14d,%r14d - addl %edx,%r11d - addl %edi,%edx - vpsrld $11,%xmm6,%xmm6 - movl %r11d,%r13d - addl %edx,%r14d - shrdl $14,%r13d,%r13d - vpxor %xmm5,%xmm4,%xmm4 - movl %r14d,%edx - movl %eax,%r12d - shrdl $9,%r14d,%r14d - vpslld $11,%xmm5,%xmm5 - xorl %r11d,%r13d - xorl %ebx,%r12d - shrdl $5,%r13d,%r13d - vpxor %xmm6,%xmm4,%xmm4 - xorl %edx,%r14d - andl %r11d,%r12d - xorl %r11d,%r13d - vpsrld $10,%xmm7,%xmm6 - addl 52(%rsp),%ecx - movl %edx,%edi - xorl %ebx,%r12d - vpxor %xmm5,%xmm4,%xmm4 - shrdl $11,%r14d,%r14d - xorl %r8d,%edi - addl %r12d,%ecx - vpsrlq $17,%xmm7,%xmm7 - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %edx,%r14d - vpaddd %xmm4,%xmm3,%xmm3 - addl %r13d,%ecx - xorl %r8d,%r15d - shrdl $2,%r14d,%r14d - vpxor %xmm7,%xmm6,%xmm6 - addl %ecx,%r10d - addl %r15d,%ecx - movl %r10d,%r13d - vpsrlq $2,%xmm7,%xmm7 - addl %ecx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%ecx - vpxor %xmm7,%xmm6,%xmm6 - movl %r11d,%r12d - shrdl $9,%r14d,%r14d - xorl %r10d,%r13d - vpshufb %xmm8,%xmm6,%xmm6 - xorl %eax,%r12d - shrdl $5,%r13d,%r13d - xorl %ecx,%r14d - vpaddd %xmm6,%xmm3,%xmm3 - andl %r10d,%r12d - xorl %r10d,%r13d - addl 56(%rsp),%ebx - vpshufd $80,%xmm3,%xmm7 - movl %ecx,%r15d - xorl %eax,%r12d - shrdl $11,%r14d,%r14d - vpsrld $10,%xmm7,%xmm6 - xorl %edx,%r15d - addl %r12d,%ebx - shrdl $6,%r13d,%r13d - vpsrlq $17,%xmm7,%xmm7 - andl %r15d,%edi - xorl %ecx,%r14d - addl %r13d,%ebx - vpxor %xmm7,%xmm6,%xmm6 - xorl %edx,%edi - shrdl $2,%r14d,%r14d - addl %ebx,%r9d - vpsrlq $2,%xmm7,%xmm7 - addl %edi,%ebx - movl %r9d,%r13d - addl %ebx,%r14d - vpxor %xmm7,%xmm6,%xmm6 - shrdl $14,%r13d,%r13d - movl %r14d,%ebx - movl %r10d,%r12d - vpshufb %xmm9,%xmm6,%xmm6 - shrdl $9,%r14d,%r14d - xorl %r9d,%r13d - xorl %r11d,%r12d - vpaddd %xmm6,%xmm3,%xmm3 - shrdl $5,%r13d,%r13d - xorl %ebx,%r14d - andl %r9d,%r12d - vpaddd 96(%rbp),%xmm3,%xmm6 - xorl %r9d,%r13d - addl 60(%rsp),%eax - movl %ebx,%edi - xorl %r11d,%r12d - shrdl $11,%r14d,%r14d - xorl %ecx,%edi - addl %r12d,%eax - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %ebx,%r14d - addl %r13d,%eax - xorl %ecx,%r15d - shrdl $2,%r14d,%r14d - addl %eax,%r8d - addl %r15d,%eax - movl %r8d,%r13d - addl %eax,%r14d - vmovdqa %xmm6,48(%rsp) - cmpb $0,131(%rbp) - jne .Lavx_00_47 - shrdl $14,%r13d,%r13d - movl %r14d,%eax - movl %r9d,%r12d - shrdl $9,%r14d,%r14d - xorl %r8d,%r13d - xorl %r10d,%r12d - shrdl $5,%r13d,%r13d - xorl %eax,%r14d - andl %r8d,%r12d - xorl %r8d,%r13d - addl 0(%rsp),%r11d - movl %eax,%r15d - xorl %r10d,%r12d - shrdl $11,%r14d,%r14d - xorl %ebx,%r15d - addl %r12d,%r11d - shrdl $6,%r13d,%r13d - andl %r15d,%edi - xorl %eax,%r14d - addl %r13d,%r11d - xorl %ebx,%edi - shrdl $2,%r14d,%r14d - addl %r11d,%edx - addl %edi,%r11d - movl %edx,%r13d - addl %r11d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r11d - movl %r8d,%r12d - shrdl $9,%r14d,%r14d - xorl %edx,%r13d - xorl %r9d,%r12d - shrdl $5,%r13d,%r13d - xorl %r11d,%r14d - andl %edx,%r12d - xorl %edx,%r13d - addl 4(%rsp),%r10d - movl %r11d,%edi - xorl %r9d,%r12d - shrdl $11,%r14d,%r14d - xorl %eax,%edi - addl %r12d,%r10d - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %r11d,%r14d - addl %r13d,%r10d - xorl %eax,%r15d - shrdl $2,%r14d,%r14d - addl %r10d,%ecx - addl %r15d,%r10d - movl %ecx,%r13d - addl %r10d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r10d - movl %edx,%r12d - shrdl $9,%r14d,%r14d - xorl %ecx,%r13d - xorl %r8d,%r12d - shrdl $5,%r13d,%r13d - xorl %r10d,%r14d - andl %ecx,%r12d - xorl %ecx,%r13d - addl 8(%rsp),%r9d - movl %r10d,%r15d - xorl %r8d,%r12d - shrdl $11,%r14d,%r14d - xorl %r11d,%r15d - addl %r12d,%r9d - shrdl $6,%r13d,%r13d - andl %r15d,%edi - xorl %r10d,%r14d - addl %r13d,%r9d - xorl %r11d,%edi - shrdl $2,%r14d,%r14d - addl %r9d,%ebx - addl %edi,%r9d - movl %ebx,%r13d - addl %r9d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r9d - movl %ecx,%r12d - shrdl $9,%r14d,%r14d - xorl %ebx,%r13d - xorl %edx,%r12d - shrdl $5,%r13d,%r13d - xorl %r9d,%r14d - andl %ebx,%r12d - xorl %ebx,%r13d - addl 12(%rsp),%r8d - movl %r9d,%edi - xorl %edx,%r12d - shrdl $11,%r14d,%r14d - xorl %r10d,%edi - addl %r12d,%r8d - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %r9d,%r14d - addl %r13d,%r8d - xorl %r10d,%r15d - shrdl $2,%r14d,%r14d - addl %r8d,%eax - addl %r15d,%r8d - movl %eax,%r13d - addl %r8d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r8d - movl %ebx,%r12d - shrdl $9,%r14d,%r14d - xorl %eax,%r13d - xorl %ecx,%r12d - shrdl $5,%r13d,%r13d - xorl %r8d,%r14d - andl %eax,%r12d - xorl %eax,%r13d - addl 16(%rsp),%edx - movl %r8d,%r15d - xorl %ecx,%r12d - shrdl $11,%r14d,%r14d - xorl %r9d,%r15d - addl %r12d,%edx - shrdl $6,%r13d,%r13d - andl %r15d,%edi - xorl %r8d,%r14d - addl %r13d,%edx - xorl %r9d,%edi - shrdl $2,%r14d,%r14d - addl %edx,%r11d - addl %edi,%edx - movl %r11d,%r13d - addl %edx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%edx - movl %eax,%r12d - shrdl $9,%r14d,%r14d - xorl %r11d,%r13d - xorl %ebx,%r12d - shrdl $5,%r13d,%r13d - xorl %edx,%r14d - andl %r11d,%r12d - xorl %r11d,%r13d - addl 20(%rsp),%ecx - movl %edx,%edi - xorl %ebx,%r12d - shrdl $11,%r14d,%r14d - xorl %r8d,%edi - addl %r12d,%ecx - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %edx,%r14d - addl %r13d,%ecx - xorl %r8d,%r15d - shrdl $2,%r14d,%r14d - addl %ecx,%r10d - addl %r15d,%ecx - movl %r10d,%r13d - addl %ecx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%ecx - movl %r11d,%r12d - shrdl $9,%r14d,%r14d - xorl %r10d,%r13d - xorl %eax,%r12d - shrdl $5,%r13d,%r13d - xorl %ecx,%r14d - andl %r10d,%r12d - xorl %r10d,%r13d - addl 24(%rsp),%ebx - movl %ecx,%r15d - xorl %eax,%r12d - shrdl $11,%r14d,%r14d - xorl %edx,%r15d - addl %r12d,%ebx - shrdl $6,%r13d,%r13d - andl %r15d,%edi - xorl %ecx,%r14d - addl %r13d,%ebx - xorl %edx,%edi - shrdl $2,%r14d,%r14d - addl %ebx,%r9d - addl %edi,%ebx - movl %r9d,%r13d - addl %ebx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%ebx - movl %r10d,%r12d - shrdl $9,%r14d,%r14d - xorl %r9d,%r13d - xorl %r11d,%r12d - shrdl $5,%r13d,%r13d - xorl %ebx,%r14d - andl %r9d,%r12d - xorl %r9d,%r13d - addl 28(%rsp),%eax - movl %ebx,%edi - xorl %r11d,%r12d - shrdl $11,%r14d,%r14d - xorl %ecx,%edi - addl %r12d,%eax - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %ebx,%r14d - addl %r13d,%eax - xorl %ecx,%r15d - shrdl $2,%r14d,%r14d - addl %eax,%r8d - addl %r15d,%eax - movl %r8d,%r13d - addl %eax,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%eax - movl %r9d,%r12d - shrdl $9,%r14d,%r14d - xorl %r8d,%r13d - xorl %r10d,%r12d - shrdl $5,%r13d,%r13d - xorl %eax,%r14d - andl %r8d,%r12d - xorl %r8d,%r13d - addl 32(%rsp),%r11d - movl %eax,%r15d - xorl %r10d,%r12d - shrdl $11,%r14d,%r14d - xorl %ebx,%r15d - addl %r12d,%r11d - shrdl $6,%r13d,%r13d - andl %r15d,%edi - xorl %eax,%r14d - addl %r13d,%r11d - xorl %ebx,%edi - shrdl $2,%r14d,%r14d - addl %r11d,%edx - addl %edi,%r11d - movl %edx,%r13d - addl %r11d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r11d - movl %r8d,%r12d - shrdl $9,%r14d,%r14d - xorl %edx,%r13d - xorl %r9d,%r12d - shrdl $5,%r13d,%r13d - xorl %r11d,%r14d - andl %edx,%r12d - xorl %edx,%r13d - addl 36(%rsp),%r10d - movl %r11d,%edi - xorl %r9d,%r12d - shrdl $11,%r14d,%r14d - xorl %eax,%edi - addl %r12d,%r10d - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %r11d,%r14d - addl %r13d,%r10d - xorl %eax,%r15d - shrdl $2,%r14d,%r14d - addl %r10d,%ecx - addl %r15d,%r10d - movl %ecx,%r13d - addl %r10d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r10d - movl %edx,%r12d - shrdl $9,%r14d,%r14d - xorl %ecx,%r13d - xorl %r8d,%r12d - shrdl $5,%r13d,%r13d - xorl %r10d,%r14d - andl %ecx,%r12d - xorl %ecx,%r13d - addl 40(%rsp),%r9d - movl %r10d,%r15d - xorl %r8d,%r12d - shrdl $11,%r14d,%r14d - xorl %r11d,%r15d - addl %r12d,%r9d - shrdl $6,%r13d,%r13d - andl %r15d,%edi - xorl %r10d,%r14d - addl %r13d,%r9d - xorl %r11d,%edi - shrdl $2,%r14d,%r14d - addl %r9d,%ebx - addl %edi,%r9d - movl %ebx,%r13d - addl %r9d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r9d - movl %ecx,%r12d - shrdl $9,%r14d,%r14d - xorl %ebx,%r13d - xorl %edx,%r12d - shrdl $5,%r13d,%r13d - xorl %r9d,%r14d - andl %ebx,%r12d - xorl %ebx,%r13d - addl 44(%rsp),%r8d - movl %r9d,%edi - xorl %edx,%r12d - shrdl $11,%r14d,%r14d - xorl %r10d,%edi - addl %r12d,%r8d - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %r9d,%r14d - addl %r13d,%r8d - xorl %r10d,%r15d - shrdl $2,%r14d,%r14d - addl %r8d,%eax - addl %r15d,%r8d - movl %eax,%r13d - addl %r8d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r8d - movl %ebx,%r12d - shrdl $9,%r14d,%r14d - xorl %eax,%r13d - xorl %ecx,%r12d - shrdl $5,%r13d,%r13d - xorl %r8d,%r14d - andl %eax,%r12d - xorl %eax,%r13d - addl 48(%rsp),%edx - movl %r8d,%r15d - xorl %ecx,%r12d - shrdl $11,%r14d,%r14d - xorl %r9d,%r15d - addl %r12d,%edx - shrdl $6,%r13d,%r13d - andl %r15d,%edi - xorl %r8d,%r14d - addl %r13d,%edx - xorl %r9d,%edi - shrdl $2,%r14d,%r14d - addl %edx,%r11d - addl %edi,%edx - movl %r11d,%r13d - addl %edx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%edx - movl %eax,%r12d - shrdl $9,%r14d,%r14d - xorl %r11d,%r13d - xorl %ebx,%r12d - shrdl $5,%r13d,%r13d - xorl %edx,%r14d - andl %r11d,%r12d - xorl %r11d,%r13d - addl 52(%rsp),%ecx - movl %edx,%edi - xorl %ebx,%r12d - shrdl $11,%r14d,%r14d - xorl %r8d,%edi - addl %r12d,%ecx - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %edx,%r14d - addl %r13d,%ecx - xorl %r8d,%r15d - shrdl $2,%r14d,%r14d - addl %ecx,%r10d - addl %r15d,%ecx - movl %r10d,%r13d - addl %ecx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%ecx - movl %r11d,%r12d - shrdl $9,%r14d,%r14d - xorl %r10d,%r13d - xorl %eax,%r12d - shrdl $5,%r13d,%r13d - xorl %ecx,%r14d - andl %r10d,%r12d - xorl %r10d,%r13d - addl 56(%rsp),%ebx - movl %ecx,%r15d - xorl %eax,%r12d - shrdl $11,%r14d,%r14d - xorl %edx,%r15d - addl %r12d,%ebx - shrdl $6,%r13d,%r13d - andl %r15d,%edi - xorl %ecx,%r14d - addl %r13d,%ebx - xorl %edx,%edi - shrdl $2,%r14d,%r14d - addl %ebx,%r9d - addl %edi,%ebx - movl %r9d,%r13d - addl %ebx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%ebx - movl %r10d,%r12d - shrdl $9,%r14d,%r14d - xorl %r9d,%r13d - xorl %r11d,%r12d - shrdl $5,%r13d,%r13d - xorl %ebx,%r14d - andl %r9d,%r12d - xorl %r9d,%r13d - addl 60(%rsp),%eax - movl %ebx,%edi - xorl %r11d,%r12d - shrdl $11,%r14d,%r14d - xorl %ecx,%edi - addl %r12d,%eax - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %ebx,%r14d - addl %r13d,%eax - xorl %ecx,%r15d - shrdl $2,%r14d,%r14d - addl %eax,%r8d - addl %r15d,%eax - movl %r8d,%r13d - addl %eax,%r14d - movq 64+0(%rsp),%rdi - movl %r14d,%eax - - addl 0(%rdi),%eax - leaq 64(%rsi),%rsi - addl 4(%rdi),%ebx - addl 8(%rdi),%ecx - addl 12(%rdi),%edx - addl 16(%rdi),%r8d - addl 20(%rdi),%r9d - addl 24(%rdi),%r10d - addl 28(%rdi),%r11d - - cmpq 64+16(%rsp),%rsi - - movl %eax,0(%rdi) - movl %ebx,4(%rdi) - movl %ecx,8(%rdi) - movl %edx,12(%rdi) - movl %r8d,16(%rdi) - movl %r9d,20(%rdi) - movl %r10d,24(%rdi) - movl %r11d,28(%rdi) - jb .Lloop_avx - - movq 64+24(%rsp),%rsi - vzeroupper - movq (%rsi),%r15 - movq 8(%rsi),%r14 - movq 16(%rsi),%r13 - movq 24(%rsi),%r12 - movq 32(%rsi),%rbp - movq 40(%rsi),%rbx - leaq 48(%rsi),%rsp -.Lepilogue_avx: - .byte 0xf3,0xc3 -.size sha256_block_data_order_avx,.-sha256_block_data_order_avx -.type sha256_block_data_order_avx2,@function -.align 64 -sha256_block_data_order_avx2: -.Lavx2_shortcut: - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - movq %rsp,%r11 - subq $544,%rsp - shlq $4,%rdx - andq $-1024,%rsp - leaq (%rsi,%rdx,4),%rdx - addq $448,%rsp - movq %rdi,64+0(%rsp) - movq %rsi,64+8(%rsp) - movq %rdx,64+16(%rsp) - movq %r11,64+24(%rsp) -.Lprologue_avx2: - - vzeroupper - subq $-64,%rsi - movl 0(%rdi),%eax - movq %rsi,%r12 - movl 4(%rdi),%ebx - cmpq %rdx,%rsi - movl 8(%rdi),%ecx - cmoveq %rsp,%r12 - movl 12(%rdi),%edx - movl 16(%rdi),%r8d - movl 20(%rdi),%r9d - movl 24(%rdi),%r10d - movl 28(%rdi),%r11d - vmovdqa K256+512+32(%rip),%ymm8 - vmovdqa K256+512+64(%rip),%ymm9 - jmp .Loop_avx2 -.align 16 -.Loop_avx2: - vmovdqa K256+512(%rip),%ymm7 - vmovdqu -64+0(%rsi),%xmm0 - vmovdqu -64+16(%rsi),%xmm1 - vmovdqu -64+32(%rsi),%xmm2 - vmovdqu -64+48(%rsi),%xmm3 - - vinserti128 $1,(%r12),%ymm0,%ymm0 - vinserti128 $1,16(%r12),%ymm1,%ymm1 - vpshufb %ymm7,%ymm0,%ymm0 - vinserti128 $1,32(%r12),%ymm2,%ymm2 - vpshufb %ymm7,%ymm1,%ymm1 - vinserti128 $1,48(%r12),%ymm3,%ymm3 - - leaq K256(%rip),%rbp - vpshufb %ymm7,%ymm2,%ymm2 - vpaddd 0(%rbp),%ymm0,%ymm4 - vpshufb %ymm7,%ymm3,%ymm3 - vpaddd 32(%rbp),%ymm1,%ymm5 - vpaddd 64(%rbp),%ymm2,%ymm6 - vpaddd 96(%rbp),%ymm3,%ymm7 - vmovdqa %ymm4,0(%rsp) - xorl %r14d,%r14d - vmovdqa %ymm5,32(%rsp) - leaq -64(%rsp),%rsp - movl %ebx,%edi - vmovdqa %ymm6,0(%rsp) - xorl %ecx,%edi - vmovdqa %ymm7,32(%rsp) - movl %r9d,%r12d - subq $-32*4,%rbp - jmp .Lavx2_00_47 - -.align 16 -.Lavx2_00_47: - leaq -64(%rsp),%rsp - vpalignr $4,%ymm0,%ymm1,%ymm4 - addl 0+128(%rsp),%r11d - andl %r8d,%r12d - rorxl $25,%r8d,%r13d - vpalignr $4,%ymm2,%ymm3,%ymm7 - rorxl $11,%r8d,%r15d - leal (%rax,%r14,1),%eax - leal (%r11,%r12,1),%r11d - vpsrld $7,%ymm4,%ymm6 - andnl %r10d,%r8d,%r12d - xorl %r15d,%r13d - rorxl $6,%r8d,%r14d - vpaddd %ymm7,%ymm0,%ymm0 - leal (%r11,%r12,1),%r11d - xorl %r14d,%r13d - movl %eax,%r15d - vpsrld $3,%ymm4,%ymm7 - rorxl $22,%eax,%r12d - leal (%r11,%r13,1),%r11d - xorl %ebx,%r15d - vpslld $14,%ymm4,%ymm5 - rorxl $13,%eax,%r14d - rorxl $2,%eax,%r13d - leal (%rdx,%r11,1),%edx - vpxor %ymm6,%ymm7,%ymm4 - andl %r15d,%edi - xorl %r12d,%r14d - xorl %ebx,%edi - vpshufd $250,%ymm3,%ymm7 - xorl %r13d,%r14d - leal (%r11,%rdi,1),%r11d - movl %r8d,%r12d - vpsrld $11,%ymm6,%ymm6 - addl 4+128(%rsp),%r10d - andl %edx,%r12d - rorxl $25,%edx,%r13d - vpxor %ymm5,%ymm4,%ymm4 - rorxl $11,%edx,%edi - leal (%r11,%r14,1),%r11d - leal (%r10,%r12,1),%r10d - vpslld $11,%ymm5,%ymm5 - andnl %r9d,%edx,%r12d - xorl %edi,%r13d - rorxl $6,%edx,%r14d - vpxor %ymm6,%ymm4,%ymm4 - leal (%r10,%r12,1),%r10d - xorl %r14d,%r13d - movl %r11d,%edi - vpsrld $10,%ymm7,%ymm6 - rorxl $22,%r11d,%r12d - leal (%r10,%r13,1),%r10d - xorl %eax,%edi - vpxor %ymm5,%ymm4,%ymm4 - rorxl $13,%r11d,%r14d - rorxl $2,%r11d,%r13d - leal (%rcx,%r10,1),%ecx - vpsrlq $17,%ymm7,%ymm7 - andl %edi,%r15d - xorl %r12d,%r14d - xorl %eax,%r15d - vpaddd %ymm4,%ymm0,%ymm0 - xorl %r13d,%r14d - leal (%r10,%r15,1),%r10d - movl %edx,%r12d - vpxor %ymm7,%ymm6,%ymm6 - addl 8+128(%rsp),%r9d - andl %ecx,%r12d - rorxl $25,%ecx,%r13d - vpsrlq $2,%ymm7,%ymm7 - rorxl $11,%ecx,%r15d - leal (%r10,%r14,1),%r10d - leal (%r9,%r12,1),%r9d - vpxor %ymm7,%ymm6,%ymm6 - andnl %r8d,%ecx,%r12d - xorl %r15d,%r13d - rorxl $6,%ecx,%r14d - vpshufb %ymm8,%ymm6,%ymm6 - leal (%r9,%r12,1),%r9d - xorl %r14d,%r13d - movl %r10d,%r15d - vpaddd %ymm6,%ymm0,%ymm0 - rorxl $22,%r10d,%r12d - leal (%r9,%r13,1),%r9d - xorl %r11d,%r15d - vpshufd $80,%ymm0,%ymm7 - rorxl $13,%r10d,%r14d - rorxl $2,%r10d,%r13d - leal (%rbx,%r9,1),%ebx - vpsrld $10,%ymm7,%ymm6 - andl %r15d,%edi - xorl %r12d,%r14d - xorl %r11d,%edi - vpsrlq $17,%ymm7,%ymm7 - xorl %r13d,%r14d - leal (%r9,%rdi,1),%r9d - movl %ecx,%r12d - vpxor %ymm7,%ymm6,%ymm6 - addl 12+128(%rsp),%r8d - andl %ebx,%r12d - rorxl $25,%ebx,%r13d - vpsrlq $2,%ymm7,%ymm7 - rorxl $11,%ebx,%edi - leal (%r9,%r14,1),%r9d - leal (%r8,%r12,1),%r8d - vpxor %ymm7,%ymm6,%ymm6 - andnl %edx,%ebx,%r12d - xorl %edi,%r13d - rorxl $6,%ebx,%r14d - vpshufb %ymm9,%ymm6,%ymm6 - leal (%r8,%r12,1),%r8d - xorl %r14d,%r13d - movl %r9d,%edi - vpaddd %ymm6,%ymm0,%ymm0 - rorxl $22,%r9d,%r12d - leal (%r8,%r13,1),%r8d - xorl %r10d,%edi - vpaddd 0(%rbp),%ymm0,%ymm6 - rorxl $13,%r9d,%r14d - rorxl $2,%r9d,%r13d - leal (%rax,%r8,1),%eax - andl %edi,%r15d - xorl %r12d,%r14d - xorl %r10d,%r15d - xorl %r13d,%r14d - leal (%r8,%r15,1),%r8d - movl %ebx,%r12d - vmovdqa %ymm6,0(%rsp) - vpalignr $4,%ymm1,%ymm2,%ymm4 - addl 32+128(%rsp),%edx - andl %eax,%r12d - rorxl $25,%eax,%r13d - vpalignr $4,%ymm3,%ymm0,%ymm7 - rorxl $11,%eax,%r15d - leal (%r8,%r14,1),%r8d - leal (%rdx,%r12,1),%edx - vpsrld $7,%ymm4,%ymm6 - andnl %ecx,%eax,%r12d - xorl %r15d,%r13d - rorxl $6,%eax,%r14d - vpaddd %ymm7,%ymm1,%ymm1 - leal (%rdx,%r12,1),%edx - xorl %r14d,%r13d - movl %r8d,%r15d - vpsrld $3,%ymm4,%ymm7 - rorxl $22,%r8d,%r12d - leal (%rdx,%r13,1),%edx - xorl %r9d,%r15d - vpslld $14,%ymm4,%ymm5 - rorxl $13,%r8d,%r14d - rorxl $2,%r8d,%r13d - leal (%r11,%rdx,1),%r11d - vpxor %ymm6,%ymm7,%ymm4 - andl %r15d,%edi - xorl %r12d,%r14d - xorl %r9d,%edi - vpshufd $250,%ymm0,%ymm7 - xorl %r13d,%r14d - leal (%rdx,%rdi,1),%edx - movl %eax,%r12d - vpsrld $11,%ymm6,%ymm6 - addl 36+128(%rsp),%ecx - andl %r11d,%r12d - rorxl $25,%r11d,%r13d - vpxor %ymm5,%ymm4,%ymm4 - rorxl $11,%r11d,%edi - leal (%rdx,%r14,1),%edx - leal (%rcx,%r12,1),%ecx - vpslld $11,%ymm5,%ymm5 - andnl %ebx,%r11d,%r12d - xorl %edi,%r13d - rorxl $6,%r11d,%r14d - vpxor %ymm6,%ymm4,%ymm4 - leal (%rcx,%r12,1),%ecx - xorl %r14d,%r13d - movl %edx,%edi - vpsrld $10,%ymm7,%ymm6 - rorxl $22,%edx,%r12d - leal (%rcx,%r13,1),%ecx - xorl %r8d,%edi - vpxor %ymm5,%ymm4,%ymm4 - rorxl $13,%edx,%r14d - rorxl $2,%edx,%r13d - leal (%r10,%rcx,1),%r10d - vpsrlq $17,%ymm7,%ymm7 - andl %edi,%r15d - xorl %r12d,%r14d - xorl %r8d,%r15d - vpaddd %ymm4,%ymm1,%ymm1 - xorl %r13d,%r14d - leal (%rcx,%r15,1),%ecx - movl %r11d,%r12d - vpxor %ymm7,%ymm6,%ymm6 - addl 40+128(%rsp),%ebx - andl %r10d,%r12d - rorxl $25,%r10d,%r13d - vpsrlq $2,%ymm7,%ymm7 - rorxl $11,%r10d,%r15d - leal (%rcx,%r14,1),%ecx - leal (%rbx,%r12,1),%ebx - vpxor %ymm7,%ymm6,%ymm6 - andnl %eax,%r10d,%r12d - xorl %r15d,%r13d - rorxl $6,%r10d,%r14d - vpshufb %ymm8,%ymm6,%ymm6 - leal (%rbx,%r12,1),%ebx - xorl %r14d,%r13d - movl %ecx,%r15d - vpaddd %ymm6,%ymm1,%ymm1 - rorxl $22,%ecx,%r12d - leal (%rbx,%r13,1),%ebx - xorl %edx,%r15d - vpshufd $80,%ymm1,%ymm7 - rorxl $13,%ecx,%r14d - rorxl $2,%ecx,%r13d - leal (%r9,%rbx,1),%r9d - vpsrld $10,%ymm7,%ymm6 - andl %r15d,%edi - xorl %r12d,%r14d - xorl %edx,%edi - vpsrlq $17,%ymm7,%ymm7 - xorl %r13d,%r14d - leal (%rbx,%rdi,1),%ebx - movl %r10d,%r12d - vpxor %ymm7,%ymm6,%ymm6 - addl 44+128(%rsp),%eax - andl %r9d,%r12d - rorxl $25,%r9d,%r13d - vpsrlq $2,%ymm7,%ymm7 - rorxl $11,%r9d,%edi - leal (%rbx,%r14,1),%ebx - leal (%rax,%r12,1),%eax - vpxor %ymm7,%ymm6,%ymm6 - andnl %r11d,%r9d,%r12d - xorl %edi,%r13d - rorxl $6,%r9d,%r14d - vpshufb %ymm9,%ymm6,%ymm6 - leal (%rax,%r12,1),%eax - xorl %r14d,%r13d - movl %ebx,%edi - vpaddd %ymm6,%ymm1,%ymm1 - rorxl $22,%ebx,%r12d - leal (%rax,%r13,1),%eax - xorl %ecx,%edi - vpaddd 32(%rbp),%ymm1,%ymm6 - rorxl $13,%ebx,%r14d - rorxl $2,%ebx,%r13d - leal (%r8,%rax,1),%r8d - andl %edi,%r15d - xorl %r12d,%r14d - xorl %ecx,%r15d - xorl %r13d,%r14d - leal (%rax,%r15,1),%eax - movl %r9d,%r12d - vmovdqa %ymm6,32(%rsp) - leaq -64(%rsp),%rsp - vpalignr $4,%ymm2,%ymm3,%ymm4 - addl 0+128(%rsp),%r11d - andl %r8d,%r12d - rorxl $25,%r8d,%r13d - vpalignr $4,%ymm0,%ymm1,%ymm7 - rorxl $11,%r8d,%r15d - leal (%rax,%r14,1),%eax - leal (%r11,%r12,1),%r11d - vpsrld $7,%ymm4,%ymm6 - andnl %r10d,%r8d,%r12d - xorl %r15d,%r13d - rorxl $6,%r8d,%r14d - vpaddd %ymm7,%ymm2,%ymm2 - leal (%r11,%r12,1),%r11d - xorl %r14d,%r13d - movl %eax,%r15d - vpsrld $3,%ymm4,%ymm7 - rorxl $22,%eax,%r12d - leal (%r11,%r13,1),%r11d - xorl %ebx,%r15d - vpslld $14,%ymm4,%ymm5 - rorxl $13,%eax,%r14d - rorxl $2,%eax,%r13d - leal (%rdx,%r11,1),%edx - vpxor %ymm6,%ymm7,%ymm4 - andl %r15d,%edi - xorl %r12d,%r14d - xorl %ebx,%edi - vpshufd $250,%ymm1,%ymm7 - xorl %r13d,%r14d - leal (%r11,%rdi,1),%r11d - movl %r8d,%r12d - vpsrld $11,%ymm6,%ymm6 - addl 4+128(%rsp),%r10d - andl %edx,%r12d - rorxl $25,%edx,%r13d - vpxor %ymm5,%ymm4,%ymm4 - rorxl $11,%edx,%edi - leal (%r11,%r14,1),%r11d - leal (%r10,%r12,1),%r10d - vpslld $11,%ymm5,%ymm5 - andnl %r9d,%edx,%r12d - xorl %edi,%r13d - rorxl $6,%edx,%r14d - vpxor %ymm6,%ymm4,%ymm4 - leal (%r10,%r12,1),%r10d - xorl %r14d,%r13d - movl %r11d,%edi - vpsrld $10,%ymm7,%ymm6 - rorxl $22,%r11d,%r12d - leal (%r10,%r13,1),%r10d - xorl %eax,%edi - vpxor %ymm5,%ymm4,%ymm4 - rorxl $13,%r11d,%r14d - rorxl $2,%r11d,%r13d - leal (%rcx,%r10,1),%ecx - vpsrlq $17,%ymm7,%ymm7 - andl %edi,%r15d - xorl %r12d,%r14d - xorl %eax,%r15d - vpaddd %ymm4,%ymm2,%ymm2 - xorl %r13d,%r14d - leal (%r10,%r15,1),%r10d - movl %edx,%r12d - vpxor %ymm7,%ymm6,%ymm6 - addl 8+128(%rsp),%r9d - andl %ecx,%r12d - rorxl $25,%ecx,%r13d - vpsrlq $2,%ymm7,%ymm7 - rorxl $11,%ecx,%r15d - leal (%r10,%r14,1),%r10d - leal (%r9,%r12,1),%r9d - vpxor %ymm7,%ymm6,%ymm6 - andnl %r8d,%ecx,%r12d - xorl %r15d,%r13d - rorxl $6,%ecx,%r14d - vpshufb %ymm8,%ymm6,%ymm6 - leal (%r9,%r12,1),%r9d - xorl %r14d,%r13d - movl %r10d,%r15d - vpaddd %ymm6,%ymm2,%ymm2 - rorxl $22,%r10d,%r12d - leal (%r9,%r13,1),%r9d - xorl %r11d,%r15d - vpshufd $80,%ymm2,%ymm7 - rorxl $13,%r10d,%r14d - rorxl $2,%r10d,%r13d - leal (%rbx,%r9,1),%ebx - vpsrld $10,%ymm7,%ymm6 - andl %r15d,%edi - xorl %r12d,%r14d - xorl %r11d,%edi - vpsrlq $17,%ymm7,%ymm7 - xorl %r13d,%r14d - leal (%r9,%rdi,1),%r9d - movl %ecx,%r12d - vpxor %ymm7,%ymm6,%ymm6 - addl 12+128(%rsp),%r8d - andl %ebx,%r12d - rorxl $25,%ebx,%r13d - vpsrlq $2,%ymm7,%ymm7 - rorxl $11,%ebx,%edi - leal (%r9,%r14,1),%r9d - leal (%r8,%r12,1),%r8d - vpxor %ymm7,%ymm6,%ymm6 - andnl %edx,%ebx,%r12d - xorl %edi,%r13d - rorxl $6,%ebx,%r14d - vpshufb %ymm9,%ymm6,%ymm6 - leal (%r8,%r12,1),%r8d - xorl %r14d,%r13d - movl %r9d,%edi - vpaddd %ymm6,%ymm2,%ymm2 - rorxl $22,%r9d,%r12d - leal (%r8,%r13,1),%r8d - xorl %r10d,%edi - vpaddd 64(%rbp),%ymm2,%ymm6 - rorxl $13,%r9d,%r14d - rorxl $2,%r9d,%r13d - leal (%rax,%r8,1),%eax - andl %edi,%r15d - xorl %r12d,%r14d - xorl %r10d,%r15d - xorl %r13d,%r14d - leal (%r8,%r15,1),%r8d - movl %ebx,%r12d - vmovdqa %ymm6,0(%rsp) - vpalignr $4,%ymm3,%ymm0,%ymm4 - addl 32+128(%rsp),%edx - andl %eax,%r12d - rorxl $25,%eax,%r13d - vpalignr $4,%ymm1,%ymm2,%ymm7 - rorxl $11,%eax,%r15d - leal (%r8,%r14,1),%r8d - leal (%rdx,%r12,1),%edx - vpsrld $7,%ymm4,%ymm6 - andnl %ecx,%eax,%r12d - xorl %r15d,%r13d - rorxl $6,%eax,%r14d - vpaddd %ymm7,%ymm3,%ymm3 - leal (%rdx,%r12,1),%edx - xorl %r14d,%r13d - movl %r8d,%r15d - vpsrld $3,%ymm4,%ymm7 - rorxl $22,%r8d,%r12d - leal (%rdx,%r13,1),%edx - xorl %r9d,%r15d - vpslld $14,%ymm4,%ymm5 - rorxl $13,%r8d,%r14d - rorxl $2,%r8d,%r13d - leal (%r11,%rdx,1),%r11d - vpxor %ymm6,%ymm7,%ymm4 - andl %r15d,%edi - xorl %r12d,%r14d - xorl %r9d,%edi - vpshufd $250,%ymm2,%ymm7 - xorl %r13d,%r14d - leal (%rdx,%rdi,1),%edx - movl %eax,%r12d - vpsrld $11,%ymm6,%ymm6 - addl 36+128(%rsp),%ecx - andl %r11d,%r12d - rorxl $25,%r11d,%r13d - vpxor %ymm5,%ymm4,%ymm4 - rorxl $11,%r11d,%edi - leal (%rdx,%r14,1),%edx - leal (%rcx,%r12,1),%ecx - vpslld $11,%ymm5,%ymm5 - andnl %ebx,%r11d,%r12d - xorl %edi,%r13d - rorxl $6,%r11d,%r14d - vpxor %ymm6,%ymm4,%ymm4 - leal (%rcx,%r12,1),%ecx - xorl %r14d,%r13d - movl %edx,%edi - vpsrld $10,%ymm7,%ymm6 - rorxl $22,%edx,%r12d - leal (%rcx,%r13,1),%ecx - xorl %r8d,%edi - vpxor %ymm5,%ymm4,%ymm4 - rorxl $13,%edx,%r14d - rorxl $2,%edx,%r13d - leal (%r10,%rcx,1),%r10d - vpsrlq $17,%ymm7,%ymm7 - andl %edi,%r15d - xorl %r12d,%r14d - xorl %r8d,%r15d - vpaddd %ymm4,%ymm3,%ymm3 - xorl %r13d,%r14d - leal (%rcx,%r15,1),%ecx - movl %r11d,%r12d - vpxor %ymm7,%ymm6,%ymm6 - addl 40+128(%rsp),%ebx - andl %r10d,%r12d - rorxl $25,%r10d,%r13d - vpsrlq $2,%ymm7,%ymm7 - rorxl $11,%r10d,%r15d - leal (%rcx,%r14,1),%ecx - leal (%rbx,%r12,1),%ebx - vpxor %ymm7,%ymm6,%ymm6 - andnl %eax,%r10d,%r12d - xorl %r15d,%r13d - rorxl $6,%r10d,%r14d - vpshufb %ymm8,%ymm6,%ymm6 - leal (%rbx,%r12,1),%ebx - xorl %r14d,%r13d - movl %ecx,%r15d - vpaddd %ymm6,%ymm3,%ymm3 - rorxl $22,%ecx,%r12d - leal (%rbx,%r13,1),%ebx - xorl %edx,%r15d - vpshufd $80,%ymm3,%ymm7 - rorxl $13,%ecx,%r14d - rorxl $2,%ecx,%r13d - leal (%r9,%rbx,1),%r9d - vpsrld $10,%ymm7,%ymm6 - andl %r15d,%edi - xorl %r12d,%r14d - xorl %edx,%edi - vpsrlq $17,%ymm7,%ymm7 - xorl %r13d,%r14d - leal (%rbx,%rdi,1),%ebx - movl %r10d,%r12d - vpxor %ymm7,%ymm6,%ymm6 - addl 44+128(%rsp),%eax - andl %r9d,%r12d - rorxl $25,%r9d,%r13d - vpsrlq $2,%ymm7,%ymm7 - rorxl $11,%r9d,%edi - leal (%rbx,%r14,1),%ebx - leal (%rax,%r12,1),%eax - vpxor %ymm7,%ymm6,%ymm6 - andnl %r11d,%r9d,%r12d - xorl %edi,%r13d - rorxl $6,%r9d,%r14d - vpshufb %ymm9,%ymm6,%ymm6 - leal (%rax,%r12,1),%eax - xorl %r14d,%r13d - movl %ebx,%edi - vpaddd %ymm6,%ymm3,%ymm3 - rorxl $22,%ebx,%r12d - leal (%rax,%r13,1),%eax - xorl %ecx,%edi - vpaddd 96(%rbp),%ymm3,%ymm6 - rorxl $13,%ebx,%r14d - rorxl $2,%ebx,%r13d - leal (%r8,%rax,1),%r8d - andl %edi,%r15d - xorl %r12d,%r14d - xorl %ecx,%r15d - xorl %r13d,%r14d - leal (%rax,%r15,1),%eax - movl %r9d,%r12d - vmovdqa %ymm6,32(%rsp) - leaq 128(%rbp),%rbp - cmpb $0,3(%rbp) - jne .Lavx2_00_47 - addl 0+64(%rsp),%r11d - andl %r8d,%r12d - rorxl $25,%r8d,%r13d - rorxl $11,%r8d,%r15d - leal (%rax,%r14,1),%eax - leal (%r11,%r12,1),%r11d - andnl %r10d,%r8d,%r12d - xorl %r15d,%r13d - rorxl $6,%r8d,%r14d - leal (%r11,%r12,1),%r11d - xorl %r14d,%r13d - movl %eax,%r15d - rorxl $22,%eax,%r12d - leal (%r11,%r13,1),%r11d - xorl %ebx,%r15d - rorxl $13,%eax,%r14d - rorxl $2,%eax,%r13d - leal (%rdx,%r11,1),%edx - andl %r15d,%edi - xorl %r12d,%r14d - xorl %ebx,%edi - xorl %r13d,%r14d - leal (%r11,%rdi,1),%r11d - movl %r8d,%r12d - addl 4+64(%rsp),%r10d - andl %edx,%r12d - rorxl $25,%edx,%r13d - rorxl $11,%edx,%edi - leal (%r11,%r14,1),%r11d - leal (%r10,%r12,1),%r10d - andnl %r9d,%edx,%r12d - xorl %edi,%r13d - rorxl $6,%edx,%r14d - leal (%r10,%r12,1),%r10d - xorl %r14d,%r13d - movl %r11d,%edi - rorxl $22,%r11d,%r12d - leal (%r10,%r13,1),%r10d - xorl %eax,%edi - rorxl $13,%r11d,%r14d - rorxl $2,%r11d,%r13d - leal (%rcx,%r10,1),%ecx - andl %edi,%r15d - xorl %r12d,%r14d - xorl %eax,%r15d - xorl %r13d,%r14d - leal (%r10,%r15,1),%r10d - movl %edx,%r12d - addl 8+64(%rsp),%r9d - andl %ecx,%r12d - rorxl $25,%ecx,%r13d - rorxl $11,%ecx,%r15d - leal (%r10,%r14,1),%r10d - leal (%r9,%r12,1),%r9d - andnl %r8d,%ecx,%r12d - xorl %r15d,%r13d - rorxl $6,%ecx,%r14d - leal (%r9,%r12,1),%r9d - xorl %r14d,%r13d - movl %r10d,%r15d - rorxl $22,%r10d,%r12d - leal (%r9,%r13,1),%r9d - xorl %r11d,%r15d - rorxl $13,%r10d,%r14d - rorxl $2,%r10d,%r13d - leal (%rbx,%r9,1),%ebx - andl %r15d,%edi - xorl %r12d,%r14d - xorl %r11d,%edi - xorl %r13d,%r14d - leal (%r9,%rdi,1),%r9d - movl %ecx,%r12d - addl 12+64(%rsp),%r8d - andl %ebx,%r12d - rorxl $25,%ebx,%r13d - rorxl $11,%ebx,%edi - leal (%r9,%r14,1),%r9d - leal (%r8,%r12,1),%r8d - andnl %edx,%ebx,%r12d - xorl %edi,%r13d - rorxl $6,%ebx,%r14d - leal (%r8,%r12,1),%r8d - xorl %r14d,%r13d - movl %r9d,%edi - rorxl $22,%r9d,%r12d - leal (%r8,%r13,1),%r8d - xorl %r10d,%edi - rorxl $13,%r9d,%r14d - rorxl $2,%r9d,%r13d - leal (%rax,%r8,1),%eax - andl %edi,%r15d - xorl %r12d,%r14d - xorl %r10d,%r15d - xorl %r13d,%r14d - leal (%r8,%r15,1),%r8d - movl %ebx,%r12d - addl 32+64(%rsp),%edx - andl %eax,%r12d - rorxl $25,%eax,%r13d - rorxl $11,%eax,%r15d - leal (%r8,%r14,1),%r8d - leal (%rdx,%r12,1),%edx - andnl %ecx,%eax,%r12d - xorl %r15d,%r13d - rorxl $6,%eax,%r14d - leal (%rdx,%r12,1),%edx - xorl %r14d,%r13d - movl %r8d,%r15d - rorxl $22,%r8d,%r12d - leal (%rdx,%r13,1),%edx - xorl %r9d,%r15d - rorxl $13,%r8d,%r14d - rorxl $2,%r8d,%r13d - leal (%r11,%rdx,1),%r11d - andl %r15d,%edi - xorl %r12d,%r14d - xorl %r9d,%edi - xorl %r13d,%r14d - leal (%rdx,%rdi,1),%edx - movl %eax,%r12d - addl 36+64(%rsp),%ecx - andl %r11d,%r12d - rorxl $25,%r11d,%r13d - rorxl $11,%r11d,%edi - leal (%rdx,%r14,1),%edx - leal (%rcx,%r12,1),%ecx - andnl %ebx,%r11d,%r12d - xorl %edi,%r13d - rorxl $6,%r11d,%r14d - leal (%rcx,%r12,1),%ecx - xorl %r14d,%r13d - movl %edx,%edi - rorxl $22,%edx,%r12d - leal (%rcx,%r13,1),%ecx - xorl %r8d,%edi - rorxl $13,%edx,%r14d - rorxl $2,%edx,%r13d - leal (%r10,%rcx,1),%r10d - andl %edi,%r15d - xorl %r12d,%r14d - xorl %r8d,%r15d - xorl %r13d,%r14d - leal (%rcx,%r15,1),%ecx - movl %r11d,%r12d - addl 40+64(%rsp),%ebx - andl %r10d,%r12d - rorxl $25,%r10d,%r13d - rorxl $11,%r10d,%r15d - leal (%rcx,%r14,1),%ecx - leal (%rbx,%r12,1),%ebx - andnl %eax,%r10d,%r12d - xorl %r15d,%r13d - rorxl $6,%r10d,%r14d - leal (%rbx,%r12,1),%ebx - xorl %r14d,%r13d - movl %ecx,%r15d - rorxl $22,%ecx,%r12d - leal (%rbx,%r13,1),%ebx - xorl %edx,%r15d - rorxl $13,%ecx,%r14d - rorxl $2,%ecx,%r13d - leal (%r9,%rbx,1),%r9d - andl %r15d,%edi - xorl %r12d,%r14d - xorl %edx,%edi - xorl %r13d,%r14d - leal (%rbx,%rdi,1),%ebx - movl %r10d,%r12d - addl 44+64(%rsp),%eax - andl %r9d,%r12d - rorxl $25,%r9d,%r13d - rorxl $11,%r9d,%edi - leal (%rbx,%r14,1),%ebx - leal (%rax,%r12,1),%eax - andnl %r11d,%r9d,%r12d - xorl %edi,%r13d - rorxl $6,%r9d,%r14d - leal (%rax,%r12,1),%eax - xorl %r14d,%r13d - movl %ebx,%edi - rorxl $22,%ebx,%r12d - leal (%rax,%r13,1),%eax - xorl %ecx,%edi - rorxl $13,%ebx,%r14d - rorxl $2,%ebx,%r13d - leal (%r8,%rax,1),%r8d - andl %edi,%r15d - xorl %r12d,%r14d - xorl %ecx,%r15d - xorl %r13d,%r14d - leal (%rax,%r15,1),%eax - movl %r9d,%r12d - addl 0(%rsp),%r11d - andl %r8d,%r12d - rorxl $25,%r8d,%r13d - rorxl $11,%r8d,%r15d - leal (%rax,%r14,1),%eax - leal (%r11,%r12,1),%r11d - andnl %r10d,%r8d,%r12d - xorl %r15d,%r13d - rorxl $6,%r8d,%r14d - leal (%r11,%r12,1),%r11d - xorl %r14d,%r13d - movl %eax,%r15d - rorxl $22,%eax,%r12d - leal (%r11,%r13,1),%r11d - xorl %ebx,%r15d - rorxl $13,%eax,%r14d - rorxl $2,%eax,%r13d - leal (%rdx,%r11,1),%edx - andl %r15d,%edi - xorl %r12d,%r14d - xorl %ebx,%edi - xorl %r13d,%r14d - leal (%r11,%rdi,1),%r11d - movl %r8d,%r12d - addl 4(%rsp),%r10d - andl %edx,%r12d - rorxl $25,%edx,%r13d - rorxl $11,%edx,%edi - leal (%r11,%r14,1),%r11d - leal (%r10,%r12,1),%r10d - andnl %r9d,%edx,%r12d - xorl %edi,%r13d - rorxl $6,%edx,%r14d - leal (%r10,%r12,1),%r10d - xorl %r14d,%r13d - movl %r11d,%edi - rorxl $22,%r11d,%r12d - leal (%r10,%r13,1),%r10d - xorl %eax,%edi - rorxl $13,%r11d,%r14d - rorxl $2,%r11d,%r13d - leal (%rcx,%r10,1),%ecx - andl %edi,%r15d - xorl %r12d,%r14d - xorl %eax,%r15d - xorl %r13d,%r14d - leal (%r10,%r15,1),%r10d - movl %edx,%r12d - addl 8(%rsp),%r9d - andl %ecx,%r12d - rorxl $25,%ecx,%r13d - rorxl $11,%ecx,%r15d - leal (%r10,%r14,1),%r10d - leal (%r9,%r12,1),%r9d - andnl %r8d,%ecx,%r12d - xorl %r15d,%r13d - rorxl $6,%ecx,%r14d - leal (%r9,%r12,1),%r9d - xorl %r14d,%r13d - movl %r10d,%r15d - rorxl $22,%r10d,%r12d - leal (%r9,%r13,1),%r9d - xorl %r11d,%r15d - rorxl $13,%r10d,%r14d - rorxl $2,%r10d,%r13d - leal (%rbx,%r9,1),%ebx - andl %r15d,%edi - xorl %r12d,%r14d - xorl %r11d,%edi - xorl %r13d,%r14d - leal (%r9,%rdi,1),%r9d - movl %ecx,%r12d - addl 12(%rsp),%r8d - andl %ebx,%r12d - rorxl $25,%ebx,%r13d - rorxl $11,%ebx,%edi - leal (%r9,%r14,1),%r9d - leal (%r8,%r12,1),%r8d - andnl %edx,%ebx,%r12d - xorl %edi,%r13d - rorxl $6,%ebx,%r14d - leal (%r8,%r12,1),%r8d - xorl %r14d,%r13d - movl %r9d,%edi - rorxl $22,%r9d,%r12d - leal (%r8,%r13,1),%r8d - xorl %r10d,%edi - rorxl $13,%r9d,%r14d - rorxl $2,%r9d,%r13d - leal (%rax,%r8,1),%eax - andl %edi,%r15d - xorl %r12d,%r14d - xorl %r10d,%r15d - xorl %r13d,%r14d - leal (%r8,%r15,1),%r8d - movl %ebx,%r12d - addl 32(%rsp),%edx - andl %eax,%r12d - rorxl $25,%eax,%r13d - rorxl $11,%eax,%r15d - leal (%r8,%r14,1),%r8d - leal (%rdx,%r12,1),%edx - andnl %ecx,%eax,%r12d - xorl %r15d,%r13d - rorxl $6,%eax,%r14d - leal (%rdx,%r12,1),%edx - xorl %r14d,%r13d - movl %r8d,%r15d - rorxl $22,%r8d,%r12d - leal (%rdx,%r13,1),%edx - xorl %r9d,%r15d - rorxl $13,%r8d,%r14d - rorxl $2,%r8d,%r13d - leal (%r11,%rdx,1),%r11d - andl %r15d,%edi - xorl %r12d,%r14d - xorl %r9d,%edi - xorl %r13d,%r14d - leal (%rdx,%rdi,1),%edx - movl %eax,%r12d - addl 36(%rsp),%ecx - andl %r11d,%r12d - rorxl $25,%r11d,%r13d - rorxl $11,%r11d,%edi - leal (%rdx,%r14,1),%edx - leal (%rcx,%r12,1),%ecx - andnl %ebx,%r11d,%r12d - xorl %edi,%r13d - rorxl $6,%r11d,%r14d - leal (%rcx,%r12,1),%ecx - xorl %r14d,%r13d - movl %edx,%edi - rorxl $22,%edx,%r12d - leal (%rcx,%r13,1),%ecx - xorl %r8d,%edi - rorxl $13,%edx,%r14d - rorxl $2,%edx,%r13d - leal (%r10,%rcx,1),%r10d - andl %edi,%r15d - xorl %r12d,%r14d - xorl %r8d,%r15d - xorl %r13d,%r14d - leal (%rcx,%r15,1),%ecx - movl %r11d,%r12d - addl 40(%rsp),%ebx - andl %r10d,%r12d - rorxl $25,%r10d,%r13d - rorxl $11,%r10d,%r15d - leal (%rcx,%r14,1),%ecx - leal (%rbx,%r12,1),%ebx - andnl %eax,%r10d,%r12d - xorl %r15d,%r13d - rorxl $6,%r10d,%r14d - leal (%rbx,%r12,1),%ebx - xorl %r14d,%r13d - movl %ecx,%r15d - rorxl $22,%ecx,%r12d - leal (%rbx,%r13,1),%ebx - xorl %edx,%r15d - rorxl $13,%ecx,%r14d - rorxl $2,%ecx,%r13d - leal (%r9,%rbx,1),%r9d - andl %r15d,%edi - xorl %r12d,%r14d - xorl %edx,%edi - xorl %r13d,%r14d - leal (%rbx,%rdi,1),%ebx - movl %r10d,%r12d - addl 44(%rsp),%eax - andl %r9d,%r12d - rorxl $25,%r9d,%r13d - rorxl $11,%r9d,%edi - leal (%rbx,%r14,1),%ebx - leal (%rax,%r12,1),%eax - andnl %r11d,%r9d,%r12d - xorl %edi,%r13d - rorxl $6,%r9d,%r14d - leal (%rax,%r12,1),%eax - xorl %r14d,%r13d - movl %ebx,%edi - rorxl $22,%ebx,%r12d - leal (%rax,%r13,1),%eax - xorl %ecx,%edi - rorxl $13,%ebx,%r14d - rorxl $2,%ebx,%r13d - leal (%r8,%rax,1),%r8d - andl %edi,%r15d - xorl %r12d,%r14d - xorl %ecx,%r15d - xorl %r13d,%r14d - leal (%rax,%r15,1),%eax - movl %r9d,%r12d - movq 512(%rsp),%rdi - addl %r14d,%eax - - leaq 448(%rsp),%rbp - - addl 0(%rdi),%eax - addl 4(%rdi),%ebx - addl 8(%rdi),%ecx - addl 12(%rdi),%edx - addl 16(%rdi),%r8d - addl 20(%rdi),%r9d - addl 24(%rdi),%r10d - addl 28(%rdi),%r11d - - movl %eax,0(%rdi) - movl %ebx,4(%rdi) - movl %ecx,8(%rdi) - movl %edx,12(%rdi) - movl %r8d,16(%rdi) - movl %r9d,20(%rdi) - movl %r10d,24(%rdi) - movl %r11d,28(%rdi) - - cmpq 80(%rbp),%rsi - je .Ldone_avx2 - - xorl %r14d,%r14d - movl %ebx,%edi - xorl %ecx,%edi - movl %r9d,%r12d - jmp .Lower_avx2 -.align 16 -.Lower_avx2: - addl 0+16(%rbp),%r11d - andl %r8d,%r12d - rorxl $25,%r8d,%r13d - rorxl $11,%r8d,%r15d - leal (%rax,%r14,1),%eax - leal (%r11,%r12,1),%r11d - andnl %r10d,%r8d,%r12d - xorl %r15d,%r13d - rorxl $6,%r8d,%r14d - leal (%r11,%r12,1),%r11d - xorl %r14d,%r13d - movl %eax,%r15d - rorxl $22,%eax,%r12d - leal (%r11,%r13,1),%r11d - xorl %ebx,%r15d - rorxl $13,%eax,%r14d - rorxl $2,%eax,%r13d - leal (%rdx,%r11,1),%edx - andl %r15d,%edi - xorl %r12d,%r14d - xorl %ebx,%edi - xorl %r13d,%r14d - leal (%r11,%rdi,1),%r11d - movl %r8d,%r12d - addl 4+16(%rbp),%r10d - andl %edx,%r12d - rorxl $25,%edx,%r13d - rorxl $11,%edx,%edi - leal (%r11,%r14,1),%r11d - leal (%r10,%r12,1),%r10d - andnl %r9d,%edx,%r12d - xorl %edi,%r13d - rorxl $6,%edx,%r14d - leal (%r10,%r12,1),%r10d - xorl %r14d,%r13d - movl %r11d,%edi - rorxl $22,%r11d,%r12d - leal (%r10,%r13,1),%r10d - xorl %eax,%edi - rorxl $13,%r11d,%r14d - rorxl $2,%r11d,%r13d - leal (%rcx,%r10,1),%ecx - andl %edi,%r15d - xorl %r12d,%r14d - xorl %eax,%r15d - xorl %r13d,%r14d - leal (%r10,%r15,1),%r10d - movl %edx,%r12d - addl 8+16(%rbp),%r9d - andl %ecx,%r12d - rorxl $25,%ecx,%r13d - rorxl $11,%ecx,%r15d - leal (%r10,%r14,1),%r10d - leal (%r9,%r12,1),%r9d - andnl %r8d,%ecx,%r12d - xorl %r15d,%r13d - rorxl $6,%ecx,%r14d - leal (%r9,%r12,1),%r9d - xorl %r14d,%r13d - movl %r10d,%r15d - rorxl $22,%r10d,%r12d - leal (%r9,%r13,1),%r9d - xorl %r11d,%r15d - rorxl $13,%r10d,%r14d - rorxl $2,%r10d,%r13d - leal (%rbx,%r9,1),%ebx - andl %r15d,%edi - xorl %r12d,%r14d - xorl %r11d,%edi - xorl %r13d,%r14d - leal (%r9,%rdi,1),%r9d - movl %ecx,%r12d - addl 12+16(%rbp),%r8d - andl %ebx,%r12d - rorxl $25,%ebx,%r13d - rorxl $11,%ebx,%edi - leal (%r9,%r14,1),%r9d - leal (%r8,%r12,1),%r8d - andnl %edx,%ebx,%r12d - xorl %edi,%r13d - rorxl $6,%ebx,%r14d - leal (%r8,%r12,1),%r8d - xorl %r14d,%r13d - movl %r9d,%edi - rorxl $22,%r9d,%r12d - leal (%r8,%r13,1),%r8d - xorl %r10d,%edi - rorxl $13,%r9d,%r14d - rorxl $2,%r9d,%r13d - leal (%rax,%r8,1),%eax - andl %edi,%r15d - xorl %r12d,%r14d - xorl %r10d,%r15d - xorl %r13d,%r14d - leal (%r8,%r15,1),%r8d - movl %ebx,%r12d - addl 32+16(%rbp),%edx - andl %eax,%r12d - rorxl $25,%eax,%r13d - rorxl $11,%eax,%r15d - leal (%r8,%r14,1),%r8d - leal (%rdx,%r12,1),%edx - andnl %ecx,%eax,%r12d - xorl %r15d,%r13d - rorxl $6,%eax,%r14d - leal (%rdx,%r12,1),%edx - xorl %r14d,%r13d - movl %r8d,%r15d - rorxl $22,%r8d,%r12d - leal (%rdx,%r13,1),%edx - xorl %r9d,%r15d - rorxl $13,%r8d,%r14d - rorxl $2,%r8d,%r13d - leal (%r11,%rdx,1),%r11d - andl %r15d,%edi - xorl %r12d,%r14d - xorl %r9d,%edi - xorl %r13d,%r14d - leal (%rdx,%rdi,1),%edx - movl %eax,%r12d - addl 36+16(%rbp),%ecx - andl %r11d,%r12d - rorxl $25,%r11d,%r13d - rorxl $11,%r11d,%edi - leal (%rdx,%r14,1),%edx - leal (%rcx,%r12,1),%ecx - andnl %ebx,%r11d,%r12d - xorl %edi,%r13d - rorxl $6,%r11d,%r14d - leal (%rcx,%r12,1),%ecx - xorl %r14d,%r13d - movl %edx,%edi - rorxl $22,%edx,%r12d - leal (%rcx,%r13,1),%ecx - xorl %r8d,%edi - rorxl $13,%edx,%r14d - rorxl $2,%edx,%r13d - leal (%r10,%rcx,1),%r10d - andl %edi,%r15d - xorl %r12d,%r14d - xorl %r8d,%r15d - xorl %r13d,%r14d - leal (%rcx,%r15,1),%ecx - movl %r11d,%r12d - addl 40+16(%rbp),%ebx - andl %r10d,%r12d - rorxl $25,%r10d,%r13d - rorxl $11,%r10d,%r15d - leal (%rcx,%r14,1),%ecx - leal (%rbx,%r12,1),%ebx - andnl %eax,%r10d,%r12d - xorl %r15d,%r13d - rorxl $6,%r10d,%r14d - leal (%rbx,%r12,1),%ebx - xorl %r14d,%r13d - movl %ecx,%r15d - rorxl $22,%ecx,%r12d - leal (%rbx,%r13,1),%ebx - xorl %edx,%r15d - rorxl $13,%ecx,%r14d - rorxl $2,%ecx,%r13d - leal (%r9,%rbx,1),%r9d - andl %r15d,%edi - xorl %r12d,%r14d - xorl %edx,%edi - xorl %r13d,%r14d - leal (%rbx,%rdi,1),%ebx - movl %r10d,%r12d - addl 44+16(%rbp),%eax - andl %r9d,%r12d - rorxl $25,%r9d,%r13d - rorxl $11,%r9d,%edi - leal (%rbx,%r14,1),%ebx - leal (%rax,%r12,1),%eax - andnl %r11d,%r9d,%r12d - xorl %edi,%r13d - rorxl $6,%r9d,%r14d - leal (%rax,%r12,1),%eax - xorl %r14d,%r13d - movl %ebx,%edi - rorxl $22,%ebx,%r12d - leal (%rax,%r13,1),%eax - xorl %ecx,%edi - rorxl $13,%ebx,%r14d - rorxl $2,%ebx,%r13d - leal (%r8,%rax,1),%r8d - andl %edi,%r15d - xorl %r12d,%r14d - xorl %ecx,%r15d - xorl %r13d,%r14d - leal (%rax,%r15,1),%eax - movl %r9d,%r12d - leaq -64(%rbp),%rbp - cmpq %rsp,%rbp - jae .Lower_avx2 - - movq 512(%rsp),%rdi - addl %r14d,%eax - - leaq 448(%rsp),%rsp - - addl 0(%rdi),%eax - addl 4(%rdi),%ebx - addl 8(%rdi),%ecx - addl 12(%rdi),%edx - addl 16(%rdi),%r8d - addl 20(%rdi),%r9d - leaq 128(%rsi),%rsi - addl 24(%rdi),%r10d - movq %rsi,%r12 - addl 28(%rdi),%r11d - cmpq 64+16(%rsp),%rsi - - movl %eax,0(%rdi) - cmoveq %rsp,%r12 - movl %ebx,4(%rdi) - movl %ecx,8(%rdi) - movl %edx,12(%rdi) - movl %r8d,16(%rdi) - movl %r9d,20(%rdi) - movl %r10d,24(%rdi) - movl %r11d,28(%rdi) - - jbe .Loop_avx2 - leaq (%rsp),%rbp - -.Ldone_avx2: - leaq (%rbp),%rsp - movq 64+24(%rsp),%rsi - vzeroupper - movq (%rsi),%r15 - movq 8(%rsi),%r14 - movq 16(%rsi),%r13 - movq 24(%rsi),%r12 - movq 32(%rsi),%rbp - movq 40(%rsi),%rbx - leaq 48(%rsi),%rsp -.Lepilogue_avx2: - .byte 0xf3,0xc3 -.size sha256_block_data_order_avx2,.-sha256_block_data_order_avx2 diff --git a/deps/openssl/asm/x64-elf-gas/sha/sha512-x86_64.s b/deps/openssl/asm/x64-elf-gas/sha/sha512-x86_64.s index a1021c17a966b8..f6638db30e9fad 100644 --- a/deps/openssl/asm/x64-elf-gas/sha/sha512-x86_64.s +++ b/deps/openssl/asm/x64-elf-gas/sha/sha512-x86_64.s @@ -5,20 +5,6 @@ .type sha512_block_data_order,@function .align 16 sha512_block_data_order: - leaq OPENSSL_ia32cap_P(%rip),%r11 - movl 0(%r11),%r9d - movl 4(%r11),%r10d - movl 8(%r11),%r11d - testl $2048,%r10d - jnz .Lxop_shortcut - andl $296,%r11d - cmpl $296,%r11d - je .Lavx2_shortcut - andl $1073741824,%r9d - andl $268435968,%r10d - orl %r9d,%r10d - cmpl $1342177792,%r10d - je .Lavx_shortcut pushq %rbx pushq %rbp pushq %r12 @@ -1795,3571 +1781,3 @@ K512: .quad 0x0001020304050607,0x08090a0b0c0d0e0f .quad 0x0001020304050607,0x08090a0b0c0d0e0f .byte 83,72,65,53,49,50,32,98,108,111,99,107,32,116,114,97,110,115,102,111,114,109,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 -.type sha512_block_data_order_xop,@function -.align 64 -sha512_block_data_order_xop: -.Lxop_shortcut: - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - movq %rsp,%r11 - shlq $4,%rdx - subq $160,%rsp - leaq (%rsi,%rdx,8),%rdx - andq $-64,%rsp - movq %rdi,128+0(%rsp) - movq %rsi,128+8(%rsp) - movq %rdx,128+16(%rsp) - movq %r11,128+24(%rsp) -.Lprologue_xop: - - vzeroupper - movq 0(%rdi),%rax - movq 8(%rdi),%rbx - movq 16(%rdi),%rcx - movq 24(%rdi),%rdx - movq 32(%rdi),%r8 - movq 40(%rdi),%r9 - movq 48(%rdi),%r10 - movq 56(%rdi),%r11 - jmp .Lloop_xop -.align 16 -.Lloop_xop: - vmovdqa K512+1280(%rip),%xmm11 - vmovdqu 0(%rsi),%xmm0 - leaq K512+128(%rip),%rbp - vmovdqu 16(%rsi),%xmm1 - vmovdqu 32(%rsi),%xmm2 - vpshufb %xmm11,%xmm0,%xmm0 - vmovdqu 48(%rsi),%xmm3 - vpshufb %xmm11,%xmm1,%xmm1 - vmovdqu 64(%rsi),%xmm4 - vpshufb %xmm11,%xmm2,%xmm2 - vmovdqu 80(%rsi),%xmm5 - vpshufb %xmm11,%xmm3,%xmm3 - vmovdqu 96(%rsi),%xmm6 - vpshufb %xmm11,%xmm4,%xmm4 - vmovdqu 112(%rsi),%xmm7 - vpshufb %xmm11,%xmm5,%xmm5 - vpaddq -128(%rbp),%xmm0,%xmm8 - vpshufb %xmm11,%xmm6,%xmm6 - vpaddq -96(%rbp),%xmm1,%xmm9 - vpshufb %xmm11,%xmm7,%xmm7 - vpaddq -64(%rbp),%xmm2,%xmm10 - vpaddq -32(%rbp),%xmm3,%xmm11 - vmovdqa %xmm8,0(%rsp) - vpaddq 0(%rbp),%xmm4,%xmm8 - vmovdqa %xmm9,16(%rsp) - vpaddq 32(%rbp),%xmm5,%xmm9 - vmovdqa %xmm10,32(%rsp) - vpaddq 64(%rbp),%xmm6,%xmm10 - vmovdqa %xmm11,48(%rsp) - vpaddq 96(%rbp),%xmm7,%xmm11 - vmovdqa %xmm8,64(%rsp) - movq %rax,%r14 - vmovdqa %xmm9,80(%rsp) - movq %rbx,%rdi - vmovdqa %xmm10,96(%rsp) - xorq %rcx,%rdi - vmovdqa %xmm11,112(%rsp) - movq %r8,%r13 - jmp .Lxop_00_47 - -.align 16 -.Lxop_00_47: - addq $256,%rbp - vpalignr $8,%xmm0,%xmm1,%xmm8 - rorq $23,%r13 - movq %r14,%rax - vpalignr $8,%xmm4,%xmm5,%xmm11 - movq %r9,%r12 - rorq $5,%r14 -.byte 143,72,120,195,200,56 - xorq %r8,%r13 - xorq %r10,%r12 - vpsrlq $7,%xmm8,%xmm8 - rorq $4,%r13 - xorq %rax,%r14 - vpaddq %xmm11,%xmm0,%xmm0 - andq %r8,%r12 - xorq %r8,%r13 - addq 0(%rsp),%r11 - movq %rax,%r15 -.byte 143,72,120,195,209,7 - xorq %r10,%r12 - rorq $6,%r14 - vpxor %xmm9,%xmm8,%xmm8 - xorq %rbx,%r15 - addq %r12,%r11 - rorq $14,%r13 - andq %r15,%rdi -.byte 143,104,120,195,223,3 - xorq %rax,%r14 - addq %r13,%r11 - vpxor %xmm10,%xmm8,%xmm8 - xorq %rbx,%rdi - rorq $28,%r14 - vpsrlq $6,%xmm7,%xmm10 - addq %r11,%rdx - addq %rdi,%r11 - vpaddq %xmm8,%xmm0,%xmm0 - movq %rdx,%r13 - addq %r11,%r14 -.byte 143,72,120,195,203,42 - rorq $23,%r13 - movq %r14,%r11 - vpxor %xmm10,%xmm11,%xmm11 - movq %r8,%r12 - rorq $5,%r14 - xorq %rdx,%r13 - xorq %r9,%r12 - vpxor %xmm9,%xmm11,%xmm11 - rorq $4,%r13 - xorq %r11,%r14 - andq %rdx,%r12 - xorq %rdx,%r13 - vpaddq %xmm11,%xmm0,%xmm0 - addq 8(%rsp),%r10 - movq %r11,%rdi - xorq %r9,%r12 - rorq $6,%r14 - vpaddq -128(%rbp),%xmm0,%xmm10 - xorq %rax,%rdi - addq %r12,%r10 - rorq $14,%r13 - andq %rdi,%r15 - xorq %r11,%r14 - addq %r13,%r10 - xorq %rax,%r15 - rorq $28,%r14 - addq %r10,%rcx - addq %r15,%r10 - movq %rcx,%r13 - addq %r10,%r14 - vmovdqa %xmm10,0(%rsp) - vpalignr $8,%xmm1,%xmm2,%xmm8 - rorq $23,%r13 - movq %r14,%r10 - vpalignr $8,%xmm5,%xmm6,%xmm11 - movq %rdx,%r12 - rorq $5,%r14 -.byte 143,72,120,195,200,56 - xorq %rcx,%r13 - xorq %r8,%r12 - vpsrlq $7,%xmm8,%xmm8 - rorq $4,%r13 - xorq %r10,%r14 - vpaddq %xmm11,%xmm1,%xmm1 - andq %rcx,%r12 - xorq %rcx,%r13 - addq 16(%rsp),%r9 - movq %r10,%r15 -.byte 143,72,120,195,209,7 - xorq %r8,%r12 - rorq $6,%r14 - vpxor %xmm9,%xmm8,%xmm8 - xorq %r11,%r15 - addq %r12,%r9 - rorq $14,%r13 - andq %r15,%rdi -.byte 143,104,120,195,216,3 - xorq %r10,%r14 - addq %r13,%r9 - vpxor %xmm10,%xmm8,%xmm8 - xorq %r11,%rdi - rorq $28,%r14 - vpsrlq $6,%xmm0,%xmm10 - addq %r9,%rbx - addq %rdi,%r9 - vpaddq %xmm8,%xmm1,%xmm1 - movq %rbx,%r13 - addq %r9,%r14 -.byte 143,72,120,195,203,42 - rorq $23,%r13 - movq %r14,%r9 - vpxor %xmm10,%xmm11,%xmm11 - movq %rcx,%r12 - rorq $5,%r14 - xorq %rbx,%r13 - xorq %rdx,%r12 - vpxor %xmm9,%xmm11,%xmm11 - rorq $4,%r13 - xorq %r9,%r14 - andq %rbx,%r12 - xorq %rbx,%r13 - vpaddq %xmm11,%xmm1,%xmm1 - addq 24(%rsp),%r8 - movq %r9,%rdi - xorq %rdx,%r12 - rorq $6,%r14 - vpaddq -96(%rbp),%xmm1,%xmm10 - xorq %r10,%rdi - addq %r12,%r8 - rorq $14,%r13 - andq %rdi,%r15 - xorq %r9,%r14 - addq %r13,%r8 - xorq %r10,%r15 - rorq $28,%r14 - addq %r8,%rax - addq %r15,%r8 - movq %rax,%r13 - addq %r8,%r14 - vmovdqa %xmm10,16(%rsp) - vpalignr $8,%xmm2,%xmm3,%xmm8 - rorq $23,%r13 - movq %r14,%r8 - vpalignr $8,%xmm6,%xmm7,%xmm11 - movq %rbx,%r12 - rorq $5,%r14 -.byte 143,72,120,195,200,56 - xorq %rax,%r13 - xorq %rcx,%r12 - vpsrlq $7,%xmm8,%xmm8 - rorq $4,%r13 - xorq %r8,%r14 - vpaddq %xmm11,%xmm2,%xmm2 - andq %rax,%r12 - xorq %rax,%r13 - addq 32(%rsp),%rdx - movq %r8,%r15 -.byte 143,72,120,195,209,7 - xorq %rcx,%r12 - rorq $6,%r14 - vpxor %xmm9,%xmm8,%xmm8 - xorq %r9,%r15 - addq %r12,%rdx - rorq $14,%r13 - andq %r15,%rdi -.byte 143,104,120,195,217,3 - xorq %r8,%r14 - addq %r13,%rdx - vpxor %xmm10,%xmm8,%xmm8 - xorq %r9,%rdi - rorq $28,%r14 - vpsrlq $6,%xmm1,%xmm10 - addq %rdx,%r11 - addq %rdi,%rdx - vpaddq %xmm8,%xmm2,%xmm2 - movq %r11,%r13 - addq %rdx,%r14 -.byte 143,72,120,195,203,42 - rorq $23,%r13 - movq %r14,%rdx - vpxor %xmm10,%xmm11,%xmm11 - movq %rax,%r12 - rorq $5,%r14 - xorq %r11,%r13 - xorq %rbx,%r12 - vpxor %xmm9,%xmm11,%xmm11 - rorq $4,%r13 - xorq %rdx,%r14 - andq %r11,%r12 - xorq %r11,%r13 - vpaddq %xmm11,%xmm2,%xmm2 - addq 40(%rsp),%rcx - movq %rdx,%rdi - xorq %rbx,%r12 - rorq $6,%r14 - vpaddq -64(%rbp),%xmm2,%xmm10 - xorq %r8,%rdi - addq %r12,%rcx - rorq $14,%r13 - andq %rdi,%r15 - xorq %rdx,%r14 - addq %r13,%rcx - xorq %r8,%r15 - rorq $28,%r14 - addq %rcx,%r10 - addq %r15,%rcx - movq %r10,%r13 - addq %rcx,%r14 - vmovdqa %xmm10,32(%rsp) - vpalignr $8,%xmm3,%xmm4,%xmm8 - rorq $23,%r13 - movq %r14,%rcx - vpalignr $8,%xmm7,%xmm0,%xmm11 - movq %r11,%r12 - rorq $5,%r14 -.byte 143,72,120,195,200,56 - xorq %r10,%r13 - xorq %rax,%r12 - vpsrlq $7,%xmm8,%xmm8 - rorq $4,%r13 - xorq %rcx,%r14 - vpaddq %xmm11,%xmm3,%xmm3 - andq %r10,%r12 - xorq %r10,%r13 - addq 48(%rsp),%rbx - movq %rcx,%r15 -.byte 143,72,120,195,209,7 - xorq %rax,%r12 - rorq $6,%r14 - vpxor %xmm9,%xmm8,%xmm8 - xorq %rdx,%r15 - addq %r12,%rbx - rorq $14,%r13 - andq %r15,%rdi -.byte 143,104,120,195,218,3 - xorq %rcx,%r14 - addq %r13,%rbx - vpxor %xmm10,%xmm8,%xmm8 - xorq %rdx,%rdi - rorq $28,%r14 - vpsrlq $6,%xmm2,%xmm10 - addq %rbx,%r9 - addq %rdi,%rbx - vpaddq %xmm8,%xmm3,%xmm3 - movq %r9,%r13 - addq %rbx,%r14 -.byte 143,72,120,195,203,42 - rorq $23,%r13 - movq %r14,%rbx - vpxor %xmm10,%xmm11,%xmm11 - movq %r10,%r12 - rorq $5,%r14 - xorq %r9,%r13 - xorq %r11,%r12 - vpxor %xmm9,%xmm11,%xmm11 - rorq $4,%r13 - xorq %rbx,%r14 - andq %r9,%r12 - xorq %r9,%r13 - vpaddq %xmm11,%xmm3,%xmm3 - addq 56(%rsp),%rax - movq %rbx,%rdi - xorq %r11,%r12 - rorq $6,%r14 - vpaddq -32(%rbp),%xmm3,%xmm10 - xorq %rcx,%rdi - addq %r12,%rax - rorq $14,%r13 - andq %rdi,%r15 - xorq %rbx,%r14 - addq %r13,%rax - xorq %rcx,%r15 - rorq $28,%r14 - addq %rax,%r8 - addq %r15,%rax - movq %r8,%r13 - addq %rax,%r14 - vmovdqa %xmm10,48(%rsp) - vpalignr $8,%xmm4,%xmm5,%xmm8 - rorq $23,%r13 - movq %r14,%rax - vpalignr $8,%xmm0,%xmm1,%xmm11 - movq %r9,%r12 - rorq $5,%r14 -.byte 143,72,120,195,200,56 - xorq %r8,%r13 - xorq %r10,%r12 - vpsrlq $7,%xmm8,%xmm8 - rorq $4,%r13 - xorq %rax,%r14 - vpaddq %xmm11,%xmm4,%xmm4 - andq %r8,%r12 - xorq %r8,%r13 - addq 64(%rsp),%r11 - movq %rax,%r15 -.byte 143,72,120,195,209,7 - xorq %r10,%r12 - rorq $6,%r14 - vpxor %xmm9,%xmm8,%xmm8 - xorq %rbx,%r15 - addq %r12,%r11 - rorq $14,%r13 - andq %r15,%rdi -.byte 143,104,120,195,219,3 - xorq %rax,%r14 - addq %r13,%r11 - vpxor %xmm10,%xmm8,%xmm8 - xorq %rbx,%rdi - rorq $28,%r14 - vpsrlq $6,%xmm3,%xmm10 - addq %r11,%rdx - addq %rdi,%r11 - vpaddq %xmm8,%xmm4,%xmm4 - movq %rdx,%r13 - addq %r11,%r14 -.byte 143,72,120,195,203,42 - rorq $23,%r13 - movq %r14,%r11 - vpxor %xmm10,%xmm11,%xmm11 - movq %r8,%r12 - rorq $5,%r14 - xorq %rdx,%r13 - xorq %r9,%r12 - vpxor %xmm9,%xmm11,%xmm11 - rorq $4,%r13 - xorq %r11,%r14 - andq %rdx,%r12 - xorq %rdx,%r13 - vpaddq %xmm11,%xmm4,%xmm4 - addq 72(%rsp),%r10 - movq %r11,%rdi - xorq %r9,%r12 - rorq $6,%r14 - vpaddq 0(%rbp),%xmm4,%xmm10 - xorq %rax,%rdi - addq %r12,%r10 - rorq $14,%r13 - andq %rdi,%r15 - xorq %r11,%r14 - addq %r13,%r10 - xorq %rax,%r15 - rorq $28,%r14 - addq %r10,%rcx - addq %r15,%r10 - movq %rcx,%r13 - addq %r10,%r14 - vmovdqa %xmm10,64(%rsp) - vpalignr $8,%xmm5,%xmm6,%xmm8 - rorq $23,%r13 - movq %r14,%r10 - vpalignr $8,%xmm1,%xmm2,%xmm11 - movq %rdx,%r12 - rorq $5,%r14 -.byte 143,72,120,195,200,56 - xorq %rcx,%r13 - xorq %r8,%r12 - vpsrlq $7,%xmm8,%xmm8 - rorq $4,%r13 - xorq %r10,%r14 - vpaddq %xmm11,%xmm5,%xmm5 - andq %rcx,%r12 - xorq %rcx,%r13 - addq 80(%rsp),%r9 - movq %r10,%r15 -.byte 143,72,120,195,209,7 - xorq %r8,%r12 - rorq $6,%r14 - vpxor %xmm9,%xmm8,%xmm8 - xorq %r11,%r15 - addq %r12,%r9 - rorq $14,%r13 - andq %r15,%rdi -.byte 143,104,120,195,220,3 - xorq %r10,%r14 - addq %r13,%r9 - vpxor %xmm10,%xmm8,%xmm8 - xorq %r11,%rdi - rorq $28,%r14 - vpsrlq $6,%xmm4,%xmm10 - addq %r9,%rbx - addq %rdi,%r9 - vpaddq %xmm8,%xmm5,%xmm5 - movq %rbx,%r13 - addq %r9,%r14 -.byte 143,72,120,195,203,42 - rorq $23,%r13 - movq %r14,%r9 - vpxor %xmm10,%xmm11,%xmm11 - movq %rcx,%r12 - rorq $5,%r14 - xorq %rbx,%r13 - xorq %rdx,%r12 - vpxor %xmm9,%xmm11,%xmm11 - rorq $4,%r13 - xorq %r9,%r14 - andq %rbx,%r12 - xorq %rbx,%r13 - vpaddq %xmm11,%xmm5,%xmm5 - addq 88(%rsp),%r8 - movq %r9,%rdi - xorq %rdx,%r12 - rorq $6,%r14 - vpaddq 32(%rbp),%xmm5,%xmm10 - xorq %r10,%rdi - addq %r12,%r8 - rorq $14,%r13 - andq %rdi,%r15 - xorq %r9,%r14 - addq %r13,%r8 - xorq %r10,%r15 - rorq $28,%r14 - addq %r8,%rax - addq %r15,%r8 - movq %rax,%r13 - addq %r8,%r14 - vmovdqa %xmm10,80(%rsp) - vpalignr $8,%xmm6,%xmm7,%xmm8 - rorq $23,%r13 - movq %r14,%r8 - vpalignr $8,%xmm2,%xmm3,%xmm11 - movq %rbx,%r12 - rorq $5,%r14 -.byte 143,72,120,195,200,56 - xorq %rax,%r13 - xorq %rcx,%r12 - vpsrlq $7,%xmm8,%xmm8 - rorq $4,%r13 - xorq %r8,%r14 - vpaddq %xmm11,%xmm6,%xmm6 - andq %rax,%r12 - xorq %rax,%r13 - addq 96(%rsp),%rdx - movq %r8,%r15 -.byte 143,72,120,195,209,7 - xorq %rcx,%r12 - rorq $6,%r14 - vpxor %xmm9,%xmm8,%xmm8 - xorq %r9,%r15 - addq %r12,%rdx - rorq $14,%r13 - andq %r15,%rdi -.byte 143,104,120,195,221,3 - xorq %r8,%r14 - addq %r13,%rdx - vpxor %xmm10,%xmm8,%xmm8 - xorq %r9,%rdi - rorq $28,%r14 - vpsrlq $6,%xmm5,%xmm10 - addq %rdx,%r11 - addq %rdi,%rdx - vpaddq %xmm8,%xmm6,%xmm6 - movq %r11,%r13 - addq %rdx,%r14 -.byte 143,72,120,195,203,42 - rorq $23,%r13 - movq %r14,%rdx - vpxor %xmm10,%xmm11,%xmm11 - movq %rax,%r12 - rorq $5,%r14 - xorq %r11,%r13 - xorq %rbx,%r12 - vpxor %xmm9,%xmm11,%xmm11 - rorq $4,%r13 - xorq %rdx,%r14 - andq %r11,%r12 - xorq %r11,%r13 - vpaddq %xmm11,%xmm6,%xmm6 - addq 104(%rsp),%rcx - movq %rdx,%rdi - xorq %rbx,%r12 - rorq $6,%r14 - vpaddq 64(%rbp),%xmm6,%xmm10 - xorq %r8,%rdi - addq %r12,%rcx - rorq $14,%r13 - andq %rdi,%r15 - xorq %rdx,%r14 - addq %r13,%rcx - xorq %r8,%r15 - rorq $28,%r14 - addq %rcx,%r10 - addq %r15,%rcx - movq %r10,%r13 - addq %rcx,%r14 - vmovdqa %xmm10,96(%rsp) - vpalignr $8,%xmm7,%xmm0,%xmm8 - rorq $23,%r13 - movq %r14,%rcx - vpalignr $8,%xmm3,%xmm4,%xmm11 - movq %r11,%r12 - rorq $5,%r14 -.byte 143,72,120,195,200,56 - xorq %r10,%r13 - xorq %rax,%r12 - vpsrlq $7,%xmm8,%xmm8 - rorq $4,%r13 - xorq %rcx,%r14 - vpaddq %xmm11,%xmm7,%xmm7 - andq %r10,%r12 - xorq %r10,%r13 - addq 112(%rsp),%rbx - movq %rcx,%r15 -.byte 143,72,120,195,209,7 - xorq %rax,%r12 - rorq $6,%r14 - vpxor %xmm9,%xmm8,%xmm8 - xorq %rdx,%r15 - addq %r12,%rbx - rorq $14,%r13 - andq %r15,%rdi -.byte 143,104,120,195,222,3 - xorq %rcx,%r14 - addq %r13,%rbx - vpxor %xmm10,%xmm8,%xmm8 - xorq %rdx,%rdi - rorq $28,%r14 - vpsrlq $6,%xmm6,%xmm10 - addq %rbx,%r9 - addq %rdi,%rbx - vpaddq %xmm8,%xmm7,%xmm7 - movq %r9,%r13 - addq %rbx,%r14 -.byte 143,72,120,195,203,42 - rorq $23,%r13 - movq %r14,%rbx - vpxor %xmm10,%xmm11,%xmm11 - movq %r10,%r12 - rorq $5,%r14 - xorq %r9,%r13 - xorq %r11,%r12 - vpxor %xmm9,%xmm11,%xmm11 - rorq $4,%r13 - xorq %rbx,%r14 - andq %r9,%r12 - xorq %r9,%r13 - vpaddq %xmm11,%xmm7,%xmm7 - addq 120(%rsp),%rax - movq %rbx,%rdi - xorq %r11,%r12 - rorq $6,%r14 - vpaddq 96(%rbp),%xmm7,%xmm10 - xorq %rcx,%rdi - addq %r12,%rax - rorq $14,%r13 - andq %rdi,%r15 - xorq %rbx,%r14 - addq %r13,%rax - xorq %rcx,%r15 - rorq $28,%r14 - addq %rax,%r8 - addq %r15,%rax - movq %r8,%r13 - addq %rax,%r14 - vmovdqa %xmm10,112(%rsp) - cmpb $0,135(%rbp) - jne .Lxop_00_47 - rorq $23,%r13 - movq %r14,%rax - movq %r9,%r12 - rorq $5,%r14 - xorq %r8,%r13 - xorq %r10,%r12 - rorq $4,%r13 - xorq %rax,%r14 - andq %r8,%r12 - xorq %r8,%r13 - addq 0(%rsp),%r11 - movq %rax,%r15 - xorq %r10,%r12 - rorq $6,%r14 - xorq %rbx,%r15 - addq %r12,%r11 - rorq $14,%r13 - andq %r15,%rdi - xorq %rax,%r14 - addq %r13,%r11 - xorq %rbx,%rdi - rorq $28,%r14 - addq %r11,%rdx - addq %rdi,%r11 - movq %rdx,%r13 - addq %r11,%r14 - rorq $23,%r13 - movq %r14,%r11 - movq %r8,%r12 - rorq $5,%r14 - xorq %rdx,%r13 - xorq %r9,%r12 - rorq $4,%r13 - xorq %r11,%r14 - andq %rdx,%r12 - xorq %rdx,%r13 - addq 8(%rsp),%r10 - movq %r11,%rdi - xorq %r9,%r12 - rorq $6,%r14 - xorq %rax,%rdi - addq %r12,%r10 - rorq $14,%r13 - andq %rdi,%r15 - xorq %r11,%r14 - addq %r13,%r10 - xorq %rax,%r15 - rorq $28,%r14 - addq %r10,%rcx - addq %r15,%r10 - movq %rcx,%r13 - addq %r10,%r14 - rorq $23,%r13 - movq %r14,%r10 - movq %rdx,%r12 - rorq $5,%r14 - xorq %rcx,%r13 - xorq %r8,%r12 - rorq $4,%r13 - xorq %r10,%r14 - andq %rcx,%r12 - xorq %rcx,%r13 - addq 16(%rsp),%r9 - movq %r10,%r15 - xorq %r8,%r12 - rorq $6,%r14 - xorq %r11,%r15 - addq %r12,%r9 - rorq $14,%r13 - andq %r15,%rdi - xorq %r10,%r14 - addq %r13,%r9 - xorq %r11,%rdi - rorq $28,%r14 - addq %r9,%rbx - addq %rdi,%r9 - movq %rbx,%r13 - addq %r9,%r14 - rorq $23,%r13 - movq %r14,%r9 - movq %rcx,%r12 - rorq $5,%r14 - xorq %rbx,%r13 - xorq %rdx,%r12 - rorq $4,%r13 - xorq %r9,%r14 - andq %rbx,%r12 - xorq %rbx,%r13 - addq 24(%rsp),%r8 - movq %r9,%rdi - xorq %rdx,%r12 - rorq $6,%r14 - xorq %r10,%rdi - addq %r12,%r8 - rorq $14,%r13 - andq %rdi,%r15 - xorq %r9,%r14 - addq %r13,%r8 - xorq %r10,%r15 - rorq $28,%r14 - addq %r8,%rax - addq %r15,%r8 - movq %rax,%r13 - addq %r8,%r14 - rorq $23,%r13 - movq %r14,%r8 - movq %rbx,%r12 - rorq $5,%r14 - xorq %rax,%r13 - xorq %rcx,%r12 - rorq $4,%r13 - xorq %r8,%r14 - andq %rax,%r12 - xorq %rax,%r13 - addq 32(%rsp),%rdx - movq %r8,%r15 - xorq %rcx,%r12 - rorq $6,%r14 - xorq %r9,%r15 - addq %r12,%rdx - rorq $14,%r13 - andq %r15,%rdi - xorq %r8,%r14 - addq %r13,%rdx - xorq %r9,%rdi - rorq $28,%r14 - addq %rdx,%r11 - addq %rdi,%rdx - movq %r11,%r13 - addq %rdx,%r14 - rorq $23,%r13 - movq %r14,%rdx - movq %rax,%r12 - rorq $5,%r14 - xorq %r11,%r13 - xorq %rbx,%r12 - rorq $4,%r13 - xorq %rdx,%r14 - andq %r11,%r12 - xorq %r11,%r13 - addq 40(%rsp),%rcx - movq %rdx,%rdi - xorq %rbx,%r12 - rorq $6,%r14 - xorq %r8,%rdi - addq %r12,%rcx - rorq $14,%r13 - andq %rdi,%r15 - xorq %rdx,%r14 - addq %r13,%rcx - xorq %r8,%r15 - rorq $28,%r14 - addq %rcx,%r10 - addq %r15,%rcx - movq %r10,%r13 - addq %rcx,%r14 - rorq $23,%r13 - movq %r14,%rcx - movq %r11,%r12 - rorq $5,%r14 - xorq %r10,%r13 - xorq %rax,%r12 - rorq $4,%r13 - xorq %rcx,%r14 - andq %r10,%r12 - xorq %r10,%r13 - addq 48(%rsp),%rbx - movq %rcx,%r15 - xorq %rax,%r12 - rorq $6,%r14 - xorq %rdx,%r15 - addq %r12,%rbx - rorq $14,%r13 - andq %r15,%rdi - xorq %rcx,%r14 - addq %r13,%rbx - xorq %rdx,%rdi - rorq $28,%r14 - addq %rbx,%r9 - addq %rdi,%rbx - movq %r9,%r13 - addq %rbx,%r14 - rorq $23,%r13 - movq %r14,%rbx - movq %r10,%r12 - rorq $5,%r14 - xorq %r9,%r13 - xorq %r11,%r12 - rorq $4,%r13 - xorq %rbx,%r14 - andq %r9,%r12 - xorq %r9,%r13 - addq 56(%rsp),%rax - movq %rbx,%rdi - xorq %r11,%r12 - rorq $6,%r14 - xorq %rcx,%rdi - addq %r12,%rax - rorq $14,%r13 - andq %rdi,%r15 - xorq %rbx,%r14 - addq %r13,%rax - xorq %rcx,%r15 - rorq $28,%r14 - addq %rax,%r8 - addq %r15,%rax - movq %r8,%r13 - addq %rax,%r14 - rorq $23,%r13 - movq %r14,%rax - movq %r9,%r12 - rorq $5,%r14 - xorq %r8,%r13 - xorq %r10,%r12 - rorq $4,%r13 - xorq %rax,%r14 - andq %r8,%r12 - xorq %r8,%r13 - addq 64(%rsp),%r11 - movq %rax,%r15 - xorq %r10,%r12 - rorq $6,%r14 - xorq %rbx,%r15 - addq %r12,%r11 - rorq $14,%r13 - andq %r15,%rdi - xorq %rax,%r14 - addq %r13,%r11 - xorq %rbx,%rdi - rorq $28,%r14 - addq %r11,%rdx - addq %rdi,%r11 - movq %rdx,%r13 - addq %r11,%r14 - rorq $23,%r13 - movq %r14,%r11 - movq %r8,%r12 - rorq $5,%r14 - xorq %rdx,%r13 - xorq %r9,%r12 - rorq $4,%r13 - xorq %r11,%r14 - andq %rdx,%r12 - xorq %rdx,%r13 - addq 72(%rsp),%r10 - movq %r11,%rdi - xorq %r9,%r12 - rorq $6,%r14 - xorq %rax,%rdi - addq %r12,%r10 - rorq $14,%r13 - andq %rdi,%r15 - xorq %r11,%r14 - addq %r13,%r10 - xorq %rax,%r15 - rorq $28,%r14 - addq %r10,%rcx - addq %r15,%r10 - movq %rcx,%r13 - addq %r10,%r14 - rorq $23,%r13 - movq %r14,%r10 - movq %rdx,%r12 - rorq $5,%r14 - xorq %rcx,%r13 - xorq %r8,%r12 - rorq $4,%r13 - xorq %r10,%r14 - andq %rcx,%r12 - xorq %rcx,%r13 - addq 80(%rsp),%r9 - movq %r10,%r15 - xorq %r8,%r12 - rorq $6,%r14 - xorq %r11,%r15 - addq %r12,%r9 - rorq $14,%r13 - andq %r15,%rdi - xorq %r10,%r14 - addq %r13,%r9 - xorq %r11,%rdi - rorq $28,%r14 - addq %r9,%rbx - addq %rdi,%r9 - movq %rbx,%r13 - addq %r9,%r14 - rorq $23,%r13 - movq %r14,%r9 - movq %rcx,%r12 - rorq $5,%r14 - xorq %rbx,%r13 - xorq %rdx,%r12 - rorq $4,%r13 - xorq %r9,%r14 - andq %rbx,%r12 - xorq %rbx,%r13 - addq 88(%rsp),%r8 - movq %r9,%rdi - xorq %rdx,%r12 - rorq $6,%r14 - xorq %r10,%rdi - addq %r12,%r8 - rorq $14,%r13 - andq %rdi,%r15 - xorq %r9,%r14 - addq %r13,%r8 - xorq %r10,%r15 - rorq $28,%r14 - addq %r8,%rax - addq %r15,%r8 - movq %rax,%r13 - addq %r8,%r14 - rorq $23,%r13 - movq %r14,%r8 - movq %rbx,%r12 - rorq $5,%r14 - xorq %rax,%r13 - xorq %rcx,%r12 - rorq $4,%r13 - xorq %r8,%r14 - andq %rax,%r12 - xorq %rax,%r13 - addq 96(%rsp),%rdx - movq %r8,%r15 - xorq %rcx,%r12 - rorq $6,%r14 - xorq %r9,%r15 - addq %r12,%rdx - rorq $14,%r13 - andq %r15,%rdi - xorq %r8,%r14 - addq %r13,%rdx - xorq %r9,%rdi - rorq $28,%r14 - addq %rdx,%r11 - addq %rdi,%rdx - movq %r11,%r13 - addq %rdx,%r14 - rorq $23,%r13 - movq %r14,%rdx - movq %rax,%r12 - rorq $5,%r14 - xorq %r11,%r13 - xorq %rbx,%r12 - rorq $4,%r13 - xorq %rdx,%r14 - andq %r11,%r12 - xorq %r11,%r13 - addq 104(%rsp),%rcx - movq %rdx,%rdi - xorq %rbx,%r12 - rorq $6,%r14 - xorq %r8,%rdi - addq %r12,%rcx - rorq $14,%r13 - andq %rdi,%r15 - xorq %rdx,%r14 - addq %r13,%rcx - xorq %r8,%r15 - rorq $28,%r14 - addq %rcx,%r10 - addq %r15,%rcx - movq %r10,%r13 - addq %rcx,%r14 - rorq $23,%r13 - movq %r14,%rcx - movq %r11,%r12 - rorq $5,%r14 - xorq %r10,%r13 - xorq %rax,%r12 - rorq $4,%r13 - xorq %rcx,%r14 - andq %r10,%r12 - xorq %r10,%r13 - addq 112(%rsp),%rbx - movq %rcx,%r15 - xorq %rax,%r12 - rorq $6,%r14 - xorq %rdx,%r15 - addq %r12,%rbx - rorq $14,%r13 - andq %r15,%rdi - xorq %rcx,%r14 - addq %r13,%rbx - xorq %rdx,%rdi - rorq $28,%r14 - addq %rbx,%r9 - addq %rdi,%rbx - movq %r9,%r13 - addq %rbx,%r14 - rorq $23,%r13 - movq %r14,%rbx - movq %r10,%r12 - rorq $5,%r14 - xorq %r9,%r13 - xorq %r11,%r12 - rorq $4,%r13 - xorq %rbx,%r14 - andq %r9,%r12 - xorq %r9,%r13 - addq 120(%rsp),%rax - movq %rbx,%rdi - xorq %r11,%r12 - rorq $6,%r14 - xorq %rcx,%rdi - addq %r12,%rax - rorq $14,%r13 - andq %rdi,%r15 - xorq %rbx,%r14 - addq %r13,%rax - xorq %rcx,%r15 - rorq $28,%r14 - addq %rax,%r8 - addq %r15,%rax - movq %r8,%r13 - addq %rax,%r14 - movq 128+0(%rsp),%rdi - movq %r14,%rax - - addq 0(%rdi),%rax - leaq 128(%rsi),%rsi - addq 8(%rdi),%rbx - addq 16(%rdi),%rcx - addq 24(%rdi),%rdx - addq 32(%rdi),%r8 - addq 40(%rdi),%r9 - addq 48(%rdi),%r10 - addq 56(%rdi),%r11 - - cmpq 128+16(%rsp),%rsi - - movq %rax,0(%rdi) - movq %rbx,8(%rdi) - movq %rcx,16(%rdi) - movq %rdx,24(%rdi) - movq %r8,32(%rdi) - movq %r9,40(%rdi) - movq %r10,48(%rdi) - movq %r11,56(%rdi) - jb .Lloop_xop - - movq 128+24(%rsp),%rsi - vzeroupper - movq (%rsi),%r15 - movq 8(%rsi),%r14 - movq 16(%rsi),%r13 - movq 24(%rsi),%r12 - movq 32(%rsi),%rbp - movq 40(%rsi),%rbx - leaq 48(%rsi),%rsp -.Lepilogue_xop: - .byte 0xf3,0xc3 -.size sha512_block_data_order_xop,.-sha512_block_data_order_xop -.type sha512_block_data_order_avx,@function -.align 64 -sha512_block_data_order_avx: -.Lavx_shortcut: - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - movq %rsp,%r11 - shlq $4,%rdx - subq $160,%rsp - leaq (%rsi,%rdx,8),%rdx - andq $-64,%rsp - movq %rdi,128+0(%rsp) - movq %rsi,128+8(%rsp) - movq %rdx,128+16(%rsp) - movq %r11,128+24(%rsp) -.Lprologue_avx: - - vzeroupper - movq 0(%rdi),%rax - movq 8(%rdi),%rbx - movq 16(%rdi),%rcx - movq 24(%rdi),%rdx - movq 32(%rdi),%r8 - movq 40(%rdi),%r9 - movq 48(%rdi),%r10 - movq 56(%rdi),%r11 - jmp .Lloop_avx -.align 16 -.Lloop_avx: - vmovdqa K512+1280(%rip),%xmm11 - vmovdqu 0(%rsi),%xmm0 - leaq K512+128(%rip),%rbp - vmovdqu 16(%rsi),%xmm1 - vmovdqu 32(%rsi),%xmm2 - vpshufb %xmm11,%xmm0,%xmm0 - vmovdqu 48(%rsi),%xmm3 - vpshufb %xmm11,%xmm1,%xmm1 - vmovdqu 64(%rsi),%xmm4 - vpshufb %xmm11,%xmm2,%xmm2 - vmovdqu 80(%rsi),%xmm5 - vpshufb %xmm11,%xmm3,%xmm3 - vmovdqu 96(%rsi),%xmm6 - vpshufb %xmm11,%xmm4,%xmm4 - vmovdqu 112(%rsi),%xmm7 - vpshufb %xmm11,%xmm5,%xmm5 - vpaddq -128(%rbp),%xmm0,%xmm8 - vpshufb %xmm11,%xmm6,%xmm6 - vpaddq -96(%rbp),%xmm1,%xmm9 - vpshufb %xmm11,%xmm7,%xmm7 - vpaddq -64(%rbp),%xmm2,%xmm10 - vpaddq -32(%rbp),%xmm3,%xmm11 - vmovdqa %xmm8,0(%rsp) - vpaddq 0(%rbp),%xmm4,%xmm8 - vmovdqa %xmm9,16(%rsp) - vpaddq 32(%rbp),%xmm5,%xmm9 - vmovdqa %xmm10,32(%rsp) - vpaddq 64(%rbp),%xmm6,%xmm10 - vmovdqa %xmm11,48(%rsp) - vpaddq 96(%rbp),%xmm7,%xmm11 - vmovdqa %xmm8,64(%rsp) - movq %rax,%r14 - vmovdqa %xmm9,80(%rsp) - movq %rbx,%rdi - vmovdqa %xmm10,96(%rsp) - xorq %rcx,%rdi - vmovdqa %xmm11,112(%rsp) - movq %r8,%r13 - jmp .Lavx_00_47 - -.align 16 -.Lavx_00_47: - addq $256,%rbp - vpalignr $8,%xmm0,%xmm1,%xmm8 - shrdq $23,%r13,%r13 - movq %r14,%rax - vpalignr $8,%xmm4,%xmm5,%xmm11 - movq %r9,%r12 - shrdq $5,%r14,%r14 - vpsrlq $1,%xmm8,%xmm10 - xorq %r8,%r13 - xorq %r10,%r12 - vpaddq %xmm11,%xmm0,%xmm0 - shrdq $4,%r13,%r13 - xorq %rax,%r14 - vpsrlq $7,%xmm8,%xmm11 - andq %r8,%r12 - xorq %r8,%r13 - vpsllq $56,%xmm8,%xmm9 - addq 0(%rsp),%r11 - movq %rax,%r15 - vpxor %xmm10,%xmm11,%xmm8 - xorq %r10,%r12 - shrdq $6,%r14,%r14 - vpsrlq $7,%xmm10,%xmm10 - xorq %rbx,%r15 - addq %r12,%r11 - vpxor %xmm9,%xmm8,%xmm8 - shrdq $14,%r13,%r13 - andq %r15,%rdi - vpsllq $7,%xmm9,%xmm9 - xorq %rax,%r14 - addq %r13,%r11 - vpxor %xmm10,%xmm8,%xmm8 - xorq %rbx,%rdi - shrdq $28,%r14,%r14 - vpsrlq $6,%xmm7,%xmm11 - addq %r11,%rdx - addq %rdi,%r11 - vpxor %xmm9,%xmm8,%xmm8 - movq %rdx,%r13 - addq %r11,%r14 - vpsllq $3,%xmm7,%xmm10 - shrdq $23,%r13,%r13 - movq %r14,%r11 - vpaddq %xmm8,%xmm0,%xmm0 - movq %r8,%r12 - shrdq $5,%r14,%r14 - vpsrlq $19,%xmm7,%xmm9 - xorq %rdx,%r13 - xorq %r9,%r12 - vpxor %xmm10,%xmm11,%xmm11 - shrdq $4,%r13,%r13 - xorq %r11,%r14 - vpsllq $42,%xmm10,%xmm10 - andq %rdx,%r12 - xorq %rdx,%r13 - vpxor %xmm9,%xmm11,%xmm11 - addq 8(%rsp),%r10 - movq %r11,%rdi - vpsrlq $42,%xmm9,%xmm9 - xorq %r9,%r12 - shrdq $6,%r14,%r14 - vpxor %xmm10,%xmm11,%xmm11 - xorq %rax,%rdi - addq %r12,%r10 - vpxor %xmm9,%xmm11,%xmm11 - shrdq $14,%r13,%r13 - andq %rdi,%r15 - vpaddq %xmm11,%xmm0,%xmm0 - xorq %r11,%r14 - addq %r13,%r10 - vpaddq -128(%rbp),%xmm0,%xmm10 - xorq %rax,%r15 - shrdq $28,%r14,%r14 - addq %r10,%rcx - addq %r15,%r10 - movq %rcx,%r13 - addq %r10,%r14 - vmovdqa %xmm10,0(%rsp) - vpalignr $8,%xmm1,%xmm2,%xmm8 - shrdq $23,%r13,%r13 - movq %r14,%r10 - vpalignr $8,%xmm5,%xmm6,%xmm11 - movq %rdx,%r12 - shrdq $5,%r14,%r14 - vpsrlq $1,%xmm8,%xmm10 - xorq %rcx,%r13 - xorq %r8,%r12 - vpaddq %xmm11,%xmm1,%xmm1 - shrdq $4,%r13,%r13 - xorq %r10,%r14 - vpsrlq $7,%xmm8,%xmm11 - andq %rcx,%r12 - xorq %rcx,%r13 - vpsllq $56,%xmm8,%xmm9 - addq 16(%rsp),%r9 - movq %r10,%r15 - vpxor %xmm10,%xmm11,%xmm8 - xorq %r8,%r12 - shrdq $6,%r14,%r14 - vpsrlq $7,%xmm10,%xmm10 - xorq %r11,%r15 - addq %r12,%r9 - vpxor %xmm9,%xmm8,%xmm8 - shrdq $14,%r13,%r13 - andq %r15,%rdi - vpsllq $7,%xmm9,%xmm9 - xorq %r10,%r14 - addq %r13,%r9 - vpxor %xmm10,%xmm8,%xmm8 - xorq %r11,%rdi - shrdq $28,%r14,%r14 - vpsrlq $6,%xmm0,%xmm11 - addq %r9,%rbx - addq %rdi,%r9 - vpxor %xmm9,%xmm8,%xmm8 - movq %rbx,%r13 - addq %r9,%r14 - vpsllq $3,%xmm0,%xmm10 - shrdq $23,%r13,%r13 - movq %r14,%r9 - vpaddq %xmm8,%xmm1,%xmm1 - movq %rcx,%r12 - shrdq $5,%r14,%r14 - vpsrlq $19,%xmm0,%xmm9 - xorq %rbx,%r13 - xorq %rdx,%r12 - vpxor %xmm10,%xmm11,%xmm11 - shrdq $4,%r13,%r13 - xorq %r9,%r14 - vpsllq $42,%xmm10,%xmm10 - andq %rbx,%r12 - xorq %rbx,%r13 - vpxor %xmm9,%xmm11,%xmm11 - addq 24(%rsp),%r8 - movq %r9,%rdi - vpsrlq $42,%xmm9,%xmm9 - xorq %rdx,%r12 - shrdq $6,%r14,%r14 - vpxor %xmm10,%xmm11,%xmm11 - xorq %r10,%rdi - addq %r12,%r8 - vpxor %xmm9,%xmm11,%xmm11 - shrdq $14,%r13,%r13 - andq %rdi,%r15 - vpaddq %xmm11,%xmm1,%xmm1 - xorq %r9,%r14 - addq %r13,%r8 - vpaddq -96(%rbp),%xmm1,%xmm10 - xorq %r10,%r15 - shrdq $28,%r14,%r14 - addq %r8,%rax - addq %r15,%r8 - movq %rax,%r13 - addq %r8,%r14 - vmovdqa %xmm10,16(%rsp) - vpalignr $8,%xmm2,%xmm3,%xmm8 - shrdq $23,%r13,%r13 - movq %r14,%r8 - vpalignr $8,%xmm6,%xmm7,%xmm11 - movq %rbx,%r12 - shrdq $5,%r14,%r14 - vpsrlq $1,%xmm8,%xmm10 - xorq %rax,%r13 - xorq %rcx,%r12 - vpaddq %xmm11,%xmm2,%xmm2 - shrdq $4,%r13,%r13 - xorq %r8,%r14 - vpsrlq $7,%xmm8,%xmm11 - andq %rax,%r12 - xorq %rax,%r13 - vpsllq $56,%xmm8,%xmm9 - addq 32(%rsp),%rdx - movq %r8,%r15 - vpxor %xmm10,%xmm11,%xmm8 - xorq %rcx,%r12 - shrdq $6,%r14,%r14 - vpsrlq $7,%xmm10,%xmm10 - xorq %r9,%r15 - addq %r12,%rdx - vpxor %xmm9,%xmm8,%xmm8 - shrdq $14,%r13,%r13 - andq %r15,%rdi - vpsllq $7,%xmm9,%xmm9 - xorq %r8,%r14 - addq %r13,%rdx - vpxor %xmm10,%xmm8,%xmm8 - xorq %r9,%rdi - shrdq $28,%r14,%r14 - vpsrlq $6,%xmm1,%xmm11 - addq %rdx,%r11 - addq %rdi,%rdx - vpxor %xmm9,%xmm8,%xmm8 - movq %r11,%r13 - addq %rdx,%r14 - vpsllq $3,%xmm1,%xmm10 - shrdq $23,%r13,%r13 - movq %r14,%rdx - vpaddq %xmm8,%xmm2,%xmm2 - movq %rax,%r12 - shrdq $5,%r14,%r14 - vpsrlq $19,%xmm1,%xmm9 - xorq %r11,%r13 - xorq %rbx,%r12 - vpxor %xmm10,%xmm11,%xmm11 - shrdq $4,%r13,%r13 - xorq %rdx,%r14 - vpsllq $42,%xmm10,%xmm10 - andq %r11,%r12 - xorq %r11,%r13 - vpxor %xmm9,%xmm11,%xmm11 - addq 40(%rsp),%rcx - movq %rdx,%rdi - vpsrlq $42,%xmm9,%xmm9 - xorq %rbx,%r12 - shrdq $6,%r14,%r14 - vpxor %xmm10,%xmm11,%xmm11 - xorq %r8,%rdi - addq %r12,%rcx - vpxor %xmm9,%xmm11,%xmm11 - shrdq $14,%r13,%r13 - andq %rdi,%r15 - vpaddq %xmm11,%xmm2,%xmm2 - xorq %rdx,%r14 - addq %r13,%rcx - vpaddq -64(%rbp),%xmm2,%xmm10 - xorq %r8,%r15 - shrdq $28,%r14,%r14 - addq %rcx,%r10 - addq %r15,%rcx - movq %r10,%r13 - addq %rcx,%r14 - vmovdqa %xmm10,32(%rsp) - vpalignr $8,%xmm3,%xmm4,%xmm8 - shrdq $23,%r13,%r13 - movq %r14,%rcx - vpalignr $8,%xmm7,%xmm0,%xmm11 - movq %r11,%r12 - shrdq $5,%r14,%r14 - vpsrlq $1,%xmm8,%xmm10 - xorq %r10,%r13 - xorq %rax,%r12 - vpaddq %xmm11,%xmm3,%xmm3 - shrdq $4,%r13,%r13 - xorq %rcx,%r14 - vpsrlq $7,%xmm8,%xmm11 - andq %r10,%r12 - xorq %r10,%r13 - vpsllq $56,%xmm8,%xmm9 - addq 48(%rsp),%rbx - movq %rcx,%r15 - vpxor %xmm10,%xmm11,%xmm8 - xorq %rax,%r12 - shrdq $6,%r14,%r14 - vpsrlq $7,%xmm10,%xmm10 - xorq %rdx,%r15 - addq %r12,%rbx - vpxor %xmm9,%xmm8,%xmm8 - shrdq $14,%r13,%r13 - andq %r15,%rdi - vpsllq $7,%xmm9,%xmm9 - xorq %rcx,%r14 - addq %r13,%rbx - vpxor %xmm10,%xmm8,%xmm8 - xorq %rdx,%rdi - shrdq $28,%r14,%r14 - vpsrlq $6,%xmm2,%xmm11 - addq %rbx,%r9 - addq %rdi,%rbx - vpxor %xmm9,%xmm8,%xmm8 - movq %r9,%r13 - addq %rbx,%r14 - vpsllq $3,%xmm2,%xmm10 - shrdq $23,%r13,%r13 - movq %r14,%rbx - vpaddq %xmm8,%xmm3,%xmm3 - movq %r10,%r12 - shrdq $5,%r14,%r14 - vpsrlq $19,%xmm2,%xmm9 - xorq %r9,%r13 - xorq %r11,%r12 - vpxor %xmm10,%xmm11,%xmm11 - shrdq $4,%r13,%r13 - xorq %rbx,%r14 - vpsllq $42,%xmm10,%xmm10 - andq %r9,%r12 - xorq %r9,%r13 - vpxor %xmm9,%xmm11,%xmm11 - addq 56(%rsp),%rax - movq %rbx,%rdi - vpsrlq $42,%xmm9,%xmm9 - xorq %r11,%r12 - shrdq $6,%r14,%r14 - vpxor %xmm10,%xmm11,%xmm11 - xorq %rcx,%rdi - addq %r12,%rax - vpxor %xmm9,%xmm11,%xmm11 - shrdq $14,%r13,%r13 - andq %rdi,%r15 - vpaddq %xmm11,%xmm3,%xmm3 - xorq %rbx,%r14 - addq %r13,%rax - vpaddq -32(%rbp),%xmm3,%xmm10 - xorq %rcx,%r15 - shrdq $28,%r14,%r14 - addq %rax,%r8 - addq %r15,%rax - movq %r8,%r13 - addq %rax,%r14 - vmovdqa %xmm10,48(%rsp) - vpalignr $8,%xmm4,%xmm5,%xmm8 - shrdq $23,%r13,%r13 - movq %r14,%rax - vpalignr $8,%xmm0,%xmm1,%xmm11 - movq %r9,%r12 - shrdq $5,%r14,%r14 - vpsrlq $1,%xmm8,%xmm10 - xorq %r8,%r13 - xorq %r10,%r12 - vpaddq %xmm11,%xmm4,%xmm4 - shrdq $4,%r13,%r13 - xorq %rax,%r14 - vpsrlq $7,%xmm8,%xmm11 - andq %r8,%r12 - xorq %r8,%r13 - vpsllq $56,%xmm8,%xmm9 - addq 64(%rsp),%r11 - movq %rax,%r15 - vpxor %xmm10,%xmm11,%xmm8 - xorq %r10,%r12 - shrdq $6,%r14,%r14 - vpsrlq $7,%xmm10,%xmm10 - xorq %rbx,%r15 - addq %r12,%r11 - vpxor %xmm9,%xmm8,%xmm8 - shrdq $14,%r13,%r13 - andq %r15,%rdi - vpsllq $7,%xmm9,%xmm9 - xorq %rax,%r14 - addq %r13,%r11 - vpxor %xmm10,%xmm8,%xmm8 - xorq %rbx,%rdi - shrdq $28,%r14,%r14 - vpsrlq $6,%xmm3,%xmm11 - addq %r11,%rdx - addq %rdi,%r11 - vpxor %xmm9,%xmm8,%xmm8 - movq %rdx,%r13 - addq %r11,%r14 - vpsllq $3,%xmm3,%xmm10 - shrdq $23,%r13,%r13 - movq %r14,%r11 - vpaddq %xmm8,%xmm4,%xmm4 - movq %r8,%r12 - shrdq $5,%r14,%r14 - vpsrlq $19,%xmm3,%xmm9 - xorq %rdx,%r13 - xorq %r9,%r12 - vpxor %xmm10,%xmm11,%xmm11 - shrdq $4,%r13,%r13 - xorq %r11,%r14 - vpsllq $42,%xmm10,%xmm10 - andq %rdx,%r12 - xorq %rdx,%r13 - vpxor %xmm9,%xmm11,%xmm11 - addq 72(%rsp),%r10 - movq %r11,%rdi - vpsrlq $42,%xmm9,%xmm9 - xorq %r9,%r12 - shrdq $6,%r14,%r14 - vpxor %xmm10,%xmm11,%xmm11 - xorq %rax,%rdi - addq %r12,%r10 - vpxor %xmm9,%xmm11,%xmm11 - shrdq $14,%r13,%r13 - andq %rdi,%r15 - vpaddq %xmm11,%xmm4,%xmm4 - xorq %r11,%r14 - addq %r13,%r10 - vpaddq 0(%rbp),%xmm4,%xmm10 - xorq %rax,%r15 - shrdq $28,%r14,%r14 - addq %r10,%rcx - addq %r15,%r10 - movq %rcx,%r13 - addq %r10,%r14 - vmovdqa %xmm10,64(%rsp) - vpalignr $8,%xmm5,%xmm6,%xmm8 - shrdq $23,%r13,%r13 - movq %r14,%r10 - vpalignr $8,%xmm1,%xmm2,%xmm11 - movq %rdx,%r12 - shrdq $5,%r14,%r14 - vpsrlq $1,%xmm8,%xmm10 - xorq %rcx,%r13 - xorq %r8,%r12 - vpaddq %xmm11,%xmm5,%xmm5 - shrdq $4,%r13,%r13 - xorq %r10,%r14 - vpsrlq $7,%xmm8,%xmm11 - andq %rcx,%r12 - xorq %rcx,%r13 - vpsllq $56,%xmm8,%xmm9 - addq 80(%rsp),%r9 - movq %r10,%r15 - vpxor %xmm10,%xmm11,%xmm8 - xorq %r8,%r12 - shrdq $6,%r14,%r14 - vpsrlq $7,%xmm10,%xmm10 - xorq %r11,%r15 - addq %r12,%r9 - vpxor %xmm9,%xmm8,%xmm8 - shrdq $14,%r13,%r13 - andq %r15,%rdi - vpsllq $7,%xmm9,%xmm9 - xorq %r10,%r14 - addq %r13,%r9 - vpxor %xmm10,%xmm8,%xmm8 - xorq %r11,%rdi - shrdq $28,%r14,%r14 - vpsrlq $6,%xmm4,%xmm11 - addq %r9,%rbx - addq %rdi,%r9 - vpxor %xmm9,%xmm8,%xmm8 - movq %rbx,%r13 - addq %r9,%r14 - vpsllq $3,%xmm4,%xmm10 - shrdq $23,%r13,%r13 - movq %r14,%r9 - vpaddq %xmm8,%xmm5,%xmm5 - movq %rcx,%r12 - shrdq $5,%r14,%r14 - vpsrlq $19,%xmm4,%xmm9 - xorq %rbx,%r13 - xorq %rdx,%r12 - vpxor %xmm10,%xmm11,%xmm11 - shrdq $4,%r13,%r13 - xorq %r9,%r14 - vpsllq $42,%xmm10,%xmm10 - andq %rbx,%r12 - xorq %rbx,%r13 - vpxor %xmm9,%xmm11,%xmm11 - addq 88(%rsp),%r8 - movq %r9,%rdi - vpsrlq $42,%xmm9,%xmm9 - xorq %rdx,%r12 - shrdq $6,%r14,%r14 - vpxor %xmm10,%xmm11,%xmm11 - xorq %r10,%rdi - addq %r12,%r8 - vpxor %xmm9,%xmm11,%xmm11 - shrdq $14,%r13,%r13 - andq %rdi,%r15 - vpaddq %xmm11,%xmm5,%xmm5 - xorq %r9,%r14 - addq %r13,%r8 - vpaddq 32(%rbp),%xmm5,%xmm10 - xorq %r10,%r15 - shrdq $28,%r14,%r14 - addq %r8,%rax - addq %r15,%r8 - movq %rax,%r13 - addq %r8,%r14 - vmovdqa %xmm10,80(%rsp) - vpalignr $8,%xmm6,%xmm7,%xmm8 - shrdq $23,%r13,%r13 - movq %r14,%r8 - vpalignr $8,%xmm2,%xmm3,%xmm11 - movq %rbx,%r12 - shrdq $5,%r14,%r14 - vpsrlq $1,%xmm8,%xmm10 - xorq %rax,%r13 - xorq %rcx,%r12 - vpaddq %xmm11,%xmm6,%xmm6 - shrdq $4,%r13,%r13 - xorq %r8,%r14 - vpsrlq $7,%xmm8,%xmm11 - andq %rax,%r12 - xorq %rax,%r13 - vpsllq $56,%xmm8,%xmm9 - addq 96(%rsp),%rdx - movq %r8,%r15 - vpxor %xmm10,%xmm11,%xmm8 - xorq %rcx,%r12 - shrdq $6,%r14,%r14 - vpsrlq $7,%xmm10,%xmm10 - xorq %r9,%r15 - addq %r12,%rdx - vpxor %xmm9,%xmm8,%xmm8 - shrdq $14,%r13,%r13 - andq %r15,%rdi - vpsllq $7,%xmm9,%xmm9 - xorq %r8,%r14 - addq %r13,%rdx - vpxor %xmm10,%xmm8,%xmm8 - xorq %r9,%rdi - shrdq $28,%r14,%r14 - vpsrlq $6,%xmm5,%xmm11 - addq %rdx,%r11 - addq %rdi,%rdx - vpxor %xmm9,%xmm8,%xmm8 - movq %r11,%r13 - addq %rdx,%r14 - vpsllq $3,%xmm5,%xmm10 - shrdq $23,%r13,%r13 - movq %r14,%rdx - vpaddq %xmm8,%xmm6,%xmm6 - movq %rax,%r12 - shrdq $5,%r14,%r14 - vpsrlq $19,%xmm5,%xmm9 - xorq %r11,%r13 - xorq %rbx,%r12 - vpxor %xmm10,%xmm11,%xmm11 - shrdq $4,%r13,%r13 - xorq %rdx,%r14 - vpsllq $42,%xmm10,%xmm10 - andq %r11,%r12 - xorq %r11,%r13 - vpxor %xmm9,%xmm11,%xmm11 - addq 104(%rsp),%rcx - movq %rdx,%rdi - vpsrlq $42,%xmm9,%xmm9 - xorq %rbx,%r12 - shrdq $6,%r14,%r14 - vpxor %xmm10,%xmm11,%xmm11 - xorq %r8,%rdi - addq %r12,%rcx - vpxor %xmm9,%xmm11,%xmm11 - shrdq $14,%r13,%r13 - andq %rdi,%r15 - vpaddq %xmm11,%xmm6,%xmm6 - xorq %rdx,%r14 - addq %r13,%rcx - vpaddq 64(%rbp),%xmm6,%xmm10 - xorq %r8,%r15 - shrdq $28,%r14,%r14 - addq %rcx,%r10 - addq %r15,%rcx - movq %r10,%r13 - addq %rcx,%r14 - vmovdqa %xmm10,96(%rsp) - vpalignr $8,%xmm7,%xmm0,%xmm8 - shrdq $23,%r13,%r13 - movq %r14,%rcx - vpalignr $8,%xmm3,%xmm4,%xmm11 - movq %r11,%r12 - shrdq $5,%r14,%r14 - vpsrlq $1,%xmm8,%xmm10 - xorq %r10,%r13 - xorq %rax,%r12 - vpaddq %xmm11,%xmm7,%xmm7 - shrdq $4,%r13,%r13 - xorq %rcx,%r14 - vpsrlq $7,%xmm8,%xmm11 - andq %r10,%r12 - xorq %r10,%r13 - vpsllq $56,%xmm8,%xmm9 - addq 112(%rsp),%rbx - movq %rcx,%r15 - vpxor %xmm10,%xmm11,%xmm8 - xorq %rax,%r12 - shrdq $6,%r14,%r14 - vpsrlq $7,%xmm10,%xmm10 - xorq %rdx,%r15 - addq %r12,%rbx - vpxor %xmm9,%xmm8,%xmm8 - shrdq $14,%r13,%r13 - andq %r15,%rdi - vpsllq $7,%xmm9,%xmm9 - xorq %rcx,%r14 - addq %r13,%rbx - vpxor %xmm10,%xmm8,%xmm8 - xorq %rdx,%rdi - shrdq $28,%r14,%r14 - vpsrlq $6,%xmm6,%xmm11 - addq %rbx,%r9 - addq %rdi,%rbx - vpxor %xmm9,%xmm8,%xmm8 - movq %r9,%r13 - addq %rbx,%r14 - vpsllq $3,%xmm6,%xmm10 - shrdq $23,%r13,%r13 - movq %r14,%rbx - vpaddq %xmm8,%xmm7,%xmm7 - movq %r10,%r12 - shrdq $5,%r14,%r14 - vpsrlq $19,%xmm6,%xmm9 - xorq %r9,%r13 - xorq %r11,%r12 - vpxor %xmm10,%xmm11,%xmm11 - shrdq $4,%r13,%r13 - xorq %rbx,%r14 - vpsllq $42,%xmm10,%xmm10 - andq %r9,%r12 - xorq %r9,%r13 - vpxor %xmm9,%xmm11,%xmm11 - addq 120(%rsp),%rax - movq %rbx,%rdi - vpsrlq $42,%xmm9,%xmm9 - xorq %r11,%r12 - shrdq $6,%r14,%r14 - vpxor %xmm10,%xmm11,%xmm11 - xorq %rcx,%rdi - addq %r12,%rax - vpxor %xmm9,%xmm11,%xmm11 - shrdq $14,%r13,%r13 - andq %rdi,%r15 - vpaddq %xmm11,%xmm7,%xmm7 - xorq %rbx,%r14 - addq %r13,%rax - vpaddq 96(%rbp),%xmm7,%xmm10 - xorq %rcx,%r15 - shrdq $28,%r14,%r14 - addq %rax,%r8 - addq %r15,%rax - movq %r8,%r13 - addq %rax,%r14 - vmovdqa %xmm10,112(%rsp) - cmpb $0,135(%rbp) - jne .Lavx_00_47 - shrdq $23,%r13,%r13 - movq %r14,%rax - movq %r9,%r12 - shrdq $5,%r14,%r14 - xorq %r8,%r13 - xorq %r10,%r12 - shrdq $4,%r13,%r13 - xorq %rax,%r14 - andq %r8,%r12 - xorq %r8,%r13 - addq 0(%rsp),%r11 - movq %rax,%r15 - xorq %r10,%r12 - shrdq $6,%r14,%r14 - xorq %rbx,%r15 - addq %r12,%r11 - shrdq $14,%r13,%r13 - andq %r15,%rdi - xorq %rax,%r14 - addq %r13,%r11 - xorq %rbx,%rdi - shrdq $28,%r14,%r14 - addq %r11,%rdx - addq %rdi,%r11 - movq %rdx,%r13 - addq %r11,%r14 - shrdq $23,%r13,%r13 - movq %r14,%r11 - movq %r8,%r12 - shrdq $5,%r14,%r14 - xorq %rdx,%r13 - xorq %r9,%r12 - shrdq $4,%r13,%r13 - xorq %r11,%r14 - andq %rdx,%r12 - xorq %rdx,%r13 - addq 8(%rsp),%r10 - movq %r11,%rdi - xorq %r9,%r12 - shrdq $6,%r14,%r14 - xorq %rax,%rdi - addq %r12,%r10 - shrdq $14,%r13,%r13 - andq %rdi,%r15 - xorq %r11,%r14 - addq %r13,%r10 - xorq %rax,%r15 - shrdq $28,%r14,%r14 - addq %r10,%rcx - addq %r15,%r10 - movq %rcx,%r13 - addq %r10,%r14 - shrdq $23,%r13,%r13 - movq %r14,%r10 - movq %rdx,%r12 - shrdq $5,%r14,%r14 - xorq %rcx,%r13 - xorq %r8,%r12 - shrdq $4,%r13,%r13 - xorq %r10,%r14 - andq %rcx,%r12 - xorq %rcx,%r13 - addq 16(%rsp),%r9 - movq %r10,%r15 - xorq %r8,%r12 - shrdq $6,%r14,%r14 - xorq %r11,%r15 - addq %r12,%r9 - shrdq $14,%r13,%r13 - andq %r15,%rdi - xorq %r10,%r14 - addq %r13,%r9 - xorq %r11,%rdi - shrdq $28,%r14,%r14 - addq %r9,%rbx - addq %rdi,%r9 - movq %rbx,%r13 - addq %r9,%r14 - shrdq $23,%r13,%r13 - movq %r14,%r9 - movq %rcx,%r12 - shrdq $5,%r14,%r14 - xorq %rbx,%r13 - xorq %rdx,%r12 - shrdq $4,%r13,%r13 - xorq %r9,%r14 - andq %rbx,%r12 - xorq %rbx,%r13 - addq 24(%rsp),%r8 - movq %r9,%rdi - xorq %rdx,%r12 - shrdq $6,%r14,%r14 - xorq %r10,%rdi - addq %r12,%r8 - shrdq $14,%r13,%r13 - andq %rdi,%r15 - xorq %r9,%r14 - addq %r13,%r8 - xorq %r10,%r15 - shrdq $28,%r14,%r14 - addq %r8,%rax - addq %r15,%r8 - movq %rax,%r13 - addq %r8,%r14 - shrdq $23,%r13,%r13 - movq %r14,%r8 - movq %rbx,%r12 - shrdq $5,%r14,%r14 - xorq %rax,%r13 - xorq %rcx,%r12 - shrdq $4,%r13,%r13 - xorq %r8,%r14 - andq %rax,%r12 - xorq %rax,%r13 - addq 32(%rsp),%rdx - movq %r8,%r15 - xorq %rcx,%r12 - shrdq $6,%r14,%r14 - xorq %r9,%r15 - addq %r12,%rdx - shrdq $14,%r13,%r13 - andq %r15,%rdi - xorq %r8,%r14 - addq %r13,%rdx - xorq %r9,%rdi - shrdq $28,%r14,%r14 - addq %rdx,%r11 - addq %rdi,%rdx - movq %r11,%r13 - addq %rdx,%r14 - shrdq $23,%r13,%r13 - movq %r14,%rdx - movq %rax,%r12 - shrdq $5,%r14,%r14 - xorq %r11,%r13 - xorq %rbx,%r12 - shrdq $4,%r13,%r13 - xorq %rdx,%r14 - andq %r11,%r12 - xorq %r11,%r13 - addq 40(%rsp),%rcx - movq %rdx,%rdi - xorq %rbx,%r12 - shrdq $6,%r14,%r14 - xorq %r8,%rdi - addq %r12,%rcx - shrdq $14,%r13,%r13 - andq %rdi,%r15 - xorq %rdx,%r14 - addq %r13,%rcx - xorq %r8,%r15 - shrdq $28,%r14,%r14 - addq %rcx,%r10 - addq %r15,%rcx - movq %r10,%r13 - addq %rcx,%r14 - shrdq $23,%r13,%r13 - movq %r14,%rcx - movq %r11,%r12 - shrdq $5,%r14,%r14 - xorq %r10,%r13 - xorq %rax,%r12 - shrdq $4,%r13,%r13 - xorq %rcx,%r14 - andq %r10,%r12 - xorq %r10,%r13 - addq 48(%rsp),%rbx - movq %rcx,%r15 - xorq %rax,%r12 - shrdq $6,%r14,%r14 - xorq %rdx,%r15 - addq %r12,%rbx - shrdq $14,%r13,%r13 - andq %r15,%rdi - xorq %rcx,%r14 - addq %r13,%rbx - xorq %rdx,%rdi - shrdq $28,%r14,%r14 - addq %rbx,%r9 - addq %rdi,%rbx - movq %r9,%r13 - addq %rbx,%r14 - shrdq $23,%r13,%r13 - movq %r14,%rbx - movq %r10,%r12 - shrdq $5,%r14,%r14 - xorq %r9,%r13 - xorq %r11,%r12 - shrdq $4,%r13,%r13 - xorq %rbx,%r14 - andq %r9,%r12 - xorq %r9,%r13 - addq 56(%rsp),%rax - movq %rbx,%rdi - xorq %r11,%r12 - shrdq $6,%r14,%r14 - xorq %rcx,%rdi - addq %r12,%rax - shrdq $14,%r13,%r13 - andq %rdi,%r15 - xorq %rbx,%r14 - addq %r13,%rax - xorq %rcx,%r15 - shrdq $28,%r14,%r14 - addq %rax,%r8 - addq %r15,%rax - movq %r8,%r13 - addq %rax,%r14 - shrdq $23,%r13,%r13 - movq %r14,%rax - movq %r9,%r12 - shrdq $5,%r14,%r14 - xorq %r8,%r13 - xorq %r10,%r12 - shrdq $4,%r13,%r13 - xorq %rax,%r14 - andq %r8,%r12 - xorq %r8,%r13 - addq 64(%rsp),%r11 - movq %rax,%r15 - xorq %r10,%r12 - shrdq $6,%r14,%r14 - xorq %rbx,%r15 - addq %r12,%r11 - shrdq $14,%r13,%r13 - andq %r15,%rdi - xorq %rax,%r14 - addq %r13,%r11 - xorq %rbx,%rdi - shrdq $28,%r14,%r14 - addq %r11,%rdx - addq %rdi,%r11 - movq %rdx,%r13 - addq %r11,%r14 - shrdq $23,%r13,%r13 - movq %r14,%r11 - movq %r8,%r12 - shrdq $5,%r14,%r14 - xorq %rdx,%r13 - xorq %r9,%r12 - shrdq $4,%r13,%r13 - xorq %r11,%r14 - andq %rdx,%r12 - xorq %rdx,%r13 - addq 72(%rsp),%r10 - movq %r11,%rdi - xorq %r9,%r12 - shrdq $6,%r14,%r14 - xorq %rax,%rdi - addq %r12,%r10 - shrdq $14,%r13,%r13 - andq %rdi,%r15 - xorq %r11,%r14 - addq %r13,%r10 - xorq %rax,%r15 - shrdq $28,%r14,%r14 - addq %r10,%rcx - addq %r15,%r10 - movq %rcx,%r13 - addq %r10,%r14 - shrdq $23,%r13,%r13 - movq %r14,%r10 - movq %rdx,%r12 - shrdq $5,%r14,%r14 - xorq %rcx,%r13 - xorq %r8,%r12 - shrdq $4,%r13,%r13 - xorq %r10,%r14 - andq %rcx,%r12 - xorq %rcx,%r13 - addq 80(%rsp),%r9 - movq %r10,%r15 - xorq %r8,%r12 - shrdq $6,%r14,%r14 - xorq %r11,%r15 - addq %r12,%r9 - shrdq $14,%r13,%r13 - andq %r15,%rdi - xorq %r10,%r14 - addq %r13,%r9 - xorq %r11,%rdi - shrdq $28,%r14,%r14 - addq %r9,%rbx - addq %rdi,%r9 - movq %rbx,%r13 - addq %r9,%r14 - shrdq $23,%r13,%r13 - movq %r14,%r9 - movq %rcx,%r12 - shrdq $5,%r14,%r14 - xorq %rbx,%r13 - xorq %rdx,%r12 - shrdq $4,%r13,%r13 - xorq %r9,%r14 - andq %rbx,%r12 - xorq %rbx,%r13 - addq 88(%rsp),%r8 - movq %r9,%rdi - xorq %rdx,%r12 - shrdq $6,%r14,%r14 - xorq %r10,%rdi - addq %r12,%r8 - shrdq $14,%r13,%r13 - andq %rdi,%r15 - xorq %r9,%r14 - addq %r13,%r8 - xorq %r10,%r15 - shrdq $28,%r14,%r14 - addq %r8,%rax - addq %r15,%r8 - movq %rax,%r13 - addq %r8,%r14 - shrdq $23,%r13,%r13 - movq %r14,%r8 - movq %rbx,%r12 - shrdq $5,%r14,%r14 - xorq %rax,%r13 - xorq %rcx,%r12 - shrdq $4,%r13,%r13 - xorq %r8,%r14 - andq %rax,%r12 - xorq %rax,%r13 - addq 96(%rsp),%rdx - movq %r8,%r15 - xorq %rcx,%r12 - shrdq $6,%r14,%r14 - xorq %r9,%r15 - addq %r12,%rdx - shrdq $14,%r13,%r13 - andq %r15,%rdi - xorq %r8,%r14 - addq %r13,%rdx - xorq %r9,%rdi - shrdq $28,%r14,%r14 - addq %rdx,%r11 - addq %rdi,%rdx - movq %r11,%r13 - addq %rdx,%r14 - shrdq $23,%r13,%r13 - movq %r14,%rdx - movq %rax,%r12 - shrdq $5,%r14,%r14 - xorq %r11,%r13 - xorq %rbx,%r12 - shrdq $4,%r13,%r13 - xorq %rdx,%r14 - andq %r11,%r12 - xorq %r11,%r13 - addq 104(%rsp),%rcx - movq %rdx,%rdi - xorq %rbx,%r12 - shrdq $6,%r14,%r14 - xorq %r8,%rdi - addq %r12,%rcx - shrdq $14,%r13,%r13 - andq %rdi,%r15 - xorq %rdx,%r14 - addq %r13,%rcx - xorq %r8,%r15 - shrdq $28,%r14,%r14 - addq %rcx,%r10 - addq %r15,%rcx - movq %r10,%r13 - addq %rcx,%r14 - shrdq $23,%r13,%r13 - movq %r14,%rcx - movq %r11,%r12 - shrdq $5,%r14,%r14 - xorq %r10,%r13 - xorq %rax,%r12 - shrdq $4,%r13,%r13 - xorq %rcx,%r14 - andq %r10,%r12 - xorq %r10,%r13 - addq 112(%rsp),%rbx - movq %rcx,%r15 - xorq %rax,%r12 - shrdq $6,%r14,%r14 - xorq %rdx,%r15 - addq %r12,%rbx - shrdq $14,%r13,%r13 - andq %r15,%rdi - xorq %rcx,%r14 - addq %r13,%rbx - xorq %rdx,%rdi - shrdq $28,%r14,%r14 - addq %rbx,%r9 - addq %rdi,%rbx - movq %r9,%r13 - addq %rbx,%r14 - shrdq $23,%r13,%r13 - movq %r14,%rbx - movq %r10,%r12 - shrdq $5,%r14,%r14 - xorq %r9,%r13 - xorq %r11,%r12 - shrdq $4,%r13,%r13 - xorq %rbx,%r14 - andq %r9,%r12 - xorq %r9,%r13 - addq 120(%rsp),%rax - movq %rbx,%rdi - xorq %r11,%r12 - shrdq $6,%r14,%r14 - xorq %rcx,%rdi - addq %r12,%rax - shrdq $14,%r13,%r13 - andq %rdi,%r15 - xorq %rbx,%r14 - addq %r13,%rax - xorq %rcx,%r15 - shrdq $28,%r14,%r14 - addq %rax,%r8 - addq %r15,%rax - movq %r8,%r13 - addq %rax,%r14 - movq 128+0(%rsp),%rdi - movq %r14,%rax - - addq 0(%rdi),%rax - leaq 128(%rsi),%rsi - addq 8(%rdi),%rbx - addq 16(%rdi),%rcx - addq 24(%rdi),%rdx - addq 32(%rdi),%r8 - addq 40(%rdi),%r9 - addq 48(%rdi),%r10 - addq 56(%rdi),%r11 - - cmpq 128+16(%rsp),%rsi - - movq %rax,0(%rdi) - movq %rbx,8(%rdi) - movq %rcx,16(%rdi) - movq %rdx,24(%rdi) - movq %r8,32(%rdi) - movq %r9,40(%rdi) - movq %r10,48(%rdi) - movq %r11,56(%rdi) - jb .Lloop_avx - - movq 128+24(%rsp),%rsi - vzeroupper - movq (%rsi),%r15 - movq 8(%rsi),%r14 - movq 16(%rsi),%r13 - movq 24(%rsi),%r12 - movq 32(%rsi),%rbp - movq 40(%rsi),%rbx - leaq 48(%rsi),%rsp -.Lepilogue_avx: - .byte 0xf3,0xc3 -.size sha512_block_data_order_avx,.-sha512_block_data_order_avx -.type sha512_block_data_order_avx2,@function -.align 64 -sha512_block_data_order_avx2: -.Lavx2_shortcut: - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - movq %rsp,%r11 - subq $1312,%rsp - shlq $4,%rdx - andq $-2048,%rsp - leaq (%rsi,%rdx,8),%rdx - addq $1152,%rsp - movq %rdi,128+0(%rsp) - movq %rsi,128+8(%rsp) - movq %rdx,128+16(%rsp) - movq %r11,128+24(%rsp) -.Lprologue_avx2: - - vzeroupper - subq $-128,%rsi - movq 0(%rdi),%rax - movq %rsi,%r12 - movq 8(%rdi),%rbx - cmpq %rdx,%rsi - movq 16(%rdi),%rcx - cmoveq %rsp,%r12 - movq 24(%rdi),%rdx - movq 32(%rdi),%r8 - movq 40(%rdi),%r9 - movq 48(%rdi),%r10 - movq 56(%rdi),%r11 - jmp .Loop_avx2 -.align 16 -.Loop_avx2: - vmovdqu -128(%rsi),%xmm0 - vmovdqu -128+16(%rsi),%xmm1 - vmovdqu -128+32(%rsi),%xmm2 - leaq K512+128(%rip),%rbp - vmovdqu -128+48(%rsi),%xmm3 - vmovdqu -128+64(%rsi),%xmm4 - vmovdqu -128+80(%rsi),%xmm5 - vmovdqu -128+96(%rsi),%xmm6 - vmovdqu -128+112(%rsi),%xmm7 - - vmovdqa 1152(%rbp),%ymm10 - vinserti128 $1,(%r12),%ymm0,%ymm0 - vinserti128 $1,16(%r12),%ymm1,%ymm1 - vpshufb %ymm10,%ymm0,%ymm0 - vinserti128 $1,32(%r12),%ymm2,%ymm2 - vpshufb %ymm10,%ymm1,%ymm1 - vinserti128 $1,48(%r12),%ymm3,%ymm3 - vpshufb %ymm10,%ymm2,%ymm2 - vinserti128 $1,64(%r12),%ymm4,%ymm4 - vpshufb %ymm10,%ymm3,%ymm3 - vinserti128 $1,80(%r12),%ymm5,%ymm5 - vpshufb %ymm10,%ymm4,%ymm4 - vinserti128 $1,96(%r12),%ymm6,%ymm6 - vpshufb %ymm10,%ymm5,%ymm5 - vinserti128 $1,112(%r12),%ymm7,%ymm7 - - vpaddq -128(%rbp),%ymm0,%ymm8 - vpshufb %ymm10,%ymm6,%ymm6 - vpaddq -96(%rbp),%ymm1,%ymm9 - vpshufb %ymm10,%ymm7,%ymm7 - vpaddq -64(%rbp),%ymm2,%ymm10 - vpaddq -32(%rbp),%ymm3,%ymm11 - vmovdqa %ymm8,0(%rsp) - vpaddq 0(%rbp),%ymm4,%ymm8 - vmovdqa %ymm9,32(%rsp) - vpaddq 32(%rbp),%ymm5,%ymm9 - vmovdqa %ymm10,64(%rsp) - vpaddq 64(%rbp),%ymm6,%ymm10 - vmovdqa %ymm11,96(%rsp) - leaq -128(%rsp),%rsp - vpaddq 96(%rbp),%ymm7,%ymm11 - vmovdqa %ymm8,0(%rsp) - xorq %r14,%r14 - vmovdqa %ymm9,32(%rsp) - movq %rbx,%rdi - vmovdqa %ymm10,64(%rsp) - xorq %rcx,%rdi - vmovdqa %ymm11,96(%rsp) - movq %r9,%r12 - addq $32*8,%rbp - jmp .Lavx2_00_47 - -.align 16 -.Lavx2_00_47: - leaq -128(%rsp),%rsp - vpalignr $8,%ymm0,%ymm1,%ymm8 - addq 0+256(%rsp),%r11 - andq %r8,%r12 - rorxq $41,%r8,%r13 - vpalignr $8,%ymm4,%ymm5,%ymm11 - rorxq $18,%r8,%r15 - leaq (%rax,%r14,1),%rax - leaq (%r11,%r12,1),%r11 - vpsrlq $1,%ymm8,%ymm10 - andnq %r10,%r8,%r12 - xorq %r15,%r13 - rorxq $14,%r8,%r14 - vpaddq %ymm11,%ymm0,%ymm0 - vpsrlq $7,%ymm8,%ymm11 - leaq (%r11,%r12,1),%r11 - xorq %r14,%r13 - movq %rax,%r15 - vpsllq $56,%ymm8,%ymm9 - vpxor %ymm10,%ymm11,%ymm8 - rorxq $39,%rax,%r12 - leaq (%r11,%r13,1),%r11 - xorq %rbx,%r15 - vpsrlq $7,%ymm10,%ymm10 - vpxor %ymm9,%ymm8,%ymm8 - rorxq $34,%rax,%r14 - rorxq $28,%rax,%r13 - leaq (%rdx,%r11,1),%rdx - vpsllq $7,%ymm9,%ymm9 - vpxor %ymm10,%ymm8,%ymm8 - andq %r15,%rdi - xorq %r12,%r14 - xorq %rbx,%rdi - vpsrlq $6,%ymm7,%ymm11 - vpxor %ymm9,%ymm8,%ymm8 - xorq %r13,%r14 - leaq (%r11,%rdi,1),%r11 - movq %r8,%r12 - vpsllq $3,%ymm7,%ymm10 - vpaddq %ymm8,%ymm0,%ymm0 - addq 8+256(%rsp),%r10 - andq %rdx,%r12 - rorxq $41,%rdx,%r13 - vpsrlq $19,%ymm7,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - rorxq $18,%rdx,%rdi - leaq (%r11,%r14,1),%r11 - leaq (%r10,%r12,1),%r10 - vpsllq $42,%ymm10,%ymm10 - vpxor %ymm9,%ymm11,%ymm11 - andnq %r9,%rdx,%r12 - xorq %rdi,%r13 - rorxq $14,%rdx,%r14 - vpsrlq $42,%ymm9,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - leaq (%r10,%r12,1),%r10 - xorq %r14,%r13 - movq %r11,%rdi - vpxor %ymm9,%ymm11,%ymm11 - rorxq $39,%r11,%r12 - leaq (%r10,%r13,1),%r10 - xorq %rax,%rdi - vpaddq %ymm11,%ymm0,%ymm0 - rorxq $34,%r11,%r14 - rorxq $28,%r11,%r13 - leaq (%rcx,%r10,1),%rcx - vpaddq -128(%rbp),%ymm0,%ymm10 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %rax,%r15 - xorq %r13,%r14 - leaq (%r10,%r15,1),%r10 - movq %rdx,%r12 - vmovdqa %ymm10,0(%rsp) - vpalignr $8,%ymm1,%ymm2,%ymm8 - addq 32+256(%rsp),%r9 - andq %rcx,%r12 - rorxq $41,%rcx,%r13 - vpalignr $8,%ymm5,%ymm6,%ymm11 - rorxq $18,%rcx,%r15 - leaq (%r10,%r14,1),%r10 - leaq (%r9,%r12,1),%r9 - vpsrlq $1,%ymm8,%ymm10 - andnq %r8,%rcx,%r12 - xorq %r15,%r13 - rorxq $14,%rcx,%r14 - vpaddq %ymm11,%ymm1,%ymm1 - vpsrlq $7,%ymm8,%ymm11 - leaq (%r9,%r12,1),%r9 - xorq %r14,%r13 - movq %r10,%r15 - vpsllq $56,%ymm8,%ymm9 - vpxor %ymm10,%ymm11,%ymm8 - rorxq $39,%r10,%r12 - leaq (%r9,%r13,1),%r9 - xorq %r11,%r15 - vpsrlq $7,%ymm10,%ymm10 - vpxor %ymm9,%ymm8,%ymm8 - rorxq $34,%r10,%r14 - rorxq $28,%r10,%r13 - leaq (%rbx,%r9,1),%rbx - vpsllq $7,%ymm9,%ymm9 - vpxor %ymm10,%ymm8,%ymm8 - andq %r15,%rdi - xorq %r12,%r14 - xorq %r11,%rdi - vpsrlq $6,%ymm0,%ymm11 - vpxor %ymm9,%ymm8,%ymm8 - xorq %r13,%r14 - leaq (%r9,%rdi,1),%r9 - movq %rcx,%r12 - vpsllq $3,%ymm0,%ymm10 - vpaddq %ymm8,%ymm1,%ymm1 - addq 40+256(%rsp),%r8 - andq %rbx,%r12 - rorxq $41,%rbx,%r13 - vpsrlq $19,%ymm0,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - rorxq $18,%rbx,%rdi - leaq (%r9,%r14,1),%r9 - leaq (%r8,%r12,1),%r8 - vpsllq $42,%ymm10,%ymm10 - vpxor %ymm9,%ymm11,%ymm11 - andnq %rdx,%rbx,%r12 - xorq %rdi,%r13 - rorxq $14,%rbx,%r14 - vpsrlq $42,%ymm9,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - leaq (%r8,%r12,1),%r8 - xorq %r14,%r13 - movq %r9,%rdi - vpxor %ymm9,%ymm11,%ymm11 - rorxq $39,%r9,%r12 - leaq (%r8,%r13,1),%r8 - xorq %r10,%rdi - vpaddq %ymm11,%ymm1,%ymm1 - rorxq $34,%r9,%r14 - rorxq $28,%r9,%r13 - leaq (%rax,%r8,1),%rax - vpaddq -96(%rbp),%ymm1,%ymm10 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %r10,%r15 - xorq %r13,%r14 - leaq (%r8,%r15,1),%r8 - movq %rbx,%r12 - vmovdqa %ymm10,32(%rsp) - vpalignr $8,%ymm2,%ymm3,%ymm8 - addq 64+256(%rsp),%rdx - andq %rax,%r12 - rorxq $41,%rax,%r13 - vpalignr $8,%ymm6,%ymm7,%ymm11 - rorxq $18,%rax,%r15 - leaq (%r8,%r14,1),%r8 - leaq (%rdx,%r12,1),%rdx - vpsrlq $1,%ymm8,%ymm10 - andnq %rcx,%rax,%r12 - xorq %r15,%r13 - rorxq $14,%rax,%r14 - vpaddq %ymm11,%ymm2,%ymm2 - vpsrlq $7,%ymm8,%ymm11 - leaq (%rdx,%r12,1),%rdx - xorq %r14,%r13 - movq %r8,%r15 - vpsllq $56,%ymm8,%ymm9 - vpxor %ymm10,%ymm11,%ymm8 - rorxq $39,%r8,%r12 - leaq (%rdx,%r13,1),%rdx - xorq %r9,%r15 - vpsrlq $7,%ymm10,%ymm10 - vpxor %ymm9,%ymm8,%ymm8 - rorxq $34,%r8,%r14 - rorxq $28,%r8,%r13 - leaq (%r11,%rdx,1),%r11 - vpsllq $7,%ymm9,%ymm9 - vpxor %ymm10,%ymm8,%ymm8 - andq %r15,%rdi - xorq %r12,%r14 - xorq %r9,%rdi - vpsrlq $6,%ymm1,%ymm11 - vpxor %ymm9,%ymm8,%ymm8 - xorq %r13,%r14 - leaq (%rdx,%rdi,1),%rdx - movq %rax,%r12 - vpsllq $3,%ymm1,%ymm10 - vpaddq %ymm8,%ymm2,%ymm2 - addq 72+256(%rsp),%rcx - andq %r11,%r12 - rorxq $41,%r11,%r13 - vpsrlq $19,%ymm1,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - rorxq $18,%r11,%rdi - leaq (%rdx,%r14,1),%rdx - leaq (%rcx,%r12,1),%rcx - vpsllq $42,%ymm10,%ymm10 - vpxor %ymm9,%ymm11,%ymm11 - andnq %rbx,%r11,%r12 - xorq %rdi,%r13 - rorxq $14,%r11,%r14 - vpsrlq $42,%ymm9,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - leaq (%rcx,%r12,1),%rcx - xorq %r14,%r13 - movq %rdx,%rdi - vpxor %ymm9,%ymm11,%ymm11 - rorxq $39,%rdx,%r12 - leaq (%rcx,%r13,1),%rcx - xorq %r8,%rdi - vpaddq %ymm11,%ymm2,%ymm2 - rorxq $34,%rdx,%r14 - rorxq $28,%rdx,%r13 - leaq (%r10,%rcx,1),%r10 - vpaddq -64(%rbp),%ymm2,%ymm10 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %r8,%r15 - xorq %r13,%r14 - leaq (%rcx,%r15,1),%rcx - movq %r11,%r12 - vmovdqa %ymm10,64(%rsp) - vpalignr $8,%ymm3,%ymm4,%ymm8 - addq 96+256(%rsp),%rbx - andq %r10,%r12 - rorxq $41,%r10,%r13 - vpalignr $8,%ymm7,%ymm0,%ymm11 - rorxq $18,%r10,%r15 - leaq (%rcx,%r14,1),%rcx - leaq (%rbx,%r12,1),%rbx - vpsrlq $1,%ymm8,%ymm10 - andnq %rax,%r10,%r12 - xorq %r15,%r13 - rorxq $14,%r10,%r14 - vpaddq %ymm11,%ymm3,%ymm3 - vpsrlq $7,%ymm8,%ymm11 - leaq (%rbx,%r12,1),%rbx - xorq %r14,%r13 - movq %rcx,%r15 - vpsllq $56,%ymm8,%ymm9 - vpxor %ymm10,%ymm11,%ymm8 - rorxq $39,%rcx,%r12 - leaq (%rbx,%r13,1),%rbx - xorq %rdx,%r15 - vpsrlq $7,%ymm10,%ymm10 - vpxor %ymm9,%ymm8,%ymm8 - rorxq $34,%rcx,%r14 - rorxq $28,%rcx,%r13 - leaq (%r9,%rbx,1),%r9 - vpsllq $7,%ymm9,%ymm9 - vpxor %ymm10,%ymm8,%ymm8 - andq %r15,%rdi - xorq %r12,%r14 - xorq %rdx,%rdi - vpsrlq $6,%ymm2,%ymm11 - vpxor %ymm9,%ymm8,%ymm8 - xorq %r13,%r14 - leaq (%rbx,%rdi,1),%rbx - movq %r10,%r12 - vpsllq $3,%ymm2,%ymm10 - vpaddq %ymm8,%ymm3,%ymm3 - addq 104+256(%rsp),%rax - andq %r9,%r12 - rorxq $41,%r9,%r13 - vpsrlq $19,%ymm2,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - rorxq $18,%r9,%rdi - leaq (%rbx,%r14,1),%rbx - leaq (%rax,%r12,1),%rax - vpsllq $42,%ymm10,%ymm10 - vpxor %ymm9,%ymm11,%ymm11 - andnq %r11,%r9,%r12 - xorq %rdi,%r13 - rorxq $14,%r9,%r14 - vpsrlq $42,%ymm9,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - leaq (%rax,%r12,1),%rax - xorq %r14,%r13 - movq %rbx,%rdi - vpxor %ymm9,%ymm11,%ymm11 - rorxq $39,%rbx,%r12 - leaq (%rax,%r13,1),%rax - xorq %rcx,%rdi - vpaddq %ymm11,%ymm3,%ymm3 - rorxq $34,%rbx,%r14 - rorxq $28,%rbx,%r13 - leaq (%r8,%rax,1),%r8 - vpaddq -32(%rbp),%ymm3,%ymm10 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %rcx,%r15 - xorq %r13,%r14 - leaq (%rax,%r15,1),%rax - movq %r9,%r12 - vmovdqa %ymm10,96(%rsp) - leaq -128(%rsp),%rsp - vpalignr $8,%ymm4,%ymm5,%ymm8 - addq 0+256(%rsp),%r11 - andq %r8,%r12 - rorxq $41,%r8,%r13 - vpalignr $8,%ymm0,%ymm1,%ymm11 - rorxq $18,%r8,%r15 - leaq (%rax,%r14,1),%rax - leaq (%r11,%r12,1),%r11 - vpsrlq $1,%ymm8,%ymm10 - andnq %r10,%r8,%r12 - xorq %r15,%r13 - rorxq $14,%r8,%r14 - vpaddq %ymm11,%ymm4,%ymm4 - vpsrlq $7,%ymm8,%ymm11 - leaq (%r11,%r12,1),%r11 - xorq %r14,%r13 - movq %rax,%r15 - vpsllq $56,%ymm8,%ymm9 - vpxor %ymm10,%ymm11,%ymm8 - rorxq $39,%rax,%r12 - leaq (%r11,%r13,1),%r11 - xorq %rbx,%r15 - vpsrlq $7,%ymm10,%ymm10 - vpxor %ymm9,%ymm8,%ymm8 - rorxq $34,%rax,%r14 - rorxq $28,%rax,%r13 - leaq (%rdx,%r11,1),%rdx - vpsllq $7,%ymm9,%ymm9 - vpxor %ymm10,%ymm8,%ymm8 - andq %r15,%rdi - xorq %r12,%r14 - xorq %rbx,%rdi - vpsrlq $6,%ymm3,%ymm11 - vpxor %ymm9,%ymm8,%ymm8 - xorq %r13,%r14 - leaq (%r11,%rdi,1),%r11 - movq %r8,%r12 - vpsllq $3,%ymm3,%ymm10 - vpaddq %ymm8,%ymm4,%ymm4 - addq 8+256(%rsp),%r10 - andq %rdx,%r12 - rorxq $41,%rdx,%r13 - vpsrlq $19,%ymm3,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - rorxq $18,%rdx,%rdi - leaq (%r11,%r14,1),%r11 - leaq (%r10,%r12,1),%r10 - vpsllq $42,%ymm10,%ymm10 - vpxor %ymm9,%ymm11,%ymm11 - andnq %r9,%rdx,%r12 - xorq %rdi,%r13 - rorxq $14,%rdx,%r14 - vpsrlq $42,%ymm9,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - leaq (%r10,%r12,1),%r10 - xorq %r14,%r13 - movq %r11,%rdi - vpxor %ymm9,%ymm11,%ymm11 - rorxq $39,%r11,%r12 - leaq (%r10,%r13,1),%r10 - xorq %rax,%rdi - vpaddq %ymm11,%ymm4,%ymm4 - rorxq $34,%r11,%r14 - rorxq $28,%r11,%r13 - leaq (%rcx,%r10,1),%rcx - vpaddq 0(%rbp),%ymm4,%ymm10 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %rax,%r15 - xorq %r13,%r14 - leaq (%r10,%r15,1),%r10 - movq %rdx,%r12 - vmovdqa %ymm10,0(%rsp) - vpalignr $8,%ymm5,%ymm6,%ymm8 - addq 32+256(%rsp),%r9 - andq %rcx,%r12 - rorxq $41,%rcx,%r13 - vpalignr $8,%ymm1,%ymm2,%ymm11 - rorxq $18,%rcx,%r15 - leaq (%r10,%r14,1),%r10 - leaq (%r9,%r12,1),%r9 - vpsrlq $1,%ymm8,%ymm10 - andnq %r8,%rcx,%r12 - xorq %r15,%r13 - rorxq $14,%rcx,%r14 - vpaddq %ymm11,%ymm5,%ymm5 - vpsrlq $7,%ymm8,%ymm11 - leaq (%r9,%r12,1),%r9 - xorq %r14,%r13 - movq %r10,%r15 - vpsllq $56,%ymm8,%ymm9 - vpxor %ymm10,%ymm11,%ymm8 - rorxq $39,%r10,%r12 - leaq (%r9,%r13,1),%r9 - xorq %r11,%r15 - vpsrlq $7,%ymm10,%ymm10 - vpxor %ymm9,%ymm8,%ymm8 - rorxq $34,%r10,%r14 - rorxq $28,%r10,%r13 - leaq (%rbx,%r9,1),%rbx - vpsllq $7,%ymm9,%ymm9 - vpxor %ymm10,%ymm8,%ymm8 - andq %r15,%rdi - xorq %r12,%r14 - xorq %r11,%rdi - vpsrlq $6,%ymm4,%ymm11 - vpxor %ymm9,%ymm8,%ymm8 - xorq %r13,%r14 - leaq (%r9,%rdi,1),%r9 - movq %rcx,%r12 - vpsllq $3,%ymm4,%ymm10 - vpaddq %ymm8,%ymm5,%ymm5 - addq 40+256(%rsp),%r8 - andq %rbx,%r12 - rorxq $41,%rbx,%r13 - vpsrlq $19,%ymm4,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - rorxq $18,%rbx,%rdi - leaq (%r9,%r14,1),%r9 - leaq (%r8,%r12,1),%r8 - vpsllq $42,%ymm10,%ymm10 - vpxor %ymm9,%ymm11,%ymm11 - andnq %rdx,%rbx,%r12 - xorq %rdi,%r13 - rorxq $14,%rbx,%r14 - vpsrlq $42,%ymm9,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - leaq (%r8,%r12,1),%r8 - xorq %r14,%r13 - movq %r9,%rdi - vpxor %ymm9,%ymm11,%ymm11 - rorxq $39,%r9,%r12 - leaq (%r8,%r13,1),%r8 - xorq %r10,%rdi - vpaddq %ymm11,%ymm5,%ymm5 - rorxq $34,%r9,%r14 - rorxq $28,%r9,%r13 - leaq (%rax,%r8,1),%rax - vpaddq 32(%rbp),%ymm5,%ymm10 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %r10,%r15 - xorq %r13,%r14 - leaq (%r8,%r15,1),%r8 - movq %rbx,%r12 - vmovdqa %ymm10,32(%rsp) - vpalignr $8,%ymm6,%ymm7,%ymm8 - addq 64+256(%rsp),%rdx - andq %rax,%r12 - rorxq $41,%rax,%r13 - vpalignr $8,%ymm2,%ymm3,%ymm11 - rorxq $18,%rax,%r15 - leaq (%r8,%r14,1),%r8 - leaq (%rdx,%r12,1),%rdx - vpsrlq $1,%ymm8,%ymm10 - andnq %rcx,%rax,%r12 - xorq %r15,%r13 - rorxq $14,%rax,%r14 - vpaddq %ymm11,%ymm6,%ymm6 - vpsrlq $7,%ymm8,%ymm11 - leaq (%rdx,%r12,1),%rdx - xorq %r14,%r13 - movq %r8,%r15 - vpsllq $56,%ymm8,%ymm9 - vpxor %ymm10,%ymm11,%ymm8 - rorxq $39,%r8,%r12 - leaq (%rdx,%r13,1),%rdx - xorq %r9,%r15 - vpsrlq $7,%ymm10,%ymm10 - vpxor %ymm9,%ymm8,%ymm8 - rorxq $34,%r8,%r14 - rorxq $28,%r8,%r13 - leaq (%r11,%rdx,1),%r11 - vpsllq $7,%ymm9,%ymm9 - vpxor %ymm10,%ymm8,%ymm8 - andq %r15,%rdi - xorq %r12,%r14 - xorq %r9,%rdi - vpsrlq $6,%ymm5,%ymm11 - vpxor %ymm9,%ymm8,%ymm8 - xorq %r13,%r14 - leaq (%rdx,%rdi,1),%rdx - movq %rax,%r12 - vpsllq $3,%ymm5,%ymm10 - vpaddq %ymm8,%ymm6,%ymm6 - addq 72+256(%rsp),%rcx - andq %r11,%r12 - rorxq $41,%r11,%r13 - vpsrlq $19,%ymm5,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - rorxq $18,%r11,%rdi - leaq (%rdx,%r14,1),%rdx - leaq (%rcx,%r12,1),%rcx - vpsllq $42,%ymm10,%ymm10 - vpxor %ymm9,%ymm11,%ymm11 - andnq %rbx,%r11,%r12 - xorq %rdi,%r13 - rorxq $14,%r11,%r14 - vpsrlq $42,%ymm9,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - leaq (%rcx,%r12,1),%rcx - xorq %r14,%r13 - movq %rdx,%rdi - vpxor %ymm9,%ymm11,%ymm11 - rorxq $39,%rdx,%r12 - leaq (%rcx,%r13,1),%rcx - xorq %r8,%rdi - vpaddq %ymm11,%ymm6,%ymm6 - rorxq $34,%rdx,%r14 - rorxq $28,%rdx,%r13 - leaq (%r10,%rcx,1),%r10 - vpaddq 64(%rbp),%ymm6,%ymm10 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %r8,%r15 - xorq %r13,%r14 - leaq (%rcx,%r15,1),%rcx - movq %r11,%r12 - vmovdqa %ymm10,64(%rsp) - vpalignr $8,%ymm7,%ymm0,%ymm8 - addq 96+256(%rsp),%rbx - andq %r10,%r12 - rorxq $41,%r10,%r13 - vpalignr $8,%ymm3,%ymm4,%ymm11 - rorxq $18,%r10,%r15 - leaq (%rcx,%r14,1),%rcx - leaq (%rbx,%r12,1),%rbx - vpsrlq $1,%ymm8,%ymm10 - andnq %rax,%r10,%r12 - xorq %r15,%r13 - rorxq $14,%r10,%r14 - vpaddq %ymm11,%ymm7,%ymm7 - vpsrlq $7,%ymm8,%ymm11 - leaq (%rbx,%r12,1),%rbx - xorq %r14,%r13 - movq %rcx,%r15 - vpsllq $56,%ymm8,%ymm9 - vpxor %ymm10,%ymm11,%ymm8 - rorxq $39,%rcx,%r12 - leaq (%rbx,%r13,1),%rbx - xorq %rdx,%r15 - vpsrlq $7,%ymm10,%ymm10 - vpxor %ymm9,%ymm8,%ymm8 - rorxq $34,%rcx,%r14 - rorxq $28,%rcx,%r13 - leaq (%r9,%rbx,1),%r9 - vpsllq $7,%ymm9,%ymm9 - vpxor %ymm10,%ymm8,%ymm8 - andq %r15,%rdi - xorq %r12,%r14 - xorq %rdx,%rdi - vpsrlq $6,%ymm6,%ymm11 - vpxor %ymm9,%ymm8,%ymm8 - xorq %r13,%r14 - leaq (%rbx,%rdi,1),%rbx - movq %r10,%r12 - vpsllq $3,%ymm6,%ymm10 - vpaddq %ymm8,%ymm7,%ymm7 - addq 104+256(%rsp),%rax - andq %r9,%r12 - rorxq $41,%r9,%r13 - vpsrlq $19,%ymm6,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - rorxq $18,%r9,%rdi - leaq (%rbx,%r14,1),%rbx - leaq (%rax,%r12,1),%rax - vpsllq $42,%ymm10,%ymm10 - vpxor %ymm9,%ymm11,%ymm11 - andnq %r11,%r9,%r12 - xorq %rdi,%r13 - rorxq $14,%r9,%r14 - vpsrlq $42,%ymm9,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - leaq (%rax,%r12,1),%rax - xorq %r14,%r13 - movq %rbx,%rdi - vpxor %ymm9,%ymm11,%ymm11 - rorxq $39,%rbx,%r12 - leaq (%rax,%r13,1),%rax - xorq %rcx,%rdi - vpaddq %ymm11,%ymm7,%ymm7 - rorxq $34,%rbx,%r14 - rorxq $28,%rbx,%r13 - leaq (%r8,%rax,1),%r8 - vpaddq 96(%rbp),%ymm7,%ymm10 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %rcx,%r15 - xorq %r13,%r14 - leaq (%rax,%r15,1),%rax - movq %r9,%r12 - vmovdqa %ymm10,96(%rsp) - leaq 256(%rbp),%rbp - cmpb $0,-121(%rbp) - jne .Lavx2_00_47 - addq 0+128(%rsp),%r11 - andq %r8,%r12 - rorxq $41,%r8,%r13 - rorxq $18,%r8,%r15 - leaq (%rax,%r14,1),%rax - leaq (%r11,%r12,1),%r11 - andnq %r10,%r8,%r12 - xorq %r15,%r13 - rorxq $14,%r8,%r14 - leaq (%r11,%r12,1),%r11 - xorq %r14,%r13 - movq %rax,%r15 - rorxq $39,%rax,%r12 - leaq (%r11,%r13,1),%r11 - xorq %rbx,%r15 - rorxq $34,%rax,%r14 - rorxq $28,%rax,%r13 - leaq (%rdx,%r11,1),%rdx - andq %r15,%rdi - xorq %r12,%r14 - xorq %rbx,%rdi - xorq %r13,%r14 - leaq (%r11,%rdi,1),%r11 - movq %r8,%r12 - addq 8+128(%rsp),%r10 - andq %rdx,%r12 - rorxq $41,%rdx,%r13 - rorxq $18,%rdx,%rdi - leaq (%r11,%r14,1),%r11 - leaq (%r10,%r12,1),%r10 - andnq %r9,%rdx,%r12 - xorq %rdi,%r13 - rorxq $14,%rdx,%r14 - leaq (%r10,%r12,1),%r10 - xorq %r14,%r13 - movq %r11,%rdi - rorxq $39,%r11,%r12 - leaq (%r10,%r13,1),%r10 - xorq %rax,%rdi - rorxq $34,%r11,%r14 - rorxq $28,%r11,%r13 - leaq (%rcx,%r10,1),%rcx - andq %rdi,%r15 - xorq %r12,%r14 - xorq %rax,%r15 - xorq %r13,%r14 - leaq (%r10,%r15,1),%r10 - movq %rdx,%r12 - addq 32+128(%rsp),%r9 - andq %rcx,%r12 - rorxq $41,%rcx,%r13 - rorxq $18,%rcx,%r15 - leaq (%r10,%r14,1),%r10 - leaq (%r9,%r12,1),%r9 - andnq %r8,%rcx,%r12 - xorq %r15,%r13 - rorxq $14,%rcx,%r14 - leaq (%r9,%r12,1),%r9 - xorq %r14,%r13 - movq %r10,%r15 - rorxq $39,%r10,%r12 - leaq (%r9,%r13,1),%r9 - xorq %r11,%r15 - rorxq $34,%r10,%r14 - rorxq $28,%r10,%r13 - leaq (%rbx,%r9,1),%rbx - andq %r15,%rdi - xorq %r12,%r14 - xorq %r11,%rdi - xorq %r13,%r14 - leaq (%r9,%rdi,1),%r9 - movq %rcx,%r12 - addq 40+128(%rsp),%r8 - andq %rbx,%r12 - rorxq $41,%rbx,%r13 - rorxq $18,%rbx,%rdi - leaq (%r9,%r14,1),%r9 - leaq (%r8,%r12,1),%r8 - andnq %rdx,%rbx,%r12 - xorq %rdi,%r13 - rorxq $14,%rbx,%r14 - leaq (%r8,%r12,1),%r8 - xorq %r14,%r13 - movq %r9,%rdi - rorxq $39,%r9,%r12 - leaq (%r8,%r13,1),%r8 - xorq %r10,%rdi - rorxq $34,%r9,%r14 - rorxq $28,%r9,%r13 - leaq (%rax,%r8,1),%rax - andq %rdi,%r15 - xorq %r12,%r14 - xorq %r10,%r15 - xorq %r13,%r14 - leaq (%r8,%r15,1),%r8 - movq %rbx,%r12 - addq 64+128(%rsp),%rdx - andq %rax,%r12 - rorxq $41,%rax,%r13 - rorxq $18,%rax,%r15 - leaq (%r8,%r14,1),%r8 - leaq (%rdx,%r12,1),%rdx - andnq %rcx,%rax,%r12 - xorq %r15,%r13 - rorxq $14,%rax,%r14 - leaq (%rdx,%r12,1),%rdx - xorq %r14,%r13 - movq %r8,%r15 - rorxq $39,%r8,%r12 - leaq (%rdx,%r13,1),%rdx - xorq %r9,%r15 - rorxq $34,%r8,%r14 - rorxq $28,%r8,%r13 - leaq (%r11,%rdx,1),%r11 - andq %r15,%rdi - xorq %r12,%r14 - xorq %r9,%rdi - xorq %r13,%r14 - leaq (%rdx,%rdi,1),%rdx - movq %rax,%r12 - addq 72+128(%rsp),%rcx - andq %r11,%r12 - rorxq $41,%r11,%r13 - rorxq $18,%r11,%rdi - leaq (%rdx,%r14,1),%rdx - leaq (%rcx,%r12,1),%rcx - andnq %rbx,%r11,%r12 - xorq %rdi,%r13 - rorxq $14,%r11,%r14 - leaq (%rcx,%r12,1),%rcx - xorq %r14,%r13 - movq %rdx,%rdi - rorxq $39,%rdx,%r12 - leaq (%rcx,%r13,1),%rcx - xorq %r8,%rdi - rorxq $34,%rdx,%r14 - rorxq $28,%rdx,%r13 - leaq (%r10,%rcx,1),%r10 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %r8,%r15 - xorq %r13,%r14 - leaq (%rcx,%r15,1),%rcx - movq %r11,%r12 - addq 96+128(%rsp),%rbx - andq %r10,%r12 - rorxq $41,%r10,%r13 - rorxq $18,%r10,%r15 - leaq (%rcx,%r14,1),%rcx - leaq (%rbx,%r12,1),%rbx - andnq %rax,%r10,%r12 - xorq %r15,%r13 - rorxq $14,%r10,%r14 - leaq (%rbx,%r12,1),%rbx - xorq %r14,%r13 - movq %rcx,%r15 - rorxq $39,%rcx,%r12 - leaq (%rbx,%r13,1),%rbx - xorq %rdx,%r15 - rorxq $34,%rcx,%r14 - rorxq $28,%rcx,%r13 - leaq (%r9,%rbx,1),%r9 - andq %r15,%rdi - xorq %r12,%r14 - xorq %rdx,%rdi - xorq %r13,%r14 - leaq (%rbx,%rdi,1),%rbx - movq %r10,%r12 - addq 104+128(%rsp),%rax - andq %r9,%r12 - rorxq $41,%r9,%r13 - rorxq $18,%r9,%rdi - leaq (%rbx,%r14,1),%rbx - leaq (%rax,%r12,1),%rax - andnq %r11,%r9,%r12 - xorq %rdi,%r13 - rorxq $14,%r9,%r14 - leaq (%rax,%r12,1),%rax - xorq %r14,%r13 - movq %rbx,%rdi - rorxq $39,%rbx,%r12 - leaq (%rax,%r13,1),%rax - xorq %rcx,%rdi - rorxq $34,%rbx,%r14 - rorxq $28,%rbx,%r13 - leaq (%r8,%rax,1),%r8 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %rcx,%r15 - xorq %r13,%r14 - leaq (%rax,%r15,1),%rax - movq %r9,%r12 - addq 0(%rsp),%r11 - andq %r8,%r12 - rorxq $41,%r8,%r13 - rorxq $18,%r8,%r15 - leaq (%rax,%r14,1),%rax - leaq (%r11,%r12,1),%r11 - andnq %r10,%r8,%r12 - xorq %r15,%r13 - rorxq $14,%r8,%r14 - leaq (%r11,%r12,1),%r11 - xorq %r14,%r13 - movq %rax,%r15 - rorxq $39,%rax,%r12 - leaq (%r11,%r13,1),%r11 - xorq %rbx,%r15 - rorxq $34,%rax,%r14 - rorxq $28,%rax,%r13 - leaq (%rdx,%r11,1),%rdx - andq %r15,%rdi - xorq %r12,%r14 - xorq %rbx,%rdi - xorq %r13,%r14 - leaq (%r11,%rdi,1),%r11 - movq %r8,%r12 - addq 8(%rsp),%r10 - andq %rdx,%r12 - rorxq $41,%rdx,%r13 - rorxq $18,%rdx,%rdi - leaq (%r11,%r14,1),%r11 - leaq (%r10,%r12,1),%r10 - andnq %r9,%rdx,%r12 - xorq %rdi,%r13 - rorxq $14,%rdx,%r14 - leaq (%r10,%r12,1),%r10 - xorq %r14,%r13 - movq %r11,%rdi - rorxq $39,%r11,%r12 - leaq (%r10,%r13,1),%r10 - xorq %rax,%rdi - rorxq $34,%r11,%r14 - rorxq $28,%r11,%r13 - leaq (%rcx,%r10,1),%rcx - andq %rdi,%r15 - xorq %r12,%r14 - xorq %rax,%r15 - xorq %r13,%r14 - leaq (%r10,%r15,1),%r10 - movq %rdx,%r12 - addq 32(%rsp),%r9 - andq %rcx,%r12 - rorxq $41,%rcx,%r13 - rorxq $18,%rcx,%r15 - leaq (%r10,%r14,1),%r10 - leaq (%r9,%r12,1),%r9 - andnq %r8,%rcx,%r12 - xorq %r15,%r13 - rorxq $14,%rcx,%r14 - leaq (%r9,%r12,1),%r9 - xorq %r14,%r13 - movq %r10,%r15 - rorxq $39,%r10,%r12 - leaq (%r9,%r13,1),%r9 - xorq %r11,%r15 - rorxq $34,%r10,%r14 - rorxq $28,%r10,%r13 - leaq (%rbx,%r9,1),%rbx - andq %r15,%rdi - xorq %r12,%r14 - xorq %r11,%rdi - xorq %r13,%r14 - leaq (%r9,%rdi,1),%r9 - movq %rcx,%r12 - addq 40(%rsp),%r8 - andq %rbx,%r12 - rorxq $41,%rbx,%r13 - rorxq $18,%rbx,%rdi - leaq (%r9,%r14,1),%r9 - leaq (%r8,%r12,1),%r8 - andnq %rdx,%rbx,%r12 - xorq %rdi,%r13 - rorxq $14,%rbx,%r14 - leaq (%r8,%r12,1),%r8 - xorq %r14,%r13 - movq %r9,%rdi - rorxq $39,%r9,%r12 - leaq (%r8,%r13,1),%r8 - xorq %r10,%rdi - rorxq $34,%r9,%r14 - rorxq $28,%r9,%r13 - leaq (%rax,%r8,1),%rax - andq %rdi,%r15 - xorq %r12,%r14 - xorq %r10,%r15 - xorq %r13,%r14 - leaq (%r8,%r15,1),%r8 - movq %rbx,%r12 - addq 64(%rsp),%rdx - andq %rax,%r12 - rorxq $41,%rax,%r13 - rorxq $18,%rax,%r15 - leaq (%r8,%r14,1),%r8 - leaq (%rdx,%r12,1),%rdx - andnq %rcx,%rax,%r12 - xorq %r15,%r13 - rorxq $14,%rax,%r14 - leaq (%rdx,%r12,1),%rdx - xorq %r14,%r13 - movq %r8,%r15 - rorxq $39,%r8,%r12 - leaq (%rdx,%r13,1),%rdx - xorq %r9,%r15 - rorxq $34,%r8,%r14 - rorxq $28,%r8,%r13 - leaq (%r11,%rdx,1),%r11 - andq %r15,%rdi - xorq %r12,%r14 - xorq %r9,%rdi - xorq %r13,%r14 - leaq (%rdx,%rdi,1),%rdx - movq %rax,%r12 - addq 72(%rsp),%rcx - andq %r11,%r12 - rorxq $41,%r11,%r13 - rorxq $18,%r11,%rdi - leaq (%rdx,%r14,1),%rdx - leaq (%rcx,%r12,1),%rcx - andnq %rbx,%r11,%r12 - xorq %rdi,%r13 - rorxq $14,%r11,%r14 - leaq (%rcx,%r12,1),%rcx - xorq %r14,%r13 - movq %rdx,%rdi - rorxq $39,%rdx,%r12 - leaq (%rcx,%r13,1),%rcx - xorq %r8,%rdi - rorxq $34,%rdx,%r14 - rorxq $28,%rdx,%r13 - leaq (%r10,%rcx,1),%r10 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %r8,%r15 - xorq %r13,%r14 - leaq (%rcx,%r15,1),%rcx - movq %r11,%r12 - addq 96(%rsp),%rbx - andq %r10,%r12 - rorxq $41,%r10,%r13 - rorxq $18,%r10,%r15 - leaq (%rcx,%r14,1),%rcx - leaq (%rbx,%r12,1),%rbx - andnq %rax,%r10,%r12 - xorq %r15,%r13 - rorxq $14,%r10,%r14 - leaq (%rbx,%r12,1),%rbx - xorq %r14,%r13 - movq %rcx,%r15 - rorxq $39,%rcx,%r12 - leaq (%rbx,%r13,1),%rbx - xorq %rdx,%r15 - rorxq $34,%rcx,%r14 - rorxq $28,%rcx,%r13 - leaq (%r9,%rbx,1),%r9 - andq %r15,%rdi - xorq %r12,%r14 - xorq %rdx,%rdi - xorq %r13,%r14 - leaq (%rbx,%rdi,1),%rbx - movq %r10,%r12 - addq 104(%rsp),%rax - andq %r9,%r12 - rorxq $41,%r9,%r13 - rorxq $18,%r9,%rdi - leaq (%rbx,%r14,1),%rbx - leaq (%rax,%r12,1),%rax - andnq %r11,%r9,%r12 - xorq %rdi,%r13 - rorxq $14,%r9,%r14 - leaq (%rax,%r12,1),%rax - xorq %r14,%r13 - movq %rbx,%rdi - rorxq $39,%rbx,%r12 - leaq (%rax,%r13,1),%rax - xorq %rcx,%rdi - rorxq $34,%rbx,%r14 - rorxq $28,%rbx,%r13 - leaq (%r8,%rax,1),%r8 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %rcx,%r15 - xorq %r13,%r14 - leaq (%rax,%r15,1),%rax - movq %r9,%r12 - movq 1280(%rsp),%rdi - addq %r14,%rax - - leaq 1152(%rsp),%rbp - - addq 0(%rdi),%rax - addq 8(%rdi),%rbx - addq 16(%rdi),%rcx - addq 24(%rdi),%rdx - addq 32(%rdi),%r8 - addq 40(%rdi),%r9 - addq 48(%rdi),%r10 - addq 56(%rdi),%r11 - - movq %rax,0(%rdi) - movq %rbx,8(%rdi) - movq %rcx,16(%rdi) - movq %rdx,24(%rdi) - movq %r8,32(%rdi) - movq %r9,40(%rdi) - movq %r10,48(%rdi) - movq %r11,56(%rdi) - - cmpq 144(%rbp),%rsi - je .Ldone_avx2 - - xorq %r14,%r14 - movq %rbx,%rdi - xorq %rcx,%rdi - movq %r9,%r12 - jmp .Lower_avx2 -.align 16 -.Lower_avx2: - addq 0+16(%rbp),%r11 - andq %r8,%r12 - rorxq $41,%r8,%r13 - rorxq $18,%r8,%r15 - leaq (%rax,%r14,1),%rax - leaq (%r11,%r12,1),%r11 - andnq %r10,%r8,%r12 - xorq %r15,%r13 - rorxq $14,%r8,%r14 - leaq (%r11,%r12,1),%r11 - xorq %r14,%r13 - movq %rax,%r15 - rorxq $39,%rax,%r12 - leaq (%r11,%r13,1),%r11 - xorq %rbx,%r15 - rorxq $34,%rax,%r14 - rorxq $28,%rax,%r13 - leaq (%rdx,%r11,1),%rdx - andq %r15,%rdi - xorq %r12,%r14 - xorq %rbx,%rdi - xorq %r13,%r14 - leaq (%r11,%rdi,1),%r11 - movq %r8,%r12 - addq 8+16(%rbp),%r10 - andq %rdx,%r12 - rorxq $41,%rdx,%r13 - rorxq $18,%rdx,%rdi - leaq (%r11,%r14,1),%r11 - leaq (%r10,%r12,1),%r10 - andnq %r9,%rdx,%r12 - xorq %rdi,%r13 - rorxq $14,%rdx,%r14 - leaq (%r10,%r12,1),%r10 - xorq %r14,%r13 - movq %r11,%rdi - rorxq $39,%r11,%r12 - leaq (%r10,%r13,1),%r10 - xorq %rax,%rdi - rorxq $34,%r11,%r14 - rorxq $28,%r11,%r13 - leaq (%rcx,%r10,1),%rcx - andq %rdi,%r15 - xorq %r12,%r14 - xorq %rax,%r15 - xorq %r13,%r14 - leaq (%r10,%r15,1),%r10 - movq %rdx,%r12 - addq 32+16(%rbp),%r9 - andq %rcx,%r12 - rorxq $41,%rcx,%r13 - rorxq $18,%rcx,%r15 - leaq (%r10,%r14,1),%r10 - leaq (%r9,%r12,1),%r9 - andnq %r8,%rcx,%r12 - xorq %r15,%r13 - rorxq $14,%rcx,%r14 - leaq (%r9,%r12,1),%r9 - xorq %r14,%r13 - movq %r10,%r15 - rorxq $39,%r10,%r12 - leaq (%r9,%r13,1),%r9 - xorq %r11,%r15 - rorxq $34,%r10,%r14 - rorxq $28,%r10,%r13 - leaq (%rbx,%r9,1),%rbx - andq %r15,%rdi - xorq %r12,%r14 - xorq %r11,%rdi - xorq %r13,%r14 - leaq (%r9,%rdi,1),%r9 - movq %rcx,%r12 - addq 40+16(%rbp),%r8 - andq %rbx,%r12 - rorxq $41,%rbx,%r13 - rorxq $18,%rbx,%rdi - leaq (%r9,%r14,1),%r9 - leaq (%r8,%r12,1),%r8 - andnq %rdx,%rbx,%r12 - xorq %rdi,%r13 - rorxq $14,%rbx,%r14 - leaq (%r8,%r12,1),%r8 - xorq %r14,%r13 - movq %r9,%rdi - rorxq $39,%r9,%r12 - leaq (%r8,%r13,1),%r8 - xorq %r10,%rdi - rorxq $34,%r9,%r14 - rorxq $28,%r9,%r13 - leaq (%rax,%r8,1),%rax - andq %rdi,%r15 - xorq %r12,%r14 - xorq %r10,%r15 - xorq %r13,%r14 - leaq (%r8,%r15,1),%r8 - movq %rbx,%r12 - addq 64+16(%rbp),%rdx - andq %rax,%r12 - rorxq $41,%rax,%r13 - rorxq $18,%rax,%r15 - leaq (%r8,%r14,1),%r8 - leaq (%rdx,%r12,1),%rdx - andnq %rcx,%rax,%r12 - xorq %r15,%r13 - rorxq $14,%rax,%r14 - leaq (%rdx,%r12,1),%rdx - xorq %r14,%r13 - movq %r8,%r15 - rorxq $39,%r8,%r12 - leaq (%rdx,%r13,1),%rdx - xorq %r9,%r15 - rorxq $34,%r8,%r14 - rorxq $28,%r8,%r13 - leaq (%r11,%rdx,1),%r11 - andq %r15,%rdi - xorq %r12,%r14 - xorq %r9,%rdi - xorq %r13,%r14 - leaq (%rdx,%rdi,1),%rdx - movq %rax,%r12 - addq 72+16(%rbp),%rcx - andq %r11,%r12 - rorxq $41,%r11,%r13 - rorxq $18,%r11,%rdi - leaq (%rdx,%r14,1),%rdx - leaq (%rcx,%r12,1),%rcx - andnq %rbx,%r11,%r12 - xorq %rdi,%r13 - rorxq $14,%r11,%r14 - leaq (%rcx,%r12,1),%rcx - xorq %r14,%r13 - movq %rdx,%rdi - rorxq $39,%rdx,%r12 - leaq (%rcx,%r13,1),%rcx - xorq %r8,%rdi - rorxq $34,%rdx,%r14 - rorxq $28,%rdx,%r13 - leaq (%r10,%rcx,1),%r10 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %r8,%r15 - xorq %r13,%r14 - leaq (%rcx,%r15,1),%rcx - movq %r11,%r12 - addq 96+16(%rbp),%rbx - andq %r10,%r12 - rorxq $41,%r10,%r13 - rorxq $18,%r10,%r15 - leaq (%rcx,%r14,1),%rcx - leaq (%rbx,%r12,1),%rbx - andnq %rax,%r10,%r12 - xorq %r15,%r13 - rorxq $14,%r10,%r14 - leaq (%rbx,%r12,1),%rbx - xorq %r14,%r13 - movq %rcx,%r15 - rorxq $39,%rcx,%r12 - leaq (%rbx,%r13,1),%rbx - xorq %rdx,%r15 - rorxq $34,%rcx,%r14 - rorxq $28,%rcx,%r13 - leaq (%r9,%rbx,1),%r9 - andq %r15,%rdi - xorq %r12,%r14 - xorq %rdx,%rdi - xorq %r13,%r14 - leaq (%rbx,%rdi,1),%rbx - movq %r10,%r12 - addq 104+16(%rbp),%rax - andq %r9,%r12 - rorxq $41,%r9,%r13 - rorxq $18,%r9,%rdi - leaq (%rbx,%r14,1),%rbx - leaq (%rax,%r12,1),%rax - andnq %r11,%r9,%r12 - xorq %rdi,%r13 - rorxq $14,%r9,%r14 - leaq (%rax,%r12,1),%rax - xorq %r14,%r13 - movq %rbx,%rdi - rorxq $39,%rbx,%r12 - leaq (%rax,%r13,1),%rax - xorq %rcx,%rdi - rorxq $34,%rbx,%r14 - rorxq $28,%rbx,%r13 - leaq (%r8,%rax,1),%r8 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %rcx,%r15 - xorq %r13,%r14 - leaq (%rax,%r15,1),%rax - movq %r9,%r12 - leaq -128(%rbp),%rbp - cmpq %rsp,%rbp - jae .Lower_avx2 - - movq 1280(%rsp),%rdi - addq %r14,%rax - - leaq 1152(%rsp),%rsp - - addq 0(%rdi),%rax - addq 8(%rdi),%rbx - addq 16(%rdi),%rcx - addq 24(%rdi),%rdx - addq 32(%rdi),%r8 - addq 40(%rdi),%r9 - leaq 256(%rsi),%rsi - addq 48(%rdi),%r10 - movq %rsi,%r12 - addq 56(%rdi),%r11 - cmpq 128+16(%rsp),%rsi - - movq %rax,0(%rdi) - cmoveq %rsp,%r12 - movq %rbx,8(%rdi) - movq %rcx,16(%rdi) - movq %rdx,24(%rdi) - movq %r8,32(%rdi) - movq %r9,40(%rdi) - movq %r10,48(%rdi) - movq %r11,56(%rdi) - - jbe .Loop_avx2 - leaq (%rsp),%rbp - -.Ldone_avx2: - leaq (%rbp),%rsp - movq 128+24(%rsp),%rsi - vzeroupper - movq (%rsi),%r15 - movq 8(%rsi),%r14 - movq 16(%rsi),%r13 - movq 24(%rsi),%r12 - movq 32(%rsi),%rbp - movq 40(%rsi),%rbx - leaq 48(%rsi),%rsp -.Lepilogue_avx2: - .byte 0xf3,0xc3 -.size sha512_block_data_order_avx2,.-sha512_block_data_order_avx2 diff --git a/deps/openssl/asm/x64-macosx-gas/aes/aesni-mb-x86_64.s b/deps/openssl/asm/x64-macosx-gas/aes/aesni-mb-x86_64.s index ccd3c7090025ff..e45c622a525e82 100644 --- a/deps/openssl/asm/x64-macosx-gas/aes/aesni-mb-x86_64.s +++ b/deps/openssl/asm/x64-macosx-gas/aes/aesni-mb-x86_64.s @@ -6,14 +6,6 @@ .p2align 5 _aesni_multi_cbc_encrypt: - cmpl $2,%edx - jb L$enc_non_avx - movl _OPENSSL_ia32cap_P+4(%rip),%ecx - testl $268435456,%ecx - jnz _avx_cbc_enc_shortcut - jmp L$enc_non_avx -.p2align 4 -L$enc_non_avx: movq %rsp,%rax pushq %rbx pushq %rbp @@ -270,14 +262,6 @@ L$enc4x_epilogue: .p2align 5 _aesni_multi_cbc_decrypt: - cmpl $2,%edx - jb L$dec_non_avx - movl _OPENSSL_ia32cap_P+4(%rip),%ecx - testl $268435456,%ecx - jnz _avx_cbc_dec_shortcut - jmp L$dec_non_avx -.p2align 4 -L$dec_non_avx: movq %rsp,%rax pushq %rbx pushq %rbp @@ -519,916 +503,3 @@ L$dec4x_done: leaq (%rax),%rsp L$dec4x_epilogue: .byte 0xf3,0xc3 - - -.p2align 5 -aesni_multi_cbc_encrypt_avx: -_avx_cbc_enc_shortcut: - movq %rsp,%rax - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - - - - - - - - - subq $192,%rsp - andq $-128,%rsp - movq %rax,16(%rsp) - -L$enc8x_body: - vzeroupper - vmovdqu (%rsi),%xmm15 - leaq 120(%rsi),%rsi - leaq 160(%rdi),%rdi - shrl $1,%edx - -L$enc8x_loop_grande: - - xorl %edx,%edx - movl -144(%rdi),%ecx - movq -160(%rdi),%r8 - cmpl %edx,%ecx - movq -152(%rdi),%rbx - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu -136(%rdi),%xmm2 - movl %ecx,32(%rsp) - cmovleq %rsp,%r8 - subq %r8,%rbx - movq %rbx,64(%rsp) - movl -104(%rdi),%ecx - movq -120(%rdi),%r9 - cmpl %edx,%ecx - movq -112(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu -96(%rdi),%xmm3 - movl %ecx,36(%rsp) - cmovleq %rsp,%r9 - subq %r9,%rbp - movq %rbp,72(%rsp) - movl -64(%rdi),%ecx - movq -80(%rdi),%r10 - cmpl %edx,%ecx - movq -72(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu -56(%rdi),%xmm4 - movl %ecx,40(%rsp) - cmovleq %rsp,%r10 - subq %r10,%rbp - movq %rbp,80(%rsp) - movl -24(%rdi),%ecx - movq -40(%rdi),%r11 - cmpl %edx,%ecx - movq -32(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu -16(%rdi),%xmm5 - movl %ecx,44(%rsp) - cmovleq %rsp,%r11 - subq %r11,%rbp - movq %rbp,88(%rsp) - movl 16(%rdi),%ecx - movq 0(%rdi),%r12 - cmpl %edx,%ecx - movq 8(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu 24(%rdi),%xmm6 - movl %ecx,48(%rsp) - cmovleq %rsp,%r12 - subq %r12,%rbp - movq %rbp,96(%rsp) - movl 56(%rdi),%ecx - movq 40(%rdi),%r13 - cmpl %edx,%ecx - movq 48(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu 64(%rdi),%xmm7 - movl %ecx,52(%rsp) - cmovleq %rsp,%r13 - subq %r13,%rbp - movq %rbp,104(%rsp) - movl 96(%rdi),%ecx - movq 80(%rdi),%r14 - cmpl %edx,%ecx - movq 88(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu 104(%rdi),%xmm8 - movl %ecx,56(%rsp) - cmovleq %rsp,%r14 - subq %r14,%rbp - movq %rbp,112(%rsp) - movl 136(%rdi),%ecx - movq 120(%rdi),%r15 - cmpl %edx,%ecx - movq 128(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu 144(%rdi),%xmm9 - movl %ecx,60(%rsp) - cmovleq %rsp,%r15 - subq %r15,%rbp - movq %rbp,120(%rsp) - testl %edx,%edx - jz L$enc8x_done - - vmovups 16-120(%rsi),%xmm1 - vmovups 32-120(%rsi),%xmm0 - movl 240-120(%rsi),%eax - - vpxor (%r8),%xmm15,%xmm10 - leaq 128(%rsp),%rbp - vpxor (%r9),%xmm15,%xmm11 - vpxor (%r10),%xmm15,%xmm12 - vpxor (%r11),%xmm15,%xmm13 - vpxor %xmm10,%xmm2,%xmm2 - vpxor (%r12),%xmm15,%xmm10 - vpxor %xmm11,%xmm3,%xmm3 - vpxor (%r13),%xmm15,%xmm11 - vpxor %xmm12,%xmm4,%xmm4 - vpxor (%r14),%xmm15,%xmm12 - vpxor %xmm13,%xmm5,%xmm5 - vpxor (%r15),%xmm15,%xmm13 - vpxor %xmm10,%xmm6,%xmm6 - movl $1,%ecx - vpxor %xmm11,%xmm7,%xmm7 - vpxor %xmm12,%xmm8,%xmm8 - vpxor %xmm13,%xmm9,%xmm9 - jmp L$oop_enc8x - -.p2align 5 -L$oop_enc8x: - vaesenc %xmm1,%xmm2,%xmm2 - cmpl 32+0(%rsp),%ecx - vaesenc %xmm1,%xmm3,%xmm3 - prefetcht0 31(%r8) - vaesenc %xmm1,%xmm4,%xmm4 - vaesenc %xmm1,%xmm5,%xmm5 - leaq (%r8,%rbx,1),%rbx - cmovgeq %rsp,%r8 - vaesenc %xmm1,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesenc %xmm1,%xmm7,%xmm7 - subq %r8,%rbx - vaesenc %xmm1,%xmm8,%xmm8 - vpxor 16(%r8),%xmm15,%xmm10 - movq %rbx,64+0(%rsp) - vaesenc %xmm1,%xmm9,%xmm9 - vmovups -72(%rsi),%xmm1 - leaq 16(%r8,%rbx,1),%r8 - vmovdqu %xmm10,0(%rbp) - vaesenc %xmm0,%xmm2,%xmm2 - cmpl 32+4(%rsp),%ecx - movq 64+8(%rsp),%rbx - vaesenc %xmm0,%xmm3,%xmm3 - prefetcht0 31(%r9) - vaesenc %xmm0,%xmm4,%xmm4 - vaesenc %xmm0,%xmm5,%xmm5 - leaq (%r9,%rbx,1),%rbx - cmovgeq %rsp,%r9 - vaesenc %xmm0,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesenc %xmm0,%xmm7,%xmm7 - subq %r9,%rbx - vaesenc %xmm0,%xmm8,%xmm8 - vpxor 16(%r9),%xmm15,%xmm11 - movq %rbx,64+8(%rsp) - vaesenc %xmm0,%xmm9,%xmm9 - vmovups -56(%rsi),%xmm0 - leaq 16(%r9,%rbx,1),%r9 - vmovdqu %xmm11,16(%rbp) - vaesenc %xmm1,%xmm2,%xmm2 - cmpl 32+8(%rsp),%ecx - movq 64+16(%rsp),%rbx - vaesenc %xmm1,%xmm3,%xmm3 - prefetcht0 31(%r10) - vaesenc %xmm1,%xmm4,%xmm4 - prefetcht0 15(%r8) - vaesenc %xmm1,%xmm5,%xmm5 - leaq (%r10,%rbx,1),%rbx - cmovgeq %rsp,%r10 - vaesenc %xmm1,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesenc %xmm1,%xmm7,%xmm7 - subq %r10,%rbx - vaesenc %xmm1,%xmm8,%xmm8 - vpxor 16(%r10),%xmm15,%xmm12 - movq %rbx,64+16(%rsp) - vaesenc %xmm1,%xmm9,%xmm9 - vmovups -40(%rsi),%xmm1 - leaq 16(%r10,%rbx,1),%r10 - vmovdqu %xmm12,32(%rbp) - vaesenc %xmm0,%xmm2,%xmm2 - cmpl 32+12(%rsp),%ecx - movq 64+24(%rsp),%rbx - vaesenc %xmm0,%xmm3,%xmm3 - prefetcht0 31(%r11) - vaesenc %xmm0,%xmm4,%xmm4 - prefetcht0 15(%r9) - vaesenc %xmm0,%xmm5,%xmm5 - leaq (%r11,%rbx,1),%rbx - cmovgeq %rsp,%r11 - vaesenc %xmm0,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesenc %xmm0,%xmm7,%xmm7 - subq %r11,%rbx - vaesenc %xmm0,%xmm8,%xmm8 - vpxor 16(%r11),%xmm15,%xmm13 - movq %rbx,64+24(%rsp) - vaesenc %xmm0,%xmm9,%xmm9 - vmovups -24(%rsi),%xmm0 - leaq 16(%r11,%rbx,1),%r11 - vmovdqu %xmm13,48(%rbp) - vaesenc %xmm1,%xmm2,%xmm2 - cmpl 32+16(%rsp),%ecx - movq 64+32(%rsp),%rbx - vaesenc %xmm1,%xmm3,%xmm3 - prefetcht0 31(%r12) - vaesenc %xmm1,%xmm4,%xmm4 - prefetcht0 15(%r10) - vaesenc %xmm1,%xmm5,%xmm5 - leaq (%r12,%rbx,1),%rbx - cmovgeq %rsp,%r12 - vaesenc %xmm1,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesenc %xmm1,%xmm7,%xmm7 - subq %r12,%rbx - vaesenc %xmm1,%xmm8,%xmm8 - vpxor 16(%r12),%xmm15,%xmm10 - movq %rbx,64+32(%rsp) - vaesenc %xmm1,%xmm9,%xmm9 - vmovups -8(%rsi),%xmm1 - leaq 16(%r12,%rbx,1),%r12 - vaesenc %xmm0,%xmm2,%xmm2 - cmpl 32+20(%rsp),%ecx - movq 64+40(%rsp),%rbx - vaesenc %xmm0,%xmm3,%xmm3 - prefetcht0 31(%r13) - vaesenc %xmm0,%xmm4,%xmm4 - prefetcht0 15(%r11) - vaesenc %xmm0,%xmm5,%xmm5 - leaq (%rbx,%r13,1),%rbx - cmovgeq %rsp,%r13 - vaesenc %xmm0,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesenc %xmm0,%xmm7,%xmm7 - subq %r13,%rbx - vaesenc %xmm0,%xmm8,%xmm8 - vpxor 16(%r13),%xmm15,%xmm11 - movq %rbx,64+40(%rsp) - vaesenc %xmm0,%xmm9,%xmm9 - vmovups 8(%rsi),%xmm0 - leaq 16(%r13,%rbx,1),%r13 - vaesenc %xmm1,%xmm2,%xmm2 - cmpl 32+24(%rsp),%ecx - movq 64+48(%rsp),%rbx - vaesenc %xmm1,%xmm3,%xmm3 - prefetcht0 31(%r14) - vaesenc %xmm1,%xmm4,%xmm4 - prefetcht0 15(%r12) - vaesenc %xmm1,%xmm5,%xmm5 - leaq (%r14,%rbx,1),%rbx - cmovgeq %rsp,%r14 - vaesenc %xmm1,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesenc %xmm1,%xmm7,%xmm7 - subq %r14,%rbx - vaesenc %xmm1,%xmm8,%xmm8 - vpxor 16(%r14),%xmm15,%xmm12 - movq %rbx,64+48(%rsp) - vaesenc %xmm1,%xmm9,%xmm9 - vmovups 24(%rsi),%xmm1 - leaq 16(%r14,%rbx,1),%r14 - vaesenc %xmm0,%xmm2,%xmm2 - cmpl 32+28(%rsp),%ecx - movq 64+56(%rsp),%rbx - vaesenc %xmm0,%xmm3,%xmm3 - prefetcht0 31(%r15) - vaesenc %xmm0,%xmm4,%xmm4 - prefetcht0 15(%r13) - vaesenc %xmm0,%xmm5,%xmm5 - leaq (%r15,%rbx,1),%rbx - cmovgeq %rsp,%r15 - vaesenc %xmm0,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesenc %xmm0,%xmm7,%xmm7 - subq %r15,%rbx - vaesenc %xmm0,%xmm8,%xmm8 - vpxor 16(%r15),%xmm15,%xmm13 - movq %rbx,64+56(%rsp) - vaesenc %xmm0,%xmm9,%xmm9 - vmovups 40(%rsi),%xmm0 - leaq 16(%r15,%rbx,1),%r15 - vmovdqu 32(%rsp),%xmm14 - prefetcht0 15(%r14) - prefetcht0 15(%r15) - cmpl $11,%eax - jb L$enc8x_tail - - vaesenc %xmm1,%xmm2,%xmm2 - vaesenc %xmm1,%xmm3,%xmm3 - vaesenc %xmm1,%xmm4,%xmm4 - vaesenc %xmm1,%xmm5,%xmm5 - vaesenc %xmm1,%xmm6,%xmm6 - vaesenc %xmm1,%xmm7,%xmm7 - vaesenc %xmm1,%xmm8,%xmm8 - vaesenc %xmm1,%xmm9,%xmm9 - vmovups 176-120(%rsi),%xmm1 - - vaesenc %xmm0,%xmm2,%xmm2 - vaesenc %xmm0,%xmm3,%xmm3 - vaesenc %xmm0,%xmm4,%xmm4 - vaesenc %xmm0,%xmm5,%xmm5 - vaesenc %xmm0,%xmm6,%xmm6 - vaesenc %xmm0,%xmm7,%xmm7 - vaesenc %xmm0,%xmm8,%xmm8 - vaesenc %xmm0,%xmm9,%xmm9 - vmovups 192-120(%rsi),%xmm0 - je L$enc8x_tail - - vaesenc %xmm1,%xmm2,%xmm2 - vaesenc %xmm1,%xmm3,%xmm3 - vaesenc %xmm1,%xmm4,%xmm4 - vaesenc %xmm1,%xmm5,%xmm5 - vaesenc %xmm1,%xmm6,%xmm6 - vaesenc %xmm1,%xmm7,%xmm7 - vaesenc %xmm1,%xmm8,%xmm8 - vaesenc %xmm1,%xmm9,%xmm9 - vmovups 208-120(%rsi),%xmm1 - - vaesenc %xmm0,%xmm2,%xmm2 - vaesenc %xmm0,%xmm3,%xmm3 - vaesenc %xmm0,%xmm4,%xmm4 - vaesenc %xmm0,%xmm5,%xmm5 - vaesenc %xmm0,%xmm6,%xmm6 - vaesenc %xmm0,%xmm7,%xmm7 - vaesenc %xmm0,%xmm8,%xmm8 - vaesenc %xmm0,%xmm9,%xmm9 - vmovups 224-120(%rsi),%xmm0 - -L$enc8x_tail: - vaesenc %xmm1,%xmm2,%xmm2 - vpxor %xmm15,%xmm15,%xmm15 - vaesenc %xmm1,%xmm3,%xmm3 - vaesenc %xmm1,%xmm4,%xmm4 - vpcmpgtd %xmm15,%xmm14,%xmm15 - vaesenc %xmm1,%xmm5,%xmm5 - vaesenc %xmm1,%xmm6,%xmm6 - vpaddd %xmm14,%xmm15,%xmm15 - vmovdqu 48(%rsp),%xmm14 - vaesenc %xmm1,%xmm7,%xmm7 - movq 64(%rsp),%rbx - vaesenc %xmm1,%xmm8,%xmm8 - vaesenc %xmm1,%xmm9,%xmm9 - vmovups 16-120(%rsi),%xmm1 - - vaesenclast %xmm0,%xmm2,%xmm2 - vmovdqa %xmm15,32(%rsp) - vpxor %xmm15,%xmm15,%xmm15 - vaesenclast %xmm0,%xmm3,%xmm3 - vaesenclast %xmm0,%xmm4,%xmm4 - vpcmpgtd %xmm15,%xmm14,%xmm15 - vaesenclast %xmm0,%xmm5,%xmm5 - vaesenclast %xmm0,%xmm6,%xmm6 - vpaddd %xmm15,%xmm14,%xmm14 - vmovdqu -120(%rsi),%xmm15 - vaesenclast %xmm0,%xmm7,%xmm7 - vaesenclast %xmm0,%xmm8,%xmm8 - vmovdqa %xmm14,48(%rsp) - vaesenclast %xmm0,%xmm9,%xmm9 - vmovups 32-120(%rsi),%xmm0 - - vmovups %xmm2,-16(%r8) - subq %rbx,%r8 - vpxor 0(%rbp),%xmm2,%xmm2 - vmovups %xmm3,-16(%r9) - subq 72(%rsp),%r9 - vpxor 16(%rbp),%xmm3,%xmm3 - vmovups %xmm4,-16(%r10) - subq 80(%rsp),%r10 - vpxor 32(%rbp),%xmm4,%xmm4 - vmovups %xmm5,-16(%r11) - subq 88(%rsp),%r11 - vpxor 48(%rbp),%xmm5,%xmm5 - vmovups %xmm6,-16(%r12) - subq 96(%rsp),%r12 - vpxor %xmm10,%xmm6,%xmm6 - vmovups %xmm7,-16(%r13) - subq 104(%rsp),%r13 - vpxor %xmm11,%xmm7,%xmm7 - vmovups %xmm8,-16(%r14) - subq 112(%rsp),%r14 - vpxor %xmm12,%xmm8,%xmm8 - vmovups %xmm9,-16(%r15) - subq 120(%rsp),%r15 - vpxor %xmm13,%xmm9,%xmm9 - - decl %edx - jnz L$oop_enc8x - - movq 16(%rsp),%rax - - - - - -L$enc8x_done: - vzeroupper - movq -48(%rax),%r15 - movq -40(%rax),%r14 - movq -32(%rax),%r13 - movq -24(%rax),%r12 - movq -16(%rax),%rbp - movq -8(%rax),%rbx - leaq (%rax),%rsp -L$enc8x_epilogue: - .byte 0xf3,0xc3 - - - -.p2align 5 -aesni_multi_cbc_decrypt_avx: -_avx_cbc_dec_shortcut: - movq %rsp,%rax - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - - - - - - - - - - subq $256,%rsp - andq $-256,%rsp - subq $192,%rsp - movq %rax,16(%rsp) - -L$dec8x_body: - vzeroupper - vmovdqu (%rsi),%xmm15 - leaq 120(%rsi),%rsi - leaq 160(%rdi),%rdi - shrl $1,%edx - -L$dec8x_loop_grande: - - xorl %edx,%edx - movl -144(%rdi),%ecx - movq -160(%rdi),%r8 - cmpl %edx,%ecx - movq -152(%rdi),%rbx - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu -136(%rdi),%xmm2 - movl %ecx,32(%rsp) - cmovleq %rsp,%r8 - subq %r8,%rbx - movq %rbx,64(%rsp) - vmovdqu %xmm2,192(%rsp) - movl -104(%rdi),%ecx - movq -120(%rdi),%r9 - cmpl %edx,%ecx - movq -112(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu -96(%rdi),%xmm3 - movl %ecx,36(%rsp) - cmovleq %rsp,%r9 - subq %r9,%rbp - movq %rbp,72(%rsp) - vmovdqu %xmm3,208(%rsp) - movl -64(%rdi),%ecx - movq -80(%rdi),%r10 - cmpl %edx,%ecx - movq -72(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu -56(%rdi),%xmm4 - movl %ecx,40(%rsp) - cmovleq %rsp,%r10 - subq %r10,%rbp - movq %rbp,80(%rsp) - vmovdqu %xmm4,224(%rsp) - movl -24(%rdi),%ecx - movq -40(%rdi),%r11 - cmpl %edx,%ecx - movq -32(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu -16(%rdi),%xmm5 - movl %ecx,44(%rsp) - cmovleq %rsp,%r11 - subq %r11,%rbp - movq %rbp,88(%rsp) - vmovdqu %xmm5,240(%rsp) - movl 16(%rdi),%ecx - movq 0(%rdi),%r12 - cmpl %edx,%ecx - movq 8(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu 24(%rdi),%xmm6 - movl %ecx,48(%rsp) - cmovleq %rsp,%r12 - subq %r12,%rbp - movq %rbp,96(%rsp) - vmovdqu %xmm6,256(%rsp) - movl 56(%rdi),%ecx - movq 40(%rdi),%r13 - cmpl %edx,%ecx - movq 48(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu 64(%rdi),%xmm7 - movl %ecx,52(%rsp) - cmovleq %rsp,%r13 - subq %r13,%rbp - movq %rbp,104(%rsp) - vmovdqu %xmm7,272(%rsp) - movl 96(%rdi),%ecx - movq 80(%rdi),%r14 - cmpl %edx,%ecx - movq 88(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu 104(%rdi),%xmm8 - movl %ecx,56(%rsp) - cmovleq %rsp,%r14 - subq %r14,%rbp - movq %rbp,112(%rsp) - vmovdqu %xmm8,288(%rsp) - movl 136(%rdi),%ecx - movq 120(%rdi),%r15 - cmpl %edx,%ecx - movq 128(%rdi),%rbp - cmovgl %ecx,%edx - testl %ecx,%ecx - vmovdqu 144(%rdi),%xmm9 - movl %ecx,60(%rsp) - cmovleq %rsp,%r15 - subq %r15,%rbp - movq %rbp,120(%rsp) - vmovdqu %xmm9,304(%rsp) - testl %edx,%edx - jz L$dec8x_done - - vmovups 16-120(%rsi),%xmm1 - vmovups 32-120(%rsi),%xmm0 - movl 240-120(%rsi),%eax - leaq 192+128(%rsp),%rbp - - vmovdqu (%r8),%xmm2 - vmovdqu (%r9),%xmm3 - vmovdqu (%r10),%xmm4 - vmovdqu (%r11),%xmm5 - vmovdqu (%r12),%xmm6 - vmovdqu (%r13),%xmm7 - vmovdqu (%r14),%xmm8 - vmovdqu (%r15),%xmm9 - vmovdqu %xmm2,0(%rbp) - vpxor %xmm15,%xmm2,%xmm2 - vmovdqu %xmm3,16(%rbp) - vpxor %xmm15,%xmm3,%xmm3 - vmovdqu %xmm4,32(%rbp) - vpxor %xmm15,%xmm4,%xmm4 - vmovdqu %xmm5,48(%rbp) - vpxor %xmm15,%xmm5,%xmm5 - vmovdqu %xmm6,64(%rbp) - vpxor %xmm15,%xmm6,%xmm6 - vmovdqu %xmm7,80(%rbp) - vpxor %xmm15,%xmm7,%xmm7 - vmovdqu %xmm8,96(%rbp) - vpxor %xmm15,%xmm8,%xmm8 - vmovdqu %xmm9,112(%rbp) - vpxor %xmm15,%xmm9,%xmm9 - xorq $128,%rbp - movl $1,%ecx - jmp L$oop_dec8x - -.p2align 5 -L$oop_dec8x: - vaesdec %xmm1,%xmm2,%xmm2 - cmpl 32+0(%rsp),%ecx - vaesdec %xmm1,%xmm3,%xmm3 - prefetcht0 31(%r8) - vaesdec %xmm1,%xmm4,%xmm4 - vaesdec %xmm1,%xmm5,%xmm5 - leaq (%r8,%rbx,1),%rbx - cmovgeq %rsp,%r8 - vaesdec %xmm1,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesdec %xmm1,%xmm7,%xmm7 - subq %r8,%rbx - vaesdec %xmm1,%xmm8,%xmm8 - vmovdqu 16(%r8),%xmm10 - movq %rbx,64+0(%rsp) - vaesdec %xmm1,%xmm9,%xmm9 - vmovups -72(%rsi),%xmm1 - leaq 16(%r8,%rbx,1),%r8 - vmovdqu %xmm10,128(%rsp) - vaesdec %xmm0,%xmm2,%xmm2 - cmpl 32+4(%rsp),%ecx - movq 64+8(%rsp),%rbx - vaesdec %xmm0,%xmm3,%xmm3 - prefetcht0 31(%r9) - vaesdec %xmm0,%xmm4,%xmm4 - vaesdec %xmm0,%xmm5,%xmm5 - leaq (%r9,%rbx,1),%rbx - cmovgeq %rsp,%r9 - vaesdec %xmm0,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesdec %xmm0,%xmm7,%xmm7 - subq %r9,%rbx - vaesdec %xmm0,%xmm8,%xmm8 - vmovdqu 16(%r9),%xmm11 - movq %rbx,64+8(%rsp) - vaesdec %xmm0,%xmm9,%xmm9 - vmovups -56(%rsi),%xmm0 - leaq 16(%r9,%rbx,1),%r9 - vmovdqu %xmm11,144(%rsp) - vaesdec %xmm1,%xmm2,%xmm2 - cmpl 32+8(%rsp),%ecx - movq 64+16(%rsp),%rbx - vaesdec %xmm1,%xmm3,%xmm3 - prefetcht0 31(%r10) - vaesdec %xmm1,%xmm4,%xmm4 - prefetcht0 15(%r8) - vaesdec %xmm1,%xmm5,%xmm5 - leaq (%r10,%rbx,1),%rbx - cmovgeq %rsp,%r10 - vaesdec %xmm1,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesdec %xmm1,%xmm7,%xmm7 - subq %r10,%rbx - vaesdec %xmm1,%xmm8,%xmm8 - vmovdqu 16(%r10),%xmm12 - movq %rbx,64+16(%rsp) - vaesdec %xmm1,%xmm9,%xmm9 - vmovups -40(%rsi),%xmm1 - leaq 16(%r10,%rbx,1),%r10 - vmovdqu %xmm12,160(%rsp) - vaesdec %xmm0,%xmm2,%xmm2 - cmpl 32+12(%rsp),%ecx - movq 64+24(%rsp),%rbx - vaesdec %xmm0,%xmm3,%xmm3 - prefetcht0 31(%r11) - vaesdec %xmm0,%xmm4,%xmm4 - prefetcht0 15(%r9) - vaesdec %xmm0,%xmm5,%xmm5 - leaq (%r11,%rbx,1),%rbx - cmovgeq %rsp,%r11 - vaesdec %xmm0,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesdec %xmm0,%xmm7,%xmm7 - subq %r11,%rbx - vaesdec %xmm0,%xmm8,%xmm8 - vmovdqu 16(%r11),%xmm13 - movq %rbx,64+24(%rsp) - vaesdec %xmm0,%xmm9,%xmm9 - vmovups -24(%rsi),%xmm0 - leaq 16(%r11,%rbx,1),%r11 - vmovdqu %xmm13,176(%rsp) - vaesdec %xmm1,%xmm2,%xmm2 - cmpl 32+16(%rsp),%ecx - movq 64+32(%rsp),%rbx - vaesdec %xmm1,%xmm3,%xmm3 - prefetcht0 31(%r12) - vaesdec %xmm1,%xmm4,%xmm4 - prefetcht0 15(%r10) - vaesdec %xmm1,%xmm5,%xmm5 - leaq (%r12,%rbx,1),%rbx - cmovgeq %rsp,%r12 - vaesdec %xmm1,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesdec %xmm1,%xmm7,%xmm7 - subq %r12,%rbx - vaesdec %xmm1,%xmm8,%xmm8 - vmovdqu 16(%r12),%xmm10 - movq %rbx,64+32(%rsp) - vaesdec %xmm1,%xmm9,%xmm9 - vmovups -8(%rsi),%xmm1 - leaq 16(%r12,%rbx,1),%r12 - vaesdec %xmm0,%xmm2,%xmm2 - cmpl 32+20(%rsp),%ecx - movq 64+40(%rsp),%rbx - vaesdec %xmm0,%xmm3,%xmm3 - prefetcht0 31(%r13) - vaesdec %xmm0,%xmm4,%xmm4 - prefetcht0 15(%r11) - vaesdec %xmm0,%xmm5,%xmm5 - leaq (%rbx,%r13,1),%rbx - cmovgeq %rsp,%r13 - vaesdec %xmm0,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesdec %xmm0,%xmm7,%xmm7 - subq %r13,%rbx - vaesdec %xmm0,%xmm8,%xmm8 - vmovdqu 16(%r13),%xmm11 - movq %rbx,64+40(%rsp) - vaesdec %xmm0,%xmm9,%xmm9 - vmovups 8(%rsi),%xmm0 - leaq 16(%r13,%rbx,1),%r13 - vaesdec %xmm1,%xmm2,%xmm2 - cmpl 32+24(%rsp),%ecx - movq 64+48(%rsp),%rbx - vaesdec %xmm1,%xmm3,%xmm3 - prefetcht0 31(%r14) - vaesdec %xmm1,%xmm4,%xmm4 - prefetcht0 15(%r12) - vaesdec %xmm1,%xmm5,%xmm5 - leaq (%r14,%rbx,1),%rbx - cmovgeq %rsp,%r14 - vaesdec %xmm1,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesdec %xmm1,%xmm7,%xmm7 - subq %r14,%rbx - vaesdec %xmm1,%xmm8,%xmm8 - vmovdqu 16(%r14),%xmm12 - movq %rbx,64+48(%rsp) - vaesdec %xmm1,%xmm9,%xmm9 - vmovups 24(%rsi),%xmm1 - leaq 16(%r14,%rbx,1),%r14 - vaesdec %xmm0,%xmm2,%xmm2 - cmpl 32+28(%rsp),%ecx - movq 64+56(%rsp),%rbx - vaesdec %xmm0,%xmm3,%xmm3 - prefetcht0 31(%r15) - vaesdec %xmm0,%xmm4,%xmm4 - prefetcht0 15(%r13) - vaesdec %xmm0,%xmm5,%xmm5 - leaq (%r15,%rbx,1),%rbx - cmovgeq %rsp,%r15 - vaesdec %xmm0,%xmm6,%xmm6 - cmovgq %rsp,%rbx - vaesdec %xmm0,%xmm7,%xmm7 - subq %r15,%rbx - vaesdec %xmm0,%xmm8,%xmm8 - vmovdqu 16(%r15),%xmm13 - movq %rbx,64+56(%rsp) - vaesdec %xmm0,%xmm9,%xmm9 - vmovups 40(%rsi),%xmm0 - leaq 16(%r15,%rbx,1),%r15 - vmovdqu 32(%rsp),%xmm14 - prefetcht0 15(%r14) - prefetcht0 15(%r15) - cmpl $11,%eax - jb L$dec8x_tail - - vaesdec %xmm1,%xmm2,%xmm2 - vaesdec %xmm1,%xmm3,%xmm3 - vaesdec %xmm1,%xmm4,%xmm4 - vaesdec %xmm1,%xmm5,%xmm5 - vaesdec %xmm1,%xmm6,%xmm6 - vaesdec %xmm1,%xmm7,%xmm7 - vaesdec %xmm1,%xmm8,%xmm8 - vaesdec %xmm1,%xmm9,%xmm9 - vmovups 176-120(%rsi),%xmm1 - - vaesdec %xmm0,%xmm2,%xmm2 - vaesdec %xmm0,%xmm3,%xmm3 - vaesdec %xmm0,%xmm4,%xmm4 - vaesdec %xmm0,%xmm5,%xmm5 - vaesdec %xmm0,%xmm6,%xmm6 - vaesdec %xmm0,%xmm7,%xmm7 - vaesdec %xmm0,%xmm8,%xmm8 - vaesdec %xmm0,%xmm9,%xmm9 - vmovups 192-120(%rsi),%xmm0 - je L$dec8x_tail - - vaesdec %xmm1,%xmm2,%xmm2 - vaesdec %xmm1,%xmm3,%xmm3 - vaesdec %xmm1,%xmm4,%xmm4 - vaesdec %xmm1,%xmm5,%xmm5 - vaesdec %xmm1,%xmm6,%xmm6 - vaesdec %xmm1,%xmm7,%xmm7 - vaesdec %xmm1,%xmm8,%xmm8 - vaesdec %xmm1,%xmm9,%xmm9 - vmovups 208-120(%rsi),%xmm1 - - vaesdec %xmm0,%xmm2,%xmm2 - vaesdec %xmm0,%xmm3,%xmm3 - vaesdec %xmm0,%xmm4,%xmm4 - vaesdec %xmm0,%xmm5,%xmm5 - vaesdec %xmm0,%xmm6,%xmm6 - vaesdec %xmm0,%xmm7,%xmm7 - vaesdec %xmm0,%xmm8,%xmm8 - vaesdec %xmm0,%xmm9,%xmm9 - vmovups 224-120(%rsi),%xmm0 - -L$dec8x_tail: - vaesdec %xmm1,%xmm2,%xmm2 - vpxor %xmm15,%xmm15,%xmm15 - vaesdec %xmm1,%xmm3,%xmm3 - vaesdec %xmm1,%xmm4,%xmm4 - vpcmpgtd %xmm15,%xmm14,%xmm15 - vaesdec %xmm1,%xmm5,%xmm5 - vaesdec %xmm1,%xmm6,%xmm6 - vpaddd %xmm14,%xmm15,%xmm15 - vmovdqu 48(%rsp),%xmm14 - vaesdec %xmm1,%xmm7,%xmm7 - movq 64(%rsp),%rbx - vaesdec %xmm1,%xmm8,%xmm8 - vaesdec %xmm1,%xmm9,%xmm9 - vmovups 16-120(%rsi),%xmm1 - - vaesdeclast %xmm0,%xmm2,%xmm2 - vmovdqa %xmm15,32(%rsp) - vpxor %xmm15,%xmm15,%xmm15 - vaesdeclast %xmm0,%xmm3,%xmm3 - vpxor 0(%rbp),%xmm2,%xmm2 - vaesdeclast %xmm0,%xmm4,%xmm4 - vpxor 16(%rbp),%xmm3,%xmm3 - vpcmpgtd %xmm15,%xmm14,%xmm15 - vaesdeclast %xmm0,%xmm5,%xmm5 - vpxor 32(%rbp),%xmm4,%xmm4 - vaesdeclast %xmm0,%xmm6,%xmm6 - vpxor 48(%rbp),%xmm5,%xmm5 - vpaddd %xmm15,%xmm14,%xmm14 - vmovdqu -120(%rsi),%xmm15 - vaesdeclast %xmm0,%xmm7,%xmm7 - vpxor 64(%rbp),%xmm6,%xmm6 - vaesdeclast %xmm0,%xmm8,%xmm8 - vpxor 80(%rbp),%xmm7,%xmm7 - vmovdqa %xmm14,48(%rsp) - vaesdeclast %xmm0,%xmm9,%xmm9 - vpxor 96(%rbp),%xmm8,%xmm8 - vmovups 32-120(%rsi),%xmm0 - - vmovups %xmm2,-16(%r8) - subq %rbx,%r8 - vmovdqu 128+0(%rsp),%xmm2 - vpxor 112(%rbp),%xmm9,%xmm9 - vmovups %xmm3,-16(%r9) - subq 72(%rsp),%r9 - vmovdqu %xmm2,0(%rbp) - vpxor %xmm15,%xmm2,%xmm2 - vmovdqu 128+16(%rsp),%xmm3 - vmovups %xmm4,-16(%r10) - subq 80(%rsp),%r10 - vmovdqu %xmm3,16(%rbp) - vpxor %xmm15,%xmm3,%xmm3 - vmovdqu 128+32(%rsp),%xmm4 - vmovups %xmm5,-16(%r11) - subq 88(%rsp),%r11 - vmovdqu %xmm4,32(%rbp) - vpxor %xmm15,%xmm4,%xmm4 - vmovdqu 128+48(%rsp),%xmm5 - vmovups %xmm6,-16(%r12) - subq 96(%rsp),%r12 - vmovdqu %xmm5,48(%rbp) - vpxor %xmm15,%xmm5,%xmm5 - vmovdqu %xmm10,64(%rbp) - vpxor %xmm10,%xmm15,%xmm6 - vmovups %xmm7,-16(%r13) - subq 104(%rsp),%r13 - vmovdqu %xmm11,80(%rbp) - vpxor %xmm11,%xmm15,%xmm7 - vmovups %xmm8,-16(%r14) - subq 112(%rsp),%r14 - vmovdqu %xmm12,96(%rbp) - vpxor %xmm12,%xmm15,%xmm8 - vmovups %xmm9,-16(%r15) - subq 120(%rsp),%r15 - vmovdqu %xmm13,112(%rbp) - vpxor %xmm13,%xmm15,%xmm9 - - xorq $128,%rbp - decl %edx - jnz L$oop_dec8x - - movq 16(%rsp),%rax - - - - - -L$dec8x_done: - vzeroupper - movq -48(%rax),%r15 - movq -40(%rax),%r14 - movq -32(%rax),%r13 - movq -24(%rax),%r12 - movq -16(%rax),%rbp - movq -8(%rax),%rbx - leaq (%rax),%rsp -L$dec8x_epilogue: - .byte 0xf3,0xc3 diff --git a/deps/openssl/asm/x64-macosx-gas/aes/aesni-sha1-x86_64.s b/deps/openssl/asm/x64-macosx-gas/aes/aesni-sha1-x86_64.s index c7606aec49a95b..970a12149bd241 100644 --- a/deps/openssl/asm/x64-macosx-gas/aes/aesni-sha1-x86_64.s +++ b/deps/openssl/asm/x64-macosx-gas/aes/aesni-sha1-x86_64.s @@ -10,11 +10,6 @@ _aesni_cbc_sha1_enc: movq _OPENSSL_ia32cap_P+4(%rip),%r11 btq $61,%r11 jc aesni_cbc_sha1_enc_shaext - andl $268435456,%r11d - andl $1073741824,%r10d - orl %r11d,%r10d - cmpl $1342177280,%r10d - je aesni_cbc_sha1_enc_avx jmp aesni_cbc_sha1_enc_ssse3 .byte 0xf3,0xc3 @@ -1372,1304 +1367,6 @@ L$aesenclast5: L$epilogue_ssse3: .byte 0xf3,0xc3 - -.p2align 5 -aesni_cbc_sha1_enc_avx: - movq 8(%rsp),%r10 - - - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - leaq -104(%rsp),%rsp - - - vzeroall - movq %rdi,%r12 - movq %rsi,%r13 - movq %rdx,%r14 - leaq 112(%rcx),%r15 - vmovdqu (%r8),%xmm12 - movq %r8,88(%rsp) - shlq $6,%r14 - subq %r12,%r13 - movl 240-112(%r15),%r8d - addq %r10,%r14 - - leaq K_XX_XX(%rip),%r11 - movl 0(%r9),%eax - movl 4(%r9),%ebx - movl 8(%r9),%ecx - movl 12(%r9),%edx - movl %ebx,%esi - movl 16(%r9),%ebp - movl %ecx,%edi - xorl %edx,%edi - andl %edi,%esi - - vmovdqa 64(%r11),%xmm6 - vmovdqa 0(%r11),%xmm10 - vmovdqu 0(%r10),%xmm0 - vmovdqu 16(%r10),%xmm1 - vmovdqu 32(%r10),%xmm2 - vmovdqu 48(%r10),%xmm3 - vpshufb %xmm6,%xmm0,%xmm0 - addq $64,%r10 - vpshufb %xmm6,%xmm1,%xmm1 - vpshufb %xmm6,%xmm2,%xmm2 - vpshufb %xmm6,%xmm3,%xmm3 - vpaddd %xmm10,%xmm0,%xmm4 - vpaddd %xmm10,%xmm1,%xmm5 - vpaddd %xmm10,%xmm2,%xmm6 - vmovdqa %xmm4,0(%rsp) - vmovdqa %xmm5,16(%rsp) - vmovdqa %xmm6,32(%rsp) - vmovups -112(%r15),%xmm15 - vmovups 16-112(%r15),%xmm14 - jmp L$oop_avx -.p2align 5 -L$oop_avx: - shrdl $2,%ebx,%ebx - vmovdqu 0(%r12),%xmm13 - vpxor %xmm15,%xmm13,%xmm13 - vpxor %xmm13,%xmm12,%xmm12 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups -80(%r15),%xmm15 - xorl %edx,%esi - vpalignr $8,%xmm0,%xmm1,%xmm4 - movl %eax,%edi - addl 0(%rsp),%ebp - vpaddd %xmm3,%xmm10,%xmm9 - xorl %ecx,%ebx - shldl $5,%eax,%eax - vpsrldq $4,%xmm3,%xmm8 - addl %esi,%ebp - andl %ebx,%edi - vpxor %xmm0,%xmm4,%xmm4 - xorl %ecx,%ebx - addl %eax,%ebp - vpxor %xmm2,%xmm8,%xmm8 - shrdl $7,%eax,%eax - xorl %ecx,%edi - movl %ebp,%esi - addl 4(%rsp),%edx - vpxor %xmm8,%xmm4,%xmm4 - xorl %ebx,%eax - shldl $5,%ebp,%ebp - vmovdqa %xmm9,48(%rsp) - addl %edi,%edx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups -64(%r15),%xmm14 - andl %eax,%esi - vpsrld $31,%xmm4,%xmm8 - xorl %ebx,%eax - addl %ebp,%edx - shrdl $7,%ebp,%ebp - xorl %ebx,%esi - vpslldq $12,%xmm4,%xmm9 - vpaddd %xmm4,%xmm4,%xmm4 - movl %edx,%edi - addl 8(%rsp),%ecx - xorl %eax,%ebp - shldl $5,%edx,%edx - vpor %xmm8,%xmm4,%xmm4 - vpsrld $30,%xmm9,%xmm8 - addl %esi,%ecx - andl %ebp,%edi - xorl %eax,%ebp - addl %edx,%ecx - vpslld $2,%xmm9,%xmm9 - vpxor %xmm8,%xmm4,%xmm4 - shrdl $7,%edx,%edx - xorl %eax,%edi - movl %ecx,%esi - addl 12(%rsp),%ebx - vaesenc %xmm14,%xmm12,%xmm12 - vmovups -48(%r15),%xmm15 - vpxor %xmm9,%xmm4,%xmm4 - xorl %ebp,%edx - shldl $5,%ecx,%ecx - addl %edi,%ebx - andl %edx,%esi - xorl %ebp,%edx - addl %ecx,%ebx - shrdl $7,%ecx,%ecx - xorl %ebp,%esi - vpalignr $8,%xmm1,%xmm2,%xmm5 - movl %ebx,%edi - addl 16(%rsp),%eax - vpaddd %xmm4,%xmm10,%xmm9 - xorl %edx,%ecx - shldl $5,%ebx,%ebx - vpsrldq $4,%xmm4,%xmm8 - addl %esi,%eax - andl %ecx,%edi - vpxor %xmm1,%xmm5,%xmm5 - xorl %edx,%ecx - addl %ebx,%eax - vpxor %xmm3,%xmm8,%xmm8 - shrdl $7,%ebx,%ebx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups -32(%r15),%xmm14 - xorl %edx,%edi - movl %eax,%esi - addl 20(%rsp),%ebp - vpxor %xmm8,%xmm5,%xmm5 - xorl %ecx,%ebx - shldl $5,%eax,%eax - vmovdqa %xmm9,0(%rsp) - addl %edi,%ebp - andl %ebx,%esi - vpsrld $31,%xmm5,%xmm8 - xorl %ecx,%ebx - addl %eax,%ebp - shrdl $7,%eax,%eax - xorl %ecx,%esi - vpslldq $12,%xmm5,%xmm9 - vpaddd %xmm5,%xmm5,%xmm5 - movl %ebp,%edi - addl 24(%rsp),%edx - xorl %ebx,%eax - shldl $5,%ebp,%ebp - vpor %xmm8,%xmm5,%xmm5 - vpsrld $30,%xmm9,%xmm8 - addl %esi,%edx - vaesenc %xmm14,%xmm12,%xmm12 - vmovups -16(%r15),%xmm15 - andl %eax,%edi - xorl %ebx,%eax - addl %ebp,%edx - vpslld $2,%xmm9,%xmm9 - vpxor %xmm8,%xmm5,%xmm5 - shrdl $7,%ebp,%ebp - xorl %ebx,%edi - movl %edx,%esi - addl 28(%rsp),%ecx - vpxor %xmm9,%xmm5,%xmm5 - xorl %eax,%ebp - shldl $5,%edx,%edx - vmovdqa 16(%r11),%xmm10 - addl %edi,%ecx - andl %ebp,%esi - xorl %eax,%ebp - addl %edx,%ecx - shrdl $7,%edx,%edx - xorl %eax,%esi - vpalignr $8,%xmm2,%xmm3,%xmm6 - movl %ecx,%edi - addl 32(%rsp),%ebx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 0(%r15),%xmm14 - vpaddd %xmm5,%xmm10,%xmm9 - xorl %ebp,%edx - shldl $5,%ecx,%ecx - vpsrldq $4,%xmm5,%xmm8 - addl %esi,%ebx - andl %edx,%edi - vpxor %xmm2,%xmm6,%xmm6 - xorl %ebp,%edx - addl %ecx,%ebx - vpxor %xmm4,%xmm8,%xmm8 - shrdl $7,%ecx,%ecx - xorl %ebp,%edi - movl %ebx,%esi - addl 36(%rsp),%eax - vpxor %xmm8,%xmm6,%xmm6 - xorl %edx,%ecx - shldl $5,%ebx,%ebx - vmovdqa %xmm9,16(%rsp) - addl %edi,%eax - andl %ecx,%esi - vpsrld $31,%xmm6,%xmm8 - xorl %edx,%ecx - addl %ebx,%eax - shrdl $7,%ebx,%ebx - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 16(%r15),%xmm15 - xorl %edx,%esi - vpslldq $12,%xmm6,%xmm9 - vpaddd %xmm6,%xmm6,%xmm6 - movl %eax,%edi - addl 40(%rsp),%ebp - xorl %ecx,%ebx - shldl $5,%eax,%eax - vpor %xmm8,%xmm6,%xmm6 - vpsrld $30,%xmm9,%xmm8 - addl %esi,%ebp - andl %ebx,%edi - xorl %ecx,%ebx - addl %eax,%ebp - vpslld $2,%xmm9,%xmm9 - vpxor %xmm8,%xmm6,%xmm6 - shrdl $7,%eax,%eax - xorl %ecx,%edi - movl %ebp,%esi - addl 44(%rsp),%edx - vpxor %xmm9,%xmm6,%xmm6 - xorl %ebx,%eax - shldl $5,%ebp,%ebp - addl %edi,%edx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 32(%r15),%xmm14 - andl %eax,%esi - xorl %ebx,%eax - addl %ebp,%edx - shrdl $7,%ebp,%ebp - xorl %ebx,%esi - vpalignr $8,%xmm3,%xmm4,%xmm7 - movl %edx,%edi - addl 48(%rsp),%ecx - vpaddd %xmm6,%xmm10,%xmm9 - xorl %eax,%ebp - shldl $5,%edx,%edx - vpsrldq $4,%xmm6,%xmm8 - addl %esi,%ecx - andl %ebp,%edi - vpxor %xmm3,%xmm7,%xmm7 - xorl %eax,%ebp - addl %edx,%ecx - vpxor %xmm5,%xmm8,%xmm8 - shrdl $7,%edx,%edx - xorl %eax,%edi - movl %ecx,%esi - addl 52(%rsp),%ebx - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 48(%r15),%xmm15 - vpxor %xmm8,%xmm7,%xmm7 - xorl %ebp,%edx - shldl $5,%ecx,%ecx - vmovdqa %xmm9,32(%rsp) - addl %edi,%ebx - andl %edx,%esi - vpsrld $31,%xmm7,%xmm8 - xorl %ebp,%edx - addl %ecx,%ebx - shrdl $7,%ecx,%ecx - xorl %ebp,%esi - vpslldq $12,%xmm7,%xmm9 - vpaddd %xmm7,%xmm7,%xmm7 - movl %ebx,%edi - addl 56(%rsp),%eax - xorl %edx,%ecx - shldl $5,%ebx,%ebx - vpor %xmm8,%xmm7,%xmm7 - vpsrld $30,%xmm9,%xmm8 - addl %esi,%eax - andl %ecx,%edi - xorl %edx,%ecx - addl %ebx,%eax - vpslld $2,%xmm9,%xmm9 - vpxor %xmm8,%xmm7,%xmm7 - shrdl $7,%ebx,%ebx - cmpl $11,%r8d - jb L$vaesenclast6 - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 64(%r15),%xmm14 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 80(%r15),%xmm15 - je L$vaesenclast6 - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 96(%r15),%xmm14 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 112(%r15),%xmm15 -L$vaesenclast6: - vaesenclast %xmm15,%xmm12,%xmm12 - vmovups -112(%r15),%xmm15 - vmovups 16-112(%r15),%xmm14 - xorl %edx,%edi - movl %eax,%esi - addl 60(%rsp),%ebp - vpxor %xmm9,%xmm7,%xmm7 - xorl %ecx,%ebx - shldl $5,%eax,%eax - addl %edi,%ebp - andl %ebx,%esi - xorl %ecx,%ebx - addl %eax,%ebp - vpalignr $8,%xmm6,%xmm7,%xmm8 - vpxor %xmm4,%xmm0,%xmm0 - shrdl $7,%eax,%eax - xorl %ecx,%esi - movl %ebp,%edi - addl 0(%rsp),%edx - vpxor %xmm1,%xmm0,%xmm0 - xorl %ebx,%eax - shldl $5,%ebp,%ebp - vpaddd %xmm7,%xmm10,%xmm9 - addl %esi,%edx - vmovdqu 16(%r12),%xmm13 - vpxor %xmm15,%xmm13,%xmm13 - vmovups %xmm12,0(%r12,%r13,1) - vpxor %xmm13,%xmm12,%xmm12 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups -80(%r15),%xmm15 - andl %eax,%edi - vpxor %xmm8,%xmm0,%xmm0 - xorl %ebx,%eax - addl %ebp,%edx - shrdl $7,%ebp,%ebp - xorl %ebx,%edi - vpsrld $30,%xmm0,%xmm8 - vmovdqa %xmm9,48(%rsp) - movl %edx,%esi - addl 4(%rsp),%ecx - xorl %eax,%ebp - shldl $5,%edx,%edx - vpslld $2,%xmm0,%xmm0 - addl %edi,%ecx - andl %ebp,%esi - xorl %eax,%ebp - addl %edx,%ecx - shrdl $7,%edx,%edx - xorl %eax,%esi - movl %ecx,%edi - addl 8(%rsp),%ebx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups -64(%r15),%xmm14 - vpor %xmm8,%xmm0,%xmm0 - xorl %ebp,%edx - shldl $5,%ecx,%ecx - addl %esi,%ebx - andl %edx,%edi - xorl %ebp,%edx - addl %ecx,%ebx - addl 12(%rsp),%eax - xorl %ebp,%edi - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %edi,%eax - xorl %edx,%esi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vpalignr $8,%xmm7,%xmm0,%xmm8 - vpxor %xmm5,%xmm1,%xmm1 - addl 16(%rsp),%ebp - vaesenc %xmm14,%xmm12,%xmm12 - vmovups -48(%r15),%xmm15 - xorl %ecx,%esi - movl %eax,%edi - shldl $5,%eax,%eax - vpxor %xmm2,%xmm1,%xmm1 - addl %esi,%ebp - xorl %ecx,%edi - vpaddd %xmm0,%xmm10,%xmm9 - shrdl $7,%ebx,%ebx - addl %eax,%ebp - vpxor %xmm8,%xmm1,%xmm1 - addl 20(%rsp),%edx - xorl %ebx,%edi - movl %ebp,%esi - shldl $5,%ebp,%ebp - vpsrld $30,%xmm1,%xmm8 - vmovdqa %xmm9,0(%rsp) - addl %edi,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %ebp,%edx - vpslld $2,%xmm1,%xmm1 - addl 24(%rsp),%ecx - xorl %eax,%esi - movl %edx,%edi - shldl $5,%edx,%edx - addl %esi,%ecx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups -32(%r15),%xmm14 - xorl %eax,%edi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - vpor %xmm8,%xmm1,%xmm1 - addl 28(%rsp),%ebx - xorl %ebp,%edi - movl %ecx,%esi - shldl $5,%ecx,%ecx - addl %edi,%ebx - xorl %ebp,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - vpalignr $8,%xmm0,%xmm1,%xmm8 - vpxor %xmm6,%xmm2,%xmm2 - addl 32(%rsp),%eax - xorl %edx,%esi - movl %ebx,%edi - shldl $5,%ebx,%ebx - vpxor %xmm3,%xmm2,%xmm2 - addl %esi,%eax - xorl %edx,%edi - vpaddd %xmm1,%xmm10,%xmm9 - vmovdqa 32(%r11),%xmm10 - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vpxor %xmm8,%xmm2,%xmm2 - addl 36(%rsp),%ebp - vaesenc %xmm14,%xmm12,%xmm12 - vmovups -16(%r15),%xmm15 - xorl %ecx,%edi - movl %eax,%esi - shldl $5,%eax,%eax - vpsrld $30,%xmm2,%xmm8 - vmovdqa %xmm9,16(%rsp) - addl %edi,%ebp - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - vpslld $2,%xmm2,%xmm2 - addl 40(%rsp),%edx - xorl %ebx,%esi - movl %ebp,%edi - shldl $5,%ebp,%ebp - addl %esi,%edx - xorl %ebx,%edi - shrdl $7,%eax,%eax - addl %ebp,%edx - vpor %xmm8,%xmm2,%xmm2 - addl 44(%rsp),%ecx - xorl %eax,%edi - movl %edx,%esi - shldl $5,%edx,%edx - addl %edi,%ecx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 0(%r15),%xmm14 - xorl %eax,%esi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - vpalignr $8,%xmm1,%xmm2,%xmm8 - vpxor %xmm7,%xmm3,%xmm3 - addl 48(%rsp),%ebx - xorl %ebp,%esi - movl %ecx,%edi - shldl $5,%ecx,%ecx - vpxor %xmm4,%xmm3,%xmm3 - addl %esi,%ebx - xorl %ebp,%edi - vpaddd %xmm2,%xmm10,%xmm9 - shrdl $7,%edx,%edx - addl %ecx,%ebx - vpxor %xmm8,%xmm3,%xmm3 - addl 52(%rsp),%eax - xorl %edx,%edi - movl %ebx,%esi - shldl $5,%ebx,%ebx - vpsrld $30,%xmm3,%xmm8 - vmovdqa %xmm9,32(%rsp) - addl %edi,%eax - xorl %edx,%esi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vpslld $2,%xmm3,%xmm3 - addl 56(%rsp),%ebp - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 16(%r15),%xmm15 - xorl %ecx,%esi - movl %eax,%edi - shldl $5,%eax,%eax - addl %esi,%ebp - xorl %ecx,%edi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - vpor %xmm8,%xmm3,%xmm3 - addl 60(%rsp),%edx - xorl %ebx,%edi - movl %ebp,%esi - shldl $5,%ebp,%ebp - addl %edi,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %ebp,%edx - vpalignr $8,%xmm2,%xmm3,%xmm8 - vpxor %xmm0,%xmm4,%xmm4 - addl 0(%rsp),%ecx - xorl %eax,%esi - movl %edx,%edi - shldl $5,%edx,%edx - vpxor %xmm5,%xmm4,%xmm4 - addl %esi,%ecx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 32(%r15),%xmm14 - xorl %eax,%edi - vpaddd %xmm3,%xmm10,%xmm9 - shrdl $7,%ebp,%ebp - addl %edx,%ecx - vpxor %xmm8,%xmm4,%xmm4 - addl 4(%rsp),%ebx - xorl %ebp,%edi - movl %ecx,%esi - shldl $5,%ecx,%ecx - vpsrld $30,%xmm4,%xmm8 - vmovdqa %xmm9,48(%rsp) - addl %edi,%ebx - xorl %ebp,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - vpslld $2,%xmm4,%xmm4 - addl 8(%rsp),%eax - xorl %edx,%esi - movl %ebx,%edi - shldl $5,%ebx,%ebx - addl %esi,%eax - xorl %edx,%edi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vpor %xmm8,%xmm4,%xmm4 - addl 12(%rsp),%ebp - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 48(%r15),%xmm15 - xorl %ecx,%edi - movl %eax,%esi - shldl $5,%eax,%eax - addl %edi,%ebp - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - vpalignr $8,%xmm3,%xmm4,%xmm8 - vpxor %xmm1,%xmm5,%xmm5 - addl 16(%rsp),%edx - xorl %ebx,%esi - movl %ebp,%edi - shldl $5,%ebp,%ebp - vpxor %xmm6,%xmm5,%xmm5 - addl %esi,%edx - xorl %ebx,%edi - vpaddd %xmm4,%xmm10,%xmm9 - shrdl $7,%eax,%eax - addl %ebp,%edx - vpxor %xmm8,%xmm5,%xmm5 - addl 20(%rsp),%ecx - xorl %eax,%edi - movl %edx,%esi - shldl $5,%edx,%edx - vpsrld $30,%xmm5,%xmm8 - vmovdqa %xmm9,0(%rsp) - addl %edi,%ecx - cmpl $11,%r8d - jb L$vaesenclast7 - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 64(%r15),%xmm14 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 80(%r15),%xmm15 - je L$vaesenclast7 - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 96(%r15),%xmm14 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 112(%r15),%xmm15 -L$vaesenclast7: - vaesenclast %xmm15,%xmm12,%xmm12 - vmovups -112(%r15),%xmm15 - vmovups 16-112(%r15),%xmm14 - xorl %eax,%esi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - vpslld $2,%xmm5,%xmm5 - addl 24(%rsp),%ebx - xorl %ebp,%esi - movl %ecx,%edi - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %ebp,%edi - shrdl $7,%edx,%edx - addl %ecx,%ebx - vpor %xmm8,%xmm5,%xmm5 - addl 28(%rsp),%eax - shrdl $7,%ecx,%ecx - movl %ebx,%esi - xorl %edx,%edi - shldl $5,%ebx,%ebx - addl %edi,%eax - xorl %ecx,%esi - xorl %edx,%ecx - addl %ebx,%eax - vpalignr $8,%xmm4,%xmm5,%xmm8 - vpxor %xmm2,%xmm6,%xmm6 - addl 32(%rsp),%ebp - vmovdqu 32(%r12),%xmm13 - vpxor %xmm15,%xmm13,%xmm13 - vmovups %xmm12,16(%r13,%r12,1) - vpxor %xmm13,%xmm12,%xmm12 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups -80(%r15),%xmm15 - andl %ecx,%esi - xorl %edx,%ecx - shrdl $7,%ebx,%ebx - vpxor %xmm7,%xmm6,%xmm6 - movl %eax,%edi - xorl %ecx,%esi - vpaddd %xmm5,%xmm10,%xmm9 - shldl $5,%eax,%eax - addl %esi,%ebp - vpxor %xmm8,%xmm6,%xmm6 - xorl %ebx,%edi - xorl %ecx,%ebx - addl %eax,%ebp - addl 36(%rsp),%edx - vpsrld $30,%xmm6,%xmm8 - vmovdqa %xmm9,16(%rsp) - andl %ebx,%edi - xorl %ecx,%ebx - shrdl $7,%eax,%eax - movl %ebp,%esi - vpslld $2,%xmm6,%xmm6 - xorl %ebx,%edi - shldl $5,%ebp,%ebp - addl %edi,%edx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups -64(%r15),%xmm14 - xorl %eax,%esi - xorl %ebx,%eax - addl %ebp,%edx - addl 40(%rsp),%ecx - andl %eax,%esi - vpor %xmm8,%xmm6,%xmm6 - xorl %ebx,%eax - shrdl $7,%ebp,%ebp - movl %edx,%edi - xorl %eax,%esi - shldl $5,%edx,%edx - addl %esi,%ecx - xorl %ebp,%edi - xorl %eax,%ebp - addl %edx,%ecx - addl 44(%rsp),%ebx - andl %ebp,%edi - xorl %eax,%ebp - shrdl $7,%edx,%edx - vaesenc %xmm14,%xmm12,%xmm12 - vmovups -48(%r15),%xmm15 - movl %ecx,%esi - xorl %ebp,%edi - shldl $5,%ecx,%ecx - addl %edi,%ebx - xorl %edx,%esi - xorl %ebp,%edx - addl %ecx,%ebx - vpalignr $8,%xmm5,%xmm6,%xmm8 - vpxor %xmm3,%xmm7,%xmm7 - addl 48(%rsp),%eax - andl %edx,%esi - xorl %ebp,%edx - shrdl $7,%ecx,%ecx - vpxor %xmm0,%xmm7,%xmm7 - movl %ebx,%edi - xorl %edx,%esi - vpaddd %xmm6,%xmm10,%xmm9 - vmovdqa 48(%r11),%xmm10 - shldl $5,%ebx,%ebx - addl %esi,%eax - vpxor %xmm8,%xmm7,%xmm7 - xorl %ecx,%edi - xorl %edx,%ecx - addl %ebx,%eax - addl 52(%rsp),%ebp - vaesenc %xmm15,%xmm12,%xmm12 - vmovups -32(%r15),%xmm14 - vpsrld $30,%xmm7,%xmm8 - vmovdqa %xmm9,32(%rsp) - andl %ecx,%edi - xorl %edx,%ecx - shrdl $7,%ebx,%ebx - movl %eax,%esi - vpslld $2,%xmm7,%xmm7 - xorl %ecx,%edi - shldl $5,%eax,%eax - addl %edi,%ebp - xorl %ebx,%esi - xorl %ecx,%ebx - addl %eax,%ebp - addl 56(%rsp),%edx - andl %ebx,%esi - vpor %xmm8,%xmm7,%xmm7 - xorl %ecx,%ebx - shrdl $7,%eax,%eax - movl %ebp,%edi - xorl %ebx,%esi - shldl $5,%ebp,%ebp - addl %esi,%edx - vaesenc %xmm14,%xmm12,%xmm12 - vmovups -16(%r15),%xmm15 - xorl %eax,%edi - xorl %ebx,%eax - addl %ebp,%edx - addl 60(%rsp),%ecx - andl %eax,%edi - xorl %ebx,%eax - shrdl $7,%ebp,%ebp - movl %edx,%esi - xorl %eax,%edi - shldl $5,%edx,%edx - addl %edi,%ecx - xorl %ebp,%esi - xorl %eax,%ebp - addl %edx,%ecx - vpalignr $8,%xmm6,%xmm7,%xmm8 - vpxor %xmm4,%xmm0,%xmm0 - addl 0(%rsp),%ebx - andl %ebp,%esi - xorl %eax,%ebp - shrdl $7,%edx,%edx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 0(%r15),%xmm14 - vpxor %xmm1,%xmm0,%xmm0 - movl %ecx,%edi - xorl %ebp,%esi - vpaddd %xmm7,%xmm10,%xmm9 - shldl $5,%ecx,%ecx - addl %esi,%ebx - vpxor %xmm8,%xmm0,%xmm0 - xorl %edx,%edi - xorl %ebp,%edx - addl %ecx,%ebx - addl 4(%rsp),%eax - vpsrld $30,%xmm0,%xmm8 - vmovdqa %xmm9,48(%rsp) - andl %edx,%edi - xorl %ebp,%edx - shrdl $7,%ecx,%ecx - movl %ebx,%esi - vpslld $2,%xmm0,%xmm0 - xorl %edx,%edi - shldl $5,%ebx,%ebx - addl %edi,%eax - xorl %ecx,%esi - xorl %edx,%ecx - addl %ebx,%eax - addl 8(%rsp),%ebp - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 16(%r15),%xmm15 - andl %ecx,%esi - vpor %xmm8,%xmm0,%xmm0 - xorl %edx,%ecx - shrdl $7,%ebx,%ebx - movl %eax,%edi - xorl %ecx,%esi - shldl $5,%eax,%eax - addl %esi,%ebp - xorl %ebx,%edi - xorl %ecx,%ebx - addl %eax,%ebp - addl 12(%rsp),%edx - andl %ebx,%edi - xorl %ecx,%ebx - shrdl $7,%eax,%eax - movl %ebp,%esi - xorl %ebx,%edi - shldl $5,%ebp,%ebp - addl %edi,%edx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 32(%r15),%xmm14 - xorl %eax,%esi - xorl %ebx,%eax - addl %ebp,%edx - vpalignr $8,%xmm7,%xmm0,%xmm8 - vpxor %xmm5,%xmm1,%xmm1 - addl 16(%rsp),%ecx - andl %eax,%esi - xorl %ebx,%eax - shrdl $7,%ebp,%ebp - vpxor %xmm2,%xmm1,%xmm1 - movl %edx,%edi - xorl %eax,%esi - vpaddd %xmm0,%xmm10,%xmm9 - shldl $5,%edx,%edx - addl %esi,%ecx - vpxor %xmm8,%xmm1,%xmm1 - xorl %ebp,%edi - xorl %eax,%ebp - addl %edx,%ecx - addl 20(%rsp),%ebx - vpsrld $30,%xmm1,%xmm8 - vmovdqa %xmm9,0(%rsp) - andl %ebp,%edi - xorl %eax,%ebp - shrdl $7,%edx,%edx - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 48(%r15),%xmm15 - movl %ecx,%esi - vpslld $2,%xmm1,%xmm1 - xorl %ebp,%edi - shldl $5,%ecx,%ecx - addl %edi,%ebx - xorl %edx,%esi - xorl %ebp,%edx - addl %ecx,%ebx - addl 24(%rsp),%eax - andl %edx,%esi - vpor %xmm8,%xmm1,%xmm1 - xorl %ebp,%edx - shrdl $7,%ecx,%ecx - movl %ebx,%edi - xorl %edx,%esi - shldl $5,%ebx,%ebx - addl %esi,%eax - xorl %ecx,%edi - xorl %edx,%ecx - addl %ebx,%eax - addl 28(%rsp),%ebp - cmpl $11,%r8d - jb L$vaesenclast8 - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 64(%r15),%xmm14 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 80(%r15),%xmm15 - je L$vaesenclast8 - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 96(%r15),%xmm14 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 112(%r15),%xmm15 -L$vaesenclast8: - vaesenclast %xmm15,%xmm12,%xmm12 - vmovups -112(%r15),%xmm15 - vmovups 16-112(%r15),%xmm14 - andl %ecx,%edi - xorl %edx,%ecx - shrdl $7,%ebx,%ebx - movl %eax,%esi - xorl %ecx,%edi - shldl $5,%eax,%eax - addl %edi,%ebp - xorl %ebx,%esi - xorl %ecx,%ebx - addl %eax,%ebp - vpalignr $8,%xmm0,%xmm1,%xmm8 - vpxor %xmm6,%xmm2,%xmm2 - addl 32(%rsp),%edx - andl %ebx,%esi - xorl %ecx,%ebx - shrdl $7,%eax,%eax - vpxor %xmm3,%xmm2,%xmm2 - movl %ebp,%edi - xorl %ebx,%esi - vpaddd %xmm1,%xmm10,%xmm9 - shldl $5,%ebp,%ebp - addl %esi,%edx - vmovdqu 48(%r12),%xmm13 - vpxor %xmm15,%xmm13,%xmm13 - vmovups %xmm12,32(%r13,%r12,1) - vpxor %xmm13,%xmm12,%xmm12 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups -80(%r15),%xmm15 - vpxor %xmm8,%xmm2,%xmm2 - xorl %eax,%edi - xorl %ebx,%eax - addl %ebp,%edx - addl 36(%rsp),%ecx - vpsrld $30,%xmm2,%xmm8 - vmovdqa %xmm9,16(%rsp) - andl %eax,%edi - xorl %ebx,%eax - shrdl $7,%ebp,%ebp - movl %edx,%esi - vpslld $2,%xmm2,%xmm2 - xorl %eax,%edi - shldl $5,%edx,%edx - addl %edi,%ecx - xorl %ebp,%esi - xorl %eax,%ebp - addl %edx,%ecx - addl 40(%rsp),%ebx - andl %ebp,%esi - vpor %xmm8,%xmm2,%xmm2 - xorl %eax,%ebp - shrdl $7,%edx,%edx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups -64(%r15),%xmm14 - movl %ecx,%edi - xorl %ebp,%esi - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %edx,%edi - xorl %ebp,%edx - addl %ecx,%ebx - addl 44(%rsp),%eax - andl %edx,%edi - xorl %ebp,%edx - shrdl $7,%ecx,%ecx - movl %ebx,%esi - xorl %edx,%edi - shldl $5,%ebx,%ebx - addl %edi,%eax - xorl %edx,%esi - addl %ebx,%eax - vpalignr $8,%xmm1,%xmm2,%xmm8 - vpxor %xmm7,%xmm3,%xmm3 - addl 48(%rsp),%ebp - vaesenc %xmm14,%xmm12,%xmm12 - vmovups -48(%r15),%xmm15 - xorl %ecx,%esi - movl %eax,%edi - shldl $5,%eax,%eax - vpxor %xmm4,%xmm3,%xmm3 - addl %esi,%ebp - xorl %ecx,%edi - vpaddd %xmm2,%xmm10,%xmm9 - shrdl $7,%ebx,%ebx - addl %eax,%ebp - vpxor %xmm8,%xmm3,%xmm3 - addl 52(%rsp),%edx - xorl %ebx,%edi - movl %ebp,%esi - shldl $5,%ebp,%ebp - vpsrld $30,%xmm3,%xmm8 - vmovdqa %xmm9,32(%rsp) - addl %edi,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %ebp,%edx - vpslld $2,%xmm3,%xmm3 - addl 56(%rsp),%ecx - xorl %eax,%esi - movl %edx,%edi - shldl $5,%edx,%edx - addl %esi,%ecx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups -32(%r15),%xmm14 - xorl %eax,%edi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - vpor %xmm8,%xmm3,%xmm3 - addl 60(%rsp),%ebx - xorl %ebp,%edi - movl %ecx,%esi - shldl $5,%ecx,%ecx - addl %edi,%ebx - xorl %ebp,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 0(%rsp),%eax - vpaddd %xmm3,%xmm10,%xmm9 - xorl %edx,%esi - movl %ebx,%edi - shldl $5,%ebx,%ebx - addl %esi,%eax - vmovdqa %xmm9,48(%rsp) - xorl %edx,%edi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 4(%rsp),%ebp - vaesenc %xmm14,%xmm12,%xmm12 - vmovups -16(%r15),%xmm15 - xorl %ecx,%edi - movl %eax,%esi - shldl $5,%eax,%eax - addl %edi,%ebp - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - addl 8(%rsp),%edx - xorl %ebx,%esi - movl %ebp,%edi - shldl $5,%ebp,%ebp - addl %esi,%edx - xorl %ebx,%edi - shrdl $7,%eax,%eax - addl %ebp,%edx - addl 12(%rsp),%ecx - xorl %eax,%edi - movl %edx,%esi - shldl $5,%edx,%edx - addl %edi,%ecx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 0(%r15),%xmm14 - xorl %eax,%esi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - cmpq %r14,%r10 - je L$done_avx - vmovdqa 64(%r11),%xmm9 - vmovdqa 0(%r11),%xmm10 - vmovdqu 0(%r10),%xmm0 - vmovdqu 16(%r10),%xmm1 - vmovdqu 32(%r10),%xmm2 - vmovdqu 48(%r10),%xmm3 - vpshufb %xmm9,%xmm0,%xmm0 - addq $64,%r10 - addl 16(%rsp),%ebx - xorl %ebp,%esi - vpshufb %xmm9,%xmm1,%xmm1 - movl %ecx,%edi - shldl $5,%ecx,%ecx - vpaddd %xmm10,%xmm0,%xmm8 - addl %esi,%ebx - xorl %ebp,%edi - shrdl $7,%edx,%edx - addl %ecx,%ebx - vmovdqa %xmm8,0(%rsp) - addl 20(%rsp),%eax - xorl %edx,%edi - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %edi,%eax - xorl %edx,%esi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 24(%rsp),%ebp - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 16(%r15),%xmm15 - xorl %ecx,%esi - movl %eax,%edi - shldl $5,%eax,%eax - addl %esi,%ebp - xorl %ecx,%edi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - addl 28(%rsp),%edx - xorl %ebx,%edi - movl %ebp,%esi - shldl $5,%ebp,%ebp - addl %edi,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %ebp,%edx - addl 32(%rsp),%ecx - xorl %eax,%esi - vpshufb %xmm9,%xmm2,%xmm2 - movl %edx,%edi - shldl $5,%edx,%edx - vpaddd %xmm10,%xmm1,%xmm8 - addl %esi,%ecx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 32(%r15),%xmm14 - xorl %eax,%edi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - vmovdqa %xmm8,16(%rsp) - addl 36(%rsp),%ebx - xorl %ebp,%edi - movl %ecx,%esi - shldl $5,%ecx,%ecx - addl %edi,%ebx - xorl %ebp,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 40(%rsp),%eax - xorl %edx,%esi - movl %ebx,%edi - shldl $5,%ebx,%ebx - addl %esi,%eax - xorl %edx,%edi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 44(%rsp),%ebp - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 48(%r15),%xmm15 - xorl %ecx,%edi - movl %eax,%esi - shldl $5,%eax,%eax - addl %edi,%ebp - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - addl 48(%rsp),%edx - xorl %ebx,%esi - vpshufb %xmm9,%xmm3,%xmm3 - movl %ebp,%edi - shldl $5,%ebp,%ebp - vpaddd %xmm10,%xmm2,%xmm8 - addl %esi,%edx - xorl %ebx,%edi - shrdl $7,%eax,%eax - addl %ebp,%edx - vmovdqa %xmm8,32(%rsp) - addl 52(%rsp),%ecx - xorl %eax,%edi - movl %edx,%esi - shldl $5,%edx,%edx - addl %edi,%ecx - cmpl $11,%r8d - jb L$vaesenclast9 - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 64(%r15),%xmm14 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 80(%r15),%xmm15 - je L$vaesenclast9 - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 96(%r15),%xmm14 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 112(%r15),%xmm15 -L$vaesenclast9: - vaesenclast %xmm15,%xmm12,%xmm12 - vmovups -112(%r15),%xmm15 - vmovups 16-112(%r15),%xmm14 - xorl %eax,%esi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - addl 56(%rsp),%ebx - xorl %ebp,%esi - movl %ecx,%edi - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %ebp,%edi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 60(%rsp),%eax - xorl %edx,%edi - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %edi,%eax - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vmovups %xmm12,48(%r13,%r12,1) - leaq 64(%r12),%r12 - - addl 0(%r9),%eax - addl 4(%r9),%esi - addl 8(%r9),%ecx - addl 12(%r9),%edx - movl %eax,0(%r9) - addl 16(%r9),%ebp - movl %esi,4(%r9) - movl %esi,%ebx - movl %ecx,8(%r9) - movl %ecx,%edi - movl %edx,12(%r9) - xorl %edx,%edi - movl %ebp,16(%r9) - andl %edi,%esi - jmp L$oop_avx - -L$done_avx: - addl 16(%rsp),%ebx - xorl %ebp,%esi - movl %ecx,%edi - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %ebp,%edi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 20(%rsp),%eax - xorl %edx,%edi - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %edi,%eax - xorl %edx,%esi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 24(%rsp),%ebp - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 16(%r15),%xmm15 - xorl %ecx,%esi - movl %eax,%edi - shldl $5,%eax,%eax - addl %esi,%ebp - xorl %ecx,%edi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - addl 28(%rsp),%edx - xorl %ebx,%edi - movl %ebp,%esi - shldl $5,%ebp,%ebp - addl %edi,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %ebp,%edx - addl 32(%rsp),%ecx - xorl %eax,%esi - movl %edx,%edi - shldl $5,%edx,%edx - addl %esi,%ecx - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 32(%r15),%xmm14 - xorl %eax,%edi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - addl 36(%rsp),%ebx - xorl %ebp,%edi - movl %ecx,%esi - shldl $5,%ecx,%ecx - addl %edi,%ebx - xorl %ebp,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 40(%rsp),%eax - xorl %edx,%esi - movl %ebx,%edi - shldl $5,%ebx,%ebx - addl %esi,%eax - xorl %edx,%edi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 44(%rsp),%ebp - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 48(%r15),%xmm15 - xorl %ecx,%edi - movl %eax,%esi - shldl $5,%eax,%eax - addl %edi,%ebp - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - addl 48(%rsp),%edx - xorl %ebx,%esi - movl %ebp,%edi - shldl $5,%ebp,%ebp - addl %esi,%edx - xorl %ebx,%edi - shrdl $7,%eax,%eax - addl %ebp,%edx - addl 52(%rsp),%ecx - xorl %eax,%edi - movl %edx,%esi - shldl $5,%edx,%edx - addl %edi,%ecx - cmpl $11,%r8d - jb L$vaesenclast10 - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 64(%r15),%xmm14 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 80(%r15),%xmm15 - je L$vaesenclast10 - vaesenc %xmm15,%xmm12,%xmm12 - vmovups 96(%r15),%xmm14 - vaesenc %xmm14,%xmm12,%xmm12 - vmovups 112(%r15),%xmm15 -L$vaesenclast10: - vaesenclast %xmm15,%xmm12,%xmm12 - vmovups -112(%r15),%xmm15 - vmovups 16-112(%r15),%xmm14 - xorl %eax,%esi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - addl 56(%rsp),%ebx - xorl %ebp,%esi - movl %ecx,%edi - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %ebp,%edi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 60(%rsp),%eax - xorl %edx,%edi - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %edi,%eax - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vmovups %xmm12,48(%r13,%r12,1) - movq 88(%rsp),%r8 - - addl 0(%r9),%eax - addl 4(%r9),%esi - addl 8(%r9),%ecx - movl %eax,0(%r9) - addl 12(%r9),%edx - movl %esi,4(%r9) - addl 16(%r9),%ebp - movl %ecx,8(%r9) - movl %edx,12(%r9) - movl %ebp,16(%r9) - vmovups %xmm12,(%r8) - vzeroall - leaq 104(%rsp),%rsi - movq 0(%rsi),%r15 - movq 8(%rsi),%r14 - movq 16(%rsi),%r13 - movq 24(%rsi),%r12 - movq 32(%rsi),%rbp - movq 40(%rsi),%rbx - leaq 48(%rsi),%rsp -L$epilogue_avx: - .byte 0xf3,0xc3 - .p2align 6 K_XX_XX: .long 0x5a827999,0x5a827999,0x5a827999,0x5a827999 @@ -2695,8 +1392,8 @@ aesni_cbc_sha1_enc_shaext: movups 16(%rcx),%xmm0 leaq 112(%rcx),%rcx - pshufd $27,%xmm8,%xmm8 - pshufd $27,%xmm9,%xmm9 + pshufd $0b00011011,%xmm8,%xmm8 + pshufd $0b00011011,%xmm9,%xmm9 jmp L$oop_shaext .p2align 4 @@ -2759,17 +1456,17 @@ L$oop_shaext: pxor %xmm3,%xmm5 .byte 15,56,201,243 cmpl $11,%r11d - jb L$aesenclast11 + jb L$aesenclast6 movups 64(%rcx),%xmm0 .byte 102,15,56,220,209 movups 80(%rcx),%xmm1 .byte 102,15,56,220,208 - je L$aesenclast11 + je L$aesenclast6 movups 96(%rcx),%xmm0 .byte 102,15,56,220,209 movups 112(%rcx),%xmm1 .byte 102,15,56,220,208 -L$aesenclast11: +L$aesenclast6: .byte 102,15,56,221,209 movups 16-112(%rcx),%xmm0 movdqa %xmm8,%xmm10 @@ -2825,17 +1522,17 @@ L$aesenclast11: pxor %xmm4,%xmm6 .byte 15,56,201,220 cmpl $11,%r11d - jb L$aesenclast12 + jb L$aesenclast7 movups 64(%rcx),%xmm0 .byte 102,15,56,220,209 movups 80(%rcx),%xmm1 .byte 102,15,56,220,208 - je L$aesenclast12 + je L$aesenclast7 movups 96(%rcx),%xmm0 .byte 102,15,56,220,209 movups 112(%rcx),%xmm1 .byte 102,15,56,220,208 -L$aesenclast12: +L$aesenclast7: .byte 102,15,56,221,209 movups 16-112(%rcx),%xmm0 movdqa %xmm8,%xmm9 @@ -2891,17 +1588,17 @@ L$aesenclast12: pxor %xmm5,%xmm3 .byte 15,56,201,229 cmpl $11,%r11d - jb L$aesenclast13 + jb L$aesenclast8 movups 64(%rcx),%xmm0 .byte 102,15,56,220,209 movups 80(%rcx),%xmm1 .byte 102,15,56,220,208 - je L$aesenclast13 + je L$aesenclast8 movups 96(%rcx),%xmm0 .byte 102,15,56,220,209 movups 112(%rcx),%xmm1 .byte 102,15,56,220,208 -L$aesenclast13: +L$aesenclast8: .byte 102,15,56,221,209 movups 16-112(%rcx),%xmm0 movdqa %xmm8,%xmm10 @@ -2955,17 +1652,17 @@ L$aesenclast13: movups 48(%rcx),%xmm1 .byte 102,15,56,220,208 cmpl $11,%r11d - jb L$aesenclast14 + jb L$aesenclast9 movups 64(%rcx),%xmm0 .byte 102,15,56,220,209 movups 80(%rcx),%xmm1 .byte 102,15,56,220,208 - je L$aesenclast14 + je L$aesenclast9 movups 96(%rcx),%xmm0 .byte 102,15,56,220,209 movups 112(%rcx),%xmm1 .byte 102,15,56,220,208 -L$aesenclast14: +L$aesenclast9: .byte 102,15,56,221,209 movups 16-112(%rcx),%xmm0 decq %rdx @@ -2975,8 +1672,8 @@ L$aesenclast14: leaq 64(%rdi),%rdi jnz L$oop_shaext - pshufd $27,%xmm8,%xmm8 - pshufd $27,%xmm9,%xmm9 + pshufd $0b00011011,%xmm8,%xmm8 + pshufd $0b00011011,%xmm9,%xmm9 movups %xmm2,(%r8) movdqu %xmm8,(%r9) movd %xmm9,16(%r9) diff --git a/deps/openssl/asm/x64-macosx-gas/aes/aesni-sha256-x86_64.s b/deps/openssl/asm/x64-macosx-gas/aes/aesni-sha256-x86_64.s index 6c6685fba4f79e..53307da35815e1 100644 --- a/deps/openssl/asm/x64-macosx-gas/aes/aesni-sha256-x86_64.s +++ b/deps/openssl/asm/x64-macosx-gas/aes/aesni-sha256-x86_64.s @@ -5,28 +5,6 @@ .p2align 4 _aesni_cbc_sha256_enc: - leaq _OPENSSL_ia32cap_P(%rip),%r11 - movl $1,%eax - cmpq $0,%rdi - je L$probe - movl 0(%r11),%eax - movq 4(%r11),%r10 - btq $61,%r10 - jc aesni_cbc_sha256_enc_shaext - movq %r10,%r11 - shrq $32,%r11 - - testl $2048,%r10d - jnz aesni_cbc_sha256_enc_xop - andl $296,%r11d - cmpl $296,%r11d - je aesni_cbc_sha256_enc_avx2 - andl $1073741824,%eax - andl $268435968,%r10d - orl %eax,%r10d - cmpl $1342177792,%r10d - je aesni_cbc_sha256_enc_avx - ud2 xorl %eax,%eax cmpq $0,%rdi je L$probe @@ -77,4280 +55,3 @@ K256: .long 0,0,0,0, 0,0,0,0 .byte 65,69,83,78,73,45,67,66,67,43,83,72,65,50,53,54,32,115,116,105,116,99,104,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 .p2align 6 - -.p2align 6 -aesni_cbc_sha256_enc_xop: -L$xop_shortcut: - movq 8(%rsp),%r10 - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - movq %rsp,%r11 - subq $128,%rsp - andq $-64,%rsp - - shlq $6,%rdx - subq %rdi,%rsi - subq %rdi,%r10 - addq %rdi,%rdx - - - movq %rsi,64+8(%rsp) - movq %rdx,64+16(%rsp) - - movq %r8,64+32(%rsp) - movq %r9,64+40(%rsp) - movq %r10,64+48(%rsp) - movq %r11,64+56(%rsp) -L$prologue_xop: - vzeroall - - movq %rdi,%r12 - leaq 128(%rcx),%rdi - leaq K256+544(%rip),%r13 - movl 240-128(%rdi),%r14d - movq %r9,%r15 - movq %r10,%rsi - vmovdqu (%r8),%xmm8 - subq $9,%r14 - - movl 0(%r15),%eax - movl 4(%r15),%ebx - movl 8(%r15),%ecx - movl 12(%r15),%edx - movl 16(%r15),%r8d - movl 20(%r15),%r9d - movl 24(%r15),%r10d - movl 28(%r15),%r11d - - vmovdqa 0(%r13,%r14,8),%xmm14 - vmovdqa 16(%r13,%r14,8),%xmm13 - vmovdqa 32(%r13,%r14,8),%xmm12 - vmovdqu 0-128(%rdi),%xmm10 - jmp L$loop_xop -.p2align 4 -L$loop_xop: - vmovdqa K256+512(%rip),%xmm7 - vmovdqu 0(%rsi,%r12,1),%xmm0 - vmovdqu 16(%rsi,%r12,1),%xmm1 - vmovdqu 32(%rsi,%r12,1),%xmm2 - vmovdqu 48(%rsi,%r12,1),%xmm3 - vpshufb %xmm7,%xmm0,%xmm0 - leaq K256(%rip),%rbp - vpshufb %xmm7,%xmm1,%xmm1 - vpshufb %xmm7,%xmm2,%xmm2 - vpaddd 0(%rbp),%xmm0,%xmm4 - vpshufb %xmm7,%xmm3,%xmm3 - vpaddd 32(%rbp),%xmm1,%xmm5 - vpaddd 64(%rbp),%xmm2,%xmm6 - vpaddd 96(%rbp),%xmm3,%xmm7 - vmovdqa %xmm4,0(%rsp) - movl %eax,%r14d - vmovdqa %xmm5,16(%rsp) - movl %ebx,%esi - vmovdqa %xmm6,32(%rsp) - xorl %ecx,%esi - vmovdqa %xmm7,48(%rsp) - movl %r8d,%r13d - jmp L$xop_00_47 - -.p2align 4 -L$xop_00_47: - subq $-32*4,%rbp - vmovdqu (%r12),%xmm9 - movq %r12,64+0(%rsp) - vpalignr $4,%xmm0,%xmm1,%xmm4 - rorl $14,%r13d - movl %r14d,%eax - vpalignr $4,%xmm2,%xmm3,%xmm7 - movl %r9d,%r12d - xorl %r8d,%r13d -.byte 143,232,120,194,236,14 - rorl $9,%r14d - xorl %r10d,%r12d - vpsrld $3,%xmm4,%xmm4 - rorl $5,%r13d - xorl %eax,%r14d - vpaddd %xmm7,%xmm0,%xmm0 - andl %r8d,%r12d - vpxor %xmm10,%xmm9,%xmm9 - vmovdqu 16-128(%rdi),%xmm10 - xorl %r8d,%r13d - addl 0(%rsp),%r11d - movl %eax,%r15d -.byte 143,232,120,194,245,11 - rorl $11,%r14d - xorl %r10d,%r12d - vpxor %xmm5,%xmm4,%xmm4 - xorl %ebx,%r15d - rorl $6,%r13d - addl %r12d,%r11d - andl %r15d,%esi -.byte 143,232,120,194,251,13 - xorl %eax,%r14d - addl %r13d,%r11d - vpxor %xmm6,%xmm4,%xmm4 - xorl %ebx,%esi - addl %r11d,%edx - vpsrld $10,%xmm3,%xmm6 - rorl $2,%r14d - addl %esi,%r11d - vpaddd %xmm4,%xmm0,%xmm0 - movl %edx,%r13d - addl %r11d,%r14d -.byte 143,232,120,194,239,2 - rorl $14,%r13d - movl %r14d,%r11d - vpxor %xmm6,%xmm7,%xmm7 - movl %r8d,%r12d - xorl %edx,%r13d - rorl $9,%r14d - xorl %r9d,%r12d - vpxor %xmm5,%xmm7,%xmm7 - rorl $5,%r13d - xorl %r11d,%r14d - andl %edx,%r12d - vpxor %xmm8,%xmm9,%xmm9 - xorl %edx,%r13d - vpsrldq $8,%xmm7,%xmm7 - addl 4(%rsp),%r10d - movl %r11d,%esi - rorl $11,%r14d - xorl %r9d,%r12d - vpaddd %xmm7,%xmm0,%xmm0 - xorl %eax,%esi - rorl $6,%r13d - addl %r12d,%r10d - andl %esi,%r15d -.byte 143,232,120,194,248,13 - xorl %r11d,%r14d - addl %r13d,%r10d - vpsrld $10,%xmm0,%xmm6 - xorl %eax,%r15d - addl %r10d,%ecx -.byte 143,232,120,194,239,2 - rorl $2,%r14d - addl %r15d,%r10d - vpxor %xmm6,%xmm7,%xmm7 - movl %ecx,%r13d - addl %r10d,%r14d - rorl $14,%r13d - movl %r14d,%r10d - vpxor %xmm5,%xmm7,%xmm7 - movl %edx,%r12d - xorl %ecx,%r13d - rorl $9,%r14d - xorl %r8d,%r12d - vpslldq $8,%xmm7,%xmm7 - rorl $5,%r13d - xorl %r10d,%r14d - andl %ecx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 32-128(%rdi),%xmm10 - xorl %ecx,%r13d - vpaddd %xmm7,%xmm0,%xmm0 - addl 8(%rsp),%r9d - movl %r10d,%r15d - rorl $11,%r14d - xorl %r8d,%r12d - vpaddd 0(%rbp),%xmm0,%xmm6 - xorl %r11d,%r15d - rorl $6,%r13d - addl %r12d,%r9d - andl %r15d,%esi - xorl %r10d,%r14d - addl %r13d,%r9d - xorl %r11d,%esi - addl %r9d,%ebx - rorl $2,%r14d - addl %esi,%r9d - movl %ebx,%r13d - addl %r9d,%r14d - rorl $14,%r13d - movl %r14d,%r9d - movl %ecx,%r12d - xorl %ebx,%r13d - rorl $9,%r14d - xorl %edx,%r12d - rorl $5,%r13d - xorl %r9d,%r14d - andl %ebx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 48-128(%rdi),%xmm10 - xorl %ebx,%r13d - addl 12(%rsp),%r8d - movl %r9d,%esi - rorl $11,%r14d - xorl %edx,%r12d - xorl %r10d,%esi - rorl $6,%r13d - addl %r12d,%r8d - andl %esi,%r15d - xorl %r9d,%r14d - addl %r13d,%r8d - xorl %r10d,%r15d - addl %r8d,%eax - rorl $2,%r14d - addl %r15d,%r8d - movl %eax,%r13d - addl %r8d,%r14d - vmovdqa %xmm6,0(%rsp) - vpalignr $4,%xmm1,%xmm2,%xmm4 - rorl $14,%r13d - movl %r14d,%r8d - vpalignr $4,%xmm3,%xmm0,%xmm7 - movl %ebx,%r12d - xorl %eax,%r13d -.byte 143,232,120,194,236,14 - rorl $9,%r14d - xorl %ecx,%r12d - vpsrld $3,%xmm4,%xmm4 - rorl $5,%r13d - xorl %r8d,%r14d - vpaddd %xmm7,%xmm1,%xmm1 - andl %eax,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 64-128(%rdi),%xmm10 - xorl %eax,%r13d - addl 16(%rsp),%edx - movl %r8d,%r15d -.byte 143,232,120,194,245,11 - rorl $11,%r14d - xorl %ecx,%r12d - vpxor %xmm5,%xmm4,%xmm4 - xorl %r9d,%r15d - rorl $6,%r13d - addl %r12d,%edx - andl %r15d,%esi -.byte 143,232,120,194,248,13 - xorl %r8d,%r14d - addl %r13d,%edx - vpxor %xmm6,%xmm4,%xmm4 - xorl %r9d,%esi - addl %edx,%r11d - vpsrld $10,%xmm0,%xmm6 - rorl $2,%r14d - addl %esi,%edx - vpaddd %xmm4,%xmm1,%xmm1 - movl %r11d,%r13d - addl %edx,%r14d -.byte 143,232,120,194,239,2 - rorl $14,%r13d - movl %r14d,%edx - vpxor %xmm6,%xmm7,%xmm7 - movl %eax,%r12d - xorl %r11d,%r13d - rorl $9,%r14d - xorl %ebx,%r12d - vpxor %xmm5,%xmm7,%xmm7 - rorl $5,%r13d - xorl %edx,%r14d - andl %r11d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 80-128(%rdi),%xmm10 - xorl %r11d,%r13d - vpsrldq $8,%xmm7,%xmm7 - addl 20(%rsp),%ecx - movl %edx,%esi - rorl $11,%r14d - xorl %ebx,%r12d - vpaddd %xmm7,%xmm1,%xmm1 - xorl %r8d,%esi - rorl $6,%r13d - addl %r12d,%ecx - andl %esi,%r15d -.byte 143,232,120,194,249,13 - xorl %edx,%r14d - addl %r13d,%ecx - vpsrld $10,%xmm1,%xmm6 - xorl %r8d,%r15d - addl %ecx,%r10d -.byte 143,232,120,194,239,2 - rorl $2,%r14d - addl %r15d,%ecx - vpxor %xmm6,%xmm7,%xmm7 - movl %r10d,%r13d - addl %ecx,%r14d - rorl $14,%r13d - movl %r14d,%ecx - vpxor %xmm5,%xmm7,%xmm7 - movl %r11d,%r12d - xorl %r10d,%r13d - rorl $9,%r14d - xorl %eax,%r12d - vpslldq $8,%xmm7,%xmm7 - rorl $5,%r13d - xorl %ecx,%r14d - andl %r10d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 96-128(%rdi),%xmm10 - xorl %r10d,%r13d - vpaddd %xmm7,%xmm1,%xmm1 - addl 24(%rsp),%ebx - movl %ecx,%r15d - rorl $11,%r14d - xorl %eax,%r12d - vpaddd 32(%rbp),%xmm1,%xmm6 - xorl %edx,%r15d - rorl $6,%r13d - addl %r12d,%ebx - andl %r15d,%esi - xorl %ecx,%r14d - addl %r13d,%ebx - xorl %edx,%esi - addl %ebx,%r9d - rorl $2,%r14d - addl %esi,%ebx - movl %r9d,%r13d - addl %ebx,%r14d - rorl $14,%r13d - movl %r14d,%ebx - movl %r10d,%r12d - xorl %r9d,%r13d - rorl $9,%r14d - xorl %r11d,%r12d - rorl $5,%r13d - xorl %ebx,%r14d - andl %r9d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 112-128(%rdi),%xmm10 - xorl %r9d,%r13d - addl 28(%rsp),%eax - movl %ebx,%esi - rorl $11,%r14d - xorl %r11d,%r12d - xorl %ecx,%esi - rorl $6,%r13d - addl %r12d,%eax - andl %esi,%r15d - xorl %ebx,%r14d - addl %r13d,%eax - xorl %ecx,%r15d - addl %eax,%r8d - rorl $2,%r14d - addl %r15d,%eax - movl %r8d,%r13d - addl %eax,%r14d - vmovdqa %xmm6,16(%rsp) - vpalignr $4,%xmm2,%xmm3,%xmm4 - rorl $14,%r13d - movl %r14d,%eax - vpalignr $4,%xmm0,%xmm1,%xmm7 - movl %r9d,%r12d - xorl %r8d,%r13d -.byte 143,232,120,194,236,14 - rorl $9,%r14d - xorl %r10d,%r12d - vpsrld $3,%xmm4,%xmm4 - rorl $5,%r13d - xorl %eax,%r14d - vpaddd %xmm7,%xmm2,%xmm2 - andl %r8d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 128-128(%rdi),%xmm10 - xorl %r8d,%r13d - addl 32(%rsp),%r11d - movl %eax,%r15d -.byte 143,232,120,194,245,11 - rorl $11,%r14d - xorl %r10d,%r12d - vpxor %xmm5,%xmm4,%xmm4 - xorl %ebx,%r15d - rorl $6,%r13d - addl %r12d,%r11d - andl %r15d,%esi -.byte 143,232,120,194,249,13 - xorl %eax,%r14d - addl %r13d,%r11d - vpxor %xmm6,%xmm4,%xmm4 - xorl %ebx,%esi - addl %r11d,%edx - vpsrld $10,%xmm1,%xmm6 - rorl $2,%r14d - addl %esi,%r11d - vpaddd %xmm4,%xmm2,%xmm2 - movl %edx,%r13d - addl %r11d,%r14d -.byte 143,232,120,194,239,2 - rorl $14,%r13d - movl %r14d,%r11d - vpxor %xmm6,%xmm7,%xmm7 - movl %r8d,%r12d - xorl %edx,%r13d - rorl $9,%r14d - xorl %r9d,%r12d - vpxor %xmm5,%xmm7,%xmm7 - rorl $5,%r13d - xorl %r11d,%r14d - andl %edx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 144-128(%rdi),%xmm10 - xorl %edx,%r13d - vpsrldq $8,%xmm7,%xmm7 - addl 36(%rsp),%r10d - movl %r11d,%esi - rorl $11,%r14d - xorl %r9d,%r12d - vpaddd %xmm7,%xmm2,%xmm2 - xorl %eax,%esi - rorl $6,%r13d - addl %r12d,%r10d - andl %esi,%r15d -.byte 143,232,120,194,250,13 - xorl %r11d,%r14d - addl %r13d,%r10d - vpsrld $10,%xmm2,%xmm6 - xorl %eax,%r15d - addl %r10d,%ecx -.byte 143,232,120,194,239,2 - rorl $2,%r14d - addl %r15d,%r10d - vpxor %xmm6,%xmm7,%xmm7 - movl %ecx,%r13d - addl %r10d,%r14d - rorl $14,%r13d - movl %r14d,%r10d - vpxor %xmm5,%xmm7,%xmm7 - movl %edx,%r12d - xorl %ecx,%r13d - rorl $9,%r14d - xorl %r8d,%r12d - vpslldq $8,%xmm7,%xmm7 - rorl $5,%r13d - xorl %r10d,%r14d - andl %ecx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 160-128(%rdi),%xmm10 - xorl %ecx,%r13d - vpaddd %xmm7,%xmm2,%xmm2 - addl 40(%rsp),%r9d - movl %r10d,%r15d - rorl $11,%r14d - xorl %r8d,%r12d - vpaddd 64(%rbp),%xmm2,%xmm6 - xorl %r11d,%r15d - rorl $6,%r13d - addl %r12d,%r9d - andl %r15d,%esi - xorl %r10d,%r14d - addl %r13d,%r9d - xorl %r11d,%esi - addl %r9d,%ebx - rorl $2,%r14d - addl %esi,%r9d - movl %ebx,%r13d - addl %r9d,%r14d - rorl $14,%r13d - movl %r14d,%r9d - movl %ecx,%r12d - xorl %ebx,%r13d - rorl $9,%r14d - xorl %edx,%r12d - rorl $5,%r13d - xorl %r9d,%r14d - andl %ebx,%r12d - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 176-128(%rdi),%xmm10 - xorl %ebx,%r13d - addl 44(%rsp),%r8d - movl %r9d,%esi - rorl $11,%r14d - xorl %edx,%r12d - xorl %r10d,%esi - rorl $6,%r13d - addl %r12d,%r8d - andl %esi,%r15d - xorl %r9d,%r14d - addl %r13d,%r8d - xorl %r10d,%r15d - addl %r8d,%eax - rorl $2,%r14d - addl %r15d,%r8d - movl %eax,%r13d - addl %r8d,%r14d - vmovdqa %xmm6,32(%rsp) - vpalignr $4,%xmm3,%xmm0,%xmm4 - rorl $14,%r13d - movl %r14d,%r8d - vpalignr $4,%xmm1,%xmm2,%xmm7 - movl %ebx,%r12d - xorl %eax,%r13d -.byte 143,232,120,194,236,14 - rorl $9,%r14d - xorl %ecx,%r12d - vpsrld $3,%xmm4,%xmm4 - rorl $5,%r13d - xorl %r8d,%r14d - vpaddd %xmm7,%xmm3,%xmm3 - andl %eax,%r12d - vpand %xmm12,%xmm11,%xmm8 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 192-128(%rdi),%xmm10 - xorl %eax,%r13d - addl 48(%rsp),%edx - movl %r8d,%r15d -.byte 143,232,120,194,245,11 - rorl $11,%r14d - xorl %ecx,%r12d - vpxor %xmm5,%xmm4,%xmm4 - xorl %r9d,%r15d - rorl $6,%r13d - addl %r12d,%edx - andl %r15d,%esi -.byte 143,232,120,194,250,13 - xorl %r8d,%r14d - addl %r13d,%edx - vpxor %xmm6,%xmm4,%xmm4 - xorl %r9d,%esi - addl %edx,%r11d - vpsrld $10,%xmm2,%xmm6 - rorl $2,%r14d - addl %esi,%edx - vpaddd %xmm4,%xmm3,%xmm3 - movl %r11d,%r13d - addl %edx,%r14d -.byte 143,232,120,194,239,2 - rorl $14,%r13d - movl %r14d,%edx - vpxor %xmm6,%xmm7,%xmm7 - movl %eax,%r12d - xorl %r11d,%r13d - rorl $9,%r14d - xorl %ebx,%r12d - vpxor %xmm5,%xmm7,%xmm7 - rorl $5,%r13d - xorl %edx,%r14d - andl %r11d,%r12d - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 208-128(%rdi),%xmm10 - xorl %r11d,%r13d - vpsrldq $8,%xmm7,%xmm7 - addl 52(%rsp),%ecx - movl %edx,%esi - rorl $11,%r14d - xorl %ebx,%r12d - vpaddd %xmm7,%xmm3,%xmm3 - xorl %r8d,%esi - rorl $6,%r13d - addl %r12d,%ecx - andl %esi,%r15d -.byte 143,232,120,194,251,13 - xorl %edx,%r14d - addl %r13d,%ecx - vpsrld $10,%xmm3,%xmm6 - xorl %r8d,%r15d - addl %ecx,%r10d -.byte 143,232,120,194,239,2 - rorl $2,%r14d - addl %r15d,%ecx - vpxor %xmm6,%xmm7,%xmm7 - movl %r10d,%r13d - addl %ecx,%r14d - rorl $14,%r13d - movl %r14d,%ecx - vpxor %xmm5,%xmm7,%xmm7 - movl %r11d,%r12d - xorl %r10d,%r13d - rorl $9,%r14d - xorl %eax,%r12d - vpslldq $8,%xmm7,%xmm7 - rorl $5,%r13d - xorl %ecx,%r14d - andl %r10d,%r12d - vpand %xmm13,%xmm11,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 224-128(%rdi),%xmm10 - xorl %r10d,%r13d - vpaddd %xmm7,%xmm3,%xmm3 - addl 56(%rsp),%ebx - movl %ecx,%r15d - rorl $11,%r14d - xorl %eax,%r12d - vpaddd 96(%rbp),%xmm3,%xmm6 - xorl %edx,%r15d - rorl $6,%r13d - addl %r12d,%ebx - andl %r15d,%esi - xorl %ecx,%r14d - addl %r13d,%ebx - xorl %edx,%esi - addl %ebx,%r9d - rorl $2,%r14d - addl %esi,%ebx - movl %r9d,%r13d - addl %ebx,%r14d - rorl $14,%r13d - movl %r14d,%ebx - movl %r10d,%r12d - xorl %r9d,%r13d - rorl $9,%r14d - xorl %r11d,%r12d - rorl $5,%r13d - xorl %ebx,%r14d - andl %r9d,%r12d - vpor %xmm11,%xmm8,%xmm8 - vaesenclast %xmm10,%xmm9,%xmm11 - vmovdqu 0-128(%rdi),%xmm10 - xorl %r9d,%r13d - addl 60(%rsp),%eax - movl %ebx,%esi - rorl $11,%r14d - xorl %r11d,%r12d - xorl %ecx,%esi - rorl $6,%r13d - addl %r12d,%eax - andl %esi,%r15d - xorl %ebx,%r14d - addl %r13d,%eax - xorl %ecx,%r15d - addl %eax,%r8d - rorl $2,%r14d - addl %r15d,%eax - movl %r8d,%r13d - addl %eax,%r14d - vmovdqa %xmm6,48(%rsp) - movq 64+0(%rsp),%r12 - vpand %xmm14,%xmm11,%xmm11 - movq 64+8(%rsp),%r15 - vpor %xmm11,%xmm8,%xmm8 - vmovdqu %xmm8,(%r15,%r12,1) - leaq 16(%r12),%r12 - cmpb $0,131(%rbp) - jne L$xop_00_47 - vmovdqu (%r12),%xmm9 - movq %r12,64+0(%rsp) - rorl $14,%r13d - movl %r14d,%eax - movl %r9d,%r12d - xorl %r8d,%r13d - rorl $9,%r14d - xorl %r10d,%r12d - rorl $5,%r13d - xorl %eax,%r14d - andl %r8d,%r12d - vpxor %xmm10,%xmm9,%xmm9 - vmovdqu 16-128(%rdi),%xmm10 - xorl %r8d,%r13d - addl 0(%rsp),%r11d - movl %eax,%r15d - rorl $11,%r14d - xorl %r10d,%r12d - xorl %ebx,%r15d - rorl $6,%r13d - addl %r12d,%r11d - andl %r15d,%esi - xorl %eax,%r14d - addl %r13d,%r11d - xorl %ebx,%esi - addl %r11d,%edx - rorl $2,%r14d - addl %esi,%r11d - movl %edx,%r13d - addl %r11d,%r14d - rorl $14,%r13d - movl %r14d,%r11d - movl %r8d,%r12d - xorl %edx,%r13d - rorl $9,%r14d - xorl %r9d,%r12d - rorl $5,%r13d - xorl %r11d,%r14d - andl %edx,%r12d - vpxor %xmm8,%xmm9,%xmm9 - xorl %edx,%r13d - addl 4(%rsp),%r10d - movl %r11d,%esi - rorl $11,%r14d - xorl %r9d,%r12d - xorl %eax,%esi - rorl $6,%r13d - addl %r12d,%r10d - andl %esi,%r15d - xorl %r11d,%r14d - addl %r13d,%r10d - xorl %eax,%r15d - addl %r10d,%ecx - rorl $2,%r14d - addl %r15d,%r10d - movl %ecx,%r13d - addl %r10d,%r14d - rorl $14,%r13d - movl %r14d,%r10d - movl %edx,%r12d - xorl %ecx,%r13d - rorl $9,%r14d - xorl %r8d,%r12d - rorl $5,%r13d - xorl %r10d,%r14d - andl %ecx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 32-128(%rdi),%xmm10 - xorl %ecx,%r13d - addl 8(%rsp),%r9d - movl %r10d,%r15d - rorl $11,%r14d - xorl %r8d,%r12d - xorl %r11d,%r15d - rorl $6,%r13d - addl %r12d,%r9d - andl %r15d,%esi - xorl %r10d,%r14d - addl %r13d,%r9d - xorl %r11d,%esi - addl %r9d,%ebx - rorl $2,%r14d - addl %esi,%r9d - movl %ebx,%r13d - addl %r9d,%r14d - rorl $14,%r13d - movl %r14d,%r9d - movl %ecx,%r12d - xorl %ebx,%r13d - rorl $9,%r14d - xorl %edx,%r12d - rorl $5,%r13d - xorl %r9d,%r14d - andl %ebx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 48-128(%rdi),%xmm10 - xorl %ebx,%r13d - addl 12(%rsp),%r8d - movl %r9d,%esi - rorl $11,%r14d - xorl %edx,%r12d - xorl %r10d,%esi - rorl $6,%r13d - addl %r12d,%r8d - andl %esi,%r15d - xorl %r9d,%r14d - addl %r13d,%r8d - xorl %r10d,%r15d - addl %r8d,%eax - rorl $2,%r14d - addl %r15d,%r8d - movl %eax,%r13d - addl %r8d,%r14d - rorl $14,%r13d - movl %r14d,%r8d - movl %ebx,%r12d - xorl %eax,%r13d - rorl $9,%r14d - xorl %ecx,%r12d - rorl $5,%r13d - xorl %r8d,%r14d - andl %eax,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 64-128(%rdi),%xmm10 - xorl %eax,%r13d - addl 16(%rsp),%edx - movl %r8d,%r15d - rorl $11,%r14d - xorl %ecx,%r12d - xorl %r9d,%r15d - rorl $6,%r13d - addl %r12d,%edx - andl %r15d,%esi - xorl %r8d,%r14d - addl %r13d,%edx - xorl %r9d,%esi - addl %edx,%r11d - rorl $2,%r14d - addl %esi,%edx - movl %r11d,%r13d - addl %edx,%r14d - rorl $14,%r13d - movl %r14d,%edx - movl %eax,%r12d - xorl %r11d,%r13d - rorl $9,%r14d - xorl %ebx,%r12d - rorl $5,%r13d - xorl %edx,%r14d - andl %r11d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 80-128(%rdi),%xmm10 - xorl %r11d,%r13d - addl 20(%rsp),%ecx - movl %edx,%esi - rorl $11,%r14d - xorl %ebx,%r12d - xorl %r8d,%esi - rorl $6,%r13d - addl %r12d,%ecx - andl %esi,%r15d - xorl %edx,%r14d - addl %r13d,%ecx - xorl %r8d,%r15d - addl %ecx,%r10d - rorl $2,%r14d - addl %r15d,%ecx - movl %r10d,%r13d - addl %ecx,%r14d - rorl $14,%r13d - movl %r14d,%ecx - movl %r11d,%r12d - xorl %r10d,%r13d - rorl $9,%r14d - xorl %eax,%r12d - rorl $5,%r13d - xorl %ecx,%r14d - andl %r10d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 96-128(%rdi),%xmm10 - xorl %r10d,%r13d - addl 24(%rsp),%ebx - movl %ecx,%r15d - rorl $11,%r14d - xorl %eax,%r12d - xorl %edx,%r15d - rorl $6,%r13d - addl %r12d,%ebx - andl %r15d,%esi - xorl %ecx,%r14d - addl %r13d,%ebx - xorl %edx,%esi - addl %ebx,%r9d - rorl $2,%r14d - addl %esi,%ebx - movl %r9d,%r13d - addl %ebx,%r14d - rorl $14,%r13d - movl %r14d,%ebx - movl %r10d,%r12d - xorl %r9d,%r13d - rorl $9,%r14d - xorl %r11d,%r12d - rorl $5,%r13d - xorl %ebx,%r14d - andl %r9d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 112-128(%rdi),%xmm10 - xorl %r9d,%r13d - addl 28(%rsp),%eax - movl %ebx,%esi - rorl $11,%r14d - xorl %r11d,%r12d - xorl %ecx,%esi - rorl $6,%r13d - addl %r12d,%eax - andl %esi,%r15d - xorl %ebx,%r14d - addl %r13d,%eax - xorl %ecx,%r15d - addl %eax,%r8d - rorl $2,%r14d - addl %r15d,%eax - movl %r8d,%r13d - addl %eax,%r14d - rorl $14,%r13d - movl %r14d,%eax - movl %r9d,%r12d - xorl %r8d,%r13d - rorl $9,%r14d - xorl %r10d,%r12d - rorl $5,%r13d - xorl %eax,%r14d - andl %r8d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 128-128(%rdi),%xmm10 - xorl %r8d,%r13d - addl 32(%rsp),%r11d - movl %eax,%r15d - rorl $11,%r14d - xorl %r10d,%r12d - xorl %ebx,%r15d - rorl $6,%r13d - addl %r12d,%r11d - andl %r15d,%esi - xorl %eax,%r14d - addl %r13d,%r11d - xorl %ebx,%esi - addl %r11d,%edx - rorl $2,%r14d - addl %esi,%r11d - movl %edx,%r13d - addl %r11d,%r14d - rorl $14,%r13d - movl %r14d,%r11d - movl %r8d,%r12d - xorl %edx,%r13d - rorl $9,%r14d - xorl %r9d,%r12d - rorl $5,%r13d - xorl %r11d,%r14d - andl %edx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 144-128(%rdi),%xmm10 - xorl %edx,%r13d - addl 36(%rsp),%r10d - movl %r11d,%esi - rorl $11,%r14d - xorl %r9d,%r12d - xorl %eax,%esi - rorl $6,%r13d - addl %r12d,%r10d - andl %esi,%r15d - xorl %r11d,%r14d - addl %r13d,%r10d - xorl %eax,%r15d - addl %r10d,%ecx - rorl $2,%r14d - addl %r15d,%r10d - movl %ecx,%r13d - addl %r10d,%r14d - rorl $14,%r13d - movl %r14d,%r10d - movl %edx,%r12d - xorl %ecx,%r13d - rorl $9,%r14d - xorl %r8d,%r12d - rorl $5,%r13d - xorl %r10d,%r14d - andl %ecx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 160-128(%rdi),%xmm10 - xorl %ecx,%r13d - addl 40(%rsp),%r9d - movl %r10d,%r15d - rorl $11,%r14d - xorl %r8d,%r12d - xorl %r11d,%r15d - rorl $6,%r13d - addl %r12d,%r9d - andl %r15d,%esi - xorl %r10d,%r14d - addl %r13d,%r9d - xorl %r11d,%esi - addl %r9d,%ebx - rorl $2,%r14d - addl %esi,%r9d - movl %ebx,%r13d - addl %r9d,%r14d - rorl $14,%r13d - movl %r14d,%r9d - movl %ecx,%r12d - xorl %ebx,%r13d - rorl $9,%r14d - xorl %edx,%r12d - rorl $5,%r13d - xorl %r9d,%r14d - andl %ebx,%r12d - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 176-128(%rdi),%xmm10 - xorl %ebx,%r13d - addl 44(%rsp),%r8d - movl %r9d,%esi - rorl $11,%r14d - xorl %edx,%r12d - xorl %r10d,%esi - rorl $6,%r13d - addl %r12d,%r8d - andl %esi,%r15d - xorl %r9d,%r14d - addl %r13d,%r8d - xorl %r10d,%r15d - addl %r8d,%eax - rorl $2,%r14d - addl %r15d,%r8d - movl %eax,%r13d - addl %r8d,%r14d - rorl $14,%r13d - movl %r14d,%r8d - movl %ebx,%r12d - xorl %eax,%r13d - rorl $9,%r14d - xorl %ecx,%r12d - rorl $5,%r13d - xorl %r8d,%r14d - andl %eax,%r12d - vpand %xmm12,%xmm11,%xmm8 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 192-128(%rdi),%xmm10 - xorl %eax,%r13d - addl 48(%rsp),%edx - movl %r8d,%r15d - rorl $11,%r14d - xorl %ecx,%r12d - xorl %r9d,%r15d - rorl $6,%r13d - addl %r12d,%edx - andl %r15d,%esi - xorl %r8d,%r14d - addl %r13d,%edx - xorl %r9d,%esi - addl %edx,%r11d - rorl $2,%r14d - addl %esi,%edx - movl %r11d,%r13d - addl %edx,%r14d - rorl $14,%r13d - movl %r14d,%edx - movl %eax,%r12d - xorl %r11d,%r13d - rorl $9,%r14d - xorl %ebx,%r12d - rorl $5,%r13d - xorl %edx,%r14d - andl %r11d,%r12d - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 208-128(%rdi),%xmm10 - xorl %r11d,%r13d - addl 52(%rsp),%ecx - movl %edx,%esi - rorl $11,%r14d - xorl %ebx,%r12d - xorl %r8d,%esi - rorl $6,%r13d - addl %r12d,%ecx - andl %esi,%r15d - xorl %edx,%r14d - addl %r13d,%ecx - xorl %r8d,%r15d - addl %ecx,%r10d - rorl $2,%r14d - addl %r15d,%ecx - movl %r10d,%r13d - addl %ecx,%r14d - rorl $14,%r13d - movl %r14d,%ecx - movl %r11d,%r12d - xorl %r10d,%r13d - rorl $9,%r14d - xorl %eax,%r12d - rorl $5,%r13d - xorl %ecx,%r14d - andl %r10d,%r12d - vpand %xmm13,%xmm11,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 224-128(%rdi),%xmm10 - xorl %r10d,%r13d - addl 56(%rsp),%ebx - movl %ecx,%r15d - rorl $11,%r14d - xorl %eax,%r12d - xorl %edx,%r15d - rorl $6,%r13d - addl %r12d,%ebx - andl %r15d,%esi - xorl %ecx,%r14d - addl %r13d,%ebx - xorl %edx,%esi - addl %ebx,%r9d - rorl $2,%r14d - addl %esi,%ebx - movl %r9d,%r13d - addl %ebx,%r14d - rorl $14,%r13d - movl %r14d,%ebx - movl %r10d,%r12d - xorl %r9d,%r13d - rorl $9,%r14d - xorl %r11d,%r12d - rorl $5,%r13d - xorl %ebx,%r14d - andl %r9d,%r12d - vpor %xmm11,%xmm8,%xmm8 - vaesenclast %xmm10,%xmm9,%xmm11 - vmovdqu 0-128(%rdi),%xmm10 - xorl %r9d,%r13d - addl 60(%rsp),%eax - movl %ebx,%esi - rorl $11,%r14d - xorl %r11d,%r12d - xorl %ecx,%esi - rorl $6,%r13d - addl %r12d,%eax - andl %esi,%r15d - xorl %ebx,%r14d - addl %r13d,%eax - xorl %ecx,%r15d - addl %eax,%r8d - rorl $2,%r14d - addl %r15d,%eax - movl %r8d,%r13d - addl %eax,%r14d - movq 64+0(%rsp),%r12 - movq 64+8(%rsp),%r13 - movq 64+40(%rsp),%r15 - movq 64+48(%rsp),%rsi - - vpand %xmm14,%xmm11,%xmm11 - movl %r14d,%eax - vpor %xmm11,%xmm8,%xmm8 - vmovdqu %xmm8,(%r12,%r13,1) - leaq 16(%r12),%r12 - - addl 0(%r15),%eax - addl 4(%r15),%ebx - addl 8(%r15),%ecx - addl 12(%r15),%edx - addl 16(%r15),%r8d - addl 20(%r15),%r9d - addl 24(%r15),%r10d - addl 28(%r15),%r11d - - cmpq 64+16(%rsp),%r12 - - movl %eax,0(%r15) - movl %ebx,4(%r15) - movl %ecx,8(%r15) - movl %edx,12(%r15) - movl %r8d,16(%r15) - movl %r9d,20(%r15) - movl %r10d,24(%r15) - movl %r11d,28(%r15) - - jb L$loop_xop - - movq 64+32(%rsp),%r8 - movq 64+56(%rsp),%rsi - vmovdqu %xmm8,(%r8) - vzeroall - movq (%rsi),%r15 - movq 8(%rsi),%r14 - movq 16(%rsi),%r13 - movq 24(%rsi),%r12 - movq 32(%rsi),%rbp - movq 40(%rsi),%rbx - leaq 48(%rsi),%rsp -L$epilogue_xop: - .byte 0xf3,0xc3 - - -.p2align 6 -aesni_cbc_sha256_enc_avx: -L$avx_shortcut: - movq 8(%rsp),%r10 - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - movq %rsp,%r11 - subq $128,%rsp - andq $-64,%rsp - - shlq $6,%rdx - subq %rdi,%rsi - subq %rdi,%r10 - addq %rdi,%rdx - - - movq %rsi,64+8(%rsp) - movq %rdx,64+16(%rsp) - - movq %r8,64+32(%rsp) - movq %r9,64+40(%rsp) - movq %r10,64+48(%rsp) - movq %r11,64+56(%rsp) -L$prologue_avx: - vzeroall - - movq %rdi,%r12 - leaq 128(%rcx),%rdi - leaq K256+544(%rip),%r13 - movl 240-128(%rdi),%r14d - movq %r9,%r15 - movq %r10,%rsi - vmovdqu (%r8),%xmm8 - subq $9,%r14 - - movl 0(%r15),%eax - movl 4(%r15),%ebx - movl 8(%r15),%ecx - movl 12(%r15),%edx - movl 16(%r15),%r8d - movl 20(%r15),%r9d - movl 24(%r15),%r10d - movl 28(%r15),%r11d - - vmovdqa 0(%r13,%r14,8),%xmm14 - vmovdqa 16(%r13,%r14,8),%xmm13 - vmovdqa 32(%r13,%r14,8),%xmm12 - vmovdqu 0-128(%rdi),%xmm10 - jmp L$loop_avx -.p2align 4 -L$loop_avx: - vmovdqa K256+512(%rip),%xmm7 - vmovdqu 0(%rsi,%r12,1),%xmm0 - vmovdqu 16(%rsi,%r12,1),%xmm1 - vmovdqu 32(%rsi,%r12,1),%xmm2 - vmovdqu 48(%rsi,%r12,1),%xmm3 - vpshufb %xmm7,%xmm0,%xmm0 - leaq K256(%rip),%rbp - vpshufb %xmm7,%xmm1,%xmm1 - vpshufb %xmm7,%xmm2,%xmm2 - vpaddd 0(%rbp),%xmm0,%xmm4 - vpshufb %xmm7,%xmm3,%xmm3 - vpaddd 32(%rbp),%xmm1,%xmm5 - vpaddd 64(%rbp),%xmm2,%xmm6 - vpaddd 96(%rbp),%xmm3,%xmm7 - vmovdqa %xmm4,0(%rsp) - movl %eax,%r14d - vmovdqa %xmm5,16(%rsp) - movl %ebx,%esi - vmovdqa %xmm6,32(%rsp) - xorl %ecx,%esi - vmovdqa %xmm7,48(%rsp) - movl %r8d,%r13d - jmp L$avx_00_47 - -.p2align 4 -L$avx_00_47: - subq $-32*4,%rbp - vmovdqu (%r12),%xmm9 - movq %r12,64+0(%rsp) - vpalignr $4,%xmm0,%xmm1,%xmm4 - shrdl $14,%r13d,%r13d - movl %r14d,%eax - movl %r9d,%r12d - vpalignr $4,%xmm2,%xmm3,%xmm7 - xorl %r8d,%r13d - shrdl $9,%r14d,%r14d - xorl %r10d,%r12d - vpsrld $7,%xmm4,%xmm6 - shrdl $5,%r13d,%r13d - xorl %eax,%r14d - andl %r8d,%r12d - vpaddd %xmm7,%xmm0,%xmm0 - vpxor %xmm10,%xmm9,%xmm9 - vmovdqu 16-128(%rdi),%xmm10 - xorl %r8d,%r13d - addl 0(%rsp),%r11d - movl %eax,%r15d - vpsrld $3,%xmm4,%xmm7 - shrdl $11,%r14d,%r14d - xorl %r10d,%r12d - xorl %ebx,%r15d - vpslld $14,%xmm4,%xmm5 - shrdl $6,%r13d,%r13d - addl %r12d,%r11d - andl %r15d,%esi - vpxor %xmm6,%xmm7,%xmm4 - xorl %eax,%r14d - addl %r13d,%r11d - xorl %ebx,%esi - vpshufd $250,%xmm3,%xmm7 - addl %r11d,%edx - shrdl $2,%r14d,%r14d - addl %esi,%r11d - vpsrld $11,%xmm6,%xmm6 - movl %edx,%r13d - addl %r11d,%r14d - shrdl $14,%r13d,%r13d - vpxor %xmm5,%xmm4,%xmm4 - movl %r14d,%r11d - movl %r8d,%r12d - xorl %edx,%r13d - vpslld $11,%xmm5,%xmm5 - shrdl $9,%r14d,%r14d - xorl %r9d,%r12d - shrdl $5,%r13d,%r13d - vpxor %xmm6,%xmm4,%xmm4 - xorl %r11d,%r14d - andl %edx,%r12d - vpxor %xmm8,%xmm9,%xmm9 - xorl %edx,%r13d - vpsrld $10,%xmm7,%xmm6 - addl 4(%rsp),%r10d - movl %r11d,%esi - shrdl $11,%r14d,%r14d - vpxor %xmm5,%xmm4,%xmm4 - xorl %r9d,%r12d - xorl %eax,%esi - shrdl $6,%r13d,%r13d - vpsrlq $17,%xmm7,%xmm7 - addl %r12d,%r10d - andl %esi,%r15d - xorl %r11d,%r14d - vpaddd %xmm4,%xmm0,%xmm0 - addl %r13d,%r10d - xorl %eax,%r15d - addl %r10d,%ecx - vpxor %xmm7,%xmm6,%xmm6 - shrdl $2,%r14d,%r14d - addl %r15d,%r10d - movl %ecx,%r13d - vpsrlq $2,%xmm7,%xmm7 - addl %r10d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r10d - vpxor %xmm7,%xmm6,%xmm6 - movl %edx,%r12d - xorl %ecx,%r13d - shrdl $9,%r14d,%r14d - vpshufd $132,%xmm6,%xmm6 - xorl %r8d,%r12d - shrdl $5,%r13d,%r13d - xorl %r10d,%r14d - vpsrldq $8,%xmm6,%xmm6 - andl %ecx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 32-128(%rdi),%xmm10 - xorl %ecx,%r13d - addl 8(%rsp),%r9d - vpaddd %xmm6,%xmm0,%xmm0 - movl %r10d,%r15d - shrdl $11,%r14d,%r14d - xorl %r8d,%r12d - vpshufd $80,%xmm0,%xmm7 - xorl %r11d,%r15d - shrdl $6,%r13d,%r13d - addl %r12d,%r9d - vpsrld $10,%xmm7,%xmm6 - andl %r15d,%esi - xorl %r10d,%r14d - addl %r13d,%r9d - vpsrlq $17,%xmm7,%xmm7 - xorl %r11d,%esi - addl %r9d,%ebx - shrdl $2,%r14d,%r14d - vpxor %xmm7,%xmm6,%xmm6 - addl %esi,%r9d - movl %ebx,%r13d - addl %r9d,%r14d - vpsrlq $2,%xmm7,%xmm7 - shrdl $14,%r13d,%r13d - movl %r14d,%r9d - movl %ecx,%r12d - vpxor %xmm7,%xmm6,%xmm6 - xorl %ebx,%r13d - shrdl $9,%r14d,%r14d - xorl %edx,%r12d - vpshufd $232,%xmm6,%xmm6 - shrdl $5,%r13d,%r13d - xorl %r9d,%r14d - andl %ebx,%r12d - vpslldq $8,%xmm6,%xmm6 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 48-128(%rdi),%xmm10 - xorl %ebx,%r13d - addl 12(%rsp),%r8d - movl %r9d,%esi - vpaddd %xmm6,%xmm0,%xmm0 - shrdl $11,%r14d,%r14d - xorl %edx,%r12d - xorl %r10d,%esi - vpaddd 0(%rbp),%xmm0,%xmm6 - shrdl $6,%r13d,%r13d - addl %r12d,%r8d - andl %esi,%r15d - xorl %r9d,%r14d - addl %r13d,%r8d - xorl %r10d,%r15d - addl %r8d,%eax - shrdl $2,%r14d,%r14d - addl %r15d,%r8d - movl %eax,%r13d - addl %r8d,%r14d - vmovdqa %xmm6,0(%rsp) - vpalignr $4,%xmm1,%xmm2,%xmm4 - shrdl $14,%r13d,%r13d - movl %r14d,%r8d - movl %ebx,%r12d - vpalignr $4,%xmm3,%xmm0,%xmm7 - xorl %eax,%r13d - shrdl $9,%r14d,%r14d - xorl %ecx,%r12d - vpsrld $7,%xmm4,%xmm6 - shrdl $5,%r13d,%r13d - xorl %r8d,%r14d - andl %eax,%r12d - vpaddd %xmm7,%xmm1,%xmm1 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 64-128(%rdi),%xmm10 - xorl %eax,%r13d - addl 16(%rsp),%edx - movl %r8d,%r15d - vpsrld $3,%xmm4,%xmm7 - shrdl $11,%r14d,%r14d - xorl %ecx,%r12d - xorl %r9d,%r15d - vpslld $14,%xmm4,%xmm5 - shrdl $6,%r13d,%r13d - addl %r12d,%edx - andl %r15d,%esi - vpxor %xmm6,%xmm7,%xmm4 - xorl %r8d,%r14d - addl %r13d,%edx - xorl %r9d,%esi - vpshufd $250,%xmm0,%xmm7 - addl %edx,%r11d - shrdl $2,%r14d,%r14d - addl %esi,%edx - vpsrld $11,%xmm6,%xmm6 - movl %r11d,%r13d - addl %edx,%r14d - shrdl $14,%r13d,%r13d - vpxor %xmm5,%xmm4,%xmm4 - movl %r14d,%edx - movl %eax,%r12d - xorl %r11d,%r13d - vpslld $11,%xmm5,%xmm5 - shrdl $9,%r14d,%r14d - xorl %ebx,%r12d - shrdl $5,%r13d,%r13d - vpxor %xmm6,%xmm4,%xmm4 - xorl %edx,%r14d - andl %r11d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 80-128(%rdi),%xmm10 - xorl %r11d,%r13d - vpsrld $10,%xmm7,%xmm6 - addl 20(%rsp),%ecx - movl %edx,%esi - shrdl $11,%r14d,%r14d - vpxor %xmm5,%xmm4,%xmm4 - xorl %ebx,%r12d - xorl %r8d,%esi - shrdl $6,%r13d,%r13d - vpsrlq $17,%xmm7,%xmm7 - addl %r12d,%ecx - andl %esi,%r15d - xorl %edx,%r14d - vpaddd %xmm4,%xmm1,%xmm1 - addl %r13d,%ecx - xorl %r8d,%r15d - addl %ecx,%r10d - vpxor %xmm7,%xmm6,%xmm6 - shrdl $2,%r14d,%r14d - addl %r15d,%ecx - movl %r10d,%r13d - vpsrlq $2,%xmm7,%xmm7 - addl %ecx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%ecx - vpxor %xmm7,%xmm6,%xmm6 - movl %r11d,%r12d - xorl %r10d,%r13d - shrdl $9,%r14d,%r14d - vpshufd $132,%xmm6,%xmm6 - xorl %eax,%r12d - shrdl $5,%r13d,%r13d - xorl %ecx,%r14d - vpsrldq $8,%xmm6,%xmm6 - andl %r10d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 96-128(%rdi),%xmm10 - xorl %r10d,%r13d - addl 24(%rsp),%ebx - vpaddd %xmm6,%xmm1,%xmm1 - movl %ecx,%r15d - shrdl $11,%r14d,%r14d - xorl %eax,%r12d - vpshufd $80,%xmm1,%xmm7 - xorl %edx,%r15d - shrdl $6,%r13d,%r13d - addl %r12d,%ebx - vpsrld $10,%xmm7,%xmm6 - andl %r15d,%esi - xorl %ecx,%r14d - addl %r13d,%ebx - vpsrlq $17,%xmm7,%xmm7 - xorl %edx,%esi - addl %ebx,%r9d - shrdl $2,%r14d,%r14d - vpxor %xmm7,%xmm6,%xmm6 - addl %esi,%ebx - movl %r9d,%r13d - addl %ebx,%r14d - vpsrlq $2,%xmm7,%xmm7 - shrdl $14,%r13d,%r13d - movl %r14d,%ebx - movl %r10d,%r12d - vpxor %xmm7,%xmm6,%xmm6 - xorl %r9d,%r13d - shrdl $9,%r14d,%r14d - xorl %r11d,%r12d - vpshufd $232,%xmm6,%xmm6 - shrdl $5,%r13d,%r13d - xorl %ebx,%r14d - andl %r9d,%r12d - vpslldq $8,%xmm6,%xmm6 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 112-128(%rdi),%xmm10 - xorl %r9d,%r13d - addl 28(%rsp),%eax - movl %ebx,%esi - vpaddd %xmm6,%xmm1,%xmm1 - shrdl $11,%r14d,%r14d - xorl %r11d,%r12d - xorl %ecx,%esi - vpaddd 32(%rbp),%xmm1,%xmm6 - shrdl $6,%r13d,%r13d - addl %r12d,%eax - andl %esi,%r15d - xorl %ebx,%r14d - addl %r13d,%eax - xorl %ecx,%r15d - addl %eax,%r8d - shrdl $2,%r14d,%r14d - addl %r15d,%eax - movl %r8d,%r13d - addl %eax,%r14d - vmovdqa %xmm6,16(%rsp) - vpalignr $4,%xmm2,%xmm3,%xmm4 - shrdl $14,%r13d,%r13d - movl %r14d,%eax - movl %r9d,%r12d - vpalignr $4,%xmm0,%xmm1,%xmm7 - xorl %r8d,%r13d - shrdl $9,%r14d,%r14d - xorl %r10d,%r12d - vpsrld $7,%xmm4,%xmm6 - shrdl $5,%r13d,%r13d - xorl %eax,%r14d - andl %r8d,%r12d - vpaddd %xmm7,%xmm2,%xmm2 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 128-128(%rdi),%xmm10 - xorl %r8d,%r13d - addl 32(%rsp),%r11d - movl %eax,%r15d - vpsrld $3,%xmm4,%xmm7 - shrdl $11,%r14d,%r14d - xorl %r10d,%r12d - xorl %ebx,%r15d - vpslld $14,%xmm4,%xmm5 - shrdl $6,%r13d,%r13d - addl %r12d,%r11d - andl %r15d,%esi - vpxor %xmm6,%xmm7,%xmm4 - xorl %eax,%r14d - addl %r13d,%r11d - xorl %ebx,%esi - vpshufd $250,%xmm1,%xmm7 - addl %r11d,%edx - shrdl $2,%r14d,%r14d - addl %esi,%r11d - vpsrld $11,%xmm6,%xmm6 - movl %edx,%r13d - addl %r11d,%r14d - shrdl $14,%r13d,%r13d - vpxor %xmm5,%xmm4,%xmm4 - movl %r14d,%r11d - movl %r8d,%r12d - xorl %edx,%r13d - vpslld $11,%xmm5,%xmm5 - shrdl $9,%r14d,%r14d - xorl %r9d,%r12d - shrdl $5,%r13d,%r13d - vpxor %xmm6,%xmm4,%xmm4 - xorl %r11d,%r14d - andl %edx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 144-128(%rdi),%xmm10 - xorl %edx,%r13d - vpsrld $10,%xmm7,%xmm6 - addl 36(%rsp),%r10d - movl %r11d,%esi - shrdl $11,%r14d,%r14d - vpxor %xmm5,%xmm4,%xmm4 - xorl %r9d,%r12d - xorl %eax,%esi - shrdl $6,%r13d,%r13d - vpsrlq $17,%xmm7,%xmm7 - addl %r12d,%r10d - andl %esi,%r15d - xorl %r11d,%r14d - vpaddd %xmm4,%xmm2,%xmm2 - addl %r13d,%r10d - xorl %eax,%r15d - addl %r10d,%ecx - vpxor %xmm7,%xmm6,%xmm6 - shrdl $2,%r14d,%r14d - addl %r15d,%r10d - movl %ecx,%r13d - vpsrlq $2,%xmm7,%xmm7 - addl %r10d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r10d - vpxor %xmm7,%xmm6,%xmm6 - movl %edx,%r12d - xorl %ecx,%r13d - shrdl $9,%r14d,%r14d - vpshufd $132,%xmm6,%xmm6 - xorl %r8d,%r12d - shrdl $5,%r13d,%r13d - xorl %r10d,%r14d - vpsrldq $8,%xmm6,%xmm6 - andl %ecx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 160-128(%rdi),%xmm10 - xorl %ecx,%r13d - addl 40(%rsp),%r9d - vpaddd %xmm6,%xmm2,%xmm2 - movl %r10d,%r15d - shrdl $11,%r14d,%r14d - xorl %r8d,%r12d - vpshufd $80,%xmm2,%xmm7 - xorl %r11d,%r15d - shrdl $6,%r13d,%r13d - addl %r12d,%r9d - vpsrld $10,%xmm7,%xmm6 - andl %r15d,%esi - xorl %r10d,%r14d - addl %r13d,%r9d - vpsrlq $17,%xmm7,%xmm7 - xorl %r11d,%esi - addl %r9d,%ebx - shrdl $2,%r14d,%r14d - vpxor %xmm7,%xmm6,%xmm6 - addl %esi,%r9d - movl %ebx,%r13d - addl %r9d,%r14d - vpsrlq $2,%xmm7,%xmm7 - shrdl $14,%r13d,%r13d - movl %r14d,%r9d - movl %ecx,%r12d - vpxor %xmm7,%xmm6,%xmm6 - xorl %ebx,%r13d - shrdl $9,%r14d,%r14d - xorl %edx,%r12d - vpshufd $232,%xmm6,%xmm6 - shrdl $5,%r13d,%r13d - xorl %r9d,%r14d - andl %ebx,%r12d - vpslldq $8,%xmm6,%xmm6 - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 176-128(%rdi),%xmm10 - xorl %ebx,%r13d - addl 44(%rsp),%r8d - movl %r9d,%esi - vpaddd %xmm6,%xmm2,%xmm2 - shrdl $11,%r14d,%r14d - xorl %edx,%r12d - xorl %r10d,%esi - vpaddd 64(%rbp),%xmm2,%xmm6 - shrdl $6,%r13d,%r13d - addl %r12d,%r8d - andl %esi,%r15d - xorl %r9d,%r14d - addl %r13d,%r8d - xorl %r10d,%r15d - addl %r8d,%eax - shrdl $2,%r14d,%r14d - addl %r15d,%r8d - movl %eax,%r13d - addl %r8d,%r14d - vmovdqa %xmm6,32(%rsp) - vpalignr $4,%xmm3,%xmm0,%xmm4 - shrdl $14,%r13d,%r13d - movl %r14d,%r8d - movl %ebx,%r12d - vpalignr $4,%xmm1,%xmm2,%xmm7 - xorl %eax,%r13d - shrdl $9,%r14d,%r14d - xorl %ecx,%r12d - vpsrld $7,%xmm4,%xmm6 - shrdl $5,%r13d,%r13d - xorl %r8d,%r14d - andl %eax,%r12d - vpaddd %xmm7,%xmm3,%xmm3 - vpand %xmm12,%xmm11,%xmm8 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 192-128(%rdi),%xmm10 - xorl %eax,%r13d - addl 48(%rsp),%edx - movl %r8d,%r15d - vpsrld $3,%xmm4,%xmm7 - shrdl $11,%r14d,%r14d - xorl %ecx,%r12d - xorl %r9d,%r15d - vpslld $14,%xmm4,%xmm5 - shrdl $6,%r13d,%r13d - addl %r12d,%edx - andl %r15d,%esi - vpxor %xmm6,%xmm7,%xmm4 - xorl %r8d,%r14d - addl %r13d,%edx - xorl %r9d,%esi - vpshufd $250,%xmm2,%xmm7 - addl %edx,%r11d - shrdl $2,%r14d,%r14d - addl %esi,%edx - vpsrld $11,%xmm6,%xmm6 - movl %r11d,%r13d - addl %edx,%r14d - shrdl $14,%r13d,%r13d - vpxor %xmm5,%xmm4,%xmm4 - movl %r14d,%edx - movl %eax,%r12d - xorl %r11d,%r13d - vpslld $11,%xmm5,%xmm5 - shrdl $9,%r14d,%r14d - xorl %ebx,%r12d - shrdl $5,%r13d,%r13d - vpxor %xmm6,%xmm4,%xmm4 - xorl %edx,%r14d - andl %r11d,%r12d - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 208-128(%rdi),%xmm10 - xorl %r11d,%r13d - vpsrld $10,%xmm7,%xmm6 - addl 52(%rsp),%ecx - movl %edx,%esi - shrdl $11,%r14d,%r14d - vpxor %xmm5,%xmm4,%xmm4 - xorl %ebx,%r12d - xorl %r8d,%esi - shrdl $6,%r13d,%r13d - vpsrlq $17,%xmm7,%xmm7 - addl %r12d,%ecx - andl %esi,%r15d - xorl %edx,%r14d - vpaddd %xmm4,%xmm3,%xmm3 - addl %r13d,%ecx - xorl %r8d,%r15d - addl %ecx,%r10d - vpxor %xmm7,%xmm6,%xmm6 - shrdl $2,%r14d,%r14d - addl %r15d,%ecx - movl %r10d,%r13d - vpsrlq $2,%xmm7,%xmm7 - addl %ecx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%ecx - vpxor %xmm7,%xmm6,%xmm6 - movl %r11d,%r12d - xorl %r10d,%r13d - shrdl $9,%r14d,%r14d - vpshufd $132,%xmm6,%xmm6 - xorl %eax,%r12d - shrdl $5,%r13d,%r13d - xorl %ecx,%r14d - vpsrldq $8,%xmm6,%xmm6 - andl %r10d,%r12d - vpand %xmm13,%xmm11,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 224-128(%rdi),%xmm10 - xorl %r10d,%r13d - addl 56(%rsp),%ebx - vpaddd %xmm6,%xmm3,%xmm3 - movl %ecx,%r15d - shrdl $11,%r14d,%r14d - xorl %eax,%r12d - vpshufd $80,%xmm3,%xmm7 - xorl %edx,%r15d - shrdl $6,%r13d,%r13d - addl %r12d,%ebx - vpsrld $10,%xmm7,%xmm6 - andl %r15d,%esi - xorl %ecx,%r14d - addl %r13d,%ebx - vpsrlq $17,%xmm7,%xmm7 - xorl %edx,%esi - addl %ebx,%r9d - shrdl $2,%r14d,%r14d - vpxor %xmm7,%xmm6,%xmm6 - addl %esi,%ebx - movl %r9d,%r13d - addl %ebx,%r14d - vpsrlq $2,%xmm7,%xmm7 - shrdl $14,%r13d,%r13d - movl %r14d,%ebx - movl %r10d,%r12d - vpxor %xmm7,%xmm6,%xmm6 - xorl %r9d,%r13d - shrdl $9,%r14d,%r14d - xorl %r11d,%r12d - vpshufd $232,%xmm6,%xmm6 - shrdl $5,%r13d,%r13d - xorl %ebx,%r14d - andl %r9d,%r12d - vpslldq $8,%xmm6,%xmm6 - vpor %xmm11,%xmm8,%xmm8 - vaesenclast %xmm10,%xmm9,%xmm11 - vmovdqu 0-128(%rdi),%xmm10 - xorl %r9d,%r13d - addl 60(%rsp),%eax - movl %ebx,%esi - vpaddd %xmm6,%xmm3,%xmm3 - shrdl $11,%r14d,%r14d - xorl %r11d,%r12d - xorl %ecx,%esi - vpaddd 96(%rbp),%xmm3,%xmm6 - shrdl $6,%r13d,%r13d - addl %r12d,%eax - andl %esi,%r15d - xorl %ebx,%r14d - addl %r13d,%eax - xorl %ecx,%r15d - addl %eax,%r8d - shrdl $2,%r14d,%r14d - addl %r15d,%eax - movl %r8d,%r13d - addl %eax,%r14d - vmovdqa %xmm6,48(%rsp) - movq 64+0(%rsp),%r12 - vpand %xmm14,%xmm11,%xmm11 - movq 64+8(%rsp),%r15 - vpor %xmm11,%xmm8,%xmm8 - vmovdqu %xmm8,(%r15,%r12,1) - leaq 16(%r12),%r12 - cmpb $0,131(%rbp) - jne L$avx_00_47 - vmovdqu (%r12),%xmm9 - movq %r12,64+0(%rsp) - shrdl $14,%r13d,%r13d - movl %r14d,%eax - movl %r9d,%r12d - xorl %r8d,%r13d - shrdl $9,%r14d,%r14d - xorl %r10d,%r12d - shrdl $5,%r13d,%r13d - xorl %eax,%r14d - andl %r8d,%r12d - vpxor %xmm10,%xmm9,%xmm9 - vmovdqu 16-128(%rdi),%xmm10 - xorl %r8d,%r13d - addl 0(%rsp),%r11d - movl %eax,%r15d - shrdl $11,%r14d,%r14d - xorl %r10d,%r12d - xorl %ebx,%r15d - shrdl $6,%r13d,%r13d - addl %r12d,%r11d - andl %r15d,%esi - xorl %eax,%r14d - addl %r13d,%r11d - xorl %ebx,%esi - addl %r11d,%edx - shrdl $2,%r14d,%r14d - addl %esi,%r11d - movl %edx,%r13d - addl %r11d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r11d - movl %r8d,%r12d - xorl %edx,%r13d - shrdl $9,%r14d,%r14d - xorl %r9d,%r12d - shrdl $5,%r13d,%r13d - xorl %r11d,%r14d - andl %edx,%r12d - vpxor %xmm8,%xmm9,%xmm9 - xorl %edx,%r13d - addl 4(%rsp),%r10d - movl %r11d,%esi - shrdl $11,%r14d,%r14d - xorl %r9d,%r12d - xorl %eax,%esi - shrdl $6,%r13d,%r13d - addl %r12d,%r10d - andl %esi,%r15d - xorl %r11d,%r14d - addl %r13d,%r10d - xorl %eax,%r15d - addl %r10d,%ecx - shrdl $2,%r14d,%r14d - addl %r15d,%r10d - movl %ecx,%r13d - addl %r10d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r10d - movl %edx,%r12d - xorl %ecx,%r13d - shrdl $9,%r14d,%r14d - xorl %r8d,%r12d - shrdl $5,%r13d,%r13d - xorl %r10d,%r14d - andl %ecx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 32-128(%rdi),%xmm10 - xorl %ecx,%r13d - addl 8(%rsp),%r9d - movl %r10d,%r15d - shrdl $11,%r14d,%r14d - xorl %r8d,%r12d - xorl %r11d,%r15d - shrdl $6,%r13d,%r13d - addl %r12d,%r9d - andl %r15d,%esi - xorl %r10d,%r14d - addl %r13d,%r9d - xorl %r11d,%esi - addl %r9d,%ebx - shrdl $2,%r14d,%r14d - addl %esi,%r9d - movl %ebx,%r13d - addl %r9d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r9d - movl %ecx,%r12d - xorl %ebx,%r13d - shrdl $9,%r14d,%r14d - xorl %edx,%r12d - shrdl $5,%r13d,%r13d - xorl %r9d,%r14d - andl %ebx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 48-128(%rdi),%xmm10 - xorl %ebx,%r13d - addl 12(%rsp),%r8d - movl %r9d,%esi - shrdl $11,%r14d,%r14d - xorl %edx,%r12d - xorl %r10d,%esi - shrdl $6,%r13d,%r13d - addl %r12d,%r8d - andl %esi,%r15d - xorl %r9d,%r14d - addl %r13d,%r8d - xorl %r10d,%r15d - addl %r8d,%eax - shrdl $2,%r14d,%r14d - addl %r15d,%r8d - movl %eax,%r13d - addl %r8d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r8d - movl %ebx,%r12d - xorl %eax,%r13d - shrdl $9,%r14d,%r14d - xorl %ecx,%r12d - shrdl $5,%r13d,%r13d - xorl %r8d,%r14d - andl %eax,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 64-128(%rdi),%xmm10 - xorl %eax,%r13d - addl 16(%rsp),%edx - movl %r8d,%r15d - shrdl $11,%r14d,%r14d - xorl %ecx,%r12d - xorl %r9d,%r15d - shrdl $6,%r13d,%r13d - addl %r12d,%edx - andl %r15d,%esi - xorl %r8d,%r14d - addl %r13d,%edx - xorl %r9d,%esi - addl %edx,%r11d - shrdl $2,%r14d,%r14d - addl %esi,%edx - movl %r11d,%r13d - addl %edx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%edx - movl %eax,%r12d - xorl %r11d,%r13d - shrdl $9,%r14d,%r14d - xorl %ebx,%r12d - shrdl $5,%r13d,%r13d - xorl %edx,%r14d - andl %r11d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 80-128(%rdi),%xmm10 - xorl %r11d,%r13d - addl 20(%rsp),%ecx - movl %edx,%esi - shrdl $11,%r14d,%r14d - xorl %ebx,%r12d - xorl %r8d,%esi - shrdl $6,%r13d,%r13d - addl %r12d,%ecx - andl %esi,%r15d - xorl %edx,%r14d - addl %r13d,%ecx - xorl %r8d,%r15d - addl %ecx,%r10d - shrdl $2,%r14d,%r14d - addl %r15d,%ecx - movl %r10d,%r13d - addl %ecx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%ecx - movl %r11d,%r12d - xorl %r10d,%r13d - shrdl $9,%r14d,%r14d - xorl %eax,%r12d - shrdl $5,%r13d,%r13d - xorl %ecx,%r14d - andl %r10d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 96-128(%rdi),%xmm10 - xorl %r10d,%r13d - addl 24(%rsp),%ebx - movl %ecx,%r15d - shrdl $11,%r14d,%r14d - xorl %eax,%r12d - xorl %edx,%r15d - shrdl $6,%r13d,%r13d - addl %r12d,%ebx - andl %r15d,%esi - xorl %ecx,%r14d - addl %r13d,%ebx - xorl %edx,%esi - addl %ebx,%r9d - shrdl $2,%r14d,%r14d - addl %esi,%ebx - movl %r9d,%r13d - addl %ebx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%ebx - movl %r10d,%r12d - xorl %r9d,%r13d - shrdl $9,%r14d,%r14d - xorl %r11d,%r12d - shrdl $5,%r13d,%r13d - xorl %ebx,%r14d - andl %r9d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 112-128(%rdi),%xmm10 - xorl %r9d,%r13d - addl 28(%rsp),%eax - movl %ebx,%esi - shrdl $11,%r14d,%r14d - xorl %r11d,%r12d - xorl %ecx,%esi - shrdl $6,%r13d,%r13d - addl %r12d,%eax - andl %esi,%r15d - xorl %ebx,%r14d - addl %r13d,%eax - xorl %ecx,%r15d - addl %eax,%r8d - shrdl $2,%r14d,%r14d - addl %r15d,%eax - movl %r8d,%r13d - addl %eax,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%eax - movl %r9d,%r12d - xorl %r8d,%r13d - shrdl $9,%r14d,%r14d - xorl %r10d,%r12d - shrdl $5,%r13d,%r13d - xorl %eax,%r14d - andl %r8d,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 128-128(%rdi),%xmm10 - xorl %r8d,%r13d - addl 32(%rsp),%r11d - movl %eax,%r15d - shrdl $11,%r14d,%r14d - xorl %r10d,%r12d - xorl %ebx,%r15d - shrdl $6,%r13d,%r13d - addl %r12d,%r11d - andl %r15d,%esi - xorl %eax,%r14d - addl %r13d,%r11d - xorl %ebx,%esi - addl %r11d,%edx - shrdl $2,%r14d,%r14d - addl %esi,%r11d - movl %edx,%r13d - addl %r11d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r11d - movl %r8d,%r12d - xorl %edx,%r13d - shrdl $9,%r14d,%r14d - xorl %r9d,%r12d - shrdl $5,%r13d,%r13d - xorl %r11d,%r14d - andl %edx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 144-128(%rdi),%xmm10 - xorl %edx,%r13d - addl 36(%rsp),%r10d - movl %r11d,%esi - shrdl $11,%r14d,%r14d - xorl %r9d,%r12d - xorl %eax,%esi - shrdl $6,%r13d,%r13d - addl %r12d,%r10d - andl %esi,%r15d - xorl %r11d,%r14d - addl %r13d,%r10d - xorl %eax,%r15d - addl %r10d,%ecx - shrdl $2,%r14d,%r14d - addl %r15d,%r10d - movl %ecx,%r13d - addl %r10d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r10d - movl %edx,%r12d - xorl %ecx,%r13d - shrdl $9,%r14d,%r14d - xorl %r8d,%r12d - shrdl $5,%r13d,%r13d - xorl %r10d,%r14d - andl %ecx,%r12d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 160-128(%rdi),%xmm10 - xorl %ecx,%r13d - addl 40(%rsp),%r9d - movl %r10d,%r15d - shrdl $11,%r14d,%r14d - xorl %r8d,%r12d - xorl %r11d,%r15d - shrdl $6,%r13d,%r13d - addl %r12d,%r9d - andl %r15d,%esi - xorl %r10d,%r14d - addl %r13d,%r9d - xorl %r11d,%esi - addl %r9d,%ebx - shrdl $2,%r14d,%r14d - addl %esi,%r9d - movl %ebx,%r13d - addl %r9d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r9d - movl %ecx,%r12d - xorl %ebx,%r13d - shrdl $9,%r14d,%r14d - xorl %edx,%r12d - shrdl $5,%r13d,%r13d - xorl %r9d,%r14d - andl %ebx,%r12d - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 176-128(%rdi),%xmm10 - xorl %ebx,%r13d - addl 44(%rsp),%r8d - movl %r9d,%esi - shrdl $11,%r14d,%r14d - xorl %edx,%r12d - xorl %r10d,%esi - shrdl $6,%r13d,%r13d - addl %r12d,%r8d - andl %esi,%r15d - xorl %r9d,%r14d - addl %r13d,%r8d - xorl %r10d,%r15d - addl %r8d,%eax - shrdl $2,%r14d,%r14d - addl %r15d,%r8d - movl %eax,%r13d - addl %r8d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r8d - movl %ebx,%r12d - xorl %eax,%r13d - shrdl $9,%r14d,%r14d - xorl %ecx,%r12d - shrdl $5,%r13d,%r13d - xorl %r8d,%r14d - andl %eax,%r12d - vpand %xmm12,%xmm11,%xmm8 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 192-128(%rdi),%xmm10 - xorl %eax,%r13d - addl 48(%rsp),%edx - movl %r8d,%r15d - shrdl $11,%r14d,%r14d - xorl %ecx,%r12d - xorl %r9d,%r15d - shrdl $6,%r13d,%r13d - addl %r12d,%edx - andl %r15d,%esi - xorl %r8d,%r14d - addl %r13d,%edx - xorl %r9d,%esi - addl %edx,%r11d - shrdl $2,%r14d,%r14d - addl %esi,%edx - movl %r11d,%r13d - addl %edx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%edx - movl %eax,%r12d - xorl %r11d,%r13d - shrdl $9,%r14d,%r14d - xorl %ebx,%r12d - shrdl $5,%r13d,%r13d - xorl %edx,%r14d - andl %r11d,%r12d - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 208-128(%rdi),%xmm10 - xorl %r11d,%r13d - addl 52(%rsp),%ecx - movl %edx,%esi - shrdl $11,%r14d,%r14d - xorl %ebx,%r12d - xorl %r8d,%esi - shrdl $6,%r13d,%r13d - addl %r12d,%ecx - andl %esi,%r15d - xorl %edx,%r14d - addl %r13d,%ecx - xorl %r8d,%r15d - addl %ecx,%r10d - shrdl $2,%r14d,%r14d - addl %r15d,%ecx - movl %r10d,%r13d - addl %ecx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%ecx - movl %r11d,%r12d - xorl %r10d,%r13d - shrdl $9,%r14d,%r14d - xorl %eax,%r12d - shrdl $5,%r13d,%r13d - xorl %ecx,%r14d - andl %r10d,%r12d - vpand %xmm13,%xmm11,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 224-128(%rdi),%xmm10 - xorl %r10d,%r13d - addl 56(%rsp),%ebx - movl %ecx,%r15d - shrdl $11,%r14d,%r14d - xorl %eax,%r12d - xorl %edx,%r15d - shrdl $6,%r13d,%r13d - addl %r12d,%ebx - andl %r15d,%esi - xorl %ecx,%r14d - addl %r13d,%ebx - xorl %edx,%esi - addl %ebx,%r9d - shrdl $2,%r14d,%r14d - addl %esi,%ebx - movl %r9d,%r13d - addl %ebx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%ebx - movl %r10d,%r12d - xorl %r9d,%r13d - shrdl $9,%r14d,%r14d - xorl %r11d,%r12d - shrdl $5,%r13d,%r13d - xorl %ebx,%r14d - andl %r9d,%r12d - vpor %xmm11,%xmm8,%xmm8 - vaesenclast %xmm10,%xmm9,%xmm11 - vmovdqu 0-128(%rdi),%xmm10 - xorl %r9d,%r13d - addl 60(%rsp),%eax - movl %ebx,%esi - shrdl $11,%r14d,%r14d - xorl %r11d,%r12d - xorl %ecx,%esi - shrdl $6,%r13d,%r13d - addl %r12d,%eax - andl %esi,%r15d - xorl %ebx,%r14d - addl %r13d,%eax - xorl %ecx,%r15d - addl %eax,%r8d - shrdl $2,%r14d,%r14d - addl %r15d,%eax - movl %r8d,%r13d - addl %eax,%r14d - movq 64+0(%rsp),%r12 - movq 64+8(%rsp),%r13 - movq 64+40(%rsp),%r15 - movq 64+48(%rsp),%rsi - - vpand %xmm14,%xmm11,%xmm11 - movl %r14d,%eax - vpor %xmm11,%xmm8,%xmm8 - vmovdqu %xmm8,(%r12,%r13,1) - leaq 16(%r12),%r12 - - addl 0(%r15),%eax - addl 4(%r15),%ebx - addl 8(%r15),%ecx - addl 12(%r15),%edx - addl 16(%r15),%r8d - addl 20(%r15),%r9d - addl 24(%r15),%r10d - addl 28(%r15),%r11d - - cmpq 64+16(%rsp),%r12 - - movl %eax,0(%r15) - movl %ebx,4(%r15) - movl %ecx,8(%r15) - movl %edx,12(%r15) - movl %r8d,16(%r15) - movl %r9d,20(%r15) - movl %r10d,24(%r15) - movl %r11d,28(%r15) - jb L$loop_avx - - movq 64+32(%rsp),%r8 - movq 64+56(%rsp),%rsi - vmovdqu %xmm8,(%r8) - vzeroall - movq (%rsi),%r15 - movq 8(%rsi),%r14 - movq 16(%rsi),%r13 - movq 24(%rsi),%r12 - movq 32(%rsi),%rbp - movq 40(%rsi),%rbx - leaq 48(%rsi),%rsp -L$epilogue_avx: - .byte 0xf3,0xc3 - - -.p2align 6 -aesni_cbc_sha256_enc_avx2: -L$avx2_shortcut: - movq 8(%rsp),%r10 - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - movq %rsp,%r11 - subq $576,%rsp - andq $-1024,%rsp - addq $448,%rsp - - shlq $6,%rdx - subq %rdi,%rsi - subq %rdi,%r10 - addq %rdi,%rdx - - - - movq %rdx,64+16(%rsp) - - movq %r8,64+32(%rsp) - movq %r9,64+40(%rsp) - movq %r10,64+48(%rsp) - movq %r11,64+56(%rsp) -L$prologue_avx2: - vzeroall - - movq %rdi,%r13 - vpinsrq $1,%rsi,%xmm15,%xmm15 - leaq 128(%rcx),%rdi - leaq K256+544(%rip),%r12 - movl 240-128(%rdi),%r14d - movq %r9,%r15 - movq %r10,%rsi - vmovdqu (%r8),%xmm8 - leaq -9(%r14),%r14 - - vmovdqa 0(%r12,%r14,8),%xmm14 - vmovdqa 16(%r12,%r14,8),%xmm13 - vmovdqa 32(%r12,%r14,8),%xmm12 - - subq $-64,%r13 - movl 0(%r15),%eax - leaq (%rsi,%r13,1),%r12 - movl 4(%r15),%ebx - cmpq %rdx,%r13 - movl 8(%r15),%ecx - cmoveq %rsp,%r12 - movl 12(%r15),%edx - movl 16(%r15),%r8d - movl 20(%r15),%r9d - movl 24(%r15),%r10d - movl 28(%r15),%r11d - vmovdqu 0-128(%rdi),%xmm10 - jmp L$oop_avx2 -.p2align 4 -L$oop_avx2: - vmovdqa K256+512(%rip),%ymm7 - vmovdqu -64+0(%rsi,%r13,1),%xmm0 - vmovdqu -64+16(%rsi,%r13,1),%xmm1 - vmovdqu -64+32(%rsi,%r13,1),%xmm2 - vmovdqu -64+48(%rsi,%r13,1),%xmm3 - - vinserti128 $1,(%r12),%ymm0,%ymm0 - vinserti128 $1,16(%r12),%ymm1,%ymm1 - vpshufb %ymm7,%ymm0,%ymm0 - vinserti128 $1,32(%r12),%ymm2,%ymm2 - vpshufb %ymm7,%ymm1,%ymm1 - vinserti128 $1,48(%r12),%ymm3,%ymm3 - - leaq K256(%rip),%rbp - vpshufb %ymm7,%ymm2,%ymm2 - leaq -64(%r13),%r13 - vpaddd 0(%rbp),%ymm0,%ymm4 - vpshufb %ymm7,%ymm3,%ymm3 - vpaddd 32(%rbp),%ymm1,%ymm5 - vpaddd 64(%rbp),%ymm2,%ymm6 - vpaddd 96(%rbp),%ymm3,%ymm7 - vmovdqa %ymm4,0(%rsp) - xorl %r14d,%r14d - vmovdqa %ymm5,32(%rsp) - leaq -64(%rsp),%rsp - movl %ebx,%esi - vmovdqa %ymm6,0(%rsp) - xorl %ecx,%esi - vmovdqa %ymm7,32(%rsp) - movl %r9d,%r12d - subq $-32*4,%rbp - jmp L$avx2_00_47 - -.p2align 4 -L$avx2_00_47: - vmovdqu (%r13),%xmm9 - vpinsrq $0,%r13,%xmm15,%xmm15 - leaq -64(%rsp),%rsp - vpalignr $4,%ymm0,%ymm1,%ymm4 - addl 0+128(%rsp),%r11d - andl %r8d,%r12d - rorxl $25,%r8d,%r13d - vpalignr $4,%ymm2,%ymm3,%ymm7 - rorxl $11,%r8d,%r15d - leal (%rax,%r14,1),%eax - leal (%r11,%r12,1),%r11d - vpsrld $7,%ymm4,%ymm6 - andnl %r10d,%r8d,%r12d - xorl %r15d,%r13d - rorxl $6,%r8d,%r14d - vpaddd %ymm7,%ymm0,%ymm0 - leal (%r11,%r12,1),%r11d - xorl %r14d,%r13d - movl %eax,%r15d - vpsrld $3,%ymm4,%ymm7 - rorxl $22,%eax,%r12d - leal (%r11,%r13,1),%r11d - xorl %ebx,%r15d - vpslld $14,%ymm4,%ymm5 - rorxl $13,%eax,%r14d - rorxl $2,%eax,%r13d - leal (%rdx,%r11,1),%edx - vpxor %ymm6,%ymm7,%ymm4 - andl %r15d,%esi - vpxor %xmm10,%xmm9,%xmm9 - vmovdqu 16-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %ebx,%esi - vpshufd $250,%ymm3,%ymm7 - xorl %r13d,%r14d - leal (%r11,%rsi,1),%r11d - movl %r8d,%r12d - vpsrld $11,%ymm6,%ymm6 - addl 4+128(%rsp),%r10d - andl %edx,%r12d - rorxl $25,%edx,%r13d - vpxor %ymm5,%ymm4,%ymm4 - rorxl $11,%edx,%esi - leal (%r11,%r14,1),%r11d - leal (%r10,%r12,1),%r10d - vpslld $11,%ymm5,%ymm5 - andnl %r9d,%edx,%r12d - xorl %esi,%r13d - rorxl $6,%edx,%r14d - vpxor %ymm6,%ymm4,%ymm4 - leal (%r10,%r12,1),%r10d - xorl %r14d,%r13d - movl %r11d,%esi - vpsrld $10,%ymm7,%ymm6 - rorxl $22,%r11d,%r12d - leal (%r10,%r13,1),%r10d - xorl %eax,%esi - vpxor %ymm5,%ymm4,%ymm4 - rorxl $13,%r11d,%r14d - rorxl $2,%r11d,%r13d - leal (%rcx,%r10,1),%ecx - vpsrlq $17,%ymm7,%ymm7 - andl %esi,%r15d - vpxor %xmm8,%xmm9,%xmm9 - xorl %r12d,%r14d - xorl %eax,%r15d - vpaddd %ymm4,%ymm0,%ymm0 - xorl %r13d,%r14d - leal (%r10,%r15,1),%r10d - movl %edx,%r12d - vpxor %ymm7,%ymm6,%ymm6 - addl 8+128(%rsp),%r9d - andl %ecx,%r12d - rorxl $25,%ecx,%r13d - vpsrlq $2,%ymm7,%ymm7 - rorxl $11,%ecx,%r15d - leal (%r10,%r14,1),%r10d - leal (%r9,%r12,1),%r9d - vpxor %ymm7,%ymm6,%ymm6 - andnl %r8d,%ecx,%r12d - xorl %r15d,%r13d - rorxl $6,%ecx,%r14d - vpshufd $132,%ymm6,%ymm6 - leal (%r9,%r12,1),%r9d - xorl %r14d,%r13d - movl %r10d,%r15d - vpsrldq $8,%ymm6,%ymm6 - rorxl $22,%r10d,%r12d - leal (%r9,%r13,1),%r9d - xorl %r11d,%r15d - vpaddd %ymm6,%ymm0,%ymm0 - rorxl $13,%r10d,%r14d - rorxl $2,%r10d,%r13d - leal (%rbx,%r9,1),%ebx - vpshufd $80,%ymm0,%ymm7 - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 32-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r11d,%esi - vpsrld $10,%ymm7,%ymm6 - xorl %r13d,%r14d - leal (%r9,%rsi,1),%r9d - movl %ecx,%r12d - vpsrlq $17,%ymm7,%ymm7 - addl 12+128(%rsp),%r8d - andl %ebx,%r12d - rorxl $25,%ebx,%r13d - vpxor %ymm7,%ymm6,%ymm6 - rorxl $11,%ebx,%esi - leal (%r9,%r14,1),%r9d - leal (%r8,%r12,1),%r8d - vpsrlq $2,%ymm7,%ymm7 - andnl %edx,%ebx,%r12d - xorl %esi,%r13d - rorxl $6,%ebx,%r14d - vpxor %ymm7,%ymm6,%ymm6 - leal (%r8,%r12,1),%r8d - xorl %r14d,%r13d - movl %r9d,%esi - vpshufd $232,%ymm6,%ymm6 - rorxl $22,%r9d,%r12d - leal (%r8,%r13,1),%r8d - xorl %r10d,%esi - vpslldq $8,%ymm6,%ymm6 - rorxl $13,%r9d,%r14d - rorxl $2,%r9d,%r13d - leal (%rax,%r8,1),%eax - vpaddd %ymm6,%ymm0,%ymm0 - andl %esi,%r15d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 48-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r10d,%r15d - vpaddd 0(%rbp),%ymm0,%ymm6 - xorl %r13d,%r14d - leal (%r8,%r15,1),%r8d - movl %ebx,%r12d - vmovdqa %ymm6,0(%rsp) - vpalignr $4,%ymm1,%ymm2,%ymm4 - addl 32+128(%rsp),%edx - andl %eax,%r12d - rorxl $25,%eax,%r13d - vpalignr $4,%ymm3,%ymm0,%ymm7 - rorxl $11,%eax,%r15d - leal (%r8,%r14,1),%r8d - leal (%rdx,%r12,1),%edx - vpsrld $7,%ymm4,%ymm6 - andnl %ecx,%eax,%r12d - xorl %r15d,%r13d - rorxl $6,%eax,%r14d - vpaddd %ymm7,%ymm1,%ymm1 - leal (%rdx,%r12,1),%edx - xorl %r14d,%r13d - movl %r8d,%r15d - vpsrld $3,%ymm4,%ymm7 - rorxl $22,%r8d,%r12d - leal (%rdx,%r13,1),%edx - xorl %r9d,%r15d - vpslld $14,%ymm4,%ymm5 - rorxl $13,%r8d,%r14d - rorxl $2,%r8d,%r13d - leal (%r11,%rdx,1),%r11d - vpxor %ymm6,%ymm7,%ymm4 - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 64-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r9d,%esi - vpshufd $250,%ymm0,%ymm7 - xorl %r13d,%r14d - leal (%rdx,%rsi,1),%edx - movl %eax,%r12d - vpsrld $11,%ymm6,%ymm6 - addl 36+128(%rsp),%ecx - andl %r11d,%r12d - rorxl $25,%r11d,%r13d - vpxor %ymm5,%ymm4,%ymm4 - rorxl $11,%r11d,%esi - leal (%rdx,%r14,1),%edx - leal (%rcx,%r12,1),%ecx - vpslld $11,%ymm5,%ymm5 - andnl %ebx,%r11d,%r12d - xorl %esi,%r13d - rorxl $6,%r11d,%r14d - vpxor %ymm6,%ymm4,%ymm4 - leal (%rcx,%r12,1),%ecx - xorl %r14d,%r13d - movl %edx,%esi - vpsrld $10,%ymm7,%ymm6 - rorxl $22,%edx,%r12d - leal (%rcx,%r13,1),%ecx - xorl %r8d,%esi - vpxor %ymm5,%ymm4,%ymm4 - rorxl $13,%edx,%r14d - rorxl $2,%edx,%r13d - leal (%r10,%rcx,1),%r10d - vpsrlq $17,%ymm7,%ymm7 - andl %esi,%r15d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 80-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r8d,%r15d - vpaddd %ymm4,%ymm1,%ymm1 - xorl %r13d,%r14d - leal (%rcx,%r15,1),%ecx - movl %r11d,%r12d - vpxor %ymm7,%ymm6,%ymm6 - addl 40+128(%rsp),%ebx - andl %r10d,%r12d - rorxl $25,%r10d,%r13d - vpsrlq $2,%ymm7,%ymm7 - rorxl $11,%r10d,%r15d - leal (%rcx,%r14,1),%ecx - leal (%rbx,%r12,1),%ebx - vpxor %ymm7,%ymm6,%ymm6 - andnl %eax,%r10d,%r12d - xorl %r15d,%r13d - rorxl $6,%r10d,%r14d - vpshufd $132,%ymm6,%ymm6 - leal (%rbx,%r12,1),%ebx - xorl %r14d,%r13d - movl %ecx,%r15d - vpsrldq $8,%ymm6,%ymm6 - rorxl $22,%ecx,%r12d - leal (%rbx,%r13,1),%ebx - xorl %edx,%r15d - vpaddd %ymm6,%ymm1,%ymm1 - rorxl $13,%ecx,%r14d - rorxl $2,%ecx,%r13d - leal (%r9,%rbx,1),%r9d - vpshufd $80,%ymm1,%ymm7 - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 96-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %edx,%esi - vpsrld $10,%ymm7,%ymm6 - xorl %r13d,%r14d - leal (%rbx,%rsi,1),%ebx - movl %r10d,%r12d - vpsrlq $17,%ymm7,%ymm7 - addl 44+128(%rsp),%eax - andl %r9d,%r12d - rorxl $25,%r9d,%r13d - vpxor %ymm7,%ymm6,%ymm6 - rorxl $11,%r9d,%esi - leal (%rbx,%r14,1),%ebx - leal (%rax,%r12,1),%eax - vpsrlq $2,%ymm7,%ymm7 - andnl %r11d,%r9d,%r12d - xorl %esi,%r13d - rorxl $6,%r9d,%r14d - vpxor %ymm7,%ymm6,%ymm6 - leal (%rax,%r12,1),%eax - xorl %r14d,%r13d - movl %ebx,%esi - vpshufd $232,%ymm6,%ymm6 - rorxl $22,%ebx,%r12d - leal (%rax,%r13,1),%eax - xorl %ecx,%esi - vpslldq $8,%ymm6,%ymm6 - rorxl $13,%ebx,%r14d - rorxl $2,%ebx,%r13d - leal (%r8,%rax,1),%r8d - vpaddd %ymm6,%ymm1,%ymm1 - andl %esi,%r15d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 112-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %ecx,%r15d - vpaddd 32(%rbp),%ymm1,%ymm6 - xorl %r13d,%r14d - leal (%rax,%r15,1),%eax - movl %r9d,%r12d - vmovdqa %ymm6,32(%rsp) - leaq -64(%rsp),%rsp - vpalignr $4,%ymm2,%ymm3,%ymm4 - addl 0+128(%rsp),%r11d - andl %r8d,%r12d - rorxl $25,%r8d,%r13d - vpalignr $4,%ymm0,%ymm1,%ymm7 - rorxl $11,%r8d,%r15d - leal (%rax,%r14,1),%eax - leal (%r11,%r12,1),%r11d - vpsrld $7,%ymm4,%ymm6 - andnl %r10d,%r8d,%r12d - xorl %r15d,%r13d - rorxl $6,%r8d,%r14d - vpaddd %ymm7,%ymm2,%ymm2 - leal (%r11,%r12,1),%r11d - xorl %r14d,%r13d - movl %eax,%r15d - vpsrld $3,%ymm4,%ymm7 - rorxl $22,%eax,%r12d - leal (%r11,%r13,1),%r11d - xorl %ebx,%r15d - vpslld $14,%ymm4,%ymm5 - rorxl $13,%eax,%r14d - rorxl $2,%eax,%r13d - leal (%rdx,%r11,1),%edx - vpxor %ymm6,%ymm7,%ymm4 - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 128-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %ebx,%esi - vpshufd $250,%ymm1,%ymm7 - xorl %r13d,%r14d - leal (%r11,%rsi,1),%r11d - movl %r8d,%r12d - vpsrld $11,%ymm6,%ymm6 - addl 4+128(%rsp),%r10d - andl %edx,%r12d - rorxl $25,%edx,%r13d - vpxor %ymm5,%ymm4,%ymm4 - rorxl $11,%edx,%esi - leal (%r11,%r14,1),%r11d - leal (%r10,%r12,1),%r10d - vpslld $11,%ymm5,%ymm5 - andnl %r9d,%edx,%r12d - xorl %esi,%r13d - rorxl $6,%edx,%r14d - vpxor %ymm6,%ymm4,%ymm4 - leal (%r10,%r12,1),%r10d - xorl %r14d,%r13d - movl %r11d,%esi - vpsrld $10,%ymm7,%ymm6 - rorxl $22,%r11d,%r12d - leal (%r10,%r13,1),%r10d - xorl %eax,%esi - vpxor %ymm5,%ymm4,%ymm4 - rorxl $13,%r11d,%r14d - rorxl $2,%r11d,%r13d - leal (%rcx,%r10,1),%ecx - vpsrlq $17,%ymm7,%ymm7 - andl %esi,%r15d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 144-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %eax,%r15d - vpaddd %ymm4,%ymm2,%ymm2 - xorl %r13d,%r14d - leal (%r10,%r15,1),%r10d - movl %edx,%r12d - vpxor %ymm7,%ymm6,%ymm6 - addl 8+128(%rsp),%r9d - andl %ecx,%r12d - rorxl $25,%ecx,%r13d - vpsrlq $2,%ymm7,%ymm7 - rorxl $11,%ecx,%r15d - leal (%r10,%r14,1),%r10d - leal (%r9,%r12,1),%r9d - vpxor %ymm7,%ymm6,%ymm6 - andnl %r8d,%ecx,%r12d - xorl %r15d,%r13d - rorxl $6,%ecx,%r14d - vpshufd $132,%ymm6,%ymm6 - leal (%r9,%r12,1),%r9d - xorl %r14d,%r13d - movl %r10d,%r15d - vpsrldq $8,%ymm6,%ymm6 - rorxl $22,%r10d,%r12d - leal (%r9,%r13,1),%r9d - xorl %r11d,%r15d - vpaddd %ymm6,%ymm2,%ymm2 - rorxl $13,%r10d,%r14d - rorxl $2,%r10d,%r13d - leal (%rbx,%r9,1),%ebx - vpshufd $80,%ymm2,%ymm7 - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 160-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r11d,%esi - vpsrld $10,%ymm7,%ymm6 - xorl %r13d,%r14d - leal (%r9,%rsi,1),%r9d - movl %ecx,%r12d - vpsrlq $17,%ymm7,%ymm7 - addl 12+128(%rsp),%r8d - andl %ebx,%r12d - rorxl $25,%ebx,%r13d - vpxor %ymm7,%ymm6,%ymm6 - rorxl $11,%ebx,%esi - leal (%r9,%r14,1),%r9d - leal (%r8,%r12,1),%r8d - vpsrlq $2,%ymm7,%ymm7 - andnl %edx,%ebx,%r12d - xorl %esi,%r13d - rorxl $6,%ebx,%r14d - vpxor %ymm7,%ymm6,%ymm6 - leal (%r8,%r12,1),%r8d - xorl %r14d,%r13d - movl %r9d,%esi - vpshufd $232,%ymm6,%ymm6 - rorxl $22,%r9d,%r12d - leal (%r8,%r13,1),%r8d - xorl %r10d,%esi - vpslldq $8,%ymm6,%ymm6 - rorxl $13,%r9d,%r14d - rorxl $2,%r9d,%r13d - leal (%rax,%r8,1),%eax - vpaddd %ymm6,%ymm2,%ymm2 - andl %esi,%r15d - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 176-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r10d,%r15d - vpaddd 64(%rbp),%ymm2,%ymm6 - xorl %r13d,%r14d - leal (%r8,%r15,1),%r8d - movl %ebx,%r12d - vmovdqa %ymm6,0(%rsp) - vpalignr $4,%ymm3,%ymm0,%ymm4 - addl 32+128(%rsp),%edx - andl %eax,%r12d - rorxl $25,%eax,%r13d - vpalignr $4,%ymm1,%ymm2,%ymm7 - rorxl $11,%eax,%r15d - leal (%r8,%r14,1),%r8d - leal (%rdx,%r12,1),%edx - vpsrld $7,%ymm4,%ymm6 - andnl %ecx,%eax,%r12d - xorl %r15d,%r13d - rorxl $6,%eax,%r14d - vpaddd %ymm7,%ymm3,%ymm3 - leal (%rdx,%r12,1),%edx - xorl %r14d,%r13d - movl %r8d,%r15d - vpsrld $3,%ymm4,%ymm7 - rorxl $22,%r8d,%r12d - leal (%rdx,%r13,1),%edx - xorl %r9d,%r15d - vpslld $14,%ymm4,%ymm5 - rorxl $13,%r8d,%r14d - rorxl $2,%r8d,%r13d - leal (%r11,%rdx,1),%r11d - vpxor %ymm6,%ymm7,%ymm4 - andl %r15d,%esi - vpand %xmm12,%xmm11,%xmm8 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 192-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r9d,%esi - vpshufd $250,%ymm2,%ymm7 - xorl %r13d,%r14d - leal (%rdx,%rsi,1),%edx - movl %eax,%r12d - vpsrld $11,%ymm6,%ymm6 - addl 36+128(%rsp),%ecx - andl %r11d,%r12d - rorxl $25,%r11d,%r13d - vpxor %ymm5,%ymm4,%ymm4 - rorxl $11,%r11d,%esi - leal (%rdx,%r14,1),%edx - leal (%rcx,%r12,1),%ecx - vpslld $11,%ymm5,%ymm5 - andnl %ebx,%r11d,%r12d - xorl %esi,%r13d - rorxl $6,%r11d,%r14d - vpxor %ymm6,%ymm4,%ymm4 - leal (%rcx,%r12,1),%ecx - xorl %r14d,%r13d - movl %edx,%esi - vpsrld $10,%ymm7,%ymm6 - rorxl $22,%edx,%r12d - leal (%rcx,%r13,1),%ecx - xorl %r8d,%esi - vpxor %ymm5,%ymm4,%ymm4 - rorxl $13,%edx,%r14d - rorxl $2,%edx,%r13d - leal (%r10,%rcx,1),%r10d - vpsrlq $17,%ymm7,%ymm7 - andl %esi,%r15d - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 208-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r8d,%r15d - vpaddd %ymm4,%ymm3,%ymm3 - xorl %r13d,%r14d - leal (%rcx,%r15,1),%ecx - movl %r11d,%r12d - vpxor %ymm7,%ymm6,%ymm6 - addl 40+128(%rsp),%ebx - andl %r10d,%r12d - rorxl $25,%r10d,%r13d - vpsrlq $2,%ymm7,%ymm7 - rorxl $11,%r10d,%r15d - leal (%rcx,%r14,1),%ecx - leal (%rbx,%r12,1),%ebx - vpxor %ymm7,%ymm6,%ymm6 - andnl %eax,%r10d,%r12d - xorl %r15d,%r13d - rorxl $6,%r10d,%r14d - vpshufd $132,%ymm6,%ymm6 - leal (%rbx,%r12,1),%ebx - xorl %r14d,%r13d - movl %ecx,%r15d - vpsrldq $8,%ymm6,%ymm6 - rorxl $22,%ecx,%r12d - leal (%rbx,%r13,1),%ebx - xorl %edx,%r15d - vpaddd %ymm6,%ymm3,%ymm3 - rorxl $13,%ecx,%r14d - rorxl $2,%ecx,%r13d - leal (%r9,%rbx,1),%r9d - vpshufd $80,%ymm3,%ymm7 - andl %r15d,%esi - vpand %xmm13,%xmm11,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 224-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %edx,%esi - vpsrld $10,%ymm7,%ymm6 - xorl %r13d,%r14d - leal (%rbx,%rsi,1),%ebx - movl %r10d,%r12d - vpsrlq $17,%ymm7,%ymm7 - addl 44+128(%rsp),%eax - andl %r9d,%r12d - rorxl $25,%r9d,%r13d - vpxor %ymm7,%ymm6,%ymm6 - rorxl $11,%r9d,%esi - leal (%rbx,%r14,1),%ebx - leal (%rax,%r12,1),%eax - vpsrlq $2,%ymm7,%ymm7 - andnl %r11d,%r9d,%r12d - xorl %esi,%r13d - rorxl $6,%r9d,%r14d - vpxor %ymm7,%ymm6,%ymm6 - leal (%rax,%r12,1),%eax - xorl %r14d,%r13d - movl %ebx,%esi - vpshufd $232,%ymm6,%ymm6 - rorxl $22,%ebx,%r12d - leal (%rax,%r13,1),%eax - xorl %ecx,%esi - vpslldq $8,%ymm6,%ymm6 - rorxl $13,%ebx,%r14d - rorxl $2,%ebx,%r13d - leal (%r8,%rax,1),%r8d - vpaddd %ymm6,%ymm3,%ymm3 - andl %esi,%r15d - vpor %xmm11,%xmm8,%xmm8 - vaesenclast %xmm10,%xmm9,%xmm11 - vmovdqu 0-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %ecx,%r15d - vpaddd 96(%rbp),%ymm3,%ymm6 - xorl %r13d,%r14d - leal (%rax,%r15,1),%eax - movl %r9d,%r12d - vmovdqa %ymm6,32(%rsp) - vmovq %xmm15,%r13 - vpextrq $1,%xmm15,%r15 - vpand %xmm14,%xmm11,%xmm11 - vpor %xmm11,%xmm8,%xmm8 - vmovdqu %xmm8,(%r15,%r13,1) - leaq 16(%r13),%r13 - leaq 128(%rbp),%rbp - cmpb $0,3(%rbp) - jne L$avx2_00_47 - vmovdqu (%r13),%xmm9 - vpinsrq $0,%r13,%xmm15,%xmm15 - addl 0+64(%rsp),%r11d - andl %r8d,%r12d - rorxl $25,%r8d,%r13d - rorxl $11,%r8d,%r15d - leal (%rax,%r14,1),%eax - leal (%r11,%r12,1),%r11d - andnl %r10d,%r8d,%r12d - xorl %r15d,%r13d - rorxl $6,%r8d,%r14d - leal (%r11,%r12,1),%r11d - xorl %r14d,%r13d - movl %eax,%r15d - rorxl $22,%eax,%r12d - leal (%r11,%r13,1),%r11d - xorl %ebx,%r15d - rorxl $13,%eax,%r14d - rorxl $2,%eax,%r13d - leal (%rdx,%r11,1),%edx - andl %r15d,%esi - vpxor %xmm10,%xmm9,%xmm9 - vmovdqu 16-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %ebx,%esi - xorl %r13d,%r14d - leal (%r11,%rsi,1),%r11d - movl %r8d,%r12d - addl 4+64(%rsp),%r10d - andl %edx,%r12d - rorxl $25,%edx,%r13d - rorxl $11,%edx,%esi - leal (%r11,%r14,1),%r11d - leal (%r10,%r12,1),%r10d - andnl %r9d,%edx,%r12d - xorl %esi,%r13d - rorxl $6,%edx,%r14d - leal (%r10,%r12,1),%r10d - xorl %r14d,%r13d - movl %r11d,%esi - rorxl $22,%r11d,%r12d - leal (%r10,%r13,1),%r10d - xorl %eax,%esi - rorxl $13,%r11d,%r14d - rorxl $2,%r11d,%r13d - leal (%rcx,%r10,1),%ecx - andl %esi,%r15d - vpxor %xmm8,%xmm9,%xmm9 - xorl %r12d,%r14d - xorl %eax,%r15d - xorl %r13d,%r14d - leal (%r10,%r15,1),%r10d - movl %edx,%r12d - addl 8+64(%rsp),%r9d - andl %ecx,%r12d - rorxl $25,%ecx,%r13d - rorxl $11,%ecx,%r15d - leal (%r10,%r14,1),%r10d - leal (%r9,%r12,1),%r9d - andnl %r8d,%ecx,%r12d - xorl %r15d,%r13d - rorxl $6,%ecx,%r14d - leal (%r9,%r12,1),%r9d - xorl %r14d,%r13d - movl %r10d,%r15d - rorxl $22,%r10d,%r12d - leal (%r9,%r13,1),%r9d - xorl %r11d,%r15d - rorxl $13,%r10d,%r14d - rorxl $2,%r10d,%r13d - leal (%rbx,%r9,1),%ebx - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 32-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r11d,%esi - xorl %r13d,%r14d - leal (%r9,%rsi,1),%r9d - movl %ecx,%r12d - addl 12+64(%rsp),%r8d - andl %ebx,%r12d - rorxl $25,%ebx,%r13d - rorxl $11,%ebx,%esi - leal (%r9,%r14,1),%r9d - leal (%r8,%r12,1),%r8d - andnl %edx,%ebx,%r12d - xorl %esi,%r13d - rorxl $6,%ebx,%r14d - leal (%r8,%r12,1),%r8d - xorl %r14d,%r13d - movl %r9d,%esi - rorxl $22,%r9d,%r12d - leal (%r8,%r13,1),%r8d - xorl %r10d,%esi - rorxl $13,%r9d,%r14d - rorxl $2,%r9d,%r13d - leal (%rax,%r8,1),%eax - andl %esi,%r15d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 48-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r10d,%r15d - xorl %r13d,%r14d - leal (%r8,%r15,1),%r8d - movl %ebx,%r12d - addl 32+64(%rsp),%edx - andl %eax,%r12d - rorxl $25,%eax,%r13d - rorxl $11,%eax,%r15d - leal (%r8,%r14,1),%r8d - leal (%rdx,%r12,1),%edx - andnl %ecx,%eax,%r12d - xorl %r15d,%r13d - rorxl $6,%eax,%r14d - leal (%rdx,%r12,1),%edx - xorl %r14d,%r13d - movl %r8d,%r15d - rorxl $22,%r8d,%r12d - leal (%rdx,%r13,1),%edx - xorl %r9d,%r15d - rorxl $13,%r8d,%r14d - rorxl $2,%r8d,%r13d - leal (%r11,%rdx,1),%r11d - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 64-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r9d,%esi - xorl %r13d,%r14d - leal (%rdx,%rsi,1),%edx - movl %eax,%r12d - addl 36+64(%rsp),%ecx - andl %r11d,%r12d - rorxl $25,%r11d,%r13d - rorxl $11,%r11d,%esi - leal (%rdx,%r14,1),%edx - leal (%rcx,%r12,1),%ecx - andnl %ebx,%r11d,%r12d - xorl %esi,%r13d - rorxl $6,%r11d,%r14d - leal (%rcx,%r12,1),%ecx - xorl %r14d,%r13d - movl %edx,%esi - rorxl $22,%edx,%r12d - leal (%rcx,%r13,1),%ecx - xorl %r8d,%esi - rorxl $13,%edx,%r14d - rorxl $2,%edx,%r13d - leal (%r10,%rcx,1),%r10d - andl %esi,%r15d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 80-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r8d,%r15d - xorl %r13d,%r14d - leal (%rcx,%r15,1),%ecx - movl %r11d,%r12d - addl 40+64(%rsp),%ebx - andl %r10d,%r12d - rorxl $25,%r10d,%r13d - rorxl $11,%r10d,%r15d - leal (%rcx,%r14,1),%ecx - leal (%rbx,%r12,1),%ebx - andnl %eax,%r10d,%r12d - xorl %r15d,%r13d - rorxl $6,%r10d,%r14d - leal (%rbx,%r12,1),%ebx - xorl %r14d,%r13d - movl %ecx,%r15d - rorxl $22,%ecx,%r12d - leal (%rbx,%r13,1),%ebx - xorl %edx,%r15d - rorxl $13,%ecx,%r14d - rorxl $2,%ecx,%r13d - leal (%r9,%rbx,1),%r9d - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 96-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %edx,%esi - xorl %r13d,%r14d - leal (%rbx,%rsi,1),%ebx - movl %r10d,%r12d - addl 44+64(%rsp),%eax - andl %r9d,%r12d - rorxl $25,%r9d,%r13d - rorxl $11,%r9d,%esi - leal (%rbx,%r14,1),%ebx - leal (%rax,%r12,1),%eax - andnl %r11d,%r9d,%r12d - xorl %esi,%r13d - rorxl $6,%r9d,%r14d - leal (%rax,%r12,1),%eax - xorl %r14d,%r13d - movl %ebx,%esi - rorxl $22,%ebx,%r12d - leal (%rax,%r13,1),%eax - xorl %ecx,%esi - rorxl $13,%ebx,%r14d - rorxl $2,%ebx,%r13d - leal (%r8,%rax,1),%r8d - andl %esi,%r15d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 112-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %ecx,%r15d - xorl %r13d,%r14d - leal (%rax,%r15,1),%eax - movl %r9d,%r12d - addl 0(%rsp),%r11d - andl %r8d,%r12d - rorxl $25,%r8d,%r13d - rorxl $11,%r8d,%r15d - leal (%rax,%r14,1),%eax - leal (%r11,%r12,1),%r11d - andnl %r10d,%r8d,%r12d - xorl %r15d,%r13d - rorxl $6,%r8d,%r14d - leal (%r11,%r12,1),%r11d - xorl %r14d,%r13d - movl %eax,%r15d - rorxl $22,%eax,%r12d - leal (%r11,%r13,1),%r11d - xorl %ebx,%r15d - rorxl $13,%eax,%r14d - rorxl $2,%eax,%r13d - leal (%rdx,%r11,1),%edx - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 128-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %ebx,%esi - xorl %r13d,%r14d - leal (%r11,%rsi,1),%r11d - movl %r8d,%r12d - addl 4(%rsp),%r10d - andl %edx,%r12d - rorxl $25,%edx,%r13d - rorxl $11,%edx,%esi - leal (%r11,%r14,1),%r11d - leal (%r10,%r12,1),%r10d - andnl %r9d,%edx,%r12d - xorl %esi,%r13d - rorxl $6,%edx,%r14d - leal (%r10,%r12,1),%r10d - xorl %r14d,%r13d - movl %r11d,%esi - rorxl $22,%r11d,%r12d - leal (%r10,%r13,1),%r10d - xorl %eax,%esi - rorxl $13,%r11d,%r14d - rorxl $2,%r11d,%r13d - leal (%rcx,%r10,1),%ecx - andl %esi,%r15d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 144-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %eax,%r15d - xorl %r13d,%r14d - leal (%r10,%r15,1),%r10d - movl %edx,%r12d - addl 8(%rsp),%r9d - andl %ecx,%r12d - rorxl $25,%ecx,%r13d - rorxl $11,%ecx,%r15d - leal (%r10,%r14,1),%r10d - leal (%r9,%r12,1),%r9d - andnl %r8d,%ecx,%r12d - xorl %r15d,%r13d - rorxl $6,%ecx,%r14d - leal (%r9,%r12,1),%r9d - xorl %r14d,%r13d - movl %r10d,%r15d - rorxl $22,%r10d,%r12d - leal (%r9,%r13,1),%r9d - xorl %r11d,%r15d - rorxl $13,%r10d,%r14d - rorxl $2,%r10d,%r13d - leal (%rbx,%r9,1),%ebx - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 160-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r11d,%esi - xorl %r13d,%r14d - leal (%r9,%rsi,1),%r9d - movl %ecx,%r12d - addl 12(%rsp),%r8d - andl %ebx,%r12d - rorxl $25,%ebx,%r13d - rorxl $11,%ebx,%esi - leal (%r9,%r14,1),%r9d - leal (%r8,%r12,1),%r8d - andnl %edx,%ebx,%r12d - xorl %esi,%r13d - rorxl $6,%ebx,%r14d - leal (%r8,%r12,1),%r8d - xorl %r14d,%r13d - movl %r9d,%esi - rorxl $22,%r9d,%r12d - leal (%r8,%r13,1),%r8d - xorl %r10d,%esi - rorxl $13,%r9d,%r14d - rorxl $2,%r9d,%r13d - leal (%rax,%r8,1),%eax - andl %esi,%r15d - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 176-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r10d,%r15d - xorl %r13d,%r14d - leal (%r8,%r15,1),%r8d - movl %ebx,%r12d - addl 32(%rsp),%edx - andl %eax,%r12d - rorxl $25,%eax,%r13d - rorxl $11,%eax,%r15d - leal (%r8,%r14,1),%r8d - leal (%rdx,%r12,1),%edx - andnl %ecx,%eax,%r12d - xorl %r15d,%r13d - rorxl $6,%eax,%r14d - leal (%rdx,%r12,1),%edx - xorl %r14d,%r13d - movl %r8d,%r15d - rorxl $22,%r8d,%r12d - leal (%rdx,%r13,1),%edx - xorl %r9d,%r15d - rorxl $13,%r8d,%r14d - rorxl $2,%r8d,%r13d - leal (%r11,%rdx,1),%r11d - andl %r15d,%esi - vpand %xmm12,%xmm11,%xmm8 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 192-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r9d,%esi - xorl %r13d,%r14d - leal (%rdx,%rsi,1),%edx - movl %eax,%r12d - addl 36(%rsp),%ecx - andl %r11d,%r12d - rorxl $25,%r11d,%r13d - rorxl $11,%r11d,%esi - leal (%rdx,%r14,1),%edx - leal (%rcx,%r12,1),%ecx - andnl %ebx,%r11d,%r12d - xorl %esi,%r13d - rorxl $6,%r11d,%r14d - leal (%rcx,%r12,1),%ecx - xorl %r14d,%r13d - movl %edx,%esi - rorxl $22,%edx,%r12d - leal (%rcx,%r13,1),%ecx - xorl %r8d,%esi - rorxl $13,%edx,%r14d - rorxl $2,%edx,%r13d - leal (%r10,%rcx,1),%r10d - andl %esi,%r15d - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 208-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r8d,%r15d - xorl %r13d,%r14d - leal (%rcx,%r15,1),%ecx - movl %r11d,%r12d - addl 40(%rsp),%ebx - andl %r10d,%r12d - rorxl $25,%r10d,%r13d - rorxl $11,%r10d,%r15d - leal (%rcx,%r14,1),%ecx - leal (%rbx,%r12,1),%ebx - andnl %eax,%r10d,%r12d - xorl %r15d,%r13d - rorxl $6,%r10d,%r14d - leal (%rbx,%r12,1),%ebx - xorl %r14d,%r13d - movl %ecx,%r15d - rorxl $22,%ecx,%r12d - leal (%rbx,%r13,1),%ebx - xorl %edx,%r15d - rorxl $13,%ecx,%r14d - rorxl $2,%ecx,%r13d - leal (%r9,%rbx,1),%r9d - andl %r15d,%esi - vpand %xmm13,%xmm11,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 224-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %edx,%esi - xorl %r13d,%r14d - leal (%rbx,%rsi,1),%ebx - movl %r10d,%r12d - addl 44(%rsp),%eax - andl %r9d,%r12d - rorxl $25,%r9d,%r13d - rorxl $11,%r9d,%esi - leal (%rbx,%r14,1),%ebx - leal (%rax,%r12,1),%eax - andnl %r11d,%r9d,%r12d - xorl %esi,%r13d - rorxl $6,%r9d,%r14d - leal (%rax,%r12,1),%eax - xorl %r14d,%r13d - movl %ebx,%esi - rorxl $22,%ebx,%r12d - leal (%rax,%r13,1),%eax - xorl %ecx,%esi - rorxl $13,%ebx,%r14d - rorxl $2,%ebx,%r13d - leal (%r8,%rax,1),%r8d - andl %esi,%r15d - vpor %xmm11,%xmm8,%xmm8 - vaesenclast %xmm10,%xmm9,%xmm11 - vmovdqu 0-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %ecx,%r15d - xorl %r13d,%r14d - leal (%rax,%r15,1),%eax - movl %r9d,%r12d - vpextrq $1,%xmm15,%r12 - vmovq %xmm15,%r13 - movq 552(%rsp),%r15 - addl %r14d,%eax - leaq 448(%rsp),%rbp - - vpand %xmm14,%xmm11,%xmm11 - vpor %xmm11,%xmm8,%xmm8 - vmovdqu %xmm8,(%r12,%r13,1) - leaq 16(%r13),%r13 - - addl 0(%r15),%eax - addl 4(%r15),%ebx - addl 8(%r15),%ecx - addl 12(%r15),%edx - addl 16(%r15),%r8d - addl 20(%r15),%r9d - addl 24(%r15),%r10d - addl 28(%r15),%r11d - - movl %eax,0(%r15) - movl %ebx,4(%r15) - movl %ecx,8(%r15) - movl %edx,12(%r15) - movl %r8d,16(%r15) - movl %r9d,20(%r15) - movl %r10d,24(%r15) - movl %r11d,28(%r15) - - cmpq 80(%rbp),%r13 - je L$done_avx2 - - xorl %r14d,%r14d - movl %ebx,%esi - movl %r9d,%r12d - xorl %ecx,%esi - jmp L$ower_avx2 -.p2align 4 -L$ower_avx2: - vmovdqu (%r13),%xmm9 - vpinsrq $0,%r13,%xmm15,%xmm15 - addl 0+16(%rbp),%r11d - andl %r8d,%r12d - rorxl $25,%r8d,%r13d - rorxl $11,%r8d,%r15d - leal (%rax,%r14,1),%eax - leal (%r11,%r12,1),%r11d - andnl %r10d,%r8d,%r12d - xorl %r15d,%r13d - rorxl $6,%r8d,%r14d - leal (%r11,%r12,1),%r11d - xorl %r14d,%r13d - movl %eax,%r15d - rorxl $22,%eax,%r12d - leal (%r11,%r13,1),%r11d - xorl %ebx,%r15d - rorxl $13,%eax,%r14d - rorxl $2,%eax,%r13d - leal (%rdx,%r11,1),%edx - andl %r15d,%esi - vpxor %xmm10,%xmm9,%xmm9 - vmovdqu 16-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %ebx,%esi - xorl %r13d,%r14d - leal (%r11,%rsi,1),%r11d - movl %r8d,%r12d - addl 4+16(%rbp),%r10d - andl %edx,%r12d - rorxl $25,%edx,%r13d - rorxl $11,%edx,%esi - leal (%r11,%r14,1),%r11d - leal (%r10,%r12,1),%r10d - andnl %r9d,%edx,%r12d - xorl %esi,%r13d - rorxl $6,%edx,%r14d - leal (%r10,%r12,1),%r10d - xorl %r14d,%r13d - movl %r11d,%esi - rorxl $22,%r11d,%r12d - leal (%r10,%r13,1),%r10d - xorl %eax,%esi - rorxl $13,%r11d,%r14d - rorxl $2,%r11d,%r13d - leal (%rcx,%r10,1),%ecx - andl %esi,%r15d - vpxor %xmm8,%xmm9,%xmm9 - xorl %r12d,%r14d - xorl %eax,%r15d - xorl %r13d,%r14d - leal (%r10,%r15,1),%r10d - movl %edx,%r12d - addl 8+16(%rbp),%r9d - andl %ecx,%r12d - rorxl $25,%ecx,%r13d - rorxl $11,%ecx,%r15d - leal (%r10,%r14,1),%r10d - leal (%r9,%r12,1),%r9d - andnl %r8d,%ecx,%r12d - xorl %r15d,%r13d - rorxl $6,%ecx,%r14d - leal (%r9,%r12,1),%r9d - xorl %r14d,%r13d - movl %r10d,%r15d - rorxl $22,%r10d,%r12d - leal (%r9,%r13,1),%r9d - xorl %r11d,%r15d - rorxl $13,%r10d,%r14d - rorxl $2,%r10d,%r13d - leal (%rbx,%r9,1),%ebx - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 32-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r11d,%esi - xorl %r13d,%r14d - leal (%r9,%rsi,1),%r9d - movl %ecx,%r12d - addl 12+16(%rbp),%r8d - andl %ebx,%r12d - rorxl $25,%ebx,%r13d - rorxl $11,%ebx,%esi - leal (%r9,%r14,1),%r9d - leal (%r8,%r12,1),%r8d - andnl %edx,%ebx,%r12d - xorl %esi,%r13d - rorxl $6,%ebx,%r14d - leal (%r8,%r12,1),%r8d - xorl %r14d,%r13d - movl %r9d,%esi - rorxl $22,%r9d,%r12d - leal (%r8,%r13,1),%r8d - xorl %r10d,%esi - rorxl $13,%r9d,%r14d - rorxl $2,%r9d,%r13d - leal (%rax,%r8,1),%eax - andl %esi,%r15d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 48-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r10d,%r15d - xorl %r13d,%r14d - leal (%r8,%r15,1),%r8d - movl %ebx,%r12d - addl 32+16(%rbp),%edx - andl %eax,%r12d - rorxl $25,%eax,%r13d - rorxl $11,%eax,%r15d - leal (%r8,%r14,1),%r8d - leal (%rdx,%r12,1),%edx - andnl %ecx,%eax,%r12d - xorl %r15d,%r13d - rorxl $6,%eax,%r14d - leal (%rdx,%r12,1),%edx - xorl %r14d,%r13d - movl %r8d,%r15d - rorxl $22,%r8d,%r12d - leal (%rdx,%r13,1),%edx - xorl %r9d,%r15d - rorxl $13,%r8d,%r14d - rorxl $2,%r8d,%r13d - leal (%r11,%rdx,1),%r11d - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 64-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r9d,%esi - xorl %r13d,%r14d - leal (%rdx,%rsi,1),%edx - movl %eax,%r12d - addl 36+16(%rbp),%ecx - andl %r11d,%r12d - rorxl $25,%r11d,%r13d - rorxl $11,%r11d,%esi - leal (%rdx,%r14,1),%edx - leal (%rcx,%r12,1),%ecx - andnl %ebx,%r11d,%r12d - xorl %esi,%r13d - rorxl $6,%r11d,%r14d - leal (%rcx,%r12,1),%ecx - xorl %r14d,%r13d - movl %edx,%esi - rorxl $22,%edx,%r12d - leal (%rcx,%r13,1),%ecx - xorl %r8d,%esi - rorxl $13,%edx,%r14d - rorxl $2,%edx,%r13d - leal (%r10,%rcx,1),%r10d - andl %esi,%r15d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 80-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r8d,%r15d - xorl %r13d,%r14d - leal (%rcx,%r15,1),%ecx - movl %r11d,%r12d - addl 40+16(%rbp),%ebx - andl %r10d,%r12d - rorxl $25,%r10d,%r13d - rorxl $11,%r10d,%r15d - leal (%rcx,%r14,1),%ecx - leal (%rbx,%r12,1),%ebx - andnl %eax,%r10d,%r12d - xorl %r15d,%r13d - rorxl $6,%r10d,%r14d - leal (%rbx,%r12,1),%ebx - xorl %r14d,%r13d - movl %ecx,%r15d - rorxl $22,%ecx,%r12d - leal (%rbx,%r13,1),%ebx - xorl %edx,%r15d - rorxl $13,%ecx,%r14d - rorxl $2,%ecx,%r13d - leal (%r9,%rbx,1),%r9d - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 96-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %edx,%esi - xorl %r13d,%r14d - leal (%rbx,%rsi,1),%ebx - movl %r10d,%r12d - addl 44+16(%rbp),%eax - andl %r9d,%r12d - rorxl $25,%r9d,%r13d - rorxl $11,%r9d,%esi - leal (%rbx,%r14,1),%ebx - leal (%rax,%r12,1),%eax - andnl %r11d,%r9d,%r12d - xorl %esi,%r13d - rorxl $6,%r9d,%r14d - leal (%rax,%r12,1),%eax - xorl %r14d,%r13d - movl %ebx,%esi - rorxl $22,%ebx,%r12d - leal (%rax,%r13,1),%eax - xorl %ecx,%esi - rorxl $13,%ebx,%r14d - rorxl $2,%ebx,%r13d - leal (%r8,%rax,1),%r8d - andl %esi,%r15d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 112-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %ecx,%r15d - xorl %r13d,%r14d - leal (%rax,%r15,1),%eax - movl %r9d,%r12d - leaq -64(%rbp),%rbp - addl 0+16(%rbp),%r11d - andl %r8d,%r12d - rorxl $25,%r8d,%r13d - rorxl $11,%r8d,%r15d - leal (%rax,%r14,1),%eax - leal (%r11,%r12,1),%r11d - andnl %r10d,%r8d,%r12d - xorl %r15d,%r13d - rorxl $6,%r8d,%r14d - leal (%r11,%r12,1),%r11d - xorl %r14d,%r13d - movl %eax,%r15d - rorxl $22,%eax,%r12d - leal (%r11,%r13,1),%r11d - xorl %ebx,%r15d - rorxl $13,%eax,%r14d - rorxl $2,%eax,%r13d - leal (%rdx,%r11,1),%edx - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 128-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %ebx,%esi - xorl %r13d,%r14d - leal (%r11,%rsi,1),%r11d - movl %r8d,%r12d - addl 4+16(%rbp),%r10d - andl %edx,%r12d - rorxl $25,%edx,%r13d - rorxl $11,%edx,%esi - leal (%r11,%r14,1),%r11d - leal (%r10,%r12,1),%r10d - andnl %r9d,%edx,%r12d - xorl %esi,%r13d - rorxl $6,%edx,%r14d - leal (%r10,%r12,1),%r10d - xorl %r14d,%r13d - movl %r11d,%esi - rorxl $22,%r11d,%r12d - leal (%r10,%r13,1),%r10d - xorl %eax,%esi - rorxl $13,%r11d,%r14d - rorxl $2,%r11d,%r13d - leal (%rcx,%r10,1),%ecx - andl %esi,%r15d - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 144-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %eax,%r15d - xorl %r13d,%r14d - leal (%r10,%r15,1),%r10d - movl %edx,%r12d - addl 8+16(%rbp),%r9d - andl %ecx,%r12d - rorxl $25,%ecx,%r13d - rorxl $11,%ecx,%r15d - leal (%r10,%r14,1),%r10d - leal (%r9,%r12,1),%r9d - andnl %r8d,%ecx,%r12d - xorl %r15d,%r13d - rorxl $6,%ecx,%r14d - leal (%r9,%r12,1),%r9d - xorl %r14d,%r13d - movl %r10d,%r15d - rorxl $22,%r10d,%r12d - leal (%r9,%r13,1),%r9d - xorl %r11d,%r15d - rorxl $13,%r10d,%r14d - rorxl $2,%r10d,%r13d - leal (%rbx,%r9,1),%ebx - andl %r15d,%esi - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 160-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r11d,%esi - xorl %r13d,%r14d - leal (%r9,%rsi,1),%r9d - movl %ecx,%r12d - addl 12+16(%rbp),%r8d - andl %ebx,%r12d - rorxl $25,%ebx,%r13d - rorxl $11,%ebx,%esi - leal (%r9,%r14,1),%r9d - leal (%r8,%r12,1),%r8d - andnl %edx,%ebx,%r12d - xorl %esi,%r13d - rorxl $6,%ebx,%r14d - leal (%r8,%r12,1),%r8d - xorl %r14d,%r13d - movl %r9d,%esi - rorxl $22,%r9d,%r12d - leal (%r8,%r13,1),%r8d - xorl %r10d,%esi - rorxl $13,%r9d,%r14d - rorxl $2,%r9d,%r13d - leal (%rax,%r8,1),%eax - andl %esi,%r15d - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 176-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r10d,%r15d - xorl %r13d,%r14d - leal (%r8,%r15,1),%r8d - movl %ebx,%r12d - addl 32+16(%rbp),%edx - andl %eax,%r12d - rorxl $25,%eax,%r13d - rorxl $11,%eax,%r15d - leal (%r8,%r14,1),%r8d - leal (%rdx,%r12,1),%edx - andnl %ecx,%eax,%r12d - xorl %r15d,%r13d - rorxl $6,%eax,%r14d - leal (%rdx,%r12,1),%edx - xorl %r14d,%r13d - movl %r8d,%r15d - rorxl $22,%r8d,%r12d - leal (%rdx,%r13,1),%edx - xorl %r9d,%r15d - rorxl $13,%r8d,%r14d - rorxl $2,%r8d,%r13d - leal (%r11,%rdx,1),%r11d - andl %r15d,%esi - vpand %xmm12,%xmm11,%xmm8 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 192-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r9d,%esi - xorl %r13d,%r14d - leal (%rdx,%rsi,1),%edx - movl %eax,%r12d - addl 36+16(%rbp),%ecx - andl %r11d,%r12d - rorxl $25,%r11d,%r13d - rorxl $11,%r11d,%esi - leal (%rdx,%r14,1),%edx - leal (%rcx,%r12,1),%ecx - andnl %ebx,%r11d,%r12d - xorl %esi,%r13d - rorxl $6,%r11d,%r14d - leal (%rcx,%r12,1),%ecx - xorl %r14d,%r13d - movl %edx,%esi - rorxl $22,%edx,%r12d - leal (%rcx,%r13,1),%ecx - xorl %r8d,%esi - rorxl $13,%edx,%r14d - rorxl $2,%edx,%r13d - leal (%r10,%rcx,1),%r10d - andl %esi,%r15d - vaesenclast %xmm10,%xmm9,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 208-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %r8d,%r15d - xorl %r13d,%r14d - leal (%rcx,%r15,1),%ecx - movl %r11d,%r12d - addl 40+16(%rbp),%ebx - andl %r10d,%r12d - rorxl $25,%r10d,%r13d - rorxl $11,%r10d,%r15d - leal (%rcx,%r14,1),%ecx - leal (%rbx,%r12,1),%ebx - andnl %eax,%r10d,%r12d - xorl %r15d,%r13d - rorxl $6,%r10d,%r14d - leal (%rbx,%r12,1),%ebx - xorl %r14d,%r13d - movl %ecx,%r15d - rorxl $22,%ecx,%r12d - leal (%rbx,%r13,1),%ebx - xorl %edx,%r15d - rorxl $13,%ecx,%r14d - rorxl $2,%ecx,%r13d - leal (%r9,%rbx,1),%r9d - andl %r15d,%esi - vpand %xmm13,%xmm11,%xmm11 - vaesenc %xmm10,%xmm9,%xmm9 - vmovdqu 224-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %edx,%esi - xorl %r13d,%r14d - leal (%rbx,%rsi,1),%ebx - movl %r10d,%r12d - addl 44+16(%rbp),%eax - andl %r9d,%r12d - rorxl $25,%r9d,%r13d - rorxl $11,%r9d,%esi - leal (%rbx,%r14,1),%ebx - leal (%rax,%r12,1),%eax - andnl %r11d,%r9d,%r12d - xorl %esi,%r13d - rorxl $6,%r9d,%r14d - leal (%rax,%r12,1),%eax - xorl %r14d,%r13d - movl %ebx,%esi - rorxl $22,%ebx,%r12d - leal (%rax,%r13,1),%eax - xorl %ecx,%esi - rorxl $13,%ebx,%r14d - rorxl $2,%ebx,%r13d - leal (%r8,%rax,1),%r8d - andl %esi,%r15d - vpor %xmm11,%xmm8,%xmm8 - vaesenclast %xmm10,%xmm9,%xmm11 - vmovdqu 0-128(%rdi),%xmm10 - xorl %r12d,%r14d - xorl %ecx,%r15d - xorl %r13d,%r14d - leal (%rax,%r15,1),%eax - movl %r9d,%r12d - vmovq %xmm15,%r13 - vpextrq $1,%xmm15,%r15 - vpand %xmm14,%xmm11,%xmm11 - vpor %xmm11,%xmm8,%xmm8 - leaq -64(%rbp),%rbp - vmovdqu %xmm8,(%r15,%r13,1) - leaq 16(%r13),%r13 - cmpq %rsp,%rbp - jae L$ower_avx2 - - movq 552(%rsp),%r15 - leaq 64(%r13),%r13 - movq 560(%rsp),%rsi - addl %r14d,%eax - leaq 448(%rsp),%rsp - - addl 0(%r15),%eax - addl 4(%r15),%ebx - addl 8(%r15),%ecx - addl 12(%r15),%edx - addl 16(%r15),%r8d - addl 20(%r15),%r9d - addl 24(%r15),%r10d - leaq (%rsi,%r13,1),%r12 - addl 28(%r15),%r11d - - cmpq 64+16(%rsp),%r13 - - movl %eax,0(%r15) - cmoveq %rsp,%r12 - movl %ebx,4(%r15) - movl %ecx,8(%r15) - movl %edx,12(%r15) - movl %r8d,16(%r15) - movl %r9d,20(%r15) - movl %r10d,24(%r15) - movl %r11d,28(%r15) - - jbe L$oop_avx2 - leaq (%rsp),%rbp - -L$done_avx2: - leaq (%rbp),%rsp - movq 64+32(%rsp),%r8 - movq 64+56(%rsp),%rsi - vmovdqu %xmm8,(%r8) - vzeroall - movq (%rsi),%r15 - movq 8(%rsi),%r14 - movq 16(%rsi),%r13 - movq 24(%rsi),%r12 - movq 32(%rsi),%rbp - movq 40(%rsi),%rbx - leaq 48(%rsi),%rsp -L$epilogue_avx2: - .byte 0xf3,0xc3 - - -.p2align 5 -aesni_cbc_sha256_enc_shaext: - movq 8(%rsp),%r10 - leaq K256+128(%rip),%rax - movdqu (%r9),%xmm1 - movdqu 16(%r9),%xmm2 - movdqa 512-128(%rax),%xmm3 - - movl 240(%rcx),%r11d - subq %rdi,%rsi - movups (%rcx),%xmm15 - movups 16(%rcx),%xmm4 - leaq 112(%rcx),%rcx - - pshufd $27,%xmm1,%xmm0 - pshufd $177,%xmm1,%xmm1 - pshufd $27,%xmm2,%xmm2 - movdqa %xmm3,%xmm7 -.byte 102,15,58,15,202,8 - punpcklqdq %xmm0,%xmm2 - - jmp L$oop_shaext - -.p2align 4 -L$oop_shaext: - movdqu (%r10),%xmm10 - movdqu 16(%r10),%xmm11 - movdqu 32(%r10),%xmm12 -.byte 102,68,15,56,0,211 - movdqu 48(%r10),%xmm13 - - movdqa 0-128(%rax),%xmm0 - paddd %xmm10,%xmm0 -.byte 102,68,15,56,0,219 - movdqa %xmm2,%xmm9 - movdqa %xmm1,%xmm8 - movups 0(%rdi),%xmm14 - xorps %xmm15,%xmm14 - xorps %xmm14,%xmm6 - movups -80(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movups -64(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,202 - - movdqa 32-128(%rax),%xmm0 - paddd %xmm11,%xmm0 -.byte 102,68,15,56,0,227 - leaq 64(%r10),%r10 - movups -48(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movups -32(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,202 - - movdqa 64-128(%rax),%xmm0 - paddd %xmm12,%xmm0 -.byte 102,68,15,56,0,235 -.byte 69,15,56,204,211 - movups -16(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movdqa %xmm13,%xmm3 -.byte 102,65,15,58,15,220,4 - paddd %xmm3,%xmm10 - movups 0(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,202 - - movdqa 96-128(%rax),%xmm0 - paddd %xmm13,%xmm0 -.byte 69,15,56,205,213 -.byte 69,15,56,204,220 - movups 16(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movups 32(%rcx),%xmm4 - aesenc %xmm5,%xmm6 - movdqa %xmm10,%xmm3 -.byte 102,65,15,58,15,221,4 - paddd %xmm3,%xmm11 -.byte 15,56,203,202 - movdqa 128-128(%rax),%xmm0 - paddd %xmm10,%xmm0 -.byte 69,15,56,205,218 -.byte 69,15,56,204,229 - movups 48(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movdqa %xmm11,%xmm3 -.byte 102,65,15,58,15,218,4 - paddd %xmm3,%xmm12 - cmpl $11,%r11d - jb L$aesenclast1 - movups 64(%rcx),%xmm4 - aesenc %xmm5,%xmm6 - movups 80(%rcx),%xmm5 - aesenc %xmm4,%xmm6 - je L$aesenclast1 - movups 96(%rcx),%xmm4 - aesenc %xmm5,%xmm6 - movups 112(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -L$aesenclast1: - aesenclast %xmm5,%xmm6 - movups 16-112(%rcx),%xmm4 - nop -.byte 15,56,203,202 - movups 16(%rdi),%xmm14 - xorps %xmm15,%xmm14 - movups %xmm6,0(%rsi,%rdi,1) - xorps %xmm14,%xmm6 - movups -80(%rcx),%xmm5 - aesenc %xmm4,%xmm6 - movdqa 160-128(%rax),%xmm0 - paddd %xmm11,%xmm0 -.byte 69,15,56,205,227 -.byte 69,15,56,204,234 - movups -64(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movdqa %xmm12,%xmm3 -.byte 102,65,15,58,15,219,4 - paddd %xmm3,%xmm13 - movups -48(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,202 - movdqa 192-128(%rax),%xmm0 - paddd %xmm12,%xmm0 -.byte 69,15,56,205,236 -.byte 69,15,56,204,211 - movups -32(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movdqa %xmm13,%xmm3 -.byte 102,65,15,58,15,220,4 - paddd %xmm3,%xmm10 - movups -16(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,202 - movdqa 224-128(%rax),%xmm0 - paddd %xmm13,%xmm0 -.byte 69,15,56,205,213 -.byte 69,15,56,204,220 - movups 0(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movdqa %xmm10,%xmm3 -.byte 102,65,15,58,15,221,4 - paddd %xmm3,%xmm11 - movups 16(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,202 - movdqa 256-128(%rax),%xmm0 - paddd %xmm10,%xmm0 -.byte 69,15,56,205,218 -.byte 69,15,56,204,229 - movups 32(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movdqa %xmm11,%xmm3 -.byte 102,65,15,58,15,218,4 - paddd %xmm3,%xmm12 - movups 48(%rcx),%xmm5 - aesenc %xmm4,%xmm6 - cmpl $11,%r11d - jb L$aesenclast2 - movups 64(%rcx),%xmm4 - aesenc %xmm5,%xmm6 - movups 80(%rcx),%xmm5 - aesenc %xmm4,%xmm6 - je L$aesenclast2 - movups 96(%rcx),%xmm4 - aesenc %xmm5,%xmm6 - movups 112(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -L$aesenclast2: - aesenclast %xmm5,%xmm6 - movups 16-112(%rcx),%xmm4 - nop -.byte 15,56,203,202 - movups 32(%rdi),%xmm14 - xorps %xmm15,%xmm14 - movups %xmm6,16(%rsi,%rdi,1) - xorps %xmm14,%xmm6 - movups -80(%rcx),%xmm5 - aesenc %xmm4,%xmm6 - movdqa 288-128(%rax),%xmm0 - paddd %xmm11,%xmm0 -.byte 69,15,56,205,227 -.byte 69,15,56,204,234 - movups -64(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movdqa %xmm12,%xmm3 -.byte 102,65,15,58,15,219,4 - paddd %xmm3,%xmm13 - movups -48(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,202 - movdqa 320-128(%rax),%xmm0 - paddd %xmm12,%xmm0 -.byte 69,15,56,205,236 -.byte 69,15,56,204,211 - movups -32(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movdqa %xmm13,%xmm3 -.byte 102,65,15,58,15,220,4 - paddd %xmm3,%xmm10 - movups -16(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,202 - movdqa 352-128(%rax),%xmm0 - paddd %xmm13,%xmm0 -.byte 69,15,56,205,213 -.byte 69,15,56,204,220 - movups 0(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movdqa %xmm10,%xmm3 -.byte 102,65,15,58,15,221,4 - paddd %xmm3,%xmm11 - movups 16(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,202 - movdqa 384-128(%rax),%xmm0 - paddd %xmm10,%xmm0 -.byte 69,15,56,205,218 -.byte 69,15,56,204,229 - movups 32(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movdqa %xmm11,%xmm3 -.byte 102,65,15,58,15,218,4 - paddd %xmm3,%xmm12 - movups 48(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,202 - movdqa 416-128(%rax),%xmm0 - paddd %xmm11,%xmm0 -.byte 69,15,56,205,227 -.byte 69,15,56,204,234 - cmpl $11,%r11d - jb L$aesenclast3 - movups 64(%rcx),%xmm4 - aesenc %xmm5,%xmm6 - movups 80(%rcx),%xmm5 - aesenc %xmm4,%xmm6 - je L$aesenclast3 - movups 96(%rcx),%xmm4 - aesenc %xmm5,%xmm6 - movups 112(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -L$aesenclast3: - aesenclast %xmm5,%xmm6 - movups 16-112(%rcx),%xmm4 - nop -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movdqa %xmm12,%xmm3 -.byte 102,65,15,58,15,219,4 - paddd %xmm3,%xmm13 - movups 48(%rdi),%xmm14 - xorps %xmm15,%xmm14 - movups %xmm6,32(%rsi,%rdi,1) - xorps %xmm14,%xmm6 - movups -80(%rcx),%xmm5 - aesenc %xmm4,%xmm6 - movups -64(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,202 - - movdqa 448-128(%rax),%xmm0 - paddd %xmm12,%xmm0 -.byte 69,15,56,205,236 - movdqa %xmm7,%xmm3 - movups -48(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movups -32(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,202 - - movdqa 480-128(%rax),%xmm0 - paddd %xmm13,%xmm0 - movups -16(%rcx),%xmm5 - aesenc %xmm4,%xmm6 - movups 0(%rcx),%xmm4 - aesenc %xmm5,%xmm6 -.byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 - movups 16(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -.byte 15,56,203,202 - - movups 32(%rcx),%xmm4 - aesenc %xmm5,%xmm6 - movups 48(%rcx),%xmm5 - aesenc %xmm4,%xmm6 - cmpl $11,%r11d - jb L$aesenclast4 - movups 64(%rcx),%xmm4 - aesenc %xmm5,%xmm6 - movups 80(%rcx),%xmm5 - aesenc %xmm4,%xmm6 - je L$aesenclast4 - movups 96(%rcx),%xmm4 - aesenc %xmm5,%xmm6 - movups 112(%rcx),%xmm5 - aesenc %xmm4,%xmm6 -L$aesenclast4: - aesenclast %xmm5,%xmm6 - movups 16-112(%rcx),%xmm4 - nop - - paddd %xmm9,%xmm2 - paddd %xmm8,%xmm1 - - decq %rdx - movups %xmm6,48(%rsi,%rdi,1) - leaq 64(%rdi),%rdi - jnz L$oop_shaext - - pshufd $177,%xmm2,%xmm2 - pshufd $27,%xmm1,%xmm3 - pshufd $177,%xmm1,%xmm1 - punpckhqdq %xmm2,%xmm1 -.byte 102,15,58,15,211,8 - - movups %xmm6,(%r8) - movdqu %xmm1,(%r9) - movdqu %xmm2,16(%r9) - .byte 0xf3,0xc3 diff --git a/deps/openssl/asm/x64-macosx-gas/bn/rsaz-avx2.s b/deps/openssl/asm/x64-macosx-gas/bn/rsaz-avx2.s index 1819757f0b4f4f..02f7f562ea827d 100644 --- a/deps/openssl/asm/x64-macosx-gas/bn/rsaz-avx2.s +++ b/deps/openssl/asm/x64-macosx-gas/bn/rsaz-avx2.s @@ -1,1632 +1,24 @@ .text -.globl _rsaz_1024_sqr_avx2 - -.p2align 6 -_rsaz_1024_sqr_avx2: - leaq (%rsp),%rax - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - vzeroupper - movq %rax,%rbp - movq %rdx,%r13 - subq $832,%rsp - movq %r13,%r15 - subq $-128,%rdi - subq $-128,%rsi - subq $-128,%r13 - - andq $4095,%r15 - addq $320,%r15 - shrq $12,%r15 - vpxor %ymm9,%ymm9,%ymm9 - jz L$sqr_1024_no_n_copy - - - - - - subq $320,%rsp - vmovdqu 0-128(%r13),%ymm0 - andq $-2048,%rsp - vmovdqu 32-128(%r13),%ymm1 - vmovdqu 64-128(%r13),%ymm2 - vmovdqu 96-128(%r13),%ymm3 - vmovdqu 128-128(%r13),%ymm4 - vmovdqu 160-128(%r13),%ymm5 - vmovdqu 192-128(%r13),%ymm6 - vmovdqu 224-128(%r13),%ymm7 - vmovdqu 256-128(%r13),%ymm8 - leaq 832+128(%rsp),%r13 - vmovdqu %ymm0,0-128(%r13) - vmovdqu %ymm1,32-128(%r13) - vmovdqu %ymm2,64-128(%r13) - vmovdqu %ymm3,96-128(%r13) - vmovdqu %ymm4,128-128(%r13) - vmovdqu %ymm5,160-128(%r13) - vmovdqu %ymm6,192-128(%r13) - vmovdqu %ymm7,224-128(%r13) - vmovdqu %ymm8,256-128(%r13) - vmovdqu %ymm9,288-128(%r13) - -L$sqr_1024_no_n_copy: - andq $-1024,%rsp - - vmovdqu 32-128(%rsi),%ymm1 - vmovdqu 64-128(%rsi),%ymm2 - vmovdqu 96-128(%rsi),%ymm3 - vmovdqu 128-128(%rsi),%ymm4 - vmovdqu 160-128(%rsi),%ymm5 - vmovdqu 192-128(%rsi),%ymm6 - vmovdqu 224-128(%rsi),%ymm7 - vmovdqu 256-128(%rsi),%ymm8 - - leaq 192(%rsp),%rbx - vpbroadcastq L$and_mask(%rip),%ymm15 - jmp L$OOP_GRANDE_SQR_1024 - -.p2align 5 -L$OOP_GRANDE_SQR_1024: - leaq 576+128(%rsp),%r9 - leaq 448(%rsp),%r12 - - - - - vpaddq %ymm1,%ymm1,%ymm1 - vpbroadcastq 0-128(%rsi),%ymm10 - vpaddq %ymm2,%ymm2,%ymm2 - vmovdqa %ymm1,0-128(%r9) - vpaddq %ymm3,%ymm3,%ymm3 - vmovdqa %ymm2,32-128(%r9) - vpaddq %ymm4,%ymm4,%ymm4 - vmovdqa %ymm3,64-128(%r9) - vpaddq %ymm5,%ymm5,%ymm5 - vmovdqa %ymm4,96-128(%r9) - vpaddq %ymm6,%ymm6,%ymm6 - vmovdqa %ymm5,128-128(%r9) - vpaddq %ymm7,%ymm7,%ymm7 - vmovdqa %ymm6,160-128(%r9) - vpaddq %ymm8,%ymm8,%ymm8 - vmovdqa %ymm7,192-128(%r9) - vpxor %ymm9,%ymm9,%ymm9 - vmovdqa %ymm8,224-128(%r9) - - vpmuludq 0-128(%rsi),%ymm10,%ymm0 - vpbroadcastq 32-128(%rsi),%ymm11 - vmovdqu %ymm9,288-192(%rbx) - vpmuludq %ymm10,%ymm1,%ymm1 - vmovdqu %ymm9,320-448(%r12) - vpmuludq %ymm10,%ymm2,%ymm2 - vmovdqu %ymm9,352-448(%r12) - vpmuludq %ymm10,%ymm3,%ymm3 - vmovdqu %ymm9,384-448(%r12) - vpmuludq %ymm10,%ymm4,%ymm4 - vmovdqu %ymm9,416-448(%r12) - vpmuludq %ymm10,%ymm5,%ymm5 - vmovdqu %ymm9,448-448(%r12) - vpmuludq %ymm10,%ymm6,%ymm6 - vmovdqu %ymm9,480-448(%r12) - vpmuludq %ymm10,%ymm7,%ymm7 - vmovdqu %ymm9,512-448(%r12) - vpmuludq %ymm10,%ymm8,%ymm8 - vpbroadcastq 64-128(%rsi),%ymm10 - vmovdqu %ymm9,544-448(%r12) - - movq %rsi,%r15 - movl $4,%r14d - jmp L$sqr_entry_1024 -.p2align 5 -L$OOP_SQR_1024: - vpbroadcastq 32-128(%r15),%ymm11 - vpmuludq 0-128(%rsi),%ymm10,%ymm0 - vpaddq 0-192(%rbx),%ymm0,%ymm0 - vpmuludq 0-128(%r9),%ymm10,%ymm1 - vpaddq 32-192(%rbx),%ymm1,%ymm1 - vpmuludq 32-128(%r9),%ymm10,%ymm2 - vpaddq 64-192(%rbx),%ymm2,%ymm2 - vpmuludq 64-128(%r9),%ymm10,%ymm3 - vpaddq 96-192(%rbx),%ymm3,%ymm3 - vpmuludq 96-128(%r9),%ymm10,%ymm4 - vpaddq 128-192(%rbx),%ymm4,%ymm4 - vpmuludq 128-128(%r9),%ymm10,%ymm5 - vpaddq 160-192(%rbx),%ymm5,%ymm5 - vpmuludq 160-128(%r9),%ymm10,%ymm6 - vpaddq 192-192(%rbx),%ymm6,%ymm6 - vpmuludq 192-128(%r9),%ymm10,%ymm7 - vpaddq 224-192(%rbx),%ymm7,%ymm7 - vpmuludq 224-128(%r9),%ymm10,%ymm8 - vpbroadcastq 64-128(%r15),%ymm10 - vpaddq 256-192(%rbx),%ymm8,%ymm8 -L$sqr_entry_1024: - vmovdqu %ymm0,0-192(%rbx) - vmovdqu %ymm1,32-192(%rbx) - - vpmuludq 32-128(%rsi),%ymm11,%ymm12 - vpaddq %ymm12,%ymm2,%ymm2 - vpmuludq 32-128(%r9),%ymm11,%ymm14 - vpaddq %ymm14,%ymm3,%ymm3 - vpmuludq 64-128(%r9),%ymm11,%ymm13 - vpaddq %ymm13,%ymm4,%ymm4 - vpmuludq 96-128(%r9),%ymm11,%ymm12 - vpaddq %ymm12,%ymm5,%ymm5 - vpmuludq 128-128(%r9),%ymm11,%ymm14 - vpaddq %ymm14,%ymm6,%ymm6 - vpmuludq 160-128(%r9),%ymm11,%ymm13 - vpaddq %ymm13,%ymm7,%ymm7 - vpmuludq 192-128(%r9),%ymm11,%ymm12 - vpaddq %ymm12,%ymm8,%ymm8 - vpmuludq 224-128(%r9),%ymm11,%ymm0 - vpbroadcastq 96-128(%r15),%ymm11 - vpaddq 288-192(%rbx),%ymm0,%ymm0 - - vmovdqu %ymm2,64-192(%rbx) - vmovdqu %ymm3,96-192(%rbx) - - vpmuludq 64-128(%rsi),%ymm10,%ymm13 - vpaddq %ymm13,%ymm4,%ymm4 - vpmuludq 64-128(%r9),%ymm10,%ymm12 - vpaddq %ymm12,%ymm5,%ymm5 - vpmuludq 96-128(%r9),%ymm10,%ymm14 - vpaddq %ymm14,%ymm6,%ymm6 - vpmuludq 128-128(%r9),%ymm10,%ymm13 - vpaddq %ymm13,%ymm7,%ymm7 - vpmuludq 160-128(%r9),%ymm10,%ymm12 - vpaddq %ymm12,%ymm8,%ymm8 - vpmuludq 192-128(%r9),%ymm10,%ymm14 - vpaddq %ymm14,%ymm0,%ymm0 - vpmuludq 224-128(%r9),%ymm10,%ymm1 - vpbroadcastq 128-128(%r15),%ymm10 - vpaddq 320-448(%r12),%ymm1,%ymm1 - - vmovdqu %ymm4,128-192(%rbx) - vmovdqu %ymm5,160-192(%rbx) - - vpmuludq 96-128(%rsi),%ymm11,%ymm12 - vpaddq %ymm12,%ymm6,%ymm6 - vpmuludq 96-128(%r9),%ymm11,%ymm14 - vpaddq %ymm14,%ymm7,%ymm7 - vpmuludq 128-128(%r9),%ymm11,%ymm13 - vpaddq %ymm13,%ymm8,%ymm8 - vpmuludq 160-128(%r9),%ymm11,%ymm12 - vpaddq %ymm12,%ymm0,%ymm0 - vpmuludq 192-128(%r9),%ymm11,%ymm14 - vpaddq %ymm14,%ymm1,%ymm1 - vpmuludq 224-128(%r9),%ymm11,%ymm2 - vpbroadcastq 160-128(%r15),%ymm11 - vpaddq 352-448(%r12),%ymm2,%ymm2 - - vmovdqu %ymm6,192-192(%rbx) - vmovdqu %ymm7,224-192(%rbx) - - vpmuludq 128-128(%rsi),%ymm10,%ymm12 - vpaddq %ymm12,%ymm8,%ymm8 - vpmuludq 128-128(%r9),%ymm10,%ymm14 - vpaddq %ymm14,%ymm0,%ymm0 - vpmuludq 160-128(%r9),%ymm10,%ymm13 - vpaddq %ymm13,%ymm1,%ymm1 - vpmuludq 192-128(%r9),%ymm10,%ymm12 - vpaddq %ymm12,%ymm2,%ymm2 - vpmuludq 224-128(%r9),%ymm10,%ymm3 - vpbroadcastq 192-128(%r15),%ymm10 - vpaddq 384-448(%r12),%ymm3,%ymm3 - - vmovdqu %ymm8,256-192(%rbx) - vmovdqu %ymm0,288-192(%rbx) - leaq 8(%rbx),%rbx - - vpmuludq 160-128(%rsi),%ymm11,%ymm13 - vpaddq %ymm13,%ymm1,%ymm1 - vpmuludq 160-128(%r9),%ymm11,%ymm12 - vpaddq %ymm12,%ymm2,%ymm2 - vpmuludq 192-128(%r9),%ymm11,%ymm14 - vpaddq %ymm14,%ymm3,%ymm3 - vpmuludq 224-128(%r9),%ymm11,%ymm4 - vpbroadcastq 224-128(%r15),%ymm11 - vpaddq 416-448(%r12),%ymm4,%ymm4 - - vmovdqu %ymm1,320-448(%r12) - vmovdqu %ymm2,352-448(%r12) - - vpmuludq 192-128(%rsi),%ymm10,%ymm12 - vpaddq %ymm12,%ymm3,%ymm3 - vpmuludq 192-128(%r9),%ymm10,%ymm14 - vpbroadcastq 256-128(%r15),%ymm0 - vpaddq %ymm14,%ymm4,%ymm4 - vpmuludq 224-128(%r9),%ymm10,%ymm5 - vpbroadcastq 0+8-128(%r15),%ymm10 - vpaddq 448-448(%r12),%ymm5,%ymm5 - - vmovdqu %ymm3,384-448(%r12) - vmovdqu %ymm4,416-448(%r12) - leaq 8(%r15),%r15 - - vpmuludq 224-128(%rsi),%ymm11,%ymm12 - vpaddq %ymm12,%ymm5,%ymm5 - vpmuludq 224-128(%r9),%ymm11,%ymm6 - vpaddq 480-448(%r12),%ymm6,%ymm6 - - vpmuludq 256-128(%rsi),%ymm0,%ymm7 - vmovdqu %ymm5,448-448(%r12) - vpaddq 512-448(%r12),%ymm7,%ymm7 - vmovdqu %ymm6,480-448(%r12) - vmovdqu %ymm7,512-448(%r12) - leaq 8(%r12),%r12 - - decl %r14d - jnz L$OOP_SQR_1024 - - vmovdqu 256(%rsp),%ymm8 - vmovdqu 288(%rsp),%ymm1 - vmovdqu 320(%rsp),%ymm2 - leaq 192(%rsp),%rbx - - vpsrlq $29,%ymm8,%ymm14 - vpand %ymm15,%ymm8,%ymm8 - vpsrlq $29,%ymm1,%ymm11 - vpand %ymm15,%ymm1,%ymm1 - - vpermq $147,%ymm14,%ymm14 - vpxor %ymm9,%ymm9,%ymm9 - vpermq $147,%ymm11,%ymm11 - - vpblendd $3,%ymm9,%ymm14,%ymm10 - vpblendd $3,%ymm14,%ymm11,%ymm14 - vpaddq %ymm10,%ymm8,%ymm8 - vpblendd $3,%ymm11,%ymm9,%ymm11 - vpaddq %ymm14,%ymm1,%ymm1 - vpaddq %ymm11,%ymm2,%ymm2 - vmovdqu %ymm1,288-192(%rbx) - vmovdqu %ymm2,320-192(%rbx) - - movq (%rsp),%rax - movq 8(%rsp),%r10 - movq 16(%rsp),%r11 - movq 24(%rsp),%r12 - vmovdqu 32(%rsp),%ymm1 - vmovdqu 64-192(%rbx),%ymm2 - vmovdqu 96-192(%rbx),%ymm3 - vmovdqu 128-192(%rbx),%ymm4 - vmovdqu 160-192(%rbx),%ymm5 - vmovdqu 192-192(%rbx),%ymm6 - vmovdqu 224-192(%rbx),%ymm7 - - movq %rax,%r9 - imull %ecx,%eax - andl $536870911,%eax - vmovd %eax,%xmm12 - - movq %rax,%rdx - imulq -128(%r13),%rax - vpbroadcastq %xmm12,%ymm12 - addq %rax,%r9 - movq %rdx,%rax - imulq 8-128(%r13),%rax - shrq $29,%r9 - addq %rax,%r10 - movq %rdx,%rax - imulq 16-128(%r13),%rax - addq %r9,%r10 - addq %rax,%r11 - imulq 24-128(%r13),%rdx - addq %rdx,%r12 - - movq %r10,%rax - imull %ecx,%eax - andl $536870911,%eax - - movl $9,%r14d - jmp L$OOP_REDUCE_1024 - -.p2align 5 -L$OOP_REDUCE_1024: - vmovd %eax,%xmm13 - vpbroadcastq %xmm13,%ymm13 - - vpmuludq 32-128(%r13),%ymm12,%ymm10 - movq %rax,%rdx - imulq -128(%r13),%rax - vpaddq %ymm10,%ymm1,%ymm1 - addq %rax,%r10 - vpmuludq 64-128(%r13),%ymm12,%ymm14 - movq %rdx,%rax - imulq 8-128(%r13),%rax - vpaddq %ymm14,%ymm2,%ymm2 - vpmuludq 96-128(%r13),%ymm12,%ymm11 -.byte 0x67 - addq %rax,%r11 -.byte 0x67 - movq %rdx,%rax - imulq 16-128(%r13),%rax - shrq $29,%r10 - vpaddq %ymm11,%ymm3,%ymm3 - vpmuludq 128-128(%r13),%ymm12,%ymm10 - addq %rax,%r12 - addq %r10,%r11 - vpaddq %ymm10,%ymm4,%ymm4 - vpmuludq 160-128(%r13),%ymm12,%ymm14 - movq %r11,%rax - imull %ecx,%eax - vpaddq %ymm14,%ymm5,%ymm5 - vpmuludq 192-128(%r13),%ymm12,%ymm11 - andl $536870911,%eax - vpaddq %ymm11,%ymm6,%ymm6 - vpmuludq 224-128(%r13),%ymm12,%ymm10 - vpaddq %ymm10,%ymm7,%ymm7 - vpmuludq 256-128(%r13),%ymm12,%ymm14 - vmovd %eax,%xmm12 - - vpaddq %ymm14,%ymm8,%ymm8 - - vpbroadcastq %xmm12,%ymm12 - - vpmuludq 32-8-128(%r13),%ymm13,%ymm11 - vmovdqu 96-8-128(%r13),%ymm14 - movq %rax,%rdx - imulq -128(%r13),%rax - vpaddq %ymm11,%ymm1,%ymm1 - vpmuludq 64-8-128(%r13),%ymm13,%ymm10 - vmovdqu 128-8-128(%r13),%ymm11 - addq %rax,%r11 - movq %rdx,%rax - imulq 8-128(%r13),%rax - vpaddq %ymm10,%ymm2,%ymm2 - addq %r12,%rax - shrq $29,%r11 - vpmuludq %ymm13,%ymm14,%ymm14 - vmovdqu 160-8-128(%r13),%ymm10 - addq %r11,%rax - vpaddq %ymm14,%ymm3,%ymm3 - vpmuludq %ymm13,%ymm11,%ymm11 - vmovdqu 192-8-128(%r13),%ymm14 -.byte 0x67 - movq %rax,%r12 - imull %ecx,%eax - vpaddq %ymm11,%ymm4,%ymm4 - vpmuludq %ymm13,%ymm10,%ymm10 -.byte 0xc4,0x41,0x7e,0x6f,0x9d,0x58,0x00,0x00,0x00 - andl $536870911,%eax - vpaddq %ymm10,%ymm5,%ymm5 - vpmuludq %ymm13,%ymm14,%ymm14 - vmovdqu 256-8-128(%r13),%ymm10 - vpaddq %ymm14,%ymm6,%ymm6 - vpmuludq %ymm13,%ymm11,%ymm11 - vmovdqu 288-8-128(%r13),%ymm9 - vmovd %eax,%xmm0 - imulq -128(%r13),%rax - vpaddq %ymm11,%ymm7,%ymm7 - vpmuludq %ymm13,%ymm10,%ymm10 - vmovdqu 32-16-128(%r13),%ymm14 - vpbroadcastq %xmm0,%ymm0 - vpaddq %ymm10,%ymm8,%ymm8 - vpmuludq %ymm13,%ymm9,%ymm9 - vmovdqu 64-16-128(%r13),%ymm11 - addq %rax,%r12 - - vmovdqu 32-24-128(%r13),%ymm13 - vpmuludq %ymm12,%ymm14,%ymm14 - vmovdqu 96-16-128(%r13),%ymm10 - vpaddq %ymm14,%ymm1,%ymm1 - vpmuludq %ymm0,%ymm13,%ymm13 - vpmuludq %ymm12,%ymm11,%ymm11 -.byte 0xc4,0x41,0x7e,0x6f,0xb5,0xf0,0xff,0xff,0xff - vpaddq %ymm1,%ymm13,%ymm13 - vpaddq %ymm11,%ymm2,%ymm2 - vpmuludq %ymm12,%ymm10,%ymm10 - vmovdqu 160-16-128(%r13),%ymm11 -.byte 0x67 - vmovq %xmm13,%rax - vmovdqu %ymm13,(%rsp) - vpaddq %ymm10,%ymm3,%ymm3 - vpmuludq %ymm12,%ymm14,%ymm14 - vmovdqu 192-16-128(%r13),%ymm10 - vpaddq %ymm14,%ymm4,%ymm4 - vpmuludq %ymm12,%ymm11,%ymm11 - vmovdqu 224-16-128(%r13),%ymm14 - vpaddq %ymm11,%ymm5,%ymm5 - vpmuludq %ymm12,%ymm10,%ymm10 - vmovdqu 256-16-128(%r13),%ymm11 - vpaddq %ymm10,%ymm6,%ymm6 - vpmuludq %ymm12,%ymm14,%ymm14 - shrq $29,%r12 - vmovdqu 288-16-128(%r13),%ymm10 - addq %r12,%rax - vpaddq %ymm14,%ymm7,%ymm7 - vpmuludq %ymm12,%ymm11,%ymm11 - - movq %rax,%r9 - imull %ecx,%eax - vpaddq %ymm11,%ymm8,%ymm8 - vpmuludq %ymm12,%ymm10,%ymm10 - andl $536870911,%eax - vmovd %eax,%xmm12 - vmovdqu 96-24-128(%r13),%ymm11 -.byte 0x67 - vpaddq %ymm10,%ymm9,%ymm9 - vpbroadcastq %xmm12,%ymm12 - - vpmuludq 64-24-128(%r13),%ymm0,%ymm14 - vmovdqu 128-24-128(%r13),%ymm10 - movq %rax,%rdx - imulq -128(%r13),%rax - movq 8(%rsp),%r10 - vpaddq %ymm14,%ymm2,%ymm1 - vpmuludq %ymm0,%ymm11,%ymm11 - vmovdqu 160-24-128(%r13),%ymm14 - addq %rax,%r9 - movq %rdx,%rax - imulq 8-128(%r13),%rax -.byte 0x67 - shrq $29,%r9 - movq 16(%rsp),%r11 - vpaddq %ymm11,%ymm3,%ymm2 - vpmuludq %ymm0,%ymm10,%ymm10 - vmovdqu 192-24-128(%r13),%ymm11 - addq %rax,%r10 - movq %rdx,%rax - imulq 16-128(%r13),%rax - vpaddq %ymm10,%ymm4,%ymm3 - vpmuludq %ymm0,%ymm14,%ymm14 - vmovdqu 224-24-128(%r13),%ymm10 - imulq 24-128(%r13),%rdx - addq %rax,%r11 - leaq (%r9,%r10,1),%rax - vpaddq %ymm14,%ymm5,%ymm4 - vpmuludq %ymm0,%ymm11,%ymm11 - vmovdqu 256-24-128(%r13),%ymm14 - movq %rax,%r10 - imull %ecx,%eax - vpmuludq %ymm0,%ymm10,%ymm10 - vpaddq %ymm11,%ymm6,%ymm5 - vmovdqu 288-24-128(%r13),%ymm11 - andl $536870911,%eax - vpaddq %ymm10,%ymm7,%ymm6 - vpmuludq %ymm0,%ymm14,%ymm14 - addq 24(%rsp),%rdx - vpaddq %ymm14,%ymm8,%ymm7 - vpmuludq %ymm0,%ymm11,%ymm11 - vpaddq %ymm11,%ymm9,%ymm8 - vmovq %r12,%xmm9 - movq %rdx,%r12 - - decl %r14d - jnz L$OOP_REDUCE_1024 - leaq 448(%rsp),%r12 - vpaddq %ymm9,%ymm13,%ymm0 - vpxor %ymm9,%ymm9,%ymm9 - - vpaddq 288-192(%rbx),%ymm0,%ymm0 - vpaddq 320-448(%r12),%ymm1,%ymm1 - vpaddq 352-448(%r12),%ymm2,%ymm2 - vpaddq 384-448(%r12),%ymm3,%ymm3 - vpaddq 416-448(%r12),%ymm4,%ymm4 - vpaddq 448-448(%r12),%ymm5,%ymm5 - vpaddq 480-448(%r12),%ymm6,%ymm6 - vpaddq 512-448(%r12),%ymm7,%ymm7 - vpaddq 544-448(%r12),%ymm8,%ymm8 - - vpsrlq $29,%ymm0,%ymm14 - vpand %ymm15,%ymm0,%ymm0 - vpsrlq $29,%ymm1,%ymm11 - vpand %ymm15,%ymm1,%ymm1 - vpsrlq $29,%ymm2,%ymm12 - vpermq $147,%ymm14,%ymm14 - vpand %ymm15,%ymm2,%ymm2 - vpsrlq $29,%ymm3,%ymm13 - vpermq $147,%ymm11,%ymm11 - vpand %ymm15,%ymm3,%ymm3 - vpermq $147,%ymm12,%ymm12 - - vpblendd $3,%ymm9,%ymm14,%ymm10 - vpermq $147,%ymm13,%ymm13 - vpblendd $3,%ymm14,%ymm11,%ymm14 - vpaddq %ymm10,%ymm0,%ymm0 - vpblendd $3,%ymm11,%ymm12,%ymm11 - vpaddq %ymm14,%ymm1,%ymm1 - vpblendd $3,%ymm12,%ymm13,%ymm12 - vpaddq %ymm11,%ymm2,%ymm2 - vpblendd $3,%ymm13,%ymm9,%ymm13 - vpaddq %ymm12,%ymm3,%ymm3 - vpaddq %ymm13,%ymm4,%ymm4 - - vpsrlq $29,%ymm0,%ymm14 - vpand %ymm15,%ymm0,%ymm0 - vpsrlq $29,%ymm1,%ymm11 - vpand %ymm15,%ymm1,%ymm1 - vpsrlq $29,%ymm2,%ymm12 - vpermq $147,%ymm14,%ymm14 - vpand %ymm15,%ymm2,%ymm2 - vpsrlq $29,%ymm3,%ymm13 - vpermq $147,%ymm11,%ymm11 - vpand %ymm15,%ymm3,%ymm3 - vpermq $147,%ymm12,%ymm12 - - vpblendd $3,%ymm9,%ymm14,%ymm10 - vpermq $147,%ymm13,%ymm13 - vpblendd $3,%ymm14,%ymm11,%ymm14 - vpaddq %ymm10,%ymm0,%ymm0 - vpblendd $3,%ymm11,%ymm12,%ymm11 - vpaddq %ymm14,%ymm1,%ymm1 - vmovdqu %ymm0,0-128(%rdi) - vpblendd $3,%ymm12,%ymm13,%ymm12 - vpaddq %ymm11,%ymm2,%ymm2 - vmovdqu %ymm1,32-128(%rdi) - vpblendd $3,%ymm13,%ymm9,%ymm13 - vpaddq %ymm12,%ymm3,%ymm3 - vmovdqu %ymm2,64-128(%rdi) - vpaddq %ymm13,%ymm4,%ymm4 - vmovdqu %ymm3,96-128(%rdi) - vpsrlq $29,%ymm4,%ymm14 - vpand %ymm15,%ymm4,%ymm4 - vpsrlq $29,%ymm5,%ymm11 - vpand %ymm15,%ymm5,%ymm5 - vpsrlq $29,%ymm6,%ymm12 - vpermq $147,%ymm14,%ymm14 - vpand %ymm15,%ymm6,%ymm6 - vpsrlq $29,%ymm7,%ymm13 - vpermq $147,%ymm11,%ymm11 - vpand %ymm15,%ymm7,%ymm7 - vpsrlq $29,%ymm8,%ymm0 - vpermq $147,%ymm12,%ymm12 - vpand %ymm15,%ymm8,%ymm8 - vpermq $147,%ymm13,%ymm13 - - vpblendd $3,%ymm9,%ymm14,%ymm10 - vpermq $147,%ymm0,%ymm0 - vpblendd $3,%ymm14,%ymm11,%ymm14 - vpaddq %ymm10,%ymm4,%ymm4 - vpblendd $3,%ymm11,%ymm12,%ymm11 - vpaddq %ymm14,%ymm5,%ymm5 - vpblendd $3,%ymm12,%ymm13,%ymm12 - vpaddq %ymm11,%ymm6,%ymm6 - vpblendd $3,%ymm13,%ymm0,%ymm13 - vpaddq %ymm12,%ymm7,%ymm7 - vpaddq %ymm13,%ymm8,%ymm8 - - vpsrlq $29,%ymm4,%ymm14 - vpand %ymm15,%ymm4,%ymm4 - vpsrlq $29,%ymm5,%ymm11 - vpand %ymm15,%ymm5,%ymm5 - vpsrlq $29,%ymm6,%ymm12 - vpermq $147,%ymm14,%ymm14 - vpand %ymm15,%ymm6,%ymm6 - vpsrlq $29,%ymm7,%ymm13 - vpermq $147,%ymm11,%ymm11 - vpand %ymm15,%ymm7,%ymm7 - vpsrlq $29,%ymm8,%ymm0 - vpermq $147,%ymm12,%ymm12 - vpand %ymm15,%ymm8,%ymm8 - vpermq $147,%ymm13,%ymm13 - - vpblendd $3,%ymm9,%ymm14,%ymm10 - vpermq $147,%ymm0,%ymm0 - vpblendd $3,%ymm14,%ymm11,%ymm14 - vpaddq %ymm10,%ymm4,%ymm4 - vpblendd $3,%ymm11,%ymm12,%ymm11 - vpaddq %ymm14,%ymm5,%ymm5 - vmovdqu %ymm4,128-128(%rdi) - vpblendd $3,%ymm12,%ymm13,%ymm12 - vpaddq %ymm11,%ymm6,%ymm6 - vmovdqu %ymm5,160-128(%rdi) - vpblendd $3,%ymm13,%ymm0,%ymm13 - vpaddq %ymm12,%ymm7,%ymm7 - vmovdqu %ymm6,192-128(%rdi) - vpaddq %ymm13,%ymm8,%ymm8 - vmovdqu %ymm7,224-128(%rdi) - vmovdqu %ymm8,256-128(%rdi) - - movq %rdi,%rsi - decl %r8d - jne L$OOP_GRANDE_SQR_1024 - - vzeroall - movq %rbp,%rax - movq -48(%rax),%r15 - movq -40(%rax),%r14 - movq -32(%rax),%r13 - movq -24(%rax),%r12 - movq -16(%rax),%rbp - movq -8(%rax),%rbx - leaq (%rax),%rsp -L$sqr_1024_epilogue: - .byte 0xf3,0xc3 - -.globl _rsaz_1024_mul_avx2 - -.p2align 6 -_rsaz_1024_mul_avx2: - leaq (%rsp),%rax - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - movq %rax,%rbp - vzeroall - movq %rdx,%r13 - subq $64,%rsp - - - - - - -.byte 0x67,0x67 - movq %rsi,%r15 - andq $4095,%r15 - addq $320,%r15 - shrq $12,%r15 - movq %rsi,%r15 - cmovnzq %r13,%rsi - cmovnzq %r15,%r13 - - movq %rcx,%r15 - subq $-128,%rsi - subq $-128,%rcx - subq $-128,%rdi - - andq $4095,%r15 - addq $320,%r15 -.byte 0x67,0x67 - shrq $12,%r15 - jz L$mul_1024_no_n_copy - - - - - - subq $320,%rsp - vmovdqu 0-128(%rcx),%ymm0 - andq $-512,%rsp - vmovdqu 32-128(%rcx),%ymm1 - vmovdqu 64-128(%rcx),%ymm2 - vmovdqu 96-128(%rcx),%ymm3 - vmovdqu 128-128(%rcx),%ymm4 - vmovdqu 160-128(%rcx),%ymm5 - vmovdqu 192-128(%rcx),%ymm6 - vmovdqu 224-128(%rcx),%ymm7 - vmovdqu 256-128(%rcx),%ymm8 - leaq 64+128(%rsp),%rcx - vmovdqu %ymm0,0-128(%rcx) - vpxor %ymm0,%ymm0,%ymm0 - vmovdqu %ymm1,32-128(%rcx) - vpxor %ymm1,%ymm1,%ymm1 - vmovdqu %ymm2,64-128(%rcx) - vpxor %ymm2,%ymm2,%ymm2 - vmovdqu %ymm3,96-128(%rcx) - vpxor %ymm3,%ymm3,%ymm3 - vmovdqu %ymm4,128-128(%rcx) - vpxor %ymm4,%ymm4,%ymm4 - vmovdqu %ymm5,160-128(%rcx) - vpxor %ymm5,%ymm5,%ymm5 - vmovdqu %ymm6,192-128(%rcx) - vpxor %ymm6,%ymm6,%ymm6 - vmovdqu %ymm7,224-128(%rcx) - vpxor %ymm7,%ymm7,%ymm7 - vmovdqu %ymm8,256-128(%rcx) - vmovdqa %ymm0,%ymm8 - vmovdqu %ymm9,288-128(%rcx) -L$mul_1024_no_n_copy: - andq $-64,%rsp - - movq (%r13),%rbx - vpbroadcastq (%r13),%ymm10 - vmovdqu %ymm0,(%rsp) - xorq %r9,%r9 -.byte 0x67 - xorq %r10,%r10 - xorq %r11,%r11 - xorq %r12,%r12 - - vmovdqu L$and_mask(%rip),%ymm15 - movl $9,%r14d - vmovdqu %ymm9,288-128(%rdi) - jmp L$oop_mul_1024 - -.p2align 5 -L$oop_mul_1024: - vpsrlq $29,%ymm3,%ymm9 - movq %rbx,%rax - imulq -128(%rsi),%rax - addq %r9,%rax - movq %rbx,%r10 - imulq 8-128(%rsi),%r10 - addq 8(%rsp),%r10 - - movq %rax,%r9 - imull %r8d,%eax - andl $536870911,%eax - - movq %rbx,%r11 - imulq 16-128(%rsi),%r11 - addq 16(%rsp),%r11 - - movq %rbx,%r12 - imulq 24-128(%rsi),%r12 - addq 24(%rsp),%r12 - vpmuludq 32-128(%rsi),%ymm10,%ymm0 - vmovd %eax,%xmm11 - vpaddq %ymm0,%ymm1,%ymm1 - vpmuludq 64-128(%rsi),%ymm10,%ymm12 - vpbroadcastq %xmm11,%ymm11 - vpaddq %ymm12,%ymm2,%ymm2 - vpmuludq 96-128(%rsi),%ymm10,%ymm13 - vpand %ymm15,%ymm3,%ymm3 - vpaddq %ymm13,%ymm3,%ymm3 - vpmuludq 128-128(%rsi),%ymm10,%ymm0 - vpaddq %ymm0,%ymm4,%ymm4 - vpmuludq 160-128(%rsi),%ymm10,%ymm12 - vpaddq %ymm12,%ymm5,%ymm5 - vpmuludq 192-128(%rsi),%ymm10,%ymm13 - vpaddq %ymm13,%ymm6,%ymm6 - vpmuludq 224-128(%rsi),%ymm10,%ymm0 - vpermq $147,%ymm9,%ymm9 - vpaddq %ymm0,%ymm7,%ymm7 - vpmuludq 256-128(%rsi),%ymm10,%ymm12 - vpbroadcastq 8(%r13),%ymm10 - vpaddq %ymm12,%ymm8,%ymm8 - - movq %rax,%rdx - imulq -128(%rcx),%rax - addq %rax,%r9 - movq %rdx,%rax - imulq 8-128(%rcx),%rax - addq %rax,%r10 - movq %rdx,%rax - imulq 16-128(%rcx),%rax - addq %rax,%r11 - shrq $29,%r9 - imulq 24-128(%rcx),%rdx - addq %rdx,%r12 - addq %r9,%r10 - - vpmuludq 32-128(%rcx),%ymm11,%ymm13 - vmovq %xmm10,%rbx - vpaddq %ymm13,%ymm1,%ymm1 - vpmuludq 64-128(%rcx),%ymm11,%ymm0 - vpaddq %ymm0,%ymm2,%ymm2 - vpmuludq 96-128(%rcx),%ymm11,%ymm12 - vpaddq %ymm12,%ymm3,%ymm3 - vpmuludq 128-128(%rcx),%ymm11,%ymm13 - vpaddq %ymm13,%ymm4,%ymm4 - vpmuludq 160-128(%rcx),%ymm11,%ymm0 - vpaddq %ymm0,%ymm5,%ymm5 - vpmuludq 192-128(%rcx),%ymm11,%ymm12 - vpaddq %ymm12,%ymm6,%ymm6 - vpmuludq 224-128(%rcx),%ymm11,%ymm13 - vpblendd $3,%ymm14,%ymm9,%ymm9 - vpaddq %ymm13,%ymm7,%ymm7 - vpmuludq 256-128(%rcx),%ymm11,%ymm0 - vpaddq %ymm9,%ymm3,%ymm3 - vpaddq %ymm0,%ymm8,%ymm8 - - movq %rbx,%rax - imulq -128(%rsi),%rax - addq %rax,%r10 - vmovdqu -8+32-128(%rsi),%ymm12 - movq %rbx,%rax - imulq 8-128(%rsi),%rax - addq %rax,%r11 - vmovdqu -8+64-128(%rsi),%ymm13 - - movq %r10,%rax - imull %r8d,%eax - andl $536870911,%eax - - imulq 16-128(%rsi),%rbx - addq %rbx,%r12 - vpmuludq %ymm10,%ymm12,%ymm12 - vmovd %eax,%xmm11 - vmovdqu -8+96-128(%rsi),%ymm0 - vpaddq %ymm12,%ymm1,%ymm1 - vpmuludq %ymm10,%ymm13,%ymm13 - vpbroadcastq %xmm11,%ymm11 - vmovdqu -8+128-128(%rsi),%ymm12 - vpaddq %ymm13,%ymm2,%ymm2 - vpmuludq %ymm10,%ymm0,%ymm0 - vmovdqu -8+160-128(%rsi),%ymm13 - vpaddq %ymm0,%ymm3,%ymm3 - vpmuludq %ymm10,%ymm12,%ymm12 - vmovdqu -8+192-128(%rsi),%ymm0 - vpaddq %ymm12,%ymm4,%ymm4 - vpmuludq %ymm10,%ymm13,%ymm13 - vmovdqu -8+224-128(%rsi),%ymm12 - vpaddq %ymm13,%ymm5,%ymm5 - vpmuludq %ymm10,%ymm0,%ymm0 - vmovdqu -8+256-128(%rsi),%ymm13 - vpaddq %ymm0,%ymm6,%ymm6 - vpmuludq %ymm10,%ymm12,%ymm12 - vmovdqu -8+288-128(%rsi),%ymm9 - vpaddq %ymm12,%ymm7,%ymm7 - vpmuludq %ymm10,%ymm13,%ymm13 - vpaddq %ymm13,%ymm8,%ymm8 - vpmuludq %ymm10,%ymm9,%ymm9 - vpbroadcastq 16(%r13),%ymm10 - - movq %rax,%rdx - imulq -128(%rcx),%rax - addq %rax,%r10 - vmovdqu -8+32-128(%rcx),%ymm0 - movq %rdx,%rax - imulq 8-128(%rcx),%rax - addq %rax,%r11 - vmovdqu -8+64-128(%rcx),%ymm12 - shrq $29,%r10 - imulq 16-128(%rcx),%rdx - addq %rdx,%r12 - addq %r10,%r11 - - vpmuludq %ymm11,%ymm0,%ymm0 - vmovq %xmm10,%rbx - vmovdqu -8+96-128(%rcx),%ymm13 - vpaddq %ymm0,%ymm1,%ymm1 - vpmuludq %ymm11,%ymm12,%ymm12 - vmovdqu -8+128-128(%rcx),%ymm0 - vpaddq %ymm12,%ymm2,%ymm2 - vpmuludq %ymm11,%ymm13,%ymm13 - vmovdqu -8+160-128(%rcx),%ymm12 - vpaddq %ymm13,%ymm3,%ymm3 - vpmuludq %ymm11,%ymm0,%ymm0 - vmovdqu -8+192-128(%rcx),%ymm13 - vpaddq %ymm0,%ymm4,%ymm4 - vpmuludq %ymm11,%ymm12,%ymm12 - vmovdqu -8+224-128(%rcx),%ymm0 - vpaddq %ymm12,%ymm5,%ymm5 - vpmuludq %ymm11,%ymm13,%ymm13 - vmovdqu -8+256-128(%rcx),%ymm12 - vpaddq %ymm13,%ymm6,%ymm6 - vpmuludq %ymm11,%ymm0,%ymm0 - vmovdqu -8+288-128(%rcx),%ymm13 - vpaddq %ymm0,%ymm7,%ymm7 - vpmuludq %ymm11,%ymm12,%ymm12 - vpaddq %ymm12,%ymm8,%ymm8 - vpmuludq %ymm11,%ymm13,%ymm13 - vpaddq %ymm13,%ymm9,%ymm9 - - vmovdqu -16+32-128(%rsi),%ymm0 - movq %rbx,%rax - imulq -128(%rsi),%rax - addq %r11,%rax - - vmovdqu -16+64-128(%rsi),%ymm12 - movq %rax,%r11 - imull %r8d,%eax - andl $536870911,%eax - - imulq 8-128(%rsi),%rbx - addq %rbx,%r12 - vpmuludq %ymm10,%ymm0,%ymm0 - vmovd %eax,%xmm11 - vmovdqu -16+96-128(%rsi),%ymm13 - vpaddq %ymm0,%ymm1,%ymm1 - vpmuludq %ymm10,%ymm12,%ymm12 - vpbroadcastq %xmm11,%ymm11 - vmovdqu -16+128-128(%rsi),%ymm0 - vpaddq %ymm12,%ymm2,%ymm2 - vpmuludq %ymm10,%ymm13,%ymm13 - vmovdqu -16+160-128(%rsi),%ymm12 - vpaddq %ymm13,%ymm3,%ymm3 - vpmuludq %ymm10,%ymm0,%ymm0 - vmovdqu -16+192-128(%rsi),%ymm13 - vpaddq %ymm0,%ymm4,%ymm4 - vpmuludq %ymm10,%ymm12,%ymm12 - vmovdqu -16+224-128(%rsi),%ymm0 - vpaddq %ymm12,%ymm5,%ymm5 - vpmuludq %ymm10,%ymm13,%ymm13 - vmovdqu -16+256-128(%rsi),%ymm12 - vpaddq %ymm13,%ymm6,%ymm6 - vpmuludq %ymm10,%ymm0,%ymm0 - vmovdqu -16+288-128(%rsi),%ymm13 - vpaddq %ymm0,%ymm7,%ymm7 - vpmuludq %ymm10,%ymm12,%ymm12 - vpaddq %ymm12,%ymm8,%ymm8 - vpmuludq %ymm10,%ymm13,%ymm13 - vpbroadcastq 24(%r13),%ymm10 - vpaddq %ymm13,%ymm9,%ymm9 - - vmovdqu -16+32-128(%rcx),%ymm0 - movq %rax,%rdx - imulq -128(%rcx),%rax - addq %rax,%r11 - vmovdqu -16+64-128(%rcx),%ymm12 - imulq 8-128(%rcx),%rdx - addq %rdx,%r12 - shrq $29,%r11 - - vpmuludq %ymm11,%ymm0,%ymm0 - vmovq %xmm10,%rbx - vmovdqu -16+96-128(%rcx),%ymm13 - vpaddq %ymm0,%ymm1,%ymm1 - vpmuludq %ymm11,%ymm12,%ymm12 - vmovdqu -16+128-128(%rcx),%ymm0 - vpaddq %ymm12,%ymm2,%ymm2 - vpmuludq %ymm11,%ymm13,%ymm13 - vmovdqu -16+160-128(%rcx),%ymm12 - vpaddq %ymm13,%ymm3,%ymm3 - vpmuludq %ymm11,%ymm0,%ymm0 - vmovdqu -16+192-128(%rcx),%ymm13 - vpaddq %ymm0,%ymm4,%ymm4 - vpmuludq %ymm11,%ymm12,%ymm12 - vmovdqu -16+224-128(%rcx),%ymm0 - vpaddq %ymm12,%ymm5,%ymm5 - vpmuludq %ymm11,%ymm13,%ymm13 - vmovdqu -16+256-128(%rcx),%ymm12 - vpaddq %ymm13,%ymm6,%ymm6 - vpmuludq %ymm11,%ymm0,%ymm0 - vmovdqu -16+288-128(%rcx),%ymm13 - vpaddq %ymm0,%ymm7,%ymm7 - vpmuludq %ymm11,%ymm12,%ymm12 - vmovdqu -24+32-128(%rsi),%ymm0 - vpaddq %ymm12,%ymm8,%ymm8 - vpmuludq %ymm11,%ymm13,%ymm13 - vmovdqu -24+64-128(%rsi),%ymm12 - vpaddq %ymm13,%ymm9,%ymm9 - - addq %r11,%r12 - imulq -128(%rsi),%rbx - addq %rbx,%r12 - - movq %r12,%rax - imull %r8d,%eax - andl $536870911,%eax - - vpmuludq %ymm10,%ymm0,%ymm0 - vmovd %eax,%xmm11 - vmovdqu -24+96-128(%rsi),%ymm13 - vpaddq %ymm0,%ymm1,%ymm1 - vpmuludq %ymm10,%ymm12,%ymm12 - vpbroadcastq %xmm11,%ymm11 - vmovdqu -24+128-128(%rsi),%ymm0 - vpaddq %ymm12,%ymm2,%ymm2 - vpmuludq %ymm10,%ymm13,%ymm13 - vmovdqu -24+160-128(%rsi),%ymm12 - vpaddq %ymm13,%ymm3,%ymm3 - vpmuludq %ymm10,%ymm0,%ymm0 - vmovdqu -24+192-128(%rsi),%ymm13 - vpaddq %ymm0,%ymm4,%ymm4 - vpmuludq %ymm10,%ymm12,%ymm12 - vmovdqu -24+224-128(%rsi),%ymm0 - vpaddq %ymm12,%ymm5,%ymm5 - vpmuludq %ymm10,%ymm13,%ymm13 - vmovdqu -24+256-128(%rsi),%ymm12 - vpaddq %ymm13,%ymm6,%ymm6 - vpmuludq %ymm10,%ymm0,%ymm0 - vmovdqu -24+288-128(%rsi),%ymm13 - vpaddq %ymm0,%ymm7,%ymm7 - vpmuludq %ymm10,%ymm12,%ymm12 - vpaddq %ymm12,%ymm8,%ymm8 - vpmuludq %ymm10,%ymm13,%ymm13 - vpbroadcastq 32(%r13),%ymm10 - vpaddq %ymm13,%ymm9,%ymm9 - addq $32,%r13 - - vmovdqu -24+32-128(%rcx),%ymm0 - imulq -128(%rcx),%rax - addq %rax,%r12 - shrq $29,%r12 - - vmovdqu -24+64-128(%rcx),%ymm12 - vpmuludq %ymm11,%ymm0,%ymm0 - vmovq %xmm10,%rbx - vmovdqu -24+96-128(%rcx),%ymm13 - vpaddq %ymm0,%ymm1,%ymm0 - vpmuludq %ymm11,%ymm12,%ymm12 - vmovdqu %ymm0,(%rsp) - vpaddq %ymm12,%ymm2,%ymm1 - vmovdqu -24+128-128(%rcx),%ymm0 - vpmuludq %ymm11,%ymm13,%ymm13 - vmovdqu -24+160-128(%rcx),%ymm12 - vpaddq %ymm13,%ymm3,%ymm2 - vpmuludq %ymm11,%ymm0,%ymm0 - vmovdqu -24+192-128(%rcx),%ymm13 - vpaddq %ymm0,%ymm4,%ymm3 - vpmuludq %ymm11,%ymm12,%ymm12 - vmovdqu -24+224-128(%rcx),%ymm0 - vpaddq %ymm12,%ymm5,%ymm4 - vpmuludq %ymm11,%ymm13,%ymm13 - vmovdqu -24+256-128(%rcx),%ymm12 - vpaddq %ymm13,%ymm6,%ymm5 - vpmuludq %ymm11,%ymm0,%ymm0 - vmovdqu -24+288-128(%rcx),%ymm13 - movq %r12,%r9 - vpaddq %ymm0,%ymm7,%ymm6 - vpmuludq %ymm11,%ymm12,%ymm12 - addq (%rsp),%r9 - vpaddq %ymm12,%ymm8,%ymm7 - vpmuludq %ymm11,%ymm13,%ymm13 - vmovq %r12,%xmm12 - vpaddq %ymm13,%ymm9,%ymm8 - - decl %r14d - jnz L$oop_mul_1024 - vpermq $0,%ymm15,%ymm15 - vpaddq (%rsp),%ymm12,%ymm0 - - vpsrlq $29,%ymm0,%ymm12 - vpand %ymm15,%ymm0,%ymm0 - vpsrlq $29,%ymm1,%ymm13 - vpand %ymm15,%ymm1,%ymm1 - vpsrlq $29,%ymm2,%ymm10 - vpermq $147,%ymm12,%ymm12 - vpand %ymm15,%ymm2,%ymm2 - vpsrlq $29,%ymm3,%ymm11 - vpermq $147,%ymm13,%ymm13 - vpand %ymm15,%ymm3,%ymm3 - - vpblendd $3,%ymm14,%ymm12,%ymm9 - vpermq $147,%ymm10,%ymm10 - vpblendd $3,%ymm12,%ymm13,%ymm12 - vpermq $147,%ymm11,%ymm11 - vpaddq %ymm9,%ymm0,%ymm0 - vpblendd $3,%ymm13,%ymm10,%ymm13 - vpaddq %ymm12,%ymm1,%ymm1 - vpblendd $3,%ymm10,%ymm11,%ymm10 - vpaddq %ymm13,%ymm2,%ymm2 - vpblendd $3,%ymm11,%ymm14,%ymm11 - vpaddq %ymm10,%ymm3,%ymm3 - vpaddq %ymm11,%ymm4,%ymm4 - - vpsrlq $29,%ymm0,%ymm12 - vpand %ymm15,%ymm0,%ymm0 - vpsrlq $29,%ymm1,%ymm13 - vpand %ymm15,%ymm1,%ymm1 - vpsrlq $29,%ymm2,%ymm10 - vpermq $147,%ymm12,%ymm12 - vpand %ymm15,%ymm2,%ymm2 - vpsrlq $29,%ymm3,%ymm11 - vpermq $147,%ymm13,%ymm13 - vpand %ymm15,%ymm3,%ymm3 - vpermq $147,%ymm10,%ymm10 - - vpblendd $3,%ymm14,%ymm12,%ymm9 - vpermq $147,%ymm11,%ymm11 - vpblendd $3,%ymm12,%ymm13,%ymm12 - vpaddq %ymm9,%ymm0,%ymm0 - vpblendd $3,%ymm13,%ymm10,%ymm13 - vpaddq %ymm12,%ymm1,%ymm1 - vpblendd $3,%ymm10,%ymm11,%ymm10 - vpaddq %ymm13,%ymm2,%ymm2 - vpblendd $3,%ymm11,%ymm14,%ymm11 - vpaddq %ymm10,%ymm3,%ymm3 - vpaddq %ymm11,%ymm4,%ymm4 - - vmovdqu %ymm0,0-128(%rdi) - vmovdqu %ymm1,32-128(%rdi) - vmovdqu %ymm2,64-128(%rdi) - vmovdqu %ymm3,96-128(%rdi) - vpsrlq $29,%ymm4,%ymm12 - vpand %ymm15,%ymm4,%ymm4 - vpsrlq $29,%ymm5,%ymm13 - vpand %ymm15,%ymm5,%ymm5 - vpsrlq $29,%ymm6,%ymm10 - vpermq $147,%ymm12,%ymm12 - vpand %ymm15,%ymm6,%ymm6 - vpsrlq $29,%ymm7,%ymm11 - vpermq $147,%ymm13,%ymm13 - vpand %ymm15,%ymm7,%ymm7 - vpsrlq $29,%ymm8,%ymm0 - vpermq $147,%ymm10,%ymm10 - vpand %ymm15,%ymm8,%ymm8 - vpermq $147,%ymm11,%ymm11 - - vpblendd $3,%ymm14,%ymm12,%ymm9 - vpermq $147,%ymm0,%ymm0 - vpblendd $3,%ymm12,%ymm13,%ymm12 - vpaddq %ymm9,%ymm4,%ymm4 - vpblendd $3,%ymm13,%ymm10,%ymm13 - vpaddq %ymm12,%ymm5,%ymm5 - vpblendd $3,%ymm10,%ymm11,%ymm10 - vpaddq %ymm13,%ymm6,%ymm6 - vpblendd $3,%ymm11,%ymm0,%ymm11 - vpaddq %ymm10,%ymm7,%ymm7 - vpaddq %ymm11,%ymm8,%ymm8 - - vpsrlq $29,%ymm4,%ymm12 - vpand %ymm15,%ymm4,%ymm4 - vpsrlq $29,%ymm5,%ymm13 - vpand %ymm15,%ymm5,%ymm5 - vpsrlq $29,%ymm6,%ymm10 - vpermq $147,%ymm12,%ymm12 - vpand %ymm15,%ymm6,%ymm6 - vpsrlq $29,%ymm7,%ymm11 - vpermq $147,%ymm13,%ymm13 - vpand %ymm15,%ymm7,%ymm7 - vpsrlq $29,%ymm8,%ymm0 - vpermq $147,%ymm10,%ymm10 - vpand %ymm15,%ymm8,%ymm8 - vpermq $147,%ymm11,%ymm11 - - vpblendd $3,%ymm14,%ymm12,%ymm9 - vpermq $147,%ymm0,%ymm0 - vpblendd $3,%ymm12,%ymm13,%ymm12 - vpaddq %ymm9,%ymm4,%ymm4 - vpblendd $3,%ymm13,%ymm10,%ymm13 - vpaddq %ymm12,%ymm5,%ymm5 - vpblendd $3,%ymm10,%ymm11,%ymm10 - vpaddq %ymm13,%ymm6,%ymm6 - vpblendd $3,%ymm11,%ymm0,%ymm11 - vpaddq %ymm10,%ymm7,%ymm7 - vpaddq %ymm11,%ymm8,%ymm8 - - vmovdqu %ymm4,128-128(%rdi) - vmovdqu %ymm5,160-128(%rdi) - vmovdqu %ymm6,192-128(%rdi) - vmovdqu %ymm7,224-128(%rdi) - vmovdqu %ymm8,256-128(%rdi) - vzeroupper - - movq %rbp,%rax - movq -48(%rax),%r15 - movq -40(%rax),%r14 - movq -32(%rax),%r13 - movq -24(%rax),%r12 - movq -16(%rax),%rbp - movq -8(%rax),%rbx - leaq (%rax),%rsp -L$mul_1024_epilogue: - .byte 0xf3,0xc3 - -.globl _rsaz_1024_red2norm_avx2 +.globl _rsaz_avx2_eligible -.p2align 5 -_rsaz_1024_red2norm_avx2: - subq $-128,%rsi - xorq %rax,%rax - movq -128(%rsi),%r8 - movq -120(%rsi),%r9 - movq -112(%rsi),%r10 - shlq $0,%r8 - shlq $29,%r9 - movq %r10,%r11 - shlq $58,%r10 - shrq $6,%r11 - addq %r8,%rax - addq %r9,%rax - addq %r10,%rax - adcq $0,%r11 - movq %rax,0(%rdi) - movq %r11,%rax - movq -104(%rsi),%r8 - movq -96(%rsi),%r9 - shlq $23,%r8 - movq %r9,%r10 - shlq $52,%r9 - shrq $12,%r10 - addq %r8,%rax - addq %r9,%rax - adcq $0,%r10 - movq %rax,8(%rdi) - movq %r10,%rax - movq -88(%rsi),%r11 - movq -80(%rsi),%r8 - shlq $17,%r11 - movq %r8,%r9 - shlq $46,%r8 - shrq $18,%r9 - addq %r11,%rax - addq %r8,%rax - adcq $0,%r9 - movq %rax,16(%rdi) - movq %r9,%rax - movq -72(%rsi),%r10 - movq -64(%rsi),%r11 - shlq $11,%r10 - movq %r11,%r8 - shlq $40,%r11 - shrq $24,%r8 - addq %r10,%rax - addq %r11,%rax - adcq $0,%r8 - movq %rax,24(%rdi) - movq %r8,%rax - movq -56(%rsi),%r9 - movq -48(%rsi),%r10 - movq -40(%rsi),%r11 - shlq $5,%r9 - shlq $34,%r10 - movq %r11,%r8 - shlq $63,%r11 - shrq $1,%r8 - addq %r9,%rax - addq %r10,%rax - addq %r11,%rax - adcq $0,%r8 - movq %rax,32(%rdi) - movq %r8,%rax - movq -32(%rsi),%r9 - movq -24(%rsi),%r10 - shlq $28,%r9 - movq %r10,%r11 - shlq $57,%r10 - shrq $7,%r11 - addq %r9,%rax - addq %r10,%rax - adcq $0,%r11 - movq %rax,40(%rdi) - movq %r11,%rax - movq -16(%rsi),%r8 - movq -8(%rsi),%r9 - shlq $22,%r8 - movq %r9,%r10 - shlq $51,%r9 - shrq $13,%r10 - addq %r8,%rax - addq %r9,%rax - adcq $0,%r10 - movq %rax,48(%rdi) - movq %r10,%rax - movq 0(%rsi),%r11 - movq 8(%rsi),%r8 - shlq $16,%r11 - movq %r8,%r9 - shlq $45,%r8 - shrq $19,%r9 - addq %r11,%rax - addq %r8,%rax - adcq $0,%r9 - movq %rax,56(%rdi) - movq %r9,%rax - movq 16(%rsi),%r10 - movq 24(%rsi),%r11 - shlq $10,%r10 - movq %r11,%r8 - shlq $39,%r11 - shrq $25,%r8 - addq %r10,%rax - addq %r11,%rax - adcq $0,%r8 - movq %rax,64(%rdi) - movq %r8,%rax - movq 32(%rsi),%r9 - movq 40(%rsi),%r10 - movq 48(%rsi),%r11 - shlq $4,%r9 - shlq $33,%r10 - movq %r11,%r8 - shlq $62,%r11 - shrq $2,%r8 - addq %r9,%rax - addq %r10,%rax - addq %r11,%rax - adcq $0,%r8 - movq %rax,72(%rdi) - movq %r8,%rax - movq 56(%rsi),%r9 - movq 64(%rsi),%r10 - shlq $27,%r9 - movq %r10,%r11 - shlq $56,%r10 - shrq $8,%r11 - addq %r9,%rax - addq %r10,%rax - adcq $0,%r11 - movq %rax,80(%rdi) - movq %r11,%rax - movq 72(%rsi),%r8 - movq 80(%rsi),%r9 - shlq $21,%r8 - movq %r9,%r10 - shlq $50,%r9 - shrq $14,%r10 - addq %r8,%rax - addq %r9,%rax - adcq $0,%r10 - movq %rax,88(%rdi) - movq %r10,%rax - movq 88(%rsi),%r11 - movq 96(%rsi),%r8 - shlq $15,%r11 - movq %r8,%r9 - shlq $44,%r8 - shrq $20,%r9 - addq %r11,%rax - addq %r8,%rax - adcq $0,%r9 - movq %rax,96(%rdi) - movq %r9,%rax - movq 104(%rsi),%r10 - movq 112(%rsi),%r11 - shlq $9,%r10 - movq %r11,%r8 - shlq $38,%r11 - shrq $26,%r8 - addq %r10,%rax - addq %r11,%rax - adcq $0,%r8 - movq %rax,104(%rdi) - movq %r8,%rax - movq 120(%rsi),%r9 - movq 128(%rsi),%r10 - movq 136(%rsi),%r11 - shlq $3,%r9 - shlq $32,%r10 - movq %r11,%r8 - shlq $61,%r11 - shrq $3,%r8 - addq %r9,%rax - addq %r10,%rax - addq %r11,%rax - adcq $0,%r8 - movq %rax,112(%rdi) - movq %r8,%rax - movq 144(%rsi),%r9 - movq 152(%rsi),%r10 - shlq $26,%r9 - movq %r10,%r11 - shlq $55,%r10 - shrq $9,%r11 - addq %r9,%rax - addq %r10,%rax - adcq $0,%r11 - movq %rax,120(%rdi) - movq %r11,%rax +_rsaz_avx2_eligible: + xorl %eax,%eax .byte 0xf3,0xc3 +.globl _rsaz_1024_sqr_avx2 +.globl _rsaz_1024_mul_avx2 .globl _rsaz_1024_norm2red_avx2 - -.p2align 5 -_rsaz_1024_norm2red_avx2: - subq $-128,%rdi - movq (%rsi),%r8 - movl $536870911,%eax - movq 8(%rsi),%r9 - movq %r8,%r11 - shrq $0,%r11 - andq %rax,%r11 - movq %r11,-128(%rdi) - movq %r8,%r10 - shrq $29,%r10 - andq %rax,%r10 - movq %r10,-120(%rdi) - shrdq $58,%r9,%r8 - andq %rax,%r8 - movq %r8,-112(%rdi) - movq 16(%rsi),%r10 - movq %r9,%r8 - shrq $23,%r8 - andq %rax,%r8 - movq %r8,-104(%rdi) - shrdq $52,%r10,%r9 - andq %rax,%r9 - movq %r9,-96(%rdi) - movq 24(%rsi),%r11 - movq %r10,%r9 - shrq $17,%r9 - andq %rax,%r9 - movq %r9,-88(%rdi) - shrdq $46,%r11,%r10 - andq %rax,%r10 - movq %r10,-80(%rdi) - movq 32(%rsi),%r8 - movq %r11,%r10 - shrq $11,%r10 - andq %rax,%r10 - movq %r10,-72(%rdi) - shrdq $40,%r8,%r11 - andq %rax,%r11 - movq %r11,-64(%rdi) - movq 40(%rsi),%r9 - movq %r8,%r11 - shrq $5,%r11 - andq %rax,%r11 - movq %r11,-56(%rdi) - movq %r8,%r10 - shrq $34,%r10 - andq %rax,%r10 - movq %r10,-48(%rdi) - shrdq $63,%r9,%r8 - andq %rax,%r8 - movq %r8,-40(%rdi) - movq 48(%rsi),%r10 - movq %r9,%r8 - shrq $28,%r8 - andq %rax,%r8 - movq %r8,-32(%rdi) - shrdq $57,%r10,%r9 - andq %rax,%r9 - movq %r9,-24(%rdi) - movq 56(%rsi),%r11 - movq %r10,%r9 - shrq $22,%r9 - andq %rax,%r9 - movq %r9,-16(%rdi) - shrdq $51,%r11,%r10 - andq %rax,%r10 - movq %r10,-8(%rdi) - movq 64(%rsi),%r8 - movq %r11,%r10 - shrq $16,%r10 - andq %rax,%r10 - movq %r10,0(%rdi) - shrdq $45,%r8,%r11 - andq %rax,%r11 - movq %r11,8(%rdi) - movq 72(%rsi),%r9 - movq %r8,%r11 - shrq $10,%r11 - andq %rax,%r11 - movq %r11,16(%rdi) - shrdq $39,%r9,%r8 - andq %rax,%r8 - movq %r8,24(%rdi) - movq 80(%rsi),%r10 - movq %r9,%r8 - shrq $4,%r8 - andq %rax,%r8 - movq %r8,32(%rdi) - movq %r9,%r11 - shrq $33,%r11 - andq %rax,%r11 - movq %r11,40(%rdi) - shrdq $62,%r10,%r9 - andq %rax,%r9 - movq %r9,48(%rdi) - movq 88(%rsi),%r11 - movq %r10,%r9 - shrq $27,%r9 - andq %rax,%r9 - movq %r9,56(%rdi) - shrdq $56,%r11,%r10 - andq %rax,%r10 - movq %r10,64(%rdi) - movq 96(%rsi),%r8 - movq %r11,%r10 - shrq $21,%r10 - andq %rax,%r10 - movq %r10,72(%rdi) - shrdq $50,%r8,%r11 - andq %rax,%r11 - movq %r11,80(%rdi) - movq 104(%rsi),%r9 - movq %r8,%r11 - shrq $15,%r11 - andq %rax,%r11 - movq %r11,88(%rdi) - shrdq $44,%r9,%r8 - andq %rax,%r8 - movq %r8,96(%rdi) - movq 112(%rsi),%r10 - movq %r9,%r8 - shrq $9,%r8 - andq %rax,%r8 - movq %r8,104(%rdi) - shrdq $38,%r10,%r9 - andq %rax,%r9 - movq %r9,112(%rdi) - movq 120(%rsi),%r11 - movq %r10,%r9 - shrq $3,%r9 - andq %rax,%r9 - movq %r9,120(%rdi) - movq %r10,%r8 - shrq $32,%r8 - andq %rax,%r8 - movq %r8,128(%rdi) - shrdq $61,%r11,%r10 - andq %rax,%r10 - movq %r10,136(%rdi) - xorq %r8,%r8 - movq %r11,%r10 - shrq $26,%r10 - andq %rax,%r10 - movq %r10,144(%rdi) - shrdq $55,%r8,%r11 - andq %rax,%r11 - movq %r11,152(%rdi) - movq %r8,160(%rdi) - movq %r8,168(%rdi) - movq %r8,176(%rdi) - movq %r8,184(%rdi) - .byte 0xf3,0xc3 - +.globl _rsaz_1024_red2norm_avx2 .globl _rsaz_1024_scatter5_avx2 - -.p2align 5 -_rsaz_1024_scatter5_avx2: - vzeroupper - vmovdqu L$scatter_permd(%rip),%ymm5 - shll $4,%edx - leaq (%rdi,%rdx,1),%rdi - movl $9,%eax - jmp L$oop_scatter_1024 - -.p2align 5 -L$oop_scatter_1024: - vmovdqu (%rsi),%ymm0 - leaq 32(%rsi),%rsi - vpermd %ymm0,%ymm5,%ymm0 - vmovdqu %xmm0,(%rdi) - leaq 512(%rdi),%rdi - decl %eax - jnz L$oop_scatter_1024 - - vzeroupper - .byte 0xf3,0xc3 - - .globl _rsaz_1024_gather5_avx2 -.p2align 5 +_rsaz_1024_sqr_avx2: +_rsaz_1024_mul_avx2: +_rsaz_1024_norm2red_avx2: +_rsaz_1024_red2norm_avx2: +_rsaz_1024_scatter5_avx2: _rsaz_1024_gather5_avx2: - leaq L$gather_table(%rip),%r11 - movl %edx,%eax - andl $3,%edx - shrl $2,%eax - shll $4,%edx - - vmovdqu -32(%r11),%ymm7 - vpbroadcastb 8(%r11,%rax,1),%xmm8 - vpbroadcastb 7(%r11,%rax,1),%xmm9 - vpbroadcastb 6(%r11,%rax,1),%xmm10 - vpbroadcastb 5(%r11,%rax,1),%xmm11 - vpbroadcastb 4(%r11,%rax,1),%xmm12 - vpbroadcastb 3(%r11,%rax,1),%xmm13 - vpbroadcastb 2(%r11,%rax,1),%xmm14 - vpbroadcastb 1(%r11,%rax,1),%xmm15 - - leaq 64(%rsi,%rdx,1),%rsi - movq $64,%r11 - movl $9,%eax - jmp L$oop_gather_1024 - -.p2align 5 -L$oop_gather_1024: - vpand -64(%rsi),%xmm8,%xmm0 - vpand (%rsi),%xmm9,%xmm1 - vpand 64(%rsi),%xmm10,%xmm2 - vpand (%rsi,%r11,2),%xmm11,%xmm3 - vpor %xmm0,%xmm1,%xmm1 - vpand 64(%rsi,%r11,2),%xmm12,%xmm4 - vpor %xmm2,%xmm3,%xmm3 - vpand (%rsi,%r11,4),%xmm13,%xmm5 - vpor %xmm1,%xmm3,%xmm3 - vpand 64(%rsi,%r11,4),%xmm14,%xmm6 - vpor %xmm4,%xmm5,%xmm5 - vpand -128(%rsi,%r11,8),%xmm15,%xmm2 - leaq (%rsi,%r11,8),%rsi - vpor %xmm3,%xmm5,%xmm5 - vpor %xmm2,%xmm6,%xmm6 - vpor %xmm5,%xmm6,%xmm6 - vpermd %ymm6,%ymm7,%ymm6 - vmovdqu %ymm6,(%rdi) - leaq 32(%rdi),%rdi - decl %eax - jnz L$oop_gather_1024 - - vpxor %ymm0,%ymm0,%ymm0 - vmovdqu %ymm0,(%rdi) - vzeroupper +.byte 0x0f,0x0b .byte 0xf3,0xc3 - - -.globl _rsaz_avx2_eligible - -.p2align 5 -_rsaz_avx2_eligible: - movl _OPENSSL_ia32cap_P+8(%rip),%eax - movl $524544,%ecx - movl $0,%edx - andl %eax,%ecx - cmpl $524544,%ecx - cmovel %edx,%eax - andl $32,%eax - shrl $5,%eax - .byte 0xf3,0xc3 - - -.p2align 6 -L$and_mask: -.quad 0x1fffffff,0x1fffffff,0x1fffffff,-1 -L$scatter_permd: -.long 0,2,4,6,7,7,7,7 -L$gather_permd: -.long 0,7,1,7,2,7,3,7 -L$gather_table: -.byte 0,0,0,0,0,0,0,0, 0xff,0,0,0,0,0,0,0 -.p2align 6 diff --git a/deps/openssl/asm/x64-macosx-gas/bn/rsaz-x86_64.s b/deps/openssl/asm/x64-macosx-gas/bn/rsaz-x86_64.s index 23c540d3acb221..b92f098e73c214 100644 --- a/deps/openssl/asm/x64-macosx-gas/bn/rsaz-x86_64.s +++ b/deps/openssl/asm/x64-macosx-gas/bn/rsaz-x86_64.s @@ -19,10 +19,6 @@ L$sqr_body: movq (%rsi),%rdx movq 8(%rsi),%rax movq %rcx,128(%rsp) - movl $524544,%r11d - andl _OPENSSL_ia32cap_P+8(%rip),%r11d - cmpl $524544,%r11d - je L$oop_sqrx jmp L$oop_sqr .p2align 5 @@ -386,276 +382,6 @@ L$oop_sqr: decl %r8d jnz L$oop_sqr - jmp L$sqr_tail - -.p2align 5 -L$oop_sqrx: - movl %r8d,128+8(%rsp) -.byte 102,72,15,110,199 -.byte 102,72,15,110,205 - - mulxq %rax,%r8,%r9 - - mulxq 16(%rsi),%rcx,%r10 - xorq %rbp,%rbp - - mulxq 24(%rsi),%rax,%r11 - adcxq %rcx,%r9 - - mulxq 32(%rsi),%rcx,%r12 - adcxq %rax,%r10 - - mulxq 40(%rsi),%rax,%r13 - adcxq %rcx,%r11 - -.byte 0xc4,0x62,0xf3,0xf6,0xb6,0x30,0x00,0x00,0x00 - adcxq %rax,%r12 - adcxq %rcx,%r13 - -.byte 0xc4,0x62,0xfb,0xf6,0xbe,0x38,0x00,0x00,0x00 - adcxq %rax,%r14 - adcxq %rbp,%r15 - - movq %r9,%rcx - shldq $1,%r8,%r9 - shlq $1,%r8 - - xorl %ebp,%ebp - mulxq %rdx,%rax,%rdx - adcxq %rdx,%r8 - movq 8(%rsi),%rdx - adcxq %rbp,%r9 - - movq %rax,(%rsp) - movq %r8,8(%rsp) - - - mulxq 16(%rsi),%rax,%rbx - adoxq %rax,%r10 - adcxq %rbx,%r11 - -.byte 0xc4,0x62,0xc3,0xf6,0x86,0x18,0x00,0x00,0x00 - adoxq %rdi,%r11 - adcxq %r8,%r12 - - mulxq 32(%rsi),%rax,%rbx - adoxq %rax,%r12 - adcxq %rbx,%r13 - - mulxq 40(%rsi),%rdi,%r8 - adoxq %rdi,%r13 - adcxq %r8,%r14 - -.byte 0xc4,0xe2,0xfb,0xf6,0x9e,0x30,0x00,0x00,0x00 - adoxq %rax,%r14 - adcxq %rbx,%r15 - -.byte 0xc4,0x62,0xc3,0xf6,0x86,0x38,0x00,0x00,0x00 - adoxq %rdi,%r15 - adcxq %rbp,%r8 - adoxq %rbp,%r8 - - movq %r11,%rbx - shldq $1,%r10,%r11 - shldq $1,%rcx,%r10 - - xorl %ebp,%ebp - mulxq %rdx,%rax,%rcx - movq 16(%rsi),%rdx - adcxq %rax,%r9 - adcxq %rcx,%r10 - adcxq %rbp,%r11 - - movq %r9,16(%rsp) -.byte 0x4c,0x89,0x94,0x24,0x18,0x00,0x00,0x00 - - -.byte 0xc4,0x62,0xc3,0xf6,0x8e,0x18,0x00,0x00,0x00 - adoxq %rdi,%r12 - adcxq %r9,%r13 - - mulxq 32(%rsi),%rax,%rcx - adoxq %rax,%r13 - adcxq %rcx,%r14 - - mulxq 40(%rsi),%rdi,%r9 - adoxq %rdi,%r14 - adcxq %r9,%r15 - -.byte 0xc4,0xe2,0xfb,0xf6,0x8e,0x30,0x00,0x00,0x00 - adoxq %rax,%r15 - adcxq %rcx,%r8 - -.byte 0xc4,0x62,0xc3,0xf6,0x8e,0x38,0x00,0x00,0x00 - adoxq %rdi,%r8 - adcxq %rbp,%r9 - adoxq %rbp,%r9 - - movq %r13,%rcx - shldq $1,%r12,%r13 - shldq $1,%rbx,%r12 - - xorl %ebp,%ebp - mulxq %rdx,%rax,%rdx - adcxq %rax,%r11 - adcxq %rdx,%r12 - movq 24(%rsi),%rdx - adcxq %rbp,%r13 - - movq %r11,32(%rsp) -.byte 0x4c,0x89,0xa4,0x24,0x28,0x00,0x00,0x00 - - -.byte 0xc4,0xe2,0xfb,0xf6,0x9e,0x20,0x00,0x00,0x00 - adoxq %rax,%r14 - adcxq %rbx,%r15 - - mulxq 40(%rsi),%rdi,%r10 - adoxq %rdi,%r15 - adcxq %r10,%r8 - - mulxq 48(%rsi),%rax,%rbx - adoxq %rax,%r8 - adcxq %rbx,%r9 - - mulxq 56(%rsi),%rdi,%r10 - adoxq %rdi,%r9 - adcxq %rbp,%r10 - adoxq %rbp,%r10 - -.byte 0x66 - movq %r15,%rbx - shldq $1,%r14,%r15 - shldq $1,%rcx,%r14 - - xorl %ebp,%ebp - mulxq %rdx,%rax,%rdx - adcxq %rax,%r13 - adcxq %rdx,%r14 - movq 32(%rsi),%rdx - adcxq %rbp,%r15 - - movq %r13,48(%rsp) - movq %r14,56(%rsp) - - -.byte 0xc4,0x62,0xc3,0xf6,0x9e,0x28,0x00,0x00,0x00 - adoxq %rdi,%r8 - adcxq %r11,%r9 - - mulxq 48(%rsi),%rax,%rcx - adoxq %rax,%r9 - adcxq %rcx,%r10 - - mulxq 56(%rsi),%rdi,%r11 - adoxq %rdi,%r10 - adcxq %rbp,%r11 - adoxq %rbp,%r11 - - movq %r9,%rcx - shldq $1,%r8,%r9 - shldq $1,%rbx,%r8 - - xorl %ebp,%ebp - mulxq %rdx,%rax,%rdx - adcxq %rax,%r15 - adcxq %rdx,%r8 - movq 40(%rsi),%rdx - adcxq %rbp,%r9 - - movq %r15,64(%rsp) - movq %r8,72(%rsp) - - -.byte 0xc4,0xe2,0xfb,0xf6,0x9e,0x30,0x00,0x00,0x00 - adoxq %rax,%r10 - adcxq %rbx,%r11 - -.byte 0xc4,0x62,0xc3,0xf6,0xa6,0x38,0x00,0x00,0x00 - adoxq %rdi,%r11 - adcxq %rbp,%r12 - adoxq %rbp,%r12 - - movq %r11,%rbx - shldq $1,%r10,%r11 - shldq $1,%rcx,%r10 - - xorl %ebp,%ebp - mulxq %rdx,%rax,%rdx - adcxq %rax,%r9 - adcxq %rdx,%r10 - movq 48(%rsi),%rdx - adcxq %rbp,%r11 - - movq %r9,80(%rsp) - movq %r10,88(%rsp) - - -.byte 0xc4,0x62,0xfb,0xf6,0xae,0x38,0x00,0x00,0x00 - adoxq %rax,%r12 - adoxq %rbp,%r13 - - xorq %r14,%r14 - shldq $1,%r13,%r14 - shldq $1,%r12,%r13 - shldq $1,%rbx,%r12 - - xorl %ebp,%ebp - mulxq %rdx,%rax,%rdx - adcxq %rax,%r11 - adcxq %rdx,%r12 - movq 56(%rsi),%rdx - adcxq %rbp,%r13 - -.byte 0x4c,0x89,0x9c,0x24,0x60,0x00,0x00,0x00 -.byte 0x4c,0x89,0xa4,0x24,0x68,0x00,0x00,0x00 - - - mulxq %rdx,%rax,%rdx - adoxq %rax,%r13 - adoxq %rbp,%rdx - -.byte 0x66 - addq %rdx,%r14 - - movq %r13,112(%rsp) - movq %r14,120(%rsp) -.byte 102,72,15,126,199 -.byte 102,72,15,126,205 - - movq 128(%rsp),%rdx - movq (%rsp),%r8 - movq 8(%rsp),%r9 - movq 16(%rsp),%r10 - movq 24(%rsp),%r11 - movq 32(%rsp),%r12 - movq 40(%rsp),%r13 - movq 48(%rsp),%r14 - movq 56(%rsp),%r15 - - call __rsaz_512_reducex - - addq 64(%rsp),%r8 - adcq 72(%rsp),%r9 - adcq 80(%rsp),%r10 - adcq 88(%rsp),%r11 - adcq 96(%rsp),%r12 - adcq 104(%rsp),%r13 - adcq 112(%rsp),%r14 - adcq 120(%rsp),%r15 - sbbq %rcx,%rcx - - call __rsaz_512_subtract - - movq %r8,%rdx - movq %r9,%rax - movl 128+8(%rsp),%r8d - movq %rdi,%rsi - - decl %r8d - jnz L$oop_sqrx - -L$sqr_tail: leaq 128+24+48(%rsp),%rax movq -48(%rax),%r15 @@ -684,10 +410,6 @@ L$mul_body: .byte 102,72,15,110,199 .byte 102,72,15,110,201 movq %r8,128(%rsp) - movl $524544,%r11d - andl _OPENSSL_ia32cap_P+8(%rip),%r11d - cmpl $524544,%r11d - je L$mulx movq (%rdx),%rbx movq %rdx,%rbp call __rsaz_512_mul @@ -705,29 +427,6 @@ L$mul_body: movq 56(%rsp),%r15 call __rsaz_512_reduce - jmp L$mul_tail - -.p2align 5 -L$mulx: - movq %rdx,%rbp - movq (%rdx),%rdx - call __rsaz_512_mulx - -.byte 102,72,15,126,199 -.byte 102,72,15,126,205 - - movq 128(%rsp),%rdx - movq (%rsp),%r8 - movq 8(%rsp),%r9 - movq 16(%rsp),%r10 - movq 24(%rsp),%r11 - movq 32(%rsp),%r12 - movq 40(%rsp),%r13 - movq 48(%rsp),%r14 - movq 56(%rsp),%r15 - - call __rsaz_512_reducex -L$mul_tail: addq 64(%rsp),%r8 adcq 72(%rsp),%r9 adcq 80(%rsp),%r10 @@ -762,52 +461,94 @@ _rsaz_512_mul_gather4: pushq %r14 pushq %r15 - movl %r9d,%r9d - subq $128+24,%rsp + subq $152,%rsp L$mul_gather4_body: - movl $524544,%r11d - andl _OPENSSL_ia32cap_P+8(%rip),%r11d - cmpl $524544,%r11d - je L$mulx_gather - movl 64(%rdx,%r9,4),%eax -.byte 102,72,15,110,199 - movl (%rdx,%r9,4),%ebx -.byte 102,72,15,110,201 + movd %r9d,%xmm8 + movdqa L$inc+16(%rip),%xmm1 + movdqa L$inc(%rip),%xmm0 + + pshufd $0,%xmm8,%xmm8 + movdqa %xmm1,%xmm7 + movdqa %xmm1,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm8,%xmm0 + movdqa %xmm7,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm8,%xmm1 + movdqa %xmm7,%xmm4 + paddd %xmm2,%xmm3 + pcmpeqd %xmm8,%xmm2 + movdqa %xmm7,%xmm5 + paddd %xmm3,%xmm4 + pcmpeqd %xmm8,%xmm3 + movdqa %xmm7,%xmm6 + paddd %xmm4,%xmm5 + pcmpeqd %xmm8,%xmm4 + paddd %xmm5,%xmm6 + pcmpeqd %xmm8,%xmm5 + paddd %xmm6,%xmm7 + pcmpeqd %xmm8,%xmm6 + pcmpeqd %xmm8,%xmm7 + + movdqa 0(%rdx),%xmm8 + movdqa 16(%rdx),%xmm9 + movdqa 32(%rdx),%xmm10 + movdqa 48(%rdx),%xmm11 + pand %xmm0,%xmm8 + movdqa 64(%rdx),%xmm12 + pand %xmm1,%xmm9 + movdqa 80(%rdx),%xmm13 + pand %xmm2,%xmm10 + movdqa 96(%rdx),%xmm14 + pand %xmm3,%xmm11 + movdqa 112(%rdx),%xmm15 + leaq 128(%rdx),%rbp + pand %xmm4,%xmm12 + pand %xmm5,%xmm13 + pand %xmm6,%xmm14 + pand %xmm7,%xmm15 + por %xmm10,%xmm8 + por %xmm11,%xmm9 + por %xmm12,%xmm8 + por %xmm13,%xmm9 + por %xmm14,%xmm8 + por %xmm15,%xmm9 + + por %xmm9,%xmm8 + pshufd $0x4e,%xmm8,%xmm9 + por %xmm9,%xmm8 +.byte 102,76,15,126,195 + movq %r8,128(%rsp) + movq %rdi,128+8(%rsp) + movq %rcx,128+16(%rsp) - shlq $32,%rax - orq %rax,%rbx movq (%rsi),%rax movq 8(%rsi),%rcx - leaq 128(%rdx,%r9,4),%rbp mulq %rbx movq %rax,(%rsp) movq %rcx,%rax movq %rdx,%r8 mulq %rbx - movd (%rbp),%xmm4 addq %rax,%r8 movq 16(%rsi),%rax movq %rdx,%r9 adcq $0,%r9 mulq %rbx - movd 64(%rbp),%xmm5 addq %rax,%r9 movq 24(%rsi),%rax movq %rdx,%r10 adcq $0,%r10 mulq %rbx - pslldq $4,%xmm5 addq %rax,%r10 movq 32(%rsi),%rax movq %rdx,%r11 adcq $0,%r11 mulq %rbx - por %xmm5,%xmm4 addq %rax,%r11 movq 40(%rsi),%rax movq %rdx,%r12 @@ -820,14 +561,12 @@ L$mul_gather4_body: adcq $0,%r13 mulq %rbx - leaq 128(%rbp),%rbp addq %rax,%r13 movq 56(%rsi),%rax movq %rdx,%r14 adcq $0,%r14 mulq %rbx -.byte 102,72,15,126,227 addq %rax,%r14 movq (%rsi),%rax movq %rdx,%r15 @@ -839,6 +578,35 @@ L$mul_gather4_body: .p2align 5 L$oop_mul_gather: + movdqa 0(%rbp),%xmm8 + movdqa 16(%rbp),%xmm9 + movdqa 32(%rbp),%xmm10 + movdqa 48(%rbp),%xmm11 + pand %xmm0,%xmm8 + movdqa 64(%rbp),%xmm12 + pand %xmm1,%xmm9 + movdqa 80(%rbp),%xmm13 + pand %xmm2,%xmm10 + movdqa 96(%rbp),%xmm14 + pand %xmm3,%xmm11 + movdqa 112(%rbp),%xmm15 + leaq 128(%rbp),%rbp + pand %xmm4,%xmm12 + pand %xmm5,%xmm13 + pand %xmm6,%xmm14 + pand %xmm7,%xmm15 + por %xmm10,%xmm8 + por %xmm11,%xmm9 + por %xmm12,%xmm8 + por %xmm13,%xmm9 + por %xmm14,%xmm8 + por %xmm15,%xmm9 + + por %xmm9,%xmm8 + pshufd $0x4e,%xmm8,%xmm9 + por %xmm9,%xmm8 +.byte 102,76,15,126,195 + mulq %rbx addq %rax,%r8 movq 8(%rsi),%rax @@ -847,7 +615,6 @@ L$oop_mul_gather: adcq $0,%r8 mulq %rbx - movd (%rbp),%xmm4 addq %rax,%r9 movq 16(%rsi),%rax adcq $0,%rdx @@ -856,7 +623,6 @@ L$oop_mul_gather: adcq $0,%r9 mulq %rbx - movd 64(%rbp),%xmm5 addq %rax,%r10 movq 24(%rsi),%rax adcq $0,%rdx @@ -865,7 +631,6 @@ L$oop_mul_gather: adcq $0,%r10 mulq %rbx - pslldq $4,%xmm5 addq %rax,%r11 movq 32(%rsi),%rax adcq $0,%rdx @@ -874,7 +639,6 @@ L$oop_mul_gather: adcq $0,%r11 mulq %rbx - por %xmm5,%xmm4 addq %rax,%r12 movq 40(%rsi),%rax adcq $0,%rdx @@ -899,7 +663,6 @@ L$oop_mul_gather: adcq $0,%r14 mulq %rbx -.byte 102,72,15,126,227 addq %rax,%r15 movq (%rsi),%rax adcq $0,%rdx @@ -907,7 +670,6 @@ L$oop_mul_gather: movq %rdx,%r15 adcq $0,%r15 - leaq 128(%rbp),%rbp leaq 8(%rdi),%rdi decl %ecx @@ -922,8 +684,8 @@ L$oop_mul_gather: movq %r14,48(%rdi) movq %r15,56(%rdi) -.byte 102,72,15,126,199 -.byte 102,72,15,126,205 + movq 128+8(%rsp),%rdi + movq 128+16(%rsp),%rbp movq (%rsp),%r8 movq 8(%rsp),%r9 @@ -935,126 +697,6 @@ L$oop_mul_gather: movq 56(%rsp),%r15 call __rsaz_512_reduce - jmp L$mul_gather_tail - -.p2align 5 -L$mulx_gather: - movl 64(%rdx,%r9,4),%eax -.byte 102,72,15,110,199 - leaq 128(%rdx,%r9,4),%rbp - movl (%rdx,%r9,4),%edx -.byte 102,72,15,110,201 - movq %r8,128(%rsp) - - shlq $32,%rax - orq %rax,%rdx - mulxq (%rsi),%rbx,%r8 - movq %rbx,(%rsp) - xorl %edi,%edi - - mulxq 8(%rsi),%rax,%r9 - movd (%rbp),%xmm4 - - mulxq 16(%rsi),%rbx,%r10 - movd 64(%rbp),%xmm5 - adcxq %rax,%r8 - - mulxq 24(%rsi),%rax,%r11 - pslldq $4,%xmm5 - adcxq %rbx,%r9 - - mulxq 32(%rsi),%rbx,%r12 - por %xmm5,%xmm4 - adcxq %rax,%r10 - - mulxq 40(%rsi),%rax,%r13 - adcxq %rbx,%r11 - - mulxq 48(%rsi),%rbx,%r14 - leaq 128(%rbp),%rbp - adcxq %rax,%r12 - - mulxq 56(%rsi),%rax,%r15 -.byte 102,72,15,126,226 - adcxq %rbx,%r13 - adcxq %rax,%r14 - movq %r8,%rbx - adcxq %rdi,%r15 - - movq $-7,%rcx - jmp L$oop_mulx_gather - -.p2align 5 -L$oop_mulx_gather: - mulxq (%rsi),%rax,%r8 - adcxq %rax,%rbx - adoxq %r9,%r8 - - mulxq 8(%rsi),%rax,%r9 -.byte 0x66,0x0f,0x6e,0xa5,0x00,0x00,0x00,0x00 - adcxq %rax,%r8 - adoxq %r10,%r9 - - mulxq 16(%rsi),%rax,%r10 - movd 64(%rbp),%xmm5 - leaq 128(%rbp),%rbp - adcxq %rax,%r9 - adoxq %r11,%r10 - -.byte 0xc4,0x62,0xfb,0xf6,0x9e,0x18,0x00,0x00,0x00 - pslldq $4,%xmm5 - por %xmm5,%xmm4 - adcxq %rax,%r10 - adoxq %r12,%r11 - - mulxq 32(%rsi),%rax,%r12 - adcxq %rax,%r11 - adoxq %r13,%r12 - - mulxq 40(%rsi),%rax,%r13 - adcxq %rax,%r12 - adoxq %r14,%r13 - -.byte 0xc4,0x62,0xfb,0xf6,0xb6,0x30,0x00,0x00,0x00 - adcxq %rax,%r13 - adoxq %r15,%r14 - - mulxq 56(%rsi),%rax,%r15 -.byte 102,72,15,126,226 - movq %rbx,64(%rsp,%rcx,8) - adcxq %rax,%r14 - adoxq %rdi,%r15 - movq %r8,%rbx - adcxq %rdi,%r15 - - incq %rcx - jnz L$oop_mulx_gather - - movq %r8,64(%rsp) - movq %r9,64+8(%rsp) - movq %r10,64+16(%rsp) - movq %r11,64+24(%rsp) - movq %r12,64+32(%rsp) - movq %r13,64+40(%rsp) - movq %r14,64+48(%rsp) - movq %r15,64+56(%rsp) - -.byte 102,72,15,126,199 -.byte 102,72,15,126,205 - - movq 128(%rsp),%rdx - movq (%rsp),%r8 - movq 8(%rsp),%r9 - movq 16(%rsp),%r10 - movq 24(%rsp),%r11 - movq 32(%rsp),%r12 - movq 40(%rsp),%r13 - movq 48(%rsp),%r14 - movq 56(%rsp),%r15 - - call __rsaz_512_reducex - -L$mul_gather_tail: addq 64(%rsp),%r8 adcq 72(%rsp),%r9 adcq 80(%rsp),%r10 @@ -1092,17 +734,13 @@ _rsaz_512_mul_scatter4: movl %r9d,%r9d subq $128+24,%rsp L$mul_scatter4_body: - leaq (%r8,%r9,4),%r8 + leaq (%r8,%r9,8),%r8 .byte 102,72,15,110,199 .byte 102,72,15,110,202 .byte 102,73,15,110,208 movq %rcx,128(%rsp) movq %rdi,%rbp - movl $524544,%r11d - andl _OPENSSL_ia32cap_P+8(%rip),%r11d - cmpl $524544,%r11d - je L$mulx_scatter movq (%rdi),%rbx call __rsaz_512_mul @@ -1119,29 +757,6 @@ L$mul_scatter4_body: movq 56(%rsp),%r15 call __rsaz_512_reduce - jmp L$mul_scatter_tail - -.p2align 5 -L$mulx_scatter: - movq (%rdi),%rdx - call __rsaz_512_mulx - -.byte 102,72,15,126,199 -.byte 102,72,15,126,205 - - movq 128(%rsp),%rdx - movq (%rsp),%r8 - movq 8(%rsp),%r9 - movq 16(%rsp),%r10 - movq 24(%rsp),%r11 - movq 32(%rsp),%r12 - movq 40(%rsp),%r13 - movq 48(%rsp),%r14 - movq 56(%rsp),%r15 - - call __rsaz_512_reducex - -L$mul_scatter_tail: addq 64(%rsp),%r8 adcq 72(%rsp),%r9 adcq 80(%rsp),%r10 @@ -1155,30 +770,14 @@ L$mul_scatter_tail: call __rsaz_512_subtract - movl %r8d,0(%rsi) - shrq $32,%r8 - movl %r9d,128(%rsi) - shrq $32,%r9 - movl %r10d,256(%rsi) - shrq $32,%r10 - movl %r11d,384(%rsi) - shrq $32,%r11 - movl %r12d,512(%rsi) - shrq $32,%r12 - movl %r13d,640(%rsi) - shrq $32,%r13 - movl %r14d,768(%rsi) - shrq $32,%r14 - movl %r15d,896(%rsi) - shrq $32,%r15 - movl %r8d,64(%rsi) - movl %r9d,192(%rsi) - movl %r10d,320(%rsi) - movl %r11d,448(%rsi) - movl %r12d,576(%rsi) - movl %r13d,704(%rsi) - movl %r14d,832(%rsi) - movl %r15d,960(%rsi) + movq %r8,0(%rsi) + movq %r9,128(%rsi) + movq %r10,256(%rsi) + movq %r11,384(%rsi) + movq %r12,512(%rsi) + movq %r13,640(%rsi) + movq %r14,768(%rsi) + movq %r15,896(%rsi) leaq 128+24+48(%rsp),%rax movq -48(%rax),%r15 @@ -1204,7 +803,6 @@ _rsaz_512_mul_by_one: subq $128+24,%rsp L$mul_by_one_body: - movl _OPENSSL_ia32cap_P+8(%rip),%eax movq %rdx,%rbp movq %rcx,128(%rsp) @@ -1225,16 +823,7 @@ L$mul_by_one_body: movdqa %xmm0,64(%rsp) movdqa %xmm0,80(%rsp) movdqa %xmm0,96(%rsp) - andl $524544,%eax - cmpl $524544,%eax - je L$by_one_callx call __rsaz_512_reduce - jmp L$by_one_tail -.p2align 5 -L$by_one_callx: - movq 128(%rsp),%rdx - call __rsaz_512_reducex -L$by_one_tail: movq %r8,(%rdi) movq %r9,8(%rdi) movq %r10,16(%rdi) @@ -1339,62 +928,6 @@ L$reduction_loop: .byte 0xf3,0xc3 -.p2align 5 -__rsaz_512_reducex: - - imulq %r8,%rdx - xorq %rsi,%rsi - movl $8,%ecx - jmp L$reduction_loopx - -.p2align 5 -L$reduction_loopx: - movq %r8,%rbx - mulxq 0(%rbp),%rax,%r8 - adcxq %rbx,%rax - adoxq %r9,%r8 - - mulxq 8(%rbp),%rax,%r9 - adcxq %rax,%r8 - adoxq %r10,%r9 - - mulxq 16(%rbp),%rbx,%r10 - adcxq %rbx,%r9 - adoxq %r11,%r10 - - mulxq 24(%rbp),%rbx,%r11 - adcxq %rbx,%r10 - adoxq %r12,%r11 - -.byte 0xc4,0x62,0xe3,0xf6,0xa5,0x20,0x00,0x00,0x00 - movq %rdx,%rax - movq %r8,%rdx - adcxq %rbx,%r11 - adoxq %r13,%r12 - - mulxq 128+8(%rsp),%rbx,%rdx - movq %rax,%rdx - - mulxq 40(%rbp),%rax,%r13 - adcxq %rax,%r12 - adoxq %r14,%r13 - -.byte 0xc4,0x62,0xfb,0xf6,0xb5,0x30,0x00,0x00,0x00 - adcxq %rax,%r13 - adoxq %r15,%r14 - - mulxq 56(%rbp),%rax,%r15 - movq %rbx,%rdx - adcxq %rax,%r14 - adoxq %rsi,%r15 - adcxq %rsi,%r15 - - decl %ecx - jne L$reduction_loopx - - .byte 0xf3,0xc3 - - .p2align 5 __rsaz_512_subtract: movq %r8,(%rdi) @@ -1593,140 +1126,18 @@ L$oop_mul: .byte 0xf3,0xc3 - -.p2align 5 -__rsaz_512_mulx: - mulxq (%rsi),%rbx,%r8 - movq $-6,%rcx - - mulxq 8(%rsi),%rax,%r9 - movq %rbx,8(%rsp) - - mulxq 16(%rsi),%rbx,%r10 - adcq %rax,%r8 - - mulxq 24(%rsi),%rax,%r11 - adcq %rbx,%r9 - - mulxq 32(%rsi),%rbx,%r12 - adcq %rax,%r10 - - mulxq 40(%rsi),%rax,%r13 - adcq %rbx,%r11 - - mulxq 48(%rsi),%rbx,%r14 - adcq %rax,%r12 - - mulxq 56(%rsi),%rax,%r15 - movq 8(%rbp),%rdx - adcq %rbx,%r13 - adcq %rax,%r14 - adcq $0,%r15 - - xorq %rdi,%rdi - jmp L$oop_mulx - -.p2align 5 -L$oop_mulx: - movq %r8,%rbx - mulxq (%rsi),%rax,%r8 - adcxq %rax,%rbx - adoxq %r9,%r8 - - mulxq 8(%rsi),%rax,%r9 - adcxq %rax,%r8 - adoxq %r10,%r9 - - mulxq 16(%rsi),%rax,%r10 - adcxq %rax,%r9 - adoxq %r11,%r10 - - mulxq 24(%rsi),%rax,%r11 - adcxq %rax,%r10 - adoxq %r12,%r11 - -.byte 0x3e,0xc4,0x62,0xfb,0xf6,0xa6,0x20,0x00,0x00,0x00 - adcxq %rax,%r11 - adoxq %r13,%r12 - - mulxq 40(%rsi),%rax,%r13 - adcxq %rax,%r12 - adoxq %r14,%r13 - - mulxq 48(%rsi),%rax,%r14 - adcxq %rax,%r13 - adoxq %r15,%r14 - - mulxq 56(%rsi),%rax,%r15 - movq 64(%rbp,%rcx,8),%rdx - movq %rbx,8+64-8(%rsp,%rcx,8) - adcxq %rax,%r14 - adoxq %rdi,%r15 - adcxq %rdi,%r15 - - incq %rcx - jnz L$oop_mulx - - movq %r8,%rbx - mulxq (%rsi),%rax,%r8 - adcxq %rax,%rbx - adoxq %r9,%r8 - -.byte 0xc4,0x62,0xfb,0xf6,0x8e,0x08,0x00,0x00,0x00 - adcxq %rax,%r8 - adoxq %r10,%r9 - -.byte 0xc4,0x62,0xfb,0xf6,0x96,0x10,0x00,0x00,0x00 - adcxq %rax,%r9 - adoxq %r11,%r10 - - mulxq 24(%rsi),%rax,%r11 - adcxq %rax,%r10 - adoxq %r12,%r11 - - mulxq 32(%rsi),%rax,%r12 - adcxq %rax,%r11 - adoxq %r13,%r12 - - mulxq 40(%rsi),%rax,%r13 - adcxq %rax,%r12 - adoxq %r14,%r13 - -.byte 0xc4,0x62,0xfb,0xf6,0xb6,0x30,0x00,0x00,0x00 - adcxq %rax,%r13 - adoxq %r15,%r14 - -.byte 0xc4,0x62,0xfb,0xf6,0xbe,0x38,0x00,0x00,0x00 - adcxq %rax,%r14 - adoxq %rdi,%r15 - adcxq %rdi,%r15 - - movq %rbx,8+64-8(%rsp) - movq %r8,8+64(%rsp) - movq %r9,8+64+8(%rsp) - movq %r10,8+64+16(%rsp) - movq %r11,8+64+24(%rsp) - movq %r12,8+64+32(%rsp) - movq %r13,8+64+40(%rsp) - movq %r14,8+64+48(%rsp) - movq %r15,8+64+56(%rsp) - - .byte 0xf3,0xc3 - .globl _rsaz_512_scatter4 .p2align 4 _rsaz_512_scatter4: - leaq (%rdi,%rdx,4),%rdi + leaq (%rdi,%rdx,8),%rdi movl $8,%r9d jmp L$oop_scatter .p2align 4 L$oop_scatter: movq (%rsi),%rax leaq 8(%rsi),%rsi - movl %eax,(%rdi) - shrq $32,%rax - movl %eax,64(%rdi) + movq %rax,(%rdi) leaq 128(%rdi),%rdi decl %r9d jnz L$oop_scatter @@ -1737,18 +1148,72 @@ L$oop_scatter: .p2align 4 _rsaz_512_gather4: - leaq (%rsi,%rdx,4),%rsi + movd %edx,%xmm8 + movdqa L$inc+16(%rip),%xmm1 + movdqa L$inc(%rip),%xmm0 + + pshufd $0,%xmm8,%xmm8 + movdqa %xmm1,%xmm7 + movdqa %xmm1,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm8,%xmm0 + movdqa %xmm7,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm8,%xmm1 + movdqa %xmm7,%xmm4 + paddd %xmm2,%xmm3 + pcmpeqd %xmm8,%xmm2 + movdqa %xmm7,%xmm5 + paddd %xmm3,%xmm4 + pcmpeqd %xmm8,%xmm3 + movdqa %xmm7,%xmm6 + paddd %xmm4,%xmm5 + pcmpeqd %xmm8,%xmm4 + paddd %xmm5,%xmm6 + pcmpeqd %xmm8,%xmm5 + paddd %xmm6,%xmm7 + pcmpeqd %xmm8,%xmm6 + pcmpeqd %xmm8,%xmm7 movl $8,%r9d jmp L$oop_gather .p2align 4 L$oop_gather: - movl (%rsi),%eax - movl 64(%rsi),%r8d + movdqa 0(%rsi),%xmm8 + movdqa 16(%rsi),%xmm9 + movdqa 32(%rsi),%xmm10 + movdqa 48(%rsi),%xmm11 + pand %xmm0,%xmm8 + movdqa 64(%rsi),%xmm12 + pand %xmm1,%xmm9 + movdqa 80(%rsi),%xmm13 + pand %xmm2,%xmm10 + movdqa 96(%rsi),%xmm14 + pand %xmm3,%xmm11 + movdqa 112(%rsi),%xmm15 leaq 128(%rsi),%rsi - shlq $32,%r8 - orq %r8,%rax - movq %rax,(%rdi) + pand %xmm4,%xmm12 + pand %xmm5,%xmm13 + pand %xmm6,%xmm14 + pand %xmm7,%xmm15 + por %xmm10,%xmm8 + por %xmm11,%xmm9 + por %xmm12,%xmm8 + por %xmm13,%xmm9 + por %xmm14,%xmm8 + por %xmm15,%xmm9 + + por %xmm9,%xmm8 + pshufd $0x4e,%xmm8,%xmm9 + por %xmm9,%xmm8 + movq %xmm8,(%rdi) leaq 8(%rdi),%rdi decl %r9d jnz L$oop_gather .byte 0xf3,0xc3 +L$SEH_end_rsaz_512_gather4: + + +.p2align 6 +L$inc: +.long 0,0, 1,1 +.long 2,2, 2,2 diff --git a/deps/openssl/asm/x64-macosx-gas/bn/x86_64-gf2m.s b/deps/openssl/asm/x64-macosx-gas/bn/x86_64-gf2m.s index 040c324c49a753..c0f0b4bd6878b8 100644 --- a/deps/openssl/asm/x64-macosx-gas/bn/x86_64-gf2m.s +++ b/deps/openssl/asm/x64-macosx-gas/bn/x86_64-gf2m.s @@ -242,7 +242,7 @@ L$body_mul_2x2: movq %rcx,56(%rsp) movq %r8,64(%rsp) - movq $15,%r8 + movq $0xf,%r8 movq %rsi,%rax movq %rcx,%rbp call _mul_1x1 diff --git a/deps/openssl/asm/x64-macosx-gas/bn/x86_64-mont.s b/deps/openssl/asm/x64-macosx-gas/bn/x86_64-mont.s index 03b9c7d949de52..9b49555a4d2132 100644 --- a/deps/openssl/asm/x64-macosx-gas/bn/x86_64-mont.s +++ b/deps/openssl/asm/x64-macosx-gas/bn/x86_64-mont.s @@ -10,7 +10,6 @@ _bn_mul_mont: jnz L$mul_enter cmpl $8,%r9d jb L$mul_enter - movl _OPENSSL_ia32cap_P+8(%rip),%r11d cmpq %rsi,%rdx jne L$mul4x_enter testl $7,%r9d @@ -216,9 +215,6 @@ L$mul_epilogue: .p2align 4 bn_mul4x_mont: L$mul4x_enter: - andl $524544,%r11d - cmpl $524544,%r11d - je L$mulx4x_enter pushq %rbx pushq %rbp pushq %r12 @@ -616,7 +612,6 @@ L$mul4x_epilogue: - .p2align 5 bn_sqr8x_mont: L$sqr8x_enter: @@ -638,20 +633,20 @@ L$sqr8x_enter: - leaq -64(%rsp,%r9,4),%r11 + leaq -64(%rsp,%r9,2),%r11 movq (%r8),%r8 subq %rsi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb L$sqr8x_sp_alt subq %r11,%rsp - leaq -64(%rsp,%r9,4),%rsp + leaq -64(%rsp,%r9,2),%rsp jmp L$sqr8x_sp_done .p2align 5 L$sqr8x_sp_alt: - leaq 4096-64(,%r9,4),%r10 - leaq -64(%rsp,%r9,4),%rsp + leaq 4096-64(,%r9,2),%r10 + leaq -64(%rsp,%r9,2),%rsp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 @@ -661,385 +656,81 @@ L$sqr8x_sp_done: movq %r9,%r10 negq %r9 - leaq 64(%rsp,%r9,2),%r11 movq %r8,32(%rsp) movq %rax,40(%rsp) L$sqr8x_body: - movq %r9,%rbp -.byte 102,73,15,110,211 - shrq $3+2,%rbp - movl _OPENSSL_ia32cap_P+8(%rip),%eax - jmp L$sqr8x_copy_n - -.p2align 5 -L$sqr8x_copy_n: - movq 0(%rcx),%xmm0 - movq 8(%rcx),%xmm1 - movq 16(%rcx),%xmm3 - movq 24(%rcx),%xmm4 - leaq 32(%rcx),%rcx - movdqa %xmm0,0(%r11) - movdqa %xmm1,16(%r11) - movdqa %xmm3,32(%r11) - movdqa %xmm4,48(%r11) - leaq 64(%r11),%r11 - decq %rbp - jnz L$sqr8x_copy_n - +.byte 102,72,15,110,209 pxor %xmm0,%xmm0 .byte 102,72,15,110,207 .byte 102,73,15,110,218 - andl $524544,%eax - cmpl $524544,%eax - jne L$sqr8x_nox - - call _bn_sqrx8x_internal - - pxor %xmm0,%xmm0 - leaq 48(%rsp),%rax - leaq 64(%rsp,%r9,2),%rdx - shrq $3+2,%r9 - movq 40(%rsp),%rsi - jmp L$sqr8x_zero - -.p2align 5 -L$sqr8x_nox: call _bn_sqr8x_internal - pxor %xmm0,%xmm0 - leaq 48(%rsp),%rax - leaq 64(%rsp,%r9,2),%rdx - shrq $3+2,%r9 - movq 40(%rsp),%rsi - jmp L$sqr8x_zero - -.p2align 5 -L$sqr8x_zero: - movdqa %xmm0,0(%rax) - movdqa %xmm0,16(%rax) - movdqa %xmm0,32(%rax) - movdqa %xmm0,48(%rax) - leaq 64(%rax),%rax - movdqa %xmm0,0(%rdx) - movdqa %xmm0,16(%rdx) - movdqa %xmm0,32(%rdx) - movdqa %xmm0,48(%rdx) - leaq 64(%rdx),%rdx - decq %r9 - jnz L$sqr8x_zero - - movq $1,%rax - movq -48(%rsi),%r15 - movq -40(%rsi),%r14 - movq -32(%rsi),%r13 - movq -24(%rsi),%r12 - movq -16(%rsi),%rbp - movq -8(%rsi),%rbx - leaq (%rsi),%rsp -L$sqr8x_epilogue: - .byte 0xf3,0xc3 - - -.p2align 5 -bn_mulx4x_mont: -L$mulx4x_enter: - movq %rsp,%rax - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - - shll $3,%r9d -.byte 0x67 - xorq %r10,%r10 - subq %r9,%r10 - movq (%r8),%r8 - leaq -72(%rsp,%r10,1),%rsp - leaq (%rdx,%r9,1),%r10 - andq $-128,%rsp - - - - - - - - - - - - - movq %r9,0(%rsp) - shrq $5,%r9 - movq %r10,16(%rsp) - subq $1,%r9 - movq %r8,24(%rsp) - movq %rdi,32(%rsp) - movq %rax,40(%rsp) - movq %r9,48(%rsp) - jmp L$mulx4x_body - -.p2align 5 -L$mulx4x_body: - leaq 8(%rdx),%rdi - movq (%rdx),%rdx - leaq 64+32(%rsp),%rbx - movq %rdx,%r9 - - mulxq 0(%rsi),%r8,%rax - mulxq 8(%rsi),%r11,%r14 - addq %rax,%r11 - movq %rdi,8(%rsp) - mulxq 16(%rsi),%r12,%r13 - adcq %r14,%r12 - adcq $0,%r13 - - movq %r8,%rdi - imulq 24(%rsp),%r8 - xorq %rbp,%rbp - - mulxq 24(%rsi),%rax,%r14 - movq %r8,%rdx - leaq 32(%rsi),%rsi - adcxq %rax,%r13 - adcxq %rbp,%r14 - - mulxq 0(%rcx),%rax,%r10 - adcxq %rax,%rdi - adoxq %r11,%r10 - mulxq 8(%rcx),%rax,%r11 - adcxq %rax,%r10 - adoxq %r12,%r11 -.byte 0xc4,0x62,0xfb,0xf6,0xa1,0x10,0x00,0x00,0x00 - movq 48(%rsp),%rdi - movq %r10,-32(%rbx) - adcxq %rax,%r11 - adoxq %r13,%r12 - mulxq 24(%rcx),%rax,%r15 - movq %r9,%rdx - movq %r11,-24(%rbx) - adcxq %rax,%r12 - adoxq %rbp,%r15 - leaq 32(%rcx),%rcx - movq %r12,-16(%rbx) - - jmp L$mulx4x_1st - -.p2align 5 -L$mulx4x_1st: - adcxq %rbp,%r15 - mulxq 0(%rsi),%r10,%rax - adcxq %r14,%r10 - mulxq 8(%rsi),%r11,%r14 - adcxq %rax,%r11 - mulxq 16(%rsi),%r12,%rax - adcxq %r14,%r12 - mulxq 24(%rsi),%r13,%r14 -.byte 0x67,0x67 - movq %r8,%rdx - adcxq %rax,%r13 - adcxq %rbp,%r14 - leaq 32(%rsi),%rsi - leaq 32(%rbx),%rbx - adoxq %r15,%r10 - mulxq 0(%rcx),%rax,%r15 - adcxq %rax,%r10 - adoxq %r15,%r11 - mulxq 8(%rcx),%rax,%r15 - adcxq %rax,%r11 - adoxq %r15,%r12 - mulxq 16(%rcx),%rax,%r15 - movq %r10,-40(%rbx) - adcxq %rax,%r12 - movq %r11,-32(%rbx) - adoxq %r15,%r13 - mulxq 24(%rcx),%rax,%r15 - movq %r9,%rdx - movq %r12,-24(%rbx) - adcxq %rax,%r13 - adoxq %rbp,%r15 - leaq 32(%rcx),%rcx - movq %r13,-16(%rbx) - decq %rdi - jnz L$mulx4x_1st - - movq 0(%rsp),%rax - movq 8(%rsp),%rdi - adcq %rbp,%r15 - addq %r15,%r14 - sbbq %r15,%r15 - movq %r14,-8(%rbx) - jmp L$mulx4x_outer -.p2align 5 -L$mulx4x_outer: - movq (%rdi),%rdx - leaq 8(%rdi),%rdi - subq %rax,%rsi - movq %r15,(%rbx) - leaq 64+32(%rsp),%rbx - subq %rax,%rcx - - mulxq 0(%rsi),%r8,%r11 - xorl %ebp,%ebp - movq %rdx,%r9 - mulxq 8(%rsi),%r14,%r12 - adoxq -32(%rbx),%r8 - adcxq %r14,%r11 - mulxq 16(%rsi),%r15,%r13 - adoxq -24(%rbx),%r11 - adcxq %r15,%r12 - adoxq %rbp,%r12 - adcxq %rbp,%r13 - - movq %rdi,8(%rsp) -.byte 0x67 - movq %r8,%r15 - imulq 24(%rsp),%r8 - xorl %ebp,%ebp - - mulxq 24(%rsi),%rax,%r14 - movq %r8,%rdx - adoxq -16(%rbx),%r12 - adcxq %rax,%r13 - adoxq -8(%rbx),%r13 - adcxq %rbp,%r14 - leaq 32(%rsi),%rsi - adoxq %rbp,%r14 - - mulxq 0(%rcx),%rax,%r10 - adcxq %rax,%r15 - adoxq %r11,%r10 - mulxq 8(%rcx),%rax,%r11 - adcxq %rax,%r10 - adoxq %r12,%r11 - mulxq 16(%rcx),%rax,%r12 - movq %r10,-32(%rbx) - adcxq %rax,%r11 - adoxq %r13,%r12 - mulxq 24(%rcx),%rax,%r15 + leaq (%rdi,%r9,1),%rbx + movq %r9,%rcx movq %r9,%rdx - movq %r11,-24(%rbx) - leaq 32(%rcx),%rcx - adcxq %rax,%r12 - adoxq %rbp,%r15 - movq 48(%rsp),%rdi - movq %r12,-16(%rbx) - - jmp L$mulx4x_inner +.byte 102,72,15,126,207 + sarq $3+2,%rcx + jmp L$sqr8x_sub .p2align 5 -L$mulx4x_inner: - mulxq 0(%rsi),%r10,%rax - adcxq %rbp,%r15 - adoxq %r14,%r10 - mulxq 8(%rsi),%r11,%r14 - adcxq 0(%rbx),%r10 - adoxq %rax,%r11 - mulxq 16(%rsi),%r12,%rax - adcxq 8(%rbx),%r11 - adoxq %r14,%r12 - mulxq 24(%rsi),%r13,%r14 - movq %r8,%rdx - adcxq 16(%rbx),%r12 - adoxq %rax,%r13 - adcxq 24(%rbx),%r13 - adoxq %rbp,%r14 - leaq 32(%rsi),%rsi +L$sqr8x_sub: + movq 0(%rbx),%r12 + movq 8(%rbx),%r13 + movq 16(%rbx),%r14 + movq 24(%rbx),%r15 leaq 32(%rbx),%rbx - adcxq %rbp,%r14 - - adoxq %r15,%r10 - mulxq 0(%rcx),%rax,%r15 - adcxq %rax,%r10 - adoxq %r15,%r11 - mulxq 8(%rcx),%rax,%r15 - adcxq %rax,%r11 - adoxq %r15,%r12 - mulxq 16(%rcx),%rax,%r15 - movq %r10,-40(%rbx) - adcxq %rax,%r12 - adoxq %r15,%r13 - mulxq 24(%rcx),%rax,%r15 - movq %r9,%rdx - movq %r11,-32(%rbx) - movq %r12,-24(%rbx) - adcxq %rax,%r13 - adoxq %rbp,%r15 - leaq 32(%rcx),%rcx - movq %r13,-16(%rbx) - - decq %rdi - jnz L$mulx4x_inner + sbbq 0(%rbp),%r12 + sbbq 8(%rbp),%r13 + sbbq 16(%rbp),%r14 + sbbq 24(%rbp),%r15 + leaq 32(%rbp),%rbp + movq %r12,0(%rdi) + movq %r13,8(%rdi) + movq %r14,16(%rdi) + movq %r15,24(%rdi) + leaq 32(%rdi),%rdi + incq %rcx + jnz L$sqr8x_sub - movq 0(%rsp),%rax - movq 8(%rsp),%rdi - adcq %rbp,%r15 - subq 0(%rbx),%rbp - adcq %r15,%r14 - movq -8(%rcx),%r8 - sbbq %r15,%r15 - movq %r14,-8(%rbx) - - cmpq 16(%rsp),%rdi - jne L$mulx4x_outer - - subq %r14,%r8 - sbbq %r8,%r8 - orq %r8,%r15 - - negq %rax - xorq %rdx,%rdx - movq 32(%rsp),%rdi - leaq 64(%rsp),%rbx + sbbq $0,%rax + leaq (%rbx,%r9,1),%rbx + leaq (%rdi,%r9,1),%rdi +.byte 102,72,15,110,200 pxor %xmm0,%xmm0 - movq 0(%rcx,%rax,1),%r8 - movq 8(%rcx,%rax,1),%r9 - negq %r8 - jmp L$mulx4x_sub_entry + pshufd $0,%xmm1,%xmm1 + movq 40(%rsp),%rsi + jmp L$sqr8x_cond_copy .p2align 5 -L$mulx4x_sub: - movq 0(%rcx,%rax,1),%r8 - movq 8(%rcx,%rax,1),%r9 - notq %r8 -L$mulx4x_sub_entry: - movq 16(%rcx,%rax,1),%r10 - notq %r9 - andq %r15,%r8 - movq 24(%rcx,%rax,1),%r11 - notq %r10 - andq %r15,%r9 - notq %r11 - andq %r15,%r10 - andq %r15,%r11 - - negq %rdx - adcq 0(%rbx),%r8 - adcq 8(%rbx),%r9 - movdqa %xmm0,(%rbx) - adcq 16(%rbx),%r10 - adcq 24(%rbx),%r11 - movdqa %xmm0,16(%rbx) +L$sqr8x_cond_copy: + movdqa 0(%rbx),%xmm2 + movdqa 16(%rbx),%xmm3 leaq 32(%rbx),%rbx - sbbq %rdx,%rdx - - movq %r8,0(%rdi) - movq %r9,8(%rdi) - movq %r10,16(%rdi) - movq %r11,24(%rdi) + movdqu 0(%rdi),%xmm4 + movdqu 16(%rdi),%xmm5 leaq 32(%rdi),%rdi + movdqa %xmm0,-32(%rbx) + movdqa %xmm0,-16(%rbx) + movdqa %xmm0,-32(%rbx,%rdx,1) + movdqa %xmm0,-16(%rbx,%rdx,1) + pcmpeqd %xmm1,%xmm0 + pand %xmm1,%xmm2 + pand %xmm1,%xmm3 + pand %xmm0,%xmm4 + pand %xmm0,%xmm5 + pxor %xmm0,%xmm0 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqu %xmm4,-32(%rdi) + movdqu %xmm5,-16(%rdi) + addq $32,%r9 + jnz L$sqr8x_cond_copy - addq $32,%rax - jnz L$mulx4x_sub - - movq 40(%rsp),%rsi movq $1,%rax movq -48(%rsi),%r15 movq -40(%rsi),%r14 @@ -1048,7 +739,7 @@ L$mulx4x_sub_entry: movq -16(%rsi),%rbp movq -8(%rsi),%rbx leaq (%rsi),%rsp -L$mulx4x_epilogue: +L$sqr8x_epilogue: .byte 0xf3,0xc3 .byte 77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105,112,108,105,99,97,116,105,111,110,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 diff --git a/deps/openssl/asm/x64-macosx-gas/bn/x86_64-mont5.s b/deps/openssl/asm/x64-macosx-gas/bn/x86_64-mont5.s index 5470fb0336182a..c9731e162da51e 100644 --- a/deps/openssl/asm/x64-macosx-gas/bn/x86_64-mont5.s +++ b/deps/openssl/asm/x64-macosx-gas/bn/x86_64-mont5.s @@ -8,53 +8,157 @@ _bn_mul_mont_gather5: testl $7,%r9d jnz L$mul_enter - movl _OPENSSL_ia32cap_P+8(%rip),%r11d jmp L$mul4x_enter .p2align 4 L$mul_enter: movl %r9d,%r9d movq %rsp,%rax - movl 8(%rsp),%r10d + movd 8(%rsp),%xmm5 + leaq L$inc(%rip),%r10 pushq %rbx pushq %rbp pushq %r12 pushq %r13 pushq %r14 pushq %r15 + leaq 2(%r9),%r11 negq %r11 - leaq (%rsp,%r11,8),%rsp + leaq -264(%rsp,%r11,8),%rsp andq $-1024,%rsp movq %rax,8(%rsp,%r9,8) L$mul_body: - movq %rdx,%r12 - movq %r10,%r11 - shrq $3,%r10 - andq $7,%r11 - notq %r10 - leaq L$magic_masks(%rip),%rax - andq $3,%r10 - leaq 96(%r12,%r11,8),%r12 - movq 0(%rax,%r10,8),%xmm4 - movq 8(%rax,%r10,8),%xmm5 - movq 16(%rax,%r10,8),%xmm6 - movq 24(%rax,%r10,8),%xmm7 - - movq -96(%r12),%xmm0 - movq -32(%r12),%xmm1 - pand %xmm4,%xmm0 - movq 32(%r12),%xmm2 - pand %xmm5,%xmm1 - movq 96(%r12),%xmm3 - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 + leaq 128(%rdx),%r12 + movdqa 0(%r10),%xmm0 + movdqa 16(%r10),%xmm1 + leaq 24-112(%rsp,%r9,8),%r10 + andq $-16,%r10 + + pshufd $0,%xmm5,%xmm5 + movdqa %xmm1,%xmm4 + movdqa %xmm1,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 +.byte 0x67 + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,112(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,128(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,144(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,160(%r10) + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,176(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,192(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,208(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,224(%r10) + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,240(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,256(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,272(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,288(%r10) + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,304(%r10) + + paddd %xmm2,%xmm3 +.byte 0x67 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,320(%r10) + + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,336(%r10) + pand 64(%r12),%xmm0 + + pand 80(%r12),%xmm1 + pand 96(%r12),%xmm2 + movdqa %xmm3,352(%r10) + pand 112(%r12),%xmm3 por %xmm2,%xmm0 + por %xmm3,%xmm1 + movdqa -128(%r12),%xmm4 + movdqa -112(%r12),%xmm5 + movdqa -96(%r12),%xmm2 + pand 112(%r10),%xmm4 + movdqa -80(%r12),%xmm3 + pand 128(%r10),%xmm5 + por %xmm4,%xmm0 + pand 144(%r10),%xmm2 + por %xmm5,%xmm1 + pand 160(%r10),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + movdqa -64(%r12),%xmm4 + movdqa -48(%r12),%xmm5 + movdqa -32(%r12),%xmm2 + pand 176(%r10),%xmm4 + movdqa -16(%r12),%xmm3 + pand 192(%r10),%xmm5 + por %xmm4,%xmm0 + pand 208(%r10),%xmm2 + por %xmm5,%xmm1 + pand 224(%r10),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + movdqa 0(%r12),%xmm4 + movdqa 16(%r12),%xmm5 + movdqa 32(%r12),%xmm2 + pand 240(%r10),%xmm4 + movdqa 48(%r12),%xmm3 + pand 256(%r10),%xmm5 + por %xmm4,%xmm0 + pand 272(%r10),%xmm2 + por %xmm5,%xmm1 + pand 288(%r10),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + por %xmm1,%xmm0 + pshufd $0x4e,%xmm0,%xmm1 + por %xmm1,%xmm0 leaq 256(%r12),%r12 - por %xmm3,%xmm0 - .byte 102,72,15,126,195 movq (%r8),%r8 @@ -63,29 +167,14 @@ L$mul_body: xorq %r14,%r14 xorq %r15,%r15 - movq -96(%r12),%xmm0 - movq -32(%r12),%xmm1 - pand %xmm4,%xmm0 - movq 32(%r12),%xmm2 - pand %xmm5,%xmm1 - movq %r8,%rbp mulq %rbx movq %rax,%r10 movq (%rcx),%rax - movq 96(%r12),%xmm3 - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 - imulq %r10,%rbp movq %rdx,%r11 - por %xmm2,%xmm0 - leaq 256(%r12),%r12 - por %xmm3,%xmm0 - mulq %rbp addq %rax,%r10 movq 8(%rsi),%rax @@ -118,14 +207,12 @@ L$1st_enter: cmpq %r9,%r15 jne L$1st -.byte 102,72,15,126,195 addq %rax,%r13 - movq (%rsi),%rax adcq $0,%rdx addq %r11,%r13 adcq $0,%rdx - movq %r13,-16(%rsp,%r15,8) + movq %r13,-16(%rsp,%r9,8) movq %rdx,%r13 movq %r10,%r11 @@ -139,33 +226,78 @@ L$1st_enter: jmp L$outer .p2align 4 L$outer: + leaq 24+128(%rsp,%r9,8),%rdx + andq $-16,%rdx + pxor %xmm4,%xmm4 + pxor %xmm5,%xmm5 + movdqa -128(%r12),%xmm0 + movdqa -112(%r12),%xmm1 + movdqa -96(%r12),%xmm2 + movdqa -80(%r12),%xmm3 + pand -128(%rdx),%xmm0 + pand -112(%rdx),%xmm1 + por %xmm0,%xmm4 + pand -96(%rdx),%xmm2 + por %xmm1,%xmm5 + pand -80(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa -64(%r12),%xmm0 + movdqa -48(%r12),%xmm1 + movdqa -32(%r12),%xmm2 + movdqa -16(%r12),%xmm3 + pand -64(%rdx),%xmm0 + pand -48(%rdx),%xmm1 + por %xmm0,%xmm4 + pand -32(%rdx),%xmm2 + por %xmm1,%xmm5 + pand -16(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa 0(%r12),%xmm0 + movdqa 16(%r12),%xmm1 + movdqa 32(%r12),%xmm2 + movdqa 48(%r12),%xmm3 + pand 0(%rdx),%xmm0 + pand 16(%rdx),%xmm1 + por %xmm0,%xmm4 + pand 32(%rdx),%xmm2 + por %xmm1,%xmm5 + pand 48(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa 64(%r12),%xmm0 + movdqa 80(%r12),%xmm1 + movdqa 96(%r12),%xmm2 + movdqa 112(%r12),%xmm3 + pand 64(%rdx),%xmm0 + pand 80(%rdx),%xmm1 + por %xmm0,%xmm4 + pand 96(%rdx),%xmm2 + por %xmm1,%xmm5 + pand 112(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + por %xmm5,%xmm4 + pshufd $0x4e,%xmm4,%xmm0 + por %xmm4,%xmm0 + leaq 256(%r12),%r12 + + movq (%rsi),%rax +.byte 102,72,15,126,195 + xorq %r15,%r15 movq %r8,%rbp movq (%rsp),%r10 - movq -96(%r12),%xmm0 - movq -32(%r12),%xmm1 - pand %xmm4,%xmm0 - movq 32(%r12),%xmm2 - pand %xmm5,%xmm1 - mulq %rbx addq %rax,%r10 movq (%rcx),%rax adcq $0,%rdx - movq 96(%r12),%xmm3 - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 - imulq %r10,%rbp movq %rdx,%r11 - por %xmm2,%xmm0 - leaq 256(%r12),%r12 - por %xmm3,%xmm0 - mulq %rbp addq %rax,%r10 movq 8(%rsi),%rax @@ -201,15 +333,12 @@ L$inner_enter: cmpq %r9,%r15 jne L$inner -.byte 102,72,15,126,195 - addq %rax,%r13 - movq (%rsi),%rax adcq $0,%rdx addq %r10,%r13 - movq (%rsp,%r15,8),%r10 + movq (%rsp,%r9,8),%r10 adcq $0,%rdx - movq %r13,-16(%rsp,%r15,8) + movq %r13,-16(%rsp,%r9,8) movq %rdx,%r13 xorq %rdx,%rdx @@ -256,6 +385,7 @@ L$copy: movq 8(%rsp,%r9,8),%rsi movq $1,%rax + movq -48(%rsi),%r15 movq -40(%rsi),%r14 movq -32(%rsi),%r13 @@ -270,9 +400,6 @@ L$mul_epilogue: .p2align 5 bn_mul4x_mont_gather5: L$mul4x_enter: - andl $524544,%r11d - cmpl $524544,%r11d - je L$mulx4x_enter .byte 0x67 movq %rsp,%rax pushq %rbx @@ -281,10 +408,10 @@ L$mul4x_enter: pushq %r13 pushq %r14 pushq %r15 + .byte 0x67 - movl %r9d,%r10d shll $3,%r9d - shll $3+2,%r10d + leaq (%r9,%r9,2),%r10 negq %r9 @@ -294,19 +421,21 @@ L$mul4x_enter: - leaq -64(%rsp,%r9,2),%r11 - subq %rsi,%r11 + + + leaq -320(%rsp,%r9,2),%r11 + subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb L$mul4xsp_alt subq %r11,%rsp - leaq -64(%rsp,%r9,2),%rsp + leaq -320(%rsp,%r9,2),%rsp jmp L$mul4xsp_done .p2align 5 L$mul4xsp_alt: - leaq 4096-64(,%r9,2),%r10 - leaq -64(%rsp,%r9,2),%rsp + leaq 4096-320(,%r9,2),%r10 + leaq -320(%rsp,%r9,2),%rsp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 @@ -322,6 +451,7 @@ L$mul4x_body: movq 40(%rsp),%rsi movq $1,%rax + movq -48(%rsi),%r15 movq -40(%rsi),%r14 movq -32(%rsi),%r13 @@ -337,47 +467,141 @@ L$mul4x_epilogue: .p2align 5 mul4x_internal: shlq $5,%r9 - movl 8(%rax),%r10d - leaq 256(%rdx,%r9,1),%r13 + movd 8(%rax),%xmm5 + leaq L$inc(%rip),%rax + leaq 128(%rdx,%r9,1),%r13 shrq $5,%r9 - movq %r10,%r11 - shrq $3,%r10 - andq $7,%r11 - notq %r10 - leaq L$magic_masks(%rip),%rax - andq $3,%r10 - leaq 96(%rdx,%r11,8),%r12 - movq 0(%rax,%r10,8),%xmm4 - movq 8(%rax,%r10,8),%xmm5 - addq $7,%r11 - movq 16(%rax,%r10,8),%xmm6 - movq 24(%rax,%r10,8),%xmm7 - andq $7,%r11 - - movq -96(%r12),%xmm0 - leaq 256(%r12),%r14 - movq -32(%r12),%xmm1 - pand %xmm4,%xmm0 - movq 32(%r12),%xmm2 - pand %xmm5,%xmm1 - movq 96(%r12),%xmm3 - pand %xmm6,%xmm2 -.byte 0x67 - por %xmm1,%xmm0 - movq -96(%r14),%xmm1 -.byte 0x67 - pand %xmm7,%xmm3 -.byte 0x67 - por %xmm2,%xmm0 - movq -32(%r14),%xmm2 + movdqa 0(%rax),%xmm0 + movdqa 16(%rax),%xmm1 + leaq 88-112(%rsp,%r9,1),%r10 + leaq 128(%rdx),%r12 + + pshufd $0,%xmm5,%xmm5 + movdqa %xmm1,%xmm4 +.byte 0x67,0x67 + movdqa %xmm1,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 .byte 0x67 - pand %xmm4,%xmm1 + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,112(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,128(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,144(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,160(%r10) + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,176(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,192(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,208(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,224(%r10) + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,240(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,256(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,272(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,288(%r10) + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,304(%r10) + + paddd %xmm2,%xmm3 .byte 0x67 - por %xmm3,%xmm0 - movq 32(%r14),%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,320(%r10) + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,336(%r10) + pand 64(%r12),%xmm0 + + pand 80(%r12),%xmm1 + pand 96(%r12),%xmm2 + movdqa %xmm3,352(%r10) + pand 112(%r12),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + movdqa -128(%r12),%xmm4 + movdqa -112(%r12),%xmm5 + movdqa -96(%r12),%xmm2 + pand 112(%r10),%xmm4 + movdqa -80(%r12),%xmm3 + pand 128(%r10),%xmm5 + por %xmm4,%xmm0 + pand 144(%r10),%xmm2 + por %xmm5,%xmm1 + pand 160(%r10),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + movdqa -64(%r12),%xmm4 + movdqa -48(%r12),%xmm5 + movdqa -32(%r12),%xmm2 + pand 176(%r10),%xmm4 + movdqa -16(%r12),%xmm3 + pand 192(%r10),%xmm5 + por %xmm4,%xmm0 + pand 208(%r10),%xmm2 + por %xmm5,%xmm1 + pand 224(%r10),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + movdqa 0(%r12),%xmm4 + movdqa 16(%r12),%xmm5 + movdqa 32(%r12),%xmm2 + pand 240(%r10),%xmm4 + movdqa 48(%r12),%xmm3 + pand 256(%r10),%xmm5 + por %xmm4,%xmm0 + pand 272(%r10),%xmm2 + por %xmm5,%xmm1 + pand 288(%r10),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + por %xmm1,%xmm0 + pshufd $0x4e,%xmm0,%xmm1 + por %xmm1,%xmm0 + leaq 256(%r12),%r12 .byte 102,72,15,126,195 - movq 96(%r14),%xmm0 + movq %r13,16+8(%rsp) movq %rdi,56+8(%rsp) @@ -391,26 +615,10 @@ mul4x_internal: movq %rax,%r10 movq (%rcx),%rax - pand %xmm5,%xmm2 - pand %xmm6,%xmm3 - por %xmm2,%xmm1 - imulq %r10,%rbp - - - - - - - - leaq 64+8(%rsp,%r11,8),%r14 + leaq 64+8(%rsp),%r14 movq %rdx,%r11 - pand %xmm7,%xmm0 - por %xmm3,%xmm1 - leaq 512(%r12),%r12 - por %xmm1,%xmm0 - mulq %rbp addq %rax,%r10 movq 8(%rsi,%r9,1),%rax @@ -419,7 +627,7 @@ mul4x_internal: mulq %rbx addq %rax,%r11 - movq 16(%rcx),%rax + movq 8(%rcx),%rax adcq $0,%rdx movq %rdx,%r10 @@ -429,7 +637,7 @@ mul4x_internal: adcq $0,%rdx addq %r11,%rdi leaq 32(%r9),%r15 - leaq 64(%rcx),%rcx + leaq 32(%rcx),%rcx adcq $0,%rdx movq %rdi,(%r14) movq %rdx,%r13 @@ -439,7 +647,7 @@ mul4x_internal: L$1st4x: mulq %rbx addq %rax,%r10 - movq -32(%rcx),%rax + movq -16(%rcx),%rax leaq 32(%r14),%r14 adcq $0,%rdx movq %rdx,%r11 @@ -455,7 +663,7 @@ L$1st4x: mulq %rbx addq %rax,%r11 - movq -16(%rcx),%rax + movq -8(%rcx),%rax adcq $0,%rdx movq %rdx,%r10 @@ -485,7 +693,7 @@ L$1st4x: mulq %rbx addq %rax,%r11 - movq 16(%rcx),%rax + movq 8(%rcx),%rax adcq $0,%rdx movq %rdx,%r10 @@ -494,7 +702,7 @@ L$1st4x: movq 16(%rsi,%r15,1),%rax adcq $0,%rdx addq %r11,%rdi - leaq 64(%rcx),%rcx + leaq 32(%rcx),%rcx adcq $0,%rdx movq %rdi,(%r14) movq %rdx,%r13 @@ -504,7 +712,7 @@ L$1st4x: mulq %rbx addq %rax,%r10 - movq -32(%rcx),%rax + movq -16(%rcx),%rax leaq 32(%r14),%r14 adcq $0,%rdx movq %rdx,%r11 @@ -520,7 +728,7 @@ L$1st4x: mulq %rbx addq %rax,%r11 - movq -16(%rcx),%rax + movq -8(%rcx),%rax adcq $0,%rdx movq %rdx,%r10 @@ -533,8 +741,7 @@ L$1st4x: movq %rdi,-16(%r14) movq %rdx,%r13 -.byte 102,72,15,126,195 - leaq (%rcx,%r9,2),%rcx + leaq (%rcx,%r9,1),%rcx xorq %rdi,%rdi addq %r10,%r13 @@ -545,6 +752,63 @@ L$1st4x: .p2align 5 L$outer4x: + leaq 16+128(%r14),%rdx + pxor %xmm4,%xmm4 + pxor %xmm5,%xmm5 + movdqa -128(%r12),%xmm0 + movdqa -112(%r12),%xmm1 + movdqa -96(%r12),%xmm2 + movdqa -80(%r12),%xmm3 + pand -128(%rdx),%xmm0 + pand -112(%rdx),%xmm1 + por %xmm0,%xmm4 + pand -96(%rdx),%xmm2 + por %xmm1,%xmm5 + pand -80(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa -64(%r12),%xmm0 + movdqa -48(%r12),%xmm1 + movdqa -32(%r12),%xmm2 + movdqa -16(%r12),%xmm3 + pand -64(%rdx),%xmm0 + pand -48(%rdx),%xmm1 + por %xmm0,%xmm4 + pand -32(%rdx),%xmm2 + por %xmm1,%xmm5 + pand -16(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa 0(%r12),%xmm0 + movdqa 16(%r12),%xmm1 + movdqa 32(%r12),%xmm2 + movdqa 48(%r12),%xmm3 + pand 0(%rdx),%xmm0 + pand 16(%rdx),%xmm1 + por %xmm0,%xmm4 + pand 32(%rdx),%xmm2 + por %xmm1,%xmm5 + pand 48(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa 64(%r12),%xmm0 + movdqa 80(%r12),%xmm1 + movdqa 96(%r12),%xmm2 + movdqa 112(%r12),%xmm3 + pand 64(%rdx),%xmm0 + pand 80(%rdx),%xmm1 + por %xmm0,%xmm4 + pand 96(%rdx),%xmm2 + por %xmm1,%xmm5 + pand 112(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + por %xmm5,%xmm4 + pshufd $0x4e,%xmm4,%xmm0 + por %xmm4,%xmm0 + leaq 256(%r12),%r12 +.byte 102,72,15,126,195 + movq (%r14,%r9,1),%r10 movq %r8,%rbp mulq %rbx @@ -552,25 +816,11 @@ L$outer4x: movq (%rcx),%rax adcq $0,%rdx - movq -96(%r12),%xmm0 - movq -32(%r12),%xmm1 - pand %xmm4,%xmm0 - movq 32(%r12),%xmm2 - pand %xmm5,%xmm1 - movq 96(%r12),%xmm3 - imulq %r10,%rbp -.byte 0x67 movq %rdx,%r11 movq %rdi,(%r14) - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 - por %xmm2,%xmm0 leaq (%r14,%r9,1),%r14 - leaq 256(%r12),%r12 - por %xmm3,%xmm0 mulq %rbp addq %rax,%r10 @@ -580,7 +830,7 @@ L$outer4x: mulq %rbx addq %rax,%r11 - movq 16(%rcx),%rax + movq 8(%rcx),%rax adcq $0,%rdx addq 8(%r14),%r11 adcq $0,%rdx @@ -592,7 +842,7 @@ L$outer4x: adcq $0,%rdx addq %r11,%rdi leaq 32(%r9),%r15 - leaq 64(%rcx),%rcx + leaq 32(%rcx),%rcx adcq $0,%rdx movq %rdx,%r13 jmp L$inner4x @@ -601,7 +851,7 @@ L$outer4x: L$inner4x: mulq %rbx addq %rax,%r10 - movq -32(%rcx),%rax + movq -16(%rcx),%rax adcq $0,%rdx addq 16(%r14),%r10 leaq 32(%r14),%r14 @@ -619,7 +869,7 @@ L$inner4x: mulq %rbx addq %rax,%r11 - movq -16(%rcx),%rax + movq -8(%rcx),%rax adcq $0,%rdx addq -8(%r14),%r11 adcq $0,%rdx @@ -653,7 +903,7 @@ L$inner4x: mulq %rbx addq %rax,%r11 - movq 16(%rcx),%rax + movq 8(%rcx),%rax adcq $0,%rdx addq 8(%r14),%r11 adcq $0,%rdx @@ -664,7 +914,7 @@ L$inner4x: movq 16(%rsi,%r15,1),%rax adcq $0,%rdx addq %r11,%rdi - leaq 64(%rcx),%rcx + leaq 32(%rcx),%rcx adcq $0,%rdx movq %r13,-8(%r14) movq %rdx,%r13 @@ -674,7 +924,7 @@ L$inner4x: mulq %rbx addq %rax,%r10 - movq -32(%rcx),%rax + movq -16(%rcx),%rax adcq $0,%rdx addq 16(%r14),%r10 leaq 32(%r14),%r14 @@ -693,7 +943,7 @@ L$inner4x: mulq %rbx addq %rax,%r11 movq %rbp,%rax - movq -16(%rcx),%rbp + movq -8(%rcx),%rbp adcq $0,%rdx addq -8(%r14),%r11 adcq $0,%rdx @@ -708,9 +958,8 @@ L$inner4x: movq %r13,-24(%r14) movq %rdx,%r13 -.byte 102,72,15,126,195 movq %rdi,-16(%r14) - leaq (%rcx,%r9,2),%rcx + leaq (%rcx,%r9,1),%rcx xorq %rdi,%rdi addq %r10,%r13 @@ -721,25 +970,28 @@ L$inner4x: cmpq 16+8(%rsp),%r12 jb L$outer4x + xorq %rax,%rax subq %r13,%rbp adcq %r15,%r15 orq %r15,%rdi - xorq $1,%rdi + subq %rdi,%rax leaq (%r14,%r9,1),%rbx - leaq (%rcx,%rdi,8),%rbp + movq (%rcx),%r12 + leaq (%rcx),%rbp movq %r9,%rcx sarq $3+2,%rcx movq 56+8(%rsp),%rdi - jmp L$sqr4x_sub + decq %r12 + xorq %r10,%r10 + movq 8(%rbp),%r13 + movq 16(%rbp),%r14 + movq 24(%rbp),%r15 + jmp L$sqr4x_sub_entry .globl _bn_power5 .p2align 5 _bn_power5: - movl _OPENSSL_ia32cap_P+8(%rip),%r11d - andl $524544,%r11d - cmpl $524544,%r11d - je L$powerx5_enter movq %rsp,%rax pushq %rbx pushq %rbp @@ -747,9 +999,9 @@ _bn_power5: pushq %r13 pushq %r14 pushq %r15 - movl %r9d,%r10d + shll $3,%r9d - shll $3+2,%r10d + leal (%r9,%r9,2),%r10d negq %r9 movq (%r8),%r8 @@ -759,19 +1011,20 @@ _bn_power5: - leaq -64(%rsp,%r9,2),%r11 - subq %rsi,%r11 + + leaq -320(%rsp,%r9,2),%r11 + subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb L$pwr_sp_alt subq %r11,%rsp - leaq -64(%rsp,%r9,2),%rsp + leaq -320(%rsp,%r9,2),%rsp jmp L$pwr_sp_done .p2align 5 L$pwr_sp_alt: - leaq 4096-64(,%r9,2),%r10 - leaq -64(%rsp,%r9,2),%rsp + leaq 4096-320(,%r9,2),%r10 + leaq -320(%rsp,%r9,2),%rsp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 @@ -799,10 +1052,15 @@ L$power5_body: .byte 102,72,15,110,226 call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal .byte 102,72,15,126,209 .byte 102,72,15,126,226 @@ -1346,9 +1604,9 @@ L$sqr4x_shift_n_add: movq %rbx,-16(%rdi) movq %r8,-8(%rdi) .byte 102,72,15,126,213 -sqr8x_reduction: +__bn_sqr8x_reduction: xorq %rax,%rax - leaq (%rbp,%r9,2),%rcx + leaq (%r9,%rbp,1),%rcx leaq 48+8(%rsp,%r9,2),%rdx movq %rcx,0+8(%rsp) leaq 48+8(%rsp,%r9,1),%rdi @@ -1381,14 +1639,14 @@ L$8x_reduction_loop: .p2align 5 L$8x_reduce: mulq %rbx - movq 16(%rbp),%rax + movq 8(%rbp),%rax negq %r8 movq %rdx,%r8 adcq $0,%r8 mulq %rbx addq %rax,%r9 - movq 32(%rbp),%rax + movq 16(%rbp),%rax adcq $0,%rdx addq %r9,%r8 movq %rbx,48-8+8(%rsp,%rcx,8) @@ -1397,7 +1655,7 @@ L$8x_reduce: mulq %rbx addq %rax,%r10 - movq 48(%rbp),%rax + movq 24(%rbp),%rax adcq $0,%rdx addq %r10,%r9 movq 32+8(%rsp),%rsi @@ -1406,7 +1664,7 @@ L$8x_reduce: mulq %rbx addq %rax,%r11 - movq 64(%rbp),%rax + movq 32(%rbp),%rax adcq $0,%rdx imulq %r8,%rsi addq %r11,%r10 @@ -1415,7 +1673,7 @@ L$8x_reduce: mulq %rbx addq %rax,%r12 - movq 80(%rbp),%rax + movq 40(%rbp),%rax adcq $0,%rdx addq %r12,%r11 movq %rdx,%r12 @@ -1423,7 +1681,7 @@ L$8x_reduce: mulq %rbx addq %rax,%r13 - movq 96(%rbp),%rax + movq 48(%rbp),%rax adcq $0,%rdx addq %r13,%r12 movq %rdx,%r13 @@ -1431,7 +1689,7 @@ L$8x_reduce: mulq %rbx addq %rax,%r14 - movq 112(%rbp),%rax + movq 56(%rbp),%rax adcq $0,%rdx addq %r14,%r13 movq %rdx,%r14 @@ -1449,7 +1707,7 @@ L$8x_reduce: decl %ecx jnz L$8x_reduce - leaq 128(%rbp),%rbp + leaq 64(%rbp),%rbp xorq %rax,%rax movq 8+8(%rsp),%rdx cmpq 0+8(%rsp),%rbp @@ -1475,14 +1733,14 @@ L$8x_reduce: L$8x_tail: mulq %rbx addq %rax,%r8 - movq 16(%rbp),%rax + movq 8(%rbp),%rax movq %r8,(%rdi) movq %rdx,%r8 adcq $0,%r8 mulq %rbx addq %rax,%r9 - movq 32(%rbp),%rax + movq 16(%rbp),%rax adcq $0,%rdx addq %r9,%r8 leaq 8(%rdi),%rdi @@ -1491,7 +1749,7 @@ L$8x_tail: mulq %rbx addq %rax,%r10 - movq 48(%rbp),%rax + movq 24(%rbp),%rax adcq $0,%rdx addq %r10,%r9 movq %rdx,%r10 @@ -1499,7 +1757,7 @@ L$8x_tail: mulq %rbx addq %rax,%r11 - movq 64(%rbp),%rax + movq 32(%rbp),%rax adcq $0,%rdx addq %r11,%r10 movq %rdx,%r11 @@ -1507,7 +1765,7 @@ L$8x_tail: mulq %rbx addq %rax,%r12 - movq 80(%rbp),%rax + movq 40(%rbp),%rax adcq $0,%rdx addq %r12,%r11 movq %rdx,%r12 @@ -1515,7 +1773,7 @@ L$8x_tail: mulq %rbx addq %rax,%r13 - movq 96(%rbp),%rax + movq 48(%rbp),%rax adcq $0,%rdx addq %r13,%r12 movq %rdx,%r13 @@ -1523,7 +1781,7 @@ L$8x_tail: mulq %rbx addq %rax,%r14 - movq 112(%rbp),%rax + movq 56(%rbp),%rax adcq $0,%rdx addq %r14,%r13 movq %rdx,%r14 @@ -1541,7 +1799,7 @@ L$8x_tail: decl %ecx jnz L$8x_tail - leaq 128(%rbp),%rbp + leaq 64(%rbp),%rbp movq 8+8(%rsp),%rdx cmpq 0+8(%rsp),%rbp jae L$8x_tail_done @@ -1565,6 +1823,15 @@ L$8x_tail: .p2align 5 L$8x_tail_done: addq (%rdx),%r8 + adcq $0,%r9 + adcq $0,%r10 + adcq $0,%r11 + adcq $0,%r12 + adcq $0,%r13 + adcq $0,%r14 + adcq $0,%r15 + + xorq %rax,%rax negq %rsi @@ -1578,7 +1845,7 @@ L$8x_no_tail: adcq 48(%rdi),%r14 adcq 56(%rdi),%r15 adcq $0,%rax - movq -16(%rbp),%rcx + movq -8(%rbp),%rcx xorq %rsi,%rsi .byte 102,72,15,126,213 @@ -1596,40 +1863,58 @@ L$8x_no_tail: cmpq %rdx,%rdi jb L$8x_reduction_loop + .byte 0xf3,0xc3 + - subq %r15,%rcx +.p2align 5 +__bn_post4x_internal: + movq 0(%rbp),%r12 leaq (%rdi,%r9,1),%rbx - adcq %rsi,%rsi movq %r9,%rcx - orq %rsi,%rax .byte 102,72,15,126,207 - xorq $1,%rax + negq %rax .byte 102,72,15,126,206 - leaq (%rbp,%rax,8),%rbp sarq $3+2,%rcx - jmp L$sqr4x_sub + decq %r12 + xorq %r10,%r10 + movq 8(%rbp),%r13 + movq 16(%rbp),%r14 + movq 24(%rbp),%r15 + jmp L$sqr4x_sub_entry -.p2align 5 +.p2align 4 L$sqr4x_sub: -.byte 0x66 - movq 0(%rbx),%r12 - movq 8(%rbx),%r13 - sbbq 0(%rbp),%r12 - movq 16(%rbx),%r14 - sbbq 16(%rbp),%r13 - movq 24(%rbx),%r15 - leaq 32(%rbx),%rbx - sbbq 32(%rbp),%r14 + movq 0(%rbp),%r12 + movq 8(%rbp),%r13 + movq 16(%rbp),%r14 + movq 24(%rbp),%r15 +L$sqr4x_sub_entry: + leaq 32(%rbp),%rbp + notq %r12 + notq %r13 + notq %r14 + notq %r15 + andq %rax,%r12 + andq %rax,%r13 + andq %rax,%r14 + andq %rax,%r15 + + negq %r10 + adcq 0(%rbx),%r12 + adcq 8(%rbx),%r13 + adcq 16(%rbx),%r14 + adcq 24(%rbx),%r15 movq %r12,0(%rdi) - sbbq 48(%rbp),%r15 - leaq 64(%rbp),%rbp + leaq 32(%rbx),%rbx movq %r13,8(%rdi) + sbbq %r10,%r10 movq %r14,16(%rdi) movq %r15,24(%rdi) leaq 32(%rdi),%rdi incq %rcx jnz L$sqr4x_sub + movq %r9,%r10 negq %r9 .byte 0xf3,0xc3 @@ -1655,10 +1940,9 @@ bn_from_mont8x: pushq %r13 pushq %r14 pushq %r15 -.byte 0x67 - movl %r9d,%r10d + shll $3,%r9d - shll $3+2,%r10d + leaq (%r9,%r9,2),%r10 negq %r9 movq (%r8),%r8 @@ -1668,19 +1952,20 @@ bn_from_mont8x: - leaq -64(%rsp,%r9,2),%r11 - subq %rsi,%r11 + + leaq -320(%rsp,%r9,2),%r11 + subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb L$from_sp_alt subq %r11,%rsp - leaq -64(%rsp,%r9,2),%rsp + leaq -320(%rsp,%r9,2),%rsp jmp L$from_sp_done .p2align 5 L$from_sp_alt: - leaq 4096-64(,%r9,2),%r10 - leaq -64(%rsp,%r9,2),%rsp + leaq 4096-320(,%r9,2),%r10 + leaq -320(%rsp,%r9,2),%rsp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 @@ -1731,22 +2016,8 @@ L$mul_by_1: .byte 0x67 movq %rcx,%rbp .byte 102,73,15,110,218 - movl _OPENSSL_ia32cap_P+8(%rip),%r11d - andl $524544,%r11d - cmpl $524544,%r11d - jne L$from_mont_nox - - leaq (%rax,%r9,1),%rdi - call sqrx8x_reduction - - pxor %xmm0,%xmm0 - leaq 48(%rsp),%rax - movq 40(%rsp),%rsi - jmp L$from_mont_zero - -.p2align 5 -L$from_mont_nox: - call sqr8x_reduction + call __bn_sqr8x_reduction + call __bn_post4x_internal pxor %xmm0,%xmm0 leaq 48(%rsp),%rax @@ -1774,1190 +2045,208 @@ L$from_mont_zero: L$from_epilogue: .byte 0xf3,0xc3 +.globl _bn_get_bits5 -.p2align 5 -bn_mulx4x_mont_gather5: -L$mulx4x_enter: -.byte 0x67 - movq %rsp,%rax - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 -.byte 0x67 - movl %r9d,%r10d - shll $3,%r9d - shll $3+2,%r10d - negq %r9 - movq (%r8),%r8 - - - - - - - - - leaq -64(%rsp,%r9,2),%r11 - subq %rsi,%r11 - andq $4095,%r11 - cmpq %r11,%r10 - jb L$mulx4xsp_alt - subq %r11,%rsp - leaq -64(%rsp,%r9,2),%rsp - jmp L$mulx4xsp_done - -.p2align 5 -L$mulx4xsp_alt: - leaq 4096-64(,%r9,2),%r10 - leaq -64(%rsp,%r9,2),%rsp - subq %r10,%r11 - movq $0,%r10 - cmovcq %r10,%r11 - subq %r11,%rsp -L$mulx4xsp_done: - andq $-64,%rsp - - - - - - - - - - +.p2align 4 +_bn_get_bits5: + leaq 0(%rdi),%r10 + leaq 1(%rdi),%r11 + movl %esi,%ecx + shrl $4,%esi + andl $15,%ecx + leal -8(%rcx),%eax + cmpl $11,%ecx + cmovaq %r11,%r10 + cmoval %eax,%ecx + movzwl (%r10,%rsi,2),%eax + shrl %cl,%eax + andl $31,%eax + .byte 0xf3,0xc3 - movq %r8,32(%rsp) - movq %rax,40(%rsp) -L$mulx4x_body: - call mulx4x_internal +.globl _bn_scatter5 - movq 40(%rsp),%rsi - movq $1,%rax - movq -48(%rsi),%r15 - movq -40(%rsi),%r14 - movq -32(%rsi),%r13 - movq -24(%rsi),%r12 - movq -16(%rsi),%rbp - movq -8(%rsi),%rbx - leaq (%rsi),%rsp -L$mulx4x_epilogue: +.p2align 4 +_bn_scatter5: + cmpl $0,%esi + jz L$scatter_epilogue + leaq (%rdx,%rcx,8),%rdx +L$scatter: + movq (%rdi),%rax + leaq 8(%rdi),%rdi + movq %rax,(%rdx) + leaq 256(%rdx),%rdx + subl $1,%esi + jnz L$scatter +L$scatter_epilogue: .byte 0xf3,0xc3 +.globl _bn_gather5 .p2align 5 -mulx4x_internal: -.byte 0x4c,0x89,0x8c,0x24,0x08,0x00,0x00,0x00 -.byte 0x67 - negq %r9 - shlq $5,%r9 - leaq 256(%rdx,%r9,1),%r13 - shrq $5+5,%r9 - movl 8(%rax),%r10d - subq $1,%r9 - movq %r13,16+8(%rsp) - movq %r9,24+8(%rsp) - movq %rdi,56+8(%rsp) - movq %r10,%r11 - shrq $3,%r10 - andq $7,%r11 - notq %r10 - leaq L$magic_masks(%rip),%rax - andq $3,%r10 - leaq 96(%rdx,%r11,8),%rdi - movq 0(%rax,%r10,8),%xmm4 - movq 8(%rax,%r10,8),%xmm5 - addq $7,%r11 - movq 16(%rax,%r10,8),%xmm6 - movq 24(%rax,%r10,8),%xmm7 - andq $7,%r11 - - movq -96(%rdi),%xmm0 - leaq 256(%rdi),%rbx - movq -32(%rdi),%xmm1 - pand %xmm4,%xmm0 - movq 32(%rdi),%xmm2 - pand %xmm5,%xmm1 - movq 96(%rdi),%xmm3 - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - movq -96(%rbx),%xmm1 - pand %xmm7,%xmm3 - por %xmm2,%xmm0 - movq -32(%rbx),%xmm2 - por %xmm3,%xmm0 -.byte 0x67,0x67 - pand %xmm4,%xmm1 - movq 32(%rbx),%xmm3 - -.byte 102,72,15,126,194 - movq 96(%rbx),%xmm0 - leaq 512(%rdi),%rdi - pand %xmm5,%xmm2 -.byte 0x67,0x67 - pand %xmm6,%xmm3 - - - +_bn_gather5: +L$SEH_begin_bn_gather5: + +.byte 0x4c,0x8d,0x14,0x24 +.byte 0x48,0x81,0xec,0x08,0x01,0x00,0x00 + leaq L$inc(%rip),%rax + andq $-16,%rsp + + movd %ecx,%xmm5 + movdqa 0(%rax),%xmm0 + movdqa 16(%rax),%xmm1 + leaq 128(%rdx),%r11 + leaq 128(%rsp),%rax + + pshufd $0,%xmm5,%xmm5 + movdqa %xmm1,%xmm4 + movdqa %xmm1,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm4,%xmm3 + + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,-128(%rax) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,-112(%rax) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,-96(%rax) + movdqa %xmm4,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,-80(%rax) + movdqa %xmm4,%xmm3 + + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,-64(%rax) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,-48(%rax) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,-32(%rax) + movdqa %xmm4,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,-16(%rax) + movdqa %xmm4,%xmm3 + + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,0(%rax) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,16(%rax) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,32(%rax) + movdqa %xmm4,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,48(%rax) + movdqa %xmm4,%xmm3 + + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,64(%rax) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,80(%rax) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,96(%rax) + movdqa %xmm4,%xmm2 + movdqa %xmm3,112(%rax) + jmp L$gather +.p2align 5 +L$gather: + pxor %xmm4,%xmm4 + pxor %xmm5,%xmm5 + movdqa -128(%r11),%xmm0 + movdqa -112(%r11),%xmm1 + movdqa -96(%r11),%xmm2 + pand -128(%rax),%xmm0 + movdqa -80(%r11),%xmm3 + pand -112(%rax),%xmm1 + por %xmm0,%xmm4 + pand -96(%rax),%xmm2 + por %xmm1,%xmm5 + pand -80(%rax),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa -64(%r11),%xmm0 + movdqa -48(%r11),%xmm1 + movdqa -32(%r11),%xmm2 + pand -64(%rax),%xmm0 + movdqa -16(%r11),%xmm3 + pand -48(%rax),%xmm1 + por %xmm0,%xmm4 + pand -32(%rax),%xmm2 + por %xmm1,%xmm5 + pand -16(%rax),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa 0(%r11),%xmm0 + movdqa 16(%r11),%xmm1 + movdqa 32(%r11),%xmm2 + pand 0(%rax),%xmm0 + movdqa 48(%r11),%xmm3 + pand 16(%rax),%xmm1 + por %xmm0,%xmm4 + pand 32(%rax),%xmm2 + por %xmm1,%xmm5 + pand 48(%rax),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa 64(%r11),%xmm0 + movdqa 80(%r11),%xmm1 + movdqa 96(%r11),%xmm2 + pand 64(%rax),%xmm0 + movdqa 112(%r11),%xmm3 + pand 80(%rax),%xmm1 + por %xmm0,%xmm4 + pand 96(%rax),%xmm2 + por %xmm1,%xmm5 + pand 112(%rax),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + por %xmm5,%xmm4 + leaq 256(%r11),%r11 + pshufd $0x4e,%xmm4,%xmm0 + por %xmm4,%xmm0 + movq %xmm0,(%rdi) + leaq 8(%rdi),%rdi + subl $1,%esi + jnz L$gather - - - leaq 64+32+8(%rsp,%r11,8),%rbx - - movq %rdx,%r9 - mulxq 0(%rsi),%r8,%rax - mulxq 8(%rsi),%r11,%r12 - addq %rax,%r11 - mulxq 16(%rsi),%rax,%r13 - adcq %rax,%r12 - adcq $0,%r13 - mulxq 24(%rsi),%rax,%r14 - - movq %r8,%r15 - imulq 32+8(%rsp),%r8 - xorq %rbp,%rbp - movq %r8,%rdx - - por %xmm2,%xmm1 - pand %xmm7,%xmm0 - por %xmm3,%xmm1 - movq %rdi,8+8(%rsp) - por %xmm1,%xmm0 - -.byte 0x48,0x8d,0xb6,0x20,0x00,0x00,0x00 - adcxq %rax,%r13 - adcxq %rbp,%r14 - - mulxq 0(%rcx),%rax,%r10 - adcxq %rax,%r15 - adoxq %r11,%r10 - mulxq 16(%rcx),%rax,%r11 - adcxq %rax,%r10 - adoxq %r12,%r11 - mulxq 32(%rcx),%rax,%r12 - movq 24+8(%rsp),%rdi -.byte 0x66 - movq %r10,-32(%rbx) - adcxq %rax,%r11 - adoxq %r13,%r12 - mulxq 48(%rcx),%rax,%r15 -.byte 0x67,0x67 - movq %r9,%rdx - movq %r11,-24(%rbx) - adcxq %rax,%r12 - adoxq %rbp,%r15 -.byte 0x48,0x8d,0x89,0x40,0x00,0x00,0x00 - movq %r12,-16(%rbx) - - -.p2align 5 -L$mulx4x_1st: - adcxq %rbp,%r15 - mulxq 0(%rsi),%r10,%rax - adcxq %r14,%r10 - mulxq 8(%rsi),%r11,%r14 - adcxq %rax,%r11 - mulxq 16(%rsi),%r12,%rax - adcxq %r14,%r12 - mulxq 24(%rsi),%r13,%r14 -.byte 0x67,0x67 - movq %r8,%rdx - adcxq %rax,%r13 - adcxq %rbp,%r14 - leaq 32(%rsi),%rsi - leaq 32(%rbx),%rbx - - adoxq %r15,%r10 - mulxq 0(%rcx),%rax,%r15 - adcxq %rax,%r10 - adoxq %r15,%r11 - mulxq 16(%rcx),%rax,%r15 - adcxq %rax,%r11 - adoxq %r15,%r12 - mulxq 32(%rcx),%rax,%r15 - movq %r10,-40(%rbx) - adcxq %rax,%r12 - movq %r11,-32(%rbx) - adoxq %r15,%r13 - mulxq 48(%rcx),%rax,%r15 - movq %r9,%rdx - movq %r12,-24(%rbx) - adcxq %rax,%r13 - adoxq %rbp,%r15 - leaq 64(%rcx),%rcx - movq %r13,-16(%rbx) - - decq %rdi - jnz L$mulx4x_1st - - movq 8(%rsp),%rax -.byte 102,72,15,126,194 - adcq %rbp,%r15 - leaq (%rsi,%rax,1),%rsi - addq %r15,%r14 - movq 8+8(%rsp),%rdi - adcq %rbp,%rbp - movq %r14,-8(%rbx) - jmp L$mulx4x_outer - -.p2align 5 -L$mulx4x_outer: - movq %rbp,(%rbx) - leaq 32(%rbx,%rax,1),%rbx - mulxq 0(%rsi),%r8,%r11 - xorq %rbp,%rbp - movq %rdx,%r9 - mulxq 8(%rsi),%r14,%r12 - adoxq -32(%rbx),%r8 - adcxq %r14,%r11 - mulxq 16(%rsi),%r15,%r13 - adoxq -24(%rbx),%r11 - adcxq %r15,%r12 - mulxq 24(%rsi),%rdx,%r14 - adoxq -16(%rbx),%r12 - adcxq %rdx,%r13 - leaq (%rcx,%rax,2),%rcx - leaq 32(%rsi),%rsi - adoxq -8(%rbx),%r13 - adcxq %rbp,%r14 - adoxq %rbp,%r14 - -.byte 0x67 - movq %r8,%r15 - imulq 32+8(%rsp),%r8 - - movq -96(%rdi),%xmm0 -.byte 0x67,0x67 - movq %r8,%rdx - movq -32(%rdi),%xmm1 -.byte 0x67 - pand %xmm4,%xmm0 - movq 32(%rdi),%xmm2 -.byte 0x67 - pand %xmm5,%xmm1 - movq 96(%rdi),%xmm3 - addq $256,%rdi -.byte 0x67 - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 - xorq %rbp,%rbp - movq %rdi,8+8(%rsp) - - mulxq 0(%rcx),%rax,%r10 - adcxq %rax,%r15 - adoxq %r11,%r10 - mulxq 16(%rcx),%rax,%r11 - adcxq %rax,%r10 - adoxq %r12,%r11 - mulxq 32(%rcx),%rax,%r12 - adcxq %rax,%r11 - adoxq %r13,%r12 - mulxq 48(%rcx),%rax,%r15 - movq %r9,%rdx - por %xmm2,%xmm0 - movq 24+8(%rsp),%rdi - movq %r10,-32(%rbx) - por %xmm3,%xmm0 - adcxq %rax,%r12 - movq %r11,-24(%rbx) - adoxq %rbp,%r15 - movq %r12,-16(%rbx) - leaq 64(%rcx),%rcx - jmp L$mulx4x_inner - -.p2align 5 -L$mulx4x_inner: - mulxq 0(%rsi),%r10,%rax - adcxq %rbp,%r15 - adoxq %r14,%r10 - mulxq 8(%rsi),%r11,%r14 - adcxq 0(%rbx),%r10 - adoxq %rax,%r11 - mulxq 16(%rsi),%r12,%rax - adcxq 8(%rbx),%r11 - adoxq %r14,%r12 - mulxq 24(%rsi),%r13,%r14 - movq %r8,%rdx - adcxq 16(%rbx),%r12 - adoxq %rax,%r13 - adcxq 24(%rbx),%r13 - adoxq %rbp,%r14 - leaq 32(%rsi),%rsi - leaq 32(%rbx),%rbx - adcxq %rbp,%r14 - - adoxq %r15,%r10 - mulxq 0(%rcx),%rax,%r15 - adcxq %rax,%r10 - adoxq %r15,%r11 - mulxq 16(%rcx),%rax,%r15 - adcxq %rax,%r11 - adoxq %r15,%r12 - mulxq 32(%rcx),%rax,%r15 - movq %r10,-40(%rbx) - adcxq %rax,%r12 - adoxq %r15,%r13 - movq %r11,-32(%rbx) - mulxq 48(%rcx),%rax,%r15 - movq %r9,%rdx - leaq 64(%rcx),%rcx - movq %r12,-24(%rbx) - adcxq %rax,%r13 - adoxq %rbp,%r15 - movq %r13,-16(%rbx) - - decq %rdi - jnz L$mulx4x_inner - - movq 0+8(%rsp),%rax -.byte 102,72,15,126,194 - adcq %rbp,%r15 - subq 0(%rbx),%rdi - movq 8+8(%rsp),%rdi - movq 16+8(%rsp),%r10 - adcq %r15,%r14 - leaq (%rsi,%rax,1),%rsi - adcq %rbp,%rbp - movq %r14,-8(%rbx) - - cmpq %r10,%rdi - jb L$mulx4x_outer - - movq -16(%rcx),%r10 - xorq %r15,%r15 - subq %r14,%r10 - adcq %r15,%r15 - orq %r15,%rbp - xorq $1,%rbp - leaq (%rbx,%rax,1),%rdi - leaq (%rcx,%rax,2),%rcx -.byte 0x67,0x67 - sarq $3+2,%rax - leaq (%rcx,%rbp,8),%rbp - movq 56+8(%rsp),%rdx - movq %rax,%rcx - jmp L$sqrx4x_sub - - -.p2align 5 -bn_powerx5: -L$powerx5_enter: -.byte 0x67 - movq %rsp,%rax - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 -.byte 0x67 - movl %r9d,%r10d - shll $3,%r9d - shll $3+2,%r10d - negq %r9 - movq (%r8),%r8 - - - - - - - - leaq -64(%rsp,%r9,2),%r11 - subq %rsi,%r11 - andq $4095,%r11 - cmpq %r11,%r10 - jb L$pwrx_sp_alt - subq %r11,%rsp - leaq -64(%rsp,%r9,2),%rsp - jmp L$pwrx_sp_done - -.p2align 5 -L$pwrx_sp_alt: - leaq 4096-64(,%r9,2),%r10 - leaq -64(%rsp,%r9,2),%rsp - subq %r10,%r11 - movq $0,%r10 - cmovcq %r10,%r11 - subq %r11,%rsp -L$pwrx_sp_done: - andq $-64,%rsp - movq %r9,%r10 - negq %r9 - - - - - - - - - - - - - pxor %xmm0,%xmm0 -.byte 102,72,15,110,207 -.byte 102,72,15,110,209 -.byte 102,73,15,110,218 -.byte 102,72,15,110,226 - movq %r8,32(%rsp) - movq %rax,40(%rsp) -L$powerx5_body: - - call __bn_sqrx8x_internal - call __bn_sqrx8x_internal - call __bn_sqrx8x_internal - call __bn_sqrx8x_internal - call __bn_sqrx8x_internal - - movq %r10,%r9 - movq %rsi,%rdi -.byte 102,72,15,126,209 -.byte 102,72,15,126,226 - movq 40(%rsp),%rax - - call mulx4x_internal - - movq 40(%rsp),%rsi - movq $1,%rax - movq -48(%rsi),%r15 - movq -40(%rsi),%r14 - movq -32(%rsi),%r13 - movq -24(%rsi),%r12 - movq -16(%rsi),%rbp - movq -8(%rsi),%rbx - leaq (%rsi),%rsp -L$powerx5_epilogue: - .byte 0xf3,0xc3 - - -.globl _bn_sqrx8x_internal -.private_extern _bn_sqrx8x_internal - -.p2align 5 -_bn_sqrx8x_internal: -__bn_sqrx8x_internal: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - leaq 48+8(%rsp),%rdi - leaq (%rsi,%r9,1),%rbp - movq %r9,0+8(%rsp) - movq %rbp,8+8(%rsp) - jmp L$sqr8x_zero_start - -.p2align 5 -.byte 0x66,0x66,0x66,0x2e,0x0f,0x1f,0x84,0x00,0x00,0x00,0x00,0x00 -L$sqrx8x_zero: -.byte 0x3e - movdqa %xmm0,0(%rdi) - movdqa %xmm0,16(%rdi) - movdqa %xmm0,32(%rdi) - movdqa %xmm0,48(%rdi) -L$sqr8x_zero_start: - movdqa %xmm0,64(%rdi) - movdqa %xmm0,80(%rdi) - movdqa %xmm0,96(%rdi) - movdqa %xmm0,112(%rdi) - leaq 128(%rdi),%rdi - subq $64,%r9 - jnz L$sqrx8x_zero - - movq 0(%rsi),%rdx - - xorq %r10,%r10 - xorq %r11,%r11 - xorq %r12,%r12 - xorq %r13,%r13 - xorq %r14,%r14 - xorq %r15,%r15 - leaq 48+8(%rsp),%rdi - xorq %rbp,%rbp - jmp L$sqrx8x_outer_loop - -.p2align 5 -L$sqrx8x_outer_loop: - mulxq 8(%rsi),%r8,%rax - adcxq %r9,%r8 - adoxq %rax,%r10 - mulxq 16(%rsi),%r9,%rax - adcxq %r10,%r9 - adoxq %rax,%r11 -.byte 0xc4,0xe2,0xab,0xf6,0x86,0x18,0x00,0x00,0x00 - adcxq %r11,%r10 - adoxq %rax,%r12 -.byte 0xc4,0xe2,0xa3,0xf6,0x86,0x20,0x00,0x00,0x00 - adcxq %r12,%r11 - adoxq %rax,%r13 - mulxq 40(%rsi),%r12,%rax - adcxq %r13,%r12 - adoxq %rax,%r14 - mulxq 48(%rsi),%r13,%rax - adcxq %r14,%r13 - adoxq %r15,%rax - mulxq 56(%rsi),%r14,%r15 - movq 8(%rsi),%rdx - adcxq %rax,%r14 - adoxq %rbp,%r15 - adcq 64(%rdi),%r15 - movq %r8,8(%rdi) - movq %r9,16(%rdi) - sbbq %rcx,%rcx - xorq %rbp,%rbp - - - mulxq 16(%rsi),%r8,%rbx - mulxq 24(%rsi),%r9,%rax - adcxq %r10,%r8 - adoxq %rbx,%r9 - mulxq 32(%rsi),%r10,%rbx - adcxq %r11,%r9 - adoxq %rax,%r10 -.byte 0xc4,0xe2,0xa3,0xf6,0x86,0x28,0x00,0x00,0x00 - adcxq %r12,%r10 - adoxq %rbx,%r11 -.byte 0xc4,0xe2,0x9b,0xf6,0x9e,0x30,0x00,0x00,0x00 - adcxq %r13,%r11 - adoxq %r14,%r12 -.byte 0xc4,0x62,0x93,0xf6,0xb6,0x38,0x00,0x00,0x00 - movq 16(%rsi),%rdx - adcxq %rax,%r12 - adoxq %rbx,%r13 - adcxq %r15,%r13 - adoxq %rbp,%r14 - adcxq %rbp,%r14 - - movq %r8,24(%rdi) - movq %r9,32(%rdi) - - mulxq 24(%rsi),%r8,%rbx - mulxq 32(%rsi),%r9,%rax - adcxq %r10,%r8 - adoxq %rbx,%r9 - mulxq 40(%rsi),%r10,%rbx - adcxq %r11,%r9 - adoxq %rax,%r10 -.byte 0xc4,0xe2,0xa3,0xf6,0x86,0x30,0x00,0x00,0x00 - adcxq %r12,%r10 - adoxq %r13,%r11 -.byte 0xc4,0x62,0x9b,0xf6,0xae,0x38,0x00,0x00,0x00 -.byte 0x3e - movq 24(%rsi),%rdx - adcxq %rbx,%r11 - adoxq %rax,%r12 - adcxq %r14,%r12 - movq %r8,40(%rdi) - movq %r9,48(%rdi) - mulxq 32(%rsi),%r8,%rax - adoxq %rbp,%r13 - adcxq %rbp,%r13 - - mulxq 40(%rsi),%r9,%rbx - adcxq %r10,%r8 - adoxq %rax,%r9 - mulxq 48(%rsi),%r10,%rax - adcxq %r11,%r9 - adoxq %r12,%r10 - mulxq 56(%rsi),%r11,%r12 - movq 32(%rsi),%rdx - movq 40(%rsi),%r14 - adcxq %rbx,%r10 - adoxq %rax,%r11 - movq 48(%rsi),%r15 - adcxq %r13,%r11 - adoxq %rbp,%r12 - adcxq %rbp,%r12 - - movq %r8,56(%rdi) - movq %r9,64(%rdi) - - mulxq %r14,%r9,%rax - movq 56(%rsi),%r8 - adcxq %r10,%r9 - mulxq %r15,%r10,%rbx - adoxq %rax,%r10 - adcxq %r11,%r10 - mulxq %r8,%r11,%rax - movq %r14,%rdx - adoxq %rbx,%r11 - adcxq %r12,%r11 - - adcxq %rbp,%rax - - mulxq %r15,%r14,%rbx - mulxq %r8,%r12,%r13 - movq %r15,%rdx - leaq 64(%rsi),%rsi - adcxq %r14,%r11 - adoxq %rbx,%r12 - adcxq %rax,%r12 - adoxq %rbp,%r13 - -.byte 0x67,0x67 - mulxq %r8,%r8,%r14 - adcxq %r8,%r13 - adcxq %rbp,%r14 - - cmpq 8+8(%rsp),%rsi - je L$sqrx8x_outer_break - - negq %rcx - movq $-8,%rcx - movq %rbp,%r15 - movq 64(%rdi),%r8 - adcxq 72(%rdi),%r9 - adcxq 80(%rdi),%r10 - adcxq 88(%rdi),%r11 - adcq 96(%rdi),%r12 - adcq 104(%rdi),%r13 - adcq 112(%rdi),%r14 - adcq 120(%rdi),%r15 - leaq (%rsi),%rbp - leaq 128(%rdi),%rdi - sbbq %rax,%rax - - movq -64(%rsi),%rdx - movq %rax,16+8(%rsp) - movq %rdi,24+8(%rsp) - - - xorl %eax,%eax - jmp L$sqrx8x_loop - -.p2align 5 -L$sqrx8x_loop: - movq %r8,%rbx - mulxq 0(%rbp),%rax,%r8 - adcxq %rax,%rbx - adoxq %r9,%r8 - - mulxq 8(%rbp),%rax,%r9 - adcxq %rax,%r8 - adoxq %r10,%r9 - - mulxq 16(%rbp),%rax,%r10 - adcxq %rax,%r9 - adoxq %r11,%r10 - - mulxq 24(%rbp),%rax,%r11 - adcxq %rax,%r10 - adoxq %r12,%r11 - -.byte 0xc4,0x62,0xfb,0xf6,0xa5,0x20,0x00,0x00,0x00 - adcxq %rax,%r11 - adoxq %r13,%r12 - - mulxq 40(%rbp),%rax,%r13 - adcxq %rax,%r12 - adoxq %r14,%r13 - - mulxq 48(%rbp),%rax,%r14 - movq %rbx,(%rdi,%rcx,8) - movl $0,%ebx - adcxq %rax,%r13 - adoxq %r15,%r14 - -.byte 0xc4,0x62,0xfb,0xf6,0xbd,0x38,0x00,0x00,0x00 - movq 8(%rsi,%rcx,8),%rdx - adcxq %rax,%r14 - adoxq %rbx,%r15 - adcxq %rbx,%r15 - -.byte 0x67 - incq %rcx - jnz L$sqrx8x_loop - - leaq 64(%rbp),%rbp - movq $-8,%rcx - cmpq 8+8(%rsp),%rbp - je L$sqrx8x_break - - subq 16+8(%rsp),%rbx -.byte 0x66 - movq -64(%rsi),%rdx - adcxq 0(%rdi),%r8 - adcxq 8(%rdi),%r9 - adcq 16(%rdi),%r10 - adcq 24(%rdi),%r11 - adcq 32(%rdi),%r12 - adcq 40(%rdi),%r13 - adcq 48(%rdi),%r14 - adcq 56(%rdi),%r15 - leaq 64(%rdi),%rdi -.byte 0x67 - sbbq %rax,%rax - xorl %ebx,%ebx - movq %rax,16+8(%rsp) - jmp L$sqrx8x_loop - -.p2align 5 -L$sqrx8x_break: - subq 16+8(%rsp),%r8 - movq 24+8(%rsp),%rcx - movq 0(%rsi),%rdx - xorl %ebp,%ebp - movq %r8,0(%rdi) - cmpq %rcx,%rdi - je L$sqrx8x_outer_loop - - movq %r9,8(%rdi) - movq 8(%rcx),%r9 - movq %r10,16(%rdi) - movq 16(%rcx),%r10 - movq %r11,24(%rdi) - movq 24(%rcx),%r11 - movq %r12,32(%rdi) - movq 32(%rcx),%r12 - movq %r13,40(%rdi) - movq 40(%rcx),%r13 - movq %r14,48(%rdi) - movq 48(%rcx),%r14 - movq %r15,56(%rdi) - movq 56(%rcx),%r15 - movq %rcx,%rdi - jmp L$sqrx8x_outer_loop - -.p2align 5 -L$sqrx8x_outer_break: - movq %r9,72(%rdi) -.byte 102,72,15,126,217 - movq %r10,80(%rdi) - movq %r11,88(%rdi) - movq %r12,96(%rdi) - movq %r13,104(%rdi) - movq %r14,112(%rdi) - leaq 48+8(%rsp),%rdi - movq (%rsi,%rcx,1),%rdx - - movq 8(%rdi),%r11 - xorq %r10,%r10 - movq 0+8(%rsp),%r9 - adoxq %r11,%r11 - movq 16(%rdi),%r12 - movq 24(%rdi),%r13 - - -.p2align 5 -L$sqrx4x_shift_n_add: - mulxq %rdx,%rax,%rbx - adoxq %r12,%r12 - adcxq %r10,%rax -.byte 0x48,0x8b,0x94,0x0e,0x08,0x00,0x00,0x00 -.byte 0x4c,0x8b,0x97,0x20,0x00,0x00,0x00 - adoxq %r13,%r13 - adcxq %r11,%rbx - movq 40(%rdi),%r11 - movq %rax,0(%rdi) - movq %rbx,8(%rdi) - - mulxq %rdx,%rax,%rbx - adoxq %r10,%r10 - adcxq %r12,%rax - movq 16(%rsi,%rcx,1),%rdx - movq 48(%rdi),%r12 - adoxq %r11,%r11 - adcxq %r13,%rbx - movq 56(%rdi),%r13 - movq %rax,16(%rdi) - movq %rbx,24(%rdi) - - mulxq %rdx,%rax,%rbx - adoxq %r12,%r12 - adcxq %r10,%rax - movq 24(%rsi,%rcx,1),%rdx - leaq 32(%rcx),%rcx - movq 64(%rdi),%r10 - adoxq %r13,%r13 - adcxq %r11,%rbx - movq 72(%rdi),%r11 - movq %rax,32(%rdi) - movq %rbx,40(%rdi) - - mulxq %rdx,%rax,%rbx - adoxq %r10,%r10 - adcxq %r12,%rax - jrcxz L$sqrx4x_shift_n_add_break -.byte 0x48,0x8b,0x94,0x0e,0x00,0x00,0x00,0x00 - adoxq %r11,%r11 - adcxq %r13,%rbx - movq 80(%rdi),%r12 - movq 88(%rdi),%r13 - movq %rax,48(%rdi) - movq %rbx,56(%rdi) - leaq 64(%rdi),%rdi - nop - jmp L$sqrx4x_shift_n_add - -.p2align 5 -L$sqrx4x_shift_n_add_break: - adcxq %r13,%rbx - movq %rax,48(%rdi) - movq %rbx,56(%rdi) - leaq 64(%rdi),%rdi -.byte 102,72,15,126,213 -sqrx8x_reduction: - xorl %eax,%eax - movq 32+8(%rsp),%rbx - movq 48+8(%rsp),%rdx - leaq -128(%rbp,%r9,2),%rcx - - movq %rcx,0+8(%rsp) - movq %rdi,8+8(%rsp) - - leaq 48+8(%rsp),%rdi - jmp L$sqrx8x_reduction_loop - -.p2align 5 -L$sqrx8x_reduction_loop: - movq 8(%rdi),%r9 - movq 16(%rdi),%r10 - movq 24(%rdi),%r11 - movq 32(%rdi),%r12 - movq %rdx,%r8 - imulq %rbx,%rdx - movq 40(%rdi),%r13 - movq 48(%rdi),%r14 - movq 56(%rdi),%r15 - movq %rax,24+8(%rsp) - - leaq 64(%rdi),%rdi - xorq %rsi,%rsi - movq $-8,%rcx - jmp L$sqrx8x_reduce - -.p2align 5 -L$sqrx8x_reduce: - movq %r8,%rbx - mulxq 0(%rbp),%rax,%r8 - adcxq %rbx,%rax - adoxq %r9,%r8 - - mulxq 16(%rbp),%rbx,%r9 - adcxq %rbx,%r8 - adoxq %r10,%r9 - - mulxq 32(%rbp),%rbx,%r10 - adcxq %rbx,%r9 - adoxq %r11,%r10 - - mulxq 48(%rbp),%rbx,%r11 - adcxq %rbx,%r10 - adoxq %r12,%r11 - -.byte 0xc4,0x62,0xe3,0xf6,0xa5,0x40,0x00,0x00,0x00 - movq %rdx,%rax - movq %r8,%rdx - adcxq %rbx,%r11 - adoxq %r13,%r12 - - mulxq 32+8(%rsp),%rbx,%rdx - movq %rax,%rdx - movq %rax,64+48+8(%rsp,%rcx,8) - - mulxq 80(%rbp),%rax,%r13 - adcxq %rax,%r12 - adoxq %r14,%r13 - - mulxq 96(%rbp),%rax,%r14 - adcxq %rax,%r13 - adoxq %r15,%r14 - - mulxq 112(%rbp),%rax,%r15 - movq %rbx,%rdx - adcxq %rax,%r14 - adoxq %rsi,%r15 - adcxq %rsi,%r15 - -.byte 0x67,0x67,0x67 - incq %rcx - jnz L$sqrx8x_reduce - - movq %rsi,%rax - cmpq 0+8(%rsp),%rbp - jae L$sqrx8x_no_tail - - movq 48+8(%rsp),%rdx - addq 0(%rdi),%r8 - leaq 128(%rbp),%rbp - movq $-8,%rcx - adcxq 8(%rdi),%r9 - adcxq 16(%rdi),%r10 - adcq 24(%rdi),%r11 - adcq 32(%rdi),%r12 - adcq 40(%rdi),%r13 - adcq 48(%rdi),%r14 - adcq 56(%rdi),%r15 - leaq 64(%rdi),%rdi - sbbq %rax,%rax - - xorq %rsi,%rsi - movq %rax,16+8(%rsp) - jmp L$sqrx8x_tail - -.p2align 5 -L$sqrx8x_tail: - movq %r8,%rbx - mulxq 0(%rbp),%rax,%r8 - adcxq %rax,%rbx - adoxq %r9,%r8 - - mulxq 16(%rbp),%rax,%r9 - adcxq %rax,%r8 - adoxq %r10,%r9 - - mulxq 32(%rbp),%rax,%r10 - adcxq %rax,%r9 - adoxq %r11,%r10 - - mulxq 48(%rbp),%rax,%r11 - adcxq %rax,%r10 - adoxq %r12,%r11 - -.byte 0xc4,0x62,0xfb,0xf6,0xa5,0x40,0x00,0x00,0x00 - adcxq %rax,%r11 - adoxq %r13,%r12 - - mulxq 80(%rbp),%rax,%r13 - adcxq %rax,%r12 - adoxq %r14,%r13 - - mulxq 96(%rbp),%rax,%r14 - adcxq %rax,%r13 - adoxq %r15,%r14 - - mulxq 112(%rbp),%rax,%r15 - movq 72+48+8(%rsp,%rcx,8),%rdx - adcxq %rax,%r14 - adoxq %rsi,%r15 - movq %rbx,(%rdi,%rcx,8) - movq %r8,%rbx - adcxq %rsi,%r15 - - incq %rcx - jnz L$sqrx8x_tail - - cmpq 0+8(%rsp),%rbp - jae L$sqrx8x_tail_done - - subq 16+8(%rsp),%rsi - movq 48+8(%rsp),%rdx - leaq 128(%rbp),%rbp - adcq 0(%rdi),%r8 - adcq 8(%rdi),%r9 - adcq 16(%rdi),%r10 - adcq 24(%rdi),%r11 - adcq 32(%rdi),%r12 - adcq 40(%rdi),%r13 - adcq 48(%rdi),%r14 - adcq 56(%rdi),%r15 - leaq 64(%rdi),%rdi - sbbq %rax,%rax - subq $8,%rcx - - xorq %rsi,%rsi - movq %rax,16+8(%rsp) - jmp L$sqrx8x_tail - -.p2align 5 -L$sqrx8x_tail_done: - addq 24+8(%rsp),%r8 - movq %rsi,%rax - - subq 16+8(%rsp),%rsi -L$sqrx8x_no_tail: - adcq 0(%rdi),%r8 -.byte 102,72,15,126,217 - adcq 8(%rdi),%r9 - movq 112(%rbp),%rsi -.byte 102,72,15,126,213 - adcq 16(%rdi),%r10 - adcq 24(%rdi),%r11 - adcq 32(%rdi),%r12 - adcq 40(%rdi),%r13 - adcq 48(%rdi),%r14 - adcq 56(%rdi),%r15 - adcq %rax,%rax - - movq 32+8(%rsp),%rbx - movq 64(%rdi,%rcx,1),%rdx - - movq %r8,0(%rdi) - leaq 64(%rdi),%r8 - movq %r9,8(%rdi) - movq %r10,16(%rdi) - movq %r11,24(%rdi) - movq %r12,32(%rdi) - movq %r13,40(%rdi) - movq %r14,48(%rdi) - movq %r15,56(%rdi) - - leaq 64(%rdi,%rcx,1),%rdi - cmpq 8+8(%rsp),%r8 - jb L$sqrx8x_reduction_loop - xorq %rbx,%rbx - subq %r15,%rsi - adcq %rbx,%rbx - movq %rcx,%r10 -.byte 0x67 - orq %rbx,%rax -.byte 0x67 - movq %rcx,%r9 - xorq $1,%rax - sarq $3+2,%rcx - - leaq (%rbp,%rax,8),%rbp -.byte 102,72,15,126,202 -.byte 102,72,15,126,206 - jmp L$sqrx4x_sub - -.p2align 5 -L$sqrx4x_sub: -.byte 0x66 - movq 0(%rdi),%r12 - movq 8(%rdi),%r13 - sbbq 0(%rbp),%r12 - movq 16(%rdi),%r14 - sbbq 16(%rbp),%r13 - movq 24(%rdi),%r15 - leaq 32(%rdi),%rdi - sbbq 32(%rbp),%r14 - movq %r12,0(%rdx) - sbbq 48(%rbp),%r15 - leaq 64(%rbp),%rbp - movq %r13,8(%rdx) - movq %r14,16(%rdx) - movq %r15,24(%rdx) - leaq 32(%rdx),%rdx - - incq %rcx - jnz L$sqrx4x_sub - negq %r9 - - .byte 0xf3,0xc3 - -.globl _bn_get_bits5 - -.p2align 4 -_bn_get_bits5: - leaq 0(%rdi),%r10 - leaq 1(%rdi),%r11 - movl %esi,%ecx - shrl $4,%esi - andl $15,%ecx - leal -8(%rcx),%eax - cmpl $11,%ecx - cmovaq %r11,%r10 - cmoval %eax,%ecx - movzwl (%r10,%rsi,2),%eax - shrl %cl,%eax - andl $31,%eax - .byte 0xf3,0xc3 - - -.globl _bn_scatter5 - -.p2align 4 -_bn_scatter5: - cmpl $0,%esi - jz L$scatter_epilogue - leaq (%rdx,%rcx,8),%rdx -L$scatter: - movq (%rdi),%rax - leaq 8(%rdi),%rdi - movq %rax,(%rdx) - leaq 256(%rdx),%rdx - subl $1,%esi - jnz L$scatter -L$scatter_epilogue: - .byte 0xf3,0xc3 - - -.globl _bn_gather5 - -.p2align 4 -_bn_gather5: - movl %ecx,%r11d - shrl $3,%ecx - andq $7,%r11 - notl %ecx - leaq L$magic_masks(%rip),%rax - andl $3,%ecx - leaq 128(%rdx,%r11,8),%rdx - movq 0(%rax,%rcx,8),%xmm4 - movq 8(%rax,%rcx,8),%xmm5 - movq 16(%rax,%rcx,8),%xmm6 - movq 24(%rax,%rcx,8),%xmm7 - jmp L$gather -.p2align 4 -L$gather: - movq -128(%rdx),%xmm0 - movq -64(%rdx),%xmm1 - pand %xmm4,%xmm0 - movq 0(%rdx),%xmm2 - pand %xmm5,%xmm1 - movq 64(%rdx),%xmm3 - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 -.byte 0x67,0x67 - por %xmm2,%xmm0 - leaq 256(%rdx),%rdx - por %xmm3,%xmm0 - - movq %xmm0,(%rdi) - leaq 8(%rdi),%rdi - subl $1,%esi - jnz L$gather + leaq (%r10),%rsp .byte 0xf3,0xc3 L$SEH_end_bn_gather5: .p2align 6 -L$magic_masks: -.long 0,0, 0,0, 0,0, -1,-1 -.long 0,0, 0,0, 0,0, 0,0 +L$inc: +.long 0,0, 1,1 +.long 2,2, 2,2 .byte 77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105,112,108,105,99,97,116,105,111,110,32,119,105,116,104,32,115,99,97,116,116,101,114,47,103,97,116,104,101,114,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 diff --git a/deps/openssl/asm/x64-macosx-gas/ec/ecp_nistz256-x86_64.s b/deps/openssl/asm/x64-macosx-gas/ec/ecp_nistz256-x86_64.s index f2eb8554e87067..30456b900fdffc 100644 --- a/deps/openssl/asm/x64-macosx-gas/ec/ecp_nistz256-x86_64.s +++ b/deps/openssl/asm/x64-macosx-gas/ec/ecp_nistz256-x86_64.s @@ -332,8 +332,6 @@ _ecp_nistz256_neg: .p2align 5 _ecp_nistz256_to_mont: - movl $524544,%ecx - andl _OPENSSL_ia32cap_P+8(%rip),%ecx leaq L$RR(%rip),%rdx jmp L$mul_mont @@ -348,8 +346,6 @@ _ecp_nistz256_to_mont: .p2align 5 _ecp_nistz256_mul_mont: - movl $524544,%ecx - andl _OPENSSL_ia32cap_P+8(%rip),%ecx L$mul_mont: pushq %rbp pushq %rbx @@ -357,8 +353,6 @@ L$mul_mont: pushq %r13 pushq %r14 pushq %r15 - cmpl $524544,%ecx - je L$mul_montx movq %rdx,%rbx movq 0(%rdx),%rax movq 0(%rsi),%r9 @@ -367,19 +361,6 @@ L$mul_mont: movq 24(%rsi),%r12 call __ecp_nistz256_mul_montq - jmp L$mul_mont_done - -.p2align 5 -L$mul_montx: - movq %rdx,%rbx - movq 0(%rdx),%rdx - movq 0(%rsi),%r9 - movq 8(%rsi),%r10 - movq 16(%rsi),%r11 - movq 24(%rsi),%r12 - leaq -128(%rsi),%rsi - - call __ecp_nistz256_mul_montx L$mul_mont_done: popq %r15 popq %r14 @@ -617,33 +598,18 @@ __ecp_nistz256_mul_montq: .p2align 5 _ecp_nistz256_sqr_mont: - movl $524544,%ecx - andl _OPENSSL_ia32cap_P+8(%rip),%ecx pushq %rbp pushq %rbx pushq %r12 pushq %r13 pushq %r14 pushq %r15 - cmpl $524544,%ecx - je L$sqr_montx movq 0(%rsi),%rax movq 8(%rsi),%r14 movq 16(%rsi),%r15 movq 24(%rsi),%r8 call __ecp_nistz256_sqr_montq - jmp L$sqr_mont_done - -.p2align 5 -L$sqr_montx: - movq 0(%rsi),%rdx - movq 8(%rsi),%r14 - movq 16(%rsi),%r15 - movq 24(%rsi),%r8 - leaq -128(%rsi),%rsi - - call __ecp_nistz256_sqr_montx L$sqr_mont_done: popq %r15 popq %r14 @@ -816,304 +782,6 @@ __ecp_nistz256_sqr_montq: .byte 0xf3,0xc3 -.p2align 5 -__ecp_nistz256_mul_montx: - - - mulxq %r9,%r8,%r9 - mulxq %r10,%rcx,%r10 - movq $32,%r14 - xorq %r13,%r13 - mulxq %r11,%rbp,%r11 - movq L$poly+24(%rip),%r15 - adcq %rcx,%r9 - mulxq %r12,%rcx,%r12 - movq %r8,%rdx - adcq %rbp,%r10 - shlxq %r14,%r8,%rbp - adcq %rcx,%r11 - shrxq %r14,%r8,%rcx - adcq $0,%r12 - - - - addq %rbp,%r9 - adcq %rcx,%r10 - - mulxq %r15,%rcx,%rbp - movq 8(%rbx),%rdx - adcq %rcx,%r11 - adcq %rbp,%r12 - adcq $0,%r13 - xorq %r8,%r8 - - - - mulxq 0+128(%rsi),%rcx,%rbp - adcxq %rcx,%r9 - adoxq %rbp,%r10 - - mulxq 8+128(%rsi),%rcx,%rbp - adcxq %rcx,%r10 - adoxq %rbp,%r11 - - mulxq 16+128(%rsi),%rcx,%rbp - adcxq %rcx,%r11 - adoxq %rbp,%r12 - - mulxq 24+128(%rsi),%rcx,%rbp - movq %r9,%rdx - adcxq %rcx,%r12 - shlxq %r14,%r9,%rcx - adoxq %rbp,%r13 - shrxq %r14,%r9,%rbp - - adcxq %r8,%r13 - adoxq %r8,%r8 - adcq $0,%r8 - - - - addq %rcx,%r10 - adcq %rbp,%r11 - - mulxq %r15,%rcx,%rbp - movq 16(%rbx),%rdx - adcq %rcx,%r12 - adcq %rbp,%r13 - adcq $0,%r8 - xorq %r9,%r9 - - - - mulxq 0+128(%rsi),%rcx,%rbp - adcxq %rcx,%r10 - adoxq %rbp,%r11 - - mulxq 8+128(%rsi),%rcx,%rbp - adcxq %rcx,%r11 - adoxq %rbp,%r12 - - mulxq 16+128(%rsi),%rcx,%rbp - adcxq %rcx,%r12 - adoxq %rbp,%r13 - - mulxq 24+128(%rsi),%rcx,%rbp - movq %r10,%rdx - adcxq %rcx,%r13 - shlxq %r14,%r10,%rcx - adoxq %rbp,%r8 - shrxq %r14,%r10,%rbp - - adcxq %r9,%r8 - adoxq %r9,%r9 - adcq $0,%r9 - - - - addq %rcx,%r11 - adcq %rbp,%r12 - - mulxq %r15,%rcx,%rbp - movq 24(%rbx),%rdx - adcq %rcx,%r13 - adcq %rbp,%r8 - adcq $0,%r9 - xorq %r10,%r10 - - - - mulxq 0+128(%rsi),%rcx,%rbp - adcxq %rcx,%r11 - adoxq %rbp,%r12 - - mulxq 8+128(%rsi),%rcx,%rbp - adcxq %rcx,%r12 - adoxq %rbp,%r13 - - mulxq 16+128(%rsi),%rcx,%rbp - adcxq %rcx,%r13 - adoxq %rbp,%r8 - - mulxq 24+128(%rsi),%rcx,%rbp - movq %r11,%rdx - adcxq %rcx,%r8 - shlxq %r14,%r11,%rcx - adoxq %rbp,%r9 - shrxq %r14,%r11,%rbp - - adcxq %r10,%r9 - adoxq %r10,%r10 - adcq $0,%r10 - - - - addq %rcx,%r12 - adcq %rbp,%r13 - - mulxq %r15,%rcx,%rbp - movq %r12,%rbx - movq L$poly+8(%rip),%r14 - adcq %rcx,%r8 - movq %r13,%rdx - adcq %rbp,%r9 - adcq $0,%r10 - - - - xorl %eax,%eax - movq %r8,%rcx - sbbq $-1,%r12 - sbbq %r14,%r13 - sbbq $0,%r8 - movq %r9,%rbp - sbbq %r15,%r9 - sbbq $0,%r10 - - cmovcq %rbx,%r12 - cmovcq %rdx,%r13 - movq %r12,0(%rdi) - cmovcq %rcx,%r8 - movq %r13,8(%rdi) - cmovcq %rbp,%r9 - movq %r8,16(%rdi) - movq %r9,24(%rdi) - - .byte 0xf3,0xc3 - - - -.p2align 5 -__ecp_nistz256_sqr_montx: - mulxq %r14,%r9,%r10 - mulxq %r15,%rcx,%r11 - xorl %eax,%eax - adcq %rcx,%r10 - mulxq %r8,%rbp,%r12 - movq %r14,%rdx - adcq %rbp,%r11 - adcq $0,%r12 - xorq %r13,%r13 - - - mulxq %r15,%rcx,%rbp - adcxq %rcx,%r11 - adoxq %rbp,%r12 - - mulxq %r8,%rcx,%rbp - movq %r15,%rdx - adcxq %rcx,%r12 - adoxq %rbp,%r13 - adcq $0,%r13 - - - mulxq %r8,%rcx,%r14 - movq 0+128(%rsi),%rdx - xorq %r15,%r15 - adcxq %r9,%r9 - adoxq %rcx,%r13 - adcxq %r10,%r10 - adoxq %r15,%r14 - - mulxq %rdx,%r8,%rbp - movq 8+128(%rsi),%rdx - adcxq %r11,%r11 - adoxq %rbp,%r9 - adcxq %r12,%r12 - mulxq %rdx,%rcx,%rax - movq 16+128(%rsi),%rdx - adcxq %r13,%r13 - adoxq %rcx,%r10 - adcxq %r14,%r14 -.byte 0x67 - mulxq %rdx,%rcx,%rbp - movq 24+128(%rsi),%rdx - adoxq %rax,%r11 - adcxq %r15,%r15 - adoxq %rcx,%r12 - movq $32,%rsi - adoxq %rbp,%r13 -.byte 0x67,0x67 - mulxq %rdx,%rcx,%rax - movq %r8,%rdx - adoxq %rcx,%r14 - shlxq %rsi,%r8,%rcx - adoxq %rax,%r15 - shrxq %rsi,%r8,%rax - movq L$poly+24(%rip),%rbp - - - addq %rcx,%r9 - adcq %rax,%r10 - - mulxq %rbp,%rcx,%r8 - movq %r9,%rdx - adcq %rcx,%r11 - shlxq %rsi,%r9,%rcx - adcq $0,%r8 - shrxq %rsi,%r9,%rax - - - addq %rcx,%r10 - adcq %rax,%r11 - - mulxq %rbp,%rcx,%r9 - movq %r10,%rdx - adcq %rcx,%r8 - shlxq %rsi,%r10,%rcx - adcq $0,%r9 - shrxq %rsi,%r10,%rax - - - addq %rcx,%r11 - adcq %rax,%r8 - - mulxq %rbp,%rcx,%r10 - movq %r11,%rdx - adcq %rcx,%r9 - shlxq %rsi,%r11,%rcx - adcq $0,%r10 - shrxq %rsi,%r11,%rax - - - addq %rcx,%r8 - adcq %rax,%r9 - - mulxq %rbp,%rcx,%r11 - adcq %rcx,%r10 - adcq $0,%r11 - - xorq %rdx,%rdx - adcq %r8,%r12 - movq L$poly+8(%rip),%rsi - adcq %r9,%r13 - movq %r12,%r8 - adcq %r10,%r14 - adcq %r11,%r15 - movq %r13,%r9 - adcq $0,%rdx - - xorl %eax,%eax - sbbq $-1,%r12 - movq %r14,%r10 - sbbq %rsi,%r13 - sbbq $0,%r14 - movq %r15,%r11 - sbbq %rbp,%r15 - sbbq $0,%rdx - - cmovcq %r8,%r12 - cmovcq %r9,%r13 - movq %r12,0(%rdi) - cmovcq %r10,%r14 - movq %r13,8(%rdi) - cmovcq %r11,%r15 - movq %r14,16(%rdi) - movq %r15,24(%rdi) - - .byte 0xf3,0xc3 - - @@ -1215,9 +883,6 @@ _ecp_nistz256_from_mont: .p2align 5 _ecp_nistz256_select_w5: - movl _OPENSSL_ia32cap_P+8(%rip),%eax - testl $32,%eax - jnz L$avx2_select_w5 movdqa L$One(%rip),%xmm0 movd %edx,%xmm1 @@ -1277,9 +942,6 @@ L$select_loop_sse_w5: .p2align 5 _ecp_nistz256_select_w7: - movl _OPENSSL_ia32cap_P+8(%rip),%eax - testl $32,%eax - jnz L$avx2_select_w7 movdqa L$One(%rip),%xmm8 movd %edx,%xmm1 @@ -1321,141 +983,11 @@ L$select_loop_sse_w7: movdqu %xmm5,48(%rdi) .byte 0xf3,0xc3 - - - -.p2align 5 -ecp_nistz256_avx2_select_w5: -L$avx2_select_w5: - vzeroupper - vmovdqa L$Two(%rip),%ymm0 - - vpxor %ymm2,%ymm2,%ymm2 - vpxor %ymm3,%ymm3,%ymm3 - vpxor %ymm4,%ymm4,%ymm4 - - vmovdqa L$One(%rip),%ymm5 - vmovdqa L$Two(%rip),%ymm10 - - vmovd %edx,%xmm1 - vpermd %ymm1,%ymm2,%ymm1 - - movq $8,%rax -L$select_loop_avx2_w5: - - vmovdqa 0(%rsi),%ymm6 - vmovdqa 32(%rsi),%ymm7 - vmovdqa 64(%rsi),%ymm8 - - vmovdqa 96(%rsi),%ymm11 - vmovdqa 128(%rsi),%ymm12 - vmovdqa 160(%rsi),%ymm13 - - vpcmpeqd %ymm1,%ymm5,%ymm9 - vpcmpeqd %ymm1,%ymm10,%ymm14 - - vpaddd %ymm0,%ymm5,%ymm5 - vpaddd %ymm0,%ymm10,%ymm10 - leaq 192(%rsi),%rsi - - vpand %ymm9,%ymm6,%ymm6 - vpand %ymm9,%ymm7,%ymm7 - vpand %ymm9,%ymm8,%ymm8 - vpand %ymm14,%ymm11,%ymm11 - vpand %ymm14,%ymm12,%ymm12 - vpand %ymm14,%ymm13,%ymm13 - - vpxor %ymm6,%ymm2,%ymm2 - vpxor %ymm7,%ymm3,%ymm3 - vpxor %ymm8,%ymm4,%ymm4 - vpxor %ymm11,%ymm2,%ymm2 - vpxor %ymm12,%ymm3,%ymm3 - vpxor %ymm13,%ymm4,%ymm4 - - decq %rax - jnz L$select_loop_avx2_w5 - - vmovdqu %ymm2,0(%rdi) - vmovdqu %ymm3,32(%rdi) - vmovdqu %ymm4,64(%rdi) - vzeroupper - .byte 0xf3,0xc3 - - - - .globl _ecp_nistz256_avx2_select_w7 .p2align 5 _ecp_nistz256_avx2_select_w7: -L$avx2_select_w7: - vzeroupper - vmovdqa L$Three(%rip),%ymm0 - - vpxor %ymm2,%ymm2,%ymm2 - vpxor %ymm3,%ymm3,%ymm3 - - vmovdqa L$One(%rip),%ymm4 - vmovdqa L$Two(%rip),%ymm8 - vmovdqa L$Three(%rip),%ymm12 - - vmovd %edx,%xmm1 - vpermd %ymm1,%ymm2,%ymm1 - - - movq $21,%rax -L$select_loop_avx2_w7: - - vmovdqa 0(%rsi),%ymm5 - vmovdqa 32(%rsi),%ymm6 - - vmovdqa 64(%rsi),%ymm9 - vmovdqa 96(%rsi),%ymm10 - - vmovdqa 128(%rsi),%ymm13 - vmovdqa 160(%rsi),%ymm14 - - vpcmpeqd %ymm1,%ymm4,%ymm7 - vpcmpeqd %ymm1,%ymm8,%ymm11 - vpcmpeqd %ymm1,%ymm12,%ymm15 - - vpaddd %ymm0,%ymm4,%ymm4 - vpaddd %ymm0,%ymm8,%ymm8 - vpaddd %ymm0,%ymm12,%ymm12 - leaq 192(%rsi),%rsi - - vpand %ymm7,%ymm5,%ymm5 - vpand %ymm7,%ymm6,%ymm6 - vpand %ymm11,%ymm9,%ymm9 - vpand %ymm11,%ymm10,%ymm10 - vpand %ymm15,%ymm13,%ymm13 - vpand %ymm15,%ymm14,%ymm14 - - vpxor %ymm5,%ymm2,%ymm2 - vpxor %ymm6,%ymm3,%ymm3 - vpxor %ymm9,%ymm2,%ymm2 - vpxor %ymm10,%ymm3,%ymm3 - vpxor %ymm13,%ymm2,%ymm2 - vpxor %ymm14,%ymm3,%ymm3 - - decq %rax - jnz L$select_loop_avx2_w7 - - - vmovdqa 0(%rsi),%ymm5 - vmovdqa 32(%rsi),%ymm6 - - vpcmpeqd %ymm1,%ymm4,%ymm7 - - vpand %ymm7,%ymm5,%ymm5 - vpand %ymm7,%ymm6,%ymm6 - - vpxor %ymm5,%ymm2,%ymm2 - vpxor %ymm6,%ymm3,%ymm3 - - vmovdqu %ymm2,0(%rdi) - vmovdqu %ymm3,32(%rdi) - vzeroupper +.byte 0x0f,0x0b .byte 0xf3,0xc3 @@ -1581,10 +1113,6 @@ __ecp_nistz256_mul_by_2q: .p2align 5 _ecp_nistz256_point_double: - movl $524544,%ecx - andl _OPENSSL_ia32cap_P+8(%rip),%ecx - cmpl $524544,%ecx - je L$point_doublex pushq %rbp pushq %rbx pushq %r12 @@ -1593,6 +1121,7 @@ _ecp_nistz256_point_double: pushq %r15 subq $160+8,%rsp +L$point_double_shortcutq: movdqu 0(%rsi),%xmm0 movq %rsi,%rbx movdqu 16(%rsi),%xmm1 @@ -1786,10 +1315,6 @@ _ecp_nistz256_point_double: .p2align 5 _ecp_nistz256_point_add: - movl $524544,%ecx - andl _OPENSSL_ia32cap_P+8(%rip),%ecx - cmpl $524544,%ecx - je L$point_addx pushq %rbp pushq %rbx pushq %r12 @@ -1817,7 +1342,7 @@ _ecp_nistz256_point_add: por %xmm1,%xmm3 movdqu 0(%rsi),%xmm0 - pshufd $177,%xmm3,%xmm5 + pshufd $0xb1,%xmm3,%xmm5 movdqu 16(%rsi),%xmm1 movdqu 32(%rsi),%xmm2 por %xmm3,%xmm5 @@ -1827,7 +1352,7 @@ _ecp_nistz256_point_add: movq 64+16(%rsi),%r15 movq 64+24(%rsi),%r8 movdqa %xmm0,480(%rsp) - pshufd $30,%xmm5,%xmm4 + pshufd $0x1e,%xmm5,%xmm4 movdqa %xmm1,480+16(%rsp) por %xmm0,%xmm1 .byte 102,72,15,110,199 @@ -1847,10 +1372,10 @@ _ecp_nistz256_point_add: call __ecp_nistz256_sqr_montq pcmpeqd %xmm4,%xmm5 - pshufd $177,%xmm3,%xmm4 + pshufd $0xb1,%xmm3,%xmm4 por %xmm3,%xmm4 pshufd $0,%xmm5,%xmm5 - pshufd $30,%xmm4,%xmm3 + pshufd $0x1e,%xmm4,%xmm3 por %xmm3,%xmm4 pxor %xmm3,%xmm3 pcmpeqd %xmm3,%xmm4 @@ -1859,6 +1384,7 @@ _ecp_nistz256_point_add: movq 64+8(%rbx),%r14 movq 64+16(%rbx),%r15 movq 64+24(%rbx),%r8 +.byte 102,72,15,110,203 leaq 64-0(%rbx),%rsi leaq 32(%rsp),%rdi @@ -1950,7 +1476,7 @@ _ecp_nistz256_point_add: testq %r8,%r8 jnz L$add_proceedq testq %r9,%r9 - jz L$add_proceedq + jz L$add_doubleq .byte 102,72,15,126,199 pxor %xmm0,%xmm0 @@ -1962,6 +1488,13 @@ _ecp_nistz256_point_add: movdqu %xmm0,80(%rdi) jmp L$add_doneq +.p2align 5 +L$add_doubleq: +.byte 102,72,15,126,206 +.byte 102,72,15,126,199 + addq $416,%rsp + jmp L$point_double_shortcutq + .p2align 5 L$add_proceedq: movq 0+64(%rsp),%rax @@ -2179,10 +1712,6 @@ L$add_doneq: .p2align 5 _ecp_nistz256_point_add_affine: - movl $524544,%ecx - andl _OPENSSL_ia32cap_P+8(%rip),%ecx - cmpl $524544,%ecx - je L$point_add_affinex pushq %rbp pushq %rbx pushq %r12 @@ -2213,13 +1742,13 @@ _ecp_nistz256_point_add_affine: por %xmm1,%xmm3 movdqu 0(%rbx),%xmm0 - pshufd $177,%xmm3,%xmm5 + pshufd $0xb1,%xmm3,%xmm5 movdqu 16(%rbx),%xmm1 movdqu 32(%rbx),%xmm2 por %xmm3,%xmm5 movdqu 48(%rbx),%xmm3 movdqa %xmm0,416(%rsp) - pshufd $30,%xmm5,%xmm4 + pshufd $0x1e,%xmm5,%xmm4 movdqa %xmm1,416+16(%rsp) por %xmm0,%xmm1 .byte 102,72,15,110,199 @@ -2235,13 +1764,13 @@ _ecp_nistz256_point_add_affine: call __ecp_nistz256_sqr_montq pcmpeqd %xmm4,%xmm5 - pshufd $177,%xmm3,%xmm4 + pshufd $0xb1,%xmm3,%xmm4 movq 0(%rbx),%rax movq %r12,%r9 por %xmm3,%xmm4 pshufd $0,%xmm5,%xmm5 - pshufd $30,%xmm4,%xmm3 + pshufd $0x1e,%xmm4,%xmm3 movq %r13,%r10 por %xmm3,%xmm4 pxor %xmm3,%xmm3 @@ -2481,1023 +2010,3 @@ _ecp_nistz256_point_add_affine: popq %rbx popq %rbp .byte 0xf3,0xc3 - - -.p2align 5 -__ecp_nistz256_add_tox: - xorq %r11,%r11 - adcq 0(%rbx),%r12 - adcq 8(%rbx),%r13 - movq %r12,%rax - adcq 16(%rbx),%r8 - adcq 24(%rbx),%r9 - movq %r13,%rbp - adcq $0,%r11 - - xorq %r10,%r10 - sbbq $-1,%r12 - movq %r8,%rcx - sbbq %r14,%r13 - sbbq $0,%r8 - movq %r9,%r10 - sbbq %r15,%r9 - - btq $0,%r11 - cmovncq %rax,%r12 - cmovncq %rbp,%r13 - movq %r12,0(%rdi) - cmovncq %rcx,%r8 - movq %r13,8(%rdi) - cmovncq %r10,%r9 - movq %r8,16(%rdi) - movq %r9,24(%rdi) - - .byte 0xf3,0xc3 - - - -.p2align 5 -__ecp_nistz256_sub_fromx: - xorq %r11,%r11 - sbbq 0(%rbx),%r12 - sbbq 8(%rbx),%r13 - movq %r12,%rax - sbbq 16(%rbx),%r8 - sbbq 24(%rbx),%r9 - movq %r13,%rbp - sbbq $0,%r11 - - xorq %r10,%r10 - adcq $-1,%r12 - movq %r8,%rcx - adcq %r14,%r13 - adcq $0,%r8 - movq %r9,%r10 - adcq %r15,%r9 - - btq $0,%r11 - cmovncq %rax,%r12 - cmovncq %rbp,%r13 - movq %r12,0(%rdi) - cmovncq %rcx,%r8 - movq %r13,8(%rdi) - cmovncq %r10,%r9 - movq %r8,16(%rdi) - movq %r9,24(%rdi) - - .byte 0xf3,0xc3 - - - -.p2align 5 -__ecp_nistz256_subx: - xorq %r11,%r11 - sbbq %r12,%rax - sbbq %r13,%rbp - movq %rax,%r12 - sbbq %r8,%rcx - sbbq %r9,%r10 - movq %rbp,%r13 - sbbq $0,%r11 - - xorq %r9,%r9 - adcq $-1,%rax - movq %rcx,%r8 - adcq %r14,%rbp - adcq $0,%rcx - movq %r10,%r9 - adcq %r15,%r10 - - btq $0,%r11 - cmovcq %rax,%r12 - cmovcq %rbp,%r13 - cmovcq %rcx,%r8 - cmovcq %r10,%r9 - - .byte 0xf3,0xc3 - - - -.p2align 5 -__ecp_nistz256_mul_by_2x: - xorq %r11,%r11 - adcq %r12,%r12 - adcq %r13,%r13 - movq %r12,%rax - adcq %r8,%r8 - adcq %r9,%r9 - movq %r13,%rbp - adcq $0,%r11 - - xorq %r10,%r10 - sbbq $-1,%r12 - movq %r8,%rcx - sbbq %r14,%r13 - sbbq $0,%r8 - movq %r9,%r10 - sbbq %r15,%r9 - - btq $0,%r11 - cmovncq %rax,%r12 - cmovncq %rbp,%r13 - movq %r12,0(%rdi) - cmovncq %rcx,%r8 - movq %r13,8(%rdi) - cmovncq %r10,%r9 - movq %r8,16(%rdi) - movq %r9,24(%rdi) - - .byte 0xf3,0xc3 - - -.p2align 5 -ecp_nistz256_point_doublex: -L$point_doublex: - pushq %rbp - pushq %rbx - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - subq $160+8,%rsp - - movdqu 0(%rsi),%xmm0 - movq %rsi,%rbx - movdqu 16(%rsi),%xmm1 - movq 32+0(%rsi),%r12 - movq 32+8(%rsi),%r13 - movq 32+16(%rsi),%r8 - movq 32+24(%rsi),%r9 - movq L$poly+8(%rip),%r14 - movq L$poly+24(%rip),%r15 - movdqa %xmm0,96(%rsp) - movdqa %xmm1,96+16(%rsp) - leaq 32(%rdi),%r10 - leaq 64(%rdi),%r11 -.byte 102,72,15,110,199 -.byte 102,73,15,110,202 -.byte 102,73,15,110,211 - - leaq 0(%rsp),%rdi - call __ecp_nistz256_mul_by_2x - - movq 64+0(%rsi),%rdx - movq 64+8(%rsi),%r14 - movq 64+16(%rsi),%r15 - movq 64+24(%rsi),%r8 - leaq 64-128(%rsi),%rsi - leaq 64(%rsp),%rdi - call __ecp_nistz256_sqr_montx - - movq 0+0(%rsp),%rdx - movq 8+0(%rsp),%r14 - leaq -128+0(%rsp),%rsi - movq 16+0(%rsp),%r15 - movq 24+0(%rsp),%r8 - leaq 0(%rsp),%rdi - call __ecp_nistz256_sqr_montx - - movq 32(%rbx),%rdx - movq 64+0(%rbx),%r9 - movq 64+8(%rbx),%r10 - movq 64+16(%rbx),%r11 - movq 64+24(%rbx),%r12 - leaq 64-128(%rbx),%rsi - leaq 32(%rbx),%rbx -.byte 102,72,15,126,215 - call __ecp_nistz256_mul_montx - call __ecp_nistz256_mul_by_2x - - movq 96+0(%rsp),%r12 - movq 96+8(%rsp),%r13 - leaq 64(%rsp),%rbx - movq 96+16(%rsp),%r8 - movq 96+24(%rsp),%r9 - leaq 32(%rsp),%rdi - call __ecp_nistz256_add_tox - - movq 96+0(%rsp),%r12 - movq 96+8(%rsp),%r13 - leaq 64(%rsp),%rbx - movq 96+16(%rsp),%r8 - movq 96+24(%rsp),%r9 - leaq 64(%rsp),%rdi - call __ecp_nistz256_sub_fromx - - movq 0+0(%rsp),%rdx - movq 8+0(%rsp),%r14 - leaq -128+0(%rsp),%rsi - movq 16+0(%rsp),%r15 - movq 24+0(%rsp),%r8 -.byte 102,72,15,126,207 - call __ecp_nistz256_sqr_montx - xorq %r9,%r9 - movq %r12,%rax - addq $-1,%r12 - movq %r13,%r10 - adcq %rsi,%r13 - movq %r14,%rcx - adcq $0,%r14 - movq %r15,%r8 - adcq %rbp,%r15 - adcq $0,%r9 - xorq %rsi,%rsi - testq $1,%rax - - cmovzq %rax,%r12 - cmovzq %r10,%r13 - cmovzq %rcx,%r14 - cmovzq %r8,%r15 - cmovzq %rsi,%r9 - - movq %r13,%rax - shrq $1,%r12 - shlq $63,%rax - movq %r14,%r10 - shrq $1,%r13 - orq %rax,%r12 - shlq $63,%r10 - movq %r15,%rcx - shrq $1,%r14 - orq %r10,%r13 - shlq $63,%rcx - movq %r12,0(%rdi) - shrq $1,%r15 - movq %r13,8(%rdi) - shlq $63,%r9 - orq %rcx,%r14 - orq %r9,%r15 - movq %r14,16(%rdi) - movq %r15,24(%rdi) - movq 64(%rsp),%rdx - leaq 64(%rsp),%rbx - movq 0+32(%rsp),%r9 - movq 8+32(%rsp),%r10 - leaq -128+32(%rsp),%rsi - movq 16+32(%rsp),%r11 - movq 24+32(%rsp),%r12 - leaq 32(%rsp),%rdi - call __ecp_nistz256_mul_montx - - leaq 128(%rsp),%rdi - call __ecp_nistz256_mul_by_2x - - leaq 32(%rsp),%rbx - leaq 32(%rsp),%rdi - call __ecp_nistz256_add_tox - - movq 96(%rsp),%rdx - leaq 96(%rsp),%rbx - movq 0+0(%rsp),%r9 - movq 8+0(%rsp),%r10 - leaq -128+0(%rsp),%rsi - movq 16+0(%rsp),%r11 - movq 24+0(%rsp),%r12 - leaq 0(%rsp),%rdi - call __ecp_nistz256_mul_montx - - leaq 128(%rsp),%rdi - call __ecp_nistz256_mul_by_2x - - movq 0+32(%rsp),%rdx - movq 8+32(%rsp),%r14 - leaq -128+32(%rsp),%rsi - movq 16+32(%rsp),%r15 - movq 24+32(%rsp),%r8 -.byte 102,72,15,126,199 - call __ecp_nistz256_sqr_montx - - leaq 128(%rsp),%rbx - movq %r14,%r8 - movq %r15,%r9 - movq %rsi,%r14 - movq %rbp,%r15 - call __ecp_nistz256_sub_fromx - - movq 0+0(%rsp),%rax - movq 0+8(%rsp),%rbp - movq 0+16(%rsp),%rcx - movq 0+24(%rsp),%r10 - leaq 0(%rsp),%rdi - call __ecp_nistz256_subx - - movq 32(%rsp),%rdx - leaq 32(%rsp),%rbx - movq %r12,%r14 - xorl %ecx,%ecx - movq %r12,0+0(%rsp) - movq %r13,%r10 - movq %r13,0+8(%rsp) - cmovzq %r8,%r11 - movq %r8,0+16(%rsp) - leaq 0-128(%rsp),%rsi - cmovzq %r9,%r12 - movq %r9,0+24(%rsp) - movq %r14,%r9 - leaq 0(%rsp),%rdi - call __ecp_nistz256_mul_montx - -.byte 102,72,15,126,203 -.byte 102,72,15,126,207 - call __ecp_nistz256_sub_fromx - - addq $160+8,%rsp - popq %r15 - popq %r14 - popq %r13 - popq %r12 - popq %rbx - popq %rbp - .byte 0xf3,0xc3 - - -.p2align 5 -ecp_nistz256_point_addx: -L$point_addx: - pushq %rbp - pushq %rbx - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - subq $576+8,%rsp - - movdqu 0(%rsi),%xmm0 - movdqu 16(%rsi),%xmm1 - movdqu 32(%rsi),%xmm2 - movdqu 48(%rsi),%xmm3 - movdqu 64(%rsi),%xmm4 - movdqu 80(%rsi),%xmm5 - movq %rsi,%rbx - movq %rdx,%rsi - movdqa %xmm0,384(%rsp) - movdqa %xmm1,384+16(%rsp) - por %xmm0,%xmm1 - movdqa %xmm2,416(%rsp) - movdqa %xmm3,416+16(%rsp) - por %xmm2,%xmm3 - movdqa %xmm4,448(%rsp) - movdqa %xmm5,448+16(%rsp) - por %xmm1,%xmm3 - - movdqu 0(%rsi),%xmm0 - pshufd $177,%xmm3,%xmm5 - movdqu 16(%rsi),%xmm1 - movdqu 32(%rsi),%xmm2 - por %xmm3,%xmm5 - movdqu 48(%rsi),%xmm3 - movq 64+0(%rsi),%rdx - movq 64+8(%rsi),%r14 - movq 64+16(%rsi),%r15 - movq 64+24(%rsi),%r8 - movdqa %xmm0,480(%rsp) - pshufd $30,%xmm5,%xmm4 - movdqa %xmm1,480+16(%rsp) - por %xmm0,%xmm1 -.byte 102,72,15,110,199 - movdqa %xmm2,512(%rsp) - movdqa %xmm3,512+16(%rsp) - por %xmm2,%xmm3 - por %xmm4,%xmm5 - pxor %xmm4,%xmm4 - por %xmm1,%xmm3 - - leaq 64-128(%rsi),%rsi - movq %rdx,544+0(%rsp) - movq %r14,544+8(%rsp) - movq %r15,544+16(%rsp) - movq %r8,544+24(%rsp) - leaq 96(%rsp),%rdi - call __ecp_nistz256_sqr_montx - - pcmpeqd %xmm4,%xmm5 - pshufd $177,%xmm3,%xmm4 - por %xmm3,%xmm4 - pshufd $0,%xmm5,%xmm5 - pshufd $30,%xmm4,%xmm3 - por %xmm3,%xmm4 - pxor %xmm3,%xmm3 - pcmpeqd %xmm3,%xmm4 - pshufd $0,%xmm4,%xmm4 - movq 64+0(%rbx),%rdx - movq 64+8(%rbx),%r14 - movq 64+16(%rbx),%r15 - movq 64+24(%rbx),%r8 - - leaq 64-128(%rbx),%rsi - leaq 32(%rsp),%rdi - call __ecp_nistz256_sqr_montx - - movq 544(%rsp),%rdx - leaq 544(%rsp),%rbx - movq 0+96(%rsp),%r9 - movq 8+96(%rsp),%r10 - leaq -128+96(%rsp),%rsi - movq 16+96(%rsp),%r11 - movq 24+96(%rsp),%r12 - leaq 224(%rsp),%rdi - call __ecp_nistz256_mul_montx - - movq 448(%rsp),%rdx - leaq 448(%rsp),%rbx - movq 0+32(%rsp),%r9 - movq 8+32(%rsp),%r10 - leaq -128+32(%rsp),%rsi - movq 16+32(%rsp),%r11 - movq 24+32(%rsp),%r12 - leaq 256(%rsp),%rdi - call __ecp_nistz256_mul_montx - - movq 416(%rsp),%rdx - leaq 416(%rsp),%rbx - movq 0+224(%rsp),%r9 - movq 8+224(%rsp),%r10 - leaq -128+224(%rsp),%rsi - movq 16+224(%rsp),%r11 - movq 24+224(%rsp),%r12 - leaq 224(%rsp),%rdi - call __ecp_nistz256_mul_montx - - movq 512(%rsp),%rdx - leaq 512(%rsp),%rbx - movq 0+256(%rsp),%r9 - movq 8+256(%rsp),%r10 - leaq -128+256(%rsp),%rsi - movq 16+256(%rsp),%r11 - movq 24+256(%rsp),%r12 - leaq 256(%rsp),%rdi - call __ecp_nistz256_mul_montx - - leaq 224(%rsp),%rbx - leaq 64(%rsp),%rdi - call __ecp_nistz256_sub_fromx - - orq %r13,%r12 - movdqa %xmm4,%xmm2 - orq %r8,%r12 - orq %r9,%r12 - por %xmm5,%xmm2 -.byte 102,73,15,110,220 - - movq 384(%rsp),%rdx - leaq 384(%rsp),%rbx - movq 0+96(%rsp),%r9 - movq 8+96(%rsp),%r10 - leaq -128+96(%rsp),%rsi - movq 16+96(%rsp),%r11 - movq 24+96(%rsp),%r12 - leaq 160(%rsp),%rdi - call __ecp_nistz256_mul_montx - - movq 480(%rsp),%rdx - leaq 480(%rsp),%rbx - movq 0+32(%rsp),%r9 - movq 8+32(%rsp),%r10 - leaq -128+32(%rsp),%rsi - movq 16+32(%rsp),%r11 - movq 24+32(%rsp),%r12 - leaq 192(%rsp),%rdi - call __ecp_nistz256_mul_montx - - leaq 160(%rsp),%rbx - leaq 0(%rsp),%rdi - call __ecp_nistz256_sub_fromx - - orq %r13,%r12 - orq %r8,%r12 - orq %r9,%r12 - -.byte 0x3e - jnz L$add_proceedx -.byte 102,73,15,126,208 -.byte 102,73,15,126,217 - testq %r8,%r8 - jnz L$add_proceedx - testq %r9,%r9 - jz L$add_proceedx - -.byte 102,72,15,126,199 - pxor %xmm0,%xmm0 - movdqu %xmm0,0(%rdi) - movdqu %xmm0,16(%rdi) - movdqu %xmm0,32(%rdi) - movdqu %xmm0,48(%rdi) - movdqu %xmm0,64(%rdi) - movdqu %xmm0,80(%rdi) - jmp L$add_donex - -.p2align 5 -L$add_proceedx: - movq 0+64(%rsp),%rdx - movq 8+64(%rsp),%r14 - leaq -128+64(%rsp),%rsi - movq 16+64(%rsp),%r15 - movq 24+64(%rsp),%r8 - leaq 96(%rsp),%rdi - call __ecp_nistz256_sqr_montx - - movq 448(%rsp),%rdx - leaq 448(%rsp),%rbx - movq 0+0(%rsp),%r9 - movq 8+0(%rsp),%r10 - leaq -128+0(%rsp),%rsi - movq 16+0(%rsp),%r11 - movq 24+0(%rsp),%r12 - leaq 352(%rsp),%rdi - call __ecp_nistz256_mul_montx - - movq 0+0(%rsp),%rdx - movq 8+0(%rsp),%r14 - leaq -128+0(%rsp),%rsi - movq 16+0(%rsp),%r15 - movq 24+0(%rsp),%r8 - leaq 32(%rsp),%rdi - call __ecp_nistz256_sqr_montx - - movq 544(%rsp),%rdx - leaq 544(%rsp),%rbx - movq 0+352(%rsp),%r9 - movq 8+352(%rsp),%r10 - leaq -128+352(%rsp),%rsi - movq 16+352(%rsp),%r11 - movq 24+352(%rsp),%r12 - leaq 352(%rsp),%rdi - call __ecp_nistz256_mul_montx - - movq 0(%rsp),%rdx - leaq 0(%rsp),%rbx - movq 0+32(%rsp),%r9 - movq 8+32(%rsp),%r10 - leaq -128+32(%rsp),%rsi - movq 16+32(%rsp),%r11 - movq 24+32(%rsp),%r12 - leaq 128(%rsp),%rdi - call __ecp_nistz256_mul_montx - - movq 160(%rsp),%rdx - leaq 160(%rsp),%rbx - movq 0+32(%rsp),%r9 - movq 8+32(%rsp),%r10 - leaq -128+32(%rsp),%rsi - movq 16+32(%rsp),%r11 - movq 24+32(%rsp),%r12 - leaq 192(%rsp),%rdi - call __ecp_nistz256_mul_montx - - - - - addq %r12,%r12 - leaq 96(%rsp),%rsi - adcq %r13,%r13 - movq %r12,%rax - adcq %r8,%r8 - adcq %r9,%r9 - movq %r13,%rbp - sbbq %r11,%r11 - - subq $-1,%r12 - movq %r8,%rcx - sbbq %r14,%r13 - sbbq $0,%r8 - movq %r9,%r10 - sbbq %r15,%r9 - testq %r11,%r11 - - cmovzq %rax,%r12 - movq 0(%rsi),%rax - cmovzq %rbp,%r13 - movq 8(%rsi),%rbp - cmovzq %rcx,%r8 - movq 16(%rsi),%rcx - cmovzq %r10,%r9 - movq 24(%rsi),%r10 - - call __ecp_nistz256_subx - - leaq 128(%rsp),%rbx - leaq 288(%rsp),%rdi - call __ecp_nistz256_sub_fromx - - movq 192+0(%rsp),%rax - movq 192+8(%rsp),%rbp - movq 192+16(%rsp),%rcx - movq 192+24(%rsp),%r10 - leaq 320(%rsp),%rdi - - call __ecp_nistz256_subx - - movq %r12,0(%rdi) - movq %r13,8(%rdi) - movq %r8,16(%rdi) - movq %r9,24(%rdi) - movq 128(%rsp),%rdx - leaq 128(%rsp),%rbx - movq 0+224(%rsp),%r9 - movq 8+224(%rsp),%r10 - leaq -128+224(%rsp),%rsi - movq 16+224(%rsp),%r11 - movq 24+224(%rsp),%r12 - leaq 256(%rsp),%rdi - call __ecp_nistz256_mul_montx - - movq 320(%rsp),%rdx - leaq 320(%rsp),%rbx - movq 0+64(%rsp),%r9 - movq 8+64(%rsp),%r10 - leaq -128+64(%rsp),%rsi - movq 16+64(%rsp),%r11 - movq 24+64(%rsp),%r12 - leaq 320(%rsp),%rdi - call __ecp_nistz256_mul_montx - - leaq 256(%rsp),%rbx - leaq 320(%rsp),%rdi - call __ecp_nistz256_sub_fromx - -.byte 102,72,15,126,199 - - movdqa %xmm5,%xmm0 - movdqa %xmm5,%xmm1 - pandn 352(%rsp),%xmm0 - movdqa %xmm5,%xmm2 - pandn 352+16(%rsp),%xmm1 - movdqa %xmm5,%xmm3 - pand 544(%rsp),%xmm2 - pand 544+16(%rsp),%xmm3 - por %xmm0,%xmm2 - por %xmm1,%xmm3 - - movdqa %xmm4,%xmm0 - movdqa %xmm4,%xmm1 - pandn %xmm2,%xmm0 - movdqa %xmm4,%xmm2 - pandn %xmm3,%xmm1 - movdqa %xmm4,%xmm3 - pand 448(%rsp),%xmm2 - pand 448+16(%rsp),%xmm3 - por %xmm0,%xmm2 - por %xmm1,%xmm3 - movdqu %xmm2,64(%rdi) - movdqu %xmm3,80(%rdi) - - movdqa %xmm5,%xmm0 - movdqa %xmm5,%xmm1 - pandn 288(%rsp),%xmm0 - movdqa %xmm5,%xmm2 - pandn 288+16(%rsp),%xmm1 - movdqa %xmm5,%xmm3 - pand 480(%rsp),%xmm2 - pand 480+16(%rsp),%xmm3 - por %xmm0,%xmm2 - por %xmm1,%xmm3 - - movdqa %xmm4,%xmm0 - movdqa %xmm4,%xmm1 - pandn %xmm2,%xmm0 - movdqa %xmm4,%xmm2 - pandn %xmm3,%xmm1 - movdqa %xmm4,%xmm3 - pand 384(%rsp),%xmm2 - pand 384+16(%rsp),%xmm3 - por %xmm0,%xmm2 - por %xmm1,%xmm3 - movdqu %xmm2,0(%rdi) - movdqu %xmm3,16(%rdi) - - movdqa %xmm5,%xmm0 - movdqa %xmm5,%xmm1 - pandn 320(%rsp),%xmm0 - movdqa %xmm5,%xmm2 - pandn 320+16(%rsp),%xmm1 - movdqa %xmm5,%xmm3 - pand 512(%rsp),%xmm2 - pand 512+16(%rsp),%xmm3 - por %xmm0,%xmm2 - por %xmm1,%xmm3 - - movdqa %xmm4,%xmm0 - movdqa %xmm4,%xmm1 - pandn %xmm2,%xmm0 - movdqa %xmm4,%xmm2 - pandn %xmm3,%xmm1 - movdqa %xmm4,%xmm3 - pand 416(%rsp),%xmm2 - pand 416+16(%rsp),%xmm3 - por %xmm0,%xmm2 - por %xmm1,%xmm3 - movdqu %xmm2,32(%rdi) - movdqu %xmm3,48(%rdi) - -L$add_donex: - addq $576+8,%rsp - popq %r15 - popq %r14 - popq %r13 - popq %r12 - popq %rbx - popq %rbp - .byte 0xf3,0xc3 - - -.p2align 5 -ecp_nistz256_point_add_affinex: -L$point_add_affinex: - pushq %rbp - pushq %rbx - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - subq $480+8,%rsp - - movdqu 0(%rsi),%xmm0 - movq %rdx,%rbx - movdqu 16(%rsi),%xmm1 - movdqu 32(%rsi),%xmm2 - movdqu 48(%rsi),%xmm3 - movdqu 64(%rsi),%xmm4 - movdqu 80(%rsi),%xmm5 - movq 64+0(%rsi),%rdx - movq 64+8(%rsi),%r14 - movq 64+16(%rsi),%r15 - movq 64+24(%rsi),%r8 - movdqa %xmm0,320(%rsp) - movdqa %xmm1,320+16(%rsp) - por %xmm0,%xmm1 - movdqa %xmm2,352(%rsp) - movdqa %xmm3,352+16(%rsp) - por %xmm2,%xmm3 - movdqa %xmm4,384(%rsp) - movdqa %xmm5,384+16(%rsp) - por %xmm1,%xmm3 - - movdqu 0(%rbx),%xmm0 - pshufd $177,%xmm3,%xmm5 - movdqu 16(%rbx),%xmm1 - movdqu 32(%rbx),%xmm2 - por %xmm3,%xmm5 - movdqu 48(%rbx),%xmm3 - movdqa %xmm0,416(%rsp) - pshufd $30,%xmm5,%xmm4 - movdqa %xmm1,416+16(%rsp) - por %xmm0,%xmm1 -.byte 102,72,15,110,199 - movdqa %xmm2,448(%rsp) - movdqa %xmm3,448+16(%rsp) - por %xmm2,%xmm3 - por %xmm4,%xmm5 - pxor %xmm4,%xmm4 - por %xmm1,%xmm3 - - leaq 64-128(%rsi),%rsi - leaq 32(%rsp),%rdi - call __ecp_nistz256_sqr_montx - - pcmpeqd %xmm4,%xmm5 - pshufd $177,%xmm3,%xmm4 - movq 0(%rbx),%rdx - - movq %r12,%r9 - por %xmm3,%xmm4 - pshufd $0,%xmm5,%xmm5 - pshufd $30,%xmm4,%xmm3 - movq %r13,%r10 - por %xmm3,%xmm4 - pxor %xmm3,%xmm3 - movq %r14,%r11 - pcmpeqd %xmm3,%xmm4 - pshufd $0,%xmm4,%xmm4 - - leaq 32-128(%rsp),%rsi - movq %r15,%r12 - leaq 0(%rsp),%rdi - call __ecp_nistz256_mul_montx - - leaq 320(%rsp),%rbx - leaq 64(%rsp),%rdi - call __ecp_nistz256_sub_fromx - - movq 384(%rsp),%rdx - leaq 384(%rsp),%rbx - movq 0+32(%rsp),%r9 - movq 8+32(%rsp),%r10 - leaq -128+32(%rsp),%rsi - movq 16+32(%rsp),%r11 - movq 24+32(%rsp),%r12 - leaq 32(%rsp),%rdi - call __ecp_nistz256_mul_montx - - movq 384(%rsp),%rdx - leaq 384(%rsp),%rbx - movq 0+64(%rsp),%r9 - movq 8+64(%rsp),%r10 - leaq -128+64(%rsp),%rsi - movq 16+64(%rsp),%r11 - movq 24+64(%rsp),%r12 - leaq 288(%rsp),%rdi - call __ecp_nistz256_mul_montx - - movq 448(%rsp),%rdx - leaq 448(%rsp),%rbx - movq 0+32(%rsp),%r9 - movq 8+32(%rsp),%r10 - leaq -128+32(%rsp),%rsi - movq 16+32(%rsp),%r11 - movq 24+32(%rsp),%r12 - leaq 32(%rsp),%rdi - call __ecp_nistz256_mul_montx - - leaq 352(%rsp),%rbx - leaq 96(%rsp),%rdi - call __ecp_nistz256_sub_fromx - - movq 0+64(%rsp),%rdx - movq 8+64(%rsp),%r14 - leaq -128+64(%rsp),%rsi - movq 16+64(%rsp),%r15 - movq 24+64(%rsp),%r8 - leaq 128(%rsp),%rdi - call __ecp_nistz256_sqr_montx - - movq 0+96(%rsp),%rdx - movq 8+96(%rsp),%r14 - leaq -128+96(%rsp),%rsi - movq 16+96(%rsp),%r15 - movq 24+96(%rsp),%r8 - leaq 192(%rsp),%rdi - call __ecp_nistz256_sqr_montx - - movq 128(%rsp),%rdx - leaq 128(%rsp),%rbx - movq 0+64(%rsp),%r9 - movq 8+64(%rsp),%r10 - leaq -128+64(%rsp),%rsi - movq 16+64(%rsp),%r11 - movq 24+64(%rsp),%r12 - leaq 160(%rsp),%rdi - call __ecp_nistz256_mul_montx - - movq 320(%rsp),%rdx - leaq 320(%rsp),%rbx - movq 0+128(%rsp),%r9 - movq 8+128(%rsp),%r10 - leaq -128+128(%rsp),%rsi - movq 16+128(%rsp),%r11 - movq 24+128(%rsp),%r12 - leaq 0(%rsp),%rdi - call __ecp_nistz256_mul_montx - - - - - addq %r12,%r12 - leaq 192(%rsp),%rsi - adcq %r13,%r13 - movq %r12,%rax - adcq %r8,%r8 - adcq %r9,%r9 - movq %r13,%rbp - sbbq %r11,%r11 - - subq $-1,%r12 - movq %r8,%rcx - sbbq %r14,%r13 - sbbq $0,%r8 - movq %r9,%r10 - sbbq %r15,%r9 - testq %r11,%r11 - - cmovzq %rax,%r12 - movq 0(%rsi),%rax - cmovzq %rbp,%r13 - movq 8(%rsi),%rbp - cmovzq %rcx,%r8 - movq 16(%rsi),%rcx - cmovzq %r10,%r9 - movq 24(%rsi),%r10 - - call __ecp_nistz256_subx - - leaq 160(%rsp),%rbx - leaq 224(%rsp),%rdi - call __ecp_nistz256_sub_fromx - - movq 0+0(%rsp),%rax - movq 0+8(%rsp),%rbp - movq 0+16(%rsp),%rcx - movq 0+24(%rsp),%r10 - leaq 64(%rsp),%rdi - - call __ecp_nistz256_subx - - movq %r12,0(%rdi) - movq %r13,8(%rdi) - movq %r8,16(%rdi) - movq %r9,24(%rdi) - movq 352(%rsp),%rdx - leaq 352(%rsp),%rbx - movq 0+160(%rsp),%r9 - movq 8+160(%rsp),%r10 - leaq -128+160(%rsp),%rsi - movq 16+160(%rsp),%r11 - movq 24+160(%rsp),%r12 - leaq 32(%rsp),%rdi - call __ecp_nistz256_mul_montx - - movq 96(%rsp),%rdx - leaq 96(%rsp),%rbx - movq 0+64(%rsp),%r9 - movq 8+64(%rsp),%r10 - leaq -128+64(%rsp),%rsi - movq 16+64(%rsp),%r11 - movq 24+64(%rsp),%r12 - leaq 64(%rsp),%rdi - call __ecp_nistz256_mul_montx - - leaq 32(%rsp),%rbx - leaq 256(%rsp),%rdi - call __ecp_nistz256_sub_fromx - -.byte 102,72,15,126,199 - - movdqa %xmm5,%xmm0 - movdqa %xmm5,%xmm1 - pandn 288(%rsp),%xmm0 - movdqa %xmm5,%xmm2 - pandn 288+16(%rsp),%xmm1 - movdqa %xmm5,%xmm3 - pand L$ONE_mont(%rip),%xmm2 - pand L$ONE_mont+16(%rip),%xmm3 - por %xmm0,%xmm2 - por %xmm1,%xmm3 - - movdqa %xmm4,%xmm0 - movdqa %xmm4,%xmm1 - pandn %xmm2,%xmm0 - movdqa %xmm4,%xmm2 - pandn %xmm3,%xmm1 - movdqa %xmm4,%xmm3 - pand 384(%rsp),%xmm2 - pand 384+16(%rsp),%xmm3 - por %xmm0,%xmm2 - por %xmm1,%xmm3 - movdqu %xmm2,64(%rdi) - movdqu %xmm3,80(%rdi) - - movdqa %xmm5,%xmm0 - movdqa %xmm5,%xmm1 - pandn 224(%rsp),%xmm0 - movdqa %xmm5,%xmm2 - pandn 224+16(%rsp),%xmm1 - movdqa %xmm5,%xmm3 - pand 416(%rsp),%xmm2 - pand 416+16(%rsp),%xmm3 - por %xmm0,%xmm2 - por %xmm1,%xmm3 - - movdqa %xmm4,%xmm0 - movdqa %xmm4,%xmm1 - pandn %xmm2,%xmm0 - movdqa %xmm4,%xmm2 - pandn %xmm3,%xmm1 - movdqa %xmm4,%xmm3 - pand 320(%rsp),%xmm2 - pand 320+16(%rsp),%xmm3 - por %xmm0,%xmm2 - por %xmm1,%xmm3 - movdqu %xmm2,0(%rdi) - movdqu %xmm3,16(%rdi) - - movdqa %xmm5,%xmm0 - movdqa %xmm5,%xmm1 - pandn 256(%rsp),%xmm0 - movdqa %xmm5,%xmm2 - pandn 256+16(%rsp),%xmm1 - movdqa %xmm5,%xmm3 - pand 448(%rsp),%xmm2 - pand 448+16(%rsp),%xmm3 - por %xmm0,%xmm2 - por %xmm1,%xmm3 - - movdqa %xmm4,%xmm0 - movdqa %xmm4,%xmm1 - pandn %xmm2,%xmm0 - movdqa %xmm4,%xmm2 - pandn %xmm3,%xmm1 - movdqa %xmm4,%xmm3 - pand 352(%rsp),%xmm2 - pand 352+16(%rsp),%xmm3 - por %xmm0,%xmm2 - por %xmm1,%xmm3 - movdqu %xmm2,32(%rdi) - movdqu %xmm3,48(%rdi) - - addq $480+8,%rsp - popq %r15 - popq %r14 - popq %r13 - popq %r12 - popq %rbx - popq %rbp - .byte 0xf3,0xc3 diff --git a/deps/openssl/asm/x64-macosx-gas/modes/aesni-gcm-x86_64.s b/deps/openssl/asm/x64-macosx-gas/modes/aesni-gcm-x86_64.s index 86665d6e995628..e2bf1bb53a19be 100644 --- a/deps/openssl/asm/x64-macosx-gas/modes/aesni-gcm-x86_64.s +++ b/deps/openssl/asm/x64-macosx-gas/modes/aesni-gcm-x86_64.s @@ -1,753 +1,14 @@ .text - -.p2align 5 -_aesni_ctr32_ghash_6x: - vmovdqu 32(%r11),%xmm2 - subq $6,%rdx - vpxor %xmm4,%xmm4,%xmm4 - vmovdqu 0-128(%rcx),%xmm15 - vpaddb %xmm2,%xmm1,%xmm10 - vpaddb %xmm2,%xmm10,%xmm11 - vpaddb %xmm2,%xmm11,%xmm12 - vpaddb %xmm2,%xmm12,%xmm13 - vpaddb %xmm2,%xmm13,%xmm14 - vpxor %xmm15,%xmm1,%xmm9 - vmovdqu %xmm4,16+8(%rsp) - jmp L$oop6x - -.p2align 5 -L$oop6x: - addl $100663296,%ebx - jc L$handle_ctr32 - vmovdqu 0-32(%r9),%xmm3 - vpaddb %xmm2,%xmm14,%xmm1 - vpxor %xmm15,%xmm10,%xmm10 - vpxor %xmm15,%xmm11,%xmm11 - -L$resume_ctr32: - vmovdqu %xmm1,(%r8) - vpclmulqdq $16,%xmm3,%xmm7,%xmm5 - vpxor %xmm15,%xmm12,%xmm12 - vmovups 16-128(%rcx),%xmm2 - vpclmulqdq $1,%xmm3,%xmm7,%xmm6 - xorq %r12,%r12 - cmpq %r14,%r15 - - vaesenc %xmm2,%xmm9,%xmm9 - vmovdqu 48+8(%rsp),%xmm0 - vpxor %xmm15,%xmm13,%xmm13 - vpclmulqdq $0,%xmm3,%xmm7,%xmm1 - vaesenc %xmm2,%xmm10,%xmm10 - vpxor %xmm15,%xmm14,%xmm14 - setnc %r12b - vpclmulqdq $17,%xmm3,%xmm7,%xmm7 - vaesenc %xmm2,%xmm11,%xmm11 - vmovdqu 16-32(%r9),%xmm3 - negq %r12 - vaesenc %xmm2,%xmm12,%xmm12 - vpxor %xmm5,%xmm6,%xmm6 - vpclmulqdq $0,%xmm3,%xmm0,%xmm5 - vpxor %xmm4,%xmm8,%xmm8 - vaesenc %xmm2,%xmm13,%xmm13 - vpxor %xmm5,%xmm1,%xmm4 - andq $96,%r12 - vmovups 32-128(%rcx),%xmm15 - vpclmulqdq $16,%xmm3,%xmm0,%xmm1 - vaesenc %xmm2,%xmm14,%xmm14 - - vpclmulqdq $1,%xmm3,%xmm0,%xmm2 - leaq (%r14,%r12,1),%r14 - vaesenc %xmm15,%xmm9,%xmm9 - vpxor 16+8(%rsp),%xmm8,%xmm8 - vpclmulqdq $17,%xmm3,%xmm0,%xmm3 - vmovdqu 64+8(%rsp),%xmm0 - vaesenc %xmm15,%xmm10,%xmm10 - movbeq 88(%r14),%r13 - vaesenc %xmm15,%xmm11,%xmm11 - movbeq 80(%r14),%r12 - vaesenc %xmm15,%xmm12,%xmm12 - movq %r13,32+8(%rsp) - vaesenc %xmm15,%xmm13,%xmm13 - movq %r12,40+8(%rsp) - vmovdqu 48-32(%r9),%xmm5 - vaesenc %xmm15,%xmm14,%xmm14 - - vmovups 48-128(%rcx),%xmm15 - vpxor %xmm1,%xmm6,%xmm6 - vpclmulqdq $0,%xmm5,%xmm0,%xmm1 - vaesenc %xmm15,%xmm9,%xmm9 - vpxor %xmm2,%xmm6,%xmm6 - vpclmulqdq $16,%xmm5,%xmm0,%xmm2 - vaesenc %xmm15,%xmm10,%xmm10 - vpxor %xmm3,%xmm7,%xmm7 - vpclmulqdq $1,%xmm5,%xmm0,%xmm3 - vaesenc %xmm15,%xmm11,%xmm11 - vpclmulqdq $17,%xmm5,%xmm0,%xmm5 - vmovdqu 80+8(%rsp),%xmm0 - vaesenc %xmm15,%xmm12,%xmm12 - vaesenc %xmm15,%xmm13,%xmm13 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqu 64-32(%r9),%xmm1 - vaesenc %xmm15,%xmm14,%xmm14 - - vmovups 64-128(%rcx),%xmm15 - vpxor %xmm2,%xmm6,%xmm6 - vpclmulqdq $0,%xmm1,%xmm0,%xmm2 - vaesenc %xmm15,%xmm9,%xmm9 - vpxor %xmm3,%xmm6,%xmm6 - vpclmulqdq $16,%xmm1,%xmm0,%xmm3 - vaesenc %xmm15,%xmm10,%xmm10 - movbeq 72(%r14),%r13 - vpxor %xmm5,%xmm7,%xmm7 - vpclmulqdq $1,%xmm1,%xmm0,%xmm5 - vaesenc %xmm15,%xmm11,%xmm11 - movbeq 64(%r14),%r12 - vpclmulqdq $17,%xmm1,%xmm0,%xmm1 - vmovdqu 96+8(%rsp),%xmm0 - vaesenc %xmm15,%xmm12,%xmm12 - movq %r13,48+8(%rsp) - vaesenc %xmm15,%xmm13,%xmm13 - movq %r12,56+8(%rsp) - vpxor %xmm2,%xmm4,%xmm4 - vmovdqu 96-32(%r9),%xmm2 - vaesenc %xmm15,%xmm14,%xmm14 - - vmovups 80-128(%rcx),%xmm15 - vpxor %xmm3,%xmm6,%xmm6 - vpclmulqdq $0,%xmm2,%xmm0,%xmm3 - vaesenc %xmm15,%xmm9,%xmm9 - vpxor %xmm5,%xmm6,%xmm6 - vpclmulqdq $16,%xmm2,%xmm0,%xmm5 - vaesenc %xmm15,%xmm10,%xmm10 - movbeq 56(%r14),%r13 - vpxor %xmm1,%xmm7,%xmm7 - vpclmulqdq $1,%xmm2,%xmm0,%xmm1 - vpxor 112+8(%rsp),%xmm8,%xmm8 - vaesenc %xmm15,%xmm11,%xmm11 - movbeq 48(%r14),%r12 - vpclmulqdq $17,%xmm2,%xmm0,%xmm2 - vaesenc %xmm15,%xmm12,%xmm12 - movq %r13,64+8(%rsp) - vaesenc %xmm15,%xmm13,%xmm13 - movq %r12,72+8(%rsp) - vpxor %xmm3,%xmm4,%xmm4 - vmovdqu 112-32(%r9),%xmm3 - vaesenc %xmm15,%xmm14,%xmm14 - - vmovups 96-128(%rcx),%xmm15 - vpxor %xmm5,%xmm6,%xmm6 - vpclmulqdq $16,%xmm3,%xmm8,%xmm5 - vaesenc %xmm15,%xmm9,%xmm9 - vpxor %xmm1,%xmm6,%xmm6 - vpclmulqdq $1,%xmm3,%xmm8,%xmm1 - vaesenc %xmm15,%xmm10,%xmm10 - movbeq 40(%r14),%r13 - vpxor %xmm2,%xmm7,%xmm7 - vpclmulqdq $0,%xmm3,%xmm8,%xmm2 - vaesenc %xmm15,%xmm11,%xmm11 - movbeq 32(%r14),%r12 - vpclmulqdq $17,%xmm3,%xmm8,%xmm8 - vaesenc %xmm15,%xmm12,%xmm12 - movq %r13,80+8(%rsp) - vaesenc %xmm15,%xmm13,%xmm13 - movq %r12,88+8(%rsp) - vpxor %xmm5,%xmm6,%xmm6 - vaesenc %xmm15,%xmm14,%xmm14 - vpxor %xmm1,%xmm6,%xmm6 - - vmovups 112-128(%rcx),%xmm15 - vpslldq $8,%xmm6,%xmm5 - vpxor %xmm2,%xmm4,%xmm4 - vmovdqu 16(%r11),%xmm3 - - vaesenc %xmm15,%xmm9,%xmm9 - vpxor %xmm8,%xmm7,%xmm7 - vaesenc %xmm15,%xmm10,%xmm10 - vpxor %xmm5,%xmm4,%xmm4 - movbeq 24(%r14),%r13 - vaesenc %xmm15,%xmm11,%xmm11 - movbeq 16(%r14),%r12 - vpalignr $8,%xmm4,%xmm4,%xmm0 - vpclmulqdq $16,%xmm3,%xmm4,%xmm4 - movq %r13,96+8(%rsp) - vaesenc %xmm15,%xmm12,%xmm12 - movq %r12,104+8(%rsp) - vaesenc %xmm15,%xmm13,%xmm13 - vmovups 128-128(%rcx),%xmm1 - vaesenc %xmm15,%xmm14,%xmm14 - - vaesenc %xmm1,%xmm9,%xmm9 - vmovups 144-128(%rcx),%xmm15 - vaesenc %xmm1,%xmm10,%xmm10 - vpsrldq $8,%xmm6,%xmm6 - vaesenc %xmm1,%xmm11,%xmm11 - vpxor %xmm6,%xmm7,%xmm7 - vaesenc %xmm1,%xmm12,%xmm12 - vpxor %xmm0,%xmm4,%xmm4 - movbeq 8(%r14),%r13 - vaesenc %xmm1,%xmm13,%xmm13 - movbeq 0(%r14),%r12 - vaesenc %xmm1,%xmm14,%xmm14 - vmovups 160-128(%rcx),%xmm1 - cmpl $11,%ebp - jb L$enc_tail - - vaesenc %xmm15,%xmm9,%xmm9 - vaesenc %xmm15,%xmm10,%xmm10 - vaesenc %xmm15,%xmm11,%xmm11 - vaesenc %xmm15,%xmm12,%xmm12 - vaesenc %xmm15,%xmm13,%xmm13 - vaesenc %xmm15,%xmm14,%xmm14 - - vaesenc %xmm1,%xmm9,%xmm9 - vaesenc %xmm1,%xmm10,%xmm10 - vaesenc %xmm1,%xmm11,%xmm11 - vaesenc %xmm1,%xmm12,%xmm12 - vaesenc %xmm1,%xmm13,%xmm13 - vmovups 176-128(%rcx),%xmm15 - vaesenc %xmm1,%xmm14,%xmm14 - vmovups 192-128(%rcx),%xmm1 - je L$enc_tail - - vaesenc %xmm15,%xmm9,%xmm9 - vaesenc %xmm15,%xmm10,%xmm10 - vaesenc %xmm15,%xmm11,%xmm11 - vaesenc %xmm15,%xmm12,%xmm12 - vaesenc %xmm15,%xmm13,%xmm13 - vaesenc %xmm15,%xmm14,%xmm14 - - vaesenc %xmm1,%xmm9,%xmm9 - vaesenc %xmm1,%xmm10,%xmm10 - vaesenc %xmm1,%xmm11,%xmm11 - vaesenc %xmm1,%xmm12,%xmm12 - vaesenc %xmm1,%xmm13,%xmm13 - vmovups 208-128(%rcx),%xmm15 - vaesenc %xmm1,%xmm14,%xmm14 - vmovups 224-128(%rcx),%xmm1 - jmp L$enc_tail - -.p2align 5 -L$handle_ctr32: - vmovdqu (%r11),%xmm0 - vpshufb %xmm0,%xmm1,%xmm6 - vmovdqu 48(%r11),%xmm5 - vpaddd 64(%r11),%xmm6,%xmm10 - vpaddd %xmm5,%xmm6,%xmm11 - vmovdqu 0-32(%r9),%xmm3 - vpaddd %xmm5,%xmm10,%xmm12 - vpshufb %xmm0,%xmm10,%xmm10 - vpaddd %xmm5,%xmm11,%xmm13 - vpshufb %xmm0,%xmm11,%xmm11 - vpxor %xmm15,%xmm10,%xmm10 - vpaddd %xmm5,%xmm12,%xmm14 - vpshufb %xmm0,%xmm12,%xmm12 - vpxor %xmm15,%xmm11,%xmm11 - vpaddd %xmm5,%xmm13,%xmm1 - vpshufb %xmm0,%xmm13,%xmm13 - vpshufb %xmm0,%xmm14,%xmm14 - vpshufb %xmm0,%xmm1,%xmm1 - jmp L$resume_ctr32 - -.p2align 5 -L$enc_tail: - vaesenc %xmm15,%xmm9,%xmm9 - vmovdqu %xmm7,16+8(%rsp) - vpalignr $8,%xmm4,%xmm4,%xmm8 - vaesenc %xmm15,%xmm10,%xmm10 - vpclmulqdq $16,%xmm3,%xmm4,%xmm4 - vpxor 0(%rdi),%xmm1,%xmm2 - vaesenc %xmm15,%xmm11,%xmm11 - vpxor 16(%rdi),%xmm1,%xmm0 - vaesenc %xmm15,%xmm12,%xmm12 - vpxor 32(%rdi),%xmm1,%xmm5 - vaesenc %xmm15,%xmm13,%xmm13 - vpxor 48(%rdi),%xmm1,%xmm6 - vaesenc %xmm15,%xmm14,%xmm14 - vpxor 64(%rdi),%xmm1,%xmm7 - vpxor 80(%rdi),%xmm1,%xmm3 - vmovdqu (%r8),%xmm1 - - vaesenclast %xmm2,%xmm9,%xmm9 - vmovdqu 32(%r11),%xmm2 - vaesenclast %xmm0,%xmm10,%xmm10 - vpaddb %xmm2,%xmm1,%xmm0 - movq %r13,112+8(%rsp) - leaq 96(%rdi),%rdi - vaesenclast %xmm5,%xmm11,%xmm11 - vpaddb %xmm2,%xmm0,%xmm5 - movq %r12,120+8(%rsp) - leaq 96(%rsi),%rsi - vmovdqu 0-128(%rcx),%xmm15 - vaesenclast %xmm6,%xmm12,%xmm12 - vpaddb %xmm2,%xmm5,%xmm6 - vaesenclast %xmm7,%xmm13,%xmm13 - vpaddb %xmm2,%xmm6,%xmm7 - vaesenclast %xmm3,%xmm14,%xmm14 - vpaddb %xmm2,%xmm7,%xmm3 - - addq $96,%r10 - subq $6,%rdx - jc L$6x_done - - vmovups %xmm9,-96(%rsi) - vpxor %xmm15,%xmm1,%xmm9 - vmovups %xmm10,-80(%rsi) - vmovdqa %xmm0,%xmm10 - vmovups %xmm11,-64(%rsi) - vmovdqa %xmm5,%xmm11 - vmovups %xmm12,-48(%rsi) - vmovdqa %xmm6,%xmm12 - vmovups %xmm13,-32(%rsi) - vmovdqa %xmm7,%xmm13 - vmovups %xmm14,-16(%rsi) - vmovdqa %xmm3,%xmm14 - vmovdqu 32+8(%rsp),%xmm7 - jmp L$oop6x - -L$6x_done: - vpxor 16+8(%rsp),%xmm8,%xmm8 - vpxor %xmm4,%xmm8,%xmm8 - - .byte 0xf3,0xc3 - -.globl _aesni_gcm_decrypt - -.p2align 5 -_aesni_gcm_decrypt: - xorq %r10,%r10 - cmpq $96,%rdx - jb L$gcm_dec_abort - - leaq (%rsp),%rax - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - vzeroupper - - vmovdqu (%r8),%xmm1 - addq $-128,%rsp - movl 12(%r8),%ebx - leaq L$bswap_mask(%rip),%r11 - leaq -128(%rcx),%r14 - movq $3968,%r15 - vmovdqu (%r9),%xmm8 - andq $-128,%rsp - vmovdqu (%r11),%xmm0 - leaq 128(%rcx),%rcx - leaq 32+32(%r9),%r9 - movl 240-128(%rcx),%ebp - vpshufb %xmm0,%xmm8,%xmm8 - - andq %r15,%r14 - andq %rsp,%r15 - subq %r14,%r15 - jc L$dec_no_key_aliasing - cmpq $768,%r15 - jnc L$dec_no_key_aliasing - subq %r15,%rsp -L$dec_no_key_aliasing: - - vmovdqu 80(%rdi),%xmm7 - leaq (%rdi),%r14 - vmovdqu 64(%rdi),%xmm4 - leaq -192(%rdi,%rdx,1),%r15 - vmovdqu 48(%rdi),%xmm5 - shrq $4,%rdx - xorq %r10,%r10 - vmovdqu 32(%rdi),%xmm6 - vpshufb %xmm0,%xmm7,%xmm7 - vmovdqu 16(%rdi),%xmm2 - vpshufb %xmm0,%xmm4,%xmm4 - vmovdqu (%rdi),%xmm3 - vpshufb %xmm0,%xmm5,%xmm5 - vmovdqu %xmm4,48(%rsp) - vpshufb %xmm0,%xmm6,%xmm6 - vmovdqu %xmm5,64(%rsp) - vpshufb %xmm0,%xmm2,%xmm2 - vmovdqu %xmm6,80(%rsp) - vpshufb %xmm0,%xmm3,%xmm3 - vmovdqu %xmm2,96(%rsp) - vmovdqu %xmm3,112(%rsp) - - call _aesni_ctr32_ghash_6x - - vmovups %xmm9,-96(%rsi) - vmovups %xmm10,-80(%rsi) - vmovups %xmm11,-64(%rsi) - vmovups %xmm12,-48(%rsi) - vmovups %xmm13,-32(%rsi) - vmovups %xmm14,-16(%rsi) - - vpshufb (%r11),%xmm8,%xmm8 - vmovdqu %xmm8,-64(%r9) - - vzeroupper - movq -48(%rax),%r15 - movq -40(%rax),%r14 - movq -32(%rax),%r13 - movq -24(%rax),%r12 - movq -16(%rax),%rbp - movq -8(%rax),%rbx - leaq (%rax),%rsp -L$gcm_dec_abort: - movq %r10,%rax - .byte 0xf3,0xc3 - - -.p2align 5 -_aesni_ctr32_6x: - vmovdqu 0-128(%rcx),%xmm4 - vmovdqu 32(%r11),%xmm2 - leaq -1(%rbp),%r13 - vmovups 16-128(%rcx),%xmm15 - leaq 32-128(%rcx),%r12 - vpxor %xmm4,%xmm1,%xmm9 - addl $100663296,%ebx - jc L$handle_ctr32_2 - vpaddb %xmm2,%xmm1,%xmm10 - vpaddb %xmm2,%xmm10,%xmm11 - vpxor %xmm4,%xmm10,%xmm10 - vpaddb %xmm2,%xmm11,%xmm12 - vpxor %xmm4,%xmm11,%xmm11 - vpaddb %xmm2,%xmm12,%xmm13 - vpxor %xmm4,%xmm12,%xmm12 - vpaddb %xmm2,%xmm13,%xmm14 - vpxor %xmm4,%xmm13,%xmm13 - vpaddb %xmm2,%xmm14,%xmm1 - vpxor %xmm4,%xmm14,%xmm14 - jmp L$oop_ctr32 - -.p2align 4 -L$oop_ctr32: - vaesenc %xmm15,%xmm9,%xmm9 - vaesenc %xmm15,%xmm10,%xmm10 - vaesenc %xmm15,%xmm11,%xmm11 - vaesenc %xmm15,%xmm12,%xmm12 - vaesenc %xmm15,%xmm13,%xmm13 - vaesenc %xmm15,%xmm14,%xmm14 - vmovups (%r12),%xmm15 - leaq 16(%r12),%r12 - decl %r13d - jnz L$oop_ctr32 - - vmovdqu (%r12),%xmm3 - vaesenc %xmm15,%xmm9,%xmm9 - vpxor 0(%rdi),%xmm3,%xmm4 - vaesenc %xmm15,%xmm10,%xmm10 - vpxor 16(%rdi),%xmm3,%xmm5 - vaesenc %xmm15,%xmm11,%xmm11 - vpxor 32(%rdi),%xmm3,%xmm6 - vaesenc %xmm15,%xmm12,%xmm12 - vpxor 48(%rdi),%xmm3,%xmm8 - vaesenc %xmm15,%xmm13,%xmm13 - vpxor 64(%rdi),%xmm3,%xmm2 - vaesenc %xmm15,%xmm14,%xmm14 - vpxor 80(%rdi),%xmm3,%xmm3 - leaq 96(%rdi),%rdi - - vaesenclast %xmm4,%xmm9,%xmm9 - vaesenclast %xmm5,%xmm10,%xmm10 - vaesenclast %xmm6,%xmm11,%xmm11 - vaesenclast %xmm8,%xmm12,%xmm12 - vaesenclast %xmm2,%xmm13,%xmm13 - vaesenclast %xmm3,%xmm14,%xmm14 - vmovups %xmm9,0(%rsi) - vmovups %xmm10,16(%rsi) - vmovups %xmm11,32(%rsi) - vmovups %xmm12,48(%rsi) - vmovups %xmm13,64(%rsi) - vmovups %xmm14,80(%rsi) - leaq 96(%rsi),%rsi - - .byte 0xf3,0xc3 -.p2align 5 -L$handle_ctr32_2: - vpshufb %xmm0,%xmm1,%xmm6 - vmovdqu 48(%r11),%xmm5 - vpaddd 64(%r11),%xmm6,%xmm10 - vpaddd %xmm5,%xmm6,%xmm11 - vpaddd %xmm5,%xmm10,%xmm12 - vpshufb %xmm0,%xmm10,%xmm10 - vpaddd %xmm5,%xmm11,%xmm13 - vpshufb %xmm0,%xmm11,%xmm11 - vpxor %xmm4,%xmm10,%xmm10 - vpaddd %xmm5,%xmm12,%xmm14 - vpshufb %xmm0,%xmm12,%xmm12 - vpxor %xmm4,%xmm11,%xmm11 - vpaddd %xmm5,%xmm13,%xmm1 - vpshufb %xmm0,%xmm13,%xmm13 - vpxor %xmm4,%xmm12,%xmm12 - vpshufb %xmm0,%xmm14,%xmm14 - vpxor %xmm4,%xmm13,%xmm13 - vpshufb %xmm0,%xmm1,%xmm1 - vpxor %xmm4,%xmm14,%xmm14 - jmp L$oop_ctr32 - - .globl _aesni_gcm_encrypt -.p2align 5 _aesni_gcm_encrypt: - xorq %r10,%r10 - cmpq $288,%rdx - jb L$gcm_enc_abort - - leaq (%rsp),%rax - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - vzeroupper - - vmovdqu (%r8),%xmm1 - addq $-128,%rsp - movl 12(%r8),%ebx - leaq L$bswap_mask(%rip),%r11 - leaq -128(%rcx),%r14 - movq $3968,%r15 - leaq 128(%rcx),%rcx - vmovdqu (%r11),%xmm0 - andq $-128,%rsp - movl 240-128(%rcx),%ebp - - andq %r15,%r14 - andq %rsp,%r15 - subq %r14,%r15 - jc L$enc_no_key_aliasing - cmpq $768,%r15 - jnc L$enc_no_key_aliasing - subq %r15,%rsp -L$enc_no_key_aliasing: - - leaq (%rsi),%r14 - leaq -192(%rsi,%rdx,1),%r15 - shrq $4,%rdx - - call _aesni_ctr32_6x - vpshufb %xmm0,%xmm9,%xmm8 - vpshufb %xmm0,%xmm10,%xmm2 - vmovdqu %xmm8,112(%rsp) - vpshufb %xmm0,%xmm11,%xmm4 - vmovdqu %xmm2,96(%rsp) - vpshufb %xmm0,%xmm12,%xmm5 - vmovdqu %xmm4,80(%rsp) - vpshufb %xmm0,%xmm13,%xmm6 - vmovdqu %xmm5,64(%rsp) - vpshufb %xmm0,%xmm14,%xmm7 - vmovdqu %xmm6,48(%rsp) - - call _aesni_ctr32_6x - - vmovdqu (%r9),%xmm8 - leaq 32+32(%r9),%r9 - subq $12,%rdx - movq $192,%r10 - vpshufb %xmm0,%xmm8,%xmm8 - - call _aesni_ctr32_ghash_6x - vmovdqu 32(%rsp),%xmm7 - vmovdqu (%r11),%xmm0 - vmovdqu 0-32(%r9),%xmm3 - vpunpckhqdq %xmm7,%xmm7,%xmm1 - vmovdqu 32-32(%r9),%xmm15 - vmovups %xmm9,-96(%rsi) - vpshufb %xmm0,%xmm9,%xmm9 - vpxor %xmm7,%xmm1,%xmm1 - vmovups %xmm10,-80(%rsi) - vpshufb %xmm0,%xmm10,%xmm10 - vmovups %xmm11,-64(%rsi) - vpshufb %xmm0,%xmm11,%xmm11 - vmovups %xmm12,-48(%rsi) - vpshufb %xmm0,%xmm12,%xmm12 - vmovups %xmm13,-32(%rsi) - vpshufb %xmm0,%xmm13,%xmm13 - vmovups %xmm14,-16(%rsi) - vpshufb %xmm0,%xmm14,%xmm14 - vmovdqu %xmm9,16(%rsp) - vmovdqu 48(%rsp),%xmm6 - vmovdqu 16-32(%r9),%xmm0 - vpunpckhqdq %xmm6,%xmm6,%xmm2 - vpclmulqdq $0,%xmm3,%xmm7,%xmm5 - vpxor %xmm6,%xmm2,%xmm2 - vpclmulqdq $17,%xmm3,%xmm7,%xmm7 - vpclmulqdq $0,%xmm15,%xmm1,%xmm1 - - vmovdqu 64(%rsp),%xmm9 - vpclmulqdq $0,%xmm0,%xmm6,%xmm4 - vmovdqu 48-32(%r9),%xmm3 - vpxor %xmm5,%xmm4,%xmm4 - vpunpckhqdq %xmm9,%xmm9,%xmm5 - vpclmulqdq $17,%xmm0,%xmm6,%xmm6 - vpxor %xmm9,%xmm5,%xmm5 - vpxor %xmm7,%xmm6,%xmm6 - vpclmulqdq $16,%xmm15,%xmm2,%xmm2 - vmovdqu 80-32(%r9),%xmm15 - vpxor %xmm1,%xmm2,%xmm2 - - vmovdqu 80(%rsp),%xmm1 - vpclmulqdq $0,%xmm3,%xmm9,%xmm7 - vmovdqu 64-32(%r9),%xmm0 - vpxor %xmm4,%xmm7,%xmm7 - vpunpckhqdq %xmm1,%xmm1,%xmm4 - vpclmulqdq $17,%xmm3,%xmm9,%xmm9 - vpxor %xmm1,%xmm4,%xmm4 - vpxor %xmm6,%xmm9,%xmm9 - vpclmulqdq $0,%xmm15,%xmm5,%xmm5 - vpxor %xmm2,%xmm5,%xmm5 - - vmovdqu 96(%rsp),%xmm2 - vpclmulqdq $0,%xmm0,%xmm1,%xmm6 - vmovdqu 96-32(%r9),%xmm3 - vpxor %xmm7,%xmm6,%xmm6 - vpunpckhqdq %xmm2,%xmm2,%xmm7 - vpclmulqdq $17,%xmm0,%xmm1,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpxor %xmm9,%xmm1,%xmm1 - vpclmulqdq $16,%xmm15,%xmm4,%xmm4 - vmovdqu 128-32(%r9),%xmm15 - vpxor %xmm5,%xmm4,%xmm4 - - vpxor 112(%rsp),%xmm8,%xmm8 - vpclmulqdq $0,%xmm3,%xmm2,%xmm5 - vmovdqu 112-32(%r9),%xmm0 - vpunpckhqdq %xmm8,%xmm8,%xmm9 - vpxor %xmm6,%xmm5,%xmm5 - vpclmulqdq $17,%xmm3,%xmm2,%xmm2 - vpxor %xmm8,%xmm9,%xmm9 - vpxor %xmm1,%xmm2,%xmm2 - vpclmulqdq $0,%xmm15,%xmm7,%xmm7 - vpxor %xmm4,%xmm7,%xmm4 - - vpclmulqdq $0,%xmm0,%xmm8,%xmm6 - vmovdqu 0-32(%r9),%xmm3 - vpunpckhqdq %xmm14,%xmm14,%xmm1 - vpclmulqdq $17,%xmm0,%xmm8,%xmm8 - vpxor %xmm14,%xmm1,%xmm1 - vpxor %xmm5,%xmm6,%xmm5 - vpclmulqdq $16,%xmm15,%xmm9,%xmm9 - vmovdqu 32-32(%r9),%xmm15 - vpxor %xmm2,%xmm8,%xmm7 - vpxor %xmm4,%xmm9,%xmm6 - - vmovdqu 16-32(%r9),%xmm0 - vpxor %xmm5,%xmm7,%xmm9 - vpclmulqdq $0,%xmm3,%xmm14,%xmm4 - vpxor %xmm9,%xmm6,%xmm6 - vpunpckhqdq %xmm13,%xmm13,%xmm2 - vpclmulqdq $17,%xmm3,%xmm14,%xmm14 - vpxor %xmm13,%xmm2,%xmm2 - vpslldq $8,%xmm6,%xmm9 - vpclmulqdq $0,%xmm15,%xmm1,%xmm1 - vpxor %xmm9,%xmm5,%xmm8 - vpsrldq $8,%xmm6,%xmm6 - vpxor %xmm6,%xmm7,%xmm7 - - vpclmulqdq $0,%xmm0,%xmm13,%xmm5 - vmovdqu 48-32(%r9),%xmm3 - vpxor %xmm4,%xmm5,%xmm5 - vpunpckhqdq %xmm12,%xmm12,%xmm9 - vpclmulqdq $17,%xmm0,%xmm13,%xmm13 - vpxor %xmm12,%xmm9,%xmm9 - vpxor %xmm14,%xmm13,%xmm13 - vpalignr $8,%xmm8,%xmm8,%xmm14 - vpclmulqdq $16,%xmm15,%xmm2,%xmm2 - vmovdqu 80-32(%r9),%xmm15 - vpxor %xmm1,%xmm2,%xmm2 - - vpclmulqdq $0,%xmm3,%xmm12,%xmm4 - vmovdqu 64-32(%r9),%xmm0 - vpxor %xmm5,%xmm4,%xmm4 - vpunpckhqdq %xmm11,%xmm11,%xmm1 - vpclmulqdq $17,%xmm3,%xmm12,%xmm12 - vpxor %xmm11,%xmm1,%xmm1 - vpxor %xmm13,%xmm12,%xmm12 - vxorps 16(%rsp),%xmm7,%xmm7 - vpclmulqdq $0,%xmm15,%xmm9,%xmm9 - vpxor %xmm2,%xmm9,%xmm9 - - vpclmulqdq $16,16(%r11),%xmm8,%xmm8 - vxorps %xmm14,%xmm8,%xmm8 - - vpclmulqdq $0,%xmm0,%xmm11,%xmm5 - vmovdqu 96-32(%r9),%xmm3 - vpxor %xmm4,%xmm5,%xmm5 - vpunpckhqdq %xmm10,%xmm10,%xmm2 - vpclmulqdq $17,%xmm0,%xmm11,%xmm11 - vpxor %xmm10,%xmm2,%xmm2 - vpalignr $8,%xmm8,%xmm8,%xmm14 - vpxor %xmm12,%xmm11,%xmm11 - vpclmulqdq $16,%xmm15,%xmm1,%xmm1 - vmovdqu 128-32(%r9),%xmm15 - vpxor %xmm9,%xmm1,%xmm1 - - vxorps %xmm7,%xmm14,%xmm14 - vpclmulqdq $16,16(%r11),%xmm8,%xmm8 - vxorps %xmm14,%xmm8,%xmm8 - - vpclmulqdq $0,%xmm3,%xmm10,%xmm4 - vmovdqu 112-32(%r9),%xmm0 - vpxor %xmm5,%xmm4,%xmm4 - vpunpckhqdq %xmm8,%xmm8,%xmm9 - vpclmulqdq $17,%xmm3,%xmm10,%xmm10 - vpxor %xmm8,%xmm9,%xmm9 - vpxor %xmm11,%xmm10,%xmm10 - vpclmulqdq $0,%xmm15,%xmm2,%xmm2 - vpxor %xmm1,%xmm2,%xmm2 - - vpclmulqdq $0,%xmm0,%xmm8,%xmm5 - vpclmulqdq $17,%xmm0,%xmm8,%xmm7 - vpxor %xmm4,%xmm5,%xmm5 - vpclmulqdq $16,%xmm15,%xmm9,%xmm6 - vpxor %xmm10,%xmm7,%xmm7 - vpxor %xmm2,%xmm6,%xmm6 - - vpxor %xmm5,%xmm7,%xmm4 - vpxor %xmm4,%xmm6,%xmm6 - vpslldq $8,%xmm6,%xmm1 - vmovdqu 16(%r11),%xmm3 - vpsrldq $8,%xmm6,%xmm6 - vpxor %xmm1,%xmm5,%xmm8 - vpxor %xmm6,%xmm7,%xmm7 + xorl %eax,%eax + .byte 0xf3,0xc3 - vpalignr $8,%xmm8,%xmm8,%xmm2 - vpclmulqdq $16,%xmm3,%xmm8,%xmm8 - vpxor %xmm2,%xmm8,%xmm8 - vpalignr $8,%xmm8,%xmm8,%xmm2 - vpclmulqdq $16,%xmm3,%xmm8,%xmm8 - vpxor %xmm7,%xmm2,%xmm2 - vpxor %xmm2,%xmm8,%xmm8 - vpshufb (%r11),%xmm8,%xmm8 - vmovdqu %xmm8,-64(%r9) +.globl _aesni_gcm_decrypt - vzeroupper - movq -48(%rax),%r15 - movq -40(%rax),%r14 - movq -32(%rax),%r13 - movq -24(%rax),%r12 - movq -16(%rax),%rbp - movq -8(%rax),%rbx - leaq (%rax),%rsp -L$gcm_enc_abort: - movq %r10,%rax +_aesni_gcm_decrypt: + xorl %eax,%eax .byte 0xf3,0xc3 - -.p2align 6 -L$bswap_mask: -.byte 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 -L$poly: -.byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xc2 -L$one_msb: -.byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 -L$two_lsb: -.byte 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -L$one_lsb: -.byte 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -.byte 65,69,83,45,78,73,32,71,67,77,32,109,111,100,117,108,101,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 -.p2align 6 diff --git a/deps/openssl/asm/x64-macosx-gas/modes/ghash-x86_64.s b/deps/openssl/asm/x64-macosx-gas/modes/ghash-x86_64.s index 09ac73bc97a349..77fddf934af3dc 100644 --- a/deps/openssl/asm/x64-macosx-gas/modes/ghash-x86_64.s +++ b/deps/openssl/asm/x64-macosx-gas/modes/ghash-x86_64.s @@ -20,14 +20,14 @@ L$gmult_prologue: movq $14,%rcx movq 8(%rsi,%rax,1),%r8 movq (%rsi,%rax,1),%r9 - andb $240,%bl + andb $0xf0,%bl movq %r8,%rdx jmp L$oop1 .p2align 4 L$oop1: shrq $4,%r8 - andq $15,%rdx + andq $0xf,%rdx movq %r9,%r10 movb (%rdi,%rcx,1),%al shrq $4,%r9 @@ -43,13 +43,13 @@ L$oop1: js L$break1 shrq $4,%r8 - andq $15,%rdx + andq $0xf,%rdx movq %r9,%r10 shrq $4,%r9 xorq 8(%rsi,%rax,1),%r8 shlq $60,%r10 xorq (%rsi,%rax,1),%r9 - andb $240,%bl + andb $0xf0,%bl xorq (%r11,%rdx,8),%r9 movq %r8,%rdx xorq %r10,%r8 @@ -58,19 +58,19 @@ L$oop1: .p2align 4 L$break1: shrq $4,%r8 - andq $15,%rdx + andq $0xf,%rdx movq %r9,%r10 shrq $4,%r9 xorq 8(%rsi,%rax,1),%r8 shlq $60,%r10 xorq (%rsi,%rax,1),%r9 - andb $240,%bl + andb $0xf0,%bl xorq (%r11,%rdx,8),%r9 movq %r8,%rdx xorq %r10,%r8 shrq $4,%r8 - andq $15,%rdx + andq $0xf,%rdx movq %r9,%r10 shrq $4,%r9 xorq 8(%rsi,%rbx,1),%r8 @@ -661,10 +661,10 @@ L$ghash_epilogue: _gcm_init_clmul: L$_init_clmul: movdqu (%rsi),%xmm2 - pshufd $78,%xmm2,%xmm2 + pshufd $0b01001110,%xmm2,%xmm2 - pshufd $255,%xmm2,%xmm4 + pshufd $0b11111111,%xmm2,%xmm4 movdqa %xmm2,%xmm3 psllq $1,%xmm2 pxor %xmm5,%xmm5 @@ -678,11 +678,11 @@ L$_init_clmul: pxor %xmm5,%xmm2 - pshufd $78,%xmm2,%xmm6 + pshufd $0b01001110,%xmm2,%xmm6 movdqa %xmm2,%xmm0 pxor %xmm2,%xmm6 movdqa %xmm0,%xmm1 - pshufd $78,%xmm0,%xmm3 + pshufd $0b01001110,%xmm0,%xmm3 pxor %xmm0,%xmm3 .byte 102,15,58,68,194,0 .byte 102,15,58,68,202,17 @@ -718,8 +718,8 @@ L$_init_clmul: pxor %xmm4,%xmm0 psrlq $1,%xmm0 pxor %xmm1,%xmm0 - pshufd $78,%xmm2,%xmm3 - pshufd $78,%xmm0,%xmm4 + pshufd $0b01001110,%xmm2,%xmm3 + pshufd $0b01001110,%xmm0,%xmm4 pxor %xmm2,%xmm3 movdqu %xmm2,0(%rdi) pxor %xmm0,%xmm4 @@ -727,7 +727,7 @@ L$_init_clmul: .byte 102,15,58,15,227,8 movdqu %xmm4,32(%rdi) movdqa %xmm0,%xmm1 - pshufd $78,%xmm0,%xmm3 + pshufd $0b01001110,%xmm0,%xmm3 pxor %xmm0,%xmm3 .byte 102,15,58,68,194,0 .byte 102,15,58,68,202,17 @@ -765,7 +765,7 @@ L$_init_clmul: pxor %xmm1,%xmm0 movdqa %xmm0,%xmm5 movdqa %xmm0,%xmm1 - pshufd $78,%xmm0,%xmm3 + pshufd $0b01001110,%xmm0,%xmm3 pxor %xmm0,%xmm3 .byte 102,15,58,68,194,0 .byte 102,15,58,68,202,17 @@ -801,8 +801,8 @@ L$_init_clmul: pxor %xmm4,%xmm0 psrlq $1,%xmm0 pxor %xmm1,%xmm0 - pshufd $78,%xmm5,%xmm3 - pshufd $78,%xmm0,%xmm4 + pshufd $0b01001110,%xmm5,%xmm3 + pshufd $0b01001110,%xmm0,%xmm4 pxor %xmm5,%xmm3 movdqu %xmm5,48(%rdi) pxor %xmm0,%xmm4 @@ -822,7 +822,7 @@ L$_gmult_clmul: movdqu 32(%rsi),%xmm4 .byte 102,15,56,0,197 movdqa %xmm0,%xmm1 - pshufd $78,%xmm0,%xmm3 + pshufd $0b01001110,%xmm0,%xmm3 pxor %xmm0,%xmm3 .byte 102,15,58,68,194,0 .byte 102,15,58,68,202,17 @@ -874,20 +874,20 @@ L$_ghash_clmul: movdqu 32(%rsi),%xmm7 .byte 102,65,15,56,0,194 - subq $16,%rcx + subq $0x10,%rcx jz L$odd_tail movdqu 16(%rsi),%xmm6 movl _OPENSSL_ia32cap_P+4(%rip),%eax - cmpq $48,%rcx + cmpq $0x30,%rcx jb L$skip4x andl $71303168,%eax cmpl $4194304,%eax je L$skip4x - subq $48,%rcx - movq $11547335547999543296,%rax + subq $0x30,%rcx + movq $0xA040608020C0E000,%rax movdqu 48(%rsi),%xmm14 movdqu 64(%rsi),%xmm15 @@ -899,14 +899,14 @@ L$_ghash_clmul: .byte 102,65,15,56,0,218 .byte 102,69,15,56,0,218 movdqa %xmm3,%xmm5 - pshufd $78,%xmm3,%xmm4 + pshufd $0b01001110,%xmm3,%xmm4 pxor %xmm3,%xmm4 .byte 102,15,58,68,218,0 .byte 102,15,58,68,234,17 .byte 102,15,58,68,231,0 movdqa %xmm11,%xmm13 - pshufd $78,%xmm11,%xmm12 + pshufd $0b01001110,%xmm11,%xmm12 pxor %xmm11,%xmm12 .byte 102,68,15,58,68,222,0 .byte 102,68,15,58,68,238,17 @@ -921,12 +921,12 @@ L$_ghash_clmul: .byte 102,69,15,56,0,218 .byte 102,69,15,56,0,194 movdqa %xmm11,%xmm13 - pshufd $78,%xmm11,%xmm12 + pshufd $0b01001110,%xmm11,%xmm12 pxor %xmm8,%xmm0 pxor %xmm11,%xmm12 .byte 102,69,15,58,68,222,0 movdqa %xmm0,%xmm1 - pshufd $78,%xmm0,%xmm8 + pshufd $0b01001110,%xmm0,%xmm8 pxor %xmm0,%xmm8 .byte 102,69,15,58,68,238,17 .byte 102,68,15,58,68,231,0 @@ -934,7 +934,7 @@ L$_ghash_clmul: xorps %xmm13,%xmm5 leaq 64(%rdx),%rdx - subq $64,%rcx + subq $0x40,%rcx jc L$tail4x jmp L$mod4_loop @@ -949,14 +949,14 @@ L$mod4_loop: movdqu 32(%rdx),%xmm3 movdqa %xmm11,%xmm13 .byte 102,68,15,58,68,199,16 - pshufd $78,%xmm11,%xmm12 + pshufd $0b01001110,%xmm11,%xmm12 xorps %xmm5,%xmm1 pxor %xmm11,%xmm12 .byte 102,65,15,56,0,218 movups 32(%rsi),%xmm7 xorps %xmm4,%xmm8 .byte 102,68,15,58,68,218,0 - pshufd $78,%xmm3,%xmm4 + pshufd $0b01001110,%xmm3,%xmm4 pxor %xmm0,%xmm8 movdqa %xmm3,%xmm5 @@ -1000,7 +1000,7 @@ L$mod4_loop: movdqa %xmm11,%xmm13 pxor %xmm12,%xmm4 - pshufd $78,%xmm11,%xmm12 + pshufd $0b01001110,%xmm11,%xmm12 pxor %xmm9,%xmm0 pxor %xmm8,%xmm1 pxor %xmm11,%xmm12 @@ -1010,14 +1010,14 @@ L$mod4_loop: movdqa %xmm0,%xmm1 .byte 102,69,15,58,68,238,17 xorps %xmm11,%xmm3 - pshufd $78,%xmm0,%xmm8 + pshufd $0b01001110,%xmm0,%xmm8 pxor %xmm0,%xmm8 .byte 102,68,15,58,68,231,0 xorps %xmm13,%xmm5 leaq 64(%rdx),%rdx - subq $64,%rcx + subq $0x40,%rcx jnc L$mod4_loop L$tail4x: @@ -1061,10 +1061,10 @@ L$tail4x: pxor %xmm4,%xmm0 psrlq $1,%xmm0 pxor %xmm1,%xmm0 - addq $64,%rcx + addq $0x40,%rcx jz L$done movdqu 32(%rsi),%xmm7 - subq $16,%rcx + subq $0x10,%rcx jz L$odd_tail L$skip4x: @@ -1079,7 +1079,7 @@ L$skip4x: pxor %xmm8,%xmm0 movdqa %xmm3,%xmm5 - pshufd $78,%xmm3,%xmm4 + pshufd $0b01001110,%xmm3,%xmm4 pxor %xmm3,%xmm4 .byte 102,15,58,68,218,0 .byte 102,15,58,68,234,17 @@ -1087,7 +1087,7 @@ L$skip4x: leaq 32(%rdx),%rdx nop - subq $32,%rcx + subq $0x20,%rcx jbe L$even_tail nop jmp L$mod_loop @@ -1096,7 +1096,7 @@ L$skip4x: L$mod_loop: movdqa %xmm0,%xmm1 movdqa %xmm4,%xmm8 - pshufd $78,%xmm0,%xmm4 + pshufd $0b01001110,%xmm0,%xmm4 pxor %xmm0,%xmm4 .byte 102,15,58,68,198,0 @@ -1134,7 +1134,7 @@ L$mod_loop: pslldq $8,%xmm0 psrldq $8,%xmm8 pxor %xmm9,%xmm0 - pshufd $78,%xmm5,%xmm4 + pshufd $0b01001110,%xmm5,%xmm4 pxor %xmm8,%xmm1 pxor %xmm5,%xmm4 @@ -1150,13 +1150,13 @@ L$mod_loop: .byte 102,15,58,68,231,0 pxor %xmm1,%xmm0 - subq $32,%rcx + subq $0x20,%rcx ja L$mod_loop L$even_tail: movdqa %xmm0,%xmm1 movdqa %xmm4,%xmm8 - pshufd $78,%xmm0,%xmm4 + pshufd $0b01001110,%xmm0,%xmm4 pxor %xmm0,%xmm4 .byte 102,15,58,68,198,0 @@ -1204,7 +1204,7 @@ L$odd_tail: .byte 102,69,15,56,0,194 pxor %xmm8,%xmm0 movdqa %xmm0,%xmm1 - pshufd $78,%xmm0,%xmm3 + pshufd $0b01001110,%xmm0,%xmm3 pxor %xmm0,%xmm3 .byte 102,15,58,68,194,0 .byte 102,15,58,68,202,17 @@ -1249,108 +1249,7 @@ L$done: .p2align 5 _gcm_init_avx: - vzeroupper - - vmovdqu (%rsi),%xmm2 - vpshufd $78,%xmm2,%xmm2 - - - vpshufd $255,%xmm2,%xmm4 - vpsrlq $63,%xmm2,%xmm3 - vpsllq $1,%xmm2,%xmm2 - vpxor %xmm5,%xmm5,%xmm5 - vpcmpgtd %xmm4,%xmm5,%xmm5 - vpslldq $8,%xmm3,%xmm3 - vpor %xmm3,%xmm2,%xmm2 - - - vpand L$0x1c2_polynomial(%rip),%xmm5,%xmm5 - vpxor %xmm5,%xmm2,%xmm2 - - vpunpckhqdq %xmm2,%xmm2,%xmm6 - vmovdqa %xmm2,%xmm0 - vpxor %xmm2,%xmm6,%xmm6 - movq $4,%r10 - jmp L$init_start_avx -.p2align 5 -L$init_loop_avx: - vpalignr $8,%xmm3,%xmm4,%xmm5 - vmovdqu %xmm5,-16(%rdi) - vpunpckhqdq %xmm0,%xmm0,%xmm3 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $17,%xmm2,%xmm0,%xmm1 - vpclmulqdq $0,%xmm2,%xmm0,%xmm0 - vpclmulqdq $0,%xmm6,%xmm3,%xmm3 - vpxor %xmm0,%xmm1,%xmm4 - vpxor %xmm4,%xmm3,%xmm3 - - vpslldq $8,%xmm3,%xmm4 - vpsrldq $8,%xmm3,%xmm3 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm3,%xmm1,%xmm1 - vpsllq $57,%xmm0,%xmm3 - vpsllq $62,%xmm0,%xmm4 - vpxor %xmm3,%xmm4,%xmm4 - vpsllq $63,%xmm0,%xmm3 - vpxor %xmm3,%xmm4,%xmm4 - vpslldq $8,%xmm4,%xmm3 - vpsrldq $8,%xmm4,%xmm4 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm4,%xmm1,%xmm1 - - vpsrlq $1,%xmm0,%xmm4 - vpxor %xmm0,%xmm1,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpsrlq $5,%xmm4,%xmm4 - vpxor %xmm4,%xmm0,%xmm0 - vpsrlq $1,%xmm0,%xmm0 - vpxor %xmm1,%xmm0,%xmm0 -L$init_start_avx: - vmovdqa %xmm0,%xmm5 - vpunpckhqdq %xmm0,%xmm0,%xmm3 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $17,%xmm2,%xmm0,%xmm1 - vpclmulqdq $0,%xmm2,%xmm0,%xmm0 - vpclmulqdq $0,%xmm6,%xmm3,%xmm3 - vpxor %xmm0,%xmm1,%xmm4 - vpxor %xmm4,%xmm3,%xmm3 - - vpslldq $8,%xmm3,%xmm4 - vpsrldq $8,%xmm3,%xmm3 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm3,%xmm1,%xmm1 - vpsllq $57,%xmm0,%xmm3 - vpsllq $62,%xmm0,%xmm4 - vpxor %xmm3,%xmm4,%xmm4 - vpsllq $63,%xmm0,%xmm3 - vpxor %xmm3,%xmm4,%xmm4 - vpslldq $8,%xmm4,%xmm3 - vpsrldq $8,%xmm4,%xmm4 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm4,%xmm1,%xmm1 - - vpsrlq $1,%xmm0,%xmm4 - vpxor %xmm0,%xmm1,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpsrlq $5,%xmm4,%xmm4 - vpxor %xmm4,%xmm0,%xmm0 - vpsrlq $1,%xmm0,%xmm0 - vpxor %xmm1,%xmm0,%xmm0 - vpshufd $78,%xmm5,%xmm3 - vpshufd $78,%xmm0,%xmm4 - vpxor %xmm5,%xmm3,%xmm3 - vmovdqu %xmm5,0(%rdi) - vpxor %xmm0,%xmm4,%xmm4 - vmovdqu %xmm0,16(%rdi) - leaq 48(%rdi),%rdi - subq $1,%r10 - jnz L$init_loop_avx - - vpalignr $8,%xmm4,%xmm3,%xmm5 - vmovdqu %xmm5,-16(%rdi) - - vzeroupper - .byte 0xf3,0xc3 + jmp L$_init_clmul .globl _gcm_gmult_avx @@ -1362,377 +1261,7 @@ _gcm_gmult_avx: .p2align 5 _gcm_ghash_avx: - vzeroupper - - vmovdqu (%rdi),%xmm10 - leaq L$0x1c2_polynomial(%rip),%r10 - leaq 64(%rsi),%rsi - vmovdqu L$bswap_mask(%rip),%xmm13 - vpshufb %xmm13,%xmm10,%xmm10 - cmpq $128,%rcx - jb L$short_avx - subq $128,%rcx - - vmovdqu 112(%rdx),%xmm14 - vmovdqu 0-64(%rsi),%xmm6 - vpshufb %xmm13,%xmm14,%xmm14 - vmovdqu 32-64(%rsi),%xmm7 - - vpunpckhqdq %xmm14,%xmm14,%xmm9 - vmovdqu 96(%rdx),%xmm15 - vpclmulqdq $0,%xmm6,%xmm14,%xmm0 - vpxor %xmm14,%xmm9,%xmm9 - vpshufb %xmm13,%xmm15,%xmm15 - vpclmulqdq $17,%xmm6,%xmm14,%xmm1 - vmovdqu 16-64(%rsi),%xmm6 - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vmovdqu 80(%rdx),%xmm14 - vpclmulqdq $0,%xmm7,%xmm9,%xmm2 - vpxor %xmm15,%xmm8,%xmm8 - - vpshufb %xmm13,%xmm14,%xmm14 - vpclmulqdq $0,%xmm6,%xmm15,%xmm3 - vpunpckhqdq %xmm14,%xmm14,%xmm9 - vpclmulqdq $17,%xmm6,%xmm15,%xmm4 - vmovdqu 48-64(%rsi),%xmm6 - vpxor %xmm14,%xmm9,%xmm9 - vmovdqu 64(%rdx),%xmm15 - vpclmulqdq $16,%xmm7,%xmm8,%xmm5 - vmovdqu 80-64(%rsi),%xmm7 - - vpshufb %xmm13,%xmm15,%xmm15 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $0,%xmm6,%xmm14,%xmm0 - vpxor %xmm1,%xmm4,%xmm4 - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vpclmulqdq $17,%xmm6,%xmm14,%xmm1 - vmovdqu 64-64(%rsi),%xmm6 - vpxor %xmm2,%xmm5,%xmm5 - vpclmulqdq $0,%xmm7,%xmm9,%xmm2 - vpxor %xmm15,%xmm8,%xmm8 - - vmovdqu 48(%rdx),%xmm14 - vpxor %xmm3,%xmm0,%xmm0 - vpclmulqdq $0,%xmm6,%xmm15,%xmm3 - vpxor %xmm4,%xmm1,%xmm1 - vpshufb %xmm13,%xmm14,%xmm14 - vpclmulqdq $17,%xmm6,%xmm15,%xmm4 - vmovdqu 96-64(%rsi),%xmm6 - vpxor %xmm5,%xmm2,%xmm2 - vpunpckhqdq %xmm14,%xmm14,%xmm9 - vpclmulqdq $16,%xmm7,%xmm8,%xmm5 - vmovdqu 128-64(%rsi),%xmm7 - vpxor %xmm14,%xmm9,%xmm9 - - vmovdqu 32(%rdx),%xmm15 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $0,%xmm6,%xmm14,%xmm0 - vpxor %xmm1,%xmm4,%xmm4 - vpshufb %xmm13,%xmm15,%xmm15 - vpclmulqdq $17,%xmm6,%xmm14,%xmm1 - vmovdqu 112-64(%rsi),%xmm6 - vpxor %xmm2,%xmm5,%xmm5 - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vpclmulqdq $0,%xmm7,%xmm9,%xmm2 - vpxor %xmm15,%xmm8,%xmm8 - - vmovdqu 16(%rdx),%xmm14 - vpxor %xmm3,%xmm0,%xmm0 - vpclmulqdq $0,%xmm6,%xmm15,%xmm3 - vpxor %xmm4,%xmm1,%xmm1 - vpshufb %xmm13,%xmm14,%xmm14 - vpclmulqdq $17,%xmm6,%xmm15,%xmm4 - vmovdqu 144-64(%rsi),%xmm6 - vpxor %xmm5,%xmm2,%xmm2 - vpunpckhqdq %xmm14,%xmm14,%xmm9 - vpclmulqdq $16,%xmm7,%xmm8,%xmm5 - vmovdqu 176-64(%rsi),%xmm7 - vpxor %xmm14,%xmm9,%xmm9 - - vmovdqu (%rdx),%xmm15 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $0,%xmm6,%xmm14,%xmm0 - vpxor %xmm1,%xmm4,%xmm4 - vpshufb %xmm13,%xmm15,%xmm15 - vpclmulqdq $17,%xmm6,%xmm14,%xmm1 - vmovdqu 160-64(%rsi),%xmm6 - vpxor %xmm2,%xmm5,%xmm5 - vpclmulqdq $16,%xmm7,%xmm9,%xmm2 - - leaq 128(%rdx),%rdx - cmpq $128,%rcx - jb L$tail_avx - - vpxor %xmm10,%xmm15,%xmm15 - subq $128,%rcx - jmp L$oop8x_avx - -.p2align 5 -L$oop8x_avx: - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vmovdqu 112(%rdx),%xmm14 - vpxor %xmm0,%xmm3,%xmm3 - vpxor %xmm15,%xmm8,%xmm8 - vpclmulqdq $0,%xmm6,%xmm15,%xmm10 - vpshufb %xmm13,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vpclmulqdq $17,%xmm6,%xmm15,%xmm11 - vmovdqu 0-64(%rsi),%xmm6 - vpunpckhqdq %xmm14,%xmm14,%xmm9 - vpxor %xmm2,%xmm5,%xmm5 - vpclmulqdq $0,%xmm7,%xmm8,%xmm12 - vmovdqu 32-64(%rsi),%xmm7 - vpxor %xmm14,%xmm9,%xmm9 - - vmovdqu 96(%rdx),%xmm15 - vpclmulqdq $0,%xmm6,%xmm14,%xmm0 - vpxor %xmm3,%xmm10,%xmm10 - vpshufb %xmm13,%xmm15,%xmm15 - vpclmulqdq $17,%xmm6,%xmm14,%xmm1 - vxorps %xmm4,%xmm11,%xmm11 - vmovdqu 16-64(%rsi),%xmm6 - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vpclmulqdq $0,%xmm7,%xmm9,%xmm2 - vpxor %xmm5,%xmm12,%xmm12 - vxorps %xmm15,%xmm8,%xmm8 - - vmovdqu 80(%rdx),%xmm14 - vpxor %xmm10,%xmm12,%xmm12 - vpclmulqdq $0,%xmm6,%xmm15,%xmm3 - vpxor %xmm11,%xmm12,%xmm12 - vpslldq $8,%xmm12,%xmm9 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $17,%xmm6,%xmm15,%xmm4 - vpsrldq $8,%xmm12,%xmm12 - vpxor %xmm9,%xmm10,%xmm10 - vmovdqu 48-64(%rsi),%xmm6 - vpshufb %xmm13,%xmm14,%xmm14 - vxorps %xmm12,%xmm11,%xmm11 - vpxor %xmm1,%xmm4,%xmm4 - vpunpckhqdq %xmm14,%xmm14,%xmm9 - vpclmulqdq $16,%xmm7,%xmm8,%xmm5 - vmovdqu 80-64(%rsi),%xmm7 - vpxor %xmm14,%xmm9,%xmm9 - vpxor %xmm2,%xmm5,%xmm5 - - vmovdqu 64(%rdx),%xmm15 - vpalignr $8,%xmm10,%xmm10,%xmm12 - vpclmulqdq $0,%xmm6,%xmm14,%xmm0 - vpshufb %xmm13,%xmm15,%xmm15 - vpxor %xmm3,%xmm0,%xmm0 - vpclmulqdq $17,%xmm6,%xmm14,%xmm1 - vmovdqu 64-64(%rsi),%xmm6 - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vpxor %xmm4,%xmm1,%xmm1 - vpclmulqdq $0,%xmm7,%xmm9,%xmm2 - vxorps %xmm15,%xmm8,%xmm8 - vpxor %xmm5,%xmm2,%xmm2 - - vmovdqu 48(%rdx),%xmm14 - vpclmulqdq $16,(%r10),%xmm10,%xmm10 - vpclmulqdq $0,%xmm6,%xmm15,%xmm3 - vpshufb %xmm13,%xmm14,%xmm14 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $17,%xmm6,%xmm15,%xmm4 - vmovdqu 96-64(%rsi),%xmm6 - vpunpckhqdq %xmm14,%xmm14,%xmm9 - vpxor %xmm1,%xmm4,%xmm4 - vpclmulqdq $16,%xmm7,%xmm8,%xmm5 - vmovdqu 128-64(%rsi),%xmm7 - vpxor %xmm14,%xmm9,%xmm9 - vpxor %xmm2,%xmm5,%xmm5 - - vmovdqu 32(%rdx),%xmm15 - vpclmulqdq $0,%xmm6,%xmm14,%xmm0 - vpshufb %xmm13,%xmm15,%xmm15 - vpxor %xmm3,%xmm0,%xmm0 - vpclmulqdq $17,%xmm6,%xmm14,%xmm1 - vmovdqu 112-64(%rsi),%xmm6 - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vpxor %xmm4,%xmm1,%xmm1 - vpclmulqdq $0,%xmm7,%xmm9,%xmm2 - vpxor %xmm15,%xmm8,%xmm8 - vpxor %xmm5,%xmm2,%xmm2 - vxorps %xmm12,%xmm10,%xmm10 - - vmovdqu 16(%rdx),%xmm14 - vpalignr $8,%xmm10,%xmm10,%xmm12 - vpclmulqdq $0,%xmm6,%xmm15,%xmm3 - vpshufb %xmm13,%xmm14,%xmm14 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $17,%xmm6,%xmm15,%xmm4 - vmovdqu 144-64(%rsi),%xmm6 - vpclmulqdq $16,(%r10),%xmm10,%xmm10 - vxorps %xmm11,%xmm12,%xmm12 - vpunpckhqdq %xmm14,%xmm14,%xmm9 - vpxor %xmm1,%xmm4,%xmm4 - vpclmulqdq $16,%xmm7,%xmm8,%xmm5 - vmovdqu 176-64(%rsi),%xmm7 - vpxor %xmm14,%xmm9,%xmm9 - vpxor %xmm2,%xmm5,%xmm5 - - vmovdqu (%rdx),%xmm15 - vpclmulqdq $0,%xmm6,%xmm14,%xmm0 - vpshufb %xmm13,%xmm15,%xmm15 - vpclmulqdq $17,%xmm6,%xmm14,%xmm1 - vmovdqu 160-64(%rsi),%xmm6 - vpxor %xmm12,%xmm15,%xmm15 - vpclmulqdq $16,%xmm7,%xmm9,%xmm2 - vpxor %xmm10,%xmm15,%xmm15 - - leaq 128(%rdx),%rdx - subq $128,%rcx - jnc L$oop8x_avx - - addq $128,%rcx - jmp L$tail_no_xor_avx - -.p2align 5 -L$short_avx: - vmovdqu -16(%rdx,%rcx,1),%xmm14 - leaq (%rdx,%rcx,1),%rdx - vmovdqu 0-64(%rsi),%xmm6 - vmovdqu 32-64(%rsi),%xmm7 - vpshufb %xmm13,%xmm14,%xmm15 - - vmovdqa %xmm0,%xmm3 - vmovdqa %xmm1,%xmm4 - vmovdqa %xmm2,%xmm5 - subq $16,%rcx - jz L$tail_avx - - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $0,%xmm6,%xmm15,%xmm0 - vpxor %xmm15,%xmm8,%xmm8 - vmovdqu -32(%rdx),%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vpclmulqdq $17,%xmm6,%xmm15,%xmm1 - vmovdqu 16-64(%rsi),%xmm6 - vpshufb %xmm13,%xmm14,%xmm15 - vpxor %xmm2,%xmm5,%xmm5 - vpclmulqdq $0,%xmm7,%xmm8,%xmm2 - vpsrldq $8,%xmm7,%xmm7 - subq $16,%rcx - jz L$tail_avx - - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $0,%xmm6,%xmm15,%xmm0 - vpxor %xmm15,%xmm8,%xmm8 - vmovdqu -48(%rdx),%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vpclmulqdq $17,%xmm6,%xmm15,%xmm1 - vmovdqu 48-64(%rsi),%xmm6 - vpshufb %xmm13,%xmm14,%xmm15 - vpxor %xmm2,%xmm5,%xmm5 - vpclmulqdq $0,%xmm7,%xmm8,%xmm2 - vmovdqu 80-64(%rsi),%xmm7 - subq $16,%rcx - jz L$tail_avx - - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $0,%xmm6,%xmm15,%xmm0 - vpxor %xmm15,%xmm8,%xmm8 - vmovdqu -64(%rdx),%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vpclmulqdq $17,%xmm6,%xmm15,%xmm1 - vmovdqu 64-64(%rsi),%xmm6 - vpshufb %xmm13,%xmm14,%xmm15 - vpxor %xmm2,%xmm5,%xmm5 - vpclmulqdq $0,%xmm7,%xmm8,%xmm2 - vpsrldq $8,%xmm7,%xmm7 - subq $16,%rcx - jz L$tail_avx - - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $0,%xmm6,%xmm15,%xmm0 - vpxor %xmm15,%xmm8,%xmm8 - vmovdqu -80(%rdx),%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vpclmulqdq $17,%xmm6,%xmm15,%xmm1 - vmovdqu 96-64(%rsi),%xmm6 - vpshufb %xmm13,%xmm14,%xmm15 - vpxor %xmm2,%xmm5,%xmm5 - vpclmulqdq $0,%xmm7,%xmm8,%xmm2 - vmovdqu 128-64(%rsi),%xmm7 - subq $16,%rcx - jz L$tail_avx - - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $0,%xmm6,%xmm15,%xmm0 - vpxor %xmm15,%xmm8,%xmm8 - vmovdqu -96(%rdx),%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vpclmulqdq $17,%xmm6,%xmm15,%xmm1 - vmovdqu 112-64(%rsi),%xmm6 - vpshufb %xmm13,%xmm14,%xmm15 - vpxor %xmm2,%xmm5,%xmm5 - vpclmulqdq $0,%xmm7,%xmm8,%xmm2 - vpsrldq $8,%xmm7,%xmm7 - subq $16,%rcx - jz L$tail_avx - - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $0,%xmm6,%xmm15,%xmm0 - vpxor %xmm15,%xmm8,%xmm8 - vmovdqu -112(%rdx),%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vpclmulqdq $17,%xmm6,%xmm15,%xmm1 - vmovdqu 144-64(%rsi),%xmm6 - vpshufb %xmm13,%xmm14,%xmm15 - vpxor %xmm2,%xmm5,%xmm5 - vpclmulqdq $0,%xmm7,%xmm8,%xmm2 - vmovq 184-64(%rsi),%xmm7 - subq $16,%rcx - jmp L$tail_avx - -.p2align 5 -L$tail_avx: - vpxor %xmm10,%xmm15,%xmm15 -L$tail_no_xor_avx: - vpunpckhqdq %xmm15,%xmm15,%xmm8 - vpxor %xmm0,%xmm3,%xmm3 - vpclmulqdq $0,%xmm6,%xmm15,%xmm0 - vpxor %xmm15,%xmm8,%xmm8 - vpxor %xmm1,%xmm4,%xmm4 - vpclmulqdq $17,%xmm6,%xmm15,%xmm1 - vpxor %xmm2,%xmm5,%xmm5 - vpclmulqdq $0,%xmm7,%xmm8,%xmm2 - - vmovdqu (%r10),%xmm12 - - vpxor %xmm0,%xmm3,%xmm10 - vpxor %xmm1,%xmm4,%xmm11 - vpxor %xmm2,%xmm5,%xmm5 - - vpxor %xmm10,%xmm5,%xmm5 - vpxor %xmm11,%xmm5,%xmm5 - vpslldq $8,%xmm5,%xmm9 - vpsrldq $8,%xmm5,%xmm5 - vpxor %xmm9,%xmm10,%xmm10 - vpxor %xmm5,%xmm11,%xmm11 - - vpclmulqdq $16,%xmm12,%xmm10,%xmm9 - vpalignr $8,%xmm10,%xmm10,%xmm10 - vpxor %xmm9,%xmm10,%xmm10 - - vpclmulqdq $16,%xmm12,%xmm10,%xmm9 - vpalignr $8,%xmm10,%xmm10,%xmm10 - vpxor %xmm11,%xmm10,%xmm10 - vpxor %xmm9,%xmm10,%xmm10 - - cmpq $0,%rcx - jne L$short_avx - - vpshufb %xmm13,%xmm10,%xmm10 - vmovdqu %xmm10,(%rdi) - vzeroupper - .byte 0xf3,0xc3 + jmp L$_ghash_clmul .p2align 6 L$bswap_mask: diff --git a/deps/openssl/asm/x64-macosx-gas/sha/sha1-mb-x86_64.s b/deps/openssl/asm/x64-macosx-gas/sha/sha1-mb-x86_64.s index c164fc3c42bb38..a0de51655d1d3a 100644 --- a/deps/openssl/asm/x64-macosx-gas/sha/sha1-mb-x86_64.s +++ b/deps/openssl/asm/x64-macosx-gas/sha/sha1-mb-x86_64.s @@ -9,8 +9,6 @@ _sha1_multi_block: movq _OPENSSL_ia32cap_P+4(%rip),%rcx btq $61,%rcx jc _shaext_shortcut - testl $268435456,%ecx - jnz _avx_shortcut movq %rsp,%rax pushq %rbx pushq %rbp @@ -2601,10 +2599,10 @@ L$oop_grande_shaext: punpcklqdq %xmm5,%xmm0 punpckhqdq %xmm5,%xmm8 - pshufd $63,%xmm7,%xmm1 - pshufd $127,%xmm7,%xmm9 - pshufd $27,%xmm0,%xmm0 - pshufd $27,%xmm8,%xmm8 + pshufd $0b00111111,%xmm7,%xmm1 + pshufd $0b01111111,%xmm7,%xmm9 + pshufd $0b00011011,%xmm0,%xmm0 + pshufd $0b00011011,%xmm8,%xmm8 jmp L$oop_shaext .p2align 5 @@ -2859,8 +2857,8 @@ L$oop_shaext: .byte 69,15,58,204,193,3 .byte 69,15,56,200,214 - pshufd $0,%xmm6,%xmm11 - pshufd $85,%xmm6,%xmm12 + pshufd $0x00,%xmm6,%xmm11 + pshufd $0x55,%xmm6,%xmm12 movdqa %xmm6,%xmm7 pcmpgtd %xmm4,%xmm11 pcmpgtd %xmm4,%xmm12 @@ -2890,8 +2888,8 @@ L$oop_shaext: movl 280(%rsp),%edx - pshufd $27,%xmm0,%xmm0 - pshufd $27,%xmm8,%xmm8 + pshufd $0b00011011,%xmm0,%xmm0 + pshufd $0b00011011,%xmm8,%xmm8 movdqa %xmm0,%xmm6 punpckldq %xmm8,%xmm0 @@ -2920,4291 +2918,6 @@ L$epilogue_shaext: .byte 0xf3,0xc3 -.p2align 5 -sha1_multi_block_avx: -_avx_shortcut: - shrq $32,%rcx - cmpl $2,%edx - jb L$avx - testl $32,%ecx - jnz _avx2_shortcut - jmp L$avx -.p2align 5 -L$avx: - movq %rsp,%rax - pushq %rbx - pushq %rbp - subq $288,%rsp - andq $-256,%rsp - movq %rax,272(%rsp) -L$body_avx: - leaq K_XX_XX(%rip),%rbp - leaq 256(%rsp),%rbx - - vzeroupper -L$oop_grande_avx: - movl %edx,280(%rsp) - xorl %edx,%edx - movq 0(%rsi),%r8 - movl 8(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,0(%rbx) - cmovleq %rbp,%r8 - movq 16(%rsi),%r9 - movl 24(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,4(%rbx) - cmovleq %rbp,%r9 - movq 32(%rsi),%r10 - movl 40(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,8(%rbx) - cmovleq %rbp,%r10 - movq 48(%rsi),%r11 - movl 56(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,12(%rbx) - cmovleq %rbp,%r11 - testl %edx,%edx - jz L$done_avx - - vmovdqu 0(%rdi),%xmm10 - leaq 128(%rsp),%rax - vmovdqu 32(%rdi),%xmm11 - vmovdqu 64(%rdi),%xmm12 - vmovdqu 96(%rdi),%xmm13 - vmovdqu 128(%rdi),%xmm14 - vmovdqu 96(%rbp),%xmm5 - jmp L$oop_avx - -.p2align 5 -L$oop_avx: - vmovdqa -32(%rbp),%xmm15 - vmovd (%r8),%xmm0 - leaq 64(%r8),%r8 - vmovd (%r9),%xmm2 - leaq 64(%r9),%r9 - vpinsrd $1,(%r10),%xmm0,%xmm0 - leaq 64(%r10),%r10 - vpinsrd $1,(%r11),%xmm2,%xmm2 - leaq 64(%r11),%r11 - vmovd -60(%r8),%xmm1 - vpunpckldq %xmm2,%xmm0,%xmm0 - vmovd -60(%r9),%xmm9 - vpshufb %xmm5,%xmm0,%xmm0 - vpinsrd $1,-60(%r10),%xmm1,%xmm1 - vpinsrd $1,-60(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm14,%xmm14 - vpslld $5,%xmm10,%xmm8 - vpandn %xmm13,%xmm11,%xmm7 - vpand %xmm12,%xmm11,%xmm6 - - vmovdqa %xmm0,0-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpunpckldq %xmm9,%xmm1,%xmm1 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -56(%r8),%xmm2 - - vpslld $30,%xmm11,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -56(%r9),%xmm9 - vpaddd %xmm6,%xmm14,%xmm14 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpshufb %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpinsrd $1,-56(%r10),%xmm2,%xmm2 - vpinsrd $1,-56(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm13,%xmm13 - vpslld $5,%xmm14,%xmm8 - vpandn %xmm12,%xmm10,%xmm7 - vpand %xmm11,%xmm10,%xmm6 - - vmovdqa %xmm1,16-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpunpckldq %xmm9,%xmm2,%xmm2 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -52(%r8),%xmm3 - - vpslld $30,%xmm10,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -52(%r9),%xmm9 - vpaddd %xmm6,%xmm13,%xmm13 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpshufb %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpinsrd $1,-52(%r10),%xmm3,%xmm3 - vpinsrd $1,-52(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm12,%xmm12 - vpslld $5,%xmm13,%xmm8 - vpandn %xmm11,%xmm14,%xmm7 - vpand %xmm10,%xmm14,%xmm6 - - vmovdqa %xmm2,32-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpunpckldq %xmm9,%xmm3,%xmm3 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -48(%r8),%xmm4 - - vpslld $30,%xmm14,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -48(%r9),%xmm9 - vpaddd %xmm6,%xmm12,%xmm12 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpshufb %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpinsrd $1,-48(%r10),%xmm4,%xmm4 - vpinsrd $1,-48(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm11,%xmm11 - vpslld $5,%xmm12,%xmm8 - vpandn %xmm10,%xmm13,%xmm7 - vpand %xmm14,%xmm13,%xmm6 - - vmovdqa %xmm3,48-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpunpckldq %xmm9,%xmm4,%xmm4 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -44(%r8),%xmm0 - - vpslld $30,%xmm13,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -44(%r9),%xmm9 - vpaddd %xmm6,%xmm11,%xmm11 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpshufb %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpinsrd $1,-44(%r10),%xmm0,%xmm0 - vpinsrd $1,-44(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm10,%xmm10 - vpslld $5,%xmm11,%xmm8 - vpandn %xmm14,%xmm12,%xmm7 - vpand %xmm13,%xmm12,%xmm6 - - vmovdqa %xmm4,64-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpunpckldq %xmm9,%xmm0,%xmm0 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -40(%r8),%xmm1 - - vpslld $30,%xmm12,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -40(%r9),%xmm9 - vpaddd %xmm6,%xmm10,%xmm10 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpshufb %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vpinsrd $1,-40(%r10),%xmm1,%xmm1 - vpinsrd $1,-40(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm14,%xmm14 - vpslld $5,%xmm10,%xmm8 - vpandn %xmm13,%xmm11,%xmm7 - vpand %xmm12,%xmm11,%xmm6 - - vmovdqa %xmm0,80-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpunpckldq %xmm9,%xmm1,%xmm1 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -36(%r8),%xmm2 - - vpslld $30,%xmm11,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -36(%r9),%xmm9 - vpaddd %xmm6,%xmm14,%xmm14 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpshufb %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpinsrd $1,-36(%r10),%xmm2,%xmm2 - vpinsrd $1,-36(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm13,%xmm13 - vpslld $5,%xmm14,%xmm8 - vpandn %xmm12,%xmm10,%xmm7 - vpand %xmm11,%xmm10,%xmm6 - - vmovdqa %xmm1,96-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpunpckldq %xmm9,%xmm2,%xmm2 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -32(%r8),%xmm3 - - vpslld $30,%xmm10,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -32(%r9),%xmm9 - vpaddd %xmm6,%xmm13,%xmm13 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpshufb %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpinsrd $1,-32(%r10),%xmm3,%xmm3 - vpinsrd $1,-32(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm12,%xmm12 - vpslld $5,%xmm13,%xmm8 - vpandn %xmm11,%xmm14,%xmm7 - vpand %xmm10,%xmm14,%xmm6 - - vmovdqa %xmm2,112-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpunpckldq %xmm9,%xmm3,%xmm3 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -28(%r8),%xmm4 - - vpslld $30,%xmm14,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -28(%r9),%xmm9 - vpaddd %xmm6,%xmm12,%xmm12 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpshufb %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpinsrd $1,-28(%r10),%xmm4,%xmm4 - vpinsrd $1,-28(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm11,%xmm11 - vpslld $5,%xmm12,%xmm8 - vpandn %xmm10,%xmm13,%xmm7 - vpand %xmm14,%xmm13,%xmm6 - - vmovdqa %xmm3,128-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpunpckldq %xmm9,%xmm4,%xmm4 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -24(%r8),%xmm0 - - vpslld $30,%xmm13,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -24(%r9),%xmm9 - vpaddd %xmm6,%xmm11,%xmm11 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpshufb %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpinsrd $1,-24(%r10),%xmm0,%xmm0 - vpinsrd $1,-24(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm10,%xmm10 - vpslld $5,%xmm11,%xmm8 - vpandn %xmm14,%xmm12,%xmm7 - vpand %xmm13,%xmm12,%xmm6 - - vmovdqa %xmm4,144-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpunpckldq %xmm9,%xmm0,%xmm0 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -20(%r8),%xmm1 - - vpslld $30,%xmm12,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -20(%r9),%xmm9 - vpaddd %xmm6,%xmm10,%xmm10 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpshufb %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vpinsrd $1,-20(%r10),%xmm1,%xmm1 - vpinsrd $1,-20(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm14,%xmm14 - vpslld $5,%xmm10,%xmm8 - vpandn %xmm13,%xmm11,%xmm7 - vpand %xmm12,%xmm11,%xmm6 - - vmovdqa %xmm0,160-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpunpckldq %xmm9,%xmm1,%xmm1 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -16(%r8),%xmm2 - - vpslld $30,%xmm11,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -16(%r9),%xmm9 - vpaddd %xmm6,%xmm14,%xmm14 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpshufb %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpinsrd $1,-16(%r10),%xmm2,%xmm2 - vpinsrd $1,-16(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm13,%xmm13 - vpslld $5,%xmm14,%xmm8 - vpandn %xmm12,%xmm10,%xmm7 - vpand %xmm11,%xmm10,%xmm6 - - vmovdqa %xmm1,176-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpunpckldq %xmm9,%xmm2,%xmm2 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -12(%r8),%xmm3 - - vpslld $30,%xmm10,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -12(%r9),%xmm9 - vpaddd %xmm6,%xmm13,%xmm13 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpshufb %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpinsrd $1,-12(%r10),%xmm3,%xmm3 - vpinsrd $1,-12(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm12,%xmm12 - vpslld $5,%xmm13,%xmm8 - vpandn %xmm11,%xmm14,%xmm7 - vpand %xmm10,%xmm14,%xmm6 - - vmovdqa %xmm2,192-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpunpckldq %xmm9,%xmm3,%xmm3 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -8(%r8),%xmm4 - - vpslld $30,%xmm14,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -8(%r9),%xmm9 - vpaddd %xmm6,%xmm12,%xmm12 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpshufb %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpinsrd $1,-8(%r10),%xmm4,%xmm4 - vpinsrd $1,-8(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm11,%xmm11 - vpslld $5,%xmm12,%xmm8 - vpandn %xmm10,%xmm13,%xmm7 - vpand %xmm14,%xmm13,%xmm6 - - vmovdqa %xmm3,208-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpunpckldq %xmm9,%xmm4,%xmm4 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vmovd -4(%r8),%xmm0 - - vpslld $30,%xmm13,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vmovd -4(%r9),%xmm9 - vpaddd %xmm6,%xmm11,%xmm11 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpshufb %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vmovdqa 0-128(%rax),%xmm1 - vpinsrd $1,-4(%r10),%xmm0,%xmm0 - vpinsrd $1,-4(%r11),%xmm9,%xmm9 - vpaddd %xmm15,%xmm10,%xmm10 - prefetcht0 63(%r8) - vpslld $5,%xmm11,%xmm8 - vpandn %xmm14,%xmm12,%xmm7 - vpand %xmm13,%xmm12,%xmm6 - - vmovdqa %xmm4,224-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpunpckldq %xmm9,%xmm0,%xmm0 - vpsrld $27,%xmm11,%xmm9 - prefetcht0 63(%r9) - vpxor %xmm7,%xmm6,%xmm6 - - vpslld $30,%xmm12,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - prefetcht0 63(%r10) - vpaddd %xmm6,%xmm10,%xmm10 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - prefetcht0 63(%r11) - vpshufb %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vmovdqa 16-128(%rax),%xmm2 - vpxor %xmm3,%xmm1,%xmm1 - vmovdqa 32-128(%rax),%xmm3 - - vpaddd %xmm15,%xmm14,%xmm14 - vpslld $5,%xmm10,%xmm8 - vpandn %xmm13,%xmm11,%xmm7 - - vpand %xmm12,%xmm11,%xmm6 - - vmovdqa %xmm0,240-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpxor 128-128(%rax),%xmm1,%xmm1 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vpxor %xmm3,%xmm1,%xmm1 - - - vpslld $30,%xmm11,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm14,%xmm14 - - vpsrld $31,%xmm1,%xmm5 - vpaddd %xmm1,%xmm1,%xmm1 - - vpsrld $2,%xmm11,%xmm11 - - vpaddd %xmm8,%xmm14,%xmm14 - vpor %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpxor %xmm4,%xmm2,%xmm2 - vmovdqa 48-128(%rax),%xmm4 - - vpaddd %xmm15,%xmm13,%xmm13 - vpslld $5,%xmm14,%xmm8 - vpandn %xmm12,%xmm10,%xmm7 - - vpand %xmm11,%xmm10,%xmm6 - - vmovdqa %xmm1,0-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpxor 144-128(%rax),%xmm2,%xmm2 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vpxor %xmm4,%xmm2,%xmm2 - - - vpslld $30,%xmm10,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm13,%xmm13 - - vpsrld $31,%xmm2,%xmm5 - vpaddd %xmm2,%xmm2,%xmm2 - - vpsrld $2,%xmm10,%xmm10 - - vpaddd %xmm8,%xmm13,%xmm13 - vpor %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpxor %xmm0,%xmm3,%xmm3 - vmovdqa 64-128(%rax),%xmm0 - - vpaddd %xmm15,%xmm12,%xmm12 - vpslld $5,%xmm13,%xmm8 - vpandn %xmm11,%xmm14,%xmm7 - - vpand %xmm10,%xmm14,%xmm6 - - vmovdqa %xmm2,16-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpxor 160-128(%rax),%xmm3,%xmm3 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vpxor %xmm0,%xmm3,%xmm3 - - - vpslld $30,%xmm14,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm12,%xmm12 - - vpsrld $31,%xmm3,%xmm5 - vpaddd %xmm3,%xmm3,%xmm3 - - vpsrld $2,%xmm14,%xmm14 - - vpaddd %xmm8,%xmm12,%xmm12 - vpor %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqa 80-128(%rax),%xmm1 - - vpaddd %xmm15,%xmm11,%xmm11 - vpslld $5,%xmm12,%xmm8 - vpandn %xmm10,%xmm13,%xmm7 - - vpand %xmm14,%xmm13,%xmm6 - - vmovdqa %xmm3,32-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpxor 176-128(%rax),%xmm4,%xmm4 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm4 - - - vpslld $30,%xmm13,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm11,%xmm11 - - vpsrld $31,%xmm4,%xmm5 - vpaddd %xmm4,%xmm4,%xmm4 - - vpsrld $2,%xmm13,%xmm13 - - vpaddd %xmm8,%xmm11,%xmm11 - vpor %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpxor %xmm2,%xmm0,%xmm0 - vmovdqa 96-128(%rax),%xmm2 - - vpaddd %xmm15,%xmm10,%xmm10 - vpslld $5,%xmm11,%xmm8 - vpandn %xmm14,%xmm12,%xmm7 - - vpand %xmm13,%xmm12,%xmm6 - - vmovdqa %xmm4,48-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpxor 192-128(%rax),%xmm0,%xmm0 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm7,%xmm6,%xmm6 - vpxor %xmm2,%xmm0,%xmm0 - - - vpslld $30,%xmm12,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm10,%xmm10 - - vpsrld $31,%xmm0,%xmm5 - vpaddd %xmm0,%xmm0,%xmm0 - - vpsrld $2,%xmm12,%xmm12 - - vpaddd %xmm8,%xmm10,%xmm10 - vpor %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vmovdqa 0(%rbp),%xmm15 - vpxor %xmm3,%xmm1,%xmm1 - vmovdqa 112-128(%rax),%xmm3 - - vpslld $5,%xmm10,%xmm8 - vpaddd %xmm15,%xmm14,%xmm14 - vpxor %xmm11,%xmm13,%xmm6 - vmovdqa %xmm0,64-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpxor 208-128(%rax),%xmm1,%xmm1 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm12,%xmm6,%xmm6 - vpxor %xmm3,%xmm1,%xmm1 - - vpslld $30,%xmm11,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm14,%xmm14 - vpsrld $31,%xmm1,%xmm5 - vpaddd %xmm1,%xmm1,%xmm1 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpor %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpxor %xmm4,%xmm2,%xmm2 - vmovdqa 128-128(%rax),%xmm4 - - vpslld $5,%xmm14,%xmm8 - vpaddd %xmm15,%xmm13,%xmm13 - vpxor %xmm10,%xmm12,%xmm6 - vmovdqa %xmm1,80-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpxor 224-128(%rax),%xmm2,%xmm2 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm11,%xmm6,%xmm6 - vpxor %xmm4,%xmm2,%xmm2 - - vpslld $30,%xmm10,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm13,%xmm13 - vpsrld $31,%xmm2,%xmm5 - vpaddd %xmm2,%xmm2,%xmm2 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpor %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpxor %xmm0,%xmm3,%xmm3 - vmovdqa 144-128(%rax),%xmm0 - - vpslld $5,%xmm13,%xmm8 - vpaddd %xmm15,%xmm12,%xmm12 - vpxor %xmm14,%xmm11,%xmm6 - vmovdqa %xmm2,96-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpxor 240-128(%rax),%xmm3,%xmm3 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm10,%xmm6,%xmm6 - vpxor %xmm0,%xmm3,%xmm3 - - vpslld $30,%xmm14,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm12,%xmm12 - vpsrld $31,%xmm3,%xmm5 - vpaddd %xmm3,%xmm3,%xmm3 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpor %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqa 160-128(%rax),%xmm1 - - vpslld $5,%xmm12,%xmm8 - vpaddd %xmm15,%xmm11,%xmm11 - vpxor %xmm13,%xmm10,%xmm6 - vmovdqa %xmm3,112-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpxor 0-128(%rax),%xmm4,%xmm4 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm14,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm4 - - vpslld $30,%xmm13,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm11,%xmm11 - vpsrld $31,%xmm4,%xmm5 - vpaddd %xmm4,%xmm4,%xmm4 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpor %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpxor %xmm2,%xmm0,%xmm0 - vmovdqa 176-128(%rax),%xmm2 - - vpslld $5,%xmm11,%xmm8 - vpaddd %xmm15,%xmm10,%xmm10 - vpxor %xmm12,%xmm14,%xmm6 - vmovdqa %xmm4,128-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpxor 16-128(%rax),%xmm0,%xmm0 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm13,%xmm6,%xmm6 - vpxor %xmm2,%xmm0,%xmm0 - - vpslld $30,%xmm12,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm10,%xmm10 - vpsrld $31,%xmm0,%xmm5 - vpaddd %xmm0,%xmm0,%xmm0 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpor %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vpxor %xmm3,%xmm1,%xmm1 - vmovdqa 192-128(%rax),%xmm3 - - vpslld $5,%xmm10,%xmm8 - vpaddd %xmm15,%xmm14,%xmm14 - vpxor %xmm11,%xmm13,%xmm6 - vmovdqa %xmm0,144-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpxor 32-128(%rax),%xmm1,%xmm1 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm12,%xmm6,%xmm6 - vpxor %xmm3,%xmm1,%xmm1 - - vpslld $30,%xmm11,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm14,%xmm14 - vpsrld $31,%xmm1,%xmm5 - vpaddd %xmm1,%xmm1,%xmm1 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpor %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpxor %xmm4,%xmm2,%xmm2 - vmovdqa 208-128(%rax),%xmm4 - - vpslld $5,%xmm14,%xmm8 - vpaddd %xmm15,%xmm13,%xmm13 - vpxor %xmm10,%xmm12,%xmm6 - vmovdqa %xmm1,160-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpxor 48-128(%rax),%xmm2,%xmm2 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm11,%xmm6,%xmm6 - vpxor %xmm4,%xmm2,%xmm2 - - vpslld $30,%xmm10,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm13,%xmm13 - vpsrld $31,%xmm2,%xmm5 - vpaddd %xmm2,%xmm2,%xmm2 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpor %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpxor %xmm0,%xmm3,%xmm3 - vmovdqa 224-128(%rax),%xmm0 - - vpslld $5,%xmm13,%xmm8 - vpaddd %xmm15,%xmm12,%xmm12 - vpxor %xmm14,%xmm11,%xmm6 - vmovdqa %xmm2,176-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpxor 64-128(%rax),%xmm3,%xmm3 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm10,%xmm6,%xmm6 - vpxor %xmm0,%xmm3,%xmm3 - - vpslld $30,%xmm14,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm12,%xmm12 - vpsrld $31,%xmm3,%xmm5 - vpaddd %xmm3,%xmm3,%xmm3 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpor %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqa 240-128(%rax),%xmm1 - - vpslld $5,%xmm12,%xmm8 - vpaddd %xmm15,%xmm11,%xmm11 - vpxor %xmm13,%xmm10,%xmm6 - vmovdqa %xmm3,192-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpxor 80-128(%rax),%xmm4,%xmm4 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm14,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm4 - - vpslld $30,%xmm13,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm11,%xmm11 - vpsrld $31,%xmm4,%xmm5 - vpaddd %xmm4,%xmm4,%xmm4 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpor %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpxor %xmm2,%xmm0,%xmm0 - vmovdqa 0-128(%rax),%xmm2 - - vpslld $5,%xmm11,%xmm8 - vpaddd %xmm15,%xmm10,%xmm10 - vpxor %xmm12,%xmm14,%xmm6 - vmovdqa %xmm4,208-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpxor 96-128(%rax),%xmm0,%xmm0 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm13,%xmm6,%xmm6 - vpxor %xmm2,%xmm0,%xmm0 - - vpslld $30,%xmm12,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm10,%xmm10 - vpsrld $31,%xmm0,%xmm5 - vpaddd %xmm0,%xmm0,%xmm0 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpor %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vpxor %xmm3,%xmm1,%xmm1 - vmovdqa 16-128(%rax),%xmm3 - - vpslld $5,%xmm10,%xmm8 - vpaddd %xmm15,%xmm14,%xmm14 - vpxor %xmm11,%xmm13,%xmm6 - vmovdqa %xmm0,224-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpxor 112-128(%rax),%xmm1,%xmm1 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm12,%xmm6,%xmm6 - vpxor %xmm3,%xmm1,%xmm1 - - vpslld $30,%xmm11,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm14,%xmm14 - vpsrld $31,%xmm1,%xmm5 - vpaddd %xmm1,%xmm1,%xmm1 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpor %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpxor %xmm4,%xmm2,%xmm2 - vmovdqa 32-128(%rax),%xmm4 - - vpslld $5,%xmm14,%xmm8 - vpaddd %xmm15,%xmm13,%xmm13 - vpxor %xmm10,%xmm12,%xmm6 - vmovdqa %xmm1,240-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpxor 128-128(%rax),%xmm2,%xmm2 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm11,%xmm6,%xmm6 - vpxor %xmm4,%xmm2,%xmm2 - - vpslld $30,%xmm10,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm13,%xmm13 - vpsrld $31,%xmm2,%xmm5 - vpaddd %xmm2,%xmm2,%xmm2 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpor %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpxor %xmm0,%xmm3,%xmm3 - vmovdqa 48-128(%rax),%xmm0 - - vpslld $5,%xmm13,%xmm8 - vpaddd %xmm15,%xmm12,%xmm12 - vpxor %xmm14,%xmm11,%xmm6 - vmovdqa %xmm2,0-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpxor 144-128(%rax),%xmm3,%xmm3 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm10,%xmm6,%xmm6 - vpxor %xmm0,%xmm3,%xmm3 - - vpslld $30,%xmm14,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm12,%xmm12 - vpsrld $31,%xmm3,%xmm5 - vpaddd %xmm3,%xmm3,%xmm3 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpor %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqa 64-128(%rax),%xmm1 - - vpslld $5,%xmm12,%xmm8 - vpaddd %xmm15,%xmm11,%xmm11 - vpxor %xmm13,%xmm10,%xmm6 - vmovdqa %xmm3,16-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpxor 160-128(%rax),%xmm4,%xmm4 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm14,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm4 - - vpslld $30,%xmm13,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm11,%xmm11 - vpsrld $31,%xmm4,%xmm5 - vpaddd %xmm4,%xmm4,%xmm4 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpor %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpxor %xmm2,%xmm0,%xmm0 - vmovdqa 80-128(%rax),%xmm2 - - vpslld $5,%xmm11,%xmm8 - vpaddd %xmm15,%xmm10,%xmm10 - vpxor %xmm12,%xmm14,%xmm6 - vmovdqa %xmm4,32-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpxor 176-128(%rax),%xmm0,%xmm0 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm13,%xmm6,%xmm6 - vpxor %xmm2,%xmm0,%xmm0 - - vpslld $30,%xmm12,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm10,%xmm10 - vpsrld $31,%xmm0,%xmm5 - vpaddd %xmm0,%xmm0,%xmm0 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpor %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vpxor %xmm3,%xmm1,%xmm1 - vmovdqa 96-128(%rax),%xmm3 - - vpslld $5,%xmm10,%xmm8 - vpaddd %xmm15,%xmm14,%xmm14 - vpxor %xmm11,%xmm13,%xmm6 - vmovdqa %xmm0,48-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpxor 192-128(%rax),%xmm1,%xmm1 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm12,%xmm6,%xmm6 - vpxor %xmm3,%xmm1,%xmm1 - - vpslld $30,%xmm11,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm14,%xmm14 - vpsrld $31,%xmm1,%xmm5 - vpaddd %xmm1,%xmm1,%xmm1 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpor %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpxor %xmm4,%xmm2,%xmm2 - vmovdqa 112-128(%rax),%xmm4 - - vpslld $5,%xmm14,%xmm8 - vpaddd %xmm15,%xmm13,%xmm13 - vpxor %xmm10,%xmm12,%xmm6 - vmovdqa %xmm1,64-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpxor 208-128(%rax),%xmm2,%xmm2 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm11,%xmm6,%xmm6 - vpxor %xmm4,%xmm2,%xmm2 - - vpslld $30,%xmm10,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm13,%xmm13 - vpsrld $31,%xmm2,%xmm5 - vpaddd %xmm2,%xmm2,%xmm2 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpor %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpxor %xmm0,%xmm3,%xmm3 - vmovdqa 128-128(%rax),%xmm0 - - vpslld $5,%xmm13,%xmm8 - vpaddd %xmm15,%xmm12,%xmm12 - vpxor %xmm14,%xmm11,%xmm6 - vmovdqa %xmm2,80-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpxor 224-128(%rax),%xmm3,%xmm3 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm10,%xmm6,%xmm6 - vpxor %xmm0,%xmm3,%xmm3 - - vpslld $30,%xmm14,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm12,%xmm12 - vpsrld $31,%xmm3,%xmm5 - vpaddd %xmm3,%xmm3,%xmm3 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpor %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqa 144-128(%rax),%xmm1 - - vpslld $5,%xmm12,%xmm8 - vpaddd %xmm15,%xmm11,%xmm11 - vpxor %xmm13,%xmm10,%xmm6 - vmovdqa %xmm3,96-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpxor 240-128(%rax),%xmm4,%xmm4 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm14,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm4 - - vpslld $30,%xmm13,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm11,%xmm11 - vpsrld $31,%xmm4,%xmm5 - vpaddd %xmm4,%xmm4,%xmm4 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpor %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpxor %xmm2,%xmm0,%xmm0 - vmovdqa 160-128(%rax),%xmm2 - - vpslld $5,%xmm11,%xmm8 - vpaddd %xmm15,%xmm10,%xmm10 - vpxor %xmm12,%xmm14,%xmm6 - vmovdqa %xmm4,112-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpxor 0-128(%rax),%xmm0,%xmm0 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm13,%xmm6,%xmm6 - vpxor %xmm2,%xmm0,%xmm0 - - vpslld $30,%xmm12,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm10,%xmm10 - vpsrld $31,%xmm0,%xmm5 - vpaddd %xmm0,%xmm0,%xmm0 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpor %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vmovdqa 32(%rbp),%xmm15 - vpxor %xmm3,%xmm1,%xmm1 - vmovdqa 176-128(%rax),%xmm3 - - vpaddd %xmm15,%xmm14,%xmm14 - vpslld $5,%xmm10,%xmm8 - vpand %xmm12,%xmm13,%xmm7 - vpxor 16-128(%rax),%xmm1,%xmm1 - - vpaddd %xmm7,%xmm14,%xmm14 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm12,%xmm13,%xmm6 - vpxor %xmm3,%xmm1,%xmm1 - - vmovdqu %xmm0,128-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm1,%xmm5 - vpand %xmm11,%xmm6,%xmm6 - vpaddd %xmm1,%xmm1,%xmm1 - - vpslld $30,%xmm11,%xmm7 - vpaddd %xmm6,%xmm14,%xmm14 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpor %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpxor %xmm4,%xmm2,%xmm2 - vmovdqa 192-128(%rax),%xmm4 - - vpaddd %xmm15,%xmm13,%xmm13 - vpslld $5,%xmm14,%xmm8 - vpand %xmm11,%xmm12,%xmm7 - vpxor 32-128(%rax),%xmm2,%xmm2 - - vpaddd %xmm7,%xmm13,%xmm13 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm11,%xmm12,%xmm6 - vpxor %xmm4,%xmm2,%xmm2 - - vmovdqu %xmm1,144-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm2,%xmm5 - vpand %xmm10,%xmm6,%xmm6 - vpaddd %xmm2,%xmm2,%xmm2 - - vpslld $30,%xmm10,%xmm7 - vpaddd %xmm6,%xmm13,%xmm13 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpor %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpxor %xmm0,%xmm3,%xmm3 - vmovdqa 208-128(%rax),%xmm0 - - vpaddd %xmm15,%xmm12,%xmm12 - vpslld $5,%xmm13,%xmm8 - vpand %xmm10,%xmm11,%xmm7 - vpxor 48-128(%rax),%xmm3,%xmm3 - - vpaddd %xmm7,%xmm12,%xmm12 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm10,%xmm11,%xmm6 - vpxor %xmm0,%xmm3,%xmm3 - - vmovdqu %xmm2,160-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm3,%xmm5 - vpand %xmm14,%xmm6,%xmm6 - vpaddd %xmm3,%xmm3,%xmm3 - - vpslld $30,%xmm14,%xmm7 - vpaddd %xmm6,%xmm12,%xmm12 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpor %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqa 224-128(%rax),%xmm1 - - vpaddd %xmm15,%xmm11,%xmm11 - vpslld $5,%xmm12,%xmm8 - vpand %xmm14,%xmm10,%xmm7 - vpxor 64-128(%rax),%xmm4,%xmm4 - - vpaddd %xmm7,%xmm11,%xmm11 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm14,%xmm10,%xmm6 - vpxor %xmm1,%xmm4,%xmm4 - - vmovdqu %xmm3,176-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm4,%xmm5 - vpand %xmm13,%xmm6,%xmm6 - vpaddd %xmm4,%xmm4,%xmm4 - - vpslld $30,%xmm13,%xmm7 - vpaddd %xmm6,%xmm11,%xmm11 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpor %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpxor %xmm2,%xmm0,%xmm0 - vmovdqa 240-128(%rax),%xmm2 - - vpaddd %xmm15,%xmm10,%xmm10 - vpslld $5,%xmm11,%xmm8 - vpand %xmm13,%xmm14,%xmm7 - vpxor 80-128(%rax),%xmm0,%xmm0 - - vpaddd %xmm7,%xmm10,%xmm10 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm13,%xmm14,%xmm6 - vpxor %xmm2,%xmm0,%xmm0 - - vmovdqu %xmm4,192-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm0,%xmm5 - vpand %xmm12,%xmm6,%xmm6 - vpaddd %xmm0,%xmm0,%xmm0 - - vpslld $30,%xmm12,%xmm7 - vpaddd %xmm6,%xmm10,%xmm10 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpor %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vpxor %xmm3,%xmm1,%xmm1 - vmovdqa 0-128(%rax),%xmm3 - - vpaddd %xmm15,%xmm14,%xmm14 - vpslld $5,%xmm10,%xmm8 - vpand %xmm12,%xmm13,%xmm7 - vpxor 96-128(%rax),%xmm1,%xmm1 - - vpaddd %xmm7,%xmm14,%xmm14 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm12,%xmm13,%xmm6 - vpxor %xmm3,%xmm1,%xmm1 - - vmovdqu %xmm0,208-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm1,%xmm5 - vpand %xmm11,%xmm6,%xmm6 - vpaddd %xmm1,%xmm1,%xmm1 - - vpslld $30,%xmm11,%xmm7 - vpaddd %xmm6,%xmm14,%xmm14 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpor %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpxor %xmm4,%xmm2,%xmm2 - vmovdqa 16-128(%rax),%xmm4 - - vpaddd %xmm15,%xmm13,%xmm13 - vpslld $5,%xmm14,%xmm8 - vpand %xmm11,%xmm12,%xmm7 - vpxor 112-128(%rax),%xmm2,%xmm2 - - vpaddd %xmm7,%xmm13,%xmm13 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm11,%xmm12,%xmm6 - vpxor %xmm4,%xmm2,%xmm2 - - vmovdqu %xmm1,224-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm2,%xmm5 - vpand %xmm10,%xmm6,%xmm6 - vpaddd %xmm2,%xmm2,%xmm2 - - vpslld $30,%xmm10,%xmm7 - vpaddd %xmm6,%xmm13,%xmm13 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpor %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpxor %xmm0,%xmm3,%xmm3 - vmovdqa 32-128(%rax),%xmm0 - - vpaddd %xmm15,%xmm12,%xmm12 - vpslld $5,%xmm13,%xmm8 - vpand %xmm10,%xmm11,%xmm7 - vpxor 128-128(%rax),%xmm3,%xmm3 - - vpaddd %xmm7,%xmm12,%xmm12 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm10,%xmm11,%xmm6 - vpxor %xmm0,%xmm3,%xmm3 - - vmovdqu %xmm2,240-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm3,%xmm5 - vpand %xmm14,%xmm6,%xmm6 - vpaddd %xmm3,%xmm3,%xmm3 - - vpslld $30,%xmm14,%xmm7 - vpaddd %xmm6,%xmm12,%xmm12 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpor %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqa 48-128(%rax),%xmm1 - - vpaddd %xmm15,%xmm11,%xmm11 - vpslld $5,%xmm12,%xmm8 - vpand %xmm14,%xmm10,%xmm7 - vpxor 144-128(%rax),%xmm4,%xmm4 - - vpaddd %xmm7,%xmm11,%xmm11 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm14,%xmm10,%xmm6 - vpxor %xmm1,%xmm4,%xmm4 - - vmovdqu %xmm3,0-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm4,%xmm5 - vpand %xmm13,%xmm6,%xmm6 - vpaddd %xmm4,%xmm4,%xmm4 - - vpslld $30,%xmm13,%xmm7 - vpaddd %xmm6,%xmm11,%xmm11 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpor %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpxor %xmm2,%xmm0,%xmm0 - vmovdqa 64-128(%rax),%xmm2 - - vpaddd %xmm15,%xmm10,%xmm10 - vpslld $5,%xmm11,%xmm8 - vpand %xmm13,%xmm14,%xmm7 - vpxor 160-128(%rax),%xmm0,%xmm0 - - vpaddd %xmm7,%xmm10,%xmm10 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm13,%xmm14,%xmm6 - vpxor %xmm2,%xmm0,%xmm0 - - vmovdqu %xmm4,16-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm0,%xmm5 - vpand %xmm12,%xmm6,%xmm6 - vpaddd %xmm0,%xmm0,%xmm0 - - vpslld $30,%xmm12,%xmm7 - vpaddd %xmm6,%xmm10,%xmm10 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpor %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vpxor %xmm3,%xmm1,%xmm1 - vmovdqa 80-128(%rax),%xmm3 - - vpaddd %xmm15,%xmm14,%xmm14 - vpslld $5,%xmm10,%xmm8 - vpand %xmm12,%xmm13,%xmm7 - vpxor 176-128(%rax),%xmm1,%xmm1 - - vpaddd %xmm7,%xmm14,%xmm14 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm12,%xmm13,%xmm6 - vpxor %xmm3,%xmm1,%xmm1 - - vmovdqu %xmm0,32-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm1,%xmm5 - vpand %xmm11,%xmm6,%xmm6 - vpaddd %xmm1,%xmm1,%xmm1 - - vpslld $30,%xmm11,%xmm7 - vpaddd %xmm6,%xmm14,%xmm14 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpor %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpxor %xmm4,%xmm2,%xmm2 - vmovdqa 96-128(%rax),%xmm4 - - vpaddd %xmm15,%xmm13,%xmm13 - vpslld $5,%xmm14,%xmm8 - vpand %xmm11,%xmm12,%xmm7 - vpxor 192-128(%rax),%xmm2,%xmm2 - - vpaddd %xmm7,%xmm13,%xmm13 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm11,%xmm12,%xmm6 - vpxor %xmm4,%xmm2,%xmm2 - - vmovdqu %xmm1,48-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm2,%xmm5 - vpand %xmm10,%xmm6,%xmm6 - vpaddd %xmm2,%xmm2,%xmm2 - - vpslld $30,%xmm10,%xmm7 - vpaddd %xmm6,%xmm13,%xmm13 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpor %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpxor %xmm0,%xmm3,%xmm3 - vmovdqa 112-128(%rax),%xmm0 - - vpaddd %xmm15,%xmm12,%xmm12 - vpslld $5,%xmm13,%xmm8 - vpand %xmm10,%xmm11,%xmm7 - vpxor 208-128(%rax),%xmm3,%xmm3 - - vpaddd %xmm7,%xmm12,%xmm12 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm10,%xmm11,%xmm6 - vpxor %xmm0,%xmm3,%xmm3 - - vmovdqu %xmm2,64-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm3,%xmm5 - vpand %xmm14,%xmm6,%xmm6 - vpaddd %xmm3,%xmm3,%xmm3 - - vpslld $30,%xmm14,%xmm7 - vpaddd %xmm6,%xmm12,%xmm12 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpor %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqa 128-128(%rax),%xmm1 - - vpaddd %xmm15,%xmm11,%xmm11 - vpslld $5,%xmm12,%xmm8 - vpand %xmm14,%xmm10,%xmm7 - vpxor 224-128(%rax),%xmm4,%xmm4 - - vpaddd %xmm7,%xmm11,%xmm11 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm14,%xmm10,%xmm6 - vpxor %xmm1,%xmm4,%xmm4 - - vmovdqu %xmm3,80-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm4,%xmm5 - vpand %xmm13,%xmm6,%xmm6 - vpaddd %xmm4,%xmm4,%xmm4 - - vpslld $30,%xmm13,%xmm7 - vpaddd %xmm6,%xmm11,%xmm11 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpor %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpxor %xmm2,%xmm0,%xmm0 - vmovdqa 144-128(%rax),%xmm2 - - vpaddd %xmm15,%xmm10,%xmm10 - vpslld $5,%xmm11,%xmm8 - vpand %xmm13,%xmm14,%xmm7 - vpxor 240-128(%rax),%xmm0,%xmm0 - - vpaddd %xmm7,%xmm10,%xmm10 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm13,%xmm14,%xmm6 - vpxor %xmm2,%xmm0,%xmm0 - - vmovdqu %xmm4,96-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm0,%xmm5 - vpand %xmm12,%xmm6,%xmm6 - vpaddd %xmm0,%xmm0,%xmm0 - - vpslld $30,%xmm12,%xmm7 - vpaddd %xmm6,%xmm10,%xmm10 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpor %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vpxor %xmm3,%xmm1,%xmm1 - vmovdqa 160-128(%rax),%xmm3 - - vpaddd %xmm15,%xmm14,%xmm14 - vpslld $5,%xmm10,%xmm8 - vpand %xmm12,%xmm13,%xmm7 - vpxor 0-128(%rax),%xmm1,%xmm1 - - vpaddd %xmm7,%xmm14,%xmm14 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm12,%xmm13,%xmm6 - vpxor %xmm3,%xmm1,%xmm1 - - vmovdqu %xmm0,112-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm1,%xmm5 - vpand %xmm11,%xmm6,%xmm6 - vpaddd %xmm1,%xmm1,%xmm1 - - vpslld $30,%xmm11,%xmm7 - vpaddd %xmm6,%xmm14,%xmm14 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpor %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpxor %xmm4,%xmm2,%xmm2 - vmovdqa 176-128(%rax),%xmm4 - - vpaddd %xmm15,%xmm13,%xmm13 - vpslld $5,%xmm14,%xmm8 - vpand %xmm11,%xmm12,%xmm7 - vpxor 16-128(%rax),%xmm2,%xmm2 - - vpaddd %xmm7,%xmm13,%xmm13 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm11,%xmm12,%xmm6 - vpxor %xmm4,%xmm2,%xmm2 - - vmovdqu %xmm1,128-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm2,%xmm5 - vpand %xmm10,%xmm6,%xmm6 - vpaddd %xmm2,%xmm2,%xmm2 - - vpslld $30,%xmm10,%xmm7 - vpaddd %xmm6,%xmm13,%xmm13 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpor %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpxor %xmm0,%xmm3,%xmm3 - vmovdqa 192-128(%rax),%xmm0 - - vpaddd %xmm15,%xmm12,%xmm12 - vpslld $5,%xmm13,%xmm8 - vpand %xmm10,%xmm11,%xmm7 - vpxor 32-128(%rax),%xmm3,%xmm3 - - vpaddd %xmm7,%xmm12,%xmm12 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm10,%xmm11,%xmm6 - vpxor %xmm0,%xmm3,%xmm3 - - vmovdqu %xmm2,144-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm3,%xmm5 - vpand %xmm14,%xmm6,%xmm6 - vpaddd %xmm3,%xmm3,%xmm3 - - vpslld $30,%xmm14,%xmm7 - vpaddd %xmm6,%xmm12,%xmm12 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpor %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqa 208-128(%rax),%xmm1 - - vpaddd %xmm15,%xmm11,%xmm11 - vpslld $5,%xmm12,%xmm8 - vpand %xmm14,%xmm10,%xmm7 - vpxor 48-128(%rax),%xmm4,%xmm4 - - vpaddd %xmm7,%xmm11,%xmm11 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm14,%xmm10,%xmm6 - vpxor %xmm1,%xmm4,%xmm4 - - vmovdqu %xmm3,160-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm4,%xmm5 - vpand %xmm13,%xmm6,%xmm6 - vpaddd %xmm4,%xmm4,%xmm4 - - vpslld $30,%xmm13,%xmm7 - vpaddd %xmm6,%xmm11,%xmm11 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpor %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpxor %xmm2,%xmm0,%xmm0 - vmovdqa 224-128(%rax),%xmm2 - - vpaddd %xmm15,%xmm10,%xmm10 - vpslld $5,%xmm11,%xmm8 - vpand %xmm13,%xmm14,%xmm7 - vpxor 64-128(%rax),%xmm0,%xmm0 - - vpaddd %xmm7,%xmm10,%xmm10 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm13,%xmm14,%xmm6 - vpxor %xmm2,%xmm0,%xmm0 - - vmovdqu %xmm4,176-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpor %xmm9,%xmm8,%xmm8 - vpsrld $31,%xmm0,%xmm5 - vpand %xmm12,%xmm6,%xmm6 - vpaddd %xmm0,%xmm0,%xmm0 - - vpslld $30,%xmm12,%xmm7 - vpaddd %xmm6,%xmm10,%xmm10 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpor %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vmovdqa 64(%rbp),%xmm15 - vpxor %xmm3,%xmm1,%xmm1 - vmovdqa 240-128(%rax),%xmm3 - - vpslld $5,%xmm10,%xmm8 - vpaddd %xmm15,%xmm14,%xmm14 - vpxor %xmm11,%xmm13,%xmm6 - vmovdqa %xmm0,192-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpxor 80-128(%rax),%xmm1,%xmm1 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm12,%xmm6,%xmm6 - vpxor %xmm3,%xmm1,%xmm1 - - vpslld $30,%xmm11,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm14,%xmm14 - vpsrld $31,%xmm1,%xmm5 - vpaddd %xmm1,%xmm1,%xmm1 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpor %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpxor %xmm4,%xmm2,%xmm2 - vmovdqa 0-128(%rax),%xmm4 - - vpslld $5,%xmm14,%xmm8 - vpaddd %xmm15,%xmm13,%xmm13 - vpxor %xmm10,%xmm12,%xmm6 - vmovdqa %xmm1,208-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpxor 96-128(%rax),%xmm2,%xmm2 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm11,%xmm6,%xmm6 - vpxor %xmm4,%xmm2,%xmm2 - - vpslld $30,%xmm10,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm13,%xmm13 - vpsrld $31,%xmm2,%xmm5 - vpaddd %xmm2,%xmm2,%xmm2 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpor %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpxor %xmm0,%xmm3,%xmm3 - vmovdqa 16-128(%rax),%xmm0 - - vpslld $5,%xmm13,%xmm8 - vpaddd %xmm15,%xmm12,%xmm12 - vpxor %xmm14,%xmm11,%xmm6 - vmovdqa %xmm2,224-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpxor 112-128(%rax),%xmm3,%xmm3 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm10,%xmm6,%xmm6 - vpxor %xmm0,%xmm3,%xmm3 - - vpslld $30,%xmm14,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm12,%xmm12 - vpsrld $31,%xmm3,%xmm5 - vpaddd %xmm3,%xmm3,%xmm3 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpor %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqa 32-128(%rax),%xmm1 - - vpslld $5,%xmm12,%xmm8 - vpaddd %xmm15,%xmm11,%xmm11 - vpxor %xmm13,%xmm10,%xmm6 - vmovdqa %xmm3,240-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpxor 128-128(%rax),%xmm4,%xmm4 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm14,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm4 - - vpslld $30,%xmm13,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm11,%xmm11 - vpsrld $31,%xmm4,%xmm5 - vpaddd %xmm4,%xmm4,%xmm4 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpor %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpxor %xmm2,%xmm0,%xmm0 - vmovdqa 48-128(%rax),%xmm2 - - vpslld $5,%xmm11,%xmm8 - vpaddd %xmm15,%xmm10,%xmm10 - vpxor %xmm12,%xmm14,%xmm6 - vmovdqa %xmm4,0-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpxor 144-128(%rax),%xmm0,%xmm0 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm13,%xmm6,%xmm6 - vpxor %xmm2,%xmm0,%xmm0 - - vpslld $30,%xmm12,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm10,%xmm10 - vpsrld $31,%xmm0,%xmm5 - vpaddd %xmm0,%xmm0,%xmm0 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpor %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vpxor %xmm3,%xmm1,%xmm1 - vmovdqa 64-128(%rax),%xmm3 - - vpslld $5,%xmm10,%xmm8 - vpaddd %xmm15,%xmm14,%xmm14 - vpxor %xmm11,%xmm13,%xmm6 - vmovdqa %xmm0,16-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpxor 160-128(%rax),%xmm1,%xmm1 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm12,%xmm6,%xmm6 - vpxor %xmm3,%xmm1,%xmm1 - - vpslld $30,%xmm11,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm14,%xmm14 - vpsrld $31,%xmm1,%xmm5 - vpaddd %xmm1,%xmm1,%xmm1 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpor %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpxor %xmm4,%xmm2,%xmm2 - vmovdqa 80-128(%rax),%xmm4 - - vpslld $5,%xmm14,%xmm8 - vpaddd %xmm15,%xmm13,%xmm13 - vpxor %xmm10,%xmm12,%xmm6 - vmovdqa %xmm1,32-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpxor 176-128(%rax),%xmm2,%xmm2 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm11,%xmm6,%xmm6 - vpxor %xmm4,%xmm2,%xmm2 - - vpslld $30,%xmm10,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm13,%xmm13 - vpsrld $31,%xmm2,%xmm5 - vpaddd %xmm2,%xmm2,%xmm2 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpor %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpxor %xmm0,%xmm3,%xmm3 - vmovdqa 96-128(%rax),%xmm0 - - vpslld $5,%xmm13,%xmm8 - vpaddd %xmm15,%xmm12,%xmm12 - vpxor %xmm14,%xmm11,%xmm6 - vmovdqa %xmm2,48-128(%rax) - vpaddd %xmm2,%xmm12,%xmm12 - vpxor 192-128(%rax),%xmm3,%xmm3 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm10,%xmm6,%xmm6 - vpxor %xmm0,%xmm3,%xmm3 - - vpslld $30,%xmm14,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm12,%xmm12 - vpsrld $31,%xmm3,%xmm5 - vpaddd %xmm3,%xmm3,%xmm3 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpor %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqa 112-128(%rax),%xmm1 - - vpslld $5,%xmm12,%xmm8 - vpaddd %xmm15,%xmm11,%xmm11 - vpxor %xmm13,%xmm10,%xmm6 - vmovdqa %xmm3,64-128(%rax) - vpaddd %xmm3,%xmm11,%xmm11 - vpxor 208-128(%rax),%xmm4,%xmm4 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm14,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm4 - - vpslld $30,%xmm13,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm11,%xmm11 - vpsrld $31,%xmm4,%xmm5 - vpaddd %xmm4,%xmm4,%xmm4 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpor %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpxor %xmm2,%xmm0,%xmm0 - vmovdqa 128-128(%rax),%xmm2 - - vpslld $5,%xmm11,%xmm8 - vpaddd %xmm15,%xmm10,%xmm10 - vpxor %xmm12,%xmm14,%xmm6 - vmovdqa %xmm4,80-128(%rax) - vpaddd %xmm4,%xmm10,%xmm10 - vpxor 224-128(%rax),%xmm0,%xmm0 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm13,%xmm6,%xmm6 - vpxor %xmm2,%xmm0,%xmm0 - - vpslld $30,%xmm12,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm10,%xmm10 - vpsrld $31,%xmm0,%xmm5 - vpaddd %xmm0,%xmm0,%xmm0 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpor %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vpxor %xmm3,%xmm1,%xmm1 - vmovdqa 144-128(%rax),%xmm3 - - vpslld $5,%xmm10,%xmm8 - vpaddd %xmm15,%xmm14,%xmm14 - vpxor %xmm11,%xmm13,%xmm6 - vmovdqa %xmm0,96-128(%rax) - vpaddd %xmm0,%xmm14,%xmm14 - vpxor 240-128(%rax),%xmm1,%xmm1 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm12,%xmm6,%xmm6 - vpxor %xmm3,%xmm1,%xmm1 - - vpslld $30,%xmm11,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm14,%xmm14 - vpsrld $31,%xmm1,%xmm5 - vpaddd %xmm1,%xmm1,%xmm1 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpor %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpxor %xmm4,%xmm2,%xmm2 - vmovdqa 160-128(%rax),%xmm4 - - vpslld $5,%xmm14,%xmm8 - vpaddd %xmm15,%xmm13,%xmm13 - vpxor %xmm10,%xmm12,%xmm6 - vmovdqa %xmm1,112-128(%rax) - vpaddd %xmm1,%xmm13,%xmm13 - vpxor 0-128(%rax),%xmm2,%xmm2 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm11,%xmm6,%xmm6 - vpxor %xmm4,%xmm2,%xmm2 - - vpslld $30,%xmm10,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm13,%xmm13 - vpsrld $31,%xmm2,%xmm5 - vpaddd %xmm2,%xmm2,%xmm2 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpor %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpxor %xmm0,%xmm3,%xmm3 - vmovdqa 176-128(%rax),%xmm0 - - vpslld $5,%xmm13,%xmm8 - vpaddd %xmm15,%xmm12,%xmm12 - vpxor %xmm14,%xmm11,%xmm6 - vpaddd %xmm2,%xmm12,%xmm12 - vpxor 16-128(%rax),%xmm3,%xmm3 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm10,%xmm6,%xmm6 - vpxor %xmm0,%xmm3,%xmm3 - - vpslld $30,%xmm14,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm12,%xmm12 - vpsrld $31,%xmm3,%xmm5 - vpaddd %xmm3,%xmm3,%xmm3 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpor %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqa 192-128(%rax),%xmm1 - - vpslld $5,%xmm12,%xmm8 - vpaddd %xmm15,%xmm11,%xmm11 - vpxor %xmm13,%xmm10,%xmm6 - vpaddd %xmm3,%xmm11,%xmm11 - vpxor 32-128(%rax),%xmm4,%xmm4 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm14,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm4 - - vpslld $30,%xmm13,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm11,%xmm11 - vpsrld $31,%xmm4,%xmm5 - vpaddd %xmm4,%xmm4,%xmm4 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpor %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpxor %xmm2,%xmm0,%xmm0 - vmovdqa 208-128(%rax),%xmm2 - - vpslld $5,%xmm11,%xmm8 - vpaddd %xmm15,%xmm10,%xmm10 - vpxor %xmm12,%xmm14,%xmm6 - vpaddd %xmm4,%xmm10,%xmm10 - vpxor 48-128(%rax),%xmm0,%xmm0 - vpsrld $27,%xmm11,%xmm9 - vpxor %xmm13,%xmm6,%xmm6 - vpxor %xmm2,%xmm0,%xmm0 - - vpslld $30,%xmm12,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm10,%xmm10 - vpsrld $31,%xmm0,%xmm5 - vpaddd %xmm0,%xmm0,%xmm0 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpor %xmm5,%xmm0,%xmm0 - vpor %xmm7,%xmm12,%xmm12 - vpxor %xmm3,%xmm1,%xmm1 - vmovdqa 224-128(%rax),%xmm3 - - vpslld $5,%xmm10,%xmm8 - vpaddd %xmm15,%xmm14,%xmm14 - vpxor %xmm11,%xmm13,%xmm6 - vpaddd %xmm0,%xmm14,%xmm14 - vpxor 64-128(%rax),%xmm1,%xmm1 - vpsrld $27,%xmm10,%xmm9 - vpxor %xmm12,%xmm6,%xmm6 - vpxor %xmm3,%xmm1,%xmm1 - - vpslld $30,%xmm11,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm14,%xmm14 - vpsrld $31,%xmm1,%xmm5 - vpaddd %xmm1,%xmm1,%xmm1 - - vpsrld $2,%xmm11,%xmm11 - vpaddd %xmm8,%xmm14,%xmm14 - vpor %xmm5,%xmm1,%xmm1 - vpor %xmm7,%xmm11,%xmm11 - vpxor %xmm4,%xmm2,%xmm2 - vmovdqa 240-128(%rax),%xmm4 - - vpslld $5,%xmm14,%xmm8 - vpaddd %xmm15,%xmm13,%xmm13 - vpxor %xmm10,%xmm12,%xmm6 - vpaddd %xmm1,%xmm13,%xmm13 - vpxor 80-128(%rax),%xmm2,%xmm2 - vpsrld $27,%xmm14,%xmm9 - vpxor %xmm11,%xmm6,%xmm6 - vpxor %xmm4,%xmm2,%xmm2 - - vpslld $30,%xmm10,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm13,%xmm13 - vpsrld $31,%xmm2,%xmm5 - vpaddd %xmm2,%xmm2,%xmm2 - - vpsrld $2,%xmm10,%xmm10 - vpaddd %xmm8,%xmm13,%xmm13 - vpor %xmm5,%xmm2,%xmm2 - vpor %xmm7,%xmm10,%xmm10 - vpxor %xmm0,%xmm3,%xmm3 - vmovdqa 0-128(%rax),%xmm0 - - vpslld $5,%xmm13,%xmm8 - vpaddd %xmm15,%xmm12,%xmm12 - vpxor %xmm14,%xmm11,%xmm6 - vpaddd %xmm2,%xmm12,%xmm12 - vpxor 96-128(%rax),%xmm3,%xmm3 - vpsrld $27,%xmm13,%xmm9 - vpxor %xmm10,%xmm6,%xmm6 - vpxor %xmm0,%xmm3,%xmm3 - - vpslld $30,%xmm14,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm12,%xmm12 - vpsrld $31,%xmm3,%xmm5 - vpaddd %xmm3,%xmm3,%xmm3 - - vpsrld $2,%xmm14,%xmm14 - vpaddd %xmm8,%xmm12,%xmm12 - vpor %xmm5,%xmm3,%xmm3 - vpor %xmm7,%xmm14,%xmm14 - vpxor %xmm1,%xmm4,%xmm4 - vmovdqa 16-128(%rax),%xmm1 - - vpslld $5,%xmm12,%xmm8 - vpaddd %xmm15,%xmm11,%xmm11 - vpxor %xmm13,%xmm10,%xmm6 - vpaddd %xmm3,%xmm11,%xmm11 - vpxor 112-128(%rax),%xmm4,%xmm4 - vpsrld $27,%xmm12,%xmm9 - vpxor %xmm14,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm4 - - vpslld $30,%xmm13,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm11,%xmm11 - vpsrld $31,%xmm4,%xmm5 - vpaddd %xmm4,%xmm4,%xmm4 - - vpsrld $2,%xmm13,%xmm13 - vpaddd %xmm8,%xmm11,%xmm11 - vpor %xmm5,%xmm4,%xmm4 - vpor %xmm7,%xmm13,%xmm13 - vpslld $5,%xmm11,%xmm8 - vpaddd %xmm15,%xmm10,%xmm10 - vpxor %xmm12,%xmm14,%xmm6 - - vpsrld $27,%xmm11,%xmm9 - vpaddd %xmm4,%xmm10,%xmm10 - vpxor %xmm13,%xmm6,%xmm6 - - vpslld $30,%xmm12,%xmm7 - vpor %xmm9,%xmm8,%xmm8 - vpaddd %xmm6,%xmm10,%xmm10 - - vpsrld $2,%xmm12,%xmm12 - vpaddd %xmm8,%xmm10,%xmm10 - vpor %xmm7,%xmm12,%xmm12 - movl $1,%ecx - cmpl 0(%rbx),%ecx - cmovgeq %rbp,%r8 - cmpl 4(%rbx),%ecx - cmovgeq %rbp,%r9 - cmpl 8(%rbx),%ecx - cmovgeq %rbp,%r10 - cmpl 12(%rbx),%ecx - cmovgeq %rbp,%r11 - vmovdqu (%rbx),%xmm6 - vpxor %xmm8,%xmm8,%xmm8 - vmovdqa %xmm6,%xmm7 - vpcmpgtd %xmm8,%xmm7,%xmm7 - vpaddd %xmm7,%xmm6,%xmm6 - - vpand %xmm7,%xmm10,%xmm10 - vpand %xmm7,%xmm11,%xmm11 - vpaddd 0(%rdi),%xmm10,%xmm10 - vpand %xmm7,%xmm12,%xmm12 - vpaddd 32(%rdi),%xmm11,%xmm11 - vpand %xmm7,%xmm13,%xmm13 - vpaddd 64(%rdi),%xmm12,%xmm12 - vpand %xmm7,%xmm14,%xmm14 - vpaddd 96(%rdi),%xmm13,%xmm13 - vpaddd 128(%rdi),%xmm14,%xmm14 - vmovdqu %xmm10,0(%rdi) - vmovdqu %xmm11,32(%rdi) - vmovdqu %xmm12,64(%rdi) - vmovdqu %xmm13,96(%rdi) - vmovdqu %xmm14,128(%rdi) - - vmovdqu %xmm6,(%rbx) - vmovdqu 96(%rbp),%xmm5 - decl %edx - jnz L$oop_avx - - movl 280(%rsp),%edx - leaq 16(%rdi),%rdi - leaq 64(%rsi),%rsi - decl %edx - jnz L$oop_grande_avx - -L$done_avx: - movq 272(%rsp),%rax - vzeroupper - movq -16(%rax),%rbp - movq -8(%rax),%rbx - leaq (%rax),%rsp -L$epilogue_avx: - .byte 0xf3,0xc3 - - -.p2align 5 -sha1_multi_block_avx2: -_avx2_shortcut: - movq %rsp,%rax - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - subq $576,%rsp - andq $-256,%rsp - movq %rax,544(%rsp) -L$body_avx2: - leaq K_XX_XX(%rip),%rbp - shrl $1,%edx - - vzeroupper -L$oop_grande_avx2: - movl %edx,552(%rsp) - xorl %edx,%edx - leaq 512(%rsp),%rbx - movq 0(%rsi),%r12 - movl 8(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,0(%rbx) - cmovleq %rbp,%r12 - movq 16(%rsi),%r13 - movl 24(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,4(%rbx) - cmovleq %rbp,%r13 - movq 32(%rsi),%r14 - movl 40(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,8(%rbx) - cmovleq %rbp,%r14 - movq 48(%rsi),%r15 - movl 56(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,12(%rbx) - cmovleq %rbp,%r15 - movq 64(%rsi),%r8 - movl 72(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,16(%rbx) - cmovleq %rbp,%r8 - movq 80(%rsi),%r9 - movl 88(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,20(%rbx) - cmovleq %rbp,%r9 - movq 96(%rsi),%r10 - movl 104(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,24(%rbx) - cmovleq %rbp,%r10 - movq 112(%rsi),%r11 - movl 120(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,28(%rbx) - cmovleq %rbp,%r11 - vmovdqu 0(%rdi),%ymm0 - leaq 128(%rsp),%rax - vmovdqu 32(%rdi),%ymm1 - leaq 256+128(%rsp),%rbx - vmovdqu 64(%rdi),%ymm2 - vmovdqu 96(%rdi),%ymm3 - vmovdqu 128(%rdi),%ymm4 - vmovdqu 96(%rbp),%ymm9 - jmp L$oop_avx2 - -.p2align 5 -L$oop_avx2: - vmovdqa -32(%rbp),%ymm15 - vmovd (%r12),%xmm10 - leaq 64(%r12),%r12 - vmovd (%r8),%xmm12 - leaq 64(%r8),%r8 - vmovd (%r13),%xmm7 - leaq 64(%r13),%r13 - vmovd (%r9),%xmm6 - leaq 64(%r9),%r9 - vpinsrd $1,(%r14),%xmm10,%xmm10 - leaq 64(%r14),%r14 - vpinsrd $1,(%r10),%xmm12,%xmm12 - leaq 64(%r10),%r10 - vpinsrd $1,(%r15),%xmm7,%xmm7 - leaq 64(%r15),%r15 - vpunpckldq %ymm7,%ymm10,%ymm10 - vpinsrd $1,(%r11),%xmm6,%xmm6 - leaq 64(%r11),%r11 - vpunpckldq %ymm6,%ymm12,%ymm12 - vmovd -60(%r12),%xmm11 - vinserti128 $1,%xmm12,%ymm10,%ymm10 - vmovd -60(%r8),%xmm8 - vpshufb %ymm9,%ymm10,%ymm10 - vmovd -60(%r13),%xmm7 - vmovd -60(%r9),%xmm6 - vpinsrd $1,-60(%r14),%xmm11,%xmm11 - vpinsrd $1,-60(%r10),%xmm8,%xmm8 - vpinsrd $1,-60(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm11,%ymm11 - vpinsrd $1,-60(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm4,%ymm4 - vpslld $5,%ymm0,%ymm7 - vpandn %ymm3,%ymm1,%ymm6 - vpand %ymm2,%ymm1,%ymm5 - - vmovdqa %ymm10,0-128(%rax) - vpaddd %ymm10,%ymm4,%ymm4 - vinserti128 $1,%xmm8,%ymm11,%ymm11 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -56(%r12),%xmm12 - - vpslld $30,%ymm1,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -56(%r8),%xmm8 - vpaddd %ymm5,%ymm4,%ymm4 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpshufb %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vmovd -56(%r13),%xmm7 - vmovd -56(%r9),%xmm6 - vpinsrd $1,-56(%r14),%xmm12,%xmm12 - vpinsrd $1,-56(%r10),%xmm8,%xmm8 - vpinsrd $1,-56(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm12,%ymm12 - vpinsrd $1,-56(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm3,%ymm3 - vpslld $5,%ymm4,%ymm7 - vpandn %ymm2,%ymm0,%ymm6 - vpand %ymm1,%ymm0,%ymm5 - - vmovdqa %ymm11,32-128(%rax) - vpaddd %ymm11,%ymm3,%ymm3 - vinserti128 $1,%xmm8,%ymm12,%ymm12 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -52(%r12),%xmm13 - - vpslld $30,%ymm0,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -52(%r8),%xmm8 - vpaddd %ymm5,%ymm3,%ymm3 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpshufb %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vmovd -52(%r13),%xmm7 - vmovd -52(%r9),%xmm6 - vpinsrd $1,-52(%r14),%xmm13,%xmm13 - vpinsrd $1,-52(%r10),%xmm8,%xmm8 - vpinsrd $1,-52(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm13,%ymm13 - vpinsrd $1,-52(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm2,%ymm2 - vpslld $5,%ymm3,%ymm7 - vpandn %ymm1,%ymm4,%ymm6 - vpand %ymm0,%ymm4,%ymm5 - - vmovdqa %ymm12,64-128(%rax) - vpaddd %ymm12,%ymm2,%ymm2 - vinserti128 $1,%xmm8,%ymm13,%ymm13 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -48(%r12),%xmm14 - - vpslld $30,%ymm4,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -48(%r8),%xmm8 - vpaddd %ymm5,%ymm2,%ymm2 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpshufb %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vmovd -48(%r13),%xmm7 - vmovd -48(%r9),%xmm6 - vpinsrd $1,-48(%r14),%xmm14,%xmm14 - vpinsrd $1,-48(%r10),%xmm8,%xmm8 - vpinsrd $1,-48(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm14,%ymm14 - vpinsrd $1,-48(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm1,%ymm1 - vpslld $5,%ymm2,%ymm7 - vpandn %ymm0,%ymm3,%ymm6 - vpand %ymm4,%ymm3,%ymm5 - - vmovdqa %ymm13,96-128(%rax) - vpaddd %ymm13,%ymm1,%ymm1 - vinserti128 $1,%xmm8,%ymm14,%ymm14 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -44(%r12),%xmm10 - - vpslld $30,%ymm3,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -44(%r8),%xmm8 - vpaddd %ymm5,%ymm1,%ymm1 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpshufb %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vmovd -44(%r13),%xmm7 - vmovd -44(%r9),%xmm6 - vpinsrd $1,-44(%r14),%xmm10,%xmm10 - vpinsrd $1,-44(%r10),%xmm8,%xmm8 - vpinsrd $1,-44(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm10,%ymm10 - vpinsrd $1,-44(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm0,%ymm0 - vpslld $5,%ymm1,%ymm7 - vpandn %ymm4,%ymm2,%ymm6 - vpand %ymm3,%ymm2,%ymm5 - - vmovdqa %ymm14,128-128(%rax) - vpaddd %ymm14,%ymm0,%ymm0 - vinserti128 $1,%xmm8,%ymm10,%ymm10 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -40(%r12),%xmm11 - - vpslld $30,%ymm2,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -40(%r8),%xmm8 - vpaddd %ymm5,%ymm0,%ymm0 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpshufb %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vmovd -40(%r13),%xmm7 - vmovd -40(%r9),%xmm6 - vpinsrd $1,-40(%r14),%xmm11,%xmm11 - vpinsrd $1,-40(%r10),%xmm8,%xmm8 - vpinsrd $1,-40(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm11,%ymm11 - vpinsrd $1,-40(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm4,%ymm4 - vpslld $5,%ymm0,%ymm7 - vpandn %ymm3,%ymm1,%ymm6 - vpand %ymm2,%ymm1,%ymm5 - - vmovdqa %ymm10,160-128(%rax) - vpaddd %ymm10,%ymm4,%ymm4 - vinserti128 $1,%xmm8,%ymm11,%ymm11 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -36(%r12),%xmm12 - - vpslld $30,%ymm1,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -36(%r8),%xmm8 - vpaddd %ymm5,%ymm4,%ymm4 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpshufb %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vmovd -36(%r13),%xmm7 - vmovd -36(%r9),%xmm6 - vpinsrd $1,-36(%r14),%xmm12,%xmm12 - vpinsrd $1,-36(%r10),%xmm8,%xmm8 - vpinsrd $1,-36(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm12,%ymm12 - vpinsrd $1,-36(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm3,%ymm3 - vpslld $5,%ymm4,%ymm7 - vpandn %ymm2,%ymm0,%ymm6 - vpand %ymm1,%ymm0,%ymm5 - - vmovdqa %ymm11,192-128(%rax) - vpaddd %ymm11,%ymm3,%ymm3 - vinserti128 $1,%xmm8,%ymm12,%ymm12 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -32(%r12),%xmm13 - - vpslld $30,%ymm0,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -32(%r8),%xmm8 - vpaddd %ymm5,%ymm3,%ymm3 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpshufb %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vmovd -32(%r13),%xmm7 - vmovd -32(%r9),%xmm6 - vpinsrd $1,-32(%r14),%xmm13,%xmm13 - vpinsrd $1,-32(%r10),%xmm8,%xmm8 - vpinsrd $1,-32(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm13,%ymm13 - vpinsrd $1,-32(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm2,%ymm2 - vpslld $5,%ymm3,%ymm7 - vpandn %ymm1,%ymm4,%ymm6 - vpand %ymm0,%ymm4,%ymm5 - - vmovdqa %ymm12,224-128(%rax) - vpaddd %ymm12,%ymm2,%ymm2 - vinserti128 $1,%xmm8,%ymm13,%ymm13 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -28(%r12),%xmm14 - - vpslld $30,%ymm4,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -28(%r8),%xmm8 - vpaddd %ymm5,%ymm2,%ymm2 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpshufb %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vmovd -28(%r13),%xmm7 - vmovd -28(%r9),%xmm6 - vpinsrd $1,-28(%r14),%xmm14,%xmm14 - vpinsrd $1,-28(%r10),%xmm8,%xmm8 - vpinsrd $1,-28(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm14,%ymm14 - vpinsrd $1,-28(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm1,%ymm1 - vpslld $5,%ymm2,%ymm7 - vpandn %ymm0,%ymm3,%ymm6 - vpand %ymm4,%ymm3,%ymm5 - - vmovdqa %ymm13,256-256-128(%rbx) - vpaddd %ymm13,%ymm1,%ymm1 - vinserti128 $1,%xmm8,%ymm14,%ymm14 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -24(%r12),%xmm10 - - vpslld $30,%ymm3,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -24(%r8),%xmm8 - vpaddd %ymm5,%ymm1,%ymm1 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpshufb %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vmovd -24(%r13),%xmm7 - vmovd -24(%r9),%xmm6 - vpinsrd $1,-24(%r14),%xmm10,%xmm10 - vpinsrd $1,-24(%r10),%xmm8,%xmm8 - vpinsrd $1,-24(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm10,%ymm10 - vpinsrd $1,-24(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm0,%ymm0 - vpslld $5,%ymm1,%ymm7 - vpandn %ymm4,%ymm2,%ymm6 - vpand %ymm3,%ymm2,%ymm5 - - vmovdqa %ymm14,288-256-128(%rbx) - vpaddd %ymm14,%ymm0,%ymm0 - vinserti128 $1,%xmm8,%ymm10,%ymm10 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -20(%r12),%xmm11 - - vpslld $30,%ymm2,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -20(%r8),%xmm8 - vpaddd %ymm5,%ymm0,%ymm0 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpshufb %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vmovd -20(%r13),%xmm7 - vmovd -20(%r9),%xmm6 - vpinsrd $1,-20(%r14),%xmm11,%xmm11 - vpinsrd $1,-20(%r10),%xmm8,%xmm8 - vpinsrd $1,-20(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm11,%ymm11 - vpinsrd $1,-20(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm4,%ymm4 - vpslld $5,%ymm0,%ymm7 - vpandn %ymm3,%ymm1,%ymm6 - vpand %ymm2,%ymm1,%ymm5 - - vmovdqa %ymm10,320-256-128(%rbx) - vpaddd %ymm10,%ymm4,%ymm4 - vinserti128 $1,%xmm8,%ymm11,%ymm11 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -16(%r12),%xmm12 - - vpslld $30,%ymm1,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -16(%r8),%xmm8 - vpaddd %ymm5,%ymm4,%ymm4 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpshufb %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vmovd -16(%r13),%xmm7 - vmovd -16(%r9),%xmm6 - vpinsrd $1,-16(%r14),%xmm12,%xmm12 - vpinsrd $1,-16(%r10),%xmm8,%xmm8 - vpinsrd $1,-16(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm12,%ymm12 - vpinsrd $1,-16(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm3,%ymm3 - vpslld $5,%ymm4,%ymm7 - vpandn %ymm2,%ymm0,%ymm6 - vpand %ymm1,%ymm0,%ymm5 - - vmovdqa %ymm11,352-256-128(%rbx) - vpaddd %ymm11,%ymm3,%ymm3 - vinserti128 $1,%xmm8,%ymm12,%ymm12 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -12(%r12),%xmm13 - - vpslld $30,%ymm0,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -12(%r8),%xmm8 - vpaddd %ymm5,%ymm3,%ymm3 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpshufb %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vmovd -12(%r13),%xmm7 - vmovd -12(%r9),%xmm6 - vpinsrd $1,-12(%r14),%xmm13,%xmm13 - vpinsrd $1,-12(%r10),%xmm8,%xmm8 - vpinsrd $1,-12(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm13,%ymm13 - vpinsrd $1,-12(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm2,%ymm2 - vpslld $5,%ymm3,%ymm7 - vpandn %ymm1,%ymm4,%ymm6 - vpand %ymm0,%ymm4,%ymm5 - - vmovdqa %ymm12,384-256-128(%rbx) - vpaddd %ymm12,%ymm2,%ymm2 - vinserti128 $1,%xmm8,%ymm13,%ymm13 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -8(%r12),%xmm14 - - vpslld $30,%ymm4,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -8(%r8),%xmm8 - vpaddd %ymm5,%ymm2,%ymm2 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpshufb %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vmovd -8(%r13),%xmm7 - vmovd -8(%r9),%xmm6 - vpinsrd $1,-8(%r14),%xmm14,%xmm14 - vpinsrd $1,-8(%r10),%xmm8,%xmm8 - vpinsrd $1,-8(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm14,%ymm14 - vpinsrd $1,-8(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm1,%ymm1 - vpslld $5,%ymm2,%ymm7 - vpandn %ymm0,%ymm3,%ymm6 - vpand %ymm4,%ymm3,%ymm5 - - vmovdqa %ymm13,416-256-128(%rbx) - vpaddd %ymm13,%ymm1,%ymm1 - vinserti128 $1,%xmm8,%ymm14,%ymm14 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vmovd -4(%r12),%xmm10 - - vpslld $30,%ymm3,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vmovd -4(%r8),%xmm8 - vpaddd %ymm5,%ymm1,%ymm1 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpshufb %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vmovdqa 0-128(%rax),%ymm11 - vmovd -4(%r13),%xmm7 - vmovd -4(%r9),%xmm6 - vpinsrd $1,-4(%r14),%xmm10,%xmm10 - vpinsrd $1,-4(%r10),%xmm8,%xmm8 - vpinsrd $1,-4(%r15),%xmm7,%xmm7 - vpunpckldq %ymm7,%ymm10,%ymm10 - vpinsrd $1,-4(%r11),%xmm6,%xmm6 - vpunpckldq %ymm6,%ymm8,%ymm8 - vpaddd %ymm15,%ymm0,%ymm0 - prefetcht0 63(%r12) - vpslld $5,%ymm1,%ymm7 - vpandn %ymm4,%ymm2,%ymm6 - vpand %ymm3,%ymm2,%ymm5 - - vmovdqa %ymm14,448-256-128(%rbx) - vpaddd %ymm14,%ymm0,%ymm0 - vinserti128 $1,%xmm8,%ymm10,%ymm10 - vpsrld $27,%ymm1,%ymm8 - prefetcht0 63(%r13) - vpxor %ymm6,%ymm5,%ymm5 - - vpslld $30,%ymm2,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - prefetcht0 63(%r14) - vpaddd %ymm5,%ymm0,%ymm0 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - prefetcht0 63(%r15) - vpshufb %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vmovdqa 32-128(%rax),%ymm12 - vpxor %ymm13,%ymm11,%ymm11 - vmovdqa 64-128(%rax),%ymm13 - - vpaddd %ymm15,%ymm4,%ymm4 - vpslld $5,%ymm0,%ymm7 - vpandn %ymm3,%ymm1,%ymm6 - prefetcht0 63(%r8) - vpand %ymm2,%ymm1,%ymm5 - - vmovdqa %ymm10,480-256-128(%rbx) - vpaddd %ymm10,%ymm4,%ymm4 - vpxor 256-256-128(%rbx),%ymm11,%ymm11 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vpxor %ymm13,%ymm11,%ymm11 - prefetcht0 63(%r9) - - vpslld $30,%ymm1,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm4,%ymm4 - prefetcht0 63(%r10) - vpsrld $31,%ymm11,%ymm9 - vpaddd %ymm11,%ymm11,%ymm11 - - vpsrld $2,%ymm1,%ymm1 - prefetcht0 63(%r11) - vpaddd %ymm7,%ymm4,%ymm4 - vpor %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vpxor %ymm14,%ymm12,%ymm12 - vmovdqa 96-128(%rax),%ymm14 - - vpaddd %ymm15,%ymm3,%ymm3 - vpslld $5,%ymm4,%ymm7 - vpandn %ymm2,%ymm0,%ymm6 - - vpand %ymm1,%ymm0,%ymm5 - - vmovdqa %ymm11,0-128(%rax) - vpaddd %ymm11,%ymm3,%ymm3 - vpxor 288-256-128(%rbx),%ymm12,%ymm12 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vpxor %ymm14,%ymm12,%ymm12 - - - vpslld $30,%ymm0,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm3,%ymm3 - - vpsrld $31,%ymm12,%ymm9 - vpaddd %ymm12,%ymm12,%ymm12 - - vpsrld $2,%ymm0,%ymm0 - - vpaddd %ymm7,%ymm3,%ymm3 - vpor %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vpxor %ymm10,%ymm13,%ymm13 - vmovdqa 128-128(%rax),%ymm10 - - vpaddd %ymm15,%ymm2,%ymm2 - vpslld $5,%ymm3,%ymm7 - vpandn %ymm1,%ymm4,%ymm6 - - vpand %ymm0,%ymm4,%ymm5 - - vmovdqa %ymm12,32-128(%rax) - vpaddd %ymm12,%ymm2,%ymm2 - vpxor 320-256-128(%rbx),%ymm13,%ymm13 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vpxor %ymm10,%ymm13,%ymm13 - - - vpslld $30,%ymm4,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm2,%ymm2 - - vpsrld $31,%ymm13,%ymm9 - vpaddd %ymm13,%ymm13,%ymm13 - - vpsrld $2,%ymm4,%ymm4 - - vpaddd %ymm7,%ymm2,%ymm2 - vpor %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vpxor %ymm11,%ymm14,%ymm14 - vmovdqa 160-128(%rax),%ymm11 - - vpaddd %ymm15,%ymm1,%ymm1 - vpslld $5,%ymm2,%ymm7 - vpandn %ymm0,%ymm3,%ymm6 - - vpand %ymm4,%ymm3,%ymm5 - - vmovdqa %ymm13,64-128(%rax) - vpaddd %ymm13,%ymm1,%ymm1 - vpxor 352-256-128(%rbx),%ymm14,%ymm14 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vpxor %ymm11,%ymm14,%ymm14 - - - vpslld $30,%ymm3,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm1,%ymm1 - - vpsrld $31,%ymm14,%ymm9 - vpaddd %ymm14,%ymm14,%ymm14 - - vpsrld $2,%ymm3,%ymm3 - - vpaddd %ymm7,%ymm1,%ymm1 - vpor %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vpxor %ymm12,%ymm10,%ymm10 - vmovdqa 192-128(%rax),%ymm12 - - vpaddd %ymm15,%ymm0,%ymm0 - vpslld $5,%ymm1,%ymm7 - vpandn %ymm4,%ymm2,%ymm6 - - vpand %ymm3,%ymm2,%ymm5 - - vmovdqa %ymm14,96-128(%rax) - vpaddd %ymm14,%ymm0,%ymm0 - vpxor 384-256-128(%rbx),%ymm10,%ymm10 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm6,%ymm5,%ymm5 - vpxor %ymm12,%ymm10,%ymm10 - - - vpslld $30,%ymm2,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm0,%ymm0 - - vpsrld $31,%ymm10,%ymm9 - vpaddd %ymm10,%ymm10,%ymm10 - - vpsrld $2,%ymm2,%ymm2 - - vpaddd %ymm7,%ymm0,%ymm0 - vpor %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vmovdqa 0(%rbp),%ymm15 - vpxor %ymm13,%ymm11,%ymm11 - vmovdqa 224-128(%rax),%ymm13 - - vpslld $5,%ymm0,%ymm7 - vpaddd %ymm15,%ymm4,%ymm4 - vpxor %ymm1,%ymm3,%ymm5 - vmovdqa %ymm10,128-128(%rax) - vpaddd %ymm10,%ymm4,%ymm4 - vpxor 416-256-128(%rbx),%ymm11,%ymm11 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm2,%ymm5,%ymm5 - vpxor %ymm13,%ymm11,%ymm11 - - vpslld $30,%ymm1,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm4,%ymm4 - vpsrld $31,%ymm11,%ymm9 - vpaddd %ymm11,%ymm11,%ymm11 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpor %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vpxor %ymm14,%ymm12,%ymm12 - vmovdqa 256-256-128(%rbx),%ymm14 - - vpslld $5,%ymm4,%ymm7 - vpaddd %ymm15,%ymm3,%ymm3 - vpxor %ymm0,%ymm2,%ymm5 - vmovdqa %ymm11,160-128(%rax) - vpaddd %ymm11,%ymm3,%ymm3 - vpxor 448-256-128(%rbx),%ymm12,%ymm12 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm1,%ymm5,%ymm5 - vpxor %ymm14,%ymm12,%ymm12 - - vpslld $30,%ymm0,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm3,%ymm3 - vpsrld $31,%ymm12,%ymm9 - vpaddd %ymm12,%ymm12,%ymm12 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpor %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vpxor %ymm10,%ymm13,%ymm13 - vmovdqa 288-256-128(%rbx),%ymm10 - - vpslld $5,%ymm3,%ymm7 - vpaddd %ymm15,%ymm2,%ymm2 - vpxor %ymm4,%ymm1,%ymm5 - vmovdqa %ymm12,192-128(%rax) - vpaddd %ymm12,%ymm2,%ymm2 - vpxor 480-256-128(%rbx),%ymm13,%ymm13 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm0,%ymm5,%ymm5 - vpxor %ymm10,%ymm13,%ymm13 - - vpslld $30,%ymm4,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm2,%ymm2 - vpsrld $31,%ymm13,%ymm9 - vpaddd %ymm13,%ymm13,%ymm13 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpor %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vpxor %ymm11,%ymm14,%ymm14 - vmovdqa 320-256-128(%rbx),%ymm11 - - vpslld $5,%ymm2,%ymm7 - vpaddd %ymm15,%ymm1,%ymm1 - vpxor %ymm3,%ymm0,%ymm5 - vmovdqa %ymm13,224-128(%rax) - vpaddd %ymm13,%ymm1,%ymm1 - vpxor 0-128(%rax),%ymm14,%ymm14 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm4,%ymm5,%ymm5 - vpxor %ymm11,%ymm14,%ymm14 - - vpslld $30,%ymm3,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm1,%ymm1 - vpsrld $31,%ymm14,%ymm9 - vpaddd %ymm14,%ymm14,%ymm14 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpor %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vpxor %ymm12,%ymm10,%ymm10 - vmovdqa 352-256-128(%rbx),%ymm12 - - vpslld $5,%ymm1,%ymm7 - vpaddd %ymm15,%ymm0,%ymm0 - vpxor %ymm2,%ymm4,%ymm5 - vmovdqa %ymm14,256-256-128(%rbx) - vpaddd %ymm14,%ymm0,%ymm0 - vpxor 32-128(%rax),%ymm10,%ymm10 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm3,%ymm5,%ymm5 - vpxor %ymm12,%ymm10,%ymm10 - - vpslld $30,%ymm2,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm0,%ymm0 - vpsrld $31,%ymm10,%ymm9 - vpaddd %ymm10,%ymm10,%ymm10 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpor %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vpxor %ymm13,%ymm11,%ymm11 - vmovdqa 384-256-128(%rbx),%ymm13 - - vpslld $5,%ymm0,%ymm7 - vpaddd %ymm15,%ymm4,%ymm4 - vpxor %ymm1,%ymm3,%ymm5 - vmovdqa %ymm10,288-256-128(%rbx) - vpaddd %ymm10,%ymm4,%ymm4 - vpxor 64-128(%rax),%ymm11,%ymm11 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm2,%ymm5,%ymm5 - vpxor %ymm13,%ymm11,%ymm11 - - vpslld $30,%ymm1,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm4,%ymm4 - vpsrld $31,%ymm11,%ymm9 - vpaddd %ymm11,%ymm11,%ymm11 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpor %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vpxor %ymm14,%ymm12,%ymm12 - vmovdqa 416-256-128(%rbx),%ymm14 - - vpslld $5,%ymm4,%ymm7 - vpaddd %ymm15,%ymm3,%ymm3 - vpxor %ymm0,%ymm2,%ymm5 - vmovdqa %ymm11,320-256-128(%rbx) - vpaddd %ymm11,%ymm3,%ymm3 - vpxor 96-128(%rax),%ymm12,%ymm12 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm1,%ymm5,%ymm5 - vpxor %ymm14,%ymm12,%ymm12 - - vpslld $30,%ymm0,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm3,%ymm3 - vpsrld $31,%ymm12,%ymm9 - vpaddd %ymm12,%ymm12,%ymm12 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpor %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vpxor %ymm10,%ymm13,%ymm13 - vmovdqa 448-256-128(%rbx),%ymm10 - - vpslld $5,%ymm3,%ymm7 - vpaddd %ymm15,%ymm2,%ymm2 - vpxor %ymm4,%ymm1,%ymm5 - vmovdqa %ymm12,352-256-128(%rbx) - vpaddd %ymm12,%ymm2,%ymm2 - vpxor 128-128(%rax),%ymm13,%ymm13 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm0,%ymm5,%ymm5 - vpxor %ymm10,%ymm13,%ymm13 - - vpslld $30,%ymm4,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm2,%ymm2 - vpsrld $31,%ymm13,%ymm9 - vpaddd %ymm13,%ymm13,%ymm13 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpor %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vpxor %ymm11,%ymm14,%ymm14 - vmovdqa 480-256-128(%rbx),%ymm11 - - vpslld $5,%ymm2,%ymm7 - vpaddd %ymm15,%ymm1,%ymm1 - vpxor %ymm3,%ymm0,%ymm5 - vmovdqa %ymm13,384-256-128(%rbx) - vpaddd %ymm13,%ymm1,%ymm1 - vpxor 160-128(%rax),%ymm14,%ymm14 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm4,%ymm5,%ymm5 - vpxor %ymm11,%ymm14,%ymm14 - - vpslld $30,%ymm3,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm1,%ymm1 - vpsrld $31,%ymm14,%ymm9 - vpaddd %ymm14,%ymm14,%ymm14 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpor %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vpxor %ymm12,%ymm10,%ymm10 - vmovdqa 0-128(%rax),%ymm12 - - vpslld $5,%ymm1,%ymm7 - vpaddd %ymm15,%ymm0,%ymm0 - vpxor %ymm2,%ymm4,%ymm5 - vmovdqa %ymm14,416-256-128(%rbx) - vpaddd %ymm14,%ymm0,%ymm0 - vpxor 192-128(%rax),%ymm10,%ymm10 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm3,%ymm5,%ymm5 - vpxor %ymm12,%ymm10,%ymm10 - - vpslld $30,%ymm2,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm0,%ymm0 - vpsrld $31,%ymm10,%ymm9 - vpaddd %ymm10,%ymm10,%ymm10 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpor %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vpxor %ymm13,%ymm11,%ymm11 - vmovdqa 32-128(%rax),%ymm13 - - vpslld $5,%ymm0,%ymm7 - vpaddd %ymm15,%ymm4,%ymm4 - vpxor %ymm1,%ymm3,%ymm5 - vmovdqa %ymm10,448-256-128(%rbx) - vpaddd %ymm10,%ymm4,%ymm4 - vpxor 224-128(%rax),%ymm11,%ymm11 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm2,%ymm5,%ymm5 - vpxor %ymm13,%ymm11,%ymm11 - - vpslld $30,%ymm1,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm4,%ymm4 - vpsrld $31,%ymm11,%ymm9 - vpaddd %ymm11,%ymm11,%ymm11 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpor %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vpxor %ymm14,%ymm12,%ymm12 - vmovdqa 64-128(%rax),%ymm14 - - vpslld $5,%ymm4,%ymm7 - vpaddd %ymm15,%ymm3,%ymm3 - vpxor %ymm0,%ymm2,%ymm5 - vmovdqa %ymm11,480-256-128(%rbx) - vpaddd %ymm11,%ymm3,%ymm3 - vpxor 256-256-128(%rbx),%ymm12,%ymm12 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm1,%ymm5,%ymm5 - vpxor %ymm14,%ymm12,%ymm12 - - vpslld $30,%ymm0,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm3,%ymm3 - vpsrld $31,%ymm12,%ymm9 - vpaddd %ymm12,%ymm12,%ymm12 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpor %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vpxor %ymm10,%ymm13,%ymm13 - vmovdqa 96-128(%rax),%ymm10 - - vpslld $5,%ymm3,%ymm7 - vpaddd %ymm15,%ymm2,%ymm2 - vpxor %ymm4,%ymm1,%ymm5 - vmovdqa %ymm12,0-128(%rax) - vpaddd %ymm12,%ymm2,%ymm2 - vpxor 288-256-128(%rbx),%ymm13,%ymm13 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm0,%ymm5,%ymm5 - vpxor %ymm10,%ymm13,%ymm13 - - vpslld $30,%ymm4,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm2,%ymm2 - vpsrld $31,%ymm13,%ymm9 - vpaddd %ymm13,%ymm13,%ymm13 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpor %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vpxor %ymm11,%ymm14,%ymm14 - vmovdqa 128-128(%rax),%ymm11 - - vpslld $5,%ymm2,%ymm7 - vpaddd %ymm15,%ymm1,%ymm1 - vpxor %ymm3,%ymm0,%ymm5 - vmovdqa %ymm13,32-128(%rax) - vpaddd %ymm13,%ymm1,%ymm1 - vpxor 320-256-128(%rbx),%ymm14,%ymm14 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm4,%ymm5,%ymm5 - vpxor %ymm11,%ymm14,%ymm14 - - vpslld $30,%ymm3,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm1,%ymm1 - vpsrld $31,%ymm14,%ymm9 - vpaddd %ymm14,%ymm14,%ymm14 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpor %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vpxor %ymm12,%ymm10,%ymm10 - vmovdqa 160-128(%rax),%ymm12 - - vpslld $5,%ymm1,%ymm7 - vpaddd %ymm15,%ymm0,%ymm0 - vpxor %ymm2,%ymm4,%ymm5 - vmovdqa %ymm14,64-128(%rax) - vpaddd %ymm14,%ymm0,%ymm0 - vpxor 352-256-128(%rbx),%ymm10,%ymm10 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm3,%ymm5,%ymm5 - vpxor %ymm12,%ymm10,%ymm10 - - vpslld $30,%ymm2,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm0,%ymm0 - vpsrld $31,%ymm10,%ymm9 - vpaddd %ymm10,%ymm10,%ymm10 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpor %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vpxor %ymm13,%ymm11,%ymm11 - vmovdqa 192-128(%rax),%ymm13 - - vpslld $5,%ymm0,%ymm7 - vpaddd %ymm15,%ymm4,%ymm4 - vpxor %ymm1,%ymm3,%ymm5 - vmovdqa %ymm10,96-128(%rax) - vpaddd %ymm10,%ymm4,%ymm4 - vpxor 384-256-128(%rbx),%ymm11,%ymm11 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm2,%ymm5,%ymm5 - vpxor %ymm13,%ymm11,%ymm11 - - vpslld $30,%ymm1,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm4,%ymm4 - vpsrld $31,%ymm11,%ymm9 - vpaddd %ymm11,%ymm11,%ymm11 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpor %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vpxor %ymm14,%ymm12,%ymm12 - vmovdqa 224-128(%rax),%ymm14 - - vpslld $5,%ymm4,%ymm7 - vpaddd %ymm15,%ymm3,%ymm3 - vpxor %ymm0,%ymm2,%ymm5 - vmovdqa %ymm11,128-128(%rax) - vpaddd %ymm11,%ymm3,%ymm3 - vpxor 416-256-128(%rbx),%ymm12,%ymm12 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm1,%ymm5,%ymm5 - vpxor %ymm14,%ymm12,%ymm12 - - vpslld $30,%ymm0,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm3,%ymm3 - vpsrld $31,%ymm12,%ymm9 - vpaddd %ymm12,%ymm12,%ymm12 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpor %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vpxor %ymm10,%ymm13,%ymm13 - vmovdqa 256-256-128(%rbx),%ymm10 - - vpslld $5,%ymm3,%ymm7 - vpaddd %ymm15,%ymm2,%ymm2 - vpxor %ymm4,%ymm1,%ymm5 - vmovdqa %ymm12,160-128(%rax) - vpaddd %ymm12,%ymm2,%ymm2 - vpxor 448-256-128(%rbx),%ymm13,%ymm13 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm0,%ymm5,%ymm5 - vpxor %ymm10,%ymm13,%ymm13 - - vpslld $30,%ymm4,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm2,%ymm2 - vpsrld $31,%ymm13,%ymm9 - vpaddd %ymm13,%ymm13,%ymm13 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpor %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vpxor %ymm11,%ymm14,%ymm14 - vmovdqa 288-256-128(%rbx),%ymm11 - - vpslld $5,%ymm2,%ymm7 - vpaddd %ymm15,%ymm1,%ymm1 - vpxor %ymm3,%ymm0,%ymm5 - vmovdqa %ymm13,192-128(%rax) - vpaddd %ymm13,%ymm1,%ymm1 - vpxor 480-256-128(%rbx),%ymm14,%ymm14 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm4,%ymm5,%ymm5 - vpxor %ymm11,%ymm14,%ymm14 - - vpslld $30,%ymm3,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm1,%ymm1 - vpsrld $31,%ymm14,%ymm9 - vpaddd %ymm14,%ymm14,%ymm14 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpor %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vpxor %ymm12,%ymm10,%ymm10 - vmovdqa 320-256-128(%rbx),%ymm12 - - vpslld $5,%ymm1,%ymm7 - vpaddd %ymm15,%ymm0,%ymm0 - vpxor %ymm2,%ymm4,%ymm5 - vmovdqa %ymm14,224-128(%rax) - vpaddd %ymm14,%ymm0,%ymm0 - vpxor 0-128(%rax),%ymm10,%ymm10 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm3,%ymm5,%ymm5 - vpxor %ymm12,%ymm10,%ymm10 - - vpslld $30,%ymm2,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm0,%ymm0 - vpsrld $31,%ymm10,%ymm9 - vpaddd %ymm10,%ymm10,%ymm10 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpor %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vmovdqa 32(%rbp),%ymm15 - vpxor %ymm13,%ymm11,%ymm11 - vmovdqa 352-256-128(%rbx),%ymm13 - - vpaddd %ymm15,%ymm4,%ymm4 - vpslld $5,%ymm0,%ymm7 - vpand %ymm2,%ymm3,%ymm6 - vpxor 32-128(%rax),%ymm11,%ymm11 - - vpaddd %ymm6,%ymm4,%ymm4 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm2,%ymm3,%ymm5 - vpxor %ymm13,%ymm11,%ymm11 - - vmovdqu %ymm10,256-256-128(%rbx) - vpaddd %ymm10,%ymm4,%ymm4 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm11,%ymm9 - vpand %ymm1,%ymm5,%ymm5 - vpaddd %ymm11,%ymm11,%ymm11 - - vpslld $30,%ymm1,%ymm6 - vpaddd %ymm5,%ymm4,%ymm4 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpor %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vpxor %ymm14,%ymm12,%ymm12 - vmovdqa 384-256-128(%rbx),%ymm14 - - vpaddd %ymm15,%ymm3,%ymm3 - vpslld $5,%ymm4,%ymm7 - vpand %ymm1,%ymm2,%ymm6 - vpxor 64-128(%rax),%ymm12,%ymm12 - - vpaddd %ymm6,%ymm3,%ymm3 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm1,%ymm2,%ymm5 - vpxor %ymm14,%ymm12,%ymm12 - - vmovdqu %ymm11,288-256-128(%rbx) - vpaddd %ymm11,%ymm3,%ymm3 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm12,%ymm9 - vpand %ymm0,%ymm5,%ymm5 - vpaddd %ymm12,%ymm12,%ymm12 - - vpslld $30,%ymm0,%ymm6 - vpaddd %ymm5,%ymm3,%ymm3 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpor %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vpxor %ymm10,%ymm13,%ymm13 - vmovdqa 416-256-128(%rbx),%ymm10 - - vpaddd %ymm15,%ymm2,%ymm2 - vpslld $5,%ymm3,%ymm7 - vpand %ymm0,%ymm1,%ymm6 - vpxor 96-128(%rax),%ymm13,%ymm13 - - vpaddd %ymm6,%ymm2,%ymm2 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm0,%ymm1,%ymm5 - vpxor %ymm10,%ymm13,%ymm13 - - vmovdqu %ymm12,320-256-128(%rbx) - vpaddd %ymm12,%ymm2,%ymm2 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm13,%ymm9 - vpand %ymm4,%ymm5,%ymm5 - vpaddd %ymm13,%ymm13,%ymm13 - - vpslld $30,%ymm4,%ymm6 - vpaddd %ymm5,%ymm2,%ymm2 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpor %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vpxor %ymm11,%ymm14,%ymm14 - vmovdqa 448-256-128(%rbx),%ymm11 - - vpaddd %ymm15,%ymm1,%ymm1 - vpslld $5,%ymm2,%ymm7 - vpand %ymm4,%ymm0,%ymm6 - vpxor 128-128(%rax),%ymm14,%ymm14 - - vpaddd %ymm6,%ymm1,%ymm1 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm4,%ymm0,%ymm5 - vpxor %ymm11,%ymm14,%ymm14 - - vmovdqu %ymm13,352-256-128(%rbx) - vpaddd %ymm13,%ymm1,%ymm1 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm14,%ymm9 - vpand %ymm3,%ymm5,%ymm5 - vpaddd %ymm14,%ymm14,%ymm14 - - vpslld $30,%ymm3,%ymm6 - vpaddd %ymm5,%ymm1,%ymm1 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpor %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vpxor %ymm12,%ymm10,%ymm10 - vmovdqa 480-256-128(%rbx),%ymm12 - - vpaddd %ymm15,%ymm0,%ymm0 - vpslld $5,%ymm1,%ymm7 - vpand %ymm3,%ymm4,%ymm6 - vpxor 160-128(%rax),%ymm10,%ymm10 - - vpaddd %ymm6,%ymm0,%ymm0 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm3,%ymm4,%ymm5 - vpxor %ymm12,%ymm10,%ymm10 - - vmovdqu %ymm14,384-256-128(%rbx) - vpaddd %ymm14,%ymm0,%ymm0 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm10,%ymm9 - vpand %ymm2,%ymm5,%ymm5 - vpaddd %ymm10,%ymm10,%ymm10 - - vpslld $30,%ymm2,%ymm6 - vpaddd %ymm5,%ymm0,%ymm0 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpor %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vpxor %ymm13,%ymm11,%ymm11 - vmovdqa 0-128(%rax),%ymm13 - - vpaddd %ymm15,%ymm4,%ymm4 - vpslld $5,%ymm0,%ymm7 - vpand %ymm2,%ymm3,%ymm6 - vpxor 192-128(%rax),%ymm11,%ymm11 - - vpaddd %ymm6,%ymm4,%ymm4 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm2,%ymm3,%ymm5 - vpxor %ymm13,%ymm11,%ymm11 - - vmovdqu %ymm10,416-256-128(%rbx) - vpaddd %ymm10,%ymm4,%ymm4 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm11,%ymm9 - vpand %ymm1,%ymm5,%ymm5 - vpaddd %ymm11,%ymm11,%ymm11 - - vpslld $30,%ymm1,%ymm6 - vpaddd %ymm5,%ymm4,%ymm4 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpor %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vpxor %ymm14,%ymm12,%ymm12 - vmovdqa 32-128(%rax),%ymm14 - - vpaddd %ymm15,%ymm3,%ymm3 - vpslld $5,%ymm4,%ymm7 - vpand %ymm1,%ymm2,%ymm6 - vpxor 224-128(%rax),%ymm12,%ymm12 - - vpaddd %ymm6,%ymm3,%ymm3 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm1,%ymm2,%ymm5 - vpxor %ymm14,%ymm12,%ymm12 - - vmovdqu %ymm11,448-256-128(%rbx) - vpaddd %ymm11,%ymm3,%ymm3 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm12,%ymm9 - vpand %ymm0,%ymm5,%ymm5 - vpaddd %ymm12,%ymm12,%ymm12 - - vpslld $30,%ymm0,%ymm6 - vpaddd %ymm5,%ymm3,%ymm3 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpor %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vpxor %ymm10,%ymm13,%ymm13 - vmovdqa 64-128(%rax),%ymm10 - - vpaddd %ymm15,%ymm2,%ymm2 - vpslld $5,%ymm3,%ymm7 - vpand %ymm0,%ymm1,%ymm6 - vpxor 256-256-128(%rbx),%ymm13,%ymm13 - - vpaddd %ymm6,%ymm2,%ymm2 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm0,%ymm1,%ymm5 - vpxor %ymm10,%ymm13,%ymm13 - - vmovdqu %ymm12,480-256-128(%rbx) - vpaddd %ymm12,%ymm2,%ymm2 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm13,%ymm9 - vpand %ymm4,%ymm5,%ymm5 - vpaddd %ymm13,%ymm13,%ymm13 - - vpslld $30,%ymm4,%ymm6 - vpaddd %ymm5,%ymm2,%ymm2 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpor %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vpxor %ymm11,%ymm14,%ymm14 - vmovdqa 96-128(%rax),%ymm11 - - vpaddd %ymm15,%ymm1,%ymm1 - vpslld $5,%ymm2,%ymm7 - vpand %ymm4,%ymm0,%ymm6 - vpxor 288-256-128(%rbx),%ymm14,%ymm14 - - vpaddd %ymm6,%ymm1,%ymm1 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm4,%ymm0,%ymm5 - vpxor %ymm11,%ymm14,%ymm14 - - vmovdqu %ymm13,0-128(%rax) - vpaddd %ymm13,%ymm1,%ymm1 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm14,%ymm9 - vpand %ymm3,%ymm5,%ymm5 - vpaddd %ymm14,%ymm14,%ymm14 - - vpslld $30,%ymm3,%ymm6 - vpaddd %ymm5,%ymm1,%ymm1 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpor %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vpxor %ymm12,%ymm10,%ymm10 - vmovdqa 128-128(%rax),%ymm12 - - vpaddd %ymm15,%ymm0,%ymm0 - vpslld $5,%ymm1,%ymm7 - vpand %ymm3,%ymm4,%ymm6 - vpxor 320-256-128(%rbx),%ymm10,%ymm10 - - vpaddd %ymm6,%ymm0,%ymm0 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm3,%ymm4,%ymm5 - vpxor %ymm12,%ymm10,%ymm10 - - vmovdqu %ymm14,32-128(%rax) - vpaddd %ymm14,%ymm0,%ymm0 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm10,%ymm9 - vpand %ymm2,%ymm5,%ymm5 - vpaddd %ymm10,%ymm10,%ymm10 - - vpslld $30,%ymm2,%ymm6 - vpaddd %ymm5,%ymm0,%ymm0 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpor %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vpxor %ymm13,%ymm11,%ymm11 - vmovdqa 160-128(%rax),%ymm13 - - vpaddd %ymm15,%ymm4,%ymm4 - vpslld $5,%ymm0,%ymm7 - vpand %ymm2,%ymm3,%ymm6 - vpxor 352-256-128(%rbx),%ymm11,%ymm11 - - vpaddd %ymm6,%ymm4,%ymm4 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm2,%ymm3,%ymm5 - vpxor %ymm13,%ymm11,%ymm11 - - vmovdqu %ymm10,64-128(%rax) - vpaddd %ymm10,%ymm4,%ymm4 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm11,%ymm9 - vpand %ymm1,%ymm5,%ymm5 - vpaddd %ymm11,%ymm11,%ymm11 - - vpslld $30,%ymm1,%ymm6 - vpaddd %ymm5,%ymm4,%ymm4 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpor %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vpxor %ymm14,%ymm12,%ymm12 - vmovdqa 192-128(%rax),%ymm14 - - vpaddd %ymm15,%ymm3,%ymm3 - vpslld $5,%ymm4,%ymm7 - vpand %ymm1,%ymm2,%ymm6 - vpxor 384-256-128(%rbx),%ymm12,%ymm12 - - vpaddd %ymm6,%ymm3,%ymm3 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm1,%ymm2,%ymm5 - vpxor %ymm14,%ymm12,%ymm12 - - vmovdqu %ymm11,96-128(%rax) - vpaddd %ymm11,%ymm3,%ymm3 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm12,%ymm9 - vpand %ymm0,%ymm5,%ymm5 - vpaddd %ymm12,%ymm12,%ymm12 - - vpslld $30,%ymm0,%ymm6 - vpaddd %ymm5,%ymm3,%ymm3 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpor %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vpxor %ymm10,%ymm13,%ymm13 - vmovdqa 224-128(%rax),%ymm10 - - vpaddd %ymm15,%ymm2,%ymm2 - vpslld $5,%ymm3,%ymm7 - vpand %ymm0,%ymm1,%ymm6 - vpxor 416-256-128(%rbx),%ymm13,%ymm13 - - vpaddd %ymm6,%ymm2,%ymm2 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm0,%ymm1,%ymm5 - vpxor %ymm10,%ymm13,%ymm13 - - vmovdqu %ymm12,128-128(%rax) - vpaddd %ymm12,%ymm2,%ymm2 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm13,%ymm9 - vpand %ymm4,%ymm5,%ymm5 - vpaddd %ymm13,%ymm13,%ymm13 - - vpslld $30,%ymm4,%ymm6 - vpaddd %ymm5,%ymm2,%ymm2 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpor %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vpxor %ymm11,%ymm14,%ymm14 - vmovdqa 256-256-128(%rbx),%ymm11 - - vpaddd %ymm15,%ymm1,%ymm1 - vpslld $5,%ymm2,%ymm7 - vpand %ymm4,%ymm0,%ymm6 - vpxor 448-256-128(%rbx),%ymm14,%ymm14 - - vpaddd %ymm6,%ymm1,%ymm1 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm4,%ymm0,%ymm5 - vpxor %ymm11,%ymm14,%ymm14 - - vmovdqu %ymm13,160-128(%rax) - vpaddd %ymm13,%ymm1,%ymm1 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm14,%ymm9 - vpand %ymm3,%ymm5,%ymm5 - vpaddd %ymm14,%ymm14,%ymm14 - - vpslld $30,%ymm3,%ymm6 - vpaddd %ymm5,%ymm1,%ymm1 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpor %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vpxor %ymm12,%ymm10,%ymm10 - vmovdqa 288-256-128(%rbx),%ymm12 - - vpaddd %ymm15,%ymm0,%ymm0 - vpslld $5,%ymm1,%ymm7 - vpand %ymm3,%ymm4,%ymm6 - vpxor 480-256-128(%rbx),%ymm10,%ymm10 - - vpaddd %ymm6,%ymm0,%ymm0 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm3,%ymm4,%ymm5 - vpxor %ymm12,%ymm10,%ymm10 - - vmovdqu %ymm14,192-128(%rax) - vpaddd %ymm14,%ymm0,%ymm0 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm10,%ymm9 - vpand %ymm2,%ymm5,%ymm5 - vpaddd %ymm10,%ymm10,%ymm10 - - vpslld $30,%ymm2,%ymm6 - vpaddd %ymm5,%ymm0,%ymm0 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpor %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vpxor %ymm13,%ymm11,%ymm11 - vmovdqa 320-256-128(%rbx),%ymm13 - - vpaddd %ymm15,%ymm4,%ymm4 - vpslld $5,%ymm0,%ymm7 - vpand %ymm2,%ymm3,%ymm6 - vpxor 0-128(%rax),%ymm11,%ymm11 - - vpaddd %ymm6,%ymm4,%ymm4 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm2,%ymm3,%ymm5 - vpxor %ymm13,%ymm11,%ymm11 - - vmovdqu %ymm10,224-128(%rax) - vpaddd %ymm10,%ymm4,%ymm4 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm11,%ymm9 - vpand %ymm1,%ymm5,%ymm5 - vpaddd %ymm11,%ymm11,%ymm11 - - vpslld $30,%ymm1,%ymm6 - vpaddd %ymm5,%ymm4,%ymm4 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpor %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vpxor %ymm14,%ymm12,%ymm12 - vmovdqa 352-256-128(%rbx),%ymm14 - - vpaddd %ymm15,%ymm3,%ymm3 - vpslld $5,%ymm4,%ymm7 - vpand %ymm1,%ymm2,%ymm6 - vpxor 32-128(%rax),%ymm12,%ymm12 - - vpaddd %ymm6,%ymm3,%ymm3 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm1,%ymm2,%ymm5 - vpxor %ymm14,%ymm12,%ymm12 - - vmovdqu %ymm11,256-256-128(%rbx) - vpaddd %ymm11,%ymm3,%ymm3 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm12,%ymm9 - vpand %ymm0,%ymm5,%ymm5 - vpaddd %ymm12,%ymm12,%ymm12 - - vpslld $30,%ymm0,%ymm6 - vpaddd %ymm5,%ymm3,%ymm3 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpor %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vpxor %ymm10,%ymm13,%ymm13 - vmovdqa 384-256-128(%rbx),%ymm10 - - vpaddd %ymm15,%ymm2,%ymm2 - vpslld $5,%ymm3,%ymm7 - vpand %ymm0,%ymm1,%ymm6 - vpxor 64-128(%rax),%ymm13,%ymm13 - - vpaddd %ymm6,%ymm2,%ymm2 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm0,%ymm1,%ymm5 - vpxor %ymm10,%ymm13,%ymm13 - - vmovdqu %ymm12,288-256-128(%rbx) - vpaddd %ymm12,%ymm2,%ymm2 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm13,%ymm9 - vpand %ymm4,%ymm5,%ymm5 - vpaddd %ymm13,%ymm13,%ymm13 - - vpslld $30,%ymm4,%ymm6 - vpaddd %ymm5,%ymm2,%ymm2 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpor %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vpxor %ymm11,%ymm14,%ymm14 - vmovdqa 416-256-128(%rbx),%ymm11 - - vpaddd %ymm15,%ymm1,%ymm1 - vpslld $5,%ymm2,%ymm7 - vpand %ymm4,%ymm0,%ymm6 - vpxor 96-128(%rax),%ymm14,%ymm14 - - vpaddd %ymm6,%ymm1,%ymm1 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm4,%ymm0,%ymm5 - vpxor %ymm11,%ymm14,%ymm14 - - vmovdqu %ymm13,320-256-128(%rbx) - vpaddd %ymm13,%ymm1,%ymm1 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm14,%ymm9 - vpand %ymm3,%ymm5,%ymm5 - vpaddd %ymm14,%ymm14,%ymm14 - - vpslld $30,%ymm3,%ymm6 - vpaddd %ymm5,%ymm1,%ymm1 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpor %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vpxor %ymm12,%ymm10,%ymm10 - vmovdqa 448-256-128(%rbx),%ymm12 - - vpaddd %ymm15,%ymm0,%ymm0 - vpslld $5,%ymm1,%ymm7 - vpand %ymm3,%ymm4,%ymm6 - vpxor 128-128(%rax),%ymm10,%ymm10 - - vpaddd %ymm6,%ymm0,%ymm0 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm3,%ymm4,%ymm5 - vpxor %ymm12,%ymm10,%ymm10 - - vmovdqu %ymm14,352-256-128(%rbx) - vpaddd %ymm14,%ymm0,%ymm0 - vpor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm10,%ymm9 - vpand %ymm2,%ymm5,%ymm5 - vpaddd %ymm10,%ymm10,%ymm10 - - vpslld $30,%ymm2,%ymm6 - vpaddd %ymm5,%ymm0,%ymm0 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpor %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vmovdqa 64(%rbp),%ymm15 - vpxor %ymm13,%ymm11,%ymm11 - vmovdqa 480-256-128(%rbx),%ymm13 - - vpslld $5,%ymm0,%ymm7 - vpaddd %ymm15,%ymm4,%ymm4 - vpxor %ymm1,%ymm3,%ymm5 - vmovdqa %ymm10,384-256-128(%rbx) - vpaddd %ymm10,%ymm4,%ymm4 - vpxor 160-128(%rax),%ymm11,%ymm11 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm2,%ymm5,%ymm5 - vpxor %ymm13,%ymm11,%ymm11 - - vpslld $30,%ymm1,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm4,%ymm4 - vpsrld $31,%ymm11,%ymm9 - vpaddd %ymm11,%ymm11,%ymm11 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpor %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vpxor %ymm14,%ymm12,%ymm12 - vmovdqa 0-128(%rax),%ymm14 - - vpslld $5,%ymm4,%ymm7 - vpaddd %ymm15,%ymm3,%ymm3 - vpxor %ymm0,%ymm2,%ymm5 - vmovdqa %ymm11,416-256-128(%rbx) - vpaddd %ymm11,%ymm3,%ymm3 - vpxor 192-128(%rax),%ymm12,%ymm12 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm1,%ymm5,%ymm5 - vpxor %ymm14,%ymm12,%ymm12 - - vpslld $30,%ymm0,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm3,%ymm3 - vpsrld $31,%ymm12,%ymm9 - vpaddd %ymm12,%ymm12,%ymm12 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpor %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vpxor %ymm10,%ymm13,%ymm13 - vmovdqa 32-128(%rax),%ymm10 - - vpslld $5,%ymm3,%ymm7 - vpaddd %ymm15,%ymm2,%ymm2 - vpxor %ymm4,%ymm1,%ymm5 - vmovdqa %ymm12,448-256-128(%rbx) - vpaddd %ymm12,%ymm2,%ymm2 - vpxor 224-128(%rax),%ymm13,%ymm13 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm0,%ymm5,%ymm5 - vpxor %ymm10,%ymm13,%ymm13 - - vpslld $30,%ymm4,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm2,%ymm2 - vpsrld $31,%ymm13,%ymm9 - vpaddd %ymm13,%ymm13,%ymm13 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpor %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vpxor %ymm11,%ymm14,%ymm14 - vmovdqa 64-128(%rax),%ymm11 - - vpslld $5,%ymm2,%ymm7 - vpaddd %ymm15,%ymm1,%ymm1 - vpxor %ymm3,%ymm0,%ymm5 - vmovdqa %ymm13,480-256-128(%rbx) - vpaddd %ymm13,%ymm1,%ymm1 - vpxor 256-256-128(%rbx),%ymm14,%ymm14 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm4,%ymm5,%ymm5 - vpxor %ymm11,%ymm14,%ymm14 - - vpslld $30,%ymm3,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm1,%ymm1 - vpsrld $31,%ymm14,%ymm9 - vpaddd %ymm14,%ymm14,%ymm14 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpor %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vpxor %ymm12,%ymm10,%ymm10 - vmovdqa 96-128(%rax),%ymm12 - - vpslld $5,%ymm1,%ymm7 - vpaddd %ymm15,%ymm0,%ymm0 - vpxor %ymm2,%ymm4,%ymm5 - vmovdqa %ymm14,0-128(%rax) - vpaddd %ymm14,%ymm0,%ymm0 - vpxor 288-256-128(%rbx),%ymm10,%ymm10 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm3,%ymm5,%ymm5 - vpxor %ymm12,%ymm10,%ymm10 - - vpslld $30,%ymm2,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm0,%ymm0 - vpsrld $31,%ymm10,%ymm9 - vpaddd %ymm10,%ymm10,%ymm10 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpor %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vpxor %ymm13,%ymm11,%ymm11 - vmovdqa 128-128(%rax),%ymm13 - - vpslld $5,%ymm0,%ymm7 - vpaddd %ymm15,%ymm4,%ymm4 - vpxor %ymm1,%ymm3,%ymm5 - vmovdqa %ymm10,32-128(%rax) - vpaddd %ymm10,%ymm4,%ymm4 - vpxor 320-256-128(%rbx),%ymm11,%ymm11 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm2,%ymm5,%ymm5 - vpxor %ymm13,%ymm11,%ymm11 - - vpslld $30,%ymm1,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm4,%ymm4 - vpsrld $31,%ymm11,%ymm9 - vpaddd %ymm11,%ymm11,%ymm11 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpor %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vpxor %ymm14,%ymm12,%ymm12 - vmovdqa 160-128(%rax),%ymm14 - - vpslld $5,%ymm4,%ymm7 - vpaddd %ymm15,%ymm3,%ymm3 - vpxor %ymm0,%ymm2,%ymm5 - vmovdqa %ymm11,64-128(%rax) - vpaddd %ymm11,%ymm3,%ymm3 - vpxor 352-256-128(%rbx),%ymm12,%ymm12 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm1,%ymm5,%ymm5 - vpxor %ymm14,%ymm12,%ymm12 - - vpslld $30,%ymm0,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm3,%ymm3 - vpsrld $31,%ymm12,%ymm9 - vpaddd %ymm12,%ymm12,%ymm12 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpor %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vpxor %ymm10,%ymm13,%ymm13 - vmovdqa 192-128(%rax),%ymm10 - - vpslld $5,%ymm3,%ymm7 - vpaddd %ymm15,%ymm2,%ymm2 - vpxor %ymm4,%ymm1,%ymm5 - vmovdqa %ymm12,96-128(%rax) - vpaddd %ymm12,%ymm2,%ymm2 - vpxor 384-256-128(%rbx),%ymm13,%ymm13 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm0,%ymm5,%ymm5 - vpxor %ymm10,%ymm13,%ymm13 - - vpslld $30,%ymm4,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm2,%ymm2 - vpsrld $31,%ymm13,%ymm9 - vpaddd %ymm13,%ymm13,%ymm13 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpor %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vpxor %ymm11,%ymm14,%ymm14 - vmovdqa 224-128(%rax),%ymm11 - - vpslld $5,%ymm2,%ymm7 - vpaddd %ymm15,%ymm1,%ymm1 - vpxor %ymm3,%ymm0,%ymm5 - vmovdqa %ymm13,128-128(%rax) - vpaddd %ymm13,%ymm1,%ymm1 - vpxor 416-256-128(%rbx),%ymm14,%ymm14 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm4,%ymm5,%ymm5 - vpxor %ymm11,%ymm14,%ymm14 - - vpslld $30,%ymm3,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm1,%ymm1 - vpsrld $31,%ymm14,%ymm9 - vpaddd %ymm14,%ymm14,%ymm14 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpor %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vpxor %ymm12,%ymm10,%ymm10 - vmovdqa 256-256-128(%rbx),%ymm12 - - vpslld $5,%ymm1,%ymm7 - vpaddd %ymm15,%ymm0,%ymm0 - vpxor %ymm2,%ymm4,%ymm5 - vmovdqa %ymm14,160-128(%rax) - vpaddd %ymm14,%ymm0,%ymm0 - vpxor 448-256-128(%rbx),%ymm10,%ymm10 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm3,%ymm5,%ymm5 - vpxor %ymm12,%ymm10,%ymm10 - - vpslld $30,%ymm2,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm0,%ymm0 - vpsrld $31,%ymm10,%ymm9 - vpaddd %ymm10,%ymm10,%ymm10 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpor %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vpxor %ymm13,%ymm11,%ymm11 - vmovdqa 288-256-128(%rbx),%ymm13 - - vpslld $5,%ymm0,%ymm7 - vpaddd %ymm15,%ymm4,%ymm4 - vpxor %ymm1,%ymm3,%ymm5 - vmovdqa %ymm10,192-128(%rax) - vpaddd %ymm10,%ymm4,%ymm4 - vpxor 480-256-128(%rbx),%ymm11,%ymm11 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm2,%ymm5,%ymm5 - vpxor %ymm13,%ymm11,%ymm11 - - vpslld $30,%ymm1,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm4,%ymm4 - vpsrld $31,%ymm11,%ymm9 - vpaddd %ymm11,%ymm11,%ymm11 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpor %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vpxor %ymm14,%ymm12,%ymm12 - vmovdqa 320-256-128(%rbx),%ymm14 - - vpslld $5,%ymm4,%ymm7 - vpaddd %ymm15,%ymm3,%ymm3 - vpxor %ymm0,%ymm2,%ymm5 - vmovdqa %ymm11,224-128(%rax) - vpaddd %ymm11,%ymm3,%ymm3 - vpxor 0-128(%rax),%ymm12,%ymm12 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm1,%ymm5,%ymm5 - vpxor %ymm14,%ymm12,%ymm12 - - vpslld $30,%ymm0,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm3,%ymm3 - vpsrld $31,%ymm12,%ymm9 - vpaddd %ymm12,%ymm12,%ymm12 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpor %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vpxor %ymm10,%ymm13,%ymm13 - vmovdqa 352-256-128(%rbx),%ymm10 - - vpslld $5,%ymm3,%ymm7 - vpaddd %ymm15,%ymm2,%ymm2 - vpxor %ymm4,%ymm1,%ymm5 - vpaddd %ymm12,%ymm2,%ymm2 - vpxor 32-128(%rax),%ymm13,%ymm13 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm0,%ymm5,%ymm5 - vpxor %ymm10,%ymm13,%ymm13 - - vpslld $30,%ymm4,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm2,%ymm2 - vpsrld $31,%ymm13,%ymm9 - vpaddd %ymm13,%ymm13,%ymm13 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpor %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vpxor %ymm11,%ymm14,%ymm14 - vmovdqa 384-256-128(%rbx),%ymm11 - - vpslld $5,%ymm2,%ymm7 - vpaddd %ymm15,%ymm1,%ymm1 - vpxor %ymm3,%ymm0,%ymm5 - vpaddd %ymm13,%ymm1,%ymm1 - vpxor 64-128(%rax),%ymm14,%ymm14 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm4,%ymm5,%ymm5 - vpxor %ymm11,%ymm14,%ymm14 - - vpslld $30,%ymm3,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm1,%ymm1 - vpsrld $31,%ymm14,%ymm9 - vpaddd %ymm14,%ymm14,%ymm14 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpor %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vpxor %ymm12,%ymm10,%ymm10 - vmovdqa 416-256-128(%rbx),%ymm12 - - vpslld $5,%ymm1,%ymm7 - vpaddd %ymm15,%ymm0,%ymm0 - vpxor %ymm2,%ymm4,%ymm5 - vpaddd %ymm14,%ymm0,%ymm0 - vpxor 96-128(%rax),%ymm10,%ymm10 - vpsrld $27,%ymm1,%ymm8 - vpxor %ymm3,%ymm5,%ymm5 - vpxor %ymm12,%ymm10,%ymm10 - - vpslld $30,%ymm2,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm0,%ymm0 - vpsrld $31,%ymm10,%ymm9 - vpaddd %ymm10,%ymm10,%ymm10 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpor %ymm9,%ymm10,%ymm10 - vpor %ymm6,%ymm2,%ymm2 - vpxor %ymm13,%ymm11,%ymm11 - vmovdqa 448-256-128(%rbx),%ymm13 - - vpslld $5,%ymm0,%ymm7 - vpaddd %ymm15,%ymm4,%ymm4 - vpxor %ymm1,%ymm3,%ymm5 - vpaddd %ymm10,%ymm4,%ymm4 - vpxor 128-128(%rax),%ymm11,%ymm11 - vpsrld $27,%ymm0,%ymm8 - vpxor %ymm2,%ymm5,%ymm5 - vpxor %ymm13,%ymm11,%ymm11 - - vpslld $30,%ymm1,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm4,%ymm4 - vpsrld $31,%ymm11,%ymm9 - vpaddd %ymm11,%ymm11,%ymm11 - - vpsrld $2,%ymm1,%ymm1 - vpaddd %ymm7,%ymm4,%ymm4 - vpor %ymm9,%ymm11,%ymm11 - vpor %ymm6,%ymm1,%ymm1 - vpxor %ymm14,%ymm12,%ymm12 - vmovdqa 480-256-128(%rbx),%ymm14 - - vpslld $5,%ymm4,%ymm7 - vpaddd %ymm15,%ymm3,%ymm3 - vpxor %ymm0,%ymm2,%ymm5 - vpaddd %ymm11,%ymm3,%ymm3 - vpxor 160-128(%rax),%ymm12,%ymm12 - vpsrld $27,%ymm4,%ymm8 - vpxor %ymm1,%ymm5,%ymm5 - vpxor %ymm14,%ymm12,%ymm12 - - vpslld $30,%ymm0,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm3,%ymm3 - vpsrld $31,%ymm12,%ymm9 - vpaddd %ymm12,%ymm12,%ymm12 - - vpsrld $2,%ymm0,%ymm0 - vpaddd %ymm7,%ymm3,%ymm3 - vpor %ymm9,%ymm12,%ymm12 - vpor %ymm6,%ymm0,%ymm0 - vpxor %ymm10,%ymm13,%ymm13 - vmovdqa 0-128(%rax),%ymm10 - - vpslld $5,%ymm3,%ymm7 - vpaddd %ymm15,%ymm2,%ymm2 - vpxor %ymm4,%ymm1,%ymm5 - vpaddd %ymm12,%ymm2,%ymm2 - vpxor 192-128(%rax),%ymm13,%ymm13 - vpsrld $27,%ymm3,%ymm8 - vpxor %ymm0,%ymm5,%ymm5 - vpxor %ymm10,%ymm13,%ymm13 - - vpslld $30,%ymm4,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm2,%ymm2 - vpsrld $31,%ymm13,%ymm9 - vpaddd %ymm13,%ymm13,%ymm13 - - vpsrld $2,%ymm4,%ymm4 - vpaddd %ymm7,%ymm2,%ymm2 - vpor %ymm9,%ymm13,%ymm13 - vpor %ymm6,%ymm4,%ymm4 - vpxor %ymm11,%ymm14,%ymm14 - vmovdqa 32-128(%rax),%ymm11 - - vpslld $5,%ymm2,%ymm7 - vpaddd %ymm15,%ymm1,%ymm1 - vpxor %ymm3,%ymm0,%ymm5 - vpaddd %ymm13,%ymm1,%ymm1 - vpxor 224-128(%rax),%ymm14,%ymm14 - vpsrld $27,%ymm2,%ymm8 - vpxor %ymm4,%ymm5,%ymm5 - vpxor %ymm11,%ymm14,%ymm14 - - vpslld $30,%ymm3,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm1,%ymm1 - vpsrld $31,%ymm14,%ymm9 - vpaddd %ymm14,%ymm14,%ymm14 - - vpsrld $2,%ymm3,%ymm3 - vpaddd %ymm7,%ymm1,%ymm1 - vpor %ymm9,%ymm14,%ymm14 - vpor %ymm6,%ymm3,%ymm3 - vpslld $5,%ymm1,%ymm7 - vpaddd %ymm15,%ymm0,%ymm0 - vpxor %ymm2,%ymm4,%ymm5 - - vpsrld $27,%ymm1,%ymm8 - vpaddd %ymm14,%ymm0,%ymm0 - vpxor %ymm3,%ymm5,%ymm5 - - vpslld $30,%ymm2,%ymm6 - vpor %ymm8,%ymm7,%ymm7 - vpaddd %ymm5,%ymm0,%ymm0 - - vpsrld $2,%ymm2,%ymm2 - vpaddd %ymm7,%ymm0,%ymm0 - vpor %ymm6,%ymm2,%ymm2 - movl $1,%ecx - leaq 512(%rsp),%rbx - cmpl 0(%rbx),%ecx - cmovgeq %rbp,%r12 - cmpl 4(%rbx),%ecx - cmovgeq %rbp,%r13 - cmpl 8(%rbx),%ecx - cmovgeq %rbp,%r14 - cmpl 12(%rbx),%ecx - cmovgeq %rbp,%r15 - cmpl 16(%rbx),%ecx - cmovgeq %rbp,%r8 - cmpl 20(%rbx),%ecx - cmovgeq %rbp,%r9 - cmpl 24(%rbx),%ecx - cmovgeq %rbp,%r10 - cmpl 28(%rbx),%ecx - cmovgeq %rbp,%r11 - vmovdqu (%rbx),%ymm5 - vpxor %ymm7,%ymm7,%ymm7 - vmovdqa %ymm5,%ymm6 - vpcmpgtd %ymm7,%ymm6,%ymm6 - vpaddd %ymm6,%ymm5,%ymm5 - - vpand %ymm6,%ymm0,%ymm0 - vpand %ymm6,%ymm1,%ymm1 - vpaddd 0(%rdi),%ymm0,%ymm0 - vpand %ymm6,%ymm2,%ymm2 - vpaddd 32(%rdi),%ymm1,%ymm1 - vpand %ymm6,%ymm3,%ymm3 - vpaddd 64(%rdi),%ymm2,%ymm2 - vpand %ymm6,%ymm4,%ymm4 - vpaddd 96(%rdi),%ymm3,%ymm3 - vpaddd 128(%rdi),%ymm4,%ymm4 - vmovdqu %ymm0,0(%rdi) - vmovdqu %ymm1,32(%rdi) - vmovdqu %ymm2,64(%rdi) - vmovdqu %ymm3,96(%rdi) - vmovdqu %ymm4,128(%rdi) - - vmovdqu %ymm5,(%rbx) - leaq 256+128(%rsp),%rbx - vmovdqu 96(%rbp),%ymm9 - decl %edx - jnz L$oop_avx2 - - - - - - - -L$done_avx2: - movq 544(%rsp),%rax - vzeroupper - movq -48(%rax),%r15 - movq -40(%rax),%r14 - movq -32(%rax),%r13 - movq -24(%rax),%r12 - movq -16(%rax),%rbp - movq -8(%rax),%rbx - leaq (%rax),%rsp -L$epilogue_avx2: - .byte 0xf3,0xc3 - - .p2align 8 .long 0x5a827999,0x5a827999,0x5a827999,0x5a827999 .long 0x5a827999,0x5a827999,0x5a827999,0x5a827999 diff --git a/deps/openssl/asm/x64-macosx-gas/sha/sha1-x86_64.s b/deps/openssl/asm/x64-macosx-gas/sha/sha1-x86_64.s index c89ffe3df60f54..798ca0dc4d076a 100644 --- a/deps/openssl/asm/x64-macosx-gas/sha/sha1-x86_64.s +++ b/deps/openssl/asm/x64-macosx-gas/sha/sha1-x86_64.s @@ -12,14 +12,6 @@ _sha1_block_data_order: jz L$ialu testl $536870912,%r10d jnz _shaext_shortcut - andl $296,%r10d - cmpl $296,%r10d - je _avx2_shortcut - andl $268435456,%r8d - andl $1073741824,%r9d - orl %r9d,%r8d - cmpl $1342177280,%r8d - je _avx_shortcut jmp _ssse3_shortcut .p2align 4 @@ -1248,9 +1240,9 @@ _shaext_shortcut: movdqa K_XX_XX+160(%rip),%xmm3 movdqu (%rsi),%xmm4 - pshufd $27,%xmm0,%xmm0 + pshufd $0b00011011,%xmm0,%xmm0 movdqu 16(%rsi),%xmm5 - pshufd $27,%xmm1,%xmm1 + pshufd $0b00011011,%xmm1,%xmm1 movdqu 32(%rsi),%xmm6 .byte 102,15,56,0,227 movdqu 48(%rsi),%xmm7 @@ -1400,8 +1392,8 @@ L$oop_shaext: jnz L$oop_shaext - pshufd $27,%xmm0,%xmm0 - pshufd $27,%xmm1,%xmm1 + pshufd $0b00011011,%xmm0,%xmm0 + pshufd $0b00011011,%xmm1,%xmm1 movdqu %xmm0,(%rdi) movd %xmm1,16(%rdi) .byte 0xf3,0xc3 @@ -2582,2803 +2574,6 @@ L$done_ssse3: L$epilogue_ssse3: .byte 0xf3,0xc3 - -.p2align 4 -sha1_block_data_order_avx: -_avx_shortcut: - movq %rsp,%rax - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - leaq -64(%rsp),%rsp - vzeroupper - movq %rax,%r14 - andq $-64,%rsp - movq %rdi,%r8 - movq %rsi,%r9 - movq %rdx,%r10 - - shlq $6,%r10 - addq %r9,%r10 - leaq K_XX_XX+64(%rip),%r11 - - movl 0(%r8),%eax - movl 4(%r8),%ebx - movl 8(%r8),%ecx - movl 12(%r8),%edx - movl %ebx,%esi - movl 16(%r8),%ebp - movl %ecx,%edi - xorl %edx,%edi - andl %edi,%esi - - vmovdqa 64(%r11),%xmm6 - vmovdqa -64(%r11),%xmm11 - vmovdqu 0(%r9),%xmm0 - vmovdqu 16(%r9),%xmm1 - vmovdqu 32(%r9),%xmm2 - vmovdqu 48(%r9),%xmm3 - vpshufb %xmm6,%xmm0,%xmm0 - addq $64,%r9 - vpshufb %xmm6,%xmm1,%xmm1 - vpshufb %xmm6,%xmm2,%xmm2 - vpshufb %xmm6,%xmm3,%xmm3 - vpaddd %xmm11,%xmm0,%xmm4 - vpaddd %xmm11,%xmm1,%xmm5 - vpaddd %xmm11,%xmm2,%xmm6 - vmovdqa %xmm4,0(%rsp) - vmovdqa %xmm5,16(%rsp) - vmovdqa %xmm6,32(%rsp) - jmp L$oop_avx -.p2align 4 -L$oop_avx: - shrdl $2,%ebx,%ebx - xorl %edx,%esi - vpalignr $8,%xmm0,%xmm1,%xmm4 - movl %eax,%edi - addl 0(%rsp),%ebp - vpaddd %xmm3,%xmm11,%xmm9 - xorl %ecx,%ebx - shldl $5,%eax,%eax - vpsrldq $4,%xmm3,%xmm8 - addl %esi,%ebp - andl %ebx,%edi - vpxor %xmm0,%xmm4,%xmm4 - xorl %ecx,%ebx - addl %eax,%ebp - vpxor %xmm2,%xmm8,%xmm8 - shrdl $7,%eax,%eax - xorl %ecx,%edi - movl %ebp,%esi - addl 4(%rsp),%edx - vpxor %xmm8,%xmm4,%xmm4 - xorl %ebx,%eax - shldl $5,%ebp,%ebp - vmovdqa %xmm9,48(%rsp) - addl %edi,%edx - andl %eax,%esi - vpsrld $31,%xmm4,%xmm8 - xorl %ebx,%eax - addl %ebp,%edx - shrdl $7,%ebp,%ebp - xorl %ebx,%esi - vpslldq $12,%xmm4,%xmm10 - vpaddd %xmm4,%xmm4,%xmm4 - movl %edx,%edi - addl 8(%rsp),%ecx - xorl %eax,%ebp - shldl $5,%edx,%edx - vpsrld $30,%xmm10,%xmm9 - vpor %xmm8,%xmm4,%xmm4 - addl %esi,%ecx - andl %ebp,%edi - xorl %eax,%ebp - addl %edx,%ecx - vpslld $2,%xmm10,%xmm10 - vpxor %xmm9,%xmm4,%xmm4 - shrdl $7,%edx,%edx - xorl %eax,%edi - movl %ecx,%esi - addl 12(%rsp),%ebx - vpxor %xmm10,%xmm4,%xmm4 - xorl %ebp,%edx - shldl $5,%ecx,%ecx - addl %edi,%ebx - andl %edx,%esi - xorl %ebp,%edx - addl %ecx,%ebx - shrdl $7,%ecx,%ecx - xorl %ebp,%esi - vpalignr $8,%xmm1,%xmm2,%xmm5 - movl %ebx,%edi - addl 16(%rsp),%eax - vpaddd %xmm4,%xmm11,%xmm9 - xorl %edx,%ecx - shldl $5,%ebx,%ebx - vpsrldq $4,%xmm4,%xmm8 - addl %esi,%eax - andl %ecx,%edi - vpxor %xmm1,%xmm5,%xmm5 - xorl %edx,%ecx - addl %ebx,%eax - vpxor %xmm3,%xmm8,%xmm8 - shrdl $7,%ebx,%ebx - xorl %edx,%edi - movl %eax,%esi - addl 20(%rsp),%ebp - vpxor %xmm8,%xmm5,%xmm5 - xorl %ecx,%ebx - shldl $5,%eax,%eax - vmovdqa %xmm9,0(%rsp) - addl %edi,%ebp - andl %ebx,%esi - vpsrld $31,%xmm5,%xmm8 - xorl %ecx,%ebx - addl %eax,%ebp - shrdl $7,%eax,%eax - xorl %ecx,%esi - vpslldq $12,%xmm5,%xmm10 - vpaddd %xmm5,%xmm5,%xmm5 - movl %ebp,%edi - addl 24(%rsp),%edx - xorl %ebx,%eax - shldl $5,%ebp,%ebp - vpsrld $30,%xmm10,%xmm9 - vpor %xmm8,%xmm5,%xmm5 - addl %esi,%edx - andl %eax,%edi - xorl %ebx,%eax - addl %ebp,%edx - vpslld $2,%xmm10,%xmm10 - vpxor %xmm9,%xmm5,%xmm5 - shrdl $7,%ebp,%ebp - xorl %ebx,%edi - movl %edx,%esi - addl 28(%rsp),%ecx - vpxor %xmm10,%xmm5,%xmm5 - xorl %eax,%ebp - shldl $5,%edx,%edx - vmovdqa -32(%r11),%xmm11 - addl %edi,%ecx - andl %ebp,%esi - xorl %eax,%ebp - addl %edx,%ecx - shrdl $7,%edx,%edx - xorl %eax,%esi - vpalignr $8,%xmm2,%xmm3,%xmm6 - movl %ecx,%edi - addl 32(%rsp),%ebx - vpaddd %xmm5,%xmm11,%xmm9 - xorl %ebp,%edx - shldl $5,%ecx,%ecx - vpsrldq $4,%xmm5,%xmm8 - addl %esi,%ebx - andl %edx,%edi - vpxor %xmm2,%xmm6,%xmm6 - xorl %ebp,%edx - addl %ecx,%ebx - vpxor %xmm4,%xmm8,%xmm8 - shrdl $7,%ecx,%ecx - xorl %ebp,%edi - movl %ebx,%esi - addl 36(%rsp),%eax - vpxor %xmm8,%xmm6,%xmm6 - xorl %edx,%ecx - shldl $5,%ebx,%ebx - vmovdqa %xmm9,16(%rsp) - addl %edi,%eax - andl %ecx,%esi - vpsrld $31,%xmm6,%xmm8 - xorl %edx,%ecx - addl %ebx,%eax - shrdl $7,%ebx,%ebx - xorl %edx,%esi - vpslldq $12,%xmm6,%xmm10 - vpaddd %xmm6,%xmm6,%xmm6 - movl %eax,%edi - addl 40(%rsp),%ebp - xorl %ecx,%ebx - shldl $5,%eax,%eax - vpsrld $30,%xmm10,%xmm9 - vpor %xmm8,%xmm6,%xmm6 - addl %esi,%ebp - andl %ebx,%edi - xorl %ecx,%ebx - addl %eax,%ebp - vpslld $2,%xmm10,%xmm10 - vpxor %xmm9,%xmm6,%xmm6 - shrdl $7,%eax,%eax - xorl %ecx,%edi - movl %ebp,%esi - addl 44(%rsp),%edx - vpxor %xmm10,%xmm6,%xmm6 - xorl %ebx,%eax - shldl $5,%ebp,%ebp - addl %edi,%edx - andl %eax,%esi - xorl %ebx,%eax - addl %ebp,%edx - shrdl $7,%ebp,%ebp - xorl %ebx,%esi - vpalignr $8,%xmm3,%xmm4,%xmm7 - movl %edx,%edi - addl 48(%rsp),%ecx - vpaddd %xmm6,%xmm11,%xmm9 - xorl %eax,%ebp - shldl $5,%edx,%edx - vpsrldq $4,%xmm6,%xmm8 - addl %esi,%ecx - andl %ebp,%edi - vpxor %xmm3,%xmm7,%xmm7 - xorl %eax,%ebp - addl %edx,%ecx - vpxor %xmm5,%xmm8,%xmm8 - shrdl $7,%edx,%edx - xorl %eax,%edi - movl %ecx,%esi - addl 52(%rsp),%ebx - vpxor %xmm8,%xmm7,%xmm7 - xorl %ebp,%edx - shldl $5,%ecx,%ecx - vmovdqa %xmm9,32(%rsp) - addl %edi,%ebx - andl %edx,%esi - vpsrld $31,%xmm7,%xmm8 - xorl %ebp,%edx - addl %ecx,%ebx - shrdl $7,%ecx,%ecx - xorl %ebp,%esi - vpslldq $12,%xmm7,%xmm10 - vpaddd %xmm7,%xmm7,%xmm7 - movl %ebx,%edi - addl 56(%rsp),%eax - xorl %edx,%ecx - shldl $5,%ebx,%ebx - vpsrld $30,%xmm10,%xmm9 - vpor %xmm8,%xmm7,%xmm7 - addl %esi,%eax - andl %ecx,%edi - xorl %edx,%ecx - addl %ebx,%eax - vpslld $2,%xmm10,%xmm10 - vpxor %xmm9,%xmm7,%xmm7 - shrdl $7,%ebx,%ebx - xorl %edx,%edi - movl %eax,%esi - addl 60(%rsp),%ebp - vpxor %xmm10,%xmm7,%xmm7 - xorl %ecx,%ebx - shldl $5,%eax,%eax - addl %edi,%ebp - andl %ebx,%esi - xorl %ecx,%ebx - addl %eax,%ebp - vpalignr $8,%xmm6,%xmm7,%xmm8 - vpxor %xmm4,%xmm0,%xmm0 - shrdl $7,%eax,%eax - xorl %ecx,%esi - movl %ebp,%edi - addl 0(%rsp),%edx - vpxor %xmm1,%xmm0,%xmm0 - xorl %ebx,%eax - shldl $5,%ebp,%ebp - vpaddd %xmm7,%xmm11,%xmm9 - addl %esi,%edx - andl %eax,%edi - vpxor %xmm8,%xmm0,%xmm0 - xorl %ebx,%eax - addl %ebp,%edx - shrdl $7,%ebp,%ebp - xorl %ebx,%edi - vpsrld $30,%xmm0,%xmm8 - vmovdqa %xmm9,48(%rsp) - movl %edx,%esi - addl 4(%rsp),%ecx - xorl %eax,%ebp - shldl $5,%edx,%edx - vpslld $2,%xmm0,%xmm0 - addl %edi,%ecx - andl %ebp,%esi - xorl %eax,%ebp - addl %edx,%ecx - shrdl $7,%edx,%edx - xorl %eax,%esi - movl %ecx,%edi - addl 8(%rsp),%ebx - vpor %xmm8,%xmm0,%xmm0 - xorl %ebp,%edx - shldl $5,%ecx,%ecx - addl %esi,%ebx - andl %edx,%edi - xorl %ebp,%edx - addl %ecx,%ebx - addl 12(%rsp),%eax - xorl %ebp,%edi - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %edi,%eax - xorl %edx,%esi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vpalignr $8,%xmm7,%xmm0,%xmm8 - vpxor %xmm5,%xmm1,%xmm1 - addl 16(%rsp),%ebp - xorl %ecx,%esi - movl %eax,%edi - shldl $5,%eax,%eax - vpxor %xmm2,%xmm1,%xmm1 - addl %esi,%ebp - xorl %ecx,%edi - vpaddd %xmm0,%xmm11,%xmm9 - shrdl $7,%ebx,%ebx - addl %eax,%ebp - vpxor %xmm8,%xmm1,%xmm1 - addl 20(%rsp),%edx - xorl %ebx,%edi - movl %ebp,%esi - shldl $5,%ebp,%ebp - vpsrld $30,%xmm1,%xmm8 - vmovdqa %xmm9,0(%rsp) - addl %edi,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %ebp,%edx - vpslld $2,%xmm1,%xmm1 - addl 24(%rsp),%ecx - xorl %eax,%esi - movl %edx,%edi - shldl $5,%edx,%edx - addl %esi,%ecx - xorl %eax,%edi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - vpor %xmm8,%xmm1,%xmm1 - addl 28(%rsp),%ebx - xorl %ebp,%edi - movl %ecx,%esi - shldl $5,%ecx,%ecx - addl %edi,%ebx - xorl %ebp,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - vpalignr $8,%xmm0,%xmm1,%xmm8 - vpxor %xmm6,%xmm2,%xmm2 - addl 32(%rsp),%eax - xorl %edx,%esi - movl %ebx,%edi - shldl $5,%ebx,%ebx - vpxor %xmm3,%xmm2,%xmm2 - addl %esi,%eax - xorl %edx,%edi - vpaddd %xmm1,%xmm11,%xmm9 - vmovdqa 0(%r11),%xmm11 - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vpxor %xmm8,%xmm2,%xmm2 - addl 36(%rsp),%ebp - xorl %ecx,%edi - movl %eax,%esi - shldl $5,%eax,%eax - vpsrld $30,%xmm2,%xmm8 - vmovdqa %xmm9,16(%rsp) - addl %edi,%ebp - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - vpslld $2,%xmm2,%xmm2 - addl 40(%rsp),%edx - xorl %ebx,%esi - movl %ebp,%edi - shldl $5,%ebp,%ebp - addl %esi,%edx - xorl %ebx,%edi - shrdl $7,%eax,%eax - addl %ebp,%edx - vpor %xmm8,%xmm2,%xmm2 - addl 44(%rsp),%ecx - xorl %eax,%edi - movl %edx,%esi - shldl $5,%edx,%edx - addl %edi,%ecx - xorl %eax,%esi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - vpalignr $8,%xmm1,%xmm2,%xmm8 - vpxor %xmm7,%xmm3,%xmm3 - addl 48(%rsp),%ebx - xorl %ebp,%esi - movl %ecx,%edi - shldl $5,%ecx,%ecx - vpxor %xmm4,%xmm3,%xmm3 - addl %esi,%ebx - xorl %ebp,%edi - vpaddd %xmm2,%xmm11,%xmm9 - shrdl $7,%edx,%edx - addl %ecx,%ebx - vpxor %xmm8,%xmm3,%xmm3 - addl 52(%rsp),%eax - xorl %edx,%edi - movl %ebx,%esi - shldl $5,%ebx,%ebx - vpsrld $30,%xmm3,%xmm8 - vmovdqa %xmm9,32(%rsp) - addl %edi,%eax - xorl %edx,%esi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vpslld $2,%xmm3,%xmm3 - addl 56(%rsp),%ebp - xorl %ecx,%esi - movl %eax,%edi - shldl $5,%eax,%eax - addl %esi,%ebp - xorl %ecx,%edi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - vpor %xmm8,%xmm3,%xmm3 - addl 60(%rsp),%edx - xorl %ebx,%edi - movl %ebp,%esi - shldl $5,%ebp,%ebp - addl %edi,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %ebp,%edx - vpalignr $8,%xmm2,%xmm3,%xmm8 - vpxor %xmm0,%xmm4,%xmm4 - addl 0(%rsp),%ecx - xorl %eax,%esi - movl %edx,%edi - shldl $5,%edx,%edx - vpxor %xmm5,%xmm4,%xmm4 - addl %esi,%ecx - xorl %eax,%edi - vpaddd %xmm3,%xmm11,%xmm9 - shrdl $7,%ebp,%ebp - addl %edx,%ecx - vpxor %xmm8,%xmm4,%xmm4 - addl 4(%rsp),%ebx - xorl %ebp,%edi - movl %ecx,%esi - shldl $5,%ecx,%ecx - vpsrld $30,%xmm4,%xmm8 - vmovdqa %xmm9,48(%rsp) - addl %edi,%ebx - xorl %ebp,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - vpslld $2,%xmm4,%xmm4 - addl 8(%rsp),%eax - xorl %edx,%esi - movl %ebx,%edi - shldl $5,%ebx,%ebx - addl %esi,%eax - xorl %edx,%edi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vpor %xmm8,%xmm4,%xmm4 - addl 12(%rsp),%ebp - xorl %ecx,%edi - movl %eax,%esi - shldl $5,%eax,%eax - addl %edi,%ebp - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - vpalignr $8,%xmm3,%xmm4,%xmm8 - vpxor %xmm1,%xmm5,%xmm5 - addl 16(%rsp),%edx - xorl %ebx,%esi - movl %ebp,%edi - shldl $5,%ebp,%ebp - vpxor %xmm6,%xmm5,%xmm5 - addl %esi,%edx - xorl %ebx,%edi - vpaddd %xmm4,%xmm11,%xmm9 - shrdl $7,%eax,%eax - addl %ebp,%edx - vpxor %xmm8,%xmm5,%xmm5 - addl 20(%rsp),%ecx - xorl %eax,%edi - movl %edx,%esi - shldl $5,%edx,%edx - vpsrld $30,%xmm5,%xmm8 - vmovdqa %xmm9,0(%rsp) - addl %edi,%ecx - xorl %eax,%esi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - vpslld $2,%xmm5,%xmm5 - addl 24(%rsp),%ebx - xorl %ebp,%esi - movl %ecx,%edi - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %ebp,%edi - shrdl $7,%edx,%edx - addl %ecx,%ebx - vpor %xmm8,%xmm5,%xmm5 - addl 28(%rsp),%eax - shrdl $7,%ecx,%ecx - movl %ebx,%esi - xorl %edx,%edi - shldl $5,%ebx,%ebx - addl %edi,%eax - xorl %ecx,%esi - xorl %edx,%ecx - addl %ebx,%eax - vpalignr $8,%xmm4,%xmm5,%xmm8 - vpxor %xmm2,%xmm6,%xmm6 - addl 32(%rsp),%ebp - andl %ecx,%esi - xorl %edx,%ecx - shrdl $7,%ebx,%ebx - vpxor %xmm7,%xmm6,%xmm6 - movl %eax,%edi - xorl %ecx,%esi - vpaddd %xmm5,%xmm11,%xmm9 - shldl $5,%eax,%eax - addl %esi,%ebp - vpxor %xmm8,%xmm6,%xmm6 - xorl %ebx,%edi - xorl %ecx,%ebx - addl %eax,%ebp - addl 36(%rsp),%edx - vpsrld $30,%xmm6,%xmm8 - vmovdqa %xmm9,16(%rsp) - andl %ebx,%edi - xorl %ecx,%ebx - shrdl $7,%eax,%eax - movl %ebp,%esi - vpslld $2,%xmm6,%xmm6 - xorl %ebx,%edi - shldl $5,%ebp,%ebp - addl %edi,%edx - xorl %eax,%esi - xorl %ebx,%eax - addl %ebp,%edx - addl 40(%rsp),%ecx - andl %eax,%esi - vpor %xmm8,%xmm6,%xmm6 - xorl %ebx,%eax - shrdl $7,%ebp,%ebp - movl %edx,%edi - xorl %eax,%esi - shldl $5,%edx,%edx - addl %esi,%ecx - xorl %ebp,%edi - xorl %eax,%ebp - addl %edx,%ecx - addl 44(%rsp),%ebx - andl %ebp,%edi - xorl %eax,%ebp - shrdl $7,%edx,%edx - movl %ecx,%esi - xorl %ebp,%edi - shldl $5,%ecx,%ecx - addl %edi,%ebx - xorl %edx,%esi - xorl %ebp,%edx - addl %ecx,%ebx - vpalignr $8,%xmm5,%xmm6,%xmm8 - vpxor %xmm3,%xmm7,%xmm7 - addl 48(%rsp),%eax - andl %edx,%esi - xorl %ebp,%edx - shrdl $7,%ecx,%ecx - vpxor %xmm0,%xmm7,%xmm7 - movl %ebx,%edi - xorl %edx,%esi - vpaddd %xmm6,%xmm11,%xmm9 - vmovdqa 32(%r11),%xmm11 - shldl $5,%ebx,%ebx - addl %esi,%eax - vpxor %xmm8,%xmm7,%xmm7 - xorl %ecx,%edi - xorl %edx,%ecx - addl %ebx,%eax - addl 52(%rsp),%ebp - vpsrld $30,%xmm7,%xmm8 - vmovdqa %xmm9,32(%rsp) - andl %ecx,%edi - xorl %edx,%ecx - shrdl $7,%ebx,%ebx - movl %eax,%esi - vpslld $2,%xmm7,%xmm7 - xorl %ecx,%edi - shldl $5,%eax,%eax - addl %edi,%ebp - xorl %ebx,%esi - xorl %ecx,%ebx - addl %eax,%ebp - addl 56(%rsp),%edx - andl %ebx,%esi - vpor %xmm8,%xmm7,%xmm7 - xorl %ecx,%ebx - shrdl $7,%eax,%eax - movl %ebp,%edi - xorl %ebx,%esi - shldl $5,%ebp,%ebp - addl %esi,%edx - xorl %eax,%edi - xorl %ebx,%eax - addl %ebp,%edx - addl 60(%rsp),%ecx - andl %eax,%edi - xorl %ebx,%eax - shrdl $7,%ebp,%ebp - movl %edx,%esi - xorl %eax,%edi - shldl $5,%edx,%edx - addl %edi,%ecx - xorl %ebp,%esi - xorl %eax,%ebp - addl %edx,%ecx - vpalignr $8,%xmm6,%xmm7,%xmm8 - vpxor %xmm4,%xmm0,%xmm0 - addl 0(%rsp),%ebx - andl %ebp,%esi - xorl %eax,%ebp - shrdl $7,%edx,%edx - vpxor %xmm1,%xmm0,%xmm0 - movl %ecx,%edi - xorl %ebp,%esi - vpaddd %xmm7,%xmm11,%xmm9 - shldl $5,%ecx,%ecx - addl %esi,%ebx - vpxor %xmm8,%xmm0,%xmm0 - xorl %edx,%edi - xorl %ebp,%edx - addl %ecx,%ebx - addl 4(%rsp),%eax - vpsrld $30,%xmm0,%xmm8 - vmovdqa %xmm9,48(%rsp) - andl %edx,%edi - xorl %ebp,%edx - shrdl $7,%ecx,%ecx - movl %ebx,%esi - vpslld $2,%xmm0,%xmm0 - xorl %edx,%edi - shldl $5,%ebx,%ebx - addl %edi,%eax - xorl %ecx,%esi - xorl %edx,%ecx - addl %ebx,%eax - addl 8(%rsp),%ebp - andl %ecx,%esi - vpor %xmm8,%xmm0,%xmm0 - xorl %edx,%ecx - shrdl $7,%ebx,%ebx - movl %eax,%edi - xorl %ecx,%esi - shldl $5,%eax,%eax - addl %esi,%ebp - xorl %ebx,%edi - xorl %ecx,%ebx - addl %eax,%ebp - addl 12(%rsp),%edx - andl %ebx,%edi - xorl %ecx,%ebx - shrdl $7,%eax,%eax - movl %ebp,%esi - xorl %ebx,%edi - shldl $5,%ebp,%ebp - addl %edi,%edx - xorl %eax,%esi - xorl %ebx,%eax - addl %ebp,%edx - vpalignr $8,%xmm7,%xmm0,%xmm8 - vpxor %xmm5,%xmm1,%xmm1 - addl 16(%rsp),%ecx - andl %eax,%esi - xorl %ebx,%eax - shrdl $7,%ebp,%ebp - vpxor %xmm2,%xmm1,%xmm1 - movl %edx,%edi - xorl %eax,%esi - vpaddd %xmm0,%xmm11,%xmm9 - shldl $5,%edx,%edx - addl %esi,%ecx - vpxor %xmm8,%xmm1,%xmm1 - xorl %ebp,%edi - xorl %eax,%ebp - addl %edx,%ecx - addl 20(%rsp),%ebx - vpsrld $30,%xmm1,%xmm8 - vmovdqa %xmm9,0(%rsp) - andl %ebp,%edi - xorl %eax,%ebp - shrdl $7,%edx,%edx - movl %ecx,%esi - vpslld $2,%xmm1,%xmm1 - xorl %ebp,%edi - shldl $5,%ecx,%ecx - addl %edi,%ebx - xorl %edx,%esi - xorl %ebp,%edx - addl %ecx,%ebx - addl 24(%rsp),%eax - andl %edx,%esi - vpor %xmm8,%xmm1,%xmm1 - xorl %ebp,%edx - shrdl $7,%ecx,%ecx - movl %ebx,%edi - xorl %edx,%esi - shldl $5,%ebx,%ebx - addl %esi,%eax - xorl %ecx,%edi - xorl %edx,%ecx - addl %ebx,%eax - addl 28(%rsp),%ebp - andl %ecx,%edi - xorl %edx,%ecx - shrdl $7,%ebx,%ebx - movl %eax,%esi - xorl %ecx,%edi - shldl $5,%eax,%eax - addl %edi,%ebp - xorl %ebx,%esi - xorl %ecx,%ebx - addl %eax,%ebp - vpalignr $8,%xmm0,%xmm1,%xmm8 - vpxor %xmm6,%xmm2,%xmm2 - addl 32(%rsp),%edx - andl %ebx,%esi - xorl %ecx,%ebx - shrdl $7,%eax,%eax - vpxor %xmm3,%xmm2,%xmm2 - movl %ebp,%edi - xorl %ebx,%esi - vpaddd %xmm1,%xmm11,%xmm9 - shldl $5,%ebp,%ebp - addl %esi,%edx - vpxor %xmm8,%xmm2,%xmm2 - xorl %eax,%edi - xorl %ebx,%eax - addl %ebp,%edx - addl 36(%rsp),%ecx - vpsrld $30,%xmm2,%xmm8 - vmovdqa %xmm9,16(%rsp) - andl %eax,%edi - xorl %ebx,%eax - shrdl $7,%ebp,%ebp - movl %edx,%esi - vpslld $2,%xmm2,%xmm2 - xorl %eax,%edi - shldl $5,%edx,%edx - addl %edi,%ecx - xorl %ebp,%esi - xorl %eax,%ebp - addl %edx,%ecx - addl 40(%rsp),%ebx - andl %ebp,%esi - vpor %xmm8,%xmm2,%xmm2 - xorl %eax,%ebp - shrdl $7,%edx,%edx - movl %ecx,%edi - xorl %ebp,%esi - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %edx,%edi - xorl %ebp,%edx - addl %ecx,%ebx - addl 44(%rsp),%eax - andl %edx,%edi - xorl %ebp,%edx - shrdl $7,%ecx,%ecx - movl %ebx,%esi - xorl %edx,%edi - shldl $5,%ebx,%ebx - addl %edi,%eax - xorl %edx,%esi - addl %ebx,%eax - vpalignr $8,%xmm1,%xmm2,%xmm8 - vpxor %xmm7,%xmm3,%xmm3 - addl 48(%rsp),%ebp - xorl %ecx,%esi - movl %eax,%edi - shldl $5,%eax,%eax - vpxor %xmm4,%xmm3,%xmm3 - addl %esi,%ebp - xorl %ecx,%edi - vpaddd %xmm2,%xmm11,%xmm9 - shrdl $7,%ebx,%ebx - addl %eax,%ebp - vpxor %xmm8,%xmm3,%xmm3 - addl 52(%rsp),%edx - xorl %ebx,%edi - movl %ebp,%esi - shldl $5,%ebp,%ebp - vpsrld $30,%xmm3,%xmm8 - vmovdqa %xmm9,32(%rsp) - addl %edi,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %ebp,%edx - vpslld $2,%xmm3,%xmm3 - addl 56(%rsp),%ecx - xorl %eax,%esi - movl %edx,%edi - shldl $5,%edx,%edx - addl %esi,%ecx - xorl %eax,%edi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - vpor %xmm8,%xmm3,%xmm3 - addl 60(%rsp),%ebx - xorl %ebp,%edi - movl %ecx,%esi - shldl $5,%ecx,%ecx - addl %edi,%ebx - xorl %ebp,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 0(%rsp),%eax - vpaddd %xmm3,%xmm11,%xmm9 - xorl %edx,%esi - movl %ebx,%edi - shldl $5,%ebx,%ebx - addl %esi,%eax - vmovdqa %xmm9,48(%rsp) - xorl %edx,%edi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 4(%rsp),%ebp - xorl %ecx,%edi - movl %eax,%esi - shldl $5,%eax,%eax - addl %edi,%ebp - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - addl 8(%rsp),%edx - xorl %ebx,%esi - movl %ebp,%edi - shldl $5,%ebp,%ebp - addl %esi,%edx - xorl %ebx,%edi - shrdl $7,%eax,%eax - addl %ebp,%edx - addl 12(%rsp),%ecx - xorl %eax,%edi - movl %edx,%esi - shldl $5,%edx,%edx - addl %edi,%ecx - xorl %eax,%esi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - cmpq %r10,%r9 - je L$done_avx - vmovdqa 64(%r11),%xmm6 - vmovdqa -64(%r11),%xmm11 - vmovdqu 0(%r9),%xmm0 - vmovdqu 16(%r9),%xmm1 - vmovdqu 32(%r9),%xmm2 - vmovdqu 48(%r9),%xmm3 - vpshufb %xmm6,%xmm0,%xmm0 - addq $64,%r9 - addl 16(%rsp),%ebx - xorl %ebp,%esi - vpshufb %xmm6,%xmm1,%xmm1 - movl %ecx,%edi - shldl $5,%ecx,%ecx - vpaddd %xmm11,%xmm0,%xmm4 - addl %esi,%ebx - xorl %ebp,%edi - shrdl $7,%edx,%edx - addl %ecx,%ebx - vmovdqa %xmm4,0(%rsp) - addl 20(%rsp),%eax - xorl %edx,%edi - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %edi,%eax - xorl %edx,%esi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 24(%rsp),%ebp - xorl %ecx,%esi - movl %eax,%edi - shldl $5,%eax,%eax - addl %esi,%ebp - xorl %ecx,%edi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - addl 28(%rsp),%edx - xorl %ebx,%edi - movl %ebp,%esi - shldl $5,%ebp,%ebp - addl %edi,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %ebp,%edx - addl 32(%rsp),%ecx - xorl %eax,%esi - vpshufb %xmm6,%xmm2,%xmm2 - movl %edx,%edi - shldl $5,%edx,%edx - vpaddd %xmm11,%xmm1,%xmm5 - addl %esi,%ecx - xorl %eax,%edi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - vmovdqa %xmm5,16(%rsp) - addl 36(%rsp),%ebx - xorl %ebp,%edi - movl %ecx,%esi - shldl $5,%ecx,%ecx - addl %edi,%ebx - xorl %ebp,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 40(%rsp),%eax - xorl %edx,%esi - movl %ebx,%edi - shldl $5,%ebx,%ebx - addl %esi,%eax - xorl %edx,%edi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 44(%rsp),%ebp - xorl %ecx,%edi - movl %eax,%esi - shldl $5,%eax,%eax - addl %edi,%ebp - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - addl 48(%rsp),%edx - xorl %ebx,%esi - vpshufb %xmm6,%xmm3,%xmm3 - movl %ebp,%edi - shldl $5,%ebp,%ebp - vpaddd %xmm11,%xmm2,%xmm6 - addl %esi,%edx - xorl %ebx,%edi - shrdl $7,%eax,%eax - addl %ebp,%edx - vmovdqa %xmm6,32(%rsp) - addl 52(%rsp),%ecx - xorl %eax,%edi - movl %edx,%esi - shldl $5,%edx,%edx - addl %edi,%ecx - xorl %eax,%esi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - addl 56(%rsp),%ebx - xorl %ebp,%esi - movl %ecx,%edi - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %ebp,%edi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 60(%rsp),%eax - xorl %edx,%edi - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %edi,%eax - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 0(%r8),%eax - addl 4(%r8),%esi - addl 8(%r8),%ecx - addl 12(%r8),%edx - movl %eax,0(%r8) - addl 16(%r8),%ebp - movl %esi,4(%r8) - movl %esi,%ebx - movl %ecx,8(%r8) - movl %ecx,%edi - movl %edx,12(%r8) - xorl %edx,%edi - movl %ebp,16(%r8) - andl %edi,%esi - jmp L$oop_avx - -.p2align 4 -L$done_avx: - addl 16(%rsp),%ebx - xorl %ebp,%esi - movl %ecx,%edi - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %ebp,%edi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 20(%rsp),%eax - xorl %edx,%edi - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %edi,%eax - xorl %edx,%esi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 24(%rsp),%ebp - xorl %ecx,%esi - movl %eax,%edi - shldl $5,%eax,%eax - addl %esi,%ebp - xorl %ecx,%edi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - addl 28(%rsp),%edx - xorl %ebx,%edi - movl %ebp,%esi - shldl $5,%ebp,%ebp - addl %edi,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %ebp,%edx - addl 32(%rsp),%ecx - xorl %eax,%esi - movl %edx,%edi - shldl $5,%edx,%edx - addl %esi,%ecx - xorl %eax,%edi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - addl 36(%rsp),%ebx - xorl %ebp,%edi - movl %ecx,%esi - shldl $5,%ecx,%ecx - addl %edi,%ebx - xorl %ebp,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 40(%rsp),%eax - xorl %edx,%esi - movl %ebx,%edi - shldl $5,%ebx,%ebx - addl %esi,%eax - xorl %edx,%edi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 44(%rsp),%ebp - xorl %ecx,%edi - movl %eax,%esi - shldl $5,%eax,%eax - addl %edi,%ebp - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%ebp - addl 48(%rsp),%edx - xorl %ebx,%esi - movl %ebp,%edi - shldl $5,%ebp,%ebp - addl %esi,%edx - xorl %ebx,%edi - shrdl $7,%eax,%eax - addl %ebp,%edx - addl 52(%rsp),%ecx - xorl %eax,%edi - movl %edx,%esi - shldl $5,%edx,%edx - addl %edi,%ecx - xorl %eax,%esi - shrdl $7,%ebp,%ebp - addl %edx,%ecx - addl 56(%rsp),%ebx - xorl %ebp,%esi - movl %ecx,%edi - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %ebp,%edi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 60(%rsp),%eax - xorl %edx,%edi - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %edi,%eax - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vzeroupper - - addl 0(%r8),%eax - addl 4(%r8),%esi - addl 8(%r8),%ecx - movl %eax,0(%r8) - addl 12(%r8),%edx - movl %esi,4(%r8) - addl 16(%r8),%ebp - movl %ecx,8(%r8) - movl %edx,12(%r8) - movl %ebp,16(%r8) - leaq (%r14),%rsi - movq -40(%rsi),%r14 - movq -32(%rsi),%r13 - movq -24(%rsi),%r12 - movq -16(%rsi),%rbp - movq -8(%rsi),%rbx - leaq (%rsi),%rsp -L$epilogue_avx: - .byte 0xf3,0xc3 - - -.p2align 4 -sha1_block_data_order_avx2: -_avx2_shortcut: - movq %rsp,%rax - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - vzeroupper - movq %rax,%r14 - movq %rdi,%r8 - movq %rsi,%r9 - movq %rdx,%r10 - - leaq -640(%rsp),%rsp - shlq $6,%r10 - leaq 64(%r9),%r13 - andq $-128,%rsp - addq %r9,%r10 - leaq K_XX_XX+64(%rip),%r11 - - movl 0(%r8),%eax - cmpq %r10,%r13 - cmovaeq %r9,%r13 - movl 4(%r8),%ebp - movl 8(%r8),%ecx - movl 12(%r8),%edx - movl 16(%r8),%esi - vmovdqu 64(%r11),%ymm6 - - vmovdqu (%r9),%xmm0 - vmovdqu 16(%r9),%xmm1 - vmovdqu 32(%r9),%xmm2 - vmovdqu 48(%r9),%xmm3 - leaq 64(%r9),%r9 - vinserti128 $1,(%r13),%ymm0,%ymm0 - vinserti128 $1,16(%r13),%ymm1,%ymm1 - vpshufb %ymm6,%ymm0,%ymm0 - vinserti128 $1,32(%r13),%ymm2,%ymm2 - vpshufb %ymm6,%ymm1,%ymm1 - vinserti128 $1,48(%r13),%ymm3,%ymm3 - vpshufb %ymm6,%ymm2,%ymm2 - vmovdqu -64(%r11),%ymm11 - vpshufb %ymm6,%ymm3,%ymm3 - - vpaddd %ymm11,%ymm0,%ymm4 - vpaddd %ymm11,%ymm1,%ymm5 - vmovdqu %ymm4,0(%rsp) - vpaddd %ymm11,%ymm2,%ymm6 - vmovdqu %ymm5,32(%rsp) - vpaddd %ymm11,%ymm3,%ymm7 - vmovdqu %ymm6,64(%rsp) - vmovdqu %ymm7,96(%rsp) - vpalignr $8,%ymm0,%ymm1,%ymm4 - vpsrldq $4,%ymm3,%ymm8 - vpxor %ymm0,%ymm4,%ymm4 - vpxor %ymm2,%ymm8,%ymm8 - vpxor %ymm8,%ymm4,%ymm4 - vpsrld $31,%ymm4,%ymm8 - vpslldq $12,%ymm4,%ymm10 - vpaddd %ymm4,%ymm4,%ymm4 - vpsrld $30,%ymm10,%ymm9 - vpor %ymm8,%ymm4,%ymm4 - vpslld $2,%ymm10,%ymm10 - vpxor %ymm9,%ymm4,%ymm4 - vpxor %ymm10,%ymm4,%ymm4 - vpaddd %ymm11,%ymm4,%ymm9 - vmovdqu %ymm9,128(%rsp) - vpalignr $8,%ymm1,%ymm2,%ymm5 - vpsrldq $4,%ymm4,%ymm8 - vpxor %ymm1,%ymm5,%ymm5 - vpxor %ymm3,%ymm8,%ymm8 - vpxor %ymm8,%ymm5,%ymm5 - vpsrld $31,%ymm5,%ymm8 - vmovdqu -32(%r11),%ymm11 - vpslldq $12,%ymm5,%ymm10 - vpaddd %ymm5,%ymm5,%ymm5 - vpsrld $30,%ymm10,%ymm9 - vpor %ymm8,%ymm5,%ymm5 - vpslld $2,%ymm10,%ymm10 - vpxor %ymm9,%ymm5,%ymm5 - vpxor %ymm10,%ymm5,%ymm5 - vpaddd %ymm11,%ymm5,%ymm9 - vmovdqu %ymm9,160(%rsp) - vpalignr $8,%ymm2,%ymm3,%ymm6 - vpsrldq $4,%ymm5,%ymm8 - vpxor %ymm2,%ymm6,%ymm6 - vpxor %ymm4,%ymm8,%ymm8 - vpxor %ymm8,%ymm6,%ymm6 - vpsrld $31,%ymm6,%ymm8 - vpslldq $12,%ymm6,%ymm10 - vpaddd %ymm6,%ymm6,%ymm6 - vpsrld $30,%ymm10,%ymm9 - vpor %ymm8,%ymm6,%ymm6 - vpslld $2,%ymm10,%ymm10 - vpxor %ymm9,%ymm6,%ymm6 - vpxor %ymm10,%ymm6,%ymm6 - vpaddd %ymm11,%ymm6,%ymm9 - vmovdqu %ymm9,192(%rsp) - vpalignr $8,%ymm3,%ymm4,%ymm7 - vpsrldq $4,%ymm6,%ymm8 - vpxor %ymm3,%ymm7,%ymm7 - vpxor %ymm5,%ymm8,%ymm8 - vpxor %ymm8,%ymm7,%ymm7 - vpsrld $31,%ymm7,%ymm8 - vpslldq $12,%ymm7,%ymm10 - vpaddd %ymm7,%ymm7,%ymm7 - vpsrld $30,%ymm10,%ymm9 - vpor %ymm8,%ymm7,%ymm7 - vpslld $2,%ymm10,%ymm10 - vpxor %ymm9,%ymm7,%ymm7 - vpxor %ymm10,%ymm7,%ymm7 - vpaddd %ymm11,%ymm7,%ymm9 - vmovdqu %ymm9,224(%rsp) - leaq 128(%rsp),%r13 - jmp L$oop_avx2 -.p2align 5 -L$oop_avx2: - rorxl $2,%ebp,%ebx - andnl %edx,%ebp,%edi - andl %ecx,%ebp - xorl %edi,%ebp - jmp L$align32_1 -.p2align 5 -L$align32_1: - vpalignr $8,%ymm6,%ymm7,%ymm8 - vpxor %ymm4,%ymm0,%ymm0 - addl -128(%r13),%esi - andnl %ecx,%eax,%edi - vpxor %ymm1,%ymm0,%ymm0 - addl %ebp,%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - vpxor %ymm8,%ymm0,%ymm0 - andl %ebx,%eax - addl %r12d,%esi - xorl %edi,%eax - vpsrld $30,%ymm0,%ymm8 - vpslld $2,%ymm0,%ymm0 - addl -124(%r13),%edx - andnl %ebx,%esi,%edi - addl %eax,%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - andl %ebp,%esi - vpor %ymm8,%ymm0,%ymm0 - addl %r12d,%edx - xorl %edi,%esi - addl -120(%r13),%ecx - andnl %ebp,%edx,%edi - vpaddd %ymm11,%ymm0,%ymm9 - addl %esi,%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - andl %eax,%edx - vmovdqu %ymm9,256(%rsp) - addl %r12d,%ecx - xorl %edi,%edx - addl -116(%r13),%ebx - andnl %eax,%ecx,%edi - addl %edx,%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - andl %esi,%ecx - addl %r12d,%ebx - xorl %edi,%ecx - addl -96(%r13),%ebp - andnl %esi,%ebx,%edi - addl %ecx,%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - andl %edx,%ebx - addl %r12d,%ebp - xorl %edi,%ebx - vpalignr $8,%ymm7,%ymm0,%ymm8 - vpxor %ymm5,%ymm1,%ymm1 - addl -92(%r13),%eax - andnl %edx,%ebp,%edi - vpxor %ymm2,%ymm1,%ymm1 - addl %ebx,%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - vpxor %ymm8,%ymm1,%ymm1 - andl %ecx,%ebp - addl %r12d,%eax - xorl %edi,%ebp - vpsrld $30,%ymm1,%ymm8 - vpslld $2,%ymm1,%ymm1 - addl -88(%r13),%esi - andnl %ecx,%eax,%edi - addl %ebp,%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - andl %ebx,%eax - vpor %ymm8,%ymm1,%ymm1 - addl %r12d,%esi - xorl %edi,%eax - addl -84(%r13),%edx - andnl %ebx,%esi,%edi - vpaddd %ymm11,%ymm1,%ymm9 - addl %eax,%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - andl %ebp,%esi - vmovdqu %ymm9,288(%rsp) - addl %r12d,%edx - xorl %edi,%esi - addl -64(%r13),%ecx - andnl %ebp,%edx,%edi - addl %esi,%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - andl %eax,%edx - addl %r12d,%ecx - xorl %edi,%edx - addl -60(%r13),%ebx - andnl %eax,%ecx,%edi - addl %edx,%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - andl %esi,%ecx - addl %r12d,%ebx - xorl %edi,%ecx - vpalignr $8,%ymm0,%ymm1,%ymm8 - vpxor %ymm6,%ymm2,%ymm2 - addl -56(%r13),%ebp - andnl %esi,%ebx,%edi - vpxor %ymm3,%ymm2,%ymm2 - vmovdqu 0(%r11),%ymm11 - addl %ecx,%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - vpxor %ymm8,%ymm2,%ymm2 - andl %edx,%ebx - addl %r12d,%ebp - xorl %edi,%ebx - vpsrld $30,%ymm2,%ymm8 - vpslld $2,%ymm2,%ymm2 - addl -52(%r13),%eax - andnl %edx,%ebp,%edi - addl %ebx,%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - andl %ecx,%ebp - vpor %ymm8,%ymm2,%ymm2 - addl %r12d,%eax - xorl %edi,%ebp - addl -32(%r13),%esi - andnl %ecx,%eax,%edi - vpaddd %ymm11,%ymm2,%ymm9 - addl %ebp,%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - andl %ebx,%eax - vmovdqu %ymm9,320(%rsp) - addl %r12d,%esi - xorl %edi,%eax - addl -28(%r13),%edx - andnl %ebx,%esi,%edi - addl %eax,%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - andl %ebp,%esi - addl %r12d,%edx - xorl %edi,%esi - addl -24(%r13),%ecx - andnl %ebp,%edx,%edi - addl %esi,%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - andl %eax,%edx - addl %r12d,%ecx - xorl %edi,%edx - vpalignr $8,%ymm1,%ymm2,%ymm8 - vpxor %ymm7,%ymm3,%ymm3 - addl -20(%r13),%ebx - andnl %eax,%ecx,%edi - vpxor %ymm4,%ymm3,%ymm3 - addl %edx,%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - vpxor %ymm8,%ymm3,%ymm3 - andl %esi,%ecx - addl %r12d,%ebx - xorl %edi,%ecx - vpsrld $30,%ymm3,%ymm8 - vpslld $2,%ymm3,%ymm3 - addl 0(%r13),%ebp - andnl %esi,%ebx,%edi - addl %ecx,%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - andl %edx,%ebx - vpor %ymm8,%ymm3,%ymm3 - addl %r12d,%ebp - xorl %edi,%ebx - addl 4(%r13),%eax - andnl %edx,%ebp,%edi - vpaddd %ymm11,%ymm3,%ymm9 - addl %ebx,%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - andl %ecx,%ebp - vmovdqu %ymm9,352(%rsp) - addl %r12d,%eax - xorl %edi,%ebp - addl 8(%r13),%esi - andnl %ecx,%eax,%edi - addl %ebp,%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - andl %ebx,%eax - addl %r12d,%esi - xorl %edi,%eax - addl 12(%r13),%edx - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - xorl %ebx,%esi - vpalignr $8,%ymm2,%ymm3,%ymm8 - vpxor %ymm0,%ymm4,%ymm4 - addl 32(%r13),%ecx - leal (%rcx,%rsi,1),%ecx - vpxor %ymm5,%ymm4,%ymm4 - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - vpxor %ymm8,%ymm4,%ymm4 - addl %r12d,%ecx - xorl %ebp,%edx - addl 36(%r13),%ebx - vpsrld $30,%ymm4,%ymm8 - vpslld $2,%ymm4,%ymm4 - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - xorl %eax,%ecx - vpor %ymm8,%ymm4,%ymm4 - addl 40(%r13),%ebp - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - vpaddd %ymm11,%ymm4,%ymm9 - xorl %edx,%ebx - addl %r12d,%ebp - xorl %esi,%ebx - addl 44(%r13),%eax - vmovdqu %ymm9,384(%rsp) - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - xorl %edx,%ebp - addl 64(%r13),%esi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - xorl %ecx,%eax - vpalignr $8,%ymm3,%ymm4,%ymm8 - vpxor %ymm1,%ymm5,%ymm5 - addl 68(%r13),%edx - leal (%rdx,%rax,1),%edx - vpxor %ymm6,%ymm5,%ymm5 - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - vpxor %ymm8,%ymm5,%ymm5 - addl %r12d,%edx - xorl %ebx,%esi - addl 72(%r13),%ecx - vpsrld $30,%ymm5,%ymm8 - vpslld $2,%ymm5,%ymm5 - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - addl %r12d,%ecx - xorl %ebp,%edx - vpor %ymm8,%ymm5,%ymm5 - addl 76(%r13),%ebx - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - vpaddd %ymm11,%ymm5,%ymm9 - xorl %esi,%ecx - addl %r12d,%ebx - xorl %eax,%ecx - addl 96(%r13),%ebp - vmovdqu %ymm9,416(%rsp) - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - xorl %esi,%ebx - addl 100(%r13),%eax - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - xorl %edx,%ebp - vpalignr $8,%ymm4,%ymm5,%ymm8 - vpxor %ymm2,%ymm6,%ymm6 - addl 104(%r13),%esi - leal (%rsi,%rbp,1),%esi - vpxor %ymm7,%ymm6,%ymm6 - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - vpxor %ymm8,%ymm6,%ymm6 - addl %r12d,%esi - xorl %ecx,%eax - addl 108(%r13),%edx - leaq 256(%r13),%r13 - vpsrld $30,%ymm6,%ymm8 - vpslld $2,%ymm6,%ymm6 - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - xorl %ebx,%esi - vpor %ymm8,%ymm6,%ymm6 - addl -128(%r13),%ecx - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - vpaddd %ymm11,%ymm6,%ymm9 - xorl %eax,%edx - addl %r12d,%ecx - xorl %ebp,%edx - addl -124(%r13),%ebx - vmovdqu %ymm9,448(%rsp) - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - xorl %eax,%ecx - addl -120(%r13),%ebp - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - xorl %esi,%ebx - vpalignr $8,%ymm5,%ymm6,%ymm8 - vpxor %ymm3,%ymm7,%ymm7 - addl -116(%r13),%eax - leal (%rax,%rbx,1),%eax - vpxor %ymm0,%ymm7,%ymm7 - vmovdqu 32(%r11),%ymm11 - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - vpxor %ymm8,%ymm7,%ymm7 - addl %r12d,%eax - xorl %edx,%ebp - addl -96(%r13),%esi - vpsrld $30,%ymm7,%ymm8 - vpslld $2,%ymm7,%ymm7 - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - xorl %ecx,%eax - vpor %ymm8,%ymm7,%ymm7 - addl -92(%r13),%edx - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - vpaddd %ymm11,%ymm7,%ymm9 - xorl %ebp,%esi - addl %r12d,%edx - xorl %ebx,%esi - addl -88(%r13),%ecx - vmovdqu %ymm9,480(%rsp) - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - addl %r12d,%ecx - xorl %ebp,%edx - addl -84(%r13),%ebx - movl %esi,%edi - xorl %eax,%edi - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - andl %edi,%ecx - jmp L$align32_2 -.p2align 5 -L$align32_2: - vpalignr $8,%ymm6,%ymm7,%ymm8 - vpxor %ymm4,%ymm0,%ymm0 - addl -64(%r13),%ebp - xorl %esi,%ecx - vpxor %ymm1,%ymm0,%ymm0 - movl %edx,%edi - xorl %esi,%edi - leal (%rcx,%rbp,1),%ebp - vpxor %ymm8,%ymm0,%ymm0 - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - vpsrld $30,%ymm0,%ymm8 - vpslld $2,%ymm0,%ymm0 - addl %r12d,%ebp - andl %edi,%ebx - addl -60(%r13),%eax - xorl %edx,%ebx - movl %ecx,%edi - xorl %edx,%edi - vpor %ymm8,%ymm0,%ymm0 - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - vpaddd %ymm11,%ymm0,%ymm9 - addl %r12d,%eax - andl %edi,%ebp - addl -56(%r13),%esi - xorl %ecx,%ebp - vmovdqu %ymm9,512(%rsp) - movl %ebx,%edi - xorl %ecx,%edi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - andl %edi,%eax - addl -52(%r13),%edx - xorl %ebx,%eax - movl %ebp,%edi - xorl %ebx,%edi - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - andl %edi,%esi - addl -32(%r13),%ecx - xorl %ebp,%esi - movl %eax,%edi - xorl %ebp,%edi - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - addl %r12d,%ecx - andl %edi,%edx - vpalignr $8,%ymm7,%ymm0,%ymm8 - vpxor %ymm5,%ymm1,%ymm1 - addl -28(%r13),%ebx - xorl %eax,%edx - vpxor %ymm2,%ymm1,%ymm1 - movl %esi,%edi - xorl %eax,%edi - leal (%rbx,%rdx,1),%ebx - vpxor %ymm8,%ymm1,%ymm1 - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - vpsrld $30,%ymm1,%ymm8 - vpslld $2,%ymm1,%ymm1 - addl %r12d,%ebx - andl %edi,%ecx - addl -24(%r13),%ebp - xorl %esi,%ecx - movl %edx,%edi - xorl %esi,%edi - vpor %ymm8,%ymm1,%ymm1 - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - vpaddd %ymm11,%ymm1,%ymm9 - addl %r12d,%ebp - andl %edi,%ebx - addl -20(%r13),%eax - xorl %edx,%ebx - vmovdqu %ymm9,544(%rsp) - movl %ecx,%edi - xorl %edx,%edi - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - andl %edi,%ebp - addl 0(%r13),%esi - xorl %ecx,%ebp - movl %ebx,%edi - xorl %ecx,%edi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - andl %edi,%eax - addl 4(%r13),%edx - xorl %ebx,%eax - movl %ebp,%edi - xorl %ebx,%edi - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - andl %edi,%esi - vpalignr $8,%ymm0,%ymm1,%ymm8 - vpxor %ymm6,%ymm2,%ymm2 - addl 8(%r13),%ecx - xorl %ebp,%esi - vpxor %ymm3,%ymm2,%ymm2 - movl %eax,%edi - xorl %ebp,%edi - leal (%rcx,%rsi,1),%ecx - vpxor %ymm8,%ymm2,%ymm2 - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - vpsrld $30,%ymm2,%ymm8 - vpslld $2,%ymm2,%ymm2 - addl %r12d,%ecx - andl %edi,%edx - addl 12(%r13),%ebx - xorl %eax,%edx - movl %esi,%edi - xorl %eax,%edi - vpor %ymm8,%ymm2,%ymm2 - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - vpaddd %ymm11,%ymm2,%ymm9 - addl %r12d,%ebx - andl %edi,%ecx - addl 32(%r13),%ebp - xorl %esi,%ecx - vmovdqu %ymm9,576(%rsp) - movl %edx,%edi - xorl %esi,%edi - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - andl %edi,%ebx - addl 36(%r13),%eax - xorl %edx,%ebx - movl %ecx,%edi - xorl %edx,%edi - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - andl %edi,%ebp - addl 40(%r13),%esi - xorl %ecx,%ebp - movl %ebx,%edi - xorl %ecx,%edi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - andl %edi,%eax - vpalignr $8,%ymm1,%ymm2,%ymm8 - vpxor %ymm7,%ymm3,%ymm3 - addl 44(%r13),%edx - xorl %ebx,%eax - vpxor %ymm4,%ymm3,%ymm3 - movl %ebp,%edi - xorl %ebx,%edi - leal (%rdx,%rax,1),%edx - vpxor %ymm8,%ymm3,%ymm3 - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - vpsrld $30,%ymm3,%ymm8 - vpslld $2,%ymm3,%ymm3 - addl %r12d,%edx - andl %edi,%esi - addl 64(%r13),%ecx - xorl %ebp,%esi - movl %eax,%edi - xorl %ebp,%edi - vpor %ymm8,%ymm3,%ymm3 - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - vpaddd %ymm11,%ymm3,%ymm9 - addl %r12d,%ecx - andl %edi,%edx - addl 68(%r13),%ebx - xorl %eax,%edx - vmovdqu %ymm9,608(%rsp) - movl %esi,%edi - xorl %eax,%edi - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - andl %edi,%ecx - addl 72(%r13),%ebp - xorl %esi,%ecx - movl %edx,%edi - xorl %esi,%edi - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - andl %edi,%ebx - addl 76(%r13),%eax - xorl %edx,%ebx - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - xorl %edx,%ebp - addl 96(%r13),%esi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - xorl %ecx,%eax - addl 100(%r13),%edx - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - xorl %ebx,%esi - addl 104(%r13),%ecx - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - addl %r12d,%ecx - xorl %ebp,%edx - addl 108(%r13),%ebx - leaq 256(%r13),%r13 - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - xorl %eax,%ecx - addl -128(%r13),%ebp - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - xorl %esi,%ebx - addl -124(%r13),%eax - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - xorl %edx,%ebp - addl -120(%r13),%esi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - xorl %ecx,%eax - addl -116(%r13),%edx - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - xorl %ebx,%esi - addl -96(%r13),%ecx - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - addl %r12d,%ecx - xorl %ebp,%edx - addl -92(%r13),%ebx - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - xorl %eax,%ecx - addl -88(%r13),%ebp - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - xorl %esi,%ebx - addl -84(%r13),%eax - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - xorl %edx,%ebp - addl -64(%r13),%esi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - xorl %ecx,%eax - addl -60(%r13),%edx - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - xorl %ebx,%esi - addl -56(%r13),%ecx - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - addl %r12d,%ecx - xorl %ebp,%edx - addl -52(%r13),%ebx - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - xorl %eax,%ecx - addl -32(%r13),%ebp - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - xorl %esi,%ebx - addl -28(%r13),%eax - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - xorl %edx,%ebp - addl -24(%r13),%esi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - xorl %ecx,%eax - addl -20(%r13),%edx - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - addl %r12d,%edx - leaq 128(%r9),%r13 - leaq 128(%r9),%rdi - cmpq %r10,%r13 - cmovaeq %r9,%r13 - - - addl 0(%r8),%edx - addl 4(%r8),%esi - addl 8(%r8),%ebp - movl %edx,0(%r8) - addl 12(%r8),%ebx - movl %esi,4(%r8) - movl %edx,%eax - addl 16(%r8),%ecx - movl %ebp,%r12d - movl %ebp,8(%r8) - movl %ebx,%edx - - movl %ebx,12(%r8) - movl %esi,%ebp - movl %ecx,16(%r8) - - movl %ecx,%esi - movl %r12d,%ecx - - - cmpq %r10,%r9 - je L$done_avx2 - vmovdqu 64(%r11),%ymm6 - cmpq %r10,%rdi - ja L$ast_avx2 - - vmovdqu -64(%rdi),%xmm0 - vmovdqu -48(%rdi),%xmm1 - vmovdqu -32(%rdi),%xmm2 - vmovdqu -16(%rdi),%xmm3 - vinserti128 $1,0(%r13),%ymm0,%ymm0 - vinserti128 $1,16(%r13),%ymm1,%ymm1 - vinserti128 $1,32(%r13),%ymm2,%ymm2 - vinserti128 $1,48(%r13),%ymm3,%ymm3 - jmp L$ast_avx2 - -.p2align 5 -L$ast_avx2: - leaq 128+16(%rsp),%r13 - rorxl $2,%ebp,%ebx - andnl %edx,%ebp,%edi - andl %ecx,%ebp - xorl %edi,%ebp - subq $-128,%r9 - addl -128(%r13),%esi - andnl %ecx,%eax,%edi - addl %ebp,%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - andl %ebx,%eax - addl %r12d,%esi - xorl %edi,%eax - addl -124(%r13),%edx - andnl %ebx,%esi,%edi - addl %eax,%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - andl %ebp,%esi - addl %r12d,%edx - xorl %edi,%esi - addl -120(%r13),%ecx - andnl %ebp,%edx,%edi - addl %esi,%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - andl %eax,%edx - addl %r12d,%ecx - xorl %edi,%edx - addl -116(%r13),%ebx - andnl %eax,%ecx,%edi - addl %edx,%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - andl %esi,%ecx - addl %r12d,%ebx - xorl %edi,%ecx - addl -96(%r13),%ebp - andnl %esi,%ebx,%edi - addl %ecx,%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - andl %edx,%ebx - addl %r12d,%ebp - xorl %edi,%ebx - addl -92(%r13),%eax - andnl %edx,%ebp,%edi - addl %ebx,%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - andl %ecx,%ebp - addl %r12d,%eax - xorl %edi,%ebp - addl -88(%r13),%esi - andnl %ecx,%eax,%edi - addl %ebp,%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - andl %ebx,%eax - addl %r12d,%esi - xorl %edi,%eax - addl -84(%r13),%edx - andnl %ebx,%esi,%edi - addl %eax,%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - andl %ebp,%esi - addl %r12d,%edx - xorl %edi,%esi - addl -64(%r13),%ecx - andnl %ebp,%edx,%edi - addl %esi,%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - andl %eax,%edx - addl %r12d,%ecx - xorl %edi,%edx - addl -60(%r13),%ebx - andnl %eax,%ecx,%edi - addl %edx,%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - andl %esi,%ecx - addl %r12d,%ebx - xorl %edi,%ecx - addl -56(%r13),%ebp - andnl %esi,%ebx,%edi - addl %ecx,%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - andl %edx,%ebx - addl %r12d,%ebp - xorl %edi,%ebx - addl -52(%r13),%eax - andnl %edx,%ebp,%edi - addl %ebx,%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - andl %ecx,%ebp - addl %r12d,%eax - xorl %edi,%ebp - addl -32(%r13),%esi - andnl %ecx,%eax,%edi - addl %ebp,%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - andl %ebx,%eax - addl %r12d,%esi - xorl %edi,%eax - addl -28(%r13),%edx - andnl %ebx,%esi,%edi - addl %eax,%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - andl %ebp,%esi - addl %r12d,%edx - xorl %edi,%esi - addl -24(%r13),%ecx - andnl %ebp,%edx,%edi - addl %esi,%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - andl %eax,%edx - addl %r12d,%ecx - xorl %edi,%edx - addl -20(%r13),%ebx - andnl %eax,%ecx,%edi - addl %edx,%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - andl %esi,%ecx - addl %r12d,%ebx - xorl %edi,%ecx - addl 0(%r13),%ebp - andnl %esi,%ebx,%edi - addl %ecx,%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - andl %edx,%ebx - addl %r12d,%ebp - xorl %edi,%ebx - addl 4(%r13),%eax - andnl %edx,%ebp,%edi - addl %ebx,%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - andl %ecx,%ebp - addl %r12d,%eax - xorl %edi,%ebp - addl 8(%r13),%esi - andnl %ecx,%eax,%edi - addl %ebp,%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - andl %ebx,%eax - addl %r12d,%esi - xorl %edi,%eax - addl 12(%r13),%edx - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - xorl %ebx,%esi - addl 32(%r13),%ecx - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - addl %r12d,%ecx - xorl %ebp,%edx - addl 36(%r13),%ebx - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - xorl %eax,%ecx - addl 40(%r13),%ebp - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - xorl %esi,%ebx - addl 44(%r13),%eax - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - xorl %edx,%ebp - addl 64(%r13),%esi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - xorl %ecx,%eax - vmovdqu -64(%r11),%ymm11 - vpshufb %ymm6,%ymm0,%ymm0 - addl 68(%r13),%edx - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - xorl %ebx,%esi - addl 72(%r13),%ecx - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - addl %r12d,%ecx - xorl %ebp,%edx - addl 76(%r13),%ebx - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - xorl %eax,%ecx - addl 96(%r13),%ebp - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - xorl %esi,%ebx - addl 100(%r13),%eax - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - xorl %edx,%ebp - vpshufb %ymm6,%ymm1,%ymm1 - vpaddd %ymm11,%ymm0,%ymm8 - addl 104(%r13),%esi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - xorl %ecx,%eax - addl 108(%r13),%edx - leaq 256(%r13),%r13 - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - xorl %ebx,%esi - addl -128(%r13),%ecx - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - addl %r12d,%ecx - xorl %ebp,%edx - addl -124(%r13),%ebx - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - xorl %eax,%ecx - addl -120(%r13),%ebp - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - xorl %esi,%ebx - vmovdqu %ymm8,0(%rsp) - vpshufb %ymm6,%ymm2,%ymm2 - vpaddd %ymm11,%ymm1,%ymm9 - addl -116(%r13),%eax - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - xorl %edx,%ebp - addl -96(%r13),%esi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - xorl %ecx,%eax - addl -92(%r13),%edx - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - xorl %ebx,%esi - addl -88(%r13),%ecx - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - addl %r12d,%ecx - xorl %ebp,%edx - addl -84(%r13),%ebx - movl %esi,%edi - xorl %eax,%edi - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - andl %edi,%ecx - vmovdqu %ymm9,32(%rsp) - vpshufb %ymm6,%ymm3,%ymm3 - vpaddd %ymm11,%ymm2,%ymm6 - addl -64(%r13),%ebp - xorl %esi,%ecx - movl %edx,%edi - xorl %esi,%edi - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - andl %edi,%ebx - addl -60(%r13),%eax - xorl %edx,%ebx - movl %ecx,%edi - xorl %edx,%edi - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - andl %edi,%ebp - addl -56(%r13),%esi - xorl %ecx,%ebp - movl %ebx,%edi - xorl %ecx,%edi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - andl %edi,%eax - addl -52(%r13),%edx - xorl %ebx,%eax - movl %ebp,%edi - xorl %ebx,%edi - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - andl %edi,%esi - addl -32(%r13),%ecx - xorl %ebp,%esi - movl %eax,%edi - xorl %ebp,%edi - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - addl %r12d,%ecx - andl %edi,%edx - jmp L$align32_3 -.p2align 5 -L$align32_3: - vmovdqu %ymm6,64(%rsp) - vpaddd %ymm11,%ymm3,%ymm7 - addl -28(%r13),%ebx - xorl %eax,%edx - movl %esi,%edi - xorl %eax,%edi - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - andl %edi,%ecx - addl -24(%r13),%ebp - xorl %esi,%ecx - movl %edx,%edi - xorl %esi,%edi - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - andl %edi,%ebx - addl -20(%r13),%eax - xorl %edx,%ebx - movl %ecx,%edi - xorl %edx,%edi - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - andl %edi,%ebp - addl 0(%r13),%esi - xorl %ecx,%ebp - movl %ebx,%edi - xorl %ecx,%edi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - andl %edi,%eax - addl 4(%r13),%edx - xorl %ebx,%eax - movl %ebp,%edi - xorl %ebx,%edi - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - andl %edi,%esi - vmovdqu %ymm7,96(%rsp) - addl 8(%r13),%ecx - xorl %ebp,%esi - movl %eax,%edi - xorl %ebp,%edi - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - addl %r12d,%ecx - andl %edi,%edx - addl 12(%r13),%ebx - xorl %eax,%edx - movl %esi,%edi - xorl %eax,%edi - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - andl %edi,%ecx - addl 32(%r13),%ebp - xorl %esi,%ecx - movl %edx,%edi - xorl %esi,%edi - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - andl %edi,%ebx - addl 36(%r13),%eax - xorl %edx,%ebx - movl %ecx,%edi - xorl %edx,%edi - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - andl %edi,%ebp - addl 40(%r13),%esi - xorl %ecx,%ebp - movl %ebx,%edi - xorl %ecx,%edi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - andl %edi,%eax - vpalignr $8,%ymm0,%ymm1,%ymm4 - addl 44(%r13),%edx - xorl %ebx,%eax - movl %ebp,%edi - xorl %ebx,%edi - vpsrldq $4,%ymm3,%ymm8 - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - vpxor %ymm0,%ymm4,%ymm4 - vpxor %ymm2,%ymm8,%ymm8 - xorl %ebp,%esi - addl %r12d,%edx - vpxor %ymm8,%ymm4,%ymm4 - andl %edi,%esi - addl 64(%r13),%ecx - xorl %ebp,%esi - movl %eax,%edi - vpsrld $31,%ymm4,%ymm8 - xorl %ebp,%edi - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - vpslldq $12,%ymm4,%ymm10 - vpaddd %ymm4,%ymm4,%ymm4 - rorxl $2,%edx,%esi - xorl %eax,%edx - vpsrld $30,%ymm10,%ymm9 - vpor %ymm8,%ymm4,%ymm4 - addl %r12d,%ecx - andl %edi,%edx - vpslld $2,%ymm10,%ymm10 - vpxor %ymm9,%ymm4,%ymm4 - addl 68(%r13),%ebx - xorl %eax,%edx - vpxor %ymm10,%ymm4,%ymm4 - movl %esi,%edi - xorl %eax,%edi - leal (%rbx,%rdx,1),%ebx - vpaddd %ymm11,%ymm4,%ymm9 - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - vmovdqu %ymm9,128(%rsp) - addl %r12d,%ebx - andl %edi,%ecx - addl 72(%r13),%ebp - xorl %esi,%ecx - movl %edx,%edi - xorl %esi,%edi - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - andl %edi,%ebx - addl 76(%r13),%eax - xorl %edx,%ebx - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - xorl %edx,%ebp - vpalignr $8,%ymm1,%ymm2,%ymm5 - addl 96(%r13),%esi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - vpsrldq $4,%ymm4,%ymm8 - xorl %ebx,%eax - addl %r12d,%esi - xorl %ecx,%eax - vpxor %ymm1,%ymm5,%ymm5 - vpxor %ymm3,%ymm8,%ymm8 - addl 100(%r13),%edx - leal (%rdx,%rax,1),%edx - vpxor %ymm8,%ymm5,%ymm5 - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - xorl %ebp,%esi - addl %r12d,%edx - vpsrld $31,%ymm5,%ymm8 - vmovdqu -32(%r11),%ymm11 - xorl %ebx,%esi - addl 104(%r13),%ecx - leal (%rcx,%rsi,1),%ecx - vpslldq $12,%ymm5,%ymm10 - vpaddd %ymm5,%ymm5,%ymm5 - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - vpsrld $30,%ymm10,%ymm9 - vpor %ymm8,%ymm5,%ymm5 - xorl %eax,%edx - addl %r12d,%ecx - vpslld $2,%ymm10,%ymm10 - vpxor %ymm9,%ymm5,%ymm5 - xorl %ebp,%edx - addl 108(%r13),%ebx - leaq 256(%r13),%r13 - vpxor %ymm10,%ymm5,%ymm5 - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - vpaddd %ymm11,%ymm5,%ymm9 - xorl %esi,%ecx - addl %r12d,%ebx - xorl %eax,%ecx - vmovdqu %ymm9,160(%rsp) - addl -128(%r13),%ebp - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - xorl %esi,%ebx - vpalignr $8,%ymm2,%ymm3,%ymm6 - addl -124(%r13),%eax - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - vpsrldq $4,%ymm5,%ymm8 - xorl %ecx,%ebp - addl %r12d,%eax - xorl %edx,%ebp - vpxor %ymm2,%ymm6,%ymm6 - vpxor %ymm4,%ymm8,%ymm8 - addl -120(%r13),%esi - leal (%rsi,%rbp,1),%esi - vpxor %ymm8,%ymm6,%ymm6 - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - vpsrld $31,%ymm6,%ymm8 - xorl %ecx,%eax - addl -116(%r13),%edx - leal (%rdx,%rax,1),%edx - vpslldq $12,%ymm6,%ymm10 - vpaddd %ymm6,%ymm6,%ymm6 - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - vpsrld $30,%ymm10,%ymm9 - vpor %ymm8,%ymm6,%ymm6 - xorl %ebp,%esi - addl %r12d,%edx - vpslld $2,%ymm10,%ymm10 - vpxor %ymm9,%ymm6,%ymm6 - xorl %ebx,%esi - addl -96(%r13),%ecx - vpxor %ymm10,%ymm6,%ymm6 - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - vpaddd %ymm11,%ymm6,%ymm9 - xorl %eax,%edx - addl %r12d,%ecx - xorl %ebp,%edx - vmovdqu %ymm9,192(%rsp) - addl -92(%r13),%ebx - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - xorl %eax,%ecx - vpalignr $8,%ymm3,%ymm4,%ymm7 - addl -88(%r13),%ebp - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - vpsrldq $4,%ymm6,%ymm8 - xorl %edx,%ebx - addl %r12d,%ebp - xorl %esi,%ebx - vpxor %ymm3,%ymm7,%ymm7 - vpxor %ymm5,%ymm8,%ymm8 - addl -84(%r13),%eax - leal (%rax,%rbx,1),%eax - vpxor %ymm8,%ymm7,%ymm7 - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - vpsrld $31,%ymm7,%ymm8 - xorl %edx,%ebp - addl -64(%r13),%esi - leal (%rsi,%rbp,1),%esi - vpslldq $12,%ymm7,%ymm10 - vpaddd %ymm7,%ymm7,%ymm7 - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - vpsrld $30,%ymm10,%ymm9 - vpor %ymm8,%ymm7,%ymm7 - xorl %ebx,%eax - addl %r12d,%esi - vpslld $2,%ymm10,%ymm10 - vpxor %ymm9,%ymm7,%ymm7 - xorl %ecx,%eax - addl -60(%r13),%edx - vpxor %ymm10,%ymm7,%ymm7 - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - rorxl $2,%esi,%eax - vpaddd %ymm11,%ymm7,%ymm9 - xorl %ebp,%esi - addl %r12d,%edx - xorl %ebx,%esi - vmovdqu %ymm9,224(%rsp) - addl -56(%r13),%ecx - leal (%rcx,%rsi,1),%ecx - rorxl $27,%edx,%r12d - rorxl $2,%edx,%esi - xorl %eax,%edx - addl %r12d,%ecx - xorl %ebp,%edx - addl -52(%r13),%ebx - leal (%rbx,%rdx,1),%ebx - rorxl $27,%ecx,%r12d - rorxl $2,%ecx,%edx - xorl %esi,%ecx - addl %r12d,%ebx - xorl %eax,%ecx - addl -32(%r13),%ebp - leal (%rcx,%rbp,1),%ebp - rorxl $27,%ebx,%r12d - rorxl $2,%ebx,%ecx - xorl %edx,%ebx - addl %r12d,%ebp - xorl %esi,%ebx - addl -28(%r13),%eax - leal (%rax,%rbx,1),%eax - rorxl $27,%ebp,%r12d - rorxl $2,%ebp,%ebx - xorl %ecx,%ebp - addl %r12d,%eax - xorl %edx,%ebp - addl -24(%r13),%esi - leal (%rsi,%rbp,1),%esi - rorxl $27,%eax,%r12d - rorxl $2,%eax,%ebp - xorl %ebx,%eax - addl %r12d,%esi - xorl %ecx,%eax - addl -20(%r13),%edx - leal (%rdx,%rax,1),%edx - rorxl $27,%esi,%r12d - addl %r12d,%edx - leaq 128(%rsp),%r13 - - - addl 0(%r8),%edx - addl 4(%r8),%esi - addl 8(%r8),%ebp - movl %edx,0(%r8) - addl 12(%r8),%ebx - movl %esi,4(%r8) - movl %edx,%eax - addl 16(%r8),%ecx - movl %ebp,%r12d - movl %ebp,8(%r8) - movl %ebx,%edx - - movl %ebx,12(%r8) - movl %esi,%ebp - movl %ecx,16(%r8) - - movl %ecx,%esi - movl %r12d,%ecx - - - cmpq %r10,%r9 - jbe L$oop_avx2 - -L$done_avx2: - vzeroupper - leaq (%r14),%rsi - movq -40(%rsi),%r14 - movq -32(%rsi),%r13 - movq -24(%rsi),%r12 - movq -16(%rsi),%rbp - movq -8(%rsi),%rbx - leaq (%rsi),%rsp -L$epilogue_avx2: - .byte 0xf3,0xc3 - .p2align 6 K_XX_XX: .long 0x5a827999,0x5a827999,0x5a827999,0x5a827999 diff --git a/deps/openssl/asm/x64-macosx-gas/sha/sha256-mb-x86_64.s b/deps/openssl/asm/x64-macosx-gas/sha/sha256-mb-x86_64.s index 77c24f1cf5d973..276322bec2b7e8 100644 --- a/deps/openssl/asm/x64-macosx-gas/sha/sha256-mb-x86_64.s +++ b/deps/openssl/asm/x64-macosx-gas/sha/sha256-mb-x86_64.s @@ -9,8 +9,6 @@ _sha256_multi_block: movq _OPENSSL_ia32cap_P+4(%rip),%rcx btq $61,%rcx jc _shaext_shortcut - testl $268435456,%ecx - jnz _avx_shortcut movq %rsp,%rax pushq %rbx pushq %rbp @@ -2679,10 +2677,10 @@ L$oop_grande_shaext: punpckhqdq %xmm8,%xmm14 punpckhqdq %xmm10,%xmm15 - pshufd $27,%xmm12,%xmm12 - pshufd $27,%xmm13,%xmm13 - pshufd $27,%xmm14,%xmm14 - pshufd $27,%xmm15,%xmm15 + pshufd $0b00011011,%xmm12,%xmm12 + pshufd $0b00011011,%xmm13,%xmm13 + pshufd $0b00011011,%xmm14,%xmm14 + pshufd $0b00011011,%xmm15,%xmm15 jmp L$oop_shaext .p2align 5 @@ -2714,11 +2712,11 @@ L$oop_shaext: movdqa %xmm2,%xmm0 movdqa %xmm15,112(%rsp) .byte 69,15,56,203,254 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 pxor %xmm12,%xmm4 movdqa %xmm12,64(%rsp) .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 pxor %xmm14,%xmm8 movdqa %xmm14,96(%rsp) movdqa 16-128(%rbp),%xmm1 @@ -2736,11 +2734,11 @@ L$oop_shaext: .byte 102,68,15,56,0,211 prefetcht0 127(%r9) .byte 69,15,56,203,254 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 .byte 102,68,15,56,0,219 .byte 15,56,204,229 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 32-128(%rbp),%xmm1 paddd %xmm6,%xmm1 .byte 69,15,56,203,247 @@ -2753,14 +2751,14 @@ L$oop_shaext: movdqa %xmm2,%xmm0 movdqa %xmm7,%xmm3 .byte 69,15,56,203,254 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 .byte 102,15,58,15,222,4 paddd %xmm3,%xmm4 movdqa %xmm11,%xmm3 .byte 102,65,15,58,15,218,4 .byte 15,56,204,238 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 48-128(%rbp),%xmm1 paddd %xmm7,%xmm1 .byte 69,15,56,203,247 @@ -2777,13 +2775,13 @@ L$oop_shaext: .byte 102,15,58,15,223,4 .byte 69,15,56,203,254 .byte 69,15,56,205,195 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm5 movdqa %xmm8,%xmm3 .byte 102,65,15,58,15,219,4 .byte 15,56,204,247 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 64-128(%rbp),%xmm1 paddd %xmm4,%xmm1 .byte 69,15,56,203,247 @@ -2799,13 +2797,13 @@ L$oop_shaext: .byte 102,15,58,15,220,4 .byte 69,15,56,203,254 .byte 69,15,56,205,200 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm6 movdqa %xmm9,%xmm3 .byte 102,65,15,58,15,216,4 .byte 15,56,204,252 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 80-128(%rbp),%xmm1 paddd %xmm5,%xmm1 .byte 69,15,56,203,247 @@ -2821,13 +2819,13 @@ L$oop_shaext: .byte 102,15,58,15,221,4 .byte 69,15,56,203,254 .byte 69,15,56,205,209 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm7 movdqa %xmm10,%xmm3 .byte 102,65,15,58,15,217,4 .byte 15,56,204,229 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 96-128(%rbp),%xmm1 paddd %xmm6,%xmm1 .byte 69,15,56,203,247 @@ -2843,13 +2841,13 @@ L$oop_shaext: .byte 102,15,58,15,222,4 .byte 69,15,56,203,254 .byte 69,15,56,205,218 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm4 movdqa %xmm11,%xmm3 .byte 102,65,15,58,15,218,4 .byte 15,56,204,238 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 112-128(%rbp),%xmm1 paddd %xmm7,%xmm1 .byte 69,15,56,203,247 @@ -2865,13 +2863,13 @@ L$oop_shaext: .byte 102,15,58,15,223,4 .byte 69,15,56,203,254 .byte 69,15,56,205,195 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm5 movdqa %xmm8,%xmm3 .byte 102,65,15,58,15,219,4 .byte 15,56,204,247 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 128-128(%rbp),%xmm1 paddd %xmm4,%xmm1 .byte 69,15,56,203,247 @@ -2887,13 +2885,13 @@ L$oop_shaext: .byte 102,15,58,15,220,4 .byte 69,15,56,203,254 .byte 69,15,56,205,200 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm6 movdqa %xmm9,%xmm3 .byte 102,65,15,58,15,216,4 .byte 15,56,204,252 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 144-128(%rbp),%xmm1 paddd %xmm5,%xmm1 .byte 69,15,56,203,247 @@ -2909,13 +2907,13 @@ L$oop_shaext: .byte 102,15,58,15,221,4 .byte 69,15,56,203,254 .byte 69,15,56,205,209 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm7 movdqa %xmm10,%xmm3 .byte 102,65,15,58,15,217,4 .byte 15,56,204,229 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 160-128(%rbp),%xmm1 paddd %xmm6,%xmm1 .byte 69,15,56,203,247 @@ -2931,13 +2929,13 @@ L$oop_shaext: .byte 102,15,58,15,222,4 .byte 69,15,56,203,254 .byte 69,15,56,205,218 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm4 movdqa %xmm11,%xmm3 .byte 102,65,15,58,15,218,4 .byte 15,56,204,238 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 176-128(%rbp),%xmm1 paddd %xmm7,%xmm1 .byte 69,15,56,203,247 @@ -2953,13 +2951,13 @@ L$oop_shaext: .byte 102,15,58,15,223,4 .byte 69,15,56,203,254 .byte 69,15,56,205,195 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm5 movdqa %xmm8,%xmm3 .byte 102,65,15,58,15,219,4 .byte 15,56,204,247 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 192-128(%rbp),%xmm1 paddd %xmm4,%xmm1 .byte 69,15,56,203,247 @@ -2975,13 +2973,13 @@ L$oop_shaext: .byte 102,15,58,15,220,4 .byte 69,15,56,203,254 .byte 69,15,56,205,200 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm6 movdqa %xmm9,%xmm3 .byte 102,65,15,58,15,216,4 .byte 15,56,204,252 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 208-128(%rbp),%xmm1 paddd %xmm5,%xmm1 .byte 69,15,56,203,247 @@ -2997,13 +2995,13 @@ L$oop_shaext: .byte 102,15,58,15,221,4 .byte 69,15,56,203,254 .byte 69,15,56,205,209 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm7 movdqa %xmm10,%xmm3 .byte 102,65,15,58,15,217,4 nop .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 224-128(%rbp),%xmm1 paddd %xmm6,%xmm1 .byte 69,15,56,203,247 @@ -3020,13 +3018,13 @@ L$oop_shaext: pxor %xmm6,%xmm6 .byte 69,15,56,203,254 .byte 69,15,56,205,218 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 movdqa 240-128(%rbp),%xmm1 paddd %xmm7,%xmm1 movq (%rbx),%xmm7 nop .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 240-128(%rbp),%xmm2 paddd %xmm11,%xmm2 .byte 69,15,56,203,247 @@ -3036,17 +3034,17 @@ L$oop_shaext: cmovgeq %rsp,%r8 cmpl 4(%rbx),%ecx cmovgeq %rsp,%r9 - pshufd $0,%xmm7,%xmm9 + pshufd $0x00,%xmm7,%xmm9 .byte 69,15,56,203,236 movdqa %xmm2,%xmm0 - pshufd $85,%xmm7,%xmm10 + pshufd $0x55,%xmm7,%xmm10 movdqa %xmm7,%xmm11 .byte 69,15,56,203,254 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 pcmpgtd %xmm6,%xmm9 pcmpgtd %xmm6,%xmm10 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 pcmpgtd %xmm6,%xmm11 movdqa K256_shaext-16(%rip),%xmm3 .byte 69,15,56,203,247 @@ -3068,10 +3066,10 @@ L$oop_shaext: movl 280(%rsp),%edx - pshufd $27,%xmm12,%xmm12 - pshufd $27,%xmm13,%xmm13 - pshufd $27,%xmm14,%xmm14 - pshufd $27,%xmm15,%xmm15 + pshufd $0b00011011,%xmm12,%xmm12 + pshufd $0b00011011,%xmm13,%xmm13 + pshufd $0b00011011,%xmm14,%xmm14 + pshufd $0b00011011,%xmm15,%xmm15 movdqa %xmm12,%xmm5 movdqa %xmm13,%xmm6 @@ -3107,4648 +3105,6 @@ L$done_shaext: L$epilogue_shaext: .byte 0xf3,0xc3 - -.p2align 5 -sha256_multi_block_avx: -_avx_shortcut: - shrq $32,%rcx - cmpl $2,%edx - jb L$avx - testl $32,%ecx - jnz _avx2_shortcut - jmp L$avx -.p2align 5 -L$avx: - movq %rsp,%rax - pushq %rbx - pushq %rbp - subq $288,%rsp - andq $-256,%rsp - movq %rax,272(%rsp) -L$body_avx: - leaq K256+128(%rip),%rbp - leaq 256(%rsp),%rbx - leaq 128(%rdi),%rdi - -L$oop_grande_avx: - movl %edx,280(%rsp) - xorl %edx,%edx - movq 0(%rsi),%r8 - movl 8(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,0(%rbx) - cmovleq %rbp,%r8 - movq 16(%rsi),%r9 - movl 24(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,4(%rbx) - cmovleq %rbp,%r9 - movq 32(%rsi),%r10 - movl 40(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,8(%rbx) - cmovleq %rbp,%r10 - movq 48(%rsi),%r11 - movl 56(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,12(%rbx) - cmovleq %rbp,%r11 - testl %edx,%edx - jz L$done_avx - - vmovdqu 0-128(%rdi),%xmm8 - leaq 128(%rsp),%rax - vmovdqu 32-128(%rdi),%xmm9 - vmovdqu 64-128(%rdi),%xmm10 - vmovdqu 96-128(%rdi),%xmm11 - vmovdqu 128-128(%rdi),%xmm12 - vmovdqu 160-128(%rdi),%xmm13 - vmovdqu 192-128(%rdi),%xmm14 - vmovdqu 224-128(%rdi),%xmm15 - vmovdqu L$pbswap(%rip),%xmm6 - jmp L$oop_avx - -.p2align 5 -L$oop_avx: - vpxor %xmm9,%xmm10,%xmm4 - vmovd 0(%r8),%xmm5 - vmovd 0(%r9),%xmm0 - vpinsrd $1,0(%r10),%xmm5,%xmm5 - vpinsrd $1,0(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm12,%xmm7 - vpslld $26,%xmm12,%xmm2 - vmovdqu %xmm5,0-128(%rax) - vpaddd %xmm15,%xmm5,%xmm5 - - vpsrld $11,%xmm12,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm12,%xmm2 - vpaddd -128(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm12,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm12,%xmm2 - vpandn %xmm14,%xmm12,%xmm0 - vpand %xmm13,%xmm12,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm8,%xmm15 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm8,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm8,%xmm9,%xmm3 - - vpxor %xmm1,%xmm15,%xmm15 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm8,%xmm1 - - vpslld $19,%xmm8,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm15,%xmm7 - - vpsrld $22,%xmm8,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm8,%xmm2 - vpxor %xmm4,%xmm9,%xmm15 - vpaddd %xmm5,%xmm11,%xmm11 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm15,%xmm15 - vpaddd %xmm7,%xmm15,%xmm15 - vmovd 4(%r8),%xmm5 - vmovd 4(%r9),%xmm0 - vpinsrd $1,4(%r10),%xmm5,%xmm5 - vpinsrd $1,4(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm11,%xmm7 - vpslld $26,%xmm11,%xmm2 - vmovdqu %xmm5,16-128(%rax) - vpaddd %xmm14,%xmm5,%xmm5 - - vpsrld $11,%xmm11,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm11,%xmm2 - vpaddd -96(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm11,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm11,%xmm2 - vpandn %xmm13,%xmm11,%xmm0 - vpand %xmm12,%xmm11,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm15,%xmm14 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm15,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm15,%xmm8,%xmm4 - - vpxor %xmm1,%xmm14,%xmm14 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm15,%xmm1 - - vpslld $19,%xmm15,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm14,%xmm7 - - vpsrld $22,%xmm15,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm15,%xmm2 - vpxor %xmm3,%xmm8,%xmm14 - vpaddd %xmm5,%xmm10,%xmm10 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm14,%xmm14 - vpaddd %xmm7,%xmm14,%xmm14 - vmovd 8(%r8),%xmm5 - vmovd 8(%r9),%xmm0 - vpinsrd $1,8(%r10),%xmm5,%xmm5 - vpinsrd $1,8(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm10,%xmm7 - vpslld $26,%xmm10,%xmm2 - vmovdqu %xmm5,32-128(%rax) - vpaddd %xmm13,%xmm5,%xmm5 - - vpsrld $11,%xmm10,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm10,%xmm2 - vpaddd -64(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm10,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm10,%xmm2 - vpandn %xmm12,%xmm10,%xmm0 - vpand %xmm11,%xmm10,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm14,%xmm13 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm14,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm14,%xmm15,%xmm3 - - vpxor %xmm1,%xmm13,%xmm13 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm14,%xmm1 - - vpslld $19,%xmm14,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm13,%xmm7 - - vpsrld $22,%xmm14,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm14,%xmm2 - vpxor %xmm4,%xmm15,%xmm13 - vpaddd %xmm5,%xmm9,%xmm9 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm13,%xmm13 - vpaddd %xmm7,%xmm13,%xmm13 - vmovd 12(%r8),%xmm5 - vmovd 12(%r9),%xmm0 - vpinsrd $1,12(%r10),%xmm5,%xmm5 - vpinsrd $1,12(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm9,%xmm7 - vpslld $26,%xmm9,%xmm2 - vmovdqu %xmm5,48-128(%rax) - vpaddd %xmm12,%xmm5,%xmm5 - - vpsrld $11,%xmm9,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm9,%xmm2 - vpaddd -32(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm9,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm9,%xmm2 - vpandn %xmm11,%xmm9,%xmm0 - vpand %xmm10,%xmm9,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm13,%xmm12 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm13,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm13,%xmm14,%xmm4 - - vpxor %xmm1,%xmm12,%xmm12 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm13,%xmm1 - - vpslld $19,%xmm13,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm12,%xmm7 - - vpsrld $22,%xmm13,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm13,%xmm2 - vpxor %xmm3,%xmm14,%xmm12 - vpaddd %xmm5,%xmm8,%xmm8 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm12,%xmm12 - vpaddd %xmm7,%xmm12,%xmm12 - vmovd 16(%r8),%xmm5 - vmovd 16(%r9),%xmm0 - vpinsrd $1,16(%r10),%xmm5,%xmm5 - vpinsrd $1,16(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm8,%xmm7 - vpslld $26,%xmm8,%xmm2 - vmovdqu %xmm5,64-128(%rax) - vpaddd %xmm11,%xmm5,%xmm5 - - vpsrld $11,%xmm8,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm8,%xmm2 - vpaddd 0(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm8,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm8,%xmm2 - vpandn %xmm10,%xmm8,%xmm0 - vpand %xmm9,%xmm8,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm12,%xmm11 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm12,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm12,%xmm13,%xmm3 - - vpxor %xmm1,%xmm11,%xmm11 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm12,%xmm1 - - vpslld $19,%xmm12,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm11,%xmm7 - - vpsrld $22,%xmm12,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm12,%xmm2 - vpxor %xmm4,%xmm13,%xmm11 - vpaddd %xmm5,%xmm15,%xmm15 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm11,%xmm11 - vpaddd %xmm7,%xmm11,%xmm11 - vmovd 20(%r8),%xmm5 - vmovd 20(%r9),%xmm0 - vpinsrd $1,20(%r10),%xmm5,%xmm5 - vpinsrd $1,20(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm15,%xmm7 - vpslld $26,%xmm15,%xmm2 - vmovdqu %xmm5,80-128(%rax) - vpaddd %xmm10,%xmm5,%xmm5 - - vpsrld $11,%xmm15,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm15,%xmm2 - vpaddd 32(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm15,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm15,%xmm2 - vpandn %xmm9,%xmm15,%xmm0 - vpand %xmm8,%xmm15,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm11,%xmm10 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm11,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm11,%xmm12,%xmm4 - - vpxor %xmm1,%xmm10,%xmm10 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm11,%xmm1 - - vpslld $19,%xmm11,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm10,%xmm7 - - vpsrld $22,%xmm11,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm11,%xmm2 - vpxor %xmm3,%xmm12,%xmm10 - vpaddd %xmm5,%xmm14,%xmm14 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm10,%xmm10 - vpaddd %xmm7,%xmm10,%xmm10 - vmovd 24(%r8),%xmm5 - vmovd 24(%r9),%xmm0 - vpinsrd $1,24(%r10),%xmm5,%xmm5 - vpinsrd $1,24(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm14,%xmm7 - vpslld $26,%xmm14,%xmm2 - vmovdqu %xmm5,96-128(%rax) - vpaddd %xmm9,%xmm5,%xmm5 - - vpsrld $11,%xmm14,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm14,%xmm2 - vpaddd 64(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm14,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm14,%xmm2 - vpandn %xmm8,%xmm14,%xmm0 - vpand %xmm15,%xmm14,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm10,%xmm9 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm10,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm10,%xmm11,%xmm3 - - vpxor %xmm1,%xmm9,%xmm9 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm10,%xmm1 - - vpslld $19,%xmm10,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm9,%xmm7 - - vpsrld $22,%xmm10,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm10,%xmm2 - vpxor %xmm4,%xmm11,%xmm9 - vpaddd %xmm5,%xmm13,%xmm13 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm9,%xmm9 - vpaddd %xmm7,%xmm9,%xmm9 - vmovd 28(%r8),%xmm5 - vmovd 28(%r9),%xmm0 - vpinsrd $1,28(%r10),%xmm5,%xmm5 - vpinsrd $1,28(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm13,%xmm7 - vpslld $26,%xmm13,%xmm2 - vmovdqu %xmm5,112-128(%rax) - vpaddd %xmm8,%xmm5,%xmm5 - - vpsrld $11,%xmm13,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm13,%xmm2 - vpaddd 96(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm13,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm13,%xmm2 - vpandn %xmm15,%xmm13,%xmm0 - vpand %xmm14,%xmm13,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm9,%xmm8 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm9,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm9,%xmm10,%xmm4 - - vpxor %xmm1,%xmm8,%xmm8 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm9,%xmm1 - - vpslld $19,%xmm9,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm8,%xmm7 - - vpsrld $22,%xmm9,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm9,%xmm2 - vpxor %xmm3,%xmm10,%xmm8 - vpaddd %xmm5,%xmm12,%xmm12 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm8,%xmm8 - vpaddd %xmm7,%xmm8,%xmm8 - addq $256,%rbp - vmovd 32(%r8),%xmm5 - vmovd 32(%r9),%xmm0 - vpinsrd $1,32(%r10),%xmm5,%xmm5 - vpinsrd $1,32(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm12,%xmm7 - vpslld $26,%xmm12,%xmm2 - vmovdqu %xmm5,128-128(%rax) - vpaddd %xmm15,%xmm5,%xmm5 - - vpsrld $11,%xmm12,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm12,%xmm2 - vpaddd -128(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm12,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm12,%xmm2 - vpandn %xmm14,%xmm12,%xmm0 - vpand %xmm13,%xmm12,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm8,%xmm15 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm8,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm8,%xmm9,%xmm3 - - vpxor %xmm1,%xmm15,%xmm15 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm8,%xmm1 - - vpslld $19,%xmm8,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm15,%xmm7 - - vpsrld $22,%xmm8,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm8,%xmm2 - vpxor %xmm4,%xmm9,%xmm15 - vpaddd %xmm5,%xmm11,%xmm11 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm15,%xmm15 - vpaddd %xmm7,%xmm15,%xmm15 - vmovd 36(%r8),%xmm5 - vmovd 36(%r9),%xmm0 - vpinsrd $1,36(%r10),%xmm5,%xmm5 - vpinsrd $1,36(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm11,%xmm7 - vpslld $26,%xmm11,%xmm2 - vmovdqu %xmm5,144-128(%rax) - vpaddd %xmm14,%xmm5,%xmm5 - - vpsrld $11,%xmm11,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm11,%xmm2 - vpaddd -96(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm11,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm11,%xmm2 - vpandn %xmm13,%xmm11,%xmm0 - vpand %xmm12,%xmm11,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm15,%xmm14 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm15,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm15,%xmm8,%xmm4 - - vpxor %xmm1,%xmm14,%xmm14 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm15,%xmm1 - - vpslld $19,%xmm15,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm14,%xmm7 - - vpsrld $22,%xmm15,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm15,%xmm2 - vpxor %xmm3,%xmm8,%xmm14 - vpaddd %xmm5,%xmm10,%xmm10 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm14,%xmm14 - vpaddd %xmm7,%xmm14,%xmm14 - vmovd 40(%r8),%xmm5 - vmovd 40(%r9),%xmm0 - vpinsrd $1,40(%r10),%xmm5,%xmm5 - vpinsrd $1,40(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm10,%xmm7 - vpslld $26,%xmm10,%xmm2 - vmovdqu %xmm5,160-128(%rax) - vpaddd %xmm13,%xmm5,%xmm5 - - vpsrld $11,%xmm10,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm10,%xmm2 - vpaddd -64(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm10,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm10,%xmm2 - vpandn %xmm12,%xmm10,%xmm0 - vpand %xmm11,%xmm10,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm14,%xmm13 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm14,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm14,%xmm15,%xmm3 - - vpxor %xmm1,%xmm13,%xmm13 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm14,%xmm1 - - vpslld $19,%xmm14,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm13,%xmm7 - - vpsrld $22,%xmm14,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm14,%xmm2 - vpxor %xmm4,%xmm15,%xmm13 - vpaddd %xmm5,%xmm9,%xmm9 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm13,%xmm13 - vpaddd %xmm7,%xmm13,%xmm13 - vmovd 44(%r8),%xmm5 - vmovd 44(%r9),%xmm0 - vpinsrd $1,44(%r10),%xmm5,%xmm5 - vpinsrd $1,44(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm9,%xmm7 - vpslld $26,%xmm9,%xmm2 - vmovdqu %xmm5,176-128(%rax) - vpaddd %xmm12,%xmm5,%xmm5 - - vpsrld $11,%xmm9,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm9,%xmm2 - vpaddd -32(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm9,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm9,%xmm2 - vpandn %xmm11,%xmm9,%xmm0 - vpand %xmm10,%xmm9,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm13,%xmm12 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm13,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm13,%xmm14,%xmm4 - - vpxor %xmm1,%xmm12,%xmm12 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm13,%xmm1 - - vpslld $19,%xmm13,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm12,%xmm7 - - vpsrld $22,%xmm13,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm13,%xmm2 - vpxor %xmm3,%xmm14,%xmm12 - vpaddd %xmm5,%xmm8,%xmm8 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm12,%xmm12 - vpaddd %xmm7,%xmm12,%xmm12 - vmovd 48(%r8),%xmm5 - vmovd 48(%r9),%xmm0 - vpinsrd $1,48(%r10),%xmm5,%xmm5 - vpinsrd $1,48(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm8,%xmm7 - vpslld $26,%xmm8,%xmm2 - vmovdqu %xmm5,192-128(%rax) - vpaddd %xmm11,%xmm5,%xmm5 - - vpsrld $11,%xmm8,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm8,%xmm2 - vpaddd 0(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm8,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm8,%xmm2 - vpandn %xmm10,%xmm8,%xmm0 - vpand %xmm9,%xmm8,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm12,%xmm11 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm12,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm12,%xmm13,%xmm3 - - vpxor %xmm1,%xmm11,%xmm11 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm12,%xmm1 - - vpslld $19,%xmm12,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm11,%xmm7 - - vpsrld $22,%xmm12,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm12,%xmm2 - vpxor %xmm4,%xmm13,%xmm11 - vpaddd %xmm5,%xmm15,%xmm15 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm11,%xmm11 - vpaddd %xmm7,%xmm11,%xmm11 - vmovd 52(%r8),%xmm5 - vmovd 52(%r9),%xmm0 - vpinsrd $1,52(%r10),%xmm5,%xmm5 - vpinsrd $1,52(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm15,%xmm7 - vpslld $26,%xmm15,%xmm2 - vmovdqu %xmm5,208-128(%rax) - vpaddd %xmm10,%xmm5,%xmm5 - - vpsrld $11,%xmm15,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm15,%xmm2 - vpaddd 32(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm15,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm15,%xmm2 - vpandn %xmm9,%xmm15,%xmm0 - vpand %xmm8,%xmm15,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm11,%xmm10 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm11,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm11,%xmm12,%xmm4 - - vpxor %xmm1,%xmm10,%xmm10 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm11,%xmm1 - - vpslld $19,%xmm11,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm10,%xmm7 - - vpsrld $22,%xmm11,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm11,%xmm2 - vpxor %xmm3,%xmm12,%xmm10 - vpaddd %xmm5,%xmm14,%xmm14 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm10,%xmm10 - vpaddd %xmm7,%xmm10,%xmm10 - vmovd 56(%r8),%xmm5 - vmovd 56(%r9),%xmm0 - vpinsrd $1,56(%r10),%xmm5,%xmm5 - vpinsrd $1,56(%r11),%xmm0,%xmm0 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm14,%xmm7 - vpslld $26,%xmm14,%xmm2 - vmovdqu %xmm5,224-128(%rax) - vpaddd %xmm9,%xmm5,%xmm5 - - vpsrld $11,%xmm14,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm14,%xmm2 - vpaddd 64(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm14,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm14,%xmm2 - vpandn %xmm8,%xmm14,%xmm0 - vpand %xmm15,%xmm14,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm10,%xmm9 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm10,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm10,%xmm11,%xmm3 - - vpxor %xmm1,%xmm9,%xmm9 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm10,%xmm1 - - vpslld $19,%xmm10,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm9,%xmm7 - - vpsrld $22,%xmm10,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm10,%xmm2 - vpxor %xmm4,%xmm11,%xmm9 - vpaddd %xmm5,%xmm13,%xmm13 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm9,%xmm9 - vpaddd %xmm7,%xmm9,%xmm9 - vmovd 60(%r8),%xmm5 - leaq 64(%r8),%r8 - vmovd 60(%r9),%xmm0 - leaq 64(%r9),%r9 - vpinsrd $1,60(%r10),%xmm5,%xmm5 - leaq 64(%r10),%r10 - vpinsrd $1,60(%r11),%xmm0,%xmm0 - leaq 64(%r11),%r11 - vpunpckldq %xmm0,%xmm5,%xmm5 - vpshufb %xmm6,%xmm5,%xmm5 - vpsrld $6,%xmm13,%xmm7 - vpslld $26,%xmm13,%xmm2 - vmovdqu %xmm5,240-128(%rax) - vpaddd %xmm8,%xmm5,%xmm5 - - vpsrld $11,%xmm13,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm13,%xmm2 - vpaddd 96(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm13,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - prefetcht0 63(%r8) - vpslld $7,%xmm13,%xmm2 - vpandn %xmm15,%xmm13,%xmm0 - vpand %xmm14,%xmm13,%xmm4 - prefetcht0 63(%r9) - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm9,%xmm8 - vpxor %xmm2,%xmm7,%xmm7 - prefetcht0 63(%r10) - vpslld $30,%xmm9,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm9,%xmm10,%xmm4 - prefetcht0 63(%r11) - vpxor %xmm1,%xmm8,%xmm8 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm9,%xmm1 - - vpslld $19,%xmm9,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm8,%xmm7 - - vpsrld $22,%xmm9,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm9,%xmm2 - vpxor %xmm3,%xmm10,%xmm8 - vpaddd %xmm5,%xmm12,%xmm12 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm8,%xmm8 - vpaddd %xmm7,%xmm8,%xmm8 - addq $256,%rbp - vmovdqu 0-128(%rax),%xmm5 - movl $3,%ecx - jmp L$oop_16_xx_avx -.p2align 5 -L$oop_16_xx_avx: - vmovdqu 16-128(%rax),%xmm6 - vpaddd 144-128(%rax),%xmm5,%xmm5 - - vpsrld $3,%xmm6,%xmm7 - vpsrld $7,%xmm6,%xmm1 - vpslld $25,%xmm6,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm6,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm6,%xmm2 - vmovdqu 224-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm5,%xmm5 - vpxor %xmm1,%xmm3,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm5,%xmm5 - vpsrld $6,%xmm12,%xmm7 - vpslld $26,%xmm12,%xmm2 - vmovdqu %xmm5,0-128(%rax) - vpaddd %xmm15,%xmm5,%xmm5 - - vpsrld $11,%xmm12,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm12,%xmm2 - vpaddd -128(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm12,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm12,%xmm2 - vpandn %xmm14,%xmm12,%xmm0 - vpand %xmm13,%xmm12,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm8,%xmm15 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm8,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm8,%xmm9,%xmm3 - - vpxor %xmm1,%xmm15,%xmm15 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm8,%xmm1 - - vpslld $19,%xmm8,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm15,%xmm7 - - vpsrld $22,%xmm8,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm8,%xmm2 - vpxor %xmm4,%xmm9,%xmm15 - vpaddd %xmm5,%xmm11,%xmm11 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm15,%xmm15 - vpaddd %xmm7,%xmm15,%xmm15 - vmovdqu 32-128(%rax),%xmm5 - vpaddd 160-128(%rax),%xmm6,%xmm6 - - vpsrld $3,%xmm5,%xmm7 - vpsrld $7,%xmm5,%xmm1 - vpslld $25,%xmm5,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm5,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm5,%xmm2 - vmovdqu 240-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm6,%xmm6 - vpsrld $6,%xmm11,%xmm7 - vpslld $26,%xmm11,%xmm2 - vmovdqu %xmm6,16-128(%rax) - vpaddd %xmm14,%xmm6,%xmm6 - - vpsrld $11,%xmm11,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm11,%xmm2 - vpaddd -96(%rbp),%xmm6,%xmm6 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm11,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm11,%xmm2 - vpandn %xmm13,%xmm11,%xmm0 - vpand %xmm12,%xmm11,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm15,%xmm14 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm15,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm15,%xmm8,%xmm4 - - vpxor %xmm1,%xmm14,%xmm14 - vpaddd %xmm7,%xmm6,%xmm6 - - vpsrld $13,%xmm15,%xmm1 - - vpslld $19,%xmm15,%xmm2 - vpaddd %xmm0,%xmm6,%xmm6 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm14,%xmm7 - - vpsrld $22,%xmm15,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm15,%xmm2 - vpxor %xmm3,%xmm8,%xmm14 - vpaddd %xmm6,%xmm10,%xmm10 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm6,%xmm14,%xmm14 - vpaddd %xmm7,%xmm14,%xmm14 - vmovdqu 48-128(%rax),%xmm6 - vpaddd 176-128(%rax),%xmm5,%xmm5 - - vpsrld $3,%xmm6,%xmm7 - vpsrld $7,%xmm6,%xmm1 - vpslld $25,%xmm6,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm6,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm6,%xmm2 - vmovdqu 0-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm5,%xmm5 - vpxor %xmm1,%xmm3,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm5,%xmm5 - vpsrld $6,%xmm10,%xmm7 - vpslld $26,%xmm10,%xmm2 - vmovdqu %xmm5,32-128(%rax) - vpaddd %xmm13,%xmm5,%xmm5 - - vpsrld $11,%xmm10,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm10,%xmm2 - vpaddd -64(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm10,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm10,%xmm2 - vpandn %xmm12,%xmm10,%xmm0 - vpand %xmm11,%xmm10,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm14,%xmm13 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm14,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm14,%xmm15,%xmm3 - - vpxor %xmm1,%xmm13,%xmm13 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm14,%xmm1 - - vpslld $19,%xmm14,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm13,%xmm7 - - vpsrld $22,%xmm14,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm14,%xmm2 - vpxor %xmm4,%xmm15,%xmm13 - vpaddd %xmm5,%xmm9,%xmm9 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm13,%xmm13 - vpaddd %xmm7,%xmm13,%xmm13 - vmovdqu 64-128(%rax),%xmm5 - vpaddd 192-128(%rax),%xmm6,%xmm6 - - vpsrld $3,%xmm5,%xmm7 - vpsrld $7,%xmm5,%xmm1 - vpslld $25,%xmm5,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm5,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm5,%xmm2 - vmovdqu 16-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm6,%xmm6 - vpsrld $6,%xmm9,%xmm7 - vpslld $26,%xmm9,%xmm2 - vmovdqu %xmm6,48-128(%rax) - vpaddd %xmm12,%xmm6,%xmm6 - - vpsrld $11,%xmm9,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm9,%xmm2 - vpaddd -32(%rbp),%xmm6,%xmm6 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm9,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm9,%xmm2 - vpandn %xmm11,%xmm9,%xmm0 - vpand %xmm10,%xmm9,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm13,%xmm12 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm13,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm13,%xmm14,%xmm4 - - vpxor %xmm1,%xmm12,%xmm12 - vpaddd %xmm7,%xmm6,%xmm6 - - vpsrld $13,%xmm13,%xmm1 - - vpslld $19,%xmm13,%xmm2 - vpaddd %xmm0,%xmm6,%xmm6 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm12,%xmm7 - - vpsrld $22,%xmm13,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm13,%xmm2 - vpxor %xmm3,%xmm14,%xmm12 - vpaddd %xmm6,%xmm8,%xmm8 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm6,%xmm12,%xmm12 - vpaddd %xmm7,%xmm12,%xmm12 - vmovdqu 80-128(%rax),%xmm6 - vpaddd 208-128(%rax),%xmm5,%xmm5 - - vpsrld $3,%xmm6,%xmm7 - vpsrld $7,%xmm6,%xmm1 - vpslld $25,%xmm6,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm6,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm6,%xmm2 - vmovdqu 32-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm5,%xmm5 - vpxor %xmm1,%xmm3,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm5,%xmm5 - vpsrld $6,%xmm8,%xmm7 - vpslld $26,%xmm8,%xmm2 - vmovdqu %xmm5,64-128(%rax) - vpaddd %xmm11,%xmm5,%xmm5 - - vpsrld $11,%xmm8,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm8,%xmm2 - vpaddd 0(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm8,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm8,%xmm2 - vpandn %xmm10,%xmm8,%xmm0 - vpand %xmm9,%xmm8,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm12,%xmm11 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm12,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm12,%xmm13,%xmm3 - - vpxor %xmm1,%xmm11,%xmm11 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm12,%xmm1 - - vpslld $19,%xmm12,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm11,%xmm7 - - vpsrld $22,%xmm12,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm12,%xmm2 - vpxor %xmm4,%xmm13,%xmm11 - vpaddd %xmm5,%xmm15,%xmm15 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm11,%xmm11 - vpaddd %xmm7,%xmm11,%xmm11 - vmovdqu 96-128(%rax),%xmm5 - vpaddd 224-128(%rax),%xmm6,%xmm6 - - vpsrld $3,%xmm5,%xmm7 - vpsrld $7,%xmm5,%xmm1 - vpslld $25,%xmm5,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm5,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm5,%xmm2 - vmovdqu 48-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm6,%xmm6 - vpsrld $6,%xmm15,%xmm7 - vpslld $26,%xmm15,%xmm2 - vmovdqu %xmm6,80-128(%rax) - vpaddd %xmm10,%xmm6,%xmm6 - - vpsrld $11,%xmm15,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm15,%xmm2 - vpaddd 32(%rbp),%xmm6,%xmm6 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm15,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm15,%xmm2 - vpandn %xmm9,%xmm15,%xmm0 - vpand %xmm8,%xmm15,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm11,%xmm10 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm11,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm11,%xmm12,%xmm4 - - vpxor %xmm1,%xmm10,%xmm10 - vpaddd %xmm7,%xmm6,%xmm6 - - vpsrld $13,%xmm11,%xmm1 - - vpslld $19,%xmm11,%xmm2 - vpaddd %xmm0,%xmm6,%xmm6 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm10,%xmm7 - - vpsrld $22,%xmm11,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm11,%xmm2 - vpxor %xmm3,%xmm12,%xmm10 - vpaddd %xmm6,%xmm14,%xmm14 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm6,%xmm10,%xmm10 - vpaddd %xmm7,%xmm10,%xmm10 - vmovdqu 112-128(%rax),%xmm6 - vpaddd 240-128(%rax),%xmm5,%xmm5 - - vpsrld $3,%xmm6,%xmm7 - vpsrld $7,%xmm6,%xmm1 - vpslld $25,%xmm6,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm6,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm6,%xmm2 - vmovdqu 64-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm5,%xmm5 - vpxor %xmm1,%xmm3,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm5,%xmm5 - vpsrld $6,%xmm14,%xmm7 - vpslld $26,%xmm14,%xmm2 - vmovdqu %xmm5,96-128(%rax) - vpaddd %xmm9,%xmm5,%xmm5 - - vpsrld $11,%xmm14,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm14,%xmm2 - vpaddd 64(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm14,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm14,%xmm2 - vpandn %xmm8,%xmm14,%xmm0 - vpand %xmm15,%xmm14,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm10,%xmm9 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm10,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm10,%xmm11,%xmm3 - - vpxor %xmm1,%xmm9,%xmm9 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm10,%xmm1 - - vpslld $19,%xmm10,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm9,%xmm7 - - vpsrld $22,%xmm10,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm10,%xmm2 - vpxor %xmm4,%xmm11,%xmm9 - vpaddd %xmm5,%xmm13,%xmm13 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm9,%xmm9 - vpaddd %xmm7,%xmm9,%xmm9 - vmovdqu 128-128(%rax),%xmm5 - vpaddd 0-128(%rax),%xmm6,%xmm6 - - vpsrld $3,%xmm5,%xmm7 - vpsrld $7,%xmm5,%xmm1 - vpslld $25,%xmm5,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm5,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm5,%xmm2 - vmovdqu 80-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm6,%xmm6 - vpsrld $6,%xmm13,%xmm7 - vpslld $26,%xmm13,%xmm2 - vmovdqu %xmm6,112-128(%rax) - vpaddd %xmm8,%xmm6,%xmm6 - - vpsrld $11,%xmm13,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm13,%xmm2 - vpaddd 96(%rbp),%xmm6,%xmm6 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm13,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm13,%xmm2 - vpandn %xmm15,%xmm13,%xmm0 - vpand %xmm14,%xmm13,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm9,%xmm8 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm9,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm9,%xmm10,%xmm4 - - vpxor %xmm1,%xmm8,%xmm8 - vpaddd %xmm7,%xmm6,%xmm6 - - vpsrld $13,%xmm9,%xmm1 - - vpslld $19,%xmm9,%xmm2 - vpaddd %xmm0,%xmm6,%xmm6 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm8,%xmm7 - - vpsrld $22,%xmm9,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm9,%xmm2 - vpxor %xmm3,%xmm10,%xmm8 - vpaddd %xmm6,%xmm12,%xmm12 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm6,%xmm8,%xmm8 - vpaddd %xmm7,%xmm8,%xmm8 - addq $256,%rbp - vmovdqu 144-128(%rax),%xmm6 - vpaddd 16-128(%rax),%xmm5,%xmm5 - - vpsrld $3,%xmm6,%xmm7 - vpsrld $7,%xmm6,%xmm1 - vpslld $25,%xmm6,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm6,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm6,%xmm2 - vmovdqu 96-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm5,%xmm5 - vpxor %xmm1,%xmm3,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm5,%xmm5 - vpsrld $6,%xmm12,%xmm7 - vpslld $26,%xmm12,%xmm2 - vmovdqu %xmm5,128-128(%rax) - vpaddd %xmm15,%xmm5,%xmm5 - - vpsrld $11,%xmm12,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm12,%xmm2 - vpaddd -128(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm12,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm12,%xmm2 - vpandn %xmm14,%xmm12,%xmm0 - vpand %xmm13,%xmm12,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm8,%xmm15 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm8,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm8,%xmm9,%xmm3 - - vpxor %xmm1,%xmm15,%xmm15 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm8,%xmm1 - - vpslld $19,%xmm8,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm15,%xmm7 - - vpsrld $22,%xmm8,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm8,%xmm2 - vpxor %xmm4,%xmm9,%xmm15 - vpaddd %xmm5,%xmm11,%xmm11 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm15,%xmm15 - vpaddd %xmm7,%xmm15,%xmm15 - vmovdqu 160-128(%rax),%xmm5 - vpaddd 32-128(%rax),%xmm6,%xmm6 - - vpsrld $3,%xmm5,%xmm7 - vpsrld $7,%xmm5,%xmm1 - vpslld $25,%xmm5,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm5,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm5,%xmm2 - vmovdqu 112-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm6,%xmm6 - vpsrld $6,%xmm11,%xmm7 - vpslld $26,%xmm11,%xmm2 - vmovdqu %xmm6,144-128(%rax) - vpaddd %xmm14,%xmm6,%xmm6 - - vpsrld $11,%xmm11,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm11,%xmm2 - vpaddd -96(%rbp),%xmm6,%xmm6 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm11,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm11,%xmm2 - vpandn %xmm13,%xmm11,%xmm0 - vpand %xmm12,%xmm11,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm15,%xmm14 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm15,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm15,%xmm8,%xmm4 - - vpxor %xmm1,%xmm14,%xmm14 - vpaddd %xmm7,%xmm6,%xmm6 - - vpsrld $13,%xmm15,%xmm1 - - vpslld $19,%xmm15,%xmm2 - vpaddd %xmm0,%xmm6,%xmm6 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm14,%xmm7 - - vpsrld $22,%xmm15,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm15,%xmm2 - vpxor %xmm3,%xmm8,%xmm14 - vpaddd %xmm6,%xmm10,%xmm10 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm6,%xmm14,%xmm14 - vpaddd %xmm7,%xmm14,%xmm14 - vmovdqu 176-128(%rax),%xmm6 - vpaddd 48-128(%rax),%xmm5,%xmm5 - - vpsrld $3,%xmm6,%xmm7 - vpsrld $7,%xmm6,%xmm1 - vpslld $25,%xmm6,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm6,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm6,%xmm2 - vmovdqu 128-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm5,%xmm5 - vpxor %xmm1,%xmm3,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm5,%xmm5 - vpsrld $6,%xmm10,%xmm7 - vpslld $26,%xmm10,%xmm2 - vmovdqu %xmm5,160-128(%rax) - vpaddd %xmm13,%xmm5,%xmm5 - - vpsrld $11,%xmm10,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm10,%xmm2 - vpaddd -64(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm10,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm10,%xmm2 - vpandn %xmm12,%xmm10,%xmm0 - vpand %xmm11,%xmm10,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm14,%xmm13 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm14,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm14,%xmm15,%xmm3 - - vpxor %xmm1,%xmm13,%xmm13 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm14,%xmm1 - - vpslld $19,%xmm14,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm13,%xmm7 - - vpsrld $22,%xmm14,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm14,%xmm2 - vpxor %xmm4,%xmm15,%xmm13 - vpaddd %xmm5,%xmm9,%xmm9 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm13,%xmm13 - vpaddd %xmm7,%xmm13,%xmm13 - vmovdqu 192-128(%rax),%xmm5 - vpaddd 64-128(%rax),%xmm6,%xmm6 - - vpsrld $3,%xmm5,%xmm7 - vpsrld $7,%xmm5,%xmm1 - vpslld $25,%xmm5,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm5,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm5,%xmm2 - vmovdqu 144-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm6,%xmm6 - vpsrld $6,%xmm9,%xmm7 - vpslld $26,%xmm9,%xmm2 - vmovdqu %xmm6,176-128(%rax) - vpaddd %xmm12,%xmm6,%xmm6 - - vpsrld $11,%xmm9,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm9,%xmm2 - vpaddd -32(%rbp),%xmm6,%xmm6 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm9,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm9,%xmm2 - vpandn %xmm11,%xmm9,%xmm0 - vpand %xmm10,%xmm9,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm13,%xmm12 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm13,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm13,%xmm14,%xmm4 - - vpxor %xmm1,%xmm12,%xmm12 - vpaddd %xmm7,%xmm6,%xmm6 - - vpsrld $13,%xmm13,%xmm1 - - vpslld $19,%xmm13,%xmm2 - vpaddd %xmm0,%xmm6,%xmm6 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm12,%xmm7 - - vpsrld $22,%xmm13,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm13,%xmm2 - vpxor %xmm3,%xmm14,%xmm12 - vpaddd %xmm6,%xmm8,%xmm8 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm6,%xmm12,%xmm12 - vpaddd %xmm7,%xmm12,%xmm12 - vmovdqu 208-128(%rax),%xmm6 - vpaddd 80-128(%rax),%xmm5,%xmm5 - - vpsrld $3,%xmm6,%xmm7 - vpsrld $7,%xmm6,%xmm1 - vpslld $25,%xmm6,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm6,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm6,%xmm2 - vmovdqu 160-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm5,%xmm5 - vpxor %xmm1,%xmm3,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm5,%xmm5 - vpsrld $6,%xmm8,%xmm7 - vpslld $26,%xmm8,%xmm2 - vmovdqu %xmm5,192-128(%rax) - vpaddd %xmm11,%xmm5,%xmm5 - - vpsrld $11,%xmm8,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm8,%xmm2 - vpaddd 0(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm8,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm8,%xmm2 - vpandn %xmm10,%xmm8,%xmm0 - vpand %xmm9,%xmm8,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm12,%xmm11 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm12,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm12,%xmm13,%xmm3 - - vpxor %xmm1,%xmm11,%xmm11 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm12,%xmm1 - - vpslld $19,%xmm12,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm11,%xmm7 - - vpsrld $22,%xmm12,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm12,%xmm2 - vpxor %xmm4,%xmm13,%xmm11 - vpaddd %xmm5,%xmm15,%xmm15 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm11,%xmm11 - vpaddd %xmm7,%xmm11,%xmm11 - vmovdqu 224-128(%rax),%xmm5 - vpaddd 96-128(%rax),%xmm6,%xmm6 - - vpsrld $3,%xmm5,%xmm7 - vpsrld $7,%xmm5,%xmm1 - vpslld $25,%xmm5,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm5,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm5,%xmm2 - vmovdqu 176-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm6,%xmm6 - vpsrld $6,%xmm15,%xmm7 - vpslld $26,%xmm15,%xmm2 - vmovdqu %xmm6,208-128(%rax) - vpaddd %xmm10,%xmm6,%xmm6 - - vpsrld $11,%xmm15,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm15,%xmm2 - vpaddd 32(%rbp),%xmm6,%xmm6 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm15,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm15,%xmm2 - vpandn %xmm9,%xmm15,%xmm0 - vpand %xmm8,%xmm15,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm11,%xmm10 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm11,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm11,%xmm12,%xmm4 - - vpxor %xmm1,%xmm10,%xmm10 - vpaddd %xmm7,%xmm6,%xmm6 - - vpsrld $13,%xmm11,%xmm1 - - vpslld $19,%xmm11,%xmm2 - vpaddd %xmm0,%xmm6,%xmm6 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm10,%xmm7 - - vpsrld $22,%xmm11,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm11,%xmm2 - vpxor %xmm3,%xmm12,%xmm10 - vpaddd %xmm6,%xmm14,%xmm14 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm6,%xmm10,%xmm10 - vpaddd %xmm7,%xmm10,%xmm10 - vmovdqu 240-128(%rax),%xmm6 - vpaddd 112-128(%rax),%xmm5,%xmm5 - - vpsrld $3,%xmm6,%xmm7 - vpsrld $7,%xmm6,%xmm1 - vpslld $25,%xmm6,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm6,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm6,%xmm2 - vmovdqu 192-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm5,%xmm5 - vpxor %xmm1,%xmm3,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm5,%xmm5 - vpsrld $6,%xmm14,%xmm7 - vpslld $26,%xmm14,%xmm2 - vmovdqu %xmm5,224-128(%rax) - vpaddd %xmm9,%xmm5,%xmm5 - - vpsrld $11,%xmm14,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm14,%xmm2 - vpaddd 64(%rbp),%xmm5,%xmm5 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm14,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm14,%xmm2 - vpandn %xmm8,%xmm14,%xmm0 - vpand %xmm15,%xmm14,%xmm3 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm10,%xmm9 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm10,%xmm1 - vpxor %xmm3,%xmm0,%xmm0 - vpxor %xmm10,%xmm11,%xmm3 - - vpxor %xmm1,%xmm9,%xmm9 - vpaddd %xmm7,%xmm5,%xmm5 - - vpsrld $13,%xmm10,%xmm1 - - vpslld $19,%xmm10,%xmm2 - vpaddd %xmm0,%xmm5,%xmm5 - vpand %xmm3,%xmm4,%xmm4 - - vpxor %xmm1,%xmm9,%xmm7 - - vpsrld $22,%xmm10,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm10,%xmm2 - vpxor %xmm4,%xmm11,%xmm9 - vpaddd %xmm5,%xmm13,%xmm13 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm5,%xmm9,%xmm9 - vpaddd %xmm7,%xmm9,%xmm9 - vmovdqu 0-128(%rax),%xmm5 - vpaddd 128-128(%rax),%xmm6,%xmm6 - - vpsrld $3,%xmm5,%xmm7 - vpsrld $7,%xmm5,%xmm1 - vpslld $25,%xmm5,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $18,%xmm5,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $14,%xmm5,%xmm2 - vmovdqu 208-128(%rax),%xmm0 - vpsrld $10,%xmm0,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - vpsrld $17,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $15,%xmm0,%xmm2 - vpaddd %xmm7,%xmm6,%xmm6 - vpxor %xmm1,%xmm4,%xmm7 - vpsrld $19,%xmm0,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $13,%xmm0,%xmm2 - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - vpaddd %xmm7,%xmm6,%xmm6 - vpsrld $6,%xmm13,%xmm7 - vpslld $26,%xmm13,%xmm2 - vmovdqu %xmm6,240-128(%rax) - vpaddd %xmm8,%xmm6,%xmm6 - - vpsrld $11,%xmm13,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - vpslld $21,%xmm13,%xmm2 - vpaddd 96(%rbp),%xmm6,%xmm6 - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $25,%xmm13,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $7,%xmm13,%xmm2 - vpandn %xmm15,%xmm13,%xmm0 - vpand %xmm14,%xmm13,%xmm4 - - vpxor %xmm1,%xmm7,%xmm7 - - vpsrld $2,%xmm9,%xmm8 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $30,%xmm9,%xmm1 - vpxor %xmm4,%xmm0,%xmm0 - vpxor %xmm9,%xmm10,%xmm4 - - vpxor %xmm1,%xmm8,%xmm8 - vpaddd %xmm7,%xmm6,%xmm6 - - vpsrld $13,%xmm9,%xmm1 - - vpslld $19,%xmm9,%xmm2 - vpaddd %xmm0,%xmm6,%xmm6 - vpand %xmm4,%xmm3,%xmm3 - - vpxor %xmm1,%xmm8,%xmm7 - - vpsrld $22,%xmm9,%xmm1 - vpxor %xmm2,%xmm7,%xmm7 - - vpslld $10,%xmm9,%xmm2 - vpxor %xmm3,%xmm10,%xmm8 - vpaddd %xmm6,%xmm12,%xmm12 - - vpxor %xmm1,%xmm7,%xmm7 - vpxor %xmm2,%xmm7,%xmm7 - - vpaddd %xmm6,%xmm8,%xmm8 - vpaddd %xmm7,%xmm8,%xmm8 - addq $256,%rbp - decl %ecx - jnz L$oop_16_xx_avx - - movl $1,%ecx - leaq K256+128(%rip),%rbp - cmpl 0(%rbx),%ecx - cmovgeq %rbp,%r8 - cmpl 4(%rbx),%ecx - cmovgeq %rbp,%r9 - cmpl 8(%rbx),%ecx - cmovgeq %rbp,%r10 - cmpl 12(%rbx),%ecx - cmovgeq %rbp,%r11 - vmovdqa (%rbx),%xmm7 - vpxor %xmm0,%xmm0,%xmm0 - vmovdqa %xmm7,%xmm6 - vpcmpgtd %xmm0,%xmm6,%xmm6 - vpaddd %xmm6,%xmm7,%xmm7 - - vmovdqu 0-128(%rdi),%xmm0 - vpand %xmm6,%xmm8,%xmm8 - vmovdqu 32-128(%rdi),%xmm1 - vpand %xmm6,%xmm9,%xmm9 - vmovdqu 64-128(%rdi),%xmm2 - vpand %xmm6,%xmm10,%xmm10 - vmovdqu 96-128(%rdi),%xmm5 - vpand %xmm6,%xmm11,%xmm11 - vpaddd %xmm0,%xmm8,%xmm8 - vmovdqu 128-128(%rdi),%xmm0 - vpand %xmm6,%xmm12,%xmm12 - vpaddd %xmm1,%xmm9,%xmm9 - vmovdqu 160-128(%rdi),%xmm1 - vpand %xmm6,%xmm13,%xmm13 - vpaddd %xmm2,%xmm10,%xmm10 - vmovdqu 192-128(%rdi),%xmm2 - vpand %xmm6,%xmm14,%xmm14 - vpaddd %xmm5,%xmm11,%xmm11 - vmovdqu 224-128(%rdi),%xmm5 - vpand %xmm6,%xmm15,%xmm15 - vpaddd %xmm0,%xmm12,%xmm12 - vpaddd %xmm1,%xmm13,%xmm13 - vmovdqu %xmm8,0-128(%rdi) - vpaddd %xmm2,%xmm14,%xmm14 - vmovdqu %xmm9,32-128(%rdi) - vpaddd %xmm5,%xmm15,%xmm15 - vmovdqu %xmm10,64-128(%rdi) - vmovdqu %xmm11,96-128(%rdi) - vmovdqu %xmm12,128-128(%rdi) - vmovdqu %xmm13,160-128(%rdi) - vmovdqu %xmm14,192-128(%rdi) - vmovdqu %xmm15,224-128(%rdi) - - vmovdqu %xmm7,(%rbx) - vmovdqu L$pbswap(%rip),%xmm6 - decl %edx - jnz L$oop_avx - - movl 280(%rsp),%edx - leaq 16(%rdi),%rdi - leaq 64(%rsi),%rsi - decl %edx - jnz L$oop_grande_avx - -L$done_avx: - movq 272(%rsp),%rax - vzeroupper - movq -16(%rax),%rbp - movq -8(%rax),%rbx - leaq (%rax),%rsp -L$epilogue_avx: - .byte 0xf3,0xc3 - - -.p2align 5 -sha256_multi_block_avx2: -_avx2_shortcut: - movq %rsp,%rax - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - subq $576,%rsp - andq $-256,%rsp - movq %rax,544(%rsp) -L$body_avx2: - leaq K256+128(%rip),%rbp - leaq 128(%rdi),%rdi - -L$oop_grande_avx2: - movl %edx,552(%rsp) - xorl %edx,%edx - leaq 512(%rsp),%rbx - movq 0(%rsi),%r12 - movl 8(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,0(%rbx) - cmovleq %rbp,%r12 - movq 16(%rsi),%r13 - movl 24(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,4(%rbx) - cmovleq %rbp,%r13 - movq 32(%rsi),%r14 - movl 40(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,8(%rbx) - cmovleq %rbp,%r14 - movq 48(%rsi),%r15 - movl 56(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,12(%rbx) - cmovleq %rbp,%r15 - movq 64(%rsi),%r8 - movl 72(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,16(%rbx) - cmovleq %rbp,%r8 - movq 80(%rsi),%r9 - movl 88(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,20(%rbx) - cmovleq %rbp,%r9 - movq 96(%rsi),%r10 - movl 104(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,24(%rbx) - cmovleq %rbp,%r10 - movq 112(%rsi),%r11 - movl 120(%rsi),%ecx - cmpl %edx,%ecx - cmovgl %ecx,%edx - testl %ecx,%ecx - movl %ecx,28(%rbx) - cmovleq %rbp,%r11 - vmovdqu 0-128(%rdi),%ymm8 - leaq 128(%rsp),%rax - vmovdqu 32-128(%rdi),%ymm9 - leaq 256+128(%rsp),%rbx - vmovdqu 64-128(%rdi),%ymm10 - vmovdqu 96-128(%rdi),%ymm11 - vmovdqu 128-128(%rdi),%ymm12 - vmovdqu 160-128(%rdi),%ymm13 - vmovdqu 192-128(%rdi),%ymm14 - vmovdqu 224-128(%rdi),%ymm15 - vmovdqu L$pbswap(%rip),%ymm6 - jmp L$oop_avx2 - -.p2align 5 -L$oop_avx2: - vpxor %ymm9,%ymm10,%ymm4 - vmovd 0(%r12),%xmm5 - vmovd 0(%r8),%xmm0 - vmovd 0(%r13),%xmm1 - vmovd 0(%r9),%xmm2 - vpinsrd $1,0(%r14),%xmm5,%xmm5 - vpinsrd $1,0(%r10),%xmm0,%xmm0 - vpinsrd $1,0(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,0(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm12,%ymm7 - vpslld $26,%ymm12,%ymm2 - vmovdqu %ymm5,0-128(%rax) - vpaddd %ymm15,%ymm5,%ymm5 - - vpsrld $11,%ymm12,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm12,%ymm2 - vpaddd -128(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm12,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm12,%ymm2 - vpandn %ymm14,%ymm12,%ymm0 - vpand %ymm13,%ymm12,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm8,%ymm15 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm8,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm8,%ymm9,%ymm3 - - vpxor %ymm1,%ymm15,%ymm15 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm8,%ymm1 - - vpslld $19,%ymm8,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm15,%ymm7 - - vpsrld $22,%ymm8,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm8,%ymm2 - vpxor %ymm4,%ymm9,%ymm15 - vpaddd %ymm5,%ymm11,%ymm11 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm15,%ymm15 - vpaddd %ymm7,%ymm15,%ymm15 - vmovd 4(%r12),%xmm5 - vmovd 4(%r8),%xmm0 - vmovd 4(%r13),%xmm1 - vmovd 4(%r9),%xmm2 - vpinsrd $1,4(%r14),%xmm5,%xmm5 - vpinsrd $1,4(%r10),%xmm0,%xmm0 - vpinsrd $1,4(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,4(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm11,%ymm7 - vpslld $26,%ymm11,%ymm2 - vmovdqu %ymm5,32-128(%rax) - vpaddd %ymm14,%ymm5,%ymm5 - - vpsrld $11,%ymm11,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm11,%ymm2 - vpaddd -96(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm11,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm11,%ymm2 - vpandn %ymm13,%ymm11,%ymm0 - vpand %ymm12,%ymm11,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm15,%ymm14 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm15,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm15,%ymm8,%ymm4 - - vpxor %ymm1,%ymm14,%ymm14 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm15,%ymm1 - - vpslld $19,%ymm15,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm14,%ymm7 - - vpsrld $22,%ymm15,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm15,%ymm2 - vpxor %ymm3,%ymm8,%ymm14 - vpaddd %ymm5,%ymm10,%ymm10 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm14,%ymm14 - vpaddd %ymm7,%ymm14,%ymm14 - vmovd 8(%r12),%xmm5 - vmovd 8(%r8),%xmm0 - vmovd 8(%r13),%xmm1 - vmovd 8(%r9),%xmm2 - vpinsrd $1,8(%r14),%xmm5,%xmm5 - vpinsrd $1,8(%r10),%xmm0,%xmm0 - vpinsrd $1,8(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,8(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm10,%ymm7 - vpslld $26,%ymm10,%ymm2 - vmovdqu %ymm5,64-128(%rax) - vpaddd %ymm13,%ymm5,%ymm5 - - vpsrld $11,%ymm10,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm10,%ymm2 - vpaddd -64(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm10,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm10,%ymm2 - vpandn %ymm12,%ymm10,%ymm0 - vpand %ymm11,%ymm10,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm14,%ymm13 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm14,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm14,%ymm15,%ymm3 - - vpxor %ymm1,%ymm13,%ymm13 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm14,%ymm1 - - vpslld $19,%ymm14,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm13,%ymm7 - - vpsrld $22,%ymm14,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm14,%ymm2 - vpxor %ymm4,%ymm15,%ymm13 - vpaddd %ymm5,%ymm9,%ymm9 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm13,%ymm13 - vpaddd %ymm7,%ymm13,%ymm13 - vmovd 12(%r12),%xmm5 - vmovd 12(%r8),%xmm0 - vmovd 12(%r13),%xmm1 - vmovd 12(%r9),%xmm2 - vpinsrd $1,12(%r14),%xmm5,%xmm5 - vpinsrd $1,12(%r10),%xmm0,%xmm0 - vpinsrd $1,12(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,12(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm9,%ymm7 - vpslld $26,%ymm9,%ymm2 - vmovdqu %ymm5,96-128(%rax) - vpaddd %ymm12,%ymm5,%ymm5 - - vpsrld $11,%ymm9,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm9,%ymm2 - vpaddd -32(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm9,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm9,%ymm2 - vpandn %ymm11,%ymm9,%ymm0 - vpand %ymm10,%ymm9,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm13,%ymm12 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm13,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm13,%ymm14,%ymm4 - - vpxor %ymm1,%ymm12,%ymm12 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm13,%ymm1 - - vpslld $19,%ymm13,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm12,%ymm7 - - vpsrld $22,%ymm13,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm13,%ymm2 - vpxor %ymm3,%ymm14,%ymm12 - vpaddd %ymm5,%ymm8,%ymm8 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm12,%ymm12 - vpaddd %ymm7,%ymm12,%ymm12 - vmovd 16(%r12),%xmm5 - vmovd 16(%r8),%xmm0 - vmovd 16(%r13),%xmm1 - vmovd 16(%r9),%xmm2 - vpinsrd $1,16(%r14),%xmm5,%xmm5 - vpinsrd $1,16(%r10),%xmm0,%xmm0 - vpinsrd $1,16(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,16(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm8,%ymm7 - vpslld $26,%ymm8,%ymm2 - vmovdqu %ymm5,128-128(%rax) - vpaddd %ymm11,%ymm5,%ymm5 - - vpsrld $11,%ymm8,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm8,%ymm2 - vpaddd 0(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm8,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm8,%ymm2 - vpandn %ymm10,%ymm8,%ymm0 - vpand %ymm9,%ymm8,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm12,%ymm11 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm12,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm12,%ymm13,%ymm3 - - vpxor %ymm1,%ymm11,%ymm11 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm12,%ymm1 - - vpslld $19,%ymm12,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm11,%ymm7 - - vpsrld $22,%ymm12,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm12,%ymm2 - vpxor %ymm4,%ymm13,%ymm11 - vpaddd %ymm5,%ymm15,%ymm15 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm11,%ymm11 - vpaddd %ymm7,%ymm11,%ymm11 - vmovd 20(%r12),%xmm5 - vmovd 20(%r8),%xmm0 - vmovd 20(%r13),%xmm1 - vmovd 20(%r9),%xmm2 - vpinsrd $1,20(%r14),%xmm5,%xmm5 - vpinsrd $1,20(%r10),%xmm0,%xmm0 - vpinsrd $1,20(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,20(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm15,%ymm7 - vpslld $26,%ymm15,%ymm2 - vmovdqu %ymm5,160-128(%rax) - vpaddd %ymm10,%ymm5,%ymm5 - - vpsrld $11,%ymm15,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm15,%ymm2 - vpaddd 32(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm15,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm15,%ymm2 - vpandn %ymm9,%ymm15,%ymm0 - vpand %ymm8,%ymm15,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm11,%ymm10 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm11,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm11,%ymm12,%ymm4 - - vpxor %ymm1,%ymm10,%ymm10 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm11,%ymm1 - - vpslld $19,%ymm11,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm10,%ymm7 - - vpsrld $22,%ymm11,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm11,%ymm2 - vpxor %ymm3,%ymm12,%ymm10 - vpaddd %ymm5,%ymm14,%ymm14 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm10,%ymm10 - vpaddd %ymm7,%ymm10,%ymm10 - vmovd 24(%r12),%xmm5 - vmovd 24(%r8),%xmm0 - vmovd 24(%r13),%xmm1 - vmovd 24(%r9),%xmm2 - vpinsrd $1,24(%r14),%xmm5,%xmm5 - vpinsrd $1,24(%r10),%xmm0,%xmm0 - vpinsrd $1,24(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,24(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm14,%ymm7 - vpslld $26,%ymm14,%ymm2 - vmovdqu %ymm5,192-128(%rax) - vpaddd %ymm9,%ymm5,%ymm5 - - vpsrld $11,%ymm14,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm14,%ymm2 - vpaddd 64(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm14,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm14,%ymm2 - vpandn %ymm8,%ymm14,%ymm0 - vpand %ymm15,%ymm14,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm10,%ymm9 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm10,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm10,%ymm11,%ymm3 - - vpxor %ymm1,%ymm9,%ymm9 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm10,%ymm1 - - vpslld $19,%ymm10,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm9,%ymm7 - - vpsrld $22,%ymm10,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm10,%ymm2 - vpxor %ymm4,%ymm11,%ymm9 - vpaddd %ymm5,%ymm13,%ymm13 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm9,%ymm9 - vpaddd %ymm7,%ymm9,%ymm9 - vmovd 28(%r12),%xmm5 - vmovd 28(%r8),%xmm0 - vmovd 28(%r13),%xmm1 - vmovd 28(%r9),%xmm2 - vpinsrd $1,28(%r14),%xmm5,%xmm5 - vpinsrd $1,28(%r10),%xmm0,%xmm0 - vpinsrd $1,28(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,28(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm13,%ymm7 - vpslld $26,%ymm13,%ymm2 - vmovdqu %ymm5,224-128(%rax) - vpaddd %ymm8,%ymm5,%ymm5 - - vpsrld $11,%ymm13,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm13,%ymm2 - vpaddd 96(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm13,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm13,%ymm2 - vpandn %ymm15,%ymm13,%ymm0 - vpand %ymm14,%ymm13,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm9,%ymm8 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm9,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm9,%ymm10,%ymm4 - - vpxor %ymm1,%ymm8,%ymm8 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm9,%ymm1 - - vpslld $19,%ymm9,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm8,%ymm7 - - vpsrld $22,%ymm9,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm9,%ymm2 - vpxor %ymm3,%ymm10,%ymm8 - vpaddd %ymm5,%ymm12,%ymm12 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm8,%ymm8 - vpaddd %ymm7,%ymm8,%ymm8 - addq $256,%rbp - vmovd 32(%r12),%xmm5 - vmovd 32(%r8),%xmm0 - vmovd 32(%r13),%xmm1 - vmovd 32(%r9),%xmm2 - vpinsrd $1,32(%r14),%xmm5,%xmm5 - vpinsrd $1,32(%r10),%xmm0,%xmm0 - vpinsrd $1,32(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,32(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm12,%ymm7 - vpslld $26,%ymm12,%ymm2 - vmovdqu %ymm5,256-256-128(%rbx) - vpaddd %ymm15,%ymm5,%ymm5 - - vpsrld $11,%ymm12,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm12,%ymm2 - vpaddd -128(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm12,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm12,%ymm2 - vpandn %ymm14,%ymm12,%ymm0 - vpand %ymm13,%ymm12,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm8,%ymm15 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm8,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm8,%ymm9,%ymm3 - - vpxor %ymm1,%ymm15,%ymm15 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm8,%ymm1 - - vpslld $19,%ymm8,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm15,%ymm7 - - vpsrld $22,%ymm8,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm8,%ymm2 - vpxor %ymm4,%ymm9,%ymm15 - vpaddd %ymm5,%ymm11,%ymm11 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm15,%ymm15 - vpaddd %ymm7,%ymm15,%ymm15 - vmovd 36(%r12),%xmm5 - vmovd 36(%r8),%xmm0 - vmovd 36(%r13),%xmm1 - vmovd 36(%r9),%xmm2 - vpinsrd $1,36(%r14),%xmm5,%xmm5 - vpinsrd $1,36(%r10),%xmm0,%xmm0 - vpinsrd $1,36(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,36(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm11,%ymm7 - vpslld $26,%ymm11,%ymm2 - vmovdqu %ymm5,288-256-128(%rbx) - vpaddd %ymm14,%ymm5,%ymm5 - - vpsrld $11,%ymm11,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm11,%ymm2 - vpaddd -96(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm11,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm11,%ymm2 - vpandn %ymm13,%ymm11,%ymm0 - vpand %ymm12,%ymm11,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm15,%ymm14 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm15,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm15,%ymm8,%ymm4 - - vpxor %ymm1,%ymm14,%ymm14 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm15,%ymm1 - - vpslld $19,%ymm15,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm14,%ymm7 - - vpsrld $22,%ymm15,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm15,%ymm2 - vpxor %ymm3,%ymm8,%ymm14 - vpaddd %ymm5,%ymm10,%ymm10 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm14,%ymm14 - vpaddd %ymm7,%ymm14,%ymm14 - vmovd 40(%r12),%xmm5 - vmovd 40(%r8),%xmm0 - vmovd 40(%r13),%xmm1 - vmovd 40(%r9),%xmm2 - vpinsrd $1,40(%r14),%xmm5,%xmm5 - vpinsrd $1,40(%r10),%xmm0,%xmm0 - vpinsrd $1,40(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,40(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm10,%ymm7 - vpslld $26,%ymm10,%ymm2 - vmovdqu %ymm5,320-256-128(%rbx) - vpaddd %ymm13,%ymm5,%ymm5 - - vpsrld $11,%ymm10,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm10,%ymm2 - vpaddd -64(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm10,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm10,%ymm2 - vpandn %ymm12,%ymm10,%ymm0 - vpand %ymm11,%ymm10,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm14,%ymm13 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm14,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm14,%ymm15,%ymm3 - - vpxor %ymm1,%ymm13,%ymm13 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm14,%ymm1 - - vpslld $19,%ymm14,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm13,%ymm7 - - vpsrld $22,%ymm14,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm14,%ymm2 - vpxor %ymm4,%ymm15,%ymm13 - vpaddd %ymm5,%ymm9,%ymm9 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm13,%ymm13 - vpaddd %ymm7,%ymm13,%ymm13 - vmovd 44(%r12),%xmm5 - vmovd 44(%r8),%xmm0 - vmovd 44(%r13),%xmm1 - vmovd 44(%r9),%xmm2 - vpinsrd $1,44(%r14),%xmm5,%xmm5 - vpinsrd $1,44(%r10),%xmm0,%xmm0 - vpinsrd $1,44(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,44(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm9,%ymm7 - vpslld $26,%ymm9,%ymm2 - vmovdqu %ymm5,352-256-128(%rbx) - vpaddd %ymm12,%ymm5,%ymm5 - - vpsrld $11,%ymm9,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm9,%ymm2 - vpaddd -32(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm9,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm9,%ymm2 - vpandn %ymm11,%ymm9,%ymm0 - vpand %ymm10,%ymm9,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm13,%ymm12 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm13,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm13,%ymm14,%ymm4 - - vpxor %ymm1,%ymm12,%ymm12 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm13,%ymm1 - - vpslld $19,%ymm13,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm12,%ymm7 - - vpsrld $22,%ymm13,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm13,%ymm2 - vpxor %ymm3,%ymm14,%ymm12 - vpaddd %ymm5,%ymm8,%ymm8 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm12,%ymm12 - vpaddd %ymm7,%ymm12,%ymm12 - vmovd 48(%r12),%xmm5 - vmovd 48(%r8),%xmm0 - vmovd 48(%r13),%xmm1 - vmovd 48(%r9),%xmm2 - vpinsrd $1,48(%r14),%xmm5,%xmm5 - vpinsrd $1,48(%r10),%xmm0,%xmm0 - vpinsrd $1,48(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,48(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm8,%ymm7 - vpslld $26,%ymm8,%ymm2 - vmovdqu %ymm5,384-256-128(%rbx) - vpaddd %ymm11,%ymm5,%ymm5 - - vpsrld $11,%ymm8,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm8,%ymm2 - vpaddd 0(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm8,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm8,%ymm2 - vpandn %ymm10,%ymm8,%ymm0 - vpand %ymm9,%ymm8,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm12,%ymm11 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm12,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm12,%ymm13,%ymm3 - - vpxor %ymm1,%ymm11,%ymm11 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm12,%ymm1 - - vpslld $19,%ymm12,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm11,%ymm7 - - vpsrld $22,%ymm12,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm12,%ymm2 - vpxor %ymm4,%ymm13,%ymm11 - vpaddd %ymm5,%ymm15,%ymm15 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm11,%ymm11 - vpaddd %ymm7,%ymm11,%ymm11 - vmovd 52(%r12),%xmm5 - vmovd 52(%r8),%xmm0 - vmovd 52(%r13),%xmm1 - vmovd 52(%r9),%xmm2 - vpinsrd $1,52(%r14),%xmm5,%xmm5 - vpinsrd $1,52(%r10),%xmm0,%xmm0 - vpinsrd $1,52(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,52(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm15,%ymm7 - vpslld $26,%ymm15,%ymm2 - vmovdqu %ymm5,416-256-128(%rbx) - vpaddd %ymm10,%ymm5,%ymm5 - - vpsrld $11,%ymm15,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm15,%ymm2 - vpaddd 32(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm15,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm15,%ymm2 - vpandn %ymm9,%ymm15,%ymm0 - vpand %ymm8,%ymm15,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm11,%ymm10 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm11,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm11,%ymm12,%ymm4 - - vpxor %ymm1,%ymm10,%ymm10 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm11,%ymm1 - - vpslld $19,%ymm11,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm10,%ymm7 - - vpsrld $22,%ymm11,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm11,%ymm2 - vpxor %ymm3,%ymm12,%ymm10 - vpaddd %ymm5,%ymm14,%ymm14 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm10,%ymm10 - vpaddd %ymm7,%ymm10,%ymm10 - vmovd 56(%r12),%xmm5 - vmovd 56(%r8),%xmm0 - vmovd 56(%r13),%xmm1 - vmovd 56(%r9),%xmm2 - vpinsrd $1,56(%r14),%xmm5,%xmm5 - vpinsrd $1,56(%r10),%xmm0,%xmm0 - vpinsrd $1,56(%r15),%xmm1,%xmm1 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,56(%r11),%xmm2,%xmm2 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm14,%ymm7 - vpslld $26,%ymm14,%ymm2 - vmovdqu %ymm5,448-256-128(%rbx) - vpaddd %ymm9,%ymm5,%ymm5 - - vpsrld $11,%ymm14,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm14,%ymm2 - vpaddd 64(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm14,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm14,%ymm2 - vpandn %ymm8,%ymm14,%ymm0 - vpand %ymm15,%ymm14,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm10,%ymm9 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm10,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm10,%ymm11,%ymm3 - - vpxor %ymm1,%ymm9,%ymm9 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm10,%ymm1 - - vpslld $19,%ymm10,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm9,%ymm7 - - vpsrld $22,%ymm10,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm10,%ymm2 - vpxor %ymm4,%ymm11,%ymm9 - vpaddd %ymm5,%ymm13,%ymm13 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm9,%ymm9 - vpaddd %ymm7,%ymm9,%ymm9 - vmovd 60(%r12),%xmm5 - leaq 64(%r12),%r12 - vmovd 60(%r8),%xmm0 - leaq 64(%r8),%r8 - vmovd 60(%r13),%xmm1 - leaq 64(%r13),%r13 - vmovd 60(%r9),%xmm2 - leaq 64(%r9),%r9 - vpinsrd $1,60(%r14),%xmm5,%xmm5 - leaq 64(%r14),%r14 - vpinsrd $1,60(%r10),%xmm0,%xmm0 - leaq 64(%r10),%r10 - vpinsrd $1,60(%r15),%xmm1,%xmm1 - leaq 64(%r15),%r15 - vpunpckldq %ymm1,%ymm5,%ymm5 - vpinsrd $1,60(%r11),%xmm2,%xmm2 - leaq 64(%r11),%r11 - vpunpckldq %ymm2,%ymm0,%ymm0 - vinserti128 $1,%xmm0,%ymm5,%ymm5 - vpshufb %ymm6,%ymm5,%ymm5 - vpsrld $6,%ymm13,%ymm7 - vpslld $26,%ymm13,%ymm2 - vmovdqu %ymm5,480-256-128(%rbx) - vpaddd %ymm8,%ymm5,%ymm5 - - vpsrld $11,%ymm13,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm13,%ymm2 - vpaddd 96(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm13,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - prefetcht0 63(%r12) - vpslld $7,%ymm13,%ymm2 - vpandn %ymm15,%ymm13,%ymm0 - vpand %ymm14,%ymm13,%ymm4 - prefetcht0 63(%r13) - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm9,%ymm8 - vpxor %ymm2,%ymm7,%ymm7 - prefetcht0 63(%r14) - vpslld $30,%ymm9,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm9,%ymm10,%ymm4 - prefetcht0 63(%r15) - vpxor %ymm1,%ymm8,%ymm8 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm9,%ymm1 - prefetcht0 63(%r8) - vpslld $19,%ymm9,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm4,%ymm3,%ymm3 - prefetcht0 63(%r9) - vpxor %ymm1,%ymm8,%ymm7 - - vpsrld $22,%ymm9,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - prefetcht0 63(%r10) - vpslld $10,%ymm9,%ymm2 - vpxor %ymm3,%ymm10,%ymm8 - vpaddd %ymm5,%ymm12,%ymm12 - prefetcht0 63(%r11) - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm8,%ymm8 - vpaddd %ymm7,%ymm8,%ymm8 - addq $256,%rbp - vmovdqu 0-128(%rax),%ymm5 - movl $3,%ecx - jmp L$oop_16_xx_avx2 -.p2align 5 -L$oop_16_xx_avx2: - vmovdqu 32-128(%rax),%ymm6 - vpaddd 288-256-128(%rbx),%ymm5,%ymm5 - - vpsrld $3,%ymm6,%ymm7 - vpsrld $7,%ymm6,%ymm1 - vpslld $25,%ymm6,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm6,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm6,%ymm2 - vmovdqu 448-256-128(%rbx),%ymm0 - vpsrld $10,%ymm0,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm5,%ymm5 - vpxor %ymm1,%ymm3,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm5,%ymm5 - vpsrld $6,%ymm12,%ymm7 - vpslld $26,%ymm12,%ymm2 - vmovdqu %ymm5,0-128(%rax) - vpaddd %ymm15,%ymm5,%ymm5 - - vpsrld $11,%ymm12,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm12,%ymm2 - vpaddd -128(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm12,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm12,%ymm2 - vpandn %ymm14,%ymm12,%ymm0 - vpand %ymm13,%ymm12,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm8,%ymm15 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm8,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm8,%ymm9,%ymm3 - - vpxor %ymm1,%ymm15,%ymm15 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm8,%ymm1 - - vpslld $19,%ymm8,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm15,%ymm7 - - vpsrld $22,%ymm8,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm8,%ymm2 - vpxor %ymm4,%ymm9,%ymm15 - vpaddd %ymm5,%ymm11,%ymm11 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm15,%ymm15 - vpaddd %ymm7,%ymm15,%ymm15 - vmovdqu 64-128(%rax),%ymm5 - vpaddd 320-256-128(%rbx),%ymm6,%ymm6 - - vpsrld $3,%ymm5,%ymm7 - vpsrld $7,%ymm5,%ymm1 - vpslld $25,%ymm5,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm5,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm5,%ymm2 - vmovdqu 480-256-128(%rbx),%ymm0 - vpsrld $10,%ymm0,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm6,%ymm6 - vpxor %ymm1,%ymm4,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm6,%ymm6 - vpsrld $6,%ymm11,%ymm7 - vpslld $26,%ymm11,%ymm2 - vmovdqu %ymm6,32-128(%rax) - vpaddd %ymm14,%ymm6,%ymm6 - - vpsrld $11,%ymm11,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm11,%ymm2 - vpaddd -96(%rbp),%ymm6,%ymm6 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm11,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm11,%ymm2 - vpandn %ymm13,%ymm11,%ymm0 - vpand %ymm12,%ymm11,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm15,%ymm14 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm15,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm15,%ymm8,%ymm4 - - vpxor %ymm1,%ymm14,%ymm14 - vpaddd %ymm7,%ymm6,%ymm6 - - vpsrld $13,%ymm15,%ymm1 - - vpslld $19,%ymm15,%ymm2 - vpaddd %ymm0,%ymm6,%ymm6 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm14,%ymm7 - - vpsrld $22,%ymm15,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm15,%ymm2 - vpxor %ymm3,%ymm8,%ymm14 - vpaddd %ymm6,%ymm10,%ymm10 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm6,%ymm14,%ymm14 - vpaddd %ymm7,%ymm14,%ymm14 - vmovdqu 96-128(%rax),%ymm6 - vpaddd 352-256-128(%rbx),%ymm5,%ymm5 - - vpsrld $3,%ymm6,%ymm7 - vpsrld $7,%ymm6,%ymm1 - vpslld $25,%ymm6,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm6,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm6,%ymm2 - vmovdqu 0-128(%rax),%ymm0 - vpsrld $10,%ymm0,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm5,%ymm5 - vpxor %ymm1,%ymm3,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm5,%ymm5 - vpsrld $6,%ymm10,%ymm7 - vpslld $26,%ymm10,%ymm2 - vmovdqu %ymm5,64-128(%rax) - vpaddd %ymm13,%ymm5,%ymm5 - - vpsrld $11,%ymm10,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm10,%ymm2 - vpaddd -64(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm10,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm10,%ymm2 - vpandn %ymm12,%ymm10,%ymm0 - vpand %ymm11,%ymm10,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm14,%ymm13 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm14,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm14,%ymm15,%ymm3 - - vpxor %ymm1,%ymm13,%ymm13 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm14,%ymm1 - - vpslld $19,%ymm14,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm13,%ymm7 - - vpsrld $22,%ymm14,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm14,%ymm2 - vpxor %ymm4,%ymm15,%ymm13 - vpaddd %ymm5,%ymm9,%ymm9 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm13,%ymm13 - vpaddd %ymm7,%ymm13,%ymm13 - vmovdqu 128-128(%rax),%ymm5 - vpaddd 384-256-128(%rbx),%ymm6,%ymm6 - - vpsrld $3,%ymm5,%ymm7 - vpsrld $7,%ymm5,%ymm1 - vpslld $25,%ymm5,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm5,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm5,%ymm2 - vmovdqu 32-128(%rax),%ymm0 - vpsrld $10,%ymm0,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm6,%ymm6 - vpxor %ymm1,%ymm4,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm6,%ymm6 - vpsrld $6,%ymm9,%ymm7 - vpslld $26,%ymm9,%ymm2 - vmovdqu %ymm6,96-128(%rax) - vpaddd %ymm12,%ymm6,%ymm6 - - vpsrld $11,%ymm9,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm9,%ymm2 - vpaddd -32(%rbp),%ymm6,%ymm6 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm9,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm9,%ymm2 - vpandn %ymm11,%ymm9,%ymm0 - vpand %ymm10,%ymm9,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm13,%ymm12 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm13,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm13,%ymm14,%ymm4 - - vpxor %ymm1,%ymm12,%ymm12 - vpaddd %ymm7,%ymm6,%ymm6 - - vpsrld $13,%ymm13,%ymm1 - - vpslld $19,%ymm13,%ymm2 - vpaddd %ymm0,%ymm6,%ymm6 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm12,%ymm7 - - vpsrld $22,%ymm13,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm13,%ymm2 - vpxor %ymm3,%ymm14,%ymm12 - vpaddd %ymm6,%ymm8,%ymm8 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm6,%ymm12,%ymm12 - vpaddd %ymm7,%ymm12,%ymm12 - vmovdqu 160-128(%rax),%ymm6 - vpaddd 416-256-128(%rbx),%ymm5,%ymm5 - - vpsrld $3,%ymm6,%ymm7 - vpsrld $7,%ymm6,%ymm1 - vpslld $25,%ymm6,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm6,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm6,%ymm2 - vmovdqu 64-128(%rax),%ymm0 - vpsrld $10,%ymm0,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm5,%ymm5 - vpxor %ymm1,%ymm3,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm5,%ymm5 - vpsrld $6,%ymm8,%ymm7 - vpslld $26,%ymm8,%ymm2 - vmovdqu %ymm5,128-128(%rax) - vpaddd %ymm11,%ymm5,%ymm5 - - vpsrld $11,%ymm8,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm8,%ymm2 - vpaddd 0(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm8,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm8,%ymm2 - vpandn %ymm10,%ymm8,%ymm0 - vpand %ymm9,%ymm8,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm12,%ymm11 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm12,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm12,%ymm13,%ymm3 - - vpxor %ymm1,%ymm11,%ymm11 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm12,%ymm1 - - vpslld $19,%ymm12,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm11,%ymm7 - - vpsrld $22,%ymm12,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm12,%ymm2 - vpxor %ymm4,%ymm13,%ymm11 - vpaddd %ymm5,%ymm15,%ymm15 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm11,%ymm11 - vpaddd %ymm7,%ymm11,%ymm11 - vmovdqu 192-128(%rax),%ymm5 - vpaddd 448-256-128(%rbx),%ymm6,%ymm6 - - vpsrld $3,%ymm5,%ymm7 - vpsrld $7,%ymm5,%ymm1 - vpslld $25,%ymm5,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm5,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm5,%ymm2 - vmovdqu 96-128(%rax),%ymm0 - vpsrld $10,%ymm0,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm6,%ymm6 - vpxor %ymm1,%ymm4,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm6,%ymm6 - vpsrld $6,%ymm15,%ymm7 - vpslld $26,%ymm15,%ymm2 - vmovdqu %ymm6,160-128(%rax) - vpaddd %ymm10,%ymm6,%ymm6 - - vpsrld $11,%ymm15,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm15,%ymm2 - vpaddd 32(%rbp),%ymm6,%ymm6 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm15,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm15,%ymm2 - vpandn %ymm9,%ymm15,%ymm0 - vpand %ymm8,%ymm15,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm11,%ymm10 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm11,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm11,%ymm12,%ymm4 - - vpxor %ymm1,%ymm10,%ymm10 - vpaddd %ymm7,%ymm6,%ymm6 - - vpsrld $13,%ymm11,%ymm1 - - vpslld $19,%ymm11,%ymm2 - vpaddd %ymm0,%ymm6,%ymm6 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm10,%ymm7 - - vpsrld $22,%ymm11,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm11,%ymm2 - vpxor %ymm3,%ymm12,%ymm10 - vpaddd %ymm6,%ymm14,%ymm14 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm6,%ymm10,%ymm10 - vpaddd %ymm7,%ymm10,%ymm10 - vmovdqu 224-128(%rax),%ymm6 - vpaddd 480-256-128(%rbx),%ymm5,%ymm5 - - vpsrld $3,%ymm6,%ymm7 - vpsrld $7,%ymm6,%ymm1 - vpslld $25,%ymm6,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm6,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm6,%ymm2 - vmovdqu 128-128(%rax),%ymm0 - vpsrld $10,%ymm0,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm5,%ymm5 - vpxor %ymm1,%ymm3,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm5,%ymm5 - vpsrld $6,%ymm14,%ymm7 - vpslld $26,%ymm14,%ymm2 - vmovdqu %ymm5,192-128(%rax) - vpaddd %ymm9,%ymm5,%ymm5 - - vpsrld $11,%ymm14,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm14,%ymm2 - vpaddd 64(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm14,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm14,%ymm2 - vpandn %ymm8,%ymm14,%ymm0 - vpand %ymm15,%ymm14,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm10,%ymm9 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm10,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm10,%ymm11,%ymm3 - - vpxor %ymm1,%ymm9,%ymm9 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm10,%ymm1 - - vpslld $19,%ymm10,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm9,%ymm7 - - vpsrld $22,%ymm10,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm10,%ymm2 - vpxor %ymm4,%ymm11,%ymm9 - vpaddd %ymm5,%ymm13,%ymm13 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm9,%ymm9 - vpaddd %ymm7,%ymm9,%ymm9 - vmovdqu 256-256-128(%rbx),%ymm5 - vpaddd 0-128(%rax),%ymm6,%ymm6 - - vpsrld $3,%ymm5,%ymm7 - vpsrld $7,%ymm5,%ymm1 - vpslld $25,%ymm5,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm5,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm5,%ymm2 - vmovdqu 160-128(%rax),%ymm0 - vpsrld $10,%ymm0,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm6,%ymm6 - vpxor %ymm1,%ymm4,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm6,%ymm6 - vpsrld $6,%ymm13,%ymm7 - vpslld $26,%ymm13,%ymm2 - vmovdqu %ymm6,224-128(%rax) - vpaddd %ymm8,%ymm6,%ymm6 - - vpsrld $11,%ymm13,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm13,%ymm2 - vpaddd 96(%rbp),%ymm6,%ymm6 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm13,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm13,%ymm2 - vpandn %ymm15,%ymm13,%ymm0 - vpand %ymm14,%ymm13,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm9,%ymm8 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm9,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm9,%ymm10,%ymm4 - - vpxor %ymm1,%ymm8,%ymm8 - vpaddd %ymm7,%ymm6,%ymm6 - - vpsrld $13,%ymm9,%ymm1 - - vpslld $19,%ymm9,%ymm2 - vpaddd %ymm0,%ymm6,%ymm6 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm8,%ymm7 - - vpsrld $22,%ymm9,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm9,%ymm2 - vpxor %ymm3,%ymm10,%ymm8 - vpaddd %ymm6,%ymm12,%ymm12 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm6,%ymm8,%ymm8 - vpaddd %ymm7,%ymm8,%ymm8 - addq $256,%rbp - vmovdqu 288-256-128(%rbx),%ymm6 - vpaddd 32-128(%rax),%ymm5,%ymm5 - - vpsrld $3,%ymm6,%ymm7 - vpsrld $7,%ymm6,%ymm1 - vpslld $25,%ymm6,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm6,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm6,%ymm2 - vmovdqu 192-128(%rax),%ymm0 - vpsrld $10,%ymm0,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm5,%ymm5 - vpxor %ymm1,%ymm3,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm5,%ymm5 - vpsrld $6,%ymm12,%ymm7 - vpslld $26,%ymm12,%ymm2 - vmovdqu %ymm5,256-256-128(%rbx) - vpaddd %ymm15,%ymm5,%ymm5 - - vpsrld $11,%ymm12,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm12,%ymm2 - vpaddd -128(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm12,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm12,%ymm2 - vpandn %ymm14,%ymm12,%ymm0 - vpand %ymm13,%ymm12,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm8,%ymm15 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm8,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm8,%ymm9,%ymm3 - - vpxor %ymm1,%ymm15,%ymm15 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm8,%ymm1 - - vpslld $19,%ymm8,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm15,%ymm7 - - vpsrld $22,%ymm8,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm8,%ymm2 - vpxor %ymm4,%ymm9,%ymm15 - vpaddd %ymm5,%ymm11,%ymm11 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm15,%ymm15 - vpaddd %ymm7,%ymm15,%ymm15 - vmovdqu 320-256-128(%rbx),%ymm5 - vpaddd 64-128(%rax),%ymm6,%ymm6 - - vpsrld $3,%ymm5,%ymm7 - vpsrld $7,%ymm5,%ymm1 - vpslld $25,%ymm5,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm5,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm5,%ymm2 - vmovdqu 224-128(%rax),%ymm0 - vpsrld $10,%ymm0,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm6,%ymm6 - vpxor %ymm1,%ymm4,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm6,%ymm6 - vpsrld $6,%ymm11,%ymm7 - vpslld $26,%ymm11,%ymm2 - vmovdqu %ymm6,288-256-128(%rbx) - vpaddd %ymm14,%ymm6,%ymm6 - - vpsrld $11,%ymm11,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm11,%ymm2 - vpaddd -96(%rbp),%ymm6,%ymm6 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm11,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm11,%ymm2 - vpandn %ymm13,%ymm11,%ymm0 - vpand %ymm12,%ymm11,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm15,%ymm14 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm15,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm15,%ymm8,%ymm4 - - vpxor %ymm1,%ymm14,%ymm14 - vpaddd %ymm7,%ymm6,%ymm6 - - vpsrld $13,%ymm15,%ymm1 - - vpslld $19,%ymm15,%ymm2 - vpaddd %ymm0,%ymm6,%ymm6 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm14,%ymm7 - - vpsrld $22,%ymm15,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm15,%ymm2 - vpxor %ymm3,%ymm8,%ymm14 - vpaddd %ymm6,%ymm10,%ymm10 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm6,%ymm14,%ymm14 - vpaddd %ymm7,%ymm14,%ymm14 - vmovdqu 352-256-128(%rbx),%ymm6 - vpaddd 96-128(%rax),%ymm5,%ymm5 - - vpsrld $3,%ymm6,%ymm7 - vpsrld $7,%ymm6,%ymm1 - vpslld $25,%ymm6,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm6,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm6,%ymm2 - vmovdqu 256-256-128(%rbx),%ymm0 - vpsrld $10,%ymm0,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm5,%ymm5 - vpxor %ymm1,%ymm3,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm5,%ymm5 - vpsrld $6,%ymm10,%ymm7 - vpslld $26,%ymm10,%ymm2 - vmovdqu %ymm5,320-256-128(%rbx) - vpaddd %ymm13,%ymm5,%ymm5 - - vpsrld $11,%ymm10,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm10,%ymm2 - vpaddd -64(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm10,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm10,%ymm2 - vpandn %ymm12,%ymm10,%ymm0 - vpand %ymm11,%ymm10,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm14,%ymm13 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm14,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm14,%ymm15,%ymm3 - - vpxor %ymm1,%ymm13,%ymm13 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm14,%ymm1 - - vpslld $19,%ymm14,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm13,%ymm7 - - vpsrld $22,%ymm14,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm14,%ymm2 - vpxor %ymm4,%ymm15,%ymm13 - vpaddd %ymm5,%ymm9,%ymm9 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm13,%ymm13 - vpaddd %ymm7,%ymm13,%ymm13 - vmovdqu 384-256-128(%rbx),%ymm5 - vpaddd 128-128(%rax),%ymm6,%ymm6 - - vpsrld $3,%ymm5,%ymm7 - vpsrld $7,%ymm5,%ymm1 - vpslld $25,%ymm5,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm5,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm5,%ymm2 - vmovdqu 288-256-128(%rbx),%ymm0 - vpsrld $10,%ymm0,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm6,%ymm6 - vpxor %ymm1,%ymm4,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm6,%ymm6 - vpsrld $6,%ymm9,%ymm7 - vpslld $26,%ymm9,%ymm2 - vmovdqu %ymm6,352-256-128(%rbx) - vpaddd %ymm12,%ymm6,%ymm6 - - vpsrld $11,%ymm9,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm9,%ymm2 - vpaddd -32(%rbp),%ymm6,%ymm6 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm9,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm9,%ymm2 - vpandn %ymm11,%ymm9,%ymm0 - vpand %ymm10,%ymm9,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm13,%ymm12 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm13,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm13,%ymm14,%ymm4 - - vpxor %ymm1,%ymm12,%ymm12 - vpaddd %ymm7,%ymm6,%ymm6 - - vpsrld $13,%ymm13,%ymm1 - - vpslld $19,%ymm13,%ymm2 - vpaddd %ymm0,%ymm6,%ymm6 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm12,%ymm7 - - vpsrld $22,%ymm13,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm13,%ymm2 - vpxor %ymm3,%ymm14,%ymm12 - vpaddd %ymm6,%ymm8,%ymm8 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm6,%ymm12,%ymm12 - vpaddd %ymm7,%ymm12,%ymm12 - vmovdqu 416-256-128(%rbx),%ymm6 - vpaddd 160-128(%rax),%ymm5,%ymm5 - - vpsrld $3,%ymm6,%ymm7 - vpsrld $7,%ymm6,%ymm1 - vpslld $25,%ymm6,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm6,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm6,%ymm2 - vmovdqu 320-256-128(%rbx),%ymm0 - vpsrld $10,%ymm0,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm5,%ymm5 - vpxor %ymm1,%ymm3,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm5,%ymm5 - vpsrld $6,%ymm8,%ymm7 - vpslld $26,%ymm8,%ymm2 - vmovdqu %ymm5,384-256-128(%rbx) - vpaddd %ymm11,%ymm5,%ymm5 - - vpsrld $11,%ymm8,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm8,%ymm2 - vpaddd 0(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm8,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm8,%ymm2 - vpandn %ymm10,%ymm8,%ymm0 - vpand %ymm9,%ymm8,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm12,%ymm11 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm12,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm12,%ymm13,%ymm3 - - vpxor %ymm1,%ymm11,%ymm11 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm12,%ymm1 - - vpslld $19,%ymm12,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm11,%ymm7 - - vpsrld $22,%ymm12,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm12,%ymm2 - vpxor %ymm4,%ymm13,%ymm11 - vpaddd %ymm5,%ymm15,%ymm15 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm11,%ymm11 - vpaddd %ymm7,%ymm11,%ymm11 - vmovdqu 448-256-128(%rbx),%ymm5 - vpaddd 192-128(%rax),%ymm6,%ymm6 - - vpsrld $3,%ymm5,%ymm7 - vpsrld $7,%ymm5,%ymm1 - vpslld $25,%ymm5,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm5,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm5,%ymm2 - vmovdqu 352-256-128(%rbx),%ymm0 - vpsrld $10,%ymm0,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm6,%ymm6 - vpxor %ymm1,%ymm4,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm6,%ymm6 - vpsrld $6,%ymm15,%ymm7 - vpslld $26,%ymm15,%ymm2 - vmovdqu %ymm6,416-256-128(%rbx) - vpaddd %ymm10,%ymm6,%ymm6 - - vpsrld $11,%ymm15,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm15,%ymm2 - vpaddd 32(%rbp),%ymm6,%ymm6 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm15,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm15,%ymm2 - vpandn %ymm9,%ymm15,%ymm0 - vpand %ymm8,%ymm15,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm11,%ymm10 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm11,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm11,%ymm12,%ymm4 - - vpxor %ymm1,%ymm10,%ymm10 - vpaddd %ymm7,%ymm6,%ymm6 - - vpsrld $13,%ymm11,%ymm1 - - vpslld $19,%ymm11,%ymm2 - vpaddd %ymm0,%ymm6,%ymm6 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm10,%ymm7 - - vpsrld $22,%ymm11,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm11,%ymm2 - vpxor %ymm3,%ymm12,%ymm10 - vpaddd %ymm6,%ymm14,%ymm14 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm6,%ymm10,%ymm10 - vpaddd %ymm7,%ymm10,%ymm10 - vmovdqu 480-256-128(%rbx),%ymm6 - vpaddd 224-128(%rax),%ymm5,%ymm5 - - vpsrld $3,%ymm6,%ymm7 - vpsrld $7,%ymm6,%ymm1 - vpslld $25,%ymm6,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm6,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm6,%ymm2 - vmovdqu 384-256-128(%rbx),%ymm0 - vpsrld $10,%ymm0,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm5,%ymm5 - vpxor %ymm1,%ymm3,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm5,%ymm5 - vpsrld $6,%ymm14,%ymm7 - vpslld $26,%ymm14,%ymm2 - vmovdqu %ymm5,448-256-128(%rbx) - vpaddd %ymm9,%ymm5,%ymm5 - - vpsrld $11,%ymm14,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm14,%ymm2 - vpaddd 64(%rbp),%ymm5,%ymm5 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm14,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm14,%ymm2 - vpandn %ymm8,%ymm14,%ymm0 - vpand %ymm15,%ymm14,%ymm3 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm10,%ymm9 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm10,%ymm1 - vpxor %ymm3,%ymm0,%ymm0 - vpxor %ymm10,%ymm11,%ymm3 - - vpxor %ymm1,%ymm9,%ymm9 - vpaddd %ymm7,%ymm5,%ymm5 - - vpsrld $13,%ymm10,%ymm1 - - vpslld $19,%ymm10,%ymm2 - vpaddd %ymm0,%ymm5,%ymm5 - vpand %ymm3,%ymm4,%ymm4 - - vpxor %ymm1,%ymm9,%ymm7 - - vpsrld $22,%ymm10,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm10,%ymm2 - vpxor %ymm4,%ymm11,%ymm9 - vpaddd %ymm5,%ymm13,%ymm13 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm5,%ymm9,%ymm9 - vpaddd %ymm7,%ymm9,%ymm9 - vmovdqu 0-128(%rax),%ymm5 - vpaddd 256-256-128(%rbx),%ymm6,%ymm6 - - vpsrld $3,%ymm5,%ymm7 - vpsrld $7,%ymm5,%ymm1 - vpslld $25,%ymm5,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $18,%ymm5,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $14,%ymm5,%ymm2 - vmovdqu 416-256-128(%rbx),%ymm0 - vpsrld $10,%ymm0,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - vpsrld $17,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $15,%ymm0,%ymm2 - vpaddd %ymm7,%ymm6,%ymm6 - vpxor %ymm1,%ymm4,%ymm7 - vpsrld $19,%ymm0,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $13,%ymm0,%ymm2 - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - vpaddd %ymm7,%ymm6,%ymm6 - vpsrld $6,%ymm13,%ymm7 - vpslld $26,%ymm13,%ymm2 - vmovdqu %ymm6,480-256-128(%rbx) - vpaddd %ymm8,%ymm6,%ymm6 - - vpsrld $11,%ymm13,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - vpslld $21,%ymm13,%ymm2 - vpaddd 96(%rbp),%ymm6,%ymm6 - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $25,%ymm13,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $7,%ymm13,%ymm2 - vpandn %ymm15,%ymm13,%ymm0 - vpand %ymm14,%ymm13,%ymm4 - - vpxor %ymm1,%ymm7,%ymm7 - - vpsrld $2,%ymm9,%ymm8 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $30,%ymm9,%ymm1 - vpxor %ymm4,%ymm0,%ymm0 - vpxor %ymm9,%ymm10,%ymm4 - - vpxor %ymm1,%ymm8,%ymm8 - vpaddd %ymm7,%ymm6,%ymm6 - - vpsrld $13,%ymm9,%ymm1 - - vpslld $19,%ymm9,%ymm2 - vpaddd %ymm0,%ymm6,%ymm6 - vpand %ymm4,%ymm3,%ymm3 - - vpxor %ymm1,%ymm8,%ymm7 - - vpsrld $22,%ymm9,%ymm1 - vpxor %ymm2,%ymm7,%ymm7 - - vpslld $10,%ymm9,%ymm2 - vpxor %ymm3,%ymm10,%ymm8 - vpaddd %ymm6,%ymm12,%ymm12 - - vpxor %ymm1,%ymm7,%ymm7 - vpxor %ymm2,%ymm7,%ymm7 - - vpaddd %ymm6,%ymm8,%ymm8 - vpaddd %ymm7,%ymm8,%ymm8 - addq $256,%rbp - decl %ecx - jnz L$oop_16_xx_avx2 - - movl $1,%ecx - leaq 512(%rsp),%rbx - leaq K256+128(%rip),%rbp - cmpl 0(%rbx),%ecx - cmovgeq %rbp,%r12 - cmpl 4(%rbx),%ecx - cmovgeq %rbp,%r13 - cmpl 8(%rbx),%ecx - cmovgeq %rbp,%r14 - cmpl 12(%rbx),%ecx - cmovgeq %rbp,%r15 - cmpl 16(%rbx),%ecx - cmovgeq %rbp,%r8 - cmpl 20(%rbx),%ecx - cmovgeq %rbp,%r9 - cmpl 24(%rbx),%ecx - cmovgeq %rbp,%r10 - cmpl 28(%rbx),%ecx - cmovgeq %rbp,%r11 - vmovdqa (%rbx),%ymm7 - vpxor %ymm0,%ymm0,%ymm0 - vmovdqa %ymm7,%ymm6 - vpcmpgtd %ymm0,%ymm6,%ymm6 - vpaddd %ymm6,%ymm7,%ymm7 - - vmovdqu 0-128(%rdi),%ymm0 - vpand %ymm6,%ymm8,%ymm8 - vmovdqu 32-128(%rdi),%ymm1 - vpand %ymm6,%ymm9,%ymm9 - vmovdqu 64-128(%rdi),%ymm2 - vpand %ymm6,%ymm10,%ymm10 - vmovdqu 96-128(%rdi),%ymm5 - vpand %ymm6,%ymm11,%ymm11 - vpaddd %ymm0,%ymm8,%ymm8 - vmovdqu 128-128(%rdi),%ymm0 - vpand %ymm6,%ymm12,%ymm12 - vpaddd %ymm1,%ymm9,%ymm9 - vmovdqu 160-128(%rdi),%ymm1 - vpand %ymm6,%ymm13,%ymm13 - vpaddd %ymm2,%ymm10,%ymm10 - vmovdqu 192-128(%rdi),%ymm2 - vpand %ymm6,%ymm14,%ymm14 - vpaddd %ymm5,%ymm11,%ymm11 - vmovdqu 224-128(%rdi),%ymm5 - vpand %ymm6,%ymm15,%ymm15 - vpaddd %ymm0,%ymm12,%ymm12 - vpaddd %ymm1,%ymm13,%ymm13 - vmovdqu %ymm8,0-128(%rdi) - vpaddd %ymm2,%ymm14,%ymm14 - vmovdqu %ymm9,32-128(%rdi) - vpaddd %ymm5,%ymm15,%ymm15 - vmovdqu %ymm10,64-128(%rdi) - vmovdqu %ymm11,96-128(%rdi) - vmovdqu %ymm12,128-128(%rdi) - vmovdqu %ymm13,160-128(%rdi) - vmovdqu %ymm14,192-128(%rdi) - vmovdqu %ymm15,224-128(%rdi) - - vmovdqu %ymm7,(%rbx) - leaq 256+128(%rsp),%rbx - vmovdqu L$pbswap(%rip),%ymm6 - decl %edx - jnz L$oop_avx2 - - - - - - - -L$done_avx2: - movq 544(%rsp),%rax - vzeroupper - movq -48(%rax),%r15 - movq -40(%rax),%r14 - movq -32(%rax),%r13 - movq -24(%rax),%r12 - movq -16(%rax),%rbp - movq -8(%rax),%rbx - leaq (%rax),%rsp -L$epilogue_avx2: - .byte 0xf3,0xc3 - .p2align 8 K256: .long 1116352408,1116352408,1116352408,1116352408 diff --git a/deps/openssl/asm/x64-macosx-gas/sha/sha256-x86_64.s b/deps/openssl/asm/x64-macosx-gas/sha/sha256-x86_64.s index b66bd34406cc74..5566d587610ea7 100644 --- a/deps/openssl/asm/x64-macosx-gas/sha/sha256-x86_64.s +++ b/deps/openssl/asm/x64-macosx-gas/sha/sha256-x86_64.s @@ -11,14 +11,6 @@ _sha256_block_data_order: movl 8(%r11),%r11d testl $536870912,%r11d jnz _shaext_shortcut - andl $296,%r11d - cmpl $296,%r11d - je L$avx2_shortcut - andl $1073741824,%r9d - andl $268435968,%r10d - orl %r9d,%r10d - cmpl $1342177792,%r10d - je L$avx_shortcut testl $512,%r10d jnz L$ssse3_shortcut pushq %rbx @@ -1762,9 +1754,9 @@ _shaext_shortcut: movdqu 16(%rdi),%xmm2 movdqa 512-128(%rcx),%xmm7 - pshufd $27,%xmm1,%xmm0 - pshufd $177,%xmm1,%xmm1 - pshufd $27,%xmm2,%xmm2 + pshufd $0x1b,%xmm1,%xmm0 + pshufd $0xb1,%xmm1,%xmm1 + pshufd $0x1b,%xmm2,%xmm2 movdqa %xmm7,%xmm8 .byte 102,15,58,15,202,8 punpcklqdq %xmm0,%xmm2 @@ -1783,7 +1775,7 @@ L$oop_shaext: .byte 102,15,56,0,231 movdqa %xmm2,%xmm10 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 nop movdqa %xmm1,%xmm9 .byte 15,56,203,202 @@ -1792,7 +1784,7 @@ L$oop_shaext: paddd %xmm4,%xmm0 .byte 102,15,56,0,239 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 leaq 64(%rsi),%rsi .byte 15,56,204,220 .byte 15,56,203,202 @@ -1801,7 +1793,7 @@ L$oop_shaext: paddd %xmm5,%xmm0 .byte 102,15,56,0,247 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm6,%xmm7 .byte 102,15,58,15,253,4 nop @@ -1813,7 +1805,7 @@ L$oop_shaext: paddd %xmm6,%xmm0 .byte 15,56,205,222 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm3,%xmm7 .byte 102,15,58,15,254,4 nop @@ -1824,7 +1816,7 @@ L$oop_shaext: paddd %xmm3,%xmm0 .byte 15,56,205,227 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm4,%xmm7 .byte 102,15,58,15,251,4 nop @@ -1835,7 +1827,7 @@ L$oop_shaext: paddd %xmm4,%xmm0 .byte 15,56,205,236 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm5,%xmm7 .byte 102,15,58,15,252,4 nop @@ -1846,7 +1838,7 @@ L$oop_shaext: paddd %xmm5,%xmm0 .byte 15,56,205,245 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm6,%xmm7 .byte 102,15,58,15,253,4 nop @@ -1857,7 +1849,7 @@ L$oop_shaext: paddd %xmm6,%xmm0 .byte 15,56,205,222 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm3,%xmm7 .byte 102,15,58,15,254,4 nop @@ -1868,7 +1860,7 @@ L$oop_shaext: paddd %xmm3,%xmm0 .byte 15,56,205,227 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm4,%xmm7 .byte 102,15,58,15,251,4 nop @@ -1879,7 +1871,7 @@ L$oop_shaext: paddd %xmm4,%xmm0 .byte 15,56,205,236 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm5,%xmm7 .byte 102,15,58,15,252,4 nop @@ -1890,7 +1882,7 @@ L$oop_shaext: paddd %xmm5,%xmm0 .byte 15,56,205,245 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm6,%xmm7 .byte 102,15,58,15,253,4 nop @@ -1901,7 +1893,7 @@ L$oop_shaext: paddd %xmm6,%xmm0 .byte 15,56,205,222 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm3,%xmm7 .byte 102,15,58,15,254,4 nop @@ -1912,7 +1904,7 @@ L$oop_shaext: paddd %xmm3,%xmm0 .byte 15,56,205,227 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm4,%xmm7 .byte 102,15,58,15,251,4 nop @@ -1923,7 +1915,7 @@ L$oop_shaext: paddd %xmm4,%xmm0 .byte 15,56,205,236 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm5,%xmm7 .byte 102,15,58,15,252,4 .byte 15,56,203,202 @@ -1932,7 +1924,7 @@ L$oop_shaext: movdqa 448-128(%rcx),%xmm0 paddd %xmm5,%xmm0 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 .byte 15,56,205,245 movdqa %xmm8,%xmm7 .byte 15,56,203,202 @@ -1941,7 +1933,7 @@ L$oop_shaext: paddd %xmm6,%xmm0 nop .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 decq %rdx nop .byte 15,56,203,202 @@ -1950,9 +1942,9 @@ L$oop_shaext: paddd %xmm9,%xmm1 jnz L$oop_shaext - pshufd $177,%xmm2,%xmm2 - pshufd $27,%xmm1,%xmm7 - pshufd $177,%xmm1,%xmm1 + pshufd $0xb1,%xmm2,%xmm2 + pshufd $0x1b,%xmm1,%xmm7 + pshufd $0xb1,%xmm1,%xmm1 punpckhqdq %xmm2,%xmm1 .byte 102,15,58,15,215,8 @@ -3054,2304 +3046,3 @@ L$ssse3_00_47: leaq 48(%rsi),%rsp L$epilogue_ssse3: .byte 0xf3,0xc3 - - -.p2align 6 -sha256_block_data_order_avx: -L$avx_shortcut: - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - movq %rsp,%r11 - shlq $4,%rdx - subq $96,%rsp - leaq (%rsi,%rdx,4),%rdx - andq $-64,%rsp - movq %rdi,64+0(%rsp) - movq %rsi,64+8(%rsp) - movq %rdx,64+16(%rsp) - movq %r11,64+24(%rsp) -L$prologue_avx: - - vzeroupper - movl 0(%rdi),%eax - movl 4(%rdi),%ebx - movl 8(%rdi),%ecx - movl 12(%rdi),%edx - movl 16(%rdi),%r8d - movl 20(%rdi),%r9d - movl 24(%rdi),%r10d - movl 28(%rdi),%r11d - vmovdqa K256+512+32(%rip),%xmm8 - vmovdqa K256+512+64(%rip),%xmm9 - jmp L$loop_avx -.p2align 4 -L$loop_avx: - vmovdqa K256+512(%rip),%xmm7 - vmovdqu 0(%rsi),%xmm0 - vmovdqu 16(%rsi),%xmm1 - vmovdqu 32(%rsi),%xmm2 - vmovdqu 48(%rsi),%xmm3 - vpshufb %xmm7,%xmm0,%xmm0 - leaq K256(%rip),%rbp - vpshufb %xmm7,%xmm1,%xmm1 - vpshufb %xmm7,%xmm2,%xmm2 - vpaddd 0(%rbp),%xmm0,%xmm4 - vpshufb %xmm7,%xmm3,%xmm3 - vpaddd 32(%rbp),%xmm1,%xmm5 - vpaddd 64(%rbp),%xmm2,%xmm6 - vpaddd 96(%rbp),%xmm3,%xmm7 - vmovdqa %xmm4,0(%rsp) - movl %eax,%r14d - vmovdqa %xmm5,16(%rsp) - movl %ebx,%edi - vmovdqa %xmm6,32(%rsp) - xorl %ecx,%edi - vmovdqa %xmm7,48(%rsp) - movl %r8d,%r13d - jmp L$avx_00_47 - -.p2align 4 -L$avx_00_47: - subq $-128,%rbp - vpalignr $4,%xmm0,%xmm1,%xmm4 - shrdl $14,%r13d,%r13d - movl %r14d,%eax - movl %r9d,%r12d - vpalignr $4,%xmm2,%xmm3,%xmm7 - shrdl $9,%r14d,%r14d - xorl %r8d,%r13d - xorl %r10d,%r12d - vpsrld $7,%xmm4,%xmm6 - shrdl $5,%r13d,%r13d - xorl %eax,%r14d - andl %r8d,%r12d - vpaddd %xmm7,%xmm0,%xmm0 - xorl %r8d,%r13d - addl 0(%rsp),%r11d - movl %eax,%r15d - vpsrld $3,%xmm4,%xmm7 - xorl %r10d,%r12d - shrdl $11,%r14d,%r14d - xorl %ebx,%r15d - vpslld $14,%xmm4,%xmm5 - addl %r12d,%r11d - shrdl $6,%r13d,%r13d - andl %r15d,%edi - vpxor %xmm6,%xmm7,%xmm4 - xorl %eax,%r14d - addl %r13d,%r11d - xorl %ebx,%edi - vpshufd $250,%xmm3,%xmm7 - shrdl $2,%r14d,%r14d - addl %r11d,%edx - addl %edi,%r11d - vpsrld $11,%xmm6,%xmm6 - movl %edx,%r13d - addl %r11d,%r14d - shrdl $14,%r13d,%r13d - vpxor %xmm5,%xmm4,%xmm4 - movl %r14d,%r11d - movl %r8d,%r12d - shrdl $9,%r14d,%r14d - vpslld $11,%xmm5,%xmm5 - xorl %edx,%r13d - xorl %r9d,%r12d - shrdl $5,%r13d,%r13d - vpxor %xmm6,%xmm4,%xmm4 - xorl %r11d,%r14d - andl %edx,%r12d - xorl %edx,%r13d - vpsrld $10,%xmm7,%xmm6 - addl 4(%rsp),%r10d - movl %r11d,%edi - xorl %r9d,%r12d - vpxor %xmm5,%xmm4,%xmm4 - shrdl $11,%r14d,%r14d - xorl %eax,%edi - addl %r12d,%r10d - vpsrlq $17,%xmm7,%xmm7 - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %r11d,%r14d - vpaddd %xmm4,%xmm0,%xmm0 - addl %r13d,%r10d - xorl %eax,%r15d - shrdl $2,%r14d,%r14d - vpxor %xmm7,%xmm6,%xmm6 - addl %r10d,%ecx - addl %r15d,%r10d - movl %ecx,%r13d - vpsrlq $2,%xmm7,%xmm7 - addl %r10d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r10d - vpxor %xmm7,%xmm6,%xmm6 - movl %edx,%r12d - shrdl $9,%r14d,%r14d - xorl %ecx,%r13d - vpshufb %xmm8,%xmm6,%xmm6 - xorl %r8d,%r12d - shrdl $5,%r13d,%r13d - xorl %r10d,%r14d - vpaddd %xmm6,%xmm0,%xmm0 - andl %ecx,%r12d - xorl %ecx,%r13d - addl 8(%rsp),%r9d - vpshufd $80,%xmm0,%xmm7 - movl %r10d,%r15d - xorl %r8d,%r12d - shrdl $11,%r14d,%r14d - vpsrld $10,%xmm7,%xmm6 - xorl %r11d,%r15d - addl %r12d,%r9d - shrdl $6,%r13d,%r13d - vpsrlq $17,%xmm7,%xmm7 - andl %r15d,%edi - xorl %r10d,%r14d - addl %r13d,%r9d - vpxor %xmm7,%xmm6,%xmm6 - xorl %r11d,%edi - shrdl $2,%r14d,%r14d - addl %r9d,%ebx - vpsrlq $2,%xmm7,%xmm7 - addl %edi,%r9d - movl %ebx,%r13d - addl %r9d,%r14d - vpxor %xmm7,%xmm6,%xmm6 - shrdl $14,%r13d,%r13d - movl %r14d,%r9d - movl %ecx,%r12d - vpshufb %xmm9,%xmm6,%xmm6 - shrdl $9,%r14d,%r14d - xorl %ebx,%r13d - xorl %edx,%r12d - vpaddd %xmm6,%xmm0,%xmm0 - shrdl $5,%r13d,%r13d - xorl %r9d,%r14d - andl %ebx,%r12d - vpaddd 0(%rbp),%xmm0,%xmm6 - xorl %ebx,%r13d - addl 12(%rsp),%r8d - movl %r9d,%edi - xorl %edx,%r12d - shrdl $11,%r14d,%r14d - xorl %r10d,%edi - addl %r12d,%r8d - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %r9d,%r14d - addl %r13d,%r8d - xorl %r10d,%r15d - shrdl $2,%r14d,%r14d - addl %r8d,%eax - addl %r15d,%r8d - movl %eax,%r13d - addl %r8d,%r14d - vmovdqa %xmm6,0(%rsp) - vpalignr $4,%xmm1,%xmm2,%xmm4 - shrdl $14,%r13d,%r13d - movl %r14d,%r8d - movl %ebx,%r12d - vpalignr $4,%xmm3,%xmm0,%xmm7 - shrdl $9,%r14d,%r14d - xorl %eax,%r13d - xorl %ecx,%r12d - vpsrld $7,%xmm4,%xmm6 - shrdl $5,%r13d,%r13d - xorl %r8d,%r14d - andl %eax,%r12d - vpaddd %xmm7,%xmm1,%xmm1 - xorl %eax,%r13d - addl 16(%rsp),%edx - movl %r8d,%r15d - vpsrld $3,%xmm4,%xmm7 - xorl %ecx,%r12d - shrdl $11,%r14d,%r14d - xorl %r9d,%r15d - vpslld $14,%xmm4,%xmm5 - addl %r12d,%edx - shrdl $6,%r13d,%r13d - andl %r15d,%edi - vpxor %xmm6,%xmm7,%xmm4 - xorl %r8d,%r14d - addl %r13d,%edx - xorl %r9d,%edi - vpshufd $250,%xmm0,%xmm7 - shrdl $2,%r14d,%r14d - addl %edx,%r11d - addl %edi,%edx - vpsrld $11,%xmm6,%xmm6 - movl %r11d,%r13d - addl %edx,%r14d - shrdl $14,%r13d,%r13d - vpxor %xmm5,%xmm4,%xmm4 - movl %r14d,%edx - movl %eax,%r12d - shrdl $9,%r14d,%r14d - vpslld $11,%xmm5,%xmm5 - xorl %r11d,%r13d - xorl %ebx,%r12d - shrdl $5,%r13d,%r13d - vpxor %xmm6,%xmm4,%xmm4 - xorl %edx,%r14d - andl %r11d,%r12d - xorl %r11d,%r13d - vpsrld $10,%xmm7,%xmm6 - addl 20(%rsp),%ecx - movl %edx,%edi - xorl %ebx,%r12d - vpxor %xmm5,%xmm4,%xmm4 - shrdl $11,%r14d,%r14d - xorl %r8d,%edi - addl %r12d,%ecx - vpsrlq $17,%xmm7,%xmm7 - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %edx,%r14d - vpaddd %xmm4,%xmm1,%xmm1 - addl %r13d,%ecx - xorl %r8d,%r15d - shrdl $2,%r14d,%r14d - vpxor %xmm7,%xmm6,%xmm6 - addl %ecx,%r10d - addl %r15d,%ecx - movl %r10d,%r13d - vpsrlq $2,%xmm7,%xmm7 - addl %ecx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%ecx - vpxor %xmm7,%xmm6,%xmm6 - movl %r11d,%r12d - shrdl $9,%r14d,%r14d - xorl %r10d,%r13d - vpshufb %xmm8,%xmm6,%xmm6 - xorl %eax,%r12d - shrdl $5,%r13d,%r13d - xorl %ecx,%r14d - vpaddd %xmm6,%xmm1,%xmm1 - andl %r10d,%r12d - xorl %r10d,%r13d - addl 24(%rsp),%ebx - vpshufd $80,%xmm1,%xmm7 - movl %ecx,%r15d - xorl %eax,%r12d - shrdl $11,%r14d,%r14d - vpsrld $10,%xmm7,%xmm6 - xorl %edx,%r15d - addl %r12d,%ebx - shrdl $6,%r13d,%r13d - vpsrlq $17,%xmm7,%xmm7 - andl %r15d,%edi - xorl %ecx,%r14d - addl %r13d,%ebx - vpxor %xmm7,%xmm6,%xmm6 - xorl %edx,%edi - shrdl $2,%r14d,%r14d - addl %ebx,%r9d - vpsrlq $2,%xmm7,%xmm7 - addl %edi,%ebx - movl %r9d,%r13d - addl %ebx,%r14d - vpxor %xmm7,%xmm6,%xmm6 - shrdl $14,%r13d,%r13d - movl %r14d,%ebx - movl %r10d,%r12d - vpshufb %xmm9,%xmm6,%xmm6 - shrdl $9,%r14d,%r14d - xorl %r9d,%r13d - xorl %r11d,%r12d - vpaddd %xmm6,%xmm1,%xmm1 - shrdl $5,%r13d,%r13d - xorl %ebx,%r14d - andl %r9d,%r12d - vpaddd 32(%rbp),%xmm1,%xmm6 - xorl %r9d,%r13d - addl 28(%rsp),%eax - movl %ebx,%edi - xorl %r11d,%r12d - shrdl $11,%r14d,%r14d - xorl %ecx,%edi - addl %r12d,%eax - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %ebx,%r14d - addl %r13d,%eax - xorl %ecx,%r15d - shrdl $2,%r14d,%r14d - addl %eax,%r8d - addl %r15d,%eax - movl %r8d,%r13d - addl %eax,%r14d - vmovdqa %xmm6,16(%rsp) - vpalignr $4,%xmm2,%xmm3,%xmm4 - shrdl $14,%r13d,%r13d - movl %r14d,%eax - movl %r9d,%r12d - vpalignr $4,%xmm0,%xmm1,%xmm7 - shrdl $9,%r14d,%r14d - xorl %r8d,%r13d - xorl %r10d,%r12d - vpsrld $7,%xmm4,%xmm6 - shrdl $5,%r13d,%r13d - xorl %eax,%r14d - andl %r8d,%r12d - vpaddd %xmm7,%xmm2,%xmm2 - xorl %r8d,%r13d - addl 32(%rsp),%r11d - movl %eax,%r15d - vpsrld $3,%xmm4,%xmm7 - xorl %r10d,%r12d - shrdl $11,%r14d,%r14d - xorl %ebx,%r15d - vpslld $14,%xmm4,%xmm5 - addl %r12d,%r11d - shrdl $6,%r13d,%r13d - andl %r15d,%edi - vpxor %xmm6,%xmm7,%xmm4 - xorl %eax,%r14d - addl %r13d,%r11d - xorl %ebx,%edi - vpshufd $250,%xmm1,%xmm7 - shrdl $2,%r14d,%r14d - addl %r11d,%edx - addl %edi,%r11d - vpsrld $11,%xmm6,%xmm6 - movl %edx,%r13d - addl %r11d,%r14d - shrdl $14,%r13d,%r13d - vpxor %xmm5,%xmm4,%xmm4 - movl %r14d,%r11d - movl %r8d,%r12d - shrdl $9,%r14d,%r14d - vpslld $11,%xmm5,%xmm5 - xorl %edx,%r13d - xorl %r9d,%r12d - shrdl $5,%r13d,%r13d - vpxor %xmm6,%xmm4,%xmm4 - xorl %r11d,%r14d - andl %edx,%r12d - xorl %edx,%r13d - vpsrld $10,%xmm7,%xmm6 - addl 36(%rsp),%r10d - movl %r11d,%edi - xorl %r9d,%r12d - vpxor %xmm5,%xmm4,%xmm4 - shrdl $11,%r14d,%r14d - xorl %eax,%edi - addl %r12d,%r10d - vpsrlq $17,%xmm7,%xmm7 - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %r11d,%r14d - vpaddd %xmm4,%xmm2,%xmm2 - addl %r13d,%r10d - xorl %eax,%r15d - shrdl $2,%r14d,%r14d - vpxor %xmm7,%xmm6,%xmm6 - addl %r10d,%ecx - addl %r15d,%r10d - movl %ecx,%r13d - vpsrlq $2,%xmm7,%xmm7 - addl %r10d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r10d - vpxor %xmm7,%xmm6,%xmm6 - movl %edx,%r12d - shrdl $9,%r14d,%r14d - xorl %ecx,%r13d - vpshufb %xmm8,%xmm6,%xmm6 - xorl %r8d,%r12d - shrdl $5,%r13d,%r13d - xorl %r10d,%r14d - vpaddd %xmm6,%xmm2,%xmm2 - andl %ecx,%r12d - xorl %ecx,%r13d - addl 40(%rsp),%r9d - vpshufd $80,%xmm2,%xmm7 - movl %r10d,%r15d - xorl %r8d,%r12d - shrdl $11,%r14d,%r14d - vpsrld $10,%xmm7,%xmm6 - xorl %r11d,%r15d - addl %r12d,%r9d - shrdl $6,%r13d,%r13d - vpsrlq $17,%xmm7,%xmm7 - andl %r15d,%edi - xorl %r10d,%r14d - addl %r13d,%r9d - vpxor %xmm7,%xmm6,%xmm6 - xorl %r11d,%edi - shrdl $2,%r14d,%r14d - addl %r9d,%ebx - vpsrlq $2,%xmm7,%xmm7 - addl %edi,%r9d - movl %ebx,%r13d - addl %r9d,%r14d - vpxor %xmm7,%xmm6,%xmm6 - shrdl $14,%r13d,%r13d - movl %r14d,%r9d - movl %ecx,%r12d - vpshufb %xmm9,%xmm6,%xmm6 - shrdl $9,%r14d,%r14d - xorl %ebx,%r13d - xorl %edx,%r12d - vpaddd %xmm6,%xmm2,%xmm2 - shrdl $5,%r13d,%r13d - xorl %r9d,%r14d - andl %ebx,%r12d - vpaddd 64(%rbp),%xmm2,%xmm6 - xorl %ebx,%r13d - addl 44(%rsp),%r8d - movl %r9d,%edi - xorl %edx,%r12d - shrdl $11,%r14d,%r14d - xorl %r10d,%edi - addl %r12d,%r8d - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %r9d,%r14d - addl %r13d,%r8d - xorl %r10d,%r15d - shrdl $2,%r14d,%r14d - addl %r8d,%eax - addl %r15d,%r8d - movl %eax,%r13d - addl %r8d,%r14d - vmovdqa %xmm6,32(%rsp) - vpalignr $4,%xmm3,%xmm0,%xmm4 - shrdl $14,%r13d,%r13d - movl %r14d,%r8d - movl %ebx,%r12d - vpalignr $4,%xmm1,%xmm2,%xmm7 - shrdl $9,%r14d,%r14d - xorl %eax,%r13d - xorl %ecx,%r12d - vpsrld $7,%xmm4,%xmm6 - shrdl $5,%r13d,%r13d - xorl %r8d,%r14d - andl %eax,%r12d - vpaddd %xmm7,%xmm3,%xmm3 - xorl %eax,%r13d - addl 48(%rsp),%edx - movl %r8d,%r15d - vpsrld $3,%xmm4,%xmm7 - xorl %ecx,%r12d - shrdl $11,%r14d,%r14d - xorl %r9d,%r15d - vpslld $14,%xmm4,%xmm5 - addl %r12d,%edx - shrdl $6,%r13d,%r13d - andl %r15d,%edi - vpxor %xmm6,%xmm7,%xmm4 - xorl %r8d,%r14d - addl %r13d,%edx - xorl %r9d,%edi - vpshufd $250,%xmm2,%xmm7 - shrdl $2,%r14d,%r14d - addl %edx,%r11d - addl %edi,%edx - vpsrld $11,%xmm6,%xmm6 - movl %r11d,%r13d - addl %edx,%r14d - shrdl $14,%r13d,%r13d - vpxor %xmm5,%xmm4,%xmm4 - movl %r14d,%edx - movl %eax,%r12d - shrdl $9,%r14d,%r14d - vpslld $11,%xmm5,%xmm5 - xorl %r11d,%r13d - xorl %ebx,%r12d - shrdl $5,%r13d,%r13d - vpxor %xmm6,%xmm4,%xmm4 - xorl %edx,%r14d - andl %r11d,%r12d - xorl %r11d,%r13d - vpsrld $10,%xmm7,%xmm6 - addl 52(%rsp),%ecx - movl %edx,%edi - xorl %ebx,%r12d - vpxor %xmm5,%xmm4,%xmm4 - shrdl $11,%r14d,%r14d - xorl %r8d,%edi - addl %r12d,%ecx - vpsrlq $17,%xmm7,%xmm7 - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %edx,%r14d - vpaddd %xmm4,%xmm3,%xmm3 - addl %r13d,%ecx - xorl %r8d,%r15d - shrdl $2,%r14d,%r14d - vpxor %xmm7,%xmm6,%xmm6 - addl %ecx,%r10d - addl %r15d,%ecx - movl %r10d,%r13d - vpsrlq $2,%xmm7,%xmm7 - addl %ecx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%ecx - vpxor %xmm7,%xmm6,%xmm6 - movl %r11d,%r12d - shrdl $9,%r14d,%r14d - xorl %r10d,%r13d - vpshufb %xmm8,%xmm6,%xmm6 - xorl %eax,%r12d - shrdl $5,%r13d,%r13d - xorl %ecx,%r14d - vpaddd %xmm6,%xmm3,%xmm3 - andl %r10d,%r12d - xorl %r10d,%r13d - addl 56(%rsp),%ebx - vpshufd $80,%xmm3,%xmm7 - movl %ecx,%r15d - xorl %eax,%r12d - shrdl $11,%r14d,%r14d - vpsrld $10,%xmm7,%xmm6 - xorl %edx,%r15d - addl %r12d,%ebx - shrdl $6,%r13d,%r13d - vpsrlq $17,%xmm7,%xmm7 - andl %r15d,%edi - xorl %ecx,%r14d - addl %r13d,%ebx - vpxor %xmm7,%xmm6,%xmm6 - xorl %edx,%edi - shrdl $2,%r14d,%r14d - addl %ebx,%r9d - vpsrlq $2,%xmm7,%xmm7 - addl %edi,%ebx - movl %r9d,%r13d - addl %ebx,%r14d - vpxor %xmm7,%xmm6,%xmm6 - shrdl $14,%r13d,%r13d - movl %r14d,%ebx - movl %r10d,%r12d - vpshufb %xmm9,%xmm6,%xmm6 - shrdl $9,%r14d,%r14d - xorl %r9d,%r13d - xorl %r11d,%r12d - vpaddd %xmm6,%xmm3,%xmm3 - shrdl $5,%r13d,%r13d - xorl %ebx,%r14d - andl %r9d,%r12d - vpaddd 96(%rbp),%xmm3,%xmm6 - xorl %r9d,%r13d - addl 60(%rsp),%eax - movl %ebx,%edi - xorl %r11d,%r12d - shrdl $11,%r14d,%r14d - xorl %ecx,%edi - addl %r12d,%eax - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %ebx,%r14d - addl %r13d,%eax - xorl %ecx,%r15d - shrdl $2,%r14d,%r14d - addl %eax,%r8d - addl %r15d,%eax - movl %r8d,%r13d - addl %eax,%r14d - vmovdqa %xmm6,48(%rsp) - cmpb $0,131(%rbp) - jne L$avx_00_47 - shrdl $14,%r13d,%r13d - movl %r14d,%eax - movl %r9d,%r12d - shrdl $9,%r14d,%r14d - xorl %r8d,%r13d - xorl %r10d,%r12d - shrdl $5,%r13d,%r13d - xorl %eax,%r14d - andl %r8d,%r12d - xorl %r8d,%r13d - addl 0(%rsp),%r11d - movl %eax,%r15d - xorl %r10d,%r12d - shrdl $11,%r14d,%r14d - xorl %ebx,%r15d - addl %r12d,%r11d - shrdl $6,%r13d,%r13d - andl %r15d,%edi - xorl %eax,%r14d - addl %r13d,%r11d - xorl %ebx,%edi - shrdl $2,%r14d,%r14d - addl %r11d,%edx - addl %edi,%r11d - movl %edx,%r13d - addl %r11d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r11d - movl %r8d,%r12d - shrdl $9,%r14d,%r14d - xorl %edx,%r13d - xorl %r9d,%r12d - shrdl $5,%r13d,%r13d - xorl %r11d,%r14d - andl %edx,%r12d - xorl %edx,%r13d - addl 4(%rsp),%r10d - movl %r11d,%edi - xorl %r9d,%r12d - shrdl $11,%r14d,%r14d - xorl %eax,%edi - addl %r12d,%r10d - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %r11d,%r14d - addl %r13d,%r10d - xorl %eax,%r15d - shrdl $2,%r14d,%r14d - addl %r10d,%ecx - addl %r15d,%r10d - movl %ecx,%r13d - addl %r10d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r10d - movl %edx,%r12d - shrdl $9,%r14d,%r14d - xorl %ecx,%r13d - xorl %r8d,%r12d - shrdl $5,%r13d,%r13d - xorl %r10d,%r14d - andl %ecx,%r12d - xorl %ecx,%r13d - addl 8(%rsp),%r9d - movl %r10d,%r15d - xorl %r8d,%r12d - shrdl $11,%r14d,%r14d - xorl %r11d,%r15d - addl %r12d,%r9d - shrdl $6,%r13d,%r13d - andl %r15d,%edi - xorl %r10d,%r14d - addl %r13d,%r9d - xorl %r11d,%edi - shrdl $2,%r14d,%r14d - addl %r9d,%ebx - addl %edi,%r9d - movl %ebx,%r13d - addl %r9d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r9d - movl %ecx,%r12d - shrdl $9,%r14d,%r14d - xorl %ebx,%r13d - xorl %edx,%r12d - shrdl $5,%r13d,%r13d - xorl %r9d,%r14d - andl %ebx,%r12d - xorl %ebx,%r13d - addl 12(%rsp),%r8d - movl %r9d,%edi - xorl %edx,%r12d - shrdl $11,%r14d,%r14d - xorl %r10d,%edi - addl %r12d,%r8d - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %r9d,%r14d - addl %r13d,%r8d - xorl %r10d,%r15d - shrdl $2,%r14d,%r14d - addl %r8d,%eax - addl %r15d,%r8d - movl %eax,%r13d - addl %r8d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r8d - movl %ebx,%r12d - shrdl $9,%r14d,%r14d - xorl %eax,%r13d - xorl %ecx,%r12d - shrdl $5,%r13d,%r13d - xorl %r8d,%r14d - andl %eax,%r12d - xorl %eax,%r13d - addl 16(%rsp),%edx - movl %r8d,%r15d - xorl %ecx,%r12d - shrdl $11,%r14d,%r14d - xorl %r9d,%r15d - addl %r12d,%edx - shrdl $6,%r13d,%r13d - andl %r15d,%edi - xorl %r8d,%r14d - addl %r13d,%edx - xorl %r9d,%edi - shrdl $2,%r14d,%r14d - addl %edx,%r11d - addl %edi,%edx - movl %r11d,%r13d - addl %edx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%edx - movl %eax,%r12d - shrdl $9,%r14d,%r14d - xorl %r11d,%r13d - xorl %ebx,%r12d - shrdl $5,%r13d,%r13d - xorl %edx,%r14d - andl %r11d,%r12d - xorl %r11d,%r13d - addl 20(%rsp),%ecx - movl %edx,%edi - xorl %ebx,%r12d - shrdl $11,%r14d,%r14d - xorl %r8d,%edi - addl %r12d,%ecx - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %edx,%r14d - addl %r13d,%ecx - xorl %r8d,%r15d - shrdl $2,%r14d,%r14d - addl %ecx,%r10d - addl %r15d,%ecx - movl %r10d,%r13d - addl %ecx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%ecx - movl %r11d,%r12d - shrdl $9,%r14d,%r14d - xorl %r10d,%r13d - xorl %eax,%r12d - shrdl $5,%r13d,%r13d - xorl %ecx,%r14d - andl %r10d,%r12d - xorl %r10d,%r13d - addl 24(%rsp),%ebx - movl %ecx,%r15d - xorl %eax,%r12d - shrdl $11,%r14d,%r14d - xorl %edx,%r15d - addl %r12d,%ebx - shrdl $6,%r13d,%r13d - andl %r15d,%edi - xorl %ecx,%r14d - addl %r13d,%ebx - xorl %edx,%edi - shrdl $2,%r14d,%r14d - addl %ebx,%r9d - addl %edi,%ebx - movl %r9d,%r13d - addl %ebx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%ebx - movl %r10d,%r12d - shrdl $9,%r14d,%r14d - xorl %r9d,%r13d - xorl %r11d,%r12d - shrdl $5,%r13d,%r13d - xorl %ebx,%r14d - andl %r9d,%r12d - xorl %r9d,%r13d - addl 28(%rsp),%eax - movl %ebx,%edi - xorl %r11d,%r12d - shrdl $11,%r14d,%r14d - xorl %ecx,%edi - addl %r12d,%eax - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %ebx,%r14d - addl %r13d,%eax - xorl %ecx,%r15d - shrdl $2,%r14d,%r14d - addl %eax,%r8d - addl %r15d,%eax - movl %r8d,%r13d - addl %eax,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%eax - movl %r9d,%r12d - shrdl $9,%r14d,%r14d - xorl %r8d,%r13d - xorl %r10d,%r12d - shrdl $5,%r13d,%r13d - xorl %eax,%r14d - andl %r8d,%r12d - xorl %r8d,%r13d - addl 32(%rsp),%r11d - movl %eax,%r15d - xorl %r10d,%r12d - shrdl $11,%r14d,%r14d - xorl %ebx,%r15d - addl %r12d,%r11d - shrdl $6,%r13d,%r13d - andl %r15d,%edi - xorl %eax,%r14d - addl %r13d,%r11d - xorl %ebx,%edi - shrdl $2,%r14d,%r14d - addl %r11d,%edx - addl %edi,%r11d - movl %edx,%r13d - addl %r11d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r11d - movl %r8d,%r12d - shrdl $9,%r14d,%r14d - xorl %edx,%r13d - xorl %r9d,%r12d - shrdl $5,%r13d,%r13d - xorl %r11d,%r14d - andl %edx,%r12d - xorl %edx,%r13d - addl 36(%rsp),%r10d - movl %r11d,%edi - xorl %r9d,%r12d - shrdl $11,%r14d,%r14d - xorl %eax,%edi - addl %r12d,%r10d - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %r11d,%r14d - addl %r13d,%r10d - xorl %eax,%r15d - shrdl $2,%r14d,%r14d - addl %r10d,%ecx - addl %r15d,%r10d - movl %ecx,%r13d - addl %r10d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r10d - movl %edx,%r12d - shrdl $9,%r14d,%r14d - xorl %ecx,%r13d - xorl %r8d,%r12d - shrdl $5,%r13d,%r13d - xorl %r10d,%r14d - andl %ecx,%r12d - xorl %ecx,%r13d - addl 40(%rsp),%r9d - movl %r10d,%r15d - xorl %r8d,%r12d - shrdl $11,%r14d,%r14d - xorl %r11d,%r15d - addl %r12d,%r9d - shrdl $6,%r13d,%r13d - andl %r15d,%edi - xorl %r10d,%r14d - addl %r13d,%r9d - xorl %r11d,%edi - shrdl $2,%r14d,%r14d - addl %r9d,%ebx - addl %edi,%r9d - movl %ebx,%r13d - addl %r9d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r9d - movl %ecx,%r12d - shrdl $9,%r14d,%r14d - xorl %ebx,%r13d - xorl %edx,%r12d - shrdl $5,%r13d,%r13d - xorl %r9d,%r14d - andl %ebx,%r12d - xorl %ebx,%r13d - addl 44(%rsp),%r8d - movl %r9d,%edi - xorl %edx,%r12d - shrdl $11,%r14d,%r14d - xorl %r10d,%edi - addl %r12d,%r8d - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %r9d,%r14d - addl %r13d,%r8d - xorl %r10d,%r15d - shrdl $2,%r14d,%r14d - addl %r8d,%eax - addl %r15d,%r8d - movl %eax,%r13d - addl %r8d,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%r8d - movl %ebx,%r12d - shrdl $9,%r14d,%r14d - xorl %eax,%r13d - xorl %ecx,%r12d - shrdl $5,%r13d,%r13d - xorl %r8d,%r14d - andl %eax,%r12d - xorl %eax,%r13d - addl 48(%rsp),%edx - movl %r8d,%r15d - xorl %ecx,%r12d - shrdl $11,%r14d,%r14d - xorl %r9d,%r15d - addl %r12d,%edx - shrdl $6,%r13d,%r13d - andl %r15d,%edi - xorl %r8d,%r14d - addl %r13d,%edx - xorl %r9d,%edi - shrdl $2,%r14d,%r14d - addl %edx,%r11d - addl %edi,%edx - movl %r11d,%r13d - addl %edx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%edx - movl %eax,%r12d - shrdl $9,%r14d,%r14d - xorl %r11d,%r13d - xorl %ebx,%r12d - shrdl $5,%r13d,%r13d - xorl %edx,%r14d - andl %r11d,%r12d - xorl %r11d,%r13d - addl 52(%rsp),%ecx - movl %edx,%edi - xorl %ebx,%r12d - shrdl $11,%r14d,%r14d - xorl %r8d,%edi - addl %r12d,%ecx - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %edx,%r14d - addl %r13d,%ecx - xorl %r8d,%r15d - shrdl $2,%r14d,%r14d - addl %ecx,%r10d - addl %r15d,%ecx - movl %r10d,%r13d - addl %ecx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%ecx - movl %r11d,%r12d - shrdl $9,%r14d,%r14d - xorl %r10d,%r13d - xorl %eax,%r12d - shrdl $5,%r13d,%r13d - xorl %ecx,%r14d - andl %r10d,%r12d - xorl %r10d,%r13d - addl 56(%rsp),%ebx - movl %ecx,%r15d - xorl %eax,%r12d - shrdl $11,%r14d,%r14d - xorl %edx,%r15d - addl %r12d,%ebx - shrdl $6,%r13d,%r13d - andl %r15d,%edi - xorl %ecx,%r14d - addl %r13d,%ebx - xorl %edx,%edi - shrdl $2,%r14d,%r14d - addl %ebx,%r9d - addl %edi,%ebx - movl %r9d,%r13d - addl %ebx,%r14d - shrdl $14,%r13d,%r13d - movl %r14d,%ebx - movl %r10d,%r12d - shrdl $9,%r14d,%r14d - xorl %r9d,%r13d - xorl %r11d,%r12d - shrdl $5,%r13d,%r13d - xorl %ebx,%r14d - andl %r9d,%r12d - xorl %r9d,%r13d - addl 60(%rsp),%eax - movl %ebx,%edi - xorl %r11d,%r12d - shrdl $11,%r14d,%r14d - xorl %ecx,%edi - addl %r12d,%eax - shrdl $6,%r13d,%r13d - andl %edi,%r15d - xorl %ebx,%r14d - addl %r13d,%eax - xorl %ecx,%r15d - shrdl $2,%r14d,%r14d - addl %eax,%r8d - addl %r15d,%eax - movl %r8d,%r13d - addl %eax,%r14d - movq 64+0(%rsp),%rdi - movl %r14d,%eax - - addl 0(%rdi),%eax - leaq 64(%rsi),%rsi - addl 4(%rdi),%ebx - addl 8(%rdi),%ecx - addl 12(%rdi),%edx - addl 16(%rdi),%r8d - addl 20(%rdi),%r9d - addl 24(%rdi),%r10d - addl 28(%rdi),%r11d - - cmpq 64+16(%rsp),%rsi - - movl %eax,0(%rdi) - movl %ebx,4(%rdi) - movl %ecx,8(%rdi) - movl %edx,12(%rdi) - movl %r8d,16(%rdi) - movl %r9d,20(%rdi) - movl %r10d,24(%rdi) - movl %r11d,28(%rdi) - jb L$loop_avx - - movq 64+24(%rsp),%rsi - vzeroupper - movq (%rsi),%r15 - movq 8(%rsi),%r14 - movq 16(%rsi),%r13 - movq 24(%rsi),%r12 - movq 32(%rsi),%rbp - movq 40(%rsi),%rbx - leaq 48(%rsi),%rsp -L$epilogue_avx: - .byte 0xf3,0xc3 - - -.p2align 6 -sha256_block_data_order_avx2: -L$avx2_shortcut: - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - movq %rsp,%r11 - subq $544,%rsp - shlq $4,%rdx - andq $-1024,%rsp - leaq (%rsi,%rdx,4),%rdx - addq $448,%rsp - movq %rdi,64+0(%rsp) - movq %rsi,64+8(%rsp) - movq %rdx,64+16(%rsp) - movq %r11,64+24(%rsp) -L$prologue_avx2: - - vzeroupper - subq $-64,%rsi - movl 0(%rdi),%eax - movq %rsi,%r12 - movl 4(%rdi),%ebx - cmpq %rdx,%rsi - movl 8(%rdi),%ecx - cmoveq %rsp,%r12 - movl 12(%rdi),%edx - movl 16(%rdi),%r8d - movl 20(%rdi),%r9d - movl 24(%rdi),%r10d - movl 28(%rdi),%r11d - vmovdqa K256+512+32(%rip),%ymm8 - vmovdqa K256+512+64(%rip),%ymm9 - jmp L$oop_avx2 -.p2align 4 -L$oop_avx2: - vmovdqa K256+512(%rip),%ymm7 - vmovdqu -64+0(%rsi),%xmm0 - vmovdqu -64+16(%rsi),%xmm1 - vmovdqu -64+32(%rsi),%xmm2 - vmovdqu -64+48(%rsi),%xmm3 - - vinserti128 $1,(%r12),%ymm0,%ymm0 - vinserti128 $1,16(%r12),%ymm1,%ymm1 - vpshufb %ymm7,%ymm0,%ymm0 - vinserti128 $1,32(%r12),%ymm2,%ymm2 - vpshufb %ymm7,%ymm1,%ymm1 - vinserti128 $1,48(%r12),%ymm3,%ymm3 - - leaq K256(%rip),%rbp - vpshufb %ymm7,%ymm2,%ymm2 - vpaddd 0(%rbp),%ymm0,%ymm4 - vpshufb %ymm7,%ymm3,%ymm3 - vpaddd 32(%rbp),%ymm1,%ymm5 - vpaddd 64(%rbp),%ymm2,%ymm6 - vpaddd 96(%rbp),%ymm3,%ymm7 - vmovdqa %ymm4,0(%rsp) - xorl %r14d,%r14d - vmovdqa %ymm5,32(%rsp) - leaq -64(%rsp),%rsp - movl %ebx,%edi - vmovdqa %ymm6,0(%rsp) - xorl %ecx,%edi - vmovdqa %ymm7,32(%rsp) - movl %r9d,%r12d - subq $-32*4,%rbp - jmp L$avx2_00_47 - -.p2align 4 -L$avx2_00_47: - leaq -64(%rsp),%rsp - vpalignr $4,%ymm0,%ymm1,%ymm4 - addl 0+128(%rsp),%r11d - andl %r8d,%r12d - rorxl $25,%r8d,%r13d - vpalignr $4,%ymm2,%ymm3,%ymm7 - rorxl $11,%r8d,%r15d - leal (%rax,%r14,1),%eax - leal (%r11,%r12,1),%r11d - vpsrld $7,%ymm4,%ymm6 - andnl %r10d,%r8d,%r12d - xorl %r15d,%r13d - rorxl $6,%r8d,%r14d - vpaddd %ymm7,%ymm0,%ymm0 - leal (%r11,%r12,1),%r11d - xorl %r14d,%r13d - movl %eax,%r15d - vpsrld $3,%ymm4,%ymm7 - rorxl $22,%eax,%r12d - leal (%r11,%r13,1),%r11d - xorl %ebx,%r15d - vpslld $14,%ymm4,%ymm5 - rorxl $13,%eax,%r14d - rorxl $2,%eax,%r13d - leal (%rdx,%r11,1),%edx - vpxor %ymm6,%ymm7,%ymm4 - andl %r15d,%edi - xorl %r12d,%r14d - xorl %ebx,%edi - vpshufd $250,%ymm3,%ymm7 - xorl %r13d,%r14d - leal (%r11,%rdi,1),%r11d - movl %r8d,%r12d - vpsrld $11,%ymm6,%ymm6 - addl 4+128(%rsp),%r10d - andl %edx,%r12d - rorxl $25,%edx,%r13d - vpxor %ymm5,%ymm4,%ymm4 - rorxl $11,%edx,%edi - leal (%r11,%r14,1),%r11d - leal (%r10,%r12,1),%r10d - vpslld $11,%ymm5,%ymm5 - andnl %r9d,%edx,%r12d - xorl %edi,%r13d - rorxl $6,%edx,%r14d - vpxor %ymm6,%ymm4,%ymm4 - leal (%r10,%r12,1),%r10d - xorl %r14d,%r13d - movl %r11d,%edi - vpsrld $10,%ymm7,%ymm6 - rorxl $22,%r11d,%r12d - leal (%r10,%r13,1),%r10d - xorl %eax,%edi - vpxor %ymm5,%ymm4,%ymm4 - rorxl $13,%r11d,%r14d - rorxl $2,%r11d,%r13d - leal (%rcx,%r10,1),%ecx - vpsrlq $17,%ymm7,%ymm7 - andl %edi,%r15d - xorl %r12d,%r14d - xorl %eax,%r15d - vpaddd %ymm4,%ymm0,%ymm0 - xorl %r13d,%r14d - leal (%r10,%r15,1),%r10d - movl %edx,%r12d - vpxor %ymm7,%ymm6,%ymm6 - addl 8+128(%rsp),%r9d - andl %ecx,%r12d - rorxl $25,%ecx,%r13d - vpsrlq $2,%ymm7,%ymm7 - rorxl $11,%ecx,%r15d - leal (%r10,%r14,1),%r10d - leal (%r9,%r12,1),%r9d - vpxor %ymm7,%ymm6,%ymm6 - andnl %r8d,%ecx,%r12d - xorl %r15d,%r13d - rorxl $6,%ecx,%r14d - vpshufb %ymm8,%ymm6,%ymm6 - leal (%r9,%r12,1),%r9d - xorl %r14d,%r13d - movl %r10d,%r15d - vpaddd %ymm6,%ymm0,%ymm0 - rorxl $22,%r10d,%r12d - leal (%r9,%r13,1),%r9d - xorl %r11d,%r15d - vpshufd $80,%ymm0,%ymm7 - rorxl $13,%r10d,%r14d - rorxl $2,%r10d,%r13d - leal (%rbx,%r9,1),%ebx - vpsrld $10,%ymm7,%ymm6 - andl %r15d,%edi - xorl %r12d,%r14d - xorl %r11d,%edi - vpsrlq $17,%ymm7,%ymm7 - xorl %r13d,%r14d - leal (%r9,%rdi,1),%r9d - movl %ecx,%r12d - vpxor %ymm7,%ymm6,%ymm6 - addl 12+128(%rsp),%r8d - andl %ebx,%r12d - rorxl $25,%ebx,%r13d - vpsrlq $2,%ymm7,%ymm7 - rorxl $11,%ebx,%edi - leal (%r9,%r14,1),%r9d - leal (%r8,%r12,1),%r8d - vpxor %ymm7,%ymm6,%ymm6 - andnl %edx,%ebx,%r12d - xorl %edi,%r13d - rorxl $6,%ebx,%r14d - vpshufb %ymm9,%ymm6,%ymm6 - leal (%r8,%r12,1),%r8d - xorl %r14d,%r13d - movl %r9d,%edi - vpaddd %ymm6,%ymm0,%ymm0 - rorxl $22,%r9d,%r12d - leal (%r8,%r13,1),%r8d - xorl %r10d,%edi - vpaddd 0(%rbp),%ymm0,%ymm6 - rorxl $13,%r9d,%r14d - rorxl $2,%r9d,%r13d - leal (%rax,%r8,1),%eax - andl %edi,%r15d - xorl %r12d,%r14d - xorl %r10d,%r15d - xorl %r13d,%r14d - leal (%r8,%r15,1),%r8d - movl %ebx,%r12d - vmovdqa %ymm6,0(%rsp) - vpalignr $4,%ymm1,%ymm2,%ymm4 - addl 32+128(%rsp),%edx - andl %eax,%r12d - rorxl $25,%eax,%r13d - vpalignr $4,%ymm3,%ymm0,%ymm7 - rorxl $11,%eax,%r15d - leal (%r8,%r14,1),%r8d - leal (%rdx,%r12,1),%edx - vpsrld $7,%ymm4,%ymm6 - andnl %ecx,%eax,%r12d - xorl %r15d,%r13d - rorxl $6,%eax,%r14d - vpaddd %ymm7,%ymm1,%ymm1 - leal (%rdx,%r12,1),%edx - xorl %r14d,%r13d - movl %r8d,%r15d - vpsrld $3,%ymm4,%ymm7 - rorxl $22,%r8d,%r12d - leal (%rdx,%r13,1),%edx - xorl %r9d,%r15d - vpslld $14,%ymm4,%ymm5 - rorxl $13,%r8d,%r14d - rorxl $2,%r8d,%r13d - leal (%r11,%rdx,1),%r11d - vpxor %ymm6,%ymm7,%ymm4 - andl %r15d,%edi - xorl %r12d,%r14d - xorl %r9d,%edi - vpshufd $250,%ymm0,%ymm7 - xorl %r13d,%r14d - leal (%rdx,%rdi,1),%edx - movl %eax,%r12d - vpsrld $11,%ymm6,%ymm6 - addl 36+128(%rsp),%ecx - andl %r11d,%r12d - rorxl $25,%r11d,%r13d - vpxor %ymm5,%ymm4,%ymm4 - rorxl $11,%r11d,%edi - leal (%rdx,%r14,1),%edx - leal (%rcx,%r12,1),%ecx - vpslld $11,%ymm5,%ymm5 - andnl %ebx,%r11d,%r12d - xorl %edi,%r13d - rorxl $6,%r11d,%r14d - vpxor %ymm6,%ymm4,%ymm4 - leal (%rcx,%r12,1),%ecx - xorl %r14d,%r13d - movl %edx,%edi - vpsrld $10,%ymm7,%ymm6 - rorxl $22,%edx,%r12d - leal (%rcx,%r13,1),%ecx - xorl %r8d,%edi - vpxor %ymm5,%ymm4,%ymm4 - rorxl $13,%edx,%r14d - rorxl $2,%edx,%r13d - leal (%r10,%rcx,1),%r10d - vpsrlq $17,%ymm7,%ymm7 - andl %edi,%r15d - xorl %r12d,%r14d - xorl %r8d,%r15d - vpaddd %ymm4,%ymm1,%ymm1 - xorl %r13d,%r14d - leal (%rcx,%r15,1),%ecx - movl %r11d,%r12d - vpxor %ymm7,%ymm6,%ymm6 - addl 40+128(%rsp),%ebx - andl %r10d,%r12d - rorxl $25,%r10d,%r13d - vpsrlq $2,%ymm7,%ymm7 - rorxl $11,%r10d,%r15d - leal (%rcx,%r14,1),%ecx - leal (%rbx,%r12,1),%ebx - vpxor %ymm7,%ymm6,%ymm6 - andnl %eax,%r10d,%r12d - xorl %r15d,%r13d - rorxl $6,%r10d,%r14d - vpshufb %ymm8,%ymm6,%ymm6 - leal (%rbx,%r12,1),%ebx - xorl %r14d,%r13d - movl %ecx,%r15d - vpaddd %ymm6,%ymm1,%ymm1 - rorxl $22,%ecx,%r12d - leal (%rbx,%r13,1),%ebx - xorl %edx,%r15d - vpshufd $80,%ymm1,%ymm7 - rorxl $13,%ecx,%r14d - rorxl $2,%ecx,%r13d - leal (%r9,%rbx,1),%r9d - vpsrld $10,%ymm7,%ymm6 - andl %r15d,%edi - xorl %r12d,%r14d - xorl %edx,%edi - vpsrlq $17,%ymm7,%ymm7 - xorl %r13d,%r14d - leal (%rbx,%rdi,1),%ebx - movl %r10d,%r12d - vpxor %ymm7,%ymm6,%ymm6 - addl 44+128(%rsp),%eax - andl %r9d,%r12d - rorxl $25,%r9d,%r13d - vpsrlq $2,%ymm7,%ymm7 - rorxl $11,%r9d,%edi - leal (%rbx,%r14,1),%ebx - leal (%rax,%r12,1),%eax - vpxor %ymm7,%ymm6,%ymm6 - andnl %r11d,%r9d,%r12d - xorl %edi,%r13d - rorxl $6,%r9d,%r14d - vpshufb %ymm9,%ymm6,%ymm6 - leal (%rax,%r12,1),%eax - xorl %r14d,%r13d - movl %ebx,%edi - vpaddd %ymm6,%ymm1,%ymm1 - rorxl $22,%ebx,%r12d - leal (%rax,%r13,1),%eax - xorl %ecx,%edi - vpaddd 32(%rbp),%ymm1,%ymm6 - rorxl $13,%ebx,%r14d - rorxl $2,%ebx,%r13d - leal (%r8,%rax,1),%r8d - andl %edi,%r15d - xorl %r12d,%r14d - xorl %ecx,%r15d - xorl %r13d,%r14d - leal (%rax,%r15,1),%eax - movl %r9d,%r12d - vmovdqa %ymm6,32(%rsp) - leaq -64(%rsp),%rsp - vpalignr $4,%ymm2,%ymm3,%ymm4 - addl 0+128(%rsp),%r11d - andl %r8d,%r12d - rorxl $25,%r8d,%r13d - vpalignr $4,%ymm0,%ymm1,%ymm7 - rorxl $11,%r8d,%r15d - leal (%rax,%r14,1),%eax - leal (%r11,%r12,1),%r11d - vpsrld $7,%ymm4,%ymm6 - andnl %r10d,%r8d,%r12d - xorl %r15d,%r13d - rorxl $6,%r8d,%r14d - vpaddd %ymm7,%ymm2,%ymm2 - leal (%r11,%r12,1),%r11d - xorl %r14d,%r13d - movl %eax,%r15d - vpsrld $3,%ymm4,%ymm7 - rorxl $22,%eax,%r12d - leal (%r11,%r13,1),%r11d - xorl %ebx,%r15d - vpslld $14,%ymm4,%ymm5 - rorxl $13,%eax,%r14d - rorxl $2,%eax,%r13d - leal (%rdx,%r11,1),%edx - vpxor %ymm6,%ymm7,%ymm4 - andl %r15d,%edi - xorl %r12d,%r14d - xorl %ebx,%edi - vpshufd $250,%ymm1,%ymm7 - xorl %r13d,%r14d - leal (%r11,%rdi,1),%r11d - movl %r8d,%r12d - vpsrld $11,%ymm6,%ymm6 - addl 4+128(%rsp),%r10d - andl %edx,%r12d - rorxl $25,%edx,%r13d - vpxor %ymm5,%ymm4,%ymm4 - rorxl $11,%edx,%edi - leal (%r11,%r14,1),%r11d - leal (%r10,%r12,1),%r10d - vpslld $11,%ymm5,%ymm5 - andnl %r9d,%edx,%r12d - xorl %edi,%r13d - rorxl $6,%edx,%r14d - vpxor %ymm6,%ymm4,%ymm4 - leal (%r10,%r12,1),%r10d - xorl %r14d,%r13d - movl %r11d,%edi - vpsrld $10,%ymm7,%ymm6 - rorxl $22,%r11d,%r12d - leal (%r10,%r13,1),%r10d - xorl %eax,%edi - vpxor %ymm5,%ymm4,%ymm4 - rorxl $13,%r11d,%r14d - rorxl $2,%r11d,%r13d - leal (%rcx,%r10,1),%ecx - vpsrlq $17,%ymm7,%ymm7 - andl %edi,%r15d - xorl %r12d,%r14d - xorl %eax,%r15d - vpaddd %ymm4,%ymm2,%ymm2 - xorl %r13d,%r14d - leal (%r10,%r15,1),%r10d - movl %edx,%r12d - vpxor %ymm7,%ymm6,%ymm6 - addl 8+128(%rsp),%r9d - andl %ecx,%r12d - rorxl $25,%ecx,%r13d - vpsrlq $2,%ymm7,%ymm7 - rorxl $11,%ecx,%r15d - leal (%r10,%r14,1),%r10d - leal (%r9,%r12,1),%r9d - vpxor %ymm7,%ymm6,%ymm6 - andnl %r8d,%ecx,%r12d - xorl %r15d,%r13d - rorxl $6,%ecx,%r14d - vpshufb %ymm8,%ymm6,%ymm6 - leal (%r9,%r12,1),%r9d - xorl %r14d,%r13d - movl %r10d,%r15d - vpaddd %ymm6,%ymm2,%ymm2 - rorxl $22,%r10d,%r12d - leal (%r9,%r13,1),%r9d - xorl %r11d,%r15d - vpshufd $80,%ymm2,%ymm7 - rorxl $13,%r10d,%r14d - rorxl $2,%r10d,%r13d - leal (%rbx,%r9,1),%ebx - vpsrld $10,%ymm7,%ymm6 - andl %r15d,%edi - xorl %r12d,%r14d - xorl %r11d,%edi - vpsrlq $17,%ymm7,%ymm7 - xorl %r13d,%r14d - leal (%r9,%rdi,1),%r9d - movl %ecx,%r12d - vpxor %ymm7,%ymm6,%ymm6 - addl 12+128(%rsp),%r8d - andl %ebx,%r12d - rorxl $25,%ebx,%r13d - vpsrlq $2,%ymm7,%ymm7 - rorxl $11,%ebx,%edi - leal (%r9,%r14,1),%r9d - leal (%r8,%r12,1),%r8d - vpxor %ymm7,%ymm6,%ymm6 - andnl %edx,%ebx,%r12d - xorl %edi,%r13d - rorxl $6,%ebx,%r14d - vpshufb %ymm9,%ymm6,%ymm6 - leal (%r8,%r12,1),%r8d - xorl %r14d,%r13d - movl %r9d,%edi - vpaddd %ymm6,%ymm2,%ymm2 - rorxl $22,%r9d,%r12d - leal (%r8,%r13,1),%r8d - xorl %r10d,%edi - vpaddd 64(%rbp),%ymm2,%ymm6 - rorxl $13,%r9d,%r14d - rorxl $2,%r9d,%r13d - leal (%rax,%r8,1),%eax - andl %edi,%r15d - xorl %r12d,%r14d - xorl %r10d,%r15d - xorl %r13d,%r14d - leal (%r8,%r15,1),%r8d - movl %ebx,%r12d - vmovdqa %ymm6,0(%rsp) - vpalignr $4,%ymm3,%ymm0,%ymm4 - addl 32+128(%rsp),%edx - andl %eax,%r12d - rorxl $25,%eax,%r13d - vpalignr $4,%ymm1,%ymm2,%ymm7 - rorxl $11,%eax,%r15d - leal (%r8,%r14,1),%r8d - leal (%rdx,%r12,1),%edx - vpsrld $7,%ymm4,%ymm6 - andnl %ecx,%eax,%r12d - xorl %r15d,%r13d - rorxl $6,%eax,%r14d - vpaddd %ymm7,%ymm3,%ymm3 - leal (%rdx,%r12,1),%edx - xorl %r14d,%r13d - movl %r8d,%r15d - vpsrld $3,%ymm4,%ymm7 - rorxl $22,%r8d,%r12d - leal (%rdx,%r13,1),%edx - xorl %r9d,%r15d - vpslld $14,%ymm4,%ymm5 - rorxl $13,%r8d,%r14d - rorxl $2,%r8d,%r13d - leal (%r11,%rdx,1),%r11d - vpxor %ymm6,%ymm7,%ymm4 - andl %r15d,%edi - xorl %r12d,%r14d - xorl %r9d,%edi - vpshufd $250,%ymm2,%ymm7 - xorl %r13d,%r14d - leal (%rdx,%rdi,1),%edx - movl %eax,%r12d - vpsrld $11,%ymm6,%ymm6 - addl 36+128(%rsp),%ecx - andl %r11d,%r12d - rorxl $25,%r11d,%r13d - vpxor %ymm5,%ymm4,%ymm4 - rorxl $11,%r11d,%edi - leal (%rdx,%r14,1),%edx - leal (%rcx,%r12,1),%ecx - vpslld $11,%ymm5,%ymm5 - andnl %ebx,%r11d,%r12d - xorl %edi,%r13d - rorxl $6,%r11d,%r14d - vpxor %ymm6,%ymm4,%ymm4 - leal (%rcx,%r12,1),%ecx - xorl %r14d,%r13d - movl %edx,%edi - vpsrld $10,%ymm7,%ymm6 - rorxl $22,%edx,%r12d - leal (%rcx,%r13,1),%ecx - xorl %r8d,%edi - vpxor %ymm5,%ymm4,%ymm4 - rorxl $13,%edx,%r14d - rorxl $2,%edx,%r13d - leal (%r10,%rcx,1),%r10d - vpsrlq $17,%ymm7,%ymm7 - andl %edi,%r15d - xorl %r12d,%r14d - xorl %r8d,%r15d - vpaddd %ymm4,%ymm3,%ymm3 - xorl %r13d,%r14d - leal (%rcx,%r15,1),%ecx - movl %r11d,%r12d - vpxor %ymm7,%ymm6,%ymm6 - addl 40+128(%rsp),%ebx - andl %r10d,%r12d - rorxl $25,%r10d,%r13d - vpsrlq $2,%ymm7,%ymm7 - rorxl $11,%r10d,%r15d - leal (%rcx,%r14,1),%ecx - leal (%rbx,%r12,1),%ebx - vpxor %ymm7,%ymm6,%ymm6 - andnl %eax,%r10d,%r12d - xorl %r15d,%r13d - rorxl $6,%r10d,%r14d - vpshufb %ymm8,%ymm6,%ymm6 - leal (%rbx,%r12,1),%ebx - xorl %r14d,%r13d - movl %ecx,%r15d - vpaddd %ymm6,%ymm3,%ymm3 - rorxl $22,%ecx,%r12d - leal (%rbx,%r13,1),%ebx - xorl %edx,%r15d - vpshufd $80,%ymm3,%ymm7 - rorxl $13,%ecx,%r14d - rorxl $2,%ecx,%r13d - leal (%r9,%rbx,1),%r9d - vpsrld $10,%ymm7,%ymm6 - andl %r15d,%edi - xorl %r12d,%r14d - xorl %edx,%edi - vpsrlq $17,%ymm7,%ymm7 - xorl %r13d,%r14d - leal (%rbx,%rdi,1),%ebx - movl %r10d,%r12d - vpxor %ymm7,%ymm6,%ymm6 - addl 44+128(%rsp),%eax - andl %r9d,%r12d - rorxl $25,%r9d,%r13d - vpsrlq $2,%ymm7,%ymm7 - rorxl $11,%r9d,%edi - leal (%rbx,%r14,1),%ebx - leal (%rax,%r12,1),%eax - vpxor %ymm7,%ymm6,%ymm6 - andnl %r11d,%r9d,%r12d - xorl %edi,%r13d - rorxl $6,%r9d,%r14d - vpshufb %ymm9,%ymm6,%ymm6 - leal (%rax,%r12,1),%eax - xorl %r14d,%r13d - movl %ebx,%edi - vpaddd %ymm6,%ymm3,%ymm3 - rorxl $22,%ebx,%r12d - leal (%rax,%r13,1),%eax - xorl %ecx,%edi - vpaddd 96(%rbp),%ymm3,%ymm6 - rorxl $13,%ebx,%r14d - rorxl $2,%ebx,%r13d - leal (%r8,%rax,1),%r8d - andl %edi,%r15d - xorl %r12d,%r14d - xorl %ecx,%r15d - xorl %r13d,%r14d - leal (%rax,%r15,1),%eax - movl %r9d,%r12d - vmovdqa %ymm6,32(%rsp) - leaq 128(%rbp),%rbp - cmpb $0,3(%rbp) - jne L$avx2_00_47 - addl 0+64(%rsp),%r11d - andl %r8d,%r12d - rorxl $25,%r8d,%r13d - rorxl $11,%r8d,%r15d - leal (%rax,%r14,1),%eax - leal (%r11,%r12,1),%r11d - andnl %r10d,%r8d,%r12d - xorl %r15d,%r13d - rorxl $6,%r8d,%r14d - leal (%r11,%r12,1),%r11d - xorl %r14d,%r13d - movl %eax,%r15d - rorxl $22,%eax,%r12d - leal (%r11,%r13,1),%r11d - xorl %ebx,%r15d - rorxl $13,%eax,%r14d - rorxl $2,%eax,%r13d - leal (%rdx,%r11,1),%edx - andl %r15d,%edi - xorl %r12d,%r14d - xorl %ebx,%edi - xorl %r13d,%r14d - leal (%r11,%rdi,1),%r11d - movl %r8d,%r12d - addl 4+64(%rsp),%r10d - andl %edx,%r12d - rorxl $25,%edx,%r13d - rorxl $11,%edx,%edi - leal (%r11,%r14,1),%r11d - leal (%r10,%r12,1),%r10d - andnl %r9d,%edx,%r12d - xorl %edi,%r13d - rorxl $6,%edx,%r14d - leal (%r10,%r12,1),%r10d - xorl %r14d,%r13d - movl %r11d,%edi - rorxl $22,%r11d,%r12d - leal (%r10,%r13,1),%r10d - xorl %eax,%edi - rorxl $13,%r11d,%r14d - rorxl $2,%r11d,%r13d - leal (%rcx,%r10,1),%ecx - andl %edi,%r15d - xorl %r12d,%r14d - xorl %eax,%r15d - xorl %r13d,%r14d - leal (%r10,%r15,1),%r10d - movl %edx,%r12d - addl 8+64(%rsp),%r9d - andl %ecx,%r12d - rorxl $25,%ecx,%r13d - rorxl $11,%ecx,%r15d - leal (%r10,%r14,1),%r10d - leal (%r9,%r12,1),%r9d - andnl %r8d,%ecx,%r12d - xorl %r15d,%r13d - rorxl $6,%ecx,%r14d - leal (%r9,%r12,1),%r9d - xorl %r14d,%r13d - movl %r10d,%r15d - rorxl $22,%r10d,%r12d - leal (%r9,%r13,1),%r9d - xorl %r11d,%r15d - rorxl $13,%r10d,%r14d - rorxl $2,%r10d,%r13d - leal (%rbx,%r9,1),%ebx - andl %r15d,%edi - xorl %r12d,%r14d - xorl %r11d,%edi - xorl %r13d,%r14d - leal (%r9,%rdi,1),%r9d - movl %ecx,%r12d - addl 12+64(%rsp),%r8d - andl %ebx,%r12d - rorxl $25,%ebx,%r13d - rorxl $11,%ebx,%edi - leal (%r9,%r14,1),%r9d - leal (%r8,%r12,1),%r8d - andnl %edx,%ebx,%r12d - xorl %edi,%r13d - rorxl $6,%ebx,%r14d - leal (%r8,%r12,1),%r8d - xorl %r14d,%r13d - movl %r9d,%edi - rorxl $22,%r9d,%r12d - leal (%r8,%r13,1),%r8d - xorl %r10d,%edi - rorxl $13,%r9d,%r14d - rorxl $2,%r9d,%r13d - leal (%rax,%r8,1),%eax - andl %edi,%r15d - xorl %r12d,%r14d - xorl %r10d,%r15d - xorl %r13d,%r14d - leal (%r8,%r15,1),%r8d - movl %ebx,%r12d - addl 32+64(%rsp),%edx - andl %eax,%r12d - rorxl $25,%eax,%r13d - rorxl $11,%eax,%r15d - leal (%r8,%r14,1),%r8d - leal (%rdx,%r12,1),%edx - andnl %ecx,%eax,%r12d - xorl %r15d,%r13d - rorxl $6,%eax,%r14d - leal (%rdx,%r12,1),%edx - xorl %r14d,%r13d - movl %r8d,%r15d - rorxl $22,%r8d,%r12d - leal (%rdx,%r13,1),%edx - xorl %r9d,%r15d - rorxl $13,%r8d,%r14d - rorxl $2,%r8d,%r13d - leal (%r11,%rdx,1),%r11d - andl %r15d,%edi - xorl %r12d,%r14d - xorl %r9d,%edi - xorl %r13d,%r14d - leal (%rdx,%rdi,1),%edx - movl %eax,%r12d - addl 36+64(%rsp),%ecx - andl %r11d,%r12d - rorxl $25,%r11d,%r13d - rorxl $11,%r11d,%edi - leal (%rdx,%r14,1),%edx - leal (%rcx,%r12,1),%ecx - andnl %ebx,%r11d,%r12d - xorl %edi,%r13d - rorxl $6,%r11d,%r14d - leal (%rcx,%r12,1),%ecx - xorl %r14d,%r13d - movl %edx,%edi - rorxl $22,%edx,%r12d - leal (%rcx,%r13,1),%ecx - xorl %r8d,%edi - rorxl $13,%edx,%r14d - rorxl $2,%edx,%r13d - leal (%r10,%rcx,1),%r10d - andl %edi,%r15d - xorl %r12d,%r14d - xorl %r8d,%r15d - xorl %r13d,%r14d - leal (%rcx,%r15,1),%ecx - movl %r11d,%r12d - addl 40+64(%rsp),%ebx - andl %r10d,%r12d - rorxl $25,%r10d,%r13d - rorxl $11,%r10d,%r15d - leal (%rcx,%r14,1),%ecx - leal (%rbx,%r12,1),%ebx - andnl %eax,%r10d,%r12d - xorl %r15d,%r13d - rorxl $6,%r10d,%r14d - leal (%rbx,%r12,1),%ebx - xorl %r14d,%r13d - movl %ecx,%r15d - rorxl $22,%ecx,%r12d - leal (%rbx,%r13,1),%ebx - xorl %edx,%r15d - rorxl $13,%ecx,%r14d - rorxl $2,%ecx,%r13d - leal (%r9,%rbx,1),%r9d - andl %r15d,%edi - xorl %r12d,%r14d - xorl %edx,%edi - xorl %r13d,%r14d - leal (%rbx,%rdi,1),%ebx - movl %r10d,%r12d - addl 44+64(%rsp),%eax - andl %r9d,%r12d - rorxl $25,%r9d,%r13d - rorxl $11,%r9d,%edi - leal (%rbx,%r14,1),%ebx - leal (%rax,%r12,1),%eax - andnl %r11d,%r9d,%r12d - xorl %edi,%r13d - rorxl $6,%r9d,%r14d - leal (%rax,%r12,1),%eax - xorl %r14d,%r13d - movl %ebx,%edi - rorxl $22,%ebx,%r12d - leal (%rax,%r13,1),%eax - xorl %ecx,%edi - rorxl $13,%ebx,%r14d - rorxl $2,%ebx,%r13d - leal (%r8,%rax,1),%r8d - andl %edi,%r15d - xorl %r12d,%r14d - xorl %ecx,%r15d - xorl %r13d,%r14d - leal (%rax,%r15,1),%eax - movl %r9d,%r12d - addl 0(%rsp),%r11d - andl %r8d,%r12d - rorxl $25,%r8d,%r13d - rorxl $11,%r8d,%r15d - leal (%rax,%r14,1),%eax - leal (%r11,%r12,1),%r11d - andnl %r10d,%r8d,%r12d - xorl %r15d,%r13d - rorxl $6,%r8d,%r14d - leal (%r11,%r12,1),%r11d - xorl %r14d,%r13d - movl %eax,%r15d - rorxl $22,%eax,%r12d - leal (%r11,%r13,1),%r11d - xorl %ebx,%r15d - rorxl $13,%eax,%r14d - rorxl $2,%eax,%r13d - leal (%rdx,%r11,1),%edx - andl %r15d,%edi - xorl %r12d,%r14d - xorl %ebx,%edi - xorl %r13d,%r14d - leal (%r11,%rdi,1),%r11d - movl %r8d,%r12d - addl 4(%rsp),%r10d - andl %edx,%r12d - rorxl $25,%edx,%r13d - rorxl $11,%edx,%edi - leal (%r11,%r14,1),%r11d - leal (%r10,%r12,1),%r10d - andnl %r9d,%edx,%r12d - xorl %edi,%r13d - rorxl $6,%edx,%r14d - leal (%r10,%r12,1),%r10d - xorl %r14d,%r13d - movl %r11d,%edi - rorxl $22,%r11d,%r12d - leal (%r10,%r13,1),%r10d - xorl %eax,%edi - rorxl $13,%r11d,%r14d - rorxl $2,%r11d,%r13d - leal (%rcx,%r10,1),%ecx - andl %edi,%r15d - xorl %r12d,%r14d - xorl %eax,%r15d - xorl %r13d,%r14d - leal (%r10,%r15,1),%r10d - movl %edx,%r12d - addl 8(%rsp),%r9d - andl %ecx,%r12d - rorxl $25,%ecx,%r13d - rorxl $11,%ecx,%r15d - leal (%r10,%r14,1),%r10d - leal (%r9,%r12,1),%r9d - andnl %r8d,%ecx,%r12d - xorl %r15d,%r13d - rorxl $6,%ecx,%r14d - leal (%r9,%r12,1),%r9d - xorl %r14d,%r13d - movl %r10d,%r15d - rorxl $22,%r10d,%r12d - leal (%r9,%r13,1),%r9d - xorl %r11d,%r15d - rorxl $13,%r10d,%r14d - rorxl $2,%r10d,%r13d - leal (%rbx,%r9,1),%ebx - andl %r15d,%edi - xorl %r12d,%r14d - xorl %r11d,%edi - xorl %r13d,%r14d - leal (%r9,%rdi,1),%r9d - movl %ecx,%r12d - addl 12(%rsp),%r8d - andl %ebx,%r12d - rorxl $25,%ebx,%r13d - rorxl $11,%ebx,%edi - leal (%r9,%r14,1),%r9d - leal (%r8,%r12,1),%r8d - andnl %edx,%ebx,%r12d - xorl %edi,%r13d - rorxl $6,%ebx,%r14d - leal (%r8,%r12,1),%r8d - xorl %r14d,%r13d - movl %r9d,%edi - rorxl $22,%r9d,%r12d - leal (%r8,%r13,1),%r8d - xorl %r10d,%edi - rorxl $13,%r9d,%r14d - rorxl $2,%r9d,%r13d - leal (%rax,%r8,1),%eax - andl %edi,%r15d - xorl %r12d,%r14d - xorl %r10d,%r15d - xorl %r13d,%r14d - leal (%r8,%r15,1),%r8d - movl %ebx,%r12d - addl 32(%rsp),%edx - andl %eax,%r12d - rorxl $25,%eax,%r13d - rorxl $11,%eax,%r15d - leal (%r8,%r14,1),%r8d - leal (%rdx,%r12,1),%edx - andnl %ecx,%eax,%r12d - xorl %r15d,%r13d - rorxl $6,%eax,%r14d - leal (%rdx,%r12,1),%edx - xorl %r14d,%r13d - movl %r8d,%r15d - rorxl $22,%r8d,%r12d - leal (%rdx,%r13,1),%edx - xorl %r9d,%r15d - rorxl $13,%r8d,%r14d - rorxl $2,%r8d,%r13d - leal (%r11,%rdx,1),%r11d - andl %r15d,%edi - xorl %r12d,%r14d - xorl %r9d,%edi - xorl %r13d,%r14d - leal (%rdx,%rdi,1),%edx - movl %eax,%r12d - addl 36(%rsp),%ecx - andl %r11d,%r12d - rorxl $25,%r11d,%r13d - rorxl $11,%r11d,%edi - leal (%rdx,%r14,1),%edx - leal (%rcx,%r12,1),%ecx - andnl %ebx,%r11d,%r12d - xorl %edi,%r13d - rorxl $6,%r11d,%r14d - leal (%rcx,%r12,1),%ecx - xorl %r14d,%r13d - movl %edx,%edi - rorxl $22,%edx,%r12d - leal (%rcx,%r13,1),%ecx - xorl %r8d,%edi - rorxl $13,%edx,%r14d - rorxl $2,%edx,%r13d - leal (%r10,%rcx,1),%r10d - andl %edi,%r15d - xorl %r12d,%r14d - xorl %r8d,%r15d - xorl %r13d,%r14d - leal (%rcx,%r15,1),%ecx - movl %r11d,%r12d - addl 40(%rsp),%ebx - andl %r10d,%r12d - rorxl $25,%r10d,%r13d - rorxl $11,%r10d,%r15d - leal (%rcx,%r14,1),%ecx - leal (%rbx,%r12,1),%ebx - andnl %eax,%r10d,%r12d - xorl %r15d,%r13d - rorxl $6,%r10d,%r14d - leal (%rbx,%r12,1),%ebx - xorl %r14d,%r13d - movl %ecx,%r15d - rorxl $22,%ecx,%r12d - leal (%rbx,%r13,1),%ebx - xorl %edx,%r15d - rorxl $13,%ecx,%r14d - rorxl $2,%ecx,%r13d - leal (%r9,%rbx,1),%r9d - andl %r15d,%edi - xorl %r12d,%r14d - xorl %edx,%edi - xorl %r13d,%r14d - leal (%rbx,%rdi,1),%ebx - movl %r10d,%r12d - addl 44(%rsp),%eax - andl %r9d,%r12d - rorxl $25,%r9d,%r13d - rorxl $11,%r9d,%edi - leal (%rbx,%r14,1),%ebx - leal (%rax,%r12,1),%eax - andnl %r11d,%r9d,%r12d - xorl %edi,%r13d - rorxl $6,%r9d,%r14d - leal (%rax,%r12,1),%eax - xorl %r14d,%r13d - movl %ebx,%edi - rorxl $22,%ebx,%r12d - leal (%rax,%r13,1),%eax - xorl %ecx,%edi - rorxl $13,%ebx,%r14d - rorxl $2,%ebx,%r13d - leal (%r8,%rax,1),%r8d - andl %edi,%r15d - xorl %r12d,%r14d - xorl %ecx,%r15d - xorl %r13d,%r14d - leal (%rax,%r15,1),%eax - movl %r9d,%r12d - movq 512(%rsp),%rdi - addl %r14d,%eax - - leaq 448(%rsp),%rbp - - addl 0(%rdi),%eax - addl 4(%rdi),%ebx - addl 8(%rdi),%ecx - addl 12(%rdi),%edx - addl 16(%rdi),%r8d - addl 20(%rdi),%r9d - addl 24(%rdi),%r10d - addl 28(%rdi),%r11d - - movl %eax,0(%rdi) - movl %ebx,4(%rdi) - movl %ecx,8(%rdi) - movl %edx,12(%rdi) - movl %r8d,16(%rdi) - movl %r9d,20(%rdi) - movl %r10d,24(%rdi) - movl %r11d,28(%rdi) - - cmpq 80(%rbp),%rsi - je L$done_avx2 - - xorl %r14d,%r14d - movl %ebx,%edi - xorl %ecx,%edi - movl %r9d,%r12d - jmp L$ower_avx2 -.p2align 4 -L$ower_avx2: - addl 0+16(%rbp),%r11d - andl %r8d,%r12d - rorxl $25,%r8d,%r13d - rorxl $11,%r8d,%r15d - leal (%rax,%r14,1),%eax - leal (%r11,%r12,1),%r11d - andnl %r10d,%r8d,%r12d - xorl %r15d,%r13d - rorxl $6,%r8d,%r14d - leal (%r11,%r12,1),%r11d - xorl %r14d,%r13d - movl %eax,%r15d - rorxl $22,%eax,%r12d - leal (%r11,%r13,1),%r11d - xorl %ebx,%r15d - rorxl $13,%eax,%r14d - rorxl $2,%eax,%r13d - leal (%rdx,%r11,1),%edx - andl %r15d,%edi - xorl %r12d,%r14d - xorl %ebx,%edi - xorl %r13d,%r14d - leal (%r11,%rdi,1),%r11d - movl %r8d,%r12d - addl 4+16(%rbp),%r10d - andl %edx,%r12d - rorxl $25,%edx,%r13d - rorxl $11,%edx,%edi - leal (%r11,%r14,1),%r11d - leal (%r10,%r12,1),%r10d - andnl %r9d,%edx,%r12d - xorl %edi,%r13d - rorxl $6,%edx,%r14d - leal (%r10,%r12,1),%r10d - xorl %r14d,%r13d - movl %r11d,%edi - rorxl $22,%r11d,%r12d - leal (%r10,%r13,1),%r10d - xorl %eax,%edi - rorxl $13,%r11d,%r14d - rorxl $2,%r11d,%r13d - leal (%rcx,%r10,1),%ecx - andl %edi,%r15d - xorl %r12d,%r14d - xorl %eax,%r15d - xorl %r13d,%r14d - leal (%r10,%r15,1),%r10d - movl %edx,%r12d - addl 8+16(%rbp),%r9d - andl %ecx,%r12d - rorxl $25,%ecx,%r13d - rorxl $11,%ecx,%r15d - leal (%r10,%r14,1),%r10d - leal (%r9,%r12,1),%r9d - andnl %r8d,%ecx,%r12d - xorl %r15d,%r13d - rorxl $6,%ecx,%r14d - leal (%r9,%r12,1),%r9d - xorl %r14d,%r13d - movl %r10d,%r15d - rorxl $22,%r10d,%r12d - leal (%r9,%r13,1),%r9d - xorl %r11d,%r15d - rorxl $13,%r10d,%r14d - rorxl $2,%r10d,%r13d - leal (%rbx,%r9,1),%ebx - andl %r15d,%edi - xorl %r12d,%r14d - xorl %r11d,%edi - xorl %r13d,%r14d - leal (%r9,%rdi,1),%r9d - movl %ecx,%r12d - addl 12+16(%rbp),%r8d - andl %ebx,%r12d - rorxl $25,%ebx,%r13d - rorxl $11,%ebx,%edi - leal (%r9,%r14,1),%r9d - leal (%r8,%r12,1),%r8d - andnl %edx,%ebx,%r12d - xorl %edi,%r13d - rorxl $6,%ebx,%r14d - leal (%r8,%r12,1),%r8d - xorl %r14d,%r13d - movl %r9d,%edi - rorxl $22,%r9d,%r12d - leal (%r8,%r13,1),%r8d - xorl %r10d,%edi - rorxl $13,%r9d,%r14d - rorxl $2,%r9d,%r13d - leal (%rax,%r8,1),%eax - andl %edi,%r15d - xorl %r12d,%r14d - xorl %r10d,%r15d - xorl %r13d,%r14d - leal (%r8,%r15,1),%r8d - movl %ebx,%r12d - addl 32+16(%rbp),%edx - andl %eax,%r12d - rorxl $25,%eax,%r13d - rorxl $11,%eax,%r15d - leal (%r8,%r14,1),%r8d - leal (%rdx,%r12,1),%edx - andnl %ecx,%eax,%r12d - xorl %r15d,%r13d - rorxl $6,%eax,%r14d - leal (%rdx,%r12,1),%edx - xorl %r14d,%r13d - movl %r8d,%r15d - rorxl $22,%r8d,%r12d - leal (%rdx,%r13,1),%edx - xorl %r9d,%r15d - rorxl $13,%r8d,%r14d - rorxl $2,%r8d,%r13d - leal (%r11,%rdx,1),%r11d - andl %r15d,%edi - xorl %r12d,%r14d - xorl %r9d,%edi - xorl %r13d,%r14d - leal (%rdx,%rdi,1),%edx - movl %eax,%r12d - addl 36+16(%rbp),%ecx - andl %r11d,%r12d - rorxl $25,%r11d,%r13d - rorxl $11,%r11d,%edi - leal (%rdx,%r14,1),%edx - leal (%rcx,%r12,1),%ecx - andnl %ebx,%r11d,%r12d - xorl %edi,%r13d - rorxl $6,%r11d,%r14d - leal (%rcx,%r12,1),%ecx - xorl %r14d,%r13d - movl %edx,%edi - rorxl $22,%edx,%r12d - leal (%rcx,%r13,1),%ecx - xorl %r8d,%edi - rorxl $13,%edx,%r14d - rorxl $2,%edx,%r13d - leal (%r10,%rcx,1),%r10d - andl %edi,%r15d - xorl %r12d,%r14d - xorl %r8d,%r15d - xorl %r13d,%r14d - leal (%rcx,%r15,1),%ecx - movl %r11d,%r12d - addl 40+16(%rbp),%ebx - andl %r10d,%r12d - rorxl $25,%r10d,%r13d - rorxl $11,%r10d,%r15d - leal (%rcx,%r14,1),%ecx - leal (%rbx,%r12,1),%ebx - andnl %eax,%r10d,%r12d - xorl %r15d,%r13d - rorxl $6,%r10d,%r14d - leal (%rbx,%r12,1),%ebx - xorl %r14d,%r13d - movl %ecx,%r15d - rorxl $22,%ecx,%r12d - leal (%rbx,%r13,1),%ebx - xorl %edx,%r15d - rorxl $13,%ecx,%r14d - rorxl $2,%ecx,%r13d - leal (%r9,%rbx,1),%r9d - andl %r15d,%edi - xorl %r12d,%r14d - xorl %edx,%edi - xorl %r13d,%r14d - leal (%rbx,%rdi,1),%ebx - movl %r10d,%r12d - addl 44+16(%rbp),%eax - andl %r9d,%r12d - rorxl $25,%r9d,%r13d - rorxl $11,%r9d,%edi - leal (%rbx,%r14,1),%ebx - leal (%rax,%r12,1),%eax - andnl %r11d,%r9d,%r12d - xorl %edi,%r13d - rorxl $6,%r9d,%r14d - leal (%rax,%r12,1),%eax - xorl %r14d,%r13d - movl %ebx,%edi - rorxl $22,%ebx,%r12d - leal (%rax,%r13,1),%eax - xorl %ecx,%edi - rorxl $13,%ebx,%r14d - rorxl $2,%ebx,%r13d - leal (%r8,%rax,1),%r8d - andl %edi,%r15d - xorl %r12d,%r14d - xorl %ecx,%r15d - xorl %r13d,%r14d - leal (%rax,%r15,1),%eax - movl %r9d,%r12d - leaq -64(%rbp),%rbp - cmpq %rsp,%rbp - jae L$ower_avx2 - - movq 512(%rsp),%rdi - addl %r14d,%eax - - leaq 448(%rsp),%rsp - - addl 0(%rdi),%eax - addl 4(%rdi),%ebx - addl 8(%rdi),%ecx - addl 12(%rdi),%edx - addl 16(%rdi),%r8d - addl 20(%rdi),%r9d - leaq 128(%rsi),%rsi - addl 24(%rdi),%r10d - movq %rsi,%r12 - addl 28(%rdi),%r11d - cmpq 64+16(%rsp),%rsi - - movl %eax,0(%rdi) - cmoveq %rsp,%r12 - movl %ebx,4(%rdi) - movl %ecx,8(%rdi) - movl %edx,12(%rdi) - movl %r8d,16(%rdi) - movl %r9d,20(%rdi) - movl %r10d,24(%rdi) - movl %r11d,28(%rdi) - - jbe L$oop_avx2 - leaq (%rsp),%rbp - -L$done_avx2: - leaq (%rbp),%rsp - movq 64+24(%rsp),%rsi - vzeroupper - movq (%rsi),%r15 - movq 8(%rsi),%r14 - movq 16(%rsi),%r13 - movq 24(%rsi),%r12 - movq 32(%rsi),%rbp - movq 40(%rsi),%rbx - leaq 48(%rsi),%rsp -L$epilogue_avx2: - .byte 0xf3,0xc3 diff --git a/deps/openssl/asm/x64-macosx-gas/sha/sha512-x86_64.s b/deps/openssl/asm/x64-macosx-gas/sha/sha512-x86_64.s index 91821da1264e86..1cae4e11fb33db 100644 --- a/deps/openssl/asm/x64-macosx-gas/sha/sha512-x86_64.s +++ b/deps/openssl/asm/x64-macosx-gas/sha/sha512-x86_64.s @@ -5,20 +5,6 @@ .p2align 4 _sha512_block_data_order: - leaq _OPENSSL_ia32cap_P(%rip),%r11 - movl 0(%r11),%r9d - movl 4(%r11),%r10d - movl 8(%r11),%r11d - testl $2048,%r10d - jnz L$xop_shortcut - andl $296,%r11d - cmpl $296,%r11d - je L$avx2_shortcut - andl $1073741824,%r9d - andl $268435968,%r10d - orl %r9d,%r10d - cmpl $1342177792,%r10d - je L$avx_shortcut pushq %rbx pushq %rbp pushq %r12 @@ -1795,3570 +1781,3 @@ K512: .quad 0x0001020304050607,0x08090a0b0c0d0e0f .quad 0x0001020304050607,0x08090a0b0c0d0e0f .byte 83,72,65,53,49,50,32,98,108,111,99,107,32,116,114,97,110,115,102,111,114,109,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 - -.p2align 6 -sha512_block_data_order_xop: -L$xop_shortcut: - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - movq %rsp,%r11 - shlq $4,%rdx - subq $160,%rsp - leaq (%rsi,%rdx,8),%rdx - andq $-64,%rsp - movq %rdi,128+0(%rsp) - movq %rsi,128+8(%rsp) - movq %rdx,128+16(%rsp) - movq %r11,128+24(%rsp) -L$prologue_xop: - - vzeroupper - movq 0(%rdi),%rax - movq 8(%rdi),%rbx - movq 16(%rdi),%rcx - movq 24(%rdi),%rdx - movq 32(%rdi),%r8 - movq 40(%rdi),%r9 - movq 48(%rdi),%r10 - movq 56(%rdi),%r11 - jmp L$loop_xop -.p2align 4 -L$loop_xop: - vmovdqa K512+1280(%rip),%xmm11 - vmovdqu 0(%rsi),%xmm0 - leaq K512+128(%rip),%rbp - vmovdqu 16(%rsi),%xmm1 - vmovdqu 32(%rsi),%xmm2 - vpshufb %xmm11,%xmm0,%xmm0 - vmovdqu 48(%rsi),%xmm3 - vpshufb %xmm11,%xmm1,%xmm1 - vmovdqu 64(%rsi),%xmm4 - vpshufb %xmm11,%xmm2,%xmm2 - vmovdqu 80(%rsi),%xmm5 - vpshufb %xmm11,%xmm3,%xmm3 - vmovdqu 96(%rsi),%xmm6 - vpshufb %xmm11,%xmm4,%xmm4 - vmovdqu 112(%rsi),%xmm7 - vpshufb %xmm11,%xmm5,%xmm5 - vpaddq -128(%rbp),%xmm0,%xmm8 - vpshufb %xmm11,%xmm6,%xmm6 - vpaddq -96(%rbp),%xmm1,%xmm9 - vpshufb %xmm11,%xmm7,%xmm7 - vpaddq -64(%rbp),%xmm2,%xmm10 - vpaddq -32(%rbp),%xmm3,%xmm11 - vmovdqa %xmm8,0(%rsp) - vpaddq 0(%rbp),%xmm4,%xmm8 - vmovdqa %xmm9,16(%rsp) - vpaddq 32(%rbp),%xmm5,%xmm9 - vmovdqa %xmm10,32(%rsp) - vpaddq 64(%rbp),%xmm6,%xmm10 - vmovdqa %xmm11,48(%rsp) - vpaddq 96(%rbp),%xmm7,%xmm11 - vmovdqa %xmm8,64(%rsp) - movq %rax,%r14 - vmovdqa %xmm9,80(%rsp) - movq %rbx,%rdi - vmovdqa %xmm10,96(%rsp) - xorq %rcx,%rdi - vmovdqa %xmm11,112(%rsp) - movq %r8,%r13 - jmp L$xop_00_47 - -.p2align 4 -L$xop_00_47: - addq $256,%rbp - vpalignr $8,%xmm0,%xmm1,%xmm8 - rorq $23,%r13 - movq %r14,%rax - vpalignr $8,%xmm4,%xmm5,%xmm11 - movq %r9,%r12 - rorq $5,%r14 -.byte 143,72,120,195,200,56 - xorq %r8,%r13 - xorq %r10,%r12 - vpsrlq $7,%xmm8,%xmm8 - rorq $4,%r13 - xorq %rax,%r14 - vpaddq %xmm11,%xmm0,%xmm0 - andq %r8,%r12 - xorq %r8,%r13 - addq 0(%rsp),%r11 - movq %rax,%r15 -.byte 143,72,120,195,209,7 - xorq %r10,%r12 - rorq $6,%r14 - vpxor %xmm9,%xmm8,%xmm8 - xorq %rbx,%r15 - addq %r12,%r11 - rorq $14,%r13 - andq %r15,%rdi -.byte 143,104,120,195,223,3 - xorq %rax,%r14 - addq %r13,%r11 - vpxor %xmm10,%xmm8,%xmm8 - xorq %rbx,%rdi - rorq $28,%r14 - vpsrlq $6,%xmm7,%xmm10 - addq %r11,%rdx - addq %rdi,%r11 - vpaddq %xmm8,%xmm0,%xmm0 - movq %rdx,%r13 - addq %r11,%r14 -.byte 143,72,120,195,203,42 - rorq $23,%r13 - movq %r14,%r11 - vpxor %xmm10,%xmm11,%xmm11 - movq %r8,%r12 - rorq $5,%r14 - xorq %rdx,%r13 - xorq %r9,%r12 - vpxor %xmm9,%xmm11,%xmm11 - rorq $4,%r13 - xorq %r11,%r14 - andq %rdx,%r12 - xorq %rdx,%r13 - vpaddq %xmm11,%xmm0,%xmm0 - addq 8(%rsp),%r10 - movq %r11,%rdi - xorq %r9,%r12 - rorq $6,%r14 - vpaddq -128(%rbp),%xmm0,%xmm10 - xorq %rax,%rdi - addq %r12,%r10 - rorq $14,%r13 - andq %rdi,%r15 - xorq %r11,%r14 - addq %r13,%r10 - xorq %rax,%r15 - rorq $28,%r14 - addq %r10,%rcx - addq %r15,%r10 - movq %rcx,%r13 - addq %r10,%r14 - vmovdqa %xmm10,0(%rsp) - vpalignr $8,%xmm1,%xmm2,%xmm8 - rorq $23,%r13 - movq %r14,%r10 - vpalignr $8,%xmm5,%xmm6,%xmm11 - movq %rdx,%r12 - rorq $5,%r14 -.byte 143,72,120,195,200,56 - xorq %rcx,%r13 - xorq %r8,%r12 - vpsrlq $7,%xmm8,%xmm8 - rorq $4,%r13 - xorq %r10,%r14 - vpaddq %xmm11,%xmm1,%xmm1 - andq %rcx,%r12 - xorq %rcx,%r13 - addq 16(%rsp),%r9 - movq %r10,%r15 -.byte 143,72,120,195,209,7 - xorq %r8,%r12 - rorq $6,%r14 - vpxor %xmm9,%xmm8,%xmm8 - xorq %r11,%r15 - addq %r12,%r9 - rorq $14,%r13 - andq %r15,%rdi -.byte 143,104,120,195,216,3 - xorq %r10,%r14 - addq %r13,%r9 - vpxor %xmm10,%xmm8,%xmm8 - xorq %r11,%rdi - rorq $28,%r14 - vpsrlq $6,%xmm0,%xmm10 - addq %r9,%rbx - addq %rdi,%r9 - vpaddq %xmm8,%xmm1,%xmm1 - movq %rbx,%r13 - addq %r9,%r14 -.byte 143,72,120,195,203,42 - rorq $23,%r13 - movq %r14,%r9 - vpxor %xmm10,%xmm11,%xmm11 - movq %rcx,%r12 - rorq $5,%r14 - xorq %rbx,%r13 - xorq %rdx,%r12 - vpxor %xmm9,%xmm11,%xmm11 - rorq $4,%r13 - xorq %r9,%r14 - andq %rbx,%r12 - xorq %rbx,%r13 - vpaddq %xmm11,%xmm1,%xmm1 - addq 24(%rsp),%r8 - movq %r9,%rdi - xorq %rdx,%r12 - rorq $6,%r14 - vpaddq -96(%rbp),%xmm1,%xmm10 - xorq %r10,%rdi - addq %r12,%r8 - rorq $14,%r13 - andq %rdi,%r15 - xorq %r9,%r14 - addq %r13,%r8 - xorq %r10,%r15 - rorq $28,%r14 - addq %r8,%rax - addq %r15,%r8 - movq %rax,%r13 - addq %r8,%r14 - vmovdqa %xmm10,16(%rsp) - vpalignr $8,%xmm2,%xmm3,%xmm8 - rorq $23,%r13 - movq %r14,%r8 - vpalignr $8,%xmm6,%xmm7,%xmm11 - movq %rbx,%r12 - rorq $5,%r14 -.byte 143,72,120,195,200,56 - xorq %rax,%r13 - xorq %rcx,%r12 - vpsrlq $7,%xmm8,%xmm8 - rorq $4,%r13 - xorq %r8,%r14 - vpaddq %xmm11,%xmm2,%xmm2 - andq %rax,%r12 - xorq %rax,%r13 - addq 32(%rsp),%rdx - movq %r8,%r15 -.byte 143,72,120,195,209,7 - xorq %rcx,%r12 - rorq $6,%r14 - vpxor %xmm9,%xmm8,%xmm8 - xorq %r9,%r15 - addq %r12,%rdx - rorq $14,%r13 - andq %r15,%rdi -.byte 143,104,120,195,217,3 - xorq %r8,%r14 - addq %r13,%rdx - vpxor %xmm10,%xmm8,%xmm8 - xorq %r9,%rdi - rorq $28,%r14 - vpsrlq $6,%xmm1,%xmm10 - addq %rdx,%r11 - addq %rdi,%rdx - vpaddq %xmm8,%xmm2,%xmm2 - movq %r11,%r13 - addq %rdx,%r14 -.byte 143,72,120,195,203,42 - rorq $23,%r13 - movq %r14,%rdx - vpxor %xmm10,%xmm11,%xmm11 - movq %rax,%r12 - rorq $5,%r14 - xorq %r11,%r13 - xorq %rbx,%r12 - vpxor %xmm9,%xmm11,%xmm11 - rorq $4,%r13 - xorq %rdx,%r14 - andq %r11,%r12 - xorq %r11,%r13 - vpaddq %xmm11,%xmm2,%xmm2 - addq 40(%rsp),%rcx - movq %rdx,%rdi - xorq %rbx,%r12 - rorq $6,%r14 - vpaddq -64(%rbp),%xmm2,%xmm10 - xorq %r8,%rdi - addq %r12,%rcx - rorq $14,%r13 - andq %rdi,%r15 - xorq %rdx,%r14 - addq %r13,%rcx - xorq %r8,%r15 - rorq $28,%r14 - addq %rcx,%r10 - addq %r15,%rcx - movq %r10,%r13 - addq %rcx,%r14 - vmovdqa %xmm10,32(%rsp) - vpalignr $8,%xmm3,%xmm4,%xmm8 - rorq $23,%r13 - movq %r14,%rcx - vpalignr $8,%xmm7,%xmm0,%xmm11 - movq %r11,%r12 - rorq $5,%r14 -.byte 143,72,120,195,200,56 - xorq %r10,%r13 - xorq %rax,%r12 - vpsrlq $7,%xmm8,%xmm8 - rorq $4,%r13 - xorq %rcx,%r14 - vpaddq %xmm11,%xmm3,%xmm3 - andq %r10,%r12 - xorq %r10,%r13 - addq 48(%rsp),%rbx - movq %rcx,%r15 -.byte 143,72,120,195,209,7 - xorq %rax,%r12 - rorq $6,%r14 - vpxor %xmm9,%xmm8,%xmm8 - xorq %rdx,%r15 - addq %r12,%rbx - rorq $14,%r13 - andq %r15,%rdi -.byte 143,104,120,195,218,3 - xorq %rcx,%r14 - addq %r13,%rbx - vpxor %xmm10,%xmm8,%xmm8 - xorq %rdx,%rdi - rorq $28,%r14 - vpsrlq $6,%xmm2,%xmm10 - addq %rbx,%r9 - addq %rdi,%rbx - vpaddq %xmm8,%xmm3,%xmm3 - movq %r9,%r13 - addq %rbx,%r14 -.byte 143,72,120,195,203,42 - rorq $23,%r13 - movq %r14,%rbx - vpxor %xmm10,%xmm11,%xmm11 - movq %r10,%r12 - rorq $5,%r14 - xorq %r9,%r13 - xorq %r11,%r12 - vpxor %xmm9,%xmm11,%xmm11 - rorq $4,%r13 - xorq %rbx,%r14 - andq %r9,%r12 - xorq %r9,%r13 - vpaddq %xmm11,%xmm3,%xmm3 - addq 56(%rsp),%rax - movq %rbx,%rdi - xorq %r11,%r12 - rorq $6,%r14 - vpaddq -32(%rbp),%xmm3,%xmm10 - xorq %rcx,%rdi - addq %r12,%rax - rorq $14,%r13 - andq %rdi,%r15 - xorq %rbx,%r14 - addq %r13,%rax - xorq %rcx,%r15 - rorq $28,%r14 - addq %rax,%r8 - addq %r15,%rax - movq %r8,%r13 - addq %rax,%r14 - vmovdqa %xmm10,48(%rsp) - vpalignr $8,%xmm4,%xmm5,%xmm8 - rorq $23,%r13 - movq %r14,%rax - vpalignr $8,%xmm0,%xmm1,%xmm11 - movq %r9,%r12 - rorq $5,%r14 -.byte 143,72,120,195,200,56 - xorq %r8,%r13 - xorq %r10,%r12 - vpsrlq $7,%xmm8,%xmm8 - rorq $4,%r13 - xorq %rax,%r14 - vpaddq %xmm11,%xmm4,%xmm4 - andq %r8,%r12 - xorq %r8,%r13 - addq 64(%rsp),%r11 - movq %rax,%r15 -.byte 143,72,120,195,209,7 - xorq %r10,%r12 - rorq $6,%r14 - vpxor %xmm9,%xmm8,%xmm8 - xorq %rbx,%r15 - addq %r12,%r11 - rorq $14,%r13 - andq %r15,%rdi -.byte 143,104,120,195,219,3 - xorq %rax,%r14 - addq %r13,%r11 - vpxor %xmm10,%xmm8,%xmm8 - xorq %rbx,%rdi - rorq $28,%r14 - vpsrlq $6,%xmm3,%xmm10 - addq %r11,%rdx - addq %rdi,%r11 - vpaddq %xmm8,%xmm4,%xmm4 - movq %rdx,%r13 - addq %r11,%r14 -.byte 143,72,120,195,203,42 - rorq $23,%r13 - movq %r14,%r11 - vpxor %xmm10,%xmm11,%xmm11 - movq %r8,%r12 - rorq $5,%r14 - xorq %rdx,%r13 - xorq %r9,%r12 - vpxor %xmm9,%xmm11,%xmm11 - rorq $4,%r13 - xorq %r11,%r14 - andq %rdx,%r12 - xorq %rdx,%r13 - vpaddq %xmm11,%xmm4,%xmm4 - addq 72(%rsp),%r10 - movq %r11,%rdi - xorq %r9,%r12 - rorq $6,%r14 - vpaddq 0(%rbp),%xmm4,%xmm10 - xorq %rax,%rdi - addq %r12,%r10 - rorq $14,%r13 - andq %rdi,%r15 - xorq %r11,%r14 - addq %r13,%r10 - xorq %rax,%r15 - rorq $28,%r14 - addq %r10,%rcx - addq %r15,%r10 - movq %rcx,%r13 - addq %r10,%r14 - vmovdqa %xmm10,64(%rsp) - vpalignr $8,%xmm5,%xmm6,%xmm8 - rorq $23,%r13 - movq %r14,%r10 - vpalignr $8,%xmm1,%xmm2,%xmm11 - movq %rdx,%r12 - rorq $5,%r14 -.byte 143,72,120,195,200,56 - xorq %rcx,%r13 - xorq %r8,%r12 - vpsrlq $7,%xmm8,%xmm8 - rorq $4,%r13 - xorq %r10,%r14 - vpaddq %xmm11,%xmm5,%xmm5 - andq %rcx,%r12 - xorq %rcx,%r13 - addq 80(%rsp),%r9 - movq %r10,%r15 -.byte 143,72,120,195,209,7 - xorq %r8,%r12 - rorq $6,%r14 - vpxor %xmm9,%xmm8,%xmm8 - xorq %r11,%r15 - addq %r12,%r9 - rorq $14,%r13 - andq %r15,%rdi -.byte 143,104,120,195,220,3 - xorq %r10,%r14 - addq %r13,%r9 - vpxor %xmm10,%xmm8,%xmm8 - xorq %r11,%rdi - rorq $28,%r14 - vpsrlq $6,%xmm4,%xmm10 - addq %r9,%rbx - addq %rdi,%r9 - vpaddq %xmm8,%xmm5,%xmm5 - movq %rbx,%r13 - addq %r9,%r14 -.byte 143,72,120,195,203,42 - rorq $23,%r13 - movq %r14,%r9 - vpxor %xmm10,%xmm11,%xmm11 - movq %rcx,%r12 - rorq $5,%r14 - xorq %rbx,%r13 - xorq %rdx,%r12 - vpxor %xmm9,%xmm11,%xmm11 - rorq $4,%r13 - xorq %r9,%r14 - andq %rbx,%r12 - xorq %rbx,%r13 - vpaddq %xmm11,%xmm5,%xmm5 - addq 88(%rsp),%r8 - movq %r9,%rdi - xorq %rdx,%r12 - rorq $6,%r14 - vpaddq 32(%rbp),%xmm5,%xmm10 - xorq %r10,%rdi - addq %r12,%r8 - rorq $14,%r13 - andq %rdi,%r15 - xorq %r9,%r14 - addq %r13,%r8 - xorq %r10,%r15 - rorq $28,%r14 - addq %r8,%rax - addq %r15,%r8 - movq %rax,%r13 - addq %r8,%r14 - vmovdqa %xmm10,80(%rsp) - vpalignr $8,%xmm6,%xmm7,%xmm8 - rorq $23,%r13 - movq %r14,%r8 - vpalignr $8,%xmm2,%xmm3,%xmm11 - movq %rbx,%r12 - rorq $5,%r14 -.byte 143,72,120,195,200,56 - xorq %rax,%r13 - xorq %rcx,%r12 - vpsrlq $7,%xmm8,%xmm8 - rorq $4,%r13 - xorq %r8,%r14 - vpaddq %xmm11,%xmm6,%xmm6 - andq %rax,%r12 - xorq %rax,%r13 - addq 96(%rsp),%rdx - movq %r8,%r15 -.byte 143,72,120,195,209,7 - xorq %rcx,%r12 - rorq $6,%r14 - vpxor %xmm9,%xmm8,%xmm8 - xorq %r9,%r15 - addq %r12,%rdx - rorq $14,%r13 - andq %r15,%rdi -.byte 143,104,120,195,221,3 - xorq %r8,%r14 - addq %r13,%rdx - vpxor %xmm10,%xmm8,%xmm8 - xorq %r9,%rdi - rorq $28,%r14 - vpsrlq $6,%xmm5,%xmm10 - addq %rdx,%r11 - addq %rdi,%rdx - vpaddq %xmm8,%xmm6,%xmm6 - movq %r11,%r13 - addq %rdx,%r14 -.byte 143,72,120,195,203,42 - rorq $23,%r13 - movq %r14,%rdx - vpxor %xmm10,%xmm11,%xmm11 - movq %rax,%r12 - rorq $5,%r14 - xorq %r11,%r13 - xorq %rbx,%r12 - vpxor %xmm9,%xmm11,%xmm11 - rorq $4,%r13 - xorq %rdx,%r14 - andq %r11,%r12 - xorq %r11,%r13 - vpaddq %xmm11,%xmm6,%xmm6 - addq 104(%rsp),%rcx - movq %rdx,%rdi - xorq %rbx,%r12 - rorq $6,%r14 - vpaddq 64(%rbp),%xmm6,%xmm10 - xorq %r8,%rdi - addq %r12,%rcx - rorq $14,%r13 - andq %rdi,%r15 - xorq %rdx,%r14 - addq %r13,%rcx - xorq %r8,%r15 - rorq $28,%r14 - addq %rcx,%r10 - addq %r15,%rcx - movq %r10,%r13 - addq %rcx,%r14 - vmovdqa %xmm10,96(%rsp) - vpalignr $8,%xmm7,%xmm0,%xmm8 - rorq $23,%r13 - movq %r14,%rcx - vpalignr $8,%xmm3,%xmm4,%xmm11 - movq %r11,%r12 - rorq $5,%r14 -.byte 143,72,120,195,200,56 - xorq %r10,%r13 - xorq %rax,%r12 - vpsrlq $7,%xmm8,%xmm8 - rorq $4,%r13 - xorq %rcx,%r14 - vpaddq %xmm11,%xmm7,%xmm7 - andq %r10,%r12 - xorq %r10,%r13 - addq 112(%rsp),%rbx - movq %rcx,%r15 -.byte 143,72,120,195,209,7 - xorq %rax,%r12 - rorq $6,%r14 - vpxor %xmm9,%xmm8,%xmm8 - xorq %rdx,%r15 - addq %r12,%rbx - rorq $14,%r13 - andq %r15,%rdi -.byte 143,104,120,195,222,3 - xorq %rcx,%r14 - addq %r13,%rbx - vpxor %xmm10,%xmm8,%xmm8 - xorq %rdx,%rdi - rorq $28,%r14 - vpsrlq $6,%xmm6,%xmm10 - addq %rbx,%r9 - addq %rdi,%rbx - vpaddq %xmm8,%xmm7,%xmm7 - movq %r9,%r13 - addq %rbx,%r14 -.byte 143,72,120,195,203,42 - rorq $23,%r13 - movq %r14,%rbx - vpxor %xmm10,%xmm11,%xmm11 - movq %r10,%r12 - rorq $5,%r14 - xorq %r9,%r13 - xorq %r11,%r12 - vpxor %xmm9,%xmm11,%xmm11 - rorq $4,%r13 - xorq %rbx,%r14 - andq %r9,%r12 - xorq %r9,%r13 - vpaddq %xmm11,%xmm7,%xmm7 - addq 120(%rsp),%rax - movq %rbx,%rdi - xorq %r11,%r12 - rorq $6,%r14 - vpaddq 96(%rbp),%xmm7,%xmm10 - xorq %rcx,%rdi - addq %r12,%rax - rorq $14,%r13 - andq %rdi,%r15 - xorq %rbx,%r14 - addq %r13,%rax - xorq %rcx,%r15 - rorq $28,%r14 - addq %rax,%r8 - addq %r15,%rax - movq %r8,%r13 - addq %rax,%r14 - vmovdqa %xmm10,112(%rsp) - cmpb $0,135(%rbp) - jne L$xop_00_47 - rorq $23,%r13 - movq %r14,%rax - movq %r9,%r12 - rorq $5,%r14 - xorq %r8,%r13 - xorq %r10,%r12 - rorq $4,%r13 - xorq %rax,%r14 - andq %r8,%r12 - xorq %r8,%r13 - addq 0(%rsp),%r11 - movq %rax,%r15 - xorq %r10,%r12 - rorq $6,%r14 - xorq %rbx,%r15 - addq %r12,%r11 - rorq $14,%r13 - andq %r15,%rdi - xorq %rax,%r14 - addq %r13,%r11 - xorq %rbx,%rdi - rorq $28,%r14 - addq %r11,%rdx - addq %rdi,%r11 - movq %rdx,%r13 - addq %r11,%r14 - rorq $23,%r13 - movq %r14,%r11 - movq %r8,%r12 - rorq $5,%r14 - xorq %rdx,%r13 - xorq %r9,%r12 - rorq $4,%r13 - xorq %r11,%r14 - andq %rdx,%r12 - xorq %rdx,%r13 - addq 8(%rsp),%r10 - movq %r11,%rdi - xorq %r9,%r12 - rorq $6,%r14 - xorq %rax,%rdi - addq %r12,%r10 - rorq $14,%r13 - andq %rdi,%r15 - xorq %r11,%r14 - addq %r13,%r10 - xorq %rax,%r15 - rorq $28,%r14 - addq %r10,%rcx - addq %r15,%r10 - movq %rcx,%r13 - addq %r10,%r14 - rorq $23,%r13 - movq %r14,%r10 - movq %rdx,%r12 - rorq $5,%r14 - xorq %rcx,%r13 - xorq %r8,%r12 - rorq $4,%r13 - xorq %r10,%r14 - andq %rcx,%r12 - xorq %rcx,%r13 - addq 16(%rsp),%r9 - movq %r10,%r15 - xorq %r8,%r12 - rorq $6,%r14 - xorq %r11,%r15 - addq %r12,%r9 - rorq $14,%r13 - andq %r15,%rdi - xorq %r10,%r14 - addq %r13,%r9 - xorq %r11,%rdi - rorq $28,%r14 - addq %r9,%rbx - addq %rdi,%r9 - movq %rbx,%r13 - addq %r9,%r14 - rorq $23,%r13 - movq %r14,%r9 - movq %rcx,%r12 - rorq $5,%r14 - xorq %rbx,%r13 - xorq %rdx,%r12 - rorq $4,%r13 - xorq %r9,%r14 - andq %rbx,%r12 - xorq %rbx,%r13 - addq 24(%rsp),%r8 - movq %r9,%rdi - xorq %rdx,%r12 - rorq $6,%r14 - xorq %r10,%rdi - addq %r12,%r8 - rorq $14,%r13 - andq %rdi,%r15 - xorq %r9,%r14 - addq %r13,%r8 - xorq %r10,%r15 - rorq $28,%r14 - addq %r8,%rax - addq %r15,%r8 - movq %rax,%r13 - addq %r8,%r14 - rorq $23,%r13 - movq %r14,%r8 - movq %rbx,%r12 - rorq $5,%r14 - xorq %rax,%r13 - xorq %rcx,%r12 - rorq $4,%r13 - xorq %r8,%r14 - andq %rax,%r12 - xorq %rax,%r13 - addq 32(%rsp),%rdx - movq %r8,%r15 - xorq %rcx,%r12 - rorq $6,%r14 - xorq %r9,%r15 - addq %r12,%rdx - rorq $14,%r13 - andq %r15,%rdi - xorq %r8,%r14 - addq %r13,%rdx - xorq %r9,%rdi - rorq $28,%r14 - addq %rdx,%r11 - addq %rdi,%rdx - movq %r11,%r13 - addq %rdx,%r14 - rorq $23,%r13 - movq %r14,%rdx - movq %rax,%r12 - rorq $5,%r14 - xorq %r11,%r13 - xorq %rbx,%r12 - rorq $4,%r13 - xorq %rdx,%r14 - andq %r11,%r12 - xorq %r11,%r13 - addq 40(%rsp),%rcx - movq %rdx,%rdi - xorq %rbx,%r12 - rorq $6,%r14 - xorq %r8,%rdi - addq %r12,%rcx - rorq $14,%r13 - andq %rdi,%r15 - xorq %rdx,%r14 - addq %r13,%rcx - xorq %r8,%r15 - rorq $28,%r14 - addq %rcx,%r10 - addq %r15,%rcx - movq %r10,%r13 - addq %rcx,%r14 - rorq $23,%r13 - movq %r14,%rcx - movq %r11,%r12 - rorq $5,%r14 - xorq %r10,%r13 - xorq %rax,%r12 - rorq $4,%r13 - xorq %rcx,%r14 - andq %r10,%r12 - xorq %r10,%r13 - addq 48(%rsp),%rbx - movq %rcx,%r15 - xorq %rax,%r12 - rorq $6,%r14 - xorq %rdx,%r15 - addq %r12,%rbx - rorq $14,%r13 - andq %r15,%rdi - xorq %rcx,%r14 - addq %r13,%rbx - xorq %rdx,%rdi - rorq $28,%r14 - addq %rbx,%r9 - addq %rdi,%rbx - movq %r9,%r13 - addq %rbx,%r14 - rorq $23,%r13 - movq %r14,%rbx - movq %r10,%r12 - rorq $5,%r14 - xorq %r9,%r13 - xorq %r11,%r12 - rorq $4,%r13 - xorq %rbx,%r14 - andq %r9,%r12 - xorq %r9,%r13 - addq 56(%rsp),%rax - movq %rbx,%rdi - xorq %r11,%r12 - rorq $6,%r14 - xorq %rcx,%rdi - addq %r12,%rax - rorq $14,%r13 - andq %rdi,%r15 - xorq %rbx,%r14 - addq %r13,%rax - xorq %rcx,%r15 - rorq $28,%r14 - addq %rax,%r8 - addq %r15,%rax - movq %r8,%r13 - addq %rax,%r14 - rorq $23,%r13 - movq %r14,%rax - movq %r9,%r12 - rorq $5,%r14 - xorq %r8,%r13 - xorq %r10,%r12 - rorq $4,%r13 - xorq %rax,%r14 - andq %r8,%r12 - xorq %r8,%r13 - addq 64(%rsp),%r11 - movq %rax,%r15 - xorq %r10,%r12 - rorq $6,%r14 - xorq %rbx,%r15 - addq %r12,%r11 - rorq $14,%r13 - andq %r15,%rdi - xorq %rax,%r14 - addq %r13,%r11 - xorq %rbx,%rdi - rorq $28,%r14 - addq %r11,%rdx - addq %rdi,%r11 - movq %rdx,%r13 - addq %r11,%r14 - rorq $23,%r13 - movq %r14,%r11 - movq %r8,%r12 - rorq $5,%r14 - xorq %rdx,%r13 - xorq %r9,%r12 - rorq $4,%r13 - xorq %r11,%r14 - andq %rdx,%r12 - xorq %rdx,%r13 - addq 72(%rsp),%r10 - movq %r11,%rdi - xorq %r9,%r12 - rorq $6,%r14 - xorq %rax,%rdi - addq %r12,%r10 - rorq $14,%r13 - andq %rdi,%r15 - xorq %r11,%r14 - addq %r13,%r10 - xorq %rax,%r15 - rorq $28,%r14 - addq %r10,%rcx - addq %r15,%r10 - movq %rcx,%r13 - addq %r10,%r14 - rorq $23,%r13 - movq %r14,%r10 - movq %rdx,%r12 - rorq $5,%r14 - xorq %rcx,%r13 - xorq %r8,%r12 - rorq $4,%r13 - xorq %r10,%r14 - andq %rcx,%r12 - xorq %rcx,%r13 - addq 80(%rsp),%r9 - movq %r10,%r15 - xorq %r8,%r12 - rorq $6,%r14 - xorq %r11,%r15 - addq %r12,%r9 - rorq $14,%r13 - andq %r15,%rdi - xorq %r10,%r14 - addq %r13,%r9 - xorq %r11,%rdi - rorq $28,%r14 - addq %r9,%rbx - addq %rdi,%r9 - movq %rbx,%r13 - addq %r9,%r14 - rorq $23,%r13 - movq %r14,%r9 - movq %rcx,%r12 - rorq $5,%r14 - xorq %rbx,%r13 - xorq %rdx,%r12 - rorq $4,%r13 - xorq %r9,%r14 - andq %rbx,%r12 - xorq %rbx,%r13 - addq 88(%rsp),%r8 - movq %r9,%rdi - xorq %rdx,%r12 - rorq $6,%r14 - xorq %r10,%rdi - addq %r12,%r8 - rorq $14,%r13 - andq %rdi,%r15 - xorq %r9,%r14 - addq %r13,%r8 - xorq %r10,%r15 - rorq $28,%r14 - addq %r8,%rax - addq %r15,%r8 - movq %rax,%r13 - addq %r8,%r14 - rorq $23,%r13 - movq %r14,%r8 - movq %rbx,%r12 - rorq $5,%r14 - xorq %rax,%r13 - xorq %rcx,%r12 - rorq $4,%r13 - xorq %r8,%r14 - andq %rax,%r12 - xorq %rax,%r13 - addq 96(%rsp),%rdx - movq %r8,%r15 - xorq %rcx,%r12 - rorq $6,%r14 - xorq %r9,%r15 - addq %r12,%rdx - rorq $14,%r13 - andq %r15,%rdi - xorq %r8,%r14 - addq %r13,%rdx - xorq %r9,%rdi - rorq $28,%r14 - addq %rdx,%r11 - addq %rdi,%rdx - movq %r11,%r13 - addq %rdx,%r14 - rorq $23,%r13 - movq %r14,%rdx - movq %rax,%r12 - rorq $5,%r14 - xorq %r11,%r13 - xorq %rbx,%r12 - rorq $4,%r13 - xorq %rdx,%r14 - andq %r11,%r12 - xorq %r11,%r13 - addq 104(%rsp),%rcx - movq %rdx,%rdi - xorq %rbx,%r12 - rorq $6,%r14 - xorq %r8,%rdi - addq %r12,%rcx - rorq $14,%r13 - andq %rdi,%r15 - xorq %rdx,%r14 - addq %r13,%rcx - xorq %r8,%r15 - rorq $28,%r14 - addq %rcx,%r10 - addq %r15,%rcx - movq %r10,%r13 - addq %rcx,%r14 - rorq $23,%r13 - movq %r14,%rcx - movq %r11,%r12 - rorq $5,%r14 - xorq %r10,%r13 - xorq %rax,%r12 - rorq $4,%r13 - xorq %rcx,%r14 - andq %r10,%r12 - xorq %r10,%r13 - addq 112(%rsp),%rbx - movq %rcx,%r15 - xorq %rax,%r12 - rorq $6,%r14 - xorq %rdx,%r15 - addq %r12,%rbx - rorq $14,%r13 - andq %r15,%rdi - xorq %rcx,%r14 - addq %r13,%rbx - xorq %rdx,%rdi - rorq $28,%r14 - addq %rbx,%r9 - addq %rdi,%rbx - movq %r9,%r13 - addq %rbx,%r14 - rorq $23,%r13 - movq %r14,%rbx - movq %r10,%r12 - rorq $5,%r14 - xorq %r9,%r13 - xorq %r11,%r12 - rorq $4,%r13 - xorq %rbx,%r14 - andq %r9,%r12 - xorq %r9,%r13 - addq 120(%rsp),%rax - movq %rbx,%rdi - xorq %r11,%r12 - rorq $6,%r14 - xorq %rcx,%rdi - addq %r12,%rax - rorq $14,%r13 - andq %rdi,%r15 - xorq %rbx,%r14 - addq %r13,%rax - xorq %rcx,%r15 - rorq $28,%r14 - addq %rax,%r8 - addq %r15,%rax - movq %r8,%r13 - addq %rax,%r14 - movq 128+0(%rsp),%rdi - movq %r14,%rax - - addq 0(%rdi),%rax - leaq 128(%rsi),%rsi - addq 8(%rdi),%rbx - addq 16(%rdi),%rcx - addq 24(%rdi),%rdx - addq 32(%rdi),%r8 - addq 40(%rdi),%r9 - addq 48(%rdi),%r10 - addq 56(%rdi),%r11 - - cmpq 128+16(%rsp),%rsi - - movq %rax,0(%rdi) - movq %rbx,8(%rdi) - movq %rcx,16(%rdi) - movq %rdx,24(%rdi) - movq %r8,32(%rdi) - movq %r9,40(%rdi) - movq %r10,48(%rdi) - movq %r11,56(%rdi) - jb L$loop_xop - - movq 128+24(%rsp),%rsi - vzeroupper - movq (%rsi),%r15 - movq 8(%rsi),%r14 - movq 16(%rsi),%r13 - movq 24(%rsi),%r12 - movq 32(%rsi),%rbp - movq 40(%rsi),%rbx - leaq 48(%rsi),%rsp -L$epilogue_xop: - .byte 0xf3,0xc3 - - -.p2align 6 -sha512_block_data_order_avx: -L$avx_shortcut: - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - movq %rsp,%r11 - shlq $4,%rdx - subq $160,%rsp - leaq (%rsi,%rdx,8),%rdx - andq $-64,%rsp - movq %rdi,128+0(%rsp) - movq %rsi,128+8(%rsp) - movq %rdx,128+16(%rsp) - movq %r11,128+24(%rsp) -L$prologue_avx: - - vzeroupper - movq 0(%rdi),%rax - movq 8(%rdi),%rbx - movq 16(%rdi),%rcx - movq 24(%rdi),%rdx - movq 32(%rdi),%r8 - movq 40(%rdi),%r9 - movq 48(%rdi),%r10 - movq 56(%rdi),%r11 - jmp L$loop_avx -.p2align 4 -L$loop_avx: - vmovdqa K512+1280(%rip),%xmm11 - vmovdqu 0(%rsi),%xmm0 - leaq K512+128(%rip),%rbp - vmovdqu 16(%rsi),%xmm1 - vmovdqu 32(%rsi),%xmm2 - vpshufb %xmm11,%xmm0,%xmm0 - vmovdqu 48(%rsi),%xmm3 - vpshufb %xmm11,%xmm1,%xmm1 - vmovdqu 64(%rsi),%xmm4 - vpshufb %xmm11,%xmm2,%xmm2 - vmovdqu 80(%rsi),%xmm5 - vpshufb %xmm11,%xmm3,%xmm3 - vmovdqu 96(%rsi),%xmm6 - vpshufb %xmm11,%xmm4,%xmm4 - vmovdqu 112(%rsi),%xmm7 - vpshufb %xmm11,%xmm5,%xmm5 - vpaddq -128(%rbp),%xmm0,%xmm8 - vpshufb %xmm11,%xmm6,%xmm6 - vpaddq -96(%rbp),%xmm1,%xmm9 - vpshufb %xmm11,%xmm7,%xmm7 - vpaddq -64(%rbp),%xmm2,%xmm10 - vpaddq -32(%rbp),%xmm3,%xmm11 - vmovdqa %xmm8,0(%rsp) - vpaddq 0(%rbp),%xmm4,%xmm8 - vmovdqa %xmm9,16(%rsp) - vpaddq 32(%rbp),%xmm5,%xmm9 - vmovdqa %xmm10,32(%rsp) - vpaddq 64(%rbp),%xmm6,%xmm10 - vmovdqa %xmm11,48(%rsp) - vpaddq 96(%rbp),%xmm7,%xmm11 - vmovdqa %xmm8,64(%rsp) - movq %rax,%r14 - vmovdqa %xmm9,80(%rsp) - movq %rbx,%rdi - vmovdqa %xmm10,96(%rsp) - xorq %rcx,%rdi - vmovdqa %xmm11,112(%rsp) - movq %r8,%r13 - jmp L$avx_00_47 - -.p2align 4 -L$avx_00_47: - addq $256,%rbp - vpalignr $8,%xmm0,%xmm1,%xmm8 - shrdq $23,%r13,%r13 - movq %r14,%rax - vpalignr $8,%xmm4,%xmm5,%xmm11 - movq %r9,%r12 - shrdq $5,%r14,%r14 - vpsrlq $1,%xmm8,%xmm10 - xorq %r8,%r13 - xorq %r10,%r12 - vpaddq %xmm11,%xmm0,%xmm0 - shrdq $4,%r13,%r13 - xorq %rax,%r14 - vpsrlq $7,%xmm8,%xmm11 - andq %r8,%r12 - xorq %r8,%r13 - vpsllq $56,%xmm8,%xmm9 - addq 0(%rsp),%r11 - movq %rax,%r15 - vpxor %xmm10,%xmm11,%xmm8 - xorq %r10,%r12 - shrdq $6,%r14,%r14 - vpsrlq $7,%xmm10,%xmm10 - xorq %rbx,%r15 - addq %r12,%r11 - vpxor %xmm9,%xmm8,%xmm8 - shrdq $14,%r13,%r13 - andq %r15,%rdi - vpsllq $7,%xmm9,%xmm9 - xorq %rax,%r14 - addq %r13,%r11 - vpxor %xmm10,%xmm8,%xmm8 - xorq %rbx,%rdi - shrdq $28,%r14,%r14 - vpsrlq $6,%xmm7,%xmm11 - addq %r11,%rdx - addq %rdi,%r11 - vpxor %xmm9,%xmm8,%xmm8 - movq %rdx,%r13 - addq %r11,%r14 - vpsllq $3,%xmm7,%xmm10 - shrdq $23,%r13,%r13 - movq %r14,%r11 - vpaddq %xmm8,%xmm0,%xmm0 - movq %r8,%r12 - shrdq $5,%r14,%r14 - vpsrlq $19,%xmm7,%xmm9 - xorq %rdx,%r13 - xorq %r9,%r12 - vpxor %xmm10,%xmm11,%xmm11 - shrdq $4,%r13,%r13 - xorq %r11,%r14 - vpsllq $42,%xmm10,%xmm10 - andq %rdx,%r12 - xorq %rdx,%r13 - vpxor %xmm9,%xmm11,%xmm11 - addq 8(%rsp),%r10 - movq %r11,%rdi - vpsrlq $42,%xmm9,%xmm9 - xorq %r9,%r12 - shrdq $6,%r14,%r14 - vpxor %xmm10,%xmm11,%xmm11 - xorq %rax,%rdi - addq %r12,%r10 - vpxor %xmm9,%xmm11,%xmm11 - shrdq $14,%r13,%r13 - andq %rdi,%r15 - vpaddq %xmm11,%xmm0,%xmm0 - xorq %r11,%r14 - addq %r13,%r10 - vpaddq -128(%rbp),%xmm0,%xmm10 - xorq %rax,%r15 - shrdq $28,%r14,%r14 - addq %r10,%rcx - addq %r15,%r10 - movq %rcx,%r13 - addq %r10,%r14 - vmovdqa %xmm10,0(%rsp) - vpalignr $8,%xmm1,%xmm2,%xmm8 - shrdq $23,%r13,%r13 - movq %r14,%r10 - vpalignr $8,%xmm5,%xmm6,%xmm11 - movq %rdx,%r12 - shrdq $5,%r14,%r14 - vpsrlq $1,%xmm8,%xmm10 - xorq %rcx,%r13 - xorq %r8,%r12 - vpaddq %xmm11,%xmm1,%xmm1 - shrdq $4,%r13,%r13 - xorq %r10,%r14 - vpsrlq $7,%xmm8,%xmm11 - andq %rcx,%r12 - xorq %rcx,%r13 - vpsllq $56,%xmm8,%xmm9 - addq 16(%rsp),%r9 - movq %r10,%r15 - vpxor %xmm10,%xmm11,%xmm8 - xorq %r8,%r12 - shrdq $6,%r14,%r14 - vpsrlq $7,%xmm10,%xmm10 - xorq %r11,%r15 - addq %r12,%r9 - vpxor %xmm9,%xmm8,%xmm8 - shrdq $14,%r13,%r13 - andq %r15,%rdi - vpsllq $7,%xmm9,%xmm9 - xorq %r10,%r14 - addq %r13,%r9 - vpxor %xmm10,%xmm8,%xmm8 - xorq %r11,%rdi - shrdq $28,%r14,%r14 - vpsrlq $6,%xmm0,%xmm11 - addq %r9,%rbx - addq %rdi,%r9 - vpxor %xmm9,%xmm8,%xmm8 - movq %rbx,%r13 - addq %r9,%r14 - vpsllq $3,%xmm0,%xmm10 - shrdq $23,%r13,%r13 - movq %r14,%r9 - vpaddq %xmm8,%xmm1,%xmm1 - movq %rcx,%r12 - shrdq $5,%r14,%r14 - vpsrlq $19,%xmm0,%xmm9 - xorq %rbx,%r13 - xorq %rdx,%r12 - vpxor %xmm10,%xmm11,%xmm11 - shrdq $4,%r13,%r13 - xorq %r9,%r14 - vpsllq $42,%xmm10,%xmm10 - andq %rbx,%r12 - xorq %rbx,%r13 - vpxor %xmm9,%xmm11,%xmm11 - addq 24(%rsp),%r8 - movq %r9,%rdi - vpsrlq $42,%xmm9,%xmm9 - xorq %rdx,%r12 - shrdq $6,%r14,%r14 - vpxor %xmm10,%xmm11,%xmm11 - xorq %r10,%rdi - addq %r12,%r8 - vpxor %xmm9,%xmm11,%xmm11 - shrdq $14,%r13,%r13 - andq %rdi,%r15 - vpaddq %xmm11,%xmm1,%xmm1 - xorq %r9,%r14 - addq %r13,%r8 - vpaddq -96(%rbp),%xmm1,%xmm10 - xorq %r10,%r15 - shrdq $28,%r14,%r14 - addq %r8,%rax - addq %r15,%r8 - movq %rax,%r13 - addq %r8,%r14 - vmovdqa %xmm10,16(%rsp) - vpalignr $8,%xmm2,%xmm3,%xmm8 - shrdq $23,%r13,%r13 - movq %r14,%r8 - vpalignr $8,%xmm6,%xmm7,%xmm11 - movq %rbx,%r12 - shrdq $5,%r14,%r14 - vpsrlq $1,%xmm8,%xmm10 - xorq %rax,%r13 - xorq %rcx,%r12 - vpaddq %xmm11,%xmm2,%xmm2 - shrdq $4,%r13,%r13 - xorq %r8,%r14 - vpsrlq $7,%xmm8,%xmm11 - andq %rax,%r12 - xorq %rax,%r13 - vpsllq $56,%xmm8,%xmm9 - addq 32(%rsp),%rdx - movq %r8,%r15 - vpxor %xmm10,%xmm11,%xmm8 - xorq %rcx,%r12 - shrdq $6,%r14,%r14 - vpsrlq $7,%xmm10,%xmm10 - xorq %r9,%r15 - addq %r12,%rdx - vpxor %xmm9,%xmm8,%xmm8 - shrdq $14,%r13,%r13 - andq %r15,%rdi - vpsllq $7,%xmm9,%xmm9 - xorq %r8,%r14 - addq %r13,%rdx - vpxor %xmm10,%xmm8,%xmm8 - xorq %r9,%rdi - shrdq $28,%r14,%r14 - vpsrlq $6,%xmm1,%xmm11 - addq %rdx,%r11 - addq %rdi,%rdx - vpxor %xmm9,%xmm8,%xmm8 - movq %r11,%r13 - addq %rdx,%r14 - vpsllq $3,%xmm1,%xmm10 - shrdq $23,%r13,%r13 - movq %r14,%rdx - vpaddq %xmm8,%xmm2,%xmm2 - movq %rax,%r12 - shrdq $5,%r14,%r14 - vpsrlq $19,%xmm1,%xmm9 - xorq %r11,%r13 - xorq %rbx,%r12 - vpxor %xmm10,%xmm11,%xmm11 - shrdq $4,%r13,%r13 - xorq %rdx,%r14 - vpsllq $42,%xmm10,%xmm10 - andq %r11,%r12 - xorq %r11,%r13 - vpxor %xmm9,%xmm11,%xmm11 - addq 40(%rsp),%rcx - movq %rdx,%rdi - vpsrlq $42,%xmm9,%xmm9 - xorq %rbx,%r12 - shrdq $6,%r14,%r14 - vpxor %xmm10,%xmm11,%xmm11 - xorq %r8,%rdi - addq %r12,%rcx - vpxor %xmm9,%xmm11,%xmm11 - shrdq $14,%r13,%r13 - andq %rdi,%r15 - vpaddq %xmm11,%xmm2,%xmm2 - xorq %rdx,%r14 - addq %r13,%rcx - vpaddq -64(%rbp),%xmm2,%xmm10 - xorq %r8,%r15 - shrdq $28,%r14,%r14 - addq %rcx,%r10 - addq %r15,%rcx - movq %r10,%r13 - addq %rcx,%r14 - vmovdqa %xmm10,32(%rsp) - vpalignr $8,%xmm3,%xmm4,%xmm8 - shrdq $23,%r13,%r13 - movq %r14,%rcx - vpalignr $8,%xmm7,%xmm0,%xmm11 - movq %r11,%r12 - shrdq $5,%r14,%r14 - vpsrlq $1,%xmm8,%xmm10 - xorq %r10,%r13 - xorq %rax,%r12 - vpaddq %xmm11,%xmm3,%xmm3 - shrdq $4,%r13,%r13 - xorq %rcx,%r14 - vpsrlq $7,%xmm8,%xmm11 - andq %r10,%r12 - xorq %r10,%r13 - vpsllq $56,%xmm8,%xmm9 - addq 48(%rsp),%rbx - movq %rcx,%r15 - vpxor %xmm10,%xmm11,%xmm8 - xorq %rax,%r12 - shrdq $6,%r14,%r14 - vpsrlq $7,%xmm10,%xmm10 - xorq %rdx,%r15 - addq %r12,%rbx - vpxor %xmm9,%xmm8,%xmm8 - shrdq $14,%r13,%r13 - andq %r15,%rdi - vpsllq $7,%xmm9,%xmm9 - xorq %rcx,%r14 - addq %r13,%rbx - vpxor %xmm10,%xmm8,%xmm8 - xorq %rdx,%rdi - shrdq $28,%r14,%r14 - vpsrlq $6,%xmm2,%xmm11 - addq %rbx,%r9 - addq %rdi,%rbx - vpxor %xmm9,%xmm8,%xmm8 - movq %r9,%r13 - addq %rbx,%r14 - vpsllq $3,%xmm2,%xmm10 - shrdq $23,%r13,%r13 - movq %r14,%rbx - vpaddq %xmm8,%xmm3,%xmm3 - movq %r10,%r12 - shrdq $5,%r14,%r14 - vpsrlq $19,%xmm2,%xmm9 - xorq %r9,%r13 - xorq %r11,%r12 - vpxor %xmm10,%xmm11,%xmm11 - shrdq $4,%r13,%r13 - xorq %rbx,%r14 - vpsllq $42,%xmm10,%xmm10 - andq %r9,%r12 - xorq %r9,%r13 - vpxor %xmm9,%xmm11,%xmm11 - addq 56(%rsp),%rax - movq %rbx,%rdi - vpsrlq $42,%xmm9,%xmm9 - xorq %r11,%r12 - shrdq $6,%r14,%r14 - vpxor %xmm10,%xmm11,%xmm11 - xorq %rcx,%rdi - addq %r12,%rax - vpxor %xmm9,%xmm11,%xmm11 - shrdq $14,%r13,%r13 - andq %rdi,%r15 - vpaddq %xmm11,%xmm3,%xmm3 - xorq %rbx,%r14 - addq %r13,%rax - vpaddq -32(%rbp),%xmm3,%xmm10 - xorq %rcx,%r15 - shrdq $28,%r14,%r14 - addq %rax,%r8 - addq %r15,%rax - movq %r8,%r13 - addq %rax,%r14 - vmovdqa %xmm10,48(%rsp) - vpalignr $8,%xmm4,%xmm5,%xmm8 - shrdq $23,%r13,%r13 - movq %r14,%rax - vpalignr $8,%xmm0,%xmm1,%xmm11 - movq %r9,%r12 - shrdq $5,%r14,%r14 - vpsrlq $1,%xmm8,%xmm10 - xorq %r8,%r13 - xorq %r10,%r12 - vpaddq %xmm11,%xmm4,%xmm4 - shrdq $4,%r13,%r13 - xorq %rax,%r14 - vpsrlq $7,%xmm8,%xmm11 - andq %r8,%r12 - xorq %r8,%r13 - vpsllq $56,%xmm8,%xmm9 - addq 64(%rsp),%r11 - movq %rax,%r15 - vpxor %xmm10,%xmm11,%xmm8 - xorq %r10,%r12 - shrdq $6,%r14,%r14 - vpsrlq $7,%xmm10,%xmm10 - xorq %rbx,%r15 - addq %r12,%r11 - vpxor %xmm9,%xmm8,%xmm8 - shrdq $14,%r13,%r13 - andq %r15,%rdi - vpsllq $7,%xmm9,%xmm9 - xorq %rax,%r14 - addq %r13,%r11 - vpxor %xmm10,%xmm8,%xmm8 - xorq %rbx,%rdi - shrdq $28,%r14,%r14 - vpsrlq $6,%xmm3,%xmm11 - addq %r11,%rdx - addq %rdi,%r11 - vpxor %xmm9,%xmm8,%xmm8 - movq %rdx,%r13 - addq %r11,%r14 - vpsllq $3,%xmm3,%xmm10 - shrdq $23,%r13,%r13 - movq %r14,%r11 - vpaddq %xmm8,%xmm4,%xmm4 - movq %r8,%r12 - shrdq $5,%r14,%r14 - vpsrlq $19,%xmm3,%xmm9 - xorq %rdx,%r13 - xorq %r9,%r12 - vpxor %xmm10,%xmm11,%xmm11 - shrdq $4,%r13,%r13 - xorq %r11,%r14 - vpsllq $42,%xmm10,%xmm10 - andq %rdx,%r12 - xorq %rdx,%r13 - vpxor %xmm9,%xmm11,%xmm11 - addq 72(%rsp),%r10 - movq %r11,%rdi - vpsrlq $42,%xmm9,%xmm9 - xorq %r9,%r12 - shrdq $6,%r14,%r14 - vpxor %xmm10,%xmm11,%xmm11 - xorq %rax,%rdi - addq %r12,%r10 - vpxor %xmm9,%xmm11,%xmm11 - shrdq $14,%r13,%r13 - andq %rdi,%r15 - vpaddq %xmm11,%xmm4,%xmm4 - xorq %r11,%r14 - addq %r13,%r10 - vpaddq 0(%rbp),%xmm4,%xmm10 - xorq %rax,%r15 - shrdq $28,%r14,%r14 - addq %r10,%rcx - addq %r15,%r10 - movq %rcx,%r13 - addq %r10,%r14 - vmovdqa %xmm10,64(%rsp) - vpalignr $8,%xmm5,%xmm6,%xmm8 - shrdq $23,%r13,%r13 - movq %r14,%r10 - vpalignr $8,%xmm1,%xmm2,%xmm11 - movq %rdx,%r12 - shrdq $5,%r14,%r14 - vpsrlq $1,%xmm8,%xmm10 - xorq %rcx,%r13 - xorq %r8,%r12 - vpaddq %xmm11,%xmm5,%xmm5 - shrdq $4,%r13,%r13 - xorq %r10,%r14 - vpsrlq $7,%xmm8,%xmm11 - andq %rcx,%r12 - xorq %rcx,%r13 - vpsllq $56,%xmm8,%xmm9 - addq 80(%rsp),%r9 - movq %r10,%r15 - vpxor %xmm10,%xmm11,%xmm8 - xorq %r8,%r12 - shrdq $6,%r14,%r14 - vpsrlq $7,%xmm10,%xmm10 - xorq %r11,%r15 - addq %r12,%r9 - vpxor %xmm9,%xmm8,%xmm8 - shrdq $14,%r13,%r13 - andq %r15,%rdi - vpsllq $7,%xmm9,%xmm9 - xorq %r10,%r14 - addq %r13,%r9 - vpxor %xmm10,%xmm8,%xmm8 - xorq %r11,%rdi - shrdq $28,%r14,%r14 - vpsrlq $6,%xmm4,%xmm11 - addq %r9,%rbx - addq %rdi,%r9 - vpxor %xmm9,%xmm8,%xmm8 - movq %rbx,%r13 - addq %r9,%r14 - vpsllq $3,%xmm4,%xmm10 - shrdq $23,%r13,%r13 - movq %r14,%r9 - vpaddq %xmm8,%xmm5,%xmm5 - movq %rcx,%r12 - shrdq $5,%r14,%r14 - vpsrlq $19,%xmm4,%xmm9 - xorq %rbx,%r13 - xorq %rdx,%r12 - vpxor %xmm10,%xmm11,%xmm11 - shrdq $4,%r13,%r13 - xorq %r9,%r14 - vpsllq $42,%xmm10,%xmm10 - andq %rbx,%r12 - xorq %rbx,%r13 - vpxor %xmm9,%xmm11,%xmm11 - addq 88(%rsp),%r8 - movq %r9,%rdi - vpsrlq $42,%xmm9,%xmm9 - xorq %rdx,%r12 - shrdq $6,%r14,%r14 - vpxor %xmm10,%xmm11,%xmm11 - xorq %r10,%rdi - addq %r12,%r8 - vpxor %xmm9,%xmm11,%xmm11 - shrdq $14,%r13,%r13 - andq %rdi,%r15 - vpaddq %xmm11,%xmm5,%xmm5 - xorq %r9,%r14 - addq %r13,%r8 - vpaddq 32(%rbp),%xmm5,%xmm10 - xorq %r10,%r15 - shrdq $28,%r14,%r14 - addq %r8,%rax - addq %r15,%r8 - movq %rax,%r13 - addq %r8,%r14 - vmovdqa %xmm10,80(%rsp) - vpalignr $8,%xmm6,%xmm7,%xmm8 - shrdq $23,%r13,%r13 - movq %r14,%r8 - vpalignr $8,%xmm2,%xmm3,%xmm11 - movq %rbx,%r12 - shrdq $5,%r14,%r14 - vpsrlq $1,%xmm8,%xmm10 - xorq %rax,%r13 - xorq %rcx,%r12 - vpaddq %xmm11,%xmm6,%xmm6 - shrdq $4,%r13,%r13 - xorq %r8,%r14 - vpsrlq $7,%xmm8,%xmm11 - andq %rax,%r12 - xorq %rax,%r13 - vpsllq $56,%xmm8,%xmm9 - addq 96(%rsp),%rdx - movq %r8,%r15 - vpxor %xmm10,%xmm11,%xmm8 - xorq %rcx,%r12 - shrdq $6,%r14,%r14 - vpsrlq $7,%xmm10,%xmm10 - xorq %r9,%r15 - addq %r12,%rdx - vpxor %xmm9,%xmm8,%xmm8 - shrdq $14,%r13,%r13 - andq %r15,%rdi - vpsllq $7,%xmm9,%xmm9 - xorq %r8,%r14 - addq %r13,%rdx - vpxor %xmm10,%xmm8,%xmm8 - xorq %r9,%rdi - shrdq $28,%r14,%r14 - vpsrlq $6,%xmm5,%xmm11 - addq %rdx,%r11 - addq %rdi,%rdx - vpxor %xmm9,%xmm8,%xmm8 - movq %r11,%r13 - addq %rdx,%r14 - vpsllq $3,%xmm5,%xmm10 - shrdq $23,%r13,%r13 - movq %r14,%rdx - vpaddq %xmm8,%xmm6,%xmm6 - movq %rax,%r12 - shrdq $5,%r14,%r14 - vpsrlq $19,%xmm5,%xmm9 - xorq %r11,%r13 - xorq %rbx,%r12 - vpxor %xmm10,%xmm11,%xmm11 - shrdq $4,%r13,%r13 - xorq %rdx,%r14 - vpsllq $42,%xmm10,%xmm10 - andq %r11,%r12 - xorq %r11,%r13 - vpxor %xmm9,%xmm11,%xmm11 - addq 104(%rsp),%rcx - movq %rdx,%rdi - vpsrlq $42,%xmm9,%xmm9 - xorq %rbx,%r12 - shrdq $6,%r14,%r14 - vpxor %xmm10,%xmm11,%xmm11 - xorq %r8,%rdi - addq %r12,%rcx - vpxor %xmm9,%xmm11,%xmm11 - shrdq $14,%r13,%r13 - andq %rdi,%r15 - vpaddq %xmm11,%xmm6,%xmm6 - xorq %rdx,%r14 - addq %r13,%rcx - vpaddq 64(%rbp),%xmm6,%xmm10 - xorq %r8,%r15 - shrdq $28,%r14,%r14 - addq %rcx,%r10 - addq %r15,%rcx - movq %r10,%r13 - addq %rcx,%r14 - vmovdqa %xmm10,96(%rsp) - vpalignr $8,%xmm7,%xmm0,%xmm8 - shrdq $23,%r13,%r13 - movq %r14,%rcx - vpalignr $8,%xmm3,%xmm4,%xmm11 - movq %r11,%r12 - shrdq $5,%r14,%r14 - vpsrlq $1,%xmm8,%xmm10 - xorq %r10,%r13 - xorq %rax,%r12 - vpaddq %xmm11,%xmm7,%xmm7 - shrdq $4,%r13,%r13 - xorq %rcx,%r14 - vpsrlq $7,%xmm8,%xmm11 - andq %r10,%r12 - xorq %r10,%r13 - vpsllq $56,%xmm8,%xmm9 - addq 112(%rsp),%rbx - movq %rcx,%r15 - vpxor %xmm10,%xmm11,%xmm8 - xorq %rax,%r12 - shrdq $6,%r14,%r14 - vpsrlq $7,%xmm10,%xmm10 - xorq %rdx,%r15 - addq %r12,%rbx - vpxor %xmm9,%xmm8,%xmm8 - shrdq $14,%r13,%r13 - andq %r15,%rdi - vpsllq $7,%xmm9,%xmm9 - xorq %rcx,%r14 - addq %r13,%rbx - vpxor %xmm10,%xmm8,%xmm8 - xorq %rdx,%rdi - shrdq $28,%r14,%r14 - vpsrlq $6,%xmm6,%xmm11 - addq %rbx,%r9 - addq %rdi,%rbx - vpxor %xmm9,%xmm8,%xmm8 - movq %r9,%r13 - addq %rbx,%r14 - vpsllq $3,%xmm6,%xmm10 - shrdq $23,%r13,%r13 - movq %r14,%rbx - vpaddq %xmm8,%xmm7,%xmm7 - movq %r10,%r12 - shrdq $5,%r14,%r14 - vpsrlq $19,%xmm6,%xmm9 - xorq %r9,%r13 - xorq %r11,%r12 - vpxor %xmm10,%xmm11,%xmm11 - shrdq $4,%r13,%r13 - xorq %rbx,%r14 - vpsllq $42,%xmm10,%xmm10 - andq %r9,%r12 - xorq %r9,%r13 - vpxor %xmm9,%xmm11,%xmm11 - addq 120(%rsp),%rax - movq %rbx,%rdi - vpsrlq $42,%xmm9,%xmm9 - xorq %r11,%r12 - shrdq $6,%r14,%r14 - vpxor %xmm10,%xmm11,%xmm11 - xorq %rcx,%rdi - addq %r12,%rax - vpxor %xmm9,%xmm11,%xmm11 - shrdq $14,%r13,%r13 - andq %rdi,%r15 - vpaddq %xmm11,%xmm7,%xmm7 - xorq %rbx,%r14 - addq %r13,%rax - vpaddq 96(%rbp),%xmm7,%xmm10 - xorq %rcx,%r15 - shrdq $28,%r14,%r14 - addq %rax,%r8 - addq %r15,%rax - movq %r8,%r13 - addq %rax,%r14 - vmovdqa %xmm10,112(%rsp) - cmpb $0,135(%rbp) - jne L$avx_00_47 - shrdq $23,%r13,%r13 - movq %r14,%rax - movq %r9,%r12 - shrdq $5,%r14,%r14 - xorq %r8,%r13 - xorq %r10,%r12 - shrdq $4,%r13,%r13 - xorq %rax,%r14 - andq %r8,%r12 - xorq %r8,%r13 - addq 0(%rsp),%r11 - movq %rax,%r15 - xorq %r10,%r12 - shrdq $6,%r14,%r14 - xorq %rbx,%r15 - addq %r12,%r11 - shrdq $14,%r13,%r13 - andq %r15,%rdi - xorq %rax,%r14 - addq %r13,%r11 - xorq %rbx,%rdi - shrdq $28,%r14,%r14 - addq %r11,%rdx - addq %rdi,%r11 - movq %rdx,%r13 - addq %r11,%r14 - shrdq $23,%r13,%r13 - movq %r14,%r11 - movq %r8,%r12 - shrdq $5,%r14,%r14 - xorq %rdx,%r13 - xorq %r9,%r12 - shrdq $4,%r13,%r13 - xorq %r11,%r14 - andq %rdx,%r12 - xorq %rdx,%r13 - addq 8(%rsp),%r10 - movq %r11,%rdi - xorq %r9,%r12 - shrdq $6,%r14,%r14 - xorq %rax,%rdi - addq %r12,%r10 - shrdq $14,%r13,%r13 - andq %rdi,%r15 - xorq %r11,%r14 - addq %r13,%r10 - xorq %rax,%r15 - shrdq $28,%r14,%r14 - addq %r10,%rcx - addq %r15,%r10 - movq %rcx,%r13 - addq %r10,%r14 - shrdq $23,%r13,%r13 - movq %r14,%r10 - movq %rdx,%r12 - shrdq $5,%r14,%r14 - xorq %rcx,%r13 - xorq %r8,%r12 - shrdq $4,%r13,%r13 - xorq %r10,%r14 - andq %rcx,%r12 - xorq %rcx,%r13 - addq 16(%rsp),%r9 - movq %r10,%r15 - xorq %r8,%r12 - shrdq $6,%r14,%r14 - xorq %r11,%r15 - addq %r12,%r9 - shrdq $14,%r13,%r13 - andq %r15,%rdi - xorq %r10,%r14 - addq %r13,%r9 - xorq %r11,%rdi - shrdq $28,%r14,%r14 - addq %r9,%rbx - addq %rdi,%r9 - movq %rbx,%r13 - addq %r9,%r14 - shrdq $23,%r13,%r13 - movq %r14,%r9 - movq %rcx,%r12 - shrdq $5,%r14,%r14 - xorq %rbx,%r13 - xorq %rdx,%r12 - shrdq $4,%r13,%r13 - xorq %r9,%r14 - andq %rbx,%r12 - xorq %rbx,%r13 - addq 24(%rsp),%r8 - movq %r9,%rdi - xorq %rdx,%r12 - shrdq $6,%r14,%r14 - xorq %r10,%rdi - addq %r12,%r8 - shrdq $14,%r13,%r13 - andq %rdi,%r15 - xorq %r9,%r14 - addq %r13,%r8 - xorq %r10,%r15 - shrdq $28,%r14,%r14 - addq %r8,%rax - addq %r15,%r8 - movq %rax,%r13 - addq %r8,%r14 - shrdq $23,%r13,%r13 - movq %r14,%r8 - movq %rbx,%r12 - shrdq $5,%r14,%r14 - xorq %rax,%r13 - xorq %rcx,%r12 - shrdq $4,%r13,%r13 - xorq %r8,%r14 - andq %rax,%r12 - xorq %rax,%r13 - addq 32(%rsp),%rdx - movq %r8,%r15 - xorq %rcx,%r12 - shrdq $6,%r14,%r14 - xorq %r9,%r15 - addq %r12,%rdx - shrdq $14,%r13,%r13 - andq %r15,%rdi - xorq %r8,%r14 - addq %r13,%rdx - xorq %r9,%rdi - shrdq $28,%r14,%r14 - addq %rdx,%r11 - addq %rdi,%rdx - movq %r11,%r13 - addq %rdx,%r14 - shrdq $23,%r13,%r13 - movq %r14,%rdx - movq %rax,%r12 - shrdq $5,%r14,%r14 - xorq %r11,%r13 - xorq %rbx,%r12 - shrdq $4,%r13,%r13 - xorq %rdx,%r14 - andq %r11,%r12 - xorq %r11,%r13 - addq 40(%rsp),%rcx - movq %rdx,%rdi - xorq %rbx,%r12 - shrdq $6,%r14,%r14 - xorq %r8,%rdi - addq %r12,%rcx - shrdq $14,%r13,%r13 - andq %rdi,%r15 - xorq %rdx,%r14 - addq %r13,%rcx - xorq %r8,%r15 - shrdq $28,%r14,%r14 - addq %rcx,%r10 - addq %r15,%rcx - movq %r10,%r13 - addq %rcx,%r14 - shrdq $23,%r13,%r13 - movq %r14,%rcx - movq %r11,%r12 - shrdq $5,%r14,%r14 - xorq %r10,%r13 - xorq %rax,%r12 - shrdq $4,%r13,%r13 - xorq %rcx,%r14 - andq %r10,%r12 - xorq %r10,%r13 - addq 48(%rsp),%rbx - movq %rcx,%r15 - xorq %rax,%r12 - shrdq $6,%r14,%r14 - xorq %rdx,%r15 - addq %r12,%rbx - shrdq $14,%r13,%r13 - andq %r15,%rdi - xorq %rcx,%r14 - addq %r13,%rbx - xorq %rdx,%rdi - shrdq $28,%r14,%r14 - addq %rbx,%r9 - addq %rdi,%rbx - movq %r9,%r13 - addq %rbx,%r14 - shrdq $23,%r13,%r13 - movq %r14,%rbx - movq %r10,%r12 - shrdq $5,%r14,%r14 - xorq %r9,%r13 - xorq %r11,%r12 - shrdq $4,%r13,%r13 - xorq %rbx,%r14 - andq %r9,%r12 - xorq %r9,%r13 - addq 56(%rsp),%rax - movq %rbx,%rdi - xorq %r11,%r12 - shrdq $6,%r14,%r14 - xorq %rcx,%rdi - addq %r12,%rax - shrdq $14,%r13,%r13 - andq %rdi,%r15 - xorq %rbx,%r14 - addq %r13,%rax - xorq %rcx,%r15 - shrdq $28,%r14,%r14 - addq %rax,%r8 - addq %r15,%rax - movq %r8,%r13 - addq %rax,%r14 - shrdq $23,%r13,%r13 - movq %r14,%rax - movq %r9,%r12 - shrdq $5,%r14,%r14 - xorq %r8,%r13 - xorq %r10,%r12 - shrdq $4,%r13,%r13 - xorq %rax,%r14 - andq %r8,%r12 - xorq %r8,%r13 - addq 64(%rsp),%r11 - movq %rax,%r15 - xorq %r10,%r12 - shrdq $6,%r14,%r14 - xorq %rbx,%r15 - addq %r12,%r11 - shrdq $14,%r13,%r13 - andq %r15,%rdi - xorq %rax,%r14 - addq %r13,%r11 - xorq %rbx,%rdi - shrdq $28,%r14,%r14 - addq %r11,%rdx - addq %rdi,%r11 - movq %rdx,%r13 - addq %r11,%r14 - shrdq $23,%r13,%r13 - movq %r14,%r11 - movq %r8,%r12 - shrdq $5,%r14,%r14 - xorq %rdx,%r13 - xorq %r9,%r12 - shrdq $4,%r13,%r13 - xorq %r11,%r14 - andq %rdx,%r12 - xorq %rdx,%r13 - addq 72(%rsp),%r10 - movq %r11,%rdi - xorq %r9,%r12 - shrdq $6,%r14,%r14 - xorq %rax,%rdi - addq %r12,%r10 - shrdq $14,%r13,%r13 - andq %rdi,%r15 - xorq %r11,%r14 - addq %r13,%r10 - xorq %rax,%r15 - shrdq $28,%r14,%r14 - addq %r10,%rcx - addq %r15,%r10 - movq %rcx,%r13 - addq %r10,%r14 - shrdq $23,%r13,%r13 - movq %r14,%r10 - movq %rdx,%r12 - shrdq $5,%r14,%r14 - xorq %rcx,%r13 - xorq %r8,%r12 - shrdq $4,%r13,%r13 - xorq %r10,%r14 - andq %rcx,%r12 - xorq %rcx,%r13 - addq 80(%rsp),%r9 - movq %r10,%r15 - xorq %r8,%r12 - shrdq $6,%r14,%r14 - xorq %r11,%r15 - addq %r12,%r9 - shrdq $14,%r13,%r13 - andq %r15,%rdi - xorq %r10,%r14 - addq %r13,%r9 - xorq %r11,%rdi - shrdq $28,%r14,%r14 - addq %r9,%rbx - addq %rdi,%r9 - movq %rbx,%r13 - addq %r9,%r14 - shrdq $23,%r13,%r13 - movq %r14,%r9 - movq %rcx,%r12 - shrdq $5,%r14,%r14 - xorq %rbx,%r13 - xorq %rdx,%r12 - shrdq $4,%r13,%r13 - xorq %r9,%r14 - andq %rbx,%r12 - xorq %rbx,%r13 - addq 88(%rsp),%r8 - movq %r9,%rdi - xorq %rdx,%r12 - shrdq $6,%r14,%r14 - xorq %r10,%rdi - addq %r12,%r8 - shrdq $14,%r13,%r13 - andq %rdi,%r15 - xorq %r9,%r14 - addq %r13,%r8 - xorq %r10,%r15 - shrdq $28,%r14,%r14 - addq %r8,%rax - addq %r15,%r8 - movq %rax,%r13 - addq %r8,%r14 - shrdq $23,%r13,%r13 - movq %r14,%r8 - movq %rbx,%r12 - shrdq $5,%r14,%r14 - xorq %rax,%r13 - xorq %rcx,%r12 - shrdq $4,%r13,%r13 - xorq %r8,%r14 - andq %rax,%r12 - xorq %rax,%r13 - addq 96(%rsp),%rdx - movq %r8,%r15 - xorq %rcx,%r12 - shrdq $6,%r14,%r14 - xorq %r9,%r15 - addq %r12,%rdx - shrdq $14,%r13,%r13 - andq %r15,%rdi - xorq %r8,%r14 - addq %r13,%rdx - xorq %r9,%rdi - shrdq $28,%r14,%r14 - addq %rdx,%r11 - addq %rdi,%rdx - movq %r11,%r13 - addq %rdx,%r14 - shrdq $23,%r13,%r13 - movq %r14,%rdx - movq %rax,%r12 - shrdq $5,%r14,%r14 - xorq %r11,%r13 - xorq %rbx,%r12 - shrdq $4,%r13,%r13 - xorq %rdx,%r14 - andq %r11,%r12 - xorq %r11,%r13 - addq 104(%rsp),%rcx - movq %rdx,%rdi - xorq %rbx,%r12 - shrdq $6,%r14,%r14 - xorq %r8,%rdi - addq %r12,%rcx - shrdq $14,%r13,%r13 - andq %rdi,%r15 - xorq %rdx,%r14 - addq %r13,%rcx - xorq %r8,%r15 - shrdq $28,%r14,%r14 - addq %rcx,%r10 - addq %r15,%rcx - movq %r10,%r13 - addq %rcx,%r14 - shrdq $23,%r13,%r13 - movq %r14,%rcx - movq %r11,%r12 - shrdq $5,%r14,%r14 - xorq %r10,%r13 - xorq %rax,%r12 - shrdq $4,%r13,%r13 - xorq %rcx,%r14 - andq %r10,%r12 - xorq %r10,%r13 - addq 112(%rsp),%rbx - movq %rcx,%r15 - xorq %rax,%r12 - shrdq $6,%r14,%r14 - xorq %rdx,%r15 - addq %r12,%rbx - shrdq $14,%r13,%r13 - andq %r15,%rdi - xorq %rcx,%r14 - addq %r13,%rbx - xorq %rdx,%rdi - shrdq $28,%r14,%r14 - addq %rbx,%r9 - addq %rdi,%rbx - movq %r9,%r13 - addq %rbx,%r14 - shrdq $23,%r13,%r13 - movq %r14,%rbx - movq %r10,%r12 - shrdq $5,%r14,%r14 - xorq %r9,%r13 - xorq %r11,%r12 - shrdq $4,%r13,%r13 - xorq %rbx,%r14 - andq %r9,%r12 - xorq %r9,%r13 - addq 120(%rsp),%rax - movq %rbx,%rdi - xorq %r11,%r12 - shrdq $6,%r14,%r14 - xorq %rcx,%rdi - addq %r12,%rax - shrdq $14,%r13,%r13 - andq %rdi,%r15 - xorq %rbx,%r14 - addq %r13,%rax - xorq %rcx,%r15 - shrdq $28,%r14,%r14 - addq %rax,%r8 - addq %r15,%rax - movq %r8,%r13 - addq %rax,%r14 - movq 128+0(%rsp),%rdi - movq %r14,%rax - - addq 0(%rdi),%rax - leaq 128(%rsi),%rsi - addq 8(%rdi),%rbx - addq 16(%rdi),%rcx - addq 24(%rdi),%rdx - addq 32(%rdi),%r8 - addq 40(%rdi),%r9 - addq 48(%rdi),%r10 - addq 56(%rdi),%r11 - - cmpq 128+16(%rsp),%rsi - - movq %rax,0(%rdi) - movq %rbx,8(%rdi) - movq %rcx,16(%rdi) - movq %rdx,24(%rdi) - movq %r8,32(%rdi) - movq %r9,40(%rdi) - movq %r10,48(%rdi) - movq %r11,56(%rdi) - jb L$loop_avx - - movq 128+24(%rsp),%rsi - vzeroupper - movq (%rsi),%r15 - movq 8(%rsi),%r14 - movq 16(%rsi),%r13 - movq 24(%rsi),%r12 - movq 32(%rsi),%rbp - movq 40(%rsi),%rbx - leaq 48(%rsi),%rsp -L$epilogue_avx: - .byte 0xf3,0xc3 - - -.p2align 6 -sha512_block_data_order_avx2: -L$avx2_shortcut: - pushq %rbx - pushq %rbp - pushq %r12 - pushq %r13 - pushq %r14 - pushq %r15 - movq %rsp,%r11 - subq $1312,%rsp - shlq $4,%rdx - andq $-2048,%rsp - leaq (%rsi,%rdx,8),%rdx - addq $1152,%rsp - movq %rdi,128+0(%rsp) - movq %rsi,128+8(%rsp) - movq %rdx,128+16(%rsp) - movq %r11,128+24(%rsp) -L$prologue_avx2: - - vzeroupper - subq $-128,%rsi - movq 0(%rdi),%rax - movq %rsi,%r12 - movq 8(%rdi),%rbx - cmpq %rdx,%rsi - movq 16(%rdi),%rcx - cmoveq %rsp,%r12 - movq 24(%rdi),%rdx - movq 32(%rdi),%r8 - movq 40(%rdi),%r9 - movq 48(%rdi),%r10 - movq 56(%rdi),%r11 - jmp L$oop_avx2 -.p2align 4 -L$oop_avx2: - vmovdqu -128(%rsi),%xmm0 - vmovdqu -128+16(%rsi),%xmm1 - vmovdqu -128+32(%rsi),%xmm2 - leaq K512+128(%rip),%rbp - vmovdqu -128+48(%rsi),%xmm3 - vmovdqu -128+64(%rsi),%xmm4 - vmovdqu -128+80(%rsi),%xmm5 - vmovdqu -128+96(%rsi),%xmm6 - vmovdqu -128+112(%rsi),%xmm7 - - vmovdqa 1152(%rbp),%ymm10 - vinserti128 $1,(%r12),%ymm0,%ymm0 - vinserti128 $1,16(%r12),%ymm1,%ymm1 - vpshufb %ymm10,%ymm0,%ymm0 - vinserti128 $1,32(%r12),%ymm2,%ymm2 - vpshufb %ymm10,%ymm1,%ymm1 - vinserti128 $1,48(%r12),%ymm3,%ymm3 - vpshufb %ymm10,%ymm2,%ymm2 - vinserti128 $1,64(%r12),%ymm4,%ymm4 - vpshufb %ymm10,%ymm3,%ymm3 - vinserti128 $1,80(%r12),%ymm5,%ymm5 - vpshufb %ymm10,%ymm4,%ymm4 - vinserti128 $1,96(%r12),%ymm6,%ymm6 - vpshufb %ymm10,%ymm5,%ymm5 - vinserti128 $1,112(%r12),%ymm7,%ymm7 - - vpaddq -128(%rbp),%ymm0,%ymm8 - vpshufb %ymm10,%ymm6,%ymm6 - vpaddq -96(%rbp),%ymm1,%ymm9 - vpshufb %ymm10,%ymm7,%ymm7 - vpaddq -64(%rbp),%ymm2,%ymm10 - vpaddq -32(%rbp),%ymm3,%ymm11 - vmovdqa %ymm8,0(%rsp) - vpaddq 0(%rbp),%ymm4,%ymm8 - vmovdqa %ymm9,32(%rsp) - vpaddq 32(%rbp),%ymm5,%ymm9 - vmovdqa %ymm10,64(%rsp) - vpaddq 64(%rbp),%ymm6,%ymm10 - vmovdqa %ymm11,96(%rsp) - leaq -128(%rsp),%rsp - vpaddq 96(%rbp),%ymm7,%ymm11 - vmovdqa %ymm8,0(%rsp) - xorq %r14,%r14 - vmovdqa %ymm9,32(%rsp) - movq %rbx,%rdi - vmovdqa %ymm10,64(%rsp) - xorq %rcx,%rdi - vmovdqa %ymm11,96(%rsp) - movq %r9,%r12 - addq $32*8,%rbp - jmp L$avx2_00_47 - -.p2align 4 -L$avx2_00_47: - leaq -128(%rsp),%rsp - vpalignr $8,%ymm0,%ymm1,%ymm8 - addq 0+256(%rsp),%r11 - andq %r8,%r12 - rorxq $41,%r8,%r13 - vpalignr $8,%ymm4,%ymm5,%ymm11 - rorxq $18,%r8,%r15 - leaq (%rax,%r14,1),%rax - leaq (%r11,%r12,1),%r11 - vpsrlq $1,%ymm8,%ymm10 - andnq %r10,%r8,%r12 - xorq %r15,%r13 - rorxq $14,%r8,%r14 - vpaddq %ymm11,%ymm0,%ymm0 - vpsrlq $7,%ymm8,%ymm11 - leaq (%r11,%r12,1),%r11 - xorq %r14,%r13 - movq %rax,%r15 - vpsllq $56,%ymm8,%ymm9 - vpxor %ymm10,%ymm11,%ymm8 - rorxq $39,%rax,%r12 - leaq (%r11,%r13,1),%r11 - xorq %rbx,%r15 - vpsrlq $7,%ymm10,%ymm10 - vpxor %ymm9,%ymm8,%ymm8 - rorxq $34,%rax,%r14 - rorxq $28,%rax,%r13 - leaq (%rdx,%r11,1),%rdx - vpsllq $7,%ymm9,%ymm9 - vpxor %ymm10,%ymm8,%ymm8 - andq %r15,%rdi - xorq %r12,%r14 - xorq %rbx,%rdi - vpsrlq $6,%ymm7,%ymm11 - vpxor %ymm9,%ymm8,%ymm8 - xorq %r13,%r14 - leaq (%r11,%rdi,1),%r11 - movq %r8,%r12 - vpsllq $3,%ymm7,%ymm10 - vpaddq %ymm8,%ymm0,%ymm0 - addq 8+256(%rsp),%r10 - andq %rdx,%r12 - rorxq $41,%rdx,%r13 - vpsrlq $19,%ymm7,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - rorxq $18,%rdx,%rdi - leaq (%r11,%r14,1),%r11 - leaq (%r10,%r12,1),%r10 - vpsllq $42,%ymm10,%ymm10 - vpxor %ymm9,%ymm11,%ymm11 - andnq %r9,%rdx,%r12 - xorq %rdi,%r13 - rorxq $14,%rdx,%r14 - vpsrlq $42,%ymm9,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - leaq (%r10,%r12,1),%r10 - xorq %r14,%r13 - movq %r11,%rdi - vpxor %ymm9,%ymm11,%ymm11 - rorxq $39,%r11,%r12 - leaq (%r10,%r13,1),%r10 - xorq %rax,%rdi - vpaddq %ymm11,%ymm0,%ymm0 - rorxq $34,%r11,%r14 - rorxq $28,%r11,%r13 - leaq (%rcx,%r10,1),%rcx - vpaddq -128(%rbp),%ymm0,%ymm10 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %rax,%r15 - xorq %r13,%r14 - leaq (%r10,%r15,1),%r10 - movq %rdx,%r12 - vmovdqa %ymm10,0(%rsp) - vpalignr $8,%ymm1,%ymm2,%ymm8 - addq 32+256(%rsp),%r9 - andq %rcx,%r12 - rorxq $41,%rcx,%r13 - vpalignr $8,%ymm5,%ymm6,%ymm11 - rorxq $18,%rcx,%r15 - leaq (%r10,%r14,1),%r10 - leaq (%r9,%r12,1),%r9 - vpsrlq $1,%ymm8,%ymm10 - andnq %r8,%rcx,%r12 - xorq %r15,%r13 - rorxq $14,%rcx,%r14 - vpaddq %ymm11,%ymm1,%ymm1 - vpsrlq $7,%ymm8,%ymm11 - leaq (%r9,%r12,1),%r9 - xorq %r14,%r13 - movq %r10,%r15 - vpsllq $56,%ymm8,%ymm9 - vpxor %ymm10,%ymm11,%ymm8 - rorxq $39,%r10,%r12 - leaq (%r9,%r13,1),%r9 - xorq %r11,%r15 - vpsrlq $7,%ymm10,%ymm10 - vpxor %ymm9,%ymm8,%ymm8 - rorxq $34,%r10,%r14 - rorxq $28,%r10,%r13 - leaq (%rbx,%r9,1),%rbx - vpsllq $7,%ymm9,%ymm9 - vpxor %ymm10,%ymm8,%ymm8 - andq %r15,%rdi - xorq %r12,%r14 - xorq %r11,%rdi - vpsrlq $6,%ymm0,%ymm11 - vpxor %ymm9,%ymm8,%ymm8 - xorq %r13,%r14 - leaq (%r9,%rdi,1),%r9 - movq %rcx,%r12 - vpsllq $3,%ymm0,%ymm10 - vpaddq %ymm8,%ymm1,%ymm1 - addq 40+256(%rsp),%r8 - andq %rbx,%r12 - rorxq $41,%rbx,%r13 - vpsrlq $19,%ymm0,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - rorxq $18,%rbx,%rdi - leaq (%r9,%r14,1),%r9 - leaq (%r8,%r12,1),%r8 - vpsllq $42,%ymm10,%ymm10 - vpxor %ymm9,%ymm11,%ymm11 - andnq %rdx,%rbx,%r12 - xorq %rdi,%r13 - rorxq $14,%rbx,%r14 - vpsrlq $42,%ymm9,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - leaq (%r8,%r12,1),%r8 - xorq %r14,%r13 - movq %r9,%rdi - vpxor %ymm9,%ymm11,%ymm11 - rorxq $39,%r9,%r12 - leaq (%r8,%r13,1),%r8 - xorq %r10,%rdi - vpaddq %ymm11,%ymm1,%ymm1 - rorxq $34,%r9,%r14 - rorxq $28,%r9,%r13 - leaq (%rax,%r8,1),%rax - vpaddq -96(%rbp),%ymm1,%ymm10 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %r10,%r15 - xorq %r13,%r14 - leaq (%r8,%r15,1),%r8 - movq %rbx,%r12 - vmovdqa %ymm10,32(%rsp) - vpalignr $8,%ymm2,%ymm3,%ymm8 - addq 64+256(%rsp),%rdx - andq %rax,%r12 - rorxq $41,%rax,%r13 - vpalignr $8,%ymm6,%ymm7,%ymm11 - rorxq $18,%rax,%r15 - leaq (%r8,%r14,1),%r8 - leaq (%rdx,%r12,1),%rdx - vpsrlq $1,%ymm8,%ymm10 - andnq %rcx,%rax,%r12 - xorq %r15,%r13 - rorxq $14,%rax,%r14 - vpaddq %ymm11,%ymm2,%ymm2 - vpsrlq $7,%ymm8,%ymm11 - leaq (%rdx,%r12,1),%rdx - xorq %r14,%r13 - movq %r8,%r15 - vpsllq $56,%ymm8,%ymm9 - vpxor %ymm10,%ymm11,%ymm8 - rorxq $39,%r8,%r12 - leaq (%rdx,%r13,1),%rdx - xorq %r9,%r15 - vpsrlq $7,%ymm10,%ymm10 - vpxor %ymm9,%ymm8,%ymm8 - rorxq $34,%r8,%r14 - rorxq $28,%r8,%r13 - leaq (%r11,%rdx,1),%r11 - vpsllq $7,%ymm9,%ymm9 - vpxor %ymm10,%ymm8,%ymm8 - andq %r15,%rdi - xorq %r12,%r14 - xorq %r9,%rdi - vpsrlq $6,%ymm1,%ymm11 - vpxor %ymm9,%ymm8,%ymm8 - xorq %r13,%r14 - leaq (%rdx,%rdi,1),%rdx - movq %rax,%r12 - vpsllq $3,%ymm1,%ymm10 - vpaddq %ymm8,%ymm2,%ymm2 - addq 72+256(%rsp),%rcx - andq %r11,%r12 - rorxq $41,%r11,%r13 - vpsrlq $19,%ymm1,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - rorxq $18,%r11,%rdi - leaq (%rdx,%r14,1),%rdx - leaq (%rcx,%r12,1),%rcx - vpsllq $42,%ymm10,%ymm10 - vpxor %ymm9,%ymm11,%ymm11 - andnq %rbx,%r11,%r12 - xorq %rdi,%r13 - rorxq $14,%r11,%r14 - vpsrlq $42,%ymm9,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - leaq (%rcx,%r12,1),%rcx - xorq %r14,%r13 - movq %rdx,%rdi - vpxor %ymm9,%ymm11,%ymm11 - rorxq $39,%rdx,%r12 - leaq (%rcx,%r13,1),%rcx - xorq %r8,%rdi - vpaddq %ymm11,%ymm2,%ymm2 - rorxq $34,%rdx,%r14 - rorxq $28,%rdx,%r13 - leaq (%r10,%rcx,1),%r10 - vpaddq -64(%rbp),%ymm2,%ymm10 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %r8,%r15 - xorq %r13,%r14 - leaq (%rcx,%r15,1),%rcx - movq %r11,%r12 - vmovdqa %ymm10,64(%rsp) - vpalignr $8,%ymm3,%ymm4,%ymm8 - addq 96+256(%rsp),%rbx - andq %r10,%r12 - rorxq $41,%r10,%r13 - vpalignr $8,%ymm7,%ymm0,%ymm11 - rorxq $18,%r10,%r15 - leaq (%rcx,%r14,1),%rcx - leaq (%rbx,%r12,1),%rbx - vpsrlq $1,%ymm8,%ymm10 - andnq %rax,%r10,%r12 - xorq %r15,%r13 - rorxq $14,%r10,%r14 - vpaddq %ymm11,%ymm3,%ymm3 - vpsrlq $7,%ymm8,%ymm11 - leaq (%rbx,%r12,1),%rbx - xorq %r14,%r13 - movq %rcx,%r15 - vpsllq $56,%ymm8,%ymm9 - vpxor %ymm10,%ymm11,%ymm8 - rorxq $39,%rcx,%r12 - leaq (%rbx,%r13,1),%rbx - xorq %rdx,%r15 - vpsrlq $7,%ymm10,%ymm10 - vpxor %ymm9,%ymm8,%ymm8 - rorxq $34,%rcx,%r14 - rorxq $28,%rcx,%r13 - leaq (%r9,%rbx,1),%r9 - vpsllq $7,%ymm9,%ymm9 - vpxor %ymm10,%ymm8,%ymm8 - andq %r15,%rdi - xorq %r12,%r14 - xorq %rdx,%rdi - vpsrlq $6,%ymm2,%ymm11 - vpxor %ymm9,%ymm8,%ymm8 - xorq %r13,%r14 - leaq (%rbx,%rdi,1),%rbx - movq %r10,%r12 - vpsllq $3,%ymm2,%ymm10 - vpaddq %ymm8,%ymm3,%ymm3 - addq 104+256(%rsp),%rax - andq %r9,%r12 - rorxq $41,%r9,%r13 - vpsrlq $19,%ymm2,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - rorxq $18,%r9,%rdi - leaq (%rbx,%r14,1),%rbx - leaq (%rax,%r12,1),%rax - vpsllq $42,%ymm10,%ymm10 - vpxor %ymm9,%ymm11,%ymm11 - andnq %r11,%r9,%r12 - xorq %rdi,%r13 - rorxq $14,%r9,%r14 - vpsrlq $42,%ymm9,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - leaq (%rax,%r12,1),%rax - xorq %r14,%r13 - movq %rbx,%rdi - vpxor %ymm9,%ymm11,%ymm11 - rorxq $39,%rbx,%r12 - leaq (%rax,%r13,1),%rax - xorq %rcx,%rdi - vpaddq %ymm11,%ymm3,%ymm3 - rorxq $34,%rbx,%r14 - rorxq $28,%rbx,%r13 - leaq (%r8,%rax,1),%r8 - vpaddq -32(%rbp),%ymm3,%ymm10 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %rcx,%r15 - xorq %r13,%r14 - leaq (%rax,%r15,1),%rax - movq %r9,%r12 - vmovdqa %ymm10,96(%rsp) - leaq -128(%rsp),%rsp - vpalignr $8,%ymm4,%ymm5,%ymm8 - addq 0+256(%rsp),%r11 - andq %r8,%r12 - rorxq $41,%r8,%r13 - vpalignr $8,%ymm0,%ymm1,%ymm11 - rorxq $18,%r8,%r15 - leaq (%rax,%r14,1),%rax - leaq (%r11,%r12,1),%r11 - vpsrlq $1,%ymm8,%ymm10 - andnq %r10,%r8,%r12 - xorq %r15,%r13 - rorxq $14,%r8,%r14 - vpaddq %ymm11,%ymm4,%ymm4 - vpsrlq $7,%ymm8,%ymm11 - leaq (%r11,%r12,1),%r11 - xorq %r14,%r13 - movq %rax,%r15 - vpsllq $56,%ymm8,%ymm9 - vpxor %ymm10,%ymm11,%ymm8 - rorxq $39,%rax,%r12 - leaq (%r11,%r13,1),%r11 - xorq %rbx,%r15 - vpsrlq $7,%ymm10,%ymm10 - vpxor %ymm9,%ymm8,%ymm8 - rorxq $34,%rax,%r14 - rorxq $28,%rax,%r13 - leaq (%rdx,%r11,1),%rdx - vpsllq $7,%ymm9,%ymm9 - vpxor %ymm10,%ymm8,%ymm8 - andq %r15,%rdi - xorq %r12,%r14 - xorq %rbx,%rdi - vpsrlq $6,%ymm3,%ymm11 - vpxor %ymm9,%ymm8,%ymm8 - xorq %r13,%r14 - leaq (%r11,%rdi,1),%r11 - movq %r8,%r12 - vpsllq $3,%ymm3,%ymm10 - vpaddq %ymm8,%ymm4,%ymm4 - addq 8+256(%rsp),%r10 - andq %rdx,%r12 - rorxq $41,%rdx,%r13 - vpsrlq $19,%ymm3,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - rorxq $18,%rdx,%rdi - leaq (%r11,%r14,1),%r11 - leaq (%r10,%r12,1),%r10 - vpsllq $42,%ymm10,%ymm10 - vpxor %ymm9,%ymm11,%ymm11 - andnq %r9,%rdx,%r12 - xorq %rdi,%r13 - rorxq $14,%rdx,%r14 - vpsrlq $42,%ymm9,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - leaq (%r10,%r12,1),%r10 - xorq %r14,%r13 - movq %r11,%rdi - vpxor %ymm9,%ymm11,%ymm11 - rorxq $39,%r11,%r12 - leaq (%r10,%r13,1),%r10 - xorq %rax,%rdi - vpaddq %ymm11,%ymm4,%ymm4 - rorxq $34,%r11,%r14 - rorxq $28,%r11,%r13 - leaq (%rcx,%r10,1),%rcx - vpaddq 0(%rbp),%ymm4,%ymm10 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %rax,%r15 - xorq %r13,%r14 - leaq (%r10,%r15,1),%r10 - movq %rdx,%r12 - vmovdqa %ymm10,0(%rsp) - vpalignr $8,%ymm5,%ymm6,%ymm8 - addq 32+256(%rsp),%r9 - andq %rcx,%r12 - rorxq $41,%rcx,%r13 - vpalignr $8,%ymm1,%ymm2,%ymm11 - rorxq $18,%rcx,%r15 - leaq (%r10,%r14,1),%r10 - leaq (%r9,%r12,1),%r9 - vpsrlq $1,%ymm8,%ymm10 - andnq %r8,%rcx,%r12 - xorq %r15,%r13 - rorxq $14,%rcx,%r14 - vpaddq %ymm11,%ymm5,%ymm5 - vpsrlq $7,%ymm8,%ymm11 - leaq (%r9,%r12,1),%r9 - xorq %r14,%r13 - movq %r10,%r15 - vpsllq $56,%ymm8,%ymm9 - vpxor %ymm10,%ymm11,%ymm8 - rorxq $39,%r10,%r12 - leaq (%r9,%r13,1),%r9 - xorq %r11,%r15 - vpsrlq $7,%ymm10,%ymm10 - vpxor %ymm9,%ymm8,%ymm8 - rorxq $34,%r10,%r14 - rorxq $28,%r10,%r13 - leaq (%rbx,%r9,1),%rbx - vpsllq $7,%ymm9,%ymm9 - vpxor %ymm10,%ymm8,%ymm8 - andq %r15,%rdi - xorq %r12,%r14 - xorq %r11,%rdi - vpsrlq $6,%ymm4,%ymm11 - vpxor %ymm9,%ymm8,%ymm8 - xorq %r13,%r14 - leaq (%r9,%rdi,1),%r9 - movq %rcx,%r12 - vpsllq $3,%ymm4,%ymm10 - vpaddq %ymm8,%ymm5,%ymm5 - addq 40+256(%rsp),%r8 - andq %rbx,%r12 - rorxq $41,%rbx,%r13 - vpsrlq $19,%ymm4,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - rorxq $18,%rbx,%rdi - leaq (%r9,%r14,1),%r9 - leaq (%r8,%r12,1),%r8 - vpsllq $42,%ymm10,%ymm10 - vpxor %ymm9,%ymm11,%ymm11 - andnq %rdx,%rbx,%r12 - xorq %rdi,%r13 - rorxq $14,%rbx,%r14 - vpsrlq $42,%ymm9,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - leaq (%r8,%r12,1),%r8 - xorq %r14,%r13 - movq %r9,%rdi - vpxor %ymm9,%ymm11,%ymm11 - rorxq $39,%r9,%r12 - leaq (%r8,%r13,1),%r8 - xorq %r10,%rdi - vpaddq %ymm11,%ymm5,%ymm5 - rorxq $34,%r9,%r14 - rorxq $28,%r9,%r13 - leaq (%rax,%r8,1),%rax - vpaddq 32(%rbp),%ymm5,%ymm10 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %r10,%r15 - xorq %r13,%r14 - leaq (%r8,%r15,1),%r8 - movq %rbx,%r12 - vmovdqa %ymm10,32(%rsp) - vpalignr $8,%ymm6,%ymm7,%ymm8 - addq 64+256(%rsp),%rdx - andq %rax,%r12 - rorxq $41,%rax,%r13 - vpalignr $8,%ymm2,%ymm3,%ymm11 - rorxq $18,%rax,%r15 - leaq (%r8,%r14,1),%r8 - leaq (%rdx,%r12,1),%rdx - vpsrlq $1,%ymm8,%ymm10 - andnq %rcx,%rax,%r12 - xorq %r15,%r13 - rorxq $14,%rax,%r14 - vpaddq %ymm11,%ymm6,%ymm6 - vpsrlq $7,%ymm8,%ymm11 - leaq (%rdx,%r12,1),%rdx - xorq %r14,%r13 - movq %r8,%r15 - vpsllq $56,%ymm8,%ymm9 - vpxor %ymm10,%ymm11,%ymm8 - rorxq $39,%r8,%r12 - leaq (%rdx,%r13,1),%rdx - xorq %r9,%r15 - vpsrlq $7,%ymm10,%ymm10 - vpxor %ymm9,%ymm8,%ymm8 - rorxq $34,%r8,%r14 - rorxq $28,%r8,%r13 - leaq (%r11,%rdx,1),%r11 - vpsllq $7,%ymm9,%ymm9 - vpxor %ymm10,%ymm8,%ymm8 - andq %r15,%rdi - xorq %r12,%r14 - xorq %r9,%rdi - vpsrlq $6,%ymm5,%ymm11 - vpxor %ymm9,%ymm8,%ymm8 - xorq %r13,%r14 - leaq (%rdx,%rdi,1),%rdx - movq %rax,%r12 - vpsllq $3,%ymm5,%ymm10 - vpaddq %ymm8,%ymm6,%ymm6 - addq 72+256(%rsp),%rcx - andq %r11,%r12 - rorxq $41,%r11,%r13 - vpsrlq $19,%ymm5,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - rorxq $18,%r11,%rdi - leaq (%rdx,%r14,1),%rdx - leaq (%rcx,%r12,1),%rcx - vpsllq $42,%ymm10,%ymm10 - vpxor %ymm9,%ymm11,%ymm11 - andnq %rbx,%r11,%r12 - xorq %rdi,%r13 - rorxq $14,%r11,%r14 - vpsrlq $42,%ymm9,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - leaq (%rcx,%r12,1),%rcx - xorq %r14,%r13 - movq %rdx,%rdi - vpxor %ymm9,%ymm11,%ymm11 - rorxq $39,%rdx,%r12 - leaq (%rcx,%r13,1),%rcx - xorq %r8,%rdi - vpaddq %ymm11,%ymm6,%ymm6 - rorxq $34,%rdx,%r14 - rorxq $28,%rdx,%r13 - leaq (%r10,%rcx,1),%r10 - vpaddq 64(%rbp),%ymm6,%ymm10 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %r8,%r15 - xorq %r13,%r14 - leaq (%rcx,%r15,1),%rcx - movq %r11,%r12 - vmovdqa %ymm10,64(%rsp) - vpalignr $8,%ymm7,%ymm0,%ymm8 - addq 96+256(%rsp),%rbx - andq %r10,%r12 - rorxq $41,%r10,%r13 - vpalignr $8,%ymm3,%ymm4,%ymm11 - rorxq $18,%r10,%r15 - leaq (%rcx,%r14,1),%rcx - leaq (%rbx,%r12,1),%rbx - vpsrlq $1,%ymm8,%ymm10 - andnq %rax,%r10,%r12 - xorq %r15,%r13 - rorxq $14,%r10,%r14 - vpaddq %ymm11,%ymm7,%ymm7 - vpsrlq $7,%ymm8,%ymm11 - leaq (%rbx,%r12,1),%rbx - xorq %r14,%r13 - movq %rcx,%r15 - vpsllq $56,%ymm8,%ymm9 - vpxor %ymm10,%ymm11,%ymm8 - rorxq $39,%rcx,%r12 - leaq (%rbx,%r13,1),%rbx - xorq %rdx,%r15 - vpsrlq $7,%ymm10,%ymm10 - vpxor %ymm9,%ymm8,%ymm8 - rorxq $34,%rcx,%r14 - rorxq $28,%rcx,%r13 - leaq (%r9,%rbx,1),%r9 - vpsllq $7,%ymm9,%ymm9 - vpxor %ymm10,%ymm8,%ymm8 - andq %r15,%rdi - xorq %r12,%r14 - xorq %rdx,%rdi - vpsrlq $6,%ymm6,%ymm11 - vpxor %ymm9,%ymm8,%ymm8 - xorq %r13,%r14 - leaq (%rbx,%rdi,1),%rbx - movq %r10,%r12 - vpsllq $3,%ymm6,%ymm10 - vpaddq %ymm8,%ymm7,%ymm7 - addq 104+256(%rsp),%rax - andq %r9,%r12 - rorxq $41,%r9,%r13 - vpsrlq $19,%ymm6,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - rorxq $18,%r9,%rdi - leaq (%rbx,%r14,1),%rbx - leaq (%rax,%r12,1),%rax - vpsllq $42,%ymm10,%ymm10 - vpxor %ymm9,%ymm11,%ymm11 - andnq %r11,%r9,%r12 - xorq %rdi,%r13 - rorxq $14,%r9,%r14 - vpsrlq $42,%ymm9,%ymm9 - vpxor %ymm10,%ymm11,%ymm11 - leaq (%rax,%r12,1),%rax - xorq %r14,%r13 - movq %rbx,%rdi - vpxor %ymm9,%ymm11,%ymm11 - rorxq $39,%rbx,%r12 - leaq (%rax,%r13,1),%rax - xorq %rcx,%rdi - vpaddq %ymm11,%ymm7,%ymm7 - rorxq $34,%rbx,%r14 - rorxq $28,%rbx,%r13 - leaq (%r8,%rax,1),%r8 - vpaddq 96(%rbp),%ymm7,%ymm10 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %rcx,%r15 - xorq %r13,%r14 - leaq (%rax,%r15,1),%rax - movq %r9,%r12 - vmovdqa %ymm10,96(%rsp) - leaq 256(%rbp),%rbp - cmpb $0,-121(%rbp) - jne L$avx2_00_47 - addq 0+128(%rsp),%r11 - andq %r8,%r12 - rorxq $41,%r8,%r13 - rorxq $18,%r8,%r15 - leaq (%rax,%r14,1),%rax - leaq (%r11,%r12,1),%r11 - andnq %r10,%r8,%r12 - xorq %r15,%r13 - rorxq $14,%r8,%r14 - leaq (%r11,%r12,1),%r11 - xorq %r14,%r13 - movq %rax,%r15 - rorxq $39,%rax,%r12 - leaq (%r11,%r13,1),%r11 - xorq %rbx,%r15 - rorxq $34,%rax,%r14 - rorxq $28,%rax,%r13 - leaq (%rdx,%r11,1),%rdx - andq %r15,%rdi - xorq %r12,%r14 - xorq %rbx,%rdi - xorq %r13,%r14 - leaq (%r11,%rdi,1),%r11 - movq %r8,%r12 - addq 8+128(%rsp),%r10 - andq %rdx,%r12 - rorxq $41,%rdx,%r13 - rorxq $18,%rdx,%rdi - leaq (%r11,%r14,1),%r11 - leaq (%r10,%r12,1),%r10 - andnq %r9,%rdx,%r12 - xorq %rdi,%r13 - rorxq $14,%rdx,%r14 - leaq (%r10,%r12,1),%r10 - xorq %r14,%r13 - movq %r11,%rdi - rorxq $39,%r11,%r12 - leaq (%r10,%r13,1),%r10 - xorq %rax,%rdi - rorxq $34,%r11,%r14 - rorxq $28,%r11,%r13 - leaq (%rcx,%r10,1),%rcx - andq %rdi,%r15 - xorq %r12,%r14 - xorq %rax,%r15 - xorq %r13,%r14 - leaq (%r10,%r15,1),%r10 - movq %rdx,%r12 - addq 32+128(%rsp),%r9 - andq %rcx,%r12 - rorxq $41,%rcx,%r13 - rorxq $18,%rcx,%r15 - leaq (%r10,%r14,1),%r10 - leaq (%r9,%r12,1),%r9 - andnq %r8,%rcx,%r12 - xorq %r15,%r13 - rorxq $14,%rcx,%r14 - leaq (%r9,%r12,1),%r9 - xorq %r14,%r13 - movq %r10,%r15 - rorxq $39,%r10,%r12 - leaq (%r9,%r13,1),%r9 - xorq %r11,%r15 - rorxq $34,%r10,%r14 - rorxq $28,%r10,%r13 - leaq (%rbx,%r9,1),%rbx - andq %r15,%rdi - xorq %r12,%r14 - xorq %r11,%rdi - xorq %r13,%r14 - leaq (%r9,%rdi,1),%r9 - movq %rcx,%r12 - addq 40+128(%rsp),%r8 - andq %rbx,%r12 - rorxq $41,%rbx,%r13 - rorxq $18,%rbx,%rdi - leaq (%r9,%r14,1),%r9 - leaq (%r8,%r12,1),%r8 - andnq %rdx,%rbx,%r12 - xorq %rdi,%r13 - rorxq $14,%rbx,%r14 - leaq (%r8,%r12,1),%r8 - xorq %r14,%r13 - movq %r9,%rdi - rorxq $39,%r9,%r12 - leaq (%r8,%r13,1),%r8 - xorq %r10,%rdi - rorxq $34,%r9,%r14 - rorxq $28,%r9,%r13 - leaq (%rax,%r8,1),%rax - andq %rdi,%r15 - xorq %r12,%r14 - xorq %r10,%r15 - xorq %r13,%r14 - leaq (%r8,%r15,1),%r8 - movq %rbx,%r12 - addq 64+128(%rsp),%rdx - andq %rax,%r12 - rorxq $41,%rax,%r13 - rorxq $18,%rax,%r15 - leaq (%r8,%r14,1),%r8 - leaq (%rdx,%r12,1),%rdx - andnq %rcx,%rax,%r12 - xorq %r15,%r13 - rorxq $14,%rax,%r14 - leaq (%rdx,%r12,1),%rdx - xorq %r14,%r13 - movq %r8,%r15 - rorxq $39,%r8,%r12 - leaq (%rdx,%r13,1),%rdx - xorq %r9,%r15 - rorxq $34,%r8,%r14 - rorxq $28,%r8,%r13 - leaq (%r11,%rdx,1),%r11 - andq %r15,%rdi - xorq %r12,%r14 - xorq %r9,%rdi - xorq %r13,%r14 - leaq (%rdx,%rdi,1),%rdx - movq %rax,%r12 - addq 72+128(%rsp),%rcx - andq %r11,%r12 - rorxq $41,%r11,%r13 - rorxq $18,%r11,%rdi - leaq (%rdx,%r14,1),%rdx - leaq (%rcx,%r12,1),%rcx - andnq %rbx,%r11,%r12 - xorq %rdi,%r13 - rorxq $14,%r11,%r14 - leaq (%rcx,%r12,1),%rcx - xorq %r14,%r13 - movq %rdx,%rdi - rorxq $39,%rdx,%r12 - leaq (%rcx,%r13,1),%rcx - xorq %r8,%rdi - rorxq $34,%rdx,%r14 - rorxq $28,%rdx,%r13 - leaq (%r10,%rcx,1),%r10 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %r8,%r15 - xorq %r13,%r14 - leaq (%rcx,%r15,1),%rcx - movq %r11,%r12 - addq 96+128(%rsp),%rbx - andq %r10,%r12 - rorxq $41,%r10,%r13 - rorxq $18,%r10,%r15 - leaq (%rcx,%r14,1),%rcx - leaq (%rbx,%r12,1),%rbx - andnq %rax,%r10,%r12 - xorq %r15,%r13 - rorxq $14,%r10,%r14 - leaq (%rbx,%r12,1),%rbx - xorq %r14,%r13 - movq %rcx,%r15 - rorxq $39,%rcx,%r12 - leaq (%rbx,%r13,1),%rbx - xorq %rdx,%r15 - rorxq $34,%rcx,%r14 - rorxq $28,%rcx,%r13 - leaq (%r9,%rbx,1),%r9 - andq %r15,%rdi - xorq %r12,%r14 - xorq %rdx,%rdi - xorq %r13,%r14 - leaq (%rbx,%rdi,1),%rbx - movq %r10,%r12 - addq 104+128(%rsp),%rax - andq %r9,%r12 - rorxq $41,%r9,%r13 - rorxq $18,%r9,%rdi - leaq (%rbx,%r14,1),%rbx - leaq (%rax,%r12,1),%rax - andnq %r11,%r9,%r12 - xorq %rdi,%r13 - rorxq $14,%r9,%r14 - leaq (%rax,%r12,1),%rax - xorq %r14,%r13 - movq %rbx,%rdi - rorxq $39,%rbx,%r12 - leaq (%rax,%r13,1),%rax - xorq %rcx,%rdi - rorxq $34,%rbx,%r14 - rorxq $28,%rbx,%r13 - leaq (%r8,%rax,1),%r8 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %rcx,%r15 - xorq %r13,%r14 - leaq (%rax,%r15,1),%rax - movq %r9,%r12 - addq 0(%rsp),%r11 - andq %r8,%r12 - rorxq $41,%r8,%r13 - rorxq $18,%r8,%r15 - leaq (%rax,%r14,1),%rax - leaq (%r11,%r12,1),%r11 - andnq %r10,%r8,%r12 - xorq %r15,%r13 - rorxq $14,%r8,%r14 - leaq (%r11,%r12,1),%r11 - xorq %r14,%r13 - movq %rax,%r15 - rorxq $39,%rax,%r12 - leaq (%r11,%r13,1),%r11 - xorq %rbx,%r15 - rorxq $34,%rax,%r14 - rorxq $28,%rax,%r13 - leaq (%rdx,%r11,1),%rdx - andq %r15,%rdi - xorq %r12,%r14 - xorq %rbx,%rdi - xorq %r13,%r14 - leaq (%r11,%rdi,1),%r11 - movq %r8,%r12 - addq 8(%rsp),%r10 - andq %rdx,%r12 - rorxq $41,%rdx,%r13 - rorxq $18,%rdx,%rdi - leaq (%r11,%r14,1),%r11 - leaq (%r10,%r12,1),%r10 - andnq %r9,%rdx,%r12 - xorq %rdi,%r13 - rorxq $14,%rdx,%r14 - leaq (%r10,%r12,1),%r10 - xorq %r14,%r13 - movq %r11,%rdi - rorxq $39,%r11,%r12 - leaq (%r10,%r13,1),%r10 - xorq %rax,%rdi - rorxq $34,%r11,%r14 - rorxq $28,%r11,%r13 - leaq (%rcx,%r10,1),%rcx - andq %rdi,%r15 - xorq %r12,%r14 - xorq %rax,%r15 - xorq %r13,%r14 - leaq (%r10,%r15,1),%r10 - movq %rdx,%r12 - addq 32(%rsp),%r9 - andq %rcx,%r12 - rorxq $41,%rcx,%r13 - rorxq $18,%rcx,%r15 - leaq (%r10,%r14,1),%r10 - leaq (%r9,%r12,1),%r9 - andnq %r8,%rcx,%r12 - xorq %r15,%r13 - rorxq $14,%rcx,%r14 - leaq (%r9,%r12,1),%r9 - xorq %r14,%r13 - movq %r10,%r15 - rorxq $39,%r10,%r12 - leaq (%r9,%r13,1),%r9 - xorq %r11,%r15 - rorxq $34,%r10,%r14 - rorxq $28,%r10,%r13 - leaq (%rbx,%r9,1),%rbx - andq %r15,%rdi - xorq %r12,%r14 - xorq %r11,%rdi - xorq %r13,%r14 - leaq (%r9,%rdi,1),%r9 - movq %rcx,%r12 - addq 40(%rsp),%r8 - andq %rbx,%r12 - rorxq $41,%rbx,%r13 - rorxq $18,%rbx,%rdi - leaq (%r9,%r14,1),%r9 - leaq (%r8,%r12,1),%r8 - andnq %rdx,%rbx,%r12 - xorq %rdi,%r13 - rorxq $14,%rbx,%r14 - leaq (%r8,%r12,1),%r8 - xorq %r14,%r13 - movq %r9,%rdi - rorxq $39,%r9,%r12 - leaq (%r8,%r13,1),%r8 - xorq %r10,%rdi - rorxq $34,%r9,%r14 - rorxq $28,%r9,%r13 - leaq (%rax,%r8,1),%rax - andq %rdi,%r15 - xorq %r12,%r14 - xorq %r10,%r15 - xorq %r13,%r14 - leaq (%r8,%r15,1),%r8 - movq %rbx,%r12 - addq 64(%rsp),%rdx - andq %rax,%r12 - rorxq $41,%rax,%r13 - rorxq $18,%rax,%r15 - leaq (%r8,%r14,1),%r8 - leaq (%rdx,%r12,1),%rdx - andnq %rcx,%rax,%r12 - xorq %r15,%r13 - rorxq $14,%rax,%r14 - leaq (%rdx,%r12,1),%rdx - xorq %r14,%r13 - movq %r8,%r15 - rorxq $39,%r8,%r12 - leaq (%rdx,%r13,1),%rdx - xorq %r9,%r15 - rorxq $34,%r8,%r14 - rorxq $28,%r8,%r13 - leaq (%r11,%rdx,1),%r11 - andq %r15,%rdi - xorq %r12,%r14 - xorq %r9,%rdi - xorq %r13,%r14 - leaq (%rdx,%rdi,1),%rdx - movq %rax,%r12 - addq 72(%rsp),%rcx - andq %r11,%r12 - rorxq $41,%r11,%r13 - rorxq $18,%r11,%rdi - leaq (%rdx,%r14,1),%rdx - leaq (%rcx,%r12,1),%rcx - andnq %rbx,%r11,%r12 - xorq %rdi,%r13 - rorxq $14,%r11,%r14 - leaq (%rcx,%r12,1),%rcx - xorq %r14,%r13 - movq %rdx,%rdi - rorxq $39,%rdx,%r12 - leaq (%rcx,%r13,1),%rcx - xorq %r8,%rdi - rorxq $34,%rdx,%r14 - rorxq $28,%rdx,%r13 - leaq (%r10,%rcx,1),%r10 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %r8,%r15 - xorq %r13,%r14 - leaq (%rcx,%r15,1),%rcx - movq %r11,%r12 - addq 96(%rsp),%rbx - andq %r10,%r12 - rorxq $41,%r10,%r13 - rorxq $18,%r10,%r15 - leaq (%rcx,%r14,1),%rcx - leaq (%rbx,%r12,1),%rbx - andnq %rax,%r10,%r12 - xorq %r15,%r13 - rorxq $14,%r10,%r14 - leaq (%rbx,%r12,1),%rbx - xorq %r14,%r13 - movq %rcx,%r15 - rorxq $39,%rcx,%r12 - leaq (%rbx,%r13,1),%rbx - xorq %rdx,%r15 - rorxq $34,%rcx,%r14 - rorxq $28,%rcx,%r13 - leaq (%r9,%rbx,1),%r9 - andq %r15,%rdi - xorq %r12,%r14 - xorq %rdx,%rdi - xorq %r13,%r14 - leaq (%rbx,%rdi,1),%rbx - movq %r10,%r12 - addq 104(%rsp),%rax - andq %r9,%r12 - rorxq $41,%r9,%r13 - rorxq $18,%r9,%rdi - leaq (%rbx,%r14,1),%rbx - leaq (%rax,%r12,1),%rax - andnq %r11,%r9,%r12 - xorq %rdi,%r13 - rorxq $14,%r9,%r14 - leaq (%rax,%r12,1),%rax - xorq %r14,%r13 - movq %rbx,%rdi - rorxq $39,%rbx,%r12 - leaq (%rax,%r13,1),%rax - xorq %rcx,%rdi - rorxq $34,%rbx,%r14 - rorxq $28,%rbx,%r13 - leaq (%r8,%rax,1),%r8 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %rcx,%r15 - xorq %r13,%r14 - leaq (%rax,%r15,1),%rax - movq %r9,%r12 - movq 1280(%rsp),%rdi - addq %r14,%rax - - leaq 1152(%rsp),%rbp - - addq 0(%rdi),%rax - addq 8(%rdi),%rbx - addq 16(%rdi),%rcx - addq 24(%rdi),%rdx - addq 32(%rdi),%r8 - addq 40(%rdi),%r9 - addq 48(%rdi),%r10 - addq 56(%rdi),%r11 - - movq %rax,0(%rdi) - movq %rbx,8(%rdi) - movq %rcx,16(%rdi) - movq %rdx,24(%rdi) - movq %r8,32(%rdi) - movq %r9,40(%rdi) - movq %r10,48(%rdi) - movq %r11,56(%rdi) - - cmpq 144(%rbp),%rsi - je L$done_avx2 - - xorq %r14,%r14 - movq %rbx,%rdi - xorq %rcx,%rdi - movq %r9,%r12 - jmp L$ower_avx2 -.p2align 4 -L$ower_avx2: - addq 0+16(%rbp),%r11 - andq %r8,%r12 - rorxq $41,%r8,%r13 - rorxq $18,%r8,%r15 - leaq (%rax,%r14,1),%rax - leaq (%r11,%r12,1),%r11 - andnq %r10,%r8,%r12 - xorq %r15,%r13 - rorxq $14,%r8,%r14 - leaq (%r11,%r12,1),%r11 - xorq %r14,%r13 - movq %rax,%r15 - rorxq $39,%rax,%r12 - leaq (%r11,%r13,1),%r11 - xorq %rbx,%r15 - rorxq $34,%rax,%r14 - rorxq $28,%rax,%r13 - leaq (%rdx,%r11,1),%rdx - andq %r15,%rdi - xorq %r12,%r14 - xorq %rbx,%rdi - xorq %r13,%r14 - leaq (%r11,%rdi,1),%r11 - movq %r8,%r12 - addq 8+16(%rbp),%r10 - andq %rdx,%r12 - rorxq $41,%rdx,%r13 - rorxq $18,%rdx,%rdi - leaq (%r11,%r14,1),%r11 - leaq (%r10,%r12,1),%r10 - andnq %r9,%rdx,%r12 - xorq %rdi,%r13 - rorxq $14,%rdx,%r14 - leaq (%r10,%r12,1),%r10 - xorq %r14,%r13 - movq %r11,%rdi - rorxq $39,%r11,%r12 - leaq (%r10,%r13,1),%r10 - xorq %rax,%rdi - rorxq $34,%r11,%r14 - rorxq $28,%r11,%r13 - leaq (%rcx,%r10,1),%rcx - andq %rdi,%r15 - xorq %r12,%r14 - xorq %rax,%r15 - xorq %r13,%r14 - leaq (%r10,%r15,1),%r10 - movq %rdx,%r12 - addq 32+16(%rbp),%r9 - andq %rcx,%r12 - rorxq $41,%rcx,%r13 - rorxq $18,%rcx,%r15 - leaq (%r10,%r14,1),%r10 - leaq (%r9,%r12,1),%r9 - andnq %r8,%rcx,%r12 - xorq %r15,%r13 - rorxq $14,%rcx,%r14 - leaq (%r9,%r12,1),%r9 - xorq %r14,%r13 - movq %r10,%r15 - rorxq $39,%r10,%r12 - leaq (%r9,%r13,1),%r9 - xorq %r11,%r15 - rorxq $34,%r10,%r14 - rorxq $28,%r10,%r13 - leaq (%rbx,%r9,1),%rbx - andq %r15,%rdi - xorq %r12,%r14 - xorq %r11,%rdi - xorq %r13,%r14 - leaq (%r9,%rdi,1),%r9 - movq %rcx,%r12 - addq 40+16(%rbp),%r8 - andq %rbx,%r12 - rorxq $41,%rbx,%r13 - rorxq $18,%rbx,%rdi - leaq (%r9,%r14,1),%r9 - leaq (%r8,%r12,1),%r8 - andnq %rdx,%rbx,%r12 - xorq %rdi,%r13 - rorxq $14,%rbx,%r14 - leaq (%r8,%r12,1),%r8 - xorq %r14,%r13 - movq %r9,%rdi - rorxq $39,%r9,%r12 - leaq (%r8,%r13,1),%r8 - xorq %r10,%rdi - rorxq $34,%r9,%r14 - rorxq $28,%r9,%r13 - leaq (%rax,%r8,1),%rax - andq %rdi,%r15 - xorq %r12,%r14 - xorq %r10,%r15 - xorq %r13,%r14 - leaq (%r8,%r15,1),%r8 - movq %rbx,%r12 - addq 64+16(%rbp),%rdx - andq %rax,%r12 - rorxq $41,%rax,%r13 - rorxq $18,%rax,%r15 - leaq (%r8,%r14,1),%r8 - leaq (%rdx,%r12,1),%rdx - andnq %rcx,%rax,%r12 - xorq %r15,%r13 - rorxq $14,%rax,%r14 - leaq (%rdx,%r12,1),%rdx - xorq %r14,%r13 - movq %r8,%r15 - rorxq $39,%r8,%r12 - leaq (%rdx,%r13,1),%rdx - xorq %r9,%r15 - rorxq $34,%r8,%r14 - rorxq $28,%r8,%r13 - leaq (%r11,%rdx,1),%r11 - andq %r15,%rdi - xorq %r12,%r14 - xorq %r9,%rdi - xorq %r13,%r14 - leaq (%rdx,%rdi,1),%rdx - movq %rax,%r12 - addq 72+16(%rbp),%rcx - andq %r11,%r12 - rorxq $41,%r11,%r13 - rorxq $18,%r11,%rdi - leaq (%rdx,%r14,1),%rdx - leaq (%rcx,%r12,1),%rcx - andnq %rbx,%r11,%r12 - xorq %rdi,%r13 - rorxq $14,%r11,%r14 - leaq (%rcx,%r12,1),%rcx - xorq %r14,%r13 - movq %rdx,%rdi - rorxq $39,%rdx,%r12 - leaq (%rcx,%r13,1),%rcx - xorq %r8,%rdi - rorxq $34,%rdx,%r14 - rorxq $28,%rdx,%r13 - leaq (%r10,%rcx,1),%r10 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %r8,%r15 - xorq %r13,%r14 - leaq (%rcx,%r15,1),%rcx - movq %r11,%r12 - addq 96+16(%rbp),%rbx - andq %r10,%r12 - rorxq $41,%r10,%r13 - rorxq $18,%r10,%r15 - leaq (%rcx,%r14,1),%rcx - leaq (%rbx,%r12,1),%rbx - andnq %rax,%r10,%r12 - xorq %r15,%r13 - rorxq $14,%r10,%r14 - leaq (%rbx,%r12,1),%rbx - xorq %r14,%r13 - movq %rcx,%r15 - rorxq $39,%rcx,%r12 - leaq (%rbx,%r13,1),%rbx - xorq %rdx,%r15 - rorxq $34,%rcx,%r14 - rorxq $28,%rcx,%r13 - leaq (%r9,%rbx,1),%r9 - andq %r15,%rdi - xorq %r12,%r14 - xorq %rdx,%rdi - xorq %r13,%r14 - leaq (%rbx,%rdi,1),%rbx - movq %r10,%r12 - addq 104+16(%rbp),%rax - andq %r9,%r12 - rorxq $41,%r9,%r13 - rorxq $18,%r9,%rdi - leaq (%rbx,%r14,1),%rbx - leaq (%rax,%r12,1),%rax - andnq %r11,%r9,%r12 - xorq %rdi,%r13 - rorxq $14,%r9,%r14 - leaq (%rax,%r12,1),%rax - xorq %r14,%r13 - movq %rbx,%rdi - rorxq $39,%rbx,%r12 - leaq (%rax,%r13,1),%rax - xorq %rcx,%rdi - rorxq $34,%rbx,%r14 - rorxq $28,%rbx,%r13 - leaq (%r8,%rax,1),%r8 - andq %rdi,%r15 - xorq %r12,%r14 - xorq %rcx,%r15 - xorq %r13,%r14 - leaq (%rax,%r15,1),%rax - movq %r9,%r12 - leaq -128(%rbp),%rbp - cmpq %rsp,%rbp - jae L$ower_avx2 - - movq 1280(%rsp),%rdi - addq %r14,%rax - - leaq 1152(%rsp),%rsp - - addq 0(%rdi),%rax - addq 8(%rdi),%rbx - addq 16(%rdi),%rcx - addq 24(%rdi),%rdx - addq 32(%rdi),%r8 - addq 40(%rdi),%r9 - leaq 256(%rsi),%rsi - addq 48(%rdi),%r10 - movq %rsi,%r12 - addq 56(%rdi),%r11 - cmpq 128+16(%rsp),%rsi - - movq %rax,0(%rdi) - cmoveq %rsp,%r12 - movq %rbx,8(%rdi) - movq %rcx,16(%rdi) - movq %rdx,24(%rdi) - movq %r8,32(%rdi) - movq %r9,40(%rdi) - movq %r10,48(%rdi) - movq %r11,56(%rdi) - - jbe L$oop_avx2 - leaq (%rsp),%rbp - -L$done_avx2: - leaq (%rbp),%rsp - movq 128+24(%rsp),%rsi - vzeroupper - movq (%rsi),%r15 - movq 8(%rsi),%r14 - movq 16(%rsi),%r13 - movq 24(%rsi),%r12 - movq 32(%rsi),%rbp - movq 40(%rsi),%rbx - leaq 48(%rsi),%rsp -L$epilogue_avx2: - .byte 0xf3,0xc3 diff --git a/deps/openssl/asm/x64-win32-masm/aes/aesni-sha256-x86_64.asm b/deps/openssl/asm/x64-win32-masm/aes/aesni-sha256-x86_64.asm index 700d7f58f5c731..602ee5b2655442 100644 --- a/deps/openssl/asm/x64-win32-masm/aes/aesni-sha256-x86_64.asm +++ b/deps/openssl/asm/x64-win32-masm/aes/aesni-sha256-x86_64.asm @@ -22,11 +22,8 @@ aesni_cbc_sha256_enc PROC PUBLIC and r11d,296 cmp r11d,296 je aesni_cbc_sha256_enc_avx2 - and eax,1073741824 - and r10d,268435968 - or r10d,eax - cmp r10d,1342177792 - je aesni_cbc_sha256_enc_avx + and r10d,268435456 + jnz aesni_cbc_sha256_enc_avx ud2 xor eax,eax cmp rcx,0 diff --git a/deps/openssl/asm/x64-win32-masm/bn/rsaz-avx2.asm b/deps/openssl/asm/x64-win32-masm/bn/rsaz-avx2.asm index 0d3107834e6983..c24d0c5e6a3d3d 100644 --- a/deps/openssl/asm/x64-win32-masm/bn/rsaz-avx2.asm +++ b/deps/openssl/asm/x64-win32-masm/bn/rsaz-avx2.asm @@ -1628,8 +1628,9 @@ PUBLIC rsaz_1024_gather5_avx2 ALIGN 32 rsaz_1024_gather5_avx2 PROC PUBLIC - lea rax,QWORD PTR[((-136))+rsp] vzeroupper + mov r11,rsp + lea rax,QWORD PTR[((-136))+rsp] $L$SEH_begin_rsaz_1024_gather5:: DB 048h,08dh,060h,0e0h @@ -1643,66 +1644,125 @@ DB 0c5h,078h,029h,060h,040h DB 0c5h,078h,029h,068h,050h DB 0c5h,078h,029h,070h,060h DB 0c5h,078h,029h,078h,070h - lea r11,QWORD PTR[$L$gather_table] - mov eax,r8d - and r8d,3 - shr eax,2 - shl r8d,4 - - vmovdqu ymm7,YMMWORD PTR[((-32))+r11] - vpbroadcastb xmm8,BYTE PTR[8+rax*1+r11] - vpbroadcastb xmm9,BYTE PTR[7+rax*1+r11] - vpbroadcastb xmm10,BYTE PTR[6+rax*1+r11] - vpbroadcastb xmm11,BYTE PTR[5+rax*1+r11] - vpbroadcastb xmm12,BYTE PTR[4+rax*1+r11] - vpbroadcastb xmm13,BYTE PTR[3+rax*1+r11] - vpbroadcastb xmm14,BYTE PTR[2+rax*1+r11] - vpbroadcastb xmm15,BYTE PTR[1+rax*1+r11] - - lea rdx,QWORD PTR[64+r8*1+rdx] - mov r11,64 - mov eax,9 - jmp $L$oop_gather_1024 + lea rsp,QWORD PTR[((-256))+rsp] + and rsp,-32 + lea r10,QWORD PTR[$L$inc] + lea rax,QWORD PTR[((-128))+rsp] + + vmovd xmm4,r8d + vmovdqa ymm0,YMMWORD PTR[r10] + vmovdqa ymm1,YMMWORD PTR[32+r10] + vmovdqa ymm5,YMMWORD PTR[64+r10] + vpbroadcastd ymm4,xmm4 + + vpaddd ymm2,ymm0,ymm5 + vpcmpeqd ymm0,ymm0,ymm4 + vpaddd ymm3,ymm1,ymm5 + vpcmpeqd ymm1,ymm1,ymm4 + vmovdqa YMMWORD PTR[(0+128)+rax],ymm0 + vpaddd ymm0,ymm2,ymm5 + vpcmpeqd ymm2,ymm2,ymm4 + vmovdqa YMMWORD PTR[(32+128)+rax],ymm1 + vpaddd ymm1,ymm3,ymm5 + vpcmpeqd ymm3,ymm3,ymm4 + vmovdqa YMMWORD PTR[(64+128)+rax],ymm2 + vpaddd ymm2,ymm0,ymm5 + vpcmpeqd ymm0,ymm0,ymm4 + vmovdqa YMMWORD PTR[(96+128)+rax],ymm3 + vpaddd ymm3,ymm1,ymm5 + vpcmpeqd ymm1,ymm1,ymm4 + vmovdqa YMMWORD PTR[(128+128)+rax],ymm0 + vpaddd ymm8,ymm2,ymm5 + vpcmpeqd ymm2,ymm2,ymm4 + vmovdqa YMMWORD PTR[(160+128)+rax],ymm1 + vpaddd ymm9,ymm3,ymm5 + vpcmpeqd ymm3,ymm3,ymm4 + vmovdqa YMMWORD PTR[(192+128)+rax],ymm2 + vpaddd ymm10,ymm8,ymm5 + vpcmpeqd ymm8,ymm8,ymm4 + vmovdqa YMMWORD PTR[(224+128)+rax],ymm3 + vpaddd ymm11,ymm9,ymm5 + vpcmpeqd ymm9,ymm9,ymm4 + vpaddd ymm12,ymm10,ymm5 + vpcmpeqd ymm10,ymm10,ymm4 + vpaddd ymm13,ymm11,ymm5 + vpcmpeqd ymm11,ymm11,ymm4 + vpaddd ymm14,ymm12,ymm5 + vpcmpeqd ymm12,ymm12,ymm4 + vpaddd ymm15,ymm13,ymm5 + vpcmpeqd ymm13,ymm13,ymm4 + vpcmpeqd ymm14,ymm14,ymm4 + vpcmpeqd ymm15,ymm15,ymm4 + + vmovdqa ymm7,YMMWORD PTR[((-32))+r10] + lea rdx,QWORD PTR[128+rdx] + mov r8d,9 -ALIGN 32 $L$oop_gather_1024:: - vpand xmm0,xmm8,XMMWORD PTR[((-64))+rdx] - vpand xmm1,xmm9,XMMWORD PTR[rdx] - vpand xmm2,xmm10,XMMWORD PTR[64+rdx] - vpand xmm3,xmm11,XMMWORD PTR[r11*2+rdx] - vpor xmm1,xmm1,xmm0 - vpand xmm4,xmm12,XMMWORD PTR[64+r11*2+rdx] - vpor xmm3,xmm3,xmm2 - vpand xmm5,xmm13,XMMWORD PTR[r11*4+rdx] - vpor xmm3,xmm3,xmm1 - vpand xmm6,xmm14,XMMWORD PTR[64+r11*4+rdx] + vmovdqa ymm0,YMMWORD PTR[((0-128))+rdx] + vmovdqa ymm1,YMMWORD PTR[((32-128))+rdx] + vmovdqa ymm2,YMMWORD PTR[((64-128))+rdx] + vmovdqa ymm3,YMMWORD PTR[((96-128))+rdx] + vpand ymm0,ymm0,YMMWORD PTR[((0+128))+rax] + vpand ymm1,ymm1,YMMWORD PTR[((32+128))+rax] + vpand ymm2,ymm2,YMMWORD PTR[((64+128))+rax] + vpor ymm4,ymm1,ymm0 + vpand ymm3,ymm3,YMMWORD PTR[((96+128))+rax] + vmovdqa ymm0,YMMWORD PTR[((128-128))+rdx] + vmovdqa ymm1,YMMWORD PTR[((160-128))+rdx] + vpor ymm5,ymm3,ymm2 + vmovdqa ymm2,YMMWORD PTR[((192-128))+rdx] + vmovdqa ymm3,YMMWORD PTR[((224-128))+rdx] + vpand ymm0,ymm0,YMMWORD PTR[((128+128))+rax] + vpand ymm1,ymm1,YMMWORD PTR[((160+128))+rax] + vpand ymm2,ymm2,YMMWORD PTR[((192+128))+rax] + vpor ymm4,ymm4,ymm0 + vpand ymm3,ymm3,YMMWORD PTR[((224+128))+rax] + vpand ymm0,ymm8,YMMWORD PTR[((256-128))+rdx] + vpor ymm5,ymm5,ymm1 + vpand ymm1,ymm9,YMMWORD PTR[((288-128))+rdx] + vpor ymm4,ymm4,ymm2 + vpand ymm2,ymm10,YMMWORD PTR[((320-128))+rdx] + vpor ymm5,ymm5,ymm3 + vpand ymm3,ymm11,YMMWORD PTR[((352-128))+rdx] + vpor ymm4,ymm4,ymm0 + vpand ymm0,ymm12,YMMWORD PTR[((384-128))+rdx] + vpor ymm5,ymm5,ymm1 + vpand ymm1,ymm13,YMMWORD PTR[((416-128))+rdx] + vpor ymm4,ymm4,ymm2 + vpand ymm2,ymm14,YMMWORD PTR[((448-128))+rdx] + vpor ymm5,ymm5,ymm3 + vpand ymm3,ymm15,YMMWORD PTR[((480-128))+rdx] + lea rdx,QWORD PTR[512+rdx] + vpor ymm4,ymm4,ymm0 + vpor ymm5,ymm5,ymm1 + vpor ymm4,ymm4,ymm2 + vpor ymm5,ymm5,ymm3 + + vpor ymm4,ymm4,ymm5 + vextracti128 xmm5,ymm4,1 vpor xmm5,xmm5,xmm4 - vpand xmm2,xmm15,XMMWORD PTR[((-128))+r11*8+rdx] - lea rdx,QWORD PTR[r11*8+rdx] - vpor xmm5,xmm5,xmm3 - vpor xmm6,xmm6,xmm2 - vpor xmm6,xmm6,xmm5 - vpermd ymm6,ymm7,ymm6 - vmovdqu YMMWORD PTR[rcx],ymm6 + vpermd ymm5,ymm7,ymm5 + vmovdqu YMMWORD PTR[rcx],ymm5 lea rcx,QWORD PTR[32+rcx] - dec eax + dec r8d jnz $L$oop_gather_1024 vpxor ymm0,ymm0,ymm0 vmovdqu YMMWORD PTR[rcx],ymm0 vzeroupper - movaps xmm6,XMMWORD PTR[rsp] - movaps xmm7,XMMWORD PTR[16+rsp] - movaps xmm8,XMMWORD PTR[32+rsp] - movaps xmm9,XMMWORD PTR[48+rsp] - movaps xmm10,XMMWORD PTR[64+rsp] - movaps xmm11,XMMWORD PTR[80+rsp] - movaps xmm12,XMMWORD PTR[96+rsp] - movaps xmm13,XMMWORD PTR[112+rsp] - movaps xmm14,XMMWORD PTR[128+rsp] - movaps xmm15,XMMWORD PTR[144+rsp] - lea rsp,QWORD PTR[168+rsp] + movaps xmm6,XMMWORD PTR[((-168))+r11] + movaps xmm7,XMMWORD PTR[((-152))+r11] + movaps xmm8,XMMWORD PTR[((-136))+r11] + movaps xmm9,XMMWORD PTR[((-120))+r11] + movaps xmm10,XMMWORD PTR[((-104))+r11] + movaps xmm11,XMMWORD PTR[((-88))+r11] + movaps xmm12,XMMWORD PTR[((-72))+r11] + movaps xmm13,XMMWORD PTR[((-56))+r11] + movaps xmm14,XMMWORD PTR[((-40))+r11] + movaps xmm15,XMMWORD PTR[((-24))+r11] $L$SEH_end_rsaz_1024_gather5:: + lea rsp,QWORD PTR[r11] DB 0F3h,0C3h ;repret rsaz_1024_gather5_avx2 ENDP EXTERN OPENSSL_ia32cap_P:NEAR @@ -1728,8 +1788,10 @@ $L$scatter_permd:: DD 0,2,4,6,7,7,7,7 $L$gather_permd:: DD 0,7,1,7,2,7,3,7 -$L$gather_table:: -DB 0,0,0,0,0,0,0,0,0ffh,0,0,0,0,0,0,0 +$L$inc:: + DD 0,0,0,0,1,1,1,1 + DD 2,2,2,2,3,3,3,3 + DD 4,4,4,4,4,4,4,4 ALIGN 64 EXTERN __imp_RtlVirtualUnwind:NEAR @@ -1850,7 +1912,7 @@ DB 9,0,0,0 DD imagerel rsaz_se_handler DD imagerel $L$mul_1024_body,imagerel $L$mul_1024_epilogue $L$SEH_info_rsaz_1024_gather5:: -DB 001h,033h,016h,000h +DB 001h,036h,017h,00bh DB 036h,0f8h,009h,000h DB 031h,0e8h,008h,000h DB 02ch,0d8h,007h,000h @@ -1862,6 +1924,7 @@ DB 013h,088h,002h,000h DB 00eh,078h,001h,000h DB 009h,068h,000h,000h DB 004h,001h,015h,000h +DB 000h,0b3h,000h,000h .xdata ENDS END diff --git a/deps/openssl/asm/x64-win32-masm/bn/rsaz-x86_64.asm b/deps/openssl/asm/x64-win32-masm/bn/rsaz-x86_64.asm index 1c6440470d9992..e431b620902c8b 100644 --- a/deps/openssl/asm/x64-win32-masm/bn/rsaz-x86_64.asm +++ b/deps/openssl/asm/x64-win32-masm/bn/rsaz-x86_64.asm @@ -803,52 +803,108 @@ $L$SEH_begin_rsaz_512_mul_gather4:: push r14 push r15 - mov r9d,r9d - sub rsp,128+24 + sub rsp,328 + movaps XMMWORD PTR[160+rsp],xmm6 + movaps XMMWORD PTR[176+rsp],xmm7 + movaps XMMWORD PTR[192+rsp],xmm8 + movaps XMMWORD PTR[208+rsp],xmm9 + movaps XMMWORD PTR[224+rsp],xmm10 + movaps XMMWORD PTR[240+rsp],xmm11 + movaps XMMWORD PTR[256+rsp],xmm12 + movaps XMMWORD PTR[272+rsp],xmm13 + movaps XMMWORD PTR[288+rsp],xmm14 + movaps XMMWORD PTR[304+rsp],xmm15 $L$mul_gather4_body:: + movd xmm8,r9d + movdqa xmm1,XMMWORD PTR[(($L$inc+16))] + movdqa xmm0,XMMWORD PTR[$L$inc] + + pshufd xmm8,xmm8,0 + movdqa xmm7,xmm1 + movdqa xmm2,xmm1 + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm8 + movdqa xmm3,xmm7 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm8 + movdqa xmm4,xmm7 + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm8 + movdqa xmm5,xmm7 + paddd xmm4,xmm3 + pcmpeqd xmm3,xmm8 + movdqa xmm6,xmm7 + paddd xmm5,xmm4 + pcmpeqd xmm4,xmm8 + paddd xmm6,xmm5 + pcmpeqd xmm5,xmm8 + paddd xmm7,xmm6 + pcmpeqd xmm6,xmm8 + pcmpeqd xmm7,xmm8 + + movdqa xmm8,XMMWORD PTR[rdx] + movdqa xmm9,XMMWORD PTR[16+rdx] + movdqa xmm10,XMMWORD PTR[32+rdx] + movdqa xmm11,XMMWORD PTR[48+rdx] + pand xmm8,xmm0 + movdqa xmm12,XMMWORD PTR[64+rdx] + pand xmm9,xmm1 + movdqa xmm13,XMMWORD PTR[80+rdx] + pand xmm10,xmm2 + movdqa xmm14,XMMWORD PTR[96+rdx] + pand xmm11,xmm3 + movdqa xmm15,XMMWORD PTR[112+rdx] + lea rbp,QWORD PTR[128+rdx] + pand xmm12,xmm4 + pand xmm13,xmm5 + pand xmm14,xmm6 + pand xmm15,xmm7 + por xmm8,xmm10 + por xmm9,xmm11 + por xmm8,xmm12 + por xmm9,xmm13 + por xmm8,xmm14 + por xmm9,xmm15 + + por xmm8,xmm9 + pshufd xmm9,xmm8,04eh + por xmm8,xmm9 mov r11d,080100h and r11d,DWORD PTR[((OPENSSL_ia32cap_P+8))] cmp r11d,080100h je $L$mulx_gather - mov eax,DWORD PTR[64+r9*4+rdx] -DB 102,72,15,110,199 - mov ebx,DWORD PTR[r9*4+rdx] -DB 102,72,15,110,201 +DB 102,76,15,126,195 + mov QWORD PTR[128+rsp],r8 + mov QWORD PTR[((128+8))+rsp],rdi + mov QWORD PTR[((128+16))+rsp],rcx - shl rax,32 - or rbx,rax mov rax,QWORD PTR[rsi] mov rcx,QWORD PTR[8+rsi] - lea rbp,QWORD PTR[128+r9*4+rdx] mul rbx mov QWORD PTR[rsp],rax mov rax,rcx mov r8,rdx mul rbx - movd xmm4,DWORD PTR[rbp] add r8,rax mov rax,QWORD PTR[16+rsi] mov r9,rdx adc r9,0 mul rbx - movd xmm5,DWORD PTR[64+rbp] add r9,rax mov rax,QWORD PTR[24+rsi] mov r10,rdx adc r10,0 mul rbx - pslldq xmm5,4 add r10,rax mov rax,QWORD PTR[32+rsi] mov r11,rdx adc r11,0 mul rbx - por xmm4,xmm5 add r11,rax mov rax,QWORD PTR[40+rsi] mov r12,rdx @@ -861,14 +917,12 @@ DB 102,72,15,110,201 adc r13,0 mul rbx - lea rbp,QWORD PTR[128+rbp] add r13,rax mov rax,QWORD PTR[56+rsi] mov r14,rdx adc r14,0 mul rbx -DB 102,72,15,126,227 add r14,rax mov rax,QWORD PTR[rsi] mov r15,rdx @@ -880,6 +934,35 @@ DB 102,72,15,126,227 ALIGN 32 $L$oop_mul_gather:: + movdqa xmm8,XMMWORD PTR[rbp] + movdqa xmm9,XMMWORD PTR[16+rbp] + movdqa xmm10,XMMWORD PTR[32+rbp] + movdqa xmm11,XMMWORD PTR[48+rbp] + pand xmm8,xmm0 + movdqa xmm12,XMMWORD PTR[64+rbp] + pand xmm9,xmm1 + movdqa xmm13,XMMWORD PTR[80+rbp] + pand xmm10,xmm2 + movdqa xmm14,XMMWORD PTR[96+rbp] + pand xmm11,xmm3 + movdqa xmm15,XMMWORD PTR[112+rbp] + lea rbp,QWORD PTR[128+rbp] + pand xmm12,xmm4 + pand xmm13,xmm5 + pand xmm14,xmm6 + pand xmm15,xmm7 + por xmm8,xmm10 + por xmm9,xmm11 + por xmm8,xmm12 + por xmm9,xmm13 + por xmm8,xmm14 + por xmm9,xmm15 + + por xmm8,xmm9 + pshufd xmm9,xmm8,04eh + por xmm8,xmm9 +DB 102,76,15,126,195 + mul rbx add r8,rax mov rax,QWORD PTR[8+rsi] @@ -888,7 +971,6 @@ $L$oop_mul_gather:: adc r8,0 mul rbx - movd xmm4,DWORD PTR[rbp] add r9,rax mov rax,QWORD PTR[16+rsi] adc rdx,0 @@ -897,7 +979,6 @@ $L$oop_mul_gather:: adc r9,0 mul rbx - movd xmm5,DWORD PTR[64+rbp] add r10,rax mov rax,QWORD PTR[24+rsi] adc rdx,0 @@ -906,7 +987,6 @@ $L$oop_mul_gather:: adc r10,0 mul rbx - pslldq xmm5,4 add r11,rax mov rax,QWORD PTR[32+rsi] adc rdx,0 @@ -915,7 +995,6 @@ $L$oop_mul_gather:: adc r11,0 mul rbx - por xmm4,xmm5 add r12,rax mov rax,QWORD PTR[40+rsi] adc rdx,0 @@ -940,7 +1019,6 @@ $L$oop_mul_gather:: adc r14,0 mul rbx -DB 102,72,15,126,227 add r15,rax mov rax,QWORD PTR[rsi] adc rdx,0 @@ -948,7 +1026,6 @@ DB 102,72,15,126,227 mov r15,rdx adc r15,0 - lea rbp,QWORD PTR[128+rbp] lea rdi,QWORD PTR[8+rdi] dec ecx @@ -963,8 +1040,8 @@ DB 102,72,15,126,227 mov QWORD PTR[48+rdi],r14 mov QWORD PTR[56+rdi],r15 -DB 102,72,15,126,199 -DB 102,72,15,126,205 + mov rdi,QWORD PTR[((128+8))+rsp] + mov rbp,QWORD PTR[((128+16))+rsp] mov r8,QWORD PTR[rsp] mov r9,QWORD PTR[8+rsp] @@ -980,45 +1057,37 @@ DB 102,72,15,126,205 ALIGN 32 $L$mulx_gather:: - mov eax,DWORD PTR[64+r9*4+rdx] -DB 102,72,15,110,199 - lea rbp,QWORD PTR[128+r9*4+rdx] - mov edx,DWORD PTR[r9*4+rdx] -DB 102,72,15,110,201 +DB 102,76,15,126,194 + mov QWORD PTR[128+rsp],r8 + mov QWORD PTR[((128+8))+rsp],rdi + mov QWORD PTR[((128+16))+rsp],rcx - shl rax,32 - or rdx,rax mulx r8,rbx,QWORD PTR[rsi] mov QWORD PTR[rsp],rbx xor edi,edi mulx r9,rax,QWORD PTR[8+rsi] - movd xmm4,DWORD PTR[rbp] mulx r10,rbx,QWORD PTR[16+rsi] - movd xmm5,DWORD PTR[64+rbp] adcx r8,rax mulx r11,rax,QWORD PTR[24+rsi] - pslldq xmm5,4 adcx r9,rbx mulx r12,rbx,QWORD PTR[32+rsi] - por xmm4,xmm5 adcx r10,rax mulx r13,rax,QWORD PTR[40+rsi] adcx r11,rbx mulx r14,rbx,QWORD PTR[48+rsi] - lea rbp,QWORD PTR[128+rbp] adcx r12,rax mulx r15,rax,QWORD PTR[56+rsi] -DB 102,72,15,126,226 adcx r13,rbx adcx r14,rax +DB 067h mov rbx,r8 adcx r15,rdi @@ -1027,24 +1096,48 @@ DB 102,72,15,126,226 ALIGN 32 $L$oop_mulx_gather:: - mulx r8,rax,QWORD PTR[rsi] + movdqa xmm8,XMMWORD PTR[rbp] + movdqa xmm9,XMMWORD PTR[16+rbp] + movdqa xmm10,XMMWORD PTR[32+rbp] + movdqa xmm11,XMMWORD PTR[48+rbp] + pand xmm8,xmm0 + movdqa xmm12,XMMWORD PTR[64+rbp] + pand xmm9,xmm1 + movdqa xmm13,XMMWORD PTR[80+rbp] + pand xmm10,xmm2 + movdqa xmm14,XMMWORD PTR[96+rbp] + pand xmm11,xmm3 + movdqa xmm15,XMMWORD PTR[112+rbp] + lea rbp,QWORD PTR[128+rbp] + pand xmm12,xmm4 + pand xmm13,xmm5 + pand xmm14,xmm6 + pand xmm15,xmm7 + por xmm8,xmm10 + por xmm9,xmm11 + por xmm8,xmm12 + por xmm9,xmm13 + por xmm8,xmm14 + por xmm9,xmm15 + + por xmm8,xmm9 + pshufd xmm9,xmm8,04eh + por xmm8,xmm9 +DB 102,76,15,126,194 + +DB 0c4h,062h,0fbh,0f6h,086h,000h,000h,000h,000h adcx rbx,rax adox r8,r9 mulx r9,rax,QWORD PTR[8+rsi] -DB 066h,00fh,06eh,0a5h,000h,000h,000h,000h adcx r8,rax adox r9,r10 mulx r10,rax,QWORD PTR[16+rsi] - movd xmm5,DWORD PTR[64+rbp] - lea rbp,QWORD PTR[128+rbp] adcx r9,rax adox r10,r11 DB 0c4h,062h,0fbh,0f6h,09eh,018h,000h,000h,000h - pslldq xmm5,4 - por xmm4,xmm5 adcx r10,rax adox r11,r12 @@ -1058,10 +1151,10 @@ DB 0c4h,062h,0fbh,0f6h,09eh,018h,000h,000h,000h DB 0c4h,062h,0fbh,0f6h,0b6h,030h,000h,000h,000h adcx r13,rax +DB 067h adox r14,r15 mulx r15,rax,QWORD PTR[56+rsi] -DB 102,72,15,126,226 mov QWORD PTR[64+rcx*8+rsp],rbx adcx r14,rax adox r15,rdi @@ -1080,10 +1173,10 @@ DB 102,72,15,126,226 mov QWORD PTR[((64+48))+rsp],r14 mov QWORD PTR[((64+56))+rsp],r15 -DB 102,72,15,126,199 -DB 102,72,15,126,205 - mov rdx,QWORD PTR[128+rsp] + mov rdi,QWORD PTR[((128+8))+rsp] + mov rbp,QWORD PTR[((128+16))+rsp] + mov r8,QWORD PTR[rsp] mov r9,QWORD PTR[8+rsp] mov r10,QWORD PTR[16+rsp] @@ -1109,6 +1202,17 @@ $L$mul_gather_tail:: call __rsaz_512_subtract lea rax,QWORD PTR[((128+24+48))+rsp] + movaps xmm6,XMMWORD PTR[((160-200))+rax] + movaps xmm7,XMMWORD PTR[((176-200))+rax] + movaps xmm8,XMMWORD PTR[((192-200))+rax] + movaps xmm9,XMMWORD PTR[((208-200))+rax] + movaps xmm10,XMMWORD PTR[((224-200))+rax] + movaps xmm11,XMMWORD PTR[((240-200))+rax] + movaps xmm12,XMMWORD PTR[((256-200))+rax] + movaps xmm13,XMMWORD PTR[((272-200))+rax] + movaps xmm14,XMMWORD PTR[((288-200))+rax] + movaps xmm15,XMMWORD PTR[((304-200))+rax] + lea rax,QWORD PTR[176+rax] mov r15,QWORD PTR[((-48))+rax] mov r14,QWORD PTR[((-40))+rax] mov r13,QWORD PTR[((-32))+rax] @@ -1148,7 +1252,7 @@ $L$SEH_begin_rsaz_512_mul_scatter4:: mov r9d,r9d sub rsp,128+24 $L$mul_scatter4_body:: - lea r8,QWORD PTR[r9*4+r8] + lea r8,QWORD PTR[r9*8+r8] DB 102,72,15,110,199 DB 102,72,15,110,202 DB 102,73,15,110,208 @@ -1211,30 +1315,14 @@ DB 102,72,15,126,214 call __rsaz_512_subtract - mov DWORD PTR[rsi],r8d - shr r8,32 - mov DWORD PTR[128+rsi],r9d - shr r9,32 - mov DWORD PTR[256+rsi],r10d - shr r10,32 - mov DWORD PTR[384+rsi],r11d - shr r11,32 - mov DWORD PTR[512+rsi],r12d - shr r12,32 - mov DWORD PTR[640+rsi],r13d - shr r13,32 - mov DWORD PTR[768+rsi],r14d - shr r14,32 - mov DWORD PTR[896+rsi],r15d - shr r15,32 - mov DWORD PTR[64+rsi],r8d - mov DWORD PTR[192+rsi],r9d - mov DWORD PTR[320+rsi],r10d - mov DWORD PTR[448+rsi],r11d - mov DWORD PTR[576+rsi],r12d - mov DWORD PTR[704+rsi],r13d - mov DWORD PTR[832+rsi],r14d - mov DWORD PTR[960+rsi],r15d + mov QWORD PTR[rsi],r8 + mov QWORD PTR[128+rsi],r9 + mov QWORD PTR[256+rsi],r10 + mov QWORD PTR[384+rsi],r11 + mov QWORD PTR[512+rsi],r12 + mov QWORD PTR[640+rsi],r13 + mov QWORD PTR[768+rsi],r14 + mov QWORD PTR[896+rsi],r15 lea rax,QWORD PTR[((128+24+48))+rsp] mov r15,QWORD PTR[((-48))+rax] @@ -1789,16 +1877,14 @@ PUBLIC rsaz_512_scatter4 ALIGN 16 rsaz_512_scatter4 PROC PUBLIC - lea rcx,QWORD PTR[r8*4+rcx] + lea rcx,QWORD PTR[r8*8+rcx] mov r9d,8 jmp $L$oop_scatter ALIGN 16 $L$oop_scatter:: mov rax,QWORD PTR[rdx] lea rdx,QWORD PTR[8+rdx] - mov DWORD PTR[rcx],eax - shr rax,32 - mov DWORD PTR[64+rcx],eax + mov QWORD PTR[rcx],rax lea rcx,QWORD PTR[128+rcx] dec r9d jnz $L$oop_scatter @@ -1809,22 +1895,98 @@ PUBLIC rsaz_512_gather4 ALIGN 16 rsaz_512_gather4 PROC PUBLIC - lea rdx,QWORD PTR[r8*4+rdx] +$L$SEH_begin_rsaz_512_gather4:: +DB 048h,081h,0ech,0a8h,000h,000h,000h +DB 00fh,029h,034h,024h +DB 00fh,029h,07ch,024h,010h +DB 044h,00fh,029h,044h,024h,020h +DB 044h,00fh,029h,04ch,024h,030h +DB 044h,00fh,029h,054h,024h,040h +DB 044h,00fh,029h,05ch,024h,050h +DB 044h,00fh,029h,064h,024h,060h +DB 044h,00fh,029h,06ch,024h,070h +DB 044h,00fh,029h,0b4h,024h,080h,0,0,0 +DB 044h,00fh,029h,0bch,024h,090h,0,0,0 + movd xmm8,r8d + movdqa xmm1,XMMWORD PTR[(($L$inc+16))] + movdqa xmm0,XMMWORD PTR[$L$inc] + + pshufd xmm8,xmm8,0 + movdqa xmm7,xmm1 + movdqa xmm2,xmm1 + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm8 + movdqa xmm3,xmm7 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm8 + movdqa xmm4,xmm7 + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm8 + movdqa xmm5,xmm7 + paddd xmm4,xmm3 + pcmpeqd xmm3,xmm8 + movdqa xmm6,xmm7 + paddd xmm5,xmm4 + pcmpeqd xmm4,xmm8 + paddd xmm6,xmm5 + pcmpeqd xmm5,xmm8 + paddd xmm7,xmm6 + pcmpeqd xmm6,xmm8 + pcmpeqd xmm7,xmm8 mov r9d,8 jmp $L$oop_gather ALIGN 16 $L$oop_gather:: - mov eax,DWORD PTR[rdx] - mov r8d,DWORD PTR[64+rdx] + movdqa xmm8,XMMWORD PTR[rdx] + movdqa xmm9,XMMWORD PTR[16+rdx] + movdqa xmm10,XMMWORD PTR[32+rdx] + movdqa xmm11,XMMWORD PTR[48+rdx] + pand xmm8,xmm0 + movdqa xmm12,XMMWORD PTR[64+rdx] + pand xmm9,xmm1 + movdqa xmm13,XMMWORD PTR[80+rdx] + pand xmm10,xmm2 + movdqa xmm14,XMMWORD PTR[96+rdx] + pand xmm11,xmm3 + movdqa xmm15,XMMWORD PTR[112+rdx] lea rdx,QWORD PTR[128+rdx] - shl r8,32 - or rax,r8 - mov QWORD PTR[rcx],rax + pand xmm12,xmm4 + pand xmm13,xmm5 + pand xmm14,xmm6 + pand xmm15,xmm7 + por xmm8,xmm10 + por xmm9,xmm11 + por xmm8,xmm12 + por xmm9,xmm13 + por xmm8,xmm14 + por xmm9,xmm15 + + por xmm8,xmm9 + pshufd xmm9,xmm8,04eh + por xmm8,xmm9 + movq QWORD PTR[rcx],xmm8 lea rcx,QWORD PTR[8+rcx] dec r9d jnz $L$oop_gather + movaps xmm6,XMMWORD PTR[rsp] + movaps xmm7,XMMWORD PTR[16+rsp] + movaps xmm8,XMMWORD PTR[32+rsp] + movaps xmm9,XMMWORD PTR[48+rsp] + movaps xmm10,XMMWORD PTR[64+rsp] + movaps xmm11,XMMWORD PTR[80+rsp] + movaps xmm12,XMMWORD PTR[96+rsp] + movaps xmm13,XMMWORD PTR[112+rsp] + movaps xmm14,XMMWORD PTR[128+rsp] + movaps xmm15,XMMWORD PTR[144+rsp] + add rsp,0a8h DB 0F3h,0C3h ;repret +$L$SEH_end_rsaz_512_gather4:: rsaz_512_gather4 ENDP + +ALIGN 64 +$L$inc:: + DD 0,0,1,1 + DD 2,2,2,2 EXTERN __imp_RtlVirtualUnwind:NEAR ALIGN 16 @@ -1860,6 +2022,18 @@ se_handler PROC PRIVATE lea rax,QWORD PTR[((128+24+48))+rax] + lea rbx,QWORD PTR[$L$mul_gather4_epilogue] + cmp rbx,r10 + jne $L$se_not_in_mul_gather4 + + lea rax,QWORD PTR[176+rax] + + lea rsi,QWORD PTR[((-48-168))+rax] + lea rdi,QWORD PTR[512+r8] + mov ecx,20 + DD 0a548f3fch + +$L$se_not_in_mul_gather4:: mov rbx,QWORD PTR[((-8))+rax] mov rbp,QWORD PTR[((-16))+rax] mov r12,QWORD PTR[((-24))+rax] @@ -1936,6 +2110,10 @@ ALIGN 4 DD imagerel $L$SEH_end_rsaz_512_mul_by_one DD imagerel $L$SEH_info_rsaz_512_mul_by_one + DD imagerel $L$SEH_begin_rsaz_512_gather4 + DD imagerel $L$SEH_end_rsaz_512_gather4 + DD imagerel $L$SEH_info_rsaz_512_gather4 + .pdata ENDS .xdata SEGMENT READONLY ALIGN(8) ALIGN 8 @@ -1959,6 +2137,19 @@ $L$SEH_info_rsaz_512_mul_by_one:: DB 9,0,0,0 DD imagerel se_handler DD imagerel $L$mul_by_one_body,imagerel $L$mul_by_one_epilogue +$L$SEH_info_rsaz_512_gather4:: +DB 001h,046h,016h,000h +DB 046h,0f8h,009h,000h +DB 03dh,0e8h,008h,000h +DB 034h,0d8h,007h,000h +DB 02eh,0c8h,006h,000h +DB 028h,0b8h,005h,000h +DB 022h,0a8h,004h,000h +DB 01ch,098h,003h,000h +DB 016h,088h,002h,000h +DB 010h,078h,001h,000h +DB 00bh,068h,000h,000h +DB 007h,001h,015h,000h .xdata ENDS END diff --git a/deps/openssl/asm/x64-win32-masm/bn/x86_64-mont.asm b/deps/openssl/asm/x64-win32-masm/bn/x86_64-mont.asm index f2527450608007..e70ec9f31ab574 100644 --- a/deps/openssl/asm/x64-win32-masm/bn/x86_64-mont.asm +++ b/deps/openssl/asm/x64-win32-masm/bn/x86_64-mont.asm @@ -681,20 +681,20 @@ $L$sqr8x_enter:: - lea r11,QWORD PTR[((-64))+r9*4+rsp] + lea r11,QWORD PTR[((-64))+r9*2+rsp] mov r8,QWORD PTR[r8] sub r11,rsi and r11,4095 cmp r10,r11 jb $L$sqr8x_sp_alt sub rsp,r11 - lea rsp,QWORD PTR[((-64))+r9*4+rsp] + lea rsp,QWORD PTR[((-64))+r9*2+rsp] jmp $L$sqr8x_sp_done ALIGN 32 $L$sqr8x_sp_alt:: - lea r10,QWORD PTR[((4096-64))+r9*4] - lea rsp,QWORD PTR[((-64))+r9*4+rsp] + lea r10,QWORD PTR[((4096-64))+r9*2] + lea rsp,QWORD PTR[((-64))+r9*2+rsp] sub r11,r10 mov r10,0 cmovc r11,r10 @@ -704,73 +704,99 @@ $L$sqr8x_sp_done:: mov r10,r9 neg r9 - lea r11,QWORD PTR[64+r9*2+rsp] mov QWORD PTR[32+rsp],r8 mov QWORD PTR[40+rsp],rax $L$sqr8x_body:: - mov rbp,r9 -DB 102,73,15,110,211 - shr rbp,3+2 - mov eax,DWORD PTR[((OPENSSL_ia32cap_P+8))] - jmp $L$sqr8x_copy_n - -ALIGN 32 -$L$sqr8x_copy_n:: - movq xmm0,QWORD PTR[rcx] - movq xmm1,QWORD PTR[8+rcx] - movq xmm3,QWORD PTR[16+rcx] - movq xmm4,QWORD PTR[24+rcx] - lea rcx,QWORD PTR[32+rcx] - movdqa XMMWORD PTR[r11],xmm0 - movdqa XMMWORD PTR[16+r11],xmm1 - movdqa XMMWORD PTR[32+r11],xmm3 - movdqa XMMWORD PTR[48+r11],xmm4 - lea r11,QWORD PTR[64+r11] - dec rbp - jnz $L$sqr8x_copy_n - +DB 102,72,15,110,209 pxor xmm0,xmm0 DB 102,72,15,110,207 DB 102,73,15,110,218 + mov eax,DWORD PTR[((OPENSSL_ia32cap_P+8))] and eax,080100h cmp eax,080100h jne $L$sqr8x_nox call bn_sqrx8x_internal - pxor xmm0,xmm0 - lea rax,QWORD PTR[48+rsp] - lea rdx,QWORD PTR[64+r9*2+rsp] - shr r9,3+2 - mov rsi,QWORD PTR[40+rsp] - jmp $L$sqr8x_zero + + + + lea rbx,QWORD PTR[rcx*1+r8] + mov r9,rcx + mov rdx,rcx +DB 102,72,15,126,207 + sar rcx,3+2 + jmp $L$sqr8x_sub ALIGN 32 $L$sqr8x_nox:: call bn_sqr8x_internal + + + + lea rbx,QWORD PTR[r9*1+rdi] + mov rcx,r9 + mov rdx,r9 +DB 102,72,15,126,207 + sar rcx,3+2 + jmp $L$sqr8x_sub + +ALIGN 32 +$L$sqr8x_sub:: + mov r12,QWORD PTR[rbx] + mov r13,QWORD PTR[8+rbx] + mov r14,QWORD PTR[16+rbx] + mov r15,QWORD PTR[24+rbx] + lea rbx,QWORD PTR[32+rbx] + sbb r12,QWORD PTR[rbp] + sbb r13,QWORD PTR[8+rbp] + sbb r14,QWORD PTR[16+rbp] + sbb r15,QWORD PTR[24+rbp] + lea rbp,QWORD PTR[32+rbp] + mov QWORD PTR[rdi],r12 + mov QWORD PTR[8+rdi],r13 + mov QWORD PTR[16+rdi],r14 + mov QWORD PTR[24+rdi],r15 + lea rdi,QWORD PTR[32+rdi] + inc rcx + jnz $L$sqr8x_sub + + sbb rax,0 + lea rbx,QWORD PTR[r9*1+rbx] + lea rdi,QWORD PTR[r9*1+rdi] + +DB 102,72,15,110,200 pxor xmm0,xmm0 - lea rax,QWORD PTR[48+rsp] - lea rdx,QWORD PTR[64+r9*2+rsp] - shr r9,3+2 + pshufd xmm1,xmm1,0 mov rsi,QWORD PTR[40+rsp] - jmp $L$sqr8x_zero + jmp $L$sqr8x_cond_copy ALIGN 32 -$L$sqr8x_zero:: - movdqa XMMWORD PTR[rax],xmm0 - movdqa XMMWORD PTR[16+rax],xmm0 - movdqa XMMWORD PTR[32+rax],xmm0 - movdqa XMMWORD PTR[48+rax],xmm0 - lea rax,QWORD PTR[64+rax] - movdqa XMMWORD PTR[rdx],xmm0 - movdqa XMMWORD PTR[16+rdx],xmm0 - movdqa XMMWORD PTR[32+rdx],xmm0 - movdqa XMMWORD PTR[48+rdx],xmm0 - lea rdx,QWORD PTR[64+rdx] - dec r9 - jnz $L$sqr8x_zero +$L$sqr8x_cond_copy:: + movdqa xmm2,XMMWORD PTR[rbx] + movdqa xmm3,XMMWORD PTR[16+rbx] + lea rbx,QWORD PTR[32+rbx] + movdqu xmm4,XMMWORD PTR[rdi] + movdqu xmm5,XMMWORD PTR[16+rdi] + lea rdi,QWORD PTR[32+rdi] + movdqa XMMWORD PTR[(-32)+rbx],xmm0 + movdqa XMMWORD PTR[(-16)+rbx],xmm0 + movdqa XMMWORD PTR[(-32)+rdx*1+rbx],xmm0 + movdqa XMMWORD PTR[(-16)+rdx*1+rbx],xmm0 + pcmpeqd xmm0,xmm1 + pand xmm2,xmm1 + pand xmm3,xmm1 + pand xmm4,xmm0 + pand xmm5,xmm0 + pxor xmm0,xmm0 + por xmm4,xmm2 + por xmm5,xmm3 + movdqu XMMWORD PTR[(-32)+rdi],xmm4 + movdqu XMMWORD PTR[(-16)+rdi],xmm5 + add r9,32 + jnz $L$sqr8x_cond_copy mov rax,1 mov r15,QWORD PTR[((-48))+rsi] @@ -1040,64 +1066,75 @@ $L$mulx4x_inner:: adc r15,rbp sub rbp,QWORD PTR[rbx] adc r14,r15 - mov r8,QWORD PTR[((-8))+rcx] sbb r15,r15 mov QWORD PTR[((-8))+rbx],r14 cmp rdi,QWORD PTR[16+rsp] jne $L$mulx4x_outer - sub r8,r14 - sbb r8,r8 - or r15,r8 - - neg rax - xor rdx,rdx + lea rbx,QWORD PTR[64+rsp] + sub rcx,rax + neg r15 + mov rdx,rax + shr rax,3+2 mov rdi,QWORD PTR[32+rsp] + jmp $L$mulx4x_sub + +ALIGN 32 +$L$mulx4x_sub:: + mov r11,QWORD PTR[rbx] + mov r12,QWORD PTR[8+rbx] + mov r13,QWORD PTR[16+rbx] + mov r14,QWORD PTR[24+rbx] + lea rbx,QWORD PTR[32+rbx] + sbb r11,QWORD PTR[rcx] + sbb r12,QWORD PTR[8+rcx] + sbb r13,QWORD PTR[16+rcx] + sbb r14,QWORD PTR[24+rcx] + lea rcx,QWORD PTR[32+rcx] + mov QWORD PTR[rdi],r11 + mov QWORD PTR[8+rdi],r12 + mov QWORD PTR[16+rdi],r13 + mov QWORD PTR[24+rdi],r14 + lea rdi,QWORD PTR[32+rdi] + dec rax + jnz $L$mulx4x_sub + + sbb r15,0 lea rbx,QWORD PTR[64+rsp] + sub rdi,rdx +DB 102,73,15,110,207 pxor xmm0,xmm0 - mov r8,QWORD PTR[rax*1+rcx] - mov r9,QWORD PTR[8+rax*1+rcx] - neg r8 - jmp $L$mulx4x_sub_entry + pshufd xmm1,xmm1,0 + mov rsi,QWORD PTR[40+rsp] + jmp $L$mulx4x_cond_copy ALIGN 32 -$L$mulx4x_sub:: - mov r8,QWORD PTR[rax*1+rcx] - mov r9,QWORD PTR[8+rax*1+rcx] - not r8 -$L$mulx4x_sub_entry:: - mov r10,QWORD PTR[16+rax*1+rcx] - not r9 - and r8,r15 - mov r11,QWORD PTR[24+rax*1+rcx] - not r10 - and r9,r15 - not r11 - and r10,r15 - and r11,r15 - - neg rdx - adc r8,QWORD PTR[rbx] - adc r9,QWORD PTR[8+rbx] - movdqa XMMWORD PTR[rbx],xmm0 - adc r10,QWORD PTR[16+rbx] - adc r11,QWORD PTR[24+rbx] - movdqa XMMWORD PTR[16+rbx],xmm0 +$L$mulx4x_cond_copy:: + movdqa xmm2,XMMWORD PTR[rbx] + movdqa xmm3,XMMWORD PTR[16+rbx] lea rbx,QWORD PTR[32+rbx] - sbb rdx,rdx - - mov QWORD PTR[rdi],r8 - mov QWORD PTR[8+rdi],r9 - mov QWORD PTR[16+rdi],r10 - mov QWORD PTR[24+rdi],r11 + movdqu xmm4,XMMWORD PTR[rdi] + movdqu xmm5,XMMWORD PTR[16+rdi] lea rdi,QWORD PTR[32+rdi] + movdqa XMMWORD PTR[(-32)+rbx],xmm0 + movdqa XMMWORD PTR[(-16)+rbx],xmm0 + pcmpeqd xmm0,xmm1 + pand xmm2,xmm1 + pand xmm3,xmm1 + pand xmm4,xmm0 + pand xmm5,xmm0 + pxor xmm0,xmm0 + por xmm4,xmm2 + por xmm5,xmm3 + movdqu XMMWORD PTR[(-32)+rdi],xmm4 + movdqu XMMWORD PTR[(-16)+rdi],xmm5 + sub rdx,32 + jnz $L$mulx4x_cond_copy - add rax,32 - jnz $L$mulx4x_sub + mov QWORD PTR[rbx],rdx - mov rsi,QWORD PTR[40+rsp] mov rax,1 mov r15,QWORD PTR[((-48))+rsi] mov r14,QWORD PTR[((-40))+rsi] diff --git a/deps/openssl/asm/x64-win32-masm/bn/x86_64-mont5.asm b/deps/openssl/asm/x64-win32-masm/bn/x86_64-mont5.asm index 9fdd91d0165574..080fb167848f84 100644 --- a/deps/openssl/asm/x64-win32-masm/bn/x86_64-mont5.asm +++ b/deps/openssl/asm/x64-win32-masm/bn/x86_64-mont5.asm @@ -28,49 +28,151 @@ ALIGN 16 $L$mul_enter:: mov r9d,r9d mov rax,rsp - mov r10d,DWORD PTR[56+rsp] + movd xmm5,DWORD PTR[56+rsp] + lea r10,QWORD PTR[$L$inc] push rbx push rbp push r12 push r13 push r14 push r15 - lea rsp,QWORD PTR[((-40))+rsp] - movaps XMMWORD PTR[rsp],xmm6 - movaps XMMWORD PTR[16+rsp],xmm7 + lea r11,QWORD PTR[2+r9] neg r11 - lea rsp,QWORD PTR[r11*8+rsp] + lea rsp,QWORD PTR[((-264))+r11*8+rsp] and rsp,-1024 mov QWORD PTR[8+r9*8+rsp],rax $L$mul_body:: - mov r12,rdx - mov r11,r10 - shr r10,3 - and r11,7 - not r10 - lea rax,QWORD PTR[$L$magic_masks] - and r10,3 - lea r12,QWORD PTR[96+r11*8+r12] - movq xmm4,QWORD PTR[r10*8+rax] - movq xmm5,QWORD PTR[8+r10*8+rax] - movq xmm6,QWORD PTR[16+r10*8+rax] - movq xmm7,QWORD PTR[24+r10*8+rax] - - movq xmm0,QWORD PTR[((-96))+r12] - movq xmm1,QWORD PTR[((-32))+r12] - pand xmm0,xmm4 - movq xmm2,QWORD PTR[32+r12] - pand xmm1,xmm5 - movq xmm3,QWORD PTR[96+r12] - pand xmm2,xmm6 - por xmm0,xmm1 - pand xmm3,xmm7 + lea r12,QWORD PTR[128+rdx] + movdqa xmm0,XMMWORD PTR[r10] + movdqa xmm1,XMMWORD PTR[16+r10] + lea r10,QWORD PTR[((24-112))+r9*8+rsp] + and r10,-16 + + pshufd xmm5,xmm5,0 + movdqa xmm4,xmm1 + movdqa xmm2,xmm1 + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 +DB 067h + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[112+r10],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[128+r10],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[144+r10],xmm2 + movdqa xmm2,xmm4 + + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[160+r10],xmm3 + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[176+r10],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[192+r10],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[208+r10],xmm2 + movdqa xmm2,xmm4 + + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[224+r10],xmm3 + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[240+r10],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[256+r10],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[272+r10],xmm2 + movdqa xmm2,xmm4 + + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[288+r10],xmm3 + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[304+r10],xmm0 + + paddd xmm3,xmm2 +DB 067h + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[320+r10],xmm1 + + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[336+r10],xmm2 + pand xmm0,XMMWORD PTR[64+r12] + + pand xmm1,XMMWORD PTR[80+r12] + pand xmm2,XMMWORD PTR[96+r12] + movdqa XMMWORD PTR[352+r10],xmm3 + pand xmm3,XMMWORD PTR[112+r12] por xmm0,xmm2 + por xmm1,xmm3 + movdqa xmm4,XMMWORD PTR[((-128))+r12] + movdqa xmm5,XMMWORD PTR[((-112))+r12] + movdqa xmm2,XMMWORD PTR[((-96))+r12] + pand xmm4,XMMWORD PTR[112+r10] + movdqa xmm3,XMMWORD PTR[((-80))+r12] + pand xmm5,XMMWORD PTR[128+r10] + por xmm0,xmm4 + pand xmm2,XMMWORD PTR[144+r10] + por xmm1,xmm5 + pand xmm3,XMMWORD PTR[160+r10] + por xmm0,xmm2 + por xmm1,xmm3 + movdqa xmm4,XMMWORD PTR[((-64))+r12] + movdqa xmm5,XMMWORD PTR[((-48))+r12] + movdqa xmm2,XMMWORD PTR[((-32))+r12] + pand xmm4,XMMWORD PTR[176+r10] + movdqa xmm3,XMMWORD PTR[((-16))+r12] + pand xmm5,XMMWORD PTR[192+r10] + por xmm0,xmm4 + pand xmm2,XMMWORD PTR[208+r10] + por xmm1,xmm5 + pand xmm3,XMMWORD PTR[224+r10] + por xmm0,xmm2 + por xmm1,xmm3 + movdqa xmm4,XMMWORD PTR[r12] + movdqa xmm5,XMMWORD PTR[16+r12] + movdqa xmm2,XMMWORD PTR[32+r12] + pand xmm4,XMMWORD PTR[240+r10] + movdqa xmm3,XMMWORD PTR[48+r12] + pand xmm5,XMMWORD PTR[256+r10] + por xmm0,xmm4 + pand xmm2,XMMWORD PTR[272+r10] + por xmm1,xmm5 + pand xmm3,XMMWORD PTR[288+r10] + por xmm0,xmm2 + por xmm1,xmm3 + por xmm0,xmm1 + pshufd xmm1,xmm0,04eh + por xmm0,xmm1 lea r12,QWORD PTR[256+r12] - por xmm0,xmm3 - DB 102,72,15,126,195 mov r8,QWORD PTR[r8] @@ -79,29 +181,14 @@ DB 102,72,15,126,195 xor r14,r14 xor r15,r15 - movq xmm0,QWORD PTR[((-96))+r12] - movq xmm1,QWORD PTR[((-32))+r12] - pand xmm0,xmm4 - movq xmm2,QWORD PTR[32+r12] - pand xmm1,xmm5 - mov rbp,r8 mul rbx mov r10,rax mov rax,QWORD PTR[rcx] - movq xmm3,QWORD PTR[96+r12] - pand xmm2,xmm6 - por xmm0,xmm1 - pand xmm3,xmm7 - imul rbp,r10 mov r11,rdx - por xmm0,xmm2 - lea r12,QWORD PTR[256+r12] - por xmm0,xmm3 - mul rbp add r10,rax mov rax,QWORD PTR[8+rsi] @@ -134,14 +221,12 @@ $L$1st_enter:: cmp r15,r9 jne $L$1st -DB 102,72,15,126,195 add r13,rax - mov rax,QWORD PTR[rsi] adc rdx,0 add r13,r11 adc rdx,0 - mov QWORD PTR[((-16))+r15*8+rsp],r13 + mov QWORD PTR[((-16))+r9*8+rsp],r13 mov r13,rdx mov r11,r10 @@ -155,33 +240,78 @@ DB 102,72,15,126,195 jmp $L$outer ALIGN 16 $L$outer:: + lea rdx,QWORD PTR[((24+128))+r9*8+rsp] + and rdx,-16 + pxor xmm4,xmm4 + pxor xmm5,xmm5 + movdqa xmm0,XMMWORD PTR[((-128))+r12] + movdqa xmm1,XMMWORD PTR[((-112))+r12] + movdqa xmm2,XMMWORD PTR[((-96))+r12] + movdqa xmm3,XMMWORD PTR[((-80))+r12] + pand xmm0,XMMWORD PTR[((-128))+rdx] + pand xmm1,XMMWORD PTR[((-112))+rdx] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[((-96))+rdx] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[((-80))+rdx] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[((-64))+r12] + movdqa xmm1,XMMWORD PTR[((-48))+r12] + movdqa xmm2,XMMWORD PTR[((-32))+r12] + movdqa xmm3,XMMWORD PTR[((-16))+r12] + pand xmm0,XMMWORD PTR[((-64))+rdx] + pand xmm1,XMMWORD PTR[((-48))+rdx] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[((-32))+rdx] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[((-16))+rdx] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[r12] + movdqa xmm1,XMMWORD PTR[16+r12] + movdqa xmm2,XMMWORD PTR[32+r12] + movdqa xmm3,XMMWORD PTR[48+r12] + pand xmm0,XMMWORD PTR[rdx] + pand xmm1,XMMWORD PTR[16+rdx] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[32+rdx] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[48+rdx] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[64+r12] + movdqa xmm1,XMMWORD PTR[80+r12] + movdqa xmm2,XMMWORD PTR[96+r12] + movdqa xmm3,XMMWORD PTR[112+r12] + pand xmm0,XMMWORD PTR[64+rdx] + pand xmm1,XMMWORD PTR[80+rdx] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[96+rdx] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[112+rdx] + por xmm4,xmm2 + por xmm5,xmm3 + por xmm4,xmm5 + pshufd xmm0,xmm4,04eh + por xmm0,xmm4 + lea r12,QWORD PTR[256+r12] + + mov rax,QWORD PTR[rsi] +DB 102,72,15,126,195 + xor r15,r15 mov rbp,r8 mov r10,QWORD PTR[rsp] - movq xmm0,QWORD PTR[((-96))+r12] - movq xmm1,QWORD PTR[((-32))+r12] - pand xmm0,xmm4 - movq xmm2,QWORD PTR[32+r12] - pand xmm1,xmm5 - mul rbx add r10,rax mov rax,QWORD PTR[rcx] adc rdx,0 - movq xmm3,QWORD PTR[96+r12] - pand xmm2,xmm6 - por xmm0,xmm1 - pand xmm3,xmm7 - imul rbp,r10 mov r11,rdx - por xmm0,xmm2 - lea r12,QWORD PTR[256+r12] - por xmm0,xmm3 - mul rbp add r10,rax mov rax,QWORD PTR[8+rsi] @@ -217,15 +347,12 @@ $L$inner_enter:: cmp r15,r9 jne $L$inner -DB 102,72,15,126,195 - add r13,rax - mov rax,QWORD PTR[rsi] adc rdx,0 add r13,r10 - mov r10,QWORD PTR[r15*8+rsp] + mov r10,QWORD PTR[r9*8+rsp] adc rdx,0 - mov QWORD PTR[((-16))+r15*8+rsp],r13 + mov QWORD PTR[((-16))+r9*8+rsp],r13 mov r13,rdx xor rdx,rdx @@ -272,8 +399,7 @@ $L$copy:: mov rsi,QWORD PTR[8+r9*8+rsp] mov rax,1 - movaps xmm6,XMMWORD PTR[((-88))+rsi] - movaps xmm7,XMMWORD PTR[((-72))+rsi] + mov r15,QWORD PTR[((-48))+rsi] mov r14,QWORD PTR[((-40))+rsi] mov r13,QWORD PTR[((-32))+rsi] @@ -303,8 +429,8 @@ $L$SEH_begin_bn_mul4x_mont_gather5:: $L$mul4x_enter:: - and r11d,080100h - cmp r11d,080100h + and r11d,080108h + cmp r11d,080108h je $L$mulx4x_enter DB 067h mov rax,rsp @@ -314,13 +440,10 @@ DB 067h push r13 push r14 push r15 - lea rsp,QWORD PTR[((-40))+rsp] - movaps XMMWORD PTR[rsp],xmm6 - movaps XMMWORD PTR[16+rsp],xmm7 + DB 067h - mov r10d,r9d shl r9d,3 - shl r10d,3+2 + lea r10,QWORD PTR[r9*2+r9] neg r9 @@ -330,19 +453,21 @@ DB 067h - lea r11,QWORD PTR[((-64))+r9*2+rsp] - sub r11,rsi + + + lea r11,QWORD PTR[((-320))+r9*2+rsp] + sub r11,rdi and r11,4095 cmp r10,r11 jb $L$mul4xsp_alt sub rsp,r11 - lea rsp,QWORD PTR[((-64))+r9*2+rsp] + lea rsp,QWORD PTR[((-320))+r9*2+rsp] jmp $L$mul4xsp_done ALIGN 32 $L$mul4xsp_alt:: - lea r10,QWORD PTR[((4096-64))+r9*2] - lea rsp,QWORD PTR[((-64))+r9*2+rsp] + lea r10,QWORD PTR[((4096-320))+r9*2] + lea rsp,QWORD PTR[((-320))+r9*2+rsp] sub r11,r10 mov r10,0 cmovc r11,r10 @@ -358,8 +483,7 @@ $L$mul4x_body:: mov rsi,QWORD PTR[40+rsp] mov rax,1 - movaps xmm6,XMMWORD PTR[((-88))+rsi] - movaps xmm7,XMMWORD PTR[((-72))+rsi] + mov r15,QWORD PTR[((-48))+rsi] mov r14,QWORD PTR[((-40))+rsi] mov r13,QWORD PTR[((-32))+rsi] @@ -378,47 +502,141 @@ bn_mul4x_mont_gather5 ENDP ALIGN 32 mul4x_internal PROC PRIVATE shl r9,5 - mov r10d,DWORD PTR[56+rax] - lea r13,QWORD PTR[256+r9*1+rdx] + movd xmm5,DWORD PTR[56+rax] + lea rax,QWORD PTR[$L$inc] + lea r13,QWORD PTR[128+r9*1+rdx] shr r9,5 - mov r11,r10 - shr r10,3 - and r11,7 - not r10 - lea rax,QWORD PTR[$L$magic_masks] - and r10,3 - lea r12,QWORD PTR[96+r11*8+rdx] - movq xmm4,QWORD PTR[r10*8+rax] - movq xmm5,QWORD PTR[8+r10*8+rax] - add r11,7 - movq xmm6,QWORD PTR[16+r10*8+rax] - movq xmm7,QWORD PTR[24+r10*8+rax] - and r11,7 - - movq xmm0,QWORD PTR[((-96))+r12] - lea r14,QWORD PTR[256+r12] - movq xmm1,QWORD PTR[((-32))+r12] - pand xmm0,xmm4 - movq xmm2,QWORD PTR[32+r12] - pand xmm1,xmm5 - movq xmm3,QWORD PTR[96+r12] - pand xmm2,xmm6 -DB 067h - por xmm0,xmm1 - movq xmm1,QWORD PTR[((-96))+r14] -DB 067h - pand xmm3,xmm7 -DB 067h - por xmm0,xmm2 - movq xmm2,QWORD PTR[((-32))+r14] + movdqa xmm0,XMMWORD PTR[rax] + movdqa xmm1,XMMWORD PTR[16+rax] + lea r10,QWORD PTR[((88-112))+r9*1+rsp] + lea r12,QWORD PTR[128+rdx] + + pshufd xmm5,xmm5,0 + movdqa xmm4,xmm1 +DB 067h,067h + movdqa xmm2,xmm1 + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 DB 067h - pand xmm1,xmm4 + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[112+r10],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[128+r10],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[144+r10],xmm2 + movdqa xmm2,xmm4 + + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[160+r10],xmm3 + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[176+r10],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[192+r10],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[208+r10],xmm2 + movdqa xmm2,xmm4 + + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[224+r10],xmm3 + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[240+r10],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[256+r10],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[272+r10],xmm2 + movdqa xmm2,xmm4 + + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[288+r10],xmm3 + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[304+r10],xmm0 + + paddd xmm3,xmm2 DB 067h - por xmm0,xmm3 - movq xmm3,QWORD PTR[32+r14] + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[320+r10],xmm1 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[336+r10],xmm2 + pand xmm0,XMMWORD PTR[64+r12] + + pand xmm1,XMMWORD PTR[80+r12] + pand xmm2,XMMWORD PTR[96+r12] + movdqa XMMWORD PTR[352+r10],xmm3 + pand xmm3,XMMWORD PTR[112+r12] + por xmm0,xmm2 + por xmm1,xmm3 + movdqa xmm4,XMMWORD PTR[((-128))+r12] + movdqa xmm5,XMMWORD PTR[((-112))+r12] + movdqa xmm2,XMMWORD PTR[((-96))+r12] + pand xmm4,XMMWORD PTR[112+r10] + movdqa xmm3,XMMWORD PTR[((-80))+r12] + pand xmm5,XMMWORD PTR[128+r10] + por xmm0,xmm4 + pand xmm2,XMMWORD PTR[144+r10] + por xmm1,xmm5 + pand xmm3,XMMWORD PTR[160+r10] + por xmm0,xmm2 + por xmm1,xmm3 + movdqa xmm4,XMMWORD PTR[((-64))+r12] + movdqa xmm5,XMMWORD PTR[((-48))+r12] + movdqa xmm2,XMMWORD PTR[((-32))+r12] + pand xmm4,XMMWORD PTR[176+r10] + movdqa xmm3,XMMWORD PTR[((-16))+r12] + pand xmm5,XMMWORD PTR[192+r10] + por xmm0,xmm4 + pand xmm2,XMMWORD PTR[208+r10] + por xmm1,xmm5 + pand xmm3,XMMWORD PTR[224+r10] + por xmm0,xmm2 + por xmm1,xmm3 + movdqa xmm4,XMMWORD PTR[r12] + movdqa xmm5,XMMWORD PTR[16+r12] + movdqa xmm2,XMMWORD PTR[32+r12] + pand xmm4,XMMWORD PTR[240+r10] + movdqa xmm3,XMMWORD PTR[48+r12] + pand xmm5,XMMWORD PTR[256+r10] + por xmm0,xmm4 + pand xmm2,XMMWORD PTR[272+r10] + por xmm1,xmm5 + pand xmm3,XMMWORD PTR[288+r10] + por xmm0,xmm2 + por xmm1,xmm3 + por xmm0,xmm1 + pshufd xmm1,xmm0,04eh + por xmm0,xmm1 + lea r12,QWORD PTR[256+r12] DB 102,72,15,126,195 - movq xmm0,QWORD PTR[96+r14] + mov QWORD PTR[((16+8))+rsp],r13 mov QWORD PTR[((56+8))+rsp],rdi @@ -432,26 +650,10 @@ DB 102,72,15,126,195 mov r10,rax mov rax,QWORD PTR[rcx] - pand xmm2,xmm5 - pand xmm3,xmm6 - por xmm1,xmm2 - imul rbp,r10 - - - - - - - - lea r14,QWORD PTR[((64+8))+r11*8+rsp] + lea r14,QWORD PTR[((64+8))+rsp] mov r11,rdx - pand xmm0,xmm7 - por xmm1,xmm3 - lea r12,QWORD PTR[512+r12] - por xmm0,xmm1 - mul rbp add r10,rax mov rax,QWORD PTR[8+r9*1+rsi] @@ -460,7 +662,7 @@ DB 102,72,15,126,195 mul rbx add r11,rax - mov rax,QWORD PTR[16+rcx] + mov rax,QWORD PTR[8+rcx] adc rdx,0 mov r10,rdx @@ -470,7 +672,7 @@ DB 102,72,15,126,195 adc rdx,0 add rdi,r11 lea r15,QWORD PTR[32+r9] - lea rcx,QWORD PTR[64+rcx] + lea rcx,QWORD PTR[32+rcx] adc rdx,0 mov QWORD PTR[r14],rdi mov r13,rdx @@ -480,7 +682,7 @@ ALIGN 32 $L$1st4x:: mul rbx add r10,rax - mov rax,QWORD PTR[((-32))+rcx] + mov rax,QWORD PTR[((-16))+rcx] lea r14,QWORD PTR[32+r14] adc rdx,0 mov r11,rdx @@ -496,7 +698,7 @@ $L$1st4x:: mul rbx add r11,rax - mov rax,QWORD PTR[((-16))+rcx] + mov rax,QWORD PTR[((-8))+rcx] adc rdx,0 mov r10,rdx @@ -526,7 +728,7 @@ $L$1st4x:: mul rbx add r11,rax - mov rax,QWORD PTR[16+rcx] + mov rax,QWORD PTR[8+rcx] adc rdx,0 mov r10,rdx @@ -535,7 +737,7 @@ $L$1st4x:: mov rax,QWORD PTR[16+r15*1+rsi] adc rdx,0 add rdi,r11 - lea rcx,QWORD PTR[64+rcx] + lea rcx,QWORD PTR[32+rcx] adc rdx,0 mov QWORD PTR[r14],rdi mov r13,rdx @@ -545,7 +747,7 @@ $L$1st4x:: mul rbx add r10,rax - mov rax,QWORD PTR[((-32))+rcx] + mov rax,QWORD PTR[((-16))+rcx] lea r14,QWORD PTR[32+r14] adc rdx,0 mov r11,rdx @@ -561,7 +763,7 @@ $L$1st4x:: mul rbx add r11,rax - mov rax,QWORD PTR[((-16))+rcx] + mov rax,QWORD PTR[((-8))+rcx] adc rdx,0 mov r10,rdx @@ -574,8 +776,7 @@ $L$1st4x:: mov QWORD PTR[((-16))+r14],rdi mov r13,rdx -DB 102,72,15,126,195 - lea rcx,QWORD PTR[r9*2+rcx] + lea rcx,QWORD PTR[r9*1+rcx] xor rdi,rdi add r13,r10 @@ -586,6 +787,63 @@ DB 102,72,15,126,195 ALIGN 32 $L$outer4x:: + lea rdx,QWORD PTR[((16+128))+r14] + pxor xmm4,xmm4 + pxor xmm5,xmm5 + movdqa xmm0,XMMWORD PTR[((-128))+r12] + movdqa xmm1,XMMWORD PTR[((-112))+r12] + movdqa xmm2,XMMWORD PTR[((-96))+r12] + movdqa xmm3,XMMWORD PTR[((-80))+r12] + pand xmm0,XMMWORD PTR[((-128))+rdx] + pand xmm1,XMMWORD PTR[((-112))+rdx] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[((-96))+rdx] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[((-80))+rdx] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[((-64))+r12] + movdqa xmm1,XMMWORD PTR[((-48))+r12] + movdqa xmm2,XMMWORD PTR[((-32))+r12] + movdqa xmm3,XMMWORD PTR[((-16))+r12] + pand xmm0,XMMWORD PTR[((-64))+rdx] + pand xmm1,XMMWORD PTR[((-48))+rdx] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[((-32))+rdx] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[((-16))+rdx] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[r12] + movdqa xmm1,XMMWORD PTR[16+r12] + movdqa xmm2,XMMWORD PTR[32+r12] + movdqa xmm3,XMMWORD PTR[48+r12] + pand xmm0,XMMWORD PTR[rdx] + pand xmm1,XMMWORD PTR[16+rdx] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[32+rdx] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[48+rdx] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[64+r12] + movdqa xmm1,XMMWORD PTR[80+r12] + movdqa xmm2,XMMWORD PTR[96+r12] + movdqa xmm3,XMMWORD PTR[112+r12] + pand xmm0,XMMWORD PTR[64+rdx] + pand xmm1,XMMWORD PTR[80+rdx] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[96+rdx] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[112+rdx] + por xmm4,xmm2 + por xmm5,xmm3 + por xmm4,xmm5 + pshufd xmm0,xmm4,04eh + por xmm0,xmm4 + lea r12,QWORD PTR[256+r12] +DB 102,72,15,126,195 + mov r10,QWORD PTR[r9*1+r14] mov rbp,r8 mul rbx @@ -593,25 +851,11 @@ $L$outer4x:: mov rax,QWORD PTR[rcx] adc rdx,0 - movq xmm0,QWORD PTR[((-96))+r12] - movq xmm1,QWORD PTR[((-32))+r12] - pand xmm0,xmm4 - movq xmm2,QWORD PTR[32+r12] - pand xmm1,xmm5 - movq xmm3,QWORD PTR[96+r12] - imul rbp,r10 -DB 067h mov r11,rdx mov QWORD PTR[r14],rdi - pand xmm2,xmm6 - por xmm0,xmm1 - pand xmm3,xmm7 - por xmm0,xmm2 lea r14,QWORD PTR[r9*1+r14] - lea r12,QWORD PTR[256+r12] - por xmm0,xmm3 mul rbp add r10,rax @@ -621,7 +865,7 @@ DB 067h mul rbx add r11,rax - mov rax,QWORD PTR[16+rcx] + mov rax,QWORD PTR[8+rcx] adc rdx,0 add r11,QWORD PTR[8+r14] adc rdx,0 @@ -633,7 +877,7 @@ DB 067h adc rdx,0 add rdi,r11 lea r15,QWORD PTR[32+r9] - lea rcx,QWORD PTR[64+rcx] + lea rcx,QWORD PTR[32+rcx] adc rdx,0 mov r13,rdx jmp $L$inner4x @@ -642,7 +886,7 @@ ALIGN 32 $L$inner4x:: mul rbx add r10,rax - mov rax,QWORD PTR[((-32))+rcx] + mov rax,QWORD PTR[((-16))+rcx] adc rdx,0 add r10,QWORD PTR[16+r14] lea r14,QWORD PTR[32+r14] @@ -660,7 +904,7 @@ $L$inner4x:: mul rbx add r11,rax - mov rax,QWORD PTR[((-16))+rcx] + mov rax,QWORD PTR[((-8))+rcx] adc rdx,0 add r11,QWORD PTR[((-8))+r14] adc rdx,0 @@ -694,7 +938,7 @@ $L$inner4x:: mul rbx add r11,rax - mov rax,QWORD PTR[16+rcx] + mov rax,QWORD PTR[8+rcx] adc rdx,0 add r11,QWORD PTR[8+r14] adc rdx,0 @@ -705,7 +949,7 @@ $L$inner4x:: mov rax,QWORD PTR[16+r15*1+rsi] adc rdx,0 add rdi,r11 - lea rcx,QWORD PTR[64+rcx] + lea rcx,QWORD PTR[32+rcx] adc rdx,0 mov QWORD PTR[((-8))+r14],r13 mov r13,rdx @@ -715,7 +959,7 @@ $L$inner4x:: mul rbx add r10,rax - mov rax,QWORD PTR[((-32))+rcx] + mov rax,QWORD PTR[((-16))+rcx] adc rdx,0 add r10,QWORD PTR[16+r14] lea r14,QWORD PTR[32+r14] @@ -734,7 +978,7 @@ $L$inner4x:: mul rbx add r11,rax mov rax,rbp - mov rbp,QWORD PTR[((-16))+rcx] + mov rbp,QWORD PTR[((-8))+rcx] adc rdx,0 add r11,QWORD PTR[((-8))+r14] adc rdx,0 @@ -749,9 +993,8 @@ $L$inner4x:: mov QWORD PTR[((-24))+r14],r13 mov r13,rdx -DB 102,72,15,126,195 mov QWORD PTR[((-16))+r14],rdi - lea rcx,QWORD PTR[r9*2+rcx] + lea rcx,QWORD PTR[r9*1+rcx] xor rdi,rdi add r13,r10 @@ -762,16 +1005,23 @@ DB 102,72,15,126,195 cmp r12,QWORD PTR[((16+8))+rsp] jb $L$outer4x + xor rax,rax sub rbp,r13 adc r15,r15 or rdi,r15 - xor rdi,1 + sub rax,rdi lea rbx,QWORD PTR[r9*1+r14] - lea rbp,QWORD PTR[rdi*8+rcx] + mov r12,QWORD PTR[rcx] + lea rbp,QWORD PTR[rcx] mov rcx,r9 sar rcx,3+2 mov rdi,QWORD PTR[((56+8))+rsp] - jmp $L$sqr4x_sub + dec r12 + xor r10,r10 + mov r13,QWORD PTR[8+rbp] + mov r14,QWORD PTR[16+rbp] + mov r15,QWORD PTR[24+rbp] + jmp $L$sqr4x_sub_entry mul4x_internal ENDP PUBLIC bn_power5 @@ -790,8 +1040,8 @@ $L$SEH_begin_bn_power5:: mov r11d,DWORD PTR[((OPENSSL_ia32cap_P+8))] - and r11d,080100h - cmp r11d,080100h + and r11d,080108h + cmp r11d,080108h je $L$powerx5_enter mov rax,rsp push rbx @@ -800,12 +1050,9 @@ $L$SEH_begin_bn_power5:: push r13 push r14 push r15 - lea rsp,QWORD PTR[((-40))+rsp] - movaps XMMWORD PTR[rsp],xmm6 - movaps XMMWORD PTR[16+rsp],xmm7 - mov r10d,r9d + shl r9d,3 - shl r10d,3+2 + lea r10d,DWORD PTR[r9*2+r9] neg r9 mov r8,QWORD PTR[r8] @@ -815,19 +1062,20 @@ $L$SEH_begin_bn_power5:: - lea r11,QWORD PTR[((-64))+r9*2+rsp] - sub r11,rsi + + lea r11,QWORD PTR[((-320))+r9*2+rsp] + sub r11,rdi and r11,4095 cmp r10,r11 jb $L$pwr_sp_alt sub rsp,r11 - lea rsp,QWORD PTR[((-64))+r9*2+rsp] + lea rsp,QWORD PTR[((-320))+r9*2+rsp] jmp $L$pwr_sp_done ALIGN 32 $L$pwr_sp_alt:: - lea r10,QWORD PTR[((4096-64))+r9*2] - lea rsp,QWORD PTR[((-64))+r9*2+rsp] + lea r10,QWORD PTR[((4096-320))+r9*2] + lea rsp,QWORD PTR[((-320))+r9*2+rsp] sub r11,r10 mov r10,0 cmovc r11,r10 @@ -855,10 +1103,15 @@ DB 102,73,15,110,218 DB 102,72,15,110,226 call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal DB 102,72,15,126,209 DB 102,72,15,126,226 @@ -1405,9 +1658,9 @@ DB 067h mov QWORD PTR[((-16))+rdi],rbx mov QWORD PTR[((-8))+rdi],r8 DB 102,72,15,126,213 -sqr8x_reduction:: +__bn_sqr8x_reduction:: xor rax,rax - lea rcx,QWORD PTR[r9*2+rbp] + lea rcx,QWORD PTR[rbp*1+r9] lea rdx,QWORD PTR[((48+8))+r9*2+rsp] mov QWORD PTR[((0+8))+rsp],rcx lea rdi,QWORD PTR[((48+8))+r9*1+rsp] @@ -1440,14 +1693,14 @@ DB 067h ALIGN 32 $L$8x_reduce:: mul rbx - mov rax,QWORD PTR[16+rbp] + mov rax,QWORD PTR[8+rbp] neg r8 mov r8,rdx adc r8,0 mul rbx add r9,rax - mov rax,QWORD PTR[32+rbp] + mov rax,QWORD PTR[16+rbp] adc rdx,0 add r8,r9 mov QWORD PTR[((48-8+8))+rcx*8+rsp],rbx @@ -1456,7 +1709,7 @@ $L$8x_reduce:: mul rbx add r10,rax - mov rax,QWORD PTR[48+rbp] + mov rax,QWORD PTR[24+rbp] adc rdx,0 add r9,r10 mov rsi,QWORD PTR[((32+8))+rsp] @@ -1465,7 +1718,7 @@ $L$8x_reduce:: mul rbx add r11,rax - mov rax,QWORD PTR[64+rbp] + mov rax,QWORD PTR[32+rbp] adc rdx,0 imul rsi,r8 add r10,r11 @@ -1474,7 +1727,7 @@ $L$8x_reduce:: mul rbx add r12,rax - mov rax,QWORD PTR[80+rbp] + mov rax,QWORD PTR[40+rbp] adc rdx,0 add r11,r12 mov r12,rdx @@ -1482,7 +1735,7 @@ $L$8x_reduce:: mul rbx add r13,rax - mov rax,QWORD PTR[96+rbp] + mov rax,QWORD PTR[48+rbp] adc rdx,0 add r12,r13 mov r13,rdx @@ -1490,7 +1743,7 @@ $L$8x_reduce:: mul rbx add r14,rax - mov rax,QWORD PTR[112+rbp] + mov rax,QWORD PTR[56+rbp] adc rdx,0 add r13,r14 mov r14,rdx @@ -1508,7 +1761,7 @@ $L$8x_reduce:: dec ecx jnz $L$8x_reduce - lea rbp,QWORD PTR[128+rbp] + lea rbp,QWORD PTR[64+rbp] xor rax,rax mov rdx,QWORD PTR[((8+8))+rsp] cmp rbp,QWORD PTR[((0+8))+rsp] @@ -1534,14 +1787,14 @@ ALIGN 32 $L$8x_tail:: mul rbx add r8,rax - mov rax,QWORD PTR[16+rbp] + mov rax,QWORD PTR[8+rbp] mov QWORD PTR[rdi],r8 mov r8,rdx adc r8,0 mul rbx add r9,rax - mov rax,QWORD PTR[32+rbp] + mov rax,QWORD PTR[16+rbp] adc rdx,0 add r8,r9 lea rdi,QWORD PTR[8+rdi] @@ -1550,7 +1803,7 @@ $L$8x_tail:: mul rbx add r10,rax - mov rax,QWORD PTR[48+rbp] + mov rax,QWORD PTR[24+rbp] adc rdx,0 add r9,r10 mov r10,rdx @@ -1558,7 +1811,7 @@ $L$8x_tail:: mul rbx add r11,rax - mov rax,QWORD PTR[64+rbp] + mov rax,QWORD PTR[32+rbp] adc rdx,0 add r10,r11 mov r11,rdx @@ -1566,7 +1819,7 @@ $L$8x_tail:: mul rbx add r12,rax - mov rax,QWORD PTR[80+rbp] + mov rax,QWORD PTR[40+rbp] adc rdx,0 add r11,r12 mov r12,rdx @@ -1574,7 +1827,7 @@ $L$8x_tail:: mul rbx add r13,rax - mov rax,QWORD PTR[96+rbp] + mov rax,QWORD PTR[48+rbp] adc rdx,0 add r12,r13 mov r13,rdx @@ -1582,7 +1835,7 @@ $L$8x_tail:: mul rbx add r14,rax - mov rax,QWORD PTR[112+rbp] + mov rax,QWORD PTR[56+rbp] adc rdx,0 add r13,r14 mov r14,rdx @@ -1600,7 +1853,7 @@ $L$8x_tail:: dec ecx jnz $L$8x_tail - lea rbp,QWORD PTR[128+rbp] + lea rbp,QWORD PTR[64+rbp] mov rdx,QWORD PTR[((8+8))+rsp] cmp rbp,QWORD PTR[((0+8))+rsp] jae $L$8x_tail_done @@ -1624,6 +1877,15 @@ $L$8x_tail:: ALIGN 32 $L$8x_tail_done:: add r8,QWORD PTR[rdx] + adc r9,0 + adc r10,0 + adc r11,0 + adc r12,0 + adc r13,0 + adc r14,0 + adc r15,0 + + xor rax,rax neg rsi @@ -1637,7 +1899,7 @@ $L$8x_no_tail:: adc r14,QWORD PTR[48+rdi] adc r15,QWORD PTR[56+rdi] adc rax,0 - mov rcx,QWORD PTR[((-16))+rbp] + mov rcx,QWORD PTR[((-8))+rbp] xor rsi,rsi DB 102,72,15,126,213 @@ -1655,44 +1917,62 @@ DB 102,73,15,126,217 cmp rdi,rdx jb $L$8x_reduction_loop + DB 0F3h,0C3h ;repret +bn_sqr8x_internal ENDP - sub rcx,r15 +ALIGN 32 +__bn_post4x_internal PROC PRIVATE + mov r12,QWORD PTR[rbp] lea rbx,QWORD PTR[r9*1+rdi] - adc rsi,rsi mov rcx,r9 - or rax,rsi DB 102,72,15,126,207 - xor rax,1 + neg rax DB 102,72,15,126,206 - lea rbp,QWORD PTR[rax*8+rbp] sar rcx,3+2 - jmp $L$sqr4x_sub + dec r12 + xor r10,r10 + mov r13,QWORD PTR[8+rbp] + mov r14,QWORD PTR[16+rbp] + mov r15,QWORD PTR[24+rbp] + jmp $L$sqr4x_sub_entry -ALIGN 32 +ALIGN 16 $L$sqr4x_sub:: -DB 066h - mov r12,QWORD PTR[rbx] - mov r13,QWORD PTR[8+rbx] - sbb r12,QWORD PTR[rbp] - mov r14,QWORD PTR[16+rbx] - sbb r13,QWORD PTR[16+rbp] - mov r15,QWORD PTR[24+rbx] - lea rbx,QWORD PTR[32+rbx] - sbb r14,QWORD PTR[32+rbp] + mov r12,QWORD PTR[rbp] + mov r13,QWORD PTR[8+rbp] + mov r14,QWORD PTR[16+rbp] + mov r15,QWORD PTR[24+rbp] +$L$sqr4x_sub_entry:: + lea rbp,QWORD PTR[32+rbp] + not r12 + not r13 + not r14 + not r15 + and r12,rax + and r13,rax + and r14,rax + and r15,rax + + neg r10 + adc r12,QWORD PTR[rbx] + adc r13,QWORD PTR[8+rbx] + adc r14,QWORD PTR[16+rbx] + adc r15,QWORD PTR[24+rbx] mov QWORD PTR[rdi],r12 - sbb r15,QWORD PTR[48+rbp] - lea rbp,QWORD PTR[64+rbp] + lea rbx,QWORD PTR[32+rbx] mov QWORD PTR[8+rdi],r13 + sbb r10,r10 mov QWORD PTR[16+rdi],r14 mov QWORD PTR[24+rdi],r15 lea rdi,QWORD PTR[32+rdi] inc rcx jnz $L$sqr4x_sub + mov r10,r9 neg r9 DB 0F3h,0C3h ;repret -bn_sqr8x_internal ENDP +__bn_post4x_internal ENDP PUBLIC bn_from_montgomery ALIGN 32 @@ -1726,13 +2006,9 @@ DB 067h push r13 push r14 push r15 - lea rsp,QWORD PTR[((-40))+rsp] - movaps XMMWORD PTR[rsp],xmm6 - movaps XMMWORD PTR[16+rsp],xmm7 -DB 067h - mov r10d,r9d + shl r9d,3 - shl r10d,3+2 + lea r10,QWORD PTR[r9*2+r9] neg r9 mov r8,QWORD PTR[r8] @@ -1742,19 +2018,20 @@ DB 067h - lea r11,QWORD PTR[((-64))+r9*2+rsp] - sub r11,rsi + + lea r11,QWORD PTR[((-320))+r9*2+rsp] + sub r11,rdi and r11,4095 cmp r10,r11 jb $L$from_sp_alt sub rsp,r11 - lea rsp,QWORD PTR[((-64))+r9*2+rsp] + lea rsp,QWORD PTR[((-320))+r9*2+rsp] jmp $L$from_sp_done ALIGN 32 $L$from_sp_alt:: - lea r10,QWORD PTR[((4096-64))+r9*2] - lea rsp,QWORD PTR[((-64))+r9*2+rsp] + lea r10,QWORD PTR[((4096-320))+r9*2] + lea rsp,QWORD PTR[((-320))+r9*2+rsp] sub r11,r10 mov r10,0 cmovc r11,r10 @@ -1806,12 +2083,13 @@ DB 067h mov rbp,rcx DB 102,73,15,110,218 mov r11d,DWORD PTR[((OPENSSL_ia32cap_P+8))] - and r11d,080100h - cmp r11d,080100h + and r11d,080108h + cmp r11d,080108h jne $L$from_mont_nox lea rdi,QWORD PTR[r9*1+rax] - call sqrx8x_reduction + call __bn_sqrx8x_reduction + call __bn_postx4x_internal pxor xmm0,xmm0 lea rax,QWORD PTR[48+rsp] @@ -1820,7 +2098,8 @@ DB 102,73,15,110,218 ALIGN 32 $L$from_mont_nox:: - call sqr8x_reduction + call __bn_sqr8x_reduction + call __bn_post4x_internal pxor xmm0,xmm0 lea rax,QWORD PTR[48+rsp] @@ -1867,7 +2146,6 @@ $L$SEH_begin_bn_mulx4x_mont_gather5:: $L$mulx4x_enter:: -DB 067h mov rax,rsp push rbx push rbp @@ -1875,13 +2153,9 @@ DB 067h push r13 push r14 push r15 - lea rsp,QWORD PTR[((-40))+rsp] - movaps XMMWORD PTR[rsp],xmm6 - movaps XMMWORD PTR[16+rsp],xmm7 -DB 067h - mov r10d,r9d + shl r9d,3 - shl r10d,3+2 + lea r10,QWORD PTR[r9*2+r9] neg r9 mov r8,QWORD PTR[r8] @@ -1892,19 +2166,20 @@ DB 067h - lea r11,QWORD PTR[((-64))+r9*2+rsp] - sub r11,rsi + + + lea r11,QWORD PTR[((-320))+r9*2+rsp] + sub r11,rdi and r11,4095 cmp r10,r11 jb $L$mulx4xsp_alt sub rsp,r11 - lea rsp,QWORD PTR[((-64))+r9*2+rsp] + lea rsp,QWORD PTR[((-320))+r9*2+rsp] jmp $L$mulx4xsp_done -ALIGN 32 $L$mulx4xsp_alt:: - lea r10,QWORD PTR[((4096-64))+r9*2] - lea rsp,QWORD PTR[((-64))+r9*2+rsp] + lea r10,QWORD PTR[((4096-320))+r9*2] + lea rsp,QWORD PTR[((-320))+r9*2+rsp] sub r11,r10 mov r10,0 cmovc r11,r10 @@ -1930,8 +2205,7 @@ $L$mulx4x_body:: mov rsi,QWORD PTR[40+rsp] mov rax,1 - movaps xmm6,XMMWORD PTR[((-88))+rsi] - movaps xmm7,XMMWORD PTR[((-72))+rsi] + mov r15,QWORD PTR[((-48))+rsi] mov r14,QWORD PTR[((-40))+rsi] mov r13,QWORD PTR[((-32))+rsi] @@ -1949,63 +2223,150 @@ bn_mulx4x_mont_gather5 ENDP ALIGN 32 mulx4x_internal PROC PRIVATE -DB 04ch,089h,08ch,024h,008h,000h,000h,000h -DB 067h + mov QWORD PTR[8+rsp],r9 + mov r10,r9 neg r9 shl r9,5 - lea r13,QWORD PTR[256+r9*1+rdx] + neg r10 + lea r13,QWORD PTR[128+r9*1+rdx] shr r9,5+5 - mov r10d,DWORD PTR[56+rax] + movd xmm5,DWORD PTR[56+rax] sub r9,1 + lea rax,QWORD PTR[$L$inc] mov QWORD PTR[((16+8))+rsp],r13 mov QWORD PTR[((24+8))+rsp],r9 mov QWORD PTR[((56+8))+rsp],rdi - mov r11,r10 - shr r10,3 - and r11,7 - not r10 - lea rax,QWORD PTR[$L$magic_masks] - and r10,3 - lea rdi,QWORD PTR[96+r11*8+rdx] - movq xmm4,QWORD PTR[r10*8+rax] - movq xmm5,QWORD PTR[8+r10*8+rax] - add r11,7 - movq xmm6,QWORD PTR[16+r10*8+rax] - movq xmm7,QWORD PTR[24+r10*8+rax] - and r11,7 - - movq xmm0,QWORD PTR[((-96))+rdi] - lea rbx,QWORD PTR[256+rdi] - movq xmm1,QWORD PTR[((-32))+rdi] - pand xmm0,xmm4 - movq xmm2,QWORD PTR[32+rdi] - pand xmm1,xmm5 - movq xmm3,QWORD PTR[96+rdi] - pand xmm2,xmm6 - por xmm0,xmm1 - movq xmm1,QWORD PTR[((-96))+rbx] - pand xmm3,xmm7 - por xmm0,xmm2 - movq xmm2,QWORD PTR[((-32))+rbx] - por xmm0,xmm3 -DB 067h,067h - pand xmm1,xmm4 - movq xmm3,QWORD PTR[32+rbx] + movdqa xmm0,XMMWORD PTR[rax] + movdqa xmm1,XMMWORD PTR[16+rax] + lea r10,QWORD PTR[((88-112))+r10*1+rsp] + lea rdi,QWORD PTR[128+rdx] + pshufd xmm5,xmm5,0 + movdqa xmm4,xmm1 +DB 067h + movdqa xmm2,xmm1 +DB 067h + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[112+r10],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[128+r10],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[144+r10],xmm2 + movdqa xmm2,xmm4 + + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[160+r10],xmm3 + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[176+r10],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[192+r10],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[208+r10],xmm2 + movdqa xmm2,xmm4 + + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[224+r10],xmm3 + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[240+r10],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[256+r10],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[272+r10],xmm2 + movdqa xmm2,xmm4 + + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[288+r10],xmm3 + movdqa xmm3,xmm4 +DB 067h + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[304+r10],xmm0 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[320+r10],xmm1 + + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[336+r10],xmm2 + + pand xmm0,XMMWORD PTR[64+rdi] + pand xmm1,XMMWORD PTR[80+rdi] + pand xmm2,XMMWORD PTR[96+rdi] + movdqa XMMWORD PTR[352+r10],xmm3 + pand xmm3,XMMWORD PTR[112+rdi] + por xmm0,xmm2 + por xmm1,xmm3 + movdqa xmm4,XMMWORD PTR[((-128))+rdi] + movdqa xmm5,XMMWORD PTR[((-112))+rdi] + movdqa xmm2,XMMWORD PTR[((-96))+rdi] + pand xmm4,XMMWORD PTR[112+r10] + movdqa xmm3,XMMWORD PTR[((-80))+rdi] + pand xmm5,XMMWORD PTR[128+r10] + por xmm0,xmm4 + pand xmm2,XMMWORD PTR[144+r10] + por xmm1,xmm5 + pand xmm3,XMMWORD PTR[160+r10] + por xmm0,xmm2 + por xmm1,xmm3 + movdqa xmm4,XMMWORD PTR[((-64))+rdi] + movdqa xmm5,XMMWORD PTR[((-48))+rdi] + movdqa xmm2,XMMWORD PTR[((-32))+rdi] + pand xmm4,XMMWORD PTR[176+r10] + movdqa xmm3,XMMWORD PTR[((-16))+rdi] + pand xmm5,XMMWORD PTR[192+r10] + por xmm0,xmm4 + pand xmm2,XMMWORD PTR[208+r10] + por xmm1,xmm5 + pand xmm3,XMMWORD PTR[224+r10] + por xmm0,xmm2 + por xmm1,xmm3 + movdqa xmm4,XMMWORD PTR[rdi] + movdqa xmm5,XMMWORD PTR[16+rdi] + movdqa xmm2,XMMWORD PTR[32+rdi] + pand xmm4,XMMWORD PTR[240+r10] + movdqa xmm3,XMMWORD PTR[48+rdi] + pand xmm5,XMMWORD PTR[256+r10] + por xmm0,xmm4 + pand xmm2,XMMWORD PTR[272+r10] + por xmm1,xmm5 + pand xmm3,XMMWORD PTR[288+r10] + por xmm0,xmm2 + por xmm1,xmm3 + pxor xmm0,xmm1 + pshufd xmm1,xmm0,04eh + por xmm0,xmm1 + lea rdi,QWORD PTR[256+rdi] DB 102,72,15,126,194 - movq xmm0,QWORD PTR[96+rbx] - lea rdi,QWORD PTR[512+rdi] - pand xmm2,xmm5 -DB 067h,067h - pand xmm3,xmm6 - - - - - - - - lea rbx,QWORD PTR[((64+32+8))+r11*8+rsp] + lea rbx,QWORD PTR[((64+32+8))+rsp] mov r9,rdx mulx rax,r8,QWORD PTR[rsi] @@ -2021,37 +2382,31 @@ DB 067h,067h xor rbp,rbp mov rdx,r8 - por xmm1,xmm2 - pand xmm0,xmm7 - por xmm1,xmm3 mov QWORD PTR[((8+8))+rsp],rdi - por xmm0,xmm1 -DB 048h,08dh,0b6h,020h,000h,000h,000h + lea rsi,QWORD PTR[32+rsi] adcx r13,rax adcx r14,rbp mulx r10,rax,QWORD PTR[rcx] adcx r15,rax adox r10,r11 - mulx r11,rax,QWORD PTR[16+rcx] + mulx r11,rax,QWORD PTR[8+rcx] adcx r10,rax adox r11,r12 - mulx r12,rax,QWORD PTR[32+rcx] + mulx r12,rax,QWORD PTR[16+rcx] mov rdi,QWORD PTR[((24+8))+rsp] -DB 066h mov QWORD PTR[((-32))+rbx],r10 adcx r11,rax adox r12,r13 - mulx r15,rax,QWORD PTR[48+rcx] -DB 067h,067h + mulx r15,rax,QWORD PTR[24+rcx] mov rdx,r9 mov QWORD PTR[((-24))+rbx],r11 adcx r12,rax adox r15,rbp -DB 048h,08dh,089h,040h,000h,000h,000h + lea rcx,QWORD PTR[32+rcx] mov QWORD PTR[((-16))+rbx],r12 - + jmp $L$mulx4x_1st ALIGN 32 $L$mulx4x_1st:: @@ -2074,27 +2429,26 @@ DB 067h,067h mulx r15,rax,QWORD PTR[rcx] adcx r10,rax adox r11,r15 - mulx r15,rax,QWORD PTR[16+rcx] + mulx r15,rax,QWORD PTR[8+rcx] adcx r11,rax adox r12,r15 - mulx r15,rax,QWORD PTR[32+rcx] + mulx r15,rax,QWORD PTR[16+rcx] mov QWORD PTR[((-40))+rbx],r10 adcx r12,rax mov QWORD PTR[((-32))+rbx],r11 adox r13,r15 - mulx r15,rax,QWORD PTR[48+rcx] + mulx r15,rax,QWORD PTR[24+rcx] mov rdx,r9 mov QWORD PTR[((-24))+rbx],r12 adcx r13,rax adox r15,rbp - lea rcx,QWORD PTR[64+rcx] + lea rcx,QWORD PTR[32+rcx] mov QWORD PTR[((-16))+rbx],r13 dec rdi jnz $L$mulx4x_1st mov rax,QWORD PTR[8+rsp] -DB 102,72,15,126,194 adc r15,rbp lea rsi,QWORD PTR[rax*1+rsi] add r14,r15 @@ -2105,6 +2459,64 @@ DB 102,72,15,126,194 ALIGN 32 $L$mulx4x_outer:: + lea r10,QWORD PTR[((16-256))+rbx] + pxor xmm4,xmm4 +DB 067h,067h + pxor xmm5,xmm5 + movdqa xmm0,XMMWORD PTR[((-128))+rdi] + movdqa xmm1,XMMWORD PTR[((-112))+rdi] + movdqa xmm2,XMMWORD PTR[((-96))+rdi] + pand xmm0,XMMWORD PTR[256+r10] + movdqa xmm3,XMMWORD PTR[((-80))+rdi] + pand xmm1,XMMWORD PTR[272+r10] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[288+r10] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[304+r10] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[((-64))+rdi] + movdqa xmm1,XMMWORD PTR[((-48))+rdi] + movdqa xmm2,XMMWORD PTR[((-32))+rdi] + pand xmm0,XMMWORD PTR[320+r10] + movdqa xmm3,XMMWORD PTR[((-16))+rdi] + pand xmm1,XMMWORD PTR[336+r10] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[352+r10] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[368+r10] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[rdi] + movdqa xmm1,XMMWORD PTR[16+rdi] + movdqa xmm2,XMMWORD PTR[32+rdi] + pand xmm0,XMMWORD PTR[384+r10] + movdqa xmm3,XMMWORD PTR[48+rdi] + pand xmm1,XMMWORD PTR[400+r10] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[416+r10] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[432+r10] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[64+rdi] + movdqa xmm1,XMMWORD PTR[80+rdi] + movdqa xmm2,XMMWORD PTR[96+rdi] + pand xmm0,XMMWORD PTR[448+r10] + movdqa xmm3,XMMWORD PTR[112+rdi] + pand xmm1,XMMWORD PTR[464+r10] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[480+r10] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[496+r10] + por xmm4,xmm2 + por xmm5,xmm3 + por xmm4,xmm5 + pshufd xmm0,xmm4,04eh + por xmm0,xmm4 + lea rdi,QWORD PTR[256+rdi] +DB 102,72,15,126,194 + mov QWORD PTR[rbx],rbp lea rbx,QWORD PTR[32+rax*1+rbx] mulx r11,r8,QWORD PTR[rsi] @@ -2119,54 +2531,37 @@ $L$mulx4x_outer:: mulx r14,rdx,QWORD PTR[24+rsi] adox r12,QWORD PTR[((-16))+rbx] adcx r13,rdx - lea rcx,QWORD PTR[rax*2+rcx] + lea rcx,QWORD PTR[rax*1+rcx] lea rsi,QWORD PTR[32+rsi] adox r13,QWORD PTR[((-8))+rbx] adcx r14,rbp adox r14,rbp -DB 067h mov r15,r8 imul r8,QWORD PTR[((32+8))+rsp] - movq xmm0,QWORD PTR[((-96))+rdi] -DB 067h,067h mov rdx,r8 - movq xmm1,QWORD PTR[((-32))+rdi] -DB 067h - pand xmm0,xmm4 - movq xmm2,QWORD PTR[32+rdi] -DB 067h - pand xmm1,xmm5 - movq xmm3,QWORD PTR[96+rdi] - add rdi,256 -DB 067h - pand xmm2,xmm6 - por xmm0,xmm1 - pand xmm3,xmm7 xor rbp,rbp mov QWORD PTR[((8+8))+rsp],rdi mulx r10,rax,QWORD PTR[rcx] adcx r15,rax adox r10,r11 - mulx r11,rax,QWORD PTR[16+rcx] + mulx r11,rax,QWORD PTR[8+rcx] adcx r10,rax adox r11,r12 - mulx r12,rax,QWORD PTR[32+rcx] + mulx r12,rax,QWORD PTR[16+rcx] adcx r11,rax adox r12,r13 - mulx r15,rax,QWORD PTR[48+rcx] + mulx r15,rax,QWORD PTR[24+rcx] mov rdx,r9 - por xmm0,xmm2 mov rdi,QWORD PTR[((24+8))+rsp] mov QWORD PTR[((-32))+rbx],r10 - por xmm0,xmm3 adcx r12,rax mov QWORD PTR[((-24))+rbx],r11 adox r15,rbp mov QWORD PTR[((-16))+rbx],r12 - lea rcx,QWORD PTR[64+rcx] + lea rcx,QWORD PTR[32+rcx] jmp $L$mulx4x_inner ALIGN 32 @@ -2194,17 +2589,17 @@ $L$mulx4x_inner:: mulx r15,rax,QWORD PTR[rcx] adcx r10,rax adox r11,r15 - mulx r15,rax,QWORD PTR[16+rcx] + mulx r15,rax,QWORD PTR[8+rcx] adcx r11,rax adox r12,r15 - mulx r15,rax,QWORD PTR[32+rcx] + mulx r15,rax,QWORD PTR[16+rcx] mov QWORD PTR[((-40))+rbx],r10 adcx r12,rax adox r13,r15 mov QWORD PTR[((-32))+rbx],r11 - mulx r15,rax,QWORD PTR[48+rcx] + mulx r15,rax,QWORD PTR[24+rcx] mov rdx,r9 - lea rcx,QWORD PTR[64+rcx] + lea rcx,QWORD PTR[32+rcx] mov QWORD PTR[((-24))+rbx],r12 adcx r13,rax adox r15,rbp @@ -2214,7 +2609,6 @@ $L$mulx4x_inner:: jnz $L$mulx4x_inner mov rax,QWORD PTR[((0+8))+rsp] -DB 102,72,15,126,194 adc r15,rbp sub rdi,QWORD PTR[rbx] mov rdi,QWORD PTR[((8+8))+rsp] @@ -2227,20 +2621,26 @@ DB 102,72,15,126,194 cmp rdi,r10 jb $L$mulx4x_outer - mov r10,QWORD PTR[((-16))+rcx] + mov r10,QWORD PTR[((-8))+rcx] + mov r8,rbp + mov r12,QWORD PTR[rax*1+rcx] + lea rbp,QWORD PTR[rax*1+rcx] + mov rcx,rax + lea rdi,QWORD PTR[rax*1+rbx] + xor eax,eax xor r15,r15 sub r10,r14 adc r15,r15 - or rbp,r15 - xor rbp,1 - lea rdi,QWORD PTR[rax*1+rbx] - lea rcx,QWORD PTR[rax*2+rcx] -DB 067h,067h - sar rax,3+2 - lea rbp,QWORD PTR[rbp*8+rcx] + or r8,r15 + sar rcx,3+2 + sub rax,r8 mov rdx,QWORD PTR[((56+8))+rsp] - mov rcx,rax - jmp $L$sqrx4x_sub + dec r12 + mov r13,QWORD PTR[8+rbp] + xor r8,r8 + mov r14,QWORD PTR[16+rbp] + mov r15,QWORD PTR[24+rbp] + jmp $L$sqrx4x_sub_entry mulx4x_internal ENDP ALIGN 32 @@ -2258,7 +2658,6 @@ $L$SEH_begin_bn_powerx5:: $L$powerx5_enter:: -DB 067h mov rax,rsp push rbx push rbp @@ -2266,13 +2665,9 @@ DB 067h push r13 push r14 push r15 - lea rsp,QWORD PTR[((-40))+rsp] - movaps XMMWORD PTR[rsp],xmm6 - movaps XMMWORD PTR[16+rsp],xmm7 -DB 067h - mov r10d,r9d + shl r9d,3 - shl r10d,3+2 + lea r10,QWORD PTR[r9*2+r9] neg r9 mov r8,QWORD PTR[r8] @@ -2282,19 +2677,20 @@ DB 067h - lea r11,QWORD PTR[((-64))+r9*2+rsp] - sub r11,rsi + + lea r11,QWORD PTR[((-320))+r9*2+rsp] + sub r11,rdi and r11,4095 cmp r10,r11 jb $L$pwrx_sp_alt sub rsp,r11 - lea rsp,QWORD PTR[((-64))+r9*2+rsp] + lea rsp,QWORD PTR[((-320))+r9*2+rsp] jmp $L$pwrx_sp_done ALIGN 32 $L$pwrx_sp_alt:: - lea r10,QWORD PTR[((4096-64))+r9*2] - lea rsp,QWORD PTR[((-64))+r9*2+rsp] + lea r10,QWORD PTR[((4096-320))+r9*2] + lea rsp,QWORD PTR[((-320))+r9*2+rsp] sub r11,r10 mov r10,0 cmovc r11,r10 @@ -2325,10 +2721,15 @@ DB 102,72,15,110,226 $L$powerx5_body:: call __bn_sqrx8x_internal + call __bn_postx4x_internal call __bn_sqrx8x_internal + call __bn_postx4x_internal call __bn_sqrx8x_internal + call __bn_postx4x_internal call __bn_sqrx8x_internal + call __bn_postx4x_internal call __bn_sqrx8x_internal + call __bn_postx4x_internal mov r9,r10 mov rdi,rsi @@ -2340,8 +2741,7 @@ DB 102,72,15,126,226 mov rsi,QWORD PTR[40+rsp] mov rax,1 - movaps xmm6,XMMWORD PTR[((-88))+rsi] - movaps xmm7,XMMWORD PTR[((-72))+rsi] + mov r15,QWORD PTR[((-48))+rsi] mov r14,QWORD PTR[((-40))+rsi] mov r13,QWORD PTR[((-32))+rsi] @@ -2757,11 +3157,11 @@ $L$sqrx4x_shift_n_add_break:: mov QWORD PTR[56+rdi],rbx lea rdi,QWORD PTR[64+rdi] DB 102,72,15,126,213 -sqrx8x_reduction:: +__bn_sqrx8x_reduction:: xor eax,eax mov rbx,QWORD PTR[((32+8))+rsp] mov rdx,QWORD PTR[((48+8))+rsp] - lea rcx,QWORD PTR[((-128))+r9*2+rbp] + lea rcx,QWORD PTR[((-64))+r9*1+rbp] mov QWORD PTR[((0+8))+rsp],rcx mov QWORD PTR[((8+8))+rsp],rdi @@ -2794,19 +3194,19 @@ $L$sqrx8x_reduce:: adcx rax,rbx adox r8,r9 - mulx r9,rbx,QWORD PTR[16+rbp] + mulx r9,rbx,QWORD PTR[8+rbp] adcx r8,rbx adox r9,r10 - mulx r10,rbx,QWORD PTR[32+rbp] + mulx r10,rbx,QWORD PTR[16+rbp] adcx r9,rbx adox r10,r11 - mulx r11,rbx,QWORD PTR[48+rbp] + mulx r11,rbx,QWORD PTR[24+rbp] adcx r10,rbx adox r11,r12 -DB 0c4h,062h,0e3h,0f6h,0a5h,040h,000h,000h,000h +DB 0c4h,062h,0e3h,0f6h,0a5h,020h,000h,000h,000h mov rax,rdx mov rdx,r8 adcx r11,rbx @@ -2816,15 +3216,15 @@ DB 0c4h,062h,0e3h,0f6h,0a5h,040h,000h,000h,000h mov rdx,rax mov QWORD PTR[((64+48+8))+rcx*8+rsp],rax - mulx r13,rax,QWORD PTR[80+rbp] + mulx r13,rax,QWORD PTR[40+rbp] adcx r12,rax adox r13,r14 - mulx r14,rax,QWORD PTR[96+rbp] + mulx r14,rax,QWORD PTR[48+rbp] adcx r13,rax adox r14,r15 - mulx r15,rax,QWORD PTR[112+rbp] + mulx r15,rax,QWORD PTR[56+rbp] mov rdx,rbx adcx r14,rax adox r15,rsi @@ -2840,7 +3240,7 @@ DB 067h,067h,067h mov rdx,QWORD PTR[((48+8))+rsp] add r8,QWORD PTR[rdi] - lea rbp,QWORD PTR[128+rbp] + lea rbp,QWORD PTR[64+rbp] mov rcx,-8 adcx r9,QWORD PTR[8+rdi] adcx r10,QWORD PTR[16+rdi] @@ -2863,31 +3263,31 @@ $L$sqrx8x_tail:: adcx rbx,rax adox r8,r9 - mulx r9,rax,QWORD PTR[16+rbp] + mulx r9,rax,QWORD PTR[8+rbp] adcx r8,rax adox r9,r10 - mulx r10,rax,QWORD PTR[32+rbp] + mulx r10,rax,QWORD PTR[16+rbp] adcx r9,rax adox r10,r11 - mulx r11,rax,QWORD PTR[48+rbp] + mulx r11,rax,QWORD PTR[24+rbp] adcx r10,rax adox r11,r12 -DB 0c4h,062h,0fbh,0f6h,0a5h,040h,000h,000h,000h +DB 0c4h,062h,0fbh,0f6h,0a5h,020h,000h,000h,000h adcx r11,rax adox r12,r13 - mulx r13,rax,QWORD PTR[80+rbp] + mulx r13,rax,QWORD PTR[40+rbp] adcx r12,rax adox r13,r14 - mulx r14,rax,QWORD PTR[96+rbp] + mulx r14,rax,QWORD PTR[48+rbp] adcx r13,rax adox r14,r15 - mulx r15,rax,QWORD PTR[112+rbp] + mulx r15,rax,QWORD PTR[56+rbp] mov rdx,QWORD PTR[((72+48+8))+rcx*8+rsp] adcx r14,rax adox r15,rsi @@ -2903,7 +3303,7 @@ DB 0c4h,062h,0fbh,0f6h,0a5h,040h,000h,000h,000h sub rsi,QWORD PTR[((16+8))+rsp] mov rdx,QWORD PTR[((48+8))+rsp] - lea rbp,QWORD PTR[128+rbp] + lea rbp,QWORD PTR[64+rbp] adc r8,QWORD PTR[rdi] adc r9,QWORD PTR[8+rdi] adc r10,QWORD PTR[16+rdi] @@ -2923,6 +3323,15 @@ DB 0c4h,062h,0fbh,0f6h,0a5h,040h,000h,000h,000h ALIGN 32 $L$sqrx8x_tail_done:: add r8,QWORD PTR[((24+8))+rsp] + adc r9,0 + adc r10,0 + adc r11,0 + adc r12,0 + adc r13,0 + adc r14,0 + adc r15,0 + + mov rax,rsi sub rsi,QWORD PTR[((16+8))+rsp] @@ -2930,7 +3339,7 @@ $L$sqrx8x_no_tail:: adc r8,QWORD PTR[rdi] DB 102,72,15,126,217 adc r9,QWORD PTR[8+rdi] - mov rsi,QWORD PTR[112+rbp] + mov rsi,QWORD PTR[56+rbp] DB 102,72,15,126,213 adc r10,QWORD PTR[16+rdi] adc r11,QWORD PTR[24+rdi] @@ -2956,47 +3365,58 @@ DB 102,72,15,126,213 lea rdi,QWORD PTR[64+rcx*1+rdi] cmp r8,QWORD PTR[((8+8))+rsp] jb $L$sqrx8x_reduction_loop - xor rbx,rbx - sub rsi,r15 - adc rbx,rbx + DB 0F3h,0C3h ;repret +bn_sqrx8x_internal ENDP +ALIGN 32 +__bn_postx4x_internal:: + mov r12,QWORD PTR[rbp] mov r10,rcx -DB 067h - or rax,rbx -DB 067h mov r9,rcx - xor rax,1 + neg rax sar rcx,3+2 - lea rbp,QWORD PTR[rax*8+rbp] DB 102,72,15,126,202 DB 102,72,15,126,206 - jmp $L$sqrx4x_sub + dec r12 + mov r13,QWORD PTR[8+rbp] + xor r8,r8 + mov r14,QWORD PTR[16+rbp] + mov r15,QWORD PTR[24+rbp] + jmp $L$sqrx4x_sub_entry -ALIGN 32 +ALIGN 16 $L$sqrx4x_sub:: -DB 066h - mov r12,QWORD PTR[rdi] - mov r13,QWORD PTR[8+rdi] - sbb r12,QWORD PTR[rbp] - mov r14,QWORD PTR[16+rdi] - sbb r13,QWORD PTR[16+rbp] - mov r15,QWORD PTR[24+rdi] - lea rdi,QWORD PTR[32+rdi] - sbb r14,QWORD PTR[32+rbp] + mov r12,QWORD PTR[rbp] + mov r13,QWORD PTR[8+rbp] + mov r14,QWORD PTR[16+rbp] + mov r15,QWORD PTR[24+rbp] +$L$sqrx4x_sub_entry:: + andn r12,r12,rax + lea rbp,QWORD PTR[32+rbp] + andn r13,r13,rax + andn r14,r14,rax + andn r15,r15,rax + + neg r8 + adc r12,QWORD PTR[rdi] + adc r13,QWORD PTR[8+rdi] + adc r14,QWORD PTR[16+rdi] + adc r15,QWORD PTR[24+rdi] mov QWORD PTR[rdx],r12 - sbb r15,QWORD PTR[48+rbp] - lea rbp,QWORD PTR[64+rbp] + lea rdi,QWORD PTR[32+rdi] mov QWORD PTR[8+rdx],r13 + sbb r8,r8 mov QWORD PTR[16+rdx],r14 mov QWORD PTR[24+rdx],r15 lea rdx,QWORD PTR[32+rdx] inc rcx jnz $L$sqrx4x_sub + neg r9 DB 0F3h,0C3h ;repret -bn_sqrx8x_internal ENDP + PUBLIC bn_get_bits5 ALIGN 16 @@ -3036,55 +3456,171 @@ bn_scatter5 ENDP PUBLIC bn_gather5 -ALIGN 16 +ALIGN 32 bn_gather5 PROC PUBLIC $L$SEH_begin_bn_gather5:: -DB 048h,083h,0ech,028h -DB 00fh,029h,034h,024h -DB 00fh,029h,07ch,024h,010h - mov r11d,r9d - shr r9d,3 - and r11,7 - not r9d - lea rax,QWORD PTR[$L$magic_masks] - and r9d,3 - lea r8,QWORD PTR[128+r11*8+r8] - movq xmm4,QWORD PTR[r9*8+rax] - movq xmm5,QWORD PTR[8+r9*8+rax] - movq xmm6,QWORD PTR[16+r9*8+rax] - movq xmm7,QWORD PTR[24+r9*8+rax] +DB 04ch,08dh,014h,024h +DB 048h,081h,0ech,008h,001h,000h,000h + lea rax,QWORD PTR[$L$inc] + and rsp,-16 + + movd xmm5,r9d + movdqa xmm0,XMMWORD PTR[rax] + movdqa xmm1,XMMWORD PTR[16+rax] + lea r11,QWORD PTR[128+r8] + lea rax,QWORD PTR[128+rsp] + + pshufd xmm5,xmm5,0 + movdqa xmm4,xmm1 + movdqa xmm2,xmm1 + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa xmm3,xmm4 + + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[(-128)+rax],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[(-112)+rax],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[(-96)+rax],xmm2 + movdqa xmm2,xmm4 + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[(-80)+rax],xmm3 + movdqa xmm3,xmm4 + + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[(-64)+rax],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[(-48)+rax],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[(-32)+rax],xmm2 + movdqa xmm2,xmm4 + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[(-16)+rax],xmm3 + movdqa xmm3,xmm4 + + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[rax],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[16+rax],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[32+rax],xmm2 + movdqa xmm2,xmm4 + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[48+rax],xmm3 + movdqa xmm3,xmm4 + + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[64+rax],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[80+rax],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[96+rax],xmm2 + movdqa xmm2,xmm4 + movdqa XMMWORD PTR[112+rax],xmm3 jmp $L$gather -ALIGN 16 -$L$gather:: - movq xmm0,QWORD PTR[((-128))+r8] - movq xmm1,QWORD PTR[((-64))+r8] - pand xmm0,xmm4 - movq xmm2,QWORD PTR[r8] - pand xmm1,xmm5 - movq xmm3,QWORD PTR[64+r8] - pand xmm2,xmm6 - por xmm0,xmm1 - pand xmm3,xmm7 -DB 067h,067h - por xmm0,xmm2 - lea r8,QWORD PTR[256+r8] - por xmm0,xmm3 +ALIGN 32 +$L$gather:: + pxor xmm4,xmm4 + pxor xmm5,xmm5 + movdqa xmm0,XMMWORD PTR[((-128))+r11] + movdqa xmm1,XMMWORD PTR[((-112))+r11] + movdqa xmm2,XMMWORD PTR[((-96))+r11] + pand xmm0,XMMWORD PTR[((-128))+rax] + movdqa xmm3,XMMWORD PTR[((-80))+r11] + pand xmm1,XMMWORD PTR[((-112))+rax] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[((-96))+rax] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[((-80))+rax] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[((-64))+r11] + movdqa xmm1,XMMWORD PTR[((-48))+r11] + movdqa xmm2,XMMWORD PTR[((-32))+r11] + pand xmm0,XMMWORD PTR[((-64))+rax] + movdqa xmm3,XMMWORD PTR[((-16))+r11] + pand xmm1,XMMWORD PTR[((-48))+rax] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[((-32))+rax] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[((-16))+rax] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[r11] + movdqa xmm1,XMMWORD PTR[16+r11] + movdqa xmm2,XMMWORD PTR[32+r11] + pand xmm0,XMMWORD PTR[rax] + movdqa xmm3,XMMWORD PTR[48+r11] + pand xmm1,XMMWORD PTR[16+rax] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[32+rax] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[48+rax] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[64+r11] + movdqa xmm1,XMMWORD PTR[80+r11] + movdqa xmm2,XMMWORD PTR[96+r11] + pand xmm0,XMMWORD PTR[64+rax] + movdqa xmm3,XMMWORD PTR[112+r11] + pand xmm1,XMMWORD PTR[80+rax] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[96+rax] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[112+rax] + por xmm4,xmm2 + por xmm5,xmm3 + por xmm4,xmm5 + lea r11,QWORD PTR[256+r11] + pshufd xmm0,xmm4,04eh + por xmm0,xmm4 movq QWORD PTR[rcx],xmm0 lea rcx,QWORD PTR[8+rcx] sub edx,1 jnz $L$gather - movaps xmm6,XMMWORD PTR[rsp] - movaps xmm7,XMMWORD PTR[16+rsp] - lea rsp,QWORD PTR[40+rsp] + + lea rsp,QWORD PTR[r10] DB 0F3h,0C3h ;repret $L$SEH_end_bn_gather5:: bn_gather5 ENDP ALIGN 64 -$L$magic_masks:: - DD 0,0,0,0,0,0,-1,-1 - DD 0,0,0,0,0,0,0,0 +$L$inc:: + DD 0,0,1,1 + DD 2,2,2,2 DB 77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105 DB 112,108,105,99,97,116,105,111,110,32,119,105,116,104,32,115 DB 99,97,116,116,101,114,47,103,97,116,104,101,114,32,102,111 @@ -3126,19 +3662,16 @@ mul_handler PROC PRIVATE lea r10,QWORD PTR[$L$mul_epilogue] cmp rbx,r10 - jb $L$body_40 + ja $L$body_40 mov r10,QWORD PTR[192+r8] mov rax,QWORD PTR[8+r10*8+rax] + jmp $L$body_proceed $L$body_40:: mov rax,QWORD PTR[40+rax] $L$body_proceed:: - - movaps xmm0,XMMWORD PTR[((-88))+rax] - movaps xmm1,XMMWORD PTR[((-72))+rax] - mov rbx,QWORD PTR[((-8))+rax] mov rbp,QWORD PTR[((-16))+rax] mov r12,QWORD PTR[((-24))+rax] @@ -3151,8 +3684,6 @@ $L$body_proceed:: mov QWORD PTR[224+r8],r13 mov QWORD PTR[232+r8],r14 mov QWORD PTR[240+r8],r15 - movups XMMWORD PTR[512+r8],xmm0 - movups XMMWORD PTR[528+r8],xmm1 $L$common_seh_tail:: mov rdi,QWORD PTR[8+rax] @@ -3257,10 +3788,9 @@ DB 9,0,0,0 DD imagerel $L$powerx5_body,imagerel $L$powerx5_epilogue ALIGN 8 $L$SEH_info_bn_gather5:: -DB 001h,00dh,005h,000h -DB 00dh,078h,001h,000h -DB 008h,068h,000h,000h -DB 004h,042h,000h,000h +DB 001h,00bh,003h,00ah +DB 00bh,001h,021h,000h +DB 004h,0a3h,000h,000h ALIGN 8 .xdata ENDS diff --git a/deps/openssl/asm/x64-win32-masm/ec/ecp_nistz256-x86_64.asm b/deps/openssl/asm/x64-win32-masm/ec/ecp_nistz256-x86_64.asm index 3fa69816b50e7b..f38d253c166748 100644 --- a/deps/openssl/asm/x64-win32-masm/ec/ecp_nistz256-x86_64.asm +++ b/deps/openssl/asm/x64-win32-masm/ec/ecp_nistz256-x86_64.asm @@ -1813,6 +1813,7 @@ $L$SEH_begin_ecp_nistz256_point_double:: push r15 sub rsp,32*5+8 +$L$point_double_shortcutq:: movdqu xmm0,XMMWORD PTR[rsi] mov rbx,rsi movdqu xmm1,XMMWORD PTR[16+rsi] @@ -2091,6 +2092,7 @@ DB 102,72,15,110,199 mov r14,QWORD PTR[((64+8))+rbx] mov r15,QWORD PTR[((64+16))+rbx] mov r8,QWORD PTR[((64+24))+rbx] +DB 102,72,15,110,203 lea rsi,QWORD PTR[((64-0))+rbx] lea rdi,QWORD PTR[32+rsp] @@ -2182,7 +2184,7 @@ DB 102,73,15,126,217 test r8,r8 jnz $L$add_proceedq test r9,r9 - jz $L$add_proceedq + jz $L$add_doubleq DB 102,72,15,126,199 pxor xmm0,xmm0 @@ -2194,6 +2196,13 @@ DB 102,72,15,126,199 movdqu XMMWORD PTR[80+rdi],xmm0 jmp $L$add_doneq +ALIGN 32 +$L$add_doubleq:: +DB 102,72,15,126,206 +DB 102,72,15,126,199 + add rsp,416 + jmp $L$point_double_shortcutq + ALIGN 32 $L$add_proceedq:: mov rax,QWORD PTR[((0+64))+rsp] @@ -2876,6 +2885,7 @@ $L$point_doublex:: push r15 sub rsp,32*5+8 +$L$point_double_shortcutx:: movdqu xmm0,XMMWORD PTR[rsi] mov rbx,rsi movdqu xmm1,XMMWORD PTR[16+rsi] @@ -3150,6 +3160,7 @@ DB 102,72,15,110,199 mov r14,QWORD PTR[((64+8))+rbx] mov r15,QWORD PTR[((64+16))+rbx] mov r8,QWORD PTR[((64+24))+rbx] +DB 102,72,15,110,203 lea rsi,QWORD PTR[((64-128))+rbx] lea rdi,QWORD PTR[32+rsp] @@ -3241,7 +3252,7 @@ DB 102,73,15,126,217 test r8,r8 jnz $L$add_proceedx test r9,r9 - jz $L$add_proceedx + jz $L$add_doublex DB 102,72,15,126,199 pxor xmm0,xmm0 @@ -3253,6 +3264,13 @@ DB 102,72,15,126,199 movdqu XMMWORD PTR[80+rdi],xmm0 jmp $L$add_donex +ALIGN 32 +$L$add_doublex:: +DB 102,72,15,126,206 +DB 102,72,15,126,199 + add rsp,416 + jmp $L$point_double_shortcutx + ALIGN 32 $L$add_proceedx:: mov rdx,QWORD PTR[((0+64))+rsp] diff --git a/deps/openssl/asm/x64-win32-masm/modes/aesni-gcm-x86_64.asm b/deps/openssl/asm/x64-win32-masm/modes/aesni-gcm-x86_64.asm index 0626d8f7824646..6552f7d017f6a4 100644 --- a/deps/openssl/asm/x64-win32-masm/modes/aesni-gcm-x86_64.asm +++ b/deps/openssl/asm/x64-win32-masm/modes/aesni-gcm-x86_64.asm @@ -412,7 +412,7 @@ $L$dec_no_key_aliasing:: vzeroupper movaps xmm6,XMMWORD PTR[((-216))+rax] - movaps xmm7,XMMWORD PTR[((-216))+rax] + movaps xmm7,XMMWORD PTR[((-200))+rax] movaps xmm8,XMMWORD PTR[((-184))+rax] movaps xmm9,XMMWORD PTR[((-168))+rax] movaps xmm10,XMMWORD PTR[((-152))+rax] diff --git a/deps/openssl/asm/x86-elf-gas/sha/sha1-586.s b/deps/openssl/asm/x86-elf-gas/sha/sha1-586.s index 8a9ef772b73414..816b1d55bb206b 100644 --- a/deps/openssl/asm/x86-elf-gas/sha/sha1-586.s +++ b/deps/openssl/asm/x86-elf-gas/sha/sha1-586.s @@ -23,11 +23,6 @@ sha1_block_data_order: jz .L001x86 testl $536870912,%ecx jnz .Lshaext_shortcut - andl $268435456,%edx - andl $1073741824,%eax - orl %edx,%eax - cmpl $1342177280,%eax - je .Lavx_shortcut jmp .Lssse3_shortcut .align 16 .L001x86: @@ -2785,1176 +2780,6 @@ _sha1_block_data_order_ssse3: popl %ebp ret .size _sha1_block_data_order_ssse3,.-_sha1_block_data_order_ssse3 -.type _sha1_block_data_order_avx,@function -.align 16 -_sha1_block_data_order_avx: - pushl %ebp - pushl %ebx - pushl %esi - pushl %edi - call .L008pic_point -.L008pic_point: - popl %ebp - leal .LK_XX_XX-.L008pic_point(%ebp),%ebp -.Lavx_shortcut: - vzeroall - vmovdqa (%ebp),%xmm7 - vmovdqa 16(%ebp),%xmm0 - vmovdqa 32(%ebp),%xmm1 - vmovdqa 48(%ebp),%xmm2 - vmovdqa 64(%ebp),%xmm6 - movl 20(%esp),%edi - movl 24(%esp),%ebp - movl 28(%esp),%edx - movl %esp,%esi - subl $208,%esp - andl $-64,%esp - vmovdqa %xmm0,112(%esp) - vmovdqa %xmm1,128(%esp) - vmovdqa %xmm2,144(%esp) - shll $6,%edx - vmovdqa %xmm7,160(%esp) - addl %ebp,%edx - vmovdqa %xmm6,176(%esp) - addl $64,%ebp - movl %edi,192(%esp) - movl %ebp,196(%esp) - movl %edx,200(%esp) - movl %esi,204(%esp) - movl (%edi),%eax - movl 4(%edi),%ebx - movl 8(%edi),%ecx - movl 12(%edi),%edx - movl 16(%edi),%edi - movl %ebx,%esi - vmovdqu -64(%ebp),%xmm0 - vmovdqu -48(%ebp),%xmm1 - vmovdqu -32(%ebp),%xmm2 - vmovdqu -16(%ebp),%xmm3 - vpshufb %xmm6,%xmm0,%xmm0 - vpshufb %xmm6,%xmm1,%xmm1 - vpshufb %xmm6,%xmm2,%xmm2 - vmovdqa %xmm7,96(%esp) - vpshufb %xmm6,%xmm3,%xmm3 - vpaddd %xmm7,%xmm0,%xmm4 - vpaddd %xmm7,%xmm1,%xmm5 - vpaddd %xmm7,%xmm2,%xmm6 - vmovdqa %xmm4,(%esp) - movl %ecx,%ebp - vmovdqa %xmm5,16(%esp) - xorl %edx,%ebp - vmovdqa %xmm6,32(%esp) - andl %ebp,%esi - jmp .L009loop -.align 16 -.L009loop: - shrdl $2,%ebx,%ebx - xorl %edx,%esi - vpalignr $8,%xmm0,%xmm1,%xmm4 - movl %eax,%ebp - addl (%esp),%edi - vpaddd %xmm3,%xmm7,%xmm7 - vmovdqa %xmm0,64(%esp) - xorl %ecx,%ebx - shldl $5,%eax,%eax - vpsrldq $4,%xmm3,%xmm6 - addl %esi,%edi - andl %ebx,%ebp - vpxor %xmm0,%xmm4,%xmm4 - xorl %ecx,%ebx - addl %eax,%edi - vpxor %xmm2,%xmm6,%xmm6 - shrdl $7,%eax,%eax - xorl %ecx,%ebp - vmovdqa %xmm7,48(%esp) - movl %edi,%esi - addl 4(%esp),%edx - vpxor %xmm6,%xmm4,%xmm4 - xorl %ebx,%eax - shldl $5,%edi,%edi - addl %ebp,%edx - andl %eax,%esi - vpsrld $31,%xmm4,%xmm6 - xorl %ebx,%eax - addl %edi,%edx - shrdl $7,%edi,%edi - xorl %ebx,%esi - vpslldq $12,%xmm4,%xmm0 - vpaddd %xmm4,%xmm4,%xmm4 - movl %edx,%ebp - addl 8(%esp),%ecx - xorl %eax,%edi - shldl $5,%edx,%edx - vpsrld $30,%xmm0,%xmm7 - vpor %xmm6,%xmm4,%xmm4 - addl %esi,%ecx - andl %edi,%ebp - xorl %eax,%edi - addl %edx,%ecx - vpslld $2,%xmm0,%xmm0 - shrdl $7,%edx,%edx - xorl %eax,%ebp - vpxor %xmm7,%xmm4,%xmm4 - movl %ecx,%esi - addl 12(%esp),%ebx - xorl %edi,%edx - shldl $5,%ecx,%ecx - vpxor %xmm0,%xmm4,%xmm4 - addl %ebp,%ebx - andl %edx,%esi - vmovdqa 96(%esp),%xmm0 - xorl %edi,%edx - addl %ecx,%ebx - shrdl $7,%ecx,%ecx - xorl %edi,%esi - vpalignr $8,%xmm1,%xmm2,%xmm5 - movl %ebx,%ebp - addl 16(%esp),%eax - vpaddd %xmm4,%xmm0,%xmm0 - vmovdqa %xmm1,80(%esp) - xorl %edx,%ecx - shldl $5,%ebx,%ebx - vpsrldq $4,%xmm4,%xmm7 - addl %esi,%eax - andl %ecx,%ebp - vpxor %xmm1,%xmm5,%xmm5 - xorl %edx,%ecx - addl %ebx,%eax - vpxor %xmm3,%xmm7,%xmm7 - shrdl $7,%ebx,%ebx - xorl %edx,%ebp - vmovdqa %xmm0,(%esp) - movl %eax,%esi - addl 20(%esp),%edi - vpxor %xmm7,%xmm5,%xmm5 - xorl %ecx,%ebx - shldl $5,%eax,%eax - addl %ebp,%edi - andl %ebx,%esi - vpsrld $31,%xmm5,%xmm7 - xorl %ecx,%ebx - addl %eax,%edi - shrdl $7,%eax,%eax - xorl %ecx,%esi - vpslldq $12,%xmm5,%xmm1 - vpaddd %xmm5,%xmm5,%xmm5 - movl %edi,%ebp - addl 24(%esp),%edx - xorl %ebx,%eax - shldl $5,%edi,%edi - vpsrld $30,%xmm1,%xmm0 - vpor %xmm7,%xmm5,%xmm5 - addl %esi,%edx - andl %eax,%ebp - xorl %ebx,%eax - addl %edi,%edx - vpslld $2,%xmm1,%xmm1 - shrdl $7,%edi,%edi - xorl %ebx,%ebp - vpxor %xmm0,%xmm5,%xmm5 - movl %edx,%esi - addl 28(%esp),%ecx - xorl %eax,%edi - shldl $5,%edx,%edx - vpxor %xmm1,%xmm5,%xmm5 - addl %ebp,%ecx - andl %edi,%esi - vmovdqa 112(%esp),%xmm1 - xorl %eax,%edi - addl %edx,%ecx - shrdl $7,%edx,%edx - xorl %eax,%esi - vpalignr $8,%xmm2,%xmm3,%xmm6 - movl %ecx,%ebp - addl 32(%esp),%ebx - vpaddd %xmm5,%xmm1,%xmm1 - vmovdqa %xmm2,96(%esp) - xorl %edi,%edx - shldl $5,%ecx,%ecx - vpsrldq $4,%xmm5,%xmm0 - addl %esi,%ebx - andl %edx,%ebp - vpxor %xmm2,%xmm6,%xmm6 - xorl %edi,%edx - addl %ecx,%ebx - vpxor %xmm4,%xmm0,%xmm0 - shrdl $7,%ecx,%ecx - xorl %edi,%ebp - vmovdqa %xmm1,16(%esp) - movl %ebx,%esi - addl 36(%esp),%eax - vpxor %xmm0,%xmm6,%xmm6 - xorl %edx,%ecx - shldl $5,%ebx,%ebx - addl %ebp,%eax - andl %ecx,%esi - vpsrld $31,%xmm6,%xmm0 - xorl %edx,%ecx - addl %ebx,%eax - shrdl $7,%ebx,%ebx - xorl %edx,%esi - vpslldq $12,%xmm6,%xmm2 - vpaddd %xmm6,%xmm6,%xmm6 - movl %eax,%ebp - addl 40(%esp),%edi - xorl %ecx,%ebx - shldl $5,%eax,%eax - vpsrld $30,%xmm2,%xmm1 - vpor %xmm0,%xmm6,%xmm6 - addl %esi,%edi - andl %ebx,%ebp - xorl %ecx,%ebx - addl %eax,%edi - vpslld $2,%xmm2,%xmm2 - vmovdqa 64(%esp),%xmm0 - shrdl $7,%eax,%eax - xorl %ecx,%ebp - vpxor %xmm1,%xmm6,%xmm6 - movl %edi,%esi - addl 44(%esp),%edx - xorl %ebx,%eax - shldl $5,%edi,%edi - vpxor %xmm2,%xmm6,%xmm6 - addl %ebp,%edx - andl %eax,%esi - vmovdqa 112(%esp),%xmm2 - xorl %ebx,%eax - addl %edi,%edx - shrdl $7,%edi,%edi - xorl %ebx,%esi - vpalignr $8,%xmm3,%xmm4,%xmm7 - movl %edx,%ebp - addl 48(%esp),%ecx - vpaddd %xmm6,%xmm2,%xmm2 - vmovdqa %xmm3,64(%esp) - xorl %eax,%edi - shldl $5,%edx,%edx - vpsrldq $4,%xmm6,%xmm1 - addl %esi,%ecx - andl %edi,%ebp - vpxor %xmm3,%xmm7,%xmm7 - xorl %eax,%edi - addl %edx,%ecx - vpxor %xmm5,%xmm1,%xmm1 - shrdl $7,%edx,%edx - xorl %eax,%ebp - vmovdqa %xmm2,32(%esp) - movl %ecx,%esi - addl 52(%esp),%ebx - vpxor %xmm1,%xmm7,%xmm7 - xorl %edi,%edx - shldl $5,%ecx,%ecx - addl %ebp,%ebx - andl %edx,%esi - vpsrld $31,%xmm7,%xmm1 - xorl %edi,%edx - addl %ecx,%ebx - shrdl $7,%ecx,%ecx - xorl %edi,%esi - vpslldq $12,%xmm7,%xmm3 - vpaddd %xmm7,%xmm7,%xmm7 - movl %ebx,%ebp - addl 56(%esp),%eax - xorl %edx,%ecx - shldl $5,%ebx,%ebx - vpsrld $30,%xmm3,%xmm2 - vpor %xmm1,%xmm7,%xmm7 - addl %esi,%eax - andl %ecx,%ebp - xorl %edx,%ecx - addl %ebx,%eax - vpslld $2,%xmm3,%xmm3 - vmovdqa 80(%esp),%xmm1 - shrdl $7,%ebx,%ebx - xorl %edx,%ebp - vpxor %xmm2,%xmm7,%xmm7 - movl %eax,%esi - addl 60(%esp),%edi - xorl %ecx,%ebx - shldl $5,%eax,%eax - vpxor %xmm3,%xmm7,%xmm7 - addl %ebp,%edi - andl %ebx,%esi - vmovdqa 112(%esp),%xmm3 - xorl %ecx,%ebx - addl %eax,%edi - vpalignr $8,%xmm6,%xmm7,%xmm2 - vpxor %xmm4,%xmm0,%xmm0 - shrdl $7,%eax,%eax - xorl %ecx,%esi - movl %edi,%ebp - addl (%esp),%edx - vpxor %xmm1,%xmm0,%xmm0 - vmovdqa %xmm4,80(%esp) - xorl %ebx,%eax - shldl $5,%edi,%edi - vmovdqa %xmm3,%xmm4 - vpaddd %xmm7,%xmm3,%xmm3 - addl %esi,%edx - andl %eax,%ebp - vpxor %xmm2,%xmm0,%xmm0 - xorl %ebx,%eax - addl %edi,%edx - shrdl $7,%edi,%edi - xorl %ebx,%ebp - vpsrld $30,%xmm0,%xmm2 - vmovdqa %xmm3,48(%esp) - movl %edx,%esi - addl 4(%esp),%ecx - xorl %eax,%edi - shldl $5,%edx,%edx - vpslld $2,%xmm0,%xmm0 - addl %ebp,%ecx - andl %edi,%esi - xorl %eax,%edi - addl %edx,%ecx - shrdl $7,%edx,%edx - xorl %eax,%esi - movl %ecx,%ebp - addl 8(%esp),%ebx - vpor %xmm2,%xmm0,%xmm0 - xorl %edi,%edx - shldl $5,%ecx,%ecx - vmovdqa 96(%esp),%xmm2 - addl %esi,%ebx - andl %edx,%ebp - xorl %edi,%edx - addl %ecx,%ebx - addl 12(%esp),%eax - xorl %edi,%ebp - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %ebp,%eax - xorl %edx,%esi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vpalignr $8,%xmm7,%xmm0,%xmm3 - vpxor %xmm5,%xmm1,%xmm1 - addl 16(%esp),%edi - xorl %ecx,%esi - movl %eax,%ebp - shldl $5,%eax,%eax - vpxor %xmm2,%xmm1,%xmm1 - vmovdqa %xmm5,96(%esp) - addl %esi,%edi - xorl %ecx,%ebp - vmovdqa %xmm4,%xmm5 - vpaddd %xmm0,%xmm4,%xmm4 - shrdl $7,%ebx,%ebx - addl %eax,%edi - vpxor %xmm3,%xmm1,%xmm1 - addl 20(%esp),%edx - xorl %ebx,%ebp - movl %edi,%esi - shldl $5,%edi,%edi - vpsrld $30,%xmm1,%xmm3 - vmovdqa %xmm4,(%esp) - addl %ebp,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %edi,%edx - vpslld $2,%xmm1,%xmm1 - addl 24(%esp),%ecx - xorl %eax,%esi - movl %edx,%ebp - shldl $5,%edx,%edx - addl %esi,%ecx - xorl %eax,%ebp - shrdl $7,%edi,%edi - addl %edx,%ecx - vpor %xmm3,%xmm1,%xmm1 - addl 28(%esp),%ebx - xorl %edi,%ebp - vmovdqa 64(%esp),%xmm3 - movl %ecx,%esi - shldl $5,%ecx,%ecx - addl %ebp,%ebx - xorl %edi,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - vpalignr $8,%xmm0,%xmm1,%xmm4 - vpxor %xmm6,%xmm2,%xmm2 - addl 32(%esp),%eax - xorl %edx,%esi - movl %ebx,%ebp - shldl $5,%ebx,%ebx - vpxor %xmm3,%xmm2,%xmm2 - vmovdqa %xmm6,64(%esp) - addl %esi,%eax - xorl %edx,%ebp - vmovdqa 128(%esp),%xmm6 - vpaddd %xmm1,%xmm5,%xmm5 - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vpxor %xmm4,%xmm2,%xmm2 - addl 36(%esp),%edi - xorl %ecx,%ebp - movl %eax,%esi - shldl $5,%eax,%eax - vpsrld $30,%xmm2,%xmm4 - vmovdqa %xmm5,16(%esp) - addl %ebp,%edi - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%edi - vpslld $2,%xmm2,%xmm2 - addl 40(%esp),%edx - xorl %ebx,%esi - movl %edi,%ebp - shldl $5,%edi,%edi - addl %esi,%edx - xorl %ebx,%ebp - shrdl $7,%eax,%eax - addl %edi,%edx - vpor %xmm4,%xmm2,%xmm2 - addl 44(%esp),%ecx - xorl %eax,%ebp - vmovdqa 80(%esp),%xmm4 - movl %edx,%esi - shldl $5,%edx,%edx - addl %ebp,%ecx - xorl %eax,%esi - shrdl $7,%edi,%edi - addl %edx,%ecx - vpalignr $8,%xmm1,%xmm2,%xmm5 - vpxor %xmm7,%xmm3,%xmm3 - addl 48(%esp),%ebx - xorl %edi,%esi - movl %ecx,%ebp - shldl $5,%ecx,%ecx - vpxor %xmm4,%xmm3,%xmm3 - vmovdqa %xmm7,80(%esp) - addl %esi,%ebx - xorl %edi,%ebp - vmovdqa %xmm6,%xmm7 - vpaddd %xmm2,%xmm6,%xmm6 - shrdl $7,%edx,%edx - addl %ecx,%ebx - vpxor %xmm5,%xmm3,%xmm3 - addl 52(%esp),%eax - xorl %edx,%ebp - movl %ebx,%esi - shldl $5,%ebx,%ebx - vpsrld $30,%xmm3,%xmm5 - vmovdqa %xmm6,32(%esp) - addl %ebp,%eax - xorl %edx,%esi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vpslld $2,%xmm3,%xmm3 - addl 56(%esp),%edi - xorl %ecx,%esi - movl %eax,%ebp - shldl $5,%eax,%eax - addl %esi,%edi - xorl %ecx,%ebp - shrdl $7,%ebx,%ebx - addl %eax,%edi - vpor %xmm5,%xmm3,%xmm3 - addl 60(%esp),%edx - xorl %ebx,%ebp - vmovdqa 96(%esp),%xmm5 - movl %edi,%esi - shldl $5,%edi,%edi - addl %ebp,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %edi,%edx - vpalignr $8,%xmm2,%xmm3,%xmm6 - vpxor %xmm0,%xmm4,%xmm4 - addl (%esp),%ecx - xorl %eax,%esi - movl %edx,%ebp - shldl $5,%edx,%edx - vpxor %xmm5,%xmm4,%xmm4 - vmovdqa %xmm0,96(%esp) - addl %esi,%ecx - xorl %eax,%ebp - vmovdqa %xmm7,%xmm0 - vpaddd %xmm3,%xmm7,%xmm7 - shrdl $7,%edi,%edi - addl %edx,%ecx - vpxor %xmm6,%xmm4,%xmm4 - addl 4(%esp),%ebx - xorl %edi,%ebp - movl %ecx,%esi - shldl $5,%ecx,%ecx - vpsrld $30,%xmm4,%xmm6 - vmovdqa %xmm7,48(%esp) - addl %ebp,%ebx - xorl %edi,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - vpslld $2,%xmm4,%xmm4 - addl 8(%esp),%eax - xorl %edx,%esi - movl %ebx,%ebp - shldl $5,%ebx,%ebx - addl %esi,%eax - xorl %edx,%ebp - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vpor %xmm6,%xmm4,%xmm4 - addl 12(%esp),%edi - xorl %ecx,%ebp - vmovdqa 64(%esp),%xmm6 - movl %eax,%esi - shldl $5,%eax,%eax - addl %ebp,%edi - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%edi - vpalignr $8,%xmm3,%xmm4,%xmm7 - vpxor %xmm1,%xmm5,%xmm5 - addl 16(%esp),%edx - xorl %ebx,%esi - movl %edi,%ebp - shldl $5,%edi,%edi - vpxor %xmm6,%xmm5,%xmm5 - vmovdqa %xmm1,64(%esp) - addl %esi,%edx - xorl %ebx,%ebp - vmovdqa %xmm0,%xmm1 - vpaddd %xmm4,%xmm0,%xmm0 - shrdl $7,%eax,%eax - addl %edi,%edx - vpxor %xmm7,%xmm5,%xmm5 - addl 20(%esp),%ecx - xorl %eax,%ebp - movl %edx,%esi - shldl $5,%edx,%edx - vpsrld $30,%xmm5,%xmm7 - vmovdqa %xmm0,(%esp) - addl %ebp,%ecx - xorl %eax,%esi - shrdl $7,%edi,%edi - addl %edx,%ecx - vpslld $2,%xmm5,%xmm5 - addl 24(%esp),%ebx - xorl %edi,%esi - movl %ecx,%ebp - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %edi,%ebp - shrdl $7,%edx,%edx - addl %ecx,%ebx - vpor %xmm7,%xmm5,%xmm5 - addl 28(%esp),%eax - vmovdqa 80(%esp),%xmm7 - shrdl $7,%ecx,%ecx - movl %ebx,%esi - xorl %edx,%ebp - shldl $5,%ebx,%ebx - addl %ebp,%eax - xorl %ecx,%esi - xorl %edx,%ecx - addl %ebx,%eax - vpalignr $8,%xmm4,%xmm5,%xmm0 - vpxor %xmm2,%xmm6,%xmm6 - addl 32(%esp),%edi - andl %ecx,%esi - xorl %edx,%ecx - shrdl $7,%ebx,%ebx - vpxor %xmm7,%xmm6,%xmm6 - vmovdqa %xmm2,80(%esp) - movl %eax,%ebp - xorl %ecx,%esi - vmovdqa %xmm1,%xmm2 - vpaddd %xmm5,%xmm1,%xmm1 - shldl $5,%eax,%eax - addl %esi,%edi - vpxor %xmm0,%xmm6,%xmm6 - xorl %ebx,%ebp - xorl %ecx,%ebx - addl %eax,%edi - addl 36(%esp),%edx - vpsrld $30,%xmm6,%xmm0 - vmovdqa %xmm1,16(%esp) - andl %ebx,%ebp - xorl %ecx,%ebx - shrdl $7,%eax,%eax - movl %edi,%esi - vpslld $2,%xmm6,%xmm6 - xorl %ebx,%ebp - shldl $5,%edi,%edi - addl %ebp,%edx - xorl %eax,%esi - xorl %ebx,%eax - addl %edi,%edx - addl 40(%esp),%ecx - andl %eax,%esi - vpor %xmm0,%xmm6,%xmm6 - xorl %ebx,%eax - shrdl $7,%edi,%edi - vmovdqa 96(%esp),%xmm0 - movl %edx,%ebp - xorl %eax,%esi - shldl $5,%edx,%edx - addl %esi,%ecx - xorl %edi,%ebp - xorl %eax,%edi - addl %edx,%ecx - addl 44(%esp),%ebx - andl %edi,%ebp - xorl %eax,%edi - shrdl $7,%edx,%edx - movl %ecx,%esi - xorl %edi,%ebp - shldl $5,%ecx,%ecx - addl %ebp,%ebx - xorl %edx,%esi - xorl %edi,%edx - addl %ecx,%ebx - vpalignr $8,%xmm5,%xmm6,%xmm1 - vpxor %xmm3,%xmm7,%xmm7 - addl 48(%esp),%eax - andl %edx,%esi - xorl %edi,%edx - shrdl $7,%ecx,%ecx - vpxor %xmm0,%xmm7,%xmm7 - vmovdqa %xmm3,96(%esp) - movl %ebx,%ebp - xorl %edx,%esi - vmovdqa 144(%esp),%xmm3 - vpaddd %xmm6,%xmm2,%xmm2 - shldl $5,%ebx,%ebx - addl %esi,%eax - vpxor %xmm1,%xmm7,%xmm7 - xorl %ecx,%ebp - xorl %edx,%ecx - addl %ebx,%eax - addl 52(%esp),%edi - vpsrld $30,%xmm7,%xmm1 - vmovdqa %xmm2,32(%esp) - andl %ecx,%ebp - xorl %edx,%ecx - shrdl $7,%ebx,%ebx - movl %eax,%esi - vpslld $2,%xmm7,%xmm7 - xorl %ecx,%ebp - shldl $5,%eax,%eax - addl %ebp,%edi - xorl %ebx,%esi - xorl %ecx,%ebx - addl %eax,%edi - addl 56(%esp),%edx - andl %ebx,%esi - vpor %xmm1,%xmm7,%xmm7 - xorl %ecx,%ebx - shrdl $7,%eax,%eax - vmovdqa 64(%esp),%xmm1 - movl %edi,%ebp - xorl %ebx,%esi - shldl $5,%edi,%edi - addl %esi,%edx - xorl %eax,%ebp - xorl %ebx,%eax - addl %edi,%edx - addl 60(%esp),%ecx - andl %eax,%ebp - xorl %ebx,%eax - shrdl $7,%edi,%edi - movl %edx,%esi - xorl %eax,%ebp - shldl $5,%edx,%edx - addl %ebp,%ecx - xorl %edi,%esi - xorl %eax,%edi - addl %edx,%ecx - vpalignr $8,%xmm6,%xmm7,%xmm2 - vpxor %xmm4,%xmm0,%xmm0 - addl (%esp),%ebx - andl %edi,%esi - xorl %eax,%edi - shrdl $7,%edx,%edx - vpxor %xmm1,%xmm0,%xmm0 - vmovdqa %xmm4,64(%esp) - movl %ecx,%ebp - xorl %edi,%esi - vmovdqa %xmm3,%xmm4 - vpaddd %xmm7,%xmm3,%xmm3 - shldl $5,%ecx,%ecx - addl %esi,%ebx - vpxor %xmm2,%xmm0,%xmm0 - xorl %edx,%ebp - xorl %edi,%edx - addl %ecx,%ebx - addl 4(%esp),%eax - vpsrld $30,%xmm0,%xmm2 - vmovdqa %xmm3,48(%esp) - andl %edx,%ebp - xorl %edi,%edx - shrdl $7,%ecx,%ecx - movl %ebx,%esi - vpslld $2,%xmm0,%xmm0 - xorl %edx,%ebp - shldl $5,%ebx,%ebx - addl %ebp,%eax - xorl %ecx,%esi - xorl %edx,%ecx - addl %ebx,%eax - addl 8(%esp),%edi - andl %ecx,%esi - vpor %xmm2,%xmm0,%xmm0 - xorl %edx,%ecx - shrdl $7,%ebx,%ebx - vmovdqa 80(%esp),%xmm2 - movl %eax,%ebp - xorl %ecx,%esi - shldl $5,%eax,%eax - addl %esi,%edi - xorl %ebx,%ebp - xorl %ecx,%ebx - addl %eax,%edi - addl 12(%esp),%edx - andl %ebx,%ebp - xorl %ecx,%ebx - shrdl $7,%eax,%eax - movl %edi,%esi - xorl %ebx,%ebp - shldl $5,%edi,%edi - addl %ebp,%edx - xorl %eax,%esi - xorl %ebx,%eax - addl %edi,%edx - vpalignr $8,%xmm7,%xmm0,%xmm3 - vpxor %xmm5,%xmm1,%xmm1 - addl 16(%esp),%ecx - andl %eax,%esi - xorl %ebx,%eax - shrdl $7,%edi,%edi - vpxor %xmm2,%xmm1,%xmm1 - vmovdqa %xmm5,80(%esp) - movl %edx,%ebp - xorl %eax,%esi - vmovdqa %xmm4,%xmm5 - vpaddd %xmm0,%xmm4,%xmm4 - shldl $5,%edx,%edx - addl %esi,%ecx - vpxor %xmm3,%xmm1,%xmm1 - xorl %edi,%ebp - xorl %eax,%edi - addl %edx,%ecx - addl 20(%esp),%ebx - vpsrld $30,%xmm1,%xmm3 - vmovdqa %xmm4,(%esp) - andl %edi,%ebp - xorl %eax,%edi - shrdl $7,%edx,%edx - movl %ecx,%esi - vpslld $2,%xmm1,%xmm1 - xorl %edi,%ebp - shldl $5,%ecx,%ecx - addl %ebp,%ebx - xorl %edx,%esi - xorl %edi,%edx - addl %ecx,%ebx - addl 24(%esp),%eax - andl %edx,%esi - vpor %xmm3,%xmm1,%xmm1 - xorl %edi,%edx - shrdl $7,%ecx,%ecx - vmovdqa 96(%esp),%xmm3 - movl %ebx,%ebp - xorl %edx,%esi - shldl $5,%ebx,%ebx - addl %esi,%eax - xorl %ecx,%ebp - xorl %edx,%ecx - addl %ebx,%eax - addl 28(%esp),%edi - andl %ecx,%ebp - xorl %edx,%ecx - shrdl $7,%ebx,%ebx - movl %eax,%esi - xorl %ecx,%ebp - shldl $5,%eax,%eax - addl %ebp,%edi - xorl %ebx,%esi - xorl %ecx,%ebx - addl %eax,%edi - vpalignr $8,%xmm0,%xmm1,%xmm4 - vpxor %xmm6,%xmm2,%xmm2 - addl 32(%esp),%edx - andl %ebx,%esi - xorl %ecx,%ebx - shrdl $7,%eax,%eax - vpxor %xmm3,%xmm2,%xmm2 - vmovdqa %xmm6,96(%esp) - movl %edi,%ebp - xorl %ebx,%esi - vmovdqa %xmm5,%xmm6 - vpaddd %xmm1,%xmm5,%xmm5 - shldl $5,%edi,%edi - addl %esi,%edx - vpxor %xmm4,%xmm2,%xmm2 - xorl %eax,%ebp - xorl %ebx,%eax - addl %edi,%edx - addl 36(%esp),%ecx - vpsrld $30,%xmm2,%xmm4 - vmovdqa %xmm5,16(%esp) - andl %eax,%ebp - xorl %ebx,%eax - shrdl $7,%edi,%edi - movl %edx,%esi - vpslld $2,%xmm2,%xmm2 - xorl %eax,%ebp - shldl $5,%edx,%edx - addl %ebp,%ecx - xorl %edi,%esi - xorl %eax,%edi - addl %edx,%ecx - addl 40(%esp),%ebx - andl %edi,%esi - vpor %xmm4,%xmm2,%xmm2 - xorl %eax,%edi - shrdl $7,%edx,%edx - vmovdqa 64(%esp),%xmm4 - movl %ecx,%ebp - xorl %edi,%esi - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %edx,%ebp - xorl %edi,%edx - addl %ecx,%ebx - addl 44(%esp),%eax - andl %edx,%ebp - xorl %edi,%edx - shrdl $7,%ecx,%ecx - movl %ebx,%esi - xorl %edx,%ebp - shldl $5,%ebx,%ebx - addl %ebp,%eax - xorl %edx,%esi - addl %ebx,%eax - vpalignr $8,%xmm1,%xmm2,%xmm5 - vpxor %xmm7,%xmm3,%xmm3 - addl 48(%esp),%edi - xorl %ecx,%esi - movl %eax,%ebp - shldl $5,%eax,%eax - vpxor %xmm4,%xmm3,%xmm3 - vmovdqa %xmm7,64(%esp) - addl %esi,%edi - xorl %ecx,%ebp - vmovdqa %xmm6,%xmm7 - vpaddd %xmm2,%xmm6,%xmm6 - shrdl $7,%ebx,%ebx - addl %eax,%edi - vpxor %xmm5,%xmm3,%xmm3 - addl 52(%esp),%edx - xorl %ebx,%ebp - movl %edi,%esi - shldl $5,%edi,%edi - vpsrld $30,%xmm3,%xmm5 - vmovdqa %xmm6,32(%esp) - addl %ebp,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %edi,%edx - vpslld $2,%xmm3,%xmm3 - addl 56(%esp),%ecx - xorl %eax,%esi - movl %edx,%ebp - shldl $5,%edx,%edx - addl %esi,%ecx - xorl %eax,%ebp - shrdl $7,%edi,%edi - addl %edx,%ecx - vpor %xmm5,%xmm3,%xmm3 - addl 60(%esp),%ebx - xorl %edi,%ebp - movl %ecx,%esi - shldl $5,%ecx,%ecx - addl %ebp,%ebx - xorl %edi,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl (%esp),%eax - vpaddd %xmm3,%xmm7,%xmm7 - xorl %edx,%esi - movl %ebx,%ebp - shldl $5,%ebx,%ebx - addl %esi,%eax - vmovdqa %xmm7,48(%esp) - xorl %edx,%ebp - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 4(%esp),%edi - xorl %ecx,%ebp - movl %eax,%esi - shldl $5,%eax,%eax - addl %ebp,%edi - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%edi - addl 8(%esp),%edx - xorl %ebx,%esi - movl %edi,%ebp - shldl $5,%edi,%edi - addl %esi,%edx - xorl %ebx,%ebp - shrdl $7,%eax,%eax - addl %edi,%edx - addl 12(%esp),%ecx - xorl %eax,%ebp - movl %edx,%esi - shldl $5,%edx,%edx - addl %ebp,%ecx - xorl %eax,%esi - shrdl $7,%edi,%edi - addl %edx,%ecx - movl 196(%esp),%ebp - cmpl 200(%esp),%ebp - je .L010done - vmovdqa 160(%esp),%xmm7 - vmovdqa 176(%esp),%xmm6 - vmovdqu (%ebp),%xmm0 - vmovdqu 16(%ebp),%xmm1 - vmovdqu 32(%ebp),%xmm2 - vmovdqu 48(%ebp),%xmm3 - addl $64,%ebp - vpshufb %xmm6,%xmm0,%xmm0 - movl %ebp,196(%esp) - vmovdqa %xmm7,96(%esp) - addl 16(%esp),%ebx - xorl %edi,%esi - vpshufb %xmm6,%xmm1,%xmm1 - movl %ecx,%ebp - shldl $5,%ecx,%ecx - vpaddd %xmm7,%xmm0,%xmm4 - addl %esi,%ebx - xorl %edi,%ebp - shrdl $7,%edx,%edx - addl %ecx,%ebx - vmovdqa %xmm4,(%esp) - addl 20(%esp),%eax - xorl %edx,%ebp - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %ebp,%eax - xorl %edx,%esi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 24(%esp),%edi - xorl %ecx,%esi - movl %eax,%ebp - shldl $5,%eax,%eax - addl %esi,%edi - xorl %ecx,%ebp - shrdl $7,%ebx,%ebx - addl %eax,%edi - addl 28(%esp),%edx - xorl %ebx,%ebp - movl %edi,%esi - shldl $5,%edi,%edi - addl %ebp,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %edi,%edx - addl 32(%esp),%ecx - xorl %eax,%esi - vpshufb %xmm6,%xmm2,%xmm2 - movl %edx,%ebp - shldl $5,%edx,%edx - vpaddd %xmm7,%xmm1,%xmm5 - addl %esi,%ecx - xorl %eax,%ebp - shrdl $7,%edi,%edi - addl %edx,%ecx - vmovdqa %xmm5,16(%esp) - addl 36(%esp),%ebx - xorl %edi,%ebp - movl %ecx,%esi - shldl $5,%ecx,%ecx - addl %ebp,%ebx - xorl %edi,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 40(%esp),%eax - xorl %edx,%esi - movl %ebx,%ebp - shldl $5,%ebx,%ebx - addl %esi,%eax - xorl %edx,%ebp - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 44(%esp),%edi - xorl %ecx,%ebp - movl %eax,%esi - shldl $5,%eax,%eax - addl %ebp,%edi - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%edi - addl 48(%esp),%edx - xorl %ebx,%esi - vpshufb %xmm6,%xmm3,%xmm3 - movl %edi,%ebp - shldl $5,%edi,%edi - vpaddd %xmm7,%xmm2,%xmm6 - addl %esi,%edx - xorl %ebx,%ebp - shrdl $7,%eax,%eax - addl %edi,%edx - vmovdqa %xmm6,32(%esp) - addl 52(%esp),%ecx - xorl %eax,%ebp - movl %edx,%esi - shldl $5,%edx,%edx - addl %ebp,%ecx - xorl %eax,%esi - shrdl $7,%edi,%edi - addl %edx,%ecx - addl 56(%esp),%ebx - xorl %edi,%esi - movl %ecx,%ebp - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %edi,%ebp - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 60(%esp),%eax - xorl %edx,%ebp - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %ebp,%eax - shrdl $7,%ecx,%ecx - addl %ebx,%eax - movl 192(%esp),%ebp - addl (%ebp),%eax - addl 4(%ebp),%esi - addl 8(%ebp),%ecx - movl %eax,(%ebp) - addl 12(%ebp),%edx - movl %esi,4(%ebp) - addl 16(%ebp),%edi - movl %ecx,%ebx - movl %ecx,8(%ebp) - xorl %edx,%ebx - movl %edx,12(%ebp) - movl %edi,16(%ebp) - movl %esi,%ebp - andl %ebx,%esi - movl %ebp,%ebx - jmp .L009loop -.align 16 -.L010done: - addl 16(%esp),%ebx - xorl %edi,%esi - movl %ecx,%ebp - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %edi,%ebp - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 20(%esp),%eax - xorl %edx,%ebp - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %ebp,%eax - xorl %edx,%esi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 24(%esp),%edi - xorl %ecx,%esi - movl %eax,%ebp - shldl $5,%eax,%eax - addl %esi,%edi - xorl %ecx,%ebp - shrdl $7,%ebx,%ebx - addl %eax,%edi - addl 28(%esp),%edx - xorl %ebx,%ebp - movl %edi,%esi - shldl $5,%edi,%edi - addl %ebp,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %edi,%edx - addl 32(%esp),%ecx - xorl %eax,%esi - movl %edx,%ebp - shldl $5,%edx,%edx - addl %esi,%ecx - xorl %eax,%ebp - shrdl $7,%edi,%edi - addl %edx,%ecx - addl 36(%esp),%ebx - xorl %edi,%ebp - movl %ecx,%esi - shldl $5,%ecx,%ecx - addl %ebp,%ebx - xorl %edi,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 40(%esp),%eax - xorl %edx,%esi - movl %ebx,%ebp - shldl $5,%ebx,%ebx - addl %esi,%eax - xorl %edx,%ebp - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 44(%esp),%edi - xorl %ecx,%ebp - movl %eax,%esi - shldl $5,%eax,%eax - addl %ebp,%edi - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%edi - addl 48(%esp),%edx - xorl %ebx,%esi - movl %edi,%ebp - shldl $5,%edi,%edi - addl %esi,%edx - xorl %ebx,%ebp - shrdl $7,%eax,%eax - addl %edi,%edx - addl 52(%esp),%ecx - xorl %eax,%ebp - movl %edx,%esi - shldl $5,%edx,%edx - addl %ebp,%ecx - xorl %eax,%esi - shrdl $7,%edi,%edi - addl %edx,%ecx - addl 56(%esp),%ebx - xorl %edi,%esi - movl %ecx,%ebp - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %edi,%ebp - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 60(%esp),%eax - xorl %edx,%ebp - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %ebp,%eax - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vzeroall - movl 192(%esp),%ebp - addl (%ebp),%eax - movl 204(%esp),%esp - addl 4(%ebp),%esi - addl 8(%ebp),%ecx - movl %eax,(%ebp) - addl 12(%ebp),%edx - movl %esi,4(%ebp) - addl 16(%ebp),%edi - movl %ecx,8(%ebp) - movl %edx,12(%ebp) - movl %edi,16(%ebp) - popl %edi - popl %esi - popl %ebx - popl %ebp - ret -.size _sha1_block_data_order_avx,.-_sha1_block_data_order_avx .align 64 .LK_XX_XX: .long 1518500249,1518500249,1518500249,1518500249 diff --git a/deps/openssl/asm/x86-elf-gas/sha/sha256-586.s b/deps/openssl/asm/x86-elf-gas/sha/sha256-586.s index b434e42babe16e..836d91886bda53 100644 --- a/deps/openssl/asm/x86-elf-gas/sha/sha256-586.s +++ b/deps/openssl/asm/x86-elf-gas/sha/sha256-586.s @@ -40,13 +40,12 @@ sha256_block_data_order: orl %ebx,%ecx andl $1342177280,%ecx cmpl $1342177280,%ecx - je .L005AVX testl $512,%ebx - jnz .L006SSSE3 + jnz .L005SSSE3 .L003no_xmm: subl %edi,%eax cmpl $256,%eax - jae .L007unrolled + jae .L006unrolled jmp .L002loop .align 16 .L002loop: @@ -118,7 +117,7 @@ sha256_block_data_order: movl %ecx,28(%esp) movl %edi,32(%esp) .align 16 -.L00800_15: +.L00700_15: movl %edx,%ecx movl 24(%esp),%esi rorl $14,%ecx @@ -156,11 +155,11 @@ sha256_block_data_order: addl $4,%ebp addl %ebx,%eax cmpl $3248222580,%esi - jne .L00800_15 + jne .L00700_15 movl 156(%esp),%ecx - jmp .L00916_63 + jmp .L00816_63 .align 16 -.L00916_63: +.L00816_63: movl %ecx,%ebx movl 104(%esp),%esi rorl $11,%ecx @@ -215,7 +214,7 @@ sha256_block_data_order: addl $4,%ebp addl %ebx,%eax cmpl $3329325298,%esi - jne .L00916_63 + jne .L00816_63 movl 356(%esp),%esi movl 8(%esp),%ebx movl 16(%esp),%ecx @@ -259,7 +258,7 @@ sha256_block_data_order: .byte 112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103 .byte 62,0 .align 16 -.L007unrolled: +.L006unrolled: leal -96(%esp),%esp movl (%esi),%eax movl 4(%esi),%ebp @@ -276,9 +275,9 @@ sha256_block_data_order: movl %ebx,20(%esp) movl %ecx,24(%esp) movl %esi,28(%esp) - jmp .L010grand_loop + jmp .L009grand_loop .align 16 -.L010grand_loop: +.L009grand_loop: movl (%edi),%ebx movl 4(%edi),%ecx bswap %ebx @@ -3158,7 +3157,7 @@ sha256_block_data_order: movl %ebx,24(%esp) movl %ecx,28(%esp) cmpl 104(%esp),%edi - jb .L010grand_loop + jb .L009grand_loop movl 108(%esp),%esp popl %edi popl %esi @@ -3177,9 +3176,9 @@ sha256_block_data_order: pshufd $27,%xmm2,%xmm2 .byte 102,15,58,15,202,8 punpcklqdq %xmm0,%xmm2 - jmp .L011loop_shaext + jmp .L010loop_shaext .align 16 -.L011loop_shaext: +.L010loop_shaext: movdqu (%edi),%xmm3 movdqu 16(%edi),%xmm4 movdqu 32(%edi),%xmm5 @@ -3349,7 +3348,7 @@ sha256_block_data_order: .byte 15,56,203,202 paddd 16(%esp),%xmm2 paddd (%esp),%xmm1 - jnz .L011loop_shaext + jnz .L010loop_shaext pshufd $177,%xmm2,%xmm2 pshufd $27,%xmm1,%xmm7 pshufd $177,%xmm1,%xmm1 @@ -3364,7 +3363,7 @@ sha256_block_data_order: popl %ebp ret .align 32 -.L006SSSE3: +.L005SSSE3: leal -96(%esp),%esp movl (%esi),%eax movl 4(%esi),%ebx @@ -3383,9 +3382,9 @@ sha256_block_data_order: movl %ecx,24(%esp) movl %esi,28(%esp) movdqa 256(%ebp),%xmm7 - jmp .L012grand_ssse3 + jmp .L011grand_ssse3 .align 16 -.L012grand_ssse3: +.L011grand_ssse3: movdqu (%edi),%xmm0 movdqu 16(%edi),%xmm1 movdqu 32(%edi),%xmm2 @@ -3408,9 +3407,9 @@ sha256_block_data_order: paddd %xmm3,%xmm7 movdqa %xmm6,64(%esp) movdqa %xmm7,80(%esp) - jmp .L013ssse3_00_47 + jmp .L012ssse3_00_47 .align 16 -.L013ssse3_00_47: +.L012ssse3_00_47: addl $64,%ebp movl %edx,%ecx movdqa %xmm1,%xmm4 @@ -4053,7 +4052,7 @@ sha256_block_data_order: addl %ecx,%eax movdqa %xmm6,80(%esp) cmpl $66051,64(%ebp) - jne .L013ssse3_00_47 + jne .L012ssse3_00_47 movl %edx,%ecx rorl $14,%edx movl 20(%esp),%esi @@ -4567,2217 +4566,12 @@ sha256_block_data_order: movdqa 64(%ebp),%xmm7 subl $192,%ebp cmpl 104(%esp),%edi - jb .L012grand_ssse3 + jb .L011grand_ssse3 movl 108(%esp),%esp popl %edi popl %esi popl %ebx popl %ebp ret -.align 32 -.L005AVX: - andl $264,%edx - cmpl $264,%edx - je .L014AVX_BMI - leal -96(%esp),%esp - vzeroall - movl (%esi),%eax - movl 4(%esi),%ebx - movl 8(%esi),%ecx - movl 12(%esi),%edi - movl %ebx,4(%esp) - xorl %ecx,%ebx - movl %ecx,8(%esp) - movl %edi,12(%esp) - movl 16(%esi),%edx - movl 20(%esi),%edi - movl 24(%esi),%ecx - movl 28(%esi),%esi - movl %edi,20(%esp) - movl 100(%esp),%edi - movl %ecx,24(%esp) - movl %esi,28(%esp) - vmovdqa 256(%ebp),%xmm7 - jmp .L015grand_avx -.align 32 -.L015grand_avx: - vmovdqu (%edi),%xmm0 - vmovdqu 16(%edi),%xmm1 - vmovdqu 32(%edi),%xmm2 - vmovdqu 48(%edi),%xmm3 - addl $64,%edi - vpshufb %xmm7,%xmm0,%xmm0 - movl %edi,100(%esp) - vpshufb %xmm7,%xmm1,%xmm1 - vpshufb %xmm7,%xmm2,%xmm2 - vpaddd (%ebp),%xmm0,%xmm4 - vpshufb %xmm7,%xmm3,%xmm3 - vpaddd 16(%ebp),%xmm1,%xmm5 - vpaddd 32(%ebp),%xmm2,%xmm6 - vpaddd 48(%ebp),%xmm3,%xmm7 - vmovdqa %xmm4,32(%esp) - vmovdqa %xmm5,48(%esp) - vmovdqa %xmm6,64(%esp) - vmovdqa %xmm7,80(%esp) - jmp .L016avx_00_47 -.align 16 -.L016avx_00_47: - addl $64,%ebp - vpalignr $4,%xmm0,%xmm1,%xmm4 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 20(%esp),%esi - vpalignr $4,%xmm2,%xmm3,%xmm7 - xorl %ecx,%edx - movl 24(%esp),%edi - xorl %edi,%esi - vpsrld $7,%xmm4,%xmm6 - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,16(%esp) - vpaddd %xmm7,%xmm0,%xmm0 - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - vpsrld $3,%xmm4,%xmm7 - movl %eax,%ecx - addl %edi,%edx - movl 4(%esp),%edi - vpslld $14,%xmm4,%xmm5 - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,(%esp) - vpxor %xmm6,%xmm7,%xmm4 - xorl %eax,%ecx - xorl %edi,%eax - addl 28(%esp),%edx - vpshufd $250,%xmm3,%xmm7 - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - vpsrld $11,%xmm6,%xmm6 - addl 32(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - vpxor %xmm5,%xmm4,%xmm4 - addl %edx,%ebx - addl 12(%esp),%edx - addl %ecx,%ebx - vpslld $11,%xmm5,%xmm5 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 16(%esp),%esi - vpxor %xmm6,%xmm4,%xmm4 - xorl %ecx,%edx - movl 20(%esp),%edi - xorl %edi,%esi - vpsrld $10,%xmm7,%xmm6 - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,12(%esp) - vpxor %xmm5,%xmm4,%xmm4 - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - vpsrlq $17,%xmm7,%xmm5 - movl %ebx,%ecx - addl %edi,%edx - movl (%esp),%edi - vpaddd %xmm4,%xmm0,%xmm0 - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,28(%esp) - vpxor %xmm5,%xmm6,%xmm6 - xorl %ebx,%ecx - xorl %edi,%ebx - addl 24(%esp),%edx - vpsrlq $19,%xmm7,%xmm7 - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - vpxor %xmm7,%xmm6,%xmm6 - addl 36(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - vpshufd $132,%xmm6,%xmm7 - addl %edx,%eax - addl 8(%esp),%edx - addl %ecx,%eax - vpsrldq $8,%xmm7,%xmm7 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 12(%esp),%esi - vpaddd %xmm7,%xmm0,%xmm0 - xorl %ecx,%edx - movl 16(%esp),%edi - xorl %edi,%esi - vpshufd $80,%xmm0,%xmm7 - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,8(%esp) - vpsrld $10,%xmm7,%xmm6 - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - vpsrlq $17,%xmm7,%xmm5 - movl %eax,%ecx - addl %edi,%edx - movl 28(%esp),%edi - vpxor %xmm5,%xmm6,%xmm6 - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,24(%esp) - vpsrlq $19,%xmm7,%xmm7 - xorl %eax,%ecx - xorl %edi,%eax - addl 20(%esp),%edx - vpxor %xmm7,%xmm6,%xmm6 - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - vpshufd $232,%xmm6,%xmm7 - addl 40(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - vpslldq $8,%xmm7,%xmm7 - addl %edx,%ebx - addl 4(%esp),%edx - addl %ecx,%ebx - vpaddd %xmm7,%xmm0,%xmm0 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 8(%esp),%esi - vpaddd (%ebp),%xmm0,%xmm6 - xorl %ecx,%edx - movl 12(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,4(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %ebx,%ecx - addl %edi,%edx - movl 24(%esp),%edi - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,20(%esp) - xorl %ebx,%ecx - xorl %edi,%ebx - addl 16(%esp),%edx - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - addl 44(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - addl %edx,%eax - addl (%esp),%edx - addl %ecx,%eax - vmovdqa %xmm6,32(%esp) - vpalignr $4,%xmm1,%xmm2,%xmm4 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 4(%esp),%esi - vpalignr $4,%xmm3,%xmm0,%xmm7 - xorl %ecx,%edx - movl 8(%esp),%edi - xorl %edi,%esi - vpsrld $7,%xmm4,%xmm6 - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,(%esp) - vpaddd %xmm7,%xmm1,%xmm1 - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - vpsrld $3,%xmm4,%xmm7 - movl %eax,%ecx - addl %edi,%edx - movl 20(%esp),%edi - vpslld $14,%xmm4,%xmm5 - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,16(%esp) - vpxor %xmm6,%xmm7,%xmm4 - xorl %eax,%ecx - xorl %edi,%eax - addl 12(%esp),%edx - vpshufd $250,%xmm0,%xmm7 - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - vpsrld $11,%xmm6,%xmm6 - addl 48(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - vpxor %xmm5,%xmm4,%xmm4 - addl %edx,%ebx - addl 28(%esp),%edx - addl %ecx,%ebx - vpslld $11,%xmm5,%xmm5 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl (%esp),%esi - vpxor %xmm6,%xmm4,%xmm4 - xorl %ecx,%edx - movl 4(%esp),%edi - xorl %edi,%esi - vpsrld $10,%xmm7,%xmm6 - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,28(%esp) - vpxor %xmm5,%xmm4,%xmm4 - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - vpsrlq $17,%xmm7,%xmm5 - movl %ebx,%ecx - addl %edi,%edx - movl 16(%esp),%edi - vpaddd %xmm4,%xmm1,%xmm1 - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,12(%esp) - vpxor %xmm5,%xmm6,%xmm6 - xorl %ebx,%ecx - xorl %edi,%ebx - addl 8(%esp),%edx - vpsrlq $19,%xmm7,%xmm7 - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - vpxor %xmm7,%xmm6,%xmm6 - addl 52(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - vpshufd $132,%xmm6,%xmm7 - addl %edx,%eax - addl 24(%esp),%edx - addl %ecx,%eax - vpsrldq $8,%xmm7,%xmm7 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 28(%esp),%esi - vpaddd %xmm7,%xmm1,%xmm1 - xorl %ecx,%edx - movl (%esp),%edi - xorl %edi,%esi - vpshufd $80,%xmm1,%xmm7 - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,24(%esp) - vpsrld $10,%xmm7,%xmm6 - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - vpsrlq $17,%xmm7,%xmm5 - movl %eax,%ecx - addl %edi,%edx - movl 12(%esp),%edi - vpxor %xmm5,%xmm6,%xmm6 - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,8(%esp) - vpsrlq $19,%xmm7,%xmm7 - xorl %eax,%ecx - xorl %edi,%eax - addl 4(%esp),%edx - vpxor %xmm7,%xmm6,%xmm6 - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - vpshufd $232,%xmm6,%xmm7 - addl 56(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - vpslldq $8,%xmm7,%xmm7 - addl %edx,%ebx - addl 20(%esp),%edx - addl %ecx,%ebx - vpaddd %xmm7,%xmm1,%xmm1 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 24(%esp),%esi - vpaddd 16(%ebp),%xmm1,%xmm6 - xorl %ecx,%edx - movl 28(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,20(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %ebx,%ecx - addl %edi,%edx - movl 8(%esp),%edi - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,4(%esp) - xorl %ebx,%ecx - xorl %edi,%ebx - addl (%esp),%edx - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - addl 60(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - addl %edx,%eax - addl 16(%esp),%edx - addl %ecx,%eax - vmovdqa %xmm6,48(%esp) - vpalignr $4,%xmm2,%xmm3,%xmm4 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 20(%esp),%esi - vpalignr $4,%xmm0,%xmm1,%xmm7 - xorl %ecx,%edx - movl 24(%esp),%edi - xorl %edi,%esi - vpsrld $7,%xmm4,%xmm6 - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,16(%esp) - vpaddd %xmm7,%xmm2,%xmm2 - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - vpsrld $3,%xmm4,%xmm7 - movl %eax,%ecx - addl %edi,%edx - movl 4(%esp),%edi - vpslld $14,%xmm4,%xmm5 - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,(%esp) - vpxor %xmm6,%xmm7,%xmm4 - xorl %eax,%ecx - xorl %edi,%eax - addl 28(%esp),%edx - vpshufd $250,%xmm1,%xmm7 - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - vpsrld $11,%xmm6,%xmm6 - addl 64(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - vpxor %xmm5,%xmm4,%xmm4 - addl %edx,%ebx - addl 12(%esp),%edx - addl %ecx,%ebx - vpslld $11,%xmm5,%xmm5 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 16(%esp),%esi - vpxor %xmm6,%xmm4,%xmm4 - xorl %ecx,%edx - movl 20(%esp),%edi - xorl %edi,%esi - vpsrld $10,%xmm7,%xmm6 - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,12(%esp) - vpxor %xmm5,%xmm4,%xmm4 - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - vpsrlq $17,%xmm7,%xmm5 - movl %ebx,%ecx - addl %edi,%edx - movl (%esp),%edi - vpaddd %xmm4,%xmm2,%xmm2 - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,28(%esp) - vpxor %xmm5,%xmm6,%xmm6 - xorl %ebx,%ecx - xorl %edi,%ebx - addl 24(%esp),%edx - vpsrlq $19,%xmm7,%xmm7 - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - vpxor %xmm7,%xmm6,%xmm6 - addl 68(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - vpshufd $132,%xmm6,%xmm7 - addl %edx,%eax - addl 8(%esp),%edx - addl %ecx,%eax - vpsrldq $8,%xmm7,%xmm7 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 12(%esp),%esi - vpaddd %xmm7,%xmm2,%xmm2 - xorl %ecx,%edx - movl 16(%esp),%edi - xorl %edi,%esi - vpshufd $80,%xmm2,%xmm7 - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,8(%esp) - vpsrld $10,%xmm7,%xmm6 - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - vpsrlq $17,%xmm7,%xmm5 - movl %eax,%ecx - addl %edi,%edx - movl 28(%esp),%edi - vpxor %xmm5,%xmm6,%xmm6 - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,24(%esp) - vpsrlq $19,%xmm7,%xmm7 - xorl %eax,%ecx - xorl %edi,%eax - addl 20(%esp),%edx - vpxor %xmm7,%xmm6,%xmm6 - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - vpshufd $232,%xmm6,%xmm7 - addl 72(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - vpslldq $8,%xmm7,%xmm7 - addl %edx,%ebx - addl 4(%esp),%edx - addl %ecx,%ebx - vpaddd %xmm7,%xmm2,%xmm2 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 8(%esp),%esi - vpaddd 32(%ebp),%xmm2,%xmm6 - xorl %ecx,%edx - movl 12(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,4(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %ebx,%ecx - addl %edi,%edx - movl 24(%esp),%edi - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,20(%esp) - xorl %ebx,%ecx - xorl %edi,%ebx - addl 16(%esp),%edx - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - addl 76(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - addl %edx,%eax - addl (%esp),%edx - addl %ecx,%eax - vmovdqa %xmm6,64(%esp) - vpalignr $4,%xmm3,%xmm0,%xmm4 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 4(%esp),%esi - vpalignr $4,%xmm1,%xmm2,%xmm7 - xorl %ecx,%edx - movl 8(%esp),%edi - xorl %edi,%esi - vpsrld $7,%xmm4,%xmm6 - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,(%esp) - vpaddd %xmm7,%xmm3,%xmm3 - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - vpsrld $3,%xmm4,%xmm7 - movl %eax,%ecx - addl %edi,%edx - movl 20(%esp),%edi - vpslld $14,%xmm4,%xmm5 - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,16(%esp) - vpxor %xmm6,%xmm7,%xmm4 - xorl %eax,%ecx - xorl %edi,%eax - addl 12(%esp),%edx - vpshufd $250,%xmm2,%xmm7 - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - vpsrld $11,%xmm6,%xmm6 - addl 80(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - vpxor %xmm5,%xmm4,%xmm4 - addl %edx,%ebx - addl 28(%esp),%edx - addl %ecx,%ebx - vpslld $11,%xmm5,%xmm5 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl (%esp),%esi - vpxor %xmm6,%xmm4,%xmm4 - xorl %ecx,%edx - movl 4(%esp),%edi - xorl %edi,%esi - vpsrld $10,%xmm7,%xmm6 - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,28(%esp) - vpxor %xmm5,%xmm4,%xmm4 - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - vpsrlq $17,%xmm7,%xmm5 - movl %ebx,%ecx - addl %edi,%edx - movl 16(%esp),%edi - vpaddd %xmm4,%xmm3,%xmm3 - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,12(%esp) - vpxor %xmm5,%xmm6,%xmm6 - xorl %ebx,%ecx - xorl %edi,%ebx - addl 8(%esp),%edx - vpsrlq $19,%xmm7,%xmm7 - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - vpxor %xmm7,%xmm6,%xmm6 - addl 84(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - vpshufd $132,%xmm6,%xmm7 - addl %edx,%eax - addl 24(%esp),%edx - addl %ecx,%eax - vpsrldq $8,%xmm7,%xmm7 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 28(%esp),%esi - vpaddd %xmm7,%xmm3,%xmm3 - xorl %ecx,%edx - movl (%esp),%edi - xorl %edi,%esi - vpshufd $80,%xmm3,%xmm7 - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,24(%esp) - vpsrld $10,%xmm7,%xmm6 - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - vpsrlq $17,%xmm7,%xmm5 - movl %eax,%ecx - addl %edi,%edx - movl 12(%esp),%edi - vpxor %xmm5,%xmm6,%xmm6 - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,8(%esp) - vpsrlq $19,%xmm7,%xmm7 - xorl %eax,%ecx - xorl %edi,%eax - addl 4(%esp),%edx - vpxor %xmm7,%xmm6,%xmm6 - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - vpshufd $232,%xmm6,%xmm7 - addl 88(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - vpslldq $8,%xmm7,%xmm7 - addl %edx,%ebx - addl 20(%esp),%edx - addl %ecx,%ebx - vpaddd %xmm7,%xmm3,%xmm3 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 24(%esp),%esi - vpaddd 48(%ebp),%xmm3,%xmm6 - xorl %ecx,%edx - movl 28(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,20(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %ebx,%ecx - addl %edi,%edx - movl 8(%esp),%edi - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,4(%esp) - xorl %ebx,%ecx - xorl %edi,%ebx - addl (%esp),%edx - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - addl 92(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - addl %edx,%eax - addl 16(%esp),%edx - addl %ecx,%eax - vmovdqa %xmm6,80(%esp) - cmpl $66051,64(%ebp) - jne .L016avx_00_47 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 20(%esp),%esi - xorl %ecx,%edx - movl 24(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,16(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %eax,%ecx - addl %edi,%edx - movl 4(%esp),%edi - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,(%esp) - xorl %eax,%ecx - xorl %edi,%eax - addl 28(%esp),%edx - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - addl 32(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - addl %edx,%ebx - addl 12(%esp),%edx - addl %ecx,%ebx - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 16(%esp),%esi - xorl %ecx,%edx - movl 20(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,12(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %ebx,%ecx - addl %edi,%edx - movl (%esp),%edi - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,28(%esp) - xorl %ebx,%ecx - xorl %edi,%ebx - addl 24(%esp),%edx - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - addl 36(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - addl %edx,%eax - addl 8(%esp),%edx - addl %ecx,%eax - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 12(%esp),%esi - xorl %ecx,%edx - movl 16(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,8(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %eax,%ecx - addl %edi,%edx - movl 28(%esp),%edi - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,24(%esp) - xorl %eax,%ecx - xorl %edi,%eax - addl 20(%esp),%edx - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - addl 40(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - addl %edx,%ebx - addl 4(%esp),%edx - addl %ecx,%ebx - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 8(%esp),%esi - xorl %ecx,%edx - movl 12(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,4(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %ebx,%ecx - addl %edi,%edx - movl 24(%esp),%edi - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,20(%esp) - xorl %ebx,%ecx - xorl %edi,%ebx - addl 16(%esp),%edx - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - addl 44(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - addl %edx,%eax - addl (%esp),%edx - addl %ecx,%eax - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 4(%esp),%esi - xorl %ecx,%edx - movl 8(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %eax,%ecx - addl %edi,%edx - movl 20(%esp),%edi - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,16(%esp) - xorl %eax,%ecx - xorl %edi,%eax - addl 12(%esp),%edx - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - addl 48(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - addl %edx,%ebx - addl 28(%esp),%edx - addl %ecx,%ebx - movl %edx,%ecx - shrdl $14,%edx,%edx - movl (%esp),%esi - xorl %ecx,%edx - movl 4(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,28(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %ebx,%ecx - addl %edi,%edx - movl 16(%esp),%edi - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,12(%esp) - xorl %ebx,%ecx - xorl %edi,%ebx - addl 8(%esp),%edx - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - addl 52(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - addl %edx,%eax - addl 24(%esp),%edx - addl %ecx,%eax - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 28(%esp),%esi - xorl %ecx,%edx - movl (%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,24(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %eax,%ecx - addl %edi,%edx - movl 12(%esp),%edi - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,8(%esp) - xorl %eax,%ecx - xorl %edi,%eax - addl 4(%esp),%edx - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - addl 56(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - addl %edx,%ebx - addl 20(%esp),%edx - addl %ecx,%ebx - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 24(%esp),%esi - xorl %ecx,%edx - movl 28(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,20(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %ebx,%ecx - addl %edi,%edx - movl 8(%esp),%edi - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,4(%esp) - xorl %ebx,%ecx - xorl %edi,%ebx - addl (%esp),%edx - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - addl 60(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - addl %edx,%eax - addl 16(%esp),%edx - addl %ecx,%eax - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 20(%esp),%esi - xorl %ecx,%edx - movl 24(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,16(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %eax,%ecx - addl %edi,%edx - movl 4(%esp),%edi - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,(%esp) - xorl %eax,%ecx - xorl %edi,%eax - addl 28(%esp),%edx - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - addl 64(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - addl %edx,%ebx - addl 12(%esp),%edx - addl %ecx,%ebx - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 16(%esp),%esi - xorl %ecx,%edx - movl 20(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,12(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %ebx,%ecx - addl %edi,%edx - movl (%esp),%edi - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,28(%esp) - xorl %ebx,%ecx - xorl %edi,%ebx - addl 24(%esp),%edx - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - addl 68(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - addl %edx,%eax - addl 8(%esp),%edx - addl %ecx,%eax - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 12(%esp),%esi - xorl %ecx,%edx - movl 16(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,8(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %eax,%ecx - addl %edi,%edx - movl 28(%esp),%edi - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,24(%esp) - xorl %eax,%ecx - xorl %edi,%eax - addl 20(%esp),%edx - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - addl 72(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - addl %edx,%ebx - addl 4(%esp),%edx - addl %ecx,%ebx - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 8(%esp),%esi - xorl %ecx,%edx - movl 12(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,4(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %ebx,%ecx - addl %edi,%edx - movl 24(%esp),%edi - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,20(%esp) - xorl %ebx,%ecx - xorl %edi,%ebx - addl 16(%esp),%edx - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - addl 76(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - addl %edx,%eax - addl (%esp),%edx - addl %ecx,%eax - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 4(%esp),%esi - xorl %ecx,%edx - movl 8(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %eax,%ecx - addl %edi,%edx - movl 20(%esp),%edi - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,16(%esp) - xorl %eax,%ecx - xorl %edi,%eax - addl 12(%esp),%edx - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - addl 80(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - addl %edx,%ebx - addl 28(%esp),%edx - addl %ecx,%ebx - movl %edx,%ecx - shrdl $14,%edx,%edx - movl (%esp),%esi - xorl %ecx,%edx - movl 4(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,28(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %ebx,%ecx - addl %edi,%edx - movl 16(%esp),%edi - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,12(%esp) - xorl %ebx,%ecx - xorl %edi,%ebx - addl 8(%esp),%edx - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - addl 84(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - addl %edx,%eax - addl 24(%esp),%edx - addl %ecx,%eax - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 28(%esp),%esi - xorl %ecx,%edx - movl (%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,24(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %eax,%ecx - addl %edi,%edx - movl 12(%esp),%edi - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,8(%esp) - xorl %eax,%ecx - xorl %edi,%eax - addl 4(%esp),%edx - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - addl 88(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - addl %edx,%ebx - addl 20(%esp),%edx - addl %ecx,%ebx - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 24(%esp),%esi - xorl %ecx,%edx - movl 28(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,20(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %ebx,%ecx - addl %edi,%edx - movl 8(%esp),%edi - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,4(%esp) - xorl %ebx,%ecx - xorl %edi,%ebx - addl (%esp),%edx - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - addl 92(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - addl %edx,%eax - addl 16(%esp),%edx - addl %ecx,%eax - movl 96(%esp),%esi - xorl %edi,%ebx - movl 12(%esp),%ecx - addl (%esi),%eax - addl 4(%esi),%ebx - addl 8(%esi),%edi - addl 12(%esi),%ecx - movl %eax,(%esi) - movl %ebx,4(%esi) - movl %edi,8(%esi) - movl %ecx,12(%esi) - movl %ebx,4(%esp) - xorl %edi,%ebx - movl %edi,8(%esp) - movl %ecx,12(%esp) - movl 20(%esp),%edi - movl 24(%esp),%ecx - addl 16(%esi),%edx - addl 20(%esi),%edi - addl 24(%esi),%ecx - movl %edx,16(%esi) - movl %edi,20(%esi) - movl %edi,20(%esp) - movl 28(%esp),%edi - movl %ecx,24(%esi) - addl 28(%esi),%edi - movl %ecx,24(%esp) - movl %edi,28(%esi) - movl %edi,28(%esp) - movl 100(%esp),%edi - vmovdqa 64(%ebp),%xmm7 - subl $192,%ebp - cmpl 104(%esp),%edi - jb .L015grand_avx - movl 108(%esp),%esp - vzeroall - popl %edi - popl %esi - popl %ebx - popl %ebp - ret -.align 32 -.L014AVX_BMI: - leal -96(%esp),%esp - vzeroall - movl (%esi),%eax - movl 4(%esi),%ebx - movl 8(%esi),%ecx - movl 12(%esi),%edi - movl %ebx,4(%esp) - xorl %ecx,%ebx - movl %ecx,8(%esp) - movl %edi,12(%esp) - movl 16(%esi),%edx - movl 20(%esi),%edi - movl 24(%esi),%ecx - movl 28(%esi),%esi - movl %edi,20(%esp) - movl 100(%esp),%edi - movl %ecx,24(%esp) - movl %esi,28(%esp) - vmovdqa 256(%ebp),%xmm7 - jmp .L017grand_avx_bmi -.align 32 -.L017grand_avx_bmi: - vmovdqu (%edi),%xmm0 - vmovdqu 16(%edi),%xmm1 - vmovdqu 32(%edi),%xmm2 - vmovdqu 48(%edi),%xmm3 - addl $64,%edi - vpshufb %xmm7,%xmm0,%xmm0 - movl %edi,100(%esp) - vpshufb %xmm7,%xmm1,%xmm1 - vpshufb %xmm7,%xmm2,%xmm2 - vpaddd (%ebp),%xmm0,%xmm4 - vpshufb %xmm7,%xmm3,%xmm3 - vpaddd 16(%ebp),%xmm1,%xmm5 - vpaddd 32(%ebp),%xmm2,%xmm6 - vpaddd 48(%ebp),%xmm3,%xmm7 - vmovdqa %xmm4,32(%esp) - vmovdqa %xmm5,48(%esp) - vmovdqa %xmm6,64(%esp) - vmovdqa %xmm7,80(%esp) - jmp .L018avx_bmi_00_47 -.align 16 -.L018avx_bmi_00_47: - addl $64,%ebp - vpalignr $4,%xmm0,%xmm1,%xmm4 - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,16(%esp) - vpalignr $4,%xmm2,%xmm3,%xmm7 - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 24(%esp),%edx,%esi - vpsrld $7,%xmm4,%xmm6 - xorl %edi,%ecx - andl 20(%esp),%edx - movl %eax,(%esp) - vpaddd %xmm7,%xmm0,%xmm0 - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - vpsrld $3,%xmm4,%xmm7 - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - vpslld $14,%xmm4,%xmm5 - movl 4(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - vpxor %xmm6,%xmm7,%xmm4 - addl 28(%esp),%edx - andl %eax,%ebx - addl 32(%esp),%edx - vpshufd $250,%xmm3,%xmm7 - xorl %edi,%ebx - addl %edx,%ecx - addl 12(%esp),%edx - vpsrld $11,%xmm6,%xmm6 - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - vpxor %xmm5,%xmm4,%xmm4 - movl %edx,12(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - vpslld $11,%xmm5,%xmm5 - andnl 20(%esp),%edx,%esi - xorl %edi,%ecx - andl 16(%esp),%edx - vpxor %xmm6,%xmm4,%xmm4 - movl %ebx,28(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - vpsrld $10,%xmm7,%xmm6 - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - vpxor %xmm5,%xmm4,%xmm4 - movl (%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - vpsrlq $17,%xmm7,%xmm5 - addl 24(%esp),%edx - andl %ebx,%eax - addl 36(%esp),%edx - vpaddd %xmm4,%xmm0,%xmm0 - xorl %edi,%eax - addl %edx,%ecx - addl 8(%esp),%edx - vpxor %xmm5,%xmm6,%xmm6 - leal (%eax,%ecx,1),%eax - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - vpsrlq $19,%xmm7,%xmm7 - movl %edx,8(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - vpxor %xmm7,%xmm6,%xmm6 - andnl 16(%esp),%edx,%esi - xorl %edi,%ecx - andl 12(%esp),%edx - vpshufd $132,%xmm6,%xmm7 - movl %eax,24(%esp) - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - vpsrldq $8,%xmm7,%xmm7 - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - vpaddd %xmm7,%xmm0,%xmm0 - movl 28(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - vpshufd $80,%xmm0,%xmm7 - addl 20(%esp),%edx - andl %eax,%ebx - addl 40(%esp),%edx - vpsrld $10,%xmm7,%xmm6 - xorl %edi,%ebx - addl %edx,%ecx - addl 4(%esp),%edx - vpsrlq $17,%xmm7,%xmm5 - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - vpxor %xmm5,%xmm6,%xmm6 - movl %edx,4(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - vpsrlq $19,%xmm7,%xmm7 - andnl 12(%esp),%edx,%esi - xorl %edi,%ecx - andl 8(%esp),%edx - vpxor %xmm7,%xmm6,%xmm6 - movl %ebx,20(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - vpshufd $232,%xmm6,%xmm7 - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - vpslldq $8,%xmm7,%xmm7 - movl 24(%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - vpaddd %xmm7,%xmm0,%xmm0 - addl 16(%esp),%edx - andl %ebx,%eax - addl 44(%esp),%edx - vpaddd (%ebp),%xmm0,%xmm6 - xorl %edi,%eax - addl %edx,%ecx - addl (%esp),%edx - leal (%eax,%ecx,1),%eax - vmovdqa %xmm6,32(%esp) - vpalignr $4,%xmm1,%xmm2,%xmm4 - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,(%esp) - vpalignr $4,%xmm3,%xmm0,%xmm7 - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 8(%esp),%edx,%esi - vpsrld $7,%xmm4,%xmm6 - xorl %edi,%ecx - andl 4(%esp),%edx - movl %eax,16(%esp) - vpaddd %xmm7,%xmm1,%xmm1 - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - vpsrld $3,%xmm4,%xmm7 - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - vpslld $14,%xmm4,%xmm5 - movl 20(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - vpxor %xmm6,%xmm7,%xmm4 - addl 12(%esp),%edx - andl %eax,%ebx - addl 48(%esp),%edx - vpshufd $250,%xmm0,%xmm7 - xorl %edi,%ebx - addl %edx,%ecx - addl 28(%esp),%edx - vpsrld $11,%xmm6,%xmm6 - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - vpxor %xmm5,%xmm4,%xmm4 - movl %edx,28(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - vpslld $11,%xmm5,%xmm5 - andnl 4(%esp),%edx,%esi - xorl %edi,%ecx - andl (%esp),%edx - vpxor %xmm6,%xmm4,%xmm4 - movl %ebx,12(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - vpsrld $10,%xmm7,%xmm6 - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - vpxor %xmm5,%xmm4,%xmm4 - movl 16(%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - vpsrlq $17,%xmm7,%xmm5 - addl 8(%esp),%edx - andl %ebx,%eax - addl 52(%esp),%edx - vpaddd %xmm4,%xmm1,%xmm1 - xorl %edi,%eax - addl %edx,%ecx - addl 24(%esp),%edx - vpxor %xmm5,%xmm6,%xmm6 - leal (%eax,%ecx,1),%eax - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - vpsrlq $19,%xmm7,%xmm7 - movl %edx,24(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - vpxor %xmm7,%xmm6,%xmm6 - andnl (%esp),%edx,%esi - xorl %edi,%ecx - andl 28(%esp),%edx - vpshufd $132,%xmm6,%xmm7 - movl %eax,8(%esp) - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - vpsrldq $8,%xmm7,%xmm7 - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - vpaddd %xmm7,%xmm1,%xmm1 - movl 12(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - vpshufd $80,%xmm1,%xmm7 - addl 4(%esp),%edx - andl %eax,%ebx - addl 56(%esp),%edx - vpsrld $10,%xmm7,%xmm6 - xorl %edi,%ebx - addl %edx,%ecx - addl 20(%esp),%edx - vpsrlq $17,%xmm7,%xmm5 - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - vpxor %xmm5,%xmm6,%xmm6 - movl %edx,20(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - vpsrlq $19,%xmm7,%xmm7 - andnl 28(%esp),%edx,%esi - xorl %edi,%ecx - andl 24(%esp),%edx - vpxor %xmm7,%xmm6,%xmm6 - movl %ebx,4(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - vpshufd $232,%xmm6,%xmm7 - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - vpslldq $8,%xmm7,%xmm7 - movl 8(%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - vpaddd %xmm7,%xmm1,%xmm1 - addl (%esp),%edx - andl %ebx,%eax - addl 60(%esp),%edx - vpaddd 16(%ebp),%xmm1,%xmm6 - xorl %edi,%eax - addl %edx,%ecx - addl 16(%esp),%edx - leal (%eax,%ecx,1),%eax - vmovdqa %xmm6,48(%esp) - vpalignr $4,%xmm2,%xmm3,%xmm4 - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,16(%esp) - vpalignr $4,%xmm0,%xmm1,%xmm7 - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 24(%esp),%edx,%esi - vpsrld $7,%xmm4,%xmm6 - xorl %edi,%ecx - andl 20(%esp),%edx - movl %eax,(%esp) - vpaddd %xmm7,%xmm2,%xmm2 - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - vpsrld $3,%xmm4,%xmm7 - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - vpslld $14,%xmm4,%xmm5 - movl 4(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - vpxor %xmm6,%xmm7,%xmm4 - addl 28(%esp),%edx - andl %eax,%ebx - addl 64(%esp),%edx - vpshufd $250,%xmm1,%xmm7 - xorl %edi,%ebx - addl %edx,%ecx - addl 12(%esp),%edx - vpsrld $11,%xmm6,%xmm6 - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - vpxor %xmm5,%xmm4,%xmm4 - movl %edx,12(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - vpslld $11,%xmm5,%xmm5 - andnl 20(%esp),%edx,%esi - xorl %edi,%ecx - andl 16(%esp),%edx - vpxor %xmm6,%xmm4,%xmm4 - movl %ebx,28(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - vpsrld $10,%xmm7,%xmm6 - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - vpxor %xmm5,%xmm4,%xmm4 - movl (%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - vpsrlq $17,%xmm7,%xmm5 - addl 24(%esp),%edx - andl %ebx,%eax - addl 68(%esp),%edx - vpaddd %xmm4,%xmm2,%xmm2 - xorl %edi,%eax - addl %edx,%ecx - addl 8(%esp),%edx - vpxor %xmm5,%xmm6,%xmm6 - leal (%eax,%ecx,1),%eax - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - vpsrlq $19,%xmm7,%xmm7 - movl %edx,8(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - vpxor %xmm7,%xmm6,%xmm6 - andnl 16(%esp),%edx,%esi - xorl %edi,%ecx - andl 12(%esp),%edx - vpshufd $132,%xmm6,%xmm7 - movl %eax,24(%esp) - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - vpsrldq $8,%xmm7,%xmm7 - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - vpaddd %xmm7,%xmm2,%xmm2 - movl 28(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - vpshufd $80,%xmm2,%xmm7 - addl 20(%esp),%edx - andl %eax,%ebx - addl 72(%esp),%edx - vpsrld $10,%xmm7,%xmm6 - xorl %edi,%ebx - addl %edx,%ecx - addl 4(%esp),%edx - vpsrlq $17,%xmm7,%xmm5 - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - vpxor %xmm5,%xmm6,%xmm6 - movl %edx,4(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - vpsrlq $19,%xmm7,%xmm7 - andnl 12(%esp),%edx,%esi - xorl %edi,%ecx - andl 8(%esp),%edx - vpxor %xmm7,%xmm6,%xmm6 - movl %ebx,20(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - vpshufd $232,%xmm6,%xmm7 - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - vpslldq $8,%xmm7,%xmm7 - movl 24(%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - vpaddd %xmm7,%xmm2,%xmm2 - addl 16(%esp),%edx - andl %ebx,%eax - addl 76(%esp),%edx - vpaddd 32(%ebp),%xmm2,%xmm6 - xorl %edi,%eax - addl %edx,%ecx - addl (%esp),%edx - leal (%eax,%ecx,1),%eax - vmovdqa %xmm6,64(%esp) - vpalignr $4,%xmm3,%xmm0,%xmm4 - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,(%esp) - vpalignr $4,%xmm1,%xmm2,%xmm7 - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 8(%esp),%edx,%esi - vpsrld $7,%xmm4,%xmm6 - xorl %edi,%ecx - andl 4(%esp),%edx - movl %eax,16(%esp) - vpaddd %xmm7,%xmm3,%xmm3 - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - vpsrld $3,%xmm4,%xmm7 - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - vpslld $14,%xmm4,%xmm5 - movl 20(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - vpxor %xmm6,%xmm7,%xmm4 - addl 12(%esp),%edx - andl %eax,%ebx - addl 80(%esp),%edx - vpshufd $250,%xmm2,%xmm7 - xorl %edi,%ebx - addl %edx,%ecx - addl 28(%esp),%edx - vpsrld $11,%xmm6,%xmm6 - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - vpxor %xmm5,%xmm4,%xmm4 - movl %edx,28(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - vpslld $11,%xmm5,%xmm5 - andnl 4(%esp),%edx,%esi - xorl %edi,%ecx - andl (%esp),%edx - vpxor %xmm6,%xmm4,%xmm4 - movl %ebx,12(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - vpsrld $10,%xmm7,%xmm6 - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - vpxor %xmm5,%xmm4,%xmm4 - movl 16(%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - vpsrlq $17,%xmm7,%xmm5 - addl 8(%esp),%edx - andl %ebx,%eax - addl 84(%esp),%edx - vpaddd %xmm4,%xmm3,%xmm3 - xorl %edi,%eax - addl %edx,%ecx - addl 24(%esp),%edx - vpxor %xmm5,%xmm6,%xmm6 - leal (%eax,%ecx,1),%eax - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - vpsrlq $19,%xmm7,%xmm7 - movl %edx,24(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - vpxor %xmm7,%xmm6,%xmm6 - andnl (%esp),%edx,%esi - xorl %edi,%ecx - andl 28(%esp),%edx - vpshufd $132,%xmm6,%xmm7 - movl %eax,8(%esp) - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - vpsrldq $8,%xmm7,%xmm7 - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - vpaddd %xmm7,%xmm3,%xmm3 - movl 12(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - vpshufd $80,%xmm3,%xmm7 - addl 4(%esp),%edx - andl %eax,%ebx - addl 88(%esp),%edx - vpsrld $10,%xmm7,%xmm6 - xorl %edi,%ebx - addl %edx,%ecx - addl 20(%esp),%edx - vpsrlq $17,%xmm7,%xmm5 - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - vpxor %xmm5,%xmm6,%xmm6 - movl %edx,20(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - vpsrlq $19,%xmm7,%xmm7 - andnl 28(%esp),%edx,%esi - xorl %edi,%ecx - andl 24(%esp),%edx - vpxor %xmm7,%xmm6,%xmm6 - movl %ebx,4(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - vpshufd $232,%xmm6,%xmm7 - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - vpslldq $8,%xmm7,%xmm7 - movl 8(%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - vpaddd %xmm7,%xmm3,%xmm3 - addl (%esp),%edx - andl %ebx,%eax - addl 92(%esp),%edx - vpaddd 48(%ebp),%xmm3,%xmm6 - xorl %edi,%eax - addl %edx,%ecx - addl 16(%esp),%edx - leal (%eax,%ecx,1),%eax - vmovdqa %xmm6,80(%esp) - cmpl $66051,64(%ebp) - jne .L018avx_bmi_00_47 - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,16(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 24(%esp),%edx,%esi - xorl %edi,%ecx - andl 20(%esp),%edx - movl %eax,(%esp) - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - movl 4(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - addl 28(%esp),%edx - andl %eax,%ebx - addl 32(%esp),%edx - xorl %edi,%ebx - addl %edx,%ecx - addl 12(%esp),%edx - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,12(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 20(%esp),%edx,%esi - xorl %edi,%ecx - andl 16(%esp),%edx - movl %ebx,28(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - movl (%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - addl 24(%esp),%edx - andl %ebx,%eax - addl 36(%esp),%edx - xorl %edi,%eax - addl %edx,%ecx - addl 8(%esp),%edx - leal (%eax,%ecx,1),%eax - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,8(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 16(%esp),%edx,%esi - xorl %edi,%ecx - andl 12(%esp),%edx - movl %eax,24(%esp) - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - movl 28(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - addl 20(%esp),%edx - andl %eax,%ebx - addl 40(%esp),%edx - xorl %edi,%ebx - addl %edx,%ecx - addl 4(%esp),%edx - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,4(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 12(%esp),%edx,%esi - xorl %edi,%ecx - andl 8(%esp),%edx - movl %ebx,20(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - movl 24(%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - addl 16(%esp),%edx - andl %ebx,%eax - addl 44(%esp),%edx - xorl %edi,%eax - addl %edx,%ecx - addl (%esp),%edx - leal (%eax,%ecx,1),%eax - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 8(%esp),%edx,%esi - xorl %edi,%ecx - andl 4(%esp),%edx - movl %eax,16(%esp) - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - movl 20(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - addl 12(%esp),%edx - andl %eax,%ebx - addl 48(%esp),%edx - xorl %edi,%ebx - addl %edx,%ecx - addl 28(%esp),%edx - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,28(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 4(%esp),%edx,%esi - xorl %edi,%ecx - andl (%esp),%edx - movl %ebx,12(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - movl 16(%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - addl 8(%esp),%edx - andl %ebx,%eax - addl 52(%esp),%edx - xorl %edi,%eax - addl %edx,%ecx - addl 24(%esp),%edx - leal (%eax,%ecx,1),%eax - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,24(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl (%esp),%edx,%esi - xorl %edi,%ecx - andl 28(%esp),%edx - movl %eax,8(%esp) - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - movl 12(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - addl 4(%esp),%edx - andl %eax,%ebx - addl 56(%esp),%edx - xorl %edi,%ebx - addl %edx,%ecx - addl 20(%esp),%edx - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,20(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 28(%esp),%edx,%esi - xorl %edi,%ecx - andl 24(%esp),%edx - movl %ebx,4(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - movl 8(%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - addl (%esp),%edx - andl %ebx,%eax - addl 60(%esp),%edx - xorl %edi,%eax - addl %edx,%ecx - addl 16(%esp),%edx - leal (%eax,%ecx,1),%eax - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,16(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 24(%esp),%edx,%esi - xorl %edi,%ecx - andl 20(%esp),%edx - movl %eax,(%esp) - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - movl 4(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - addl 28(%esp),%edx - andl %eax,%ebx - addl 64(%esp),%edx - xorl %edi,%ebx - addl %edx,%ecx - addl 12(%esp),%edx - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,12(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 20(%esp),%edx,%esi - xorl %edi,%ecx - andl 16(%esp),%edx - movl %ebx,28(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - movl (%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - addl 24(%esp),%edx - andl %ebx,%eax - addl 68(%esp),%edx - xorl %edi,%eax - addl %edx,%ecx - addl 8(%esp),%edx - leal (%eax,%ecx,1),%eax - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,8(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 16(%esp),%edx,%esi - xorl %edi,%ecx - andl 12(%esp),%edx - movl %eax,24(%esp) - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - movl 28(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - addl 20(%esp),%edx - andl %eax,%ebx - addl 72(%esp),%edx - xorl %edi,%ebx - addl %edx,%ecx - addl 4(%esp),%edx - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,4(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 12(%esp),%edx,%esi - xorl %edi,%ecx - andl 8(%esp),%edx - movl %ebx,20(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - movl 24(%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - addl 16(%esp),%edx - andl %ebx,%eax - addl 76(%esp),%edx - xorl %edi,%eax - addl %edx,%ecx - addl (%esp),%edx - leal (%eax,%ecx,1),%eax - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 8(%esp),%edx,%esi - xorl %edi,%ecx - andl 4(%esp),%edx - movl %eax,16(%esp) - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - movl 20(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - addl 12(%esp),%edx - andl %eax,%ebx - addl 80(%esp),%edx - xorl %edi,%ebx - addl %edx,%ecx - addl 28(%esp),%edx - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,28(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 4(%esp),%edx,%esi - xorl %edi,%ecx - andl (%esp),%edx - movl %ebx,12(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - movl 16(%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - addl 8(%esp),%edx - andl %ebx,%eax - addl 84(%esp),%edx - xorl %edi,%eax - addl %edx,%ecx - addl 24(%esp),%edx - leal (%eax,%ecx,1),%eax - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,24(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl (%esp),%edx,%esi - xorl %edi,%ecx - andl 28(%esp),%edx - movl %eax,8(%esp) - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - movl 12(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - addl 4(%esp),%edx - andl %eax,%ebx - addl 88(%esp),%edx - xorl %edi,%ebx - addl %edx,%ecx - addl 20(%esp),%edx - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,20(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 28(%esp),%edx,%esi - xorl %edi,%ecx - andl 24(%esp),%edx - movl %ebx,4(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - movl 8(%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - addl (%esp),%edx - andl %ebx,%eax - addl 92(%esp),%edx - xorl %edi,%eax - addl %edx,%ecx - addl 16(%esp),%edx - leal (%eax,%ecx,1),%eax - movl 96(%esp),%esi - xorl %edi,%ebx - movl 12(%esp),%ecx - addl (%esi),%eax - addl 4(%esi),%ebx - addl 8(%esi),%edi - addl 12(%esi),%ecx - movl %eax,(%esi) - movl %ebx,4(%esi) - movl %edi,8(%esi) - movl %ecx,12(%esi) - movl %ebx,4(%esp) - xorl %edi,%ebx - movl %edi,8(%esp) - movl %ecx,12(%esp) - movl 20(%esp),%edi - movl 24(%esp),%ecx - addl 16(%esi),%edx - addl 20(%esi),%edi - addl 24(%esi),%ecx - movl %edx,16(%esi) - movl %edi,20(%esi) - movl %edi,20(%esp) - movl 28(%esp),%edi - movl %ecx,24(%esi) - addl 28(%esi),%edi - movl %ecx,24(%esp) - movl %edi,28(%esi) - movl %edi,28(%esp) - movl 100(%esp),%edi - vmovdqa 64(%ebp),%xmm7 - subl $192,%ebp - cmpl 104(%esp),%edi - jb .L017grand_avx_bmi - movl 108(%esp),%esp - vzeroall - popl %edi - popl %esi - popl %ebx - popl %ebp - ret .size sha256_block_data_order,.-.L_sha256_block_data_order_begin .comm OPENSSL_ia32cap_P,16,4 diff --git a/deps/openssl/asm/x86-macosx-gas/sha/sha1-586.s b/deps/openssl/asm/x86-macosx-gas/sha/sha1-586.s index d75e61693d5de1..a0fe22eb2eca7b 100644 --- a/deps/openssl/asm/x86-macosx-gas/sha/sha1-586.s +++ b/deps/openssl/asm/x86-macosx-gas/sha/sha1-586.s @@ -22,11 +22,6 @@ L000pic_point: jz L001x86 testl $536870912,%ecx jnz Lshaext_shortcut - andl $268435456,%edx - andl $1073741824,%eax - orl %edx,%eax - cmpl $1342177280,%eax - je Lavx_shortcut jmp Lssse3_shortcut .align 4,0x90 L001x86: @@ -2779,1174 +2774,6 @@ L007done: popl %ebx popl %ebp ret -.align 4 -__sha1_block_data_order_avx: - pushl %ebp - pushl %ebx - pushl %esi - pushl %edi - call L008pic_point -L008pic_point: - popl %ebp - leal LK_XX_XX-L008pic_point(%ebp),%ebp -Lavx_shortcut: - vzeroall - vmovdqa (%ebp),%xmm7 - vmovdqa 16(%ebp),%xmm0 - vmovdqa 32(%ebp),%xmm1 - vmovdqa 48(%ebp),%xmm2 - vmovdqa 64(%ebp),%xmm6 - movl 20(%esp),%edi - movl 24(%esp),%ebp - movl 28(%esp),%edx - movl %esp,%esi - subl $208,%esp - andl $-64,%esp - vmovdqa %xmm0,112(%esp) - vmovdqa %xmm1,128(%esp) - vmovdqa %xmm2,144(%esp) - shll $6,%edx - vmovdqa %xmm7,160(%esp) - addl %ebp,%edx - vmovdqa %xmm6,176(%esp) - addl $64,%ebp - movl %edi,192(%esp) - movl %ebp,196(%esp) - movl %edx,200(%esp) - movl %esi,204(%esp) - movl (%edi),%eax - movl 4(%edi),%ebx - movl 8(%edi),%ecx - movl 12(%edi),%edx - movl 16(%edi),%edi - movl %ebx,%esi - vmovdqu -64(%ebp),%xmm0 - vmovdqu -48(%ebp),%xmm1 - vmovdqu -32(%ebp),%xmm2 - vmovdqu -16(%ebp),%xmm3 - vpshufb %xmm6,%xmm0,%xmm0 - vpshufb %xmm6,%xmm1,%xmm1 - vpshufb %xmm6,%xmm2,%xmm2 - vmovdqa %xmm7,96(%esp) - vpshufb %xmm6,%xmm3,%xmm3 - vpaddd %xmm7,%xmm0,%xmm4 - vpaddd %xmm7,%xmm1,%xmm5 - vpaddd %xmm7,%xmm2,%xmm6 - vmovdqa %xmm4,(%esp) - movl %ecx,%ebp - vmovdqa %xmm5,16(%esp) - xorl %edx,%ebp - vmovdqa %xmm6,32(%esp) - andl %ebp,%esi - jmp L009loop -.align 4,0x90 -L009loop: - shrdl $2,%ebx,%ebx - xorl %edx,%esi - vpalignr $8,%xmm0,%xmm1,%xmm4 - movl %eax,%ebp - addl (%esp),%edi - vpaddd %xmm3,%xmm7,%xmm7 - vmovdqa %xmm0,64(%esp) - xorl %ecx,%ebx - shldl $5,%eax,%eax - vpsrldq $4,%xmm3,%xmm6 - addl %esi,%edi - andl %ebx,%ebp - vpxor %xmm0,%xmm4,%xmm4 - xorl %ecx,%ebx - addl %eax,%edi - vpxor %xmm2,%xmm6,%xmm6 - shrdl $7,%eax,%eax - xorl %ecx,%ebp - vmovdqa %xmm7,48(%esp) - movl %edi,%esi - addl 4(%esp),%edx - vpxor %xmm6,%xmm4,%xmm4 - xorl %ebx,%eax - shldl $5,%edi,%edi - addl %ebp,%edx - andl %eax,%esi - vpsrld $31,%xmm4,%xmm6 - xorl %ebx,%eax - addl %edi,%edx - shrdl $7,%edi,%edi - xorl %ebx,%esi - vpslldq $12,%xmm4,%xmm0 - vpaddd %xmm4,%xmm4,%xmm4 - movl %edx,%ebp - addl 8(%esp),%ecx - xorl %eax,%edi - shldl $5,%edx,%edx - vpsrld $30,%xmm0,%xmm7 - vpor %xmm6,%xmm4,%xmm4 - addl %esi,%ecx - andl %edi,%ebp - xorl %eax,%edi - addl %edx,%ecx - vpslld $2,%xmm0,%xmm0 - shrdl $7,%edx,%edx - xorl %eax,%ebp - vpxor %xmm7,%xmm4,%xmm4 - movl %ecx,%esi - addl 12(%esp),%ebx - xorl %edi,%edx - shldl $5,%ecx,%ecx - vpxor %xmm0,%xmm4,%xmm4 - addl %ebp,%ebx - andl %edx,%esi - vmovdqa 96(%esp),%xmm0 - xorl %edi,%edx - addl %ecx,%ebx - shrdl $7,%ecx,%ecx - xorl %edi,%esi - vpalignr $8,%xmm1,%xmm2,%xmm5 - movl %ebx,%ebp - addl 16(%esp),%eax - vpaddd %xmm4,%xmm0,%xmm0 - vmovdqa %xmm1,80(%esp) - xorl %edx,%ecx - shldl $5,%ebx,%ebx - vpsrldq $4,%xmm4,%xmm7 - addl %esi,%eax - andl %ecx,%ebp - vpxor %xmm1,%xmm5,%xmm5 - xorl %edx,%ecx - addl %ebx,%eax - vpxor %xmm3,%xmm7,%xmm7 - shrdl $7,%ebx,%ebx - xorl %edx,%ebp - vmovdqa %xmm0,(%esp) - movl %eax,%esi - addl 20(%esp),%edi - vpxor %xmm7,%xmm5,%xmm5 - xorl %ecx,%ebx - shldl $5,%eax,%eax - addl %ebp,%edi - andl %ebx,%esi - vpsrld $31,%xmm5,%xmm7 - xorl %ecx,%ebx - addl %eax,%edi - shrdl $7,%eax,%eax - xorl %ecx,%esi - vpslldq $12,%xmm5,%xmm1 - vpaddd %xmm5,%xmm5,%xmm5 - movl %edi,%ebp - addl 24(%esp),%edx - xorl %ebx,%eax - shldl $5,%edi,%edi - vpsrld $30,%xmm1,%xmm0 - vpor %xmm7,%xmm5,%xmm5 - addl %esi,%edx - andl %eax,%ebp - xorl %ebx,%eax - addl %edi,%edx - vpslld $2,%xmm1,%xmm1 - shrdl $7,%edi,%edi - xorl %ebx,%ebp - vpxor %xmm0,%xmm5,%xmm5 - movl %edx,%esi - addl 28(%esp),%ecx - xorl %eax,%edi - shldl $5,%edx,%edx - vpxor %xmm1,%xmm5,%xmm5 - addl %ebp,%ecx - andl %edi,%esi - vmovdqa 112(%esp),%xmm1 - xorl %eax,%edi - addl %edx,%ecx - shrdl $7,%edx,%edx - xorl %eax,%esi - vpalignr $8,%xmm2,%xmm3,%xmm6 - movl %ecx,%ebp - addl 32(%esp),%ebx - vpaddd %xmm5,%xmm1,%xmm1 - vmovdqa %xmm2,96(%esp) - xorl %edi,%edx - shldl $5,%ecx,%ecx - vpsrldq $4,%xmm5,%xmm0 - addl %esi,%ebx - andl %edx,%ebp - vpxor %xmm2,%xmm6,%xmm6 - xorl %edi,%edx - addl %ecx,%ebx - vpxor %xmm4,%xmm0,%xmm0 - shrdl $7,%ecx,%ecx - xorl %edi,%ebp - vmovdqa %xmm1,16(%esp) - movl %ebx,%esi - addl 36(%esp),%eax - vpxor %xmm0,%xmm6,%xmm6 - xorl %edx,%ecx - shldl $5,%ebx,%ebx - addl %ebp,%eax - andl %ecx,%esi - vpsrld $31,%xmm6,%xmm0 - xorl %edx,%ecx - addl %ebx,%eax - shrdl $7,%ebx,%ebx - xorl %edx,%esi - vpslldq $12,%xmm6,%xmm2 - vpaddd %xmm6,%xmm6,%xmm6 - movl %eax,%ebp - addl 40(%esp),%edi - xorl %ecx,%ebx - shldl $5,%eax,%eax - vpsrld $30,%xmm2,%xmm1 - vpor %xmm0,%xmm6,%xmm6 - addl %esi,%edi - andl %ebx,%ebp - xorl %ecx,%ebx - addl %eax,%edi - vpslld $2,%xmm2,%xmm2 - vmovdqa 64(%esp),%xmm0 - shrdl $7,%eax,%eax - xorl %ecx,%ebp - vpxor %xmm1,%xmm6,%xmm6 - movl %edi,%esi - addl 44(%esp),%edx - xorl %ebx,%eax - shldl $5,%edi,%edi - vpxor %xmm2,%xmm6,%xmm6 - addl %ebp,%edx - andl %eax,%esi - vmovdqa 112(%esp),%xmm2 - xorl %ebx,%eax - addl %edi,%edx - shrdl $7,%edi,%edi - xorl %ebx,%esi - vpalignr $8,%xmm3,%xmm4,%xmm7 - movl %edx,%ebp - addl 48(%esp),%ecx - vpaddd %xmm6,%xmm2,%xmm2 - vmovdqa %xmm3,64(%esp) - xorl %eax,%edi - shldl $5,%edx,%edx - vpsrldq $4,%xmm6,%xmm1 - addl %esi,%ecx - andl %edi,%ebp - vpxor %xmm3,%xmm7,%xmm7 - xorl %eax,%edi - addl %edx,%ecx - vpxor %xmm5,%xmm1,%xmm1 - shrdl $7,%edx,%edx - xorl %eax,%ebp - vmovdqa %xmm2,32(%esp) - movl %ecx,%esi - addl 52(%esp),%ebx - vpxor %xmm1,%xmm7,%xmm7 - xorl %edi,%edx - shldl $5,%ecx,%ecx - addl %ebp,%ebx - andl %edx,%esi - vpsrld $31,%xmm7,%xmm1 - xorl %edi,%edx - addl %ecx,%ebx - shrdl $7,%ecx,%ecx - xorl %edi,%esi - vpslldq $12,%xmm7,%xmm3 - vpaddd %xmm7,%xmm7,%xmm7 - movl %ebx,%ebp - addl 56(%esp),%eax - xorl %edx,%ecx - shldl $5,%ebx,%ebx - vpsrld $30,%xmm3,%xmm2 - vpor %xmm1,%xmm7,%xmm7 - addl %esi,%eax - andl %ecx,%ebp - xorl %edx,%ecx - addl %ebx,%eax - vpslld $2,%xmm3,%xmm3 - vmovdqa 80(%esp),%xmm1 - shrdl $7,%ebx,%ebx - xorl %edx,%ebp - vpxor %xmm2,%xmm7,%xmm7 - movl %eax,%esi - addl 60(%esp),%edi - xorl %ecx,%ebx - shldl $5,%eax,%eax - vpxor %xmm3,%xmm7,%xmm7 - addl %ebp,%edi - andl %ebx,%esi - vmovdqa 112(%esp),%xmm3 - xorl %ecx,%ebx - addl %eax,%edi - vpalignr $8,%xmm6,%xmm7,%xmm2 - vpxor %xmm4,%xmm0,%xmm0 - shrdl $7,%eax,%eax - xorl %ecx,%esi - movl %edi,%ebp - addl (%esp),%edx - vpxor %xmm1,%xmm0,%xmm0 - vmovdqa %xmm4,80(%esp) - xorl %ebx,%eax - shldl $5,%edi,%edi - vmovdqa %xmm3,%xmm4 - vpaddd %xmm7,%xmm3,%xmm3 - addl %esi,%edx - andl %eax,%ebp - vpxor %xmm2,%xmm0,%xmm0 - xorl %ebx,%eax - addl %edi,%edx - shrdl $7,%edi,%edi - xorl %ebx,%ebp - vpsrld $30,%xmm0,%xmm2 - vmovdqa %xmm3,48(%esp) - movl %edx,%esi - addl 4(%esp),%ecx - xorl %eax,%edi - shldl $5,%edx,%edx - vpslld $2,%xmm0,%xmm0 - addl %ebp,%ecx - andl %edi,%esi - xorl %eax,%edi - addl %edx,%ecx - shrdl $7,%edx,%edx - xorl %eax,%esi - movl %ecx,%ebp - addl 8(%esp),%ebx - vpor %xmm2,%xmm0,%xmm0 - xorl %edi,%edx - shldl $5,%ecx,%ecx - vmovdqa 96(%esp),%xmm2 - addl %esi,%ebx - andl %edx,%ebp - xorl %edi,%edx - addl %ecx,%ebx - addl 12(%esp),%eax - xorl %edi,%ebp - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %ebp,%eax - xorl %edx,%esi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vpalignr $8,%xmm7,%xmm0,%xmm3 - vpxor %xmm5,%xmm1,%xmm1 - addl 16(%esp),%edi - xorl %ecx,%esi - movl %eax,%ebp - shldl $5,%eax,%eax - vpxor %xmm2,%xmm1,%xmm1 - vmovdqa %xmm5,96(%esp) - addl %esi,%edi - xorl %ecx,%ebp - vmovdqa %xmm4,%xmm5 - vpaddd %xmm0,%xmm4,%xmm4 - shrdl $7,%ebx,%ebx - addl %eax,%edi - vpxor %xmm3,%xmm1,%xmm1 - addl 20(%esp),%edx - xorl %ebx,%ebp - movl %edi,%esi - shldl $5,%edi,%edi - vpsrld $30,%xmm1,%xmm3 - vmovdqa %xmm4,(%esp) - addl %ebp,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %edi,%edx - vpslld $2,%xmm1,%xmm1 - addl 24(%esp),%ecx - xorl %eax,%esi - movl %edx,%ebp - shldl $5,%edx,%edx - addl %esi,%ecx - xorl %eax,%ebp - shrdl $7,%edi,%edi - addl %edx,%ecx - vpor %xmm3,%xmm1,%xmm1 - addl 28(%esp),%ebx - xorl %edi,%ebp - vmovdqa 64(%esp),%xmm3 - movl %ecx,%esi - shldl $5,%ecx,%ecx - addl %ebp,%ebx - xorl %edi,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - vpalignr $8,%xmm0,%xmm1,%xmm4 - vpxor %xmm6,%xmm2,%xmm2 - addl 32(%esp),%eax - xorl %edx,%esi - movl %ebx,%ebp - shldl $5,%ebx,%ebx - vpxor %xmm3,%xmm2,%xmm2 - vmovdqa %xmm6,64(%esp) - addl %esi,%eax - xorl %edx,%ebp - vmovdqa 128(%esp),%xmm6 - vpaddd %xmm1,%xmm5,%xmm5 - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vpxor %xmm4,%xmm2,%xmm2 - addl 36(%esp),%edi - xorl %ecx,%ebp - movl %eax,%esi - shldl $5,%eax,%eax - vpsrld $30,%xmm2,%xmm4 - vmovdqa %xmm5,16(%esp) - addl %ebp,%edi - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%edi - vpslld $2,%xmm2,%xmm2 - addl 40(%esp),%edx - xorl %ebx,%esi - movl %edi,%ebp - shldl $5,%edi,%edi - addl %esi,%edx - xorl %ebx,%ebp - shrdl $7,%eax,%eax - addl %edi,%edx - vpor %xmm4,%xmm2,%xmm2 - addl 44(%esp),%ecx - xorl %eax,%ebp - vmovdqa 80(%esp),%xmm4 - movl %edx,%esi - shldl $5,%edx,%edx - addl %ebp,%ecx - xorl %eax,%esi - shrdl $7,%edi,%edi - addl %edx,%ecx - vpalignr $8,%xmm1,%xmm2,%xmm5 - vpxor %xmm7,%xmm3,%xmm3 - addl 48(%esp),%ebx - xorl %edi,%esi - movl %ecx,%ebp - shldl $5,%ecx,%ecx - vpxor %xmm4,%xmm3,%xmm3 - vmovdqa %xmm7,80(%esp) - addl %esi,%ebx - xorl %edi,%ebp - vmovdqa %xmm6,%xmm7 - vpaddd %xmm2,%xmm6,%xmm6 - shrdl $7,%edx,%edx - addl %ecx,%ebx - vpxor %xmm5,%xmm3,%xmm3 - addl 52(%esp),%eax - xorl %edx,%ebp - movl %ebx,%esi - shldl $5,%ebx,%ebx - vpsrld $30,%xmm3,%xmm5 - vmovdqa %xmm6,32(%esp) - addl %ebp,%eax - xorl %edx,%esi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vpslld $2,%xmm3,%xmm3 - addl 56(%esp),%edi - xorl %ecx,%esi - movl %eax,%ebp - shldl $5,%eax,%eax - addl %esi,%edi - xorl %ecx,%ebp - shrdl $7,%ebx,%ebx - addl %eax,%edi - vpor %xmm5,%xmm3,%xmm3 - addl 60(%esp),%edx - xorl %ebx,%ebp - vmovdqa 96(%esp),%xmm5 - movl %edi,%esi - shldl $5,%edi,%edi - addl %ebp,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %edi,%edx - vpalignr $8,%xmm2,%xmm3,%xmm6 - vpxor %xmm0,%xmm4,%xmm4 - addl (%esp),%ecx - xorl %eax,%esi - movl %edx,%ebp - shldl $5,%edx,%edx - vpxor %xmm5,%xmm4,%xmm4 - vmovdqa %xmm0,96(%esp) - addl %esi,%ecx - xorl %eax,%ebp - vmovdqa %xmm7,%xmm0 - vpaddd %xmm3,%xmm7,%xmm7 - shrdl $7,%edi,%edi - addl %edx,%ecx - vpxor %xmm6,%xmm4,%xmm4 - addl 4(%esp),%ebx - xorl %edi,%ebp - movl %ecx,%esi - shldl $5,%ecx,%ecx - vpsrld $30,%xmm4,%xmm6 - vmovdqa %xmm7,48(%esp) - addl %ebp,%ebx - xorl %edi,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - vpslld $2,%xmm4,%xmm4 - addl 8(%esp),%eax - xorl %edx,%esi - movl %ebx,%ebp - shldl $5,%ebx,%ebx - addl %esi,%eax - xorl %edx,%ebp - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vpor %xmm6,%xmm4,%xmm4 - addl 12(%esp),%edi - xorl %ecx,%ebp - vmovdqa 64(%esp),%xmm6 - movl %eax,%esi - shldl $5,%eax,%eax - addl %ebp,%edi - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%edi - vpalignr $8,%xmm3,%xmm4,%xmm7 - vpxor %xmm1,%xmm5,%xmm5 - addl 16(%esp),%edx - xorl %ebx,%esi - movl %edi,%ebp - shldl $5,%edi,%edi - vpxor %xmm6,%xmm5,%xmm5 - vmovdqa %xmm1,64(%esp) - addl %esi,%edx - xorl %ebx,%ebp - vmovdqa %xmm0,%xmm1 - vpaddd %xmm4,%xmm0,%xmm0 - shrdl $7,%eax,%eax - addl %edi,%edx - vpxor %xmm7,%xmm5,%xmm5 - addl 20(%esp),%ecx - xorl %eax,%ebp - movl %edx,%esi - shldl $5,%edx,%edx - vpsrld $30,%xmm5,%xmm7 - vmovdqa %xmm0,(%esp) - addl %ebp,%ecx - xorl %eax,%esi - shrdl $7,%edi,%edi - addl %edx,%ecx - vpslld $2,%xmm5,%xmm5 - addl 24(%esp),%ebx - xorl %edi,%esi - movl %ecx,%ebp - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %edi,%ebp - shrdl $7,%edx,%edx - addl %ecx,%ebx - vpor %xmm7,%xmm5,%xmm5 - addl 28(%esp),%eax - vmovdqa 80(%esp),%xmm7 - shrdl $7,%ecx,%ecx - movl %ebx,%esi - xorl %edx,%ebp - shldl $5,%ebx,%ebx - addl %ebp,%eax - xorl %ecx,%esi - xorl %edx,%ecx - addl %ebx,%eax - vpalignr $8,%xmm4,%xmm5,%xmm0 - vpxor %xmm2,%xmm6,%xmm6 - addl 32(%esp),%edi - andl %ecx,%esi - xorl %edx,%ecx - shrdl $7,%ebx,%ebx - vpxor %xmm7,%xmm6,%xmm6 - vmovdqa %xmm2,80(%esp) - movl %eax,%ebp - xorl %ecx,%esi - vmovdqa %xmm1,%xmm2 - vpaddd %xmm5,%xmm1,%xmm1 - shldl $5,%eax,%eax - addl %esi,%edi - vpxor %xmm0,%xmm6,%xmm6 - xorl %ebx,%ebp - xorl %ecx,%ebx - addl %eax,%edi - addl 36(%esp),%edx - vpsrld $30,%xmm6,%xmm0 - vmovdqa %xmm1,16(%esp) - andl %ebx,%ebp - xorl %ecx,%ebx - shrdl $7,%eax,%eax - movl %edi,%esi - vpslld $2,%xmm6,%xmm6 - xorl %ebx,%ebp - shldl $5,%edi,%edi - addl %ebp,%edx - xorl %eax,%esi - xorl %ebx,%eax - addl %edi,%edx - addl 40(%esp),%ecx - andl %eax,%esi - vpor %xmm0,%xmm6,%xmm6 - xorl %ebx,%eax - shrdl $7,%edi,%edi - vmovdqa 96(%esp),%xmm0 - movl %edx,%ebp - xorl %eax,%esi - shldl $5,%edx,%edx - addl %esi,%ecx - xorl %edi,%ebp - xorl %eax,%edi - addl %edx,%ecx - addl 44(%esp),%ebx - andl %edi,%ebp - xorl %eax,%edi - shrdl $7,%edx,%edx - movl %ecx,%esi - xorl %edi,%ebp - shldl $5,%ecx,%ecx - addl %ebp,%ebx - xorl %edx,%esi - xorl %edi,%edx - addl %ecx,%ebx - vpalignr $8,%xmm5,%xmm6,%xmm1 - vpxor %xmm3,%xmm7,%xmm7 - addl 48(%esp),%eax - andl %edx,%esi - xorl %edi,%edx - shrdl $7,%ecx,%ecx - vpxor %xmm0,%xmm7,%xmm7 - vmovdqa %xmm3,96(%esp) - movl %ebx,%ebp - xorl %edx,%esi - vmovdqa 144(%esp),%xmm3 - vpaddd %xmm6,%xmm2,%xmm2 - shldl $5,%ebx,%ebx - addl %esi,%eax - vpxor %xmm1,%xmm7,%xmm7 - xorl %ecx,%ebp - xorl %edx,%ecx - addl %ebx,%eax - addl 52(%esp),%edi - vpsrld $30,%xmm7,%xmm1 - vmovdqa %xmm2,32(%esp) - andl %ecx,%ebp - xorl %edx,%ecx - shrdl $7,%ebx,%ebx - movl %eax,%esi - vpslld $2,%xmm7,%xmm7 - xorl %ecx,%ebp - shldl $5,%eax,%eax - addl %ebp,%edi - xorl %ebx,%esi - xorl %ecx,%ebx - addl %eax,%edi - addl 56(%esp),%edx - andl %ebx,%esi - vpor %xmm1,%xmm7,%xmm7 - xorl %ecx,%ebx - shrdl $7,%eax,%eax - vmovdqa 64(%esp),%xmm1 - movl %edi,%ebp - xorl %ebx,%esi - shldl $5,%edi,%edi - addl %esi,%edx - xorl %eax,%ebp - xorl %ebx,%eax - addl %edi,%edx - addl 60(%esp),%ecx - andl %eax,%ebp - xorl %ebx,%eax - shrdl $7,%edi,%edi - movl %edx,%esi - xorl %eax,%ebp - shldl $5,%edx,%edx - addl %ebp,%ecx - xorl %edi,%esi - xorl %eax,%edi - addl %edx,%ecx - vpalignr $8,%xmm6,%xmm7,%xmm2 - vpxor %xmm4,%xmm0,%xmm0 - addl (%esp),%ebx - andl %edi,%esi - xorl %eax,%edi - shrdl $7,%edx,%edx - vpxor %xmm1,%xmm0,%xmm0 - vmovdqa %xmm4,64(%esp) - movl %ecx,%ebp - xorl %edi,%esi - vmovdqa %xmm3,%xmm4 - vpaddd %xmm7,%xmm3,%xmm3 - shldl $5,%ecx,%ecx - addl %esi,%ebx - vpxor %xmm2,%xmm0,%xmm0 - xorl %edx,%ebp - xorl %edi,%edx - addl %ecx,%ebx - addl 4(%esp),%eax - vpsrld $30,%xmm0,%xmm2 - vmovdqa %xmm3,48(%esp) - andl %edx,%ebp - xorl %edi,%edx - shrdl $7,%ecx,%ecx - movl %ebx,%esi - vpslld $2,%xmm0,%xmm0 - xorl %edx,%ebp - shldl $5,%ebx,%ebx - addl %ebp,%eax - xorl %ecx,%esi - xorl %edx,%ecx - addl %ebx,%eax - addl 8(%esp),%edi - andl %ecx,%esi - vpor %xmm2,%xmm0,%xmm0 - xorl %edx,%ecx - shrdl $7,%ebx,%ebx - vmovdqa 80(%esp),%xmm2 - movl %eax,%ebp - xorl %ecx,%esi - shldl $5,%eax,%eax - addl %esi,%edi - xorl %ebx,%ebp - xorl %ecx,%ebx - addl %eax,%edi - addl 12(%esp),%edx - andl %ebx,%ebp - xorl %ecx,%ebx - shrdl $7,%eax,%eax - movl %edi,%esi - xorl %ebx,%ebp - shldl $5,%edi,%edi - addl %ebp,%edx - xorl %eax,%esi - xorl %ebx,%eax - addl %edi,%edx - vpalignr $8,%xmm7,%xmm0,%xmm3 - vpxor %xmm5,%xmm1,%xmm1 - addl 16(%esp),%ecx - andl %eax,%esi - xorl %ebx,%eax - shrdl $7,%edi,%edi - vpxor %xmm2,%xmm1,%xmm1 - vmovdqa %xmm5,80(%esp) - movl %edx,%ebp - xorl %eax,%esi - vmovdqa %xmm4,%xmm5 - vpaddd %xmm0,%xmm4,%xmm4 - shldl $5,%edx,%edx - addl %esi,%ecx - vpxor %xmm3,%xmm1,%xmm1 - xorl %edi,%ebp - xorl %eax,%edi - addl %edx,%ecx - addl 20(%esp),%ebx - vpsrld $30,%xmm1,%xmm3 - vmovdqa %xmm4,(%esp) - andl %edi,%ebp - xorl %eax,%edi - shrdl $7,%edx,%edx - movl %ecx,%esi - vpslld $2,%xmm1,%xmm1 - xorl %edi,%ebp - shldl $5,%ecx,%ecx - addl %ebp,%ebx - xorl %edx,%esi - xorl %edi,%edx - addl %ecx,%ebx - addl 24(%esp),%eax - andl %edx,%esi - vpor %xmm3,%xmm1,%xmm1 - xorl %edi,%edx - shrdl $7,%ecx,%ecx - vmovdqa 96(%esp),%xmm3 - movl %ebx,%ebp - xorl %edx,%esi - shldl $5,%ebx,%ebx - addl %esi,%eax - xorl %ecx,%ebp - xorl %edx,%ecx - addl %ebx,%eax - addl 28(%esp),%edi - andl %ecx,%ebp - xorl %edx,%ecx - shrdl $7,%ebx,%ebx - movl %eax,%esi - xorl %ecx,%ebp - shldl $5,%eax,%eax - addl %ebp,%edi - xorl %ebx,%esi - xorl %ecx,%ebx - addl %eax,%edi - vpalignr $8,%xmm0,%xmm1,%xmm4 - vpxor %xmm6,%xmm2,%xmm2 - addl 32(%esp),%edx - andl %ebx,%esi - xorl %ecx,%ebx - shrdl $7,%eax,%eax - vpxor %xmm3,%xmm2,%xmm2 - vmovdqa %xmm6,96(%esp) - movl %edi,%ebp - xorl %ebx,%esi - vmovdqa %xmm5,%xmm6 - vpaddd %xmm1,%xmm5,%xmm5 - shldl $5,%edi,%edi - addl %esi,%edx - vpxor %xmm4,%xmm2,%xmm2 - xorl %eax,%ebp - xorl %ebx,%eax - addl %edi,%edx - addl 36(%esp),%ecx - vpsrld $30,%xmm2,%xmm4 - vmovdqa %xmm5,16(%esp) - andl %eax,%ebp - xorl %ebx,%eax - shrdl $7,%edi,%edi - movl %edx,%esi - vpslld $2,%xmm2,%xmm2 - xorl %eax,%ebp - shldl $5,%edx,%edx - addl %ebp,%ecx - xorl %edi,%esi - xorl %eax,%edi - addl %edx,%ecx - addl 40(%esp),%ebx - andl %edi,%esi - vpor %xmm4,%xmm2,%xmm2 - xorl %eax,%edi - shrdl $7,%edx,%edx - vmovdqa 64(%esp),%xmm4 - movl %ecx,%ebp - xorl %edi,%esi - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %edx,%ebp - xorl %edi,%edx - addl %ecx,%ebx - addl 44(%esp),%eax - andl %edx,%ebp - xorl %edi,%edx - shrdl $7,%ecx,%ecx - movl %ebx,%esi - xorl %edx,%ebp - shldl $5,%ebx,%ebx - addl %ebp,%eax - xorl %edx,%esi - addl %ebx,%eax - vpalignr $8,%xmm1,%xmm2,%xmm5 - vpxor %xmm7,%xmm3,%xmm3 - addl 48(%esp),%edi - xorl %ecx,%esi - movl %eax,%ebp - shldl $5,%eax,%eax - vpxor %xmm4,%xmm3,%xmm3 - vmovdqa %xmm7,64(%esp) - addl %esi,%edi - xorl %ecx,%ebp - vmovdqa %xmm6,%xmm7 - vpaddd %xmm2,%xmm6,%xmm6 - shrdl $7,%ebx,%ebx - addl %eax,%edi - vpxor %xmm5,%xmm3,%xmm3 - addl 52(%esp),%edx - xorl %ebx,%ebp - movl %edi,%esi - shldl $5,%edi,%edi - vpsrld $30,%xmm3,%xmm5 - vmovdqa %xmm6,32(%esp) - addl %ebp,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %edi,%edx - vpslld $2,%xmm3,%xmm3 - addl 56(%esp),%ecx - xorl %eax,%esi - movl %edx,%ebp - shldl $5,%edx,%edx - addl %esi,%ecx - xorl %eax,%ebp - shrdl $7,%edi,%edi - addl %edx,%ecx - vpor %xmm5,%xmm3,%xmm3 - addl 60(%esp),%ebx - xorl %edi,%ebp - movl %ecx,%esi - shldl $5,%ecx,%ecx - addl %ebp,%ebx - xorl %edi,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl (%esp),%eax - vpaddd %xmm3,%xmm7,%xmm7 - xorl %edx,%esi - movl %ebx,%ebp - shldl $5,%ebx,%ebx - addl %esi,%eax - vmovdqa %xmm7,48(%esp) - xorl %edx,%ebp - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 4(%esp),%edi - xorl %ecx,%ebp - movl %eax,%esi - shldl $5,%eax,%eax - addl %ebp,%edi - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%edi - addl 8(%esp),%edx - xorl %ebx,%esi - movl %edi,%ebp - shldl $5,%edi,%edi - addl %esi,%edx - xorl %ebx,%ebp - shrdl $7,%eax,%eax - addl %edi,%edx - addl 12(%esp),%ecx - xorl %eax,%ebp - movl %edx,%esi - shldl $5,%edx,%edx - addl %ebp,%ecx - xorl %eax,%esi - shrdl $7,%edi,%edi - addl %edx,%ecx - movl 196(%esp),%ebp - cmpl 200(%esp),%ebp - je L010done - vmovdqa 160(%esp),%xmm7 - vmovdqa 176(%esp),%xmm6 - vmovdqu (%ebp),%xmm0 - vmovdqu 16(%ebp),%xmm1 - vmovdqu 32(%ebp),%xmm2 - vmovdqu 48(%ebp),%xmm3 - addl $64,%ebp - vpshufb %xmm6,%xmm0,%xmm0 - movl %ebp,196(%esp) - vmovdqa %xmm7,96(%esp) - addl 16(%esp),%ebx - xorl %edi,%esi - vpshufb %xmm6,%xmm1,%xmm1 - movl %ecx,%ebp - shldl $5,%ecx,%ecx - vpaddd %xmm7,%xmm0,%xmm4 - addl %esi,%ebx - xorl %edi,%ebp - shrdl $7,%edx,%edx - addl %ecx,%ebx - vmovdqa %xmm4,(%esp) - addl 20(%esp),%eax - xorl %edx,%ebp - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %ebp,%eax - xorl %edx,%esi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 24(%esp),%edi - xorl %ecx,%esi - movl %eax,%ebp - shldl $5,%eax,%eax - addl %esi,%edi - xorl %ecx,%ebp - shrdl $7,%ebx,%ebx - addl %eax,%edi - addl 28(%esp),%edx - xorl %ebx,%ebp - movl %edi,%esi - shldl $5,%edi,%edi - addl %ebp,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %edi,%edx - addl 32(%esp),%ecx - xorl %eax,%esi - vpshufb %xmm6,%xmm2,%xmm2 - movl %edx,%ebp - shldl $5,%edx,%edx - vpaddd %xmm7,%xmm1,%xmm5 - addl %esi,%ecx - xorl %eax,%ebp - shrdl $7,%edi,%edi - addl %edx,%ecx - vmovdqa %xmm5,16(%esp) - addl 36(%esp),%ebx - xorl %edi,%ebp - movl %ecx,%esi - shldl $5,%ecx,%ecx - addl %ebp,%ebx - xorl %edi,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 40(%esp),%eax - xorl %edx,%esi - movl %ebx,%ebp - shldl $5,%ebx,%ebx - addl %esi,%eax - xorl %edx,%ebp - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 44(%esp),%edi - xorl %ecx,%ebp - movl %eax,%esi - shldl $5,%eax,%eax - addl %ebp,%edi - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%edi - addl 48(%esp),%edx - xorl %ebx,%esi - vpshufb %xmm6,%xmm3,%xmm3 - movl %edi,%ebp - shldl $5,%edi,%edi - vpaddd %xmm7,%xmm2,%xmm6 - addl %esi,%edx - xorl %ebx,%ebp - shrdl $7,%eax,%eax - addl %edi,%edx - vmovdqa %xmm6,32(%esp) - addl 52(%esp),%ecx - xorl %eax,%ebp - movl %edx,%esi - shldl $5,%edx,%edx - addl %ebp,%ecx - xorl %eax,%esi - shrdl $7,%edi,%edi - addl %edx,%ecx - addl 56(%esp),%ebx - xorl %edi,%esi - movl %ecx,%ebp - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %edi,%ebp - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 60(%esp),%eax - xorl %edx,%ebp - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %ebp,%eax - shrdl $7,%ecx,%ecx - addl %ebx,%eax - movl 192(%esp),%ebp - addl (%ebp),%eax - addl 4(%ebp),%esi - addl 8(%ebp),%ecx - movl %eax,(%ebp) - addl 12(%ebp),%edx - movl %esi,4(%ebp) - addl 16(%ebp),%edi - movl %ecx,%ebx - movl %ecx,8(%ebp) - xorl %edx,%ebx - movl %edx,12(%ebp) - movl %edi,16(%ebp) - movl %esi,%ebp - andl %ebx,%esi - movl %ebp,%ebx - jmp L009loop -.align 4,0x90 -L010done: - addl 16(%esp),%ebx - xorl %edi,%esi - movl %ecx,%ebp - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %edi,%ebp - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 20(%esp),%eax - xorl %edx,%ebp - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %ebp,%eax - xorl %edx,%esi - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 24(%esp),%edi - xorl %ecx,%esi - movl %eax,%ebp - shldl $5,%eax,%eax - addl %esi,%edi - xorl %ecx,%ebp - shrdl $7,%ebx,%ebx - addl %eax,%edi - addl 28(%esp),%edx - xorl %ebx,%ebp - movl %edi,%esi - shldl $5,%edi,%edi - addl %ebp,%edx - xorl %ebx,%esi - shrdl $7,%eax,%eax - addl %edi,%edx - addl 32(%esp),%ecx - xorl %eax,%esi - movl %edx,%ebp - shldl $5,%edx,%edx - addl %esi,%ecx - xorl %eax,%ebp - shrdl $7,%edi,%edi - addl %edx,%ecx - addl 36(%esp),%ebx - xorl %edi,%ebp - movl %ecx,%esi - shldl $5,%ecx,%ecx - addl %ebp,%ebx - xorl %edi,%esi - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 40(%esp),%eax - xorl %edx,%esi - movl %ebx,%ebp - shldl $5,%ebx,%ebx - addl %esi,%eax - xorl %edx,%ebp - shrdl $7,%ecx,%ecx - addl %ebx,%eax - addl 44(%esp),%edi - xorl %ecx,%ebp - movl %eax,%esi - shldl $5,%eax,%eax - addl %ebp,%edi - xorl %ecx,%esi - shrdl $7,%ebx,%ebx - addl %eax,%edi - addl 48(%esp),%edx - xorl %ebx,%esi - movl %edi,%ebp - shldl $5,%edi,%edi - addl %esi,%edx - xorl %ebx,%ebp - shrdl $7,%eax,%eax - addl %edi,%edx - addl 52(%esp),%ecx - xorl %eax,%ebp - movl %edx,%esi - shldl $5,%edx,%edx - addl %ebp,%ecx - xorl %eax,%esi - shrdl $7,%edi,%edi - addl %edx,%ecx - addl 56(%esp),%ebx - xorl %edi,%esi - movl %ecx,%ebp - shldl $5,%ecx,%ecx - addl %esi,%ebx - xorl %edi,%ebp - shrdl $7,%edx,%edx - addl %ecx,%ebx - addl 60(%esp),%eax - xorl %edx,%ebp - movl %ebx,%esi - shldl $5,%ebx,%ebx - addl %ebp,%eax - shrdl $7,%ecx,%ecx - addl %ebx,%eax - vzeroall - movl 192(%esp),%ebp - addl (%ebp),%eax - movl 204(%esp),%esp - addl 4(%ebp),%esi - addl 8(%ebp),%ecx - movl %eax,(%ebp) - addl 12(%ebp),%edx - movl %esi,4(%ebp) - addl 16(%ebp),%edi - movl %ecx,8(%ebp) - movl %edx,12(%ebp) - movl %edi,16(%ebp) - popl %edi - popl %esi - popl %ebx - popl %ebp - ret .align 6,0x90 LK_XX_XX: .long 1518500249,1518500249,1518500249,1518500249 diff --git a/deps/openssl/asm/x86-macosx-gas/sha/sha256-586.s b/deps/openssl/asm/x86-macosx-gas/sha/sha256-586.s index d30c582726c2be..37f532aa5fb686 100644 --- a/deps/openssl/asm/x86-macosx-gas/sha/sha256-586.s +++ b/deps/openssl/asm/x86-macosx-gas/sha/sha256-586.s @@ -39,13 +39,12 @@ L000pic_point: orl %ebx,%ecx andl $1342177280,%ecx cmpl $1342177280,%ecx - je L005AVX testl $512,%ebx - jnz L006SSSE3 + jnz L005SSSE3 L003no_xmm: subl %edi,%eax cmpl $256,%eax - jae L007unrolled + jae L006unrolled jmp L002loop .align 4,0x90 L002loop: @@ -117,7 +116,7 @@ L002loop: movl %ecx,28(%esp) movl %edi,32(%esp) .align 4,0x90 -L00800_15: +L00700_15: movl %edx,%ecx movl 24(%esp),%esi rorl $14,%ecx @@ -155,11 +154,11 @@ L00800_15: addl $4,%ebp addl %ebx,%eax cmpl $3248222580,%esi - jne L00800_15 + jne L00700_15 movl 156(%esp),%ecx - jmp L00916_63 + jmp L00816_63 .align 4,0x90 -L00916_63: +L00816_63: movl %ecx,%ebx movl 104(%esp),%esi rorl $11,%ecx @@ -214,7 +213,7 @@ L00916_63: addl $4,%ebp addl %ebx,%eax cmpl $3329325298,%esi - jne L00916_63 + jne L00816_63 movl 356(%esp),%esi movl 8(%esp),%ebx movl 16(%esp),%ecx @@ -258,7 +257,7 @@ L001K256: .byte 112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103 .byte 62,0 .align 4,0x90 -L007unrolled: +L006unrolled: leal -96(%esp),%esp movl (%esi),%eax movl 4(%esi),%ebp @@ -275,9 +274,9 @@ L007unrolled: movl %ebx,20(%esp) movl %ecx,24(%esp) movl %esi,28(%esp) - jmp L010grand_loop + jmp L009grand_loop .align 4,0x90 -L010grand_loop: +L009grand_loop: movl (%edi),%ebx movl 4(%edi),%ecx bswap %ebx @@ -3157,7 +3156,7 @@ L010grand_loop: movl %ebx,24(%esp) movl %ecx,28(%esp) cmpl 104(%esp),%edi - jb L010grand_loop + jb L009grand_loop movl 108(%esp),%esp popl %edi popl %esi @@ -3176,9 +3175,9 @@ L004shaext: pshufd $27,%xmm2,%xmm2 .byte 102,15,58,15,202,8 punpcklqdq %xmm0,%xmm2 - jmp L011loop_shaext + jmp L010loop_shaext .align 4,0x90 -L011loop_shaext: +L010loop_shaext: movdqu (%edi),%xmm3 movdqu 16(%edi),%xmm4 movdqu 32(%edi),%xmm5 @@ -3348,7 +3347,7 @@ L011loop_shaext: .byte 15,56,203,202 paddd 16(%esp),%xmm2 paddd (%esp),%xmm1 - jnz L011loop_shaext + jnz L010loop_shaext pshufd $177,%xmm2,%xmm2 pshufd $27,%xmm1,%xmm7 pshufd $177,%xmm1,%xmm1 @@ -3363,7 +3362,7 @@ L011loop_shaext: popl %ebp ret .align 5,0x90 -L006SSSE3: +L005SSSE3: leal -96(%esp),%esp movl (%esi),%eax movl 4(%esi),%ebx @@ -3382,9 +3381,9 @@ L006SSSE3: movl %ecx,24(%esp) movl %esi,28(%esp) movdqa 256(%ebp),%xmm7 - jmp L012grand_ssse3 + jmp L011grand_ssse3 .align 4,0x90 -L012grand_ssse3: +L011grand_ssse3: movdqu (%edi),%xmm0 movdqu 16(%edi),%xmm1 movdqu 32(%edi),%xmm2 @@ -3407,9 +3406,9 @@ L012grand_ssse3: paddd %xmm3,%xmm7 movdqa %xmm6,64(%esp) movdqa %xmm7,80(%esp) - jmp L013ssse3_00_47 + jmp L012ssse3_00_47 .align 4,0x90 -L013ssse3_00_47: +L012ssse3_00_47: addl $64,%ebp movl %edx,%ecx movdqa %xmm1,%xmm4 @@ -4052,7 +4051,7 @@ L013ssse3_00_47: addl %ecx,%eax movdqa %xmm6,80(%esp) cmpl $66051,64(%ebp) - jne L013ssse3_00_47 + jne L012ssse3_00_47 movl %edx,%ecx rorl $14,%edx movl 20(%esp),%esi @@ -4566,2218 +4565,13 @@ L013ssse3_00_47: movdqa 64(%ebp),%xmm7 subl $192,%ebp cmpl 104(%esp),%edi - jb L012grand_ssse3 + jb L011grand_ssse3 movl 108(%esp),%esp popl %edi popl %esi popl %ebx popl %ebp ret -.align 5,0x90 -L005AVX: - andl $264,%edx - cmpl $264,%edx - je L014AVX_BMI - leal -96(%esp),%esp - vzeroall - movl (%esi),%eax - movl 4(%esi),%ebx - movl 8(%esi),%ecx - movl 12(%esi),%edi - movl %ebx,4(%esp) - xorl %ecx,%ebx - movl %ecx,8(%esp) - movl %edi,12(%esp) - movl 16(%esi),%edx - movl 20(%esi),%edi - movl 24(%esi),%ecx - movl 28(%esi),%esi - movl %edi,20(%esp) - movl 100(%esp),%edi - movl %ecx,24(%esp) - movl %esi,28(%esp) - vmovdqa 256(%ebp),%xmm7 - jmp L015grand_avx -.align 5,0x90 -L015grand_avx: - vmovdqu (%edi),%xmm0 - vmovdqu 16(%edi),%xmm1 - vmovdqu 32(%edi),%xmm2 - vmovdqu 48(%edi),%xmm3 - addl $64,%edi - vpshufb %xmm7,%xmm0,%xmm0 - movl %edi,100(%esp) - vpshufb %xmm7,%xmm1,%xmm1 - vpshufb %xmm7,%xmm2,%xmm2 - vpaddd (%ebp),%xmm0,%xmm4 - vpshufb %xmm7,%xmm3,%xmm3 - vpaddd 16(%ebp),%xmm1,%xmm5 - vpaddd 32(%ebp),%xmm2,%xmm6 - vpaddd 48(%ebp),%xmm3,%xmm7 - vmovdqa %xmm4,32(%esp) - vmovdqa %xmm5,48(%esp) - vmovdqa %xmm6,64(%esp) - vmovdqa %xmm7,80(%esp) - jmp L016avx_00_47 -.align 4,0x90 -L016avx_00_47: - addl $64,%ebp - vpalignr $4,%xmm0,%xmm1,%xmm4 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 20(%esp),%esi - vpalignr $4,%xmm2,%xmm3,%xmm7 - xorl %ecx,%edx - movl 24(%esp),%edi - xorl %edi,%esi - vpsrld $7,%xmm4,%xmm6 - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,16(%esp) - vpaddd %xmm7,%xmm0,%xmm0 - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - vpsrld $3,%xmm4,%xmm7 - movl %eax,%ecx - addl %edi,%edx - movl 4(%esp),%edi - vpslld $14,%xmm4,%xmm5 - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,(%esp) - vpxor %xmm6,%xmm7,%xmm4 - xorl %eax,%ecx - xorl %edi,%eax - addl 28(%esp),%edx - vpshufd $250,%xmm3,%xmm7 - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - vpsrld $11,%xmm6,%xmm6 - addl 32(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - vpxor %xmm5,%xmm4,%xmm4 - addl %edx,%ebx - addl 12(%esp),%edx - addl %ecx,%ebx - vpslld $11,%xmm5,%xmm5 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 16(%esp),%esi - vpxor %xmm6,%xmm4,%xmm4 - xorl %ecx,%edx - movl 20(%esp),%edi - xorl %edi,%esi - vpsrld $10,%xmm7,%xmm6 - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,12(%esp) - vpxor %xmm5,%xmm4,%xmm4 - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - vpsrlq $17,%xmm7,%xmm5 - movl %ebx,%ecx - addl %edi,%edx - movl (%esp),%edi - vpaddd %xmm4,%xmm0,%xmm0 - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,28(%esp) - vpxor %xmm5,%xmm6,%xmm6 - xorl %ebx,%ecx - xorl %edi,%ebx - addl 24(%esp),%edx - vpsrlq $19,%xmm7,%xmm7 - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - vpxor %xmm7,%xmm6,%xmm6 - addl 36(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - vpshufd $132,%xmm6,%xmm7 - addl %edx,%eax - addl 8(%esp),%edx - addl %ecx,%eax - vpsrldq $8,%xmm7,%xmm7 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 12(%esp),%esi - vpaddd %xmm7,%xmm0,%xmm0 - xorl %ecx,%edx - movl 16(%esp),%edi - xorl %edi,%esi - vpshufd $80,%xmm0,%xmm7 - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,8(%esp) - vpsrld $10,%xmm7,%xmm6 - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - vpsrlq $17,%xmm7,%xmm5 - movl %eax,%ecx - addl %edi,%edx - movl 28(%esp),%edi - vpxor %xmm5,%xmm6,%xmm6 - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,24(%esp) - vpsrlq $19,%xmm7,%xmm7 - xorl %eax,%ecx - xorl %edi,%eax - addl 20(%esp),%edx - vpxor %xmm7,%xmm6,%xmm6 - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - vpshufd $232,%xmm6,%xmm7 - addl 40(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - vpslldq $8,%xmm7,%xmm7 - addl %edx,%ebx - addl 4(%esp),%edx - addl %ecx,%ebx - vpaddd %xmm7,%xmm0,%xmm0 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 8(%esp),%esi - vpaddd (%ebp),%xmm0,%xmm6 - xorl %ecx,%edx - movl 12(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,4(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %ebx,%ecx - addl %edi,%edx - movl 24(%esp),%edi - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,20(%esp) - xorl %ebx,%ecx - xorl %edi,%ebx - addl 16(%esp),%edx - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - addl 44(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - addl %edx,%eax - addl (%esp),%edx - addl %ecx,%eax - vmovdqa %xmm6,32(%esp) - vpalignr $4,%xmm1,%xmm2,%xmm4 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 4(%esp),%esi - vpalignr $4,%xmm3,%xmm0,%xmm7 - xorl %ecx,%edx - movl 8(%esp),%edi - xorl %edi,%esi - vpsrld $7,%xmm4,%xmm6 - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,(%esp) - vpaddd %xmm7,%xmm1,%xmm1 - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - vpsrld $3,%xmm4,%xmm7 - movl %eax,%ecx - addl %edi,%edx - movl 20(%esp),%edi - vpslld $14,%xmm4,%xmm5 - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,16(%esp) - vpxor %xmm6,%xmm7,%xmm4 - xorl %eax,%ecx - xorl %edi,%eax - addl 12(%esp),%edx - vpshufd $250,%xmm0,%xmm7 - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - vpsrld $11,%xmm6,%xmm6 - addl 48(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - vpxor %xmm5,%xmm4,%xmm4 - addl %edx,%ebx - addl 28(%esp),%edx - addl %ecx,%ebx - vpslld $11,%xmm5,%xmm5 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl (%esp),%esi - vpxor %xmm6,%xmm4,%xmm4 - xorl %ecx,%edx - movl 4(%esp),%edi - xorl %edi,%esi - vpsrld $10,%xmm7,%xmm6 - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,28(%esp) - vpxor %xmm5,%xmm4,%xmm4 - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - vpsrlq $17,%xmm7,%xmm5 - movl %ebx,%ecx - addl %edi,%edx - movl 16(%esp),%edi - vpaddd %xmm4,%xmm1,%xmm1 - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,12(%esp) - vpxor %xmm5,%xmm6,%xmm6 - xorl %ebx,%ecx - xorl %edi,%ebx - addl 8(%esp),%edx - vpsrlq $19,%xmm7,%xmm7 - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - vpxor %xmm7,%xmm6,%xmm6 - addl 52(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - vpshufd $132,%xmm6,%xmm7 - addl %edx,%eax - addl 24(%esp),%edx - addl %ecx,%eax - vpsrldq $8,%xmm7,%xmm7 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 28(%esp),%esi - vpaddd %xmm7,%xmm1,%xmm1 - xorl %ecx,%edx - movl (%esp),%edi - xorl %edi,%esi - vpshufd $80,%xmm1,%xmm7 - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,24(%esp) - vpsrld $10,%xmm7,%xmm6 - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - vpsrlq $17,%xmm7,%xmm5 - movl %eax,%ecx - addl %edi,%edx - movl 12(%esp),%edi - vpxor %xmm5,%xmm6,%xmm6 - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,8(%esp) - vpsrlq $19,%xmm7,%xmm7 - xorl %eax,%ecx - xorl %edi,%eax - addl 4(%esp),%edx - vpxor %xmm7,%xmm6,%xmm6 - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - vpshufd $232,%xmm6,%xmm7 - addl 56(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - vpslldq $8,%xmm7,%xmm7 - addl %edx,%ebx - addl 20(%esp),%edx - addl %ecx,%ebx - vpaddd %xmm7,%xmm1,%xmm1 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 24(%esp),%esi - vpaddd 16(%ebp),%xmm1,%xmm6 - xorl %ecx,%edx - movl 28(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,20(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %ebx,%ecx - addl %edi,%edx - movl 8(%esp),%edi - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,4(%esp) - xorl %ebx,%ecx - xorl %edi,%ebx - addl (%esp),%edx - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - addl 60(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - addl %edx,%eax - addl 16(%esp),%edx - addl %ecx,%eax - vmovdqa %xmm6,48(%esp) - vpalignr $4,%xmm2,%xmm3,%xmm4 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 20(%esp),%esi - vpalignr $4,%xmm0,%xmm1,%xmm7 - xorl %ecx,%edx - movl 24(%esp),%edi - xorl %edi,%esi - vpsrld $7,%xmm4,%xmm6 - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,16(%esp) - vpaddd %xmm7,%xmm2,%xmm2 - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - vpsrld $3,%xmm4,%xmm7 - movl %eax,%ecx - addl %edi,%edx - movl 4(%esp),%edi - vpslld $14,%xmm4,%xmm5 - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,(%esp) - vpxor %xmm6,%xmm7,%xmm4 - xorl %eax,%ecx - xorl %edi,%eax - addl 28(%esp),%edx - vpshufd $250,%xmm1,%xmm7 - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - vpsrld $11,%xmm6,%xmm6 - addl 64(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - vpxor %xmm5,%xmm4,%xmm4 - addl %edx,%ebx - addl 12(%esp),%edx - addl %ecx,%ebx - vpslld $11,%xmm5,%xmm5 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 16(%esp),%esi - vpxor %xmm6,%xmm4,%xmm4 - xorl %ecx,%edx - movl 20(%esp),%edi - xorl %edi,%esi - vpsrld $10,%xmm7,%xmm6 - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,12(%esp) - vpxor %xmm5,%xmm4,%xmm4 - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - vpsrlq $17,%xmm7,%xmm5 - movl %ebx,%ecx - addl %edi,%edx - movl (%esp),%edi - vpaddd %xmm4,%xmm2,%xmm2 - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,28(%esp) - vpxor %xmm5,%xmm6,%xmm6 - xorl %ebx,%ecx - xorl %edi,%ebx - addl 24(%esp),%edx - vpsrlq $19,%xmm7,%xmm7 - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - vpxor %xmm7,%xmm6,%xmm6 - addl 68(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - vpshufd $132,%xmm6,%xmm7 - addl %edx,%eax - addl 8(%esp),%edx - addl %ecx,%eax - vpsrldq $8,%xmm7,%xmm7 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 12(%esp),%esi - vpaddd %xmm7,%xmm2,%xmm2 - xorl %ecx,%edx - movl 16(%esp),%edi - xorl %edi,%esi - vpshufd $80,%xmm2,%xmm7 - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,8(%esp) - vpsrld $10,%xmm7,%xmm6 - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - vpsrlq $17,%xmm7,%xmm5 - movl %eax,%ecx - addl %edi,%edx - movl 28(%esp),%edi - vpxor %xmm5,%xmm6,%xmm6 - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,24(%esp) - vpsrlq $19,%xmm7,%xmm7 - xorl %eax,%ecx - xorl %edi,%eax - addl 20(%esp),%edx - vpxor %xmm7,%xmm6,%xmm6 - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - vpshufd $232,%xmm6,%xmm7 - addl 72(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - vpslldq $8,%xmm7,%xmm7 - addl %edx,%ebx - addl 4(%esp),%edx - addl %ecx,%ebx - vpaddd %xmm7,%xmm2,%xmm2 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 8(%esp),%esi - vpaddd 32(%ebp),%xmm2,%xmm6 - xorl %ecx,%edx - movl 12(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,4(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %ebx,%ecx - addl %edi,%edx - movl 24(%esp),%edi - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,20(%esp) - xorl %ebx,%ecx - xorl %edi,%ebx - addl 16(%esp),%edx - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - addl 76(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - addl %edx,%eax - addl (%esp),%edx - addl %ecx,%eax - vmovdqa %xmm6,64(%esp) - vpalignr $4,%xmm3,%xmm0,%xmm4 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 4(%esp),%esi - vpalignr $4,%xmm1,%xmm2,%xmm7 - xorl %ecx,%edx - movl 8(%esp),%edi - xorl %edi,%esi - vpsrld $7,%xmm4,%xmm6 - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,(%esp) - vpaddd %xmm7,%xmm3,%xmm3 - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - vpsrld $3,%xmm4,%xmm7 - movl %eax,%ecx - addl %edi,%edx - movl 20(%esp),%edi - vpslld $14,%xmm4,%xmm5 - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,16(%esp) - vpxor %xmm6,%xmm7,%xmm4 - xorl %eax,%ecx - xorl %edi,%eax - addl 12(%esp),%edx - vpshufd $250,%xmm2,%xmm7 - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - vpsrld $11,%xmm6,%xmm6 - addl 80(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - vpxor %xmm5,%xmm4,%xmm4 - addl %edx,%ebx - addl 28(%esp),%edx - addl %ecx,%ebx - vpslld $11,%xmm5,%xmm5 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl (%esp),%esi - vpxor %xmm6,%xmm4,%xmm4 - xorl %ecx,%edx - movl 4(%esp),%edi - xorl %edi,%esi - vpsrld $10,%xmm7,%xmm6 - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,28(%esp) - vpxor %xmm5,%xmm4,%xmm4 - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - vpsrlq $17,%xmm7,%xmm5 - movl %ebx,%ecx - addl %edi,%edx - movl 16(%esp),%edi - vpaddd %xmm4,%xmm3,%xmm3 - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,12(%esp) - vpxor %xmm5,%xmm6,%xmm6 - xorl %ebx,%ecx - xorl %edi,%ebx - addl 8(%esp),%edx - vpsrlq $19,%xmm7,%xmm7 - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - vpxor %xmm7,%xmm6,%xmm6 - addl 84(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - vpshufd $132,%xmm6,%xmm7 - addl %edx,%eax - addl 24(%esp),%edx - addl %ecx,%eax - vpsrldq $8,%xmm7,%xmm7 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 28(%esp),%esi - vpaddd %xmm7,%xmm3,%xmm3 - xorl %ecx,%edx - movl (%esp),%edi - xorl %edi,%esi - vpshufd $80,%xmm3,%xmm7 - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,24(%esp) - vpsrld $10,%xmm7,%xmm6 - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - vpsrlq $17,%xmm7,%xmm5 - movl %eax,%ecx - addl %edi,%edx - movl 12(%esp),%edi - vpxor %xmm5,%xmm6,%xmm6 - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,8(%esp) - vpsrlq $19,%xmm7,%xmm7 - xorl %eax,%ecx - xorl %edi,%eax - addl 4(%esp),%edx - vpxor %xmm7,%xmm6,%xmm6 - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - vpshufd $232,%xmm6,%xmm7 - addl 88(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - vpslldq $8,%xmm7,%xmm7 - addl %edx,%ebx - addl 20(%esp),%edx - addl %ecx,%ebx - vpaddd %xmm7,%xmm3,%xmm3 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 24(%esp),%esi - vpaddd 48(%ebp),%xmm3,%xmm6 - xorl %ecx,%edx - movl 28(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,20(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %ebx,%ecx - addl %edi,%edx - movl 8(%esp),%edi - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,4(%esp) - xorl %ebx,%ecx - xorl %edi,%ebx - addl (%esp),%edx - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - addl 92(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - addl %edx,%eax - addl 16(%esp),%edx - addl %ecx,%eax - vmovdqa %xmm6,80(%esp) - cmpl $66051,64(%ebp) - jne L016avx_00_47 - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 20(%esp),%esi - xorl %ecx,%edx - movl 24(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,16(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %eax,%ecx - addl %edi,%edx - movl 4(%esp),%edi - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,(%esp) - xorl %eax,%ecx - xorl %edi,%eax - addl 28(%esp),%edx - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - addl 32(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - addl %edx,%ebx - addl 12(%esp),%edx - addl %ecx,%ebx - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 16(%esp),%esi - xorl %ecx,%edx - movl 20(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,12(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %ebx,%ecx - addl %edi,%edx - movl (%esp),%edi - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,28(%esp) - xorl %ebx,%ecx - xorl %edi,%ebx - addl 24(%esp),%edx - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - addl 36(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - addl %edx,%eax - addl 8(%esp),%edx - addl %ecx,%eax - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 12(%esp),%esi - xorl %ecx,%edx - movl 16(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,8(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %eax,%ecx - addl %edi,%edx - movl 28(%esp),%edi - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,24(%esp) - xorl %eax,%ecx - xorl %edi,%eax - addl 20(%esp),%edx - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - addl 40(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - addl %edx,%ebx - addl 4(%esp),%edx - addl %ecx,%ebx - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 8(%esp),%esi - xorl %ecx,%edx - movl 12(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,4(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %ebx,%ecx - addl %edi,%edx - movl 24(%esp),%edi - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,20(%esp) - xorl %ebx,%ecx - xorl %edi,%ebx - addl 16(%esp),%edx - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - addl 44(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - addl %edx,%eax - addl (%esp),%edx - addl %ecx,%eax - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 4(%esp),%esi - xorl %ecx,%edx - movl 8(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %eax,%ecx - addl %edi,%edx - movl 20(%esp),%edi - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,16(%esp) - xorl %eax,%ecx - xorl %edi,%eax - addl 12(%esp),%edx - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - addl 48(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - addl %edx,%ebx - addl 28(%esp),%edx - addl %ecx,%ebx - movl %edx,%ecx - shrdl $14,%edx,%edx - movl (%esp),%esi - xorl %ecx,%edx - movl 4(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,28(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %ebx,%ecx - addl %edi,%edx - movl 16(%esp),%edi - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,12(%esp) - xorl %ebx,%ecx - xorl %edi,%ebx - addl 8(%esp),%edx - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - addl 52(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - addl %edx,%eax - addl 24(%esp),%edx - addl %ecx,%eax - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 28(%esp),%esi - xorl %ecx,%edx - movl (%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,24(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %eax,%ecx - addl %edi,%edx - movl 12(%esp),%edi - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,8(%esp) - xorl %eax,%ecx - xorl %edi,%eax - addl 4(%esp),%edx - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - addl 56(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - addl %edx,%ebx - addl 20(%esp),%edx - addl %ecx,%ebx - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 24(%esp),%esi - xorl %ecx,%edx - movl 28(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,20(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %ebx,%ecx - addl %edi,%edx - movl 8(%esp),%edi - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,4(%esp) - xorl %ebx,%ecx - xorl %edi,%ebx - addl (%esp),%edx - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - addl 60(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - addl %edx,%eax - addl 16(%esp),%edx - addl %ecx,%eax - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 20(%esp),%esi - xorl %ecx,%edx - movl 24(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,16(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %eax,%ecx - addl %edi,%edx - movl 4(%esp),%edi - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,(%esp) - xorl %eax,%ecx - xorl %edi,%eax - addl 28(%esp),%edx - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - addl 64(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - addl %edx,%ebx - addl 12(%esp),%edx - addl %ecx,%ebx - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 16(%esp),%esi - xorl %ecx,%edx - movl 20(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,12(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %ebx,%ecx - addl %edi,%edx - movl (%esp),%edi - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,28(%esp) - xorl %ebx,%ecx - xorl %edi,%ebx - addl 24(%esp),%edx - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - addl 68(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - addl %edx,%eax - addl 8(%esp),%edx - addl %ecx,%eax - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 12(%esp),%esi - xorl %ecx,%edx - movl 16(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,8(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %eax,%ecx - addl %edi,%edx - movl 28(%esp),%edi - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,24(%esp) - xorl %eax,%ecx - xorl %edi,%eax - addl 20(%esp),%edx - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - addl 72(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - addl %edx,%ebx - addl 4(%esp),%edx - addl %ecx,%ebx - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 8(%esp),%esi - xorl %ecx,%edx - movl 12(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,4(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %ebx,%ecx - addl %edi,%edx - movl 24(%esp),%edi - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,20(%esp) - xorl %ebx,%ecx - xorl %edi,%ebx - addl 16(%esp),%edx - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - addl 76(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - addl %edx,%eax - addl (%esp),%edx - addl %ecx,%eax - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 4(%esp),%esi - xorl %ecx,%edx - movl 8(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %eax,%ecx - addl %edi,%edx - movl 20(%esp),%edi - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,16(%esp) - xorl %eax,%ecx - xorl %edi,%eax - addl 12(%esp),%edx - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - addl 80(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - addl %edx,%ebx - addl 28(%esp),%edx - addl %ecx,%ebx - movl %edx,%ecx - shrdl $14,%edx,%edx - movl (%esp),%esi - xorl %ecx,%edx - movl 4(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,28(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %ebx,%ecx - addl %edi,%edx - movl 16(%esp),%edi - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,12(%esp) - xorl %ebx,%ecx - xorl %edi,%ebx - addl 8(%esp),%edx - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - addl 84(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - addl %edx,%eax - addl 24(%esp),%edx - addl %ecx,%eax - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 28(%esp),%esi - xorl %ecx,%edx - movl (%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,24(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %eax,%ecx - addl %edi,%edx - movl 12(%esp),%edi - movl %eax,%esi - shrdl $9,%ecx,%ecx - movl %eax,8(%esp) - xorl %eax,%ecx - xorl %edi,%eax - addl 4(%esp),%edx - shrdl $11,%ecx,%ecx - andl %eax,%ebx - xorl %esi,%ecx - addl 88(%esp),%edx - xorl %edi,%ebx - shrdl $2,%ecx,%ecx - addl %edx,%ebx - addl 20(%esp),%edx - addl %ecx,%ebx - movl %edx,%ecx - shrdl $14,%edx,%edx - movl 24(%esp),%esi - xorl %ecx,%edx - movl 28(%esp),%edi - xorl %edi,%esi - shrdl $5,%edx,%edx - andl %ecx,%esi - movl %ecx,20(%esp) - xorl %ecx,%edx - xorl %esi,%edi - shrdl $6,%edx,%edx - movl %ebx,%ecx - addl %edi,%edx - movl 8(%esp),%edi - movl %ebx,%esi - shrdl $9,%ecx,%ecx - movl %ebx,4(%esp) - xorl %ebx,%ecx - xorl %edi,%ebx - addl (%esp),%edx - shrdl $11,%ecx,%ecx - andl %ebx,%eax - xorl %esi,%ecx - addl 92(%esp),%edx - xorl %edi,%eax - shrdl $2,%ecx,%ecx - addl %edx,%eax - addl 16(%esp),%edx - addl %ecx,%eax - movl 96(%esp),%esi - xorl %edi,%ebx - movl 12(%esp),%ecx - addl (%esi),%eax - addl 4(%esi),%ebx - addl 8(%esi),%edi - addl 12(%esi),%ecx - movl %eax,(%esi) - movl %ebx,4(%esi) - movl %edi,8(%esi) - movl %ecx,12(%esi) - movl %ebx,4(%esp) - xorl %edi,%ebx - movl %edi,8(%esp) - movl %ecx,12(%esp) - movl 20(%esp),%edi - movl 24(%esp),%ecx - addl 16(%esi),%edx - addl 20(%esi),%edi - addl 24(%esi),%ecx - movl %edx,16(%esi) - movl %edi,20(%esi) - movl %edi,20(%esp) - movl 28(%esp),%edi - movl %ecx,24(%esi) - addl 28(%esi),%edi - movl %ecx,24(%esp) - movl %edi,28(%esi) - movl %edi,28(%esp) - movl 100(%esp),%edi - vmovdqa 64(%ebp),%xmm7 - subl $192,%ebp - cmpl 104(%esp),%edi - jb L015grand_avx - movl 108(%esp),%esp - vzeroall - popl %edi - popl %esi - popl %ebx - popl %ebp - ret -.align 5,0x90 -L014AVX_BMI: - leal -96(%esp),%esp - vzeroall - movl (%esi),%eax - movl 4(%esi),%ebx - movl 8(%esi),%ecx - movl 12(%esi),%edi - movl %ebx,4(%esp) - xorl %ecx,%ebx - movl %ecx,8(%esp) - movl %edi,12(%esp) - movl 16(%esi),%edx - movl 20(%esi),%edi - movl 24(%esi),%ecx - movl 28(%esi),%esi - movl %edi,20(%esp) - movl 100(%esp),%edi - movl %ecx,24(%esp) - movl %esi,28(%esp) - vmovdqa 256(%ebp),%xmm7 - jmp L017grand_avx_bmi -.align 5,0x90 -L017grand_avx_bmi: - vmovdqu (%edi),%xmm0 - vmovdqu 16(%edi),%xmm1 - vmovdqu 32(%edi),%xmm2 - vmovdqu 48(%edi),%xmm3 - addl $64,%edi - vpshufb %xmm7,%xmm0,%xmm0 - movl %edi,100(%esp) - vpshufb %xmm7,%xmm1,%xmm1 - vpshufb %xmm7,%xmm2,%xmm2 - vpaddd (%ebp),%xmm0,%xmm4 - vpshufb %xmm7,%xmm3,%xmm3 - vpaddd 16(%ebp),%xmm1,%xmm5 - vpaddd 32(%ebp),%xmm2,%xmm6 - vpaddd 48(%ebp),%xmm3,%xmm7 - vmovdqa %xmm4,32(%esp) - vmovdqa %xmm5,48(%esp) - vmovdqa %xmm6,64(%esp) - vmovdqa %xmm7,80(%esp) - jmp L018avx_bmi_00_47 -.align 4,0x90 -L018avx_bmi_00_47: - addl $64,%ebp - vpalignr $4,%xmm0,%xmm1,%xmm4 - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,16(%esp) - vpalignr $4,%xmm2,%xmm3,%xmm7 - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 24(%esp),%edx,%esi - vpsrld $7,%xmm4,%xmm6 - xorl %edi,%ecx - andl 20(%esp),%edx - movl %eax,(%esp) - vpaddd %xmm7,%xmm0,%xmm0 - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - vpsrld $3,%xmm4,%xmm7 - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - vpslld $14,%xmm4,%xmm5 - movl 4(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - vpxor %xmm6,%xmm7,%xmm4 - addl 28(%esp),%edx - andl %eax,%ebx - addl 32(%esp),%edx - vpshufd $250,%xmm3,%xmm7 - xorl %edi,%ebx - addl %edx,%ecx - addl 12(%esp),%edx - vpsrld $11,%xmm6,%xmm6 - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - vpxor %xmm5,%xmm4,%xmm4 - movl %edx,12(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - vpslld $11,%xmm5,%xmm5 - andnl 20(%esp),%edx,%esi - xorl %edi,%ecx - andl 16(%esp),%edx - vpxor %xmm6,%xmm4,%xmm4 - movl %ebx,28(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - vpsrld $10,%xmm7,%xmm6 - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - vpxor %xmm5,%xmm4,%xmm4 - movl (%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - vpsrlq $17,%xmm7,%xmm5 - addl 24(%esp),%edx - andl %ebx,%eax - addl 36(%esp),%edx - vpaddd %xmm4,%xmm0,%xmm0 - xorl %edi,%eax - addl %edx,%ecx - addl 8(%esp),%edx - vpxor %xmm5,%xmm6,%xmm6 - leal (%eax,%ecx,1),%eax - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - vpsrlq $19,%xmm7,%xmm7 - movl %edx,8(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - vpxor %xmm7,%xmm6,%xmm6 - andnl 16(%esp),%edx,%esi - xorl %edi,%ecx - andl 12(%esp),%edx - vpshufd $132,%xmm6,%xmm7 - movl %eax,24(%esp) - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - vpsrldq $8,%xmm7,%xmm7 - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - vpaddd %xmm7,%xmm0,%xmm0 - movl 28(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - vpshufd $80,%xmm0,%xmm7 - addl 20(%esp),%edx - andl %eax,%ebx - addl 40(%esp),%edx - vpsrld $10,%xmm7,%xmm6 - xorl %edi,%ebx - addl %edx,%ecx - addl 4(%esp),%edx - vpsrlq $17,%xmm7,%xmm5 - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - vpxor %xmm5,%xmm6,%xmm6 - movl %edx,4(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - vpsrlq $19,%xmm7,%xmm7 - andnl 12(%esp),%edx,%esi - xorl %edi,%ecx - andl 8(%esp),%edx - vpxor %xmm7,%xmm6,%xmm6 - movl %ebx,20(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - vpshufd $232,%xmm6,%xmm7 - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - vpslldq $8,%xmm7,%xmm7 - movl 24(%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - vpaddd %xmm7,%xmm0,%xmm0 - addl 16(%esp),%edx - andl %ebx,%eax - addl 44(%esp),%edx - vpaddd (%ebp),%xmm0,%xmm6 - xorl %edi,%eax - addl %edx,%ecx - addl (%esp),%edx - leal (%eax,%ecx,1),%eax - vmovdqa %xmm6,32(%esp) - vpalignr $4,%xmm1,%xmm2,%xmm4 - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,(%esp) - vpalignr $4,%xmm3,%xmm0,%xmm7 - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 8(%esp),%edx,%esi - vpsrld $7,%xmm4,%xmm6 - xorl %edi,%ecx - andl 4(%esp),%edx - movl %eax,16(%esp) - vpaddd %xmm7,%xmm1,%xmm1 - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - vpsrld $3,%xmm4,%xmm7 - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - vpslld $14,%xmm4,%xmm5 - movl 20(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - vpxor %xmm6,%xmm7,%xmm4 - addl 12(%esp),%edx - andl %eax,%ebx - addl 48(%esp),%edx - vpshufd $250,%xmm0,%xmm7 - xorl %edi,%ebx - addl %edx,%ecx - addl 28(%esp),%edx - vpsrld $11,%xmm6,%xmm6 - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - vpxor %xmm5,%xmm4,%xmm4 - movl %edx,28(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - vpslld $11,%xmm5,%xmm5 - andnl 4(%esp),%edx,%esi - xorl %edi,%ecx - andl (%esp),%edx - vpxor %xmm6,%xmm4,%xmm4 - movl %ebx,12(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - vpsrld $10,%xmm7,%xmm6 - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - vpxor %xmm5,%xmm4,%xmm4 - movl 16(%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - vpsrlq $17,%xmm7,%xmm5 - addl 8(%esp),%edx - andl %ebx,%eax - addl 52(%esp),%edx - vpaddd %xmm4,%xmm1,%xmm1 - xorl %edi,%eax - addl %edx,%ecx - addl 24(%esp),%edx - vpxor %xmm5,%xmm6,%xmm6 - leal (%eax,%ecx,1),%eax - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - vpsrlq $19,%xmm7,%xmm7 - movl %edx,24(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - vpxor %xmm7,%xmm6,%xmm6 - andnl (%esp),%edx,%esi - xorl %edi,%ecx - andl 28(%esp),%edx - vpshufd $132,%xmm6,%xmm7 - movl %eax,8(%esp) - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - vpsrldq $8,%xmm7,%xmm7 - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - vpaddd %xmm7,%xmm1,%xmm1 - movl 12(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - vpshufd $80,%xmm1,%xmm7 - addl 4(%esp),%edx - andl %eax,%ebx - addl 56(%esp),%edx - vpsrld $10,%xmm7,%xmm6 - xorl %edi,%ebx - addl %edx,%ecx - addl 20(%esp),%edx - vpsrlq $17,%xmm7,%xmm5 - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - vpxor %xmm5,%xmm6,%xmm6 - movl %edx,20(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - vpsrlq $19,%xmm7,%xmm7 - andnl 28(%esp),%edx,%esi - xorl %edi,%ecx - andl 24(%esp),%edx - vpxor %xmm7,%xmm6,%xmm6 - movl %ebx,4(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - vpshufd $232,%xmm6,%xmm7 - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - vpslldq $8,%xmm7,%xmm7 - movl 8(%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - vpaddd %xmm7,%xmm1,%xmm1 - addl (%esp),%edx - andl %ebx,%eax - addl 60(%esp),%edx - vpaddd 16(%ebp),%xmm1,%xmm6 - xorl %edi,%eax - addl %edx,%ecx - addl 16(%esp),%edx - leal (%eax,%ecx,1),%eax - vmovdqa %xmm6,48(%esp) - vpalignr $4,%xmm2,%xmm3,%xmm4 - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,16(%esp) - vpalignr $4,%xmm0,%xmm1,%xmm7 - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 24(%esp),%edx,%esi - vpsrld $7,%xmm4,%xmm6 - xorl %edi,%ecx - andl 20(%esp),%edx - movl %eax,(%esp) - vpaddd %xmm7,%xmm2,%xmm2 - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - vpsrld $3,%xmm4,%xmm7 - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - vpslld $14,%xmm4,%xmm5 - movl 4(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - vpxor %xmm6,%xmm7,%xmm4 - addl 28(%esp),%edx - andl %eax,%ebx - addl 64(%esp),%edx - vpshufd $250,%xmm1,%xmm7 - xorl %edi,%ebx - addl %edx,%ecx - addl 12(%esp),%edx - vpsrld $11,%xmm6,%xmm6 - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - vpxor %xmm5,%xmm4,%xmm4 - movl %edx,12(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - vpslld $11,%xmm5,%xmm5 - andnl 20(%esp),%edx,%esi - xorl %edi,%ecx - andl 16(%esp),%edx - vpxor %xmm6,%xmm4,%xmm4 - movl %ebx,28(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - vpsrld $10,%xmm7,%xmm6 - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - vpxor %xmm5,%xmm4,%xmm4 - movl (%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - vpsrlq $17,%xmm7,%xmm5 - addl 24(%esp),%edx - andl %ebx,%eax - addl 68(%esp),%edx - vpaddd %xmm4,%xmm2,%xmm2 - xorl %edi,%eax - addl %edx,%ecx - addl 8(%esp),%edx - vpxor %xmm5,%xmm6,%xmm6 - leal (%eax,%ecx,1),%eax - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - vpsrlq $19,%xmm7,%xmm7 - movl %edx,8(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - vpxor %xmm7,%xmm6,%xmm6 - andnl 16(%esp),%edx,%esi - xorl %edi,%ecx - andl 12(%esp),%edx - vpshufd $132,%xmm6,%xmm7 - movl %eax,24(%esp) - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - vpsrldq $8,%xmm7,%xmm7 - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - vpaddd %xmm7,%xmm2,%xmm2 - movl 28(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - vpshufd $80,%xmm2,%xmm7 - addl 20(%esp),%edx - andl %eax,%ebx - addl 72(%esp),%edx - vpsrld $10,%xmm7,%xmm6 - xorl %edi,%ebx - addl %edx,%ecx - addl 4(%esp),%edx - vpsrlq $17,%xmm7,%xmm5 - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - vpxor %xmm5,%xmm6,%xmm6 - movl %edx,4(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - vpsrlq $19,%xmm7,%xmm7 - andnl 12(%esp),%edx,%esi - xorl %edi,%ecx - andl 8(%esp),%edx - vpxor %xmm7,%xmm6,%xmm6 - movl %ebx,20(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - vpshufd $232,%xmm6,%xmm7 - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - vpslldq $8,%xmm7,%xmm7 - movl 24(%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - vpaddd %xmm7,%xmm2,%xmm2 - addl 16(%esp),%edx - andl %ebx,%eax - addl 76(%esp),%edx - vpaddd 32(%ebp),%xmm2,%xmm6 - xorl %edi,%eax - addl %edx,%ecx - addl (%esp),%edx - leal (%eax,%ecx,1),%eax - vmovdqa %xmm6,64(%esp) - vpalignr $4,%xmm3,%xmm0,%xmm4 - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,(%esp) - vpalignr $4,%xmm1,%xmm2,%xmm7 - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 8(%esp),%edx,%esi - vpsrld $7,%xmm4,%xmm6 - xorl %edi,%ecx - andl 4(%esp),%edx - movl %eax,16(%esp) - vpaddd %xmm7,%xmm3,%xmm3 - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - vpsrld $3,%xmm4,%xmm7 - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - vpslld $14,%xmm4,%xmm5 - movl 20(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - vpxor %xmm6,%xmm7,%xmm4 - addl 12(%esp),%edx - andl %eax,%ebx - addl 80(%esp),%edx - vpshufd $250,%xmm2,%xmm7 - xorl %edi,%ebx - addl %edx,%ecx - addl 28(%esp),%edx - vpsrld $11,%xmm6,%xmm6 - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - vpxor %xmm5,%xmm4,%xmm4 - movl %edx,28(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - vpslld $11,%xmm5,%xmm5 - andnl 4(%esp),%edx,%esi - xorl %edi,%ecx - andl (%esp),%edx - vpxor %xmm6,%xmm4,%xmm4 - movl %ebx,12(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - vpsrld $10,%xmm7,%xmm6 - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - vpxor %xmm5,%xmm4,%xmm4 - movl 16(%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - vpsrlq $17,%xmm7,%xmm5 - addl 8(%esp),%edx - andl %ebx,%eax - addl 84(%esp),%edx - vpaddd %xmm4,%xmm3,%xmm3 - xorl %edi,%eax - addl %edx,%ecx - addl 24(%esp),%edx - vpxor %xmm5,%xmm6,%xmm6 - leal (%eax,%ecx,1),%eax - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - vpsrlq $19,%xmm7,%xmm7 - movl %edx,24(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - vpxor %xmm7,%xmm6,%xmm6 - andnl (%esp),%edx,%esi - xorl %edi,%ecx - andl 28(%esp),%edx - vpshufd $132,%xmm6,%xmm7 - movl %eax,8(%esp) - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - vpsrldq $8,%xmm7,%xmm7 - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - vpaddd %xmm7,%xmm3,%xmm3 - movl 12(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - vpshufd $80,%xmm3,%xmm7 - addl 4(%esp),%edx - andl %eax,%ebx - addl 88(%esp),%edx - vpsrld $10,%xmm7,%xmm6 - xorl %edi,%ebx - addl %edx,%ecx - addl 20(%esp),%edx - vpsrlq $17,%xmm7,%xmm5 - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - vpxor %xmm5,%xmm6,%xmm6 - movl %edx,20(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - vpsrlq $19,%xmm7,%xmm7 - andnl 28(%esp),%edx,%esi - xorl %edi,%ecx - andl 24(%esp),%edx - vpxor %xmm7,%xmm6,%xmm6 - movl %ebx,4(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - vpshufd $232,%xmm6,%xmm7 - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - vpslldq $8,%xmm7,%xmm7 - movl 8(%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - vpaddd %xmm7,%xmm3,%xmm3 - addl (%esp),%edx - andl %ebx,%eax - addl 92(%esp),%edx - vpaddd 48(%ebp),%xmm3,%xmm6 - xorl %edi,%eax - addl %edx,%ecx - addl 16(%esp),%edx - leal (%eax,%ecx,1),%eax - vmovdqa %xmm6,80(%esp) - cmpl $66051,64(%ebp) - jne L018avx_bmi_00_47 - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,16(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 24(%esp),%edx,%esi - xorl %edi,%ecx - andl 20(%esp),%edx - movl %eax,(%esp) - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - movl 4(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - addl 28(%esp),%edx - andl %eax,%ebx - addl 32(%esp),%edx - xorl %edi,%ebx - addl %edx,%ecx - addl 12(%esp),%edx - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,12(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 20(%esp),%edx,%esi - xorl %edi,%ecx - andl 16(%esp),%edx - movl %ebx,28(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - movl (%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - addl 24(%esp),%edx - andl %ebx,%eax - addl 36(%esp),%edx - xorl %edi,%eax - addl %edx,%ecx - addl 8(%esp),%edx - leal (%eax,%ecx,1),%eax - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,8(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 16(%esp),%edx,%esi - xorl %edi,%ecx - andl 12(%esp),%edx - movl %eax,24(%esp) - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - movl 28(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - addl 20(%esp),%edx - andl %eax,%ebx - addl 40(%esp),%edx - xorl %edi,%ebx - addl %edx,%ecx - addl 4(%esp),%edx - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,4(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 12(%esp),%edx,%esi - xorl %edi,%ecx - andl 8(%esp),%edx - movl %ebx,20(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - movl 24(%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - addl 16(%esp),%edx - andl %ebx,%eax - addl 44(%esp),%edx - xorl %edi,%eax - addl %edx,%ecx - addl (%esp),%edx - leal (%eax,%ecx,1),%eax - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 8(%esp),%edx,%esi - xorl %edi,%ecx - andl 4(%esp),%edx - movl %eax,16(%esp) - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - movl 20(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - addl 12(%esp),%edx - andl %eax,%ebx - addl 48(%esp),%edx - xorl %edi,%ebx - addl %edx,%ecx - addl 28(%esp),%edx - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,28(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 4(%esp),%edx,%esi - xorl %edi,%ecx - andl (%esp),%edx - movl %ebx,12(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - movl 16(%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - addl 8(%esp),%edx - andl %ebx,%eax - addl 52(%esp),%edx - xorl %edi,%eax - addl %edx,%ecx - addl 24(%esp),%edx - leal (%eax,%ecx,1),%eax - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,24(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl (%esp),%edx,%esi - xorl %edi,%ecx - andl 28(%esp),%edx - movl %eax,8(%esp) - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - movl 12(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - addl 4(%esp),%edx - andl %eax,%ebx - addl 56(%esp),%edx - xorl %edi,%ebx - addl %edx,%ecx - addl 20(%esp),%edx - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,20(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 28(%esp),%edx,%esi - xorl %edi,%ecx - andl 24(%esp),%edx - movl %ebx,4(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - movl 8(%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - addl (%esp),%edx - andl %ebx,%eax - addl 60(%esp),%edx - xorl %edi,%eax - addl %edx,%ecx - addl 16(%esp),%edx - leal (%eax,%ecx,1),%eax - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,16(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 24(%esp),%edx,%esi - xorl %edi,%ecx - andl 20(%esp),%edx - movl %eax,(%esp) - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - movl 4(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - addl 28(%esp),%edx - andl %eax,%ebx - addl 64(%esp),%edx - xorl %edi,%ebx - addl %edx,%ecx - addl 12(%esp),%edx - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,12(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 20(%esp),%edx,%esi - xorl %edi,%ecx - andl 16(%esp),%edx - movl %ebx,28(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - movl (%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - addl 24(%esp),%edx - andl %ebx,%eax - addl 68(%esp),%edx - xorl %edi,%eax - addl %edx,%ecx - addl 8(%esp),%edx - leal (%eax,%ecx,1),%eax - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,8(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 16(%esp),%edx,%esi - xorl %edi,%ecx - andl 12(%esp),%edx - movl %eax,24(%esp) - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - movl 28(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - addl 20(%esp),%edx - andl %eax,%ebx - addl 72(%esp),%edx - xorl %edi,%ebx - addl %edx,%ecx - addl 4(%esp),%edx - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,4(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 12(%esp),%edx,%esi - xorl %edi,%ecx - andl 8(%esp),%edx - movl %ebx,20(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - movl 24(%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - addl 16(%esp),%edx - andl %ebx,%eax - addl 76(%esp),%edx - xorl %edi,%eax - addl %edx,%ecx - addl (%esp),%edx - leal (%eax,%ecx,1),%eax - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 8(%esp),%edx,%esi - xorl %edi,%ecx - andl 4(%esp),%edx - movl %eax,16(%esp) - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - movl 20(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - addl 12(%esp),%edx - andl %eax,%ebx - addl 80(%esp),%edx - xorl %edi,%ebx - addl %edx,%ecx - addl 28(%esp),%edx - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,28(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 4(%esp),%edx,%esi - xorl %edi,%ecx - andl (%esp),%edx - movl %ebx,12(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - movl 16(%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - addl 8(%esp),%edx - andl %ebx,%eax - addl 84(%esp),%edx - xorl %edi,%eax - addl %edx,%ecx - addl 24(%esp),%edx - leal (%eax,%ecx,1),%eax - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,24(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl (%esp),%edx,%esi - xorl %edi,%ecx - andl 28(%esp),%edx - movl %eax,8(%esp) - orl %esi,%edx - rorxl $2,%eax,%edi - rorxl $13,%eax,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%eax,%ecx - xorl %edi,%esi - movl 12(%esp),%edi - xorl %esi,%ecx - xorl %edi,%eax - addl 4(%esp),%edx - andl %eax,%ebx - addl 88(%esp),%edx - xorl %edi,%ebx - addl %edx,%ecx - addl 20(%esp),%edx - leal (%ebx,%ecx,1),%ebx - rorxl $6,%edx,%ecx - rorxl $11,%edx,%esi - movl %edx,20(%esp) - rorxl $25,%edx,%edi - xorl %esi,%ecx - andnl 28(%esp),%edx,%esi - xorl %edi,%ecx - andl 24(%esp),%edx - movl %ebx,4(%esp) - orl %esi,%edx - rorxl $2,%ebx,%edi - rorxl $13,%ebx,%esi - leal (%edx,%ecx,1),%edx - rorxl $22,%ebx,%ecx - xorl %edi,%esi - movl 8(%esp),%edi - xorl %esi,%ecx - xorl %edi,%ebx - addl (%esp),%edx - andl %ebx,%eax - addl 92(%esp),%edx - xorl %edi,%eax - addl %edx,%ecx - addl 16(%esp),%edx - leal (%eax,%ecx,1),%eax - movl 96(%esp),%esi - xorl %edi,%ebx - movl 12(%esp),%ecx - addl (%esi),%eax - addl 4(%esi),%ebx - addl 8(%esi),%edi - addl 12(%esi),%ecx - movl %eax,(%esi) - movl %ebx,4(%esi) - movl %edi,8(%esi) - movl %ecx,12(%esi) - movl %ebx,4(%esp) - xorl %edi,%ebx - movl %edi,8(%esp) - movl %ecx,12(%esp) - movl 20(%esp),%edi - movl 24(%esp),%ecx - addl 16(%esi),%edx - addl 20(%esi),%edi - addl 24(%esi),%ecx - movl %edx,16(%esi) - movl %edi,20(%esi) - movl %edi,20(%esp) - movl 28(%esp),%edi - movl %ecx,24(%esi) - addl 28(%esi),%edi - movl %ecx,24(%esp) - movl %edi,28(%esi) - movl %edi,28(%esp) - movl 100(%esp),%edi - vmovdqa 64(%ebp),%xmm7 - subl $192,%ebp - cmpl 104(%esp),%edi - jb L017grand_avx_bmi - movl 108(%esp),%esp - vzeroall - popl %edi - popl %esi - popl %ebx - popl %ebp - ret .section __IMPORT,__pointers,non_lazy_symbol_pointers L_OPENSSL_ia32cap_P$non_lazy_ptr: .indirect_symbol _OPENSSL_ia32cap_P diff --git a/deps/openssl/asm/x86-win32-masm/sha/sha1-586.asm b/deps/openssl/asm/x86-win32-masm/sha/sha1-586.asm index 4607eda762a75a..38aaf17445b4b8 100644 --- a/deps/openssl/asm/x86-win32-masm/sha/sha1-586.asm +++ b/deps/openssl/asm/x86-win32-masm/sha/sha1-586.asm @@ -39,11 +39,6 @@ $L000pic_point: jz $L001x86 test ecx,536870912 jnz $Lshaext_shortcut - and edx,268435456 - and eax,1073741824 - or eax,edx - cmp eax,1342177280 - je $Lavx_shortcut jmp $Lssse3_shortcut ALIGN 16 $L001x86: @@ -2799,1175 +2794,6 @@ $L007done: pop ebp ret __sha1_block_data_order_ssse3 ENDP -ALIGN 16 -__sha1_block_data_order_avx PROC PRIVATE - push ebp - push ebx - push esi - push edi - call $L008pic_point -$L008pic_point: - pop ebp - lea ebp,DWORD PTR ($LK_XX_XX-$L008pic_point)[ebp] -$Lavx_shortcut:: - vzeroall - vmovdqa xmm7,XMMWORD PTR [ebp] - vmovdqa xmm0,XMMWORD PTR 16[ebp] - vmovdqa xmm1,XMMWORD PTR 32[ebp] - vmovdqa xmm2,XMMWORD PTR 48[ebp] - vmovdqa xmm6,XMMWORD PTR 64[ebp] - mov edi,DWORD PTR 20[esp] - mov ebp,DWORD PTR 24[esp] - mov edx,DWORD PTR 28[esp] - mov esi,esp - sub esp,208 - and esp,-64 - vmovdqa XMMWORD PTR 112[esp],xmm0 - vmovdqa XMMWORD PTR 128[esp],xmm1 - vmovdqa XMMWORD PTR 144[esp],xmm2 - shl edx,6 - vmovdqa XMMWORD PTR 160[esp],xmm7 - add edx,ebp - vmovdqa XMMWORD PTR 176[esp],xmm6 - add ebp,64 - mov DWORD PTR 192[esp],edi - mov DWORD PTR 196[esp],ebp - mov DWORD PTR 200[esp],edx - mov DWORD PTR 204[esp],esi - mov eax,DWORD PTR [edi] - mov ebx,DWORD PTR 4[edi] - mov ecx,DWORD PTR 8[edi] - mov edx,DWORD PTR 12[edi] - mov edi,DWORD PTR 16[edi] - mov esi,ebx - vmovdqu xmm0,XMMWORD PTR [ebp-64] - vmovdqu xmm1,XMMWORD PTR [ebp-48] - vmovdqu xmm2,XMMWORD PTR [ebp-32] - vmovdqu xmm3,XMMWORD PTR [ebp-16] - vpshufb xmm0,xmm0,xmm6 - vpshufb xmm1,xmm1,xmm6 - vpshufb xmm2,xmm2,xmm6 - vmovdqa XMMWORD PTR 96[esp],xmm7 - vpshufb xmm3,xmm3,xmm6 - vpaddd xmm4,xmm0,xmm7 - vpaddd xmm5,xmm1,xmm7 - vpaddd xmm6,xmm2,xmm7 - vmovdqa XMMWORD PTR [esp],xmm4 - mov ebp,ecx - vmovdqa XMMWORD PTR 16[esp],xmm5 - xor ebp,edx - vmovdqa XMMWORD PTR 32[esp],xmm6 - and esi,ebp - jmp $L009loop -ALIGN 16 -$L009loop: - shrd ebx,ebx,2 - xor esi,edx - vpalignr xmm4,xmm1,xmm0,8 - mov ebp,eax - add edi,DWORD PTR [esp] - vpaddd xmm7,xmm7,xmm3 - vmovdqa XMMWORD PTR 64[esp],xmm0 - xor ebx,ecx - shld eax,eax,5 - vpsrldq xmm6,xmm3,4 - add edi,esi - and ebp,ebx - vpxor xmm4,xmm4,xmm0 - xor ebx,ecx - add edi,eax - vpxor xmm6,xmm6,xmm2 - shrd eax,eax,7 - xor ebp,ecx - vmovdqa XMMWORD PTR 48[esp],xmm7 - mov esi,edi - add edx,DWORD PTR 4[esp] - vpxor xmm4,xmm4,xmm6 - xor eax,ebx - shld edi,edi,5 - add edx,ebp - and esi,eax - vpsrld xmm6,xmm4,31 - xor eax,ebx - add edx,edi - shrd edi,edi,7 - xor esi,ebx - vpslldq xmm0,xmm4,12 - vpaddd xmm4,xmm4,xmm4 - mov ebp,edx - add ecx,DWORD PTR 8[esp] - xor edi,eax - shld edx,edx,5 - vpsrld xmm7,xmm0,30 - vpor xmm4,xmm4,xmm6 - add ecx,esi - and ebp,edi - xor edi,eax - add ecx,edx - vpslld xmm0,xmm0,2 - shrd edx,edx,7 - xor ebp,eax - vpxor xmm4,xmm4,xmm7 - mov esi,ecx - add ebx,DWORD PTR 12[esp] - xor edx,edi - shld ecx,ecx,5 - vpxor xmm4,xmm4,xmm0 - add ebx,ebp - and esi,edx - vmovdqa xmm0,XMMWORD PTR 96[esp] - xor edx,edi - add ebx,ecx - shrd ecx,ecx,7 - xor esi,edi - vpalignr xmm5,xmm2,xmm1,8 - mov ebp,ebx - add eax,DWORD PTR 16[esp] - vpaddd xmm0,xmm0,xmm4 - vmovdqa XMMWORD PTR 80[esp],xmm1 - xor ecx,edx - shld ebx,ebx,5 - vpsrldq xmm7,xmm4,4 - add eax,esi - and ebp,ecx - vpxor xmm5,xmm5,xmm1 - xor ecx,edx - add eax,ebx - vpxor xmm7,xmm7,xmm3 - shrd ebx,ebx,7 - xor ebp,edx - vmovdqa XMMWORD PTR [esp],xmm0 - mov esi,eax - add edi,DWORD PTR 20[esp] - vpxor xmm5,xmm5,xmm7 - xor ebx,ecx - shld eax,eax,5 - add edi,ebp - and esi,ebx - vpsrld xmm7,xmm5,31 - xor ebx,ecx - add edi,eax - shrd eax,eax,7 - xor esi,ecx - vpslldq xmm1,xmm5,12 - vpaddd xmm5,xmm5,xmm5 - mov ebp,edi - add edx,DWORD PTR 24[esp] - xor eax,ebx - shld edi,edi,5 - vpsrld xmm0,xmm1,30 - vpor xmm5,xmm5,xmm7 - add edx,esi - and ebp,eax - xor eax,ebx - add edx,edi - vpslld xmm1,xmm1,2 - shrd edi,edi,7 - xor ebp,ebx - vpxor xmm5,xmm5,xmm0 - mov esi,edx - add ecx,DWORD PTR 28[esp] - xor edi,eax - shld edx,edx,5 - vpxor xmm5,xmm5,xmm1 - add ecx,ebp - and esi,edi - vmovdqa xmm1,XMMWORD PTR 112[esp] - xor edi,eax - add ecx,edx - shrd edx,edx,7 - xor esi,eax - vpalignr xmm6,xmm3,xmm2,8 - mov ebp,ecx - add ebx,DWORD PTR 32[esp] - vpaddd xmm1,xmm1,xmm5 - vmovdqa XMMWORD PTR 96[esp],xmm2 - xor edx,edi - shld ecx,ecx,5 - vpsrldq xmm0,xmm5,4 - add ebx,esi - and ebp,edx - vpxor xmm6,xmm6,xmm2 - xor edx,edi - add ebx,ecx - vpxor xmm0,xmm0,xmm4 - shrd ecx,ecx,7 - xor ebp,edi - vmovdqa XMMWORD PTR 16[esp],xmm1 - mov esi,ebx - add eax,DWORD PTR 36[esp] - vpxor xmm6,xmm6,xmm0 - xor ecx,edx - shld ebx,ebx,5 - add eax,ebp - and esi,ecx - vpsrld xmm0,xmm6,31 - xor ecx,edx - add eax,ebx - shrd ebx,ebx,7 - xor esi,edx - vpslldq xmm2,xmm6,12 - vpaddd xmm6,xmm6,xmm6 - mov ebp,eax - add edi,DWORD PTR 40[esp] - xor ebx,ecx - shld eax,eax,5 - vpsrld xmm1,xmm2,30 - vpor xmm6,xmm6,xmm0 - add edi,esi - and ebp,ebx - xor ebx,ecx - add edi,eax - vpslld xmm2,xmm2,2 - vmovdqa xmm0,XMMWORD PTR 64[esp] - shrd eax,eax,7 - xor ebp,ecx - vpxor xmm6,xmm6,xmm1 - mov esi,edi - add edx,DWORD PTR 44[esp] - xor eax,ebx - shld edi,edi,5 - vpxor xmm6,xmm6,xmm2 - add edx,ebp - and esi,eax - vmovdqa xmm2,XMMWORD PTR 112[esp] - xor eax,ebx - add edx,edi - shrd edi,edi,7 - xor esi,ebx - vpalignr xmm7,xmm4,xmm3,8 - mov ebp,edx - add ecx,DWORD PTR 48[esp] - vpaddd xmm2,xmm2,xmm6 - vmovdqa XMMWORD PTR 64[esp],xmm3 - xor edi,eax - shld edx,edx,5 - vpsrldq xmm1,xmm6,4 - add ecx,esi - and ebp,edi - vpxor xmm7,xmm7,xmm3 - xor edi,eax - add ecx,edx - vpxor xmm1,xmm1,xmm5 - shrd edx,edx,7 - xor ebp,eax - vmovdqa XMMWORD PTR 32[esp],xmm2 - mov esi,ecx - add ebx,DWORD PTR 52[esp] - vpxor xmm7,xmm7,xmm1 - xor edx,edi - shld ecx,ecx,5 - add ebx,ebp - and esi,edx - vpsrld xmm1,xmm7,31 - xor edx,edi - add ebx,ecx - shrd ecx,ecx,7 - xor esi,edi - vpslldq xmm3,xmm7,12 - vpaddd xmm7,xmm7,xmm7 - mov ebp,ebx - add eax,DWORD PTR 56[esp] - xor ecx,edx - shld ebx,ebx,5 - vpsrld xmm2,xmm3,30 - vpor xmm7,xmm7,xmm1 - add eax,esi - and ebp,ecx - xor ecx,edx - add eax,ebx - vpslld xmm3,xmm3,2 - vmovdqa xmm1,XMMWORD PTR 80[esp] - shrd ebx,ebx,7 - xor ebp,edx - vpxor xmm7,xmm7,xmm2 - mov esi,eax - add edi,DWORD PTR 60[esp] - xor ebx,ecx - shld eax,eax,5 - vpxor xmm7,xmm7,xmm3 - add edi,ebp - and esi,ebx - vmovdqa xmm3,XMMWORD PTR 112[esp] - xor ebx,ecx - add edi,eax - vpalignr xmm2,xmm7,xmm6,8 - vpxor xmm0,xmm0,xmm4 - shrd eax,eax,7 - xor esi,ecx - mov ebp,edi - add edx,DWORD PTR [esp] - vpxor xmm0,xmm0,xmm1 - vmovdqa XMMWORD PTR 80[esp],xmm4 - xor eax,ebx - shld edi,edi,5 - vmovdqa xmm4,xmm3 - vpaddd xmm3,xmm3,xmm7 - add edx,esi - and ebp,eax - vpxor xmm0,xmm0,xmm2 - xor eax,ebx - add edx,edi - shrd edi,edi,7 - xor ebp,ebx - vpsrld xmm2,xmm0,30 - vmovdqa XMMWORD PTR 48[esp],xmm3 - mov esi,edx - add ecx,DWORD PTR 4[esp] - xor edi,eax - shld edx,edx,5 - vpslld xmm0,xmm0,2 - add ecx,ebp - and esi,edi - xor edi,eax - add ecx,edx - shrd edx,edx,7 - xor esi,eax - mov ebp,ecx - add ebx,DWORD PTR 8[esp] - vpor xmm0,xmm0,xmm2 - xor edx,edi - shld ecx,ecx,5 - vmovdqa xmm2,XMMWORD PTR 96[esp] - add ebx,esi - and ebp,edx - xor edx,edi - add ebx,ecx - add eax,DWORD PTR 12[esp] - xor ebp,edi - mov esi,ebx - shld ebx,ebx,5 - add eax,ebp - xor esi,edx - shrd ecx,ecx,7 - add eax,ebx - vpalignr xmm3,xmm0,xmm7,8 - vpxor xmm1,xmm1,xmm5 - add edi,DWORD PTR 16[esp] - xor esi,ecx - mov ebp,eax - shld eax,eax,5 - vpxor xmm1,xmm1,xmm2 - vmovdqa XMMWORD PTR 96[esp],xmm5 - add edi,esi - xor ebp,ecx - vmovdqa xmm5,xmm4 - vpaddd xmm4,xmm4,xmm0 - shrd ebx,ebx,7 - add edi,eax - vpxor xmm1,xmm1,xmm3 - add edx,DWORD PTR 20[esp] - xor ebp,ebx - mov esi,edi - shld edi,edi,5 - vpsrld xmm3,xmm1,30 - vmovdqa XMMWORD PTR [esp],xmm4 - add edx,ebp - xor esi,ebx - shrd eax,eax,7 - add edx,edi - vpslld xmm1,xmm1,2 - add ecx,DWORD PTR 24[esp] - xor esi,eax - mov ebp,edx - shld edx,edx,5 - add ecx,esi - xor ebp,eax - shrd edi,edi,7 - add ecx,edx - vpor xmm1,xmm1,xmm3 - add ebx,DWORD PTR 28[esp] - xor ebp,edi - vmovdqa xmm3,XMMWORD PTR 64[esp] - mov esi,ecx - shld ecx,ecx,5 - add ebx,ebp - xor esi,edi - shrd edx,edx,7 - add ebx,ecx - vpalignr xmm4,xmm1,xmm0,8 - vpxor xmm2,xmm2,xmm6 - add eax,DWORD PTR 32[esp] - xor esi,edx - mov ebp,ebx - shld ebx,ebx,5 - vpxor xmm2,xmm2,xmm3 - vmovdqa XMMWORD PTR 64[esp],xmm6 - add eax,esi - xor ebp,edx - vmovdqa xmm6,XMMWORD PTR 128[esp] - vpaddd xmm5,xmm5,xmm1 - shrd ecx,ecx,7 - add eax,ebx - vpxor xmm2,xmm2,xmm4 - add edi,DWORD PTR 36[esp] - xor ebp,ecx - mov esi,eax - shld eax,eax,5 - vpsrld xmm4,xmm2,30 - vmovdqa XMMWORD PTR 16[esp],xmm5 - add edi,ebp - xor esi,ecx - shrd ebx,ebx,7 - add edi,eax - vpslld xmm2,xmm2,2 - add edx,DWORD PTR 40[esp] - xor esi,ebx - mov ebp,edi - shld edi,edi,5 - add edx,esi - xor ebp,ebx - shrd eax,eax,7 - add edx,edi - vpor xmm2,xmm2,xmm4 - add ecx,DWORD PTR 44[esp] - xor ebp,eax - vmovdqa xmm4,XMMWORD PTR 80[esp] - mov esi,edx - shld edx,edx,5 - add ecx,ebp - xor esi,eax - shrd edi,edi,7 - add ecx,edx - vpalignr xmm5,xmm2,xmm1,8 - vpxor xmm3,xmm3,xmm7 - add ebx,DWORD PTR 48[esp] - xor esi,edi - mov ebp,ecx - shld ecx,ecx,5 - vpxor xmm3,xmm3,xmm4 - vmovdqa XMMWORD PTR 80[esp],xmm7 - add ebx,esi - xor ebp,edi - vmovdqa xmm7,xmm6 - vpaddd xmm6,xmm6,xmm2 - shrd edx,edx,7 - add ebx,ecx - vpxor xmm3,xmm3,xmm5 - add eax,DWORD PTR 52[esp] - xor ebp,edx - mov esi,ebx - shld ebx,ebx,5 - vpsrld xmm5,xmm3,30 - vmovdqa XMMWORD PTR 32[esp],xmm6 - add eax,ebp - xor esi,edx - shrd ecx,ecx,7 - add eax,ebx - vpslld xmm3,xmm3,2 - add edi,DWORD PTR 56[esp] - xor esi,ecx - mov ebp,eax - shld eax,eax,5 - add edi,esi - xor ebp,ecx - shrd ebx,ebx,7 - add edi,eax - vpor xmm3,xmm3,xmm5 - add edx,DWORD PTR 60[esp] - xor ebp,ebx - vmovdqa xmm5,XMMWORD PTR 96[esp] - mov esi,edi - shld edi,edi,5 - add edx,ebp - xor esi,ebx - shrd eax,eax,7 - add edx,edi - vpalignr xmm6,xmm3,xmm2,8 - vpxor xmm4,xmm4,xmm0 - add ecx,DWORD PTR [esp] - xor esi,eax - mov ebp,edx - shld edx,edx,5 - vpxor xmm4,xmm4,xmm5 - vmovdqa XMMWORD PTR 96[esp],xmm0 - add ecx,esi - xor ebp,eax - vmovdqa xmm0,xmm7 - vpaddd xmm7,xmm7,xmm3 - shrd edi,edi,7 - add ecx,edx - vpxor xmm4,xmm4,xmm6 - add ebx,DWORD PTR 4[esp] - xor ebp,edi - mov esi,ecx - shld ecx,ecx,5 - vpsrld xmm6,xmm4,30 - vmovdqa XMMWORD PTR 48[esp],xmm7 - add ebx,ebp - xor esi,edi - shrd edx,edx,7 - add ebx,ecx - vpslld xmm4,xmm4,2 - add eax,DWORD PTR 8[esp] - xor esi,edx - mov ebp,ebx - shld ebx,ebx,5 - add eax,esi - xor ebp,edx - shrd ecx,ecx,7 - add eax,ebx - vpor xmm4,xmm4,xmm6 - add edi,DWORD PTR 12[esp] - xor ebp,ecx - vmovdqa xmm6,XMMWORD PTR 64[esp] - mov esi,eax - shld eax,eax,5 - add edi,ebp - xor esi,ecx - shrd ebx,ebx,7 - add edi,eax - vpalignr xmm7,xmm4,xmm3,8 - vpxor xmm5,xmm5,xmm1 - add edx,DWORD PTR 16[esp] - xor esi,ebx - mov ebp,edi - shld edi,edi,5 - vpxor xmm5,xmm5,xmm6 - vmovdqa XMMWORD PTR 64[esp],xmm1 - add edx,esi - xor ebp,ebx - vmovdqa xmm1,xmm0 - vpaddd xmm0,xmm0,xmm4 - shrd eax,eax,7 - add edx,edi - vpxor xmm5,xmm5,xmm7 - add ecx,DWORD PTR 20[esp] - xor ebp,eax - mov esi,edx - shld edx,edx,5 - vpsrld xmm7,xmm5,30 - vmovdqa XMMWORD PTR [esp],xmm0 - add ecx,ebp - xor esi,eax - shrd edi,edi,7 - add ecx,edx - vpslld xmm5,xmm5,2 - add ebx,DWORD PTR 24[esp] - xor esi,edi - mov ebp,ecx - shld ecx,ecx,5 - add ebx,esi - xor ebp,edi - shrd edx,edx,7 - add ebx,ecx - vpor xmm5,xmm5,xmm7 - add eax,DWORD PTR 28[esp] - vmovdqa xmm7,XMMWORD PTR 80[esp] - shrd ecx,ecx,7 - mov esi,ebx - xor ebp,edx - shld ebx,ebx,5 - add eax,ebp - xor esi,ecx - xor ecx,edx - add eax,ebx - vpalignr xmm0,xmm5,xmm4,8 - vpxor xmm6,xmm6,xmm2 - add edi,DWORD PTR 32[esp] - and esi,ecx - xor ecx,edx - shrd ebx,ebx,7 - vpxor xmm6,xmm6,xmm7 - vmovdqa XMMWORD PTR 80[esp],xmm2 - mov ebp,eax - xor esi,ecx - vmovdqa xmm2,xmm1 - vpaddd xmm1,xmm1,xmm5 - shld eax,eax,5 - add edi,esi - vpxor xmm6,xmm6,xmm0 - xor ebp,ebx - xor ebx,ecx - add edi,eax - add edx,DWORD PTR 36[esp] - vpsrld xmm0,xmm6,30 - vmovdqa XMMWORD PTR 16[esp],xmm1 - and ebp,ebx - xor ebx,ecx - shrd eax,eax,7 - mov esi,edi - vpslld xmm6,xmm6,2 - xor ebp,ebx - shld edi,edi,5 - add edx,ebp - xor esi,eax - xor eax,ebx - add edx,edi - add ecx,DWORD PTR 40[esp] - and esi,eax - vpor xmm6,xmm6,xmm0 - xor eax,ebx - shrd edi,edi,7 - vmovdqa xmm0,XMMWORD PTR 96[esp] - mov ebp,edx - xor esi,eax - shld edx,edx,5 - add ecx,esi - xor ebp,edi - xor edi,eax - add ecx,edx - add ebx,DWORD PTR 44[esp] - and ebp,edi - xor edi,eax - shrd edx,edx,7 - mov esi,ecx - xor ebp,edi - shld ecx,ecx,5 - add ebx,ebp - xor esi,edx - xor edx,edi - add ebx,ecx - vpalignr xmm1,xmm6,xmm5,8 - vpxor xmm7,xmm7,xmm3 - add eax,DWORD PTR 48[esp] - and esi,edx - xor edx,edi - shrd ecx,ecx,7 - vpxor xmm7,xmm7,xmm0 - vmovdqa XMMWORD PTR 96[esp],xmm3 - mov ebp,ebx - xor esi,edx - vmovdqa xmm3,XMMWORD PTR 144[esp] - vpaddd xmm2,xmm2,xmm6 - shld ebx,ebx,5 - add eax,esi - vpxor xmm7,xmm7,xmm1 - xor ebp,ecx - xor ecx,edx - add eax,ebx - add edi,DWORD PTR 52[esp] - vpsrld xmm1,xmm7,30 - vmovdqa XMMWORD PTR 32[esp],xmm2 - and ebp,ecx - xor ecx,edx - shrd ebx,ebx,7 - mov esi,eax - vpslld xmm7,xmm7,2 - xor ebp,ecx - shld eax,eax,5 - add edi,ebp - xor esi,ebx - xor ebx,ecx - add edi,eax - add edx,DWORD PTR 56[esp] - and esi,ebx - vpor xmm7,xmm7,xmm1 - xor ebx,ecx - shrd eax,eax,7 - vmovdqa xmm1,XMMWORD PTR 64[esp] - mov ebp,edi - xor esi,ebx - shld edi,edi,5 - add edx,esi - xor ebp,eax - xor eax,ebx - add edx,edi - add ecx,DWORD PTR 60[esp] - and ebp,eax - xor eax,ebx - shrd edi,edi,7 - mov esi,edx - xor ebp,eax - shld edx,edx,5 - add ecx,ebp - xor esi,edi - xor edi,eax - add ecx,edx - vpalignr xmm2,xmm7,xmm6,8 - vpxor xmm0,xmm0,xmm4 - add ebx,DWORD PTR [esp] - and esi,edi - xor edi,eax - shrd edx,edx,7 - vpxor xmm0,xmm0,xmm1 - vmovdqa XMMWORD PTR 64[esp],xmm4 - mov ebp,ecx - xor esi,edi - vmovdqa xmm4,xmm3 - vpaddd xmm3,xmm3,xmm7 - shld ecx,ecx,5 - add ebx,esi - vpxor xmm0,xmm0,xmm2 - xor ebp,edx - xor edx,edi - add ebx,ecx - add eax,DWORD PTR 4[esp] - vpsrld xmm2,xmm0,30 - vmovdqa XMMWORD PTR 48[esp],xmm3 - and ebp,edx - xor edx,edi - shrd ecx,ecx,7 - mov esi,ebx - vpslld xmm0,xmm0,2 - xor ebp,edx - shld ebx,ebx,5 - add eax,ebp - xor esi,ecx - xor ecx,edx - add eax,ebx - add edi,DWORD PTR 8[esp] - and esi,ecx - vpor xmm0,xmm0,xmm2 - xor ecx,edx - shrd ebx,ebx,7 - vmovdqa xmm2,XMMWORD PTR 80[esp] - mov ebp,eax - xor esi,ecx - shld eax,eax,5 - add edi,esi - xor ebp,ebx - xor ebx,ecx - add edi,eax - add edx,DWORD PTR 12[esp] - and ebp,ebx - xor ebx,ecx - shrd eax,eax,7 - mov esi,edi - xor ebp,ebx - shld edi,edi,5 - add edx,ebp - xor esi,eax - xor eax,ebx - add edx,edi - vpalignr xmm3,xmm0,xmm7,8 - vpxor xmm1,xmm1,xmm5 - add ecx,DWORD PTR 16[esp] - and esi,eax - xor eax,ebx - shrd edi,edi,7 - vpxor xmm1,xmm1,xmm2 - vmovdqa XMMWORD PTR 80[esp],xmm5 - mov ebp,edx - xor esi,eax - vmovdqa xmm5,xmm4 - vpaddd xmm4,xmm4,xmm0 - shld edx,edx,5 - add ecx,esi - vpxor xmm1,xmm1,xmm3 - xor ebp,edi - xor edi,eax - add ecx,edx - add ebx,DWORD PTR 20[esp] - vpsrld xmm3,xmm1,30 - vmovdqa XMMWORD PTR [esp],xmm4 - and ebp,edi - xor edi,eax - shrd edx,edx,7 - mov esi,ecx - vpslld xmm1,xmm1,2 - xor ebp,edi - shld ecx,ecx,5 - add ebx,ebp - xor esi,edx - xor edx,edi - add ebx,ecx - add eax,DWORD PTR 24[esp] - and esi,edx - vpor xmm1,xmm1,xmm3 - xor edx,edi - shrd ecx,ecx,7 - vmovdqa xmm3,XMMWORD PTR 96[esp] - mov ebp,ebx - xor esi,edx - shld ebx,ebx,5 - add eax,esi - xor ebp,ecx - xor ecx,edx - add eax,ebx - add edi,DWORD PTR 28[esp] - and ebp,ecx - xor ecx,edx - shrd ebx,ebx,7 - mov esi,eax - xor ebp,ecx - shld eax,eax,5 - add edi,ebp - xor esi,ebx - xor ebx,ecx - add edi,eax - vpalignr xmm4,xmm1,xmm0,8 - vpxor xmm2,xmm2,xmm6 - add edx,DWORD PTR 32[esp] - and esi,ebx - xor ebx,ecx - shrd eax,eax,7 - vpxor xmm2,xmm2,xmm3 - vmovdqa XMMWORD PTR 96[esp],xmm6 - mov ebp,edi - xor esi,ebx - vmovdqa xmm6,xmm5 - vpaddd xmm5,xmm5,xmm1 - shld edi,edi,5 - add edx,esi - vpxor xmm2,xmm2,xmm4 - xor ebp,eax - xor eax,ebx - add edx,edi - add ecx,DWORD PTR 36[esp] - vpsrld xmm4,xmm2,30 - vmovdqa XMMWORD PTR 16[esp],xmm5 - and ebp,eax - xor eax,ebx - shrd edi,edi,7 - mov esi,edx - vpslld xmm2,xmm2,2 - xor ebp,eax - shld edx,edx,5 - add ecx,ebp - xor esi,edi - xor edi,eax - add ecx,edx - add ebx,DWORD PTR 40[esp] - and esi,edi - vpor xmm2,xmm2,xmm4 - xor edi,eax - shrd edx,edx,7 - vmovdqa xmm4,XMMWORD PTR 64[esp] - mov ebp,ecx - xor esi,edi - shld ecx,ecx,5 - add ebx,esi - xor ebp,edx - xor edx,edi - add ebx,ecx - add eax,DWORD PTR 44[esp] - and ebp,edx - xor edx,edi - shrd ecx,ecx,7 - mov esi,ebx - xor ebp,edx - shld ebx,ebx,5 - add eax,ebp - xor esi,edx - add eax,ebx - vpalignr xmm5,xmm2,xmm1,8 - vpxor xmm3,xmm3,xmm7 - add edi,DWORD PTR 48[esp] - xor esi,ecx - mov ebp,eax - shld eax,eax,5 - vpxor xmm3,xmm3,xmm4 - vmovdqa XMMWORD PTR 64[esp],xmm7 - add edi,esi - xor ebp,ecx - vmovdqa xmm7,xmm6 - vpaddd xmm6,xmm6,xmm2 - shrd ebx,ebx,7 - add edi,eax - vpxor xmm3,xmm3,xmm5 - add edx,DWORD PTR 52[esp] - xor ebp,ebx - mov esi,edi - shld edi,edi,5 - vpsrld xmm5,xmm3,30 - vmovdqa XMMWORD PTR 32[esp],xmm6 - add edx,ebp - xor esi,ebx - shrd eax,eax,7 - add edx,edi - vpslld xmm3,xmm3,2 - add ecx,DWORD PTR 56[esp] - xor esi,eax - mov ebp,edx - shld edx,edx,5 - add ecx,esi - xor ebp,eax - shrd edi,edi,7 - add ecx,edx - vpor xmm3,xmm3,xmm5 - add ebx,DWORD PTR 60[esp] - xor ebp,edi - mov esi,ecx - shld ecx,ecx,5 - add ebx,ebp - xor esi,edi - shrd edx,edx,7 - add ebx,ecx - add eax,DWORD PTR [esp] - vpaddd xmm7,xmm7,xmm3 - xor esi,edx - mov ebp,ebx - shld ebx,ebx,5 - add eax,esi - vmovdqa XMMWORD PTR 48[esp],xmm7 - xor ebp,edx - shrd ecx,ecx,7 - add eax,ebx - add edi,DWORD PTR 4[esp] - xor ebp,ecx - mov esi,eax - shld eax,eax,5 - add edi,ebp - xor esi,ecx - shrd ebx,ebx,7 - add edi,eax - add edx,DWORD PTR 8[esp] - xor esi,ebx - mov ebp,edi - shld edi,edi,5 - add edx,esi - xor ebp,ebx - shrd eax,eax,7 - add edx,edi - add ecx,DWORD PTR 12[esp] - xor ebp,eax - mov esi,edx - shld edx,edx,5 - add ecx,ebp - xor esi,eax - shrd edi,edi,7 - add ecx,edx - mov ebp,DWORD PTR 196[esp] - cmp ebp,DWORD PTR 200[esp] - je $L010done - vmovdqa xmm7,XMMWORD PTR 160[esp] - vmovdqa xmm6,XMMWORD PTR 176[esp] - vmovdqu xmm0,XMMWORD PTR [ebp] - vmovdqu xmm1,XMMWORD PTR 16[ebp] - vmovdqu xmm2,XMMWORD PTR 32[ebp] - vmovdqu xmm3,XMMWORD PTR 48[ebp] - add ebp,64 - vpshufb xmm0,xmm0,xmm6 - mov DWORD PTR 196[esp],ebp - vmovdqa XMMWORD PTR 96[esp],xmm7 - add ebx,DWORD PTR 16[esp] - xor esi,edi - vpshufb xmm1,xmm1,xmm6 - mov ebp,ecx - shld ecx,ecx,5 - vpaddd xmm4,xmm0,xmm7 - add ebx,esi - xor ebp,edi - shrd edx,edx,7 - add ebx,ecx - vmovdqa XMMWORD PTR [esp],xmm4 - add eax,DWORD PTR 20[esp] - xor ebp,edx - mov esi,ebx - shld ebx,ebx,5 - add eax,ebp - xor esi,edx - shrd ecx,ecx,7 - add eax,ebx - add edi,DWORD PTR 24[esp] - xor esi,ecx - mov ebp,eax - shld eax,eax,5 - add edi,esi - xor ebp,ecx - shrd ebx,ebx,7 - add edi,eax - add edx,DWORD PTR 28[esp] - xor ebp,ebx - mov esi,edi - shld edi,edi,5 - add edx,ebp - xor esi,ebx - shrd eax,eax,7 - add edx,edi - add ecx,DWORD PTR 32[esp] - xor esi,eax - vpshufb xmm2,xmm2,xmm6 - mov ebp,edx - shld edx,edx,5 - vpaddd xmm5,xmm1,xmm7 - add ecx,esi - xor ebp,eax - shrd edi,edi,7 - add ecx,edx - vmovdqa XMMWORD PTR 16[esp],xmm5 - add ebx,DWORD PTR 36[esp] - xor ebp,edi - mov esi,ecx - shld ecx,ecx,5 - add ebx,ebp - xor esi,edi - shrd edx,edx,7 - add ebx,ecx - add eax,DWORD PTR 40[esp] - xor esi,edx - mov ebp,ebx - shld ebx,ebx,5 - add eax,esi - xor ebp,edx - shrd ecx,ecx,7 - add eax,ebx - add edi,DWORD PTR 44[esp] - xor ebp,ecx - mov esi,eax - shld eax,eax,5 - add edi,ebp - xor esi,ecx - shrd ebx,ebx,7 - add edi,eax - add edx,DWORD PTR 48[esp] - xor esi,ebx - vpshufb xmm3,xmm3,xmm6 - mov ebp,edi - shld edi,edi,5 - vpaddd xmm6,xmm2,xmm7 - add edx,esi - xor ebp,ebx - shrd eax,eax,7 - add edx,edi - vmovdqa XMMWORD PTR 32[esp],xmm6 - add ecx,DWORD PTR 52[esp] - xor ebp,eax - mov esi,edx - shld edx,edx,5 - add ecx,ebp - xor esi,eax - shrd edi,edi,7 - add ecx,edx - add ebx,DWORD PTR 56[esp] - xor esi,edi - mov ebp,ecx - shld ecx,ecx,5 - add ebx,esi - xor ebp,edi - shrd edx,edx,7 - add ebx,ecx - add eax,DWORD PTR 60[esp] - xor ebp,edx - mov esi,ebx - shld ebx,ebx,5 - add eax,ebp - shrd ecx,ecx,7 - add eax,ebx - mov ebp,DWORD PTR 192[esp] - add eax,DWORD PTR [ebp] - add esi,DWORD PTR 4[ebp] - add ecx,DWORD PTR 8[ebp] - mov DWORD PTR [ebp],eax - add edx,DWORD PTR 12[ebp] - mov DWORD PTR 4[ebp],esi - add edi,DWORD PTR 16[ebp] - mov ebx,ecx - mov DWORD PTR 8[ebp],ecx - xor ebx,edx - mov DWORD PTR 12[ebp],edx - mov DWORD PTR 16[ebp],edi - mov ebp,esi - and esi,ebx - mov ebx,ebp - jmp $L009loop -ALIGN 16 -$L010done: - add ebx,DWORD PTR 16[esp] - xor esi,edi - mov ebp,ecx - shld ecx,ecx,5 - add ebx,esi - xor ebp,edi - shrd edx,edx,7 - add ebx,ecx - add eax,DWORD PTR 20[esp] - xor ebp,edx - mov esi,ebx - shld ebx,ebx,5 - add eax,ebp - xor esi,edx - shrd ecx,ecx,7 - add eax,ebx - add edi,DWORD PTR 24[esp] - xor esi,ecx - mov ebp,eax - shld eax,eax,5 - add edi,esi - xor ebp,ecx - shrd ebx,ebx,7 - add edi,eax - add edx,DWORD PTR 28[esp] - xor ebp,ebx - mov esi,edi - shld edi,edi,5 - add edx,ebp - xor esi,ebx - shrd eax,eax,7 - add edx,edi - add ecx,DWORD PTR 32[esp] - xor esi,eax - mov ebp,edx - shld edx,edx,5 - add ecx,esi - xor ebp,eax - shrd edi,edi,7 - add ecx,edx - add ebx,DWORD PTR 36[esp] - xor ebp,edi - mov esi,ecx - shld ecx,ecx,5 - add ebx,ebp - xor esi,edi - shrd edx,edx,7 - add ebx,ecx - add eax,DWORD PTR 40[esp] - xor esi,edx - mov ebp,ebx - shld ebx,ebx,5 - add eax,esi - xor ebp,edx - shrd ecx,ecx,7 - add eax,ebx - add edi,DWORD PTR 44[esp] - xor ebp,ecx - mov esi,eax - shld eax,eax,5 - add edi,ebp - xor esi,ecx - shrd ebx,ebx,7 - add edi,eax - add edx,DWORD PTR 48[esp] - xor esi,ebx - mov ebp,edi - shld edi,edi,5 - add edx,esi - xor ebp,ebx - shrd eax,eax,7 - add edx,edi - add ecx,DWORD PTR 52[esp] - xor ebp,eax - mov esi,edx - shld edx,edx,5 - add ecx,ebp - xor esi,eax - shrd edi,edi,7 - add ecx,edx - add ebx,DWORD PTR 56[esp] - xor esi,edi - mov ebp,ecx - shld ecx,ecx,5 - add ebx,esi - xor ebp,edi - shrd edx,edx,7 - add ebx,ecx - add eax,DWORD PTR 60[esp] - xor ebp,edx - mov esi,ebx - shld ebx,ebx,5 - add eax,ebp - shrd ecx,ecx,7 - add eax,ebx - vzeroall - mov ebp,DWORD PTR 192[esp] - add eax,DWORD PTR [ebp] - mov esp,DWORD PTR 204[esp] - add esi,DWORD PTR 4[ebp] - add ecx,DWORD PTR 8[ebp] - mov DWORD PTR [ebp],eax - add edx,DWORD PTR 12[ebp] - mov DWORD PTR 4[ebp],esi - add edi,DWORD PTR 16[ebp] - mov DWORD PTR 8[ebp],ecx - mov DWORD PTR 12[ebp],edx - mov DWORD PTR 16[ebp],edi - pop edi - pop esi - pop ebx - pop ebp - ret -__sha1_block_data_order_avx ENDP ALIGN 64 $LK_XX_XX:: DD 1518500249,1518500249,1518500249,1518500249 diff --git a/deps/openssl/asm/x86-win32-masm/sha/sha256-586.asm b/deps/openssl/asm/x86-win32-masm/sha/sha256-586.asm index d184877bb717a2..b6af4ab0640332 100644 --- a/deps/openssl/asm/x86-win32-masm/sha/sha256-586.asm +++ b/deps/openssl/asm/x86-win32-masm/sha/sha256-586.asm @@ -56,13 +56,12 @@ $L000pic_point: or ecx,ebx and ecx,1342177280 cmp ecx,1342177280 - je $L005AVX test ebx,512 - jnz $L006SSSE3 + jnz $L005SSSE3 $L003no_xmm: sub eax,edi cmp eax,256 - jae $L007unrolled + jae $L006unrolled jmp $L002loop ALIGN 16 $L002loop: @@ -134,7 +133,7 @@ $L002loop: mov DWORD PTR 28[esp],ecx mov DWORD PTR 32[esp],edi ALIGN 16 -$L00800_15: +$L00700_15: mov ecx,edx mov esi,DWORD PTR 24[esp] ror ecx,14 @@ -172,11 +171,11 @@ $L00800_15: add ebp,4 add eax,ebx cmp esi,3248222580 - jne $L00800_15 + jne $L00700_15 mov ecx,DWORD PTR 156[esp] - jmp $L00916_63 + jmp $L00816_63 ALIGN 16 -$L00916_63: +$L00816_63: mov ebx,ecx mov esi,DWORD PTR 104[esp] ror ecx,11 @@ -231,7 +230,7 @@ $L00916_63: add ebp,4 add eax,ebx cmp esi,3329325298 - jne $L00916_63 + jne $L00816_63 mov esi,DWORD PTR 356[esp] mov ebx,DWORD PTR 8[esp] mov ecx,DWORD PTR 16[esp] @@ -290,7 +289,7 @@ DB 67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97 DB 112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103 DB 62,0 ALIGN 16 -$L007unrolled: +$L006unrolled: lea esp,DWORD PTR [esp-96] mov eax,DWORD PTR [esi] mov ebp,DWORD PTR 4[esi] @@ -307,9 +306,9 @@ $L007unrolled: mov DWORD PTR 20[esp],ebx mov DWORD PTR 24[esp],ecx mov DWORD PTR 28[esp],esi - jmp $L010grand_loop + jmp $L009grand_loop ALIGN 16 -$L010grand_loop: +$L009grand_loop: mov ebx,DWORD PTR [edi] mov ecx,DWORD PTR 4[edi] bswap ebx @@ -3189,7 +3188,7 @@ $L010grand_loop: mov DWORD PTR 24[esp],ebx mov DWORD PTR 28[esp],ecx cmp edi,DWORD PTR 104[esp] - jb $L010grand_loop + jb $L009grand_loop mov esp,DWORD PTR 108[esp] pop edi pop esi @@ -3208,9 +3207,9 @@ $L004shaext: pshufd xmm2,xmm2,27 DB 102,15,58,15,202,8 punpcklqdq xmm2,xmm0 - jmp $L011loop_shaext + jmp $L010loop_shaext ALIGN 16 -$L011loop_shaext: +$L010loop_shaext: movdqu xmm3,XMMWORD PTR [edi] movdqu xmm4,XMMWORD PTR 16[edi] movdqu xmm5,XMMWORD PTR 32[edi] @@ -3380,7 +3379,7 @@ DB 15,56,203,209 DB 15,56,203,202 paddd xmm2,XMMWORD PTR 16[esp] paddd xmm1,XMMWORD PTR [esp] - jnz $L011loop_shaext + jnz $L010loop_shaext pshufd xmm2,xmm2,177 pshufd xmm7,xmm1,27 pshufd xmm1,xmm1,177 @@ -3395,7 +3394,7 @@ DB 102,15,58,15,215,8 pop ebp ret ALIGN 32 -$L006SSSE3: +$L005SSSE3: lea esp,DWORD PTR [esp-96] mov eax,DWORD PTR [esi] mov ebx,DWORD PTR 4[esi] @@ -3414,9 +3413,9 @@ $L006SSSE3: mov DWORD PTR 24[esp],ecx mov DWORD PTR 28[esp],esi movdqa xmm7,XMMWORD PTR 256[ebp] - jmp $L012grand_ssse3 + jmp $L011grand_ssse3 ALIGN 16 -$L012grand_ssse3: +$L011grand_ssse3: movdqu xmm0,XMMWORD PTR [edi] movdqu xmm1,XMMWORD PTR 16[edi] movdqu xmm2,XMMWORD PTR 32[edi] @@ -3439,9 +3438,9 @@ DB 102,15,56,0,223 paddd xmm7,xmm3 movdqa XMMWORD PTR 64[esp],xmm6 movdqa XMMWORD PTR 80[esp],xmm7 - jmp $L013ssse3_00_47 + jmp $L012ssse3_00_47 ALIGN 16 -$L013ssse3_00_47: +$L012ssse3_00_47: add ebp,64 mov ecx,edx movdqa xmm4,xmm1 @@ -4084,7 +4083,7 @@ DB 102,15,58,15,249,4 add eax,ecx movdqa XMMWORD PTR 80[esp],xmm6 cmp DWORD PTR 64[ebp],66051 - jne $L013ssse3_00_47 + jne $L012ssse3_00_47 mov ecx,edx ror edx,14 mov esi,DWORD PTR 20[esp] @@ -4598,2218 +4597,13 @@ DB 102,15,58,15,249,4 movdqa xmm7,XMMWORD PTR 64[ebp] sub ebp,192 cmp edi,DWORD PTR 104[esp] - jb $L012grand_ssse3 + jb $L011grand_ssse3 mov esp,DWORD PTR 108[esp] pop edi pop esi pop ebx pop ebp ret -ALIGN 32 -$L005AVX: - and edx,264 - cmp edx,264 - je $L014AVX_BMI - lea esp,DWORD PTR [esp-96] - vzeroall - mov eax,DWORD PTR [esi] - mov ebx,DWORD PTR 4[esi] - mov ecx,DWORD PTR 8[esi] - mov edi,DWORD PTR 12[esi] - mov DWORD PTR 4[esp],ebx - xor ebx,ecx - mov DWORD PTR 8[esp],ecx - mov DWORD PTR 12[esp],edi - mov edx,DWORD PTR 16[esi] - mov edi,DWORD PTR 20[esi] - mov ecx,DWORD PTR 24[esi] - mov esi,DWORD PTR 28[esi] - mov DWORD PTR 20[esp],edi - mov edi,DWORD PTR 100[esp] - mov DWORD PTR 24[esp],ecx - mov DWORD PTR 28[esp],esi - vmovdqa xmm7,XMMWORD PTR 256[ebp] - jmp $L015grand_avx -ALIGN 32 -$L015grand_avx: - vmovdqu xmm0,XMMWORD PTR [edi] - vmovdqu xmm1,XMMWORD PTR 16[edi] - vmovdqu xmm2,XMMWORD PTR 32[edi] - vmovdqu xmm3,XMMWORD PTR 48[edi] - add edi,64 - vpshufb xmm0,xmm0,xmm7 - mov DWORD PTR 100[esp],edi - vpshufb xmm1,xmm1,xmm7 - vpshufb xmm2,xmm2,xmm7 - vpaddd xmm4,xmm0,XMMWORD PTR [ebp] - vpshufb xmm3,xmm3,xmm7 - vpaddd xmm5,xmm1,XMMWORD PTR 16[ebp] - vpaddd xmm6,xmm2,XMMWORD PTR 32[ebp] - vpaddd xmm7,xmm3,XMMWORD PTR 48[ebp] - vmovdqa XMMWORD PTR 32[esp],xmm4 - vmovdqa XMMWORD PTR 48[esp],xmm5 - vmovdqa XMMWORD PTR 64[esp],xmm6 - vmovdqa XMMWORD PTR 80[esp],xmm7 - jmp $L016avx_00_47 -ALIGN 16 -$L016avx_00_47: - add ebp,64 - vpalignr xmm4,xmm1,xmm0,4 - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 20[esp] - vpalignr xmm7,xmm3,xmm2,4 - xor edx,ecx - mov edi,DWORD PTR 24[esp] - xor esi,edi - vpsrld xmm6,xmm4,7 - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 16[esp],ecx - vpaddd xmm0,xmm0,xmm7 - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - vpsrld xmm7,xmm4,3 - mov ecx,eax - add edx,edi - mov edi,DWORD PTR 4[esp] - vpslld xmm5,xmm4,14 - mov esi,eax - shrd ecx,ecx,9 - mov DWORD PTR [esp],eax - vpxor xmm4,xmm7,xmm6 - xor ecx,eax - xor eax,edi - add edx,DWORD PTR 28[esp] - vpshufd xmm7,xmm3,250 - shrd ecx,ecx,11 - and ebx,eax - xor ecx,esi - vpsrld xmm6,xmm6,11 - add edx,DWORD PTR 32[esp] - xor ebx,edi - shrd ecx,ecx,2 - vpxor xmm4,xmm4,xmm5 - add ebx,edx - add edx,DWORD PTR 12[esp] - add ebx,ecx - vpslld xmm5,xmm5,11 - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 16[esp] - vpxor xmm4,xmm4,xmm6 - xor edx,ecx - mov edi,DWORD PTR 20[esp] - xor esi,edi - vpsrld xmm6,xmm7,10 - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 12[esp],ecx - vpxor xmm4,xmm4,xmm5 - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - vpsrlq xmm5,xmm7,17 - mov ecx,ebx - add edx,edi - mov edi,DWORD PTR [esp] - vpaddd xmm0,xmm0,xmm4 - mov esi,ebx - shrd ecx,ecx,9 - mov DWORD PTR 28[esp],ebx - vpxor xmm6,xmm6,xmm5 - xor ecx,ebx - xor ebx,edi - add edx,DWORD PTR 24[esp] - vpsrlq xmm7,xmm7,19 - shrd ecx,ecx,11 - and eax,ebx - xor ecx,esi - vpxor xmm6,xmm6,xmm7 - add edx,DWORD PTR 36[esp] - xor eax,edi - shrd ecx,ecx,2 - vpshufd xmm7,xmm6,132 - add eax,edx - add edx,DWORD PTR 8[esp] - add eax,ecx - vpsrldq xmm7,xmm7,8 - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 12[esp] - vpaddd xmm0,xmm0,xmm7 - xor edx,ecx - mov edi,DWORD PTR 16[esp] - xor esi,edi - vpshufd xmm7,xmm0,80 - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 8[esp],ecx - vpsrld xmm6,xmm7,10 - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - vpsrlq xmm5,xmm7,17 - mov ecx,eax - add edx,edi - mov edi,DWORD PTR 28[esp] - vpxor xmm6,xmm6,xmm5 - mov esi,eax - shrd ecx,ecx,9 - mov DWORD PTR 24[esp],eax - vpsrlq xmm7,xmm7,19 - xor ecx,eax - xor eax,edi - add edx,DWORD PTR 20[esp] - vpxor xmm6,xmm6,xmm7 - shrd ecx,ecx,11 - and ebx,eax - xor ecx,esi - vpshufd xmm7,xmm6,232 - add edx,DWORD PTR 40[esp] - xor ebx,edi - shrd ecx,ecx,2 - vpslldq xmm7,xmm7,8 - add ebx,edx - add edx,DWORD PTR 4[esp] - add ebx,ecx - vpaddd xmm0,xmm0,xmm7 - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 8[esp] - vpaddd xmm6,xmm0,XMMWORD PTR [ebp] - xor edx,ecx - mov edi,DWORD PTR 12[esp] - xor esi,edi - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 4[esp],ecx - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - mov ecx,ebx - add edx,edi - mov edi,DWORD PTR 24[esp] - mov esi,ebx - shrd ecx,ecx,9 - mov DWORD PTR 20[esp],ebx - xor ecx,ebx - xor ebx,edi - add edx,DWORD PTR 16[esp] - shrd ecx,ecx,11 - and eax,ebx - xor ecx,esi - add edx,DWORD PTR 44[esp] - xor eax,edi - shrd ecx,ecx,2 - add eax,edx - add edx,DWORD PTR [esp] - add eax,ecx - vmovdqa XMMWORD PTR 32[esp],xmm6 - vpalignr xmm4,xmm2,xmm1,4 - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 4[esp] - vpalignr xmm7,xmm0,xmm3,4 - xor edx,ecx - mov edi,DWORD PTR 8[esp] - xor esi,edi - vpsrld xmm6,xmm4,7 - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR [esp],ecx - vpaddd xmm1,xmm1,xmm7 - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - vpsrld xmm7,xmm4,3 - mov ecx,eax - add edx,edi - mov edi,DWORD PTR 20[esp] - vpslld xmm5,xmm4,14 - mov esi,eax - shrd ecx,ecx,9 - mov DWORD PTR 16[esp],eax - vpxor xmm4,xmm7,xmm6 - xor ecx,eax - xor eax,edi - add edx,DWORD PTR 12[esp] - vpshufd xmm7,xmm0,250 - shrd ecx,ecx,11 - and ebx,eax - xor ecx,esi - vpsrld xmm6,xmm6,11 - add edx,DWORD PTR 48[esp] - xor ebx,edi - shrd ecx,ecx,2 - vpxor xmm4,xmm4,xmm5 - add ebx,edx - add edx,DWORD PTR 28[esp] - add ebx,ecx - vpslld xmm5,xmm5,11 - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR [esp] - vpxor xmm4,xmm4,xmm6 - xor edx,ecx - mov edi,DWORD PTR 4[esp] - xor esi,edi - vpsrld xmm6,xmm7,10 - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 28[esp],ecx - vpxor xmm4,xmm4,xmm5 - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - vpsrlq xmm5,xmm7,17 - mov ecx,ebx - add edx,edi - mov edi,DWORD PTR 16[esp] - vpaddd xmm1,xmm1,xmm4 - mov esi,ebx - shrd ecx,ecx,9 - mov DWORD PTR 12[esp],ebx - vpxor xmm6,xmm6,xmm5 - xor ecx,ebx - xor ebx,edi - add edx,DWORD PTR 8[esp] - vpsrlq xmm7,xmm7,19 - shrd ecx,ecx,11 - and eax,ebx - xor ecx,esi - vpxor xmm6,xmm6,xmm7 - add edx,DWORD PTR 52[esp] - xor eax,edi - shrd ecx,ecx,2 - vpshufd xmm7,xmm6,132 - add eax,edx - add edx,DWORD PTR 24[esp] - add eax,ecx - vpsrldq xmm7,xmm7,8 - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 28[esp] - vpaddd xmm1,xmm1,xmm7 - xor edx,ecx - mov edi,DWORD PTR [esp] - xor esi,edi - vpshufd xmm7,xmm1,80 - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 24[esp],ecx - vpsrld xmm6,xmm7,10 - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - vpsrlq xmm5,xmm7,17 - mov ecx,eax - add edx,edi - mov edi,DWORD PTR 12[esp] - vpxor xmm6,xmm6,xmm5 - mov esi,eax - shrd ecx,ecx,9 - mov DWORD PTR 8[esp],eax - vpsrlq xmm7,xmm7,19 - xor ecx,eax - xor eax,edi - add edx,DWORD PTR 4[esp] - vpxor xmm6,xmm6,xmm7 - shrd ecx,ecx,11 - and ebx,eax - xor ecx,esi - vpshufd xmm7,xmm6,232 - add edx,DWORD PTR 56[esp] - xor ebx,edi - shrd ecx,ecx,2 - vpslldq xmm7,xmm7,8 - add ebx,edx - add edx,DWORD PTR 20[esp] - add ebx,ecx - vpaddd xmm1,xmm1,xmm7 - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 24[esp] - vpaddd xmm6,xmm1,XMMWORD PTR 16[ebp] - xor edx,ecx - mov edi,DWORD PTR 28[esp] - xor esi,edi - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 20[esp],ecx - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - mov ecx,ebx - add edx,edi - mov edi,DWORD PTR 8[esp] - mov esi,ebx - shrd ecx,ecx,9 - mov DWORD PTR 4[esp],ebx - xor ecx,ebx - xor ebx,edi - add edx,DWORD PTR [esp] - shrd ecx,ecx,11 - and eax,ebx - xor ecx,esi - add edx,DWORD PTR 60[esp] - xor eax,edi - shrd ecx,ecx,2 - add eax,edx - add edx,DWORD PTR 16[esp] - add eax,ecx - vmovdqa XMMWORD PTR 48[esp],xmm6 - vpalignr xmm4,xmm3,xmm2,4 - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 20[esp] - vpalignr xmm7,xmm1,xmm0,4 - xor edx,ecx - mov edi,DWORD PTR 24[esp] - xor esi,edi - vpsrld xmm6,xmm4,7 - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 16[esp],ecx - vpaddd xmm2,xmm2,xmm7 - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - vpsrld xmm7,xmm4,3 - mov ecx,eax - add edx,edi - mov edi,DWORD PTR 4[esp] - vpslld xmm5,xmm4,14 - mov esi,eax - shrd ecx,ecx,9 - mov DWORD PTR [esp],eax - vpxor xmm4,xmm7,xmm6 - xor ecx,eax - xor eax,edi - add edx,DWORD PTR 28[esp] - vpshufd xmm7,xmm1,250 - shrd ecx,ecx,11 - and ebx,eax - xor ecx,esi - vpsrld xmm6,xmm6,11 - add edx,DWORD PTR 64[esp] - xor ebx,edi - shrd ecx,ecx,2 - vpxor xmm4,xmm4,xmm5 - add ebx,edx - add edx,DWORD PTR 12[esp] - add ebx,ecx - vpslld xmm5,xmm5,11 - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 16[esp] - vpxor xmm4,xmm4,xmm6 - xor edx,ecx - mov edi,DWORD PTR 20[esp] - xor esi,edi - vpsrld xmm6,xmm7,10 - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 12[esp],ecx - vpxor xmm4,xmm4,xmm5 - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - vpsrlq xmm5,xmm7,17 - mov ecx,ebx - add edx,edi - mov edi,DWORD PTR [esp] - vpaddd xmm2,xmm2,xmm4 - mov esi,ebx - shrd ecx,ecx,9 - mov DWORD PTR 28[esp],ebx - vpxor xmm6,xmm6,xmm5 - xor ecx,ebx - xor ebx,edi - add edx,DWORD PTR 24[esp] - vpsrlq xmm7,xmm7,19 - shrd ecx,ecx,11 - and eax,ebx - xor ecx,esi - vpxor xmm6,xmm6,xmm7 - add edx,DWORD PTR 68[esp] - xor eax,edi - shrd ecx,ecx,2 - vpshufd xmm7,xmm6,132 - add eax,edx - add edx,DWORD PTR 8[esp] - add eax,ecx - vpsrldq xmm7,xmm7,8 - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 12[esp] - vpaddd xmm2,xmm2,xmm7 - xor edx,ecx - mov edi,DWORD PTR 16[esp] - xor esi,edi - vpshufd xmm7,xmm2,80 - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 8[esp],ecx - vpsrld xmm6,xmm7,10 - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - vpsrlq xmm5,xmm7,17 - mov ecx,eax - add edx,edi - mov edi,DWORD PTR 28[esp] - vpxor xmm6,xmm6,xmm5 - mov esi,eax - shrd ecx,ecx,9 - mov DWORD PTR 24[esp],eax - vpsrlq xmm7,xmm7,19 - xor ecx,eax - xor eax,edi - add edx,DWORD PTR 20[esp] - vpxor xmm6,xmm6,xmm7 - shrd ecx,ecx,11 - and ebx,eax - xor ecx,esi - vpshufd xmm7,xmm6,232 - add edx,DWORD PTR 72[esp] - xor ebx,edi - shrd ecx,ecx,2 - vpslldq xmm7,xmm7,8 - add ebx,edx - add edx,DWORD PTR 4[esp] - add ebx,ecx - vpaddd xmm2,xmm2,xmm7 - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 8[esp] - vpaddd xmm6,xmm2,XMMWORD PTR 32[ebp] - xor edx,ecx - mov edi,DWORD PTR 12[esp] - xor esi,edi - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 4[esp],ecx - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - mov ecx,ebx - add edx,edi - mov edi,DWORD PTR 24[esp] - mov esi,ebx - shrd ecx,ecx,9 - mov DWORD PTR 20[esp],ebx - xor ecx,ebx - xor ebx,edi - add edx,DWORD PTR 16[esp] - shrd ecx,ecx,11 - and eax,ebx - xor ecx,esi - add edx,DWORD PTR 76[esp] - xor eax,edi - shrd ecx,ecx,2 - add eax,edx - add edx,DWORD PTR [esp] - add eax,ecx - vmovdqa XMMWORD PTR 64[esp],xmm6 - vpalignr xmm4,xmm0,xmm3,4 - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 4[esp] - vpalignr xmm7,xmm2,xmm1,4 - xor edx,ecx - mov edi,DWORD PTR 8[esp] - xor esi,edi - vpsrld xmm6,xmm4,7 - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR [esp],ecx - vpaddd xmm3,xmm3,xmm7 - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - vpsrld xmm7,xmm4,3 - mov ecx,eax - add edx,edi - mov edi,DWORD PTR 20[esp] - vpslld xmm5,xmm4,14 - mov esi,eax - shrd ecx,ecx,9 - mov DWORD PTR 16[esp],eax - vpxor xmm4,xmm7,xmm6 - xor ecx,eax - xor eax,edi - add edx,DWORD PTR 12[esp] - vpshufd xmm7,xmm2,250 - shrd ecx,ecx,11 - and ebx,eax - xor ecx,esi - vpsrld xmm6,xmm6,11 - add edx,DWORD PTR 80[esp] - xor ebx,edi - shrd ecx,ecx,2 - vpxor xmm4,xmm4,xmm5 - add ebx,edx - add edx,DWORD PTR 28[esp] - add ebx,ecx - vpslld xmm5,xmm5,11 - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR [esp] - vpxor xmm4,xmm4,xmm6 - xor edx,ecx - mov edi,DWORD PTR 4[esp] - xor esi,edi - vpsrld xmm6,xmm7,10 - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 28[esp],ecx - vpxor xmm4,xmm4,xmm5 - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - vpsrlq xmm5,xmm7,17 - mov ecx,ebx - add edx,edi - mov edi,DWORD PTR 16[esp] - vpaddd xmm3,xmm3,xmm4 - mov esi,ebx - shrd ecx,ecx,9 - mov DWORD PTR 12[esp],ebx - vpxor xmm6,xmm6,xmm5 - xor ecx,ebx - xor ebx,edi - add edx,DWORD PTR 8[esp] - vpsrlq xmm7,xmm7,19 - shrd ecx,ecx,11 - and eax,ebx - xor ecx,esi - vpxor xmm6,xmm6,xmm7 - add edx,DWORD PTR 84[esp] - xor eax,edi - shrd ecx,ecx,2 - vpshufd xmm7,xmm6,132 - add eax,edx - add edx,DWORD PTR 24[esp] - add eax,ecx - vpsrldq xmm7,xmm7,8 - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 28[esp] - vpaddd xmm3,xmm3,xmm7 - xor edx,ecx - mov edi,DWORD PTR [esp] - xor esi,edi - vpshufd xmm7,xmm3,80 - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 24[esp],ecx - vpsrld xmm6,xmm7,10 - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - vpsrlq xmm5,xmm7,17 - mov ecx,eax - add edx,edi - mov edi,DWORD PTR 12[esp] - vpxor xmm6,xmm6,xmm5 - mov esi,eax - shrd ecx,ecx,9 - mov DWORD PTR 8[esp],eax - vpsrlq xmm7,xmm7,19 - xor ecx,eax - xor eax,edi - add edx,DWORD PTR 4[esp] - vpxor xmm6,xmm6,xmm7 - shrd ecx,ecx,11 - and ebx,eax - xor ecx,esi - vpshufd xmm7,xmm6,232 - add edx,DWORD PTR 88[esp] - xor ebx,edi - shrd ecx,ecx,2 - vpslldq xmm7,xmm7,8 - add ebx,edx - add edx,DWORD PTR 20[esp] - add ebx,ecx - vpaddd xmm3,xmm3,xmm7 - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 24[esp] - vpaddd xmm6,xmm3,XMMWORD PTR 48[ebp] - xor edx,ecx - mov edi,DWORD PTR 28[esp] - xor esi,edi - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 20[esp],ecx - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - mov ecx,ebx - add edx,edi - mov edi,DWORD PTR 8[esp] - mov esi,ebx - shrd ecx,ecx,9 - mov DWORD PTR 4[esp],ebx - xor ecx,ebx - xor ebx,edi - add edx,DWORD PTR [esp] - shrd ecx,ecx,11 - and eax,ebx - xor ecx,esi - add edx,DWORD PTR 92[esp] - xor eax,edi - shrd ecx,ecx,2 - add eax,edx - add edx,DWORD PTR 16[esp] - add eax,ecx - vmovdqa XMMWORD PTR 80[esp],xmm6 - cmp DWORD PTR 64[ebp],66051 - jne $L016avx_00_47 - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 20[esp] - xor edx,ecx - mov edi,DWORD PTR 24[esp] - xor esi,edi - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 16[esp],ecx - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - mov ecx,eax - add edx,edi - mov edi,DWORD PTR 4[esp] - mov esi,eax - shrd ecx,ecx,9 - mov DWORD PTR [esp],eax - xor ecx,eax - xor eax,edi - add edx,DWORD PTR 28[esp] - shrd ecx,ecx,11 - and ebx,eax - xor ecx,esi - add edx,DWORD PTR 32[esp] - xor ebx,edi - shrd ecx,ecx,2 - add ebx,edx - add edx,DWORD PTR 12[esp] - add ebx,ecx - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 16[esp] - xor edx,ecx - mov edi,DWORD PTR 20[esp] - xor esi,edi - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 12[esp],ecx - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - mov ecx,ebx - add edx,edi - mov edi,DWORD PTR [esp] - mov esi,ebx - shrd ecx,ecx,9 - mov DWORD PTR 28[esp],ebx - xor ecx,ebx - xor ebx,edi - add edx,DWORD PTR 24[esp] - shrd ecx,ecx,11 - and eax,ebx - xor ecx,esi - add edx,DWORD PTR 36[esp] - xor eax,edi - shrd ecx,ecx,2 - add eax,edx - add edx,DWORD PTR 8[esp] - add eax,ecx - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 12[esp] - xor edx,ecx - mov edi,DWORD PTR 16[esp] - xor esi,edi - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 8[esp],ecx - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - mov ecx,eax - add edx,edi - mov edi,DWORD PTR 28[esp] - mov esi,eax - shrd ecx,ecx,9 - mov DWORD PTR 24[esp],eax - xor ecx,eax - xor eax,edi - add edx,DWORD PTR 20[esp] - shrd ecx,ecx,11 - and ebx,eax - xor ecx,esi - add edx,DWORD PTR 40[esp] - xor ebx,edi - shrd ecx,ecx,2 - add ebx,edx - add edx,DWORD PTR 4[esp] - add ebx,ecx - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 8[esp] - xor edx,ecx - mov edi,DWORD PTR 12[esp] - xor esi,edi - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 4[esp],ecx - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - mov ecx,ebx - add edx,edi - mov edi,DWORD PTR 24[esp] - mov esi,ebx - shrd ecx,ecx,9 - mov DWORD PTR 20[esp],ebx - xor ecx,ebx - xor ebx,edi - add edx,DWORD PTR 16[esp] - shrd ecx,ecx,11 - and eax,ebx - xor ecx,esi - add edx,DWORD PTR 44[esp] - xor eax,edi - shrd ecx,ecx,2 - add eax,edx - add edx,DWORD PTR [esp] - add eax,ecx - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 4[esp] - xor edx,ecx - mov edi,DWORD PTR 8[esp] - xor esi,edi - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR [esp],ecx - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - mov ecx,eax - add edx,edi - mov edi,DWORD PTR 20[esp] - mov esi,eax - shrd ecx,ecx,9 - mov DWORD PTR 16[esp],eax - xor ecx,eax - xor eax,edi - add edx,DWORD PTR 12[esp] - shrd ecx,ecx,11 - and ebx,eax - xor ecx,esi - add edx,DWORD PTR 48[esp] - xor ebx,edi - shrd ecx,ecx,2 - add ebx,edx - add edx,DWORD PTR 28[esp] - add ebx,ecx - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR [esp] - xor edx,ecx - mov edi,DWORD PTR 4[esp] - xor esi,edi - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 28[esp],ecx - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - mov ecx,ebx - add edx,edi - mov edi,DWORD PTR 16[esp] - mov esi,ebx - shrd ecx,ecx,9 - mov DWORD PTR 12[esp],ebx - xor ecx,ebx - xor ebx,edi - add edx,DWORD PTR 8[esp] - shrd ecx,ecx,11 - and eax,ebx - xor ecx,esi - add edx,DWORD PTR 52[esp] - xor eax,edi - shrd ecx,ecx,2 - add eax,edx - add edx,DWORD PTR 24[esp] - add eax,ecx - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 28[esp] - xor edx,ecx - mov edi,DWORD PTR [esp] - xor esi,edi - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 24[esp],ecx - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - mov ecx,eax - add edx,edi - mov edi,DWORD PTR 12[esp] - mov esi,eax - shrd ecx,ecx,9 - mov DWORD PTR 8[esp],eax - xor ecx,eax - xor eax,edi - add edx,DWORD PTR 4[esp] - shrd ecx,ecx,11 - and ebx,eax - xor ecx,esi - add edx,DWORD PTR 56[esp] - xor ebx,edi - shrd ecx,ecx,2 - add ebx,edx - add edx,DWORD PTR 20[esp] - add ebx,ecx - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 24[esp] - xor edx,ecx - mov edi,DWORD PTR 28[esp] - xor esi,edi - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 20[esp],ecx - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - mov ecx,ebx - add edx,edi - mov edi,DWORD PTR 8[esp] - mov esi,ebx - shrd ecx,ecx,9 - mov DWORD PTR 4[esp],ebx - xor ecx,ebx - xor ebx,edi - add edx,DWORD PTR [esp] - shrd ecx,ecx,11 - and eax,ebx - xor ecx,esi - add edx,DWORD PTR 60[esp] - xor eax,edi - shrd ecx,ecx,2 - add eax,edx - add edx,DWORD PTR 16[esp] - add eax,ecx - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 20[esp] - xor edx,ecx - mov edi,DWORD PTR 24[esp] - xor esi,edi - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 16[esp],ecx - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - mov ecx,eax - add edx,edi - mov edi,DWORD PTR 4[esp] - mov esi,eax - shrd ecx,ecx,9 - mov DWORD PTR [esp],eax - xor ecx,eax - xor eax,edi - add edx,DWORD PTR 28[esp] - shrd ecx,ecx,11 - and ebx,eax - xor ecx,esi - add edx,DWORD PTR 64[esp] - xor ebx,edi - shrd ecx,ecx,2 - add ebx,edx - add edx,DWORD PTR 12[esp] - add ebx,ecx - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 16[esp] - xor edx,ecx - mov edi,DWORD PTR 20[esp] - xor esi,edi - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 12[esp],ecx - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - mov ecx,ebx - add edx,edi - mov edi,DWORD PTR [esp] - mov esi,ebx - shrd ecx,ecx,9 - mov DWORD PTR 28[esp],ebx - xor ecx,ebx - xor ebx,edi - add edx,DWORD PTR 24[esp] - shrd ecx,ecx,11 - and eax,ebx - xor ecx,esi - add edx,DWORD PTR 68[esp] - xor eax,edi - shrd ecx,ecx,2 - add eax,edx - add edx,DWORD PTR 8[esp] - add eax,ecx - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 12[esp] - xor edx,ecx - mov edi,DWORD PTR 16[esp] - xor esi,edi - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 8[esp],ecx - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - mov ecx,eax - add edx,edi - mov edi,DWORD PTR 28[esp] - mov esi,eax - shrd ecx,ecx,9 - mov DWORD PTR 24[esp],eax - xor ecx,eax - xor eax,edi - add edx,DWORD PTR 20[esp] - shrd ecx,ecx,11 - and ebx,eax - xor ecx,esi - add edx,DWORD PTR 72[esp] - xor ebx,edi - shrd ecx,ecx,2 - add ebx,edx - add edx,DWORD PTR 4[esp] - add ebx,ecx - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 8[esp] - xor edx,ecx - mov edi,DWORD PTR 12[esp] - xor esi,edi - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 4[esp],ecx - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - mov ecx,ebx - add edx,edi - mov edi,DWORD PTR 24[esp] - mov esi,ebx - shrd ecx,ecx,9 - mov DWORD PTR 20[esp],ebx - xor ecx,ebx - xor ebx,edi - add edx,DWORD PTR 16[esp] - shrd ecx,ecx,11 - and eax,ebx - xor ecx,esi - add edx,DWORD PTR 76[esp] - xor eax,edi - shrd ecx,ecx,2 - add eax,edx - add edx,DWORD PTR [esp] - add eax,ecx - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 4[esp] - xor edx,ecx - mov edi,DWORD PTR 8[esp] - xor esi,edi - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR [esp],ecx - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - mov ecx,eax - add edx,edi - mov edi,DWORD PTR 20[esp] - mov esi,eax - shrd ecx,ecx,9 - mov DWORD PTR 16[esp],eax - xor ecx,eax - xor eax,edi - add edx,DWORD PTR 12[esp] - shrd ecx,ecx,11 - and ebx,eax - xor ecx,esi - add edx,DWORD PTR 80[esp] - xor ebx,edi - shrd ecx,ecx,2 - add ebx,edx - add edx,DWORD PTR 28[esp] - add ebx,ecx - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR [esp] - xor edx,ecx - mov edi,DWORD PTR 4[esp] - xor esi,edi - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 28[esp],ecx - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - mov ecx,ebx - add edx,edi - mov edi,DWORD PTR 16[esp] - mov esi,ebx - shrd ecx,ecx,9 - mov DWORD PTR 12[esp],ebx - xor ecx,ebx - xor ebx,edi - add edx,DWORD PTR 8[esp] - shrd ecx,ecx,11 - and eax,ebx - xor ecx,esi - add edx,DWORD PTR 84[esp] - xor eax,edi - shrd ecx,ecx,2 - add eax,edx - add edx,DWORD PTR 24[esp] - add eax,ecx - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 28[esp] - xor edx,ecx - mov edi,DWORD PTR [esp] - xor esi,edi - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 24[esp],ecx - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - mov ecx,eax - add edx,edi - mov edi,DWORD PTR 12[esp] - mov esi,eax - shrd ecx,ecx,9 - mov DWORD PTR 8[esp],eax - xor ecx,eax - xor eax,edi - add edx,DWORD PTR 4[esp] - shrd ecx,ecx,11 - and ebx,eax - xor ecx,esi - add edx,DWORD PTR 88[esp] - xor ebx,edi - shrd ecx,ecx,2 - add ebx,edx - add edx,DWORD PTR 20[esp] - add ebx,ecx - mov ecx,edx - shrd edx,edx,14 - mov esi,DWORD PTR 24[esp] - xor edx,ecx - mov edi,DWORD PTR 28[esp] - xor esi,edi - shrd edx,edx,5 - and esi,ecx - mov DWORD PTR 20[esp],ecx - xor edx,ecx - xor edi,esi - shrd edx,edx,6 - mov ecx,ebx - add edx,edi - mov edi,DWORD PTR 8[esp] - mov esi,ebx - shrd ecx,ecx,9 - mov DWORD PTR 4[esp],ebx - xor ecx,ebx - xor ebx,edi - add edx,DWORD PTR [esp] - shrd ecx,ecx,11 - and eax,ebx - xor ecx,esi - add edx,DWORD PTR 92[esp] - xor eax,edi - shrd ecx,ecx,2 - add eax,edx - add edx,DWORD PTR 16[esp] - add eax,ecx - mov esi,DWORD PTR 96[esp] - xor ebx,edi - mov ecx,DWORD PTR 12[esp] - add eax,DWORD PTR [esi] - add ebx,DWORD PTR 4[esi] - add edi,DWORD PTR 8[esi] - add ecx,DWORD PTR 12[esi] - mov DWORD PTR [esi],eax - mov DWORD PTR 4[esi],ebx - mov DWORD PTR 8[esi],edi - mov DWORD PTR 12[esi],ecx - mov DWORD PTR 4[esp],ebx - xor ebx,edi - mov DWORD PTR 8[esp],edi - mov DWORD PTR 12[esp],ecx - mov edi,DWORD PTR 20[esp] - mov ecx,DWORD PTR 24[esp] - add edx,DWORD PTR 16[esi] - add edi,DWORD PTR 20[esi] - add ecx,DWORD PTR 24[esi] - mov DWORD PTR 16[esi],edx - mov DWORD PTR 20[esi],edi - mov DWORD PTR 20[esp],edi - mov edi,DWORD PTR 28[esp] - mov DWORD PTR 24[esi],ecx - add edi,DWORD PTR 28[esi] - mov DWORD PTR 24[esp],ecx - mov DWORD PTR 28[esi],edi - mov DWORD PTR 28[esp],edi - mov edi,DWORD PTR 100[esp] - vmovdqa xmm7,XMMWORD PTR 64[ebp] - sub ebp,192 - cmp edi,DWORD PTR 104[esp] - jb $L015grand_avx - mov esp,DWORD PTR 108[esp] - vzeroall - pop edi - pop esi - pop ebx - pop ebp - ret -ALIGN 32 -$L014AVX_BMI: - lea esp,DWORD PTR [esp-96] - vzeroall - mov eax,DWORD PTR [esi] - mov ebx,DWORD PTR 4[esi] - mov ecx,DWORD PTR 8[esi] - mov edi,DWORD PTR 12[esi] - mov DWORD PTR 4[esp],ebx - xor ebx,ecx - mov DWORD PTR 8[esp],ecx - mov DWORD PTR 12[esp],edi - mov edx,DWORD PTR 16[esi] - mov edi,DWORD PTR 20[esi] - mov ecx,DWORD PTR 24[esi] - mov esi,DWORD PTR 28[esi] - mov DWORD PTR 20[esp],edi - mov edi,DWORD PTR 100[esp] - mov DWORD PTR 24[esp],ecx - mov DWORD PTR 28[esp],esi - vmovdqa xmm7,XMMWORD PTR 256[ebp] - jmp $L017grand_avx_bmi -ALIGN 32 -$L017grand_avx_bmi: - vmovdqu xmm0,XMMWORD PTR [edi] - vmovdqu xmm1,XMMWORD PTR 16[edi] - vmovdqu xmm2,XMMWORD PTR 32[edi] - vmovdqu xmm3,XMMWORD PTR 48[edi] - add edi,64 - vpshufb xmm0,xmm0,xmm7 - mov DWORD PTR 100[esp],edi - vpshufb xmm1,xmm1,xmm7 - vpshufb xmm2,xmm2,xmm7 - vpaddd xmm4,xmm0,XMMWORD PTR [ebp] - vpshufb xmm3,xmm3,xmm7 - vpaddd xmm5,xmm1,XMMWORD PTR 16[ebp] - vpaddd xmm6,xmm2,XMMWORD PTR 32[ebp] - vpaddd xmm7,xmm3,XMMWORD PTR 48[ebp] - vmovdqa XMMWORD PTR 32[esp],xmm4 - vmovdqa XMMWORD PTR 48[esp],xmm5 - vmovdqa XMMWORD PTR 64[esp],xmm6 - vmovdqa XMMWORD PTR 80[esp],xmm7 - jmp $L018avx_bmi_00_47 -ALIGN 16 -$L018avx_bmi_00_47: - add ebp,64 - vpalignr xmm4,xmm1,xmm0,4 - rorx ecx,edx,6 - rorx esi,edx,11 - mov DWORD PTR 16[esp],edx - vpalignr xmm7,xmm3,xmm2,4 - rorx edi,edx,25 - xor ecx,esi - andn esi,edx,DWORD PTR 24[esp] - vpsrld xmm6,xmm4,7 - xor ecx,edi - and edx,DWORD PTR 20[esp] - mov DWORD PTR [esp],eax - vpaddd xmm0,xmm0,xmm7 - or edx,esi - rorx edi,eax,2 - rorx esi,eax,13 - vpsrld xmm7,xmm4,3 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,eax,22 - xor esi,edi - vpslld xmm5,xmm4,14 - mov edi,DWORD PTR 4[esp] - xor ecx,esi - xor eax,edi - vpxor xmm4,xmm7,xmm6 - add edx,DWORD PTR 28[esp] - and ebx,eax - add edx,DWORD PTR 32[esp] - vpshufd xmm7,xmm3,250 - xor ebx,edi - add ecx,edx - add edx,DWORD PTR 12[esp] - vpsrld xmm6,xmm6,11 - lea ebx,DWORD PTR [ecx*1+ebx] - rorx ecx,edx,6 - rorx esi,edx,11 - vpxor xmm4,xmm4,xmm5 - mov DWORD PTR 12[esp],edx - rorx edi,edx,25 - xor ecx,esi - vpslld xmm5,xmm5,11 - andn esi,edx,DWORD PTR 20[esp] - xor ecx,edi - and edx,DWORD PTR 16[esp] - vpxor xmm4,xmm4,xmm6 - mov DWORD PTR 28[esp],ebx - or edx,esi - rorx edi,ebx,2 - rorx esi,ebx,13 - vpsrld xmm6,xmm7,10 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,ebx,22 - xor esi,edi - vpxor xmm4,xmm4,xmm5 - mov edi,DWORD PTR [esp] - xor ecx,esi - xor ebx,edi - vpsrlq xmm5,xmm7,17 - add edx,DWORD PTR 24[esp] - and eax,ebx - add edx,DWORD PTR 36[esp] - vpaddd xmm0,xmm0,xmm4 - xor eax,edi - add ecx,edx - add edx,DWORD PTR 8[esp] - vpxor xmm6,xmm6,xmm5 - lea eax,DWORD PTR [ecx*1+eax] - rorx ecx,edx,6 - rorx esi,edx,11 - vpsrlq xmm7,xmm7,19 - mov DWORD PTR 8[esp],edx - rorx edi,edx,25 - xor ecx,esi - vpxor xmm6,xmm6,xmm7 - andn esi,edx,DWORD PTR 16[esp] - xor ecx,edi - and edx,DWORD PTR 12[esp] - vpshufd xmm7,xmm6,132 - mov DWORD PTR 24[esp],eax - or edx,esi - rorx edi,eax,2 - rorx esi,eax,13 - vpsrldq xmm7,xmm7,8 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,eax,22 - xor esi,edi - vpaddd xmm0,xmm0,xmm7 - mov edi,DWORD PTR 28[esp] - xor ecx,esi - xor eax,edi - vpshufd xmm7,xmm0,80 - add edx,DWORD PTR 20[esp] - and ebx,eax - add edx,DWORD PTR 40[esp] - vpsrld xmm6,xmm7,10 - xor ebx,edi - add ecx,edx - add edx,DWORD PTR 4[esp] - vpsrlq xmm5,xmm7,17 - lea ebx,DWORD PTR [ecx*1+ebx] - rorx ecx,edx,6 - rorx esi,edx,11 - vpxor xmm6,xmm6,xmm5 - mov DWORD PTR 4[esp],edx - rorx edi,edx,25 - xor ecx,esi - vpsrlq xmm7,xmm7,19 - andn esi,edx,DWORD PTR 12[esp] - xor ecx,edi - and edx,DWORD PTR 8[esp] - vpxor xmm6,xmm6,xmm7 - mov DWORD PTR 20[esp],ebx - or edx,esi - rorx edi,ebx,2 - rorx esi,ebx,13 - vpshufd xmm7,xmm6,232 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,ebx,22 - xor esi,edi - vpslldq xmm7,xmm7,8 - mov edi,DWORD PTR 24[esp] - xor ecx,esi - xor ebx,edi - vpaddd xmm0,xmm0,xmm7 - add edx,DWORD PTR 16[esp] - and eax,ebx - add edx,DWORD PTR 44[esp] - vpaddd xmm6,xmm0,XMMWORD PTR [ebp] - xor eax,edi - add ecx,edx - add edx,DWORD PTR [esp] - lea eax,DWORD PTR [ecx*1+eax] - vmovdqa XMMWORD PTR 32[esp],xmm6 - vpalignr xmm4,xmm2,xmm1,4 - rorx ecx,edx,6 - rorx esi,edx,11 - mov DWORD PTR [esp],edx - vpalignr xmm7,xmm0,xmm3,4 - rorx edi,edx,25 - xor ecx,esi - andn esi,edx,DWORD PTR 8[esp] - vpsrld xmm6,xmm4,7 - xor ecx,edi - and edx,DWORD PTR 4[esp] - mov DWORD PTR 16[esp],eax - vpaddd xmm1,xmm1,xmm7 - or edx,esi - rorx edi,eax,2 - rorx esi,eax,13 - vpsrld xmm7,xmm4,3 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,eax,22 - xor esi,edi - vpslld xmm5,xmm4,14 - mov edi,DWORD PTR 20[esp] - xor ecx,esi - xor eax,edi - vpxor xmm4,xmm7,xmm6 - add edx,DWORD PTR 12[esp] - and ebx,eax - add edx,DWORD PTR 48[esp] - vpshufd xmm7,xmm0,250 - xor ebx,edi - add ecx,edx - add edx,DWORD PTR 28[esp] - vpsrld xmm6,xmm6,11 - lea ebx,DWORD PTR [ecx*1+ebx] - rorx ecx,edx,6 - rorx esi,edx,11 - vpxor xmm4,xmm4,xmm5 - mov DWORD PTR 28[esp],edx - rorx edi,edx,25 - xor ecx,esi - vpslld xmm5,xmm5,11 - andn esi,edx,DWORD PTR 4[esp] - xor ecx,edi - and edx,DWORD PTR [esp] - vpxor xmm4,xmm4,xmm6 - mov DWORD PTR 12[esp],ebx - or edx,esi - rorx edi,ebx,2 - rorx esi,ebx,13 - vpsrld xmm6,xmm7,10 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,ebx,22 - xor esi,edi - vpxor xmm4,xmm4,xmm5 - mov edi,DWORD PTR 16[esp] - xor ecx,esi - xor ebx,edi - vpsrlq xmm5,xmm7,17 - add edx,DWORD PTR 8[esp] - and eax,ebx - add edx,DWORD PTR 52[esp] - vpaddd xmm1,xmm1,xmm4 - xor eax,edi - add ecx,edx - add edx,DWORD PTR 24[esp] - vpxor xmm6,xmm6,xmm5 - lea eax,DWORD PTR [ecx*1+eax] - rorx ecx,edx,6 - rorx esi,edx,11 - vpsrlq xmm7,xmm7,19 - mov DWORD PTR 24[esp],edx - rorx edi,edx,25 - xor ecx,esi - vpxor xmm6,xmm6,xmm7 - andn esi,edx,DWORD PTR [esp] - xor ecx,edi - and edx,DWORD PTR 28[esp] - vpshufd xmm7,xmm6,132 - mov DWORD PTR 8[esp],eax - or edx,esi - rorx edi,eax,2 - rorx esi,eax,13 - vpsrldq xmm7,xmm7,8 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,eax,22 - xor esi,edi - vpaddd xmm1,xmm1,xmm7 - mov edi,DWORD PTR 12[esp] - xor ecx,esi - xor eax,edi - vpshufd xmm7,xmm1,80 - add edx,DWORD PTR 4[esp] - and ebx,eax - add edx,DWORD PTR 56[esp] - vpsrld xmm6,xmm7,10 - xor ebx,edi - add ecx,edx - add edx,DWORD PTR 20[esp] - vpsrlq xmm5,xmm7,17 - lea ebx,DWORD PTR [ecx*1+ebx] - rorx ecx,edx,6 - rorx esi,edx,11 - vpxor xmm6,xmm6,xmm5 - mov DWORD PTR 20[esp],edx - rorx edi,edx,25 - xor ecx,esi - vpsrlq xmm7,xmm7,19 - andn esi,edx,DWORD PTR 28[esp] - xor ecx,edi - and edx,DWORD PTR 24[esp] - vpxor xmm6,xmm6,xmm7 - mov DWORD PTR 4[esp],ebx - or edx,esi - rorx edi,ebx,2 - rorx esi,ebx,13 - vpshufd xmm7,xmm6,232 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,ebx,22 - xor esi,edi - vpslldq xmm7,xmm7,8 - mov edi,DWORD PTR 8[esp] - xor ecx,esi - xor ebx,edi - vpaddd xmm1,xmm1,xmm7 - add edx,DWORD PTR [esp] - and eax,ebx - add edx,DWORD PTR 60[esp] - vpaddd xmm6,xmm1,XMMWORD PTR 16[ebp] - xor eax,edi - add ecx,edx - add edx,DWORD PTR 16[esp] - lea eax,DWORD PTR [ecx*1+eax] - vmovdqa XMMWORD PTR 48[esp],xmm6 - vpalignr xmm4,xmm3,xmm2,4 - rorx ecx,edx,6 - rorx esi,edx,11 - mov DWORD PTR 16[esp],edx - vpalignr xmm7,xmm1,xmm0,4 - rorx edi,edx,25 - xor ecx,esi - andn esi,edx,DWORD PTR 24[esp] - vpsrld xmm6,xmm4,7 - xor ecx,edi - and edx,DWORD PTR 20[esp] - mov DWORD PTR [esp],eax - vpaddd xmm2,xmm2,xmm7 - or edx,esi - rorx edi,eax,2 - rorx esi,eax,13 - vpsrld xmm7,xmm4,3 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,eax,22 - xor esi,edi - vpslld xmm5,xmm4,14 - mov edi,DWORD PTR 4[esp] - xor ecx,esi - xor eax,edi - vpxor xmm4,xmm7,xmm6 - add edx,DWORD PTR 28[esp] - and ebx,eax - add edx,DWORD PTR 64[esp] - vpshufd xmm7,xmm1,250 - xor ebx,edi - add ecx,edx - add edx,DWORD PTR 12[esp] - vpsrld xmm6,xmm6,11 - lea ebx,DWORD PTR [ecx*1+ebx] - rorx ecx,edx,6 - rorx esi,edx,11 - vpxor xmm4,xmm4,xmm5 - mov DWORD PTR 12[esp],edx - rorx edi,edx,25 - xor ecx,esi - vpslld xmm5,xmm5,11 - andn esi,edx,DWORD PTR 20[esp] - xor ecx,edi - and edx,DWORD PTR 16[esp] - vpxor xmm4,xmm4,xmm6 - mov DWORD PTR 28[esp],ebx - or edx,esi - rorx edi,ebx,2 - rorx esi,ebx,13 - vpsrld xmm6,xmm7,10 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,ebx,22 - xor esi,edi - vpxor xmm4,xmm4,xmm5 - mov edi,DWORD PTR [esp] - xor ecx,esi - xor ebx,edi - vpsrlq xmm5,xmm7,17 - add edx,DWORD PTR 24[esp] - and eax,ebx - add edx,DWORD PTR 68[esp] - vpaddd xmm2,xmm2,xmm4 - xor eax,edi - add ecx,edx - add edx,DWORD PTR 8[esp] - vpxor xmm6,xmm6,xmm5 - lea eax,DWORD PTR [ecx*1+eax] - rorx ecx,edx,6 - rorx esi,edx,11 - vpsrlq xmm7,xmm7,19 - mov DWORD PTR 8[esp],edx - rorx edi,edx,25 - xor ecx,esi - vpxor xmm6,xmm6,xmm7 - andn esi,edx,DWORD PTR 16[esp] - xor ecx,edi - and edx,DWORD PTR 12[esp] - vpshufd xmm7,xmm6,132 - mov DWORD PTR 24[esp],eax - or edx,esi - rorx edi,eax,2 - rorx esi,eax,13 - vpsrldq xmm7,xmm7,8 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,eax,22 - xor esi,edi - vpaddd xmm2,xmm2,xmm7 - mov edi,DWORD PTR 28[esp] - xor ecx,esi - xor eax,edi - vpshufd xmm7,xmm2,80 - add edx,DWORD PTR 20[esp] - and ebx,eax - add edx,DWORD PTR 72[esp] - vpsrld xmm6,xmm7,10 - xor ebx,edi - add ecx,edx - add edx,DWORD PTR 4[esp] - vpsrlq xmm5,xmm7,17 - lea ebx,DWORD PTR [ecx*1+ebx] - rorx ecx,edx,6 - rorx esi,edx,11 - vpxor xmm6,xmm6,xmm5 - mov DWORD PTR 4[esp],edx - rorx edi,edx,25 - xor ecx,esi - vpsrlq xmm7,xmm7,19 - andn esi,edx,DWORD PTR 12[esp] - xor ecx,edi - and edx,DWORD PTR 8[esp] - vpxor xmm6,xmm6,xmm7 - mov DWORD PTR 20[esp],ebx - or edx,esi - rorx edi,ebx,2 - rorx esi,ebx,13 - vpshufd xmm7,xmm6,232 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,ebx,22 - xor esi,edi - vpslldq xmm7,xmm7,8 - mov edi,DWORD PTR 24[esp] - xor ecx,esi - xor ebx,edi - vpaddd xmm2,xmm2,xmm7 - add edx,DWORD PTR 16[esp] - and eax,ebx - add edx,DWORD PTR 76[esp] - vpaddd xmm6,xmm2,XMMWORD PTR 32[ebp] - xor eax,edi - add ecx,edx - add edx,DWORD PTR [esp] - lea eax,DWORD PTR [ecx*1+eax] - vmovdqa XMMWORD PTR 64[esp],xmm6 - vpalignr xmm4,xmm0,xmm3,4 - rorx ecx,edx,6 - rorx esi,edx,11 - mov DWORD PTR [esp],edx - vpalignr xmm7,xmm2,xmm1,4 - rorx edi,edx,25 - xor ecx,esi - andn esi,edx,DWORD PTR 8[esp] - vpsrld xmm6,xmm4,7 - xor ecx,edi - and edx,DWORD PTR 4[esp] - mov DWORD PTR 16[esp],eax - vpaddd xmm3,xmm3,xmm7 - or edx,esi - rorx edi,eax,2 - rorx esi,eax,13 - vpsrld xmm7,xmm4,3 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,eax,22 - xor esi,edi - vpslld xmm5,xmm4,14 - mov edi,DWORD PTR 20[esp] - xor ecx,esi - xor eax,edi - vpxor xmm4,xmm7,xmm6 - add edx,DWORD PTR 12[esp] - and ebx,eax - add edx,DWORD PTR 80[esp] - vpshufd xmm7,xmm2,250 - xor ebx,edi - add ecx,edx - add edx,DWORD PTR 28[esp] - vpsrld xmm6,xmm6,11 - lea ebx,DWORD PTR [ecx*1+ebx] - rorx ecx,edx,6 - rorx esi,edx,11 - vpxor xmm4,xmm4,xmm5 - mov DWORD PTR 28[esp],edx - rorx edi,edx,25 - xor ecx,esi - vpslld xmm5,xmm5,11 - andn esi,edx,DWORD PTR 4[esp] - xor ecx,edi - and edx,DWORD PTR [esp] - vpxor xmm4,xmm4,xmm6 - mov DWORD PTR 12[esp],ebx - or edx,esi - rorx edi,ebx,2 - rorx esi,ebx,13 - vpsrld xmm6,xmm7,10 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,ebx,22 - xor esi,edi - vpxor xmm4,xmm4,xmm5 - mov edi,DWORD PTR 16[esp] - xor ecx,esi - xor ebx,edi - vpsrlq xmm5,xmm7,17 - add edx,DWORD PTR 8[esp] - and eax,ebx - add edx,DWORD PTR 84[esp] - vpaddd xmm3,xmm3,xmm4 - xor eax,edi - add ecx,edx - add edx,DWORD PTR 24[esp] - vpxor xmm6,xmm6,xmm5 - lea eax,DWORD PTR [ecx*1+eax] - rorx ecx,edx,6 - rorx esi,edx,11 - vpsrlq xmm7,xmm7,19 - mov DWORD PTR 24[esp],edx - rorx edi,edx,25 - xor ecx,esi - vpxor xmm6,xmm6,xmm7 - andn esi,edx,DWORD PTR [esp] - xor ecx,edi - and edx,DWORD PTR 28[esp] - vpshufd xmm7,xmm6,132 - mov DWORD PTR 8[esp],eax - or edx,esi - rorx edi,eax,2 - rorx esi,eax,13 - vpsrldq xmm7,xmm7,8 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,eax,22 - xor esi,edi - vpaddd xmm3,xmm3,xmm7 - mov edi,DWORD PTR 12[esp] - xor ecx,esi - xor eax,edi - vpshufd xmm7,xmm3,80 - add edx,DWORD PTR 4[esp] - and ebx,eax - add edx,DWORD PTR 88[esp] - vpsrld xmm6,xmm7,10 - xor ebx,edi - add ecx,edx - add edx,DWORD PTR 20[esp] - vpsrlq xmm5,xmm7,17 - lea ebx,DWORD PTR [ecx*1+ebx] - rorx ecx,edx,6 - rorx esi,edx,11 - vpxor xmm6,xmm6,xmm5 - mov DWORD PTR 20[esp],edx - rorx edi,edx,25 - xor ecx,esi - vpsrlq xmm7,xmm7,19 - andn esi,edx,DWORD PTR 28[esp] - xor ecx,edi - and edx,DWORD PTR 24[esp] - vpxor xmm6,xmm6,xmm7 - mov DWORD PTR 4[esp],ebx - or edx,esi - rorx edi,ebx,2 - rorx esi,ebx,13 - vpshufd xmm7,xmm6,232 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,ebx,22 - xor esi,edi - vpslldq xmm7,xmm7,8 - mov edi,DWORD PTR 8[esp] - xor ecx,esi - xor ebx,edi - vpaddd xmm3,xmm3,xmm7 - add edx,DWORD PTR [esp] - and eax,ebx - add edx,DWORD PTR 92[esp] - vpaddd xmm6,xmm3,XMMWORD PTR 48[ebp] - xor eax,edi - add ecx,edx - add edx,DWORD PTR 16[esp] - lea eax,DWORD PTR [ecx*1+eax] - vmovdqa XMMWORD PTR 80[esp],xmm6 - cmp DWORD PTR 64[ebp],66051 - jne $L018avx_bmi_00_47 - rorx ecx,edx,6 - rorx esi,edx,11 - mov DWORD PTR 16[esp],edx - rorx edi,edx,25 - xor ecx,esi - andn esi,edx,DWORD PTR 24[esp] - xor ecx,edi - and edx,DWORD PTR 20[esp] - mov DWORD PTR [esp],eax - or edx,esi - rorx edi,eax,2 - rorx esi,eax,13 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,eax,22 - xor esi,edi - mov edi,DWORD PTR 4[esp] - xor ecx,esi - xor eax,edi - add edx,DWORD PTR 28[esp] - and ebx,eax - add edx,DWORD PTR 32[esp] - xor ebx,edi - add ecx,edx - add edx,DWORD PTR 12[esp] - lea ebx,DWORD PTR [ecx*1+ebx] - rorx ecx,edx,6 - rorx esi,edx,11 - mov DWORD PTR 12[esp],edx - rorx edi,edx,25 - xor ecx,esi - andn esi,edx,DWORD PTR 20[esp] - xor ecx,edi - and edx,DWORD PTR 16[esp] - mov DWORD PTR 28[esp],ebx - or edx,esi - rorx edi,ebx,2 - rorx esi,ebx,13 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,ebx,22 - xor esi,edi - mov edi,DWORD PTR [esp] - xor ecx,esi - xor ebx,edi - add edx,DWORD PTR 24[esp] - and eax,ebx - add edx,DWORD PTR 36[esp] - xor eax,edi - add ecx,edx - add edx,DWORD PTR 8[esp] - lea eax,DWORD PTR [ecx*1+eax] - rorx ecx,edx,6 - rorx esi,edx,11 - mov DWORD PTR 8[esp],edx - rorx edi,edx,25 - xor ecx,esi - andn esi,edx,DWORD PTR 16[esp] - xor ecx,edi - and edx,DWORD PTR 12[esp] - mov DWORD PTR 24[esp],eax - or edx,esi - rorx edi,eax,2 - rorx esi,eax,13 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,eax,22 - xor esi,edi - mov edi,DWORD PTR 28[esp] - xor ecx,esi - xor eax,edi - add edx,DWORD PTR 20[esp] - and ebx,eax - add edx,DWORD PTR 40[esp] - xor ebx,edi - add ecx,edx - add edx,DWORD PTR 4[esp] - lea ebx,DWORD PTR [ecx*1+ebx] - rorx ecx,edx,6 - rorx esi,edx,11 - mov DWORD PTR 4[esp],edx - rorx edi,edx,25 - xor ecx,esi - andn esi,edx,DWORD PTR 12[esp] - xor ecx,edi - and edx,DWORD PTR 8[esp] - mov DWORD PTR 20[esp],ebx - or edx,esi - rorx edi,ebx,2 - rorx esi,ebx,13 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,ebx,22 - xor esi,edi - mov edi,DWORD PTR 24[esp] - xor ecx,esi - xor ebx,edi - add edx,DWORD PTR 16[esp] - and eax,ebx - add edx,DWORD PTR 44[esp] - xor eax,edi - add ecx,edx - add edx,DWORD PTR [esp] - lea eax,DWORD PTR [ecx*1+eax] - rorx ecx,edx,6 - rorx esi,edx,11 - mov DWORD PTR [esp],edx - rorx edi,edx,25 - xor ecx,esi - andn esi,edx,DWORD PTR 8[esp] - xor ecx,edi - and edx,DWORD PTR 4[esp] - mov DWORD PTR 16[esp],eax - or edx,esi - rorx edi,eax,2 - rorx esi,eax,13 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,eax,22 - xor esi,edi - mov edi,DWORD PTR 20[esp] - xor ecx,esi - xor eax,edi - add edx,DWORD PTR 12[esp] - and ebx,eax - add edx,DWORD PTR 48[esp] - xor ebx,edi - add ecx,edx - add edx,DWORD PTR 28[esp] - lea ebx,DWORD PTR [ecx*1+ebx] - rorx ecx,edx,6 - rorx esi,edx,11 - mov DWORD PTR 28[esp],edx - rorx edi,edx,25 - xor ecx,esi - andn esi,edx,DWORD PTR 4[esp] - xor ecx,edi - and edx,DWORD PTR [esp] - mov DWORD PTR 12[esp],ebx - or edx,esi - rorx edi,ebx,2 - rorx esi,ebx,13 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,ebx,22 - xor esi,edi - mov edi,DWORD PTR 16[esp] - xor ecx,esi - xor ebx,edi - add edx,DWORD PTR 8[esp] - and eax,ebx - add edx,DWORD PTR 52[esp] - xor eax,edi - add ecx,edx - add edx,DWORD PTR 24[esp] - lea eax,DWORD PTR [ecx*1+eax] - rorx ecx,edx,6 - rorx esi,edx,11 - mov DWORD PTR 24[esp],edx - rorx edi,edx,25 - xor ecx,esi - andn esi,edx,DWORD PTR [esp] - xor ecx,edi - and edx,DWORD PTR 28[esp] - mov DWORD PTR 8[esp],eax - or edx,esi - rorx edi,eax,2 - rorx esi,eax,13 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,eax,22 - xor esi,edi - mov edi,DWORD PTR 12[esp] - xor ecx,esi - xor eax,edi - add edx,DWORD PTR 4[esp] - and ebx,eax - add edx,DWORD PTR 56[esp] - xor ebx,edi - add ecx,edx - add edx,DWORD PTR 20[esp] - lea ebx,DWORD PTR [ecx*1+ebx] - rorx ecx,edx,6 - rorx esi,edx,11 - mov DWORD PTR 20[esp],edx - rorx edi,edx,25 - xor ecx,esi - andn esi,edx,DWORD PTR 28[esp] - xor ecx,edi - and edx,DWORD PTR 24[esp] - mov DWORD PTR 4[esp],ebx - or edx,esi - rorx edi,ebx,2 - rorx esi,ebx,13 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,ebx,22 - xor esi,edi - mov edi,DWORD PTR 8[esp] - xor ecx,esi - xor ebx,edi - add edx,DWORD PTR [esp] - and eax,ebx - add edx,DWORD PTR 60[esp] - xor eax,edi - add ecx,edx - add edx,DWORD PTR 16[esp] - lea eax,DWORD PTR [ecx*1+eax] - rorx ecx,edx,6 - rorx esi,edx,11 - mov DWORD PTR 16[esp],edx - rorx edi,edx,25 - xor ecx,esi - andn esi,edx,DWORD PTR 24[esp] - xor ecx,edi - and edx,DWORD PTR 20[esp] - mov DWORD PTR [esp],eax - or edx,esi - rorx edi,eax,2 - rorx esi,eax,13 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,eax,22 - xor esi,edi - mov edi,DWORD PTR 4[esp] - xor ecx,esi - xor eax,edi - add edx,DWORD PTR 28[esp] - and ebx,eax - add edx,DWORD PTR 64[esp] - xor ebx,edi - add ecx,edx - add edx,DWORD PTR 12[esp] - lea ebx,DWORD PTR [ecx*1+ebx] - rorx ecx,edx,6 - rorx esi,edx,11 - mov DWORD PTR 12[esp],edx - rorx edi,edx,25 - xor ecx,esi - andn esi,edx,DWORD PTR 20[esp] - xor ecx,edi - and edx,DWORD PTR 16[esp] - mov DWORD PTR 28[esp],ebx - or edx,esi - rorx edi,ebx,2 - rorx esi,ebx,13 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,ebx,22 - xor esi,edi - mov edi,DWORD PTR [esp] - xor ecx,esi - xor ebx,edi - add edx,DWORD PTR 24[esp] - and eax,ebx - add edx,DWORD PTR 68[esp] - xor eax,edi - add ecx,edx - add edx,DWORD PTR 8[esp] - lea eax,DWORD PTR [ecx*1+eax] - rorx ecx,edx,6 - rorx esi,edx,11 - mov DWORD PTR 8[esp],edx - rorx edi,edx,25 - xor ecx,esi - andn esi,edx,DWORD PTR 16[esp] - xor ecx,edi - and edx,DWORD PTR 12[esp] - mov DWORD PTR 24[esp],eax - or edx,esi - rorx edi,eax,2 - rorx esi,eax,13 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,eax,22 - xor esi,edi - mov edi,DWORD PTR 28[esp] - xor ecx,esi - xor eax,edi - add edx,DWORD PTR 20[esp] - and ebx,eax - add edx,DWORD PTR 72[esp] - xor ebx,edi - add ecx,edx - add edx,DWORD PTR 4[esp] - lea ebx,DWORD PTR [ecx*1+ebx] - rorx ecx,edx,6 - rorx esi,edx,11 - mov DWORD PTR 4[esp],edx - rorx edi,edx,25 - xor ecx,esi - andn esi,edx,DWORD PTR 12[esp] - xor ecx,edi - and edx,DWORD PTR 8[esp] - mov DWORD PTR 20[esp],ebx - or edx,esi - rorx edi,ebx,2 - rorx esi,ebx,13 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,ebx,22 - xor esi,edi - mov edi,DWORD PTR 24[esp] - xor ecx,esi - xor ebx,edi - add edx,DWORD PTR 16[esp] - and eax,ebx - add edx,DWORD PTR 76[esp] - xor eax,edi - add ecx,edx - add edx,DWORD PTR [esp] - lea eax,DWORD PTR [ecx*1+eax] - rorx ecx,edx,6 - rorx esi,edx,11 - mov DWORD PTR [esp],edx - rorx edi,edx,25 - xor ecx,esi - andn esi,edx,DWORD PTR 8[esp] - xor ecx,edi - and edx,DWORD PTR 4[esp] - mov DWORD PTR 16[esp],eax - or edx,esi - rorx edi,eax,2 - rorx esi,eax,13 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,eax,22 - xor esi,edi - mov edi,DWORD PTR 20[esp] - xor ecx,esi - xor eax,edi - add edx,DWORD PTR 12[esp] - and ebx,eax - add edx,DWORD PTR 80[esp] - xor ebx,edi - add ecx,edx - add edx,DWORD PTR 28[esp] - lea ebx,DWORD PTR [ecx*1+ebx] - rorx ecx,edx,6 - rorx esi,edx,11 - mov DWORD PTR 28[esp],edx - rorx edi,edx,25 - xor ecx,esi - andn esi,edx,DWORD PTR 4[esp] - xor ecx,edi - and edx,DWORD PTR [esp] - mov DWORD PTR 12[esp],ebx - or edx,esi - rorx edi,ebx,2 - rorx esi,ebx,13 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,ebx,22 - xor esi,edi - mov edi,DWORD PTR 16[esp] - xor ecx,esi - xor ebx,edi - add edx,DWORD PTR 8[esp] - and eax,ebx - add edx,DWORD PTR 84[esp] - xor eax,edi - add ecx,edx - add edx,DWORD PTR 24[esp] - lea eax,DWORD PTR [ecx*1+eax] - rorx ecx,edx,6 - rorx esi,edx,11 - mov DWORD PTR 24[esp],edx - rorx edi,edx,25 - xor ecx,esi - andn esi,edx,DWORD PTR [esp] - xor ecx,edi - and edx,DWORD PTR 28[esp] - mov DWORD PTR 8[esp],eax - or edx,esi - rorx edi,eax,2 - rorx esi,eax,13 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,eax,22 - xor esi,edi - mov edi,DWORD PTR 12[esp] - xor ecx,esi - xor eax,edi - add edx,DWORD PTR 4[esp] - and ebx,eax - add edx,DWORD PTR 88[esp] - xor ebx,edi - add ecx,edx - add edx,DWORD PTR 20[esp] - lea ebx,DWORD PTR [ecx*1+ebx] - rorx ecx,edx,6 - rorx esi,edx,11 - mov DWORD PTR 20[esp],edx - rorx edi,edx,25 - xor ecx,esi - andn esi,edx,DWORD PTR 28[esp] - xor ecx,edi - and edx,DWORD PTR 24[esp] - mov DWORD PTR 4[esp],ebx - or edx,esi - rorx edi,ebx,2 - rorx esi,ebx,13 - lea edx,DWORD PTR [ecx*1+edx] - rorx ecx,ebx,22 - xor esi,edi - mov edi,DWORD PTR 8[esp] - xor ecx,esi - xor ebx,edi - add edx,DWORD PTR [esp] - and eax,ebx - add edx,DWORD PTR 92[esp] - xor eax,edi - add ecx,edx - add edx,DWORD PTR 16[esp] - lea eax,DWORD PTR [ecx*1+eax] - mov esi,DWORD PTR 96[esp] - xor ebx,edi - mov ecx,DWORD PTR 12[esp] - add eax,DWORD PTR [esi] - add ebx,DWORD PTR 4[esi] - add edi,DWORD PTR 8[esi] - add ecx,DWORD PTR 12[esi] - mov DWORD PTR [esi],eax - mov DWORD PTR 4[esi],ebx - mov DWORD PTR 8[esi],edi - mov DWORD PTR 12[esi],ecx - mov DWORD PTR 4[esp],ebx - xor ebx,edi - mov DWORD PTR 8[esp],edi - mov DWORD PTR 12[esp],ecx - mov edi,DWORD PTR 20[esp] - mov ecx,DWORD PTR 24[esp] - add edx,DWORD PTR 16[esi] - add edi,DWORD PTR 20[esi] - add ecx,DWORD PTR 24[esi] - mov DWORD PTR 16[esi],edx - mov DWORD PTR 20[esi],edi - mov DWORD PTR 20[esp],edi - mov edi,DWORD PTR 28[esp] - mov DWORD PTR 24[esi],ecx - add edi,DWORD PTR 28[esi] - mov DWORD PTR 24[esp],ecx - mov DWORD PTR 28[esi],edi - mov DWORD PTR 28[esp],edi - mov edi,DWORD PTR 100[esp] - vmovdqa xmm7,XMMWORD PTR 64[ebp] - sub ebp,192 - cmp edi,DWORD PTR 104[esp] - jb $L017grand_avx_bmi - mov esp,DWORD PTR 108[esp] - vzeroall - pop edi - pop esi - pop ebx - pop ebp - ret _sha256_block_data_order ENDP .text$ ENDS .bss SEGMENT 'BSS' diff --git a/deps/openssl/asm_obsolete/arm-void-gas/bn/armv4-gf2m.S b/deps/openssl/asm_obsolete/arm-void-gas/bn/armv4-gf2m.S index 32610558ac5853..ad71aa0b667d94 100644 --- a/deps/openssl/asm_obsolete/arm-void-gas/bn/armv4-gf2m.S +++ b/deps/openssl/asm_obsolete/arm-void-gas/bn/armv4-gf2m.S @@ -98,7 +98,7 @@ bn_GF2m_mul_2x2: mov r12,#7<<2 sub sp,sp,#32 @ allocate tab[8] - bl mul_1x1_ialu @ a1�b1 + bl mul_1x1_ialu @ a1·b1 str r5,[r10,#8] str r4,[r10,#12] @@ -108,13 +108,13 @@ bn_GF2m_mul_2x2: eor r2,r2,r1 eor r0,r0,r3 eor r1,r1,r2 - bl mul_1x1_ialu @ a0�b0 + bl mul_1x1_ialu @ a0·b0 str r5,[r10] str r4,[r10,#4] eor r1,r1,r2 eor r0,r0,r3 - bl mul_1x1_ialu @ (a1+a0)�(b1+b0) + bl mul_1x1_ialu @ (a1+a0)·(b1+b0) ldmia r10,{r6-r9} eor r5,r5,r4 eor r4,r4,r7 diff --git a/deps/openssl/asm_obsolete/arm-void-gas/modes/ghash-armv4.S b/deps/openssl/asm_obsolete/arm-void-gas/modes/ghash-armv4.S index c54f5149974c6f..6f699dbd870818 100644 --- a/deps/openssl/asm_obsolete/arm-void-gas/modes/ghash-armv4.S +++ b/deps/openssl/asm_obsolete/arm-void-gas/modes/ghash-armv4.S @@ -3,6 +3,11 @@ .text .code 32 +#ifdef __clang__ +#define ldrplb ldrbpl +#define ldrneb ldrbne +#endif + .type rem_4bit,%object .align 5 rem_4bit: diff --git a/deps/openssl/asm_obsolete/arm-void-gas/modes/ghashv8-armx.S b/deps/openssl/asm_obsolete/arm-void-gas/modes/ghashv8-armx.S index 269574945fa6a2..9aaea13f9197db 100644 --- a/deps/openssl/asm_obsolete/arm-void-gas/modes/ghashv8-armx.S +++ b/deps/openssl/asm_obsolete/arm-void-gas/modes/ghashv8-armx.S @@ -66,10 +66,10 @@ gcm_gmult_v8: #endif vext.8 q3,q9,q9,#8 - .byte 0x86,0x0e,0xa8,0xf2 @ pmull q0,q12,q3 @ H.lo�Xi.lo + .byte 0x86,0x0e,0xa8,0xf2 @ pmull q0,q12,q3 @ H.lo·Xi.lo veor q9,q9,q3 @ Karatsuba pre-processing - .byte 0x87,0x4e,0xa9,0xf2 @ pmull2 q2,q12,q3 @ H.hi�Xi.hi - .byte 0xa2,0x2e,0xaa,0xf2 @ pmull q1,q13,q9 @ (H.lo+H.hi)�(Xi.lo+Xi.hi) + .byte 0x87,0x4e,0xa9,0xf2 @ pmull2 q2,q12,q3 @ H.hi·Xi.hi + .byte 0xa2,0x2e,0xaa,0xf2 @ pmull q1,q13,q9 @ (H.lo+H.hi)·(Xi.lo+Xi.hi) vext.8 q9,q0,q2,#8 @ Karatsuba post-processing veor q10,q0,q2 @@ -134,7 +134,7 @@ gcm_ghash_v8: #endif vext.8 q7,q9,q9,#8 veor q3,q3,q0 @ I[i]^=Xi - .byte 0x8e,0x8e,0xa8,0xf2 @ pmull q4,q12,q7 @ H�Ii+1 + .byte 0x8e,0x8e,0xa8,0xf2 @ pmull q4,q12,q7 @ H·Ii+1 veor q9,q9,q7 @ Karatsuba pre-processing .byte 0x8f,0xce,0xa9,0xf2 @ pmull2 q6,q12,q7 b .Loop_mod2x_v8 @@ -143,14 +143,14 @@ gcm_ghash_v8: .Loop_mod2x_v8: vext.8 q10,q3,q3,#8 subs r3,r3,#32 @ is there more data? - .byte 0x86,0x0e,0xac,0xf2 @ pmull q0,q14,q3 @ H^2.lo�Xi.lo + .byte 0x86,0x0e,0xac,0xf2 @ pmull q0,q14,q3 @ H^2.lo·Xi.lo movlo r12,#0 @ is it time to zero r12? .byte 0xa2,0xae,0xaa,0xf2 @ pmull q5,q13,q9 veor q10,q10,q3 @ Karatsuba pre-processing - .byte 0x87,0x4e,0xad,0xf2 @ pmull2 q2,q14,q3 @ H^2.hi�Xi.hi + .byte 0x87,0x4e,0xad,0xf2 @ pmull2 q2,q14,q3 @ H^2.hi·Xi.hi veor q0,q0,q4 @ accumulate - .byte 0xa5,0x2e,0xab,0xf2 @ pmull2 q1,q13,q10 @ (H^2.lo+H^2.hi)�(Xi.lo+Xi.hi) + .byte 0xa5,0x2e,0xab,0xf2 @ pmull2 q1,q13,q10 @ (H^2.lo+H^2.hi)·(Xi.lo+Xi.hi) vld1.64 {q8},[r2],r12 @ load [rotated] I[i+2] veor q2,q2,q6 @@ -175,7 +175,7 @@ gcm_ghash_v8: vext.8 q7,q9,q9,#8 vext.8 q3,q8,q8,#8 veor q0,q1,q10 - .byte 0x8e,0x8e,0xa8,0xf2 @ pmull q4,q12,q7 @ H�Ii+1 + .byte 0x8e,0x8e,0xa8,0xf2 @ pmull q4,q12,q7 @ H·Ii+1 veor q3,q3,q2 @ accumulate q3 early vext.8 q10,q0,q0,#8 @ 2nd phase of reduction @@ -196,10 +196,10 @@ gcm_ghash_v8: veor q3,q3,q0 @ inp^=Xi veor q9,q8,q10 @ q9 is rotated inp^Xi - .byte 0x86,0x0e,0xa8,0xf2 @ pmull q0,q12,q3 @ H.lo�Xi.lo + .byte 0x86,0x0e,0xa8,0xf2 @ pmull q0,q12,q3 @ H.lo·Xi.lo veor q9,q9,q3 @ Karatsuba pre-processing - .byte 0x87,0x4e,0xa9,0xf2 @ pmull2 q2,q12,q3 @ H.hi�Xi.hi - .byte 0xa2,0x2e,0xaa,0xf2 @ pmull q1,q13,q9 @ (H.lo+H.hi)�(Xi.lo+Xi.hi) + .byte 0x87,0x4e,0xa9,0xf2 @ pmull2 q2,q12,q3 @ H.hi·Xi.hi + .byte 0xa2,0x2e,0xaa,0xf2 @ pmull q1,q13,q9 @ (H.lo+H.hi)·(Xi.lo+Xi.hi) vext.8 q9,q0,q2,#8 @ Karatsuba post-processing veor q10,q0,q2 diff --git a/deps/openssl/asm_obsolete/arm64-linux64-gas/modes/ghashv8-armx.S b/deps/openssl/asm_obsolete/arm64-linux64-gas/modes/ghashv8-armx.S index 479007dc54dfab..fc3dadd08a17a9 100644 --- a/deps/openssl/asm_obsolete/arm64-linux64-gas/modes/ghashv8-armx.S +++ b/deps/openssl/asm_obsolete/arm64-linux64-gas/modes/ghashv8-armx.S @@ -65,10 +65,10 @@ gcm_gmult_v8: #endif ext v3.16b,v17.16b,v17.16b,#8 - pmull v0.1q,v20.1d,v3.1d //H.lo�Xi.lo + pmull v0.1q,v20.1d,v3.1d //H.lo·Xi.lo eor v17.16b,v17.16b,v3.16b //Karatsuba pre-processing - pmull2 v2.1q,v20.2d,v3.2d //H.hi�Xi.hi - pmull v1.1q,v21.1d,v17.1d //(H.lo+H.hi)�(Xi.lo+Xi.hi) + pmull2 v2.1q,v20.2d,v3.2d //H.hi·Xi.hi + pmull v1.1q,v21.1d,v17.1d //(H.lo+H.hi)·(Xi.lo+Xi.hi) ext v17.16b,v0.16b,v2.16b,#8 //Karatsuba post-processing eor v18.16b,v0.16b,v2.16b @@ -132,7 +132,7 @@ gcm_ghash_v8: #endif ext v7.16b,v17.16b,v17.16b,#8 eor v3.16b,v3.16b,v0.16b //I[i]^=Xi - pmull v4.1q,v20.1d,v7.1d //H�Ii+1 + pmull v4.1q,v20.1d,v7.1d //H·Ii+1 eor v17.16b,v17.16b,v7.16b //Karatsuba pre-processing pmull2 v6.1q,v20.2d,v7.2d b .Loop_mod2x_v8 @@ -141,14 +141,14 @@ gcm_ghash_v8: .Loop_mod2x_v8: ext v18.16b,v3.16b,v3.16b,#8 subs x3,x3,#32 //is there more data? - pmull v0.1q,v22.1d,v3.1d //H^2.lo�Xi.lo + pmull v0.1q,v22.1d,v3.1d //H^2.lo·Xi.lo csel x12,xzr,x12,lo //is it time to zero x12? pmull v5.1q,v21.1d,v17.1d eor v18.16b,v18.16b,v3.16b //Karatsuba pre-processing - pmull2 v2.1q,v22.2d,v3.2d //H^2.hi�Xi.hi + pmull2 v2.1q,v22.2d,v3.2d //H^2.hi·Xi.hi eor v0.16b,v0.16b,v4.16b //accumulate - pmull2 v1.1q,v21.2d,v18.2d //(H^2.lo+H^2.hi)�(Xi.lo+Xi.hi) + pmull2 v1.1q,v21.2d,v18.2d //(H^2.lo+H^2.hi)·(Xi.lo+Xi.hi) ld1 {v16.2d},[x2],x12 //load [rotated] I[i+2] eor v2.16b,v2.16b,v6.16b @@ -173,7 +173,7 @@ gcm_ghash_v8: ext v7.16b,v17.16b,v17.16b,#8 ext v3.16b,v16.16b,v16.16b,#8 eor v0.16b,v1.16b,v18.16b - pmull v4.1q,v20.1d,v7.1d //H�Ii+1 + pmull v4.1q,v20.1d,v7.1d //H·Ii+1 eor v3.16b,v3.16b,v2.16b //accumulate v3.16b early ext v18.16b,v0.16b,v0.16b,#8 //2nd phase of reduction @@ -194,10 +194,10 @@ gcm_ghash_v8: eor v3.16b,v3.16b,v0.16b //inp^=Xi eor v17.16b,v16.16b,v18.16b //v17.16b is rotated inp^Xi - pmull v0.1q,v20.1d,v3.1d //H.lo�Xi.lo + pmull v0.1q,v20.1d,v3.1d //H.lo·Xi.lo eor v17.16b,v17.16b,v3.16b //Karatsuba pre-processing - pmull2 v2.1q,v20.2d,v3.2d //H.hi�Xi.hi - pmull v1.1q,v21.1d,v17.1d //(H.lo+H.hi)�(Xi.lo+Xi.hi) + pmull2 v2.1q,v20.2d,v3.2d //H.hi·Xi.hi + pmull v1.1q,v21.1d,v17.1d //(H.lo+H.hi)·(Xi.lo+Xi.hi) ext v17.16b,v0.16b,v2.16b,#8 //Karatsuba post-processing eor v18.16b,v0.16b,v2.16b diff --git a/deps/openssl/asm_obsolete/x64-elf-gas/aes/aes-x86_64.s b/deps/openssl/asm_obsolete/x64-elf-gas/aes/aes-x86_64.s index 0bdfe91fc530bc..c21cce10f5db9e 100644 --- a/deps/openssl/asm_obsolete/x64-elf-gas/aes/aes-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-elf-gas/aes/aes-x86_64.s @@ -81,8 +81,8 @@ _x86_64_AES_encrypt: movl 0(%r14,%rdi,8),%edi movl 0(%r14,%rbp,8),%ebp - andl $65280,%edi - andl $65280,%ebp + andl $0x0000ff00,%edi + andl $0x0000ff00,%ebp xorl %edi,%r10d xorl %ebp,%r11d @@ -94,8 +94,8 @@ _x86_64_AES_encrypt: movl 0(%r14,%rsi,8),%esi movl 0(%r14,%rdi,8),%edi - andl $65280,%esi - andl $65280,%edi + andl $0x0000ff00,%esi + andl $0x0000ff00,%edi shrl $16,%ebx xorl %esi,%r12d xorl %edi,%r8d @@ -108,9 +108,9 @@ _x86_64_AES_encrypt: movl 0(%r14,%rdi,8),%edi movl 0(%r14,%rbp,8),%ebp - andl $16711680,%esi - andl $16711680,%edi - andl $16711680,%ebp + andl $0x00ff0000,%esi + andl $0x00ff0000,%edi + andl $0x00ff0000,%ebp xorl %esi,%r10d xorl %edi,%r11d @@ -123,9 +123,9 @@ _x86_64_AES_encrypt: movl 2(%r14,%rdi,8),%edi movl 2(%r14,%rbp,8),%ebp - andl $16711680,%esi - andl $4278190080,%edi - andl $4278190080,%ebp + andl $0x00ff0000,%esi + andl $0xff000000,%edi + andl $0xff000000,%ebp xorl %esi,%r8d xorl %edi,%r10d @@ -138,8 +138,8 @@ _x86_64_AES_encrypt: movl 2(%r14,%rdi,8),%edi movl 16+0(%r15),%eax - andl $4278190080,%esi - andl $4278190080,%edi + andl $0xff000000,%esi + andl $0xff000000,%edi xorl %esi,%r12d xorl %edi,%r8d @@ -241,8 +241,8 @@ _x86_64_AES_encrypt_compact: xorl %r8d,%edx cmpq 16(%rsp),%r15 je .Lenc_compact_done - movl $2155905152,%r10d - movl $2155905152,%r11d + movl $0x80808080,%r10d + movl $0x80808080,%r11d andl %eax,%r10d andl %ebx,%r11d movl %r10d,%esi @@ -253,10 +253,10 @@ _x86_64_AES_encrypt_compact: leal (%rbx,%rbx,1),%r9d subl %r10d,%esi subl %r11d,%edi - andl $4278124286,%r8d - andl $4278124286,%r9d - andl $454761243,%esi - andl $454761243,%edi + andl $0xfefefefe,%r8d + andl $0xfefefefe,%r9d + andl $0x1b1b1b1b,%esi + andl $0x1b1b1b1b,%edi movl %eax,%r10d movl %ebx,%r11d xorl %esi,%r8d @@ -264,9 +264,9 @@ _x86_64_AES_encrypt_compact: xorl %r8d,%eax xorl %r9d,%ebx - movl $2155905152,%r12d + movl $0x80808080,%r12d roll $24,%eax - movl $2155905152,%ebp + movl $0x80808080,%ebp roll $24,%ebx andl %ecx,%r12d andl %edx,%ebp @@ -289,10 +289,10 @@ _x86_64_AES_encrypt_compact: xorl %r10d,%eax xorl %r11d,%ebx - andl $4278124286,%r8d - andl $4278124286,%r9d - andl $454761243,%esi - andl $454761243,%edi + andl $0xfefefefe,%r8d + andl $0xfefefefe,%r9d + andl $0x1b1b1b1b,%esi + andl $0x1b1b1b1b,%edi movl %ecx,%r12d movl %edx,%ebp xorl %esi,%r8d @@ -345,7 +345,7 @@ AES_encrypt: andq $-64,%rsp subq %rsp,%rcx negq %rcx - andq $960,%rcx + andq $0x3c0,%rcx subq %rcx,%rsp subq $32,%rsp @@ -370,7 +370,7 @@ AES_encrypt: leaq .LAES_Te+2048(%rip),%r14 leaq 768(%rsp),%rbp subq %r14,%rbp - andq $768,%rbp + andq $0x300,%rbp leaq (%r14,%rbp,1),%r14 call _x86_64_AES_encrypt_compact @@ -792,7 +792,7 @@ AES_decrypt: andq $-64,%rsp subq %rsp,%rcx negq %rcx - andq $960,%rcx + andq $0x3c0,%rcx subq %rcx,%rsp subq $32,%rsp @@ -817,7 +817,7 @@ AES_decrypt: leaq .LAES_Td+2048(%rip),%r14 leaq 768(%rsp),%rbp subq %r14,%rbp - andq $768,%rbp + andq $0x300,%rbp leaq (%r14,%rbp,1),%r14 shrq $3,%rbp addq %rbp,%r14 @@ -1333,9 +1333,9 @@ AES_cbc_encrypt: movq %r14,%r10 leaq 2304(%r14),%r11 movq %r15,%r12 - andq $4095,%r10 - andq $4095,%r11 - andq $4095,%r12 + andq $0xFFF,%r10 + andq $0xFFF,%r11 + andq $0xFFF,%r12 cmpq %r11,%r12 jb .Lcbc_te_break_out @@ -1344,7 +1344,7 @@ AES_cbc_encrypt: jmp .Lcbc_te_ok .Lcbc_te_break_out: subq %r10,%r12 - andq $4095,%r12 + andq $0xFFF,%r12 addq $320,%r12 subq %r12,%r15 .align 4 @@ -1370,7 +1370,7 @@ AES_cbc_encrypt: movq %r15,%r10 subq %r14,%r10 - andq $4095,%r10 + andq $0xfff,%r10 cmpq $2304,%r10 jb .Lcbc_do_ecopy cmpq $4096-248,%r10 @@ -1557,7 +1557,7 @@ AES_cbc_encrypt: leaq -88-63(%rcx),%r10 subq %rbp,%r10 negq %r10 - andq $960,%r10 + andq $0x3c0,%r10 subq %r10,%rbp xchgq %rsp,%rbp @@ -1586,7 +1586,7 @@ AES_cbc_encrypt: leaq 2048(%r14),%r14 leaq 768-8(%rsp),%rax subq %r14,%rax - andq $768,%rax + andq $0x300,%rax leaq (%r14,%rax,1),%r14 cmpq $0,%rbx diff --git a/deps/openssl/asm_obsolete/x64-elf-gas/aes/aesni-sha1-x86_64.s b/deps/openssl/asm_obsolete/x64-elf-gas/aes/aesni-sha1-x86_64.s index d4ed2047c6db9c..edbd5cb343c327 100644 --- a/deps/openssl/asm_obsolete/x64-elf-gas/aes/aesni-sha1-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-elf-gas/aes/aesni-sha1-x86_64.s @@ -1392,8 +1392,8 @@ aesni_cbc_sha1_enc_shaext: movups 16(%rcx),%xmm0 leaq 112(%rcx),%rcx - pshufd $27,%xmm8,%xmm8 - pshufd $27,%xmm9,%xmm9 + pshufd $0b00011011,%xmm8,%xmm8 + pshufd $0b00011011,%xmm9,%xmm9 jmp .Loop_shaext .align 16 @@ -1672,8 +1672,8 @@ aesni_cbc_sha1_enc_shaext: leaq 64(%rdi),%rdi jnz .Loop_shaext - pshufd $27,%xmm8,%xmm8 - pshufd $27,%xmm9,%xmm9 + pshufd $0b00011011,%xmm8,%xmm8 + pshufd $0b00011011,%xmm9,%xmm9 movups %xmm2,(%r8) movdqu %xmm8,(%r9) movd %xmm9,16(%r9) diff --git a/deps/openssl/asm_obsolete/x64-elf-gas/aes/aesni-x86_64.s b/deps/openssl/asm_obsolete/x64-elf-gas/aes/aesni-x86_64.s index 6573fe4be3494d..fcf42adbb4b83a 100644 --- a/deps/openssl/asm_obsolete/x64-elf-gas/aes/aesni-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-elf-gas/aes/aesni-x86_64.s @@ -503,7 +503,7 @@ aesni_ecb_encrypt: testl %r8d,%r8d jz .Lecb_decrypt - cmpq $128,%rdx + cmpq $0x80,%rdx jb .Lecb_enc_tail movdqu (%rdi),%xmm2 @@ -515,7 +515,7 @@ aesni_ecb_encrypt: movdqu 96(%rdi),%xmm8 movdqu 112(%rdi),%xmm9 leaq 128(%rdi),%rdi - subq $128,%rdx + subq $0x80,%rdx jmp .Lecb_enc_loop8_enter .align 16 .Lecb_enc_loop8: @@ -543,7 +543,7 @@ aesni_ecb_encrypt: call _aesni_encrypt8 - subq $128,%rdx + subq $0x80,%rdx jnc .Lecb_enc_loop8 movups %xmm2,(%rsi) @@ -557,22 +557,22 @@ aesni_ecb_encrypt: movups %xmm8,96(%rsi) movups %xmm9,112(%rsi) leaq 128(%rsi),%rsi - addq $128,%rdx + addq $0x80,%rdx jz .Lecb_ret .Lecb_enc_tail: movups (%rdi),%xmm2 - cmpq $32,%rdx + cmpq $0x20,%rdx jb .Lecb_enc_one movups 16(%rdi),%xmm3 je .Lecb_enc_two movups 32(%rdi),%xmm4 - cmpq $64,%rdx + cmpq $0x40,%rdx jb .Lecb_enc_three movups 48(%rdi),%xmm5 je .Lecb_enc_four movups 64(%rdi),%xmm6 - cmpq $96,%rdx + cmpq $0x60,%rdx jb .Lecb_enc_five movups 80(%rdi),%xmm7 je .Lecb_enc_six @@ -646,7 +646,7 @@ aesni_ecb_encrypt: .align 16 .Lecb_decrypt: - cmpq $128,%rdx + cmpq $0x80,%rdx jb .Lecb_dec_tail movdqu (%rdi),%xmm2 @@ -658,7 +658,7 @@ aesni_ecb_encrypt: movdqu 96(%rdi),%xmm8 movdqu 112(%rdi),%xmm9 leaq 128(%rdi),%rdi - subq $128,%rdx + subq $0x80,%rdx jmp .Lecb_dec_loop8_enter .align 16 .Lecb_dec_loop8: @@ -687,7 +687,7 @@ aesni_ecb_encrypt: call _aesni_decrypt8 movups (%r11),%xmm0 - subq $128,%rdx + subq $0x80,%rdx jnc .Lecb_dec_loop8 movups %xmm2,(%rsi) @@ -709,22 +709,22 @@ aesni_ecb_encrypt: movups %xmm9,112(%rsi) pxor %xmm9,%xmm9 leaq 128(%rsi),%rsi - addq $128,%rdx + addq $0x80,%rdx jz .Lecb_ret .Lecb_dec_tail: movups (%rdi),%xmm2 - cmpq $32,%rdx + cmpq $0x20,%rdx jb .Lecb_dec_one movups 16(%rdi),%xmm3 je .Lecb_dec_two movups 32(%rdi),%xmm4 - cmpq $64,%rdx + cmpq $0x40,%rdx jb .Lecb_dec_three movups 48(%rdi),%xmm5 je .Lecb_dec_four movups 64(%rdi),%xmm6 - cmpq $96,%rdx + cmpq $0x60,%rdx jb .Lecb_dec_five movups 80(%rdi),%xmm7 je .Lecb_dec_six @@ -1598,7 +1598,7 @@ aesni_xts_encrypt: movdqa .Lxts_magic(%rip),%xmm8 movdqa %xmm2,%xmm15 - pshufd $95,%xmm2,%xmm9 + pshufd $0x5f,%xmm2,%xmm9 pxor %xmm0,%xmm1 movdqa %xmm9,%xmm14 paddd %xmm9,%xmm9 @@ -1697,7 +1697,7 @@ aesni_xts_encrypt: .byte 102,15,56,220,248 movups 64(%r11),%xmm0 movdqa %xmm8,80(%rsp) - pshufd $95,%xmm15,%xmm9 + pshufd $0x5f,%xmm15,%xmm9 jmp .Lxts_enc_loop6 .align 32 .Lxts_enc_loop6: @@ -1836,13 +1836,13 @@ aesni_xts_encrypt: jz .Lxts_enc_done pxor %xmm0,%xmm11 - cmpq $32,%rdx + cmpq $0x20,%rdx jb .Lxts_enc_one pxor %xmm0,%xmm12 je .Lxts_enc_two pxor %xmm0,%xmm13 - cmpq $64,%rdx + cmpq $0x40,%rdx jb .Lxts_enc_three pxor %xmm0,%xmm14 je .Lxts_enc_four @@ -2069,7 +2069,7 @@ aesni_xts_decrypt: movdqa .Lxts_magic(%rip),%xmm8 movdqa %xmm2,%xmm15 - pshufd $95,%xmm2,%xmm9 + pshufd $0x5f,%xmm2,%xmm9 pxor %xmm0,%xmm1 movdqa %xmm9,%xmm14 paddd %xmm9,%xmm9 @@ -2168,7 +2168,7 @@ aesni_xts_decrypt: .byte 102,15,56,222,248 movups 64(%r11),%xmm0 movdqa %xmm8,80(%rsp) - pshufd $95,%xmm15,%xmm9 + pshufd $0x5f,%xmm15,%xmm9 jmp .Lxts_dec_loop6 .align 32 .Lxts_dec_loop6: @@ -2308,13 +2308,13 @@ aesni_xts_decrypt: jz .Lxts_dec_done pxor %xmm0,%xmm12 - cmpq $32,%rdx + cmpq $0x20,%rdx jb .Lxts_dec_one pxor %xmm0,%xmm13 je .Lxts_dec_two pxor %xmm0,%xmm14 - cmpq $64,%rdx + cmpq $0x40,%rdx jb .Lxts_dec_three je .Lxts_dec_four @@ -2345,7 +2345,7 @@ aesni_xts_decrypt: pcmpgtd %xmm15,%xmm14 movdqu %xmm6,64(%rsi) leaq 80(%rsi),%rsi - pshufd $19,%xmm14,%xmm11 + pshufd $0x13,%xmm14,%xmm11 andq $15,%r9 jz .Lxts_dec_ret @@ -2634,7 +2634,7 @@ aesni_cbc_encrypt: leaq -8(%rax),%rbp movups (%r8),%xmm10 movl %r10d,%eax - cmpq $80,%rdx + cmpq $0x50,%rdx jbe .Lcbc_dec_tail movups (%rcx),%xmm0 @@ -2650,14 +2650,14 @@ aesni_cbc_encrypt: movdqu 80(%rdi),%xmm7 movdqa %xmm6,%xmm15 movl OPENSSL_ia32cap_P+4(%rip),%r9d - cmpq $112,%rdx + cmpq $0x70,%rdx jbe .Lcbc_dec_six_or_seven andl $71303168,%r9d - subq $80,%rdx + subq $0x50,%rdx cmpl $4194304,%r9d je .Lcbc_dec_loop6_enter - subq $32,%rdx + subq $0x20,%rdx leaq 112(%rcx),%rcx jmp .Lcbc_dec_loop8_enter .align 16 @@ -2672,7 +2672,7 @@ aesni_cbc_encrypt: movups 16-112(%rcx),%xmm1 pxor %xmm0,%xmm4 xorq %r11,%r11 - cmpq $112,%rdx + cmpq $0x70,%rdx pxor %xmm0,%xmm5 pxor %xmm0,%xmm6 pxor %xmm0,%xmm7 @@ -2857,21 +2857,21 @@ aesni_cbc_encrypt: movups %xmm8,96(%rsi) leaq 112(%rsi),%rsi - subq $128,%rdx + subq $0x80,%rdx ja .Lcbc_dec_loop8 movaps %xmm9,%xmm2 leaq -112(%rcx),%rcx - addq $112,%rdx + addq $0x70,%rdx jle .Lcbc_dec_clear_tail_collected movups %xmm9,(%rsi) leaq 16(%rsi),%rsi - cmpq $80,%rdx + cmpq $0x50,%rdx jbe .Lcbc_dec_tail movaps %xmm11,%xmm2 .Lcbc_dec_six_or_seven: - cmpq $96,%rdx + cmpq $0x60,%rdx ja .Lcbc_dec_seven movaps %xmm7,%xmm8 @@ -2964,33 +2964,33 @@ aesni_cbc_encrypt: movl %r10d,%eax movdqu %xmm6,64(%rsi) leaq 80(%rsi),%rsi - subq $96,%rdx + subq $0x60,%rdx ja .Lcbc_dec_loop6 movdqa %xmm7,%xmm2 - addq $80,%rdx + addq $0x50,%rdx jle .Lcbc_dec_clear_tail_collected movups %xmm7,(%rsi) leaq 16(%rsi),%rsi .Lcbc_dec_tail: movups (%rdi),%xmm2 - subq $16,%rdx + subq $0x10,%rdx jbe .Lcbc_dec_one movups 16(%rdi),%xmm3 movaps %xmm2,%xmm11 - subq $16,%rdx + subq $0x10,%rdx jbe .Lcbc_dec_two movups 32(%rdi),%xmm4 movaps %xmm3,%xmm12 - subq $16,%rdx + subq $0x10,%rdx jbe .Lcbc_dec_three movups 48(%rdi),%xmm5 movaps %xmm4,%xmm13 - subq $16,%rdx + subq $0x10,%rdx jbe .Lcbc_dec_four movups 64(%rdi),%xmm6 @@ -3015,7 +3015,7 @@ aesni_cbc_encrypt: movdqa %xmm6,%xmm2 pxor %xmm6,%xmm6 pxor %xmm7,%xmm7 - subq $16,%rdx + subq $0x10,%rdx jmp .Lcbc_dec_tail_collected .align 16 @@ -3332,7 +3332,7 @@ __aesni_set_encrypt_key: pslldq $4,%xmm0 pxor %xmm3,%xmm0 - pshufd $255,%xmm0,%xmm3 + pshufd $0xff,%xmm0,%xmm3 pxor %xmm1,%xmm3 pslldq $4,%xmm1 pxor %xmm1,%xmm3 @@ -3419,7 +3419,7 @@ __aesni_set_encrypt_key: decl %r10d jz .Ldone_key256 - pshufd $255,%xmm0,%xmm2 + pshufd $0xff,%xmm0,%xmm2 pxor %xmm3,%xmm3 .byte 102,15,56,221,211 @@ -3462,11 +3462,11 @@ __aesni_set_encrypt_key: movups %xmm0,(%rax) leaq 16(%rax),%rax .Lkey_expansion_128_cold: - shufps $16,%xmm0,%xmm4 + shufps $0b00010000,%xmm0,%xmm4 xorps %xmm4,%xmm0 - shufps $140,%xmm0,%xmm4 + shufps $0b10001100,%xmm0,%xmm4 xorps %xmm4,%xmm0 - shufps $255,%xmm1,%xmm1 + shufps $0b11111111,%xmm1,%xmm1 xorps %xmm1,%xmm0 .byte 0xf3,0xc3 @@ -3477,25 +3477,25 @@ __aesni_set_encrypt_key: .Lkey_expansion_192a_cold: movaps %xmm2,%xmm5 .Lkey_expansion_192b_warm: - shufps $16,%xmm0,%xmm4 + shufps $0b00010000,%xmm0,%xmm4 movdqa %xmm2,%xmm3 xorps %xmm4,%xmm0 - shufps $140,%xmm0,%xmm4 + shufps $0b10001100,%xmm0,%xmm4 pslldq $4,%xmm3 xorps %xmm4,%xmm0 - pshufd $85,%xmm1,%xmm1 + pshufd $0b01010101,%xmm1,%xmm1 pxor %xmm3,%xmm2 pxor %xmm1,%xmm0 - pshufd $255,%xmm0,%xmm3 + pshufd $0b11111111,%xmm0,%xmm3 pxor %xmm3,%xmm2 .byte 0xf3,0xc3 .align 16 .Lkey_expansion_192b: movaps %xmm0,%xmm3 - shufps $68,%xmm0,%xmm5 + shufps $0b01000100,%xmm0,%xmm5 movups %xmm5,(%rax) - shufps $78,%xmm2,%xmm3 + shufps $0b01001110,%xmm2,%xmm3 movups %xmm3,16(%rax) leaq 32(%rax),%rax jmp .Lkey_expansion_192b_warm @@ -3505,11 +3505,11 @@ __aesni_set_encrypt_key: movups %xmm2,(%rax) leaq 16(%rax),%rax .Lkey_expansion_256a_cold: - shufps $16,%xmm0,%xmm4 + shufps $0b00010000,%xmm0,%xmm4 xorps %xmm4,%xmm0 - shufps $140,%xmm0,%xmm4 + shufps $0b10001100,%xmm0,%xmm4 xorps %xmm4,%xmm0 - shufps $255,%xmm1,%xmm1 + shufps $0b11111111,%xmm1,%xmm1 xorps %xmm1,%xmm0 .byte 0xf3,0xc3 @@ -3518,11 +3518,11 @@ __aesni_set_encrypt_key: movups %xmm0,(%rax) leaq 16(%rax),%rax - shufps $16,%xmm2,%xmm4 + shufps $0b00010000,%xmm2,%xmm4 xorps %xmm4,%xmm2 - shufps $140,%xmm2,%xmm4 + shufps $0b10001100,%xmm2,%xmm4 xorps %xmm4,%xmm2 - shufps $170,%xmm1,%xmm1 + shufps $0b10101010,%xmm1,%xmm1 xorps %xmm1,%xmm2 .byte 0xf3,0xc3 .size aesni_set_encrypt_key,.-aesni_set_encrypt_key diff --git a/deps/openssl/asm_obsolete/x64-elf-gas/aes/bsaes-x86_64.s b/deps/openssl/asm_obsolete/x64-elf-gas/aes/bsaes-x86_64.s index 5b363a5eef9020..0fd201167f647a 100644 --- a/deps/openssl/asm_obsolete/x64-elf-gas/aes/bsaes-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-elf-gas/aes/bsaes-x86_64.s @@ -324,45 +324,45 @@ _bsaes_encrypt8_bitslice: pxor %xmm2,%xmm5 decl %r10d jl .Lenc_done - pshufd $147,%xmm15,%xmm7 - pshufd $147,%xmm0,%xmm8 + pshufd $0x93,%xmm15,%xmm7 + pshufd $0x93,%xmm0,%xmm8 pxor %xmm7,%xmm15 - pshufd $147,%xmm3,%xmm9 + pshufd $0x93,%xmm3,%xmm9 pxor %xmm8,%xmm0 - pshufd $147,%xmm5,%xmm10 + pshufd $0x93,%xmm5,%xmm10 pxor %xmm9,%xmm3 - pshufd $147,%xmm2,%xmm11 + pshufd $0x93,%xmm2,%xmm11 pxor %xmm10,%xmm5 - pshufd $147,%xmm6,%xmm12 + pshufd $0x93,%xmm6,%xmm12 pxor %xmm11,%xmm2 - pshufd $147,%xmm1,%xmm13 + pshufd $0x93,%xmm1,%xmm13 pxor %xmm12,%xmm6 - pshufd $147,%xmm4,%xmm14 + pshufd $0x93,%xmm4,%xmm14 pxor %xmm13,%xmm1 pxor %xmm14,%xmm4 pxor %xmm15,%xmm8 pxor %xmm4,%xmm7 pxor %xmm4,%xmm8 - pshufd $78,%xmm15,%xmm15 + pshufd $0x4E,%xmm15,%xmm15 pxor %xmm0,%xmm9 - pshufd $78,%xmm0,%xmm0 + pshufd $0x4E,%xmm0,%xmm0 pxor %xmm2,%xmm12 pxor %xmm7,%xmm15 pxor %xmm6,%xmm13 pxor %xmm8,%xmm0 pxor %xmm5,%xmm11 - pshufd $78,%xmm2,%xmm7 + pshufd $0x4E,%xmm2,%xmm7 pxor %xmm1,%xmm14 - pshufd $78,%xmm6,%xmm8 + pshufd $0x4E,%xmm6,%xmm8 pxor %xmm3,%xmm10 - pshufd $78,%xmm5,%xmm2 + pshufd $0x4E,%xmm5,%xmm2 pxor %xmm4,%xmm10 - pshufd $78,%xmm4,%xmm6 + pshufd $0x4E,%xmm4,%xmm6 pxor %xmm4,%xmm11 - pshufd $78,%xmm1,%xmm5 + pshufd $0x4E,%xmm1,%xmm5 pxor %xmm11,%xmm7 - pshufd $78,%xmm3,%xmm1 + pshufd $0x4E,%xmm3,%xmm1 pxor %xmm12,%xmm8 pxor %xmm10,%xmm2 pxor %xmm14,%xmm6 @@ -796,24 +796,24 @@ _bsaes_decrypt8: decl %r10d jl .Ldec_done - pshufd $78,%xmm15,%xmm7 - pshufd $78,%xmm2,%xmm13 + pshufd $0x4E,%xmm15,%xmm7 + pshufd $0x4E,%xmm2,%xmm13 pxor %xmm15,%xmm7 - pshufd $78,%xmm4,%xmm14 + pshufd $0x4E,%xmm4,%xmm14 pxor %xmm2,%xmm13 - pshufd $78,%xmm0,%xmm8 + pshufd $0x4E,%xmm0,%xmm8 pxor %xmm4,%xmm14 - pshufd $78,%xmm5,%xmm9 + pshufd $0x4E,%xmm5,%xmm9 pxor %xmm0,%xmm8 - pshufd $78,%xmm3,%xmm10 + pshufd $0x4E,%xmm3,%xmm10 pxor %xmm5,%xmm9 pxor %xmm13,%xmm15 pxor %xmm13,%xmm0 - pshufd $78,%xmm1,%xmm11 + pshufd $0x4E,%xmm1,%xmm11 pxor %xmm3,%xmm10 pxor %xmm7,%xmm5 pxor %xmm8,%xmm3 - pshufd $78,%xmm6,%xmm12 + pshufd $0x4E,%xmm6,%xmm12 pxor %xmm1,%xmm11 pxor %xmm14,%xmm0 pxor %xmm9,%xmm1 @@ -827,45 +827,45 @@ _bsaes_decrypt8: pxor %xmm14,%xmm1 pxor %xmm14,%xmm6 pxor %xmm12,%xmm4 - pshufd $147,%xmm15,%xmm7 - pshufd $147,%xmm0,%xmm8 + pshufd $0x93,%xmm15,%xmm7 + pshufd $0x93,%xmm0,%xmm8 pxor %xmm7,%xmm15 - pshufd $147,%xmm5,%xmm9 + pshufd $0x93,%xmm5,%xmm9 pxor %xmm8,%xmm0 - pshufd $147,%xmm3,%xmm10 + pshufd $0x93,%xmm3,%xmm10 pxor %xmm9,%xmm5 - pshufd $147,%xmm1,%xmm11 + pshufd $0x93,%xmm1,%xmm11 pxor %xmm10,%xmm3 - pshufd $147,%xmm6,%xmm12 + pshufd $0x93,%xmm6,%xmm12 pxor %xmm11,%xmm1 - pshufd $147,%xmm2,%xmm13 + pshufd $0x93,%xmm2,%xmm13 pxor %xmm12,%xmm6 - pshufd $147,%xmm4,%xmm14 + pshufd $0x93,%xmm4,%xmm14 pxor %xmm13,%xmm2 pxor %xmm14,%xmm4 pxor %xmm15,%xmm8 pxor %xmm4,%xmm7 pxor %xmm4,%xmm8 - pshufd $78,%xmm15,%xmm15 + pshufd $0x4E,%xmm15,%xmm15 pxor %xmm0,%xmm9 - pshufd $78,%xmm0,%xmm0 + pshufd $0x4E,%xmm0,%xmm0 pxor %xmm1,%xmm12 pxor %xmm7,%xmm15 pxor %xmm6,%xmm13 pxor %xmm8,%xmm0 pxor %xmm3,%xmm11 - pshufd $78,%xmm1,%xmm7 + pshufd $0x4E,%xmm1,%xmm7 pxor %xmm2,%xmm14 - pshufd $78,%xmm6,%xmm8 + pshufd $0x4E,%xmm6,%xmm8 pxor %xmm5,%xmm10 - pshufd $78,%xmm3,%xmm1 + pshufd $0x4E,%xmm3,%xmm1 pxor %xmm4,%xmm10 - pshufd $78,%xmm4,%xmm6 + pshufd $0x4E,%xmm4,%xmm6 pxor %xmm4,%xmm11 - pshufd $78,%xmm2,%xmm3 + pshufd $0x4E,%xmm2,%xmm3 pxor %xmm11,%xmm7 - pshufd $78,%xmm5,%xmm2 + pshufd $0x4E,%xmm5,%xmm2 pxor %xmm12,%xmm8 pxor %xmm1,%xmm10 pxor %xmm14,%xmm6 @@ -1552,20 +1552,20 @@ bsaes_xts_encrypt: movdqa %xmm7,(%rax) andq $-16,%r14 - subq $128,%rsp + subq $0x80,%rsp movdqa 32(%rbp),%xmm6 pxor %xmm14,%xmm14 movdqa .Lxts_magic(%rip),%xmm12 pcmpgtd %xmm6,%xmm14 - subq $128,%r14 + subq $0x80,%r14 jc .Lxts_enc_short jmp .Lxts_enc_loop .align 16 .Lxts_enc_loop: - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm15 movdqa %xmm6,0(%rsp) @@ -1573,7 +1573,7 @@ bsaes_xts_encrypt: pand %xmm12,%xmm13 pcmpgtd %xmm6,%xmm14 pxor %xmm13,%xmm6 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm0 movdqa %xmm6,16(%rsp) @@ -1582,7 +1582,7 @@ bsaes_xts_encrypt: pcmpgtd %xmm6,%xmm14 pxor %xmm13,%xmm6 movdqu 0(%r12),%xmm7 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm1 movdqa %xmm6,32(%rsp) @@ -1592,7 +1592,7 @@ bsaes_xts_encrypt: pxor %xmm13,%xmm6 movdqu 16(%r12),%xmm8 pxor %xmm7,%xmm15 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm2 movdqa %xmm6,48(%rsp) @@ -1602,7 +1602,7 @@ bsaes_xts_encrypt: pxor %xmm13,%xmm6 movdqu 32(%r12),%xmm9 pxor %xmm8,%xmm0 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm3 movdqa %xmm6,64(%rsp) @@ -1612,7 +1612,7 @@ bsaes_xts_encrypt: pxor %xmm13,%xmm6 movdqu 48(%r12),%xmm10 pxor %xmm9,%xmm1 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm4 movdqa %xmm6,80(%rsp) @@ -1622,7 +1622,7 @@ bsaes_xts_encrypt: pxor %xmm13,%xmm6 movdqu 64(%r12),%xmm11 pxor %xmm10,%xmm2 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm5 movdqa %xmm6,96(%rsp) @@ -1666,20 +1666,20 @@ bsaes_xts_encrypt: pxor %xmm14,%xmm14 movdqa .Lxts_magic(%rip),%xmm12 pcmpgtd %xmm6,%xmm14 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 paddq %xmm6,%xmm6 pand %xmm12,%xmm13 pcmpgtd %xmm6,%xmm14 pxor %xmm13,%xmm6 - subq $128,%r14 + subq $0x80,%r14 jnc .Lxts_enc_loop .Lxts_enc_short: - addq $128,%r14 + addq $0x80,%r14 jz .Lxts_enc_done - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm15 movdqa %xmm6,0(%rsp) @@ -1687,7 +1687,7 @@ bsaes_xts_encrypt: pand %xmm12,%xmm13 pcmpgtd %xmm6,%xmm14 pxor %xmm13,%xmm6 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm0 movdqa %xmm6,16(%rsp) @@ -1698,7 +1698,7 @@ bsaes_xts_encrypt: movdqu 0(%r12),%xmm7 cmpq $16,%r14 je .Lxts_enc_1 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm1 movdqa %xmm6,32(%rsp) @@ -1710,7 +1710,7 @@ bsaes_xts_encrypt: cmpq $32,%r14 je .Lxts_enc_2 pxor %xmm7,%xmm15 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm2 movdqa %xmm6,48(%rsp) @@ -1722,7 +1722,7 @@ bsaes_xts_encrypt: cmpq $48,%r14 je .Lxts_enc_3 pxor %xmm8,%xmm0 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm3 movdqa %xmm6,64(%rsp) @@ -1734,7 +1734,7 @@ bsaes_xts_encrypt: cmpq $64,%r14 je .Lxts_enc_4 pxor %xmm9,%xmm1 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm4 movdqa %xmm6,80(%rsp) @@ -1746,7 +1746,7 @@ bsaes_xts_encrypt: cmpq $80,%r14 je .Lxts_enc_5 pxor %xmm10,%xmm2 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm5 movdqa %xmm6,96(%rsp) @@ -2011,20 +2011,20 @@ bsaes_xts_decrypt: shlq $4,%rax subq %rax,%r14 - subq $128,%rsp + subq $0x80,%rsp movdqa 32(%rbp),%xmm6 pxor %xmm14,%xmm14 movdqa .Lxts_magic(%rip),%xmm12 pcmpgtd %xmm6,%xmm14 - subq $128,%r14 + subq $0x80,%r14 jc .Lxts_dec_short jmp .Lxts_dec_loop .align 16 .Lxts_dec_loop: - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm15 movdqa %xmm6,0(%rsp) @@ -2032,7 +2032,7 @@ bsaes_xts_decrypt: pand %xmm12,%xmm13 pcmpgtd %xmm6,%xmm14 pxor %xmm13,%xmm6 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm0 movdqa %xmm6,16(%rsp) @@ -2041,7 +2041,7 @@ bsaes_xts_decrypt: pcmpgtd %xmm6,%xmm14 pxor %xmm13,%xmm6 movdqu 0(%r12),%xmm7 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm1 movdqa %xmm6,32(%rsp) @@ -2051,7 +2051,7 @@ bsaes_xts_decrypt: pxor %xmm13,%xmm6 movdqu 16(%r12),%xmm8 pxor %xmm7,%xmm15 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm2 movdqa %xmm6,48(%rsp) @@ -2061,7 +2061,7 @@ bsaes_xts_decrypt: pxor %xmm13,%xmm6 movdqu 32(%r12),%xmm9 pxor %xmm8,%xmm0 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm3 movdqa %xmm6,64(%rsp) @@ -2071,7 +2071,7 @@ bsaes_xts_decrypt: pxor %xmm13,%xmm6 movdqu 48(%r12),%xmm10 pxor %xmm9,%xmm1 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm4 movdqa %xmm6,80(%rsp) @@ -2081,7 +2081,7 @@ bsaes_xts_decrypt: pxor %xmm13,%xmm6 movdqu 64(%r12),%xmm11 pxor %xmm10,%xmm2 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm5 movdqa %xmm6,96(%rsp) @@ -2125,20 +2125,20 @@ bsaes_xts_decrypt: pxor %xmm14,%xmm14 movdqa .Lxts_magic(%rip),%xmm12 pcmpgtd %xmm6,%xmm14 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 paddq %xmm6,%xmm6 pand %xmm12,%xmm13 pcmpgtd %xmm6,%xmm14 pxor %xmm13,%xmm6 - subq $128,%r14 + subq $0x80,%r14 jnc .Lxts_dec_loop .Lxts_dec_short: - addq $128,%r14 + addq $0x80,%r14 jz .Lxts_dec_done - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm15 movdqa %xmm6,0(%rsp) @@ -2146,7 +2146,7 @@ bsaes_xts_decrypt: pand %xmm12,%xmm13 pcmpgtd %xmm6,%xmm14 pxor %xmm13,%xmm6 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm0 movdqa %xmm6,16(%rsp) @@ -2157,7 +2157,7 @@ bsaes_xts_decrypt: movdqu 0(%r12),%xmm7 cmpq $16,%r14 je .Lxts_dec_1 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm1 movdqa %xmm6,32(%rsp) @@ -2169,7 +2169,7 @@ bsaes_xts_decrypt: cmpq $32,%r14 je .Lxts_dec_2 pxor %xmm7,%xmm15 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm2 movdqa %xmm6,48(%rsp) @@ -2181,7 +2181,7 @@ bsaes_xts_decrypt: cmpq $48,%r14 je .Lxts_dec_3 pxor %xmm8,%xmm0 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm3 movdqa %xmm6,64(%rsp) @@ -2193,7 +2193,7 @@ bsaes_xts_decrypt: cmpq $64,%r14 je .Lxts_dec_4 pxor %xmm9,%xmm1 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm4 movdqa %xmm6,80(%rsp) @@ -2205,7 +2205,7 @@ bsaes_xts_decrypt: cmpq $80,%r14 je .Lxts_dec_5 pxor %xmm10,%xmm2 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm5 movdqa %xmm6,96(%rsp) @@ -2382,7 +2382,7 @@ bsaes_xts_decrypt: pxor %xmm14,%xmm14 movdqa .Lxts_magic(%rip),%xmm12 pcmpgtd %xmm6,%xmm14 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 movdqa %xmm6,%xmm5 paddq %xmm6,%xmm6 pand %xmm12,%xmm13 diff --git a/deps/openssl/asm_obsolete/x64-elf-gas/aes/vpaes-x86_64.s b/deps/openssl/asm_obsolete/x64-elf-gas/aes/vpaes-x86_64.s index b9d6df5134ec60..bf7c2b0b6f6b04 100644 --- a/deps/openssl/asm_obsolete/x64-elf-gas/aes/vpaes-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-elf-gas/aes/vpaes-x86_64.s @@ -60,7 +60,7 @@ _vpaes_encrypt_core: addq $16,%r11 pxor %xmm0,%xmm3 .byte 102,15,56,0,193 - andq $48,%r11 + andq $0x30,%r11 subq $1,%rax pxor %xmm3,%xmm0 @@ -120,10 +120,10 @@ _vpaes_decrypt_core: pand %xmm9,%xmm0 .byte 102,15,56,0,208 movdqa .Lk_dipt+16(%rip),%xmm0 - xorq $48,%r11 + xorq $0x30,%r11 leaq .Lk_dsbd(%rip),%r10 .byte 102,15,56,0,193 - andq $48,%r11 + andq $0x30,%r11 pxor %xmm5,%xmm2 movdqa .Lk_mc_forward+48(%rip),%xmm5 pxor %xmm2,%xmm0 @@ -242,7 +242,7 @@ _vpaes_schedule_core: movdqa (%r8,%r10,1),%xmm1 .byte 102,15,56,0,217 movdqu %xmm3,(%rdx) - xorq $48,%r8 + xorq $0x30,%r8 .Lschedule_go: cmpl $192,%esi @@ -332,7 +332,7 @@ _vpaes_schedule_core: call _vpaes_schedule_mangle - pshufd $255,%xmm0,%xmm0 + pshufd $0xFF,%xmm0,%xmm0 movdqa %xmm7,%xmm5 movdqa %xmm6,%xmm7 call _vpaes_schedule_low_round @@ -399,8 +399,8 @@ _vpaes_schedule_core: .type _vpaes_schedule_192_smear,@function .align 16 _vpaes_schedule_192_smear: - pshufd $128,%xmm6,%xmm1 - pshufd $254,%xmm7,%xmm0 + pshufd $0x80,%xmm6,%xmm1 + pshufd $0xFE,%xmm7,%xmm0 pxor %xmm1,%xmm6 pxor %xmm1,%xmm1 pxor %xmm0,%xmm6 @@ -437,7 +437,7 @@ _vpaes_schedule_round: pxor %xmm1,%xmm7 - pshufd $255,%xmm0,%xmm0 + pshufd $0xFF,%xmm0,%xmm0 .byte 102,15,58,15,192,1 @@ -596,7 +596,7 @@ _vpaes_schedule_mangle: movdqa (%r8,%r10,1),%xmm1 .byte 102,15,56,0,217 addq $-16,%r8 - andq $48,%r8 + andq $0x30,%r8 movdqu %xmm3,(%rdx) .byte 0xf3,0xc3 .size _vpaes_schedule_mangle,.-_vpaes_schedule_mangle @@ -614,7 +614,7 @@ vpaes_set_encrypt_key: movl %eax,240(%rdx) movl $0,%ecx - movl $48,%r8d + movl $0x30,%r8d call _vpaes_schedule_core xorl %eax,%eax .byte 0xf3,0xc3 diff --git a/deps/openssl/asm_obsolete/x64-elf-gas/bn/rsaz-x86_64.s b/deps/openssl/asm_obsolete/x64-elf-gas/bn/rsaz-x86_64.s index b43eb278e2cc06..4a1211329c67ea 100644 --- a/deps/openssl/asm_obsolete/x64-elf-gas/bn/rsaz-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-elf-gas/bn/rsaz-x86_64.s @@ -461,48 +461,94 @@ rsaz_512_mul_gather4: pushq %r14 pushq %r15 - movl %r9d,%r9d - subq $128+24,%rsp + subq $152,%rsp .Lmul_gather4_body: - movl 64(%rdx,%r9,4),%eax -.byte 102,72,15,110,199 - movl (%rdx,%r9,4),%ebx -.byte 102,72,15,110,201 + movd %r9d,%xmm8 + movdqa .Linc+16(%rip),%xmm1 + movdqa .Linc(%rip),%xmm0 + + pshufd $0,%xmm8,%xmm8 + movdqa %xmm1,%xmm7 + movdqa %xmm1,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm8,%xmm0 + movdqa %xmm7,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm8,%xmm1 + movdqa %xmm7,%xmm4 + paddd %xmm2,%xmm3 + pcmpeqd %xmm8,%xmm2 + movdqa %xmm7,%xmm5 + paddd %xmm3,%xmm4 + pcmpeqd %xmm8,%xmm3 + movdqa %xmm7,%xmm6 + paddd %xmm4,%xmm5 + pcmpeqd %xmm8,%xmm4 + paddd %xmm5,%xmm6 + pcmpeqd %xmm8,%xmm5 + paddd %xmm6,%xmm7 + pcmpeqd %xmm8,%xmm6 + pcmpeqd %xmm8,%xmm7 + + movdqa 0(%rdx),%xmm8 + movdqa 16(%rdx),%xmm9 + movdqa 32(%rdx),%xmm10 + movdqa 48(%rdx),%xmm11 + pand %xmm0,%xmm8 + movdqa 64(%rdx),%xmm12 + pand %xmm1,%xmm9 + movdqa 80(%rdx),%xmm13 + pand %xmm2,%xmm10 + movdqa 96(%rdx),%xmm14 + pand %xmm3,%xmm11 + movdqa 112(%rdx),%xmm15 + leaq 128(%rdx),%rbp + pand %xmm4,%xmm12 + pand %xmm5,%xmm13 + pand %xmm6,%xmm14 + pand %xmm7,%xmm15 + por %xmm10,%xmm8 + por %xmm11,%xmm9 + por %xmm12,%xmm8 + por %xmm13,%xmm9 + por %xmm14,%xmm8 + por %xmm15,%xmm9 + + por %xmm9,%xmm8 + pshufd $0x4e,%xmm8,%xmm9 + por %xmm9,%xmm8 +.byte 102,76,15,126,195 + movq %r8,128(%rsp) + movq %rdi,128+8(%rsp) + movq %rcx,128+16(%rsp) - shlq $32,%rax - orq %rax,%rbx movq (%rsi),%rax movq 8(%rsi),%rcx - leaq 128(%rdx,%r9,4),%rbp mulq %rbx movq %rax,(%rsp) movq %rcx,%rax movq %rdx,%r8 mulq %rbx - movd (%rbp),%xmm4 addq %rax,%r8 movq 16(%rsi),%rax movq %rdx,%r9 adcq $0,%r9 mulq %rbx - movd 64(%rbp),%xmm5 addq %rax,%r9 movq 24(%rsi),%rax movq %rdx,%r10 adcq $0,%r10 mulq %rbx - pslldq $4,%xmm5 addq %rax,%r10 movq 32(%rsi),%rax movq %rdx,%r11 adcq $0,%r11 mulq %rbx - por %xmm5,%xmm4 addq %rax,%r11 movq 40(%rsi),%rax movq %rdx,%r12 @@ -515,14 +561,12 @@ rsaz_512_mul_gather4: adcq $0,%r13 mulq %rbx - leaq 128(%rbp),%rbp addq %rax,%r13 movq 56(%rsi),%rax movq %rdx,%r14 adcq $0,%r14 mulq %rbx -.byte 102,72,15,126,227 addq %rax,%r14 movq (%rsi),%rax movq %rdx,%r15 @@ -534,6 +578,35 @@ rsaz_512_mul_gather4: .align 32 .Loop_mul_gather: + movdqa 0(%rbp),%xmm8 + movdqa 16(%rbp),%xmm9 + movdqa 32(%rbp),%xmm10 + movdqa 48(%rbp),%xmm11 + pand %xmm0,%xmm8 + movdqa 64(%rbp),%xmm12 + pand %xmm1,%xmm9 + movdqa 80(%rbp),%xmm13 + pand %xmm2,%xmm10 + movdqa 96(%rbp),%xmm14 + pand %xmm3,%xmm11 + movdqa 112(%rbp),%xmm15 + leaq 128(%rbp),%rbp + pand %xmm4,%xmm12 + pand %xmm5,%xmm13 + pand %xmm6,%xmm14 + pand %xmm7,%xmm15 + por %xmm10,%xmm8 + por %xmm11,%xmm9 + por %xmm12,%xmm8 + por %xmm13,%xmm9 + por %xmm14,%xmm8 + por %xmm15,%xmm9 + + por %xmm9,%xmm8 + pshufd $0x4e,%xmm8,%xmm9 + por %xmm9,%xmm8 +.byte 102,76,15,126,195 + mulq %rbx addq %rax,%r8 movq 8(%rsi),%rax @@ -542,7 +615,6 @@ rsaz_512_mul_gather4: adcq $0,%r8 mulq %rbx - movd (%rbp),%xmm4 addq %rax,%r9 movq 16(%rsi),%rax adcq $0,%rdx @@ -551,7 +623,6 @@ rsaz_512_mul_gather4: adcq $0,%r9 mulq %rbx - movd 64(%rbp),%xmm5 addq %rax,%r10 movq 24(%rsi),%rax adcq $0,%rdx @@ -560,7 +631,6 @@ rsaz_512_mul_gather4: adcq $0,%r10 mulq %rbx - pslldq $4,%xmm5 addq %rax,%r11 movq 32(%rsi),%rax adcq $0,%rdx @@ -569,7 +639,6 @@ rsaz_512_mul_gather4: adcq $0,%r11 mulq %rbx - por %xmm5,%xmm4 addq %rax,%r12 movq 40(%rsi),%rax adcq $0,%rdx @@ -594,7 +663,6 @@ rsaz_512_mul_gather4: adcq $0,%r14 mulq %rbx -.byte 102,72,15,126,227 addq %rax,%r15 movq (%rsi),%rax adcq $0,%rdx @@ -602,7 +670,6 @@ rsaz_512_mul_gather4: movq %rdx,%r15 adcq $0,%r15 - leaq 128(%rbp),%rbp leaq 8(%rdi),%rdi decl %ecx @@ -617,8 +684,8 @@ rsaz_512_mul_gather4: movq %r14,48(%rdi) movq %r15,56(%rdi) -.byte 102,72,15,126,199 -.byte 102,72,15,126,205 + movq 128+8(%rsp),%rdi + movq 128+16(%rsp),%rbp movq (%rsp),%r8 movq 8(%rsp),%r9 @@ -667,7 +734,7 @@ rsaz_512_mul_scatter4: movl %r9d,%r9d subq $128+24,%rsp .Lmul_scatter4_body: - leaq (%r8,%r9,4),%r8 + leaq (%r8,%r9,8),%r8 .byte 102,72,15,110,199 .byte 102,72,15,110,202 .byte 102,73,15,110,208 @@ -703,30 +770,14 @@ rsaz_512_mul_scatter4: call __rsaz_512_subtract - movl %r8d,0(%rsi) - shrq $32,%r8 - movl %r9d,128(%rsi) - shrq $32,%r9 - movl %r10d,256(%rsi) - shrq $32,%r10 - movl %r11d,384(%rsi) - shrq $32,%r11 - movl %r12d,512(%rsi) - shrq $32,%r12 - movl %r13d,640(%rsi) - shrq $32,%r13 - movl %r14d,768(%rsi) - shrq $32,%r14 - movl %r15d,896(%rsi) - shrq $32,%r15 - movl %r8d,64(%rsi) - movl %r9d,192(%rsi) - movl %r10d,320(%rsi) - movl %r11d,448(%rsi) - movl %r12d,576(%rsi) - movl %r13d,704(%rsi) - movl %r14d,832(%rsi) - movl %r15d,960(%rsi) + movq %r8,0(%rsi) + movq %r9,128(%rsi) + movq %r10,256(%rsi) + movq %r11,384(%rsi) + movq %r12,512(%rsi) + movq %r13,640(%rsi) + movq %r14,768(%rsi) + movq %r15,896(%rsi) leaq 128+24+48(%rsp),%rax movq -48(%rax),%r15 @@ -1079,16 +1130,14 @@ __rsaz_512_mul: .type rsaz_512_scatter4,@function .align 16 rsaz_512_scatter4: - leaq (%rdi,%rdx,4),%rdi + leaq (%rdi,%rdx,8),%rdi movl $8,%r9d jmp .Loop_scatter .align 16 .Loop_scatter: movq (%rsi),%rax leaq 8(%rsi),%rsi - movl %eax,(%rdi) - shrq $32,%rax - movl %eax,64(%rdi) + movq %rax,(%rdi) leaq 128(%rdi),%rdi decl %r9d jnz .Loop_scatter @@ -1099,19 +1148,72 @@ rsaz_512_scatter4: .type rsaz_512_gather4,@function .align 16 rsaz_512_gather4: - leaq (%rsi,%rdx,4),%rsi + movd %edx,%xmm8 + movdqa .Linc+16(%rip),%xmm1 + movdqa .Linc(%rip),%xmm0 + + pshufd $0,%xmm8,%xmm8 + movdqa %xmm1,%xmm7 + movdqa %xmm1,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm8,%xmm0 + movdqa %xmm7,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm8,%xmm1 + movdqa %xmm7,%xmm4 + paddd %xmm2,%xmm3 + pcmpeqd %xmm8,%xmm2 + movdqa %xmm7,%xmm5 + paddd %xmm3,%xmm4 + pcmpeqd %xmm8,%xmm3 + movdqa %xmm7,%xmm6 + paddd %xmm4,%xmm5 + pcmpeqd %xmm8,%xmm4 + paddd %xmm5,%xmm6 + pcmpeqd %xmm8,%xmm5 + paddd %xmm6,%xmm7 + pcmpeqd %xmm8,%xmm6 + pcmpeqd %xmm8,%xmm7 movl $8,%r9d jmp .Loop_gather .align 16 .Loop_gather: - movl (%rsi),%eax - movl 64(%rsi),%r8d + movdqa 0(%rsi),%xmm8 + movdqa 16(%rsi),%xmm9 + movdqa 32(%rsi),%xmm10 + movdqa 48(%rsi),%xmm11 + pand %xmm0,%xmm8 + movdqa 64(%rsi),%xmm12 + pand %xmm1,%xmm9 + movdqa 80(%rsi),%xmm13 + pand %xmm2,%xmm10 + movdqa 96(%rsi),%xmm14 + pand %xmm3,%xmm11 + movdqa 112(%rsi),%xmm15 leaq 128(%rsi),%rsi - shlq $32,%r8 - orq %r8,%rax - movq %rax,(%rdi) + pand %xmm4,%xmm12 + pand %xmm5,%xmm13 + pand %xmm6,%xmm14 + pand %xmm7,%xmm15 + por %xmm10,%xmm8 + por %xmm11,%xmm9 + por %xmm12,%xmm8 + por %xmm13,%xmm9 + por %xmm14,%xmm8 + por %xmm15,%xmm9 + + por %xmm9,%xmm8 + pshufd $0x4e,%xmm8,%xmm9 + por %xmm9,%xmm8 + movq %xmm8,(%rdi) leaq 8(%rdi),%rdi decl %r9d jnz .Loop_gather .byte 0xf3,0xc3 +.LSEH_end_rsaz_512_gather4: .size rsaz_512_gather4,.-rsaz_512_gather4 + +.align 64 +.Linc: +.long 0,0, 1,1 +.long 2,2, 2,2 diff --git a/deps/openssl/asm_obsolete/x64-elf-gas/bn/x86_64-gf2m.s b/deps/openssl/asm_obsolete/x64-elf-gas/bn/x86_64-gf2m.s index eed057ad6a1a8a..f4e5337565bbc7 100644 --- a/deps/openssl/asm_obsolete/x64-elf-gas/bn/x86_64-gf2m.s +++ b/deps/openssl/asm_obsolete/x64-elf-gas/bn/x86_64-gf2m.s @@ -242,7 +242,7 @@ bn_GF2m_mul_2x2: movq %rcx,56(%rsp) movq %r8,64(%rsp) - movq $15,%r8 + movq $0xf,%r8 movq %rsi,%rax movq %rcx,%rbp call _mul_1x1 diff --git a/deps/openssl/asm_obsolete/x64-elf-gas/bn/x86_64-mont.s b/deps/openssl/asm_obsolete/x64-elf-gas/bn/x86_64-mont.s index b0981692130394..9e0019c163771c 100644 --- a/deps/openssl/asm_obsolete/x64-elf-gas/bn/x86_64-mont.s +++ b/deps/openssl/asm_obsolete/x64-elf-gas/bn/x86_64-mont.s @@ -633,20 +633,20 @@ bn_sqr8x_mont: - leaq -64(%rsp,%r9,4),%r11 + leaq -64(%rsp,%r9,2),%r11 movq (%r8),%r8 subq %rsi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb .Lsqr8x_sp_alt subq %r11,%rsp - leaq -64(%rsp,%r9,4),%rsp + leaq -64(%rsp,%r9,2),%rsp jmp .Lsqr8x_sp_done .align 32 .Lsqr8x_sp_alt: - leaq 4096-64(,%r9,4),%r10 - leaq -64(%rsp,%r9,4),%rsp + leaq 4096-64(,%r9,2),%r10 + leaq -64(%rsp,%r9,2),%rsp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 @@ -656,58 +656,80 @@ bn_sqr8x_mont: movq %r9,%r10 negq %r9 - leaq 64(%rsp,%r9,2),%r11 movq %r8,32(%rsp) movq %rax,40(%rsp) .Lsqr8x_body: - movq %r9,%rbp -.byte 102,73,15,110,211 - shrq $3+2,%rbp - movl OPENSSL_ia32cap_P+8(%rip),%eax - jmp .Lsqr8x_copy_n - -.align 32 -.Lsqr8x_copy_n: - movq 0(%rcx),%xmm0 - movq 8(%rcx),%xmm1 - movq 16(%rcx),%xmm3 - movq 24(%rcx),%xmm4 - leaq 32(%rcx),%rcx - movdqa %xmm0,0(%r11) - movdqa %xmm1,16(%r11) - movdqa %xmm3,32(%r11) - movdqa %xmm4,48(%r11) - leaq 64(%r11),%r11 - decq %rbp - jnz .Lsqr8x_copy_n - +.byte 102,72,15,110,209 pxor %xmm0,%xmm0 .byte 102,72,15,110,207 .byte 102,73,15,110,218 call bn_sqr8x_internal + + + + leaq (%rdi,%r9,1),%rbx + movq %r9,%rcx + movq %r9,%rdx +.byte 102,72,15,126,207 + sarq $3+2,%rcx + jmp .Lsqr8x_sub + +.align 32 +.Lsqr8x_sub: + movq 0(%rbx),%r12 + movq 8(%rbx),%r13 + movq 16(%rbx),%r14 + movq 24(%rbx),%r15 + leaq 32(%rbx),%rbx + sbbq 0(%rbp),%r12 + sbbq 8(%rbp),%r13 + sbbq 16(%rbp),%r14 + sbbq 24(%rbp),%r15 + leaq 32(%rbp),%rbp + movq %r12,0(%rdi) + movq %r13,8(%rdi) + movq %r14,16(%rdi) + movq %r15,24(%rdi) + leaq 32(%rdi),%rdi + incq %rcx + jnz .Lsqr8x_sub + + sbbq $0,%rax + leaq (%rbx,%r9,1),%rbx + leaq (%rdi,%r9,1),%rdi + +.byte 102,72,15,110,200 pxor %xmm0,%xmm0 - leaq 48(%rsp),%rax - leaq 64(%rsp,%r9,2),%rdx - shrq $3+2,%r9 + pshufd $0,%xmm1,%xmm1 movq 40(%rsp),%rsi - jmp .Lsqr8x_zero + jmp .Lsqr8x_cond_copy .align 32 -.Lsqr8x_zero: - movdqa %xmm0,0(%rax) - movdqa %xmm0,16(%rax) - movdqa %xmm0,32(%rax) - movdqa %xmm0,48(%rax) - leaq 64(%rax),%rax - movdqa %xmm0,0(%rdx) - movdqa %xmm0,16(%rdx) - movdqa %xmm0,32(%rdx) - movdqa %xmm0,48(%rdx) - leaq 64(%rdx),%rdx - decq %r9 - jnz .Lsqr8x_zero +.Lsqr8x_cond_copy: + movdqa 0(%rbx),%xmm2 + movdqa 16(%rbx),%xmm3 + leaq 32(%rbx),%rbx + movdqu 0(%rdi),%xmm4 + movdqu 16(%rdi),%xmm5 + leaq 32(%rdi),%rdi + movdqa %xmm0,-32(%rbx) + movdqa %xmm0,-16(%rbx) + movdqa %xmm0,-32(%rbx,%rdx,1) + movdqa %xmm0,-16(%rbx,%rdx,1) + pcmpeqd %xmm1,%xmm0 + pand %xmm1,%xmm2 + pand %xmm1,%xmm3 + pand %xmm0,%xmm4 + pand %xmm0,%xmm5 + pxor %xmm0,%xmm0 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqu %xmm4,-32(%rdi) + movdqu %xmm5,-16(%rdi) + addq $32,%r9 + jnz .Lsqr8x_cond_copy movq $1,%rax movq -48(%rsi),%r15 diff --git a/deps/openssl/asm_obsolete/x64-elf-gas/bn/x86_64-mont5.s b/deps/openssl/asm_obsolete/x64-elf-gas/bn/x86_64-mont5.s index 5f98ff2237b711..8afe2496952006 100644 --- a/deps/openssl/asm_obsolete/x64-elf-gas/bn/x86_64-mont5.s +++ b/deps/openssl/asm_obsolete/x64-elf-gas/bn/x86_64-mont5.s @@ -14,46 +14,151 @@ bn_mul_mont_gather5: .Lmul_enter: movl %r9d,%r9d movq %rsp,%rax - movl 8(%rsp),%r10d + movd 8(%rsp),%xmm5 + leaq .Linc(%rip),%r10 pushq %rbx pushq %rbp pushq %r12 pushq %r13 pushq %r14 pushq %r15 + leaq 2(%r9),%r11 negq %r11 - leaq (%rsp,%r11,8),%rsp + leaq -264(%rsp,%r11,8),%rsp andq $-1024,%rsp movq %rax,8(%rsp,%r9,8) .Lmul_body: - movq %rdx,%r12 - movq %r10,%r11 - shrq $3,%r10 - andq $7,%r11 - notq %r10 - leaq .Lmagic_masks(%rip),%rax - andq $3,%r10 - leaq 96(%r12,%r11,8),%r12 - movq 0(%rax,%r10,8),%xmm4 - movq 8(%rax,%r10,8),%xmm5 - movq 16(%rax,%r10,8),%xmm6 - movq 24(%rax,%r10,8),%xmm7 - - movq -96(%r12),%xmm0 - movq -32(%r12),%xmm1 - pand %xmm4,%xmm0 - movq 32(%r12),%xmm2 - pand %xmm5,%xmm1 - movq 96(%r12),%xmm3 - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 + leaq 128(%rdx),%r12 + movdqa 0(%r10),%xmm0 + movdqa 16(%r10),%xmm1 + leaq 24-112(%rsp,%r9,8),%r10 + andq $-16,%r10 + + pshufd $0,%xmm5,%xmm5 + movdqa %xmm1,%xmm4 + movdqa %xmm1,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 +.byte 0x67 + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,112(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,128(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,144(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,160(%r10) + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,176(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,192(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,208(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,224(%r10) + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,240(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,256(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,272(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,288(%r10) + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,304(%r10) + + paddd %xmm2,%xmm3 +.byte 0x67 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,320(%r10) + + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,336(%r10) + pand 64(%r12),%xmm0 + + pand 80(%r12),%xmm1 + pand 96(%r12),%xmm2 + movdqa %xmm3,352(%r10) + pand 112(%r12),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + movdqa -128(%r12),%xmm4 + movdqa -112(%r12),%xmm5 + movdqa -96(%r12),%xmm2 + pand 112(%r10),%xmm4 + movdqa -80(%r12),%xmm3 + pand 128(%r10),%xmm5 + por %xmm4,%xmm0 + pand 144(%r10),%xmm2 + por %xmm5,%xmm1 + pand 160(%r10),%xmm3 por %xmm2,%xmm0 + por %xmm3,%xmm1 + movdqa -64(%r12),%xmm4 + movdqa -48(%r12),%xmm5 + movdqa -32(%r12),%xmm2 + pand 176(%r10),%xmm4 + movdqa -16(%r12),%xmm3 + pand 192(%r10),%xmm5 + por %xmm4,%xmm0 + pand 208(%r10),%xmm2 + por %xmm5,%xmm1 + pand 224(%r10),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + movdqa 0(%r12),%xmm4 + movdqa 16(%r12),%xmm5 + movdqa 32(%r12),%xmm2 + pand 240(%r10),%xmm4 + movdqa 48(%r12),%xmm3 + pand 256(%r10),%xmm5 + por %xmm4,%xmm0 + pand 272(%r10),%xmm2 + por %xmm5,%xmm1 + pand 288(%r10),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + por %xmm1,%xmm0 + pshufd $0x4e,%xmm0,%xmm1 + por %xmm1,%xmm0 leaq 256(%r12),%r12 - por %xmm3,%xmm0 - .byte 102,72,15,126,195 movq (%r8),%r8 @@ -62,29 +167,14 @@ bn_mul_mont_gather5: xorq %r14,%r14 xorq %r15,%r15 - movq -96(%r12),%xmm0 - movq -32(%r12),%xmm1 - pand %xmm4,%xmm0 - movq 32(%r12),%xmm2 - pand %xmm5,%xmm1 - movq %r8,%rbp mulq %rbx movq %rax,%r10 movq (%rcx),%rax - movq 96(%r12),%xmm3 - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 - imulq %r10,%rbp movq %rdx,%r11 - por %xmm2,%xmm0 - leaq 256(%r12),%r12 - por %xmm3,%xmm0 - mulq %rbp addq %rax,%r10 movq 8(%rsi),%rax @@ -117,14 +207,12 @@ bn_mul_mont_gather5: cmpq %r9,%r15 jne .L1st -.byte 102,72,15,126,195 addq %rax,%r13 - movq (%rsi),%rax adcq $0,%rdx addq %r11,%r13 adcq $0,%rdx - movq %r13,-16(%rsp,%r15,8) + movq %r13,-16(%rsp,%r9,8) movq %rdx,%r13 movq %r10,%r11 @@ -138,33 +226,78 @@ bn_mul_mont_gather5: jmp .Louter .align 16 .Louter: + leaq 24+128(%rsp,%r9,8),%rdx + andq $-16,%rdx + pxor %xmm4,%xmm4 + pxor %xmm5,%xmm5 + movdqa -128(%r12),%xmm0 + movdqa -112(%r12),%xmm1 + movdqa -96(%r12),%xmm2 + movdqa -80(%r12),%xmm3 + pand -128(%rdx),%xmm0 + pand -112(%rdx),%xmm1 + por %xmm0,%xmm4 + pand -96(%rdx),%xmm2 + por %xmm1,%xmm5 + pand -80(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa -64(%r12),%xmm0 + movdqa -48(%r12),%xmm1 + movdqa -32(%r12),%xmm2 + movdqa -16(%r12),%xmm3 + pand -64(%rdx),%xmm0 + pand -48(%rdx),%xmm1 + por %xmm0,%xmm4 + pand -32(%rdx),%xmm2 + por %xmm1,%xmm5 + pand -16(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa 0(%r12),%xmm0 + movdqa 16(%r12),%xmm1 + movdqa 32(%r12),%xmm2 + movdqa 48(%r12),%xmm3 + pand 0(%rdx),%xmm0 + pand 16(%rdx),%xmm1 + por %xmm0,%xmm4 + pand 32(%rdx),%xmm2 + por %xmm1,%xmm5 + pand 48(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa 64(%r12),%xmm0 + movdqa 80(%r12),%xmm1 + movdqa 96(%r12),%xmm2 + movdqa 112(%r12),%xmm3 + pand 64(%rdx),%xmm0 + pand 80(%rdx),%xmm1 + por %xmm0,%xmm4 + pand 96(%rdx),%xmm2 + por %xmm1,%xmm5 + pand 112(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + por %xmm5,%xmm4 + pshufd $0x4e,%xmm4,%xmm0 + por %xmm4,%xmm0 + leaq 256(%r12),%r12 + + movq (%rsi),%rax +.byte 102,72,15,126,195 + xorq %r15,%r15 movq %r8,%rbp movq (%rsp),%r10 - movq -96(%r12),%xmm0 - movq -32(%r12),%xmm1 - pand %xmm4,%xmm0 - movq 32(%r12),%xmm2 - pand %xmm5,%xmm1 - mulq %rbx addq %rax,%r10 movq (%rcx),%rax adcq $0,%rdx - movq 96(%r12),%xmm3 - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 - imulq %r10,%rbp movq %rdx,%r11 - por %xmm2,%xmm0 - leaq 256(%r12),%r12 - por %xmm3,%xmm0 - mulq %rbp addq %rax,%r10 movq 8(%rsi),%rax @@ -200,15 +333,12 @@ bn_mul_mont_gather5: cmpq %r9,%r15 jne .Linner -.byte 102,72,15,126,195 - addq %rax,%r13 - movq (%rsi),%rax adcq $0,%rdx addq %r10,%r13 - movq (%rsp,%r15,8),%r10 + movq (%rsp,%r9,8),%r10 adcq $0,%rdx - movq %r13,-16(%rsp,%r15,8) + movq %r13,-16(%rsp,%r9,8) movq %rdx,%r13 xorq %rdx,%rdx @@ -255,6 +385,7 @@ bn_mul_mont_gather5: movq 8(%rsp,%r9,8),%rsi movq $1,%rax + movq -48(%rsi),%r15 movq -40(%rsi),%r14 movq -32(%rsi),%r13 @@ -277,10 +408,10 @@ bn_mul4x_mont_gather5: pushq %r13 pushq %r14 pushq %r15 + .byte 0x67 - movl %r9d,%r10d shll $3,%r9d - shll $3+2,%r10d + leaq (%r9,%r9,2),%r10 negq %r9 @@ -290,19 +421,21 @@ bn_mul4x_mont_gather5: - leaq -64(%rsp,%r9,2),%r11 - subq %rsi,%r11 + + + leaq -320(%rsp,%r9,2),%r11 + subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb .Lmul4xsp_alt subq %r11,%rsp - leaq -64(%rsp,%r9,2),%rsp + leaq -320(%rsp,%r9,2),%rsp jmp .Lmul4xsp_done .align 32 .Lmul4xsp_alt: - leaq 4096-64(,%r9,2),%r10 - leaq -64(%rsp,%r9,2),%rsp + leaq 4096-320(,%r9,2),%r10 + leaq -320(%rsp,%r9,2),%rsp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 @@ -318,6 +451,7 @@ bn_mul4x_mont_gather5: movq 40(%rsp),%rsi movq $1,%rax + movq -48(%rsi),%r15 movq -40(%rsi),%r14 movq -32(%rsi),%r13 @@ -333,47 +467,141 @@ bn_mul4x_mont_gather5: .align 32 mul4x_internal: shlq $5,%r9 - movl 8(%rax),%r10d - leaq 256(%rdx,%r9,1),%r13 + movd 8(%rax),%xmm5 + leaq .Linc(%rip),%rax + leaq 128(%rdx,%r9,1),%r13 shrq $5,%r9 - movq %r10,%r11 - shrq $3,%r10 - andq $7,%r11 - notq %r10 - leaq .Lmagic_masks(%rip),%rax - andq $3,%r10 - leaq 96(%rdx,%r11,8),%r12 - movq 0(%rax,%r10,8),%xmm4 - movq 8(%rax,%r10,8),%xmm5 - addq $7,%r11 - movq 16(%rax,%r10,8),%xmm6 - movq 24(%rax,%r10,8),%xmm7 - andq $7,%r11 - - movq -96(%r12),%xmm0 - leaq 256(%r12),%r14 - movq -32(%r12),%xmm1 - pand %xmm4,%xmm0 - movq 32(%r12),%xmm2 - pand %xmm5,%xmm1 - movq 96(%r12),%xmm3 - pand %xmm6,%xmm2 -.byte 0x67 - por %xmm1,%xmm0 - movq -96(%r14),%xmm1 -.byte 0x67 - pand %xmm7,%xmm3 -.byte 0x67 - por %xmm2,%xmm0 - movq -32(%r14),%xmm2 + movdqa 0(%rax),%xmm0 + movdqa 16(%rax),%xmm1 + leaq 88-112(%rsp,%r9,1),%r10 + leaq 128(%rdx),%r12 + + pshufd $0,%xmm5,%xmm5 + movdqa %xmm1,%xmm4 +.byte 0x67,0x67 + movdqa %xmm1,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 .byte 0x67 - pand %xmm4,%xmm1 + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,112(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,128(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,144(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,160(%r10) + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,176(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,192(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,208(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,224(%r10) + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,240(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,256(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,272(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,288(%r10) + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,304(%r10) + + paddd %xmm2,%xmm3 .byte 0x67 - por %xmm3,%xmm0 - movq 32(%r14),%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,320(%r10) + + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,336(%r10) + pand 64(%r12),%xmm0 + pand 80(%r12),%xmm1 + pand 96(%r12),%xmm2 + movdqa %xmm3,352(%r10) + pand 112(%r12),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + movdqa -128(%r12),%xmm4 + movdqa -112(%r12),%xmm5 + movdqa -96(%r12),%xmm2 + pand 112(%r10),%xmm4 + movdqa -80(%r12),%xmm3 + pand 128(%r10),%xmm5 + por %xmm4,%xmm0 + pand 144(%r10),%xmm2 + por %xmm5,%xmm1 + pand 160(%r10),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + movdqa -64(%r12),%xmm4 + movdqa -48(%r12),%xmm5 + movdqa -32(%r12),%xmm2 + pand 176(%r10),%xmm4 + movdqa -16(%r12),%xmm3 + pand 192(%r10),%xmm5 + por %xmm4,%xmm0 + pand 208(%r10),%xmm2 + por %xmm5,%xmm1 + pand 224(%r10),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + movdqa 0(%r12),%xmm4 + movdqa 16(%r12),%xmm5 + movdqa 32(%r12),%xmm2 + pand 240(%r10),%xmm4 + movdqa 48(%r12),%xmm3 + pand 256(%r10),%xmm5 + por %xmm4,%xmm0 + pand 272(%r10),%xmm2 + por %xmm5,%xmm1 + pand 288(%r10),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + por %xmm1,%xmm0 + pshufd $0x4e,%xmm0,%xmm1 + por %xmm1,%xmm0 + leaq 256(%r12),%r12 .byte 102,72,15,126,195 - movq 96(%r14),%xmm0 + movq %r13,16+8(%rsp) movq %rdi,56+8(%rsp) @@ -387,26 +615,10 @@ mul4x_internal: movq %rax,%r10 movq (%rcx),%rax - pand %xmm5,%xmm2 - pand %xmm6,%xmm3 - por %xmm2,%xmm1 - imulq %r10,%rbp - - - - - - - - leaq 64+8(%rsp,%r11,8),%r14 + leaq 64+8(%rsp),%r14 movq %rdx,%r11 - pand %xmm7,%xmm0 - por %xmm3,%xmm1 - leaq 512(%r12),%r12 - por %xmm1,%xmm0 - mulq %rbp addq %rax,%r10 movq 8(%rsi,%r9,1),%rax @@ -415,7 +627,7 @@ mul4x_internal: mulq %rbx addq %rax,%r11 - movq 16(%rcx),%rax + movq 8(%rcx),%rax adcq $0,%rdx movq %rdx,%r10 @@ -425,7 +637,7 @@ mul4x_internal: adcq $0,%rdx addq %r11,%rdi leaq 32(%r9),%r15 - leaq 64(%rcx),%rcx + leaq 32(%rcx),%rcx adcq $0,%rdx movq %rdi,(%r14) movq %rdx,%r13 @@ -435,7 +647,7 @@ mul4x_internal: .L1st4x: mulq %rbx addq %rax,%r10 - movq -32(%rcx),%rax + movq -16(%rcx),%rax leaq 32(%r14),%r14 adcq $0,%rdx movq %rdx,%r11 @@ -451,7 +663,7 @@ mul4x_internal: mulq %rbx addq %rax,%r11 - movq -16(%rcx),%rax + movq -8(%rcx),%rax adcq $0,%rdx movq %rdx,%r10 @@ -481,7 +693,7 @@ mul4x_internal: mulq %rbx addq %rax,%r11 - movq 16(%rcx),%rax + movq 8(%rcx),%rax adcq $0,%rdx movq %rdx,%r10 @@ -490,7 +702,7 @@ mul4x_internal: movq 16(%rsi,%r15,1),%rax adcq $0,%rdx addq %r11,%rdi - leaq 64(%rcx),%rcx + leaq 32(%rcx),%rcx adcq $0,%rdx movq %rdi,(%r14) movq %rdx,%r13 @@ -500,7 +712,7 @@ mul4x_internal: mulq %rbx addq %rax,%r10 - movq -32(%rcx),%rax + movq -16(%rcx),%rax leaq 32(%r14),%r14 adcq $0,%rdx movq %rdx,%r11 @@ -516,7 +728,7 @@ mul4x_internal: mulq %rbx addq %rax,%r11 - movq -16(%rcx),%rax + movq -8(%rcx),%rax adcq $0,%rdx movq %rdx,%r10 @@ -529,8 +741,7 @@ mul4x_internal: movq %rdi,-16(%r14) movq %rdx,%r13 -.byte 102,72,15,126,195 - leaq (%rcx,%r9,2),%rcx + leaq (%rcx,%r9,1),%rcx xorq %rdi,%rdi addq %r10,%r13 @@ -541,6 +752,63 @@ mul4x_internal: .align 32 .Louter4x: + leaq 16+128(%r14),%rdx + pxor %xmm4,%xmm4 + pxor %xmm5,%xmm5 + movdqa -128(%r12),%xmm0 + movdqa -112(%r12),%xmm1 + movdqa -96(%r12),%xmm2 + movdqa -80(%r12),%xmm3 + pand -128(%rdx),%xmm0 + pand -112(%rdx),%xmm1 + por %xmm0,%xmm4 + pand -96(%rdx),%xmm2 + por %xmm1,%xmm5 + pand -80(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa -64(%r12),%xmm0 + movdqa -48(%r12),%xmm1 + movdqa -32(%r12),%xmm2 + movdqa -16(%r12),%xmm3 + pand -64(%rdx),%xmm0 + pand -48(%rdx),%xmm1 + por %xmm0,%xmm4 + pand -32(%rdx),%xmm2 + por %xmm1,%xmm5 + pand -16(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa 0(%r12),%xmm0 + movdqa 16(%r12),%xmm1 + movdqa 32(%r12),%xmm2 + movdqa 48(%r12),%xmm3 + pand 0(%rdx),%xmm0 + pand 16(%rdx),%xmm1 + por %xmm0,%xmm4 + pand 32(%rdx),%xmm2 + por %xmm1,%xmm5 + pand 48(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa 64(%r12),%xmm0 + movdqa 80(%r12),%xmm1 + movdqa 96(%r12),%xmm2 + movdqa 112(%r12),%xmm3 + pand 64(%rdx),%xmm0 + pand 80(%rdx),%xmm1 + por %xmm0,%xmm4 + pand 96(%rdx),%xmm2 + por %xmm1,%xmm5 + pand 112(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + por %xmm5,%xmm4 + pshufd $0x4e,%xmm4,%xmm0 + por %xmm4,%xmm0 + leaq 256(%r12),%r12 +.byte 102,72,15,126,195 + movq (%r14,%r9,1),%r10 movq %r8,%rbp mulq %rbx @@ -548,25 +816,11 @@ mul4x_internal: movq (%rcx),%rax adcq $0,%rdx - movq -96(%r12),%xmm0 - movq -32(%r12),%xmm1 - pand %xmm4,%xmm0 - movq 32(%r12),%xmm2 - pand %xmm5,%xmm1 - movq 96(%r12),%xmm3 - imulq %r10,%rbp -.byte 0x67 movq %rdx,%r11 movq %rdi,(%r14) - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 - por %xmm2,%xmm0 leaq (%r14,%r9,1),%r14 - leaq 256(%r12),%r12 - por %xmm3,%xmm0 mulq %rbp addq %rax,%r10 @@ -576,7 +830,7 @@ mul4x_internal: mulq %rbx addq %rax,%r11 - movq 16(%rcx),%rax + movq 8(%rcx),%rax adcq $0,%rdx addq 8(%r14),%r11 adcq $0,%rdx @@ -588,7 +842,7 @@ mul4x_internal: adcq $0,%rdx addq %r11,%rdi leaq 32(%r9),%r15 - leaq 64(%rcx),%rcx + leaq 32(%rcx),%rcx adcq $0,%rdx movq %rdx,%r13 jmp .Linner4x @@ -597,7 +851,7 @@ mul4x_internal: .Linner4x: mulq %rbx addq %rax,%r10 - movq -32(%rcx),%rax + movq -16(%rcx),%rax adcq $0,%rdx addq 16(%r14),%r10 leaq 32(%r14),%r14 @@ -615,7 +869,7 @@ mul4x_internal: mulq %rbx addq %rax,%r11 - movq -16(%rcx),%rax + movq -8(%rcx),%rax adcq $0,%rdx addq -8(%r14),%r11 adcq $0,%rdx @@ -649,7 +903,7 @@ mul4x_internal: mulq %rbx addq %rax,%r11 - movq 16(%rcx),%rax + movq 8(%rcx),%rax adcq $0,%rdx addq 8(%r14),%r11 adcq $0,%rdx @@ -660,7 +914,7 @@ mul4x_internal: movq 16(%rsi,%r15,1),%rax adcq $0,%rdx addq %r11,%rdi - leaq 64(%rcx),%rcx + leaq 32(%rcx),%rcx adcq $0,%rdx movq %r13,-8(%r14) movq %rdx,%r13 @@ -670,7 +924,7 @@ mul4x_internal: mulq %rbx addq %rax,%r10 - movq -32(%rcx),%rax + movq -16(%rcx),%rax adcq $0,%rdx addq 16(%r14),%r10 leaq 32(%r14),%r14 @@ -689,7 +943,7 @@ mul4x_internal: mulq %rbx addq %rax,%r11 movq %rbp,%rax - movq -16(%rcx),%rbp + movq -8(%rcx),%rbp adcq $0,%rdx addq -8(%r14),%r11 adcq $0,%rdx @@ -704,9 +958,8 @@ mul4x_internal: movq %r13,-24(%r14) movq %rdx,%r13 -.byte 102,72,15,126,195 movq %rdi,-16(%r14) - leaq (%rcx,%r9,2),%rcx + leaq (%rcx,%r9,1),%rcx xorq %rdi,%rdi addq %r10,%r13 @@ -717,16 +970,23 @@ mul4x_internal: cmpq 16+8(%rsp),%r12 jb .Louter4x + xorq %rax,%rax subq %r13,%rbp adcq %r15,%r15 orq %r15,%rdi - xorq $1,%rdi + subq %rdi,%rax leaq (%r14,%r9,1),%rbx - leaq (%rcx,%rdi,8),%rbp + movq (%rcx),%r12 + leaq (%rcx),%rbp movq %r9,%rcx sarq $3+2,%rcx movq 56+8(%rsp),%rdi - jmp .Lsqr4x_sub + decq %r12 + xorq %r10,%r10 + movq 8(%rbp),%r13 + movq 16(%rbp),%r14 + movq 24(%rbp),%r15 + jmp .Lsqr4x_sub_entry .size mul4x_internal,.-mul4x_internal .globl bn_power5 .type bn_power5,@function @@ -739,9 +999,9 @@ bn_power5: pushq %r13 pushq %r14 pushq %r15 - movl %r9d,%r10d + shll $3,%r9d - shll $3+2,%r10d + leal (%r9,%r9,2),%r10d negq %r9 movq (%r8),%r8 @@ -751,19 +1011,20 @@ bn_power5: - leaq -64(%rsp,%r9,2),%r11 - subq %rsi,%r11 + + leaq -320(%rsp,%r9,2),%r11 + subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb .Lpwr_sp_alt subq %r11,%rsp - leaq -64(%rsp,%r9,2),%rsp + leaq -320(%rsp,%r9,2),%rsp jmp .Lpwr_sp_done .align 32 .Lpwr_sp_alt: - leaq 4096-64(,%r9,2),%r10 - leaq -64(%rsp,%r9,2),%rsp + leaq 4096-320(,%r9,2),%r10 + leaq -320(%rsp,%r9,2),%rsp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 @@ -791,10 +1052,15 @@ bn_power5: .byte 102,72,15,110,226 call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal .byte 102,72,15,126,209 .byte 102,72,15,126,226 @@ -1338,9 +1604,9 @@ __bn_sqr8x_internal: movq %rbx,-16(%rdi) movq %r8,-8(%rdi) .byte 102,72,15,126,213 -sqr8x_reduction: +__bn_sqr8x_reduction: xorq %rax,%rax - leaq (%rbp,%r9,2),%rcx + leaq (%r9,%rbp,1),%rcx leaq 48+8(%rsp,%r9,2),%rdx movq %rcx,0+8(%rsp) leaq 48+8(%rsp,%r9,1),%rdi @@ -1373,14 +1639,14 @@ sqr8x_reduction: .align 32 .L8x_reduce: mulq %rbx - movq 16(%rbp),%rax + movq 8(%rbp),%rax negq %r8 movq %rdx,%r8 adcq $0,%r8 mulq %rbx addq %rax,%r9 - movq 32(%rbp),%rax + movq 16(%rbp),%rax adcq $0,%rdx addq %r9,%r8 movq %rbx,48-8+8(%rsp,%rcx,8) @@ -1389,7 +1655,7 @@ sqr8x_reduction: mulq %rbx addq %rax,%r10 - movq 48(%rbp),%rax + movq 24(%rbp),%rax adcq $0,%rdx addq %r10,%r9 movq 32+8(%rsp),%rsi @@ -1398,7 +1664,7 @@ sqr8x_reduction: mulq %rbx addq %rax,%r11 - movq 64(%rbp),%rax + movq 32(%rbp),%rax adcq $0,%rdx imulq %r8,%rsi addq %r11,%r10 @@ -1407,7 +1673,7 @@ sqr8x_reduction: mulq %rbx addq %rax,%r12 - movq 80(%rbp),%rax + movq 40(%rbp),%rax adcq $0,%rdx addq %r12,%r11 movq %rdx,%r12 @@ -1415,7 +1681,7 @@ sqr8x_reduction: mulq %rbx addq %rax,%r13 - movq 96(%rbp),%rax + movq 48(%rbp),%rax adcq $0,%rdx addq %r13,%r12 movq %rdx,%r13 @@ -1423,7 +1689,7 @@ sqr8x_reduction: mulq %rbx addq %rax,%r14 - movq 112(%rbp),%rax + movq 56(%rbp),%rax adcq $0,%rdx addq %r14,%r13 movq %rdx,%r14 @@ -1441,7 +1707,7 @@ sqr8x_reduction: decl %ecx jnz .L8x_reduce - leaq 128(%rbp),%rbp + leaq 64(%rbp),%rbp xorq %rax,%rax movq 8+8(%rsp),%rdx cmpq 0+8(%rsp),%rbp @@ -1467,14 +1733,14 @@ sqr8x_reduction: .L8x_tail: mulq %rbx addq %rax,%r8 - movq 16(%rbp),%rax + movq 8(%rbp),%rax movq %r8,(%rdi) movq %rdx,%r8 adcq $0,%r8 mulq %rbx addq %rax,%r9 - movq 32(%rbp),%rax + movq 16(%rbp),%rax adcq $0,%rdx addq %r9,%r8 leaq 8(%rdi),%rdi @@ -1483,7 +1749,7 @@ sqr8x_reduction: mulq %rbx addq %rax,%r10 - movq 48(%rbp),%rax + movq 24(%rbp),%rax adcq $0,%rdx addq %r10,%r9 movq %rdx,%r10 @@ -1491,7 +1757,7 @@ sqr8x_reduction: mulq %rbx addq %rax,%r11 - movq 64(%rbp),%rax + movq 32(%rbp),%rax adcq $0,%rdx addq %r11,%r10 movq %rdx,%r11 @@ -1499,7 +1765,7 @@ sqr8x_reduction: mulq %rbx addq %rax,%r12 - movq 80(%rbp),%rax + movq 40(%rbp),%rax adcq $0,%rdx addq %r12,%r11 movq %rdx,%r12 @@ -1507,7 +1773,7 @@ sqr8x_reduction: mulq %rbx addq %rax,%r13 - movq 96(%rbp),%rax + movq 48(%rbp),%rax adcq $0,%rdx addq %r13,%r12 movq %rdx,%r13 @@ -1515,7 +1781,7 @@ sqr8x_reduction: mulq %rbx addq %rax,%r14 - movq 112(%rbp),%rax + movq 56(%rbp),%rax adcq $0,%rdx addq %r14,%r13 movq %rdx,%r14 @@ -1533,7 +1799,7 @@ sqr8x_reduction: decl %ecx jnz .L8x_tail - leaq 128(%rbp),%rbp + leaq 64(%rbp),%rbp movq 8+8(%rsp),%rdx cmpq 0+8(%rsp),%rbp jae .L8x_tail_done @@ -1557,6 +1823,15 @@ sqr8x_reduction: .align 32 .L8x_tail_done: addq (%rdx),%r8 + adcq $0,%r9 + adcq $0,%r10 + adcq $0,%r11 + adcq $0,%r12 + adcq $0,%r13 + adcq $0,%r14 + adcq $0,%r15 + + xorq %rax,%rax negq %rsi @@ -1570,7 +1845,7 @@ sqr8x_reduction: adcq 48(%rdi),%r14 adcq 56(%rdi),%r15 adcq $0,%rax - movq -16(%rbp),%rcx + movq -8(%rbp),%rcx xorq %rsi,%rsi .byte 102,72,15,126,213 @@ -1588,44 +1863,62 @@ sqr8x_reduction: cmpq %rdx,%rdi jb .L8x_reduction_loop - - subq %r15,%rcx + .byte 0xf3,0xc3 +.size bn_sqr8x_internal,.-bn_sqr8x_internal +.type __bn_post4x_internal,@function +.align 32 +__bn_post4x_internal: + movq 0(%rbp),%r12 leaq (%rdi,%r9,1),%rbx - adcq %rsi,%rsi movq %r9,%rcx - orq %rsi,%rax .byte 102,72,15,126,207 - xorq $1,%rax + negq %rax .byte 102,72,15,126,206 - leaq (%rbp,%rax,8),%rbp sarq $3+2,%rcx - jmp .Lsqr4x_sub + decq %r12 + xorq %r10,%r10 + movq 8(%rbp),%r13 + movq 16(%rbp),%r14 + movq 24(%rbp),%r15 + jmp .Lsqr4x_sub_entry -.align 32 +.align 16 .Lsqr4x_sub: -.byte 0x66 - movq 0(%rbx),%r12 - movq 8(%rbx),%r13 - sbbq 0(%rbp),%r12 - movq 16(%rbx),%r14 - sbbq 16(%rbp),%r13 - movq 24(%rbx),%r15 - leaq 32(%rbx),%rbx - sbbq 32(%rbp),%r14 + movq 0(%rbp),%r12 + movq 8(%rbp),%r13 + movq 16(%rbp),%r14 + movq 24(%rbp),%r15 +.Lsqr4x_sub_entry: + leaq 32(%rbp),%rbp + notq %r12 + notq %r13 + notq %r14 + notq %r15 + andq %rax,%r12 + andq %rax,%r13 + andq %rax,%r14 + andq %rax,%r15 + + negq %r10 + adcq 0(%rbx),%r12 + adcq 8(%rbx),%r13 + adcq 16(%rbx),%r14 + adcq 24(%rbx),%r15 movq %r12,0(%rdi) - sbbq 48(%rbp),%r15 - leaq 64(%rbp),%rbp + leaq 32(%rbx),%rbx movq %r13,8(%rdi) + sbbq %r10,%r10 movq %r14,16(%rdi) movq %r15,24(%rdi) leaq 32(%rdi),%rdi incq %rcx jnz .Lsqr4x_sub + movq %r9,%r10 negq %r9 .byte 0xf3,0xc3 -.size bn_sqr8x_internal,.-bn_sqr8x_internal +.size __bn_post4x_internal,.-__bn_post4x_internal .globl bn_from_montgomery .type bn_from_montgomery,@function .align 32 @@ -1647,10 +1940,9 @@ bn_from_mont8x: pushq %r13 pushq %r14 pushq %r15 -.byte 0x67 - movl %r9d,%r10d + shll $3,%r9d - shll $3+2,%r10d + leaq (%r9,%r9,2),%r10 negq %r9 movq (%r8),%r8 @@ -1660,19 +1952,20 @@ bn_from_mont8x: - leaq -64(%rsp,%r9,2),%r11 - subq %rsi,%r11 + + leaq -320(%rsp,%r9,2),%r11 + subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb .Lfrom_sp_alt subq %r11,%rsp - leaq -64(%rsp,%r9,2),%rsp + leaq -320(%rsp,%r9,2),%rsp jmp .Lfrom_sp_done .align 32 .Lfrom_sp_alt: - leaq 4096-64(,%r9,2),%r10 - leaq -64(%rsp,%r9,2),%rsp + leaq 4096-320(,%r9,2),%r10 + leaq -320(%rsp,%r9,2),%rsp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 @@ -1723,7 +2016,8 @@ bn_from_mont8x: .byte 0x67 movq %rcx,%rbp .byte 102,73,15,110,218 - call sqr8x_reduction + call __bn_sqr8x_reduction + call __bn_post4x_internal pxor %xmm0,%xmm0 leaq 48(%rsp),%rax @@ -1790,45 +2084,169 @@ bn_scatter5: .globl bn_gather5 .type bn_gather5,@function -.align 16 +.align 32 bn_gather5: - movl %ecx,%r11d - shrl $3,%ecx - andq $7,%r11 - notl %ecx - leaq .Lmagic_masks(%rip),%rax - andl $3,%ecx - leaq 128(%rdx,%r11,8),%rdx - movq 0(%rax,%rcx,8),%xmm4 - movq 8(%rax,%rcx,8),%xmm5 - movq 16(%rax,%rcx,8),%xmm6 - movq 24(%rax,%rcx,8),%xmm7 +.LSEH_begin_bn_gather5: + +.byte 0x4c,0x8d,0x14,0x24 +.byte 0x48,0x81,0xec,0x08,0x01,0x00,0x00 + leaq .Linc(%rip),%rax + andq $-16,%rsp + + movd %ecx,%xmm5 + movdqa 0(%rax),%xmm0 + movdqa 16(%rax),%xmm1 + leaq 128(%rdx),%r11 + leaq 128(%rsp),%rax + + pshufd $0,%xmm5,%xmm5 + movdqa %xmm1,%xmm4 + movdqa %xmm1,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm4,%xmm3 + + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,-128(%rax) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,-112(%rax) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,-96(%rax) + movdqa %xmm4,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,-80(%rax) + movdqa %xmm4,%xmm3 + + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,-64(%rax) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,-48(%rax) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,-32(%rax) + movdqa %xmm4,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,-16(%rax) + movdqa %xmm4,%xmm3 + + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,0(%rax) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,16(%rax) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,32(%rax) + movdqa %xmm4,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,48(%rax) + movdqa %xmm4,%xmm3 + + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,64(%rax) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,80(%rax) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,96(%rax) + movdqa %xmm4,%xmm2 + movdqa %xmm3,112(%rax) jmp .Lgather -.align 16 -.Lgather: - movq -128(%rdx),%xmm0 - movq -64(%rdx),%xmm1 - pand %xmm4,%xmm0 - movq 0(%rdx),%xmm2 - pand %xmm5,%xmm1 - movq 64(%rdx),%xmm3 - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 -.byte 0x67,0x67 - por %xmm2,%xmm0 - leaq 256(%rdx),%rdx - por %xmm3,%xmm0 +.align 32 +.Lgather: + pxor %xmm4,%xmm4 + pxor %xmm5,%xmm5 + movdqa -128(%r11),%xmm0 + movdqa -112(%r11),%xmm1 + movdqa -96(%r11),%xmm2 + pand -128(%rax),%xmm0 + movdqa -80(%r11),%xmm3 + pand -112(%rax),%xmm1 + por %xmm0,%xmm4 + pand -96(%rax),%xmm2 + por %xmm1,%xmm5 + pand -80(%rax),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa -64(%r11),%xmm0 + movdqa -48(%r11),%xmm1 + movdqa -32(%r11),%xmm2 + pand -64(%rax),%xmm0 + movdqa -16(%r11),%xmm3 + pand -48(%rax),%xmm1 + por %xmm0,%xmm4 + pand -32(%rax),%xmm2 + por %xmm1,%xmm5 + pand -16(%rax),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa 0(%r11),%xmm0 + movdqa 16(%r11),%xmm1 + movdqa 32(%r11),%xmm2 + pand 0(%rax),%xmm0 + movdqa 48(%r11),%xmm3 + pand 16(%rax),%xmm1 + por %xmm0,%xmm4 + pand 32(%rax),%xmm2 + por %xmm1,%xmm5 + pand 48(%rax),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa 64(%r11),%xmm0 + movdqa 80(%r11),%xmm1 + movdqa 96(%r11),%xmm2 + pand 64(%rax),%xmm0 + movdqa 112(%r11),%xmm3 + pand 80(%rax),%xmm1 + por %xmm0,%xmm4 + pand 96(%rax),%xmm2 + por %xmm1,%xmm5 + pand 112(%rax),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + por %xmm5,%xmm4 + leaq 256(%r11),%r11 + pshufd $0x4e,%xmm4,%xmm0 + por %xmm4,%xmm0 movq %xmm0,(%rdi) leaq 8(%rdi),%rdi subl $1,%esi jnz .Lgather + + leaq (%r10),%rsp .byte 0xf3,0xc3 .LSEH_end_bn_gather5: .size bn_gather5,.-bn_gather5 .align 64 -.Lmagic_masks: -.long 0,0, 0,0, 0,0, -1,-1 -.long 0,0, 0,0, 0,0, 0,0 +.Linc: +.long 0,0, 1,1 +.long 2,2, 2,2 .byte 77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105,112,108,105,99,97,116,105,111,110,32,119,105,116,104,32,115,99,97,116,116,101,114,47,103,97,116,104,101,114,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 diff --git a/deps/openssl/asm_obsolete/x64-elf-gas/camellia/cmll-x86_64.s b/deps/openssl/asm_obsolete/x64-elf-gas/camellia/cmll-x86_64.s index ac7da4dfc2d19e..1117381f316d9e 100644 --- a/deps/openssl/asm_obsolete/x64-elf-gas/camellia/cmll-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-elf-gas/camellia/cmll-x86_64.s @@ -1624,7 +1624,7 @@ Camellia_cbc_encrypt: leaq -64-63(%rcx),%r10 subq %rsp,%r10 negq %r10 - andq $960,%r10 + andq $0x3C0,%r10 subq %r10,%rsp diff --git a/deps/openssl/asm_obsolete/x64-elf-gas/ec/ecp_nistz256-x86_64.s b/deps/openssl/asm_obsolete/x64-elf-gas/ec/ecp_nistz256-x86_64.s index 393782329e0b91..7876e382994517 100644 --- a/deps/openssl/asm_obsolete/x64-elf-gas/ec/ecp_nistz256-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-elf-gas/ec/ecp_nistz256-x86_64.s @@ -1121,6 +1121,7 @@ ecp_nistz256_point_double: pushq %r15 subq $160+8,%rsp +.Lpoint_double_shortcutq: movdqu 0(%rsi),%xmm0 movq %rsi,%rbx movdqu 16(%rsi),%xmm1 @@ -1341,7 +1342,7 @@ ecp_nistz256_point_add: por %xmm1,%xmm3 movdqu 0(%rsi),%xmm0 - pshufd $177,%xmm3,%xmm5 + pshufd $0xb1,%xmm3,%xmm5 movdqu 16(%rsi),%xmm1 movdqu 32(%rsi),%xmm2 por %xmm3,%xmm5 @@ -1351,7 +1352,7 @@ ecp_nistz256_point_add: movq 64+16(%rsi),%r15 movq 64+24(%rsi),%r8 movdqa %xmm0,480(%rsp) - pshufd $30,%xmm5,%xmm4 + pshufd $0x1e,%xmm5,%xmm4 movdqa %xmm1,480+16(%rsp) por %xmm0,%xmm1 .byte 102,72,15,110,199 @@ -1371,10 +1372,10 @@ ecp_nistz256_point_add: call __ecp_nistz256_sqr_montq pcmpeqd %xmm4,%xmm5 - pshufd $177,%xmm3,%xmm4 + pshufd $0xb1,%xmm3,%xmm4 por %xmm3,%xmm4 pshufd $0,%xmm5,%xmm5 - pshufd $30,%xmm4,%xmm3 + pshufd $0x1e,%xmm4,%xmm3 por %xmm3,%xmm4 pxor %xmm3,%xmm3 pcmpeqd %xmm3,%xmm4 @@ -1383,6 +1384,7 @@ ecp_nistz256_point_add: movq 64+8(%rbx),%r14 movq 64+16(%rbx),%r15 movq 64+24(%rbx),%r8 +.byte 102,72,15,110,203 leaq 64-0(%rbx),%rsi leaq 32(%rsp),%rdi @@ -1474,7 +1476,7 @@ ecp_nistz256_point_add: testq %r8,%r8 jnz .Ladd_proceedq testq %r9,%r9 - jz .Ladd_proceedq + jz .Ladd_doubleq .byte 102,72,15,126,199 pxor %xmm0,%xmm0 @@ -1486,6 +1488,13 @@ ecp_nistz256_point_add: movdqu %xmm0,80(%rdi) jmp .Ladd_doneq +.align 32 +.Ladd_doubleq: +.byte 102,72,15,126,206 +.byte 102,72,15,126,199 + addq $416,%rsp + jmp .Lpoint_double_shortcutq + .align 32 .Ladd_proceedq: movq 0+64(%rsp),%rax @@ -1733,13 +1742,13 @@ ecp_nistz256_point_add_affine: por %xmm1,%xmm3 movdqu 0(%rbx),%xmm0 - pshufd $177,%xmm3,%xmm5 + pshufd $0xb1,%xmm3,%xmm5 movdqu 16(%rbx),%xmm1 movdqu 32(%rbx),%xmm2 por %xmm3,%xmm5 movdqu 48(%rbx),%xmm3 movdqa %xmm0,416(%rsp) - pshufd $30,%xmm5,%xmm4 + pshufd $0x1e,%xmm5,%xmm4 movdqa %xmm1,416+16(%rsp) por %xmm0,%xmm1 .byte 102,72,15,110,199 @@ -1755,13 +1764,13 @@ ecp_nistz256_point_add_affine: call __ecp_nistz256_sqr_montq pcmpeqd %xmm4,%xmm5 - pshufd $177,%xmm3,%xmm4 + pshufd $0xb1,%xmm3,%xmm4 movq 0(%rbx),%rax movq %r12,%r9 por %xmm3,%xmm4 pshufd $0,%xmm5,%xmm5 - pshufd $30,%xmm4,%xmm3 + pshufd $0x1e,%xmm4,%xmm3 movq %r13,%r10 por %xmm3,%xmm4 pxor %xmm3,%xmm3 diff --git a/deps/openssl/asm_obsolete/x64-elf-gas/modes/ghash-x86_64.s b/deps/openssl/asm_obsolete/x64-elf-gas/modes/ghash-x86_64.s index 462ef7fe739f2f..e9ffdc2de2ea85 100644 --- a/deps/openssl/asm_obsolete/x64-elf-gas/modes/ghash-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-elf-gas/modes/ghash-x86_64.s @@ -20,14 +20,14 @@ gcm_gmult_4bit: movq $14,%rcx movq 8(%rsi,%rax,1),%r8 movq (%rsi,%rax,1),%r9 - andb $240,%bl + andb $0xf0,%bl movq %r8,%rdx jmp .Loop1 .align 16 .Loop1: shrq $4,%r8 - andq $15,%rdx + andq $0xf,%rdx movq %r9,%r10 movb (%rdi,%rcx,1),%al shrq $4,%r9 @@ -43,13 +43,13 @@ gcm_gmult_4bit: js .Lbreak1 shrq $4,%r8 - andq $15,%rdx + andq $0xf,%rdx movq %r9,%r10 shrq $4,%r9 xorq 8(%rsi,%rax,1),%r8 shlq $60,%r10 xorq (%rsi,%rax,1),%r9 - andb $240,%bl + andb $0xf0,%bl xorq (%r11,%rdx,8),%r9 movq %r8,%rdx xorq %r10,%r8 @@ -58,19 +58,19 @@ gcm_gmult_4bit: .align 16 .Lbreak1: shrq $4,%r8 - andq $15,%rdx + andq $0xf,%rdx movq %r9,%r10 shrq $4,%r9 xorq 8(%rsi,%rax,1),%r8 shlq $60,%r10 xorq (%rsi,%rax,1),%r9 - andb $240,%bl + andb $0xf0,%bl xorq (%r11,%rdx,8),%r9 movq %r8,%rdx xorq %r10,%r8 shrq $4,%r8 - andq $15,%rdx + andq $0xf,%rdx movq %r9,%r10 shrq $4,%r9 xorq 8(%rsi,%rbx,1),%r8 @@ -661,10 +661,10 @@ gcm_ghash_4bit: gcm_init_clmul: .L_init_clmul: movdqu (%rsi),%xmm2 - pshufd $78,%xmm2,%xmm2 + pshufd $0b01001110,%xmm2,%xmm2 - pshufd $255,%xmm2,%xmm4 + pshufd $0b11111111,%xmm2,%xmm4 movdqa %xmm2,%xmm3 psllq $1,%xmm2 pxor %xmm5,%xmm5 @@ -678,11 +678,11 @@ gcm_init_clmul: pxor %xmm5,%xmm2 - pshufd $78,%xmm2,%xmm6 + pshufd $0b01001110,%xmm2,%xmm6 movdqa %xmm2,%xmm0 pxor %xmm2,%xmm6 movdqa %xmm0,%xmm1 - pshufd $78,%xmm0,%xmm3 + pshufd $0b01001110,%xmm0,%xmm3 pxor %xmm0,%xmm3 .byte 102,15,58,68,194,0 .byte 102,15,58,68,202,17 @@ -718,8 +718,8 @@ gcm_init_clmul: pxor %xmm4,%xmm0 psrlq $1,%xmm0 pxor %xmm1,%xmm0 - pshufd $78,%xmm2,%xmm3 - pshufd $78,%xmm0,%xmm4 + pshufd $0b01001110,%xmm2,%xmm3 + pshufd $0b01001110,%xmm0,%xmm4 pxor %xmm2,%xmm3 movdqu %xmm2,0(%rdi) pxor %xmm0,%xmm4 @@ -727,7 +727,7 @@ gcm_init_clmul: .byte 102,15,58,15,227,8 movdqu %xmm4,32(%rdi) movdqa %xmm0,%xmm1 - pshufd $78,%xmm0,%xmm3 + pshufd $0b01001110,%xmm0,%xmm3 pxor %xmm0,%xmm3 .byte 102,15,58,68,194,0 .byte 102,15,58,68,202,17 @@ -765,7 +765,7 @@ gcm_init_clmul: pxor %xmm1,%xmm0 movdqa %xmm0,%xmm5 movdqa %xmm0,%xmm1 - pshufd $78,%xmm0,%xmm3 + pshufd $0b01001110,%xmm0,%xmm3 pxor %xmm0,%xmm3 .byte 102,15,58,68,194,0 .byte 102,15,58,68,202,17 @@ -801,8 +801,8 @@ gcm_init_clmul: pxor %xmm4,%xmm0 psrlq $1,%xmm0 pxor %xmm1,%xmm0 - pshufd $78,%xmm5,%xmm3 - pshufd $78,%xmm0,%xmm4 + pshufd $0b01001110,%xmm5,%xmm3 + pshufd $0b01001110,%xmm0,%xmm4 pxor %xmm5,%xmm3 movdqu %xmm5,48(%rdi) pxor %xmm0,%xmm4 @@ -822,7 +822,7 @@ gcm_gmult_clmul: movdqu 32(%rsi),%xmm4 .byte 102,15,56,0,197 movdqa %xmm0,%xmm1 - pshufd $78,%xmm0,%xmm3 + pshufd $0b01001110,%xmm0,%xmm3 pxor %xmm0,%xmm3 .byte 102,15,58,68,194,0 .byte 102,15,58,68,202,17 @@ -874,20 +874,20 @@ gcm_ghash_clmul: movdqu 32(%rsi),%xmm7 .byte 102,65,15,56,0,194 - subq $16,%rcx + subq $0x10,%rcx jz .Lodd_tail movdqu 16(%rsi),%xmm6 movl OPENSSL_ia32cap_P+4(%rip),%eax - cmpq $48,%rcx + cmpq $0x30,%rcx jb .Lskip4x andl $71303168,%eax cmpl $4194304,%eax je .Lskip4x - subq $48,%rcx - movq $11547335547999543296,%rax + subq $0x30,%rcx + movq $0xA040608020C0E000,%rax movdqu 48(%rsi),%xmm14 movdqu 64(%rsi),%xmm15 @@ -899,14 +899,14 @@ gcm_ghash_clmul: .byte 102,65,15,56,0,218 .byte 102,69,15,56,0,218 movdqa %xmm3,%xmm5 - pshufd $78,%xmm3,%xmm4 + pshufd $0b01001110,%xmm3,%xmm4 pxor %xmm3,%xmm4 .byte 102,15,58,68,218,0 .byte 102,15,58,68,234,17 .byte 102,15,58,68,231,0 movdqa %xmm11,%xmm13 - pshufd $78,%xmm11,%xmm12 + pshufd $0b01001110,%xmm11,%xmm12 pxor %xmm11,%xmm12 .byte 102,68,15,58,68,222,0 .byte 102,68,15,58,68,238,17 @@ -921,12 +921,12 @@ gcm_ghash_clmul: .byte 102,69,15,56,0,218 .byte 102,69,15,56,0,194 movdqa %xmm11,%xmm13 - pshufd $78,%xmm11,%xmm12 + pshufd $0b01001110,%xmm11,%xmm12 pxor %xmm8,%xmm0 pxor %xmm11,%xmm12 .byte 102,69,15,58,68,222,0 movdqa %xmm0,%xmm1 - pshufd $78,%xmm0,%xmm8 + pshufd $0b01001110,%xmm0,%xmm8 pxor %xmm0,%xmm8 .byte 102,69,15,58,68,238,17 .byte 102,68,15,58,68,231,0 @@ -934,7 +934,7 @@ gcm_ghash_clmul: xorps %xmm13,%xmm5 leaq 64(%rdx),%rdx - subq $64,%rcx + subq $0x40,%rcx jc .Ltail4x jmp .Lmod4_loop @@ -949,14 +949,14 @@ gcm_ghash_clmul: movdqu 32(%rdx),%xmm3 movdqa %xmm11,%xmm13 .byte 102,68,15,58,68,199,16 - pshufd $78,%xmm11,%xmm12 + pshufd $0b01001110,%xmm11,%xmm12 xorps %xmm5,%xmm1 pxor %xmm11,%xmm12 .byte 102,65,15,56,0,218 movups 32(%rsi),%xmm7 xorps %xmm4,%xmm8 .byte 102,68,15,58,68,218,0 - pshufd $78,%xmm3,%xmm4 + pshufd $0b01001110,%xmm3,%xmm4 pxor %xmm0,%xmm8 movdqa %xmm3,%xmm5 @@ -1000,7 +1000,7 @@ gcm_ghash_clmul: movdqa %xmm11,%xmm13 pxor %xmm12,%xmm4 - pshufd $78,%xmm11,%xmm12 + pshufd $0b01001110,%xmm11,%xmm12 pxor %xmm9,%xmm0 pxor %xmm8,%xmm1 pxor %xmm11,%xmm12 @@ -1010,14 +1010,14 @@ gcm_ghash_clmul: movdqa %xmm0,%xmm1 .byte 102,69,15,58,68,238,17 xorps %xmm11,%xmm3 - pshufd $78,%xmm0,%xmm8 + pshufd $0b01001110,%xmm0,%xmm8 pxor %xmm0,%xmm8 .byte 102,68,15,58,68,231,0 xorps %xmm13,%xmm5 leaq 64(%rdx),%rdx - subq $64,%rcx + subq $0x40,%rcx jnc .Lmod4_loop .Ltail4x: @@ -1061,10 +1061,10 @@ gcm_ghash_clmul: pxor %xmm4,%xmm0 psrlq $1,%xmm0 pxor %xmm1,%xmm0 - addq $64,%rcx + addq $0x40,%rcx jz .Ldone movdqu 32(%rsi),%xmm7 - subq $16,%rcx + subq $0x10,%rcx jz .Lodd_tail .Lskip4x: @@ -1079,7 +1079,7 @@ gcm_ghash_clmul: pxor %xmm8,%xmm0 movdqa %xmm3,%xmm5 - pshufd $78,%xmm3,%xmm4 + pshufd $0b01001110,%xmm3,%xmm4 pxor %xmm3,%xmm4 .byte 102,15,58,68,218,0 .byte 102,15,58,68,234,17 @@ -1087,7 +1087,7 @@ gcm_ghash_clmul: leaq 32(%rdx),%rdx nop - subq $32,%rcx + subq $0x20,%rcx jbe .Leven_tail nop jmp .Lmod_loop @@ -1096,7 +1096,7 @@ gcm_ghash_clmul: .Lmod_loop: movdqa %xmm0,%xmm1 movdqa %xmm4,%xmm8 - pshufd $78,%xmm0,%xmm4 + pshufd $0b01001110,%xmm0,%xmm4 pxor %xmm0,%xmm4 .byte 102,15,58,68,198,0 @@ -1134,7 +1134,7 @@ gcm_ghash_clmul: pslldq $8,%xmm0 psrldq $8,%xmm8 pxor %xmm9,%xmm0 - pshufd $78,%xmm5,%xmm4 + pshufd $0b01001110,%xmm5,%xmm4 pxor %xmm8,%xmm1 pxor %xmm5,%xmm4 @@ -1150,13 +1150,13 @@ gcm_ghash_clmul: .byte 102,15,58,68,231,0 pxor %xmm1,%xmm0 - subq $32,%rcx + subq $0x20,%rcx ja .Lmod_loop .Leven_tail: movdqa %xmm0,%xmm1 movdqa %xmm4,%xmm8 - pshufd $78,%xmm0,%xmm4 + pshufd $0b01001110,%xmm0,%xmm4 pxor %xmm0,%xmm4 .byte 102,15,58,68,198,0 @@ -1204,7 +1204,7 @@ gcm_ghash_clmul: .byte 102,69,15,56,0,194 pxor %xmm8,%xmm0 movdqa %xmm0,%xmm1 - pshufd $78,%xmm0,%xmm3 + pshufd $0b01001110,%xmm0,%xmm3 pxor %xmm0,%xmm3 .byte 102,15,58,68,194,0 .byte 102,15,58,68,202,17 diff --git a/deps/openssl/asm_obsolete/x64-elf-gas/sha/sha1-mb-x86_64.s b/deps/openssl/asm_obsolete/x64-elf-gas/sha/sha1-mb-x86_64.s index 8a1e5e7b595379..4d25c99cf65bd3 100644 --- a/deps/openssl/asm_obsolete/x64-elf-gas/sha/sha1-mb-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-elf-gas/sha/sha1-mb-x86_64.s @@ -2599,10 +2599,10 @@ _shaext_shortcut: punpcklqdq %xmm5,%xmm0 punpckhqdq %xmm5,%xmm8 - pshufd $63,%xmm7,%xmm1 - pshufd $127,%xmm7,%xmm9 - pshufd $27,%xmm0,%xmm0 - pshufd $27,%xmm8,%xmm8 + pshufd $0b00111111,%xmm7,%xmm1 + pshufd $0b01111111,%xmm7,%xmm9 + pshufd $0b00011011,%xmm0,%xmm0 + pshufd $0b00011011,%xmm8,%xmm8 jmp .Loop_shaext .align 32 @@ -2857,8 +2857,8 @@ _shaext_shortcut: .byte 69,15,58,204,193,3 .byte 69,15,56,200,214 - pshufd $0,%xmm6,%xmm11 - pshufd $85,%xmm6,%xmm12 + pshufd $0x00,%xmm6,%xmm11 + pshufd $0x55,%xmm6,%xmm12 movdqa %xmm6,%xmm7 pcmpgtd %xmm4,%xmm11 pcmpgtd %xmm4,%xmm12 @@ -2888,8 +2888,8 @@ _shaext_shortcut: movl 280(%rsp),%edx - pshufd $27,%xmm0,%xmm0 - pshufd $27,%xmm8,%xmm8 + pshufd $0b00011011,%xmm0,%xmm0 + pshufd $0b00011011,%xmm8,%xmm8 movdqa %xmm0,%xmm6 punpckldq %xmm8,%xmm0 diff --git a/deps/openssl/asm_obsolete/x64-elf-gas/sha/sha1-x86_64.s b/deps/openssl/asm_obsolete/x64-elf-gas/sha/sha1-x86_64.s index 38b7df19704ba2..38e9956cb68384 100644 --- a/deps/openssl/asm_obsolete/x64-elf-gas/sha/sha1-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-elf-gas/sha/sha1-x86_64.s @@ -1240,9 +1240,9 @@ _shaext_shortcut: movdqa K_XX_XX+160(%rip),%xmm3 movdqu (%rsi),%xmm4 - pshufd $27,%xmm0,%xmm0 + pshufd $0b00011011,%xmm0,%xmm0 movdqu 16(%rsi),%xmm5 - pshufd $27,%xmm1,%xmm1 + pshufd $0b00011011,%xmm1,%xmm1 movdqu 32(%rsi),%xmm6 .byte 102,15,56,0,227 movdqu 48(%rsi),%xmm7 @@ -1392,8 +1392,8 @@ _shaext_shortcut: jnz .Loop_shaext - pshufd $27,%xmm0,%xmm0 - pshufd $27,%xmm1,%xmm1 + pshufd $0b00011011,%xmm0,%xmm0 + pshufd $0b00011011,%xmm1,%xmm1 movdqu %xmm0,(%rdi) movd %xmm1,16(%rdi) .byte 0xf3,0xc3 diff --git a/deps/openssl/asm_obsolete/x64-elf-gas/sha/sha256-mb-x86_64.s b/deps/openssl/asm_obsolete/x64-elf-gas/sha/sha256-mb-x86_64.s index 7f8e35a92e0a15..7655283b9885b9 100644 --- a/deps/openssl/asm_obsolete/x64-elf-gas/sha/sha256-mb-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-elf-gas/sha/sha256-mb-x86_64.s @@ -2677,10 +2677,10 @@ _shaext_shortcut: punpckhqdq %xmm8,%xmm14 punpckhqdq %xmm10,%xmm15 - pshufd $27,%xmm12,%xmm12 - pshufd $27,%xmm13,%xmm13 - pshufd $27,%xmm14,%xmm14 - pshufd $27,%xmm15,%xmm15 + pshufd $0b00011011,%xmm12,%xmm12 + pshufd $0b00011011,%xmm13,%xmm13 + pshufd $0b00011011,%xmm14,%xmm14 + pshufd $0b00011011,%xmm15,%xmm15 jmp .Loop_shaext .align 32 @@ -2712,11 +2712,11 @@ _shaext_shortcut: movdqa %xmm2,%xmm0 movdqa %xmm15,112(%rsp) .byte 69,15,56,203,254 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 pxor %xmm12,%xmm4 movdqa %xmm12,64(%rsp) .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 pxor %xmm14,%xmm8 movdqa %xmm14,96(%rsp) movdqa 16-128(%rbp),%xmm1 @@ -2734,11 +2734,11 @@ _shaext_shortcut: .byte 102,68,15,56,0,211 prefetcht0 127(%r9) .byte 69,15,56,203,254 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 .byte 102,68,15,56,0,219 .byte 15,56,204,229 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 32-128(%rbp),%xmm1 paddd %xmm6,%xmm1 .byte 69,15,56,203,247 @@ -2751,14 +2751,14 @@ _shaext_shortcut: movdqa %xmm2,%xmm0 movdqa %xmm7,%xmm3 .byte 69,15,56,203,254 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 .byte 102,15,58,15,222,4 paddd %xmm3,%xmm4 movdqa %xmm11,%xmm3 .byte 102,65,15,58,15,218,4 .byte 15,56,204,238 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 48-128(%rbp),%xmm1 paddd %xmm7,%xmm1 .byte 69,15,56,203,247 @@ -2775,13 +2775,13 @@ _shaext_shortcut: .byte 102,15,58,15,223,4 .byte 69,15,56,203,254 .byte 69,15,56,205,195 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm5 movdqa %xmm8,%xmm3 .byte 102,65,15,58,15,219,4 .byte 15,56,204,247 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 64-128(%rbp),%xmm1 paddd %xmm4,%xmm1 .byte 69,15,56,203,247 @@ -2797,13 +2797,13 @@ _shaext_shortcut: .byte 102,15,58,15,220,4 .byte 69,15,56,203,254 .byte 69,15,56,205,200 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm6 movdqa %xmm9,%xmm3 .byte 102,65,15,58,15,216,4 .byte 15,56,204,252 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 80-128(%rbp),%xmm1 paddd %xmm5,%xmm1 .byte 69,15,56,203,247 @@ -2819,13 +2819,13 @@ _shaext_shortcut: .byte 102,15,58,15,221,4 .byte 69,15,56,203,254 .byte 69,15,56,205,209 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm7 movdqa %xmm10,%xmm3 .byte 102,65,15,58,15,217,4 .byte 15,56,204,229 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 96-128(%rbp),%xmm1 paddd %xmm6,%xmm1 .byte 69,15,56,203,247 @@ -2841,13 +2841,13 @@ _shaext_shortcut: .byte 102,15,58,15,222,4 .byte 69,15,56,203,254 .byte 69,15,56,205,218 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm4 movdqa %xmm11,%xmm3 .byte 102,65,15,58,15,218,4 .byte 15,56,204,238 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 112-128(%rbp),%xmm1 paddd %xmm7,%xmm1 .byte 69,15,56,203,247 @@ -2863,13 +2863,13 @@ _shaext_shortcut: .byte 102,15,58,15,223,4 .byte 69,15,56,203,254 .byte 69,15,56,205,195 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm5 movdqa %xmm8,%xmm3 .byte 102,65,15,58,15,219,4 .byte 15,56,204,247 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 128-128(%rbp),%xmm1 paddd %xmm4,%xmm1 .byte 69,15,56,203,247 @@ -2885,13 +2885,13 @@ _shaext_shortcut: .byte 102,15,58,15,220,4 .byte 69,15,56,203,254 .byte 69,15,56,205,200 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm6 movdqa %xmm9,%xmm3 .byte 102,65,15,58,15,216,4 .byte 15,56,204,252 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 144-128(%rbp),%xmm1 paddd %xmm5,%xmm1 .byte 69,15,56,203,247 @@ -2907,13 +2907,13 @@ _shaext_shortcut: .byte 102,15,58,15,221,4 .byte 69,15,56,203,254 .byte 69,15,56,205,209 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm7 movdqa %xmm10,%xmm3 .byte 102,65,15,58,15,217,4 .byte 15,56,204,229 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 160-128(%rbp),%xmm1 paddd %xmm6,%xmm1 .byte 69,15,56,203,247 @@ -2929,13 +2929,13 @@ _shaext_shortcut: .byte 102,15,58,15,222,4 .byte 69,15,56,203,254 .byte 69,15,56,205,218 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm4 movdqa %xmm11,%xmm3 .byte 102,65,15,58,15,218,4 .byte 15,56,204,238 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 176-128(%rbp),%xmm1 paddd %xmm7,%xmm1 .byte 69,15,56,203,247 @@ -2951,13 +2951,13 @@ _shaext_shortcut: .byte 102,15,58,15,223,4 .byte 69,15,56,203,254 .byte 69,15,56,205,195 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm5 movdqa %xmm8,%xmm3 .byte 102,65,15,58,15,219,4 .byte 15,56,204,247 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 192-128(%rbp),%xmm1 paddd %xmm4,%xmm1 .byte 69,15,56,203,247 @@ -2973,13 +2973,13 @@ _shaext_shortcut: .byte 102,15,58,15,220,4 .byte 69,15,56,203,254 .byte 69,15,56,205,200 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm6 movdqa %xmm9,%xmm3 .byte 102,65,15,58,15,216,4 .byte 15,56,204,252 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 208-128(%rbp),%xmm1 paddd %xmm5,%xmm1 .byte 69,15,56,203,247 @@ -2995,13 +2995,13 @@ _shaext_shortcut: .byte 102,15,58,15,221,4 .byte 69,15,56,203,254 .byte 69,15,56,205,209 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm7 movdqa %xmm10,%xmm3 .byte 102,65,15,58,15,217,4 nop .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 224-128(%rbp),%xmm1 paddd %xmm6,%xmm1 .byte 69,15,56,203,247 @@ -3018,13 +3018,13 @@ _shaext_shortcut: pxor %xmm6,%xmm6 .byte 69,15,56,203,254 .byte 69,15,56,205,218 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 movdqa 240-128(%rbp),%xmm1 paddd %xmm7,%xmm1 movq (%rbx),%xmm7 nop .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 240-128(%rbp),%xmm2 paddd %xmm11,%xmm2 .byte 69,15,56,203,247 @@ -3034,17 +3034,17 @@ _shaext_shortcut: cmovgeq %rsp,%r8 cmpl 4(%rbx),%ecx cmovgeq %rsp,%r9 - pshufd $0,%xmm7,%xmm9 + pshufd $0x00,%xmm7,%xmm9 .byte 69,15,56,203,236 movdqa %xmm2,%xmm0 - pshufd $85,%xmm7,%xmm10 + pshufd $0x55,%xmm7,%xmm10 movdqa %xmm7,%xmm11 .byte 69,15,56,203,254 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 pcmpgtd %xmm6,%xmm9 pcmpgtd %xmm6,%xmm10 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 pcmpgtd %xmm6,%xmm11 movdqa K256_shaext-16(%rip),%xmm3 .byte 69,15,56,203,247 @@ -3066,10 +3066,10 @@ _shaext_shortcut: movl 280(%rsp),%edx - pshufd $27,%xmm12,%xmm12 - pshufd $27,%xmm13,%xmm13 - pshufd $27,%xmm14,%xmm14 - pshufd $27,%xmm15,%xmm15 + pshufd $0b00011011,%xmm12,%xmm12 + pshufd $0b00011011,%xmm13,%xmm13 + pshufd $0b00011011,%xmm14,%xmm14 + pshufd $0b00011011,%xmm15,%xmm15 movdqa %xmm12,%xmm5 movdqa %xmm13,%xmm6 diff --git a/deps/openssl/asm_obsolete/x64-elf-gas/sha/sha256-x86_64.s b/deps/openssl/asm_obsolete/x64-elf-gas/sha/sha256-x86_64.s index d2951d8ea3be3a..ab16a7b618820c 100644 --- a/deps/openssl/asm_obsolete/x64-elf-gas/sha/sha256-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-elf-gas/sha/sha256-x86_64.s @@ -1754,9 +1754,9 @@ _shaext_shortcut: movdqu 16(%rdi),%xmm2 movdqa 512-128(%rcx),%xmm7 - pshufd $27,%xmm1,%xmm0 - pshufd $177,%xmm1,%xmm1 - pshufd $27,%xmm2,%xmm2 + pshufd $0x1b,%xmm1,%xmm0 + pshufd $0xb1,%xmm1,%xmm1 + pshufd $0x1b,%xmm2,%xmm2 movdqa %xmm7,%xmm8 .byte 102,15,58,15,202,8 punpcklqdq %xmm0,%xmm2 @@ -1775,7 +1775,7 @@ _shaext_shortcut: .byte 102,15,56,0,231 movdqa %xmm2,%xmm10 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 nop movdqa %xmm1,%xmm9 .byte 15,56,203,202 @@ -1784,7 +1784,7 @@ _shaext_shortcut: paddd %xmm4,%xmm0 .byte 102,15,56,0,239 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 leaq 64(%rsi),%rsi .byte 15,56,204,220 .byte 15,56,203,202 @@ -1793,7 +1793,7 @@ _shaext_shortcut: paddd %xmm5,%xmm0 .byte 102,15,56,0,247 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm6,%xmm7 .byte 102,15,58,15,253,4 nop @@ -1805,7 +1805,7 @@ _shaext_shortcut: paddd %xmm6,%xmm0 .byte 15,56,205,222 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm3,%xmm7 .byte 102,15,58,15,254,4 nop @@ -1816,7 +1816,7 @@ _shaext_shortcut: paddd %xmm3,%xmm0 .byte 15,56,205,227 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm4,%xmm7 .byte 102,15,58,15,251,4 nop @@ -1827,7 +1827,7 @@ _shaext_shortcut: paddd %xmm4,%xmm0 .byte 15,56,205,236 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm5,%xmm7 .byte 102,15,58,15,252,4 nop @@ -1838,7 +1838,7 @@ _shaext_shortcut: paddd %xmm5,%xmm0 .byte 15,56,205,245 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm6,%xmm7 .byte 102,15,58,15,253,4 nop @@ -1849,7 +1849,7 @@ _shaext_shortcut: paddd %xmm6,%xmm0 .byte 15,56,205,222 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm3,%xmm7 .byte 102,15,58,15,254,4 nop @@ -1860,7 +1860,7 @@ _shaext_shortcut: paddd %xmm3,%xmm0 .byte 15,56,205,227 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm4,%xmm7 .byte 102,15,58,15,251,4 nop @@ -1871,7 +1871,7 @@ _shaext_shortcut: paddd %xmm4,%xmm0 .byte 15,56,205,236 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm5,%xmm7 .byte 102,15,58,15,252,4 nop @@ -1882,7 +1882,7 @@ _shaext_shortcut: paddd %xmm5,%xmm0 .byte 15,56,205,245 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm6,%xmm7 .byte 102,15,58,15,253,4 nop @@ -1893,7 +1893,7 @@ _shaext_shortcut: paddd %xmm6,%xmm0 .byte 15,56,205,222 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm3,%xmm7 .byte 102,15,58,15,254,4 nop @@ -1904,7 +1904,7 @@ _shaext_shortcut: paddd %xmm3,%xmm0 .byte 15,56,205,227 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm4,%xmm7 .byte 102,15,58,15,251,4 nop @@ -1915,7 +1915,7 @@ _shaext_shortcut: paddd %xmm4,%xmm0 .byte 15,56,205,236 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm5,%xmm7 .byte 102,15,58,15,252,4 .byte 15,56,203,202 @@ -1924,7 +1924,7 @@ _shaext_shortcut: movdqa 448-128(%rcx),%xmm0 paddd %xmm5,%xmm0 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 .byte 15,56,205,245 movdqa %xmm8,%xmm7 .byte 15,56,203,202 @@ -1933,7 +1933,7 @@ _shaext_shortcut: paddd %xmm6,%xmm0 nop .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 decq %rdx nop .byte 15,56,203,202 @@ -1942,9 +1942,9 @@ _shaext_shortcut: paddd %xmm9,%xmm1 jnz .Loop_shaext - pshufd $177,%xmm2,%xmm2 - pshufd $27,%xmm1,%xmm7 - pshufd $177,%xmm1,%xmm1 + pshufd $0xb1,%xmm2,%xmm2 + pshufd $0x1b,%xmm1,%xmm7 + pshufd $0xb1,%xmm1,%xmm1 punpckhqdq %xmm2,%xmm1 .byte 102,15,58,15,215,8 diff --git a/deps/openssl/asm_obsolete/x64-elf-gas/x86_64cpuid.s b/deps/openssl/asm_obsolete/x64-elf-gas/x86_64cpuid.s index 656a5ce85576e0..0e81a290e3ec09 100644 --- a/deps/openssl/asm_obsolete/x64-elf-gas/x86_64cpuid.s +++ b/deps/openssl/asm_obsolete/x64-elf-gas/x86_64cpuid.s @@ -44,43 +44,43 @@ OPENSSL_ia32_cpuid: movl %eax,%r11d xorl %eax,%eax - cmpl $1970169159,%ebx + cmpl $0x756e6547,%ebx setne %al movl %eax,%r9d - cmpl $1231384169,%edx + cmpl $0x49656e69,%edx setne %al orl %eax,%r9d - cmpl $1818588270,%ecx + cmpl $0x6c65746e,%ecx setne %al orl %eax,%r9d jz .Lintel - cmpl $1752462657,%ebx + cmpl $0x68747541,%ebx setne %al movl %eax,%r10d - cmpl $1769238117,%edx + cmpl $0x69746E65,%edx setne %al orl %eax,%r10d - cmpl $1145913699,%ecx + cmpl $0x444D4163,%ecx setne %al orl %eax,%r10d jnz .Lintel - movl $2147483648,%eax + movl $0x80000000,%eax cpuid - cmpl $2147483649,%eax + cmpl $0x80000001,%eax jb .Lintel movl %eax,%r10d - movl $2147483649,%eax + movl $0x80000001,%eax cpuid orl %ecx,%r9d - andl $2049,%r9d + andl $0x00000801,%r9d - cmpl $2147483656,%r10d + cmpl $0x80000008,%r10d jb .Lintel - movl $2147483656,%eax + movl $0x80000008,%eax cpuid movzbq %cl,%r10 incq %r10 @@ -92,7 +92,7 @@ OPENSSL_ia32_cpuid: shrl $16,%ebx cmpb %r10b,%bl ja .Lgeneric - andl $4026531839,%edx + andl $0xefffffff,%edx jmp .Lgeneric .Lintel: @@ -105,7 +105,7 @@ OPENSSL_ia32_cpuid: cpuid movl %eax,%r10d shrl $14,%r10d - andl $4095,%r10d + andl $0xfff,%r10d cmpl $7,%r11d jb .Lnocacheinfo @@ -118,29 +118,29 @@ OPENSSL_ia32_cpuid: .Lnocacheinfo: movl $1,%eax cpuid - andl $3220176895,%edx + andl $0xbfefffff,%edx cmpl $0,%r9d jne .Lnotintel - orl $1073741824,%edx + orl $0x40000000,%edx andb $15,%ah cmpb $15,%ah jne .Lnotintel - orl $1048576,%edx + orl $0x00100000,%edx .Lnotintel: btl $28,%edx jnc .Lgeneric - andl $4026531839,%edx + andl $0xefffffff,%edx cmpl $0,%r10d je .Lgeneric - orl $268435456,%edx + orl $0x10000000,%edx shrl $16,%ebx cmpb $1,%bl ja .Lgeneric - andl $4026531839,%edx + andl $0xefffffff,%edx .Lgeneric: - andl $2048,%r9d - andl $4294965247,%ecx + andl $0x00000800,%r9d + andl $0xfffff7ff,%ecx orl %ecx,%r9d movl %edx,%r10d @@ -152,9 +152,9 @@ OPENSSL_ia32_cpuid: cmpl $6,%eax je .Ldone .Lclear_avx: - movl $4026525695,%eax + movl $0xefffe7ff,%eax andl %eax,%r9d - andl $4294967263,8(%rdi) + andl $0xffffffdf,8(%rdi) .Ldone: shlq $32,%r9 movl %r10d,%eax diff --git a/deps/openssl/asm_obsolete/x64-macosx-gas/aes/aes-x86_64.s b/deps/openssl/asm_obsolete/x64-macosx-gas/aes/aes-x86_64.s index a50170a9a201f5..cb2db3584a444c 100644 --- a/deps/openssl/asm_obsolete/x64-macosx-gas/aes/aes-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-macosx-gas/aes/aes-x86_64.s @@ -81,8 +81,8 @@ L$enc_loop: movl 0(%r14,%rdi,8),%edi movl 0(%r14,%rbp,8),%ebp - andl $65280,%edi - andl $65280,%ebp + andl $0x0000ff00,%edi + andl $0x0000ff00,%ebp xorl %edi,%r10d xorl %ebp,%r11d @@ -94,8 +94,8 @@ L$enc_loop: movl 0(%r14,%rsi,8),%esi movl 0(%r14,%rdi,8),%edi - andl $65280,%esi - andl $65280,%edi + andl $0x0000ff00,%esi + andl $0x0000ff00,%edi shrl $16,%ebx xorl %esi,%r12d xorl %edi,%r8d @@ -108,9 +108,9 @@ L$enc_loop: movl 0(%r14,%rdi,8),%edi movl 0(%r14,%rbp,8),%ebp - andl $16711680,%esi - andl $16711680,%edi - andl $16711680,%ebp + andl $0x00ff0000,%esi + andl $0x00ff0000,%edi + andl $0x00ff0000,%ebp xorl %esi,%r10d xorl %edi,%r11d @@ -123,9 +123,9 @@ L$enc_loop: movl 2(%r14,%rdi,8),%edi movl 2(%r14,%rbp,8),%ebp - andl $16711680,%esi - andl $4278190080,%edi - andl $4278190080,%ebp + andl $0x00ff0000,%esi + andl $0xff000000,%edi + andl $0xff000000,%ebp xorl %esi,%r8d xorl %edi,%r10d @@ -138,8 +138,8 @@ L$enc_loop: movl 2(%r14,%rdi,8),%edi movl 16+0(%r15),%eax - andl $4278190080,%esi - andl $4278190080,%edi + andl $0xff000000,%esi + andl $0xff000000,%edi xorl %esi,%r12d xorl %edi,%r8d @@ -241,8 +241,8 @@ L$enc_loop_compact: xorl %r8d,%edx cmpq 16(%rsp),%r15 je L$enc_compact_done - movl $2155905152,%r10d - movl $2155905152,%r11d + movl $0x80808080,%r10d + movl $0x80808080,%r11d andl %eax,%r10d andl %ebx,%r11d movl %r10d,%esi @@ -253,10 +253,10 @@ L$enc_loop_compact: leal (%rbx,%rbx,1),%r9d subl %r10d,%esi subl %r11d,%edi - andl $4278124286,%r8d - andl $4278124286,%r9d - andl $454761243,%esi - andl $454761243,%edi + andl $0xfefefefe,%r8d + andl $0xfefefefe,%r9d + andl $0x1b1b1b1b,%esi + andl $0x1b1b1b1b,%edi movl %eax,%r10d movl %ebx,%r11d xorl %esi,%r8d @@ -264,9 +264,9 @@ L$enc_loop_compact: xorl %r8d,%eax xorl %r9d,%ebx - movl $2155905152,%r12d + movl $0x80808080,%r12d roll $24,%eax - movl $2155905152,%ebp + movl $0x80808080,%ebp roll $24,%ebx andl %ecx,%r12d andl %edx,%ebp @@ -289,10 +289,10 @@ L$enc_loop_compact: xorl %r10d,%eax xorl %r11d,%ebx - andl $4278124286,%r8d - andl $4278124286,%r9d - andl $454761243,%esi - andl $454761243,%edi + andl $0xfefefefe,%r8d + andl $0xfefefefe,%r9d + andl $0x1b1b1b1b,%esi + andl $0x1b1b1b1b,%edi movl %ecx,%r12d movl %edx,%ebp xorl %esi,%r8d @@ -345,7 +345,7 @@ _AES_encrypt: andq $-64,%rsp subq %rsp,%rcx negq %rcx - andq $960,%rcx + andq $0x3c0,%rcx subq %rcx,%rsp subq $32,%rsp @@ -370,7 +370,7 @@ L$enc_prologue: leaq L$AES_Te+2048(%rip),%r14 leaq 768(%rsp),%rbp subq %r14,%rbp - andq $768,%rbp + andq $0x300,%rbp leaq (%r14,%rbp,1),%r14 call _x86_64_AES_encrypt_compact @@ -792,7 +792,7 @@ _AES_decrypt: andq $-64,%rsp subq %rsp,%rcx negq %rcx - andq $960,%rcx + andq $0x3c0,%rcx subq %rcx,%rsp subq $32,%rsp @@ -817,7 +817,7 @@ L$dec_prologue: leaq L$AES_Td+2048(%rip),%r14 leaq 768(%rsp),%rbp subq %r14,%rbp - andq $768,%rbp + andq $0x300,%rbp leaq (%r14,%rbp,1),%r14 shrq $3,%rbp addq %rbp,%r14 @@ -1333,9 +1333,9 @@ L$cbc_picked_te: movq %r14,%r10 leaq 2304(%r14),%r11 movq %r15,%r12 - andq $4095,%r10 - andq $4095,%r11 - andq $4095,%r12 + andq $0xFFF,%r10 + andq $0xFFF,%r11 + andq $0xFFF,%r12 cmpq %r11,%r12 jb L$cbc_te_break_out @@ -1344,7 +1344,7 @@ L$cbc_picked_te: jmp L$cbc_te_ok L$cbc_te_break_out: subq %r10,%r12 - andq $4095,%r12 + andq $0xFFF,%r12 addq $320,%r12 subq %r12,%r15 .p2align 2 @@ -1370,7 +1370,7 @@ L$cbc_fast_body: movq %r15,%r10 subq %r14,%r10 - andq $4095,%r10 + andq $0xfff,%r10 cmpq $2304,%r10 jb L$cbc_do_ecopy cmpq $4096-248,%r10 @@ -1557,7 +1557,7 @@ L$cbc_slow_prologue: leaq -88-63(%rcx),%r10 subq %rbp,%r10 negq %r10 - andq $960,%r10 + andq $0x3c0,%r10 subq %r10,%rbp xchgq %rsp,%rbp @@ -1586,7 +1586,7 @@ L$cbc_slow_body: leaq 2048(%r14),%r14 leaq 768-8(%rsp),%rax subq %r14,%rax - andq $768,%rax + andq $0x300,%rax leaq (%r14,%rax,1),%r14 cmpq $0,%rbx diff --git a/deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-sha1-x86_64.s b/deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-sha1-x86_64.s index 015db5faa7facd..970a12149bd241 100644 --- a/deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-sha1-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-sha1-x86_64.s @@ -1392,8 +1392,8 @@ aesni_cbc_sha1_enc_shaext: movups 16(%rcx),%xmm0 leaq 112(%rcx),%rcx - pshufd $27,%xmm8,%xmm8 - pshufd $27,%xmm9,%xmm9 + pshufd $0b00011011,%xmm8,%xmm8 + pshufd $0b00011011,%xmm9,%xmm9 jmp L$oop_shaext .p2align 4 @@ -1672,8 +1672,8 @@ L$aesenclast9: leaq 64(%rdi),%rdi jnz L$oop_shaext - pshufd $27,%xmm8,%xmm8 - pshufd $27,%xmm9,%xmm9 + pshufd $0b00011011,%xmm8,%xmm8 + pshufd $0b00011011,%xmm9,%xmm9 movups %xmm2,(%r8) movdqu %xmm8,(%r9) movd %xmm9,16(%r9) diff --git a/deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s b/deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s index 41ad80eebd1f89..6aa1441150a825 100644 --- a/deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-macosx-gas/aes/aesni-x86_64.s @@ -503,7 +503,7 @@ _aesni_ecb_encrypt: testl %r8d,%r8d jz L$ecb_decrypt - cmpq $128,%rdx + cmpq $0x80,%rdx jb L$ecb_enc_tail movdqu (%rdi),%xmm2 @@ -515,7 +515,7 @@ _aesni_ecb_encrypt: movdqu 96(%rdi),%xmm8 movdqu 112(%rdi),%xmm9 leaq 128(%rdi),%rdi - subq $128,%rdx + subq $0x80,%rdx jmp L$ecb_enc_loop8_enter .p2align 4 L$ecb_enc_loop8: @@ -543,7 +543,7 @@ L$ecb_enc_loop8_enter: call _aesni_encrypt8 - subq $128,%rdx + subq $0x80,%rdx jnc L$ecb_enc_loop8 movups %xmm2,(%rsi) @@ -557,22 +557,22 @@ L$ecb_enc_loop8_enter: movups %xmm8,96(%rsi) movups %xmm9,112(%rsi) leaq 128(%rsi),%rsi - addq $128,%rdx + addq $0x80,%rdx jz L$ecb_ret L$ecb_enc_tail: movups (%rdi),%xmm2 - cmpq $32,%rdx + cmpq $0x20,%rdx jb L$ecb_enc_one movups 16(%rdi),%xmm3 je L$ecb_enc_two movups 32(%rdi),%xmm4 - cmpq $64,%rdx + cmpq $0x40,%rdx jb L$ecb_enc_three movups 48(%rdi),%xmm5 je L$ecb_enc_four movups 64(%rdi),%xmm6 - cmpq $96,%rdx + cmpq $0x60,%rdx jb L$ecb_enc_five movups 80(%rdi),%xmm7 je L$ecb_enc_six @@ -646,7 +646,7 @@ L$ecb_enc_six: .p2align 4 L$ecb_decrypt: - cmpq $128,%rdx + cmpq $0x80,%rdx jb L$ecb_dec_tail movdqu (%rdi),%xmm2 @@ -658,7 +658,7 @@ L$ecb_decrypt: movdqu 96(%rdi),%xmm8 movdqu 112(%rdi),%xmm9 leaq 128(%rdi),%rdi - subq $128,%rdx + subq $0x80,%rdx jmp L$ecb_dec_loop8_enter .p2align 4 L$ecb_dec_loop8: @@ -687,7 +687,7 @@ L$ecb_dec_loop8_enter: call _aesni_decrypt8 movups (%r11),%xmm0 - subq $128,%rdx + subq $0x80,%rdx jnc L$ecb_dec_loop8 movups %xmm2,(%rsi) @@ -709,22 +709,22 @@ L$ecb_dec_loop8_enter: movups %xmm9,112(%rsi) pxor %xmm9,%xmm9 leaq 128(%rsi),%rsi - addq $128,%rdx + addq $0x80,%rdx jz L$ecb_ret L$ecb_dec_tail: movups (%rdi),%xmm2 - cmpq $32,%rdx + cmpq $0x20,%rdx jb L$ecb_dec_one movups 16(%rdi),%xmm3 je L$ecb_dec_two movups 32(%rdi),%xmm4 - cmpq $64,%rdx + cmpq $0x40,%rdx jb L$ecb_dec_three movups 48(%rdi),%xmm5 je L$ecb_dec_four movups 64(%rdi),%xmm6 - cmpq $96,%rdx + cmpq $0x60,%rdx jb L$ecb_dec_five movups 80(%rdi),%xmm7 je L$ecb_dec_six @@ -1598,7 +1598,7 @@ L$oop_enc1_8: movdqa L$xts_magic(%rip),%xmm8 movdqa %xmm2,%xmm15 - pshufd $95,%xmm2,%xmm9 + pshufd $0x5f,%xmm2,%xmm9 pxor %xmm0,%xmm1 movdqa %xmm9,%xmm14 paddd %xmm9,%xmm9 @@ -1697,7 +1697,7 @@ L$xts_enc_grandloop: .byte 102,15,56,220,248 movups 64(%r11),%xmm0 movdqa %xmm8,80(%rsp) - pshufd $95,%xmm15,%xmm9 + pshufd $0x5f,%xmm15,%xmm9 jmp L$xts_enc_loop6 .p2align 5 L$xts_enc_loop6: @@ -1836,13 +1836,13 @@ L$xts_enc_short: jz L$xts_enc_done pxor %xmm0,%xmm11 - cmpq $32,%rdx + cmpq $0x20,%rdx jb L$xts_enc_one pxor %xmm0,%xmm12 je L$xts_enc_two pxor %xmm0,%xmm13 - cmpq $64,%rdx + cmpq $0x40,%rdx jb L$xts_enc_three pxor %xmm0,%xmm14 je L$xts_enc_four @@ -2069,7 +2069,7 @@ L$oop_enc1_11: movdqa L$xts_magic(%rip),%xmm8 movdqa %xmm2,%xmm15 - pshufd $95,%xmm2,%xmm9 + pshufd $0x5f,%xmm2,%xmm9 pxor %xmm0,%xmm1 movdqa %xmm9,%xmm14 paddd %xmm9,%xmm9 @@ -2168,7 +2168,7 @@ L$xts_dec_grandloop: .byte 102,15,56,222,248 movups 64(%r11),%xmm0 movdqa %xmm8,80(%rsp) - pshufd $95,%xmm15,%xmm9 + pshufd $0x5f,%xmm15,%xmm9 jmp L$xts_dec_loop6 .p2align 5 L$xts_dec_loop6: @@ -2308,13 +2308,13 @@ L$xts_dec_short: jz L$xts_dec_done pxor %xmm0,%xmm12 - cmpq $32,%rdx + cmpq $0x20,%rdx jb L$xts_dec_one pxor %xmm0,%xmm13 je L$xts_dec_two pxor %xmm0,%xmm14 - cmpq $64,%rdx + cmpq $0x40,%rdx jb L$xts_dec_three je L$xts_dec_four @@ -2345,7 +2345,7 @@ L$xts_dec_short: pcmpgtd %xmm15,%xmm14 movdqu %xmm6,64(%rsi) leaq 80(%rsi),%rsi - pshufd $19,%xmm14,%xmm11 + pshufd $0x13,%xmm14,%xmm11 andq $15,%r9 jz L$xts_dec_ret @@ -2634,7 +2634,7 @@ L$cbc_decrypt_bulk: leaq -8(%rax),%rbp movups (%r8),%xmm10 movl %r10d,%eax - cmpq $80,%rdx + cmpq $0x50,%rdx jbe L$cbc_dec_tail movups (%rcx),%xmm0 @@ -2650,14 +2650,14 @@ L$cbc_decrypt_bulk: movdqu 80(%rdi),%xmm7 movdqa %xmm6,%xmm15 movl _OPENSSL_ia32cap_P+4(%rip),%r9d - cmpq $112,%rdx + cmpq $0x70,%rdx jbe L$cbc_dec_six_or_seven andl $71303168,%r9d - subq $80,%rdx + subq $0x50,%rdx cmpl $4194304,%r9d je L$cbc_dec_loop6_enter - subq $32,%rdx + subq $0x20,%rdx leaq 112(%rcx),%rcx jmp L$cbc_dec_loop8_enter .p2align 4 @@ -2672,7 +2672,7 @@ L$cbc_dec_loop8_enter: movups 16-112(%rcx),%xmm1 pxor %xmm0,%xmm4 xorq %r11,%r11 - cmpq $112,%rdx + cmpq $0x70,%rdx pxor %xmm0,%xmm5 pxor %xmm0,%xmm6 pxor %xmm0,%xmm7 @@ -2857,21 +2857,21 @@ L$cbc_dec_done: movups %xmm8,96(%rsi) leaq 112(%rsi),%rsi - subq $128,%rdx + subq $0x80,%rdx ja L$cbc_dec_loop8 movaps %xmm9,%xmm2 leaq -112(%rcx),%rcx - addq $112,%rdx + addq $0x70,%rdx jle L$cbc_dec_clear_tail_collected movups %xmm9,(%rsi) leaq 16(%rsi),%rsi - cmpq $80,%rdx + cmpq $0x50,%rdx jbe L$cbc_dec_tail movaps %xmm11,%xmm2 L$cbc_dec_six_or_seven: - cmpq $96,%rdx + cmpq $0x60,%rdx ja L$cbc_dec_seven movaps %xmm7,%xmm8 @@ -2964,33 +2964,33 @@ L$cbc_dec_loop6_enter: movl %r10d,%eax movdqu %xmm6,64(%rsi) leaq 80(%rsi),%rsi - subq $96,%rdx + subq $0x60,%rdx ja L$cbc_dec_loop6 movdqa %xmm7,%xmm2 - addq $80,%rdx + addq $0x50,%rdx jle L$cbc_dec_clear_tail_collected movups %xmm7,(%rsi) leaq 16(%rsi),%rsi L$cbc_dec_tail: movups (%rdi),%xmm2 - subq $16,%rdx + subq $0x10,%rdx jbe L$cbc_dec_one movups 16(%rdi),%xmm3 movaps %xmm2,%xmm11 - subq $16,%rdx + subq $0x10,%rdx jbe L$cbc_dec_two movups 32(%rdi),%xmm4 movaps %xmm3,%xmm12 - subq $16,%rdx + subq $0x10,%rdx jbe L$cbc_dec_three movups 48(%rdi),%xmm5 movaps %xmm4,%xmm13 - subq $16,%rdx + subq $0x10,%rdx jbe L$cbc_dec_four movups 64(%rdi),%xmm6 @@ -3015,7 +3015,7 @@ L$cbc_dec_tail: movdqa %xmm6,%xmm2 pxor %xmm6,%xmm6 pxor %xmm7,%xmm7 - subq $16,%rdx + subq $0x10,%rdx jmp L$cbc_dec_tail_collected .p2align 4 @@ -3332,7 +3332,7 @@ L$oop_key192: pslldq $4,%xmm0 pxor %xmm3,%xmm0 - pshufd $255,%xmm0,%xmm3 + pshufd $0xff,%xmm0,%xmm3 pxor %xmm1,%xmm3 pslldq $4,%xmm1 pxor %xmm1,%xmm3 @@ -3419,7 +3419,7 @@ L$oop_key256: decl %r10d jz L$done_key256 - pshufd $255,%xmm0,%xmm2 + pshufd $0xff,%xmm0,%xmm2 pxor %xmm3,%xmm3 .byte 102,15,56,221,211 @@ -3462,11 +3462,11 @@ L$key_expansion_128: movups %xmm0,(%rax) leaq 16(%rax),%rax L$key_expansion_128_cold: - shufps $16,%xmm0,%xmm4 + shufps $0b00010000,%xmm0,%xmm4 xorps %xmm4,%xmm0 - shufps $140,%xmm0,%xmm4 + shufps $0b10001100,%xmm0,%xmm4 xorps %xmm4,%xmm0 - shufps $255,%xmm1,%xmm1 + shufps $0b11111111,%xmm1,%xmm1 xorps %xmm1,%xmm0 .byte 0xf3,0xc3 @@ -3477,25 +3477,25 @@ L$key_expansion_192a: L$key_expansion_192a_cold: movaps %xmm2,%xmm5 L$key_expansion_192b_warm: - shufps $16,%xmm0,%xmm4 + shufps $0b00010000,%xmm0,%xmm4 movdqa %xmm2,%xmm3 xorps %xmm4,%xmm0 - shufps $140,%xmm0,%xmm4 + shufps $0b10001100,%xmm0,%xmm4 pslldq $4,%xmm3 xorps %xmm4,%xmm0 - pshufd $85,%xmm1,%xmm1 + pshufd $0b01010101,%xmm1,%xmm1 pxor %xmm3,%xmm2 pxor %xmm1,%xmm0 - pshufd $255,%xmm0,%xmm3 + pshufd $0b11111111,%xmm0,%xmm3 pxor %xmm3,%xmm2 .byte 0xf3,0xc3 .p2align 4 L$key_expansion_192b: movaps %xmm0,%xmm3 - shufps $68,%xmm0,%xmm5 + shufps $0b01000100,%xmm0,%xmm5 movups %xmm5,(%rax) - shufps $78,%xmm2,%xmm3 + shufps $0b01001110,%xmm2,%xmm3 movups %xmm3,16(%rax) leaq 32(%rax),%rax jmp L$key_expansion_192b_warm @@ -3505,11 +3505,11 @@ L$key_expansion_256a: movups %xmm2,(%rax) leaq 16(%rax),%rax L$key_expansion_256a_cold: - shufps $16,%xmm0,%xmm4 + shufps $0b00010000,%xmm0,%xmm4 xorps %xmm4,%xmm0 - shufps $140,%xmm0,%xmm4 + shufps $0b10001100,%xmm0,%xmm4 xorps %xmm4,%xmm0 - shufps $255,%xmm1,%xmm1 + shufps $0b11111111,%xmm1,%xmm1 xorps %xmm1,%xmm0 .byte 0xf3,0xc3 @@ -3518,11 +3518,11 @@ L$key_expansion_256b: movups %xmm0,(%rax) leaq 16(%rax),%rax - shufps $16,%xmm2,%xmm4 + shufps $0b00010000,%xmm2,%xmm4 xorps %xmm4,%xmm2 - shufps $140,%xmm2,%xmm4 + shufps $0b10001100,%xmm2,%xmm4 xorps %xmm4,%xmm2 - shufps $170,%xmm1,%xmm1 + shufps $0b10101010,%xmm1,%xmm1 xorps %xmm1,%xmm2 .byte 0xf3,0xc3 diff --git a/deps/openssl/asm_obsolete/x64-macosx-gas/aes/bsaes-x86_64.s b/deps/openssl/asm_obsolete/x64-macosx-gas/aes/bsaes-x86_64.s index 2af36a90b05f91..52ae782e9a2e48 100644 --- a/deps/openssl/asm_obsolete/x64-macosx-gas/aes/bsaes-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-macosx-gas/aes/bsaes-x86_64.s @@ -324,45 +324,45 @@ L$enc_sbox: pxor %xmm2,%xmm5 decl %r10d jl L$enc_done - pshufd $147,%xmm15,%xmm7 - pshufd $147,%xmm0,%xmm8 + pshufd $0x93,%xmm15,%xmm7 + pshufd $0x93,%xmm0,%xmm8 pxor %xmm7,%xmm15 - pshufd $147,%xmm3,%xmm9 + pshufd $0x93,%xmm3,%xmm9 pxor %xmm8,%xmm0 - pshufd $147,%xmm5,%xmm10 + pshufd $0x93,%xmm5,%xmm10 pxor %xmm9,%xmm3 - pshufd $147,%xmm2,%xmm11 + pshufd $0x93,%xmm2,%xmm11 pxor %xmm10,%xmm5 - pshufd $147,%xmm6,%xmm12 + pshufd $0x93,%xmm6,%xmm12 pxor %xmm11,%xmm2 - pshufd $147,%xmm1,%xmm13 + pshufd $0x93,%xmm1,%xmm13 pxor %xmm12,%xmm6 - pshufd $147,%xmm4,%xmm14 + pshufd $0x93,%xmm4,%xmm14 pxor %xmm13,%xmm1 pxor %xmm14,%xmm4 pxor %xmm15,%xmm8 pxor %xmm4,%xmm7 pxor %xmm4,%xmm8 - pshufd $78,%xmm15,%xmm15 + pshufd $0x4E,%xmm15,%xmm15 pxor %xmm0,%xmm9 - pshufd $78,%xmm0,%xmm0 + pshufd $0x4E,%xmm0,%xmm0 pxor %xmm2,%xmm12 pxor %xmm7,%xmm15 pxor %xmm6,%xmm13 pxor %xmm8,%xmm0 pxor %xmm5,%xmm11 - pshufd $78,%xmm2,%xmm7 + pshufd $0x4E,%xmm2,%xmm7 pxor %xmm1,%xmm14 - pshufd $78,%xmm6,%xmm8 + pshufd $0x4E,%xmm6,%xmm8 pxor %xmm3,%xmm10 - pshufd $78,%xmm5,%xmm2 + pshufd $0x4E,%xmm5,%xmm2 pxor %xmm4,%xmm10 - pshufd $78,%xmm4,%xmm6 + pshufd $0x4E,%xmm4,%xmm6 pxor %xmm4,%xmm11 - pshufd $78,%xmm1,%xmm5 + pshufd $0x4E,%xmm1,%xmm5 pxor %xmm11,%xmm7 - pshufd $78,%xmm3,%xmm1 + pshufd $0x4E,%xmm3,%xmm1 pxor %xmm12,%xmm8 pxor %xmm10,%xmm2 pxor %xmm14,%xmm6 @@ -796,24 +796,24 @@ L$dec_sbox: decl %r10d jl L$dec_done - pshufd $78,%xmm15,%xmm7 - pshufd $78,%xmm2,%xmm13 + pshufd $0x4E,%xmm15,%xmm7 + pshufd $0x4E,%xmm2,%xmm13 pxor %xmm15,%xmm7 - pshufd $78,%xmm4,%xmm14 + pshufd $0x4E,%xmm4,%xmm14 pxor %xmm2,%xmm13 - pshufd $78,%xmm0,%xmm8 + pshufd $0x4E,%xmm0,%xmm8 pxor %xmm4,%xmm14 - pshufd $78,%xmm5,%xmm9 + pshufd $0x4E,%xmm5,%xmm9 pxor %xmm0,%xmm8 - pshufd $78,%xmm3,%xmm10 + pshufd $0x4E,%xmm3,%xmm10 pxor %xmm5,%xmm9 pxor %xmm13,%xmm15 pxor %xmm13,%xmm0 - pshufd $78,%xmm1,%xmm11 + pshufd $0x4E,%xmm1,%xmm11 pxor %xmm3,%xmm10 pxor %xmm7,%xmm5 pxor %xmm8,%xmm3 - pshufd $78,%xmm6,%xmm12 + pshufd $0x4E,%xmm6,%xmm12 pxor %xmm1,%xmm11 pxor %xmm14,%xmm0 pxor %xmm9,%xmm1 @@ -827,45 +827,45 @@ L$dec_sbox: pxor %xmm14,%xmm1 pxor %xmm14,%xmm6 pxor %xmm12,%xmm4 - pshufd $147,%xmm15,%xmm7 - pshufd $147,%xmm0,%xmm8 + pshufd $0x93,%xmm15,%xmm7 + pshufd $0x93,%xmm0,%xmm8 pxor %xmm7,%xmm15 - pshufd $147,%xmm5,%xmm9 + pshufd $0x93,%xmm5,%xmm9 pxor %xmm8,%xmm0 - pshufd $147,%xmm3,%xmm10 + pshufd $0x93,%xmm3,%xmm10 pxor %xmm9,%xmm5 - pshufd $147,%xmm1,%xmm11 + pshufd $0x93,%xmm1,%xmm11 pxor %xmm10,%xmm3 - pshufd $147,%xmm6,%xmm12 + pshufd $0x93,%xmm6,%xmm12 pxor %xmm11,%xmm1 - pshufd $147,%xmm2,%xmm13 + pshufd $0x93,%xmm2,%xmm13 pxor %xmm12,%xmm6 - pshufd $147,%xmm4,%xmm14 + pshufd $0x93,%xmm4,%xmm14 pxor %xmm13,%xmm2 pxor %xmm14,%xmm4 pxor %xmm15,%xmm8 pxor %xmm4,%xmm7 pxor %xmm4,%xmm8 - pshufd $78,%xmm15,%xmm15 + pshufd $0x4E,%xmm15,%xmm15 pxor %xmm0,%xmm9 - pshufd $78,%xmm0,%xmm0 + pshufd $0x4E,%xmm0,%xmm0 pxor %xmm1,%xmm12 pxor %xmm7,%xmm15 pxor %xmm6,%xmm13 pxor %xmm8,%xmm0 pxor %xmm3,%xmm11 - pshufd $78,%xmm1,%xmm7 + pshufd $0x4E,%xmm1,%xmm7 pxor %xmm2,%xmm14 - pshufd $78,%xmm6,%xmm8 + pshufd $0x4E,%xmm6,%xmm8 pxor %xmm5,%xmm10 - pshufd $78,%xmm3,%xmm1 + pshufd $0x4E,%xmm3,%xmm1 pxor %xmm4,%xmm10 - pshufd $78,%xmm4,%xmm6 + pshufd $0x4E,%xmm4,%xmm6 pxor %xmm4,%xmm11 - pshufd $78,%xmm2,%xmm3 + pshufd $0x4E,%xmm2,%xmm3 pxor %xmm11,%xmm7 - pshufd $78,%xmm5,%xmm2 + pshufd $0x4E,%xmm5,%xmm2 pxor %xmm12,%xmm8 pxor %xmm1,%xmm10 pxor %xmm14,%xmm6 @@ -1552,20 +1552,20 @@ L$xts_enc_prologue: movdqa %xmm7,(%rax) andq $-16,%r14 - subq $128,%rsp + subq $0x80,%rsp movdqa 32(%rbp),%xmm6 pxor %xmm14,%xmm14 movdqa L$xts_magic(%rip),%xmm12 pcmpgtd %xmm6,%xmm14 - subq $128,%r14 + subq $0x80,%r14 jc L$xts_enc_short jmp L$xts_enc_loop .p2align 4 L$xts_enc_loop: - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm15 movdqa %xmm6,0(%rsp) @@ -1573,7 +1573,7 @@ L$xts_enc_loop: pand %xmm12,%xmm13 pcmpgtd %xmm6,%xmm14 pxor %xmm13,%xmm6 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm0 movdqa %xmm6,16(%rsp) @@ -1582,7 +1582,7 @@ L$xts_enc_loop: pcmpgtd %xmm6,%xmm14 pxor %xmm13,%xmm6 movdqu 0(%r12),%xmm7 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm1 movdqa %xmm6,32(%rsp) @@ -1592,7 +1592,7 @@ L$xts_enc_loop: pxor %xmm13,%xmm6 movdqu 16(%r12),%xmm8 pxor %xmm7,%xmm15 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm2 movdqa %xmm6,48(%rsp) @@ -1602,7 +1602,7 @@ L$xts_enc_loop: pxor %xmm13,%xmm6 movdqu 32(%r12),%xmm9 pxor %xmm8,%xmm0 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm3 movdqa %xmm6,64(%rsp) @@ -1612,7 +1612,7 @@ L$xts_enc_loop: pxor %xmm13,%xmm6 movdqu 48(%r12),%xmm10 pxor %xmm9,%xmm1 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm4 movdqa %xmm6,80(%rsp) @@ -1622,7 +1622,7 @@ L$xts_enc_loop: pxor %xmm13,%xmm6 movdqu 64(%r12),%xmm11 pxor %xmm10,%xmm2 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm5 movdqa %xmm6,96(%rsp) @@ -1666,20 +1666,20 @@ L$xts_enc_loop: pxor %xmm14,%xmm14 movdqa L$xts_magic(%rip),%xmm12 pcmpgtd %xmm6,%xmm14 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 paddq %xmm6,%xmm6 pand %xmm12,%xmm13 pcmpgtd %xmm6,%xmm14 pxor %xmm13,%xmm6 - subq $128,%r14 + subq $0x80,%r14 jnc L$xts_enc_loop L$xts_enc_short: - addq $128,%r14 + addq $0x80,%r14 jz L$xts_enc_done - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm15 movdqa %xmm6,0(%rsp) @@ -1687,7 +1687,7 @@ L$xts_enc_short: pand %xmm12,%xmm13 pcmpgtd %xmm6,%xmm14 pxor %xmm13,%xmm6 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm0 movdqa %xmm6,16(%rsp) @@ -1698,7 +1698,7 @@ L$xts_enc_short: movdqu 0(%r12),%xmm7 cmpq $16,%r14 je L$xts_enc_1 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm1 movdqa %xmm6,32(%rsp) @@ -1710,7 +1710,7 @@ L$xts_enc_short: cmpq $32,%r14 je L$xts_enc_2 pxor %xmm7,%xmm15 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm2 movdqa %xmm6,48(%rsp) @@ -1722,7 +1722,7 @@ L$xts_enc_short: cmpq $48,%r14 je L$xts_enc_3 pxor %xmm8,%xmm0 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm3 movdqa %xmm6,64(%rsp) @@ -1734,7 +1734,7 @@ L$xts_enc_short: cmpq $64,%r14 je L$xts_enc_4 pxor %xmm9,%xmm1 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm4 movdqa %xmm6,80(%rsp) @@ -1746,7 +1746,7 @@ L$xts_enc_short: cmpq $80,%r14 je L$xts_enc_5 pxor %xmm10,%xmm2 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm5 movdqa %xmm6,96(%rsp) @@ -2011,20 +2011,20 @@ L$xts_dec_prologue: shlq $4,%rax subq %rax,%r14 - subq $128,%rsp + subq $0x80,%rsp movdqa 32(%rbp),%xmm6 pxor %xmm14,%xmm14 movdqa L$xts_magic(%rip),%xmm12 pcmpgtd %xmm6,%xmm14 - subq $128,%r14 + subq $0x80,%r14 jc L$xts_dec_short jmp L$xts_dec_loop .p2align 4 L$xts_dec_loop: - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm15 movdqa %xmm6,0(%rsp) @@ -2032,7 +2032,7 @@ L$xts_dec_loop: pand %xmm12,%xmm13 pcmpgtd %xmm6,%xmm14 pxor %xmm13,%xmm6 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm0 movdqa %xmm6,16(%rsp) @@ -2041,7 +2041,7 @@ L$xts_dec_loop: pcmpgtd %xmm6,%xmm14 pxor %xmm13,%xmm6 movdqu 0(%r12),%xmm7 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm1 movdqa %xmm6,32(%rsp) @@ -2051,7 +2051,7 @@ L$xts_dec_loop: pxor %xmm13,%xmm6 movdqu 16(%r12),%xmm8 pxor %xmm7,%xmm15 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm2 movdqa %xmm6,48(%rsp) @@ -2061,7 +2061,7 @@ L$xts_dec_loop: pxor %xmm13,%xmm6 movdqu 32(%r12),%xmm9 pxor %xmm8,%xmm0 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm3 movdqa %xmm6,64(%rsp) @@ -2071,7 +2071,7 @@ L$xts_dec_loop: pxor %xmm13,%xmm6 movdqu 48(%r12),%xmm10 pxor %xmm9,%xmm1 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm4 movdqa %xmm6,80(%rsp) @@ -2081,7 +2081,7 @@ L$xts_dec_loop: pxor %xmm13,%xmm6 movdqu 64(%r12),%xmm11 pxor %xmm10,%xmm2 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm5 movdqa %xmm6,96(%rsp) @@ -2125,20 +2125,20 @@ L$xts_dec_loop: pxor %xmm14,%xmm14 movdqa L$xts_magic(%rip),%xmm12 pcmpgtd %xmm6,%xmm14 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 paddq %xmm6,%xmm6 pand %xmm12,%xmm13 pcmpgtd %xmm6,%xmm14 pxor %xmm13,%xmm6 - subq $128,%r14 + subq $0x80,%r14 jnc L$xts_dec_loop L$xts_dec_short: - addq $128,%r14 + addq $0x80,%r14 jz L$xts_dec_done - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm15 movdqa %xmm6,0(%rsp) @@ -2146,7 +2146,7 @@ L$xts_dec_short: pand %xmm12,%xmm13 pcmpgtd %xmm6,%xmm14 pxor %xmm13,%xmm6 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm0 movdqa %xmm6,16(%rsp) @@ -2157,7 +2157,7 @@ L$xts_dec_short: movdqu 0(%r12),%xmm7 cmpq $16,%r14 je L$xts_dec_1 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm1 movdqa %xmm6,32(%rsp) @@ -2169,7 +2169,7 @@ L$xts_dec_short: cmpq $32,%r14 je L$xts_dec_2 pxor %xmm7,%xmm15 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm2 movdqa %xmm6,48(%rsp) @@ -2181,7 +2181,7 @@ L$xts_dec_short: cmpq $48,%r14 je L$xts_dec_3 pxor %xmm8,%xmm0 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm3 movdqa %xmm6,64(%rsp) @@ -2193,7 +2193,7 @@ L$xts_dec_short: cmpq $64,%r14 je L$xts_dec_4 pxor %xmm9,%xmm1 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm4 movdqa %xmm6,80(%rsp) @@ -2205,7 +2205,7 @@ L$xts_dec_short: cmpq $80,%r14 je L$xts_dec_5 pxor %xmm10,%xmm2 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 pxor %xmm14,%xmm14 movdqa %xmm6,%xmm5 movdqa %xmm6,96(%rsp) @@ -2382,7 +2382,7 @@ L$xts_dec_done: pxor %xmm14,%xmm14 movdqa L$xts_magic(%rip),%xmm12 pcmpgtd %xmm6,%xmm14 - pshufd $19,%xmm14,%xmm13 + pshufd $0x13,%xmm14,%xmm13 movdqa %xmm6,%xmm5 paddq %xmm6,%xmm6 pand %xmm12,%xmm13 diff --git a/deps/openssl/asm_obsolete/x64-macosx-gas/aes/vpaes-x86_64.s b/deps/openssl/asm_obsolete/x64-macosx-gas/aes/vpaes-x86_64.s index c724170ce99e1b..2ffd0bc1007578 100644 --- a/deps/openssl/asm_obsolete/x64-macosx-gas/aes/vpaes-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-macosx-gas/aes/vpaes-x86_64.s @@ -60,7 +60,7 @@ L$enc_loop: addq $16,%r11 pxor %xmm0,%xmm3 .byte 102,15,56,0,193 - andq $48,%r11 + andq $0x30,%r11 subq $1,%rax pxor %xmm3,%xmm0 @@ -120,10 +120,10 @@ _vpaes_decrypt_core: pand %xmm9,%xmm0 .byte 102,15,56,0,208 movdqa L$k_dipt+16(%rip),%xmm0 - xorq $48,%r11 + xorq $0x30,%r11 leaq L$k_dsbd(%rip),%r10 .byte 102,15,56,0,193 - andq $48,%r11 + andq $0x30,%r11 pxor %xmm5,%xmm2 movdqa L$k_mc_forward+48(%rip),%xmm5 pxor %xmm2,%xmm0 @@ -242,7 +242,7 @@ L$schedule_am_decrypting: movdqa (%r8,%r10,1),%xmm1 .byte 102,15,56,0,217 movdqu %xmm3,(%rdx) - xorq $48,%r8 + xorq $0x30,%r8 L$schedule_go: cmpl $192,%esi @@ -332,7 +332,7 @@ L$oop_schedule_256: call _vpaes_schedule_mangle - pshufd $255,%xmm0,%xmm0 + pshufd $0xFF,%xmm0,%xmm0 movdqa %xmm7,%xmm5 movdqa %xmm6,%xmm7 call _vpaes_schedule_low_round @@ -399,8 +399,8 @@ L$schedule_mangle_last_dec: .p2align 4 _vpaes_schedule_192_smear: - pshufd $128,%xmm6,%xmm1 - pshufd $254,%xmm7,%xmm0 + pshufd $0x80,%xmm6,%xmm1 + pshufd $0xFE,%xmm7,%xmm0 pxor %xmm1,%xmm6 pxor %xmm1,%xmm1 pxor %xmm0,%xmm6 @@ -437,7 +437,7 @@ _vpaes_schedule_round: pxor %xmm1,%xmm7 - pshufd $255,%xmm0,%xmm0 + pshufd $0xFF,%xmm0,%xmm0 .byte 102,15,58,15,192,1 @@ -596,7 +596,7 @@ L$schedule_mangle_both: movdqa (%r8,%r10,1),%xmm1 .byte 102,15,56,0,217 addq $-16,%r8 - andq $48,%r8 + andq $0x30,%r8 movdqu %xmm3,(%rdx) .byte 0xf3,0xc3 @@ -614,7 +614,7 @@ _vpaes_set_encrypt_key: movl %eax,240(%rdx) movl $0,%ecx - movl $48,%r8d + movl $0x30,%r8d call _vpaes_schedule_core xorl %eax,%eax .byte 0xf3,0xc3 diff --git a/deps/openssl/asm_obsolete/x64-macosx-gas/bn/rsaz-x86_64.s b/deps/openssl/asm_obsolete/x64-macosx-gas/bn/rsaz-x86_64.s index 4e70deabbd3f6a..b92f098e73c214 100644 --- a/deps/openssl/asm_obsolete/x64-macosx-gas/bn/rsaz-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-macosx-gas/bn/rsaz-x86_64.s @@ -461,48 +461,94 @@ _rsaz_512_mul_gather4: pushq %r14 pushq %r15 - movl %r9d,%r9d - subq $128+24,%rsp + subq $152,%rsp L$mul_gather4_body: - movl 64(%rdx,%r9,4),%eax -.byte 102,72,15,110,199 - movl (%rdx,%r9,4),%ebx -.byte 102,72,15,110,201 + movd %r9d,%xmm8 + movdqa L$inc+16(%rip),%xmm1 + movdqa L$inc(%rip),%xmm0 + + pshufd $0,%xmm8,%xmm8 + movdqa %xmm1,%xmm7 + movdqa %xmm1,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm8,%xmm0 + movdqa %xmm7,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm8,%xmm1 + movdqa %xmm7,%xmm4 + paddd %xmm2,%xmm3 + pcmpeqd %xmm8,%xmm2 + movdqa %xmm7,%xmm5 + paddd %xmm3,%xmm4 + pcmpeqd %xmm8,%xmm3 + movdqa %xmm7,%xmm6 + paddd %xmm4,%xmm5 + pcmpeqd %xmm8,%xmm4 + paddd %xmm5,%xmm6 + pcmpeqd %xmm8,%xmm5 + paddd %xmm6,%xmm7 + pcmpeqd %xmm8,%xmm6 + pcmpeqd %xmm8,%xmm7 + + movdqa 0(%rdx),%xmm8 + movdqa 16(%rdx),%xmm9 + movdqa 32(%rdx),%xmm10 + movdqa 48(%rdx),%xmm11 + pand %xmm0,%xmm8 + movdqa 64(%rdx),%xmm12 + pand %xmm1,%xmm9 + movdqa 80(%rdx),%xmm13 + pand %xmm2,%xmm10 + movdqa 96(%rdx),%xmm14 + pand %xmm3,%xmm11 + movdqa 112(%rdx),%xmm15 + leaq 128(%rdx),%rbp + pand %xmm4,%xmm12 + pand %xmm5,%xmm13 + pand %xmm6,%xmm14 + pand %xmm7,%xmm15 + por %xmm10,%xmm8 + por %xmm11,%xmm9 + por %xmm12,%xmm8 + por %xmm13,%xmm9 + por %xmm14,%xmm8 + por %xmm15,%xmm9 + + por %xmm9,%xmm8 + pshufd $0x4e,%xmm8,%xmm9 + por %xmm9,%xmm8 +.byte 102,76,15,126,195 + movq %r8,128(%rsp) + movq %rdi,128+8(%rsp) + movq %rcx,128+16(%rsp) - shlq $32,%rax - orq %rax,%rbx movq (%rsi),%rax movq 8(%rsi),%rcx - leaq 128(%rdx,%r9,4),%rbp mulq %rbx movq %rax,(%rsp) movq %rcx,%rax movq %rdx,%r8 mulq %rbx - movd (%rbp),%xmm4 addq %rax,%r8 movq 16(%rsi),%rax movq %rdx,%r9 adcq $0,%r9 mulq %rbx - movd 64(%rbp),%xmm5 addq %rax,%r9 movq 24(%rsi),%rax movq %rdx,%r10 adcq $0,%r10 mulq %rbx - pslldq $4,%xmm5 addq %rax,%r10 movq 32(%rsi),%rax movq %rdx,%r11 adcq $0,%r11 mulq %rbx - por %xmm5,%xmm4 addq %rax,%r11 movq 40(%rsi),%rax movq %rdx,%r12 @@ -515,14 +561,12 @@ L$mul_gather4_body: adcq $0,%r13 mulq %rbx - leaq 128(%rbp),%rbp addq %rax,%r13 movq 56(%rsi),%rax movq %rdx,%r14 adcq $0,%r14 mulq %rbx -.byte 102,72,15,126,227 addq %rax,%r14 movq (%rsi),%rax movq %rdx,%r15 @@ -534,6 +578,35 @@ L$mul_gather4_body: .p2align 5 L$oop_mul_gather: + movdqa 0(%rbp),%xmm8 + movdqa 16(%rbp),%xmm9 + movdqa 32(%rbp),%xmm10 + movdqa 48(%rbp),%xmm11 + pand %xmm0,%xmm8 + movdqa 64(%rbp),%xmm12 + pand %xmm1,%xmm9 + movdqa 80(%rbp),%xmm13 + pand %xmm2,%xmm10 + movdqa 96(%rbp),%xmm14 + pand %xmm3,%xmm11 + movdqa 112(%rbp),%xmm15 + leaq 128(%rbp),%rbp + pand %xmm4,%xmm12 + pand %xmm5,%xmm13 + pand %xmm6,%xmm14 + pand %xmm7,%xmm15 + por %xmm10,%xmm8 + por %xmm11,%xmm9 + por %xmm12,%xmm8 + por %xmm13,%xmm9 + por %xmm14,%xmm8 + por %xmm15,%xmm9 + + por %xmm9,%xmm8 + pshufd $0x4e,%xmm8,%xmm9 + por %xmm9,%xmm8 +.byte 102,76,15,126,195 + mulq %rbx addq %rax,%r8 movq 8(%rsi),%rax @@ -542,7 +615,6 @@ L$oop_mul_gather: adcq $0,%r8 mulq %rbx - movd (%rbp),%xmm4 addq %rax,%r9 movq 16(%rsi),%rax adcq $0,%rdx @@ -551,7 +623,6 @@ L$oop_mul_gather: adcq $0,%r9 mulq %rbx - movd 64(%rbp),%xmm5 addq %rax,%r10 movq 24(%rsi),%rax adcq $0,%rdx @@ -560,7 +631,6 @@ L$oop_mul_gather: adcq $0,%r10 mulq %rbx - pslldq $4,%xmm5 addq %rax,%r11 movq 32(%rsi),%rax adcq $0,%rdx @@ -569,7 +639,6 @@ L$oop_mul_gather: adcq $0,%r11 mulq %rbx - por %xmm5,%xmm4 addq %rax,%r12 movq 40(%rsi),%rax adcq $0,%rdx @@ -594,7 +663,6 @@ L$oop_mul_gather: adcq $0,%r14 mulq %rbx -.byte 102,72,15,126,227 addq %rax,%r15 movq (%rsi),%rax adcq $0,%rdx @@ -602,7 +670,6 @@ L$oop_mul_gather: movq %rdx,%r15 adcq $0,%r15 - leaq 128(%rbp),%rbp leaq 8(%rdi),%rdi decl %ecx @@ -617,8 +684,8 @@ L$oop_mul_gather: movq %r14,48(%rdi) movq %r15,56(%rdi) -.byte 102,72,15,126,199 -.byte 102,72,15,126,205 + movq 128+8(%rsp),%rdi + movq 128+16(%rsp),%rbp movq (%rsp),%r8 movq 8(%rsp),%r9 @@ -667,7 +734,7 @@ _rsaz_512_mul_scatter4: movl %r9d,%r9d subq $128+24,%rsp L$mul_scatter4_body: - leaq (%r8,%r9,4),%r8 + leaq (%r8,%r9,8),%r8 .byte 102,72,15,110,199 .byte 102,72,15,110,202 .byte 102,73,15,110,208 @@ -703,30 +770,14 @@ L$mul_scatter4_body: call __rsaz_512_subtract - movl %r8d,0(%rsi) - shrq $32,%r8 - movl %r9d,128(%rsi) - shrq $32,%r9 - movl %r10d,256(%rsi) - shrq $32,%r10 - movl %r11d,384(%rsi) - shrq $32,%r11 - movl %r12d,512(%rsi) - shrq $32,%r12 - movl %r13d,640(%rsi) - shrq $32,%r13 - movl %r14d,768(%rsi) - shrq $32,%r14 - movl %r15d,896(%rsi) - shrq $32,%r15 - movl %r8d,64(%rsi) - movl %r9d,192(%rsi) - movl %r10d,320(%rsi) - movl %r11d,448(%rsi) - movl %r12d,576(%rsi) - movl %r13d,704(%rsi) - movl %r14d,832(%rsi) - movl %r15d,960(%rsi) + movq %r8,0(%rsi) + movq %r9,128(%rsi) + movq %r10,256(%rsi) + movq %r11,384(%rsi) + movq %r12,512(%rsi) + movq %r13,640(%rsi) + movq %r14,768(%rsi) + movq %r15,896(%rsi) leaq 128+24+48(%rsp),%rax movq -48(%rax),%r15 @@ -1079,16 +1130,14 @@ L$oop_mul: .p2align 4 _rsaz_512_scatter4: - leaq (%rdi,%rdx,4),%rdi + leaq (%rdi,%rdx,8),%rdi movl $8,%r9d jmp L$oop_scatter .p2align 4 L$oop_scatter: movq (%rsi),%rax leaq 8(%rsi),%rsi - movl %eax,(%rdi) - shrq $32,%rax - movl %eax,64(%rdi) + movq %rax,(%rdi) leaq 128(%rdi),%rdi decl %r9d jnz L$oop_scatter @@ -1099,18 +1148,72 @@ L$oop_scatter: .p2align 4 _rsaz_512_gather4: - leaq (%rsi,%rdx,4),%rsi + movd %edx,%xmm8 + movdqa L$inc+16(%rip),%xmm1 + movdqa L$inc(%rip),%xmm0 + + pshufd $0,%xmm8,%xmm8 + movdqa %xmm1,%xmm7 + movdqa %xmm1,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm8,%xmm0 + movdqa %xmm7,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm8,%xmm1 + movdqa %xmm7,%xmm4 + paddd %xmm2,%xmm3 + pcmpeqd %xmm8,%xmm2 + movdqa %xmm7,%xmm5 + paddd %xmm3,%xmm4 + pcmpeqd %xmm8,%xmm3 + movdqa %xmm7,%xmm6 + paddd %xmm4,%xmm5 + pcmpeqd %xmm8,%xmm4 + paddd %xmm5,%xmm6 + pcmpeqd %xmm8,%xmm5 + paddd %xmm6,%xmm7 + pcmpeqd %xmm8,%xmm6 + pcmpeqd %xmm8,%xmm7 movl $8,%r9d jmp L$oop_gather .p2align 4 L$oop_gather: - movl (%rsi),%eax - movl 64(%rsi),%r8d + movdqa 0(%rsi),%xmm8 + movdqa 16(%rsi),%xmm9 + movdqa 32(%rsi),%xmm10 + movdqa 48(%rsi),%xmm11 + pand %xmm0,%xmm8 + movdqa 64(%rsi),%xmm12 + pand %xmm1,%xmm9 + movdqa 80(%rsi),%xmm13 + pand %xmm2,%xmm10 + movdqa 96(%rsi),%xmm14 + pand %xmm3,%xmm11 + movdqa 112(%rsi),%xmm15 leaq 128(%rsi),%rsi - shlq $32,%r8 - orq %r8,%rax - movq %rax,(%rdi) + pand %xmm4,%xmm12 + pand %xmm5,%xmm13 + pand %xmm6,%xmm14 + pand %xmm7,%xmm15 + por %xmm10,%xmm8 + por %xmm11,%xmm9 + por %xmm12,%xmm8 + por %xmm13,%xmm9 + por %xmm14,%xmm8 + por %xmm15,%xmm9 + + por %xmm9,%xmm8 + pshufd $0x4e,%xmm8,%xmm9 + por %xmm9,%xmm8 + movq %xmm8,(%rdi) leaq 8(%rdi),%rdi decl %r9d jnz L$oop_gather .byte 0xf3,0xc3 +L$SEH_end_rsaz_512_gather4: + + +.p2align 6 +L$inc: +.long 0,0, 1,1 +.long 2,2, 2,2 diff --git a/deps/openssl/asm_obsolete/x64-macosx-gas/bn/x86_64-gf2m.s b/deps/openssl/asm_obsolete/x64-macosx-gas/bn/x86_64-gf2m.s index 040c324c49a753..c0f0b4bd6878b8 100644 --- a/deps/openssl/asm_obsolete/x64-macosx-gas/bn/x86_64-gf2m.s +++ b/deps/openssl/asm_obsolete/x64-macosx-gas/bn/x86_64-gf2m.s @@ -242,7 +242,7 @@ L$body_mul_2x2: movq %rcx,56(%rsp) movq %r8,64(%rsp) - movq $15,%r8 + movq $0xf,%r8 movq %rsi,%rax movq %rcx,%rbp call _mul_1x1 diff --git a/deps/openssl/asm_obsolete/x64-macosx-gas/bn/x86_64-mont.s b/deps/openssl/asm_obsolete/x64-macosx-gas/bn/x86_64-mont.s index 2ed1c0ff4233de..9b49555a4d2132 100644 --- a/deps/openssl/asm_obsolete/x64-macosx-gas/bn/x86_64-mont.s +++ b/deps/openssl/asm_obsolete/x64-macosx-gas/bn/x86_64-mont.s @@ -633,20 +633,20 @@ L$sqr8x_enter: - leaq -64(%rsp,%r9,4),%r11 + leaq -64(%rsp,%r9,2),%r11 movq (%r8),%r8 subq %rsi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb L$sqr8x_sp_alt subq %r11,%rsp - leaq -64(%rsp,%r9,4),%rsp + leaq -64(%rsp,%r9,2),%rsp jmp L$sqr8x_sp_done .p2align 5 L$sqr8x_sp_alt: - leaq 4096-64(,%r9,4),%r10 - leaq -64(%rsp,%r9,4),%rsp + leaq 4096-64(,%r9,2),%r10 + leaq -64(%rsp,%r9,2),%rsp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 @@ -656,58 +656,80 @@ L$sqr8x_sp_done: movq %r9,%r10 negq %r9 - leaq 64(%rsp,%r9,2),%r11 movq %r8,32(%rsp) movq %rax,40(%rsp) L$sqr8x_body: - movq %r9,%rbp -.byte 102,73,15,110,211 - shrq $3+2,%rbp - movl _OPENSSL_ia32cap_P+8(%rip),%eax - jmp L$sqr8x_copy_n - -.p2align 5 -L$sqr8x_copy_n: - movq 0(%rcx),%xmm0 - movq 8(%rcx),%xmm1 - movq 16(%rcx),%xmm3 - movq 24(%rcx),%xmm4 - leaq 32(%rcx),%rcx - movdqa %xmm0,0(%r11) - movdqa %xmm1,16(%r11) - movdqa %xmm3,32(%r11) - movdqa %xmm4,48(%r11) - leaq 64(%r11),%r11 - decq %rbp - jnz L$sqr8x_copy_n - +.byte 102,72,15,110,209 pxor %xmm0,%xmm0 .byte 102,72,15,110,207 .byte 102,73,15,110,218 call _bn_sqr8x_internal + + + + leaq (%rdi,%r9,1),%rbx + movq %r9,%rcx + movq %r9,%rdx +.byte 102,72,15,126,207 + sarq $3+2,%rcx + jmp L$sqr8x_sub + +.p2align 5 +L$sqr8x_sub: + movq 0(%rbx),%r12 + movq 8(%rbx),%r13 + movq 16(%rbx),%r14 + movq 24(%rbx),%r15 + leaq 32(%rbx),%rbx + sbbq 0(%rbp),%r12 + sbbq 8(%rbp),%r13 + sbbq 16(%rbp),%r14 + sbbq 24(%rbp),%r15 + leaq 32(%rbp),%rbp + movq %r12,0(%rdi) + movq %r13,8(%rdi) + movq %r14,16(%rdi) + movq %r15,24(%rdi) + leaq 32(%rdi),%rdi + incq %rcx + jnz L$sqr8x_sub + + sbbq $0,%rax + leaq (%rbx,%r9,1),%rbx + leaq (%rdi,%r9,1),%rdi + +.byte 102,72,15,110,200 pxor %xmm0,%xmm0 - leaq 48(%rsp),%rax - leaq 64(%rsp,%r9,2),%rdx - shrq $3+2,%r9 + pshufd $0,%xmm1,%xmm1 movq 40(%rsp),%rsi - jmp L$sqr8x_zero + jmp L$sqr8x_cond_copy .p2align 5 -L$sqr8x_zero: - movdqa %xmm0,0(%rax) - movdqa %xmm0,16(%rax) - movdqa %xmm0,32(%rax) - movdqa %xmm0,48(%rax) - leaq 64(%rax),%rax - movdqa %xmm0,0(%rdx) - movdqa %xmm0,16(%rdx) - movdqa %xmm0,32(%rdx) - movdqa %xmm0,48(%rdx) - leaq 64(%rdx),%rdx - decq %r9 - jnz L$sqr8x_zero +L$sqr8x_cond_copy: + movdqa 0(%rbx),%xmm2 + movdqa 16(%rbx),%xmm3 + leaq 32(%rbx),%rbx + movdqu 0(%rdi),%xmm4 + movdqu 16(%rdi),%xmm5 + leaq 32(%rdi),%rdi + movdqa %xmm0,-32(%rbx) + movdqa %xmm0,-16(%rbx) + movdqa %xmm0,-32(%rbx,%rdx,1) + movdqa %xmm0,-16(%rbx,%rdx,1) + pcmpeqd %xmm1,%xmm0 + pand %xmm1,%xmm2 + pand %xmm1,%xmm3 + pand %xmm0,%xmm4 + pand %xmm0,%xmm5 + pxor %xmm0,%xmm0 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqu %xmm4,-32(%rdi) + movdqu %xmm5,-16(%rdi) + addq $32,%r9 + jnz L$sqr8x_cond_copy movq $1,%rax movq -48(%rsi),%r15 diff --git a/deps/openssl/asm_obsolete/x64-macosx-gas/bn/x86_64-mont5.s b/deps/openssl/asm_obsolete/x64-macosx-gas/bn/x86_64-mont5.s index 049bf06473ae02..c9731e162da51e 100644 --- a/deps/openssl/asm_obsolete/x64-macosx-gas/bn/x86_64-mont5.s +++ b/deps/openssl/asm_obsolete/x64-macosx-gas/bn/x86_64-mont5.s @@ -14,46 +14,151 @@ _bn_mul_mont_gather5: L$mul_enter: movl %r9d,%r9d movq %rsp,%rax - movl 8(%rsp),%r10d + movd 8(%rsp),%xmm5 + leaq L$inc(%rip),%r10 pushq %rbx pushq %rbp pushq %r12 pushq %r13 pushq %r14 pushq %r15 + leaq 2(%r9),%r11 negq %r11 - leaq (%rsp,%r11,8),%rsp + leaq -264(%rsp,%r11,8),%rsp andq $-1024,%rsp movq %rax,8(%rsp,%r9,8) L$mul_body: - movq %rdx,%r12 - movq %r10,%r11 - shrq $3,%r10 - andq $7,%r11 - notq %r10 - leaq L$magic_masks(%rip),%rax - andq $3,%r10 - leaq 96(%r12,%r11,8),%r12 - movq 0(%rax,%r10,8),%xmm4 - movq 8(%rax,%r10,8),%xmm5 - movq 16(%rax,%r10,8),%xmm6 - movq 24(%rax,%r10,8),%xmm7 - - movq -96(%r12),%xmm0 - movq -32(%r12),%xmm1 - pand %xmm4,%xmm0 - movq 32(%r12),%xmm2 - pand %xmm5,%xmm1 - movq 96(%r12),%xmm3 - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 + leaq 128(%rdx),%r12 + movdqa 0(%r10),%xmm0 + movdqa 16(%r10),%xmm1 + leaq 24-112(%rsp,%r9,8),%r10 + andq $-16,%r10 + + pshufd $0,%xmm5,%xmm5 + movdqa %xmm1,%xmm4 + movdqa %xmm1,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 +.byte 0x67 + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,112(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,128(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,144(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,160(%r10) + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,176(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,192(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,208(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,224(%r10) + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,240(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,256(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,272(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,288(%r10) + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,304(%r10) + + paddd %xmm2,%xmm3 +.byte 0x67 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,320(%r10) + + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,336(%r10) + pand 64(%r12),%xmm0 + + pand 80(%r12),%xmm1 + pand 96(%r12),%xmm2 + movdqa %xmm3,352(%r10) + pand 112(%r12),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + movdqa -128(%r12),%xmm4 + movdqa -112(%r12),%xmm5 + movdqa -96(%r12),%xmm2 + pand 112(%r10),%xmm4 + movdqa -80(%r12),%xmm3 + pand 128(%r10),%xmm5 + por %xmm4,%xmm0 + pand 144(%r10),%xmm2 + por %xmm5,%xmm1 + pand 160(%r10),%xmm3 por %xmm2,%xmm0 + por %xmm3,%xmm1 + movdqa -64(%r12),%xmm4 + movdqa -48(%r12),%xmm5 + movdqa -32(%r12),%xmm2 + pand 176(%r10),%xmm4 + movdqa -16(%r12),%xmm3 + pand 192(%r10),%xmm5 + por %xmm4,%xmm0 + pand 208(%r10),%xmm2 + por %xmm5,%xmm1 + pand 224(%r10),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + movdqa 0(%r12),%xmm4 + movdqa 16(%r12),%xmm5 + movdqa 32(%r12),%xmm2 + pand 240(%r10),%xmm4 + movdqa 48(%r12),%xmm3 + pand 256(%r10),%xmm5 + por %xmm4,%xmm0 + pand 272(%r10),%xmm2 + por %xmm5,%xmm1 + pand 288(%r10),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + por %xmm1,%xmm0 + pshufd $0x4e,%xmm0,%xmm1 + por %xmm1,%xmm0 leaq 256(%r12),%r12 - por %xmm3,%xmm0 - .byte 102,72,15,126,195 movq (%r8),%r8 @@ -62,29 +167,14 @@ L$mul_body: xorq %r14,%r14 xorq %r15,%r15 - movq -96(%r12),%xmm0 - movq -32(%r12),%xmm1 - pand %xmm4,%xmm0 - movq 32(%r12),%xmm2 - pand %xmm5,%xmm1 - movq %r8,%rbp mulq %rbx movq %rax,%r10 movq (%rcx),%rax - movq 96(%r12),%xmm3 - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 - imulq %r10,%rbp movq %rdx,%r11 - por %xmm2,%xmm0 - leaq 256(%r12),%r12 - por %xmm3,%xmm0 - mulq %rbp addq %rax,%r10 movq 8(%rsi),%rax @@ -117,14 +207,12 @@ L$1st_enter: cmpq %r9,%r15 jne L$1st -.byte 102,72,15,126,195 addq %rax,%r13 - movq (%rsi),%rax adcq $0,%rdx addq %r11,%r13 adcq $0,%rdx - movq %r13,-16(%rsp,%r15,8) + movq %r13,-16(%rsp,%r9,8) movq %rdx,%r13 movq %r10,%r11 @@ -138,33 +226,78 @@ L$1st_enter: jmp L$outer .p2align 4 L$outer: + leaq 24+128(%rsp,%r9,8),%rdx + andq $-16,%rdx + pxor %xmm4,%xmm4 + pxor %xmm5,%xmm5 + movdqa -128(%r12),%xmm0 + movdqa -112(%r12),%xmm1 + movdqa -96(%r12),%xmm2 + movdqa -80(%r12),%xmm3 + pand -128(%rdx),%xmm0 + pand -112(%rdx),%xmm1 + por %xmm0,%xmm4 + pand -96(%rdx),%xmm2 + por %xmm1,%xmm5 + pand -80(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa -64(%r12),%xmm0 + movdqa -48(%r12),%xmm1 + movdqa -32(%r12),%xmm2 + movdqa -16(%r12),%xmm3 + pand -64(%rdx),%xmm0 + pand -48(%rdx),%xmm1 + por %xmm0,%xmm4 + pand -32(%rdx),%xmm2 + por %xmm1,%xmm5 + pand -16(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa 0(%r12),%xmm0 + movdqa 16(%r12),%xmm1 + movdqa 32(%r12),%xmm2 + movdqa 48(%r12),%xmm3 + pand 0(%rdx),%xmm0 + pand 16(%rdx),%xmm1 + por %xmm0,%xmm4 + pand 32(%rdx),%xmm2 + por %xmm1,%xmm5 + pand 48(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa 64(%r12),%xmm0 + movdqa 80(%r12),%xmm1 + movdqa 96(%r12),%xmm2 + movdqa 112(%r12),%xmm3 + pand 64(%rdx),%xmm0 + pand 80(%rdx),%xmm1 + por %xmm0,%xmm4 + pand 96(%rdx),%xmm2 + por %xmm1,%xmm5 + pand 112(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + por %xmm5,%xmm4 + pshufd $0x4e,%xmm4,%xmm0 + por %xmm4,%xmm0 + leaq 256(%r12),%r12 + + movq (%rsi),%rax +.byte 102,72,15,126,195 + xorq %r15,%r15 movq %r8,%rbp movq (%rsp),%r10 - movq -96(%r12),%xmm0 - movq -32(%r12),%xmm1 - pand %xmm4,%xmm0 - movq 32(%r12),%xmm2 - pand %xmm5,%xmm1 - mulq %rbx addq %rax,%r10 movq (%rcx),%rax adcq $0,%rdx - movq 96(%r12),%xmm3 - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 - imulq %r10,%rbp movq %rdx,%r11 - por %xmm2,%xmm0 - leaq 256(%r12),%r12 - por %xmm3,%xmm0 - mulq %rbp addq %rax,%r10 movq 8(%rsi),%rax @@ -200,15 +333,12 @@ L$inner_enter: cmpq %r9,%r15 jne L$inner -.byte 102,72,15,126,195 - addq %rax,%r13 - movq (%rsi),%rax adcq $0,%rdx addq %r10,%r13 - movq (%rsp,%r15,8),%r10 + movq (%rsp,%r9,8),%r10 adcq $0,%rdx - movq %r13,-16(%rsp,%r15,8) + movq %r13,-16(%rsp,%r9,8) movq %rdx,%r13 xorq %rdx,%rdx @@ -255,6 +385,7 @@ L$copy: movq 8(%rsp,%r9,8),%rsi movq $1,%rax + movq -48(%rsi),%r15 movq -40(%rsi),%r14 movq -32(%rsi),%r13 @@ -277,10 +408,10 @@ L$mul4x_enter: pushq %r13 pushq %r14 pushq %r15 + .byte 0x67 - movl %r9d,%r10d shll $3,%r9d - shll $3+2,%r10d + leaq (%r9,%r9,2),%r10 negq %r9 @@ -290,19 +421,21 @@ L$mul4x_enter: - leaq -64(%rsp,%r9,2),%r11 - subq %rsi,%r11 + + + leaq -320(%rsp,%r9,2),%r11 + subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb L$mul4xsp_alt subq %r11,%rsp - leaq -64(%rsp,%r9,2),%rsp + leaq -320(%rsp,%r9,2),%rsp jmp L$mul4xsp_done .p2align 5 L$mul4xsp_alt: - leaq 4096-64(,%r9,2),%r10 - leaq -64(%rsp,%r9,2),%rsp + leaq 4096-320(,%r9,2),%r10 + leaq -320(%rsp,%r9,2),%rsp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 @@ -318,6 +451,7 @@ L$mul4x_body: movq 40(%rsp),%rsi movq $1,%rax + movq -48(%rsi),%r15 movq -40(%rsi),%r14 movq -32(%rsi),%r13 @@ -333,47 +467,141 @@ L$mul4x_epilogue: .p2align 5 mul4x_internal: shlq $5,%r9 - movl 8(%rax),%r10d - leaq 256(%rdx,%r9,1),%r13 + movd 8(%rax),%xmm5 + leaq L$inc(%rip),%rax + leaq 128(%rdx,%r9,1),%r13 shrq $5,%r9 - movq %r10,%r11 - shrq $3,%r10 - andq $7,%r11 - notq %r10 - leaq L$magic_masks(%rip),%rax - andq $3,%r10 - leaq 96(%rdx,%r11,8),%r12 - movq 0(%rax,%r10,8),%xmm4 - movq 8(%rax,%r10,8),%xmm5 - addq $7,%r11 - movq 16(%rax,%r10,8),%xmm6 - movq 24(%rax,%r10,8),%xmm7 - andq $7,%r11 - - movq -96(%r12),%xmm0 - leaq 256(%r12),%r14 - movq -32(%r12),%xmm1 - pand %xmm4,%xmm0 - movq 32(%r12),%xmm2 - pand %xmm5,%xmm1 - movq 96(%r12),%xmm3 - pand %xmm6,%xmm2 -.byte 0x67 - por %xmm1,%xmm0 - movq -96(%r14),%xmm1 -.byte 0x67 - pand %xmm7,%xmm3 -.byte 0x67 - por %xmm2,%xmm0 - movq -32(%r14),%xmm2 + movdqa 0(%rax),%xmm0 + movdqa 16(%rax),%xmm1 + leaq 88-112(%rsp,%r9,1),%r10 + leaq 128(%rdx),%r12 + + pshufd $0,%xmm5,%xmm5 + movdqa %xmm1,%xmm4 +.byte 0x67,0x67 + movdqa %xmm1,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 .byte 0x67 - pand %xmm4,%xmm1 + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,112(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,128(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,144(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,160(%r10) + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,176(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,192(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,208(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,224(%r10) + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,240(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,256(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,272(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,288(%r10) + movdqa %xmm4,%xmm3 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,304(%r10) + + paddd %xmm2,%xmm3 .byte 0x67 - por %xmm3,%xmm0 - movq 32(%r14),%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,320(%r10) + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,336(%r10) + pand 64(%r12),%xmm0 + + pand 80(%r12),%xmm1 + pand 96(%r12),%xmm2 + movdqa %xmm3,352(%r10) + pand 112(%r12),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + movdqa -128(%r12),%xmm4 + movdqa -112(%r12),%xmm5 + movdqa -96(%r12),%xmm2 + pand 112(%r10),%xmm4 + movdqa -80(%r12),%xmm3 + pand 128(%r10),%xmm5 + por %xmm4,%xmm0 + pand 144(%r10),%xmm2 + por %xmm5,%xmm1 + pand 160(%r10),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + movdqa -64(%r12),%xmm4 + movdqa -48(%r12),%xmm5 + movdqa -32(%r12),%xmm2 + pand 176(%r10),%xmm4 + movdqa -16(%r12),%xmm3 + pand 192(%r10),%xmm5 + por %xmm4,%xmm0 + pand 208(%r10),%xmm2 + por %xmm5,%xmm1 + pand 224(%r10),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + movdqa 0(%r12),%xmm4 + movdqa 16(%r12),%xmm5 + movdqa 32(%r12),%xmm2 + pand 240(%r10),%xmm4 + movdqa 48(%r12),%xmm3 + pand 256(%r10),%xmm5 + por %xmm4,%xmm0 + pand 272(%r10),%xmm2 + por %xmm5,%xmm1 + pand 288(%r10),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 + por %xmm1,%xmm0 + pshufd $0x4e,%xmm0,%xmm1 + por %xmm1,%xmm0 + leaq 256(%r12),%r12 .byte 102,72,15,126,195 - movq 96(%r14),%xmm0 + movq %r13,16+8(%rsp) movq %rdi,56+8(%rsp) @@ -387,26 +615,10 @@ mul4x_internal: movq %rax,%r10 movq (%rcx),%rax - pand %xmm5,%xmm2 - pand %xmm6,%xmm3 - por %xmm2,%xmm1 - imulq %r10,%rbp - - - - - - - - leaq 64+8(%rsp,%r11,8),%r14 + leaq 64+8(%rsp),%r14 movq %rdx,%r11 - pand %xmm7,%xmm0 - por %xmm3,%xmm1 - leaq 512(%r12),%r12 - por %xmm1,%xmm0 - mulq %rbp addq %rax,%r10 movq 8(%rsi,%r9,1),%rax @@ -415,7 +627,7 @@ mul4x_internal: mulq %rbx addq %rax,%r11 - movq 16(%rcx),%rax + movq 8(%rcx),%rax adcq $0,%rdx movq %rdx,%r10 @@ -425,7 +637,7 @@ mul4x_internal: adcq $0,%rdx addq %r11,%rdi leaq 32(%r9),%r15 - leaq 64(%rcx),%rcx + leaq 32(%rcx),%rcx adcq $0,%rdx movq %rdi,(%r14) movq %rdx,%r13 @@ -435,7 +647,7 @@ mul4x_internal: L$1st4x: mulq %rbx addq %rax,%r10 - movq -32(%rcx),%rax + movq -16(%rcx),%rax leaq 32(%r14),%r14 adcq $0,%rdx movq %rdx,%r11 @@ -451,7 +663,7 @@ L$1st4x: mulq %rbx addq %rax,%r11 - movq -16(%rcx),%rax + movq -8(%rcx),%rax adcq $0,%rdx movq %rdx,%r10 @@ -481,7 +693,7 @@ L$1st4x: mulq %rbx addq %rax,%r11 - movq 16(%rcx),%rax + movq 8(%rcx),%rax adcq $0,%rdx movq %rdx,%r10 @@ -490,7 +702,7 @@ L$1st4x: movq 16(%rsi,%r15,1),%rax adcq $0,%rdx addq %r11,%rdi - leaq 64(%rcx),%rcx + leaq 32(%rcx),%rcx adcq $0,%rdx movq %rdi,(%r14) movq %rdx,%r13 @@ -500,7 +712,7 @@ L$1st4x: mulq %rbx addq %rax,%r10 - movq -32(%rcx),%rax + movq -16(%rcx),%rax leaq 32(%r14),%r14 adcq $0,%rdx movq %rdx,%r11 @@ -516,7 +728,7 @@ L$1st4x: mulq %rbx addq %rax,%r11 - movq -16(%rcx),%rax + movq -8(%rcx),%rax adcq $0,%rdx movq %rdx,%r10 @@ -529,8 +741,7 @@ L$1st4x: movq %rdi,-16(%r14) movq %rdx,%r13 -.byte 102,72,15,126,195 - leaq (%rcx,%r9,2),%rcx + leaq (%rcx,%r9,1),%rcx xorq %rdi,%rdi addq %r10,%r13 @@ -541,6 +752,63 @@ L$1st4x: .p2align 5 L$outer4x: + leaq 16+128(%r14),%rdx + pxor %xmm4,%xmm4 + pxor %xmm5,%xmm5 + movdqa -128(%r12),%xmm0 + movdqa -112(%r12),%xmm1 + movdqa -96(%r12),%xmm2 + movdqa -80(%r12),%xmm3 + pand -128(%rdx),%xmm0 + pand -112(%rdx),%xmm1 + por %xmm0,%xmm4 + pand -96(%rdx),%xmm2 + por %xmm1,%xmm5 + pand -80(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa -64(%r12),%xmm0 + movdqa -48(%r12),%xmm1 + movdqa -32(%r12),%xmm2 + movdqa -16(%r12),%xmm3 + pand -64(%rdx),%xmm0 + pand -48(%rdx),%xmm1 + por %xmm0,%xmm4 + pand -32(%rdx),%xmm2 + por %xmm1,%xmm5 + pand -16(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa 0(%r12),%xmm0 + movdqa 16(%r12),%xmm1 + movdqa 32(%r12),%xmm2 + movdqa 48(%r12),%xmm3 + pand 0(%rdx),%xmm0 + pand 16(%rdx),%xmm1 + por %xmm0,%xmm4 + pand 32(%rdx),%xmm2 + por %xmm1,%xmm5 + pand 48(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa 64(%r12),%xmm0 + movdqa 80(%r12),%xmm1 + movdqa 96(%r12),%xmm2 + movdqa 112(%r12),%xmm3 + pand 64(%rdx),%xmm0 + pand 80(%rdx),%xmm1 + por %xmm0,%xmm4 + pand 96(%rdx),%xmm2 + por %xmm1,%xmm5 + pand 112(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + por %xmm5,%xmm4 + pshufd $0x4e,%xmm4,%xmm0 + por %xmm4,%xmm0 + leaq 256(%r12),%r12 +.byte 102,72,15,126,195 + movq (%r14,%r9,1),%r10 movq %r8,%rbp mulq %rbx @@ -548,25 +816,11 @@ L$outer4x: movq (%rcx),%rax adcq $0,%rdx - movq -96(%r12),%xmm0 - movq -32(%r12),%xmm1 - pand %xmm4,%xmm0 - movq 32(%r12),%xmm2 - pand %xmm5,%xmm1 - movq 96(%r12),%xmm3 - imulq %r10,%rbp -.byte 0x67 movq %rdx,%r11 movq %rdi,(%r14) - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 - por %xmm2,%xmm0 leaq (%r14,%r9,1),%r14 - leaq 256(%r12),%r12 - por %xmm3,%xmm0 mulq %rbp addq %rax,%r10 @@ -576,7 +830,7 @@ L$outer4x: mulq %rbx addq %rax,%r11 - movq 16(%rcx),%rax + movq 8(%rcx),%rax adcq $0,%rdx addq 8(%r14),%r11 adcq $0,%rdx @@ -588,7 +842,7 @@ L$outer4x: adcq $0,%rdx addq %r11,%rdi leaq 32(%r9),%r15 - leaq 64(%rcx),%rcx + leaq 32(%rcx),%rcx adcq $0,%rdx movq %rdx,%r13 jmp L$inner4x @@ -597,7 +851,7 @@ L$outer4x: L$inner4x: mulq %rbx addq %rax,%r10 - movq -32(%rcx),%rax + movq -16(%rcx),%rax adcq $0,%rdx addq 16(%r14),%r10 leaq 32(%r14),%r14 @@ -615,7 +869,7 @@ L$inner4x: mulq %rbx addq %rax,%r11 - movq -16(%rcx),%rax + movq -8(%rcx),%rax adcq $0,%rdx addq -8(%r14),%r11 adcq $0,%rdx @@ -649,7 +903,7 @@ L$inner4x: mulq %rbx addq %rax,%r11 - movq 16(%rcx),%rax + movq 8(%rcx),%rax adcq $0,%rdx addq 8(%r14),%r11 adcq $0,%rdx @@ -660,7 +914,7 @@ L$inner4x: movq 16(%rsi,%r15,1),%rax adcq $0,%rdx addq %r11,%rdi - leaq 64(%rcx),%rcx + leaq 32(%rcx),%rcx adcq $0,%rdx movq %r13,-8(%r14) movq %rdx,%r13 @@ -670,7 +924,7 @@ L$inner4x: mulq %rbx addq %rax,%r10 - movq -32(%rcx),%rax + movq -16(%rcx),%rax adcq $0,%rdx addq 16(%r14),%r10 leaq 32(%r14),%r14 @@ -689,7 +943,7 @@ L$inner4x: mulq %rbx addq %rax,%r11 movq %rbp,%rax - movq -16(%rcx),%rbp + movq -8(%rcx),%rbp adcq $0,%rdx addq -8(%r14),%r11 adcq $0,%rdx @@ -704,9 +958,8 @@ L$inner4x: movq %r13,-24(%r14) movq %rdx,%r13 -.byte 102,72,15,126,195 movq %rdi,-16(%r14) - leaq (%rcx,%r9,2),%rcx + leaq (%rcx,%r9,1),%rcx xorq %rdi,%rdi addq %r10,%r13 @@ -717,16 +970,23 @@ L$inner4x: cmpq 16+8(%rsp),%r12 jb L$outer4x + xorq %rax,%rax subq %r13,%rbp adcq %r15,%r15 orq %r15,%rdi - xorq $1,%rdi + subq %rdi,%rax leaq (%r14,%r9,1),%rbx - leaq (%rcx,%rdi,8),%rbp + movq (%rcx),%r12 + leaq (%rcx),%rbp movq %r9,%rcx sarq $3+2,%rcx movq 56+8(%rsp),%rdi - jmp L$sqr4x_sub + decq %r12 + xorq %r10,%r10 + movq 8(%rbp),%r13 + movq 16(%rbp),%r14 + movq 24(%rbp),%r15 + jmp L$sqr4x_sub_entry .globl _bn_power5 @@ -739,9 +999,9 @@ _bn_power5: pushq %r13 pushq %r14 pushq %r15 - movl %r9d,%r10d + shll $3,%r9d - shll $3+2,%r10d + leal (%r9,%r9,2),%r10d negq %r9 movq (%r8),%r8 @@ -751,19 +1011,20 @@ _bn_power5: - leaq -64(%rsp,%r9,2),%r11 - subq %rsi,%r11 + + leaq -320(%rsp,%r9,2),%r11 + subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb L$pwr_sp_alt subq %r11,%rsp - leaq -64(%rsp,%r9,2),%rsp + leaq -320(%rsp,%r9,2),%rsp jmp L$pwr_sp_done .p2align 5 L$pwr_sp_alt: - leaq 4096-64(,%r9,2),%r10 - leaq -64(%rsp,%r9,2),%rsp + leaq 4096-320(,%r9,2),%r10 + leaq -320(%rsp,%r9,2),%rsp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 @@ -791,10 +1052,15 @@ L$power5_body: .byte 102,72,15,110,226 call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal .byte 102,72,15,126,209 .byte 102,72,15,126,226 @@ -1338,9 +1604,9 @@ L$sqr4x_shift_n_add: movq %rbx,-16(%rdi) movq %r8,-8(%rdi) .byte 102,72,15,126,213 -sqr8x_reduction: +__bn_sqr8x_reduction: xorq %rax,%rax - leaq (%rbp,%r9,2),%rcx + leaq (%r9,%rbp,1),%rcx leaq 48+8(%rsp,%r9,2),%rdx movq %rcx,0+8(%rsp) leaq 48+8(%rsp,%r9,1),%rdi @@ -1373,14 +1639,14 @@ L$8x_reduction_loop: .p2align 5 L$8x_reduce: mulq %rbx - movq 16(%rbp),%rax + movq 8(%rbp),%rax negq %r8 movq %rdx,%r8 adcq $0,%r8 mulq %rbx addq %rax,%r9 - movq 32(%rbp),%rax + movq 16(%rbp),%rax adcq $0,%rdx addq %r9,%r8 movq %rbx,48-8+8(%rsp,%rcx,8) @@ -1389,7 +1655,7 @@ L$8x_reduce: mulq %rbx addq %rax,%r10 - movq 48(%rbp),%rax + movq 24(%rbp),%rax adcq $0,%rdx addq %r10,%r9 movq 32+8(%rsp),%rsi @@ -1398,7 +1664,7 @@ L$8x_reduce: mulq %rbx addq %rax,%r11 - movq 64(%rbp),%rax + movq 32(%rbp),%rax adcq $0,%rdx imulq %r8,%rsi addq %r11,%r10 @@ -1407,7 +1673,7 @@ L$8x_reduce: mulq %rbx addq %rax,%r12 - movq 80(%rbp),%rax + movq 40(%rbp),%rax adcq $0,%rdx addq %r12,%r11 movq %rdx,%r12 @@ -1415,7 +1681,7 @@ L$8x_reduce: mulq %rbx addq %rax,%r13 - movq 96(%rbp),%rax + movq 48(%rbp),%rax adcq $0,%rdx addq %r13,%r12 movq %rdx,%r13 @@ -1423,7 +1689,7 @@ L$8x_reduce: mulq %rbx addq %rax,%r14 - movq 112(%rbp),%rax + movq 56(%rbp),%rax adcq $0,%rdx addq %r14,%r13 movq %rdx,%r14 @@ -1441,7 +1707,7 @@ L$8x_reduce: decl %ecx jnz L$8x_reduce - leaq 128(%rbp),%rbp + leaq 64(%rbp),%rbp xorq %rax,%rax movq 8+8(%rsp),%rdx cmpq 0+8(%rsp),%rbp @@ -1467,14 +1733,14 @@ L$8x_reduce: L$8x_tail: mulq %rbx addq %rax,%r8 - movq 16(%rbp),%rax + movq 8(%rbp),%rax movq %r8,(%rdi) movq %rdx,%r8 adcq $0,%r8 mulq %rbx addq %rax,%r9 - movq 32(%rbp),%rax + movq 16(%rbp),%rax adcq $0,%rdx addq %r9,%r8 leaq 8(%rdi),%rdi @@ -1483,7 +1749,7 @@ L$8x_tail: mulq %rbx addq %rax,%r10 - movq 48(%rbp),%rax + movq 24(%rbp),%rax adcq $0,%rdx addq %r10,%r9 movq %rdx,%r10 @@ -1491,7 +1757,7 @@ L$8x_tail: mulq %rbx addq %rax,%r11 - movq 64(%rbp),%rax + movq 32(%rbp),%rax adcq $0,%rdx addq %r11,%r10 movq %rdx,%r11 @@ -1499,7 +1765,7 @@ L$8x_tail: mulq %rbx addq %rax,%r12 - movq 80(%rbp),%rax + movq 40(%rbp),%rax adcq $0,%rdx addq %r12,%r11 movq %rdx,%r12 @@ -1507,7 +1773,7 @@ L$8x_tail: mulq %rbx addq %rax,%r13 - movq 96(%rbp),%rax + movq 48(%rbp),%rax adcq $0,%rdx addq %r13,%r12 movq %rdx,%r13 @@ -1515,7 +1781,7 @@ L$8x_tail: mulq %rbx addq %rax,%r14 - movq 112(%rbp),%rax + movq 56(%rbp),%rax adcq $0,%rdx addq %r14,%r13 movq %rdx,%r14 @@ -1533,7 +1799,7 @@ L$8x_tail: decl %ecx jnz L$8x_tail - leaq 128(%rbp),%rbp + leaq 64(%rbp),%rbp movq 8+8(%rsp),%rdx cmpq 0+8(%rsp),%rbp jae L$8x_tail_done @@ -1557,6 +1823,15 @@ L$8x_tail: .p2align 5 L$8x_tail_done: addq (%rdx),%r8 + adcq $0,%r9 + adcq $0,%r10 + adcq $0,%r11 + adcq $0,%r12 + adcq $0,%r13 + adcq $0,%r14 + adcq $0,%r15 + + xorq %rax,%rax negq %rsi @@ -1570,7 +1845,7 @@ L$8x_no_tail: adcq 48(%rdi),%r14 adcq 56(%rdi),%r15 adcq $0,%rax - movq -16(%rbp),%rcx + movq -8(%rbp),%rcx xorq %rsi,%rsi .byte 102,72,15,126,213 @@ -1588,40 +1863,58 @@ L$8x_no_tail: cmpq %rdx,%rdi jb L$8x_reduction_loop + .byte 0xf3,0xc3 - subq %r15,%rcx + +.p2align 5 +__bn_post4x_internal: + movq 0(%rbp),%r12 leaq (%rdi,%r9,1),%rbx - adcq %rsi,%rsi movq %r9,%rcx - orq %rsi,%rax .byte 102,72,15,126,207 - xorq $1,%rax + negq %rax .byte 102,72,15,126,206 - leaq (%rbp,%rax,8),%rbp sarq $3+2,%rcx - jmp L$sqr4x_sub + decq %r12 + xorq %r10,%r10 + movq 8(%rbp),%r13 + movq 16(%rbp),%r14 + movq 24(%rbp),%r15 + jmp L$sqr4x_sub_entry -.p2align 5 +.p2align 4 L$sqr4x_sub: -.byte 0x66 - movq 0(%rbx),%r12 - movq 8(%rbx),%r13 - sbbq 0(%rbp),%r12 - movq 16(%rbx),%r14 - sbbq 16(%rbp),%r13 - movq 24(%rbx),%r15 - leaq 32(%rbx),%rbx - sbbq 32(%rbp),%r14 + movq 0(%rbp),%r12 + movq 8(%rbp),%r13 + movq 16(%rbp),%r14 + movq 24(%rbp),%r15 +L$sqr4x_sub_entry: + leaq 32(%rbp),%rbp + notq %r12 + notq %r13 + notq %r14 + notq %r15 + andq %rax,%r12 + andq %rax,%r13 + andq %rax,%r14 + andq %rax,%r15 + + negq %r10 + adcq 0(%rbx),%r12 + adcq 8(%rbx),%r13 + adcq 16(%rbx),%r14 + adcq 24(%rbx),%r15 movq %r12,0(%rdi) - sbbq 48(%rbp),%r15 - leaq 64(%rbp),%rbp + leaq 32(%rbx),%rbx movq %r13,8(%rdi) + sbbq %r10,%r10 movq %r14,16(%rdi) movq %r15,24(%rdi) leaq 32(%rdi),%rdi incq %rcx jnz L$sqr4x_sub + movq %r9,%r10 negq %r9 .byte 0xf3,0xc3 @@ -1647,10 +1940,9 @@ bn_from_mont8x: pushq %r13 pushq %r14 pushq %r15 -.byte 0x67 - movl %r9d,%r10d + shll $3,%r9d - shll $3+2,%r10d + leaq (%r9,%r9,2),%r10 negq %r9 movq (%r8),%r8 @@ -1660,19 +1952,20 @@ bn_from_mont8x: - leaq -64(%rsp,%r9,2),%r11 - subq %rsi,%r11 + + leaq -320(%rsp,%r9,2),%r11 + subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb L$from_sp_alt subq %r11,%rsp - leaq -64(%rsp,%r9,2),%rsp + leaq -320(%rsp,%r9,2),%rsp jmp L$from_sp_done .p2align 5 L$from_sp_alt: - leaq 4096-64(,%r9,2),%r10 - leaq -64(%rsp,%r9,2),%rsp + leaq 4096-320(,%r9,2),%r10 + leaq -320(%rsp,%r9,2),%rsp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 @@ -1723,7 +2016,8 @@ L$mul_by_1: .byte 0x67 movq %rcx,%rbp .byte 102,73,15,110,218 - call sqr8x_reduction + call __bn_sqr8x_reduction + call __bn_post4x_internal pxor %xmm0,%xmm0 leaq 48(%rsp),%rax @@ -1790,45 +2084,169 @@ L$scatter_epilogue: .globl _bn_gather5 -.p2align 4 +.p2align 5 _bn_gather5: - movl %ecx,%r11d - shrl $3,%ecx - andq $7,%r11 - notl %ecx - leaq L$magic_masks(%rip),%rax - andl $3,%ecx - leaq 128(%rdx,%r11,8),%rdx - movq 0(%rax,%rcx,8),%xmm4 - movq 8(%rax,%rcx,8),%xmm5 - movq 16(%rax,%rcx,8),%xmm6 - movq 24(%rax,%rcx,8),%xmm7 +L$SEH_begin_bn_gather5: + +.byte 0x4c,0x8d,0x14,0x24 +.byte 0x48,0x81,0xec,0x08,0x01,0x00,0x00 + leaq L$inc(%rip),%rax + andq $-16,%rsp + + movd %ecx,%xmm5 + movdqa 0(%rax),%xmm0 + movdqa 16(%rax),%xmm1 + leaq 128(%rdx),%r11 + leaq 128(%rsp),%rax + + pshufd $0,%xmm5,%xmm5 + movdqa %xmm1,%xmm4 + movdqa %xmm1,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm4,%xmm3 + + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,-128(%rax) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,-112(%rax) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,-96(%rax) + movdqa %xmm4,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,-80(%rax) + movdqa %xmm4,%xmm3 + + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,-64(%rax) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,-48(%rax) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,-32(%rax) + movdqa %xmm4,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,-16(%rax) + movdqa %xmm4,%xmm3 + + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,0(%rax) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,16(%rax) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,32(%rax) + movdqa %xmm4,%xmm2 + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,48(%rax) + movdqa %xmm4,%xmm3 + + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,64(%rax) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,80(%rax) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,96(%rax) + movdqa %xmm4,%xmm2 + movdqa %xmm3,112(%rax) jmp L$gather -.p2align 4 -L$gather: - movq -128(%rdx),%xmm0 - movq -64(%rdx),%xmm1 - pand %xmm4,%xmm0 - movq 0(%rdx),%xmm2 - pand %xmm5,%xmm1 - movq 64(%rdx),%xmm3 - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 -.byte 0x67,0x67 - por %xmm2,%xmm0 - leaq 256(%rdx),%rdx - por %xmm3,%xmm0 +.p2align 5 +L$gather: + pxor %xmm4,%xmm4 + pxor %xmm5,%xmm5 + movdqa -128(%r11),%xmm0 + movdqa -112(%r11),%xmm1 + movdqa -96(%r11),%xmm2 + pand -128(%rax),%xmm0 + movdqa -80(%r11),%xmm3 + pand -112(%rax),%xmm1 + por %xmm0,%xmm4 + pand -96(%rax),%xmm2 + por %xmm1,%xmm5 + pand -80(%rax),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa -64(%r11),%xmm0 + movdqa -48(%r11),%xmm1 + movdqa -32(%r11),%xmm2 + pand -64(%rax),%xmm0 + movdqa -16(%r11),%xmm3 + pand -48(%rax),%xmm1 + por %xmm0,%xmm4 + pand -32(%rax),%xmm2 + por %xmm1,%xmm5 + pand -16(%rax),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa 0(%r11),%xmm0 + movdqa 16(%r11),%xmm1 + movdqa 32(%r11),%xmm2 + pand 0(%rax),%xmm0 + movdqa 48(%r11),%xmm3 + pand 16(%rax),%xmm1 + por %xmm0,%xmm4 + pand 32(%rax),%xmm2 + por %xmm1,%xmm5 + pand 48(%rax),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqa 64(%r11),%xmm0 + movdqa 80(%r11),%xmm1 + movdqa 96(%r11),%xmm2 + pand 64(%rax),%xmm0 + movdqa 112(%r11),%xmm3 + pand 80(%rax),%xmm1 + por %xmm0,%xmm4 + pand 96(%rax),%xmm2 + por %xmm1,%xmm5 + pand 112(%rax),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + por %xmm5,%xmm4 + leaq 256(%r11),%r11 + pshufd $0x4e,%xmm4,%xmm0 + por %xmm4,%xmm0 movq %xmm0,(%rdi) leaq 8(%rdi),%rdi subl $1,%esi jnz L$gather + + leaq (%r10),%rsp .byte 0xf3,0xc3 L$SEH_end_bn_gather5: .p2align 6 -L$magic_masks: -.long 0,0, 0,0, 0,0, -1,-1 -.long 0,0, 0,0, 0,0, 0,0 +L$inc: +.long 0,0, 1,1 +.long 2,2, 2,2 .byte 77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105,112,108,105,99,97,116,105,111,110,32,119,105,116,104,32,115,99,97,116,116,101,114,47,103,97,116,104,101,114,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0 diff --git a/deps/openssl/asm_obsolete/x64-macosx-gas/camellia/cmll-x86_64.s b/deps/openssl/asm_obsolete/x64-macosx-gas/camellia/cmll-x86_64.s index 0a3145ad4b8969..8025d088fdab4e 100644 --- a/deps/openssl/asm_obsolete/x64-macosx-gas/camellia/cmll-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-macosx-gas/camellia/cmll-x86_64.s @@ -1624,7 +1624,7 @@ L$cbc_prologue: leaq -64-63(%rcx),%r10 subq %rsp,%r10 negq %r10 - andq $960,%r10 + andq $0x3C0,%r10 subq %r10,%rsp diff --git a/deps/openssl/asm_obsolete/x64-macosx-gas/ec/ecp_nistz256-x86_64.s b/deps/openssl/asm_obsolete/x64-macosx-gas/ec/ecp_nistz256-x86_64.s index a63b602b9baa97..30456b900fdffc 100644 --- a/deps/openssl/asm_obsolete/x64-macosx-gas/ec/ecp_nistz256-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-macosx-gas/ec/ecp_nistz256-x86_64.s @@ -1121,6 +1121,7 @@ _ecp_nistz256_point_double: pushq %r15 subq $160+8,%rsp +L$point_double_shortcutq: movdqu 0(%rsi),%xmm0 movq %rsi,%rbx movdqu 16(%rsi),%xmm1 @@ -1341,7 +1342,7 @@ _ecp_nistz256_point_add: por %xmm1,%xmm3 movdqu 0(%rsi),%xmm0 - pshufd $177,%xmm3,%xmm5 + pshufd $0xb1,%xmm3,%xmm5 movdqu 16(%rsi),%xmm1 movdqu 32(%rsi),%xmm2 por %xmm3,%xmm5 @@ -1351,7 +1352,7 @@ _ecp_nistz256_point_add: movq 64+16(%rsi),%r15 movq 64+24(%rsi),%r8 movdqa %xmm0,480(%rsp) - pshufd $30,%xmm5,%xmm4 + pshufd $0x1e,%xmm5,%xmm4 movdqa %xmm1,480+16(%rsp) por %xmm0,%xmm1 .byte 102,72,15,110,199 @@ -1371,10 +1372,10 @@ _ecp_nistz256_point_add: call __ecp_nistz256_sqr_montq pcmpeqd %xmm4,%xmm5 - pshufd $177,%xmm3,%xmm4 + pshufd $0xb1,%xmm3,%xmm4 por %xmm3,%xmm4 pshufd $0,%xmm5,%xmm5 - pshufd $30,%xmm4,%xmm3 + pshufd $0x1e,%xmm4,%xmm3 por %xmm3,%xmm4 pxor %xmm3,%xmm3 pcmpeqd %xmm3,%xmm4 @@ -1383,6 +1384,7 @@ _ecp_nistz256_point_add: movq 64+8(%rbx),%r14 movq 64+16(%rbx),%r15 movq 64+24(%rbx),%r8 +.byte 102,72,15,110,203 leaq 64-0(%rbx),%rsi leaq 32(%rsp),%rdi @@ -1474,7 +1476,7 @@ _ecp_nistz256_point_add: testq %r8,%r8 jnz L$add_proceedq testq %r9,%r9 - jz L$add_proceedq + jz L$add_doubleq .byte 102,72,15,126,199 pxor %xmm0,%xmm0 @@ -1486,6 +1488,13 @@ _ecp_nistz256_point_add: movdqu %xmm0,80(%rdi) jmp L$add_doneq +.p2align 5 +L$add_doubleq: +.byte 102,72,15,126,206 +.byte 102,72,15,126,199 + addq $416,%rsp + jmp L$point_double_shortcutq + .p2align 5 L$add_proceedq: movq 0+64(%rsp),%rax @@ -1733,13 +1742,13 @@ _ecp_nistz256_point_add_affine: por %xmm1,%xmm3 movdqu 0(%rbx),%xmm0 - pshufd $177,%xmm3,%xmm5 + pshufd $0xb1,%xmm3,%xmm5 movdqu 16(%rbx),%xmm1 movdqu 32(%rbx),%xmm2 por %xmm3,%xmm5 movdqu 48(%rbx),%xmm3 movdqa %xmm0,416(%rsp) - pshufd $30,%xmm5,%xmm4 + pshufd $0x1e,%xmm5,%xmm4 movdqa %xmm1,416+16(%rsp) por %xmm0,%xmm1 .byte 102,72,15,110,199 @@ -1755,13 +1764,13 @@ _ecp_nistz256_point_add_affine: call __ecp_nistz256_sqr_montq pcmpeqd %xmm4,%xmm5 - pshufd $177,%xmm3,%xmm4 + pshufd $0xb1,%xmm3,%xmm4 movq 0(%rbx),%rax movq %r12,%r9 por %xmm3,%xmm4 pshufd $0,%xmm5,%xmm5 - pshufd $30,%xmm4,%xmm3 + pshufd $0x1e,%xmm4,%xmm3 movq %r13,%r10 por %xmm3,%xmm4 pxor %xmm3,%xmm3 diff --git a/deps/openssl/asm_obsolete/x64-macosx-gas/modes/ghash-x86_64.s b/deps/openssl/asm_obsolete/x64-macosx-gas/modes/ghash-x86_64.s index f21b3013c55f51..77fddf934af3dc 100644 --- a/deps/openssl/asm_obsolete/x64-macosx-gas/modes/ghash-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-macosx-gas/modes/ghash-x86_64.s @@ -20,14 +20,14 @@ L$gmult_prologue: movq $14,%rcx movq 8(%rsi,%rax,1),%r8 movq (%rsi,%rax,1),%r9 - andb $240,%bl + andb $0xf0,%bl movq %r8,%rdx jmp L$oop1 .p2align 4 L$oop1: shrq $4,%r8 - andq $15,%rdx + andq $0xf,%rdx movq %r9,%r10 movb (%rdi,%rcx,1),%al shrq $4,%r9 @@ -43,13 +43,13 @@ L$oop1: js L$break1 shrq $4,%r8 - andq $15,%rdx + andq $0xf,%rdx movq %r9,%r10 shrq $4,%r9 xorq 8(%rsi,%rax,1),%r8 shlq $60,%r10 xorq (%rsi,%rax,1),%r9 - andb $240,%bl + andb $0xf0,%bl xorq (%r11,%rdx,8),%r9 movq %r8,%rdx xorq %r10,%r8 @@ -58,19 +58,19 @@ L$oop1: .p2align 4 L$break1: shrq $4,%r8 - andq $15,%rdx + andq $0xf,%rdx movq %r9,%r10 shrq $4,%r9 xorq 8(%rsi,%rax,1),%r8 shlq $60,%r10 xorq (%rsi,%rax,1),%r9 - andb $240,%bl + andb $0xf0,%bl xorq (%r11,%rdx,8),%r9 movq %r8,%rdx xorq %r10,%r8 shrq $4,%r8 - andq $15,%rdx + andq $0xf,%rdx movq %r9,%r10 shrq $4,%r9 xorq 8(%rsi,%rbx,1),%r8 @@ -661,10 +661,10 @@ L$ghash_epilogue: _gcm_init_clmul: L$_init_clmul: movdqu (%rsi),%xmm2 - pshufd $78,%xmm2,%xmm2 + pshufd $0b01001110,%xmm2,%xmm2 - pshufd $255,%xmm2,%xmm4 + pshufd $0b11111111,%xmm2,%xmm4 movdqa %xmm2,%xmm3 psllq $1,%xmm2 pxor %xmm5,%xmm5 @@ -678,11 +678,11 @@ L$_init_clmul: pxor %xmm5,%xmm2 - pshufd $78,%xmm2,%xmm6 + pshufd $0b01001110,%xmm2,%xmm6 movdqa %xmm2,%xmm0 pxor %xmm2,%xmm6 movdqa %xmm0,%xmm1 - pshufd $78,%xmm0,%xmm3 + pshufd $0b01001110,%xmm0,%xmm3 pxor %xmm0,%xmm3 .byte 102,15,58,68,194,0 .byte 102,15,58,68,202,17 @@ -718,8 +718,8 @@ L$_init_clmul: pxor %xmm4,%xmm0 psrlq $1,%xmm0 pxor %xmm1,%xmm0 - pshufd $78,%xmm2,%xmm3 - pshufd $78,%xmm0,%xmm4 + pshufd $0b01001110,%xmm2,%xmm3 + pshufd $0b01001110,%xmm0,%xmm4 pxor %xmm2,%xmm3 movdqu %xmm2,0(%rdi) pxor %xmm0,%xmm4 @@ -727,7 +727,7 @@ L$_init_clmul: .byte 102,15,58,15,227,8 movdqu %xmm4,32(%rdi) movdqa %xmm0,%xmm1 - pshufd $78,%xmm0,%xmm3 + pshufd $0b01001110,%xmm0,%xmm3 pxor %xmm0,%xmm3 .byte 102,15,58,68,194,0 .byte 102,15,58,68,202,17 @@ -765,7 +765,7 @@ L$_init_clmul: pxor %xmm1,%xmm0 movdqa %xmm0,%xmm5 movdqa %xmm0,%xmm1 - pshufd $78,%xmm0,%xmm3 + pshufd $0b01001110,%xmm0,%xmm3 pxor %xmm0,%xmm3 .byte 102,15,58,68,194,0 .byte 102,15,58,68,202,17 @@ -801,8 +801,8 @@ L$_init_clmul: pxor %xmm4,%xmm0 psrlq $1,%xmm0 pxor %xmm1,%xmm0 - pshufd $78,%xmm5,%xmm3 - pshufd $78,%xmm0,%xmm4 + pshufd $0b01001110,%xmm5,%xmm3 + pshufd $0b01001110,%xmm0,%xmm4 pxor %xmm5,%xmm3 movdqu %xmm5,48(%rdi) pxor %xmm0,%xmm4 @@ -822,7 +822,7 @@ L$_gmult_clmul: movdqu 32(%rsi),%xmm4 .byte 102,15,56,0,197 movdqa %xmm0,%xmm1 - pshufd $78,%xmm0,%xmm3 + pshufd $0b01001110,%xmm0,%xmm3 pxor %xmm0,%xmm3 .byte 102,15,58,68,194,0 .byte 102,15,58,68,202,17 @@ -874,20 +874,20 @@ L$_ghash_clmul: movdqu 32(%rsi),%xmm7 .byte 102,65,15,56,0,194 - subq $16,%rcx + subq $0x10,%rcx jz L$odd_tail movdqu 16(%rsi),%xmm6 movl _OPENSSL_ia32cap_P+4(%rip),%eax - cmpq $48,%rcx + cmpq $0x30,%rcx jb L$skip4x andl $71303168,%eax cmpl $4194304,%eax je L$skip4x - subq $48,%rcx - movq $11547335547999543296,%rax + subq $0x30,%rcx + movq $0xA040608020C0E000,%rax movdqu 48(%rsi),%xmm14 movdqu 64(%rsi),%xmm15 @@ -899,14 +899,14 @@ L$_ghash_clmul: .byte 102,65,15,56,0,218 .byte 102,69,15,56,0,218 movdqa %xmm3,%xmm5 - pshufd $78,%xmm3,%xmm4 + pshufd $0b01001110,%xmm3,%xmm4 pxor %xmm3,%xmm4 .byte 102,15,58,68,218,0 .byte 102,15,58,68,234,17 .byte 102,15,58,68,231,0 movdqa %xmm11,%xmm13 - pshufd $78,%xmm11,%xmm12 + pshufd $0b01001110,%xmm11,%xmm12 pxor %xmm11,%xmm12 .byte 102,68,15,58,68,222,0 .byte 102,68,15,58,68,238,17 @@ -921,12 +921,12 @@ L$_ghash_clmul: .byte 102,69,15,56,0,218 .byte 102,69,15,56,0,194 movdqa %xmm11,%xmm13 - pshufd $78,%xmm11,%xmm12 + pshufd $0b01001110,%xmm11,%xmm12 pxor %xmm8,%xmm0 pxor %xmm11,%xmm12 .byte 102,69,15,58,68,222,0 movdqa %xmm0,%xmm1 - pshufd $78,%xmm0,%xmm8 + pshufd $0b01001110,%xmm0,%xmm8 pxor %xmm0,%xmm8 .byte 102,69,15,58,68,238,17 .byte 102,68,15,58,68,231,0 @@ -934,7 +934,7 @@ L$_ghash_clmul: xorps %xmm13,%xmm5 leaq 64(%rdx),%rdx - subq $64,%rcx + subq $0x40,%rcx jc L$tail4x jmp L$mod4_loop @@ -949,14 +949,14 @@ L$mod4_loop: movdqu 32(%rdx),%xmm3 movdqa %xmm11,%xmm13 .byte 102,68,15,58,68,199,16 - pshufd $78,%xmm11,%xmm12 + pshufd $0b01001110,%xmm11,%xmm12 xorps %xmm5,%xmm1 pxor %xmm11,%xmm12 .byte 102,65,15,56,0,218 movups 32(%rsi),%xmm7 xorps %xmm4,%xmm8 .byte 102,68,15,58,68,218,0 - pshufd $78,%xmm3,%xmm4 + pshufd $0b01001110,%xmm3,%xmm4 pxor %xmm0,%xmm8 movdqa %xmm3,%xmm5 @@ -1000,7 +1000,7 @@ L$mod4_loop: movdqa %xmm11,%xmm13 pxor %xmm12,%xmm4 - pshufd $78,%xmm11,%xmm12 + pshufd $0b01001110,%xmm11,%xmm12 pxor %xmm9,%xmm0 pxor %xmm8,%xmm1 pxor %xmm11,%xmm12 @@ -1010,14 +1010,14 @@ L$mod4_loop: movdqa %xmm0,%xmm1 .byte 102,69,15,58,68,238,17 xorps %xmm11,%xmm3 - pshufd $78,%xmm0,%xmm8 + pshufd $0b01001110,%xmm0,%xmm8 pxor %xmm0,%xmm8 .byte 102,68,15,58,68,231,0 xorps %xmm13,%xmm5 leaq 64(%rdx),%rdx - subq $64,%rcx + subq $0x40,%rcx jnc L$mod4_loop L$tail4x: @@ -1061,10 +1061,10 @@ L$tail4x: pxor %xmm4,%xmm0 psrlq $1,%xmm0 pxor %xmm1,%xmm0 - addq $64,%rcx + addq $0x40,%rcx jz L$done movdqu 32(%rsi),%xmm7 - subq $16,%rcx + subq $0x10,%rcx jz L$odd_tail L$skip4x: @@ -1079,7 +1079,7 @@ L$skip4x: pxor %xmm8,%xmm0 movdqa %xmm3,%xmm5 - pshufd $78,%xmm3,%xmm4 + pshufd $0b01001110,%xmm3,%xmm4 pxor %xmm3,%xmm4 .byte 102,15,58,68,218,0 .byte 102,15,58,68,234,17 @@ -1087,7 +1087,7 @@ L$skip4x: leaq 32(%rdx),%rdx nop - subq $32,%rcx + subq $0x20,%rcx jbe L$even_tail nop jmp L$mod_loop @@ -1096,7 +1096,7 @@ L$skip4x: L$mod_loop: movdqa %xmm0,%xmm1 movdqa %xmm4,%xmm8 - pshufd $78,%xmm0,%xmm4 + pshufd $0b01001110,%xmm0,%xmm4 pxor %xmm0,%xmm4 .byte 102,15,58,68,198,0 @@ -1134,7 +1134,7 @@ L$mod_loop: pslldq $8,%xmm0 psrldq $8,%xmm8 pxor %xmm9,%xmm0 - pshufd $78,%xmm5,%xmm4 + pshufd $0b01001110,%xmm5,%xmm4 pxor %xmm8,%xmm1 pxor %xmm5,%xmm4 @@ -1150,13 +1150,13 @@ L$mod_loop: .byte 102,15,58,68,231,0 pxor %xmm1,%xmm0 - subq $32,%rcx + subq $0x20,%rcx ja L$mod_loop L$even_tail: movdqa %xmm0,%xmm1 movdqa %xmm4,%xmm8 - pshufd $78,%xmm0,%xmm4 + pshufd $0b01001110,%xmm0,%xmm4 pxor %xmm0,%xmm4 .byte 102,15,58,68,198,0 @@ -1204,7 +1204,7 @@ L$odd_tail: .byte 102,69,15,56,0,194 pxor %xmm8,%xmm0 movdqa %xmm0,%xmm1 - pshufd $78,%xmm0,%xmm3 + pshufd $0b01001110,%xmm0,%xmm3 pxor %xmm0,%xmm3 .byte 102,15,58,68,194,0 .byte 102,15,58,68,202,17 diff --git a/deps/openssl/asm_obsolete/x64-macosx-gas/sha/sha1-mb-x86_64.s b/deps/openssl/asm_obsolete/x64-macosx-gas/sha/sha1-mb-x86_64.s index 010924530be391..a0de51655d1d3a 100644 --- a/deps/openssl/asm_obsolete/x64-macosx-gas/sha/sha1-mb-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-macosx-gas/sha/sha1-mb-x86_64.s @@ -2599,10 +2599,10 @@ L$oop_grande_shaext: punpcklqdq %xmm5,%xmm0 punpckhqdq %xmm5,%xmm8 - pshufd $63,%xmm7,%xmm1 - pshufd $127,%xmm7,%xmm9 - pshufd $27,%xmm0,%xmm0 - pshufd $27,%xmm8,%xmm8 + pshufd $0b00111111,%xmm7,%xmm1 + pshufd $0b01111111,%xmm7,%xmm9 + pshufd $0b00011011,%xmm0,%xmm0 + pshufd $0b00011011,%xmm8,%xmm8 jmp L$oop_shaext .p2align 5 @@ -2857,8 +2857,8 @@ L$oop_shaext: .byte 69,15,58,204,193,3 .byte 69,15,56,200,214 - pshufd $0,%xmm6,%xmm11 - pshufd $85,%xmm6,%xmm12 + pshufd $0x00,%xmm6,%xmm11 + pshufd $0x55,%xmm6,%xmm12 movdqa %xmm6,%xmm7 pcmpgtd %xmm4,%xmm11 pcmpgtd %xmm4,%xmm12 @@ -2888,8 +2888,8 @@ L$oop_shaext: movl 280(%rsp),%edx - pshufd $27,%xmm0,%xmm0 - pshufd $27,%xmm8,%xmm8 + pshufd $0b00011011,%xmm0,%xmm0 + pshufd $0b00011011,%xmm8,%xmm8 movdqa %xmm0,%xmm6 punpckldq %xmm8,%xmm0 diff --git a/deps/openssl/asm_obsolete/x64-macosx-gas/sha/sha1-x86_64.s b/deps/openssl/asm_obsolete/x64-macosx-gas/sha/sha1-x86_64.s index 671034cdafa3c4..798ca0dc4d076a 100644 --- a/deps/openssl/asm_obsolete/x64-macosx-gas/sha/sha1-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-macosx-gas/sha/sha1-x86_64.s @@ -1240,9 +1240,9 @@ _shaext_shortcut: movdqa K_XX_XX+160(%rip),%xmm3 movdqu (%rsi),%xmm4 - pshufd $27,%xmm0,%xmm0 + pshufd $0b00011011,%xmm0,%xmm0 movdqu 16(%rsi),%xmm5 - pshufd $27,%xmm1,%xmm1 + pshufd $0b00011011,%xmm1,%xmm1 movdqu 32(%rsi),%xmm6 .byte 102,15,56,0,227 movdqu 48(%rsi),%xmm7 @@ -1392,8 +1392,8 @@ L$oop_shaext: jnz L$oop_shaext - pshufd $27,%xmm0,%xmm0 - pshufd $27,%xmm1,%xmm1 + pshufd $0b00011011,%xmm0,%xmm0 + pshufd $0b00011011,%xmm1,%xmm1 movdqu %xmm0,(%rdi) movd %xmm1,16(%rdi) .byte 0xf3,0xc3 diff --git a/deps/openssl/asm_obsolete/x64-macosx-gas/sha/sha256-mb-x86_64.s b/deps/openssl/asm_obsolete/x64-macosx-gas/sha/sha256-mb-x86_64.s index 5ad4c7bb100a2f..276322bec2b7e8 100644 --- a/deps/openssl/asm_obsolete/x64-macosx-gas/sha/sha256-mb-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-macosx-gas/sha/sha256-mb-x86_64.s @@ -2677,10 +2677,10 @@ L$oop_grande_shaext: punpckhqdq %xmm8,%xmm14 punpckhqdq %xmm10,%xmm15 - pshufd $27,%xmm12,%xmm12 - pshufd $27,%xmm13,%xmm13 - pshufd $27,%xmm14,%xmm14 - pshufd $27,%xmm15,%xmm15 + pshufd $0b00011011,%xmm12,%xmm12 + pshufd $0b00011011,%xmm13,%xmm13 + pshufd $0b00011011,%xmm14,%xmm14 + pshufd $0b00011011,%xmm15,%xmm15 jmp L$oop_shaext .p2align 5 @@ -2712,11 +2712,11 @@ L$oop_shaext: movdqa %xmm2,%xmm0 movdqa %xmm15,112(%rsp) .byte 69,15,56,203,254 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 pxor %xmm12,%xmm4 movdqa %xmm12,64(%rsp) .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 pxor %xmm14,%xmm8 movdqa %xmm14,96(%rsp) movdqa 16-128(%rbp),%xmm1 @@ -2734,11 +2734,11 @@ L$oop_shaext: .byte 102,68,15,56,0,211 prefetcht0 127(%r9) .byte 69,15,56,203,254 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 .byte 102,68,15,56,0,219 .byte 15,56,204,229 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 32-128(%rbp),%xmm1 paddd %xmm6,%xmm1 .byte 69,15,56,203,247 @@ -2751,14 +2751,14 @@ L$oop_shaext: movdqa %xmm2,%xmm0 movdqa %xmm7,%xmm3 .byte 69,15,56,203,254 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 .byte 102,15,58,15,222,4 paddd %xmm3,%xmm4 movdqa %xmm11,%xmm3 .byte 102,65,15,58,15,218,4 .byte 15,56,204,238 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 48-128(%rbp),%xmm1 paddd %xmm7,%xmm1 .byte 69,15,56,203,247 @@ -2775,13 +2775,13 @@ L$oop_shaext: .byte 102,15,58,15,223,4 .byte 69,15,56,203,254 .byte 69,15,56,205,195 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm5 movdqa %xmm8,%xmm3 .byte 102,65,15,58,15,219,4 .byte 15,56,204,247 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 64-128(%rbp),%xmm1 paddd %xmm4,%xmm1 .byte 69,15,56,203,247 @@ -2797,13 +2797,13 @@ L$oop_shaext: .byte 102,15,58,15,220,4 .byte 69,15,56,203,254 .byte 69,15,56,205,200 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm6 movdqa %xmm9,%xmm3 .byte 102,65,15,58,15,216,4 .byte 15,56,204,252 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 80-128(%rbp),%xmm1 paddd %xmm5,%xmm1 .byte 69,15,56,203,247 @@ -2819,13 +2819,13 @@ L$oop_shaext: .byte 102,15,58,15,221,4 .byte 69,15,56,203,254 .byte 69,15,56,205,209 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm7 movdqa %xmm10,%xmm3 .byte 102,65,15,58,15,217,4 .byte 15,56,204,229 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 96-128(%rbp),%xmm1 paddd %xmm6,%xmm1 .byte 69,15,56,203,247 @@ -2841,13 +2841,13 @@ L$oop_shaext: .byte 102,15,58,15,222,4 .byte 69,15,56,203,254 .byte 69,15,56,205,218 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm4 movdqa %xmm11,%xmm3 .byte 102,65,15,58,15,218,4 .byte 15,56,204,238 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 112-128(%rbp),%xmm1 paddd %xmm7,%xmm1 .byte 69,15,56,203,247 @@ -2863,13 +2863,13 @@ L$oop_shaext: .byte 102,15,58,15,223,4 .byte 69,15,56,203,254 .byte 69,15,56,205,195 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm5 movdqa %xmm8,%xmm3 .byte 102,65,15,58,15,219,4 .byte 15,56,204,247 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 128-128(%rbp),%xmm1 paddd %xmm4,%xmm1 .byte 69,15,56,203,247 @@ -2885,13 +2885,13 @@ L$oop_shaext: .byte 102,15,58,15,220,4 .byte 69,15,56,203,254 .byte 69,15,56,205,200 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm6 movdqa %xmm9,%xmm3 .byte 102,65,15,58,15,216,4 .byte 15,56,204,252 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 144-128(%rbp),%xmm1 paddd %xmm5,%xmm1 .byte 69,15,56,203,247 @@ -2907,13 +2907,13 @@ L$oop_shaext: .byte 102,15,58,15,221,4 .byte 69,15,56,203,254 .byte 69,15,56,205,209 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm7 movdqa %xmm10,%xmm3 .byte 102,65,15,58,15,217,4 .byte 15,56,204,229 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 160-128(%rbp),%xmm1 paddd %xmm6,%xmm1 .byte 69,15,56,203,247 @@ -2929,13 +2929,13 @@ L$oop_shaext: .byte 102,15,58,15,222,4 .byte 69,15,56,203,254 .byte 69,15,56,205,218 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm4 movdqa %xmm11,%xmm3 .byte 102,65,15,58,15,218,4 .byte 15,56,204,238 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 176-128(%rbp),%xmm1 paddd %xmm7,%xmm1 .byte 69,15,56,203,247 @@ -2951,13 +2951,13 @@ L$oop_shaext: .byte 102,15,58,15,223,4 .byte 69,15,56,203,254 .byte 69,15,56,205,195 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm5 movdqa %xmm8,%xmm3 .byte 102,65,15,58,15,219,4 .byte 15,56,204,247 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 192-128(%rbp),%xmm1 paddd %xmm4,%xmm1 .byte 69,15,56,203,247 @@ -2973,13 +2973,13 @@ L$oop_shaext: .byte 102,15,58,15,220,4 .byte 69,15,56,203,254 .byte 69,15,56,205,200 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm6 movdqa %xmm9,%xmm3 .byte 102,65,15,58,15,216,4 .byte 15,56,204,252 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 208-128(%rbp),%xmm1 paddd %xmm5,%xmm1 .byte 69,15,56,203,247 @@ -2995,13 +2995,13 @@ L$oop_shaext: .byte 102,15,58,15,221,4 .byte 69,15,56,203,254 .byte 69,15,56,205,209 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 paddd %xmm3,%xmm7 movdqa %xmm10,%xmm3 .byte 102,65,15,58,15,217,4 nop .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 224-128(%rbp),%xmm1 paddd %xmm6,%xmm1 .byte 69,15,56,203,247 @@ -3018,13 +3018,13 @@ L$oop_shaext: pxor %xmm6,%xmm6 .byte 69,15,56,203,254 .byte 69,15,56,205,218 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 movdqa 240-128(%rbp),%xmm1 paddd %xmm7,%xmm1 movq (%rbx),%xmm7 nop .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 movdqa 240-128(%rbp),%xmm2 paddd %xmm11,%xmm2 .byte 69,15,56,203,247 @@ -3034,17 +3034,17 @@ L$oop_shaext: cmovgeq %rsp,%r8 cmpl 4(%rbx),%ecx cmovgeq %rsp,%r9 - pshufd $0,%xmm7,%xmm9 + pshufd $0x00,%xmm7,%xmm9 .byte 69,15,56,203,236 movdqa %xmm2,%xmm0 - pshufd $85,%xmm7,%xmm10 + pshufd $0x55,%xmm7,%xmm10 movdqa %xmm7,%xmm11 .byte 69,15,56,203,254 - pshufd $14,%xmm1,%xmm0 + pshufd $0x0e,%xmm1,%xmm0 pcmpgtd %xmm6,%xmm9 pcmpgtd %xmm6,%xmm10 .byte 69,15,56,203,229 - pshufd $14,%xmm2,%xmm0 + pshufd $0x0e,%xmm2,%xmm0 pcmpgtd %xmm6,%xmm11 movdqa K256_shaext-16(%rip),%xmm3 .byte 69,15,56,203,247 @@ -3066,10 +3066,10 @@ L$oop_shaext: movl 280(%rsp),%edx - pshufd $27,%xmm12,%xmm12 - pshufd $27,%xmm13,%xmm13 - pshufd $27,%xmm14,%xmm14 - pshufd $27,%xmm15,%xmm15 + pshufd $0b00011011,%xmm12,%xmm12 + pshufd $0b00011011,%xmm13,%xmm13 + pshufd $0b00011011,%xmm14,%xmm14 + pshufd $0b00011011,%xmm15,%xmm15 movdqa %xmm12,%xmm5 movdqa %xmm13,%xmm6 diff --git a/deps/openssl/asm_obsolete/x64-macosx-gas/sha/sha256-x86_64.s b/deps/openssl/asm_obsolete/x64-macosx-gas/sha/sha256-x86_64.s index aa507cada6bb4f..5566d587610ea7 100644 --- a/deps/openssl/asm_obsolete/x64-macosx-gas/sha/sha256-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-macosx-gas/sha/sha256-x86_64.s @@ -1754,9 +1754,9 @@ _shaext_shortcut: movdqu 16(%rdi),%xmm2 movdqa 512-128(%rcx),%xmm7 - pshufd $27,%xmm1,%xmm0 - pshufd $177,%xmm1,%xmm1 - pshufd $27,%xmm2,%xmm2 + pshufd $0x1b,%xmm1,%xmm0 + pshufd $0xb1,%xmm1,%xmm1 + pshufd $0x1b,%xmm2,%xmm2 movdqa %xmm7,%xmm8 .byte 102,15,58,15,202,8 punpcklqdq %xmm0,%xmm2 @@ -1775,7 +1775,7 @@ L$oop_shaext: .byte 102,15,56,0,231 movdqa %xmm2,%xmm10 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 nop movdqa %xmm1,%xmm9 .byte 15,56,203,202 @@ -1784,7 +1784,7 @@ L$oop_shaext: paddd %xmm4,%xmm0 .byte 102,15,56,0,239 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 leaq 64(%rsi),%rsi .byte 15,56,204,220 .byte 15,56,203,202 @@ -1793,7 +1793,7 @@ L$oop_shaext: paddd %xmm5,%xmm0 .byte 102,15,56,0,247 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm6,%xmm7 .byte 102,15,58,15,253,4 nop @@ -1805,7 +1805,7 @@ L$oop_shaext: paddd %xmm6,%xmm0 .byte 15,56,205,222 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm3,%xmm7 .byte 102,15,58,15,254,4 nop @@ -1816,7 +1816,7 @@ L$oop_shaext: paddd %xmm3,%xmm0 .byte 15,56,205,227 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm4,%xmm7 .byte 102,15,58,15,251,4 nop @@ -1827,7 +1827,7 @@ L$oop_shaext: paddd %xmm4,%xmm0 .byte 15,56,205,236 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm5,%xmm7 .byte 102,15,58,15,252,4 nop @@ -1838,7 +1838,7 @@ L$oop_shaext: paddd %xmm5,%xmm0 .byte 15,56,205,245 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm6,%xmm7 .byte 102,15,58,15,253,4 nop @@ -1849,7 +1849,7 @@ L$oop_shaext: paddd %xmm6,%xmm0 .byte 15,56,205,222 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm3,%xmm7 .byte 102,15,58,15,254,4 nop @@ -1860,7 +1860,7 @@ L$oop_shaext: paddd %xmm3,%xmm0 .byte 15,56,205,227 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm4,%xmm7 .byte 102,15,58,15,251,4 nop @@ -1871,7 +1871,7 @@ L$oop_shaext: paddd %xmm4,%xmm0 .byte 15,56,205,236 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm5,%xmm7 .byte 102,15,58,15,252,4 nop @@ -1882,7 +1882,7 @@ L$oop_shaext: paddd %xmm5,%xmm0 .byte 15,56,205,245 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm6,%xmm7 .byte 102,15,58,15,253,4 nop @@ -1893,7 +1893,7 @@ L$oop_shaext: paddd %xmm6,%xmm0 .byte 15,56,205,222 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm3,%xmm7 .byte 102,15,58,15,254,4 nop @@ -1904,7 +1904,7 @@ L$oop_shaext: paddd %xmm3,%xmm0 .byte 15,56,205,227 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm4,%xmm7 .byte 102,15,58,15,251,4 nop @@ -1915,7 +1915,7 @@ L$oop_shaext: paddd %xmm4,%xmm0 .byte 15,56,205,236 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 movdqa %xmm5,%xmm7 .byte 102,15,58,15,252,4 .byte 15,56,203,202 @@ -1924,7 +1924,7 @@ L$oop_shaext: movdqa 448-128(%rcx),%xmm0 paddd %xmm5,%xmm0 .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 .byte 15,56,205,245 movdqa %xmm8,%xmm7 .byte 15,56,203,202 @@ -1933,7 +1933,7 @@ L$oop_shaext: paddd %xmm6,%xmm0 nop .byte 15,56,203,209 - pshufd $14,%xmm0,%xmm0 + pshufd $0x0e,%xmm0,%xmm0 decq %rdx nop .byte 15,56,203,202 @@ -1942,9 +1942,9 @@ L$oop_shaext: paddd %xmm9,%xmm1 jnz L$oop_shaext - pshufd $177,%xmm2,%xmm2 - pshufd $27,%xmm1,%xmm7 - pshufd $177,%xmm1,%xmm1 + pshufd $0xb1,%xmm2,%xmm2 + pshufd $0x1b,%xmm1,%xmm7 + pshufd $0xb1,%xmm1,%xmm1 punpckhqdq %xmm2,%xmm1 .byte 102,15,58,15,215,8 diff --git a/deps/openssl/asm_obsolete/x64-macosx-gas/x86_64cpuid.s b/deps/openssl/asm_obsolete/x64-macosx-gas/x86_64cpuid.s index 5d69baad8f4ab7..ef623d5967716c 100644 --- a/deps/openssl/asm_obsolete/x64-macosx-gas/x86_64cpuid.s +++ b/deps/openssl/asm_obsolete/x64-macosx-gas/x86_64cpuid.s @@ -45,43 +45,43 @@ _OPENSSL_ia32_cpuid: movl %eax,%r11d xorl %eax,%eax - cmpl $1970169159,%ebx + cmpl $0x756e6547,%ebx setne %al movl %eax,%r9d - cmpl $1231384169,%edx + cmpl $0x49656e69,%edx setne %al orl %eax,%r9d - cmpl $1818588270,%ecx + cmpl $0x6c65746e,%ecx setne %al orl %eax,%r9d jz L$intel - cmpl $1752462657,%ebx + cmpl $0x68747541,%ebx setne %al movl %eax,%r10d - cmpl $1769238117,%edx + cmpl $0x69746E65,%edx setne %al orl %eax,%r10d - cmpl $1145913699,%ecx + cmpl $0x444D4163,%ecx setne %al orl %eax,%r10d jnz L$intel - movl $2147483648,%eax + movl $0x80000000,%eax cpuid - cmpl $2147483649,%eax + cmpl $0x80000001,%eax jb L$intel movl %eax,%r10d - movl $2147483649,%eax + movl $0x80000001,%eax cpuid orl %ecx,%r9d - andl $2049,%r9d + andl $0x00000801,%r9d - cmpl $2147483656,%r10d + cmpl $0x80000008,%r10d jb L$intel - movl $2147483656,%eax + movl $0x80000008,%eax cpuid movzbq %cl,%r10 incq %r10 @@ -93,7 +93,7 @@ _OPENSSL_ia32_cpuid: shrl $16,%ebx cmpb %r10b,%bl ja L$generic - andl $4026531839,%edx + andl $0xefffffff,%edx jmp L$generic L$intel: @@ -106,7 +106,7 @@ L$intel: cpuid movl %eax,%r10d shrl $14,%r10d - andl $4095,%r10d + andl $0xfff,%r10d cmpl $7,%r11d jb L$nocacheinfo @@ -119,29 +119,29 @@ L$intel: L$nocacheinfo: movl $1,%eax cpuid - andl $3220176895,%edx + andl $0xbfefffff,%edx cmpl $0,%r9d jne L$notintel - orl $1073741824,%edx + orl $0x40000000,%edx andb $15,%ah cmpb $15,%ah jne L$notintel - orl $1048576,%edx + orl $0x00100000,%edx L$notintel: btl $28,%edx jnc L$generic - andl $4026531839,%edx + andl $0xefffffff,%edx cmpl $0,%r10d je L$generic - orl $268435456,%edx + orl $0x10000000,%edx shrl $16,%ebx cmpb $1,%bl ja L$generic - andl $4026531839,%edx + andl $0xefffffff,%edx L$generic: - andl $2048,%r9d - andl $4294965247,%ecx + andl $0x00000800,%r9d + andl $0xfffff7ff,%ecx orl %ecx,%r9d movl %edx,%r10d @@ -153,9 +153,9 @@ L$generic: cmpl $6,%eax je L$done L$clear_avx: - movl $4026525695,%eax + movl $0xefffe7ff,%eax andl %eax,%r9d - andl $4294967263,8(%rdi) + andl $0xffffffdf,8(%rdi) L$done: shlq $32,%r9 movl %r10d,%eax diff --git a/deps/openssl/asm_obsolete/x64-win32-masm/bn/rsaz-x86_64.asm b/deps/openssl/asm_obsolete/x64-win32-masm/bn/rsaz-x86_64.asm index 86e828d3dc651b..89114311a56e7b 100644 --- a/deps/openssl/asm_obsolete/x64-win32-masm/bn/rsaz-x86_64.asm +++ b/deps/openssl/asm_obsolete/x64-win32-masm/bn/rsaz-x86_64.asm @@ -502,48 +502,104 @@ $L$SEH_begin_rsaz_512_mul_gather4:: push r14 push r15 - mov r9d,r9d - sub rsp,128+24 + sub rsp,328 + movaps XMMWORD PTR[160+rsp],xmm6 + movaps XMMWORD PTR[176+rsp],xmm7 + movaps XMMWORD PTR[192+rsp],xmm8 + movaps XMMWORD PTR[208+rsp],xmm9 + movaps XMMWORD PTR[224+rsp],xmm10 + movaps XMMWORD PTR[240+rsp],xmm11 + movaps XMMWORD PTR[256+rsp],xmm12 + movaps XMMWORD PTR[272+rsp],xmm13 + movaps XMMWORD PTR[288+rsp],xmm14 + movaps XMMWORD PTR[304+rsp],xmm15 $L$mul_gather4_body:: - mov eax,DWORD PTR[64+r9*4+rdx] -DB 102,72,15,110,199 - mov ebx,DWORD PTR[r9*4+rdx] -DB 102,72,15,110,201 + movd xmm8,r9d + movdqa xmm1,XMMWORD PTR[(($L$inc+16))] + movdqa xmm0,XMMWORD PTR[$L$inc] + + pshufd xmm8,xmm8,0 + movdqa xmm7,xmm1 + movdqa xmm2,xmm1 + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm8 + movdqa xmm3,xmm7 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm8 + movdqa xmm4,xmm7 + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm8 + movdqa xmm5,xmm7 + paddd xmm4,xmm3 + pcmpeqd xmm3,xmm8 + movdqa xmm6,xmm7 + paddd xmm5,xmm4 + pcmpeqd xmm4,xmm8 + paddd xmm6,xmm5 + pcmpeqd xmm5,xmm8 + paddd xmm7,xmm6 + pcmpeqd xmm6,xmm8 + pcmpeqd xmm7,xmm8 + + movdqa xmm8,XMMWORD PTR[rdx] + movdqa xmm9,XMMWORD PTR[16+rdx] + movdqa xmm10,XMMWORD PTR[32+rdx] + movdqa xmm11,XMMWORD PTR[48+rdx] + pand xmm8,xmm0 + movdqa xmm12,XMMWORD PTR[64+rdx] + pand xmm9,xmm1 + movdqa xmm13,XMMWORD PTR[80+rdx] + pand xmm10,xmm2 + movdqa xmm14,XMMWORD PTR[96+rdx] + pand xmm11,xmm3 + movdqa xmm15,XMMWORD PTR[112+rdx] + lea rbp,QWORD PTR[128+rdx] + pand xmm12,xmm4 + pand xmm13,xmm5 + pand xmm14,xmm6 + pand xmm15,xmm7 + por xmm8,xmm10 + por xmm9,xmm11 + por xmm8,xmm12 + por xmm9,xmm13 + por xmm8,xmm14 + por xmm9,xmm15 + + por xmm8,xmm9 + pshufd xmm9,xmm8,04eh + por xmm8,xmm9 +DB 102,76,15,126,195 + mov QWORD PTR[128+rsp],r8 + mov QWORD PTR[((128+8))+rsp],rdi + mov QWORD PTR[((128+16))+rsp],rcx - shl rax,32 - or rbx,rax mov rax,QWORD PTR[rsi] mov rcx,QWORD PTR[8+rsi] - lea rbp,QWORD PTR[128+r9*4+rdx] mul rbx mov QWORD PTR[rsp],rax mov rax,rcx mov r8,rdx mul rbx - movd xmm4,DWORD PTR[rbp] add r8,rax mov rax,QWORD PTR[16+rsi] mov r9,rdx adc r9,0 mul rbx - movd xmm5,DWORD PTR[64+rbp] add r9,rax mov rax,QWORD PTR[24+rsi] mov r10,rdx adc r10,0 mul rbx - pslldq xmm5,4 add r10,rax mov rax,QWORD PTR[32+rsi] mov r11,rdx adc r11,0 mul rbx - por xmm4,xmm5 add r11,rax mov rax,QWORD PTR[40+rsi] mov r12,rdx @@ -556,14 +612,12 @@ DB 102,72,15,110,201 adc r13,0 mul rbx - lea rbp,QWORD PTR[128+rbp] add r13,rax mov rax,QWORD PTR[56+rsi] mov r14,rdx adc r14,0 mul rbx -DB 102,72,15,126,227 add r14,rax mov rax,QWORD PTR[rsi] mov r15,rdx @@ -575,6 +629,35 @@ DB 102,72,15,126,227 ALIGN 32 $L$oop_mul_gather:: + movdqa xmm8,XMMWORD PTR[rbp] + movdqa xmm9,XMMWORD PTR[16+rbp] + movdqa xmm10,XMMWORD PTR[32+rbp] + movdqa xmm11,XMMWORD PTR[48+rbp] + pand xmm8,xmm0 + movdqa xmm12,XMMWORD PTR[64+rbp] + pand xmm9,xmm1 + movdqa xmm13,XMMWORD PTR[80+rbp] + pand xmm10,xmm2 + movdqa xmm14,XMMWORD PTR[96+rbp] + pand xmm11,xmm3 + movdqa xmm15,XMMWORD PTR[112+rbp] + lea rbp,QWORD PTR[128+rbp] + pand xmm12,xmm4 + pand xmm13,xmm5 + pand xmm14,xmm6 + pand xmm15,xmm7 + por xmm8,xmm10 + por xmm9,xmm11 + por xmm8,xmm12 + por xmm9,xmm13 + por xmm8,xmm14 + por xmm9,xmm15 + + por xmm8,xmm9 + pshufd xmm9,xmm8,04eh + por xmm8,xmm9 +DB 102,76,15,126,195 + mul rbx add r8,rax mov rax,QWORD PTR[8+rsi] @@ -583,7 +666,6 @@ $L$oop_mul_gather:: adc r8,0 mul rbx - movd xmm4,DWORD PTR[rbp] add r9,rax mov rax,QWORD PTR[16+rsi] adc rdx,0 @@ -592,7 +674,6 @@ $L$oop_mul_gather:: adc r9,0 mul rbx - movd xmm5,DWORD PTR[64+rbp] add r10,rax mov rax,QWORD PTR[24+rsi] adc rdx,0 @@ -601,7 +682,6 @@ $L$oop_mul_gather:: adc r10,0 mul rbx - pslldq xmm5,4 add r11,rax mov rax,QWORD PTR[32+rsi] adc rdx,0 @@ -610,7 +690,6 @@ $L$oop_mul_gather:: adc r11,0 mul rbx - por xmm4,xmm5 add r12,rax mov rax,QWORD PTR[40+rsi] adc rdx,0 @@ -635,7 +714,6 @@ $L$oop_mul_gather:: adc r14,0 mul rbx -DB 102,72,15,126,227 add r15,rax mov rax,QWORD PTR[rsi] adc rdx,0 @@ -643,7 +721,6 @@ DB 102,72,15,126,227 mov r15,rdx adc r15,0 - lea rbp,QWORD PTR[128+rbp] lea rdi,QWORD PTR[8+rdi] dec ecx @@ -658,8 +735,8 @@ DB 102,72,15,126,227 mov QWORD PTR[48+rdi],r14 mov QWORD PTR[56+rdi],r15 -DB 102,72,15,126,199 -DB 102,72,15,126,205 + mov rdi,QWORD PTR[((128+8))+rsp] + mov rbp,QWORD PTR[((128+16))+rsp] mov r8,QWORD PTR[rsp] mov r9,QWORD PTR[8+rsp] @@ -684,6 +761,17 @@ DB 102,72,15,126,205 call __rsaz_512_subtract lea rax,QWORD PTR[((128+24+48))+rsp] + movaps xmm6,XMMWORD PTR[((160-200))+rax] + movaps xmm7,XMMWORD PTR[((176-200))+rax] + movaps xmm8,XMMWORD PTR[((192-200))+rax] + movaps xmm9,XMMWORD PTR[((208-200))+rax] + movaps xmm10,XMMWORD PTR[((224-200))+rax] + movaps xmm11,XMMWORD PTR[((240-200))+rax] + movaps xmm12,XMMWORD PTR[((256-200))+rax] + movaps xmm13,XMMWORD PTR[((272-200))+rax] + movaps xmm14,XMMWORD PTR[((288-200))+rax] + movaps xmm15,XMMWORD PTR[((304-200))+rax] + lea rax,QWORD PTR[176+rax] mov r15,QWORD PTR[((-48))+rax] mov r14,QWORD PTR[((-40))+rax] mov r13,QWORD PTR[((-32))+rax] @@ -723,7 +811,7 @@ $L$SEH_begin_rsaz_512_mul_scatter4:: mov r9d,r9d sub rsp,128+24 $L$mul_scatter4_body:: - lea r8,QWORD PTR[r9*4+r8] + lea r8,QWORD PTR[r9*8+r8] DB 102,72,15,110,199 DB 102,72,15,110,202 DB 102,73,15,110,208 @@ -759,30 +847,14 @@ DB 102,72,15,126,214 call __rsaz_512_subtract - mov DWORD PTR[rsi],r8d - shr r8,32 - mov DWORD PTR[128+rsi],r9d - shr r9,32 - mov DWORD PTR[256+rsi],r10d - shr r10,32 - mov DWORD PTR[384+rsi],r11d - shr r11,32 - mov DWORD PTR[512+rsi],r12d - shr r12,32 - mov DWORD PTR[640+rsi],r13d - shr r13,32 - mov DWORD PTR[768+rsi],r14d - shr r14,32 - mov DWORD PTR[896+rsi],r15d - shr r15,32 - mov DWORD PTR[64+rsi],r8d - mov DWORD PTR[192+rsi],r9d - mov DWORD PTR[320+rsi],r10d - mov DWORD PTR[448+rsi],r11d - mov DWORD PTR[576+rsi],r12d - mov DWORD PTR[704+rsi],r13d - mov DWORD PTR[832+rsi],r14d - mov DWORD PTR[960+rsi],r15d + mov QWORD PTR[rsi],r8 + mov QWORD PTR[128+rsi],r9 + mov QWORD PTR[256+rsi],r10 + mov QWORD PTR[384+rsi],r11 + mov QWORD PTR[512+rsi],r12 + mov QWORD PTR[640+rsi],r13 + mov QWORD PTR[768+rsi],r14 + mov QWORD PTR[896+rsi],r15 lea rax,QWORD PTR[((128+24+48))+rsp] mov r15,QWORD PTR[((-48))+rax] @@ -1151,16 +1223,14 @@ PUBLIC rsaz_512_scatter4 ALIGN 16 rsaz_512_scatter4 PROC PUBLIC - lea rcx,QWORD PTR[r8*4+rcx] + lea rcx,QWORD PTR[r8*8+rcx] mov r9d,8 jmp $L$oop_scatter ALIGN 16 $L$oop_scatter:: mov rax,QWORD PTR[rdx] lea rdx,QWORD PTR[8+rdx] - mov DWORD PTR[rcx],eax - shr rax,32 - mov DWORD PTR[64+rcx],eax + mov QWORD PTR[rcx],rax lea rcx,QWORD PTR[128+rcx] dec r9d jnz $L$oop_scatter @@ -1171,22 +1241,98 @@ PUBLIC rsaz_512_gather4 ALIGN 16 rsaz_512_gather4 PROC PUBLIC - lea rdx,QWORD PTR[r8*4+rdx] +$L$SEH_begin_rsaz_512_gather4:: +DB 048h,081h,0ech,0a8h,000h,000h,000h +DB 00fh,029h,034h,024h +DB 00fh,029h,07ch,024h,010h +DB 044h,00fh,029h,044h,024h,020h +DB 044h,00fh,029h,04ch,024h,030h +DB 044h,00fh,029h,054h,024h,040h +DB 044h,00fh,029h,05ch,024h,050h +DB 044h,00fh,029h,064h,024h,060h +DB 044h,00fh,029h,06ch,024h,070h +DB 044h,00fh,029h,0b4h,024h,080h,0,0,0 +DB 044h,00fh,029h,0bch,024h,090h,0,0,0 + movd xmm8,r8d + movdqa xmm1,XMMWORD PTR[(($L$inc+16))] + movdqa xmm0,XMMWORD PTR[$L$inc] + + pshufd xmm8,xmm8,0 + movdqa xmm7,xmm1 + movdqa xmm2,xmm1 + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm8 + movdqa xmm3,xmm7 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm8 + movdqa xmm4,xmm7 + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm8 + movdqa xmm5,xmm7 + paddd xmm4,xmm3 + pcmpeqd xmm3,xmm8 + movdqa xmm6,xmm7 + paddd xmm5,xmm4 + pcmpeqd xmm4,xmm8 + paddd xmm6,xmm5 + pcmpeqd xmm5,xmm8 + paddd xmm7,xmm6 + pcmpeqd xmm6,xmm8 + pcmpeqd xmm7,xmm8 mov r9d,8 jmp $L$oop_gather ALIGN 16 $L$oop_gather:: - mov eax,DWORD PTR[rdx] - mov r8d,DWORD PTR[64+rdx] + movdqa xmm8,XMMWORD PTR[rdx] + movdqa xmm9,XMMWORD PTR[16+rdx] + movdqa xmm10,XMMWORD PTR[32+rdx] + movdqa xmm11,XMMWORD PTR[48+rdx] + pand xmm8,xmm0 + movdqa xmm12,XMMWORD PTR[64+rdx] + pand xmm9,xmm1 + movdqa xmm13,XMMWORD PTR[80+rdx] + pand xmm10,xmm2 + movdqa xmm14,XMMWORD PTR[96+rdx] + pand xmm11,xmm3 + movdqa xmm15,XMMWORD PTR[112+rdx] lea rdx,QWORD PTR[128+rdx] - shl r8,32 - or rax,r8 - mov QWORD PTR[rcx],rax + pand xmm12,xmm4 + pand xmm13,xmm5 + pand xmm14,xmm6 + pand xmm15,xmm7 + por xmm8,xmm10 + por xmm9,xmm11 + por xmm8,xmm12 + por xmm9,xmm13 + por xmm8,xmm14 + por xmm9,xmm15 + + por xmm8,xmm9 + pshufd xmm9,xmm8,04eh + por xmm8,xmm9 + movq QWORD PTR[rcx],xmm8 lea rcx,QWORD PTR[8+rcx] dec r9d jnz $L$oop_gather + movaps xmm6,XMMWORD PTR[rsp] + movaps xmm7,XMMWORD PTR[16+rsp] + movaps xmm8,XMMWORD PTR[32+rsp] + movaps xmm9,XMMWORD PTR[48+rsp] + movaps xmm10,XMMWORD PTR[64+rsp] + movaps xmm11,XMMWORD PTR[80+rsp] + movaps xmm12,XMMWORD PTR[96+rsp] + movaps xmm13,XMMWORD PTR[112+rsp] + movaps xmm14,XMMWORD PTR[128+rsp] + movaps xmm15,XMMWORD PTR[144+rsp] + add rsp,0a8h DB 0F3h,0C3h ;repret +$L$SEH_end_rsaz_512_gather4:: rsaz_512_gather4 ENDP + +ALIGN 64 +$L$inc:: + DD 0,0,1,1 + DD 2,2,2,2 EXTERN __imp_RtlVirtualUnwind:NEAR ALIGN 16 @@ -1222,6 +1368,18 @@ se_handler PROC PRIVATE lea rax,QWORD PTR[((128+24+48))+rax] + lea rbx,QWORD PTR[$L$mul_gather4_epilogue] + cmp rbx,r10 + jne $L$se_not_in_mul_gather4 + + lea rax,QWORD PTR[176+rax] + + lea rsi,QWORD PTR[((-48-168))+rax] + lea rdi,QWORD PTR[512+r8] + mov ecx,20 + DD 0a548f3fch + +$L$se_not_in_mul_gather4:: mov rbx,QWORD PTR[((-8))+rax] mov rbp,QWORD PTR[((-16))+rax] mov r12,QWORD PTR[((-24))+rax] @@ -1298,6 +1456,10 @@ ALIGN 4 DD imagerel $L$SEH_end_rsaz_512_mul_by_one DD imagerel $L$SEH_info_rsaz_512_mul_by_one + DD imagerel $L$SEH_begin_rsaz_512_gather4 + DD imagerel $L$SEH_end_rsaz_512_gather4 + DD imagerel $L$SEH_info_rsaz_512_gather4 + .pdata ENDS .xdata SEGMENT READONLY ALIGN(8) ALIGN 8 @@ -1321,6 +1483,19 @@ $L$SEH_info_rsaz_512_mul_by_one:: DB 9,0,0,0 DD imagerel se_handler DD imagerel $L$mul_by_one_body,imagerel $L$mul_by_one_epilogue +$L$SEH_info_rsaz_512_gather4:: +DB 001h,046h,016h,000h +DB 046h,0f8h,009h,000h +DB 03dh,0e8h,008h,000h +DB 034h,0d8h,007h,000h +DB 02eh,0c8h,006h,000h +DB 028h,0b8h,005h,000h +DB 022h,0a8h,004h,000h +DB 01ch,098h,003h,000h +DB 016h,088h,002h,000h +DB 010h,078h,001h,000h +DB 00bh,068h,000h,000h +DB 007h,001h,015h,000h .xdata ENDS END diff --git a/deps/openssl/asm_obsolete/x64-win32-masm/bn/x86_64-mont.asm b/deps/openssl/asm_obsolete/x64-win32-masm/bn/x86_64-mont.asm index afec83bd17596c..e24eb89aeee6f2 100644 --- a/deps/openssl/asm_obsolete/x64-win32-masm/bn/x86_64-mont.asm +++ b/deps/openssl/asm_obsolete/x64-win32-masm/bn/x86_64-mont.asm @@ -676,20 +676,20 @@ $L$sqr8x_enter:: - lea r11,QWORD PTR[((-64))+r9*4+rsp] + lea r11,QWORD PTR[((-64))+r9*2+rsp] mov r8,QWORD PTR[r8] sub r11,rsi and r11,4095 cmp r10,r11 jb $L$sqr8x_sp_alt sub rsp,r11 - lea rsp,QWORD PTR[((-64))+r9*4+rsp] + lea rsp,QWORD PTR[((-64))+r9*2+rsp] jmp $L$sqr8x_sp_done ALIGN 32 $L$sqr8x_sp_alt:: - lea r10,QWORD PTR[((4096-64))+r9*4] - lea rsp,QWORD PTR[((-64))+r9*4+rsp] + lea r10,QWORD PTR[((4096-64))+r9*2] + lea rsp,QWORD PTR[((-64))+r9*2+rsp] sub r11,r10 mov r10,0 cmovc r11,r10 @@ -699,58 +699,80 @@ $L$sqr8x_sp_done:: mov r10,r9 neg r9 - lea r11,QWORD PTR[64+r9*2+rsp] mov QWORD PTR[32+rsp],r8 mov QWORD PTR[40+rsp],rax $L$sqr8x_body:: - mov rbp,r9 -DB 102,73,15,110,211 - shr rbp,3+2 - mov eax,DWORD PTR[((OPENSSL_ia32cap_P+8))] - jmp $L$sqr8x_copy_n - -ALIGN 32 -$L$sqr8x_copy_n:: - movq xmm0,QWORD PTR[rcx] - movq xmm1,QWORD PTR[8+rcx] - movq xmm3,QWORD PTR[16+rcx] - movq xmm4,QWORD PTR[24+rcx] - lea rcx,QWORD PTR[32+rcx] - movdqa XMMWORD PTR[r11],xmm0 - movdqa XMMWORD PTR[16+r11],xmm1 - movdqa XMMWORD PTR[32+r11],xmm3 - movdqa XMMWORD PTR[48+r11],xmm4 - lea r11,QWORD PTR[64+r11] - dec rbp - jnz $L$sqr8x_copy_n - +DB 102,72,15,110,209 pxor xmm0,xmm0 DB 102,72,15,110,207 DB 102,73,15,110,218 call bn_sqr8x_internal + + + + lea rbx,QWORD PTR[r9*1+rdi] + mov rcx,r9 + mov rdx,r9 +DB 102,72,15,126,207 + sar rcx,3+2 + jmp $L$sqr8x_sub + +ALIGN 32 +$L$sqr8x_sub:: + mov r12,QWORD PTR[rbx] + mov r13,QWORD PTR[8+rbx] + mov r14,QWORD PTR[16+rbx] + mov r15,QWORD PTR[24+rbx] + lea rbx,QWORD PTR[32+rbx] + sbb r12,QWORD PTR[rbp] + sbb r13,QWORD PTR[8+rbp] + sbb r14,QWORD PTR[16+rbp] + sbb r15,QWORD PTR[24+rbp] + lea rbp,QWORD PTR[32+rbp] + mov QWORD PTR[rdi],r12 + mov QWORD PTR[8+rdi],r13 + mov QWORD PTR[16+rdi],r14 + mov QWORD PTR[24+rdi],r15 + lea rdi,QWORD PTR[32+rdi] + inc rcx + jnz $L$sqr8x_sub + + sbb rax,0 + lea rbx,QWORD PTR[r9*1+rbx] + lea rdi,QWORD PTR[r9*1+rdi] + +DB 102,72,15,110,200 pxor xmm0,xmm0 - lea rax,QWORD PTR[48+rsp] - lea rdx,QWORD PTR[64+r9*2+rsp] - shr r9,3+2 + pshufd xmm1,xmm1,0 mov rsi,QWORD PTR[40+rsp] - jmp $L$sqr8x_zero + jmp $L$sqr8x_cond_copy ALIGN 32 -$L$sqr8x_zero:: - movdqa XMMWORD PTR[rax],xmm0 - movdqa XMMWORD PTR[16+rax],xmm0 - movdqa XMMWORD PTR[32+rax],xmm0 - movdqa XMMWORD PTR[48+rax],xmm0 - lea rax,QWORD PTR[64+rax] - movdqa XMMWORD PTR[rdx],xmm0 - movdqa XMMWORD PTR[16+rdx],xmm0 - movdqa XMMWORD PTR[32+rdx],xmm0 - movdqa XMMWORD PTR[48+rdx],xmm0 - lea rdx,QWORD PTR[64+rdx] - dec r9 - jnz $L$sqr8x_zero +$L$sqr8x_cond_copy:: + movdqa xmm2,XMMWORD PTR[rbx] + movdqa xmm3,XMMWORD PTR[16+rbx] + lea rbx,QWORD PTR[32+rbx] + movdqu xmm4,XMMWORD PTR[rdi] + movdqu xmm5,XMMWORD PTR[16+rdi] + lea rdi,QWORD PTR[32+rdi] + movdqa XMMWORD PTR[(-32)+rbx],xmm0 + movdqa XMMWORD PTR[(-16)+rbx],xmm0 + movdqa XMMWORD PTR[(-32)+rdx*1+rbx],xmm0 + movdqa XMMWORD PTR[(-16)+rdx*1+rbx],xmm0 + pcmpeqd xmm0,xmm1 + pand xmm2,xmm1 + pand xmm3,xmm1 + pand xmm4,xmm0 + pand xmm5,xmm0 + pxor xmm0,xmm0 + por xmm4,xmm2 + por xmm5,xmm3 + movdqu XMMWORD PTR[(-32)+rdi],xmm4 + movdqu XMMWORD PTR[(-16)+rdi],xmm5 + add r9,32 + jnz $L$sqr8x_cond_copy mov rax,1 mov r15,QWORD PTR[((-48))+rsi] diff --git a/deps/openssl/asm_obsolete/x64-win32-masm/bn/x86_64-mont5.asm b/deps/openssl/asm_obsolete/x64-win32-masm/bn/x86_64-mont5.asm index f690ba58d37f19..503e2d6a038ee6 100644 --- a/deps/openssl/asm_obsolete/x64-win32-masm/bn/x86_64-mont5.asm +++ b/deps/openssl/asm_obsolete/x64-win32-masm/bn/x86_64-mont5.asm @@ -27,49 +27,151 @@ ALIGN 16 $L$mul_enter:: mov r9d,r9d mov rax,rsp - mov r10d,DWORD PTR[56+rsp] + movd xmm5,DWORD PTR[56+rsp] + lea r10,QWORD PTR[$L$inc] push rbx push rbp push r12 push r13 push r14 push r15 - lea rsp,QWORD PTR[((-40))+rsp] - movaps XMMWORD PTR[rsp],xmm6 - movaps XMMWORD PTR[16+rsp],xmm7 + lea r11,QWORD PTR[2+r9] neg r11 - lea rsp,QWORD PTR[r11*8+rsp] + lea rsp,QWORD PTR[((-264))+r11*8+rsp] and rsp,-1024 mov QWORD PTR[8+r9*8+rsp],rax $L$mul_body:: - mov r12,rdx - mov r11,r10 - shr r10,3 - and r11,7 - not r10 - lea rax,QWORD PTR[$L$magic_masks] - and r10,3 - lea r12,QWORD PTR[96+r11*8+r12] - movq xmm4,QWORD PTR[r10*8+rax] - movq xmm5,QWORD PTR[8+r10*8+rax] - movq xmm6,QWORD PTR[16+r10*8+rax] - movq xmm7,QWORD PTR[24+r10*8+rax] - - movq xmm0,QWORD PTR[((-96))+r12] - movq xmm1,QWORD PTR[((-32))+r12] - pand xmm0,xmm4 - movq xmm2,QWORD PTR[32+r12] - pand xmm1,xmm5 - movq xmm3,QWORD PTR[96+r12] - pand xmm2,xmm6 - por xmm0,xmm1 - pand xmm3,xmm7 + lea r12,QWORD PTR[128+rdx] + movdqa xmm0,XMMWORD PTR[r10] + movdqa xmm1,XMMWORD PTR[16+r10] + lea r10,QWORD PTR[((24-112))+r9*8+rsp] + and r10,-16 + + pshufd xmm5,xmm5,0 + movdqa xmm4,xmm1 + movdqa xmm2,xmm1 + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 +DB 067h + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[112+r10],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[128+r10],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[144+r10],xmm2 + movdqa xmm2,xmm4 + + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[160+r10],xmm3 + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[176+r10],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[192+r10],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[208+r10],xmm2 + movdqa xmm2,xmm4 + + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[224+r10],xmm3 + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[240+r10],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[256+r10],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[272+r10],xmm2 + movdqa xmm2,xmm4 + + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[288+r10],xmm3 + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[304+r10],xmm0 + + paddd xmm3,xmm2 +DB 067h + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[320+r10],xmm1 + + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[336+r10],xmm2 + pand xmm0,XMMWORD PTR[64+r12] + + pand xmm1,XMMWORD PTR[80+r12] + pand xmm2,XMMWORD PTR[96+r12] + movdqa XMMWORD PTR[352+r10],xmm3 + pand xmm3,XMMWORD PTR[112+r12] + por xmm0,xmm2 + por xmm1,xmm3 + movdqa xmm4,XMMWORD PTR[((-128))+r12] + movdqa xmm5,XMMWORD PTR[((-112))+r12] + movdqa xmm2,XMMWORD PTR[((-96))+r12] + pand xmm4,XMMWORD PTR[112+r10] + movdqa xmm3,XMMWORD PTR[((-80))+r12] + pand xmm5,XMMWORD PTR[128+r10] + por xmm0,xmm4 + pand xmm2,XMMWORD PTR[144+r10] + por xmm1,xmm5 + pand xmm3,XMMWORD PTR[160+r10] por xmm0,xmm2 + por xmm1,xmm3 + movdqa xmm4,XMMWORD PTR[((-64))+r12] + movdqa xmm5,XMMWORD PTR[((-48))+r12] + movdqa xmm2,XMMWORD PTR[((-32))+r12] + pand xmm4,XMMWORD PTR[176+r10] + movdqa xmm3,XMMWORD PTR[((-16))+r12] + pand xmm5,XMMWORD PTR[192+r10] + por xmm0,xmm4 + pand xmm2,XMMWORD PTR[208+r10] + por xmm1,xmm5 + pand xmm3,XMMWORD PTR[224+r10] + por xmm0,xmm2 + por xmm1,xmm3 + movdqa xmm4,XMMWORD PTR[r12] + movdqa xmm5,XMMWORD PTR[16+r12] + movdqa xmm2,XMMWORD PTR[32+r12] + pand xmm4,XMMWORD PTR[240+r10] + movdqa xmm3,XMMWORD PTR[48+r12] + pand xmm5,XMMWORD PTR[256+r10] + por xmm0,xmm4 + pand xmm2,XMMWORD PTR[272+r10] + por xmm1,xmm5 + pand xmm3,XMMWORD PTR[288+r10] + por xmm0,xmm2 + por xmm1,xmm3 + por xmm0,xmm1 + pshufd xmm1,xmm0,04eh + por xmm0,xmm1 lea r12,QWORD PTR[256+r12] - por xmm0,xmm3 - DB 102,72,15,126,195 mov r8,QWORD PTR[r8] @@ -78,29 +180,14 @@ DB 102,72,15,126,195 xor r14,r14 xor r15,r15 - movq xmm0,QWORD PTR[((-96))+r12] - movq xmm1,QWORD PTR[((-32))+r12] - pand xmm0,xmm4 - movq xmm2,QWORD PTR[32+r12] - pand xmm1,xmm5 - mov rbp,r8 mul rbx mov r10,rax mov rax,QWORD PTR[rcx] - movq xmm3,QWORD PTR[96+r12] - pand xmm2,xmm6 - por xmm0,xmm1 - pand xmm3,xmm7 - imul rbp,r10 mov r11,rdx - por xmm0,xmm2 - lea r12,QWORD PTR[256+r12] - por xmm0,xmm3 - mul rbp add r10,rax mov rax,QWORD PTR[8+rsi] @@ -133,14 +220,12 @@ $L$1st_enter:: cmp r15,r9 jne $L$1st -DB 102,72,15,126,195 add r13,rax - mov rax,QWORD PTR[rsi] adc rdx,0 add r13,r11 adc rdx,0 - mov QWORD PTR[((-16))+r15*8+rsp],r13 + mov QWORD PTR[((-16))+r9*8+rsp],r13 mov r13,rdx mov r11,r10 @@ -154,33 +239,78 @@ DB 102,72,15,126,195 jmp $L$outer ALIGN 16 $L$outer:: + lea rdx,QWORD PTR[((24+128))+r9*8+rsp] + and rdx,-16 + pxor xmm4,xmm4 + pxor xmm5,xmm5 + movdqa xmm0,XMMWORD PTR[((-128))+r12] + movdqa xmm1,XMMWORD PTR[((-112))+r12] + movdqa xmm2,XMMWORD PTR[((-96))+r12] + movdqa xmm3,XMMWORD PTR[((-80))+r12] + pand xmm0,XMMWORD PTR[((-128))+rdx] + pand xmm1,XMMWORD PTR[((-112))+rdx] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[((-96))+rdx] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[((-80))+rdx] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[((-64))+r12] + movdqa xmm1,XMMWORD PTR[((-48))+r12] + movdqa xmm2,XMMWORD PTR[((-32))+r12] + movdqa xmm3,XMMWORD PTR[((-16))+r12] + pand xmm0,XMMWORD PTR[((-64))+rdx] + pand xmm1,XMMWORD PTR[((-48))+rdx] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[((-32))+rdx] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[((-16))+rdx] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[r12] + movdqa xmm1,XMMWORD PTR[16+r12] + movdqa xmm2,XMMWORD PTR[32+r12] + movdqa xmm3,XMMWORD PTR[48+r12] + pand xmm0,XMMWORD PTR[rdx] + pand xmm1,XMMWORD PTR[16+rdx] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[32+rdx] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[48+rdx] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[64+r12] + movdqa xmm1,XMMWORD PTR[80+r12] + movdqa xmm2,XMMWORD PTR[96+r12] + movdqa xmm3,XMMWORD PTR[112+r12] + pand xmm0,XMMWORD PTR[64+rdx] + pand xmm1,XMMWORD PTR[80+rdx] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[96+rdx] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[112+rdx] + por xmm4,xmm2 + por xmm5,xmm3 + por xmm4,xmm5 + pshufd xmm0,xmm4,04eh + por xmm0,xmm4 + lea r12,QWORD PTR[256+r12] + + mov rax,QWORD PTR[rsi] +DB 102,72,15,126,195 + xor r15,r15 mov rbp,r8 mov r10,QWORD PTR[rsp] - movq xmm0,QWORD PTR[((-96))+r12] - movq xmm1,QWORD PTR[((-32))+r12] - pand xmm0,xmm4 - movq xmm2,QWORD PTR[32+r12] - pand xmm1,xmm5 - mul rbx add r10,rax mov rax,QWORD PTR[rcx] adc rdx,0 - movq xmm3,QWORD PTR[96+r12] - pand xmm2,xmm6 - por xmm0,xmm1 - pand xmm3,xmm7 - imul rbp,r10 mov r11,rdx - por xmm0,xmm2 - lea r12,QWORD PTR[256+r12] - por xmm0,xmm3 - mul rbp add r10,rax mov rax,QWORD PTR[8+rsi] @@ -216,15 +346,12 @@ $L$inner_enter:: cmp r15,r9 jne $L$inner -DB 102,72,15,126,195 - add r13,rax - mov rax,QWORD PTR[rsi] adc rdx,0 add r13,r10 - mov r10,QWORD PTR[r15*8+rsp] + mov r10,QWORD PTR[r9*8+rsp] adc rdx,0 - mov QWORD PTR[((-16))+r15*8+rsp],r13 + mov QWORD PTR[((-16))+r9*8+rsp],r13 mov r13,rdx xor rdx,rdx @@ -271,8 +398,7 @@ $L$copy:: mov rsi,QWORD PTR[8+r9*8+rsp] mov rax,1 - movaps xmm6,XMMWORD PTR[((-88))+rsi] - movaps xmm7,XMMWORD PTR[((-72))+rsi] + mov r15,QWORD PTR[((-48))+rsi] mov r14,QWORD PTR[((-40))+rsi] mov r13,QWORD PTR[((-32))+rsi] @@ -310,13 +436,10 @@ DB 067h push r13 push r14 push r15 - lea rsp,QWORD PTR[((-40))+rsp] - movaps XMMWORD PTR[rsp],xmm6 - movaps XMMWORD PTR[16+rsp],xmm7 + DB 067h - mov r10d,r9d shl r9d,3 - shl r10d,3+2 + lea r10,QWORD PTR[r9*2+r9] neg r9 @@ -326,19 +449,21 @@ DB 067h - lea r11,QWORD PTR[((-64))+r9*2+rsp] - sub r11,rsi + + + lea r11,QWORD PTR[((-320))+r9*2+rsp] + sub r11,rdi and r11,4095 cmp r10,r11 jb $L$mul4xsp_alt sub rsp,r11 - lea rsp,QWORD PTR[((-64))+r9*2+rsp] + lea rsp,QWORD PTR[((-320))+r9*2+rsp] jmp $L$mul4xsp_done ALIGN 32 $L$mul4xsp_alt:: - lea r10,QWORD PTR[((4096-64))+r9*2] - lea rsp,QWORD PTR[((-64))+r9*2+rsp] + lea r10,QWORD PTR[((4096-320))+r9*2] + lea rsp,QWORD PTR[((-320))+r9*2+rsp] sub r11,r10 mov r10,0 cmovc r11,r10 @@ -354,8 +479,7 @@ $L$mul4x_body:: mov rsi,QWORD PTR[40+rsp] mov rax,1 - movaps xmm6,XMMWORD PTR[((-88))+rsi] - movaps xmm7,XMMWORD PTR[((-72))+rsi] + mov r15,QWORD PTR[((-48))+rsi] mov r14,QWORD PTR[((-40))+rsi] mov r13,QWORD PTR[((-32))+rsi] @@ -374,47 +498,141 @@ bn_mul4x_mont_gather5 ENDP ALIGN 32 mul4x_internal PROC PRIVATE shl r9,5 - mov r10d,DWORD PTR[56+rax] - lea r13,QWORD PTR[256+r9*1+rdx] + movd xmm5,DWORD PTR[56+rax] + lea rax,QWORD PTR[$L$inc] + lea r13,QWORD PTR[128+r9*1+rdx] shr r9,5 - mov r11,r10 - shr r10,3 - and r11,7 - not r10 - lea rax,QWORD PTR[$L$magic_masks] - and r10,3 - lea r12,QWORD PTR[96+r11*8+rdx] - movq xmm4,QWORD PTR[r10*8+rax] - movq xmm5,QWORD PTR[8+r10*8+rax] - add r11,7 - movq xmm6,QWORD PTR[16+r10*8+rax] - movq xmm7,QWORD PTR[24+r10*8+rax] - and r11,7 - - movq xmm0,QWORD PTR[((-96))+r12] - lea r14,QWORD PTR[256+r12] - movq xmm1,QWORD PTR[((-32))+r12] - pand xmm0,xmm4 - movq xmm2,QWORD PTR[32+r12] - pand xmm1,xmm5 - movq xmm3,QWORD PTR[96+r12] - pand xmm2,xmm6 -DB 067h - por xmm0,xmm1 - movq xmm1,QWORD PTR[((-96))+r14] -DB 067h - pand xmm3,xmm7 -DB 067h - por xmm0,xmm2 - movq xmm2,QWORD PTR[((-32))+r14] + movdqa xmm0,XMMWORD PTR[rax] + movdqa xmm1,XMMWORD PTR[16+rax] + lea r10,QWORD PTR[((88-112))+r9*1+rsp] + lea r12,QWORD PTR[128+rdx] + + pshufd xmm5,xmm5,0 + movdqa xmm4,xmm1 +DB 067h,067h + movdqa xmm2,xmm1 + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 DB 067h - pand xmm1,xmm4 + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[112+r10],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[128+r10],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[144+r10],xmm2 + movdqa xmm2,xmm4 + + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[160+r10],xmm3 + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[176+r10],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[192+r10],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[208+r10],xmm2 + movdqa xmm2,xmm4 + + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[224+r10],xmm3 + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[240+r10],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[256+r10],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[272+r10],xmm2 + movdqa xmm2,xmm4 + + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[288+r10],xmm3 + movdqa xmm3,xmm4 + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[304+r10],xmm0 + + paddd xmm3,xmm2 DB 067h - por xmm0,xmm3 - movq xmm3,QWORD PTR[32+r14] + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[320+r10],xmm1 + + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[336+r10],xmm2 + pand xmm0,XMMWORD PTR[64+r12] + pand xmm1,XMMWORD PTR[80+r12] + pand xmm2,XMMWORD PTR[96+r12] + movdqa XMMWORD PTR[352+r10],xmm3 + pand xmm3,XMMWORD PTR[112+r12] + por xmm0,xmm2 + por xmm1,xmm3 + movdqa xmm4,XMMWORD PTR[((-128))+r12] + movdqa xmm5,XMMWORD PTR[((-112))+r12] + movdqa xmm2,XMMWORD PTR[((-96))+r12] + pand xmm4,XMMWORD PTR[112+r10] + movdqa xmm3,XMMWORD PTR[((-80))+r12] + pand xmm5,XMMWORD PTR[128+r10] + por xmm0,xmm4 + pand xmm2,XMMWORD PTR[144+r10] + por xmm1,xmm5 + pand xmm3,XMMWORD PTR[160+r10] + por xmm0,xmm2 + por xmm1,xmm3 + movdqa xmm4,XMMWORD PTR[((-64))+r12] + movdqa xmm5,XMMWORD PTR[((-48))+r12] + movdqa xmm2,XMMWORD PTR[((-32))+r12] + pand xmm4,XMMWORD PTR[176+r10] + movdqa xmm3,XMMWORD PTR[((-16))+r12] + pand xmm5,XMMWORD PTR[192+r10] + por xmm0,xmm4 + pand xmm2,XMMWORD PTR[208+r10] + por xmm1,xmm5 + pand xmm3,XMMWORD PTR[224+r10] + por xmm0,xmm2 + por xmm1,xmm3 + movdqa xmm4,XMMWORD PTR[r12] + movdqa xmm5,XMMWORD PTR[16+r12] + movdqa xmm2,XMMWORD PTR[32+r12] + pand xmm4,XMMWORD PTR[240+r10] + movdqa xmm3,XMMWORD PTR[48+r12] + pand xmm5,XMMWORD PTR[256+r10] + por xmm0,xmm4 + pand xmm2,XMMWORD PTR[272+r10] + por xmm1,xmm5 + pand xmm3,XMMWORD PTR[288+r10] + por xmm0,xmm2 + por xmm1,xmm3 + por xmm0,xmm1 + pshufd xmm1,xmm0,04eh + por xmm0,xmm1 + lea r12,QWORD PTR[256+r12] DB 102,72,15,126,195 - movq xmm0,QWORD PTR[96+r14] + mov QWORD PTR[((16+8))+rsp],r13 mov QWORD PTR[((56+8))+rsp],rdi @@ -428,26 +646,10 @@ DB 102,72,15,126,195 mov r10,rax mov rax,QWORD PTR[rcx] - pand xmm2,xmm5 - pand xmm3,xmm6 - por xmm1,xmm2 - imul rbp,r10 - - - - - - - - lea r14,QWORD PTR[((64+8))+r11*8+rsp] + lea r14,QWORD PTR[((64+8))+rsp] mov r11,rdx - pand xmm0,xmm7 - por xmm1,xmm3 - lea r12,QWORD PTR[512+r12] - por xmm0,xmm1 - mul rbp add r10,rax mov rax,QWORD PTR[8+r9*1+rsi] @@ -456,7 +658,7 @@ DB 102,72,15,126,195 mul rbx add r11,rax - mov rax,QWORD PTR[16+rcx] + mov rax,QWORD PTR[8+rcx] adc rdx,0 mov r10,rdx @@ -466,7 +668,7 @@ DB 102,72,15,126,195 adc rdx,0 add rdi,r11 lea r15,QWORD PTR[32+r9] - lea rcx,QWORD PTR[64+rcx] + lea rcx,QWORD PTR[32+rcx] adc rdx,0 mov QWORD PTR[r14],rdi mov r13,rdx @@ -476,7 +678,7 @@ ALIGN 32 $L$1st4x:: mul rbx add r10,rax - mov rax,QWORD PTR[((-32))+rcx] + mov rax,QWORD PTR[((-16))+rcx] lea r14,QWORD PTR[32+r14] adc rdx,0 mov r11,rdx @@ -492,7 +694,7 @@ $L$1st4x:: mul rbx add r11,rax - mov rax,QWORD PTR[((-16))+rcx] + mov rax,QWORD PTR[((-8))+rcx] adc rdx,0 mov r10,rdx @@ -522,7 +724,7 @@ $L$1st4x:: mul rbx add r11,rax - mov rax,QWORD PTR[16+rcx] + mov rax,QWORD PTR[8+rcx] adc rdx,0 mov r10,rdx @@ -531,7 +733,7 @@ $L$1st4x:: mov rax,QWORD PTR[16+r15*1+rsi] adc rdx,0 add rdi,r11 - lea rcx,QWORD PTR[64+rcx] + lea rcx,QWORD PTR[32+rcx] adc rdx,0 mov QWORD PTR[r14],rdi mov r13,rdx @@ -541,7 +743,7 @@ $L$1st4x:: mul rbx add r10,rax - mov rax,QWORD PTR[((-32))+rcx] + mov rax,QWORD PTR[((-16))+rcx] lea r14,QWORD PTR[32+r14] adc rdx,0 mov r11,rdx @@ -557,7 +759,7 @@ $L$1st4x:: mul rbx add r11,rax - mov rax,QWORD PTR[((-16))+rcx] + mov rax,QWORD PTR[((-8))+rcx] adc rdx,0 mov r10,rdx @@ -570,8 +772,7 @@ $L$1st4x:: mov QWORD PTR[((-16))+r14],rdi mov r13,rdx -DB 102,72,15,126,195 - lea rcx,QWORD PTR[r9*2+rcx] + lea rcx,QWORD PTR[r9*1+rcx] xor rdi,rdi add r13,r10 @@ -582,6 +783,63 @@ DB 102,72,15,126,195 ALIGN 32 $L$outer4x:: + lea rdx,QWORD PTR[((16+128))+r14] + pxor xmm4,xmm4 + pxor xmm5,xmm5 + movdqa xmm0,XMMWORD PTR[((-128))+r12] + movdqa xmm1,XMMWORD PTR[((-112))+r12] + movdqa xmm2,XMMWORD PTR[((-96))+r12] + movdqa xmm3,XMMWORD PTR[((-80))+r12] + pand xmm0,XMMWORD PTR[((-128))+rdx] + pand xmm1,XMMWORD PTR[((-112))+rdx] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[((-96))+rdx] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[((-80))+rdx] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[((-64))+r12] + movdqa xmm1,XMMWORD PTR[((-48))+r12] + movdqa xmm2,XMMWORD PTR[((-32))+r12] + movdqa xmm3,XMMWORD PTR[((-16))+r12] + pand xmm0,XMMWORD PTR[((-64))+rdx] + pand xmm1,XMMWORD PTR[((-48))+rdx] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[((-32))+rdx] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[((-16))+rdx] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[r12] + movdqa xmm1,XMMWORD PTR[16+r12] + movdqa xmm2,XMMWORD PTR[32+r12] + movdqa xmm3,XMMWORD PTR[48+r12] + pand xmm0,XMMWORD PTR[rdx] + pand xmm1,XMMWORD PTR[16+rdx] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[32+rdx] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[48+rdx] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[64+r12] + movdqa xmm1,XMMWORD PTR[80+r12] + movdqa xmm2,XMMWORD PTR[96+r12] + movdqa xmm3,XMMWORD PTR[112+r12] + pand xmm0,XMMWORD PTR[64+rdx] + pand xmm1,XMMWORD PTR[80+rdx] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[96+rdx] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[112+rdx] + por xmm4,xmm2 + por xmm5,xmm3 + por xmm4,xmm5 + pshufd xmm0,xmm4,04eh + por xmm0,xmm4 + lea r12,QWORD PTR[256+r12] +DB 102,72,15,126,195 + mov r10,QWORD PTR[r9*1+r14] mov rbp,r8 mul rbx @@ -589,25 +847,11 @@ $L$outer4x:: mov rax,QWORD PTR[rcx] adc rdx,0 - movq xmm0,QWORD PTR[((-96))+r12] - movq xmm1,QWORD PTR[((-32))+r12] - pand xmm0,xmm4 - movq xmm2,QWORD PTR[32+r12] - pand xmm1,xmm5 - movq xmm3,QWORD PTR[96+r12] - imul rbp,r10 -DB 067h mov r11,rdx mov QWORD PTR[r14],rdi - pand xmm2,xmm6 - por xmm0,xmm1 - pand xmm3,xmm7 - por xmm0,xmm2 lea r14,QWORD PTR[r9*1+r14] - lea r12,QWORD PTR[256+r12] - por xmm0,xmm3 mul rbp add r10,rax @@ -617,7 +861,7 @@ DB 067h mul rbx add r11,rax - mov rax,QWORD PTR[16+rcx] + mov rax,QWORD PTR[8+rcx] adc rdx,0 add r11,QWORD PTR[8+r14] adc rdx,0 @@ -629,7 +873,7 @@ DB 067h adc rdx,0 add rdi,r11 lea r15,QWORD PTR[32+r9] - lea rcx,QWORD PTR[64+rcx] + lea rcx,QWORD PTR[32+rcx] adc rdx,0 mov r13,rdx jmp $L$inner4x @@ -638,7 +882,7 @@ ALIGN 32 $L$inner4x:: mul rbx add r10,rax - mov rax,QWORD PTR[((-32))+rcx] + mov rax,QWORD PTR[((-16))+rcx] adc rdx,0 add r10,QWORD PTR[16+r14] lea r14,QWORD PTR[32+r14] @@ -656,7 +900,7 @@ $L$inner4x:: mul rbx add r11,rax - mov rax,QWORD PTR[((-16))+rcx] + mov rax,QWORD PTR[((-8))+rcx] adc rdx,0 add r11,QWORD PTR[((-8))+r14] adc rdx,0 @@ -690,7 +934,7 @@ $L$inner4x:: mul rbx add r11,rax - mov rax,QWORD PTR[16+rcx] + mov rax,QWORD PTR[8+rcx] adc rdx,0 add r11,QWORD PTR[8+r14] adc rdx,0 @@ -701,7 +945,7 @@ $L$inner4x:: mov rax,QWORD PTR[16+r15*1+rsi] adc rdx,0 add rdi,r11 - lea rcx,QWORD PTR[64+rcx] + lea rcx,QWORD PTR[32+rcx] adc rdx,0 mov QWORD PTR[((-8))+r14],r13 mov r13,rdx @@ -711,7 +955,7 @@ $L$inner4x:: mul rbx add r10,rax - mov rax,QWORD PTR[((-32))+rcx] + mov rax,QWORD PTR[((-16))+rcx] adc rdx,0 add r10,QWORD PTR[16+r14] lea r14,QWORD PTR[32+r14] @@ -730,7 +974,7 @@ $L$inner4x:: mul rbx add r11,rax mov rax,rbp - mov rbp,QWORD PTR[((-16))+rcx] + mov rbp,QWORD PTR[((-8))+rcx] adc rdx,0 add r11,QWORD PTR[((-8))+r14] adc rdx,0 @@ -745,9 +989,8 @@ $L$inner4x:: mov QWORD PTR[((-24))+r14],r13 mov r13,rdx -DB 102,72,15,126,195 mov QWORD PTR[((-16))+r14],rdi - lea rcx,QWORD PTR[r9*2+rcx] + lea rcx,QWORD PTR[r9*1+rcx] xor rdi,rdi add r13,r10 @@ -758,16 +1001,23 @@ DB 102,72,15,126,195 cmp r12,QWORD PTR[((16+8))+rsp] jb $L$outer4x + xor rax,rax sub rbp,r13 adc r15,r15 or rdi,r15 - xor rdi,1 + sub rax,rdi lea rbx,QWORD PTR[r9*1+r14] - lea rbp,QWORD PTR[rdi*8+rcx] + mov r12,QWORD PTR[rcx] + lea rbp,QWORD PTR[rcx] mov rcx,r9 sar rcx,3+2 mov rdi,QWORD PTR[((56+8))+rsp] - jmp $L$sqr4x_sub + dec r12 + xor r10,r10 + mov r13,QWORD PTR[8+rbp] + mov r14,QWORD PTR[16+rbp] + mov r15,QWORD PTR[24+rbp] + jmp $L$sqr4x_sub_entry mul4x_internal ENDP PUBLIC bn_power5 @@ -792,12 +1042,9 @@ $L$SEH_begin_bn_power5:: push r13 push r14 push r15 - lea rsp,QWORD PTR[((-40))+rsp] - movaps XMMWORD PTR[rsp],xmm6 - movaps XMMWORD PTR[16+rsp],xmm7 - mov r10d,r9d + shl r9d,3 - shl r10d,3+2 + lea r10d,DWORD PTR[r9*2+r9] neg r9 mov r8,QWORD PTR[r8] @@ -807,19 +1054,20 @@ $L$SEH_begin_bn_power5:: - lea r11,QWORD PTR[((-64))+r9*2+rsp] - sub r11,rsi + + lea r11,QWORD PTR[((-320))+r9*2+rsp] + sub r11,rdi and r11,4095 cmp r10,r11 jb $L$pwr_sp_alt sub rsp,r11 - lea rsp,QWORD PTR[((-64))+r9*2+rsp] + lea rsp,QWORD PTR[((-320))+r9*2+rsp] jmp $L$pwr_sp_done ALIGN 32 $L$pwr_sp_alt:: - lea r10,QWORD PTR[((4096-64))+r9*2] - lea rsp,QWORD PTR[((-64))+r9*2+rsp] + lea r10,QWORD PTR[((4096-320))+r9*2] + lea rsp,QWORD PTR[((-320))+r9*2+rsp] sub r11,r10 mov r10,0 cmovc r11,r10 @@ -847,10 +1095,15 @@ DB 102,73,15,110,218 DB 102,72,15,110,226 call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal DB 102,72,15,126,209 DB 102,72,15,126,226 @@ -1397,9 +1650,9 @@ DB 067h mov QWORD PTR[((-16))+rdi],rbx mov QWORD PTR[((-8))+rdi],r8 DB 102,72,15,126,213 -sqr8x_reduction:: +__bn_sqr8x_reduction:: xor rax,rax - lea rcx,QWORD PTR[r9*2+rbp] + lea rcx,QWORD PTR[rbp*1+r9] lea rdx,QWORD PTR[((48+8))+r9*2+rsp] mov QWORD PTR[((0+8))+rsp],rcx lea rdi,QWORD PTR[((48+8))+r9*1+rsp] @@ -1432,14 +1685,14 @@ DB 067h ALIGN 32 $L$8x_reduce:: mul rbx - mov rax,QWORD PTR[16+rbp] + mov rax,QWORD PTR[8+rbp] neg r8 mov r8,rdx adc r8,0 mul rbx add r9,rax - mov rax,QWORD PTR[32+rbp] + mov rax,QWORD PTR[16+rbp] adc rdx,0 add r8,r9 mov QWORD PTR[((48-8+8))+rcx*8+rsp],rbx @@ -1448,7 +1701,7 @@ $L$8x_reduce:: mul rbx add r10,rax - mov rax,QWORD PTR[48+rbp] + mov rax,QWORD PTR[24+rbp] adc rdx,0 add r9,r10 mov rsi,QWORD PTR[((32+8))+rsp] @@ -1457,7 +1710,7 @@ $L$8x_reduce:: mul rbx add r11,rax - mov rax,QWORD PTR[64+rbp] + mov rax,QWORD PTR[32+rbp] adc rdx,0 imul rsi,r8 add r10,r11 @@ -1466,7 +1719,7 @@ $L$8x_reduce:: mul rbx add r12,rax - mov rax,QWORD PTR[80+rbp] + mov rax,QWORD PTR[40+rbp] adc rdx,0 add r11,r12 mov r12,rdx @@ -1474,7 +1727,7 @@ $L$8x_reduce:: mul rbx add r13,rax - mov rax,QWORD PTR[96+rbp] + mov rax,QWORD PTR[48+rbp] adc rdx,0 add r12,r13 mov r13,rdx @@ -1482,7 +1735,7 @@ $L$8x_reduce:: mul rbx add r14,rax - mov rax,QWORD PTR[112+rbp] + mov rax,QWORD PTR[56+rbp] adc rdx,0 add r13,r14 mov r14,rdx @@ -1500,7 +1753,7 @@ $L$8x_reduce:: dec ecx jnz $L$8x_reduce - lea rbp,QWORD PTR[128+rbp] + lea rbp,QWORD PTR[64+rbp] xor rax,rax mov rdx,QWORD PTR[((8+8))+rsp] cmp rbp,QWORD PTR[((0+8))+rsp] @@ -1526,14 +1779,14 @@ ALIGN 32 $L$8x_tail:: mul rbx add r8,rax - mov rax,QWORD PTR[16+rbp] + mov rax,QWORD PTR[8+rbp] mov QWORD PTR[rdi],r8 mov r8,rdx adc r8,0 mul rbx add r9,rax - mov rax,QWORD PTR[32+rbp] + mov rax,QWORD PTR[16+rbp] adc rdx,0 add r8,r9 lea rdi,QWORD PTR[8+rdi] @@ -1542,7 +1795,7 @@ $L$8x_tail:: mul rbx add r10,rax - mov rax,QWORD PTR[48+rbp] + mov rax,QWORD PTR[24+rbp] adc rdx,0 add r9,r10 mov r10,rdx @@ -1550,7 +1803,7 @@ $L$8x_tail:: mul rbx add r11,rax - mov rax,QWORD PTR[64+rbp] + mov rax,QWORD PTR[32+rbp] adc rdx,0 add r10,r11 mov r11,rdx @@ -1558,7 +1811,7 @@ $L$8x_tail:: mul rbx add r12,rax - mov rax,QWORD PTR[80+rbp] + mov rax,QWORD PTR[40+rbp] adc rdx,0 add r11,r12 mov r12,rdx @@ -1566,7 +1819,7 @@ $L$8x_tail:: mul rbx add r13,rax - mov rax,QWORD PTR[96+rbp] + mov rax,QWORD PTR[48+rbp] adc rdx,0 add r12,r13 mov r13,rdx @@ -1574,7 +1827,7 @@ $L$8x_tail:: mul rbx add r14,rax - mov rax,QWORD PTR[112+rbp] + mov rax,QWORD PTR[56+rbp] adc rdx,0 add r13,r14 mov r14,rdx @@ -1592,7 +1845,7 @@ $L$8x_tail:: dec ecx jnz $L$8x_tail - lea rbp,QWORD PTR[128+rbp] + lea rbp,QWORD PTR[64+rbp] mov rdx,QWORD PTR[((8+8))+rsp] cmp rbp,QWORD PTR[((0+8))+rsp] jae $L$8x_tail_done @@ -1616,6 +1869,15 @@ $L$8x_tail:: ALIGN 32 $L$8x_tail_done:: add r8,QWORD PTR[rdx] + adc r9,0 + adc r10,0 + adc r11,0 + adc r12,0 + adc r13,0 + adc r14,0 + adc r15,0 + + xor rax,rax neg rsi @@ -1629,7 +1891,7 @@ $L$8x_no_tail:: adc r14,QWORD PTR[48+rdi] adc r15,QWORD PTR[56+rdi] adc rax,0 - mov rcx,QWORD PTR[((-16))+rbp] + mov rcx,QWORD PTR[((-8))+rbp] xor rsi,rsi DB 102,72,15,126,213 @@ -1647,44 +1909,62 @@ DB 102,73,15,126,217 cmp rdi,rdx jb $L$8x_reduction_loop + DB 0F3h,0C3h ;repret +bn_sqr8x_internal ENDP - sub rcx,r15 +ALIGN 32 +__bn_post4x_internal PROC PRIVATE + mov r12,QWORD PTR[rbp] lea rbx,QWORD PTR[r9*1+rdi] - adc rsi,rsi mov rcx,r9 - or rax,rsi DB 102,72,15,126,207 - xor rax,1 + neg rax DB 102,72,15,126,206 - lea rbp,QWORD PTR[rax*8+rbp] sar rcx,3+2 - jmp $L$sqr4x_sub + dec r12 + xor r10,r10 + mov r13,QWORD PTR[8+rbp] + mov r14,QWORD PTR[16+rbp] + mov r15,QWORD PTR[24+rbp] + jmp $L$sqr4x_sub_entry -ALIGN 32 +ALIGN 16 $L$sqr4x_sub:: -DB 066h - mov r12,QWORD PTR[rbx] - mov r13,QWORD PTR[8+rbx] - sbb r12,QWORD PTR[rbp] - mov r14,QWORD PTR[16+rbx] - sbb r13,QWORD PTR[16+rbp] - mov r15,QWORD PTR[24+rbx] - lea rbx,QWORD PTR[32+rbx] - sbb r14,QWORD PTR[32+rbp] + mov r12,QWORD PTR[rbp] + mov r13,QWORD PTR[8+rbp] + mov r14,QWORD PTR[16+rbp] + mov r15,QWORD PTR[24+rbp] +$L$sqr4x_sub_entry:: + lea rbp,QWORD PTR[32+rbp] + not r12 + not r13 + not r14 + not r15 + and r12,rax + and r13,rax + and r14,rax + and r15,rax + + neg r10 + adc r12,QWORD PTR[rbx] + adc r13,QWORD PTR[8+rbx] + adc r14,QWORD PTR[16+rbx] + adc r15,QWORD PTR[24+rbx] mov QWORD PTR[rdi],r12 - sbb r15,QWORD PTR[48+rbp] - lea rbp,QWORD PTR[64+rbp] + lea rbx,QWORD PTR[32+rbx] mov QWORD PTR[8+rdi],r13 + sbb r10,r10 mov QWORD PTR[16+rdi],r14 mov QWORD PTR[24+rdi],r15 lea rdi,QWORD PTR[32+rdi] inc rcx jnz $L$sqr4x_sub + mov r10,r9 neg r9 DB 0F3h,0C3h ;repret -bn_sqr8x_internal ENDP +__bn_post4x_internal ENDP PUBLIC bn_from_montgomery ALIGN 32 @@ -1718,13 +1998,9 @@ DB 067h push r13 push r14 push r15 - lea rsp,QWORD PTR[((-40))+rsp] - movaps XMMWORD PTR[rsp],xmm6 - movaps XMMWORD PTR[16+rsp],xmm7 -DB 067h - mov r10d,r9d + shl r9d,3 - shl r10d,3+2 + lea r10,QWORD PTR[r9*2+r9] neg r9 mov r8,QWORD PTR[r8] @@ -1734,19 +2010,20 @@ DB 067h - lea r11,QWORD PTR[((-64))+r9*2+rsp] - sub r11,rsi + + lea r11,QWORD PTR[((-320))+r9*2+rsp] + sub r11,rdi and r11,4095 cmp r10,r11 jb $L$from_sp_alt sub rsp,r11 - lea rsp,QWORD PTR[((-64))+r9*2+rsp] + lea rsp,QWORD PTR[((-320))+r9*2+rsp] jmp $L$from_sp_done ALIGN 32 $L$from_sp_alt:: - lea r10,QWORD PTR[((4096-64))+r9*2] - lea rsp,QWORD PTR[((-64))+r9*2+rsp] + lea r10,QWORD PTR[((4096-320))+r9*2] + lea rsp,QWORD PTR[((-320))+r9*2+rsp] sub r11,r10 mov r10,0 cmovc r11,r10 @@ -1797,7 +2074,8 @@ DB 102,72,15,110,209 DB 067h mov rbp,rcx DB 102,73,15,110,218 - call sqr8x_reduction + call __bn_sqr8x_reduction + call __bn_post4x_internal pxor xmm0,xmm0 lea rax,QWORD PTR[48+rsp] @@ -1867,55 +2145,171 @@ bn_scatter5 ENDP PUBLIC bn_gather5 -ALIGN 16 +ALIGN 32 bn_gather5 PROC PUBLIC $L$SEH_begin_bn_gather5:: -DB 048h,083h,0ech,028h -DB 00fh,029h,034h,024h -DB 00fh,029h,07ch,024h,010h - mov r11d,r9d - shr r9d,3 - and r11,7 - not r9d - lea rax,QWORD PTR[$L$magic_masks] - and r9d,3 - lea r8,QWORD PTR[128+r11*8+r8] - movq xmm4,QWORD PTR[r9*8+rax] - movq xmm5,QWORD PTR[8+r9*8+rax] - movq xmm6,QWORD PTR[16+r9*8+rax] - movq xmm7,QWORD PTR[24+r9*8+rax] +DB 04ch,08dh,014h,024h +DB 048h,081h,0ech,008h,001h,000h,000h + lea rax,QWORD PTR[$L$inc] + and rsp,-16 + + movd xmm5,r9d + movdqa xmm0,XMMWORD PTR[rax] + movdqa xmm1,XMMWORD PTR[16+rax] + lea r11,QWORD PTR[128+r8] + lea rax,QWORD PTR[128+rsp] + + pshufd xmm5,xmm5,0 + movdqa xmm4,xmm1 + movdqa xmm2,xmm1 + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa xmm3,xmm4 + + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[(-128)+rax],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[(-112)+rax],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[(-96)+rax],xmm2 + movdqa xmm2,xmm4 + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[(-80)+rax],xmm3 + movdqa xmm3,xmm4 + + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[(-64)+rax],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[(-48)+rax],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[(-32)+rax],xmm2 + movdqa xmm2,xmm4 + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[(-16)+rax],xmm3 + movdqa xmm3,xmm4 + + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[rax],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[16+rax],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[32+rax],xmm2 + movdqa xmm2,xmm4 + paddd xmm1,xmm0 + pcmpeqd xmm0,xmm5 + movdqa XMMWORD PTR[48+rax],xmm3 + movdqa xmm3,xmm4 + + paddd xmm2,xmm1 + pcmpeqd xmm1,xmm5 + movdqa XMMWORD PTR[64+rax],xmm0 + movdqa xmm0,xmm4 + + paddd xmm3,xmm2 + pcmpeqd xmm2,xmm5 + movdqa XMMWORD PTR[80+rax],xmm1 + movdqa xmm1,xmm4 + + paddd xmm0,xmm3 + pcmpeqd xmm3,xmm5 + movdqa XMMWORD PTR[96+rax],xmm2 + movdqa xmm2,xmm4 + movdqa XMMWORD PTR[112+rax],xmm3 jmp $L$gather -ALIGN 16 -$L$gather:: - movq xmm0,QWORD PTR[((-128))+r8] - movq xmm1,QWORD PTR[((-64))+r8] - pand xmm0,xmm4 - movq xmm2,QWORD PTR[r8] - pand xmm1,xmm5 - movq xmm3,QWORD PTR[64+r8] - pand xmm2,xmm6 - por xmm0,xmm1 - pand xmm3,xmm7 -DB 067h,067h - por xmm0,xmm2 - lea r8,QWORD PTR[256+r8] - por xmm0,xmm3 +ALIGN 32 +$L$gather:: + pxor xmm4,xmm4 + pxor xmm5,xmm5 + movdqa xmm0,XMMWORD PTR[((-128))+r11] + movdqa xmm1,XMMWORD PTR[((-112))+r11] + movdqa xmm2,XMMWORD PTR[((-96))+r11] + pand xmm0,XMMWORD PTR[((-128))+rax] + movdqa xmm3,XMMWORD PTR[((-80))+r11] + pand xmm1,XMMWORD PTR[((-112))+rax] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[((-96))+rax] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[((-80))+rax] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[((-64))+r11] + movdqa xmm1,XMMWORD PTR[((-48))+r11] + movdqa xmm2,XMMWORD PTR[((-32))+r11] + pand xmm0,XMMWORD PTR[((-64))+rax] + movdqa xmm3,XMMWORD PTR[((-16))+r11] + pand xmm1,XMMWORD PTR[((-48))+rax] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[((-32))+rax] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[((-16))+rax] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[r11] + movdqa xmm1,XMMWORD PTR[16+r11] + movdqa xmm2,XMMWORD PTR[32+r11] + pand xmm0,XMMWORD PTR[rax] + movdqa xmm3,XMMWORD PTR[48+r11] + pand xmm1,XMMWORD PTR[16+rax] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[32+rax] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[48+rax] + por xmm4,xmm2 + por xmm5,xmm3 + movdqa xmm0,XMMWORD PTR[64+r11] + movdqa xmm1,XMMWORD PTR[80+r11] + movdqa xmm2,XMMWORD PTR[96+r11] + pand xmm0,XMMWORD PTR[64+rax] + movdqa xmm3,XMMWORD PTR[112+r11] + pand xmm1,XMMWORD PTR[80+rax] + por xmm4,xmm0 + pand xmm2,XMMWORD PTR[96+rax] + por xmm5,xmm1 + pand xmm3,XMMWORD PTR[112+rax] + por xmm4,xmm2 + por xmm5,xmm3 + por xmm4,xmm5 + lea r11,QWORD PTR[256+r11] + pshufd xmm0,xmm4,04eh + por xmm0,xmm4 movq QWORD PTR[rcx],xmm0 lea rcx,QWORD PTR[8+rcx] sub edx,1 jnz $L$gather - movaps xmm6,XMMWORD PTR[rsp] - movaps xmm7,XMMWORD PTR[16+rsp] - lea rsp,QWORD PTR[40+rsp] + + lea rsp,QWORD PTR[r10] DB 0F3h,0C3h ;repret $L$SEH_end_bn_gather5:: bn_gather5 ENDP ALIGN 64 -$L$magic_masks:: - DD 0,0,0,0,0,0,-1,-1 - DD 0,0,0,0,0,0,0,0 +$L$inc:: + DD 0,0,1,1 + DD 2,2,2,2 DB 77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105 DB 112,108,105,99,97,116,105,111,110,32,119,105,116,104,32,115 DB 99,97,116,116,101,114,47,103,97,116,104,101,114,32,102,111 @@ -1957,19 +2351,16 @@ mul_handler PROC PRIVATE lea r10,QWORD PTR[$L$mul_epilogue] cmp rbx,r10 - jb $L$body_40 + ja $L$body_40 mov r10,QWORD PTR[192+r8] mov rax,QWORD PTR[8+r10*8+rax] + jmp $L$body_proceed $L$body_40:: mov rax,QWORD PTR[40+rax] $L$body_proceed:: - - movaps xmm0,XMMWORD PTR[((-88))+rax] - movaps xmm1,XMMWORD PTR[((-72))+rax] - mov rbx,QWORD PTR[((-8))+rax] mov rbp,QWORD PTR[((-16))+rax] mov r12,QWORD PTR[((-24))+rax] @@ -1982,8 +2373,6 @@ $L$body_proceed:: mov QWORD PTR[224+r8],r13 mov QWORD PTR[232+r8],r14 mov QWORD PTR[240+r8],r15 - movups XMMWORD PTR[512+r8],xmm0 - movups XMMWORD PTR[528+r8],xmm1 $L$common_seh_tail:: mov rdi,QWORD PTR[8+rax] @@ -2071,10 +2460,9 @@ DB 9,0,0,0 DD imagerel $L$from_body,imagerel $L$from_epilogue ALIGN 8 $L$SEH_info_bn_gather5:: -DB 001h,00dh,005h,000h -DB 00dh,078h,001h,000h -DB 008h,068h,000h,000h -DB 004h,042h,000h,000h +DB 001h,00bh,003h,00ah +DB 00bh,001h,021h,000h +DB 004h,0a3h,000h,000h ALIGN 8 .xdata ENDS diff --git a/deps/openssl/asm_obsolete/x64-win32-masm/ec/ecp_nistz256-x86_64.asm b/deps/openssl/asm_obsolete/x64-win32-masm/ec/ecp_nistz256-x86_64.asm index ef9b22fbfddc11..ca78bd52ccc9f2 100644 --- a/deps/openssl/asm_obsolete/x64-win32-masm/ec/ecp_nistz256-x86_64.asm +++ b/deps/openssl/asm_obsolete/x64-win32-masm/ec/ecp_nistz256-x86_64.asm @@ -1303,6 +1303,7 @@ $L$SEH_begin_ecp_nistz256_point_double:: push r15 sub rsp,32*5+8 +$L$point_double_shortcutq:: movdqu xmm0,XMMWORD PTR[rsi] mov rbx,rsi movdqu xmm1,XMMWORD PTR[16+rsi] @@ -1577,6 +1578,7 @@ DB 102,72,15,110,199 mov r14,QWORD PTR[((64+8))+rbx] mov r15,QWORD PTR[((64+16))+rbx] mov r8,QWORD PTR[((64+24))+rbx] +DB 102,72,15,110,203 lea rsi,QWORD PTR[((64-0))+rbx] lea rdi,QWORD PTR[32+rsp] @@ -1668,7 +1670,7 @@ DB 102,73,15,126,217 test r8,r8 jnz $L$add_proceedq test r9,r9 - jz $L$add_proceedq + jz $L$add_doubleq DB 102,72,15,126,199 pxor xmm0,xmm0 @@ -1680,6 +1682,13 @@ DB 102,72,15,126,199 movdqu XMMWORD PTR[80+rdi],xmm0 jmp $L$add_doneq +ALIGN 32 +$L$add_doubleq:: +DB 102,72,15,126,206 +DB 102,72,15,126,199 + add rsp,416 + jmp $L$point_double_shortcutq + ALIGN 32 $L$add_proceedq:: mov rax,QWORD PTR[((0+64))+rsp] diff --git a/deps/openssl/config/Makefile b/deps/openssl/config/Makefile index b56e9004c3b732..c8155b16d8dcfb 100644 --- a/deps/openssl/config/Makefile +++ b/deps/openssl/config/Makefile @@ -5,7 +5,8 @@ COPT = no-shared no-symlinks ARCHS = aix-gcc aix64-gcc BSD-x86 BSD-x86_64 VC-WIN32 \ VC-WIN64A darwin64-x86_64-cc darwin-i386-cc linux-aarch64 \ linux-armv4 linux-elf linux-x32 linux-x86_64 linux-ppc \ -linux-ppc64 solaris-x86-gcc solaris64-x86_64-gcc +linux-ppc64 linux32-s390x linux64-s390x solaris-x86-gcc \ +solaris64-x86_64-gcc CFG = opensslconf.h SRC_CFG = ../openssl/crypto/$(CFG) diff --git a/deps/openssl/config/archs/BSD-x86/opensslconf.h b/deps/openssl/config/archs/BSD-x86/opensslconf.h index d93c0bfbb5a0aa..769c15e052f9ff 100644 --- a/deps/openssl/config/archs/BSD-x86/opensslconf.h +++ b/deps/openssl/config/archs/BSD-x86/opensslconf.h @@ -38,12 +38,18 @@ extern "C" { #ifndef OPENSSL_NO_SSL_TRACE # define OPENSSL_NO_SSL_TRACE #endif +#ifndef OPENSSL_NO_SSL2 +# define OPENSSL_NO_SSL2 +#endif #ifndef OPENSSL_NO_STORE # define OPENSSL_NO_STORE #endif #ifndef OPENSSL_NO_UNIT_TEST # define OPENSSL_NO_UNIT_TEST #endif +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +#endif #endif /* OPENSSL_DOING_MAKEDEPEND */ @@ -89,12 +95,18 @@ extern "C" { # if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) # define NO_SSL_TRACE # endif +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) +# define NO_SSL2 +# endif # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) # define NO_STORE # endif # if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) # define NO_UNIT_TEST # endif +# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) +# define NO_WEAK_SSL_CIPHERS +# endif #endif @@ -221,7 +233,7 @@ extern "C" { optimization options. Older Sparc's work better with only UNROLL, but there's no way to tell at compile time what it is you're running on */ -#if defined( sun ) /* Newer Sparc's */ +#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ # define DES_PTR # define DES_RISC1 # define DES_UNROLL diff --git a/deps/openssl/config/archs/BSD-x86_64/opensslconf.h b/deps/openssl/config/archs/BSD-x86_64/opensslconf.h index ee73a6de4e7747..231c8f3628079d 100644 --- a/deps/openssl/config/archs/BSD-x86_64/opensslconf.h +++ b/deps/openssl/config/archs/BSD-x86_64/opensslconf.h @@ -38,12 +38,18 @@ extern "C" { #ifndef OPENSSL_NO_SSL_TRACE # define OPENSSL_NO_SSL_TRACE #endif +#ifndef OPENSSL_NO_SSL2 +# define OPENSSL_NO_SSL2 +#endif #ifndef OPENSSL_NO_STORE # define OPENSSL_NO_STORE #endif #ifndef OPENSSL_NO_UNIT_TEST # define OPENSSL_NO_UNIT_TEST #endif +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +#endif #endif /* OPENSSL_DOING_MAKEDEPEND */ @@ -89,12 +95,18 @@ extern "C" { # if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) # define NO_SSL_TRACE # endif +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) +# define NO_SSL2 +# endif # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) # define NO_STORE # endif # if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) # define NO_UNIT_TEST # endif +# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) +# define NO_WEAK_SSL_CIPHERS +# endif #endif @@ -221,7 +233,7 @@ extern "C" { optimization options. Older Sparc's work better with only UNROLL, but there's no way to tell at compile time what it is you're running on */ -#if defined( sun ) /* Newer Sparc's */ +#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ # define DES_PTR # define DES_RISC1 # define DES_UNROLL diff --git a/deps/openssl/config/archs/VC-WIN32/opensslconf.h b/deps/openssl/config/archs/VC-WIN32/opensslconf.h index 515a5157412e57..963b384b2221b9 100644 --- a/deps/openssl/config/archs/VC-WIN32/opensslconf.h +++ b/deps/openssl/config/archs/VC-WIN32/opensslconf.h @@ -41,12 +41,18 @@ extern "C" { #ifndef OPENSSL_NO_SSL_TRACE # define OPENSSL_NO_SSL_TRACE #endif +#ifndef OPENSSL_NO_SSL2 +# define OPENSSL_NO_SSL2 +#endif #ifndef OPENSSL_NO_STORE # define OPENSSL_NO_STORE #endif #ifndef OPENSSL_NO_UNIT_TEST # define OPENSSL_NO_UNIT_TEST #endif +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +#endif #endif /* OPENSSL_DOING_MAKEDEPEND */ @@ -89,12 +95,18 @@ extern "C" { # if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) # define NO_SSL_TRACE # endif +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) +# define NO_SSL2 +# endif # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) # define NO_STORE # endif # if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) # define NO_UNIT_TEST # endif +# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) +# define NO_WEAK_SSL_CIPHERS +# endif #endif @@ -222,7 +234,7 @@ extern "C" { optimization options. Older Sparc's work better with only UNROLL, but there's no way to tell at compile time what it is you're running on */ -#if defined( sun ) /* Newer Sparc's */ +#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ # define DES_PTR # define DES_RISC1 # define DES_UNROLL diff --git a/deps/openssl/config/archs/VC-WIN64A/opensslconf.h b/deps/openssl/config/archs/VC-WIN64A/opensslconf.h index 902fa56aca02ed..2993295bd4de3d 100644 --- a/deps/openssl/config/archs/VC-WIN64A/opensslconf.h +++ b/deps/openssl/config/archs/VC-WIN64A/opensslconf.h @@ -41,12 +41,18 @@ extern "C" { #ifndef OPENSSL_NO_SSL_TRACE # define OPENSSL_NO_SSL_TRACE #endif +#ifndef OPENSSL_NO_SSL2 +# define OPENSSL_NO_SSL2 +#endif #ifndef OPENSSL_NO_STORE # define OPENSSL_NO_STORE #endif #ifndef OPENSSL_NO_UNIT_TEST # define OPENSSL_NO_UNIT_TEST #endif +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +#endif #endif /* OPENSSL_DOING_MAKEDEPEND */ @@ -89,12 +95,18 @@ extern "C" { # if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) # define NO_SSL_TRACE # endif +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) +# define NO_SSL2 +# endif # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) # define NO_STORE # endif # if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) # define NO_UNIT_TEST # endif +# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) +# define NO_WEAK_SSL_CIPHERS +# endif #endif @@ -222,7 +234,7 @@ extern "C" { optimization options. Older Sparc's work better with only UNROLL, but there's no way to tell at compile time what it is you're running on */ -#if defined( sun ) /* Newer Sparc's */ +#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ # define DES_PTR # define DES_RISC1 # define DES_UNROLL diff --git a/deps/openssl/config/archs/aix-gcc/opensslconf.h b/deps/openssl/config/archs/aix-gcc/opensslconf.h index d419fb02db8289..0b5a4da2199b20 100644 --- a/deps/openssl/config/archs/aix-gcc/opensslconf.h +++ b/deps/openssl/config/archs/aix-gcc/opensslconf.h @@ -41,12 +41,18 @@ extern "C" { #ifndef OPENSSL_NO_SSL_TRACE # define OPENSSL_NO_SSL_TRACE #endif +#ifndef OPENSSL_NO_SSL2 +# define OPENSSL_NO_SSL2 +#endif #ifndef OPENSSL_NO_STORE # define OPENSSL_NO_STORE #endif #ifndef OPENSSL_NO_UNIT_TEST # define OPENSSL_NO_UNIT_TEST #endif +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +#endif #endif /* OPENSSL_DOING_MAKEDEPEND */ @@ -92,12 +98,18 @@ extern "C" { # if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) # define NO_SSL_TRACE # endif +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) +# define NO_SSL2 +# endif # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) # define NO_STORE # endif # if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) # define NO_UNIT_TEST # endif +# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) +# define NO_WEAK_SSL_CIPHERS +# endif #endif @@ -224,7 +236,7 @@ extern "C" { optimization options. Older Sparc's work better with only UNROLL, but there's no way to tell at compile time what it is you're running on */ -#if defined( sun ) /* Newer Sparc's */ +#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ # define DES_PTR # define DES_RISC1 # define DES_UNROLL diff --git a/deps/openssl/config/archs/aix64-gcc/opensslconf.h b/deps/openssl/config/archs/aix64-gcc/opensslconf.h index 3c17cfc5d047df..0cca4cae21dd10 100644 --- a/deps/openssl/config/archs/aix64-gcc/opensslconf.h +++ b/deps/openssl/config/archs/aix64-gcc/opensslconf.h @@ -41,12 +41,18 @@ extern "C" { #ifndef OPENSSL_NO_SSL_TRACE # define OPENSSL_NO_SSL_TRACE #endif +#ifndef OPENSSL_NO_SSL2 +# define OPENSSL_NO_SSL2 +#endif #ifndef OPENSSL_NO_STORE # define OPENSSL_NO_STORE #endif #ifndef OPENSSL_NO_UNIT_TEST # define OPENSSL_NO_UNIT_TEST #endif +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +#endif #endif /* OPENSSL_DOING_MAKEDEPEND */ @@ -92,12 +98,18 @@ extern "C" { # if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) # define NO_SSL_TRACE # endif +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) +# define NO_SSL2 +# endif # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) # define NO_STORE # endif # if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) # define NO_UNIT_TEST # endif +# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) +# define NO_WEAK_SSL_CIPHERS +# endif #endif @@ -224,7 +236,7 @@ extern "C" { optimization options. Older Sparc's work better with only UNROLL, but there's no way to tell at compile time what it is you're running on */ -#if defined( sun ) /* Newer Sparc's */ +#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ # define DES_PTR # define DES_RISC1 # define DES_UNROLL diff --git a/deps/openssl/config/archs/darwin-i386-cc/opensslconf.h b/deps/openssl/config/archs/darwin-i386-cc/opensslconf.h index 4dedfacceea277..584537094dc49b 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/opensslconf.h +++ b/deps/openssl/config/archs/darwin-i386-cc/opensslconf.h @@ -41,12 +41,18 @@ extern "C" { #ifndef OPENSSL_NO_SSL_TRACE # define OPENSSL_NO_SSL_TRACE #endif +#ifndef OPENSSL_NO_SSL2 +# define OPENSSL_NO_SSL2 +#endif #ifndef OPENSSL_NO_STORE # define OPENSSL_NO_STORE #endif #ifndef OPENSSL_NO_UNIT_TEST # define OPENSSL_NO_UNIT_TEST #endif +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +#endif #endif /* OPENSSL_DOING_MAKEDEPEND */ @@ -92,12 +98,18 @@ extern "C" { # if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) # define NO_SSL_TRACE # endif +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) +# define NO_SSL2 +# endif # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) # define NO_STORE # endif # if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) # define NO_UNIT_TEST # endif +# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) +# define NO_WEAK_SSL_CIPHERS +# endif #endif @@ -224,7 +236,7 @@ extern "C" { optimization options. Older Sparc's work better with only UNROLL, but there's no way to tell at compile time what it is you're running on */ -#if defined( sun ) /* Newer Sparc's */ +#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ # define DES_PTR # define DES_RISC1 # define DES_UNROLL diff --git a/deps/openssl/config/archs/darwin64-x86_64-cc/opensslconf.h b/deps/openssl/config/archs/darwin64-x86_64-cc/opensslconf.h index 1667b0a9d7aa6b..1d7932d04b8c0e 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/opensslconf.h +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/opensslconf.h @@ -41,12 +41,18 @@ extern "C" { #ifndef OPENSSL_NO_SSL_TRACE # define OPENSSL_NO_SSL_TRACE #endif +#ifndef OPENSSL_NO_SSL2 +# define OPENSSL_NO_SSL2 +#endif #ifndef OPENSSL_NO_STORE # define OPENSSL_NO_STORE #endif #ifndef OPENSSL_NO_UNIT_TEST # define OPENSSL_NO_UNIT_TEST #endif +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +#endif #endif /* OPENSSL_DOING_MAKEDEPEND */ @@ -92,12 +98,18 @@ extern "C" { # if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) # define NO_SSL_TRACE # endif +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) +# define NO_SSL2 +# endif # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) # define NO_STORE # endif # if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) # define NO_UNIT_TEST # endif +# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) +# define NO_WEAK_SSL_CIPHERS +# endif #endif @@ -224,7 +236,7 @@ extern "C" { optimization options. Older Sparc's work better with only UNROLL, but there's no way to tell at compile time what it is you're running on */ -#if defined( sun ) /* Newer Sparc's */ +#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ # define DES_PTR # define DES_RISC1 # define DES_UNROLL diff --git a/deps/openssl/config/archs/linux-aarch64/opensslconf.h b/deps/openssl/config/archs/linux-aarch64/opensslconf.h index 4bf4588b62457c..bd4869d4c51d87 100644 --- a/deps/openssl/config/archs/linux-aarch64/opensslconf.h +++ b/deps/openssl/config/archs/linux-aarch64/opensslconf.h @@ -38,12 +38,18 @@ extern "C" { #ifndef OPENSSL_NO_SSL_TRACE # define OPENSSL_NO_SSL_TRACE #endif +#ifndef OPENSSL_NO_SSL2 +# define OPENSSL_NO_SSL2 +#endif #ifndef OPENSSL_NO_STORE # define OPENSSL_NO_STORE #endif #ifndef OPENSSL_NO_UNIT_TEST # define OPENSSL_NO_UNIT_TEST #endif +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +#endif #endif /* OPENSSL_DOING_MAKEDEPEND */ @@ -89,12 +95,18 @@ extern "C" { # if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) # define NO_SSL_TRACE # endif +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) +# define NO_SSL2 +# endif # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) # define NO_STORE # endif # if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) # define NO_UNIT_TEST # endif +# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) +# define NO_WEAK_SSL_CIPHERS +# endif #endif @@ -221,7 +233,7 @@ extern "C" { optimization options. Older Sparc's work better with only UNROLL, but there's no way to tell at compile time what it is you're running on */ -#if defined( sun ) /* Newer Sparc's */ +#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ # define DES_PTR # define DES_RISC1 # define DES_UNROLL diff --git a/deps/openssl/config/archs/linux-armv4/opensslconf.h b/deps/openssl/config/archs/linux-armv4/opensslconf.h index 731af2f8eca134..4f6aa1c69b9355 100644 --- a/deps/openssl/config/archs/linux-armv4/opensslconf.h +++ b/deps/openssl/config/archs/linux-armv4/opensslconf.h @@ -38,12 +38,18 @@ extern "C" { #ifndef OPENSSL_NO_SSL_TRACE # define OPENSSL_NO_SSL_TRACE #endif +#ifndef OPENSSL_NO_SSL2 +# define OPENSSL_NO_SSL2 +#endif #ifndef OPENSSL_NO_STORE # define OPENSSL_NO_STORE #endif #ifndef OPENSSL_NO_UNIT_TEST # define OPENSSL_NO_UNIT_TEST #endif +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +#endif #endif /* OPENSSL_DOING_MAKEDEPEND */ @@ -89,12 +95,18 @@ extern "C" { # if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) # define NO_SSL_TRACE # endif +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) +# define NO_SSL2 +# endif # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) # define NO_STORE # endif # if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) # define NO_UNIT_TEST # endif +# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) +# define NO_WEAK_SSL_CIPHERS +# endif #endif @@ -221,7 +233,7 @@ extern "C" { optimization options. Older Sparc's work better with only UNROLL, but there's no way to tell at compile time what it is you're running on */ -#if defined( sun ) /* Newer Sparc's */ +#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ # define DES_PTR # define DES_RISC1 # define DES_UNROLL diff --git a/deps/openssl/config/archs/linux-elf/opensslconf.h b/deps/openssl/config/archs/linux-elf/opensslconf.h index d93c0bfbb5a0aa..769c15e052f9ff 100644 --- a/deps/openssl/config/archs/linux-elf/opensslconf.h +++ b/deps/openssl/config/archs/linux-elf/opensslconf.h @@ -38,12 +38,18 @@ extern "C" { #ifndef OPENSSL_NO_SSL_TRACE # define OPENSSL_NO_SSL_TRACE #endif +#ifndef OPENSSL_NO_SSL2 +# define OPENSSL_NO_SSL2 +#endif #ifndef OPENSSL_NO_STORE # define OPENSSL_NO_STORE #endif #ifndef OPENSSL_NO_UNIT_TEST # define OPENSSL_NO_UNIT_TEST #endif +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +#endif #endif /* OPENSSL_DOING_MAKEDEPEND */ @@ -89,12 +95,18 @@ extern "C" { # if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) # define NO_SSL_TRACE # endif +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) +# define NO_SSL2 +# endif # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) # define NO_STORE # endif # if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) # define NO_UNIT_TEST # endif +# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) +# define NO_WEAK_SSL_CIPHERS +# endif #endif @@ -221,7 +233,7 @@ extern "C" { optimization options. Older Sparc's work better with only UNROLL, but there's no way to tell at compile time what it is you're running on */ -#if defined( sun ) /* Newer Sparc's */ +#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ # define DES_PTR # define DES_RISC1 # define DES_UNROLL diff --git a/deps/openssl/config/archs/linux-ppc/opensslconf.h b/deps/openssl/config/archs/linux-ppc/opensslconf.h index bd5d3befeda038..e0d62da24e142e 100644 --- a/deps/openssl/config/archs/linux-ppc/opensslconf.h +++ b/deps/openssl/config/archs/linux-ppc/opensslconf.h @@ -38,12 +38,18 @@ extern "C" { #ifndef OPENSSL_NO_SSL_TRACE # define OPENSSL_NO_SSL_TRACE #endif +#ifndef OPENSSL_NO_SSL2 +# define OPENSSL_NO_SSL2 +#endif #ifndef OPENSSL_NO_STORE # define OPENSSL_NO_STORE #endif #ifndef OPENSSL_NO_UNIT_TEST # define OPENSSL_NO_UNIT_TEST #endif +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +#endif #endif /* OPENSSL_DOING_MAKEDEPEND */ @@ -89,12 +95,18 @@ extern "C" { # if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) # define NO_SSL_TRACE # endif +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) +# define NO_SSL2 +# endif # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) # define NO_STORE # endif # if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) # define NO_UNIT_TEST # endif +# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) +# define NO_WEAK_SSL_CIPHERS +# endif #endif @@ -202,7 +214,7 @@ extern "C" { #endif #if defined(DES_RISC1) && defined(DES_RISC2) -YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! +#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! #endif /* Unroll the inner loop, this sometimes helps, sometimes hinders. @@ -221,7 +233,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! optimization options. Older Sparc's work better with only UNROLL, but there's no way to tell at compile time what it is you're running on */ -#if defined( sun ) /* Newer Sparc's */ +#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ # define DES_PTR # define DES_RISC1 # define DES_UNROLL diff --git a/deps/openssl/config/archs/linux-ppc64/opensslconf.h b/deps/openssl/config/archs/linux-ppc64/opensslconf.h index dc671aad0d66bd..3f7202d25427e3 100644 --- a/deps/openssl/config/archs/linux-ppc64/opensslconf.h +++ b/deps/openssl/config/archs/linux-ppc64/opensslconf.h @@ -38,12 +38,18 @@ extern "C" { #ifndef OPENSSL_NO_SSL_TRACE # define OPENSSL_NO_SSL_TRACE #endif +#ifndef OPENSSL_NO_SSL2 +# define OPENSSL_NO_SSL2 +#endif #ifndef OPENSSL_NO_STORE # define OPENSSL_NO_STORE #endif #ifndef OPENSSL_NO_UNIT_TEST # define OPENSSL_NO_UNIT_TEST #endif +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +#endif #endif /* OPENSSL_DOING_MAKEDEPEND */ @@ -89,12 +95,18 @@ extern "C" { # if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) # define NO_SSL_TRACE # endif +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) +# define NO_SSL2 +# endif # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) # define NO_STORE # endif # if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) # define NO_UNIT_TEST # endif +# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) +# define NO_WEAK_SSL_CIPHERS +# endif #endif @@ -202,7 +214,7 @@ extern "C" { #endif #if defined(DES_RISC1) && defined(DES_RISC2) -YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! +#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! #endif /* Unroll the inner loop, this sometimes helps, sometimes hinders. @@ -221,7 +233,7 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! optimization options. Older Sparc's work better with only UNROLL, but there's no way to tell at compile time what it is you're running on */ -#if defined( sun ) /* Newer Sparc's */ +#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ # define DES_PTR # define DES_RISC1 # define DES_UNROLL diff --git a/deps/openssl/config/archs/linux-x32/opensslconf.h b/deps/openssl/config/archs/linux-x32/opensslconf.h index ad4d1e9dfa340d..8e184bc815f9cf 100644 --- a/deps/openssl/config/archs/linux-x32/opensslconf.h +++ b/deps/openssl/config/archs/linux-x32/opensslconf.h @@ -38,12 +38,18 @@ extern "C" { #ifndef OPENSSL_NO_SSL_TRACE # define OPENSSL_NO_SSL_TRACE #endif +#ifndef OPENSSL_NO_SSL2 +# define OPENSSL_NO_SSL2 +#endif #ifndef OPENSSL_NO_STORE # define OPENSSL_NO_STORE #endif #ifndef OPENSSL_NO_UNIT_TEST # define OPENSSL_NO_UNIT_TEST #endif +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +#endif #endif /* OPENSSL_DOING_MAKEDEPEND */ @@ -89,12 +95,18 @@ extern "C" { # if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) # define NO_SSL_TRACE # endif +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) +# define NO_SSL2 +# endif # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) # define NO_STORE # endif # if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) # define NO_UNIT_TEST # endif +# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) +# define NO_WEAK_SSL_CIPHERS +# endif #endif @@ -221,7 +233,7 @@ extern "C" { optimization options. Older Sparc's work better with only UNROLL, but there's no way to tell at compile time what it is you're running on */ -#if defined( sun ) /* Newer Sparc's */ +#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ # define DES_PTR # define DES_RISC1 # define DES_UNROLL diff --git a/deps/openssl/config/archs/linux-x86_64/opensslconf.h b/deps/openssl/config/archs/linux-x86_64/opensslconf.h index ee73a6de4e7747..231c8f3628079d 100644 --- a/deps/openssl/config/archs/linux-x86_64/opensslconf.h +++ b/deps/openssl/config/archs/linux-x86_64/opensslconf.h @@ -38,12 +38,18 @@ extern "C" { #ifndef OPENSSL_NO_SSL_TRACE # define OPENSSL_NO_SSL_TRACE #endif +#ifndef OPENSSL_NO_SSL2 +# define OPENSSL_NO_SSL2 +#endif #ifndef OPENSSL_NO_STORE # define OPENSSL_NO_STORE #endif #ifndef OPENSSL_NO_UNIT_TEST # define OPENSSL_NO_UNIT_TEST #endif +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +#endif #endif /* OPENSSL_DOING_MAKEDEPEND */ @@ -89,12 +95,18 @@ extern "C" { # if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) # define NO_SSL_TRACE # endif +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) +# define NO_SSL2 +# endif # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) # define NO_STORE # endif # if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) # define NO_UNIT_TEST # endif +# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) +# define NO_WEAK_SSL_CIPHERS +# endif #endif @@ -221,7 +233,7 @@ extern "C" { optimization options. Older Sparc's work better with only UNROLL, but there's no way to tell at compile time what it is you're running on */ -#if defined( sun ) /* Newer Sparc's */ +#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ # define DES_PTR # define DES_RISC1 # define DES_UNROLL diff --git a/deps/openssl/config/archs/linux32-s390x/opensslconf.h b/deps/openssl/config/archs/linux32-s390x/opensslconf.h new file mode 100644 index 00000000000000..e0d0f8fa613456 --- /dev/null +++ b/deps/openssl/config/archs/linux32-s390x/opensslconf.h @@ -0,0 +1,270 @@ +/* opensslconf.h */ +/* WARNING: Generated automatically from opensslconf.h.in by Configure. */ + +#ifdef __cplusplus +extern "C" { +#endif +/* OpenSSL was configured with the following options: */ +#ifndef OPENSSL_DOING_MAKEDEPEND + + +#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 +# define OPENSSL_NO_EC_NISTP_64_GCC_128 +#endif +#ifndef OPENSSL_NO_GMP +# define OPENSSL_NO_GMP +#endif +#ifndef OPENSSL_NO_JPAKE +# define OPENSSL_NO_JPAKE +#endif +#ifndef OPENSSL_NO_KRB5 +# define OPENSSL_NO_KRB5 +#endif +#ifndef OPENSSL_NO_LIBUNBOUND +# define OPENSSL_NO_LIBUNBOUND +#endif +#ifndef OPENSSL_NO_MD2 +# define OPENSSL_NO_MD2 +#endif +#ifndef OPENSSL_NO_RC5 +# define OPENSSL_NO_RC5 +#endif +#ifndef OPENSSL_NO_RFC3779 +# define OPENSSL_NO_RFC3779 +#endif +#ifndef OPENSSL_NO_SCTP +# define OPENSSL_NO_SCTP +#endif +#ifndef OPENSSL_NO_SSL_TRACE +# define OPENSSL_NO_SSL_TRACE +#endif +#ifndef OPENSSL_NO_SSL2 +# define OPENSSL_NO_SSL2 +#endif +#ifndef OPENSSL_NO_STORE +# define OPENSSL_NO_STORE +#endif +#ifndef OPENSSL_NO_UNIT_TEST +# define OPENSSL_NO_UNIT_TEST +#endif +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +#endif + +#endif /* OPENSSL_DOING_MAKEDEPEND */ + +#ifndef OPENSSL_THREADS +# define OPENSSL_THREADS +#endif +#ifndef OPENSSL_NO_DYNAMIC_ENGINE +# define OPENSSL_NO_DYNAMIC_ENGINE +#endif + +/* The OPENSSL_NO_* macros are also defined as NO_* if the application + asks for it. This is a transient feature that is provided for those + who haven't had the time to do the appropriate changes in their + applications. */ +#ifdef OPENSSL_ALGORITHM_DEFINES +# if defined(OPENSSL_NO_EC_NISTP_64_GCC_128) && !defined(NO_EC_NISTP_64_GCC_128) +# define NO_EC_NISTP_64_GCC_128 +# endif +# if defined(OPENSSL_NO_GMP) && !defined(NO_GMP) +# define NO_GMP +# endif +# if defined(OPENSSL_NO_JPAKE) && !defined(NO_JPAKE) +# define NO_JPAKE +# endif +# if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5) +# define NO_KRB5 +# endif +# if defined(OPENSSL_NO_LIBUNBOUND) && !defined(NO_LIBUNBOUND) +# define NO_LIBUNBOUND +# endif +# if defined(OPENSSL_NO_MD2) && !defined(NO_MD2) +# define NO_MD2 +# endif +# if defined(OPENSSL_NO_RC5) && !defined(NO_RC5) +# define NO_RC5 +# endif +# if defined(OPENSSL_NO_RFC3779) && !defined(NO_RFC3779) +# define NO_RFC3779 +# endif +# if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP) +# define NO_SCTP +# endif +# if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) +# define NO_SSL_TRACE +# endif +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) +# define NO_SSL2 +# endif +# if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) +# define NO_STORE +# endif +# if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) +# define NO_UNIT_TEST +# endif +# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) +# define NO_WEAK_SSL_CIPHERS +# endif +#endif + + + +/* crypto/opensslconf.h.in */ + +/* Generate 80386 code? */ +#undef I386_ONLY + +#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */ +#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) +#define ENGINESDIR "/usr/local/ssl/lib/engines" +#define OPENSSLDIR "/usr/local/ssl" +#endif +#endif + +#undef OPENSSL_UNISTD +#define OPENSSL_UNISTD + +#undef OPENSSL_EXPORT_VAR_AS_FUNCTION + +#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) +#define IDEA_INT unsigned int +#endif + +#if defined(HEADER_MD2_H) && !defined(MD2_INT) +#define MD2_INT unsigned int +#endif + +#if defined(HEADER_RC2_H) && !defined(RC2_INT) +/* I need to put in a mod for the alpha - eay */ +#define RC2_INT unsigned int +#endif + +#if defined(HEADER_RC4_H) +#if !defined(RC4_INT) +/* using int types make the structure larger but make the code faster + * on most boxes I have tested - up to %20 faster. */ +/* + * I don't know what does "most" mean, but declaring "int" is a must on: + * - Intel P6 because partial register stalls are very expensive; + * - elder Alpha because it lacks byte load/store instructions; + */ +#define RC4_INT unsigned char +#endif +#if !defined(RC4_CHUNK) +/* + * This enables code handling data aligned at natural CPU word + * boundary. See crypto/rc4/rc4_enc.c for further details. + */ +#define RC4_CHUNK unsigned long +#endif +#endif + +#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG) +/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a + * %20 speed up (longs are 8 bytes, int's are 4). */ +#ifndef DES_LONG +#define DES_LONG unsigned int +#endif +#endif + +#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) +#define CONFIG_HEADER_BN_H +#define BN_LLONG + +/* Should we define BN_DIV2W here? */ + +/* Only one for the following should be defined */ +#undef SIXTY_FOUR_BIT_LONG +#undef SIXTY_FOUR_BIT +#define THIRTY_TWO_BIT +#endif + +#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H) +#define CONFIG_HEADER_RC4_LOCL_H +/* if this is defined data[i] is used instead of *data, this is a %20 + * speedup on x86 */ +#undef RC4_INDEX +#endif + +#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) +#define CONFIG_HEADER_BF_LOCL_H +#undef BF_PTR +#endif /* HEADER_BF_LOCL_H */ + +#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H) +#define CONFIG_HEADER_DES_LOCL_H +#ifndef DES_DEFAULT_OPTIONS +/* the following is tweaked from a config script, that is why it is a + * protected undef/define */ +#ifndef DES_PTR +#undef DES_PTR +#endif + +/* This helps C compiler generate the correct code for multiple functional + * units. It reduces register dependancies at the expense of 2 more + * registers */ +#ifndef DES_RISC1 +#undef DES_RISC1 +#endif + +#ifndef DES_RISC2 +#undef DES_RISC2 +#endif + +#if defined(DES_RISC1) && defined(DES_RISC2) +#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! +#endif + +/* Unroll the inner loop, this sometimes helps, sometimes hinders. + * Very mucy CPU dependant */ +#ifndef DES_UNROLL +#define DES_UNROLL +#endif + +/* These default values were supplied by + * Peter Gutman + * They are only used if nothing else has been defined */ +#if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL) +/* Special defines which change the way the code is built depending on the + CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find + even newer MIPS CPU's, but at the moment one size fits all for + optimization options. Older Sparc's work better with only UNROLL, but + there's no way to tell at compile time what it is you're running on */ + +#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ +# define DES_PTR +# define DES_RISC1 +# define DES_UNROLL +#elif defined( __ultrix ) /* Older MIPS */ +# define DES_PTR +# define DES_RISC2 +# define DES_UNROLL +#elif defined( __osf1__ ) /* Alpha */ +# define DES_PTR +# define DES_RISC2 +#elif defined ( _AIX ) /* RS6000 */ + /* Unknown */ +#elif defined( __hpux ) /* HP-PA */ + /* Unknown */ +#elif defined( __aux ) /* 68K */ + /* Unknown */ +#elif defined( __dgux ) /* 88K (but P6 in latest boxes) */ +# define DES_UNROLL +#elif defined( __sgi ) /* Newer MIPS */ +# define DES_PTR +# define DES_RISC2 +# define DES_UNROLL +#elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */ +# define DES_PTR +# define DES_RISC1 +# define DES_UNROLL +#endif /* Systems-specific speed defines */ +#endif + +#endif /* DES_DEFAULT_OPTIONS */ +#endif /* HEADER_DES_LOCL_H */ +#ifdef __cplusplus +} +#endif diff --git a/deps/openssl/config/archs/linux64-s390x/opensslconf.h b/deps/openssl/config/archs/linux64-s390x/opensslconf.h new file mode 100644 index 00000000000000..dbb03486798275 --- /dev/null +++ b/deps/openssl/config/archs/linux64-s390x/opensslconf.h @@ -0,0 +1,270 @@ +/* opensslconf.h */ +/* WARNING: Generated automatically from opensslconf.h.in by Configure. */ + +#ifdef __cplusplus +extern "C" { +#endif +/* OpenSSL was configured with the following options: */ +#ifndef OPENSSL_DOING_MAKEDEPEND + + +#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 +# define OPENSSL_NO_EC_NISTP_64_GCC_128 +#endif +#ifndef OPENSSL_NO_GMP +# define OPENSSL_NO_GMP +#endif +#ifndef OPENSSL_NO_JPAKE +# define OPENSSL_NO_JPAKE +#endif +#ifndef OPENSSL_NO_KRB5 +# define OPENSSL_NO_KRB5 +#endif +#ifndef OPENSSL_NO_LIBUNBOUND +# define OPENSSL_NO_LIBUNBOUND +#endif +#ifndef OPENSSL_NO_MD2 +# define OPENSSL_NO_MD2 +#endif +#ifndef OPENSSL_NO_RC5 +# define OPENSSL_NO_RC5 +#endif +#ifndef OPENSSL_NO_RFC3779 +# define OPENSSL_NO_RFC3779 +#endif +#ifndef OPENSSL_NO_SCTP +# define OPENSSL_NO_SCTP +#endif +#ifndef OPENSSL_NO_SSL_TRACE +# define OPENSSL_NO_SSL_TRACE +#endif +#ifndef OPENSSL_NO_SSL2 +# define OPENSSL_NO_SSL2 +#endif +#ifndef OPENSSL_NO_STORE +# define OPENSSL_NO_STORE +#endif +#ifndef OPENSSL_NO_UNIT_TEST +# define OPENSSL_NO_UNIT_TEST +#endif +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +#endif + +#endif /* OPENSSL_DOING_MAKEDEPEND */ + +#ifndef OPENSSL_THREADS +# define OPENSSL_THREADS +#endif +#ifndef OPENSSL_NO_DYNAMIC_ENGINE +# define OPENSSL_NO_DYNAMIC_ENGINE +#endif + +/* The OPENSSL_NO_* macros are also defined as NO_* if the application + asks for it. This is a transient feature that is provided for those + who haven't had the time to do the appropriate changes in their + applications. */ +#ifdef OPENSSL_ALGORITHM_DEFINES +# if defined(OPENSSL_NO_EC_NISTP_64_GCC_128) && !defined(NO_EC_NISTP_64_GCC_128) +# define NO_EC_NISTP_64_GCC_128 +# endif +# if defined(OPENSSL_NO_GMP) && !defined(NO_GMP) +# define NO_GMP +# endif +# if defined(OPENSSL_NO_JPAKE) && !defined(NO_JPAKE) +# define NO_JPAKE +# endif +# if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5) +# define NO_KRB5 +# endif +# if defined(OPENSSL_NO_LIBUNBOUND) && !defined(NO_LIBUNBOUND) +# define NO_LIBUNBOUND +# endif +# if defined(OPENSSL_NO_MD2) && !defined(NO_MD2) +# define NO_MD2 +# endif +# if defined(OPENSSL_NO_RC5) && !defined(NO_RC5) +# define NO_RC5 +# endif +# if defined(OPENSSL_NO_RFC3779) && !defined(NO_RFC3779) +# define NO_RFC3779 +# endif +# if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP) +# define NO_SCTP +# endif +# if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) +# define NO_SSL_TRACE +# endif +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) +# define NO_SSL2 +# endif +# if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) +# define NO_STORE +# endif +# if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) +# define NO_UNIT_TEST +# endif +# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) +# define NO_WEAK_SSL_CIPHERS +# endif +#endif + + + +/* crypto/opensslconf.h.in */ + +/* Generate 80386 code? */ +#undef I386_ONLY + +#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */ +#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR) +#define ENGINESDIR "/usr/local/ssl/lib/engines" +#define OPENSSLDIR "/usr/local/ssl" +#endif +#endif + +#undef OPENSSL_UNISTD +#define OPENSSL_UNISTD + +#undef OPENSSL_EXPORT_VAR_AS_FUNCTION + +#if defined(HEADER_IDEA_H) && !defined(IDEA_INT) +#define IDEA_INT unsigned int +#endif + +#if defined(HEADER_MD2_H) && !defined(MD2_INT) +#define MD2_INT unsigned int +#endif + +#if defined(HEADER_RC2_H) && !defined(RC2_INT) +/* I need to put in a mod for the alpha - eay */ +#define RC2_INT unsigned int +#endif + +#if defined(HEADER_RC4_H) +#if !defined(RC4_INT) +/* using int types make the structure larger but make the code faster + * on most boxes I have tested - up to %20 faster. */ +/* + * I don't know what does "most" mean, but declaring "int" is a must on: + * - Intel P6 because partial register stalls are very expensive; + * - elder Alpha because it lacks byte load/store instructions; + */ +#define RC4_INT unsigned char +#endif +#if !defined(RC4_CHUNK) +/* + * This enables code handling data aligned at natural CPU word + * boundary. See crypto/rc4/rc4_enc.c for further details. + */ +#define RC4_CHUNK unsigned long +#endif +#endif + +#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG) +/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a + * %20 speed up (longs are 8 bytes, int's are 4). */ +#ifndef DES_LONG +#define DES_LONG unsigned int +#endif +#endif + +#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H) +#define CONFIG_HEADER_BN_H +#undef BN_LLONG + +/* Should we define BN_DIV2W here? */ + +/* Only one for the following should be defined */ +#define SIXTY_FOUR_BIT_LONG +#undef SIXTY_FOUR_BIT +#undef THIRTY_TWO_BIT +#endif + +#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H) +#define CONFIG_HEADER_RC4_LOCL_H +/* if this is defined data[i] is used instead of *data, this is a %20 + * speedup on x86 */ +#undef RC4_INDEX +#endif + +#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) +#define CONFIG_HEADER_BF_LOCL_H +#undef BF_PTR +#endif /* HEADER_BF_LOCL_H */ + +#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H) +#define CONFIG_HEADER_DES_LOCL_H +#ifndef DES_DEFAULT_OPTIONS +/* the following is tweaked from a config script, that is why it is a + * protected undef/define */ +#ifndef DES_PTR +#undef DES_PTR +#endif + +/* This helps C compiler generate the correct code for multiple functional + * units. It reduces register dependancies at the expense of 2 more + * registers */ +#ifndef DES_RISC1 +#undef DES_RISC1 +#endif + +#ifndef DES_RISC2 +#undef DES_RISC2 +#endif + +#if defined(DES_RISC1) && defined(DES_RISC2) +#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!! +#endif + +/* Unroll the inner loop, this sometimes helps, sometimes hinders. + * Very mucy CPU dependant */ +#ifndef DES_UNROLL +#define DES_UNROLL +#endif + +/* These default values were supplied by + * Peter Gutman + * They are only used if nothing else has been defined */ +#if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL) +/* Special defines which change the way the code is built depending on the + CPU and OS. For SGI machines you can use _MIPS_SZLONG (32 or 64) to find + even newer MIPS CPU's, but at the moment one size fits all for + optimization options. Older Sparc's work better with only UNROLL, but + there's no way to tell at compile time what it is you're running on */ + +#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ +# define DES_PTR +# define DES_RISC1 +# define DES_UNROLL +#elif defined( __ultrix ) /* Older MIPS */ +# define DES_PTR +# define DES_RISC2 +# define DES_UNROLL +#elif defined( __osf1__ ) /* Alpha */ +# define DES_PTR +# define DES_RISC2 +#elif defined ( _AIX ) /* RS6000 */ + /* Unknown */ +#elif defined( __hpux ) /* HP-PA */ + /* Unknown */ +#elif defined( __aux ) /* 68K */ + /* Unknown */ +#elif defined( __dgux ) /* 88K (but P6 in latest boxes) */ +# define DES_UNROLL +#elif defined( __sgi ) /* Newer MIPS */ +# define DES_PTR +# define DES_RISC2 +# define DES_UNROLL +#elif defined(i386) || defined(__i386__) /* x86 boxes, should be gcc */ +# define DES_PTR +# define DES_RISC1 +# define DES_UNROLL +#endif /* Systems-specific speed defines */ +#endif + +#endif /* DES_DEFAULT_OPTIONS */ +#endif /* HEADER_DES_LOCL_H */ +#ifdef __cplusplus +} +#endif diff --git a/deps/openssl/config/archs/solaris-x86-gcc/opensslconf.h b/deps/openssl/config/archs/solaris-x86-gcc/opensslconf.h index d93c0bfbb5a0aa..769c15e052f9ff 100644 --- a/deps/openssl/config/archs/solaris-x86-gcc/opensslconf.h +++ b/deps/openssl/config/archs/solaris-x86-gcc/opensslconf.h @@ -38,12 +38,18 @@ extern "C" { #ifndef OPENSSL_NO_SSL_TRACE # define OPENSSL_NO_SSL_TRACE #endif +#ifndef OPENSSL_NO_SSL2 +# define OPENSSL_NO_SSL2 +#endif #ifndef OPENSSL_NO_STORE # define OPENSSL_NO_STORE #endif #ifndef OPENSSL_NO_UNIT_TEST # define OPENSSL_NO_UNIT_TEST #endif +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +#endif #endif /* OPENSSL_DOING_MAKEDEPEND */ @@ -89,12 +95,18 @@ extern "C" { # if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) # define NO_SSL_TRACE # endif +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) +# define NO_SSL2 +# endif # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) # define NO_STORE # endif # if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) # define NO_UNIT_TEST # endif +# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) +# define NO_WEAK_SSL_CIPHERS +# endif #endif @@ -221,7 +233,7 @@ extern "C" { optimization options. Older Sparc's work better with only UNROLL, but there's no way to tell at compile time what it is you're running on */ -#if defined( sun ) /* Newer Sparc's */ +#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ # define DES_PTR # define DES_RISC1 # define DES_UNROLL diff --git a/deps/openssl/config/archs/solaris64-x86_64-gcc/opensslconf.h b/deps/openssl/config/archs/solaris64-x86_64-gcc/opensslconf.h index ee73a6de4e7747..231c8f3628079d 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/opensslconf.h +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/opensslconf.h @@ -38,12 +38,18 @@ extern "C" { #ifndef OPENSSL_NO_SSL_TRACE # define OPENSSL_NO_SSL_TRACE #endif +#ifndef OPENSSL_NO_SSL2 +# define OPENSSL_NO_SSL2 +#endif #ifndef OPENSSL_NO_STORE # define OPENSSL_NO_STORE #endif #ifndef OPENSSL_NO_UNIT_TEST # define OPENSSL_NO_UNIT_TEST #endif +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +#endif #endif /* OPENSSL_DOING_MAKEDEPEND */ @@ -89,12 +95,18 @@ extern "C" { # if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE) # define NO_SSL_TRACE # endif +# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2) +# define NO_SSL2 +# endif # if defined(OPENSSL_NO_STORE) && !defined(NO_STORE) # define NO_STORE # endif # if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) # define NO_UNIT_TEST # endif +# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS) +# define NO_WEAK_SSL_CIPHERS +# endif #endif @@ -221,7 +233,7 @@ extern "C" { optimization options. Older Sparc's work better with only UNROLL, but there's no way to tell at compile time what it is you're running on */ -#if defined( sun ) /* Newer Sparc's */ +#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ # define DES_PTR # define DES_RISC1 # define DES_UNROLL diff --git a/deps/openssl/config/opensslconf.h b/deps/openssl/config/opensslconf.h index 9a7cda94543e68..9b20fb6485aa84 100644 --- a/deps/openssl/config/opensslconf.h +++ b/deps/openssl/config/opensslconf.h @@ -27,6 +27,8 @@ | linux | arm64 | linux-aarch64 | o | | linux | ppc | linux-ppc | o | | linux | ppc64 | linux-ppc64 | o | + | linux | s390 | linux32-s390x | o | + | linux | s390x | linux64-s390x | o | | mac | ia32 | darwin-i386-cc | o | | mac | x64 | darwin64-x86-cc | o | | win | ia32 | VC-WIN32 | - | @@ -68,6 +70,8 @@ | | _ARCH_PPC | | ppc64 | __PPC64__ | | | _ARCH_PPC64 | + | s390 | __s390__ | + | s390x | __s390x__ | These are the list which is not implemented yet. @@ -124,6 +128,10 @@ # include "./archs/aix64-gcc/opensslconf.h" #elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) # include "./archs/aix-gcc/opensslconf.h" +#elif defined(OPENSSL_LINUX) && defined(__s390x__) +# include "./archs/linux64-s390x/opensslconf.h" +#elif defined(OPENSSL_LINUX) && defined(__s390__) +# include "./archs/linux32-s390x/opensslconf.h" #else # include "./archs/linux-elf/opensslconf.h" #endif diff --git a/deps/openssl/doc/UPGRADING.md b/deps/openssl/doc/UPGRADING.md index aac92f730acc9c..5c8919d2cf349e 100644 --- a/deps/openssl/doc/UPGRADING.md +++ b/deps/openssl/doc/UPGRADING.md @@ -1,8 +1,8 @@ ## How to upgrade openssl library in Node.js -This document describes the procedure to upgrade openssl from 1.0.2a -to 1.0.2c in Node.js. - +This document describes the procedure to upgrade openssl from 1.0.2e +to 1.0.2f in Node.js. This procedure might be applied to upgrading +any versions in 1.0.2. ### Build System and Upgrading Overview The openssl build system is based on the `Configure` perl script in @@ -31,6 +31,8 @@ The tested platform in CI are also listed. | --dest-os | --dest-cpu | conf | asm | openssl target | CI | |---------- |----------- |----- |----- |------------------- |--- | +| aix | ppc | o | x(*2)| aix-gcc | o | +| aix | ppc64 | o | x(*2)| aix64-gcc | o | | linux | ia32 | o | o |linux-elf | o | | linux | x32 | o | x(*2)|linux-x32 | x | | linux | x64 | o | o |linux-x86_64 | o | @@ -91,48 +93,197 @@ https://github.com/openssl/openssl/blob/OpenSSL_1_0_2-stable/crypto/sha/asm/sha5 otherwise asm_obsolete are used. The following is the detail instruction steps how to upgrade openssl -version from 1.0.2a to 1.0.2c in node. +version from 1.0.2e to 1.0.2f in node. + +*This needs to run Linux +enviroment.* ### 1. Replace openssl source in `deps/openssl/openssl` Remove old openssl sources in `deps/openssl/openssl` . Get original openssl sources from -https://www.openssl.org/source/openssl-1.0.2c.tar.gz and extract all +https://www.openssl.org/source/openssl-1.0.2f.tar.gz and extract all files into `deps/openssl/openssl` . -### 2. Apply private patches -There are three kinds of private patches to be applied in openssl-1.0.2c. - -- The two fixes of assembly error on ia32 win32. masm is no longer - supported in openssl. We should move to use nasm or yasm in future - version of node. - -- The fix of openssl-cli built on win. Key press requirement of - openssl-cli in win causes timeout failures of several tests. +```sh +ohtsu@ubuntu:~/github/node$ cd deps/openssl/ +ohtsu@ubuntu:~/github/node/deps/openssl$ rm -rf openssl +ohtsu@ubuntu:~/github/node/deps/openssl$ tar zxf ~/tmp/openssl-1.0.2f.tar.gz +ohtsu@ubuntu:~/github/node/deps/openssl$ mv openssl-1.0.2f openssl +ohtsu@ubuntu:~/github/node/deps/openssl$ git add --all openssl +ohtsu@ubuntu:~/github/node/deps/openssl$ git commit openssl +```` +The commit message can be -- A new `-no_rand_screen` option to openssl s_client. This makes test - time of test-tls-server-verify be much faster. +>deps: upgrade openssl sources to 1.0.2f +> +>This replaces all sources of openssl-1.0.2f.tar.gz into +>deps/openssl/openssl -### 3. Replace openssl header files in `deps/openssl/openssl/include/openssl` +### 2. Replace openssl header files in `deps/openssl/openssl/include/openssl` all header files in `deps/openssl/openssl/include/openssl/*.h` are symbolic links in the distributed release tar.gz. They cause issues in Windows. They are copied from the real files of symlink origin into the include directory. During installation, they also copied into `PREFIX/node/include` by tools/install.py. +`deps/openssl/openssl/include/openssl/opensslconf.h` and +`deps/openssl/openssl/crypto/opensslconf.h` needs to be changed so as +to refer the platform independent file of `deps/openssl/config/opensslconf.h` + +The following shell script (copy_symlink.sh) is my tool for working +this procedures to invoke it in the `deps/openssl/openssl/include/openssl/`. + +```sh +#!/bin/bash +for var in "$@" +do + if [ -L $var ]; then + origin=`readlink $var` + rm $var + cp $origin $var + fi +done +rm opensslconf.h +echo '#include "../../crypto/opensslconf.h"' > opensslconf.h +rm ../../crypto/opensslconf.h +echo '#include "../../config/opensslconf.h"' > ../../crypto/opensslconf.h +```` + +This step somehow gets troublesome since openssl-1.0.2f because +symlink headers are removed in tar.gz file and we have to execute +./config script to generate them. The config script also generate +unnecessary platform dependent files in the repository so that we have +to clean up them after committing header files. + +```sh +ohtsu@ubuntu:~/github/node/deps/openssl$ cd openssl/ +ohtsu@ubuntu:~/github/node/deps/openssl/openssl$ ./config + +make[1]: Leaving directory `/home/ohtsu/github/node/deps/openssl/openssl/test' + +Configured for linux-x86_64. +ohtsu@ubuntu:~/github/node/deps/openssl/openssl$ cd include/openssl/ +ohtsu@ubuntu:~/github/node/deps/openssl/openssl/include/openssl$ ~/copy_symlink.sh *.h +ohtsu@ubuntu:~/github/node/deps/openssl/openssl/include/openssl$ cd ../.. +ohtsu@ubuntu:~/github/node/deps/openssl/openssl$ git add include +ohtsu@ubuntu:~/github/node/deps/openssl/openssl$ git commit include/ crypto/opensslconf.h +ohtsu@ubuntu:~/github/node/deps/openssl/openssl$ git clean -f +ohtsu@ubuntu:~/github/node/deps/openssl/openssl$ git checkout Makefile Makefile.bak +```` +The commit message can be + +>deps: copy all openssl header files to include dir +> +>All symlink files in `deps/openssl/openssl/include/openssl/` +>are removed and replaced with real header files to avoid +>issues on Windows. Two files of opensslconf.h in crypto and +>include dir are replaced to refer config/opensslconf.h. + +### 3. Apply floating patches +At the time of writing, there are four floating patches to be applied +to openssl. + +- Two fixes for assembly errors on ia32 win32. + +- One fix for openssl-cli built on win. Key press requirement of + openssl-cli in win causes timeout failures of several tests. + +- Adding a new `-no_rand_screen` option to openssl s_client. This + makes test time of test-tls-server-verify be much faster. + +These fixes can be applied via cherry-pick. The first three will merge without conflict. +The last commit can be landed using a recursive strategy that prefers newer changes. + +```sh +git cherry-pick c66c3d9fa3f5bab0bdfe363dd947136cf8a3907f +git cherry-pick 42a8de2ac66b6953cbc731fdb0b128b8019643b2 +git cherry-pick 2eb170874aa5e84e71b62caab7ac9792fd59c10f +git cherry-pick --strategy=recursive -X theirs 664a659 +``` + +If you attempted to cherry-pick the last commit you would have the following conflict + +``` +# do not do this +git cherry-pick 664a6596960655e214fef25e74d3285097703e95 +error: could not apply 664a659... deps: add -no_rand_screen to openssl s_client +hint: after resolving the conflicts, mark the corrected paths +hint: with 'git add ' or 'git rm ' +hint: and commit the result with 'git commit' +git cherry-pi +``` + +the conflict is in `deps/openssl/openssl/apps/app_rand.c` as below. + +```sh +ohtsu@omb:openssl$ git diff +diff --cc deps/openssl/openssl/apps/app_rand.c +index 7f40bba,b6fe294..0000000 +--- a/deps/openssl/openssl/apps/app_rand.c ++++ b/deps/openssl/openssl/apps/app_rand.c +@@@ -124,7 -124,16 +124,20 @@@ int app_RAND_load_file(const char *file + char buffer[200]; + + #ifdef OPENSSL_SYS_WINDOWS + ++<<<<<<< HEAD + + RAND_screen(); + ++======= + + /* + + * allocate 2 to dont_warn not to use RAND_screen() via + + * -no_rand_screen option in s_client + + */ + + if (dont_warn != 2) { + + BIO_printf(bio_e, "Loading 'screen' into random state -"); + + BIO_flush(bio_e); + + RAND_screen(); + + BIO_printf(bio_e, " done\n"); + + } + ++>>>>>>> 664a659... deps: add -no_rand_screen to openssl s_client + #endif + + if (file == NULL) +```` + +We want to opt for the changes from 664a659 instead of the changes present on HEAD. +`git cherry-pick --strategy=recursive -X theirs` will do just that! ### 4. Change `opensslconf.h` so as to fit each platform. -No change. +opensslconf.h includes defines and macros which are platform +dependent. Each files can be generated via `deps/openssl/config/Makefile` +We can regenerate them and commit them if any diffs exist. + +```sh +ohtsu@ubuntu:~/github/node/deps/openssl$ cd config +ohtsu@ubuntu:~/github/node/deps/openssl/config$ make clean +find archs -name opensslconf.h -exec rm "{}" \; +ohtsu@ubuntu:~/github/node/deps/openssl/config$ make +cd ../openssl; perl ./Configure no-shared no-symlinks aix-gcc > /dev/null +ohtsu@ubuntu:~/github/node/deps/openssl/config$ git diff +ohtsu@ubuntu:~/github/node/deps/openssl/config$ git commit . +```` +The commit message can be + +>deps: update openssl config files +> +>Regenerate config files for supported platforms with Makefile. ### 5. Update openssl.gyp and openssl.gypi -No change. +This process is needed when source files are removed, renamed and added. +It seldom happen in the minor bug fix release. Build errors would be +thrown if it happens. In case of build errors, we need to check source +files in Makefiles of its platform and change openssl.gyp or +openssl.gypi according to the changes of source files. Please contact +@shigeki if it is needed. ### 6. ASM files for openssl We provide two sets of asm files. One is for the latest assembler -and the other is the older one. +and the other is the older one. sections 6.1 and 6.2 describe the two +types of files. Section 6.3 explains the steps to update the files. +In the case of upgrading 1.0.2f there were no changes to the asm files. ### 6.1. asm files for the latest compiler This was made in `deps/openssl/asm/Makefile` - Updated asm files for each platforms which are required in - openssl-1.0.2c. + openssl-1.0.2f. - Some perl files need CC and ASM envs. Added a check if these envs exist. Followed asm files are to be generated with CC=gcc and ASM=nasm on Linux. See @@ -148,8 +299,9 @@ This was made in `deps/openssl/asm/Makefile` With export environments of CC=gcc and ASM=nasm, then type make command and check if new asm files are generated. +If you don't have nasm please install it such as `apt-get install nasm`. -### 6.2.asm files for the older compiler +### 6.2. asm files for the older compiler For older assembler, the version check of CC and ASM should be skipped in generating asm file with perl scripts. Copy files from `deps/openssl/asm` into @@ -158,3 +310,42 @@ into this directories and remove the check of CC and ASM envs. Without environments of CC and ASM, then type make command and check if new asm files for older compilers are generated. + +The following steps includes version check of gcc and nasm. + +### 6.3 steps + +```sh +ohtsu@ubuntu:~/github/node/deps/openssl/config$ cd ../asm +ohtsu@ubuntu:~/github/node/deps/openssl/asm$ gcc --version +gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4 +Copyright (C) 2013 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +ohtsu@ubuntu:~/github/node/deps/openssl/asm$ nasm -v +NASM version 2.10.09 compiled on Dec 29 2013 +ohtsu@ubuntu:~/github/node/deps/openssl/asm$ export CC=gcc +ohtsu@ubuntu:~/github/node/deps/openssl/asm$ export ASM=nasm +ohtsu@ubuntu:~/github/node/deps/openssl/asm$ make clean +find . -iname '*.asm' -exec rm "{}" \; +find . -iname '*.s' -exec rm "{}" \; +find . -iname '*.S' -exec rm "{}" \; +ohtsu@ubuntu:~/github/node/deps/openssl/asm$ make +ohtsu@ubuntu:~/github/node/deps/openssl/asm$ cd ../asm_obsolete/ +ohtsu@ubuntu:~/github/node/deps/openssl/asm_obsolete$ unset CC +ohtsu@ubuntu:~/github/node/deps/openssl/asm_obsolete$ unset ASM +ohtsu@ubuntu:~/github/node/deps/openssl/asm_obsolete$ make clean +find . -iname '*.asm' -exec rm "{}" \; +find . -iname '*.s' -exec rm "{}" \; +find . -iname '*.S' -exec rm "{}" \; +ohtsu@ubuntu:~/github/node/deps/openssl$ git status +ohtsu@ubuntu:~/github/node/deps/openssl$ git commit asm asm_obsolete +```` +The commit message can be + +>deps: update openssl asm and asm_obsolete files +> +>Regenerate asm files with Makefile and CC=gcc and ASM=gcc where +>gcc-4.8.4. Also asm files in asm_obsolete dir to support old compiler +>and assembler are regenerated without CC and ASM envs. diff --git a/deps/openssl/openssl.gyp b/deps/openssl/openssl.gyp index 3a319d91f0df7a..db57033d54e20e 100644 --- a/deps/openssl/openssl.gyp +++ b/deps/openssl/openssl.gyp @@ -8,6 +8,7 @@ 'gcc_version': 0, 'openssl_no_asm%': 0, 'llvm_version%': 0, + 'xcode_version%': 0, 'gas_version%': 0, 'openssl_fips%': 'false', }, diff --git a/deps/openssl/openssl.gypi b/deps/openssl/openssl.gypi index e2e06d8333172c..63286a1a64138c 100644 --- a/deps/openssl/openssl.gypi +++ b/deps/openssl/openssl.gypi @@ -1040,7 +1040,7 @@ # 'conditions': [ ['(OS=="win" and MSVS_VERSION>="2012") or ' - 'llvm_version>="3.3" or gas_version>="2.23"', { + 'llvm_version>="3.3" or xcode_version>="5.0" or gas_version>="2.23"', { 'openssl_sources_x64_win_masm': [ '<@(openssl_sources_asm_latest_x64_win_masm)', '<@(openssl_sources_common_x64_win_masm)', @@ -1252,10 +1252,6 @@ 'PURIFY', '_REENTRANT', - # SSLv2 is known broken and has been superseded by SSLv3 for almost - # twenty years now. - 'OPENSSL_NO_SSL2', - # SSLv3 is susceptible to downgrade attacks (POODLE.) 'OPENSSL_NO_SSL3', diff --git a/deps/openssl/openssl/ACKNOWLEDGMENTS b/deps/openssl/openssl/ACKNOWLEDGMENTS index 59c6f01f97f652..d21dccbb79cfa1 100644 --- a/deps/openssl/openssl/ACKNOWLEDGMENTS +++ b/deps/openssl/openssl/ACKNOWLEDGMENTS @@ -1,30 +1,2 @@ -The OpenSSL project depends on volunteer efforts and financial support from -the end user community. That support comes in the form of donations and paid -sponsorships, software support contracts, paid consulting services -and commissioned software development. - -Since all these activities support the continued development and improvement -of OpenSSL we consider all these clients and customers as sponsors of the -OpenSSL project. - -We would like to identify and thank the following such sponsors for their past -or current significant support of the OpenSSL project: - -Major support: - - Qualys http://www.qualys.com/ - -Very significant support: - - OpenGear: http://www.opengear.com/ - -Significant support: - - PSW Group: http://www.psw.net/ - Acano Ltd. http://acano.com/ - -Please note that we ask permission to identify sponsors and that some sponsors -we consider eligible for inclusion here have requested to remain anonymous. - -Additional sponsorship or financial support is always welcome: for more -information please contact the OpenSSL Software Foundation. +Please https://www.openssl.org/community/thanks.html for the current +acknowledgements. diff --git a/deps/openssl/openssl/CHANGES b/deps/openssl/openssl/CHANGES index 5d4c234363f6a4..df4b6064ddb9e9 100644 --- a/deps/openssl/openssl/CHANGES +++ b/deps/openssl/openssl/CHANGES @@ -2,6 +2,244 @@ OpenSSL CHANGES _______________ + Changes between 1.0.2f and 1.0.2g [1 Mar 2016] + + * Disable weak ciphers in SSLv3 and up in default builds of OpenSSL. + Builds that are not configured with "enable-weak-ssl-ciphers" will not + provide any "EXPORT" or "LOW" strength ciphers. + [Viktor Dukhovni] + + * Disable SSLv2 default build, default negotiation and weak ciphers. SSLv2 + is by default disabled at build-time. Builds that are not configured with + "enable-ssl2" will not support SSLv2. Even if "enable-ssl2" is used, + users who want to negotiate SSLv2 via the version-flexible SSLv23_method() + will need to explicitly call either of: + + SSL_CTX_clear_options(ctx, SSL_OP_NO_SSLv2); + or + SSL_clear_options(ssl, SSL_OP_NO_SSLv2); + + as appropriate. Even if either of those is used, or the application + explicitly uses the version-specific SSLv2_method() or its client and + server variants, SSLv2 ciphers vulnerable to exhaustive search key + recovery have been removed. Specifically, the SSLv2 40-bit EXPORT + ciphers, and SSLv2 56-bit DES are no longer available. + (CVE-2016-0800) + [Viktor Dukhovni] + + *) Fix a double-free in DSA code + + A double free bug was discovered when OpenSSL parses malformed DSA private + keys and could lead to a DoS attack or memory corruption for applications + that receive DSA private keys from untrusted sources. This scenario is + considered rare. + + This issue was reported to OpenSSL by Adam Langley(Google/BoringSSL) using + libFuzzer. + (CVE-2016-0705) + [Stephen Henson] + + *) Disable SRP fake user seed to address a server memory leak. + + Add a new method SRP_VBASE_get1_by_user that handles the seed properly. + + SRP_VBASE_get_by_user had inconsistent memory management behaviour. + In order to fix an unavoidable memory leak, SRP_VBASE_get_by_user + was changed to ignore the "fake user" SRP seed, even if the seed + is configured. + + Users should use SRP_VBASE_get1_by_user instead. Note that in + SRP_VBASE_get1_by_user, caller must free the returned value. Note + also that even though configuring the SRP seed attempts to hide + invalid usernames by continuing the handshake with fake + credentials, this behaviour is not constant time and no strong + guarantees are made that the handshake is indistinguishable from + that of a valid user. + (CVE-2016-0798) + [Emilia Käsper] + + *) Fix BN_hex2bn/BN_dec2bn NULL pointer deref/heap corruption + + In the BN_hex2bn function the number of hex digits is calculated using an + int value |i|. Later |bn_expand| is called with a value of |i * 4|. For + large values of |i| this can result in |bn_expand| not allocating any + memory because |i * 4| is negative. This can leave the internal BIGNUM data + field as NULL leading to a subsequent NULL ptr deref. For very large values + of |i|, the calculation |i * 4| could be a positive value smaller than |i|. + In this case memory is allocated to the internal BIGNUM data field, but it + is insufficiently sized leading to heap corruption. A similar issue exists + in BN_dec2bn. This could have security consequences if BN_hex2bn/BN_dec2bn + is ever called by user applications with very large untrusted hex/dec data. + This is anticipated to be a rare occurrence. + + All OpenSSL internal usage of these functions use data that is not expected + to be untrusted, e.g. config file data or application command line + arguments. If user developed applications generate config file data based + on untrusted data then it is possible that this could also lead to security + consequences. This is also anticipated to be rare. + + This issue was reported to OpenSSL by Guido Vranken. + (CVE-2016-0797) + [Matt Caswell] + + *) Fix memory issues in BIO_*printf functions + + The internal |fmtstr| function used in processing a "%s" format string in + the BIO_*printf functions could overflow while calculating the length of a + string and cause an OOB read when printing very long strings. + + Additionally the internal |doapr_outch| function can attempt to write to an + OOB memory location (at an offset from the NULL pointer) in the event of a + memory allocation failure. In 1.0.2 and below this could be caused where + the size of a buffer to be allocated is greater than INT_MAX. E.g. this + could be in processing a very long "%s" format string. Memory leaks can + also occur. + + The first issue may mask the second issue dependent on compiler behaviour. + These problems could enable attacks where large amounts of untrusted data + is passed to the BIO_*printf functions. If applications use these functions + in this way then they could be vulnerable. OpenSSL itself uses these + functions when printing out human-readable dumps of ASN.1 data. Therefore + applications that print this data could be vulnerable if the data is from + untrusted sources. OpenSSL command line applications could also be + vulnerable where they print out ASN.1 data, or if untrusted data is passed + as command line arguments. + + Libssl is not considered directly vulnerable. Additionally certificates etc + received via remote connections via libssl are also unlikely to be able to + trigger these issues because of message size limits enforced within libssl. + + This issue was reported to OpenSSL Guido Vranken. + (CVE-2016-0799) + [Matt Caswell] + + *) Side channel attack on modular exponentiation + + A side-channel attack was found which makes use of cache-bank conflicts on + the Intel Sandy-Bridge microarchitecture which could lead to the recovery + of RSA keys. The ability to exploit this issue is limited as it relies on + an attacker who has control of code in a thread running on the same + hyper-threaded core as the victim thread which is performing decryptions. + + This issue was reported to OpenSSL by Yuval Yarom, The University of + Adelaide and NICTA, Daniel Genkin, Technion and Tel Aviv University, and + Nadia Heninger, University of Pennsylvania with more information at + http://cachebleed.info. + (CVE-2016-0702) + [Andy Polyakov] + + *) Change the req app to generate a 2048-bit RSA/DSA key by default, + if no keysize is specified with default_bits. This fixes an + omission in an earlier change that changed all RSA/DSA key generation + apps to use 2048 bits by default. + [Emilia Käsper] + + Changes between 1.0.2e and 1.0.2f [28 Jan 2016] + + *) DH small subgroups + + Historically OpenSSL only ever generated DH parameters based on "safe" + primes. More recently (in version 1.0.2) support was provided for + generating X9.42 style parameter files such as those required for RFC 5114 + support. The primes used in such files may not be "safe". Where an + application is using DH configured with parameters based on primes that are + not "safe" then an attacker could use this fact to find a peer's private + DH exponent. This attack requires that the attacker complete multiple + handshakes in which the peer uses the same private DH exponent. For example + this could be used to discover a TLS server's private DH exponent if it's + reusing the private DH exponent or it's using a static DH ciphersuite. + + OpenSSL provides the option SSL_OP_SINGLE_DH_USE for ephemeral DH (DHE) in + TLS. It is not on by default. If the option is not set then the server + reuses the same private DH exponent for the life of the server process and + would be vulnerable to this attack. It is believed that many popular + applications do set this option and would therefore not be at risk. + + The fix for this issue adds an additional check where a "q" parameter is + available (as is the case in X9.42 based parameters). This detects the + only known attack, and is the only possible defense for static DH + ciphersuites. This could have some performance impact. + + Additionally the SSL_OP_SINGLE_DH_USE option has been switched on by + default and cannot be disabled. This could have some performance impact. + + This issue was reported to OpenSSL by Antonio Sanso (Adobe). + (CVE-2016-0701) + [Matt Caswell] + + *) SSLv2 doesn't block disabled ciphers + + A malicious client can negotiate SSLv2 ciphers that have been disabled on + the server and complete SSLv2 handshakes even if all SSLv2 ciphers have + been disabled, provided that the SSLv2 protocol was not also disabled via + SSL_OP_NO_SSLv2. + + This issue was reported to OpenSSL on 26th December 2015 by Nimrod Aviram + and Sebastian Schinzel. + (CVE-2015-3197) + [Viktor Dukhovni] + + *) Reject DH handshakes with parameters shorter than 1024 bits. + [Kurt Roeckx] + + Changes between 1.0.2d and 1.0.2e [3 Dec 2015] + + *) BN_mod_exp may produce incorrect results on x86_64 + + There is a carry propagating bug in the x86_64 Montgomery squaring + procedure. No EC algorithms are affected. Analysis suggests that attacks + against RSA and DSA as a result of this defect would be very difficult to + perform and are not believed likely. Attacks against DH are considered just + feasible (although very difficult) because most of the work necessary to + deduce information about a private key may be performed offline. The amount + of resources required for such an attack would be very significant and + likely only accessible to a limited number of attackers. An attacker would + additionally need online access to an unpatched system using the target + private key in a scenario with persistent DH parameters and a private + key that is shared between multiple clients. For example this can occur by + default in OpenSSL DHE based SSL/TLS ciphersuites. + + This issue was reported to OpenSSL by Hanno Böck. + (CVE-2015-3193) + [Andy Polyakov] + + *) Certificate verify crash with missing PSS parameter + + The signature verification routines will crash with a NULL pointer + dereference if presented with an ASN.1 signature using the RSA PSS + algorithm and absent mask generation function parameter. Since these + routines are used to verify certificate signature algorithms this can be + used to crash any certificate verification operation and exploited in a + DoS attack. Any application which performs certificate verification is + vulnerable including OpenSSL clients and servers which enable client + authentication. + + This issue was reported to OpenSSL by Loïc Jonas Etienne (Qnective AG). + (CVE-2015-3194) + [Stephen Henson] + + *) X509_ATTRIBUTE memory leak + + When presented with a malformed X509_ATTRIBUTE structure OpenSSL will leak + memory. This structure is used by the PKCS#7 and CMS routines so any + application which reads PKCS#7 or CMS data from untrusted sources is + affected. SSL/TLS is not affected. + + This issue was reported to OpenSSL by Adam Langley (Google/BoringSSL) using + libFuzzer. + (CVE-2015-3195) + [Stephen Henson] + + *) Rewrite EVP_DecodeUpdate (base64 decoding) to fix several bugs. + This changes the decoding behaviour for some invalid messages, + though the change is mostly in the more lenient direction, and + legacy behaviour is preserved as much as possible. + [Emilia Käsper] + + *) In DSA_generate_parameters_ex, if the provided seed is too short, + use a random seed, as already documented. + [Rich Salz and Ismo Puustinen ] + Changes between 1.0.2c and 1.0.2d [9 Jul 2015] *) Alternate chains certificate forgery @@ -15,8 +253,18 @@ This issue was reported to OpenSSL by Adam Langley/David Benjamin (Google/BoringSSL). + (CVE-2015-1793) [Matt Caswell] + *) Race condition handling PSK identify hint + + If PSK identity hints are received by a multi-threaded client then + the values are wrongly updated in the parent SSL_CTX structure. This can + result in a race condition potentially leading to a double free of the + identify hint data. + (CVE-2015-3196) + [Stephen Henson] + Changes between 1.0.2b and 1.0.2c [12 Jun 2015] *) Fix HMAC ABI incompatibility. The previous version introduced an ABI @@ -55,9 +303,9 @@ callbacks. This issue was reported to OpenSSL by Robert Swiecki (Google), and - independently by Hanno B�ck. + independently by Hanno Böck. (CVE-2015-1789) - [Emilia K�sper] + [Emilia Käsper] *) PKCS7 crash with missing EnvelopedContent @@ -71,7 +319,7 @@ This issue was reported to OpenSSL by Michal Zalewski (Google). (CVE-2015-1790) - [Emilia K�sper] + [Emilia Käsper] *) CMS verify infinite loop with unknown hash function @@ -201,7 +449,7 @@ This issue was reported to OpenSSL by Michal Zalewski (Google). (CVE-2015-0289) - [Emilia K�sper] + [Emilia Käsper] *) DoS via reachable assert in SSLv2 servers fix @@ -209,10 +457,10 @@ servers that both support SSLv2 and enable export cipher suites by sending a specially crafted SSLv2 CLIENT-MASTER-KEY message. - This issue was discovered by Sean Burford (Google) and Emilia K�sper + This issue was discovered by Sean Burford (Google) and Emilia Käsper (OpenSSL development team). (CVE-2015-0293) - [Emilia K�sper] + [Emilia Käsper] *) Empty CKE with client auth and DHE fix @@ -272,6 +520,10 @@ Changes between 1.0.1l and 1.0.2 [22 Jan 2015] + *) Change RSA and DH/DSA key generation apps to generate 2048-bit + keys by default. + [Kurt Roeckx] + *) Facilitate "universal" ARM builds targeting range of ARM ISAs, e.g. ARMv5 through ARMv8, as opposite to "locking" it to single one. So far those who have to target multiple plaforms would compromise @@ -717,12 +969,12 @@ version does not match the session's version. Resuming with a different version, while not strictly forbidden by the RFC, is of questionable sanity and breaks all known clients. - [David Benjamin, Emilia K�sper] + [David Benjamin, Emilia Käsper] *) Tighten handling of the ChangeCipherSpec (CCS) message: reject early CCS messages during renegotiation. (Note that because renegotiation is encrypted, this early CCS was not exploitable.) - [Emilia K�sper] + [Emilia Käsper] *) Tighten client-side session ticket handling during renegotiation: ensure that the client only accepts a session ticket if the server sends @@ -733,7 +985,7 @@ Similarly, ensure that the client requires a session ticket if one was advertised in the ServerHello. Previously, a TLS client would ignore a missing NewSessionTicket message. - [Emilia K�sper] + [Emilia Käsper] Changes between 1.0.1i and 1.0.1j [15 Oct 2014] @@ -813,10 +1065,10 @@ with a null pointer dereference (read) by specifying an anonymous (EC)DH ciphersuite and sending carefully crafted handshake messages. - Thanks to Felix Gr�bert (Google) for discovering and researching this + Thanks to Felix Gröbert (Google) for discovering and researching this issue. (CVE-2014-3510) - [Emilia K�sper] + [Emilia Käsper] *) By sending carefully crafted DTLS packets an attacker could cause openssl to leak memory. This can be exploited through a Denial of Service attack. @@ -853,7 +1105,7 @@ properly negotiated with the client. This can be exploited through a Denial of Service attack. - Thanks to Joonas Kuorilehto and Riku Hietam�ki (Codenomicon) for + Thanks to Joonas Kuorilehto and Riku Hietamäki (Codenomicon) for discovering and researching this issue. (CVE-2014-5139) [Steve Henson] @@ -865,7 +1117,7 @@ Thanks to Ivan Fratric (Google) for discovering this issue. (CVE-2014-3508) - [Emilia K�sper, and Steve Henson] + [Emilia Käsper, and Steve Henson] *) Fix ec_GFp_simple_points_make_affine (thus, EC_POINTs_mul etc.) for corner cases. (Certain input points at infinity could lead to @@ -895,22 +1147,22 @@ client or server. This is potentially exploitable to run arbitrary code on a vulnerable client or server. - Thanks to J�ri Aedla for reporting this issue. (CVE-2014-0195) - [J�ri Aedla, Steve Henson] + Thanks to Jüri Aedla for reporting this issue. (CVE-2014-0195) + [Jüri Aedla, Steve Henson] *) Fix bug in TLS code where clients enable anonymous ECDH ciphersuites are subject to a denial of service attack. - Thanks to Felix Gr�bert and Ivan Fratric at Google for discovering + Thanks to Felix Gröbert and Ivan Fratric at Google for discovering this issue. (CVE-2014-3470) - [Felix Gr�bert, Ivan Fratric, Steve Henson] + [Felix Gröbert, Ivan Fratric, Steve Henson] *) Harmonize version and its documentation. -f flag is used to display compilation flags. [mancha ] *) Fix eckey_priv_encode so it immediately returns an error upon a failure - in i2d_ECPrivateKey. + in i2d_ECPrivateKey. Thanks to Ted Unangst for feedback on this issue. [mancha ] *) Fix some double frees. These are not thought to be exploitable. @@ -982,9 +1234,9 @@ Thanks go to Nadhem Alfardan and Kenny Paterson of the Information Security Group at Royal Holloway, University of London (www.isg.rhul.ac.uk) for discovering this flaw and Adam Langley and - Emilia K�sper for the initial patch. + Emilia Käsper for the initial patch. (CVE-2013-0169) - [Emilia K�sper, Adam Langley, Ben Laurie, Andy Polyakov, Steve Henson] + [Emilia Käsper, Adam Langley, Ben Laurie, Andy Polyakov, Steve Henson] *) Fix flaw in AESNI handling of TLS 1.2 and 1.1 records for CBC mode ciphersuites which can be exploited in a denial of service attack. @@ -1159,7 +1411,7 @@ EC_GROUP_new_by_curve_name() will automatically use these (while EC_GROUP_new_curve_GFp() currently prefers the more flexible implementations). - [Emilia K�sper, Adam Langley, Bodo Moeller (Google)] + [Emilia Käsper, Adam Langley, Bodo Moeller (Google)] *) Use type ossl_ssize_t instad of ssize_t which isn't available on all platforms. Move ssize_t definition from e_os.h to the public @@ -1435,7 +1687,7 @@ [Adam Langley (Google)] *) Fix spurious failures in ecdsatest.c. - [Emilia K�sper (Google)] + [Emilia Käsper (Google)] *) Fix the BIO_f_buffer() implementation (which was mixing different interpretations of the '..._len' fields). @@ -1449,7 +1701,7 @@ lock to call BN_BLINDING_invert_ex, and avoids one use of BN_BLINDING_update for each BN_BLINDING structure (previously, the last update always remained unused). - [Emilia K�sper (Google)] + [Emilia Käsper (Google)] *) In ssl3_clear, preserve s3->init_extra along with s3->rbuf. [Bob Buckholz (Google)] @@ -2258,7 +2510,7 @@ *) Add RFC 3161 compliant time stamp request creation, response generation and response verification functionality. - [Zolt�n Gl�zik , The OpenTSA Project] + [Zoltán Glózik , The OpenTSA Project] *) Add initial support for TLS extensions, specifically for the server_name extension so far. The SSL_SESSION, SSL_CTX, and SSL data structures now @@ -3426,7 +3678,7 @@ *) BN_CTX_get() should return zero-valued bignums, providing the same initialised value as BN_new(). - [Geoff Thorpe, suggested by Ulf M�ller] + [Geoff Thorpe, suggested by Ulf Möller] *) Support for inhibitAnyPolicy certificate extension. [Steve Henson] @@ -3445,7 +3697,7 @@ some point, these tighter rules will become openssl's default to improve maintainability, though the assert()s and other overheads will remain only in debugging configurations. See bn.h for more details. - [Geoff Thorpe, Nils Larsch, Ulf M�ller] + [Geoff Thorpe, Nils Larsch, Ulf Möller] *) BN_CTX_init() has been deprecated, as BN_CTX is an opaque structure that can only be obtained through BN_CTX_new() (which implicitly @@ -3512,7 +3764,7 @@ [Douglas Stebila (Sun Microsystems Laboratories)] *) Add the possibility to load symbols globally with DSO. - [G�tz Babin-Ebell via Richard Levitte] + [Götz Babin-Ebell via Richard Levitte] *) Add the functions ERR_set_mark() and ERR_pop_to_mark() for better control of the error stack. @@ -4227,7 +4479,7 @@ [Steve Henson] *) Undo Cygwin change. - [Ulf M�ller] + [Ulf Möller] *) Added support for proxy certificates according to RFC 3820. Because they may be a security thread to unaware applications, @@ -4260,11 +4512,11 @@ [Stephen Henson, reported by UK NISCC] *) Use Windows randomness collection on Cygwin. - [Ulf M�ller] + [Ulf Möller] *) Fix hang in EGD/PRNGD query when communication socket is closed prematurely by EGD/PRNGD. - [Darren Tucker via Lutz J�nicke, resolves #1014] + [Darren Tucker via Lutz Jänicke, resolves #1014] *) Prompt for pass phrases when appropriate for PKCS12 input format. [Steve Henson] @@ -4726,7 +4978,7 @@ pointers passed to them whenever necessary. Otherwise it is possible the caller may have overwritten (or deallocated) the original string data when a later ENGINE operation tries to use the stored values. - [G�tz Babin-Ebell ] + [Götz Babin-Ebell ] *) Improve diagnostics in file reading and command-line digests. [Ben Laurie aided and abetted by Solar Designer ] @@ -6831,7 +7083,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k [Bodo Moeller] *) BN_sqr() bug fix. - [Ulf M�ller, reported by Jim Ellis ] + [Ulf Möller, reported by Jim Ellis ] *) Rabin-Miller test analyses assume uniformly distributed witnesses, so use BN_pseudo_rand_range() instead of using BN_pseudo_rand() @@ -6991,7 +7243,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k [Bodo Moeller] *) Fix OAEP check. - [Ulf M�ller, Bodo M�ller] + [Ulf Möller, Bodo Möller] *) The countermeasure against Bleichbacher's attack on PKCS #1 v1.5 RSA encryption was accidentally removed in s3_srvr.c in OpenSSL 0.9.5 @@ -7253,10 +7505,10 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k [Bodo Moeller] *) Use better test patterns in bntest. - [Ulf M�ller] + [Ulf Möller] *) rand_win.c fix for Borland C. - [Ulf M�ller] + [Ulf Möller] *) BN_rshift bugfix for n == 0. [Bodo Moeller] @@ -7401,14 +7653,14 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k *) New BIO_shutdown_wr macro, which invokes the BIO_C_SHUTDOWN_WR BIO_ctrl (for BIO pairs). - [Bodo M�ller] + [Bodo Möller] *) Add DSO method for VMS. [Richard Levitte] *) Bug fix: Montgomery multiplication could produce results with the wrong sign. - [Ulf M�ller] + [Ulf Möller] *) Add RPM specification openssl.spec and modify it to build three packages. The default package contains applications, application @@ -7426,7 +7678,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k *) Don't set the two most significant bits to one when generating a random number < q in the DSA library. - [Ulf M�ller] + [Ulf Möller] *) New SSL API mode 'SSL_MODE_AUTO_RETRY'. This disables the default behaviour that SSL_read may result in SSL_ERROR_WANT_READ (even if @@ -7692,7 +7944,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k *) Randomness polling function for Win9x, as described in: Peter Gutmann, Software Generation of Practically Strong Random Numbers. - [Ulf M�ller] + [Ulf Möller] *) Fix so PRNG is seeded in req if using an already existing DSA key. @@ -7912,7 +8164,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k [Steve Henson] *) Eliminate non-ANSI declarations in crypto.h and stack.h. - [Ulf M�ller] + [Ulf Möller] *) Fix for SSL server purpose checking. Server checking was rejecting certificates which had extended key usage present @@ -7944,7 +8196,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k [Bodo Moeller] *) Bugfix for linux-elf makefile.one. - [Ulf M�ller] + [Ulf Möller] *) RSA_get_default_method() will now cause a default RSA_METHOD to be chosen if one doesn't exist already. @@ -8033,7 +8285,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k [Steve Henson] *) des_quad_cksum() byte order bug fix. - [Ulf M�ller, using the problem description in krb4-0.9.7, where + [Ulf Möller, using the problem description in krb4-0.9.7, where the solution is attributed to Derrick J Brashear ] *) Fix so V_ASN1_APP_CHOOSE works again: however its use is strongly @@ -8134,7 +8386,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k [Rolf Haberrecker ] *) Assembler module support for Mingw32. - [Ulf M�ller] + [Ulf Möller] *) Shared library support for HPUX (in shlib/). [Lutz Jaenicke and Anonymous] @@ -8153,7 +8405,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k *) BN_mul bugfix: In bn_mul_part_recursion() only the a>a[n] && b>b[n] case was implemented. This caused BN_div_recp() to fail occasionally. - [Ulf M�ller] + [Ulf Möller] *) Add an optional second argument to the set_label() in the perl assembly language builder. If this argument exists and is set @@ -8183,14 +8435,14 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k [Steve Henson] *) Fix potential buffer overrun problem in BIO_printf(). - [Ulf M�ller, using public domain code by Patrick Powell; problem + [Ulf Möller, using public domain code by Patrick Powell; problem pointed out by David Sacerdote ] *) Support EGD . New functions RAND_egd() and RAND_status(). In the command line application, the EGD socket can be specified like a seed file using RANDFILE or -rand. - [Ulf M�ller] + [Ulf Möller] *) Allow the string CERTIFICATE to be tolerated in PKCS#7 structures. Some CAs (e.g. Verisign) distribute certificates in this form. @@ -8223,7 +8475,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k #define OPENSSL_ALGORITHM_DEFINES #include defines all pertinent NO_ symbols, such as NO_IDEA, NO_RSA, etc. - [Richard Levitte, Ulf and Bodo M�ller] + [Richard Levitte, Ulf and Bodo Möller] *) Bugfix: Tolerate fragmentation and interleaving in the SSL 3/TLS record layer. @@ -8274,17 +8526,17 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k *) Bug fix for BN_div_recp() for numerators with an even number of bits. - [Ulf M�ller] + [Ulf Möller] *) More tests in bntest.c, and changed test_bn output. - [Ulf M�ller] + [Ulf Möller] *) ./config recognizes MacOS X now. [Andy Polyakov] *) Bug fix for BN_div() when the first words of num and divsor are equal (it gave wrong results if (rem=(n1-q*d0)&BN_MASK2) < d0). - [Ulf M�ller] + [Ulf Möller] *) Add support for various broken PKCS#8 formats, and command line options to produce them. @@ -8292,11 +8544,11 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k *) New functions BN_CTX_start(), BN_CTX_get() and BT_CTX_end() to get temporary BIGNUMs from a BN_CTX. - [Ulf M�ller] + [Ulf Möller] *) Correct return values in BN_mod_exp_mont() and BN_mod_exp2_mont() for p == 0. - [Ulf M�ller] + [Ulf Möller] *) Change the SSLeay_add_all_*() functions to OpenSSL_add_all_*() and include a #define from the old name to the new. The original intent @@ -8320,7 +8572,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k *) Source code cleanups: use const where appropriate, eliminate casts, use void * instead of char * in lhash. - [Ulf M�ller] + [Ulf Möller] *) Bugfix: ssl3_send_server_key_exchange was not restartable (the state was not changed to SSL3_ST_SW_KEY_EXCH_B, and because of @@ -8365,13 +8617,13 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k [Steve Henson] *) New function BN_pseudo_rand(). - [Ulf M�ller] + [Ulf Möller] *) Clean up BN_mod_mul_montgomery(): replace the broken (and unreadable) bignum version of BN_from_montgomery() with the working code from SSLeay 0.9.0 (the word based version is faster anyway), and clean up the comments. - [Ulf M�ller] + [Ulf Möller] *) Avoid a race condition in s2_clnt.c (function get_server_hello) that made it impossible to use the same SSL_SESSION data structure in @@ -8381,25 +8633,25 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k *) The return value of RAND_load_file() no longer counts bytes obtained by stat(). RAND_load_file(..., -1) is new and uses the complete file to seed the PRNG (previously an explicit byte count was required). - [Ulf M�ller, Bodo M�ller] + [Ulf Möller, Bodo Möller] *) Clean up CRYPTO_EX_DATA functions, some of these didn't have prototypes used (char *) instead of (void *) and had casts all over the place. [Steve Henson] *) Make BN_generate_prime() return NULL on error if ret!=NULL. - [Ulf M�ller] + [Ulf Möller] *) Retain source code compatibility for BN_prime_checks macro: BN_is_prime(..., BN_prime_checks, ...) now uses BN_prime_checks_for_size to determine the appropriate number of Rabin-Miller iterations. - [Ulf M�ller] + [Ulf Möller] *) Diffie-Hellman uses "safe" primes: DH_check() return code renamed to DH_CHECK_P_NOT_SAFE_PRIME. (Check if this is true? OpenPGP calls them "strong".) - [Ulf M�ller] + [Ulf Möller] *) Merge the functionality of "dh" and "gendh" programs into a new program "dhparam". The old programs are retained for now but will handle DH keys @@ -8455,7 +8707,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k *) Add missing #ifndefs that caused missing symbols when building libssl as a shared library without RSA. Use #ifndef NO_SSL2 instead of NO_RSA in ssl/s2*.c. - [Kris Kennaway , modified by Ulf M�ller] + [Kris Kennaway , modified by Ulf Möller] *) Precautions against using the PRNG uninitialized: RAND_bytes() now has a return value which indicates the quality of the random data @@ -8464,7 +8716,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k guaranteed to be unique but not unpredictable. RAND_add is like RAND_seed, but takes an extra argument for an entropy estimate (RAND_seed always assumes full entropy). - [Ulf M�ller] + [Ulf Möller] *) Do more iterations of Rabin-Miller probable prime test (specifically, 3 for 1024-bit primes, 6 for 512-bit primes, 12 for 256-bit primes @@ -8494,7 +8746,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k [Steve Henson] *) Honor the no-xxx Configure options when creating .DEF files. - [Ulf M�ller] + [Ulf Möller] *) Add PKCS#10 attributes to field table: challengePassword, unstructuredName and unstructuredAddress. These are taken from @@ -9328,7 +9580,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k *) More DES library cleanups: remove references to srand/rand and delete an unused file. - [Ulf M�ller] + [Ulf Möller] *) Add support for the the free Netwide assembler (NASM) under Win32, since not many people have MASM (ml) and it can be hard to obtain. @@ -9417,7 +9669,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k worked. *) Fix problems with no-hmac etc. - [Ulf M�ller, pointed out by Brian Wellington ] + [Ulf Möller, pointed out by Brian Wellington ] *) New functions RSA_get_default_method(), RSA_set_method() and RSA_get_method(). These allows replacement of RSA_METHODs without having @@ -9534,7 +9786,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k [Ben Laurie] *) DES library cleanups. - [Ulf M�ller] + [Ulf Möller] *) Add support for PKCS#5 v2.0 PBE algorithms. This will permit PKCS#8 to be used with any cipher unlike PKCS#5 v1.5 which can at most handle 64 bit @@ -9577,7 +9829,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k [Christian Forster ] *) config now generates no-xxx options for missing ciphers. - [Ulf M�ller] + [Ulf Möller] *) Support the EBCDIC character set (work in progress). File ebcdic.c not yet included because it has a different license. @@ -9690,7 +9942,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k [Bodo Moeller] *) Move openssl.cnf out of lib/. - [Ulf M�ller] + [Ulf Möller] *) Fix various things to let OpenSSL even pass ``egcc -pipe -O2 -Wall -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes @@ -9747,10 +9999,10 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k [Ben Laurie] *) Support Borland C++ builder. - [Janez Jere , modified by Ulf M�ller] + [Janez Jere , modified by Ulf Möller] *) Support Mingw32. - [Ulf M�ller] + [Ulf Möller] *) SHA-1 cleanups and performance enhancements. [Andy Polyakov ] @@ -9759,7 +10011,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k [Andy Polyakov ] *) Accept any -xxx and +xxx compiler options in Configure. - [Ulf M�ller] + [Ulf Möller] *) Update HPUX configuration. [Anonymous] @@ -9792,7 +10044,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k [Bodo Moeller] *) OAEP decoding bug fix. - [Ulf M�ller] + [Ulf Möller] *) Support INSTALL_PREFIX for package builders, as proposed by David Harris. @@ -9815,21 +10067,21 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k [Niels Poppe ] *) New Configure option no- (rsa, idea, rc5, ...). - [Ulf M�ller] + [Ulf Möller] *) Add the PKCS#12 API documentation to openssl.txt. Preliminary support for extension adding in x509 utility. [Steve Henson] *) Remove NOPROTO sections and error code comments. - [Ulf M�ller] + [Ulf Möller] *) Partial rewrite of the DEF file generator to now parse the ANSI prototypes. [Steve Henson] *) New Configure options --prefix=DIR and --openssldir=DIR. - [Ulf M�ller] + [Ulf Möller] *) Complete rewrite of the error code script(s). It is all now handled by one script at the top level which handles error code gathering, @@ -9858,7 +10110,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k [Steve Henson] *) Move the autogenerated header file parts to crypto/opensslconf.h. - [Ulf M�ller] + [Ulf Möller] *) Fix new 56-bit DES export ciphersuites: they were using 7 bytes instead of 8 of keying material. Merlin has also confirmed interop with this fix @@ -9876,13 +10128,13 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k [Andy Polyakov ] *) Change functions to ANSI C. - [Ulf M�ller] + [Ulf Möller] *) Fix typos in error codes. - [Martin Kraemer , Ulf M�ller] + [Martin Kraemer , Ulf Möller] *) Remove defunct assembler files from Configure. - [Ulf M�ller] + [Ulf Möller] *) SPARC v8 assembler BIGNUM implementation. [Andy Polyakov ] @@ -9919,7 +10171,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k [Steve Henson] *) New Configure option "rsaref". - [Ulf M�ller] + [Ulf Möller] *) Don't auto-generate pem.h. [Bodo Moeller] @@ -9967,7 +10219,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k *) New functions DSA_do_sign and DSA_do_verify to provide access to the raw DSA values prior to ASN.1 encoding. - [Ulf M�ller] + [Ulf Möller] *) Tweaks to Configure [Niels Poppe ] @@ -9977,11 +10229,11 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k [Steve Henson] *) New variables $(RANLIB) and $(PERL) in the Makefiles. - [Ulf M�ller] + [Ulf Möller] *) New config option to avoid instructions that are illegal on the 80386. The default code is faster, but requires at least a 486. - [Ulf M�ller] + [Ulf Möller] *) Got rid of old SSL2_CLIENT_VERSION (inconsistently used) and SSL2_SERVER_VERSION (not used at all) macros, which are now the @@ -10520,7 +10772,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k Hagino ] *) File was opened incorrectly in randfile.c. - [Ulf M�ller ] + [Ulf Möller ] *) Beginning of support for GeneralizedTime. d2i, i2d, check and print functions. Also ASN1_TIME suite which is a CHOICE of UTCTime or @@ -10530,7 +10782,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k [Steve Henson] *) Correct Linux 1 recognition in config. - [Ulf M�ller ] + [Ulf Möller ] *) Remove pointless MD5 hash when using DSA keys in ca. [Anonymous ] @@ -10677,7 +10929,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k *) Fix the RSA header declarations that hid a bug I fixed in 0.9.0b but was already fixed by Eric for 0.9.1 it seems. - [Ben Laurie - pointed out by Ulf M�ller ] + [Ben Laurie - pointed out by Ulf Möller ] *) Autodetect FreeBSD3. [Ben Laurie] diff --git a/deps/openssl/openssl/CONTRIBUTING b/deps/openssl/openssl/CONTRIBUTING new file mode 100644 index 00000000000000..9d63d8abb67252 --- /dev/null +++ b/deps/openssl/openssl/CONTRIBUTING @@ -0,0 +1,38 @@ +HOW TO CONTRIBUTE TO OpenSSL +---------------------------- + +Development is coordinated on the openssl-dev mailing list (see +http://www.openssl.org for information on subscribing). If you +would like to submit a patch, send it to rt@openssl.org with +the string "[PATCH]" in the subject. Please be sure to include a +textual explanation of what your patch does. + +You can also make GitHub pull requests. If you do this, please also send +mail to rt@openssl.org with a brief description and a link to the PR so +that we can more easily keep track of it. + +If you are unsure as to whether a feature will be useful for the general +OpenSSL community please discuss it on the openssl-dev mailing list first. +Someone may be already working on the same thing or there may be a good +reason as to why that feature isn't implemented. + +Patches should be as up to date as possible, preferably relative to the +current Git or the last snapshot. They should follow our coding style +(see https://www.openssl.org/policies/codingstyle.html) and compile without +warnings using the --strict-warnings flag. OpenSSL compiles on many varied +platforms: try to ensure you only use portable features. + +Our preferred format for patch files is "git format-patch" output. For example +to provide a patch file containing the last commit in your local git repository +use the following command: + +# git format-patch --stdout HEAD^ >mydiffs.patch + +Another method of creating an acceptable patch file without using git is as +follows: + +# cd openssl-work +# [your changes] +# ./Configure dist; make clean +# cd .. +# diff -ur openssl-orig openssl-work > mydiffs.patch diff --git a/deps/openssl/openssl/Configure b/deps/openssl/openssl/Configure index d99eed7f9303c7..c98107a487188f 100755 --- a/deps/openssl/openssl/Configure +++ b/deps/openssl/openssl/Configure @@ -58,6 +58,10 @@ my $usage="Usage: Configure [no- ...] [enable- ...] [experimenta # library and will be loaded in run-time by the OpenSSL library. # sctp include SCTP support # 386 generate 80386 code +# enable-weak-ssl-ciphers +# Enable EXPORT and LOW SSLv3 ciphers that are disabled by +# default. Note, weak SSLv2 ciphers are unconditionally +# disabled. # no-sse2 disables IA-32 SSE2 code, above option implies no-sse2 # no- build without specified algorithm (rsa, idea, rc5, ...) # - + compiler options are passed through @@ -124,6 +128,9 @@ my $clang_disabled_warnings = "-Wno-unused-parameter -Wno-missing-field-initiali # -Wextended-offsetof my $clang_devteam_warn = "-Wno-unused-parameter -Wno-missing-field-initializers -Wno-language-extension-token -Wno-extended-offsetof -Qunused-arguments"; +# Warn that "make depend" should be run? +my $warn_make_depend = 0; + my $strict_warnings = 0; my $x86_gcc_des="DES_PTR DES_RISC1 DES_UNROLL"; @@ -416,6 +423,7 @@ my %table=( "linux-ia64-icc","icc:-DL_ENDIAN -O2 -Wall::-D_REENTRANT::-ldl -no_cpprt:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "linux-x86_64", "gcc:-m64 -DL_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", "linux-x86_64-clang", "clang: -m64 -DL_ENDIAN -O3 -Wall -Wextra $clang_disabled_warnings -Qunused-arguments::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", +"debug-linux-x86_64-clang", "clang: -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -m64 -DL_ENDIAN -g -Wall -Wextra $clang_disabled_warnings -Qunused-arguments::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", "linux-x86_64-icc", "icc:-DL_ENDIAN -O2::-D_REENTRANT::-ldl -no_cpprt:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", "linux-x32", "gcc:-mx32 -DL_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-mx32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::x32", "linux64-s390x", "gcc:-m64 -DB_ENDIAN -O3 -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${s390x_asm}:64:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", @@ -777,11 +785,13 @@ my %disabled = ( # "what" => "comment" [or special keyword "experimental "md2" => "default", "rc5" => "default", "rfc3779" => "default", - "sctp" => "default", + "sctp" => "default", "shared" => "default", "ssl-trace" => "default", + "ssl2" => "default", "store" => "experimental", "unit-test" => "default", + "weak-ssl-ciphers" => "default", "zlib" => "default", "zlib-dynamic" => "default" ); @@ -1512,7 +1522,7 @@ if ($target =~ /\-icc$/) # Intel C compiler # linker only when --prefix is not /usr. if ($target =~ /^BSD\-/) { - $shared_ldflag.=" -Wl,-rpath,\$(LIBRPATH)" if ($prefix !~ m|^/usr[/]*$|); + $shared_ldflag.=" -Wl,-rpath,\$\$(LIBRPATH)" if ($prefix !~ m|^/usr[/]*$|); } if ($sys_id ne "") @@ -1646,21 +1656,22 @@ if ($shlib_version_number =~ /(^[0-9]*)\.([0-9\.]*)/) $shlib_minor=$2; } +my $ecc = $cc; +$ecc = "clang" if `$cc --version 2>&1` =~ /clang/; + if ($strict_warnings) { - my $ecc = $cc; - $ecc = "clang" if `$cc --version 2>&1` =~ /clang/; my $wopt; die "ERROR --strict-warnings requires gcc or clang" unless ($ecc =~ /gcc$/ or $ecc =~ /clang$/); foreach $wopt (split /\s+/, $gcc_devteam_warn) { - $cflags .= " $wopt" unless ($cflags =~ /$wopt/) + $cflags .= " $wopt" unless ($cflags =~ /(^|\s)$wopt(\s|$)/) } if ($ecc eq "clang") { foreach $wopt (split /\s+/, $clang_devteam_warn) { - $cflags .= " $wopt" unless ($cflags =~ /$wopt/) + $cflags .= " $wopt" unless ($cflags =~ /(^|\s)$wopt(\s|$)/) } } } @@ -1713,6 +1724,7 @@ while () s/^AR=\s*ar/AR= $ar/; s/^RANLIB=.*/RANLIB= $ranlib/; s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $cc eq "gcc"; + s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $ecc eq "gcc" || $ecc eq "clang"; } s/^CFLAG=.*$/CFLAG= $cflags/; s/^DEPFLAG=.*$/DEPFLAG=$depflags/; @@ -2025,14 +2037,8 @@ EOF &dofile("apps/CA.pl",'/usr/local/bin/perl','^#!/', '#!%s'); } if ($depflags ne $default_depflags && !$make_depend) { - print < fail with a certificate verify error? -* Why can I only use weak ciphers when I connect to a server using OpenSSL? -* How can I create DSA certificates? -* Why can't I make an SSL connection using a DSA certificate? -* How can I remove the passphrase on a private key? -* Why can't I use OpenSSL certificates with SSL client authentication? -* Why does my browser give a warning about a mismatched hostname? -* How do I install a CA certificate into a browser? -* Why is OpenSSL x509 DN output not conformant to RFC2253? -* What is a "128 bit certificate"? Can I create one with OpenSSL? -* Why does OpenSSL set the authority key identifier extension incorrectly? -* How can I set up a bundle of commercial root CA certificates? - -[BUILD] Questions about building and testing OpenSSL - -* Why does the linker complain about undefined symbols? -* Why does the OpenSSL test fail with "bc: command not found"? -* Why does the OpenSSL test fail with "bc: 1 no implemented"? -* Why does the OpenSSL test fail with "bc: stack empty"? -* Why does the OpenSSL compilation fail on Alpha Tru64 Unix? -* Why does the OpenSSL compilation fail with "ar: command not found"? -* Why does the OpenSSL compilation fail on Win32 with VC++? -* What is special about OpenSSL on Redhat? -* Why does the OpenSSL compilation fail on MacOS X? -* Why does the OpenSSL test suite fail on MacOS X? -* Why does the OpenSSL test suite fail in BN_sqr test [on a 64-bit platform]? -* Why does OpenBSD-i386 build fail on des-586.s with "Unimplemented segment type"? -* Why does the OpenSSL test suite fail in sha512t on x86 CPU? -* Why does compiler fail to compile sha512.c? -* Test suite still fails, what to do? -* I think I've found a bug, what should I do? -* I'm SURE I've found a bug, how do I report it? -* I've found a security issue, how do I report it? - -[PROG] Questions about programming with OpenSSL - -* Is OpenSSL thread-safe? -* I've compiled a program under Windows and it crashes: why? -* How do I read or write a DER encoded buffer using the ASN1 functions? -* OpenSSL uses DER but I need BER format: does OpenSSL support BER? -* I've tried using and I get errors why? -* I've called and it fails, why? -* I just get a load of numbers for the error output, what do they mean? -* Why do I get errors about unknown algorithms? -* Why can't the OpenSSH configure script detect OpenSSL? -* Can I use OpenSSL's SSL library with non-blocking I/O? -* Why doesn't my server application receive a client certificate? -* Why does compilation fail due to an undefined symbol NID_uniqueIdentifier? -* I think I've detected a memory leak, is this a bug? -* Why does Valgrind complain about the use of uninitialized data? -* Why doesn't a memory BIO work when a file does? -* Where are the declarations and implementations of d2i_X509() etc? - -=============================================================================== - -[MISC] ======================================================================== - -* Which is the current version of OpenSSL? - -The current version is available from . -OpenSSL 1.0.1a was released on Apr 19th, 2012. - -In addition to the current stable release, you can also access daily -snapshots of the OpenSSL development version at , or get it by anonymous Git access. - - -* Where is the documentation? - -OpenSSL is a library that provides cryptographic functionality to -applications such as secure web servers. Be sure to read the -documentation of the application you want to use. The INSTALL file -explains how to install this library. - -OpenSSL includes a command line utility that can be used to perform a -variety of cryptographic functions. It is described in the openssl(1) -manpage. Documentation for developers is currently being written. Many -manual pages are available; overviews over libcrypto and -libssl are given in the crypto(3) and ssl(3) manpages. - -The OpenSSL manpages are installed in /usr/local/ssl/man/ (or a -different directory if you specified one as described in INSTALL). -In addition, you can read the most current versions at -. Note that the online documents refer -to the very latest development versions of OpenSSL and may include features -not present in released versions. If in doubt refer to the documentation -that came with the version of OpenSSL you are using. The pod format -documentation is included in each OpenSSL distribution under the docs -directory. - -There is some documentation about certificate extensions and PKCS#12 -in doc/openssl.txt - -The original SSLeay documentation is included in OpenSSL as -doc/ssleay.txt. It may be useful when none of the other resources -help, but please note that it reflects the obsolete version SSLeay -0.6.6. - - -* How can I contact the OpenSSL developers? - -The README file describes how to submit bug reports and patches to -OpenSSL. Information on the OpenSSL mailing lists is available from -. - - -* Where can I get a compiled version of OpenSSL? - -You can finder pointers to binary distributions in - . - -Some applications that use OpenSSL are distributed in binary form. -When using such an application, you don't need to install OpenSSL -yourself; the application will include the required parts (e.g. DLLs). - -If you want to build OpenSSL on a Windows system and you don't have -a C compiler, read the "Mingw32" section of INSTALL.W32 for information -on how to obtain and install the free GNU C compiler. - -A number of Linux and *BSD distributions include OpenSSL. - - -* Why aren't tools like 'autoconf' and 'libtool' used? - -autoconf will probably be used in future OpenSSL versions. If it was -less Unix-centric, it might have been used much earlier. - -* What is an 'engine' version? - -With version 0.9.6 OpenSSL was extended to interface to external crypto -hardware. This was realized in a special release '0.9.6-engine'. With -version 0.9.7 the changes were merged into the main development line, -so that the special release is no longer necessary. - -* How do I check the authenticity of the OpenSSL distribution? - -We provide MD5 digests and ASC signatures of each tarball. -Use MD5 to check that a tarball from a mirror site is identical: - - md5sum TARBALL | awk '{print $1;}' | cmp - TARBALL.md5 - -You can check authenticity using pgp or gpg. You need the OpenSSL team -member public key used to sign it (download it from a key server, see a -list of keys at ). Then -just do: - - pgp TARBALL.asc - -* How does the versioning scheme work? - -After the release of OpenSSL 1.0.0 the versioning scheme changed. Letter -releases (e.g. 1.0.1a) can only contain bug and security fixes and no -new features. Minor releases change the last number (e.g. 1.0.2) and -can contain new features that retain binary compatibility. Changes to -the middle number are considered major releases and neither source nor -binary compatibility is guaranteed. - -Therefore the answer to the common question "when will feature X be -backported to OpenSSL 1.0.0/0.9.8?" is "never" but it could appear -in the next minor release. - -* What happens when the letter release reaches z? - -It was decided after the release of OpenSSL 0.9.8y the next version should -be 0.9.8za then 0.9.8zb and so on. - - -[LEGAL] ======================================================================= - -* Do I need patent licenses to use OpenSSL? - -For information on intellectual property rights, please consult a lawyer. -The OpenSSL team does not offer legal advice. - -You can configure OpenSSL so as not to use IDEA, MDC2 and RC5 by using - ./config no-idea no-mdc2 no-rc5 - - -* Can I use OpenSSL with GPL software? - -On many systems including the major Linux and BSD distributions, yes (the -GPL does not place restrictions on using libraries that are part of the -normal operating system distribution). - -On other systems, the situation is less clear. Some GPL software copyright -holders claim that you infringe on their rights if you use OpenSSL with -their software on operating systems that don't normally include OpenSSL. - -If you develop open source software that uses OpenSSL, you may find it -useful to choose an other license than the GPL, or state explicitly that -"This program is released under the GPL with the additional exemption that -compiling, linking, and/or using OpenSSL is allowed." If you are using -GPL software developed by others, you may want to ask the copyright holder -for permission to use their software with OpenSSL. - - -[USER] ======================================================================== - -* Why do I get a "PRNG not seeded" error message? - -Cryptographic software needs a source of unpredictable data to work -correctly. Many open source operating systems provide a "randomness -device" (/dev/urandom or /dev/random) that serves this purpose. -All OpenSSL versions try to use /dev/urandom by default; starting with -version 0.9.7, OpenSSL also tries /dev/random if /dev/urandom is not -available. - -On other systems, applications have to call the RAND_add() or -RAND_seed() function with appropriate data before generating keys or -performing public key encryption. (These functions initialize the -pseudo-random number generator, PRNG.) Some broken applications do -not do this. As of version 0.9.5, the OpenSSL functions that need -randomness report an error if the random number generator has not been -seeded with at least 128 bits of randomness. If this error occurs and -is not discussed in the documentation of the application you are -using, please contact the author of that application; it is likely -that it never worked correctly. OpenSSL 0.9.5 and later make the -error visible by refusing to perform potentially insecure encryption. - -If you are using Solaris 8, you can add /dev/urandom and /dev/random -devices by installing patch 112438 (Sparc) or 112439 (x86), which are -available via the Patchfinder at -(Solaris 9 includes these devices by default). For /dev/random support -for earlier Solaris versions, see Sun's statement at - -(the SUNWski package is available in patch 105710). - -On systems without /dev/urandom and /dev/random, it is a good idea to -use the Entropy Gathering Demon (EGD); see the RAND_egd() manpage for -details. Starting with version 0.9.7, OpenSSL will automatically look -for an EGD socket at /var/run/egd-pool, /dev/egd-pool, /etc/egd-pool and -/etc/entropy. - -Most components of the openssl command line utility automatically try -to seed the random number generator from a file. The name of the -default seeding file is determined as follows: If environment variable -RANDFILE is set, then it names the seeding file. Otherwise if -environment variable HOME is set, then the seeding file is $HOME/.rnd. -If neither RANDFILE nor HOME is set, versions up to OpenSSL 0.9.6 will -use file .rnd in the current directory while OpenSSL 0.9.6a uses no -default seeding file at all. OpenSSL 0.9.6b and later will behave -similarly to 0.9.6a, but will use a default of "C:\" for HOME on -Windows systems if the environment variable has not been set. - -If the default seeding file does not exist or is too short, the "PRNG -not seeded" error message may occur. - -The openssl command line utility will write back a new state to the -default seeding file (and create this file if necessary) unless -there was no sufficient seeding. - -Pointing $RANDFILE to an Entropy Gathering Daemon socket does not work. -Use the "-rand" option of the OpenSSL command line tools instead. -The $RANDFILE environment variable and $HOME/.rnd are only used by the -OpenSSL command line tools. Applications using the OpenSSL library -provide their own configuration options to specify the entropy source, -please check out the documentation coming the with application. - - -* Why do I get an "unable to write 'random state'" error message? - - -Sometimes the openssl command line utility does not abort with -a "PRNG not seeded" error message, but complains that it is -"unable to write 'random state'". This message refers to the -default seeding file (see previous answer). A possible reason -is that no default filename is known because neither RANDFILE -nor HOME is set. (Versions up to 0.9.6 used file ".rnd" in the -current directory in this case, but this has changed with 0.9.6a.) - - -* How do I create certificates or certificate requests? - -Check out the CA.pl(1) manual page. This provides a simple wrapper round -the 'req', 'verify', 'ca' and 'pkcs12' utilities. For finer control check -out the manual pages for the individual utilities and the certificate -extensions documentation (in ca(1), req(1), x509v3_config(5) ) - - -* Why can't I create certificate requests? - -You typically get the error: - - unable to find 'distinguished_name' in config - problems making Certificate Request - -This is because it can't find the configuration file. Check out the -DIAGNOSTICS section of req(1) for more information. - - -* Why does fail with a certificate verify error? - -This problem is usually indicated by log messages saying something like -"unable to get local issuer certificate" or "self signed certificate". -When a certificate is verified its root CA must be "trusted" by OpenSSL -this typically means that the CA certificate must be placed in a directory -or file and the relevant program configured to read it. The OpenSSL program -'verify' behaves in a similar way and issues similar error messages: check -the verify(1) program manual page for more information. - - -* Why can I only use weak ciphers when I connect to a server using OpenSSL? - -This is almost certainly because you are using an old "export grade" browser -which only supports weak encryption. Upgrade your browser to support 128 bit -ciphers. - - -* How can I create DSA certificates? - -Check the CA.pl(1) manual page for a DSA certificate example. - - -* Why can't I make an SSL connection to a server using a DSA certificate? - -Typically you'll see a message saying there are no shared ciphers when -the same setup works fine with an RSA certificate. There are two possible -causes. The client may not support connections to DSA servers most web -browsers (including Netscape and MSIE) only support connections to servers -supporting RSA cipher suites. The other cause is that a set of DH parameters -has not been supplied to the server. DH parameters can be created with the -dhparam(1) command and loaded using the SSL_CTX_set_tmp_dh() for example: -check the source to s_server in apps/s_server.c for an example. - - -* How can I remove the passphrase on a private key? - -Firstly you should be really *really* sure you want to do this. Leaving -a private key unencrypted is a major security risk. If you decide that -you do have to do this check the EXAMPLES sections of the rsa(1) and -dsa(1) manual pages. - - -* Why can't I use OpenSSL certificates with SSL client authentication? - -What will typically happen is that when a server requests authentication -it will either not include your certificate or tell you that you have -no client certificates (Netscape) or present you with an empty list box -(MSIE). The reason for this is that when a server requests a client -certificate it includes a list of CAs names which it will accept. Browsers -will only let you select certificates from the list on the grounds that -there is little point presenting a certificate which the server will -reject. - -The solution is to add the relevant CA certificate to your servers "trusted -CA list". How you do this depends on the server software in uses. You can -print out the servers list of acceptable CAs using the OpenSSL s_client tool: - -openssl s_client -connect www.some.host:443 -prexit - -If your server only requests certificates on certain URLs then you may need -to manually issue an HTTP GET command to get the list when s_client connects: - -GET /some/page/needing/a/certificate.html - -If your CA does not appear in the list then this confirms the problem. - - -* Why does my browser give a warning about a mismatched hostname? - -Browsers expect the server's hostname to match the value in the commonName -(CN) field of the certificate. If it does not then you get a warning. - - -* How do I install a CA certificate into a browser? - -The usual way is to send the DER encoded certificate to the browser as -MIME type application/x-x509-ca-cert, for example by clicking on an appropriate -link. On MSIE certain extensions such as .der or .cacert may also work, or you -can import the certificate using the certificate import wizard. - -You can convert a certificate to DER form using the command: - -openssl x509 -in ca.pem -outform DER -out ca.der - -Occasionally someone suggests using a command such as: - -openssl pkcs12 -export -out cacert.p12 -in cacert.pem -inkey cakey.pem - -DO NOT DO THIS! This command will give away your CAs private key and -reduces its security to zero: allowing anyone to forge certificates in -whatever name they choose. - -* Why is OpenSSL x509 DN output not conformant to RFC2253? - -The ways to print out the oneline format of the DN (Distinguished Name) have -been extended in version 0.9.7 of OpenSSL. Using the new X509_NAME_print_ex() -interface, the "-nameopt" option could be introduded. See the manual -page of the "openssl x509" commandline tool for details. The old behaviour -has however been left as default for the sake of compatibility. - -* What is a "128 bit certificate"? Can I create one with OpenSSL? - -The term "128 bit certificate" is a highly misleading marketing term. It does -*not* refer to the size of the public key in the certificate! A certificate -containing a 128 bit RSA key would have negligible security. - -There were various other names such as "magic certificates", "SGC -certificates", "step up certificates" etc. - -You can't generally create such a certificate using OpenSSL but there is no -need to any more. Nowadays web browsers using unrestricted strong encryption -are generally available. - -When there were tight restrictions on the export of strong encryption -software from the US only weak encryption algorithms could be freely exported -(initially 40 bit and then 56 bit). It was widely recognised that this was -inadequate. A relaxation of the rules allowed the use of strong encryption but -only to an authorised server. - -Two slighly different techniques were developed to support this, one used by -Netscape was called "step up", the other used by MSIE was called "Server Gated -Cryptography" (SGC). When a browser initially connected to a server it would -check to see if the certificate contained certain extensions and was issued by -an authorised authority. If these test succeeded it would reconnect using -strong encryption. - -Only certain (initially one) certificate authorities could issue the -certificates and they generally cost more than ordinary certificates. - -Although OpenSSL can create certificates containing the appropriate extensions -the certificate would not come from a permitted authority and so would not -be recognized. - -The export laws were later changed to allow almost unrestricted use of strong -encryption so these certificates are now obsolete. - - -* Why does OpenSSL set the authority key identifier (AKID) extension incorrectly? - -It doesn't: this extension is often the cause of confusion. - -Consider a certificate chain A->B->C so that A signs B and B signs C. Suppose -certificate C contains AKID. - -The purpose of this extension is to identify the authority certificate B. This -can be done either by including the subject key identifier of B or its issuer -name and serial number. - -In this latter case because it is identifying certifcate B it must contain the -issuer name and serial number of B. - -It is often wrongly assumed that it should contain the subject name of B. If it -did this would be redundant information because it would duplicate the issuer -name of C. - - -* How can I set up a bundle of commercial root CA certificates? - -The OpenSSL software is shipped without any root CA certificate as the -OpenSSL project does not have any policy on including or excluding -any specific CA and does not intend to set up such a policy. Deciding -about which CAs to support is up to application developers or -administrators. - -Other projects do have other policies so you can for example extract the CA -bundle used by Mozilla and/or modssl as described in this article: - - - - -[BUILD] ======================================================================= - -* Why does the linker complain about undefined symbols? - -Maybe the compilation was interrupted, and make doesn't notice that -something is missing. Run "make clean; make". - -If you used ./Configure instead of ./config, make sure that you -selected the right target. File formats may differ slightly between -OS versions (for example sparcv8/sparcv9, or a.out/elf). - -In case you get errors about the following symbols, use the config -option "no-asm", as described in INSTALL: - - BF_cbc_encrypt, BF_decrypt, BF_encrypt, CAST_cbc_encrypt, - CAST_decrypt, CAST_encrypt, RC4, RC5_32_cbc_encrypt, RC5_32_decrypt, - RC5_32_encrypt, bn_add_words, bn_div_words, bn_mul_add_words, - bn_mul_comba4, bn_mul_comba8, bn_mul_words, bn_sqr_comba4, - bn_sqr_comba8, bn_sqr_words, bn_sub_words, des_decrypt3, - des_ede3_cbc_encrypt, des_encrypt, des_encrypt2, des_encrypt3, - des_ncbc_encrypt, md5_block_asm_host_order, sha1_block_asm_data_order - -If none of these helps, you may want to try using the current snapshot. -If the problem persists, please submit a bug report. - - -* Why does the OpenSSL test fail with "bc: command not found"? - -You didn't install "bc", the Unix calculator. If you want to run the -tests, get GNU bc from ftp://ftp.gnu.org or from your OS distributor. - - -* Why does the OpenSSL test fail with "bc: 1 no implemented"? - -On some SCO installations or versions, bc has a bug that gets triggered -when you run the test suite (using "make test"). The message returned is -"bc: 1 not implemented". - -The best way to deal with this is to find another implementation of bc -and compile/install it. GNU bc (see -for download instructions) can be safely used, for example. - - -* Why does the OpenSSL test fail with "bc: stack empty"? - -On some DG/ux versions, bc seems to have a too small stack for calculations -that the OpenSSL bntest throws at it. This gets triggered when you run the -test suite (using "make test"). The message returned is "bc: stack empty". - -The best way to deal with this is to find another implementation of bc -and compile/install it. GNU bc (see -for download instructions) can be safely used, for example. - - -* Why does the OpenSSL compilation fail on Alpha Tru64 Unix? - -On some Alpha installations running Tru64 Unix and Compaq C, the compilation -of crypto/sha/sha_dgst.c fails with the message 'Fatal: Insufficient virtual -memory to continue compilation.' As far as the tests have shown, this may be -a compiler bug. What happens is that it eats up a lot of resident memory -to build something, probably a table. The problem is clearly in the -optimization code, because if one eliminates optimization completely (-O0), -the compilation goes through (and the compiler consumes about 2MB of resident -memory instead of 240MB or whatever one's limit is currently). - -There are three options to solve this problem: - -1. set your current data segment size soft limit higher. Experience shows -that about 241000 kbytes seems to be enough on an AlphaServer DS10. You do -this with the command 'ulimit -Sd nnnnnn', where 'nnnnnn' is the number of -kbytes to set the limit to. - -2. If you have a hard limit that is lower than what you need and you can't -get it changed, you can compile all of OpenSSL with -O0 as optimization -level. This is however not a very nice thing to do for those who expect to -get the best result from OpenSSL. A bit more complicated solution is the -following: - ------ snip:start ----- - make DIRS=crypto SDIRS=sha "`grep '^CFLAG=' Makefile.ssl | \ - sed -e 's/ -O[0-9] / -O0 /'`" - rm `ls crypto/*.o crypto/sha/*.o | grep -v 'sha_dgst\.o'` - make ------ snip:end ----- - -This will only compile sha_dgst.c with -O0, the rest with the optimization -level chosen by the configuration process. When the above is done, do the -test and installation and you're set. - -3. Reconfigure the toolkit with no-sha0 option to leave out SHA0. It -should not be used and is not used in SSL/TLS nor any other recognized -protocol in either case. - - -* Why does the OpenSSL compilation fail with "ar: command not found"? - -Getting this message is quite usual on Solaris 2, because Sun has hidden -away 'ar' and other development commands in directories that aren't in -$PATH by default. One of those directories is '/usr/ccs/bin'. The -quickest way to fix this is to do the following (it assumes you use sh -or any sh-compatible shell): - ------ snip:start ----- - PATH=${PATH}:/usr/ccs/bin; export PATH ------ snip:end ----- - -and then redo the compilation. What you should really do is make sure -'/usr/ccs/bin' is permanently in your $PATH, for example through your -'.profile' (again, assuming you use a sh-compatible shell). - - -* Why does the OpenSSL compilation fail on Win32 with VC++? - -Sometimes, you may get reports from VC++ command line (cl) that it -can't find standard include files like stdio.h and other weirdnesses. -One possible cause is that the environment isn't correctly set up. -To solve that problem for VC++ versions up to 6, one should run -VCVARS32.BAT which is found in the 'bin' subdirectory of the VC++ -installation directory (somewhere under 'Program Files'). For VC++ -version 7 (and up?), which is also called VS.NET, the file is called -VSVARS32.BAT instead. -This needs to be done prior to running NMAKE, and the changes are only -valid for the current DOS session. - - -* What is special about OpenSSL on Redhat? - -Red Hat Linux (release 7.0 and later) include a preinstalled limited -version of OpenSSL. Red Hat has chosen to disable support for IDEA, RC5 and -MDC2 in this version. The same may apply to other Linux distributions. -Users may therefore wish to install more or all of the features left out. - -To do this you MUST ensure that you do not overwrite the openssl that is in -/usr/bin on your Red Hat machine. Several packages depend on this file, -including sendmail and ssh. /usr/local/bin is a good alternative choice. The -libraries that come with Red Hat 7.0 onwards have different names and so are -not affected. (eg For Red Hat 7.2 they are /lib/libssl.so.0.9.6b and -/lib/libcrypto.so.0.9.6b with symlinks /lib/libssl.so.2 and -/lib/libcrypto.so.2 respectively). - -Please note that we have been advised by Red Hat attempting to recompile the -openssl rpm with all the cryptography enabled will not work. All other -packages depend on the original Red Hat supplied openssl package. It is also -worth noting that due to the way Red Hat supplies its packages, updates to -openssl on each distribution never change the package version, only the -build number. For example, on Red Hat 7.1, the latest openssl package has -version number 0.9.6 and build number 9 even though it contains all the -relevant updates in packages up to and including 0.9.6b. - -A possible way around this is to persuade Red Hat to produce a non-US -version of Red Hat Linux. - - -* Why does the OpenSSL compilation fail on MacOS X? - -If the failure happens when trying to build the "openssl" binary, with -a large number of undefined symbols, it's very probable that you have -OpenSSL 0.9.6b delivered with the operating system (you can find out by -running '/usr/bin/openssl version') and that you were trying to build -OpenSSL 0.9.7 or newer. The problem is that the loader ('ld') in -MacOS X has a misfeature that's quite difficult to go around. -Look in the file PROBLEMS for a more detailed explanation and for possible -solutions. - - -* Why does the OpenSSL test suite fail on MacOS X? - -If the failure happens when running 'make test' and the RC4 test fails, -it's very probable that you have OpenSSL 0.9.6b delivered with the -operating system (you can find out by running '/usr/bin/openssl version') -and that you were trying to build OpenSSL 0.9.6d. The problem is that -the loader ('ld') in MacOS X has a misfeature that's quite difficult to -go around and has linked the programs "openssl" and the test programs -with /usr/lib/libcrypto.dylib and /usr/lib/libssl.dylib instead of the -libraries you just built. -Look in the file PROBLEMS for a more detailed explanation and for possible -solutions. - -* Why does the OpenSSL test suite fail in BN_sqr test [on a 64-bit platform]? - -Failure in BN_sqr test is most likely caused by a failure to configure the -toolkit for current platform or lack of support for the platform in question. -Run './config -t' and './apps/openssl version -p'. Do these platform -identifiers match? If they don't, then you most likely failed to run -./config and you're hereby advised to do so before filing a bug report. -If ./config itself fails to run, then it's most likely problem with your -local environment and you should turn to your system administrator (or -similar). If identifiers match (and/or no alternative identifier is -suggested by ./config script), then the platform is unsupported. There might -or might not be a workaround. Most notably on SPARC64 platforms with GNU -C compiler you should be able to produce a working build by running -'./config -m32'. I understand that -m32 might not be what you want/need, -but the build should be operational. For further details turn to -. - -* Why does OpenBSD-i386 build fail on des-586.s with "Unimplemented segment type"? - -As of 0.9.7 assembler routines were overhauled for position independence -of the machine code, which is essential for shared library support. For -some reason OpenBSD is equipped with an out-of-date GNU assembler which -finds the new code offensive. To work around the problem, configure with -no-asm (and sacrifice a great deal of performance) or patch your assembler -according to . -For your convenience a pre-compiled replacement binary is provided at -. -Reportedly elder *BSD a.out platforms also suffer from this problem and -remedy should be same. Provided binary is statically linked and should be -working across wider range of *BSD branches, not just OpenBSD. - -* Why does the OpenSSL test suite fail in sha512t on x86 CPU? - -If the test program in question fails withs SIGILL, Illegal Instruction -exception, then you more than likely to run SSE2-capable CPU, such as -Intel P4, under control of kernel which does not support SSE2 -instruction extentions. See accompanying INSTALL file and -OPENSSL_ia32cap(3) documentation page for further information. - -* Why does compiler fail to compile sha512.c? - -OpenSSL SHA-512 implementation depends on compiler support for 64-bit -integer type. Few elder compilers [ULTRIX cc, SCO compiler to mention a -couple] lack support for this and therefore are incapable of compiling -the module in question. The recommendation is to disable SHA-512 by -adding no-sha512 to ./config [or ./Configure] command line. Another -possible alternative might be to switch to GCC. - -* Test suite still fails, what to do? - -Another common reason for failure to complete some particular test is -simply bad code generated by a buggy component in toolchain or deficiency -in run-time environment. There are few cases documented in PROBLEMS file, -consult it for possible workaround before you beat the drum. Even if you -don't find solution or even mention there, do reserve for possibility of -a compiler bug. Compiler bugs might appear in rather bizarre ways, they -never make sense, and tend to emerge when you least expect them. In order -to identify one, drop optimization level, e.g. by editing CFLAG line in -top-level Makefile, recompile and re-run the test. - -* I think I've found a bug, what should I do? - -If you are a new user then it is quite likely you haven't found a bug and -something is happening you aren't familiar with. Check this FAQ, the associated -documentation and the mailing lists for similar queries. If you are still -unsure whether it is a bug or not submit a query to the openssl-users mailing -list. - - -* I'm SURE I've found a bug, how do I report it? - -Bug reports with no security implications should be sent to the request -tracker. This can be done by mailing the report to (or its -alias ), please note that messages sent to the -request tracker also appear in the public openssl-dev mailing list. - -The report should be in plain text. Any patches should be sent as -plain text attachments because some mailers corrupt patches sent inline. -If your issue affects multiple versions of OpenSSL check any patches apply -cleanly and, if possible include patches to each affected version. - -The report should be given a meaningful subject line briefly summarising the -issue. Just "bug in OpenSSL" or "bug in OpenSSL 0.9.8n" is not very helpful. - -By sending reports to the request tracker the bug can then be given a priority -and assigned to the appropriate maintainer. The history of discussions can be -accessed and if the issue has been addressed or a reason why not. If patches -are only sent to openssl-dev they can be mislaid if a team member has to -wade through months of old messages to review the discussion. - -See also - - -* I've found a security issue, how do I report it? - -If you think your bug has security implications then please send it to -openssl-security@openssl.org if you don't get a prompt reply at least -acknowledging receipt then resend or mail it directly to one of the -more active team members (e.g. Steve). - -Note that bugs only present in the openssl utility are not in general -considered to be security issues. - -[PROG] ======================================================================== - -* Is OpenSSL thread-safe? - -Yes (with limitations: an SSL connection may not concurrently be used -by multiple threads). On Windows and many Unix systems, OpenSSL -automatically uses the multi-threaded versions of the standard -libraries. If your platform is not one of these, consult the INSTALL -file. - -Multi-threaded applications must provide two callback functions to -OpenSSL by calling CRYPTO_set_locking_callback() and -CRYPTO_set_id_callback(), for all versions of OpenSSL up to and -including 0.9.8[abc...]. As of version 1.0.0, CRYPTO_set_id_callback() -and associated APIs are deprecated by CRYPTO_THREADID_set_callback() -and friends. This is described in the threads(3) manpage. - -* I've compiled a program under Windows and it crashes: why? - -This is usually because you've missed the comment in INSTALL.W32. -Your application must link against the same version of the Win32 -C-Runtime against which your openssl libraries were linked. The -default version for OpenSSL is /MD - "Multithreaded DLL". - -If you are using Microsoft Visual C++'s IDE (Visual Studio), in -many cases, your new project most likely defaulted to "Debug -Singlethreaded" - /ML. This is NOT interchangeable with /MD and your -program will crash, typically on the first BIO related read or write -operation. - -For each of the six possible link stage configurations within Win32, -your application must link against the same by which OpenSSL was -built. If you are using MS Visual C++ (Studio) this can be changed -by: - - 1. Select Settings... from the Project Menu. - 2. Select the C/C++ Tab. - 3. Select "Code Generation from the "Category" drop down list box - 4. Select the Appropriate library (see table below) from the "Use - run-time library" drop down list box. Perform this step for both - your debug and release versions of your application (look at the - top left of the settings panel to change between the two) - - Single Threaded /ML - MS VC++ often defaults to - this for the release - version of a new project. - Debug Single Threaded /MLd - MS VC++ often defaults to - this for the debug version - of a new project. - Multithreaded /MT - Debug Multithreaded /MTd - Multithreaded DLL /MD - OpenSSL defaults to this. - Debug Multithreaded DLL /MDd - -Note that debug and release libraries are NOT interchangeable. If you -built OpenSSL with /MD your application must use /MD and cannot use /MDd. - -As per 0.9.8 the above limitation is eliminated for .DLLs. OpenSSL -.DLLs compiled with some specific run-time option [we insist on the -default /MD] can be deployed with application compiled with different -option or even different compiler. But there is a catch! Instead of -re-compiling OpenSSL toolkit, as you would have to with prior versions, -you have to compile small C snippet with compiler and/or options of -your choice. The snippet gets installed as -/include/openssl/applink.c and should be either added to -your application project or simply #include-d in one [and only one] -of your application source files. Failure to link this shim module -into your application manifests itself as fatal "no OPENSSL_Applink" -run-time error. An explicit reminder is due that in this situation -[mixing compiler options] it is as important to add CRYPTO_malloc_init -prior first call to OpenSSL. - -* How do I read or write a DER encoded buffer using the ASN1 functions? - -You have two options. You can either use a memory BIO in conjunction -with the i2d_*_bio() or d2i_*_bio() functions or you can use the -i2d_*(), d2i_*() functions directly. Since these are often the -cause of grief here are some code fragments using PKCS7 as an example: - - unsigned char *buf, *p; - int len; - - len = i2d_PKCS7(p7, NULL); - buf = OPENSSL_malloc(len); /* or Malloc, error checking omitted */ - p = buf; - i2d_PKCS7(p7, &p); - -At this point buf contains the len bytes of the DER encoding of -p7. - -The opposite assumes we already have len bytes in buf: - - unsigned char *p; - p = buf; - p7 = d2i_PKCS7(NULL, &p, len); - -At this point p7 contains a valid PKCS7 structure or NULL if an error -occurred. If an error occurred ERR_print_errors(bio) should give more -information. - -The reason for the temporary variable 'p' is that the ASN1 functions -increment the passed pointer so it is ready to read or write the next -structure. This is often a cause of problems: without the temporary -variable the buffer pointer is changed to point just after the data -that has been read or written. This may well be uninitialized data -and attempts to free the buffer will have unpredictable results -because it no longer points to the same address. - -Memory allocation and encoding can also be combined in a single -operation by the ASN1 routines: - - unsigned char *buf = NULL; /* mandatory */ - int len; - len = i2d_PKCS7(p7, &buf); - if (len < 0) - /* Error */ - /* Do some things with 'buf' */ - /* Finished with buf: free it */ - OPENSSL_free(buf); - -In this special case the "buf" parameter is *not* incremented, it points -to the start of the encoding. - - -* OpenSSL uses DER but I need BER format: does OpenSSL support BER? - -The short answer is yes, because DER is a special case of BER and OpenSSL -ASN1 decoders can process BER. - -The longer answer is that ASN1 structures can be encoded in a number of -different ways. One set of ways is the Basic Encoding Rules (BER) with various -permissible encodings. A restriction of BER is the Distinguished Encoding -Rules (DER): these uniquely specify how a given structure is encoded. - -Therefore, because DER is a special case of BER, DER is an acceptable encoding -for BER. - - -* I've tried using and I get errors why? - -This usually happens when you try compiling something using the PKCS#12 -macros with a C++ compiler. There is hardly ever any need to use the -PKCS#12 macros in a program, it is much easier to parse and create -PKCS#12 files using the PKCS12_parse() and PKCS12_create() functions -documented in doc/openssl.txt and with examples in demos/pkcs12. The -'pkcs12' application has to use the macros because it prints out -debugging information. - - -* I've called and it fails, why? - -Before submitting a report or asking in one of the mailing lists, you -should try to determine the cause. In particular, you should call -ERR_print_errors() or ERR_print_errors_fp() after the failed call -and see if the message helps. Note that the problem may occur earlier -than you think -- you should check for errors after every call where -it is possible, otherwise the actual problem may be hidden because -some OpenSSL functions clear the error state. - - -* I just get a load of numbers for the error output, what do they mean? - -The actual format is described in the ERR_print_errors() manual page. -You should call the function ERR_load_crypto_strings() before hand and -the message will be output in text form. If you can't do this (for example -it is a pre-compiled binary) you can use the errstr utility on the error -code itself (the hex digits after the second colon). - - -* Why do I get errors about unknown algorithms? - -The cause is forgetting to load OpenSSL's table of algorithms with -OpenSSL_add_all_algorithms(). See the manual page for more information. This -can cause several problems such as being unable to read in an encrypted -PEM file, unable to decrypt a PKCS#12 file or signature failure when -verifying certificates. - -* Why can't the OpenSSH configure script detect OpenSSL? - -Several reasons for problems with the automatic detection exist. -OpenSSH requires at least version 0.9.5a of the OpenSSL libraries. -Sometimes the distribution has installed an older version in the system -locations that is detected instead of a new one installed. The OpenSSL -library might have been compiled for another CPU or another mode (32/64 bits). -Permissions might be wrong. - -The general answer is to check the config.log file generated when running -the OpenSSH configure script. It should contain the detailed information -on why the OpenSSL library was not detected or considered incompatible. - - -* Can I use OpenSSL's SSL library with non-blocking I/O? - -Yes; make sure to read the SSL_get_error(3) manual page! - -A pitfall to avoid: Don't assume that SSL_read() will just read from -the underlying transport or that SSL_write() will just write to it -- -it is also possible that SSL_write() cannot do any useful work until -there is data to read, or that SSL_read() cannot do anything until it -is possible to send data. One reason for this is that the peer may -request a new TLS/SSL handshake at any time during the protocol, -requiring a bi-directional message exchange; both SSL_read() and -SSL_write() will try to continue any pending handshake. - - -* Why doesn't my server application receive a client certificate? - -Due to the TLS protocol definition, a client will only send a certificate, -if explicitly asked by the server. Use the SSL_VERIFY_PEER flag of the -SSL_CTX_set_verify() function to enable the use of client certificates. - - -* Why does compilation fail due to an undefined symbol NID_uniqueIdentifier? - -For OpenSSL 0.9.7 the OID table was extended and corrected. In earlier -versions, uniqueIdentifier was incorrectly used for X.509 certificates. -The correct name according to RFC2256 (LDAP) is x500UniqueIdentifier. -Change your code to use the new name when compiling against OpenSSL 0.9.7. - - -* I think I've detected a memory leak, is this a bug? - -In most cases the cause of an apparent memory leak is an OpenSSL internal table -that is allocated when an application starts up. Since such tables do not grow -in size over time they are harmless. - -These internal tables can be freed up when an application closes using various -functions. Currently these include following: - -Thread-local cleanup functions: - - ERR_remove_state() - -Application-global cleanup functions that are aware of usage (and therefore -thread-safe): - - ENGINE_cleanup() and CONF_modules_unload() - -"Brutal" (thread-unsafe) Application-global cleanup functions: - - ERR_free_strings(), EVP_cleanup() and CRYPTO_cleanup_all_ex_data(). - - -* Why does Valgrind complain about the use of uninitialized data? - -When OpenSSL's PRNG routines are called to generate random numbers the supplied -buffer contents are mixed into the entropy pool: so it technically does not -matter whether the buffer is initialized at this point or not. Valgrind (and -other test tools) will complain about this. When using Valgrind, make sure the -OpenSSL library has been compiled with the PURIFY macro defined (-DPURIFY) -to get rid of these warnings. - - -* Why doesn't a memory BIO work when a file does? - -This can occur in several cases for example reading an S/MIME email message. -The reason is that a memory BIO can do one of two things when all the data -has been read from it. - -The default behaviour is to indicate that no more data is available and that -the call should be retried, this is to allow the application to fill up the BIO -again if necessary. - -Alternatively it can indicate that no more data is available and that EOF has -been reached. - -If a memory BIO is to behave in the same way as a file this second behaviour -is needed. This must be done by calling: - - BIO_set_mem_eof_return(bio, 0); - -See the manual pages for more details. - - -* Where are the declarations and implementations of d2i_X509() etc? - -These are defined and implemented by macros of the form: - - - DECLARE_ASN1_FUNCTIONS(X509) and IMPLEMENT_ASN1_FUNCTIONS(X509) - -The implementation passes an ASN1 "template" defining the structure into an -ASN1 interpreter using generalised functions such as ASN1_item_d2i(). - - -=============================================================================== +The FAQ is now maintained on the web: + https://www.openssl.org/docs/faq.html diff --git a/deps/openssl/openssl/INSTALL b/deps/openssl/openssl/INSTALL index 1325079f2a993b..679b30d4c7900f 100644 --- a/deps/openssl/openssl/INSTALL +++ b/deps/openssl/openssl/INSTALL @@ -164,10 +164,10 @@ standard headers). If it is a problem with OpenSSL itself, please report the problem to (note that your message will be recorded in the request tracker publicly readable - via http://www.openssl.org/support/rt.html and will be forwarded to a - public mailing list). Include the output of "make report" in your message. - Please check out the request tracker. Maybe the bug was already - reported or has already been fixed. + at https://www.openssl.org/community/index.html#bugs and will be + forwarded to a public mailing list). Include the output of "make + report" in your message. Please check out the request tracker. Maybe + the bug was already reported or has already been fixed. [If you encounter assembler error messages, try the "no-asm" configuration option as an immediate fix.] diff --git a/deps/openssl/openssl/LICENSE b/deps/openssl/openssl/LICENSE index e47d101f1025e8..fb03713dd11115 100644 --- a/deps/openssl/openssl/LICENSE +++ b/deps/openssl/openssl/LICENSE @@ -12,7 +12,7 @@ --------------- /* ==================================================================== - * Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. + * Copyright (c) 1998-2016 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/deps/openssl/openssl/Makefile b/deps/openssl/openssl/Makefile deleted file mode 100644 index f36147287f5dfa..00000000000000 --- a/deps/openssl/openssl/Makefile +++ /dev/null @@ -1,679 +0,0 @@ -### Generated automatically from Makefile.org by Configure. - -## -## Makefile for OpenSSL -## - -VERSION=1.0.2d -MAJOR=1 -MINOR=0.2 -SHLIB_VERSION_NUMBER=1.0.0 -SHLIB_VERSION_HISTORY= -SHLIB_MAJOR=1 -SHLIB_MINOR=0.0 -SHLIB_EXT= -PLATFORM=dist -OPTIONS= no-ec_nistp_64_gcc_128 no-gmp no-jpake no-krb5 no-libunbound no-md2 no-rc5 no-rfc3779 no-sctp no-shared no-ssl-trace no-store no-unit-test no-zlib no-zlib-dynamic static-engine -CONFIGURE_ARGS=dist -SHLIB_TARGET= - -# HERE indicates where this Makefile lives. This can be used to indicate -# where sub-Makefiles are expected to be. Currently has very limited usage, -# and should probably not be bothered with at all. -HERE=. - -# INSTALL_PREFIX is for package builders so that they can configure -# for, say, /usr/ and yet have everything installed to /tmp/somedir/usr/. -# Normally it is left empty. -INSTALL_PREFIX= -INSTALLTOP=/usr/local/ssl - -# Do not edit this manually. Use Configure --openssldir=DIR do change this! -OPENSSLDIR=/usr/local/ssl - -# NO_IDEA - Define to build without the IDEA algorithm -# NO_RC4 - Define to build without the RC4 algorithm -# NO_RC2 - Define to build without the RC2 algorithm -# THREADS - Define when building with threads, you will probably also need any -# system defines as well, i.e. _REENTERANT for Solaris 2.[34] -# TERMIO - Define the termio terminal subsystem, needed if sgtty is missing. -# TERMIOS - Define the termios terminal subsystem, Silicon Graphics. -# LONGCRYPT - Define to use HPUX 10.x's long password modification to crypt(3). -# DEVRANDOM - Give this the value of the 'random device' if your OS supports -# one. 32 bytes will be read from this when the random -# number generator is initalised. -# SSL_FORBID_ENULL - define if you want the server to be not able to use the -# NULL encryption ciphers. -# -# LOCK_DEBUG - turns on lots of lock debug output :-) -# REF_CHECK - turn on some xyz_free() assertions. -# REF_PRINT - prints some stuff on structure free. -# CRYPTO_MDEBUG - turns on my 'memory leak' detecting stuff -# MFUNC - Make all Malloc/Free/Realloc calls call -# CRYPTO_malloc/CRYPTO_free/CRYPTO_realloc which can be setup to -# call application defined callbacks via CRYPTO_set_mem_functions() -# MD5_ASM needs to be defined to use the x86 assembler for MD5 -# SHA1_ASM needs to be defined to use the x86 assembler for SHA1 -# RMD160_ASM needs to be defined to use the x86 assembler for RIPEMD160 -# Do not define B_ENDIAN or L_ENDIAN if 'unsigned long' == 8. It must -# equal 4. -# PKCS1_CHECK - pkcs1 tests. - -CC= cc -CFLAG= -O -DEPFLAG= -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_LIBUNBOUND -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_SSL_TRACE -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST -PEX_LIBS= -EX_LIBS= -EXE_EXT= -ARFLAGS= -AR= ar $(ARFLAGS) r -RANLIB= /usr/bin/ranlib -NM= nm -PERL= /usr/bin/perl -TAR= tar -TARFLAGS= --no-recursion -MAKEDEPPROG=makedepend -LIBDIR=lib - -# We let the C compiler driver to take care of .s files. This is done in -# order to be excused from maintaining a separate set of architecture -# dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC -# gcc, then the driver will automatically translate it to -xarch=v8plus -# and pass it down to assembler. -AS=$(CC) -c -ASFLAG=$(CFLAG) - -# For x86 assembler: Set PROCESSOR to 386 if you want to support -# the 80386. -PROCESSOR= - -# CPUID module collects small commonly used assembler snippets -CPUID_OBJ= mem_clr.o -BN_ASM= bn_asm.o -EC_ASM= -DES_ENC= des_enc.o fcrypt_b.o -AES_ENC= aes_core.o aes_cbc.o -BF_ENC= bf_enc.o -CAST_ENC= c_enc.o -RC4_ENC= rc4_enc.o rc4_skey.o -RC5_ENC= rc5_enc.o -MD5_ASM_OBJ= -SHA1_ASM_OBJ= -RMD160_ASM_OBJ= -WP_ASM_OBJ= wp_block.o -CMLL_ENC= camellia.o cmll_misc.o cmll_cbc.o -MODES_ASM_OBJ= -ENGINES_ASM_OBJ= -PERLASM_SCHEME= - -# KRB5 stuff -KRB5_INCLUDES= -LIBKRB5= - -# Zlib stuff -ZLIB_INCLUDE= -LIBZLIB= - -# TOP level FIPS install directory. -FIPSDIR=/usr/local/ssl/fips-2.0 - -# This is the location of fipscanister.o and friends. -# The FIPS module build will place it $(INSTALLTOP)/lib -# but since $(INSTALLTOP) can only take the default value -# when the module is built it will be in /usr/local/ssl/lib -# $(INSTALLTOP) for this build may be different so hard -# code the path. - -FIPSLIBDIR= - -# The location of the library which contains fipscanister.o -# normally it will be libcrypto unless fipsdso is set in which -# case it will be libfips. If not compiling in FIPS mode at all -# this is empty making it a useful test for a FIPS compile. - -FIPSCANLIB= - -# Shared library base address. Currently only used on Windows. -# - -BASEADDR=0xFB00000 - -DIRS= crypto ssl engines apps test tools -ENGDIRS= ccgost -SHLIBDIRS= crypto ssl - -# dirs in crypto to build -SDIRS= \ - objects \ - md4 md5 sha mdc2 hmac ripemd whrlpool \ - des aes rc2 rc4 idea bf cast camellia seed modes \ - bn ec rsa dsa ecdsa dh ecdh dso engine \ - buffer bio stack lhash rand err \ - evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \ - cms pqueue ts srp cmac -# keep in mind that the above list is adjusted by ./Configure -# according to no-xxx arguments... - -# tests to perform. "alltests" is a special word indicating that all tests -# should be performed. -TESTS = alltests - -MAKEFILE= Makefile - -MANDIR=$(OPENSSLDIR)/man -MAN1=1 -MAN3=3 -MANSUFFIX= -HTMLSUFFIX=html -HTMLDIR=$(OPENSSLDIR)/html -SHELL=/bin/sh - -TOP= . -ONEDIRS=out tmp -EDIRS= times doc bugs util include certs ms shlib mt demos perl sf dep VMS -WDIRS= windows -LIBS= libcrypto.a libssl.a -SHARED_CRYPTO=libcrypto$(SHLIB_EXT) -SHARED_SSL=libssl$(SHLIB_EXT) -SHARED_LIBS= -SHARED_LIBS_LINK_EXTS= -SHARED_LDFLAGS= - -GENERAL= Makefile -BASENAME= openssl -NAME= $(BASENAME)-$(VERSION) -TARFILE= $(NAME).tar -WTARFILE= $(NAME)-win.tar -EXHEADER= e_os2.h -HEADER= e_os.h - -all: Makefile build_all - -# as we stick to -e, CLEARENV ensures that local variables in lower -# Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn -# shell, which [annoyingly enough] terminates unset with error if VAR -# is not present:-( TOP= && unset TOP is tribute to HP-UX /bin/sh, -# which terminates unset with error if no variable was present:-( -CLEARENV= TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS} \ - $${INCLUDE+INCLUDE} $${INCLUDES+INCLUDES} \ - $${DIR+DIR} $${DIRS+DIRS} $${SRC+SRC} \ - $${LIBSRC+LIBSRC} $${LIBOBJ+LIBOBJ} $${ALL+ALL} \ - $${EXHEADER+EXHEADER} $${HEADER+HEADER} \ - $${GENERAL+GENERAL} $${CFLAGS+CFLAGS} \ - $${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS} \ - $${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS} $${SCRIPTS+SCRIPTS} \ - $${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \ - $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS} - -BUILDENV= PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \ - CC='$(CC)' CFLAG='$(CFLAG)' \ - AS='$(CC)' ASFLAG='$(CFLAG) -c' \ - AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \ - CROSS_COMPILE='$(CROSS_COMPILE)' \ - PERL='$(PERL)' ENGDIRS='$(ENGDIRS)' \ - SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/$(LIBDIR)' \ - INSTALL_PREFIX='$(INSTALL_PREFIX)' \ - INSTALLTOP='$(INSTALLTOP)' OPENSSLDIR='$(OPENSSLDIR)' \ - LIBDIR='$(LIBDIR)' \ - MAKEDEPEND='$$$${TOP}/util/domd $$$${TOP} -MD $(MAKEDEPPROG)' \ - DEPFLAG='-DOPENSSL_NO_DEPRECATED $(DEPFLAG)' \ - MAKEDEPPROG='$(MAKEDEPPROG)' \ - SHARED_LDFLAGS='$(SHARED_LDFLAGS)' \ - KRB5_INCLUDES='$(KRB5_INCLUDES)' LIBKRB5='$(LIBKRB5)' \ - ZLIB_INCLUDE='$(ZLIB_INCLUDE)' LIBZLIB='$(LIBZLIB)' \ - EXE_EXT='$(EXE_EXT)' SHARED_LIBS='$(SHARED_LIBS)' \ - SHLIB_EXT='$(SHLIB_EXT)' SHLIB_TARGET='$(SHLIB_TARGET)' \ - PEX_LIBS='$(PEX_LIBS)' EX_LIBS='$(EX_LIBS)' \ - CPUID_OBJ='$(CPUID_OBJ)' BN_ASM='$(BN_ASM)' \ - EC_ASM='$(EC_ASM)' DES_ENC='$(DES_ENC)' \ - AES_ENC='$(AES_ENC)' CMLL_ENC='$(CMLL_ENC)' \ - BF_ENC='$(BF_ENC)' CAST_ENC='$(CAST_ENC)' \ - RC4_ENC='$(RC4_ENC)' RC5_ENC='$(RC5_ENC)' \ - SHA1_ASM_OBJ='$(SHA1_ASM_OBJ)' \ - MD5_ASM_OBJ='$(MD5_ASM_OBJ)' \ - RMD160_ASM_OBJ='$(RMD160_ASM_OBJ)' \ - WP_ASM_OBJ='$(WP_ASM_OBJ)' \ - MODES_ASM_OBJ='$(MODES_ASM_OBJ)' \ - ENGINES_ASM_OBJ='$(ENGINES_ASM_OBJ)' \ - PERLASM_SCHEME='$(PERLASM_SCHEME)' \ - FIPSLIBDIR='${FIPSLIBDIR}' \ - FIPSDIR='${FIPSDIR}' \ - FIPSCANLIB="$${FIPSCANLIB:-$(FIPSCANLIB)}" \ - THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES= -# MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors, -# which in turn eliminates ambiguities in variable treatment with -e. - -# BUILD_CMD is a generic macro to build a given target in a given -# subdirectory. The target must be given through the shell variable -# `target' and the subdirectory to build in must be given through `dir'. -# This macro shouldn't be used directly, use RECURSIVE_BUILD_CMD or -# BUILD_ONE_CMD instead. -# -# BUILD_ONE_CMD is a macro to build a given target in a given -# subdirectory if that subdirectory is part of $(DIRS). It requires -# exactly the same shell variables as BUILD_CMD. -# -# RECURSIVE_BUILD_CMD is a macro to build a given target in all -# subdirectories defined in $(DIRS). It requires that the target -# is given through the shell variable `target'. -BUILD_CMD= if [ -d "$$dir" ]; then \ - ( cd $$dir && echo "making $$target in $$dir..." && \ - $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. DIR=$$dir $$target \ - ) || exit 1; \ - fi -RECURSIVE_BUILD_CMD=for dir in $(DIRS); do $(BUILD_CMD); done -BUILD_ONE_CMD=\ - if expr " $(DIRS) " : ".* $$dir " >/dev/null 2>&1; then \ - $(BUILD_CMD); \ - fi - -reflect: - @[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV) - -sub_all: build_all - -build_all: build_libs build_apps build_tests build_tools - -build_libs: build_libcrypto build_libssl openssl.pc - -build_libcrypto: build_crypto build_engines libcrypto.pc -build_libssl: build_ssl libssl.pc - -build_crypto: - @dir=crypto; target=all; $(BUILD_ONE_CMD) -build_ssl: build_crypto - @dir=ssl; target=all; $(BUILD_ONE_CMD) -build_engines: build_crypto - @dir=engines; target=all; $(BUILD_ONE_CMD) -build_apps: build_libs - @dir=apps; target=all; $(BUILD_ONE_CMD) -build_tests: build_libs - @dir=test; target=all; $(BUILD_ONE_CMD) -build_tools: build_libs - @dir=tools; target=all; $(BUILD_ONE_CMD) - -all_testapps: build_libs build_testapps -build_testapps: - @dir=crypto; target=testapps; $(BUILD_ONE_CMD) - -fips_premain_dso$(EXE_EXT): libcrypto.a - [ -z "$(FIPSCANLIB)" ] || $(CC) $(CFLAG) -Iinclude \ - -DFINGERPRINT_PREMAIN_DSO_LOAD -o $@ \ - $(FIPSLIBDIR)fips_premain.c $(FIPSLIBDIR)fipscanister.o \ - libcrypto.a $(EX_LIBS) - -libcrypto$(SHLIB_EXT): libcrypto.a fips_premain_dso$(EXE_EXT) - @if [ "$(SHLIB_TARGET)" != "" ]; then \ - if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \ - FIPSLD_LIBCRYPTO=libcrypto.a ; \ - FIPSLD_CC="$(CC)"; CC=$(FIPSDIR)/bin/fipsld; \ - export CC FIPSLD_CC FIPSLD_LIBCRYPTO; \ - fi; \ - $(MAKE) -e SHLIBDIRS=crypto CC="$${CC:-$(CC)}" build-shared && \ - (touch -c fips_premain_dso$(EXE_EXT) || :); \ - else \ - echo "There's no support for shared libraries on this platform" >&2; \ - exit 1; \ - fi - -libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a - @if [ "$(SHLIB_TARGET)" != "" ]; then \ - $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \ - else \ - echo "There's no support for shared libraries on this platform" >&2; \ - exit 1; \ - fi - -clean-shared: - @set -e; for i in $(SHLIBDIRS); do \ - if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \ - tmp="$(SHARED_LIBS_LINK_EXTS)"; \ - for j in $${tmp:-x}; do \ - ( set -x; rm -f lib$$i$$j ); \ - done; \ - fi; \ - ( set -x; rm -f lib$$i$(SHLIB_EXT) ); \ - if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \ - ( set -x; rm -f cyg$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \ - fi; \ - done - -link-shared: - @ set -e; for i in $(SHLIBDIRS); do \ - $(MAKE) -f $(HERE)/Makefile.shared -e $(BUILDENV) \ - LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \ - LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \ - symlink.$(SHLIB_TARGET); \ - libs="$$libs -l$$i"; \ - done - -build-shared: do_$(SHLIB_TARGET) link-shared - -do_$(SHLIB_TARGET): - @ set -e; libs='-L. $(SHLIBDEPS)'; for i in $(SHLIBDIRS); do \ - if [ "$$i" = "ssl" -a -n "$(LIBKRB5)" ]; then \ - libs="$(LIBKRB5) $$libs"; \ - fi; \ - $(CLEARENV) && $(MAKE) -f Makefile.shared -e $(BUILDENV) \ - LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \ - LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \ - LIBDEPS="$$libs $(EX_LIBS)" \ - link_a.$(SHLIB_TARGET); \ - libs="-l$$i $$libs"; \ - done - -libcrypto.pc: Makefile - @ ( echo 'prefix=$(INSTALLTOP)'; \ - echo 'exec_prefix=$${prefix}'; \ - echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \ - echo 'includedir=$${prefix}/include'; \ - echo ''; \ - echo 'Name: OpenSSL-libcrypto'; \ - echo 'Description: OpenSSL cryptography library'; \ - echo 'Version: '$(VERSION); \ - echo 'Requires: '; \ - echo 'Libs: -L$${libdir} -lcrypto'; \ - echo 'Libs.private: $(EX_LIBS)'; \ - echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libcrypto.pc - -libssl.pc: Makefile - @ ( echo 'prefix=$(INSTALLTOP)'; \ - echo 'exec_prefix=$${prefix}'; \ - echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \ - echo 'includedir=$${prefix}/include'; \ - echo ''; \ - echo 'Name: OpenSSL-libssl'; \ - echo 'Description: Secure Sockets Layer and cryptography libraries'; \ - echo 'Version: '$(VERSION); \ - echo 'Requires.private: libcrypto'; \ - echo 'Libs: -L$${libdir} -lssl'; \ - echo 'Libs.private: $(EX_LIBS)'; \ - echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libssl.pc - -openssl.pc: Makefile - @ ( echo 'prefix=$(INSTALLTOP)'; \ - echo 'exec_prefix=$${prefix}'; \ - echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \ - echo 'includedir=$${prefix}/include'; \ - echo ''; \ - echo 'Name: OpenSSL'; \ - echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \ - echo 'Version: '$(VERSION); \ - echo 'Requires: libssl libcrypto' ) > openssl.pc - -Makefile: Makefile.org Configure config - @echo "Makefile is older than Makefile.org, Configure or config." - @echo "Reconfigure the source tree (via './config' or 'perl Configure'), please." - @false - -libclean: - rm -f *.map *.so *.so.* *.dylib *.dll engines/*.so engines/*.dll engines/*.dylib *.a engines/*.a */lib */*/lib - -clean: libclean - rm -f shlib/*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c - @set -e; target=clean; $(RECURSIVE_BUILD_CMD) - rm -f $(LIBS) - rm -f openssl.pc libssl.pc libcrypto.pc - rm -f speed.* .pure - rm -f $(TARFILE) - @set -e; for i in $(ONEDIRS) ;\ - do \ - rm -fr $$i/*; \ - done - -makefile.one: files - $(PERL) util/mk1mf.pl >makefile.one; \ - sh util/do_ms.sh - -files: - $(PERL) $(TOP)/util/files.pl Makefile > $(TOP)/MINFO - @set -e; target=files; $(RECURSIVE_BUILD_CMD) - -links: - @$(PERL) $(TOP)/util/mkdir-p.pl include/openssl - @$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER) - @set -e; target=links; $(RECURSIVE_BUILD_CMD) - -gentests: - @(cd test && echo "generating dummy tests (if needed)..." && \ - $(CLEARENV) && $(MAKE) -e $(BUILDENV) TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on generate ); - -dclean: - rm -rf *.bak include/openssl certs/.0 - @set -e; target=dclean; $(RECURSIVE_BUILD_CMD) - -rehash: rehash.time -rehash.time: certs apps - @if [ -z "$(CROSS_COMPILE)" ]; then \ - (OPENSSL="`pwd`/util/opensslwrap.sh"; \ - [ -x "apps/openssl.exe" ] && OPENSSL="apps/openssl.exe" || :; \ - OPENSSL_DEBUG_MEMORY=on; \ - export OPENSSL OPENSSL_DEBUG_MEMORY; \ - $(PERL) tools/c_rehash certs/demo) && \ - touch rehash.time; \ - else :; fi - -test: tests - -tests: rehash - @(cd test && echo "testing..." && \ - $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf tests ); - OPENSSL_CONF=apps/openssl.cnf util/opensslwrap.sh version -a - -report: - @$(PERL) util/selftest.pl - -update: errors stacks util/libeay.num util/ssleay.num TABLE - @set -e; target=update; $(RECURSIVE_BUILD_CMD) - -depend: - @set -e; target=depend; $(RECURSIVE_BUILD_CMD) - -lint: - @set -e; target=lint; $(RECURSIVE_BUILD_CMD) - -tags: - rm -f TAGS - find . -name '[^.]*.[ch]' | xargs etags -a - -errors: - $(PERL) util/ck_errf.pl -strict */*.c */*/*.c - $(PERL) util/mkerr.pl -recurse -write - (cd engines; $(MAKE) PERL=$(PERL) errors) - -stacks: - $(PERL) util/mkstack.pl -write - -util/libeay.num:: - $(PERL) util/mkdef.pl crypto update - -util/ssleay.num:: - $(PERL) util/mkdef.pl ssl update - -TABLE: Configure - (echo 'Output of `Configure TABLE'"':"; \ - $(PERL) Configure TABLE) > TABLE - -# Build distribution tar-file. As the list of files returned by "find" is -# pretty long, on several platforms a "too many arguments" error or similar -# would occur. Therefore the list of files is temporarily stored into a file -# and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal -# tar does not support the --files-from option. -tar: - find . -type d -print | xargs chmod 755 - find . -type f -print | xargs chmod a+r - find . -type f -perm -0100 -print | xargs chmod a+x - find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \ - $(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \ - tardy --user_number=0 --user_name=openssl \ - --group_number=0 --group_name=openssl \ - --prefix=openssl-$(VERSION) - |\ - gzip --best >../$(TARFILE).gz; \ - rm -f ../$(TARFILE).list; \ - ls -l ../$(TARFILE).gz - -tar-snap: - @$(TAR) $(TARFLAGS) -cvf - \ - `find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \! -name '*test' \! -name '.#*' \! -name '*~' | sort` |\ - tardy --user_number=0 --user_name=openssl \ - --group_number=0 --group_name=openssl \ - --prefix=openssl-$(VERSION) - > ../$(TARFILE);\ - ls -l ../$(TARFILE) - -dist: - $(PERL) Configure dist - @$(MAKE) dist_pem_h - @$(MAKE) SDIRS='$(SDIRS)' clean - @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' tar - -dist_pem_h: - (cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean) - -install: all install_docs install_sw - -install_sw: - @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \ - $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR) \ - $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines \ - $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig \ - $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \ - $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \ - $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \ - $(INSTALL_PREFIX)$(OPENSSLDIR)/private - @set -e; headerlist="$(EXHEADER)"; for i in $$headerlist;\ - do \ - (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ - chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ - done; - @set -e; target=install; $(RECURSIVE_BUILD_CMD) - @set -e; liblist="$(LIBS)"; for i in $$liblist ;\ - do \ - if [ -f "$$i" ]; then \ - ( echo installing $$i; \ - cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \ - $(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \ - chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \ - mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i ); \ - fi; \ - done; - @set -e; if [ -n "$(SHARED_LIBS)" ]; then \ - tmp="$(SHARED_LIBS)"; \ - for i in $${tmp:-x}; \ - do \ - if [ -f "$$i" -o -f "$$i.a" ]; then \ - ( echo installing $$i; \ - if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \ - c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \ - cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \ - chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \ - mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \ - cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \ - chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \ - mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \ - else \ - cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \ - chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \ - mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \ - fi ); \ - if expr $(PLATFORM) : 'mingw' > /dev/null; then \ - ( case $$i in \ - *crypto*) i=libeay32.dll;; \ - *ssl*) i=ssleay32.dll;; \ - esac; \ - echo installing $$i; \ - cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \ - chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \ - mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i ); \ - fi; \ - fi; \ - done; \ - ( here="`pwd`"; \ - cd $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR); \ - $(MAKE) -f $$here/Makefile HERE="$$here" link-shared ); \ - if [ "$(INSTALLTOP)" != "/usr" ]; then \ - echo 'OpenSSL shared libraries have been installed in:'; \ - echo ' $(INSTALLTOP)'; \ - echo ''; \ - sed -e '1,/^$$/d' doc/openssl-shared.txt; \ - fi; \ - fi - cp libcrypto.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig - chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc - cp libssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig - chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc - cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig - chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc - -install_html_docs: - here="`pwd`"; \ - filecase=; \ - case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \ - filecase=-i; \ - esac; \ - for subdir in apps crypto ssl; do \ - mkdir -p $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \ - for i in doc/$$subdir/*.pod; do \ - fn=`basename $$i .pod`; \ - echo "installing html/$$fn.$(HTMLSUFFIX)"; \ - cat $$i \ - | sed -r 's/L<([^)]*)(\([0-9]\))?\|([^)]*)(\([0-9]\))?>/L<\1|\3>/g' \ - | pod2html --podroot=doc --htmlroot=.. --podpath=apps:crypto:ssl \ - | sed -r 's/ $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \ - $(PERL) util/extract-names.pl < $$i | \ - grep -v $$filecase "^$$fn\$$" | \ - (cd $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \ - while read n; do \ - PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$(HTMLSUFFIX) "$$n".$(HTMLSUFFIX); \ - done); \ - done; \ - done - -install_docs: - @$(PERL) $(TOP)/util/mkdir-p.pl \ - $(INSTALL_PREFIX)$(MANDIR)/man1 \ - $(INSTALL_PREFIX)$(MANDIR)/man3 \ - $(INSTALL_PREFIX)$(MANDIR)/man5 \ - $(INSTALL_PREFIX)$(MANDIR)/man7 - @pod2man="`cd ./util; ./pod2mantest $(PERL)`"; \ - here="`pwd`"; \ - filecase=; \ - case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \ - filecase=-i; \ - esac; \ - set -e; for i in doc/apps/*.pod; do \ - fn=`basename $$i .pod`; \ - sec=`$(PERL) util/extract-section.pl 1 < $$i`; \ - echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \ - (cd `$(PERL) util/dirname.pl $$i`; \ - sh -c "$$pod2man \ - --section=$$sec --center=OpenSSL \ - --release=$(VERSION) `basename $$i`") \ - > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \ - $(PERL) util/extract-names.pl < $$i | \ - (grep -v $$filecase "^$$fn\$$"; true) | \ - (grep -v "[ ]"; true) | \ - (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \ - while read n; do \ - PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \ - done); \ - done; \ - set -e; for i in doc/crypto/*.pod doc/ssl/*.pod; do \ - fn=`basename $$i .pod`; \ - sec=`$(PERL) util/extract-section.pl 3 < $$i`; \ - echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \ - (cd `$(PERL) util/dirname.pl $$i`; \ - sh -c "$$pod2man \ - --section=$$sec --center=OpenSSL \ - --release=$(VERSION) `basename $$i`") \ - > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \ - $(PERL) util/extract-names.pl < $$i | \ - (grep -v $$filecase "^$$fn\$$"; true) | \ - (grep -v "[ ]"; true) | \ - (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \ - while read n; do \ - PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \ - done); \ - done - -# DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/deps/openssl/openssl/Makefile.bak b/deps/openssl/openssl/Makefile.bak deleted file mode 100644 index 9a3e50df6011bb..00000000000000 --- a/deps/openssl/openssl/Makefile.bak +++ /dev/null @@ -1,679 +0,0 @@ -### Generated automatically from Makefile.org by Configure. - -## -## Makefile for OpenSSL -## - -VERSION=1.0.2d-dev -MAJOR=1 -MINOR=0.2 -SHLIB_VERSION_NUMBER=1.0.0 -SHLIB_VERSION_HISTORY= -SHLIB_MAJOR=1 -SHLIB_MINOR=0.0 -SHLIB_EXT= -PLATFORM=gcc -OPTIONS= no-ec_nistp_64_gcc_128 no-gmp no-jpake no-krb5 no-libunbound no-md2 no-rc5 no-rfc3779 no-sctp no-shared no-ssl-trace no-store no-unit-test no-zlib no-zlib-dynamic static-engine -CONFIGURE_ARGS=gcc -SHLIB_TARGET= - -# HERE indicates where this Makefile lives. This can be used to indicate -# where sub-Makefiles are expected to be. Currently has very limited usage, -# and should probably not be bothered with at all. -HERE=. - -# INSTALL_PREFIX is for package builders so that they can configure -# for, say, /usr/ and yet have everything installed to /tmp/somedir/usr/. -# Normally it is left empty. -INSTALL_PREFIX= -INSTALLTOP=/usr/local/ssl - -# Do not edit this manually. Use Configure --openssldir=DIR do change this! -OPENSSLDIR=/usr/local/ssl - -# NO_IDEA - Define to build without the IDEA algorithm -# NO_RC4 - Define to build without the RC4 algorithm -# NO_RC2 - Define to build without the RC2 algorithm -# THREADS - Define when building with threads, you will probably also need any -# system defines as well, i.e. _REENTERANT for Solaris 2.[34] -# TERMIO - Define the termio terminal subsystem, needed if sgtty is missing. -# TERMIOS - Define the termios terminal subsystem, Silicon Graphics. -# LONGCRYPT - Define to use HPUX 10.x's long password modification to crypt(3). -# DEVRANDOM - Give this the value of the 'random device' if your OS supports -# one. 32 bytes will be read from this when the random -# number generator is initalised. -# SSL_FORBID_ENULL - define if you want the server to be not able to use the -# NULL encryption ciphers. -# -# LOCK_DEBUG - turns on lots of lock debug output :-) -# REF_CHECK - turn on some xyz_free() assertions. -# REF_PRINT - prints some stuff on structure free. -# CRYPTO_MDEBUG - turns on my 'memory leak' detecting stuff -# MFUNC - Make all Malloc/Free/Realloc calls call -# CRYPTO_malloc/CRYPTO_free/CRYPTO_realloc which can be setup to -# call application defined callbacks via CRYPTO_set_mem_functions() -# MD5_ASM needs to be defined to use the x86 assembler for MD5 -# SHA1_ASM needs to be defined to use the x86 assembler for SHA1 -# RMD160_ASM needs to be defined to use the x86 assembler for RIPEMD160 -# Do not define B_ENDIAN or L_ENDIAN if 'unsigned long' == 8. It must -# equal 4. -# PKCS1_CHECK - pkcs1 tests. - -CC= gcc -CFLAG= -O3 -DEPFLAG= -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_LIBUNBOUND -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_SSL_TRACE -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST -PEX_LIBS= -EX_LIBS= -EXE_EXT= -ARFLAGS= -AR= ar $(ARFLAGS) r -RANLIB= /usr/bin/ranlib -NM= nm -PERL= /usr/bin/perl -TAR= tar -TARFLAGS= --no-recursion -MAKEDEPPROG= gcc -LIBDIR=lib - -# We let the C compiler driver to take care of .s files. This is done in -# order to be excused from maintaining a separate set of architecture -# dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC -# gcc, then the driver will automatically translate it to -xarch=v8plus -# and pass it down to assembler. -AS=$(CC) -c -ASFLAG=$(CFLAG) - -# For x86 assembler: Set PROCESSOR to 386 if you want to support -# the 80386. -PROCESSOR= - -# CPUID module collects small commonly used assembler snippets -CPUID_OBJ= mem_clr.o -BN_ASM= bn_asm.o -EC_ASM= -DES_ENC= des_enc.o fcrypt_b.o -AES_ENC= aes_core.o aes_cbc.o -BF_ENC= bf_enc.o -CAST_ENC= c_enc.o -RC4_ENC= rc4_enc.o rc4_skey.o -RC5_ENC= rc5_enc.o -MD5_ASM_OBJ= -SHA1_ASM_OBJ= -RMD160_ASM_OBJ= -WP_ASM_OBJ= wp_block.o -CMLL_ENC= camellia.o cmll_misc.o cmll_cbc.o -MODES_ASM_OBJ= -ENGINES_ASM_OBJ= -PERLASM_SCHEME= - -# KRB5 stuff -KRB5_INCLUDES= -LIBKRB5= - -# Zlib stuff -ZLIB_INCLUDE= -LIBZLIB= - -# TOP level FIPS install directory. -FIPSDIR=/usr/local/ssl/fips-2.0 - -# This is the location of fipscanister.o and friends. -# The FIPS module build will place it $(INSTALLTOP)/lib -# but since $(INSTALLTOP) can only take the default value -# when the module is built it will be in /usr/local/ssl/lib -# $(INSTALLTOP) for this build may be different so hard -# code the path. - -FIPSLIBDIR= - -# The location of the library which contains fipscanister.o -# normally it will be libcrypto unless fipsdso is set in which -# case it will be libfips. If not compiling in FIPS mode at all -# this is empty making it a useful test for a FIPS compile. - -FIPSCANLIB= - -# Shared library base address. Currently only used on Windows. -# - -BASEADDR=0xFB00000 - -DIRS= crypto ssl engines apps test tools -ENGDIRS= ccgost -SHLIBDIRS= crypto ssl - -# dirs in crypto to build -SDIRS= \ - objects \ - md4 md5 sha mdc2 hmac ripemd whrlpool \ - des aes rc2 rc4 idea bf cast camellia seed modes \ - bn ec rsa dsa ecdsa dh ecdh dso engine \ - buffer bio stack lhash rand err \ - evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \ - cms pqueue ts srp cmac -# keep in mind that the above list is adjusted by ./Configure -# according to no-xxx arguments... - -# tests to perform. "alltests" is a special word indicating that all tests -# should be performed. -TESTS = alltests - -MAKEFILE= Makefile - -MANDIR=$(OPENSSLDIR)/man -MAN1=1 -MAN3=3 -MANSUFFIX= -HTMLSUFFIX=html -HTMLDIR=$(OPENSSLDIR)/html -SHELL=/bin/sh - -TOP= . -ONEDIRS=out tmp -EDIRS= times doc bugs util include certs ms shlib mt demos perl sf dep VMS -WDIRS= windows -LIBS= libcrypto.a libssl.a -SHARED_CRYPTO=libcrypto$(SHLIB_EXT) -SHARED_SSL=libssl$(SHLIB_EXT) -SHARED_LIBS= -SHARED_LIBS_LINK_EXTS= -SHARED_LDFLAGS= - -GENERAL= Makefile -BASENAME= openssl -NAME= $(BASENAME)-$(VERSION) -TARFILE= $(NAME).tar -WTARFILE= $(NAME)-win.tar -EXHEADER= e_os2.h -HEADER= e_os.h - -all: Makefile build_all - -# as we stick to -e, CLEARENV ensures that local variables in lower -# Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn -# shell, which [annoyingly enough] terminates unset with error if VAR -# is not present:-( TOP= && unset TOP is tribute to HP-UX /bin/sh, -# which terminates unset with error if no variable was present:-( -CLEARENV= TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS} \ - $${INCLUDE+INCLUDE} $${INCLUDES+INCLUDES} \ - $${DIR+DIR} $${DIRS+DIRS} $${SRC+SRC} \ - $${LIBSRC+LIBSRC} $${LIBOBJ+LIBOBJ} $${ALL+ALL} \ - $${EXHEADER+EXHEADER} $${HEADER+HEADER} \ - $${GENERAL+GENERAL} $${CFLAGS+CFLAGS} \ - $${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS} \ - $${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS} $${SCRIPTS+SCRIPTS} \ - $${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \ - $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS} - -BUILDENV= PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \ - CC='$(CC)' CFLAG='$(CFLAG)' \ - AS='$(CC)' ASFLAG='$(CFLAG) -c' \ - AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \ - CROSS_COMPILE='$(CROSS_COMPILE)' \ - PERL='$(PERL)' ENGDIRS='$(ENGDIRS)' \ - SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/$(LIBDIR)' \ - INSTALL_PREFIX='$(INSTALL_PREFIX)' \ - INSTALLTOP='$(INSTALLTOP)' OPENSSLDIR='$(OPENSSLDIR)' \ - LIBDIR='$(LIBDIR)' \ - MAKEDEPEND='$$$${TOP}/util/domd $$$${TOP} -MD $(MAKEDEPPROG)' \ - DEPFLAG='-DOPENSSL_NO_DEPRECATED $(DEPFLAG)' \ - MAKEDEPPROG='$(MAKEDEPPROG)' \ - SHARED_LDFLAGS='$(SHARED_LDFLAGS)' \ - KRB5_INCLUDES='$(KRB5_INCLUDES)' LIBKRB5='$(LIBKRB5)' \ - ZLIB_INCLUDE='$(ZLIB_INCLUDE)' LIBZLIB='$(LIBZLIB)' \ - EXE_EXT='$(EXE_EXT)' SHARED_LIBS='$(SHARED_LIBS)' \ - SHLIB_EXT='$(SHLIB_EXT)' SHLIB_TARGET='$(SHLIB_TARGET)' \ - PEX_LIBS='$(PEX_LIBS)' EX_LIBS='$(EX_LIBS)' \ - CPUID_OBJ='$(CPUID_OBJ)' BN_ASM='$(BN_ASM)' \ - EC_ASM='$(EC_ASM)' DES_ENC='$(DES_ENC)' \ - AES_ENC='$(AES_ENC)' CMLL_ENC='$(CMLL_ENC)' \ - BF_ENC='$(BF_ENC)' CAST_ENC='$(CAST_ENC)' \ - RC4_ENC='$(RC4_ENC)' RC5_ENC='$(RC5_ENC)' \ - SHA1_ASM_OBJ='$(SHA1_ASM_OBJ)' \ - MD5_ASM_OBJ='$(MD5_ASM_OBJ)' \ - RMD160_ASM_OBJ='$(RMD160_ASM_OBJ)' \ - WP_ASM_OBJ='$(WP_ASM_OBJ)' \ - MODES_ASM_OBJ='$(MODES_ASM_OBJ)' \ - ENGINES_ASM_OBJ='$(ENGINES_ASM_OBJ)' \ - PERLASM_SCHEME='$(PERLASM_SCHEME)' \ - FIPSLIBDIR='${FIPSLIBDIR}' \ - FIPSDIR='${FIPSDIR}' \ - FIPSCANLIB="$${FIPSCANLIB:-$(FIPSCANLIB)}" \ - THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES= -# MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors, -# which in turn eliminates ambiguities in variable treatment with -e. - -# BUILD_CMD is a generic macro to build a given target in a given -# subdirectory. The target must be given through the shell variable -# `target' and the subdirectory to build in must be given through `dir'. -# This macro shouldn't be used directly, use RECURSIVE_BUILD_CMD or -# BUILD_ONE_CMD instead. -# -# BUILD_ONE_CMD is a macro to build a given target in a given -# subdirectory if that subdirectory is part of $(DIRS). It requires -# exactly the same shell variables as BUILD_CMD. -# -# RECURSIVE_BUILD_CMD is a macro to build a given target in all -# subdirectories defined in $(DIRS). It requires that the target -# is given through the shell variable `target'. -BUILD_CMD= if [ -d "$$dir" ]; then \ - ( cd $$dir && echo "making $$target in $$dir..." && \ - $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. DIR=$$dir $$target \ - ) || exit 1; \ - fi -RECURSIVE_BUILD_CMD=for dir in $(DIRS); do $(BUILD_CMD); done -BUILD_ONE_CMD=\ - if expr " $(DIRS) " : ".* $$dir " >/dev/null 2>&1; then \ - $(BUILD_CMD); \ - fi - -reflect: - @[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV) - -sub_all: build_all - -build_all: build_libs build_apps build_tests build_tools - -build_libs: build_libcrypto build_libssl openssl.pc - -build_libcrypto: build_crypto build_engines libcrypto.pc -build_libssl: build_ssl libssl.pc - -build_crypto: - @dir=crypto; target=all; $(BUILD_ONE_CMD) -build_ssl: build_crypto - @dir=ssl; target=all; $(BUILD_ONE_CMD) -build_engines: build_crypto - @dir=engines; target=all; $(BUILD_ONE_CMD) -build_apps: build_libs - @dir=apps; target=all; $(BUILD_ONE_CMD) -build_tests: build_libs - @dir=test; target=all; $(BUILD_ONE_CMD) -build_tools: build_libs - @dir=tools; target=all; $(BUILD_ONE_CMD) - -all_testapps: build_libs build_testapps -build_testapps: - @dir=crypto; target=testapps; $(BUILD_ONE_CMD) - -fips_premain_dso$(EXE_EXT): libcrypto.a - [ -z "$(FIPSCANLIB)" ] || $(CC) $(CFLAG) -Iinclude \ - -DFINGERPRINT_PREMAIN_DSO_LOAD -o $@ \ - $(FIPSLIBDIR)fips_premain.c $(FIPSLIBDIR)fipscanister.o \ - libcrypto.a $(EX_LIBS) - -libcrypto$(SHLIB_EXT): libcrypto.a fips_premain_dso$(EXE_EXT) - @if [ "$(SHLIB_TARGET)" != "" ]; then \ - if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \ - FIPSLD_LIBCRYPTO=libcrypto.a ; \ - FIPSLD_CC="$(CC)"; CC=$(FIPSDIR)/bin/fipsld; \ - export CC FIPSLD_CC FIPSLD_LIBCRYPTO; \ - fi; \ - $(MAKE) -e SHLIBDIRS=crypto CC="$${CC:-$(CC)}" build-shared && \ - (touch -c fips_premain_dso$(EXE_EXT) || :); \ - else \ - echo "There's no support for shared libraries on this platform" >&2; \ - exit 1; \ - fi - -libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a - @if [ "$(SHLIB_TARGET)" != "" ]; then \ - $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \ - else \ - echo "There's no support for shared libraries on this platform" >&2; \ - exit 1; \ - fi - -clean-shared: - @set -e; for i in $(SHLIBDIRS); do \ - if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \ - tmp="$(SHARED_LIBS_LINK_EXTS)"; \ - for j in $${tmp:-x}; do \ - ( set -x; rm -f lib$$i$$j ); \ - done; \ - fi; \ - ( set -x; rm -f lib$$i$(SHLIB_EXT) ); \ - if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \ - ( set -x; rm -f cyg$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \ - fi; \ - done - -link-shared: - @ set -e; for i in $(SHLIBDIRS); do \ - $(MAKE) -f $(HERE)/Makefile.shared -e $(BUILDENV) \ - LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \ - LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \ - symlink.$(SHLIB_TARGET); \ - libs="$$libs -l$$i"; \ - done - -build-shared: do_$(SHLIB_TARGET) link-shared - -do_$(SHLIB_TARGET): - @ set -e; libs='-L. $(SHLIBDEPS)'; for i in $(SHLIBDIRS); do \ - if [ "$$i" = "ssl" -a -n "$(LIBKRB5)" ]; then \ - libs="$(LIBKRB5) $$libs"; \ - fi; \ - $(CLEARENV) && $(MAKE) -f Makefile.shared -e $(BUILDENV) \ - LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \ - LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \ - LIBDEPS="$$libs $(EX_LIBS)" \ - link_a.$(SHLIB_TARGET); \ - libs="-l$$i $$libs"; \ - done - -libcrypto.pc: Makefile - @ ( echo 'prefix=$(INSTALLTOP)'; \ - echo 'exec_prefix=$${prefix}'; \ - echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \ - echo 'includedir=$${prefix}/include'; \ - echo ''; \ - echo 'Name: OpenSSL-libcrypto'; \ - echo 'Description: OpenSSL cryptography library'; \ - echo 'Version: '$(VERSION); \ - echo 'Requires: '; \ - echo 'Libs: -L$${libdir} -lcrypto'; \ - echo 'Libs.private: $(EX_LIBS)'; \ - echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libcrypto.pc - -libssl.pc: Makefile - @ ( echo 'prefix=$(INSTALLTOP)'; \ - echo 'exec_prefix=$${prefix}'; \ - echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \ - echo 'includedir=$${prefix}/include'; \ - echo ''; \ - echo 'Name: OpenSSL-libssl'; \ - echo 'Description: Secure Sockets Layer and cryptography libraries'; \ - echo 'Version: '$(VERSION); \ - echo 'Requires.private: libcrypto'; \ - echo 'Libs: -L$${libdir} -lssl'; \ - echo 'Libs.private: $(EX_LIBS)'; \ - echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libssl.pc - -openssl.pc: Makefile - @ ( echo 'prefix=$(INSTALLTOP)'; \ - echo 'exec_prefix=$${prefix}'; \ - echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \ - echo 'includedir=$${prefix}/include'; \ - echo ''; \ - echo 'Name: OpenSSL'; \ - echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \ - echo 'Version: '$(VERSION); \ - echo 'Requires: libssl libcrypto' ) > openssl.pc - -Makefile: Makefile.org Configure config - @echo "Makefile is older than Makefile.org, Configure or config." - @echo "Reconfigure the source tree (via './config' or 'perl Configure'), please." - @false - -libclean: - rm -f *.map *.so *.so.* *.dylib *.dll engines/*.so engines/*.dll engines/*.dylib *.a engines/*.a */lib */*/lib - -clean: libclean - rm -f shlib/*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c - @set -e; target=clean; $(RECURSIVE_BUILD_CMD) - rm -f $(LIBS) - rm -f openssl.pc libssl.pc libcrypto.pc - rm -f speed.* .pure - rm -f $(TARFILE) - @set -e; for i in $(ONEDIRS) ;\ - do \ - rm -fr $$i/*; \ - done - -makefile.one: files - $(PERL) util/mk1mf.pl >makefile.one; \ - sh util/do_ms.sh - -files: - $(PERL) $(TOP)/util/files.pl Makefile > $(TOP)/MINFO - @set -e; target=files; $(RECURSIVE_BUILD_CMD) - -links: - @$(PERL) $(TOP)/util/mkdir-p.pl include/openssl - @$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER) - @set -e; target=links; $(RECURSIVE_BUILD_CMD) - -gentests: - @(cd test && echo "generating dummy tests (if needed)..." && \ - $(CLEARENV) && $(MAKE) -e $(BUILDENV) TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on generate ); - -dclean: - rm -rf *.bak include/openssl certs/.0 - @set -e; target=dclean; $(RECURSIVE_BUILD_CMD) - -rehash: rehash.time -rehash.time: certs apps - @if [ -z "$(CROSS_COMPILE)" ]; then \ - (OPENSSL="`pwd`/util/opensslwrap.sh"; \ - [ -x "apps/openssl.exe" ] && OPENSSL="apps/openssl.exe" || :; \ - OPENSSL_DEBUG_MEMORY=on; \ - export OPENSSL OPENSSL_DEBUG_MEMORY; \ - $(PERL) tools/c_rehash certs/demo) && \ - touch rehash.time; \ - else :; fi - -test: tests - -tests: rehash - @(cd test && echo "testing..." && \ - $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf tests ); - OPENSSL_CONF=apps/openssl.cnf util/opensslwrap.sh version -a - -report: - @$(PERL) util/selftest.pl - -update: errors stacks util/libeay.num util/ssleay.num TABLE - @set -e; target=update; $(RECURSIVE_BUILD_CMD) - -depend: - @set -e; target=depend; $(RECURSIVE_BUILD_CMD) - -lint: - @set -e; target=lint; $(RECURSIVE_BUILD_CMD) - -tags: - rm -f TAGS - find . -name '[^.]*.[ch]' | xargs etags -a - -errors: - $(PERL) util/ck_errf.pl -strict */*.c */*/*.c - $(PERL) util/mkerr.pl -recurse -write - (cd engines; $(MAKE) PERL=$(PERL) errors) - -stacks: - $(PERL) util/mkstack.pl -write - -util/libeay.num:: - $(PERL) util/mkdef.pl crypto update - -util/ssleay.num:: - $(PERL) util/mkdef.pl ssl update - -TABLE: Configure - (echo 'Output of `Configure TABLE'"':"; \ - $(PERL) Configure TABLE) > TABLE - -# Build distribution tar-file. As the list of files returned by "find" is -# pretty long, on several platforms a "too many arguments" error or similar -# would occur. Therefore the list of files is temporarily stored into a file -# and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal -# tar does not support the --files-from option. -tar: - find . -type d -print | xargs chmod 755 - find . -type f -print | xargs chmod a+r - find . -type f -perm -0100 -print | xargs chmod a+x - find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \ - $(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \ - tardy --user_number=0 --user_name=openssl \ - --group_number=0 --group_name=openssl \ - --prefix=openssl-$(VERSION) - |\ - gzip --best >../$(TARFILE).gz; \ - rm -f ../$(TARFILE).list; \ - ls -l ../$(TARFILE).gz - -tar-snap: - @$(TAR) $(TARFLAGS) -cvf - \ - `find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \! -name '*test' \! -name '.#*' \! -name '*~' | sort` |\ - tardy --user_number=0 --user_name=openssl \ - --group_number=0 --group_name=openssl \ - --prefix=openssl-$(VERSION) - > ../$(TARFILE);\ - ls -l ../$(TARFILE) - -dist: - $(PERL) Configure dist - @$(MAKE) dist_pem_h - @$(MAKE) SDIRS='$(SDIRS)' clean - @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' tar - -dist_pem_h: - (cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean) - -install: all install_docs install_sw - -install_sw: - @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \ - $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR) \ - $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines \ - $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig \ - $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \ - $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \ - $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \ - $(INSTALL_PREFIX)$(OPENSSLDIR)/private - @set -e; headerlist="$(EXHEADER)"; for i in $$headerlist;\ - do \ - (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ - chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ - done; - @set -e; target=install; $(RECURSIVE_BUILD_CMD) - @set -e; liblist="$(LIBS)"; for i in $$liblist ;\ - do \ - if [ -f "$$i" ]; then \ - ( echo installing $$i; \ - cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \ - $(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \ - chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \ - mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i ); \ - fi; \ - done; - @set -e; if [ -n "$(SHARED_LIBS)" ]; then \ - tmp="$(SHARED_LIBS)"; \ - for i in $${tmp:-x}; \ - do \ - if [ -f "$$i" -o -f "$$i.a" ]; then \ - ( echo installing $$i; \ - if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \ - c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \ - cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \ - chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \ - mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \ - cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \ - chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \ - mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \ - else \ - cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \ - chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \ - mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/$$i; \ - fi ); \ - if expr $(PLATFORM) : 'mingw' > /dev/null; then \ - ( case $$i in \ - *crypto*) i=libeay32.dll;; \ - *ssl*) i=ssleay32.dll;; \ - esac; \ - echo installing $$i; \ - cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \ - chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \ - mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i ); \ - fi; \ - fi; \ - done; \ - ( here="`pwd`"; \ - cd $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR); \ - $(MAKE) -f $$here/Makefile HERE="$$here" link-shared ); \ - if [ "$(INSTALLTOP)" != "/usr" ]; then \ - echo 'OpenSSL shared libraries have been installed in:'; \ - echo ' $(INSTALLTOP)'; \ - echo ''; \ - sed -e '1,/^$$/d' doc/openssl-shared.txt; \ - fi; \ - fi - cp libcrypto.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig - chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc - cp libssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig - chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc - cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig - chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc - -install_html_docs: - here="`pwd`"; \ - filecase=; \ - case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \ - filecase=-i; \ - esac; \ - for subdir in apps crypto ssl; do \ - mkdir -p $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \ - for i in doc/$$subdir/*.pod; do \ - fn=`basename $$i .pod`; \ - echo "installing html/$$fn.$(HTMLSUFFIX)"; \ - cat $$i \ - | sed -r 's/L<([^)]*)(\([0-9]\))?\|([^)]*)(\([0-9]\))?>/L<\1|\3>/g' \ - | pod2html --podroot=doc --htmlroot=.. --podpath=apps:crypto:ssl \ - | sed -r 's/ $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \ - $(PERL) util/extract-names.pl < $$i | \ - grep -v $$filecase "^$$fn\$$" | \ - (cd $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \ - while read n; do \ - PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$(HTMLSUFFIX) "$$n".$(HTMLSUFFIX); \ - done); \ - done; \ - done - -install_docs: - @$(PERL) $(TOP)/util/mkdir-p.pl \ - $(INSTALL_PREFIX)$(MANDIR)/man1 \ - $(INSTALL_PREFIX)$(MANDIR)/man3 \ - $(INSTALL_PREFIX)$(MANDIR)/man5 \ - $(INSTALL_PREFIX)$(MANDIR)/man7 - @pod2man="`cd ./util; ./pod2mantest $(PERL)`"; \ - here="`pwd`"; \ - filecase=; \ - case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \ - filecase=-i; \ - esac; \ - set -e; for i in doc/apps/*.pod; do \ - fn=`basename $$i .pod`; \ - sec=`$(PERL) util/extract-section.pl 1 < $$i`; \ - echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \ - (cd `$(PERL) util/dirname.pl $$i`; \ - sh -c "$$pod2man \ - --section=$$sec --center=OpenSSL \ - --release=$(VERSION) `basename $$i`") \ - > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \ - $(PERL) util/extract-names.pl < $$i | \ - (grep -v $$filecase "^$$fn\$$"; true) | \ - (grep -v "[ ]"; true) | \ - (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \ - while read n; do \ - PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \ - done); \ - done; \ - set -e; for i in doc/crypto/*.pod doc/ssl/*.pod; do \ - fn=`basename $$i .pod`; \ - sec=`$(PERL) util/extract-section.pl 3 < $$i`; \ - echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \ - (cd `$(PERL) util/dirname.pl $$i`; \ - sh -c "$$pod2man \ - --section=$$sec --center=OpenSSL \ - --release=$(VERSION) `basename $$i`") \ - > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \ - $(PERL) util/extract-names.pl < $$i | \ - (grep -v $$filecase "^$$fn\$$"; true) | \ - (grep -v "[ ]"; true) | \ - (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \ - while read n; do \ - PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \ - done); \ - done - -# DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/deps/openssl/openssl/Makefile.org b/deps/openssl/openssl/Makefile.org index d77e26495887c9..76fdbdf6ac5c2a 100644 --- a/deps/openssl/openssl/Makefile.org +++ b/deps/openssl/openssl/Makefile.org @@ -180,8 +180,7 @@ SHARED_LDFLAGS= GENERAL= Makefile BASENAME= openssl NAME= $(BASENAME)-$(VERSION) -TARFILE= $(NAME).tar -WTARFILE= $(NAME)-win.tar +TARFILE= ../$(NAME).tar EXHEADER= e_os2.h HEADER= e_os.h @@ -203,7 +202,9 @@ CLEARENV= TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS} \ $${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \ $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS} -BUILDENV= PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \ +# LC_ALL=C ensures that error [and other] messages are delivered in +# same language for uniform treatment. +BUILDENV= LC_ALL=C PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)'\ CC='$(CC)' CFLAG='$(CFLAG)' \ AS='$(CC)' ASFLAG='$(CFLAG) -c' \ AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \ @@ -497,35 +498,35 @@ TABLE: Configure # would occur. Therefore the list of files is temporarily stored into a file # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal # tar does not support the --files-from option. -tar: +TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from $(TARFILE).list \ + --owner 0 --group 0 \ + --transform 's|^|$(NAME)/|' \ + -cvf - + +$(TARFILE).list: + find * \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \ + \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \ + \( \! -name '*test' -o -name bctest -o -name pod2mantest \) \ + \! -name '.#*' \! -name '*~' \! -type l \ + | sort > $(TARFILE).list + +tar: $(TARFILE).list find . -type d -print | xargs chmod 755 find . -type f -print | xargs chmod a+r find . -type f -perm -0100 -print | xargs chmod a+x - find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \ - $(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \ - tardy --user_number=0 --user_name=openssl \ - --group_number=0 --group_name=openssl \ - --prefix=openssl-$(VERSION) - |\ - gzip --best >../$(TARFILE).gz; \ - rm -f ../$(TARFILE).list; \ - ls -l ../$(TARFILE).gz - -tar-snap: - @$(TAR) $(TARFLAGS) -cvf - \ - `find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \! -name '*test' \! -name '.#*' \! -name '*~' | sort` |\ - tardy --user_number=0 --user_name=openssl \ - --group_number=0 --group_name=openssl \ - --prefix=openssl-$(VERSION) - > ../$(TARFILE);\ - ls -l ../$(TARFILE) + $(TAR_COMMAND) | gzip --best > $(TARFILE).gz + rm -f $(TARFILE).list + ls -l $(TARFILE).gz + +tar-snap: $(TARFILE).list + $(TAR_COMMAND) > $(TARFILE) + rm -f $(TARFILE).list + ls -l $(TARFILE) dist: $(PERL) Configure dist - @$(MAKE) dist_pem_h @$(MAKE) SDIRS='$(SDIRS)' clean - @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' tar - -dist_pem_h: - (cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean) + @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar install: all install_docs install_sw diff --git a/deps/openssl/openssl/Makefile.shared b/deps/openssl/openssl/Makefile.shared index e753f44e18fdf6..a2aa9804c1d98d 100644 --- a/deps/openssl/openssl/Makefile.shared +++ b/deps/openssl/openssl/Makefile.shared @@ -272,7 +272,7 @@ link_o.cygwin: SHLIB_SOVER=${LIBVERSION:+"-$(LIBVERSION)"}; \ ALLSYMSFLAGS='-Wl,--whole-archive'; \ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ - SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base $$deffile -Wl,-s,-Bsymbolic"; \ + SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base $$deffile -Wl,-Bsymbolic"; \ $(LINK_SO_O) #for mingw target if def-file is in use dll-name should match library-name link_a.cygwin: @@ -289,7 +289,7 @@ link_a.cygwin: SHLIB_SOVER=32; \ extras="$(LIBNAME).def"; \ $(PERL) util/mkdef.pl 32 $$SHLIB > $$extras; \ - base=; [ $(LIBNAME) = "crypto" ] && base=-Wl,--image-base,0x63000000; \ + base=; [ $(LIBNAME) = "crypto" -a -n "$(FIPSCANLIB)" ] && base=-Wl,--image-base,0x63000000; \ fi; \ dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \ $(PERL) util/mkrc.pl $$dll_name | \ @@ -297,7 +297,7 @@ link_a.cygwin: extras="$$extras rc.o"; \ ALLSYMSFLAGS='-Wl,--whole-archive'; \ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ - SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-s,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a $$extras"; \ + SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared $$base -Wl,-Bsymbolic -Wl,--out-implib,lib$(LIBNAME).dll.a $$extras"; \ [ -f apps/$$dll_name ] && rm apps/$$dll_name; \ [ -f test/$$dll_name ] && rm test/$$dll_name; \ $(LINK_SO_A) || exit 1; \ diff --git a/deps/openssl/openssl/NEWS b/deps/openssl/openssl/NEWS index 29e48053efe7f4..33242c83624de2 100644 --- a/deps/openssl/openssl/NEWS +++ b/deps/openssl/openssl/NEWS @@ -5,9 +5,37 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.0.2f and OpenSSL 1.0.2g [1 Mar 2016] + + o Disable weak ciphers in SSLv3 and up in default builds of OpenSSL. + o Disable SSLv2 default build, default negotiation and weak ciphers + (CVE-2016-0800) + o Fix a double-free in DSA code (CVE-2016-0705) + o Disable SRP fake user seed to address a server memory leak + (CVE-2016-0798) + o Fix BN_hex2bn/BN_dec2bn NULL pointer deref/heap corruption + (CVE-2016-0797) + o Fix memory issues in BIO_*printf functions (CVE-2016-0799) + o Fix side channel attack on modular exponentiation (CVE-2016-0702) + + Major changes between OpenSSL 1.0.2e and OpenSSL 1.0.2f [28 Jan 2016] + + o DH small subgroups (CVE-2016-0701) + o SSLv2 doesn't block disabled ciphers (CVE-2015-3197) + + Major changes between OpenSSL 1.0.2d and OpenSSL 1.0.2e [3 Dec 2015] + + o BN_mod_exp may produce incorrect results on x86_64 (CVE-2015-3193) + o Certificate verify crash with missing PSS parameter (CVE-2015-3194) + o X509_ATTRIBUTE memory leak (CVE-2015-3195) + o Rewrite EVP_DecodeUpdate (base64 decoding) to fix several bugs + o In DSA_generate_parameters_ex, if the provided seed is too short, + return an error + Major changes between OpenSSL 1.0.2c and OpenSSL 1.0.2d [9 Jul 2015] o Alternate chains certificate forgery (CVE-2015-1793) + o Race condition handling PSK identify hint (CVE-2015-3196) Major changes between OpenSSL 1.0.2b and OpenSSL 1.0.2c [12 Jun 2015] diff --git a/deps/openssl/openssl/README b/deps/openssl/openssl/README index 493141b69ca03d..2077b04eb271d4 100644 --- a/deps/openssl/openssl/README +++ b/deps/openssl/openssl/README @@ -1,7 +1,7 @@ - OpenSSL 1.0.2d 9 Jul 2015 + OpenSSL 1.0.2g 1 Mar 2016 - Copyright (c) 1998-2011 The OpenSSL Project + Copyright (c) 1998-2015 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson All rights reserved. @@ -10,17 +10,17 @@ The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, fully featured, and Open Source toolkit implementing the - Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) - protocols as well as a full-strength general purpose cryptography library. - The project is managed by a worldwide community of volunteers that use the - Internet to communicate, plan, and develop the OpenSSL toolkit and its - related documentation. + Secure Sockets Layer (SSLv3) and Transport Layer Security (TLS) protocols as + well as a full-strength general purpose cryptograpic library. The project is + managed by a worldwide community of volunteers that use the Internet to + communicate, plan, and develop the OpenSSL toolkit and its related + documentation. - OpenSSL is based on the excellent SSLeay library developed from Eric A. Young + OpenSSL is descended from the SSLeay library developed by Eric A. Young and Tim J. Hudson. The OpenSSL toolkit is licensed under a dual-license (the - OpenSSL license plus the SSLeay license) situation, which basically means - that you are free to get and use it for commercial and non-commercial - purposes as long as you fulfill the conditions of both licenses. + OpenSSL license plus the SSLeay license), which means that you are free to + get and use it for commercial and non-commercial purposes as long as you + fulfill the conditions of both licenses. OVERVIEW -------- @@ -28,90 +28,39 @@ The OpenSSL toolkit includes: libssl.a: - Implementation of SSLv2, SSLv3, TLSv1 and the required code to support - both SSLv2, SSLv3 and TLSv1 in the one server and client. + Provides the client and server-side implementations for SSLv3 and TLS. libcrypto.a: - General encryption and X.509 v1/v3 stuff needed by SSL/TLS but not - actually logically part of it. It includes routines for the following: - - Ciphers - libdes - EAY's libdes DES encryption package which was floating - around the net for a few years, and was then relicensed by - him as part of SSLeay. It includes 15 'modes/variations' - of DES (1, 2 and 3 key versions of ecb, cbc, cfb and ofb; - pcbc and a more general form of cfb and ofb) including desx - in cbc mode, a fast crypt(3), and routines to read - passwords from the keyboard. - RC4 encryption, - RC2 encryption - 4 different modes, ecb, cbc, cfb and ofb. - Blowfish encryption - 4 different modes, ecb, cbc, cfb and ofb. - IDEA encryption - 4 different modes, ecb, cbc, cfb and ofb. - - Digests - MD5 and MD2 message digest algorithms, fast implementations, - SHA (SHA-0) and SHA-1 message digest algorithms, - MDC2 message digest. A DES based hash that is popular on smart cards. - - Public Key - RSA encryption/decryption/generation. - There is no limit on the number of bits. - DSA encryption/decryption/generation. - There is no limit on the number of bits. - Diffie-Hellman key-exchange/key generation. - There is no limit on the number of bits. - - X.509v3 certificates - X509 encoding/decoding into/from binary ASN1 and a PEM - based ASCII-binary encoding which supports encryption with a - private key. Program to generate RSA and DSA certificate - requests and to generate RSA and DSA certificates. - - Systems - The normal digital envelope routines and base64 encoding. Higher - level access to ciphers and digests by name. New ciphers can be - loaded at run time. The BIO io system which is a simple non-blocking - IO abstraction. Current methods supported are file descriptors, - sockets, socket accept, socket connect, memory buffer, buffering, SSL - client/server, file pointer, encryption, digest, non-blocking testing - and null. - - Data structures - A dynamically growing hashing system - A simple stack. - A Configuration loader that uses a format similar to MS .ini files. + Provides general cryptographic and X.509 support needed by SSL/TLS but + not logically part of it. openssl: A command line tool that can be used for: - Creation of RSA, DH and DSA key parameters + Creation of key parameters Creation of X.509 certificates, CSRs and CRLs - Calculation of Message Digests - Encryption and Decryption with Ciphers - SSL/TLS Client and Server Tests + Calculation of message digests + Encryption and decryption + SSL/TLS client and server tests Handling of S/MIME signed or encrypted mail + And more... INSTALLATION ------------ - To install this package under a Unix derivative, read the INSTALL file. For - a Win32 platform, read the INSTALL.W32 file. For OpenVMS systems, read - INSTALL.VMS. - - Read the documentation in the doc/ directory. It is quite rough, but it - lists the functions; you will probably have to look at the code to work out - how to use them. Look at the example programs. - - PROBLEMS - -------- - - For some platforms, there are some known problems that may affect the user - or application author. We try to collect those in doc/PROBLEMS, with current - thoughts on how they should be solved in a future of OpenSSL. + See the appropriate file: + INSTALL Linux, Unix, etc. + INSTALL.DJGPP DOS platform with DJGPP + INSTALL.NW Netware + INSTALL.OS2 OS/2 + INSTALL.VMS VMS + INSTALL.W32 Windows (32bit) + INSTALL.W64 Windows (64bit) + INSTALL.WCE Windows CE SUPPORT ------- - See the OpenSSL website www.openssl.org for details of how to obtain + See the OpenSSL website www.openssl.org for details on how to obtain commercial technical support. If you have any problems with OpenSSL then please take the following steps @@ -137,56 +86,34 @@ Email the report to: - openssl-bugs@openssl.org + rt@openssl.org + + In order to avoid spam, this is a moderated mailing list, and it might + take a day for the ticket to show up. (We also scan posts to make sure + that security disclosures aren't publically posted by mistake.) Mail + to this address is recorded in the public RT (request tracker) database + (see https://www.openssl.org/community/index.html#bugs for details) and + also forwarded the public openssl-dev mailing list. Confidential mail + may be sent to openssl-security@openssl.org (PGP key available from the + key servers). - Note that the request tracker should NOT be used for general assistance - or support queries. Just because something doesn't work the way you expect - does not mean it is necessarily a bug in OpenSSL. + Please do NOT use this for general assistance or support queries. + Just because something doesn't work the way you expect does not mean it + is necessarily a bug in OpenSSL. - Note that mail to openssl-bugs@openssl.org is recorded in the public - request tracker database (see https://www.openssl.org/support/rt.html - for details) and also forwarded to a public mailing list. Confidential - mail may be sent to openssl-security@openssl.org (PGP key available from - the key servers). + You can also make GitHub pull requests. If you do this, please also send + mail to rt@openssl.org with a link to the PR so that we can more easily + keep track of it. HOW TO CONTRIBUTE TO OpenSSL ---------------------------- - Development is coordinated on the openssl-dev mailing list (see - http://www.openssl.org for information on subscribing). If you - would like to submit a patch, send it to openssl-bugs@openssl.org with - the string "[PATCH]" in the subject. Please be sure to include a - textual explanation of what your patch does. - - If you are unsure as to whether a feature will be useful for the general - OpenSSL community please discuss it on the openssl-dev mailing list first. - Someone may be already working on the same thing or there may be a good - reason as to why that feature isn't implemented. - - Patches should be as up to date as possible, preferably relative to the - current Git or the last snapshot. They should follow the coding style of - OpenSSL and compile without warnings. Some of the core team developer targets - can be used for testing purposes, (debug-steve64, debug-geoff etc). OpenSSL - compiles on many varied platforms: try to ensure you only use portable - features. - - Note: For legal reasons, contributions from the US can be accepted only - if a TSU notification and a copy of the patch are sent to crypt@bis.doc.gov - (formerly BXA) with a copy to the ENC Encryption Request Coordinator; - please take some time to look at - http://www.bis.doc.gov/Encryption/PubAvailEncSourceCodeNofify.html [sic] - and - http://w3.access.gpo.gov/bis/ear/pdf/740.pdf (EAR Section 740.13(e)) - for the details. If "your encryption source code is too large to serve as - an email attachment", they are glad to receive it by fax instead; hope you - have a cheap long-distance plan. - - Our preferred format for changes is "diff -u" output. You might - generate it like this: - - # cd openssl-work - # [your changes] - # ./Configure dist; make clean - # cd .. - # diff -ur openssl-orig openssl-work > mydiffs.patch + See CONTRIBUTING + + LEGALITIES + ---------- + A number of nations, in particular the U.S., restrict the use or export + of cryptography. If you are potentially subject to such restrictions + you should seek competent professional legal advice before attempting to + develop or distribute cryptographic code. diff --git a/deps/openssl/openssl/apps/CA.pl b/deps/openssl/openssl/apps/CA.pl deleted file mode 100644 index a3965ecea96eda..00000000000000 --- a/deps/openssl/openssl/apps/CA.pl +++ /dev/null @@ -1,189 +0,0 @@ -#!/usr/bin/perl -# -# CA - wrapper around ca to make it easier to use ... basically ca requires -# some setup stuff to be done before you can use it and this makes -# things easier between now and when Eric is convinced to fix it :-) -# -# CA -newca ... will setup the right stuff -# CA -newreq[-nodes] ... will generate a certificate request -# CA -sign ... will sign the generated request and output -# -# At the end of that grab newreq.pem and newcert.pem (one has the key -# and the other the certificate) and cat them together and that is what -# you want/need ... I'll make even this a little cleaner later. -# -# -# 12-Jan-96 tjh Added more things ... including CA -signcert which -# converts a certificate to a request and then signs it. -# 10-Jan-96 eay Fixed a few more bugs and added the SSLEAY_CONFIG -# environment variable so this can be driven from -# a script. -# 25-Jul-96 eay Cleaned up filenames some more. -# 11-Jun-96 eay Fixed a few filename missmatches. -# 03-May-96 eay Modified to use 'ssleay cmd' instead of 'cmd'. -# 18-Apr-96 tjh Original hacking -# -# Tim Hudson -# tjh@cryptsoft.com -# - -# 27-Apr-98 snh Translation into perl, fix existing CA bug. -# -# -# Steve Henson -# shenson@bigfoot.com - -# default openssl.cnf file has setup as per the following -# demoCA ... where everything is stored - -my $openssl; -if(defined $ENV{OPENSSL}) { - $openssl = $ENV{OPENSSL}; -} else { - $openssl = "openssl"; - $ENV{OPENSSL} = $openssl; -} - -$SSLEAY_CONFIG=$ENV{"SSLEAY_CONFIG"}; -$DAYS="-days 365"; # 1 year -$CADAYS="-days 1095"; # 3 years -$REQ="$openssl req $SSLEAY_CONFIG"; -$CA="$openssl ca $SSLEAY_CONFIG"; -$VERIFY="$openssl verify"; -$X509="$openssl x509"; -$PKCS12="$openssl pkcs12"; - -$CATOP="./demoCA"; -$CAKEY="cakey.pem"; -$CAREQ="careq.pem"; -$CACERT="cacert.pem"; - -$DIRMODE = 0777; - -$RET = 0; - -foreach (@ARGV) { - if ( /^(-\?|-h|-help)$/ ) { - print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-verify\n"; - exit 0; - } elsif (/^-newcert$/) { - # create a certificate - system ("$REQ -new -x509 -keyout newkey.pem -out newcert.pem $DAYS"); - $RET=$?; - print "Certificate is in newcert.pem, private key is in newkey.pem\n" - } elsif (/^-newreq$/) { - # create a certificate request - system ("$REQ -new -keyout newkey.pem -out newreq.pem $DAYS"); - $RET=$?; - print "Request is in newreq.pem, private key is in newkey.pem\n"; - } elsif (/^-newreq-nodes$/) { - # create a certificate request - system ("$REQ -new -nodes -keyout newkey.pem -out newreq.pem $DAYS"); - $RET=$?; - print "Request is in newreq.pem, private key is in newkey.pem\n"; - } elsif (/^-newca$/) { - # if explicitly asked for or it doesn't exist then setup the - # directory structure that Eric likes to manage things - $NEW="1"; - if ( "$NEW" || ! -f "${CATOP}/serial" ) { - # create the directory hierarchy - mkdir $CATOP, $DIRMODE; - mkdir "${CATOP}/certs", $DIRMODE; - mkdir "${CATOP}/crl", $DIRMODE ; - mkdir "${CATOP}/newcerts", $DIRMODE; - mkdir "${CATOP}/private", $DIRMODE; - open OUT, ">${CATOP}/index.txt"; - close OUT; - open OUT, ">${CATOP}/crlnumber"; - print OUT "01\n"; - close OUT; - } - if ( ! -f "${CATOP}/private/$CAKEY" ) { - print "CA certificate filename (or enter to create)\n"; - $FILE = ; - - chop $FILE; - - # ask user for existing CA certificate - if ($FILE) { - cp_pem($FILE,"${CATOP}/private/$CAKEY", "PRIVATE"); - cp_pem($FILE,"${CATOP}/$CACERT", "CERTIFICATE"); - $RET=$?; - } else { - print "Making CA certificate ...\n"; - system ("$REQ -new -keyout " . - "${CATOP}/private/$CAKEY -out ${CATOP}/$CAREQ"); - system ("$CA -create_serial " . - "-out ${CATOP}/$CACERT $CADAYS -batch " . - "-keyfile ${CATOP}/private/$CAKEY -selfsign " . - "-extensions v3_ca " . - "-infiles ${CATOP}/$CAREQ "); - $RET=$?; - } - } - } elsif (/^-pkcs12$/) { - my $cname = $ARGV[1]; - $cname = "My Certificate" unless defined $cname; - system ("$PKCS12 -in newcert.pem -inkey newkey.pem " . - "-certfile ${CATOP}/$CACERT -out newcert.p12 " . - "-export -name \"$cname\""); - $RET=$?; - print "PKCS #12 file is in newcert.p12\n"; - exit $RET; - } elsif (/^-xsign$/) { - system ("$CA -policy policy_anything -infiles newreq.pem"); - $RET=$?; - } elsif (/^(-sign|-signreq)$/) { - system ("$CA -policy policy_anything -out newcert.pem " . - "-infiles newreq.pem"); - $RET=$?; - print "Signed certificate is in newcert.pem\n"; - } elsif (/^(-signCA)$/) { - system ("$CA -policy policy_anything -out newcert.pem " . - "-extensions v3_ca -infiles newreq.pem"); - $RET=$?; - print "Signed CA certificate is in newcert.pem\n"; - } elsif (/^-signcert$/) { - system ("$X509 -x509toreq -in newreq.pem -signkey newreq.pem " . - "-out tmp.pem"); - system ("$CA -policy policy_anything -out newcert.pem " . - "-infiles tmp.pem"); - $RET = $?; - print "Signed certificate is in newcert.pem\n"; - } elsif (/^-verify$/) { - if (shift) { - foreach $j (@ARGV) { - system ("$VERIFY -CAfile $CATOP/$CACERT $j"); - $RET=$? if ($? != 0); - } - exit $RET; - } else { - system ("$VERIFY -CAfile $CATOP/$CACERT newcert.pem"); - $RET=$?; - exit 0; - } - } else { - print STDERR "Unknown arg $_\n"; - print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-verify\n"; - exit 1; - } -} - -exit $RET; - -sub cp_pem { -my ($infile, $outfile, $bound) = @_; -open IN, $infile; -open OUT, ">$outfile"; -my $flag = 0; -while () { - $flag = 1 if (/^-----BEGIN.*$bound/) ; - print OUT $_ if ($flag); - if (/^-----END.*$bound/) { - close IN; - close OUT; - return; - } -} -} - diff --git a/deps/openssl/openssl/apps/Makefile b/deps/openssl/openssl/apps/Makefile index cafe55458ddc14..8c3297ea672473 100644 --- a/deps/openssl/openssl/apps/Makefile +++ b/deps/openssl/openssl/apps/Makefile @@ -135,7 +135,7 @@ update: openssl-vms.cnf local_depend depend: local_depend @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi local_depend: - @[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(SRC); \ + @[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(SRC) dclean: $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new diff --git a/deps/openssl/openssl/apps/apps.c b/deps/openssl/openssl/apps/apps.c index 7478fc379a55da..b1dd97038f7d7c 100644 --- a/deps/openssl/openssl/apps/apps.c +++ b/deps/openssl/openssl/apps/apps.c @@ -119,9 +119,6 @@ #include #include #include -#if !defined(OPENSSL_SYSNAME_WIN32) && !defined(OPENSSL_SYSNAME_WINCE) && !defined(NETWARE_CLIB) -# include -#endif #include #include #include @@ -1352,7 +1349,11 @@ int set_name_ex(unsigned long *flags, const char *arg) {"ca_default", XN_FLAG_MULTILINE, 0xffffffffL}, {NULL, 0, 0} }; - return set_multi_opts(flags, arg, ex_tbl); + if (set_multi_opts(flags, arg, ex_tbl) == 0) + return 0; + if ((*flags & XN_FLAG_SEP_MASK) == 0) + *flags |= XN_FLAG_SEP_CPLUS_SPC; + return 1; } int set_ext_copy(int *copy_type, const char *arg) @@ -2441,7 +2442,11 @@ int bio_to_mem(unsigned char **out, int maxlen, BIO *in) else len = 1024; len = BIO_read(in, tbuf, len); - if (len <= 0) + if (len < 0) { + BIO_free(mem); + return -1; + } + if (len == 0) break; if (BIO_write(mem, tbuf, len) != len) { BIO_free(mem); @@ -2458,7 +2463,7 @@ int bio_to_mem(unsigned char **out, int maxlen, BIO *in) return ret; } -int pkey_ctrl_string(EVP_PKEY_CTX *ctx, char *value) +int pkey_ctrl_string(EVP_PKEY_CTX *ctx, const char *value) { int rv; char *stmp, *vtmp = NULL; diff --git a/deps/openssl/openssl/apps/apps.h b/deps/openssl/openssl/apps/apps.h index 8276e708694dd1..19bf5cc3337d7d 100644 --- a/deps/openssl/openssl/apps/apps.h +++ b/deps/openssl/openssl/apps/apps.h @@ -321,7 +321,7 @@ int args_verify(char ***pargs, int *pargc, int *badarg, BIO *err, X509_VERIFY_PARAM **pm); void policies_print(BIO *out, X509_STORE_CTX *ctx); int bio_to_mem(unsigned char **out, int maxlen, BIO *in); -int pkey_ctrl_string(EVP_PKEY_CTX *ctx, char *value); +int pkey_ctrl_string(EVP_PKEY_CTX *ctx, const char *value); int init_gen_str(BIO *err, EVP_PKEY_CTX **pctx, const char *algname, ENGINE *e, int do_param); int do_X509_sign(BIO *err, X509 *x, EVP_PKEY *pkey, const EVP_MD *md, diff --git a/deps/openssl/openssl/apps/asn1pars.c b/deps/openssl/openssl/apps/asn1pars.c index 11b07875943be8..0a6b990b503d85 100644 --- a/deps/openssl/openssl/apps/asn1pars.c +++ b/deps/openssl/openssl/apps/asn1pars.c @@ -313,9 +313,9 @@ int MAIN(int argc, char **argv) } typ = ASN1_TYPE_get(at); if ((typ == V_ASN1_OBJECT) + || (typ == V_ASN1_BOOLEAN) || (typ == V_ASN1_NULL)) { - BIO_printf(bio_err, "Can't parse %s type\n", - typ == V_ASN1_NULL ? "NULL" : "OBJECT"); + BIO_printf(bio_err, "Can't parse %s type\n", ASN1_tag2str(typ)); ERR_print_errors(bio_err); goto end; } diff --git a/deps/openssl/openssl/apps/ca.c b/deps/openssl/openssl/apps/ca.c index 3b7336c0466e5d..0b66095b83b6f1 100644 --- a/deps/openssl/openssl/apps/ca.c +++ b/deps/openssl/openssl/apps/ca.c @@ -99,25 +99,19 @@ #undef PROG #define PROG ca_main -#define BASE_SECTION "ca" -#define CONFIG_FILE "openssl.cnf" +#define BASE_SECTION "ca" +#define CONFIG_FILE "openssl.cnf" #define ENV_DEFAULT_CA "default_ca" -#define STRING_MASK "string_mask" +#define STRING_MASK "string_mask" #define UTF8_IN "utf8" -#define ENV_DIR "dir" -#define ENV_CERTS "certs" -#define ENV_CRL_DIR "crl_dir" -#define ENV_CA_DB "CA_DB" #define ENV_NEW_CERTS_DIR "new_certs_dir" #define ENV_CERTIFICATE "certificate" #define ENV_SERIAL "serial" #define ENV_CRLNUMBER "crlnumber" -#define ENV_CRL "crl" #define ENV_PRIVATE_KEY "private_key" -#define ENV_RANDFILE "RANDFILE" #define ENV_DEFAULT_DAYS "default_days" #define ENV_DEFAULT_STARTDATE "default_startdate" #define ENV_DEFAULT_ENDDATE "default_enddate" @@ -2538,6 +2532,8 @@ static int do_updatedb(CA_DB *db) char **rrow, *a_tm_s; a_tm = ASN1_UTCTIME_new(); + if (a_tm == NULL) + return -1; /* get actual time and make a string */ a_tm = X509_gmtime_adj(a_tm, 0); diff --git a/deps/openssl/openssl/apps/ecparam.c b/deps/openssl/openssl/apps/ecparam.c index 06ac77b838a380..71b67f435cfd56 100644 --- a/deps/openssl/openssl/apps/ecparam.c +++ b/deps/openssl/openssl/apps/ecparam.c @@ -416,14 +416,13 @@ int MAIN(int argc, char **argv) } if (check) { - if (group == NULL) - BIO_printf(bio_err, "no elliptic curve parameters\n"); BIO_printf(bio_err, "checking elliptic curve parameters: "); if (!EC_GROUP_check(group, NULL)) { BIO_printf(bio_err, "failed\n"); ERR_print_errors(bio_err); - } else - BIO_printf(bio_err, "ok\n"); + goto end; + } + BIO_printf(bio_err, "ok\n"); } diff --git a/deps/openssl/openssl/apps/engine.c b/deps/openssl/openssl/apps/engine.c index 3d70cac416d6a5..f54631b50d819a 100644 --- a/deps/openssl/openssl/apps/engine.c +++ b/deps/openssl/openssl/apps/engine.c @@ -1,4 +1,4 @@ -/* apps/engine.c -*- mode: C; c-file-style: "eay" -*- */ +/* apps/engine.c */ /* * Written by Richard Levitte for the OpenSSL project * 2000. @@ -99,8 +99,6 @@ static void identity(char *ptr) static int append_buf(char **buf, const char *s, int *size, int step) { - int l = strlen(s); - if (*buf == NULL) { *size = step; *buf = OPENSSL_malloc(*size); @@ -109,9 +107,6 @@ static int append_buf(char **buf, const char *s, int *size, int step) **buf = '\0'; } - if (**buf != '\0') - l += 2; /* ", " */ - if (strlen(*buf) + strlen(s) >= (unsigned int)*size) { *size += step; *buf = OPENSSL_realloc(*buf, *size); diff --git a/deps/openssl/openssl/apps/md4.c b/deps/openssl/openssl/apps/md4.c deleted file mode 120000 index 7f457b2ab1e120..00000000000000 --- a/deps/openssl/openssl/apps/md4.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/md4/md4.c \ No newline at end of file diff --git a/deps/openssl/openssl/apps/ocsp.c b/deps/openssl/openssl/apps/ocsp.c index 926083dd1b5cc1..5da51df5148c8c 100644 --- a/deps/openssl/openssl/apps/ocsp.c +++ b/deps/openssl/openssl/apps/ocsp.c @@ -1041,7 +1041,7 @@ static int make_ocsp_response(OCSP_RESPONSE **resp, OCSP_REQUEST *req, bs = OCSP_BASICRESP_new(); thisupd = X509_gmtime_adj(NULL, 0); if (ndays != -1) - nextupd = X509_gmtime_adj(NULL, nmin * 60 + ndays * 3600 * 24); + nextupd = X509_time_adj_ex(NULL, ndays, nmin * 60, NULL); /* Examine each certificate id in the request */ for (i = 0; i < id_count; i++) { @@ -1261,8 +1261,8 @@ static OCSP_RESPONSE *query_responder(BIO *err, BIO *cbio, const char *path, return NULL; } - if (BIO_get_fd(cbio, &fd) <= 0) { - BIO_puts(err, "Can't get connection fd\n"); + if (BIO_get_fd(cbio, &fd) < 0) { + BIO_puts(bio_err, "Can't get connection fd\n"); goto err; } diff --git a/deps/openssl/openssl/apps/pkcs12.c b/deps/openssl/openssl/apps/pkcs12.c index 4ff64495a956cc..cbb75b7d5fe49a 100644 --- a/deps/openssl/openssl/apps/pkcs12.c +++ b/deps/openssl/openssl/apps/pkcs12.c @@ -79,7 +79,8 @@ const EVP_CIPHER *enc; # define CLCERTS 0x8 # define CACERTS 0x10 -int get_cert_chain(X509 *cert, X509_STORE *store, STACK_OF(X509) **chain); +static int get_cert_chain(X509 *cert, X509_STORE *store, + STACK_OF(X509) **chain); int dump_certs_keys_p12(BIO *out, PKCS12 *p12, char *pass, int passlen, int options, char *pempass); int dump_certs_pkeys_bags(BIO *out, STACK_OF(PKCS12_SAFEBAG) *bags, @@ -134,13 +135,6 @@ int MAIN(int argc, char **argv) apps_startup(); -# ifdef OPENSSL_FIPS - if (FIPS_mode()) - cert_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC; - else -# endif - cert_pbe = NID_pbe_WithSHA1And40BitRC2_CBC; - enc = EVP_des_ede3_cbc(); if (bio_err == NULL) bio_err = BIO_new_fp(stderr, BIO_NOCLOSE); @@ -148,6 +142,13 @@ int MAIN(int argc, char **argv) if (!load_config(bio_err, NULL)) goto end; +# ifdef OPENSSL_FIPS + if (FIPS_mode()) + cert_pbe = NID_pbe_WithSHA1And3_Key_TripleDES_CBC; + else +# endif + cert_pbe = NID_pbe_WithSHA1And40BitRC2_CBC; + args = argv + 1; while (*args) { @@ -594,7 +595,7 @@ int MAIN(int argc, char **argv) vret = get_cert_chain(ucert, store, &chain2); X509_STORE_free(store); - if (!vret) { + if (vret == X509_V_OK) { /* Exclude verified certificate */ for (i = 1; i < sk_X509_num(chain2); i++) sk_X509_push(certs, sk_X509_value(chain2, i)); @@ -602,7 +603,7 @@ int MAIN(int argc, char **argv) X509_free(sk_X509_value(chain2, 0)); sk_X509_free(chain2); } else { - if (vret >= 0) + if (vret != X509_V_ERR_UNSPECIFIED) BIO_printf(bio_err, "Error %s getting chain.\n", X509_verify_cert_error_string(vret)); else @@ -906,36 +907,25 @@ int dump_certs_pkeys_bag(BIO *out, PKCS12_SAFEBAG *bag, char *pass, /* Given a single certificate return a verified chain or NULL if error */ -/* Hope this is OK .... */ - -int get_cert_chain(X509 *cert, X509_STORE *store, STACK_OF(X509) **chain) +static int get_cert_chain(X509 *cert, X509_STORE *store, + STACK_OF(X509) **chain) { X509_STORE_CTX store_ctx; - STACK_OF(X509) *chn; + STACK_OF(X509) *chn = NULL; int i = 0; - /* - * FIXME: Should really check the return status of X509_STORE_CTX_init - * for an error, but how that fits into the return value of this function - * is less obvious. - */ - X509_STORE_CTX_init(&store_ctx, store, cert, NULL); - if (X509_verify_cert(&store_ctx) <= 0) { - i = X509_STORE_CTX_get_error(&store_ctx); - if (i == 0) - /* - * avoid returning 0 if X509_verify_cert() did not set an - * appropriate error value in the context - */ - i = -1; - chn = NULL; - goto err; - } else + if (!X509_STORE_CTX_init(&store_ctx, store, cert, NULL)) { + *chain = NULL; + return X509_V_ERR_UNSPECIFIED; + } + + if (X509_verify_cert(&store_ctx) > 0) chn = X509_STORE_CTX_get1_chain(&store_ctx); - err: + else if ((i = X509_STORE_CTX_get_error(&store_ctx)) == 0) + i = X509_V_ERR_UNSPECIFIED; + X509_STORE_CTX_cleanup(&store_ctx); *chain = chn; - return i; } diff --git a/deps/openssl/openssl/apps/pkeyutl.c b/deps/openssl/openssl/apps/pkeyutl.c index aaa90740ad4dc6..39faa451ab8df0 100644 --- a/deps/openssl/openssl/apps/pkeyutl.c +++ b/deps/openssl/openssl/apps/pkeyutl.c @@ -73,11 +73,12 @@ static void usage(void); #define PROG pkeyutl_main static EVP_PKEY_CTX *init_ctx(int *pkeysize, - char *keyfile, int keyform, int key_type, - char *passargin, int pkey_op, ENGINE *e); + const char *keyfile, int keyform, int key_type, + char *passargin, int pkey_op, ENGINE *e, + int impl); static int setup_peer(BIO *err, EVP_PKEY_CTX *ctx, int peerform, - const char *file); + const char *file, ENGINE* e); static int do_keyop(EVP_PKEY_CTX *ctx, int pkey_op, unsigned char *out, size_t *poutlen, @@ -97,10 +98,13 @@ int MAIN(int argc, char **argv) EVP_PKEY_CTX *ctx = NULL; char *passargin = NULL; int keysize = -1; - + int engine_impl = 0; unsigned char *buf_in = NULL, *buf_out = NULL, *sig = NULL; - size_t buf_outlen; + size_t buf_outlen = 0; int buf_inlen = 0, siglen = -1; + const char *inkey = NULL; + const char *peerkey = NULL; + STACK_OF(OPENSSL_STRING) *pkeyopts = NULL; int ret = 1, rv = -1; @@ -134,21 +138,13 @@ int MAIN(int argc, char **argv) } else if (!strcmp(*argv, "-inkey")) { if (--argc < 1) badarg = 1; - else { - ctx = init_ctx(&keysize, - *(++argv), keyform, key_type, - passargin, pkey_op, e); - if (!ctx) { - BIO_puts(bio_err, "Error initializing context\n"); - ERR_print_errors(bio_err); - badarg = 1; - } - } + else + inkey = *++argv; } else if (!strcmp(*argv, "-peerkey")) { if (--argc < 1) badarg = 1; - else if (!setup_peer(bio_err, ctx, peerform, *(++argv))) - badarg = 1; + else + peerkey = *++argv; } else if (!strcmp(*argv, "-passin")) { if (--argc < 1) badarg = 1; @@ -171,6 +167,8 @@ int MAIN(int argc, char **argv) badarg = 1; else e = setup_engine(bio_err, *(++argv), 0); + } else if (!strcmp(*argv, "-engine_impl")) { + engine_impl = 1; } #endif else if (!strcmp(*argv, "-pubin")) @@ -187,23 +185,21 @@ int MAIN(int argc, char **argv) pkey_op = EVP_PKEY_OP_VERIFY; else if (!strcmp(*argv, "-verifyrecover")) pkey_op = EVP_PKEY_OP_VERIFYRECOVER; - else if (!strcmp(*argv, "-rev")) - rev = 1; else if (!strcmp(*argv, "-encrypt")) pkey_op = EVP_PKEY_OP_ENCRYPT; else if (!strcmp(*argv, "-decrypt")) pkey_op = EVP_PKEY_OP_DECRYPT; else if (!strcmp(*argv, "-derive")) pkey_op = EVP_PKEY_OP_DERIVE; + else if (!strcmp(*argv, "-rev")) + rev = 1; else if (strcmp(*argv, "-pkeyopt") == 0) { if (--argc < 1) badarg = 1; - else if (!ctx) { - BIO_puts(bio_err, "-pkeyopt command before -inkey\n"); - badarg = 1; - } else if (pkey_ctrl_string(ctx, *(++argv)) <= 0) { - BIO_puts(bio_err, "parameter setting error\n"); - ERR_print_errors(bio_err); + else if ((pkeyopts == NULL && + (pkeyopts = sk_OPENSSL_STRING_new_null()) == NULL) || + sk_OPENSSL_STRING_push(pkeyopts, *++argv) == 0) { + BIO_puts(bio_err, "out of memory\n"); goto end; } } else @@ -216,10 +212,37 @@ int MAIN(int argc, char **argv) argv++; } - if (!ctx) { + if (inkey == NULL || + (peerkey != NULL && pkey_op != EVP_PKEY_OP_DERIVE)) { usage(); goto end; } + ctx = init_ctx(&keysize, inkey, keyform, key_type, + passargin, pkey_op, e, engine_impl); + if (!ctx) { + BIO_puts(bio_err, "Error initializing context\n"); + ERR_print_errors(bio_err); + goto end; + } + if (peerkey != NULL && !setup_peer(bio_err, ctx, peerform, peerkey, e)) { + BIO_puts(bio_err, "Error setting up peer key\n"); + ERR_print_errors(bio_err); + goto end; + } + if (pkeyopts != NULL) { + int num = sk_OPENSSL_STRING_num(pkeyopts); + int i; + + for (i = 0; i < num; ++i) { + const char *opt = sk_OPENSSL_STRING_value(pkeyopts, i); + + if (pkey_ctrl_string(ctx, opt) <= 0) { + BIO_puts(bio_err, "parameter setting error\n"); + ERR_print_errors(bio_err); + goto end; + } + } + } if (sigfile && (pkey_op != EVP_PKEY_OP_VERIFY)) { BIO_puts(bio_err, "Signature file specified for non verify\n"); @@ -269,7 +292,7 @@ int MAIN(int argc, char **argv) } siglen = bio_to_mem(&sig, keysize * 10, sigbio); BIO_free(sigbio); - if (siglen <= 0) { + if (siglen < 0) { BIO_printf(bio_err, "Error reading signature data\n"); goto end; } @@ -278,7 +301,7 @@ int MAIN(int argc, char **argv) if (in) { /* Read the input data */ buf_inlen = bio_to_mem(&buf_in, keysize * 10, in); - if (buf_inlen <= 0) { + if (buf_inlen < 0) { BIO_printf(bio_err, "Error reading input Data\n"); exit(1); } @@ -306,7 +329,7 @@ int MAIN(int argc, char **argv) } else { rv = do_keyop(ctx, pkey_op, NULL, (size_t *)&buf_outlen, buf_in, (size_t)buf_inlen); - if (rv > 0) { + if (rv > 0 && buf_outlen != 0) { buf_out = OPENSSL_malloc(buf_outlen); if (!buf_out) rv = -1; @@ -336,12 +359,14 @@ int MAIN(int argc, char **argv) EVP_PKEY_CTX_free(ctx); BIO_free(in); BIO_free_all(out); - if (buf_in) + if (buf_in != NULL) OPENSSL_free(buf_in); - if (buf_out) + if (buf_out != NULL) OPENSSL_free(buf_out); - if (sig) + if (sig != NULL) OPENSSL_free(sig); + if (pkeyopts != NULL) + sk_OPENSSL_STRING_free(pkeyopts); return ret; } @@ -368,18 +393,21 @@ static void usage() BIO_printf(bio_err, "-hexdump hex dump output\n"); #ifndef OPENSSL_NO_ENGINE BIO_printf(bio_err, - "-engine e use engine e, possibly a hardware device.\n"); + "-engine e use engine e, maybe a hardware device, for loading keys.\n"); + BIO_printf(bio_err, "-engine_impl also use engine given by -engine for crypto operations\n"); #endif BIO_printf(bio_err, "-passin arg pass phrase source\n"); } static EVP_PKEY_CTX *init_ctx(int *pkeysize, - char *keyfile, int keyform, int key_type, - char *passargin, int pkey_op, ENGINE *e) + const char *keyfile, int keyform, int key_type, + char *passargin, int pkey_op, ENGINE *e, + int engine_impl) { EVP_PKEY *pkey = NULL; EVP_PKEY_CTX *ctx = NULL; + ENGINE *impl = NULL; char *passin = NULL; int rv = -1; X509 *x; @@ -419,7 +447,12 @@ static EVP_PKEY_CTX *init_ctx(int *pkeysize, if (!pkey) goto end; - ctx = EVP_PKEY_CTX_new(pkey, e); +#ifndef OPENSSL_NO_ENGINE + if (engine_impl) + impl = e; +#endif + + ctx = EVP_PKEY_CTX_new(pkey, impl); EVP_PKEY_free(pkey); @@ -467,16 +500,15 @@ static EVP_PKEY_CTX *init_ctx(int *pkeysize, } static int setup_peer(BIO *err, EVP_PKEY_CTX *ctx, int peerform, - const char *file) + const char *file, ENGINE* e) { EVP_PKEY *peer = NULL; + ENGINE* engine = NULL; int ret; - if (!ctx) { - BIO_puts(err, "-peerkey command before -inkey\n"); - return 0; - } - peer = load_pubkey(bio_err, file, peerform, 0, NULL, NULL, "Peer Key"); + if (peerform == FORMAT_ENGINE) + engine = e; + peer = load_pubkey(bio_err, file, peerform, 0, NULL, engine, "Peer Key"); if (!peer) { BIO_printf(bio_err, "Error reading peer key %s\n", file); diff --git a/deps/openssl/openssl/apps/req.c b/deps/openssl/openssl/apps/req.c index 57781c93c4cafe..e818bd2976d6db 100644 --- a/deps/openssl/openssl/apps/req.c +++ b/deps/openssl/openssl/apps/req.c @@ -101,8 +101,8 @@ #define STRING_MASK "string_mask" #define UTF8_IN "utf8" -#define DEFAULT_KEY_LENGTH 512 -#define MIN_KEY_LENGTH 384 +#define DEFAULT_KEY_LENGTH 2048 +#define MIN_KEY_LENGTH 512 #undef PROG #define PROG req_main diff --git a/deps/openssl/openssl/apps/rsautl.c b/deps/openssl/openssl/apps/rsautl.c index d642f9ad97f3c1..5b6f849ea74d6e 100644 --- a/deps/openssl/openssl/apps/rsautl.c +++ b/deps/openssl/openssl/apps/rsautl.c @@ -250,7 +250,7 @@ int MAIN(int argc, char **argv) if (outfile) { if (!(out = BIO_new_file(outfile, "wb"))) { - BIO_printf(bio_err, "Error Reading Output File\n"); + BIO_printf(bio_err, "Error Writing Output File\n"); ERR_print_errors(bio_err); goto end; } @@ -276,7 +276,7 @@ int MAIN(int argc, char **argv) /* Read the input data */ rsa_inlen = BIO_read(in, rsa_in, keysize * 2); - if (rsa_inlen <= 0) { + if (rsa_inlen < 0) { BIO_printf(bio_err, "Error reading input Data\n"); exit(1); } @@ -311,7 +311,7 @@ int MAIN(int argc, char **argv) } - if (rsa_outlen <= 0) { + if (rsa_outlen < 0) { BIO_printf(bio_err, "RSA operation error\n"); ERR_print_errors(bio_err); goto end; diff --git a/deps/openssl/openssl/apps/s_cb.c b/deps/openssl/openssl/apps/s_cb.c index dd3aa74e02afd4..5b5e711bf2eb9c 100644 --- a/deps/openssl/openssl/apps/s_cb.c +++ b/deps/openssl/openssl/apps/s_cb.c @@ -981,6 +981,11 @@ void MS_CALLBACK tlsext_cb(SSL *s, int client_server, int type, extname = "next protocol"; break; #endif +#ifdef TLSEXT_TYPE_application_layer_protocol_negotiation + case TLSEXT_TYPE_application_layer_protocol_negotiation: + extname = "application layer protocol negotiation"; + break; +#endif case TLSEXT_TYPE_padding: extname = "TLS padding"; diff --git a/deps/openssl/openssl/apps/s_client.c b/deps/openssl/openssl/apps/s_client.c index d89f2c51066574..bc8004a5551524 100644 --- a/deps/openssl/openssl/apps/s_client.c +++ b/deps/openssl/openssl/apps/s_client.c @@ -316,7 +316,7 @@ static void sc_usage(void) " -connect host:port - who to connect to (default is %s:%s)\n", SSL_HOST_NAME, PORT_STR); BIO_printf(bio_err, - " -verify_host host - check peer certificate matches \"host\"\n"); + " -verify_hostname host - check peer certificate matches \"host\"\n"); BIO_printf(bio_err, " -verify_email email - check peer certificate matches \"email\"\n"); BIO_printf(bio_err, @@ -398,8 +398,6 @@ static void sc_usage(void) " -no_tls1_2/-no_tls1_1/-no_tls1/-no_ssl3/-no_ssl2 - turn off that protocol\n"); BIO_printf(bio_err, " -bugs - Switch on all SSL implementation bug workarounds\n"); - BIO_printf(bio_err, - " -serverpref - Use server's cipher preferences (only SSLv2)\n"); BIO_printf(bio_err, " -cipher - preferred cipher to use, use the 'openssl ciphers'\n"); BIO_printf(bio_err, @@ -432,6 +430,14 @@ static void sc_usage(void) " -no_ticket - disable use of RFC4507bis session tickets\n"); BIO_printf(bio_err, " -serverinfo types - send empty ClientHello extensions (comma-separated numbers)\n"); + BIO_printf(bio_err, + " -curves arg - Elliptic curves to advertise (colon-separated list)\n"); + BIO_printf(bio_err, + " -sigalgs arg - Signature algorithms to support (colon-separated list)\n"); + BIO_printf(bio_err, + " -client_sigalgs arg - Signature algorithms to support for client\n"); + BIO_printf(bio_err, + " certificate authentication (colon-separated list)\n"); #endif #ifndef OPENSSL_NO_NEXTPROTONEG BIO_printf(bio_err, @@ -2080,6 +2086,9 @@ int MAIN(int argc, char **argv) sk_X509_pop_free(chain, X509_free); if (pass) OPENSSL_free(pass); +#ifndef OPENSSL_NO_SRP + OPENSSL_free(srp_arg.srppassin); +#endif if (vpm) X509_VERIFY_PARAM_free(vpm); ssl_excert_free(exc); diff --git a/deps/openssl/openssl/apps/s_server.c b/deps/openssl/openssl/apps/s_server.c index acef382c2c4bb0..09c755b55cfe16 100644 --- a/deps/openssl/openssl/apps/s_server.c +++ b/deps/openssl/openssl/apps/s_server.c @@ -429,6 +429,8 @@ typedef struct srpsrvparm_st { static int MS_CALLBACK ssl_srp_server_param_cb(SSL *s, int *ad, void *arg) { srpsrvparm *p = (srpsrvparm *) arg; + int ret = SSL3_AL_FATAL; + if (p->login == NULL && p->user == NULL) { p->login = SSL_get_srp_username(s); BIO_printf(bio_err, "SRP username = \"%s\"\n", p->login); @@ -437,21 +439,25 @@ static int MS_CALLBACK ssl_srp_server_param_cb(SSL *s, int *ad, void *arg) if (p->user == NULL) { BIO_printf(bio_err, "User %s doesn't exist\n", p->login); - return SSL3_AL_FATAL; + goto err; } + if (SSL_set_srp_server_param (s, p->user->N, p->user->g, p->user->s, p->user->v, p->user->info) < 0) { *ad = SSL_AD_INTERNAL_ERROR; - return SSL3_AL_FATAL; + goto err; } BIO_printf(bio_err, "SRP parameters set: username = \"%s\" info=\"%s\" \n", p->login, p->user->info); - /* need to check whether there are memory leaks */ + ret = SSL_ERROR_NONE; + +err: + SRP_user_pwd_free(p->user); p->user = NULL; p->login = NULL; - return SSL_ERROR_NONE; + return ret; } #endif @@ -498,7 +504,7 @@ static void sv_usage(void) BIO_printf(bio_err, " -accept arg - port to accept on (default is %d)\n", PORT); BIO_printf(bio_err, - " -verify_host host - check peer certificate matches \"host\"\n"); + " -verify_hostname host - check peer certificate matches \"host\"\n"); BIO_printf(bio_err, " -verify_email email - check peer certificate matches \"email\"\n"); BIO_printf(bio_err, @@ -652,6 +658,12 @@ static void sv_usage(void) " -no_ticket - disable use of RFC4507bis session tickets\n"); BIO_printf(bio_err, " -legacy_renegotiation - enable use of legacy renegotiation (dangerous)\n"); + BIO_printf(bio_err, + " -sigalgs arg - Signature algorithms to support (colon-separated list)\n"); + BIO_printf(bio_err, + " -client_sigalgs arg - Signature algorithms to support for client \n"); + BIO_printf(bio_err, + " certificate authentication (colon-separated list)\n"); # ifndef OPENSSL_NO_NEXTPROTONEG BIO_printf(bio_err, " -nextprotoneg arg - set the advertised protocols for the NPN extension (comma-separated list)\n"); @@ -2446,9 +2458,10 @@ static int sv_body(char *hostname, int s, int stype, unsigned char *context) #ifndef OPENSSL_NO_SRP while (SSL_get_error(con, k) == SSL_ERROR_WANT_X509_LOOKUP) { BIO_printf(bio_s_out, "LOOKUP renego during write\n"); + SRP_user_pwd_free(srp_callback_parm.user); srp_callback_parm.user = - SRP_VBASE_get_by_user(srp_callback_parm.vb, - srp_callback_parm.login); + SRP_VBASE_get1_by_user(srp_callback_parm.vb, + srp_callback_parm.login); if (srp_callback_parm.user) BIO_printf(bio_s_out, "LOOKUP done %s\n", srp_callback_parm.user->info); @@ -2502,9 +2515,10 @@ static int sv_body(char *hostname, int s, int stype, unsigned char *context) #ifndef OPENSSL_NO_SRP while (SSL_get_error(con, i) == SSL_ERROR_WANT_X509_LOOKUP) { BIO_printf(bio_s_out, "LOOKUP renego during read\n"); + SRP_user_pwd_free(srp_callback_parm.user); srp_callback_parm.user = - SRP_VBASE_get_by_user(srp_callback_parm.vb, - srp_callback_parm.login); + SRP_VBASE_get1_by_user(srp_callback_parm.vb, + srp_callback_parm.login); if (srp_callback_parm.user) BIO_printf(bio_s_out, "LOOKUP done %s\n", srp_callback_parm.user->info); @@ -2599,9 +2613,10 @@ static int init_ssl_connection(SSL *con) while (i <= 0 && SSL_get_error(con, i) == SSL_ERROR_WANT_X509_LOOKUP) { BIO_printf(bio_s_out, "LOOKUP during accept %s\n", srp_callback_parm.login); + SRP_user_pwd_free(srp_callback_parm.user); srp_callback_parm.user = - SRP_VBASE_get_by_user(srp_callback_parm.vb, - srp_callback_parm.login); + SRP_VBASE_get1_by_user(srp_callback_parm.vb, + srp_callback_parm.login); if (srp_callback_parm.user) BIO_printf(bio_s_out, "LOOKUP done %s\n", srp_callback_parm.user->info); @@ -2843,9 +2858,10 @@ static int www_body(char *hostname, int s, int stype, unsigned char *context) && SSL_get_error(con, i) == SSL_ERROR_WANT_X509_LOOKUP) { BIO_printf(bio_s_out, "LOOKUP during accept %s\n", srp_callback_parm.login); + SRP_user_pwd_free(srp_callback_parm.user); srp_callback_parm.user = - SRP_VBASE_get_by_user(srp_callback_parm.vb, - srp_callback_parm.login); + SRP_VBASE_get1_by_user(srp_callback_parm.vb, + srp_callback_parm.login); if (srp_callback_parm.user) BIO_printf(bio_s_out, "LOOKUP done %s\n", srp_callback_parm.user->info); @@ -2881,6 +2897,22 @@ static int www_body(char *hostname, int s, int stype, unsigned char *context) goto err; } else { BIO_printf(bio_s_out, "read R BLOCK\n"); +#ifndef OPENSSL_NO_SRP + if (BIO_should_io_special(io) + && BIO_get_retry_reason(io) == BIO_RR_SSL_X509_LOOKUP) { + BIO_printf(bio_s_out, "LOOKUP renego during read\n"); + SRP_user_pwd_free(srp_callback_parm.user); + srp_callback_parm.user = + SRP_VBASE_get1_by_user(srp_callback_parm.vb, + srp_callback_parm.login); + if (srp_callback_parm.user) + BIO_printf(bio_s_out, "LOOKUP done %s\n", + srp_callback_parm.user->info); + else + BIO_printf(bio_s_out, "LOOKUP not successful\n"); + continue; + } +#endif #if defined(OPENSSL_SYS_NETWARE) delay(1000); #elif !defined(OPENSSL_SYS_MSDOS) && !defined(__DJGPP__) @@ -3211,6 +3243,22 @@ static int rev_body(char *hostname, int s, int stype, unsigned char *context) ERR_print_errors(bio_err); goto end; } +#ifndef OPENSSL_NO_SRP + if (BIO_should_io_special(io) + && BIO_get_retry_reason(io) == BIO_RR_SSL_X509_LOOKUP) { + BIO_printf(bio_s_out, "LOOKUP renego during accept\n"); + SRP_user_pwd_free(srp_callback_parm.user); + srp_callback_parm.user = + SRP_VBASE_get1_by_user(srp_callback_parm.vb, + srp_callback_parm.login); + if (srp_callback_parm.user) + BIO_printf(bio_s_out, "LOOKUP done %s\n", + srp_callback_parm.user->info); + else + BIO_printf(bio_s_out, "LOOKUP not successful\n"); + continue; + } +#endif } BIO_printf(bio_err, "CONNECTION ESTABLISHED\n"); print_ssl_summary(bio_err, con); @@ -3224,6 +3272,22 @@ static int rev_body(char *hostname, int s, int stype, unsigned char *context) goto err; } else { BIO_printf(bio_s_out, "read R BLOCK\n"); +#ifndef OPENSSL_NO_SRP + if (BIO_should_io_special(io) + && BIO_get_retry_reason(io) == BIO_RR_SSL_X509_LOOKUP) { + BIO_printf(bio_s_out, "LOOKUP renego during read\n"); + SRP_user_pwd_free(srp_callback_parm.user); + srp_callback_parm.user = + SRP_VBASE_get1_by_user(srp_callback_parm.vb, + srp_callback_parm.login); + if (srp_callback_parm.user) + BIO_printf(bio_s_out, "LOOKUP done %s\n", + srp_callback_parm.user->info); + else + BIO_printf(bio_s_out, "LOOKUP not successful\n"); + continue; + } +#endif #if defined(OPENSSL_SYS_NETWARE) delay(1000); #elif !defined(OPENSSL_SYS_MSDOS) && !defined(__DJGPP__) diff --git a/deps/openssl/openssl/apps/speed.c b/deps/openssl/openssl/apps/speed.c index 3697b71ec18b45..95adcc19cc15f1 100644 --- a/deps/openssl/openssl/apps/speed.c +++ b/deps/openssl/openssl/apps/speed.c @@ -1,4 +1,4 @@ -/* apps/speed.c -*- mode:C; c-file-style: "eay" -*- */ +/* apps/speed.c */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * diff --git a/deps/openssl/openssl/apps/x509.c b/deps/openssl/openssl/apps/x509.c index 864a60dda2e7ff..7c215bced00106 100644 --- a/deps/openssl/openssl/apps/x509.c +++ b/deps/openssl/openssl/apps/x509.c @@ -1226,12 +1226,7 @@ static int sign(X509 *x, EVP_PKEY *pkey, int days, int clrext, if (X509_gmtime_adj(X509_get_notBefore(x), 0) == NULL) goto err; - /* Lets just make it 12:00am GMT, Jan 1 1970 */ - /* memcpy(x->cert_info->validity->notBefore,"700101120000Z",13); */ - /* 28 days to be certified */ - - if (X509_gmtime_adj(X509_get_notAfter(x), (long)60 * 60 * 24 * days) == - NULL) + if (X509_time_adj_ex(X509_get_notAfter(x), days, 0, NULL) == NULL) goto err; if (!X509_set_pubkey(x, pkey)) diff --git a/deps/openssl/openssl/appveyor.yml b/deps/openssl/openssl/appveyor.yml new file mode 100644 index 00000000000000..8695359488d8dd --- /dev/null +++ b/deps/openssl/openssl/appveyor.yml @@ -0,0 +1,60 @@ +platform: + - x86 + - x64 + +environment: + matrix: + - VSVER: 9 + - VSVER: 10 + - VSVER: 11 + - VSVER: 12 + - VSVER: 14 + +configuration: + - plain + - shared + +matrix: + allow_failures: + - platform: x64 + VSVER: 9 + - platform: x64 + VSVER: 10 + - platform: x64 + VSVER: 11 + +before_build: + - ps: >- + If ($env:Platform -Match "x86") { + $env:VCVARS_PLATFORM="x86" + $env:TARGET="VC-WIN32" + $env:DO="do_ms" + } Else { + $env:VCVARS_PLATFORM="amd64" + $env:TARGET="VC-WIN64A" + $env:DO="do_win64a" + } + - ps: >- + If ($env:Configuration -Like "*shared*") { + $env:MAK="ntdll.mak" + } Else { + $env:MAK="nt.mak" + } + - ps: $env:VSCOMNTOOLS=(Get-Content ("env:VS" + "$env:VSVER" + "0COMNTOOLS")) + - call "%VSCOMNTOOLS%\..\..\VC\vcvarsall.bat" %VCVARS_PLATFORM% + - perl Configure %TARGET% no-asm + - call ms\%DO% + +build_script: + - nmake /f ms\%MAK% + +test_script: + - nmake /f ms\%MAK% test + +notifications: + - provider: Email + to: + - openssl-commits@openssl.org + on_build_success: false + on_build_failure: true + on_build_status_changed: true diff --git a/deps/openssl/openssl/config b/deps/openssl/openssl/config index 77f730f093e61b..bba370c4f3f1cb 100755 --- a/deps/openssl/openssl/config +++ b/deps/openssl/openssl/config @@ -852,7 +852,8 @@ case "$GUESSOS" in # *-dgux) OUT="dgux" ;; mips-sony-newsos4) OUT="newsos4-gcc" ;; *-*-cygwin_pre1.3) OUT="Cygwin-pre1.3" ;; - *-*-cygwin) OUT="Cygwin" ;; + i[3456]86-*-cygwin) OUT="Cygwin" ;; + *-*-cygwin) OUT="Cygwin-${MACHINE}" ;; t3e-cray-unicosmk) OUT="cray-t3e" ;; j90-cray-unicos) OUT="cray-j90" ;; nsr-tandem-nsk) OUT="tandem-c89" ;; diff --git a/deps/openssl/openssl/crypto/aes/aes.h b/deps/openssl/openssl/crypto/aes/aes.h index 87bf60f6f2bfbe..faa66c49148f50 100644 --- a/deps/openssl/openssl/crypto/aes/aes.h +++ b/deps/openssl/openssl/crypto/aes/aes.h @@ -1,4 +1,4 @@ -/* crypto/aes/aes.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes.h */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/aes/aes_cbc.c b/deps/openssl/openssl/crypto/aes/aes_cbc.c index e39231f17cb8e4..805d0e260a6f28 100644 --- a/deps/openssl/openssl/crypto/aes/aes_cbc.c +++ b/deps/openssl/openssl/crypto/aes/aes_cbc.c @@ -1,4 +1,4 @@ -/* crypto/aes/aes_cbc.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_cbc.c */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/aes/aes_cfb.c b/deps/openssl/openssl/crypto/aes/aes_cfb.c index 1c79ce2dbaa17a..1225000963ea09 100644 --- a/deps/openssl/openssl/crypto/aes/aes_cfb.c +++ b/deps/openssl/openssl/crypto/aes/aes_cfb.c @@ -1,4 +1,4 @@ -/* crypto/aes/aes_cfb.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_cfb.c */ /* ==================================================================== * Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/aes/aes_core.c b/deps/openssl/openssl/crypto/aes/aes_core.c index 2ddb0860d78aca..7019b5d7aa3a5d 100644 --- a/deps/openssl/openssl/crypto/aes/aes_core.c +++ b/deps/openssl/openssl/crypto/aes/aes_core.c @@ -1,4 +1,4 @@ -/* crypto/aes/aes_core.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_core.c */ /** * rijndael-alg-fst.c * diff --git a/deps/openssl/openssl/crypto/aes/aes_ctr.c b/deps/openssl/openssl/crypto/aes/aes_ctr.c index 3ee382299881c1..9e760c4b12adbb 100644 --- a/deps/openssl/openssl/crypto/aes/aes_ctr.c +++ b/deps/openssl/openssl/crypto/aes/aes_ctr.c @@ -1,4 +1,4 @@ -/* crypto/aes/aes_ctr.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_ctr.c */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/aes/aes_ecb.c b/deps/openssl/openssl/crypto/aes/aes_ecb.c index 2e0d20ca224e95..52151a5c70f446 100644 --- a/deps/openssl/openssl/crypto/aes/aes_ecb.c +++ b/deps/openssl/openssl/crypto/aes/aes_ecb.c @@ -1,4 +1,4 @@ -/* crypto/aes/aes_ecb.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_ecb.c */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/aes/aes_ige.c b/deps/openssl/openssl/crypto/aes/aes_ige.c index cf31c9bba44ade..8f2b7706472a04 100644 --- a/deps/openssl/openssl/crypto/aes/aes_ige.c +++ b/deps/openssl/openssl/crypto/aes/aes_ige.c @@ -1,4 +1,4 @@ -/* crypto/aes/aes_ige.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_ige.c */ /* ==================================================================== * Copyright (c) 2006 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/aes/aes_locl.h b/deps/openssl/openssl/crypto/aes/aes_locl.h index fabfd02ac095e0..7acd74ec1603a7 100644 --- a/deps/openssl/openssl/crypto/aes/aes_locl.h +++ b/deps/openssl/openssl/crypto/aes/aes_locl.h @@ -1,4 +1,4 @@ -/* crypto/aes/aes.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes.h */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/aes/aes_misc.c b/deps/openssl/openssl/crypto/aes/aes_misc.c index ab948ad85eb462..fafad4d6f57a36 100644 --- a/deps/openssl/openssl/crypto/aes/aes_misc.c +++ b/deps/openssl/openssl/crypto/aes/aes_misc.c @@ -1,4 +1,4 @@ -/* crypto/aes/aes_misc.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_misc.c */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/aes/aes_ofb.c b/deps/openssl/openssl/crypto/aes/aes_ofb.c index e6153f99ba70e1..64a08caaec6de5 100644 --- a/deps/openssl/openssl/crypto/aes/aes_ofb.c +++ b/deps/openssl/openssl/crypto/aes/aes_ofb.c @@ -1,4 +1,4 @@ -/* crypto/aes/aes_ofb.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_ofb.c */ /* ==================================================================== * Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/aes/aes_x86core.c b/deps/openssl/openssl/crypto/aes/aes_x86core.c index c869ed7198520d..b5dd6976772ac4 100644 --- a/deps/openssl/openssl/crypto/aes/aes_x86core.c +++ b/deps/openssl/openssl/crypto/aes/aes_x86core.c @@ -1,4 +1,4 @@ -/* crypto/aes/aes_core.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes_core.c */ /** * rijndael-alg-fst.c * diff --git a/deps/openssl/openssl/crypto/aes/asm/aes-586.pl b/deps/openssl/openssl/crypto/aes/asm/aes-586.pl index 451d0e0ed1e214..60286ecb9645db 100755 --- a/deps/openssl/openssl/crypto/aes/asm/aes-586.pl +++ b/deps/openssl/openssl/crypto/aes/asm/aes-586.pl @@ -45,7 +45,7 @@ # the undertaken effort was that it appeared that in tight IA-32 # register window little-endian flavor could achieve slightly higher # Instruction Level Parallelism, and it indeed resulted in up to 15% -# better performance on most recent �-archs... +# better performance on most recent µ-archs... # # Third version adds AES_cbc_encrypt implementation, which resulted in # up to 40% performance imrovement of CBC benchmark results. 40% was @@ -224,7 +224,7 @@ $speed_limit=512; # chunks smaller than $speed_limit are # processed with compact routine in CBC mode $small_footprint=1; # $small_footprint=1 code is ~5% slower [on - # recent �-archs], but ~5 times smaller! + # recent µ-archs], but ~5 times smaller! # I favor compact code to minimize cache # contention and in hope to "collect" 5% back # in real-life applications... @@ -565,7 +565,7 @@ () # Performance is not actually extraordinary in comparison to pure # x86 code. In particular encrypt performance is virtually the same. # Decrypt performance on the other hand is 15-20% better on newer -# �-archs [but we're thankful for *any* improvement here], and ~50% +# µ-archs [but we're thankful for *any* improvement here], and ~50% # better on PIII:-) And additionally on the pros side this code # eliminates redundant references to stack and thus relieves/ # minimizes the pressure on the memory bus. diff --git a/deps/openssl/openssl/crypto/aes/asm/aesni-mb-x86_64.pl b/deps/openssl/openssl/crypto/aes/asm/aesni-mb-x86_64.pl index 33b1aed3c0b4c3..d7ad7882c4ee97 100644 --- a/deps/openssl/openssl/crypto/aes/asm/aesni-mb-x86_64.pl +++ b/deps/openssl/openssl/crypto/aes/asm/aesni-mb-x86_64.pl @@ -63,7 +63,7 @@ $avx = ($1>=10) + ($1>=11); } -if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) { +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([3-9]\.[0-9]+)/) { $avx = ($2>=3.0) + ($2>3.0); } diff --git a/deps/openssl/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl b/deps/openssl/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl index 97992adca7c348..8c84260856e164 100644 --- a/deps/openssl/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl +++ b/deps/openssl/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl @@ -94,7 +94,7 @@ $avx=1 if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) && `ml64 2>&1` =~ /Version ([0-9]+)\./ && $1>=10); -$avx=1 if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/ && $2>=3.0); +$avx=1 if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([3-9]\.[0-9]+)/ && $2>=3.0); $shaext=1; ### set to zero if compiling for 1.0.1 diff --git a/deps/openssl/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl b/deps/openssl/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl index 19b0433b3b1bdb..72f44ecf625345 100644 --- a/deps/openssl/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl +++ b/deps/openssl/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl @@ -59,7 +59,7 @@ $avx = ($1>=10) + ($1>=12); } -if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) { +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([3-9]\.[0-9]+)/) { $avx = ($2>=3.0) + ($2>3.0); } @@ -139,11 +139,8 @@ je ${func}_avx2 ___ $code.=<<___; - and \$`1<<30`,%eax # mask "Intel CPU" bit - and \$`1<<28|1<<9`,%r10d # mask AVX+SSSE3 bits - or %eax,%r10d - cmp \$`1<<28|1<<9|1<<30`,%r10d - je ${func}_avx + and \$`1<<28`,%r10d # check for AVX + jnz ${func}_avx ud2 ___ } diff --git a/deps/openssl/openssl/crypto/aes/asm/aesni-x86.pl b/deps/openssl/openssl/crypto/aes/asm/aesni-x86.pl index f67df8cf13da3e..9b2e37aafb1a05 100644 --- a/deps/openssl/openssl/crypto/aes/asm/aesni-x86.pl +++ b/deps/openssl/openssl/crypto/aes/asm/aesni-x86.pl @@ -88,7 +88,7 @@ $inout4="xmm6"; $in0="xmm6"; $inout5="xmm7"; $ivec="xmm7"; -# AESNI extenstion +# AESNI extension sub aeskeygenassist { my($dst,$src,$imm)=@_; if ("$dst:$src" =~ /xmm([0-7]):xmm([0-7])/) diff --git a/deps/openssl/openssl/crypto/aes/asm/vpaes-ppc.pl b/deps/openssl/openssl/crypto/aes/asm/vpaes-ppc.pl index 7fda60ed9e4d59..1759ae9dcff272 100644 --- a/deps/openssl/openssl/crypto/aes/asm/vpaes-ppc.pl +++ b/deps/openssl/openssl/crypto/aes/asm/vpaes-ppc.pl @@ -337,24 +337,27 @@ addi $inp, $inp, 15 # 15 is not a typo ?lvsr $outperm, 0, $out ?lvsl $keyperm, 0, $key # prepare for unaligned access - vnor $outmask, v7, v7 # 0xff..ff lvx $inptail, 0, $inp # redundant in aligned case - ?vperm $outmask, v7, $outmask, $outperm - lvx $outhead, 0, $out ?vperm v0, v0, $inptail, $inpperm bl _vpaes_encrypt_core + andi. r8, $out, 15 + li r9, 16 + beq Lenc_out_aligned + vperm v0, v0, v0, $outperm # rotate right/left - vsel v1, $outhead, v0, $outmask - vmr $outhead, v0 - stvx v1, 0, $out - addi $out, $out, 15 # 15 is not a typo - ######## + mtctr r9 +Lenc_out_unaligned: + stvebx v0, 0, $out + addi $out, $out, 1 + bdnz Lenc_out_unaligned + b Lenc_done - lvx v1, 0, $out # redundant in aligned case - vsel v1, $outhead, v1, $outmask - stvx v1, 0, $out +.align 4 +Lenc_out_aligned: + stvx v0, 0, $out +Lenc_done: li r10,`15+6*$SIZE_T` li r11,`31+6*$SIZE_T` @@ -566,24 +569,27 @@ addi $inp, $inp, 15 # 15 is not a typo ?lvsr $outperm, 0, $out ?lvsl $keyperm, 0, $key - vnor $outmask, v7, v7 # 0xff..ff lvx $inptail, 0, $inp # redundant in aligned case - ?vperm $outmask, v7, $outmask, $outperm - lvx $outhead, 0, $out ?vperm v0, v0, $inptail, $inpperm bl _vpaes_decrypt_core + andi. r8, $out, 15 + li r9, 16 + beq Ldec_out_aligned + vperm v0, v0, v0, $outperm # rotate right/left - vsel v1, $outhead, v0, $outmask - vmr $outhead, v0 - stvx v1, 0, $out - addi $out, $out, 15 # 15 is not a typo - ######## + mtctr r9 +Ldec_out_unaligned: + stvebx v0, 0, $out + addi $out, $out, 1 + bdnz Ldec_out_unaligned + b Ldec_done - lvx v1, 0, $out # redundant in aligned case - vsel v1, $outhead, v1, $outmask - stvx v1, 0, $out +.align 4 +Ldec_out_aligned: + stvx v0, 0, $out +Ldec_done: li r10,`15+6*$SIZE_T` li r11,`31+6*$SIZE_T` @@ -658,11 +664,11 @@ $PUSH r0, `$FRAME+$SIZE_T*2+$LRSAVE`($sp) and r30, r5, r9 # copy length&-16 + andi. r9, $out, 15 # is $out aligned? mr r5, r6 # copy pointer to key mr r31, r7 # copy pointer to iv - blt Lcbc_abort - cmpwi r8, 0 # test direction li r6, -1 + mcrf cr1, cr0 # put aside $out alignment flag mr r7, r12 # copy vrsave mtspr 256, r6 # preserve all AltiVec registers @@ -672,6 +678,7 @@ lvx v25, r9, r31 ?vperm v24, v24, v25, $inpperm + cmpwi r8, 0 # test direction neg r8, $inp # prepare for unaligned access vxor v7, v7, v7 ?lvsl $keyperm, 0, $key @@ -681,13 +688,37 @@ lvx $inptail, 0, $inp ?vperm $outmask, v7, $outmask, $outperm addi $inp, $inp, 15 # 15 is not a typo - lvx $outhead, 0, $out beq Lcbc_decrypt bl _vpaes_encrypt_preheat li r0, 16 + beq cr1, Lcbc_enc_loop # $out is aligned + + vmr v0, $inptail + lvx $inptail, 0, $inp + addi $inp, $inp, 16 + ?vperm v0, v0, $inptail, $inpperm + vxor v0, v0, v24 # ^= iv + + bl _vpaes_encrypt_core + + andi. r8, $out, 15 + vmr v24, v0 # put aside iv + sub r9, $out, r8 + vperm $outhead, v0, v0, $outperm # rotate right/left + +Lcbc_enc_head: + stvebx $outhead, r8, r9 + cmpwi r8, 15 + addi r8, r8, 1 + bne Lcbc_enc_head + + sub. r30, r30, r0 # len -= 16 + addi $out, $out, 16 + beq Lcbc_unaligned_done + Lcbc_enc_loop: vmr v0, $inptail lvx $inptail, 0, $inp @@ -713,6 +744,32 @@ bl _vpaes_decrypt_preheat li r0, 16 + beq cr1, Lcbc_dec_loop # $out is aligned + + vmr v0, $inptail + lvx $inptail, 0, $inp + addi $inp, $inp, 16 + ?vperm v0, v0, $inptail, $inpperm + vmr v25, v0 # put aside input + + bl _vpaes_decrypt_core + + andi. r8, $out, 15 + vxor v0, v0, v24 # ^= iv + vmr v24, v25 + sub r9, $out, r8 + vperm $outhead, v0, v0, $outperm # rotate right/left + +Lcbc_dec_head: + stvebx $outhead, r8, r9 + cmpwi r8, 15 + addi r8, r8, 1 + bne Lcbc_dec_head + + sub. r30, r30, r0 # len -= 16 + addi $out, $out, 16 + beq Lcbc_unaligned_done + Lcbc_dec_loop: vmr v0, $inptail lvx $inptail, 0, $inp @@ -733,23 +790,29 @@ bne Lcbc_dec_loop Lcbc_done: - addi $out, $out, -1 - lvx v1, 0, $out # redundant in aligned case - vsel v1, $outhead, v1, $outmask - stvx v1, 0, $out - + beq cr1, Lcbc_write_iv # $out is aligned + +Lcbc_unaligned_done: + andi. r8, $out, 15 + sub $out, $out, r8 + li r9, 0 +Lcbc_tail: + stvebx $outhead, r9, $out + addi r9, r9, 1 + cmpw r9, r8 + bne Lcbc_tail + +Lcbc_write_iv: neg r8, r31 # write [potentially unaligned] iv + li r10, 4 ?lvsl $outperm, 0, r8 - li r6, 15 - vnor $outmask, v7, v7 # 0xff..ff - ?vperm $outmask, v7, $outmask, $outperm - lvx $outhead, 0, r31 + li r11, 8 + li r12, 12 vperm v24, v24, v24, $outperm # rotate right/left - vsel v0, $outhead, v24, $outmask - lvx v1, r6, r31 - stvx v0, 0, r31 - vsel v1, v24, v1, $outmask - stvx v1, r6, r31 + stvewx v24, 0, r31 # ivp is at least 32-bit aligned + stvewx v24, r10, r31 + stvewx v24, r11, r31 + stvewx v24, r12, r31 mtspr 256, r7 # restore vrsave li r10,`15+6*$SIZE_T` @@ -872,18 +935,21 @@ # encrypting, output zeroth round key after transform li r8, 0x30 # mov \$0x30,%r8d - addi r10, r12, 0x80 # lea .Lk_sr(%rip),%r10 + li r9, 4 + li r10, 8 + li r11, 12 ?lvsr $outperm, 0, $out # prepare for unaligned access vnor $outmask, v9, v9 # 0xff..ff - lvx $outhead, 0, $out ?vperm $outmask, v9, $outmask, $outperm #stvx v0, 0, $out # vmovdqu %xmm0, (%rdx) - vperm v1, v0, v0, $outperm # rotate right/left - vsel v2, $outhead, v1, $outmask - vmr $outhead, v1 - stvx v2, 0, $out + vperm $outhead, v0, v0, $outperm # rotate right/left + stvewx $outhead, 0, $out # some are superfluous + stvewx $outhead, r9, $out + stvewx $outhead, r10, $out + addi r10, r12, 0x80 # lea .Lk_sr(%rip),%r10 + stvewx $outhead, r11, $out b Lschedule_go Lschedule_am_decrypting: @@ -893,20 +959,24 @@ addi r10, r12, 0x80 # lea .Lk_sr(%rip),%r10 # decrypting, output zeroth round key after shiftrows lvx v1, r8, r10 # vmovdqa (%r8,%r10), %xmm1 + li r9, 4 + li r10, 8 + li r11, 12 vperm v4, v3, v3, v1 # vpshufb %xmm1, %xmm3, %xmm3 neg r0, $out # prepare for unaligned access ?lvsl $outperm, 0, r0 - addi $out, $out, 15 # 15 is not typo vnor $outmask, v9, v9 # 0xff..ff - lvx $outhead, 0, $out ?vperm $outmask, $outmask, v9, $outperm #stvx v4, 0, $out # vmovdqu %xmm3, (%rdx) - vperm v4, v4, v4, $outperm # rotate right/left - vsel v2, $outhead, v4, $outmask - vmr $outhead, v4 - stvx v2, 0, $out + vperm $outhead, v4, v4, $outperm # rotate right/left + stvewx $outhead, 0, $out # some are superfluous + stvewx $outhead, r9, $out + stvewx $outhead, r10, $out + addi r10, r12, 0x80 # lea .Lk_sr(%rip),%r10 + stvewx $outhead, r11, $out + addi $out, $out, 15 # 15 is not typo xori r8, r8, 0x30 # xor \$0x30, %r8 Lschedule_go: @@ -1038,14 +1108,15 @@ #stvx v0, r0, $out # vmovdqu %xmm0, (%rdx) # save last key vperm v0, v0, v0, $outperm # rotate right/left + li r10, 4 vsel v2, $outhead, v0, $outmask - vmr $outhead, v0 + li r11, 8 stvx v2, 0, $out - - addi $out, $out, 15 # 15 is not typo - lvx v1, 0, $out # redundant in aligned case - vsel v1, $outhead, v1, $outmask - stvx v1, 0, $out + li r12, 12 + stvewx v0, 0, $out # some (or all) are redundant + stvewx v0, r10, $out + stvewx v0, r11, $out + stvewx v0, r12, $out b Lschedule_mangle_done .align 4 @@ -1057,15 +1128,18 @@ bl _vpaes_schedule_transform # output transform #stvx v0, r0, $out # vmovdqu %xmm0, (%rdx) # save last key + addi r9, $out, -15 # -15 is not typo vperm v0, v0, v0, $outperm # rotate right/left + li r10, 4 vsel v2, $outhead, v0, $outmask - vmr $outhead, v0 + li r11, 8 stvx v2, 0, $out + li r12, 12 + stvewx v0, 0, r9 # some (or all) are redundant + stvewx v0, r10, r9 + stvewx v0, r11, r9 + stvewx v0, r12, r9 - addi $out, $out, -15 # -15 is not typo - lvx v1, 0, $out # redundant in aligned case - vsel v1, $outhead, v1, $outmask - stvx v1, 0, $out Lschedule_mangle_done: mtlr r7 diff --git a/deps/openssl/openssl/crypto/asn1/asn1_par.c b/deps/openssl/openssl/crypto/asn1/asn1_par.c index a5d2da10bb72df..0ca985a2be1e70 100644 --- a/deps/openssl/openssl/crypto/asn1/asn1_par.c +++ b/deps/openssl/openssl/crypto/asn1/asn1_par.c @@ -62,6 +62,10 @@ #include #include +#ifndef ASN1_PARSE_MAXDEPTH +#define ASN1_PARSE_MAXDEPTH 128 +#endif + static int asn1_print_info(BIO *bp, int tag, int xclass, int constructed, int indent); static int asn1_parse2(BIO *bp, const unsigned char **pp, long length, @@ -128,6 +132,12 @@ static int asn1_parse2(BIO *bp, const unsigned char **pp, long length, #else dump_indent = 6; /* Because we know BIO_dump_indent() */ #endif + + if (depth > ASN1_PARSE_MAXDEPTH) { + BIO_puts(bp, "BAD RECURSION DEPTH\n"); + return 0; + } + p = *pp; tot = p + length; op = p - 1; diff --git a/deps/openssl/openssl/crypto/asn1/d2i_pr.c b/deps/openssl/openssl/crypto/asn1/d2i_pr.c index c96da091d39c44..d21829af192f0c 100644 --- a/deps/openssl/openssl/crypto/asn1/d2i_pr.c +++ b/deps/openssl/openssl/crypto/asn1/d2i_pr.c @@ -72,6 +72,7 @@ EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp, long length) { EVP_PKEY *ret; + const unsigned char *p = *pp; if ((a == NULL) || (*a == NULL)) { if ((ret = EVP_PKEY_new()) == NULL) { @@ -94,21 +95,23 @@ EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp, } if (!ret->ameth->old_priv_decode || - !ret->ameth->old_priv_decode(ret, pp, length)) { + !ret->ameth->old_priv_decode(ret, &p, length)) { if (ret->ameth->priv_decode) { PKCS8_PRIV_KEY_INFO *p8 = NULL; - p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, pp, length); + p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, length); if (!p8) goto err; EVP_PKEY_free(ret); ret = EVP_PKCS82PKEY(p8); PKCS8_PRIV_KEY_INFO_free(p8); - + if (ret == NULL) + goto err; } else { ASN1err(ASN1_F_D2I_PRIVATEKEY, ERR_R_ASN1_LIB); goto err; } } + *pp = p; if (a != NULL) (*a) = ret; return (ret); @@ -136,6 +139,7 @@ EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp, * input is surrounded by an ASN1 SEQUENCE. */ inkey = d2i_ASN1_SEQUENCE_ANY(NULL, &p, length); + p = *pp; /* * Since we only need to discern "traditional format" RSA and DSA keys we * can just count the elements. @@ -146,7 +150,7 @@ EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp, keytype = EVP_PKEY_EC; else if (sk_ASN1_TYPE_num(inkey) == 3) { /* This seems to be PKCS8, not * traditional format */ - PKCS8_PRIV_KEY_INFO *p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, pp, length); + PKCS8_PRIV_KEY_INFO *p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, length); EVP_PKEY *ret; sk_ASN1_TYPE_pop_free(inkey, ASN1_TYPE_free); @@ -157,6 +161,9 @@ EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp, } ret = EVP_PKCS82PKEY(p8); PKCS8_PRIV_KEY_INFO_free(p8); + if (ret == NULL) + return NULL; + *pp = p; if (a) { *a = ret; } diff --git a/deps/openssl/openssl/crypto/asn1/tasn_dec.c b/deps/openssl/openssl/crypto/asn1/tasn_dec.c index 7fd336a402268b..5a507967c894f2 100644 --- a/deps/openssl/openssl/crypto/asn1/tasn_dec.c +++ b/deps/openssl/openssl/crypto/asn1/tasn_dec.c @@ -180,6 +180,8 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, int otag; int ret = 0; ASN1_VALUE **pchptr, *ptmpval; + int combine = aclass & ASN1_TFLG_COMBINE; + aclass &= ~ASN1_TFLG_COMBINE; if (!pval) return 0; if (aux && aux->asn1_cb) @@ -350,9 +352,9 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, } asn1_set_choice_selector(pval, i, it); - *in = p; if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL)) goto auxerr; + *in = p; return 1; case ASN1_ITYPE_NDEF_SEQUENCE: @@ -489,9 +491,9 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, /* Save encoding */ if (!asn1_enc_save(pval, *in, p - *in, it)) goto auxerr; - *in = p; if (asn1_cb && !asn1_cb(ASN1_OP_D2I_POST, pval, it, NULL)) goto auxerr; + *in = p; return 1; default: @@ -500,7 +502,8 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, auxerr: ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, ASN1_R_AUX_ERROR); err: - ASN1_item_ex_free(pval, it); + if (combine == 0) + ASN1_item_ex_free(pval, it); if (errtt) ERR_add_error_data(4, "Field=", errtt->field_name, ", Type=", it->sname); @@ -689,7 +692,7 @@ static int asn1_template_noexp_d2i(ASN1_VALUE **val, } else { /* Nothing special */ ret = ASN1_item_ex_d2i(val, &p, len, ASN1_ITEM_ptr(tt->item), - -1, 0, opt, ctx); + -1, tt->flags & ASN1_TFLG_COMBINE, opt, ctx); if (!ret) { ASN1err(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I, ERR_R_NESTED_ASN1_ERROR); goto err; @@ -714,7 +717,7 @@ static int asn1_d2i_ex_primitive(ASN1_VALUE **pval, long plen; char cst, inf, free_cont = 0; const unsigned char *p; - BUF_MEM buf; + BUF_MEM buf = { 0, NULL, 0 }; const unsigned char *cont = NULL; long len; if (!pval) { @@ -790,7 +793,6 @@ static int asn1_d2i_ex_primitive(ASN1_VALUE **pval, } else { len = p - cont + plen; p += plen; - buf.data = NULL; } } else if (cst) { if (utype == V_ASN1_NULL || utype == V_ASN1_BOOLEAN @@ -799,9 +801,9 @@ static int asn1_d2i_ex_primitive(ASN1_VALUE **pval, ASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ASN1_R_TYPE_NOT_PRIMITIVE); return 0; } - buf.length = 0; - buf.max = 0; - buf.data = NULL; + + /* Free any returned 'buf' content */ + free_cont = 1; /* * Should really check the internal tags are correct but some things * may get this wrong. The relevant specs say that constructed string @@ -809,18 +811,16 @@ static int asn1_d2i_ex_primitive(ASN1_VALUE **pval, * So instead just check for UNIVERSAL class and ignore the tag. */ if (!asn1_collect(&buf, &p, plen, inf, -1, V_ASN1_UNIVERSAL, 0)) { - free_cont = 1; goto err; } len = buf.length; /* Append a final null to string */ if (!BUF_MEM_grow_clean(&buf, len + 1)) { ASN1err(ASN1_F_ASN1_D2I_EX_PRIMITIVE, ERR_R_MALLOC_FAILURE); - return 0; + goto err; } buf.data[len] = 0; cont = (const unsigned char *)buf.data; - free_cont = 1; } else { cont = p; len = plen; @@ -828,6 +828,7 @@ static int asn1_d2i_ex_primitive(ASN1_VALUE **pval, } /* We now have content length and type: translate into a structure */ + /* asn1_ex_c2i may reuse allocated buffer, and so sets free_cont to 0 */ if (!asn1_ex_c2i(pval, cont, len, utype, &free_cont, it)) goto err; diff --git a/deps/openssl/openssl/crypto/asn1/x_bignum.c b/deps/openssl/openssl/crypto/asn1/x_bignum.c index a5a403c26e10ee..eaf046639d6a20 100644 --- a/deps/openssl/openssl/crypto/asn1/x_bignum.c +++ b/deps/openssl/openssl/crypto/asn1/x_bignum.c @@ -141,8 +141,9 @@ static int bn_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it) { BIGNUM *bn; - if (!*pval) - bn_new(pval, it); + + if (*pval == NULL && !bn_new(pval, it)) + return 0; bn = (BIGNUM *)*pval; if (!BN_bin2bn(cont, len, bn)) { bn_free(pval, it); diff --git a/deps/openssl/openssl/crypto/asn1/x_pubkey.c b/deps/openssl/openssl/crypto/asn1/x_pubkey.c index 4b682018c2de40..6c57a7971c9da2 100644 --- a/deps/openssl/openssl/crypto/asn1/x_pubkey.c +++ b/deps/openssl/openssl/crypto/asn1/x_pubkey.c @@ -188,13 +188,16 @@ EVP_PKEY *d2i_PUBKEY(EVP_PKEY **a, const unsigned char **pp, long length) { X509_PUBKEY *xpk; EVP_PKEY *pktmp; - xpk = d2i_X509_PUBKEY(NULL, pp, length); + const unsigned char *q; + q = *pp; + xpk = d2i_X509_PUBKEY(NULL, &q, length); if (!xpk) return NULL; pktmp = X509_PUBKEY_get(xpk); X509_PUBKEY_free(xpk); if (!pktmp) return NULL; + *pp = q; if (a) { EVP_PKEY_free(*a); *a = pktmp; diff --git a/deps/openssl/openssl/crypto/asn1/x_x509.c b/deps/openssl/openssl/crypto/asn1/x_x509.c index 5f266a26b4c28e..e2cac836943d72 100644 --- a/deps/openssl/openssl/crypto/asn1/x_x509.c +++ b/deps/openssl/openssl/crypto/asn1/x_x509.c @@ -180,16 +180,15 @@ X509 *d2i_X509_AUX(X509 **a, const unsigned char **pp, long length) if (!a || *a == NULL) { freeret = 1; } - ret = d2i_X509(a, pp, length); + ret = d2i_X509(a, &q, length); /* If certificate unreadable then forget it */ if (!ret) return NULL; /* update length */ - length -= *pp - q; - if (!length) - return ret; - if (!d2i_X509_CERT_AUX(&ret->aux, pp, length)) + length -= q - *pp; + if (length > 0 && !d2i_X509_CERT_AUX(&ret->aux, &q, length)) goto err; + *pp = q; return ret; err: if (freeret) { diff --git a/deps/openssl/openssl/crypto/asn1/x_x509a.c b/deps/openssl/openssl/crypto/asn1/x_x509a.c index 76bbc1370ff7fb..ad93592a714a2a 100644 --- a/deps/openssl/openssl/crypto/asn1/x_x509a.c +++ b/deps/openssl/openssl/crypto/asn1/x_x509a.c @@ -163,10 +163,13 @@ int X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj) if (!(objtmp = OBJ_dup(obj))) return 0; if (!(aux = aux_get(x))) - return 0; + goto err; if (!aux->reject && !(aux->reject = sk_ASN1_OBJECT_new_null())) - return 0; + goto err; return sk_ASN1_OBJECT_push(aux->reject, objtmp); + err: + ASN1_OBJECT_free(objtmp); + return 0; } void X509_trust_clear(X509 *x) diff --git a/deps/openssl/openssl/crypto/bio/b_dump.c b/deps/openssl/openssl/crypto/bio/b_dump.c index ed8e521449a445..ccf0e287c4e828 100644 --- a/deps/openssl/openssl/crypto/bio/b_dump.c +++ b/deps/openssl/openssl/crypto/bio/b_dump.c @@ -104,7 +104,6 @@ int BIO_dump_indent_cb(int (*cb) (const void *data, size_t len, void *u), if ((rows * dump_width) < len) rows++; for (i = 0; i < rows; i++) { - buf[0] = '\0'; /* start with empty string */ BUF_strlcpy(buf, str, sizeof buf); BIO_snprintf(tmp, sizeof tmp, "%04x - ", i * dump_width); BUF_strlcat(buf, tmp, sizeof buf); diff --git a/deps/openssl/openssl/crypto/bio/b_print.c b/deps/openssl/openssl/crypto/bio/b_print.c index 7c81e25d482cf1..90248fa2aabac7 100644 --- a/deps/openssl/openssl/crypto/bio/b_print.c +++ b/deps/openssl/openssl/crypto/bio/b_print.c @@ -125,16 +125,16 @@ # define LLONG long #endif -static void fmtstr(char **, char **, size_t *, size_t *, - const char *, int, int, int); -static void fmtint(char **, char **, size_t *, size_t *, - LLONG, int, int, int, int); -static void fmtfp(char **, char **, size_t *, size_t *, - LDOUBLE, int, int, int); -static void doapr_outch(char **, char **, size_t *, size_t *, int); -static void _dopr(char **sbuffer, char **buffer, - size_t *maxlen, size_t *retlen, int *truncated, - const char *format, va_list args); +static int fmtstr(char **, char **, size_t *, size_t *, + const char *, int, int, int); +static int fmtint(char **, char **, size_t *, size_t *, + LLONG, int, int, int, int); +static int fmtfp(char **, char **, size_t *, size_t *, + LDOUBLE, int, int, int); +static int doapr_outch(char **, char **, size_t *, size_t *, int); +static int _dopr(char **sbuffer, char **buffer, + size_t *maxlen, size_t *retlen, int *truncated, + const char *format, va_list args); /* format read states */ #define DP_S_DEFAULT 0 @@ -165,7 +165,7 @@ static void _dopr(char **sbuffer, char **buffer, #define char_to_int(p) (p - '0') #define OSSL_MAX(p,q) ((p >= q) ? p : q) -static void +static int _dopr(char **sbuffer, char **buffer, size_t *maxlen, @@ -196,7 +196,8 @@ _dopr(char **sbuffer, if (ch == '%') state = DP_S_FLAGS; else - doapr_outch(sbuffer, buffer, &currlen, maxlen, ch); + if(!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch)) + return 0; ch = *format++; break; case DP_S_FLAGS: @@ -302,8 +303,9 @@ _dopr(char **sbuffer, value = va_arg(args, int); break; } - fmtint(sbuffer, buffer, &currlen, maxlen, - value, 10, min, max, flags); + if (!fmtint(sbuffer, buffer, &currlen, maxlen, value, 10, min, + max, flags)) + return 0; break; case 'X': flags |= DP_F_UP; @@ -326,17 +328,19 @@ _dopr(char **sbuffer, value = (LLONG) va_arg(args, unsigned int); break; } - fmtint(sbuffer, buffer, &currlen, maxlen, value, - ch == 'o' ? 8 : (ch == 'u' ? 10 : 16), - min, max, flags); + if (!fmtint(sbuffer, buffer, &currlen, maxlen, value, + ch == 'o' ? 8 : (ch == 'u' ? 10 : 16), + min, max, flags)) + return 0; break; case 'f': if (cflags == DP_C_LDOUBLE) fvalue = va_arg(args, LDOUBLE); else fvalue = va_arg(args, double); - fmtfp(sbuffer, buffer, &currlen, maxlen, - fvalue, min, max, flags); + if (!fmtfp(sbuffer, buffer, &currlen, maxlen, fvalue, min, max, + flags)) + return 0; break; case 'E': flags |= DP_F_UP; @@ -355,8 +359,9 @@ _dopr(char **sbuffer, fvalue = va_arg(args, double); break; case 'c': - doapr_outch(sbuffer, buffer, &currlen, maxlen, - va_arg(args, int)); + if(!doapr_outch(sbuffer, buffer, &currlen, maxlen, + va_arg(args, int))) + return 0; break; case 's': strvalue = va_arg(args, char *); @@ -366,13 +371,15 @@ _dopr(char **sbuffer, else max = *maxlen; } - fmtstr(sbuffer, buffer, &currlen, maxlen, strvalue, - flags, min, max); + if (!fmtstr(sbuffer, buffer, &currlen, maxlen, strvalue, + flags, min, max)) + return 0; break; case 'p': value = (long)va_arg(args, void *); - fmtint(sbuffer, buffer, &currlen, maxlen, - value, 16, min, max, flags | DP_F_NUM); + if (!fmtint(sbuffer, buffer, &currlen, maxlen, + value, 16, min, max, flags | DP_F_NUM)) + return 0; break; case 'n': /* XXX */ if (cflags == DP_C_SHORT) { @@ -394,7 +401,8 @@ _dopr(char **sbuffer, } break; case '%': - doapr_outch(sbuffer, buffer, &currlen, maxlen, ch); + if(!doapr_outch(sbuffer, buffer, &currlen, maxlen, ch)) + return 0; break; case 'w': /* not supported yet, treat as next char */ @@ -418,46 +426,56 @@ _dopr(char **sbuffer, *truncated = (currlen > *maxlen - 1); if (*truncated) currlen = *maxlen - 1; - doapr_outch(sbuffer, buffer, &currlen, maxlen, '\0'); + if(!doapr_outch(sbuffer, buffer, &currlen, maxlen, '\0')) + return 0; *retlen = currlen - 1; - return; + return 1; } -static void +static int fmtstr(char **sbuffer, char **buffer, size_t *currlen, size_t *maxlen, const char *value, int flags, int min, int max) { - int padlen, strln; + int padlen; + size_t strln; int cnt = 0; if (value == 0) value = ""; - for (strln = 0; value[strln]; ++strln) ; + + strln = strlen(value); + if (strln > INT_MAX) + strln = INT_MAX; + padlen = min - strln; - if (padlen < 0) + if (min < 0 || padlen < 0) padlen = 0; if (flags & DP_F_MINUS) padlen = -padlen; while ((padlen > 0) && (cnt < max)) { - doapr_outch(sbuffer, buffer, currlen, maxlen, ' '); + if(!doapr_outch(sbuffer, buffer, currlen, maxlen, ' ')) + return 0; --padlen; ++cnt; } while (*value && (cnt < max)) { - doapr_outch(sbuffer, buffer, currlen, maxlen, *value++); + if(!doapr_outch(sbuffer, buffer, currlen, maxlen, *value++)) + return 0; ++cnt; } while ((padlen < 0) && (cnt < max)) { - doapr_outch(sbuffer, buffer, currlen, maxlen, ' '); + if(!doapr_outch(sbuffer, buffer, currlen, maxlen, ' ')) + return 0; ++padlen; ++cnt; } + return 1; } -static void +static int fmtint(char **sbuffer, char **buffer, size_t *currlen, @@ -517,37 +535,44 @@ fmtint(char **sbuffer, /* spaces */ while (spadlen > 0) { - doapr_outch(sbuffer, buffer, currlen, maxlen, ' '); + if(!doapr_outch(sbuffer, buffer, currlen, maxlen, ' ')) + return 0; --spadlen; } /* sign */ if (signvalue) - doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue); + if(!doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue)) + return 0; /* prefix */ while (*prefix) { - doapr_outch(sbuffer, buffer, currlen, maxlen, *prefix); + if(!doapr_outch(sbuffer, buffer, currlen, maxlen, *prefix)) + return 0; prefix++; } /* zeros */ if (zpadlen > 0) { while (zpadlen > 0) { - doapr_outch(sbuffer, buffer, currlen, maxlen, '0'); + if(!doapr_outch(sbuffer, buffer, currlen, maxlen, '0')) + return 0; --zpadlen; } } /* digits */ - while (place > 0) - doapr_outch(sbuffer, buffer, currlen, maxlen, convert[--place]); + while (place > 0) { + if (!doapr_outch(sbuffer, buffer, currlen, maxlen, convert[--place])) + return 0; + } /* left justified spaces */ while (spadlen < 0) { - doapr_outch(sbuffer, buffer, currlen, maxlen, ' '); + if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' ')) + return 0; ++spadlen; } - return; + return 1; } static LDOUBLE abs_val(LDOUBLE value) @@ -578,7 +603,7 @@ static long roundv(LDOUBLE value) return intpart; } -static void +static int fmtfp(char **sbuffer, char **buffer, size_t *currlen, @@ -657,47 +682,61 @@ fmtfp(char **sbuffer, if ((flags & DP_F_ZERO) && (padlen > 0)) { if (signvalue) { - doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue); + if (!doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue)) + return 0; --padlen; signvalue = 0; } while (padlen > 0) { - doapr_outch(sbuffer, buffer, currlen, maxlen, '0'); + if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '0')) + return 0; --padlen; } } while (padlen > 0) { - doapr_outch(sbuffer, buffer, currlen, maxlen, ' '); + if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' ')) + return 0; --padlen; } - if (signvalue) - doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue); + if (signvalue && !doapr_outch(sbuffer, buffer, currlen, maxlen, signvalue)) + return 0; - while (iplace > 0) - doapr_outch(sbuffer, buffer, currlen, maxlen, iconvert[--iplace]); + while (iplace > 0) { + if (!doapr_outch(sbuffer, buffer, currlen, maxlen, iconvert[--iplace])) + return 0; + } /* * Decimal point. This should probably use locale to find the correct * char to print out. */ if (max > 0 || (flags & DP_F_NUM)) { - doapr_outch(sbuffer, buffer, currlen, maxlen, '.'); + if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '.')) + return 0; - while (fplace > 0) - doapr_outch(sbuffer, buffer, currlen, maxlen, fconvert[--fplace]); + while (fplace > 0) { + if(!doapr_outch(sbuffer, buffer, currlen, maxlen, + fconvert[--fplace])) + return 0; + } } while (zpadlen > 0) { - doapr_outch(sbuffer, buffer, currlen, maxlen, '0'); + if (!doapr_outch(sbuffer, buffer, currlen, maxlen, '0')) + return 0; --zpadlen; } while (padlen < 0) { - doapr_outch(sbuffer, buffer, currlen, maxlen, ' '); + if (!doapr_outch(sbuffer, buffer, currlen, maxlen, ' ')) + return 0; ++padlen; } + return 1; } -static void +#define BUFFER_INC 1024 + +static int doapr_outch(char **sbuffer, char **buffer, size_t *currlen, size_t *maxlen, int c) { @@ -708,24 +747,25 @@ doapr_outch(char **sbuffer, assert(*currlen <= *maxlen); if (buffer && *currlen == *maxlen) { - *maxlen += 1024; + if (*maxlen > INT_MAX - BUFFER_INC) + return 0; + + *maxlen += BUFFER_INC; if (*buffer == NULL) { *buffer = OPENSSL_malloc(*maxlen); - if (!*buffer) { - /* Panic! Can't really do anything sensible. Just return */ - return; - } + if (*buffer == NULL) + return 0; if (*currlen > 0) { assert(*sbuffer != NULL); memcpy(*buffer, *sbuffer, *currlen); } *sbuffer = NULL; } else { - *buffer = OPENSSL_realloc(*buffer, *maxlen); - if (!*buffer) { - /* Panic! Can't really do anything sensible. Just return */ - return; - } + char *tmpbuf; + tmpbuf = OPENSSL_realloc(*buffer, *maxlen); + if (tmpbuf == NULL) + return 0; + *buffer = tmpbuf; } } @@ -736,7 +776,7 @@ doapr_outch(char **sbuffer, (*buffer)[(*currlen)++] = (char)c; } - return; + return 1; } /***************************************************************************/ @@ -768,7 +808,11 @@ int BIO_vprintf(BIO *bio, const char *format, va_list args) dynbuf = NULL; CRYPTO_push_info("doapr()"); - _dopr(&hugebufp, &dynbuf, &hugebufsize, &retlen, &ignored, format, args); + if (!_dopr(&hugebufp, &dynbuf, &hugebufsize, &retlen, &ignored, format, + args)) { + OPENSSL_free(dynbuf); + return -1; + } if (dynbuf) { ret = BIO_write(bio, dynbuf, (int)retlen); OPENSSL_free(dynbuf); @@ -803,7 +847,8 @@ int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args) size_t retlen; int truncated; - _dopr(&buf, NULL, &n, &retlen, &truncated, format, args); + if(!_dopr(&buf, NULL, &n, &retlen, &truncated, format, args)) + return -1; if (truncated) /* diff --git a/deps/openssl/openssl/crypto/bio/bio.h b/deps/openssl/openssl/crypto/bio/bio.h index f78796b069f547..6790aed28e0bae 100644 --- a/deps/openssl/openssl/crypto/bio/bio.h +++ b/deps/openssl/openssl/crypto/bio/bio.h @@ -479,11 +479,11 @@ struct bio_dgram_sctp_prinfo { # define BIO_get_conn_hostname(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0) # define BIO_get_conn_port(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1) # define BIO_get_conn_ip(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2) -# define BIO_get_conn_int_port(b) BIO_int_ctrl(b,BIO_C_GET_CONNECT,3,0) +# define BIO_get_conn_int_port(b) BIO_ctrl(b,BIO_C_GET_CONNECT,3,NULL) # define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) -/* BIO_s_accept_socket() */ +/* BIO_s_accept() */ # define BIO_set_accept_port(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0,(char *)name) # define BIO_get_accept_port(b) BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0) /* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) */ @@ -496,6 +496,7 @@ struct bio_dgram_sctp_prinfo { # define BIO_set_bind_mode(b,mode) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL) # define BIO_get_bind_mode(b,mode) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL) +/* BIO_s_accept() and BIO_s_connect() */ # define BIO_do_connect(b) BIO_do_handshake(b) # define BIO_do_accept(b) BIO_do_handshake(b) # define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL) @@ -515,12 +516,15 @@ struct bio_dgram_sctp_prinfo { # define BIO_get_url(b,url) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,2,(char *)(url)) # define BIO_get_no_connect_return(b) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,5,NULL) +/* BIO_s_datagram(), BIO_s_fd(), BIO_s_socket(), BIO_s_accept() and BIO_s_connect() */ # define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd) # define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char *)c) +/* BIO_s_file() */ # define BIO_set_fp(b,fp,c) BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)fp) # define BIO_get_fp(b,fpp) BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,(char *)fpp) +/* BIO_s_fd() and BIO_s_file() */ # define BIO_seek(b,ofs) (int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL) # define BIO_tell(b) (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL) @@ -685,7 +689,7 @@ long BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi, long argl, long ret); BIO_METHOD *BIO_s_mem(void); -BIO *BIO_new_mem_buf(void *buf, int len); +BIO *BIO_new_mem_buf(const void *buf, int len); BIO_METHOD *BIO_s_socket(void); BIO_METHOD *BIO_s_connect(void); BIO_METHOD *BIO_s_accept(void); diff --git a/deps/openssl/openssl/crypto/bio/bss_bio.c b/deps/openssl/openssl/crypto/bio/bss_bio.c index d629a37a5a1dbf..4d8727f8f890cc 100644 --- a/deps/openssl/openssl/crypto/bio/bss_bio.c +++ b/deps/openssl/openssl/crypto/bio/bss_bio.c @@ -1,4 +1,4 @@ -/* crypto/bio/bss_bio.c -*- Mode: C; c-file-style: "eay" -*- */ +/* crypto/bio/bss_bio.c */ /* ==================================================================== * Copyright (c) 1998-2003 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/bio/bss_conn.c b/deps/openssl/openssl/crypto/bio/bss_conn.c index 42d0afffbc6c4c..7d15ad29dcd70e 100644 --- a/deps/openssl/openssl/crypto/bio/bss_conn.c +++ b/deps/openssl/openssl/crypto/bio/bss_conn.c @@ -419,7 +419,7 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr) { BIO *dbio; int *ip; - const char **pptr; + const char **pptr = NULL; long ret = 1; BIO_CONNECT *data; @@ -442,19 +442,28 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr) case BIO_C_GET_CONNECT: if (ptr != NULL) { pptr = (const char **)ptr; - if (num == 0) { - *pptr = data->param_hostname; + } - } else if (num == 1) { - *pptr = data->param_port; - } else if (num == 2) { - *pptr = (char *)&(data->ip[0]); - } else if (num == 3) { - *((int *)ptr) = data->port; + if (b->init) { + if (pptr != NULL) { + ret = 1; + if (num == 0) { + *pptr = data->param_hostname; + } else if (num == 1) { + *pptr = data->param_port; + } else if (num == 2) { + *pptr = (char *)&(data->ip[0]); + } else { + ret = 0; + } + } + if (num == 3) { + ret = data->port; } - if ((!b->init) || (ptr == NULL)) + } else { + if (pptr != NULL) *pptr = "not initialized"; - ret = 1; + ret = 0; } break; case BIO_C_SET_CONNECT: diff --git a/deps/openssl/openssl/crypto/bio/bss_dgram.c b/deps/openssl/openssl/crypto/bio/bss_dgram.c index 7fcd831da06bed..bdd7bf88ea0e85 100644 --- a/deps/openssl/openssl/crypto/bio/bss_dgram.c +++ b/deps/openssl/openssl/crypto/bio/bss_dgram.c @@ -519,10 +519,8 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr) switch (cmd) { case BIO_CTRL_RESET: num = 0; - case BIO_C_FILE_SEEK: ret = 0; break; - case BIO_C_FILE_TELL: case BIO_CTRL_INFO: ret = 0; break; diff --git a/deps/openssl/openssl/crypto/bio/bss_file.c b/deps/openssl/openssl/crypto/bio/bss_file.c index d7f15b0699c91d..bfba93e62bbd08 100644 --- a/deps/openssl/openssl/crypto/bio/bss_file.c +++ b/deps/openssl/openssl/crypto/bio/bss_file.c @@ -115,9 +115,8 @@ static BIO_METHOD methods_filep = { NULL, }; -BIO *BIO_new_file(const char *filename, const char *mode) +static FILE *file_fopen(const char *filename, const char *mode) { - BIO *ret; FILE *file = NULL; # if defined(_WIN32) && defined(CP_UTF8) @@ -164,6 +163,14 @@ BIO *BIO_new_file(const char *filename, const char *mode) # else file = fopen(filename, mode); # endif + return (file); +} + +BIO *BIO_new_file(const char *filename, const char *mode) +{ + BIO *ret; + FILE *file = file_fopen(filename, mode); + if (file == NULL) { SYSerr(SYS_F_FOPEN, get_last_sys_error()); ERR_add_error_data(5, "fopen('", filename, "','", mode, "')"); @@ -386,7 +393,7 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr) else strcat(p, "t"); # endif - fp = fopen(ptr, p); + fp = file_fopen(ptr, p); if (fp == NULL) { SYSerr(SYS_F_FOPEN, get_last_sys_error()); ERR_add_error_data(5, "fopen('", ptr, "','", p, "')"); diff --git a/deps/openssl/openssl/crypto/bio/bss_mem.c b/deps/openssl/openssl/crypto/bio/bss_mem.c index d190765dc2010e..b0394a960da15f 100644 --- a/deps/openssl/openssl/crypto/bio/bss_mem.c +++ b/deps/openssl/openssl/crypto/bio/bss_mem.c @@ -91,7 +91,8 @@ BIO_METHOD *BIO_s_mem(void) return (&mem_method); } -BIO *BIO_new_mem_buf(void *buf, int len) + +BIO *BIO_new_mem_buf(const void *buf, int len) { BIO *ret; BUF_MEM *b; @@ -105,7 +106,8 @@ BIO *BIO_new_mem_buf(void *buf, int len) if (!(ret = BIO_new(BIO_s_mem()))) return NULL; b = (BUF_MEM *)ret->ptr; - b->data = buf; + /* Cast away const and trust in the MEM_RDONLY flag. */ + b->data = (void *)buf; b->length = sz; b->max = sz; ret->flags |= BIO_FLAGS_MEM_RDONLY; diff --git a/deps/openssl/openssl/crypto/bn/Makefile b/deps/openssl/openssl/crypto/bn/Makefile index 215855ecae914c..c4c6409517596f 100644 --- a/deps/openssl/openssl/crypto/bn/Makefile +++ b/deps/openssl/openssl/crypto/bn/Makefile @@ -252,8 +252,8 @@ bn_exp.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h bn_exp.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h bn_exp.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h bn_exp.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h -bn_exp.o: ../../include/openssl/symhacks.h ../cryptlib.h bn_exp.c bn_lcl.h -bn_exp.o: rsaz_exp.h +bn_exp.o: ../../include/openssl/symhacks.h ../constant_time_locl.h +bn_exp.o: ../cryptlib.h bn_exp.c bn_lcl.h rsaz_exp.h bn_exp2.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h bn_exp2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h bn_exp2.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h diff --git a/deps/openssl/openssl/crypto/bn/asm/armv4-gf2m.pl b/deps/openssl/openssl/crypto/bn/asm/armv4-gf2m.pl index 8f529c95cf0509..72381a77240ca9 100644 --- a/deps/openssl/openssl/crypto/bn/asm/armv4-gf2m.pl +++ b/deps/openssl/openssl/crypto/bn/asm/armv4-gf2m.pl @@ -27,7 +27,7 @@ # referred below, which improves ECDH and ECDSA verify benchmarks # by 18-40%. # -# C�mara, D.; Gouv�a, C. P. L.; L�pez, J. & Dahab, R.: Fast Software +# Câmara, D.; Gouvêa, C. P. L.; López, J. & Dahab, R.: Fast Software # Polynomial Multiplication on ARM Processors using the NEON Engine. # # http://conradoplg.cryptoland.net/files/2010/12/mocrysen13.pdf @@ -136,7 +136,7 @@ ################ # void bn_GF2m_mul_2x2(BN_ULONG *r, # BN_ULONG a1,BN_ULONG a0, -# BN_ULONG b1,BN_ULONG b0); # r[3..0]=a1a0�b1b0 +# BN_ULONG b1,BN_ULONG b0); # r[3..0]=a1a0·b1b0 { $code.=<<___; .global bn_GF2m_mul_2x2 @@ -159,7 +159,7 @@ mov $mask,#7<<2 sub sp,sp,#32 @ allocate tab[8] - bl mul_1x1_ialu @ a1�b1 + bl mul_1x1_ialu @ a1·b1 str $lo,[$ret,#8] str $hi,[$ret,#12] @@ -169,13 +169,13 @@ eor r2,r2,$a eor $b,$b,r3 eor $a,$a,r2 - bl mul_1x1_ialu @ a0�b0 + bl mul_1x1_ialu @ a0·b0 str $lo,[$ret] str $hi,[$ret,#4] eor $a,$a,r2 eor $b,$b,r3 - bl mul_1x1_ialu @ (a1+a0)�(b1+b0) + bl mul_1x1_ialu @ (a1+a0)·(b1+b0) ___ @r=map("r$_",(6..9)); $code.=<<___; diff --git a/deps/openssl/openssl/crypto/bn/asm/ia64.S b/deps/openssl/openssl/crypto/bn/asm/ia64.S index 951abc53ea5bba..a9a42abfc302d6 100644 --- a/deps/openssl/openssl/crypto/bn/asm/ia64.S +++ b/deps/openssl/openssl/crypto/bn/asm/ia64.S @@ -422,7 +422,7 @@ bn_mul_add_words: // This loop spins in 3*(n+10) ticks on Itanium and in 2*(n+10) on // Itanium 2. Yes, unlike previous versions it scales:-) Previous -// version was peforming *all* additions in IALU and was starving +// version was performing *all* additions in IALU and was starving // for those even on Itanium 2. In this version one addition is // moved to FPU and is folded with multiplication. This is at cost // of propogating the result from previous call to this subroutine @@ -568,7 +568,7 @@ bn_sqr_comba8: // I've estimated this routine to run in ~120 ticks, but in reality // (i.e. according to ar.itc) it takes ~160 ticks. Are those extra // cycles consumed for instructions fetch? Or did I misinterpret some -// clause in Itanium �-architecture manual? Comments are welcomed and +// clause in Itanium µ-architecture manual? Comments are welcomed and // highly appreciated. // // On Itanium 2 it takes ~190 ticks. This is because of stalls on diff --git a/deps/openssl/openssl/crypto/bn/asm/ppc64-mont.pl b/deps/openssl/openssl/crypto/bn/asm/ppc64-mont.pl index 68e3733e3f79cd..9e3c12d788e5fd 100644 --- a/deps/openssl/openssl/crypto/bn/asm/ppc64-mont.pl +++ b/deps/openssl/openssl/crypto/bn/asm/ppc64-mont.pl @@ -94,6 +94,8 @@ $POP= "ld"; } else { die "nonsense $flavour"; } +$LITTLE_ENDIAN = ($flavour=~/le$/) ? 4 : 0; + $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; ( $xlate="${dir}ppc-xlate.pl" and -f $xlate ) or ( $xlate="${dir}../../perlasm/ppc-xlate.pl" and -f $xlate) or @@ -294,12 +296,12 @@ extrdi $t0,$a0,32,32 ; lwz $t0,4($ap) extrdi $t1,$a0,32,0 ; lwz $t1,0($ap) - lwz $t2,12($ap) ; load a[1] as 32-bit word pair - lwz $t3,8($ap) - lwz $t4,4($np) ; load n[0] as 32-bit word pair - lwz $t5,0($np) - lwz $t6,12($np) ; load n[1] as 32-bit word pair - lwz $t7,8($np) + lwz $t2,`12^$LITTLE_ENDIAN`($ap) ; load a[1] as 32-bit word pair + lwz $t3,`8^$LITTLE_ENDIAN`($ap) + lwz $t4,`4^$LITTLE_ENDIAN`($np) ; load n[0] as 32-bit word pair + lwz $t5,`0^$LITTLE_ENDIAN`($np) + lwz $t6,`12^$LITTLE_ENDIAN`($np) ; load n[1] as 32-bit word pair + lwz $t7,`8^$LITTLE_ENDIAN`($np) ___ $code.=<<___ if ($SIZE_T==4); lwz $a0,0($ap) ; pull ap[0,1] value @@ -463,14 +465,14 @@ L1st: ___ $code.=<<___ if ($SIZE_T==8); - lwz $t0,4($ap) ; load a[j] as 32-bit word pair - lwz $t1,0($ap) - lwz $t2,12($ap) ; load a[j+1] as 32-bit word pair - lwz $t3,8($ap) - lwz $t4,4($np) ; load n[j] as 32-bit word pair - lwz $t5,0($np) - lwz $t6,12($np) ; load n[j+1] as 32-bit word pair - lwz $t7,8($np) + lwz $t0,`4^$LITTLE_ENDIAN`($ap) ; load a[j] as 32-bit word pair + lwz $t1,`0^$LITTLE_ENDIAN`($ap) + lwz $t2,`12^$LITTLE_ENDIAN`($ap) ; load a[j+1] as 32-bit word pair + lwz $t3,`8^$LITTLE_ENDIAN`($ap) + lwz $t4,`4^$LITTLE_ENDIAN`($np) ; load n[j] as 32-bit word pair + lwz $t5,`0^$LITTLE_ENDIAN`($np) + lwz $t6,`12^$LITTLE_ENDIAN`($np) ; load n[j+1] as 32-bit word pair + lwz $t7,`8^$LITTLE_ENDIAN`($np) ___ $code.=<<___ if ($SIZE_T==4); lwz $t0,0($ap) ; load a[j..j+3] as 32-bit word pairs @@ -505,14 +507,14 @@ ___ } else { $code.=<<___; - lwz $t1,`$FRAME+0`($sp) - lwz $t0,`$FRAME+4`($sp) - lwz $t3,`$FRAME+8`($sp) - lwz $t2,`$FRAME+12`($sp) - lwz $t5,`$FRAME+16`($sp) - lwz $t4,`$FRAME+20`($sp) - lwz $t7,`$FRAME+24`($sp) - lwz $t6,`$FRAME+28`($sp) + lwz $t1,`$FRAME+0^$LITTLE_ENDIAN`($sp) + lwz $t0,`$FRAME+4^$LITTLE_ENDIAN`($sp) + lwz $t3,`$FRAME+8^$LITTLE_ENDIAN`($sp) + lwz $t2,`$FRAME+12^$LITTLE_ENDIAN`($sp) + lwz $t5,`$FRAME+16^$LITTLE_ENDIAN`($sp) + lwz $t4,`$FRAME+20^$LITTLE_ENDIAN`($sp) + lwz $t7,`$FRAME+24^$LITTLE_ENDIAN`($sp) + lwz $t6,`$FRAME+28^$LITTLE_ENDIAN`($sp) ___ } $code.=<<___; @@ -651,8 +653,8 @@ fmadd $T1a,$N1,$na,$T1a fmadd $T1b,$N1,$nb,$T1b - lwz $t3,`$FRAME+32`($sp) ; permuted $t1 - lwz $t2,`$FRAME+36`($sp) ; permuted $t0 + lwz $t3,`$FRAME+32^$LITTLE_ENDIAN`($sp) ; permuted $t1 + lwz $t2,`$FRAME+36^$LITTLE_ENDIAN`($sp) ; permuted $t0 addc $t4,$t4,$carry adde $t5,$t5,$c1 srwi $carry,$t4,16 @@ -673,8 +675,8 @@ fmadd $T1a,$N0,$nc,$T1a fmadd $T1b,$N0,$nd,$T1b - lwz $t7,`$FRAME+40`($sp) ; permuted $t3 - lwz $t6,`$FRAME+44`($sp) ; permuted $t2 + lwz $t7,`$FRAME+40^$LITTLE_ENDIAN`($sp) ; permuted $t3 + lwz $t6,`$FRAME+44^$LITTLE_ENDIAN`($sp) ; permuted $t2 addc $t2,$t2,$carry adde $t3,$t3,$c1 srwi $carry,$t2,16 @@ -686,8 +688,8 @@ insrwi $carry,$t3,16,0 fmadd $T3a,$N2,$nc,$T3a fmadd $T3b,$N2,$nd,$T3b - lwz $t1,`$FRAME+48`($sp) ; permuted $t5 - lwz $t0,`$FRAME+52`($sp) ; permuted $t4 + lwz $t1,`$FRAME+48^$LITTLE_ENDIAN`($sp) ; permuted $t5 + lwz $t0,`$FRAME+52^$LITTLE_ENDIAN`($sp) ; permuted $t4 addc $t6,$t6,$carry adde $t7,$t7,$c1 srwi $carry,$t6,16 @@ -699,8 +701,8 @@ fctid $T0a,$T0a fctid $T0b,$T0b - lwz $t5,`$FRAME+56`($sp) ; permuted $t7 - lwz $t4,`$FRAME+60`($sp) ; permuted $t6 + lwz $t5,`$FRAME+56^$LITTLE_ENDIAN`($sp) ; permuted $t7 + lwz $t4,`$FRAME+60^$LITTLE_ENDIAN`($sp) ; permuted $t6 addc $t0,$t0,$carry adde $t1,$t1,$c1 srwi $carry,$t0,16 @@ -787,14 +789,14 @@ ___ } else { $code.=<<___; - lwz $t1,`$FRAME+0`($sp) - lwz $t0,`$FRAME+4`($sp) - lwz $t3,`$FRAME+8`($sp) - lwz $t2,`$FRAME+12`($sp) - lwz $t5,`$FRAME+16`($sp) - lwz $t4,`$FRAME+20`($sp) - lwz $t7,`$FRAME+24`($sp) - lwz $t6,`$FRAME+28`($sp) + lwz $t1,`$FRAME+0^$LITTLE_ENDIAN`($sp) + lwz $t0,`$FRAME+4^$LITTLE_ENDIAN`($sp) + lwz $t3,`$FRAME+8^$LITTLE_ENDIAN`($sp) + lwz $t2,`$FRAME+12^$LITTLE_ENDIAN`($sp) + lwz $t5,`$FRAME+16^$LITTLE_ENDIAN`($sp) + lwz $t4,`$FRAME+20^$LITTLE_ENDIAN`($sp) + lwz $t7,`$FRAME+24^$LITTLE_ENDIAN`($sp) + lwz $t6,`$FRAME+28^$LITTLE_ENDIAN`($sp) stfd $dota,`$FRAME+64`($sp) stfd $dotb,`$FRAME+72`($sp) @@ -823,14 +825,14 @@ stw $t0,12($tp) ; tp[j-1] stw $t4,8($tp) - lwz $t3,`$FRAME+32`($sp) ; permuted $t1 - lwz $t2,`$FRAME+36`($sp) ; permuted $t0 - lwz $t7,`$FRAME+40`($sp) ; permuted $t3 - lwz $t6,`$FRAME+44`($sp) ; permuted $t2 - lwz $t1,`$FRAME+48`($sp) ; permuted $t5 - lwz $t0,`$FRAME+52`($sp) ; permuted $t4 - lwz $t5,`$FRAME+56`($sp) ; permuted $t7 - lwz $t4,`$FRAME+60`($sp) ; permuted $t6 + lwz $t3,`$FRAME+32^$LITTLE_ENDIAN`($sp) ; permuted $t1 + lwz $t2,`$FRAME+36^$LITTLE_ENDIAN`($sp) ; permuted $t0 + lwz $t7,`$FRAME+40^$LITTLE_ENDIAN`($sp) ; permuted $t3 + lwz $t6,`$FRAME+44^$LITTLE_ENDIAN`($sp) ; permuted $t2 + lwz $t1,`$FRAME+48^$LITTLE_ENDIAN`($sp) ; permuted $t5 + lwz $t0,`$FRAME+52^$LITTLE_ENDIAN`($sp) ; permuted $t4 + lwz $t5,`$FRAME+56^$LITTLE_ENDIAN`($sp) ; permuted $t7 + lwz $t4,`$FRAME+60^$LITTLE_ENDIAN`($sp) ; permuted $t6 addc $t2,$t2,$carry adde $t3,$t3,$c1 @@ -857,10 +859,10 @@ stw $t2,20($tp) ; tp[j] stwu $t0,16($tp) - lwz $t7,`$FRAME+64`($sp) - lwz $t6,`$FRAME+68`($sp) - lwz $t5,`$FRAME+72`($sp) - lwz $t4,`$FRAME+76`($sp) + lwz $t7,`$FRAME+64^$LITTLE_ENDIAN`($sp) + lwz $t6,`$FRAME+68^$LITTLE_ENDIAN`($sp) + lwz $t5,`$FRAME+72^$LITTLE_ENDIAN`($sp) + lwz $t4,`$FRAME+76^$LITTLE_ENDIAN`($sp) addc $t6,$t6,$carry adde $t7,$t7,$c1 @@ -1165,23 +1167,23 @@ $code.=<<___; fmadd $T1a,$N1,$na,$T1a fmadd $T1b,$N1,$nb,$T1b - lwz $t1,`$FRAME+0`($sp) - lwz $t0,`$FRAME+4`($sp) + lwz $t1,`$FRAME+0^$LITTLE_ENDIAN`($sp) + lwz $t0,`$FRAME+4^$LITTLE_ENDIAN`($sp) fmadd $T2a,$N2,$na,$T2a fmadd $T2b,$N2,$nb,$T2b - lwz $t3,`$FRAME+8`($sp) - lwz $t2,`$FRAME+12`($sp) + lwz $t3,`$FRAME+8^$LITTLE_ENDIAN`($sp) + lwz $t2,`$FRAME+12^$LITTLE_ENDIAN`($sp) fmadd $T3a,$N3,$na,$T3a fmadd $T3b,$N3,$nb,$T3b - lwz $t5,`$FRAME+16`($sp) - lwz $t4,`$FRAME+20`($sp) + lwz $t5,`$FRAME+16^$LITTLE_ENDIAN`($sp) + lwz $t4,`$FRAME+20^$LITTLE_ENDIAN`($sp) addc $t0,$t0,$carry adde $t1,$t1,$c1 srwi $carry,$t0,16 fmadd $T0a,$N0,$na,$T0a fmadd $T0b,$N0,$nb,$T0b - lwz $t7,`$FRAME+24`($sp) - lwz $t6,`$FRAME+28`($sp) + lwz $t7,`$FRAME+24^$LITTLE_ENDIAN`($sp) + lwz $t6,`$FRAME+28^$LITTLE_ENDIAN`($sp) srwi $c1,$t1,16 insrwi $carry,$t1,16,0 @@ -1218,8 +1220,8 @@ fctid $T1a,$T1a addc $t0,$t0,$t2 adde $t4,$t4,$t3 - lwz $t3,`$FRAME+32`($sp) ; permuted $t1 - lwz $t2,`$FRAME+36`($sp) ; permuted $t0 + lwz $t3,`$FRAME+32^$LITTLE_ENDIAN`($sp) ; permuted $t1 + lwz $t2,`$FRAME+36^$LITTLE_ENDIAN`($sp) ; permuted $t0 fctid $T1b,$T1b addze $carry,$carry addze $c1,$c1 @@ -1229,19 +1231,19 @@ addc $t2,$t2,$carry adde $t3,$t3,$c1 srwi $carry,$t2,16 - lwz $t7,`$FRAME+40`($sp) ; permuted $t3 - lwz $t6,`$FRAME+44`($sp) ; permuted $t2 + lwz $t7,`$FRAME+40^$LITTLE_ENDIAN`($sp) ; permuted $t3 + lwz $t6,`$FRAME+44^$LITTLE_ENDIAN`($sp) ; permuted $t2 fctid $T2b,$T2b srwi $c1,$t3,16 insrwi $carry,$t3,16,0 - lwz $t1,`$FRAME+48`($sp) ; permuted $t5 - lwz $t0,`$FRAME+52`($sp) ; permuted $t4 + lwz $t1,`$FRAME+48^$LITTLE_ENDIAN`($sp) ; permuted $t5 + lwz $t0,`$FRAME+52^$LITTLE_ENDIAN`($sp) ; permuted $t4 fctid $T3a,$T3a addc $t6,$t6,$carry adde $t7,$t7,$c1 srwi $carry,$t6,16 - lwz $t5,`$FRAME+56`($sp) ; permuted $t7 - lwz $t4,`$FRAME+60`($sp) ; permuted $t6 + lwz $t5,`$FRAME+56^$LITTLE_ENDIAN`($sp) ; permuted $t7 + lwz $t4,`$FRAME+60^$LITTLE_ENDIAN`($sp) ; permuted $t6 fctid $T3b,$T3b insrwi $t2,$t6,16,0 ; 64..95 bits @@ -1354,14 +1356,14 @@ ___ } else { $code.=<<___; - lwz $t1,`$FRAME+0`($sp) - lwz $t0,`$FRAME+4`($sp) - lwz $t3,`$FRAME+8`($sp) - lwz $t2,`$FRAME+12`($sp) - lwz $t5,`$FRAME+16`($sp) - lwz $t4,`$FRAME+20`($sp) - lwz $t7,`$FRAME+24`($sp) - lwz $t6,`$FRAME+28`($sp) + lwz $t1,`$FRAME+0^$LITTLE_ENDIAN`($sp) + lwz $t0,`$FRAME+4^$LITTLE_ENDIAN`($sp) + lwz $t3,`$FRAME+8^$LITTLE_ENDIAN`($sp) + lwz $t2,`$FRAME+12^$LITTLE_ENDIAN`($sp) + lwz $t5,`$FRAME+16^$LITTLE_ENDIAN`($sp) + lwz $t4,`$FRAME+20^$LITTLE_ENDIAN`($sp) + lwz $t7,`$FRAME+24^$LITTLE_ENDIAN`($sp) + lwz $t6,`$FRAME+28^$LITTLE_ENDIAN`($sp) stfd $dota,`$FRAME+64`($sp) stfd $dotb,`$FRAME+72`($sp) @@ -1397,14 +1399,14 @@ stw $t0,4($tp) ; tp[j-1] stw $t4,0($tp) - lwz $t3,`$FRAME+32`($sp) ; permuted $t1 - lwz $t2,`$FRAME+36`($sp) ; permuted $t0 - lwz $t7,`$FRAME+40`($sp) ; permuted $t3 - lwz $t6,`$FRAME+44`($sp) ; permuted $t2 - lwz $t1,`$FRAME+48`($sp) ; permuted $t5 - lwz $t0,`$FRAME+52`($sp) ; permuted $t4 - lwz $t5,`$FRAME+56`($sp) ; permuted $t7 - lwz $t4,`$FRAME+60`($sp) ; permuted $t6 + lwz $t3,`$FRAME+32^$LITTLE_ENDIAN`($sp) ; permuted $t1 + lwz $t2,`$FRAME+36^$LITTLE_ENDIAN`($sp) ; permuted $t0 + lwz $t7,`$FRAME+40^$LITTLE_ENDIAN`($sp) ; permuted $t3 + lwz $t6,`$FRAME+44^$LITTLE_ENDIAN`($sp) ; permuted $t2 + lwz $t1,`$FRAME+48^$LITTLE_ENDIAN`($sp) ; permuted $t5 + lwz $t0,`$FRAME+52^$LITTLE_ENDIAN`($sp) ; permuted $t4 + lwz $t5,`$FRAME+56^$LITTLE_ENDIAN`($sp) ; permuted $t7 + lwz $t4,`$FRAME+60^$LITTLE_ENDIAN`($sp) ; permuted $t6 addc $t2,$t2,$carry adde $t3,$t3,$c1 @@ -1433,12 +1435,12 @@ addc $t2,$t2,$t6 adde $t0,$t0,$t7 - lwz $t7,`$FRAME+64`($sp) - lwz $t6,`$FRAME+68`($sp) + lwz $t7,`$FRAME+64^$LITTLE_ENDIAN`($sp) + lwz $t6,`$FRAME+68^$LITTLE_ENDIAN`($sp) addze $carry,$carry addze $c1,$c1 - lwz $t5,`$FRAME+72`($sp) - lwz $t4,`$FRAME+76`($sp) + lwz $t5,`$FRAME+72^$LITTLE_ENDIAN`($sp) + lwz $t4,`$FRAME+76^$LITTLE_ENDIAN`($sp) addc $t6,$t6,$carry adde $t7,$t7,$c1 diff --git a/deps/openssl/openssl/crypto/bn/asm/rsaz-avx2.pl b/deps/openssl/openssl/crypto/bn/asm/rsaz-avx2.pl index 3b6ccf83d13e4b..712a77fe8ca3ab 100755 --- a/deps/openssl/openssl/crypto/bn/asm/rsaz-avx2.pl +++ b/deps/openssl/openssl/crypto/bn/asm/rsaz-avx2.pl @@ -443,7 +443,7 @@ $TEMP3 = $Y1; $TEMP4 = $Y2; $code.=<<___; - #we need to fix indexes 32-39 to avoid overflow + # we need to fix indices 32-39 to avoid overflow vmovdqu 32*8(%rsp), $ACC8 # 32*8-192($tp0), vmovdqu 32*9(%rsp), $ACC1 # 32*9-192($tp0) vmovdqu 32*10(%rsp), $ACC2 # 32*10-192($tp0) @@ -1592,68 +1592,128 @@ .type rsaz_1024_gather5_avx2,\@abi-omnipotent .align 32 rsaz_1024_gather5_avx2: + vzeroupper + mov %rsp,%r11 ___ $code.=<<___ if ($win64); lea -0x88(%rsp),%rax - vzeroupper .LSEH_begin_rsaz_1024_gather5: # I can't trust assembler to use specific encoding:-( - .byte 0x48,0x8d,0x60,0xe0 #lea -0x20(%rax),%rsp - .byte 0xc5,0xf8,0x29,0x70,0xe0 #vmovaps %xmm6,-0x20(%rax) - .byte 0xc5,0xf8,0x29,0x78,0xf0 #vmovaps %xmm7,-0x10(%rax) - .byte 0xc5,0x78,0x29,0x40,0x00 #vmovaps %xmm8,0(%rax) - .byte 0xc5,0x78,0x29,0x48,0x10 #vmovaps %xmm9,0x10(%rax) - .byte 0xc5,0x78,0x29,0x50,0x20 #vmovaps %xmm10,0x20(%rax) - .byte 0xc5,0x78,0x29,0x58,0x30 #vmovaps %xmm11,0x30(%rax) - .byte 0xc5,0x78,0x29,0x60,0x40 #vmovaps %xmm12,0x40(%rax) - .byte 0xc5,0x78,0x29,0x68,0x50 #vmovaps %xmm13,0x50(%rax) - .byte 0xc5,0x78,0x29,0x70,0x60 #vmovaps %xmm14,0x60(%rax) - .byte 0xc5,0x78,0x29,0x78,0x70 #vmovaps %xmm15,0x70(%rax) + .byte 0x48,0x8d,0x60,0xe0 # lea -0x20(%rax),%rsp + .byte 0xc5,0xf8,0x29,0x70,0xe0 # vmovaps %xmm6,-0x20(%rax) + .byte 0xc5,0xf8,0x29,0x78,0xf0 # vmovaps %xmm7,-0x10(%rax) + .byte 0xc5,0x78,0x29,0x40,0x00 # vmovaps %xmm8,0(%rax) + .byte 0xc5,0x78,0x29,0x48,0x10 # vmovaps %xmm9,0x10(%rax) + .byte 0xc5,0x78,0x29,0x50,0x20 # vmovaps %xmm10,0x20(%rax) + .byte 0xc5,0x78,0x29,0x58,0x30 # vmovaps %xmm11,0x30(%rax) + .byte 0xc5,0x78,0x29,0x60,0x40 # vmovaps %xmm12,0x40(%rax) + .byte 0xc5,0x78,0x29,0x68,0x50 # vmovaps %xmm13,0x50(%rax) + .byte 0xc5,0x78,0x29,0x70,0x60 # vmovaps %xmm14,0x60(%rax) + .byte 0xc5,0x78,0x29,0x78,0x70 # vmovaps %xmm15,0x70(%rax) ___ $code.=<<___; - lea .Lgather_table(%rip),%r11 - mov $power,%eax - and \$3,$power - shr \$2,%eax # cache line number - shl \$4,$power # offset within cache line - - vmovdqu -32(%r11),%ymm7 # .Lgather_permd - vpbroadcastb 8(%r11,%rax), %xmm8 - vpbroadcastb 7(%r11,%rax), %xmm9 - vpbroadcastb 6(%r11,%rax), %xmm10 - vpbroadcastb 5(%r11,%rax), %xmm11 - vpbroadcastb 4(%r11,%rax), %xmm12 - vpbroadcastb 3(%r11,%rax), %xmm13 - vpbroadcastb 2(%r11,%rax), %xmm14 - vpbroadcastb 1(%r11,%rax), %xmm15 - - lea 64($inp,$power),$inp - mov \$64,%r11 # size optimization - mov \$9,%eax - jmp .Loop_gather_1024 + lea -0x100(%rsp),%rsp + and \$-32, %rsp + lea .Linc(%rip), %r10 + lea -128(%rsp),%rax # control u-op density + + vmovd $power, %xmm4 + vmovdqa (%r10),%ymm0 + vmovdqa 32(%r10),%ymm1 + vmovdqa 64(%r10),%ymm5 + vpbroadcastd %xmm4,%ymm4 + + vpaddd %ymm5, %ymm0, %ymm2 + vpcmpeqd %ymm4, %ymm0, %ymm0 + vpaddd %ymm5, %ymm1, %ymm3 + vpcmpeqd %ymm4, %ymm1, %ymm1 + vmovdqa %ymm0, 32*0+128(%rax) + vpaddd %ymm5, %ymm2, %ymm0 + vpcmpeqd %ymm4, %ymm2, %ymm2 + vmovdqa %ymm1, 32*1+128(%rax) + vpaddd %ymm5, %ymm3, %ymm1 + vpcmpeqd %ymm4, %ymm3, %ymm3 + vmovdqa %ymm2, 32*2+128(%rax) + vpaddd %ymm5, %ymm0, %ymm2 + vpcmpeqd %ymm4, %ymm0, %ymm0 + vmovdqa %ymm3, 32*3+128(%rax) + vpaddd %ymm5, %ymm1, %ymm3 + vpcmpeqd %ymm4, %ymm1, %ymm1 + vmovdqa %ymm0, 32*4+128(%rax) + vpaddd %ymm5, %ymm2, %ymm8 + vpcmpeqd %ymm4, %ymm2, %ymm2 + vmovdqa %ymm1, 32*5+128(%rax) + vpaddd %ymm5, %ymm3, %ymm9 + vpcmpeqd %ymm4, %ymm3, %ymm3 + vmovdqa %ymm2, 32*6+128(%rax) + vpaddd %ymm5, %ymm8, %ymm10 + vpcmpeqd %ymm4, %ymm8, %ymm8 + vmovdqa %ymm3, 32*7+128(%rax) + vpaddd %ymm5, %ymm9, %ymm11 + vpcmpeqd %ymm4, %ymm9, %ymm9 + vpaddd %ymm5, %ymm10, %ymm12 + vpcmpeqd %ymm4, %ymm10, %ymm10 + vpaddd %ymm5, %ymm11, %ymm13 + vpcmpeqd %ymm4, %ymm11, %ymm11 + vpaddd %ymm5, %ymm12, %ymm14 + vpcmpeqd %ymm4, %ymm12, %ymm12 + vpaddd %ymm5, %ymm13, %ymm15 + vpcmpeqd %ymm4, %ymm13, %ymm13 + vpcmpeqd %ymm4, %ymm14, %ymm14 + vpcmpeqd %ymm4, %ymm15, %ymm15 + + vmovdqa -32(%r10),%ymm7 # .Lgather_permd + lea 128($inp), $inp + mov \$9,$power -.align 32 .Loop_gather_1024: - vpand -64($inp), %xmm8,%xmm0 - vpand ($inp), %xmm9,%xmm1 - vpand 64($inp), %xmm10,%xmm2 - vpand ($inp,%r11,2), %xmm11,%xmm3 - vpor %xmm0,%xmm1,%xmm1 - vpand 64($inp,%r11,2), %xmm12,%xmm4 - vpor %xmm2,%xmm3,%xmm3 - vpand ($inp,%r11,4), %xmm13,%xmm5 - vpor %xmm1,%xmm3,%xmm3 - vpand 64($inp,%r11,4), %xmm14,%xmm6 - vpor %xmm4,%xmm5,%xmm5 - vpand -128($inp,%r11,8), %xmm15,%xmm2 - lea ($inp,%r11,8),$inp - vpor %xmm3,%xmm5,%xmm5 - vpor %xmm2,%xmm6,%xmm6 - vpor %xmm5,%xmm6,%xmm6 - vpermd %ymm6,%ymm7,%ymm6 - vmovdqu %ymm6,($out) + vmovdqa 32*0-128($inp), %ymm0 + vmovdqa 32*1-128($inp), %ymm1 + vmovdqa 32*2-128($inp), %ymm2 + vmovdqa 32*3-128($inp), %ymm3 + vpand 32*0+128(%rax), %ymm0, %ymm0 + vpand 32*1+128(%rax), %ymm1, %ymm1 + vpand 32*2+128(%rax), %ymm2, %ymm2 + vpor %ymm0, %ymm1, %ymm4 + vpand 32*3+128(%rax), %ymm3, %ymm3 + vmovdqa 32*4-128($inp), %ymm0 + vmovdqa 32*5-128($inp), %ymm1 + vpor %ymm2, %ymm3, %ymm5 + vmovdqa 32*6-128($inp), %ymm2 + vmovdqa 32*7-128($inp), %ymm3 + vpand 32*4+128(%rax), %ymm0, %ymm0 + vpand 32*5+128(%rax), %ymm1, %ymm1 + vpand 32*6+128(%rax), %ymm2, %ymm2 + vpor %ymm0, %ymm4, %ymm4 + vpand 32*7+128(%rax), %ymm3, %ymm3 + vpand 32*8-128($inp), %ymm8, %ymm0 + vpor %ymm1, %ymm5, %ymm5 + vpand 32*9-128($inp), %ymm9, %ymm1 + vpor %ymm2, %ymm4, %ymm4 + vpand 32*10-128($inp),%ymm10, %ymm2 + vpor %ymm3, %ymm5, %ymm5 + vpand 32*11-128($inp),%ymm11, %ymm3 + vpor %ymm0, %ymm4, %ymm4 + vpand 32*12-128($inp),%ymm12, %ymm0 + vpor %ymm1, %ymm5, %ymm5 + vpand 32*13-128($inp),%ymm13, %ymm1 + vpor %ymm2, %ymm4, %ymm4 + vpand 32*14-128($inp),%ymm14, %ymm2 + vpor %ymm3, %ymm5, %ymm5 + vpand 32*15-128($inp),%ymm15, %ymm3 + lea 32*16($inp), $inp + vpor %ymm0, %ymm4, %ymm4 + vpor %ymm1, %ymm5, %ymm5 + vpor %ymm2, %ymm4, %ymm4 + vpor %ymm3, %ymm5, %ymm5 + + vpor %ymm5, %ymm4, %ymm4 + vextracti128 \$1, %ymm4, %xmm5 # upper half is cleared + vpor %xmm4, %xmm5, %xmm5 + vpermd %ymm5,%ymm7,%ymm5 + vmovdqu %ymm5,($out) lea 32($out),$out - dec %eax + dec $power jnz .Loop_gather_1024 vpxor %ymm0,%ymm0,%ymm0 @@ -1661,20 +1721,20 @@ vzeroupper ___ $code.=<<___ if ($win64); - movaps (%rsp),%xmm6 - movaps 0x10(%rsp),%xmm7 - movaps 0x20(%rsp),%xmm8 - movaps 0x30(%rsp),%xmm9 - movaps 0x40(%rsp),%xmm10 - movaps 0x50(%rsp),%xmm11 - movaps 0x60(%rsp),%xmm12 - movaps 0x70(%rsp),%xmm13 - movaps 0x80(%rsp),%xmm14 - movaps 0x90(%rsp),%xmm15 - lea 0xa8(%rsp),%rsp + movaps -0xa8(%r11),%xmm6 + movaps -0x98(%r11),%xmm7 + movaps -0x88(%r11),%xmm8 + movaps -0x78(%r11),%xmm9 + movaps -0x68(%r11),%xmm10 + movaps -0x58(%r11),%xmm11 + movaps -0x48(%r11),%xmm12 + movaps -0x38(%r11),%xmm13 + movaps -0x28(%r11),%xmm14 + movaps -0x18(%r11),%xmm15 .LSEH_end_rsaz_1024_gather5: ___ $code.=<<___; + lea (%r11),%rsp ret .size rsaz_1024_gather5_avx2,.-rsaz_1024_gather5_avx2 ___ @@ -1708,8 +1768,10 @@ .long 0,2,4,6,7,7,7,7 .Lgather_permd: .long 0,7,1,7,2,7,3,7 -.Lgather_table: - .byte 0,0,0,0,0,0,0,0, 0xff,0,0,0,0,0,0,0 +.Linc: + .long 0,0,0,0, 1,1,1,1 + .long 2,2,2,2, 3,3,3,3 + .long 4,4,4,4, 4,4,4,4 .align 64 ___ @@ -1837,18 +1899,19 @@ .rva rsaz_se_handler .rva .Lmul_1024_body,.Lmul_1024_epilogue .LSEH_info_rsaz_1024_gather5: - .byte 0x01,0x33,0x16,0x00 - .byte 0x36,0xf8,0x09,0x00 #vmovaps 0x90(rsp),xmm15 - .byte 0x31,0xe8,0x08,0x00 #vmovaps 0x80(rsp),xmm14 - .byte 0x2c,0xd8,0x07,0x00 #vmovaps 0x70(rsp),xmm13 - .byte 0x27,0xc8,0x06,0x00 #vmovaps 0x60(rsp),xmm12 - .byte 0x22,0xb8,0x05,0x00 #vmovaps 0x50(rsp),xmm11 - .byte 0x1d,0xa8,0x04,0x00 #vmovaps 0x40(rsp),xmm10 - .byte 0x18,0x98,0x03,0x00 #vmovaps 0x30(rsp),xmm9 - .byte 0x13,0x88,0x02,0x00 #vmovaps 0x20(rsp),xmm8 - .byte 0x0e,0x78,0x01,0x00 #vmovaps 0x10(rsp),xmm7 - .byte 0x09,0x68,0x00,0x00 #vmovaps 0x00(rsp),xmm6 - .byte 0x04,0x01,0x15,0x00 #sub rsp,0xa8 + .byte 0x01,0x36,0x17,0x0b + .byte 0x36,0xf8,0x09,0x00 # vmovaps 0x90(rsp),xmm15 + .byte 0x31,0xe8,0x08,0x00 # vmovaps 0x80(rsp),xmm14 + .byte 0x2c,0xd8,0x07,0x00 # vmovaps 0x70(rsp),xmm13 + .byte 0x27,0xc8,0x06,0x00 # vmovaps 0x60(rsp),xmm12 + .byte 0x22,0xb8,0x05,0x00 # vmovaps 0x50(rsp),xmm11 + .byte 0x1d,0xa8,0x04,0x00 # vmovaps 0x40(rsp),xmm10 + .byte 0x18,0x98,0x03,0x00 # vmovaps 0x30(rsp),xmm9 + .byte 0x13,0x88,0x02,0x00 # vmovaps 0x20(rsp),xmm8 + .byte 0x0e,0x78,0x01,0x00 # vmovaps 0x10(rsp),xmm7 + .byte 0x09,0x68,0x00,0x00 # vmovaps 0x00(rsp),xmm6 + .byte 0x04,0x01,0x15,0x00 # sub rsp,0xa8 + .byte 0x00,0xb3,0x00,0x00 # set_frame r11 ___ } diff --git a/deps/openssl/openssl/crypto/bn/asm/rsaz-x86_64.pl b/deps/openssl/openssl/crypto/bn/asm/rsaz-x86_64.pl index 3bd45dbac01d5b..87ce2c34d90cbb 100755 --- a/deps/openssl/openssl/crypto/bn/asm/rsaz-x86_64.pl +++ b/deps/openssl/openssl/crypto/bn/asm/rsaz-x86_64.pl @@ -113,7 +113,7 @@ $addx = ($1>=12); } -if (!$addx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9])\.([0-9]+)/) { +if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([3-9])\.([0-9]+)/) { my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10 $addx = ($ver>=3.03); } @@ -915,9 +915,76 @@ push %r14 push %r15 - mov $pwr, $pwr - subq \$128+24, %rsp + subq \$`128+24+($win64?0xb0:0)`, %rsp +___ +$code.=<<___ if ($win64); + movaps %xmm6,0xa0(%rsp) + movaps %xmm7,0xb0(%rsp) + movaps %xmm8,0xc0(%rsp) + movaps %xmm9,0xd0(%rsp) + movaps %xmm10,0xe0(%rsp) + movaps %xmm11,0xf0(%rsp) + movaps %xmm12,0x100(%rsp) + movaps %xmm13,0x110(%rsp) + movaps %xmm14,0x120(%rsp) + movaps %xmm15,0x130(%rsp) +___ +$code.=<<___; .Lmul_gather4_body: + movd $pwr,%xmm8 + movdqa .Linc+16(%rip),%xmm1 # 00000002000000020000000200000002 + movdqa .Linc(%rip),%xmm0 # 00000001000000010000000000000000 + + pshufd \$0,%xmm8,%xmm8 # broadcast $power + movdqa %xmm1,%xmm7 + movdqa %xmm1,%xmm2 +___ +######################################################################## +# calculate mask by comparing 0..15 to $power +# +for($i=0;$i<4;$i++) { +$code.=<<___; + paddd %xmm`$i`,%xmm`$i+1` + pcmpeqd %xmm8,%xmm`$i` + movdqa %xmm7,%xmm`$i+3` +___ +} +for(;$i<7;$i++) { +$code.=<<___; + paddd %xmm`$i`,%xmm`$i+1` + pcmpeqd %xmm8,%xmm`$i` +___ +} +$code.=<<___; + pcmpeqd %xmm8,%xmm7 + + movdqa 16*0($bp),%xmm8 + movdqa 16*1($bp),%xmm9 + movdqa 16*2($bp),%xmm10 + movdqa 16*3($bp),%xmm11 + pand %xmm0,%xmm8 + movdqa 16*4($bp),%xmm12 + pand %xmm1,%xmm9 + movdqa 16*5($bp),%xmm13 + pand %xmm2,%xmm10 + movdqa 16*6($bp),%xmm14 + pand %xmm3,%xmm11 + movdqa 16*7($bp),%xmm15 + leaq 128($bp), %rbp + pand %xmm4,%xmm12 + pand %xmm5,%xmm13 + pand %xmm6,%xmm14 + pand %xmm7,%xmm15 + por %xmm10,%xmm8 + por %xmm11,%xmm9 + por %xmm12,%xmm8 + por %xmm13,%xmm9 + por %xmm14,%xmm8 + por %xmm15,%xmm9 + + por %xmm9,%xmm8 + pshufd \$0x4e,%xmm8,%xmm9 + por %xmm9,%xmm8 ___ $code.=<<___ if ($addx); movl \$0x80100,%r11d @@ -926,45 +993,38 @@ je .Lmulx_gather ___ $code.=<<___; - movl 64($bp,$pwr,4), %eax - movq $out, %xmm0 # off-load arguments - movl ($bp,$pwr,4), %ebx - movq $mod, %xmm1 - movq $n0, 128(%rsp) + movq %xmm8,%rbx + + movq $n0, 128(%rsp) # off-load arguments + movq $out, 128+8(%rsp) + movq $mod, 128+16(%rsp) - shlq \$32, %rax - or %rax, %rbx movq ($ap), %rax movq 8($ap), %rcx - leaq 128($bp,$pwr,4), %rbp mulq %rbx # 0 iteration movq %rax, (%rsp) movq %rcx, %rax movq %rdx, %r8 mulq %rbx - movd (%rbp), %xmm4 addq %rax, %r8 movq 16($ap), %rax movq %rdx, %r9 adcq \$0, %r9 mulq %rbx - movd 64(%rbp), %xmm5 addq %rax, %r9 movq 24($ap), %rax movq %rdx, %r10 adcq \$0, %r10 mulq %rbx - pslldq \$4, %xmm5 addq %rax, %r10 movq 32($ap), %rax movq %rdx, %r11 adcq \$0, %r11 mulq %rbx - por %xmm5, %xmm4 addq %rax, %r11 movq 40($ap), %rax movq %rdx, %r12 @@ -977,14 +1037,12 @@ adcq \$0, %r13 mulq %rbx - leaq 128(%rbp), %rbp addq %rax, %r13 movq 56($ap), %rax movq %rdx, %r14 adcq \$0, %r14 mulq %rbx - movq %xmm4, %rbx addq %rax, %r14 movq ($ap), %rax movq %rdx, %r15 @@ -996,6 +1054,35 @@ .align 32 .Loop_mul_gather: + movdqa 16*0(%rbp),%xmm8 + movdqa 16*1(%rbp),%xmm9 + movdqa 16*2(%rbp),%xmm10 + movdqa 16*3(%rbp),%xmm11 + pand %xmm0,%xmm8 + movdqa 16*4(%rbp),%xmm12 + pand %xmm1,%xmm9 + movdqa 16*5(%rbp),%xmm13 + pand %xmm2,%xmm10 + movdqa 16*6(%rbp),%xmm14 + pand %xmm3,%xmm11 + movdqa 16*7(%rbp),%xmm15 + leaq 128(%rbp), %rbp + pand %xmm4,%xmm12 + pand %xmm5,%xmm13 + pand %xmm6,%xmm14 + pand %xmm7,%xmm15 + por %xmm10,%xmm8 + por %xmm11,%xmm9 + por %xmm12,%xmm8 + por %xmm13,%xmm9 + por %xmm14,%xmm8 + por %xmm15,%xmm9 + + por %xmm9,%xmm8 + pshufd \$0x4e,%xmm8,%xmm9 + por %xmm9,%xmm8 + movq %xmm8,%rbx + mulq %rbx addq %rax, %r8 movq 8($ap), %rax @@ -1004,7 +1091,6 @@ adcq \$0, %r8 mulq %rbx - movd (%rbp), %xmm4 addq %rax, %r9 movq 16($ap), %rax adcq \$0, %rdx @@ -1013,7 +1099,6 @@ adcq \$0, %r9 mulq %rbx - movd 64(%rbp), %xmm5 addq %rax, %r10 movq 24($ap), %rax adcq \$0, %rdx @@ -1022,7 +1107,6 @@ adcq \$0, %r10 mulq %rbx - pslldq \$4, %xmm5 addq %rax, %r11 movq 32($ap), %rax adcq \$0, %rdx @@ -1031,7 +1115,6 @@ adcq \$0, %r11 mulq %rbx - por %xmm5, %xmm4 addq %rax, %r12 movq 40($ap), %rax adcq \$0, %rdx @@ -1056,7 +1139,6 @@ adcq \$0, %r14 mulq %rbx - movq %xmm4, %rbx addq %rax, %r15 movq ($ap), %rax adcq \$0, %rdx @@ -1064,7 +1146,6 @@ movq %rdx, %r15 adcq \$0, %r15 - leaq 128(%rbp), %rbp leaq 8(%rdi), %rdi decl %ecx @@ -1079,8 +1160,8 @@ movq %r14, 48(%rdi) movq %r15, 56(%rdi) - movq %xmm0, $out - movq %xmm1, %rbp + movq 128+8(%rsp), $out + movq 128+16(%rsp), %rbp movq (%rsp), %r8 movq 8(%rsp), %r9 @@ -1098,45 +1179,37 @@ .align 32 .Lmulx_gather: - mov 64($bp,$pwr,4), %eax - movq $out, %xmm0 # off-load arguments - lea 128($bp,$pwr,4), %rbp - mov ($bp,$pwr,4), %edx - movq $mod, %xmm1 - mov $n0, 128(%rsp) + movq %xmm8,%rdx + + mov $n0, 128(%rsp) # off-load arguments + mov $out, 128+8(%rsp) + mov $mod, 128+16(%rsp) - shl \$32, %rax - or %rax, %rdx mulx ($ap), %rbx, %r8 # 0 iteration mov %rbx, (%rsp) xor %edi, %edi # cf=0, of=0 mulx 8($ap), %rax, %r9 - movd (%rbp), %xmm4 mulx 16($ap), %rbx, %r10 - movd 64(%rbp), %xmm5 adcx %rax, %r8 mulx 24($ap), %rax, %r11 - pslldq \$4, %xmm5 adcx %rbx, %r9 mulx 32($ap), %rbx, %r12 - por %xmm5, %xmm4 adcx %rax, %r10 mulx 40($ap), %rax, %r13 adcx %rbx, %r11 mulx 48($ap), %rbx, %r14 - lea 128(%rbp), %rbp adcx %rax, %r12 mulx 56($ap), %rax, %r15 - movq %xmm4, %rdx adcx %rbx, %r13 adcx %rax, %r14 + .byte 0x67 mov %r8, %rbx adcx %rdi, %r15 # %rdi is 0 @@ -1145,24 +1218,48 @@ .align 32 .Loop_mulx_gather: - mulx ($ap), %rax, %r8 + movdqa 16*0(%rbp),%xmm8 + movdqa 16*1(%rbp),%xmm9 + movdqa 16*2(%rbp),%xmm10 + movdqa 16*3(%rbp),%xmm11 + pand %xmm0,%xmm8 + movdqa 16*4(%rbp),%xmm12 + pand %xmm1,%xmm9 + movdqa 16*5(%rbp),%xmm13 + pand %xmm2,%xmm10 + movdqa 16*6(%rbp),%xmm14 + pand %xmm3,%xmm11 + movdqa 16*7(%rbp),%xmm15 + leaq 128(%rbp), %rbp + pand %xmm4,%xmm12 + pand %xmm5,%xmm13 + pand %xmm6,%xmm14 + pand %xmm7,%xmm15 + por %xmm10,%xmm8 + por %xmm11,%xmm9 + por %xmm12,%xmm8 + por %xmm13,%xmm9 + por %xmm14,%xmm8 + por %xmm15,%xmm9 + + por %xmm9,%xmm8 + pshufd \$0x4e,%xmm8,%xmm9 + por %xmm9,%xmm8 + movq %xmm8,%rdx + + .byte 0xc4,0x62,0xfb,0xf6,0x86,0x00,0x00,0x00,0x00 # mulx ($ap), %rax, %r8 adcx %rax, %rbx adox %r9, %r8 mulx 8($ap), %rax, %r9 - .byte 0x66,0x0f,0x6e,0xa5,0x00,0x00,0x00,0x00 # movd (%rbp), %xmm4 adcx %rax, %r8 adox %r10, %r9 mulx 16($ap), %rax, %r10 - movd 64(%rbp), %xmm5 - lea 128(%rbp), %rbp adcx %rax, %r9 adox %r11, %r10 .byte 0xc4,0x62,0xfb,0xf6,0x9e,0x18,0x00,0x00,0x00 # mulx 24($ap), %rax, %r11 - pslldq \$4, %xmm5 - por %xmm5, %xmm4 adcx %rax, %r10 adox %r12, %r11 @@ -1176,10 +1273,10 @@ .byte 0xc4,0x62,0xfb,0xf6,0xb6,0x30,0x00,0x00,0x00 # mulx 48($ap), %rax, %r14 adcx %rax, %r13 + .byte 0x67 adox %r15, %r14 mulx 56($ap), %rax, %r15 - movq %xmm4, %rdx mov %rbx, 64(%rsp,%rcx,8) adcx %rax, %r14 adox %rdi, %r15 @@ -1198,10 +1295,10 @@ mov %r14, 64+48(%rsp) mov %r15, 64+56(%rsp) - movq %xmm0, $out - movq %xmm1, %rbp + mov 128(%rsp), %rdx # pull arguments + mov 128+8(%rsp), $out + mov 128+16(%rsp), %rbp - mov 128(%rsp), %rdx # pull $n0 mov (%rsp), %r8 mov 8(%rsp), %r9 mov 16(%rsp), %r10 @@ -1229,6 +1326,21 @@ call __rsaz_512_subtract leaq 128+24+48(%rsp), %rax +___ +$code.=<<___ if ($win64); + movaps 0xa0-0xc8(%rax),%xmm6 + movaps 0xb0-0xc8(%rax),%xmm7 + movaps 0xc0-0xc8(%rax),%xmm8 + movaps 0xd0-0xc8(%rax),%xmm9 + movaps 0xe0-0xc8(%rax),%xmm10 + movaps 0xf0-0xc8(%rax),%xmm11 + movaps 0x100-0xc8(%rax),%xmm12 + movaps 0x110-0xc8(%rax),%xmm13 + movaps 0x120-0xc8(%rax),%xmm14 + movaps 0x130-0xc8(%rax),%xmm15 + lea 0xb0(%rax),%rax +___ +$code.=<<___; movq -48(%rax), %r15 movq -40(%rax), %r14 movq -32(%rax), %r13 @@ -1258,7 +1370,7 @@ mov $pwr, $pwr subq \$128+24, %rsp .Lmul_scatter4_body: - leaq ($tbl,$pwr,4), $tbl + leaq ($tbl,$pwr,8), $tbl movq $out, %xmm0 # off-load arguments movq $mod, %xmm1 movq $tbl, %xmm2 @@ -1329,30 +1441,14 @@ call __rsaz_512_subtract - movl %r8d, 64*0($inp) # scatter - shrq \$32, %r8 - movl %r9d, 64*2($inp) - shrq \$32, %r9 - movl %r10d, 64*4($inp) - shrq \$32, %r10 - movl %r11d, 64*6($inp) - shrq \$32, %r11 - movl %r12d, 64*8($inp) - shrq \$32, %r12 - movl %r13d, 64*10($inp) - shrq \$32, %r13 - movl %r14d, 64*12($inp) - shrq \$32, %r14 - movl %r15d, 64*14($inp) - shrq \$32, %r15 - movl %r8d, 64*1($inp) - movl %r9d, 64*3($inp) - movl %r10d, 64*5($inp) - movl %r11d, 64*7($inp) - movl %r12d, 64*9($inp) - movl %r13d, 64*11($inp) - movl %r14d, 64*13($inp) - movl %r15d, 64*15($inp) + movq %r8, 128*0($inp) # scatter + movq %r9, 128*1($inp) + movq %r10, 128*2($inp) + movq %r11, 128*3($inp) + movq %r12, 128*4($inp) + movq %r13, 128*5($inp) + movq %r14, 128*6($inp) + movq %r15, 128*7($inp) leaq 128+24+48(%rsp), %rax movq -48(%rax), %r15 @@ -1956,16 +2052,14 @@ .type rsaz_512_scatter4,\@abi-omnipotent .align 16 rsaz_512_scatter4: - leaq ($out,$power,4), $out + leaq ($out,$power,8), $out movl \$8, %r9d jmp .Loop_scatter .align 16 .Loop_scatter: movq ($inp), %rax leaq 8($inp), $inp - movl %eax, ($out) - shrq \$32, %rax - movl %eax, 64($out) + movq %rax, ($out) leaq 128($out), $out decl %r9d jnz .Loop_scatter @@ -1976,22 +2070,106 @@ .type rsaz_512_gather4,\@abi-omnipotent .align 16 rsaz_512_gather4: - leaq ($inp,$power,4), $inp +___ +$code.=<<___ if ($win64); +.LSEH_begin_rsaz_512_gather4: + .byte 0x48,0x81,0xec,0xa8,0x00,0x00,0x00 # sub $0xa8,%rsp + .byte 0x0f,0x29,0x34,0x24 # movaps %xmm6,(%rsp) + .byte 0x0f,0x29,0x7c,0x24,0x10 # movaps %xmm7,0x10(%rsp) + .byte 0x44,0x0f,0x29,0x44,0x24,0x20 # movaps %xmm8,0x20(%rsp) + .byte 0x44,0x0f,0x29,0x4c,0x24,0x30 # movaps %xmm9,0x30(%rsp) + .byte 0x44,0x0f,0x29,0x54,0x24,0x40 # movaps %xmm10,0x40(%rsp) + .byte 0x44,0x0f,0x29,0x5c,0x24,0x50 # movaps %xmm11,0x50(%rsp) + .byte 0x44,0x0f,0x29,0x64,0x24,0x60 # movaps %xmm12,0x60(%rsp) + .byte 0x44,0x0f,0x29,0x6c,0x24,0x70 # movaps %xmm13,0x70(%rsp) + .byte 0x44,0x0f,0x29,0xb4,0x24,0x80,0,0,0 # movaps %xmm14,0x80(%rsp) + .byte 0x44,0x0f,0x29,0xbc,0x24,0x90,0,0,0 # movaps %xmm15,0x90(%rsp) +___ +$code.=<<___; + movd $power,%xmm8 + movdqa .Linc+16(%rip),%xmm1 # 00000002000000020000000200000002 + movdqa .Linc(%rip),%xmm0 # 00000001000000010000000000000000 + + pshufd \$0,%xmm8,%xmm8 # broadcast $power + movdqa %xmm1,%xmm7 + movdqa %xmm1,%xmm2 +___ +######################################################################## +# calculate mask by comparing 0..15 to $power +# +for($i=0;$i<4;$i++) { +$code.=<<___; + paddd %xmm`$i`,%xmm`$i+1` + pcmpeqd %xmm8,%xmm`$i` + movdqa %xmm7,%xmm`$i+3` +___ +} +for(;$i<7;$i++) { +$code.=<<___; + paddd %xmm`$i`,%xmm`$i+1` + pcmpeqd %xmm8,%xmm`$i` +___ +} +$code.=<<___; + pcmpeqd %xmm8,%xmm7 movl \$8, %r9d jmp .Loop_gather .align 16 .Loop_gather: - movl ($inp), %eax - movl 64($inp), %r8d + movdqa 16*0($inp),%xmm8 + movdqa 16*1($inp),%xmm9 + movdqa 16*2($inp),%xmm10 + movdqa 16*3($inp),%xmm11 + pand %xmm0,%xmm8 + movdqa 16*4($inp),%xmm12 + pand %xmm1,%xmm9 + movdqa 16*5($inp),%xmm13 + pand %xmm2,%xmm10 + movdqa 16*6($inp),%xmm14 + pand %xmm3,%xmm11 + movdqa 16*7($inp),%xmm15 leaq 128($inp), $inp - shlq \$32, %r8 - or %r8, %rax - movq %rax, ($out) + pand %xmm4,%xmm12 + pand %xmm5,%xmm13 + pand %xmm6,%xmm14 + pand %xmm7,%xmm15 + por %xmm10,%xmm8 + por %xmm11,%xmm9 + por %xmm12,%xmm8 + por %xmm13,%xmm9 + por %xmm14,%xmm8 + por %xmm15,%xmm9 + + por %xmm9,%xmm8 + pshufd \$0x4e,%xmm8,%xmm9 + por %xmm9,%xmm8 + movq %xmm8,($out) leaq 8($out), $out decl %r9d jnz .Loop_gather +___ +$code.=<<___ if ($win64); + movaps 0x00(%rsp),%xmm6 + movaps 0x10(%rsp),%xmm7 + movaps 0x20(%rsp),%xmm8 + movaps 0x30(%rsp),%xmm9 + movaps 0x40(%rsp),%xmm10 + movaps 0x50(%rsp),%xmm11 + movaps 0x60(%rsp),%xmm12 + movaps 0x70(%rsp),%xmm13 + movaps 0x80(%rsp),%xmm14 + movaps 0x90(%rsp),%xmm15 + add \$0xa8,%rsp +___ +$code.=<<___; ret +.LSEH_end_rsaz_512_gather4: .size rsaz_512_gather4,.-rsaz_512_gather4 + +.align 64 +.Linc: + .long 0,0, 1,1 + .long 2,2, 2,2 ___ } @@ -2039,6 +2217,18 @@ lea 128+24+48(%rax),%rax + lea .Lmul_gather4_epilogue(%rip),%rbx + cmp %r10,%rbx + jne .Lse_not_in_mul_gather4 + + lea 0xb0(%rax),%rax + + lea -48-0xa8(%rax),%rsi + lea 512($context),%rdi + mov \$20,%ecx + .long 0xa548f3fc # cld; rep movsq + +.Lse_not_in_mul_gather4: mov -8(%rax),%rbx mov -16(%rax),%rbp mov -24(%rax),%r12 @@ -2090,7 +2280,7 @@ pop %rdi pop %rsi ret -.size sqr_handler,.-sqr_handler +.size se_handler,.-se_handler .section .pdata .align 4 @@ -2114,6 +2304,10 @@ .rva .LSEH_end_rsaz_512_mul_by_one .rva .LSEH_info_rsaz_512_mul_by_one + .rva .LSEH_begin_rsaz_512_gather4 + .rva .LSEH_end_rsaz_512_gather4 + .rva .LSEH_info_rsaz_512_gather4 + .section .xdata .align 8 .LSEH_info_rsaz_512_sqr: @@ -2136,6 +2330,19 @@ .byte 9,0,0,0 .rva se_handler .rva .Lmul_by_one_body,.Lmul_by_one_epilogue # HandlerData[] +.LSEH_info_rsaz_512_gather4: + .byte 0x01,0x46,0x16,0x00 + .byte 0x46,0xf8,0x09,0x00 # vmovaps 0x90(rsp),xmm15 + .byte 0x3d,0xe8,0x08,0x00 # vmovaps 0x80(rsp),xmm14 + .byte 0x34,0xd8,0x07,0x00 # vmovaps 0x70(rsp),xmm13 + .byte 0x2e,0xc8,0x06,0x00 # vmovaps 0x60(rsp),xmm12 + .byte 0x28,0xb8,0x05,0x00 # vmovaps 0x50(rsp),xmm11 + .byte 0x22,0xa8,0x04,0x00 # vmovaps 0x40(rsp),xmm10 + .byte 0x1c,0x98,0x03,0x00 # vmovaps 0x30(rsp),xmm9 + .byte 0x16,0x88,0x02,0x00 # vmovaps 0x20(rsp),xmm8 + .byte 0x10,0x78,0x01,0x00 # vmovaps 0x10(rsp),xmm7 + .byte 0x0b,0x68,0x00,0x00 # vmovaps 0x00(rsp),xmm6 + .byte 0x07,0x01,0x15,0x00 # sub rsp,0xa8 ___ } diff --git a/deps/openssl/openssl/crypto/bn/asm/s390x-gf2m.pl b/deps/openssl/openssl/crypto/bn/asm/s390x-gf2m.pl index cd9f13eca29265..9d18d40e778467 100644 --- a/deps/openssl/openssl/crypto/bn/asm/s390x-gf2m.pl +++ b/deps/openssl/openssl/crypto/bn/asm/s390x-gf2m.pl @@ -172,19 +172,19 @@ if ($SIZE_T==8) { my @r=map("%r$_",(6..9)); $code.=<<___; - bras $ra,_mul_1x1 # a1�b1 + bras $ra,_mul_1x1 # a1·b1 stmg $lo,$hi,16($rp) lg $a,`$stdframe+128+4*$SIZE_T`($sp) lg $b,`$stdframe+128+6*$SIZE_T`($sp) - bras $ra,_mul_1x1 # a0�b0 + bras $ra,_mul_1x1 # a0·b0 stmg $lo,$hi,0($rp) lg $a,`$stdframe+128+3*$SIZE_T`($sp) lg $b,`$stdframe+128+5*$SIZE_T`($sp) xg $a,`$stdframe+128+4*$SIZE_T`($sp) xg $b,`$stdframe+128+6*$SIZE_T`($sp) - bras $ra,_mul_1x1 # (a0+a1)�(b0+b1) + bras $ra,_mul_1x1 # (a0+a1)·(b0+b1) lmg @r[0],@r[3],0($rp) xgr $lo,$hi diff --git a/deps/openssl/openssl/crypto/bn/asm/s390x.S b/deps/openssl/openssl/crypto/bn/asm/s390x.S index 43fcb79bc0119f..f5eebe413a28c3 100755 --- a/deps/openssl/openssl/crypto/bn/asm/s390x.S +++ b/deps/openssl/openssl/crypto/bn/asm/s390x.S @@ -18,71 +18,106 @@ .align 4 bn_mul_add_words: lghi zero,0 // zero = 0 - la %r1,0(%r2) // put rp aside - lghi %r2,0 // i=0; + la %r1,0(%r2) // put rp aside [to give way to] + lghi %r2,0 // return value ltgfr %r4,%r4 bler %r14 // if (len<=0) return 0; - stmg %r6,%r10,48(%r15) - lghi %r10,3 - lghi %r8,0 // carry = 0 - nr %r10,%r4 // len%4 + stmg %r6,%r13,48(%r15) + lghi %r2,3 + lghi %r12,0 // carry = 0 + slgr %r1,%r3 // rp-=ap + nr %r2,%r4 // len%4 sra %r4,2 // cnt=len/4 jz .Loop1_madd // carry is incidentally cleared if branch taken algr zero,zero // clear carry -.Loop4_madd: - lg %r7,0(%r2,%r3) // ap[i] + lg %r7,0(%r3) // ap[0] + lg %r9,8(%r3) // ap[1] mlgr %r6,%r5 // *=w - alcgr %r7,%r8 // +=carry - alcgr %r6,zero - alg %r7,0(%r2,%r1) // +=rp[i] - stg %r7,0(%r2,%r1) // rp[i]= + brct %r4,.Loop4_madd + j .Loop4_madd_tail - lg %r9,8(%r2,%r3) +.Loop4_madd: mlgr %r8,%r5 + lg %r11,16(%r3) // ap[i+2] + alcgr %r7,%r12 // +=carry + alcgr %r6,zero + alg %r7,0(%r3,%r1) // +=rp[i] + stg %r7,0(%r3,%r1) // rp[i]= + + mlgr %r10,%r5 + lg %r13,24(%r3) alcgr %r9,%r6 alcgr %r8,zero - alg %r9,8(%r2,%r1) - stg %r9,8(%r2,%r1) + alg %r9,8(%r3,%r1) + stg %r9,8(%r3,%r1) + + mlgr %r12,%r5 + lg %r7,32(%r3) + alcgr %r11,%r8 + alcgr %r10,zero + alg %r11,16(%r3,%r1) + stg %r11,16(%r3,%r1) - lg %r7,16(%r2,%r3) mlgr %r6,%r5 - alcgr %r7,%r8 - alcgr %r6,zero - alg %r7,16(%r2,%r1) - stg %r7,16(%r2,%r1) + lg %r9,40(%r3) + alcgr %r13,%r10 + alcgr %r12,zero + alg %r13,24(%r3,%r1) + stg %r13,24(%r3,%r1) - lg %r9,24(%r2,%r3) + la %r3,32(%r3) // i+=4 + brct %r4,.Loop4_madd + +.Loop4_madd_tail: mlgr %r8,%r5 + lg %r11,16(%r3) + alcgr %r7,%r12 // +=carry + alcgr %r6,zero + alg %r7,0(%r3,%r1) // +=rp[i] + stg %r7,0(%r3,%r1) // rp[i]= + + mlgr %r10,%r5 + lg %r13,24(%r3) alcgr %r9,%r6 alcgr %r8,zero - alg %r9,24(%r2,%r1) - stg %r9,24(%r2,%r1) + alg %r9,8(%r3,%r1) + stg %r9,8(%r3,%r1) - la %r2,32(%r2) // i+=4 - brct %r4,.Loop4_madd + mlgr %r12,%r5 + alcgr %r11,%r8 + alcgr %r10,zero + alg %r11,16(%r3,%r1) + stg %r11,16(%r3,%r1) - la %r10,1(%r10) // see if len%4 is zero ... - brct %r10,.Loop1_madd // without touching condition code:-) + alcgr %r13,%r10 + alcgr %r12,zero + alg %r13,24(%r3,%r1) + stg %r13,24(%r3,%r1) + + la %r3,32(%r3) // i+=4 + + la %r2,1(%r2) // see if len%4 is zero ... + brct %r2,.Loop1_madd // without touching condition code:-) .Lend_madd: - alcgr %r8,zero // collect carry bit - lgr %r2,%r8 - lmg %r6,%r10,48(%r15) + lgr %r2,zero // return value + alcgr %r2,%r12 // collect even carry bit + lmg %r6,%r13,48(%r15) br %r14 .Loop1_madd: - lg %r7,0(%r2,%r3) // ap[i] + lg %r7,0(%r3) // ap[i] mlgr %r6,%r5 // *=w - alcgr %r7,%r8 // +=carry + alcgr %r7,%r12 // +=carry alcgr %r6,zero - alg %r7,0(%r2,%r1) // +=rp[i] - stg %r7,0(%r2,%r1) // rp[i]= + alg %r7,0(%r3,%r1) // +=rp[i] + stg %r7,0(%r3,%r1) // rp[i]= - lgr %r8,%r6 - la %r2,8(%r2) // i++ - brct %r10,.Loop1_madd + lgr %r12,%r6 + la %r3,8(%r3) // i++ + brct %r2,.Loop1_madd j .Lend_madd .size bn_mul_add_words,.-bn_mul_add_words diff --git a/deps/openssl/openssl/crypto/bn/asm/x86-gf2m.pl b/deps/openssl/openssl/crypto/bn/asm/x86-gf2m.pl index 808a1e59691de3..b57953027298f3 100644 --- a/deps/openssl/openssl/crypto/bn/asm/x86-gf2m.pl +++ b/deps/openssl/openssl/crypto/bn/asm/x86-gf2m.pl @@ -14,7 +14,7 @@ # the time being... Except that it has three code paths: pure integer # code suitable for any x86 CPU, MMX code suitable for PIII and later # and PCLMULQDQ suitable for Westmere and later. Improvement varies -# from one benchmark and �-arch to another. Below are interval values +# from one benchmark and µ-arch to another. Below are interval values # for 163- and 571-bit ECDH benchmarks relative to compiler-generated # code: # @@ -226,22 +226,22 @@ &push ("edi"); &mov ($a,&wparam(1)); &mov ($b,&wparam(3)); - &call ("_mul_1x1_mmx"); # a1�b1 + &call ("_mul_1x1_mmx"); # a1·b1 &movq ("mm7",$R); &mov ($a,&wparam(2)); &mov ($b,&wparam(4)); - &call ("_mul_1x1_mmx"); # a0�b0 + &call ("_mul_1x1_mmx"); # a0·b0 &movq ("mm6",$R); &mov ($a,&wparam(1)); &mov ($b,&wparam(3)); &xor ($a,&wparam(2)); &xor ($b,&wparam(4)); - &call ("_mul_1x1_mmx"); # (a0+a1)�(b0+b1) + &call ("_mul_1x1_mmx"); # (a0+a1)·(b0+b1) &pxor ($R,"mm7"); &mov ($a,&wparam(0)); - &pxor ($R,"mm6"); # (a0+a1)�(b0+b1)-a1�b1-a0�b0 + &pxor ($R,"mm6"); # (a0+a1)·(b0+b1)-a1·b1-a0·b0 &movq ($A,$R); &psllq ($R,32); @@ -266,13 +266,13 @@ &mov ($a,&wparam(1)); &mov ($b,&wparam(3)); - &call ("_mul_1x1_ialu"); # a1�b1 + &call ("_mul_1x1_ialu"); # a1·b1 &mov (&DWP(8,"esp"),$lo); &mov (&DWP(12,"esp"),$hi); &mov ($a,&wparam(2)); &mov ($b,&wparam(4)); - &call ("_mul_1x1_ialu"); # a0�b0 + &call ("_mul_1x1_ialu"); # a0·b0 &mov (&DWP(0,"esp"),$lo); &mov (&DWP(4,"esp"),$hi); @@ -280,7 +280,7 @@ &mov ($b,&wparam(3)); &xor ($a,&wparam(2)); &xor ($b,&wparam(4)); - &call ("_mul_1x1_ialu"); # (a0+a1)�(b0+b1) + &call ("_mul_1x1_ialu"); # (a0+a1)·(b0+b1) &mov ("ebp",&wparam(0)); @r=("ebx","ecx","edi","esi"); diff --git a/deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c b/deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c index d5488866e0cfd4..d77dc433d40555 100644 --- a/deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c +++ b/deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c @@ -65,7 +65,7 @@ # undef mul_add /*- - * "m"(a), "+m"(r) is the way to favor DirectPath �-code; + * "m"(a), "+m"(r) is the way to favor DirectPath µ-code; * "g"(0) let the compiler to decide where does it * want to keep the value of zero; */ diff --git a/deps/openssl/openssl/crypto/bn/asm/x86_64-gf2m.pl b/deps/openssl/openssl/crypto/bn/asm/x86_64-gf2m.pl index 226c66c35e3557..42bbec2fb7ef72 100644 --- a/deps/openssl/openssl/crypto/bn/asm/x86_64-gf2m.pl +++ b/deps/openssl/openssl/crypto/bn/asm/x86_64-gf2m.pl @@ -13,7 +13,7 @@ # in bn_gf2m.c. It's kind of low-hanging mechanical port from C for # the time being... Except that it has two code paths: code suitable # for any x86_64 CPU and PCLMULQDQ one suitable for Westmere and -# later. Improvement varies from one benchmark and �-arch to another. +# later. Improvement varies from one benchmark and µ-arch to another. # Vanilla code path is at most 20% faster than compiler-generated code # [not very impressive], while PCLMULQDQ - whole 85%-160% better on # 163- and 571-bit ECDH benchmarks on Intel CPUs. Keep in mind that @@ -184,13 +184,13 @@ $code.=<<___; movdqa %xmm0,%xmm4 movdqa %xmm1,%xmm5 - pclmulqdq \$0,%xmm1,%xmm0 # a1�b1 + pclmulqdq \$0,%xmm1,%xmm0 # a1·b1 pxor %xmm2,%xmm4 pxor %xmm3,%xmm5 - pclmulqdq \$0,%xmm3,%xmm2 # a0�b0 - pclmulqdq \$0,%xmm5,%xmm4 # (a0+a1)�(b0+b1) + pclmulqdq \$0,%xmm3,%xmm2 # a0·b0 + pclmulqdq \$0,%xmm5,%xmm4 # (a0+a1)·(b0+b1) xorps %xmm0,%xmm4 - xorps %xmm2,%xmm4 # (a0+a1)�(b0+b1)-a0�b0-a1�b1 + xorps %xmm2,%xmm4 # (a0+a1)·(b0+b1)-a0·b0-a1·b1 movdqa %xmm4,%xmm5 pslldq \$8,%xmm4 psrldq \$8,%xmm5 @@ -225,13 +225,13 @@ mov \$0xf,$mask mov $a1,$a mov $b1,$b - call _mul_1x1 # a1�b1 + call _mul_1x1 # a1·b1 mov $lo,16(%rsp) mov $hi,24(%rsp) mov 48(%rsp),$a mov 64(%rsp),$b - call _mul_1x1 # a0�b0 + call _mul_1x1 # a0·b0 mov $lo,0(%rsp) mov $hi,8(%rsp) @@ -239,7 +239,7 @@ mov 56(%rsp),$b xor 48(%rsp),$a xor 64(%rsp),$b - call _mul_1x1 # (a0+a1)�(b0+b1) + call _mul_1x1 # (a0+a1)·(b0+b1) ___ @r=("%rbx","%rcx","%rdi","%rsi"); $code.=<<___; diff --git a/deps/openssl/openssl/crypto/bn/asm/x86_64-mont.pl b/deps/openssl/openssl/crypto/bn/asm/x86_64-mont.pl index 2989b58f256eaa..29ba1224e36b5e 100755 --- a/deps/openssl/openssl/crypto/bn/asm/x86_64-mont.pl +++ b/deps/openssl/openssl/crypto/bn/asm/x86_64-mont.pl @@ -68,6 +68,11 @@ $addx = ($1>=12); } +if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([3-9])\.([0-9]+)/) { + my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10 + $addx = ($ver>=3.03); +} + # int bn_mul_mont( $rp="%rdi"; # BN_ULONG *rp, $ap="%rsi"; # const BN_ULONG *ap, @@ -770,100 +775,126 @@ # 4096. this is done to allow memory disambiguation logic # do its job. # - lea -64(%rsp,$num,4),%r11 + lea -64(%rsp,$num,2),%r11 mov ($n0),$n0 # *n0 sub $aptr,%r11 and \$4095,%r11 cmp %r11,%r10 jb .Lsqr8x_sp_alt sub %r11,%rsp # align with $aptr - lea -64(%rsp,$num,4),%rsp # alloca(frame+4*$num) + lea -64(%rsp,$num,2),%rsp # alloca(frame+2*$num) jmp .Lsqr8x_sp_done .align 32 .Lsqr8x_sp_alt: - lea 4096-64(,$num,4),%r10 # 4096-frame-4*$num - lea -64(%rsp,$num,4),%rsp # alloca(frame+4*$num) + lea 4096-64(,$num,2),%r10 # 4096-frame-2*$num + lea -64(%rsp,$num,2),%rsp # alloca(frame+2*$num) sub %r10,%r11 mov \$0,%r10 cmovc %r10,%r11 sub %r11,%rsp .Lsqr8x_sp_done: and \$-64,%rsp - mov $num,%r10 + mov $num,%r10 neg $num - lea 64(%rsp,$num,2),%r11 # copy of modulus mov $n0, 32(%rsp) mov %rax, 40(%rsp) # save original %rsp .Lsqr8x_body: - mov $num,$i - movq %r11, %xmm2 # save pointer to modulus copy - shr \$3+2,$i - mov OPENSSL_ia32cap_P+8(%rip),%eax - jmp .Lsqr8x_copy_n - -.align 32 -.Lsqr8x_copy_n: - movq 8*0($nptr),%xmm0 - movq 8*1($nptr),%xmm1 - movq 8*2($nptr),%xmm3 - movq 8*3($nptr),%xmm4 - lea 8*4($nptr),$nptr - movdqa %xmm0,16*0(%r11) - movdqa %xmm1,16*1(%r11) - movdqa %xmm3,16*2(%r11) - movdqa %xmm4,16*3(%r11) - lea 16*4(%r11),%r11 - dec $i - jnz .Lsqr8x_copy_n - + movq $nptr, %xmm2 # save pointer to modulus pxor %xmm0,%xmm0 movq $rptr,%xmm1 # save $rptr movq %r10, %xmm3 # -$num ___ $code.=<<___ if ($addx); + mov OPENSSL_ia32cap_P+8(%rip),%eax and \$0x80100,%eax cmp \$0x80100,%eax jne .Lsqr8x_nox call bn_sqrx8x_internal # see x86_64-mont5 module - - pxor %xmm0,%xmm0 - lea 48(%rsp),%rax - lea 64(%rsp,$num,2),%rdx - shr \$3+2,$num - mov 40(%rsp),%rsi # restore %rsp - jmp .Lsqr8x_zero + # %rax top-most carry + # %rbp nptr + # %rcx -8*num + # %r8 end of tp[2*num] + lea (%r8,%rcx),%rbx + mov %rcx,$num + mov %rcx,%rdx + movq %xmm1,$rptr + sar \$3+2,%rcx # %cf=0 + jmp .Lsqr8x_sub .align 32 .Lsqr8x_nox: ___ $code.=<<___; call bn_sqr8x_internal # see x86_64-mont5 module + # %rax top-most carry + # %rbp nptr + # %r8 -8*num + # %rdi end of tp[2*num] + lea (%rdi,$num),%rbx + mov $num,%rcx + mov $num,%rdx + movq %xmm1,$rptr + sar \$3+2,%rcx # %cf=0 + jmp .Lsqr8x_sub +.align 32 +.Lsqr8x_sub: + mov 8*0(%rbx),%r12 + mov 8*1(%rbx),%r13 + mov 8*2(%rbx),%r14 + mov 8*3(%rbx),%r15 + lea 8*4(%rbx),%rbx + sbb 8*0(%rbp),%r12 + sbb 8*1(%rbp),%r13 + sbb 8*2(%rbp),%r14 + sbb 8*3(%rbp),%r15 + lea 8*4(%rbp),%rbp + mov %r12,8*0($rptr) + mov %r13,8*1($rptr) + mov %r14,8*2($rptr) + mov %r15,8*3($rptr) + lea 8*4($rptr),$rptr + inc %rcx # preserves %cf + jnz .Lsqr8x_sub + + sbb \$0,%rax # top-most carry + lea (%rbx,$num),%rbx # rewind + lea ($rptr,$num),$rptr # rewind + + movq %rax,%xmm1 pxor %xmm0,%xmm0 - lea 48(%rsp),%rax - lea 64(%rsp,$num,2),%rdx - shr \$3+2,$num + pshufd \$0,%xmm1,%xmm1 mov 40(%rsp),%rsi # restore %rsp - jmp .Lsqr8x_zero + jmp .Lsqr8x_cond_copy .align 32 -.Lsqr8x_zero: - movdqa %xmm0,16*0(%rax) # wipe t - movdqa %xmm0,16*1(%rax) - movdqa %xmm0,16*2(%rax) - movdqa %xmm0,16*3(%rax) - lea 16*4(%rax),%rax - movdqa %xmm0,16*0(%rdx) # wipe n - movdqa %xmm0,16*1(%rdx) - movdqa %xmm0,16*2(%rdx) - movdqa %xmm0,16*3(%rdx) - lea 16*4(%rdx),%rdx - dec $num - jnz .Lsqr8x_zero +.Lsqr8x_cond_copy: + movdqa 16*0(%rbx),%xmm2 + movdqa 16*1(%rbx),%xmm3 + lea 16*2(%rbx),%rbx + movdqu 16*0($rptr),%xmm4 + movdqu 16*1($rptr),%xmm5 + lea 16*2($rptr),$rptr + movdqa %xmm0,-16*2(%rbx) # zero tp + movdqa %xmm0,-16*1(%rbx) + movdqa %xmm0,-16*2(%rbx,%rdx) + movdqa %xmm0,-16*1(%rbx,%rdx) + pcmpeqd %xmm1,%xmm0 + pand %xmm1,%xmm2 + pand %xmm1,%xmm3 + pand %xmm0,%xmm4 + pand %xmm0,%xmm5 + pxor %xmm0,%xmm0 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqu %xmm4,-16*2($rptr) + movdqu %xmm5,-16*1($rptr) + add \$32,$num + jnz .Lsqr8x_cond_copy mov \$1,%rax mov -48(%rsi),%r15 @@ -1130,64 +1161,75 @@ adc $zero,%r15 # modulo-scheduled sub 0*8($tptr),$zero # pull top-most carry adc %r15,%r14 - mov -8($nptr),$mi sbb %r15,%r15 # top-most carry mov %r14,-1*8($tptr) cmp 16(%rsp),$bptr jne .Lmulx4x_outer - sub %r14,$mi # compare top-most words - sbb $mi,$mi - or $mi,%r15 - - neg $num - xor %rdx,%rdx + lea 64(%rsp),$tptr + sub $num,$nptr # rewind $nptr + neg %r15 + mov $num,%rdx + shr \$3+2,$num # %cf=0 mov 32(%rsp),$rptr # restore rp + jmp .Lmulx4x_sub + +.align 32 +.Lmulx4x_sub: + mov 8*0($tptr),%r11 + mov 8*1($tptr),%r12 + mov 8*2($tptr),%r13 + mov 8*3($tptr),%r14 + lea 8*4($tptr),$tptr + sbb 8*0($nptr),%r11 + sbb 8*1($nptr),%r12 + sbb 8*2($nptr),%r13 + sbb 8*3($nptr),%r14 + lea 8*4($nptr),$nptr + mov %r11,8*0($rptr) + mov %r12,8*1($rptr) + mov %r13,8*2($rptr) + mov %r14,8*3($rptr) + lea 8*4($rptr),$rptr + dec $num # preserves %cf + jnz .Lmulx4x_sub + + sbb \$0,%r15 # top-most carry lea 64(%rsp),$tptr + sub %rdx,$rptr # rewind + movq %r15,%xmm1 pxor %xmm0,%xmm0 - mov 0*8($nptr,$num),%r8 - mov 1*8($nptr,$num),%r9 - neg %r8 - jmp .Lmulx4x_sub_entry + pshufd \$0,%xmm1,%xmm1 + mov 40(%rsp),%rsi # restore %rsp + jmp .Lmulx4x_cond_copy .align 32 -.Lmulx4x_sub: - mov 0*8($nptr,$num),%r8 - mov 1*8($nptr,$num),%r9 - not %r8 -.Lmulx4x_sub_entry: - mov 2*8($nptr,$num),%r10 - not %r9 - and %r15,%r8 - mov 3*8($nptr,$num),%r11 - not %r10 - and %r15,%r9 - not %r11 - and %r15,%r10 - and %r15,%r11 - - neg %rdx # mov %rdx,%cf - adc 0*8($tptr),%r8 - adc 1*8($tptr),%r9 - movdqa %xmm0,($tptr) - adc 2*8($tptr),%r10 - adc 3*8($tptr),%r11 - movdqa %xmm0,16($tptr) - lea 4*8($tptr),$tptr - sbb %rdx,%rdx # mov %cf,%rdx - - mov %r8,0*8($rptr) - mov %r9,1*8($rptr) - mov %r10,2*8($rptr) - mov %r11,3*8($rptr) - lea 4*8($rptr),$rptr +.Lmulx4x_cond_copy: + movdqa 16*0($tptr),%xmm2 + movdqa 16*1($tptr),%xmm3 + lea 16*2($tptr),$tptr + movdqu 16*0($rptr),%xmm4 + movdqu 16*1($rptr),%xmm5 + lea 16*2($rptr),$rptr + movdqa %xmm0,-16*2($tptr) # zero tp + movdqa %xmm0,-16*1($tptr) + pcmpeqd %xmm1,%xmm0 + pand %xmm1,%xmm2 + pand %xmm1,%xmm3 + pand %xmm0,%xmm4 + pand %xmm0,%xmm5 + pxor %xmm0,%xmm0 + por %xmm2,%xmm4 + por %xmm3,%xmm5 + movdqu %xmm4,-16*2($rptr) + movdqu %xmm5,-16*1($rptr) + sub \$32,%rdx + jnz .Lmulx4x_cond_copy - add \$32,$num - jnz .Lmulx4x_sub + mov %rdx,($tptr) - mov 40(%rsp),%rsi # restore %rsp mov \$1,%rax mov -48(%rsi),%r15 mov -40(%rsi),%r14 diff --git a/deps/openssl/openssl/crypto/bn/asm/x86_64-mont5.pl b/deps/openssl/openssl/crypto/bn/asm/x86_64-mont5.pl index 820de3d6f6270b..2e8c9db32cbc13 100755 --- a/deps/openssl/openssl/crypto/bn/asm/x86_64-mont5.pl +++ b/deps/openssl/openssl/crypto/bn/asm/x86_64-mont5.pl @@ -53,6 +53,11 @@ $addx = ($1>=12); } +if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([3-9])\.([0-9]+)/) { + my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10 + $addx = ($ver>=3.03); +} + # int bn_mul_mont_gather5( $rp="%rdi"; # BN_ULONG *rp, $ap="%rsi"; # const BN_ULONG *ap, @@ -94,58 +99,111 @@ .Lmul_enter: mov ${num}d,${num}d mov %rsp,%rax - mov `($win64?56:8)`(%rsp),%r10d # load 7th argument + movd `($win64?56:8)`(%rsp),%xmm5 # load 7th argument + lea .Linc(%rip),%r10 push %rbx push %rbp push %r12 push %r13 push %r14 push %r15 -___ -$code.=<<___ if ($win64); - lea -0x28(%rsp),%rsp - movaps %xmm6,(%rsp) - movaps %xmm7,0x10(%rsp) -___ -$code.=<<___; + lea 2($num),%r11 neg %r11 - lea (%rsp,%r11,8),%rsp # tp=alloca(8*(num+2)) + lea -264(%rsp,%r11,8),%rsp # tp=alloca(8*(num+2)+256+8) and \$-1024,%rsp # minimize TLB usage mov %rax,8(%rsp,$num,8) # tp[num+1]=%rsp .Lmul_body: - mov $bp,%r12 # reassign $bp + lea 128($bp),%r12 # reassign $bp (+size optimization) ___ $bp="%r12"; $STRIDE=2**5*8; # 5 is "window size" $N=$STRIDE/4; # should match cache line size $code.=<<___; - mov %r10,%r11 - shr \$`log($N/8)/log(2)`,%r10 - and \$`$N/8-1`,%r11 - not %r10 - lea .Lmagic_masks(%rip),%rax - and \$`2**5/($N/8)-1`,%r10 # 5 is "window size" - lea 96($bp,%r11,8),$bp # pointer within 1st cache line - movq 0(%rax,%r10,8),%xmm4 # set of masks denoting which - movq 8(%rax,%r10,8),%xmm5 # cache line contains element - movq 16(%rax,%r10,8),%xmm6 # denoted by 7th argument - movq 24(%rax,%r10,8),%xmm7 - - movq `0*$STRIDE/4-96`($bp),%xmm0 - movq `1*$STRIDE/4-96`($bp),%xmm1 - pand %xmm4,%xmm0 - movq `2*$STRIDE/4-96`($bp),%xmm2 - pand %xmm5,%xmm1 - movq `3*$STRIDE/4-96`($bp),%xmm3 - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 + movdqa 0(%r10),%xmm0 # 00000001000000010000000000000000 + movdqa 16(%r10),%xmm1 # 00000002000000020000000200000002 + lea 24-112(%rsp,$num,8),%r10# place the mask after tp[num+3] (+ICache optimization) + and \$-16,%r10 + + pshufd \$0,%xmm5,%xmm5 # broadcast index + movdqa %xmm1,%xmm4 + movdqa %xmm1,%xmm2 +___ +######################################################################## +# calculate mask by comparing 0..31 to index and save result to stack +# +$code.=<<___; + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 # compare to 1,0 + .byte 0x67 + movdqa %xmm4,%xmm3 +___ +for($k=0;$k<$STRIDE/16-4;$k+=4) { +$code.=<<___; + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 # compare to 3,2 + movdqa %xmm0,`16*($k+0)+112`(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 # compare to 5,4 + movdqa %xmm1,`16*($k+1)+112`(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 # compare to 7,6 + movdqa %xmm2,`16*($k+2)+112`(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,`16*($k+3)+112`(%r10) + movdqa %xmm4,%xmm3 +___ +} +$code.=<<___; # last iteration can be optimized + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,`16*($k+0)+112`(%r10) + + paddd %xmm2,%xmm3 + .byte 0x67 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,`16*($k+1)+112`(%r10) + + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,`16*($k+2)+112`(%r10) + pand `16*($k+0)-128`($bp),%xmm0 # while it's still in register + + pand `16*($k+1)-128`($bp),%xmm1 + pand `16*($k+2)-128`($bp),%xmm2 + movdqa %xmm3,`16*($k+3)+112`(%r10) + pand `16*($k+3)-128`($bp),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 +___ +for($k=0;$k<$STRIDE/16-4;$k+=4) { +$code.=<<___; + movdqa `16*($k+0)-128`($bp),%xmm4 + movdqa `16*($k+1)-128`($bp),%xmm5 + movdqa `16*($k+2)-128`($bp),%xmm2 + pand `16*($k+0)+112`(%r10),%xmm4 + movdqa `16*($k+3)-128`($bp),%xmm3 + pand `16*($k+1)+112`(%r10),%xmm5 + por %xmm4,%xmm0 + pand `16*($k+2)+112`(%r10),%xmm2 + por %xmm5,%xmm1 + pand `16*($k+3)+112`(%r10),%xmm3 por %xmm2,%xmm0 + por %xmm3,%xmm1 +___ +} +$code.=<<___; + por %xmm1,%xmm0 + pshufd \$0x4e,%xmm0,%xmm1 + por %xmm1,%xmm0 lea $STRIDE($bp),$bp - por %xmm3,%xmm0 - movq %xmm0,$m0 # m0=bp[0] mov ($n0),$n0 # pull n0[0] value @@ -154,29 +212,14 @@ xor $i,$i # i=0 xor $j,$j # j=0 - movq `0*$STRIDE/4-96`($bp),%xmm0 - movq `1*$STRIDE/4-96`($bp),%xmm1 - pand %xmm4,%xmm0 - movq `2*$STRIDE/4-96`($bp),%xmm2 - pand %xmm5,%xmm1 - mov $n0,$m1 mulq $m0 # ap[0]*bp[0] mov %rax,$lo0 mov ($np),%rax - movq `3*$STRIDE/4-96`($bp),%xmm3 - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 - imulq $lo0,$m1 # "tp[0]"*n0 mov %rdx,$hi0 - por %xmm2,%xmm0 - lea $STRIDE($bp),$bp - por %xmm3,%xmm0 - mulq $m1 # np[0]*m1 add %rax,$lo0 # discarded mov 8($ap),%rax @@ -207,16 +250,14 @@ mulq $m1 # np[j]*m1 cmp $num,$j - jne .L1st - - movq %xmm0,$m0 # bp[1] + jne .L1st # note that upon exit $j==$num, so + # they can be used interchangeably add %rax,$hi1 - mov ($ap),%rax # ap[0] adc \$0,%rdx add $hi0,$hi1 # np[j]*m1+ap[j]*bp[0] adc \$0,%rdx - mov $hi1,-16(%rsp,$j,8) # tp[j-1] + mov $hi1,-16(%rsp,$num,8) # tp[num-1] mov %rdx,$hi1 mov $lo0,$hi0 @@ -230,33 +271,48 @@ jmp .Louter .align 16 .Louter: + lea 24+128(%rsp,$num,8),%rdx # where 256-byte mask is (+size optimization) + and \$-16,%rdx + pxor %xmm4,%xmm4 + pxor %xmm5,%xmm5 +___ +for($k=0;$k<$STRIDE/16;$k+=4) { +$code.=<<___; + movdqa `16*($k+0)-128`($bp),%xmm0 + movdqa `16*($k+1)-128`($bp),%xmm1 + movdqa `16*($k+2)-128`($bp),%xmm2 + movdqa `16*($k+3)-128`($bp),%xmm3 + pand `16*($k+0)-128`(%rdx),%xmm0 + pand `16*($k+1)-128`(%rdx),%xmm1 + por %xmm0,%xmm4 + pand `16*($k+2)-128`(%rdx),%xmm2 + por %xmm1,%xmm5 + pand `16*($k+3)-128`(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 +___ +} +$code.=<<___; + por %xmm5,%xmm4 + pshufd \$0x4e,%xmm4,%xmm0 + por %xmm4,%xmm0 + lea $STRIDE($bp),$bp + + mov ($ap),%rax # ap[0] + movq %xmm0,$m0 # m0=bp[i] + xor $j,$j # j=0 mov $n0,$m1 mov (%rsp),$lo0 - movq `0*$STRIDE/4-96`($bp),%xmm0 - movq `1*$STRIDE/4-96`($bp),%xmm1 - pand %xmm4,%xmm0 - movq `2*$STRIDE/4-96`($bp),%xmm2 - pand %xmm5,%xmm1 - mulq $m0 # ap[0]*bp[i] add %rax,$lo0 # ap[0]*bp[i]+tp[0] mov ($np),%rax adc \$0,%rdx - movq `3*$STRIDE/4-96`($bp),%xmm3 - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 - imulq $lo0,$m1 # tp[0]*n0 mov %rdx,$hi0 - por %xmm2,%xmm0 - lea $STRIDE($bp),$bp - por %xmm3,%xmm0 - mulq $m1 # np[0]*m1 add %rax,$lo0 # discarded mov 8($ap),%rax @@ -290,17 +346,14 @@ mulq $m1 # np[j]*m1 cmp $num,$j - jne .Linner - - movq %xmm0,$m0 # bp[i+1] - + jne .Linner # note that upon exit $j==$num, so + # they can be used interchangeably add %rax,$hi1 - mov ($ap),%rax # ap[0] adc \$0,%rdx add $lo0,$hi1 # np[j]*m1+ap[j]*bp[i]+tp[j] - mov (%rsp,$j,8),$lo0 + mov (%rsp,$num,8),$lo0 adc \$0,%rdx - mov $hi1,-16(%rsp,$j,8) # tp[j-1] + mov $hi1,-16(%rsp,$num,8) # tp[num-1] mov %rdx,$hi1 xor %rdx,%rdx @@ -347,12 +400,7 @@ mov 8(%rsp,$num,8),%rsi # restore %rsp mov \$1,%rax -___ -$code.=<<___ if ($win64); - movaps -88(%rsi),%xmm6 - movaps -72(%rsi),%xmm7 -___ -$code.=<<___; + mov -48(%rsi),%r15 mov -40(%rsi),%r14 mov -32(%rsi),%r13 @@ -374,8 +422,8 @@ .Lmul4x_enter: ___ $code.=<<___ if ($addx); - and \$0x80100,%r11d - cmp \$0x80100,%r11d + and \$0x80108,%r11d + cmp \$0x80108,%r11d # check for AD*X+BMI2+BMI1 je .Lmulx4x_enter ___ $code.=<<___; @@ -387,39 +435,34 @@ push %r13 push %r14 push %r15 -___ -$code.=<<___ if ($win64); - lea -0x28(%rsp),%rsp - movaps %xmm6,(%rsp) - movaps %xmm7,0x10(%rsp) -___ -$code.=<<___; + .byte 0x67 - mov ${num}d,%r10d - shl \$3,${num}d - shl \$3+2,%r10d # 4*$num + shl \$3,${num}d # convert $num to bytes + lea ($num,$num,2),%r10 # 3*$num in bytes neg $num # -$num ############################################################## - # ensure that stack frame doesn't alias with $aptr+4*$num - # modulo 4096, which covers ret[num], am[num] and n[2*num] - # (see bn_exp.c). this is done to allow memory disambiguation - # logic do its magic. [excessive frame is allocated in order - # to allow bn_from_mont8x to clear it.] + # Ensure that stack frame doesn't alias with $rptr+3*$num + # modulo 4096, which covers ret[num], am[num] and n[num] + # (see bn_exp.c). This is done to allow memory disambiguation + # logic do its magic. [Extra [num] is allocated in order + # to align with bn_power5's frame, which is cleansed after + # completing exponentiation. Extra 256 bytes is for power mask + # calculated from 7th argument, the index.] # - lea -64(%rsp,$num,2),%r11 - sub $ap,%r11 + lea -320(%rsp,$num,2),%r11 + sub $rp,%r11 and \$4095,%r11 cmp %r11,%r10 jb .Lmul4xsp_alt - sub %r11,%rsp # align with $ap - lea -64(%rsp,$num,2),%rsp # alloca(128+num*8) + sub %r11,%rsp # align with $rp + lea -320(%rsp,$num,2),%rsp # alloca(frame+2*num*8+256) jmp .Lmul4xsp_done .align 32 .Lmul4xsp_alt: - lea 4096-64(,$num,2),%r10 - lea -64(%rsp,$num,2),%rsp # alloca(128+num*8) + lea 4096-320(,$num,2),%r10 + lea -320(%rsp,$num,2),%rsp # alloca(frame+2*num*8+256) sub %r10,%r11 mov \$0,%r10 cmovc %r10,%r11 @@ -435,12 +478,7 @@ mov 40(%rsp),%rsi # restore %rsp mov \$1,%rax -___ -$code.=<<___ if ($win64); - movaps -88(%rsi),%xmm6 - movaps -72(%rsi),%xmm7 -___ -$code.=<<___; + mov -48(%rsi),%r15 mov -40(%rsi),%r14 mov -32(%rsi),%r13 @@ -455,9 +493,10 @@ .type mul4x_internal,\@abi-omnipotent .align 32 mul4x_internal: - shl \$5,$num - mov `($win64?56:8)`(%rax),%r10d # load 7th argument - lea 256(%rdx,$num),%r13 + shl \$5,$num # $num was in bytes + movd `($win64?56:8)`(%rax),%xmm5 # load 7th argument, index + lea .Linc(%rip),%rax + lea 128(%rdx,$num),%r13 # end of powers table (+size optimization) shr \$5,$num # restore $num ___ $bp="%r12"; @@ -465,44 +504,92 @@ $N=$STRIDE/4; # should match cache line size $tp=$i; $code.=<<___; - mov %r10,%r11 - shr \$`log($N/8)/log(2)`,%r10 - and \$`$N/8-1`,%r11 - not %r10 - lea .Lmagic_masks(%rip),%rax - and \$`2**5/($N/8)-1`,%r10 # 5 is "window size" - lea 96(%rdx,%r11,8),$bp # pointer within 1st cache line - movq 0(%rax,%r10,8),%xmm4 # set of masks denoting which - movq 8(%rax,%r10,8),%xmm5 # cache line contains element - add \$7,%r11 - movq 16(%rax,%r10,8),%xmm6 # denoted by 7th argument - movq 24(%rax,%r10,8),%xmm7 - and \$7,%r11 - - movq `0*$STRIDE/4-96`($bp),%xmm0 - lea $STRIDE($bp),$tp # borrow $tp - movq `1*$STRIDE/4-96`($bp),%xmm1 - pand %xmm4,%xmm0 - movq `2*$STRIDE/4-96`($bp),%xmm2 - pand %xmm5,%xmm1 - movq `3*$STRIDE/4-96`($bp),%xmm3 - pand %xmm6,%xmm2 - .byte 0x67 - por %xmm1,%xmm0 - movq `0*$STRIDE/4-96`($tp),%xmm1 - .byte 0x67 - pand %xmm7,%xmm3 - .byte 0x67 - por %xmm2,%xmm0 - movq `1*$STRIDE/4-96`($tp),%xmm2 + movdqa 0(%rax),%xmm0 # 00000001000000010000000000000000 + movdqa 16(%rax),%xmm1 # 00000002000000020000000200000002 + lea 88-112(%rsp,$num),%r10 # place the mask after tp[num+1] (+ICache optimization) + lea 128(%rdx),$bp # size optimization + + pshufd \$0,%xmm5,%xmm5 # broadcast index + movdqa %xmm1,%xmm4 + .byte 0x67,0x67 + movdqa %xmm1,%xmm2 +___ +######################################################################## +# calculate mask by comparing 0..31 to index and save result to stack +# +$code.=<<___; + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 # compare to 1,0 .byte 0x67 - pand %xmm4,%xmm1 + movdqa %xmm4,%xmm3 +___ +for($i=0;$i<$STRIDE/16-4;$i+=4) { +$code.=<<___; + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 # compare to 3,2 + movdqa %xmm0,`16*($i+0)+112`(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 # compare to 5,4 + movdqa %xmm1,`16*($i+1)+112`(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 # compare to 7,6 + movdqa %xmm2,`16*($i+2)+112`(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,`16*($i+3)+112`(%r10) + movdqa %xmm4,%xmm3 +___ +} +$code.=<<___; # last iteration can be optimized + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,`16*($i+0)+112`(%r10) + + paddd %xmm2,%xmm3 .byte 0x67 - por %xmm3,%xmm0 - movq `2*$STRIDE/4-96`($tp),%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,`16*($i+1)+112`(%r10) + + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,`16*($i+2)+112`(%r10) + pand `16*($i+0)-128`($bp),%xmm0 # while it's still in register + pand `16*($i+1)-128`($bp),%xmm1 + pand `16*($i+2)-128`($bp),%xmm2 + movdqa %xmm3,`16*($i+3)+112`(%r10) + pand `16*($i+3)-128`($bp),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 +___ +for($i=0;$i<$STRIDE/16-4;$i+=4) { +$code.=<<___; + movdqa `16*($i+0)-128`($bp),%xmm4 + movdqa `16*($i+1)-128`($bp),%xmm5 + movdqa `16*($i+2)-128`($bp),%xmm2 + pand `16*($i+0)+112`(%r10),%xmm4 + movdqa `16*($i+3)-128`($bp),%xmm3 + pand `16*($i+1)+112`(%r10),%xmm5 + por %xmm4,%xmm0 + pand `16*($i+2)+112`(%r10),%xmm2 + por %xmm5,%xmm1 + pand `16*($i+3)+112`(%r10),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 +___ +} +$code.=<<___; + por %xmm1,%xmm0 + pshufd \$0x4e,%xmm0,%xmm1 + por %xmm1,%xmm0 + lea $STRIDE($bp),$bp movq %xmm0,$m0 # m0=bp[0] - movq `3*$STRIDE/4-96`($tp),%xmm0 + mov %r13,16+8(%rsp) # save end of b[num] mov $rp, 56+8(%rsp) # save $rp @@ -516,26 +603,10 @@ mov %rax,$A[0] mov ($np),%rax - pand %xmm5,%xmm2 - pand %xmm6,%xmm3 - por %xmm2,%xmm1 - imulq $A[0],$m1 # "tp[0]"*n0 - ############################################################## - # $tp is chosen so that writing to top-most element of the - # vector occurs just "above" references to powers table, - # "above" modulo cache-line size, which effectively precludes - # possibility of memory disambiguation logic failure when - # accessing the table. - # - lea 64+8(%rsp,%r11,8),$tp + lea 64+8(%rsp),$tp mov %rdx,$A[1] - pand %xmm7,%xmm0 - por %xmm3,%xmm1 - lea 2*$STRIDE($bp),$bp - por %xmm1,%xmm0 - mulq $m1 # np[0]*m1 add %rax,$A[0] # discarded mov 8($ap,$num),%rax @@ -544,7 +615,7 @@ mulq $m0 add %rax,$A[1] - mov 16*1($np),%rax # interleaved with 0, therefore 16*n + mov 8*1($np),%rax adc \$0,%rdx mov %rdx,$A[0] @@ -554,7 +625,7 @@ adc \$0,%rdx add $A[1],$N[1] lea 4*8($num),$j # j=4 - lea 16*4($np),$np + lea 8*4($np),$np adc \$0,%rdx mov $N[1],($tp) mov %rdx,$N[0] @@ -564,7 +635,7 @@ .L1st4x: mulq $m0 # ap[j]*bp[0] add %rax,$A[0] - mov -16*2($np),%rax + mov -8*2($np),%rax lea 32($tp),$tp adc \$0,%rdx mov %rdx,$A[1] @@ -580,7 +651,7 @@ mulq $m0 # ap[j]*bp[0] add %rax,$A[1] - mov -16*1($np),%rax + mov -8*1($np),%rax adc \$0,%rdx mov %rdx,$A[0] @@ -595,7 +666,7 @@ mulq $m0 # ap[j]*bp[0] add %rax,$A[0] - mov 16*0($np),%rax + mov 8*0($np),%rax adc \$0,%rdx mov %rdx,$A[1] @@ -610,7 +681,7 @@ mulq $m0 # ap[j]*bp[0] add %rax,$A[1] - mov 16*1($np),%rax + mov 8*1($np),%rax adc \$0,%rdx mov %rdx,$A[0] @@ -619,7 +690,7 @@ mov 16($ap,$j),%rax adc \$0,%rdx add $A[1],$N[1] # np[j]*m1+ap[j]*bp[0] - lea 16*4($np),$np + lea 8*4($np),$np adc \$0,%rdx mov $N[1],($tp) # tp[j-1] mov %rdx,$N[0] @@ -629,7 +700,7 @@ mulq $m0 # ap[j]*bp[0] add %rax,$A[0] - mov -16*2($np),%rax + mov -8*2($np),%rax lea 32($tp),$tp adc \$0,%rdx mov %rdx,$A[1] @@ -645,7 +716,7 @@ mulq $m0 # ap[j]*bp[0] add %rax,$A[1] - mov -16*1($np),%rax + mov -8*1($np),%rax adc \$0,%rdx mov %rdx,$A[0] @@ -658,8 +729,7 @@ mov $N[1],-16($tp) # tp[j-1] mov %rdx,$N[0] - movq %xmm0,$m0 # bp[1] - lea ($np,$num,2),$np # rewind $np + lea ($np,$num),$np # rewind $np xor $N[1],$N[1] add $A[0],$N[0] @@ -670,6 +740,33 @@ .align 32 .Louter4x: + lea 16+128($tp),%rdx # where 256-byte mask is (+size optimization) + pxor %xmm4,%xmm4 + pxor %xmm5,%xmm5 +___ +for($i=0;$i<$STRIDE/16;$i+=4) { +$code.=<<___; + movdqa `16*($i+0)-128`($bp),%xmm0 + movdqa `16*($i+1)-128`($bp),%xmm1 + movdqa `16*($i+2)-128`($bp),%xmm2 + movdqa `16*($i+3)-128`($bp),%xmm3 + pand `16*($i+0)-128`(%rdx),%xmm0 + pand `16*($i+1)-128`(%rdx),%xmm1 + por %xmm0,%xmm4 + pand `16*($i+2)-128`(%rdx),%xmm2 + por %xmm1,%xmm5 + pand `16*($i+3)-128`(%rdx),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 +___ +} +$code.=<<___; + por %xmm5,%xmm4 + pshufd \$0x4e,%xmm4,%xmm0 + por %xmm4,%xmm0 + lea $STRIDE($bp),$bp + movq %xmm0,$m0 # m0=bp[i] + mov ($tp,$num),$A[0] mov $n0,$m1 mulq $m0 # ap[0]*bp[i] @@ -677,25 +774,11 @@ mov ($np),%rax adc \$0,%rdx - movq `0*$STRIDE/4-96`($bp),%xmm0 - movq `1*$STRIDE/4-96`($bp),%xmm1 - pand %xmm4,%xmm0 - movq `2*$STRIDE/4-96`($bp),%xmm2 - pand %xmm5,%xmm1 - movq `3*$STRIDE/4-96`($bp),%xmm3 - imulq $A[0],$m1 # tp[0]*n0 - .byte 0x67 mov %rdx,$A[1] mov $N[1],($tp) # store upmost overflow bit - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 - por %xmm2,%xmm0 lea ($tp,$num),$tp # rewind $tp - lea $STRIDE($bp),$bp - por %xmm3,%xmm0 mulq $m1 # np[0]*m1 add %rax,$A[0] # "$N[0]", discarded @@ -705,7 +788,7 @@ mulq $m0 # ap[j]*bp[i] add %rax,$A[1] - mov 16*1($np),%rax # interleaved with 0, therefore 16*n + mov 8*1($np),%rax adc \$0,%rdx add 8($tp),$A[1] # +tp[1] adc \$0,%rdx @@ -717,7 +800,7 @@ adc \$0,%rdx add $A[1],$N[1] # np[j]*m1+ap[j]*bp[i]+tp[j] lea 4*8($num),$j # j=4 - lea 16*4($np),$np + lea 8*4($np),$np adc \$0,%rdx mov %rdx,$N[0] jmp .Linner4x @@ -726,7 +809,7 @@ .Linner4x: mulq $m0 # ap[j]*bp[i] add %rax,$A[0] - mov -16*2($np),%rax + mov -8*2($np),%rax adc \$0,%rdx add 16($tp),$A[0] # ap[j]*bp[i]+tp[j] lea 32($tp),$tp @@ -744,7 +827,7 @@ mulq $m0 # ap[j]*bp[i] add %rax,$A[1] - mov -16*1($np),%rax + mov -8*1($np),%rax adc \$0,%rdx add -8($tp),$A[1] adc \$0,%rdx @@ -761,7 +844,7 @@ mulq $m0 # ap[j]*bp[i] add %rax,$A[0] - mov 16*0($np),%rax + mov 8*0($np),%rax adc \$0,%rdx add ($tp),$A[0] # ap[j]*bp[i]+tp[j] adc \$0,%rdx @@ -778,7 +861,7 @@ mulq $m0 # ap[j]*bp[i] add %rax,$A[1] - mov 16*1($np),%rax + mov 8*1($np),%rax adc \$0,%rdx add 8($tp),$A[1] adc \$0,%rdx @@ -789,7 +872,7 @@ mov 16($ap,$j),%rax adc \$0,%rdx add $A[1],$N[1] - lea 16*4($np),$np + lea 8*4($np),$np adc \$0,%rdx mov $N[0],-8($tp) # tp[j-1] mov %rdx,$N[0] @@ -799,7 +882,7 @@ mulq $m0 # ap[j]*bp[i] add %rax,$A[0] - mov -16*2($np),%rax + mov -8*2($np),%rax adc \$0,%rdx add 16($tp),$A[0] # ap[j]*bp[i]+tp[j] lea 32($tp),$tp @@ -818,7 +901,7 @@ mulq $m0 # ap[j]*bp[i] add %rax,$A[1] mov $m1,%rax - mov -16*1($np),$m1 + mov -8*1($np),$m1 adc \$0,%rdx add -8($tp),$A[1] adc \$0,%rdx @@ -833,9 +916,8 @@ mov $N[0],-24($tp) # tp[j-1] mov %rdx,$N[0] - movq %xmm0,$m0 # bp[i+1] mov $N[1],-16($tp) # tp[j-1] - lea ($np,$num,2),$np # rewind $np + lea ($np,$num),$np # rewind $np xor $N[1],$N[1] add $A[0],$N[0] @@ -849,16 +931,23 @@ ___ if (1) { $code.=<<___; + xor %rax,%rax sub $N[0],$m1 # compare top-most words adc $j,$j # $j is zero or $j,$N[1] - xor \$1,$N[1] + sub $N[1],%rax # %rax=-$N[1] lea ($tp,$num),%rbx # tptr in .sqr4x_sub - lea ($np,$N[1],8),%rbp # nptr in .sqr4x_sub + mov ($np),%r12 + lea ($np),%rbp # nptr in .sqr4x_sub mov %r9,%rcx - sar \$3+2,%rcx # cf=0 + sar \$3+2,%rcx mov 56+8(%rsp),%rdi # rptr in .sqr4x_sub - jmp .Lsqr4x_sub + dec %r12 # so that after 'not' we get -n[0] + xor %r10,%r10 + mov 8*1(%rbp),%r13 + mov 8*2(%rbp),%r14 + mov 8*3(%rbp),%r15 + jmp .Lsqr4x_sub_entry ___ } else { my @ri=("%rax",$bp,$m0,$m1); @@ -925,8 +1014,8 @@ ___ $code.=<<___ if ($addx); mov OPENSSL_ia32cap_P+8(%rip),%r11d - and \$0x80100,%r11d - cmp \$0x80100,%r11d + and \$0x80108,%r11d + cmp \$0x80108,%r11d # check for AD*X+BMI2+BMI1 je .Lpowerx5_enter ___ $code.=<<___; @@ -937,38 +1026,32 @@ push %r13 push %r14 push %r15 -___ -$code.=<<___ if ($win64); - lea -0x28(%rsp),%rsp - movaps %xmm6,(%rsp) - movaps %xmm7,0x10(%rsp) -___ -$code.=<<___; - mov ${num}d,%r10d + shl \$3,${num}d # convert $num to bytes - shl \$3+2,%r10d # 4*$num + lea ($num,$num,2),%r10d # 3*$num neg $num mov ($n0),$n0 # *n0 ############################################################## - # ensure that stack frame doesn't alias with $aptr+4*$num - # modulo 4096, which covers ret[num], am[num] and n[2*num] - # (see bn_exp.c). this is done to allow memory disambiguation - # logic do its magic. + # Ensure that stack frame doesn't alias with $rptr+3*$num + # modulo 4096, which covers ret[num], am[num] and n[num] + # (see bn_exp.c). This is done to allow memory disambiguation + # logic do its magic. [Extra 256 bytes is for power mask + # calculated from 7th argument, the index.] # - lea -64(%rsp,$num,2),%r11 - sub $aptr,%r11 + lea -320(%rsp,$num,2),%r11 + sub $rptr,%r11 and \$4095,%r11 cmp %r11,%r10 jb .Lpwr_sp_alt sub %r11,%rsp # align with $aptr - lea -64(%rsp,$num,2),%rsp # alloca(frame+2*$num) + lea -320(%rsp,$num,2),%rsp # alloca(frame+2*num*8+256) jmp .Lpwr_sp_done .align 32 .Lpwr_sp_alt: - lea 4096-64(,$num,2),%r10 # 4096-frame-2*$num - lea -64(%rsp,$num,2),%rsp # alloca(frame+2*$num) + lea 4096-320(,$num,2),%r10 + lea -320(%rsp,$num,2),%rsp # alloca(frame+2*num*8+256) sub %r10,%r11 mov \$0,%r10 cmovc %r10,%r11 @@ -990,16 +1073,21 @@ mov $n0, 32(%rsp) mov %rax, 40(%rsp) # save original %rsp .Lpower5_body: - movq $rptr,%xmm1 # save $rptr + movq $rptr,%xmm1 # save $rptr, used in sqr8x movq $nptr,%xmm2 # save $nptr - movq %r10, %xmm3 # -$num + movq %r10, %xmm3 # -$num, used in sqr8x movq $bptr,%xmm4 call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal call __bn_sqr8x_internal + call __bn_post4x_internal movq %xmm2,$nptr movq %xmm4,$bptr @@ -1560,9 +1648,9 @@ $code.=<<___; movq %xmm2,$nptr -sqr8x_reduction: +__bn_sqr8x_reduction: xor %rax,%rax - lea ($nptr,$num,2),%rcx # end of n[] + lea ($nptr,$num),%rcx # end of n[] lea 48+8(%rsp,$num,2),%rdx # end of t[] buffer mov %rcx,0+8(%rsp) lea 48+8(%rsp,$num),$tptr # end of initial t[] window @@ -1588,21 +1676,21 @@ .byte 0x67 mov $m0,%r8 imulq 32+8(%rsp),$m0 # n0*a[0] - mov 16*0($nptr),%rax # n[0] + mov 8*0($nptr),%rax # n[0] mov \$8,%ecx jmp .L8x_reduce .align 32 .L8x_reduce: mulq $m0 - mov 16*1($nptr),%rax # n[1] + mov 8*1($nptr),%rax # n[1] neg %r8 mov %rdx,%r8 adc \$0,%r8 mulq $m0 add %rax,%r9 - mov 16*2($nptr),%rax + mov 8*2($nptr),%rax adc \$0,%rdx add %r9,%r8 mov $m0,48-8+8(%rsp,%rcx,8) # put aside n0*a[i] @@ -1611,7 +1699,7 @@ mulq $m0 add %rax,%r10 - mov 16*3($nptr),%rax + mov 8*3($nptr),%rax adc \$0,%rdx add %r10,%r9 mov 32+8(%rsp),$carry # pull n0, borrow $carry @@ -1620,7 +1708,7 @@ mulq $m0 add %rax,%r11 - mov 16*4($nptr),%rax + mov 8*4($nptr),%rax adc \$0,%rdx imulq %r8,$carry # modulo-scheduled add %r11,%r10 @@ -1629,7 +1717,7 @@ mulq $m0 add %rax,%r12 - mov 16*5($nptr),%rax + mov 8*5($nptr),%rax adc \$0,%rdx add %r12,%r11 mov %rdx,%r12 @@ -1637,7 +1725,7 @@ mulq $m0 add %rax,%r13 - mov 16*6($nptr),%rax + mov 8*6($nptr),%rax adc \$0,%rdx add %r13,%r12 mov %rdx,%r13 @@ -1645,7 +1733,7 @@ mulq $m0 add %rax,%r14 - mov 16*7($nptr),%rax + mov 8*7($nptr),%rax adc \$0,%rdx add %r14,%r13 mov %rdx,%r14 @@ -1654,7 +1742,7 @@ mulq $m0 mov $carry,$m0 # n0*a[i] add %rax,%r15 - mov 16*0($nptr),%rax # n[0] + mov 8*0($nptr),%rax # n[0] adc \$0,%rdx add %r15,%r14 mov %rdx,%r15 @@ -1663,7 +1751,7 @@ dec %ecx jnz .L8x_reduce - lea 16*8($nptr),$nptr + lea 8*8($nptr),$nptr xor %rax,%rax mov 8+8(%rsp),%rdx # pull end of t[] cmp 0+8(%rsp),$nptr # end of n[]? @@ -1682,21 +1770,21 @@ mov 48+56+8(%rsp),$m0 # pull n0*a[0] mov \$8,%ecx - mov 16*0($nptr),%rax + mov 8*0($nptr),%rax jmp .L8x_tail .align 32 .L8x_tail: mulq $m0 add %rax,%r8 - mov 16*1($nptr),%rax + mov 8*1($nptr),%rax mov %r8,($tptr) # save result mov %rdx,%r8 adc \$0,%r8 mulq $m0 add %rax,%r9 - mov 16*2($nptr),%rax + mov 8*2($nptr),%rax adc \$0,%rdx add %r9,%r8 lea 8($tptr),$tptr # $tptr++ @@ -1705,7 +1793,7 @@ mulq $m0 add %rax,%r10 - mov 16*3($nptr),%rax + mov 8*3($nptr),%rax adc \$0,%rdx add %r10,%r9 mov %rdx,%r10 @@ -1713,7 +1801,7 @@ mulq $m0 add %rax,%r11 - mov 16*4($nptr),%rax + mov 8*4($nptr),%rax adc \$0,%rdx add %r11,%r10 mov %rdx,%r11 @@ -1721,7 +1809,7 @@ mulq $m0 add %rax,%r12 - mov 16*5($nptr),%rax + mov 8*5($nptr),%rax adc \$0,%rdx add %r12,%r11 mov %rdx,%r12 @@ -1729,7 +1817,7 @@ mulq $m0 add %rax,%r13 - mov 16*6($nptr),%rax + mov 8*6($nptr),%rax adc \$0,%rdx add %r13,%r12 mov %rdx,%r13 @@ -1737,7 +1825,7 @@ mulq $m0 add %rax,%r14 - mov 16*7($nptr),%rax + mov 8*7($nptr),%rax adc \$0,%rdx add %r14,%r13 mov %rdx,%r14 @@ -1748,14 +1836,14 @@ add %rax,%r15 adc \$0,%rdx add %r15,%r14 - mov 16*0($nptr),%rax # pull n[0] + mov 8*0($nptr),%rax # pull n[0] mov %rdx,%r15 adc \$0,%r15 dec %ecx jnz .L8x_tail - lea 16*8($nptr),$nptr + lea 8*8($nptr),$nptr mov 8+8(%rsp),%rdx # pull end of t[] cmp 0+8(%rsp),$nptr # end of n[]? jae .L8x_tail_done # break out of loop @@ -1779,6 +1867,15 @@ .align 32 .L8x_tail_done: add (%rdx),%r8 # can this overflow? + adc \$0,%r9 + adc \$0,%r10 + adc \$0,%r11 + adc \$0,%r12 + adc \$0,%r13 + adc \$0,%r14 + adc \$0,%r15 # can't overflow, because we + # started with "overhung" part + # of multiplication xor %rax,%rax neg $carry @@ -1792,7 +1889,7 @@ adc 8*6($tptr),%r14 adc 8*7($tptr),%r15 adc \$0,%rax # top-most carry - mov -16($nptr),%rcx # np[num-1] + mov -8($nptr),%rcx # np[num-1] xor $carry,$carry movq %xmm2,$nptr # restore $nptr @@ -1810,6 +1907,8 @@ cmp %rdx,$tptr # end of t[]? jb .L8x_reduction_loop + ret +.size bn_sqr8x_internal,.-bn_sqr8x_internal ___ } ############################################################## @@ -1818,48 +1917,62 @@ { my ($tptr,$nptr)=("%rbx","%rbp"); $code.=<<___; - #xor %rsi,%rsi # %rsi was $carry above - sub %r15,%rcx # compare top-most words +.type __bn_post4x_internal,\@abi-omnipotent +.align 32 +__bn_post4x_internal: + mov 8*0($nptr),%r12 lea (%rdi,$num),$tptr # %rdi was $tptr above - adc %rsi,%rsi mov $num,%rcx - or %rsi,%rax movq %xmm1,$rptr # restore $rptr - xor \$1,%rax + neg %rax movq %xmm1,$aptr # prepare for back-to-back call - lea ($nptr,%rax,8),$nptr - sar \$3+2,%rcx # cf=0 - jmp .Lsqr4x_sub + sar \$3+2,%rcx + dec %r12 # so that after 'not' we get -n[0] + xor %r10,%r10 + mov 8*1($nptr),%r13 + mov 8*2($nptr),%r14 + mov 8*3($nptr),%r15 + jmp .Lsqr4x_sub_entry -.align 32 +.align 16 .Lsqr4x_sub: - .byte 0x66 - mov 8*0($tptr),%r12 - mov 8*1($tptr),%r13 - sbb 16*0($nptr),%r12 - mov 8*2($tptr),%r14 - sbb 16*1($nptr),%r13 - mov 8*3($tptr),%r15 - lea 8*4($tptr),$tptr - sbb 16*2($nptr),%r14 + mov 8*0($nptr),%r12 + mov 8*1($nptr),%r13 + mov 8*2($nptr),%r14 + mov 8*3($nptr),%r15 +.Lsqr4x_sub_entry: + lea 8*4($nptr),$nptr + not %r12 + not %r13 + not %r14 + not %r15 + and %rax,%r12 + and %rax,%r13 + and %rax,%r14 + and %rax,%r15 + + neg %r10 # mov %r10,%cf + adc 8*0($tptr),%r12 + adc 8*1($tptr),%r13 + adc 8*2($tptr),%r14 + adc 8*3($tptr),%r15 mov %r12,8*0($rptr) - sbb 16*3($nptr),%r15 - lea 16*4($nptr),$nptr + lea 8*4($tptr),$tptr mov %r13,8*1($rptr) + sbb %r10,%r10 # mov %cf,%r10 mov %r14,8*2($rptr) mov %r15,8*3($rptr) lea 8*4($rptr),$rptr inc %rcx # pass %cf jnz .Lsqr4x_sub -___ -} -$code.=<<___; + mov $num,%r10 # prepare for back-to-back call neg $num # restore $num ret -.size bn_sqr8x_internal,.-bn_sqr8x_internal +.size __bn_post4x_internal,.-__bn_post4x_internal ___ +} { $code.=<<___; .globl bn_from_montgomery @@ -1883,39 +1996,32 @@ push %r13 push %r14 push %r15 -___ -$code.=<<___ if ($win64); - lea -0x28(%rsp),%rsp - movaps %xmm6,(%rsp) - movaps %xmm7,0x10(%rsp) -___ -$code.=<<___; - .byte 0x67 - mov ${num}d,%r10d + shl \$3,${num}d # convert $num to bytes - shl \$3+2,%r10d # 4*$num + lea ($num,$num,2),%r10 # 3*$num in bytes neg $num mov ($n0),$n0 # *n0 ############################################################## - # ensure that stack frame doesn't alias with $aptr+4*$num - # modulo 4096, which covers ret[num], am[num] and n[2*num] - # (see bn_exp.c). this is done to allow memory disambiguation - # logic do its magic. + # Ensure that stack frame doesn't alias with $rptr+3*$num + # modulo 4096, which covers ret[num], am[num] and n[num] + # (see bn_exp.c). The stack is allocated to aligned with + # bn_power5's frame, and as bn_from_montgomery happens to be + # last operation, we use the opportunity to cleanse it. # - lea -64(%rsp,$num,2),%r11 - sub $aptr,%r11 + lea -320(%rsp,$num,2),%r11 + sub $rptr,%r11 and \$4095,%r11 cmp %r11,%r10 jb .Lfrom_sp_alt sub %r11,%rsp # align with $aptr - lea -64(%rsp,$num,2),%rsp # alloca(frame+2*$num) + lea -320(%rsp,$num,2),%rsp # alloca(frame+2*$num*8+256) jmp .Lfrom_sp_done .align 32 .Lfrom_sp_alt: - lea 4096-64(,$num,2),%r10 # 4096-frame-2*$num - lea -64(%rsp,$num,2),%rsp # alloca(frame+2*$num) + lea 4096-320(,$num,2),%r10 + lea -320(%rsp,$num,2),%rsp # alloca(frame+2*$num*8+256) sub %r10,%r11 mov \$0,%r10 cmovc %r10,%r11 @@ -1969,12 +2075,13 @@ ___ $code.=<<___ if ($addx); mov OPENSSL_ia32cap_P+8(%rip),%r11d - and \$0x80100,%r11d - cmp \$0x80100,%r11d + and \$0x80108,%r11d + cmp \$0x80108,%r11d # check for AD*X+BMI2+BMI1 jne .Lfrom_mont_nox lea (%rax,$num),$rptr - call sqrx8x_reduction + call __bn_sqrx8x_reduction + call __bn_postx4x_internal pxor %xmm0,%xmm0 lea 48(%rsp),%rax @@ -1985,7 +2092,8 @@ .Lfrom_mont_nox: ___ $code.=<<___; - call sqr8x_reduction + call __bn_sqr8x_reduction + call __bn_post4x_internal pxor %xmm0,%xmm0 lea 48(%rsp),%rax @@ -2025,7 +2133,6 @@ .align 32 bn_mulx4x_mont_gather5: .Lmulx4x_enter: - .byte 0x67 mov %rsp,%rax push %rbx push %rbp @@ -2033,40 +2140,33 @@ push %r13 push %r14 push %r15 -___ -$code.=<<___ if ($win64); - lea -0x28(%rsp),%rsp - movaps %xmm6,(%rsp) - movaps %xmm7,0x10(%rsp) -___ -$code.=<<___; - .byte 0x67 - mov ${num}d,%r10d + shl \$3,${num}d # convert $num to bytes - shl \$3+2,%r10d # 4*$num + lea ($num,$num,2),%r10 # 3*$num in bytes neg $num # -$num mov ($n0),$n0 # *n0 ############################################################## - # ensure that stack frame doesn't alias with $aptr+4*$num - # modulo 4096, which covers a[num], ret[num] and n[2*num] - # (see bn_exp.c). this is done to allow memory disambiguation - # logic do its magic. [excessive frame is allocated in order - # to allow bn_from_mont8x to clear it.] + # Ensure that stack frame doesn't alias with $rptr+3*$num + # modulo 4096, which covers ret[num], am[num] and n[num] + # (see bn_exp.c). This is done to allow memory disambiguation + # logic do its magic. [Extra [num] is allocated in order + # to align with bn_power5's frame, which is cleansed after + # completing exponentiation. Extra 256 bytes is for power mask + # calculated from 7th argument, the index.] # - lea -64(%rsp,$num,2),%r11 - sub $ap,%r11 + lea -320(%rsp,$num,2),%r11 + sub $rp,%r11 and \$4095,%r11 cmp %r11,%r10 jb .Lmulx4xsp_alt sub %r11,%rsp # align with $aptr - lea -64(%rsp,$num,2),%rsp # alloca(frame+$num) + lea -320(%rsp,$num,2),%rsp # alloca(frame+2*$num*8+256) jmp .Lmulx4xsp_done -.align 32 .Lmulx4xsp_alt: - lea 4096-64(,$num,2),%r10 # 4096-frame-$num - lea -64(%rsp,$num,2),%rsp # alloca(frame+$num) + lea 4096-320(,$num,2),%r10 + lea -320(%rsp,$num,2),%rsp # alloca(frame+2*$num*8+256) sub %r10,%r11 mov \$0,%r10 cmovc %r10,%r11 @@ -2092,12 +2192,7 @@ mov 40(%rsp),%rsi # restore %rsp mov \$1,%rax -___ -$code.=<<___ if ($win64); - movaps -88(%rsi),%xmm6 - movaps -72(%rsi),%xmm7 -___ -$code.=<<___; + mov -48(%rsi),%r15 mov -40(%rsi),%r14 mov -32(%rsi),%r13 @@ -2112,14 +2207,16 @@ .type mulx4x_internal,\@abi-omnipotent .align 32 mulx4x_internal: - .byte 0x4c,0x89,0x8c,0x24,0x08,0x00,0x00,0x00 # mov $num,8(%rsp) # save -$num - .byte 0x67 + mov $num,8(%rsp) # save -$num (it was in bytes) + mov $num,%r10 neg $num # restore $num shl \$5,$num - lea 256($bp,$num),%r13 + neg %r10 # restore $num + lea 128($bp,$num),%r13 # end of powers table (+size optimization) shr \$5+5,$num - mov `($win64?56:8)`(%rax),%r10d # load 7th argument + movd `($win64?56:8)`(%rax),%xmm5 # load 7th argument sub \$1,$num + lea .Linc(%rip),%rax mov %r13,16+8(%rsp) # end of b[num] mov $num,24+8(%rsp) # inner counter mov $rp, 56+8(%rsp) # save $rp @@ -2130,52 +2227,92 @@ my $STRIDE=2**5*8; # 5 is "window size" my $N=$STRIDE/4; # should match cache line size $code.=<<___; - mov %r10,%r11 - shr \$`log($N/8)/log(2)`,%r10 - and \$`$N/8-1`,%r11 - not %r10 - lea .Lmagic_masks(%rip),%rax - and \$`2**5/($N/8)-1`,%r10 # 5 is "window size" - lea 96($bp,%r11,8),$bptr # pointer within 1st cache line - movq 0(%rax,%r10,8),%xmm4 # set of masks denoting which - movq 8(%rax,%r10,8),%xmm5 # cache line contains element - add \$7,%r11 - movq 16(%rax,%r10,8),%xmm6 # denoted by 7th argument - movq 24(%rax,%r10,8),%xmm7 - and \$7,%r11 - - movq `0*$STRIDE/4-96`($bptr),%xmm0 - lea $STRIDE($bptr),$tptr # borrow $tptr - movq `1*$STRIDE/4-96`($bptr),%xmm1 - pand %xmm4,%xmm0 - movq `2*$STRIDE/4-96`($bptr),%xmm2 - pand %xmm5,%xmm1 - movq `3*$STRIDE/4-96`($bptr),%xmm3 - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - movq `0*$STRIDE/4-96`($tptr),%xmm1 - pand %xmm7,%xmm3 - por %xmm2,%xmm0 - movq `1*$STRIDE/4-96`($tptr),%xmm2 - por %xmm3,%xmm0 - .byte 0x67,0x67 - pand %xmm4,%xmm1 - movq `2*$STRIDE/4-96`($tptr),%xmm3 + movdqa 0(%rax),%xmm0 # 00000001000000010000000000000000 + movdqa 16(%rax),%xmm1 # 00000002000000020000000200000002 + lea 88-112(%rsp,%r10),%r10 # place the mask after tp[num+1] (+ICache optimizaton) + lea 128($bp),$bptr # size optimization + pshufd \$0,%xmm5,%xmm5 # broadcast index + movdqa %xmm1,%xmm4 + .byte 0x67 + movdqa %xmm1,%xmm2 +___ +######################################################################## +# calculate mask by comparing 0..31 to index and save result to stack +# +$code.=<<___; + .byte 0x67 + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 # compare to 1,0 + movdqa %xmm4,%xmm3 +___ +for($i=0;$i<$STRIDE/16-4;$i+=4) { +$code.=<<___; + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 # compare to 3,2 + movdqa %xmm0,`16*($i+0)+112`(%r10) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 # compare to 5,4 + movdqa %xmm1,`16*($i+1)+112`(%r10) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 # compare to 7,6 + movdqa %xmm2,`16*($i+2)+112`(%r10) + movdqa %xmm4,%xmm2 + + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 + movdqa %xmm3,`16*($i+3)+112`(%r10) + movdqa %xmm4,%xmm3 +___ +} +$code.=<<___; # last iteration can be optimized + .byte 0x67 + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 + movdqa %xmm0,`16*($i+0)+112`(%r10) + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 + movdqa %xmm1,`16*($i+1)+112`(%r10) + + pcmpeqd %xmm5,%xmm3 + movdqa %xmm2,`16*($i+2)+112`(%r10) + + pand `16*($i+0)-128`($bptr),%xmm0 # while it's still in register + pand `16*($i+1)-128`($bptr),%xmm1 + pand `16*($i+2)-128`($bptr),%xmm2 + movdqa %xmm3,`16*($i+3)+112`(%r10) + pand `16*($i+3)-128`($bptr),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 +___ +for($i=0;$i<$STRIDE/16-4;$i+=4) { +$code.=<<___; + movdqa `16*($i+0)-128`($bptr),%xmm4 + movdqa `16*($i+1)-128`($bptr),%xmm5 + movdqa `16*($i+2)-128`($bptr),%xmm2 + pand `16*($i+0)+112`(%r10),%xmm4 + movdqa `16*($i+3)-128`($bptr),%xmm3 + pand `16*($i+1)+112`(%r10),%xmm5 + por %xmm4,%xmm0 + pand `16*($i+2)+112`(%r10),%xmm2 + por %xmm5,%xmm1 + pand `16*($i+3)+112`(%r10),%xmm3 + por %xmm2,%xmm0 + por %xmm3,%xmm1 +___ +} +$code.=<<___; + pxor %xmm1,%xmm0 + pshufd \$0x4e,%xmm0,%xmm1 + por %xmm1,%xmm0 + lea $STRIDE($bptr),$bptr movq %xmm0,%rdx # bp[0] - movq `3*$STRIDE/4-96`($tptr),%xmm0 - lea 2*$STRIDE($bptr),$bptr # next &b[i] - pand %xmm5,%xmm2 - .byte 0x67,0x67 - pand %xmm6,%xmm3 - ############################################################## - # $tptr is chosen so that writing to top-most element of the - # vector occurs just "above" references to powers table, - # "above" modulo cache-line size, which effectively precludes - # possibility of memory disambiguation logic failure when - # accessing the table. - # - lea 64+8*4+8(%rsp,%r11,8),$tptr + lea 64+8*4+8(%rsp),$tptr mov %rdx,$bi mulx 0*8($aptr),$mi,%rax # a[0]*b[0] @@ -2191,37 +2328,31 @@ xor $zero,$zero # cf=0, of=0 mov $mi,%rdx - por %xmm2,%xmm1 - pand %xmm7,%xmm0 - por %xmm3,%xmm1 mov $bptr,8+8(%rsp) # off-load &b[i] - por %xmm1,%xmm0 - .byte 0x48,0x8d,0xb6,0x20,0x00,0x00,0x00 # lea 4*8($aptr),$aptr + lea 4*8($aptr),$aptr adcx %rax,%r13 adcx $zero,%r14 # cf=0 - mulx 0*16($nptr),%rax,%r10 + mulx 0*8($nptr),%rax,%r10 adcx %rax,%r15 # discarded adox %r11,%r10 - mulx 1*16($nptr),%rax,%r11 + mulx 1*8($nptr),%rax,%r11 adcx %rax,%r10 adox %r12,%r11 - mulx 2*16($nptr),%rax,%r12 + mulx 2*8($nptr),%rax,%r12 mov 24+8(%rsp),$bptr # counter value - .byte 0x66 mov %r10,-8*4($tptr) adcx %rax,%r11 adox %r13,%r12 - mulx 3*16($nptr),%rax,%r15 - .byte 0x67,0x67 + mulx 3*8($nptr),%rax,%r15 mov $bi,%rdx mov %r11,-8*3($tptr) adcx %rax,%r12 adox $zero,%r15 # of=0 - .byte 0x48,0x8d,0x89,0x40,0x00,0x00,0x00 # lea 4*16($nptr),$nptr + lea 4*8($nptr),$nptr mov %r12,-8*2($tptr) - #jmp .Lmulx4x_1st + jmp .Lmulx4x_1st .align 32 .Lmulx4x_1st: @@ -2241,30 +2372,29 @@ lea 4*8($tptr),$tptr adox %r15,%r10 - mulx 0*16($nptr),%rax,%r15 + mulx 0*8($nptr),%rax,%r15 adcx %rax,%r10 adox %r15,%r11 - mulx 1*16($nptr),%rax,%r15 + mulx 1*8($nptr),%rax,%r15 adcx %rax,%r11 adox %r15,%r12 - mulx 2*16($nptr),%rax,%r15 + mulx 2*8($nptr),%rax,%r15 mov %r10,-5*8($tptr) adcx %rax,%r12 mov %r11,-4*8($tptr) adox %r15,%r13 - mulx 3*16($nptr),%rax,%r15 + mulx 3*8($nptr),%rax,%r15 mov $bi,%rdx mov %r12,-3*8($tptr) adcx %rax,%r13 adox $zero,%r15 - lea 4*16($nptr),$nptr + lea 4*8($nptr),$nptr mov %r13,-2*8($tptr) dec $bptr # of=0, pass cf jnz .Lmulx4x_1st mov 8(%rsp),$num # load -num - movq %xmm0,%rdx # bp[1] adc $zero,%r15 # modulo-scheduled lea ($aptr,$num),$aptr # rewind $aptr add %r15,%r14 @@ -2275,6 +2405,34 @@ .align 32 .Lmulx4x_outer: + lea 16-256($tptr),%r10 # where 256-byte mask is (+density control) + pxor %xmm4,%xmm4 + .byte 0x67,0x67 + pxor %xmm5,%xmm5 +___ +for($i=0;$i<$STRIDE/16;$i+=4) { +$code.=<<___; + movdqa `16*($i+0)-128`($bptr),%xmm0 + movdqa `16*($i+1)-128`($bptr),%xmm1 + movdqa `16*($i+2)-128`($bptr),%xmm2 + pand `16*($i+0)+256`(%r10),%xmm0 + movdqa `16*($i+3)-128`($bptr),%xmm3 + pand `16*($i+1)+256`(%r10),%xmm1 + por %xmm0,%xmm4 + pand `16*($i+2)+256`(%r10),%xmm2 + por %xmm1,%xmm5 + pand `16*($i+3)+256`(%r10),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 +___ +} +$code.=<<___; + por %xmm5,%xmm4 + pshufd \$0x4e,%xmm4,%xmm0 + por %xmm4,%xmm0 + lea $STRIDE($bptr),$bptr + movq %xmm0,%rdx # m0=bp[i] + mov $zero,($tptr) # save top-most carry lea 4*8($tptr,$num),$tptr # rewind $tptr mulx 0*8($aptr),$mi,%r11 # a[0]*b[i] @@ -2289,54 +2447,37 @@ mulx 3*8($aptr),%rdx,%r14 adox -2*8($tptr),%r12 adcx %rdx,%r13 - lea ($nptr,$num,2),$nptr # rewind $nptr + lea ($nptr,$num),$nptr # rewind $nptr lea 4*8($aptr),$aptr adox -1*8($tptr),%r13 adcx $zero,%r14 adox $zero,%r14 - .byte 0x67 mov $mi,%r15 imulq 32+8(%rsp),$mi # "t[0]"*n0 - movq `0*$STRIDE/4-96`($bptr),%xmm0 - .byte 0x67,0x67 mov $mi,%rdx - movq `1*$STRIDE/4-96`($bptr),%xmm1 - .byte 0x67 - pand %xmm4,%xmm0 - movq `2*$STRIDE/4-96`($bptr),%xmm2 - .byte 0x67 - pand %xmm5,%xmm1 - movq `3*$STRIDE/4-96`($bptr),%xmm3 - add \$$STRIDE,$bptr # next &b[i] - .byte 0x67 - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 xor $zero,$zero # cf=0, of=0 mov $bptr,8+8(%rsp) # off-load &b[i] - mulx 0*16($nptr),%rax,%r10 + mulx 0*8($nptr),%rax,%r10 adcx %rax,%r15 # discarded adox %r11,%r10 - mulx 1*16($nptr),%rax,%r11 + mulx 1*8($nptr),%rax,%r11 adcx %rax,%r10 adox %r12,%r11 - mulx 2*16($nptr),%rax,%r12 + mulx 2*8($nptr),%rax,%r12 adcx %rax,%r11 adox %r13,%r12 - mulx 3*16($nptr),%rax,%r15 + mulx 3*8($nptr),%rax,%r15 mov $bi,%rdx - por %xmm2,%xmm0 mov 24+8(%rsp),$bptr # counter value mov %r10,-8*4($tptr) - por %xmm3,%xmm0 adcx %rax,%r12 mov %r11,-8*3($tptr) adox $zero,%r15 # of=0 mov %r12,-8*2($tptr) - lea 4*16($nptr),$nptr + lea 4*8($nptr),$nptr jmp .Lmulx4x_inner .align 32 @@ -2361,20 +2502,20 @@ adcx $zero,%r14 # cf=0 adox %r15,%r10 - mulx 0*16($nptr),%rax,%r15 + mulx 0*8($nptr),%rax,%r15 adcx %rax,%r10 adox %r15,%r11 - mulx 1*16($nptr),%rax,%r15 + mulx 1*8($nptr),%rax,%r15 adcx %rax,%r11 adox %r15,%r12 - mulx 2*16($nptr),%rax,%r15 + mulx 2*8($nptr),%rax,%r15 mov %r10,-5*8($tptr) adcx %rax,%r12 adox %r15,%r13 mov %r11,-4*8($tptr) - mulx 3*16($nptr),%rax,%r15 + mulx 3*8($nptr),%rax,%r15 mov $bi,%rdx - lea 4*16($nptr),$nptr + lea 4*8($nptr),$nptr mov %r12,-3*8($tptr) adcx %rax,%r13 adox $zero,%r15 @@ -2384,7 +2525,6 @@ jnz .Lmulx4x_inner mov 0+8(%rsp),$num # load -num - movq %xmm0,%rdx # bp[i+1] adc $zero,%r15 # modulo-scheduled sub 0*8($tptr),$bptr # pull top-most carry to %cf mov 8+8(%rsp),$bptr # re-load &b[i] @@ -2397,20 +2537,26 @@ cmp %r10,$bptr jb .Lmulx4x_outer - mov -16($nptr),%r10 + mov -8($nptr),%r10 + mov $zero,%r8 + mov ($nptr,$num),%r12 + lea ($nptr,$num),%rbp # rewind $nptr + mov $num,%rcx + lea ($tptr,$num),%rdi # rewind $tptr + xor %eax,%eax xor %r15,%r15 sub %r14,%r10 # compare top-most words adc %r15,%r15 - or %r15,$zero - xor \$1,$zero - lea ($tptr,$num),%rdi # rewind $tptr - lea ($nptr,$num,2),$nptr # rewind $nptr - .byte 0x67,0x67 - sar \$3+2,$num # cf=0 - lea ($nptr,$zero,8),%rbp + or %r15,%r8 + sar \$3+2,%rcx + sub %r8,%rax # %rax=-%r8 mov 56+8(%rsp),%rdx # restore rp - mov $num,%rcx - jmp .Lsqrx4x_sub # common post-condition + dec %r12 # so that after 'not' we get -n[0] + mov 8*1(%rbp),%r13 + xor %r8,%r8 + mov 8*2(%rbp),%r14 + mov 8*3(%rbp),%r15 + jmp .Lsqrx4x_sub_entry # common post-condition .size mulx4x_internal,.-mulx4x_internal ___ } { @@ -2434,7 +2580,6 @@ .align 32 bn_powerx5: .Lpowerx5_enter: - .byte 0x67 mov %rsp,%rax push %rbx push %rbp @@ -2442,39 +2587,32 @@ push %r13 push %r14 push %r15 -___ -$code.=<<___ if ($win64); - lea -0x28(%rsp),%rsp - movaps %xmm6,(%rsp) - movaps %xmm7,0x10(%rsp) -___ -$code.=<<___; - .byte 0x67 - mov ${num}d,%r10d + shl \$3,${num}d # convert $num to bytes - shl \$3+2,%r10d # 4*$num + lea ($num,$num,2),%r10 # 3*$num in bytes neg $num mov ($n0),$n0 # *n0 ############################################################## - # ensure that stack frame doesn't alias with $aptr+4*$num - # modulo 4096, which covers ret[num], am[num] and n[2*num] - # (see bn_exp.c). this is done to allow memory disambiguation - # logic do its magic. + # Ensure that stack frame doesn't alias with $rptr+3*$num + # modulo 4096, which covers ret[num], am[num] and n[num] + # (see bn_exp.c). This is done to allow memory disambiguation + # logic do its magic. [Extra 256 bytes is for power mask + # calculated from 7th argument, the index.] # - lea -64(%rsp,$num,2),%r11 - sub $aptr,%r11 + lea -320(%rsp,$num,2),%r11 + sub $rptr,%r11 and \$4095,%r11 cmp %r11,%r10 jb .Lpwrx_sp_alt sub %r11,%rsp # align with $aptr - lea -64(%rsp,$num,2),%rsp # alloca(frame+2*$num) + lea -320(%rsp,$num,2),%rsp # alloca(frame+2*$num*8+256) jmp .Lpwrx_sp_done .align 32 .Lpwrx_sp_alt: - lea 4096-64(,$num,2),%r10 # 4096-frame-2*$num - lea -64(%rsp,$num,2),%rsp # alloca(frame+2*$num) + lea 4096-320(,$num,2),%r10 + lea -320(%rsp,$num,2),%rsp # alloca(frame+2*$num*8+256) sub %r10,%r11 mov \$0,%r10 cmovc %r10,%r11 @@ -2505,10 +2643,15 @@ .Lpowerx5_body: call __bn_sqrx8x_internal + call __bn_postx4x_internal call __bn_sqrx8x_internal + call __bn_postx4x_internal call __bn_sqrx8x_internal + call __bn_postx4x_internal call __bn_sqrx8x_internal + call __bn_postx4x_internal call __bn_sqrx8x_internal + call __bn_postx4x_internal mov %r10,$num # -num mov $aptr,$rptr @@ -2520,12 +2663,7 @@ mov 40(%rsp),%rsi # restore %rsp mov \$1,%rax -___ -$code.=<<___ if ($win64); - movaps -88(%rsi),%xmm6 - movaps -72(%rsi),%xmm7 -___ -$code.=<<___; + mov -48(%rsi),%r15 mov -40(%rsi),%r14 mov -32(%rsi),%r13 @@ -2959,11 +3097,11 @@ $code.=<<___; movq %xmm2,$nptr -sqrx8x_reduction: +__bn_sqrx8x_reduction: xor %eax,%eax # initial top-most carry bit mov 32+8(%rsp),%rbx # n0 mov 48+8(%rsp),%rdx # "%r8", 8*0($tptr) - lea -128($nptr,$num,2),%rcx # end of n[] + lea -8*8($nptr,$num),%rcx # end of n[] #lea 48+8(%rsp,$num,2),$tptr # end of t[] buffer mov %rcx, 0+8(%rsp) # save end of n[] mov $tptr,8+8(%rsp) # save end of t[] @@ -2992,23 +3130,23 @@ .align 32 .Lsqrx8x_reduce: mov %r8, %rbx - mulx 16*0($nptr),%rax,%r8 # n[0] + mulx 8*0($nptr),%rax,%r8 # n[0] adcx %rbx,%rax # discarded adox %r9,%r8 - mulx 16*1($nptr),%rbx,%r9 # n[1] + mulx 8*1($nptr),%rbx,%r9 # n[1] adcx %rbx,%r8 adox %r10,%r9 - mulx 16*2($nptr),%rbx,%r10 + mulx 8*2($nptr),%rbx,%r10 adcx %rbx,%r9 adox %r11,%r10 - mulx 16*3($nptr),%rbx,%r11 + mulx 8*3($nptr),%rbx,%r11 adcx %rbx,%r10 adox %r12,%r11 - .byte 0xc4,0x62,0xe3,0xf6,0xa5,0x40,0x00,0x00,0x00 # mulx 16*4($nptr),%rbx,%r12 + .byte 0xc4,0x62,0xe3,0xf6,0xa5,0x20,0x00,0x00,0x00 # mulx 8*4($nptr),%rbx,%r12 mov %rdx,%rax mov %r8,%rdx adcx %rbx,%r11 @@ -3018,15 +3156,15 @@ mov %rax,%rdx mov %rax,64+48+8(%rsp,%rcx,8) # put aside n0*a[i] - mulx 16*5($nptr),%rax,%r13 + mulx 8*5($nptr),%rax,%r13 adcx %rax,%r12 adox %r14,%r13 - mulx 16*6($nptr),%rax,%r14 + mulx 8*6($nptr),%rax,%r14 adcx %rax,%r13 adox %r15,%r14 - mulx 16*7($nptr),%rax,%r15 + mulx 8*7($nptr),%rax,%r15 mov %rbx,%rdx adcx %rax,%r14 adox $carry,%r15 # $carry is 0 @@ -3042,7 +3180,7 @@ mov 48+8(%rsp),%rdx # pull n0*a[0] add 8*0($tptr),%r8 - lea 16*8($nptr),$nptr + lea 8*8($nptr),$nptr mov \$-8,%rcx adcx 8*1($tptr),%r9 adcx 8*2($tptr),%r10 @@ -3061,35 +3199,35 @@ .align 32 .Lsqrx8x_tail: mov %r8,%rbx - mulx 16*0($nptr),%rax,%r8 + mulx 8*0($nptr),%rax,%r8 adcx %rax,%rbx adox %r9,%r8 - mulx 16*1($nptr),%rax,%r9 + mulx 8*1($nptr),%rax,%r9 adcx %rax,%r8 adox %r10,%r9 - mulx 16*2($nptr),%rax,%r10 + mulx 8*2($nptr),%rax,%r10 adcx %rax,%r9 adox %r11,%r10 - mulx 16*3($nptr),%rax,%r11 + mulx 8*3($nptr),%rax,%r11 adcx %rax,%r10 adox %r12,%r11 - .byte 0xc4,0x62,0xfb,0xf6,0xa5,0x40,0x00,0x00,0x00 # mulx 16*4($nptr),%rax,%r12 + .byte 0xc4,0x62,0xfb,0xf6,0xa5,0x20,0x00,0x00,0x00 # mulx 8*4($nptr),%rax,%r12 adcx %rax,%r11 adox %r13,%r12 - mulx 16*5($nptr),%rax,%r13 + mulx 8*5($nptr),%rax,%r13 adcx %rax,%r12 adox %r14,%r13 - mulx 16*6($nptr),%rax,%r14 + mulx 8*6($nptr),%rax,%r14 adcx %rax,%r13 adox %r15,%r14 - mulx 16*7($nptr),%rax,%r15 + mulx 8*7($nptr),%rax,%r15 mov 72+48+8(%rsp,%rcx,8),%rdx # pull n0*a[i] adcx %rax,%r14 adox $carry,%r15 @@ -3105,7 +3243,7 @@ sub 16+8(%rsp),$carry # mov 16(%rsp),%cf mov 48+8(%rsp),%rdx # pull n0*a[0] - lea 16*8($nptr),$nptr + lea 8*8($nptr),$nptr adc 8*0($tptr),%r8 adc 8*1($tptr),%r9 adc 8*2($tptr),%r10 @@ -3125,6 +3263,15 @@ .align 32 .Lsqrx8x_tail_done: add 24+8(%rsp),%r8 # can this overflow? + adc \$0,%r9 + adc \$0,%r10 + adc \$0,%r11 + adc \$0,%r12 + adc \$0,%r13 + adc \$0,%r14 + adc \$0,%r15 # can't overflow, because we + # started with "overhung" part + # of multiplication mov $carry,%rax # xor %rax,%rax sub 16+8(%rsp),$carry # mov 16(%rsp),%cf @@ -3132,7 +3279,7 @@ adc 8*0($tptr),%r8 movq %xmm3,%rcx adc 8*1($tptr),%r9 - mov 16*7($nptr),$carry + mov 8*7($nptr),$carry movq %xmm2,$nptr # restore $nptr adc 8*2($tptr),%r10 adc 8*3($tptr),%r11 @@ -3158,6 +3305,8 @@ lea 8*8($tptr,%rcx),$tptr # start of current t[] window cmp 8+8(%rsp),%r8 # end of t[]? jb .Lsqrx8x_reduction_loop + ret +.size bn_sqrx8x_internal,.-bn_sqrx8x_internal ___ } ############################################################## @@ -3165,54 +3314,59 @@ # { my ($rptr,$nptr)=("%rdx","%rbp"); -my @ri=map("%r$_",(10..13)); -my @ni=map("%r$_",(14..15)); $code.=<<___; - xor %rbx,%rbx - sub %r15,%rsi # compare top-most words - adc %rbx,%rbx +.align 32 +__bn_postx4x_internal: + mov 8*0($nptr),%r12 mov %rcx,%r10 # -$num - .byte 0x67 - or %rbx,%rax - .byte 0x67 mov %rcx,%r9 # -$num - xor \$1,%rax - sar \$3+2,%rcx # cf=0 + neg %rax + sar \$3+2,%rcx #lea 48+8(%rsp,%r9),$tptr - lea ($nptr,%rax,8),$nptr movq %xmm1,$rptr # restore $rptr movq %xmm1,$aptr # prepare for back-to-back call - jmp .Lsqrx4x_sub + dec %r12 # so that after 'not' we get -n[0] + mov 8*1($nptr),%r13 + xor %r8,%r8 + mov 8*2($nptr),%r14 + mov 8*3($nptr),%r15 + jmp .Lsqrx4x_sub_entry -.align 32 +.align 16 .Lsqrx4x_sub: - .byte 0x66 - mov 8*0($tptr),%r12 - mov 8*1($tptr),%r13 - sbb 16*0($nptr),%r12 - mov 8*2($tptr),%r14 - sbb 16*1($nptr),%r13 - mov 8*3($tptr),%r15 - lea 8*4($tptr),$tptr - sbb 16*2($nptr),%r14 + mov 8*0($nptr),%r12 + mov 8*1($nptr),%r13 + mov 8*2($nptr),%r14 + mov 8*3($nptr),%r15 +.Lsqrx4x_sub_entry: + andn %rax,%r12,%r12 + lea 8*4($nptr),$nptr + andn %rax,%r13,%r13 + andn %rax,%r14,%r14 + andn %rax,%r15,%r15 + + neg %r8 # mov %r8,%cf + adc 8*0($tptr),%r12 + adc 8*1($tptr),%r13 + adc 8*2($tptr),%r14 + adc 8*3($tptr),%r15 mov %r12,8*0($rptr) - sbb 16*3($nptr),%r15 - lea 16*4($nptr),$nptr + lea 8*4($tptr),$tptr mov %r13,8*1($rptr) + sbb %r8,%r8 # mov %cf,%r8 mov %r14,8*2($rptr) mov %r15,8*3($rptr) lea 8*4($rptr),$rptr inc %rcx jnz .Lsqrx4x_sub -___ -} -$code.=<<___; + neg %r9 # restore $num ret -.size bn_sqrx8x_internal,.-bn_sqrx8x_internal +.size __bn_postx4x_internal,.-__bn_postx4x_internal ___ +} }}} { my ($inp,$num,$tbl,$idx)=$win64?("%rcx","%edx","%r8", "%r9d") : # Win64 order @@ -3261,56 +3415,91 @@ .globl bn_gather5 .type bn_gather5,\@abi-omnipotent -.align 16 +.align 32 bn_gather5: -___ -$code.=<<___ if ($win64); -.LSEH_begin_bn_gather5: +.LSEH_begin_bn_gather5: # Win64 thing, but harmless in other cases # I can't trust assembler to use specific encoding:-( - .byte 0x48,0x83,0xec,0x28 #sub \$0x28,%rsp - .byte 0x0f,0x29,0x34,0x24 #movaps %xmm6,(%rsp) - .byte 0x0f,0x29,0x7c,0x24,0x10 #movdqa %xmm7,0x10(%rsp) + .byte 0x4c,0x8d,0x14,0x24 #lea (%rsp),%r10 + .byte 0x48,0x81,0xec,0x08,0x01,0x00,0x00 #sub $0x108,%rsp + lea .Linc(%rip),%rax + and \$-16,%rsp # shouldn't be formally required + + movd $idx,%xmm5 + movdqa 0(%rax),%xmm0 # 00000001000000010000000000000000 + movdqa 16(%rax),%xmm1 # 00000002000000020000000200000002 + lea 128($tbl),%r11 # size optimization + lea 128(%rsp),%rax # size optimization + + pshufd \$0,%xmm5,%xmm5 # broadcast $idx + movdqa %xmm1,%xmm4 + movdqa %xmm1,%xmm2 ___ +######################################################################## +# calculate mask by comparing 0..31 to $idx and save result to stack +# +for($i=0;$i<$STRIDE/16;$i+=4) { $code.=<<___; - mov $idx,%r11d - shr \$`log($N/8)/log(2)`,$idx - and \$`$N/8-1`,%r11 - not $idx - lea .Lmagic_masks(%rip),%rax - and \$`2**5/($N/8)-1`,$idx # 5 is "window size" - lea 128($tbl,%r11,8),$tbl # pointer within 1st cache line - movq 0(%rax,$idx,8),%xmm4 # set of masks denoting which - movq 8(%rax,$idx,8),%xmm5 # cache line contains element - movq 16(%rax,$idx,8),%xmm6 # denoted by 7th argument - movq 24(%rax,$idx,8),%xmm7 + paddd %xmm0,%xmm1 + pcmpeqd %xmm5,%xmm0 # compare to 1,0 +___ +$code.=<<___ if ($i); + movdqa %xmm3,`16*($i-1)-128`(%rax) +___ +$code.=<<___; + movdqa %xmm4,%xmm3 + + paddd %xmm1,%xmm2 + pcmpeqd %xmm5,%xmm1 # compare to 3,2 + movdqa %xmm0,`16*($i+0)-128`(%rax) + movdqa %xmm4,%xmm0 + + paddd %xmm2,%xmm3 + pcmpeqd %xmm5,%xmm2 # compare to 5,4 + movdqa %xmm1,`16*($i+1)-128`(%rax) + movdqa %xmm4,%xmm1 + + paddd %xmm3,%xmm0 + pcmpeqd %xmm5,%xmm3 # compare to 7,6 + movdqa %xmm2,`16*($i+2)-128`(%rax) + movdqa %xmm4,%xmm2 +___ +} +$code.=<<___; + movdqa %xmm3,`16*($i-1)-128`(%rax) jmp .Lgather -.align 16 -.Lgather: - movq `0*$STRIDE/4-128`($tbl),%xmm0 - movq `1*$STRIDE/4-128`($tbl),%xmm1 - pand %xmm4,%xmm0 - movq `2*$STRIDE/4-128`($tbl),%xmm2 - pand %xmm5,%xmm1 - movq `3*$STRIDE/4-128`($tbl),%xmm3 - pand %xmm6,%xmm2 - por %xmm1,%xmm0 - pand %xmm7,%xmm3 - .byte 0x67,0x67 - por %xmm2,%xmm0 - lea $STRIDE($tbl),$tbl - por %xmm3,%xmm0 +.align 32 +.Lgather: + pxor %xmm4,%xmm4 + pxor %xmm5,%xmm5 +___ +for($i=0;$i<$STRIDE/16;$i+=4) { +$code.=<<___; + movdqa `16*($i+0)-128`(%r11),%xmm0 + movdqa `16*($i+1)-128`(%r11),%xmm1 + movdqa `16*($i+2)-128`(%r11),%xmm2 + pand `16*($i+0)-128`(%rax),%xmm0 + movdqa `16*($i+3)-128`(%r11),%xmm3 + pand `16*($i+1)-128`(%rax),%xmm1 + por %xmm0,%xmm4 + pand `16*($i+2)-128`(%rax),%xmm2 + por %xmm1,%xmm5 + pand `16*($i+3)-128`(%rax),%xmm3 + por %xmm2,%xmm4 + por %xmm3,%xmm5 +___ +} +$code.=<<___; + por %xmm5,%xmm4 + lea $STRIDE(%r11),%r11 + pshufd \$0x4e,%xmm4,%xmm0 + por %xmm4,%xmm0 movq %xmm0,($out) # m0=bp[0] lea 8($out),$out sub \$1,$num jnz .Lgather -___ -$code.=<<___ if ($win64); - movaps (%rsp),%xmm6 - movaps 0x10(%rsp),%xmm7 - lea 0x28(%rsp),%rsp -___ -$code.=<<___; + + lea (%r10),%rsp ret .LSEH_end_bn_gather5: .size bn_gather5,.-bn_gather5 @@ -3318,9 +3507,9 @@ } $code.=<<___; .align 64 -.Lmagic_masks: - .long 0,0, 0,0, 0,0, -1,-1 - .long 0,0, 0,0, 0,0, 0,0 +.Linc: + .long 0,0, 1,1 + .long 2,2, 2,2 .asciz "Montgomery Multiplication with scatter/gather for x86_64, CRYPTOGAMS by " ___ @@ -3368,19 +3557,16 @@ lea .Lmul_epilogue(%rip),%r10 cmp %r10,%rbx - jb .Lbody_40 + ja .Lbody_40 mov 192($context),%r10 # pull $num mov 8(%rax,%r10,8),%rax # pull saved stack pointer + jmp .Lbody_proceed .Lbody_40: mov 40(%rax),%rax # pull saved stack pointer .Lbody_proceed: - - movaps -88(%rax),%xmm0 - movaps -72(%rax),%xmm1 - mov -8(%rax),%rbx mov -16(%rax),%rbp mov -24(%rax),%r12 @@ -3393,8 +3579,6 @@ mov %r13,224($context) # restore context->R13 mov %r14,232($context) # restore context->R14 mov %r15,240($context) # restore context->R15 - movups %xmm0,512($context) # restore context->Xmm6 - movups %xmm1,528($context) # restore context->Xmm7 .Lcommon_seh_tail: mov 8(%rax),%rdi @@ -3505,10 +3689,9 @@ $code.=<<___; .align 8 .LSEH_info_bn_gather5: - .byte 0x01,0x0d,0x05,0x00 - .byte 0x0d,0x78,0x01,0x00 #movaps 0x10(rsp),xmm7 - .byte 0x08,0x68,0x00,0x00 #movaps (rsp),xmm6 - .byte 0x04,0x42,0x00,0x00 #sub rsp,0x28 + .byte 0x01,0x0b,0x03,0x0a + .byte 0x0b,0x01,0x21,0x00 # sub rsp,0x108 + .byte 0x04,0xa3,0x00,0x00 # lea r10,(rsp) .align 8 ___ } diff --git a/deps/openssl/openssl/crypto/bn/bn.h b/deps/openssl/openssl/crypto/bn/bn.h index 5696965e9a09d0..86264ae6315fb1 100644 --- a/deps/openssl/openssl/crypto/bn/bn.h +++ b/deps/openssl/openssl/crypto/bn/bn.h @@ -125,6 +125,7 @@ #ifndef HEADER_BN_H # define HEADER_BN_H +# include # include # ifndef OPENSSL_NO_FP_API # include /* FILE */ @@ -721,8 +722,17 @@ const BIGNUM *BN_get0_nist_prime_521(void); /* library internal functions */ -# define bn_expand(a,bits) ((((((bits+BN_BITS2-1))/BN_BITS2)) <= (a)->dmax)?\ - (a):bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2)) +# define bn_expand(a,bits) \ + ( \ + bits > (INT_MAX - BN_BITS2 + 1) ? \ + NULL \ + : \ + (((bits+BN_BITS2-1)/BN_BITS2) <= (a)->dmax) ? \ + (a) \ + : \ + bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2) \ + ) + # define bn_wexpand(a,words) (((words) <= (a)->dmax)?(a):bn_expand2((a),(words))) BIGNUM *bn_expand2(BIGNUM *a, int words); # ifndef OPENSSL_NO_DEPRECATED diff --git a/deps/openssl/openssl/crypto/bn/bn_exp.c b/deps/openssl/openssl/crypto/bn/bn_exp.c index 24afdd60a227a9..1670f01d1d8c44 100644 --- a/deps/openssl/openssl/crypto/bn/bn_exp.c +++ b/deps/openssl/openssl/crypto/bn/bn_exp.c @@ -110,6 +110,7 @@ */ #include "cryptlib.h" +#include "constant_time_locl.h" #include "bn_lcl.h" #include @@ -282,9 +283,14 @@ int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, } bits = BN_num_bits(p); - if (bits == 0) { - ret = BN_one(r); + /* x**0 mod 1 is still zero. */ + if (BN_is_one(m)) { + ret = 1; + BN_zero(r); + } else { + ret = BN_one(r); + } return ret; } @@ -418,7 +424,13 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, } bits = BN_num_bits(p); if (bits == 0) { - ret = BN_one(rr); + /* x**0 mod 1 is still zero. */ + if (BN_is_one(m)) { + ret = 1; + BN_zero(rr); + } else { + ret = BN_one(rr); + } return ret; } @@ -595,15 +607,17 @@ static BN_ULONG bn_get_bits(const BIGNUM *a, int bitpos) static int MOD_EXP_CTIME_COPY_TO_PREBUF(const BIGNUM *b, int top, unsigned char *buf, int idx, - int width) + int window) { - size_t i, j; + int i, j; + int width = 1 << window; + BN_ULONG *table = (BN_ULONG *)buf; if (top > b->top) top = b->top; /* this works because 'buf' is explicitly * zeroed */ - for (i = 0, j = idx; i < top * sizeof b->d[0]; i++, j += width) { - buf[j] = ((unsigned char *)b->d)[i]; + for (i = 0, j = idx; i < top; i++, j += width) { + table[j] = b->d[i]; } return 1; @@ -611,15 +625,51 @@ static int MOD_EXP_CTIME_COPY_TO_PREBUF(const BIGNUM *b, int top, static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top, unsigned char *buf, int idx, - int width) + int window) { - size_t i, j; + int i, j; + int width = 1 << window; + volatile BN_ULONG *table = (volatile BN_ULONG *)buf; if (bn_wexpand(b, top) == NULL) return 0; - for (i = 0, j = idx; i < top * sizeof b->d[0]; i++, j += width) { - ((unsigned char *)b->d)[i] = buf[j]; + if (window <= 3) { + for (i = 0; i < top; i++, table += width) { + BN_ULONG acc = 0; + + for (j = 0; j < width; j++) { + acc |= table[j] & + ((BN_ULONG)0 - (constant_time_eq_int(j,idx)&1)); + } + + b->d[i] = acc; + } + } else { + int xstride = 1 << (window - 2); + BN_ULONG y0, y1, y2, y3; + + i = idx >> (window - 2); /* equivalent of idx / xstride */ + idx &= xstride - 1; /* equivalent of idx % xstride */ + + y0 = (BN_ULONG)0 - (constant_time_eq_int(i,0)&1); + y1 = (BN_ULONG)0 - (constant_time_eq_int(i,1)&1); + y2 = (BN_ULONG)0 - (constant_time_eq_int(i,2)&1); + y3 = (BN_ULONG)0 - (constant_time_eq_int(i,3)&1); + + for (i = 0; i < top; i++, table += width) { + BN_ULONG acc = 0; + + for (j = 0; j < xstride; j++) { + acc |= ( (table[j + 0 * xstride] & y0) | + (table[j + 1 * xstride] & y1) | + (table[j + 2 * xstride] & y2) | + (table[j + 3 * xstride] & y3) ) + & ((BN_ULONG)0 - (constant_time_eq_int(j,idx)&1)); + } + + b->d[i] = acc; + } } b->top = top; @@ -639,7 +689,7 @@ static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top, * precomputation memory layout to limit data-dependency to a minimum to * protect secret exponents (cf. the hyper-threading timing attacks pointed * out by Colin Percival, - * http://www.daemong-consideredperthreading-considered-harmful/) + * http://www.daemonology.net/hyperthreading-considered-harmful/) */ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, @@ -662,15 +712,22 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, bn_check_top(p); bn_check_top(m); - top = m->top; - - if (!(m->d[0] & 1)) { + if (!BN_is_odd(m)) { BNerr(BN_F_BN_MOD_EXP_MONT_CONSTTIME, BN_R_CALLED_WITH_EVEN_MODULUS); return (0); } + + top = m->top; + bits = BN_num_bits(p); if (bits == 0) { - ret = BN_one(rr); + /* x**0 mod 1 is still zero. */ + if (BN_is_one(m)) { + ret = 1; + BN_zero(rr); + } else { + ret = BN_one(rr); + } return ret; } @@ -731,8 +788,8 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, if (window >= 5) { window = 5; /* ~5% improvement for RSA2048 sign, and even * for RSA4096 */ - if ((top & 7) == 0) - powerbufLen += 2 * top * sizeof(m->d[0]); + /* reserve space for mont->N.d[] copy */ + powerbufLen += top * sizeof(mont->N.d[0]); } #endif (void)0; @@ -953,7 +1010,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, const BN_ULONG *not_used, const BN_ULONG *np, const BN_ULONG *n0, int num); - BN_ULONG *np = mont->N.d, *n0 = mont->n0, *np2; + BN_ULONG *n0 = mont->n0, *np; /* * BN_to_montgomery can contaminate words above .top [in @@ -964,11 +1021,11 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, for (i = tmp.top; i < top; i++) tmp.d[i] = 0; - if (top & 7) - np2 = np; - else - for (np2 = am.d + top, i = 0; i < top; i++) - np2[2 * i] = np[i]; + /* + * copy mont->N.d[] to improve cache locality + */ + for (np = am.d + top, i = 0; i < top; i++) + np[i] = mont->N.d[i]; bn_scatter5(tmp.d, top, powerbuf, 0); bn_scatter5(am.d, am.top, powerbuf, 1); @@ -978,7 +1035,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, # if 0 for (i = 3; i < 32; i++) { /* Calculate a^i = a^(i-1) * a */ - bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np2, n0, top, i - 1); + bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1); bn_scatter5(tmp.d, top, powerbuf, i); } # else @@ -989,7 +1046,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, } for (i = 3; i < 8; i += 2) { int j; - bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np2, n0, top, i - 1); + bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1); bn_scatter5(tmp.d, top, powerbuf, i); for (j = 2 * i; j < 32; j *= 2) { bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top); @@ -997,13 +1054,13 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, } } for (; i < 16; i += 2) { - bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np2, n0, top, i - 1); + bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1); bn_scatter5(tmp.d, top, powerbuf, i); bn_mul_mont(tmp.d, tmp.d, tmp.d, np, n0, top); bn_scatter5(tmp.d, top, powerbuf, 2 * i); } for (; i < 32; i += 2) { - bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np2, n0, top, i - 1); + bn_mul_mont_gather5(tmp.d, am.d, powerbuf, np, n0, top, i - 1); bn_scatter5(tmp.d, top, powerbuf, i); } # endif @@ -1032,11 +1089,11 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, while (bits >= 0) { wvalue = bn_get_bits5(p->d, bits - 4); bits -= 5; - bn_power5(tmp.d, tmp.d, powerbuf, np2, n0, top, wvalue); + bn_power5(tmp.d, tmp.d, powerbuf, np, n0, top, wvalue); } } - ret = bn_from_montgomery(tmp.d, tmp.d, NULL, np2, n0, top); + ret = bn_from_montgomery(tmp.d, tmp.d, NULL, np, n0, top); tmp.top = top; bn_correct_top(&tmp); if (ret) { @@ -1047,9 +1104,9 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, } else #endif { - if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, 0, numPowers)) + if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, 0, window)) goto err; - if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&am, top, powerbuf, 1, numPowers)) + if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&am, top, powerbuf, 1, window)) goto err; /* @@ -1061,15 +1118,15 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, if (window > 1) { if (!BN_mod_mul_montgomery(&tmp, &am, &am, mont, ctx)) goto err; - if (!MOD_EXP_CTIME_COPY_TO_PREBUF - (&tmp, top, powerbuf, 2, numPowers)) + if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, 2, + window)) goto err; for (i = 3; i < numPowers; i++) { /* Calculate a^i = a^(i-1) * a */ if (!BN_mod_mul_montgomery(&tmp, &am, &tmp, mont, ctx)) goto err; - if (!MOD_EXP_CTIME_COPY_TO_PREBUF - (&tmp, top, powerbuf, i, numPowers)) + if (!MOD_EXP_CTIME_COPY_TO_PREBUF(&tmp, top, powerbuf, i, + window)) goto err; } } @@ -1077,8 +1134,8 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, bits--; for (wvalue = 0, i = bits % window; i >= 0; i--, bits--) wvalue = (wvalue << 1) + BN_is_bit_set(p, bits); - if (!MOD_EXP_CTIME_COPY_FROM_PREBUF - (&tmp, top, powerbuf, wvalue, numPowers)) + if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(&tmp, top, powerbuf, wvalue, + window)) goto err; /* @@ -1098,8 +1155,8 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, /* * Fetch the appropriate pre-computed value from the pre-buf */ - if (!MOD_EXP_CTIME_COPY_FROM_PREBUF - (&am, top, powerbuf, wvalue, numPowers)) + if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(&am, top, powerbuf, wvalue, + window)) goto err; /* Multiply the result into the intermediate result */ @@ -1181,8 +1238,9 @@ int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p, if (BN_is_one(m)) { ret = 1; BN_zero(rr); - } else + } else { ret = BN_one(rr); + } return ret; } if (a == 0) { @@ -1296,9 +1354,14 @@ int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, } bits = BN_num_bits(p); - - if (bits == 0) { - ret = BN_one(r); + if (bits == 0) { + /* x**0 mod 1 is still zero. */ + if (BN_is_one(m)) { + ret = 1; + BN_zero(r); + } else { + ret = BN_one(r); + } return ret; } diff --git a/deps/openssl/openssl/crypto/bn/bn_gcd.c b/deps/openssl/openssl/crypto/bn/bn_gcd.c index 97c55ab7209815..ce59fe701f9db1 100644 --- a/deps/openssl/openssl/crypto/bn/bn_gcd.c +++ b/deps/openssl/openssl/crypto/bn/bn_gcd.c @@ -583,6 +583,7 @@ static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in, * BN_div_no_branch will be called eventually. */ pB = &local_B; + local_B.flags = 0; BN_with_flags(pB, B, BN_FLG_CONSTTIME); if (!BN_nnmod(B, pB, A, ctx)) goto err; @@ -610,6 +611,7 @@ static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in, * BN_div_no_branch will be called eventually. */ pA = &local_A; + local_A.flags = 0; BN_with_flags(pA, A, BN_FLG_CONSTTIME); /* (D, M) := (A/B, A%B) ... */ diff --git a/deps/openssl/openssl/crypto/bn/bn_gf2m.c b/deps/openssl/openssl/crypto/bn/bn_gf2m.c index cfa1c7ce14990a..2c61da11093f33 100644 --- a/deps/openssl/openssl/crypto/bn/bn_gf2m.c +++ b/deps/openssl/openssl/crypto/bn/bn_gf2m.c @@ -575,7 +575,7 @@ int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[], bn_check_top(a); BN_CTX_start(ctx); if ((s = BN_CTX_get(ctx)) == NULL) - return 0; + goto err; if (!bn_wexpand(s, 2 * a->top)) goto err; @@ -699,18 +699,21 @@ int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) int top = p->top; BN_ULONG *udp, *bdp, *vdp, *cdp; - bn_wexpand(u, top); + if (!bn_wexpand(u, top)) + goto err; udp = u->d; for (i = u->top; i < top; i++) udp[i] = 0; u->top = top; - bn_wexpand(b, top); + if (!bn_wexpand(b, top)) + goto err; bdp = b->d; bdp[0] = 1; for (i = 1; i < top; i++) bdp[i] = 0; b->top = top; - bn_wexpand(c, top); + if (!bn_wexpand(c, top)) + goto err; cdp = c->d; for (i = 0; i < top; i++) cdp[i] = 0; diff --git a/deps/openssl/openssl/crypto/bn/bn_mont.c b/deps/openssl/openssl/crypto/bn/bn_mont.c index aadd5db1d8dbde..be95bd55d02064 100644 --- a/deps/openssl/openssl/crypto/bn/bn_mont.c +++ b/deps/openssl/openssl/crypto/bn/bn_mont.c @@ -361,9 +361,9 @@ void BN_MONT_CTX_free(BN_MONT_CTX *mont) if (mont == NULL) return; - BN_free(&(mont->RR)); - BN_free(&(mont->N)); - BN_free(&(mont->Ni)); + BN_clear_free(&(mont->RR)); + BN_clear_free(&(mont->N)); + BN_clear_free(&(mont->Ni)); if (mont->flags & BN_FLG_MALLOCED) OPENSSL_free(mont); } @@ -373,6 +373,9 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) int ret = 0; BIGNUM *Ri, *R; + if (BN_is_zero(mod)) + return 0; + BN_CTX_start(ctx); if ((Ri = BN_CTX_get(ctx)) == NULL) goto err; diff --git a/deps/openssl/openssl/crypto/bn/bn_print.c b/deps/openssl/openssl/crypto/bn/bn_print.c index ab10b957ba27d4..bfa31efc56216b 100644 --- a/deps/openssl/openssl/crypto/bn/bn_print.c +++ b/deps/openssl/openssl/crypto/bn/bn_print.c @@ -58,6 +58,7 @@ #include #include +#include #include "cryptlib.h" #include #include "bn_lcl.h" @@ -189,7 +190,11 @@ int BN_hex2bn(BIGNUM **bn, const char *a) a++; } - for (i = 0; isxdigit((unsigned char)a[i]); i++) ; + for (i = 0; i <= (INT_MAX/4) && isxdigit((unsigned char)a[i]); i++) + continue; + + if (i > INT_MAX/4) + goto err; num = i + neg; if (bn == NULL) @@ -204,7 +209,7 @@ int BN_hex2bn(BIGNUM **bn, const char *a) BN_zero(ret); } - /* i is the number of hex digests; */ + /* i is the number of hex digits */ if (bn_expand(ret, i * 4) == NULL) goto err; @@ -260,7 +265,11 @@ int BN_dec2bn(BIGNUM **bn, const char *a) a++; } - for (i = 0; isdigit((unsigned char)a[i]); i++) ; + for (i = 0; i <= (INT_MAX/4) && isdigit((unsigned char)a[i]); i++) + continue; + + if (i > INT_MAX/4) + goto err; num = i + neg; if (bn == NULL) @@ -278,7 +287,7 @@ int BN_dec2bn(BIGNUM **bn, const char *a) BN_zero(ret); } - /* i is the number of digests, a bit of an over expand; */ + /* i is the number of digits, a bit of an over expand */ if (bn_expand(ret, i * 4) == NULL) goto err; diff --git a/deps/openssl/openssl/crypto/bn/bn_recp.c b/deps/openssl/openssl/crypto/bn/bn_recp.c index 6826f93b3882f5..f047040efe03bd 100644 --- a/deps/openssl/openssl/crypto/bn/bn_recp.c +++ b/deps/openssl/openssl/crypto/bn/bn_recp.c @@ -65,6 +65,7 @@ void BN_RECP_CTX_init(BN_RECP_CTX *recp) BN_init(&(recp->N)); BN_init(&(recp->Nr)); recp->num_bits = 0; + recp->shift = 0; recp->flags = 0; } @@ -152,8 +153,10 @@ int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, if (BN_ucmp(m, &(recp->N)) < 0) { BN_zero(d); - if (!BN_copy(r, m)) + if (!BN_copy(r, m)) { + BN_CTX_end(ctx); return 0; + } BN_CTX_end(ctx); return (1); } diff --git a/deps/openssl/openssl/crypto/bn/bn_x931p.c b/deps/openssl/openssl/crypto/bn/bn_x931p.c index 6d76b1284e107d..efa48bdf87724a 100644 --- a/deps/openssl/openssl/crypto/bn/bn_x931p.c +++ b/deps/openssl/openssl/crypto/bn/bn_x931p.c @@ -213,14 +213,14 @@ int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx) * exceeded. */ if (!BN_rand(Xp, nbits, 1, 0)) - return 0; + goto err; BN_CTX_start(ctx); t = BN_CTX_get(ctx); for (i = 0; i < 1000; i++) { if (!BN_rand(Xq, nbits, 1, 0)) - return 0; + goto err; /* Check that |Xp - Xq| > 2^(nbits - 100) */ BN_sub(t, Xp, Xq); if (BN_num_bits(t) > (nbits - 100)) @@ -234,6 +234,9 @@ int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx) return 0; + err: + BN_CTX_end(ctx); + return 0; } /* diff --git a/deps/openssl/openssl/crypto/bn/bntest.c b/deps/openssl/openssl/crypto/bn/bntest.c index 470d5dabf1ec9b..1e35988022bbcb 100644 --- a/deps/openssl/openssl/crypto/bn/bntest.c +++ b/deps/openssl/openssl/crypto/bn/bntest.c @@ -441,6 +441,14 @@ int test_div(BIO *bp, BN_CTX *ctx) BN_init(&d); BN_init(&e); + BN_one(&a); + BN_zero(&b); + + if (BN_div(&d, &c, &a, &b, ctx)) { + fprintf(stderr, "Division by zero succeeded!\n"); + return 0; + } + for (i = 0; i < num0 + num1; i++) { if (i < num1) { BN_bntest_rand(&a, 400, 0, 0); @@ -516,9 +524,9 @@ int test_div_word(BIO *bp) do { BN_bntest_rand(&a, 512, -1, 0); BN_bntest_rand(&b, BN_BITS2, -1, 0); - s = b.d[0]; - } while (!s); + } while (BN_is_zero(&b)); + s = b.d[0]; BN_copy(&b, &a); r = BN_div_word(&b, s); @@ -781,6 +789,18 @@ int test_mont(BIO *bp, BN_CTX *ctx) if (mont == NULL) return 0; + BN_zero(&n); + if (BN_MONT_CTX_set(mont, &n, ctx)) { + fprintf(stderr, "BN_MONT_CTX_set succeeded for zero modulus!\n"); + return 0; + } + + BN_set_word(&n, 16); + if (BN_MONT_CTX_set(mont, &n, ctx)) { + fprintf(stderr, "BN_MONT_CTX_set succeeded for even modulus!\n"); + return 0; + } + BN_bntest_rand(&a, 100, 0, 0); BN_bntest_rand(&b, 100, 0, 0); for (i = 0; i < num2; i++) { @@ -887,6 +907,14 @@ int test_mod_mul(BIO *bp, BN_CTX *ctx) d = BN_new(); e = BN_new(); + BN_one(a); + BN_one(b); + BN_zero(c); + if (BN_mod_mul(e, a, b, c, ctx)) { + fprintf(stderr, "BN_mod_mul with zero modulus succeeded!\n"); + return 0; + } + for (j = 0; j < 3; j++) { BN_bntest_rand(c, 1024, 0, 0); for (i = 0; i < num0; i++) { @@ -952,6 +980,14 @@ int test_mod_exp(BIO *bp, BN_CTX *ctx) d = BN_new(); e = BN_new(); + BN_one(a); + BN_one(b); + BN_zero(c); + if (BN_mod_exp(d, a, b, c, ctx)) { + fprintf(stderr, "BN_mod_exp with zero modulus succeeded!\n"); + return 0; + } + BN_bntest_rand(c, 30, 0, 1); /* must be odd for montgomery */ for (i = 0; i < num2; i++) { BN_bntest_rand(a, 20 + i * 5, 0, 0); @@ -980,6 +1016,24 @@ int test_mod_exp(BIO *bp, BN_CTX *ctx) return 0; } } + + /* Regression test for carry propagation bug in sqr8x_reduction */ + BN_hex2bn(&a, "050505050505"); + BN_hex2bn(&b, "02"); + BN_hex2bn(&c, + "4141414141414141414141274141414141414141414141414141414141414141" + "4141414141414141414141414141414141414141414141414141414141414141" + "4141414141414141414141800000000000000000000000000000000000000000" + "0000000000000000000000000000000000000000000000000000000000000000" + "0000000000000000000000000000000000000000000000000000000000000000" + "0000000000000000000000000000000000000000000000000000000001"); + BN_mod_exp(d, a, b, c, ctx); + BN_mul(e, a, a, ctx); + if (BN_cmp(d, e)) { + fprintf(stderr, "BN_mod_exp and BN_mul produce different results!\n"); + return 0; + } + BN_free(a); BN_free(b); BN_free(c); @@ -999,6 +1053,22 @@ int test_mod_exp_mont_consttime(BIO *bp, BN_CTX *ctx) d = BN_new(); e = BN_new(); + BN_one(a); + BN_one(b); + BN_zero(c); + if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) { + fprintf(stderr, "BN_mod_exp_mont_consttime with zero modulus " + "succeeded\n"); + return 0; + } + + BN_set_word(c, 16); + if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) { + fprintf(stderr, "BN_mod_exp_mont_consttime with even modulus " + "succeeded\n"); + return 0; + } + BN_bntest_rand(c, 30, 0, 1); /* must be odd for montgomery */ for (i = 0; i < num2; i++) { BN_bntest_rand(a, 20 + i * 5, 0, 0); diff --git a/deps/openssl/openssl/crypto/bn/exptest.c b/deps/openssl/openssl/crypto/bn/exptest.c index 8b3a4bae43288f..ac611c2e261449 100644 --- a/deps/openssl/openssl/crypto/bn/exptest.c +++ b/deps/openssl/openssl/crypto/bn/exptest.c @@ -72,6 +72,25 @@ static const char rnd_seed[] = "string to make the random number generator think it has entropy"; +/* + * Test that r == 0 in test_exp_mod_zero(). Returns one on success, + * returns zero and prints debug output otherwise. + */ +static int a_is_zero_mod_one(const char *method, const BIGNUM *r, + const BIGNUM *a) { + if (!BN_is_zero(r)) { + fprintf(stderr, "%s failed:\n", method); + fprintf(stderr, "a ** 0 mod 1 = r (should be 0)\n"); + fprintf(stderr, "a = "); + BN_print_fp(stderr, a); + fprintf(stderr, "\nr = "); + BN_print_fp(stderr, r); + fprintf(stderr, "\n"); + return 0; + } + return 1; +} + /* * test_exp_mod_zero tests that x**0 mod 1 == 0. It returns zero on success. */ @@ -79,8 +98,9 @@ static int test_exp_mod_zero() { BIGNUM a, p, m; BIGNUM r; + BN_ULONG one_word = 1; BN_CTX *ctx = BN_CTX_new(); - int ret = 1; + int ret = 1, failed = 0; BN_init(&m); BN_one(&m); @@ -92,21 +112,65 @@ static int test_exp_mod_zero() BN_zero(&p); BN_init(&r); - BN_mod_exp(&r, &a, &p, &m, ctx); - BN_CTX_free(ctx); - if (BN_is_zero(&r)) - ret = 0; - else { - printf("1**0 mod 1 = "); - BN_print_fp(stdout, &r); - printf(", should be 0\n"); + if (!BN_rand(&a, 1024, 0, 0)) + goto err; + + if (!BN_mod_exp(&r, &a, &p, &m, ctx)) + goto err; + + if (!a_is_zero_mod_one("BN_mod_exp", &r, &a)) + failed = 1; + + if (!BN_mod_exp_recp(&r, &a, &p, &m, ctx)) + goto err; + + if (!a_is_zero_mod_one("BN_mod_exp_recp", &r, &a)) + failed = 1; + + if (!BN_mod_exp_simple(&r, &a, &p, &m, ctx)) + goto err; + + if (!a_is_zero_mod_one("BN_mod_exp_simple", &r, &a)) + failed = 1; + + if (!BN_mod_exp_mont(&r, &a, &p, &m, ctx, NULL)) + goto err; + + if (!a_is_zero_mod_one("BN_mod_exp_mont", &r, &a)) + failed = 1; + + if (!BN_mod_exp_mont_consttime(&r, &a, &p, &m, ctx, NULL)) { + goto err; + } + + if (!a_is_zero_mod_one("BN_mod_exp_mont_consttime", &r, &a)) + failed = 1; + + /* + * A different codepath exists for single word multiplication + * in non-constant-time only. + */ + if (!BN_mod_exp_mont_word(&r, one_word, &p, &m, ctx, NULL)) + goto err; + + if (!BN_is_zero(&r)) { + fprintf(stderr, "BN_mod_exp_mont_word failed:\n"); + fprintf(stderr, "1 ** 0 mod 1 = r (should be 0)\n"); + fprintf(stderr, "r = "); + BN_print_fp(stderr, &r); + fprintf(stderr, "\n"); + return 0; } + ret = failed; + + err: BN_free(&r); BN_free(&a); BN_free(&p); BN_free(&m); + BN_CTX_free(ctx); return ret; } diff --git a/deps/openssl/openssl/crypto/bn/rsaz_exp.h b/deps/openssl/openssl/crypto/bn/rsaz_exp.h index 33361de99572f2..229e181f67b53d 100644 --- a/deps/openssl/openssl/crypto/bn/rsaz_exp.h +++ b/deps/openssl/openssl/crypto/bn/rsaz_exp.h @@ -1,32 +1,44 @@ -/****************************************************************************** -* Copyright(c) 2012, Intel Corp. -* Developers and authors: -* Shay Gueron (1, 2), and Vlad Krasnov (1) -* (1) Intel Corporation, Israel Development Center, Haifa, Israel -* (2) University of Haifa, Israel +/***************************************************************************** +* * +* Copyright (c) 2012, Intel Corporation * +* * +* All rights reserved. * +* * +* Redistribution and use in source and binary forms, with or without * +* modification, are permitted provided that the following conditions are * +* met: * +* * +* * Redistributions of source code must retain the above copyright * +* notice, this list of conditions and the following disclaimer. * +* * +* * Redistributions in binary form must reproduce the above copyright * +* notice, this list of conditions and the following disclaimer in the * +* documentation and/or other materials provided with the * +* distribution. * +* * +* * Neither the name of the Intel Corporation nor the names of its * +* contributors may be used to endorse or promote products derived from * +* this software without specific prior written permission. * +* * +* * +* THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION ""AS IS"" AND ANY * +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * +* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * +* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION OR * +* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * +* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * +* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * +* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * +* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * +* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * ****************************************************************************** -* LICENSE: -* This submission to OpenSSL is to be made available under the OpenSSL -* license, and only to the OpenSSL project, in order to allow integration -* into the publicly distributed code. -* The use of this code, or portions of this code, or concepts embedded in -* this code, or modification of this code and/or algorithm(s) in it, or the -* use of this code for any other purpose than stated above, requires special -* licensing. -****************************************************************************** -* DISCLAIMER: -* THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS AND THE COPYRIGHT OWNERS -* ``AS IS''. ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS OR THE COPYRIGHT -* OWNERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, -* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -******************************************************************************/ +* Developers and authors: * +* Shay Gueron (1, 2), and Vlad Krasnov (1) * +* (1) Intel Corporation, Israel Development Center, Haifa, Israel * +* (2) University of Haifa, Israel * +*****************************************************************************/ #ifndef RSAZ_EXP_H # define RSAZ_EXP_H diff --git a/deps/openssl/openssl/crypto/buffer/buf_str.c b/deps/openssl/openssl/crypto/buffer/buf_str.c index ebc5ab4646cef2..fa0d608e76bbb2 100644 --- a/deps/openssl/openssl/crypto/buffer/buf_str.c +++ b/deps/openssl/openssl/crypto/buffer/buf_str.c @@ -58,6 +58,7 @@ #include #include "cryptlib.h" +#include #include size_t BUF_strnlen(const char *str, size_t maxlen) @@ -72,7 +73,7 @@ size_t BUF_strnlen(const char *str, size_t maxlen) char *BUF_strdup(const char *str) { if (str == NULL) - return (NULL); + return NULL; return BUF_strndup(str, strlen(str)); } @@ -81,16 +82,22 @@ char *BUF_strndup(const char *str, size_t siz) char *ret; if (str == NULL) - return (NULL); + return NULL; siz = BUF_strnlen(str, siz); + if (siz >= INT_MAX) + return NULL; + ret = OPENSSL_malloc(siz + 1); if (ret == NULL) { BUFerr(BUF_F_BUF_STRNDUP, ERR_R_MALLOC_FAILURE); - return (NULL); + return NULL; } - BUF_strlcpy(ret, str, siz + 1); + + memcpy(ret, str, siz); + ret[siz] = '\0'; + return (ret); } @@ -98,13 +105,13 @@ void *BUF_memdup(const void *data, size_t siz) { void *ret; - if (data == NULL) - return (NULL); + if (data == NULL || siz >= INT_MAX) + return NULL; ret = OPENSSL_malloc(siz); if (ret == NULL) { BUFerr(BUF_F_BUF_MEMDUP, ERR_R_MALLOC_FAILURE); - return (NULL); + return NULL; } return memcpy(ret, data, siz); } diff --git a/deps/openssl/openssl/crypto/buffer/buffer.h b/deps/openssl/openssl/crypto/buffer/buffer.h index c343dd772f1efb..efd240a5f91e25 100644 --- a/deps/openssl/openssl/crypto/buffer/buffer.h +++ b/deps/openssl/openssl/crypto/buffer/buffer.h @@ -86,7 +86,13 @@ int BUF_MEM_grow(BUF_MEM *str, size_t len); int BUF_MEM_grow_clean(BUF_MEM *str, size_t len); size_t BUF_strnlen(const char *str, size_t maxlen); char *BUF_strdup(const char *str); + +/* + * Like strndup, but in addition, explicitly guarantees to never read past the + * first |siz| bytes of |str|. + */ char *BUF_strndup(const char *str, size_t siz); + void *BUF_memdup(const void *data, size_t siz); void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz); diff --git a/deps/openssl/openssl/crypto/camellia/camellia.c b/deps/openssl/openssl/crypto/camellia/camellia.c index b4a6766c623ca9..719fa61cf627f2 100644 --- a/deps/openssl/openssl/crypto/camellia/camellia.c +++ b/deps/openssl/openssl/crypto/camellia/camellia.c @@ -1,4 +1,4 @@ -/* crypto/camellia/camellia.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/camellia/camellia.c */ /* ==================================================================== * Copyright 2006 NTT (Nippon Telegraph and Telephone Corporation) . * ALL RIGHTS RESERVED. @@ -67,7 +67,7 @@ /* * Algorithm Specification - * http://info.isl.llia/specicrypt/eng/camellia/specifications.html + * http://info.isl.ntt.co.jp/crypt/eng/camellia/specifications.html */ /* diff --git a/deps/openssl/openssl/crypto/camellia/camellia.h b/deps/openssl/openssl/crypto/camellia/camellia.h index 9be7c0fd999667..45e8d25b1dd5b5 100644 --- a/deps/openssl/openssl/crypto/camellia/camellia.h +++ b/deps/openssl/openssl/crypto/camellia/camellia.h @@ -1,4 +1,4 @@ -/* crypto/camellia/camellia.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/camellia/camellia.h */ /* ==================================================================== * Copyright (c) 2006 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/camellia/cmll_cbc.c b/deps/openssl/openssl/crypto/camellia/cmll_cbc.c index a4907ca05f78c1..4017e00d9272a3 100644 --- a/deps/openssl/openssl/crypto/camellia/cmll_cbc.c +++ b/deps/openssl/openssl/crypto/camellia/cmll_cbc.c @@ -1,4 +1,4 @@ -/* crypto/camellia/camellia_cbc.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/camellia/camellia_cbc.c */ /* ==================================================================== * Copyright (c) 2006 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/camellia/cmll_cfb.c b/deps/openssl/openssl/crypto/camellia/cmll_cfb.c index 59b85225c35e20..78f2ae4566b12e 100644 --- a/deps/openssl/openssl/crypto/camellia/cmll_cfb.c +++ b/deps/openssl/openssl/crypto/camellia/cmll_cfb.c @@ -1,4 +1,4 @@ -/* crypto/camellia/camellia_cfb.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/camellia/camellia_cfb.c */ /* ==================================================================== * Copyright (c) 2006 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/camellia/cmll_ctr.c b/deps/openssl/openssl/crypto/camellia/cmll_ctr.c index b8f523d446481a..95e26621b7d853 100644 --- a/deps/openssl/openssl/crypto/camellia/cmll_ctr.c +++ b/deps/openssl/openssl/crypto/camellia/cmll_ctr.c @@ -1,4 +1,4 @@ -/* crypto/camellia/camellia_ctr.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/camellia/camellia_ctr.c */ /* ==================================================================== * Copyright (c) 2006 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/camellia/cmll_ecb.c b/deps/openssl/openssl/crypto/camellia/cmll_ecb.c index 16f1af86ac38d3..b030791b275cb7 100644 --- a/deps/openssl/openssl/crypto/camellia/cmll_ecb.c +++ b/deps/openssl/openssl/crypto/camellia/cmll_ecb.c @@ -1,4 +1,4 @@ -/* crypto/camellia/camellia_ecb.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/camellia/camellia_ecb.c */ /* ==================================================================== * Copyright (c) 2006 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/camellia/cmll_locl.h b/deps/openssl/openssl/crypto/camellia/cmll_locl.h index 4e4707b6213e43..2bd79b8c4eb332 100644 --- a/deps/openssl/openssl/crypto/camellia/cmll_locl.h +++ b/deps/openssl/openssl/crypto/camellia/cmll_locl.h @@ -1,4 +1,4 @@ -/* crypto/camellia/camellia_locl.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/camellia/camellia_locl.h */ /* ==================================================================== * Copyright 2006 NTT (Nippon Telegraph and Telephone Corporation) . * ALL RIGHTS RESERVED. diff --git a/deps/openssl/openssl/crypto/camellia/cmll_misc.c b/deps/openssl/openssl/crypto/camellia/cmll_misc.c index cbd250227becca..694d2fac8f1fd1 100644 --- a/deps/openssl/openssl/crypto/camellia/cmll_misc.c +++ b/deps/openssl/openssl/crypto/camellia/cmll_misc.c @@ -1,4 +1,4 @@ -/* crypto/camellia/camellia_misc.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/camellia/camellia_misc.c */ /* ==================================================================== * Copyright (c) 2006 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/camellia/cmll_ofb.c b/deps/openssl/openssl/crypto/camellia/cmll_ofb.c index 46c3ae2af73766..85eb8921568ffe 100644 --- a/deps/openssl/openssl/crypto/camellia/cmll_ofb.c +++ b/deps/openssl/openssl/crypto/camellia/cmll_ofb.c @@ -1,4 +1,4 @@ -/* crypto/camellia/camellia_ofb.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/camellia/camellia_ofb.c */ /* ==================================================================== * Copyright (c) 2006 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/camellia/cmll_utl.c b/deps/openssl/openssl/crypto/camellia/cmll_utl.c index d19ee19317ce7e..d5eb6b4d68b1a5 100644 --- a/deps/openssl/openssl/crypto/camellia/cmll_utl.c +++ b/deps/openssl/openssl/crypto/camellia/cmll_utl.c @@ -1,4 +1,4 @@ -/* crypto/camellia/cmll_utl.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/camellia/cmll_utl.c */ /* ==================================================================== * Copyright (c) 2011 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/cmac/cmac.c b/deps/openssl/openssl/crypto/cmac/cmac.c index 774e6dc919050d..2954b6eb7dcfeb 100644 --- a/deps/openssl/openssl/crypto/cmac/cmac.c +++ b/deps/openssl/openssl/crypto/cmac/cmac.c @@ -160,6 +160,14 @@ int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen, EVPerr(EVP_F_CMAC_INIT, EVP_R_DISABLED_FOR_FIPS); return 0; } + + /* Switch to FIPS cipher implementation if possible */ + if (cipher != NULL) { + const EVP_CIPHER *fcipher; + fcipher = FIPS_get_cipherbynid(EVP_CIPHER_nid(cipher)); + if (fcipher != NULL) + cipher = fcipher; + } /* * Other algorithm blocking will be done in FIPS_cmac_init, via * FIPS_cipherinit(). diff --git a/deps/openssl/openssl/crypto/cms/cms_enc.c b/deps/openssl/openssl/crypto/cms/cms_enc.c index 85ae928a496ff0..b14b4b68b5c950 100644 --- a/deps/openssl/openssl/crypto/cms/cms_enc.c +++ b/deps/openssl/openssl/crypto/cms/cms_enc.c @@ -195,7 +195,7 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec) ok = 1; err: - if (ec->key && !keep_key) { + if (ec->key && (!keep_key || !ok)) { OPENSSL_cleanse(ec->key, ec->keylen); OPENSSL_free(ec->key); ec->key = NULL; diff --git a/deps/openssl/openssl/crypto/cms/cms_pwri.c b/deps/openssl/openssl/crypto/cms/cms_pwri.c index a8322dcdf1a62c..b91c01691fec21 100644 --- a/deps/openssl/openssl/crypto/cms/cms_pwri.c +++ b/deps/openssl/openssl/crypto/cms/cms_pwri.c @@ -121,6 +121,9 @@ CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms, /* Setup algorithm identifier for cipher */ encalg = X509_ALGOR_new(); + if (encalg == NULL) { + goto merr; + } EVP_CIPHER_CTX_init(&ctx); if (EVP_EncryptInit_ex(&ctx, kekciph, NULL, NULL, NULL) <= 0) { diff --git a/deps/openssl/openssl/crypto/cms/cms_sd.c b/deps/openssl/openssl/crypto/cms/cms_sd.c index 721ffd5afb8535..a41aca8e1277c1 100644 --- a/deps/openssl/openssl/crypto/cms/cms_sd.c +++ b/deps/openssl/openssl/crypto/cms/cms_sd.c @@ -857,6 +857,8 @@ int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain) } else { const EVP_MD *md = EVP_MD_CTX_md(&mctx); pkctx = EVP_PKEY_CTX_new(si->pkey, NULL); + if (pkctx == NULL) + goto err; if (EVP_PKEY_verify_init(pkctx) <= 0) goto err; if (EVP_PKEY_CTX_set_signature_md(pkctx, md) <= 0) diff --git a/deps/openssl/openssl/crypto/cms/cms_smime.c b/deps/openssl/openssl/crypto/cms/cms_smime.c index 5522a376acb6ec..07e3472e1079a7 100644 --- a/deps/openssl/openssl/crypto/cms/cms_smime.c +++ b/deps/openssl/openssl/crypto/cms/cms_smime.c @@ -754,7 +754,7 @@ int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, unsigned int flags) BIO *cmsbio; int ret = 0; if (!(cmsbio = CMS_dataInit(cms, dcont))) { - CMSerr(CMS_F_CMS_FINAL, ERR_R_MALLOC_FAILURE); + CMSerr(CMS_F_CMS_FINAL, CMS_R_CMS_LIB); return 0; } diff --git a/deps/openssl/openssl/crypto/comp/c_zlib.c b/deps/openssl/openssl/crypto/comp/c_zlib.c index 6731af8b0d7b29..9c32614d3c7027 100644 --- a/deps/openssl/openssl/crypto/comp/c_zlib.c +++ b/deps/openssl/openssl/crypto/comp/c_zlib.c @@ -404,8 +404,9 @@ COMP_METHOD *COMP_zlib(void) void COMP_zlib_cleanup(void) { #ifdef ZLIB_SHARED - if (zlib_dso) + if (zlib_dso != NULL) DSO_free(zlib_dso); + zlib_dso = NULL; #endif } diff --git a/deps/openssl/openssl/crypto/conf/conf_def.c b/deps/openssl/openssl/crypto/conf/conf_def.c index faca9aeb571b9d..68c77cec7d8b46 100644 --- a/deps/openssl/openssl/crypto/conf/conf_def.c +++ b/deps/openssl/openssl/crypto/conf/conf_def.c @@ -225,12 +225,11 @@ static int def_load_bio(CONF *conf, BIO *in, long *line) goto err; } - section = (char *)OPENSSL_malloc(10); + section = BUF_strdup("default"); if (section == NULL) { CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE); goto err; } - BUF_strlcpy(section, "default", 10); if (_CONF_new_data(conf) == 0) { CONFerr(CONF_F_DEF_LOAD_BIO, ERR_R_MALLOC_FAILURE); diff --git a/deps/openssl/openssl/crypto/conf/conf_sap.c b/deps/openssl/openssl/crypto/conf/conf_sap.c index 544fe9738719c4..c042cf222dc7e4 100644 --- a/deps/openssl/openssl/crypto/conf/conf_sap.c +++ b/deps/openssl/openssl/crypto/conf/conf_sap.c @@ -90,6 +90,7 @@ void OPENSSL_config(const char *config_name) CONF_modules_load_file(NULL, config_name, CONF_MFLAGS_DEFAULT_SECTION | CONF_MFLAGS_IGNORE_MISSING_FILE); + openssl_configured = 1; } void OPENSSL_no_config() diff --git a/deps/openssl/openssl/crypto/cryptlib.c b/deps/openssl/openssl/crypto/cryptlib.c index ca0e3ccc0c7aa0..1925428f5ec532 100644 --- a/deps/openssl/openssl/crypto/cryptlib.c +++ b/deps/openssl/openssl/crypto/cryptlib.c @@ -953,13 +953,29 @@ void OPENSSL_showfatal(const char *fmta, ...) # if defined(_WIN32_WINNT) && _WIN32_WINNT>=0x0333 /* this -------------v--- guards NT-specific calls */ if (check_winnt() && OPENSSL_isservice() > 0) { - HANDLE h = RegisterEventSource(0, _T("OPENSSL")); - const TCHAR *pmsg = buf; - ReportEvent(h, EVENTLOG_ERROR_TYPE, 0, 0, 0, 1, 0, &pmsg, 0); - DeregisterEventSource(h); + HANDLE hEventLog = RegisterEventSource(NULL, _T("OpenSSL")); + + if (hEventLog != NULL) { + const TCHAR *pmsg = buf; + + if (!ReportEvent(hEventLog, EVENTLOG_ERROR_TYPE, 0, 0, NULL, + 1, 0, &pmsg, NULL)) { +#if defined(DEBUG) + /* + * We are in a situation where we tried to report a critical + * error and this failed for some reason. As a last resort, + * in debug builds, send output to the debugger or any other + * tool like DebugView which can monitor the output. + */ + OutputDebugString(pmsg); +#endif + } + + (void)DeregisterEventSource(hEventLog); + } } else # endif - MessageBox(NULL, buf, _T("OpenSSL: FATAL"), MB_OK | MB_ICONSTOP); + MessageBox(NULL, buf, _T("OpenSSL: FATAL"), MB_OK | MB_ICONERROR); } #else void OPENSSL_showfatal(const char *fmta, ...) @@ -1000,11 +1016,11 @@ void *OPENSSL_stderr(void) return stderr; } -int CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len) +int CRYPTO_memcmp(const volatile void *in_a, const volatile void *in_b, size_t len) { size_t i; - const unsigned char *a = in_a; - const unsigned char *b = in_b; + const volatile unsigned char *a = in_a; + const volatile unsigned char *b = in_b; unsigned char x = 0; for (i = 0; i < len; i++) diff --git a/deps/openssl/openssl/crypto/crypto.h b/deps/openssl/openssl/crypto/crypto.h index c450d7a3c374b3..6c644ce12a8250 100644 --- a/deps/openssl/openssl/crypto/crypto.h +++ b/deps/openssl/openssl/crypto/crypto.h @@ -628,7 +628,7 @@ void OPENSSL_init(void); * into a defined order as the return value when a != b is undefined, other * than to be non-zero. */ -int CRYPTO_memcmp(const void *a, const void *b, size_t len); +int CRYPTO_memcmp(const volatile void *a, const volatile void *b, size_t len); /* BEGIN ERROR CODES */ /* diff --git a/deps/openssl/openssl/crypto/des/des_old.c b/deps/openssl/openssl/crypto/des/des_old.c index 54b0968e663b4f..c5c5a00f00c101 100644 --- a/deps/openssl/openssl/crypto/des/des_old.c +++ b/deps/openssl/openssl/crypto/des/des_old.c @@ -1,4 +1,4 @@ -/* crypto/des/des_old.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/des/des_old.c */ /*- * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING diff --git a/deps/openssl/openssl/crypto/des/des_old.h b/deps/openssl/openssl/crypto/des/des_old.h index f1e1e2cb09cfb2..ee7607a2415f83 100644 --- a/deps/openssl/openssl/crypto/des/des_old.h +++ b/deps/openssl/openssl/crypto/des/des_old.h @@ -1,4 +1,4 @@ -/* crypto/des/des_old.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/des/des_old.h */ /*- * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING diff --git a/deps/openssl/openssl/crypto/des/des_old2.c b/deps/openssl/openssl/crypto/des/des_old2.c index f7d28a67135542..247ff8dcf85f70 100644 --- a/deps/openssl/openssl/crypto/des/des_old2.c +++ b/deps/openssl/openssl/crypto/des/des_old2.c @@ -1,4 +1,4 @@ -/* crypto/des/des_old.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/des/des_old.c */ /* * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING The diff --git a/deps/openssl/openssl/crypto/des/t/test b/deps/openssl/openssl/crypto/des/t/test deleted file mode 100644 index 97acd0552e4303..00000000000000 --- a/deps/openssl/openssl/crypto/des/t/test +++ /dev/null @@ -1,27 +0,0 @@ -#!./perl - -BEGIN { push(@INC, qw(../../../lib ../../lib ../lib lib)); } - -use DES; - -$key='00000000'; -$ks=DES::set_key($key); -@a=split(//,$ks); -foreach (@a) { printf "%02x-",ord($_); } -print "\n"; - - -$key=DES::random_key(); -print "($_)\n"; -@a=split(//,$key); -foreach (@a) { printf "%02x-",ord($_); } -print "\n"; -$str="this is and again into the breach"; -($k1,$k2)=DES::string_to_2keys($str); -@a=split(//,$k1); -foreach (@a) { printf "%02x-",ord($_); } -print "\n"; -@a=split(//,$k2); -foreach (@a) { printf "%02x-",ord($_); } -print "\n"; - diff --git a/deps/openssl/openssl/crypto/dh/dh.h b/deps/openssl/openssl/crypto/dh/dh.h index 0502f1a9cc14dc..a5bd9016aae85a 100644 --- a/deps/openssl/openssl/crypto/dh/dh.h +++ b/deps/openssl/openssl/crypto/dh/dh.h @@ -142,7 +142,7 @@ struct dh_st { BIGNUM *p; BIGNUM *g; long length; /* optional */ - BIGNUM *pub_key; /* g^x */ + BIGNUM *pub_key; /* g^x % p */ BIGNUM *priv_key; /* x */ int flags; BN_MONT_CTX *method_mont_p; @@ -174,6 +174,7 @@ struct dh_st { /* DH_check_pub_key error codes */ # define DH_CHECK_PUBKEY_TOO_SMALL 0x01 # define DH_CHECK_PUBKEY_TOO_LARGE 0x02 +# define DH_CHECK_PUBKEY_INVALID 0x04 /* * primes p where (p-1)/2 is prime too are called "safe"; we define this for diff --git a/deps/openssl/openssl/crypto/dh/dh_check.c b/deps/openssl/openssl/crypto/dh/dh_check.c index 347467c6a43369..027704111432d2 100644 --- a/deps/openssl/openssl/crypto/dh/dh_check.c +++ b/deps/openssl/openssl/crypto/dh/dh_check.c @@ -151,23 +151,37 @@ int DH_check(const DH *dh, int *ret) int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *ret) { int ok = 0; - BIGNUM *q = NULL; + BIGNUM *tmp = NULL; + BN_CTX *ctx = NULL; *ret = 0; - q = BN_new(); - if (q == NULL) + ctx = BN_CTX_new(); + if (ctx == NULL) goto err; - BN_set_word(q, 1); - if (BN_cmp(pub_key, q) <= 0) + BN_CTX_start(ctx); + tmp = BN_CTX_get(ctx); + if (tmp == NULL || !BN_set_word(tmp, 1)) + goto err; + if (BN_cmp(pub_key, tmp) <= 0) *ret |= DH_CHECK_PUBKEY_TOO_SMALL; - BN_copy(q, dh->p); - BN_sub_word(q, 1); - if (BN_cmp(pub_key, q) >= 0) + if (BN_copy(tmp, dh->p) == NULL || !BN_sub_word(tmp, 1)) + goto err; + if (BN_cmp(pub_key, tmp) >= 0) *ret |= DH_CHECK_PUBKEY_TOO_LARGE; + if (dh->q != NULL) { + /* Check pub_key^q == 1 mod p */ + if (!BN_mod_exp(tmp, pub_key, dh->q, dh->p, ctx)) + goto err; + if (!BN_is_one(tmp)) + *ret |= DH_CHECK_PUBKEY_INVALID; + } + ok = 1; err: - if (q != NULL) - BN_free(q); + if (ctx != NULL) { + BN_CTX_end(ctx); + BN_CTX_free(ctx); + } return (ok); } diff --git a/deps/openssl/openssl/crypto/dh/dhtest.c b/deps/openssl/openssl/crypto/dh/dhtest.c index c9dd76bc75e175..c5d3d87ea549e0 100644 --- a/deps/openssl/openssl/crypto/dh/dhtest.c +++ b/deps/openssl/openssl/crypto/dh/dhtest.c @@ -471,6 +471,31 @@ static const unsigned char dhtest_2048_256_Z[] = { 0xC2, 0x6C, 0x5D, 0x7C }; +static const unsigned char dhtest_rfc5114_2048_224_bad_y[] = { + 0x45, 0x32, 0x5F, 0x51, 0x07, 0xE5, 0xDF, 0x1C, 0xD6, 0x02, 0x82, 0xB3, + 0x32, 0x8F, 0xA4, 0x0F, 0x87, 0xB8, 0x41, 0xFE, 0xB9, 0x35, 0xDE, 0xAD, + 0xC6, 0x26, 0x85, 0xB4, 0xFF, 0x94, 0x8C, 0x12, 0x4C, 0xBF, 0x5B, 0x20, + 0xC4, 0x46, 0xA3, 0x26, 0xEB, 0xA4, 0x25, 0xB7, 0x68, 0x8E, 0xCC, 0x67, + 0xBA, 0xEA, 0x58, 0xD0, 0xF2, 0xE9, 0xD2, 0x24, 0x72, 0x60, 0xDA, 0x88, + 0x18, 0x9C, 0xE0, 0x31, 0x6A, 0xAD, 0x50, 0x6D, 0x94, 0x35, 0x8B, 0x83, + 0x4A, 0x6E, 0xFA, 0x48, 0x73, 0x0F, 0x83, 0x87, 0xFF, 0x6B, 0x66, 0x1F, + 0xA8, 0x82, 0xC6, 0x01, 0xE5, 0x80, 0xB5, 0xB0, 0x52, 0xD0, 0xE9, 0xD8, + 0x72, 0xF9, 0x7D, 0x5B, 0x8B, 0xA5, 0x4C, 0xA5, 0x25, 0x95, 0x74, 0xE2, + 0x7A, 0x61, 0x4E, 0xA7, 0x8F, 0x12, 0xE2, 0xD2, 0x9D, 0x8C, 0x02, 0x70, + 0x34, 0x44, 0x32, 0xC7, 0xB2, 0xF3, 0xB9, 0xFE, 0x17, 0x2B, 0xD6, 0x1F, + 0x8B, 0x7E, 0x4A, 0xFA, 0xA3, 0xB5, 0x3E, 0x7A, 0x81, 0x9A, 0x33, 0x66, + 0x62, 0xA4, 0x50, 0x18, 0x3E, 0xA2, 0x5F, 0x00, 0x07, 0xD8, 0x9B, 0x22, + 0xE4, 0xEC, 0x84, 0xD5, 0xEB, 0x5A, 0xF3, 0x2A, 0x31, 0x23, 0xD8, 0x44, + 0x22, 0x2A, 0x8B, 0x37, 0x44, 0xCC, 0xC6, 0x87, 0x4B, 0xBE, 0x50, 0x9D, + 0x4A, 0xC4, 0x8E, 0x45, 0xCF, 0x72, 0x4D, 0xC0, 0x89, 0xB3, 0x72, 0xED, + 0x33, 0x2C, 0xBC, 0x7F, 0x16, 0x39, 0x3B, 0xEB, 0xD2, 0xDD, 0xA8, 0x01, + 0x73, 0x84, 0x62, 0xB9, 0x29, 0xD2, 0xC9, 0x51, 0x32, 0x9E, 0x7A, 0x6A, + 0xCF, 0xC1, 0x0A, 0xDB, 0x0E, 0xE0, 0x62, 0x77, 0x6F, 0x59, 0x62, 0x72, + 0x5A, 0x69, 0xA6, 0x5B, 0x70, 0xCA, 0x65, 0xC4, 0x95, 0x6F, 0x9A, 0xC2, + 0xDF, 0x72, 0x6D, 0xB1, 0x1E, 0x54, 0x7B, 0x51, 0xB4, 0xEF, 0x7F, 0x89, + 0x93, 0x74, 0x89, 0x59 +}; + typedef struct { DH *(*get_param) (void); const unsigned char *xA; @@ -503,10 +528,15 @@ static const rfc5114_td rfctd[] = { static int run_rfc5114_tests(void) { int i; + DH *dhA = NULL; + DH *dhB = NULL; + unsigned char *Z1 = NULL; + unsigned char *Z2 = NULL; + const rfc5114_td *td = NULL; + BIGNUM *bady = NULL; + for (i = 0; i < (int)(sizeof(rfctd) / sizeof(rfc5114_td)); i++) { - DH *dhA, *dhB; - unsigned char *Z1 = NULL, *Z2 = NULL; - const rfc5114_td *td = rfctd + i; + td = rfctd + i; /* Set up DH structures setting key components */ dhA = td->get_param(); dhB = td->get_param(); @@ -533,9 +563,9 @@ static int run_rfc5114_tests(void) * Work out shared secrets using both sides and compare with expected * values. */ - if (!DH_compute_key(Z1, dhB->pub_key, dhA)) + if (DH_compute_key(Z1, dhB->pub_key, dhA) == -1) goto bad_err; - if (!DH_compute_key(Z2, dhA->pub_key, dhB)) + if (DH_compute_key(Z2, dhA->pub_key, dhB) == -1) goto bad_err; if (memcmp(Z1, td->Z, td->Z_len)) @@ -549,14 +579,63 @@ static int run_rfc5114_tests(void) DH_free(dhB); OPENSSL_free(Z1); OPENSSL_free(Z2); + dhA = NULL; + dhB = NULL; + Z1 = NULL; + Z2 = NULL; + } + /* Now i == OSSL_NELEM(rfctd) */ + /* RFC5114 uses unsafe primes, so now test an invalid y value */ + dhA = DH_get_2048_224(); + if (dhA == NULL) + goto bad_err; + Z1 = OPENSSL_malloc(DH_size(dhA)); + if (Z1 == NULL) + goto bad_err; + + bady = BN_bin2bn(dhtest_rfc5114_2048_224_bad_y, + sizeof(dhtest_rfc5114_2048_224_bad_y), NULL); + if (bady == NULL) + goto bad_err; + + if (!DH_generate_key(dhA)) + goto bad_err; + + if (DH_compute_key(Z1, bady, dhA) != -1) { + /* + * DH_compute_key should fail with -1. If we get here we unexpectedly + * allowed an invalid y value + */ + goto err; } + /* We'll have a stale error on the queue from the above test so clear it */ + ERR_clear_error(); + + printf("RFC5114 parameter test %d OK\n", i + 1); + + BN_free(bady); + DH_free(dhA); + OPENSSL_free(Z1); + return 1; bad_err: + BN_free(bady); + DH_free(dhA); + DH_free(dhB); + OPENSSL_free(Z1); + OPENSSL_free(Z2); + fprintf(stderr, "Initalisation error RFC5114 set %d\n", i + 1); ERR_print_errors_fp(stderr); return 0; err: + BN_free(bady); + DH_free(dhA); + DH_free(dhB); + OPENSSL_free(Z1); + OPENSSL_free(Z2); + fprintf(stderr, "Test failed RFC5114 set %d\n", i + 1); return 0; } diff --git a/deps/openssl/openssl/crypto/dsa/dsa_ameth.c b/deps/openssl/openssl/crypto/dsa/dsa_ameth.c index 2a5cd71371a761..cc83d6e6ad3b6f 100644 --- a/deps/openssl/openssl/crypto/dsa/dsa_ameth.c +++ b/deps/openssl/openssl/crypto/dsa/dsa_ameth.c @@ -191,6 +191,8 @@ static int dsa_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8) STACK_OF(ASN1_TYPE) *ndsa = NULL; DSA *dsa = NULL; + int ret = 0; + if (!PKCS8_pkey_get0(NULL, &p, &pklen, &palg, p8)) return 0; X509_ALGOR_get0(NULL, &ptype, &pval, palg); @@ -262,23 +264,21 @@ static int dsa_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8) } EVP_PKEY_assign_DSA(pkey, dsa); - BN_CTX_free(ctx); - if (ndsa) - sk_ASN1_TYPE_pop_free(ndsa, ASN1_TYPE_free); - else - ASN1_STRING_clear_free(privkey); - return 1; + ret = 1; + goto done; decerr: - DSAerr(DSA_F_DSA_PRIV_DECODE, EVP_R_DECODE_ERROR); + DSAerr(DSA_F_DSA_PRIV_DECODE, DSA_R_DECODE_ERROR); dsaerr: + DSA_free(dsa); + done: BN_CTX_free(ctx); - if (privkey) + if (ndsa) + sk_ASN1_TYPE_pop_free(ndsa, ASN1_TYPE_free); + else ASN1_STRING_clear_free(privkey); - sk_ASN1_TYPE_pop_free(ndsa, ASN1_TYPE_free); - DSA_free(dsa); - return 0; + return ret; } static int dsa_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey) @@ -318,6 +318,7 @@ static int dsa_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey) dplen = i2d_ASN1_INTEGER(prkey, &dp); ASN1_STRING_clear_free(prkey); + prkey = NULL; if (!PKCS8_pkey_set0(p8, OBJ_nid2obj(NID_dsa), 0, V_ASN1_SEQUENCE, params, dp, dplen)) diff --git a/deps/openssl/openssl/crypto/dsa/dsa_gen.c b/deps/openssl/openssl/crypto/dsa/dsa_gen.c index 5a328aaab5b408..15f3bb4f3f3951 100644 --- a/deps/openssl/openssl/crypto/dsa/dsa_gen.c +++ b/deps/openssl/openssl/crypto/dsa/dsa_gen.c @@ -114,16 +114,8 @@ int DSA_generate_parameters_ex(DSA *ret, int bits, } # endif else { - const EVP_MD *evpmd; - size_t qbits = bits >= 2048 ? 256 : 160; - - if (bits >= 2048) { - qbits = 256; - evpmd = EVP_sha256(); - } else { - qbits = 160; - evpmd = EVP_sha1(); - } + const EVP_MD *evpmd = bits >= 2048 ? EVP_sha256() : EVP_sha1(); + size_t qbits = EVP_MD_size(evpmd) * 8; return dsa_builtin_paramgen(ret, bits, qbits, evpmd, seed_in, seed_len, NULL, counter_ret, @@ -176,13 +168,14 @@ int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits, if (seed_in != NULL) memcpy(seed, seed_in, seed_len); - if ((ctx = BN_CTX_new()) == NULL) + if ((mont = BN_MONT_CTX_new()) == NULL) goto err; - if ((mont = BN_MONT_CTX_new()) == NULL) + if ((ctx = BN_CTX_new()) == NULL) goto err; BN_CTX_start(ctx); + r0 = BN_CTX_get(ctx); g = BN_CTX_get(ctx); W = BN_CTX_get(ctx); @@ -203,7 +196,7 @@ int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits, if (!BN_GENCB_call(cb, 0, m++)) goto err; - if (!seed_len) { + if (!seed_len || !seed_in) { if (RAND_pseudo_bytes(seed, qsize) < 0) goto err; seed_is_random = 1; diff --git a/deps/openssl/openssl/crypto/dsa/dsa_ossl.c b/deps/openssl/openssl/crypto/dsa/dsa_ossl.c index f0ec8faa84cc3c..efc4f1b6aebab0 100644 --- a/deps/openssl/openssl/crypto/dsa/dsa_ossl.c +++ b/deps/openssl/openssl/crypto/dsa/dsa_ossl.c @@ -187,9 +187,6 @@ static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) if (!BN_mod_mul(s, s, kinv, dsa->q, ctx)) goto err; - ret = DSA_SIG_new(); - if (ret == NULL) - goto err; /* * Redo if r or s is zero as required by FIPS 186-3: this is very * unlikely. @@ -201,11 +198,14 @@ static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) } goto redo; } + ret = DSA_SIG_new(); + if (ret == NULL) + goto err; ret->r = r; ret->s = s; err: - if (!ret) { + if (ret == NULL) { DSAerr(DSA_F_DSA_DO_SIGN, reason); BN_free(r); BN_free(s); diff --git a/deps/openssl/openssl/crypto/dso/dso.h b/deps/openssl/openssl/crypto/dso/dso.h index 7c4a1dc4a620fb..c9013f5cea8b25 100644 --- a/deps/openssl/openssl/crypto/dso/dso.h +++ b/deps/openssl/openssl/crypto/dso/dso.h @@ -1,4 +1,4 @@ -/* dso.h -*- mode:C; c-file-style: "eay" -*- */ +/* dso.h */ /* * Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL project * 2000. diff --git a/deps/openssl/openssl/crypto/dso/dso_dl.c b/deps/openssl/openssl/crypto/dso/dso_dl.c index 0087ac54afe1fc..ceedf66e885625 100644 --- a/deps/openssl/openssl/crypto/dso/dso_dl.c +++ b/deps/openssl/openssl/crypto/dso/dso_dl.c @@ -1,4 +1,4 @@ -/* dso_dl.c -*- mode:C; c-file-style: "eay" -*- */ +/* dso_dl.c */ /* * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project * 2000. diff --git a/deps/openssl/openssl/crypto/dso/dso_dlfcn.c b/deps/openssl/openssl/crypto/dso/dso_dlfcn.c index f629f0380d8c85..78df723ffbae88 100644 --- a/deps/openssl/openssl/crypto/dso/dso_dlfcn.c +++ b/deps/openssl/openssl/crypto/dso/dso_dlfcn.c @@ -1,4 +1,4 @@ -/* dso_dlfcn.c -*- mode:C; c-file-style: "eay" -*- */ +/* dso_dlfcn.c */ /* * Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL project * 2000. diff --git a/deps/openssl/openssl/crypto/dso/dso_lib.c b/deps/openssl/openssl/crypto/dso/dso_lib.c index 09b8eafccacc3d..2beb7c1ba54246 100644 --- a/deps/openssl/openssl/crypto/dso/dso_lib.c +++ b/deps/openssl/openssl/crypto/dso/dso_lib.c @@ -1,4 +1,4 @@ -/* dso_lib.c -*- mode:C; c-file-style: "eay" -*- */ +/* dso_lib.c */ /* * Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL project * 2000. @@ -122,6 +122,7 @@ DSO *DSO_new_method(DSO_METHOD *meth) ret->meth = meth; ret->references = 1; if ((ret->meth->init != NULL) && !ret->meth->init(ret)) { + sk_void_free(ret->meth_data); OPENSSL_free(ret); ret = NULL; } diff --git a/deps/openssl/openssl/crypto/dso/dso_vms.c b/deps/openssl/openssl/crypto/dso/dso_vms.c index d0794b8fb044b8..1efd84b94539ec 100644 --- a/deps/openssl/openssl/crypto/dso/dso_vms.c +++ b/deps/openssl/openssl/crypto/dso/dso_vms.c @@ -1,4 +1,4 @@ -/* dso_vms.c -*- mode:C; c-file-style: "eay" -*- */ +/* dso_vms.c */ /* * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project * 2000. diff --git a/deps/openssl/openssl/crypto/dso/dso_win32.c b/deps/openssl/openssl/crypto/dso/dso_win32.c index c65234e9c44bb5..706e754a3f9f75 100644 --- a/deps/openssl/openssl/crypto/dso/dso_win32.c +++ b/deps/openssl/openssl/crypto/dso/dso_win32.c @@ -1,4 +1,4 @@ -/* dso_win32.c -*- mode:C; c-file-style: "eay" -*- */ +/* dso_win32.c */ /* * Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL project * 2000. diff --git a/deps/openssl/openssl/crypto/ec/Makefile b/deps/openssl/openssl/crypto/ec/Makefile index 359ef4e40fd4b5..89491454a4412d 100644 --- a/deps/openssl/openssl/crypto/ec/Makefile +++ b/deps/openssl/openssl/crypto/ec/Makefile @@ -89,7 +89,7 @@ dclean: mv -f Makefile.new $(MAKEFILE) clean: - rm -f *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff + rm -f *.s *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff # DO NOT DELETE THIS LINE -- make depend depends on it. diff --git a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl index 84379fce1cb95e..7140860e245b45 100755 --- a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl +++ b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl @@ -81,7 +81,7 @@ $addx = ($1>=12); } -if (!$addx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9])\.([0-9]+)/) { +if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([3-9])\.([0-9]+)/) { my $ver = $2 + $3/100.0; # 3.1->3.01, 3.10->3.10 $avx = ($ver>=3.0) + ($ver>=3.01); $addx = ($ver>=3.03); @@ -2001,6 +2001,7 @@ () push %r15 sub \$32*5+8, %rsp +.Lpoint_double_shortcut$x: movdqu 0x00($a_ptr), %xmm0 # copy *(P256_POINT *)$a_ptr.x mov $a_ptr, $b_ptr # backup copy movdqu 0x10($a_ptr), %xmm1 @@ -2291,6 +2292,7 @@ () mov 0x40+8*1($b_ptr), $acc6 mov 0x40+8*2($b_ptr), $acc7 mov 0x40+8*3($b_ptr), $acc0 + movq $b_ptr, %xmm1 lea 0x40-$bias($b_ptr), $a_ptr lea $Z1sqr(%rsp), $r_ptr # Z1^2 @@ -2346,7 +2348,7 @@ () test $acc0, $acc0 jnz .Ladd_proceed$x # (in1infty || in2infty)? test $acc1, $acc1 - jz .Ladd_proceed$x # is_equal(S1,S2)? + jz .Ladd_double$x # is_equal(S1,S2)? movq %xmm0, $r_ptr # restore $r_ptr pxor %xmm0, %xmm0 @@ -2358,6 +2360,13 @@ () movdqu %xmm0, 0x50($r_ptr) jmp .Ladd_done$x +.align 32 +.Ladd_double$x: + movq %xmm1, $a_ptr # restore $a_ptr + movq %xmm0, $r_ptr # restore $r_ptr + add \$`32*(18-5)`, %rsp # difference in frame sizes + jmp .Lpoint_double_shortcut$x + .align 32 .Ladd_proceed$x: `&load_for_sqr("$R(%rsp)", "$src0")` diff --git a/deps/openssl/openssl/crypto/ec/ec.h b/deps/openssl/openssl/crypto/ec/ec.h index 6d3178f609f493..81e6faf6c5c502 100644 --- a/deps/openssl/openssl/crypto/ec/ec.h +++ b/deps/openssl/openssl/crypto/ec/ec.h @@ -106,7 +106,7 @@ typedef enum { /** the point is encoded as z||x, where the octet z specifies * which solution of the quadratic equation y is */ POINT_CONVERSION_COMPRESSED = 2, - /** the point is encoded as z||x||y, where z is the octet 0x02 */ + /** the point is encoded as z||x||y, where z is the octet 0x04 */ POINT_CONVERSION_UNCOMPRESSED = 4, /** the point is encoded as z||x||y, where the octet z specifies * which solution of the quadratic equation y is */ diff --git a/deps/openssl/openssl/crypto/ec/ec2_smpl.c b/deps/openssl/openssl/crypto/ec/ec2_smpl.c index 077c7fc8dda595..5b27b91fcc94f3 100644 --- a/deps/openssl/openssl/crypto/ec/ec2_smpl.c +++ b/deps/openssl/openssl/crypto/ec/ec2_smpl.c @@ -746,6 +746,7 @@ int ec_GF2m_simple_make_affine(const EC_GROUP *group, EC_POINT *point, goto err; if (!BN_one(&point->Z)) goto err; + point->Z_is_one = 1; ret = 1; diff --git a/deps/openssl/openssl/crypto/ec/ec_asn1.c b/deps/openssl/openssl/crypto/ec/ec_asn1.c index 4ad8494981bfc4..33abf61f44417c 100644 --- a/deps/openssl/openssl/crypto/ec/ec_asn1.c +++ b/deps/openssl/openssl/crypto/ec/ec_asn1.c @@ -970,8 +970,9 @@ EC_GROUP *d2i_ECPKParameters(EC_GROUP **a, const unsigned char **in, long len) { EC_GROUP *group = NULL; ECPKPARAMETERS *params = NULL; + const unsigned char *p = *in; - if ((params = d2i_ECPKPARAMETERS(NULL, in, len)) == NULL) { + if ((params = d2i_ECPKPARAMETERS(NULL, &p, len)) == NULL) { ECerr(EC_F_D2I_ECPKPARAMETERS, EC_R_D2I_ECPKPARAMETERS_FAILURE); ECPKPARAMETERS_free(params); return NULL; @@ -989,6 +990,7 @@ EC_GROUP *d2i_ECPKParameters(EC_GROUP **a, const unsigned char **in, long len) *a = group; ECPKPARAMETERS_free(params); + *in = p; return (group); } @@ -1016,8 +1018,9 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len) int ok = 0; EC_KEY *ret = NULL; EC_PRIVATEKEY *priv_key = NULL; + const unsigned char *p = *in; - if ((priv_key = d2i_EC_PRIVATEKEY(NULL, in, len)) == NULL) { + if ((priv_key = d2i_EC_PRIVATEKEY(NULL, &p, len)) == NULL) { ECerr(EC_F_D2I_ECPRIVATEKEY, ERR_R_EC_LIB); return NULL; } @@ -1096,6 +1099,7 @@ EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len) if (a) *a = ret; + *in = p; ok = 1; err: if (!ok) { diff --git a/deps/openssl/openssl/crypto/ec/ec_key.c b/deps/openssl/openssl/crypto/ec/ec_key.c index 55ce3fe9beb2fd..bc94ab5661ffed 100644 --- a/deps/openssl/openssl/crypto/ec/ec_key.c +++ b/deps/openssl/openssl/crypto/ec/ec_key.c @@ -366,7 +366,10 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, BN_CTX *ctx = NULL; BIGNUM *tx, *ty; EC_POINT *point = NULL; - int ok = 0, tmp_nid, is_char_two = 0; + int ok = 0; +#ifndef OPENSSL_NO_EC2M + int tmp_nid, is_char_two = 0; +#endif if (!key || !key->group || !x || !y) { ECerr(EC_F_EC_KEY_SET_PUBLIC_KEY_AFFINE_COORDINATES, @@ -382,14 +385,17 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, if (!point) goto err; + tx = BN_CTX_get(ctx); + ty = BN_CTX_get(ctx); + if (ty == NULL) + goto err; + +#ifndef OPENSSL_NO_EC2M tmp_nid = EC_METHOD_get_field_type(EC_GROUP_method_of(key->group)); if (tmp_nid == NID_X9_62_characteristic_two_field) is_char_two = 1; - tx = BN_CTX_get(ctx); - ty = BN_CTX_get(ctx); -#ifndef OPENSSL_NO_EC2M if (is_char_two) { if (!EC_POINT_set_affine_coordinates_GF2m(key->group, point, x, y, ctx)) diff --git a/deps/openssl/openssl/crypto/ec/ecp_nistp224.c b/deps/openssl/openssl/crypto/ec/ecp_nistp224.c index ed09f97ade6837..d81cc9ce6b1a0d 100644 --- a/deps/openssl/openssl/crypto/ec/ecp_nistp224.c +++ b/deps/openssl/openssl/crypto/ec/ecp_nistp224.c @@ -1657,8 +1657,7 @@ int ec_GFp_nistp224_precompute_mult(EC_GROUP *group, BN_CTX *ctx) */ if (0 == EC_POINT_cmp(group, generator, group->generator, ctx)) { memcpy(pre->g_pre_comp, gmul, sizeof(pre->g_pre_comp)); - ret = 1; - goto err; + goto done; } if ((!BN_to_felem(pre->g_pre_comp[0][1][0], &group->generator->X)) || (!BN_to_felem(pre->g_pre_comp[0][1][1], &group->generator->Y)) || @@ -1736,6 +1735,7 @@ int ec_GFp_nistp224_precompute_mult(EC_GROUP *group, BN_CTX *ctx) } make_points_affine(31, &(pre->g_pre_comp[0][1]), tmp_felems); + done: if (!EC_EX_DATA_set_data(&group->extra_data, pre, nistp224_pre_comp_dup, nistp224_pre_comp_free, nistp224_pre_comp_clear_free)) diff --git a/deps/openssl/openssl/crypto/ec/ecp_nistp256.c b/deps/openssl/openssl/crypto/ec/ecp_nistp256.c index a5887086c63856..78d191aac7afbb 100644 --- a/deps/openssl/openssl/crypto/ec/ecp_nistp256.c +++ b/deps/openssl/openssl/crypto/ec/ecp_nistp256.c @@ -2249,8 +2249,7 @@ int ec_GFp_nistp256_precompute_mult(EC_GROUP *group, BN_CTX *ctx) */ if (0 == EC_POINT_cmp(group, generator, group->generator, ctx)) { memcpy(pre->g_pre_comp, gmul, sizeof(pre->g_pre_comp)); - ret = 1; - goto err; + goto done; } if ((!BN_to_felem(x_tmp, &group->generator->X)) || (!BN_to_felem(y_tmp, &group->generator->Y)) || @@ -2337,6 +2336,7 @@ int ec_GFp_nistp256_precompute_mult(EC_GROUP *group, BN_CTX *ctx) } make_points_affine(31, &(pre->g_pre_comp[0][1]), tmp_smallfelems); + done: if (!EC_EX_DATA_set_data(&group->extra_data, pre, nistp256_pre_comp_dup, nistp256_pre_comp_free, nistp256_pre_comp_clear_free)) diff --git a/deps/openssl/openssl/crypto/ec/ecp_nistp521.c b/deps/openssl/openssl/crypto/ec/ecp_nistp521.c index 360b9a3516f611..c53a61bbfb697d 100644 --- a/deps/openssl/openssl/crypto/ec/ecp_nistp521.c +++ b/deps/openssl/openssl/crypto/ec/ecp_nistp521.c @@ -2056,8 +2056,7 @@ int ec_GFp_nistp521_precompute_mult(EC_GROUP *group, BN_CTX *ctx) */ if (0 == EC_POINT_cmp(group, generator, group->generator, ctx)) { memcpy(pre->g_pre_comp, gmul, sizeof(pre->g_pre_comp)); - ret = 1; - goto err; + goto done; } if ((!BN_to_felem(pre->g_pre_comp[1][0], &group->generator->X)) || (!BN_to_felem(pre->g_pre_comp[1][1], &group->generator->Y)) || @@ -2115,6 +2114,7 @@ int ec_GFp_nistp521_precompute_mult(EC_GROUP *group, BN_CTX *ctx) } make_points_affine(15, &(pre->g_pre_comp[1]), tmp_felems); + done: if (!EC_EX_DATA_set_data(&group->extra_data, pre, nistp521_pre_comp_dup, nistp521_pre_comp_free, nistp521_pre_comp_clear_free)) diff --git a/deps/openssl/openssl/crypto/ec/ecp_nistz256_table.c b/deps/openssl/openssl/crypto/ec/ecp_nistz256_table.c index 216d024e01203c..2f0797db6b9b66 100644 --- a/deps/openssl/openssl/crypto/ec/ecp_nistz256_table.c +++ b/deps/openssl/openssl/crypto/ec/ecp_nistz256_table.c @@ -17,7 +17,7 @@ __attribute((aligned(4096))) #elif defined(_MSC_VER) __declspec(align(4096)) #elif defined(__SUNPRO_C) -# pragma align 4096(ecp_nistz256_precomputed) +# pragma align 64(ecp_nistz256_precomputed) #endif static const BN_ULONG ecp_nistz256_precomputed[37][64 * sizeof(P256_POINT_AFFINE) / diff --git a/deps/openssl/openssl/crypto/ec/ectest.c b/deps/openssl/openssl/crypto/ec/ectest.c index fede530bc1391b..40a1f003259faf 100644 --- a/deps/openssl/openssl/crypto/ec/ectest.c +++ b/deps/openssl/openssl/crypto/ec/ectest.c @@ -1591,7 +1591,7 @@ struct nistp_test_params { int degree; /* * Qx, Qy and D are taken from - * http://csrcdocut.gov/groups/ST/toolkit/documents/Examples/ECDSA_Prime.pdf + * http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/ECDSA_Prime.pdf * Otherwise, values are standard curve parameters from FIPS 180-3 */ const char *p, *a, *b, *Qx, *Qy, *Gx, *Gy, *order, *d; @@ -1758,9 +1758,18 @@ static void nistp_single_test(const struct nistp_test_params *test) if (0 != EC_POINT_cmp(NISTP, Q, Q_CHECK, ctx)) ABORT; + /* + * We have not performed precomputation so have_precompute mult should be + * false + */ + if (EC_GROUP_have_precompute_mult(NISTP)) + ABORT; + /* now repeat all tests with precomputation */ if (!EC_GROUP_precompute_mult(NISTP, ctx)) ABORT; + if (!EC_GROUP_have_precompute_mult(NISTP)) + ABORT; /* fixed point multiplication */ EC_POINT_mul(NISTP, Q, m, NULL, NULL, ctx); diff --git a/deps/openssl/openssl/crypto/ecdsa/ecdsa.h b/deps/openssl/openssl/crypto/ecdsa/ecdsa.h index c4016ac3e19b3f..a6f0930f829ccc 100644 --- a/deps/openssl/openssl/crypto/ecdsa/ecdsa.h +++ b/deps/openssl/openssl/crypto/ecdsa/ecdsa.h @@ -233,7 +233,7 @@ void *ECDSA_get_ex_data(EC_KEY *d, int idx); * \return pointer to a ECDSA_METHOD structure or NULL if an error occurred */ -ECDSA_METHOD *ECDSA_METHOD_new(ECDSA_METHOD *ecdsa_method); +ECDSA_METHOD *ECDSA_METHOD_new(const ECDSA_METHOD *ecdsa_method); /** frees a ECDSA_METHOD structure * \param ecdsa_method pointer to the ECDSA_METHOD structure diff --git a/deps/openssl/openssl/crypto/ecdsa/ecs_lib.c b/deps/openssl/openssl/crypto/ecdsa/ecs_lib.c index 1c02310318500b..8dc1dda462598a 100644 --- a/deps/openssl/openssl/crypto/ecdsa/ecs_lib.c +++ b/deps/openssl/openssl/crypto/ecdsa/ecs_lib.c @@ -276,7 +276,7 @@ void *ECDSA_get_ex_data(EC_KEY *d, int idx) return (CRYPTO_get_ex_data(&ecdsa->ex_data, idx)); } -ECDSA_METHOD *ECDSA_METHOD_new(ECDSA_METHOD *ecdsa_meth) +ECDSA_METHOD *ECDSA_METHOD_new(const ECDSA_METHOD *ecdsa_meth) { ECDSA_METHOD *ret; diff --git a/deps/openssl/openssl/crypto/engine/eng_all.c b/deps/openssl/openssl/crypto/engine/eng_all.c index 195a3a95542a7a..48ad0d26b41e7d 100644 --- a/deps/openssl/openssl/crypto/engine/eng_all.c +++ b/deps/openssl/openssl/crypto/engine/eng_all.c @@ -1,4 +1,4 @@ -/* crypto/engine/eng_all.c -*- mode: C; c-file-style: "eay" -*- */ +/* crypto/engine/eng_all.c */ /* * Written by Richard Levitte for the OpenSSL project * 2000. diff --git a/deps/openssl/openssl/crypto/engine/eng_cryptodev.c b/deps/openssl/openssl/crypto/engine/eng_cryptodev.c index 926d95c0d7fc5d..8fb9c3373dd67a 100644 --- a/deps/openssl/openssl/crypto/engine/eng_cryptodev.c +++ b/deps/openssl/openssl/crypto/engine/eng_cryptodev.c @@ -1292,15 +1292,18 @@ static DSA_SIG *cryptodev_dsa_do_sign(const unsigned char *dgst, int dlen, if (cryptodev_asym(&kop, BN_num_bytes(dsa->q), r, BN_num_bytes(dsa->q), s) == 0) { dsaret = DSA_SIG_new(); + if (dsaret == NULL) + goto err; dsaret->r = r; dsaret->s = s; + r = s = NULL; } else { const DSA_METHOD *meth = DSA_OpenSSL(); - BN_free(r); - BN_free(s); dsaret = (meth->dsa_do_sign) (dgst, dlen, dsa); } err: + BN_free(r); + BN_free(s); kop.crk_param[0].crp_p = NULL; zapparams(&kop); return (dsaret); diff --git a/deps/openssl/openssl/crypto/engine/eng_dyn.c b/deps/openssl/openssl/crypto/engine/eng_dyn.c index 3169b09ad86511..40f30e9d585e21 100644 --- a/deps/openssl/openssl/crypto/engine/eng_dyn.c +++ b/deps/openssl/openssl/crypto/engine/eng_dyn.c @@ -243,8 +243,10 @@ static int dynamic_set_data_ctx(ENGINE *e, dynamic_data_ctx **ctx) * If we lost the race to set the context, c is non-NULL and *ctx is the * context of the thread that won. */ - if (c) + if (c) { + sk_OPENSSL_STRING_free(c->dirs); OPENSSL_free(c); + } return 1; } diff --git a/deps/openssl/openssl/crypto/engine/eng_list.c b/deps/openssl/openssl/crypto/engine/eng_list.c index 3384e318289336..83c95d56f4660f 100644 --- a/deps/openssl/openssl/crypto/engine/eng_list.c +++ b/deps/openssl/openssl/crypto/engine/eng_list.c @@ -260,6 +260,7 @@ int ENGINE_add(ENGINE *e) } if ((e->id == NULL) || (e->name == NULL)) { ENGINEerr(ENGINE_F_ENGINE_ADD, ENGINE_R_ID_OR_NAME_MISSING); + return 0; } CRYPTO_w_lock(CRYPTO_LOCK_ENGINE); if (!engine_list_add(e)) { diff --git a/deps/openssl/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c b/deps/openssl/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c index b1c586e6fd96b8..37800213c764eb 100644 --- a/deps/openssl/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c +++ b/deps/openssl/openssl/crypto/evp/e_aes_cbc_hmac_sha256.c @@ -498,7 +498,18 @@ static int aesni_cbc_hmac_sha256_cipher(EVP_CIPHER_CTX *ctx, iv = AES_BLOCK_SIZE; # if defined(STITCHED_CALL) + /* + * Assembly stitch handles AVX-capable processors, but its + * performance is not optimal on AMD Jaguar, ~40% worse, for + * unknown reasons. Incidentally processor in question supports + * AVX, but not AMD-specific XOP extension, which can be used + * to identify it and avoid stitch invocation. So that after we + * establish that current CPU supports AVX, we even see if it's + * either even XOP-capable Bulldozer-based or GenuineIntel one. + */ if (OPENSSL_ia32cap_P[1] & (1 << (60 - 32)) && /* AVX? */ + ((OPENSSL_ia32cap_P[1] & (1 << (43 - 32))) /* XOP? */ + | (OPENSSL_ia32cap_P[0] & (1<<30))) && /* "Intel CPU"? */ plen > (sha_off + iv) && (blocks = (plen - (sha_off + iv)) / SHA256_CBLOCK)) { SHA256_Update(&key->md, in + iv, sha_off); @@ -816,8 +827,6 @@ static int aesni_cbc_hmac_sha256_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, if (arg != EVP_AEAD_TLS1_AAD_LEN) return -1; - len = p[arg - 2] << 8 | p[arg - 1]; - if (ctx->encrypt) { key->payload_length = len; if ((key->aux.tls_ver = diff --git a/deps/openssl/openssl/crypto/evp/e_camellia.c b/deps/openssl/openssl/crypto/evp/e_camellia.c index f9c84013675d29..f273f9c9475a9b 100644 --- a/deps/openssl/openssl/crypto/evp/e_camellia.c +++ b/deps/openssl/openssl/crypto/evp/e_camellia.c @@ -1,4 +1,4 @@ -/* crypto/evp/e_camellia.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/evp/e_camellia.c */ /* ==================================================================== * Copyright (c) 2006 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/evp/e_des.c b/deps/openssl/openssl/crypto/evp/e_des.c index aae13a675694b4..8ca65cd03ae1f1 100644 --- a/deps/openssl/openssl/crypto/evp/e_des.c +++ b/deps/openssl/openssl/crypto/evp/e_des.c @@ -71,12 +71,13 @@ typedef struct { DES_key_schedule ks; } ks; union { - void (*cbc) (const void *, void *, size_t, const void *, void *); + void (*cbc) (const void *, void *, size_t, + const DES_key_schedule *, unsigned char *); } stream; } EVP_DES_KEY; # if defined(AES_ASM) && (defined(__sparc) || defined(__sparc__)) -/* ---------^^^ this is not a typo, just a way to detect that +/* ----------^^^ this is not a typo, just a way to detect that * assembler support was in general requested... */ # include "sparc_arch.h" @@ -86,9 +87,9 @@ extern unsigned int OPENSSL_sparcv9cap_P[]; void des_t4_key_expand(const void *key, DES_key_schedule *ks); void des_t4_cbc_encrypt(const void *inp, void *out, size_t len, - DES_key_schedule *ks, unsigned char iv[8]); + const DES_key_schedule *ks, unsigned char iv[8]); void des_t4_cbc_decrypt(const void *inp, void *out, size_t len, - DES_key_schedule *ks, unsigned char iv[8]); + const DES_key_schedule *ks, unsigned char iv[8]); # endif static int des_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, @@ -130,7 +131,7 @@ static int des_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, { EVP_DES_KEY *dat = (EVP_DES_KEY *) ctx->cipher_data; - if (dat->stream.cbc) { + if (dat->stream.cbc != NULL) { (*dat->stream.cbc) (in, out, inl, &dat->ks.ks, ctx->iv); return 1; } diff --git a/deps/openssl/openssl/crypto/evp/e_des3.c b/deps/openssl/openssl/crypto/evp/e_des3.c index 96f272eb8046f6..0e910d6d8085b9 100644 --- a/deps/openssl/openssl/crypto/evp/e_des3.c +++ b/deps/openssl/openssl/crypto/evp/e_des3.c @@ -75,7 +75,8 @@ typedef struct { DES_key_schedule ks[3]; } ks; union { - void (*cbc) (const void *, void *, size_t, const void *, void *); + void (*cbc) (const void *, void *, size_t, + const DES_key_schedule *, unsigned char *); } stream; } DES_EDE_KEY; # define ks1 ks.ks[0] @@ -93,9 +94,9 @@ extern unsigned int OPENSSL_sparcv9cap_P[]; void des_t4_key_expand(const void *key, DES_key_schedule *ks); void des_t4_ede3_cbc_encrypt(const void *inp, void *out, size_t len, - DES_key_schedule *ks, unsigned char iv[8]); + const DES_key_schedule ks[3], unsigned char iv[8]); void des_t4_ede3_cbc_decrypt(const void *inp, void *out, size_t len, - DES_key_schedule *ks, unsigned char iv[8]); + const DES_key_schedule ks[3], unsigned char iv[8]); # endif static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, @@ -162,7 +163,7 @@ static int des_ede_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, } # endif /* KSSL_DEBUG */ if (dat->stream.cbc) { - (*dat->stream.cbc) (in, out, inl, &dat->ks, ctx->iv); + (*dat->stream.cbc) (in, out, inl, dat->ks.ks, ctx->iv); return 1; } @@ -289,7 +290,7 @@ static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, # endif # ifdef EVP_CHECK_DES_KEY if (DES_set_key_checked(&deskey[0], &dat->ks1) - ! !DES_set_key_checked(&deskey[1], &dat->ks2)) + || DES_set_key_checked(&deskey[1], &dat->ks2)) return 0; # else DES_set_key_unchecked(&deskey[0], &dat->ks1); @@ -395,7 +396,7 @@ static int des_ede3_unwrap(EVP_CIPHER_CTX *ctx, unsigned char *out, int rv = -1; if (inl < 24) return -1; - if (!out) + if (out == NULL) return inl - 16; memcpy(ctx->iv, wrap_iv, 8); /* Decrypt first block which will end up as icv */ @@ -438,7 +439,7 @@ static int des_ede3_wrap(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl) { unsigned char sha1tmp[SHA_DIGEST_LENGTH]; - if (!out) + if (out == NULL) return inl + 16; /* Copy input to output buffer + 8 so we have space for IV */ memmove(out + 8, in, inl); diff --git a/deps/openssl/openssl/crypto/evp/e_old.c b/deps/openssl/openssl/crypto/evp/e_old.c index c93f5a548163df..a23d143b7fae64 100644 --- a/deps/openssl/openssl/crypto/evp/e_old.c +++ b/deps/openssl/openssl/crypto/evp/e_old.c @@ -1,4 +1,4 @@ -/* crypto/evp/e_old.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/evp/e_old.c */ /* * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project * 2004. diff --git a/deps/openssl/openssl/crypto/evp/e_seed.c b/deps/openssl/openssl/crypto/evp/e_seed.c index c948a8f3914fd5..7249d1b1eecb46 100644 --- a/deps/openssl/openssl/crypto/evp/e_seed.c +++ b/deps/openssl/openssl/crypto/evp/e_seed.c @@ -1,4 +1,4 @@ -/* crypto/evp/e_seed.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/evp/e_seed.c */ /* ==================================================================== * Copyright (c) 2007 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/evp/encode.c b/deps/openssl/openssl/crypto/evp/encode.c index c361d1f0126994..c6abc4ae8e47b0 100644 --- a/deps/openssl/openssl/crypto/evp/encode.c +++ b/deps/openssl/openssl/crypto/evp/encode.c @@ -60,9 +60,9 @@ #include "cryptlib.h" #include +static unsigned char conv_ascii2bin(unsigned char a); #ifndef CHARSET_EBCDIC # define conv_bin2ascii(a) (data_bin2ascii[(a)&0x3f]) -# define conv_ascii2bin(a) (data_ascii2bin[(a)&0x7f]) #else /* * We assume that PEM encoded files are EBCDIC files (i.e., printable text @@ -71,7 +71,6 @@ * as the underlying textstring data_bin2ascii[] is already EBCDIC) */ # define conv_bin2ascii(a) (data_bin2ascii[(a)&0x3f]) -# define conv_ascii2bin(a) (data_ascii2bin[os_toascii[a]&0x7f]) #endif /*- @@ -103,6 +102,7 @@ abcdefghijklmnopqrstuvwxyz0123456789+/"; #define B64_WS 0xE0 #define B64_ERROR 0xFF #define B64_NOT_BASE64(a) (((a)|0x13) == 0xF3) +#define B64_BASE64(a) !B64_NOT_BASE64(a) static const unsigned char data_ascii2bin[128] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, @@ -123,6 +123,23 @@ static const unsigned char data_ascii2bin[128] = { 0x31, 0x32, 0x33, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, }; +#ifndef CHARSET_EBCDIC +static unsigned char conv_ascii2bin(unsigned char a) +{ + if (a & 0x80) + return B64_ERROR; + return data_ascii2bin[a]; +} +#else +static unsigned char conv_ascii2bin(unsigned char a) +{ + a = os_toascii[a]; + if (a & 0x80) + return B64_ERROR; + return data_ascii2bin[a]; +} +#endif + void EVP_EncodeInit(EVP_ENCODE_CTX *ctx) { ctx->length = 48; @@ -218,8 +235,9 @@ int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int dlen) void EVP_DecodeInit(EVP_ENCODE_CTX *ctx) { - ctx->length = 30; + /* Only ctx->num is used during decoding. */ ctx->num = 0; + ctx->length = 0; ctx->line_num = 0; ctx->expect_nl = 0; } @@ -228,139 +246,123 @@ void EVP_DecodeInit(EVP_ENCODE_CTX *ctx) * -1 for error * 0 for last line * 1 for full line + * + * Note: even though EVP_DecodeUpdate attempts to detect and report end of + * content, the context doesn't currently remember it and will accept more data + * in the next call. Therefore, the caller is responsible for checking and + * rejecting a 0 return value in the middle of content. + * + * Note: even though EVP_DecodeUpdate has historically tried to detect end of + * content based on line length, this has never worked properly. Therefore, + * we now return 0 when one of the following is true: + * - Padding or B64_EOF was detected and the last block is complete. + * - Input has zero-length. + * -1 is returned if: + * - Invalid characters are detected. + * - There is extra trailing padding, or data after padding. + * - B64_EOF is detected after an incomplete base64 block. */ int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, const unsigned char *in, int inl) { - int seof = -1, eof = 0, rv = -1, ret = 0, i, v, tmp, n, ln, exp_nl; + int seof = 0, eof = 0, rv = -1, ret = 0, i, v, tmp, n, decoded_len; unsigned char *d; n = ctx->num; d = ctx->enc_data; - ln = ctx->line_num; - exp_nl = ctx->expect_nl; - /* last line of input. */ - if ((inl == 0) || ((n == 0) && (conv_ascii2bin(in[0]) == B64_EOF))) { + if (n > 0 && d[n - 1] == '=') { + eof++; + if (n > 1 && d[n - 2] == '=') + eof++; + } + + /* Legacy behaviour: an empty input chunk signals end of input. */ + if (inl == 0) { rv = 0; goto end; } - /* We parse the input data */ for (i = 0; i < inl; i++) { - /* If the current line is > 80 characters, scream a lot */ - if (ln >= 80) { - rv = -1; - goto end; - } - - /* Get char and put it into the buffer */ tmp = *(in++); v = conv_ascii2bin(tmp); - /* only save the good data :-) */ - if (!B64_NOT_BASE64(v)) { - OPENSSL_assert(n < (int)sizeof(ctx->enc_data)); - d[n++] = tmp; - ln++; - } else if (v == B64_ERROR) { + if (v == B64_ERROR) { rv = -1; goto end; } - /* - * have we seen a '=' which is 'definitly' the last input line. seof - * will point to the character that holds it. and eof will hold how - * many characters to chop off. - */ if (tmp == '=') { - if (seof == -1) - seof = n; eof++; + } else if (eof > 0 && B64_BASE64(v)) { + /* More data after padding. */ + rv = -1; + goto end; } - if (v == B64_CR) { - ln = 0; - if (exp_nl) - continue; + if (eof > 2) { + rv = -1; + goto end; } - /* eoln */ - if (v == B64_EOLN) { - ln = 0; - if (exp_nl) { - exp_nl = 0; - continue; - } - } - exp_nl = 0; - - /* - * If we are at the end of input and it looks like a line, process - * it. - */ - if (((i + 1) == inl) && (((n & 3) == 0) || eof)) { - v = B64_EOF; - /* - * In case things were given us in really small records (so two - * '=' were given in separate updates), eof may contain the - * incorrect number of ending bytes to skip, so let's redo the - * count - */ - eof = 0; - if (d[n - 1] == '=') - eof++; - if (d[n - 2] == '=') - eof++; - /* There will never be more than two '=' */ + if (v == B64_EOF) { + seof = 1; + goto tail; } - if ((v == B64_EOF && (n & 3) == 0) || (n >= 64)) { - /* - * This is needed to work correctly on 64 byte input lines. We - * process the line and then need to accept the '\n' - */ - if ((v != B64_EOF) && (n >= 64)) - exp_nl = 1; - if (n > 0) { - v = EVP_DecodeBlock(out, d, n); - n = 0; - if (v < 0) { - rv = 0; - goto end; - } - if (eof > v) { - rv = -1; - goto end; - } - ret += (v - eof); - } else { - eof = 1; - v = 0; + /* Only save valid base64 characters. */ + if (B64_BASE64(v)) { + if (n >= 64) { + /* + * We increment n once per loop, and empty the buffer as soon as + * we reach 64 characters, so this can only happen if someone's + * manually messed with the ctx. Refuse to write any more data. + */ + rv = -1; + goto end; } + OPENSSL_assert(n < (int)sizeof(ctx->enc_data)); + d[n++] = tmp; + } - /* - * This is the case where we have had a short but valid input - * line - */ - if ((v < ctx->length) && eof) { - rv = 0; + if (n == 64) { + decoded_len = EVP_DecodeBlock(out, d, n); + n = 0; + if (decoded_len < 0 || eof > decoded_len) { + rv = -1; goto end; - } else - ctx->length = v; + } + ret += decoded_len - eof; + out += decoded_len - eof; + } + } - if (seof >= 0) { - rv = 0; + /* + * Legacy behaviour: if the current line is a full base64-block (i.e., has + * 0 mod 4 base64 characters), it is processed immediately. We keep this + * behaviour as applications may not be calling EVP_DecodeFinal properly. + */ +tail: + if (n > 0) { + if ((n & 3) == 0) { + decoded_len = EVP_DecodeBlock(out, d, n); + n = 0; + if (decoded_len < 0 || eof > decoded_len) { + rv = -1; goto end; } - out += v; + ret += (decoded_len - eof); + } else if (seof) { + /* EOF in the middle of a base64 block. */ + rv = -1; + goto end; } } - rv = 1; - end: + + rv = seof || (n == 0 && eof) ? 0 : 1; +end: + /* Legacy behaviour. This should probably rather be zeroed on error. */ *outl = ret; ctx->num = n; - ctx->line_num = ln; - ctx->expect_nl = exp_nl; return (rv); } diff --git a/deps/openssl/openssl/crypto/evp/evp_key.c b/deps/openssl/openssl/crypto/evp/evp_key.c index 71fa627b20d3ed..5be9e336f9e717 100644 --- a/deps/openssl/openssl/crypto/evp/evp_key.c +++ b/deps/openssl/openssl/crypto/evp/evp_key.c @@ -104,6 +104,8 @@ int EVP_read_pw_string_min(char *buf, int min, int len, const char *prompt, if ((prompt == NULL) && (prompt_string[0] != '\0')) prompt = prompt_string; ui = UI_new(); + if (ui == NULL) + return -1; UI_add_input_string(ui, prompt, 0, buf, min, (len >= BUFSIZ) ? BUFSIZ - 1 : len); if (verify) @@ -137,7 +139,7 @@ int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md, EVP_MD_CTX_init(&c); for (;;) { if (!EVP_DigestInit_ex(&c, md, NULL)) - return 0; + goto err; if (addmd++) if (!EVP_DigestUpdate(&c, &(md_buf[0]), mds)) goto err; @@ -188,6 +190,6 @@ int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md, rv = type->key_len; err: EVP_MD_CTX_cleanup(&c); - OPENSSL_cleanse(&(md_buf[0]), EVP_MAX_MD_SIZE); + OPENSSL_cleanse(md_buf, sizeof(md_buf)); return rv; } diff --git a/deps/openssl/openssl/crypto/evp/evp_lib.c b/deps/openssl/openssl/crypto/evp/evp_lib.c index a53a27ca0c92e2..7e0bab90d49aca 100644 --- a/deps/openssl/openssl/crypto/evp/evp_lib.c +++ b/deps/openssl/openssl/crypto/evp/evp_lib.c @@ -72,11 +72,22 @@ int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type) if (c->cipher->set_asn1_parameters != NULL) ret = c->cipher->set_asn1_parameters(c, type); else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1) { - if (EVP_CIPHER_CTX_mode(c) == EVP_CIPH_WRAP_MODE) { - ASN1_TYPE_set(type, V_ASN1_NULL, NULL); + switch (EVP_CIPHER_CTX_mode(c)) { + case EVP_CIPH_WRAP_MODE: + if (EVP_CIPHER_CTX_nid(c) == NID_id_smime_alg_CMS3DESwrap) + ASN1_TYPE_set(type, V_ASN1_NULL, NULL); ret = 1; - } else + break; + + case EVP_CIPH_GCM_MODE: + case EVP_CIPH_CCM_MODE: + case EVP_CIPH_XTS_MODE: + ret = -1; + break; + + default: ret = EVP_CIPHER_set_asn1_iv(c, type); + } } else ret = -1; return (ret); @@ -89,9 +100,22 @@ int EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type) if (c->cipher->get_asn1_parameters != NULL) ret = c->cipher->get_asn1_parameters(c, type); else if (c->cipher->flags & EVP_CIPH_FLAG_DEFAULT_ASN1) { - if (EVP_CIPHER_CTX_mode(c) == EVP_CIPH_WRAP_MODE) - return 1; - ret = EVP_CIPHER_get_asn1_iv(c, type); + switch (EVP_CIPHER_CTX_mode(c)) { + + case EVP_CIPH_WRAP_MODE: + ret = 1; + break; + + case EVP_CIPH_GCM_MODE: + case EVP_CIPH_CCM_MODE: + case EVP_CIPH_XTS_MODE: + ret = -1; + break; + + default: + ret = EVP_CIPHER_get_asn1_iv(c, type); + break; + } } else ret = -1; return (ret); diff --git a/deps/openssl/openssl/crypto/evp/evp_pbe.c b/deps/openssl/openssl/crypto/evp/evp_pbe.c index e3fa95db928988..7934c95fad0c50 100644 --- a/deps/openssl/openssl/crypto/evp/evp_pbe.c +++ b/deps/openssl/openssl/crypto/evp/evp_pbe.c @@ -228,12 +228,16 @@ int EVP_PBE_alg_add_type(int pbe_type, int pbe_nid, int cipher_nid, int md_nid, EVP_PBE_KEYGEN *keygen) { EVP_PBE_CTL *pbe_tmp; - if (!pbe_algs) + + if (pbe_algs == NULL) { pbe_algs = sk_EVP_PBE_CTL_new(pbe_cmp); - if (!(pbe_tmp = (EVP_PBE_CTL *)OPENSSL_malloc(sizeof(EVP_PBE_CTL)))) { - EVPerr(EVP_F_EVP_PBE_ALG_ADD_TYPE, ERR_R_MALLOC_FAILURE); - return 0; + if (pbe_algs == NULL) + goto err; } + + if ((pbe_tmp = OPENSSL_malloc(sizeof(*pbe_tmp))) == NULL) + goto err; + pbe_tmp->pbe_type = pbe_type; pbe_tmp->pbe_nid = pbe_nid; pbe_tmp->cipher_nid = cipher_nid; @@ -242,6 +246,10 @@ int EVP_PBE_alg_add_type(int pbe_type, int pbe_nid, int cipher_nid, sk_EVP_PBE_CTL_push(pbe_algs, pbe_tmp); return 1; + + err: + EVPerr(EVP_F_EVP_PBE_ALG_ADD_TYPE, ERR_R_MALLOC_FAILURE); + return 0; } int EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md, diff --git a/deps/openssl/openssl/crypto/evp/p_lib.c b/deps/openssl/openssl/crypto/evp/p_lib.c index 1171d3086d0b2d..c0171244d5d010 100644 --- a/deps/openssl/openssl/crypto/evp/p_lib.c +++ b/deps/openssl/openssl/crypto/evp/p_lib.c @@ -253,7 +253,7 @@ int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len) int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key) { - if (!EVP_PKEY_set_type(pkey, type)) + if (pkey == NULL || !EVP_PKEY_set_type(pkey, type)) return 0; pkey->pkey.ptr = key; return (key != NULL); diff --git a/deps/openssl/openssl/crypto/evp/pmeth_gn.c b/deps/openssl/openssl/crypto/evp/pmeth_gn.c index 59f81342e94d0b..6435f1b632cfe8 100644 --- a/deps/openssl/openssl/crypto/evp/pmeth_gn.c +++ b/deps/openssl/openssl/crypto/evp/pmeth_gn.c @@ -96,12 +96,17 @@ int EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey) return -1; } - if (!ppkey) + if (ppkey == NULL) return -1; - if (!*ppkey) + if (*ppkey == NULL) *ppkey = EVP_PKEY_new(); + if (*ppkey == NULL) { + EVPerr(EVP_F_EVP_PKEY_PARAMGEN, ERR_R_MALLOC_FAILURE); + return -1; + } + ret = ctx->pmeth->paramgen(ctx, *ppkey); if (ret <= 0) { EVP_PKEY_free(*ppkey); diff --git a/deps/openssl/openssl/crypto/hmac/hm_ameth.c b/deps/openssl/openssl/crypto/hmac/hm_ameth.c index 29b2b5dffcf7e4..944c6c857b177f 100644 --- a/deps/openssl/openssl/crypto/hmac/hm_ameth.c +++ b/deps/openssl/openssl/crypto/hmac/hm_ameth.c @@ -108,9 +108,14 @@ static int old_hmac_decode(EVP_PKEY *pkey, ASN1_OCTET_STRING *os; os = ASN1_OCTET_STRING_new(); if (!os || !ASN1_OCTET_STRING_set(os, *pder, derlen)) - return 0; - EVP_PKEY_assign(pkey, EVP_PKEY_HMAC, os); + goto err; + if (!EVP_PKEY_assign(pkey, EVP_PKEY_HMAC, os)) + goto err; return 1; + + err: + ASN1_OCTET_STRING_free(os); + return 0; } static int old_hmac_encode(const EVP_PKEY *pkey, unsigned char **pder) diff --git a/deps/openssl/openssl/crypto/jpake/jpake.c b/deps/openssl/openssl/crypto/jpake/jpake.c index 8c38727e20fd31..ebc09755756d31 100644 --- a/deps/openssl/openssl/crypto/jpake/jpake.c +++ b/deps/openssl/openssl/crypto/jpake/jpake.c @@ -219,6 +219,9 @@ static int verify_zkp(const JPAKE_STEP_PART *p, const BIGNUM *zkpg, BIGNUM *t3 = BN_new(); int ret = 0; + if (h == NULL || t1 == NULL || t2 == NULL || t3 == NULL) + goto end; + zkp_hash(h, zkpg, p, ctx->p.peer_name); /* t1 = g^b */ @@ -234,6 +237,7 @@ static int verify_zkp(const JPAKE_STEP_PART *p, const BIGNUM *zkpg, else JPAKEerr(JPAKE_F_VERIFY_ZKP, JPAKE_R_ZKP_VERIFY_FAILED); +end: /* cleanup */ BN_free(t3); BN_free(t2); diff --git a/deps/openssl/openssl/crypto/mem_clr.c b/deps/openssl/openssl/crypto/mem_clr.c index 3df1f3928d0688..ab85344eef386b 100644 --- a/deps/openssl/openssl/crypto/mem_clr.c +++ b/deps/openssl/openssl/crypto/mem_clr.c @@ -1,4 +1,4 @@ -/* crypto/mem_clr.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/mem_clr.c */ /* * Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL project * 2002. @@ -66,6 +66,10 @@ void OPENSSL_cleanse(void *ptr, size_t len) { unsigned char *p = ptr; size_t loop = len, ctr = cleanse_ctr; + + if (ptr == NULL) + return; + while (loop--) { *(p++) = (unsigned char)ctr; ctr += (17 + ((size_t)p & 0xF)); diff --git a/deps/openssl/openssl/crypto/modes/asm/aesni-gcm-x86_64.pl b/deps/openssl/openssl/crypto/modes/asm/aesni-gcm-x86_64.pl index 7e4e04ea25300d..980cfd23efe34e 100644 --- a/deps/openssl/openssl/crypto/modes/asm/aesni-gcm-x86_64.pl +++ b/deps/openssl/openssl/crypto/modes/asm/aesni-gcm-x86_64.pl @@ -43,7 +43,7 @@ if (`$ENV{CC} -Wa,-v -c -o /dev/null -x assembler /dev/null 2>&1` =~ /GNU assembler version ([2-9]\.[0-9]+)/) { - $avx = ($1>=2.19) + ($1>=2.22); + $avx = ($1>=2.20) + ($1>=2.22); } if (!$avx && $win64 && ($flavour =~ /nasm/ || $ENV{ASM} =~ /nasm/) && @@ -56,7 +56,7 @@ $avx = ($1>=10) + ($1>=11); } -if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) { +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([3-9]\.[0-9]+)/) { $avx = ($2>=3.0) + ($2>3.0); } @@ -489,7 +489,7 @@ ___ $code.=<<___ if ($win64); movaps -0xd8(%rax),%xmm6 - movaps -0xd8(%rax),%xmm7 + movaps -0xc8(%rax),%xmm7 movaps -0xb8(%rax),%xmm8 movaps -0xa8(%rax),%xmm9 movaps -0x98(%rax),%xmm10 diff --git a/deps/openssl/openssl/crypto/modes/asm/ghash-armv4.pl b/deps/openssl/openssl/crypto/modes/asm/ghash-armv4.pl index 77fbf34465db48..8ccc963ef29729 100644 --- a/deps/openssl/openssl/crypto/modes/asm/ghash-armv4.pl +++ b/deps/openssl/openssl/crypto/modes/asm/ghash-armv4.pl @@ -45,7 +45,7 @@ # processes one byte in 8.45 cycles, A9 - in 10.2, Snapdragon S4 - # in 9.33. # -# C�mara, D.; Gouv�a, C. P. L.; L�pez, J. & Dahab, R.: Fast Software +# Câmara, D.; Gouvêa, C. P. L.; López, J. & Dahab, R.: Fast Software # Polynomial Multiplication on ARM Processors using the NEON Engine. # # http://conradoplg.cryptoland.net/files/2010/12/mocrysen13.pdf @@ -126,6 +126,11 @@ () .text .code 32 +#ifdef __clang__ +#define ldrplb ldrbpl +#define ldrneb ldrbne +#endif + .type rem_4bit,%object .align 5 rem_4bit: @@ -432,12 +437,12 @@ sub clmul64x64 { veor $IN,$Xl @ inp^=Xi .Lgmult_neon: ___ - &clmul64x64 ($Xl,$Hlo,"$IN#lo"); # H.lo�Xi.lo + &clmul64x64 ($Xl,$Hlo,"$IN#lo"); # H.lo·Xi.lo $code.=<<___; veor $IN#lo,$IN#lo,$IN#hi @ Karatsuba pre-processing ___ - &clmul64x64 ($Xm,$Hhl,"$IN#lo"); # (H.lo+H.hi)�(Xi.lo+Xi.hi) - &clmul64x64 ($Xh,$Hhi,"$IN#hi"); # H.hi�Xi.hi + &clmul64x64 ($Xm,$Hhl,"$IN#lo"); # (H.lo+H.hi)·(Xi.lo+Xi.hi) + &clmul64x64 ($Xh,$Hhi,"$IN#hi"); # H.hi·Xi.hi $code.=<<___; veor $Xm,$Xm,$Xl @ Karatsuba post-processing veor $Xm,$Xm,$Xh diff --git a/deps/openssl/openssl/crypto/modes/asm/ghash-sparcv9.pl b/deps/openssl/openssl/crypto/modes/asm/ghash-sparcv9.pl index 0365e0f1ff429e..5bc28702019a17 100644 --- a/deps/openssl/openssl/crypto/modes/asm/ghash-sparcv9.pl +++ b/deps/openssl/openssl/crypto/modes/asm/ghash-sparcv9.pl @@ -379,7 +379,7 @@ or $V,%lo(0xA0406080),$V or %l0,%lo(0x20C0E000),%l0 sllx $V,32,$V - or %l0,$V,$V ! (0xE0�i)&0xff=0xA040608020C0E000 + or %l0,$V,$V ! (0xE0·i)&0xff=0xA040608020C0E000 stx $V,[%i0+16] ret @@ -399,7 +399,7 @@ mov 0xE1,%l7 sllx %l7,57,$xE1 ! 57 is not a typo - ldx [$Htable+16],$V ! (0xE0�i)&0xff=0xA040608020C0E000 + ldx [$Htable+16],$V ! (0xE0·i)&0xff=0xA040608020C0E000 xor $Hhi,$Hlo,$Hhl ! Karatsuba pre-processing xmulx $Xlo,$Hlo,$C0 @@ -411,9 +411,9 @@ xmulx $Xhi,$Hhi,$Xhi sll $C0,3,$sqr - srlx $V,$sqr,$sqr ! �0xE0 [implicit &(7<<3)] + srlx $V,$sqr,$sqr ! ·0xE0 [implicit &(7<<3)] xor $C0,$sqr,$sqr - sllx $sqr,57,$sqr ! ($C0�0xE1)<<1<<56 [implicit &0x7f] + sllx $sqr,57,$sqr ! ($C0·0xE1)<<1<<56 [implicit &0x7f] xor $C0,$C1,$C1 ! Karatsuba post-processing xor $Xlo,$C2,$C2 @@ -423,7 +423,7 @@ xor $Xhi,$C2,$C2 xor $Xhi,$C1,$C1 - xmulxhi $C0,$xE1,$Xlo ! �0xE1<<1<<56 + xmulxhi $C0,$xE1,$Xlo ! ·0xE1<<1<<56 xor $C0,$C2,$C2 xmulx $C1,$xE1,$C0 xor $C1,$C3,$C3 @@ -453,7 +453,7 @@ mov 0xE1,%l7 sllx %l7,57,$xE1 ! 57 is not a typo - ldx [$Htable+16],$V ! (0xE0�i)&0xff=0xA040608020C0E000 + ldx [$Htable+16],$V ! (0xE0·i)&0xff=0xA040608020C0E000 and $inp,7,$shl andn $inp,7,$inp @@ -490,9 +490,9 @@ xmulx $Xhi,$Hhi,$Xhi sll $C0,3,$sqr - srlx $V,$sqr,$sqr ! �0xE0 [implicit &(7<<3)] + srlx $V,$sqr,$sqr ! ·0xE0 [implicit &(7<<3)] xor $C0,$sqr,$sqr - sllx $sqr,57,$sqr ! ($C0�0xE1)<<1<<56 [implicit &0x7f] + sllx $sqr,57,$sqr ! ($C0·0xE1)<<1<<56 [implicit &0x7f] xor $C0,$C1,$C1 ! Karatsuba post-processing xor $Xlo,$C2,$C2 @@ -502,7 +502,7 @@ xor $Xhi,$C2,$C2 xor $Xhi,$C1,$C1 - xmulxhi $C0,$xE1,$Xlo ! �0xE1<<1<<56 + xmulxhi $C0,$xE1,$Xlo ! ·0xE1<<1<<56 xor $C0,$C2,$C2 xmulx $C1,$xE1,$C0 xor $C1,$C3,$C3 diff --git a/deps/openssl/openssl/crypto/modes/asm/ghash-x86.pl b/deps/openssl/openssl/crypto/modes/asm/ghash-x86.pl index 23a5527b30af3b..0269169fa743b5 100644 --- a/deps/openssl/openssl/crypto/modes/asm/ghash-x86.pl +++ b/deps/openssl/openssl/crypto/modes/asm/ghash-x86.pl @@ -358,7 +358,7 @@ sub deposit_rem_4bit { # effective address calculation and finally merge of value to Z.hi. # Reference to rem_4bit is scheduled so late that I had to >>4 # rem_4bit elements. This resulted in 20-45% procent improvement -# on contemporary �-archs. +# on contemporary µ-archs. { my $cnt; my $rem_4bit = "eax"; diff --git a/deps/openssl/openssl/crypto/modes/asm/ghash-x86_64.pl b/deps/openssl/openssl/crypto/modes/asm/ghash-x86_64.pl index 6e656ca13b8029..f889f2018789fb 100644 --- a/deps/openssl/openssl/crypto/modes/asm/ghash-x86_64.pl +++ b/deps/openssl/openssl/crypto/modes/asm/ghash-x86_64.pl @@ -92,7 +92,7 @@ if (`$ENV{CC} -Wa,-v -c -o /dev/null -x assembler /dev/null 2>&1` =~ /GNU assembler version ([2-9]\.[0-9]+)/) { - $avx = ($1>=2.19) + ($1>=2.22); + $avx = ($1>=2.20) + ($1>=2.22); } if (!$avx && $win64 && ($flavour =~ /nasm/ || $ENV{ASM} =~ /nasm/) && @@ -105,7 +105,7 @@ $avx = ($1>=10) + ($1>=11); } -if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) { +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([3-9]\.[0-9]+)/) { $avx = ($2>=3.0) + ($2>3.0); } @@ -576,15 +576,15 @@ sub reduction_alg9 { # 17/11 times faster than Intel version # experimental alternative. special thing about is that there # no dependency between the two multiplications... mov \$`0xE1<<1`,%eax - mov \$0xA040608020C0E000,%r10 # ((7..0)�0xE0)&0xff + mov \$0xA040608020C0E000,%r10 # ((7..0)·0xE0)&0xff mov \$0x07,%r11d movq %rax,$T1 movq %r10,$T2 movq %r11,$T3 # borrow $T3 pand $Xi,$T3 - pshufb $T3,$T2 # ($Xi&7)�0xE0 + pshufb $T3,$T2 # ($Xi&7)·0xE0 movq %rax,$T3 - pclmulqdq \$0x00,$Xi,$T1 # �(0xE1<<1) + pclmulqdq \$0x00,$Xi,$T1 # ·(0xE1<<1) pxor $Xi,$T2 pslldq \$15,$T2 paddd $T2,$T2 # <<(64+56+1) @@ -657,7 +657,7 @@ sub reduction_alg9 { # 17/11 times faster than Intel version je .Lskip4x sub \$0x30,$len - mov \$0xA040608020C0E000,%rax # ((7..0)�0xE0)&0xff + mov \$0xA040608020C0E000,%rax # ((7..0)·0xE0)&0xff movdqu 0x30($Htbl),$Hkey3 movdqu 0x40($Htbl),$Hkey4 diff --git a/deps/openssl/openssl/crypto/modes/asm/ghashp8-ppc.pl b/deps/openssl/openssl/crypto/modes/asm/ghashp8-ppc.pl index e76a58c343c1c7..71457cf4fc59b1 100755 --- a/deps/openssl/openssl/crypto/modes/asm/ghashp8-ppc.pl +++ b/deps/openssl/openssl/crypto/modes/asm/ghashp8-ppc.pl @@ -118,9 +118,9 @@ le?vperm $IN,$IN,$IN,$lemask vxor $zero,$zero,$zero - vpmsumd $Xl,$IN,$Hl # H.lo�Xi.lo - vpmsumd $Xm,$IN,$H # H.hi�Xi.lo+H.lo�Xi.hi - vpmsumd $Xh,$IN,$Hh # H.hi�Xi.hi + vpmsumd $Xl,$IN,$Hl # H.lo·Xi.lo + vpmsumd $Xm,$IN,$H # H.hi·Xi.lo+H.lo·Xi.hi + vpmsumd $Xh,$IN,$Hh # H.hi·Xi.hi vpmsumd $t2,$Xl,$xC2 # 1st phase @@ -178,11 +178,11 @@ .align 5 Loop: subic $len,$len,16 - vpmsumd $Xl,$IN,$Hl # H.lo�Xi.lo + vpmsumd $Xl,$IN,$Hl # H.lo·Xi.lo subfe. r0,r0,r0 # borrow?-1:0 - vpmsumd $Xm,$IN,$H # H.hi�Xi.lo+H.lo�Xi.hi + vpmsumd $Xm,$IN,$H # H.hi·Xi.lo+H.lo·Xi.hi and r0,r0,$len - vpmsumd $Xh,$IN,$Hh # H.hi�Xi.hi + vpmsumd $Xh,$IN,$Hh # H.hi·Xi.hi add $inp,$inp,r0 vpmsumd $t2,$Xl,$xC2 # 1st phase diff --git a/deps/openssl/openssl/crypto/modes/asm/ghashv8-armx.pl b/deps/openssl/openssl/crypto/modes/asm/ghashv8-armx.pl index 0b9cd7359fbaa3..0886d21807029a 100644 --- a/deps/openssl/openssl/crypto/modes/asm/ghashv8-armx.pl +++ b/deps/openssl/openssl/crypto/modes/asm/ghashv8-armx.pl @@ -135,10 +135,10 @@ #endif vext.8 $IN,$t1,$t1,#8 - vpmull.p64 $Xl,$H,$IN @ H.lo�Xi.lo + vpmull.p64 $Xl,$H,$IN @ H.lo·Xi.lo veor $t1,$t1,$IN @ Karatsuba pre-processing - vpmull2.p64 $Xh,$H,$IN @ H.hi�Xi.hi - vpmull.p64 $Xm,$Hhl,$t1 @ (H.lo+H.hi)�(Xi.lo+Xi.hi) + vpmull2.p64 $Xh,$H,$IN @ H.hi·Xi.hi + vpmull.p64 $Xm,$Hhl,$t1 @ (H.lo+H.hi)·(Xi.lo+Xi.hi) vext.8 $t1,$Xl,$Xh,#8 @ Karatsuba post-processing veor $t2,$Xl,$Xh @@ -226,7 +226,7 @@ #endif vext.8 $In,$t1,$t1,#8 veor $IN,$IN,$Xl @ I[i]^=Xi - vpmull.p64 $Xln,$H,$In @ H�Ii+1 + vpmull.p64 $Xln,$H,$In @ H·Ii+1 veor $t1,$t1,$In @ Karatsuba pre-processing vpmull2.p64 $Xhn,$H,$In b .Loop_mod2x_v8 @@ -235,14 +235,14 @@ .Loop_mod2x_v8: vext.8 $t2,$IN,$IN,#8 subs $len,$len,#32 @ is there more data? - vpmull.p64 $Xl,$H2,$IN @ H^2.lo�Xi.lo + vpmull.p64 $Xl,$H2,$IN @ H^2.lo·Xi.lo cclr $inc,lo @ is it time to zero $inc? vpmull.p64 $Xmn,$Hhl,$t1 veor $t2,$t2,$IN @ Karatsuba pre-processing - vpmull2.p64 $Xh,$H2,$IN @ H^2.hi�Xi.hi + vpmull2.p64 $Xh,$H2,$IN @ H^2.hi·Xi.hi veor $Xl,$Xl,$Xln @ accumulate - vpmull2.p64 $Xm,$Hhl,$t2 @ (H^2.lo+H^2.hi)�(Xi.lo+Xi.hi) + vpmull2.p64 $Xm,$Hhl,$t2 @ (H^2.lo+H^2.hi)·(Xi.lo+Xi.hi) vld1.64 {$t0},[$inp],$inc @ load [rotated] I[i+2] veor $Xh,$Xh,$Xhn @@ -267,7 +267,7 @@ vext.8 $In,$t1,$t1,#8 vext.8 $IN,$t0,$t0,#8 veor $Xl,$Xm,$t2 - vpmull.p64 $Xln,$H,$In @ H�Ii+1 + vpmull.p64 $Xln,$H,$In @ H·Ii+1 veor $IN,$IN,$Xh @ accumulate $IN early vext.8 $t2,$Xl,$Xl,#8 @ 2nd phase of reduction @@ -291,10 +291,10 @@ veor $IN,$IN,$Xl @ inp^=Xi veor $t1,$t0,$t2 @ $t1 is rotated inp^Xi - vpmull.p64 $Xl,$H,$IN @ H.lo�Xi.lo + vpmull.p64 $Xl,$H,$IN @ H.lo·Xi.lo veor $t1,$t1,$IN @ Karatsuba pre-processing - vpmull2.p64 $Xh,$H,$IN @ H.hi�Xi.hi - vpmull.p64 $Xm,$Hhl,$t1 @ (H.lo+H.hi)�(Xi.lo+Xi.hi) + vpmull2.p64 $Xh,$H,$IN @ H.hi·Xi.hi + vpmull.p64 $Xm,$Hhl,$t1 @ (H.lo+H.hi)·(Xi.lo+Xi.hi) vext.8 $t1,$Xl,$Xh,#8 @ Karatsuba post-processing veor $t2,$Xl,$Xh diff --git a/deps/openssl/openssl/crypto/modes/ctr128.c b/deps/openssl/openssl/crypto/modes/ctr128.c index f3bbcbf7237609..bcafd6b6bfb169 100644 --- a/deps/openssl/openssl/crypto/modes/ctr128.c +++ b/deps/openssl/openssl/crypto/modes/ctr128.c @@ -67,23 +67,20 @@ /* increment counter (128-bit int) by 1 */ static void ctr128_inc(unsigned char *counter) { - u32 n = 16; - u8 c; + u32 n = 16, c = 1; do { --n; - c = counter[n]; - ++c; - counter[n] = c; - if (c) - return; + c += counter[n]; + counter[n] = (u8)c; + c >>= 8; } while (n); } #if !defined(OPENSSL_SMALL_FOOTPRINT) static void ctr128_inc_aligned(unsigned char *counter) { - size_t *data, c, n; + size_t *data, c, d, n; const union { long one; char little; @@ -91,20 +88,19 @@ static void ctr128_inc_aligned(unsigned char *counter) 1 }; - if (is_endian.little) { + if (is_endian.little || ((size_t)counter % sizeof(size_t)) != 0) { ctr128_inc(counter); return; } data = (size_t *)counter; + c = 1; n = 16 / sizeof(size_t); do { --n; - c = data[n]; - ++c; - data[n] = c; - if (c) - return; + d = data[n] += c; + /* did addition carry? */ + c = ((d - c) ^ d) >> (sizeof(size_t) * 8 - 1); } while (n); } #endif @@ -144,14 +140,14 @@ void CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out, } # if defined(STRICT_ALIGNMENT) - if (((size_t)in | (size_t)out | (size_t)ivec) % sizeof(size_t) != - 0) + if (((size_t)in | (size_t)out | (size_t)ecount_buf) + % sizeof(size_t) != 0) break; # endif while (len >= 16) { (*block) (ivec, ecount_buf, key); ctr128_inc_aligned(ivec); - for (; n < 16; n += sizeof(size_t)) + for (n = 0; n < 16; n += sizeof(size_t)) *(size_t *)(out + n) = *(size_t *)(in + n) ^ *(size_t *)(ecount_buf + n); len -= 16; @@ -189,16 +185,13 @@ void CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out, /* increment upper 96 bits of 128-bit counter by 1 */ static void ctr96_inc(unsigned char *counter) { - u32 n = 12; - u8 c; + u32 n = 12, c = 1; do { --n; - c = counter[n]; - ++c; - counter[n] = c; - if (c) - return; + c += counter[n]; + counter[n] = (u8)c; + c >>= 8; } while (n); } diff --git a/deps/openssl/openssl/crypto/modes/wrap128.c b/deps/openssl/openssl/crypto/modes/wrap128.c index 4dcaf0326fa8da..384978371af2a0 100644 --- a/deps/openssl/openssl/crypto/modes/wrap128.c +++ b/deps/openssl/openssl/crypto/modes/wrap128.c @@ -76,7 +76,7 @@ size_t CRYPTO_128_wrap(void *key, const unsigned char *iv, return 0; A = B; t = 1; - memcpy(out + 8, in, inlen); + memmove(out + 8, in, inlen); if (!iv) iv = default_iv; @@ -113,7 +113,7 @@ size_t CRYPTO_128_unwrap(void *key, const unsigned char *iv, A = B; t = 6 * (inlen >> 3); memcpy(A, in, 8); - memcpy(out, in + 8, inlen); + memmove(out, in + 8, inlen); for (j = 0; j < 6; j++) { R = out + inlen - 8; for (i = 0; i < inlen; i += 8, t--, R -= 8) { diff --git a/deps/openssl/openssl/crypto/o_dir.c b/deps/openssl/openssl/crypto/o_dir.c index 26242444c88500..f9dbed87112793 100644 --- a/deps/openssl/openssl/crypto/o_dir.c +++ b/deps/openssl/openssl/crypto/o_dir.c @@ -1,4 +1,4 @@ -/* crypto/o_dir.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/o_dir.c */ /* * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project * 2004. diff --git a/deps/openssl/openssl/crypto/o_dir.h b/deps/openssl/openssl/crypto/o_dir.h index d55431194ef268..bf45a14d02ec74 100644 --- a/deps/openssl/openssl/crypto/o_dir.h +++ b/deps/openssl/openssl/crypto/o_dir.h @@ -1,4 +1,4 @@ -/* crypto/o_dir.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/o_dir.h */ /* * Copied from Richard Levitte's (richard@levitte.org) LP library. All * symbol names have been changed, with permission from the author. diff --git a/deps/openssl/openssl/crypto/o_dir_test.c b/deps/openssl/openssl/crypto/o_dir_test.c index 7cdbbbc403e72d..60436b72ce37d6 100644 --- a/deps/openssl/openssl/crypto/o_dir_test.c +++ b/deps/openssl/openssl/crypto/o_dir_test.c @@ -1,4 +1,4 @@ -/* crypto/o_dir.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/o_dir.h */ /* * Copied from Richard Levitte's (richard@levitte.org) LP library. All * symbol names have been changed, with permission from the author. diff --git a/deps/openssl/openssl/crypto/o_str.c b/deps/openssl/openssl/crypto/o_str.c index 4e2d096704f000..7e61cde85a273a 100644 --- a/deps/openssl/openssl/crypto/o_str.c +++ b/deps/openssl/openssl/crypto/o_str.c @@ -1,4 +1,4 @@ -/* crypto/o_str.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/o_str.c */ /* * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project * 2003. diff --git a/deps/openssl/openssl/crypto/o_str.h b/deps/openssl/openssl/crypto/o_str.h index 5313528ed92671..fa512eb3978422 100644 --- a/deps/openssl/openssl/crypto/o_str.h +++ b/deps/openssl/openssl/crypto/o_str.h @@ -1,4 +1,4 @@ -/* crypto/o_str.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/o_str.h */ /* * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project * 2003. diff --git a/deps/openssl/openssl/crypto/o_time.c b/deps/openssl/openssl/crypto/o_time.c index 58413fe97d09d3..635dae184d2fee 100644 --- a/deps/openssl/openssl/crypto/o_time.c +++ b/deps/openssl/openssl/crypto/o_time.c @@ -1,4 +1,4 @@ -/* crypto/o_time.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/o_time.c */ /* * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project * 2001. diff --git a/deps/openssl/openssl/crypto/o_time.h b/deps/openssl/openssl/crypto/o_time.h index a83a3d247d41ee..f192c6dccf374e 100644 --- a/deps/openssl/openssl/crypto/o_time.h +++ b/deps/openssl/openssl/crypto/o_time.h @@ -1,4 +1,4 @@ -/* crypto/o_time.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/o_time.h */ /* * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project * 2001. diff --git a/deps/openssl/openssl/crypto/ocsp/ocsp_lib.c b/deps/openssl/openssl/crypto/ocsp/ocsp_lib.c index 442a5b63d4ba2d..cabf53933a4422 100644 --- a/deps/openssl/openssl/crypto/ocsp/ocsp_lib.c +++ b/deps/openssl/openssl/crypto/ocsp/ocsp_lib.c @@ -246,12 +246,6 @@ int OCSP_parse_url(const char *url, char **phost, char **pport, char **ppath, if ((p = strchr(p, ':'))) { *p = 0; port = p + 1; - } else { - /* Not found: set default port */ - if (*pssl) - port = "443"; - else - port = "80"; } *pport = BUF_strdup(port); diff --git a/deps/openssl/openssl/crypto/ocsp/ocsp_prn.c b/deps/openssl/openssl/crypto/ocsp/ocsp_prn.c index 1834256af271f3..47d5f83ef9b09a 100644 --- a/deps/openssl/openssl/crypto/ocsp/ocsp_prn.c +++ b/deps/openssl/openssl/crypto/ocsp/ocsp_prn.c @@ -212,8 +212,7 @@ int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE *o, unsigned long flags) return 1; } - i = ASN1_STRING_length(rb->response); - if (!(br = OCSP_response_get1_basic(o))) + if ((br = OCSP_response_get1_basic(o)) == NULL) goto err; rd = br->tbsResponseData; l = ASN1_INTEGER_get(rd->version); diff --git a/deps/openssl/openssl/crypto/opensslconf.h.in b/deps/openssl/openssl/crypto/opensslconf.h.in index 814309becb6c6c..7a1c85d6ec9da0 100644 --- a/deps/openssl/openssl/crypto/opensslconf.h.in +++ b/deps/openssl/openssl/crypto/opensslconf.h.in @@ -120,7 +120,7 @@ optimization options. Older Sparc's work better with only UNROLL, but there's no way to tell at compile time what it is you're running on */ -#if defined( sun ) /* Newer Sparc's */ +#if defined( __sun ) || defined ( sun ) /* Newer Sparc's */ # define DES_PTR # define DES_RISC1 # define DES_UNROLL diff --git a/deps/openssl/openssl/crypto/opensslv.h b/deps/openssl/openssl/crypto/opensslv.h index c06b13ac6b0f92..4334fd15cd8739 100644 --- a/deps/openssl/openssl/crypto/opensslv.h +++ b/deps/openssl/openssl/crypto/opensslv.h @@ -30,11 +30,11 @@ extern "C" { * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for * major minor fix final patch/beta) */ -# define OPENSSL_VERSION_NUMBER 0x1000204fL +# define OPENSSL_VERSION_NUMBER 0x1000207fL # ifdef OPENSSL_FIPS -# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2d-fips 9 Jul 2015" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2g-fips 1 Mar 2016" # else -# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2d 9 Jul 2015" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2g 1 Mar 2016" # endif # define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT diff --git a/deps/openssl/openssl/crypto/pem/pem_info.c b/deps/openssl/openssl/crypto/pem/pem_info.c index 68747d162586a8..4d736a1d07e585 100644 --- a/deps/openssl/openssl/crypto/pem/pem_info.c +++ b/deps/openssl/openssl/crypto/pem/pem_info.c @@ -172,6 +172,8 @@ STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, xi->enc_len = 0; xi->x_pkey = X509_PKEY_new(); + if (xi->x_pkey == NULL) + goto err; ptype = EVP_PKEY_RSA; pp = &xi->x_pkey->dec_pkey; if ((int)strlen(header) > 10) /* assume encrypted */ @@ -193,6 +195,8 @@ STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, xi->enc_len = 0; xi->x_pkey = X509_PKEY_new(); + if (xi->x_pkey == NULL) + goto err; ptype = EVP_PKEY_DSA; pp = &xi->x_pkey->dec_pkey; if ((int)strlen(header) > 10) /* assume encrypted */ @@ -214,6 +218,8 @@ STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, xi->enc_len = 0; xi->x_pkey = X509_PKEY_new(); + if (xi->x_pkey == NULL) + goto err; ptype = EVP_PKEY_EC; pp = &xi->x_pkey->dec_pkey; if ((int)strlen(header) > 10) /* assume encrypted */ diff --git a/deps/openssl/openssl/crypto/pem/pvkfmt.c b/deps/openssl/openssl/crypto/pem/pvkfmt.c index ee4b6a8241cc2c..82d45273ed16e8 100644 --- a/deps/openssl/openssl/crypto/pem/pvkfmt.c +++ b/deps/openssl/openssl/crypto/pem/pvkfmt.c @@ -624,13 +624,11 @@ static int do_PVK_header(const unsigned char **in, unsigned int length, PEMerr(PEM_F_DO_PVK_HEADER, PEM_R_PVK_TOO_SHORT); return 0; } - length -= 20; } else { if (length < 24) { PEMerr(PEM_F_DO_PVK_HEADER, PEM_R_PVK_TOO_SHORT); return 0; } - length -= 24; pvk_magic = read_ledword(&p); if (pvk_magic != MS_PVKMAGIC) { PEMerr(PEM_F_DO_PVK_HEADER, PEM_R_BAD_MAGIC_NUMBER); @@ -692,23 +690,23 @@ static EVP_PKEY *do_PVK_body(const unsigned char **in, inlen = PEM_def_callback(psbuf, PEM_BUFSIZE, 0, u); if (inlen <= 0) { PEMerr(PEM_F_DO_PVK_BODY, PEM_R_BAD_PASSWORD_READ); - return NULL; + goto err; } enctmp = OPENSSL_malloc(keylen + 8); if (!enctmp) { PEMerr(PEM_F_DO_PVK_BODY, ERR_R_MALLOC_FAILURE); - return NULL; + goto err; } if (!derive_pvk_key(keybuf, p, saltlen, (unsigned char *)psbuf, inlen)) - return NULL; + goto err; p += saltlen; /* Copy BLOBHEADER across, decrypt rest */ memcpy(enctmp, p, 8); p += 8; if (keylen < 8) { PEMerr(PEM_F_DO_PVK_BODY, PEM_R_PVK_TOO_SHORT); - return NULL; + goto err; } inlen = keylen - 8; q = enctmp + 8; diff --git a/deps/openssl/openssl/crypto/perlasm/ppc-xlate.pl b/deps/openssl/openssl/crypto/perlasm/ppc-xlate.pl index f89e8142993166..0f46cf06bcb859 100755 --- a/deps/openssl/openssl/crypto/perlasm/ppc-xlate.pl +++ b/deps/openssl/openssl/crypto/perlasm/ppc-xlate.pl @@ -151,6 +151,26 @@ " vor $vx,$vy,$vy"; }; +# Some ABIs specify vrsave, special-purpose register #256, as reserved +# for system use. +my $no_vrsave = ($flavour =~ /aix|linux64le/); +my $mtspr = sub { + my ($f,$idx,$ra) = @_; + if ($idx == 256 && $no_vrsave) { + " or $ra,$ra,$ra"; + } else { + " mtspr $idx,$ra"; + } +}; +my $mfspr = sub { + my ($f,$rd,$idx) = @_; + if ($idx == 256 && $no_vrsave) { + " li $rd,-1"; + } else { + " mfspr $rd,$idx"; + } +}; + # PowerISA 2.06 stuff sub vsxmem_op { my ($f, $vrt, $ra, $rb, $op) = @_; diff --git a/deps/openssl/openssl/crypto/perlasm/x86_64-xlate.pl b/deps/openssl/openssl/crypto/perlasm/x86_64-xlate.pl index 9c70b8c2c6e9d7..ee04221c7e1da7 100755 --- a/deps/openssl/openssl/crypto/perlasm/x86_64-xlate.pl +++ b/deps/openssl/openssl/crypto/perlasm/x86_64-xlate.pl @@ -198,8 +198,11 @@ if ($gas) { # Solaris /usr/ccs/bin/as can't handle multiplications # in $self->{value} - $self->{value} =~ s/(?{value} =~ s/([0-9]+\s*[\*\/\%]\s*[0-9]+)/eval($1)/eg; + my $value = $self->{value}; + $value =~ s/(?{value} = $value; + } sprintf "\$%s",$self->{value}; } else { $self->{value} =~ s/(0b[0-1]+)/oct($1)/eig; diff --git a/deps/openssl/openssl/crypto/pkcs12/p12_add.c b/deps/openssl/openssl/crypto/pkcs12/p12_add.c index 982805d988de28..d9f03a39fd1532 100644 --- a/deps/openssl/openssl/crypto/pkcs12/p12_add.c +++ b/deps/openssl/openssl/crypto/pkcs12/p12_add.c @@ -75,15 +75,19 @@ PKCS12_SAFEBAG *PKCS12_item_pack_safebag(void *obj, const ASN1_ITEM *it, bag->type = OBJ_nid2obj(nid1); if (!ASN1_item_pack(obj, it, &bag->value.octet)) { PKCS12err(PKCS12_F_PKCS12_ITEM_PACK_SAFEBAG, ERR_R_MALLOC_FAILURE); - return NULL; + goto err; } if (!(safebag = PKCS12_SAFEBAG_new())) { PKCS12err(PKCS12_F_PKCS12_ITEM_PACK_SAFEBAG, ERR_R_MALLOC_FAILURE); - return NULL; + goto err; } safebag->value.bag = bag; safebag->type = OBJ_nid2obj(nid2); return safebag; + + err: + PKCS12_BAGS_free(bag); + return NULL; } /* Turn PKCS8 object into a keybag */ @@ -127,6 +131,7 @@ PKCS12_SAFEBAG *PKCS12_MAKE_SHKEYBAG(int pbe_nid, const char *pass, PKCS8_encrypt(pbe_nid, pbe_ciph, pass, passlen, salt, saltlen, iter, p8))) { PKCS12err(PKCS12_F_PKCS12_MAKE_SHKEYBAG, ERR_R_MALLOC_FAILURE); + PKCS12_SAFEBAG_free(bag); return NULL; } @@ -144,14 +149,18 @@ PKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk) p7->type = OBJ_nid2obj(NID_pkcs7_data); if (!(p7->d.data = M_ASN1_OCTET_STRING_new())) { PKCS12err(PKCS12_F_PKCS12_PACK_P7DATA, ERR_R_MALLOC_FAILURE); - return NULL; + goto err; } if (!ASN1_item_pack(sk, ASN1_ITEM_rptr(PKCS12_SAFEBAGS), &p7->d.data)) { PKCS12err(PKCS12_F_PKCS12_PACK_P7DATA, PKCS12_R_CANT_PACK_STRUCTURE); - return NULL; + goto err; } return p7; + + err: + PKCS7_free(p7); + return NULL; } /* Unpack SAFEBAGS from PKCS#7 data ContentInfo */ @@ -181,7 +190,7 @@ PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen, if (!PKCS7_set_type(p7, NID_pkcs7_encrypted)) { PKCS12err(PKCS12_F_PKCS12_PACK_P7ENCDATA, PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE); - return NULL; + goto err; } pbe_ciph = EVP_get_cipherbynid(pbe_nid); @@ -193,7 +202,7 @@ PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen, if (!pbe) { PKCS12err(PKCS12_F_PKCS12_PACK_P7ENCDATA, ERR_R_MALLOC_FAILURE); - return NULL; + goto err; } X509_ALGOR_free(p7->d.encrypted->enc_data->algorithm); p7->d.encrypted->enc_data->algorithm = pbe; @@ -202,10 +211,14 @@ PKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen, PKCS12_item_i2d_encrypt(pbe, ASN1_ITEM_rptr(PKCS12_SAFEBAGS), pass, passlen, bags, 1))) { PKCS12err(PKCS12_F_PKCS12_PACK_P7ENCDATA, PKCS12_R_ENCRYPT_ERROR); - return NULL; + goto err; } return p7; + + err: + PKCS7_free(p7); + return NULL; } STACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass, diff --git a/deps/openssl/openssl/crypto/pkcs12/p12_crpt.c b/deps/openssl/openssl/crypto/pkcs12/p12_crpt.c index 3a166e61300365..9c2dcab0246329 100644 --- a/deps/openssl/openssl/crypto/pkcs12/p12_crpt.c +++ b/deps/openssl/openssl/crypto/pkcs12/p12_crpt.c @@ -77,6 +77,9 @@ int PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen, const unsigned char *pbuf; unsigned char key[EVP_MAX_KEY_LENGTH], iv[EVP_MAX_IV_LENGTH]; + if (cipher == NULL) + return 0; + /* Extract useful info from parameter */ if (param == NULL || param->type != V_ASN1_SEQUENCE || param->value.sequence == NULL) { diff --git a/deps/openssl/openssl/crypto/pkcs12/p12_mutl.c b/deps/openssl/openssl/crypto/pkcs12/p12_mutl.c index 5ab4bf290e142e..a9277827ff2df5 100644 --- a/deps/openssl/openssl/crypto/pkcs12/p12_mutl.c +++ b/deps/openssl/openssl/crypto/pkcs12/p12_mutl.c @@ -173,11 +173,11 @@ int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, int saltlen, } if (!saltlen) saltlen = PKCS12_SALT_LEN; - p12->mac->salt->length = saltlen; - if (!(p12->mac->salt->data = OPENSSL_malloc(saltlen))) { + if ((p12->mac->salt->data = OPENSSL_malloc(saltlen)) == NULL) { PKCS12err(PKCS12_F_PKCS12_SETUP_MAC, ERR_R_MALLOC_FAILURE); return 0; } + p12->mac->salt->length = saltlen; if (!salt) { if (RAND_pseudo_bytes(p12->mac->salt->data, saltlen) < 0) return 0; diff --git a/deps/openssl/openssl/crypto/pkcs7/pk7_doit.c b/deps/openssl/openssl/crypto/pkcs7/pk7_doit.c index c8d7db01bd730c..946aaa65435b33 100644 --- a/deps/openssl/openssl/crypto/pkcs7/pk7_doit.c +++ b/deps/openssl/openssl/crypto/pkcs7/pk7_doit.c @@ -656,6 +656,8 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert) bio = BIO_new_mem_buf(data_body->data, data_body->length); else { bio = BIO_new(BIO_s_mem()); + if (bio == NULL) + goto err; BIO_set_mem_eof_return(bio, 0); } if (bio == NULL) @@ -1156,7 +1158,6 @@ PKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx) rsk = p7->d.signed_and_enveloped->recipientinfo; if (rsk == NULL) return NULL; - ri = sk_PKCS7_RECIP_INFO_value(rsk, 0); if (sk_PKCS7_RECIP_INFO_num(rsk) <= idx) return (NULL); ri = sk_PKCS7_RECIP_INFO_value(rsk, idx); diff --git a/deps/openssl/openssl/crypto/pkcs7/pk7_smime.c b/deps/openssl/openssl/crypto/pkcs7/pk7_smime.c index dbd4100c8d028b..dc9b484078afc9 100644 --- a/deps/openssl/openssl/crypto/pkcs7/pk7_smime.c +++ b/deps/openssl/openssl/crypto/pkcs7/pk7_smime.c @@ -256,8 +256,8 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, X509_STORE_CTX cert_ctx; char buf[4096]; int i, j = 0, k, ret = 0; - BIO *p7bio; - BIO *tmpin, *tmpout; + BIO *p7bio = NULL; + BIO *tmpin = NULL, *tmpout = NULL; if (!p7) { PKCS7err(PKCS7_F_PKCS7_VERIFY, PKCS7_R_INVALID_NULL_POINTER); @@ -277,7 +277,18 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, #if 0 /* * NB: this test commented out because some versions of Netscape - * illegally include zero length content when signing data. + * illegally include zero length content when signing data. Also + * Microsoft Authenticode includes a SpcIndirectDataContent data + * structure which describes the content to be protected by the + * signature, rather than directly embedding that content. So + * Authenticode implementations are also expected to use + * PKCS7_verify() with explicit external data, on non-detached + * PKCS#7 signatures. + * + * In OpenSSL 1.1 a new flag PKCS7_NO_DUAL_CONTENT has been + * introduced to disable this sanity check. For the 1.0.2 branch + * this change is not acceptable, so the check remains completely + * commented out (as it has been for a long time). */ /* Check for data and content: two sets of data */ @@ -295,7 +306,6 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, } signers = PKCS7_get0_signers(p7, certs, flags); - if (!signers) return 0; @@ -308,14 +318,12 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, if (!X509_STORE_CTX_init(&cert_ctx, store, signer, p7->d.sign->cert)) { PKCS7err(PKCS7_F_PKCS7_VERIFY, ERR_R_X509_LIB); - sk_X509_free(signers); - return 0; + goto err; } X509_STORE_CTX_set_default(&cert_ctx, "smime_sign"); } else if (!X509_STORE_CTX_init(&cert_ctx, store, signer, NULL)) { PKCS7err(PKCS7_F_PKCS7_VERIFY, ERR_R_X509_LIB); - sk_X509_free(signers); - return 0; + goto err; } if (!(flags & PKCS7_NOCRL)) X509_STORE_CTX_set0_crls(&cert_ctx, p7->d.sign->crl); @@ -328,8 +336,7 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, PKCS7_R_CERTIFICATE_VERIFY_ERROR); ERR_add_error_data(2, "Verify error:", X509_verify_cert_error_string(j)); - sk_X509_free(signers); - return 0; + goto err; } /* Check for revocation status here */ } @@ -348,7 +355,7 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, tmpin = BIO_new_mem_buf(ptr, len); if (tmpin == NULL) { PKCS7err(PKCS7_F_PKCS7_VERIFY, ERR_R_MALLOC_FAILURE); - return 0; + goto err; } } else tmpin = indata; @@ -398,15 +405,12 @@ int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, ret = 1; err: - if (tmpin == indata) { if (indata) BIO_pop(p7bio); } BIO_free_all(p7bio); - sk_X509_free(signers); - return ret; } diff --git a/deps/openssl/openssl/crypto/ppccap.c b/deps/openssl/openssl/crypto/ppccap.c index 2b7f704cd82af2..74af4732b5fa8d 100644 --- a/deps/openssl/openssl/crypto/ppccap.c +++ b/deps/openssl/openssl/crypto/ppccap.c @@ -7,7 +7,7 @@ #if defined(__linux) || defined(_AIX) # include #endif -#include +#include #include #include "ppc_arch.h" diff --git a/deps/openssl/openssl/crypto/rand/rand_vms.c b/deps/openssl/openssl/crypto/rand/rand_vms.c index a7179a4ba121be..0e10c363e2b512 100644 --- a/deps/openssl/openssl/crypto/rand/rand_vms.c +++ b/deps/openssl/openssl/crypto/rand/rand_vms.c @@ -1,4 +1,4 @@ -/* crypto/rand/rand_vms.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/rand/rand_vms.c */ /* * Written by Richard Levitte for the OpenSSL project * 2000. diff --git a/deps/openssl/openssl/crypto/rc4/asm/rc4-x86_64.pl b/deps/openssl/openssl/crypto/rc4/asm/rc4-x86_64.pl index 75750dbf334dda..20722d3e724615 100755 --- a/deps/openssl/openssl/crypto/rc4/asm/rc4-x86_64.pl +++ b/deps/openssl/openssl/crypto/rc4/asm/rc4-x86_64.pl @@ -56,7 +56,7 @@ # achieves respectful 432MBps on 2.8GHz processor now. For reference. # If executed on Xeon, current RC4_CHAR code-path is 2.7x faster than # RC4_INT code-path. While if executed on Opteron, it's only 25% -# slower than the RC4_INT one [meaning that if CPU �-arch detection +# slower than the RC4_INT one [meaning that if CPU µ-arch detection # is not implemented, then this final RC4_CHAR code-path should be # preferred, as it provides better *all-round* performance]. diff --git a/deps/openssl/openssl/crypto/rc4/rc4_utl.c b/deps/openssl/openssl/crypto/rc4/rc4_utl.c index 7c6a15f1c71f9f..cbd4a24e4b4d05 100644 --- a/deps/openssl/openssl/crypto/rc4/rc4_utl.c +++ b/deps/openssl/openssl/crypto/rc4/rc4_utl.c @@ -1,4 +1,4 @@ -/* crypto/rc4/rc4_utl.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/rc4/rc4_utl.c */ /* ==================================================================== * Copyright (c) 2011 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/rsa/rsa_ameth.c b/deps/openssl/openssl/crypto/rsa/rsa_ameth.c index ca3922e6c29831..4e0621827cf3ed 100644 --- a/deps/openssl/openssl/crypto/rsa/rsa_ameth.c +++ b/deps/openssl/openssl/crypto/rsa/rsa_ameth.c @@ -268,7 +268,7 @@ static X509_ALGOR *rsa_mgf1_decode(X509_ALGOR *alg) { const unsigned char *p; int plen; - if (alg == NULL) + if (alg == NULL || alg->parameter == NULL) return NULL; if (OBJ_obj2nid(alg->algorithm) != NID_mgf1) return NULL; diff --git a/deps/openssl/openssl/crypto/rsa/rsa_chk.c b/deps/openssl/openssl/crypto/rsa/rsa_chk.c index f4383860b58b28..607faa00171ed4 100644 --- a/deps/openssl/openssl/crypto/rsa/rsa_chk.c +++ b/deps/openssl/openssl/crypto/rsa/rsa_chk.c @@ -1,4 +1,4 @@ -/* crypto/rsa/rsa_chk.c -*- Mode: C; c-file-style: "eay" -*- */ +/* crypto/rsa/rsa_chk.c */ /* ==================================================================== * Copyright (c) 1999 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/rsa/rsa_gen.c b/deps/openssl/openssl/crypto/rsa/rsa_gen.c index 2465fbdebf190b..7f7dca39fd089b 100644 --- a/deps/openssl/openssl/crypto/rsa/rsa_gen.c +++ b/deps/openssl/openssl/crypto/rsa/rsa_gen.c @@ -69,6 +69,8 @@ #include #ifdef OPENSSL_FIPS # include +extern int FIPS_rsa_x931_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, + BN_GENCB *cb); #endif static int rsa_builtin_keygen(RSA *rsa, int bits, BIGNUM *e_value, @@ -94,7 +96,7 @@ int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb) return rsa->meth->rsa_keygen(rsa, bits, e_value, cb); #ifdef OPENSSL_FIPS if (FIPS_mode()) - return FIPS_rsa_generate_key_ex(rsa, bits, e_value, cb); + return FIPS_rsa_x931_generate_key_ex(rsa, bits, e_value, cb); #endif return rsa_builtin_keygen(rsa, bits, e_value, cb); } diff --git a/deps/openssl/openssl/crypto/rsa/rsa_sign.c b/deps/openssl/openssl/crypto/rsa/rsa_sign.c index 19461c6364d43e..82ca8324dfbc11 100644 --- a/deps/openssl/openssl/crypto/rsa/rsa_sign.c +++ b/deps/openssl/openssl/crypto/rsa/rsa_sign.c @@ -218,14 +218,13 @@ int int_rsa_verify(int dtype, const unsigned char *m, memcpy(rm, s + 2, 16); *prm_len = 16; ret = 1; - } else if (memcmp(m, s + 2, 16)) + } else if (memcmp(m, s + 2, 16)) { RSAerr(RSA_F_INT_RSA_VERIFY, RSA_R_BAD_SIGNATURE); - else + } else { ret = 1; - } - - /* Special case: SSL signature */ - if (dtype == NID_md5_sha1) { + } + } else if (dtype == NID_md5_sha1) { + /* Special case: SSL signature */ if ((i != SSL_SIG_LENGTH) || memcmp(s, m, SSL_SIG_LENGTH)) RSAerr(RSA_F_INT_RSA_VERIFY, RSA_R_BAD_SIGNATURE); else diff --git a/deps/openssl/openssl/crypto/rsa/rsa_test.c b/deps/openssl/openssl/crypto/rsa/rsa_test.c index e9712953e99393..85c7440b8c6805 100644 --- a/deps/openssl/openssl/crypto/rsa/rsa_test.c +++ b/deps/openssl/openssl/crypto/rsa/rsa_test.c @@ -297,22 +297,30 @@ int main(int argc, char *argv[]) } else printf("OAEP encryption/decryption ok\n"); - /* Try decrypting corrupted ciphertexts */ + /* Try decrypting corrupted ciphertexts. */ for (n = 0; n < clen; ++n) { - int b; - unsigned char saved = ctext[n]; - for (b = 0; b < 256; ++b) { - if (b == saved) - continue; - ctext[n] = b; - num = RSA_private_decrypt(num, ctext, ptext, key, + ctext[n] ^= 1; + num = RSA_private_decrypt(clen, ctext, ptext, key, RSA_PKCS1_OAEP_PADDING); - if (num > 0) { - printf("Corrupt data decrypted!\n"); - err = 1; - } + if (num > 0) { + printf("Corrupt data decrypted!\n"); + err = 1; + break; } + ctext[n] ^= 1; } + + /* Test truncated ciphertexts, as well as negative length. */ + for (n = -1; n < clen; ++n) { + num = RSA_private_decrypt(n, ctext, ptext, key, + RSA_PKCS1_OAEP_PADDING); + if (num > 0) { + printf("Truncated data decrypted!\n"); + err = 1; + break; + } + } + next: RSA_free(key); } diff --git a/deps/openssl/openssl/crypto/seed/seed_cbc.c b/deps/openssl/openssl/crypto/seed/seed_cbc.c index 33e6887740e92b..ee1115b4c11360 100644 --- a/deps/openssl/openssl/crypto/seed/seed_cbc.c +++ b/deps/openssl/openssl/crypto/seed/seed_cbc.c @@ -1,4 +1,4 @@ -/* crypto/seed/seed_cbc.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/seed/seed_cbc.c */ /* ==================================================================== * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/seed/seed_cfb.c b/deps/openssl/openssl/crypto/seed/seed_cfb.c index 3437d7b4e11141..b6a5648b35fd74 100644 --- a/deps/openssl/openssl/crypto/seed/seed_cfb.c +++ b/deps/openssl/openssl/crypto/seed/seed_cfb.c @@ -1,4 +1,4 @@ -/* crypto/seed/seed_cfb.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/seed/seed_cfb.c */ /* ==================================================================== * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/seed/seed_ecb.c b/deps/openssl/openssl/crypto/seed/seed_ecb.c index 937a31b42a8765..9363d5508044a3 100644 --- a/deps/openssl/openssl/crypto/seed/seed_ecb.c +++ b/deps/openssl/openssl/crypto/seed/seed_ecb.c @@ -1,4 +1,4 @@ -/* crypto/seed/seed_ecb.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/seed/seed_ecb.c */ /* ==================================================================== * Copyright (c) 2007 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/seed/seed_ofb.c b/deps/openssl/openssl/crypto/seed/seed_ofb.c index 6974302ce80f5c..48b71224c52c8d 100644 --- a/deps/openssl/openssl/crypto/seed/seed_ofb.c +++ b/deps/openssl/openssl/crypto/seed/seed_ofb.c @@ -1,4 +1,4 @@ -/* crypto/seed/seed_ofb.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/seed/seed_ofb.c */ /* ==================================================================== * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/sha/asm/sha1-586.pl b/deps/openssl/openssl/crypto/sha/asm/sha1-586.pl index 4895eb3ddf8579..e0b5d83b62018a 100644 --- a/deps/openssl/openssl/crypto/sha/asm/sha1-586.pl +++ b/deps/openssl/openssl/crypto/sha/asm/sha1-586.pl @@ -66,9 +66,9 @@ # switch to AVX alone improves performance by as little as 4% in # comparison to SSSE3 code path. But below result doesn't look like # 4% improvement... Trouble is that Sandy Bridge decodes 'ro[rl]' as -# pair of �-ops, and it's the additional �-ops, two per round, that +# pair of µ-ops, and it's the additional µ-ops, two per round, that # make it run slower than Core2 and Westmere. But 'sh[rl]d' is decoded -# as single �-op by Sandy Bridge and it's replacing 'ro[rl]' with +# as single µ-op by Sandy Bridge and it's replacing 'ro[rl]' with # equivalent 'sh[rl]d' that is responsible for the impressive 5.1 # cycles per processed byte. But 'sh[rl]d' is not something that used # to be fast, nor does it appear to be fast in upcoming Bulldozer diff --git a/deps/openssl/openssl/crypto/sha/asm/sha1-mb-x86_64.pl b/deps/openssl/openssl/crypto/sha/asm/sha1-mb-x86_64.pl index a8ee075eaaa0a0..a8d8708d4b7514 100644 --- a/deps/openssl/openssl/crypto/sha/asm/sha1-mb-x86_64.pl +++ b/deps/openssl/openssl/crypto/sha/asm/sha1-mb-x86_64.pl @@ -58,7 +58,7 @@ $avx = ($1>=10) + ($1>=11); } -if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) { +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([3-9]\.[0-9]+)/) { $avx = ($2>=3.0) + ($2>3.0); } diff --git a/deps/openssl/openssl/crypto/sha/asm/sha1-x86_64.pl b/deps/openssl/openssl/crypto/sha/asm/sha1-x86_64.pl index 9bb6b498190fdf..5f375fc6886b3a 100755 --- a/deps/openssl/openssl/crypto/sha/asm/sha1-x86_64.pl +++ b/deps/openssl/openssl/crypto/sha/asm/sha1-x86_64.pl @@ -107,7 +107,7 @@ $avx = ($1>=10) + ($1>=11); } -if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([2-9]\.[0-9]+)/) { +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([2-9]\.[0-9]+)/) { $avx = ($2>=3.0) + ($2>3.0); } diff --git a/deps/openssl/openssl/crypto/sha/asm/sha256-586.pl b/deps/openssl/openssl/crypto/sha/asm/sha256-586.pl index 6462e45ba75bee..e9077143817cdb 100644 --- a/deps/openssl/openssl/crypto/sha/asm/sha256-586.pl +++ b/deps/openssl/openssl/crypto/sha/asm/sha256-586.pl @@ -10,7 +10,7 @@ # SHA256 block transform for x86. September 2007. # # Performance improvement over compiler generated code varies from -# 10% to 40% [see below]. Not very impressive on some �-archs, but +# 10% to 40% [see below]. Not very impressive on some µ-archs, but # it's 5 times smaller and optimizies amount of writes. # # May 2012. diff --git a/deps/openssl/openssl/crypto/sha/asm/sha256-mb-x86_64.pl b/deps/openssl/openssl/crypto/sha/asm/sha256-mb-x86_64.pl index adf2ddccd18b0c..9770286b9596ad 100644 --- a/deps/openssl/openssl/crypto/sha/asm/sha256-mb-x86_64.pl +++ b/deps/openssl/openssl/crypto/sha/asm/sha256-mb-x86_64.pl @@ -59,7 +59,7 @@ $avx = ($1>=10) + ($1>=11); } -if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) { +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([3-9]\.[0-9]+)/) { $avx = ($2>=3.0) + ($2>3.0); } diff --git a/deps/openssl/openssl/crypto/sha/asm/sha512-586.pl b/deps/openssl/openssl/crypto/sha/asm/sha512-586.pl index e96ec00314a486..2f6a202c37658c 100644 --- a/deps/openssl/openssl/crypto/sha/asm/sha512-586.pl +++ b/deps/openssl/openssl/crypto/sha/asm/sha512-586.pl @@ -37,7 +37,7 @@ # # IALU code-path is optimized for elder Pentiums. On vanilla Pentium # performance improvement over compiler generated code reaches ~60%, -# while on PIII - ~35%. On newer �-archs improvement varies from 15% +# while on PIII - ~35%. On newer µ-archs improvement varies from 15% # to 50%, but it's less important as they are expected to execute SSE2 # code-path, which is commonly ~2-3x faster [than compiler generated # code]. SSE2 code-path is as fast as original sha512-sse2.pl, even diff --git a/deps/openssl/openssl/crypto/sha/asm/sha512-parisc.pl b/deps/openssl/openssl/crypto/sha/asm/sha512-parisc.pl index fc0e15b3c0593a..6cad72e255730f 100755 --- a/deps/openssl/openssl/crypto/sha/asm/sha512-parisc.pl +++ b/deps/openssl/openssl/crypto/sha/asm/sha512-parisc.pl @@ -19,7 +19,7 @@ # SHA512 performance is >2.9x better than gcc 3.2 generated code on # PA-7100LC, PA-RISC 1.1 processor. Then implementation detects if the # code is executed on PA-RISC 2.0 processor and switches to 64-bit -# code path delivering adequate peformance even in "blended" 32-bit +# code path delivering adequate performance even in "blended" 32-bit # build. Though 64-bit code is not any faster than code generated by # vendor compiler on PA-8600... # diff --git a/deps/openssl/openssl/crypto/sha/asm/sha512-x86_64.pl b/deps/openssl/openssl/crypto/sha/asm/sha512-x86_64.pl index b7b44b4411362d..78e445f3fe4ac2 100755 --- a/deps/openssl/openssl/crypto/sha/asm/sha512-x86_64.pl +++ b/deps/openssl/openssl/crypto/sha/asm/sha512-x86_64.pl @@ -124,7 +124,7 @@ $avx = ($1>=10) + ($1>=11); } -if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) { +if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|.*based on LLVM) ([3-9]\.[0-9]+)/) { $avx = ($2>=3.0) + ($2>3.0); } diff --git a/deps/openssl/openssl/crypto/sha/sha1test.c b/deps/openssl/openssl/crypto/sha/sha1test.c index 0052a95c7dd436..551a348df37f1f 100644 --- a/deps/openssl/openssl/crypto/sha/sha1test.c +++ b/deps/openssl/openssl/crypto/sha/sha1test.c @@ -157,8 +157,8 @@ int main(int argc, char *argv[]) if (err) printf("ERROR: %d\n", err); # endif - EXIT(err); EVP_MD_CTX_cleanup(&c); + EXIT(err); return (0); } diff --git a/deps/openssl/openssl/crypto/sparccpuid.S b/deps/openssl/openssl/crypto/sparccpuid.S index eea2006fba18f6..7b12ec29315436 100644 --- a/deps/openssl/openssl/crypto/sparccpuid.S +++ b/deps/openssl/openssl/crypto/sparccpuid.S @@ -123,7 +123,7 @@ OPENSSL_wipe_cpu: fmovs %f1,%f3 fmovs %f0,%f2 - add %fp,BIAS,%i0 ! return pointer to caller�s top of stack + add %fp,BIAS,%i0 ! return pointer to caller´s top of stack ret restore diff --git a/deps/openssl/openssl/crypto/sparcv9cap.c b/deps/openssl/openssl/crypto/sparcv9cap.c index 8bf2846929b177..a36e461792941d 100644 --- a/deps/openssl/openssl/crypto/sparcv9cap.c +++ b/deps/openssl/openssl/crypto/sparcv9cap.c @@ -237,6 +237,17 @@ static void common_handler(int sig) siglongjmp(common_jmp, sig); } +#if defined(__sun) && defined(__SVR4) +# if defined(__GNUC__) && __GNUC__>=2 +extern unsigned int getisax(unsigned int vec[], unsigned int sz) __attribute__ ((weak)); +# elif defined(__SUNPRO_C) +#pragma weak getisax +extern unsigned int getisax(unsigned int vec[], unsigned int sz); +# else +static unsigned int (*getisax) (unsigned int vec[], unsigned int sz) = NULL; +# endif +#endif + void OPENSSL_cpuid_setup(void) { char *e; @@ -255,6 +266,42 @@ void OPENSSL_cpuid_setup(void) return; } +#if defined(__sun) && defined(__SVR4) + if (getisax != NULL) { + unsigned int vec[1]; + + if (getisax (vec,1)) { + if (vec[0]&0x0020) OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS1; + if (vec[0]&0x0040) OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS2; + if (vec[0]&0x0080) OPENSSL_sparcv9cap_P[0] |= SPARCV9_BLK; + if (vec[0]&0x0100) OPENSSL_sparcv9cap_P[0] |= SPARCV9_FMADD; + if (vec[0]&0x0400) OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS3; + + /* reconstruct %cfr copy */ + OPENSSL_sparcv9cap_P[1] = (vec[0]>>17)&0x3ff; + OPENSSL_sparcv9cap_P[1] |= (OPENSSL_sparcv9cap_P[1]&CFR_MONTMUL)<<1; + if (vec[0]&0x20000000) OPENSSL_sparcv9cap_P[1] |= CFR_CRC32C; + + /* Some heuristics */ + /* all known VIS2-capable CPUs have unprivileged tick counter */ + if (OPENSSL_sparcv9cap_P[0]&SPARCV9_VIS2) + OPENSSL_sparcv9cap_P[0] &= ~SPARCV9_TICK_PRIVILEGED; + + OPENSSL_sparcv9cap_P[0] |= SPARCV9_PREFER_FPU; + + /* detect UltraSPARC-Tx, see sparccpud.S for details... */ + if ((OPENSSL_sparcv9cap_P[0]&SPARCV9_VIS1) && + _sparcv9_vis1_instrument() >= 12) + OPENSSL_sparcv9cap_P[0] &= ~(SPARCV9_VIS1 | SPARCV9_PREFER_FPU); + } + + if (sizeof(size_t) == 8) + OPENSSL_sparcv9cap_P[0] |= SPARCV9_64BIT_STACK; + + return; + } +#endif + /* Initial value, fits UltraSPARC-I&II... */ OPENSSL_sparcv9cap_P[0] = SPARCV9_PREFER_FPU | SPARCV9_TICK_PRIVILEGED; diff --git a/deps/openssl/openssl/crypto/srp/srp.h b/deps/openssl/openssl/crypto/srp/srp.h index d072536fec9bb3..028892a1ff5e04 100644 --- a/deps/openssl/openssl/crypto/srp/srp.h +++ b/deps/openssl/openssl/crypto/srp/srp.h @@ -82,16 +82,21 @@ typedef struct SRP_gN_cache_st { DECLARE_STACK_OF(SRP_gN_cache) typedef struct SRP_user_pwd_st { + /* Owned by us. */ char *id; BIGNUM *s; BIGNUM *v; + /* Not owned by us. */ const BIGNUM *g; const BIGNUM *N; + /* Owned by us. */ char *info; } SRP_user_pwd; DECLARE_STACK_OF(SRP_user_pwd) +void SRP_user_pwd_free(SRP_user_pwd *user_pwd); + typedef struct SRP_VBASE_st { STACK_OF(SRP_user_pwd) *users_pwd; STACK_OF(SRP_gN_cache) *gN_cache; @@ -115,7 +120,12 @@ DECLARE_STACK_OF(SRP_gN) SRP_VBASE *SRP_VBASE_new(char *seed_key); int SRP_VBASE_free(SRP_VBASE *vb); int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file); + +/* This method ignores the configured seed and fails for an unknown user. */ SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username); +/* NOTE: unlike in SRP_VBASE_get_by_user, caller owns the returned pointer.*/ +SRP_user_pwd *SRP_VBASE_get1_by_user(SRP_VBASE *vb, char *username); + char *SRP_create_verifier(const char *user, const char *pass, char **salt, char **verifier, const char *N, const char *g); int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt, diff --git a/deps/openssl/openssl/crypto/srp/srp_vfy.c b/deps/openssl/openssl/crypto/srp/srp_vfy.c index 50f75d7e4c9f16..26ad3e07b4bb3f 100644 --- a/deps/openssl/openssl/crypto/srp/srp_vfy.c +++ b/deps/openssl/openssl/crypto/srp/srp_vfy.c @@ -185,7 +185,7 @@ static char *t_tob64(char *dst, const unsigned char *src, int size) return olddst; } -static void SRP_user_pwd_free(SRP_user_pwd *user_pwd) +void SRP_user_pwd_free(SRP_user_pwd *user_pwd) { if (user_pwd == NULL) return; @@ -247,6 +247,24 @@ static int SRP_user_pwd_set_sv_BN(SRP_user_pwd *vinfo, BIGNUM *s, BIGNUM *v) return (vinfo->s != NULL && vinfo->v != NULL); } +static SRP_user_pwd *srp_user_pwd_dup(SRP_user_pwd *src) +{ + SRP_user_pwd *ret; + + if (src == NULL) + return NULL; + if ((ret = SRP_user_pwd_new()) == NULL) + return NULL; + + SRP_user_pwd_set_gN(ret, src->g, src->N); + if (!SRP_user_pwd_set_ids(ret, src->id, src->info) + || !SRP_user_pwd_set_sv_BN(ret, BN_dup(src->s), BN_dup(src->v))) { + SRP_user_pwd_free(ret); + return NULL; + } + return ret; +} + SRP_VBASE *SRP_VBASE_new(char *seed_key) { SRP_VBASE *vb = (SRP_VBASE *)OPENSSL_malloc(sizeof(SRP_VBASE)); @@ -468,21 +486,50 @@ int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file) } -SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username) +static SRP_user_pwd *find_user(SRP_VBASE *vb, char *username) { int i; SRP_user_pwd *user; - unsigned char digv[SHA_DIGEST_LENGTH]; - unsigned char digs[SHA_DIGEST_LENGTH]; - EVP_MD_CTX ctxt; if (vb == NULL) return NULL; + for (i = 0; i < sk_SRP_user_pwd_num(vb->users_pwd); i++) { user = sk_SRP_user_pwd_value(vb->users_pwd, i); if (strcmp(user->id, username) == 0) return user; } + + return NULL; +} + +/* + * This method ignores the configured seed and fails for an unknown user. + * Ownership of the returned pointer is not released to the caller. + * In other words, caller must not free the result. + */ +SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username) +{ + return find_user(vb, username); +} + +/* + * Ownership of the returned pointer is released to the caller. + * In other words, caller must free the result once done. + */ +SRP_user_pwd *SRP_VBASE_get1_by_user(SRP_VBASE *vb, char *username) +{ + SRP_user_pwd *user; + unsigned char digv[SHA_DIGEST_LENGTH]; + unsigned char digs[SHA_DIGEST_LENGTH]; + EVP_MD_CTX ctxt; + + if (vb == NULL) + return NULL; + + if ((user = find_user(vb, username)) != NULL) + return srp_user_pwd_dup(user); + if ((vb->seed_key == NULL) || (vb->default_g == NULL) || (vb->default_N == NULL)) return NULL; @@ -521,12 +568,12 @@ char *SRP_create_verifier(const char *user, const char *pass, char **salt, char **verifier, const char *N, const char *g) { int len; - char *result = NULL; - char *vf; + char *result = NULL, *vf = NULL; BIGNUM *N_bn = NULL, *g_bn = NULL, *s = NULL, *v = NULL; unsigned char tmp[MAX_LEN]; unsigned char tmp2[MAX_LEN]; char *defgNid = NULL; + int vfsize = 0; if ((user == NULL) || (pass == NULL) || (salt == NULL) || (verifier == NULL)) @@ -564,22 +611,23 @@ char *SRP_create_verifier(const char *user, const char *pass, char **salt, goto err; BN_bn2bin(v, tmp); - if (((vf = OPENSSL_malloc(BN_num_bytes(v) * 2)) == NULL)) + vfsize = BN_num_bytes(v) * 2; + if (((vf = OPENSSL_malloc(vfsize)) == NULL)) goto err; t_tob64(vf, tmp, BN_num_bytes(v)); - *verifier = vf; if (*salt == NULL) { char *tmp_salt; if ((tmp_salt = OPENSSL_malloc(SRP_RANDOM_SALT_LEN * 2)) == NULL) { - OPENSSL_free(vf); goto err; } t_tob64(tmp_salt, tmp2, SRP_RANDOM_SALT_LEN); *salt = tmp_salt; } + *verifier = vf; + vf = NULL; result = defgNid; err: @@ -587,11 +635,21 @@ char *SRP_create_verifier(const char *user, const char *pass, char **salt, BN_free(N_bn); BN_free(g_bn); } + OPENSSL_cleanse(vf, vfsize); + OPENSSL_free(vf); + BN_clear_free(s); + BN_clear_free(v); return result; } /* - * create a verifier (*salt,*verifier,g and N are BIGNUMs) + * create a verifier (*salt,*verifier,g and N are BIGNUMs). If *salt != NULL + * then the provided salt will be used. On successful exit *verifier will point + * to a newly allocated BIGNUM containing the verifier and (if a salt was not + * provided) *salt will be populated with a newly allocated BIGNUM containing a + * random salt. + * The caller is responsible for freeing the allocated *salt and *verifier + * BIGNUMS. */ int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt, BIGNUM **verifier, BIGNUM *N, BIGNUM *g) @@ -600,6 +658,7 @@ int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt, BIGNUM *x = NULL; BN_CTX *bn_ctx = BN_CTX_new(); unsigned char tmp2[MAX_LEN]; + BIGNUM *salttmp = NULL; if ((user == NULL) || (pass == NULL) || @@ -614,10 +673,12 @@ int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt, if (RAND_pseudo_bytes(tmp2, SRP_RANDOM_SALT_LEN) < 0) goto err; - *salt = BN_bin2bn(tmp2, SRP_RANDOM_SALT_LEN, NULL); + salttmp = BN_bin2bn(tmp2, SRP_RANDOM_SALT_LEN, NULL); + } else { + salttmp = *salt; } - x = SRP_Calc_x(*salt, user, pass); + x = SRP_Calc_x(salttmp, user, pass); *verifier = BN_new(); if (*verifier == NULL) @@ -631,9 +692,11 @@ int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt, srp_bn_print(*verifier); result = 1; + *salt = salttmp; err: - + if (*salt != salttmp) + BN_clear_free(salttmp); BN_clear_free(x); BN_CTX_free(bn_ctx); return result; diff --git a/deps/openssl/openssl/crypto/stack/stack.c b/deps/openssl/openssl/crypto/stack/stack.c index de437acf6a5cb6..fa50083e22b3b9 100644 --- a/deps/openssl/openssl/crypto/stack/stack.c +++ b/deps/openssl/openssl/crypto/stack/stack.c @@ -360,7 +360,7 @@ void *sk_set(_STACK *st, int i, void *value) void sk_sort(_STACK *st) { - if (st && !st->sorted) { + if (st && !st->sorted && st->comp != NULL) { int (*comp_func) (const void *, const void *); /* diff --git a/deps/openssl/openssl/crypto/store/store.h b/deps/openssl/openssl/crypto/store/store.h index 834334104907bf..ce3709d9f00bfb 100644 --- a/deps/openssl/openssl/crypto/store/store.h +++ b/deps/openssl/openssl/crypto/store/store.h @@ -1,4 +1,4 @@ -/* crypto/store/store.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/store/store.h */ /* * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project * 2003. diff --git a/deps/openssl/openssl/crypto/store/str_lib.c b/deps/openssl/openssl/crypto/store/str_lib.c index 227b797b594947..e3d5da93886803 100644 --- a/deps/openssl/openssl/crypto/store/str_lib.c +++ b/deps/openssl/openssl/crypto/store/str_lib.c @@ -1,4 +1,4 @@ -/* crypto/store/str_lib.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/store/str_lib.c */ /* * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project * 2003. diff --git a/deps/openssl/openssl/crypto/store/str_locl.h b/deps/openssl/openssl/crypto/store/str_locl.h index ac55784df0aa9c..c0b40f0db67436 100644 --- a/deps/openssl/openssl/crypto/store/str_locl.h +++ b/deps/openssl/openssl/crypto/store/str_locl.h @@ -1,4 +1,4 @@ -/* crypto/store/str_locl.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/store/str_locl.h */ /* * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project * 2003. diff --git a/deps/openssl/openssl/crypto/store/str_mem.c b/deps/openssl/openssl/crypto/store/str_mem.c index 8edd0eb41b1296..6eee5bba292273 100644 --- a/deps/openssl/openssl/crypto/store/str_mem.c +++ b/deps/openssl/openssl/crypto/store/str_mem.c @@ -1,4 +1,4 @@ -/* crypto/store/str_mem.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/store/str_mem.c */ /* * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project * 2003. diff --git a/deps/openssl/openssl/crypto/store/str_meth.c b/deps/openssl/openssl/crypto/store/str_meth.c index d83a6de0fc476a..c83fbc565aaca9 100644 --- a/deps/openssl/openssl/crypto/store/str_meth.c +++ b/deps/openssl/openssl/crypto/store/str_meth.c @@ -1,4 +1,4 @@ -/* crypto/store/str_meth.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/store/str_meth.c */ /* * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project * 2003. diff --git a/deps/openssl/openssl/crypto/ts/ts_rsp_verify.c b/deps/openssl/openssl/crypto/ts/ts_rsp_verify.c index 3ce765dfa1b6a1..29aa5a497e89ba 100644 --- a/deps/openssl/openssl/crypto/ts/ts_rsp_verify.c +++ b/deps/openssl/openssl/crypto/ts/ts_rsp_verify.c @@ -255,7 +255,8 @@ static int TS_verify_cert(X509_STORE *store, STACK_OF(X509) *untrusted, /* chain is an out argument. */ *chain = NULL; - X509_STORE_CTX_init(&cert_ctx, store, signer, untrusted); + if (!X509_STORE_CTX_init(&cert_ctx, store, signer, untrusted)) + return 0; X509_STORE_CTX_set_purpose(&cert_ctx, X509_PURPOSE_TIMESTAMP_SIGN); i = X509_verify_cert(&cert_ctx); if (i <= 0) { @@ -522,7 +523,7 @@ static int TS_check_status_info(TS_RESP *response) if (ASN1_BIT_STRING_get_bit(info->failure_info, TS_failure_info[i].code)) { if (!first) - strcpy(failure_text, ","); + strcat(failure_text, ","); else first = 0; strcat(failure_text, TS_failure_info[i].text); diff --git a/deps/openssl/openssl/crypto/ui/ui.h b/deps/openssl/openssl/crypto/ui/ui.h index b917edab3a7a38..0dc16330b8708a 100644 --- a/deps/openssl/openssl/crypto/ui/ui.h +++ b/deps/openssl/openssl/crypto/ui/ui.h @@ -1,4 +1,4 @@ -/* crypto/ui/ui.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/ui/ui.h */ /* * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project * 2001. diff --git a/deps/openssl/openssl/crypto/ui/ui_compat.c b/deps/openssl/openssl/crypto/ui/ui_compat.c index 0ca5284f91c01c..e79d54eea6824f 100644 --- a/deps/openssl/openssl/crypto/ui/ui_compat.c +++ b/deps/openssl/openssl/crypto/ui/ui_compat.c @@ -1,4 +1,4 @@ -/* crypto/ui/ui_compat.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/ui/ui_compat.c */ /* ==================================================================== * Copyright (c) 2001-2002 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/ui/ui_compat.h b/deps/openssl/openssl/crypto/ui/ui_compat.h index 42fb9ff6500f4d..bf541542c04112 100644 --- a/deps/openssl/openssl/crypto/ui/ui_compat.h +++ b/deps/openssl/openssl/crypto/ui/ui_compat.h @@ -1,4 +1,4 @@ -/* crypto/ui/ui.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/ui/ui.h */ /* * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project * 2001. diff --git a/deps/openssl/openssl/crypto/ui/ui_lib.c b/deps/openssl/openssl/crypto/ui/ui_lib.c index 5ddd7317e52b48..2f580352ce8f47 100644 --- a/deps/openssl/openssl/crypto/ui/ui_lib.c +++ b/deps/openssl/openssl/crypto/ui/ui_lib.c @@ -1,4 +1,4 @@ -/* crypto/ui/ui_lib.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/ui/ui_lib.c */ /* * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project * 2001. diff --git a/deps/openssl/openssl/crypto/ui/ui_locl.h b/deps/openssl/openssl/crypto/ui/ui_locl.h index 0d919cd7b1cce8..bebc13abfc526f 100644 --- a/deps/openssl/openssl/crypto/ui/ui_locl.h +++ b/deps/openssl/openssl/crypto/ui/ui_locl.h @@ -1,4 +1,4 @@ -/* crypto/ui/ui.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/ui/ui.h */ /* * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project * 2001. diff --git a/deps/openssl/openssl/crypto/ui/ui_openssl.c b/deps/openssl/openssl/crypto/ui/ui_openssl.c index 5d66276418fc83..9ab259b8f605a6 100644 --- a/deps/openssl/openssl/crypto/ui/ui_openssl.c +++ b/deps/openssl/openssl/crypto/ui/ui_openssl.c @@ -1,4 +1,4 @@ -/* crypto/ui/ui_openssl.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/ui/ui_openssl.c */ /* * Written by Richard Levitte (richard@levitte.org) and others for the * OpenSSL project 2001. diff --git a/deps/openssl/openssl/crypto/ui/ui_util.c b/deps/openssl/openssl/crypto/ui/ui_util.c index f65f80d71de671..0f290115d0f849 100644 --- a/deps/openssl/openssl/crypto/ui/ui_util.c +++ b/deps/openssl/openssl/crypto/ui/ui_util.c @@ -1,4 +1,4 @@ -/* crypto/ui/ui_util.c -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/ui/ui_util.c */ /* ==================================================================== * Copyright (c) 2001-2002 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/crypto/whrlpool/asm/wp-mmx.pl b/deps/openssl/openssl/crypto/whrlpool/asm/wp-mmx.pl index c584e5b92b251a..7725951d6b711c 100644 --- a/deps/openssl/openssl/crypto/whrlpool/asm/wp-mmx.pl +++ b/deps/openssl/openssl/crypto/whrlpool/asm/wp-mmx.pl @@ -16,7 +16,7 @@ # table]. I stick to value of 2 for two reasons: 1. smaller table # minimizes cache trashing and thus mitigates the hazard of side- # channel leakage similar to AES cache-timing one; 2. performance -# gap among different �-archs is smaller. +# gap among different µ-archs is smaller. # # Performance table lists rounded amounts of CPU cycles spent by # whirlpool_block_mmx routine on single 64 byte input block, i.e. diff --git a/deps/openssl/openssl/crypto/x509/x509_lu.c b/deps/openssl/openssl/crypto/x509/x509_lu.c index b0d653903ff566..50120a4d70c645 100644 --- a/deps/openssl/openssl/crypto/x509/x509_lu.c +++ b/deps/openssl/openssl/crypto/x509/x509_lu.c @@ -536,8 +536,6 @@ STACK_OF(X509_CRL) *X509_STORE_get1_crls(X509_STORE_CTX *ctx, X509_NAME *nm) X509_OBJECT *obj, xobj; sk = sk_X509_CRL_new_null(); CRYPTO_w_lock(CRYPTO_LOCK_X509_STORE); - /* Check cache first */ - idx = x509_object_idx_cnt(ctx->ctx->objs, X509_LU_CRL, nm, &cnt); /* * Always do lookup to possibly add new CRLs to cache diff --git a/deps/openssl/openssl/crypto/x509/x509_vfy.c b/deps/openssl/openssl/crypto/x509/x509_vfy.c index a2f1dbefe3520a..4d34dbac93149e 100644 --- a/deps/openssl/openssl/crypto/x509/x509_vfy.c +++ b/deps/openssl/openssl/crypto/x509/x509_vfy.c @@ -194,6 +194,9 @@ int X509_verify_cert(X509_STORE_CTX *ctx) int num, j, retry; int (*cb) (int xok, X509_STORE_CTX *xctx); STACK_OF(X509) *sktmp = NULL; + int trust = X509_TRUST_UNTRUSTED; + int err; + if (ctx->cert == NULL) { X509err(X509_F_X509_VERIFY_CERT, X509_R_NO_CERT_SET_FOR_US_TO_VERIFY); return -1; @@ -216,7 +219,8 @@ int X509_verify_cert(X509_STORE_CTX *ctx) if (((ctx->chain = sk_X509_new_null()) == NULL) || (!sk_X509_push(ctx->chain, ctx->cert))) { X509err(X509_F_X509_VERIFY_CERT, ERR_R_MALLOC_FAILURE); - goto end; + ok = -1; + goto err; } CRYPTO_add(&ctx->cert->references, 1, CRYPTO_LOCK_X509); ctx->last_untrusted = 1; @@ -225,7 +229,8 @@ int X509_verify_cert(X509_STORE_CTX *ctx) if (ctx->untrusted != NULL && (sktmp = sk_X509_dup(ctx->untrusted)) == NULL) { X509err(X509_F_X509_VERIFY_CERT, ERR_R_MALLOC_FAILURE); - goto end; + ok = -1; + goto err; } num = sk_X509_num(ctx->chain); @@ -249,7 +254,7 @@ int X509_verify_cert(X509_STORE_CTX *ctx) if (ctx->param->flags & X509_V_FLAG_TRUSTED_FIRST) { ok = ctx->get_issuer(&xtmp, ctx, x); if (ok < 0) - return ok; + goto err; /* * If successful for now free up cert so it will be picked up * again later. @@ -266,7 +271,8 @@ int X509_verify_cert(X509_STORE_CTX *ctx) if (xtmp != NULL) { if (!sk_X509_push(ctx->chain, xtmp)) { X509err(X509_F_X509_VERIFY_CERT, ERR_R_MALLOC_FAILURE); - goto end; + ok = -1; + goto err; } CRYPTO_add(&xtmp->references, 1, CRYPTO_LOCK_X509); (void)sk_X509_delete_ptr(sktmp, xtmp); @@ -314,7 +320,7 @@ int X509_verify_cert(X509_STORE_CTX *ctx) bad_chain = 1; ok = cb(0, ctx); if (!ok) - goto end; + goto err; } else { /* * We have a match: replace certificate with store @@ -347,24 +353,26 @@ int X509_verify_cert(X509_STORE_CTX *ctx) ok = ctx->get_issuer(&xtmp, ctx, x); if (ok < 0) - return ok; + goto err; if (ok == 0) break; x = xtmp; if (!sk_X509_push(ctx->chain, x)) { X509_free(xtmp); X509err(X509_F_X509_VERIFY_CERT, ERR_R_MALLOC_FAILURE); - return 0; + ok = -1; + goto err; } num++; } /* we now have our chain, lets check it... */ - i = check_trust(ctx); + if ((trust = check_trust(ctx)) == X509_TRUST_REJECTED) { + /* Callback already issued */ + ok = 0; + goto err; + } - /* If explicitly rejected error */ - if (i == X509_TRUST_REJECTED) - goto end; /* * If it's not explicitly trusted then check if there is an alternative * chain that could be used. We only do this if we haven't already @@ -372,14 +380,14 @@ int X509_verify_cert(X509_STORE_CTX *ctx) * chain checking */ retry = 0; - if (i != X509_TRUST_TRUSTED + if (trust != X509_TRUST_TRUSTED && !(ctx->param->flags & X509_V_FLAG_TRUSTED_FIRST) && !(ctx->param->flags & X509_V_FLAG_NO_ALT_CHAINS)) { while (j-- > 1) { xtmp2 = sk_X509_value(ctx->chain, j - 1); ok = ctx->get_issuer(&xtmp, ctx, xtmp2); if (ok < 0) - goto end; + goto err; /* Check if we found an alternate chain */ if (ok > 0) { /* @@ -409,7 +417,7 @@ int X509_verify_cert(X509_STORE_CTX *ctx) * self signed certificate in which case we've indicated an error already * and set bad_chain == 1 */ - if (i != X509_TRUST_TRUSTED && !bad_chain) { + if (trust != X509_TRUST_TRUSTED && !bad_chain) { if ((chain_ss == NULL) || !ctx->check_issued(ctx, x, chain_ss)) { if (ctx->last_untrusted >= num) ctx->error = X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY; @@ -430,26 +438,26 @@ int X509_verify_cert(X509_STORE_CTX *ctx) bad_chain = 1; ok = cb(0, ctx); if (!ok) - goto end; + goto err; } /* We have the chain complete: now we need to check its purpose */ ok = check_chain_extensions(ctx); if (!ok) - goto end; + goto err; /* Check name constraints */ ok = check_name_constraints(ctx); if (!ok) - goto end; + goto err; ok = check_id(ctx); if (!ok) - goto end; + goto err; /* We may as well copy down any DSA parameters that are required */ X509_get_pubkey_parameters(NULL, ctx->chain); @@ -461,16 +469,16 @@ int X509_verify_cert(X509_STORE_CTX *ctx) ok = ctx->check_revocation(ctx); if (!ok) - goto end; + goto err; - i = X509_chain_check_suiteb(&ctx->error_depth, NULL, ctx->chain, - ctx->param->flags); - if (i != X509_V_OK) { - ctx->error = i; + err = X509_chain_check_suiteb(&ctx->error_depth, NULL, ctx->chain, + ctx->param->flags); + if (err != X509_V_OK) { + ctx->error = err; ctx->current_cert = sk_X509_value(ctx->chain, ctx->error_depth); ok = cb(0, ctx); if (!ok) - goto end; + goto err; } /* At this point, we have a chain and need to verify it */ @@ -479,25 +487,28 @@ int X509_verify_cert(X509_STORE_CTX *ctx) else ok = internal_verify(ctx); if (!ok) - goto end; + goto err; #ifndef OPENSSL_NO_RFC3779 /* RFC 3779 path validation, now that CRL check has been done */ ok = v3_asid_validate_path(ctx); if (!ok) - goto end; + goto err; ok = v3_addr_validate_path(ctx); if (!ok) - goto end; + goto err; #endif /* If we get this far evaluate policies */ if (!bad_chain && (ctx->param->flags & X509_V_FLAG_POLICY_CHECK)) ok = ctx->check_policy(ctx); if (!ok) - goto end; + goto err; if (0) { - end: + err: + /* Ensure we return an error */ + if (ok > 0) + ok = 0; X509_get_pubkey_parameters(NULL, ctx->chain); } if (sktmp != NULL) @@ -752,6 +763,10 @@ static int check_hosts(X509 *x, X509_VERIFY_PARAM_ID *id) int n = sk_OPENSSL_STRING_num(id->hosts); char *name; + if (id->peername != NULL) { + OPENSSL_free(id->peername); + id->peername = NULL; + } for (i = 0; i < n; ++i) { name = sk_OPENSSL_STRING_value(id->hosts, i); if (X509_check_host(x, name, 0, id->hostflags, &id->peername) > 0) @@ -2278,9 +2293,10 @@ int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509, ctx->current_reasons = 0; ctx->tree = NULL; ctx->parent = NULL; + /* Zero ex_data to make sure we're cleanup-safe */ + memset(&ctx->ex_data, 0, sizeof(ctx->ex_data)); ctx->param = X509_VERIFY_PARAM_new(); - if (!ctx->param) { X509err(X509_F_X509_STORE_CTX_INIT, ERR_R_MALLOC_FAILURE); return 0; @@ -2289,7 +2305,6 @@ int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509, /* * Inherit callbacks and flags from X509_STORE if not set use defaults. */ - if (store) ret = X509_VERIFY_PARAM_inherit(ctx->param, store->param); else @@ -2297,6 +2312,7 @@ int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509, if (store) { ctx->verify_cb = store->verify_cb; + /* Seems to always be 0 in OpenSSL, else must be idempotent */ ctx->cleanup = store->cleanup; } else ctx->cleanup = 0; @@ -2307,7 +2323,7 @@ int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509, if (ret == 0) { X509err(X509_F_X509_STORE_CTX_INIT, ERR_R_MALLOC_FAILURE); - return 0; + goto err; } if (store && store->check_issued) @@ -2362,19 +2378,18 @@ int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509, ctx->check_policy = check_policy; + if (CRYPTO_new_ex_data(CRYPTO_EX_INDEX_X509_STORE_CTX, ctx, + &ctx->ex_data)) + return 1; + X509err(X509_F_X509_STORE_CTX_INIT, ERR_R_MALLOC_FAILURE); + + err: /* - * This memset() can't make any sense anyway, so it's removed. As - * X509_STORE_CTX_cleanup does a proper "free" on the ex_data, we put a - * corresponding "new" here and remove this bogus initialisation. + * On error clean up allocated storage, if the store context was not + * allocated with X509_STORE_CTX_new() this is our last chance to do so. */ - /* memset(&(ctx->ex_data),0,sizeof(CRYPTO_EX_DATA)); */ - if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_X509_STORE_CTX, ctx, - &(ctx->ex_data))) { - OPENSSL_free(ctx); - X509err(X509_F_X509_STORE_CTX_INIT, ERR_R_MALLOC_FAILURE); - return 0; - } - return 1; + X509_STORE_CTX_cleanup(ctx); + return 0; } /* @@ -2390,8 +2405,17 @@ void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk) void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx) { - if (ctx->cleanup) + /* + * We need to be idempotent because, unfortunately, free() also calls + * cleanup(), so the natural call sequence new(), init(), cleanup(), free() + * calls cleanup() for the same object twice! Thus we must zero the + * pointers below after they're freed! + */ + /* Seems to always be 0 in OpenSSL, do this at most once. */ + if (ctx->cleanup != NULL) { ctx->cleanup(ctx); + ctx->cleanup = NULL; + } if (ctx->param != NULL) { if (ctx->parent == NULL) X509_VERIFY_PARAM_free(ctx->param); diff --git a/deps/openssl/openssl/crypto/x509/x509_vfy.h b/deps/openssl/openssl/crypto/x509/x509_vfy.h index bd8613c62ba429..2663e1c0a362aa 100644 --- a/deps/openssl/openssl/crypto/x509/x509_vfy.h +++ b/deps/openssl/openssl/crypto/x509/x509_vfy.h @@ -313,7 +313,7 @@ void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth); X509_LOOKUP_ctrl((x),X509_L_ADD_DIR,(name),(long)(type),NULL) # define X509_V_OK 0 -/* illegal error (for uninitialized values, to avoid X509_V_OK): 1 */ +# define X509_V_ERR_UNSPECIFIED 1 # define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT 2 # define X509_V_ERR_UNABLE_TO_GET_CRL 3 diff --git a/deps/openssl/openssl/crypto/x509/x509_vpm.c b/deps/openssl/openssl/crypto/x509/x509_vpm.c index 1ea0c69f5743d1..1ac15a881a1059 100644 --- a/deps/openssl/openssl/crypto/x509/x509_vpm.c +++ b/deps/openssl/openssl/crypto/x509/x509_vpm.c @@ -94,11 +94,11 @@ static int int_x509_param_set_hosts(X509_VERIFY_PARAM_ID *id, int mode, * Refuse names with embedded NUL bytes, except perhaps as final byte. * XXX: Do we need to push an error onto the error stack? */ - if (namelen == 0) + if (namelen == 0 || name == NULL) namelen = name ? strlen(name) : 0; else if (name && memchr(name, '\0', namelen > 1 ? namelen - 1 : namelen)) return 0; - if (name && name[namelen - 1] == '\0') + if (namelen > 0 && name[namelen - 1] == '\0') --namelen; if (mode == SET_HOST && id->hosts) { @@ -155,6 +155,7 @@ static void x509_verify_param_zero(X509_VERIFY_PARAM *param) } if (paramid->peername) OPENSSL_free(paramid->peername); + paramid->peername = NULL; if (paramid->email) { OPENSSL_free(paramid->email); paramid->email = NULL; @@ -165,7 +166,6 @@ static void x509_verify_param_zero(X509_VERIFY_PARAM *param) paramid->ip = NULL; paramid->iplen = 0; } - } X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void) @@ -176,13 +176,20 @@ X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void) param = OPENSSL_malloc(sizeof *param); if (!param) return NULL; - paramid = OPENSSL_malloc(sizeof *paramid); + memset(param, 0, sizeof(*param)); + + paramid = OPENSSL_malloc(sizeof(*paramid)); if (!paramid) { OPENSSL_free(param); return NULL; } - memset(param, 0, sizeof *param); - memset(paramid, 0, sizeof *paramid); + memset(paramid, 0, sizeof(*paramid)); + /* Exotic platforms may have non-zero bit representation of NULL */ + paramid->hosts = NULL; + paramid->peername = NULL; + paramid->email = NULL; + paramid->ip = NULL; + param->id = paramid; x509_verify_param_zero(param); return param; diff --git a/deps/openssl/openssl/crypto/x509v3/v3_cpols.c b/deps/openssl/openssl/crypto/x509v3/v3_cpols.c index 0febc1b3edc1cf..d97f6226b9ee01 100644 --- a/deps/openssl/openssl/crypto/x509v3/v3_cpols.c +++ b/deps/openssl/openssl/crypto/x509v3/v3_cpols.c @@ -186,6 +186,10 @@ static STACK_OF(POLICYINFO) *r2i_certpol(X509V3_EXT_METHOD *method, goto err; } pol = POLICYINFO_new(); + if (pol == NULL) { + X509V3err(X509V3_F_R2I_CERTPOL, ERR_R_MALLOC_FAILURE); + goto err; + } pol->policyid = pobj; } if (!sk_POLICYINFO_push(pols, pol)) { diff --git a/deps/openssl/openssl/crypto/x509v3/v3_ncons.c b/deps/openssl/openssl/crypto/x509v3/v3_ncons.c index b97ed271e3e293..2855269668bee8 100644 --- a/deps/openssl/openssl/crypto/x509v3/v3_ncons.c +++ b/deps/openssl/openssl/crypto/x509v3/v3_ncons.c @@ -132,6 +132,8 @@ static void *v2i_NAME_CONSTRAINTS(const X509V3_EXT_METHOD *method, } tval.value = val->value; sub = GENERAL_SUBTREE_new(); + if (sub == NULL) + goto memerr; if (!v2i_GENERAL_NAME_ex(sub->base, method, ctx, &tval, 1)) goto err; if (!*ptree) diff --git a/deps/openssl/openssl/crypto/x509v3/v3_pci.c b/deps/openssl/openssl/crypto/x509v3/v3_pci.c index fe0d8063d1f108..34cad53cb5f0e0 100644 --- a/deps/openssl/openssl/crypto/x509v3/v3_pci.c +++ b/deps/openssl/openssl/crypto/x509v3/v3_pci.c @@ -1,9 +1,9 @@ -/* v3_pci.c -*- mode:C; c-file-style: "eay" -*- */ +/* v3_pci.c */ /* * Contributed to the OpenSSL Project 2004 by Richard Levitte * (richard@levitte.org) */ -/* Copyright (c) 2004 Kungliga Tekniska H�gskolan +/* Copyright (c) 2004 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * diff --git a/deps/openssl/openssl/crypto/x509v3/v3_pcia.c b/deps/openssl/openssl/crypto/x509v3/v3_pcia.c index 350b39889fcc3e..e53c82e8dc79ea 100644 --- a/deps/openssl/openssl/crypto/x509v3/v3_pcia.c +++ b/deps/openssl/openssl/crypto/x509v3/v3_pcia.c @@ -1,9 +1,9 @@ -/* v3_pcia.c -*- mode:C; c-file-style: "eay" -*- */ +/* v3_pcia.c */ /* * Contributed to the OpenSSL Project 2004 by Richard Levitte * (richard@levitte.org) */ -/* Copyright (c) 2004 Kungliga Tekniska H�gskolan +/* Copyright (c) 2004 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * diff --git a/deps/openssl/openssl/crypto/x509v3/v3_purp.c b/deps/openssl/openssl/crypto/x509v3/v3_purp.c index 36b0d87a0d8bb5..845be673b79998 100644 --- a/deps/openssl/openssl/crypto/x509v3/v3_purp.c +++ b/deps/openssl/openssl/crypto/x509v3/v3_purp.c @@ -380,6 +380,14 @@ static void setup_crldp(X509 *x) setup_dp(x, sk_DIST_POINT_value(x->crldp, i)); } +#define V1_ROOT (EXFLAG_V1|EXFLAG_SS) +#define ku_reject(x, usage) \ + (((x)->ex_flags & EXFLAG_KUSAGE) && !((x)->ex_kusage & (usage))) +#define xku_reject(x, usage) \ + (((x)->ex_flags & EXFLAG_XKUSAGE) && !((x)->ex_xkusage & (usage))) +#define ns_reject(x, usage) \ + (((x)->ex_flags & EXFLAG_NSCERT) && !((x)->ex_nscert & (usage))) + static void x509v3_cache_extensions(X509 *x) { BASIC_CONSTRAINTS *bs; @@ -499,7 +507,8 @@ static void x509v3_cache_extensions(X509 *x) if (!X509_NAME_cmp(X509_get_subject_name(x), X509_get_issuer_name(x))) { x->ex_flags |= EXFLAG_SI; /* If SKID matches AKID also indicate self signed */ - if (X509_check_akid(x, x->akid) == X509_V_OK) + if (X509_check_akid(x, x->akid) == X509_V_OK && + !ku_reject(x, KU_KEY_CERT_SIGN)) x->ex_flags |= EXFLAG_SS; } x->altname = X509_get_ext_d2i(x, NID_subject_alt_name, NULL, NULL); @@ -538,14 +547,6 @@ static void x509v3_cache_extensions(X509 *x) * 4 basicConstraints absent but keyUsage present and keyCertSign asserted. */ -#define V1_ROOT (EXFLAG_V1|EXFLAG_SS) -#define ku_reject(x, usage) \ - (((x)->ex_flags & EXFLAG_KUSAGE) && !((x)->ex_kusage & (usage))) -#define xku_reject(x, usage) \ - (((x)->ex_flags & EXFLAG_XKUSAGE) && !((x)->ex_xkusage & (usage))) -#define ns_reject(x, usage) \ - (((x)->ex_flags & EXFLAG_NSCERT) && !((x)->ex_nscert & (usage))) - static int check_ca(const X509 *x) { /* keyUsage if present should allow cert signing */ diff --git a/deps/openssl/openssl/crypto/x509v3/v3_scts.c b/deps/openssl/openssl/crypto/x509v3/v3_scts.c index 6e0b8d6844c8ce..0b7c68180e7883 100644 --- a/deps/openssl/openssl/crypto/x509v3/v3_scts.c +++ b/deps/openssl/openssl/crypto/x509v3/v3_scts.c @@ -190,8 +190,9 @@ static STACK_OF(SCT) *d2i_SCT_LIST(STACK_OF(SCT) **a, SCT *sct; unsigned char *p, *p2; unsigned short listlen, sctlen = 0, fieldlen; + const unsigned char *q = *pp; - if (d2i_ASN1_OCTET_STRING(&oct, pp, length) == NULL) + if (d2i_ASN1_OCTET_STRING(&oct, &q, length) == NULL) return NULL; if (oct->length < 2) goto done; @@ -279,6 +280,7 @@ static STACK_OF(SCT) *d2i_SCT_LIST(STACK_OF(SCT) **a, done: ASN1_OCTET_STRING_free(oct); + *pp = q; return sk; err: diff --git a/deps/openssl/openssl/crypto/x509v3/v3_utl.c b/deps/openssl/openssl/crypto/x509v3/v3_utl.c index bdd7b95f4570b4..43b9cb9c5861cd 100644 --- a/deps/openssl/openssl/crypto/x509v3/v3_utl.c +++ b/deps/openssl/openssl/crypto/x509v3/v3_utl.c @@ -841,7 +841,8 @@ static const unsigned char *valid_star(const unsigned char *p, size_t len, state = LABEL_START; ++dots; } else if (p[i] == '-') { - if ((state & LABEL_HYPHEN) != 0) + /* no domain/subdomain starts with '-' */ + if ((state & LABEL_START) != 0) return NULL; state |= LABEL_HYPHEN; } else @@ -926,7 +927,7 @@ static int do_x509_check(X509 *x, const char *chk, size_t chklen, GENERAL_NAMES *gens = NULL; X509_NAME *name = NULL; int i; - int cnid; + int cnid = NID_undef; int alt_type; int san_present = 0; int rv = 0; @@ -949,7 +950,6 @@ static int do_x509_check(X509 *x, const char *chk, size_t chklen, else equal = equal_wildcard; } else { - cnid = 0; alt_type = V_ASN1_OCTET_STRING; equal = equal_case; } @@ -980,11 +980,16 @@ static int do_x509_check(X509 *x, const char *chk, size_t chklen, GENERAL_NAMES_free(gens); if (rv != 0) return rv; - if (!cnid + if (cnid == NID_undef || (san_present && !(flags & X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT))) return 0; } + + /* We're done if CN-ID is not pertinent */ + if (cnid == NID_undef) + return 0; + i = -1; name = X509_get_subject_name(x); while ((i = X509_NAME_get_index_by_NID(name, cnid, i)) >= 0) { diff --git a/deps/openssl/openssl/crypto/x509v3/v3nametest.c b/deps/openssl/openssl/crypto/x509v3/v3nametest.c index 7b5c1c8e51270f..ac5c9ff432d961 100644 --- a/deps/openssl/openssl/crypto/x509v3/v3nametest.c +++ b/deps/openssl/openssl/crypto/x509v3/v3nametest.c @@ -6,12 +6,16 @@ static const char *const names[] = { "a", "b", ".", "*", "@", ".a", "a.", ".b", "b.", ".*", "*.", "*@", "@*", "a@", "@a", "b@", "..", + "-example.com", "example-.com", "@@", "**", "*.com", "*com", "*.*.com", "*com", "com*", "*example.com", "*@example.com", "test@*.example.com", "example.com", "www.example.com", "test.www.example.com", "*.example.com", "*.www.example.com", "test.*.example.com", "www.*.com", ".www.example.com", "*www.example.com", "example.net", "xn--rger-koa.example.com", + "*.xn--rger-koa.example.com", "www.xn--rger-koa.example.com", + "*.good--example.com", "www.good--example.com", + "*.xn--bar.com", "xn--foo.xn--bar.com", "a.example.com", "b.example.com", "postmaster@example.com", "Postmaster@example.com", "postmaster@EXAMPLE.COM", @@ -27,6 +31,9 @@ static const char *const exceptions[] = { "set CN: host: [*.www.example.com] matches [.www.example.com]", "set CN: host: [*www.example.com] matches [www.example.com]", "set CN: host: [test.www.example.com] matches [.www.example.com]", + "set CN: host: [*.xn--rger-koa.example.com] matches [www.xn--rger-koa.example.com]", + "set CN: host: [*.xn--bar.com] matches [xn--foo.xn--bar.com]", + "set CN: host: [*.good--example.com] matches [www.good--example.com]", "set CN: host-no-wildcards: [*.www.example.com] matches [.www.example.com]", "set CN: host-no-wildcards: [test.www.example.com] matches [.www.example.com]", "set emailAddress: email: [postmaster@example.com] does not match [Postmaster@example.com]", @@ -43,6 +50,9 @@ static const char *const exceptions[] = { "set dnsName: host: [*.www.example.com] matches [.www.example.com]", "set dnsName: host: [*www.example.com] matches [www.example.com]", "set dnsName: host: [test.www.example.com] matches [.www.example.com]", + "set dnsName: host: [*.xn--rger-koa.example.com] matches [www.xn--rger-koa.example.com]", + "set dnsName: host: [*.xn--bar.com] matches [xn--foo.xn--bar.com]", + "set dnsName: host: [*.good--example.com] matches [www.good--example.com]", "set rfc822Name: email: [postmaster@example.com] does not match [Postmaster@example.com]", "set rfc822Name: email: [Postmaster@example.com] does not match [postmaster@example.com]", "set rfc822Name: email: [Postmaster@example.com] does not match [postmaster@EXAMPLE.COM]", diff --git a/deps/openssl/openssl/demos/easy_tls/README b/deps/openssl/openssl/demos/easy_tls/README index 816a58009c86df..ee89dfb9423307 100644 --- a/deps/openssl/openssl/demos/easy_tls/README +++ b/deps/openssl/openssl/demos/easy_tls/README @@ -62,4 +62,4 @@ As noted above, easy_tls.c will be changed to become a library one day, which means that future revisions will not be fully compatible to the current version. -Bodo M�ller +Bodo Möller diff --git a/deps/openssl/openssl/demos/easy_tls/easy-tls.c b/deps/openssl/openssl/demos/easy_tls/easy-tls.c index 5682e91a479302..ebcadafa7ba3f1 100644 --- a/deps/openssl/openssl/demos/easy_tls/easy-tls.c +++ b/deps/openssl/openssl/demos/easy_tls/easy-tls.c @@ -1,4 +1,4 @@ -/* -*- Mode: C; c-file-style: "bsd" -*- */ +/* */ /*- * easy-tls.c -- generic TLS proxy. * $Id: easy-tls.c,v 1.4 2002/03/05 09:07:16 bodo Exp $ diff --git a/deps/openssl/openssl/demos/easy_tls/easy-tls.h b/deps/openssl/openssl/demos/easy_tls/easy-tls.h index 1c587b861c5cd2..b88d21c57bd230 100644 --- a/deps/openssl/openssl/demos/easy_tls/easy-tls.h +++ b/deps/openssl/openssl/demos/easy_tls/easy-tls.h @@ -1,4 +1,4 @@ -/* -*- Mode: C; c-file-style: "bsd" -*- */ +/* */ /*- * easy-tls.h -- generic TLS proxy. * $Id: easy-tls.h,v 1.1 2001/09/17 19:06:59 bodo Exp $ diff --git a/deps/openssl/openssl/demos/engines/zencod/hw_zencod.c b/deps/openssl/openssl/demos/engines/zencod/hw_zencod.c index 0c0f524d4c060d..daf0aef1efe236 100644 --- a/deps/openssl/openssl/demos/engines/zencod/hw_zencod.c +++ b/deps/openssl/openssl/demos/engines/zencod/hw_zencod.c @@ -610,7 +610,7 @@ static int zencod_init(ENGINE *e) ptr_zencod_rc4_cipher = ptr_rc4_1; /* - * We should peform a test to see if there is actually any unit runnig on + * We should perform a test to see if there is actually any unit runnig on * the system ... Even if the cryptozen library is loaded the module coul * not be loaded on the system ... For now we may just open and close the * device !! diff --git a/deps/openssl/openssl/demos/tunala/tunala.c b/deps/openssl/openssl/demos/tunala/tunala.c index 11a7c5bb1497c5..3ceea02fad08d9 100644 --- a/deps/openssl/openssl/demos/tunala/tunala.c +++ b/deps/openssl/openssl/demos/tunala/tunala.c @@ -1154,7 +1154,7 @@ static int tunala_item_io(tunala_selector_t * selector, tunala_item_t * item) /* * This function name is attributed to the term donated by David Schwartz * on openssl-dev, message-ID: - * . :-) + * . :-) */ if (!state_machine_churn(&item->sm)) /* diff --git a/deps/openssl/openssl/doc/HOWTO/keys.txt b/deps/openssl/openssl/doc/HOWTO/keys.txt index 7ae2a3a11833a3..ba0314fafce046 100644 --- a/deps/openssl/openssl/doc/HOWTO/keys.txt +++ b/deps/openssl/openssl/doc/HOWTO/keys.txt @@ -40,9 +40,8 @@ consider insecure or to be insecure pretty soon. 3. To generate a DSA key -A DSA key can be used for signing only. This is important to keep -in mind to know what kind of purposes a certificate request with a -DSA key can really be used for. +A DSA key can be used for signing only. It is important to +know what a certificate request with a DSA key can really be used for. Generating a key for the DSA algorithm is a two-step process. First, you have to generate parameters from which to generate the key: diff --git a/deps/openssl/openssl/doc/README b/deps/openssl/openssl/doc/README index 6ecc14d9945773..cc760402ae9b5e 100644 --- a/deps/openssl/openssl/doc/README +++ b/deps/openssl/openssl/doc/README @@ -1,12 +1,21 @@ - apps/openssl.pod .... Documentation of OpenSSL `openssl' command - crypto/crypto.pod ... Documentation of OpenSSL crypto.h+libcrypto.a - ssl/ssl.pod ......... Documentation of OpenSSL ssl.h+libssl.a - openssl.txt ......... Assembled documentation files for OpenSSL [not final] - ssleay.txt .......... Assembled documentation of ancestor SSLeay [obsolete] - standards.txt ....... Assembled pointers to standards, RFCs or internet drafts - that are related to OpenSSL. +README This file - An archive of HTML documents for the SSLeay library is available from - http://www.columbia.edu/~ariel/ssleay/ +fingerprints.txt + PGP fingerprints of authoried release signers +standards.txt + Pointers to standards, RFC's and IETF Drafts that are + related to OpenSSL. Incomplete. + +HOWTO/ + A few how-to documents; not necessarily up-to-date +apps/ + The openssl command-line tools; start with openssl.pod +ssl/ + The SSL library; start with ssl.pod +crypto/ + The cryptographic library; start with crypto.pod + +Formatted versions of the manpages (apps,ssl,crypto) can be found at + https://www.openssl.org/docs/manpages.html diff --git a/deps/openssl/openssl/doc/apps/ciphers.pod b/deps/openssl/openssl/doc/apps/ciphers.pod index 1c26e3b3da36ab..9643b4d48ca8c1 100644 --- a/deps/openssl/openssl/doc/apps/ciphers.pod +++ b/deps/openssl/openssl/doc/apps/ciphers.pod @@ -38,25 +38,21 @@ SSL v2 and for SSL v3/TLS v1. Like B<-v>, but include cipher suite codes in output (hex format). -=item B<-ssl3> +=item B<-ssl3>, B<-tls1> -only include SSL v3 ciphers. +This lists ciphers compatible with any of SSLv3, TLSv1, TLSv1.1 or TLSv1.2. =item B<-ssl2> -only include SSL v2 ciphers. - -=item B<-tls1> - -only include TLS v1 ciphers. +Only include SSLv2 ciphers. =item B<-h>, B<-?> -print a brief usage message. +Print a brief usage message. =item B -a cipher list to convert to a cipher preference list. If it is not included +A cipher list to convert to a cipher preference list. If it is not included then the default cipher list will be used. The format is described below. =back @@ -109,9 +105,10 @@ The following is a list of all permitted cipher strings and their meanings. =item B -the default cipher list. This is determined at compile time and -is normally B. This must be the firstcipher string -specified. +The default cipher list. +This is determined at compile time and is normally +B. +When used, this must be the first cipherstring specified. =item B @@ -139,34 +136,46 @@ than 128 bits, and some cipher suites with 128-bit keys. =item B -"low" encryption cipher suites, currently those using 64 or 56 bit encryption algorithms -but excluding export cipher suites. +Low strength encryption cipher suites, currently those using 64 or 56 bit +encryption algorithms but excluding export cipher suites. +As of OpenSSL 1.0.2g, these are disabled in default builds. =item B, B -export encryption algorithms. Including 40 and 56 bits algorithms. +Export strength encryption algorithms. Including 40 and 56 bits algorithms. +As of OpenSSL 1.0.2g, these are disabled in default builds. =item B -40 bit export encryption algorithms +40-bit export encryption algorithms +As of OpenSSL 1.0.2g, these are disabled in default builds. =item B -56 bit export encryption algorithms. In OpenSSL 0.9.8c and later the set of +56-bit export encryption algorithms. In OpenSSL 0.9.8c and later the set of 56 bit export ciphers is empty unless OpenSSL has been explicitly configured with support for experimental ciphers. +As of OpenSSL 1.0.2g, these are disabled in default builds. =item B, B -the "NULL" ciphers that is those offering no encryption. Because these offer no -encryption at all and are a security risk they are disabled unless explicitly -included. +The "NULL" ciphers that is those offering no encryption. Because these offer no +encryption at all and are a security risk they are not enabled via either the +B or B cipher strings. +Be careful when building cipherlists out of lower-level primitives such as +B or B as these do overlap with the B ciphers. +When in doubt, include B in your cipherlist. =item B -the cipher suites offering no authentication. This is currently the anonymous +The cipher suites offering no authentication. This is currently the anonymous DH algorithms and anonymous ECDH algorithms. These cipher suites are vulnerable to a "man in the middle" attack and so their use is normally discouraged. +These are excluded from the B ciphers, but included in the B +ciphers. +Be careful when building cipherlists out of lower-level primitives such as +B or B as these do overlap with the B ciphers. +When in doubt, include B in your cipherlist. =item B, B @@ -582,11 +591,11 @@ Note: these ciphers can also be used in SSL v3. =head2 Deprecated SSL v2.0 cipher suites. SSL_CK_RC4_128_WITH_MD5 RC4-MD5 - SSL_CK_RC4_128_EXPORT40_WITH_MD5 EXP-RC4-MD5 - SSL_CK_RC2_128_CBC_WITH_MD5 RC2-MD5 - SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5 EXP-RC2-MD5 + SSL_CK_RC4_128_EXPORT40_WITH_MD5 Not implemented. + SSL_CK_RC2_128_CBC_WITH_MD5 RC2-CBC-MD5 + SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5 Not implemented. SSL_CK_IDEA_128_CBC_WITH_MD5 IDEA-CBC-MD5 - SSL_CK_DES_64_CBC_WITH_MD5 DES-CBC-MD5 + SSL_CK_DES_64_CBC_WITH_MD5 Not implemented. SSL_CK_DES_192_EDE3_CBC_WITH_MD5 DES-CBC3-MD5 =head1 NOTES diff --git a/deps/openssl/openssl/doc/apps/dgst.pod b/deps/openssl/openssl/doc/apps/dgst.pod index 9e15798d8279d1..b27bb946b1b2e3 100644 --- a/deps/openssl/openssl/doc/apps/dgst.pod +++ b/deps/openssl/openssl/doc/apps/dgst.pod @@ -13,7 +13,6 @@ B B [B<-hex>] [B<-binary>] [B<-r>] -[B<-hmac arg>] [B<-non-fips-allow>] [B<-out filename>] [B<-sign filename>] @@ -64,10 +63,6 @@ output the digest or signature in binary form. output the digest in the "coreutils" format used by programs like B. -=item B<-hmac arg> - -set the HMAC key to "arg". - =item B<-non-fips-allow> Allow use of non FIPS digest when in FIPS mode. This has no effect when not in diff --git a/deps/openssl/openssl/doc/apps/genrsa.pod b/deps/openssl/openssl/doc/apps/genrsa.pod index cb03d09b95eb64..3dc9870f34b96a 100644 --- a/deps/openssl/openssl/doc/apps/genrsa.pod +++ b/deps/openssl/openssl/doc/apps/genrsa.pod @@ -10,12 +10,6 @@ B B [B<-out filename>] [B<-passout arg>] [B<-aes128>] -[B<-aes128>] -[B<-aes192>] -[B<-aes256>] -[B<-camellia128>] -[B<-camellia192>] -[B<-camellia256>] [B<-aes192>] [B<-aes256>] [B<-camellia128>] diff --git a/deps/openssl/openssl/doc/apps/pkcs12.pod b/deps/openssl/openssl/doc/apps/pkcs12.pod index 8e0d91798ac437..744984838dc7c2 100644 --- a/deps/openssl/openssl/doc/apps/pkcs12.pod +++ b/deps/openssl/openssl/doc/apps/pkcs12.pod @@ -216,7 +216,7 @@ key is encrypted using triple DES and the certificate using 40 bit RC2. these options allow the algorithm used to encrypt the private key and certificates to be selected. Any PKCS#5 v1.5 or PKCS#12 PBE algorithm name -can be used (see B section for more information). If a a cipher name +can be used (see B section for more information). If a cipher name (as output by the B command is specified then it is used with PKCS#5 v2.0. For interoperability reasons it is advisable to only use PKCS#12 algorithms. diff --git a/deps/openssl/openssl/doc/apps/pkeyutl.pod b/deps/openssl/openssl/doc/apps/pkeyutl.pod index 27be9a90079f6a..5da347c97d327c 100644 --- a/deps/openssl/openssl/doc/apps/pkeyutl.pod +++ b/deps/openssl/openssl/doc/apps/pkeyutl.pod @@ -137,6 +137,19 @@ Unless otherwise mentioned all algorithms support the B option which specifies the digest in use for sign, verify and verifyrecover operations. The value B should represent a digest name as used in the EVP_get_digestbyname() function for example B. +This value is used only for sanity-checking the lengths of data passed in to +the B and for creating the structures that make up the signature +(e.g. B in RSASSA PKCS#1 v1.5 signatures). +In case of RSA, ECDSA and DSA signatures, this utility +will not perform hashing on input data but rather use the data directly as +input of signature algorithm. Depending on key type, signature type and mode +of padding, the maximum acceptable lengths of input data differ. In general, +with RSA the signed data can't be longer than the key modulus, in case of ECDSA +and DSA the data shouldn't be longer than field size, otherwise it will be +silently truncated to field size. + +In other words, if the value of digest is B the input should be 20 bytes +long binary encoding of SHA-1 hash function output. =head1 RSA ALGORITHM diff --git a/deps/openssl/openssl/doc/apps/req.pod b/deps/openssl/openssl/doc/apps/req.pod index df68cb0921fda3..30653e50935777 100644 --- a/deps/openssl/openssl/doc/apps/req.pod +++ b/deps/openssl/openssl/doc/apps/req.pod @@ -30,7 +30,6 @@ B B [B<-keygen_engine id>] [B<-[digest]>] [B<-config filename>] -[B<-subj arg>] [B<-multivalue-rdn>] [B<-x509>] [B<-days n>] @@ -348,9 +347,12 @@ configuration file values. =item B -This specifies the default key size in bits. If not specified then -512 is used. It is used if the B<-new> option is used. It can be -overridden by using the B<-newkey> option. +Specifies the default key size in bits. + +This option is used in conjunction with the B<-new> option to generate +a new key. It can be overridden by specifying an explicit key size in +the B<-newkey> option. The smallest accepted key size is 512 bits. If +no key size is specified then 2048 bits is used. =item B @@ -490,7 +492,7 @@ be input by calling it "1.organizationName". The actual permitted field names are any object identifier short or long names. These are compiled into OpenSSL and include the usual values such as commonName, countryName, localityName, organizationName, -organizationUnitName, stateOrProvinceName. Additionally emailAddress +organizationalUnitName, stateOrProvinceName. Additionally emailAddress is include as well as name, surname, givenName initials and dnQualifier. Additional object identifiers can be defined with the B or @@ -506,16 +508,16 @@ Examine and verify certificate request: Create a private key and then generate a certificate request from it: - openssl genrsa -out key.pem 1024 + openssl genrsa -out key.pem 2048 openssl req -new -key key.pem -out req.pem The same but just using req: - openssl req -newkey rsa:1024 -keyout key.pem -out req.pem + openssl req -newkey rsa:2048 -keyout key.pem -out req.pem Generate a self signed root certificate: - openssl req -x509 -newkey rsa:1024 -keyout key.pem -out req.pem + openssl req -x509 -newkey rsa:2048 -keyout key.pem -out req.pem Example of a file pointed to by the B option: @@ -531,7 +533,7 @@ expansion: Sample configuration file prompting for field values: [ req ] - default_bits = 1024 + default_bits = 2048 default_keyfile = privkey.pem distinguished_name = req_distinguished_name attributes = req_attributes @@ -572,7 +574,7 @@ Sample configuration containing all field values: RANDFILE = $ENV::HOME/.rnd [ req ] - default_bits = 1024 + default_bits = 2048 default_keyfile = keyfile.pem distinguished_name = req_distinguished_name attributes = req_attributes diff --git a/deps/openssl/openssl/doc/apps/s_client.pod b/deps/openssl/openssl/doc/apps/s_client.pod index 84d0527069418d..618df9659d3bc6 100644 --- a/deps/openssl/openssl/doc/apps/s_client.pod +++ b/deps/openssl/openssl/doc/apps/s_client.pod @@ -201,15 +201,11 @@ Use the PSK key B when using a PSK cipher suite. The key is given as a hexadecimal number without leading 0x, for example -psk 1a2b3c4d. -=item B<-ssl2>, B<-ssl3>, B<-tls1>, B<-no_ssl2>, B<-no_ssl3>, B<-no_tls1>, B<-no_tls1_1>, B<-no_tls1_2> +=item B<-ssl2>, B<-ssl3>, B<-tls1>, B<-tls1_1>, B<-tls1_2>, B<-no_ssl2>, B<-no_ssl3>, B<-no_tls1>, B<-no_tls1_1>, B<-no_tls1_2> -these options disable the use of certain SSL or TLS protocols. By default -the initial handshake uses a method which should be compatible with all -servers and permit them to use SSL v3, SSL v2 or TLS as appropriate. - -Unfortunately there are still ancient and broken servers in use which -cannot handle this technique and will fail to connect. Some servers only -work if TLS is turned off. +These options require or disable the use of the specified SSL or TLS protocols. +By default the initial handshake uses a I method which will +negotiate the highest mutually supported protocol version. =item B<-fallback_scsv> diff --git a/deps/openssl/openssl/doc/apps/s_server.pod b/deps/openssl/openssl/doc/apps/s_server.pod index baca7792446f2e..6f4acb7006ffdc 100644 --- a/deps/openssl/openssl/doc/apps/s_server.pod +++ b/deps/openssl/openssl/doc/apps/s_server.pod @@ -217,11 +217,11 @@ Use the PSK key B when using a PSK cipher suite. The key is given as a hexadecimal number without leading 0x, for example -psk 1a2b3c4d. -=item B<-ssl2>, B<-ssl3>, B<-tls1>, B<-no_ssl2>, B<-no_ssl3>, B<-no_tls1> +=item B<-ssl2>, B<-ssl3>, B<-tls1>, B<-tls1_1>, B<-tls1_2>, B<-no_ssl2>, B<-no_ssl3>, B<-no_tls1>, B<-no_tls1_1>, B<-no_tls1_2> -these options disable the use of certain SSL or TLS protocols. By default -the initial handshake uses a method which should be compatible with all -servers and permit them to use SSL v3, SSL v2 or TLS as appropriate. +These options require or disable the use of the specified SSL or TLS protocols. +By default the initial handshake uses a I method which will +negotiate the highest mutually supported protocol version. =item B<-bugs> diff --git a/deps/openssl/openssl/doc/apps/s_time.pod b/deps/openssl/openssl/doc/apps/s_time.pod index 5a38aa2e03944f..9082d876feeb0e 100644 --- a/deps/openssl/openssl/doc/apps/s_time.pod +++ b/deps/openssl/openssl/doc/apps/s_time.pod @@ -26,7 +26,7 @@ B B =head1 DESCRIPTION -The B command implements a generic SSL/TLS client which connects to a +The B command implements a generic SSL/TLS client which connects to a remote host using SSL/TLS. It can request a page from the server and includes the time to transfer the payload data in its timing measurements. It measures the number of connections within a given timeframe, the amount of data @@ -127,7 +127,7 @@ and the link speed determine how many connections B can establish. =head1 NOTES -B can be used to measure the performance of an SSL connection. +B can be used to measure the performance of an SSL connection. To connect to an SSL HTTP server and get the default page the command openssl s_time -connect servername:443 -www / -CApath yourdir -CAfile yourfile.pem -cipher commoncipher [-ssl3] diff --git a/deps/openssl/openssl/doc/apps/x509.pod b/deps/openssl/openssl/doc/apps/x509.pod index a1326edeefb6f3..26f71c88329500 100644 --- a/deps/openssl/openssl/doc/apps/x509.pod +++ b/deps/openssl/openssl/doc/apps/x509.pod @@ -539,7 +539,8 @@ very rare and their use is discouraged). The options ending in "space" additionally place a space after the separator to make it more readable. The B uses a linefeed character for the RDN separator and a spaced B<+> for the AVA separator. It also -indents the fields by four characters. +indents the fields by four characters. If no field separator is specified +then B is used by default. =item B diff --git a/deps/openssl/openssl/doc/crypto/BIO_read.pod b/deps/openssl/openssl/doc/crypto/BIO_read.pod index b34528104ddf24..2c177f0b6d86d5 100644 --- a/deps/openssl/openssl/doc/crypto/BIO_read.pod +++ b/deps/openssl/openssl/doc/crypto/BIO_read.pod @@ -9,9 +9,9 @@ BIO_read, BIO_write, BIO_gets, BIO_puts - BIO I/O functions #include int BIO_read(BIO *b, void *buf, int len); - int BIO_gets(BIO *b,char *buf, int size); + int BIO_gets(BIO *b, char *buf, int size); int BIO_write(BIO *b, const void *buf, int len); - int BIO_puts(BIO *b,const char *buf); + int BIO_puts(BIO *b, const char *buf); =head1 DESCRIPTION @@ -26,7 +26,7 @@ return the digest and other BIOs may not support BIO_gets() at all. BIO_write() attempts to write B bytes from B to BIO B. -BIO_puts() attempts to write a null terminated string B to BIO B +BIO_puts() attempts to write a null terminated string B to BIO B. =head1 RETURN VALUES diff --git a/deps/openssl/openssl/doc/crypto/BIO_s_connect.pod b/deps/openssl/openssl/doc/crypto/BIO_s_connect.pod index 18ece4c91f66fe..345a468a5d74c6 100644 --- a/deps/openssl/openssl/doc/crypto/BIO_s_connect.pod +++ b/deps/openssl/openssl/doc/crypto/BIO_s_connect.pod @@ -21,8 +21,8 @@ BIO_set_nbio, BIO_do_connect - connect BIO long BIO_set_conn_int_port(BIO *b, char *port); char *BIO_get_conn_hostname(BIO *b); char *BIO_get_conn_port(BIO *b); - char *BIO_get_conn_ip(BIO *b, dummy); - long BIO_get_conn_int_port(BIO *b, int port); + char *BIO_get_conn_ip(BIO *b); + long BIO_get_conn_int_port(BIO *b); long BIO_set_nbio(BIO *b, long n); diff --git a/deps/openssl/openssl/doc/crypto/BIO_s_mem.pod b/deps/openssl/openssl/doc/crypto/BIO_s_mem.pod index 8f85e0dceeb7f2..9f239648d7525b 100644 --- a/deps/openssl/openssl/doc/crypto/BIO_s_mem.pod +++ b/deps/openssl/openssl/doc/crypto/BIO_s_mem.pod @@ -16,7 +16,7 @@ BIO_get_mem_ptr, BIO_new_mem_buf - memory BIO BIO_set_mem_buf(BIO *b,BUF_MEM *bm,int c) BIO_get_mem_ptr(BIO *b,BUF_MEM **pp) - BIO *BIO_new_mem_buf(void *buf, int len); + BIO *BIO_new_mem_buf(const void *buf, int len); =head1 DESCRIPTION @@ -61,7 +61,7 @@ BIO_get_mem_ptr() places the underlying BUF_MEM structure in B. It is a macro. BIO_new_mem_buf() creates a memory BIO using B bytes of data at B, -if B is -1 then the B is assumed to be null terminated and its +if B is -1 then the B is assumed to be nul terminated and its length is determined by B. The BIO is set to a read only state and as a result cannot be written to. This is useful when some data needs to be made available from a static area of memory in the form of a BIO. The diff --git a/deps/openssl/openssl/doc/crypto/BN_rand.pod b/deps/openssl/openssl/doc/crypto/BN_rand.pod index bd6bc8632394ed..e8cbf658b47d81 100644 --- a/deps/openssl/openssl/doc/crypto/BN_rand.pod +++ b/deps/openssl/openssl/doc/crypto/BN_rand.pod @@ -19,7 +19,7 @@ BN_rand, BN_pseudo_rand, BN_rand_range, BN_pseudo_rand_range - generate pseudo-r =head1 DESCRIPTION BN_rand() generates a cryptographically strong pseudo-random number of -B bits in length and stores it in B. If B is -1, the +B in length and stores it in B. If B is -1, the most significant bit of the random number can be zero. If B is 0, it is set to 1, and if B is 1, the two most significant bits of the number will be set to 1, so that the product of two such random @@ -33,7 +33,7 @@ non-cryptographic purposes and for certain purposes in cryptographic protocols, but usually not for key generation etc. BN_rand_range() generates a cryptographically strong pseudo-random -number B in the range 0 = B E B. +number B in the range 0 E= B E B. BN_pseudo_rand_range() does the same, but is based on BN_pseudo_rand(), and hence numbers generated by it are not necessarily unpredictable. diff --git a/deps/openssl/openssl/doc/crypto/DSA_generate_parameters.pod b/deps/openssl/openssl/doc/crypto/DSA_generate_parameters.pod index 16a67f22b0c423..b1a4d201b75cd1 100644 --- a/deps/openssl/openssl/doc/crypto/DSA_generate_parameters.pod +++ b/deps/openssl/openssl/doc/crypto/DSA_generate_parameters.pod @@ -29,7 +29,7 @@ maximum of 1024 bits. If B is B or B E 20, the primes will be generated at random. Otherwise, the seed is used to generate them. If the given seed does not yield a prime q, a new random -seed is chosen and placed at B. +seed is chosen. DSA_generate_parameters_ex() places the iteration count in *B and a counter used for finding a generator in diff --git a/deps/openssl/openssl/doc/crypto/EC_GROUP_copy.pod b/deps/openssl/openssl/doc/crypto/EC_GROUP_copy.pod index 954af469d5aa8c..49dc01ced14788 100644 --- a/deps/openssl/openssl/doc/crypto/EC_GROUP_copy.pod +++ b/deps/openssl/openssl/doc/crypto/EC_GROUP_copy.pod @@ -158,7 +158,7 @@ EC_GROUP_get0_seed returns a pointer to the seed that was used to generate the p specified. EC_GROUP_get_seed_len returns the length of the seed or 0 if the seed is not specified. EC_GROUP_set_seed returns the length of the seed that has been set. If the supplied seed is NULL, or the supplied seed length is -0, the the return value will be 1. On error 0 is returned. +0, the return value will be 1. On error 0 is returned. EC_GROUP_cmp returns 0 if the curves are equal, 1 if they are not equal, or -1 on error. diff --git a/deps/openssl/openssl/doc/crypto/EC_KEY_new.pod b/deps/openssl/openssl/doc/crypto/EC_KEY_new.pod index e859689bcb5079..0fa2de1721b727 100644 --- a/deps/openssl/openssl/doc/crypto/EC_KEY_new.pod +++ b/deps/openssl/openssl/doc/crypto/EC_KEY_new.pod @@ -70,8 +70,8 @@ The functions EC_KEY_get0_group, EC_KEY_set_group, EC_KEY_get0_private_key, EC_K The functions EC_KEY_get_conv_form and EC_KEY_set_conv_form get and set the point_conversion_form for the B. For a description of point_conversion_forms please refer to L. -EC_KEY_insert_key_method_data and EC_KEY_get_key_method_data enable the caller to associate arbitary additional data specific to the -elliptic curve scheme being used with the EC_KEY object. This data is treated as a "black box" by the ec library. The data to be stored by EC_KEY_insert_key_method_data is provided in the B parameter, which must have have associated functions for duplicating, freeing and "clear_freeing" the data item. If a subsequent EC_KEY_get_key_method_data call is issued, the functions for duplicating, freeing and "clear_freeing" the data item must be provided again, and they must be the same as they were when the data item was inserted. +EC_KEY_insert_key_method_data and EC_KEY_get_key_method_data enable the caller to associate arbitrary additional data specific to the +elliptic curve scheme being used with the EC_KEY object. This data is treated as a "black box" by the ec library. The data to be stored by EC_KEY_insert_key_method_data is provided in the B parameter, which must have associated functions for duplicating, freeing and "clear_freeing" the data item. If a subsequent EC_KEY_get_key_method_data call is issued, the functions for duplicating, freeing and "clear_freeing" the data item must be provided again, and they must be the same as they were when the data item was inserted. EC_KEY_set_flags sets the flags in the B parameter on the EC_KEY object. Any flags that are already set are left set. The currently defined standard flags are EC_FLAG_NON_FIPS_ALLOW and EC_FLAG_FIPS_CHECKED. In addition there is the flag EC_FLAG_COFACTOR_ECDH which is specific to ECDH and is defined in ecdh.h. EC_KEY_get_flags returns the current flags that are set for this EC_KEY. EC_KEY_clear_flags clears the flags indicated by the B parameter. All other flags are left in their existing state. diff --git a/deps/openssl/openssl/doc/crypto/EVP_DigestVerifyInit.pod b/deps/openssl/openssl/doc/crypto/EVP_DigestVerifyInit.pod index e0217e40cba8d2..0ead2d2f8aa185 100644 --- a/deps/openssl/openssl/doc/crypto/EVP_DigestVerifyInit.pod +++ b/deps/openssl/openssl/doc/crypto/EVP_DigestVerifyInit.pod @@ -37,10 +37,11 @@ EVP_DigestVerifyInit() and EVP_DigestVerifyUpdate() return 1 for success and 0 or a negative value for failure. In particular a return value of -2 indicates the operation is not supported by the public key algorithm. -Unlike other functions the return value 0 from EVP_DigestVerifyFinal() only -indicates that the signature did not verify successfully (that is tbs did -not match the original data or the signature was of invalid form) it is not an -indication of a more serious error. +EVP_DigestVerifyFinal() returns 1 for success; any other value indicates +failure. A return value of zero indicates that the signature did not verify +successfully (that is, tbs did not match the original data or the signature had +an invalid form), while other values indicate a more serious error (and +sometimes also indicate an invalid signature form). The error codes can be obtained from L. diff --git a/deps/openssl/openssl/doc/crypto/EVP_EncryptInit.pod b/deps/openssl/openssl/doc/crypto/EVP_EncryptInit.pod index fb6036f959ba0c..c69e6a6d700e4e 100644 --- a/deps/openssl/openssl/doc/crypto/EVP_EncryptInit.pod +++ b/deps/openssl/openssl/doc/crypto/EVP_EncryptInit.pod @@ -111,7 +111,7 @@ EVP_CIPHER_CTX_init() initializes cipher contex B. EVP_EncryptInit_ex() sets up cipher context B for encryption with cipher B from ENGINE B. B must be initialized before calling this function. B is normally supplied -by a function such as EVP_des_cbc(). If B is NULL then the +by a function such as EVP_aes_256_cbc(). If B is NULL then the default implementation is used. B is the symmetric key to use and B is the IV to use (if necessary), the actual number of bytes used for the key and IV depends on the cipher. It is possible to set diff --git a/deps/openssl/openssl/doc/crypto/EVP_SealInit.pod b/deps/openssl/openssl/doc/crypto/EVP_SealInit.pod index 7d793e19ef7a13..19112a542d8925 100644 --- a/deps/openssl/openssl/doc/crypto/EVP_SealInit.pod +++ b/deps/openssl/openssl/doc/crypto/EVP_SealInit.pod @@ -25,7 +25,7 @@ encrypted using this key. EVP_SealInit() initializes a cipher context B for encryption with cipher B using a random secret key and IV. B is normally -supplied by a function such as EVP_des_cbc(). The secret key is encrypted +supplied by a function such as EVP_aes_256_cbc(). The secret key is encrypted using one or more public keys, this allows the same encrypted data to be decrypted using any of the corresponding private keys. B is an array of buffers where the public key encrypted secret key will be written, each buffer diff --git a/deps/openssl/openssl/doc/crypto/EVP_SignInit.pod b/deps/openssl/openssl/doc/crypto/EVP_SignInit.pod index 14ecc775af6a7e..c63d6b339318cb 100644 --- a/deps/openssl/openssl/doc/crypto/EVP_SignInit.pod +++ b/deps/openssl/openssl/doc/crypto/EVP_SignInit.pod @@ -2,7 +2,8 @@ =head1 NAME -EVP_SignInit, EVP_SignUpdate, EVP_SignFinal - EVP signing functions +EVP_SignInit, EVP_SignInit_ex, EVP_SignUpdate, EVP_SignFinal - EVP signing +functions =head1 SYNOPSIS diff --git a/deps/openssl/openssl/doc/crypto/X509_check_host.pod b/deps/openssl/openssl/doc/crypto/X509_check_host.pod index 0def17aac1c54a..521b9f535c7b2e 100644 --- a/deps/openssl/openssl/doc/crypto/X509_check_host.pod +++ b/deps/openssl/openssl/doc/crypto/X509_check_host.pod @@ -135,6 +135,6 @@ L =head1 HISTORY -These functions were added in OpenSSL 1.1.0. +These functions were added in OpenSSL 1.0.2. =cut diff --git a/deps/openssl/openssl/doc/crypto/buffer.pod b/deps/openssl/openssl/doc/crypto/buffer.pod index 781f5b11ee546e..52c5c841eb036b 100644 --- a/deps/openssl/openssl/doc/crypto/buffer.pod +++ b/deps/openssl/openssl/doc/crypto/buffer.pod @@ -2,8 +2,11 @@ =head1 NAME -BUF_MEM_new, BUF_MEM_free, BUF_MEM_grow, BUF_strdup - simple -character arrays structure +BUF_MEM_new, BUF_MEM_new_ex, BUF_MEM_free, BUF_MEM_grow - simple +character array structure + +BUF_strdup, BUF_strndup, BUF_memdup, BUF_strlcpy, BUF_strlcat - +standard C library equivalents =head1 SYNOPSIS @@ -15,25 +18,22 @@ character arrays structure int BUF_MEM_grow(BUF_MEM *str, int len); - char * BUF_strdup(const char *str); + char *BUF_strdup(const char *str); -=head1 DESCRIPTION + char *BUF_strndup(const char *str, size_t siz); -The buffer library handles simple character arrays. Buffers are used for -various purposes in the library, most notably memory BIOs. + void *BUF_memdup(const void *data, size_t siz); + + size_t BUF_strlcpy(char *dst, const char *src, size_t size); -The library uses the BUF_MEM structure defined in buffer.h: + size_t BUF_strlcat(char *dst, const char *src, size_t size); - typedef struct buf_mem_st - { - int length; /* current number of bytes */ - char *data; - int max; /* size of buffer */ - } BUF_MEM; + size_t BUF_strnlen(const char *str, size_t maxlen); -B is the current size of the buffer in bytes, B is the amount of -memory allocated to the buffer. There are three functions which handle these -and one "miscellaneous" function. +=head1 DESCRIPTION + +The buffer library handles simple character arrays. Buffers are used for +various purposes in the library, most notably memory BIOs. BUF_MEM_new() allocates a new buffer of zero size. @@ -44,14 +44,17 @@ BUF_MEM_grow() changes the size of an already existing buffer to B. Any data already in the buffer is preserved if it increases in size. -BUF_strdup() copies a null terminated string into a block of allocated -memory and returns a pointer to the allocated block. -Unlike the standard C library strdup() this function uses OPENSSL_malloc() and so -should be used in preference to the standard library strdup() because it can -be used for memory leak checking or replacing the malloc() function. +BUF_strdup(), BUF_strndup(), BUF_memdup(), BUF_strlcpy(), +BUF_strlcat() and BUF_strnlen are equivalents of the standard C +library functions. The dup() functions use OPENSSL_malloc() underneath +and so should be used in preference to the standard library for memory +leak checking or replacing the malloc() function. + +Memory allocated from these functions should be freed up using the +OPENSSL_free() function. -The memory allocated from BUF_strdup() should be freed up using the OPENSSL_free() -function. +BUF_strndup makes the explicit guarantee that it will never read past +the first B bytes of B. =head1 RETURN VALUES diff --git a/deps/openssl/openssl/doc/crypto/d2i_X509_NAME.pod b/deps/openssl/openssl/doc/crypto/d2i_X509_NAME.pod index 343ffe1519148b..b025de7b2ff630 100644 --- a/deps/openssl/openssl/doc/crypto/d2i_X509_NAME.pod +++ b/deps/openssl/openssl/doc/crypto/d2i_X509_NAME.pod @@ -14,7 +14,7 @@ d2i_X509_NAME, i2d_X509_NAME - X509_NAME encoding functions =head1 DESCRIPTION These functions decode and encode an B structure which is the -the same as the B type defined in RFC2459 (and elsewhere) and used +same as the B type defined in RFC2459 (and elsewhere) and used for example in certificate subject and issuer names. Othewise the functions behave in a similar way to d2i_X509() and i2d_X509() diff --git a/deps/openssl/openssl/doc/crypto/engine.pod b/deps/openssl/openssl/doc/crypto/engine.pod index f5ab1c3e50fd73..48741ee3062979 100644 --- a/deps/openssl/openssl/doc/crypto/engine.pod +++ b/deps/openssl/openssl/doc/crypto/engine.pod @@ -192,7 +192,7 @@ to use the pointer value at all, as this kind of reference is a guarantee that the structure can not be deallocated until the reference is released. However, a structural reference provides no guarantee that the ENGINE is -initiliased and able to use any of its cryptographic +initialised and able to use any of its cryptographic implementations. Indeed it's quite possible that most ENGINEs will not initialise at all in typical environments, as ENGINEs are typically used to support specialised hardware. To use an ENGINE's functionality, you need a @@ -201,8 +201,8 @@ specialised form of structural reference, because each functional reference implicitly contains a structural reference as well - however to avoid difficult-to-find programming bugs, it is recommended to treat the two kinds of reference independently. If you have a functional reference to an -ENGINE, you have a guarantee that the ENGINE has been initialised ready to -perform cryptographic operations and will remain uninitialised +ENGINE, you have a guarantee that the ENGINE has been initialised and +is ready to perform cryptographic operations, and will remain initialised until after you have released your reference. I @@ -370,7 +370,7 @@ I Here we'll assume an application has been configured by its user or admin to want to use the "ACME" ENGINE if it is available in the version of OpenSSL the application was compiled with. If it is available, it should be -used by default for all RSA, DSA, and symmetric cipher operation, otherwise +used by default for all RSA, DSA, and symmetric cipher operations, otherwise OpenSSL should use its builtin software as per usual. The following code illustrates how to approach this; @@ -401,7 +401,7 @@ I Here we'll assume we want to load and register all ENGINE implementations bundled with OpenSSL, such that for any cryptographic algorithm required by -OpenSSL - if there is an ENGINE that implements it and can be initialise, +OpenSSL - if there is an ENGINE that implements it and can be initialised, it should be used. The following code illustrates how this can work; /* Load all bundled ENGINEs into memory and make them visible */ diff --git a/deps/openssl/openssl/doc/dir-locals.example.el b/deps/openssl/openssl/doc/dir-locals.example.el new file mode 100644 index 00000000000000..79d0b01108d421 --- /dev/null +++ b/deps/openssl/openssl/doc/dir-locals.example.el @@ -0,0 +1,15 @@ +;;; This is an example of what a .dir-locals.el suitable for OpenSSL +;;; development could look like. +;;; +;;; Apart from setting the CC mode style to "OpenSSL-II", it also +;;; makes sure that tabs are never used for indentation in any file, +;;; and that the fill column is 78. +;;; +;;; For more information see (info "(emacs) Directory Variables") + +((nil + (indent-tabs-mode . nil) + (fill-column . 78) + ) + (c-mode + (c-file-style . "OpenSSL-II"))) diff --git a/deps/openssl/openssl/doc/openssl-c-indent.el b/deps/openssl/openssl/doc/openssl-c-indent.el new file mode 100644 index 00000000000000..144a915675ed1f --- /dev/null +++ b/deps/openssl/openssl/doc/openssl-c-indent.el @@ -0,0 +1,62 @@ +;;; This Emacs Lisp file defines a C indentation style for OpenSSL. +;;; +;;; This definition is for the "CC mode" package, which is the default +;;; mode for editing C source files in Emacs 20, not for the older +;;; c-mode.el (which was the default in less recent releaes of Emacs 19). +;;; +;;; Recommended use is to add this line in your .emacs: +;;; +;;; (load (expand-file-name "~/PATH/TO/openssl-c-indent.el")) +;;; +;;; To activate this indentation style, visit a C file, type +;;; M-x c-set-style (or C-c . for short), and enter "eay". +;;; To toggle the auto-newline feature of CC mode, type C-c C-a. +;;; +;;; If you're a OpenSSL developer, you might find it more comfortable +;;; to have this style be permanent in your OpenSSL development +;;; directory. To have that, please perform this: +;;; +;;; M-x add-dir-local-variable c-mode c-file-style +;;; "OpenSSL-II" +;;; +;;; A new buffer with .dir-locals.el will appear. Save it (C-x C-s). +;;; +;;; Alternatively, have a look at dir-locals.example.el + +;;; For suggesting improvements, please send e-mail to levitte@openssl.org. + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Note, it could be easy to inherit from the "gnu" style... however, +;; one never knows if that style will change somewhere in the future, +;; so I've chosen to copy the "gnu" style values explicitely instead +;; and mark them with a comment. // RLevitte 2015-08-31 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(c-add-style "OpenSSL-II" + '((c-basic-offset . 4) + (indent-tabs-mode . nil) + (fill-column . 78) + (comment-column . 33) + (c-comment-only-line-offset 0 . 0) ; From "gnu" style + (c-hanging-braces-alist ; From "gnu" style + (substatement-open before after) ; From "gnu" style + (arglist-cont-nonempty)) ; From "gnu" style + (c-offsets-alist + (statement-block-intro . +) ; From "gnu" style + (knr-argdecl-intro . 0) + (knr-argdecl . 0) + (substatement-open . +) ; From "gnu" style + (substatement-label . 0) ; From "gnu" style + (label . 1) + (statement-case-open . +) ; From "gnu" style + (statement-cont . +) ; From "gnu" style + (arglist-intro . c-lineup-arglist-intro-after-paren) ; From "gnu" style + (arglist-close . c-lineup-arglist) ; From "gnu" style + (inline-open . 0) ; From "gnu" style + (brace-list-open . +) ; From "gnu" style + (topmost-intro-cont first c-lineup-topmost-intro-cont + c-lineup-gnu-DEFUN-intro-cont) ; From "gnu" style + ) + (c-special-indent-hook . c-gnu-impose-minimum) ; From "gnu" style + (c-block-comment-prefix . "* ") + )) diff --git a/deps/openssl/openssl/doc/openssl_button.gif b/deps/openssl/openssl/doc/openssl_button.gif deleted file mode 100644 index 3d3c90c9f84992..00000000000000 Binary files a/deps/openssl/openssl/doc/openssl_button.gif and /dev/null differ diff --git a/deps/openssl/openssl/doc/openssl_button.html b/deps/openssl/openssl/doc/openssl_button.html deleted file mode 100644 index 44c91bd3d0683e..00000000000000 --- a/deps/openssl/openssl/doc/openssl_button.html +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/deps/openssl/openssl/doc/ssl/SSL_CONF_cmd.pod b/deps/openssl/openssl/doc/ssl/SSL_CONF_cmd.pod index 2bf1a60e9013fd..e81d76ae779ad4 100644 --- a/deps/openssl/openssl/doc/ssl/SSL_CONF_cmd.pod +++ b/deps/openssl/openssl/doc/ssl/SSL_CONF_cmd.pod @@ -74,7 +74,7 @@ B). Curve names are case sensitive. =item B<-named_curve> -This sets the temporary curve used for ephemeral ECDH modes. Only used by +This sets the temporary curve used for ephemeral ECDH modes. Only used by servers The B argument is a curve name or the special value B which @@ -85,7 +85,7 @@ can be either the B name (e.g. B) or an OpenSSL OID name =item B<-cipher> Sets the cipher suite list to B. Note: syntax checking of B is -currently not performed unless a B or B structure is +currently not performed unless a B or B structure is associated with B. =item B<-cert> @@ -111,9 +111,9 @@ operations are permitted. =item B<-no_ssl2>, B<-no_ssl3>, B<-no_tls1>, B<-no_tls1_1>, B<-no_tls1_2> -Disables protocol support for SSLv2, SSLv3, TLS 1.0, TLS 1.1 or TLS 1.2 -by setting the corresponding options B, B, -B, B and B respectively. +Disables protocol support for SSLv2, SSLv3, TLSv1.0, TLSv1.1 or TLSv1.2 +by setting the corresponding options B, B, +B, B and B respectively. =item B<-bugs> @@ -177,7 +177,7 @@ Note: the command prefix (if set) alters the recognised B values. =item B Sets the cipher suite list to B. Note: syntax checking of B is -currently not performed unless an B or B structure is +currently not performed unless an B or B structure is associated with B. =item B @@ -244,7 +244,7 @@ B). Curve names are case sensitive. =item B -This sets the temporary curve used for ephemeral ECDH modes. Only used by +This sets the temporary curve used for ephemeral ECDH modes. Only used by servers The B argument is a curve name or the special value B which @@ -258,10 +258,11 @@ The supported versions of the SSL or TLS protocol. The B argument is a comma separated list of supported protocols to enable or disable. If an protocol is preceded by B<-> that version is disabled. -All versions are enabled by default, though applications may choose to -explicitly disable some. Currently supported protocol values are B, -B, B, B and B. The special value B refers -to all supported versions. +Currently supported protocol values are B, B, B, +B and B. +All protocol versions other than B are enabled by default. +To avoid inadvertent enabling of B, when SSLv2 is disabled, it is not +possible to enable it via the B command. =item B @@ -339,16 +340,16 @@ The value is a directory name. The order of operations is significant. This can be used to set either defaults or values which cannot be overridden. For example if an application calls: - SSL_CONF_cmd(ctx, "Protocol", "-SSLv2"); + SSL_CONF_cmd(ctx, "Protocol", "-SSLv3"); SSL_CONF_cmd(ctx, userparam, uservalue); -it will disable SSLv2 support by default but the user can override it. If +it will disable SSLv3 support by default but the user can override it. If however the call sequence is: SSL_CONF_cmd(ctx, userparam, uservalue); - SSL_CONF_cmd(ctx, "Protocol", "-SSLv2"); + SSL_CONF_cmd(ctx, "Protocol", "-SSLv3"); -SSLv2 is B disabled and attempt to override this by the user are +then SSLv3 is B disabled and attempt to override this by the user are ignored. By checking the return code of SSL_CTX_cmd() it is possible to query if a @@ -372,7 +373,7 @@ can be checked instead. If -3 is returned a required argument is missing and an error is indicated. If 0 is returned some other error occurred and this can be reported back to the user. -The function SSL_CONF_cmd_value_type() can be used by applications to +The function SSL_CONF_cmd_value_type() can be used by applications to check for the existence of a command or to perform additional syntax checking or translation of the command value. For example if the return value is B an application could translate a relative diff --git a/deps/openssl/openssl/doc/ssl/SSL_CTX_add_extra_chain_cert.pod b/deps/openssl/openssl/doc/ssl/SSL_CTX_add_extra_chain_cert.pod index 8e832a57eaace8..04300fbe6f3ff0 100644 --- a/deps/openssl/openssl/doc/ssl/SSL_CTX_add_extra_chain_cert.pod +++ b/deps/openssl/openssl/doc/ssl/SSL_CTX_add_extra_chain_cert.pod @@ -2,29 +2,39 @@ =head1 NAME -SSL_CTX_add_extra_chain_cert - add certificate to chain +SSL_CTX_add_extra_chain_cert, SSL_CTX_clear_extra_chain_certs - add or clear +extra chain certificates =head1 SYNOPSIS #include - long SSL_CTX_add_extra_chain_cert(SSL_CTX ctx, X509 *x509) + long SSL_CTX_add_extra_chain_cert(SSL_CTX *ctx, X509 *x509); + long SSL_CTX_clear_extra_chain_certs(SSL_CTX *ctx); =head1 DESCRIPTION -SSL_CTX_add_extra_chain_cert() adds the certificate B to the certificate -chain presented together with the certificate. Several certificates -can be added one after the other. +SSL_CTX_add_extra_chain_cert() adds the certificate B to the extra chain +certificates associated with B. Several certificates can be added one +after another. + +SSL_CTX_clear_extra_chain_certs() clears all extra chain certificates +associated with B. + +These functions are implemented as macros. =head1 NOTES -When constructing the certificate chain, the chain will be formed from -these certificates explicitly specified. If no chain is specified, -the library will try to complete the chain from the available CA -certificates in the trusted CA storage, see +When sending a certificate chain, extra chain certificates are sent in order +following the end entity certificate. + +If no chain is specified, the library will try to complete the chain from the +available CA certificates in the trusted CA storage, see L. -The B certificate provided to SSL_CTX_add_extra_chain_cert() will be freed by the library when the B is destroyed. An application B free the B object. +The B certificate provided to SSL_CTX_add_extra_chain_cert() will be +freed by the library when the B is destroyed. An application +B free the B object. =head1 RESTRICTIONS @@ -37,8 +47,9 @@ be used instead. =head1 RETURN VALUES -SSL_CTX_add_extra_chain_cert() returns 1 on success. Check out the -error stack to find out the reason for failure otherwise. +SSL_CTX_add_extra_chain_cert() and SSL_CTX_clear_extra_chain_certs() return +1 on success and 0 for failure. Check out the error stack to find out the +reason for failure. =head1 SEE ALSO diff --git a/deps/openssl/openssl/doc/ssl/SSL_CTX_get0_param.pod b/deps/openssl/openssl/doc/ssl/SSL_CTX_get0_param.pod index 332f181187a8f4..ba16b50f087994 100644 --- a/deps/openssl/openssl/doc/ssl/SSL_CTX_get0_param.pod +++ b/deps/openssl/openssl/doc/ssl/SSL_CTX_get0_param.pod @@ -34,7 +34,7 @@ them to suit its needs: for example to add a hostname check. Check hostname matches "www.foo.com" in peer certificate: X509_VERIFY_PARAM *vpm = SSL_get0_param(ssl); - X509_VERIFY_PARAM_set1_host(vpm, "www.foo.com"); + X509_VERIFY_PARAM_set1_host(vpm, "www.foo.com", 0); =head1 RETURN VALUES diff --git a/deps/openssl/openssl/doc/ssl/SSL_CTX_new.pod b/deps/openssl/openssl/doc/ssl/SSL_CTX_new.pod index 491ac8c172cb5e..b8cc8797845149 100644 --- a/deps/openssl/openssl/doc/ssl/SSL_CTX_new.pod +++ b/deps/openssl/openssl/doc/ssl/SSL_CTX_new.pod @@ -2,13 +2,55 @@ =head1 NAME -SSL_CTX_new - create a new SSL_CTX object as framework for TLS/SSL enabled functions +SSL_CTX_new, +SSLv23_method, SSLv23_server_method, SSLv23_client_method, +TLSv1_2_method, TLSv1_2_server_method, TLSv1_2_client_method, +TLSv1_1_method, TLSv1_1_server_method, TLSv1_1_client_method, +TLSv1_method, TLSv1_server_method, TLSv1_client_method, +SSLv3_method, SSLv3_server_method, SSLv3_client_method, +SSLv2_method, SSLv2_server_method, SSLv2_client_method, +DTLS_method, DTLS_server_method, DTLS_client_method, +DTLSv1_2_method, DTLSv1_2_server_method, DTLSv1_2_client_method, +DTLSv1_method, DTLSv1_server_method, DTLSv1_client_method - +create a new SSL_CTX object as framework for TLS/SSL enabled functions =head1 SYNOPSIS #include SSL_CTX *SSL_CTX_new(const SSL_METHOD *method); + const SSL_METHOD *SSLv23_method(void); + const SSL_METHOD *SSLv23_server_method(void); + const SSL_METHOD *SSLv23_client_method(void); + const SSL_METHOD *TLSv1_2_method(void); + const SSL_METHOD *TLSv1_2_server_method(void); + const SSL_METHOD *TLSv1_2_client_method(void); + const SSL_METHOD *TLSv1_1_method(void); + const SSL_METHOD *TLSv1_1_server_method(void); + const SSL_METHOD *TLSv1_1_client_method(void); + const SSL_METHOD *TLSv1_method(void); + const SSL_METHOD *TLSv1_server_method(void); + const SSL_METHOD *TLSv1_client_method(void); + #ifndef OPENSSL_NO_SSL3_METHOD + const SSL_METHOD *SSLv3_method(void); + const SSL_METHOD *SSLv3_server_method(void); + const SSL_METHOD *SSLv3_client_method(void); + #endif + #ifndef OPENSSL_NO_SSL2 + const SSL_METHOD *SSLv2_method(void); + const SSL_METHOD *SSLv2_server_method(void); + const SSL_METHOD *SSLv2_client_method(void); + #endif + + const SSL_METHOD *DTLS_method(void); + const SSL_METHOD *DTLS_server_method(void); + const SSL_METHOD *DTLS_client_method(void); + const SSL_METHOD *DTLSv1_2_method(void); + const SSL_METHOD *DTLSv1_2_server_method(void); + const SSL_METHOD *DTLSv1_2_client_method(void); + const SSL_METHOD *DTLSv1_method(void); + const SSL_METHOD *DTLSv1_server_method(void); + const SSL_METHOD *DTLSv1_client_method(void); =head1 DESCRIPTION @@ -23,65 +65,88 @@ client only type. B can be of the following types: =over 4 -=item SSLv2_method(void), SSLv2_server_method(void), SSLv2_client_method(void) +=item SSLv23_method(), SSLv23_server_method(), SSLv23_client_method() + +These are the general-purpose I SSL/TLS methods. +The actual protocol version used will be negotiated to the highest version +mutually supported by the client and the server. +The supported protocols are SSLv2, SSLv3, TLSv1, TLSv1.1 and TLSv1.2. +Most applications should use these method, and avoid the version specific +methods described below. + +The list of protocols available can be further limited using the +B, B, B, +B and B options of the +L or L functions. +Clients should avoid creating "holes" in the set of protocols they support, +when disabling a protocol, make sure that you also disable either all previous +or all subsequent protocol versions. +In clients, when a protocol version is disabled without disabling I +previous protocol versions, the effect is to also disable all subsequent +protocol versions. + +The SSLv2 and SSLv3 protocols are deprecated and should generally not be used. +Applications should typically use L in combination with +the B flag to disable negotiation of SSLv3 via the above +I SSL/TLS methods. +The B option is set by default, and would need to be cleared +via L in order to enable negotiation of SSLv2. + +=item TLSv1_2_method(), TLSv1_2_server_method(), TLSv1_2_client_method() -A TLS/SSL connection established with these methods will only understand -the SSLv2 protocol. A client will send out SSLv2 client hello messages -and will also indicate that it only understand SSLv2. A server will only -understand SSLv2 client hello messages. +A TLS/SSL connection established with these methods will only understand the +TLSv1.2 protocol. A client will send out TLSv1.2 client hello messages and +will also indicate that it only understand TLSv1.2. A server will only +understand TLSv1.2 client hello messages. -=item SSLv3_method(void), SSLv3_server_method(void), SSLv3_client_method(void) +=item TLSv1_1_method(), TLSv1_1_server_method(), TLSv1_1_client_method() A TLS/SSL connection established with these methods will only understand the -SSLv3 protocol. A client will send out SSLv3 client hello messages -and will indicate that it only understands SSLv3. A server will only understand -SSLv3 client hello messages. This especially means, that it will -not understand SSLv2 client hello messages which are widely used for -compatibility reasons, see SSLv23_*_method(). +TLSv1.1 protocol. A client will send out TLSv1.1 client hello messages and +will also indicate that it only understand TLSv1.1. A server will only +understand TLSv1.1 client hello messages. -=item TLSv1_method(void), TLSv1_server_method(void), TLSv1_client_method(void) +=item TLSv1_method(), TLSv1_server_method(), TLSv1_client_method() A TLS/SSL connection established with these methods will only understand the -TLSv1 protocol. A client will send out TLSv1 client hello messages -and will indicate that it only understands TLSv1. A server will only understand -TLSv1 client hello messages. This especially means, that it will -not understand SSLv2 client hello messages which are widely used for -compatibility reasons, see SSLv23_*_method(). It will also not understand -SSLv3 client hello messages. - -=item SSLv23_method(void), SSLv23_server_method(void), SSLv23_client_method(void) - -A TLS/SSL connection established with these methods may understand the SSLv2, -SSLv3, TLSv1, TLSv1.1 and TLSv1.2 protocols. - -If the cipher list does not contain any SSLv2 ciphersuites (the default -cipher list does not) or extensions are required (for example server name) -a client will send out TLSv1 client hello messages including extensions and -will indicate that it also understands TLSv1.1, TLSv1.2 and permits a -fallback to SSLv3. A server will support SSLv3, TLSv1, TLSv1.1 and TLSv1.2 -protocols. This is the best choice when compatibility is a concern. - -If any SSLv2 ciphersuites are included in the cipher list and no extensions -are required then SSLv2 compatible client hellos will be used by clients and -SSLv2 will be accepted by servers. This is B recommended due to the -insecurity of SSLv2 and the limited nature of the SSLv2 client hello -prohibiting the use of extensions. +TLSv1 protocol. A client will send out TLSv1 client hello messages and will +indicate that it only understands TLSv1. A server will only understand TLSv1 +client hello messages. -=back +=item SSLv3_method(), SSLv3_server_method(), SSLv3_client_method() + +A TLS/SSL connection established with these methods will only understand the +SSLv3 protocol. A client will send out SSLv3 client hello messages and will +indicate that it only understands SSLv3. A server will only understand SSLv3 +client hello messages. The SSLv3 protocol is deprecated and should not be +used. + +=item SSLv2_method(), SSLv2_server_method(), SSLv2_client_method() + +A TLS/SSL connection established with these methods will only understand the +SSLv2 protocol. A client will send out SSLv2 client hello messages and will +also indicate that it only understand SSLv2. A server will only understand +SSLv2 client hello messages. The SSLv2 protocol offers little to no security +and should not be used. +As of OpenSSL 1.0.2g, EXPORT ciphers and 56-bit DES are no longer available +with SSLv2. -The list of protocols available can later be limited using the SSL_OP_NO_SSLv2, -SSL_OP_NO_SSLv3, SSL_OP_NO_TLSv1, SSL_OP_NO_TLSv1_1 and SSL_OP_NO_TLSv1_2 -options of the SSL_CTX_set_options() or SSL_set_options() functions. -Using these options it is possible to choose e.g. SSLv23_server_method() and -be able to negotiate with all possible clients, but to only allow newer -protocols like TLSv1, TLSv1.1 or TLS v1.2. +=item DTLS_method(), DTLS_server_method(), DTLS_client_method() -Applications which never want to support SSLv2 (even is the cipher string -is configured to use SSLv2 ciphersuites) can set SSL_OP_NO_SSLv2. +These are the version-flexible DTLS methods. + +=item DTLSv1_2_method(), DTLSv1_2_server_method(), DTLSv1_2_client_method() + +These are the version-specific methods for DTLSv1.2. + +=item DTLSv1_method(), DTLSv1_server_method(), DTLSv1_client_method() + +These are the version-specific methods for DTLSv1. + +=back -SSL_CTX_new() initializes the list of ciphers, the session cache setting, -the callbacks, the keys and certificates and the options to its default -values. +SSL_CTX_new() initializes the list of ciphers, the session cache setting, the +callbacks, the keys and certificates and the options to its default values. =head1 RETURN VALUES @@ -91,8 +156,8 @@ The following return values can occur: =item NULL -The creation of a new SSL_CTX object failed. Check the error stack to -find out the reason. +The creation of a new SSL_CTX object failed. Check the error stack to find out +the reason. =item Pointer to an SSL_CTX object @@ -102,6 +167,7 @@ The return value points to an allocated SSL_CTX object. =head1 SEE ALSO +L, L, L, L, L, L, L diff --git a/deps/openssl/openssl/doc/ssl/SSL_CTX_set1_verify_cert_store.pod b/deps/openssl/openssl/doc/ssl/SSL_CTX_set1_verify_cert_store.pod index 493cca48194008..3e3a4fa90c0ea4 100644 --- a/deps/openssl/openssl/doc/ssl/SSL_CTX_set1_verify_cert_store.pod +++ b/deps/openssl/openssl/doc/ssl/SSL_CTX_set1_verify_cert_store.pod @@ -17,10 +17,10 @@ verification or chain store int SSL_CTX_set0_chain_cert_store(SSL_CTX *ctx, X509_STORE *st); int SSL_CTX_set1_chain_cert_store(SSL_CTX *ctx, X509_STORE *st); - int SSL_set0_verify_cert_store(SSL_CTX *ctx, X509_STORE *st); - int SSL_set1_verify_cert_store(SSL_CTX *ctx, X509_STORE *st); - int SSL_set0_chain_cert_store(SSL_CTX *ctx, X509_STORE *st); - int SSL_set1_chain_cert_store(SSL_CTX *ctx, X509_STORE *st); + int SSL_set0_verify_cert_store(SSL *ctx, X509_STORE *st); + int SSL_set1_verify_cert_store(SSL *ctx, X509_STORE *st); + int SSL_set0_chain_cert_store(SSL *ctx, X509_STORE *st); + int SSL_set1_chain_cert_store(SSL *ctx, X509_STORE *st); =head1 DESCRIPTION diff --git a/deps/openssl/openssl/doc/ssl/SSL_CTX_set_options.pod b/deps/openssl/openssl/doc/ssl/SSL_CTX_set_options.pod index e80a72cd4d06b1..9a7e98c1d4146d 100644 --- a/deps/openssl/openssl/doc/ssl/SSL_CTX_set_options.pod +++ b/deps/openssl/openssl/doc/ssl/SSL_CTX_set_options.pod @@ -189,15 +189,25 @@ browser has a cert, it will crash/hang. Works for 3.x and 4.xbeta =item SSL_OP_NO_SSLv2 Do not use the SSLv2 protocol. +As of OpenSSL 1.0.2g the B option is set by default. =item SSL_OP_NO_SSLv3 Do not use the SSLv3 protocol. +It is recommended that applications should set this option. =item SSL_OP_NO_TLSv1 Do not use the TLSv1 protocol. +=item SSL_OP_NO_TLSv1_1 + +Do not use the TLSv1.1 protocol. + +=item SSL_OP_NO_TLSv1_2 + +Do not use the TLSv1.2 protocol. + =item SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION When performing renegotiation as a server, always start a new session diff --git a/deps/openssl/openssl/doc/ssl/SSL_CTX_set_tlsext_status_cb.pod b/deps/openssl/openssl/doc/ssl/SSL_CTX_set_tlsext_status_cb.pod new file mode 100644 index 00000000000000..b8147baecf98b9 --- /dev/null +++ b/deps/openssl/openssl/doc/ssl/SSL_CTX_set_tlsext_status_cb.pod @@ -0,0 +1,73 @@ +=pod + +=head1 NAME + +SSL_CTX_set_tlsext_status_cb, SSL_CTX_set_tlsext_status_arg, +SSL_set_tlsext_status_type, SSL_get_tlsext_status_ocsp_resp, +SSL_set_tlsext_status_ocsp_resp - OCSP Certificate Status Request functions + +=head1 SYNOPSIS + + #include + + long SSL_CTX_set_tlsext_status_cb(SSL_CTX *ctx, + int (*callback)(SSL *, void *)); + long SSL_CTX_set_tlsext_status_arg(SSL_CTX *ctx, void *arg); + + long SSL_set_tlsext_status_type(SSL *s, int type); + + long SSL_get_tlsext_status_ocsp_resp(ssl, unsigned char **resp); + long SSL_set_tlsext_status_ocsp_resp(ssl, unsigned char *resp, int len); + +=head1 DESCRIPTION + +A client application may request that a server send back an OCSP status response +(also known as OCSP stapling). To do so the client should call the +SSL_set_tlsext_status_type() function prior to the start of the handshake. +Currently the only supported type is B. This value +should be passed in the B argument. The client should additionally provide +a callback function to decide what to do with the returned OCSP response by +calling SSL_CTX_set_tlsext_status_cb(). The callback function should determine +whether the returned OCSP response is acceptable or not. The callback will be +passed as an argument the value previously set via a call to +SSL_CTX_set_tlsext_status_arg(). Note that the callback will not be called in +the event of a handshake where session resumption occurs (because there are no +Certificates exchanged in such a handshake). + +The response returned by the server can be obtained via a call to +SSL_get_tlsext_status_ocsp_resp(). The value B<*resp> will be updated to point +to the OCSP response data and the return value will be the length of that data. +Typically a callback would obtain an OCSP_RESPONSE object from this data via a +call to the d2i_OCSP_RESPONSE() function. If the server has not provided any +response data then B<*resp> will be NULL and the return value from +SSL_get_tlsext_status_ocsp_resp() will be -1. + +A server application must also call the SSL_CTX_set_tlsext_status_cb() function +if it wants to be able to provide clients with OCSP Certificate Status +responses. Typically the server callback would obtain the server certificate +that is being sent back to the client via a call to SSL_get_certificate(); +obtain the OCSP response to be sent back; and then set that response data by +calling SSL_set_tlsext_status_ocsp_resp(). A pointer to the response data should +be provided in the B argument, and the length of that data should be in +the B argument. + +=head1 RETURN VALUES + +The callback when used on the client side should return a negative value on +error; 0 if the response is not acceptable (in which case the handshake will +fail) or a positive value if it is acceptable. + +The callback when used on the server side should return with either +SSL_TLSEXT_ERR_OK (meaning that the OCSP response that has been set should be +returned), SSL_TLSEXT_ERR_NOACK (meaning that an OCSP response should not be +returned) or SSL_TLSEXT_ERR_ALERT_FATAL (meaning that a fatal error has +occurred). + +SSL_CTX_set_tlsext_status_cb(), SSL_CTX_set_tlsext_status_arg(), +SSL_set_tlsext_status_type() and SSL_set_tlsext_status_ocsp_resp() return 0 on +error or 1 on success. + +SSL_get_tlsext_status_ocsp_resp() returns the length of the OCSP response data +or -1 if there is no OCSP response data. + +=cut diff --git a/deps/openssl/openssl/doc/ssl/SSL_CTX_set_tmp_dh_callback.pod b/deps/openssl/openssl/doc/ssl/SSL_CTX_set_tmp_dh_callback.pod index b754c16a86e66e..234fbc845002f3 100644 --- a/deps/openssl/openssl/doc/ssl/SSL_CTX_set_tmp_dh_callback.pod +++ b/deps/openssl/openssl/doc/ssl/SSL_CTX_set_tmp_dh_callback.pod @@ -48,25 +48,8 @@ even if he gets hold of the normal (certified) key, as this key was only used for signing. In order to perform a DH key exchange the server must use a DH group -(DH parameters) and generate a DH key. -The server will always generate a new DH key during the negotiation -if either the DH parameters are supplied via callback or the -SSL_OP_SINGLE_DH_USE option of SSL_CTX_set_options(3) is set (or both). -It will immediately create a DH key if DH parameters are supplied via -SSL_CTX_set_tmp_dh() and SSL_OP_SINGLE_DH_USE is not set. -In this case, -it may happen that a key is generated on initialization without later -being needed, while on the other hand the computer time during the -negotiation is being saved. - -If "strong" primes were used to generate the DH parameters, it is not strictly -necessary to generate a new key for each handshake but it does improve forward -secrecy. If it is not assured that "strong" primes were used, -SSL_OP_SINGLE_DH_USE must be used in order to prevent small subgroup -attacks. Always using SSL_OP_SINGLE_DH_USE has an impact on the -computer time needed during negotiation, but it is not very large, so -application authors/users should consider always enabling this option. -The option is required to implement perfect forward secrecy (PFS). +(DH parameters) and generate a DH key. The server will always generate +a new DH key during the negotiation. As generating DH parameters is extremely time consuming, an application should not generate the parameters on the fly but supply the parameters. @@ -93,10 +76,9 @@ can supply the DH parameters via a callback function. Previous versions of the callback used B and B parameters to control parameter generation for export and non-export cipher suites. Modern servers that do not support export ciphersuites -are advised to either use SSL_CTX_set_tmp_dh() in combination with -SSL_OP_SINGLE_DH_USE, or alternatively, use the callback but ignore -B and B and simply supply at least 2048-bit -parameters in the callback. +are advised to either use SSL_CTX_set_tmp_dh() or alternatively, use +the callback but ignore B and B and simply +supply at least 2048-bit parameters in the callback. =head1 EXAMPLES @@ -128,7 +110,6 @@ partly left out.) if (SSL_CTX_set_tmp_dh(ctx, dh_2048) != 1) { /* Error. */ } - SSL_CTX_set_options(ctx, SSL_OP_SINGLE_DH_USE); ... =head1 RETURN VALUES diff --git a/deps/openssl/openssl/doc/ssl/SSL_check_chain.pod b/deps/openssl/openssl/doc/ssl/SSL_check_chain.pod new file mode 100644 index 00000000000000..d3b7601909e40d --- /dev/null +++ b/deps/openssl/openssl/doc/ssl/SSL_check_chain.pod @@ -0,0 +1,85 @@ +=pod + +=head1 NAME + +SSL_check_chain - check certificate chain suitability + +=head1 SYNOPSIS + + #include + + int SSL_check_chain(SSL *s, X509 *x, EVP_PKEY *pk, STACK_OF(X509) *chain); + +=head1 DESCRIPTION + +SSL_check_chain() checks whether certificate B, private key B and +certificate chain B is suitable for use with the current session +B. + +=head1 RETURN VALUES + +SSL_check_chain() returns a bitmap of flags indicating the validity of the +chain. + +B: the chain can be used with the current session. +If this flag is B set then the certificate will never be used even +if the application tries to set it because it is inconsistent with the +peer preferences. + +B: the EE key can be used for signing. + +B: the signature algorithm of the EE certificate is +acceptable. + +B: the signature algorithms of all CA certificates +are acceptable. + +B: the parameters of the end entity certificate are +acceptable (e.g. it is a supported curve). + +B: the parameters of all CA certificates are acceptable. + +B: the end entity certificate algorithm +can be used explicitly for signing (i.e. it is mentioned in the signature +algorithms extension). + +B: the issuer name is acceptable. This is only +meaningful for client authentication. + +B: the certificate type is acceptable. Only meaningful +for client authentication. + +B: chain is suitable for Suite B use. + +=head1 NOTES + +SSL_check_chain() must be called in servers after a client hello message or in +clients after a certificate request message. It will typically be called +in the certificate callback. + +An application wishing to support multiple certificate chains may call this +function on each chain in turn: starting with the one it considers the +most secure. It could then use the chain of the first set which returns +suitable flags. + +As a minimum the flag B must be set for a chain to be +usable. An application supporting multiple chains with different CA signature +algorithms may also wish to check B too. If no +chain is suitable a server should fall back to the most secure chain which +sets B. + +The validity of a chain is determined by checking if it matches a supported +signature algorithm, supported curves and in the case of client authentication +certificate types and issuer names. + +Since the supported signature algorithms extension is only used in TLS 1.2 +and DTLS 1.2 the results for earlier versions of TLS and DTLS may not be +very useful. Applications may wish to specify a different "legacy" chain +for earlier versions of TLS or DTLS. + +=head1 SEE ALSO + +L, +L + +=cut diff --git a/deps/openssl/openssl/doc/ssl/ssl.pod b/deps/openssl/openssl/doc/ssl/ssl.pod index 242087e691e35a..70cca178a20477 100644 --- a/deps/openssl/openssl/doc/ssl/ssl.pod +++ b/deps/openssl/openssl/doc/ssl/ssl.pod @@ -130,41 +130,86 @@ protocol methods defined in B structures. =over 4 -=item const SSL_METHOD *B(void); +=item const SSL_METHOD *B(void); -Constructor for the SSLv2 SSL_METHOD structure for a dedicated client. +Constructor for the I SSL_METHOD structure for +clients, servers or both. +See L for details. -=item const SSL_METHOD *B(void); +=item const SSL_METHOD *B(void); -Constructor for the SSLv2 SSL_METHOD structure for a dedicated server. +Constructor for the I SSL_METHOD structure for +clients. -=item const SSL_METHOD *B(void); +=item const SSL_METHOD *B(void); -Constructor for the SSLv2 SSL_METHOD structure for combined client and server. +Constructor for the I SSL_METHOD structure for +servers. -=item const SSL_METHOD *B(void); +=item const SSL_METHOD *B(void); -Constructor for the SSLv3 SSL_METHOD structure for a dedicated client. +Constructor for the TLSv1.2 SSL_METHOD structure for clients, servers +or both. -=item const SSL_METHOD *B(void); +=item const SSL_METHOD *B(void); -Constructor for the SSLv3 SSL_METHOD structure for a dedicated server. +Constructor for the TLSv1.2 SSL_METHOD structure for clients. -=item const SSL_METHOD *B(void); +=item const SSL_METHOD *B(void); + +Constructor for the TLSv1.2 SSL_METHOD structure for servers. + +=item const SSL_METHOD *B(void); -Constructor for the SSLv3 SSL_METHOD structure for combined client and server. +Constructor for the TLSv1.1 SSL_METHOD structure for clients, servers +or both. + +=item const SSL_METHOD *B(void); + +Constructor for the TLSv1.1 SSL_METHOD structure for clients. + +=item const SSL_METHOD *B(void); + +Constructor for the TLSv1.1 SSL_METHOD structure for servers. + +=item const SSL_METHOD *B(void); + +Constructor for the TLSv1 SSL_METHOD structure for clients, servers +or both. =item const SSL_METHOD *B(void); -Constructor for the TLSv1 SSL_METHOD structure for a dedicated client. +Constructor for the TLSv1 SSL_METHOD structure for clients. =item const SSL_METHOD *B(void); -Constructor for the TLSv1 SSL_METHOD structure for a dedicated server. +Constructor for the TLSv1 SSL_METHOD structure for servers. -=item const SSL_METHOD *B(void); +=item const SSL_METHOD *B(void); + +Constructor for the SSLv3 SSL_METHOD structure for clients, servers +or both. + +=item const SSL_METHOD *B(void); + +Constructor for the SSLv3 SSL_METHOD structure for clients. + +=item const SSL_METHOD *B(void); + +Constructor for the SSLv3 SSL_METHOD structure for servers. + +=item const SSL_METHOD *B(void); + +Constructor for the SSLv2 SSL_METHOD structure for clients, servers +or both. + +=item const SSL_METHOD *B(void); + +Constructor for the SSLv2 SSL_METHOD structure for clients. + +=item const SSL_METHOD *B(void); -Constructor for the TLSv1 SSL_METHOD structure for combined client and server. +Constructor for the SSLv2 SSL_METHOD structure for servers. =back diff --git a/deps/openssl/openssl/e_os.h b/deps/openssl/openssl/e_os.h index 45fef691a09411..1fa36c17198082 100644 --- a/deps/openssl/openssl/e_os.h +++ b/deps/openssl/openssl/e_os.h @@ -619,7 +619,7 @@ struct servent *PASCAL getservbyname(const char *, const char *); # include # endif -# if defined(sun) +# if defined(__sun) || defined(sun) # include # else # ifndef VMS @@ -661,7 +661,7 @@ struct servent *PASCAL getservbyname(const char *, const char *); # endif -# if defined(sun) && !defined(__svr4__) && !defined(__SVR4) +# if (defined(__sun) || defined(sun)) && !defined(__svr4__) && !defined(__SVR4) /* include headers first, so our defines don't break it */ # include # include diff --git a/deps/openssl/openssl/engines/e_capi.c b/deps/openssl/openssl/engines/e_capi.c index f4cd2ffe7fa16d..6e524633f3f0f6 100644 --- a/deps/openssl/openssl/engines/e_capi.c +++ b/deps/openssl/openssl/engines/e_capi.c @@ -114,6 +114,26 @@ # define CERT_SYSTEM_STORE_CURRENT_USER 0x00010000 # endif +# ifndef ALG_SID_SHA_256 +# define ALG_SID_SHA_256 12 +# endif +# ifndef ALG_SID_SHA_384 +# define ALG_SID_SHA_384 13 +# endif +# ifndef ALG_SID_SHA_512 +# define ALG_SID_SHA_512 14 +# endif + +# ifndef CALG_SHA_256 +# define CALG_SHA_256 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_256) +# endif +# ifndef CALG_SHA_384 +# define CALG_SHA_384 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_384) +# endif +# ifndef CALG_SHA_512 +# define CALG_SHA_512 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_512) +# endif + # include # include # include @@ -800,6 +820,18 @@ int capi_rsa_sign(int dtype, const unsigned char *m, unsigned int m_len, } /* Convert the signature type to a CryptoAPI algorithm ID */ switch (dtype) { + case NID_sha256: + alg = CALG_SHA_256; + break; + + case NID_sha384: + alg = CALG_SHA_384; + break; + + case NID_sha512: + alg = CALG_SHA_512; + break; + case NID_sha1: alg = CALG_SHA1; break; diff --git a/deps/openssl/openssl/engines/e_chil.c b/deps/openssl/openssl/engines/e_chil.c index 69d49d7d3a88bd..5dfab513452761 100644 --- a/deps/openssl/openssl/engines/e_chil.c +++ b/deps/openssl/openssl/engines/e_chil.c @@ -1,4 +1,4 @@ -/* crypto/engine/e_chil.c -*- mode: C; c-file-style: "eay" -*- */ +/* crypto/engine/e_chil.c */ /* * Written by Richard Levitte (richard@levitte.org), Geoff Thorpe * (geoff@geoffthorpe.net) and Dr Stephen N Henson (steve@openssl.org) for @@ -839,6 +839,10 @@ static EVP_PKEY *hwcrhk_load_privkey(ENGINE *eng, const char *key_id, bn_fix_top(rtmp->n); res = EVP_PKEY_new(); + if (res == NULL) { + HWCRHKerr(HWCRHK_F_HWCRHK_LOAD_PRIVKEY, HWCRHK_R_CHIL_ERROR); + goto err; + } EVP_PKEY_assign_RSA(res, rtmp); # endif diff --git a/deps/openssl/openssl/include/openssl/aes.h b/deps/openssl/openssl/include/openssl/aes.h index 87bf60f6f2bfbe..faa66c49148f50 100644 --- a/deps/openssl/openssl/include/openssl/aes.h +++ b/deps/openssl/openssl/include/openssl/aes.h @@ -1,4 +1,4 @@ -/* crypto/aes/aes.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/aes/aes.h */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/include/openssl/bio.h b/deps/openssl/openssl/include/openssl/bio.h index f78796b069f547..6790aed28e0bae 100644 --- a/deps/openssl/openssl/include/openssl/bio.h +++ b/deps/openssl/openssl/include/openssl/bio.h @@ -479,11 +479,11 @@ struct bio_dgram_sctp_prinfo { # define BIO_get_conn_hostname(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0) # define BIO_get_conn_port(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1) # define BIO_get_conn_ip(b) BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2) -# define BIO_get_conn_int_port(b) BIO_int_ctrl(b,BIO_C_GET_CONNECT,3,0) +# define BIO_get_conn_int_port(b) BIO_ctrl(b,BIO_C_GET_CONNECT,3,NULL) # define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) -/* BIO_s_accept_socket() */ +/* BIO_s_accept() */ # define BIO_set_accept_port(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0,(char *)name) # define BIO_get_accept_port(b) BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0) /* #define BIO_set_nbio(b,n) BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) */ @@ -496,6 +496,7 @@ struct bio_dgram_sctp_prinfo { # define BIO_set_bind_mode(b,mode) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL) # define BIO_get_bind_mode(b,mode) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL) +/* BIO_s_accept() and BIO_s_connect() */ # define BIO_do_connect(b) BIO_do_handshake(b) # define BIO_do_accept(b) BIO_do_handshake(b) # define BIO_do_handshake(b) BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL) @@ -515,12 +516,15 @@ struct bio_dgram_sctp_prinfo { # define BIO_get_url(b,url) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,2,(char *)(url)) # define BIO_get_no_connect_return(b) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,5,NULL) +/* BIO_s_datagram(), BIO_s_fd(), BIO_s_socket(), BIO_s_accept() and BIO_s_connect() */ # define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd) # define BIO_get_fd(b,c) BIO_ctrl(b,BIO_C_GET_FD,0,(char *)c) +/* BIO_s_file() */ # define BIO_set_fp(b,fp,c) BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)fp) # define BIO_get_fp(b,fpp) BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,(char *)fpp) +/* BIO_s_fd() and BIO_s_file() */ # define BIO_seek(b,ofs) (int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL) # define BIO_tell(b) (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL) @@ -685,7 +689,7 @@ long BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi, long argl, long ret); BIO_METHOD *BIO_s_mem(void); -BIO *BIO_new_mem_buf(void *buf, int len); +BIO *BIO_new_mem_buf(const void *buf, int len); BIO_METHOD *BIO_s_socket(void); BIO_METHOD *BIO_s_connect(void); BIO_METHOD *BIO_s_accept(void); diff --git a/deps/openssl/openssl/include/openssl/bn.h b/deps/openssl/openssl/include/openssl/bn.h index 5696965e9a09d0..86264ae6315fb1 100644 --- a/deps/openssl/openssl/include/openssl/bn.h +++ b/deps/openssl/openssl/include/openssl/bn.h @@ -125,6 +125,7 @@ #ifndef HEADER_BN_H # define HEADER_BN_H +# include # include # ifndef OPENSSL_NO_FP_API # include /* FILE */ @@ -721,8 +722,17 @@ const BIGNUM *BN_get0_nist_prime_521(void); /* library internal functions */ -# define bn_expand(a,bits) ((((((bits+BN_BITS2-1))/BN_BITS2)) <= (a)->dmax)?\ - (a):bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2)) +# define bn_expand(a,bits) \ + ( \ + bits > (INT_MAX - BN_BITS2 + 1) ? \ + NULL \ + : \ + (((bits+BN_BITS2-1)/BN_BITS2) <= (a)->dmax) ? \ + (a) \ + : \ + bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2) \ + ) + # define bn_wexpand(a,words) (((words) <= (a)->dmax)?(a):bn_expand2((a),(words))) BIGNUM *bn_expand2(BIGNUM *a, int words); # ifndef OPENSSL_NO_DEPRECATED diff --git a/deps/openssl/openssl/include/openssl/buffer.h b/deps/openssl/openssl/include/openssl/buffer.h index c343dd772f1efb..efd240a5f91e25 100644 --- a/deps/openssl/openssl/include/openssl/buffer.h +++ b/deps/openssl/openssl/include/openssl/buffer.h @@ -86,7 +86,13 @@ int BUF_MEM_grow(BUF_MEM *str, size_t len); int BUF_MEM_grow_clean(BUF_MEM *str, size_t len); size_t BUF_strnlen(const char *str, size_t maxlen); char *BUF_strdup(const char *str); + +/* + * Like strndup, but in addition, explicitly guarantees to never read past the + * first |siz| bytes of |str|. + */ char *BUF_strndup(const char *str, size_t siz); + void *BUF_memdup(const void *data, size_t siz); void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz); diff --git a/deps/openssl/openssl/include/openssl/camellia.h b/deps/openssl/openssl/include/openssl/camellia.h index 9be7c0fd999667..45e8d25b1dd5b5 100644 --- a/deps/openssl/openssl/include/openssl/camellia.h +++ b/deps/openssl/openssl/include/openssl/camellia.h @@ -1,4 +1,4 @@ -/* crypto/camellia/camellia.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/camellia/camellia.h */ /* ==================================================================== * Copyright (c) 2006 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/include/openssl/crypto.h b/deps/openssl/openssl/include/openssl/crypto.h index c450d7a3c374b3..6c644ce12a8250 100644 --- a/deps/openssl/openssl/include/openssl/crypto.h +++ b/deps/openssl/openssl/include/openssl/crypto.h @@ -628,7 +628,7 @@ void OPENSSL_init(void); * into a defined order as the return value when a != b is undefined, other * than to be non-zero. */ -int CRYPTO_memcmp(const void *a, const void *b, size_t len); +int CRYPTO_memcmp(const volatile void *a, const volatile void *b, size_t len); /* BEGIN ERROR CODES */ /* diff --git a/deps/openssl/openssl/include/openssl/des_old.h b/deps/openssl/openssl/include/openssl/des_old.h index f1e1e2cb09cfb2..ee7607a2415f83 100644 --- a/deps/openssl/openssl/include/openssl/des_old.h +++ b/deps/openssl/openssl/include/openssl/des_old.h @@ -1,4 +1,4 @@ -/* crypto/des/des_old.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/des/des_old.h */ /*- * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING diff --git a/deps/openssl/openssl/include/openssl/dh.h b/deps/openssl/openssl/include/openssl/dh.h index 0502f1a9cc14dc..a5bd9016aae85a 100644 --- a/deps/openssl/openssl/include/openssl/dh.h +++ b/deps/openssl/openssl/include/openssl/dh.h @@ -142,7 +142,7 @@ struct dh_st { BIGNUM *p; BIGNUM *g; long length; /* optional */ - BIGNUM *pub_key; /* g^x */ + BIGNUM *pub_key; /* g^x % p */ BIGNUM *priv_key; /* x */ int flags; BN_MONT_CTX *method_mont_p; @@ -174,6 +174,7 @@ struct dh_st { /* DH_check_pub_key error codes */ # define DH_CHECK_PUBKEY_TOO_SMALL 0x01 # define DH_CHECK_PUBKEY_TOO_LARGE 0x02 +# define DH_CHECK_PUBKEY_INVALID 0x04 /* * primes p where (p-1)/2 is prime too are called "safe"; we define this for diff --git a/deps/openssl/openssl/include/openssl/dso.h b/deps/openssl/openssl/include/openssl/dso.h index 7c4a1dc4a620fb..c9013f5cea8b25 100644 --- a/deps/openssl/openssl/include/openssl/dso.h +++ b/deps/openssl/openssl/include/openssl/dso.h @@ -1,4 +1,4 @@ -/* dso.h -*- mode:C; c-file-style: "eay" -*- */ +/* dso.h */ /* * Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL project * 2000. diff --git a/deps/openssl/openssl/include/openssl/ec.h b/deps/openssl/openssl/include/openssl/ec.h index 6d3178f609f493..81e6faf6c5c502 100644 --- a/deps/openssl/openssl/include/openssl/ec.h +++ b/deps/openssl/openssl/include/openssl/ec.h @@ -106,7 +106,7 @@ typedef enum { /** the point is encoded as z||x, where the octet z specifies * which solution of the quadratic equation y is */ POINT_CONVERSION_COMPRESSED = 2, - /** the point is encoded as z||x||y, where z is the octet 0x02 */ + /** the point is encoded as z||x||y, where z is the octet 0x04 */ POINT_CONVERSION_UNCOMPRESSED = 4, /** the point is encoded as z||x||y, where the octet z specifies * which solution of the quadratic equation y is */ diff --git a/deps/openssl/openssl/include/openssl/ecdsa.h b/deps/openssl/openssl/include/openssl/ecdsa.h index c4016ac3e19b3f..a6f0930f829ccc 100644 --- a/deps/openssl/openssl/include/openssl/ecdsa.h +++ b/deps/openssl/openssl/include/openssl/ecdsa.h @@ -233,7 +233,7 @@ void *ECDSA_get_ex_data(EC_KEY *d, int idx); * \return pointer to a ECDSA_METHOD structure or NULL if an error occurred */ -ECDSA_METHOD *ECDSA_METHOD_new(ECDSA_METHOD *ecdsa_method); +ECDSA_METHOD *ECDSA_METHOD_new(const ECDSA_METHOD *ecdsa_method); /** frees a ECDSA_METHOD structure * \param ecdsa_method pointer to the ECDSA_METHOD structure diff --git a/deps/openssl/openssl/include/openssl/kssl.h b/deps/openssl/openssl/include/openssl/kssl.h index 9a5767280150c2..ae8a51f472daf2 100644 --- a/deps/openssl/openssl/include/openssl/kssl.h +++ b/deps/openssl/openssl/include/openssl/kssl.h @@ -1,4 +1,4 @@ -/* ssl/kssl.h -*- mode: C; c-file-style: "eay" -*- */ +/* ssl/kssl.h */ /* * Written by Vern Staats for the OpenSSL project * 2000. project 2000. diff --git a/deps/openssl/openssl/include/openssl/opensslv.h b/deps/openssl/openssl/include/openssl/opensslv.h index c06b13ac6b0f92..4334fd15cd8739 100644 --- a/deps/openssl/openssl/include/openssl/opensslv.h +++ b/deps/openssl/openssl/include/openssl/opensslv.h @@ -30,11 +30,11 @@ extern "C" { * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for * major minor fix final patch/beta) */ -# define OPENSSL_VERSION_NUMBER 0x1000204fL +# define OPENSSL_VERSION_NUMBER 0x1000207fL # ifdef OPENSSL_FIPS -# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2d-fips 9 Jul 2015" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2g-fips 1 Mar 2016" # else -# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2d 9 Jul 2015" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2g 1 Mar 2016" # endif # define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT diff --git a/deps/openssl/openssl/include/openssl/srp.h b/deps/openssl/openssl/include/openssl/srp.h index d072536fec9bb3..028892a1ff5e04 100644 --- a/deps/openssl/openssl/include/openssl/srp.h +++ b/deps/openssl/openssl/include/openssl/srp.h @@ -82,16 +82,21 @@ typedef struct SRP_gN_cache_st { DECLARE_STACK_OF(SRP_gN_cache) typedef struct SRP_user_pwd_st { + /* Owned by us. */ char *id; BIGNUM *s; BIGNUM *v; + /* Not owned by us. */ const BIGNUM *g; const BIGNUM *N; + /* Owned by us. */ char *info; } SRP_user_pwd; DECLARE_STACK_OF(SRP_user_pwd) +void SRP_user_pwd_free(SRP_user_pwd *user_pwd); + typedef struct SRP_VBASE_st { STACK_OF(SRP_user_pwd) *users_pwd; STACK_OF(SRP_gN_cache) *gN_cache; @@ -115,7 +120,12 @@ DECLARE_STACK_OF(SRP_gN) SRP_VBASE *SRP_VBASE_new(char *seed_key); int SRP_VBASE_free(SRP_VBASE *vb); int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file); + +/* This method ignores the configured seed and fails for an unknown user. */ SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username); +/* NOTE: unlike in SRP_VBASE_get_by_user, caller owns the returned pointer.*/ +SRP_user_pwd *SRP_VBASE_get1_by_user(SRP_VBASE *vb, char *username); + char *SRP_create_verifier(const char *user, const char *pass, char **salt, char **verifier, const char *N, const char *g); int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt, diff --git a/deps/openssl/openssl/include/openssl/ssl.h b/deps/openssl/openssl/include/openssl/ssl.h index 6fe1a2474d43a8..04d4007eeb8e5a 100644 --- a/deps/openssl/openssl/include/openssl/ssl.h +++ b/deps/openssl/openssl/include/openssl/ssl.h @@ -625,7 +625,7 @@ struct ssl_session_st { # define SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION 0x00040000L /* If set, always create a new key when using tmp_ecdh parameters */ # define SSL_OP_SINGLE_ECDH_USE 0x00080000L -/* If set, always create a new key when using tmp_dh parameters */ +/* Does nothing: retained for compatibility */ # define SSL_OP_SINGLE_DH_USE 0x00100000L /* Does nothing: retained for compatibiity */ # define SSL_OP_EPHEMERAL_RSA 0x0 @@ -2092,7 +2092,7 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) # define SSL_CTX_set1_sigalgs_list(ctx, s) \ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)s) # define SSL_set1_sigalgs(ctx, slist, slistlen) \ - SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS,clistlen,(int *)slist) + SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS,slistlen,(int *)slist) # define SSL_set1_sigalgs_list(ctx, s) \ SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)s) # define SSL_CTX_set1_client_sigalgs(ctx, slist, slistlen) \ @@ -2681,6 +2681,7 @@ void ERR_load_SSL_strings(void); # define SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC 292 # define SSL_F_SSL3_ENC 134 # define SSL_F_SSL3_GENERATE_KEY_BLOCK 238 +# define SSL_F_SSL3_GENERATE_MASTER_SECRET 388 # define SSL_F_SSL3_GET_CERTIFICATE_REQUEST 135 # define SSL_F_SSL3_GET_CERT_STATUS 289 # define SSL_F_SSL3_GET_CERT_VERIFY 136 @@ -2846,8 +2847,11 @@ void ERR_load_SSL_strings(void); # define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK 106 # define SSL_R_BAD_DECOMPRESSION 107 # define SSL_R_BAD_DH_G_LENGTH 108 +# define SSL_R_BAD_DH_G_VALUE 375 # define SSL_R_BAD_DH_PUB_KEY_LENGTH 109 +# define SSL_R_BAD_DH_PUB_KEY_VALUE 393 # define SSL_R_BAD_DH_P_LENGTH 110 +# define SSL_R_BAD_DH_P_VALUE 395 # define SSL_R_BAD_DIGEST_LENGTH 111 # define SSL_R_BAD_DSA_SIGNATURE 112 # define SSL_R_BAD_ECC_CERT 304 @@ -3052,6 +3056,7 @@ void ERR_load_SSL_strings(void); # define SSL_R_SERVERHELLO_TLSEXT 275 # define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 277 # define SSL_R_SHORT_READ 219 +# define SSL_R_SHUTDOWN_WHILE_IN_INIT 407 # define SSL_R_SIGNATURE_ALGORITHMS_ERROR 360 # define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE 220 # define SSL_R_SRP_A_CALC 361 diff --git a/deps/openssl/openssl/include/openssl/tls1.h b/deps/openssl/openssl/include/openssl/tls1.h index 5929607ff8b6ef..7e237d0631a3c4 100644 --- a/deps/openssl/openssl/include/openssl/tls1.h +++ b/deps/openssl/openssl/include/openssl/tls1.h @@ -231,13 +231,12 @@ extern "C" { /* ExtensionType value from RFC5620 */ # define TLSEXT_TYPE_heartbeat 15 -/* ExtensionType value from draft-ietf-tls-applayerprotoneg-00 */ +/* ExtensionType value from RFC7301 */ # define TLSEXT_TYPE_application_layer_protocol_negotiation 16 /* * ExtensionType value for TLS padding extension. - * http://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml - * http://tools.ietf.org/html/draft-agl-tls-padding-03 + * http://tools.ietf.org/html/draft-agl-tls-padding */ # define TLSEXT_TYPE_padding 21 @@ -262,20 +261,19 @@ extern "C" { # define TLSEXT_TYPE_next_proto_neg 13172 # endif -/* NameType value from RFC 3546 */ +/* NameType value from RFC3546 */ # define TLSEXT_NAMETYPE_host_name 0 -/* status request value from RFC 3546 */ +/* status request value from RFC3546 */ # define TLSEXT_STATUSTYPE_ocsp 1 -/* ECPointFormat values from draft-ietf-tls-ecc-12 */ +/* ECPointFormat values from RFC4492 */ # define TLSEXT_ECPOINTFORMAT_first 0 # define TLSEXT_ECPOINTFORMAT_uncompressed 0 # define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime 1 # define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2 2 # define TLSEXT_ECPOINTFORMAT_last 2 -/* Signature and hash algorithms from RFC 5246 */ - +/* Signature and hash algorithms from RFC5246 */ # define TLSEXT_signature_anonymous 0 # define TLSEXT_signature_rsa 1 # define TLSEXT_signature_dsa 2 @@ -430,7 +428,6 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) # define TLS1_CK_DHE_DSS_WITH_RC4_128_SHA 0x03000066 /* AES ciphersuites from RFC3268 */ - # define TLS1_CK_RSA_WITH_AES_128_SHA 0x0300002F # define TLS1_CK_DH_DSS_WITH_AES_128_SHA 0x03000030 # define TLS1_CK_DH_RSA_WITH_AES_128_SHA 0x03000031 @@ -595,7 +592,7 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) # define TLS1_TXT_DHE_RSA_WITH_AES_256_SHA "DHE-RSA-AES256-SHA" # define TLS1_TXT_ADH_WITH_AES_256_SHA "ADH-AES256-SHA" -/* ECC ciphersuites from draft-ietf-tls-ecc-01.txt (Mar 15, 2001) */ +/* ECC ciphersuites from RFC4492 */ # define TLS1_TXT_ECDH_ECDSA_WITH_NULL_SHA "ECDH-ECDSA-NULL-SHA" # define TLS1_TXT_ECDH_ECDSA_WITH_RC4_128_SHA "ECDH-ECDSA-RC4-SHA" # define TLS1_TXT_ECDH_ECDSA_WITH_DES_192_CBC3_SHA "ECDH-ECDSA-DES-CBC3-SHA" diff --git a/deps/openssl/openssl/include/openssl/ui.h b/deps/openssl/openssl/include/openssl/ui.h index b917edab3a7a38..0dc16330b8708a 100644 --- a/deps/openssl/openssl/include/openssl/ui.h +++ b/deps/openssl/openssl/include/openssl/ui.h @@ -1,4 +1,4 @@ -/* crypto/ui/ui.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/ui/ui.h */ /* * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project * 2001. diff --git a/deps/openssl/openssl/include/openssl/ui_compat.h b/deps/openssl/openssl/include/openssl/ui_compat.h index 42fb9ff6500f4d..bf541542c04112 100644 --- a/deps/openssl/openssl/include/openssl/ui_compat.h +++ b/deps/openssl/openssl/include/openssl/ui_compat.h @@ -1,4 +1,4 @@ -/* crypto/ui/ui.h -*- mode:C; c-file-style: "eay" -*- */ +/* crypto/ui/ui.h */ /* * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project * 2001. diff --git a/deps/openssl/openssl/include/openssl/x509_vfy.h b/deps/openssl/openssl/include/openssl/x509_vfy.h index bd8613c62ba429..2663e1c0a362aa 100644 --- a/deps/openssl/openssl/include/openssl/x509_vfy.h +++ b/deps/openssl/openssl/include/openssl/x509_vfy.h @@ -313,7 +313,7 @@ void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth); X509_LOOKUP_ctrl((x),X509_L_ADD_DIR,(name),(long)(type),NULL) # define X509_V_OK 0 -/* illegal error (for uninitialized values, to avoid X509_V_OK): 1 */ +# define X509_V_ERR_UNSPECIFIED 1 # define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT 2 # define X509_V_ERR_UNABLE_TO_GET_CRL 3 diff --git a/deps/openssl/openssl/ms/uplink-x86.pl b/deps/openssl/openssl/ms/uplink-x86.pl index 0dffc14fcd2ead..53b998d2708a9b 100755 --- a/deps/openssl/openssl/ms/uplink-x86.pl +++ b/deps/openssl/openssl/ms/uplink-x86.pl @@ -14,11 +14,11 @@ for ($i=1;$i<=$N;$i++) { &function_begin_B("_\$lazy${i}"); &lea ("eax",&DWP(&label("OPENSSL_UplinkTable"))); - &push ("eax"); &push ($i); + &push ("eax"); &call (&label("OPENSSL_Uplink")); - &add ("esp",8); &pop ("eax"); + &add ("esp",4); &jmp_ptr(&DWP(4*$i,"eax")); &function_end_B("_\$lazy${i}"); } diff --git a/deps/openssl/openssl/openssl.spec b/deps/openssl/openssl/openssl.spec index b721d657297a60..67fb0735e2bf76 100644 --- a/deps/openssl/openssl/openssl.spec +++ b/deps/openssl/openssl/openssl.spec @@ -6,7 +6,7 @@ Release: 1 Summary: Secure Sockets Layer and cryptography libraries and tools Name: openssl -Version: 1.0.2d +Version: 1.0.2g Source0: ftp://ftp.openssl.org/source/%{name}-%{version}.tar.gz License: OpenSSL Group: System Environment/Libraries diff --git a/deps/openssl/openssl/ssl/Makefile b/deps/openssl/openssl/ssl/Makefile index 42f1af5c8e932e..b6dee5b5ea522a 100644 --- a/deps/openssl/openssl/ssl/Makefile +++ b/deps/openssl/openssl/ssl/Makefile @@ -15,7 +15,7 @@ KRB5_INCLUDES= CFLAGS= $(INCLUDES) $(CFLAG) GENERAL=Makefile README ssl-lib.com install.com -TEST=ssltest.c heartbeat_test.c +TEST=ssltest.c heartbeat_test.c clienthellotest.c sslv2conftest.c APPS= LIB=$(TOP)/libssl.a @@ -399,14 +399,14 @@ s2_clnt.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h s2_clnt.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h s2_clnt.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h s2_clnt.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h -s2_clnt.o: ../include/openssl/pqueue.h ../include/openssl/rand.h -s2_clnt.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -s2_clnt.o: ../include/openssl/sha.h ../include/openssl/srtp.h -s2_clnt.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -s2_clnt.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h -s2_clnt.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -s2_clnt.o: ../include/openssl/tls1.h ../include/openssl/x509.h -s2_clnt.o: ../include/openssl/x509_vfy.h s2_clnt.c ssl_locl.h +s2_clnt.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h +s2_clnt.o: ../include/openssl/safestack.h ../include/openssl/sha.h +s2_clnt.o: ../include/openssl/srtp.h ../include/openssl/ssl.h +s2_clnt.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h +s2_clnt.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +s2_clnt.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h +s2_clnt.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h s2_clnt.c +s2_clnt.o: ssl_locl.h s2_enc.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h s2_enc.o: ../include/openssl/buffer.h ../include/openssl/comp.h s2_enc.o: ../include/openssl/crypto.h ../include/openssl/dsa.h @@ -435,18 +435,18 @@ s2_lib.o: ../include/openssl/ec.h ../include/openssl/ecdh.h s2_lib.o: ../include/openssl/ecdsa.h ../include/openssl/err.h s2_lib.o: ../include/openssl/evp.h ../include/openssl/hmac.h s2_lib.o: ../include/openssl/kssl.h ../include/openssl/lhash.h -s2_lib.o: ../include/openssl/md5.h ../include/openssl/obj_mac.h -s2_lib.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -s2_lib.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -s2_lib.o: ../include/openssl/pem.h ../include/openssl/pem2.h -s2_lib.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -s2_lib.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -s2_lib.o: ../include/openssl/sha.h ../include/openssl/srtp.h -s2_lib.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h -s2_lib.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h -s2_lib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -s2_lib.o: ../include/openssl/tls1.h ../include/openssl/x509.h -s2_lib.o: ../include/openssl/x509_vfy.h s2_lib.c ssl_locl.h +s2_lib.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +s2_lib.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +s2_lib.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +s2_lib.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +s2_lib.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h +s2_lib.o: ../include/openssl/safestack.h ../include/openssl/sha.h +s2_lib.o: ../include/openssl/srtp.h ../include/openssl/ssl.h +s2_lib.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h +s2_lib.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +s2_lib.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h +s2_lib.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h s2_lib.c +s2_lib.o: ssl_locl.h s2_meth.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h s2_meth.o: ../include/openssl/buffer.h ../include/openssl/comp.h s2_meth.o: ../include/openssl/crypto.h ../include/openssl/dsa.h @@ -487,20 +487,19 @@ s2_pkt.o: ../include/openssl/ssl3.h ../include/openssl/stack.h s2_pkt.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h s2_pkt.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h s2_pkt.c s2_pkt.o: ssl_locl.h -s2_srvr.o: ../crypto/constant_time_locl.h ../e_os.h ../include/openssl/asn1.h -s2_srvr.o: ../include/openssl/bio.h ../include/openssl/buffer.h -s2_srvr.o: ../include/openssl/comp.h ../include/openssl/crypto.h -s2_srvr.o: ../include/openssl/dsa.h ../include/openssl/dtls1.h -s2_srvr.o: ../include/openssl/e_os2.h ../include/openssl/ec.h -s2_srvr.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h -s2_srvr.o: ../include/openssl/err.h ../include/openssl/evp.h -s2_srvr.o: ../include/openssl/hmac.h ../include/openssl/kssl.h -s2_srvr.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h -s2_srvr.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -s2_srvr.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -s2_srvr.o: ../include/openssl/pem.h ../include/openssl/pem2.h -s2_srvr.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h -s2_srvr.o: ../include/openssl/rand.h ../include/openssl/rsa.h +s2_srvr.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h +s2_srvr.o: ../include/openssl/buffer.h ../include/openssl/comp.h +s2_srvr.o: ../include/openssl/crypto.h ../include/openssl/dsa.h +s2_srvr.o: ../include/openssl/dtls1.h ../include/openssl/e_os2.h +s2_srvr.o: ../include/openssl/ec.h ../include/openssl/ecdh.h +s2_srvr.o: ../include/openssl/ecdsa.h ../include/openssl/err.h +s2_srvr.o: ../include/openssl/evp.h ../include/openssl/hmac.h +s2_srvr.o: ../include/openssl/kssl.h ../include/openssl/lhash.h +s2_srvr.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +s2_srvr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +s2_srvr.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +s2_srvr.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +s2_srvr.o: ../include/openssl/pqueue.h ../include/openssl/rsa.h s2_srvr.o: ../include/openssl/safestack.h ../include/openssl/sha.h s2_srvr.o: ../include/openssl/srtp.h ../include/openssl/ssl.h s2_srvr.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h diff --git a/deps/openssl/openssl/ssl/bio_ssl.c b/deps/openssl/openssl/ssl/bio_ssl.c index a0c583e34215b8..d2d4d2ea2d2dbb 100644 --- a/deps/openssl/openssl/ssl/bio_ssl.c +++ b/deps/openssl/openssl/ssl/bio_ssl.c @@ -419,6 +419,10 @@ static long ssl_ctrl(BIO *b, int cmd, long num, void *ptr) BIO_set_flags(b, BIO_FLAGS_IO_SPECIAL | BIO_FLAGS_SHOULD_RETRY); b->retry_reason = b->next_bio->retry_reason; break; + case SSL_ERROR_WANT_X509_LOOKUP: + BIO_set_retry_special(b); + b->retry_reason = BIO_RR_SSL_X509_LOOKUP; + break; default: break; } diff --git a/deps/openssl/openssl/ssl/clienthellotest.c b/deps/openssl/openssl/ssl/clienthellotest.c new file mode 100644 index 00000000000000..77517c61b1f347 --- /dev/null +++ b/deps/openssl/openssl/ssl/clienthellotest.c @@ -0,0 +1,219 @@ +/* Written by Matt Caswell for the OpenSSL Project */ +/* ==================================================================== + * Copyright (c) 1998-2015 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#include + +#include +#include +#include +#include +#include + + +#define CLIENT_VERSION_LEN 2 +#define SESSION_ID_LEN_LEN 1 +#define CIPHERS_LEN_LEN 2 +#define COMPRESSION_LEN_LEN 1 +#define EXTENSIONS_LEN_LEN 2 +#define EXTENSION_TYPE_LEN 2 +#define EXTENSION_SIZE_LEN 2 + + +#define TOTAL_NUM_TESTS 2 + +/* + * Test that explicitly setting ticket data results in it appearing in the + * ClientHello for TLS1.2 + */ +#define TEST_SET_SESSION_TICK_DATA_TLS_1_2 0 + +/* + * Test that explicitly setting ticket data results in it appearing in the + * ClientHello for a negotiated SSL/TLS version + */ +#define TEST_SET_SESSION_TICK_DATA_VER_NEG 1 + +int main(int argc, char *argv[]) +{ + SSL_CTX *ctx; + SSL *con; + BIO *rbio; + BIO *wbio; + BIO *err; + long len; + unsigned char *data; + unsigned char *dataend; + char *dummytick = "Hello World!"; + unsigned int tmplen; + unsigned int type; + unsigned int size; + int testresult = 0; + int currtest = 0; + + SSL_library_init(); + SSL_load_error_strings(); + + err = BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT); + + CRYPTO_malloc_debug_init(); + CRYPTO_set_mem_debug_options(V_CRYPTO_MDEBUG_ALL); + CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); + + /* + * For each test set up an SSL_CTX and SSL and see what ClientHello gets + * produced when we try to connect + */ + for (; currtest < TOTAL_NUM_TESTS; currtest++) { + testresult = 0; + if (currtest == TEST_SET_SESSION_TICK_DATA_TLS_1_2) { + ctx = SSL_CTX_new(TLSv1_2_method()); + } else { + ctx = SSL_CTX_new(SSLv23_method()); + } + con = SSL_new(ctx); + + rbio = BIO_new(BIO_s_mem()); + wbio = BIO_new(BIO_s_mem()); + SSL_set_bio(con, rbio, wbio); + SSL_set_connect_state(con); + + if (currtest == TEST_SET_SESSION_TICK_DATA_TLS_1_2 + || currtest == TEST_SET_SESSION_TICK_DATA_VER_NEG) { + if (!SSL_set_session_ticket_ext(con, dummytick, strlen(dummytick))) + goto end; + } + + if (SSL_connect(con) > 0) { + /* This shouldn't succeed because we don't have a server! */ + goto end; + } + + len = BIO_get_mem_data(wbio, (char **)&data); + dataend = data + len; + + /* Skip the record header */ + data += SSL3_RT_HEADER_LENGTH; + /* Skip the handshake message header */ + data += SSL3_HM_HEADER_LENGTH; + /* Skip client version and random */ + data += CLIENT_VERSION_LEN + SSL3_RANDOM_SIZE; + if (data + SESSION_ID_LEN_LEN > dataend) + goto end; + /* Skip session id */ + tmplen = *data; + data += SESSION_ID_LEN_LEN + tmplen; + if (data + CIPHERS_LEN_LEN > dataend) + goto end; + /* Skip ciphers */ + tmplen = ((*data) << 8) | *(data + 1); + data += CIPHERS_LEN_LEN + tmplen; + if (data + COMPRESSION_LEN_LEN > dataend) + goto end; + /* Skip compression */ + tmplen = *data; + data += COMPRESSION_LEN_LEN + tmplen; + if (data + EXTENSIONS_LEN_LEN > dataend) + goto end; + /* Extensions len */ + tmplen = ((*data) << 8) | *(data + 1); + data += EXTENSIONS_LEN_LEN; + if (data + tmplen > dataend) + goto end; + + /* Loop through all extensions */ + while (tmplen > EXTENSION_TYPE_LEN + EXTENSION_SIZE_LEN) { + type = ((*data) << 8) | *(data + 1); + data += EXTENSION_TYPE_LEN; + size = ((*data) << 8) | *(data + 1); + data += EXTENSION_SIZE_LEN; + if (data + size > dataend) + goto end; + + if (type == TLSEXT_TYPE_session_ticket) { + if (currtest == TEST_SET_SESSION_TICK_DATA_TLS_1_2 + || currtest == TEST_SET_SESSION_TICK_DATA_VER_NEG) { + if (size == strlen(dummytick) + && memcmp(data, dummytick, size) == 0) { + /* Ticket data is as we expected */ + testresult = 1; + } else { + printf("Received session ticket is not as expected\n"); + } + break; + } + } + + tmplen -= EXTENSION_TYPE_LEN + EXTENSION_SIZE_LEN + size; + data += size; + } + + end: + SSL_free(con); + SSL_CTX_free(ctx); + if (!testresult) { + printf("ClientHello test: FAILED (Test %d)\n", currtest); + break; + } + } + + ERR_free_strings(); + ERR_remove_thread_state(NULL); + EVP_cleanup(); + CRYPTO_cleanup_all_ex_data(); + CRYPTO_mem_leaks(err); + BIO_free(err); + + return testresult?0:1; +} diff --git a/deps/openssl/openssl/ssl/d1_both.c b/deps/openssl/openssl/ssl/d1_both.c index b4ee7abe27dcb7..d1fc716d5c5c14 100644 --- a/deps/openssl/openssl/ssl/d1_both.c +++ b/deps/openssl/openssl/ssl/d1_both.c @@ -295,8 +295,44 @@ int dtls1_do_write(SSL *s, int type) blocksize = 0; frag_off = 0; + s->rwstate = SSL_NOTHING; + /* s->init_num shouldn't ever be < 0...but just in case */ while (s->init_num > 0) { + if (type == SSL3_RT_HANDSHAKE && s->init_off != 0) { + /* We must be writing a fragment other than the first one */ + + if (frag_off > 0) { + /* This is the first attempt at writing out this fragment */ + + if (s->init_off <= DTLS1_HM_HEADER_LENGTH) { + /* + * Each fragment that was already sent must at least have + * contained the message header plus one other byte. + * Therefore |init_off| must have progressed by at least + * |DTLS1_HM_HEADER_LENGTH + 1| bytes. If not something went + * wrong. + */ + return -1; + } + + /* + * Adjust |init_off| and |init_num| to allow room for a new + * message header for this fragment. + */ + s->init_off -= DTLS1_HM_HEADER_LENGTH; + s->init_num += DTLS1_HM_HEADER_LENGTH; + } else { + /* + * We must have been called again after a retry so use the + * fragment offset from our last attempt. We do not need + * to adjust |init_off| and |init_num| as above, because + * that should already have been done before the retry. + */ + frag_off = s->d1->w_msg_hdr.frag_off; + } + } + used_len = BIO_wpending(SSL_get_wbio(s)) + DTLS1_RT_HEADER_LENGTH + mac_size + blocksize; if (s->d1->mtu > used_len) @@ -309,8 +345,10 @@ int dtls1_do_write(SSL *s, int type) * grr.. we could get an error if MTU picked was wrong */ ret = BIO_flush(SSL_get_wbio(s)); - if (ret <= 0) + if (ret <= 0) { + s->rwstate = SSL_WRITING; return ret; + } used_len = DTLS1_RT_HEADER_LENGTH + mac_size + blocksize; if (s->d1->mtu > used_len + DTLS1_HM_HEADER_LENGTH) { curr_mtu = s->d1->mtu - used_len; @@ -336,25 +374,6 @@ int dtls1_do_write(SSL *s, int type) * XDTLS: this function is too long. split out the CCS part */ if (type == SSL3_RT_HANDSHAKE) { - if (s->init_off != 0) { - OPENSSL_assert(s->init_off > DTLS1_HM_HEADER_LENGTH); - s->init_off -= DTLS1_HM_HEADER_LENGTH; - s->init_num += DTLS1_HM_HEADER_LENGTH; - - /* - * We just checked that s->init_num > 0 so this cast should - * be safe - */ - if (((unsigned int)s->init_num) > curr_mtu) - len = curr_mtu; - else - len = s->init_num; - } - - /* Shouldn't ever happen */ - if (len > INT_MAX) - len = INT_MAX; - if (len < DTLS1_HM_HEADER_LENGTH) { /* * len is so small that we really can't do anything sensible @@ -442,7 +461,16 @@ int dtls1_do_write(SSL *s, int type) } s->init_off += ret; s->init_num -= ret; - frag_off += (ret -= DTLS1_HM_HEADER_LENGTH); + ret -= DTLS1_HM_HEADER_LENGTH; + frag_off += ret; + + /* + * We save the fragment offset for the next fragment so we have it + * available in case of an IO retry. We don't know the length of the + * next fragment yet so just set that to 0 for now. It will be + * updated again later. + */ + dtls1_fix_message_header(s, frag_off, 0); } } return (0); @@ -1370,9 +1398,12 @@ int dtls1_shutdown(SSL *s) { int ret; #ifndef OPENSSL_NO_SCTP - if (BIO_dgram_is_sctp(SSL_get_wbio(s)) && + BIO *wbio; + + wbio = SSL_get_wbio(s); + if (wbio != NULL && BIO_dgram_is_sctp(wbio) && !(s->shutdown & SSL_SENT_SHUTDOWN)) { - ret = BIO_dgram_sctp_wait_for_dry(SSL_get_wbio(s)); + ret = BIO_dgram_sctp_wait_for_dry(wbio); if (ret < 0) return -1; diff --git a/deps/openssl/openssl/ssl/d1_clnt.c b/deps/openssl/openssl/ssl/d1_clnt.c index 4c2ccbf5ae085f..3ddfa7bca4b79e 100644 --- a/deps/openssl/openssl/ssl/d1_clnt.c +++ b/deps/openssl/openssl/ssl/d1_clnt.c @@ -133,12 +133,14 @@ static int dtls1_get_hello_verify(SSL *s); static const SSL_METHOD *dtls1_get_client_method(int ver) { - if (ver == DTLS1_VERSION || ver == DTLS1_BAD_VER) - return (DTLSv1_client_method()); + if (ver == DTLS_ANY_VERSION) + return DTLS_client_method(); + else if (ver == DTLS1_VERSION || ver == DTLS1_BAD_VER) + return DTLSv1_client_method(); else if (ver == DTLS1_2_VERSION) - return (DTLSv1_2_client_method()); + return DTLSv1_2_client_method(); else - return (NULL); + return NULL; } IMPLEMENT_dtls1_meth_func(DTLS1_VERSION, @@ -147,13 +149,13 @@ IMPLEMENT_dtls1_meth_func(DTLS1_VERSION, dtls1_connect, dtls1_get_client_method, DTLSv1_enc_data) - IMPLEMENT_dtls1_meth_func(DTLS1_2_VERSION, +IMPLEMENT_dtls1_meth_func(DTLS1_2_VERSION, DTLSv1_2_client_method, ssl_undefined_function, dtls1_connect, dtls1_get_client_method, DTLSv1_2_enc_data) - IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION, +IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION, DTLS_client_method, ssl_undefined_function, dtls1_connect, @@ -315,13 +317,12 @@ int dtls1_connect(SSL *s) #endif case SSL3_ST_CW_CLNT_HELLO_A: - case SSL3_ST_CW_CLNT_HELLO_B: - s->shutdown = 0; /* every DTLS ClientHello resets Finished MAC */ ssl3_init_finished_mac(s); + case SSL3_ST_CW_CLNT_HELLO_B: dtls1_start_timer(s); ret = ssl3_client_hello(s); if (ret <= 0) @@ -366,11 +367,15 @@ int dtls1_connect(SSL *s) sizeof(DTLS1_SCTP_AUTH_LABEL), DTLS1_SCTP_AUTH_LABEL); - SSL_export_keying_material(s, sctpauthkey, + if (SSL_export_keying_material(s, sctpauthkey, sizeof(sctpauthkey), labelbuffer, sizeof(labelbuffer), NULL, 0, - 0); + 0) <= 0) { + ret = -1; + s->state = SSL_ST_ERR; + goto end; + } BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY, @@ -378,6 +383,10 @@ int dtls1_connect(SSL *s) #endif s->state = SSL3_ST_CR_FINISHED_A; + if (s->tlsext_ticket_expected) { + /* receive renewed session ticket */ + s->state = SSL3_ST_CR_SESSION_TICKET_A; + } } else s->state = DTLS1_ST_CR_HELLO_VERIFY_REQUEST_A; } @@ -500,9 +509,13 @@ int dtls1_connect(SSL *s) snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL), DTLS1_SCTP_AUTH_LABEL); - SSL_export_keying_material(s, sctpauthkey, + if (SSL_export_keying_material(s, sctpauthkey, sizeof(sctpauthkey), labelbuffer, - sizeof(labelbuffer), NULL, 0, 0); + sizeof(labelbuffer), NULL, 0, 0) <= 0) { + ret = -1; + s->state = SSL_ST_ERR; + goto end; + } BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY, sizeof(sctpauthkey), sctpauthkey); diff --git a/deps/openssl/openssl/ssl/d1_meth.c b/deps/openssl/openssl/ssl/d1_meth.c index 734077493f843b..899010e9851ce3 100644 --- a/deps/openssl/openssl/ssl/d1_meth.c +++ b/deps/openssl/openssl/ssl/d1_meth.c @@ -64,12 +64,14 @@ static const SSL_METHOD *dtls1_get_method(int ver); static const SSL_METHOD *dtls1_get_method(int ver) { - if (ver == DTLS1_VERSION) - return (DTLSv1_method()); + if (ver == DTLS_ANY_VERSION) + return DTLS_method(); + else if (ver == DTLS1_VERSION) + return DTLSv1_method(); else if (ver == DTLS1_2_VERSION) - return (DTLSv1_2_method()); + return DTLSv1_2_method(); else - return (NULL); + return NULL; } IMPLEMENT_dtls1_meth_func(DTLS1_VERSION, @@ -77,12 +79,12 @@ IMPLEMENT_dtls1_meth_func(DTLS1_VERSION, dtls1_accept, dtls1_connect, dtls1_get_method, DTLSv1_enc_data) - IMPLEMENT_dtls1_meth_func(DTLS1_2_VERSION, +IMPLEMENT_dtls1_meth_func(DTLS1_2_VERSION, DTLSv1_2_method, dtls1_accept, dtls1_connect, dtls1_get_method, DTLSv1_2_enc_data) - IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION, +IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION, DTLS_method, dtls1_accept, dtls1_connect, dtls1_get_method, DTLSv1_2_enc_data) diff --git a/deps/openssl/openssl/ssl/d1_srvr.c b/deps/openssl/openssl/ssl/d1_srvr.c index 655333a25210d7..e677d880f0ac92 100644 --- a/deps/openssl/openssl/ssl/d1_srvr.c +++ b/deps/openssl/openssl/ssl/d1_srvr.c @@ -131,12 +131,14 @@ static int dtls1_send_hello_verify_request(SSL *s); static const SSL_METHOD *dtls1_get_server_method(int ver) { - if (ver == DTLS1_VERSION) - return (DTLSv1_server_method()); + if (ver == DTLS_ANY_VERSION) + return DTLS_server_method(); + else if (ver == DTLS1_VERSION) + return DTLSv1_server_method(); else if (ver == DTLS1_2_VERSION) - return (DTLSv1_2_server_method()); + return DTLSv1_2_server_method(); else - return (NULL); + return NULL; } IMPLEMENT_dtls1_meth_func(DTLS1_VERSION, @@ -145,13 +147,13 @@ IMPLEMENT_dtls1_meth_func(DTLS1_VERSION, ssl_undefined_function, dtls1_get_server_method, DTLSv1_enc_data) - IMPLEMENT_dtls1_meth_func(DTLS1_2_VERSION, +IMPLEMENT_dtls1_meth_func(DTLS1_2_VERSION, DTLSv1_2_server_method, dtls1_accept, ssl_undefined_function, dtls1_get_server_method, DTLSv1_2_enc_data) - IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION, +IMPLEMENT_dtls1_meth_func(DTLS_ANY_VERSION, DTLS_server_method, dtls1_accept, ssl_undefined_function, @@ -283,6 +285,19 @@ int dtls1_accept(SSL *s) ssl3_init_finished_mac(s); s->state = SSL3_ST_SR_CLNT_HELLO_A; s->ctx->stats.sess_accept++; + } else if (!s->s3->send_connection_binding && + !(s->options & + SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION)) { + /* + * Server attempting to renegotiate with client that doesn't + * support secure renegotiation. + */ + SSLerr(SSL_F_DTLS1_ACCEPT, + SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED); + ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); + ret = -1; + s->state = SSL_ST_ERR; + goto end; } else { /* * s->state == SSL_ST_RENEGOTIATE, we will just send a @@ -421,9 +436,13 @@ int dtls1_accept(SSL *s) snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL), DTLS1_SCTP_AUTH_LABEL); - SSL_export_keying_material(s, sctpauthkey, - sizeof(sctpauthkey), labelbuffer, - sizeof(labelbuffer), NULL, 0, 0); + if (SSL_export_keying_material(s, sctpauthkey, + sizeof(sctpauthkey), labelbuffer, + sizeof(labelbuffer), NULL, 0, 0) <= 0) { + ret = -1; + s->state = SSL_ST_ERR; + goto end; + } BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY, sizeof(sctpauthkey), sctpauthkey); @@ -635,9 +654,13 @@ int dtls1_accept(SSL *s) snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL), DTLS1_SCTP_AUTH_LABEL); - SSL_export_keying_material(s, sctpauthkey, + if (SSL_export_keying_material(s, sctpauthkey, sizeof(sctpauthkey), labelbuffer, - sizeof(labelbuffer), NULL, 0, 0); + sizeof(labelbuffer), NULL, 0, 0) <= 0) { + ret = -1; + s->state = SSL_ST_ERR; + goto end; + } BIO_ctrl(SSL_get_wbio(s), BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY, sizeof(sctpauthkey), sctpauthkey); diff --git a/deps/openssl/openssl/ssl/kssl.c b/deps/openssl/openssl/ssl/kssl.c index cf585679dcccfe..f2839bdcd7f53f 100644 --- a/deps/openssl/openssl/ssl/kssl.c +++ b/deps/openssl/openssl/ssl/kssl.c @@ -1,4 +1,4 @@ -/* ssl/kssl.c -*- mode: C; c-file-style: "eay" -*- */ +/* ssl/kssl.c */ /* * Written by Vern Staats for the OpenSSL project * 2000. diff --git a/deps/openssl/openssl/ssl/kssl.h b/deps/openssl/openssl/ssl/kssl.h index 9a5767280150c2..ae8a51f472daf2 100644 --- a/deps/openssl/openssl/ssl/kssl.h +++ b/deps/openssl/openssl/ssl/kssl.h @@ -1,4 +1,4 @@ -/* ssl/kssl.h -*- mode: C; c-file-style: "eay" -*- */ +/* ssl/kssl.h */ /* * Written by Vern Staats for the OpenSSL project * 2000. project 2000. diff --git a/deps/openssl/openssl/ssl/kssl_lcl.h b/deps/openssl/openssl/ssl/kssl_lcl.h index 46dcef22d16c86..8e6a6d69e9497c 100644 --- a/deps/openssl/openssl/ssl/kssl_lcl.h +++ b/deps/openssl/openssl/ssl/kssl_lcl.h @@ -1,4 +1,4 @@ -/* ssl/kssl.h -*- mode: C; c-file-style: "eay" -*- */ +/* ssl/kssl.h */ /* * Written by Vern Staats for the OpenSSL project * 2000. project 2000. diff --git a/deps/openssl/openssl/ssl/s23_clnt.c b/deps/openssl/openssl/ssl/s23_clnt.c index e4e707cf687e7b..f782010c4782c8 100644 --- a/deps/openssl/openssl/ssl/s23_clnt.c +++ b/deps/openssl/openssl/ssl/s23_clnt.c @@ -375,12 +375,13 @@ static int ssl23_client_hello(SSL *s) buf = (unsigned char *)s->init_buf->data; if (s->state == SSL23_ST_CW_CLNT_HELLO_A) { -#if 0 - /* don't reuse session-id's */ + /* + * Since we're sending s23 client hello, we're not reusing a session, as + * we'd be using the method from the saved session instead + */ if (!ssl_get_new_session(s, 0)) { - return (-1); + return -1; } -#endif p = s->s3->client_random; if (ssl_fill_hello_random(s, 0, p, SSL3_RANDOM_SIZE) <= 0) @@ -445,9 +446,6 @@ static int ssl23_client_hello(SSL *s) /* * put in the session-id length (zero since there is no reuse) */ -#if 0 - s->session->session_id_length = 0; -#endif s2n(0, d); if (s->options & SSL_OP_NETSCAPE_CHALLENGE_BUG) @@ -738,6 +736,8 @@ static int ssl23_get_server_hello(SSL *s) goto err; } + s->session->ssl_version = s->version; + /* ensure that TLS_MAX_VERSION is up-to-date */ OPENSSL_assert(s->version <= TLS_MAX_VERSION); @@ -796,13 +796,6 @@ static int ssl23_get_server_hello(SSL *s) } s->init_num = 0; - /* - * Since, if we are sending a ssl23 client hello, we are not reusing a - * session-id - */ - if (!ssl_get_new_session(s, 0)) - goto err; - return (SSL_connect(s)); err: return (-1); diff --git a/deps/openssl/openssl/ssl/s2_lib.c b/deps/openssl/openssl/ssl/s2_lib.c index d55b93f76bb7f8..a8036b357f0e93 100644 --- a/deps/openssl/openssl/ssl/s2_lib.c +++ b/deps/openssl/openssl/ssl/s2_lib.c @@ -156,6 +156,7 @@ OPENSSL_GLOBAL const SSL_CIPHER ssl2_ciphers[] = { 128, }, +# if 0 /* RC4_128_EXPORT40_WITH_MD5 */ { 1, @@ -171,6 +172,7 @@ OPENSSL_GLOBAL const SSL_CIPHER ssl2_ciphers[] = { 40, 128, }, +# endif /* RC2_128_CBC_WITH_MD5 */ { @@ -188,6 +190,7 @@ OPENSSL_GLOBAL const SSL_CIPHER ssl2_ciphers[] = { 128, }, +# if 0 /* RC2_128_CBC_EXPORT40_WITH_MD5 */ { 1, @@ -203,6 +206,7 @@ OPENSSL_GLOBAL const SSL_CIPHER ssl2_ciphers[] = { 40, 128, }, +# endif # ifndef OPENSSL_NO_IDEA /* IDEA_128_CBC_WITH_MD5 */ @@ -222,6 +226,7 @@ OPENSSL_GLOBAL const SSL_CIPHER ssl2_ciphers[] = { }, # endif +# if 0 /* DES_64_CBC_WITH_MD5 */ { 1, @@ -237,6 +242,7 @@ OPENSSL_GLOBAL const SSL_CIPHER ssl2_ciphers[] = { 56, 56, }, +# endif /* DES_192_EDE3_CBC_WITH_MD5 */ { diff --git a/deps/openssl/openssl/ssl/s2_srvr.c b/deps/openssl/openssl/ssl/s2_srvr.c index 4289272b73d3dc..07e9df82820a9e 100644 --- a/deps/openssl/openssl/ssl/s2_srvr.c +++ b/deps/openssl/openssl/ssl/s2_srvr.c @@ -402,7 +402,7 @@ static int get_client_master_key(SSL *s) } cp = ssl2_get_cipher_by_char(p); - if (cp == NULL) { + if (cp == NULL || sk_SSL_CIPHER_find(s->session->ciphers, cp) < 0) { ssl2_return_error(s, SSL2_PE_NO_CIPHER); SSLerr(SSL_F_GET_CLIENT_MASTER_KEY, SSL_R_NO_CIPHER_MATCH); return (-1); @@ -598,6 +598,11 @@ static int get_client_hello(SSL *s) s->s2->tmp.cipher_spec_length = i; n2s(p, i); s->s2->tmp.session_id_length = i; + if ((i < 0) || (i > SSL_MAX_SSL_SESSION_ID_LENGTH)) { + ssl2_return_error(s, SSL2_PE_UNDEFINED_ERROR); + SSLerr(SSL_F_GET_CLIENT_HELLO, SSL_R_LENGTH_MISMATCH); + return -1; + } n2s(p, i); s->s2->challenge_length = i; if ((i < SSL2_MIN_CHALLENGE_LENGTH) || @@ -687,8 +692,12 @@ static int get_client_hello(SSL *s) prio = cs; allow = cl; } + + /* Generate list of SSLv2 ciphers shared between client and server */ for (z = 0; z < sk_SSL_CIPHER_num(prio); z++) { - if (sk_SSL_CIPHER_find(allow, sk_SSL_CIPHER_value(prio, z)) < 0) { + const SSL_CIPHER *cp = sk_SSL_CIPHER_value(prio, z); + if ((cp->algorithm_ssl & SSL_SSLV2) == 0 || + sk_SSL_CIPHER_find(allow, cp) < 0) { (void)sk_SSL_CIPHER_delete(prio, z); z--; } @@ -697,6 +706,13 @@ static int get_client_hello(SSL *s) sk_SSL_CIPHER_free(s->session->ciphers); s->session->ciphers = prio; } + + /* Make sure we have at least one cipher in common */ + if (sk_SSL_CIPHER_num(s->session->ciphers) == 0) { + ssl2_return_error(s, SSL2_PE_NO_CIPHER); + SSLerr(SSL_F_GET_CLIENT_HELLO, SSL_R_NO_CIPHER_MATCH); + return -1; + } /* * s->session->ciphers should now have a list of ciphers that are on * both the client and server. This list is ordered by the order the diff --git a/deps/openssl/openssl/ssl/s3_both.c b/deps/openssl/openssl/ssl/s3_both.c index 019e21cd02741c..09d0661e81f64e 100644 --- a/deps/openssl/openssl/ssl/s3_both.c +++ b/deps/openssl/openssl/ssl/s3_both.c @@ -648,7 +648,7 @@ int ssl3_setup_read_buffer(SSL *s) unsigned char *p; size_t len, align = 0, headerlen; - if (SSL_version(s) == DTLS1_VERSION || SSL_version(s) == DTLS1_BAD_VER) + if (SSL_IS_DTLS(s)) headerlen = DTLS1_RT_HEADER_LENGTH; else headerlen = SSL3_RT_HEADER_LENGTH; @@ -687,7 +687,7 @@ int ssl3_setup_write_buffer(SSL *s) unsigned char *p; size_t len, align = 0, headerlen; - if (SSL_version(s) == DTLS1_VERSION || SSL_version(s) == DTLS1_BAD_VER) + if (SSL_IS_DTLS(s)) headerlen = DTLS1_RT_HEADER_LENGTH + 1; else headerlen = SSL3_RT_HEADER_LENGTH; diff --git a/deps/openssl/openssl/ssl/s3_cbc.c b/deps/openssl/openssl/ssl/s3_cbc.c index a0edcef90ada1b..557622f51365d2 100644 --- a/deps/openssl/openssl/ssl/s3_cbc.c +++ b/deps/openssl/openssl/ssl/s3_cbc.c @@ -411,8 +411,9 @@ char ssl3_cbc_record_digest_supported(const EVP_MD_CTX *ctx) * functions, above, we know that data_plus_mac_size is large enough to contain * a padding byte and MAC. (If the padding was invalid, it might contain the * padding too. ) + * Returns 1 on success or 0 on error */ -void ssl3_cbc_digest_record(const EVP_MD_CTX *ctx, +int ssl3_cbc_digest_record(const EVP_MD_CTX *ctx, unsigned char *md_out, size_t *md_out_size, const unsigned char header[13], @@ -455,7 +456,8 @@ void ssl3_cbc_digest_record(const EVP_MD_CTX *ctx, switch (EVP_MD_CTX_type(ctx)) { case NID_md5: - MD5_Init((MD5_CTX *)md_state.c); + if (MD5_Init((MD5_CTX *)md_state.c) <= 0) + return 0; md_final_raw = tls1_md5_final_raw; md_transform = (void (*)(void *ctx, const unsigned char *block))MD5_Transform; @@ -464,7 +466,8 @@ void ssl3_cbc_digest_record(const EVP_MD_CTX *ctx, length_is_big_endian = 0; break; case NID_sha1: - SHA1_Init((SHA_CTX *)md_state.c); + if (SHA1_Init((SHA_CTX *)md_state.c) <= 0) + return 0; md_final_raw = tls1_sha1_final_raw; md_transform = (void (*)(void *ctx, const unsigned char *block))SHA1_Transform; @@ -472,14 +475,16 @@ void ssl3_cbc_digest_record(const EVP_MD_CTX *ctx, break; #ifndef OPENSSL_NO_SHA256 case NID_sha224: - SHA224_Init((SHA256_CTX *)md_state.c); + if (SHA224_Init((SHA256_CTX *)md_state.c) <= 0) + return 0; md_final_raw = tls1_sha256_final_raw; md_transform = (void (*)(void *ctx, const unsigned char *block))SHA256_Transform; md_size = 224 / 8; break; case NID_sha256: - SHA256_Init((SHA256_CTX *)md_state.c); + if (SHA256_Init((SHA256_CTX *)md_state.c) <= 0) + return 0; md_final_raw = tls1_sha256_final_raw; md_transform = (void (*)(void *ctx, const unsigned char *block))SHA256_Transform; @@ -488,7 +493,8 @@ void ssl3_cbc_digest_record(const EVP_MD_CTX *ctx, #endif #ifndef OPENSSL_NO_SHA512 case NID_sha384: - SHA384_Init((SHA512_CTX *)md_state.c); + if (SHA384_Init((SHA512_CTX *)md_state.c) <= 0) + return 0; md_final_raw = tls1_sha512_final_raw; md_transform = (void (*)(void *ctx, const unsigned char *block))SHA512_Transform; @@ -497,7 +503,8 @@ void ssl3_cbc_digest_record(const EVP_MD_CTX *ctx, md_length_size = 16; break; case NID_sha512: - SHA512_Init((SHA512_CTX *)md_state.c); + if (SHA512_Init((SHA512_CTX *)md_state.c) <= 0) + return 0; md_final_raw = tls1_sha512_final_raw; md_transform = (void (*)(void *ctx, const unsigned char *block))SHA512_Transform; @@ -513,8 +520,8 @@ void ssl3_cbc_digest_record(const EVP_MD_CTX *ctx, */ OPENSSL_assert(0); if (md_out_size) - *md_out_size = -1; - return; + *md_out_size = 0; + return 0; } OPENSSL_assert(md_length_size <= MAX_HASH_BIT_COUNT_BYTES); @@ -652,7 +659,7 @@ void ssl3_cbc_digest_record(const EVP_MD_CTX *ctx, */ if (header_length <= md_block_size) { /* Should never happen */ - return; + return 0; } overhang = header_length - md_block_size; md_transform(md_state.c, header); @@ -733,26 +740,34 @@ void ssl3_cbc_digest_record(const EVP_MD_CTX *ctx, } EVP_MD_CTX_init(&md_ctx); - EVP_DigestInit_ex(&md_ctx, ctx->digest, NULL /* engine */ ); + if (EVP_DigestInit_ex(&md_ctx, ctx->digest, NULL /* engine */ ) <= 0) + goto err; if (is_sslv3) { /* We repurpose |hmac_pad| to contain the SSLv3 pad2 block. */ memset(hmac_pad, 0x5c, sslv3_pad_length); - EVP_DigestUpdate(&md_ctx, mac_secret, mac_secret_length); - EVP_DigestUpdate(&md_ctx, hmac_pad, sslv3_pad_length); - EVP_DigestUpdate(&md_ctx, mac_out, md_size); + if (EVP_DigestUpdate(&md_ctx, mac_secret, mac_secret_length) <= 0 + || EVP_DigestUpdate(&md_ctx, hmac_pad, sslv3_pad_length) <= 0 + || EVP_DigestUpdate(&md_ctx, mac_out, md_size) <= 0) + goto err; } else { /* Complete the HMAC in the standard manner. */ for (i = 0; i < md_block_size; i++) hmac_pad[i] ^= 0x6a; - EVP_DigestUpdate(&md_ctx, hmac_pad, md_block_size); - EVP_DigestUpdate(&md_ctx, mac_out, md_size); + if (EVP_DigestUpdate(&md_ctx, hmac_pad, md_block_size) <= 0 + || EVP_DigestUpdate(&md_ctx, mac_out, md_size) <= 0) + goto err; } EVP_DigestFinal(&md_ctx, md_out, &md_out_size_u); if (md_out_size) *md_out_size = md_out_size_u; EVP_MD_CTX_cleanup(&md_ctx); + + return 1; +err: + EVP_MD_CTX_cleanup(&md_ctx); + return 0; } #ifdef OPENSSL_FIPS diff --git a/deps/openssl/openssl/ssl/s3_clnt.c b/deps/openssl/openssl/ssl/s3_clnt.c index 6af145a8b744da..04cc9f54a92dff 100644 --- a/deps/openssl/openssl/ssl/s3_clnt.c +++ b/deps/openssl/openssl/ssl/s3_clnt.c @@ -1050,6 +1050,11 @@ int ssl3_get_server_hello(SSL *s) SSLerr(SSL_F_SSL3_GET_SERVER_HELLO, SSL_R_UNKNOWN_CIPHER_RETURNED); goto f_err; } + /* Set version disabled mask now we know version */ + if (!SSL_USE_TLS1_2_CIPHERS(s)) + ct->mask_ssl = SSL_TLSV1_2; + else + ct->mask_ssl = 0; /* * If it is a disabled cipher we didn't send it in client hello, so * return an error. @@ -1699,6 +1704,12 @@ int ssl3_get_key_exchange(SSL *s) } p += i; + if (BN_is_zero(dh->p)) { + SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_BAD_DH_P_VALUE); + goto f_err; + } + + if (2 > n - param_len) { SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_LENGTH_TOO_SHORT); goto f_err; @@ -1719,6 +1730,11 @@ int ssl3_get_key_exchange(SSL *s) } p += i; + if (BN_is_zero(dh->g)) { + SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_BAD_DH_G_VALUE); + goto f_err; + } + if (2 > n - param_len) { SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_LENGTH_TOO_SHORT); goto f_err; @@ -1740,6 +1756,11 @@ int ssl3_get_key_exchange(SSL *s) p += i; n -= param_len; + if (BN_is_zero(dh->pub_key)) { + SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, SSL_R_BAD_DH_PUB_KEY_VALUE); + goto f_err; + } + # ifndef OPENSSL_NO_RSA if (alg_a & SSL_aRSA) pkey = @@ -1935,14 +1956,20 @@ int ssl3_get_key_exchange(SSL *s) q = md_buf; for (num = 2; num > 0; num--) { EVP_MD_CTX_set_flags(&md_ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); - EVP_DigestInit_ex(&md_ctx, (num == 2) - ? s->ctx->md5 : s->ctx->sha1, NULL); - EVP_DigestUpdate(&md_ctx, &(s->s3->client_random[0]), - SSL3_RANDOM_SIZE); - EVP_DigestUpdate(&md_ctx, &(s->s3->server_random[0]), - SSL3_RANDOM_SIZE); - EVP_DigestUpdate(&md_ctx, param, param_len); - EVP_DigestFinal_ex(&md_ctx, q, &size); + if (EVP_DigestInit_ex(&md_ctx, + (num == 2) ? s->ctx->md5 : s->ctx->sha1, + NULL) <= 0 + || EVP_DigestUpdate(&md_ctx, &(s->s3->client_random[0]), + SSL3_RANDOM_SIZE) <= 0 + || EVP_DigestUpdate(&md_ctx, &(s->s3->server_random[0]), + SSL3_RANDOM_SIZE) <= 0 + || EVP_DigestUpdate(&md_ctx, param, param_len) <= 0 + || EVP_DigestFinal_ex(&md_ctx, q, &size) <= 0) { + SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, + ERR_R_INTERNAL_ERROR); + al = SSL_AD_INTERNAL_ERROR; + goto f_err; + } q += size; j += size; } @@ -1961,12 +1988,16 @@ int ssl3_get_key_exchange(SSL *s) } else #endif { - EVP_VerifyInit_ex(&md_ctx, md, NULL); - EVP_VerifyUpdate(&md_ctx, &(s->s3->client_random[0]), - SSL3_RANDOM_SIZE); - EVP_VerifyUpdate(&md_ctx, &(s->s3->server_random[0]), - SSL3_RANDOM_SIZE); - EVP_VerifyUpdate(&md_ctx, param, param_len); + if (EVP_VerifyInit_ex(&md_ctx, md, NULL) <= 0 + || EVP_VerifyUpdate(&md_ctx, &(s->s3->client_random[0]), + SSL3_RANDOM_SIZE) <= 0 + || EVP_VerifyUpdate(&md_ctx, &(s->s3->server_random[0]), + SSL3_RANDOM_SIZE) <= 0 + || EVP_VerifyUpdate(&md_ctx, param, param_len) <= 0) { + al = SSL_AD_INTERNAL_ERROR; + SSLerr(SSL_F_SSL3_GET_KEY_EXCHANGE, ERR_R_EVP_LIB); + goto f_err; + } if (EVP_VerifyFinal(&md_ctx, p, (int)n, pkey) <= 0) { /* bad signature */ al = SSL_AD_DECRYPT_ERROR; @@ -2208,6 +2239,7 @@ int ssl3_get_new_session_ticket(SSL *s) long n; const unsigned char *p; unsigned char *d; + unsigned long ticket_lifetime_hint; n = s->method->ssl_get_message(s, SSL3_ST_CR_SESSION_TICKET_A, @@ -2226,6 +2258,19 @@ int ssl3_get_new_session_ticket(SSL *s) p = d = (unsigned char *)s->init_msg; + n2l(p, ticket_lifetime_hint); + n2s(p, ticklen); + /* ticket_lifetime_hint + ticket_length + ticket */ + if (ticklen + 6 != n) { + al = SSL_AD_DECODE_ERROR; + SSLerr(SSL_F_SSL3_GET_NEW_SESSION_TICKET, SSL_R_LENGTH_MISMATCH); + goto f_err; + } + + /* Server is allowed to change its mind and send an empty ticket. */ + if (ticklen == 0) + return 1; + if (s->session->session_id_length > 0) { int i = s->session_ctx->session_cache_mode; SSL_SESSION *new_sess; @@ -2257,14 +2302,6 @@ int ssl3_get_new_session_ticket(SSL *s) s->session = new_sess; } - n2l(p, s->session->tlsext_tick_lifetime_hint); - n2s(p, ticklen); - /* ticket_lifetime_hint + ticket_length + ticket */ - if (ticklen + 6 != n) { - al = SSL_AD_DECODE_ERROR; - SSLerr(SSL_F_SSL3_GET_NEW_SESSION_TICKET, SSL_R_LENGTH_MISMATCH); - goto f_err; - } if (s->session->tlsext_tick) { OPENSSL_free(s->session->tlsext_tick); s->session->tlsext_ticklen = 0; @@ -2275,6 +2312,7 @@ int ssl3_get_new_session_ticket(SSL *s) goto err; } memcpy(s->session->tlsext_tick, p, ticklen); + s->session->tlsext_tick_lifetime_hint = ticket_lifetime_hint; s->session->tlsext_ticklen = ticklen; /* * There are two ways to detect a resumed ticket session. One is to set @@ -2312,37 +2350,44 @@ int ssl3_get_cert_status(SSL *s) n = s->method->ssl_get_message(s, SSL3_ST_CR_CERT_STATUS_A, SSL3_ST_CR_CERT_STATUS_B, - SSL3_MT_CERTIFICATE_STATUS, 16384, &ok); + -1, 16384, &ok); if (!ok) return ((int)n); - if (n < 4) { - /* need at least status type + length */ - al = SSL_AD_DECODE_ERROR; - SSLerr(SSL_F_SSL3_GET_CERT_STATUS, SSL_R_LENGTH_MISMATCH); - goto f_err; - } - p = (unsigned char *)s->init_msg; - if (*p++ != TLSEXT_STATUSTYPE_ocsp) { - al = SSL_AD_DECODE_ERROR; - SSLerr(SSL_F_SSL3_GET_CERT_STATUS, SSL_R_UNSUPPORTED_STATUS_TYPE); - goto f_err; - } - n2l3(p, resplen); - if (resplen + 4 != n) { - al = SSL_AD_DECODE_ERROR; - SSLerr(SSL_F_SSL3_GET_CERT_STATUS, SSL_R_LENGTH_MISMATCH); - goto f_err; - } - if (s->tlsext_ocsp_resp) - OPENSSL_free(s->tlsext_ocsp_resp); - s->tlsext_ocsp_resp = BUF_memdup(p, resplen); - if (!s->tlsext_ocsp_resp) { - al = SSL_AD_INTERNAL_ERROR; - SSLerr(SSL_F_SSL3_GET_CERT_STATUS, ERR_R_MALLOC_FAILURE); - goto f_err; + + if (s->s3->tmp.message_type != SSL3_MT_CERTIFICATE_STATUS) { + /* + * The CertificateStatus message is optional even if + * tlsext_status_expected is set + */ + s->s3->tmp.reuse_message = 1; + } else { + if (n < 4) { + /* need at least status type + length */ + al = SSL_AD_DECODE_ERROR; + SSLerr(SSL_F_SSL3_GET_CERT_STATUS, SSL_R_LENGTH_MISMATCH); + goto f_err; + } + p = (unsigned char *)s->init_msg; + if (*p++ != TLSEXT_STATUSTYPE_ocsp) { + al = SSL_AD_DECODE_ERROR; + SSLerr(SSL_F_SSL3_GET_CERT_STATUS, SSL_R_UNSUPPORTED_STATUS_TYPE); + goto f_err; + } + n2l3(p, resplen); + if (resplen + 4 != n) { + al = SSL_AD_DECODE_ERROR; + SSLerr(SSL_F_SSL3_GET_CERT_STATUS, SSL_R_LENGTH_MISMATCH); + goto f_err; + } + s->tlsext_ocsp_resp = BUF_memdup(p, resplen); + if (s->tlsext_ocsp_resp == NULL) { + al = SSL_AD_INTERNAL_ERROR; + SSLerr(SSL_F_SSL3_GET_CERT_STATUS, ERR_R_MALLOC_FAILURE); + goto f_err; + } + s->tlsext_ocsp_resplen = resplen; } - s->tlsext_ocsp_resplen = resplen; if (s->ctx->tlsext_status_cb) { int ret; ret = s->ctx->tlsext_status_cb(s, s->ctx->tlsext_status_arg); @@ -2462,6 +2507,7 @@ int ssl3_send_client_key_exchange(SSL *s) || (pkey->pkey.rsa == NULL)) { SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR); + EVP_PKEY_free(pkey); goto err; } rsa = pkey->pkey.rsa; @@ -2927,6 +2973,11 @@ int ssl3_send_client_key_exchange(SSL *s) pkey_ctx = EVP_PKEY_CTX_new(pub_key = X509_get_pubkey(peer_cert), NULL); + if (pkey_ctx == NULL) { + SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE, + ERR_R_MALLOC_FAILURE); + goto err; + } /* * If we have send a certificate, and certificate key * @@ -2936,10 +2987,13 @@ int ssl3_send_client_key_exchange(SSL *s) /* Otherwise, generate ephemeral key pair */ - EVP_PKEY_encrypt_init(pkey_ctx); - /* Generate session key */ - if (RAND_bytes(premaster_secret, 32) <= 0) { + if (pkey_ctx == NULL + || EVP_PKEY_encrypt_init(pkey_ctx) <= 0 + /* Generate session key */ + || RAND_bytes(premaster_secret, 32) <= 0) { EVP_PKEY_CTX_free(pkey_ctx); + SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE, + ERR_R_INTERNAL_ERROR); goto err; } /* @@ -2960,13 +3014,18 @@ int ssl3_send_client_key_exchange(SSL *s) * data */ ukm_hash = EVP_MD_CTX_create(); - EVP_DigestInit(ukm_hash, - EVP_get_digestbynid(NID_id_GostR3411_94)); - EVP_DigestUpdate(ukm_hash, s->s3->client_random, - SSL3_RANDOM_SIZE); - EVP_DigestUpdate(ukm_hash, s->s3->server_random, - SSL3_RANDOM_SIZE); - EVP_DigestFinal_ex(ukm_hash, shared_ukm, &md_len); + if (EVP_DigestInit(ukm_hash, + EVP_get_digestbynid(NID_id_GostR3411_94)) <= 0 + || EVP_DigestUpdate(ukm_hash, s->s3->client_random, + SSL3_RANDOM_SIZE) <= 0 + || EVP_DigestUpdate(ukm_hash, s->s3->server_random, + SSL3_RANDOM_SIZE) <= 0 + || EVP_DigestFinal_ex(ukm_hash, shared_ukm, &md_len) <= 0) { + EVP_MD_CTX_destroy(ukm_hash); + SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE, + ERR_R_INTERNAL_ERROR); + goto err; + } EVP_MD_CTX_destroy(ukm_hash); if (EVP_PKEY_CTX_ctrl (pkey_ctx, -1, EVP_PKEY_OP_ENCRYPT, EVP_PKEY_CTRL_SET_IV, 8, @@ -2982,7 +3041,7 @@ int ssl3_send_client_key_exchange(SSL *s) *(p++) = V_ASN1_SEQUENCE | V_ASN1_CONSTRUCTED; msglen = 255; if (EVP_PKEY_encrypt(pkey_ctx, tmp, &msglen, premaster_secret, 32) - < 0) { + <= 0) { SSLerr(SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE, SSL_R_LIBRARY_BUG); goto err; @@ -3177,7 +3236,10 @@ int ssl3_send_client_verify(SSL *s) pkey = s->cert->key->privatekey; /* Create context from key and test if sha1 is allowed as digest */ pctx = EVP_PKEY_CTX_new(pkey, NULL); - EVP_PKEY_sign_init(pctx); + if (pctx == NULL || EVP_PKEY_sign_init(pctx) <= 0) { + SSLerr(SSL_F_SSL3_SEND_CLIENT_VERIFY, ERR_R_INTERNAL_ERROR); + goto err; + } if (EVP_PKEY_CTX_set_signature_md(pctx, EVP_sha1()) > 0) { if (!SSL_USE_SIGALGS(s)) s->method->ssl3_enc->cert_verify_mac(s, @@ -3365,7 +3427,6 @@ int ssl3_send_client_certificate(SSL *s) * If we get an error, we need to ssl->rwstate=SSL_X509_LOOKUP; * return(-1); We then get retied later */ - i = 0; i = ssl_do_client_cert_cb(s, &x509, &pkey); if (i < 0) { s->rwstate = SSL_X509_LOOKUP; @@ -3549,7 +3610,7 @@ int ssl3_check_cert_and_algorithm(SSL *s) DH_free(dh_srvr); } - if ((!SSL_C_IS_EXPORT(s->s3->tmp.new_cipher) && dh_size < 768) + if ((!SSL_C_IS_EXPORT(s->s3->tmp.new_cipher) && dh_size < 1024) || (SSL_C_IS_EXPORT(s->s3->tmp.new_cipher) && dh_size < 512)) { SSLerr(SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM, SSL_R_DH_KEY_TOO_SMALL); goto f_err; diff --git a/deps/openssl/openssl/ssl/s3_enc.c b/deps/openssl/openssl/ssl/s3_enc.c index cda2d8c77603c7..47a0ec9fe04b18 100644 --- a/deps/openssl/openssl/ssl/s3_enc.c +++ b/deps/openssl/openssl/ssl/s3_enc.c @@ -253,7 +253,10 @@ int ssl3_change_cipher_state(SSL *s, int which) EVP_CIPHER_CTX_init(s->enc_read_ctx); dd = s->enc_read_ctx; - ssl_replace_hash(&s->read_hash, m); + if (ssl_replace_hash(&s->read_hash, m) == NULL) { + SSLerr(SSL_F_SSL3_CHANGE_CIPHER_STATE, ERR_R_INTERNAL_ERROR); + goto err2; + } #ifndef OPENSSL_NO_COMP /* COMPRESS */ if (s->expand != NULL) { @@ -288,7 +291,10 @@ int ssl3_change_cipher_state(SSL *s, int which) */ EVP_CIPHER_CTX_init(s->enc_write_ctx); dd = s->enc_write_ctx; - ssl_replace_hash(&s->write_hash, m); + if (ssl_replace_hash(&s->write_hash, m) == NULL) { + SSLerr(SSL_F_SSL3_CHANGE_CIPHER_STATE, ERR_R_INTERNAL_ERROR); + goto err2; + } #ifndef OPENSSL_NO_COMP /* COMPRESS */ if (s->compress != NULL) { @@ -691,19 +697,21 @@ static int ssl3_handshake_mac(SSL *s, int md_nid, return 0; npad = (48 / n) * n; - if (sender != NULL) - EVP_DigestUpdate(&ctx, sender, len); - EVP_DigestUpdate(&ctx, s->session->master_key, - s->session->master_key_length); - EVP_DigestUpdate(&ctx, ssl3_pad_1, npad); - EVP_DigestFinal_ex(&ctx, md_buf, &i); - - EVP_DigestInit_ex(&ctx, EVP_MD_CTX_md(&ctx), NULL); - EVP_DigestUpdate(&ctx, s->session->master_key, - s->session->master_key_length); - EVP_DigestUpdate(&ctx, ssl3_pad_2, npad); - EVP_DigestUpdate(&ctx, md_buf, i); - EVP_DigestFinal_ex(&ctx, p, &ret); + if ((sender != NULL && EVP_DigestUpdate(&ctx, sender, len) <= 0) + || EVP_DigestUpdate(&ctx, s->session->master_key, + s->session->master_key_length) <= 0 + || EVP_DigestUpdate(&ctx, ssl3_pad_1, npad) <= 0 + || EVP_DigestFinal_ex(&ctx, md_buf, &i) <= 0 + + || EVP_DigestInit_ex(&ctx, EVP_MD_CTX_md(&ctx), NULL) <= 0 + || EVP_DigestUpdate(&ctx, s->session->master_key, + s->session->master_key_length) <= 0 + || EVP_DigestUpdate(&ctx, ssl3_pad_2, npad) <= 0 + || EVP_DigestUpdate(&ctx, md_buf, i) <= 0 + || EVP_DigestFinal_ex(&ctx, p, &ret) <= 0) { + SSLerr(SSL_F_SSL3_HANDSHAKE_MAC, ERR_R_INTERNAL_ERROR); + ret = 0; + } EVP_MD_CTX_cleanup(&ctx); @@ -775,33 +783,36 @@ int n_ssl3_mac(SSL *ssl, unsigned char *md, int send) header[j++] = rec->length & 0xff; /* Final param == is SSLv3 */ - ssl3_cbc_digest_record(hash, - md, &md_size, - header, rec->input, - rec->length + md_size, orig_len, - mac_sec, md_size, 1); + if (ssl3_cbc_digest_record(hash, + md, &md_size, + header, rec->input, + rec->length + md_size, orig_len, + mac_sec, md_size, 1) <= 0) + return -1; } else { unsigned int md_size_u; /* Chop the digest off the end :-) */ EVP_MD_CTX_init(&md_ctx); - EVP_MD_CTX_copy_ex(&md_ctx, hash); - EVP_DigestUpdate(&md_ctx, mac_sec, md_size); - EVP_DigestUpdate(&md_ctx, ssl3_pad_1, npad); - EVP_DigestUpdate(&md_ctx, seq, 8); rec_char = rec->type; - EVP_DigestUpdate(&md_ctx, &rec_char, 1); p = md; s2n(rec->length, p); - EVP_DigestUpdate(&md_ctx, md, 2); - EVP_DigestUpdate(&md_ctx, rec->input, rec->length); - EVP_DigestFinal_ex(&md_ctx, md, NULL); - - EVP_MD_CTX_copy_ex(&md_ctx, hash); - EVP_DigestUpdate(&md_ctx, mac_sec, md_size); - EVP_DigestUpdate(&md_ctx, ssl3_pad_2, npad); - EVP_DigestUpdate(&md_ctx, md, md_size); - EVP_DigestFinal_ex(&md_ctx, md, &md_size_u); + if (EVP_MD_CTX_copy_ex(&md_ctx, hash) <= 0 + || EVP_DigestUpdate(&md_ctx, mac_sec, md_size) <= 0 + || EVP_DigestUpdate(&md_ctx, ssl3_pad_1, npad) <= 0 + || EVP_DigestUpdate(&md_ctx, seq, 8) <= 0 + || EVP_DigestUpdate(&md_ctx, &rec_char, 1) <= 0 + || EVP_DigestUpdate(&md_ctx, md, 2) <= 0 + || EVP_DigestUpdate(&md_ctx, rec->input, rec->length) <= 0 + || EVP_DigestFinal_ex(&md_ctx, md, NULL) <= 0 + || EVP_MD_CTX_copy_ex(&md_ctx, hash) <= 0 + || EVP_DigestUpdate(&md_ctx, mac_sec, md_size) <= 0 + || EVP_DigestUpdate(&md_ctx, ssl3_pad_2, npad) <= 0 + || EVP_DigestUpdate(&md_ctx, md, md_size) <= 0 + || EVP_DigestFinal_ex(&md_ctx, md, &md_size_u) <= 0) { + EVP_MD_CTX_cleanup(&md_ctx); + return -1; + } md_size = md_size_u; EVP_MD_CTX_cleanup(&md_ctx); @@ -846,24 +857,31 @@ int ssl3_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p, EVP_MD_CTX_init(&ctx); for (i = 0; i < 3; i++) { - EVP_DigestInit_ex(&ctx, s->ctx->sha1, NULL); - EVP_DigestUpdate(&ctx, salt[i], strlen((const char *)salt[i])); - EVP_DigestUpdate(&ctx, p, len); - EVP_DigestUpdate(&ctx, &(s->s3->client_random[0]), SSL3_RANDOM_SIZE); - EVP_DigestUpdate(&ctx, &(s->s3->server_random[0]), SSL3_RANDOM_SIZE); - EVP_DigestFinal_ex(&ctx, buf, &n); - - EVP_DigestInit_ex(&ctx, s->ctx->md5, NULL); - EVP_DigestUpdate(&ctx, p, len); - EVP_DigestUpdate(&ctx, buf, n); - EVP_DigestFinal_ex(&ctx, out, &n); + if (EVP_DigestInit_ex(&ctx, s->ctx->sha1, NULL) <= 0 + || EVP_DigestUpdate(&ctx, salt[i], + strlen((const char *)salt[i])) <= 0 + || EVP_DigestUpdate(&ctx, p, len) <= 0 + || EVP_DigestUpdate(&ctx, &(s->s3->client_random[0]), + SSL3_RANDOM_SIZE) <= 0 + || EVP_DigestUpdate(&ctx, &(s->s3->server_random[0]), + SSL3_RANDOM_SIZE) <= 0 + || EVP_DigestFinal_ex(&ctx, buf, &n) <= 0 + + || EVP_DigestInit_ex(&ctx, s->ctx->md5, NULL) <= 0 + || EVP_DigestUpdate(&ctx, p, len) <= 0 + || EVP_DigestUpdate(&ctx, buf, n) <= 0 + || EVP_DigestFinal_ex(&ctx, out, &n) <= 0) { + SSLerr(SSL_F_SSL3_GENERATE_MASTER_SECRET, ERR_R_INTERNAL_ERROR); + ret = 0; + break; + } out += n; ret += n; } EVP_MD_CTX_cleanup(&ctx); #ifdef OPENSSL_SSL_TRACE_CRYPTO - if (s->msg_callback) { + if (ret > 0 && s->msg_callback) { s->msg_callback(2, s->version, TLS1_RT_CRYPTO_PREMASTER, p, len, s, s->msg_callback_arg); s->msg_callback(2, s->version, TLS1_RT_CRYPTO_CLIENT_RANDOM, diff --git a/deps/openssl/openssl/ssl/s3_lib.c b/deps/openssl/openssl/ssl/s3_lib.c index ad9eeb6fd45345..4aac3b27928045 100644 --- a/deps/openssl/openssl/ssl/s3_lib.c +++ b/deps/openssl/openssl/ssl/s3_lib.c @@ -198,6 +198,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { }, /* Cipher 03 */ +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 1, SSL3_TXT_RSA_RC4_40_MD5, @@ -212,6 +213,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 40, 128, }, +#endif /* Cipher 04 */ { @@ -246,6 +248,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { }, /* Cipher 06 */ +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 1, SSL3_TXT_RSA_RC2_40_MD5, @@ -260,6 +263,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 40, 128, }, +#endif /* Cipher 07 */ #ifndef OPENSSL_NO_IDEA @@ -280,6 +284,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { #endif /* Cipher 08 */ +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 1, SSL3_TXT_RSA_DES_40_CBC_SHA, @@ -294,8 +299,10 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 40, 56, }, +#endif /* Cipher 09 */ +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 1, SSL3_TXT_RSA_DES_64_CBC_SHA, @@ -310,6 +317,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 56, 56, }, +#endif /* Cipher 0A */ { @@ -329,6 +337,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { /* The DH ciphers */ /* Cipher 0B */ +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 0, SSL3_TXT_DH_DSS_DES_40_CBC_SHA, @@ -343,8 +352,10 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 40, 56, }, +#endif /* Cipher 0C */ +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 1, SSL3_TXT_DH_DSS_DES_64_CBC_SHA, @@ -359,6 +370,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 56, 56, }, +#endif /* Cipher 0D */ { @@ -377,6 +389,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { }, /* Cipher 0E */ +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 0, SSL3_TXT_DH_RSA_DES_40_CBC_SHA, @@ -391,8 +404,10 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 40, 56, }, +#endif /* Cipher 0F */ +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 1, SSL3_TXT_DH_RSA_DES_64_CBC_SHA, @@ -407,6 +422,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 56, 56, }, +#endif /* Cipher 10 */ { @@ -426,6 +442,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { /* The Ephemeral DH ciphers */ /* Cipher 11 */ +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 1, SSL3_TXT_EDH_DSS_DES_40_CBC_SHA, @@ -440,8 +457,10 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 40, 56, }, +#endif /* Cipher 12 */ +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 1, SSL3_TXT_EDH_DSS_DES_64_CBC_SHA, @@ -456,6 +475,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 56, 56, }, +#endif /* Cipher 13 */ { @@ -474,6 +494,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { }, /* Cipher 14 */ +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 1, SSL3_TXT_EDH_RSA_DES_40_CBC_SHA, @@ -488,8 +509,10 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 40, 56, }, +#endif /* Cipher 15 */ +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 1, SSL3_TXT_EDH_RSA_DES_64_CBC_SHA, @@ -504,6 +527,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 56, 56, }, +#endif /* Cipher 16 */ { @@ -522,6 +546,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { }, /* Cipher 17 */ +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 1, SSL3_TXT_ADH_RC4_40_MD5, @@ -536,6 +561,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 40, 128, }, +#endif /* Cipher 18 */ { @@ -554,6 +580,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { }, /* Cipher 19 */ +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 1, SSL3_TXT_ADH_DES_40_CBC_SHA, @@ -568,8 +595,10 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 40, 128, }, +#endif /* Cipher 1A */ +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 1, SSL3_TXT_ADH_DES_64_CBC_SHA, @@ -584,6 +613,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 56, 56, }, +#endif /* Cipher 1B */ { @@ -655,6 +685,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { #ifndef OPENSSL_NO_KRB5 /* The Kerberos ciphers*/ /* Cipher 1E */ +# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 1, SSL3_TXT_KRB5_DES_64_CBC_SHA, @@ -669,6 +700,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 56, 56, }, +# endif /* Cipher 1F */ { @@ -719,6 +751,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { }, /* Cipher 22 */ +# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 1, SSL3_TXT_KRB5_DES_64_CBC_MD5, @@ -733,6 +766,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 56, 56, }, +# endif /* Cipher 23 */ { @@ -783,6 +817,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { }, /* Cipher 26 */ +# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 1, SSL3_TXT_KRB5_DES_40_CBC_SHA, @@ -797,8 +832,10 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 40, 56, }, +# endif /* Cipher 27 */ +# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 1, SSL3_TXT_KRB5_RC2_40_CBC_SHA, @@ -813,8 +850,10 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 40, 128, }, +# endif /* Cipher 28 */ +# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 1, SSL3_TXT_KRB5_RC4_40_SHA, @@ -829,8 +868,10 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 40, 128, }, +# endif /* Cipher 29 */ +# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 1, SSL3_TXT_KRB5_DES_40_CBC_MD5, @@ -845,8 +886,10 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 40, 56, }, +# endif /* Cipher 2A */ +# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 1, SSL3_TXT_KRB5_RC2_40_CBC_MD5, @@ -861,8 +904,10 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 40, 128, }, +# endif /* Cipher 2B */ +# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 1, SSL3_TXT_KRB5_RC4_40_MD5, @@ -877,6 +922,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 40, 128, }, +# endif #endif /* OPENSSL_NO_KRB5 */ /* New AES ciphersuites */ @@ -1300,6 +1346,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { # endif /* Cipher 62 */ +# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 1, TLS1_TXT_RSA_EXPORT1024_WITH_DES_CBC_SHA, @@ -1314,8 +1361,10 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 56, 56, }, +# endif /* Cipher 63 */ +# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 1, TLS1_TXT_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA, @@ -1330,8 +1379,10 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 56, 56, }, +# endif /* Cipher 64 */ +# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 1, TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_SHA, @@ -1346,8 +1397,10 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 56, 128, }, +# endif /* Cipher 65 */ +# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS { 1, TLS1_TXT_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA, @@ -1362,6 +1415,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { 56, 128, }, +# endif /* Cipher 66 */ { @@ -2983,7 +3037,7 @@ int ssl3_new(SSL *s) void ssl3_free(SSL *s) { - if (s == NULL) + if (s == NULL || s->s3 == NULL) return; #ifdef TLSEXT_TYPE_opaque_prf_input @@ -3206,13 +3260,6 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg) SSLerr(SSL_F_SSL3_CTRL, ERR_R_DH_LIB); return (ret); } - if (!(s->options & SSL_OP_SINGLE_DH_USE)) { - if (!DH_generate_key(dh)) { - DH_free(dh); - SSLerr(SSL_F_SSL3_CTRL, ERR_R_DH_LIB); - return (ret); - } - } if (s->cert->dh_tmp != NULL) DH_free(s->cert->dh_tmp); s->cert->dh_tmp = dh; @@ -3263,6 +3310,8 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg) #ifndef OPENSSL_NO_TLSEXT case SSL_CTRL_SET_TLSEXT_HOSTNAME: if (larg == TLSEXT_NAMETYPE_host_name) { + size_t len; + if (s->tlsext_hostname != NULL) OPENSSL_free(s->tlsext_hostname); s->tlsext_hostname = NULL; @@ -3270,7 +3319,8 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg) ret = 1; if (parg == NULL) break; - if (strlen((char *)parg) > TLSEXT_MAXLEN_host_name) { + len = strlen((char *)parg); + if (len == 0 || len > TLSEXT_MAXLEN_host_name) { SSLerr(SSL_F_SSL3_CTRL, SSL_R_SSL3_EXT_INVALID_SERVERNAME); return 0; } @@ -3710,13 +3760,6 @@ long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg) SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_DH_LIB); return 0; } - if (!(ctx->options & SSL_OP_SINGLE_DH_USE)) { - if (!DH_generate_key(new)) { - SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_DH_LIB); - DH_free(new); - return 0; - } - } if (cert->dh_tmp != NULL) DH_free(cert->dh_tmp); cert->dh_tmp = new; diff --git a/deps/openssl/openssl/ssl/s3_pkt.c b/deps/openssl/openssl/ssl/s3_pkt.c index 603c285ac49940..379890237e8663 100644 --- a/deps/openssl/openssl/ssl/s3_pkt.c +++ b/deps/openssl/openssl/ssl/s3_pkt.c @@ -1115,7 +1115,7 @@ int ssl3_write_pending(SSL *s, int type, const unsigned char *buf, s->rwstate = SSL_NOTHING; return (s->s3->wpend_ret); } else if (i <= 0) { - if (s->version == DTLS1_VERSION || s->version == DTLS1_BAD_VER) { + if (SSL_IS_DTLS(s)) { /* * For DTLS, just drop it. That's kind of the whole point in * using a datagram service diff --git a/deps/openssl/openssl/ssl/s3_srvr.c b/deps/openssl/openssl/ssl/s3_srvr.c index acd3b9e964a239..ab28702ee972da 100644 --- a/deps/openssl/openssl/ssl/s3_srvr.c +++ b/deps/openssl/openssl/ssl/s3_srvr.c @@ -1,4 +1,4 @@ -/* ssl/s3_srvr.c -*- mode:C; c-file-style: "eay" -*- */ +/* ssl/s3_srvr.c */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -383,7 +383,6 @@ int ssl3_accept(SSL *s) */ if (al != TLS1_AD_UNKNOWN_PSK_IDENTITY) SSLerr(SSL_F_SSL3_ACCEPT, SSL_R_CLIENTHELLO_TLSEXT); - ret = SSL_TLSEXT_ERR_ALERT_FATAL; ret = -1; s->state = SSL_ST_ERR; goto end; @@ -902,7 +901,7 @@ int ssl3_send_hello_request(SSL *s) int ssl3_get_client_hello(SSL *s) { - int i, j, ok, al = SSL_AD_INTERNAL_ERROR, ret = -1; + int i, j, ok, al = SSL_AD_INTERNAL_ERROR, ret = -1, cookie_valid = 0; unsigned int cookie_len; long n; unsigned long id; @@ -1005,6 +1004,12 @@ int ssl3_get_client_hello(SSL *s) goto f_err; } + if ((j < 0) || (j > SSL_MAX_SSL_SESSION_ID_LENGTH)) { + al = SSL_AD_DECODE_ERROR; + SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_MISMATCH); + goto f_err; + } + s->hit = 0; /* * Versions before 0.9.7 always allow clients to resume sessions in @@ -1095,8 +1100,7 @@ int ssl3_get_client_hello(SSL *s) SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_COOKIE_MISMATCH); goto f_err; } - /* Set to -2 so if successful we return 2 */ - ret = -2; + cookie_valid = 1; } p += cookie_len; @@ -1231,7 +1235,7 @@ int ssl3_get_client_hello(SSL *s) #ifndef OPENSSL_NO_TLSEXT /* TLS extensions */ if (s->version >= SSL3_VERSION) { - if (!ssl_parse_clienthello_tlsext(s, &p, d, n)) { + if (!ssl_parse_clienthello_tlsext(s, &p, d + n)) { SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_PARSE_TLSEXT); goto err; } @@ -1466,8 +1470,7 @@ int ssl3_get_client_hello(SSL *s) } } - if (ret < 0) - ret = -ret; + ret = cookie_valid ? 2 : 1; if (0) { f_err: ssl3_send_alert(s, SSL3_AL_FATAL, al); @@ -1477,7 +1480,7 @@ int ssl3_get_client_hello(SSL *s) if (ciphers != NULL) sk_SSL_CIPHER_free(ciphers); - return ret < 0 ? -1 : ret; + return ret; } int ssl3_send_server_hello(SSL *s) @@ -1684,20 +1687,9 @@ int ssl3_send_server_key_exchange(SSL *s) } s->s3->tmp.dh = dh; - if ((dhp->pub_key == NULL || - dhp->priv_key == NULL || - (s->options & SSL_OP_SINGLE_DH_USE))) { - if (!DH_generate_key(dh)) { - SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE, ERR_R_DH_LIB); - goto err; - } - } else { - dh->pub_key = BN_dup(dhp->pub_key); - dh->priv_key = BN_dup(dhp->priv_key); - if ((dh->pub_key == NULL) || (dh->priv_key == NULL)) { - SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE, ERR_R_DH_LIB); - goto err; - } + if (!DH_generate_key(dh)) { + SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE, ERR_R_DH_LIB); + goto err; } r[0] = dh->p; r[1] = dh->g; @@ -1950,14 +1942,22 @@ int ssl3_send_server_key_exchange(SSL *s) for (num = 2; num > 0; num--) { EVP_MD_CTX_set_flags(&md_ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); - EVP_DigestInit_ex(&md_ctx, (num == 2) - ? s->ctx->md5 : s->ctx->sha1, NULL); - EVP_DigestUpdate(&md_ctx, &(s->s3->client_random[0]), - SSL3_RANDOM_SIZE); - EVP_DigestUpdate(&md_ctx, &(s->s3->server_random[0]), - SSL3_RANDOM_SIZE); - EVP_DigestUpdate(&md_ctx, d, n); - EVP_DigestFinal_ex(&md_ctx, q, (unsigned int *)&i); + if (EVP_DigestInit_ex(&md_ctx, + (num == 2) ? s->ctx->md5 + : s->ctx->sha1, + NULL) <= 0 + || EVP_DigestUpdate(&md_ctx, &(s->s3->client_random[0]), + SSL3_RANDOM_SIZE) <= 0 + || EVP_DigestUpdate(&md_ctx, &(s->s3->server_random[0]), + SSL3_RANDOM_SIZE) <= 0 + || EVP_DigestUpdate(&md_ctx, d, n) <= 0 + || EVP_DigestFinal_ex(&md_ctx, q, + (unsigned int *)&i) <= 0) { + SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE, + ERR_LIB_EVP); + al = SSL_AD_INTERNAL_ERROR; + goto f_err; + } q += i; j += i; } @@ -1985,16 +1985,17 @@ int ssl3_send_server_key_exchange(SSL *s) #ifdef SSL_DEBUG fprintf(stderr, "Using hash %s\n", EVP_MD_name(md)); #endif - EVP_SignInit_ex(&md_ctx, md, NULL); - EVP_SignUpdate(&md_ctx, &(s->s3->client_random[0]), - SSL3_RANDOM_SIZE); - EVP_SignUpdate(&md_ctx, &(s->s3->server_random[0]), - SSL3_RANDOM_SIZE); - EVP_SignUpdate(&md_ctx, d, n); - if (!EVP_SignFinal(&md_ctx, &(p[2]), - (unsigned int *)&i, pkey)) { + if (EVP_SignInit_ex(&md_ctx, md, NULL) <= 0 + || EVP_SignUpdate(&md_ctx, &(s->s3->client_random[0]), + SSL3_RANDOM_SIZE) <= 0 + || EVP_SignUpdate(&md_ctx, &(s->s3->server_random[0]), + SSL3_RANDOM_SIZE) <= 0 + || EVP_SignUpdate(&md_ctx, d, n) <= 0 + || EVP_SignFinal(&md_ctx, &(p[2]), + (unsigned int *)&i, pkey) <= 0) { SSLerr(SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE, ERR_LIB_EVP); - goto err; + al = SSL_AD_INTERNAL_ERROR; + goto f_err; } s2n(i, p); n += i + 2; @@ -2867,7 +2868,15 @@ int ssl3_get_client_key_exchange(SSL *s) pk = s->cert->pkeys[SSL_PKEY_GOST01].privatekey; pkey_ctx = EVP_PKEY_CTX_new(pk, NULL); - EVP_PKEY_decrypt_init(pkey_ctx); + if (pkey_ctx == NULL) { + al = SSL_AD_INTERNAL_ERROR; + SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_MALLOC_FAILURE); + goto f_err; + } + if (EVP_PKEY_decrypt_init(pkey_ctx) <= 0) { + SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_INTERNAL_ERROR); + goto gerr; + } /* * If client certificate is present and is of the same type, maybe * use it for key exchange. Don't mind errors from @@ -3099,7 +3108,17 @@ int ssl3_get_cert_verify(SSL *s) unsigned char signature[64]; int idx; EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new(pkey, NULL); - EVP_PKEY_verify_init(pctx); + if (pctx == NULL) { + al = SSL_AD_INTERNAL_ERROR; + SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, ERR_R_MALLOC_FAILURE); + goto f_err; + } + if (EVP_PKEY_verify_init(pctx) <= 0) { + EVP_PKEY_CTX_free(pctx); + al = SSL_AD_INTERNAL_ERROR; + SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, ERR_R_INTERNAL_ERROR); + goto f_err; + } if (i != 64) { fprintf(stderr, "GOST signature length is %d", i); } diff --git a/deps/openssl/openssl/ssl/ssl.h b/deps/openssl/openssl/ssl/ssl.h index 6fe1a2474d43a8..04d4007eeb8e5a 100644 --- a/deps/openssl/openssl/ssl/ssl.h +++ b/deps/openssl/openssl/ssl/ssl.h @@ -625,7 +625,7 @@ struct ssl_session_st { # define SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION 0x00040000L /* If set, always create a new key when using tmp_ecdh parameters */ # define SSL_OP_SINGLE_ECDH_USE 0x00080000L -/* If set, always create a new key when using tmp_dh parameters */ +/* Does nothing: retained for compatibility */ # define SSL_OP_SINGLE_DH_USE 0x00100000L /* Does nothing: retained for compatibiity */ # define SSL_OP_EPHEMERAL_RSA 0x0 @@ -2092,7 +2092,7 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) # define SSL_CTX_set1_sigalgs_list(ctx, s) \ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)s) # define SSL_set1_sigalgs(ctx, slist, slistlen) \ - SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS,clistlen,(int *)slist) + SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS,slistlen,(int *)slist) # define SSL_set1_sigalgs_list(ctx, s) \ SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)s) # define SSL_CTX_set1_client_sigalgs(ctx, slist, slistlen) \ @@ -2681,6 +2681,7 @@ void ERR_load_SSL_strings(void); # define SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC 292 # define SSL_F_SSL3_ENC 134 # define SSL_F_SSL3_GENERATE_KEY_BLOCK 238 +# define SSL_F_SSL3_GENERATE_MASTER_SECRET 388 # define SSL_F_SSL3_GET_CERTIFICATE_REQUEST 135 # define SSL_F_SSL3_GET_CERT_STATUS 289 # define SSL_F_SSL3_GET_CERT_VERIFY 136 @@ -2846,8 +2847,11 @@ void ERR_load_SSL_strings(void); # define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK 106 # define SSL_R_BAD_DECOMPRESSION 107 # define SSL_R_BAD_DH_G_LENGTH 108 +# define SSL_R_BAD_DH_G_VALUE 375 # define SSL_R_BAD_DH_PUB_KEY_LENGTH 109 +# define SSL_R_BAD_DH_PUB_KEY_VALUE 393 # define SSL_R_BAD_DH_P_LENGTH 110 +# define SSL_R_BAD_DH_P_VALUE 395 # define SSL_R_BAD_DIGEST_LENGTH 111 # define SSL_R_BAD_DSA_SIGNATURE 112 # define SSL_R_BAD_ECC_CERT 304 @@ -3052,6 +3056,7 @@ void ERR_load_SSL_strings(void); # define SSL_R_SERVERHELLO_TLSEXT 275 # define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 277 # define SSL_R_SHORT_READ 219 +# define SSL_R_SHUTDOWN_WHILE_IN_INIT 407 # define SSL_R_SIGNATURE_ALGORITHMS_ERROR 360 # define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE 220 # define SSL_R_SRP_A_CALC 361 diff --git a/deps/openssl/openssl/ssl/ssl_asn1.c b/deps/openssl/openssl/ssl/ssl_asn1.c index 39d48eabf03b95..35cc27c5e9855e 100644 --- a/deps/openssl/openssl/ssl/ssl_asn1.c +++ b/deps/openssl/openssl/ssl/ssl_asn1.c @@ -121,13 +121,16 @@ typedef struct ssl_session_asn1_st { int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp) { #define LSIZE2 (sizeof(long)*2) - int v1 = 0, v2 = 0, v3 = 0, v4 = 0, v5 = 0, v7 = 0, v8 = 0; + int v1 = 0, v2 = 0, v3 = 0, v4 = 0, v5 = 0; unsigned char buf[4], ibuf1[LSIZE2], ibuf2[LSIZE2]; unsigned char ibuf3[LSIZE2], ibuf4[LSIZE2], ibuf5[LSIZE2]; #ifndef OPENSSL_NO_TLSEXT int v6 = 0, v9 = 0, v10 = 0; unsigned char ibuf6[LSIZE2]; #endif +#ifndef OPENSSL_NO_PSK + int v7 = 0, v8 = 0; +#endif #ifndef OPENSSL_NO_COMP unsigned char cbuf; int v11 = 0; diff --git a/deps/openssl/openssl/ssl/ssl_cert.c b/deps/openssl/openssl/ssl/ssl_cert.c index 93a1eb941ab942..a73f866cb9a7fb 100644 --- a/deps/openssl/openssl/ssl/ssl_cert.c +++ b/deps/openssl/openssl/ssl/ssl_cert.c @@ -227,6 +227,7 @@ CERT *ssl_cert_dup(CERT *cert) memset(ret, 0, sizeof(CERT)); + ret->references = 1; ret->key = &ret->pkeys[cert->key - &cert->pkeys[0]]; /* * or ret->key = ret->pkeys + (cert->key - cert->pkeys), if you find that @@ -325,7 +326,6 @@ CERT *ssl_cert_dup(CERT *cert) #endif } - ret->references = 1; /* * Set digests to defaults. NB: we don't copy existing values as they * will be set during handshake. diff --git a/deps/openssl/openssl/ssl/ssl_ciph.c b/deps/openssl/openssl/ssl/ssl_ciph.c index 2cc9a4a21f75a6..6957bda7850987 100644 --- a/deps/openssl/openssl/ssl/ssl_ciph.c +++ b/deps/openssl/openssl/ssl/ssl_ciph.c @@ -376,10 +376,11 @@ static int get_optional_pkey_id(const char *pkey_name) const EVP_PKEY_ASN1_METHOD *ameth; int pkey_id = 0; ameth = EVP_PKEY_asn1_find_str(NULL, pkey_name, -1); - if (ameth) { - EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL, ameth); + if (ameth && EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL, + ameth) > 0) { + return pkey_id; } - return pkey_id; + return 0; } #else @@ -391,7 +392,9 @@ static int get_optional_pkey_id(const char *pkey_name) int pkey_id = 0; ameth = EVP_PKEY_asn1_find_str(&tmpeng, pkey_name, -1); if (ameth) { - EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL, ameth); + if (EVP_PKEY_asn1_get0_info(&pkey_id, NULL, NULL, NULL, NULL, + ameth) <= 0) + pkey_id = 0; } if (tmpeng) ENGINE_finish(tmpeng); @@ -1404,15 +1407,16 @@ static int check_suiteb_cipher_list(const SSL_METHOD *meth, CERT *c, const char **prule_str) { unsigned int suiteb_flags = 0, suiteb_comb2 = 0; - if (!strcmp(*prule_str, "SUITEB128")) - suiteb_flags = SSL_CERT_FLAG_SUITEB_128_LOS; - else if (!strcmp(*prule_str, "SUITEB128ONLY")) + if (strncmp(*prule_str, "SUITEB128ONLY", 13) == 0) { suiteb_flags = SSL_CERT_FLAG_SUITEB_128_LOS_ONLY; - else if (!strcmp(*prule_str, "SUITEB128C2")) { + } else if (strncmp(*prule_str, "SUITEB128C2", 11) == 0) { suiteb_comb2 = 1; suiteb_flags = SSL_CERT_FLAG_SUITEB_128_LOS; - } else if (!strcmp(*prule_str, "SUITEB192")) + } else if (strncmp(*prule_str, "SUITEB128", 9) == 0) { + suiteb_flags = SSL_CERT_FLAG_SUITEB_128_LOS; + } else if (strncmp(*prule_str, "SUITEB192", 9) == 0) { suiteb_flags = SSL_CERT_FLAG_SUITEB_192_LOS; + } if (suiteb_flags) { c->cert_flags &= ~SSL_CERT_FLAG_SUITEB_128_LOS; diff --git a/deps/openssl/openssl/ssl/ssl_conf.c b/deps/openssl/openssl/ssl/ssl_conf.c index 5478840deae994..8d3709d2b62c99 100644 --- a/deps/openssl/openssl/ssl/ssl_conf.c +++ b/deps/openssl/openssl/ssl/ssl_conf.c @@ -330,11 +330,19 @@ static int cmd_Protocol(SSL_CONF_CTX *cctx, const char *value) SSL_FLAG_TBL_INV("TLSv1.1", SSL_OP_NO_TLSv1_1), SSL_FLAG_TBL_INV("TLSv1.2", SSL_OP_NO_TLSv1_2) }; + int ret; + int sslv2off; + if (!(cctx->flags & SSL_CONF_FLAG_FILE)) return -2; cctx->tbl = ssl_protocol_list; cctx->ntbl = sizeof(ssl_protocol_list) / sizeof(ssl_flag_tbl); - return CONF_parse_list(value, ',', 1, ssl_set_option_list, cctx); + + sslv2off = *cctx->poptions & SSL_OP_NO_SSLv2; + ret = CONF_parse_list(value, ',', 1, ssl_set_option_list, cctx); + /* Never turn on SSLv2 through configuration */ + *cctx->poptions |= sslv2off; + return ret; } static int cmd_Options(SSL_CONF_CTX *cctx, const char *value) diff --git a/deps/openssl/openssl/ssl/ssl_err.c b/deps/openssl/openssl/ssl/ssl_err.c index 1a6030e6238dee..704088dc469ed9 100644 --- a/deps/openssl/openssl/ssl/ssl_err.c +++ b/deps/openssl/openssl/ssl/ssl_err.c @@ -163,6 +163,8 @@ static ERR_STRING_DATA SSL_str_functs[] = { "ssl3_do_change_cipher_spec"}, {ERR_FUNC(SSL_F_SSL3_ENC), "ssl3_enc"}, {ERR_FUNC(SSL_F_SSL3_GENERATE_KEY_BLOCK), "SSL3_GENERATE_KEY_BLOCK"}, + {ERR_FUNC(SSL_F_SSL3_GENERATE_MASTER_SECRET), + "ssl3_generate_master_secret"}, {ERR_FUNC(SSL_F_SSL3_GET_CERTIFICATE_REQUEST), "ssl3_get_certificate_request"}, {ERR_FUNC(SSL_F_SSL3_GET_CERT_STATUS), "ssl3_get_cert_status"}, @@ -386,8 +388,11 @@ static ERR_STRING_DATA SSL_str_reasons[] = { "bad data returned by callback"}, {ERR_REASON(SSL_R_BAD_DECOMPRESSION), "bad decompression"}, {ERR_REASON(SSL_R_BAD_DH_G_LENGTH), "bad dh g length"}, + {ERR_REASON(SSL_R_BAD_DH_G_VALUE), "bad dh g value"}, {ERR_REASON(SSL_R_BAD_DH_PUB_KEY_LENGTH), "bad dh pub key length"}, + {ERR_REASON(SSL_R_BAD_DH_PUB_KEY_VALUE), "bad dh pub key value"}, {ERR_REASON(SSL_R_BAD_DH_P_LENGTH), "bad dh p length"}, + {ERR_REASON(SSL_R_BAD_DH_P_VALUE), "bad dh p value"}, {ERR_REASON(SSL_R_BAD_DIGEST_LENGTH), "bad digest length"}, {ERR_REASON(SSL_R_BAD_DSA_SIGNATURE), "bad dsa signature"}, {ERR_REASON(SSL_R_BAD_ECC_CERT), "bad ecc cert"}, @@ -642,6 +647,7 @@ static ERR_STRING_DATA SSL_str_reasons[] = { {ERR_REASON(SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED), "session id context uninitialized"}, {ERR_REASON(SSL_R_SHORT_READ), "short read"}, + {ERR_REASON(SSL_R_SHUTDOWN_WHILE_IN_INIT), "shutdown while in init"}, {ERR_REASON(SSL_R_SIGNATURE_ALGORITHMS_ERROR), "signature algorithms error"}, {ERR_REASON(SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE), diff --git a/deps/openssl/openssl/ssl/ssl_lib.c b/deps/openssl/openssl/ssl/ssl_lib.c index c0931e787728ed..f1279bbf910343 100644 --- a/deps/openssl/openssl/ssl/ssl_lib.c +++ b/deps/openssl/openssl/ssl/ssl_lib.c @@ -307,6 +307,7 @@ SSL *SSL_new(SSL_CTX *ctx) s->options = ctx->options; s->mode = ctx->mode; s->max_cert_list = ctx->max_cert_list; + s->references = 1; if (ctx->cert != NULL) { /* @@ -405,7 +406,6 @@ SSL *SSL_new(SSL_CTX *ctx) if (!s->method->ssl_new(s)) goto err; - s->references = 1; s->server = (ctx->method->ssl_accept == ssl_undefined_function) ? 0 : 1; SSL_clear(s); @@ -1060,10 +1060,12 @@ int SSL_shutdown(SSL *s) return -1; } - if ((s != NULL) && !SSL_in_init(s)) - return (s->method->ssl_shutdown(s)); - else - return (1); + if (!SSL_in_init(s)) { + return s->method->ssl_shutdown(s); + } else { + SSLerr(SSL_F_SSL_SHUTDOWN, SSL_R_SHUTDOWN_WHILE_IN_INIT); + return -1; + } } int SSL_renegotiate(SSL *s) @@ -1980,7 +1982,7 @@ SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth) ret->extra_certs = NULL; /* No compression for DTLS */ - if (meth->version != DTLS1_VERSION) + if (!(meth->ssl3_enc->enc_flags & SSL_ENC_FLAG_DTLS)) ret->comp_methods = SSL_COMP_get_compression_methods(); ret->max_send_fragment = SSL3_RT_MAX_PLAIN_LENGTH; @@ -2052,6 +2054,13 @@ SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth) */ ret->options |= SSL_OP_LEGACY_SERVER_CONNECT; + /* + * Disable SSLv2 by default, callers that want to enable SSLv2 will have to + * explicitly clear this option via either of SSL_CTX_clear_options() or + * SSL_clear_options(). + */ + ret->options |= SSL_OP_NO_SSLv2; + return (ret); err: SSLerr(SSL_F_SSL_CTX_NEW, ERR_R_MALLOC_FAILURE); @@ -3507,8 +3516,11 @@ EVP_MD_CTX *ssl_replace_hash(EVP_MD_CTX **hash, const EVP_MD *md) { ssl_clear_hash_ctx(hash); *hash = EVP_MD_CTX_create(); - if (md) - EVP_DigestInit_ex(*hash, md, NULL); + if (*hash == NULL || (md && EVP_DigestInit_ex(*hash, md, NULL) <= 0)) { + EVP_MD_CTX_destroy(*hash); + *hash = NULL; + return NULL; + } return *hash; } diff --git a/deps/openssl/openssl/ssl/ssl_locl.h b/deps/openssl/openssl/ssl/ssl_locl.h index 6c2c551e5e341e..a8e4efceba5f05 100644 --- a/deps/openssl/openssl/ssl/ssl_locl.h +++ b/deps/openssl/openssl/ssl/ssl_locl.h @@ -1366,7 +1366,7 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *buf, unsigned char *ssl_add_serverhello_tlsext(SSL *s, unsigned char *buf, unsigned char *limit, int *al); int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **data, - unsigned char *d, int n); + unsigned char *limit); int tls1_set_server_sigalgs(SSL *s); int ssl_check_clienthello_tlsext_late(SSL *s); int ssl_parse_serverhello_tlsext(SSL *s, unsigned char **data, @@ -1439,15 +1439,15 @@ int tls1_cbc_remove_padding(const SSL *s, SSL3_RECORD *rec, unsigned block_size, unsigned mac_size); char ssl3_cbc_record_digest_supported(const EVP_MD_CTX *ctx); -void ssl3_cbc_digest_record(const EVP_MD_CTX *ctx, - unsigned char *md_out, - size_t *md_out_size, - const unsigned char header[13], - const unsigned char *data, - size_t data_plus_mac_size, - size_t data_plus_mac_plus_padding_size, - const unsigned char *mac_secret, - unsigned mac_secret_length, char is_sslv3); +int ssl3_cbc_digest_record(const EVP_MD_CTX *ctx, + unsigned char *md_out, + size_t *md_out_size, + const unsigned char header[13], + const unsigned char *data, + size_t data_plus_mac_size, + size_t data_plus_mac_plus_padding_size, + const unsigned char *mac_secret, + unsigned mac_secret_length, char is_sslv3); void tls_fips_digest_extra(const EVP_CIPHER_CTX *cipher_ctx, EVP_MD_CTX *mac_ctx, const unsigned char *data, diff --git a/deps/openssl/openssl/ssl/ssl_rsa.c b/deps/openssl/openssl/ssl/ssl_rsa.c index b1b2318350a52a..b0f75c913f9154 100644 --- a/deps/openssl/openssl/ssl/ssl_rsa.c +++ b/deps/openssl/openssl/ssl/ssl_rsa.c @@ -160,7 +160,10 @@ int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa) } RSA_up_ref(rsa); - EVP_PKEY_assign_RSA(pkey, rsa); + if (EVP_PKEY_assign_RSA(pkey, rsa) <= 0) { + RSA_free(rsa); + return 0; + } ret = ssl_set_pkey(ssl->cert, pkey); EVP_PKEY_free(pkey); @@ -195,6 +198,15 @@ static int ssl_set_pkey(CERT *c, EVP_PKEY *pkey) if (c->pkeys[i].x509 != NULL) { EVP_PKEY *pktmp; pktmp = X509_get_pubkey(c->pkeys[i].x509); + if (pktmp == NULL) { + SSLerr(SSL_F_SSL_SET_PKEY, ERR_R_MALLOC_FAILURE); + EVP_PKEY_free(pktmp); + return 0; + } + /* + * The return code from EVP_PKEY_copy_parameters is deliberately + * ignored. Some EVP_PKEY types cannot do this. + */ EVP_PKEY_copy_parameters(pktmp, pkey); EVP_PKEY_free(pktmp); ERR_clear_error(); @@ -396,6 +408,10 @@ static int ssl_set_cert(CERT *c, X509 *x) } if (c->pkeys[i].privatekey != NULL) { + /* + * The return code from EVP_PKEY_copy_parameters is deliberately + * ignored. Some EVP_PKEY types cannot do this. + */ EVP_PKEY_copy_parameters(pkey, c->pkeys[i].privatekey); ERR_clear_error(); @@ -516,7 +532,10 @@ int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa) } RSA_up_ref(rsa); - EVP_PKEY_assign_RSA(pkey, rsa); + if (EVP_PKEY_assign_RSA(pkey, rsa) <= 0) { + RSA_free(rsa); + return 0; + } ret = ssl_set_pkey(ctx->cert, pkey); EVP_PKEY_free(pkey); @@ -750,31 +769,31 @@ static int serverinfo_find_extension(const unsigned char *serverinfo, *extension_data = NULL; *extension_length = 0; if (serverinfo == NULL || serverinfo_length == 0) - return 0; + return -1; for (;;) { unsigned int type = 0; size_t len = 0; /* end of serverinfo */ if (serverinfo_length == 0) - return -1; /* Extension not found */ + return 0; /* Extension not found */ /* read 2-byte type field */ if (serverinfo_length < 2) - return 0; /* Error */ + return -1; /* Error */ type = (serverinfo[0] << 8) + serverinfo[1]; serverinfo += 2; serverinfo_length -= 2; /* read 2-byte len field */ if (serverinfo_length < 2) - return 0; /* Error */ + return -1; /* Error */ len = (serverinfo[0] << 8) + serverinfo[1]; serverinfo += 2; serverinfo_length -= 2; if (len > serverinfo_length) - return 0; /* Error */ + return -1; /* Error */ if (type == extension_type) { *extension_data = serverinfo; @@ -814,10 +833,12 @@ static int serverinfo_srv_add_cb(SSL *s, unsigned int ext_type, /* Find the relevant extension from the serverinfo */ int retval = serverinfo_find_extension(serverinfo, serverinfo_length, ext_type, out, outlen); + if (retval == -1) { + *al = SSL_AD_DECODE_ERROR; + return -1; /* Error */ + } if (retval == 0) - return 0; /* Error */ - if (retval == -1) - return -1; /* No extension found, don't send extension */ + return 0; /* No extension found, don't send extension */ return 1; /* Send extension */ } return -1; /* No serverinfo data found, don't send diff --git a/deps/openssl/openssl/ssl/ssl_sess.c b/deps/openssl/openssl/ssl/ssl_sess.c index 07e7379abfd104..b182998343844a 100644 --- a/deps/openssl/openssl/ssl/ssl_sess.c +++ b/deps/openssl/openssl/ssl/ssl_sess.c @@ -256,8 +256,8 @@ SSL_SESSION *ssl_session_dup(SSL_SESSION *src, int ticket) dest->tlsext_ecpointformatlist = NULL; dest->tlsext_ellipticcurvelist = NULL; # endif -#endif dest->tlsext_tick = NULL; +#endif #ifndef OPENSSL_NO_SRP dest->srp_username = NULL; #endif @@ -324,7 +324,6 @@ SSL_SESSION *ssl_session_dup(SSL_SESSION *src, int ticket) goto err; } # endif -#endif if (ticket != 0) { dest->tlsext_tick = BUF_memdup(src->tlsext_tick, src->tlsext_ticklen); @@ -334,6 +333,7 @@ SSL_SESSION *ssl_session_dup(SSL_SESSION *src, int ticket) dest->tlsext_tick_lifetime_hint = 0; dest->tlsext_ticklen = 0; } +#endif #ifndef OPENSSL_NO_SRP if (src->srp_username) { @@ -573,9 +573,6 @@ int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len, int r; #endif - if (len < 0 || len > SSL_MAX_SSL_SESSION_ID_LENGTH) - goto err; - if (session_id + len > limit) { fatal = 1; goto err; diff --git a/deps/openssl/openssl/ssl/ssltest.c b/deps/openssl/openssl/ssl/ssltest.c index 6737adf239c0b2..aaf6c6bd896df9 100644 --- a/deps/openssl/openssl/ssl/ssltest.c +++ b/deps/openssl/openssl/ssl/ssltest.c @@ -142,6 +142,7 @@ /* Or gethostname won't be declared properly on Linux and GNU platforms. */ #define _BSD_SOURCE 1 +#define _DEFAULT_SOURCE 1 #include #include diff --git a/deps/openssl/openssl/ssl/sslv2conftest.c b/deps/openssl/openssl/ssl/sslv2conftest.c new file mode 100644 index 00000000000000..1fd748b11866e0 --- /dev/null +++ b/deps/openssl/openssl/ssl/sslv2conftest.c @@ -0,0 +1,231 @@ +/* Written by Matt Caswell for the OpenSSL Project */ +/* ==================================================================== + * Copyright (c) 2016 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + +#include +#include +#include +#include + + +#define TOTAL_NUM_TESTS 2 +#define TEST_SSL_CTX 0 + +#define SSLV2ON 1 +#define SSLV2OFF 0 + +SSL_CONF_CTX *confctx; +SSL_CTX *ctx; +SSL *ssl; + +static int checksslv2(int test, int sslv2) +{ + int options; + if (test == TEST_SSL_CTX) { + options = SSL_CTX_get_options(ctx); + } else { + options = SSL_get_options(ssl); + } + return ((options & SSL_OP_NO_SSLv2) == 0) ^ (sslv2 == SSLV2OFF); +} + +int main(int argc, char *argv[]) +{ + BIO *err; + int testresult = 0; + int currtest; + + SSL_library_init(); + SSL_load_error_strings(); + + err = BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT); + + CRYPTO_malloc_debug_init(); + CRYPTO_set_mem_debug_options(V_CRYPTO_MDEBUG_ALL); + CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); + + + confctx = SSL_CONF_CTX_new(); + ctx = SSL_CTX_new(SSLv23_method()); + ssl = SSL_new(ctx); + if (confctx == NULL || ctx == NULL) + goto end; + + SSL_CONF_CTX_set_flags(confctx, SSL_CONF_FLAG_FILE + | SSL_CONF_FLAG_CLIENT + | SSL_CONF_FLAG_SERVER); + + /* + * For each test set up an SSL_CTX and SSL and see whether SSLv2 is enabled + * as expected after various SSL_CONF_cmd("Protocol", ...) calls. + */ + for (currtest = 0; currtest < TOTAL_NUM_TESTS; currtest++) { + BIO_printf(err, "SSLv2 CONF Test number %d\n", currtest); + if (currtest == TEST_SSL_CTX) + SSL_CONF_CTX_set_ssl_ctx(confctx, ctx); + else + SSL_CONF_CTX_set_ssl(confctx, ssl); + + /* SSLv2 should be off by default */ + if (!checksslv2(currtest, SSLV2OFF)) { + BIO_printf(err, "SSLv2 CONF Test: Off by default test FAIL\n"); + goto end; + } + + if (SSL_CONF_cmd(confctx, "Protocol", "ALL") != 2 + || !SSL_CONF_CTX_finish(confctx)) { + BIO_printf(err, "SSLv2 CONF Test: SSL_CONF command FAIL\n"); + goto end; + } + + /* Should still be off even after ALL Protocols on */ + if (!checksslv2(currtest, SSLV2OFF)) { + BIO_printf(err, "SSLv2 CONF Test: Off after config #1 FAIL\n"); + goto end; + } + + if (SSL_CONF_cmd(confctx, "Protocol", "SSLv2") != 2 + || !SSL_CONF_CTX_finish(confctx)) { + BIO_printf(err, "SSLv2 CONF Test: SSL_CONF command FAIL\n"); + goto end; + } + + /* Should still be off even if explicitly asked for */ + if (!checksslv2(currtest, SSLV2OFF)) { + BIO_printf(err, "SSLv2 CONF Test: Off after config #2 FAIL\n"); + goto end; + } + + if (SSL_CONF_cmd(confctx, "Protocol", "-SSLv2") != 2 + || !SSL_CONF_CTX_finish(confctx)) { + BIO_printf(err, "SSLv2 CONF Test: SSL_CONF command FAIL\n");; + goto end; + } + + if (!checksslv2(currtest, SSLV2OFF)) { + BIO_printf(err, "SSLv2 CONF Test: Off after config #3 FAIL\n"); + goto end; + } + + if (currtest == TEST_SSL_CTX) + SSL_CTX_clear_options(ctx, SSL_OP_NO_SSLv2); + else + SSL_clear_options(ssl, SSL_OP_NO_SSLv2); + + if (!checksslv2(currtest, SSLV2ON)) { + BIO_printf(err, "SSLv2 CONF Test: On after clear FAIL\n"); + goto end; + } + + if (SSL_CONF_cmd(confctx, "Protocol", "ALL") != 2 + || !SSL_CONF_CTX_finish(confctx)) { + BIO_printf(err, "SSLv2 CONF Test: SSL_CONF command FAIL\n"); + goto end; + } + + /* Option has been cleared and config says have SSLv2 so should be on */ + if (!checksslv2(currtest, SSLV2ON)) { + BIO_printf(err, "SSLv2 CONF Test: On after config #1 FAIL\n"); + goto end; + } + + if (SSL_CONF_cmd(confctx, "Protocol", "SSLv2") != 2 + || !SSL_CONF_CTX_finish(confctx)) { + BIO_printf(err, "SSLv2 CONF Test: SSL_CONF command FAIL\n"); + goto end; + } + + /* Option has been cleared and config says have SSLv2 so should be on */ + if (!checksslv2(currtest, SSLV2ON)) { + BIO_printf(err, "SSLv2 CONF Test: On after config #2 FAIL\n"); + goto end; + } + + if (SSL_CONF_cmd(confctx, "Protocol", "-SSLv2") != 2 + || !SSL_CONF_CTX_finish(confctx)) { + BIO_printf(err, "SSLv2 CONF Test: SSL_CONF command FAIL\n"); + goto end; + } + + /* Option has been cleared but config says no SSLv2 so should be off */ + if (!checksslv2(currtest, SSLV2OFF)) { + BIO_printf(err, "SSLv2 CONF Test: Off after config #4 FAIL\n"); + goto end; + } + + } + + testresult = 1; + + end: + SSL_free(ssl); + SSL_CTX_free(ctx); + SSL_CONF_CTX_free(confctx); + + if (!testresult) { + printf("SSLv2 CONF test: FAILED (Test %d)\n", currtest); + ERR_print_errors(err); + } else { + printf("SSLv2 CONF test: PASSED\n"); + } + + ERR_free_strings(); + ERR_remove_thread_state(NULL); + EVP_cleanup(); + CRYPTO_cleanup_all_ex_data(); + CRYPTO_mem_leaks(err); + BIO_free(err); + + return testresult ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/deps/openssl/openssl/ssl/t1_enc.c b/deps/openssl/openssl/ssl/t1_enc.c index e2a8f86919789e..514fcb3e4e74c4 100644 --- a/deps/openssl/openssl/ssl/t1_enc.c +++ b/deps/openssl/openssl/ssl/t1_enc.c @@ -384,6 +384,8 @@ int tls1_change_cipher_state(SSL *s, int which) EVP_CIPHER_CTX_init(s->enc_read_ctx); dd = s->enc_read_ctx; mac_ctx = ssl_replace_hash(&s->read_hash, NULL); + if (mac_ctx == NULL) + goto err; #ifndef OPENSSL_NO_COMP if (s->expand != NULL) { COMP_CTX_free(s->expand); @@ -422,11 +424,14 @@ int tls1_change_cipher_state(SSL *s, int which) dd = s->enc_write_ctx; if (SSL_IS_DTLS(s)) { mac_ctx = EVP_MD_CTX_create(); - if (!mac_ctx) + if (mac_ctx == NULL) goto err; s->write_hash = mac_ctx; - } else + } else { mac_ctx = ssl_replace_hash(&s->write_hash, NULL); + if (mac_ctx == NULL) + goto err; + } #ifndef OPENSSL_NO_COMP if (s->compress != NULL) { COMP_CTX_free(s->compress); @@ -499,7 +504,12 @@ int tls1_change_cipher_state(SSL *s, int which) if (!(EVP_CIPHER_flags(c) & EVP_CIPH_FLAG_AEAD_CIPHER)) { mac_key = EVP_PKEY_new_mac_key(mac_type, NULL, mac_secret, *mac_secret_size); - EVP_DigestSignInit(mac_ctx, NULL, m, NULL, mac_key); + if (mac_key == NULL + || EVP_DigestSignInit(mac_ctx, NULL, m, NULL, mac_key) <= 0) { + EVP_PKEY_free(mac_key); + SSLerr(SSL_F_TLS1_CHANGE_CIPHER_STATE, ERR_R_INTERNAL_ERROR); + goto err2; + } EVP_PKEY_free(mac_key); } #ifdef TLS_DEBUG @@ -931,8 +941,9 @@ int tls1_cert_verify_mac(SSL *s, int md_nid, unsigned char *out) } EVP_MD_CTX_init(&ctx); - EVP_MD_CTX_copy_ex(&ctx, d); - EVP_DigestFinal_ex(&ctx, out, &ret); + if (EVP_MD_CTX_copy_ex(&ctx, d) <=0 + || EVP_DigestFinal_ex(&ctx, out, &ret) <= 0) + ret = 0; EVP_MD_CTX_cleanup(&ctx); return ((int)ret); } @@ -1059,17 +1070,24 @@ int tls1_mac(SSL *ssl, unsigned char *md, int send) * are hashing because that gives an attacker a timing-oracle. */ /* Final param == not SSLv3 */ - ssl3_cbc_digest_record(mac_ctx, - md, &md_size, - header, rec->input, - rec->length + md_size, orig_len, - ssl->s3->read_mac_secret, - ssl->s3->read_mac_secret_size, 0); + if (ssl3_cbc_digest_record(mac_ctx, + md, &md_size, + header, rec->input, + rec->length + md_size, orig_len, + ssl->s3->read_mac_secret, + ssl->s3->read_mac_secret_size, 0) <= 0) { + if (!stream_mac) + EVP_MD_CTX_cleanup(&hmac); + return -1; + } } else { - EVP_DigestSignUpdate(mac_ctx, header, sizeof(header)); - EVP_DigestSignUpdate(mac_ctx, rec->input, rec->length); - t = EVP_DigestSignFinal(mac_ctx, md, &md_size); - OPENSSL_assert(t > 0); + if (EVP_DigestSignUpdate(mac_ctx, header, sizeof(header)) <= 0 + || EVP_DigestSignUpdate(mac_ctx, rec->input, rec->length) <= 0 + || EVP_DigestSignFinal(mac_ctx, md, &md_size) <= 0) { + if (!stream_mac) + EVP_MD_CTX_cleanup(&hmac); + return -1; + } #ifdef OPENSSL_FIPS if (!send && FIPS_mode()) tls_fips_digest_extra(ssl->enc_read_ctx, @@ -1137,7 +1155,7 @@ int tls1_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p, so = s->s3->server_opaque_prf_input; /* * must be same as col (see - * draft-resc-00.txts-opaque-prf-input-00.txt, section 3.1) + * draft-rescorla-tls-opaque-prf-input-00.txt, section 3.1) */ sol = s->s3->client_opaque_prf_input_len; } diff --git a/deps/openssl/openssl/ssl/t1_lib.c b/deps/openssl/openssl/ssl/t1_lib.c index 210a5e87430f26..d9ba99d7358466 100644 --- a/deps/openssl/openssl/ssl/t1_lib.c +++ b/deps/openssl/openssl/ssl/t1_lib.c @@ -497,7 +497,7 @@ static int tls1_get_curvelist(SSL *s, int sess, } else # endif { - if (!s->server || (s->cert && s->cert->ecdh_tmp_auto)) { + if (!s->server || s->cert->ecdh_tmp_auto) { *pcurves = eccurves_auto; pcurveslen = sizeof(eccurves_auto); } else { @@ -1837,7 +1837,7 @@ unsigned char *ssl_add_serverhello_tlsext(SSL *s, unsigned char *buf, * 10.8..10.8.3 (which don't work). */ static void ssl_check_for_safari(SSL *s, const unsigned char *data, - const unsigned char *d, int n) + const unsigned char *limit) { unsigned short type, size; static const unsigned char kSafariExtensionsBlock[] = { @@ -1866,11 +1866,11 @@ static void ssl_check_for_safari(SSL *s, const unsigned char *data, 0x02, 0x03, /* SHA-1/ECDSA */ }; - if (data >= (d + n - 2)) + if (data >= (limit - 2)) return; data += 2; - if (data > (d + n - 4)) + if (data > (limit - 4)) return; n2s(data, type); n2s(data, size); @@ -1878,7 +1878,7 @@ static void ssl_check_for_safari(SSL *s, const unsigned char *data, if (type != TLSEXT_TYPE_server_name) return; - if (data + size > d + n) + if (data + size > limit) return; data += size; @@ -1886,7 +1886,7 @@ static void ssl_check_for_safari(SSL *s, const unsigned char *data, const size_t len1 = sizeof(kSafariExtensionsBlock); const size_t len2 = sizeof(kSafariTLS12ExtensionsBlock); - if (data + len1 + len2 != d + n) + if (data + len1 + len2 != limit) return; if (memcmp(data, kSafariExtensionsBlock, len1) != 0) return; @@ -1895,7 +1895,7 @@ static void ssl_check_for_safari(SSL *s, const unsigned char *data, } else { const size_t len = sizeof(kSafariExtensionsBlock); - if (data + len != d + n) + if (data + len != limit) return; if (memcmp(data, kSafariExtensionsBlock, len) != 0) return; @@ -1974,7 +1974,7 @@ static int tls1_alpn_handle_client_hello(SSL *s, const unsigned char *data, } static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, - unsigned char *d, int n, int *al) + unsigned char *limit, int *al) { unsigned short type; unsigned short size; @@ -1999,7 +1999,7 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, # ifndef OPENSSL_NO_EC if (s->options & SSL_OP_SAFARI_ECDHE_ECDSA_BUG) - ssl_check_for_safari(s, data, d, n); + ssl_check_for_safari(s, data, limit); # endif /* !OPENSSL_NO_EC */ /* Clear any signature algorithms extension received */ @@ -2016,22 +2016,22 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, s->srtp_profile = NULL; - if (data == d + n) + if (data == limit) goto ri_check; - if (data > (d + n - 2)) + if (data > (limit - 2)) goto err; n2s(data, len); - if (data > (d + n - len)) + if (data + len != limit) goto err; - while (data <= (d + n - 4)) { + while (data <= (limit - 4)) { n2s(data, type); n2s(data, size); - if (data + size > (d + n)) + if (data + size > (limit)) goto err; # if 0 fprintf(stderr, "Received extension type %d size %d\n", type, size); @@ -2405,7 +2405,7 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, } /* Spurious data on the end */ - if (data != d + n) + if (data != limit) goto err; *p = data; @@ -2465,8 +2465,8 @@ static int ssl_scan_clienthello_custom_tlsext(SSL *s, return 1; } -int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, - int n) +int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, + unsigned char *limit) { int al = -1; unsigned char *ptmp = *p; @@ -2476,7 +2476,7 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, * switch the parent context using SSL_set_SSL_CTX and custom extensions * need to be handled by the new SSL_CTX structure. */ - if (ssl_scan_clienthello_tlsext(s, p, d, n, &al) <= 0) { + if (ssl_scan_clienthello_tlsext(s, p, limit, &al) <= 0) { ssl3_send_alert(s, SSL3_AL_FATAL, al); return 0; } @@ -2487,7 +2487,7 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, } custom_ext_init(&s->cert->srv_ext); - if (ssl_scan_clienthello_custom_tlsext(s, ptmp, d + n, &al) <= 0) { + if (ssl_scan_clienthello_custom_tlsext(s, ptmp, limit, &al) <= 0) { ssl3_send_alert(s, SSL3_AL_FATAL, al); return 0; } @@ -3157,22 +3157,20 @@ int ssl_check_serverhello_tlsext(SSL *s) } # endif + OPENSSL_free(s->tlsext_ocsp_resp); + s->tlsext_ocsp_resp = NULL; + s->tlsext_ocsp_resplen = -1; /* * If we've requested certificate status and we wont get one tell the * callback */ if ((s->tlsext_status_type != -1) && !(s->tlsext_status_expected) - && s->ctx && s->ctx->tlsext_status_cb) { + && !(s->hit) && s->ctx && s->ctx->tlsext_status_cb) { int r; /* - * Set resp to NULL, resplen to -1 so callback knows there is no - * response. + * Call callback with resp == NULL and resplen == -1 so callback + * knows there is no response */ - if (s->tlsext_ocsp_resp) { - OPENSSL_free(s->tlsext_ocsp_resp); - s->tlsext_ocsp_resp = NULL; - } - s->tlsext_ocsp_resplen = -1; r = s->ctx->tlsext_status_cb(s, s->ctx->tlsext_status_arg); if (r == 0) { al = SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE; @@ -3385,10 +3383,13 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick, /* Check key name matches */ if (memcmp(etick, tctx->tlsext_tick_key_name, 16)) return 2; - HMAC_Init_ex(&hctx, tctx->tlsext_tick_hmac_key, 16, - tlsext_tick_md(), NULL); - EVP_DecryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, - tctx->tlsext_tick_aes_key, etick + 16); + if (HMAC_Init_ex(&hctx, tctx->tlsext_tick_hmac_key, 16, + tlsext_tick_md(), NULL) <= 0 + || EVP_DecryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, + tctx->tlsext_tick_aes_key, + etick + 16) <= 0) { + goto err; + } } /* * Attempt to process session ticket, first conduct sanity and integrity @@ -3396,13 +3397,14 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick, */ mlen = HMAC_size(&hctx); if (mlen < 0) { - EVP_CIPHER_CTX_cleanup(&ctx); - return -1; + goto err; } eticklen -= mlen; /* Check HMAC of encrypted ticket */ - HMAC_Update(&hctx, etick, eticklen); - HMAC_Final(&hctx, tick_hmac, NULL); + if (HMAC_Update(&hctx, etick, eticklen) <= 0 + || HMAC_Final(&hctx, tick_hmac, NULL) <= 0) { + goto err; + } HMAC_CTX_cleanup(&hctx); if (CRYPTO_memcmp(tick_hmac, etick + eticklen, mlen)) { EVP_CIPHER_CTX_cleanup(&ctx); @@ -3413,11 +3415,10 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick, p = etick + 16 + EVP_CIPHER_CTX_iv_length(&ctx); eticklen -= 16 + EVP_CIPHER_CTX_iv_length(&ctx); sdec = OPENSSL_malloc(eticklen); - if (!sdec) { + if (!sdec || EVP_DecryptUpdate(&ctx, sdec, &slen, p, eticklen) <= 0) { EVP_CIPHER_CTX_cleanup(&ctx); return -1; } - EVP_DecryptUpdate(&ctx, sdec, &slen, p, eticklen); if (EVP_DecryptFinal(&ctx, sdec + slen, &mlen) <= 0) { EVP_CIPHER_CTX_cleanup(&ctx); OPENSSL_free(sdec); @@ -3450,6 +3451,10 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick, * For session parse failure, indicate that we need to send a new ticket. */ return 2; +err: + EVP_CIPHER_CTX_cleanup(&ctx); + HMAC_CTX_cleanup(&hctx); + return -1; } /* Tables to translate from NIDs to TLS v1.2 ids */ @@ -3576,7 +3581,7 @@ static int tls12_get_pkey_idx(unsigned char sig_alg) static void tls1_lookup_sigalg(int *phash_nid, int *psign_nid, int *psignhash_nid, const unsigned char *data) { - int sign_nid = 0, hash_nid = 0; + int sign_nid = NID_undef, hash_nid = NID_undef; if (!phash_nid && !psign_nid && !psignhash_nid) return; if (phash_nid || psignhash_nid) { @@ -3592,9 +3597,9 @@ static void tls1_lookup_sigalg(int *phash_nid, int *psign_nid, *psign_nid = sign_nid; } if (psignhash_nid) { - if (sign_nid && hash_nid) - OBJ_find_sigid_by_algs(psignhash_nid, hash_nid, sign_nid); - else + if (sign_nid == NID_undef || hash_nid == NID_undef + || OBJ_find_sigid_by_algs(psignhash_nid, hash_nid, + sign_nid) <= 0) *psignhash_nid = NID_undef; } } diff --git a/deps/openssl/openssl/ssl/tls1.h b/deps/openssl/openssl/ssl/tls1.h index 5929607ff8b6ef..7e237d0631a3c4 100644 --- a/deps/openssl/openssl/ssl/tls1.h +++ b/deps/openssl/openssl/ssl/tls1.h @@ -231,13 +231,12 @@ extern "C" { /* ExtensionType value from RFC5620 */ # define TLSEXT_TYPE_heartbeat 15 -/* ExtensionType value from draft-ietf-tls-applayerprotoneg-00 */ +/* ExtensionType value from RFC7301 */ # define TLSEXT_TYPE_application_layer_protocol_negotiation 16 /* * ExtensionType value for TLS padding extension. - * http://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml - * http://tools.ietf.org/html/draft-agl-tls-padding-03 + * http://tools.ietf.org/html/draft-agl-tls-padding */ # define TLSEXT_TYPE_padding 21 @@ -262,20 +261,19 @@ extern "C" { # define TLSEXT_TYPE_next_proto_neg 13172 # endif -/* NameType value from RFC 3546 */ +/* NameType value from RFC3546 */ # define TLSEXT_NAMETYPE_host_name 0 -/* status request value from RFC 3546 */ +/* status request value from RFC3546 */ # define TLSEXT_STATUSTYPE_ocsp 1 -/* ECPointFormat values from draft-ietf-tls-ecc-12 */ +/* ECPointFormat values from RFC4492 */ # define TLSEXT_ECPOINTFORMAT_first 0 # define TLSEXT_ECPOINTFORMAT_uncompressed 0 # define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime 1 # define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2 2 # define TLSEXT_ECPOINTFORMAT_last 2 -/* Signature and hash algorithms from RFC 5246 */ - +/* Signature and hash algorithms from RFC5246 */ # define TLSEXT_signature_anonymous 0 # define TLSEXT_signature_rsa 1 # define TLSEXT_signature_dsa 2 @@ -430,7 +428,6 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) # define TLS1_CK_DHE_DSS_WITH_RC4_128_SHA 0x03000066 /* AES ciphersuites from RFC3268 */ - # define TLS1_CK_RSA_WITH_AES_128_SHA 0x0300002F # define TLS1_CK_DH_DSS_WITH_AES_128_SHA 0x03000030 # define TLS1_CK_DH_RSA_WITH_AES_128_SHA 0x03000031 @@ -595,7 +592,7 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) # define TLS1_TXT_DHE_RSA_WITH_AES_256_SHA "DHE-RSA-AES256-SHA" # define TLS1_TXT_ADH_WITH_AES_256_SHA "ADH-AES256-SHA" -/* ECC ciphersuites from draft-ietf-tls-ecc-01.txt (Mar 15, 2001) */ +/* ECC ciphersuites from RFC4492 */ # define TLS1_TXT_ECDH_ECDSA_WITH_NULL_SHA "ECDH-ECDSA-NULL-SHA" # define TLS1_TXT_ECDH_ECDSA_WITH_RC4_128_SHA "ECDH-ECDSA-RC4-SHA" # define TLS1_TXT_ECDH_ECDSA_WITH_DES_192_CBC3_SHA "ECDH-ECDSA-DES-CBC3-SHA" diff --git a/deps/openssl/openssl/test/Makefile b/deps/openssl/openssl/test/Makefile index e695073fd3f54a..e566babfa59d42 100644 --- a/deps/openssl/openssl/test/Makefile +++ b/deps/openssl/openssl/test/Makefile @@ -69,6 +69,8 @@ ASN1TEST= asn1test HEARTBEATTEST= heartbeat_test CONSTTIMETEST= constant_time_test VERIFYEXTRATEST= verify_extra_test +CLIENTHELLOTEST= clienthellotest +SSLV2CONFTEST = sslv2conftest TESTS= alltests @@ -81,7 +83,8 @@ EXE= $(BNTEST)$(EXE_EXT) $(ECTEST)$(EXE_EXT) $(ECDSATEST)$(EXE_EXT) $(ECDHTEST) $(BFTEST)$(EXE_EXT) $(CASTTEST)$(EXE_EXT) $(SSLTEST)$(EXE_EXT) $(EXPTEST)$(EXE_EXT) $(DSATEST)$(EXE_EXT) $(RSATEST)$(EXE_EXT) \ $(EVPTEST)$(EXE_EXT) $(EVPEXTRATEST)$(EXE_EXT) $(IGETEST)$(EXE_EXT) $(JPAKETEST)$(EXE_EXT) $(SRPTEST)$(EXE_EXT) \ $(ASN1TEST)$(EXE_EXT) $(V3NAMETEST)$(EXE_EXT) $(HEARTBEATTEST)$(EXE_EXT) \ - $(CONSTTIMETEST)$(EXE_EXT) $(VERIFYEXTRATEST)$(EXE_EXT) + $(CONSTTIMETEST)$(EXE_EXT) $(VERIFYEXTRATEST)$(EXE_EXT) \ + $(CLIENTHELLOTEST)$(EXE_EXT) $(SSLV2CONFTEST)$(EXE_EXT) # $(METHTEST)$(EXE_EXT) @@ -94,7 +97,8 @@ OBJ= $(BNTEST).o $(ECTEST).o $(ECDSATEST).o $(ECDHTEST).o $(IDEATEST).o \ $(RANDTEST).o $(DHTEST).o $(ENGINETEST).o $(CASTTEST).o \ $(BFTEST).o $(SSLTEST).o $(DSATEST).o $(EXPTEST).o $(RSATEST).o \ $(EVPTEST).o $(EVPEXTRATEST).o $(IGETEST).o $(JPAKETEST).o $(ASN1TEST).o $(V3NAMETEST).o \ - $(HEARTBEATTEST).o $(CONSTTIMETEST).o $(VERIFYEXTRATEST).o + $(HEARTBEATTEST).o $(CONSTTIMETEST).o $(VERIFYEXTRATEST).o \ + $(CLIENTHELLOTEST).o $(SSLV2CONFTEST).o SRC= $(BNTEST).c $(ECTEST).c $(ECDSATEST).c $(ECDHTEST).c $(IDEATEST).c \ $(MD2TEST).c $(MD4TEST).c $(MD5TEST).c \ @@ -104,7 +108,8 @@ SRC= $(BNTEST).c $(ECTEST).c $(ECDSATEST).c $(ECDHTEST).c $(IDEATEST).c \ $(RANDTEST).c $(DHTEST).c $(ENGINETEST).c $(CASTTEST).c \ $(BFTEST).c $(SSLTEST).c $(DSATEST).c $(EXPTEST).c $(RSATEST).c \ $(EVPTEST).c $(EVPEXTRATEST).c $(IGETEST).c $(JPAKETEST).c $(SRPTEST).c $(ASN1TEST).c \ - $(V3NAMETEST).c $(HEARTBEATTEST).c $(CONSTTIMETEST).c $(VERIFYEXTRATEST).c + $(V3NAMETEST).c $(HEARTBEATTEST).c $(CONSTTIMETEST).c $(VERIFYEXTRATEST).c \ + $(CLIENTHELLOTEST).c $(SSLV2CONFTEST).c EXHEADER= HEADER= testutil.h $(EXHEADER) @@ -148,7 +153,7 @@ alltests: \ test_gen test_req test_pkcs7 test_verify test_dh test_dsa \ test_ss test_ca test_engine test_evp test_evp_extra test_ssl test_tsa test_ige \ test_jpake test_srp test_cms test_ocsp test_v3name test_heartbeat \ - test_constant_time test_verify_extra + test_constant_time test_verify_extra test_clienthello test_sslv2conftest test_evp: $(EVPTEST)$(EXE_EXT) evptests.txt ../util/shlib_wrap.sh ./$(EVPTEST) evptests.txt @@ -241,7 +246,7 @@ test_bn: $(BNTEST)$(EXE_EXT) $(EXPTEST)$(EXE_EXT) bctest @../util/shlib_wrap.sh ./$(BNTEST) >tmp.bntest @echo quit >>tmp.bntest @echo "running bc" - @) {if (/^test (.*)/) {print STDERR "\nverify $$1";} elsif (!/^0$$/) {die "\nFailed! bc: $$_";} else {print STDERR "."; $$i++;}} print STDERR "\n$$i tests passed\n"' + @) {if (/^test (.*)/) {print STDERR "\nverify $$1";} elsif (!/^0\r?$$/) {die "\nFailed! bc: $$_";} else {print STDERR "."; $$i++;}} print STDERR "\n$$i tests passed\n"' @echo 'test a^b%c implementations' ../util/shlib_wrap.sh ./$(EXPTEST) @@ -353,6 +358,14 @@ test_verify_extra: $(VERIFYEXTRATEST)$(EXE_EXT) @echo $(START) $@ ../util/shlib_wrap.sh ./$(VERIFYEXTRATEST) +test_clienthello: $(CLIENTHELLOTEST)$(EXE_EXT) + @echo $(START) $@ + ../util/shlib_wrap.sh ./$(CLIENTHELLOTEST) + +test_sslv2conftest: $(SSLV2CONFTEST)$(EXE_EXT) + @echo $(START) $@ + ../util/shlib_wrap.sh ./$(SSLV2CONFTEST) + lint: lint -DLINT $(INCLUDES) $(SRC)>fluff @@ -527,6 +540,12 @@ $(CONSTTIMETEST)$(EXE_EXT): $(CONSTTIMETEST).o $(VERIFYEXTRATEST)$(EXE_EXT): $(VERIFYEXTRATEST).o @target=$(VERIFYEXTRATEST) $(BUILD_CMD) +$(CLIENTHELLOTEST)$(EXE_EXT): $(CLIENTHELLOTEST).o + @target=$(CLIENTHELLOTEST) $(BUILD_CMD) + +$(SSLV2CONFTEST)$(EXE_EXT): $(SSLV2CONFTEST).o + @target=$(SSLV2CONFTEST) $(BUILD_CMD) + #$(AESTEST).o: $(AESTEST).c # $(CC) -c $(CFLAGS) -DINTERMEDIATE_VALUE_KAT -DTRACE_KAT_MCT $(AESTEST).c @@ -572,6 +591,26 @@ bntest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h bntest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h bntest.c casttest.o: ../e_os.h ../include/openssl/cast.h ../include/openssl/e_os2.h casttest.o: ../include/openssl/opensslconf.h casttest.c +clienthellotest.o: ../include/openssl/asn1.h ../include/openssl/bio.h +clienthellotest.o: ../include/openssl/buffer.h ../include/openssl/comp.h +clienthellotest.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h +clienthellotest.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +clienthellotest.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +clienthellotest.o: ../include/openssl/err.h ../include/openssl/evp.h +clienthellotest.o: ../include/openssl/hmac.h ../include/openssl/kssl.h +clienthellotest.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +clienthellotest.o: ../include/openssl/objects.h +clienthellotest.o: ../include/openssl/opensslconf.h +clienthellotest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +clienthellotest.o: ../include/openssl/pem.h ../include/openssl/pem2.h +clienthellotest.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h +clienthellotest.o: ../include/openssl/safestack.h ../include/openssl/sha.h +clienthellotest.o: ../include/openssl/srtp.h ../include/openssl/ssl.h +clienthellotest.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h +clienthellotest.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +clienthellotest.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h +clienthellotest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +clienthellotest.o: clienthellotest.c constant_time_test.o: ../crypto/constant_time_locl.h ../e_os.h constant_time_test.o: ../include/openssl/e_os2.h constant_time_test.o: ../include/openssl/opensslconf.h constant_time_test.c @@ -817,6 +856,25 @@ ssltest.o: ../include/openssl/ssl3.h ../include/openssl/stack.h ssltest.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h ssltest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h ssltest.o: ../include/openssl/x509v3.h ssltest.c +sslv2conftest.o: ../include/openssl/asn1.h ../include/openssl/bio.h +sslv2conftest.o: ../include/openssl/buffer.h ../include/openssl/comp.h +sslv2conftest.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h +sslv2conftest.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +sslv2conftest.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +sslv2conftest.o: ../include/openssl/err.h ../include/openssl/evp.h +sslv2conftest.o: ../include/openssl/hmac.h ../include/openssl/kssl.h +sslv2conftest.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +sslv2conftest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h +sslv2conftest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +sslv2conftest.o: ../include/openssl/pem.h ../include/openssl/pem2.h +sslv2conftest.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h +sslv2conftest.o: ../include/openssl/safestack.h ../include/openssl/sha.h +sslv2conftest.o: ../include/openssl/srtp.h ../include/openssl/ssl.h +sslv2conftest.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h +sslv2conftest.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +sslv2conftest.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h +sslv2conftest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h +sslv2conftest.o: sslv2conftest.c v3nametest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h v3nametest.o: ../include/openssl/buffer.h ../include/openssl/conf.h v3nametest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h diff --git a/deps/openssl/openssl/test/bftest.c b/deps/openssl/openssl/test/bftest.c deleted file mode 120000 index 78b1749a4d1ad2..00000000000000 --- a/deps/openssl/openssl/test/bftest.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/bf/bftest.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/bntest.c b/deps/openssl/openssl/test/bntest.c deleted file mode 120000 index 03f54a238ef1d3..00000000000000 --- a/deps/openssl/openssl/test/bntest.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/bn/bntest.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/casttest.c b/deps/openssl/openssl/test/casttest.c deleted file mode 120000 index ac7ede8d795c61..00000000000000 --- a/deps/openssl/openssl/test/casttest.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/cast/casttest.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/certs/pss1.pem b/deps/openssl/openssl/test/certs/pss1.pem new file mode 100644 index 00000000000000..29da71dae8ae4d --- /dev/null +++ b/deps/openssl/openssl/test/certs/pss1.pem @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDdjCCAjqgAwIBAgIJANcwZLyfEv7DMD4GCSqGSIb3DQEBCjAxoA0wCwYJYIZI +AWUDBAIBoRowGAYJKoZIhvcNAQEIMAsGCWCGSAFlAwQCAaIEAgIA3jAnMSUwIwYD +VQQDDBxUZXN0IEludmFsaWQgUFNTIGNlcnRpZmljYXRlMB4XDTE1MTEwNDE2MDIz +NVoXDTE1MTIwNDE2MDIzNVowJzElMCMGA1UEAwwcVGVzdCBJbnZhbGlkIFBTUyBj +ZXJ0aWZpY2F0ZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMTaM7WH +qVCAGAIA+zL1KWvvASTrhlq+1ePdO7wsrWX2KiYoTYrJYTnxhLnn0wrHqApt79nL +IBG7cfShyZqFHOY/IzlYPMVt+gPo293gw96Fds5JBsjhjkyGnOyr9OUntFqvxDbT +IIFU7o9IdxD4edaqjRv+fegVE+B79pDk4s0ujsk6dULtCg9Rst0ucGFo19mr+b7k +dbfn8pZ72ZNDJPueVdrUAWw9oll61UcYfk75XdrLk6JlL41GrYHc8KlfXf43gGQq +QfrpHkg4Ih2cI6Wt2nhFGAzrlcorzLliQIUJRIhM8h4IgDfpBpaPdVQLqS2pFbXa +5eQjqiyJwak2vJ8CAwEAAaNQME4wHQYDVR0OBBYEFCt180N4oGUt5LbzBwQ4Ia+2 +4V97MB8GA1UdIwQYMBaAFCt180N4oGUt5LbzBwQ4Ia+24V97MAwGA1UdEwQFMAMB +Af8wMQYJKoZIhvcNAQEKMCSgDTALBglghkgBZQMEAgGhDTALBgkqhkiG9w0BAQii +BAICAN4DggEBAAjBtm90lGxgddjc4Xu/nbXXFHVs2zVcHv/mqOZoQkGB9r/BVgLb +xhHrFZ2pHGElbUYPfifdS9ztB73e1d4J+P29o0yBqfd4/wGAc/JA8qgn6AAEO/Xn +plhFeTRJQtLZVl75CkHXgUGUd3h+ADvKtcBuW9dSUncaUrgNKR8u/h/2sMG38RWY +DzBddC/66YTa3r7KkVUfW7yqRQfELiGKdcm+bjlTEMsvS+EhHup9CzbpoCx2Fx9p +NPtFY3yEObQhmL1JyoCRWqBE75GzFPbRaiux5UpEkns+i3trkGssZzsOuVqHNTNZ +lC9+9hPHIoc9UMmAQNo1vGIW3NWVoeGbaJ8= +-----END CERTIFICATE----- diff --git a/deps/openssl/openssl/test/constant_time_test.c b/deps/openssl/openssl/test/constant_time_test.c deleted file mode 120000 index 519f2f35114d8c..00000000000000 --- a/deps/openssl/openssl/test/constant_time_test.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/constant_time_test.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/destest.c b/deps/openssl/openssl/test/destest.c deleted file mode 120000 index 5988c7303a3789..00000000000000 --- a/deps/openssl/openssl/test/destest.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/des/destest.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/dhtest.c b/deps/openssl/openssl/test/dhtest.c deleted file mode 120000 index 9a67f9162884dc..00000000000000 --- a/deps/openssl/openssl/test/dhtest.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/dh/dhtest.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/dsatest.c b/deps/openssl/openssl/test/dsatest.c deleted file mode 120000 index 16a1b5a349f314..00000000000000 --- a/deps/openssl/openssl/test/dsatest.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/dsa/dsatest.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/ecdhtest.c b/deps/openssl/openssl/test/ecdhtest.c deleted file mode 120000 index 206d98686d7dd3..00000000000000 --- a/deps/openssl/openssl/test/ecdhtest.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/ecdh/ecdhtest.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/ecdsatest.c b/deps/openssl/openssl/test/ecdsatest.c deleted file mode 120000 index 441082ba24381a..00000000000000 --- a/deps/openssl/openssl/test/ecdsatest.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/ecdsa/ecdsatest.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/ectest.c b/deps/openssl/openssl/test/ectest.c deleted file mode 120000 index df1831f812c540..00000000000000 --- a/deps/openssl/openssl/test/ectest.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/ec/ectest.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/enginetest.c b/deps/openssl/openssl/test/enginetest.c deleted file mode 120000 index 5c74a6f418995f..00000000000000 --- a/deps/openssl/openssl/test/enginetest.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/engine/enginetest.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/evp_extra_test.c b/deps/openssl/openssl/test/evp_extra_test.c deleted file mode 120000 index 2f2a8f7b08aaad..00000000000000 --- a/deps/openssl/openssl/test/evp_extra_test.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/evp/evp_extra_test.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/evp_test.c b/deps/openssl/openssl/test/evp_test.c deleted file mode 120000 index 074162812a3856..00000000000000 --- a/deps/openssl/openssl/test/evp_test.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/evp/evp_test.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/evptests.txt b/deps/openssl/openssl/test/evptests.txt deleted file mode 100644 index 4e9958b3b5bc07..00000000000000 --- a/deps/openssl/openssl/test/evptests.txt +++ /dev/null @@ -1,401 +0,0 @@ -#cipher:key:iv:plaintext:ciphertext:0/1(decrypt/encrypt) -#aadcipher:key:iv:plaintext:ciphertext:aad:tag:0/1(decrypt/encrypt) -#digest:::input:output - -# SHA(1) tests (from shatest.c) -SHA1:::616263:a9993e364706816aba3e25717850c26c9cd0d89d - -# MD5 tests (from md5test.c) -MD5::::d41d8cd98f00b204e9800998ecf8427e -MD5:::61:0cc175b9c0f1b6a831c399e269772661 -MD5:::616263:900150983cd24fb0d6963f7d28e17f72 -MD5:::6d65737361676520646967657374:f96b697d7cb7938d525a2f31aaf161d0 -MD5:::6162636465666768696a6b6c6d6e6f707172737475767778797a:c3fcd3d76192e4007dfb496cca67e13b -MD5:::4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a30313233343536373839:d174ab98d277d9f5a5611c2c9f419d9f -MD5:::3132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930:57edf4a22be3c955ac49da2e2107b67a - -# AES 128 ECB tests (from FIPS-197 test vectors, encrypt) - -AES-128-ECB:000102030405060708090A0B0C0D0E0F::00112233445566778899AABBCCDDEEFF:69C4E0D86A7B0430D8CDB78070B4C55A:1 - -# AES 192 ECB tests (from FIPS-197 test vectors, encrypt) - -AES-192-ECB:000102030405060708090A0B0C0D0E0F1011121314151617::00112233445566778899AABBCCDDEEFF:DDA97CA4864CDFE06EAF70A0EC0D7191:1 - -# AES 256 ECB tests (from FIPS-197 test vectors, encrypt) - -AES-256-ECB:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F::00112233445566778899AABBCCDDEEFF:8EA2B7CA516745BFEAFC49904B496089:1 - -# AES 128 ECB tests (from NIST test vectors, encrypt) - -#AES-128-ECB:00000000000000000000000000000000::00000000000000000000000000000000:C34C052CC0DA8D73451AFE5F03BE297F:1 - -# AES 128 ECB tests (from NIST test vectors, decrypt) - -#AES-128-ECB:00000000000000000000000000000000::44416AC2D1F53C583303917E6BE9EBE0:00000000000000000000000000000000:0 - -# AES 192 ECB tests (from NIST test vectors, decrypt) - -#AES-192-ECB:000000000000000000000000000000000000000000000000::48E31E9E256718F29229319C19F15BA4:00000000000000000000000000000000:0 - -# AES 256 ECB tests (from NIST test vectors, decrypt) - -#AES-256-ECB:0000000000000000000000000000000000000000000000000000000000000000::058CCFFDBBCB382D1F6F56585D8A4ADE:00000000000000000000000000000000:0 - -# AES 128 CBC tests (from NIST test vectors, encrypt) - -#AES-128-CBC:00000000000000000000000000000000:00000000000000000000000000000000:00000000000000000000000000000000:8A05FC5E095AF4848A08D328D3688E3D:1 - -# AES 192 CBC tests (from NIST test vectors, encrypt) - -#AES-192-CBC:000000000000000000000000000000000000000000000000:00000000000000000000000000000000:00000000000000000000000000000000:7BD966D53AD8C1BB85D2ADFAE87BB104:1 - -# AES 256 CBC tests (from NIST test vectors, encrypt) - -#AES-256-CBC:0000000000000000000000000000000000000000000000000000000000000000:00000000000000000000000000000000:00000000000000000000000000000000:FE3C53653E2F45B56FCD88B2CC898FF0:1 - -# AES 128 CBC tests (from NIST test vectors, decrypt) - -#AES-128-CBC:00000000000000000000000000000000:00000000000000000000000000000000:FACA37E0B0C85373DF706E73F7C9AF86:00000000000000000000000000000000:0 - -# AES tests from NIST document SP800-38A -# For all ECB encrypts and decrypts, the transformed sequence is -# AES-bits-ECB:key::plaintext:ciphertext:encdec -# ECB-AES128.Encrypt and ECB-AES128.Decrypt -AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::6BC1BEE22E409F96E93D7E117393172A:3AD77BB40D7A3660A89ECAF32466EF97 -AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::AE2D8A571E03AC9C9EB76FAC45AF8E51:F5D3D58503B9699DE785895A96FDBAAF -AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::30C81C46A35CE411E5FBC1191A0A52EF:43B1CD7F598ECE23881B00E3ED030688 -AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::F69F2445DF4F9B17AD2B417BE66C3710:7B0C785E27E8AD3F8223207104725DD4 -# ECB-AES192.Encrypt and ECB-AES192.Decrypt -AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::6BC1BEE22E409F96E93D7E117393172A:BD334F1D6E45F25FF712A214571FA5CC -AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::AE2D8A571E03AC9C9EB76FAC45AF8E51:974104846D0AD3AD7734ECB3ECEE4EEF -AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::30C81C46A35CE411E5FBC1191A0A52EF:EF7AFD2270E2E60ADCE0BA2FACE6444E -AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::F69F2445DF4F9B17AD2B417BE66C3710:9A4B41BA738D6C72FB16691603C18E0E -# ECB-AES256.Encrypt and ECB-AES256.Decrypt -AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::6BC1BEE22E409F96E93D7E117393172A:F3EED1BDB5D2A03C064B5A7E3DB181F8 -AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::AE2D8A571E03AC9C9EB76FAC45AF8E51:591CCB10D410ED26DC5BA74A31362870 -AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::30C81C46A35CE411E5FBC1191A0A52EF:B6ED21B99CA6F4F9F153E7B1BEAFED1D -AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::F69F2445DF4F9B17AD2B417BE66C3710:23304B7A39F9F3FF067D8D8F9E24ECC7 -# For all CBC encrypts and decrypts, the transformed sequence is -# AES-bits-CBC:key:IV/ciphertext':plaintext:ciphertext:encdec -# CBC-AES128.Encrypt and CBC-AES128.Decrypt -AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:7649ABAC8119B246CEE98E9B12E9197D -AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:7649ABAC8119B246CEE98E9B12E9197D:AE2D8A571E03AC9C9EB76FAC45AF8E51:5086CB9B507219EE95DB113A917678B2 -AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:5086CB9B507219EE95DB113A917678B2:30C81C46A35CE411E5FBC1191A0A52EF:73BED6B8E3C1743B7116E69E22229516 -AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:73BED6B8E3C1743B7116E69E22229516:F69F2445DF4F9B17AD2B417BE66C3710:3FF1CAA1681FAC09120ECA307586E1A7 -# CBC-AES192.Encrypt and CBC-AES192.Decrypt -AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:4F021DB243BC633D7178183A9FA071E8 -AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:4F021DB243BC633D7178183A9FA071E8:AE2D8A571E03AC9C9EB76FAC45AF8E51:B4D9ADA9AD7DEDF4E5E738763F69145A -AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:B4D9ADA9AD7DEDF4E5E738763F69145A:30C81C46A35CE411E5FBC1191A0A52EF:571B242012FB7AE07FA9BAAC3DF102E0 -AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:571B242012FB7AE07FA9BAAC3DF102E0:F69F2445DF4F9B17AD2B417BE66C3710:08B0E27988598881D920A9E64F5615CD -# CBC-AES256.Encrypt and CBC-AES256.Decrypt -AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:F58C4C04D6E5F1BA779EABFB5F7BFBD6 -AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:F58C4C04D6E5F1BA779EABFB5F7BFBD6:AE2D8A571E03AC9C9EB76FAC45AF8E51:9CFC4E967EDB808D679F777BC6702C7D -AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:9CFC4E967EDB808D679F777BC6702C7D:30C81C46A35CE411E5FBC1191A0A52EF:39F23369A9D9BACFA530E26304231461 -AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:39F23369A9D9BACFA530E26304231461:F69F2445DF4F9B17AD2B417BE66C3710:B2EB05E2C39BE9FCDA6C19078C6A9D1B -# We don't support CFB{1,8}-AESxxx.{En,De}crypt -# For all CFB128 encrypts and decrypts, the transformed sequence is -# AES-bits-CFB:key:IV/ciphertext':plaintext:ciphertext:encdec -# CFB128-AES128.Encrypt -AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:1 -AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:3B3FD92EB72DAD20333449F8E83CFB4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:C8A64537A0B3A93FCDE3CDAD9F1CE58B:1 -AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:C8A64537A0B3A93FCDE3CDAD9F1CE58B:30C81C46A35CE411E5FBC1191A0A52EF:26751F67A3CBB140B1808CF187A4F4DF:1 -AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:26751F67A3CBB140B1808CF187A4F4DF:F69F2445DF4F9B17AD2B417BE66C3710:C04B05357C5D1C0EEAC4C66F9FF7F2E6:1 -# CFB128-AES128.Decrypt -AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:0 -AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:3B3FD92EB72DAD20333449F8E83CFB4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:C8A64537A0B3A93FCDE3CDAD9F1CE58B:0 -AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:C8A64537A0B3A93FCDE3CDAD9F1CE58B:30C81C46A35CE411E5FBC1191A0A52EF:26751F67A3CBB140B1808CF187A4F4DF:0 -AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:26751F67A3CBB140B1808CF187A4F4DF:F69F2445DF4F9B17AD2B417BE66C3710:C04B05357C5D1C0EEAC4C66F9FF7F2E6:0 -# CFB128-AES192.Encrypt -AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:1 -AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:CDC80D6FDDF18CAB34C25909C99A4174:AE2D8A571E03AC9C9EB76FAC45AF8E51:67CE7F7F81173621961A2B70171D3D7A:1 -AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:67CE7F7F81173621961A2B70171D3D7A:30C81C46A35CE411E5FBC1191A0A52EF:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:1 -AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:F69F2445DF4F9B17AD2B417BE66C3710:C05F9F9CA9834FA042AE8FBA584B09FF:1 -# CFB128-AES192.Decrypt -AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:0 -AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:CDC80D6FDDF18CAB34C25909C99A4174:AE2D8A571E03AC9C9EB76FAC45AF8E51:67CE7F7F81173621961A2B70171D3D7A:0 -AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:67CE7F7F81173621961A2B70171D3D7A:30C81C46A35CE411E5FBC1191A0A52EF:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:0 -AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:F69F2445DF4F9B17AD2B417BE66C3710:C05F9F9CA9834FA042AE8FBA584B09FF:0 -# CFB128-AES256.Encrypt -AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:1 -AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DC7E84BFDA79164B7ECD8486985D3860:AE2D8A571E03AC9C9EB76FAC45AF8E51:39FFED143B28B1C832113C6331E5407B:1 -AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:39FFED143B28B1C832113C6331E5407B:30C81C46A35CE411E5FBC1191A0A52EF:DF10132415E54B92A13ED0A8267AE2F9:1 -AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DF10132415E54B92A13ED0A8267AE2F9:F69F2445DF4F9B17AD2B417BE66C3710:75A385741AB9CEF82031623D55B1E471:1 -# CFB128-AES256.Decrypt -AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:0 -AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DC7E84BFDA79164B7ECD8486985D3860:AE2D8A571E03AC9C9EB76FAC45AF8E51:39FFED143B28B1C832113C6331E5407B:0 -AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:39FFED143B28B1C832113C6331E5407B:30C81C46A35CE411E5FBC1191A0A52EF:DF10132415E54B92A13ED0A8267AE2F9:0 -AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DF10132415E54B92A13ED0A8267AE2F9:F69F2445DF4F9B17AD2B417BE66C3710:75A385741AB9CEF82031623D55B1E471:0 -# For all OFB encrypts and decrypts, the transformed sequence is -# AES-bits-CFB:key:IV/output':plaintext:ciphertext:encdec -# OFB-AES128.Encrypt -AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:1 -AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:7789508D16918F03F53C52DAC54ED825:1 -AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:9740051E9C5FECF64344F7A82260EDCC:1 -AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:304C6528F659C77866A510D9C1D6AE5E:1 -# OFB-AES128.Decrypt -AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:0 -AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:7789508D16918F03F53C52DAC54ED825:0 -AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:9740051E9C5FECF64344F7A82260EDCC:0 -AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:304C6528F659C77866A510D9C1D6AE5E:0 -# OFB-AES192.Encrypt -AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:1 -AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:FCC28B8D4C63837C09E81700C1100401:1 -AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:8D9A9AEAC0F6596F559C6D4DAF59A5F2:1 -AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:6D9F200857CA6C3E9CAC524BD9ACC92A:1 -# OFB-AES192.Decrypt -AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:0 -AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:FCC28B8D4C63837C09E81700C1100401:0 -AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:8D9A9AEAC0F6596F559C6D4DAF59A5F2:0 -AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:6D9F200857CA6C3E9CAC524BD9ACC92A:0 -# OFB-AES256.Encrypt -AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:1 -AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:4FEBDC6740D20B3AC88F6AD82A4FB08D:1 -AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:71AB47A086E86EEDF39D1C5BBA97C408:1 -AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0126141D67F37BE8538F5A8BE740E484:1 -# OFB-AES256.Decrypt -AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:0 -AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:4FEBDC6740D20B3AC88F6AD82A4FB08D:0 -AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:71AB47A086E86EEDF39D1C5BBA97C408:0 -AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0126141D67F37BE8538F5A8BE740E484:0 - -# AES Counter test vectors from RFC3686 -aes-128-ctr:AE6852F8121067CC4BF7A5765577F39E:00000030000000000000000000000001:53696E676C6520626C6F636B206D7367:E4095D4FB7A7B3792D6175A3261311B8:1 -aes-128-ctr:7E24067817FAE0D743D6CE1F32539163:006CB6DBC0543B59DA48D90B00000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F:5104A106168A72D9790D41EE8EDAD388EB2E1EFC46DA57C8FCE630DF9141BE28:1 -aes-128-ctr:7691BE035E5020A8AC6E618529F9A0DC:00E0017B27777F3F4A1786F000000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223:C1CF48A89F2FFDD9CF4652E9EFDB72D74540A42BDE6D7836D59A5CEAAEF3105325B2072F:1 - -aes-192-ctr:16AF5B145FC9F579C175F93E3BFB0EED863D06CCFDB78515:0000004836733C147D6D93CB00000001:53696E676C6520626C6F636B206D7367:4B55384FE259C9C84E7935A003CBE928:1 -aes-192-ctr:7C5CB2401B3DC33C19E7340819E0F69C678C3DB8E6F6A91A:0096B03B020C6EADC2CB500D00000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F:453243FC609B23327EDFAAFA7131CD9F8490701C5AD4A79CFC1FE0FF42F4FB00:1 -aes-192-ctr:02BF391EE8ECB159B959617B0965279BF59B60A786D3E0FE:0007BDFD5CBD60278DCC091200000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223:96893FC55E5C722F540B7DD1DDF7E758D288BC95C69165884536C811662F2188ABEE0935:1 - -aes-256-ctr:776BEFF2851DB06F4C8A0542C8696F6C6A81AF1EEC96B4D37FC1D689E6C1C104:00000060DB5672C97AA8F0B200000001:53696E676C6520626C6F636B206D7367:145AD01DBF824EC7560863DC71E3E0C0:1 -aes-256-ctr:F6D66D6BD52D59BB0796365879EFF886C66DD51A5B6A99744B50590C87A23884:00FAAC24C1585EF15A43D87500000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F:F05E231B3894612C49EE000B804EB2A9B8306B508F839D6A5530831D9344AF1C:1 -aes-256-ctr:FF7A617CE69148E4F1726E2F43581DE2AA62D9F805532EDFF1EED687FB54153D:001CC5B751A51D70A1C1114800000001:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223:EB6C52821D0BBBF7CE7594462ACA4FAAB407DF866569FD07F48CC0B583D6071F1EC0E6B8:1 - -# DES ECB tests (from destest) - -DES-ECB:0000000000000000::0000000000000000:8CA64DE9C1B123A7 -DES-ECB:FFFFFFFFFFFFFFFF::FFFFFFFFFFFFFFFF:7359B2163E4EDC58 -DES-ECB:3000000000000000::1000000000000001:958E6E627A05557B -DES-ECB:1111111111111111::1111111111111111:F40379AB9E0EC533 -DES-ECB:0123456789ABCDEF::1111111111111111:17668DFC7292532D -DES-ECB:1111111111111111::0123456789ABCDEF:8A5AE1F81AB8F2DD -DES-ECB:FEDCBA9876543210::0123456789ABCDEF:ED39D950FA74BCC4 - -# DESX-CBC tests (from destest) -DESX-CBC:0123456789abcdeff1e0d3c2b5a49786fedcba9876543210:fedcba9876543210:37363534333231204E6F77206973207468652074696D6520666F722000000000:846B2914851E9A2954732F8AA0A611C115CDC2D7951B1053A63C5E03B21AA3C4 - -# DES EDE3 CBC tests (from destest) -DES-EDE3-CBC:0123456789abcdeff1e0d3c2b5a49786fedcba9876543210:fedcba9876543210:37363534333231204E6F77206973207468652074696D6520666F722000000000:3FE301C962AC01D02213763C1CBD4CDC799657C064ECF5D41C673812CFDE9675 - -# RC4 tests (from rc4test) -RC4:0123456789abcdef0123456789abcdef::0123456789abcdef:75b7878099e0c596 -RC4:0123456789abcdef0123456789abcdef::0000000000000000:7494c2e7104b0879 -RC4:00000000000000000000000000000000::0000000000000000:de188941a3375d3a -RC4:ef012345ef012345ef012345ef012345::0000000000000000000000000000000000000000:d6a141a7ec3c38dfbd615a1162e1c7ba36b67858 -RC4:0123456789abcdef0123456789abcdef::123456789ABCDEF0123456789ABCDEF0123456789ABCDEF012345678:66a0949f8af7d6891f7f832ba833c00c892ebe30143ce28740011ecf -RC4:ef012345ef012345ef012345ef012345::00000000000000000000:d6a141a7ec3c38dfbd61 - - -# Camellia tests from RFC3713 -# For all ECB encrypts and decrypts, the transformed sequence is -# CAMELLIA-bits-ECB:key::plaintext:ciphertext:encdec -CAMELLIA-128-ECB:0123456789abcdeffedcba9876543210::0123456789abcdeffedcba9876543210:67673138549669730857065648eabe43 -CAMELLIA-192-ECB:0123456789abcdeffedcba98765432100011223344556677::0123456789abcdeffedcba9876543210:b4993401b3e996f84ee5cee7d79b09b9 -CAMELLIA-256-ECB:0123456789abcdeffedcba987654321000112233445566778899aabbccddeeff::0123456789abcdeffedcba9876543210:9acc237dff16d76c20ef7c919e3a7509 - -# ECB-CAMELLIA128.Encrypt -CAMELLIA-128-ECB:000102030405060708090A0B0C0D0E0F::00112233445566778899AABBCCDDEEFF:77CF412067AF8270613529149919546F:1 -CAMELLIA-192-ECB:000102030405060708090A0B0C0D0E0F1011121314151617::00112233445566778899AABBCCDDEEFF:B22F3C36B72D31329EEE8ADDC2906C68:1 -CAMELLIA-256-ECB:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F::00112233445566778899AABBCCDDEEFF:2EDF1F3418D53B88841FC8985FB1ECF2:1 - -# ECB-CAMELLIA128.Encrypt and ECB-CAMELLIA128.Decrypt -CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::6BC1BEE22E409F96E93D7E117393172A:432FC5DCD628115B7C388D770B270C96 -CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::AE2D8A571E03AC9C9EB76FAC45AF8E51:0BE1F14023782A22E8384C5ABB7FAB2B -CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::30C81C46A35CE411E5FBC1191A0A52EF:A0A1ABCD1893AB6FE0FE5B65DF5F8636 -CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::F69F2445DF4F9B17AD2B417BE66C3710:E61925E0D5DFAA9BB29F815B3076E51A - -# ECB-CAMELLIA192.Encrypt and ECB-CAMELLIA192.Decrypt -CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::6BC1BEE22E409F96E93D7E117393172A:CCCC6C4E138B45848514D48D0D3439D3 -CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::AE2D8A571E03AC9C9EB76FAC45AF8E51:5713C62C14B2EC0F8393B6AFD6F5785A -CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::30C81C46A35CE411E5FBC1191A0A52EF:B40ED2B60EB54D09D030CF511FEEF366 -CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::F69F2445DF4F9B17AD2B417BE66C3710:909DBD95799096748CB27357E73E1D26 - -# ECB-CAMELLIA256.Encrypt and ECB-CAMELLIA256.Decrypt -CAMELLIA-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::6BC1BEE22E409F96E93D7E117393172A:BEFD219B112FA00098919CD101C9CCFA -CAMELLIA-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::AE2D8A571E03AC9C9EB76FAC45AF8E51:C91D3A8F1AEA08A9386CF4B66C0169EA -CAMELLIA-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::30C81C46A35CE411E5FBC1191A0A52EF:A623D711DC5F25A51BB8A80D56397D28 -CAMELLIA-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::F69F2445DF4F9B17AD2B417BE66C3710:7960109FB6DC42947FCFE59EA3C5EB6B - -# For all CBC encrypts and decrypts, the transformed sequence is -# CAMELLIA-bits-CBC:key:IV/ciphertext':plaintext:ciphertext:encdec -# CBC-CAMELLIA128.Encrypt and CBC-CAMELLIA128.Decrypt -CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:1607CF494B36BBF00DAEB0B503C831AB -CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:1607CF494B36BBF00DAEB0B503C831AB:AE2D8A571E03AC9C9EB76FAC45AF8E51:A2F2CF671629EF7840C5A5DFB5074887 -CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:A2F2CF671629EF7840C5A5DFB5074887:30C81C46A35CE411E5FBC1191A0A52EF:0F06165008CF8B8B5A63586362543E54 -CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:36A84CDAFD5F9A85ADA0F0A993D6D577:F69F2445DF4F9B17AD2B417BE66C3710:74C64268CDB8B8FAF5B34E8AF3732980 - -# CBC-CAMELLIA192.Encrypt and CBC-CAMELLIA192.Decrypt -CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:2A4830AB5AC4A1A2405955FD2195CF93 -CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:2A4830AB5AC4A1A2405955FD2195CF93:AE2D8A571E03AC9C9EB76FAC45AF8E51:5D5A869BD14CE54264F892A6DD2EC3D5 -CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:5D5A869BD14CE54264F892A6DD2EC3D5:30C81C46A35CE411E5FBC1191A0A52EF:37D359C3349836D884E310ADDF68C449 -CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:37D359C3349836D884E310ADDF68C449:F69F2445DF4F9B17AD2B417BE66C3710:01FAAA930B4AB9916E9668E1428C6B08 - -# CBC-CAMELLIA256.Encrypt and CBC-CAMELLIA256.Decrypt -CAMELLIA-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:E6CFA35FC02B134A4D2C0B6737AC3EDA -CAMELLIA-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E6CFA35FC02B134A4D2C0B6737AC3EDA:AE2D8A571E03AC9C9EB76FAC45AF8E51:36CBEB73BD504B4070B1B7DE2B21EB50 -CAMELLIA-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:36CBEB73BD504B4070B1B7DE2B21EB50:30C81C46A35CE411E5FBC1191A0A52EF:E31A6055297D96CA3330CDF1B1860A83 -CAMELLIA-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E31A6055297D96CA3330CDF1B1860A83:F69F2445DF4F9B17AD2B417BE66C3710:5D563F6D1CCCF236051C0C5C1C58F28F - -# We don't support CFB{1,8}-CAMELLIAxxx.{En,De}crypt -# For all CFB128 encrypts and decrypts, the transformed sequence is -# CAMELLIA-bits-CFB:key:IV/ciphertext':plaintext:ciphertext:encdec -# CFB128-CAMELLIA128.Encrypt -CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:1 -CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:14F7646187817EB586599146B82BD719:AE2D8A571E03AC9C9EB76FAC45AF8E51:A53D28BB82DF741103EA4F921A44880B:1 -CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:A53D28BB82DF741103EA4F921A44880B:30C81C46A35CE411E5FBC1191A0A52EF:9C2157A664626D1DEF9EA420FDE69B96:1 -CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:9C2157A664626D1DEF9EA420FDE69B96:F69F2445DF4F9B17AD2B417BE66C3710:742A25F0542340C7BAEF24CA8482BB09:1 - -# CFB128-CAMELLIA128.Decrypt -CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:0 -CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:14F7646187817EB586599146B82BD719:AE2D8A571E03AC9C9EB76FAC45AF8E51:A53D28BB82DF741103EA4F921A44880B:0 -CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:A53D28BB82DF741103EA4F921A44880B:30C81C46A35CE411E5FBC1191A0A52EF:9C2157A664626D1DEF9EA420FDE69B96:0 -CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:9C2157A664626D1DEF9EA420FDE69B96:F69F2445DF4F9B17AD2B417BE66C3710:742A25F0542340C7BAEF24CA8482BB09:0 - -# CFB128-CAMELLIA192.Encrypt -CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:C832BB9780677DAA82D9B6860DCD565E:1 -CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:C832BB9780677DAA82D9B6860DCD565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:86F8491627906D780C7A6D46EA331F98:1 -CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:86F8491627906D780C7A6D46EA331F98:30C81C46A35CE411E5FBC1191A0A52EF:69511CCE594CF710CB98BB63D7221F01:1 -CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:69511CCE594CF710CB98BB63D7221F01:F69F2445DF4F9B17AD2B417BE66C3710:D5B5378A3ABED55803F25565D8907B84:1 - -# CFB128-CAMELLIA192.Decrypt -CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:C832BB9780677DAA82D9B6860DCD565E:0 -CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:C832BB9780677DAA82D9B6860DCD565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:86F8491627906D780C7A6D46EA331F98:0 -CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:86F8491627906D780C7A6D46EA331F98:30C81C46A35CE411E5FBC1191A0A52EF:69511CCE594CF710CB98BB63D7221F01:0 -CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:69511CCE594CF710CB98BB63D7221F01:F69F2445DF4F9B17AD2B417BE66C3710:D5B5378A3ABED55803F25565D8907B84:0 - -# CFB128-CAMELLIA256.Encrypt -CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:1 -CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:CF6107BB0CEA7D7FB1BD31F5E7B06C93:AE2D8A571E03AC9C9EB76FAC45AF8E51:89BEDB4CCDD864EA11BA4CBE849B5E2B:1 -CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:89BEDB4CCDD864EA11BA4CBE849B5E2B:30C81C46A35CE411E5FBC1191A0A52EF:555FC3F34BDD2D54C62D9E3BF338C1C4:1 -CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:555FC3F34BDD2D54C62D9E3BF338C1C4:F69F2445DF4F9B17AD2B417BE66C3710:5953ADCE14DB8C7F39F1BD39F359BFFA:1 - -# CFB128-CAMELLIA256.Decrypt -CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:0 -CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:CF6107BB0CEA7D7FB1BD31F5E7B06C93:AE2D8A571E03AC9C9EB76FAC45AF8E51:89BEDB4CCDD864EA11BA4CBE849B5E2B:0 -CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:89BEDB4CCDD864EA11BA4CBE849B5E2B:30C81C46A35CE411E5FBC1191A0A52EF:555FC3F34BDD2D54C62D9E3BF338C1C4:0 -CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:555FC3F34BDD2D54C62D9E3BF338C1C4:F69F2445DF4F9B17AD2B417BE66C3710:5953ADCE14DB8C7F39F1BD39F359BFFA:0 - -# For all OFB encrypts and decrypts, the transformed sequence is -# CAMELLIA-bits-OFB:key:IV/output':plaintext:ciphertext:encdec -# OFB-CAMELLIA128.Encrypt -CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:1 -CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:25623DB569CA51E01482649977E28D84:1 -CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:C776634A60729DC657D12B9FCA801E98:1 -CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:D776379BE0E50825E681DA1A4C980E8E:1 - -# OFB-CAMELLIA128.Decrypt -CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:0 -CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:25623DB569CA51E01482649977E28D84:0 -CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:C776634A60729DC657D12B9FCA801E98:0 -CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:D776379BE0E50825E681DA1A4C980E8E:0 - -# OFB-CAMELLIA192.Encrypt -CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:C832BB9780677DAA82D9B6860DCD565E:1 -CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:8ECEB7D0350D72C7F78562AEBDF99339:1 -CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:BDD62DBBB9700846C53B507F544696F0:1 -CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:E28014E046B802F385C4C2E13EAD4A72:1 - -# OFB-CAMELLIA192.Decrypt -CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:C832BB9780677DAA82D9B6860DCD565E:0 -CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:8ECEB7D0350D72C7F78562AEBDF99339:0 -CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:BDD62DBBB9700846C53B507F544696F0:0 -CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:E28014E046B802F385C4C2E13EAD4A72:0 - -# OFB-CAMELLIA256.Encrypt -CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:1 -CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:127AD97E8E3994E4820027D7BA109368:1 -CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:6BFF6265A6A6B7A535BC65A80B17214E:1 -CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0A4A0404E26AA78A27CB271E8BF3CF20:1 - -# OFB-CAMELLIA256.Decrypt -CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:0 -CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:127AD97E8E3994E4820027D7BA109368:0 -CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:6BFF6265A6A6B7A535BC65A80B17214E:0 -CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0A4A0404E26AA78A27CB271E8BF3CF20:0 - -# SEED test vectors from RFC4269 -SEED-ECB:00000000000000000000000000000000::000102030405060708090A0B0C0D0E0F:5EBAC6E0054E166819AFF1CC6D346CDB:0 -SEED-ECB:000102030405060708090A0B0C0D0E0F::00000000000000000000000000000000:C11F22F20140505084483597E4370F43:0 -SEED-ECB:4706480851E61BE85D74BFB3FD956185::83A2F8A288641FB9A4E9A5CC2F131C7D:EE54D13EBCAE706D226BC3142CD40D4A:0 -SEED-ECB:28DBC3BC49FFD87DCFA509B11D422BE7::B41E6BE2EBA84A148E2EED84593C5EC7:9B9B7BFCD1813CB95D0B3618F40F5122:0 -SEED-ECB:00000000000000000000000000000000::000102030405060708090A0B0C0D0E0F:5EBAC6E0054E166819AFF1CC6D346CDB:1 -SEED-ECB:000102030405060708090A0B0C0D0E0F::00000000000000000000000000000000:C11F22F20140505084483597E4370F43:1 -SEED-ECB:4706480851E61BE85D74BFB3FD956185::83A2F8A288641FB9A4E9A5CC2F131C7D:EE54D13EBCAE706D226BC3142CD40D4A:1 -SEED-ECB:28DBC3BC49FFD87DCFA509B11D422BE7::B41E6BE2EBA84A148E2EED84593C5EC7:9B9B7BFCD1813CB95D0B3618F40F5122:1 - -# AES CCM 256 bit key -aes-256-ccm:1bde3251d41a8b5ea013c195ae128b218b3e0306376357077ef1c1c78548b92e:5b8e40746f6b98e00f1d13ff41:53bd72a97089e312422bf72e242377b3c6ee3e2075389b999c4ef7f28bd2b80a:9a5fcccdb4cf04e7293d2775cc76a488f042382d949b43b7d6bb2b9864786726:c17a32514eb6103f3249e076d4c871dc97e04b286699e54491dc18f6d734d4c0:2024931d73bca480c24a24ece6b6c2bf - -# AES GCM test vectors from http://csrc.nist.gov/groups/ST/toolkit/BCM/documents/proposedmodes/gcm/gcm-spec.pdf -aes-128-gcm:00000000000000000000000000000000:000000000000000000000000::::58e2fccefa7e3061367f1d57a4e7455a -aes-128-gcm:00000000000000000000000000000000:000000000000000000000000:00000000000000000000000000000000:0388dace60b6a392f328c2b971b2fe78::ab6e47d42cec13bdf53a67b21257bddf -aes-128-gcm:feffe9928665731c6d6a8f9467308308:cafebabefacedbaddecaf888:d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255:42831ec2217774244b7221b784d0d49ce3aa212f2c02a4e035c17e2329aca12e21d514b25466931c7d8f6a5aac84aa051ba30b396a0aac973d58e091473f5985::4d5c2af327cd64a62cf35abd2ba6fab4 -aes-128-gcm:feffe9928665731c6d6a8f9467308308:cafebabefacedbaddecaf888:d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39:42831ec2217774244b7221b784d0d49ce3aa212f2c02a4e035c17e2329aca12e21d514b25466931c7d8f6a5aac84aa051ba30b396a0aac973d58e091:feedfacedeadbeeffeedfacedeadbeefabaddad2:5bc94fbc3221a5db94fae95ae7121a47 -aes-128-gcm:feffe9928665731c6d6a8f9467308308:cafebabefacedbad:d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39:61353b4c2806934a777ff51fa22a4755699b2a714fcdc6f83766e5f97b6c742373806900e49f24b22b097544d4896b424989b5e1ebac0f07c23f4598:feedfacedeadbeeffeedfacedeadbeefabaddad2:3612d2e79e3b0785561be14aaca2fccb -aes-128-gcm:feffe9928665731c6d6a8f9467308308:9313225df88406e555909c5aff5269aa6a7a9538534f7da1e4c303d2a318a728c3c0c95156809539fcf0e2429a6b525416aedbf5a0de6a57a637b39b:d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39:8ce24998625615b603a033aca13fb894be9112a5c3a211a8ba262a3cca7e2ca701e4a9a4fba43c90ccdcb281d48c7c6fd62875d2aca417034c34aee5:feedfacedeadbeeffeedfacedeadbeefabaddad2:619cc5aefffe0bfa462af43c1699d050 -aes-192-gcm:000000000000000000000000000000000000000000000000:000000000000000000000000::::cd33b28ac773f74ba00ed1f312572435 -aes-192-gcm:000000000000000000000000000000000000000000000000:000000000000000000000000:00000000000000000000000000000000:98e7247c07f0fe411c267e4384b0f600::2ff58d80033927ab8ef4d4587514f0fb -aes-192-gcm:feffe9928665731c6d6a8f9467308308feffe9928665731c:cafebabefacedbaddecaf888:d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255:3980ca0b3c00e841eb06fac4872a2757859e1ceaa6efd984628593b40ca1e19c7d773d00c144c525ac619d18c84a3f4718e2448b2fe324d9ccda2710acade256::9924a7c8587336bfb118024db8674a14 -aes-192-gcm:feffe9928665731c6d6a8f9467308308feffe9928665731c:cafebabefacedbaddecaf888:d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39:3980ca0b3c00e841eb06fac4872a2757859e1ceaa6efd984628593b40ca1e19c7d773d00c144c525ac619d18c84a3f4718e2448b2fe324d9ccda2710:feedfacedeadbeeffeedfacedeadbeefabaddad2:2519498e80f1478f37ba55bd6d27618c -aes-192-gcm:feffe9928665731c6d6a8f9467308308feffe9928665731c:cafebabefacedbad:d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39:0f10f599ae14a154ed24b36e25324db8c566632ef2bbb34f8347280fc4507057fddc29df9a471f75c66541d4d4dad1c9e93a19a58e8b473fa0f062f7:feedfacedeadbeeffeedfacedeadbeefabaddad2:65dcc57fcf623a24094fcca40d3533f8 -aes-192-gcm:feffe9928665731c6d6a8f9467308308feffe9928665731c:9313225df88406e555909c5aff5269aa6a7a9538534f7da1e4c303d2a318a728c3c0c95156809539fcf0e2429a6b525416aedbf5a0de6a57a637b39b:d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39:d27e88681ce3243c4830165a8fdcf9ff1de9a1d8e6b447ef6ef7b79828666e4581e79012af34ddd9e2f037589b292db3e67c036745fa22e7e9b7373b:feedfacedeadbeeffeedfacedeadbeefabaddad2:dcf566ff291c25bbb8568fc3d376a6d9 -aes-256-gcm:0000000000000000000000000000000000000000000000000000000000000000:000000000000000000000000::::530f8afbc74536b9a963b4f1c4cb738b -aes-256-gcm:0000000000000000000000000000000000000000000000000000000000000000:000000000000000000000000:00000000000000000000000000000000:cea7403d4d606b6e074ec5d3baf39d18::d0d1c8a799996bf0265b98b5d48ab919 -aes-256-gcm:feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308:cafebabefacedbaddecaf888:d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255:522dc1f099567d07f47f37a32a84427d643a8cdcbfe5c0c97598a2bd2555d1aa8cb08e48590dbb3da7b08b1056828838c5f61e6393ba7a0abcc9f662898015ad::b094dac5d93471bdec1a502270e3cc6c -aes-256-gcm:feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308:cafebabefacedbaddecaf888:d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39:522dc1f099567d07f47f37a32a84427d643a8cdcbfe5c0c97598a2bd2555d1aa8cb08e48590dbb3da7b08b1056828838c5f61e6393ba7a0abcc9f662:feedfacedeadbeeffeedfacedeadbeefabaddad2:76fc6ece0f4e1768cddf8853bb2d551b -aes-256-gcm:feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308:cafebabefacedbad:d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39:c3762df1ca787d32ae47c13bf19844cbaf1ae14d0b976afac52ff7d79bba9de0feb582d33934a4f0954cc2363bc73f7862ac430e64abe499f47c9b1f:feedfacedeadbeeffeedfacedeadbeefabaddad2:3a337dbf46a792c45e454913fe2ea8f2 -aes-256-gcm:feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308:9313225df88406e555909c5aff5269aa6a7a9538534f7da1e4c303d2a318a728c3c0c95156809539fcf0e2429a6b525416aedbf5a0de6a57a637b39b:d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39:5a8def2f0c9e53f1f75d7853659e2a20eeb2b22aafde6419a058ab4f6f746bf40fc0c3b780f244452da3ebf1c5d82cdea2418997200ef82e44ae7e3f:feedfacedeadbeeffeedfacedeadbeefabaddad2:a44a8266ee1c8eb0c8b5d4cf5ae9f19a -# local add-ons, primarily streaming ghash tests -# 128 bytes aad -aes-128-gcm:00000000000000000000000000000000:000000000000000000000000:::d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255522dc1f099567d07f47f37a32a84427d643a8cdcbfe5c0c97598a2bd2555d1aa8cb08e48590dbb3da7b08b1056828838c5f61e6393ba7a0abcc9f662898015ad:5fea793a2d6f974d37e68e0cb8ff9492 -# 48 bytes plaintext -aes-128-gcm:00000000000000000000000000000000:000000000000000000000000:000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000:0388dace60b6a392f328c2b971b2fe78f795aaab494b5923f7fd89ff948bc1e0200211214e7394da2089b6acd093abe0::9dd0a376b08e40eb00c35f29f9ea61a4 -# 80 bytes plaintext -aes-128-gcm:00000000000000000000000000000000:000000000000000000000000:0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000:0388dace60b6a392f328c2b971b2fe78f795aaab494b5923f7fd89ff948bc1e0200211214e7394da2089b6acd093abe0c94da219118e297d7b7ebcbcc9c388f28ade7d85a8ee35616f7124a9d5270291::98885a3a22bd4742fe7b72172193b163 -# 128 bytes plaintext -aes-128-gcm:00000000000000000000000000000000:000000000000000000000000:0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000:0388dace60b6a392f328c2b971b2fe78f795aaab494b5923f7fd89ff948bc1e0200211214e7394da2089b6acd093abe0c94da219118e297d7b7ebcbcc9c388f28ade7d85a8ee35616f7124a9d527029195b84d1b96c690ff2f2de30bf2ec89e00253786e126504f0dab90c48a30321de3345e6b0461e7c9e6c6b7afedde83f40::cac45f60e31efd3b5a43b98a22ce1aa1 -# 192 bytes plaintext, iv is chosen so that initial counter LSB is 0xFF -aes-128-gcm:00000000000000000000000000000000:ffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000:000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000:56b3373ca9ef6e4a2b64fe1e9a17b61425f10d47a75a5fce13efc6bc784af24f4141bdd48cf7c770887afd573cca5418a9aeffcd7c5ceddfc6a78397b9a85b499da558257267caab2ad0b23ca476a53cb17fb41c4b8b475cb4f3f7165094c229c9e8c4dc0a2a5ff1903e501511221376a1cdb8364c5061a20cae74bc4acd76ceb0abc9fd3217ef9f8c90be402ddf6d8697f4f880dff15bfb7a6b28241ec8fe183c2d59e3f9dfff653c7126f0acb9e64211f42bae12af462b1070bef1ab5e3606::566f8ef683078bfdeeffa869d751a017 -# 80 bytes plaintext, submitted by Intel -aes-128-gcm:843ffcf5d2b72694d19ed01d01249412:dbcca32ebf9b804617c3aa9e:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f:6268c6fa2a80b2d137467f092f657ac04d89be2beaa623d61b5a868c8f03ff95d3dcee23ad2f1ab3a6c80eaf4b140eb05de3457f0fbc111a6b43d0763aa422a3013cf1dc37fe417d1fbfc449b75d4cc5:00000000000000000000000000000000101112131415161718191a1b1c1d1e1f:3b629ccfbc1119b7319e1dce2cd6fd6d - -# AES XTS test vectors from IEEE Std 1619-2007 -aes-128-xts:0000000000000000000000000000000000000000000000000000000000000000:00000000000000000000000000000000:0000000000000000000000000000000000000000000000000000000000000000:917cf69ebd68b2ec9b9fe9a3eadda692cd43d2f59598ed858c02c2652fbf922e -aes-128-xts:1111111111111111111111111111111122222222222222222222222222222222:33333333330000000000000000000000:4444444444444444444444444444444444444444444444444444444444444444:c454185e6a16936e39334038acef838bfb186fff7480adc4289382ecd6d394f0 -aes-128-xts:fffefdfcfbfaf9f8f7f6f5f4f3f2f1f022222222222222222222222222222222:33333333330000000000000000000000:4444444444444444444444444444444444444444444444444444444444444444:af85336b597afc1a900b2eb21ec949d292df4c047e0b21532186a5971a227a89 -aes-128-xts:2718281828459045235360287471352631415926535897932384626433832795:00000000000000000000000000000000:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff:27a7479befa1d476489f308cd4cfa6e2a96e4bbe3208ff25287dd3819616e89cc78cf7f5e543445f8333d8fa7f56000005279fa5d8b5e4ad40e736ddb4d35412328063fd2aab53e5ea1e0a9f332500a5df9487d07a5c92cc512c8866c7e860ce93fdf166a24912b422976146ae20ce846bb7dc9ba94a767aaef20c0d61ad02655ea92dc4c4e41a8952c651d33174be51a10c421110e6d81588ede82103a252d8a750e8768defffed9122810aaeb99f9172af82b604dc4b8e51bcb08235a6f4341332e4ca60482a4ba1a03b3e65008fc5da76b70bf1690db4eae29c5f1badd03c5ccf2a55d705ddcd86d449511ceb7ec30bf12b1fa35b913f9f747a8afd1b130e94bff94effd01a91735ca1726acd0b197c4e5b03393697e126826fb6bbde8ecc1e08298516e2c9ed03ff3c1b7860f6de76d4cecd94c8119855ef5297ca67e9f3e7ff72b1e99785ca0a7e7720c5b36dc6d72cac9574c8cbbc2f801e23e56fd344b07f22154beba0f08ce8891e643ed995c94d9a69c9f1b5f499027a78572aeebd74d20cc39881c213ee770b1010e4bea718846977ae119f7a023ab58cca0ad752afe656bb3c17256a9f6e9bf19fdd5a38fc82bbe872c5539edb609ef4f79c203ebb140f2e583cb2ad15b4aa5b655016a8449277dbd477ef2c8d6c017db738b18deb4a427d1923ce3ff262735779a418f20a282df920147beabe421ee5319d0568 -aes-128-xts:2718281828459045235360287471352631415926535897932384626433832795:01000000000000000000000000000000:27a7479befa1d476489f308cd4cfa6e2a96e4bbe3208ff25287dd3819616e89cc78cf7f5e543445f8333d8fa7f56000005279fa5d8b5e4ad40e736ddb4d35412328063fd2aab53e5ea1e0a9f332500a5df9487d07a5c92cc512c8866c7e860ce93fdf166a24912b422976146ae20ce846bb7dc9ba94a767aaef20c0d61ad02655ea92dc4c4e41a8952c651d33174be51a10c421110e6d81588ede82103a252d8a750e8768defffed9122810aaeb99f9172af82b604dc4b8e51bcb08235a6f4341332e4ca60482a4ba1a03b3e65008fc5da76b70bf1690db4eae29c5f1badd03c5ccf2a55d705ddcd86d449511ceb7ec30bf12b1fa35b913f9f747a8afd1b130e94bff94effd01a91735ca1726acd0b197c4e5b03393697e126826fb6bbde8ecc1e08298516e2c9ed03ff3c1b7860f6de76d4cecd94c8119855ef5297ca67e9f3e7ff72b1e99785ca0a7e7720c5b36dc6d72cac9574c8cbbc2f801e23e56fd344b07f22154beba0f08ce8891e643ed995c94d9a69c9f1b5f499027a78572aeebd74d20cc39881c213ee770b1010e4bea718846977ae119f7a023ab58cca0ad752afe656bb3c17256a9f6e9bf19fdd5a38fc82bbe872c5539edb609ef4f79c203ebb140f2e583cb2ad15b4aa5b655016a8449277dbd477ef2c8d6c017db738b18deb4a427d1923ce3ff262735779a418f20a282df920147beabe421ee5319d0568:264d3ca8512194fec312c8c9891f279fefdd608d0c027b60483a3fa811d65ee59d52d9e40ec5672d81532b38b6b089ce951f0f9c35590b8b978d175213f329bb1c2fd30f2f7f30492a61a532a79f51d36f5e31a7c9a12c286082ff7d2394d18f783e1a8e72c722caaaa52d8f065657d2631fd25bfd8e5baad6e527d763517501c68c5edc3cdd55435c532d7125c8614deed9adaa3acade5888b87bef641c4c994c8091b5bcd387f3963fb5bc37aa922fbfe3df4e5b915e6eb514717bdd2a74079a5073f5c4bfd46adf7d282e7a393a52579d11a028da4d9cd9c77124f9648ee383b1ac763930e7162a8d37f350b2f74b8472cf09902063c6b32e8c2d9290cefbd7346d1c779a0df50edcde4531da07b099c638e83a755944df2aef1aa31752fd323dcb710fb4bfbb9d22b925bc3577e1b8949e729a90bbafeacf7f7879e7b1147e28ba0bae940db795a61b15ecf4df8db07b824bb062802cc98a9545bb2aaeed77cb3fc6db15dcd7d80d7d5bc406c4970a3478ada8899b329198eb61c193fb6275aa8ca340344a75a862aebe92eee1ce032fd950b47d7704a3876923b4ad62844bf4a09c4dbe8b4397184b7471360c9564880aedddb9baa4af2e75394b08cd32ff479c57a07d3eab5d54de5f9738b8d27f27a9f0ab11799d7b7ffefb2704c95c6ad12c39f1e867a4b7b1d7818a4b753dfd2a89ccb45e001a03a867b187f225dd -aes-128-xts:2718281828459045235360287471352631415926535897932384626433832795:02000000000000000000000000000000:264d3ca8512194fec312c8c9891f279fefdd608d0c027b60483a3fa811d65ee59d52d9e40ec5672d81532b38b6b089ce951f0f9c35590b8b978d175213f329bb1c2fd30f2f7f30492a61a532a79f51d36f5e31a7c9a12c286082ff7d2394d18f783e1a8e72c722caaaa52d8f065657d2631fd25bfd8e5baad6e527d763517501c68c5edc3cdd55435c532d7125c8614deed9adaa3acade5888b87bef641c4c994c8091b5bcd387f3963fb5bc37aa922fbfe3df4e5b915e6eb514717bdd2a74079a5073f5c4bfd46adf7d282e7a393a52579d11a028da4d9cd9c77124f9648ee383b1ac763930e7162a8d37f350b2f74b8472cf09902063c6b32e8c2d9290cefbd7346d1c779a0df50edcde4531da07b099c638e83a755944df2aef1aa31752fd323dcb710fb4bfbb9d22b925bc3577e1b8949e729a90bbafeacf7f7879e7b1147e28ba0bae940db795a61b15ecf4df8db07b824bb062802cc98a9545bb2aaeed77cb3fc6db15dcd7d80d7d5bc406c4970a3478ada8899b329198eb61c193fb6275aa8ca340344a75a862aebe92eee1ce032fd950b47d7704a3876923b4ad62844bf4a09c4dbe8b4397184b7471360c9564880aedddb9baa4af2e75394b08cd32ff479c57a07d3eab5d54de5f9738b8d27f27a9f0ab11799d7b7ffefb2704c95c6ad12c39f1e867a4b7b1d7818a4b753dfd2a89ccb45e001a03a867b187f225dd:fa762a3680b76007928ed4a4f49a9456031b704782e65e16cecb54ed7d017b5e18abd67b338e81078f21edb7868d901ebe9c731a7c18b5e6dec1d6a72e078ac9a4262f860beefa14f4e821018272e411a951502b6e79066e84252c3346f3aa62344351a291d4bedc7a07618bdea2af63145cc7a4b8d4070691ae890cd65733e7946e9021a1dffc4c59f159425ee6d50ca9b135fa6162cea18a939838dc000fb386fad086acce5ac07cb2ece7fd580b00cfa5e98589631dc25e8e2a3daf2ffdec26531659912c9d8f7a15e5865ea8fb5816d6207052bd7128cd743c12c8118791a4736811935eb982a532349e31dd401e0b660a568cb1a4711f552f55ded59f1f15bf7196b3ca12a91e488ef59d64f3a02bf45239499ac6176ae321c4a211ec545365971c5d3f4f09d4eb139bfdf2073d33180b21002b65cc9865e76cb24cd92c874c24c18350399a936ab3637079295d76c417776b94efce3a0ef7206b15110519655c956cbd8b2489405ee2b09a6b6eebe0c53790a12a8998378b33a5b71159625f4ba49d2a2fdba59fbf0897bc7aabd8d707dc140a80f0f309f835d3da54ab584e501dfa0ee977fec543f74186a802b9a37adb3e8291eca04d66520d229e60401e7282bef486ae059aa70696e0e305d777140a7a883ecdcb69b9ff938e8a4231864c69ca2c2043bed007ff3e605e014bcf518138dc3a25c5e236171a2d01d6 -aes-128-xts:2718281828459045235360287471352631415926535897932384626433832795:fd000000000000000000000000000000:8e41b78c390b5af9d758bb214a67e9f6bf7727b09ac6124084c37611398fa45daad94868600ed391fb1acd4857a95b466e62ef9f4b377244d1c152e7b30d731aad30c716d214b707aed99eb5b5e580b3e887cf7497465651d4b60e6042051da3693c3b78c14489543be8b6ad0ba629565bba202313ba7b0d0c94a3252b676f46cc02ce0f8a7d34c0ed229129673c1f61aed579d08a9203a25aac3a77e9db60267996db38df637356d9dcd1632e369939f2a29d89345c66e05066f1a3677aef18dea4113faeb629e46721a66d0a7e785d3e29af2594eb67dfa982affe0aac058f6e15864269b135418261fc3afb089472cf68c45dd7f231c6249ba0255e1e033833fc4d00a3fe02132d7bc3873614b8aee34273581ea0325c81f0270affa13641d052d36f0757d484014354d02d6883ca15c24d8c3956b1bd027bcf41f151fd8023c5340e5606f37e90fdb87c86fb4fa634b3718a30bace06a66eaf8f63c4aa3b637826a87fe8cfa44282e92cb1615af3a28e53bc74c7cba1a0977be9065d0c1a5dec6c54ae38d37f37aa35283e048e5530a85c4e7a29d7b92ec0c3169cdf2a805c7604bce60049b9fb7b8eaac10f51ae23794ceba68bb58112e293b9b692ca721b37c662f8574ed4dba6f88e170881c82cddc1034a0ca7e284bf0962b6b26292d836fa9f73c1ac770eef0f2d3a1eaf61d3e03555fd424eedd67e18a18094f888:d55f684f81f4426e9fde92a5ff02df2ac896af63962888a97910c1379e20b0a3b1db613fb7fe2e07004329ea5c22bfd33e3dbe4cf58cc608c2c26c19a2e2fe22f98732c2b5cb844cc6c0702d91e1d50fc4382a7eba5635cd602432a2306ac4ce82f8d70c8d9bc15f918fe71e74c622d5cf71178bf6e0b9cc9f2b41dd8dbe441c41cd0c73a6dc47a348f6702f9d0e9b1b1431e948e299b9ec2272ab2c5f0c7be86affa5dec87a0bee81d3d50007edaa2bcfccb35605155ff36ed8edd4a40dcd4b243acd11b2b987bdbfaf91a7cac27e9c5aea525ee53de7b2d3332c8644402b823e94a7db26276d2d23aa07180f76b4fd29b9c0823099c9d62c519880aee7e9697617c1497d47bf3e571950311421b6b734d38b0db91eb85331b91ea9f61530f54512a5a52a4bad589eb69781d537f23297bb459bdad2948a29e1550bf4787e0be95bb173cf5fab17dab7a13a052a63453d97ccec1a321954886b7a1299faaeecae35c6eaaca753b041b5e5f093bf83397fd21dd6b3012066fcc058cc32c3b09d7562dee29509b5839392c9ff05f51f3166aaac4ac5f238038a3045e6f72e48ef0fe8bc675e82c318a268e43970271bf119b81bf6a982746554f84e72b9f00280a320a08142923c23c883423ff949827f29bbacdc1ccdb04938ce6098c95ba6b32528f4ef78eed778b2e122ddfd1cbdd11d1c0a6783e011fc536d63d053260637 -aes-128-xts:2718281828459045235360287471352631415926535897932384626433832795:fe000000000000000000000000000000:d55f684f81f4426e9fde92a5ff02df2ac896af63962888a97910c1379e20b0a3b1db613fb7fe2e07004329ea5c22bfd33e3dbe4cf58cc608c2c26c19a2e2fe22f98732c2b5cb844cc6c0702d91e1d50fc4382a7eba5635cd602432a2306ac4ce82f8d70c8d9bc15f918fe71e74c622d5cf71178bf6e0b9cc9f2b41dd8dbe441c41cd0c73a6dc47a348f6702f9d0e9b1b1431e948e299b9ec2272ab2c5f0c7be86affa5dec87a0bee81d3d50007edaa2bcfccb35605155ff36ed8edd4a40dcd4b243acd11b2b987bdbfaf91a7cac27e9c5aea525ee53de7b2d3332c8644402b823e94a7db26276d2d23aa07180f76b4fd29b9c0823099c9d62c519880aee7e9697617c1497d47bf3e571950311421b6b734d38b0db91eb85331b91ea9f61530f54512a5a52a4bad589eb69781d537f23297bb459bdad2948a29e1550bf4787e0be95bb173cf5fab17dab7a13a052a63453d97ccec1a321954886b7a1299faaeecae35c6eaaca753b041b5e5f093bf83397fd21dd6b3012066fcc058cc32c3b09d7562dee29509b5839392c9ff05f51f3166aaac4ac5f238038a3045e6f72e48ef0fe8bc675e82c318a268e43970271bf119b81bf6a982746554f84e72b9f00280a320a08142923c23c883423ff949827f29bbacdc1ccdb04938ce6098c95ba6b32528f4ef78eed778b2e122ddfd1cbdd11d1c0a6783e011fc536d63d053260637:72efc1ebfe1ee25975a6eb3aa8589dda2b261f1c85bdab442a9e5b2dd1d7c3957a16fc08e526d4b1223f1b1232a11af274c3d70dac57f83e0983c498f1a6f1aecb021c3e70085a1e527f1ce41ee5911a82020161529cd82773762daf5459de94a0a82adae7e1703c808543c29ed6fb32d9e004327c1355180c995a07741493a09c21ba01a387882da4f62534b87bb15d60d197201c0fd3bf30c1500a3ecfecdd66d8721f90bcc4c17ee925c61b0a03727a9c0d5f5ca462fbfa0af1c2513a9d9d4b5345bd27a5f6e653f751693e6b6a2b8ead57d511e00e58c45b7b8d005af79288f5c7c22fd4f1bf7a898b03a5634c6a1ae3f9fae5de4f296a2896b23e7ed43ed14fa5a2803f4d28f0d3ffcf24757677aebdb47bb388378708948a8d4126ed1839e0da29a537a8c198b3c66ab00712dd261674bf45a73d67f76914f830ca014b65596f27e4cf62de66125a5566df9975155628b400fbfb3a29040ed50faffdbb18aece7c5c44693260aab386c0a37b11b114f1c415aebb653be468179428d43a4d8bc3ec38813eca30a13cf1bb18d524f1992d44d8b1a42ea30b22e6c95b199d8d182f8840b09d059585c31ad691fa0619ff038aca2c39a943421157361717c49d322028a74648113bd8c9d7ec77cf3c89c1ec8718ceff8516d96b34c3c614f10699c9abc4ed0411506223bea16af35c883accdbe1104eef0cfdb54e12fb230a -aes-128-xts:2718281828459045235360287471352631415926535897932384626433832795:ff000000000000000000000000000000:72efc1ebfe1ee25975a6eb3aa8589dda2b261f1c85bdab442a9e5b2dd1d7c3957a16fc08e526d4b1223f1b1232a11af274c3d70dac57f83e0983c498f1a6f1aecb021c3e70085a1e527f1ce41ee5911a82020161529cd82773762daf5459de94a0a82adae7e1703c808543c29ed6fb32d9e004327c1355180c995a07741493a09c21ba01a387882da4f62534b87bb15d60d197201c0fd3bf30c1500a3ecfecdd66d8721f90bcc4c17ee925c61b0a03727a9c0d5f5ca462fbfa0af1c2513a9d9d4b5345bd27a5f6e653f751693e6b6a2b8ead57d511e00e58c45b7b8d005af79288f5c7c22fd4f1bf7a898b03a5634c6a1ae3f9fae5de4f296a2896b23e7ed43ed14fa5a2803f4d28f0d3ffcf24757677aebdb47bb388378708948a8d4126ed1839e0da29a537a8c198b3c66ab00712dd261674bf45a73d67f76914f830ca014b65596f27e4cf62de66125a5566df9975155628b400fbfb3a29040ed50faffdbb18aece7c5c44693260aab386c0a37b11b114f1c415aebb653be468179428d43a4d8bc3ec38813eca30a13cf1bb18d524f1992d44d8b1a42ea30b22e6c95b199d8d182f8840b09d059585c31ad691fa0619ff038aca2c39a943421157361717c49d322028a74648113bd8c9d7ec77cf3c89c1ec8718ceff8516d96b34c3c614f10699c9abc4ed0411506223bea16af35c883accdbe1104eef0cfdb54e12fb230a:3260ae8dad1f4a32c5cafe3ab0eb95549d461a67ceb9e5aa2d3afb62dece0553193ba50c75be251e08d1d08f1088576c7efdfaaf3f459559571e12511753b07af073f35da06af0ce0bbf6b8f5ccc5cea500ec1b211bd51f63b606bf6528796ca12173ba39b8935ee44ccce646f90a45bf9ccc567f0ace13dc2d53ebeedc81f58b2e41179dddf0d5a5c42f5d8506c1a5d2f8f59f3ea873cbcd0eec19acbf325423bd3dcb8c2b1bf1d1eaed0eba7f0698e4314fbeb2f1566d1b9253008cbccf45a2b0d9c5c9c21474f4076e02be26050b99dee4fd68a4cf890e496e4fcae7b70f94ea5a9062da0daeba1993d2ccd1dd3c244b8428801495a58b216547e7e847c46d1d756377b6242d2e5fb83bf752b54e0df71e889f3a2bb0f4c10805bf3c590376e3c24e22ff57f7fa965577375325cea5d920db94b9c336b455f6e894c01866fe9fbb8c8d3f70a2957285f6dfb5dcd8cbf54782f8fe7766d4723819913ac773421e3a31095866bad22c86a6036b2518b2059b4229d18c8c2ccbdf906c6cc6e82464ee57bddb0bebcb1dc645325bfb3e665ef7251082c88ebb1cf203bd779fdd38675713c8daadd17e1cabee432b09787b6ddf3304e38b731b45df5df51b78fcfb3d32466028d0ba36555e7e11ab0ee0666061d1645d962444bc47a38188930a84b4d561395c73c087021927ca638b7afc8a8679ccb84c26555440ec7f10445cd - -aes-256-xts:27182818284590452353602874713526624977572470936999595749669676273141592653589793238462643383279502884197169399375105820974944592:ff000000000000000000000000000000:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff:1c3b3a102f770386e4836c99e370cf9bea00803f5e482357a4ae12d414a3e63b5d31e276f8fe4a8d66b317f9ac683f44680a86ac35adfc3345befecb4bb188fd5776926c49a3095eb108fd1098baec70aaa66999a72a82f27d848b21d4a741b0c5cd4d5fff9dac89aeba122961d03a757123e9870f8acf1000020887891429ca2a3e7a7d7df7b10355165c8b9a6d0a7de8b062c4500dc4cd120c0f7418dae3d0b5781c34803fa75421c790dfe1de1834f280d7667b327f6c8cd7557e12ac3a0f93ec05c52e0493ef31a12d3d9260f79a289d6a379bc70c50841473d1a8cc81ec583e9645e07b8d9670655ba5bbcfecc6dc3966380ad8fecb17b6ba02469a020a84e18e8f84252070c13e9f1f289be54fbc481457778f616015e1327a02b140f1505eb309326d68378f8374595c849d84f4c333ec4423885143cb47bd71c5edae9be69a2ffeceb1bec9de244fbe15992b11b77c040f12bd8f6a975a44a0f90c29a9abc3d4d893927284c58754cce294529f8614dcd2aba991925fedc4ae74ffac6e333b93eb4aff0479da9a410e4450e0dd7ae4c6e2910900575da401fc07059f645e8b7e9bfdef33943054ff84011493c27b3429eaedb4ed5376441a77ed43851ad77f16f541dfd269d50d6a5f14fb0aab1cbb4c1550be97f7ab4066193c4caa773dad38014bd2092fa755c824bb5e54c4f36ffda9fcea70b9c6e693e148c151 -aes-256-xts:27182818284590452353602874713526624977572470936999595749669676273141592653589793238462643383279502884197169399375105820974944592:ffff0000000000000000000000000000:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff:77a31251618a15e6b92d1d66dffe7b50b50bad552305ba0217a610688eff7e11e1d0225438e093242d6db274fde801d4cae06f2092c728b2478559df58e837c2469ee4a4fa794e4bbc7f39bc026e3cb72c33b0888f25b4acf56a2a9804f1ce6d3d6e1dc6ca181d4b546179d55544aa7760c40d06741539c7e3cd9d2f6650b2013fd0eeb8c2b8e3d8d240ccae2d4c98320a7442e1c8d75a42d6e6cfa4c2eca1798d158c7aecdf82490f24bb9b38e108bcda12c3faf9a21141c3613b58367f922aaa26cd22f23d708dae699ad7cb40a8ad0b6e2784973dcb605684c08b8d6998c69aac049921871ebb65301a4619ca80ecb485a31d744223ce8ddc2394828d6a80470c092f5ba413c3378fa6054255c6f9df4495862bbb3287681f931b687c888abf844dfc8fc28331e579928cd12bd2390ae123cf03818d14dedde5c0c24c8ab018bfca75ca096f2d531f3d1619e785f1ada437cab92e980558b3dce1474afb75bfedbf8ff54cb2618e0244c9ac0d3c66fb51598cd2db11f9be39791abe447c63094f7c453b7ff87cb5bb36b7c79efb0872d17058b83b15ab0866ad8a58656c5a7e20dbdf308b2461d97c0ec0024a2715055249cf3b478ddd4740de654f75ca686e0d7345c69ed50cdc2a8b332b1f8824108ac937eb050585608ee734097fc09054fbff89eeaeea791f4a7ab1f9868294a4f9e27b42af8100cb9d59cef9645803 -aes-256-xts:27182818284590452353602874713526624977572470936999595749669676273141592653589793238462643383279502884197169399375105820974944592:ffffff00000000000000000000000000:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff:e387aaa58ba483afa7e8eb469778317ecf4cf573aa9d4eac23f2cdf914e4e200a8b490e42ee646802dc6ee2b471b278195d60918ececb44bf79966f83faba0499298ebc699c0c8634715a320bb4f075d622e74c8c932004f25b41e361025b5a87815391f6108fc4afa6a05d9303c6ba68a128a55705d415985832fdeaae6c8e19110e84d1b1f199a2692119edc96132658f09da7c623efcec712537a3d94c0bf5d7e352ec94ae5797fdb377dc1551150721adf15bd26a8efc2fcaad56881fa9e62462c28f30ae1ceaca93c345cf243b73f542e2074a705bd2643bb9f7cc79bb6e7091ea6e232df0f9ad0d6cf502327876d82207abf2115cdacf6d5a48f6c1879a65b115f0f8b3cb3c59d15dd8c769bc014795a1837f3901b5845eb491adfefe097b1fa30a12fc1f65ba22905031539971a10f2f36c321bb51331cdefb39e3964c7ef079994f5b69b2edd83a71ef549971ee93f44eac3938fcdd61d01fa71799da3a8091c4c48aa9ed263ff0749df95d44fef6a0bb578ec69456aa5408ae32c7af08ad7ba8921287e3bbee31b767be06a0e705c864a769137df28292283ea81a2480241b44d9921cdbec1bc28dc1fda114bd8e5217ac9d8ebafa720e9da4f9ace231cc949e5b96fe76ffc21063fddc83a6b8679c00d35e09576a875305bed5f36ed242c8900dd1fa965bc950dfce09b132263a1eef52dd6888c309f5a7d712826 -aes-256-xts:27182818284590452353602874713526624977572470936999595749669676273141592653589793238462643383279502884197169399375105820974944592:ffffffff000000000000000000000000:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff:bf53d2dade78e822a4d949a9bc6766b01b06a8ef70d26748c6a7fc36d80ae4c5520f7c4ab0ac8544424fa405162fef5a6b7f229498063618d39f0003cb5fb8d1c86b643497da1ff945c8d3bedeca4f479702a7a735f043ddb1d6aaade3c4a0ac7ca7f3fa5279bef56f82cd7a2f38672e824814e10700300a055e1630b8f1cb0e919f5e942010a416e2bf48cb46993d3cb6a51c19bacf864785a00bc2ecff15d350875b246ed53e68be6f55bd7e05cfc2b2ed6432198a6444b6d8c247fab941f569768b5c429366f1d3f00f0345b96123d56204c01c63b22ce78baf116e525ed90fdea39fa469494d3866c31e05f295ff21fea8d4e6e13d67e47ce722e9698a1c1048d68ebcde76b86fcf976eab8aa9790268b7068e017a8b9b749409514f1053027fd16c3786ea1bac5f15cb79711ee2abe82f5cf8b13ae73030ef5b9e4457e75d1304f988d62dd6fc4b94ed38ba831da4b7634971b6cd8ec325d9c61c00f1df73627ed3745a5e8489f3a95c69639c32cd6e1d537a85f75cc844726e8a72fc0077ad22000f1d5078f6b866318c668f1ad03d5a5fced5219f2eabbd0aa5c0f460d183f04404a0d6f469558e81fab24a167905ab4c7878502ad3e38fdbe62a41556cec37325759533ce8f25f367c87bb5578d667ae93f9e2fd99bcbc5f2fbba88cf6516139420fcff3b7361d86322c4bd84c82f335abb152c4a93411373aaa8220 -aes-256-xts:27182818284590452353602874713526624977572470936999595749669676273141592653589793238462643383279502884197169399375105820974944592:ffffffffff0000000000000000000000:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff:64497e5a831e4a932c09be3e5393376daa599548b816031d224bbf50a818ed2350eae7e96087c8a0db51ad290bd00c1ac1620857635bf246c176ab463be30b808da548081ac847b158e1264be25bb0910bbc92647108089415d45fab1b3d2604e8a8eff1ae4020cfa39936b66827b23f371b92200be90251e6d73c5f86de5fd4a950781933d79a28272b782a2ec313efdfcc0628f43d744c2dc2ff3dcb66999b50c7ca895b0c64791eeaa5f29499fb1c026f84ce5b5c72ba1083cddb5ce45434631665c333b60b11593fb253c5179a2c8db813782a004856a1653011e93fb6d876c18366dd8683f53412c0c180f9c848592d593f8609ca736317d356e13e2bff3a9f59cd9aeb19cd482593d8c46128bb32423b37a9adfb482b99453fbe25a41bf6feb4aa0bef5ed24bf73c762978025482c13115e4015aac992e5613a3b5c2f685b84795cb6e9b2656d8c88157e52c42f978d8634c43d06fea928f2822e465aa6576e9bf419384506cc3ce3c54ac1a6f67dc66f3b30191e698380bc999b05abce19dc0c6dcc2dd001ec535ba18deb2df1a101023108318c75dc98611a09dc48a0acdec676fabdf222f07e026f059b672b56e5cbc8e1d21bbd867dd927212054681d70ea737134cdfce93b6f82ae22423274e58a0821cc5502e2d0ab4585e94de6975be5e0b4efce51cd3e70c25a1fbbbd609d273ad5b0d59631c531f6a0a57b9 - -aes-128-xts:fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0:9a785634120000000000000000000000:000102030405060708090a0b0c0d0e0f10:6c1625db4671522d3d7599601de7ca09ed -aes-128-xts:fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0:9a785634120000000000000000000000:000102030405060708090a0b0c0d0e0f1011:d069444b7a7e0cab09e24447d24deb1fedbf -aes-128-xts:fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0:9a785634120000000000000000000000:000102030405060708090a0b0c0d0e0f101112:e5df1351c0544ba1350b3363cd8ef4beedbf9d -aes-128-xts:fffefdfcfbfaf9f8f7f6f5f4f3f2f1f0bfbebdbcbbbab9b8b7b6b5b4b3b2b1b0:9a785634120000000000000000000000:000102030405060708090a0b0c0d0e0f10111213:9d84c813f719aa2c7be3f66171c7c5c2edbf9dac -aes-128-xts:e0e1e2e3e4e5e6e7e8e9eaebecedeeefc0c1c2c3c4c5c6c7c8c9cacbcccdcecf:21436587a90000000000000000000000:000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff:38b45812ef43a05bd957e545907e223b954ab4aaf088303ad910eadf14b42be68b2461149d8c8ba85f992be970bc621f1b06573f63e867bf5875acafa04e42ccbd7bd3c2a0fb1fff791ec5ec36c66ae4ac1e806d81fbf709dbe29e471fad38549c8e66f5345d7c1eb94f405d1ec785cc6f6a68f6254dd8339f9d84057e01a17741990482999516b5611a38f41bb6478e6f173f320805dd71b1932fc333cb9ee39936beea9ad96fa10fb4112b901734ddad40bc1878995f8e11aee7d141a2f5d48b7a4e1e7f0b2c04830e69a4fd1378411c2f287edf48c6c4e5c247a19680f7fe41cefbd49b582106e3616cbbe4dfb2344b2ae9519391f3e0fb4922254b1d6d2d19c6d4d537b3a26f3bcc51588b32f3eca0829b6a5ac72578fb814fb43cf80d64a233e3f997a3f02683342f2b33d25b492536b93becb2f5e1a8b82f5b883342729e8ae09d16938841a21a97fb543eea3bbff59f13c1a18449e398701c1ad51648346cbc04c27bb2da3b93a1372ccae548fb53bee476f9e9c91773b1bb19828394d55d3e1a20ed69113a860b6829ffa847224604435070221b257e8dff783615d2cae4803a93aa4334ab482a0afac9c0aeda70b45a481df5dec5df8cc0f423c77a5fd46cd312021d4b438862419a791be03bb4d97c0e59578542531ba466a83baf92cefc151b5cc1611a167893819b63fb8a6b18e86de60290fa72b797b0ce59f3 -# AES wrap tests from RFC3394 -id-aes128-wrap:000102030405060708090A0B0C0D0E0F::00112233445566778899AABBCCDDEEFF:1FA68B0A8112B447AEF34BD8FB5A7B829D3E862371D2CFE5 -id-aes192-wrap:000102030405060708090A0B0C0D0E0F1011121314151617::00112233445566778899AABBCCDDEEFF:96778B25AE6CA435F92B5B97C050AED2468AB8A17AD84E5D -id-aes256-wrap:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F::00112233445566778899AABBCCDDEEFF:64E8C3F9CE0F5BA263E9777905818A2A93C8191E7D6E8AE7 -id-aes192-wrap:000102030405060708090A0B0C0D0E0F1011121314151617::00112233445566778899AABBCCDDEEFF0001020304050607:031D33264E15D33268F24EC260743EDCE1C6C7DDEE725A936BA814915C6762D2 -id-aes256-wrap:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F::00112233445566778899AABBCCDDEEFF0001020304050607:A8F9BC1612C68B3FF6E6F4FBE30E71E4769C8B80A32CB8958CD5D17D6B254DA1 -id-aes256-wrap:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F::00112233445566778899AABBCCDDEEFF000102030405060708090A0B0C0D0E0F:28C9F404C4B810F4CBCCB35CFB87F8263F5786E2D80ED326CBC7F0E71A99F43BFB988B9B7A02DD21 diff --git a/deps/openssl/openssl/test/exptest.c b/deps/openssl/openssl/test/exptest.c deleted file mode 120000 index 50ccf71cbb71e2..00000000000000 --- a/deps/openssl/openssl/test/exptest.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/bn/exptest.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/heartbeat_test.c b/deps/openssl/openssl/test/heartbeat_test.c deleted file mode 120000 index 79576fd5aaf874..00000000000000 --- a/deps/openssl/openssl/test/heartbeat_test.c +++ /dev/null @@ -1 +0,0 @@ -../ssl/heartbeat_test.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/hmactest.c b/deps/openssl/openssl/test/hmactest.c deleted file mode 120000 index 353ee2c7f984ce..00000000000000 --- a/deps/openssl/openssl/test/hmactest.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/hmac/hmactest.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/ideatest.c b/deps/openssl/openssl/test/ideatest.c deleted file mode 120000 index a9bfb3d480410d..00000000000000 --- a/deps/openssl/openssl/test/ideatest.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/idea/ideatest.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/igetest.c b/deps/openssl/openssl/test/igetest.c index 0c7b3573d05065..08f361a0a85c4d 100644 --- a/deps/openssl/openssl/test/igetest.c +++ b/deps/openssl/openssl/test/igetest.c @@ -1,4 +1,4 @@ -/* test/igetest.c -*- mode:C; c-file-style: "eay" -*- */ +/* test/igetest.c */ /* ==================================================================== * Copyright (c) 2006 The OpenSSL Project. All rights reserved. * diff --git a/deps/openssl/openssl/test/jpaketest.c b/deps/openssl/openssl/test/jpaketest.c deleted file mode 120000 index 49f44f8b69e54d..00000000000000 --- a/deps/openssl/openssl/test/jpaketest.c +++ /dev/null @@ -1 +0,0 @@ -dummytest.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/md2test.c b/deps/openssl/openssl/test/md2test.c deleted file mode 120000 index 49f44f8b69e54d..00000000000000 --- a/deps/openssl/openssl/test/md2test.c +++ /dev/null @@ -1 +0,0 @@ -dummytest.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/md4test.c b/deps/openssl/openssl/test/md4test.c deleted file mode 120000 index 1509be911dad49..00000000000000 --- a/deps/openssl/openssl/test/md4test.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/md4/md4test.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/md5test.c b/deps/openssl/openssl/test/md5test.c deleted file mode 120000 index 20f4aaf0a4ec8d..00000000000000 --- a/deps/openssl/openssl/test/md5test.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/md5/md5test.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/mdc2test.c b/deps/openssl/openssl/test/mdc2test.c deleted file mode 120000 index c4ffe4835e9fb3..00000000000000 --- a/deps/openssl/openssl/test/mdc2test.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/mdc2/mdc2test.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/randtest.c b/deps/openssl/openssl/test/randtest.c deleted file mode 120000 index a2b107a2b0e9ce..00000000000000 --- a/deps/openssl/openssl/test/randtest.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/rand/randtest.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/rc2test.c b/deps/openssl/openssl/test/rc2test.c deleted file mode 120000 index 5c53ad984a4cbc..00000000000000 --- a/deps/openssl/openssl/test/rc2test.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/rc2/rc2test.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/rc4test.c b/deps/openssl/openssl/test/rc4test.c deleted file mode 120000 index 061ac37734469a..00000000000000 --- a/deps/openssl/openssl/test/rc4test.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/rc4/rc4test.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/rc5test.c b/deps/openssl/openssl/test/rc5test.c deleted file mode 120000 index 49f44f8b69e54d..00000000000000 --- a/deps/openssl/openssl/test/rc5test.c +++ /dev/null @@ -1 +0,0 @@ -dummytest.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/rmdtest.c b/deps/openssl/openssl/test/rmdtest.c deleted file mode 120000 index ce66460654dcbb..00000000000000 --- a/deps/openssl/openssl/test/rmdtest.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/ripemd/rmdtest.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/rsa_test.c b/deps/openssl/openssl/test/rsa_test.c deleted file mode 120000 index aaea20d98ba744..00000000000000 --- a/deps/openssl/openssl/test/rsa_test.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/rsa/rsa_test.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/sha1test.c b/deps/openssl/openssl/test/sha1test.c deleted file mode 120000 index 8d66e9ee4c2f0e..00000000000000 --- a/deps/openssl/openssl/test/sha1test.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/sha/sha1test.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/sha256t.c b/deps/openssl/openssl/test/sha256t.c deleted file mode 120000 index 952a5086766530..00000000000000 --- a/deps/openssl/openssl/test/sha256t.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/sha/sha256t.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/sha512t.c b/deps/openssl/openssl/test/sha512t.c deleted file mode 120000 index c80d152f1ba546..00000000000000 --- a/deps/openssl/openssl/test/sha512t.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/sha/sha512t.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/shatest.c b/deps/openssl/openssl/test/shatest.c deleted file mode 120000 index 43cfda78fbfdea..00000000000000 --- a/deps/openssl/openssl/test/shatest.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/sha/shatest.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/srptest.c b/deps/openssl/openssl/test/srptest.c deleted file mode 120000 index 95348682676ae6..00000000000000 --- a/deps/openssl/openssl/test/srptest.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/srp/srptest.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/ssltest.c b/deps/openssl/openssl/test/ssltest.c deleted file mode 120000 index 40191f0da24210..00000000000000 --- a/deps/openssl/openssl/test/ssltest.c +++ /dev/null @@ -1 +0,0 @@ -../ssl/ssltest.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/tx509 b/deps/openssl/openssl/test/tx509 index 0ce3b5223c5bcf..77f5cacfcac971 100644 --- a/deps/openssl/openssl/test/tx509 +++ b/deps/openssl/openssl/test/tx509 @@ -74,5 +74,12 @@ if [ $? != 0 ]; then exit 1; fi cmp x509-f.p x509-ff.p3 if [ $? != 0 ]; then exit 1; fi +echo "Parsing test certificates" + +$cmd -in certs/pss1.pem -text -noout >/dev/null +if [ $? != 0 ]; then exit 1; fi + +echo OK + /bin/rm -f x509-f.* x509-ff.* x509-fff.* exit 0 diff --git a/deps/openssl/openssl/test/v3nametest.c b/deps/openssl/openssl/test/v3nametest.c deleted file mode 120000 index 1d209eb96323d0..00000000000000 --- a/deps/openssl/openssl/test/v3nametest.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/x509v3/v3nametest.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/verify_extra_test.c b/deps/openssl/openssl/test/verify_extra_test.c deleted file mode 120000 index 11d837c6fae49a..00000000000000 --- a/deps/openssl/openssl/test/verify_extra_test.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/x509/verify_extra_test.c \ No newline at end of file diff --git a/deps/openssl/openssl/test/wp_test.c b/deps/openssl/openssl/test/wp_test.c deleted file mode 120000 index 81b2021f39a222..00000000000000 --- a/deps/openssl/openssl/test/wp_test.c +++ /dev/null @@ -1 +0,0 @@ -../crypto/whrlpool/wp_test.c \ No newline at end of file diff --git a/deps/openssl/openssl/times/090/586-100.nt b/deps/openssl/openssl/times/090/586-100.nt deleted file mode 100644 index 297ec3e7f08882..00000000000000 --- a/deps/openssl/openssl/times/090/586-100.nt +++ /dev/null @@ -1,32 +0,0 @@ -SSLeay 0.9.0 08-Apr-1998 -built on Wed Apr 8 12:47:17 EST 1998 -options:bn(64,32) md2(int) rc4(idx,int) des(idx,cisc,4,long) idea(int) blowfish( -ptr2) -C flags:cl /MD /W3 /WX /G5 /Ox /O2 /Ob2 /Gs0 /GF /Gy /nologo -DWIN32 -DL_ENDIAN --DBN_ASM -DMD5_ASM -DSHA1_ASM -DRMD160_ASM -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 92.25k 256.80k 347.01k 380.40k 390.31k -mdc2 240.72k 251.10k 252.00k 250.80k 251.40k -md5 1013.61k 5651.94k 11831.61k 16294.89k 17901.43k -hmac(md5) 419.50k 2828.07k 7770.11k 13824.34k 17091.70k -sha1 524.31k 2721.45k 5216.15k 6766.10k 7308.42k -rmd160 462.09k 2288.59k 4260.77k 5446.44k 5841.65k -rc4 7895.90k 10326.73k 10555.43k 10728.22k 10429.44k -des cbc 2036.86k 2208.92k 2237.68k 2237.20k 2181.35k -des ede3 649.92k 739.42k 749.07k 748.86k 738.27k -idea cbc 823.19k 885.10k 894.92k 896.45k 891.87k -rc2 cbc 792.63k 859.00k 867.45k 868.96k 865.30k -rc5-32/12 cbc 3502.26k 4026.79k 4107.23k 4121.76k 4073.72k -blowfish cbc 3752.96k 4026.79k 4075.31k 3965.87k 3892.26k -cast cbc 2566.27k 2807.43k 2821.79k 2792.48k 2719.34k - sign verify sign/s verify/s -rsa 512 bits 0.0179s 0.0020s 56.0 501.7 -rsa 1024 bits 0.0950s 0.0060s 10.5 166.6 -rsa 2048 bits 0.6299s 0.0209s 1.6 47.8 -rsa 4096 bits 4.5870s 0.0787s 0.2 12.7 - sign verify sign/s verify/s -dsa 512 bits 0.0180s 0.0339s 55.6 29.5 -dsa 1024 bits 0.0555s 0.1076s 18.0 9.3 -dsa 2048 bits 0.1971s 0.3918s 5.1 2.6 - diff --git a/deps/openssl/openssl/times/091/486-50.nt b/deps/openssl/openssl/times/091/486-50.nt deleted file mode 100644 index 84820d9c650987..00000000000000 --- a/deps/openssl/openssl/times/091/486-50.nt +++ /dev/null @@ -1,30 +0,0 @@ -486-50 NT 4.0 - -SSLeay 0.9.1a 06-Jul-1998 -built on Sat Jul 18 18:03:20 EST 1998 -options:bn(64,32) md2(int) rc4(idx,int) des(idx,cisc,4,long) idea(int) blowfish(ptr2) -C flags:cl /MD /W3 /WX /G5 /Ox /O2 /Ob2 /Gs0 /GF /Gy /nologo -DWIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DBN_ASM -DMD5_ASM -DSHA1_ASM -DRMD160_ASM /Fdout32 -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 28.77k 80.30k 108.50k 118.98k 122.47k -mdc2 51.52k 54.06k 54.54k 54.65k 54.62k -md5 304.39k 1565.04k 3061.54k 3996.10k 4240.10k -hmac(md5) 119.53k 793.23k 2061.29k 3454.95k 4121.76k -sha1 127.51k 596.93k 1055.54k 1313.84k 1413.18k -rmd160 128.50k 572.49k 1001.03k 1248.01k 1323.63k -rc4 1224.40k 1545.11k 1590.29k 1600.20k 1576.90k -des cbc 448.19k 503.45k 512.30k 513.30k 508.23k -des ede3 148.66k 162.48k 163.68k 163.94k 164.24k -idea cbc 194.18k 211.10k 212.99k 213.18k 212.64k -rc2 cbc 245.78k 271.01k 274.12k 274.38k 273.52k -rc5-32/12 cbc 1252.48k 1625.20k 1700.03k 1711.12k 1677.18k -blowfish cbc 725.16k 828.26k 850.01k 846.99k 833.79k -cast cbc 643.30k 717.22k 739.48k 741.57k 735.33k - sign verify sign/s verify/s -rsa 512 bits 0.0904s 0.0104s 11.1 96.2 -rsa 1024 bits 0.5968s 0.0352s 1.7 28.4 -rsa 2048 bits 3.8860s 0.1017s 0.3 9.8 - sign verify sign/s verify/s -dsa 512 bits 0.1006s 0.1249s 9.9 8.0 -dsa 1024 bits 0.3306s 0.4093s 3.0 2.4 -dsa 2048 bits 0.9454s 1.1707s 1.1 0.9 diff --git a/deps/openssl/openssl/times/091/586-100.lnx b/deps/openssl/openssl/times/091/586-100.lnx deleted file mode 100644 index 92892a672db775..00000000000000 --- a/deps/openssl/openssl/times/091/586-100.lnx +++ /dev/null @@ -1,32 +0,0 @@ -Pentium 100mhz, linux - -SSLeay 0.9.0a 14-Apr-1998 -built on Fri Apr 17 08:47:07 EST 1998 -options:bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) -C flags:gcc -DL_ENDIAN -DTERMIO -DBN_ASM -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DSHA1_ASM -DMD5_ASM -DRMD160_ASM -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 56.65k 153.88k 208.47k 229.03k 237.57k -mdc2 189.59k 204.95k 206.93k 208.90k 209.56k -md5 1019.48k 5882.41k 12085.42k 16376.49k 18295.47k -hmac(md5) 415.86k 2887.85k 7891.29k 13894.66k 17446.23k -sha1 540.68k 2791.96k 5289.30k 6813.01k 7432.87k -rmd160 298.37k 1846.87k 3869.10k 5273.94k 5892.78k -rc4 7870.87k 10438.10k 10857.13k 10729.47k 10788.86k -des cbc 1960.60k 2226.37k 2241.88k 2054.83k 2181.80k -des ede3 734.44k 739.69k 779.43k 750.25k 772.78k -idea cbc 654.07k 711.00k 716.89k 718.51k 720.90k -rc2 cbc 648.83k 701.91k 708.61k 708.95k 709.97k -rc5-32/12 cbc 3504.71k 4054.76k 4131.41k 4105.56k 4134.23k -blowfish cbc 3762.25k 4313.79k 4460.54k 4356.78k 4317.18k -cast cbc 2755.01k 3038.91k 3076.44k 3027.63k 2998.27k - sign verify sign/s verify/s -rsa 512 bits 0.0195s 0.0019s 51.4 519.9 -rsa 1024 bits 0.1000s 0.0059s 10.0 168.2 -rsa 2048 bits 0.6406s 0.0209s 1.6 47.8 -rsa 4096 bits 4.6100s 0.0787s 0.2 12.7 - sign verify sign/s verify/s -dsa 512 bits 0.0188s 0.0360s 53.1 27.8 -dsa 1024 bits 0.0570s 0.1126s 17.5 8.9 -dsa 2048 bits 0.1990s 0.3954s 5.0 2.5 - diff --git a/deps/openssl/openssl/times/091/68000.bsd b/deps/openssl/openssl/times/091/68000.bsd deleted file mode 100644 index a3a14e80873e8d..00000000000000 --- a/deps/openssl/openssl/times/091/68000.bsd +++ /dev/null @@ -1,32 +0,0 @@ -Motorolla 68020 20mhz, NetBSD - -SSLeay 0.9.0t 29-May-1998 -built on Fri Jun 5 12:42:23 EST 1998 -options:bn(64,32) md2(char) rc4(idx,int) des(idx,cisc,16,long) idea(int) blowfish(idx) -C flags:gcc -DTERMIOS -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 2176.00 5994.67 8079.73 8845.18 9077.01 -mdc2 5730.67 6122.67 6167.66 6176.51 6174.87 -md5 29.10k 127.31k 209.66k 250.50k 263.99k -hmac(md5) 12.33k 73.02k 160.17k 228.04k 261.15k -sha1 11.27k 49.37k 84.31k 102.40k 109.23k -rmd160 11.69k 48.62k 78.76k 93.15k 98.41k -rc4 117.96k 148.94k 152.57k 153.09k 152.92k -des cbc 27.13k 30.06k 30.38k 30.38k 30.53k -des ede3 10.51k 10.94k 11.01k 11.01k 11.01k -idea cbc 26.74k 29.23k 29.45k 29.60k 29.74k -rc2 cbc 34.27k 39.39k 40.03k 40.07k 40.16k -rc5-32/12 cbc 64.31k 83.18k 85.70k 86.70k 87.09k -blowfish cbc 48.86k 59.18k 60.07k 60.42k 60.78k -cast cbc 42.67k 50.01k 50.86k 51.20k 51.37k - sign verify sign/s verify/s -rsa 512 bits 0.7738s 0.0774s 1.3 12.9 -rsa 1024 bits 4.3967s 0.2615s 0.2 3.8 -rsa 2048 bits 29.5200s 0.9664s 0.0 1.0 - sign verify sign/s verify/s -dsa 512 bits 0.7862s 0.9709s 1.3 1.0 -dsa 1024 bits 2.5375s 3.1625s 0.4 0.3 -dsa 2048 bits 9.2150s 11.8200s 0.1 0.1 - - diff --git a/deps/openssl/openssl/times/091/686-200.lnx b/deps/openssl/openssl/times/091/686-200.lnx deleted file mode 100644 index bb857d48d0e3bb..00000000000000 --- a/deps/openssl/openssl/times/091/686-200.lnx +++ /dev/null @@ -1,32 +0,0 @@ -Pentium Pro 200mhz, linux - -SSLeay 0.9.0d 26-Apr-1998 -built on Sun Apr 26 10:25:33 EST 1998 -options:bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) -C flags:gcc -DL_ENDIAN -DTERMIO -DBN_ASM -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DSHA1_ASM -DMD5_ASM -DRMD160_ASM -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 130.58k 364.54k 499.24k 545.79k 561.66k -mdc2 526.68k 579.72k 588.37k 588.80k 589.82k -md5 1917.71k 11434.69k 22512.21k 29495.30k 32677.89k -hmac(md5) 749.18k 5264.83k 14227.20k 25018.71k 31760.38k -sha1 1343.83k 6436.29k 11702.78k 14664.70k 15829.67k -rmd160 1038.05k 5138.77k 8985.51k 10985.13k 11799.21k -rc4 14891.04k 21334.06k 22376.79k 22579.54k 22574.42k -des cbc 4131.97k 4568.31k 4645.29k 4631.21k 4572.73k -des ede3 1567.17k 1631.13k 1657.32k 1653.08k 1643.86k -idea cbc 2427.23k 2671.21k 2716.67k 2723.84k 2733.40k -rc2 cbc 1629.90k 1767.38k 1788.50k 1797.12k 1799.51k -rc5-32/12 cbc 10290.55k 13161.60k 13744.55k 14011.73k 14123.01k -blowfish cbc 5896.42k 6920.77k 7122.01k 7151.62k 7146.15k -cast cbc 6037.71k 6935.19k 7101.35k 7145.81k 7116.12k - sign verify sign/s verify/s -rsa 512 bits 0.0070s 0.0007s 142.6 1502.9 -rsa 1024 bits 0.0340s 0.0019s 29.4 513.3 -rsa 2048 bits 0.2087s 0.0066s 4.8 151.3 -rsa 4096 bits 1.4700s 0.0242s 0.7 41.2 - sign verify sign/s verify/s -dsa 512 bits 0.0064s 0.0121s 156.1 82.9 -dsa 1024 bits 0.0184s 0.0363s 54.4 27.5 -dsa 2048 bits 0.0629s 0.1250s 15.9 8.0 - diff --git a/deps/openssl/openssl/times/091/alpha064.osf b/deps/openssl/openssl/times/091/alpha064.osf deleted file mode 100644 index a8e7fdfd610e09..00000000000000 --- a/deps/openssl/openssl/times/091/alpha064.osf +++ /dev/null @@ -1,32 +0,0 @@ -Alpha EV4.5 (21064) 275mhz, OSF1 V4.0 -SSLeay 0.9.0g 01-May-1998 -built on Mon May 4 17:26:09 CST 1998 -options:bn(64,64) md2(int) rc4(ptr,int) des(idx,cisc,4,long) idea(int) blowfish(idx) -C flags:cc -tune host -O4 -readonly_strings -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 119.58k 327.48k 443.28k 480.09k 495.16k -mdc2 436.67k 456.35k 465.42k 466.57k 469.01k -md5 1459.34k 6566.46k 11111.91k 13375.30k 14072.60k -hmac(md5) 597.90k 3595.45k 8180.88k 12099.49k 13884.46k -sha1 707.01k 3253.09k 6131.73k 7798.23k 8439.67k -rmd160 618.57k 2729.07k 4711.33k 5825.16k 6119.23k -rc4 8796.43k 9393.62k 9548.88k 9378.77k 9472.57k -des cbc 2165.97k 2514.90k 2586.27k 2572.93k 2639.08k -des ede3 945.44k 1004.03k 1005.96k 1017.33k 1020.85k -idea cbc 1498.81k 1629.11k 1637.28k 1625.50k 1641.11k -rc2 cbc 1866.00k 2044.92k 2067.12k 2064.00k 2068.96k -rc5-32/12 cbc 4366.97k 5521.32k 5687.50k 5729.16k 5736.96k -blowfish cbc 3997.31k 4790.60k 4937.84k 4954.56k 5024.85k -cast cbc 2900.19k 3673.30k 3803.73k 3823.93k 3890.25k - sign verify sign/s verify/s -rsa 512 bits 0.0069s 0.0006s 144.2 1545.8 -rsa 1024 bits 0.0304s 0.0018s 32.9 552.6 -rsa 2048 bits 0.1887s 0.0062s 5.3 161.4 -rsa 4096 bits 1.3667s 0.0233s 0.7 42.9 - sign verify sign/s verify/s -dsa 512 bits 0.0067s 0.0123s 149.6 81.1 -dsa 1024 bits 0.0177s 0.0332s 56.6 30.1 -dsa 2048 bits 0.0590s 0.1162s 16.9 8.6 - - diff --git a/deps/openssl/openssl/times/091/alpha164.lnx b/deps/openssl/openssl/times/091/alpha164.lnx deleted file mode 100644 index c994662698ce49..00000000000000 --- a/deps/openssl/openssl/times/091/alpha164.lnx +++ /dev/null @@ -1,32 +0,0 @@ -Alpha EV5.6 (21164A) 533mhz, Linux 2.0.32 - -SSLeay 0.9.0p 22-May-1998 -built on Sun May 27 14:23:38 GMT 2018 -options:bn(64,64) md2(int) rc4(ptr,int) des(idx,risc1,16,long) idea(int) blowfish(idx) -C flags:gcc -O3 -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 295.78k 825.34k 1116.42k 1225.10k 1262.65k -mdc2 918.16k 1017.55k 1032.18k 1034.24k 1035.60k -md5 3574.93k 15517.05k 25482.67k 30434.31k 32210.51k -hmac(md5) 1261.54k 7757.15k 18025.46k 27081.21k 31653.27k -sha1 2251.89k 10056.84k 16990.19k 20651.04k 21973.29k -rmd160 1615.49k 7017.13k 11601.11k 13875.62k 14690.31k -rc4 22435.16k 24476.40k 24349.95k 23042.36k 24581.53k -des cbc 5198.38k 6559.04k 6775.43k 6827.87k 6875.82k -des ede3 2257.73k 2602.18k 2645.60k 2657.12k 2670.59k -idea cbc 3694.42k 4125.61k 4180.74k 4193.28k 4192.94k -rc2 cbc 4642.47k 5323.85k 5415.42k 5435.86k 5434.03k -rc5-32/12 cbc 9705.26k 13277.79k 13843.46k 13989.66k 13987.57k -blowfish cbc 7861.28k 10852.34k 11447.98k 11616.97k 11667.54k -cast cbc 6718.13k 8599.98k 8967.17k 9070.81k 9099.28k - sign verify sign/s verify/s -rsa 512 bits 0.0018s 0.0002s 555.9 6299.5 -rsa 1024 bits 0.0081s 0.0005s 123.3 2208.7 -rsa 2048 bits 0.0489s 0.0015s 20.4 648.5 -rsa 4096 bits 0.3402s 0.0057s 2.9 174.7 - sign verify sign/s verify/s -dsa 512 bits 0.0019s 0.0032s 529.0 310.2 -dsa 1024 bits 0.0047s 0.0086s 214.1 115.7 -dsa 2048 bits 0.0150s 0.0289s 66.7 34.6 - diff --git a/deps/openssl/openssl/times/091/alpha164.osf b/deps/openssl/openssl/times/091/alpha164.osf deleted file mode 100644 index df712c689ff24f..00000000000000 --- a/deps/openssl/openssl/times/091/alpha164.osf +++ /dev/null @@ -1,31 +0,0 @@ -Alpha EV5.6 (21164A) 400mhz, OSF1 V4.0 - -SSLeay 0.9.0 10-Apr-1998 -built on Sun Apr 19 07:54:37 EST 1998 -options:bn(64,64) md2(int) rc4(ptr,int) des(ptr,risc2,4,int) idea(int) blowfish(idx) -C flags:cc -O4 -tune host -fast -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 276.30k 762.07k 1034.35k 1134.07k 1160.53k -mdc2 814.99k 845.83k 849.09k 850.33k 849.24k -md5 2468.43k 10945.27k 17963.48k 21430.89k 22544.38k -hmac(md5) 1002.48k 6023.98k 13430.99k 19344.17k 22351.80k -sha1 1984.93k 8882.47k 14856.47k 17878.70k 18955.10k -rmd160 1286.96k 5595.52k 9167.00k 10957.74k 11582.30k -rc4 15948.15k 16710.29k 16793.20k 17929.50k 18474.56k -des cbc 3416.04k 4149.37k 4296.25k 4328.89k 4327.57k -des ede3 1540.14k 1683.36k 1691.14k 1705.90k 1705.22k -idea cbc 2795.87k 3192.93k 3238.13k 3238.17k 3256.66k -rc2 cbc 3529.00k 4069.93k 4135.79k 4135.25k 4160.07k -rc5-32/12 cbc 7212.35k 9849.71k 10260.91k 10423.38k 10439.99k -blowfish cbc 6061.75k 8363.50k 8706.80k 8779.40k 8784.55k -cast cbc 5401.75k 6433.31k 6638.18k 6662.40k 6702.80k - sign verify sign/s verify/s -rsa 512 bits 0.0022s 0.0002s 449.6 4916.2 -rsa 1024 bits 0.0105s 0.0006s 95.3 1661.2 -rsa 2048 bits 0.0637s 0.0020s 15.7 495.6 -rsa 4096 bits 0.4457s 0.0075s 2.2 132.7 - sign verify sign/s verify/s -dsa 512 bits 0.0028s 0.0048s 362.2 210.4 -dsa 1024 bits 0.0064s 0.0123s 155.2 81.6 -dsa 2048 bits 0.0201s 0.0394s 49.7 25.4 diff --git a/deps/openssl/openssl/times/091/mips-rel.pl b/deps/openssl/openssl/times/091/mips-rel.pl deleted file mode 100644 index 4b2509315a4172..00000000000000 --- a/deps/openssl/openssl/times/091/mips-rel.pl +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/local/bin/perl - -&doit(100,"Pentium 100 32",0.0195,0.1000,0.6406,4.6100); # pentium-100 -&doit(200,"PPro 200 32",0.0070,0.0340,0.2087,1.4700); # pentium-100 -&doit( 25,"R3000 25 32",0.0860,0.4825,3.2417,23.8833); # R3000-25 -&doit(200,"R4400 200 32",0.0137,0.0717,0.4730,3.4367); # R4400 32bit -&doit(180,"R10000 180 32",0.0061,0.0311,0.1955,1.3871); # R10000 32bit -&doit(180,"R10000 180 64",0.0034,0.0149,0.0880,0.5933); # R10000 64bit -&doit(400,"DEC 21164 400 64",0.0022,0.0105,0.0637,0.4457); # R10000 64bit - -sub doit - { - local($mhz,$label,@data)=@_; - - for ($i=0; $i <= $#data; $i++) - { - $data[$i]=1/$data[$i]*200/$mhz; - } - printf("%s %6.1f %6.1f %6.1f %6.1f\n",$label,@data); - } - diff --git a/deps/openssl/openssl/times/091/r10000.irx b/deps/openssl/openssl/times/091/r10000.irx deleted file mode 100644 index 237ee5d1929123..00000000000000 --- a/deps/openssl/openssl/times/091/r10000.irx +++ /dev/null @@ -1,37 +0,0 @@ -MIPS R10000 32kI+32kD 180mhz, IRIX 6.4 - -Using crypto/bn/mips3.s - -This is built for n32, which is faster for all benchmarks than the n64 -compilation model - -SSLeay 0.9.0b 19-Apr-1998 -built on Sat Apr 25 12:43:14 EST 1998 -options:bn(64,64) md2(int) rc4(ptr,int) des(ptr,risc2,16,long) idea(int) blowfish(ptr) -C flags:cc -use_readonly_const -O2 -DTERMIOS -DB_ENDIAN -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 126.38k 349.38k 472.67k 517.01k 529.81k -mdc2 501.64k 545.87k 551.80k 553.64k 554.41k -md5 1825.77k 7623.64k 12630.47k 15111.74k 16012.09k -hmac(md5) 780.81k 4472.86k 9667.22k 13802.67k 15777.89k -sha1 1375.52k 6213.91k 11037.30k 13682.01k 14714.09k -rmd160 856.72k 3454.40k 5598.33k 6689.94k 7073.48k -rc4 11260.93k 13311.50k 13360.05k 13322.17k 13364.39k -des cbc 2770.78k 3055.42k 3095.18k 3092.48k 3103.03k -des ede3 1023.22k 1060.58k 1063.81k 1070.37k 1064.54k -idea cbc 3029.09k 3334.30k 3375.29k 3375.65k 3380.64k -rc2 cbc 2307.45k 2470.72k 2501.25k 2500.68k 2500.55k -rc5-32/12 cbc 6770.91k 8629.89k 8909.58k 9009.64k 9044.95k -blowfish cbc 4796.53k 5598.20k 5717.14k 5755.11k 5749.86k -cast cbc 3986.20k 4426.17k 4465.04k 4476.84k 4475.08k - sign verify sign/s verify/s -rsa 512 bits 0.0034s 0.0003s 296.1 3225.4 -rsa 1024 bits 0.0139s 0.0008s 71.8 1221.8 -rsa 2048 bits 0.0815s 0.0026s 12.3 380.3 -rsa 4096 bits 0.5656s 0.0096s 1.8 103.7 - sign verify sign/s verify/s -dsa 512 bits 0.0034s 0.0061s 290.8 164.9 -dsa 1024 bits 0.0084s 0.0161s 119.1 62.3 -dsa 2048 bits 0.0260s 0.0515s 38.5 19.4 - diff --git a/deps/openssl/openssl/times/091/r3000.ult b/deps/openssl/openssl/times/091/r3000.ult deleted file mode 100644 index ecd33908bbd6e1..00000000000000 --- a/deps/openssl/openssl/times/091/r3000.ult +++ /dev/null @@ -1,32 +0,0 @@ -MIPS R3000 64kI+64kD 25mhz, ultrix 4.3 - -SSLeay 0.9.0b 19-Apr-1998 -built on Thu Apr 23 07:22:31 EST 1998 -options:bn(32,32) md2(int) rc4(ptr,int) des(ptr,risc2,16,long) idea(int) blowfish(idx) -C flags:cc -O2 -DL_ENDIAN -DNOPROTO -DNOCONST -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 14.63k 40.65k 54.70k 60.07k 61.78k -mdc2 29.43k 37.27k 38.23k 38.57k 38.60k -md5 140.04k 676.59k 1283.84k 1654.10k 1802.24k -hmac(md5) 60.51k 378.90k 937.82k 1470.46k 1766.74k -sha1 60.77k 296.79k 525.40k 649.90k 699.05k -rmd160 48.82k 227.16k 417.19k 530.31k 572.05k -rc4 904.76k 996.20k 1007.53k 1015.65k 1010.35k -des cbc 178.87k 209.39k 213.42k 215.55k 214.53k -des ede3 74.25k 79.30k 80.40k 80.21k 80.14k -idea cbc 181.02k 209.37k 214.44k 214.36k 213.83k -rc2 cbc 161.52k 184.98k 187.99k 188.76k 189.05k -rc5-32/12 cbc 398.99k 582.91k 614.66k 626.07k 621.87k -blowfish cbc 296.38k 387.69k 405.50k 412.57k 410.05k -cast cbc 214.76k 260.63k 266.92k 268.63k 258.26k - sign verify sign/s verify/s -rsa 512 bits 0.0870s 0.0089s 11.5 112.4 -rsa 1024 bits 0.4881s 0.0295s 2.0 33.9 -rsa 2048 bits 3.2750s 0.1072s 0.3 9.3 -rsa 4096 bits 23.9833s 0.4093s 0.0 2.4 - sign verify sign/s verify/s -dsa 512 bits 0.0898s 0.1706s 11.1 5.9 -dsa 1024 bits 0.2847s 0.5565s 3.5 1.8 -dsa 2048 bits 1.0267s 2.0433s 1.0 0.5 - diff --git a/deps/openssl/openssl/times/091/r4400.irx b/deps/openssl/openssl/times/091/r4400.irx deleted file mode 100644 index 9b96ca110a9c52..00000000000000 --- a/deps/openssl/openssl/times/091/r4400.irx +++ /dev/null @@ -1,32 +0,0 @@ -R4400 16kI+16kD 200mhz, Irix 5.3 - -SSLeay 0.9.0e 27-Apr-1998 -built on Sun Apr 26 07:26:05 PDT 1998 -options:bn(64,32) md2(int) rc4(ptr,int) des(ptr,risc2,16,long) idea(int) blowfish(ptr) -C flags:cc -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 79.80k 220.59k 298.01k 327.06k 338.60k -mdc2 262.74k 285.30k 289.16k 288.36k 288.49k -md5 930.35k 4167.13k 7167.91k 8678.23k 9235.86k -hmac(md5) 399.44k 2367.57k 5370.74k 7884.28k 9076.98k -sha1 550.96k 2488.17k 4342.76k 5362.50k 5745.40k -rmd160 424.58k 1752.83k 2909.67k 3486.08k 3702.89k -rc4 6687.79k 7834.63k 7962.61k 8035.65k 7915.28k -des cbc 1544.20k 1725.94k 1748.35k 1758.17k 1745.61k -des ede3 587.29k 637.75k 645.93k 643.17k 646.01k -idea cbc 1575.52k 1719.75k 1732.41k 1736.69k 1740.11k -rc2 cbc 1496.21k 1629.90k 1643.19k 1652.14k 1646.62k -rc5-32/12 cbc 3452.48k 4276.47k 4390.74k 4405.25k 4400.12k -blowfish cbc 2354.58k 3242.36k 3401.11k 3433.65k 3383.65k -cast cbc 1942.22k 2152.28k 2187.51k 2185.67k 2177.20k - sign verify sign/s verify/s -rsa 512 bits 0.0130s 0.0014s 76.9 729.8 -rsa 1024 bits 0.0697s 0.0043s 14.4 233.9 -rsa 2048 bits 0.4664s 0.0156s 2.1 64.0 -rsa 4096 bits 3.4067s 0.0586s 0.3 17.1 - sign verify sign/s verify/s -dsa 512 bits 0.0140s 0.0261s 71.4 38.4 -dsa 1024 bits 0.0417s 0.0794s 24.0 12.6 -dsa 2048 bits 0.1478s 0.2929s 6.8 3.4 - diff --git a/deps/openssl/openssl/times/100.lnx b/deps/openssl/openssl/times/100.lnx deleted file mode 100644 index d0f45371d664f7..00000000000000 --- a/deps/openssl/openssl/times/100.lnx +++ /dev/null @@ -1,32 +0,0 @@ -SSLeay 0.8.4c 03-Aug-1999 -built on Tue Nov 4 02:52:29 EST 1997 -options:bn(64,32) md2(int) rc4(ptr,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) -C flags:gcc -DL_ENDIAN -DTERMIO -DBN_ASM -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DMD5_ASM -DSHA1_ASM -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 53.27k 155.95k 201.30k 216.41k 236.78k -mdc2 192.98k 207.98k 206.76k 206.17k 208.87k -md5 993.15k 5748.27k 11944.70k 16477.53k 18287.27k -hmac(md5) 404.97k 2787.58k 7690.07k 13744.43k 17601.88k -sha1 563.24k 2851.67k 5363.71k 6879.23k 7441.07k -rc4 7876.70k 10400.85k 10825.90k 10943.49k 10745.17k -des cbc 2047.39k 2188.25k 2188.29k 2239.49k 2233.69k -des ede3 660.55k 764.01k 773.55k 779.21k 780.97k -idea cbc 653.93k 708.48k 715.43k 719.87k 720.90k -rc2 cbc 648.08k 702.23k 708.78k 711.00k 709.97k -blowfish cbc 3764.39k 4288.66k 4375.04k 4497.07k 4423.68k -cast cbc 2757.14k 2993.75k 3035.31k 3078.90k 3055.62k - -blowfish cbc 3258.81k 3673.47k 3767.30k 3774.12k 3719.17k -cast cbc 2677.05k 3164.78k 3273.05k 3287.38k 3244.03k - - - sign verify -rsa 512 bits 0.0213s 0.0020s -rsa 1024 bits 0.1073s 0.0063s -rsa 2048 bits 0.6873s 0.0224s -rsa 4096 bits 4.9333s 0.0845s - sign verify -dsa 512 bits 0.0201s 0.0385s -dsa 1024 bits 0.0604s 0.1190s -dsa 2048 bits 0.2121s 0.4229s diff --git a/deps/openssl/openssl/times/100.nt b/deps/openssl/openssl/times/100.nt deleted file mode 100644 index 0dd7cfc478e118..00000000000000 --- a/deps/openssl/openssl/times/100.nt +++ /dev/null @@ -1,29 +0,0 @@ -SSLeay 0.8.4c 03-Aug-1999 -built on Tue Aug 3 09:49:58 EST 1999 -options:bn(64,32) md2(int) rc4(ptr,int) des(idx,cisc,4,long) idea(int) blowfish( -ptr2) -C flags:cl /W3 /WX /G5 /Ox /O2 /Ob2 /Gs0 /GF /Gy /nologo -DWIN32 -DL_ENDIAN -DBN -_ASM -DMD5_ASM -DSHA1_ASM -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 93.07k 258.38k 349.03k 382.83k 392.87k -mdc2 245.80k 259.02k 259.34k 259.16k 260.14k -md5 1103.42k 6017.65k 12210.49k 16552.11k 18291.77k -hmac(md5) 520.15k 3394.00k 8761.86k 14593.96k 17742.40k -sha1 538.06k 2726.76k 5242.22k 6821.12k 7426.18k -rc4 8283.90k 10513.09k 10886.38k 10929.50k 10816.75k -des cbc 2073.10k 2232.91k 2251.61k 2256.46k 2232.44k -des ede3 758.85k 782.46k 786.14k 786.08k 781.24k -idea cbc 831.02k 892.63k 901.07k 903.48k 901.85k -rc2 cbc 799.89k 866.09k 873.96k 876.22k 874.03k -blowfish cbc 3835.32k 4418.78k 4511.94k 4494.54k 4416.92k -cast cbc 2974.68k 3272.71k 3313.04k 3335.17k 3261.51k - sign verify -rsa 512 bits 0.0202s 0.0019s -rsa 1024 bits 0.1029s 0.0062s -rsa 2048 bits 0.6770s 0.0220s -rsa 4096 bits 4.8770s 0.0838s - sign verify -dsa 512 bits 0.0191s 0.0364s -dsa 1024 bits 0.0590s 0.1141s -dsa 2048 bits 0.2088s 0.4171s diff --git a/deps/openssl/openssl/times/200.lnx b/deps/openssl/openssl/times/200.lnx deleted file mode 100644 index fd7e7f4e92b329..00000000000000 --- a/deps/openssl/openssl/times/200.lnx +++ /dev/null @@ -1,30 +0,0 @@ -This machine was slightly loaded :-( - -SSLeay 0.8.4c 03-Aug-1999 -built on Tue Nov 4 02:52:29 EST 1997 -options:bn(64,32) md2(int) rc4(ptr,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) -C flags:gcc -DL_ENDIAN -DTERMIO -DBN_ASM -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DMD5_ASM -DSHA1_ASM -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 130.86k 365.31k 499.60k 547.75k 561.41k -mdc2 526.03k 581.38k 587.12k 586.31k 589.60k -md5 1919.49k 11173.23k 22387.60k 29553.47k 32587.21k -hmac(md5) 747.09k 5248.35k 14275.44k 24713.26k 31737.13k -sha1 1336.63k 6400.50k 11668.67k 14648.83k 15700.85k -rc4 15002.32k 21327.21k 22301.63k 22503.78k 22549.26k -des cbc 4115.16k 4521.08k 4632.37k 4607.28k 4570.57k -des ede3 1540.29k 1609.76k 1623.64k 1620.76k 1624.18k -idea cbc 2405.08k 2664.78k 2704.22k 2713.95k 2716.29k -rc2 cbc 1634.07k 1764.30k 1780.23k 1790.27k 1788.12k -blowfish cbc 5993.98k 6927.27k 7083.61k 7088.40k 7123.72k -cast cbc 5981.52k 6900.44k 7079.70k 7110.40k 7057.72k - sign verify -rsa 512 bits 0.0085s 0.0007s -rsa 1024 bits 0.0377s 0.0020s -rsa 2048 bits 0.2176s 0.0067s -rsa 4096 bits 1.4800s 0.0242s -sign verify -dsa 512 bits 0.0071s 0.0132s -dsa 1024 bits 0.0192s 0.0376s -dsa 2048 bits 0.0638s 0.1280s - diff --git a/deps/openssl/openssl/times/486-66.dos b/deps/openssl/openssl/times/486-66.dos deleted file mode 100644 index 1644bf8022a379..00000000000000 --- a/deps/openssl/openssl/times/486-66.dos +++ /dev/null @@ -1,22 +0,0 @@ -MS-dos static libs, 16bit C build, 16bit assember - -SSLeay 0.6.1 -options:bn(32,16) md2(char) rc4(idx,int) des(ptr,long) idea(short) -C flags:cl /ALw /Gx- /Gf /f- /Ocgnotb2 /G2 /W3 /WX -DL_ENDIAN /nologo -DMSDOS -D -NO_SOCK -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 18.62k 55.54k 76.88k 85.39k 86.52k -md5 94.03k 442.06k 794.38k 974.51k 1061.31k -sha 38.37k 166.23k 272.78k 331.41k 353.77k -sha1 34.38k 147.77k 244.77k 292.57k 312.08k -rc4 641.25k 795.34k 817.16k 829.57k 817.16k -des cfb 111.46k 118.08k 120.69k 119.16k 119.37k -des cbc 122.96k 135.69k 137.10k 135.69k 135.40k -des ede3 48.01k 50.92k 50.32k 50.96k 50.96k -idea cfb 97.09k 100.21k 100.36k 101.14k 100.98k -idea cbc 102.08k 109.41k 111.46k 111.65k 110.52k -rc2 cfb 120.47k 125.55k 125.79k 125.55k 125.55k -rc2 cbc 129.77k 140.33k 143.72k 142.16k 141.85k -rsa 512 bits 0.264s -rsa 1024 bits 1.494s diff --git a/deps/openssl/openssl/times/486-66.nt b/deps/openssl/openssl/times/486-66.nt deleted file mode 100644 index b26a9005d63e64..00000000000000 --- a/deps/openssl/openssl/times/486-66.nt +++ /dev/null @@ -1,22 +0,0 @@ -SSLeay 0.6.1 02-Jul-1996 -built on Fri Jul 10 09:53:15 EST 1996 -options:bn(64,32) md2(int) rc4(idx,int) des(idx,long) idea(int) -C flags:cl /W3 /WX /G5 /Ox /O2 /Ob2 /Gs0 /nologo -DWIN32 -DL_ENDIAN /MD -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 38.27k 107.28k 145.43k 159.60k 164.15k -md5 399.00k 1946.13k 3610.80k 4511.94k 4477.27k -sha 182.04k 851.26k 1470.65k 1799.20k 1876.48k -sha1 151.83k 756.55k 1289.76k 1567.38k 1625.70k -rc4 1853.92k 2196.25k 2232.91k 2241.31k 2152.96k -des cfb 360.58k 382.69k 384.94k 386.07k 377.19k -des cbc 376.10k 431.87k 436.32k 437.78k 430.45k -des ede3 152.55k 160.38k 161.51k 161.33k 159.98k -idea cfb 245.59k 255.60k 256.65k 257.16k 254.61k -idea cbc 257.16k 276.12k 279.05k 279.11k 276.70k -rc2 cfb 280.25k 293.49k 294.74k 294.15k 291.47k -rc2 cbc 295.47k 321.57k 324.76k 324.76k 320.00k -rsa 512 bits 0.084s -rsa 1024 bits 0.495s -rsa 2048 bits 3.435s - diff --git a/deps/openssl/openssl/times/486-66.w31 b/deps/openssl/openssl/times/486-66.w31 deleted file mode 100644 index 381f149b328626..00000000000000 --- a/deps/openssl/openssl/times/486-66.w31 +++ /dev/null @@ -1,23 +0,0 @@ -Windows 3.1 DLL's, 16 bit C with 32bit assember - -SSLeay 0.6.1 02-Jul-1996 -built on Wed Jul 10 09:53:15 EST 1996 -options:bn(32,32) md2(char) rc4(idx,int) des(ptr,long) idea(short) -C flags:cl /ALw /Gx- /Gf /G2 /f- /Ocgnotb2 /W3 /WX -DL_ENDIAN /nologo -DWIN16 -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 18.94k 54.27k 73.43k 80.91k 83.75k -md5 78.96k 391.26k 734.30k 919.80k 992.97k -sha 39.01k 168.04k 280.67k 336.08k 359.10k -sha1 35.20k 150.14k 247.31k 294.54k 313.94k -rc4 509.61k 655.36k 678.43k 677.02k 670.10k -des cfb 97.09k 104.69k 106.56k 105.70k 106.56k -des cbc 116.82k 129.77k 131.07k 131.07k 131.07k -des ede3 44.22k 47.90k 48.53k 48.47k 47.86k -idea cfb 83.49k 87.03k 87.03k 87.15k 87.73k -idea cbc 89.04k 96.23k 96.95k 97.81k 97.09k -rc2 cfb 108.32k 113.58k 113.78k 114.57k 114.77k -rc2 cbc 118.08k 131.07k 134.02k 134.02k 132.66k -rsa 512 bits 0.181s -rsa 1024 bits 0.846s - diff --git a/deps/openssl/openssl/times/5.lnx b/deps/openssl/openssl/times/5.lnx deleted file mode 100644 index 1c1e392a29566b..00000000000000 --- a/deps/openssl/openssl/times/5.lnx +++ /dev/null @@ -1,29 +0,0 @@ -SSLeay 0.8.5g 24-Jan-1998 -built on Tue Jan 27 08:11:42 EST 1998 -options:bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) -C flags:gcc -DL_ENDIAN -DTERMIO -DBN_ASM -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DSHA1_ASM -DMD5_ASM -DRMD160_ASM -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 56.55k 156.69k 211.63k 231.77k 238.71k -mdc2 192.26k 208.09k 210.09k 209.58k 210.26k -md5 991.04k 5745.51k 11932.67k 16465.24k 18306.39k -hmac(md5) 333.99k 2383.89k 6890.67k 13133.82k 17397.08k -sha1 571.68k 2883.88k 5379.07k 6880.26k 7443.80k -rmd160 409.41k 2212.91k 4225.45k 5456.55k 5928.28k -rc4 6847.57k 8596.22k 8901.80k 8912.90k 8850.09k -des cbc 2046.29k 2229.78k 2254.76k 2259.97k 2233.69k -des ede3 751.11k 779.95k 783.96k 784.38k 780.97k -idea cbc 653.40k 708.29k 718.42k 720.21k 720.90k -rc2 cbc 647.19k 702.46k 709.21k 710.66k 709.97k -rc5-32/12 cbc 3498.18k 4054.12k 4133.46k 4151.64k 4139.69k -blowfish cbc 3763.95k 4437.74k 4532.74k 4515.50k 4448.26k -cast cbc 2754.22k 3020.67k 3079.08k 3069.95k 3036.50k - sign verify sign/s verify/s -rsa 512 bits 0.0207s 0.0020s 48.3 511.3 -rsa 1024 bits 0.1018s 0.0059s 9.8 169.6 -rsa 2048 bits 0.6438s 0.0208s 1.6 48.0 -rsa 4096 bits 4.6033s 0.0793s 0.2 12.6 - sign verify sign/s verify/s -dsa 512 bits 0.0190s 0.0359s 52.6 27.8 -dsa 1024 bits 0.0566s 0.1109s 17.7 9.0 -dsa 2048 bits 0.1988s 0.3915s 5.0 2.6 diff --git a/deps/openssl/openssl/times/586-085i.nt b/deps/openssl/openssl/times/586-085i.nt deleted file mode 100644 index 8a5797526f2e7b..00000000000000 --- a/deps/openssl/openssl/times/586-085i.nt +++ /dev/null @@ -1,29 +0,0 @@ -SSLeay 0.8.5i 28-Jan-1998 -built on Wed Jan 28 18:00:07 EST 1998 -options:bn(64,32) md2(int) rc4(idx,int) des(idx,cisc,4,long) idea(int) blowfish(ptr2) -C flags:cl /MT /W3 /WX /G5 /Ox /O2 /Ob2 /Gs0 /GF /Gy /nologo -DWIN32 -DL_ENDIAN -DBN_ASM -DMD5_ASM -DSHA1_ASM -DRMD160_ASM -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 92.74k 257.59k 348.16k 381.79k 392.14k -mdc2 227.65k 247.82k 249.90k 250.65k 250.20k -md5 1089.54k 5966.29k 12104.77k 16493.53k 18204.44k -hmac(md5) 513.53k 3361.36k 8725.41k 14543.36k 17593.56k -sha1 580.74k 2880.51k 5376.62k 6865.78k 7413.05k -rmd160 508.06k 2427.96k 4385.51k 5510.84k 5915.80k -rc4 8004.40k 10408.74k 10794.48k 10884.12k 10728.22k -des cbc 2057.24k 2222.97k 2246.79k 2209.39k 2223.44k -des ede3 739.42k 761.99k 765.48k 760.26k 760.97k -idea cbc 827.08k 889.60k 898.83k 901.15k 897.98k -rc2 cbc 795.64k 861.04k 871.13k 872.58k 871.13k -rc5-32/12 cbc 3597.17k 4139.66k 4204.39k 4223.02k 4204.39k -blowfish cbc 3807.47k 3996.10k 4156.07k 4204.39k 4105.62k -cast cbc 2777.68k 2814.21k 2892.62k 2916.76k 2868.88k - sign verify sign/s verify/s -rsa 512 bits 0.0178s 0.0018s 56.3 541.6 -rsa 1024 bits 0.0945s 0.0059s 10.6 168.3 -rsa 2048 bits 0.6269s 0.0208s 1.6 48.0 -rsa 4096 bits 4.5560s 0.0784s 0.2 12.8 - sign verify sign/s verify/s -dsa 512 bits 0.0178s 0.0340s 56.2 29.4 -dsa 1024 bits 0.0552s 0.1077s 18.1 9.3 -dsa 2048 bits 0.1963s 0.3811s 5.1 2.6 diff --git a/deps/openssl/openssl/times/586-100.LN3 b/deps/openssl/openssl/times/586-100.LN3 deleted file mode 100644 index a6fa818f4bec7b..00000000000000 --- a/deps/openssl/openssl/times/586-100.LN3 +++ /dev/null @@ -1,26 +0,0 @@ -SSLeay 0.8.3v 15-Oct-1997 -built on Wed Oct 15 10:05:00 EST 1997 -options:bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) -C flags:gcc -DL_ENDIAN -DTERMIO -DX86_ASM -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 56.27k 156.76k 211.46k 231.77k 238.71k -mdc2 188.74k 206.12k 207.70k 207.87k 208.18k -md5 991.56k 5718.31k 11748.61k 16090.79k 17850.37k -hmac(md5) 387.56k 2636.01k 7327.83k 13340.33k 17091.24k -sha1 463.55k 2274.18k 4071.17k 5072.90k 5447.68k -rc4 3673.94k 4314.52k 4402.26k 4427.09k 4407.30k -des cbc 2023.79k 2209.77k 2233.34k 2220.71k 2222.76k -des ede3 747.17k 778.54k 781.57k 778.24k 778.24k -idea cbc 614.64k 678.04k 683.52k 685.06k 685.40k -rc2 cbc 536.83k 574.10k 578.05k 579.24k 578.90k -blowfish cbc 3673.39k 4354.58k 4450.22k 4429.48k 4377.26k - sign verify -rsa 512 bits 0.0217s 0.0021s -rsa 1024 bits 0.1083s 0.0064s -rsa 2048 bits 0.6867s 0.0223s -rsa 4096 bits 4.9400s 0.0846s - sign verify -dsa 512 bits 0.0203s 0.0387s -dsa 1024 bits 0.0599s 0.1170s -dsa 2048 bits 0.2115s 0.4242s diff --git a/deps/openssl/openssl/times/586-100.NT2 b/deps/openssl/openssl/times/586-100.NT2 deleted file mode 100644 index 7f8c167b469206..00000000000000 --- a/deps/openssl/openssl/times/586-100.NT2 +++ /dev/null @@ -1,26 +0,0 @@ -SSLeay 0.8.3e 30-Sep-1997 -built on Tue Sep 30 14:52:58 EST 1997 -options:bn(64,32) md2(int) rc4(idx,int) des(idx,cisc,4,long) idea(int) blowfish(ptr2) -C flags:cl /W3 /WX /G5 /Ox /O2 /Ob2 /Gs0 /GF /Gy /nologo -DWIN32 -DL_ENDIAN -DX86_ASM -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 92.99k 257.59k 348.16k 381.47k 392.14k -mdc2 223.77k 235.30k 237.15k 236.77k 237.29k -md5 862.53k 4222.17k 7842.75k 9925.00k 10392.23k -sha 491.34k 2338.61k 4062.28k 4986.10k 5307.90k -sha1 494.38k 2234.94k 3838.83k 4679.58k 4980.18k -rc4 6338.10k 7489.83k 7676.25k 7698.80k 7631.56k -des cbc 1654.17k 1917.66k 1961.05k 1968.05k 1960.69k -des ede3 691.17k 739.42k 744.13k 745.82k 741.40k -idea cbc 788.46k 870.33k 879.16k 881.38k 879.90k -rc2 cbc 794.44k 859.63k 868.24k 869.68k 867.45k -blowfish cbc 2379.88k 3017.48k 3116.12k 3134.76k 3070.50k - sign verify -rsa 512 bits 0.0204s 0.0027s -rsa 1024 bits 0.1074s 0.0032s -rsa 2048 bits 0.6890s 0.0246s -rsa 4096 bits 5.0180s 0.0911s - sign verify -dsa 512 bits 0.0201s 0.0376s -dsa 1024 bits 0.0608s 0.1193s -dsa 2048 bits 0.2133s 0.4294s diff --git a/deps/openssl/openssl/times/586-100.dos b/deps/openssl/openssl/times/586-100.dos deleted file mode 100644 index 3085c256b119fa..00000000000000 --- a/deps/openssl/openssl/times/586-100.dos +++ /dev/null @@ -1,24 +0,0 @@ -ms-dos static libs, 16 bit C and 16 bit assmber - -SSLeay 0.6.1 02-Jul-1996 -built on Tue Jul 9 22:52:54 EST 1996 -options:bn(32,16) md2(char) rc4(idx,int) des(ptr,long) idea(short) -C flags:cl /ALw /Gx- /Gf /G2 /f- /Ocgnotb2 /W3 /WX -DL_ENDIAN /nologo -DMSDOS -DNO_SOCK -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 45.99k 130.75k 176.53k 199.35k 203.21k -md5 236.17k 1072.16k 1839.61k 2221.56k 2383.13k -sha 107.97k 459.10k 757.64k 908.64k 954.99k -sha1 96.95k 409.92k 672.16k 788.40k 844.26k -rc4 1659.14k 1956.30k 2022.72k 2022.72k 2022.72k -des cfb 313.57k 326.86k 326.86k 331.83k 326.86k -des cbc 345.84k 378.82k 378.82k 384.38k 378.82k -des ede3 139.59k 144.66k 144.61k 144.45k 143.29k -idea cfb 262.67k 274.21k 274.21k 274.21k 274.21k -idea cbc 284.32k 318.14k 318.14k 318.14k 318.14k -rc2 cfb 265.33k 274.21k 277.69k 277.11k 277.69k -rc2 cbc 283.71k 310.60k 309.86k 313.57k 314.32k -rsa 512 bits 0.104s -rsa 1024 bits 0.566s -rsa 2048 bits 3.680s -rsa 4096 bits 26.740s diff --git a/deps/openssl/openssl/times/586-100.ln4 b/deps/openssl/openssl/times/586-100.ln4 deleted file mode 100644 index 14a9db912be378..00000000000000 --- a/deps/openssl/openssl/times/586-100.ln4 +++ /dev/null @@ -1,26 +0,0 @@ -SSLeay 0.8.3aa 24-Oct-1997 -built on Mon Oct 27 10:16:25 EST 1997 -options:bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) -C flags:gcc -DL_ENDIAN -DTERMIO -DBN_ASM -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DMD5_ASM -DSHA1_ASM -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 56.78k 156.71k 211.46k 231.77k 238.71k -mdc2 187.45k 200.49k 201.64k 202.75k 202.77k -md5 1002.51k 5798.66k 11967.15k 16449.19k 18251.78k -hmac(md5) 468.71k 3173.46k 8386.99k 14305.56k 17607.34k -sha1 586.98k 2934.87k 5393.58k 6863.19k 7408.30k -rc4 3675.10k 4314.15k 4402.77k 4427.78k 4404.57k -des cbc 1902.96k 2202.01k 2242.30k 2252.46k 2236.42k -des ede3 700.15k 774.23k 783.70k 781.62k 783.70k -idea cbc 618.46k 677.93k 683.61k 685.40k 685.40k -rc2 cbc 536.97k 573.87k 577.96k 579.24k 578.90k -blowfish cbc 3672.66k 4271.89k 4428.80k 4469.76k 4374.53k - sign verify -rsa 512 bits 0.0213s 0.0021s -rsa 1024 bits 0.1075s 0.0063s -rsa 2048 bits 0.6853s 0.0224s -rsa 4096 bits 4.9400s 0.0845s - sign verify -dsa 512 bits 0.0203s 0.0380s -dsa 1024 bits 0.0600s 0.1189s -dsa 2048 bits 0.2110s 0.4250s diff --git a/deps/openssl/openssl/times/586-100.lnx b/deps/openssl/openssl/times/586-100.lnx deleted file mode 100644 index 0c051738c641df..00000000000000 --- a/deps/openssl/openssl/times/586-100.lnx +++ /dev/null @@ -1,23 +0,0 @@ -SSLeay 0.7.3 30-Apr-1997 -built on Mon May 12 04:13:55 EST 1997 -options:bn(64,32) md2(char) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) -C flags:gcc -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 72.95k 202.77k 274.01k 300.37k 309.23k -md5 770.57k 4094.02k 7409.41k 9302.36k 9986.05k -sha 363.05k 1571.07k 2613.85k 3134.81k 3320.49k -sha1 340.94k 1462.85k 2419.20k 2892.12k 3042.35k -rc4 3676.91k 4314.94k 4407.47k 4430.51k 4412.76k -des cbc 1489.95k 1799.08k 1841.66k 1851.73k 1848.66k -des ede3 621.93k 711.19k 726.10k 729.77k 729.09k -idea cbc 618.16k 676.99k 683.09k 684.37k 683.59k -rc2 cbc 537.59k 573.93k 578.56k 579.58k 579.70k -blowfish cbc 2077.57k 2682.20k 2827.18k 2840.92k 2842.62k -rsa 512 bits 0.024s 0.003 -rsa 1024 bits 0.120s 0.003 -rsa 2048 bits 0.751s 0.026 -rsa 4096 bits 5.320s 0.096 -dsa 512 bits 0.022s 0.042 -dsa 1024 bits 0.065s 0.126 -dsa 2048 bits 0.227s 0.449 diff --git a/deps/openssl/openssl/times/586-100.nt b/deps/openssl/openssl/times/586-100.nt deleted file mode 100644 index 9adcac31050ac5..00000000000000 --- a/deps/openssl/openssl/times/586-100.nt +++ /dev/null @@ -1,23 +0,0 @@ -SSLeay 0.7.3 30-Apr-1997 -built on Mon May 19 10:47:38 EST 1997 -options:bn(64,32) md2(char) rc4(idx,int) des(idx,cisc,4,long) idea(int) blowfish(ptr2) -C flags not available -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 89.57k 245.94k 331.59k 362.95k 373.29k -md5 858.93k 4175.51k 7700.21k 9715.78k 10369.11k -sha 466.18k 2103.67k 3607.69k 4399.31k 4669.16k -sha1 449.59k 2041.02k 3496.13k 4256.45k 4512.92k -rc4 5862.55k 7447.27k 7698.80k 7768.38k 7653.84k -des cbc 1562.71k 1879.84k 1928.24k 1938.93k 1911.02k -des ede3 680.27k 707.97k 728.62k 733.15k 725.98k -idea cbc 797.46k 885.85k 895.68k 898.06k 896.45k -rc2 cbc 609.46k 648.75k 654.01k 654.42k 653.60k -blowfish cbc 2357.94k 3000.22k 3106.89k 3134.76k 3080.42k -rsa 512 bits 0.022s 0.003 -rsa 1024 bits 0.112s 0.003 -rsa 2048 bits 0.726s 0.026 -rsa 4096 bits 5.268s 0.095 -dsa 512 bits 0.021s 0.039 -dsa 1024 bits 0.063s 0.127 -dsa 2048 bits 0.224s 0.451 diff --git a/deps/openssl/openssl/times/586-100.ntx b/deps/openssl/openssl/times/586-100.ntx deleted file mode 100644 index 35166a5e9785ec..00000000000000 --- a/deps/openssl/openssl/times/586-100.ntx +++ /dev/null @@ -1,30 +0,0 @@ -SSLeay 0.8.5f 22-Jan-1998 -built on Wed Jan 21 17:11:53 EST 1998 -options:bn(64,32) md2(int) rc4(idx,int) des(idx,cisc,4,long) idea(int) blowfish( -ptr2) -C flags:cl /MT /W3 /WX /G5 /Ox /O2 /Ob2 /Gs0 /GF /Gy /nologo -DWIN32 -DL_ENDIAN --DBN_ASM -DMD5_ASM -DSHA1_ASM -DRMD160_ASM -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 92.99k 257.43k 347.84k 381.82k 392.14k -mdc2 232.19k 253.68k 257.57k 258.70k 258.70k -md5 1094.09k 5974.79k 12139.81k 16487.04k 18291.77k -hmac(md5) 375.70k 2590.04k 7309.70k 13469.18k 17447.19k -sha1 613.78k 2982.93k 5446.44k 6889.46k 7424.86k -rmd160 501.23k 2405.68k 4367.25k 5503.61k 5915.80k -rc4 8167.75k 10429.44k 10839.12k 10929.50k 10772.30k -des cbc 2057.24k 2218.27k 2237.20k 2227.69k 2213.59k -des ede3 719.63k 727.11k 728.77k 719.56k 722.97k -idea cbc 827.67k 888.85k 898.06k 900.30k 898.75k -rc2 cbc 797.46k 862.53k 870.33k 872.58k 870.40k -blowfish cbc 3835.32k 4435.60k 4513.89k 4513.89k 4416.92k -cast cbc 2785.06k 3052.62k 3088.59k 3034.95k 3034.95k - sign verify sign/s verify/s -rsa 512 bits 0.0202s 0.0020s 49.4 500.2 -rsa 1024 bits 0.1030s 0.0063s 9.7 159.4 -rsa 2048 bits 0.6740s 0.0223s 1.5 44.9 -rsa 4096 bits 4.8970s 0.0844s 0.2 11.8 - sign verify sign/s verify/s -dsa 512 bits 0.0191s 0.0361s 52.4 27.7 -dsa 1024 bits 0.0587s 0.1167s 17.0 8.6 -dsa 2048 bits 0.2091s 0.4123s 4.8 2.4 diff --git a/deps/openssl/openssl/times/586-100.w31 b/deps/openssl/openssl/times/586-100.w31 deleted file mode 100644 index d5b1c102435ee9..00000000000000 --- a/deps/openssl/openssl/times/586-100.w31 +++ /dev/null @@ -1,27 +0,0 @@ -Pentium 100, Windows 3.1 DLL's, 16 bit C, 32bit assember. - -Running under Windows NT 4.0 Beta 2 - -SSLeay 0.6.4 20-Aug-1996 -built on Thu Aug 22 08:44:21 EST 1996 -options:bn(32,32) md2(char) rc4(idx,int) des(ptr,long) idea(short) -C flags:cl /ALw /Gx- /Gf /G2 /f- /Ocgnotb2 /W3 /WX -DL_ENDIAN /nologo -DWIN16 -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 45.83k 128.82k 180.17k 194.90k 198.59k -md5 224.82k 1038.19k 1801.68k 2175.47k 2330.17k -sha 105.11k 448.11k 739.48k 884.13k 944.66k -sha1 94.71k 402.99k 667.88k 795.58k 844.26k -rc4 1614.19k 1956.30k 2022.72k 2022.72k 2022.72k -des cfb 291.27k 318.14k 318.14k 318.14k 322.84k -des cbc 326.86k 356.17k 362.08k 362.08k 367.15k -des ede3 132.40k 139.57k 139.53k 139.37k 140.97k -idea cfb 265.33k 280.67k 280.67k 277.69k 281.27k -idea cbc 274.21k 302.01k 306.24k 306.24k 305.53k -rc2 cfb 264.79k 274.21k 274.78k 274.21k 274.21k -rc2 cbc 281.27k 306.24k 309.86k 305.53k 309.86k -rsa 512 bits 0.058s -rsa 1024 bits 0.280s -rsa 2048 bits 1.430s -rsa 4096 bits 10.600s - diff --git a/deps/openssl/openssl/times/586-1002.lnx b/deps/openssl/openssl/times/586-1002.lnx deleted file mode 100644 index d830bcea422731..00000000000000 --- a/deps/openssl/openssl/times/586-1002.lnx +++ /dev/null @@ -1,26 +0,0 @@ -SSLeay 0.8.3e 30-Sep-1997 -built on Wed Oct 1 03:01:44 EST 1997 -options:bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) -C flags:gcc -DL_ENDIAN -DTERMIO -DX86_ASM -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 56.21k 156.57k 211.29k 231.77k 237.92k -mdc2 170.99k 191.70k 193.90k 195.58k 195.95k -md5 770.50k 3961.96k 7291.22k 9250.82k 9942.36k -sha 344.93k 1520.77k 2569.81k 3108.52k 3295.91k -sha1 326.20k 1423.74k 2385.15k 2870.95k 3041.96k -rc4 3672.88k 4309.65k 4374.41k 4408.66k 4355.41k -des cbc 1349.73k 1689.05k 1735.34k 1748.99k 1739.43k -des ede3 638.70k 704.00k 711.85k 714.41k 712.70k -idea cbc 619.55k 677.33k 683.26k 685.06k 685.40k -rc2 cbc 521.18k 571.20k 573.46k 578.90k 578.90k -blowfish cbc 2079.67k 2592.49k 2702.34k 2730.33k 2695.17k - sign verify -rsa 512 bits 0.0213s 0.0026s -rsa 1024 bits 0.1099s 0.0031s -rsa 2048 bits 0.7007s 0.0248s -rsa 4096 bits 5.0500s 0.0921s - sign verify -dsa 512 bits 0.0203s 0.0389s -dsa 1024 bits 0.0614s 0.1222s -dsa 2048 bits 0.2149s 0.4283s diff --git a/deps/openssl/openssl/times/586p-100.lnx b/deps/openssl/openssl/times/586p-100.lnx deleted file mode 100644 index 561eb3114fe21d..00000000000000 --- a/deps/openssl/openssl/times/586p-100.lnx +++ /dev/null @@ -1,26 +0,0 @@ -Pentium 100 - Linux 1.2.13 - gcc 2.7.2p -This is the pentium specific version of gcc - -SSLeay 0.6.4 20-Aug-1996 -built on Thu Aug 22 08:27:58 EST 1996 -options:bn(64,32) md2(char) rc4(idx,int) des(idx,long) idea(int) -C flags:gcc -DL_ENDIAN -DTERMIO -O6 -fomit-frame-pointer -mpentium -Wall -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 74.90k 208.43k 282.11k 309.59k 318.43k -md5 807.08k 4205.67k 7801.51k 9958.06k 10810.71k -sha 405.98k 1821.55k 3119.10k 3799.04k 4052.31k -sha1 389.13k 1699.50k 2852.78k 3437.57k 3656.36k -rc4 3621.15k 4130.07k 4212.74k 4228.44k 4213.42k -des cfb 794.39k 828.37k 831.74k 832.51k 832.85k -des cbc 817.68k 886.17k 894.72k 896.00k 892.93k -des ede3 308.83k 323.29k 324.61k 324.95k 324.95k -idea cfb 690.41k 715.39k 718.51k 719.19k 718.17k -idea cbc 696.80k 760.60k 767.32k 768.68k 770.05k -rc2 cfb 619.91k 639.74k 642.30k 642.73k 641.71k -rc2 cbc 631.99k 671.42k 676.35k 676.18k 677.21k -rsa 512 bits 0.025s -rsa 1024 bits 0.123s -rsa 2048 bits 0.756s -rsa 4096 bits 5.365s - diff --git a/deps/openssl/openssl/times/686-200.bsd b/deps/openssl/openssl/times/686-200.bsd deleted file mode 100644 index f23c580e09f596..00000000000000 --- a/deps/openssl/openssl/times/686-200.bsd +++ /dev/null @@ -1,25 +0,0 @@ -Pentium Pro 200mhz -FreeBSD 2.1.5 -gcc 2.7.2.2 - -SSLeay 0.7.0 30-Jan-1997 -built on Tue Apr 22 12:14:36 EST 1997 -options:bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) -C flags:gcc -DTERMIOS -D_ANSI_SOURCE -fomit-frame-pointer -O3 -m486 -Wall -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 130.99k 367.68k 499.09k 547.04k 566.50k -md5 1924.98k 8293.50k 13464.41k 16010.39k 16820.68k -sha 1250.75k 5330.43k 8636.88k 10227.36k 10779.14k -sha1 1071.55k 4572.50k 7459.98k 8791.96k 9341.61k -rc4 10724.22k 14546.25k 15240.18k 15259.50k 15265.63k -des cbc 3309.11k 3883.01k 3968.25k 3971.86k 3979.14k -des ede3 1442.98k 1548.33k 1562.48k 1562.00k 1563.33k -idea cbc 2195.69k 2506.39k 2529.59k 2545.66k 2546.54k -rc2 cbc 806.00k 833.52k 837.58k 838.52k 836.69k -blowfish cbc 4687.34k 5949.97k 6182.43k 6248.11k 6226.09k -rsa 512 bits 0.010s -rsa 1024 bits 0.045s -rsa 2048 bits 0.260s -rsa 4096 bits 1.690s - diff --git a/deps/openssl/openssl/times/686-200.lnx b/deps/openssl/openssl/times/686-200.lnx deleted file mode 100644 index a10cc2fd012f90..00000000000000 --- a/deps/openssl/openssl/times/686-200.lnx +++ /dev/null @@ -1,26 +0,0 @@ -SSLeay 0.8.2a 04-Sep-1997 -built on Fri Sep 5 17:37:05 EST 1997 -options:bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) C flags:gcc -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 131.02k 368.41k 500.57k 549.21k 566.09k -mdc2 535.60k 589.10k 595.88k 595.97k 594.54k -md5 1801.53k 9674.77k 17484.03k 21849.43k 23592.96k -sha 1261.63k 5533.25k 9285.63k 11187.88k 11913.90k -sha1 1103.13k 4782.53k 7933.78k 9472.34k 10070.70k -rc4 10722.53k 14443.93k 15215.79k 15299.24k 15219.59k -des cbc 3286.57k 3827.73k 3913.39k 3931.82k 3926.70k -des ede3 1443.50k 1549.08k 1561.17k 1566.38k 1564.67k -idea cbc 2203.64k 2508.16k 2538.33k 2543.62k 2547.71k -rc2 cbc 1430.94k 1511.59k 1524.82k 1527.13k 1523.33k -blowfish cbc 4716.07k 5965.82k 6190.17k 6243.67k 6234.11k - sign verify -rsa 512 bits 0.0100s 0.0011s -rsa 1024 bits 0.0451s 0.0012s -rsa 2048 bits 0.2605s 0.0086s -rsa 4096 bits 1.6883s 0.0302s - sign verify -dsa 512 bits 0.0083s 0.0156s -dsa 1024 bits 0.0228s 0.0454s -dsa 2048 bits 0.0719s 0.1446s - diff --git a/deps/openssl/openssl/times/686-200.nt b/deps/openssl/openssl/times/686-200.nt deleted file mode 100644 index c8cbaa04e39daf..00000000000000 --- a/deps/openssl/openssl/times/686-200.nt +++ /dev/null @@ -1,24 +0,0 @@ -built on Tue May 13 08:24:51 EST 1997 -options:bn(64,32) md2(char) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfi -sh(ptr2) -C flags not available -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 156.39k 427.99k 576.14k 628.36k 647.27k -md5 2120.48k 10255.02k 18396.07k 22795.13k 24244.53k -sha 1468.59k 6388.89k 10686.12k 12826.62k 13640.01k -sha1 1393.46k 6013.34k 9974.56k 11932.59k 12633.45k -rc4 13833.46k 19275.29k 20321.24k 20281.93k 20520.08k -des cbc 3382.50k 4104.02k 4152.78k 4194.30k 4194.30k -des ede3 1465.51k 1533.00k 1549.96k 1553.29k 1570.29k -idea cbc 2579.52k 3079.52k 3130.08k 3153.61k 3106.89k -rc2 cbc 1204.57k 1276.42k 1285.81k 1289.76k 1285.81k -blowfish cbc 5229.81k 6374.32k 6574.14k 6574.14k 6594.82k -rsa 512 bits 0.008s 0.001 -rsa 1024 bits 0.038s 0.001 -rsa 2048 bits 0.231s 0.008 -rsa 4096 bits 1.540s 0.027 -dsa 512 bits 0.007s 0.013 -dsa 1024 bits 0.021s 0.040 -dsa 2048 bits 0.066s 0.130 - diff --git a/deps/openssl/openssl/times/L1 b/deps/openssl/openssl/times/L1 deleted file mode 100644 index 09253d72795609..00000000000000 --- a/deps/openssl/openssl/times/L1 +++ /dev/null @@ -1,27 +0,0 @@ -SSLeay 0.8.3ad 27-Oct-1997 -built on Wed Oct 29 00:36:17 EST 1997 -options:bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) -C flags:gcc -DL_ENDIAN -DTERMIO -DBN_ASM -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DMD5_ASM -DSHA1_ASM -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 56.16k 156.50k 211.46k 231.77k 238.71k -mdc2 183.37k 205.21k 205.57k 209.92k 207.53k -md5 1003.65k 5605.56k 11628.54k 15887.70k 17522.69k -hmac(md5) 411.24k 2803.46k 7616.94k 13475.84k 16864.60k -sha1 542.66k 2843.50k 5320.53k 6833.49k 7389.18k -rc4 3677.15k 4313.73k 4407.89k 4429.82k 4404.57k -des cbc 1787.94k 2174.51k 2236.76k 2249.73k 2230.95k -des ede3 719.46k 777.26k 784.81k 780.29k 783.70k -idea cbc 619.56k 677.89k 684.12k 685.40k 685.40k -rc2 cbc 537.51k 573.93k 578.47k 579.24k 578.90k -blowfish cbc 3226.76k 4221.65k 4424.19k 4468.39k 4377.26k -cast cbc 2866.13k 3165.35k 3263.15k 3287.04k 3233.11k - sign verify -rsa 512 bits 0.0212s 0.0021s -rsa 1024 bits 0.1072s 0.0064s -rsa 2048 bits 0.6853s 0.0222s -rsa 4096 bits 4.9300s 0.0848s - sign verify -dsa 512 bits 0.0200s 0.0380s -dsa 1024 bits 0.0600s 0.1180s -dsa 2048 bits 0.2110s 0.4221s diff --git a/deps/openssl/openssl/times/R10000.t b/deps/openssl/openssl/times/R10000.t deleted file mode 100644 index 6b3874c8665d7e..00000000000000 --- a/deps/openssl/openssl/times/R10000.t +++ /dev/null @@ -1,24 +0,0 @@ -IRIX 6.2 - R10000 195mhz -SLeay 0.6.5a 06-Dec-1996 -built on Tue Dec 24 03:51:45 EST 1996 -options:bn(32,32) md2(int) rc4(ptr,int) des(ptr,risc2,16,long) idea(int) -C flags:cc -O2 -DTERMIOS -DB_ENDIAN -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 156.34k 424.03k 571.88k 628.88k 646.01k -md5 1885.02k 8181.72k 13440.53k 16020.60k 16947.54k -sha 1587.12k 7022.05k 11951.24k 14440.12k 15462.74k -sha1 1413.13k 6215.86k 10571.16k 12736.22k 13628.51k -rc4 10556.28k 11974.08k 12077.10k 12111.38k 12103.20k -des cfb 2977.71k 3252.27k 3284.36k 3302.66k 3290.54k -des cbc 3298.31k 3704.96k 3771.30k 3730.73k 3778.80k -des ede3 1278.28k 1328.82k 1342.66k 1339.82k 1343.27k -idea cfb 2843.34k 3138.04k 3180.95k 3176.46k 3188.54k -idea cbc 3115.21k 3558.03k 3590.61k 3591.24k 3601.18k -rc2 cfb 2006.66k 2133.33k 2149.03k 2159.36k 2149.71k -rc2 cbc 2167.07k 2315.30k 2338.05k 2329.34k 2333.90k -rsa 512 bits 0.008s -rsa 1024 bits 0.043s -rsa 2048 bits 0.280s -rsa 4096 bits 2.064s - diff --git a/deps/openssl/openssl/times/R4400.t b/deps/openssl/openssl/times/R4400.t deleted file mode 100644 index af8848ffe369f0..00000000000000 --- a/deps/openssl/openssl/times/R4400.t +++ /dev/null @@ -1,26 +0,0 @@ -IRIX 5.3 -R4400 200mhz -cc -O2 -SSLeay 0.6.5a 06-Dec-1996 -built on Mon Dec 23 11:51:11 EST 1996 -options:bn(32,32) md2(int) rc4(ptr,int) des(ptr,risc2,16,long) idea(int) -C flags:cc -O2 -DTERMIOS -DB_ENDIAN -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 100.62k 280.25k 380.15k 416.02k 428.82k -md5 828.62k 3525.05k 6311.98k 7742.51k 8328.04k -sha 580.04k 2513.74k 4251.73k 5101.04k 5394.80k -sha1 520.23k 2382.94k 4107.82k 5024.62k 5362.56k -rc4 5871.53k 6323.08k 6357.49k 6392.04k 6305.45k -des cfb 1016.76k 1156.72k 1176.59k 1180.55k 1181.65k -des cbc 1016.38k 1303.81k 1349.10k 1359.41k 1356.62k -des ede3 607.39k 650.74k 655.11k 657.52k 654.18k -idea cfb 1296.10k 1348.66k 1353.80k 1358.75k 1355.40k -idea cbc 1453.90k 1554.68k 1567.84k 1569.89k 1573.57k -rc2 cfb 1199.86k 1251.69k 1253.57k 1259.56k 1251.31k -rc2 cbc 1334.60k 1428.55k 1441.89k 1445.42k 1441.45k -rsa 512 bits 0.024s -rsa 1024 bits 0.125s -rsa 2048 bits 0.806s -rsa 4096 bits 5.800s - diff --git a/deps/openssl/openssl/times/aix.t b/deps/openssl/openssl/times/aix.t deleted file mode 100644 index 4f24e3980e5563..00000000000000 --- a/deps/openssl/openssl/times/aix.t +++ /dev/null @@ -1,34 +0,0 @@ -from Paco Garcia -This machine is a Bull Estrella Minitower Model MT604-100 -Processor : PPC604 -P.Speed : 100Mhz -Data/Instr Cache : 16 K -L2 Cache : 256 K -PCI BUS Speed : 33 Mhz -TransfRate PCI : 132 MB/s -Memory : 96 MB - -AIX 4.1.4 - -SSLeay 0.6.6 14-Jan-1997 -built on Mon Jan 13 21:36:03 CUT 1997 -options:bn(64,32) md2(int) rc4(ptr,char) des(idx,cisc,4,long) idea(int) blowfish -(idx) -C flags:cc -O -DAIX -DB_ENDIAN -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 53.83k 147.46k 197.63k 215.72k 221.70k -md5 1278.13k 5354.77k 8679.60k 10195.09k 10780.56k -sha 1055.34k 4600.37k 7721.30k 9298.94k 9868.63k -sha1 276.90k 1270.25k 2187.95k 2666.84k 2850.82k -rc4 4660.57k 5268.93k 5332.48k 5362.47k 5346.65k -des cbc 1774.16k 1981.10k 1979.56k 2032.71k 1972.25k -des ede3 748.81k 781.42k 785.66k 785.75k 780.84k -idea cbc 2066.19k 2329.58k 2378.91k 2379.86k 2380.89k -rc2 cbc 1278.53k 1379.69k 1389.99k 1393.66k 1389.91k -blowfish cbc 2812.91k 3307.90k 3364.91k 3386.37k 3374.32k -rsa 512 bits 0.019s -rsa 1024 bits 0.096s -rsa 2048 bits 0.614s -rsa 4096 bits 4.433s - diff --git a/deps/openssl/openssl/times/aixold.t b/deps/openssl/openssl/times/aixold.t deleted file mode 100644 index 0b51412cf9f04b..00000000000000 --- a/deps/openssl/openssl/times/aixold.t +++ /dev/null @@ -1,23 +0,0 @@ -SSLeay 0.7.3r 20-May-1997 -built on Mon Jun 2 04:06:32 EST 1997 -options:bn(64,32) md2(int) rc4(ptr,char) des(idx,cisc,4,long) idea(int) blowfish(idx) -C flags:cc -O -DAIX -DB_ENDIAN -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 19.09k 52.47k 71.23k 77.49k 78.93k -md5 214.56k 941.21k 1585.43k 1883.12k 1988.70k -sha 118.35k 521.65k 860.28k 1042.27k 1100.46k -sha1 109.52k 478.98k 825.90k 995.48k 1049.69k -rc4 1263.63k 1494.24k 1545.70k 1521.66k 1518.99k -des cbc 259.62k 286.55k 287.15k 288.15k 289.45k -des ede3 104.92k 107.88k 109.27k 109.25k 109.96k -idea cbc 291.63k 320.07k 319.40k 320.51k 318.27k -rc2 cbc 220.04k 237.76k 241.44k 245.90k 244.08k -blowfish cbc 407.95k 474.83k 480.99k 485.71k 481.07k -rsa 512 bits 0.157s 0.019 -rsa 1024 bits 0.908s 0.023 -rsa 2048 bits 6.225s 0.218 -rsa 4096 bits 46.500s 0.830 -dsa 512 bits 0.159s 0.312 -dsa 1024 bits 0.536s 1.057 -dsa 2048 bits 1.970s 3.977 diff --git a/deps/openssl/openssl/times/alpha.t b/deps/openssl/openssl/times/alpha.t deleted file mode 100644 index 3a7c6c4983622f..00000000000000 --- a/deps/openssl/openssl/times/alpha.t +++ /dev/null @@ -1,81 +0,0 @@ -SSLeay-051 Alpha gcc -O3 64Bit (assember bn_mul) -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 44.40k 121.56k 162.73k 179.20k 185.01k -md5 780.85k 3278.53k 5281.52k 6327.98k 6684.67k -sha 501.40k 2249.19k 3855.27k 4801.19k 5160.96k -sha-1 384.99k 1759.72k 3113.64k 3946.92k 4229.80k -rc4 3505.05k 3724.54k 3723.78k 3555.33k 3694.68k -des cfb 946.96k 1015.27k 1021.87k 1033.56k 1037.65k -des cbc 1001.24k 1220.20k 1243.31k 1272.73k 1265.87k -des ede3 445.34k 491.65k 500.53k 502.10k 502.44k -idea cfb 643.53k 667.49k 663.81k 666.28k 664.51k -idea cbc 650.42k 735.41k 733.27k 742.74k 745.47k -rsa 512 bits 0.031s -rsa 1024 bits 0.141s -rsa 2048 bits 0.844s -rsa 4096 bits 6.033s - -SSLeay-051 Alpha cc -O2 64bit (assember bn_mul) -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 45.37k 122.86k 165.97k 182.95k 188.42k -md5 842.42k 3629.93k 5916.76k 7039.17k 7364.61k -sha 498.93k 2197.23k 3895.60k 4756.48k 5132.13k -sha-1 382.02k 1757.21k 3112.53k 3865.23k 4128.77k -rc4 2975.25k 3049.33k 3180.97k 3214.68k 3424.26k -des cfb 901.55k 990.83k 1006.08k 1011.19k 1004.89k -des cbc 947.84k 1127.84k 1163.67k 1162.24k 1157.80k -des ede3 435.62k 485.57k 493.67k 491.52k 491.52k -idea cfb 629.31k 648.66k 647.77k 648.53k 649.90k -idea cbc 565.15k 608.00k 613.46k 613.38k 617.13k -rsa 512 bits 0.030s -rsa 1024 bits 0.141s -rsa 2048 bits 0.854s -rsa 4096 bits 6.067s - -des cfb 718.28k 822.64k 833.11k 836.27k 841.05k -des cbc 806.10k 951.42k 975.83k 983.73k 991.23k -des ede3 329.50k 379.11k 387.95k 387.41k 388.33k - -des cfb 871.62k 948.65k 951.81k 953.00k 955.58k -des cbc 953.60k 1174.27k 1206.70k 1216.10k 1216.44k -des ede3 349.34k 418.05k 427.26k 429.74k 431.45k - - - - -SSLeay-045c Alpha gcc -O3 64Bit -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 44.95k 122.22k 164.27k 180.62k 184.66k -md5 808.71k 3371.95k 5415.68k 6385.66k 6684.67k -sha 493.68k 2162.05k 3725.82k 4552.02k 4838.74k -rc4 3317.32k 3649.09k 3728.30k 3744.09k 3691.86k -cfb des 996.45k 1050.77k 1058.30k 1059.16k 1064.96k -cbc des 1096.52k 1255.49k 1282.13k 1289.90k 1299.80k -ede3 des 482.14k 513.51k 518.66k 520.19k 521.39k -cfb idea 519.90k 533.40k 535.21k 535.55k 535.21k -cbc idea 619.34k 682.21k 688.04k 689.15k 690.86k -rsa 512 bits 0.050s -rsa 1024 bits 0.279s -rsa 2048 bits 1.908s -rsa 4096 bits 14.750s - -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 37.31k 102.77k 137.64k 151.55k 155.78k -md5 516.65k 2535.21k 4655.72k 5859.66k 6343.34k -rc4 3519.61k 3707.01k 3746.86k 3755.39k 3675.48k -cfb des 780.27k 894.68k 913.10k 921.26k 922.97k -cbc des 867.54k 1040.13k 1074.17k 1075.54k 1084.07k -ede3 des 357.19k 397.36k 398.08k 402.28k 401.41k -cbc idea 646.53k 686.44k 694.03k 691.20k 693.59k -rsa 512 bits 0.046s -rsa 1024 bits 0.270s -rsa 2048 bits 1.858s -rsa 4096 bits 14.350s - -md2 C 37.83k 103.17k 137.90k 150.87k 155.37k -md2 L 37.30k 102.04k 139.01k 152.74k 155.78k -rc4 I 3532.24k 3718.08k 3750.83k 3768.78k 3694.59k -rc4 CI 2662.97k 2873.26k 2907.22k 2920.63k 2886.31k -rc4 LI 3514.63k 3738.72k 3747.41k 3752.96k 3708.49k -cbc idea S 619.01k 658.68k 661.50k 662.53k 663.55k -cbc idea L 645.69k 684.22k 694.55k 692.57k 690.86k diff --git a/deps/openssl/openssl/times/alpha400.t b/deps/openssl/openssl/times/alpha400.t deleted file mode 100644 index 079e0d187ce3b4..00000000000000 --- a/deps/openssl/openssl/times/alpha400.t +++ /dev/null @@ -1,25 +0,0 @@ -Alpha EV5.6 (21164A) 400mhz - -SSLeay 0.7.3r 20-May-1997 -built on Mon Jun 2 03:39:58 EST 1997 -options:bn(64,64) md2(int) rc4(ptr,int) des(idx,cisc,4,long) idea(int) blowfish(idx) -C flags:cc -arch host -tune host -fast -std -O4 -inline speed -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 274.98k 760.96k 1034.27k 1124.69k 1148.69k -md5 2524.46k 11602.60k 19838.81k 24075.26k 25745.10k -sha 1848.46k 8335.66k 14232.49k 17247.91k 18530.30k -sha1 1639.67k 7336.53k 12371.80k 14807.72k 15870.63k -rc4 17950.93k 19390.66k 19652.44k 19700.39k 19412.31k -des cbc 4018.59k 4872.06k 4988.76k 5003.26k 4995.73k -des ede3 1809.11k 1965.67k 1984.26k 1986.90k 1982.46k -idea cbc 2848.82k 3204.33k 3250.26k 3257.34k 3260.42k -rc2 cbc 3766.08k 4349.50k 4432.21k 4448.94k 4448.26k -blowfish cbc 6694.88k 9042.35k 9486.93k 9598.98k 9624.91k -rsa 512 bits 0.003s 0.000 -rsa 1024 bits 0.013s 0.000 -rsa 2048 bits 0.081s 0.003 -rsa 4096 bits 0.577s 0.011 -dsa 512 bits 0.003s 0.005 -dsa 1024 bits 0.007s 0.014 -dsa 2048 bits 0.025s 0.050 diff --git a/deps/openssl/openssl/times/cyrix100.lnx b/deps/openssl/openssl/times/cyrix100.lnx deleted file mode 100644 index 010a2216b1e864..00000000000000 --- a/deps/openssl/openssl/times/cyrix100.lnx +++ /dev/null @@ -1,22 +0,0 @@ -SSLeay 0.6.6 06-Dec-1996 -built on Fri Dec 6 10:05:20 GMT 1996 -options:bn(64,32) md2(char) rc4(idx,int) des(idx,risc,16,long) idea(int) -C flags:gcc -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 36.77k 102.48k 138.00k 151.57k 155.78k -md5 513.59k 2577.22k 4623.51k 5768.99k 6214.53k -sha 259.89k 1105.45k 1814.97k 2156.16k 2292.13k -sha1 242.43k 1040.95k 1719.44k 2049.74k 2164.64k -rc4 1984.48k 2303.41k 2109.37k 2071.47k 1985.61k -des cfb 712.08k 758.29k 753.17k 752.06k 748.67k -des cbc 787.37k 937.64k 956.77k 961.61k 957.54k -des ede3 353.97k 377.28k 379.99k 379.34k 379.11k -idea cfb 403.80k 418.50k 416.60k 415.78k 415.03k -idea cbc 426.54k 466.40k 471.31k 472.67k 473.14k -rc2 cfb 405.15k 420.05k 418.16k 416.72k 416.36k -rc2 cbc 428.21k 468.43k 473.09k 472.59k 474.70k -rsa 512 bits 0.040s -rsa 1024 bits 0.195s -rsa 2048 bits 1.201s -rsa 4096 bits 8.700s diff --git a/deps/openssl/openssl/times/dgux-x86.t b/deps/openssl/openssl/times/dgux-x86.t deleted file mode 100644 index 70635c536b45db..00000000000000 --- a/deps/openssl/openssl/times/dgux-x86.t +++ /dev/null @@ -1,23 +0,0 @@ -version:SSLeay 0.5.2c 15-May-1996 -built Fri Jun 14 19:47:04 EST 1996 -options:bn(LLONG,thirty_two) md2(CHAR) rc4(IDX,int) des(ary,long) idea(int) -C flags:gcc -O3 -fomit-frame-pointer -DL_ENDIAN - -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 113.86k 316.48k 428.36k 467.63k 481.56k -md5 1001.99k 5037.99k 9545.94k 12036.95k 11800.38k -sha 628.77k 2743.48k 5113.42k 6206.99k 6165.42k -sha1 583.83k 2638.66k 4538.85k 5532.09k 5917.04k -rc4 5493.27k 6369.39k 6511.30k 6577.83k 6486.73k -des cfb 1219.01k 1286.06k 1299.33k 1288.87k 1381.72k -des cbc 1360.58k 1469.04k 1456.96k 1454.08k 1513.57k -des ede3 544.45k 567.84k 568.99k 570.37k 566.09k -idea cfb 1012.39k 1056.30k 1063.52k 989.17k 863.24k -idea cbc 985.36k 1090.44k 1105.92k 1108.65k 1090.17k -rc2 cfb 963.86k 979.06k 995.30k 937.35k 827.39k -rc2 cbc 951.72k 1042.11k 1049.60k 1047.21k 1059.11k -rsa 512 bits 0.032s -rsa 1024 bits 0.159s -rsa 2048 bits 1.025s -rsa 4096 bits 7.270s - diff --git a/deps/openssl/openssl/times/dgux.t b/deps/openssl/openssl/times/dgux.t deleted file mode 100644 index c7f7564e8dab69..00000000000000 --- a/deps/openssl/openssl/times/dgux.t +++ /dev/null @@ -1,17 +0,0 @@ -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 38.54k 106.28k 144.00k 157.46k 161.72k -md5 323.23k 1471.62k 2546.11k 3100.20k 3309.57k -rc4 I 1902.74k 2055.20k 2080.42k 2077.88k 2065.46k -cfb des 456.23k 475.22k 481.79k 488.42k 487.17k -cbc des 484.30k 537.50k 553.09k 558.08k 558.67k -ede3 des 199.97k 209.05k 211.03k 211.85k 212.78k -cbc idea 478.50k 519.33k 523.42k 525.09k 526.44k -rsa 512 bits 0.159s !RSA_LLONG -rsa 1024 bits 1.053s -rsa 2048 bits 7.600s -rsa 4096 bits 59.760s - -md2 C 30.53k 83.58k 112.84k 123.22k 126.24k -rc4 1844.56k 1975.50k 1997.73k 1994.95k 1984.88k -rc4 C 1800.09k 1968.85k 1995.20k 1992.36k 1996.80k -rc4 CI 1830.81k 2035.75k 2067.28k 2070.23k 2062.77k diff --git a/deps/openssl/openssl/times/hpux-acc.t b/deps/openssl/openssl/times/hpux-acc.t deleted file mode 100644 index 0c0e936d193254..00000000000000 --- a/deps/openssl/openssl/times/hpux-acc.t +++ /dev/null @@ -1,25 +0,0 @@ -HPUX 887 - -SSLeay 0.7.3r 20-May-1997 -built on Mon Jun 2 02:59:45 EST 1997 -options:bn(32,32) md2(int) rc4(ptr,int) des(ptr,risc1,16,long) idea(int) blowfish(idx) -C flags:cc -DB_ENDIAN -D_HPUX_SOURCE -Aa -Ae +ESlit +O4 -Wl,-a,archive -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 58.99k 166.85k 225.07k 247.21k 253.76k -md5 639.22k 2726.98k 4477.25k 5312.69k 5605.20k -sha 381.08k 1661.49k 2793.84k 3368.86k 3581.23k -sha1 349.54k 1514.56k 2536.63k 3042.59k 3224.39k -rc4 2891.10k 4238.01k 4464.11k 4532.49k 4545.87k -des cbc 717.05k 808.76k 820.14k 821.97k 821.96k -des ede3 288.21k 303.50k 303.69k 305.82k 305.14k -idea cbc 325.83k 334.36k 335.89k 336.61k 333.43k -rc2 cbc 793.00k 915.81k 926.69k 933.28k 929.53k -blowfish cbc 1561.91k 2051.97k 2122.65k 2139.40k 2145.92k -rsa 512 bits 0.031s 0.004 -rsa 1024 bits 0.164s 0.004 -rsa 2048 bits 1.055s 0.037 -rsa 4096 bits 7.600s 0.137 -dsa 512 bits 0.029s 0.057 -dsa 1024 bits 0.092s 0.177 -dsa 2048 bits 0.325s 0.646 diff --git a/deps/openssl/openssl/times/hpux-kr.t b/deps/openssl/openssl/times/hpux-kr.t deleted file mode 100644 index ad4a0adc1876d5..00000000000000 --- a/deps/openssl/openssl/times/hpux-kr.t +++ /dev/null @@ -1,23 +0,0 @@ -SSLeay 0.7.3r 20-May-1997 -built on Mon Jun 2 02:17:35 EST 1997 -options:bn(32,32) md2(int) rc4(ptr,int) des(ptr,cisc,16,long) idea(int) blowfish(idx) -C flags:cc -DB_ENDIAN -DNOCONST -DNOPROTO -D_HPUX_SOURCE -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 35.30k 98.36k 133.41k 146.34k 150.69k -md5 391.20k 1737.31k 2796.65k 3313.75k 3503.74k -sha 189.55k 848.14k 1436.72k 1735.87k 1848.03k -sha1 175.30k 781.14k 1310.32k 1575.61k 1675.81k -rc4 2070.55k 2501.47k 2556.65k 2578.34k 2584.91k -des cbc 465.13k 536.85k 545.87k 547.86k 548.89k -des ede3 190.05k 200.99k 202.31k 202.22k 202.75k -idea cbc 263.44k 277.77k 282.13k 281.51k 283.15k -rc2 cbc 448.37k 511.39k 519.54k 522.00k 521.31k -blowfish cbc 839.98k 1097.70k 1131.16k 1145.64k 1144.67k -rsa 512 bits 0.048s 0.005 -rsa 1024 bits 0.222s 0.006 -rsa 2048 bits 1.272s 0.042 -rsa 4096 bits 8.445s 0.149 -dsa 512 bits 0.041s 0.077 -dsa 1024 bits 0.111s 0.220 -dsa 2048 bits 0.363s 0.726 diff --git a/deps/openssl/openssl/times/hpux.t b/deps/openssl/openssl/times/hpux.t deleted file mode 100644 index dcf7615edf363e..00000000000000 --- a/deps/openssl/openssl/times/hpux.t +++ /dev/null @@ -1,86 +0,0 @@ -HP-UX A.09.05 9000/712 - -SSLeay 0.6.6 14-Jan-1997 -built on Tue Jan 14 16:36:31 WET 1997 -options:bn(32,32) md2(int) rc4(ptr,int) des(ptr,risc1,16,long) idea(int) -blowfish(idx) -C flags:cc -DB_ENDIAN -D_HPUX_SOURCE -Aa +ESlit +O2 -Wl,-a,archive -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 66.56k 184.92k 251.82k 259.86k 282.62k -md5 615.54k 2805.92k 4764.30k 5724.21k 6084.39k -sha 358.23k 1616.46k 2781.50k 3325.72k 3640.89k -sha1 327.50k 1497.98k 2619.44k 3220.26k 3460.85k -rc4 3500.47k 3890.99k 3943.81k 3883.74k 3900.02k -des cbc 742.65k 871.66k 887.15k 891.21k 895.40k -des ede3 302.42k 322.50k 324.46k 326.66k 326.05k -idea cbc 664.41k 755.87k 765.61k 772.70k 773.69k -rc2 cbc 798.78k 931.04k 947.69k 950.31k 952.04k -blowfish cbc 1353.32k 1932.29k 2021.93k 2047.02k 2053.66k -rsa 512 bits 0.059s -rsa 1024 bits 0.372s -rsa 2048 bits 2.697s -rsa 4096 bits 20.790s - -SSLeay 0.6.6 14-Jan-1997 -built on Tue Jan 14 15:37:30 WET 1997 -options:bn(64,32) md2(int) rc4(ptr,int) des(ptr,risc1,16,long) idea(int) -blowfish(idx) -C flags:gcc -DB_ENDIAN -O3 -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 44.91k 122.57k 167.71k 183.89k 190.24k -md5 532.50k 2316.27k 3965.72k 4740.11k 5055.06k -sha 363.76k 1684.09k 2978.53k 3730.86k 3972.72k -sha1 385.76k 1743.53k 2997.69k 3650.74k 3899.08k -rc4 3178.84k 3621.31k 3672.71k 3684.01k 3571.54k -des cbc 733.00k 844.70k 863.28k 863.72k 868.73k -des ede3 289.99k 308.94k 310.11k 309.64k 312.08k -idea cbc 624.07k 713.91k 724.76k 723.35k 725.13k -rc2 cbc 704.34k 793.39k 804.25k 805.99k 782.63k -blowfish cbc 1371.24k 1823.66k 1890.05k 1915.51k 1920.12k -rsa 512 bits 0.030s -rsa 1024 bits 0.156s -rsa 2048 bits 1.113s -rsa 4096 bits 7.480s - - -HPUX B.10.01 V 9000/887 - HP92453-01 A.10.11 HP C Compiler -SSLeay 0.5.2 - -Aa +ESlit +Oall +O4 -Wl,-a,archive - -HPUX A.09.04 B 9000/887 - -ssleay 0.5.1 gcc v 2.7.0 -O3 -mpa-risc-1-1 -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 53.00k 166.81k 205.66k 241.95k 242.20k -md5 743.22k 3128.44k 6031.85k 6142.07k 7025.26k -sha 481.30k 2008.24k 3361.31k 3985.07k 4180.74k -sha-1 463.60k 1916.15k 3139.24k 3786.27k 3997.70k -rc4 3708.61k 4125.16k 4547.53k 4206.21k 4390.07k -des cfb 665.91k 705.97k 698.48k 694.25k 666.08k -des cbc 679.80k 741.90k 769.85k 747.62k 719.47k -des ede3 264.31k 270.22k 265.63k 273.07k 273.07k -idea cfb 635.91k 673.40k 605.60k 699.53k 672.36k -idea cbc 705.85k 774.63k 750.60k 715.83k 721.50k -rsa 512 bits 0.066s -rsa 1024 bits 0.372s -rsa 2048 bits 2.177s -rsa 4096 bits 16.230s - -HP92453-01 A.09.61 HP C Compiler -ssleay 0.5.1 cc -Ae +ESlit +Oall -Wl,-a,archive -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 58.69k 163.30k 213.57k 230.40k 254.23k -md5 608.60k 2596.82k 3871.43k 4684.10k 4763.88k -sha 343.26k 1482.43k 2316.80k 2766.27k 2860.26k -sha-1 319.15k 1324.13k 2106.03k 2527.82k 2747.95k -rc4 2467.47k 3374.41k 3265.49k 3354.39k 3368.55k -des cfb 812.05k 814.90k 851.20k 819.20k 854.56k -des cbc 836.35k 994.06k 916.02k 1020.01k 988.14k -des ede3 369.78k 389.15k 401.01k 382.94k 408.03k -idea cfb 290.40k 298.06k 286.11k 296.92k 299.46k -idea cbc 301.30k 297.72k 304.34k 300.10k 309.70k -rsa 512 bits 0.350s -rsa 1024 bits 2.635s -rsa 2048 bits 19.930s - diff --git a/deps/openssl/openssl/times/p2.w95 b/deps/openssl/openssl/times/p2.w95 deleted file mode 100644 index 82d1e5515d59ac..00000000000000 --- a/deps/openssl/openssl/times/p2.w95 +++ /dev/null @@ -1,22 +0,0 @@ -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 235.90k 652.30k 893.36k 985.74k 985.74k -mdc2 779.61k 816.81k 825.65k 816.01k 825.65k -md5 2788.77k 13508.23k 24672.38k 30504.03k 33156.55k -sha 1938.22k 8397.01k 14122.24k 16980.99k 18196.55k -sha1 1817.29k 7832.50k 13168.93k 15738.48k 16810.84k -rc4 15887.52k 21709.65k 22745.68k 22995.09k 22995.09k -des cbc 4599.02k 5377.31k 5377.31k 5533.38k 5533.38k -des ede3 1899.59k 2086.71k 2086.67k 2086.51k 2085.90k -idea cbc 3350.08k 3934.62k 3979.42k 4017.53k 4017.53k -rc2 cbc 1534.13k 1630.76k 1625.70k 1644.83k 1653.91k -blowfish cbc 6678.83k 8490.49k 8701.88k 8848.74k 8886.24k - sign verify -rsa 512 bits 0.0062s 0.0008s -rsa 1024 bits 0.0287s 0.0009s -rsa 2048 bits 0.1785s 0.0059s -rsa 4096 bits 1.1300s 0.0205s - sign verify -dsa 512 bits 0.0055s 0.0100s -dsa 1024 bits 0.0154s 0.0299s -dsa 2048 bits 0.0502s 0.0996s diff --git a/deps/openssl/openssl/times/pent2.t b/deps/openssl/openssl/times/pent2.t deleted file mode 100644 index b6dc269155ac0c..00000000000000 --- a/deps/openssl/openssl/times/pent2.t +++ /dev/null @@ -1,24 +0,0 @@ -pentium 2, 266mhz, Visual C++ 5.0, Windows 95 - -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 235.90k 652.30k 893.36k 985.74k 985.74k -mdc2 779.61k 816.81k 825.65k 816.01k 825.65k -md5 2788.77k 13508.23k 24672.38k 30504.03k 33156.55k -sha 1938.22k 8397.01k 14122.24k 16980.99k 18196.55k -sha1 1817.29k 7832.50k 13168.93k 15738.48k 16810.84k -rc4 15887.52k 21709.65k 22745.68k 22995.09k 22995.09k -des cbc 4599.02k 5377.31k 5377.31k 5533.38k 5533.38k -des ede3 1899.59k 2086.71k 2086.67k 2086.51k 2085.90k -idea cbc 3350.08k 3934.62k 3979.42k 4017.53k 4017.53k -rc2 cbc 1534.13k 1630.76k 1625.70k 1644.83k 1653.91k -blowfish cbc 6678.83k 8490.49k 8701.88k 8848.74k 8886.24k - sign verify -rsa 512 bits 0.0062s 0.0008s -rsa 1024 bits 0.0287s 0.0009s -rsa 2048 bits 0.1785s 0.0059s -rsa 4096 bits 1.1300s 0.0205s - sign verify -dsa 512 bits 0.0055s 0.0100s -dsa 1024 bits 0.0154s 0.0299s -dsa 2048 bits 0.0502s 0.0996s diff --git a/deps/openssl/openssl/times/readme b/deps/openssl/openssl/times/readme deleted file mode 100644 index 7074f5815b9d38..00000000000000 --- a/deps/openssl/openssl/times/readme +++ /dev/null @@ -1,11 +0,0 @@ -The 'times' in this directory are not all for the most recent version of -the library and it should be noted that on some CPUs (specifically sparc -and Alpha), the locations of files in the application after linking can -make upto a %10 speed difference when running benchmarks on things like -cbc mode DES. To put it mildly this can be very anoying. - -About the only way to get around this would be to compile the library as one -object file, or to 'include' the source files in a specific order. - -The best way to get an idea of the 'raw' DES speed is to build the -'speed' program in crypto/des. diff --git a/deps/openssl/openssl/times/s586-100.lnx b/deps/openssl/openssl/times/s586-100.lnx deleted file mode 100644 index cbc3e3c4fb91db..00000000000000 --- a/deps/openssl/openssl/times/s586-100.lnx +++ /dev/null @@ -1,25 +0,0 @@ -Shared library build - -SSLeay 0.7.3 30-Apr-1997 -built on Tue May 13 03:43:56 EST 1997 -options:bn(64,32) md2(char) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) -C flags:-DTERMIO -O3 -DL_ENDIAN -fomit-frame-pointer -m486 -Wall -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 68.95k 191.40k 258.22k 283.31k 291.21k -md5 627.37k 3064.75k 5370.15k 6765.91k 7255.38k -sha 323.35k 1431.32k 2417.07k 2916.69k 3102.04k -sha1 298.08k 1318.34k 2228.82k 2694.83k 2864.47k -rc4 3404.13k 4026.33k 4107.43k 4136.28k 4117.85k -des cbc 1414.60k 1782.53k 1824.24k 1847.64k 1840.47k -des ede3 588.36k 688.19k 700.33k 702.46k 704.51k -idea cbc 582.96k 636.71k 641.54k 642.39k 642.30k -rc2 cbc 569.34k 612.37k 617.64k 617.47k 619.86k -blowfish cbc 2015.77k 2534.49k 2609.65k 2607.10k 2615.98k -rsa 512 bits 0.027s 0.003 -rsa 1024 bits 0.128s 0.003 -rsa 2048 bits 0.779s 0.027 -rsa 4096 bits 5.450s 0.098 -dsa 512 bits 0.024s 0.045 -dsa 1024 bits 0.068s 0.132 -dsa 2048 bits 0.231s 0.469 diff --git a/deps/openssl/openssl/times/s586-100.nt b/deps/openssl/openssl/times/s586-100.nt deleted file mode 100644 index 8e3baf6d5e622b..00000000000000 --- a/deps/openssl/openssl/times/s586-100.nt +++ /dev/null @@ -1,23 +0,0 @@ -SSLeay 0.7.3 30-Apr-1997 -built on Mon May 19 10:47:38 EST 1997 -options:bn(64,32) md2(char) rc4(idx,int) des(idx,cisc,4,long) idea(int) blowfish(ptr2) -C flags not available -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 90.26k 248.57k 335.06k 366.09k 376.64k -md5 863.95k 4205.24k 7628.78k 9582.60k 10290.25k -sha 463.93k 2102.51k 3623.28k 4417.85k 4695.29k -sha1 458.23k 2005.88k 3385.78k 4094.00k 4340.13k -rc4 5843.60k 7543.71k 7790.31k 7836.89k 7791.47k -des cbc 1583.95k 1910.67k 1960.69k 1972.12k 1946.13k -des ede3 654.79k 722.60k 740.97k 745.82k 738.27k -idea cbc 792.04k 876.96k 887.35k 892.63k 890.36k -rc2 cbc 603.50k 652.38k 661.85k 662.69k 661.44k -blowfish cbc 2379.88k 3043.76k 3153.61k 3153.61k 3134.76k -rsa 512 bits 0.022s 0.003 -rsa 1024 bits 0.111s 0.003 -rsa 2048 bits 0.716s 0.025 -rsa 4096 bits 5.188s 0.094 -dsa 512 bits 0.020s 0.039 -dsa 1024 bits 0.062s 0.124 -dsa 2048 bits 0.221s 0.441 diff --git a/deps/openssl/openssl/times/sgi.t b/deps/openssl/openssl/times/sgi.t deleted file mode 100644 index 7963610150b7ee..00000000000000 --- a/deps/openssl/openssl/times/sgi.t +++ /dev/null @@ -1,29 +0,0 @@ -SGI Challenge R4400 200mhz IRIX 5.3 - gcc (2.6.3) -SSLeay 0.6.1 02-Jul-1996 -built on Tue Jul 2 16:25:30 EST 1996 -options:bn(64,32) md2(char) rc4(idx,char) des(idx,long) idea(int) -C flags:gcc -O2 -mips2 -DTERMIOS -DB_ENDIAN -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 96.53k 266.70k 360.09k 393.70k 405.07k -md5 971.15k 4382.56k 7406.90k 8979.99k 9559.18k -sha 596.86k 2832.26k 4997.30k 6277.75k 6712.89k -sha1 578.34k 2630.16k 4632.05k 5684.34k 6083.37k -rc4 5641.12k 6821.76k 6996.13k 7052.61k 6913.32k -des cfb 1354.86k 1422.11k 1434.58k 1433.24k 1432.89k -des cbc 1467.13k 1618.92k 1630.08k 1637.00k 1629.62k -des ede3 566.13k 591.91k 596.86k 596.18k 592.54k -idea cfb 1190.60k 1264.49k 1270.38k 1267.84k 1272.37k -idea cbc 1271.45k 1410.37k 1422.49k 1426.46k 1421.73k -rc2 cfb 1285.73k 1371.40k 1380.92k 1383.13k 1379.23k -rc2 cbc 1386.61k 1542.10k 1562.49k 1572.45k 1567.93k -rsa 512 bits 0.018s -rsa 1024 bits 0.106s -rsa 2048 bits 0.738s -rsa 4096 bits 5.535s - -version:SSLeay 0.5.2c 15-May-1996 -rsa 512 bits 0.035s -rsa 1024 bits 0.204s -rsa 2048 bits 1.423s -rsa 4096 bits 10.800s diff --git a/deps/openssl/openssl/times/sparc.t b/deps/openssl/openssl/times/sparc.t deleted file mode 100644 index 1611f76570a4d3..00000000000000 --- a/deps/openssl/openssl/times/sparc.t +++ /dev/null @@ -1,26 +0,0 @@ -gcc 2.7.2 -Sparc 10 - Solaris 2.3 - 50mhz -SSLeay 0.7.3r 20-May-1997 -built on Mon Jun 2 00:55:51 EST 1997 -options:bn(64,32) md2(int) rc4(ptr,char) des(idx,cisc,16,long) idea(int) blowfish(ptr) -C flags:gcc -O3 -fomit-frame-pointer -mv8 -Wall -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 54.88k 154.52k 210.35k 231.08k 237.21k -md5 550.75k 2460.49k 4116.01k 4988.74k 5159.86k -sha 340.28k 1461.76k 2430.10k 2879.87k 2999.15k -sha1 307.27k 1298.41k 2136.26k 2540.07k 2658.28k -rc4 2652.21k 2805.24k 3301.63k 4003.98k 4071.18k -des cbc 811.78k 903.93k 914.19k 921.60k 932.29k -des ede3 328.21k 344.93k 349.64k 351.48k 345.07k -idea cbc 685.06k 727.42k 734.41k 730.11k 739.21k -rc2 cbc 718.59k 777.02k 781.96k 784.38k 782.60k -blowfish cbc 1268.85k 1520.64k 1568.88k 1587.54k 1591.98k -rsa 512 bits 0.037s 0.005 -rsa 1024 bits 0.213s 0.006 -rsa 2048 bits 1.471s 0.053 -rsa 4096 bits 11.100s 0.202 -dsa 512 bits 0.038s 0.074 -dsa 1024 bits 0.128s 0.248 -dsa 2048 bits 0.473s 0.959 - diff --git a/deps/openssl/openssl/times/sparc2 b/deps/openssl/openssl/times/sparc2 deleted file mode 100644 index 4b0dd805efc0be..00000000000000 --- a/deps/openssl/openssl/times/sparc2 +++ /dev/null @@ -1,21 +0,0 @@ -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 14.56k 40.25k 54.95k 60.13k 62.18k -mdc2 53.59k 57.45k 58.11k 58.21k 58.51k -md5 176.95k 764.75k 1270.36k 1520.14k 1608.36k -hmac(md5) 55.88k 369.70k 881.15k 1337.05k 1567.40k -sha1 92.69k 419.75k 723.63k 878.82k 939.35k -rc4 1247.28k 1414.09k 1434.30k 1434.34k 1441.13k -des cbc 284.41k 318.58k 323.07k 324.09k 323.87k -des ede3 109.99k 119.99k 121.60k 121.87k 121.66k -idea cbc 43.06k 43.68k 43.84k 43.64k 44.07k -rc2 cbc 278.85k 311.44k 316.50k 316.57k 317.37k -blowfish cbc 468.89k 569.35k 581.61k 568.34k 559.54k -cast cbc 285.84k 338.79k 345.71k 346.19k 341.09k - sign verify -rsa 512 bits 0.4175s 0.0519s -rsa 1024 bits 2.9325s 0.1948s -rsa 2048 bits 22.3600s 0.7669s - sign verify -dsa 512 bits 0.5178s 1.0300s -dsa 1024 bits 1.8780s 3.7167s -dsa 2048 bits 7.3500s 14.4800s diff --git a/deps/openssl/openssl/times/sparcLX.t b/deps/openssl/openssl/times/sparcLX.t deleted file mode 100644 index 2fdaed7cc5000c..00000000000000 --- a/deps/openssl/openssl/times/sparcLX.t +++ /dev/null @@ -1,22 +0,0 @@ -Sparc Station LX -SSLeay 0.7.3 30-Apr-1997 -built on Thu May 1 10:44:02 EST 1997 -options:bn(64,32) md2(int) rc4(ptr,char) des(idx,cisc,16,long) idea(int) blowfish(ptr) -C flags:gcc -O3 -fomit-frame-pointer -mv8 -Wall -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 17.60k 48.72k 66.47k 72.70k 74.72k -md5 226.24k 1082.21k 1982.72k 2594.02k 2717.01k -sha 71.38k 320.71k 551.08k 677.76k 720.90k -sha1 63.08k 280.79k 473.86k 576.94k 608.94k -rc4 1138.30k 1257.67k 1304.49k 1377.78k 1364.42k -des cbc 265.34k 308.85k 314.28k 315.39k 317.20k -des ede3 83.23k 93.13k 94.04k 94.50k 94.63k -idea cbc 254.48k 274.26k 275.88k 274.68k 275.80k -rc2 cbc 328.27k 375.39k 381.43k 381.61k 380.83k -blowfish cbc 487.00k 498.02k 510.12k 515.41k 516.10k -rsa 512 bits 0.093s -rsa 1024 bits 0.537s -rsa 2048 bits 3.823s -rsa 4096 bits 28.650s - diff --git a/deps/openssl/openssl/times/usparc.t b/deps/openssl/openssl/times/usparc.t deleted file mode 100644 index 2215624f9f2e7b..00000000000000 --- a/deps/openssl/openssl/times/usparc.t +++ /dev/null @@ -1,25 +0,0 @@ -Sparc 2000? - Solaris 2.5.1 - 167mhz Ultra sparc - -SSLeay 0.7.3r 20-May-1997 -built on Mon Jun 2 02:25:48 EST 1997 -options:bn(64,32) md2(int) rc4(ptr,char) des(ptr,risc1,16,long) idea(int) blowfish(ptr) -C flags:cc cc -xtarget=ultra -xarch=v8plus -Xa -xO5 -Xa -DB_ENDIAN -The 'numbers' are in 1000s of bytes per second processed. -type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes -md2 135.23k 389.87k 536.66k 591.87k 603.48k -md5 1534.38k 6160.41k 9842.69k 11446.95k 11993.09k -sha 1178.30k 5020.74k 8532.22k 10275.50k 11010.05k -sha1 1114.22k 4703.94k 7703.81k 9236.14k 9756.67k -rc4 10818.03k 13327.57k 13711.10k 13810.69k 13836.29k -des cbc 3052.44k 3320.02k 3356.25k 3369.98k 3295.91k -des ede3 1310.32k 1359.98k 1367.47k 1362.94k 1362.60k -idea cbc 1749.52k 1833.13k 1844.74k 1848.32k 1848.66k -rc2 cbc 1950.25k 2053.23k 2064.21k 2072.58k 2072.58k -blowfish cbc 4927.16k 5659.75k 5762.73k 5797.55k 5805.40k -rsa 512 bits 0.021s 0.003 -rsa 1024 bits 0.126s 0.003 -rsa 2048 bits 0.888s 0.032 -rsa 4096 bits 6.770s 0.122 -dsa 512 bits 0.022s 0.043 -dsa 1024 bits 0.076s 0.151 -dsa 2048 bits 0.286s 0.574 diff --git a/deps/openssl/openssl/times/x86/bfs.cpp b/deps/openssl/openssl/times/x86/bfs.cpp deleted file mode 100644 index d74c45776078b4..00000000000000 --- a/deps/openssl/openssl/times/x86/bfs.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// -// gettsc.inl -// -// gives access to the Pentium's (secret) cycle counter -// -// This software was written by Leonard Janke (janke@unixg.ubc.ca) -// in 1996-7 and is entered, by him, into the public domain. - -#if defined(__WATCOMC__) -void GetTSC(unsigned long&); -#pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax]; -#elif defined(__GNUC__) -inline -void GetTSC(unsigned long& tsc) -{ - asm volatile(".byte 15, 49\n\t" - : "=eax" (tsc) - : - : "%edx", "%eax"); -} -#elif defined(_MSC_VER) -inline -void GetTSC(unsigned long& tsc) -{ - unsigned long a; - __asm _emit 0fh - __asm _emit 31h - __asm mov a, eax; - tsc=a; -} -#endif - -#include -#include -#include - -void main(int argc,char *argv[]) - { - BF_KEY key; - unsigned long s1,s2,e1,e2; - unsigned long data[2]; - int i,j; - - for (j=0; j<6; j++) - { - for (i=0; i<1000; i++) /**/ - { - BF_encrypt(&data[0],&key); - GetTSC(s1); - BF_encrypt(&data[0],&key); - BF_encrypt(&data[0],&key); - BF_encrypt(&data[0],&key); - GetTSC(e1); - GetTSC(s2); - BF_encrypt(&data[0],&key); - BF_encrypt(&data[0],&key); - BF_encrypt(&data[0],&key); - BF_encrypt(&data[0],&key); - GetTSC(e2); - BF_encrypt(&data[0],&key); - } - - printf("blowfish %d %d (%d)\n", - e1-s1,e2-s2,((e2-s2)-(e1-s1))); - } - } - diff --git a/deps/openssl/openssl/times/x86/casts.cpp b/deps/openssl/openssl/times/x86/casts.cpp deleted file mode 100644 index 7661191acf5ce0..00000000000000 --- a/deps/openssl/openssl/times/x86/casts.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// -// gettsc.inl -// -// gives access to the Pentium's (secret) cycle counter -// -// This software was written by Leonard Janke (janke@unixg.ubc.ca) -// in 1996-7 and is entered, by him, into the public domain. - -#if defined(__WATCOMC__) -void GetTSC(unsigned long&); -#pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax]; -#elif defined(__GNUC__) -inline -void GetTSC(unsigned long& tsc) -{ - asm volatile(".byte 15, 49\n\t" - : "=eax" (tsc) - : - : "%edx", "%eax"); -} -#elif defined(_MSC_VER) -inline -void GetTSC(unsigned long& tsc) -{ - unsigned long a; - __asm _emit 0fh - __asm _emit 31h - __asm mov a, eax; - tsc=a; -} -#endif - -#include -#include -#include - -void main(int argc,char *argv[]) - { - CAST_KEY key; - unsigned long s1,s2,e1,e2; - unsigned long data[2]; - int i,j; - - for (j=0; j<6; j++) - { - for (i=0; i<1000; i++) /**/ - { - CAST_encrypt(&data[0],&key); - GetTSC(s1); - CAST_encrypt(&data[0],&key); - CAST_encrypt(&data[0],&key); - CAST_encrypt(&data[0],&key); - GetTSC(e1); - GetTSC(s2); - CAST_encrypt(&data[0],&key); - CAST_encrypt(&data[0],&key); - CAST_encrypt(&data[0],&key); - CAST_encrypt(&data[0],&key); - GetTSC(e2); - CAST_encrypt(&data[0],&key); - } - - printf("cast %d %d (%d)\n", - e1-s1,e2-s2,((e2-s2)-(e1-s1))); - } - } - diff --git a/deps/openssl/openssl/times/x86/des3s.cpp b/deps/openssl/openssl/times/x86/des3s.cpp deleted file mode 100644 index cd2b1126f19fbb..00000000000000 --- a/deps/openssl/openssl/times/x86/des3s.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// -// gettsc.inl -// -// gives access to the Pentium's (secret) cycle counter -// -// This software was written by Leonard Janke (janke@unixg.ubc.ca) -// in 1996-7 and is entered, by him, into the public domain. - -#if defined(__WATCOMC__) -void GetTSC(unsigned long&); -#pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax]; -#elif defined(__GNUC__) -inline -void GetTSC(unsigned long& tsc) -{ - asm volatile(".byte 15, 49\n\t" - : "=eax" (tsc) - : - : "%edx", "%eax"); -} -#elif defined(_MSC_VER) -inline -void GetTSC(unsigned long& tsc) -{ - unsigned long a; - __asm _emit 0fh - __asm _emit 31h - __asm mov a, eax; - tsc=a; -} -#endif - -#include -#include -#include - -void main(int argc,char *argv[]) - { - des_key_schedule key1,key2,key3; - unsigned long s1,s2,e1,e2; - unsigned long data[2]; - int i,j; - - for (j=0; j<6; j++) - { - for (i=0; i<1000; i++) /**/ - { - des_encrypt3(&data[0],key1,key2,key3); - GetTSC(s1); - des_encrypt3(&data[0],key1,key2,key3); - des_encrypt3(&data[0],key1,key2,key3); - des_encrypt3(&data[0],key1,key2,key3); - GetTSC(e1); - GetTSC(s2); - des_encrypt3(&data[0],key1,key2,key3); - des_encrypt3(&data[0],key1,key2,key3); - des_encrypt3(&data[0],key1,key2,key3); - des_encrypt3(&data[0],key1,key2,key3); - GetTSC(e2); - des_encrypt3(&data[0],key1,key2,key3); - } - - printf("des3 %d %d (%d)\n", - e1-s1,e2-s2,((e2-s2)-(e1-s1))); - } - } - diff --git a/deps/openssl/openssl/times/x86/dess.cpp b/deps/openssl/openssl/times/x86/dess.cpp deleted file mode 100644 index 753e67ad9be280..00000000000000 --- a/deps/openssl/openssl/times/x86/dess.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// -// gettsc.inl -// -// gives access to the Pentium's (secret) cycle counter -// -// This software was written by Leonard Janke (janke@unixg.ubc.ca) -// in 1996-7 and is entered, by him, into the public domain. - -#if defined(__WATCOMC__) -void GetTSC(unsigned long&); -#pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax]; -#elif defined(__GNUC__) -inline -void GetTSC(unsigned long& tsc) -{ - asm volatile(".byte 15, 49\n\t" - : "=eax" (tsc) - : - : "%edx", "%eax"); -} -#elif defined(_MSC_VER) -inline -void GetTSC(unsigned long& tsc) -{ - unsigned long a; - __asm _emit 0fh - __asm _emit 31h - __asm mov a, eax; - tsc=a; -} -#endif - -#include -#include -#include - -void main(int argc,char *argv[]) - { - des_key_schedule key; - unsigned long s1,s2,e1,e2; - unsigned long data[2]; - int i,j; - - for (j=0; j<6; j++) - { - for (i=0; i<1000; i++) /**/ - { - des_encrypt(&data[0],key,1); - GetTSC(s1); - des_encrypt(&data[0],key,1); - des_encrypt(&data[0],key,1); - des_encrypt(&data[0],key,1); - GetTSC(e1); - GetTSC(s2); - des_encrypt(&data[0],key,1); - des_encrypt(&data[0],key,1); - des_encrypt(&data[0],key,1); - des_encrypt(&data[0],key,1); - GetTSC(e2); - des_encrypt(&data[0],key,1); - } - - printf("des %d %d (%d)\n", - e1-s1,e2-s2,((e2-s2)-(e1-s1))); - } - } - diff --git a/deps/openssl/openssl/times/x86/md4s.cpp b/deps/openssl/openssl/times/x86/md4s.cpp deleted file mode 100644 index c0ec97fc9f9b95..00000000000000 --- a/deps/openssl/openssl/times/x86/md4s.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// -// gettsc.inl -// -// gives access to the Pentium's (secret) cycle counter -// -// This software was written by Leonard Janke (janke@unixg.ubc.ca) -// in 1996-7 and is entered, by him, into the public domain. - -#if defined(__WATCOMC__) -void GetTSC(unsigned long&); -#pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax]; -#elif defined(__GNUC__) -inline -void GetTSC(unsigned long& tsc) -{ - asm volatile(".byte 15, 49\n\t" - : "=eax" (tsc) - : - : "%edx", "%eax"); -} -#elif defined(_MSC_VER) -inline -void GetTSC(unsigned long& tsc) -{ - unsigned long a; - __asm _emit 0fh - __asm _emit 31h - __asm mov a, eax; - tsc=a; -} -#endif - -#include -#include -#include - -extern "C" { -void md4_block_x86(MD4_CTX *ctx, unsigned char *buffer,int num); -} - -void main(int argc,char *argv[]) - { - unsigned char buffer[64*256]; - MD4_CTX ctx; - unsigned long s1,s2,e1,e2; - unsigned char k[16]; - unsigned long data[2]; - unsigned char iv[8]; - int i,num=0,numm; - int j=0; - - if (argc >= 2) - num=atoi(argv[1]); - - if (num == 0) num=16; - if (num > 250) num=16; - numm=num+2; - num*=64; - numm*=64; - - for (j=0; j<6; j++) - { - for (i=0; i<10; i++) /**/ - { - md4_block_x86(&ctx,buffer,numm); - GetTSC(s1); - md4_block_x86(&ctx,buffer,numm); - GetTSC(e1); - GetTSC(s2); - md4_block_x86(&ctx,buffer,num); - GetTSC(e2); - md4_block_x86(&ctx,buffer,num); - } - printf("md4 (%d bytes) %d %d (%.2f)\n",num, - e1-s1,e2-s2,(double)((e1-s1)-(e2-s2))/2); - } - } - diff --git a/deps/openssl/openssl/times/x86/md5s.cpp b/deps/openssl/openssl/times/x86/md5s.cpp deleted file mode 100644 index dd343fd4e6edfd..00000000000000 --- a/deps/openssl/openssl/times/x86/md5s.cpp +++ /dev/null @@ -1,78 +0,0 @@ -// -// gettsc.inl -// -// gives access to the Pentium's (secret) cycle counter -// -// This software was written by Leonard Janke (janke@unixg.ubc.ca) -// in 1996-7 and is entered, by him, into the public domain. - -#if defined(__WATCOMC__) -void GetTSC(unsigned long&); -#pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax]; -#elif defined(__GNUC__) -inline -void GetTSC(unsigned long& tsc) -{ - asm volatile(".byte 15, 49\n\t" - : "=eax" (tsc) - : - : "%edx", "%eax"); -} -#elif defined(_MSC_VER) -inline -void GetTSC(unsigned long& tsc) -{ - unsigned long a; - __asm _emit 0fh - __asm _emit 31h - __asm mov a, eax; - tsc=a; -} -#endif - -#include -#include -#include - -extern "C" { -void md5_block_x86(MD5_CTX *ctx, unsigned char *buffer,int num); -} - -void main(int argc,char *argv[]) - { - unsigned char buffer[64*256]; - MD5_CTX ctx; - unsigned long s1,s2,e1,e2; - unsigned char k[16]; - unsigned long data[2]; - unsigned char iv[8]; - int i,num=0,numm; - int j=0; - - if (argc >= 2) - num=atoi(argv[1]); - - if (num == 0) num=16; - if (num > 250) num=16; - numm=num+2; - num*=64; - numm*=64; - - for (j=0; j<6; j++) - { - for (i=0; i<10; i++) /**/ - { - md5_block_x86(&ctx,buffer,numm); - GetTSC(s1); - md5_block_x86(&ctx,buffer,numm); - GetTSC(e1); - GetTSC(s2); - md5_block_x86(&ctx,buffer,num); - GetTSC(e2); - md5_block_x86(&ctx,buffer,num); - } - printf("md5 (%d bytes) %d %d (%.2f)\n",num, - e1-s1,e2-s2,(double)((e1-s1)-(e2-s2))/2); - } - } - diff --git a/deps/openssl/openssl/times/x86/rc4s.cpp b/deps/openssl/openssl/times/x86/rc4s.cpp deleted file mode 100644 index 3814fde9972fcb..00000000000000 --- a/deps/openssl/openssl/times/x86/rc4s.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// -// gettsc.inl -// -// gives access to the Pentium's (secret) cycle counter -// -// This software was written by Leonard Janke (janke@unixg.ubc.ca) -// in 1996-7 and is entered, by him, into the public domain. - -#if defined(__WATCOMC__) -void GetTSC(unsigned long&); -#pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax]; -#elif defined(__GNUC__) -inline -void GetTSC(unsigned long& tsc) -{ - asm volatile(".byte 15, 49\n\t" - : "=eax" (tsc) - : - : "%edx", "%eax"); -} -#elif defined(_MSC_VER) -inline -void GetTSC(unsigned long& tsc) -{ - unsigned long a; - __asm _emit 0fh - __asm _emit 31h - __asm mov a, eax; - tsc=a; -} -#endif - -#include -#include -#include - -void main(int argc,char *argv[]) - { - unsigned char buffer[1024]; - RC4_KEY ctx; - unsigned long s1,s2,e1,e2; - unsigned char k[16]; - unsigned long data[2]; - unsigned char iv[8]; - int i,num=64,numm; - int j=0; - - if (argc >= 2) - num=atoi(argv[1]); - - if (num == 0) num=256; - if (num > 1024-16) num=1024-16; - numm=num+8; - - for (j=0; j<6; j++) - { - for (i=0; i<10; i++) /**/ - { - RC4(&ctx,numm,buffer,buffer); - GetTSC(s1); - RC4(&ctx,numm,buffer,buffer); - GetTSC(e1); - GetTSC(s2); - RC4(&ctx,num,buffer,buffer); - GetTSC(e2); - RC4(&ctx,num,buffer,buffer); - } - - printf("RC4 (%d bytes) %d %d (%d) - 8 bytes\n",num, - e1-s1,e2-s2,(e1-s1)-(e2-s2)); - } - } - diff --git a/deps/openssl/openssl/times/x86/sha1s.cpp b/deps/openssl/openssl/times/x86/sha1s.cpp deleted file mode 100644 index 3103e1871bbed9..00000000000000 --- a/deps/openssl/openssl/times/x86/sha1s.cpp +++ /dev/null @@ -1,79 +0,0 @@ -// -// gettsc.inl -// -// gives access to the Pentium's (secret) cycle counter -// -// This software was written by Leonard Janke (janke@unixg.ubc.ca) -// in 1996-7 and is entered, by him, into the public domain. - -#if defined(__WATCOMC__) -void GetTSC(unsigned long&); -#pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [edx eax]; -#elif defined(__GNUC__) -inline -void GetTSC(unsigned long& tsc) -{ - asm volatile(".byte 15, 49\n\t" - : "=eax" (tsc) - : - : "%edx", "%eax"); -} -#elif defined(_MSC_VER) -inline -void GetTSC(unsigned long& tsc) -{ - unsigned long a; - __asm _emit 0fh - __asm _emit 31h - __asm mov a, eax; - tsc=a; -} -#endif - -#include -#include -#include - -extern "C" { -void sha1_block_x86(SHA_CTX *ctx, unsigned char *buffer,int num); -} - -void main(int argc,char *argv[]) - { - unsigned char buffer[64*256]; - SHA_CTX ctx; - unsigned long s1,s2,e1,e2; - unsigned char k[16]; - unsigned long data[2]; - unsigned char iv[8]; - int i,num=0,numm; - int j=0; - - if (argc >= 2) - num=atoi(argv[1]); - - if (num == 0) num=16; - if (num > 250) num=16; - numm=num+2; - num*=64; - numm*=64; - - for (j=0; j<6; j++) - { - for (i=0; i<10; i++) /**/ - { - sha1_block_x86(&ctx,buffer,numm); - GetTSC(s1); - sha1_block_x86(&ctx,buffer,numm); - GetTSC(e1); - GetTSC(s2); - sha1_block_x86(&ctx,buffer,num); - GetTSC(e2); - sha1_block_x86(&ctx,buffer,num); - } - - printf("sha1 (%d bytes) %d %d (%.2f)\n",num, - e1-s1,e2-s2,(double)((e1-s1)-(e2-s2))/2); - } - } - diff --git a/deps/openssl/openssl/tools/c_rehash b/deps/openssl/openssl/tools/c_rehash deleted file mode 100644 index 6a27c02245e917..00000000000000 --- a/deps/openssl/openssl/tools/c_rehash +++ /dev/null @@ -1,210 +0,0 @@ -#!/usr/bin/perl - -# Perl c_rehash script, scan all files in a directory -# and add symbolic links to their hash values. - -my $dir = "/usr/local/ssl"; -my $prefix = "/usr/local/ssl"; - -my $openssl = $ENV{OPENSSL} || "openssl"; -my $pwd; -my $x509hash = "-subject_hash"; -my $crlhash = "-hash"; -my $verbose = 0; -my $symlink_exists=eval {symlink("",""); 1}; -my $removelinks = 1; - -## Parse flags. -while ( $ARGV[0] =~ /^-/ ) { - my $flag = shift @ARGV; - last if ( $flag eq '--'); - if ( $flag eq '-old') { - $x509hash = "-subject_hash_old"; - $crlhash = "-hash_old"; - } elsif ( $flag eq '-h') { - help(); - } elsif ( $flag eq '-n' ) { - $removelinks = 0; - } elsif ( $flag eq '-v' ) { - $verbose++; - } - else { - print STDERR "Usage error; try -help.\n"; - exit 1; - } -} - -sub help { - print "Usage: c_rehash [-old] [-h] [-v] [dirs...]\n"; - print " -old use old-style digest\n"; - print " -h print this help text\n"; - print " -v print files removed and linked\n"; - exit 0; -} - -eval "require Cwd"; -if (defined(&Cwd::getcwd)) { - $pwd=Cwd::getcwd(); -} else { - $pwd=`pwd`; - chomp($pwd); -} - -# DOS/Win32 or Unix delimiter? Prefix our installdir, then search. -my $path_delim = ($pwd =~ /^[a-z]\:/i) ? ';' : ':'; -$ENV{PATH} = "$prefix/bin" . ($ENV{PATH} ? $path_delim . $ENV{PATH} : ""); - -if(! -x $openssl) { - my $found = 0; - foreach (split /$path_delim/, $ENV{PATH}) { - if(-x "$_/$openssl") { - $found = 1; - $openssl = "$_/$openssl"; - last; - } - } - if($found == 0) { - print STDERR "c_rehash: rehashing skipped ('openssl' program not available)\n"; - exit 0; - } -} - -if(@ARGV) { - @dirlist = @ARGV; -} elsif($ENV{SSL_CERT_DIR}) { - @dirlist = split /$path_delim/, $ENV{SSL_CERT_DIR}; -} else { - $dirlist[0] = "$dir/certs"; -} - -if (-d $dirlist[0]) { - chdir $dirlist[0]; - $openssl="$pwd/$openssl" if (!-x $openssl); - chdir $pwd; -} - -foreach (@dirlist) { - if(-d $_ and -w $_) { - hash_dir($_); - } -} - -sub hash_dir { - my %hashlist; - print "Doing $_[0]\n"; - chdir $_[0]; - opendir(DIR, "."); - my @flist = readdir(DIR); - closedir DIR; - if ( $removelinks ) { - # Delete any existing symbolic links - foreach (grep {/^[\da-f]+\.r{0,1}\d+$/} @flist) { - if(-l $_) { - unlink $_; - print "unlink $_" if $verbose; - } - } - } - FILE: foreach $fname (grep {/\.(pem)|(crt)|(cer)|(crl)$/} @flist) { - # Check to see if certificates and/or CRLs present. - my ($cert, $crl) = check_file($fname); - if(!$cert && !$crl) { - print STDERR "WARNING: $fname does not contain a certificate or CRL: skipping\n"; - next; - } - link_hash_cert($fname) if($cert); - link_hash_crl($fname) if($crl); - } -} - -sub check_file { - my ($is_cert, $is_crl) = (0,0); - my $fname = $_[0]; - open IN, $fname; - while() { - if(/^-----BEGIN (.*)-----/) { - my $hdr = $1; - if($hdr =~ /^(X509 |TRUSTED |)CERTIFICATE$/) { - $is_cert = 1; - last if($is_crl); - } elsif($hdr eq "X509 CRL") { - $is_crl = 1; - last if($is_cert); - } - } - } - close IN; - return ($is_cert, $is_crl); -} - - -# Link a certificate to its subject name hash value, each hash is of -# the form . where n is an integer. If the hash value already exists -# then we need to up the value of n, unless its a duplicate in which -# case we skip the link. We check for duplicates by comparing the -# certificate fingerprints - -sub link_hash_cert { - my $fname = $_[0]; - $fname =~ s/'/'\\''/g; - my ($hash, $fprint) = `"$openssl" x509 $x509hash -fingerprint -noout -in "$fname"`; - chomp $hash; - chomp $fprint; - $fprint =~ s/^.*=//; - $fprint =~ tr/://d; - my $suffix = 0; - # Search for an unused hash filename - while(exists $hashlist{"$hash.$suffix"}) { - # Hash matches: if fingerprint matches its a duplicate cert - if($hashlist{"$hash.$suffix"} eq $fprint) { - print STDERR "WARNING: Skipping duplicate certificate $fname\n"; - return; - } - $suffix++; - } - $hash .= ".$suffix"; - if ($symlink_exists) { - symlink $fname, $hash; - print "link $fname -> $hash\n" if $verbose; - } else { - open IN,"<$fname" or die "can't open $fname for read"; - open OUT,">$hash" or die "can't open $hash for write"; - print OUT ; # does the job for small text files - close OUT; - close IN; - print "copy $fname -> $hash\n" if $verbose; - } - $hashlist{$hash} = $fprint; -} - -# Same as above except for a CRL. CRL links are of the form .r - -sub link_hash_crl { - my $fname = $_[0]; - $fname =~ s/'/'\\''/g; - my ($hash, $fprint) = `"$openssl" crl $crlhash -fingerprint -noout -in '$fname'`; - chomp $hash; - chomp $fprint; - $fprint =~ s/^.*=//; - $fprint =~ tr/://d; - my $suffix = 0; - # Search for an unused hash filename - while(exists $hashlist{"$hash.r$suffix"}) { - # Hash matches: if fingerprint matches its a duplicate cert - if($hashlist{"$hash.r$suffix"} eq $fprint) { - print STDERR "WARNING: Skipping duplicate CRL $fname\n"; - return; - } - $suffix++; - } - $hash .= ".r$suffix"; - if ($symlink_exists) { - symlink $fname, $hash; - print "link $fname -> $hash\n" if $verbose; - } else { - system ("cp", $fname, $hash); - print "cp $fname -> $hash\n" if $verbose; - } - $hashlist{$hash} = $fprint; -} - diff --git a/deps/openssl/openssl/util/domd b/deps/openssl/openssl/util/domd index bab48cb7a27e14..95bb1b06e25786 100755 --- a/deps/openssl/openssl/util/domd +++ b/deps/openssl/openssl/util/domd @@ -14,7 +14,8 @@ if [ "$MAKEDEPEND" = "" ]; then MAKEDEPEND=makedepend; fi cp Makefile Makefile.save # fake the presence of Kerberos touch $TOP/krb5.h -if expr "$MAKEDEPEND" : '.*gcc$' > /dev/null; then +if ${MAKEDEPEND} --version 2>&1 | grep "clang" > /dev/null || + echo $MAKEDEPEND | grep "gcc" > /dev/null; then args="" while [ $# -gt 0 ]; do if [ "$1" != "--" ]; then args="$args $1"; fi diff --git a/deps/openssl/openssl/util/indent.pro b/deps/openssl/openssl/util/indent.pro index e8714310cc4d1a..4dcda5df78cab5 100644 --- a/deps/openssl/openssl/util/indent.pro +++ b/deps/openssl/openssl/util/indent.pro @@ -749,3 +749,19 @@ -T ssl_trace_tbl -T _stdcall -T tls12_lookup +-T OPTIONS +-T OPT_PAIR +-T uint64_t +-T int64_t +-T uint32_t +-T int32_t +-T uint16_t +-T int16_t +-T uint8_t +-T int8_t +-T STRINT_PAIR +-T felem +-T felem_bytearray +-T SH_LIST +-T PACKET +-T RECORD_LAYER diff --git a/deps/openssl/openssl/util/libeay.num b/deps/openssl/openssl/util/libeay.num index 7f7487df504428..e5b3c6ea841c85 100755 --- a/deps/openssl/openssl/util/libeay.num +++ b/deps/openssl/openssl/util/libeay.num @@ -1807,6 +1807,8 @@ ASN1_UTCTIME_get 2350 NOEXIST::FUNCTION: X509_REQ_digest 2362 EXIST::FUNCTION:EVP X509_CRL_digest 2391 EXIST::FUNCTION:EVP ASN1_STRING_clear_free 2392 EXIST::FUNCTION: +SRP_VBASE_get1_by_user 2393 EXIST::FUNCTION:SRP +SRP_user_pwd_free 2394 EXIST::FUNCTION:SRP d2i_ASN1_SET_OF_PKCS7 2397 NOEXIST::FUNCTION: X509_ALGOR_cmp 2398 EXIST::FUNCTION: EVP_CIPHER_CTX_set_key_length 2399 EXIST::FUNCTION: diff --git a/deps/openssl/openssl/util/mk1mf.pl b/deps/openssl/openssl/util/mk1mf.pl index 9b8abc0cf115fe..2629a1c5dd645b 100755 --- a/deps/openssl/openssl/util/mk1mf.pl +++ b/deps/openssl/openssl/util/mk1mf.pl @@ -290,6 +290,7 @@ $cflags.=" -DOPENSSL_FIPS" if $fips; $cflags.=" -DOPENSSL_NO_JPAKE" if $no_jpake; $cflags.=" -DOPENSSL_NO_EC2M" if $no_ec2m; +$cflags.=" -DOPENSSL_NO_WEAK_SSL_CIPHERS" if $no_weak_ssl; $cflags.= " -DZLIB" if $zlib_opt; $cflags.= " -DZLIB_SHARED" if $zlib_opt == 2; @@ -447,7 +448,7 @@ # N.B. You MUST use -j on FreeBSD. # This makefile has been automatically generated from the OpenSSL distribution. # This single makefile will build the complete OpenSSL distribution and -# by default leave the 'intertesting' output files in .${o}out and the stuff +# by default leave the 'interesting' output files in .${o}out and the stuff # that needs deleting in .${o}tmp. # The file was generated by running 'make makefile.one', which # does a 'make files', which writes all the environment variables from all @@ -482,7 +483,7 @@ # The OpenSSL directory SRC_D=$src_dir -LINK=$link +LINK_CMD=$link LFLAGS=$lflags RSC=$rsc @@ -1205,6 +1206,7 @@ sub read_options "no-jpake" => \$no_jpake, "no-ec2m" => \$no_ec2m, "no-ec_nistp_64_gcc_128" => 0, + "no-weak-ssl-ciphers" => \$no_weak_ssl, "no-err" => \$no_err, "no-sock" => \$no_sock, "no-krb5" => \$no_krb5, diff --git a/deps/openssl/openssl/util/mkrc.pl b/deps/openssl/openssl/util/mkrc.pl index 0ceadcf8d143f4..83ee6a4167fc37 100755 --- a/deps/openssl/openssl/util/mkrc.pl +++ b/deps/openssl/openssl/util/mkrc.pl @@ -57,7 +57,7 @@ BEGIN VALUE "ProductVersion", "$version\\0" // Optional: //VALUE "Comments", "\\0" - VALUE "LegalCopyright", "Copyright � 1998-2006 The OpenSSL Project. Copyright � 1995-1998 Eric A. Young, Tim J. Hudson. All rights reserved.\\0" + VALUE "LegalCopyright", "Copyright © 1998-2006 The OpenSSL Project. Copyright © 1995-1998 Eric A. Young, Tim J. Hudson. All rights reserved.\\0" //VALUE "LegalTrademarks", "\\0" //VALUE "PrivateBuild", "\\0" //VALUE "SpecialBuild", "\\0" diff --git a/deps/openssl/openssl/util/mkstack.pl b/deps/openssl/openssl/util/mkstack.pl index 2bd96cd0c1ea81..f4520d4dd32818 100755 --- a/deps/openssl/openssl/util/mkstack.pl +++ b/deps/openssl/openssl/util/mkstack.pl @@ -98,7 +98,7 @@ EOF } - foreach $type_thing (sort @sstacklst) { + foreach $type_thing (sort { $a->[0] cmp $b->[0]} @sstacklst) { my $t1 = $type_thing->[0]; my $t2 = $type_thing->[1]; $new_stackfile .= < "$F.utf8" && \ + ( cmp -s "$F" "$F.utf8" || \ + ( echo "$F" + mv "$F" "$F.iso-8859-1" + mv "$F.utf8" "$F" + ) + ) + fi + done diff --git a/deps/uv/AUTHORS b/deps/uv/AUTHORS index b2397e2df6de5f..8dc3955cad5bf3 100644 --- a/deps/uv/AUTHORS +++ b/deps/uv/AUTHORS @@ -225,3 +225,18 @@ Colin Snover Sakthipriyan Vairamani Eli Skeggs nmushell +Gireesh Punathil +Ryan Johnston +Adam Stylinski +Nathan Corvino +Wink Saville +Angel Leon +Louis DeJardin +Imran Iqbal +Petka Antonov +Ian Kronquist +kkdaemon +Yuval Brik +Joran Dirk Greef +Andrey Mazo +sztomi diff --git a/deps/uv/ChangeLog b/deps/uv/ChangeLog index 42f10352b1cb35..af0743af72c8db 100644 --- a/deps/uv/ChangeLog +++ b/deps/uv/ChangeLog @@ -1,3 +1,102 @@ +2015.12.15, Version 1.8.0 (Stable), 5467299450ecf61635657557b6e01aaaf6c3fdf4 + +Changes since version 1.7.5: + +* unix: fix memory leak in uv_interface_addresses (Jianghua Yang) + +* unix: make uv_guess_handle work properly for AIX (Gireesh Punathil) + +* fs: undo uv__req_init when uv__malloc failed (Jianghua Yang) + +* build: remove unused 'component' GYP option (Saúl Ibarra Corretgé) + +* include: remove duplicate extern declaration (Jianghua Yang) + +* win: use the MSVC provided snprintf where possible (Jason Williams) + +* win, test: fix compilation warning (Saúl Ibarra Corretgé) + +* win: fix compilation with VS < 2012 (Ryan Johnston) + +* stream: support empty uv_try_write on unix (Fedor Indutny) + +* unix: fix request handle leak in uv__udp_send (Jianghua Yang) + +* src: replace QUEUE_SPLIT with QUEUE_MOVE (Ben Noordhuis) + +* unix: use QUEUE_MOVE when iterating over lists (Ben Noordhuis) + +* unix: squelch harmless valgrind warning (Ben Noordhuis) + +* test: don't abort on setrlimit() failure (Ben Noordhuis) + +* unix: only undo fs req registration in async mode (Ben Noordhuis) + +* unix: fix uv__getiovmax return value (HungMingWu) + +* unix: make work with Solaris Studio. (Adam Stylinski) + +* test: fix fs_event_watch_file_currentdir flakiness (Santiago Gimeno) + +* unix: skip prohibited syscalls on tvOS and watchOS (Nathan Corvino) + +* test: use FQDN in getaddrinfo_fail test (Wink Saville) + +* docs: clarify documentation of uv_tcp_init_ex (Andrius Bentkus) + +* win: fix comment (Miodrag Milanovic) + +* doc: fix typo in README (Angel Leon) + +* darwin: abort() if (un)locking fs mutex fails (Ben Noordhuis) + +* pipe: enable inprocess uv_write2 on Windows (Louis DeJardin) + +* win: properly return UV_EBADF when _close() fails (Nicholas Vavilov) + +* test: skip process_title for AIX (Imran Iqbal) + +* misc: expose handle print APIs (Petka Antonov) + +* include: add stdio.h to uv.h (Saúl Ibarra Corretgé) + +* misc: remove unnecessary null pointer checks (Ian Kronquist) + +* test,freebsd: skip udp_dual_stack if not supported (Santiago Gimeno) + +* linux: don't retry dup2/dup3 on EINTR (Ben Noordhuis) + +* unix: don't retry dup2/dup3 on EINTR (Ben Noordhuis) + +* test: fix -Wtautological-pointer-compare warnings (Saúl Ibarra Corretgé) + +* win: map ERROR_BAD_PATHNAME to UV_ENOENT (Tony Kelman) + +* test: fix test/test-tty.c for AIX (Imran Iqbal) + +* android: support api level less than 21 (kkdaemon) + +* fsevents: fix race on simultaneous init+close (Fedor Indutny) + +* linux,fs: fix p{read,write}v with a 64bit offset (Saúl Ibarra Corretgé) + +* fs: add uv_fs_realpath() (Yuval Brik) + +* win: fix path for removed and renamed fs events (Joran Dirk Greef) + +* win: do not read more from stream than available (Jeremy Whitlock) + +* test: test that uv_close() doesn't corrupt QUEUE (Andrey Mazo) + +* unix: fix uv_fs_event_stop() from fs_event_cb (Andrey Mazo) + +* test: fix self-deadlocks in thread_rwlock_trylock (Ben Noordhuis) + +* src: remove non ascii character (sztomi) + +* test: fix test udp_multicast_join6 for AIX (Imran Iqbal) + + 2015.09.23, Version 1.7.5 (Stable), a8c1136de2cabf25b143021488cbaab05834daa8 Changes since version 1.7.4: diff --git a/deps/uv/Makefile.am b/deps/uv/Makefile.am index fbf9527ae93a70..0ef781ff198804 100644 --- a/deps/uv/Makefile.am +++ b/deps/uv/Makefile.am @@ -200,6 +200,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \ test/test-poll-closesocket.c \ test/test-poll.c \ test/test-process-title.c \ + test/test-queue-foreach-delete.c \ test/test-ref.c \ test/test-run-nowait.c \ test/test-run-once.c \ diff --git a/deps/uv/README.md b/deps/uv/README.md index 0ce26699716a1a..dfd24ba79d1850 100644 --- a/deps/uv/README.md +++ b/deps/uv/README.md @@ -119,7 +119,7 @@ Git tags are signed with the developer's key, they can be verified as follows: $ git verify-tag v1.6.1 Starting with libuv 1.7.0, the tarballs stored in the -[downloads site](http://dist.libuv.org/dist/) are signed and an accomanying +[downloads site](http://dist.libuv.org/dist/) are signed and an accompanying signature file sit alongside each. Once both the release tarball and the signature file are downloaded, the file can be verified as follows: diff --git a/deps/uv/appveyor.yml b/deps/uv/appveyor.yml index c9f55134e583dd..9aa63c5a5d2e73 100644 --- a/deps/uv/appveyor.yml +++ b/deps/uv/appveyor.yml @@ -1,4 +1,4 @@ -version: v1.7.5.build{build} +version: v1.8.0.build{build} install: - cinst -y nsis diff --git a/deps/uv/common.gypi b/deps/uv/common.gypi index 392c85951e1ebd..7cebcde5f89137 100644 --- a/deps/uv/common.gypi +++ b/deps/uv/common.gypi @@ -4,7 +4,6 @@ 'target_arch%': 'ia32', # set v8's target architecture 'host_arch%': 'ia32', # set v8's host architecture 'uv_library%': 'static_library', # allow override to 'shared_library' for DLL/.so builds - 'component%': 'static_library', # NB. these names match with what V8 expects 'msvs_multi_core_compile': '0', # we do enable multicore compiles, but not using the V8 way }, diff --git a/deps/uv/configure.ac b/deps/uv/configure.ac index c55a11847e255e..011bee2a891e73 100644 --- a/deps/uv/configure.ac +++ b/deps/uv/configure.ac @@ -13,7 +13,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_PREREQ(2.57) -AC_INIT([libuv], [1.7.5], [https://github.com/libuv/libuv/issues]) +AC_INIT([libuv], [1.8.0], [https://github.com/libuv/libuv/issues]) AC_CONFIG_MACRO_DIR([m4]) m4_include([m4/libuv-extra-automake-flags.m4]) m4_include([m4/as_case.m4]) diff --git a/deps/uv/docs/src/fs.rst b/deps/uv/docs/src/fs.rst index 33c04406f14d9e..69e283f4c67fc6 100644 --- a/deps/uv/docs/src/fs.rst +++ b/deps/uv/docs/src/fs.rst @@ -279,6 +279,16 @@ API Equivalent to :man:`readlink(2)`. +.. c:function:: int uv_fs_realpath(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) + + Equivalent to :man:`realpath(3)` on Unix. Windows uses ``GetFinalPathNameByHandle()``. + + .. note:: + This function is not implemented on Windows XP and Windows Server 2003. + On these systems, UV_ENOSYS is returned. + + .. versionadded:: 1.8.0 + .. c:function:: int uv_fs_chown(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_uid_t uid, uv_gid_t gid, uv_fs_cb cb) .. c:function:: int uv_fs_fchown(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_uid_t uid, uv_gid_t gid, uv_fs_cb cb) diff --git a/deps/uv/docs/src/misc.rst b/deps/uv/docs/src/misc.rst index e9ddba3db6a953..2ce0887db0c278 100644 --- a/deps/uv/docs/src/misc.rst +++ b/deps/uv/docs/src/misc.rst @@ -288,3 +288,41 @@ API .. note:: Not every platform can support nanosecond resolution; however, this value will always be in nanoseconds. + +.. c:function:: void uv_print_all_handles(uv_loop_t* loop, FILE* stream) + + Prints all handles associated with the given `loop` to the given `stream`. + + Example: + + :: + + uv_print_all_handles(uv_default_loop(), stderr); + /* + [--I] signal 0x1a25ea8 + [-AI] async 0x1a25cf0 + [R--] idle 0x1a7a8c8 + */ + + The format is `[flags] handle-type handle-address`. For `flags`: + + - `R` is printed for a handle that is referenced + - `A` is printed for a handle that is active + - `I` is printed for a handle that is internal + + .. warning:: + This function is meant for ad hoc debugging, there is no API/ABI + stability guarantees. + + .. versionadded:: 1.8.0 + +.. c:function:: void uv_print_active_handles(uv_loop_t* loop, FILE* stream) + + This is the same as :c:func:`uv_print_all_handles` except only active handles + are printed. + + .. warning:: + This function is meant for ad hoc debugging, there is no API/ABI + stability guarantees. + + .. versionadded:: 1.8.0 diff --git a/deps/uv/docs/src/tcp.rst b/deps/uv/docs/src/tcp.rst index dd18522d91d4eb..ca0c9b4ac5af4c 100644 --- a/deps/uv/docs/src/tcp.rst +++ b/deps/uv/docs/src/tcp.rst @@ -34,7 +34,7 @@ API .. c:function:: int uv_tcp_init_ex(uv_loop_t* loop, uv_tcp_t* handle, unsigned int flags) - Initialize the handle with the specified flags. At the moment the lower 8 bits + Initialize the handle with the specified flags. At the moment only the lower 8 bits of the `flags` parameter are used as the socket domain. A socket will be created for the given domain. If the specified domain is ``AF_UNSPEC`` no socket is created, just like :c:func:`uv_tcp_init`. diff --git a/deps/uv/gyp_uv.py b/deps/uv/gyp_uv.py index 0491ff873f1af1..39933f624d5c40 100755 --- a/deps/uv/gyp_uv.py +++ b/deps/uv/gyp_uv.py @@ -83,9 +83,6 @@ def run_gyp(args): if not any(a.startswith('-Duv_library=') for a in args): args.append('-Duv_library=static_library') - if not any(a.startswith('-Dcomponent=') for a in args): - args.append('-Dcomponent=static_library') - # Some platforms (OpenBSD for example) don't have multiprocessing.synchronize # so gyp must be run with --no-parallel if not gyp_parallel_support: diff --git a/deps/uv/include/uv-version.h b/deps/uv/include/uv-version.h index e1f26601a156c2..6e61f55ed20d85 100644 --- a/deps/uv/include/uv-version.h +++ b/deps/uv/include/uv-version.h @@ -31,8 +31,8 @@ */ #define UV_VERSION_MAJOR 1 -#define UV_VERSION_MINOR 7 -#define UV_VERSION_PATCH 5 +#define UV_VERSION_MINOR 8 +#define UV_VERSION_PATCH 0 #define UV_VERSION_IS_RELEASE 1 #define UV_VERSION_SUFFIX "" diff --git a/deps/uv/include/uv.h b/deps/uv/include/uv.h index f96026b603d34e..dd3111a960e69b 100644 --- a/deps/uv/include/uv.h +++ b/deps/uv/include/uv.h @@ -48,6 +48,7 @@ extern "C" { #include "uv-errno.h" #include "uv-version.h" #include +#include #if defined(_MSC_VER) && _MSC_VER < 1600 # include "stdint-msvc2008.h" @@ -424,6 +425,10 @@ UV_EXTERN int uv_is_active(const uv_handle_t* handle); UV_EXTERN void uv_walk(uv_loop_t* loop, uv_walk_cb walk_cb, void* arg); +/* Helpers for ad hoc debugging, no API/ABI stability guaranteed. */ +UV_EXTERN void uv_print_all_handles(uv_loop_t* loop, FILE* stream); +UV_EXTERN void uv_print_active_handles(uv_loop_t* loop, FILE* stream); + UV_EXTERN void uv_close(uv_handle_t* handle, uv_close_cb close_cb); UV_EXTERN int uv_send_buffer_size(uv_handle_t* handle, int* value); @@ -1083,7 +1088,8 @@ typedef enum { UV_FS_SYMLINK, UV_FS_READLINK, UV_FS_CHOWN, - UV_FS_FCHOWN + UV_FS_FCHOWN, + UV_FS_REALPATH } uv_fs_type; /* uv_fs_t is a subclass of uv_req_t. */ @@ -1235,6 +1241,10 @@ UV_EXTERN int uv_fs_readlink(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb); +UV_EXTERN int uv_fs_realpath(uv_loop_t* loop, + uv_fs_t* req, + const char* path, + uv_fs_cb cb); UV_EXTERN int uv_fs_fchmod(uv_loop_t* loop, uv_fs_t* req, uv_file file, @@ -1363,7 +1373,7 @@ UV_EXTERN int uv_chdir(const char* dir); UV_EXTERN uint64_t uv_get_free_memory(void); UV_EXTERN uint64_t uv_get_total_memory(void); -UV_EXTERN extern uint64_t uv_hrtime(void); +UV_EXTERN uint64_t uv_hrtime(void); UV_EXTERN void uv_disable_stdio_inheritance(void); diff --git a/deps/uv/src/inet.c b/deps/uv/src/inet.c index c948b2e7cfaf01..da63a688c4e424 100644 --- a/deps/uv/src/inet.c +++ b/deps/uv/src/inet.c @@ -55,11 +55,7 @@ static int inet_ntop4(const unsigned char *src, char *dst, size_t size) { char tmp[UV__INET_ADDRSTRLEN]; int l; -#ifndef _WIN32 l = snprintf(tmp, sizeof(tmp), fmt, src[0], src[1], src[2], src[3]); -#else - l = _snprintf(tmp, sizeof(tmp), fmt, src[0], src[1], src[2], src[3]); -#endif if (l <= 0 || (size_t) l >= size) { return UV_ENOSPC; } diff --git a/deps/uv/src/queue.h b/deps/uv/src/queue.h index 60c80000385be5..ff3540a0a51c84 100644 --- a/deps/uv/src/queue.h +++ b/deps/uv/src/queue.h @@ -30,6 +30,9 @@ typedef void *QUEUE[2]; #define QUEUE_DATA(ptr, type, field) \ ((type *) ((char *) (ptr) - offsetof(type, field))) +/* Important note: mutating the list while QUEUE_FOREACH is + * iterating over its elements results in undefined behavior. + */ #define QUEUE_FOREACH(q, h) \ for ((q) = QUEUE_NEXT(h); (q) != (h); (q) = QUEUE_NEXT(q)) @@ -66,6 +69,17 @@ typedef void *QUEUE[2]; } \ while (0) +#define QUEUE_MOVE(h, n) \ + do { \ + if (QUEUE_EMPTY(h)) \ + QUEUE_INIT(n); \ + else { \ + QUEUE* q = QUEUE_HEAD(h); \ + QUEUE_SPLIT(h, q, n); \ + } \ + } \ + while (0) + #define QUEUE_INSERT_HEAD(h, q) \ do { \ QUEUE_NEXT(q) = QUEUE_NEXT(h); \ diff --git a/deps/uv/src/threadpool.c b/deps/uv/src/threadpool.c index 15d719944f1d0c..2c5152b4200875 100644 --- a/deps/uv/src/threadpool.c +++ b/deps/uv/src/threadpool.c @@ -223,13 +223,8 @@ void uv__work_done(uv_async_t* handle) { int err; loop = container_of(handle, uv_loop_t, wq_async); - QUEUE_INIT(&wq); - uv_mutex_lock(&loop->wq_mutex); - if (!QUEUE_EMPTY(&loop->wq)) { - q = QUEUE_HEAD(&loop->wq); - QUEUE_SPLIT(&loop->wq, q, &wq); - } + QUEUE_MOVE(&loop->wq, &wq); uv_mutex_unlock(&loop->wq_mutex); while (!QUEUE_EMPTY(&wq)) { diff --git a/deps/uv/src/unix/android-ifaddrs.c b/deps/uv/src/unix/android-ifaddrs.c index 71f7290b3263e0..30f681b7d04a41 100644 --- a/deps/uv/src/unix/android-ifaddrs.c +++ b/deps/uv/src/unix/android-ifaddrs.c @@ -1,6 +1,6 @@ /* Copyright (c) 2013, Kenneth MacKay -Copyright (c) 2014, Emergya (Cloud4all, FP7/2007-2013 grant agreement n° 289016) +Copyright (c) 2014, Emergya (Cloud4all, FP7/2007-2013 grant agreement #289016) All rights reserved. Redistribution and use in source and binary forms, with or without modification, diff --git a/deps/uv/src/unix/async.c b/deps/uv/src/unix/async.c index 9ff24aeb3d7d87..184b598126eb2c 100644 --- a/deps/uv/src/unix/async.c +++ b/deps/uv/src/unix/async.c @@ -78,12 +78,18 @@ void uv__async_close(uv_async_t* handle) { static void uv__async_event(uv_loop_t* loop, struct uv__async* w, unsigned int nevents) { + QUEUE queue; QUEUE* q; uv_async_t* h; - QUEUE_FOREACH(q, &loop->async_handles) { + QUEUE_MOVE(&loop->async_handles, &queue); + while (!QUEUE_EMPTY(&queue)) { + q = QUEUE_HEAD(&queue); h = QUEUE_DATA(q, uv_async_t, queue); + QUEUE_REMOVE(q); + QUEUE_INSERT_TAIL(&loop->async_handles, q); + if (cmpxchgi(&h->pending, 1, 0) == 0) continue; diff --git a/deps/uv/src/unix/atomic-ops.h b/deps/uv/src/unix/atomic-ops.h index 8fb157dcc61eb4..84e471838bede7 100644 --- a/deps/uv/src/unix/atomic-ops.h +++ b/deps/uv/src/unix/atomic-ops.h @@ -18,6 +18,11 @@ #include "internal.h" /* UV_UNUSED */ +#if defined(__SUNPRO_C) || defined(__SUNPRO_CC) +#include +#define __sync_val_compare_and_swap(p, o, n) atomic_cas_ptr(p, o, n) +#endif + UV_UNUSED(static int cmpxchgi(int* ptr, int oldval, int newval)); UV_UNUSED(static long cmpxchgl(long* ptr, long oldval, long newval)); UV_UNUSED(static void cpu_relax(void)); diff --git a/deps/uv/src/unix/core.c b/deps/uv/src/unix/core.c index e149357e076eb2..cedd86ed34a128 100644 --- a/deps/uv/src/unix/core.c +++ b/deps/uv/src/unix/core.c @@ -75,6 +75,10 @@ #include #endif +#if defined(__ANDROID_API__) && __ANDROID_API__ < 21 +# include /* for dlsym */ +#endif + static int uv__run_pending(uv_loop_t* loop); /* Verify that uv_buf_t is ABI-compatible with struct iovec. */ @@ -204,8 +208,14 @@ int uv__getiovmax(void) { return IOV_MAX; #elif defined(_SC_IOV_MAX) static int iovmax = -1; - if (iovmax == -1) + if (iovmax == -1) { iovmax = sysconf(_SC_IOV_MAX); + /* On some embedded devices (arm-linux-uclibc based ip camera), + * sysconf(_SC_IOV_MAX) can not get the correct value. The return + * value is -1 and the errno is EINPROGRESS. Degrade the value to 1. + */ + if (iovmax == -1) iovmax = 1; + } return iovmax; #else return 1024; @@ -721,9 +731,7 @@ static int uv__run_pending(uv_loop_t* loop) { if (QUEUE_EMPTY(&loop->pending_queue)) return 0; - QUEUE_INIT(&pq); - q = QUEUE_HEAD(&loop->pending_queue); - QUEUE_SPLIT(&loop->pending_queue, q, &pq); + QUEUE_MOVE(&loop->pending_queue, &pq); while (!QUEUE_EMPTY(&pq)) { q = QUEUE_HEAD(&pq); @@ -956,16 +964,12 @@ int uv__open_cloexec(const char* path, int flags) { int uv__dup2_cloexec(int oldfd, int newfd) { int r; #if defined(__FreeBSD__) && __FreeBSD__ >= 10 - do - r = dup3(oldfd, newfd, O_CLOEXEC); - while (r == -1 && errno == EINTR); + r = dup3(oldfd, newfd, O_CLOEXEC); if (r == -1) return -errno; return r; #elif defined(__FreeBSD__) && defined(F_DUP2FD_CLOEXEC) - do - r = fcntl(oldfd, F_DUP2FD_CLOEXEC, newfd); - while (r == -1 && errno == EINTR); + r = fcntl(oldfd, F_DUP2FD_CLOEXEC, newfd); if (r != -1) return r; if (errno != EINVAL) @@ -976,7 +980,7 @@ int uv__dup2_cloexec(int oldfd, int newfd) { if (!no_dup3) { do r = uv__dup3(oldfd, newfd, UV__O_CLOEXEC); - while (r == -1 && (errno == EINTR || errno == EBUSY)); + while (r == -1 && errno == EBUSY); if (r != -1) return r; if (errno != ENOSYS) @@ -990,9 +994,9 @@ int uv__dup2_cloexec(int oldfd, int newfd) { do r = dup2(oldfd, newfd); #if defined(__linux__) - while (r == -1 && (errno == EINTR || errno == EBUSY)); + while (r == -1 && errno == EBUSY); #else - while (r == -1 && errno == EINTR); + while (0); /* Never retry. */ #endif if (r == -1) @@ -1018,6 +1022,9 @@ int uv_os_homedir(char* buffer, size_t* size) { size_t len; long initsize; int r; +#if defined(__ANDROID_API__) && __ANDROID_API__ < 21 + int (*getpwuid_r)(uid_t, struct passwd*, char*, size_t, struct passwd**); +#endif if (buffer == NULL || size == NULL || *size == 0) return -EINVAL; @@ -1039,6 +1046,12 @@ int uv_os_homedir(char* buffer, size_t* size) { return 0; } +#if defined(__ANDROID_API__) && __ANDROID_API__ < 21 + getpwuid_r = dlsym(RTLD_DEFAULT, "getpwuid_r"); + if (getpwuid_r == NULL) + return -ENOSYS; +#endif + /* HOME is not set, so call getpwuid() */ initsize = sysconf(_SC_GETPW_R_SIZE_MAX); diff --git a/deps/uv/src/unix/darwin.c b/deps/uv/src/unix/darwin.c index dab6ca999d05f6..cf95da21693b9a 100644 --- a/deps/uv/src/unix/darwin.c +++ b/deps/uv/src/unix/darwin.c @@ -258,8 +258,10 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) { } *addresses = uv__malloc(*count * sizeof(**addresses)); - if (!(*addresses)) + if (!(*addresses)) { + freeifaddrs(addrs); return -ENOMEM; + } address = *addresses; diff --git a/deps/uv/src/unix/dl.c b/deps/uv/src/unix/dl.c index 7c6d41c969b25f..fc1c052bb8122e 100644 --- a/deps/uv/src/unix/dl.c +++ b/deps/uv/src/unix/dl.c @@ -39,10 +39,8 @@ int uv_dlopen(const char* filename, uv_lib_t* lib) { void uv_dlclose(uv_lib_t* lib) { - if (lib->errmsg) { - uv__free(lib->errmsg); - lib->errmsg = NULL; - } + uv__free(lib->errmsg); + lib->errmsg = NULL; if (lib->handle) { /* Ignore errors. No good way to signal them without leaking memory. */ @@ -67,8 +65,7 @@ const char* uv_dlerror(const uv_lib_t* lib) { static int uv__dlerror(uv_lib_t* lib) { const char* errmsg; - if (lib->errmsg) - uv__free(lib->errmsg); + uv__free(lib->errmsg); errmsg = dlerror(); diff --git a/deps/uv/src/unix/freebsd.c b/deps/uv/src/unix/freebsd.c index c69608b139973b..b747abdf5bc46e 100644 --- a/deps/uv/src/unix/freebsd.c +++ b/deps/uv/src/unix/freebsd.c @@ -176,7 +176,7 @@ char** uv_setup_args(int argc, char** argv) { int uv_set_process_title(const char* title) { int oid[4]; - if (process_title) uv__free(process_title); + uv__free(process_title); process_title = uv__strdup(title); oid[0] = CTL_KERN; @@ -373,8 +373,10 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) { } *addresses = uv__malloc(*count * sizeof(**addresses)); - if (!(*addresses)) + if (!(*addresses)) { + freeifaddrs(addrs); return -ENOMEM; + } address = *addresses; diff --git a/deps/uv/src/unix/fs.c b/deps/uv/src/unix/fs.c index d739c282585f71..57b65be25a85ea 100644 --- a/deps/uv/src/unix/fs.c +++ b/deps/uv/src/unix/fs.c @@ -80,8 +80,10 @@ req->path = path; \ } else { \ req->path = uv__strdup(path); \ - if (req->path == NULL) \ + if (req->path == NULL) { \ + uv__req_unregister(loop, req); \ return -ENOMEM; \ + } \ } \ } \ while (0) @@ -97,8 +99,10 @@ path_len = strlen(path) + 1; \ new_path_len = strlen(new_path) + 1; \ req->path = uv__malloc(path_len + new_path_len); \ - if (req->path == NULL) \ + if (req->path == NULL) { \ + uv__req_unregister(loop, req); \ return -ENOMEM; \ + } \ req->new_path = req->path + path_len; \ memcpy((void*) req->path, path, path_len); \ memcpy((void*) req->new_path, new_path, new_path_len); \ @@ -370,20 +374,27 @@ static ssize_t uv__fs_scandir(uv_fs_t* req) { } -static ssize_t uv__fs_readlink(uv_fs_t* req) { - ssize_t len; - char* buf; +static ssize_t uv__fs_pathmax_size(const char* path) { + ssize_t pathmax; - len = pathconf(req->path, _PC_PATH_MAX); + pathmax = pathconf(path, _PC_PATH_MAX); - if (len == -1) { + if (pathmax == -1) { #if defined(PATH_MAX) - len = PATH_MAX; + return PATH_MAX; #else - len = 4096; + return 4096; #endif } + return pathmax; +} + +static ssize_t uv__fs_readlink(uv_fs_t* req) { + ssize_t len; + char* buf; + + len = uv__fs_pathmax_size(req->path); buf = uv__malloc(len + 1); if (buf == NULL) { @@ -404,6 +415,27 @@ static ssize_t uv__fs_readlink(uv_fs_t* req) { return 0; } +static ssize_t uv__fs_realpath(uv_fs_t* req) { + ssize_t len; + char* buf; + + len = uv__fs_pathmax_size(req->path); + buf = uv__malloc(len + 1); + + if (buf == NULL) { + errno = ENOMEM; + return -1; + } + + if (realpath(req->path, buf) == NULL) { + uv__free(buf); + return -1; + } + + req->ptr = buf; + + return 0; +} static ssize_t uv__fs_sendfile_emul(uv_fs_t* req) { struct pollfd pfd; @@ -626,7 +658,9 @@ static ssize_t uv__fs_write(uv_fs_t* req) { */ #if defined(__APPLE__) static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; - pthread_mutex_lock(&lock); + + if (pthread_mutex_lock(&lock)) + abort(); #endif if (req->off < 0) { @@ -683,7 +717,8 @@ static ssize_t uv__fs_write(uv_fs_t* req) { done: #if defined(__APPLE__) - pthread_mutex_unlock(&lock); + if (pthread_mutex_unlock(&lock)) + abort(); #endif return r; @@ -867,6 +902,7 @@ static void uv__fs_work(struct uv__work* w) { X(READ, uv__fs_buf_iter(req, uv__fs_read)); X(SCANDIR, uv__fs_scandir(req)); X(READLINK, uv__fs_readlink(req)); + X(REALPATH, uv__fs_realpath(req)); X(RENAME, rename(req->path, req->new_path)); X(RMDIR, rmdir(req->path)); X(SENDFILE, uv__fs_sendfile(req)); @@ -1062,8 +1098,11 @@ int uv_fs_mkdtemp(uv_loop_t* loop, uv_fs_cb cb) { INIT(MKDTEMP); req->path = uv__strdup(tpl); - if (req->path == NULL) + if (req->path == NULL) { + if (cb != NULL) + uv__req_unregister(loop, req); return -ENOMEM; + } POST; } @@ -1099,8 +1138,11 @@ int uv_fs_read(uv_loop_t* loop, uv_fs_t* req, if (nbufs > ARRAY_SIZE(req->bufsml)) req->bufs = uv__malloc(nbufs * sizeof(*bufs)); - if (req->bufs == NULL) + if (req->bufs == NULL) { + if (cb != NULL) + uv__req_unregister(loop, req); return -ENOMEM; + } memcpy(req->bufs, bufs, nbufs * sizeof(*bufs)); @@ -1131,6 +1173,16 @@ int uv_fs_readlink(uv_loop_t* loop, } +int uv_fs_realpath(uv_loop_t* loop, + uv_fs_t* req, + const char * path, + uv_fs_cb cb) { + INIT(REALPATH); + PATH; + POST; +} + + int uv_fs_rename(uv_loop_t* loop, uv_fs_t* req, const char* path, @@ -1224,8 +1276,11 @@ int uv_fs_write(uv_loop_t* loop, if (nbufs > ARRAY_SIZE(req->bufsml)) req->bufs = uv__malloc(nbufs * sizeof(*bufs)); - if (req->bufs == NULL) + if (req->bufs == NULL) { + if (cb != NULL) + uv__req_unregister(loop, req); return -ENOMEM; + } memcpy(req->bufs, bufs, nbufs * sizeof(*bufs)); diff --git a/deps/uv/src/unix/fsevents.c b/deps/uv/src/unix/fsevents.c index 8143f7c1f018db..d331a13172675e 100644 --- a/deps/uv/src/unix/fsevents.c +++ b/deps/uv/src/unix/fsevents.c @@ -73,9 +73,16 @@ typedef struct uv__fsevents_event_s uv__fsevents_event_t; typedef struct uv__cf_loop_signal_s uv__cf_loop_signal_t; typedef struct uv__cf_loop_state_s uv__cf_loop_state_t; +enum uv__cf_loop_signal_type_e { + kUVCFLoopSignalRegular, + kUVCFLoopSignalClosing +}; +typedef enum uv__cf_loop_signal_type_e uv__cf_loop_signal_type_t; + struct uv__cf_loop_signal_s { QUEUE member; uv_fs_event_t* handle; + uv__cf_loop_signal_type_t type; }; struct uv__fsevents_event_s { @@ -98,7 +105,9 @@ struct uv__cf_loop_state_s { /* Forward declarations */ static void uv__cf_loop_cb(void* arg); static void* uv__cf_loop_runner(void* arg); -static int uv__cf_loop_signal(uv_loop_t* loop, uv_fs_event_t* handle); +static int uv__cf_loop_signal(uv_loop_t* loop, + uv_fs_event_t* handle, + uv__cf_loop_signal_type_t type); /* Lazy-loaded by uv__fsevents_global_init(). */ static CFArrayRef (*pCFArrayCreate)(CFAllocatorRef, @@ -149,11 +158,7 @@ static void (*pFSEventStreamStop)(FSEventStreamRef); int err; \ uv_mutex_lock(&(handle)->cf_mutex); \ /* Split-off all events and empty original queue */ \ - QUEUE_INIT(&events); \ - if (!QUEUE_EMPTY(&(handle)->cf_events)) { \ - q = QUEUE_HEAD(&(handle)->cf_events); \ - QUEUE_SPLIT(&(handle)->cf_events, q, &events); \ - } \ + QUEUE_MOVE(&(handle)->cf_events, &events); \ /* Get error (if any) and zero original one */ \ err = (handle)->cf_error; \ (handle)->cf_error = 0; \ @@ -387,7 +392,8 @@ static void uv__fsevents_destroy_stream(uv_loop_t* loop) { /* Runs in CF thread, when there're new fsevent handles to add to stream */ -static void uv__fsevents_reschedule(uv_fs_event_t* handle) { +static void uv__fsevents_reschedule(uv_fs_event_t* handle, + uv__cf_loop_signal_type_t type) { uv__cf_loop_state_t* state; QUEUE* q; uv_fs_event_t* curr; @@ -486,7 +492,7 @@ static void uv__fsevents_reschedule(uv_fs_event_t* handle) { * * NOTE: This is coupled with `uv_sem_wait()` in `uv__fsevents_close` */ - if (!uv__is_active(handle)) + if (type == kUVCFLoopSignalClosing) uv_sem_post(&state->fsevent_sem); } @@ -676,7 +682,7 @@ void uv__fsevents_loop_delete(uv_loop_t* loop) { if (loop->cf_state == NULL) return; - if (uv__cf_loop_signal(loop, NULL) != 0) + if (uv__cf_loop_signal(loop, NULL, kUVCFLoopSignalRegular) != 0) abort(); uv_thread_join(&loop->cf_thread); @@ -735,17 +741,14 @@ static void uv__cf_loop_cb(void* arg) { loop = arg; state = loop->cf_state; - QUEUE_INIT(&split_head); uv_mutex_lock(&loop->cf_mutex); - if (!QUEUE_EMPTY(&loop->cf_signals)) { - QUEUE* split_pos = QUEUE_HEAD(&loop->cf_signals); - QUEUE_SPLIT(&loop->cf_signals, split_pos, &split_head); - } + QUEUE_MOVE(&loop->cf_signals, &split_head); uv_mutex_unlock(&loop->cf_mutex); while (!QUEUE_EMPTY(&split_head)) { item = QUEUE_HEAD(&split_head); + QUEUE_REMOVE(item); s = QUEUE_DATA(item, uv__cf_loop_signal_t, member); @@ -753,16 +756,17 @@ static void uv__cf_loop_cb(void* arg) { if (s->handle == NULL) pCFRunLoopStop(state->loop); else - uv__fsevents_reschedule(s->handle); + uv__fsevents_reschedule(s->handle, s->type); - QUEUE_REMOVE(item); uv__free(s); } } /* Runs in UV loop to notify CF thread */ -int uv__cf_loop_signal(uv_loop_t* loop, uv_fs_event_t* handle) { +int uv__cf_loop_signal(uv_loop_t* loop, + uv_fs_event_t* handle, + uv__cf_loop_signal_type_t type) { uv__cf_loop_signal_t* item; uv__cf_loop_state_t* state; @@ -771,6 +775,7 @@ int uv__cf_loop_signal(uv_loop_t* loop, uv_fs_event_t* handle) { return -ENOMEM; item->handle = handle; + item->type = type; uv_mutex_lock(&loop->cf_mutex); QUEUE_INSERT_TAIL(&loop->cf_signals, &item->member); @@ -833,7 +838,7 @@ int uv__fsevents_init(uv_fs_event_t* handle) { /* Reschedule FSEventStream */ assert(handle != NULL); - err = uv__cf_loop_signal(handle->loop, handle); + err = uv__cf_loop_signal(handle->loop, handle, kUVCFLoopSignalRegular); if (err) goto fail_loop_signal; @@ -873,7 +878,7 @@ int uv__fsevents_close(uv_fs_event_t* handle) { /* Reschedule FSEventStream */ assert(handle != NULL); - err = uv__cf_loop_signal(handle->loop, handle); + err = uv__cf_loop_signal(handle->loop, handle, kUVCFLoopSignalClosing); if (err) return -err; diff --git a/deps/uv/src/unix/linux-core.c b/deps/uv/src/unix/linux-core.c index e6e68283d58d07..3ff6fb15e93557 100644 --- a/deps/uv/src/unix/linux-core.c +++ b/deps/uv/src/unix/linux-core.c @@ -814,8 +814,10 @@ int uv_interface_addresses(uv_interface_address_t** addresses, return 0; *addresses = uv__malloc(*count * sizeof(**addresses)); - if (!(*addresses)) + if (!(*addresses)) { + freeifaddrs(addrs); return -ENOMEM; + } address = *addresses; diff --git a/deps/uv/src/unix/linux-inotify.c b/deps/uv/src/unix/linux-inotify.c index d9ed9f4b24512b..282912115d8120 100644 --- a/deps/uv/src/unix/linux-inotify.c +++ b/deps/uv/src/unix/linux-inotify.c @@ -35,6 +35,7 @@ struct watcher_list { RB_ENTRY(watcher_list) entry; QUEUE watchers; + int iterating; char* path; int wd; }; @@ -113,6 +114,15 @@ static struct watcher_list* find_watcher(uv_loop_t* loop, int wd) { return RB_FIND(watcher_root, CAST(&loop->inotify_watchers), &w); } +static void maybe_free_watcher_list(struct watcher_list* w, uv_loop_t* loop) { + /* if the watcher_list->watchers is being iterated over, we can't free it. */ + if ((!w->iterating) && QUEUE_EMPTY(&w->watchers)) { + /* No watchers left for this path. Clean up. */ + RB_REMOVE(watcher_root, CAST(&loop->inotify_watchers), w); + uv__inotify_rm_watch(loop->inotify_fd, w->wd); + uv__free(w); + } +} static void uv__inotify_read(uv_loop_t* loop, uv__io_t* dummy, @@ -120,6 +130,7 @@ static void uv__inotify_read(uv_loop_t* loop, const struct uv__inotify_event* e; struct watcher_list* w; uv_fs_event_t* h; + QUEUE queue; QUEUE* q; const char* path; ssize_t size; @@ -159,10 +170,31 @@ static void uv__inotify_read(uv_loop_t* loop, */ path = e->len ? (const char*) (e + 1) : uv__basename_r(w->path); - QUEUE_FOREACH(q, &w->watchers) { + /* We're about to iterate over the queue and call user's callbacks. + * What can go wrong? + * A callback could call uv_fs_event_stop() + * and the queue can change under our feet. + * So, we use QUEUE_MOVE() trick to safely iterate over the queue. + * And we don't free the watcher_list until we're done iterating. + * + * First, + * tell uv_fs_event_stop() (that could be called from a user's callback) + * not to free watcher_list. + */ + w->iterating = 1; + QUEUE_MOVE(&w->watchers, &queue); + while (!QUEUE_EMPTY(&queue)) { + q = QUEUE_HEAD(&queue); h = QUEUE_DATA(q, uv_fs_event_t, watchers); + + QUEUE_REMOVE(q); + QUEUE_INSERT_TAIL(&w->watchers, q); + h->cb(h, path, events, 0); } + /* done iterating, time to (maybe) free empty watcher_list */ + w->iterating = 0; + maybe_free_watcher_list(w, loop); } } } @@ -214,6 +246,7 @@ int uv_fs_event_start(uv_fs_event_t* handle, w->wd = wd; w->path = strcpy((char*)(w + 1), path); QUEUE_INIT(&w->watchers); + w->iterating = 0; RB_INSERT(watcher_root, CAST(&handle->loop->inotify_watchers), w); no_insert: @@ -241,12 +274,7 @@ int uv_fs_event_stop(uv_fs_event_t* handle) { uv__handle_stop(handle); QUEUE_REMOVE(&handle->watchers); - if (QUEUE_EMPTY(&w->watchers)) { - /* No watchers left for this path. Clean up. */ - RB_REMOVE(watcher_root, CAST(&handle->loop->inotify_watchers), w); - uv__inotify_rm_watch(handle->loop->inotify_fd, w->wd); - uv__free(w); - } + maybe_free_watcher_list(w, handle->loop); return 0; } diff --git a/deps/uv/src/unix/linux-syscalls.c b/deps/uv/src/unix/linux-syscalls.c index 566e1f37cfed12..89998ded26b17c 100644 --- a/deps/uv/src/unix/linux-syscalls.c +++ b/deps/uv/src/unix/linux-syscalls.c @@ -444,18 +444,18 @@ int uv__utimesat(int dirfd, } -ssize_t uv__preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset) { +ssize_t uv__preadv(int fd, const struct iovec *iov, int iovcnt, int64_t offset) { #if defined(__NR_preadv) - return syscall(__NR_preadv, fd, iov, iovcnt, offset); + return syscall(__NR_preadv, fd, iov, iovcnt, (long)offset, (long)(offset >> 32)); #else return errno = ENOSYS, -1; #endif } -ssize_t uv__pwritev(int fd, const struct iovec *iov, int iovcnt, off_t offset) { +ssize_t uv__pwritev(int fd, const struct iovec *iov, int iovcnt, int64_t offset) { #if defined(__NR_pwritev) - return syscall(__NR_pwritev, fd, iov, iovcnt, offset); + return syscall(__NR_pwritev, fd, iov, iovcnt, (long)offset, (long)(offset >> 32)); #else return errno = ENOSYS, -1; #endif diff --git a/deps/uv/src/unix/linux-syscalls.h b/deps/uv/src/unix/linux-syscalls.h index 6f249b72453675..96e79439cf07ab 100644 --- a/deps/uv/src/unix/linux-syscalls.h +++ b/deps/uv/src/unix/linux-syscalls.h @@ -151,8 +151,8 @@ int uv__utimesat(int dirfd, const char* path, const struct timespec times[2], int flags); -ssize_t uv__preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset); -ssize_t uv__pwritev(int fd, const struct iovec *iov, int iovcnt, off_t offset); +ssize_t uv__preadv(int fd, const struct iovec *iov, int iovcnt, int64_t offset); +ssize_t uv__pwritev(int fd, const struct iovec *iov, int iovcnt, int64_t offset); int uv__dup3(int oldfd, int newfd, int flags); #endif /* UV_LINUX_SYSCALL_H_ */ diff --git a/deps/uv/src/unix/loop-watcher.c b/deps/uv/src/unix/loop-watcher.c index dc25760bd5344c..340bb0dfa11350 100644 --- a/deps/uv/src/unix/loop-watcher.c +++ b/deps/uv/src/unix/loop-watcher.c @@ -47,9 +47,14 @@ \ void uv__run_##name(uv_loop_t* loop) { \ uv_##name##_t* h; \ + QUEUE queue; \ QUEUE* q; \ - QUEUE_FOREACH(q, &loop->name##_handles) { \ + QUEUE_MOVE(&loop->name##_handles, &queue); \ + while (!QUEUE_EMPTY(&queue)) { \ + q = QUEUE_HEAD(&queue); \ h = QUEUE_DATA(q, uv_##name##_t, queue); \ + QUEUE_REMOVE(q); \ + QUEUE_INSERT_TAIL(&loop->name##_handles, q); \ h->name##_cb(h); \ } \ } \ diff --git a/deps/uv/src/unix/netbsd.c b/deps/uv/src/unix/netbsd.c index 29f2a4dec63831..ca48550f9d99d4 100644 --- a/deps/uv/src/unix/netbsd.c +++ b/deps/uv/src/unix/netbsd.c @@ -298,8 +298,10 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) { *addresses = uv__malloc(*count * sizeof(**addresses)); - if (!(*addresses)) + if (!(*addresses)) { + freeifaddrs(addrs); return -ENOMEM; + } address = *addresses; diff --git a/deps/uv/src/unix/openbsd.c b/deps/uv/src/unix/openbsd.c index c8d54599386efe..6a3909a666c1d0 100644 --- a/deps/uv/src/unix/openbsd.c +++ b/deps/uv/src/unix/openbsd.c @@ -161,7 +161,7 @@ char** uv_setup_args(int argc, char** argv) { int uv_set_process_title(const char* title) { - if (process_title) uv__free(process_title); + uv__free(process_title); process_title = uv__strdup(title); setproctitle(title); return 0; @@ -313,8 +313,10 @@ int uv_interface_addresses(uv_interface_address_t** addresses, *addresses = uv__malloc(*count * sizeof(**addresses)); - if (!(*addresses)) + if (!(*addresses)) { + freeifaddrs(addrs); return -ENOMEM; + } address = *addresses; diff --git a/deps/uv/src/unix/process.c b/deps/uv/src/unix/process.c index 9fa061e6bc99b6..571f8cd778c74f 100644 --- a/deps/uv/src/unix/process.c +++ b/deps/uv/src/unix/process.c @@ -270,6 +270,11 @@ static void uv__write_int(int fd, int val) { } +#if !(defined(__APPLE__) && (TARGET_OS_TV || TARGET_OS_WATCH)) +/* execvp is marked __WATCHOS_PROHIBITED __TVOS_PROHIBITED, so must be + * avoided. Since this isn't called on those targets, the function + * doesn't even need to be defined for them. + */ static void uv__process_child_init(const uv_process_options_t* options, int stdio_count, int (*pipes)[2], @@ -375,11 +380,16 @@ static void uv__process_child_init(const uv_process_options_t* options, uv__write_int(error_fd, -errno); _exit(127); } +#endif int uv_spawn(uv_loop_t* loop, uv_process_t* process, const uv_process_options_t* options) { +#if defined(__APPLE__) && (TARGET_OS_TV || TARGET_OS_WATCH) + /* fork is marked __WATCHOS_PROHIBITED __TVOS_PROHIBITED. */ + return -ENOSYS; +#else int signal_pipe[2] = { -1, -1 }; int (*pipes)[2]; int stdio_count; @@ -528,6 +538,7 @@ int uv_spawn(uv_loop_t* loop, } return err; +#endif } diff --git a/deps/uv/src/unix/signal.c b/deps/uv/src/unix/signal.c index 0b7a405c15da65..edd9085d3f352f 100644 --- a/deps/uv/src/unix/signal.c +++ b/deps/uv/src/unix/signal.c @@ -234,6 +234,8 @@ void uv__signal_loop_cleanup(uv_loop_t* loop) { /* Stop all the signal watchers that are still attached to this loop. This * ensures that the (shared) signal tree doesn't contain any invalid entries * entries, and that signal handlers are removed when appropriate. + * It's safe to use QUEUE_FOREACH here because the handles and the handle + * queue are not modified by uv__signal_stop(). */ QUEUE_FOREACH(q, &loop->handle_queue) { uv_handle_t* handle = QUEUE_DATA(q, uv_handle_t, handle_queue); diff --git a/deps/uv/src/unix/stream.c b/deps/uv/src/unix/stream.c index 183b68cf7165b0..7d7ab2633b6f2d 100644 --- a/deps/uv/src/unix/stream.c +++ b/deps/uv/src/unix/stream.c @@ -779,9 +779,9 @@ static void uv__write(uv_stream_t* stream) { if (req->send_handle) { struct msghdr msg; - char scratch[64]; struct cmsghdr *cmsg; int fd_to_send = uv__handle_fd((uv_handle_t*) req->send_handle); + char scratch[64] = {0}; assert(fd_to_send >= 0); @@ -1471,7 +1471,7 @@ int uv_try_write(uv_stream_t* stream, uv__stream_osx_interrupt_select(stream); } - if (written == 0) + if (written == 0 && req_size != 0) return -EAGAIN; else return written; diff --git a/deps/uv/src/unix/sunos.c b/deps/uv/src/unix/sunos.c index 05b7a114031178..0c46817b446e61 100644 --- a/deps/uv/src/unix/sunos.c +++ b/deps/uv/src/unix/sunos.c @@ -693,8 +693,10 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) { } *addresses = uv__malloc(*count * sizeof(**addresses)); - if (!(*addresses)) + if (!(*addresses)) { + freeifaddrs(addrs); return -ENOMEM; + } address = *addresses; diff --git a/deps/uv/src/unix/tty.c b/deps/uv/src/unix/tty.c index 54c9055a08ae12..7cc5b714ed302c 100644 --- a/deps/uv/src/unix/tty.c +++ b/deps/uv/src/unix/tty.c @@ -236,6 +236,15 @@ uv_handle_type uv_guess_handle(uv_file file) { return UV_UDP; if (type == SOCK_STREAM) { +#if defined(_AIX) + /* on AIX the getsockname call returns an empty sa structure + * for sockets of type AF_UNIX. For all other types it will + * return a properly filled in structure. + */ + if (len == 0) + return UV_NAMED_PIPE; +#endif /* defined(_AIX) */ + if (sa.sa_family == AF_INET || sa.sa_family == AF_INET6) return UV_TCP; if (sa.sa_family == AF_UNIX) diff --git a/deps/uv/src/unix/udp.c b/deps/uv/src/unix/udp.c index 66ecc4e341b913..39ade8de338afc 100644 --- a/deps/uv/src/unix/udp.c +++ b/deps/uv/src/unix/udp.c @@ -410,8 +410,10 @@ int uv__udp_send(uv_udp_send_t* req, if (nbufs > ARRAY_SIZE(req->bufsml)) req->bufs = uv__malloc(nbufs * sizeof(bufs[0])); - if (req->bufs == NULL) + if (req->bufs == NULL) { + uv__req_unregister(handle->loop, req); return -ENOMEM; + } memcpy(req->bufs, bufs, nbufs * sizeof(bufs[0])); handle->send_queue_size += uv__count_bufs(req->bufs, req->nbufs); diff --git a/deps/uv/src/uv-common.c b/deps/uv/src/uv-common.c index 675a776bf4ae1e..40ed28fec5a662 100644 --- a/deps/uv/src/uv-common.c +++ b/deps/uv/src/uv-common.c @@ -141,11 +141,7 @@ static const char* uv__unknown_err_code(int err) { char buf[32]; char* copy; -#ifndef _WIN32 snprintf(buf, sizeof(buf), "Unknown system error %d", err); -#else - _snprintf(buf, sizeof(buf), "Unknown system error %d", err); -#endif copy = uv__strdup(buf); return copy != NULL ? copy : "Unknown system error"; @@ -341,19 +337,25 @@ int uv_udp_recv_stop(uv_udp_t* handle) { void uv_walk(uv_loop_t* loop, uv_walk_cb walk_cb, void* arg) { + QUEUE queue; QUEUE* q; uv_handle_t* h; - QUEUE_FOREACH(q, &loop->handle_queue) { + QUEUE_MOVE(&loop->handle_queue, &queue); + while (!QUEUE_EMPTY(&queue)) { + q = QUEUE_HEAD(&queue); h = QUEUE_DATA(q, uv_handle_t, handle_queue); + + QUEUE_REMOVE(q); + QUEUE_INSERT_TAIL(&loop->handle_queue, q); + if (h->flags & UV__HANDLE_INTERNAL) continue; walk_cb(h, arg); } } -#ifndef NDEBUG -static void uv__print_handles(uv_loop_t* loop, int only_active) { +static void uv__print_handles(uv_loop_t* loop, int only_active, FILE* stream) { const char* type; QUEUE* q; uv_handle_t* h; @@ -374,7 +376,7 @@ static void uv__print_handles(uv_loop_t* loop, int only_active) { default: type = ""; } - fprintf(stderr, + fprintf(stream, "[%c%c%c] %-8s %p\n", "R-"[!(h->flags & UV__HANDLE_REF)], "A-"[!(h->flags & UV__HANDLE_ACTIVE)], @@ -385,15 +387,14 @@ static void uv__print_handles(uv_loop_t* loop, int only_active) { } -void uv_print_all_handles(uv_loop_t* loop) { - uv__print_handles(loop, 0); +void uv_print_all_handles(uv_loop_t* loop, FILE* stream) { + uv__print_handles(loop, 0, stream); } -void uv_print_active_handles(uv_loop_t* loop) { - uv__print_handles(loop, 1); +void uv_print_active_handles(uv_loop_t* loop, FILE* stream) { + uv__print_handles(loop, 1, stream); } -#endif void uv_ref(uv_handle_t* handle) { diff --git a/deps/uv/src/uv-common.h b/deps/uv/src/uv-common.h index b348ec76bd50bd..27902fdf8645f7 100644 --- a/deps/uv/src/uv-common.h +++ b/deps/uv/src/uv-common.h @@ -41,6 +41,10 @@ #include "tree.h" #include "queue.h" +#if !defined(snprintf) && defined(_MSC_VER) && _MSC_VER < 1900 +extern int snprintf(char*, size_t, const char*, ...); +#endif + #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) #define container_of(ptr, type, member) \ diff --git a/deps/uv/src/win/error.c b/deps/uv/src/win/error.c index a265a272dced19..c512f35af979a3 100644 --- a/deps/uv/src/win/error.c +++ b/deps/uv/src/win/error.c @@ -129,6 +129,7 @@ int uv_translate_sys_error(int sys_errno) { case ERROR_NETWORK_UNREACHABLE: return UV_ENETUNREACH; case WSAENETUNREACH: return UV_ENETUNREACH; case WSAENOBUFS: return UV_ENOBUFS; + case ERROR_BAD_PATHNAME: return UV_ENOENT; case ERROR_DIRECTORY: return UV_ENOENT; case ERROR_FILE_NOT_FOUND: return UV_ENOENT; case ERROR_INVALID_NAME: return UV_ENOENT; diff --git a/deps/uv/src/win/fs-event.c b/deps/uv/src/win/fs-event.c index ba68f78c82a610..76ecfebaa24c39 100644 --- a/deps/uv/src/win/fs-event.c +++ b/deps/uv/src/win/fs-event.c @@ -381,9 +381,10 @@ void uv_process_fs_event_req(uv_loop_t* loop, uv_req_t* req, if (handle->dirw) { /* - * We attempt to convert the file name to its long form for - * events that still point to valid files on disk. - * For removed and renamed events, we do not provide the file name. + * We attempt to resolve the long form of the file name explicitly. + * We only do this for file names that might still exist on disk. + * If this fails, we use the name given by ReadDirectoryChangesW. + * This may be the long form or the 8.3 short name in some cases. */ if (file_info->Action != FILE_ACTION_REMOVED && file_info->Action != FILE_ACTION_RENAMED_OLD_NAME) { @@ -438,16 +439,24 @@ void uv_process_fs_event_req(uv_loop_t* loop, uv_req_t* req, } /* - * If we couldn't get the long name - just use the name - * provided by ReadDirectoryChangesW. + * We could not resolve the long form explicitly. + * We therefore use the name given by ReadDirectoryChangesW. + * This may be the long form or the 8.3 short name in some cases. */ if (!long_filenamew) { filenamew = file_info->FileName; sizew = file_info->FileNameLength / sizeof(WCHAR); } } else { - /* Removed or renamed callbacks don't provide filename. */ - filenamew = NULL; + /* + * Removed or renamed events cannot be resolved to the long form. + * We therefore use the name given by ReadDirectoryChangesW. + * This may be the long form or the 8.3 short name in some cases. + */ + if (!long_filenamew) { + filenamew = file_info->FileName; + sizew = file_info->FileNameLength / sizeof(WCHAR); + } } } else { /* We already have the long name of the file, so just use it. */ diff --git a/deps/uv/src/win/fs.c b/deps/uv/src/win/fs.c index 4a17573113ff9b..a32b0127f7e1e9 100644 --- a/deps/uv/src/win/fs.c +++ b/deps/uv/src/win/fs.c @@ -110,6 +110,9 @@ const WCHAR JUNCTION_PREFIX_LEN = 4; const WCHAR LONG_PATH_PREFIX[] = L"\\\\?\\"; const WCHAR LONG_PATH_PREFIX_LEN = 4; +const WCHAR UNC_PATH_PREFIX[] = L"\\\\?\\UNC\\"; +const WCHAR UNC_PATH_PREFIX_LEN = 8; + void uv_fs_init() { _fmode = _O_BINARY; @@ -233,14 +236,61 @@ INLINE static void uv_fs_req_init(uv_loop_t* loop, uv_fs_t* req, } +static int fs__wide_to_utf8(WCHAR* w_source_ptr, + DWORD w_source_len, + char** target_ptr, + uint64_t* target_len_ptr) { + int r; + int target_len; + char* target; + target_len = WideCharToMultiByte(CP_UTF8, + 0, + w_source_ptr, + w_source_len, + NULL, + 0, + NULL, + NULL); + + if (target_len == 0) { + return -1; + } + + if (target_len_ptr != NULL) { + *target_len_ptr = target_len; + } + + if (target_ptr == NULL) { + return 0; + } + + target = uv__malloc(target_len + 1); + if (target == NULL) { + SetLastError(ERROR_OUTOFMEMORY); + return -1; + } + + r = WideCharToMultiByte(CP_UTF8, + 0, + w_source_ptr, + w_source_len, + target, + target_len, + NULL, + NULL); + assert(r == target_len); + target[target_len] = '\0'; + *target_ptr = target; + return 0; +} + + INLINE static int fs__readlink_handle(HANDLE handle, char** target_ptr, uint64_t* target_len_ptr) { char buffer[MAXIMUM_REPARSE_DATA_BUFFER_SIZE]; REPARSE_DATA_BUFFER* reparse_data = (REPARSE_DATA_BUFFER*) buffer; - WCHAR *w_target; + WCHAR* w_target; DWORD w_target_len; - char* target; - int target_len; DWORD bytes; if (!DeviceIoControl(handle, @@ -333,50 +383,7 @@ INLINE static int fs__readlink_handle(HANDLE handle, char** target_ptr, return -1; } - /* If needed, compute the length of the target. */ - if (target_ptr != NULL || target_len_ptr != NULL) { - /* Compute the length of the target. */ - target_len = WideCharToMultiByte(CP_UTF8, - 0, - w_target, - w_target_len, - NULL, - 0, - NULL, - NULL); - if (target_len == 0) { - return -1; - } - } - - /* If requested, allocate memory and convert to UTF8. */ - if (target_ptr != NULL) { - int r; - target = (char*) uv__malloc(target_len + 1); - if (target == NULL) { - SetLastError(ERROR_OUTOFMEMORY); - return -1; - } - - r = WideCharToMultiByte(CP_UTF8, - 0, - w_target, - w_target_len, - target, - target_len, - NULL, - NULL); - assert(r == target_len); - target[target_len] = '\0'; - - *target_ptr = target; - } - - if (target_len_ptr != NULL) { - *target_len_ptr = target_len; - } - - return 0; + return fs__wide_to_utf8(w_target, w_target_len, target_ptr, target_len_ptr); } @@ -533,7 +540,15 @@ void fs__close(uv_fs_t* req) { else result = 0; - SET_REQ_RESULT(req, result); + /* _close doesn't set _doserrno on failure, but it does always set errno + * to EBADF on failure. + */ + if (result == -1) { + assert(errno == EBADF); + SET_REQ_UV_ERROR(req, UV_EBADF, ERROR_INVALID_HANDLE); + } else { + req->result = 0; + } } @@ -1699,6 +1714,84 @@ static void fs__readlink(uv_fs_t* req) { } +static size_t fs__realpath_handle(HANDLE handle, char** realpath_ptr) { + int r; + DWORD w_realpath_len; + WCHAR* w_realpath_ptr; + WCHAR* w_finalpath_ptr = NULL; + + w_realpath_len = pGetFinalPathNameByHandleW(handle, NULL, 0, VOLUME_NAME_DOS); + if (w_realpath_len == 0) { + return -1; + } + + w_realpath_ptr = uv__malloc((w_realpath_len + 1) * sizeof(WCHAR)); + if (w_realpath_ptr == NULL) { + SetLastError(ERROR_OUTOFMEMORY); + return -1; + } + + if (pGetFinalPathNameByHandleW(handle, + w_realpath_ptr, + w_realpath_len, + VOLUME_NAME_DOS) == 0) { + uv__free(w_realpath_ptr); + SetLastError(ERROR_INVALID_HANDLE); + return -1; + } + + /* convert UNC path to long path */ + if (wcsncmp(w_realpath_ptr, + UNC_PATH_PREFIX, + UNC_PATH_PREFIX_LEN) == 0) { + w_finalpath_ptr = w_realpath_ptr + 6; + *w_finalpath_ptr = L'\\'; + } else if (wcsncmp(w_realpath_ptr, + LONG_PATH_PREFIX, + LONG_PATH_PREFIX_LEN) == 0) { + w_finalpath_ptr = w_realpath_ptr + 4; + } else { + uv__free(w_realpath_ptr); + SetLastError(ERROR_INVALID_HANDLE); + return -1; + } + + r = fs__wide_to_utf8(w_finalpath_ptr, w_realpath_len, realpath_ptr, NULL); + uv__free(w_realpath_ptr); + return r; +} + +static void fs__realpath(uv_fs_t* req) { + HANDLE handle; + + if (!pGetFinalPathNameByHandleW) { + SET_REQ_UV_ERROR(req, UV_ENOSYS, ERROR_NOT_SUPPORTED); + return; + } + + handle = CreateFileW(req->file.pathw, + 0, + 0, + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, + NULL); + if (handle == INVALID_HANDLE_VALUE) { + SET_REQ_WIN32_ERROR(req, GetLastError()); + return; + } + + if (fs__realpath_handle(handle, (char**) &req->ptr) == -1) { + CloseHandle(handle); + SET_REQ_WIN32_ERROR(req, GetLastError()); + return; + } + + CloseHandle(handle); + req->flags |= UV_FS_FREE_PTR; + SET_REQ_RESULT(req, 0); +} + static void fs__chown(uv_fs_t* req) { req->result = 0; @@ -1743,6 +1836,7 @@ static void uv__fs_work(struct uv__work* w) { XX(LINK, link) XX(SYMLINK, symlink) XX(READLINK, readlink) + XX(REALPATH, realpath) XX(CHOWN, chown) XX(FCHOWN, fchown); default: @@ -2067,6 +2161,31 @@ int uv_fs_readlink(uv_loop_t* loop, uv_fs_t* req, const char* path, } +int uv_fs_realpath(uv_loop_t* loop, uv_fs_t* req, const char* path, + uv_fs_cb cb) { + int err; + + if (!req || !path) { + return UV_EINVAL; + } + + uv_fs_req_init(loop, req, UV_FS_REALPATH, cb); + + err = fs__capture_path(req, path, NULL, cb != NULL); + if (err) { + return uv_translate_sys_error(err); + } + + if (cb) { + QUEUE_FS_TP_JOB(loop, req); + return 0; + } else { + fs__realpath(req); + return req->result; + } +} + + int uv_fs_chown(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_uid_t uid, uv_gid_t gid, uv_fs_cb cb) { int err; diff --git a/deps/uv/src/win/getaddrinfo.c b/deps/uv/src/win/getaddrinfo.c index 3d23660e884c5d..ceed3b7638b457 100644 --- a/deps/uv/src/win/getaddrinfo.c +++ b/deps/uv/src/win/getaddrinfo.c @@ -109,10 +109,8 @@ static void uv__getaddrinfo_done(struct uv__work* w, int status) { req = container_of(w, uv_getaddrinfo_t, work_req); /* release input parameter memory */ - if (req->alloc != NULL) { - uv__free(req->alloc); - req->alloc = NULL; - } + uv__free(req->alloc); + req->alloc = NULL; if (status == UV_ECANCELED) { assert(req->retcode == 0); @@ -219,9 +217,7 @@ void uv_freeaddrinfo(struct addrinfo* ai) { char* alloc_ptr = (char*)ai; /* release copied result memory */ - if (alloc_ptr != NULL) { - uv__free(alloc_ptr); - } + uv__free(alloc_ptr); } @@ -354,8 +350,9 @@ int uv_getaddrinfo(uv_loop_t* loop, } error: - if (req != NULL && req->alloc != NULL) { + if (req != NULL) { uv__free(req->alloc); + req->alloc = NULL; } return uv_translate_sys_error(err); } diff --git a/deps/uv/src/win/internal.h b/deps/uv/src/win/internal.h index 8d4081bdb51ccf..783f21af0fe9f1 100644 --- a/deps/uv/src/win/internal.h +++ b/deps/uv/src/win/internal.h @@ -327,6 +327,7 @@ void uv__util_init(); uint64_t uv__hrtime(double scale); int uv_parent_pid(); +int uv_current_pid(); __declspec(noreturn) void uv_fatal_error(const int errorno, const char* syscall); diff --git a/deps/uv/src/win/pipe.c b/deps/uv/src/win/pipe.c index 8312b1ceb958c3..bcce80c77e5d57 100644 --- a/deps/uv/src/win/pipe.c +++ b/deps/uv/src/win/pipe.c @@ -85,7 +85,7 @@ static void eof_timer_close_cb(uv_handle_t* handle); static void uv_unique_pipe_name(char* ptr, char* name, size_t size) { - _snprintf(name, size, "\\\\?\\pipe\\uv\\%p-%u", ptr, GetCurrentProcessId()); + snprintf(name, size, "\\\\?\\pipe\\uv\\%p-%u", ptr, GetCurrentProcessId()); } @@ -1246,6 +1246,10 @@ static int uv_pipe_write_impl(uv_loop_t* loop, if (send_handle) { tcp_send_handle = (uv_tcp_t*)send_handle; + if (handle->pipe.conn.ipc_pid == 0) { + handle->pipe.conn.ipc_pid = uv_current_pid(); + } + err = uv_tcp_duplicate_socket(tcp_send_handle, handle->pipe.conn.ipc_pid, &ipc_frame.socket_info_ex.socket_info); if (err) { @@ -1629,7 +1633,7 @@ void uv_process_pipe_read_req(uv_loop_t* loop, uv_pipe_t* handle, if (ReadFile(handle->handle, buf.base, - buf.len, + min(buf.len, avail), &bytes, NULL)) { /* Successful read */ diff --git a/deps/uv/src/win/snprintf.c b/deps/uv/src/win/snprintf.c new file mode 100644 index 00000000000000..776c0e39217585 --- /dev/null +++ b/deps/uv/src/win/snprintf.c @@ -0,0 +1,42 @@ +/* Copyright the libuv project contributors. All rights reserved. + * + * 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. + */ + +#if defined(_MSC_VER) && _MSC_VER < 1900 + +#include +#include + +/* Emulate snprintf() on MSVC<2015, _snprintf() doesn't zero-terminate the buffer + * on overflow... + */ +int snprintf(char* buf, size_t len, const char* fmt, ...) { + int n; + va_list ap; + va_start(ap, fmt); + + n = _vscprintf(fmt, ap); + vsnprintf_s(buf, len, _TRUNCATE, fmt, ap); + + va_end(ap); + return n; +} + +#endif diff --git a/deps/uv/src/win/tty.c b/deps/uv/src/win/tty.c index b40bb42710ae7b..d87cc699097cf7 100644 --- a/deps/uv/src/win/tty.c +++ b/deps/uv/src/win/tty.c @@ -208,7 +208,7 @@ static void uv_tty_capture_initial_style(CONSOLE_SCREEN_BUFFER_INFO* info) { static int style_captured = 0; /* Only do this once. - /* Assumption: Caller has acquired uv_tty_output_lock. */ + Assumption: Caller has acquired uv_tty_output_lock. */ if (style_captured) return; diff --git a/deps/uv/src/win/util.c b/deps/uv/src/win/util.c index a0d1307f8a2590..cb247513046351 100644 --- a/deps/uv/src/win/util.c +++ b/deps/uv/src/win/util.c @@ -59,6 +59,10 @@ static char *process_title; static CRITICAL_SECTION process_title_lock; +/* Cached copy of the process id, written once. */ +static DWORD current_pid = 0; + + /* Interval (in seconds) of the high-resolution clock. */ static double hrtime_interval_ = 0; @@ -359,6 +363,14 @@ int uv_parent_pid() { } +int uv_current_pid() { + if (current_pid == 0) { + current_pid = GetCurrentProcessId(); + } + return current_pid; +} + + char** uv_setup_args(int argc, char** argv) { return argv; } diff --git a/deps/uv/src/win/winapi.c b/deps/uv/src/win/winapi.c index b0b7fd825fb64e..26bd0648668742 100644 --- a/deps/uv/src/win/winapi.c +++ b/deps/uv/src/win/winapi.c @@ -46,6 +46,7 @@ sSleepConditionVariableSRW pSleepConditionVariableSRW; sWakeAllConditionVariable pWakeAllConditionVariable; sWakeConditionVariable pWakeConditionVariable; sCancelSynchronousIo pCancelSynchronousIo; +sGetFinalPathNameByHandleW pGetFinalPathNameByHandleW; void uv_winapi_init() { @@ -139,4 +140,7 @@ void uv_winapi_init() { pCancelSynchronousIo = (sCancelSynchronousIo) GetProcAddress(kernel32_module, "CancelSynchronousIo"); + + pGetFinalPathNameByHandleW = (sGetFinalPathNameByHandleW) + GetProcAddress(kernel32_module, "GetFinalPathNameByHandleW"); } diff --git a/deps/uv/src/win/winapi.h b/deps/uv/src/win/winapi.h index 5bc79bcab27dbb..122198a6d481ac 100644 --- a/deps/uv/src/win/winapi.h +++ b/deps/uv/src/win/winapi.h @@ -4678,6 +4678,12 @@ typedef VOID (WINAPI* sWakeConditionVariable) typedef BOOL (WINAPI* sCancelSynchronousIo) (HANDLE hThread); +typedef DWORD (WINAPI* sGetFinalPathNameByHandleW) + (HANDLE hFile, + LPWSTR lpszFilePath, + DWORD cchFilePath, + DWORD dwFlags); + /* Ntdll function pointers */ extern sRtlNtStatusToDosError pRtlNtStatusToDosError; extern sNtDeviceIoControlFile pNtDeviceIoControlFile; @@ -4699,5 +4705,6 @@ extern sSleepConditionVariableSRW pSleepConditionVariableSRW; extern sWakeAllConditionVariable pWakeAllConditionVariable; extern sWakeConditionVariable pWakeConditionVariable; extern sCancelSynchronousIo pCancelSynchronousIo; +extern sGetFinalPathNameByHandleW pGetFinalPathNameByHandleW; #endif /* UV_WIN_WINAPI_H_ */ diff --git a/deps/uv/test/runner-win.h b/deps/uv/test/runner-win.h index c94b89bd5ec712..8cc4c16eb22eac 100644 --- a/deps/uv/test/runner-win.h +++ b/deps/uv/test/runner-win.h @@ -19,9 +19,6 @@ * IN THE SOFTWARE. */ -/* Don't complain about _snprintf being insecure. */ -#define _CRT_SECURE_NO_WARNINGS - /* Don't complain about write(), fileno() etc. being deprecated. */ #pragma warning(disable : 4996) @@ -30,10 +27,9 @@ #include #include - -/* Windows has no snprintf, only _snprintf. */ -#define snprintf _snprintf - +#if !defined(snprintf) && defined(_MSC_VER) && _MSC_VER < 1900 +extern int snprintf(char*, size_t, const char*, ...); +#endif typedef struct { HANDLE process; diff --git a/deps/uv/test/runner.c b/deps/uv/test/runner.c index e094defc7e7de5..c616d176445db1 100644 --- a/deps/uv/test/runner.c +++ b/deps/uv/test/runner.c @@ -210,6 +210,8 @@ int run_test(const char* test, #ifndef _WIN32 /* Clean up stale socket from previous run. */ remove(TEST_PIPENAME); + remove(TEST_PIPENAME_2); + remove(TEST_PIPENAME_3); #endif /* If it's a helper the user asks for, start it directly. */ diff --git a/deps/uv/test/task.h b/deps/uv/test/task.h index e736763802f610..d18c1daa364702 100644 --- a/deps/uv/test/task.h +++ b/deps/uv/test/task.h @@ -50,9 +50,11 @@ #ifdef _WIN32 # define TEST_PIPENAME "\\\\?\\pipe\\uv-test" # define TEST_PIPENAME_2 "\\\\?\\pipe\\uv-test2" +# define TEST_PIPENAME_3 "\\\\?\\pipe\\uv-test3" #else # define TEST_PIPENAME "/tmp/uv-test-sock" # define TEST_PIPENAME_2 "/tmp/uv-test-sock2" +# define TEST_PIPENAME_3 "/tmp/uv-test-sock3" #endif #ifdef _WIN32 @@ -174,40 +176,8 @@ enum test_status { #endif - -#if defined _WIN32 && ! defined __GNUC__ - -#include - -/* Define inline for MSVC<2015 */ -# if defined(_MSC_VER) && _MSC_VER < 1900 -# define inline __inline -# endif - -# if defined(_MSC_VER) && _MSC_VER < 1900 -/* Emulate snprintf() on MSVC<2015, _snprintf() doesn't zero-terminate the buffer - * on overflow... - */ -inline int snprintf(char* buf, size_t len, const char* fmt, ...) { - va_list ap; - int n; - - va_start(ap, fmt); - n = _vsprintf_p(buf, len, fmt, ap); - va_end(ap); - - /* It's a sad fact of life that no one ever checks the return value of - * snprintf(). Zero-terminating the buffer hopefully reduces the risk - * of gaping security holes. - */ - if (n < 0) - if (len > 0) - buf[0] = '\0'; - - return n; -} -# endif - +#if !defined(snprintf) && defined(_MSC_VER) && _MSC_VER < 1900 +extern int snprintf(char*, size_t, const char*, ...); #endif #if defined(__clang__) || \ diff --git a/deps/uv/test/test-emfile.c b/deps/uv/test/test-emfile.c index 453bfe4cf5ff55..dd35f785b46352 100644 --- a/deps/uv/test/test-emfile.c +++ b/deps/uv/test/test-emfile.c @@ -25,7 +25,6 @@ #include "task.h" #include -#include #include #include @@ -45,6 +44,13 @@ TEST_IMPL(emfile) { uv_loop_t* loop; int first_fd; + /* Lower the file descriptor limit and use up all fds save one. */ + limits.rlim_cur = limits.rlim_max = maxfd + 1; + if (setrlimit(RLIMIT_NOFILE, &limits)) { + ASSERT(errno == EPERM); /* Valgrind blocks the setrlimit() call. */ + RETURN_SKIP("setrlimit(RLIMIT_NOFILE) failed, running under valgrind?"); + } + loop = uv_default_loop(); ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); ASSERT(0 == uv_tcp_init(loop, &server_handle)); @@ -52,13 +58,6 @@ TEST_IMPL(emfile) { ASSERT(0 == uv_tcp_bind(&server_handle, (const struct sockaddr*) &addr, 0)); ASSERT(0 == uv_listen((uv_stream_t*) &server_handle, 8, connection_cb)); - /* Lower the file descriptor limit and use up all fds save one. */ - limits.rlim_cur = limits.rlim_max = maxfd + 1; - if (setrlimit(RLIMIT_NOFILE, &limits)) { - perror("setrlimit(RLIMIT_NOFILE)"); - ASSERT(0); - } - /* Remember the first one so we can clean up afterwards. */ do first_fd = dup(0); diff --git a/deps/uv/test/test-fs-event.c b/deps/uv/test/test-fs-event.c index a0908ce575bd42..e02ff2fda5e5d9 100644 --- a/deps/uv/test/test-fs-event.c +++ b/deps/uv/test/test-fs-event.c @@ -115,7 +115,11 @@ static void fs_event_cb_dir(uv_fs_event_t* handle, const char* filename, ASSERT(handle == &fs_event); ASSERT(status == 0); ASSERT(events == UV_RENAME); + #if defined(__APPLE__) || defined(_WIN32) || defined(__linux__) + ASSERT(strcmp(filename, "file1") == 0); + #else ASSERT(filename == NULL || strcmp(filename, "file1") == 0); + #endif ASSERT(0 == uv_fs_event_stop(handle)); uv_close((uv_handle_t*)handle, close_cb); } @@ -178,8 +182,12 @@ static void fs_event_cb_dir_multi_file(uv_fs_event_t* handle, ASSERT(handle == &fs_event); ASSERT(status == 0); ASSERT(events == UV_CHANGE || UV_RENAME); + #if defined(__APPLE__) || defined(_WIN32) || defined(__linux__) + ASSERT(strncmp(filename, file_prefix, sizeof(file_prefix) - 1) == 0); + #else ASSERT(filename == NULL || strncmp(filename, file_prefix, sizeof(file_prefix) - 1) == 0); + #endif if (fs_event_created + fs_event_removed == fs_event_file_count) { /* Once we've processed all create events, delete all files */ @@ -250,8 +258,16 @@ static void fs_event_cb_dir_multi_file_in_subdir(uv_fs_event_t* handle, ASSERT(handle == &fs_event); ASSERT(status == 0); ASSERT(events == UV_CHANGE || UV_RENAME); + #if defined(__APPLE__) || defined(_WIN32) || defined(__linux__) + ASSERT(strncmp(filename, + file_prefix_in_subdir, + sizeof(file_prefix_in_subdir) - 1) == 0); + #else ASSERT(filename == NULL || - strncmp(filename, file_prefix_in_subdir, sizeof(file_prefix_in_subdir) - 1) == 0); + strncmp(filename, + file_prefix_in_subdir, + sizeof(file_prefix_in_subdir) - 1) == 0); + #endif if (fs_event_created + fs_event_removed == fs_event_file_count) { /* Once we've processed all create events, delete all files */ @@ -270,7 +286,11 @@ static void fs_event_cb_file(uv_fs_event_t* handle, const char* filename, ASSERT(handle == &fs_event); ASSERT(status == 0); ASSERT(events == UV_CHANGE); + #if defined(__APPLE__) || defined(_WIN32) || defined(__linux__) + ASSERT(strcmp(filename, "file2") == 0); + #else ASSERT(filename == NULL || strcmp(filename, "file2") == 0); + #endif ASSERT(0 == uv_fs_event_stop(handle)); uv_close((uv_handle_t*)handle, close_cb); } @@ -293,7 +313,11 @@ static void fs_event_cb_file_current_dir(uv_fs_event_t* handle, ASSERT(handle == &fs_event); ASSERT(status == 0); ASSERT(events == UV_CHANGE); + #if defined(__APPLE__) || defined(_WIN32) || defined(__linux__) + ASSERT(strcmp(filename, "watch_file") == 0); + #else ASSERT(filename == NULL || strcmp(filename, "watch_file") == 0); + #endif /* Regression test for SunOS: touch should generate just one event. */ { @@ -487,7 +511,7 @@ TEST_IMPL(fs_event_watch_file_current_dir) { r = uv_timer_init(loop, &timer); ASSERT(r == 0); - r = uv_timer_start(&timer, timer_cb_touch, 1, 0); + r = uv_timer_start(&timer, timer_cb_touch, 10, 0); ASSERT(r == 0); ASSERT(timer_cb_touch_called == 0); diff --git a/deps/uv/test/test-fs.c b/deps/uv/test/test-fs.c index 90572ca6147150..cf37ac4909ca12 100644 --- a/deps/uv/test/test-fs.c +++ b/deps/uv/test/test-fs.c @@ -83,6 +83,7 @@ static int fchown_cb_count; static int link_cb_count; static int symlink_cb_count; static int readlink_cb_count; +static int realpath_cb_count; static int utime_cb_count; static int futime_cb_count; @@ -168,6 +169,35 @@ static void readlink_cb(uv_fs_t* req) { } +static void realpath_cb(uv_fs_t* req) { + char test_file_abs_buf[PATHMAX]; + size_t test_file_abs_size = sizeof(test_file_abs_buf); + ASSERT(req->fs_type == UV_FS_REALPATH); +#ifdef _WIN32 + /* + * Windows XP and Server 2003 don't support GetFinalPathNameByHandleW() + */ + if (req->result == UV_ENOSYS) { + realpath_cb_count++; + uv_fs_req_cleanup(req); + return; + } +#endif + ASSERT(req->result == 0); + + uv_cwd(test_file_abs_buf, &test_file_abs_size); +#ifdef _WIN32 + strcat(test_file_abs_buf, "\\test_file"); + ASSERT(stricmp(req->ptr, test_file_abs_buf) == 0); +#else + strcat(test_file_abs_buf, "/test_file"); + ASSERT(strcmp(req->ptr, test_file_abs_buf) == 0); +#endif + realpath_cb_count++; + uv_fs_req_cleanup(req); +} + + static void access_cb(uv_fs_t* req) { ASSERT(req->fs_type == UV_FS_ACCESS); access_cb_count++; @@ -1565,11 +1595,43 @@ TEST_IMPL(fs_readlink) { } +TEST_IMPL(fs_realpath) { + uv_fs_t req; + + loop = uv_default_loop(); + ASSERT(0 == uv_fs_realpath(loop, &req, "no_such_file", dummy_cb)); + ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT)); + ASSERT(dummy_cb_count == 1); + ASSERT(req.ptr == NULL); +#ifdef _WIN32 + /* + * Windows XP and Server 2003 don't support GetFinalPathNameByHandleW() + */ + if (req.result == UV_ENOSYS) { + uv_fs_req_cleanup(&req); + RETURN_SKIP("realpath is not supported on Windows XP"); + } +#endif + ASSERT(req.result == UV_ENOENT); + uv_fs_req_cleanup(&req); + + ASSERT(UV_ENOENT == uv_fs_realpath(NULL, &req, "no_such_file", NULL)); + ASSERT(req.ptr == NULL); + ASSERT(req.result == UV_ENOENT); + uv_fs_req_cleanup(&req); + + MAKE_VALGRIND_HAPPY(); + return 0; +} + + TEST_IMPL(fs_symlink) { int r; uv_fs_t req; uv_file file; uv_file link; + char test_file_abs_buf[PATHMAX]; + size_t test_file_abs_size; /* Setup. */ unlink("test_file"); @@ -1577,6 +1639,14 @@ TEST_IMPL(fs_symlink) { unlink("test_file_symlink2"); unlink("test_file_symlink_symlink"); unlink("test_file_symlink2_symlink"); + test_file_abs_size = sizeof(test_file_abs_buf); +#ifdef _WIN32 + uv_cwd(test_file_abs_buf, &test_file_abs_size); + strcat(test_file_abs_buf, "\\test_file"); +#else + uv_cwd(test_file_abs_buf, &test_file_abs_size); + strcat(test_file_abs_buf, "/test_file"); +#endif loop = uv_default_loop(); @@ -1647,6 +1717,24 @@ TEST_IMPL(fs_symlink) { ASSERT(strcmp(req.ptr, "test_file_symlink") == 0); uv_fs_req_cleanup(&req); + r = uv_fs_realpath(NULL, &req, "test_file_symlink_symlink", NULL); +#ifdef _WIN32 + /* + * Windows XP and Server 2003 don't support GetFinalPathNameByHandleW() + */ + if (r == UV_ENOSYS) { + uv_fs_req_cleanup(&req); + RETURN_SKIP("realpath is not supported on Windows XP"); + } +#endif + ASSERT(r == 0); +#ifdef _WIN32 + ASSERT(stricmp(req.ptr, test_file_abs_buf) == 0); +#else + ASSERT(strcmp(req.ptr, test_file_abs_buf) == 0); +#endif + uv_fs_req_cleanup(&req); + /* async link */ r = uv_fs_symlink(loop, &req, @@ -1687,6 +1775,20 @@ TEST_IMPL(fs_symlink) { uv_run(loop, UV_RUN_DEFAULT); ASSERT(readlink_cb_count == 1); + r = uv_fs_realpath(loop, &req, "test_file", realpath_cb); +#ifdef _WIN32 + /* + * Windows XP and Server 2003 don't support GetFinalPathNameByHandleW() + */ + if (r == UV_ENOSYS) { + uv_fs_req_cleanup(&req); + RETURN_SKIP("realpath is not supported on Windows XP"); + } +#endif + ASSERT(r == 0); + uv_run(loop, UV_RUN_DEFAULT); + ASSERT(realpath_cb_count == 1); + /* * Run the loop just to check we don't have make any extraneous uv_ref() * calls. This should drop out immediately. @@ -1710,12 +1812,15 @@ TEST_IMPL(fs_symlink_dir) { int r; char* test_dir; uv_dirent_t dent; + static char test_dir_abs_buf[PATHMAX]; + size_t test_dir_abs_size; /* set-up */ unlink("test_dir/file1"); unlink("test_dir/file2"); rmdir("test_dir"); rmdir("test_dir_symlink"); + test_dir_abs_size = sizeof(test_dir_abs_buf); loop = uv_default_loop(); @@ -1723,16 +1828,16 @@ TEST_IMPL(fs_symlink_dir) { uv_fs_req_cleanup(&req); #ifdef _WIN32 - { - static char src_path_buf[PATHMAX]; - size_t size; - size = sizeof(src_path_buf); - strcpy(src_path_buf, "\\\\?\\"); - uv_cwd(src_path_buf + 4, &size); - strcat(src_path_buf, "\\test_dir\\"); - test_dir = src_path_buf; - } + strcpy(test_dir_abs_buf, "\\\\?\\"); + uv_cwd(test_dir_abs_buf + 4, &test_dir_abs_size); + test_dir_abs_size += 4; + strcat(test_dir_abs_buf, "\\test_dir\\"); + test_dir_abs_size += strlen("\\test_dir\\"); + test_dir = test_dir_abs_buf; #else + uv_cwd(test_dir_abs_buf, &test_dir_abs_size); + strcat(test_dir_abs_buf, "/test_dir"); + test_dir_abs_size += strlen("/test_dir"); test_dir = "test_dir"; #endif @@ -1767,6 +1872,25 @@ TEST_IMPL(fs_symlink_dir) { #endif uv_fs_req_cleanup(&req); + r = uv_fs_realpath(NULL, &req, "test_dir_symlink", NULL); +#ifdef _WIN32 + /* + * Windows XP and Server 2003 don't support GetFinalPathNameByHandleW() + */ + if (r == UV_ENOSYS) { + uv_fs_req_cleanup(&req); + RETURN_SKIP("realpath is not supported on Windows XP"); + } +#endif + ASSERT(r == 0); +#ifdef _WIN32 + ASSERT(strlen(req.ptr) == test_dir_abs_size - 5); + ASSERT(strnicmp(req.ptr, test_dir + 4, test_dir_abs_size - 5) == 0); +#else + ASSERT(strcmp(req.ptr, test_dir_abs_buf) == 0); +#endif + uv_fs_req_cleanup(&req); + r = uv_fs_open(NULL, &open_req1, "test_dir/file1", O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); diff --git a/deps/uv/test/test-get-loadavg.c b/deps/uv/test/test-get-loadavg.c index 7465e18b91e9c7..4762e47576d064 100644 --- a/deps/uv/test/test-get-loadavg.c +++ b/deps/uv/test/test-get-loadavg.c @@ -24,10 +24,9 @@ TEST_IMPL(get_loadavg) { - double avg[3]; + double avg[3] = {-1, -1, -1}; uv_loadavg(avg); - ASSERT(avg != NULL); ASSERT(avg[0] >= 0); ASSERT(avg[1] >= 0); ASSERT(avg[2] >= 0); diff --git a/deps/uv/test/test-getaddrinfo.c b/deps/uv/test/test-getaddrinfo.c index 45813c313af2c2..6b644a8d442a3a 100644 --- a/deps/uv/test/test-getaddrinfo.c +++ b/deps/uv/test/test-getaddrinfo.c @@ -83,10 +83,11 @@ static void getaddrinfo_cuncurrent_cb(uv_getaddrinfo_t* handle, TEST_IMPL(getaddrinfo_fail) { uv_getaddrinfo_t req; + /* Use a FQDN by ending in a period */ ASSERT(0 == uv_getaddrinfo(uv_default_loop(), &req, getaddrinfo_fail_cb, - "xyzzy.xyzzy.xyzzy", + "xyzzy.xyzzy.xyzzy.", NULL, NULL)); ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); @@ -100,10 +101,11 @@ TEST_IMPL(getaddrinfo_fail) { TEST_IMPL(getaddrinfo_fail_sync) { uv_getaddrinfo_t req; + /* Use a FQDN by ending in a period */ ASSERT(0 > uv_getaddrinfo(uv_default_loop(), &req, NULL, - "xyzzy.xyzzy.xyzzy", + "xyzzy.xyzzy.xyzzy.", NULL, NULL)); uv_freeaddrinfo(req.addrinfo); diff --git a/deps/uv/test/test-getnameinfo.c b/deps/uv/test/test-getnameinfo.c index ebe9246699dbd0..b1391616d13e54 100644 --- a/deps/uv/test/test-getnameinfo.c +++ b/deps/uv/test/test-getnameinfo.c @@ -73,8 +73,8 @@ TEST_IMPL(getnameinfo_basic_ip4_sync) { NULL, (const struct sockaddr*)&addr4, 0)); - ASSERT(req.host != NULL); - ASSERT(req.service != NULL); + ASSERT(req.host[0] != '\0'); + ASSERT(req.service[0] != '\0'); MAKE_VALGRIND_HAPPY(); return 0; diff --git a/deps/uv/test/test-ipc-send-recv.c b/deps/uv/test/test-ipc-send-recv.c index d9b913339d3d50..c445483fa089e3 100644 --- a/deps/uv/test/test-ipc-send-recv.c +++ b/deps/uv/test/test-ipc-send-recv.c @@ -30,6 +30,8 @@ void spawn_helper(uv_pipe_t* channel, uv_process_t* process, const char* helper); +void ipc_send_recv_helper_threadproc(void* arg); + union handles { uv_handle_t handle; uv_stream_t stream; @@ -38,16 +40,37 @@ union handles { uv_tty_t tty; }; -struct echo_ctx { +struct test_ctx { uv_pipe_t channel; + uv_connect_t connect_req; uv_write_t write_req; + uv_write_t write_req2; uv_handle_type expected_type; union handles send; + union handles send2; + union handles recv; + union handles recv2; +}; + +struct echo_ctx { + uv_pipe_t listen; + uv_pipe_t channel; + uv_write_t write_req; + uv_write_t write_req2; + uv_handle_type expected_type; union handles recv; + union handles recv2; }; -static struct echo_ctx ctx; -static int num_recv_handles; +static struct test_ctx ctx; +static struct echo_ctx ctx2; + +/* Used in write2_cb to decide if we need to cleanup or not */ +static int is_child_process; +static int is_in_process; +static int read_cb_called; +static int recv_cb_called; +static int write2_cb_called; static void alloc_cb(uv_handle_t* handle, @@ -66,39 +89,55 @@ static void recv_cb(uv_stream_t* handle, uv_handle_type pending; uv_pipe_t* pipe; int r; + union handles* recv; + + if (++recv_cb_called == 1) { + recv = &ctx.recv; + } else { + recv = &ctx.recv2; + } pipe = (uv_pipe_t*) handle; ASSERT(pipe == &ctx.channel); - ASSERT(nread >= 0); - ASSERT(1 == uv_pipe_pending_count(pipe)); - - pending = uv_pipe_pending_type(pipe); - ASSERT(pending == ctx.expected_type); - - if (pending == UV_NAMED_PIPE) - r = uv_pipe_init(ctx.channel.loop, &ctx.recv.pipe, 0); - else if (pending == UV_TCP) - r = uv_tcp_init(ctx.channel.loop, &ctx.recv.tcp); - else - abort(); - ASSERT(r == 0); - r = uv_accept(handle, &ctx.recv.stream); - ASSERT(r == 0); - - uv_close((uv_handle_t*)&ctx.channel, NULL); - uv_close(&ctx.send.handle, NULL); - uv_close(&ctx.recv.handle, NULL); - num_recv_handles++; + /* Depending on the OS, the final recv_cb can be called after the child + * process has terminated which can result in nread being UV_EOF instead of + * the number of bytes read. Since the other end of the pipe has closed this + * UV_EOF is an acceptable value. */ + if (nread == UV_EOF) { + /* UV_EOF is only acceptable for the final recv_cb call */ + ASSERT(recv_cb_called == 2); + } else { + ASSERT(nread >= 0); + ASSERT(1 == uv_pipe_pending_count(pipe)); + + pending = uv_pipe_pending_type(pipe); + ASSERT(pending == ctx.expected_type); + + if (pending == UV_NAMED_PIPE) + r = uv_pipe_init(ctx.channel.loop, &recv->pipe, 0); + else if (pending == UV_TCP) + r = uv_tcp_init(ctx.channel.loop, &recv->tcp); + else + abort(); + ASSERT(r == 0); + + r = uv_accept(handle, &recv->stream); + ASSERT(r == 0); + } + + /* Close after two writes received */ + if (recv_cb_called == 2) { + uv_close((uv_handle_t*)&ctx.channel, NULL); + } } - -static int run_test(void) { - uv_process_t process; - uv_buf_t buf; +static void connect_cb(uv_connect_t* req, int status) { int r; + uv_buf_t buf; - spawn_helper(&ctx.channel, &process, "ipc_send_recv_helper"); + ASSERT(req == &ctx.connect_req); + ASSERT(status == 0); buf = uv_buf_init(".", 1); r = uv_write2(&ctx.write_req, @@ -108,19 +147,56 @@ static int run_test(void) { NULL); ASSERT(r == 0); + /* Perform two writes to the same pipe to make sure that on Windows we are + * not running into issue 505: + * https://github.com/libuv/libuv/issues/505 */ + buf = uv_buf_init(".", 1); + r = uv_write2(&ctx.write_req2, + (uv_stream_t*)&ctx.channel, + &buf, 1, + &ctx.send2.stream, + NULL); + ASSERT(r == 0); + r = uv_read_start((uv_stream_t*)&ctx.channel, alloc_cb, recv_cb); ASSERT(r == 0); +} + +static int run_test(int inprocess) { + uv_process_t process; + uv_thread_t tid; + int r; + + if (inprocess) { + r = uv_thread_create(&tid, ipc_send_recv_helper_threadproc, (void *) 42); + ASSERT(r == 0); + + uv_sleep(1000); + + r = uv_pipe_init(uv_default_loop(), &ctx.channel, 1); + ASSERT(r == 0); + + uv_pipe_connect(&ctx.connect_req, &ctx.channel, TEST_PIPENAME_3, connect_cb); + } else { + spawn_helper(&ctx.channel, &process, "ipc_send_recv_helper"); + + connect_cb(&ctx.connect_req, 0); + } r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); ASSERT(r == 0); - ASSERT(num_recv_handles == 1); + ASSERT(recv_cb_called == 2); + + if (inprocess) { + r = uv_thread_join(&tid); + ASSERT(r == 0); + } return 0; } - -TEST_IMPL(ipc_send_recv_pipe) { +static int run_ipc_send_recv_pipe(int inprocess) { int r; ctx.expected_type = UV_NAMED_PIPE; @@ -131,15 +207,28 @@ TEST_IMPL(ipc_send_recv_pipe) { r = uv_pipe_bind(&ctx.send.pipe, TEST_PIPENAME); ASSERT(r == 0); - r = run_test(); + r = uv_pipe_init(uv_default_loop(), &ctx.send2.pipe, 1); + ASSERT(r == 0); + + r = uv_pipe_bind(&ctx.send2.pipe, TEST_PIPENAME_2); + ASSERT(r == 0); + + r = run_test(inprocess); ASSERT(r == 0); MAKE_VALGRIND_HAPPY(); return 0; } +TEST_IMPL(ipc_send_recv_pipe) { + return run_ipc_send_recv_pipe(0); +} -TEST_IMPL(ipc_send_recv_tcp) { +TEST_IMPL(ipc_send_recv_pipe_inprocess) { + return run_ipc_send_recv_pipe(1); +} + +static int run_ipc_send_recv_tcp(int inprocess) { struct sockaddr_in addr; int r; @@ -150,25 +239,45 @@ TEST_IMPL(ipc_send_recv_tcp) { r = uv_tcp_init(uv_default_loop(), &ctx.send.tcp); ASSERT(r == 0); + r = uv_tcp_init(uv_default_loop(), &ctx.send2.tcp); + ASSERT(r == 0); + r = uv_tcp_bind(&ctx.send.tcp, (const struct sockaddr*) &addr, 0); ASSERT(r == 0); - r = run_test(); + r = uv_tcp_bind(&ctx.send2.tcp, (const struct sockaddr*) &addr, 0); + ASSERT(r == 0); + + r = run_test(inprocess); ASSERT(r == 0); MAKE_VALGRIND_HAPPY(); return 0; } +TEST_IMPL(ipc_send_recv_tcp) { + return run_ipc_send_recv_tcp(0); +} + +TEST_IMPL(ipc_send_recv_tcp_inprocess) { + return run_ipc_send_recv_tcp(1); +} + -/* Everything here runs in a child process. */ +/* Everything here runs in a child process or second thread. */ static void write2_cb(uv_write_t* req, int status) { ASSERT(status == 0); - uv_close(&ctx.recv.handle, NULL); - uv_close((uv_handle_t*)&ctx.channel, NULL); -} + /* After two successful writes in the child process, allow the child + * process to be closed. */ + if (++write2_cb_called == 2 && (is_child_process || is_in_process)) { + uv_close(&ctx2.recv.handle, NULL); + uv_close(&ctx2.recv2.handle, NULL); + uv_close((uv_handle_t*)&ctx2.channel, NULL); + uv_close((uv_handle_t*)&ctx2.listen, NULL); + } +} static void read_cb(uv_stream_t* handle, ssize_t nread, @@ -177,37 +286,102 @@ static void read_cb(uv_stream_t* handle, uv_pipe_t* pipe; uv_handle_type pending; int r; + union handles* recv; + uv_write_t* write_req; + + if (nread == UV__EOF || nread == UV__ECONNABORTED) { + return; + } + + if (++read_cb_called == 2) { + recv = &ctx2.recv; + write_req = &ctx2.write_req; + } else { + recv = &ctx2.recv2; + write_req = &ctx2.write_req2; + } pipe = (uv_pipe_t*) handle; - ASSERT(pipe == &ctx.channel); + ASSERT(pipe == &ctx2.channel); ASSERT(nread >= 0); ASSERT(1 == uv_pipe_pending_count(pipe)); pending = uv_pipe_pending_type(pipe); ASSERT(pending == UV_NAMED_PIPE || pending == UV_TCP); - wrbuf = uv_buf_init(".", 1); - if (pending == UV_NAMED_PIPE) - r = uv_pipe_init(ctx.channel.loop, &ctx.recv.pipe, 0); + r = uv_pipe_init(ctx2.channel.loop, &recv->pipe, 0); else if (pending == UV_TCP) - r = uv_tcp_init(ctx.channel.loop, &ctx.recv.tcp); + r = uv_tcp_init(ctx2.channel.loop, &recv->tcp); else abort(); ASSERT(r == 0); - r = uv_accept(handle, &ctx.recv.stream); + r = uv_accept(handle, &recv->stream); ASSERT(r == 0); - r = uv_write2(&ctx.write_req, - (uv_stream_t*)&ctx.channel, + wrbuf = uv_buf_init(".", 1); + r = uv_write2(write_req, + (uv_stream_t*)&ctx2.channel, &wrbuf, 1, - &ctx.recv.stream, + &recv->stream, write2_cb); ASSERT(r == 0); } +static void send_recv_start() { + int r; + ASSERT(1 == uv_is_readable((uv_stream_t*)&ctx2.channel)); + ASSERT(1 == uv_is_writable((uv_stream_t*)&ctx2.channel)); + ASSERT(0 == uv_is_closing((uv_handle_t*)&ctx2.channel)); + + r = uv_read_start((uv_stream_t*)&ctx2.channel, alloc_cb, read_cb); + ASSERT(r == 0); +} + +static void listen_cb(uv_stream_t* handle, int status) { + int r; + ASSERT(handle == (uv_stream_t*)&ctx2.listen); + ASSERT(status == 0); + + r = uv_accept((uv_stream_t*)&ctx2.listen, (uv_stream_t*)&ctx2.channel); + ASSERT(r == 0); + + send_recv_start(); +} + +int run_ipc_send_recv_helper(uv_loop_t* loop, int inprocess) { + int r; + + is_in_process = inprocess; + + memset(&ctx2, 0, sizeof(ctx2)); + + r = uv_pipe_init(loop, &ctx2.listen, 0); + ASSERT(r == 0); + + r = uv_pipe_init(loop, &ctx2.channel, 1); + ASSERT(r == 0); + + if (inprocess) { + r = uv_pipe_bind(&ctx2.listen, TEST_PIPENAME_3); + ASSERT(r == 0); + + r = uv_listen((uv_stream_t*)&ctx2.listen, SOMAXCONN, listen_cb); + ASSERT(r == 0); + } else { + r = uv_pipe_open(&ctx2.channel, 0); + ASSERT(r == 0); + + send_recv_start(); + } + + r = uv_run(loop, UV_RUN_DEFAULT); + ASSERT(r == 0); + + return 0; +} /* stdin is a duplex channel over which a handle is sent. * We receive it and send it back where it came from. @@ -215,22 +389,23 @@ static void read_cb(uv_stream_t* handle, int ipc_send_recv_helper(void) { int r; - memset(&ctx, 0, sizeof(ctx)); - - r = uv_pipe_init(uv_default_loop(), &ctx.channel, 1); + r = run_ipc_send_recv_helper(uv_default_loop(), 0); ASSERT(r == 0); - uv_pipe_open(&ctx.channel, 0); - ASSERT(1 == uv_is_readable((uv_stream_t*)&ctx.channel)); - ASSERT(1 == uv_is_writable((uv_stream_t*)&ctx.channel)); - ASSERT(0 == uv_is_closing((uv_handle_t*)&ctx.channel)); + MAKE_VALGRIND_HAPPY(); + return 0; +} - r = uv_read_start((uv_stream_t*)&ctx.channel, alloc_cb, read_cb); +void ipc_send_recv_helper_threadproc(void* arg) { + int r; + uv_loop_t loop; + + r = uv_loop_init(&loop); ASSERT(r == 0); - r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); + r = run_ipc_send_recv_helper(&loop, 1); ASSERT(r == 0); - MAKE_VALGRIND_HAPPY(); - return 0; + r = uv_loop_close(&loop); + ASSERT(r == 0); } diff --git a/deps/uv/test/test-list.h b/deps/uv/test/test-list.h index 8ee74391afaeb7..858a20af49c291 100644 --- a/deps/uv/test/test-list.h +++ b/deps/uv/test/test-list.h @@ -50,8 +50,10 @@ TEST_DECLARE (ipc_listen_before_write) TEST_DECLARE (ipc_listen_after_write) #ifndef _WIN32 TEST_DECLARE (ipc_send_recv_pipe) +TEST_DECLARE (ipc_send_recv_pipe_inprocess) #endif TEST_DECLARE (ipc_send_recv_tcp) +TEST_DECLARE (ipc_send_recv_tcp_inprocess) TEST_DECLARE (ipc_tcp_connection) TEST_DECLARE (tcp_ping_pong) TEST_DECLARE (tcp_ping_pong_v6) @@ -252,6 +254,7 @@ TEST_DECLARE (fs_unlink_readonly) TEST_DECLARE (fs_chown) TEST_DECLARE (fs_link) TEST_DECLARE (fs_readlink) +TEST_DECLARE (fs_realpath) TEST_DECLARE (fs_symlink) TEST_DECLARE (fs_symlink_dir) TEST_DECLARE (fs_utime) @@ -334,6 +337,7 @@ HELPER_DECLARE (tcp6_echo_server) HELPER_DECLARE (udp4_echo_server) HELPER_DECLARE (pipe_echo_server) +TEST_DECLARE (queue_foreach_delete) TASK_LIST_START TEST_ENTRY_CUSTOM (platform_output, 0, 1, 5000) @@ -380,8 +384,10 @@ TASK_LIST_START TEST_ENTRY (ipc_listen_after_write) #ifndef _WIN32 TEST_ENTRY (ipc_send_recv_pipe) + TEST_ENTRY (ipc_send_recv_pipe_inprocess) #endif TEST_ENTRY (ipc_send_recv_tcp) + TEST_ENTRY (ipc_send_recv_tcp_inprocess) TEST_ENTRY (ipc_tcp_connection) TEST_ENTRY (tcp_ping_pong) @@ -671,6 +677,7 @@ TASK_LIST_START TEST_ENTRY (fs_utime) TEST_ENTRY (fs_futime) TEST_ENTRY (fs_readlink) + TEST_ENTRY (fs_realpath) TEST_ENTRY (fs_symlink) TEST_ENTRY (fs_symlink_dir) TEST_ENTRY (fs_stat_missing_path) @@ -714,6 +721,9 @@ TASK_LIST_START TEST_ENTRY (dlerror) TEST_ENTRY (ip4_addr) TEST_ENTRY (ip6_addr_link_local) + + TEST_ENTRY (queue_foreach_delete) + #if 0 /* These are for testing the test runner. */ TEST_ENTRY (fail_always) diff --git a/deps/uv/test/test-mutexes.c b/deps/uv/test/test-mutexes.c index 4aeac73b4c1571..af5e4e88a22f30 100644 --- a/deps/uv/test/test-mutexes.c +++ b/deps/uv/test/test-mutexes.c @@ -25,6 +25,10 @@ #include #include +static uv_cond_t condvar; +static uv_mutex_t mutex; +static uv_rwlock_t rwlock; +static int step; /* The mutex and rwlock tests are really poor. * They're very basic sanity checks and nothing more. @@ -63,60 +67,96 @@ TEST_IMPL(thread_rwlock) { } -TEST_IMPL(thread_rwlock_trylock) { - uv_rwlock_t rwlock; - int r; - - r = uv_rwlock_init(&rwlock); - ASSERT(r == 0); - - /* No locks held. */ +/* Call when holding |mutex|. */ +static void synchronize_nowait(void) { + step += 1; + uv_cond_signal(&condvar); +} - r = uv_rwlock_trywrlock(&rwlock); - ASSERT(r == 0); - /* Write lock held. */ +/* Call when holding |mutex|. */ +static void synchronize(void) { + int current; - r = uv_rwlock_tryrdlock(&rwlock); - ASSERT(r == UV_EBUSY); - r = uv_rwlock_trywrlock(&rwlock); - ASSERT(r == UV_EBUSY); + synchronize_nowait(); + /* Wait for the other thread. Guard against spurious wakeups. */ + for (current = step; current == step; uv_cond_wait(&condvar, &mutex)); + ASSERT(step == current + 1); +} - uv_rwlock_wrunlock(&rwlock); - /* No locks held. */ +static void thread_rwlock_trylock_peer(void* unused) { + (void) &unused; - r = uv_rwlock_tryrdlock(&rwlock); - ASSERT(r == 0); + uv_mutex_lock(&mutex); - /* One read lock held. */ + /* Write lock held by other thread. */ + ASSERT(UV_EBUSY == uv_rwlock_tryrdlock(&rwlock)); + ASSERT(UV_EBUSY == uv_rwlock_trywrlock(&rwlock)); + synchronize(); - r = uv_rwlock_tryrdlock(&rwlock); - ASSERT(r == 0); + /* Read lock held by other thread. */ + ASSERT(0 == uv_rwlock_tryrdlock(&rwlock)); + uv_rwlock_rdunlock(&rwlock); + ASSERT(UV_EBUSY == uv_rwlock_trywrlock(&rwlock)); + synchronize(); - /* Two read locks held. */ + /* Acquire write lock. */ + ASSERT(0 == uv_rwlock_trywrlock(&rwlock)); + synchronize(); - r = uv_rwlock_trywrlock(&rwlock); - ASSERT(r == UV_EBUSY); + /* Release write lock and acquire read lock. */ + uv_rwlock_wrunlock(&rwlock); + ASSERT(0 == uv_rwlock_tryrdlock(&rwlock)); + synchronize(); uv_rwlock_rdunlock(&rwlock); + synchronize_nowait(); /* Signal main thread we're going away. */ + uv_mutex_unlock(&mutex); +} - /* One read lock held. */ - uv_rwlock_rdunlock(&rwlock); +TEST_IMPL(thread_rwlock_trylock) { + uv_thread_t thread; - /* No read locks held. */ + ASSERT(0 == uv_cond_init(&condvar)); + ASSERT(0 == uv_mutex_init(&mutex)); + ASSERT(0 == uv_rwlock_init(&rwlock)); - r = uv_rwlock_trywrlock(&rwlock); - ASSERT(r == 0); + uv_mutex_lock(&mutex); + ASSERT(0 == uv_thread_create(&thread, thread_rwlock_trylock_peer, NULL)); - /* Write lock held. */ + /* Hold write lock. */ + ASSERT(0 == uv_rwlock_trywrlock(&rwlock)); + synchronize(); /* Releases the mutex to the other thread. */ + /* Release write lock and acquire read lock. Pthreads doesn't support + * the notion of upgrading or downgrading rwlocks, so neither do we. + */ uv_rwlock_wrunlock(&rwlock); + ASSERT(0 == uv_rwlock_tryrdlock(&rwlock)); + synchronize(); + + /* Release read lock. */ + uv_rwlock_rdunlock(&rwlock); + synchronize(); - /* No locks held. */ + /* Write lock held by other thread. */ + ASSERT(UV_EBUSY == uv_rwlock_tryrdlock(&rwlock)); + ASSERT(UV_EBUSY == uv_rwlock_trywrlock(&rwlock)); + synchronize(); + /* Read lock held by other thread. */ + ASSERT(0 == uv_rwlock_tryrdlock(&rwlock)); + uv_rwlock_rdunlock(&rwlock); + ASSERT(UV_EBUSY == uv_rwlock_trywrlock(&rwlock)); + synchronize(); + + ASSERT(0 == uv_thread_join(&thread)); uv_rwlock_destroy(&rwlock); + uv_mutex_unlock(&mutex); + uv_mutex_destroy(&mutex); + uv_cond_destroy(&condvar); return 0; } diff --git a/deps/uv/test/test-process-title.c b/deps/uv/test/test-process-title.c index 29be20749bea9d..42ade44160416f 100644 --- a/deps/uv/test/test-process-title.c +++ b/deps/uv/test/test-process-title.c @@ -42,7 +42,7 @@ static void set_title(const char* title) { TEST_IMPL(process_title) { -#if defined(__sun) +#if defined(__sun) || defined(_AIX) RETURN_SKIP("uv_(get|set)_process_title is not implemented."); #else /* Check for format string vulnerabilities. */ diff --git a/deps/uv/test/test-queue-foreach-delete.c b/deps/uv/test/test-queue-foreach-delete.c new file mode 100644 index 00000000000000..45da225381f51f --- /dev/null +++ b/deps/uv/test/test-queue-foreach-delete.c @@ -0,0 +1,200 @@ +/* Copyright The libuv project and contributors. All rights reserved. + * + * 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. + */ + +#include "uv.h" +#include "task.h" + +#include + + +/* + * The idea behind the test is as follows. + * Certain handle types are stored in a queue internally. + * Extra care should be taken for removal of a handle from the queue while iterating over the queue. + * (i.e., QUEUE_REMOVE() called within QUEUE_FOREACH()) + * This usually happens when someone closes or stops a handle from within its callback. + * So we need to check that we haven't screwed the queue on close/stop. + * To do so we do the following (for each handle type): + * 1. Create and start 3 handles (#0, #1, and #2). + * + * The queue after the start() calls: + * ..=> [queue head] <=> [handle] <=> [handle #1] <=> [handle] <=.. + * + * 2. Trigger handles to fire (for uv_idle_t, uv_prepare_t, and uv_check_t there is nothing to do). + * + * 3. In the callback for the first-executed handle (#0 or #2 depending on handle type) + * stop the handle and the next one (#1). + * (for uv_idle_t, uv_prepare_t, and uv_check_t callbacks are executed in the reverse order as they are start()'ed, + * so callback for handle #2 will be called first) + * + * The queue after the stop() calls: + * correct foreach "next" | + * \/ + * ..=> [queue head] <==============================> [handle] <=.. + * [ ] <- [handle] <=> [handle #1] -> [ ] + * /\ + * wrong foreach "next" | + * + * 4. The callback for handle #1 shouldn't be called because the handle #1 is stopped in the previous step. + * However, if QUEUE_REMOVE() is not handled properly within QUEUE_FOREACH(), the callback _will_ be called. + */ + +static const unsigned first_handle_number_idle = 2; +static const unsigned first_handle_number_prepare = 2; +static const unsigned first_handle_number_check = 2; +#ifdef __linux__ +static const unsigned first_handle_number_fs_event = 0; +#endif + + +#define DEFINE_GLOBALS_AND_CBS(name) \ + static uv_##name##_t (name)[3]; \ + static unsigned name##_cb_calls[3]; \ + \ + static void name##2_cb(uv_##name##_t* handle) { \ + ASSERT(handle == &(name)[2]); \ + if (first_handle_number_##name == 2) { \ + uv_close((uv_handle_t*)&(name)[2], NULL); \ + uv_close((uv_handle_t*)&(name)[1], NULL); \ + } \ + name##_cb_calls[2]++; \ + } \ + \ + static void name##1_cb(uv_##name##_t* handle) { \ + ASSERT(handle == &(name)[1]); \ + ASSERT(0 && "Shouldn't be called" && (&name[0])); \ + } \ + \ + static void name##0_cb(uv_##name##_t* handle) { \ + ASSERT(handle == &(name)[0]); \ + if (first_handle_number_##name == 0) { \ + uv_close((uv_handle_t*)&(name)[0], NULL); \ + uv_close((uv_handle_t*)&(name)[1], NULL); \ + } \ + name##_cb_calls[0]++; \ + } \ + \ + static const uv_##name##_cb name##_cbs[] = { \ + (uv_##name##_cb)name##0_cb, \ + (uv_##name##_cb)name##1_cb, \ + (uv_##name##_cb)name##2_cb, \ + }; + +#define INIT_AND_START(name, loop) \ + do { \ + size_t i; \ + for (i = 0; i < ARRAY_SIZE(name); i++) { \ + int r; \ + r = uv_##name##_init((loop), &(name)[i]); \ + ASSERT(r == 0); \ + \ + r = uv_##name##_start(&(name)[i], name##_cbs[i]); \ + ASSERT(r == 0); \ + } \ + } while (0) + +#define END_ASSERTS(name) \ + do { \ + ASSERT(name##_cb_calls[0] == 1); \ + ASSERT(name##_cb_calls[1] == 0); \ + ASSERT(name##_cb_calls[2] == 1); \ + } while (0) + +DEFINE_GLOBALS_AND_CBS(idle) +DEFINE_GLOBALS_AND_CBS(prepare) +DEFINE_GLOBALS_AND_CBS(check) + +#ifdef __linux__ +DEFINE_GLOBALS_AND_CBS(fs_event) + +static const char watched_dir[] = "."; +static uv_timer_t timer; +static unsigned helper_timer_cb_calls; + + +static void init_and_start_fs_events(uv_loop_t* loop) { + size_t i; + for (i = 0; i < ARRAY_SIZE(fs_event); i++) { + int r; + r = uv_fs_event_init(loop, &fs_event[i]); + ASSERT(r == 0); + + r = uv_fs_event_start(&fs_event[i], + (uv_fs_event_cb)fs_event_cbs[i], + watched_dir, + 0); + ASSERT(r == 0); + } +} + +static void helper_timer_cb(uv_timer_t* thandle) { + int r; + uv_fs_t fs_req; + + /* fire all fs_events */ + r = uv_fs_utime(thandle->loop, &fs_req, watched_dir, 0, 0, NULL); + ASSERT(r == 0); + ASSERT(fs_req.result == 0); + ASSERT(fs_req.fs_type == UV_FS_UTIME); + ASSERT(strcmp(fs_req.path, watched_dir) == 0); + uv_fs_req_cleanup(&fs_req); + + helper_timer_cb_calls++; +} +#endif + + +TEST_IMPL(queue_foreach_delete) { + uv_loop_t* loop; + int r; + + loop = uv_default_loop(); + + INIT_AND_START(idle, loop); + INIT_AND_START(prepare, loop); + INIT_AND_START(check, loop); + +#ifdef __linux__ + init_and_start_fs_events(loop); + + /* helper timer to trigger async and fs_event callbacks */ + r = uv_timer_init(loop, &timer); + ASSERT(r == 0); + + r = uv_timer_start(&timer, helper_timer_cb, 0, 0); + ASSERT(r == 0); +#endif + + r = uv_run(loop, UV_RUN_NOWAIT); + ASSERT(r == 1); + + END_ASSERTS(idle); + END_ASSERTS(prepare); + END_ASSERTS(check); + +#ifdef __linux__ + ASSERT(helper_timer_cb_calls == 1); +#endif + + MAKE_VALGRIND_HAPPY(); + + return 0; +} diff --git a/deps/uv/test/test-spawn.c b/deps/uv/test/test-spawn.c index e71f0f7d53d344..eba54ae7054976 100644 --- a/deps/uv/test/test-spawn.c +++ b/deps/uv/test/test-spawn.c @@ -960,11 +960,11 @@ TEST_IMPL(spawn_detect_pipe_name_collisions_on_windows) { options.stdio_count = 2; /* Create a pipe that'll cause a collision. */ - _snprintf(name, - sizeof(name), - "\\\\.\\pipe\\uv\\%p-%d", - &out, - GetCurrentProcessId()); + snprintf(name, + sizeof(name), + "\\\\.\\pipe\\uv\\%p-%d", + &out, + GetCurrentProcessId()); pipe_handle = CreateNamedPipeA(name, PIPE_ACCESS_INBOUND | FILE_FLAG_OVERLAPPED, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, diff --git a/deps/uv/test/test-tcp-try-write.c b/deps/uv/test/test-tcp-try-write.c index 8a60136b64e9aa..97a1d6e3d5794f 100644 --- a/deps/uv/test/test-tcp-try-write.c +++ b/deps/uv/test/test-tcp-try-write.c @@ -58,6 +58,11 @@ static void connect_cb(uv_connect_t* req, int status) { break; } } while (1); + + do { + buf = uv_buf_init("", 0); + r = uv_try_write((uv_stream_t*) &client, &buf, 1); + } while (r != 0); uv_close((uv_handle_t*) &client, close_cb); } diff --git a/deps/uv/test/test-tcp-write-fail.c b/deps/uv/test/test-tcp-write-fail.c index 2840d8161032be..5256a9f4a790aa 100644 --- a/deps/uv/test/test-tcp-write-fail.c +++ b/deps/uv/test/test-tcp-write-fail.c @@ -43,7 +43,7 @@ static void close_socket(uv_tcp_t* sock) { r = uv_fileno((uv_handle_t*)sock, &fd); ASSERT(r == 0); #ifdef _WIN32 - r = closesocket(fd); + r = closesocket((uv_os_sock_t)fd); #else r = close(fd); #endif diff --git a/deps/uv/test/test-threadpool-cancel.c b/deps/uv/test/test-threadpool-cancel.c index cb456224516823..784c1739f6d47e 100644 --- a/deps/uv/test/test-threadpool-cancel.c +++ b/deps/uv/test/test-threadpool-cancel.c @@ -276,7 +276,7 @@ TEST_IMPL(threadpool_cancel_work) { TEST_IMPL(threadpool_cancel_fs) { struct cancel_info ci; - uv_fs_t reqs[25]; + uv_fs_t reqs[26]; uv_loop_t* loop; unsigned n; uv_buf_t iov; @@ -305,6 +305,7 @@ TEST_IMPL(threadpool_cancel_fs) { ASSERT(0 == uv_fs_read(loop, reqs + n++, 0, &iov, 1, 0, fs_cb)); ASSERT(0 == uv_fs_scandir(loop, reqs + n++, "/", 0, fs_cb)); ASSERT(0 == uv_fs_readlink(loop, reqs + n++, "/", fs_cb)); + ASSERT(0 == uv_fs_realpath(loop, reqs + n++, "/", fs_cb)); ASSERT(0 == uv_fs_rename(loop, reqs + n++, "/", "/", fs_cb)); ASSERT(0 == uv_fs_mkdir(loop, reqs + n++, "/", 0, fs_cb)); ASSERT(0 == uv_fs_sendfile(loop, reqs + n++, 0, 0, 0, 0, fs_cb)); diff --git a/deps/uv/test/test-tty.c b/deps/uv/test/test-tty.c index 81e612c1d6ae1c..b844959d526340 100644 --- a/deps/uv/test/test-tty.c +++ b/deps/uv/test/test-tty.c @@ -153,11 +153,14 @@ TEST_IMPL(tty_file) { ASSERT(0 == close(fd)); } +/* Bug on AIX where '/dev/random' returns 1 from isatty() */ +#ifndef _AIX fd = open("/dev/random", O_RDONLY); if (fd != -1) { ASSERT(UV_EINVAL == uv_tty_init(&loop, &tty, fd, 1)); ASSERT(0 == close(fd)); } +#endif /* _AIX */ fd = open("/dev/zero", O_RDONLY); if (fd != -1) { diff --git a/deps/uv/test/test-udp-ipv6.c b/deps/uv/test/test-udp-ipv6.c index 1d5720ce73162a..1b0db78b8efcea 100644 --- a/deps/uv/test/test-udp-ipv6.c +++ b/deps/uv/test/test-udp-ipv6.c @@ -26,6 +26,10 @@ #include #include +#ifdef __FreeBSD__ +#include +#endif + #define CHECK_HANDLE(handle) \ ASSERT((uv_udp_t*)(handle) == &server \ || (uv_udp_t*)(handle) == &client \ @@ -43,6 +47,18 @@ static int send_cb_called; static int recv_cb_called; static int close_cb_called; +#ifdef __FreeBSD__ +static int can_ipv6_ipv4_dual() { + int v6only; + size_t size = sizeof(int); + + if (sysctlbyname("net.inet6.ip6.v6only", &v6only, &size, NULL, 0)) + return 0; + + return v6only != 1; +} +#endif + static void alloc_cb(uv_handle_t* handle, size_t suggested_size, @@ -150,6 +166,11 @@ TEST_IMPL(udp_dual_stack) { if (!can_ipv6()) RETURN_SKIP("IPv6 not supported"); +#ifdef __FreeBSD__ + if (!can_ipv6_ipv4_dual()) + RETURN_SKIP("IPv6-IPv4 dual stack not supported"); +#endif + do_test(ipv6_recv_ok, 0); ASSERT(recv_cb_called == 1); diff --git a/deps/uv/test/test-udp-multicast-join6.c b/deps/uv/test/test-udp-multicast-join6.c index 873cb6d811d749..f635bdb9e14ee2 100644 --- a/deps/uv/test/test-udp-multicast-join6.c +++ b/deps/uv/test/test-udp-multicast-join6.c @@ -119,7 +119,7 @@ TEST_IMPL(udp_multicast_join6) { ASSERT(r == 0); /* join the multicast channel */ -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(_AIX) r = uv_udp_set_membership(&client, "ff02::1", "::1%lo0", UV_JOIN_GROUP); #else r = uv_udp_set_membership(&client, "ff02::1", NULL, UV_JOIN_GROUP); diff --git a/deps/uv/uv.gyp b/deps/uv/uv.gyp index 8049faa7a66929..635a234ea6eee8 100644 --- a/deps/uv/uv.gyp +++ b/deps/uv/uv.gyp @@ -104,6 +104,13 @@ 'src/win/winsock.c', 'src/win/winsock.h', ], + 'conditions': [ + ['MSVS_VERSION < "2015"', { + 'sources': [ + 'src/win/snprintf.c' + ] + }] + ], 'link_settings': { 'libraries': [ '-ladvapi32', @@ -340,6 +347,7 @@ 'test/test-poll-close-doesnt-corrupt-stack.c', 'test/test-poll-closesocket.c', 'test/test-process-title.c', + 'test/test-queue-foreach-delete.c', 'test/test-ref.c', 'test/test-run-nowait.c', 'test/test-run-once.c', diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS index 72c23bcc83e0b7..05e3f9410c6eda 100644 --- a/deps/v8/AUTHORS +++ b/deps/v8/AUTHORS @@ -96,6 +96,7 @@ Seo Sanghyeon Tobias Burnus Victor Costan Vlad Burlik +Vladimir Krivosheev Vladimir Shutoff Yu Yin Zhongping Wang diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index 54fd822efe41ed..7744c089f68ce0 100644 --- a/deps/v8/include/v8-version.h +++ b/deps/v8/include/v8-version.h @@ -11,7 +11,7 @@ #define V8_MAJOR_VERSION 4 #define V8_MINOR_VERSION 6 #define V8_BUILD_NUMBER 85 -#define V8_PATCH_LEVEL 25 +#define V8_PATCH_LEVEL 31 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/v8/src/api.cc b/deps/v8/src/api.cc index a2feebea45545b..eac27192aacb1b 100644 --- a/deps/v8/src/api.cc +++ b/deps/v8/src/api.cc @@ -31,6 +31,7 @@ #include "src/debug/debug.h" #include "src/deoptimizer.h" #include "src/execution.h" +#include "src/gdb-jit.h" #include "src/global-handles.h" #include "src/heap-profiler.h" #include "src/heap-snapshot-generator-inl.h" @@ -7102,10 +7103,16 @@ Isolate* Isolate::New(const Isolate::CreateParams& params) { if (params.entry_hook) { isolate->set_function_entry_hook(params.entry_hook); } - if (params.code_event_handler) { + auto code_event_handler = params.code_event_handler; +#ifdef ENABLE_GDB_JIT_INTERFACE + if (code_event_handler == nullptr && i::FLAG_gdbjit) { + code_event_handler = i::GDBJITInterface::EventHandler; + } +#endif // ENABLE_GDB_JIT_INTERFACE + if (code_event_handler) { isolate->InitializeLoggingAndCounters(); isolate->logger()->SetCodeEventHandler(kJitCodeEventDefault, - params.code_event_handler); + code_event_handler); } if (params.counter_lookup_callback) { v8_isolate->SetCounterFunction(params.counter_lookup_callback); diff --git a/deps/v8/src/arm64/lithium-codegen-arm64.cc b/deps/v8/src/arm64/lithium-codegen-arm64.cc index 3dff64cbe84ce9..32650e7ab0fc79 100644 --- a/deps/v8/src/arm64/lithium-codegen-arm64.cc +++ b/deps/v8/src/arm64/lithium-codegen-arm64.cc @@ -2819,6 +2819,8 @@ void LCodeGen::DoDoubleToIntOrSmi(LDoubleToIntOrSmi* instr) { void LCodeGen::DoDrop(LDrop* instr) { __ Drop(instr->count()); + + RecordPushedArgumentsDelta(instr->hydrogen_value()->argument_delta()); } diff --git a/deps/v8/src/ast-numbering.cc b/deps/v8/src/ast-numbering.cc index dc0528caa0cff6..4becade296fa52 100644 --- a/deps/v8/src/ast-numbering.cc +++ b/deps/v8/src/ast-numbering.cc @@ -553,7 +553,7 @@ bool AstNumberingVisitor::Renumber(FunctionLiteral* node) { Scope* scope = node->scope(); if (scope->HasIllegalRedeclaration()) { - scope->VisitIllegalRedeclaration(this); + Visit(scope->GetIllegalRedeclaration()); DisableOptimization(kFunctionWithIllegalRedeclaration); return Finish(node); } diff --git a/deps/v8/src/ast-value-factory.cc b/deps/v8/src/ast-value-factory.cc index 68cf015200365c..fbcde8b45703fc 100644 --- a/deps/v8/src/ast-value-factory.cc +++ b/deps/v8/src/ast-value-factory.cc @@ -29,6 +29,7 @@ #include "src/api.h" #include "src/objects.h" +#include "src/utils.h" namespace v8 { namespace internal { @@ -379,11 +380,32 @@ AstRawString* AstValueFactory::GetString(uint32_t hash, bool is_one_byte, bool AstValueFactory::AstRawStringCompare(void* a, void* b) { const AstRawString* lhs = static_cast(a); const AstRawString* rhs = static_cast(b); - if (lhs->is_one_byte() != rhs->is_one_byte()) return false; + if (lhs->length() != rhs->length()) return false; if (lhs->hash() != rhs->hash()) return false; - int len = lhs->byte_length(); - if (rhs->byte_length() != len) return false; - return memcmp(lhs->raw_data(), rhs->raw_data(), len) == 0; + const unsigned char* l = lhs->raw_data(); + const unsigned char* r = rhs->raw_data(); + size_t length = rhs->length(); + if (lhs->is_one_byte()) { + if (rhs->is_one_byte()) { + return CompareCharsUnsigned(reinterpret_cast(l), + reinterpret_cast(r), + length) == 0; + } else { + return CompareCharsUnsigned(reinterpret_cast(l), + reinterpret_cast(r), + length) == 0; + } + } else { + if (rhs->is_one_byte()) { + return CompareCharsUnsigned(reinterpret_cast(l), + reinterpret_cast(r), + length) == 0; + } else { + return CompareCharsUnsigned(reinterpret_cast(l), + reinterpret_cast(r), + length) == 0; + } + } } } // namespace internal } // namespace v8 diff --git a/deps/v8/src/builtins.cc b/deps/v8/src/builtins.cc index aa7268f6b6ccfb..31649d0fc27432 100644 --- a/deps/v8/src/builtins.cc +++ b/deps/v8/src/builtins.cc @@ -1430,6 +1430,9 @@ void Builtins::SetUp(Isolate* isolate, bool create_heap_objects) { #ifdef DEBUG // We can generate a lot of debug code on Arm64. const size_t buffer_size = 32*KB; +#elif V8_TARGET_ARCH_PPC64 + // 8 KB is insufficient on PPC64 when FLAG_debug_code is on. + const size_t buffer_size = 10 * KB; #else const size_t buffer_size = 8*KB; #endif diff --git a/deps/v8/src/compiler/ast-graph-builder.cc b/deps/v8/src/compiler/ast-graph-builder.cc index e7725799233cbb..947d2e3b185f1b 100644 --- a/deps/v8/src/compiler/ast-graph-builder.cc +++ b/deps/v8/src/compiler/ast-graph-builder.cc @@ -586,8 +586,7 @@ void AstGraphBuilder::CreateGraphBody(bool stack_check) { // Visit illegal re-declaration and bail out if it exists. if (scope->HasIllegalRedeclaration()) { - AstEffectContext for_effect(this); - scope->VisitIllegalRedeclaration(this); + VisitForEffect(scope->GetIllegalRedeclaration()); return; } diff --git a/deps/v8/src/compiler/linkage.cc b/deps/v8/src/compiler/linkage.cc index 2bbedaceb26b07..80b5e2616f3262 100644 --- a/deps/v8/src/compiler/linkage.cc +++ b/deps/v8/src/compiler/linkage.cc @@ -218,10 +218,10 @@ int Linkage::FrameStateInputCount(Runtime::FunctionId function) { switch (function) { case Runtime::kAllocateInTargetSpace: case Runtime::kDateField: - case Runtime::kFinalizeClassDefinition: // TODO(conradw): Is it safe? case Runtime::kDefineClassMethod: // TODO(jarin): Is it safe? case Runtime::kDefineGetterPropertyUnchecked: // TODO(jarin): Is it safe? case Runtime::kDefineSetterPropertyUnchecked: // TODO(jarin): Is it safe? + case Runtime::kFinalizeClassDefinition: // TODO(conradw): Is it safe? case Runtime::kForInDone: case Runtime::kForInStep: case Runtime::kGetOriginalConstructor: @@ -244,6 +244,7 @@ int Linkage::FrameStateInputCount(Runtime::FunctionId function) { case Runtime::kInlineGetCallerJSFunction: case Runtime::kInlineGetPrototype: case Runtime::kInlineRegExpExec: + case Runtime::kInlineSubString: case Runtime::kInlineToObject: return 1; case Runtime::kInlineDeoptimizeNow: diff --git a/deps/v8/src/compiler/ppc/code-generator-ppc.cc b/deps/v8/src/compiler/ppc/code-generator-ppc.cc index 2acea2f1d5925a..f7479c7a69d4e6 100644 --- a/deps/v8/src/compiler/ppc/code-generator-ppc.cc +++ b/deps/v8/src/compiler/ppc/code-generator-ppc.cc @@ -1210,8 +1210,8 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr, PPCOperandConverter i(this, instr); Label done; ArchOpcode op = instr->arch_opcode(); - bool check_unordered = (op == kPPC_CmpDouble); CRegister cr = cr0; + int reg_value = -1; // Overflow checked for add/sub only. DCHECK((condition != kOverflow && condition != kNotOverflow) || @@ -1223,44 +1223,44 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr, Register reg = i.OutputRegister(instr->OutputCount() - 1); Condition cond = FlagsConditionToCondition(condition); - switch (cond) { - case eq: - case lt: + if (op == kPPC_CmpDouble) { + // check for unordered if necessary + if (cond == le) { + reg_value = 0; __ li(reg, Operand::Zero()); - __ li(kScratchReg, Operand(1)); - __ isel(cond, reg, kScratchReg, reg, cr); - break; - case ne: - case ge: + __ bunordered(&done, cr); + } else if (cond == gt) { + reg_value = 1; __ li(reg, Operand(1)); - __ isel(NegateCondition(cond), reg, r0, reg, cr); - break; - case gt: - if (check_unordered) { - __ li(reg, Operand(1)); + __ bunordered(&done, cr); + } + // Unnecessary for eq/lt & ne/ge since only FU bit will be set. + } + + if (CpuFeatures::IsSupported(ISELECT)) { + switch (cond) { + case eq: + case lt: + case gt: + if (reg_value != 1) __ li(reg, Operand(1)); __ li(kScratchReg, Operand::Zero()); - __ bunordered(&done, cr); __ isel(cond, reg, reg, kScratchReg, cr); - } else { - __ li(reg, Operand::Zero()); - __ li(kScratchReg, Operand(1)); - __ isel(cond, reg, kScratchReg, reg, cr); - } - break; - case le: - if (check_unordered) { - __ li(reg, Operand::Zero()); - __ li(kScratchReg, Operand(1)); - __ bunordered(&done, cr); - __ isel(NegateCondition(cond), reg, r0, kScratchReg, cr); - } else { - __ li(reg, Operand(1)); + break; + case ne: + case ge: + case le: + if (reg_value != 1) __ li(reg, Operand(1)); + // r0 implies logical zero in this form __ isel(NegateCondition(cond), reg, r0, reg, cr); - } - break; + break; default: UNREACHABLE(); break; + } + } else { + if (reg_value != 0) __ li(reg, Operand::Zero()); + __ b(NegateCondition(cond), &done, cr); + __ li(reg, Operand(1)); } __ bind(&done); } diff --git a/deps/v8/src/d8.cc b/deps/v8/src/d8.cc index 58b59c890fac87..81b3a944103df3 100644 --- a/deps/v8/src/d8.cc +++ b/deps/v8/src/d8.cc @@ -26,10 +26,6 @@ #include "include/v8-testing.h" #endif // V8_SHARED -#if !defined(V8_SHARED) && defined(ENABLE_GDB_JIT_INTERFACE) -#include "src/gdb-jit.h" -#endif - #ifdef ENABLE_VTUNE_JIT_INTERFACE #include "src/third_party/vtune/v8-vtune.h" #endif @@ -2389,11 +2385,6 @@ int Shell::Main(int argc, char* argv[]) { Shell::array_buffer_allocator = &shell_array_buffer_allocator; } create_params.array_buffer_allocator = Shell::array_buffer_allocator; -#if !defined(V8_SHARED) && defined(ENABLE_GDB_JIT_INTERFACE) - if (i::FLAG_gdbjit) { - create_params.code_event_handler = i::GDBJITInterface::EventHandler; - } -#endif #ifdef ENABLE_VTUNE_JIT_INTERFACE create_params.code_event_handler = vTune::GetVtuneCodeEventHandler(); #endif diff --git a/deps/v8/src/dateparser-inl.h b/deps/v8/src/dateparser-inl.h index 8973aa0d4ff286..d405ab64935e49 100644 --- a/deps/v8/src/dateparser-inl.h +++ b/deps/v8/src/dateparser-inl.h @@ -23,9 +23,9 @@ bool DateParser::Parse(Vector str, DayComposer day; // Specification: - // Accept ES6 ISO 8601 date-time-strings or legacy dates compatible + // Accept ES5 ISO 8601 date-time-strings or legacy dates compatible // with Safari. - // ES6 ISO 8601 dates: + // ES5 ISO 8601 dates: // [('-'|'+')yy]yyyy[-MM[-DD]][THH:mm[:ss[.sss]][Z|(+|-)hh:mm]] // where yyyy is in the range 0000..9999 and // +/-yyyyyy is in the range -999999..+999999 - @@ -40,7 +40,8 @@ bool DateParser::Parse(Vector str, // sss is in the range 000..999, // hh is in the range 00..23, // mm, ss, and sss default to 00 if missing, and - // timezone defaults to local time if missing. + // timezone defaults to Z if missing + // (following Safari, ISO actually demands local time). // Extensions: // We also allow sss to have more or less than three digits (but at // least one). @@ -62,13 +63,15 @@ bool DateParser::Parse(Vector str, // is allowed). // Intersection of the two: // A string that matches both formats (e.g. 1970-01-01) will be - // parsed as an ES6 date-time string. - // After a valid "T" has been read while scanning an ES6 datetime string, + // parsed as an ES5 date-time string - which means it will default + // to UTC time-zone. That's unavoidable if following the ES5 + // specification. + // After a valid "T" has been read while scanning an ES5 datetime string, // the input can no longer be a valid legacy date, since the "T" is a // garbage string after a number has been read. - // First try getting as far as possible with as ES6 Date Time String. - DateToken next_unhandled_token = ParseES6DateTime(&scanner, &day, &time, &tz); + // First try getting as far as possible with as ES5 Date Time String. + DateToken next_unhandled_token = ParseES5DateTime(&scanner, &day, &time, &tz); if (next_unhandled_token.IsInvalid()) return false; bool has_read_number = !day.IsEmpty(); // If there's anything left, continue with the legacy parser. @@ -193,7 +196,7 @@ DateParser::DateToken DateParser::DateStringTokenizer::Scan() { template -DateParser::DateToken DateParser::ParseES6DateTime( +DateParser::DateToken DateParser::ParseES5DateTime( DateStringTokenizer* scanner, DayComposer* day, TimeComposer* time, @@ -231,7 +234,7 @@ DateParser::DateToken DateParser::ParseES6DateTime( if (!scanner->Peek().IsKeywordType(TIME_SEPARATOR)) { if (!scanner->Peek().IsEndOfInput()) return scanner->Next(); } else { - // ES6 Date Time String time part is present. + // ES5 Date Time String time part is present. scanner->Next(); if (!scanner->Peek().IsFixedLengthNumber(2) || !Between(scanner->Peek().number(), 0, 24)) { @@ -297,7 +300,8 @@ DateParser::DateToken DateParser::ParseES6DateTime( } if (!scanner->Peek().IsEndOfInput()) return DateToken::Invalid(); } - // Successfully parsed ES6 Date Time String. + // Successfully parsed ES5 Date Time String. Default to UTC if no TZ given. + if (tz->IsEmpty()) tz->Set(0); day->set_iso_date(); return DateToken::EndOfInput(); } diff --git a/deps/v8/src/dateparser.h b/deps/v8/src/dateparser.h index a9db8685d90466..aa57bb1c667f8e 100644 --- a/deps/v8/src/dateparser.h +++ b/deps/v8/src/dateparser.h @@ -368,13 +368,13 @@ class DateParser : public AllStatic { bool is_iso_date_; }; - // Tries to parse an ES6 Date Time String. Returns the next token + // Tries to parse an ES5 Date Time String. Returns the next token // to continue with in the legacy date string parser. If parsing is // complete, returns DateToken::EndOfInput(). If terminally unsuccessful, // returns DateToken::Invalid(). Otherwise parsing continues in the // legacy parser. template - static DateParser::DateToken ParseES6DateTime( + static DateParser::DateToken ParseES5DateTime( DateStringTokenizer* scanner, DayComposer* day, TimeComposer* time, diff --git a/deps/v8/src/debug/debug.js b/deps/v8/src/debug/debug.js index 2e51d4308894a0..a863ab9cdef07e 100644 --- a/deps/v8/src/debug/debug.js +++ b/deps/v8/src/debug/debug.js @@ -2416,7 +2416,7 @@ DebugCommandProcessor.prototype.restartFrameRequest_ = function( frame_mirror = this.exec_state_.frame(); } - var result_description = Debug.LiveEdit.RestartFrame(frame_mirror); + var result_description = frame_mirror.restart(); response.body = {result: result_description}; }; @@ -2607,6 +2607,9 @@ function ValueToProtocolValue_(value, mirror_serializer) { utils.InstallConstants(global, [ "Debug", Debug, "DebugCommandProcessor", DebugCommandProcessor, + "BreakEvent", BreakEvent, + "CompileEvent", CompileEvent, + "BreakPoint", BreakPoint, ]); // Functions needed by the debugger runtime. diff --git a/deps/v8/src/elements.cc b/deps/v8/src/elements.cc index 3e80d5570b90e4..caa596102f3535 100644 --- a/deps/v8/src/elements.cc +++ b/deps/v8/src/elements.cc @@ -1071,13 +1071,18 @@ class FastElementsAccessor } int num_used = 0; for (int i = 0; i < backing_store->length(); ++i) { - if (!backing_store->is_the_hole(i)) ++num_used; - // Bail out early if more than 1/4 is used. - if (4 * num_used > backing_store->length()) break; - } - if (4 * num_used <= backing_store->length()) { - JSObject::NormalizeElements(obj); + if (!backing_store->is_the_hole(i)) { + ++num_used; + // Bail out if a number dictionary wouldn't be able to save at least + // 75% space. + if (4 * SeededNumberDictionary::ComputeCapacity(num_used) * + SeededNumberDictionary::kEntrySize > + backing_store->length()) { + return; + } + } } + JSObject::NormalizeElements(obj); } } diff --git a/deps/v8/src/full-codegen/arm/full-codegen-arm.cc b/deps/v8/src/full-codegen/arm/full-codegen-arm.cc index 197a5ecc6fc1f9..56f7e62ded8bae 100644 --- a/deps/v8/src/full-codegen/arm/full-codegen-arm.cc +++ b/deps/v8/src/full-codegen/arm/full-codegen-arm.cc @@ -338,7 +338,7 @@ void FullCodeGenerator::Generate() { // redeclaration. if (scope()->HasIllegalRedeclaration()) { Comment cmnt(masm_, "[ Declarations"); - scope()->VisitIllegalRedeclaration(this); + VisitForEffect(scope()->GetIllegalRedeclaration()); } else { PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); diff --git a/deps/v8/src/full-codegen/arm64/full-codegen-arm64.cc b/deps/v8/src/full-codegen/arm64/full-codegen-arm64.cc index 73aaf46abde31a..96e8d957d5c543 100644 --- a/deps/v8/src/full-codegen/arm64/full-codegen-arm64.cc +++ b/deps/v8/src/full-codegen/arm64/full-codegen-arm64.cc @@ -344,7 +344,7 @@ void FullCodeGenerator::Generate() { // redeclaration. if (scope()->HasIllegalRedeclaration()) { Comment cmnt(masm_, "[ Declarations"); - scope()->VisitIllegalRedeclaration(this); + VisitForEffect(scope()->GetIllegalRedeclaration()); } else { PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); diff --git a/deps/v8/src/full-codegen/ia32/full-codegen-ia32.cc b/deps/v8/src/full-codegen/ia32/full-codegen-ia32.cc index 5aa64094413334..1503211b0b8b67 100644 --- a/deps/v8/src/full-codegen/ia32/full-codegen-ia32.cc +++ b/deps/v8/src/full-codegen/ia32/full-codegen-ia32.cc @@ -341,7 +341,7 @@ void FullCodeGenerator::Generate() { // redeclaration. if (scope()->HasIllegalRedeclaration()) { Comment cmnt(masm_, "[ Declarations"); - scope()->VisitIllegalRedeclaration(this); + VisitForEffect(scope()->GetIllegalRedeclaration()); } else { PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); diff --git a/deps/v8/src/full-codegen/mips/full-codegen-mips.cc b/deps/v8/src/full-codegen/mips/full-codegen-mips.cc index c8da77fba2128c..2f0173191b89ae 100644 --- a/deps/v8/src/full-codegen/mips/full-codegen-mips.cc +++ b/deps/v8/src/full-codegen/mips/full-codegen-mips.cc @@ -356,7 +356,7 @@ void FullCodeGenerator::Generate() { // redeclaration. if (scope()->HasIllegalRedeclaration()) { Comment cmnt(masm_, "[ Declarations"); - scope()->VisitIllegalRedeclaration(this); + VisitForEffect(scope()->GetIllegalRedeclaration()); } else { PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); diff --git a/deps/v8/src/full-codegen/mips64/full-codegen-mips64.cc b/deps/v8/src/full-codegen/mips64/full-codegen-mips64.cc index 231e8ba3840a77..db25e433dc240c 100644 --- a/deps/v8/src/full-codegen/mips64/full-codegen-mips64.cc +++ b/deps/v8/src/full-codegen/mips64/full-codegen-mips64.cc @@ -351,7 +351,7 @@ void FullCodeGenerator::Generate() { // redeclaration. if (scope()->HasIllegalRedeclaration()) { Comment cmnt(masm_, "[ Declarations"); - scope()->VisitIllegalRedeclaration(this); + VisitForEffect(scope()->GetIllegalRedeclaration()); } else { PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); diff --git a/deps/v8/src/full-codegen/ppc/full-codegen-ppc.cc b/deps/v8/src/full-codegen/ppc/full-codegen-ppc.cc index 656c37523247f4..5c25c6dc9ed959 100644 --- a/deps/v8/src/full-codegen/ppc/full-codegen-ppc.cc +++ b/deps/v8/src/full-codegen/ppc/full-codegen-ppc.cc @@ -349,7 +349,7 @@ void FullCodeGenerator::Generate() { // redeclaration. if (scope()->HasIllegalRedeclaration()) { Comment cmnt(masm_, "[ Declarations"); - scope()->VisitIllegalRedeclaration(this); + VisitForEffect(scope()->GetIllegalRedeclaration()); } else { PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); diff --git a/deps/v8/src/full-codegen/x64/full-codegen-x64.cc b/deps/v8/src/full-codegen/x64/full-codegen-x64.cc index 7e0553103f3fff..a9a5e162438a09 100644 --- a/deps/v8/src/full-codegen/x64/full-codegen-x64.cc +++ b/deps/v8/src/full-codegen/x64/full-codegen-x64.cc @@ -338,7 +338,7 @@ void FullCodeGenerator::Generate() { // redeclaration. if (scope()->HasIllegalRedeclaration()) { Comment cmnt(masm_, "[ Declarations"); - scope()->VisitIllegalRedeclaration(this); + VisitForEffect(scope()->GetIllegalRedeclaration()); } else { PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); diff --git a/deps/v8/src/full-codegen/x87/full-codegen-x87.cc b/deps/v8/src/full-codegen/x87/full-codegen-x87.cc index cfa752c19145db..fdf42cdb8a3c5b 100644 --- a/deps/v8/src/full-codegen/x87/full-codegen-x87.cc +++ b/deps/v8/src/full-codegen/x87/full-codegen-x87.cc @@ -338,7 +338,7 @@ void FullCodeGenerator::Generate() { // redeclaration. if (scope()->HasIllegalRedeclaration()) { Comment cmnt(masm_, "[ Declarations"); - scope()->VisitIllegalRedeclaration(this); + VisitForEffect(scope()->GetIllegalRedeclaration()); } else { PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); diff --git a/deps/v8/src/heap/heap.cc b/deps/v8/src/heap/heap.cc index 6c8c3ce34e0a92..edf9dea31dc7d8 100644 --- a/deps/v8/src/heap/heap.cc +++ b/deps/v8/src/heap/heap.cc @@ -2016,42 +2016,8 @@ Address Heap::DoScavenge(ObjectVisitor* scavenge_visitor, // for pointers to from semispace instead of looking for pointers // to new space. DCHECK(!target->IsMap()); - Address obj_address = target->address(); - - // We are not collecting slots on new space objects during mutation - // thus we have to scan for pointers to evacuation candidates when we - // promote objects. But we should not record any slots in non-black - // objects. Grey object's slots would be rescanned. - // White object might not survive until the end of collection - // it would be a violation of the invariant to record it's slots. - bool record_slots = false; - if (incremental_marking()->IsCompacting()) { - MarkBit mark_bit = Marking::MarkBitFrom(target); - record_slots = Marking::IsBlack(mark_bit); - } -#if V8_DOUBLE_FIELDS_UNBOXING - LayoutDescriptorHelper helper(target->map()); - bool has_only_tagged_fields = helper.all_fields_tagged(); - - if (!has_only_tagged_fields) { - for (int offset = 0; offset < size;) { - int end_of_region_offset; - if (helper.IsTagged(offset, size, &end_of_region_offset)) { - IterateAndMarkPointersToFromSpace( - target, obj_address + offset, - obj_address + end_of_region_offset, record_slots, - &ScavengeObject); - } - offset = end_of_region_offset; - } - } else { -#endif - IterateAndMarkPointersToFromSpace(target, obj_address, - obj_address + size, record_slots, - &ScavengeObject); -#if V8_DOUBLE_FIELDS_UNBOXING - } -#endif + + IteratePointersToFromSpace(target, size, &ScavengeObject); } } @@ -5184,6 +5150,68 @@ void Heap::IterateAndMarkPointersToFromSpace(HeapObject* object, Address start, } +void Heap::IteratePointersToFromSpace(HeapObject* target, int size, + ObjectSlotCallback callback) { + Address obj_address = target->address(); + + // We are not collecting slots on new space objects during mutation + // thus we have to scan for pointers to evacuation candidates when we + // promote objects. But we should not record any slots in non-black + // objects. Grey object's slots would be rescanned. + // White object might not survive until the end of collection + // it would be a violation of the invariant to record it's slots. + bool record_slots = false; + if (incremental_marking()->IsCompacting()) { + MarkBit mark_bit = Marking::MarkBitFrom(target); + record_slots = Marking::IsBlack(mark_bit); + } + + // Do not scavenge JSArrayBuffer's contents + switch (target->ContentType()) { + case HeapObjectContents::kTaggedValues: { + IterateAndMarkPointersToFromSpace(target, obj_address, obj_address + size, + record_slots, callback); + break; + } + case HeapObjectContents::kMixedValues: { + if (target->IsFixedTypedArrayBase()) { + IterateAndMarkPointersToFromSpace( + target, obj_address + FixedTypedArrayBase::kBasePointerOffset, + obj_address + FixedTypedArrayBase::kHeaderSize, record_slots, + callback); + } else if (target->IsJSArrayBuffer()) { + IterateAndMarkPointersToFromSpace( + target, obj_address, + obj_address + JSArrayBuffer::kByteLengthOffset + kPointerSize, + record_slots, callback); + IterateAndMarkPointersToFromSpace( + target, obj_address + JSArrayBuffer::kSize, obj_address + size, + record_slots, callback); +#if V8_DOUBLE_FIELDS_UNBOXING + } else if (FLAG_unbox_double_fields) { + LayoutDescriptorHelper helper(target->map()); + DCHECK(!helper.all_fields_tagged()); + + for (int offset = 0; offset < size;) { + int end_of_region_offset; + if (helper.IsTagged(offset, size, &end_of_region_offset)) { + IterateAndMarkPointersToFromSpace( + target, obj_address + offset, + obj_address + end_of_region_offset, record_slots, callback); + } + offset = end_of_region_offset; + } +#endif + } + break; + } + case HeapObjectContents::kRawValues: { + break; + } + } +} + + void Heap::IterateRoots(ObjectVisitor* v, VisitMode mode) { IterateStrongRoots(v, mode); IterateWeakRoots(v, mode); diff --git a/deps/v8/src/heap/heap.h b/deps/v8/src/heap/heap.h index 0da6f5e6c05ae4..a33a98226c6b91 100644 --- a/deps/v8/src/heap/heap.h +++ b/deps/v8/src/heap/heap.h @@ -961,6 +961,9 @@ class Heap { // Iterate pointers to from semispace of new space found in memory interval // from start to end within |object|. + void IteratePointersToFromSpace(HeapObject* target, int size, + ObjectSlotCallback callback); + void IterateAndMarkPointersToFromSpace(HeapObject* object, Address start, Address end, bool record_slots, ObjectSlotCallback callback); diff --git a/deps/v8/src/i18n.js b/deps/v8/src/i18n.js index 5fd32c8b407fd7..b825ece6bcde80 100644 --- a/deps/v8/src/i18n.js +++ b/deps/v8/src/i18n.js @@ -1103,14 +1103,15 @@ function initializeNumberFormat(numberFormat, locales, options) { var mnfd = options['minimumFractionDigits']; var mxfd = options['maximumFractionDigits']; - if (!IS_UNDEFINED(mnfd) || !internalOptions.style === 'currency') { + if (!IS_UNDEFINED(mnfd) || internalOptions.style !== 'currency') { mnfd = getNumberOption(options, 'minimumFractionDigits', 0, 20, 0); defineWEProperty(internalOptions, 'minimumFractionDigits', mnfd); } - if (!IS_UNDEFINED(mxfd) || !internalOptions.style === 'currency') { + if (!IS_UNDEFINED(mxfd) || internalOptions.style !== 'currency') { + var min_mxfd = internalOptions.style === 'percent' ? 0 : 3; mnfd = IS_UNDEFINED(mnfd) ? 0 : mnfd; - fallback_limit = (mnfd > 3) ? mnfd : 3; + fallback_limit = (mnfd > min_mxfd) ? mnfd : min_mxfd; mxfd = getNumberOption(options, 'maximumFractionDigits', mnfd, 20, fallback_limit); defineWEProperty(internalOptions, 'maximumFractionDigits', mxfd); } diff --git a/deps/v8/src/isolate.cc b/deps/v8/src/isolate.cc index f63d423fa741c4..5be41943288f26 100644 --- a/deps/v8/src/isolate.cc +++ b/deps/v8/src/isolate.cc @@ -1279,9 +1279,14 @@ void Isolate::ComputeLocation(MessageLocation* target) { Object* script = fun->shared()->script(); if (script->IsScript() && !(Script::cast(script)->source()->IsUndefined())) { - int pos = frame->LookupCode()->SourcePosition(frame->pc()); - // Compute the location from the function and the reloc info. Handle diff --git a/doc/thin-white-stripe.jpg b/doc/thin-white-stripe.jpg index 1b4be8d99437b8..5342304e79dae4 100644 Binary files a/doc/thin-white-stripe.jpg and b/doc/thin-white-stripe.jpg differ diff --git a/doc/topics/blocking-vs-non-blocking.md b/doc/topics/blocking-vs-non-blocking.md new file mode 100644 index 00000000000000..788887ae3b4a11 --- /dev/null +++ b/doc/topics/blocking-vs-non-blocking.md @@ -0,0 +1,143 @@ +# Overview of Blocking vs Non-Blocking + +This overview covers the difference between **blocking** and **non-blocking** +calls in Node.js. This overview will refer to the event loop and libuv but no +prior knowledge of those topics is required. Readers are assumed to have a +basic understanding of the JavaScript language and Node.js callback pattern. + +> "I/O" refers primarily to interaction with the system's disk and +network supported by [libuv](http://libuv.org/). + + +## Blocking + +**Blocking** is when the execution of additional JavaScript in the Node.js +process must wait until a non-JavaScript operation completes. This happens +because the event loop is unable to continue running JavaScript while a +**blocking** operation is occurring. + +In Node.js, JavaScript that exhibits poor performance due to being CPU intensive +rather than waiting on a non-JavaScript operation, such as I/O, isn't typically +referred to as **blocking**. Synchronous methods in the Node.js standard library +that use libuv are the most commonly used **blocking** operations. Native +modules may also have **blocking** methods. + +All of the I/O methods in the Node.js standard library provide asynchronous +versions, which are **non-blocking**, and accept callback functions. Some +methods also have **blocking** counterparts, which have names that end with +`Sync`. + + +## Comparing Code + +**Blocking** methods execute **synchronously** and **non-blocking** methods +execute **asynchronously**. + +Using the File System module as an example, this is a **synchronous** file read: + +```js +const fs = require('fs'); +const data = fs.readFileSync('/file.md'); // blocks here until file is read +``` + +And here is an equivalent **asynchronous** example: + +```js +const fs = require('fs'); +fs.readFile('/file.md', (err, data) => { + if (err) throw err; +}); +``` + +The first example appears simpler than the second but has the disadvantage of +the second line **blocking** the execution of any additional JavaScript until +the entire file is read. Note that in the synchronous version if an error is +thrown it will need to be caught or the process will crash. In the asynchronous +version, it is up to the author to decide whether an error should throw as +shown. + +Let's expand our example a little bit: + +```js +const fs = require('fs'); +const data = fs.readFileSync('/file.md'); // blocks here until file is read +console.log(data); +// moreWork(); will run after console.log +``` + +And here is a similar, but not equivalent asynchronous example: + +```js +const fs = require('fs'); +fs.readFile('/file.md', (err, data) => { + if (err) throw err; + console.log(data); +}); +// moreWork(); will run before console.log +``` + +In the first example above, `console.log` will be called before `moreWork()`. In +the second example `fs.readFile()` is **non-blocking** so JavaScript execution +can continue and `moreWork()` will be called first. The ability to run +`moreWork()` without waiting for the file read to complete is a key design +choice that allows for higher throughput. + + +## Concurrency and Throughput + +JavaScript execution in Node.js is single threaded, so concurrency refers to the +event loop's capacity to execute JavaScript callback functions after completing +other work. Any code that is expected to run in a concurrent manner must allow +the event loop to continue running as non-JavaScript operations, like I/O, are +occurring. + +As an example, let's consider a case where each request to a web server takes +50ms to complete and 45ms of that 50ms is database I/O that can be done +asychronously. Choosing **non-blocking** asynchronous operations frees up that +45ms per request to handle other requests. This is a significant difference in +capacity just by choosing to use **non-blocking** methods instead of +**blocking** methods. + +The event loop is different than models in many other languages where additional +threads may be created to handle concurrent work. + + +## Dangers of Mixing Blocking and Non-Blocking Code + +There are some patterns that should be avoided when dealing with I/O. Let's look +at an example: + +```js +const fs = require('fs'); +fs.readFile('/file.md', (err, data) => { + if (err) throw err; + console.log(data); +}); +fs.unlinkSync('/file.md'); +``` + +In the above example, `fs.unlinkSync()` is likely to be run before +`fs.readFile()`, which would delete `file.md` before it is actually read. A +better way to write this that is completely **non-blocking** and guaranteed to +execute in the correct order is: + + +```js +const fs = require('fs'); +fs.readFile('/file.md', (err, data) => { + if (err) throw err; + console.log(data); + fs.unlink('/file.md', (err) => { + if (err) throw err; + }); +}); +``` + +The above places a **non-blocking** call to `fs.unlink()` within the callback of +`fs.readFile()` which guarantees the correct order of operations. + + +## Additional Resources + +- [libuv](http://libuv.org/) +- [About Node.js](https://nodejs.org/en/about/) diff --git a/doc/topics/domain-postmortem.md b/doc/topics/domain-postmortem.md new file mode 100644 index 00000000000000..0a8a854a586647 --- /dev/null +++ b/doc/topics/domain-postmortem.md @@ -0,0 +1,299 @@ +# Domain Module Postmortem + +## Usability Issues + +### Implicit Behavior + +It's possible for a developer to create a new domain and then simply run +`domain.enter()`. Which then acts as a catch-all for any exception in the +future that couldn't be observed by the thrower. Allowing a module author to +intercept the exceptions of unrelated code in a different module. Preventing +the originator of the code from knowing about its own exceptions. + +Here's an example of how one indirectly linked modules can affect another: + +```js +// module a.js +const b = require('./b'); +const c = require('./c'); + + +// module b.js +const d = require('domain').create(); +d.on('error', () => { /* silence everything */ }); +d.enter(); + + +// module c.js +const dep = require('some-dep'); +dep.method(); // Uh-oh! This method doesn't actually exist. +``` + +Since module `b` enters the domain but never exits any uncaught exception will +be swallowed. Leaving module `c` in the dark as to why it didn't run the entire +script. Leaving a potentially partially populated `module.exports`. Doing this +is not the same as listening for `'uncaughtException'`. As the latter is +explicitly meant to globally catch errors. The other issue is that domains are +processed prior to any `'uncaughtException'` handlers, and prevent them from +running. + +Another issue is that domains route errors automatically if no `'error'` +handler was set on the event emitter. There is no opt-in mechanism for this, +and automatically propagates across the entire asynchronous chain. This may +seem useful at first, but once asynchronous calls are two or more modules deep +and one of them doesn't include an error handler the creator of the domain will +suddenly be catching unexpected exceptions, and the thrower's exception will go +unnoticed by the author. + +The following is a simple example of how a missing `'error'` handler allows +the active domain to hijack the error: + +```js +const domain = require('domain'); +const net = require('net'); +const d = domain.create(); +d.on('error', (err) => console.error(err.message)); + +d.run(() => net.createServer((c) => { + c.end(); + c.write('bye'); +}).listen(8000)); +``` + +Even manually removing the connection via `d.remove(c)` does not prevent the +connection's error from being automatically intercepted. + +Failures that plagues both error routing and exception handling are the +inconsistencies in how errors are bubbled. The following is an example of how +nested domains will and won't bubble the exception based on when they happen: + +```js +const domain = require('domain'); +const net = require('net'); +const d = domain.create(); +d.on('error', () => console.error('d intercepted an error')); + +d.run(() => { + const server = net.createServer((c) => { + const e = domain.create(); // No 'error' handler being set. + e.run(() => { + // This will not be caught by d's error handler. + setImmediate(() => { + throw new Error('thrown from setImmediate'); + }); + // Though this one will bubble to d's error handler. + throw new Error('immediately thrown'); + }); + }).listen(8080); +}); +``` + +It may be expected that nested domains always remain nested, and will always +propagate the exception up the domain stack. Or that exceptions will never +automatically bubble. Unfortunately both these situations occur, leading to +potentially confusing behavior that may even be prone to difficult to debug +timing conflicts. + + +### API Gaps + +While APIs based on using `EventEmitter` can use `bind()` and errback style +callbacks can use `intercept()`, alternative APIs that implicitly bind to the +active domain must be executed inside of `run()`. Meaning if module authors +wanted to support domains using a mechanism alternative to those mentioned they +must manually implement domain support themselves. Instead of being able to +leverage the implicit mechanisms already in place. + + +### Error Propagation + +Propagating errors across nested domains is not straight forward, if even +possible. Existing documentation shows a simple example of how to `close()` an +`http` server if there is an error in the request handler. What it does not +explain is how to close the server if the request handler creates another +domain instance for another async request. Using the following as a simple +example of the failing of error propagation: + +```js +const d1 = domain.create(); +d1.foo = true; // custom member to make more visible in console +d1.on('error', (er) => { /* handle error */ }); + +d1.run(() => setTimeout(() => { + const d2 = domain.create(); + d2.bar = 43; + d2.on('error', (er) => console.error(er.message, domain._stack)); + d2.run(() => { + setTimeout(() => { + setTimeout(() => { + throw new Error('outer'); + }); + throw new Error('inner') + }); + }); +})); +``` + +Even in the case that the domain instances are being used for local storage so +access to resources are made available there is still no way to allow the error +to continue propagating from `d2` back to `d1`. Quick inspection may tell us +that simply throwing from `d2`'s domain `'error'` handler would allow `d1` to +then catch the exception and execute its own error handler. Though that is not +the case. Upon inspection of `domain._stack` you'll see that the stack only +contains `d2`. + +This may be considered a failing of the API, but even if it did operate in this +way there is still the issue of transmitting the fact that a branch in the +asynchronous execution has failed, and that all further operations in that +branch must cease. In the example of the http request handler, if we fire off +several asynchronous requests and each one then `write()`'s data back to the +client many more errors will arise from attempting to `write()` to a closed +handle. More on this in _Resource Cleanup on Exception_. + + +### Resource Cleanup on Exception + +The script [`domain-resource-cleanup.js`](domain-resource-cleanup.js) +contains a more complex example of properly cleaning up in a small resource +dependency tree in the case that an exception occurs in a given connection or +any of its dependencies. Breaking down the script into its basic operations: + +- When a new connection happens, concurrently: + - Open a file on the file system + - Open Pipe to unique socket +- Read a chunk of the file asynchronously +- Write chunk to both the TCP connection and any listening sockets +- If any of these resources error, notify all other attached resources that + they need to clean up and shutdown + +As we can see from this example a lot more must be done to properly clean up +resources when something fails than what can be done strictly through the +domain API. All that domains offer is an exception aggregation mechanism. Even +the potentially useful ability to propagate data with the domain is easily +countered, in this example, by passing the needed resources as a function +argument. + +One problem domains perpetuated was the supposed simplicity of being able to +continue execution, contrary to what the documentation stated, of the +application despite an unexpected exception. This example demonstrates the +fallacy behind that idea. + +Attempting proper resource cleanup on unexpected exception becomes more complex +as the application itself grows in complexity. This example only has 3 basic +resources in play, and all of them with a clear dependency path. If an +application uses something like shared resources or resource reuse the ability +to cleanup, and properly test that cleanup has been done, grows greatly. + +In the end, in terms of handling errors, domains aren't much more than a +glorified `'uncaughtException'` handler. Except with more implicit and +unobservable behavior by third-parties. + + +### Resource Propagation + +Another use case for domains was to use it to propagate data along asynchronous +data paths. One problematic point is the ambiguity of when to expect the +correct domain when there are multiple in the stack (which must be assumed if +the async stack works with other modules). Also the conflict between being +able to depend on a domain for error handling while also having it available to +retrieve the necessary data. + +The following is a involved example demonstrating the failing using domains to +propagate data along asynchronous stacks: + +```js +const domain = require('domain'); +const net = require('net'); + +const server = net.createServer((c) => { + // Use a domain to propagate data across events within the + // connection so that we don't have to pass arguments + // everywhere. + const d = domain.create(); + d.data = { connection: c }; + d.add(c); + // Mock class that does some useless async data transformation + // for demonstration purposes. + const ds = new DataStream(dataTransformed); + c.on('data', (chunk) => ds.data(chunk)); +}).listen(8080, () => console.log(`listening on 8080`)); + +function dataTransformed(chunk) { + // FAIL! Because the DataStream instance also created a + // domain we have now lost the active domain we had + // hoped to use. + domain.active.data.connection.write(chunk); +} + +function DataStream(cb) { + this.cb = cb; + // DataStream wants to use domains for data propagation too! + // Unfortunately this will conflict with any domain that + // already exists. + this.domain = domain.create(); + this.domain.data = { inst: this }; +} + +DataStream.prototype.data = function data(chunk) { + // This code is self contained, but pretend it's a complex + // operation that crosses at least one other module. So + // passing along "this", etc., is not easy. + this.domain.run(function() { + // Simulate an async operation that does the data transform. + setImmediate(() => { + for (var i = 0; i < chunk.length; i++) + chunk[i] = ((chunk[i] + Math.random() * 100) % 96) + 33; + // Grab the instance from the active domain and use that + // to call the user's callback. + const self = domain.active.data.inst; + self.cb.call(self, chunk); + }); + }); +}; +``` + +The above shows that it is difficult to have more than one asynchronous API +attempt to use domains to propagate data. This example could possibly be fixed +by assigning `parent: domain.active` in the `DataStream` constructor. Then +restoring it via `domain.active = domain.active.data.parent` just before the +user's callback is called. Also the instantiation of `DataStream` in the +`'connection'` callback must be run inside `d.run()`, instead of simply using +`d.add(c)`, otherwise there will be no active domain. + +In short, for this to have a prayer of a chance usage would need to strictly +adhere to a set of guidelines that would be difficult to enforce or test. + + +## Performance Issues + +A significant deterrent from using domains is the overhead. Using node's +built-in http benchmark, `http_simple.js`, without domains it can handle over +22,000 requests/second. Whereas if it's run with `NODE_USE_DOMAINS=1` that +number drops down to under 17,000 requests/second. In this case there is only +a single global domain. If we edit the benchmark so the http request callback +creates a new domain instance performance drops further to 15,000 +requests/second. + +While this probably wouldn't affect a server only serving a few hundred or even +a thousand requests per second, the amount of overhead is directly proportional +to the number of asynchronous requests made. So if a single connection needs to +connect to several other services all of those will contribute to the overall +latency of delivering the final product to the client. + +Using `AsyncWrap` and tracking the number of times +`init`/`pre`/`post`/`destroy` are called in the mentioned benchmark we find +that the sum of all events called is over 170,000 times per second. This means +even adding 1 microsecond overhead per call for any type of setup or tear down +will result in a 17% performance loss. Granted, this is for the optimized +scenario of the benchmark, but I believe this demonstrates the necessity for a +mechanism such as domain to be as cheap to run as possible. + + +## Looking Ahead + +The domain module has been soft deprecated since Dec 2014, but has not yet been +removed because node offers no alternative functionality at the moment. As of +this writing there is ongoing work building out the `AsyncWrap` API and a +proposal for Zones being prepared for the TC39. At such time there is suitable +functionality to replace domains it will undergo the full deprecation cycle and +eventually be removed from core. diff --git a/doc/topics/domain-resource-cleanup-example.js b/doc/topics/domain-resource-cleanup-example.js new file mode 100644 index 00000000000000..d379d1a00e6695 --- /dev/null +++ b/doc/topics/domain-resource-cleanup-example.js @@ -0,0 +1,136 @@ +'use strict'; + +const domain = require('domain'); +const EE = require('events'); +const fs = require('fs'); +const net = require('net'); +const util = require('util'); +const print = process._rawDebug; + +const pipeList = []; +const FILENAME = '/tmp/tmp.tmp'; +const PIPENAME = '/tmp/node-domain-example-'; +const FILESIZE = 1024; +var uid = 0; + +// Setting up temporary resources +const buf = Buffer(FILESIZE); +for (var i = 0; i < buf.length; i++) + buf[i] = ((Math.random() * 1e3) % 78) + 48; // Basic ASCII +fs.writeFileSync(FILENAME, buf); + +function ConnectionResource(c) { + EE.call(this); + this._connection = c; + this._alive = true; + this._domain = domain.create(); + this._id = Math.random().toString(32).substr(2).substr(0, 8) + (++uid); + + this._domain.add(c); + this._domain.on('error', () => { + this._alive = false; + }); +} +util.inherits(ConnectionResource, EE); + +ConnectionResource.prototype.end = function end(chunk) { + this._alive = false; + this._connection.end(chunk); + this.emit('end'); +}; + +ConnectionResource.prototype.isAlive = function isAlive() { + return this._alive; +}; + +ConnectionResource.prototype.id = function id() { + return this._id; +}; + +ConnectionResource.prototype.write = function write(chunk) { + this.emit('data', chunk); + return this._connection.write(chunk); +}; + +// Example begin +net.createServer((c) => { + const cr = new ConnectionResource(c); + + const d1 = domain.create(); + fs.open(FILENAME, 'r', d1.intercept((fd) => { + streamInParts(fd, cr, 0); + })); + + pipeData(cr); + + c.on('close', () => cr.end()); +}).listen(8080); + +function streamInParts(fd, cr, pos) { + const d2 = domain.create(); + var alive = true; + d2.on('error', (er) => { + print('d2 error:', er.message) + cr.end(); + }); + fs.read(fd, new Buffer(10), 0, 10, pos, d2.intercept((bRead, buf) => { + if (!cr.isAlive()) { + return fs.close(fd); + } + if (cr._connection.bytesWritten < FILESIZE) { + // Documentation says callback is optional, but doesn't mention that if + // the write fails an exception will be thrown. + const goodtogo = cr.write(buf); + if (goodtogo) { + setTimeout(() => streamInParts(fd, cr, pos + bRead), 1000); + } else { + cr._connection.once('drain', () => streamInParts(fd, cr, pos + bRead)); + } + return; + } + cr.end(buf); + fs.close(fd); + })); +} + +function pipeData(cr) { + const pname = PIPENAME + cr.id(); + const ps = net.createServer(); + const d3 = domain.create(); + const connectionList = []; + d3.on('error', (er) => { + print('d3 error:', er.message); + cr.end(); + }); + d3.add(ps); + ps.on('connection', (conn) => { + connectionList.push(conn); + conn.on('data', () => {}); // don't care about incoming data. + conn.on('close', () => { + connectionList.splice(connectionList.indexOf(conn), 1); + }); + }); + cr.on('data', (chunk) => { + for (var i = 0; i < connectionList.length; i++) { + connectionList[i].write(chunk); + } + }); + cr.on('end', () => { + for (var i = 0; i < connectionList.length; i++) { + connectionList[i].end(); + } + ps.close(); + }); + pipeList.push(pname); + ps.listen(pname); +} + +process.on('SIGINT', () => process.exit()); +process.on('exit', () => { + try { + for (var i = 0; i < pipeList.length; i++) { + fs.unlinkSync(pipeList[i]); + } + fs.unlinkSync(FILENAME); + } catch (e) { } +}); diff --git a/doc/topics/the-event-loop-timers-and-nexttick.md b/doc/topics/the-event-loop-timers-and-nexttick.md new file mode 100644 index 00000000000000..2676b94da37ef4 --- /dev/null +++ b/doc/topics/the-event-loop-timers-and-nexttick.md @@ -0,0 +1,467 @@ +# The Node.js Event Loop, Timers, and `process.nextTick()` + +## What is the Event Loop? + +The event loop is what allows Node.js to perform non-blocking I/O +operations — despite the fact that JavaScript is single-threaded — by +offloading operations to the system kernel whenever possible. + +Since most modern kernels are multi-threaded, they can handle multiple +operations executing in the background. When one of these operations +completes, the kernel tells Node.js so that the appropriate callback +may added to the `poll` queue to eventually be executed. We'll explain +this in further detail later in this topic. + +## Event Loop Explained + +When Node.js starts, it initializes the event loop, processes the +provided input script (or drops into the REPL, which is not covered in +this document) which may make async API calls, schedule timers, or call +`process.nextTick()`, then begins processing the event loop. + +The following diagram shows a simplified overview of the event loop's +order of operations. + + ┌───────────────────────┐ + ┌─>│ timers │ + │ └──────────┬────────────┘ + │ ┌──────────┴────────────┐ + │ │ I/O callbacks │ + │ └──────────┬────────────┘ + │ ┌──────────┴────────────┐ + │ │ idle, prepare │ + │ └──────────┬────────────┘ ┌───────────────┐ + │ ┌──────────┴────────────┐ │ incoming: │ + │ │ poll │<─────┤ connections, │ + │ └──────────┬────────────┘ │ data, etc. │ + │ ┌──────────┴────────────┐ └───────────────┘ + │ │ check │ + │ └──────────┬────────────┘ + │ ┌──────────┴────────────┐ + └──┤ close callbacks │ + └───────────────────────┘ + +*note: each box will be referred to as a "phase" of the event loop.* + +Each phase has a FIFO queue of callbacks to execute. While each phase is +special in its own way, generally, when the event loop enters a given +phase, it will perform any operations specific to that phase, then +execute callbacks in that phase's queue until the queue has been +exhausted or the maximum number of callbacks have executed. When the +queue has been exhausted or the callback limit is reached, the event +loop will move to the next phase, and so on. + +Since any of these operations may schedule _more_ operations and new +events processed in the `poll` phase are queued by the kernel, poll +events can be queued while polling events are being processed. As a +result, long running callbacks can allow the poll phase to run much +longer than a timer's threshold. See the [`timers`](#timers) and +[`poll`](#poll) sections for more details. + +_**NOTE:** There is a slight discrepancy between the Windows and the +Unix/Linux implementation, but that's not important for this +demonstration. The most important parts are here. There are actually +seven or eight steps, but the ones we care about — ones that Node.js +actually uses are those above._ + + +## Phases Overview: + +* `timers`: this phase executes callbacks scheduled by `setTimeout()` + and `setInterval()`. +* `I/O callbacks`: most types of callback except timers, setImmedate, close +* `idle, prepare`: only used internally +* `poll`: retrieve new I/O events; node will block here when appropriate +* `check`: setImmediate callbacks are invoked here +* `close callbacks`: e.g socket.on('close', ...) + +Between each run of the event loop, Node.js checks if it is waiting for +any asynchronous I/O or timer and it shuts down cleanly if there are not +any. + +## Phases in Detail + +### timers + +A timer specifies the **threshold** _after which_ a provided callback +_may be executed_ rather than the **exact** time a person _wants it to +be executed_. Timers callbacks will run as early as they can be +scheduled after the specified amount of time has passed; however, +Operating System scheduling or the running of other callbacks may delay +them. + +_**Note**: Technically, the [`poll` phase](#poll) controls when timers +are executed._ + +For example, say you schedule a timeout to execute after a 100 ms +threshold, then your script starts asynchronously reading a file which +takes 95 ms: + +```js + +var fs = require('fs'); + +function someAsyncOperation (callback) { + + // let's assume this takes 95ms to complete + fs.readFile('/path/to/file', callback); + +} + +var timeoutScheduled = Date.now(); + +setTimeout(function () { + + var delay = Date.now() - timeoutScheduled; + + console.log(delay + "ms have passed since I was scheduled"); +}, 100); + + +// do someAsyncOperation which takes 95 ms to complete +someAsyncOperation(function () { + + var startCallback = Date.now(); + + // do something that will take 10ms... + while (Date.now() - startCallback < 10) { + ; // do nothing + } + +}); +``` + +When the event loop enters the `poll` phase, it has an empty queue +(`fs.readFile()` has not completed) so it will wait for the number of ms +remaining until the soonest timer's threshold is reached. While it is +waiting 95 ms pass, `fs.readFile()` finishes reading the file and its +callback which takes 10 ms to complete is added to the `poll` queue and +executed. When the callback finishes, there are no more callbacks in the +queue, so the event loop will see that the threshold of the soonest +timer has been reached then wrap back to the `timers` phase to execute +the timer's callback. In this example, you will see that the total delay +between the timer being scheduled and its callback being executed will +be 105ms. + +Note: To prevent the `poll` phase from starving the event loop, libuv +also has a hard maximum (system dependent) before it stops `poll`ing for +more events. + +### I/O callbacks: + +This phase executes callbacks for some system operations such as types +of TCP errors. For example if a TCP socket receives `ECONNREFUSED` when +attempting to connect, some \*nix systems want to wait to report the +error. This will be queued to execute in the `I/O callbacks` phase. + +### poll: + +The poll phase has two main functions: + +1. Executing scripts for timers who's threshold has elapsed, then +2. Processing events in the `poll` queue. + + +When the event loop enters the `poll` phase _and there are no timers +scheduled_, one of two things will happen: + +* _If the `poll` queue **is not empty**_, the event loop will iterate +through its queue of callbacks executing them synchronously until +either the queue has been exhausted, or the system-dependent hard limit +is reached. + +* _If the `poll` queue is **empty**, one of two more things will +happen: + * If scripts have been scheduled by `setImmediate()`, the event loop + will end the `poll` phase and continue to the `check` phase to + execute those scheduled scripts. + + * If scripts **have not** been scheduled by `setImmediate()`, the + event loop will wait for callbacks to be added to the queue, then + execute it immediately. + +Once the `poll` queue is empty the event loop will check for timers +_whose time thresholds have been reached_. If one or more timers are +ready, the event loop will wrap back to the timers phase to execute +those timers' callbacks. + +### `check`: + +This phase allows a person to execute callbacks immediately after the +`poll` phase has completed. If the `poll` phase becomes idle and +scripts have been queued with `setImmediate()`, the event loop may +continue to the `check` phase rather than waiting. + +`setImmediate()` is actually a special timer that runs in a separate +phase of the event loop. It uses a libuv API that schedules callbacks to +execute after the `poll` phase has completed. + +Generally, as the code is executed, the event loop will eventually hit +the `poll` phase where it will wait for an incoming connection, request, +etc. However, after a callback has been scheduled with `setImmediate()`, +then the `poll` phase becomes idle, it will end and continue to the +`check` phase rather than waiting for `poll` events. + +### `close callbacks`: + +If a socket or handle is closed abruptly (e.g. `socket.destroy()`), the +`'close'` event will be emitted in this phase. Otherwise it will be +emitted via `process.nextTick()`. + +## `setImmediate()` vs `setTimeout()` + +`setImmediate` and `setTimeout()` are similar, but behave in different +ways depending on when they are called. + +* `setImmediate()` is designed to execute a script once the current +`poll` phase completes. +* `setTimeout()` schedules a script to be run +after a minimum threshold in ms has elapsed. + +The order in which they are execute varies depending on the context in +which they are called. If both are called in the main module then you +are bound to how fast your process go, which is impacted by other +programs running on your machine. + +For example, if we run the following script which is not within a I/O +cycle (i.e. the main module), the order in which the two functions are +executed is non-deterministic as it is based upon how fast your process +goes (which is impacted by other programs running on your machine): + + +```js +// timeout_vs_immediate.js +setTimeout(function timeout () { + console.log('timeout'); +},0); + +setImmediate(function immediate () { + console.log('immediate'); +}); +``` + + $ node timeout_vs_immediate.js + timeout + immediate + + $ node timeout_vs_immediate.js + immediate + timeout + + +However, if you move the two calls within an I/O cycle, the immediate +callback is always executed first: + +```js +// timeout_vs_immediate.js +var fs = require('fs') + +fs.readFile(__filename, () => { + setTimeout(() => { + console.log('timeout') + }, 0) + setImmediate(() => { + console.log('immediate') + }) +}) +``` + + $ node timeout_vs_immediate.js + immediate + timeout + + $ node timeout_vs_immediate.js + immediate + timeout + +The main advantage to using `setImmediate()` over `setTimeout()` is +`setImmediate()` will always be executed before any timers if scheduled +within an I/O cycle, independently of how many timers are present. + +## `process.nextTick()`: + +### Understanding `process.nextTick()` + +You may have noticed that `process.nextTick()` was not displayed in the +diagram, even though its a part of the asynchronous API. This is because +`process.nextTick()` is not technically part of the event loop. Instead, +the nextTickQueue will be processed after the current operation +completes, regardless of the current `phase` of the event loop. + +Looking back at our diagram, any time you call `process.nextTick()` in a +given phase, all callbacks passed to `process.nextTick()` will be +resolved before the event loop continues. This can create some bad +situations because **it allows you to "starve" your I/O by making +recursive `process.nextTick()` calls.** which prevents the event loop +from reaching the `poll` phase. + +### Why would that be allowed? + +Why would something like this be included in Node.js? Part of it is a +design philosophy where an API should always be asynchronous even where +it doesn't have to be. Take this code snippet for example: + +```js +function apiCall (arg, callback) { + if (typeof arg !== 'string') + return process.nextTick(callback, + new TypeError('argument should be string')); +} +``` + +The snippet does an argument check and if it's not correct, it will pass +the error to the callback. The API updated fairly recently to allow +passing arguments to `process.nextTick()` allowing it to take any +arguments passed after the callback to be propagated as the arguments to +the callback so you don't have to nest functions. + +What we're doing is passing an error back to the user but only *after* +we have allowed the rest of the user's code to execute. By using +`process.nextTick()` we guarantee that `apiCall()` always runs its +callback *after* the rest of the user's code and *before* the event loop +is allowed to proceed. To acheive this, the JS call stack is allowed to +unwind then immediately execute the provided callback which allows a +person to make recursive calls to nextTick without reaching a +`RangeError: Maximum call stack size exceeded from v8`. + +This philosophy can lead to some potentially problematic situations. +Take this snippet for example: + +```js +// this has an asynchronous signature, but calls callback synchronously +function someAsyncApiCall (callback) { callback(); }; + +// the callback is called before `someAsyncApiCall` completes. +someAsyncApiCall(() => { + + // since someAsyncApiCall has completed, bar hasn't been assigned any value + console.log('bar', bar); // undefined + +}); + +var bar = 1; +``` + +The user defines `someAsyncApiCall()` to have an asynchronous signature, +actually operates synchronously. When it is called, the callback +provided to `someAsyncApiCall ()` is called in the same phase of the +event loop because `someAsyncApiCall()` doesn't actually do anything +asynchronously. As a result, the callback tries to reference `bar` but +it may not have that variable in scope yet because the script has not +been able to run to completion. + +By placing it in a `process.nextTick()`, the script still has the +ability to run to completion, allowing all the variables, functions, +etc., to be initialized prior to the callback being called. It also has +the advantage of not allowing the event loop to continue. It may be +useful that the user be alerted to an error before the event loop is +allowed to continue. + +A real world example in node would be: + +```js +const server = net.createServer(() => {}).listen(8080); + +server.on('listening', () => {}); +``` + +When only a port is passed the port is bound immediately. So the +`'listening'` callback could be called immediately. Problem is that the +`.on('listening')` will not have been set by that time. + +To get around this the `'listening'` event is queued in a `nextTick()` +to allow the script to run to completion. Which allows the user to set +any event handlers they want. + +## `process.nextTick()` vs `setImmediate()` + +We have two calls that are similar as far as users are concerned, but +their names are confusing. + +* `process.nextTick()` fires immediately on the same phase +* `setImmediate()` fires on the following iteration or 'tick' of the +event loop + +In essence, the names should be swapped. `process.nextTick()` fires more +immediately than `setImmediate()` but this is an artifact of the past +which is unlikely to change. Making this switch would break a large +percentage of the packages on npm. Every day more new modules are being +added, which mean every day we wait, more potential breakages occur. +While they are confusing, the names themselves won't change. + +*We recommend developers use `setImmediate()` in all cases because its +easier to reason about (and it leads to code that's compatible with a +wider variety of environments, like browser JS.)* + +## Why use `process.nextTick()`? + +There are two main reasons: + +1. Allow users to handle errors, cleanup any then unneeded resources, or +perhaps try the request again before the event loop continues. + +2. At times it's necessary to allow a callback to run after the call +stack has unwound but before the event loop continues. + +One example is to match the user's expectations. Simple example: + +```js +var server = net.createServer(); +server.on('connection', function(conn) { }); + +server.listen(8080); +server.on('listening', function() { }); +``` + +Say that listen() is run at the beginning of the event loop, but the +listening callback is placed in a `setImmediate()`. Now, unless a +hostname is passed binding to the port will happen immediately. Now for +the event loop to proceed it must hit the `poll` phase, which means +there is a non-zero chance that a connection could have been received +allowing the connection event to be fired before the listening event. + +Another example is running a function constructor that was to, say, +inherit from `EventEmitter` and it wanted to call an event within the +constructor: + +```js +const EventEmitter = require('events'); +const util = require('util'); + +function MyEmitter() { + EventEmitter.call(this); + this.emit('event'); +} +util.inherits(MyEmitter, EventEmitter); + +const myEmitter = new MyEmitter(); +myEmitter.on('event', function() { + console.log('an event occurred!'); +}); +``` + +You can't emit an event from the constructor immediately +because the script will not have processed to the point where the user +assigns a callback to that event. So, within the constructor itself, +you can use `process.nextTick()` to set a callback to emit the event +after the constructor has finished, which provides the expected results: + +```js +const EventEmitter = require('events'); +const util = require('util'); + +function MyEmitter() { + EventEmitter.call(this); + + // use nextTick to emit the event once a handler is assigned + process.nextTick(function () { + this.emit('event'); + }.bind(this)); +} +util.inherits(MyEmitter, EventEmitter); + +const myEmitter = new MyEmitter(); +myEmitter.on('event', function() { + console.log('an event occurred!'); +}); +``` diff --git a/doc/tsc-meetings/2015-09-30.md b/doc/tsc-meetings/2015-09-30.md new file mode 100644 index 00000000000000..0b2b2c8f32e6d8 --- /dev/null +++ b/doc/tsc-meetings/2015-09-30.md @@ -0,0 +1,161 @@ +# Node Foundation TSC Meeting 2015-09-30 + +## Links + +* **Audio Recording**: https://soundcloud.com/node-foundation/tsc-meeting-2015-09-30 +* **GitHub Issue**: https://github.com/nodejs/node/issues/3126 +* **Minutes Google Doc**: https://docs.google.com/document/d/1RkLAWTIrhD3BTB2rs9_FahWI0C7lt9F8xnQXaueJPIE +* _Previous Minutes Google Doc: _ + +## Present + +* Rod Vagg (TSC) +* Brian White (TSC) +* Chris Dickinson (TSC) +* James Snell (TSC) +* Michael Dawson +* Ben Noordhuis (TSC) +* Steven R Loomis +* Bert Belder (TSC) +* Alexis Campailla (TSC) +* Domenic Denicola +* Seth Thompson + +## Agenda + +Extracted from **tsc-agenda** labelled issues and pull requests in the nodejs org prior to meeting. + +### nodejs/node + +* Discussion: LTS & v5 release planning [#3000](https://github.com/nodejs/node/issues/3000) +* Inspecting Node.js with Chrome DevTools [#2546](https://github.com/nodejs/node/issues/2546) + +### nodejs/TSC + +* Umbrella Program [#2](https://github.com/nodejs/TSC/pull/2) + +## Minutes + +### Standup + +* Rod Vagg (TSC) - Lots! Pass. +* Brian White (TSC) - DNS PR (querying NSS modules like mDNS works now, continuing work on other getnameinfo/getaddrinfo compat issues) +* Chris Dickinson (TSC) - Static Analysis +* James Snell (TSC) - Review of the HTTP module, going in depth with spec compliance +* Michael Dawson - AIX, contributing changes from IBM repos, node-gyp, all related to getting native modules working on AIX, submitted PR to core, benchmarking — bare metal machine for benchmarking group, backporting test fix to 0.12, FIPS-compat work on the test suite, getting hooked into v8 security reporting +* Ben Noordhuis (TSC) - Review PRs, bug reports, fixed 1-2 bugs, sent a few patches upstream to V8 and gyp, fixed a few bugs in node-gyp. +* Steven R Loomis - Review PRs, bug reports. Looking into alternatives to packaging full ICU data. Might be able to `npm install` ICU data. +* Bert Belder (TSC) - +* Alexis Campailla (TSC) - working on Node-serialport on Windows in Jenkins, looking into native module build service +* Domenic Denicola - v8-extras are starting to appear in Chrome, maybe use them in Node for startup performance. + +### Review of previous meeting + +* Deprecate Array#values() in 0.12.x [#25877](https://github.com/nodejs/node-v0.x-archive/issues/25877) +* Deprecate smalloc in v0.12 [#25784](https://github.com/nodejs/node-v0.x-archive/issues/25784) +* Inspecting Node.js with Chrome DevTools [#2546](https://github.com/nodejs/node/issues/2546) +* util: Remove p, has been deprecated for years [#2529](https://github.com/nodejs/node/pull/2529) + +### Discussion: LTS & v5 release planning [#3000](https://github.com/nodejs/node/issues/3000) + +(Chris: apologies, I did a bad job here.) + +Ben: Plan is to ship the first LTS release with v8 4.5, not 4.6 + +Rod: Yes. + +Ben: Is there a pressing reason to do so? + +Rod: LTS comes off the v4.x branch, we committed to not bump V8 in stable releases. + +Ben: It basically means that the first LTS release is going to ship with an outdated release. + +James: Yes, we knew this was a strong possibility. + +Michael: The model is that we give the community time to catch up. In the future that’s 6 months, so we’re never going to be on a supported version. + +Ben: V8 moves quickly. If we stick with 4.5, we’re going to have to manage a bigger delta between our copy and upstream. + +James: Yes, this was always going to be the case. We’re committed to supporting the V8 for 36 months. + +Ben: Yes, my point is that we could be starting with a smaller delta. + +Rod: One of the reasons we had this LTS delay on 4 is to shake out some of these concerns, like the buffer changes. Normally this shakeout will be 6 months, but this time it’s only been a month. + +Alexis: Is v5 going to be LTS also? + +Rod: We are having discussions about the overlap between v5 and v6, whether there’ll be a strict cutoff or some overlap. No decision yet. That’ll happen in April. It sounds like most folks are leaning towards +making the two releases (v4 LTS + v5) independent — option 1 [here](https://github.com/nodejs/node/issues/3000#issuecomment-144026295). + +Ben: We still haven’t come up with a way to maintain V8 going forward. + +James: We do need a good process there, you are absolutely right about that. + +Rod: I vote for IBM to hire someone dedicated to this. (Laughter) + +Michael: I can’t promise that at this point. + +Rod: As the delta increases between versions this becomes more concerning. + +James: make sure this is on the LTS WG agenda for next week. + +Rod: We tried to tackle this once before, came up with job description but nothing concrete. + +Michael: We stopped short of telling the foundation that this is a position that we need to staff. + +James: I would agree. We’re at the point where bringing someone in at the foundation level is probably a good idea. + +Rod: Noted. OK. We’ve got resolution there. + +Michael: James: Make sure it’s on the LTS agenda for going back to the foundation for resources. + +Rod: LTS is meeting this Monday (issue 43 on the repo). There’s some discussion around codenames and how to expose LTS info. We’ve committed to first week of October for LTS releases, so timing is going to be a little awkward with 4.1.2 coming out monday. Version 5 will be shipping when we have a stable V8, presumably mid-to-late october (1-3 weeks with no stable release line.) + +Rod: We’ll be pulling in semver minor and patch changes, we’ll continue to have bugfix releases for version 4, + +### Inspecting Node.js with Chrome DevTools [#2546](https://github.com/nodejs/node/issues/2546) + +Rod: Trevor is lead on this, but isn’t present. Does anyone else have any updates? + +Ben: Wasn’t the last contentious issue putting WS in core? I think we agreed that if it’s not exposed to user-land, it's fine. + +Alexis: (discussion of another WS issue) + +Bert: we decided on this + +Ben: We agreed that if it was internal, non-exposed to core, + +(Talk about native deps for WS, buffer-util can be ) + +Ben: if this is a private dependency, we don’t need it to be fast, so we don’t necessarily need the native deps. + +Chris: (Hopped into discussion from minute-taking, hence the bad minutes) +https://github.com/nodejs/node/pull/1202 - add mask/unmask +https://github.com/nodejs/node/pull/1319 - add utf8 validator + +### Umbrella Program [#2](https://github.com/nodejs/TSC/pull/2) + +Ben: it’s basically a template for describing projects that are under the umbrella of the node foundation. It doesn’t look that controversial to me. + +Rod: it also doesn’t look that complete. + +Ben: Indeed. I suggest we discuss next week when mikeal is on the call. Seems like a rubber-stamp LGTM to me. + +Rod: We should think about what projects we want to introduce to the organization, including what happens to competition in the ecosystem when we pull in things (like build tools) +Domenic: This is for things like libuv, yes? + +Rod: There are already npm projects knocking on the door. One such project is request. It has its own org right now, but could work under the auspices of the node foundation. However it exists in an ecosystem where there is competition — is it okay for us to bless one project over others? NAN is sort of in the same position, it _could_ have competition. Another example is the npm client possibly. If the foundation were in a position to take npm would we even want it? + +### renaming of “language groups” from iojs-\* to nodejs-\* [#2525](https://github.com/nodejs/node/issues/2525) + +Steven: Looking for buyoff on this. + +Ben: Seen the approach and it looks good. + +Rod: You should take this as “you have authority to move ahead”. + +Steven: Will do. + +### Next Meeting + +October 7th diff --git a/doc/tsc-meetings/2015-10-07.md b/doc/tsc-meetings/2015-10-07.md new file mode 100644 index 00000000000000..6cb8813a5cac02 --- /dev/null +++ b/doc/tsc-meetings/2015-10-07.md @@ -0,0 +1,102 @@ +# Node Foundation TSC Meeting 2015-10-07 + +## Links + +* **Audio Recording**: https://soundcloud.com/node-foundation/tsc-meeting-2015-10-07 +* **GitHub Issue**: https://github.com/nodejs/node/issues/3126 +* **Minutes Google Doc**: https://docs.google.com/document/d/1LIrTCdTUjKtb_GGecrJ3Es0rPOpVdpkV5kefJ_p5FGU +* _Previous Minutes Google Doc: _ + +## Present + +* Rod Vagg (TSC) +* Brian White (TSC) +* Steven Loomis (observer) +* Trevor Norris (TSC) +* Shigeki Ohtsu (TSC) +* Ben Noordhuis (TSC) +* Mikeal Rogers (observer) +* Michael Dawson (observer) +* Seth Thompson (observer) +* Jeremiah Senkpiel (TSC) + +## Agenda + +Extracted from **tsc-agenda** labelled issues and pull requests in the nodejs org prior to meeting. + +### nodejs/node + +* WG: Considering a new HTTP WG [#3214](https://github.com/nodejs/node/issues/3214) +* lib,test: deprecate _linklist [#3078](https://github.com/nodejs/node/pull/3078) +* Discussion: LTS & v5 release planning [#3000](https://github.com/nodejs/node/issues/3000) +* Compiling node v4.0.0 with OpenSSL 1.0.1 fails [#2783](https://github.com/nodejs/node/issues/2783) +* Inspecting Node.js with Chrome DevTools [#2546](https://github.com/nodejs/node/issues/2546) + +### nodejs/TSC + +* Umbrella Program [#2](https://github.com/nodejs/TSC/pull/2) + +## Minutes + +### Standup + +* Rod Vagg: 4.1.2 release, security procedures surrounding that +* Brian White: Working on javascript dns resolver, regular PR + Issue work. +* Steven Loomis: Working on ICU 56 Release. TC 39 & emca spec work for Intl WG. Working on Intl build issues. +* Trevor Norris: Focused on fixing async_wrap, writing tests and preparing for it to become more official +* Shigeki Ohtsu: No works for node project, I spent all time to my internal works. +* Ben Noordhuis: Nothing to report—the usual +* Mikeal Rogers: Looking into stalled Wgs and seeing how to help out. Working on the umbrella program. Lots of conference things. +* Michael Dawson: Added a benchmarking machine to the CI, working on some tests issues. Working on PPC for the CI. +* Seth Thompson: Working on v8 4.7, scheduled soon +* Jeremiah Senkpiel: vacation, some issue catch-up + +### Review of previous meeting + +* Discussion: LTS & v5 release planning [#3000](https://github.com/nodejs/node/issues/3000) +* Inspecting Node.js with Chrome DevTools [#2546](https://github.com/nodejs/node/issues/2546) +* Umbrella Program [#2](https://github.com/nodejs/TSC/pull/2) +* renaming of “language groups” from iojs-\* to nodejs-\* [#2525](https://github.com/nodejs/node/issues/2525) + + +### WG: Considering a new HTTP WG [#3214](https://github.com/nodejs/node/issues/3214) + +* Discussed the HTTP WG based on James’ comments @ https://github.com/nodejs/node/issues/3234#issuecomment-146293038 +* Generally positive, only concerns are regarding decision making power—TSC may not want to hand that off as this is not quite like Streams (in that few people grok the code!) and there are philosophical questions to be resolved about HTTP that the TSC should be involved in. + +### lib,test: deprecate _linklist [#3078](https://github.com/nodejs/node/pull/3078) + +* Userland modules exist that could be used instead +* Ben suggested straight removal, Jeramiah raised the matter of process that we have committed to adding a warning before removal, so we could remove in v6 but probably shouldn’t in v5 +* No disagreement with moving forward for deprecation + +### Discussion: LTS & v5 release planning [#3000](https://github.com/nodejs/node/issues/3000) + +* Recap of the latest LTS meeting [LTS#43](https://github.com/nodejs/LTS/issues/43) +* Aim to have LTS / v4.2.0 out tomorrow, backup date of Monday if we miss that. LTS starts then for v4.x, v5.x has to wait until V8 4.6 to be stable mid to late October. + +### Compiling node v4.0.0 with OpenSSL 1.0.1 fails [#2783](https://github.com/nodejs/node/issues/2783) + +* Shigeki, Ben: It would be quite hard to support 1.0.1 since we are using 1.0.2 APIs. + +* Discussion on the possible difficulty of using 1.0.2 on varied Linux distros + +* ubuntu wily (not released) seems to use 1.0.2 - work has been done to package. 1.0.2 is only in Wily - https://launchpad.net/ubuntu/+source/openssl/1.0.2d-0ubuntu1 - https://answers.launchpad.net/ubuntu/+source/openssl/+question/263725 - “My guess is that we will see openssl 1.0.2 from Ubuntu 15.10 onwards (or eventually only starting with 16.04)” + +* Concern that allowing 1.0.1 would result in a substandard (insecure?) & untested binary. + +* Some discussion about the fact that we don’t test building with shared / static dependencies + +* feedback to issue: No appetite to do the work from the TSC, maybe someone could do it but we wouldn’t support. + +### Inspecting Node.js with Chrome DevTools [#2546](https://github.com/nodejs/node/issues/2546) + +_skipped discussion_ + +### Umbrella Program [#2](https://github.com/nodejs/TSC/pull/2) + +_skipped discussion_ + +## Next Meeting + +October 14th, 2015 diff --git a/doc/tsc-meetings/2015-10-14.md b/doc/tsc-meetings/2015-10-14.md new file mode 100644 index 00000000000000..65a0f467cdffb3 --- /dev/null +++ b/doc/tsc-meetings/2015-10-14.md @@ -0,0 +1,121 @@ +# Node Foundation TSC Meeting 2015-10-14 + +## Links + +* **Audio Recording**: https://soundcloud.com/node-foundation/tsc-meeting-2015-10-14 +* **GitHub Issue**: https://github.com/nodejs/node/issues/3363 +* **Minutes Google Doc**: +* _Previous Minutes Google Doc: _ + +## Present + +* Rod Vagg (TSC) +* Domenic Denicola (observer) +* Brian White (TSC) +* Steven Loomis (observer) +* James Snell (TSC) +* Michael Dawson (observer) +* Ben Noordhuis (TSC) +* Jeremiah Senkpiel (TSC) +* Trevor Norris (TSC) +* Alexis Campailla (TSC) +* Mikeal Rogers (observer) + +## Agenda + +Extracted from **tsc-agenda** labelled issues and pull requests in the nodejs org prior to meeting. + +### nodejs/node + +* V8 security reporting [#3348](https://github.com/nodejs/node/issues/3348) +* doc: add information about Assert behavior and maintenance [#3330](https://github.com/nodejs/node/pull/3330) +* WG: Considering a new HTTP WG [#3214](https://github.com/nodejs/node/issues/3214) +* Discussion: LTS & v5 release planning [#3000](https://github.com/nodejs/node/issues/3000) +* Compiling node v4.0.0 with OpenSSL 1.0.1 fails [#2783](https://github.com/nodejs/node/issues/2783) + +### nodejs/TSC + +* Umbrella Program [#2](https://github.com/nodejs/TSC/pull/2) + + +## Minutes + +### Standup + +* Rod Vagg: Not quite as involved, took a bit of time off. Getting back up to speed on build +* Domenic: Nothing this week +* Brian: PRs & Issues +* Steven: Worked on getting ICU 56.1 out and into v4.2.0 LTS, working on making the ICU [install better](https://github.com/nodejs/node-v0.x-archive/issues/8996#issuecomment-89411193). Also shepherding iojs-* rename to nodejs-* [#2525](https://github.com/nodejs/node/issues/2525) +* James: Worked on the 4.2.0 and 4.2.1 releases. Working on the cgitm smoke-testing tool and http WG. +* Michael: Worked on adding pLinux to the CI. Looking into running the tests on fips-compliant mode. Investigated some AIX issues. +* Ben: PRs & Issues, doing some work on the debugger and memory bugs in libuv +* Jeremiah: PRs & Issues, working on resolving the timers in beforeExit bug: https://github.com/nodejs/node/pull/2795 +* Trevor: Helped Jeremiah with the beforeExit thing, worked on PRs and Issues. Looking into AsyncWrap improvements. +* Alexis: Looking into a native module build service. Worked on the Ci a bit. +* Mikeal: Worked on the Umbrella Program proposal. Helping set up the Node.js Interactive conference. + + +### Review of previous meeting + +* WG: Considering a new HTTP WG [#3214](https://github.com/nodejs/node/issues/3214) +* lib,test: deprecate _linklist [#3078](https://github.com/nodejs/node/pull/3078) +* Discussion: LTS & v5 release planning [#3000](https://github.com/nodejs/node/issues/3000) +* Compiling node v4.0.0 with OpenSSL 1.0.1 fails [#2783](https://github.com/nodejs/node/issues/2783) +* Inspecting Node.js with Chrome DevTools [#2546](https://github.com/nodejs/node/issues/2546) +* Umbrella Program [#2](https://github.com/nodejs/TSC/pull/2) + + +### V8 security reporting [#3348](https://github.com/nodejs/node/issues/3348) + +Michael: Proposal is to add one or more TSC members to the V8 security list. Not all issues will actually be V8 issues, but there shouldn’t be too many. + +* Concerns about too many issues + +Michael: Let’s go back and ask if a handfull means only 4-5 a week. + +Mikeal: Part of the Umbrella Program is to make a top-level security group that all security issues are funneled through. This group may not need to be TSC members. + +Ben: How would this group know an issue is relevant to us? + +Rod: We are talking about a Chromium security list, so we would probably need someone with enough knowledge to filter out which issues affect us. + +Mikeal: They would only be an initial filter. + +Rod: Some chromium issues will not be recognizable as V8 issues without prior understanding. + +Rod & others: Suggest to add Ben and Fedor to add to the Chromium/V8 security list. + +Discussion about the current Security repo / group, and current mailing lists + +### doc: add information about Assert behavior and maintenance [#3330](https://github.com/nodejs/node/pull/3330) + +Discussion about what assert is intended to do, and how we want to deal with additions and breaking changes in the future. + +Discussion about the stability index in the docs. + +Resolution: Lock the assert module. Possibly re-evaluate in the future. Close existing open PRs/issues against it after landing doc change. + + +### WG: Considering a new HTTP WG [#3214](https://github.com/nodejs/node/issues/3214) + +James: having scheduling problems for an initial hangout but are getting a lot of interest from outside of core, including Doug Wilson and Eran Hammer. + +Discussion about the WG’s goals and how we should possibly think about handing over authority of the http module to this WG in the future. (At charter time or later on) + +### Discussion: LTS & v5 release planning [#3000](https://github.com/nodejs/node/issues/3000) + +James: recommended that we adopt a general rule that commits must go through at least one stable release before going into an LTS. Exceptions to this are security problems and changes that can’t go on to stable. + +### Compiling node v4.0.0 with OpenSSL 1.0.1 fails [#2783](https://github.com/nodejs/node/issues/2783) + +Conclusion was that this would be difficult and would result in a build that had some features disabled. The TSC is not going to undertake this work and would have reservations officially supporting a build that cripples some crypto features. However, pull requests for this work are welcome and would be considered. + +### Umbrella Program [#2](https://github.com/nodejs/TSC/pull/2) + +Mikeal sought a vote from the TSC to adopt the Project Lifecycle document and the Core TLP document. + +Resolution: there were no abstentions from voting and no disagreement amongst TSC members present, additional TSC members have registered their +1 on the PR so the motion is passed. + +## Next Meeting + +October 21st, 2015 diff --git a/doc/tsc-meetings/2015-10-21.md b/doc/tsc-meetings/2015-10-21.md new file mode 100644 index 00000000000000..5aad511600bb88 --- /dev/null +++ b/doc/tsc-meetings/2015-10-21.md @@ -0,0 +1,214 @@ +# Node Foundation Core Technical Committee (CTC) Meeting 2015-10-21 + +## Links + +* **Audio Recording**: https://soundcloud.com/node-foundation/tsc-meeting-2015-10-21 +* **GitHub Issue**: https://github.com/nodejs/node/issues/3464 +* **Minutes Google Doc**: +* _Previous Minutes Google Doc: _ + +## Present + +* Rod Vagg (CTC) +* Brian White (CTC) +* Steven R. Loomis (observer) +* James Snell (CTC) +* Michael Dawson (observer) +* Chris Dickinson (CTC) +* Ben Noordhuis (CTC) +* Jeremiah Senkpiel (CTC) +* Trevor Norris (CTC) +* Alexis Campailla (CTC) +* Mikeal Rogers (observer) +* Shigeki Ohtsu (CTC) +* Seth Thompson (observer) +* Bert Belder (CTC) +* Fedor Indutny (CTC) +## Agenda + +Extracted from **tsc-agenda** labelled issues and pull requests in the nodejs org prior to meeting. + +### nodejs/node + +* governance: add new collaborators #VIII [#3472](https://github.com/nodejs/node/issues/3472) +* detect "full-icu" module [#3460](https://github.com/nodejs/node/issues/3460) +* WG: Considering a new HTTP WG [#3214](https://github.com/nodejs/node/issues/3214) +* node: deprecate public access to `process.binding` [#2768](https://github.com/nodejs/node/pull/2768) + +## Minutes + +### Review of previous meeting + +* V8 security reporting [#3348](https://github.com/nodejs/node/issues/3348) +* doc: add information about Assert behavior and maintenance [#3330](https://github.com/nodejs/node/pull/3330) +* WG: Considering a new HTTP WG [#3214](https://github.com/nodejs/node/issues/3214) +* Discussion: LTS & v5 release planning [#3000](https://github.com/nodejs/node/issues/3000) +* Compiling node v4.0.0 with OpenSSL 1.0.1 fails [#2783](https://github.com/nodejs/node/issues/2783) +* Umbrella Program [#2](https://github.com/nodejs/TSC/pull/2) + +### Standup + +* Rod Vagg: index.tab and index.json updates (nodejs.org/dist/index.*) including an “lts” field, also made consistent directories for ancient Node tarballs with shasums files so nvm and other tools can simplify their access. v5 and other build yak shaving. +* Brian White: usual triaging and PR and Issues commenting, not much else +* Steven R. Loomis: Intl meeting, "full-icu" npm module [will be away until Nov 11 meeting, Unicode conf/Unicode-TC] +* James Snell: Working on localization for the node runtime [#3413](https://github.com/nodejs/node/pull/3413) +* Michael Dawson: Working through PPC and AIX PRs and issues, LTS WG discussions, Benchmarking WG, working with Stefan on agenda items for API WG meeting. +* Chris Dickinson: was busy with vacation and conferences, but looking into the WhatWG Streams spec, next up is static analysis server +* Ben Noordhuis: The usual. Looking into make the debugger better. The test suite is in bad shape +* Jeremiah Senkpiel: issue and PR work — going back through the backlog now, helping with v5 release + npm@3 +* Trevor Norris: flurry of AsyncWrap PRs, trying to get it to a point where people could more reliably use it, it can’t be hidden forever. +* Alexis Campailla: Sick, traveling; CI progress on flakiness, some progress on native module build service +* Mikeal Rogers: Foundation resources for v5 release: PR folks wrote a blog post, expectation setting, make sure enterprises are still using LTS, if you’re a dev here’s what to be excited about, etc. +* Shigeki Ohtsu: Worked semver-major fix to limit DH key size [#1831] (https://github.com/nodejs/node/pull/1831) and some works for root certs. +* Seth Thompson: Security mailing list stuff went through this week, working on v8 side of things to create a new version of the octane benchmark, excited about the benchmarking WG +* Bert Belder: nothing +* Fedor Indutny: reviewing PRs, helped fix a beforeExit bug, fixing yet another V8’s ArrayBuffer issue + - Discussed the ArrayBuffer issue in detail + +* (Aside: Shigeki and Fedor were asked to look at [#3406](https://github.com/nodejs/node/issues/3406) - “p1/p2” issue ) + +### governance: add new collaborators #VIII [#3472](https://github.com/nodejs/node/issues/3472) + +- Discussed onboarding. + +- Action: Jeremiah to schedule and run another onaboarding, Chris to tune in. + +### detect "full-icu" module [#3460](https://github.com/nodejs/node/issues/3460) + +Stems from conversation from the 0.X days about whether Node should ship other languages separately. + +This is a module published on npm as an alternative to shipping with Node proper. + +Whether node can detect a full-icu install in a special place (node_modules/full-icu, global/node_modules/full-icu) + +Nathan7 commented with a concern about coupling npm to node + +Currently have to start node with ICU_DATA_PATH=some/path/to/file + +Rod: Couple it to `execPath` + +James: globally installed could install into a well known global location + +Rod: Does this have to be done at startup? + +Stephen: Yes. V8 has to have the data available before starting. + +James: Happens right after parsing args + +Rod: Could use HOME? + +Stephen: Could use NODE_PATH? + +Rod: Trying to move away from NODE_PATH + +Ben: Might just bite the bullet and include ICU? + +Stephen: I would like that, but I am sympathetic to folks running on OpenWRT + +Ben: I can see that, but all this installing in special paths leaves a lot of margin for error. + +James: Full ICU will double the size of the Node binary. Hard pill to swallow. + +Rod: We could offer alternative downloads? + +Stephen: Two downloads would work as well. We could do this all from build infra. + +Bert: I would not be in favor of that. We end up with “oh my module doesn’t work” “oh you didn’t download the right flavor of Node” + +Jeremiah: It’s going to make it confusing no matter what + +... [I missed this] + +Chris: could we offer better error messages? + +Rod: it peeks through in a lot of places — the ICU object, strings, etc. Maybe best to leave to module authors? Include a process.versions.icu object? + +James: small-icu is the default build running locally — CI doesn’t run with ICU enabled? + +Trevor: even if small-icu is there, it means less data, but not less build time. I would like to see how that affects the raspberry pi’s build time. + +Ben: we could avoid rebuilding ICU on rasppis + +Stephen: or use a precompiled ICU + +Jeremiah: Assumes an internet connected machine + +Rod: If we go with small-icu we should make it available + +Ben: should we add it to the repo? + +Alexis: I think so, it’s causing problems + +[???]: It’s about 80mb + +Rod: How big is it? + +Stephen: The source size & binary size was comparable to Node. +We could have a non-standard source checked in. + +Mikeal: we could use the large file storage stuff GH just added. +Stephen: 25mb uncompressed, 130mb for source tree + +Mikeal: if we say “you need ICU to build” we need to make it available + +Trevor: How’s this going to work with bouncing between branches? + +Alexis: What about keeping it as text? + +Ben: + +Steven: We have a 25mb compressed zip of source, that itself contains a 25mb compressed zip. We could strip that down — what would it take to delete the tests, etc — a subset + +Mikeal: so could we just install this 25mb file? + +Rod: This adds a dep on Git LFS + +Mikeal: Let’s try to solve one problem at a time — fix downloading, not making the default + +Rod: I’m happy with how the CI does it + +… + +Stephen: The first time you hit something ICU-based it loads it. + +Rod: I’m just wondering if this could be turned into a proper npm module. + +Stephen: I’m not sure — it looks pretty deeply enmeshed into V8 + +Seth: I don’t have answers off the top of my head on that one, I responded on the thread; we don’t currently have a priority to mess +around with localization. If there’s a design doc that proposes cleaning things up we’d be interested + +James: Resource bundle mechanism — [Note: didn’t get all of this] “using the same startup sequence as Intl.. so needs to be configured at start time” (https://github.com/nodejs/node/pull/3413 uses ICU’s resource bundle mechanism, which uses the same init path as the core data. ICU does not allow multiple initializations. + +Alexis: If the only reason we’re trying to package it is to use npm to install it, maybe we’re complicating this unnecessarily + +Rod: On the iojs side we decided not to go with ICU. It’s in core because it has to be initialized before v8 is started, my question is this something that could be changed upstream in v8? Ideally this should not be in core. + +Steven: It didn’t look like it could be split off easily. + +Chris: JS proxies + +Steven: Possible, but _very_ tricky + +[Moving conversation to GH] + + +### WG: Considering a new HTTP WG [#3214](https://github.com/nodejs/node/issues/3214) + +HTTP WG first meeting is tomorrow at 1pm Pacific, nothing to discuss yet + +### node: deprecate public access to `process.binding` [#2768](https://github.com/nodejs/node/pull/2768) + +Lots of discussion, focused on `process.binding('natives')`. Summary: We should at least try to make it read-only first. Ben said he would follow up with a PR. + +### node: make listen address configurable [#3316](https://github.com/nodejs/node/pull/3316) + +Fedor: Ben suggested commandline argument to submit hostname and port. Fedor concerned about the amout of code required to parse and separate the two parts of the option. Would be better to have a separate argument for hostname. + +Discussion about usability vs simplicity of code. + +Quick vote on whether to move forward with the PR in its current form, no objections. + +## Next Meeting + +October 28th, 2015 diff --git a/lib/.eslintrc b/lib/.eslintrc new file mode 100644 index 00000000000000..341e9327c7cf3a --- /dev/null +++ b/lib/.eslintrc @@ -0,0 +1,3 @@ +rules: + # Custom rules in tools/eslint-rules + require-buffer: 2 diff --git a/lib/_debug_agent.js b/lib/_debug_agent.js index 63c50357894b08..cb4684f0eddfac 100644 --- a/lib/_debug_agent.js +++ b/lib/_debug_agent.js @@ -48,6 +48,7 @@ function Agent() { this.first = true; this.binding = process._debugAPI; + assert(this.binding, 'Debugger agent running without bindings!'); var self = this; this.binding.onmessage = function(msg) { @@ -57,7 +58,6 @@ function Agent() { }; this.clients = []; - assert(this.binding, 'Debugger agent running without bindings!'); } util.inherits(Agent, net.Server); @@ -119,10 +119,10 @@ Client.prototype._transform = function _transform(data, enc, cb) { while (true) { if (this.state === 'headers') { // Not enough data - if (!/\r\n/.test(this.buffer)) + if (!this.buffer.includes('\r\n')) break; - if (/^\r\n/.test(this.buffer)) { + if (this.buffer.startsWith('\r\n')) { this.buffer = this.buffer.slice(2); this.state = 'body'; continue; diff --git a/lib/_debugger.js b/lib/_debugger.js index 9f8fa26f2189c3..5ad200a43a87ee 100644 --- a/lib/_debugger.js +++ b/lib/_debugger.js @@ -5,7 +5,7 @@ const path = require('path'); const net = require('net'); const vm = require('vm'); const Module = require('module'); -const repl = Module.requireRepl(); +const repl = require('repl'); const inherits = util.inherits; const assert = require('assert'); const spawn = require('child_process').spawn; @@ -25,8 +25,8 @@ exports.start = function(argv, stdin, stdout) { stdin = stdin || process.stdin; stdout = stdout || process.stdout; - var args = ['--debug-brk'].concat(argv), - interface_ = new Interface(stdin, stdout, args); + const args = ['--debug-brk'].concat(argv); + const interface_ = new Interface(stdin, stdout, args); stdin.resume(); @@ -45,7 +45,7 @@ exports.port = 5858; // // Parser/Serializer for V8 debugger protocol -// http://code.google.com/p/v8/wiki/DebuggerProtocol +// https://github.com/v8/v8/wiki/Debugging-Protocol // // Usage: // p = new Protocol(); @@ -142,7 +142,7 @@ Protocol.prototype.serialize = function(req) { const NO_FRAME = -1; function Client() { - net.Stream.call(this); + net.Socket.call(this); var protocol = this.protocol = new Protocol(this); this._reqCallbacks = []; var socket = this; @@ -159,9 +159,9 @@ function Client() { protocol.execute(d); }); - protocol.onResponse = this._onResponse.bind(this); + protocol.onResponse = (res) => this._onResponse(res); } -inherits(Client, net.Stream); +inherits(Client, net.Socket); exports.Client = Client; @@ -197,8 +197,8 @@ Client.prototype._removeScript = function(desc) { Client.prototype._onResponse = function(res) { - var cb, - index = -1; + var cb; + var index = -1; this._reqCallbacks.some(function(fn, i) { if (fn.request_seq == res.body.request_seq) { @@ -295,11 +295,11 @@ Client.prototype.reqLookup = function(refs, cb) { }; Client.prototype.reqScopes = function(cb) { - var self = this, - req = { - command: 'scopes', - arguments: {} - }; + const self = this; + const req = { + command: 'scopes', + arguments: {} + }; cb = cb || function() {}; this.req(req, function(err, res) { @@ -462,7 +462,7 @@ Client.prototype.setBreakpoint = function(req, cb) { }; Client.prototype.clearBreakpoint = function(req, cb) { - var req = { + req = { command: 'clearbreakpoint', arguments: req }; @@ -525,8 +525,8 @@ Client.prototype.mirrorObject = function(handle, depth, cb) { return; } - var mirror, - waiting = 1; + var mirror; + var waiting = 1; if (handle.className == 'Array') { mirror = []; @@ -567,13 +567,13 @@ Client.prototype.mirrorObject = function(handle, depth, cb) { waitForOthers(); function waitForOthers() { - if (--waiting === 0 && cb) { + if (--waiting === 0) { keyValues.forEach(function(kv) { mirror[kv.name] = kv.value; }); cb(null, mirror); } - }; + } }); return; } else if (handle.type === 'function') { @@ -657,6 +657,7 @@ const commands = [ 'unwatch', 'watchers', 'repl', + 'exec', 'restart', 'kill', 'list', @@ -672,12 +673,15 @@ var helpMessage = 'Commands: ' + commands.map(function(group) { return group.join(', '); }).join(',\n'); +// Previous command received. Initialize to empty command. +var lastCommand = '\n'; + function SourceUnderline(sourceText, position, repl) { if (!sourceText) return ''; - var head = sourceText.slice(0, position), - tail = sourceText.slice(position); + const head = sourceText.slice(0, position); + var tail = sourceText.slice(position); // Colourize char if stdout supports colours if (repl.useColors) { @@ -697,8 +701,8 @@ function SourceInfo(body) { if (body.script) { if (body.script.name) { - var name = body.script.name, - dir = path.resolve() + '/'; + var name = body.script.name; + const dir = path.resolve() + '/'; // Change path to relative, if possible if (name.indexOf(dir) === 0) { @@ -733,7 +737,7 @@ function Interface(stdin, stdout, args) { prompt: 'debug> ', input: this.stdin, output: this.stdout, - eval: this.controlEval.bind(this), + eval: (code, ctx, file, cb) => this.controlEval(code, ctx, file, cb), useGlobal: false, ignoreUndefined: true }; @@ -764,7 +768,7 @@ function Interface(stdin, stdout, args) { }); // Handle all possible exits - process.on('exit', this.killChild.bind(this)); + process.on('exit', () => this.killChild()); process.once('SIGTERM', process.exit.bind(process, 0)); process.once('SIGHUP', process.exit.bind(process, 0)); @@ -798,7 +802,7 @@ function Interface(stdin, stdout, args) { } else { self.repl.context[key] = fn; } - }; + } // Copy all prototype methods in repl context // Setup them as getters if possible @@ -943,10 +947,16 @@ Interface.prototype.requireConnection = function() { Interface.prototype.controlEval = function(code, context, filename, callback) { try { // Repeat last command if empty line are going to be evaluated - if (this.repl.rli.history && this.repl.rli.history.length > 0) { - if (code === '\n') { - code = this.repl.rli.history[0] + '\n'; - } + if (code === '\n') { + code = lastCommand; + } else { + lastCommand = code; + } + + // exec process.title => exec("process.title"); + var match = code.match(/^\s*exec\s+([^\n]*)/); + if (match) { + code = 'exec(' + JSON.stringify(match[1]) + ')'; } var result = vm.runInContext(code, context, filename); @@ -969,8 +979,8 @@ Interface.prototype.controlEval = function(code, context, filename, callback) { Interface.prototype.debugEval = function(code, context, filename, callback) { if (!this.requireConnection()) return; - var self = this, - client = this.client; + const self = this; + const client = this.client; // Repl asked for scope variables if (code === '.scope') { @@ -1004,15 +1014,11 @@ Interface.prototype.debugEval = function(code, context, filename, callback) { // Adds spaces and prefix to number // maxN is a maximum number we should have space for function leftPad(n, prefix, maxN) { - var s = n.toString(), - nchars = Math.max(2, String(maxN).length) + 1, - nspaces = nchars - s.length - 1; - - for (var i = 0; i < nspaces; i++) { - prefix += ' '; - } + const s = n.toString(); + const nchars = Math.max(2, String(maxN).length) + 1; + const nspaces = nchars - s.length - 1; - return prefix + s; + return prefix + ' '.repeat(nspaces) + s; } @@ -1078,10 +1084,10 @@ Interface.prototype.list = function(delta) { delta || (delta = 5); - var self = this, - client = this.client, - from = client.currentSourceLine - delta + 1, - to = client.currentSourceLine + delta + 1; + const self = this; + const client = this.client; + const from = client.currentSourceLine - delta + 1; + const to = client.currentSourceLine + delta + 1; self.pause(); client.reqSource(from, to, function(err, res) { @@ -1096,12 +1102,12 @@ Interface.prototype.list = function(delta) { var lineno = res.fromLine + i + 1; if (lineno < from || lineno > to) continue; - var current = lineno == 1 + client.currentSourceLine, - breakpoint = client.breakpoints.some(function(bp) { - return (bp.scriptReq === client.currentScript || - bp.script === client.currentScript) && - bp.line == lineno; - }); + const current = lineno == 1 + client.currentSourceLine; + const breakpoint = client.breakpoints.some(function(bp) { + return (bp.scriptReq === client.currentScript || + bp.script === client.currentScript) && + bp.line == lineno; + }); if (lineno == 1) { // The first line needs to have the module wrapper filtered out of @@ -1139,8 +1145,8 @@ Interface.prototype.list = function(delta) { Interface.prototype.backtrace = function() { if (!this.requireConnection()) return; - var self = this, - client = this.client; + const self = this; + const client = this.client; self.pause(); client.fullTrace(function(err, bt) { @@ -1153,8 +1159,8 @@ Interface.prototype.backtrace = function() { if (bt.totalFrames == 0) { self.print('(empty stack)'); } else { - var trace = [], - firstFrameNative = bt.frames[0].script.isNative; + const trace = []; + const firstFrameNative = bt.frames[0].script.isNative; for (var i = 0; i < bt.frames.length; i++) { var frame = bt.frames[i]; @@ -1183,9 +1189,9 @@ Interface.prototype.backtrace = function() { Interface.prototype.scripts = function() { if (!this.requireConnection()) return; - var client = this.client, - displayNatives = arguments[0] || false, - scripts = []; + const client = this.client; + const displayNatives = arguments[0] || false; + const scripts = []; this.pause(); for (var id in client.scripts) { @@ -1323,9 +1329,9 @@ Interface.prototype.setBreakpoint = function(script, line, condition, silent) { if (!this.requireConnection()) return; - var self = this, - scriptId, - ambiguous; + const self = this; + var scriptId; + var ambiguous; // setBreakpoint() should insert breakpoint on current line if (script === undefined) { @@ -1345,9 +1351,10 @@ Interface.prototype.setBreakpoint = function(script, line, return; } - if (/\(\)$/.test(script)) { + let req; + if (script.endsWith('()')) { // setBreakpoint('functionname()'); - var req = { + req = { type: 'function', target: script.replace(/\(\)$/, ''), condition: condition @@ -1373,7 +1380,6 @@ Interface.prototype.setBreakpoint = function(script, line, if (ambiguous) return this.error('Script name is ambiguous'); if (line <= 0) return this.error('Line should be a positive value'); - var req; if (scriptId) { req = { type: 'scriptId', @@ -1429,10 +1435,10 @@ Interface.prototype.setBreakpoint = function(script, line, Interface.prototype.clearBreakpoint = function(script, line) { if (!this.requireConnection()) return; - var ambiguous, - breakpoint, - scriptId, - index; + var ambiguous; + var breakpoint; + var scriptId; + var index; this.client.breakpoints.some(function(bp, i) { if (bp.scriptId === script || @@ -1474,10 +1480,8 @@ Interface.prototype.clearBreakpoint = function(script, line) { return this.error('Breakpoint not found on line ' + line); } - var self = this, - req = { - breakpoint: breakpoint - }; + var self = this; + const req = {breakpoint}; self.pause(); self.client.clearBreakpoint(req, function(err, res) { @@ -1513,8 +1517,8 @@ Interface.prototype.breakpoints = function() { Interface.prototype.pause_ = function() { if (!this.requireConnection()) return; - var self = this, - cmd = 'process._debugPause();'; + const self = this; + const cmd = 'process._debugPause();'; this.pause(); this.client.reqFrameEval(cmd, NO_FRAME, function(err, res) { @@ -1527,6 +1531,18 @@ Interface.prototype.pause_ = function() { }; +// execute expression +Interface.prototype.exec = function(code) { + this.debugEval(code, null, null, (err, result) => { + if (err) { + this.error(err); + } else { + this.print(util.inspect(result, {colors: true})); + } + }); +}; + + // Kill child process Interface.prototype.kill = function() { if (!this.child) return; @@ -1546,8 +1562,7 @@ Interface.prototype.repl = function() { var listeners = this.repl.rli.listeners('SIGINT').slice(0); this.repl.rli.removeAllListeners('SIGINT'); - // Exit debug repl on Ctrl + C - this.repl.rli.once('SIGINT', function() { + function exitDebugRepl() { // Restore all listeners process.nextTick(function() { listeners.forEach(function(listener) { @@ -1557,10 +1572,20 @@ Interface.prototype.repl = function() { // Exit debug repl self.exitRepl(); - }); + + self.repl.rli.removeListener('SIGINT', exitDebugRepl); + self.repl.removeListener('exit', exitDebugRepl); + } + + // Exit debug repl on SIGINT + this.repl.rli.on('SIGINT', exitDebugRepl); + + // Exit debug repl on repl exit + this.repl.on('exit', exitDebugRepl); // Set new - this.repl.eval = this.debugEval.bind(this); + this.repl.eval = (code, ctx, file, cb) => + this.debugEval(code, ctx, file, cb); this.repl.context = {}; // Swap history @@ -1575,7 +1600,8 @@ Interface.prototype.repl = function() { // Exit debug repl Interface.prototype.exitRepl = function() { // Restore eval - this.repl.eval = this.controlEval.bind(this); + this.repl.eval = (code, ctx, file, cb) => + this.controlEval(code, ctx, file, cb); // Swap history this.history.debug = this.repl.rli.history; @@ -1613,18 +1639,18 @@ Interface.prototype.killChild = function() { // Spawns child process (and restores breakpoints) Interface.prototype.trySpawn = function(cb) { - var self = this, - breakpoints = this.breakpoints || [], - port = exports.port, - host = '127.0.0.1', - childArgs = this.args; + const self = this; + const breakpoints = this.breakpoints || []; + var port = exports.port; + var host = '127.0.0.1'; + var childArgs = this.args; this.killChild(); assert(!this.child); var isRemote = false; if (this.args.length === 2) { - var match = this.args[1].match(/^([^:]+):(\d+)$/); + const match = this.args[1].match(/^([^:]+):(\d+)$/); if (match) { // Connecting to remote debugger @@ -1648,7 +1674,7 @@ Interface.prototype.trySpawn = function(cb) { } isRemote = true; } else { - var match = this.args[1].match(/^--port=(\d+)$/); + const match = this.args[1].match(/^--port=(\d+)$/); if (match) { // Start debugger on custom port // `node debug --port=5858 app.js` @@ -1662,14 +1688,14 @@ Interface.prototype.trySpawn = function(cb) { // pipe stream into debugger this.child = spawn(process.execPath, childArgs); - this.child.stdout.on('data', this.childPrint.bind(this)); - this.child.stderr.on('data', this.childPrint.bind(this)); + this.child.stdout.on('data', (text) => this.childPrint(text)); + this.child.stderr.on('data', (text) => this.childPrint(text)); } this.pause(); - var client = self.client = new Client(), - connectionAttempts = 0; + const client = self.client = new Client(); + var connectionAttempts = 0; client.once('ready', function() { self.stdout.write(' ok\n'); @@ -1722,11 +1748,12 @@ Interface.prototype.trySpawn = function(cb) { client.connect(port, host); } - self.print('connecting to ' + host + ':' + port + ' ..', true); if (isRemote) { + self.print('connecting to ' + host + ':' + port + ' ..', true); attemptConnect(); } else { this.child.stderr.once('data', function() { + self.print('connecting to ' + host + ':' + port + ' ..', true); setImmediate(attemptConnect); }); } diff --git a/lib/_http_agent.js b/lib/_http_agent.js index 305baa2cbd2f03..fd74daafec6486 100644 --- a/lib/_http_agent.js +++ b/lib/_http_agent.js @@ -44,7 +44,7 @@ function Agent(options) { var name = self.getName(options); debug('agent.on(free)', name); - if (!socket.destroyed && + if (socket.writable && self.requests[name] && self.requests[name].length) { self.requests[name].shift().onSocket(socket); if (self.requests[name].length === 0) { @@ -57,8 +57,8 @@ function Agent(options) { var req = socket._httpMessage; if (req && req.shouldKeepAlive && - !socket.destroyed && - self.options.keepAlive) { + socket.writable && + self.keepAlive) { var freeSockets = self.freeSockets[name]; var freeLen = freeSockets ? freeSockets.length : 0; var count = freeLen; @@ -66,7 +66,6 @@ function Agent(options) { count += self.sockets[name].length; if (count > self.maxSockets || freeLen >= self.maxFreeSockets) { - self.removeSocket(socket, options); socket.destroy(); } else { freeSockets = freeSockets || []; @@ -78,7 +77,6 @@ function Agent(options) { freeSockets.push(socket); } } else { - self.removeSocket(socket, options); socket.destroy(); } } @@ -117,6 +115,9 @@ Agent.prototype.addRequest = function(req, options) { }; } + options = util._extend({}, options); + options = util._extend(options, this.options); + var name = this.getName(options); if (!this.sockets[name]) { this.sockets[name] = []; @@ -140,7 +141,15 @@ Agent.prototype.addRequest = function(req, options) { } else if (sockLen < this.maxSockets) { debug('call onSocket', sockLen, freeLen); // If we are under maxSockets create a new one. - req.onSocket(this.createSocket(req, options)); + this.createSocket(req, options, function(err, newSocket) { + if (err) { + process.nextTick(function() { + req.emit('error', err); + }); + return; + } + req.onSocket(newSocket); + }); } else { debug('wait for socket'); // We are over limit so we'll add it to the queue. @@ -151,18 +160,16 @@ Agent.prototype.addRequest = function(req, options) { } }; -Agent.prototype.createSocket = function(req, options) { +Agent.prototype.createSocket = function(req, options, cb) { var self = this; options = util._extend({}, options); options = util._extend(options, self.options); if (!options.servername) { options.servername = options.host; - if (req) { - var hostHeader = req.getHeader('host'); - if (hostHeader) { - options.servername = hostHeader.replace(/:.*$/, ''); - } + const hostHeader = req.getHeader('host'); + if (hostHeader) { + options.servername = hostHeader.replace(/:.*$/, ''); } } @@ -171,48 +178,58 @@ Agent.prototype.createSocket = function(req, options) { debug('createConnection', name, options); options.encoding = null; - var s = self.createConnection(options); - if (!self.sockets[name]) { - self.sockets[name] = []; - } - this.sockets[name].push(s); - debug('sockets', name, this.sockets[name].length); + var called = false; + const newSocket = self.createConnection(options, oncreate); + if (newSocket) + oncreate(null, newSocket); + function oncreate(err, s) { + if (called) + return; + called = true; + if (err) + return cb(err); + if (!self.sockets[name]) { + self.sockets[name] = []; + } + self.sockets[name].push(s); + debug('sockets', name, self.sockets[name].length); - function onFree() { - self.emit('free', s, options); - } - s.on('free', onFree); - - function onClose(err) { - debug('CLIENT socket onClose'); - // This is the only place where sockets get removed from the Agent. - // If you want to remove a socket from the pool, just close it. - // All socket errors end in a close event anyway. - self.removeSocket(s, options); - } - s.on('close', onClose); - - function onRemove() { - // We need this function for cases like HTTP 'upgrade' - // (defined by WebSockets) where we need to remove a socket from the - // pool because it'll be locked up indefinitely - debug('CLIENT socket onRemove'); - self.removeSocket(s, options); - s.removeListener('close', onClose); - s.removeListener('free', onFree); - s.removeListener('agentRemove', onRemove); + function onFree() { + self.emit('free', s, options); + } + s.on('free', onFree); + + function onClose(err) { + debug('CLIENT socket onClose'); + // This is the only place where sockets get removed from the Agent. + // If you want to remove a socket from the pool, just close it. + // All socket errors end in a close event anyway. + self.removeSocket(s, options); + } + s.on('close', onClose); + + function onRemove() { + // We need this function for cases like HTTP 'upgrade' + // (defined by WebSockets) where we need to remove a socket from the + // pool because it'll be locked up indefinitely + debug('CLIENT socket onRemove'); + self.removeSocket(s, options); + s.removeListener('close', onClose); + s.removeListener('free', onFree); + s.removeListener('agentRemove', onRemove); + } + s.on('agentRemove', onRemove); + cb(null, s); } - s.on('agentRemove', onRemove); - return s; }; Agent.prototype.removeSocket = function(s, options) { var name = this.getName(options); - debug('removeSocket', name, 'destroyed:', s.destroyed); + debug('removeSocket', name, 'writable:', s.writable); var sets = [this.sockets]; // If the socket was destroyed, remove it from the free buffers too. - if (s.destroyed) + if (!s.writable) sets.push(this.freeSockets); for (var sk = 0; sk < sets.length; sk++) { @@ -233,7 +250,15 @@ Agent.prototype.removeSocket = function(s, options) { debug('removeSocket, have a request, make a socket'); var req = this.requests[name][0]; // If we have pending requests and a socket gets closed make a new one - this.createSocket(req, options).emit('free'); + this.createSocket(req, options, function(err, newSocket) { + if (err) { + process.nextTick(function() { + req.emit('error', err); + }); + return; + } + newSocket.emit('free'); + }); } }; diff --git a/lib/_http_client.js b/lib/_http_client.js index 201593e61da5ac..6dfa71dca88b86 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -3,7 +3,6 @@ const util = require('util'); const net = require('net'); const url = require('url'); -const EventEmitter = require('events'); const HTTPParser = process.binding('http_parser').HTTPParser; const assert = require('assert').ok; const common = require('_http_common'); @@ -22,6 +21,9 @@ function ClientRequest(options, cb) { if (typeof options === 'string') { options = url.parse(options); + if (!options.hostname) { + throw new Error('Unable to determine the domain name'); + } } else { options = util._extend({}, options); } @@ -31,7 +33,7 @@ function ClientRequest(options, cb) { if (agent === false) { agent = new defaultAgent.constructor(); } else if ((agent === null || agent === undefined) && - !options.createConnection) { + typeof options.createConnection !== 'function') { agent = defaultAgent; } self.agent = agent; @@ -85,6 +87,17 @@ function ClientRequest(options, cb) { } if (host && !this.getHeader('host') && setHost) { var hostHeader = host; + var posColon = -1; + + // For the Host header, ensure that IPv6 addresses are enclosed + // in square brackets, as defined by URI formatting + // https://tools.ietf.org/html/rfc3986#section-3.2.2 + if (-1 !== (posColon = hostHeader.indexOf(':')) && + -1 !== (posColon = hostHeader.indexOf(':', posColon)) && + '[' !== hostHeader[0]) { + hostHeader = `[${hostHeader}]`; + } + if (port && +port !== defaultPort) { hostHeader += ':' + port; } @@ -116,11 +129,20 @@ function ClientRequest(options, cb) { self._renderHeaders()); } + var called = false; if (self.socketPath) { self._last = true; self.shouldKeepAlive = false; - var conn = self.agent.createConnection({ path: self.socketPath }); - self.onSocket(conn); + const optionsPath = { + path: self.socketPath + }; + const newSocket = self.agent.createConnection(optionsPath, oncreate); + if (newSocket && !called) { + called = true; + self.onSocket(newSocket); + } else { + return; + } } else if (self.agent) { // If there is an agent we should default to Connection:keep-alive, // but only if the Agent will actually reuse the connection! @@ -138,13 +160,35 @@ function ClientRequest(options, cb) { // No agent, default to Connection:close. self._last = true; self.shouldKeepAlive = false; - if (options.createConnection) { - var conn = options.createConnection(options); + if (typeof options.createConnection === 'function') { + const newSocket = options.createConnection(options, oncreate); + if (newSocket && !called) { + called = true; + self.onSocket(newSocket); + } else { + return; + } } else { debug('CLIENT use net.createConnection', options); - var conn = net.createConnection(options); + self.onSocket(net.createConnection(options)); + } + } + + function oncreate(err, socket) { + if (called) + return; + called = true; + if (err) { + process.nextTick(function() { + self.emit('error', err); + }); + return; } - self.onSocket(conn); + self.onSocket(socket); + self._deferToConnect(null, null, function() { + self._flush(); + self = null; + }); } self._deferToConnect(null, null, function() { @@ -280,6 +324,13 @@ function socketErrorListener(err) { socket.destroy(); } +function freeSocketErrorListener(err) { + var socket = this; + debug('SOCKET ERROR on FREE socket:', err.message, err.stack); + socket.destroy(); + socket.emit('agentRemove'); +} + function socketOnEnd() { var socket = this; var req = this._httpMessage; @@ -381,7 +432,7 @@ function parserOnIncomingClient(res, shouldKeepAlive) { // Responses to CONNECT request is handled as Upgrade. if (req.method === 'CONNECT') { res.upgrade = true; - return true; // skip body + return 2; // skip body, and the rest } // Responses to HEAD requests are crazy. @@ -446,6 +497,7 @@ function responseOnEnd() { } socket.removeListener('close', socketCloseListener); socket.removeListener('error', socketErrorListener); + socket.once('error', freeSocketErrorListener); // Mark this socket as available, AFTER user-added end // handlers have a chance to run. process.nextTick(emitFreeNT, socket); @@ -463,6 +515,7 @@ function tickOnSocket(req, socket) { parser.reinitialize(HTTPParser.RESPONSE); parser.socket = socket; parser.incoming = null; + parser.outgoing = req; req.parser = parser; socket.parser = parser; @@ -480,6 +533,7 @@ function tickOnSocket(req, socket) { } parser.onIncoming = parserOnIncomingClient; + socket.removeListener('error', freeSocketErrorListener); socket.on('error', socketErrorListener); socket.on('data', socketOnData); socket.on('end', socketOnEnd); @@ -565,10 +619,18 @@ ClientRequest.prototype.setTimeout = function(msecs, callback) { }; ClientRequest.prototype.setNoDelay = function() { - this._deferToConnect('setNoDelay', arguments); + const argsLen = arguments.length; + const args = new Array(argsLen); + for (var i = 0; i < argsLen; i++) + args[i] = arguments[i]; + this._deferToConnect('setNoDelay', args); }; ClientRequest.prototype.setSocketKeepAlive = function() { - this._deferToConnect('setKeepAlive', arguments); + const argsLen = arguments.length; + const args = new Array(argsLen); + for (var i = 0; i < argsLen; i++) + args[i] = arguments[i]; + this._deferToConnect('setKeepAlive', args); }; ClientRequest.prototype.clearTimeout = function(cb) { diff --git a/lib/_http_common.js b/lib/_http_common.js index 5140d366661cb4..1e6490eaffb6ce 100644 --- a/lib/_http_common.js +++ b/lib/_http_common.js @@ -20,6 +20,7 @@ const kOnHeaders = HTTPParser.kOnHeaders | 0; const kOnHeadersComplete = HTTPParser.kOnHeadersComplete | 0; const kOnBody = HTTPParser.kOnBody | 0; const kOnMessageComplete = HTTPParser.kOnMessageComplete | 0; +const kOnExecute = HTTPParser.kOnExecute | 0; // Only called in the slow case where slow means // that the request headers were either fragmented @@ -77,9 +78,23 @@ function parserOnHeadersComplete(versionMajor, versionMinor, headers, method, parser.incoming.statusMessage = statusMessage; } + // The client made non-upgrade request, and server is just advertising + // supported protocols. + // + // See RFC7230 Section 6.7 + // + // NOTE: RegExp below matches `upgrade` in `Connection: abc, upgrade, def` + // header. + if (upgrade && + parser.outgoing !== null && + (parser.outgoing._headers.upgrade === undefined || + !/(^|\W)upgrade(\W|$)/i.test(parser.outgoing._headers.connection))) { + upgrade = false; + } + parser.incoming.upgrade = upgrade; - var skipBody = false; // response to HEAD or CONNECT + var skipBody = 0; // response to HEAD or CONNECT if (!upgrade) { // For upgraded connections and CONNECT method request, we'll emit this @@ -88,7 +103,10 @@ function parserOnHeadersComplete(versionMajor, versionMinor, headers, method, skipBody = parser.onIncoming(parser.incoming, shouldKeepAlive); } - return skipBody; + if (typeof skipBody !== 'number') + return skipBody ? 1 : 0; + else + return skipBody; } // XXX This is a mess. @@ -142,6 +160,10 @@ var parsers = new FreeList('parsers', 1000, function() { parser._url = ''; parser._consumed = false; + parser.socket = null; + parser.incoming = null; + parser.outgoing = null; + // Only called in the slow case where slow means // that the request headers were either fragmented // across multiple TCP packets or too large to be @@ -151,6 +173,7 @@ var parsers = new FreeList('parsers', 1000, function() { parser[kOnHeadersComplete] = parserOnHeadersComplete; parser[kOnBody] = parserOnBody; parser[kOnMessageComplete] = parserOnMessageComplete; + parser[kOnExecute] = null; return parser; }); @@ -175,6 +198,8 @@ function freeParser(parser, req, socket) { parser.socket.parser = null; parser.socket = null; parser.incoming = null; + parser.outgoing = null; + parser[kOnExecute] = null; if (parsers.free(parser) === false) parser.close(); parser = null; @@ -203,9 +228,72 @@ exports.httpSocketSetup = httpSocketSetup; /** * Verifies that the given val is a valid HTTP token * per the rules defined in RFC 7230 + * See https://tools.ietf.org/html/rfc7230#section-3.2.6 + * + * This implementation of checkIsHttpToken() loops over the string instead of + * using a regular expression since the former is up to 180% faster with v8 4.9 + * depending on the string length (the shorter the string, the larger the + * performance difference) **/ -const token = /^[a-zA-Z0-9_!#$%&'*+.^`|~-]+$/; function checkIsHttpToken(val) { - return typeof val === 'string' && token.test(val); + if (typeof val !== 'string' || val.length === 0) + return false; + + for (var i = 0, len = val.length; i < len; i++) { + var ch = val.charCodeAt(i); + + if (ch >= 65 && ch <= 90) // A-Z + continue; + + if (ch >= 97 && ch <= 122) // a-z + continue; + + // ^ => 94 + // _ => 95 + // ` => 96 + // | => 124 + // ~ => 126 + if (ch === 94 || ch === 95 || ch === 96 || ch === 124 || ch === 126) + continue; + + if (ch >= 48 && ch <= 57) // 0-9 + continue; + + // ! => 33 + // # => 35 + // $ => 36 + // % => 37 + // & => 38 + // ' => 39 + // * => 42 + // + => 43 + // - => 45 + // . => 46 + if (ch >= 33 && ch <= 46) { + if (ch === 34 || ch === 40 || ch === 41 || ch === 44) + return false; + continue; + } + + return false; + } + return true; } exports._checkIsHttpToken = checkIsHttpToken; + +/** + * True if val contains an invalid field-vchar + * field-value = *( field-content / obs-fold ) + * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] + * field-vchar = VCHAR / obs-text + **/ +function checkInvalidHeaderChar(val) { + val = '' + val; + for (var i = 0; i < val.length; i++) { + const ch = val.charCodeAt(i); + if (ch === 9) continue; + if (ch <= 31 || ch > 255 || ch === 127) return true; + } + return false; +} +exports._checkInvalidHeaderChar = checkInvalidHeaderChar; diff --git a/lib/_http_incoming.js b/lib/_http_incoming.js index 5377c84d5d3c7e..6e66ae6d42a9c0 100644 --- a/lib/_http_incoming.js +++ b/lib/_http_incoming.js @@ -20,10 +20,6 @@ exports.readStop = readStop; function IncomingMessage(socket) { Stream.Readable.call(this); - // XXX This implementation is kind of all over the place - // When the parser emits body chunks, they go in this list. - // _read() pulls them out, and when it finds EOF, it ends. - this.socket = socket; this.connection = socket; @@ -165,7 +161,7 @@ IncomingMessage.prototype._addHeaderLine = function(field, value, dest) { default: // make comma-separated list - if (dest[field] !== undefined) { + if (typeof dest[field] === 'string') { dest[field] += ', ' + value; } else { dest[field] = value; diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index e28609f8869a11..77f0b8f9e63125 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -91,8 +91,6 @@ exports.OutgoingMessage = OutgoingMessage; OutgoingMessage.prototype.setTimeout = function(msecs, callback) { if (callback) { - if (typeof callback !== 'function') - throw new TypeError('callback must be a function'); this.on('timeout', callback); } @@ -307,8 +305,10 @@ function storeHeader(self, state, field, value) { throw new TypeError( 'Header name must be a valid HTTP Token ["' + field + '"]'); } - value = escapeHeaderValue(value); - state.messageHeader += field + ': ' + value + CRLF; + if (common._checkInvalidHeaderChar(value) === true) { + throw new TypeError('The header content contains invalid characters'); + } + state.messageHeader += field + ': ' + escapeHeaderValue(value) + CRLF; if (connectionExpression.test(field)) { state.sentConnectionHeader = true; @@ -344,7 +344,9 @@ OutgoingMessage.prototype.setHeader = function(name, value) { throw new Error('`value` required in setHeader("' + name + '", value).'); if (this._header) throw new Error('Can\'t set headers after they are sent.'); - + if (common._checkInvalidHeaderChar(value) === true) { + throw new TypeError('The header content contains invalid characters'); + } if (this._headers === null) this._headers = {}; @@ -487,8 +489,7 @@ function writeAfterEndNT(self, err, callback) { function connectionCorkNT(conn) { - if (conn) - conn.uncork(); + conn.uncork(); } @@ -517,6 +518,9 @@ OutgoingMessage.prototype.addTrailers = function(headers) { throw new TypeError( 'Trailer name must be a valid HTTP Token ["' + field + '"]'); } + if (common._checkInvalidHeaderChar(value) === true) { + throw new TypeError('The header content contains invalid characters'); + } this._trailer += field + ': ' + escapeHeaderValue(value) + CRLF; } }; @@ -574,7 +578,7 @@ OutgoingMessage.prototype.end = function(data, encoding, callback) { var ret; if (data) { // Normal body write. - ret = this.write(data, encoding); + this.write(data, encoding); } if (this._hasBody && this.chunkedEncoding) { diff --git a/lib/_http_server.js b/lib/_http_server.js index dc7276d0ae729d..905cc3c0b8833c 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -2,7 +2,6 @@ const util = require('util'); const net = require('net'); -const EventEmitter = require('events'); const HTTPParser = process.binding('http_parser').HTTPParser; const assert = require('assert').ok; const common = require('_http_common'); @@ -64,7 +63,8 @@ const STATUS_CODES = exports.STATUS_CODES = { 426 : 'Upgrade Required', // RFC 2817 428 : 'Precondition Required', // RFC 6585 429 : 'Too Many Requests', // RFC 6585 - 431 : 'Request Header Fields Too Large',// RFC 6585 + 431 : 'Request Header Fields Too Large', // RFC 6585 + 451 : 'Unavailable For Legal Reasons', 500 : 'Internal Server Error', 501 : 'Not Implemented', 502 : 'Bad Gateway', @@ -187,6 +187,10 @@ ServerResponse.prototype.writeHead = function(statusCode, reason, obj) { headers = obj; } + statusCode |= 0; + if (statusCode < 100 || statusCode > 999) + throw new RangeError(`Invalid status code: ${statusCode}`); + var statusLine = 'HTTP/1.1 ' + statusCode.toString() + ' ' + this.statusMessage + CRLF; @@ -364,6 +368,7 @@ function connectionListener(socket) { } function onParserExecute(ret, d) { + socket._unrefTimer(); debug('SERVER socketOnParserExecute %d', ret); onParserExecuteCommon(ret, undefined); } @@ -390,7 +395,7 @@ function connectionListener(socket) { parser = null; var eventName = req.method === 'CONNECT' ? 'connect' : 'upgrade'; - if (EventEmitter.listenerCount(self, eventName) > 0) { + if (self.listenerCount(eventName) > 0) { debug('SERVER have listener for %s', eventName); var bodyHead = d.slice(bytesParsed, d.length); @@ -404,7 +409,7 @@ function connectionListener(socket) { } } - if (socket._paused) { + if (socket._paused && socket.parser) { // onIncoming paused the socket, we should pause the parser as well debug('pause parser'); socket.parser.pause(); @@ -445,7 +450,8 @@ function connectionListener(socket) { // If we previously paused, then start reading again. if (socket._paused && !needPause) { socket._paused = false; - socket.parser.resume(); + if (socket.parser) + socket.parser.resume(); socket.resume(); } } @@ -484,7 +490,7 @@ function connectionListener(socket) { } // When we're finished writing the response, check if this is the last - // respose, if so destroy the socket. + // response, if so destroy the socket. res.on('finish', resOnFinish); function resOnFinish() { // Usually the first incoming element should be our request. it may @@ -514,14 +520,23 @@ function connectionListener(socket) { } if (req.headers.expect !== undefined && - (req.httpVersionMajor == 1 && req.httpVersionMinor == 1) && - continueExpression.test(req.headers['expect'])) { - res._expect_continue = true; - if (EventEmitter.listenerCount(self, 'checkContinue') > 0) { - self.emit('checkContinue', req, res); + (req.httpVersionMajor == 1 && req.httpVersionMinor == 1)) { + if (continueExpression.test(req.headers.expect)) { + res._expect_continue = true; + + if (self.listenerCount('checkContinue') > 0) { + self.emit('checkContinue', req, res); + } else { + res.writeContinue(); + self.emit('request', req, res); + } } else { - res.writeContinue(); - self.emit('request', req, res); + if (self.listenerCount('checkExpectation') > 0) { + self.emit('checkExpectation', req, res); + } else { + res.writeHead(417); + res.end(); + } } } else { self.emit('request', req, res); diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index ab47830767c525..5d29b86ab6a491 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -51,6 +51,7 @@ function ReadableState(options, stream) { this.needReadable = false; this.emittedReadable = false; this.readableListening = false; + this.resumeScheduled = false; // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. @@ -129,32 +130,39 @@ function readableAddChunk(stream, state, chunk, encoding, addToFront) { onEofChunk(stream, state); } else if (state.objectMode || chunk && chunk.length > 0) { if (state.ended && !addToFront) { - var e = new Error('stream.push() after EOF'); + const e = new Error('stream.push() after EOF'); stream.emit('error', e); } else if (state.endEmitted && addToFront) { - var e = new Error('stream.unshift() after end event'); + const e = new Error('stream.unshift() after end event'); stream.emit('error', e); } else { - if (state.decoder && !addToFront && !encoding) + var skipAdd; + if (state.decoder && !addToFront && !encoding) { chunk = state.decoder.write(chunk); + skipAdd = (!state.objectMode && chunk.length === 0); + } if (!addToFront) state.reading = false; - // if we want the data now, just emit it. - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) - state.buffer.unshift(chunk); - else - state.buffer.push(chunk); - - if (state.needReadable) - emitReadable(stream); + // Don't add to the buffer if we've decoded to an empty string chunk and + // we're not in object mode + if (!skipAdd) { + // if we want the data now, just emit it. + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) + state.buffer.unshift(chunk); + else + state.buffer.push(chunk); + + if (state.needReadable) + emitReadable(stream); + } } maybeReadMore(stream, state); @@ -530,9 +538,9 @@ Readable.prototype.pipe = function(dest, pipeOpts) { // If the user unpiped during `dest.write()`, it is possible // to get stuck in a permanently paused state if that write // also returned false. - if (state.pipesCount === 1 && - state.pipes[0] === dest && - src.listenerCount('data') === 1 && + // => Check whether `dest` is still a piping destination. + if (((state.pipesCount === 1 && state.pipes === dest) || + (state.pipesCount > 1 && state.pipes.indexOf(dest) !== -1)) && !cleanedUp) { debug('false write response, pause', src._readableState.awaitDrain); src._readableState.awaitDrain++; @@ -639,13 +647,13 @@ Readable.prototype.unpipe = function(dest) { state.pipesCount = 0; state.flowing = false; - for (var i = 0; i < len; i++) + for (let i = 0; i < len; i++) dests[i].emit('unpipe', this); return this; } // try to find the right one. - var i = state.pipes.indexOf(dest); + const i = state.pipes.indexOf(dest); if (i === -1) return this; @@ -670,7 +678,7 @@ Readable.prototype.on = function(ev, fn) { this.resume(); } - if (ev === 'readable' && this.readable) { + if (ev === 'readable' && !this._readableState.endEmitted) { var state = this._readableState; if (!state.readableListening) { state.readableListening = true; @@ -846,7 +854,7 @@ function fromList(n, state) { if (n < list[0].length) { // just take a part of the first list item. // slice is the same for buffers and strings. - var buf = list[0]; + const buf = list[0]; ret = buf.slice(0, n); list[0] = buf.slice(n); } else if (n === list[0].length) { @@ -862,7 +870,7 @@ function fromList(n, state) { var c = 0; for (var i = 0, l = list.length; i < l && c < n; i++) { - var buf = list[0]; + const buf = list[0]; var cpy = Math.min(n - c, buf.length); if (stringMode) diff --git a/lib/_stream_transform.js b/lib/_stream_transform.js index 8ff428e11ffed0..9c24394b7d88fa 100644 --- a/lib/_stream_transform.js +++ b/lib/_stream_transform.js @@ -58,6 +58,7 @@ function TransformState(stream) { this.transforming = false; this.writecb = null; this.writechunk = null; + this.writeencoding = null; } function afterTransform(stream, er, data) { @@ -75,8 +76,7 @@ function afterTransform(stream, er, data) { if (data !== null && data !== undefined) stream.push(data); - if (cb) - cb(er); + cb(er); var rs = stream._readableState; rs.reading = false; diff --git a/lib/_stream_wrap.js b/lib/_stream_wrap.js index 924d07a986a906..7eb3008484b2aa 100644 --- a/lib/_stream_wrap.js +++ b/lib/_stream_wrap.js @@ -4,6 +4,7 @@ const assert = require('assert'); const util = require('util'); const Socket = require('net').Socket; const JSStream = process.binding('js_stream').JSStream; +const Buffer = require('buffer').Buffer; const uv = process.binding('uv'); const debug = util.debuglog('stream_wrap'); @@ -39,15 +40,24 @@ function StreamWrap(stream) { }; this.stream.pause(); - this.stream.on('error', function(err) { + this.stream.on('error', function onerror(err) { self.emit('error', err); }); - this.stream.on('data', function(chunk) { + this.stream.on('data', function ondata(chunk) { + if (!(chunk instanceof Buffer)) { + // Make sure that no further `data` events will happen + this.pause(); + this.removeListener('data', ondata); + + self.emit('error', new Error('Stream has StringDecoder')); + return; + } + debug('data', chunk.length); if (self._handle) self._handle.readBuffer(chunk); }); - this.stream.once('end', function() { + this.stream.once('end', function onend() { debug('end'); if (self._handle) self._handle.emitEOF(); diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js index 9c7e2630161cd9..18e07241c0d3c3 100644 --- a/lib/_stream_writable.js +++ b/lib/_stream_writable.js @@ -108,6 +108,13 @@ function WritableState(options, stream) { // True if the error was already emitted and should not be thrown again this.errorEmitted = false; + + // count buffered requests + this.bufferedRequestCount = 0; + + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + this.corkedRequestsFree = new CorkedRequest(this); } WritableState.prototype.getBuffer = function writableStateGetBuffer() { @@ -274,6 +281,7 @@ function writeOrBuffer(stream, state, chunk, encoding, cb) { } else { state.bufferedRequest = state.lastBufferedRequest; } + state.bufferedRequestCount += 1; } else { doWrite(stream, state, false, len, chunk, encoding, cb); } @@ -357,7 +365,6 @@ function onwriteDrain(stream, state) { } } - // if there's something in the buffer waiting, then process it function clearBuffer(stream, state) { state.bufferProcessing = true; @@ -365,26 +372,30 @@ function clearBuffer(stream, state) { if (stream._writev && entry && entry.next) { // Fast case, write everything using _writev() - var buffer = []; - var cbs = []; + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + + var count = 0; while (entry) { - cbs.push(entry.callback); - buffer.push(entry); + buffer[count] = entry; entry = entry.next; + count += 1; } - // count the one we are adding, as well. - // TODO(isaacs) clean this up + doWrite(stream, state, true, state.length, buffer, '', holder.finish); + + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite state.pendingcb++; state.lastBufferedRequest = null; - doWrite(stream, state, true, state.length, buffer, '', function(err) { - for (var i = 0; i < cbs.length; i++) { - state.pendingcb--; - cbs[i](err); - } - }); - - // Clear buffer + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } } else { // Slow case, write chunks one-by-one while (entry) { @@ -407,6 +418,8 @@ function clearBuffer(stream, state) { if (entry === null) state.lastBufferedRequest = null; } + + state.bufferedRequestCount = 0; state.bufferedRequest = entry; state.bufferProcessing = false; } @@ -483,4 +496,28 @@ function endWritable(stream, state, cb) { stream.once('finish', cb); } state.ended = true; + stream.writable = false; +} + +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + this.next = null; + this.entry = null; + + this.finish = (err) => { + var entry = this.entry; + this.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = this; + } else { + state.corkedRequestsFree = this; + } + }; } diff --git a/lib/_tls_common.js b/lib/_tls_common.js index 120dce5784b27b..390478df7bbc49 100644 --- a/lib/_tls_common.js +++ b/lib/_tls_common.js @@ -47,7 +47,7 @@ exports.createSecureContext = function createSecureContext(options, context) { // cert's issuer in C++ code. if (options.ca) { if (Array.isArray(options.ca)) { - for (var i = 0, len = options.ca.length; i < len; i++) { + for (let i = 0, len = options.ca.length; i < len; i++) { c.context.addCACert(options.ca[i]); } } else { @@ -59,7 +59,7 @@ exports.createSecureContext = function createSecureContext(options, context) { if (options.cert) { if (Array.isArray(options.cert)) { - for (var i = 0; i < options.cert.length; i++) + for (let i = 0; i < options.cert.length; i++) c.context.setCert(options.cert[i]); } else { c.context.setCert(options.cert); @@ -72,7 +72,7 @@ exports.createSecureContext = function createSecureContext(options, context) { // which leads to the crash later on. if (options.key) { if (Array.isArray(options.key)) { - for (var i = 0; i < options.key.length; i++) { + for (let i = 0; i < options.key.length; i++) { var key = options.key[i]; if (key.passphrase) @@ -107,7 +107,7 @@ exports.createSecureContext = function createSecureContext(options, context) { if (options.crl) { if (Array.isArray(options.crl)) { - for (var i = 0, len = options.crl.length; i < len; i++) { + for (let i = 0, len = options.crl.length; i < len; i++) { c.context.addCRL(options.crl[i]); } } else { diff --git a/lib/_tls_legacy.js b/lib/_tls_legacy.js index 1d700c9218f538..6fcd02239c2580 100644 --- a/lib/_tls_legacy.js +++ b/lib/_tls_legacy.js @@ -177,7 +177,7 @@ CryptoStream.prototype._write = function write(data, encoding, cb) { if (this.pair.encrypted._internallyPendingBytes()) this.pair.encrypted.read(0); - // Get NPN and Server name when ready + // Get ALPN, NPN and Server name when ready this.pair.maybeInitFinished(); // Whole buffer was written @@ -224,9 +224,9 @@ CryptoStream.prototype._write = function write(data, encoding, cb) { CryptoStream.prototype._writePending = function writePending() { - var data = this._pending, - encoding = this._pendingEncoding, - cb = this._pendingCallback; + const data = this._pending; + const encoding = this._pendingEncoding; + const cb = this._pendingCallback; this._pending = null; this._pendingEncoding = ''; @@ -252,9 +252,9 @@ CryptoStream.prototype._read = function read(size) { out = this.pair.ssl.encOut; } - var bytesRead = 0, - start = this._buffer.offset, - last = start; + var bytesRead = 0; + const start = this._buffer.offset; + var last = start; do { assert(last === this._buffer.offset); var read = this._buffer.use(this.pair.ssl, out, size - bytesRead); @@ -273,7 +273,7 @@ CryptoStream.prototype._read = function read(size) { bytesRead < size && this.pair.ssl !== null); - // Get NPN and Server name when ready + // Get ALPN, NPN and Server name when ready this.pair.maybeInitFinished(); // Create new buffer if previous was filled up @@ -604,8 +604,8 @@ function onhandshakedone() { function onclienthello(hello) { - var self = this, - once = false; + const self = this; + var once = false; this._resumingSession = true; function callback(err, session) { @@ -614,13 +614,15 @@ function onclienthello(hello) { if (err) return self.socket.destroy(err); - self.ssl.loadSession(session); - self.ssl.endParser(); + setImmediate(function() { + self.ssl.loadSession(session); + self.ssl.endParser(); - // Cycle data - self._resumingSession = false; - self.cleartext.read(0); - self.encrypted.read(0); + // Cycle data + self._resumingSession = false; + self.cleartext.read(0); + self.encrypted.read(0); + }); } if (hello.sessionId.length <= 0 || @@ -704,14 +706,15 @@ function SecurePair(context, isServer, requestCert, rejectUnauthorized, this._rejectUnauthorized); if (this._isServer) { - this.ssl.onhandshakestart = onhandshakestart.bind(this); - this.ssl.onhandshakedone = onhandshakedone.bind(this); - this.ssl.onclienthello = onclienthello.bind(this); - this.ssl.onnewsession = onnewsession.bind(this); + this.ssl.onhandshakestart = () => onhandshakestart.call(this); + this.ssl.onhandshakedone = () => onhandshakedone.call(this); + this.ssl.onclienthello = (hello) => onclienthello.call(this, hello); + this.ssl.onnewsession = + (key, session) => onnewsession.call(this, key, session); this.ssl.lastHandshakeTime = 0; this.ssl.handshakes = 0; } else { - this.ssl.onocspresponse = onocspresponse.bind(this); + this.ssl.onocspresponse = (resp) => onocspresponse.call(this, resp); } if (process.features.tls_sni) { @@ -726,6 +729,13 @@ function SecurePair(context, isServer, requestCert, rejectUnauthorized, this.npnProtocol = null; } + if (process.features.tls_alpn && options.ALPNProtocols) { + // keep reference in secureContext not to be GC-ed + this.ssl._secureContext.alpnBuffer = options.ALPNProtocols; + this.ssl.setALPNrotocols(this.ssl._secureContext.alpnBuffer); + this.alpnProtocol = null; + } + /* Acts as a r/w stream to the cleartext side of the stream. */ this.cleartext = new CleartextStream(this, options.cleartext); @@ -761,11 +771,13 @@ function securePairNT(self, options) { exports.createSecurePair = function(context, isServer, requestCert, - rejectUnauthorized) { + rejectUnauthorized, + options) { var pair = new SecurePair(context, isServer, requestCert, - rejectUnauthorized); + rejectUnauthorized, + options); return pair; }; @@ -776,6 +788,10 @@ SecurePair.prototype.maybeInitFinished = function() { this.npnProtocol = this.ssl.getNegotiatedProtocol(); } + if (process.features.tls_alpn) { + this.alpnProtocol = this.ssl.getALPNNegotiatedProtocol(); + } + if (process.features.tls_sni) { this.servername = this.ssl.getServername(); } diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 6a1c295ce31034..7516c4c9b11c0b 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -14,6 +14,21 @@ const Timer = process.binding('timer_wrap').Timer; const tls_wrap = process.binding('tls_wrap'); const TCP = process.binding('tcp_wrap').TCP; const Pipe = process.binding('pipe_wrap').Pipe; +const defaultSessionIdContext = getDefaultSessionIdContext(); + +function getDefaultSessionIdContext() { + var defaultText = process.argv.join(' '); + /* SSL_MAX_SID_CTX_LENGTH is 128 bits */ + if (process.config.variables.openssl_fips) { + return crypto.createHash('sha1') + .update(defaultText) + .digest('hex').slice(0, 32); + } else { + return crypto.createHash('md5') + .update(defaultText) + .digest('hex'); + } +} function onhandshakestart() { debug('onhandshakestart'); @@ -228,7 +243,10 @@ function initRead(tls, wrapped) { */ function TLSSocket(socket, options) { - this._tlsOptions = options; + if (options === undefined) + this._tlsOptions = {}; + else + this._tlsOptions = options; this._secureEstablished = false; this._securePending = false; this._newSessionPending = false; @@ -236,6 +254,7 @@ function TLSSocket(socket, options) { this._SNICallback = null; this.servername = null; this.npnProtocol = null; + this.alpnProtocol = null; this.authorized = false; this.authorizationError = null; @@ -295,6 +314,9 @@ proxiedMethods.forEach(function(name) { }); tls_wrap.TLSWrap.prototype.close = function closeProxy(cb) { + if (this.owner) + this.owner.ssl = null; + if (this._parentWrap && this._parentWrap._handle === this._parent) { this._parentWrap.once('close', cb); return this._parentWrap.destroy(); @@ -321,7 +343,7 @@ TLSSocket.prototype._wrapHandle = function(wrap) { tls.createSecureContext(); res = tls_wrap.wrap(handle._externalStream, context.context, - options.isServer); + !!options.isServer); res._parent = handle; res._parentWrap = wrap; res._secureContext = context; @@ -371,16 +393,10 @@ TLSSocket.prototype._init = function(socket, wrap) { this.server = options.server; - // Move the server to TLSSocket, otherwise both `socket.destroy()` and - // `TLSSocket.destroy()` will decrement number of connections of the TLS - // server, leading to misfiring `server.close()` callback - if (socket && socket.server === this.server) - socket.server = null; - // For clients, we will always have either a given ca list or be using // default one - var requestCert = !!options.requestCert || !options.isServer, - rejectUnauthorized = !!options.rejectUnauthorized; + const requestCert = !!options.requestCert || !options.isServer; + const rejectUnauthorized = !!options.rejectUnauthorized; this._requestCert = requestCert; this._rejectUnauthorized = rejectUnauthorized; @@ -388,11 +404,11 @@ TLSSocket.prototype._init = function(socket, wrap) { ssl.setVerifyMode(requestCert, rejectUnauthorized); if (options.isServer) { - ssl.onhandshakestart = onhandshakestart.bind(this); - ssl.onhandshakedone = onhandshakedone.bind(this); - ssl.onclienthello = onclienthello.bind(this); - ssl.oncertcb = oncertcb.bind(this); - ssl.onnewsession = onnewsession.bind(this); + ssl.onhandshakestart = () => onhandshakestart.call(this); + ssl.onhandshakedone = () => onhandshakedone.call(this); + ssl.onclienthello = (hello) => onclienthello.call(this, hello); + ssl.oncertcb = (info) => oncertcb.call(this, info); + ssl.onnewsession = (key, session) => onnewsession.call(this, key, session); ssl.lastHandshakeTime = 0; ssl.handshakes = 0; @@ -406,8 +422,8 @@ TLSSocket.prototype._init = function(socket, wrap) { } } else { ssl.onhandshakestart = function() {}; - ssl.onhandshakedone = this._finishInit.bind(this); - ssl.onocspresponse = onocspresponse.bind(this); + ssl.onhandshakedone = () => this._finishInit(); + ssl.onocspresponse = (resp) => onocspresponse.call(this, resp); if (options.session) ssl.setSession(options.session); @@ -450,6 +466,12 @@ TLSSocket.prototype._init = function(socket, wrap) { if (process.features.tls_npn && options.NPNProtocols) ssl.setNPNProtocols(options.NPNProtocols); + if (process.features.tls_alpn && options.ALPNProtocols) { + // keep reference in secureContext not to be GC-ed + ssl._secureContext.alpnBuffer = options.ALPNProtocols; + ssl.setALPNProtocols(ssl._secureContext.alpnBuffer); + } + if (options.handshakeTimeout > 0) this.setTimeout(options.handshakeTimeout, this._handleTimeout); @@ -476,8 +498,8 @@ TLSSocket.prototype._init = function(socket, wrap) { }; TLSSocket.prototype.renegotiate = function(options, callback) { - var requestCert = this._requestCert, - rejectUnauthorized = this._rejectUnauthorized; + var requestCert = this._requestCert; + var rejectUnauthorized = this._rejectUnauthorized; if (this.destroyed) return; @@ -556,6 +578,10 @@ TLSSocket.prototype._finishInit = function() { this.npnProtocol = this._handle.getNegotiatedProtocol(); } + if (process.features.tls_alpn) { + this.alpnProtocol = this.ssl.getALPNNegotiatedProtocol(); + } + if (process.features.tls_sni && this._tlsOptions.isServer) { this.servername = this._handle.getServername(); } @@ -635,6 +661,13 @@ TLSSocket.prototype.getEphemeralKeyInfo = function() { return null; }; +TLSSocket.prototype.getProtocol = function() { + if (this._handle) + return this._handle.getProtocol(); + + return null; +}; + // TODO: support anonymous (nocert) and PSK @@ -763,6 +796,7 @@ function Server(/* [options], listener */) { rejectUnauthorized: self.rejectUnauthorized, handshakeTimeout: timeout, NPNProtocols: self.NPNProtocols, + ALPNProtocols: self.ALPNProtocols, SNICallback: options.SNICallback || SNICallback }); @@ -873,12 +907,12 @@ Server.prototype.setOptions = function(options) { this.honorCipherOrder = true; if (secureOptions) this.secureOptions = secureOptions; if (options.NPNProtocols) tls.convertNPNProtocols(options.NPNProtocols, this); + if (options.ALPNProtocols) + tls.convertALPNProtocols(options.ALPNProtocols, this); if (options.sessionIdContext) { this.sessionIdContext = options.sessionIdContext; } else { - this.sessionIdContext = crypto.createHash('md5') - .update(process.argv.join(' ')) - .digest('hex'); + this.sessionIdContext = defaultSessionIdContext; } }; @@ -938,7 +972,11 @@ function normalizeConnectArgs(listArgs) { } exports.connect = function(/* [port, host], options, cb */) { - var args = normalizeConnectArgs(arguments); + const argsLen = arguments.length; + var args = new Array(argsLen); + for (var i = 0; i < argsLen; i++) + args[i] = arguments[i]; + args = normalizeConnectArgs(args); var options = args[0]; var cb = args[1]; @@ -957,16 +995,18 @@ exports.connect = function(/* [port, host], options, cb */) { assert(typeof options.minDHSize === 'number', 'options.minDHSize is not a number: ' + options.minDHSize); assert(options.minDHSize > 0, - 'options.minDHSize is not a posivie number: ' + + 'options.minDHSize is not a positive number: ' + options.minDHSize); var hostname = options.servername || options.host || (options.socket && options.socket._host) || - 'localhost', - NPN = {}, - context = tls.createSecureContext(options); + 'localhost'; + const NPN = {}; + const ALPN = {}; + const context = options.secureContext || tls.createSecureContext(options); tls.convertNPNProtocols(options.NPNProtocols, NPN); + tls.convertALPNProtocols(options.ALPNProtocols, ALPN); var socket = new TLSSocket(options.socket, { pipe: options.path && !options.port, @@ -976,6 +1016,7 @@ exports.connect = function(/* [port, host], options, cb */) { rejectUnauthorized: options.rejectUnauthorized, session: options.session, NPNProtocols: NPN.NPNProtocols, + ALPNProtocols: ALPN.ALPNProtocols, requestOCSP: options.requestOCSP }); diff --git a/lib/assert.js b/lib/assert.js index 6b99098c5fda35..698d04766e5eed 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -29,6 +29,7 @@ const compare = process.binding('buffer').compare; const util = require('util'); const Buffer = require('buffer').Buffer; const pSlice = Array.prototype.slice; +const pToString = (obj) => Object.prototype.toString.call(obj); // 1. The assert module provides functions that throw // AssertionError's when particular conditions are not met. The @@ -170,6 +171,19 @@ function _deepEqual(actual, expected, strict) { (expected === null || typeof expected !== 'object')) { return strict ? actual === expected : actual == expected; + // If both values are instances of typed arrays, wrap their underlying + // ArrayBuffers in a Buffer each to increase performance + // This optimization requires the arrays to have the same type as checked by + // Object.prototype.toString (aka pToString). Never perform binary + // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their + // bit patterns are not identical. + } else if (ArrayBuffer.isView(actual) && ArrayBuffer.isView(expected) && + pToString(actual) === pToString(expected) && + !(actual instanceof Float32Array || + actual instanceof Float64Array)) { + return compare(Buffer(actual.buffer), + Buffer(expected.buffer)) === 0; + // 7.5 For all other Object pairs, including Array objects, equivalence is // determined by having the same number of owned properties (as verified // with Object.prototype.hasOwnProperty.call), the same set of keys @@ -193,8 +207,8 @@ function objEquiv(a, b, strict) { return a === b; if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b)) return false; - var aIsArgs = isArguments(a), - bIsArgs = isArguments(b); + const aIsArgs = isArguments(a); + const bIsArgs = isArguments(b); if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs)) return false; if (aIsArgs) { @@ -202,9 +216,9 @@ function objEquiv(a, b, strict) { b = pSlice.call(b); return _deepEqual(a, b, strict); } - var ka = Object.keys(a), - kb = Object.keys(b), - key, i; + const ka = Object.keys(a); + const kb = Object.keys(b); + var key, i; // having the same number of owned properties (keys incorporates // hasOwnProperty) if (ka.length !== kb.length) @@ -278,9 +292,23 @@ function expectedException(actual, expected) { // Ignore. The instanceof check doesn't work for arrow functions. } + if (Error.isPrototypeOf(expected)) { + return false; + } + return expected.call({}, actual) === true; } +function _tryBlock(block) { + var error; + try { + block(); + } catch (e) { + error = e; + } + return error; +} + function _throws(shouldThrow, block, expected, message) { var actual; @@ -293,11 +321,7 @@ function _throws(shouldThrow, block, expected, message) { expected = null; } - try { - block(); - } catch (e) { - actual = e; - } + actual = _tryBlock(block); message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + (message ? ' ' + message : '.'); @@ -306,7 +330,14 @@ function _throws(shouldThrow, block, expected, message) { fail(actual, expected, 'Missing expected exception' + message); } - if (!shouldThrow && expectedException(actual, expected)) { + const userProvidedMessage = typeof message === 'string'; + const isUnwantedException = !shouldThrow && util.isError(actual); + const isUnexpectedException = !shouldThrow && actual && !expected; + + if ((isUnwantedException && + userProvidedMessage && + expectedException(actual, expected)) || + isUnexpectedException) { fail(actual, expected, 'Got unwanted exception' + message); } @@ -320,12 +351,12 @@ function _throws(shouldThrow, block, expected, message) { // assert.throws(block, Error_opt, message_opt); assert.throws = function(block, /*optional*/error, /*optional*/message) { - _throws.apply(this, [true].concat(pSlice.call(arguments))); + _throws(true, block, error, message); }; // EXTENSION! This is annoying to write outside this module. -assert.doesNotThrow = function(block, /*optional*/message) { - _throws.apply(this, [false].concat(pSlice.call(arguments))); +assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) { + _throws(false, block, error, message); }; assert.ifError = function(err) { if (err) throw err; }; diff --git a/lib/buffer.js b/lib/buffer.js index 41d5e0aba2d536..33765d5d8f52b4 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -10,22 +10,69 @@ exports.SlowBuffer = SlowBuffer; exports.INSPECT_MAX_BYTES = 50; exports.kMaxLength = binding.kMaxLength; +const kFromErrorMsg = 'must start with number, buffer, array or string'; Buffer.poolSize = 8 * 1024; var poolSize, poolOffset, allocPool; binding.setupBufferJS(Buffer.prototype, bindingObj); + +const swap16n = binding.swap16; +const swap32n = binding.swap32; + +function swap(b, n, m) { + const i = b[n]; + b[n] = b[m]; + b[m] = i; +} + +Buffer.prototype.swap16 = function swap16() { + // For Buffer.length < 512, it's generally faster to + // do the swap in javascript. For larger buffers, + // dropping down to the native code is faster. + const len = this.length; + if (len % 2 !== 0) + throw new RangeError('Buffer size must be a multiple of 16-bits'); + if (len < 512) { + for (var i = 0; i < len; i += 2) + swap(this, i, i + 1); + return this; + } + return swap16n.apply(this); +}; + +Buffer.prototype.swap32 = function swap32() { + // For Buffer.length < 1024, it's generally faster to + // do the swap in javascript. For larger buffers, + // dropping down to the native code is faster. + const len = this.length; + if (len % 4 !== 0) + throw new RangeError('Buffer size must be a multiple of 32-bits'); + if (len < 1024) { + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3); + swap(this, i + 1, i + 2); + } + return this; + } + return swap32n.apply(this); +}; + const flags = bindingObj.flags; const kNoZeroFill = 0; +function createBuffer(size) { + const ui8 = new Uint8Array(size); + Object.setPrototypeOf(ui8, Buffer.prototype); + return ui8; +} function createPool() { poolSize = Buffer.poolSize; if (poolSize > 0) flags[kNoZeroFill] = 1; - allocPool = new Uint8Array(poolSize); - Object.setPrototypeOf(allocPool, Buffer.prototype); + allocPool = createBuffer(poolSize); poolOffset = 0; } createPool(); @@ -40,36 +87,76 @@ function alignPool() { } -function Buffer(arg) { +function Buffer(arg, encodingOrOffset, length) { // Common case. - if (typeof arg === 'number') { - // If less than zero, or NaN. - if (arg < 0 || arg !== arg) - arg = 0; - return allocate(arg); - } - - // Slightly less common case. - if (typeof arg === 'string') { - return fromString(arg, arguments[1]); - } - - // Unusual. - return fromObject(arg); + if (typeof arg === 'number') + return Buffer.allocUnsafe(arg); + return Buffer.from(arg, encodingOrOffset, length); } +/** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ +Buffer.from = function(value, encodingOrOffset, length) { + if (typeof value === 'number') + throw new TypeError('"value" argument must not be a number'); + + if (value instanceof ArrayBuffer) + return fromArrayBuffer(value, encodingOrOffset, length); + + if (typeof value === 'string') + return fromString(value, encodingOrOffset); + + return fromObject(value); +}; + Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype); Object.setPrototypeOf(Buffer, Uint8Array); +/** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ +Buffer.alloc = function(size, fill, encoding) { + if (typeof size !== 'number') + throw new TypeError('"size" argument must be a number'); + if (size <= 0) + return createBuffer(size); + if (fill !== undefined) { + // Since we are filling anyway, don't zero fill initially. + flags[kNoZeroFill] = 1; + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpretted as a start offset. + return typeof encoding === 'string' ? + createBuffer(size).fill(fill, encoding) : + createBuffer(size).fill(fill); + } + flags[kNoZeroFill] = 0; + return createBuffer(size); +}; + +/** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer + * instance. If `--zero-fill-buffers` is set, will zero-fill the buffer. + **/ +Buffer.allocUnsafe = function(size) { + if (typeof size !== 'number') + throw new TypeError('"size" argument must be a number'); + return allocate(size); +}; function SlowBuffer(length) { if (+length != length) length = 0; if (length > 0) flags[kNoZeroFill] = 1; - const ui8 = new Uint8Array(+length); - Object.setPrototypeOf(ui8, Buffer.prototype); - return ui8; + return createBuffer(+length); } Object.setPrototypeOf(SlowBuffer.prototype, Uint8Array.prototype); @@ -78,9 +165,7 @@ Object.setPrototypeOf(SlowBuffer, Uint8Array); function allocate(size) { if (size === 0) { - const ui8 = new Uint8Array(size); - Object.setPrototypeOf(ui8, Buffer.prototype); - return ui8; + return createBuffer(size); } if (size < (Buffer.poolSize >>> 1)) { if (size > (poolSize - poolOffset)) @@ -95,9 +180,7 @@ function allocate(size) { // being zero filled. if (size > 0) flags[kNoZeroFill] = 1; - const ui8 = new Uint8Array(size); - Object.setPrototypeOf(ui8, Buffer.prototype); - return ui8; + return createBuffer(size); } } @@ -119,52 +202,49 @@ function fromString(string, encoding) { return b; } +function fromArrayLike(obj) { + const length = obj.length; + const b = allocate(length); + for (var i = 0; i < length; i++) + b[i] = obj[i] & 255; + return b; +} + +function fromArrayBuffer(obj, byteOffset, length) { + byteOffset >>>= 0; + + if (typeof length === 'undefined') + return binding.createFromArrayBuffer(obj, byteOffset); + + length >>>= 0; + return binding.createFromArrayBuffer(obj, byteOffset, length); +} function fromObject(obj) { if (obj instanceof Buffer) { - var b = allocate(obj.length); - obj.copy(b, 0, 0, obj.length); - return b; - } - - if (Array.isArray(obj)) { - var length = obj.length; - var b = allocate(length); - for (var i = 0; i < length; i++) - b[i] = obj[i] & 255; - return b; - } + const b = allocate(obj.length); - if (obj == null) { - throw new TypeError('must start with number, buffer, array or string'); - } + if (b.length === 0) + return b; - if (obj instanceof ArrayBuffer) { - return binding.createFromArrayBuffer(obj); + obj.copy(b, 0, 0, obj.length); + return b; } - if (obj.buffer instanceof ArrayBuffer || obj.length) { - var length; - if (typeof obj.length !== 'number' || obj.length !== obj.length) - length = 0; - else - length = obj.length; - var b = allocate(length); - for (var i = 0; i < length; i++) { - b[i] = obj[i] & 255; + if (obj) { + if (obj.buffer instanceof ArrayBuffer || 'length' in obj) { + if (typeof obj.length !== 'number' || obj.length !== obj.length) { + return allocate(0); + } + return fromArrayLike(obj); } - return b; - } - if (obj.type === 'Buffer' && Array.isArray(obj.data)) { - var array = obj.data; - var b = allocate(array.length); - for (var i = 0; i < array.length; i++) - b[i] = array[i] & 255; - return b; + if (obj.type === 'Buffer' && Array.isArray(obj.data)) { + return fromArrayLike(obj.data); + } } - throw new TypeError('must start with number, buffer, array or string'); + throw new TypeError(kFromErrorMsg); } @@ -216,24 +296,27 @@ Buffer.isEncoding = function(encoding) { Buffer.concat = function(list, length) { + var i; if (!Array.isArray(list)) - throw new TypeError('list argument must be an Array of Buffers.'); + throw new TypeError('list argument must be an Array of Buffers'); if (list.length === 0) - return new Buffer(0); + return Buffer.alloc(0); if (length === undefined) { length = 0; - for (var i = 0; i < list.length; i++) + for (i = 0; i < list.length; i++) length += list[i].length; } else { length = length >>> 0; } - var buffer = new Buffer(length); + var buffer = Buffer.allocUnsafe(length); var pos = 0; - for (var i = 0; i < list.length; i++) { + for (i = 0; i < list.length; i++) { var buf = list[i]; + if (!Buffer.isBuffer(buf)) + throw new TypeError('list argument must be an Array of Buffers'); buf.copy(buffer, pos); pos += buf.length; } @@ -255,8 +338,12 @@ function base64ByteLength(str, bytes) { function byteLength(string, encoding) { - if (typeof string !== 'string') + if (typeof string !== 'string') { + if (ArrayBuffer.isView(string) || string instanceof ArrayBuffer) + return string.byteLength; + string = '' + string; + } var len = string.length; if (len === 0) @@ -272,6 +359,7 @@ function byteLength(string, encoding) { case 'utf8': case 'utf-8': + case undefined: return binding.byteLengthUtf8(string); case 'ucs2': @@ -326,13 +414,34 @@ Object.defineProperty(Buffer.prototype, 'offset', { function slowToString(encoding, start, end) { var loweredCase = false; - start = start >>> 0; - end = end === undefined || end === Infinity ? this.length : end >>> 0; + // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. + + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + if (start === undefined || start < 0) + start = 0; + // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + if (start > this.length) + return ''; + + if (end === undefined || end > this.length) + end = this.length; + + if (end <= 0) + return ''; + + // Force coersion to uint32. This will also coerce falsey/NaN values to 0. + end >>>= 0; + start >>>= 0; + + if (end <= start) + return ''; if (!encoding) encoding = 'utf8'; - if (start < 0) start = 0; - if (end > this.length) end = this.length; - if (end <= start) return ''; while (true) { switch (encoding) { @@ -369,10 +478,11 @@ function slowToString(encoding, start, end) { Buffer.prototype.toString = function() { + let result; if (arguments.length === 0) { - var result = this.utf8Slice(0, this.length); + result = this.utf8Slice(0, this.length); } else { - var result = slowToString.apply(this, arguments); + result = slowToString.apply(this, arguments); } if (result === undefined) throw new Error('toString failed'); @@ -403,15 +513,44 @@ Buffer.prototype.inspect = function inspect() { return '<' + this.constructor.name + ' ' + str + '>'; }; +Buffer.prototype.compare = function compare(target, + start, + end, + thisStart, + thisEnd) { -Buffer.prototype.compare = function compare(b) { - if (!(b instanceof Buffer)) + if (!(target instanceof Buffer)) throw new TypeError('Argument must be a Buffer'); - if (this === b) + if (start === undefined) + start = 0; + if (end === undefined) + end = target ? target.length : 0; + if (thisStart === undefined) + thisStart = 0; + if (thisEnd === undefined) + thisEnd = this.length; + + if (start < 0 || + end > target.length || + thisStart < 0 || + thisEnd > this.length) { + throw new RangeError('out of range index'); + } + + if (thisStart >= thisEnd && start >= end) return 0; + if (thisStart >= thisEnd) + return -1; + if (start >= end) + return 1; + + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; - return binding.compare(this, b); + return binding.compareOffset(this, target, start, thisStart, end, thisEnd); }; function slowIndexOf(buffer, val, byteOffset, encoding) { @@ -431,7 +570,7 @@ function slowIndexOf(buffer, val, byteOffset, encoding) { case 'ascii': case 'hex': return binding.indexOfBuffer( - buffer, Buffer(val, encoding), byteOffset, encoding); + buffer, Buffer.from(val, encoding), byteOffset, encoding); default: if (loweredCase) { @@ -445,10 +584,14 @@ function slowIndexOf(buffer, val, byteOffset, encoding) { } Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) { - if (byteOffset > 0x7fffffff) + if (typeof byteOffset === 'string') { + encoding = byteOffset; + byteOffset = 0; + } else if (byteOffset > 0x7fffffff) { byteOffset = 0x7fffffff; - else if (byteOffset < -0x80000000) + } else if (byteOffset < -0x80000000) { byteOffset = -0x80000000; + } byteOffset >>= 0; if (typeof val === 'string') { @@ -466,24 +609,58 @@ Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) { }; -Buffer.prototype.fill = function fill(val, start, end) { - start = start >> 0; - end = (end === undefined) ? this.length : end >> 0; +Buffer.prototype.includes = function includes(val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1; +}; + + +// Usage: +// buffer.fill(number[, offset[, end]]) +// buffer.fill(buffer[, offset[, end]]) +// buffer.fill(string[, offset[, end]][, encoding]) +Buffer.prototype.fill = function fill(val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start; + start = 0; + end = this.length; + } else if (typeof end === 'string') { + encoding = end; + end = this.length; + } + if (val.length === 1) { + var code = val.charCodeAt(0); + if (code < 256) + val = code; + } + if (val.length === 0) { + // Previously, if val === '', the Buffer would not fill, + // which is rather surprising. + val = 0; + } + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string'); + } + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding); + } + + } else if (typeof val === 'number') { + val = val & 255; + } + // Invalid ranges are not set to a default, so can range check early. if (start < 0 || end > this.length) throw new RangeError('out of range index'); + if (end <= start) return this; - if (typeof val !== 'string') { - val = val >>> 0; - } else if (val.length === 1) { - var code = val.charCodeAt(0); - if (code < 256) - val = code; - } + start = start >>> 0; + end = end === undefined ? this.length : end >>> 0; - binding.fill(this, val, start, end); + binding.fill(this, val, start, end, encoding); return this; }; @@ -507,8 +684,6 @@ Buffer.prototype.set = internalUtil.deprecate(function set(offset, v) { }, 'Buffer.set is deprecated. Use array indexes instead.'); -// TODO(trevnorris): fix these checks to follow new standard -// write(string, offset = 0, length = buffer.length, encoding = 'utf8') var writeWarned = false; const writeMsg = 'Buffer.write(string, encoding, offset, length) is ' + 'deprecated. Use write(string[, offset[, length]]' + @@ -601,8 +776,6 @@ Buffer.prototype.toJSON = function() { }; -// TODO(trevnorris): currently works like Array.prototype.slice(), which -// doesn't follow the new standard for throwing on out of range indexes. Buffer.prototype.slice = function slice(start, end) { const buffer = this.subarray(start, end); Object.setPrototypeOf(buffer, Buffer.prototype); @@ -832,8 +1005,10 @@ Buffer.prototype.writeUIntLE = function(value, offset, byteLength, noAssert) { value = +value; offset = offset >>> 0; byteLength = byteLength >>> 0; - if (!noAssert) - checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0); + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } var mul = 1; var i = 0; @@ -849,8 +1024,10 @@ Buffer.prototype.writeUIntBE = function(value, offset, byteLength, noAssert) { value = +value; offset = offset >>> 0; byteLength = byteLength >>> 0; - if (!noAssert) - checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength), 0); + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } var i = byteLength - 1; var mul = 1; @@ -934,10 +1111,13 @@ Buffer.prototype.writeIntLE = function(value, offset, byteLength, noAssert) { var i = 0; var mul = 1; - var sub = value < 0 ? 1 : 0; + var sub = 0; this[offset] = value; - while (++i < byteLength && (mul *= 0x100)) + while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) + sub = 1; this[offset + i] = ((value / mul) >> 0) - sub; + } return offset + byteLength; }; @@ -957,10 +1137,13 @@ Buffer.prototype.writeIntBE = function(value, offset, byteLength, noAssert) { var i = byteLength - 1; var mul = 1; - var sub = value < 0 ? 1 : 0; + var sub = 0; this[offset + i] = value; - while (--i >= 0 && (mul *= 0x100)) + while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) + sub = 1; this[offset + i] = ((value / mul) >> 0) - sub; + } return offset + byteLength; }; @@ -1024,20 +1207,13 @@ Buffer.prototype.writeInt32BE = function(value, offset, noAssert) { }; -function checkFloat(buffer, value, offset, ext) { - if (!(buffer instanceof Buffer)) - throw new TypeError('buffer must be a Buffer instance'); - if (offset + ext > buffer.length) - throw new RangeError('index out of range'); -} - - Buffer.prototype.writeFloatLE = function writeFloatLE(val, offset, noAssert) { val = +val; offset = offset >>> 0; if (!noAssert) - checkFloat(this, val, offset, 4); - binding.writeFloatLE(this, val, offset); + binding.writeFloatLE(this, val, offset); + else + binding.writeFloatLE(this, val, offset, true); return offset + 4; }; @@ -1046,8 +1222,9 @@ Buffer.prototype.writeFloatBE = function writeFloatBE(val, offset, noAssert) { val = +val; offset = offset >>> 0; if (!noAssert) - checkFloat(this, val, offset, 4); - binding.writeFloatBE(this, val, offset); + binding.writeFloatBE(this, val, offset); + else + binding.writeFloatBE(this, val, offset, true); return offset + 4; }; @@ -1056,8 +1233,9 @@ Buffer.prototype.writeDoubleLE = function writeDoubleLE(val, offset, noAssert) { val = +val; offset = offset >>> 0; if (!noAssert) - checkFloat(this, val, offset, 8); - binding.writeDoubleLE(this, val, offset); + binding.writeDoubleLE(this, val, offset); + else + binding.writeDoubleLE(this, val, offset, true); return offset + 8; }; @@ -1066,7 +1244,8 @@ Buffer.prototype.writeDoubleBE = function writeDoubleBE(val, offset, noAssert) { val = +val; offset = offset >>> 0; if (!noAssert) - checkFloat(this, val, offset, 8); - binding.writeDoubleBE(this, val, offset); + binding.writeDoubleBE(this, val, offset); + else + binding.writeDoubleBE(this, val, offset, true); return offset + 8; }; diff --git a/lib/child_process.js b/lib/child_process.js index 0fe9ca75c7794a..d4519231600c45 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -32,6 +32,16 @@ exports.fork = function(modulePath /*, args, options*/) { // Prepare arguments for fork: execArgv = options.execArgv || process.execArgv; + + if (execArgv === process.execArgv && process._eval != null) { + const index = execArgv.lastIndexOf(process._eval); + if (index > 0) { + // Remove the -e switch to avoid fork bombing ourselves. + execArgv = execArgv.slice(); + execArgv.splice(index - 1, 2); + } + } + args = execArgv.concat([modulePath], args); // Leave stdin open for the IPC channel. stdout and stderr should be the @@ -61,7 +71,8 @@ exports._forkChild = function(fd) { function normalizeExecArgs(command /*, options, callback*/) { - var file, args, options, callback; + let options; + let callback; if (typeof arguments[1] === 'function') { options = undefined; @@ -71,25 +82,12 @@ function normalizeExecArgs(command /*, options, callback*/) { callback = arguments[2]; } - if (process.platform === 'win32') { - file = process.env.comspec || 'cmd.exe'; - args = ['/s', '/c', '"' + command + '"']; - // Make a shallow copy before patching so we don't clobber the user's - // options object. - options = util._extend({}, options); - options.windowsVerbatimArguments = true; - } else { - file = '/bin/sh'; - args = ['-c', command]; - } - - if (options && options.shell) - file = options.shell; + // Make a shallow copy so we don't clobber the user's options object. + options = Object.assign({}, options); + options.shell = typeof options.shell === 'string' ? options.shell : true; return { - cmd: command, - file: file, - args: args, + file: command, options: options, callback: callback }; @@ -99,7 +97,6 @@ function normalizeExecArgs(command /*, options, callback*/) { exports.exec = function(command /*, options, callback*/) { var opts = normalizeExecArgs.apply(null, arguments); return exports.execFile(opts.file, - opts.args, opts.options, opts.callback); }; @@ -113,7 +110,8 @@ exports.execFile = function(file /*, args, options, callback*/) { maxBuffer: 200 * 1024, killSignal: 'SIGTERM', cwd: null, - env: null + env: null, + shell: false }; // Parse the optional positional parameters. @@ -143,6 +141,7 @@ exports.execFile = function(file /*, args, options, callback*/) { env: options.env, gid: options.gid, uid: options.uid, + shell: options.shell, windowsVerbatimArguments: !!options.windowsVerbatimArguments }); @@ -212,14 +211,22 @@ exports.execFile = function(file /*, args, options, callback*/) { function errorhandler(e) { ex = e; - child.stdout.destroy(); - child.stderr.destroy(); + + if (child.stdout) + child.stdout.destroy(); + + if (child.stderr) + child.stderr.destroy(); + exithandler(); } function kill() { - child.stdout.destroy(); - child.stderr.destroy(); + if (child.stdout) + child.stdout.destroy(); + + if (child.stderr) + child.stderr.destroy(); killed = true; try { @@ -237,37 +244,42 @@ exports.execFile = function(file /*, args, options, callback*/) { }, options.timeout); } - child.stdout.addListener('data', function(chunk) { - stdoutLen += chunk.length; - - if (stdoutLen > options.maxBuffer) { - ex = new Error('stdout maxBuffer exceeded.'); - kill(); - } else { - if (!encoding) - _stdout.push(chunk); - else - _stdout += chunk; - } - }); - - child.stderr.addListener('data', function(chunk) { - stderrLen += chunk.length; - - if (stderrLen > options.maxBuffer) { - ex = new Error('stderr maxBuffer exceeded.'); - kill(); - } else { - if (!encoding) - _stderr.push(chunk); - else - _stderr += chunk; - } - }); + if (child.stdout) { + if (encoding) + child.stdout.setEncoding(encoding); + + child.stdout.addListener('data', function(chunk) { + stdoutLen += chunk.length; + + if (stdoutLen > options.maxBuffer) { + ex = new Error('stdout maxBuffer exceeded'); + kill(); + } else { + if (!encoding) + _stdout.push(chunk); + else + _stdout += chunk; + } + }); + } - if (encoding) { - child.stderr.setEncoding(encoding); - child.stdout.setEncoding(encoding); + if (child.stderr) { + if (encoding) + child.stderr.setEncoding(encoding); + + child.stderr.addListener('data', function(chunk) { + stderrLen += chunk.length; + + if (stderrLen > options.maxBuffer) { + ex = new Error('stderr maxBuffer exceeded'); + kill(); + } else { + if (!encoding) + _stderr.push(chunk); + else + _stderr += chunk; + } + }); } child.addListener('close', exithandler); @@ -308,7 +320,23 @@ function normalizeSpawnArguments(file /*, args, options*/) { else if (options === null || typeof options !== 'object') throw new TypeError('options argument must be an object'); - options = util._extend({}, options); + // Make a shallow copy so we don't clobber the user's options object. + options = Object.assign({}, options); + + if (options.shell) { + const command = [file].concat(args).join(' '); + + if (process.platform === 'win32') { + file = typeof options.shell === 'string' ? options.shell : + process.env.comspec || 'cmd.exe'; + args = ['/s', '/c', '"' + command + '"']; + options.windowsVerbatimArguments = true; + } else { + file = typeof options.shell === 'string' ? options.shell : '/bin/sh'; + args = ['-c', command]; + } + } + args.unshift(file); var env = options.env || process.env; @@ -435,9 +463,10 @@ function checkExecSyncError(ret) { ret.error = null; if (!err) { - var msg = 'Command failed: ' + - (ret.cmd ? ret.cmd : ret.args.join(' ')) + - (ret.stderr ? '\n' + ret.stderr.toString() : ''); + var msg = 'Command failed: '; + msg += ret.cmd || ret.args.join(' '); + if (ret.stderr) + msg += '\n' + ret.stderr.toString(); err = new Error(msg); } @@ -468,12 +497,12 @@ function execFileSync(/*command, args, options*/) { exports.execFileSync = execFileSync; -function execSync(/*command, options*/) { +function execSync(command /*, options*/) { var opts = normalizeExecArgs.apply(null, arguments); var inheritStderr = opts.options ? !opts.options.stdio : true; - var ret = spawnSync(opts.file, opts.args, opts.options); - ret.cmd = opts.cmd; + var ret = spawnSync(opts.file, opts.options); + ret.cmd = command; if (inheritStderr) process.stderr.write(ret.stderr); diff --git a/lib/cluster.js b/lib/cluster.js index 602cc8d60b9200..e4bbd5f3ff7838 100644 --- a/lib/cluster.js +++ b/lib/cluster.js @@ -33,8 +33,12 @@ function Worker(options) { if (options.process) { this.process = options.process; - this.process.on('error', this.emit.bind(this, 'error')); - this.process.on('message', this.emit.bind(this, 'message')); + this.process.on('error', (code, signal) => + this.emit('error', code, signal) + ); + this.process.on('message', (message, handle) => + this.emit('message', message, handle) + ); } } util.inherits(Worker, EventEmitter); @@ -217,7 +221,7 @@ function masterInit() { // Keyed on address:port:etc. When a worker dies, we walk over the handles // and remove() the worker from each one. remove() may do a linear scan // itself so we might end up with an O(n*m) operation. Ergo, FIXME. - var handles = {}; + const handles = require('internal/cluster').handles; var initialized = false; cluster.setupMaster = function(options) { @@ -233,9 +237,8 @@ function masterInit() { // Without --logfile=v8-%p.log, everything ends up in a single, unusable // file. (Unusable because what V8 logs are memory addresses and each // process has its own memory mappings.) - if (settings.execArgv.some(function(s) { return /^--prof/.test(s); }) && - !settings.execArgv.some(function(s) { return /^--logfile=/.test(s); })) - { + if (settings.execArgv.some((s) => s.startsWith('--prof')) && + !settings.execArgv.some((s) => s.startsWith('--logfile='))) { settings.execArgv = settings.execArgv.concat(['--logfile=v8-%p.log']); } cluster.settings = settings; @@ -291,7 +294,7 @@ function masterInit() { var match = execArgv[i].match(/^(--debug|--debug-(brk|port))(=\d+)?$/); if (match) { - let debugPort = process.debugPort + debugPortOffset; + const debugPort = process.debugPort + debugPortOffset; ++debugPortOffset; execArgv[i] = match[1] + '=' + debugPort; } @@ -308,6 +311,26 @@ function masterInit() { var ids = 0; + function removeWorker(worker) { + assert(worker); + + delete cluster.workers[worker.id]; + + if (Object.keys(cluster.workers).length === 0) { + assert(Object.keys(handles).length === 0, 'Resource leak detected.'); + intercom.emit('disconnect'); + } + } + + function removeHandlesForWorker(worker) { + assert(worker); + + for (var key in handles) { + var handle = handles[key]; + if (handle.remove(worker)) delete handles[key]; + } + } + cluster.fork = function(env) { cluster.setupMaster(); const id = ++ids; @@ -317,27 +340,9 @@ function masterInit() { process: workerProcess }); - worker.on('message', this.emit.bind(this, 'message')); - - function removeWorker(worker) { - assert(worker); - - delete cluster.workers[worker.id]; - - if (Object.keys(cluster.workers).length === 0) { - assert(Object.keys(handles).length === 0, 'Resource leak detected.'); - intercom.emit('disconnect'); - } - } - - function removeHandlesForWorker(worker) { - assert(worker); - - for (var key in handles) { - var handle = handles[key]; - if (handle.remove(worker)) delete handles[key]; - } - } + worker.on('message', (message, handle) => + cluster.emit('message', message, handle) + ); worker.process.once('exit', function(exitCode, signalCode) { /* @@ -345,7 +350,10 @@ function masterInit() { * if it has disconnected, otherwise we might * still want to access it. */ - if (!worker.isConnected()) removeWorker(worker); + if (!worker.isConnected()) { + removeHandlesForWorker(worker); + removeWorker(worker); + } worker.suicide = !!worker.suicide; worker.state = 'dead'; @@ -401,6 +409,8 @@ function masterInit() { Worker.prototype.disconnect = function() { this.suicide = true; send(this, { act: 'disconnect' }); + removeHandlesForWorker(this); + removeWorker(this); }; Worker.prototype.destroy = function(signo) { @@ -423,7 +433,7 @@ function masterInit() { else if (message.act === 'listening') listening(worker, message); else if (message.act === 'suicide') - worker.suicide = true; + suicide(worker, message); else if (message.act === 'close') close(worker, message); } @@ -434,7 +444,15 @@ function masterInit() { cluster.emit('online', worker); } + function suicide(worker, message) { + worker.suicide = true; + send(worker, { ack: message.seq }); + } + function queryServer(worker, message) { + // Stop processing if worker already disconnecting + if (worker.suicide) + return; var args = [message.address, message.port, message.addressType, @@ -487,11 +505,12 @@ function masterInit() { cluster.emit('listening', worker, info); } - // Server in worker is closing, remove from list. + // Server in worker is closing, remove from list. The handle may have been + // removed by a prior call to removeHandlesForWorker() so guard against that. function close(worker, message) { var key = message.key; var handle = handles[key]; - if (handle.remove(worker)) delete handles[key]; + if (handle && handle.remove(worker)) delete handles[key]; } function send(worker, message, handle, cb) { @@ -526,7 +545,7 @@ function workerInit() { if (message.act === 'newconn') onconnection(message, handle); else if (message.act === 'disconnect') - worker.disconnect(); + _disconnect.call(worker, true); } }; @@ -647,41 +666,48 @@ function workerInit() { } Worker.prototype.disconnect = function() { - this.suicide = true; - var waitingHandles = 0; - - function checkRemainingHandles() { - waitingHandles--; - if (waitingHandles === 0) { - process.disconnect(); - } - } - - for (var key in handles) { - var handle = handles[key]; - delete handles[key]; - waitingHandles++; - handle.owner.close(checkRemainingHandles); - } - - if (waitingHandles === 0) { - process.disconnect(); - } - + _disconnect.call(this); }; Worker.prototype.destroy = function() { this.suicide = true; if (!this.isConnected()) process.exit(0); var exit = process.exit.bind(null, 0); - send({ act: 'suicide' }, exit); + send({ act: 'suicide' }, () => process.disconnect()); process.once('disconnect', exit); - process.disconnect(); }; function send(message, cb) { sendHelper(process, message, null, cb); } + + function _disconnect(masterInitiated) { + this.suicide = true; + let waitingCount = 1; + + function checkWaitingCount() { + waitingCount--; + if (waitingCount === 0) { + // If disconnect is worker initiated, wait for ack to be sure suicide + // is properly set in the master, otherwise, if it's master initiated + // there's no need to send the suicide message + if (masterInitiated) { + process.disconnect(); + } else { + send({ act: 'suicide' }, () => process.disconnect()); + } + } + } + + for (const key in handles) { + const handle = handles[key]; + delete handles[key]; + waitingCount++; + handle.owner.close(checkWaitingCount); + } + + checkWaitingCount(); + } } diff --git a/lib/console.js b/lib/console.js index f9032e24a0fa44..15b483c248abc9 100644 --- a/lib/console.js +++ b/lib/console.js @@ -11,7 +11,10 @@ function Console(stdout, stderr) { } if (!stderr) { stderr = stdout; + } else if (typeof stderr.write !== 'function') { + throw new TypeError('Console expects writable stream instances'); } + var prop = { writable: true, enumerable: false, @@ -33,7 +36,7 @@ function Console(stdout, stderr) { } Console.prototype.log = function() { - this._stdout.write(util.format.apply(this, arguments) + '\n'); + this._stdout.write(util.format.apply(null, arguments) + '\n'); }; @@ -41,7 +44,7 @@ Console.prototype.info = Console.prototype.log; Console.prototype.warn = function() { - this._stderr.write(util.format.apply(this, arguments) + '\n'); + this._stderr.write(util.format.apply(null, arguments) + '\n'); }; @@ -56,7 +59,7 @@ Console.prototype.dir = function(object, options) { Console.prototype.time = function(label) { - this._times.set(label, Date.now()); + this._times.set(label, process.hrtime()); }; @@ -65,8 +68,9 @@ Console.prototype.timeEnd = function(label) { if (!time) { throw new Error('No such label: ' + label); } - var duration = Date.now() - time; - this.log('%s: %dms', label, duration); + const duration = process.hrtime(time); + const ms = duration[0] * 1000 + duration[1] / 1e6; + this.log('%s: %sms', label, ms.toFixed(3)); }; @@ -75,7 +79,7 @@ Console.prototype.trace = function trace() { // exposed. var err = new Error(); err.name = 'Trace'; - err.message = util.format.apply(this, arguments); + err.message = util.format.apply(null, arguments); Error.captureStackTrace(err, trace); this.error(err.stack); }; @@ -83,8 +87,11 @@ Console.prototype.trace = function trace() { Console.prototype.assert = function(expression) { if (!expression) { - var arr = Array.prototype.slice.call(arguments, 1); - require('assert').ok(false, util.format.apply(this, arr)); + const argsLen = arguments.length || 1; + const arr = new Array(argsLen - 1); + for (var i = 1; i < argsLen; i++) + arr[i - 1] = arguments[i]; + require('assert').ok(false, util.format.apply(null, arr)); } }; diff --git a/lib/dgram.js b/lib/dgram.js index eaf84272d16284..49151f704a1ef3 100644 --- a/lib/dgram.js +++ b/lib/dgram.js @@ -29,24 +29,24 @@ function lookup(address, family, callback) { function lookup4(address, callback) { - return lookup(address || '0.0.0.0', 4, callback); + return lookup(address || '127.0.0.1', 4, callback); } function lookup6(address, callback) { - return lookup(address || '::0', 6, callback); + return lookup(address || '::1', 6, callback); } function newHandle(type) { if (type == 'udp4') { - var handle = new UDP(); + const handle = new UDP(); handle.lookup = lookup4; return handle; } if (type == 'udp6') { - var handle = new UDP(); + const handle = new UDP(); handle.lookup = lookup6; handle.bind = handle.bind6; handle.send = handle.send6; @@ -134,8 +134,9 @@ function replaceHandle(self, newHandle) { self._handle = newHandle; } -Socket.prototype.bind = function(port /*, address, callback*/) { +Socket.prototype.bind = function(port_ /*, address, callback*/) { var self = this; + let port = port_; self._healthCheck(); @@ -165,6 +166,13 @@ Socket.prototype.bind = function(port /*, address, callback*/) { exclusive = false; } + // defaulting address for bind to all interfaces + if (!address && self._handle.lookup === lookup4) { + address = '0.0.0.0'; + } else if (!address && self._handle.lookup === lookup6) { + address = '::'; + } + // resolve address first self._handle.lookup(address, function(err, ip) { if (err) { @@ -208,7 +216,7 @@ Socket.prototype.bind = function(port /*, address, callback*/) { if (!self._handle) return; // handle has been closed in the mean time - var err = self._handle.bind(ip, port || 0, flags); + const err = self._handle.bind(ip, port || 0, flags); if (err) { var ex = exceptionWithHostPort(err, 'bind', ip, port); self.emit('error', ex); @@ -242,6 +250,56 @@ Socket.prototype.sendto = function(buffer, }; +function sliceBuffer(buffer, offset, length) { + if (typeof buffer === 'string') + buffer = new Buffer(buffer); + else if (!(buffer instanceof Buffer)) + throw new TypeError('First argument must be a buffer or string'); + + offset = offset >>> 0; + length = length >>> 0; + + return buffer.slice(offset, offset + length); +} + + +function fixBuffer(buffer) { + for (var i = 0, l = buffer.length; i < l; i++) { + var buf = buffer[i]; + if (typeof buf === 'string') + buffer[i] = new Buffer(buf); + else if (!(buf instanceof Buffer)) + return false; + } + + return true; +} + + +function enqueue(self, toEnqueue) { + // If the send queue hasn't been initialized yet, do it, and install an + // event handler that flushes the send queue after binding is done. + if (!self._sendQueue) { + self._sendQueue = []; + self.once('listening', function() { + // Flush the send queue. + for (var i = 0; i < this._sendQueue.length; i++) + this.send.apply(self, this._sendQueue[i]); + this._sendQueue = undefined; + }); + } + self._sendQueue.push(toEnqueue); + return; +} + + +// valid combinations +// send(buffer, offset, length, port, address, callback) +// send(buffer, offset, length, port, address) +// send(buffer, offset, length, port) +// send(bufferOrList, port, address, callback) +// send(bufferOrList, port, address) +// send(bufferOrList, port) Socket.prototype.send = function(buffer, offset, length, @@ -250,31 +308,28 @@ Socket.prototype.send = function(buffer, callback) { var self = this; - if (typeof buffer === 'string') - buffer = new Buffer(buffer); - - if (!(buffer instanceof Buffer)) - throw new TypeError('First argument must be a buffer or string.'); - - offset = offset | 0; - if (offset < 0) - throw new RangeError('Offset should be >= 0'); - - if ((length == 0 && offset > buffer.length) || - (length > 0 && offset >= buffer.length)) - throw new RangeError('Offset into buffer too large'); - - // Sending a zero-length datagram is kind of pointless but it _is_ - // allowed, hence check that length >= 0 rather than > 0. - length = length | 0; - if (length < 0) - throw new RangeError('Length should be >= 0'); + if (address || (port && typeof port !== 'function')) { + buffer = sliceBuffer(buffer, offset, length); + } else { + callback = port; + port = offset; + address = length; + } - if (offset + length > buffer.length) - throw new RangeError('Offset + length beyond buffer length'); + if (!Array.isArray(buffer)) { + if (typeof buffer === 'string') { + buffer = [ new Buffer(buffer) ]; + } else if (!(buffer instanceof Buffer)) { + throw new TypeError('First argument must be a buffer or a string'); + } else { + buffer = [ buffer ]; + } + } else if (!fixBuffer(buffer)) { + throw new TypeError('Buffer list arguments must be buffers or strings'); + } - port = port | 0; - if (port <= 0 || port > 65535) + port = port >>> 0; + if (port === 0 || port > 65535) throw new RangeError('Port should be > 0 and < 65536'); // Normalize callback so it's either a function or undefined but not anything @@ -290,61 +345,55 @@ Socket.prototype.send = function(buffer, // If the socket hasn't been bound yet, push the outbound packet onto the // send queue and send after binding is complete. if (self._bindState != BIND_STATE_BOUND) { - // If the send queue hasn't been initialized yet, do it, and install an - // event handler that flushes the send queue after binding is done. - if (!self._sendQueue) { - self._sendQueue = []; - self.once('listening', function() { - // Flush the send queue. - for (var i = 0; i < self._sendQueue.length; i++) - self.send.apply(self, self._sendQueue[i]); - self._sendQueue = undefined; - }); - } - self._sendQueue.push([buffer, offset, length, port, address, callback]); + enqueue(self, [buffer, port, address, callback]); return; } - self._handle.lookup(address, function(ex, ip) { - if (ex) { - if (typeof callback === 'function') { - callback(ex); - return; - } - - self.emit('error', ex); - } else if (self._handle) { - var req = new SendWrap(); - req.buffer = buffer; // Keep reference alive. - req.length = length; - req.address = address; - req.port = port; - if (callback) { - req.callback = callback; - req.oncomplete = afterSend; - } - var err = self._handle.send(req, - buffer, - offset, - length, - port, - ip, - !!callback); - if (err && callback) { - // don't emit as error, dgram_legacy.js compatibility - var ex = exceptionWithHostPort(err, 'send', address, port); - process.nextTick(callback, ex); - } - } + self._handle.lookup(address, function afterDns(ex, ip) { + doSend(ex, self, ip, buffer, address, port, callback); }); }; -function afterSend(err) { +function doSend(ex, self, ip, buffer, address, port, callback) { + if (ex) { + if (typeof callback === 'function') { + callback(ex); + return; + } + + self.emit('error', ex); + return; + } else if (!self._handle) { + return; + } + + var req = new SendWrap(); + req.buffer = buffer; // Keep reference alive. + req.address = address; + req.port = port; + if (callback) { + req.callback = callback; + req.oncomplete = afterSend; + } + var err = self._handle.send(req, + buffer, + buffer.length, + port, + ip, + !!callback); + if (err && callback) { + // don't emit as error, dgram_legacy.js compatibility + const ex = exceptionWithHostPort(err, 'send', address, port); + process.nextTick(callback, ex); + } +} + +function afterSend(err, sent) { if (err) { err = exceptionWithHostPort(err, 'send', this.address, this.port); } - this.callback(err, this.length); + this.callback(err, sent); } @@ -355,8 +404,7 @@ Socket.prototype.close = function(callback) { this._stopReceiving(); this._handle.close(); this._handle = null; - var self = this; - process.nextTick(socketCloseNT, self); + process.nextTick(socketCloseNT, this); return this; }; diff --git a/lib/dns.js b/lib/dns.js index 8bd61caee96066..6940c51d29e19b 100644 --- a/lib/dns.js +++ b/lib/dns.js @@ -1,6 +1,5 @@ 'use strict'; -const net = require('net'); const util = require('util'); const cares = process.binding('cares_wrap'); @@ -10,11 +9,11 @@ const GetAddrInfoReqWrap = cares.GetAddrInfoReqWrap; const GetNameInfoReqWrap = cares.GetNameInfoReqWrap; const QueryReqWrap = cares.QueryReqWrap; -const isIp = net.isIP; +const isIP = cares.isIP; function errnoException(err, syscall, hostname) { - // FIXME(bnoordhuis) Remove this backwards compatibility shite and pass + // FIXME(bnoordhuis) Remove this backwards compatibility nonsense and pass // the true error to the user. ENOTFOUND is not even a proper POSIX error! if (err === uv.UV_EAI_MEMORY || err === uv.UV_EAI_NODATA || @@ -23,7 +22,8 @@ function errnoException(err, syscall, hostname) { } var ex = null; if (typeof err === 'string') { // c-ares error code. - ex = new Error(syscall + ' ' + err + (hostname ? ' ' + hostname : '')); + const errHost = hostname ? ' ' + hostname : ''; + ex = new Error(`${syscall} ${err}${errHost}`); ex.code = err; ex.errno = err; ex.syscall = syscall; @@ -146,7 +146,7 @@ exports.lookup = function lookup(hostname, options, callback) { return {}; } - var matchedFamily = net.isIP(hostname); + var matchedFamily = isIP(hostname); if (matchedFamily) { if (all) { callback(null, [{address: hostname, family: matchedFamily}]); @@ -186,9 +186,12 @@ exports.lookupService = function(host, port, callback) { if (arguments.length !== 3) throw new Error('invalid arguments'); - if (cares.isIP(host) === 0) + if (isIP(host) === 0) throw new TypeError('host needs to be a valid IP address'); + if (typeof port !== 'number') + throw new TypeError(`port argument must be a number, got "${port}"`); + callback = makeAsync(callback); var req = new GetNameInfoReqWrap(); @@ -237,7 +240,7 @@ function resolver(bindingName) { } -var resolveMap = {}; +var resolveMap = Object.create(null); exports.resolve4 = resolveMap.A = resolver('queryA'); exports.resolve6 = resolveMap.AAAA = resolver('queryAaaa'); exports.resolveCname = resolveMap.CNAME = resolver('queryCname'); @@ -265,7 +268,7 @@ exports.resolve = function(hostname, type_, callback_) { if (typeof resolver === 'function') { return resolver(hostname, callback); } else { - throw new Error('Unknown type "' + type_ + '"'); + throw new Error(`Unknown type "${type_}"`); } }; @@ -278,43 +281,38 @@ exports.getServers = function() { exports.setServers = function(servers) { // cache the original servers because in the event of an error setting the // servers cares won't have any servers available for resolution - var orig = cares.getServers(); - - var newSet = []; - - servers.forEach(function(serv) { - var ver = isIp(serv); - - if (ver) - return newSet.push([ver, serv]); + const orig = cares.getServers(); - var match = serv.match(/\[(.*)\](:\d+)?/); + const newSet = servers.map((serv) => { + var ipVersion = isIP(serv); + if (ipVersion !== 0) + return [ipVersion, serv]; + const match = serv.match(/\[(.*)\](:\d+)?/); // we have an IPv6 in brackets if (match) { - ver = isIp(match[1]); - if (ver) - return newSet.push([ver, match[1]]); + ipVersion = isIP(match[1]); + if (ipVersion !== 0) + return [ipVersion, match[1]]; } - var s = serv.split(/:\d+$/)[0]; - ver = isIp(s); + const s = serv.split(/:\d+$/)[0]; + ipVersion = isIP(s); - if (ver) - return newSet.push([ver, s]); + if (ipVersion !== 0) + return [ipVersion, s]; - throw new Error('IP address is not properly formatted: ' + serv); + throw new Error(`IP address is not properly formatted: ${serv}`); }); - var r = cares.setServers(newSet); + const errorNumber = cares.setServers(newSet); - if (r) { + if (errorNumber !== 0) { // reset the servers to the old servers, because ares probably unset them cares.setServers(orig.join(',')); - var err = cares.strerror(r); - throw new Error('c-ares failed to set servers: "' + err + - '" [' + servers + ']'); + var err = cares.strerror(errorNumber); + throw new Error(`c-ares failed to set servers: "${err}" [${servers}]`); } }; diff --git a/lib/domain.js b/lib/domain.js index b6321a20f80db6..472c0f0c12b5a3 100644 --- a/lib/domain.js +++ b/lib/domain.js @@ -27,8 +27,13 @@ Object.defineProperty(process, 'domain', { } }); +// It's possible to enter one domain while already inside +// another one. The stack is each entered domain. +const stack = []; +exports._stack = stack; + // let the process know we're using domains -const _domain_flag = process._setupDomainUse(_domain); +const _domain_flag = process._setupDomainUse(_domain, stack); exports.Domain = Domain; @@ -36,10 +41,6 @@ exports.create = exports.createDomain = function() { return new Domain(); }; -// it's possible to enter one domain while already inside -// another one. the stack is each entered domain. -var stack = []; -exports._stack = stack; // the active domain is always the one that we're currently in. exports.active = null; @@ -96,14 +97,20 @@ Domain.prototype._errorHandler = function errorHandler(er) { // that these exceptions are caught, and thus would prevent it from // aborting in these cases. if (stack.length === 1) { - try { - // Set the _emittingTopLevelDomainError so that we know that, even - // if technically the top-level domain is still active, it would - // be ok to abort on an uncaught exception at this point - process._emittingTopLevelDomainError = true; - caught = emitError(); - } finally { - process._emittingTopLevelDomainError = false; + // If there's no error handler, do not emit an 'error' event + // as this would throw an error, make the process exit, and thus + // prevent the process 'uncaughtException' event from being emitted + // if a listener is set. + if (EventEmitter.listenerCount(this, 'error') > 0) { + try { + // Set the _emittingTopLevelDomainError so that we know that, even + // if technically the top-level domain is still active, it would + // be ok to abort on an uncaught exception at this point + process._emittingTopLevelDomainError = true; + caught = emitError(); + } finally { + process._emittingTopLevelDomainError = false; + } } } else { // wrap this in a try/catch so we don't get infinite throwing diff --git a/lib/events.js b/lib/events.js index ea3f2831eb3bbc..d20460720eda2e 100644 --- a/lib/events.js +++ b/lib/events.js @@ -18,7 +18,20 @@ EventEmitter.prototype._maxListeners = undefined; // By default EventEmitters will print a warning if more than 10 listeners are // added to it. This is a useful default which helps finding memory leaks. -EventEmitter.defaultMaxListeners = 10; +var defaultMaxListeners = 10; + +Object.defineProperty(EventEmitter, 'defaultMaxListeners', { + enumerable: true, + get: function() { + return defaultMaxListeners; + }, + set: function(arg) { + // force global console to be compiled. + // see https://github.com/nodejs/node/issues/4467 + console; + defaultMaxListeners = arg; + } +}); EventEmitter.init = function() { this.domain = null; @@ -417,7 +430,7 @@ function listenerCount(type) { } return 0; -}; +} // About 1.5x faster than the two-arg version of Array#splice(). function spliceOne(list, index) { diff --git a/lib/fs.js b/lib/fs.js index fef4f7ba501b50..5a3176158f6718 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -101,6 +101,10 @@ function nullCheck(path, callback) { return true; } +function isFd(path) { + return (path >>> 0) === path; +} + // Static method to set the stats properties on a Stats object. fs.Stats = function( dev, @@ -243,10 +247,18 @@ fs.readFile = function(path, options, callback_) { return; var context = new ReadFileContext(callback, encoding); + context.isUserFd = isFd(path); // file descriptor ownership var req = new FSReqWrap(); req.context = context; req.oncomplete = readFileAfterOpen; + if (context.isUserFd) { + process.nextTick(function() { + req.oncomplete(null, path); + }); + return; + } + binding.open(pathModule._makeLong(path), stringToFlags(flag), 0o666, @@ -257,6 +269,7 @@ const kReadFileBufferLength = 8 * 1024; function ReadFileContext(callback, encoding) { this.fd = undefined; + this.isUserFd = undefined; this.size = undefined; this.callback = callback; this.buffers = null; @@ -293,6 +306,14 @@ ReadFileContext.prototype.close = function(err) { req.oncomplete = readFileAfterClose; req.context = this; this.err = err; + + if (this.isUserFd) { + process.nextTick(function() { + req.oncomplete(null); + }); + return; + } + binding.close(this.fd, req); }; @@ -374,12 +395,24 @@ function readFileAfterClose(err) { else buffer = context.buffer; - if (context.encoding) - buffer = buffer.toString(context.encoding); + if (err) return callback(err, buffer); + + if (context.encoding) { + return tryToString(buffer, context.encoding, callback); + } - callback(err, buffer); + callback(null, buffer); } +function tryToString(buf, encoding, callback) { + var e = null; + try { + buf = buf.toString(encoding); + } catch (err) { + e = err; + } + callback(e, buf); +} fs.readFileSync = function(path, options) { if (!options) { @@ -394,7 +427,8 @@ fs.readFileSync = function(path, options) { assertEncoding(encoding); var flag = options.flag || 'r'; - var fd = fs.openSync(path, flag, 0o666); + var isUserFd = isFd(path); // file descriptor ownership + var fd = isUserFd ? path : fs.openSync(path, flag, 0o666); var st; var size; @@ -404,7 +438,7 @@ fs.readFileSync = function(path, options) { size = st.isFile() ? st.size : 0; threw = false; } finally { - if (threw) fs.closeSync(fd); + if (threw && !isUserFd) fs.closeSync(fd); } var pos = 0; @@ -419,7 +453,7 @@ fs.readFileSync = function(path, options) { buffer = new Buffer(size); threw = false; } finally { - if (threw) fs.closeSync(fd); + if (threw && !isUserFd) fs.closeSync(fd); } } @@ -442,14 +476,15 @@ fs.readFileSync = function(path, options) { } threw = false; } finally { - if (threw) fs.closeSync(fd); + if (threw && !isUserFd) fs.closeSync(fd); } pos += bytesRead; done = (bytesRead === 0) || (size !== 0 && pos >= size); } - fs.closeSync(fd); + if (!isUserFd) + fs.closeSync(fd); if (size === 0) { // data was collected into the buffers list. @@ -552,8 +587,8 @@ fs.openSync = function(path, flags, mode) { fs.read = function(fd, buffer, offset, length, position, callback) { if (!(buffer instanceof Buffer)) { // legacy string interface (fd, length, position, encoding, callback) - var cb = arguments[4], - encoding = arguments[3]; + const cb = arguments[4]; + const encoding = arguments[3]; assertEncoding(encoding); @@ -564,10 +599,13 @@ fs.read = function(fd, buffer, offset, length, position, callback) { callback = function(err, bytesRead) { if (!cb) return; + if (err) return cb(err); - var str = (bytesRead > 0) ? buffer.toString(encoding, 0, bytesRead) : ''; - - (cb)(err, str, bytesRead); + if (bytesRead > 0) { + tryToStringWithEnd(buffer, encoding, bytesRead, cb); + } else { + (cb)(err, '', bytesRead); + } }; } @@ -582,6 +620,16 @@ fs.read = function(fd, buffer, offset, length, position, callback) { binding.read(fd, buffer, offset, length, position, req); }; +function tryToStringWithEnd(buf, encoding, end, callback) { + var e; + try { + buf = buf.toString(encoding, 0, end); + } catch (err) { + e = err; + } + callback(e, buf, end); +} + fs.readSync = function(fd, buffer, offset, length, position) { var legacy = false; var encoding; @@ -614,17 +662,14 @@ fs.readSync = function(fd, buffer, offset, length, position) { // OR // fs.write(fd, string[, position[, encoding]], callback); fs.write = function(fd, buffer, offset, length, position, callback) { - function strWrapper(err, written) { + function wrapper(err, written) { // Retain a reference to buffer so that it can't be GC'ed too soon. callback(err, written || 0, buffer); } - function bufWrapper(err, written) { - // retain reference to string in case it's external - callback(err, written || 0, buffer); - } - var req = new FSReqWrap(); + req.oncomplete = wrapper; + if (buffer instanceof Buffer) { // if no position is passed then assume null if (typeof position === 'function') { @@ -632,7 +677,6 @@ fs.write = function(fd, buffer, offset, length, position, callback) { position = null; } callback = maybeCallback(callback); - req.oncomplete = strWrapper; return binding.writeBuffer(fd, buffer, offset, length, position, req); } @@ -648,7 +692,6 @@ fs.write = function(fd, buffer, offset, length, position, callback) { length = 'utf8'; } callback = maybeCallback(position); - req.oncomplete = bufWrapper; return binding.writeString(fd, buffer, offset, length, req); }; @@ -877,29 +920,29 @@ function preprocessSymlinkDestination(path, type, linkPath) { } } -fs.symlink = function(destination, path, type_, callback_) { +fs.symlink = function(target, path, type_, callback_) { var type = (typeof type_ === 'string' ? type_ : null); var callback = makeCallback(arguments[arguments.length - 1]); - if (!nullCheck(destination, callback)) return; + if (!nullCheck(target, callback)) return; if (!nullCheck(path, callback)) return; var req = new FSReqWrap(); req.oncomplete = callback; - binding.symlink(preprocessSymlinkDestination(destination, type, path), + binding.symlink(preprocessSymlinkDestination(target, type, path), pathModule._makeLong(path), type, req); }; -fs.symlinkSync = function(destination, path, type) { +fs.symlinkSync = function(target, path, type) { type = (typeof type === 'string' ? type : null); - nullCheck(destination); + nullCheck(target); nullCheck(path); - return binding.symlink(preprocessSymlinkDestination(destination, type, path), + return binding.symlink(preprocessSymlinkDestination(target, type, path), pathModule._makeLong(path), type); }; @@ -1096,25 +1139,33 @@ fs.futimesSync = function(fd, atime, mtime) { binding.futimes(fd, atime, mtime); }; -function writeAll(fd, buffer, offset, length, position, callback_) { +function writeAll(fd, isUserFd, buffer, offset, length, position, callback_) { var callback = maybeCallback(arguments[arguments.length - 1]); // write(fd, buffer, offset, length, position, callback) fs.write(fd, buffer, offset, length, position, function(writeErr, written) { if (writeErr) { - fs.close(fd, function() { - if (callback) callback(writeErr); - }); + if (isUserFd) { + callback(writeErr); + } else { + fs.close(fd, function() { + callback(writeErr); + }); + } } else { if (written === length) { - fs.close(fd, callback); + if (isUserFd) { + callback(null); + } else { + fs.close(fd, callback); + } } else { offset += written; length -= written; if (position !== null) { position += written; } - writeAll(fd, buffer, offset, length, position, callback); + writeAll(fd, isUserFd, buffer, offset, length, position, callback); } } }); @@ -1134,16 +1185,27 @@ fs.writeFile = function(path, data, options, callback_) { assertEncoding(options.encoding); var flag = options.flag || 'w'; + + if (isFd(path)) { + writeFd(path, true); + return; + } + fs.open(path, flag, options.mode, function(openErr, fd) { if (openErr) { - if (callback) callback(openErr); + callback(openErr); } else { - var buffer = (data instanceof Buffer) ? data : new Buffer('' + data, - options.encoding || 'utf8'); - var position = /a/.test(flag) ? null : 0; - writeAll(fd, buffer, 0, buffer.length, position, callback); + writeFd(fd, false); } }); + + function writeFd(fd, isUserFd) { + var buffer = (data instanceof Buffer) ? data : new Buffer('' + data, + options.encoding || 'utf8'); + var position = /a/.test(flag) ? null : 0; + + writeAll(fd, isUserFd, buffer, 0, buffer.length, position, callback); + } }; fs.writeFileSync = function(path, data, options) { @@ -1158,7 +1220,9 @@ fs.writeFileSync = function(path, data, options) { assertEncoding(options.encoding); var flag = options.flag || 'w'; - var fd = fs.openSync(path, flag, options.mode); + var isUserFd = isFd(path); // file descriptor ownership + var fd = isUserFd ? path : fs.openSync(path, flag, options.mode); + if (!(data instanceof Buffer)) { data = new Buffer('' + data, options.encoding || 'utf8'); } @@ -1175,7 +1239,7 @@ fs.writeFileSync = function(path, data, options) { } } } finally { - fs.closeSync(fd); + if (!isUserFd) fs.closeSync(fd); } }; @@ -1192,6 +1256,11 @@ fs.appendFile = function(path, data, options, callback_) { if (!options.flag) options = util._extend({ flag: 'a' }, options); + + // force append behavior when using a supplied file descriptor + if (isFd(path)) + options.flag = 'a'; + fs.writeFile(path, data, options, callback); }; @@ -1203,9 +1272,14 @@ fs.appendFileSync = function(path, data, options) { } else if (typeof options !== 'object') { throwOptionsError(options); } + if (!options.flag) options = util._extend({ flag: 'a' }, options); + // force append behavior when using a supplied file descriptor + if (isFd(path)) + options.flag = 'a'; + fs.writeFileSync(path, data, options); }; @@ -1372,18 +1446,14 @@ fs.unwatchFile = function(filename, listener) { // Regexp that finds the next partion of a (partial) path // result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] -if (isWindows) { - var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; -} else { - var nextPartRe = /(.*?)(?:[\/]+|$)/g; -} +const nextPartRe = isWindows ? + /(.*?)(?:[\/\\]+|$)/g : + /(.*?)(?:[\/]+|$)/g; // Regex to find the device root, including trailing slash. E.g. 'c:\\'. -if (isWindows) { - var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; -} else { - var splitRootRe = /^[\/]*/; -} +const splitRootRe = isWindows ? + /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/ : + /^[\/]*/; fs.realpathSync = function realpathSync(p, cache) { // make p is absolute @@ -1393,9 +1463,9 @@ fs.realpathSync = function realpathSync(p, cache) { return cache[p]; } - var original = p, - seenLinks = {}, - knownHard = {}; + const original = p; + const seenLinks = {}; + const knownHard = {}; // current character position in p var pos; @@ -1495,9 +1565,9 @@ fs.realpath = function realpath(p, cache, cb) { return process.nextTick(cb.bind(null, null, cache[p])); } - var original = p, - seenLinks = {}, - knownHard = {}; + const original = p; + const seenLinks = {}; + const knownHard = {}; // current character position in p var pos; @@ -1768,7 +1838,7 @@ ReadStream.prototype.close = function(cb) { this.once('open', close); return; } - return process.nextTick(this.emit.bind(this, 'close')); + return process.nextTick(() => this.emit('close')); } this.closed = true; close(); @@ -1812,6 +1882,7 @@ function WriteStream(path, options) { this.mode = options.mode === undefined ? 0o666 : options.mode; this.start = options.start; + this.autoClose = options.autoClose === undefined ? true : !!options.autoClose; this.pos = undefined; this.bytesWritten = 0; @@ -1833,7 +1904,11 @@ function WriteStream(path, options) { this.open(); // dispose on finish. - this.once('finish', this.close); + this.once('finish', function() { + if (this.autoClose) { + this.close(); + } + }); } fs.FileWriteStream = fs.WriteStream; // support the legacy name @@ -1842,7 +1917,9 @@ fs.FileWriteStream = fs.WriteStream; // support the legacy name WriteStream.prototype.open = function() { fs.open(this.path, this.flags, this.mode, function(er, fd) { if (er) { - this.destroy(); + if (this.autoClose) { + this.destroy(); + } this.emit('error', er); return; } @@ -1865,7 +1942,9 @@ WriteStream.prototype._write = function(data, encoding, cb) { var self = this; fs.write(this.fd, data, 0, data.length, this.pos, function(er, bytes) { if (er) { - self.destroy(); + if (self.autoClose) { + self.destroy(); + } return cb(er); } self.bytesWritten += bytes; @@ -1946,9 +2025,9 @@ util.inherits(SyncWriteStream, Stream); // Export Object.defineProperty(fs, 'SyncWriteStream', { - configurable: true, - writable: true, - value: SyncWriteStream + configurable: true, + writable: true, + value: SyncWriteStream }); SyncWriteStream.prototype.write = function(data, arg1, arg2) { @@ -1999,3 +2078,24 @@ SyncWriteStream.prototype.destroy = function() { }; SyncWriteStream.prototype.destroySoon = SyncWriteStream.prototype.destroy; + +fs.mkdtemp = function(prefix, callback) { + if (typeof callback !== 'function') { + throw new TypeError('"callback" argument must be a function'); + } + + if (!nullCheck(prefix, callback)) { + return; + } + + var req = new FSReqWrap(); + req.oncomplete = callback; + + binding.mkdtemp(prefix + 'XXXXXX', req); +}; + +fs.mkdtempSync = function(prefix) { + nullCheck(prefix); + + return binding.mkdtemp(prefix + 'XXXXXX'); +}; diff --git a/lib/https.js b/lib/https.js index abe4a20907dfdd..e80b41e21a7e35 100644 --- a/lib/https.js +++ b/lib/https.js @@ -14,6 +14,13 @@ function Server(opts, requestListener) { opts.NPNProtocols = ['http/1.1', 'http/1.0']; } + if (process.features.tls_alpn && !opts.ALPNProtocols) { + // http/1.0 is not defined as Protocol IDs in IANA + // http://www.iana.org/assignments/tls-extensiontype-values + // /tls-extensiontype-values.xhtml#alpn-protocol-ids + opts.ALPNProtocols = ['http/1.1']; + } + tls.Server.call(this, opts, http._connectionListener); this.httpAllowHalfOpen = false; @@ -69,13 +76,19 @@ function createConnection(port, host, options) { } } - const self = this; - const socket = tls.connect(options, function() { + const socket = tls.connect(options, () => { if (!options._agentKey) return; - self._cacheSession(options._agentKey, socket.getSession()); + this._cacheSession(options._agentKey, socket.getSession()); + }); + + // Evict session on error + socket.once('close', (err) => { + if (err) + this._evictSession(options._agentKey); }); + return socket; } @@ -123,6 +136,10 @@ Agent.prototype.getName = function(options) { if (options.rejectUnauthorized !== undefined) name += options.rejectUnauthorized; + name += ':'; + if (options.servername && options.servername !== options.host) + name += options.servername; + return name; }; @@ -131,6 +148,10 @@ Agent.prototype._getSession = function _getSession(key) { }; Agent.prototype._cacheSession = function _cacheSession(key, session) { + // Cache is disabled + if (this.maxCachedSessions === 0) + return; + // Fast case - update existing entry if (this._sessionCache.map[key]) { this._sessionCache.map[key] = session; @@ -148,6 +169,15 @@ Agent.prototype._cacheSession = function _cacheSession(key, session) { this._sessionCache.map[key] = session; }; +Agent.prototype._evictSession = function _evictSession(key) { + const index = this._sessionCache.list.indexOf(key); + if (index === -1) + return; + + this._sessionCache.list.splice(index, 1); + delete this._sessionCache.map[key]; +}; + const globalAgent = new Agent(); exports.globalAgent = globalAgent; @@ -156,6 +186,9 @@ exports.Agent = Agent; exports.request = function(options, cb) { if (typeof options === 'string') { options = url.parse(options); + if (!options.hostname) { + throw new Error('Unable to determine the domain name'); + } } else { options = util._extend({}, options); } diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js new file mode 100644 index 00000000000000..30f05e90e7c792 --- /dev/null +++ b/lib/internal/bootstrap_node.js @@ -0,0 +1,406 @@ +// Hello, and welcome to hacking node.js! +// +// This file is invoked by node::LoadEnvironment in src/node.cc, and is +// responsible for bootstrapping the node.js core. As special caution is given +// to the performance of the startup process, many dependencies are invoked +// lazily. + +'use strict'; + +(function(process) { + + function startup() { + var EventEmitter = NativeModule.require('events'); + process._eventsCount = 0; + + Object.setPrototypeOf(process, Object.create(EventEmitter.prototype, { + constructor: { + value: process.constructor + } + })); + + EventEmitter.call(process); + + process.EventEmitter = EventEmitter; // process.EventEmitter is deprecated + + setupProcessObject(); + + // do this good and early, since it handles errors. + setupProcessFatal(); + + setupGlobalVariables(); + if (!process._noBrowserGlobals) { + setupGlobalTimeouts(); + setupGlobalConsole(); + } + + const _process = NativeModule.require('internal/process'); + + _process.setup_hrtime(); + _process.setupConfig(NativeModule._source); + NativeModule.require('internal/process/next_tick').setup(); + NativeModule.require('internal/process/stdio').setup(); + _process.setupKillAndExit(); + _process.setupSignalHandlers(); + + // Do not initialize channel in debugger agent, it deletes env variable + // and the main thread won't see it. + if (process.argv[1] !== '--debug-agent') + _process.setupChannel(); + + _process.setupRawDebug(); + + process.argv[0] = process.execPath; + + // There are various modes that Node can run in. The most common two + // are running from a script and running the REPL - but there are a few + // others like the debugger or running --eval arguments. Here we decide + // which mode we run in. + + if (NativeModule.exists('_third_party_main')) { + // To allow people to extend Node in different ways, this hook allows + // one to drop a file lib/_third_party_main.js into the build + // directory which will be executed instead of Node's normal loading. + process.nextTick(function() { + NativeModule.require('_third_party_main'); + }); + + } else if (process.argv[1] == 'debug') { + // Start the debugger agent + NativeModule.require('_debugger').start(); + + } else if (process.argv[1] == '--debug-agent') { + // Start the debugger agent + NativeModule.require('_debug_agent').start(); + + } else if (process.profProcess) { + NativeModule.require('internal/v8_prof_processor'); + + } else { + // There is user code to be run + + // If this is a worker in cluster mode, start up the communication + // channel. This needs to be done before any user code gets executed + // (including preload modules). + if (process.argv[1] && process.env.NODE_UNIQUE_ID) { + var cluster = NativeModule.require('cluster'); + cluster._setupWorker(); + + // Make sure it's not accidentally inherited by child processes. + delete process.env.NODE_UNIQUE_ID; + } + + if (process._eval != null && !process._forceRepl) { + // User passed '-e' or '--eval' arguments to Node without '-i' or + // '--interactive' + preloadModules(); + + const internalModule = NativeModule.require('internal/module'); + internalModule.addBuiltinLibsToObject(global); + evalScript('[eval]'); + } else if (process.argv[1]) { + // make process.argv[1] into a full path + var path = NativeModule.require('path'); + process.argv[1] = path.resolve(process.argv[1]); + + var Module = NativeModule.require('module'); + + // check if user passed `-c` or `--check` arguments to Node. + if (process._syntax_check_only != null) { + var vm = NativeModule.require('vm'); + var fs = NativeModule.require('fs'); + var internalModule = NativeModule.require('internal/module'); + // read the source + var filename = Module._resolveFilename(process.argv[1]); + var source = fs.readFileSync(filename, 'utf-8'); + // remove shebang and BOM + source = internalModule.stripBOM(source.replace(/^\#\!.*/, '')); + // wrap it + source = Module.wrap(source); + // compile the script, this will throw if it fails + new vm.Script(source, {filename: filename, displayErrors: true}); + process.exit(0); + } + + preloadModules(); + + if (global.v8debug && + process.execArgv.some(function(arg) { + return arg.match(/^--debug-brk(=[0-9]*)?$/); + })) { + + // XXX Fix this terrible hack! + // + // Give the client program a few ticks to connect. + // Otherwise, there's a race condition where `node debug foo.js` + // will not be able to connect in time to catch the first + // breakpoint message on line 1. + // + // A better fix would be to somehow get a message from the + // global.v8debug object about a connection, and runMain when + // that occurs. --isaacs + + var debugTimeout = +process.env.NODE_DEBUG_TIMEOUT || 50; + setTimeout(Module.runMain, debugTimeout); + + } else { + // Main entry point into most programs: + Module.runMain(); + } + + } else { + preloadModules(); + // If -i or --interactive were passed, or stdin is a TTY. + if (process._forceRepl || NativeModule.require('tty').isatty(0)) { + // REPL + var cliRepl = NativeModule.require('internal/repl'); + cliRepl.createInternalRepl(process.env, function(err, repl) { + if (err) { + throw err; + } + repl.on('exit', function() { + if (repl._flushing) { + repl.pause(); + return repl.once('flushHistory', function() { + process.exit(); + }); + } + process.exit(); + }); + }); + + if (process._eval != null) { + // User passed '-e' or '--eval' + evalScript('[eval]'); + } + } else { + // Read all of stdin - execute it. + process.stdin.setEncoding('utf8'); + + var code = ''; + process.stdin.on('data', function(d) { + code += d; + }); + + process.stdin.on('end', function() { + process._eval = code; + evalScript('[stdin]'); + }); + } + } + } + } + + function setupProcessObject() { + process._setupProcessObject(pushValueToArray); + + function pushValueToArray() { + for (var i = 0; i < arguments.length; i++) + this.push(arguments[i]); + } + } + + function setupGlobalVariables() { + global.process = process; + global.GLOBAL = global; + global.root = global; + global.Buffer = NativeModule.require('buffer').Buffer; + process.domain = null; + process._exiting = false; + } + + function setupGlobalTimeouts() { + const timers = NativeModule.require('timers'); + global.clearImmediate = timers.clearImmediate; + global.clearInterval = timers.clearInterval; + global.clearTimeout = timers.clearTimeout; + global.setImmediate = timers.setImmediate; + global.setInterval = timers.setInterval; + global.setTimeout = timers.setTimeout; + } + + function setupGlobalConsole() { + global.__defineGetter__('console', function() { + return NativeModule.require('console'); + }); + } + + function setupProcessFatal() { + + process._fatalException = function(er) { + var caught; + + if (process.domain && process.domain._errorHandler) + caught = process.domain._errorHandler(er) || caught; + + if (!caught) + caught = process.emit('uncaughtException', er); + + // If someone handled it, then great. otherwise, die in C++ land + // since that means that we'll exit the process, emit the 'exit' event + if (!caught) { + try { + if (!process._exiting) { + process._exiting = true; + process.emit('exit', 1); + } + } catch (er) { + // nothing to be done about it at this point. + } + + // if we handled an error, then make sure any ticks get processed + } else { + NativeModule.require('timers').setImmediate(process._tickCallback); + } + + return caught; + }; + } + + function evalScript(name) { + var Module = NativeModule.require('module'); + var path = NativeModule.require('path'); + + try { + var cwd = process.cwd(); + } catch (e) { + // getcwd(3) can fail if the current working directory has been deleted. + // Fall back to the directory name of the (absolute) executable path. + // It's not really correct but what are the alternatives? + cwd = path.dirname(process.execPath); + } + + var module = new Module(name); + module.filename = path.join(cwd, name); + module.paths = Module._nodeModulePaths(cwd); + var script = process._eval; + var body = script; + script = `global.__filename = ${JSON.stringify(name)};\n` + + 'global.exports = exports;\n' + + 'global.module = module;\n' + + 'global.__dirname = __dirname;\n' + + 'global.require = require;\n' + + 'return require("vm").runInThisContext(' + + `${JSON.stringify(body)}, { filename: ` + + `${JSON.stringify(name)} });\n`; + // Defer evaluation for a tick. This is a workaround for deferred + // events not firing when evaluating scripts from the command line, + // see https://github.com/nodejs/node/issues/1600. + process.nextTick(function() { + var result = module._compile(script, `${name}-wrapper`); + if (process._print_eval) console.log(result); + }); + } + + // Load preload modules + function preloadModules() { + if (process._preload_modules) { + NativeModule.require('module')._preloadModules(process._preload_modules); + } + } + + // Below you find a minimal module system, which is used to load the node + // core modules found in lib/*.js. All core modules are compiled into the + // node binary, so they can be loaded faster. + + var ContextifyScript = process.binding('contextify').ContextifyScript; + function runInThisContext(code, options) { + var script = new ContextifyScript(code, options); + return script.runInThisContext(); + } + + function NativeModule(id) { + this.filename = `${id}.js`; + this.id = id; + this.exports = {}; + this.loaded = false; + } + + NativeModule._source = process.binding('natives'); + NativeModule._cache = {}; + + NativeModule.require = function(id) { + if (id == 'native_module') { + return NativeModule; + } + + var cached = NativeModule.getCached(id); + if (cached) { + return cached.exports; + } + + if (!NativeModule.exists(id)) { + throw new Error(`No such native module ${id}`); + } + + process.moduleLoadList.push(`NativeModule ${id}`); + + var nativeModule = new NativeModule(id); + + nativeModule.cache(); + nativeModule.compile(); + + return nativeModule.exports; + }; + + NativeModule.getCached = function(id) { + return NativeModule._cache[id]; + }; + + NativeModule.exists = function(id) { + return NativeModule._source.hasOwnProperty(id); + }; + + const EXPOSE_INTERNALS = process.execArgv.some(function(arg) { + return arg.match(/^--expose[-_]internals$/); + }); + + if (EXPOSE_INTERNALS) { + NativeModule.nonInternalExists = NativeModule.exists; + + NativeModule.isInternal = function(id) { + return false; + }; + } else { + NativeModule.nonInternalExists = function(id) { + return NativeModule.exists(id) && !NativeModule.isInternal(id); + }; + + NativeModule.isInternal = function(id) { + return id.startsWith('internal/'); + }; + } + + + NativeModule.getSource = function(id) { + return NativeModule._source[id]; + }; + + NativeModule.wrap = function(script) { + return NativeModule.wrapper[0] + script + NativeModule.wrapper[1]; + }; + + NativeModule.wrapper = [ + '(function (exports, require, module, __filename, __dirname) { ', + '\n});' + ]; + + NativeModule.prototype.compile = function() { + var source = NativeModule.getSource(this.id); + source = NativeModule.wrap(source); + + var fn = runInThisContext(source, { + filename: this.filename, + lineOffset: 0 + }); + fn(this.exports, NativeModule.require, this, this.filename); + + this.loaded = true; + }; + + NativeModule.prototype.cache = function() { + NativeModule._cache[this.id] = this; + }; + + startup(); +}); diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js index 8c1abc5f746fc8..ac43c22a82a733 100644 --- a/lib/internal/child_process.js +++ b/lib/internal/child_process.js @@ -35,7 +35,7 @@ const handleConversion = { 'net.Native': { simultaneousAccepts: true, - send: function(message, handle) { + send: function(message, handle, options) { return handle; }, @@ -47,7 +47,7 @@ const handleConversion = { 'net.Server': { simultaneousAccepts: true, - send: function(message, server) { + send: function(message, server, options) { return server._handle; }, @@ -60,7 +60,7 @@ const handleConversion = { }, 'net.Socket': { - send: function(message, socket) { + send: function(message, socket, options) { if (!socket._handle) return; @@ -78,21 +78,25 @@ const handleConversion = { if (firstTime) socket.server._setupSlave(socketList); // Act like socket is detached - socket.server._connections--; + if (!options.keepOpen) + socket.server._connections--; } + var handle = socket._handle; + // remove handle from socket object, it will be closed when the socket // will be sent - var handle = socket._handle; - handle.onread = function() {}; - socket._handle = null; + if (!options.keepOpen) { + handle.onread = function() {}; + socket._handle = null; + } return handle; }, - postSend: function(handle) { + postSend: function(handle, options) { // Close the Socket handle after sending it - if (handle) + if (handle && !options.keepOpen) handle.close(); }, @@ -117,7 +121,7 @@ const handleConversion = { 'dgram.Native': { simultaneousAccepts: false, - send: function(message, handle) { + send: function(message, handle, options) { return handle; }, @@ -129,7 +133,7 @@ const handleConversion = { 'dgram.Socket': { simultaneousAccepts: false, - send: function(message, socket) { + send: function(message, socket, options) { message.dgramType = socket.type; return socket._handle; @@ -217,7 +221,7 @@ util.inherits(ChildProcess, EventEmitter); function flushStdio(subprocess) { if (subprocess.stdio == null) return; subprocess.stdio.forEach(function(stream, fd, stdio) { - if (!stream || !stream.readable || stream._consuming) + if (!stream || !stream.readable || stream._readableState.readableListening) return; stream.resume(); }); @@ -250,11 +254,11 @@ function getHandleWrapType(stream) { ChildProcess.prototype.spawn = function(options) { - var self = this, - ipc, - ipcFd, - // If no `stdio` option was given - use default - stdio = options.stdio || 'pipe'; + const self = this; + var ipc; + var ipcFd; + // If no `stdio` option was given - use default + var stdio = options.stdio || 'pipe'; stdio = _validateStdio(stdio, false); @@ -466,7 +470,7 @@ function setupChannel(target, channel) { target._handleQueue = null; queue.forEach(function(args) { - target._send(args.message, args.handle, false, args.callback); + target._send(args.message, args.handle, args.options, args.callback); }); // Process a pending disconnect (if any). @@ -498,14 +502,23 @@ function setupChannel(target, channel) { }); }); - target.send = function(message, handle, callback) { + target.send = function(message, handle, options, callback) { if (typeof handle === 'function') { callback = handle; handle = undefined; + options = undefined; + } else if (typeof options === 'function') { + callback = options; + options = undefined; + } else if (options !== undefined && + (options === null || typeof options !== 'object')) { + throw new TypeError('"options" argument must be an object'); } + + options = Object.assign({swallowErrors: false}, options); + if (this.connected) { - this._send(message, handle, false, callback); - return; + return this._send(message, handle, options, callback); } const ex = new Error('channel closed'); if (typeof callback === 'function') { @@ -513,14 +526,20 @@ function setupChannel(target, channel) { } else { this.emit('error', ex); // FIXME(bnoordhuis) Defer to next tick. } + return false; }; - target._send = function(message, handle, swallowErrors, callback) { + target._send = function(message, handle, options, callback) { assert(this.connected || this._channel); if (message === undefined) throw new TypeError('message cannot be undefined'); + // Support legacy function signature + if (typeof options === 'boolean') { + options = {swallowErrors: options}; + } + // package messages with a handle object if (handle) { // this message will be handled by an internalMessage event handler @@ -549,16 +568,19 @@ function setupChannel(target, channel) { this._handleQueue.push({ callback: callback, handle: handle, + options: options, message: message.msg, }); - return; + return this._handleQueue.length === 1; } var obj = handleConversion[message.type]; // convert TCP object to native handle object - handle = - handleConversion[message.type].send.call(target, message, handle); + handle = handleConversion[message.type].send.call(target, + message, + handle, + options); // If handle was sent twice, or it is impossible to get native handle // out of it - just send a text without the handle. @@ -575,9 +597,10 @@ function setupChannel(target, channel) { this._handleQueue.push({ callback: callback, handle: null, + options: options, message: message, }); - return; + return this._handleQueue.length === 1; } var req = new WriteWrap(); @@ -593,7 +616,7 @@ function setupChannel(target, channel) { if (this.async === true) control.unref(); if (obj && obj.postSend) - obj.postSend(handle); + obj.postSend(handle, options); if (typeof callback === 'function') callback(null); }; @@ -602,12 +625,18 @@ function setupChannel(target, channel) { } else { process.nextTick(function() { req.oncomplete(); }); } - } else if (!swallowErrors) { - const ex = errnoException(err, 'write'); - if (typeof callback === 'function') { - process.nextTick(callback, ex); - } else { - this.emit('error', ex); // FIXME(bnoordhuis) Defer to next tick. + } else { + // Cleanup handle on error + if (obj && obj.postSend) + obj.postSend(handle, options); + + if (!options.swallowErrors) { + const ex = errnoException(err, 'write'); + if (typeof callback === 'function') { + process.nextTick(callback, ex); + } else { + this.emit('error', ex); // FIXME(bnoordhuis) Defer to next tick. + } } } @@ -675,6 +704,9 @@ function setupChannel(target, channel) { const INTERNAL_PREFIX = 'NODE_'; function handleMessage(target, message, handle) { + if (!target._channel) + return; + var eventName = 'message'; if (message !== null && typeof message === 'object' && @@ -689,8 +721,8 @@ function handleMessage(target, message, handle) { function nop() { } function _validateStdio(stdio, sync) { - var ipc, - ipcFd; + var ipc; + var ipcFd; // Replace shortcut with an array if (typeof stdio === 'string') { diff --git a/lib/internal/cluster.js b/lib/internal/cluster.js new file mode 100644 index 00000000000000..8380ea7482c670 --- /dev/null +++ b/lib/internal/cluster.js @@ -0,0 +1,4 @@ +'use strict'; + +// Used in tests. +exports.handles = {}; diff --git a/lib/internal/freelist.js b/lib/internal/freelist.js index 4b17d154d4acef..580726e8725379 100644 --- a/lib/internal/freelist.js +++ b/lib/internal/freelist.js @@ -10,7 +10,7 @@ exports.FreeList = function(name, max, constructor) { exports.FreeList.prototype.alloc = function() { - return this.list.length ? this.list.shift() : + return this.list.length ? this.list.pop() : this.constructor.apply(this, arguments); }; diff --git a/lib/internal/module.js b/lib/internal/module.js index 7f3a39e539424a..1742716726478b 100644 --- a/lib/internal/module.js +++ b/lib/internal/module.js @@ -1,6 +1,41 @@ 'use strict'; -module.exports.stripBOM = stripBOM; +exports = module.exports = { + makeRequireFunction, + stripBOM, + addBuiltinLibsToObject +}; + +exports.requireDepth = 0; + +// Invoke with makeRequireFunction.call(module) where |module| is the +// Module object to use as the context for the require() function. +function makeRequireFunction() { + const Module = this.constructor; + const self = this; + + function require(path) { + try { + exports.requireDepth += 1; + return self.require(path); + } finally { + exports.requireDepth -= 1; + } + } + + require.resolve = function(request) { + return Module._resolveFilename(request, self); + }; + + require.main = process.mainModule; + + // Enable support to add extra extension types. + require.extensions = Module._extensions; + + require.cache = Module._cache; + + return require; +} /** * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) @@ -13,3 +48,47 @@ function stripBOM(content) { } return content; } + +exports.builtinLibs = ['assert', 'buffer', 'child_process', 'cluster', + 'crypto', 'dgram', 'dns', 'domain', 'events', 'fs', 'http', 'https', 'net', + 'os', 'path', 'punycode', 'querystring', 'readline', 'repl', 'stream', + 'string_decoder', 'tls', 'tty', 'url', 'util', 'v8', 'vm', 'zlib']; + +function addBuiltinLibsToObject(object) { + // Make built-in modules available directly (loaded lazily). + exports.builtinLibs.forEach((name) => { + // Goals of this mechanism are: + // - Lazy loading of built-in modules + // - Having all built-in modules available as non-enumerable properties + // - Allowing the user to re-assign these variables as if there were no + // pre-existing globals with the same name. + + const setReal = (val) => { + // Deleting the property before re-assigning it disables the + // getter/setter mechanism. + delete object[name]; + object[name] = val; + }; + + Object.defineProperty(object, name, { + get: () => { + const lib = require(name); + + // Disable the current getter/setter and set up a new + // non-enumerable property. + delete object[name]; + Object.defineProperty(object, name, { + get: () => lib, + set: setReal, + configurable: true, + enumerable: false + }); + + return lib; + }, + set: setReal, + configurable: true, + enumerable: false + }); + }); +} diff --git a/lib/internal/net.js b/lib/internal/net.js new file mode 100644 index 00000000000000..effc6485d25011 --- /dev/null +++ b/lib/internal/net.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = { isLegalPort }; + +// Check that the port number is not NaN when coerced to a number, +// is an integer and that it falls within the legal range of port numbers. +function isLegalPort(port) { + if (typeof port === 'string' && port.trim() === '') + return false; + return +port === (port >>> 0) && port >= 0 && port <= 0xFFFF; +} diff --git a/lib/internal/process.js b/lib/internal/process.js new file mode 100644 index 00000000000000..17ca5bc326c08a --- /dev/null +++ b/lib/internal/process.js @@ -0,0 +1,186 @@ +'use strict'; + +var _lazyConstants = null; + +function lazyConstants() { + if (!_lazyConstants) { + _lazyConstants = process.binding('constants'); + } + return _lazyConstants; +} + +exports.setup_hrtime = setup_hrtime; +exports.setupConfig = setupConfig; +exports.setupKillAndExit = setupKillAndExit; +exports.setupSignalHandlers = setupSignalHandlers; +exports.setupChannel = setupChannel; +exports.setupRawDebug = setupRawDebug; + + +const assert = process.assert = function(x, msg) { + if (!x) throw new Error(msg || 'assertion error'); +}; + + +function setup_hrtime() { + const _hrtime = process.hrtime; + const hrValues = new Uint32Array(3); + + process.hrtime = function hrtime(ar) { + _hrtime(hrValues); + + if (typeof ar !== 'undefined') { + if (Array.isArray(ar)) { + const sec = (hrValues[0] * 0x100000000 + hrValues[1]) - ar[0]; + const nsec = hrValues[2] - ar[1]; + return [nsec < 0 ? sec - 1 : sec, nsec < 0 ? nsec + 1e9 : nsec]; + } + + throw new TypeError('process.hrtime() only accepts an Array tuple'); + } + + return [ + hrValues[0] * 0x100000000 + hrValues[1], + hrValues[2] + ]; + }; +} + + +function setupConfig(_source) { + // NativeModule._source + // used for `process.config`, but not a real module + var config = _source.config; + delete _source.config; + + // strip the gyp comment line at the beginning + config = config.split('\n') + .slice(1) + .join('\n') + .replace(/"/g, '\\"') + .replace(/'/g, '"'); + + process.config = JSON.parse(config, function(key, value) { + if (value === 'true') return true; + if (value === 'false') return false; + return value; + }); +} + + +function setupKillAndExit() { + + process.exit = function(code) { + if (code || code === 0) + process.exitCode = code; + + if (!process._exiting) { + process._exiting = true; + process.emit('exit', process.exitCode || 0); + } + process.reallyExit(process.exitCode || 0); + }; + + process.kill = function(pid, sig) { + var err; + + if (pid != (pid | 0)) { + throw new TypeError('invalid pid'); + } + + // preserve null signal + if (0 === sig) { + err = process._kill(pid, 0); + } else { + sig = sig || 'SIGTERM'; + if (lazyConstants()[sig] && + sig.slice(0, 3) === 'SIG') { + err = process._kill(pid, lazyConstants()[sig]); + } else { + throw new Error(`Unknown signal: ${sig}`); + } + } + + if (err) { + var errnoException = require('util')._errnoException; + throw errnoException(err, 'kill'); + } + + return true; + }; +} + + +function setupSignalHandlers() { + // Load events module in order to access prototype elements on process like + // process.addListener. + var signalWraps = {}; + + function isSignal(event) { + return typeof event === 'string' && + event.slice(0, 3) === 'SIG' && + lazyConstants().hasOwnProperty(event); + } + + // Detect presence of a listener for the special signal types + process.on('newListener', function(type, listener) { + if (isSignal(type) && + !signalWraps.hasOwnProperty(type)) { + var Signal = process.binding('signal_wrap').Signal; + var wrap = new Signal(); + + wrap.unref(); + + wrap.onsignal = function() { process.emit(type); }; + + var signum = lazyConstants()[type]; + var err = wrap.start(signum); + if (err) { + wrap.close(); + var errnoException = require('util')._errnoException; + throw errnoException(err, 'uv_signal_start'); + } + + signalWraps[type] = wrap; + } + }); + + process.on('removeListener', function(type, listener) { + if (signalWraps.hasOwnProperty(type) && this.listenerCount(type) === 0) { + signalWraps[type].close(); + delete signalWraps[type]; + } + }); +} + + +function setupChannel() { + // If we were spawned with env NODE_CHANNEL_FD then load that up and + // start parsing data from that stream. + if (process.env.NODE_CHANNEL_FD) { + var fd = parseInt(process.env.NODE_CHANNEL_FD, 10); + assert(fd >= 0); + + // Make sure it's not accidentally inherited by child processes. + delete process.env.NODE_CHANNEL_FD; + + var cp = require('child_process'); + + // Load tcp_wrap to avoid situation where we might immediately receive + // a message. + // FIXME is this really necessary? + process.binding('tcp_wrap'); + + cp._forkChild(fd); + assert(process.send); + } +} + + +function setupRawDebug() { + var format = require('util').format; + var rawDebug = process._rawDebug; + process._rawDebug = function() { + rawDebug(format.apply(null, arguments)); + }; +} diff --git a/lib/internal/process/next_tick.js b/lib/internal/process/next_tick.js new file mode 100644 index 00000000000000..bfbbc1e02548a4 --- /dev/null +++ b/lib/internal/process/next_tick.js @@ -0,0 +1,155 @@ +'use strict'; + +exports.setup = setupNextTick; + +function setupNextTick() { + const promises = require('internal/process/promises'); + const emitPendingUnhandledRejections = promises.setup(scheduleMicrotasks); + var nextTickQueue = []; + var microtasksScheduled = false; + + // Used to run V8's micro task queue. + var _runMicrotasks = {}; + + // *Must* match Environment::TickInfo::Fields in src/env.h. + var kIndex = 0; + var kLength = 1; + + process.nextTick = nextTick; + // Needs to be accessible from beyond this scope. + process._tickCallback = _tickCallback; + process._tickDomainCallback = _tickDomainCallback; + + // This tickInfo thing is used so that the C++ code in src/node.cc + // can have easy access to our nextTick state, and avoid unnecessary + // calls into JS land. + const tickInfo = process._setupNextTick(_tickCallback, _runMicrotasks); + + _runMicrotasks = _runMicrotasks.runMicrotasks; + + function tickDone() { + if (tickInfo[kLength] !== 0) { + if (tickInfo[kLength] <= tickInfo[kIndex]) { + nextTickQueue = []; + tickInfo[kLength] = 0; + } else { + nextTickQueue.splice(0, tickInfo[kIndex]); + tickInfo[kLength] = nextTickQueue.length; + } + } + tickInfo[kIndex] = 0; + } + + function scheduleMicrotasks() { + if (microtasksScheduled) + return; + + nextTickQueue.push({ + callback: runMicrotasksCallback, + domain: null + }); + + tickInfo[kLength]++; + microtasksScheduled = true; + } + + function runMicrotasksCallback() { + microtasksScheduled = false; + _runMicrotasks(); + + if (tickInfo[kIndex] < tickInfo[kLength] || + emitPendingUnhandledRejections()) + scheduleMicrotasks(); + } + + function _combinedTickCallback(args, callback) { + if (args === undefined) { + callback(); + } else { + switch (args.length) { + case 1: + callback(args[0]); + break; + case 2: + callback(args[0], args[1]); + break; + case 3: + callback(args[0], args[1], args[2]); + break; + default: + callback.apply(null, args); + } + } + } + + // Run callbacks that have no domain. + // Using domains will cause this to be overridden. + function _tickCallback() { + var callback, args, tock; + + do { + while (tickInfo[kIndex] < tickInfo[kLength]) { + tock = nextTickQueue[tickInfo[kIndex]++]; + callback = tock.callback; + args = tock.args; + // Using separate callback execution functions allows direct + // callback invocation with small numbers of arguments to avoid the + // performance hit associated with using `fn.apply()` + _combinedTickCallback(args, callback); + if (1e4 < tickInfo[kIndex]) + tickDone(); + } + tickDone(); + _runMicrotasks(); + emitPendingUnhandledRejections(); + } while (tickInfo[kLength] !== 0); + } + + function _tickDomainCallback() { + var callback, domain, args, tock; + + do { + while (tickInfo[kIndex] < tickInfo[kLength]) { + tock = nextTickQueue[tickInfo[kIndex]++]; + callback = tock.callback; + domain = tock.domain; + args = tock.args; + if (domain) + domain.enter(); + // Using separate callback execution functions allows direct + // callback invocation with small numbers of arguments to avoid the + // performance hit associated with using `fn.apply()` + _combinedTickCallback(args, callback); + if (1e4 < tickInfo[kIndex]) + tickDone(); + if (domain) + domain.exit(); + } + tickDone(); + _runMicrotasks(); + emitPendingUnhandledRejections(); + } while (tickInfo[kLength] !== 0); + } + + function TickObject(c, args) { + this.callback = c; + this.domain = process.domain || null; + this.args = args; + } + + function nextTick(callback) { + // on the way out, don't bother. it won't get fired anyway. + if (process._exiting) + return; + + var args; + if (arguments.length > 1) { + args = new Array(arguments.length - 1); + for (var i = 1; i < arguments.length; i++) + args[i - 1] = arguments[i]; + } + + nextTickQueue.push(new TickObject(callback, args)); + tickInfo[kLength]++; + } +} diff --git a/lib/internal/process/promises.js b/lib/internal/process/promises.js new file mode 100644 index 00000000000000..22f1959784be9a --- /dev/null +++ b/lib/internal/process/promises.js @@ -0,0 +1,61 @@ +'use strict'; + +const promiseRejectEvent = process._promiseRejectEvent; +const hasBeenNotifiedProperty = new WeakMap(); +const pendingUnhandledRejections = []; + +exports.setup = setupPromises; + +function setupPromises(scheduleMicrotasks) { + process._setupPromises(function(event, promise, reason) { + if (event === promiseRejectEvent.unhandled) + unhandledRejection(promise, reason); + else if (event === promiseRejectEvent.handled) + rejectionHandled(promise); + else + require('assert').fail(null, null, 'unexpected PromiseRejectEvent'); + }); + + function unhandledRejection(promise, reason) { + hasBeenNotifiedProperty.set(promise, false); + addPendingUnhandledRejection(promise, reason); + } + + function rejectionHandled(promise) { + var hasBeenNotified = hasBeenNotifiedProperty.get(promise); + if (hasBeenNotified !== undefined) { + hasBeenNotifiedProperty.delete(promise); + if (hasBeenNotified === true) { + process.nextTick(function() { + process.emit('rejectionHandled', promise); + }); + } + + } + } + + function emitPendingUnhandledRejections() { + var hadListeners = false; + while (pendingUnhandledRejections.length > 0) { + var promise = pendingUnhandledRejections.shift(); + var reason = pendingUnhandledRejections.shift(); + if (hasBeenNotifiedProperty.get(promise) === false) { + hasBeenNotifiedProperty.set(promise, true); + if (!process.emit('unhandledRejection', reason, promise)) { + // Nobody is listening. + // TODO(petkaantonov) Take some default action, see #830 + } else { + hadListeners = true; + } + } + } + return hadListeners; + } + + function addPendingUnhandledRejection(promise, reason) { + pendingUnhandledRejections.push(promise, reason); + scheduleMicrotasks(); + } + + return emitPendingUnhandledRejections; +} diff --git a/lib/internal/process/stdio.js b/lib/internal/process/stdio.js new file mode 100644 index 00000000000000..55689069ff2cb5 --- /dev/null +++ b/lib/internal/process/stdio.js @@ -0,0 +1,161 @@ +'use strict'; + +exports.setup = setupStdio; + +function setupStdio() { + var stdin, stdout, stderr; + + process.__defineGetter__('stdout', function() { + if (stdout) return stdout; + stdout = createWritableStdioStream(1); + stdout.destroy = stdout.destroySoon = function(er) { + er = er || new Error('process.stdout cannot be closed.'); + stdout.emit('error', er); + }; + if (stdout.isTTY) { + process.on('SIGWINCH', function() { + stdout._refreshSize(); + }); + } + return stdout; + }); + + process.__defineGetter__('stderr', function() { + if (stderr) return stderr; + stderr = createWritableStdioStream(2); + stderr.destroy = stderr.destroySoon = function(er) { + er = er || new Error('process.stderr cannot be closed.'); + stderr.emit('error', er); + }; + if (stderr.isTTY) { + process.on('SIGWINCH', function() { + stderr._refreshSize(); + }); + } + return stderr; + }); + + process.__defineGetter__('stdin', function() { + if (stdin) return stdin; + + var tty_wrap = process.binding('tty_wrap'); + var fd = 0; + + switch (tty_wrap.guessHandleType(fd)) { + case 'TTY': + var tty = require('tty'); + stdin = new tty.ReadStream(fd, { + highWaterMark: 0, + readable: true, + writable: false + }); + break; + + case 'FILE': + var fs = require('fs'); + stdin = new fs.ReadStream(null, { fd: fd, autoClose: false }); + break; + + case 'PIPE': + case 'TCP': + var net = require('net'); + + // It could be that process has been started with an IPC channel + // sitting on fd=0, in such case the pipe for this fd is already + // present and creating a new one will lead to the assertion failure + // in libuv. + if (process._channel && process._channel.fd === fd) { + stdin = new net.Socket({ + handle: process._channel, + readable: true, + writable: false + }); + } else { + stdin = new net.Socket({ + fd: fd, + readable: true, + writable: false + }); + } + // Make sure the stdin can't be `.end()`-ed + stdin._writableState.ended = true; + break; + + default: + // Probably an error on in uv_guess_handle() + throw new Error('Implement me. Unknown stdin file type!'); + } + + // For supporting legacy API we put the FD here. + stdin.fd = fd; + + // stdin starts out life in a paused state, but node doesn't + // know yet. Explicitly to readStop() it to put it in the + // not-reading state. + if (stdin._handle && stdin._handle.readStop) { + stdin._handle.reading = false; + stdin._readableState.reading = false; + stdin._handle.readStop(); + } + + // if the user calls stdin.pause(), then we need to stop reading + // immediately, so that the process can close down. + stdin.on('pause', function() { + if (!stdin._handle) + return; + stdin._readableState.reading = false; + stdin._handle.reading = false; + stdin._handle.readStop(); + }); + + return stdin; + }); + + process.openStdin = function() { + process.stdin.resume(); + return process.stdin; + }; +} + +function createWritableStdioStream(fd) { + var stream; + var tty_wrap = process.binding('tty_wrap'); + + // Note stream._type is used for test-module-load-list.js + + switch (tty_wrap.guessHandleType(fd)) { + case 'TTY': + var tty = require('tty'); + stream = new tty.WriteStream(fd); + stream._type = 'tty'; + break; + + case 'FILE': + var fs = require('fs'); + stream = new fs.SyncWriteStream(fd, { autoClose: false }); + stream._type = 'fs'; + break; + + case 'PIPE': + case 'TCP': + var net = require('net'); + stream = new net.Socket({ + fd: fd, + readable: false, + writable: true + }); + stream._type = 'pipe'; + break; + + default: + // Probably an error on in uv_guess_handle() + throw new Error('Implement me. Unknown stream file type!'); + } + + // For supporting legacy API we put the FD here. + stream.fd = fd; + + stream._isStdio = true; + + return stream; +} diff --git a/lib/internal/repl.js b/lib/internal/repl.js index c1beb85cefd795..371446a83bd4fd 100644 --- a/lib/internal/repl.js +++ b/lib/internal/repl.js @@ -14,12 +14,6 @@ module.exports.createInternalRepl = createRepl; // The debounce is to guard against code pasted into the REPL. const kDebounceHistoryMS = 15; -// XXX(chrisdickinson): hack to make sure that the internal debugger -// uses the original repl. -function replStart() { - return REPL.start.apply(REPL, arguments); -} - function createRepl(env, opts, cb) { if (typeof opts === 'function') { cb = opts; @@ -61,15 +55,26 @@ function createRepl(env, opts, cb) { } const repl = REPL.start(opts); - if (opts.terminal && env.NODE_REPL_HISTORY !== '') { + if (opts.terminal) { return setupHistory(repl, env.NODE_REPL_HISTORY, env.NODE_REPL_HISTORY_FILE, cb); } + repl._historyPrev = _replHistoryMessage; cb(null, repl); } function setupHistory(repl, historyPath, oldHistoryPath, ready) { + // Empty string disables persistent history. + + if (typeof historyPath === 'string') + historyPath = historyPath.trim(); + + if (historyPath === '') { + repl._historyPrev = _replHistoryMessage; + return ready(null, repl); + } + if (!historyPath) { try { historyPath = path.join(os.homedir(), '.node_repl_history'); @@ -92,7 +97,16 @@ function setupHistory(repl, historyPath, oldHistoryPath, ready) { function oninit(err, hnd) { if (err) { - return ready(err); + // Cannot open history file. + // Don't crash, just don't persist history. + repl._writeToOutput('\nError: Could not open history file.\n' + + 'REPL session history will not be persisted.\n'); + repl._refreshLine(); + debug(err.stack); + + repl._historyPrev = _replHistoryMessage; + repl.resume(); + return ready(null, repl); } fs.close(hnd, onclose); } @@ -110,8 +124,16 @@ function setupHistory(repl, historyPath, oldHistoryPath, ready) { } if (data) { - repl.history = data.split(/[\n\r]+/).slice(-repl.historySize); - } else if (oldHistoryPath) { + repl.history = data.split(/[\n\r]+/, repl.historySize); + } else if (oldHistoryPath === historyPath) { + // If pre-v3.0, the user had set NODE_REPL_HISTORY_FILE to + // ~/.node_repl_history, warn the user about it and proceed. + repl._writeToOutput( + '\nThe old repl history file has the same name and location as ' + + `the new one i.e., ${historyPath} and is empty.\nUsing it as is.\n`); + repl._refreshLine(); + + } else if (oldHistoryPath) { // Grab data from the older pre-v3.0 JSON NODE_REPL_HISTORY_FILE format. repl._writeToOutput( '\nConverting old JSON repl history to line-separated history.\n' + @@ -119,11 +141,17 @@ function setupHistory(repl, historyPath, oldHistoryPath, ready) { repl._refreshLine(); try { - repl.history = JSON.parse(fs.readFileSync(oldHistoryPath, 'utf8')); + // Pre-v3.0, repl history was stored as JSON. + // Try and convert it to line separated history. + const oldReplJSONHistory = fs.readFileSync(oldHistoryPath, 'utf8'); + + // Only attempt to use the history if there was any. + if (oldReplJSONHistory) repl.history = JSON.parse(oldReplJSONHistory); + if (!Array.isArray(repl.history)) { throw new Error('Expected array, got ' + typeof repl.history); } - repl.history = repl.history.slice(-repl.historySize); + repl.history = repl.history.slice(0, repl.historySize); } catch (err) { if (err.code !== 'ENOENT') { return ready( diff --git a/lib/internal/socket_list.js b/lib/internal/socket_list.js index 950d632a26360d..0f4be6df239dd6 100644 --- a/lib/internal/socket_list.js +++ b/lib/internal/socket_list.js @@ -58,13 +58,11 @@ SocketListSend.prototype.getConnections = function getConnections(callback) { function SocketListReceive(slave, key) { EventEmitter.call(this); - var self = this; - this.connections = 0; this.key = key; this.slave = slave; - function onempty() { + function onempty(self) { if (!self.slave.connected) return; self.slave.send({ @@ -73,21 +71,21 @@ function SocketListReceive(slave, key) { }); } - this.slave.on('internalMessage', function(msg) { - if (msg.key !== self.key) return; + this.slave.on('internalMessage', (msg) => { + if (msg.key !== this.key) return; if (msg.cmd === 'NODE_SOCKET_NOTIFY_CLOSE') { // Already empty - if (self.connections === 0) return onempty(); + if (this.connections === 0) return onempty(this); // Wait for sockets to get closed - self.once('empty', onempty); + this.once('empty', onempty); } else if (msg.cmd === 'NODE_SOCKET_GET_COUNT') { - if (!self.slave.connected) return; - self.slave.send({ + if (!this.slave.connected) return; + this.slave.send({ cmd: 'NODE_SOCKET_COUNT', - key: self.key, - count: self.connections + key: this.key, + count: this.connections }); } }); @@ -95,14 +93,12 @@ function SocketListReceive(slave, key) { util.inherits(SocketListReceive, EventEmitter); SocketListReceive.prototype.add = function(obj) { - var self = this; - this.connections++; // Notify previous owner of socket about its state change - obj.socket.once('close', function() { - self.connections--; + obj.socket.once('close', () => { + this.connections--; - if (self.connections === 0) self.emit('empty'); + if (this.connections === 0) this.emit('empty', this); }); }; diff --git a/lib/internal/util.js b/lib/internal/util.js index a31f22e6e9f186..c34682ed1b3809 100644 --- a/lib/internal/util.js +++ b/lib/internal/util.js @@ -1,7 +1,10 @@ 'use strict'; +const binding = process.binding('util'); const prefix = '(node) '; +exports.getHiddenValue = binding.getHiddenValue; + // All the internal deprecations have to use this function only, as this will // prepend the prefix to the actual message. exports.deprecate = function(fn, msg) { @@ -54,3 +57,21 @@ exports._deprecate = function(fn, msg) { return deprecated; }; + +exports.decorateErrorStack = function decorateErrorStack(err) { + if (!(exports.isError(err) && err.stack)) + return; + + const arrow = exports.getHiddenValue(err, 'arrowMessage'); + + if (arrow) + err.stack = arrow + err.stack; +}; + +exports.isError = function isError(e) { + return exports.objectToString(e) === '[object Error]' || e instanceof Error; +}; + +exports.objectToString = function objectToString(o) { + return Object.prototype.toString.call(o); +}; diff --git a/lib/internal/v8_prof_polyfill.js b/lib/internal/v8_prof_polyfill.js new file mode 100644 index 00000000000000..755f8f0d65d1fb --- /dev/null +++ b/lib/internal/v8_prof_polyfill.js @@ -0,0 +1,102 @@ +// Copyright 2012 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Node polyfill +const fs = require('fs'); +const cp = require('child_process'); +const os = { + system: function(name, args) { + if (process.platform === 'linux' && name === 'nm') { + // Filter out vdso and vsyscall entries. + const arg = args[args.length - 1]; + if (arg === '[vdso]' || + arg == '[vsyscall]' || + /^[0-9a-f]+-[0-9a-f]+$/.test(arg)) { + return ''; + } + } else if (process.platform === 'darwin') { + args.unshift('-c', name); + name = '/bin/sh'; + } + return cp.spawnSync(name, args).stdout.toString(); + } +}; +const print = console.log; +function read(fileName) { + return fs.readFileSync(fileName, 'utf8'); +} +const quit = process.exit; + +// Polyfill "readline()". +const logFile = arguments[arguments.length - 1]; +try { + fs.accessSync(logFile); +} catch(e) { + console.error('Please provide a valid isolate file as the final argument.'); + process.exit(1); +} +const fd = fs.openSync(logFile, 'r'); +const buf = new Buffer(4096); +const dec = new (require('string_decoder').StringDecoder)('utf-8'); +var line = ''; +versionCheck(); +function readline() { + while (true) { + var lineBreak = line.indexOf('\n'); + if (lineBreak !== -1) { + var res = line.slice(0, lineBreak); + line = line.slice(lineBreak + 1); + return res; + } + var bytes = fs.readSync(fd, buf, 0, buf.length); + line += dec.write(buf.slice(0, bytes)); + if (line.length === 0) { + return false; + } + } +} + +function versionCheck() { + // v8-version looks like "v8-version,$major,$minor,$build,$patch,$candidate" + // whereas process.versions.v8 is either "$major.$minor.$build" or + // "$major.$minor.$build.$patch". + var firstLine = readline(); + line = firstLine + '\n' + line; + firstLine = firstLine.split(','); + const curVer = process.versions.v8.split('.'); + if (firstLine.length !== 6 && firstLine[0] !== 'v8-version') { + console.log('Unable to read v8-version from log file.'); + return; + } + // Compare major, minor and build; ignore the patch and candidate fields. + for (var i = 0; i < 3; i++) { + if (curVer[i] !== firstLine[i + 1]) { + console.log('Testing v8 version different from logging version'); + return; + } + } +} diff --git a/lib/internal/v8_prof_processor.js b/lib/internal/v8_prof_processor.js new file mode 100644 index 00000000000000..db5f400ed8febf --- /dev/null +++ b/lib/internal/v8_prof_processor.js @@ -0,0 +1,30 @@ +/* eslint-disable strict */ +const scriptFiles = [ + 'internal/v8_prof_polyfill', + 'v8/tools/splaytree', + 'v8/tools/codemap', + 'v8/tools/csvparser', + 'v8/tools/consarray', + 'v8/tools/profile', + 'v8/tools/profile_view', + 'v8/tools/logreader', + 'v8/tools/tickprocessor', + 'v8/tools/SourceMap', + 'v8/tools/tickprocessor-driver' +]; +var script = ''; + +scriptFiles.forEach(function(s) { + script += process.binding('natives')[s] + '\n'; +}); + +var tickArguments = []; +if (process.platform === 'darwin') { + const nm = 'foo() { nm "$@" | (c++filt -p -i || cat) }; foo $@'; + tickArguments.push('--mac', '--nm=' + nm); +} else if (process.platform === 'win32') { + tickArguments.push('--windows'); +} +tickArguments.push.apply(tickArguments, process.argv.slice(1)); +script = 'arguments = ' + JSON.stringify(tickArguments) + ';\n' + script; +eval(script); diff --git a/lib/module.js b/lib/module.js index ef0fad209ff9c8..871e7513cd5aa9 100644 --- a/lib/module.js +++ b/lib/module.js @@ -11,6 +11,9 @@ const path = require('path'); const internalModuleReadFile = process.binding('fs').internalModuleReadFile; const internalModuleStat = process.binding('fs').internalModuleStat; +const splitRe = process.platform === 'win32' ? /[\/\\]/ : /\//; +const isIndexRe = /^index\.\w+?$/; +const shebangRe = /^\#\!.*/; // If obj.hasOwnProperty has been overridden, then calling // obj.hasOwnProperty(prop) will break. @@ -20,6 +23,20 @@ function hasOwnProperty(obj, prop) { } +function stat(filename) { + filename = path._makeLong(filename); + const cache = stat.cache; + if (cache !== null) { + const result = cache.get(filename); + if (result !== undefined) return result; + } + const result = internalModuleStat(filename); + if (cache !== null) cache.set(filename, result); + return result; +} +stat.cache = null; + + function Module(id, parent) { this.id = id; this.exports = {}; @@ -44,7 +61,6 @@ Module.wrapper = NativeModule.wrapper; Module.wrap = NativeModule.wrap; Module._debug = util.debuglog('module'); - // We use this alias for the preprocessor that filters it out const debug = Module._debug; @@ -102,7 +118,7 @@ Module._realpathCache = {}; // check if the file exists and is not a directory function tryFile(requestPath) { - const rc = internalModuleStat(path._makeLong(requestPath)); + const rc = stat(requestPath); return rc === 0 && toRealPath(requestPath); } @@ -124,28 +140,27 @@ function tryExtensions(p, exts) { var warned = false; Module._findPath = function(request, paths) { - var exts = Object.keys(Module._extensions); - if (path.isAbsolute(request)) { paths = ['']; } - var trailingSlash = (request.slice(-1) === '/'); - var cacheKey = JSON.stringify({request: request, paths: paths}); if (Module._pathCache[cacheKey]) { return Module._pathCache[cacheKey]; } + const exts = Object.keys(Module._extensions); + const trailingSlash = request.slice(-1) === '/'; + // For each path for (var i = 0, PL = paths.length; i < PL; i++) { // Don't search further if path doesn't exist - if (paths[i] && internalModuleStat(path._makeLong(paths[i])) < 1) continue; + if (paths[i] && stat(paths[i]) < 1) continue; var basePath = path.resolve(paths[i], request); var filename; if (!trailingSlash) { - const rc = internalModuleStat(path._makeLong(basePath)); + const rc = stat(basePath); if (rc === 0) { // File. filename = toRealPath(basePath); } else if (rc === 1) { // Directory. @@ -191,7 +206,6 @@ Module._nodeModulePaths = function(from) { // note: this approach *only* works when the path is guaranteed // to be absolute. Doing a fully-edge-case-correct path.split // that works on both Windows and Posix is non-trivial. - var splitRe = process.platform === 'win32' ? /[\/\\]/ : /\//; var paths = []; var parts = from.split(splitRe); @@ -244,7 +258,7 @@ Module._resolveLookupPaths = function(request, parent) { // Is the parent an index module? // We can assume the parent has a valid extension, // as it already has been accepted as a module. - var isIndex = /^index\.\w+?$/.test(path.basename(parent.filename)); + var isIndex = isIndexRe.test(path.basename(parent.filename)); var parentIdPath = isIndex ? parent.id : path.dirname(parent.id); var id = path.resolve(parentIdPath, request); @@ -254,8 +268,8 @@ Module._resolveLookupPaths = function(request, parent) { id = './' + id; } - debug('RELATIVE: requested:' + request + - ' set ID to: ' + id + ' from ' + parent.id); + debug('RELATIVE: requested: %s set ID to: %s from %s', request, id, + parent.id); return [id, [path.dirname(parent.filename)]]; }; @@ -270,18 +284,7 @@ Module._resolveLookupPaths = function(request, parent) { // object. Module._load = function(request, parent, isMain) { if (parent) { - debug('Module._load REQUEST ' + (request) + ' parent: ' + parent.id); - } - - // REPL is a special case, because it needs the real require. - if (request === 'internal/repl' || request === 'repl') { - if (Module._cache[request]) { - return Module._cache[request]; - } - var replModule = new Module(request); - replModule._compile(NativeModule.getSource(request), `${request}.js`); - NativeModule._cache[request] = replModule; - return replModule.exports; + debug('Module._load REQUEST %s parent: %s', request, parent.id); } var filename = Module._resolveFilename(request, parent); @@ -292,7 +295,7 @@ Module._load = function(request, parent, isMain) { } if (NativeModule.nonInternalExists(filename)) { - debug('load native module ' + request); + debug('load native module %s', request); return NativeModule.require(filename); } @@ -329,8 +332,7 @@ Module._resolveFilename = function(request, parent) { var paths = resolvedModule[1]; // look up the filename first, since that's the cache key. - debug('looking for ' + JSON.stringify(id) + - ' in ' + JSON.stringify(paths)); + debug('looking for %j in %j', id, paths); var filename = Module._findPath(request, paths); if (!filename) { @@ -344,8 +346,7 @@ Module._resolveFilename = function(request, parent) { // Given a file name, pass it to the proper extension handler. Module.prototype.load = function(filename) { - debug('load ' + JSON.stringify(filename) + - ' for module ' + JSON.stringify(this.id)); + debug('load %j for module %j', filename, this.id); assert(!this.loaded); this.filename = filename; @@ -363,7 +364,7 @@ Module.prototype.load = function(filename) { Module.prototype.require = function(path) { assert(path, 'missing path'); assert(typeof path === 'string', 'path must be a string'); - return Module._load(path, this); + return Module._load(path, this, /* isMain */ false); }; @@ -377,31 +378,14 @@ var resolvedArgv; // the file. // Returns exception, if any. Module.prototype._compile = function(content, filename) { - var self = this; // remove shebang - content = content.replace(/^\#\!.*/, ''); - - function require(path) { - return self.require(path); - } - - require.resolve = function(request) { - return Module._resolveFilename(request, self); - }; - - require.main = process.mainModule; - - // Enable support to add extra extension types - require.extensions = Module._extensions; - - require.cache = Module._cache; - - var dirname = path.dirname(filename); + content = content.replace(shebangRe, ''); // create wrapper function var wrapper = Module.wrap(content); - var compiledWrapper = runInThisContext(wrapper, { filename: filename }); + var compiledWrapper = runInThisContext(wrapper, + { filename: filename, lineOffset: 0 }); if (global.v8debug) { if (!resolvedArgv) { // we enter the repl if we're not given a filename argument. @@ -421,8 +405,14 @@ Module.prototype._compile = function(content, filename) { global.v8debug.Debug.setBreakPoint(compiledWrapper, 0, 0); } } - var args = [self.exports, require, self, filename, dirname]; - return compiledWrapper.apply(self.exports, args); + const dirname = path.dirname(filename); + const require = internalModule.makeRequireFunction.call(this); + const args = [this.exports, require, this, filename, dirname]; + const depth = internalModule.requireDepth; + if (depth === 0) stat.cache = new Map(); + const result = compiledWrapper.apply(this.exports, args); + if (depth === 0) stat.cache = null; + return result; }; @@ -462,10 +452,11 @@ Module.runMain = function() { Module._initPaths = function() { const isWindows = process.platform === 'win32'; + var homeDir; if (isWindows) { - var homeDir = process.env.USERPROFILE; + homeDir = process.env.USERPROFILE; } else { - var homeDir = process.env.HOME; + homeDir = process.env.HOME; } var paths = [path.resolve(process.execPath, '..', '..', 'lib', 'node')]; @@ -488,10 +479,10 @@ Module._initPaths = function() { Module.globalPaths = modulePaths.slice(0); }; -// bootstrap repl -Module.requireRepl = function() { - return Module._load('internal/repl', '.'); -}; +// TODO(bnoordhuis) Unused, remove in the future. +Module.requireRepl = internalUtil.deprecate(function() { + return NativeModule.require('internal/repl'); +}, 'Module.requireRepl is deprecated.'); Module._preloadModules = function(requests) { if (!Array.isArray(requests)) diff --git a/lib/net.js b/lib/net.js index a7a8eb1fcc21a7..cfbbef15ba48da 100644 --- a/lib/net.js +++ b/lib/net.js @@ -5,6 +5,7 @@ const stream = require('stream'); const timers = require('timers'); const util = require('util'); const internalUtil = require('internal/util'); +const internalNet = require('internal/net'); const assert = require('assert'); const cares = process.binding('cares_wrap'); const uv = process.binding('uv'); @@ -22,6 +23,7 @@ const WriteWrap = process.binding('stream_wrap').WriteWrap; var cluster; const errnoException = util._errnoException; const exceptionWithHostPort = util._exceptionWithHostPort; +const isLegalPort = internalNet.isLegalPort; function noop() {} @@ -57,7 +59,11 @@ exports.createServer = function(options, connectionListener) { // connect(path, [cb]); // exports.connect = exports.createConnection = function() { - var args = normalizeConnectArgs(arguments); + const argsLen = arguments.length; + var args = new Array(argsLen); + for (var i = 0; i < argsLen; i++) + args[i] = arguments[i]; + args = normalizeConnectArgs(args); debug('createConnection', args); var s = new Socket(args[0]); return Socket.prototype.connect.apply(s, args); @@ -91,7 +97,6 @@ exports._normalizeConnectArgs = normalizeConnectArgs; // called when creating new Socket, or when re-using a closed Socket function initSocketHandle(self) { self.destroyed = false; - self.bytesRead = 0; self._bytesDispatched = 0; self._sockname = null; @@ -106,6 +111,10 @@ function initSocketHandle(self) { } } + +const BYTES_READ = Symbol('bytesRead'); + + function Socket(options) { if (!(this instanceof Socket)) return new Socket(options); @@ -169,6 +178,13 @@ function Socket(options) { this.read(0); } } + + // Reserve properties + this.server = null; + this._server = null; + + // Used after `.destroy()` + this[BYTES_READ] = 0; } util.inherits(Socket, stream.Duplex); @@ -267,9 +283,8 @@ function writeAfterFIN(chunk, encoding, cb) { var er = new Error('This socket has been ended by the other party'); er.code = 'EPIPE'; - var self = this; // TODO: defer error events consistently everywhere, not just the cb - self.emit('error', er); + this.emit('error', er); if (typeof cb === 'function') { process.nextTick(cb, er); } @@ -290,9 +305,8 @@ Socket.prototype.read = function(n) { Socket.prototype.listen = function() { debug('socket.listen'); - var self = this; - self.on('connection', arguments[0]); - listen(self, null, null, null); + this.on('connection', arguments[0]); + listen(this, null, null, null); }; @@ -322,7 +336,7 @@ Socket.prototype._onTimeout = function() { Socket.prototype.setNoDelay = function(enable) { if (!this._handle) { this.once('connect', - enable ? this.setNoDelay : this.setNoDelay.bind(this, enable)); + enable ? this.setNoDelay : () => this.setNoDelay(enable)); return this; } @@ -336,7 +350,7 @@ Socket.prototype.setNoDelay = function(enable) { Socket.prototype.setKeepAlive = function(setting, msecs) { if (!this._handle) { - this.once('connect', this.setKeepAlive.bind(this, setting, msecs)); + this.once('connect', () => this.setKeepAlive(setting, msecs)); return this; } @@ -384,7 +398,7 @@ Socket.prototype._read = function(n) { if (this._connecting || !this._handle) { debug('_read wait for connection'); - this.once('connect', this._read.bind(this, n)); + this.once('connect', () => this._read(n)); } else if (!this._handle.reading) { // not already reading, start the flow debug('Socket._read readStart'); @@ -436,9 +450,7 @@ Socket.prototype.destroySoon = function() { Socket.prototype._destroy = function(exception, cb) { debug('destroy'); - var self = this; - - function fireErrorCallbacks() { + function fireErrorCallbacks(self) { if (cb) cb(exception); if (exception && !self._writableState.errorEmitted) { process.nextTick(emitErrorNT, self, exception); @@ -448,11 +460,11 @@ Socket.prototype._destroy = function(exception, cb) { if (this.destroyed) { debug('already destroyed, fire error callbacks'); - fireErrorCallbacks(); + fireErrorCallbacks(this); return; } - self._connecting = false; + this._connecting = false; this.readable = this.writable = false; @@ -464,9 +476,12 @@ Socket.prototype._destroy = function(exception, cb) { if (this !== process.stderr) debug('close handle'); var isException = exception ? true : false; - this._handle.close(function() { + // `bytesRead` should be accessible after `.destroy()` + this[BYTES_READ] = this._handle.bytesRead; + + this._handle.close(() => { debug('emit close'); - self.emit('close', isException); + this.emit('close', isException); }); this._handle.onread = noop; this._handle = null; @@ -477,14 +492,14 @@ Socket.prototype._destroy = function(exception, cb) { // to make it re-entrance safe in case Socket.prototype.destroy() // is called within callbacks this.destroyed = true; - fireErrorCallbacks(); + fireErrorCallbacks(this); - if (this.server) { + if (this._server) { COUNTER_NET_SERVER_CONNECTION_CLOSE(this); debug('has server'); - this.server._connections--; - if (this.server._emitCloseIfDrained) { - this.server._emitCloseIfDrained(); + this._server._connections--; + if (this._server._emitCloseIfDrained) { + this._server._emitCloseIfDrained(); } } }; @@ -515,10 +530,6 @@ function onread(nread, buffer) { // will prevent this from being called again until _read() gets // called again. - // if it's not enough data, we'll just call handle.readStart() - // again right away. - self.bytesRead += nread; - // Optimization: emit the original buffer with end points var ret = self.push(buffer); @@ -574,16 +585,27 @@ Socket.prototype._getpeername = function() { return this._peername; }; +function protoGetter(name, callback) { + Object.defineProperty(Socket.prototype, name, { + configurable: false, + enumerable: true, + get: callback + }); +} + +protoGetter('bytesRead', function bytesRead() { + return this._handle ? this._handle.bytesRead : this[BYTES_READ]; +}); -Socket.prototype.__defineGetter__('remoteAddress', function() { +protoGetter('remoteAddress', function remoteAddress() { return this._getpeername().address; }); -Socket.prototype.__defineGetter__('remoteFamily', function() { +protoGetter('remoteFamily', function remoteFamily() { return this._getpeername().family; }); -Socket.prototype.__defineGetter__('remotePort', function() { +protoGetter('remotePort', function remotePort() { return this._getpeername().port; }); @@ -602,12 +624,12 @@ Socket.prototype._getsockname = function() { }; -Socket.prototype.__defineGetter__('localAddress', function() { +protoGetter('localAddress', function localAddress() { return this._getsockname().address; }); -Socket.prototype.__defineGetter__('localPort', function() { +protoGetter('localPort', function localPort() { return this._getsockname().port; }); @@ -651,10 +673,8 @@ Socket.prototype._writeGeneric = function(writev, data, encoding, cb) { var chunks = new Array(data.length << 1); for (var i = 0; i < data.length; i++) { var entry = data[i]; - var chunk = entry.chunk; - var enc = entry.encoding; - chunks[i * 2] = chunk; - chunks[i * 2 + 1] = enc; + chunks[i * 2] = entry.chunk; + chunks[i * 2 + 1] = entry.encoding; } err = this._handle.writev(req, chunks); @@ -721,11 +741,11 @@ function createWriteReq(req, handle, data, encoding) { } -Socket.prototype.__defineGetter__('bytesWritten', function() { - var bytes = this._bytesDispatched, - state = this._writableState, - data = this._pendingData, - encoding = this._pendingEncoding; +protoGetter('bytesWritten', function bytesWritten() { + var bytes = this._bytesDispatched; + const state = this._writableState; + const data = this._pendingData; + const encoding = this._pendingEncoding; if (!state) return undefined; @@ -760,7 +780,7 @@ function afterWrite(status, handle, req, err) { } if (status < 0) { - var ex = exceptionWithHostPort(status, 'write', req.address, req.port); + var ex = errnoException(status, 'write', req.error); debug('write failure', ex); self._destroy(ex, req.cb); return; @@ -806,17 +826,19 @@ function connect(self, address, port, addressType, localAddress, localPort) { err = bind(localAddress, localPort); if (err) { - var ex = exceptionWithHostPort(err, 'bind', localAddress, localPort); + const ex = exceptionWithHostPort(err, 'bind', localAddress, localPort); self._destroy(ex); return; } } if (addressType === 6 || addressType === 4) { - var req = new TCPConnectWrap(); + const req = new TCPConnectWrap(); req.oncomplete = afterConnect; req.address = address; req.port = port; + req.localAddress = localAddress; + req.localPort = localPort; if (addressType === 4) err = self._handle.connect(req, address, port); @@ -824,7 +846,7 @@ function connect(self, address, port, addressType, localAddress, localPort) { err = self._handle.connect6(req, address, port); } else { - var req = new PipeConnectWrap(); + const req = new PipeConnectWrap(); req.address = address; req.oncomplete = afterConnect; err = self._handle.connect(req, address, afterConnect); @@ -838,21 +860,12 @@ function connect(self, address, port, addressType, localAddress, localPort) { details = sockname.address + ':' + sockname.port; } - var ex = exceptionWithHostPort(err, 'connect', address, port, details); + const ex = exceptionWithHostPort(err, 'connect', address, port, details); self._destroy(ex); } } -// Check that the port number is not NaN when coerced to a number, -// is an integer and that it falls within the legal range of port numbers. -function isLegalPort(port) { - if (typeof port === 'string' && port.trim() === '') - return false; - return +port === (port >>> 0) && port >= 0 && port <= 0xFFFF; -} - - Socket.prototype.connect = function(options, cb) { if (this.write !== Socket.prototype.write) this.write = Socket.prototype.write; @@ -861,7 +874,11 @@ Socket.prototype.connect = function(options, cb) { // Old API: // connect(port, [host], [cb]) // connect(path, [cb]); - var args = normalizeConnectArgs(arguments); + const argsLen = arguments.length; + var args = new Array(argsLen); + for (var i = 0; i < argsLen; i++) + args[i] = arguments[i]; + args = normalizeConnectArgs(args); return Socket.prototype.connect.apply(this, args); } @@ -879,7 +896,6 @@ Socket.prototype.connect = function(options, cb) { this._sockname = null; } - var self = this; var pipe = !!options.path; debug('pipe', pipe, options.path); @@ -889,21 +905,20 @@ Socket.prototype.connect = function(options, cb) { } if (typeof cb === 'function') { - self.once('connect', cb); + this.once('connect', cb); } this._unrefTimer(); - self._connecting = true; - self.writable = true; + this._connecting = true; + this.writable = true; if (pipe) { - connect(self, options.path); - + connect(this, options.path); } else { - lookupAndConnect(self, options); + lookupAndConnect(this, options); } - return self; + return this; }; @@ -929,7 +944,6 @@ function lookupAndConnect(self, options) { port |= 0; // If host is an IP, skip performing a lookup - // TODO(evanlucas) should we hot path this for localhost? var addressType = exports.isIP(host); if (addressType) { process.nextTick(function() { @@ -944,17 +958,17 @@ function lookupAndConnect(self, options) { var dnsopts = { family: options.family, - hints: 0 + hints: options.hints || 0 }; - if (dnsopts.family !== 4 && dnsopts.family !== 6) { + if (dnsopts.family !== 4 && dnsopts.family !== 6 && dnsopts.hints === 0) { dnsopts.hints = dns.ADDRCONFIG; - // The AI_V4MAPPED hint is not supported on FreeBSD, and getaddrinfo - // returns EAI_BADFLAGS. However, it seems to be supported on most other - // systems. See + // The AI_V4MAPPED hint is not supported on FreeBSD or Android, + // and getaddrinfo returns EAI_BADFLAGS. However, it seems to be + // supported on most other systems. See // http://lists.freebsd.org/pipermail/freebsd-bugs/2008-February/028260.html // for more information on the lack of support for FreeBSD. - if (process.platform !== 'freebsd') + if (process.platform !== 'freebsd' && process.platform !== 'android') dnsopts.hints |= dns.V4MAPPED; } @@ -963,7 +977,7 @@ function lookupAndConnect(self, options) { self._host = host; var lookup = options.lookup || dns.lookup; lookup(host, dnsopts, function(err, ip, addressType) { - self.emit('lookup', err, ip, addressType); + self.emit('lookup', err, ip, addressType, host); // It's possible we were destroyed while looking this up. // XXX it would be great if we could cancel the promise returned by @@ -1056,15 +1070,17 @@ function afterConnect(status, handle, req, readable, writable) { self._connecting = false; var details; if (req.localAddress && req.localPort) { - ex.localAddress = req.localAddress; - ex.localPort = req.localPort; - details = ex.localAddress + ':' + ex.localPort; + details = req.localAddress + ':' + req.localPort; } var ex = exceptionWithHostPort(status, 'connect', req.address, req.port, details); + if (details) { + ex.localAddress = req.localAddress; + ex.localPort = req.localPort; + } self._destroy(ex); } } @@ -1076,34 +1092,31 @@ function Server(options, connectionListener) { EventEmitter.call(this); - var self = this; - var options; - if (typeof options === 'function') { connectionListener = options; options = {}; - self.on('connection', connectionListener); + this.on('connection', connectionListener); } else { options = options || {}; if (typeof connectionListener === 'function') { - self.on('connection', connectionListener); + this.on('connection', connectionListener); } } this._connections = 0; Object.defineProperty(this, 'connections', { - get: internalUtil.deprecate(function() { + get: internalUtil.deprecate(() => { - if (self._usingSlaves) { + if (this._usingSlaves) { return null; } - return self._connections; + return this._connections; }, 'Server.connections property is deprecated. ' + 'Use Server.getConnections method instead.'), - set: internalUtil.deprecate(function(val) { - return (self._connections = val); + set: internalUtil.deprecate((val) => { + return (this._connections = val); }, 'Server.connections property is deprecated.'), configurable: true, enumerable: false }); @@ -1129,8 +1142,7 @@ function _listen(handle, backlog) { return handle.listen(backlog || 511); } -var createServerHandle = exports._createServerHandle = - function(address, port, addressType, fd) { +function createServerHandle(address, port, addressType, fd) { var err = 0; // assign handle in listen, and clean up if bind or listen fails var handle; @@ -1185,16 +1197,16 @@ var createServerHandle = exports._createServerHandle = } return handle; -}; +} +exports._createServerHandle = createServerHandle; Server.prototype._listen2 = function(address, port, addressType, backlog, fd) { debug('listen2', address, port, addressType, backlog, fd); - var self = this; // If there is not yet a handle, we need to create one and bind. // In the case of a server sent via IPC, we don't need to do this. - if (self._handle) { + if (this._handle) { debug('_listen2: have a handle already'); } else { debug('_listen2: create a handle'); @@ -1219,22 +1231,22 @@ Server.prototype._listen2 = function(address, port, addressType, backlog, fd) { if (typeof rval === 'number') { var error = exceptionWithHostPort(rval, 'listen', address, port); - process.nextTick(emitErrorNT, self, error); + process.nextTick(emitErrorNT, this, error); return; } - self._handle = rval; + this._handle = rval; } - self._handle.onconnection = onconnection; - self._handle.owner = self; + this._handle.onconnection = onconnection; + this._handle.owner = this; - var err = _listen(self._handle, backlog); + var err = _listen(this._handle, backlog); if (err) { var ex = exceptionWithHostPort(err, 'listen', address, port); - self._handle.close(); - self._handle = null; - process.nextTick(emitErrorNT, self, ex); + this._handle.close(); + this._handle = null; + process.nextTick(emitErrorNT, this, ex); return; } @@ -1245,7 +1257,7 @@ Server.prototype._listen2 = function(address, port, addressType, backlog, fd) { if (this._unref) this.unref(); - process.nextTick(emitListeningNT, self); + process.nextTick(emitListeningNT, this); }; @@ -1348,7 +1360,7 @@ Server.prototype.listen = function() { else listen(self, null, h.port | 0, 4, backlog, undefined, h.exclusive); } else if (h.path && isPipeName(h.path)) { - var pipeName = self._pipeName = h.path; + const pipeName = self._pipeName = h.path; listen(self, pipeName, -1, -1, backlog, undefined, h.exclusive); } else { throw new Error('Invalid listen argument: ' + h); @@ -1356,7 +1368,7 @@ Server.prototype.listen = function() { } } else if (isPipeName(arguments[0])) { // UNIX socket or Windows pipe. - var pipeName = self._pipeName = arguments[0]; + const pipeName = self._pipeName = arguments[0]; listen(self, pipeName, -1, -1, backlog); } else if (arguments[1] === undefined || @@ -1384,6 +1396,14 @@ Server.prototype.listen = function() { return self; }; +Object.defineProperty(Server.prototype, 'listening', { + get: function() { + return !!this._handle; + }, + configurable: true, + enumerable: true +}); + Server.prototype.address = function() { if (this._handle && this._handle.getsockname) { var out = {}; @@ -1423,6 +1443,7 @@ function onconnection(err, clientHandle) { self._connections++; socket.server = self; + socket._server = self; DTRACE_NET_SERVER_CONNECTION(socket); LTTNG_NET_SERVER_CONNECTION(socket); @@ -1441,8 +1462,8 @@ Server.prototype.getConnections = function(cb) { } // Poll slaves - var left = this._slaves.length, - total = this._connections; + var left = this._slaves.length; + var total = this._connections; function oncount(err, count) { if (err) { @@ -1484,8 +1505,8 @@ Server.prototype.close = function(cb) { } if (this._usingSlaves) { - var self = this, - left = this._slaves.length; + var self = this; + var left = this._slaves.length; // Increment connections to be sure that, even if all sockets will be closed // during polling of slaves, `close` event will be emitted only once. @@ -1504,15 +1525,14 @@ Server.prototype.close = function(cb) { Server.prototype._emitCloseIfDrained = function() { debug('SERVER _emitCloseIfDrained'); - var self = this; - if (self._handle || self._connections) { + if (this._handle || this._connections) { debug('SERVER handle? %j connections? %d', - !!self._handle, self._connections); + !!this._handle, this._connections); return; } - process.nextTick(emitCloseNT, self); + process.nextTick(emitCloseNT, this); }; @@ -1554,12 +1574,12 @@ exports.isIP = cares.isIP; exports.isIPv4 = function(input) { - return exports.isIP(input) === 4; + return cares.isIPv4(input); }; exports.isIPv6 = function(input) { - return exports.isIP(input) === 6; + return cares.isIPv6(input); }; diff --git a/lib/os.js b/lib/os.js index 2d537f53840a35..42ece99a7d266c 100644 --- a/lib/os.js +++ b/lib/os.js @@ -1,7 +1,6 @@ 'use strict'; const binding = process.binding('os'); -const util = require('util'); const internalUtil = require('internal/util'); const isWindows = process.platform === 'win32'; @@ -25,23 +24,23 @@ exports.platform = function() { return process.platform; }; -const trailingSlashRe = isWindows ? /[^:]\\$/ - : /.\/$/; - exports.tmpdir = function() { var path; if (isWindows) { path = process.env.TEMP || process.env.TMP || (process.env.SystemRoot || process.env.windir) + '\\temp'; + if (path.length > 1 && path.endsWith('\\') && !path.endsWith(':\\')) + path = path.slice(0, -1); } else { path = process.env.TMPDIR || process.env.TMP || process.env.TEMP || '/tmp'; + if (path.length > 1 && path.endsWith('/')) + path = path.slice(0, -1); } - if (trailingSlashRe.test(path)) - path = path.slice(0, -1); + return path; }; diff --git a/lib/path.js b/lib/path.js index 0c9c656e66c3a7..cc1d6e9618d92e 100644 --- a/lib/path.js +++ b/lib/path.js @@ -1,612 +1,1599 @@ 'use strict'; -const util = require('util'); -const isWindows = process.platform === 'win32'; +const inspect = require('util').inspect; function assertPath(path) { if (typeof path !== 'string') { - throw new TypeError('Path must be a string. Received ' + - util.inspect(path)); + throw new TypeError('Path must be a string. Received ' + inspect(path)); } } -// resolves . and .. elements in a path array with directory names there -// must be no slashes or device names (c:\) in the array -// (so also no leading and trailing slashes - it does not distinguish -// relative and absolute paths) -function normalizeArray(parts, allowAboveRoot) { - var res = []; - for (var i = 0; i < parts.length; i++) { - var p = parts[i]; - - // ignore empty parts - if (!p || p === '.') - continue; - - if (p === '..') { - if (res.length && res[res.length - 1] !== '..') { - res.pop(); - } else if (allowAboveRoot) { - res.push('..'); +// Resolves . and .. elements in a path with directory names +function normalizeStringWin32(path, allowAboveRoot) { + var res = ''; + var lastSlash = -1; + var dots = 0; + var code; + for (var i = 0; i <= path.length; ++i) { + if (i < path.length) + code = path.charCodeAt(i); + else if (code === 47/*/*/ || code === 92/*\*/) + break; + else + code = 47/*/*/; + if (code === 47/*/*/ || code === 92/*\*/) { + if (lastSlash === i - 1 || dots === 1) { + // NOOP + } else if (lastSlash !== i - 1 && dots === 2) { + if (res.length < 2 || + res.charCodeAt(res.length - 1) !== 46/*.*/ || + res.charCodeAt(res.length - 2) !== 46/*.*/) { + if (res.length > 2) { + const start = res.length - 1; + var j = start; + for (; j >= 0; --j) { + if (res.charCodeAt(j) === 92/*\*/) + break; + } + if (j !== start) { + if (j === -1) + res = ''; + else + res = res.slice(0, j); + lastSlash = i; + dots = 0; + continue; + } + } else if (res.length === 2 || res.length === 1) { + res = ''; + lastSlash = i; + dots = 0; + continue; + } + } + if (allowAboveRoot) { + if (res.length > 0) + res += '\\..'; + else + res = '..'; + } + } else { + if (res.length > 0) + res += '\\' + path.slice(lastSlash + 1, i); + else + res = path.slice(lastSlash + 1, i); } + lastSlash = i; + dots = 0; + } else if (code === 46/*.*/ && dots !== -1) { + ++dots; } else { - res.push(p); + dots = -1; } } - return res; } -// Returns an array with empty elements removed from either end of the input -// array or the original array if no elements need to be removed -function trimArray(arr) { - var lastIndex = arr.length - 1; - var start = 0; - for (; start <= lastIndex; start++) { - if (arr[start]) +// Resolves . and .. elements in a path with directory names +function normalizeStringPosix(path, allowAboveRoot) { + var res = ''; + var lastSlash = -1; + var dots = 0; + var code; + for (var i = 0; i <= path.length; ++i) { + if (i < path.length) + code = path.charCodeAt(i); + else if (code === 47/*/*/) break; + else + code = 47/*/*/; + if (code === 47/*/*/) { + if (lastSlash === i - 1 || dots === 1) { + // NOOP + } else if (lastSlash !== i - 1 && dots === 2) { + if (res.length < 2 || + res.charCodeAt(res.length - 1) !== 46/*.*/ || + res.charCodeAt(res.length - 2) !== 46/*.*/) { + if (res.length > 2) { + const start = res.length - 1; + var j = start; + for (; j >= 0; --j) { + if (res.charCodeAt(j) === 47/*/*/) + break; + } + if (j !== start) { + if (j === -1) + res = ''; + else + res = res.slice(0, j); + lastSlash = i; + dots = 0; + continue; + } + } else if (res.length === 2 || res.length === 1) { + res = ''; + lastSlash = i; + dots = 0; + continue; + } + } + if (allowAboveRoot) { + if (res.length > 0) + res += '/..'; + else + res = '..'; + } + } else { + if (res.length > 0) + res += '/' + path.slice(lastSlash + 1, i); + else + res = path.slice(lastSlash + 1, i); + } + lastSlash = i; + dots = 0; + } else if (code === 46/*.*/ && dots !== -1) { + ++dots; + } else { + dots = -1; + } } + return res; +} - var end = lastIndex; - for (; end >= 0; end--) { - if (arr[end]) - break; +function _format(sep, pathObject) { + const dir = pathObject.dir || pathObject.root; + const base = pathObject.base || + ((pathObject.name || '') + (pathObject.ext || '')); + if (!dir) { + return base; } - - if (start === 0 && end === lastIndex) - return arr; - if (start > end) - return []; - return arr.slice(start, end + 1); + if (dir === pathObject.root) { + return dir + base; + } + return dir + sep + base; } -// Regex to split a windows path into three parts: [*, device, slash, -// tail] windows-only -const splitDeviceRe = - /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; - -// Regex to split the tail part of the above into [*, dir, basename, ext] -const splitTailRe = - /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/; - -var win32 = {}; - -// Function to split a filename into [root, dir, basename, ext] -function win32SplitPath(filename) { - // Separate device+slash from tail - var result = splitDeviceRe.exec(filename), - device = (result[1] || '') + (result[2] || ''), - tail = result[3]; - // Split the tail into dir, basename and extension - var result2 = splitTailRe.exec(tail), - dir = result2[1], - basename = result2[2], - ext = result2[3]; - return [device, dir, basename, ext]; -} +const win32 = { + // path.resolve([from ...], to) + resolve: function resolve() { + var resolvedDevice = ''; + var resolvedTail = ''; + var resolvedAbsolute = false; + + for (var i = arguments.length - 1; i >= -1; i--) { + var path; + if (i >= 0) { + path = arguments[i]; + } else if (!resolvedDevice) { + path = process.cwd(); + } else { + // Windows has the concept of drive-specific current working + // directories. If we've resolved a drive letter but not yet an + // absolute path, get cwd for that drive. We're sure the device is not + // a UNC path at this points, because UNC paths are always absolute. + path = process.env['=' + resolvedDevice]; + // Verify that a drive-local cwd was found and that it actually points + // to our drive. If not, default to the drive's root. + if (path === undefined || + path.slice(0, 3).toLowerCase() !== + resolvedDevice.toLowerCase() + '\\') { + path = resolvedDevice + '\\'; + } + } -function win32StatPath(path) { - var result = splitDeviceRe.exec(path), - device = result[1] || '', - isUnc = !!device && device[1] !== ':'; - return { - device, - isUnc, - isAbsolute: isUnc || !!result[2], // UNC paths are always absolute - tail: result[3] - }; -} + assertPath(path); -function normalizeUNCRoot(device) { - return '\\\\' + device.replace(/^[\\\/]+/, '').replace(/[\\\/]+/g, '\\'); -} + // Skip empty entries + if (path.length === 0) { + continue; + } -// path.resolve([from ...], to) -win32.resolve = function() { - var resolvedDevice = '', - resolvedTail = '', - resolvedAbsolute = false; - - for (var i = arguments.length - 1; i >= -1; i--) { - var path; - if (i >= 0) { - path = arguments[i]; - } else if (!resolvedDevice) { - path = process.cwd(); - } else { - // Windows has the concept of drive-specific current working - // directories. If we've resolved a drive letter but not yet an - // absolute path, get cwd for that drive. We're sure the device is not - // an unc path at this points, because unc paths are always absolute. - path = process.env['=' + resolvedDevice]; - // Verify that a drive-local cwd was found and that it actually points - // to our drive. If not, default to the drive's root. - if (!path || path.substr(0, 3).toLowerCase() !== - resolvedDevice.toLowerCase() + '\\') { - path = resolvedDevice + '\\'; + var len = path.length; + var rootEnd = 0; + var code = path.charCodeAt(0); + var device = ''; + var isAbsolute = false; + + // Try to match a root + if (len > 1) { + if (code === 47/*/*/ || code === 92/*\*/) { + // Possible UNC root + + // If we started with a separator, we know we at least have an + // absolute path of some kind (UNC or otherwise) + isAbsolute = true; + + code = path.charCodeAt(1); + if (code === 47/*/*/ || code === 92/*\*/) { + // Matched double path separator at beginning + var j = 2; + var last = j; + // Match 1 or more non-path separators + for (; j < len; ++j) { + code = path.charCodeAt(j); + if (code === 47/*/*/ || code === 92/*\*/) + break; + } + if (j < len && j !== last) { + const firstPart = path.slice(last, j); + // Matched! + last = j; + // Match 1 or more path separators + for (; j < len; ++j) { + code = path.charCodeAt(j); + if (code !== 47/*/*/ && code !== 92/*\*/) + break; + } + if (j < len && j !== last) { + // Matched! + last = j; + // Match 1 or more non-path separators + for (; j < len; ++j) { + code = path.charCodeAt(j); + if (code === 47/*/*/ || code === 92/*\*/) + break; + } + if (j === len) { + // We matched a UNC root only + + device = '\\\\' + firstPart + '\\' + path.slice(last); + rootEnd = j; + } else if (j !== last) { + // We matched a UNC root with leftovers + + device = '\\\\' + firstPart + '\\' + path.slice(last, j); + rootEnd = j; + } + } + } + } else { + rootEnd = 1; + } + } else if ((code >= 65/*A*/ && code <= 90/*Z*/) || + (code >= 97/*a*/ && code <= 122/*z*/)) { + // Possible device root + + code = path.charCodeAt(1); + if (path.charCodeAt(1) === 58/*:*/) { + device = path.slice(0, 2); + rootEnd = 2; + if (len > 2) { + code = path.charCodeAt(2); + if (code === 47/*/*/ || code === 92/*\*/) { + // Treat separator following drive name as an absolute path + // indicator + isAbsolute = true; + rootEnd = 3; + } + } + } + } + } else if (code === 47/*/*/ || code === 92/*\*/) { + // `path` contains just a path separator + rootEnd = 1; + isAbsolute = true; } - } - assertPath(path); + if (device.length > 0 && + resolvedDevice.length > 0 && + device.toLowerCase() !== resolvedDevice.toLowerCase()) { + // This path points to another device so it is not applicable + continue; + } - // Skip empty entries - if (path === '') { - continue; + if (resolvedDevice.length === 0 && device.length > 0) { + resolvedDevice = device; + } + if (!resolvedAbsolute) { + resolvedTail = path.slice(rootEnd) + '\\' + resolvedTail; + resolvedAbsolute = isAbsolute; + } + + if (resolvedDevice.length > 0 && resolvedAbsolute) { + break; + } } - var result = win32StatPath(path), - device = result.device, - isUnc = result.isUnc, - isAbsolute = result.isAbsolute, - tail = result.tail; + // At this point the path should be resolved to a full absolute path, + // but handle relative paths to be safe (might happen when process.cwd() + // fails) - if (device && - resolvedDevice && - device.toLowerCase() !== resolvedDevice.toLowerCase()) { - // This path points to another device so it is not applicable - continue; - } + // Normalize the tail path + resolvedTail = normalizeStringWin32(resolvedTail, !resolvedAbsolute); - if (!resolvedDevice) { - resolvedDevice = device; - } - if (!resolvedAbsolute) { - resolvedTail = tail + '\\' + resolvedTail; - resolvedAbsolute = isAbsolute; - } + return (resolvedDevice + (resolvedAbsolute ? '\\' : '') + resolvedTail) || + '.'; + }, - if (resolvedDevice && resolvedAbsolute) { - break; + normalize: function normalize(path) { + assertPath(path); + const len = path.length; + if (len === 0) + return '.'; + var rootEnd = 0; + var code = path.charCodeAt(0); + var device; + var isAbsolute = false; + + // Try to match a root + if (len > 1) { + if (code === 47/*/*/ || code === 92/*\*/) { + // Possible UNC root + + // If we started with a separator, we know we at least have an absolute + // path of some kind (UNC or otherwise) + isAbsolute = true; + + code = path.charCodeAt(1); + if (code === 47/*/*/ || code === 92/*\*/) { + // Matched double path separator at beginning + var j = 2; + var last = j; + // Match 1 or more non-path separators + for (; j < len; ++j) { + code = path.charCodeAt(j); + if (code === 47/*/*/ || code === 92/*\*/) + break; + } + if (j < len && j !== last) { + const firstPart = path.slice(last, j); + // Matched! + last = j; + // Match 1 or more path separators + for (; j < len; ++j) { + code = path.charCodeAt(j); + if (code !== 47/*/*/ && code !== 92/*\*/) + break; + } + if (j < len && j !== last) { + // Matched! + last = j; + // Match 1 or more non-path separators + for (; j < len; ++j) { + code = path.charCodeAt(j); + if (code === 47/*/*/ || code === 92/*\*/) + break; + } + if (j === len) { + // We matched a UNC root only + // Return the normalized version of the UNC root since there + // is nothing left to process + + return '\\\\' + firstPart + '\\' + path.slice(last) + '\\'; + } else if (j !== last) { + // We matched a UNC root with leftovers + + device = '\\\\' + firstPart + '\\' + path.slice(last, j); + rootEnd = j; + } + } + } + } else { + rootEnd = 1; + } + } else if ((code >= 65/*A*/ && code <= 90/*Z*/) || + (code >= 97/*a*/ && code <= 122/*z*/)) { + // Possible device root + + code = path.charCodeAt(1); + if (path.charCodeAt(1) === 58/*:*/) { + device = path.slice(0, 2); + rootEnd = 2; + if (len > 2) { + code = path.charCodeAt(2); + if (code === 47/*/*/ || code === 92/*\*/) { + // Treat separator following drive name as an absolute path + // indicator + isAbsolute = true; + rootEnd = 3; + } + } + } + } + } else if (code === 47/*/*/ || code === 92/*\*/) { + // `path` contains just a path separator, exit early to avoid unnecessary + // work + return '\\'; } - } - // Convert slashes to backslashes when `resolvedDevice` points to an UNC - // root. Also squash multiple slashes into a single one where appropriate. - if (isUnc) { - resolvedDevice = normalizeUNCRoot(resolvedDevice); - } + code = path.charCodeAt(len - 1); + var trailingSeparator = (code === 47/*/*/ || code === 92/*\*/); + var tail; + if (rootEnd < len) + tail = normalizeStringWin32(path.slice(rootEnd), !isAbsolute); + else + tail = ''; + if (tail.length === 0 && !isAbsolute) + tail = '.'; + if (tail.length > 0 && trailingSeparator) + tail += '\\'; + if (device === undefined) { + if (isAbsolute) { + if (tail.length > 0) + return '\\' + tail; + else + return '\\'; + } else if (tail.length > 0) { + return tail; + } else { + return ''; + } + } else { + if (isAbsolute) { + if (tail.length > 0) + return device + '\\' + tail; + else + return device + '\\'; + } else if (tail.length > 0) { + return device + tail; + } else { + return device; + } + } + }, - // At this point the path should be resolved to a full absolute path, - // but handle relative paths to be safe (might happen when process.cwd() - // fails) - // Normalize the tail path - resolvedTail = normalizeArray(resolvedTail.split(/[\\\/]+/), - !resolvedAbsolute).join('\\'); + isAbsolute: function isAbsolute(path) { + assertPath(path); + const len = path.length; + if (len === 0) + return false; + var code = path.charCodeAt(0); + if (code === 47/*/*/ || code === 92/*\*/) { + return true; + } else if ((code >= 65/*A*/ && code <= 90/*Z*/) || + (code >= 97/*a*/ && code <= 122/*z*/)) { + // Possible device root + + if (len > 2 && path.charCodeAt(1) === 58/*:*/) { + code = path.charCodeAt(2); + if (code === 47/*/*/ || code === 92/*\*/) + return true; + } + } + return false; + }, + + + join: function join() { + if (arguments.length === 0) + return '.'; + + var joined; + var firstPart; + for (var i = 0; i < arguments.length; ++i) { + var arg = arguments[i]; + assertPath(arg); + if (arg.length > 0) { + if (joined === undefined) + joined = firstPart = arg; + else + joined += '\\' + arg; + } + } - return (resolvedDevice + (resolvedAbsolute ? '\\' : '') + resolvedTail) || - '.'; -}; + if (joined === undefined) + return '.'; + + // Make sure that the joined path doesn't start with two slashes, because + // normalize() will mistake it for an UNC path then. + // + // This step is skipped when it is very clear that the user actually + // intended to point at an UNC path. This is assumed when the first + // non-empty string arguments starts with exactly two slashes followed by + // at least one more non-slash character. + // + // Note that for normalize() to treat a path as an UNC path it needs to + // have at least 2 components, so we don't filter for that here. + // This means that the user can use join to construct UNC paths from + // a server name and a share name; for example: + // path.join('//server', 'share') -> '\\\\server\\share\\') + //var firstPart = paths[0]; + var needsReplace = true; + var slashCount = 0; + var code = firstPart.charCodeAt(0); + if (code === 47/*/*/ || code === 92/*\*/) { + ++slashCount; + const firstLen = firstPart.length; + if (firstLen > 1) { + code = firstPart.charCodeAt(1); + if (code === 47/*/*/ || code === 92/*\*/) { + ++slashCount; + if (firstLen > 2) { + code = firstPart.charCodeAt(2); + if (code === 47/*/*/ || code === 92/*\*/) + ++slashCount; + else { + // We matched a UNC path in the first part + needsReplace = false; + } + } + } + } + } + if (needsReplace) { + // Find any more consecutive slashes we need to replace + for (; slashCount < joined.length; ++slashCount) { + code = joined.charCodeAt(slashCount); + if (code !== 47/*/*/ && code !== 92/*\*/) + break; + } + // Replace the slashes if needed + if (slashCount >= 2) + joined = '\\' + joined.slice(slashCount); + } -win32.normalize = function(path) { - assertPath(path); + return win32.normalize(joined); + }, - var result = win32StatPath(path), - device = result.device, - isUnc = result.isUnc, - isAbsolute = result.isAbsolute, - tail = result.tail, - trailingSlash = /[\\\/]$/.test(tail); - // Normalize the tail path - tail = normalizeArray(tail.split(/[\\\/]+/), !isAbsolute).join('\\'); + // It will solve the relative path from `from` to `to`, for instance: + // from = 'C:\\orandea\\test\\aaa' + // to = 'C:\\orandea\\impl\\bbb' + // The output of the function should be: '..\\..\\impl\\bbb' + relative: function relative(from, to) { + assertPath(from); + assertPath(to); - if (!tail && !isAbsolute) { - tail = '.'; - } - if (tail && trailingSlash) { - tail += '\\'; - } + if (from === to) + return ''; - // Convert slashes to backslashes when `device` points to an UNC root. - // Also squash multiple slashes into a single one where appropriate. - if (isUnc) { - device = normalizeUNCRoot(device); - } + var fromOrig = win32.resolve(from); + var toOrig = win32.resolve(to); - return device + (isAbsolute ? '\\' : '') + tail; -}; + if (fromOrig === toOrig) + return ''; + from = fromOrig.toLowerCase(); + to = toOrig.toLowerCase(); -win32.isAbsolute = function(path) { - assertPath(path); - return win32StatPath(path).isAbsolute; -}; + if (from === to) + return ''; -win32.join = function() { - var paths = []; - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - assertPath(arg); - if (arg) { - paths.push(arg); + // Trim any leading backslashes + var fromStart = 0; + for (; fromStart < from.length; ++fromStart) { + if (from.charCodeAt(fromStart) !== 92/*\*/) + break; } - } - - var joined = paths.join('\\'); - - // Make sure that the joined path doesn't start with two slashes, because - // normalize() will mistake it for an UNC path then. - // - // This step is skipped when it is very clear that the user actually - // intended to point at an UNC path. This is assumed when the first - // non-empty string arguments starts with exactly two slashes followed by - // at least one more non-slash character. - // - // Note that for normalize() to treat a path as an UNC path it needs to - // have at least 2 components, so we don't filter for that here. - // This means that the user can use join to construct UNC paths from - // a server name and a share name; for example: - // path.join('//server', 'share') -> '\\\\server\\share\') - if (!/^[\\\/]{2}[^\\\/]/.test(paths[0])) { - joined = joined.replace(/^[\\\/]{2,}/, '\\'); - } - - return win32.normalize(joined); -}; + // Trim trailing backslashes (applicable to UNC paths only) + var fromEnd = from.length; + for (; fromEnd - 1 > fromStart; --fromEnd) { + if (from.charCodeAt(fromEnd - 1) !== 92/*\*/) + break; + } + var fromLen = (fromEnd - fromStart); + // Trim any leading backslashes + var toStart = 0; + for (; toStart < to.length; ++toStart) { + if (to.charCodeAt(toStart) !== 92/*\*/) + break; + } + // Trim trailing backslashes (applicable to UNC paths only) + var toEnd = to.length; + for (; toEnd - 1 > toStart; --toEnd) { + if (to.charCodeAt(toEnd - 1) !== 92/*\*/) + break; + } + var toLen = (toEnd - toStart); + + // Compare paths to find the longest common path from root + var length = (fromLen < toLen ? fromLen : toLen); + var lastCommonSep = -1; + var i = 0; + for (; i <= length; ++i) { + if (i === length) { + if (toLen > length) { + if (to.charCodeAt(toStart + i) === 92/*\*/) { + // We get here if `from` is the exact base path for `to`. + // For example: from='C:\\foo\\bar'; to='C:\\foo\\bar\\baz' + return toOrig.slice(toStart + i + 1); + } else if (i === 2) { + // We get here if `from` is the device root. + // For example: from='C:\\'; to='C:\\foo' + return toOrig.slice(toStart + i); + } + } + if (fromLen > length) { + if (from.charCodeAt(fromStart + i) === 92/*\*/) { + // We get here if `to` is the exact base path for `from`. + // For example: from='C:\\foo\\bar'; to='C:\\foo' + lastCommonSep = i; + } else if (i === 2) { + // We get here if `to` is the device root. + // For example: from='C:\\foo\\bar'; to='C:\\' + lastCommonSep = 3; + } + } + break; + } + var fromCode = from.charCodeAt(fromStart + i); + var toCode = to.charCodeAt(toStart + i); + if (fromCode !== toCode) + break; + else if (fromCode === 92/*\*/) + lastCommonSep = i; + } -// path.relative(from, to) -// it will solve the relative path from 'from' to 'to', for instance: -// from = 'C:\\orandea\\test\\aaa' -// to = 'C:\\orandea\\impl\\bbb' -// The output of the function should be: '..\\..\\impl\\bbb' -win32.relative = function(from, to) { - assertPath(from); - assertPath(to); + // We found a mismatch before the first common path separator was seen, so + // return the original `to`. + // TODO: do this just for device roots (and not UNC paths)? + if (i !== length && lastCommonSep === -1) { + if (toStart > 0) + return toOrig.slice(toStart); + else + return toOrig; + } - from = win32.resolve(from); - to = win32.resolve(to); + var out = ''; + if (lastCommonSep === -1) + lastCommonSep = 0; + // Generate the relative path based on the path difference between `to` and + // `from` + for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) { + if (i === fromEnd || from.charCodeAt(i) === 92/*\*/) { + if (out.length === 0) + out += '..'; + else + out += '\\..'; + } + } - // windows is not case sensitive - var lowerFrom = from.toLowerCase(); - var lowerTo = to.toLowerCase(); + // Lastly, append the rest of the destination (`to`) path that comes after + // the common path parts + if (out.length > 0) + return out + toOrig.slice(toStart + lastCommonSep, toEnd); + else { + toStart += lastCommonSep; + if (toOrig.charCodeAt(toStart) === 92/*\*/) + ++toStart; + return toOrig.slice(toStart, toEnd); + } + }, - var toParts = trimArray(to.split('\\')); - var lowerFromParts = trimArray(lowerFrom.split('\\')); - var lowerToParts = trimArray(lowerTo.split('\\')); + _makeLong: function _makeLong(path) { + // Note: this will *probably* throw somewhere. + if (typeof path !== 'string') + return path; - var length = Math.min(lowerFromParts.length, lowerToParts.length); - var samePartsLength = length; - for (var i = 0; i < length; i++) { - if (lowerFromParts[i] !== lowerToParts[i]) { - samePartsLength = i; - break; + if (path.length === 0) { + return ''; } - } - if (samePartsLength === 0) { - return to; - } - - var outputParts = []; - for (var i = samePartsLength; i < lowerFromParts.length; i++) { - outputParts.push('..'); - } - - outputParts = outputParts.concat(toParts.slice(samePartsLength)); + const resolvedPath = win32.resolve(path); + + if (resolvedPath.length >= 3) { + var code = resolvedPath.charCodeAt(0); + if (code === 92/*\*/) { + // Possible UNC root + + if (resolvedPath.charCodeAt(1) === 92/*\*/) { + code = resolvedPath.charCodeAt(2); + if (code !== 63/*?*/ && code !== 46/*.*/) { + // Matched non-long UNC root, convert the path to a long UNC path + return '\\\\?\\UNC\\' + resolvedPath.slice(2); + } + } + } else if ((code >= 65/*A*/ && code <= 90/*Z*/) || + (code >= 97/*a*/ && code <= 122/*z*/)) { + // Possible device root + + if (resolvedPath.charCodeAt(1) === 58/*:*/ && + resolvedPath.charCodeAt(2) === 92/*\*/) { + // Matched device root, convert the path to a long UNC path + return '\\\\?\\' + resolvedPath; + } + } + } - return outputParts.join('\\'); -}; + return path; + }, + + + dirname: function dirname(path) { + if (typeof path !== 'string') + path = '' + path; + const len = path.length; + if (len === 0) + return '.'; + var rootEnd = -1; + var end = -1; + var matchedSlash = true; + var offset = 0; + var code = path.charCodeAt(0); + + // Try to match a root + if (len > 1) { + if (code === 47/*/*/ || code === 92/*\*/) { + // Possible UNC root + + rootEnd = offset = 1; + + code = path.charCodeAt(1); + if (code === 47/*/*/ || code === 92/*\*/) { + // Matched double path separator at beginning + var j = 2; + var last = j; + // Match 1 or more non-path separators + for (; j < len; ++j) { + code = path.charCodeAt(j); + if (code === 47/*/*/ || code === 92/*\*/) + break; + } + if (j < len && j !== last) { + // Matched! + last = j; + // Match 1 or more path separators + for (; j < len; ++j) { + code = path.charCodeAt(j); + if (code !== 47/*/*/ && code !== 92/*\*/) + break; + } + if (j < len && j !== last) { + // Matched! + last = j; + // Match 1 or more non-path separators + for (; j < len; ++j) { + code = path.charCodeAt(j); + if (code === 47/*/*/ || code === 92/*\*/) + break; + } + if (j === len) { + // We matched a UNC root only + return path; + } + if (j !== last) { + // We matched a UNC root with leftovers + + // Offset by 1 to include the separator after the UNC root to + // treat it as a "normal root" on top of a (UNC) root + rootEnd = offset = j + 1; + } + } + } + } + } else if ((code >= 65/*A*/ && code <= 90/*Z*/) || + (code >= 97/*a*/ && code <= 122/*z*/)) { + // Possible device root + + code = path.charCodeAt(1); + if (path.charCodeAt(1) === 58/*:*/) { + rootEnd = offset = 2; + if (len > 2) { + code = path.charCodeAt(2); + if (code === 47/*/*/ || code === 92/*\*/) + rootEnd = offset = 3; + } + } + } + } else if (code === 47/*/*/ || code === 92/*\*/) { + return path[0]; + } + for (var i = len - 1; i >= offset; --i) { + code = path.charCodeAt(i); + if (code === 47/*/*/ || code === 92/*\*/) { + if (!matchedSlash) { + end = i; + break; + } + } else { + // We saw the first non-path separator + matchedSlash = false; + } + } -win32._makeLong = function(path) { - // Note: this will *probably* throw somewhere. - if (typeof path !== 'string') - return path; + if (end === -1) { + if (rootEnd === -1) + return '.'; + else + end = rootEnd; + } + return path.slice(0, end); + }, + + + basename: function basename(path, ext) { + if (ext !== undefined && typeof ext !== 'string') + throw new TypeError('ext must be a string'); + if (typeof path !== 'string') + path = '' + path; + var start = 0; + var end = -1; + var matchedSlash = true; + var i; + + // Check for a drive letter prefix so as not to mistake the following + // path separator as an extra separator at the end of the path that can be + // disregarded + if (path.length >= 2) { + const drive = path.charCodeAt(0); + if ((drive >= 65/*A*/ && drive <= 90/*Z*/) || + (drive >= 97/*a*/ && drive <= 122/*z*/)) { + if (path.charCodeAt(1) === 58/*:*/) + start = 2; + } + } - if (!path) { - return ''; - } + if (ext !== undefined && ext.length > 0 && ext.length <= path.length) { + if (ext.length === path.length && ext === path) + return ''; + var extIdx = ext.length - 1; + var firstNonSlashEnd = -1; + for (i = path.length - 1; i >= start; --i) { + const code = path.charCodeAt(i); + if (code === 47/*/*/ || code === 92/*\*/) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now + if (!matchedSlash) { + start = i + 1; + break; + } + } else { + if (firstNonSlashEnd === -1) { + // We saw the first non-path separator, remember this index in case + // we need it if the extension ends up not matching + matchedSlash = false; + firstNonSlashEnd = i + 1; + } + if (extIdx >= 0) { + // Try to match the explicit extension + if (code === ext.charCodeAt(extIdx)) { + if (--extIdx === -1) { + // We matched the extension, so mark this as the end of our path + // component + end = i; + } + } else { + // Extension does not match, so our result is the entire path + // component + extIdx = -1; + end = firstNonSlashEnd; + } + } + } + } - var resolvedPath = win32.resolve(path); + if (end === -1) + return ''; + return path.slice(start, end); + } else { + for (i = path.length - 1; i >= start; --i) { + const code = path.charCodeAt(i); + if (code === 47/*/*/ || code === 92/*\*/) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now + if (!matchedSlash) { + start = i + 1; + break; + } + } else if (end === -1) { + // We saw the first non-path separator, mark this as the end of our + // path component + matchedSlash = false; + end = i + 1; + } + } - if (/^[a-zA-Z]\:\\/.test(resolvedPath)) { - // path is local filesystem path, which needs to be converted - // to long UNC path. - return '\\\\?\\' + resolvedPath; - } else if (/^\\\\[^?.]/.test(resolvedPath)) { - // path is network UNC path, which needs to be converted - // to long UNC path. - return '\\\\?\\UNC\\' + resolvedPath.substring(2); - } + if (end === -1) + return ''; + return path.slice(start, end); + } + }, + + + extname: function extname(path) { + if (typeof path !== 'string') + path = '' + path; + var startDot = -1; + var startPart = 0; + var end = -1; + var matchedSlash = true; + // Track the state of characters (if any) we see before our first dot and + // after any path separator we find + var preDotState = 0; + for (var i = path.length - 1; i >= 0; --i) { + const code = path.charCodeAt(i); + if (code === 47/*/*/ || code === 92/*\*/) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now + if (!matchedSlash) { + startPart = i + 1; + break; + } + continue; + } + if (end === -1) { + // We saw the first non-path separator, mark this as the end of our + // extension + matchedSlash = false; + end = i + 1; + } + if (code === 46/*.*/) { + // If this is our first dot, mark it as the start of our extension + if (startDot === -1) + startDot = i; + else if (preDotState !== 1) + preDotState = 1; + } else if (startDot !== -1) { + // We saw a non-dot and non-path separator before our dot, so we should + // have a good chance at having a non-empty extension + preDotState = -1; + } + } - return path; -}; + if (startDot === -1 || + end === -1 || + // We saw a non-dot character immediately before the dot + preDotState === 0 || + // The (right-most) trimmed path component is exactly '..' + (preDotState === 1 && + startDot === end - 1 && + startDot === startPart + 1)) { + return ''; + } + return path.slice(startDot, end); + }, -win32.dirname = function(path) { - var result = win32SplitPath(path), - root = result[0], - dir = result[1]; + format: function format(pathObject) { + if (pathObject === null || typeof pathObject !== 'object') { + throw new TypeError( + `Parameter \'pathObject\' must be an object, not ${typeof pathObject}` + ); + } + return _format('\\', pathObject); + }, - if (!root && !dir) { - // No dirname whatsoever - return '.'; - } - if (dir) { - // It has a dirname, strip trailing slash - dir = dir.substr(0, dir.length - 1); - } + parse: function parse(path) { + assertPath(path); - return root + dir; -}; + var ret = { root: '', dir: '', base: '', ext: '', name: '' }; + if (path.length === 0) + return ret; + + var len = path.length; + var rootEnd = 0; + var code = path.charCodeAt(0); + var isAbsolute = false; + + // Try to match a root + if (len > 1) { + if (code === 47/*/*/ || code === 92/*\*/) { + // Possible UNC root + + isAbsolute = true; + + code = path.charCodeAt(1); + rootEnd = 1; + if (code === 47/*/*/ || code === 92/*\*/) { + // Matched double path separator at beginning + var j = 2; + var last = j; + // Match 1 or more non-path separators + for (; j < len; ++j) { + code = path.charCodeAt(j); + if (code === 47/*/*/ || code === 92/*\*/) + break; + } + if (j < len && j !== last) { + // Matched! + last = j; + // Match 1 or more path separators + for (; j < len; ++j) { + code = path.charCodeAt(j); + if (code !== 47/*/*/ && code !== 92/*\*/) + break; + } + if (j < len && j !== last) { + // Matched! + last = j; + // Match 1 or more non-path separators + for (; j < len; ++j) { + code = path.charCodeAt(j); + if (code === 47/*/*/ || code === 92/*\*/) + break; + } + if (j === len) { + // We matched a UNC root only + + rootEnd = j; + } else if (j !== last) { + // We matched a UNC root with leftovers + + rootEnd = j + 1; + } + } + } + } + } else if ((code >= 65/*A*/ && code <= 90/*Z*/) || + (code >= 97/*a*/ && code <= 122/*z*/)) { + // Possible device root + + code = path.charCodeAt(1); + if (path.charCodeAt(1) === 58/*:*/) { + rootEnd = 2; + if (len > 2) { + code = path.charCodeAt(2); + if (code === 47/*/*/ || code === 92/*\*/) { + if (len === 3) { + // `path` contains just a drive root, exit early to avoid + // unnecessary work + ret.root = ret.dir = path.slice(0, 3); + return ret; + } + isAbsolute = true; + rootEnd = 3; + } + } else { + // `path` contains just a drive root, exit early to avoid + // unnecessary work + ret.root = ret.dir = path.slice(0, 2); + return ret; + } + } + } + } else if (code === 47/*/*/ || code === 92/*\*/) { + // `path` contains just a path separator, exit early to avoid + // unnecessary work + ret.root = ret.dir = path[0]; + return ret; + } + if (rootEnd > 0) + ret.root = path.slice(0, rootEnd); + + var startDot = -1; + var startPart = 0; + var end = -1; + var matchedSlash = true; + var i = path.length - 1; + + // Track the state of characters (if any) we see before our first dot and + // after any path separator we find + var preDotState = 0; + + // Get non-dir info + for (; i >= rootEnd; --i) { + code = path.charCodeAt(i); + if (code === 47/*/*/ || code === 92/*\*/) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now + if (!matchedSlash) { + startPart = i + 1; + break; + } + continue; + } + if (end === -1) { + // We saw the first non-path separator, mark this as the end of our + // extension + matchedSlash = false; + end = i + 1; + } + if (code === 46/*.*/) { + // If this is our first dot, mark it as the start of our extension + if (startDot === -1) + startDot = i; + else if (preDotState !== 1) + preDotState = 1; + } else if (startDot !== -1) { + // We saw a non-dot and non-path separator before our dot, so we should + // have a good chance at having a non-empty extension + preDotState = -1; + } + } -win32.basename = function(path, ext) { - if (ext !== undefined && typeof ext !== 'string') - throw new TypeError('ext must be a string'); + if (startDot === -1 || + end === -1 || + // We saw a non-dot character immediately before the dot + preDotState === 0 || + // The (right-most) trimmed path component is exactly '..' + (preDotState === 1 && + startDot === end - 1 && + startDot === startPart + 1)) { + if (end !== -1) { + if (startPart === 0 && isAbsolute) + ret.base = ret.name = path.slice(rootEnd, end); + else + ret.base = ret.name = path.slice(startPart, end); + } + } else { + if (startPart === 0 && isAbsolute) { + ret.name = path.slice(rootEnd, startDot); + ret.base = path.slice(rootEnd, end); + } else { + ret.name = path.slice(startPart, startDot); + ret.base = path.slice(startPart, end); + } + ret.ext = path.slice(startDot, end); + } - var f = win32SplitPath(path)[2]; - // TODO: make this comparison case-insensitive on windows? - if (ext && f.substr(-1 * ext.length) === ext) { - f = f.substr(0, f.length - ext.length); - } - return f; -}; + if (startPart > 0) + ret.dir = path.slice(0, startPart - 1); + else if (isAbsolute) + ret.dir = path.slice(0, rootEnd); + return ret; + }, -win32.extname = function(path) { - return win32SplitPath(path)[3]; + sep: '\\', + delimiter: ';', + win32: null, + posix: null }; -win32.format = function(pathObject) { - if (pathObject === null || typeof pathObject !== 'object') { - throw new TypeError( - "Parameter 'pathObject' must be an object, not " + typeof pathObject - ); - } - - var root = pathObject.root || ''; +const posix = { + // path.resolve([from ...], to) + resolve: function resolve() { + var resolvedPath = ''; + var resolvedAbsolute = false; + var cwd; + + for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { + var path; + if (i >= 0) + path = arguments[i]; + else { + if (cwd === undefined) + cwd = process.cwd(); + path = cwd; + } - if (typeof root !== 'string') { - throw new TypeError( - "'pathObject.root' must be a string or undefined, not " + - typeof pathObject.root - ); - } + assertPath(path); - var dir = pathObject.dir; - var base = pathObject.base || ''; - if (!dir) { - return base; - } - if (dir[dir.length - 1] === win32.sep) { - return dir + base; - } - return dir + win32.sep + base; -}; + // Skip empty entries + if (path.length === 0) { + continue; + } + resolvedPath = path + '/' + resolvedPath; + resolvedAbsolute = path.charCodeAt(0) === 47/*/*/; + } -win32.parse = function(pathString) { - assertPath(pathString); + // At this point the path should be resolved to a full absolute path, but + // handle relative paths to be safe (might happen when process.cwd() fails) - var allParts = win32SplitPath(pathString); - return { - root: allParts[0], - dir: allParts[0] + allParts[1].slice(0, -1), - base: allParts[2], - ext: allParts[3], - name: allParts[2].slice(0, allParts[2].length - allParts[3].length) - }; -}; + // Normalize the path + resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute); + if (resolvedAbsolute) { + if (resolvedPath.length > 0) + return '/' + resolvedPath; + else + return '/'; + } else if (resolvedPath.length > 0) { + return resolvedPath; + } else { + return '.'; + } + }, -win32.sep = '\\'; -win32.delimiter = ';'; + normalize: function normalize(path) { + assertPath(path); -// Split a filename into [root, dir, basename, ext], unix version -// 'root' is just a slash, or nothing. -const splitPathRe = - /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; -var posix = {}; + if (path.length === 0) + return '.'; + const isAbsolute = path.charCodeAt(0) === 47/*/*/; + const trailingSeparator = path.charCodeAt(path.length - 1) === 47/*/*/; -function posixSplitPath(filename) { - const out = splitPathRe.exec(filename); - out.shift(); - return out; -} + // Normalize the path + path = normalizeStringPosix(path, !isAbsolute); + if (path.length === 0 && !isAbsolute) + path = '.'; + if (path.length > 0 && trailingSeparator) + path += '/'; -// path.resolve([from ...], to) -// posix version -posix.resolve = function() { - var resolvedPath = '', - resolvedAbsolute = false; + if (isAbsolute) + return '/' + path; + return path; + }, - for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { - var path = (i >= 0) ? arguments[i] : process.cwd(); + isAbsolute: function isAbsolute(path) { assertPath(path); - - // Skip empty entries - if (path === '') { - continue; + return path.length > 0 && path.charCodeAt(0) === 47/*/*/; + }, + + + join: function join() { + if (arguments.length === 0) + return '.'; + var joined; + for (var i = 0; i < arguments.length; ++i) { + var arg = arguments[i]; + assertPath(arg); + if (arg.length > 0) { + if (joined === undefined) + joined = arg; + else + joined += '/' + arg; + } } + if (joined === undefined) + return '.'; + return posix.normalize(joined); + }, - resolvedPath = path + '/' + resolvedPath; - resolvedAbsolute = path[0] === '/'; - } - - // At this point the path should be resolved to a full absolute path, but - // handle relative paths to be safe (might happen when process.cwd() fails) - - // Normalize the path - resolvedPath = normalizeArray(resolvedPath.split('/'), - !resolvedAbsolute).join('/'); - - return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; -}; - -// path.normalize(path) -// posix version -posix.normalize = function(path) { - assertPath(path); - var isAbsolute = posix.isAbsolute(path), - trailingSlash = path && path[path.length - 1] === '/'; + relative: function relative(from, to) { + assertPath(from); + assertPath(to); - // Normalize the path - path = normalizeArray(path.split('/'), !isAbsolute).join('/'); + if (from === to) + return ''; - if (!path && !isAbsolute) { - path = '.'; - } - if (path && trailingSlash) { - path += '/'; - } + from = posix.resolve(from); + to = posix.resolve(to); - return (isAbsolute ? '/' : '') + path; -}; + if (from === to) + return ''; -// posix version -posix.isAbsolute = function(path) { - assertPath(path); - return !!path && path[0] === '/'; -}; - -// posix version -posix.join = function() { - var path = ''; - for (var i = 0; i < arguments.length; i++) { - var segment = arguments[i]; - assertPath(segment); - if (segment) { - if (!path) { - path += segment; - } else { - path += '/' + segment; + // Trim any leading backslashes + var fromStart = 1; + for (; fromStart < from.length; ++fromStart) { + if (from.charCodeAt(fromStart) !== 47/*/*/) + break; + } + var fromEnd = from.length; + var fromLen = (fromEnd - fromStart); + + // Trim any leading backslashes + var toStart = 1; + for (; toStart < to.length; ++toStart) { + if (to.charCodeAt(toStart) !== 47/*/*/) + break; + } + var toEnd = to.length; + var toLen = (toEnd - toStart); + + // Compare paths to find the longest common path from root + var length = (fromLen < toLen ? fromLen : toLen); + var lastCommonSep = -1; + var i = 0; + for (; i <= length; ++i) { + if (i === length) { + if (toLen > length) { + if (to.charCodeAt(toStart + i) === 47/*/*/) { + // We get here if `from` is the exact base path for `to`. + // For example: from='/foo/bar'; to='/foo/bar/baz' + return to.slice(toStart + i + 1); + } else if (i === 0) { + // We get here if `from` is the root + // For example: from='/'; to='/foo' + return to.slice(toStart + i); + } + } else if (fromLen > length) { + if (from.charCodeAt(fromStart + i) === 47/*/*/) { + // We get here if `to` is the exact base path for `from`. + // For example: from='/foo/bar/baz'; to='/foo/bar' + lastCommonSep = i; + } else if (i === 0) { + // We get here if `to` is the root. + // For example: from='/foo'; to='/' + lastCommonSep = 0; + } + } + break; } + var fromCode = from.charCodeAt(fromStart + i); + var toCode = to.charCodeAt(toStart + i); + if (fromCode !== toCode) + break; + else if (fromCode === 47/*/*/) + lastCommonSep = i; } - } - return posix.normalize(path); -}; - - -// path.relative(from, to) -// posix version -posix.relative = function(from, to) { - assertPath(from); - assertPath(to); - - from = posix.resolve(from).substr(1); - to = posix.resolve(to).substr(1); - var fromParts = trimArray(from.split('/')); - var toParts = trimArray(to.split('/')); - - var length = Math.min(fromParts.length, toParts.length); - var samePartsLength = length; - for (var i = 0; i < length; i++) { - if (fromParts[i] !== toParts[i]) { - samePartsLength = i; - break; + var out = ''; + // Generate the relative path based on the path difference between `to` + // and `from` + for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) { + if (i === fromEnd || from.charCodeAt(i) === 47/*/*/) { + if (out.length === 0) + out += '..'; + else + out += '/..'; + } } - } - - var outputParts = []; - for (var i = samePartsLength; i < fromParts.length; i++) { - outputParts.push('..'); - } - - outputParts = outputParts.concat(toParts.slice(samePartsLength)); - - return outputParts.join('/'); -}; - - -posix._makeLong = function(path) { - return path; -}; - -posix.dirname = function(path) { - var result = posixSplitPath(path), - root = result[0], - dir = result[1]; - - if (!root && !dir) { - // No dirname whatsoever - return '.'; - } - - if (dir) { - // It has a dirname, strip trailing slash - dir = dir.substr(0, dir.length - 1); - } - - return root + dir; -}; + // Lastly, append the rest of the destination (`to`) path that comes after + // the common path parts + if (out.length > 0) + return out + to.slice(toStart + lastCommonSep); + else { + toStart += lastCommonSep; + if (to.charCodeAt(toStart) === 47/*/*/) + ++toStart; + return to.slice(toStart); + } + }, -posix.basename = function(path, ext) { - if (ext !== undefined && typeof ext !== 'string') - throw new TypeError('ext must be a string'); + _makeLong: function _makeLong(path) { + return path; + }, + + + dirname: function dirname(path) { + if (typeof path !== 'string') + path = '' + path; + if (path.length === 0) + return '.'; + var code = path.charCodeAt(0); + var hasRoot = (code === 47/*/*/); + var end = -1; + var matchedSlash = true; + for (var i = path.length - 1; i >= 1; --i) { + code = path.charCodeAt(i); + if (code === 47/*/*/) { + if (!matchedSlash) { + end = i; + break; + } + } else { + // We saw the first non-path separator + matchedSlash = false; + } + } - var f = posixSplitPath(path)[2]; + if (end === -1) + return hasRoot ? '/' : '.'; + if (hasRoot && end === 1) + return '//'; + return path.slice(0, end); + }, + + + basename: function basename(path, ext) { + if (ext !== undefined && typeof ext !== 'string') + throw new TypeError('ext must be a string'); + if (typeof path !== 'string') + path = '' + path; + + var start = 0; + var end = -1; + var matchedSlash = true; + var i; + + if (ext !== undefined && ext.length > 0 && ext.length <= path.length) { + if (ext.length === path.length && ext === path) + return ''; + var extIdx = ext.length - 1; + var firstNonSlashEnd = -1; + for (i = path.length - 1; i >= 0; --i) { + const code = path.charCodeAt(i); + if (code === 47/*/*/) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now + if (!matchedSlash) { + start = i + 1; + break; + } + } else { + if (firstNonSlashEnd === -1) { + // We saw the first non-path separator, remember this index in case + // we need it if the extension ends up not matching + matchedSlash = false; + firstNonSlashEnd = i + 1; + } + if (extIdx >= 0) { + // Try to match the explicit extension + if (code === ext.charCodeAt(extIdx)) { + if (--extIdx === -1) { + // We matched the extension, so mark this as the end of our path + // component + end = i; + } + } else { + // Extension does not match, so our result is the entire path + // component + extIdx = -1; + end = firstNonSlashEnd; + } + } + } + } - if (ext && f.substr(-1 * ext.length) === ext) { - f = f.substr(0, f.length - ext.length); - } - return f; -}; + if (end === -1) + return ''; + return path.slice(start, end); + } else { + for (i = path.length - 1; i >= 0; --i) { + if (path.charCodeAt(i) === 47/*/*/) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now + if (!matchedSlash) { + start = i + 1; + break; + } + } else if (end === -1) { + // We saw the first non-path separator, mark this as the end of our + // path component + matchedSlash = false; + end = i + 1; + } + } + if (end === -1) + return ''; + return path.slice(start, end); + } + }, + + + extname: function extname(path) { + if (typeof path !== 'string') + path = '' + path; + var startDot = -1; + var startPart = 0; + var end = -1; + var matchedSlash = true; + // Track the state of characters (if any) we see before our first dot and + // after any path separator we find + var preDotState = 0; + for (var i = path.length - 1; i >= 0; --i) { + const code = path.charCodeAt(i); + if (code === 47/*/*/) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now + if (!matchedSlash) { + startPart = i + 1; + break; + } + continue; + } + if (end === -1) { + // We saw the first non-path separator, mark this as the end of our + // extension + matchedSlash = false; + end = i + 1; + } + if (code === 46/*.*/) { + // If this is our first dot, mark it as the start of our extension + if (startDot === -1) + startDot = i; + else if (preDotState !== 1) + preDotState = 1; + } else if (startDot !== -1) { + // We saw a non-dot and non-path separator before our dot, so we should + // have a good chance at having a non-empty extension + preDotState = -1; + } + } -posix.extname = function(path) { - return posixSplitPath(path)[3]; -}; + if (startDot === -1 || + end === -1 || + // We saw a non-dot character immediately before the dot + preDotState === 0 || + // The (right-most) trimmed path component is exactly '..' + (preDotState === 1 && + startDot === end - 1 && + startDot === startPart + 1)) { + return ''; + } + return path.slice(startDot, end); + }, + + format: function format(pathObject) { + if (pathObject === null || typeof pathObject !== 'object') { + throw new TypeError( + `Parameter \'pathObject\' must be an object, not ${typeof pathObject}` + ); + } + return _format('/', pathObject); + }, -posix.format = function(pathObject) { - if (pathObject === null || typeof pathObject !== 'object') { - throw new TypeError( - "Parameter 'pathObject' must be an object, not " + typeof pathObject - ); - } + parse: function parse(path) { + assertPath(path); - var root = pathObject.root || ''; + var ret = { root: '', dir: '', base: '', ext: '', name: '' }; + if (path.length === 0) + return ret; + var code = path.charCodeAt(0); + var isAbsolute = (code === 47/*/*/); + var start; + if (isAbsolute) { + ret.root = '/'; + start = 1; + } else { + start = 0; + } + var startDot = -1; + var startPart = 0; + var end = -1; + var matchedSlash = true; + var i = path.length - 1; + + // Track the state of characters (if any) we see before our first dot and + // after any path separator we find + var preDotState = 0; + + // Get non-dir info + for (; i >= start; --i) { + code = path.charCodeAt(i); + if (code === 47/*/*/) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now + if (!matchedSlash) { + startPart = i + 1; + break; + } + continue; + } + if (end === -1) { + // We saw the first non-path separator, mark this as the end of our + // extension + matchedSlash = false; + end = i + 1; + } + if (code === 46/*.*/) { + // If this is our first dot, mark it as the start of our extension + if (startDot === -1) + startDot = i; + else if (preDotState !== 1) + preDotState = 1; + } else if (startDot !== -1) { + // We saw a non-dot and non-path separator before our dot, so we should + // have a good chance at having a non-empty extension + preDotState = -1; + } + } - if (typeof root !== 'string') { - throw new TypeError( - "'pathObject.root' must be a string or undefined, not " + - typeof pathObject.root - ); - } + if (startDot === -1 || + end === -1 || + // We saw a non-dot character immediately before the dot + preDotState === 0 || + // The (right-most) trimmed path component is exactly '..' + (preDotState === 1 && + startDot === end - 1 && + startDot === startPart + 1)) { + if (end !== -1) { + if (startPart === 0 && isAbsolute) + ret.base = ret.name = path.slice(1, end); + else + ret.base = ret.name = path.slice(startPart, end); + } + } else { + if (startPart === 0 && isAbsolute) { + ret.name = path.slice(1, startDot); + ret.base = path.slice(1, end); + } else { + ret.name = path.slice(startPart, startDot); + ret.base = path.slice(startPart, end); + } + ret.ext = path.slice(startDot, end); + } - var dir = pathObject.dir ? pathObject.dir + posix.sep : ''; - var base = pathObject.base || ''; - return dir + base; -}; + if (startPart > 0) + ret.dir = path.slice(0, startPart - 1); + else if (isAbsolute) + ret.dir = '/'; + return ret; + }, -posix.parse = function(pathString) { - assertPath(pathString); - var allParts = posixSplitPath(pathString); - return { - root: allParts[0], - dir: allParts[0] + allParts[1].slice(0, -1), - base: allParts[2], - ext: allParts[3], - name: allParts[2].slice(0, allParts[2].length - allParts[3].length) - }; + sep: '/', + delimiter: ':', + win32: null, + posix: null }; -posix.sep = '/'; -posix.delimiter = ':'; +posix.win32 = win32.win32 = win32; +posix.posix = win32.posix = posix; -if (isWindows) +if (process.platform === 'win32') module.exports = win32; -else /* posix */ +else module.exports = posix; - -module.exports.posix = posix; -module.exports.win32 = win32; diff --git a/lib/querystring.js b/lib/querystring.js index 8735d2814bc307..b88e685b677c70 100644 --- a/lib/querystring.js +++ b/lib/querystring.js @@ -6,29 +6,25 @@ const QueryString = exports; const Buffer = require('buffer').Buffer; -function charCode(c) { - return c.charCodeAt(0); -} - - // a safe fast alternative to decodeURIComponent QueryString.unescapeBuffer = function(s, decodeSpaces) { var out = new Buffer(s.length); - var state = 'CHAR'; // states: CHAR, HEX0, HEX1 + var state = 0; var n, m, hexchar; for (var inIndex = 0, outIndex = 0; inIndex <= s.length; inIndex++) { - var c = s.charCodeAt(inIndex); + var c = inIndex < s.length ? s.charCodeAt(inIndex) : NaN; switch (state) { - case 'CHAR': + case 0: // Any character switch (c) { - case charCode('%'): + case 37: // '%' n = 0; m = 0; - state = 'HEX0'; + state = 1; break; - case charCode('+'): - if (decodeSpaces) c = charCode(' '); + case 43: // '+' + if (decodeSpaces) + c = 32; // ' ' // falls through default: out[outIndex++] = c; @@ -36,33 +32,33 @@ QueryString.unescapeBuffer = function(s, decodeSpaces) { } break; - case 'HEX0': - state = 'HEX1'; + case 1: // First hex digit hexchar = c; - if (charCode('0') <= c && c <= charCode('9')) { - n = c - charCode('0'); - } else if (charCode('a') <= c && c <= charCode('f')) { - n = c - charCode('a') + 10; - } else if (charCode('A') <= c && c <= charCode('F')) { - n = c - charCode('A') + 10; + if (c >= 48/*0*/ && c <= 57/*9*/) { + n = c - 48/*0*/; + } else if (c >= 65/*A*/ && c <= 70/*F*/) { + n = c - 65/*A*/ + 10; + } else if (c >= 97/*a*/ && c <= 102/*f*/) { + n = c - 97/*a*/ + 10; } else { - out[outIndex++] = charCode('%'); + out[outIndex++] = 37/*%*/; out[outIndex++] = c; - state = 'CHAR'; + state = 0; break; } + state = 2; break; - case 'HEX1': - state = 'CHAR'; - if (charCode('0') <= c && c <= charCode('9')) { - m = c - charCode('0'); - } else if (charCode('a') <= c && c <= charCode('f')) { - m = c - charCode('a') + 10; - } else if (charCode('A') <= c && c <= charCode('F')) { - m = c - charCode('A') + 10; + case 2: // Second hex digit + state = 0; + if (c >= 48/*0*/ && c <= 57/*9*/) { + m = c - 48/*0*/; + } else if (c >= 65/*A*/ && c <= 70/*F*/) { + m = c - 65/*A*/ + 10; + } else if (c >= 97/*a*/ && c <= 102/*f*/) { + m = c - 97/*a*/ + 10; } else { - out[outIndex++] = charCode('%'); + out[outIndex++] = 37/*%*/; out[outIndex++] = hexchar; out[outIndex++] = c; break; @@ -78,13 +74,14 @@ QueryString.unescapeBuffer = function(s, decodeSpaces) { }; -QueryString.unescape = function(s, decodeSpaces) { +function qsUnescape(s, decodeSpaces) { try { return decodeURIComponent(s); } catch (e) { return QueryString.unescapeBuffer(s, decodeSpaces).toString(); } -}; +} +QueryString.unescape = qsUnescape; var hexTable = new Array(256); @@ -93,16 +90,13 @@ for (var i = 0; i < 256; ++i) QueryString.escape = function(str) { // replaces encodeURIComponent // http://www.ecma-international.org/ecma-262/5.1/#sec-15.1.3.4 - str = '' + str; - var len = str.length; + if (typeof str !== 'string') + str += ''; var out = ''; - var i, c; - - if (len === 0) - return str; + var lastPos = 0; - for (i = 0; i < len; ++i) { - c = str.charCodeAt(i); + for (var i = 0; i < str.length; ++i) { + var c = str.charCodeAt(i); // These characters do not need escaping (in order): // ! - . _ ~ @@ -115,22 +109,27 @@ QueryString.escape = function(str) { (c >= 0x30 && c <= 0x39) || (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A)) { - out += str[i]; continue; } + if (i - lastPos > 0) + out += str.slice(lastPos, i); + // Other ASCII characters if (c < 0x80) { + lastPos = i + 1; out += hexTable[c]; continue; } // Multi-byte characters ... if (c < 0x800) { + lastPos = i + 1; out += hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]; continue; } if (c < 0xD800 || c >= 0xE000) { + lastPos = i + 1; out += hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]; @@ -138,12 +137,22 @@ QueryString.escape = function(str) { } // Surrogate pair ++i; - c = 0x10000 + (((c & 0x3FF) << 10) | (str.charCodeAt(i) & 0x3FF)); + var c2; + if (i < str.length) + c2 = str.charCodeAt(i) & 0x3FF; + else + throw new URIError('URI malformed'); + lastPos = i + 1; + c = 0x10000 + (((c & 0x3FF) << 10) | c2); out += hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]; } + if (lastPos === 0) + return str; + if (lastPos < str.length) + return out + str.slice(lastPos); return out; }; @@ -198,56 +207,183 @@ QueryString.stringify = QueryString.encode = function(obj, sep, eq, options) { return ''; }; -// Parse a key=val string. +// Parse a key/val string. QueryString.parse = QueryString.decode = function(qs, sep, eq, options) { sep = sep || '&'; eq = eq || '='; - var obj = {}; + + const obj = {}; if (typeof qs !== 'string' || qs.length === 0) { return obj; } - var regexp = /\+/g; - qs = qs.split(sep); + if (typeof sep !== 'string') + sep += ''; + + const eqLen = eq.length; + const sepLen = sep.length; var maxKeys = 1000; if (options && typeof options.maxKeys === 'number') { maxKeys = options.maxKeys; } - var len = qs.length; - // maxKeys <= 0 means that we should not limit keys count - if (maxKeys > 0 && len > maxKeys) { - len = maxKeys; - } + var pairs = Infinity; + if (maxKeys > 0) + pairs = maxKeys; var decode = QueryString.unescape; if (options && typeof options.decodeURIComponent === 'function') { decode = options.decodeURIComponent; } + const customDecode = (decode !== qsUnescape); + + const keys = []; + var lastPos = 0; + var sepIdx = 0; + var eqIdx = 0; + var key = ''; + var value = ''; + var keyEncoded = customDecode; + var valEncoded = customDecode; + var encodeCheck = 0; + for (var i = 0; i < qs.length; ++i) { + const code = qs.charCodeAt(i); + + // Try matching key/value pair separator (e.g. '&') + if (code === sep.charCodeAt(sepIdx)) { + if (++sepIdx === sepLen) { + // Key/value pair separator match! + const end = i - sepIdx + 1; + if (eqIdx < eqLen) { + // If we didn't find the key/value separator, treat the substring as + // part of the key instead of the value + if (lastPos < end) + key += qs.slice(lastPos, end); + } else if (lastPos < end) + value += qs.slice(lastPos, end); + if (keyEncoded) + key = decodeStr(key, decode); + if (valEncoded) + value = decodeStr(value, decode); + // Use a key array lookup instead of using hasOwnProperty(), which is + // slower + if (keys.indexOf(key) === -1) { + obj[key] = value; + keys[keys.length] = key; + } else { + const curValue = obj[key]; + // `instanceof Array` is used instead of Array.isArray() because it + // is ~15-20% faster with v8 4.7 and is safe to use because we are + // using it with values being created within this function + if (curValue instanceof Array) + curValue[curValue.length] = value; + else + obj[key] = [curValue, value]; + } + if (--pairs === 0) + break; + keyEncoded = valEncoded = customDecode; + encodeCheck = 0; + key = value = ''; + lastPos = i + 1; + sepIdx = eqIdx = 0; + } + continue; + } else { + sepIdx = 0; + if (!valEncoded) { + // Try to match an (valid) encoded byte (once) to minimize unnecessary + // calls to string decoding functions + if (code === 37/*%*/) { + encodeCheck = 1; + } else if (encodeCheck > 0 && + ((code >= 48/*0*/ && code <= 57/*9*/) || + (code >= 65/*A*/ && code <= 70/*Z*/) || + (code >= 97/*a*/ && code <= 102/*z*/))) { + if (++encodeCheck === 3) + valEncoded = true; + } else { + encodeCheck = 0; + } + } + } - var keys = []; - for (var i = 0; i < len; ++i) { - var x = qs[i].replace(regexp, '%20'), - idx = x.indexOf(eq), - k, v; + // Try matching key/value separator (e.g. '=') if we haven't already + if (eqIdx < eqLen) { + if (code === eq.charCodeAt(eqIdx)) { + if (++eqIdx === eqLen) { + // Key/value separator match! + const end = i - eqIdx + 1; + if (lastPos < end) + key += qs.slice(lastPos, end); + encodeCheck = 0; + lastPos = i + 1; + } + continue; + } else { + eqIdx = 0; + if (!keyEncoded) { + // Try to match an (valid) encoded byte once to minimize unnecessary + // calls to string decoding functions + if (code === 37/*%*/) { + encodeCheck = 1; + } else if (encodeCheck > 0 && + ((code >= 48/*0*/ && code <= 57/*9*/) || + (code >= 65/*A*/ && code <= 70/*Z*/) || + (code >= 97/*a*/ && code <= 102/*z*/))) { + if (++encodeCheck === 3) + keyEncoded = true; + } else { + encodeCheck = 0; + } + } + } + } - if (idx >= 0) { - k = decodeStr(x.substring(0, idx), decode); - v = decodeStr(x.substring(idx + 1), decode); - } else { - k = decodeStr(x, decode); - v = ''; + if (code === 43/*+*/) { + if (eqIdx < eqLen) { + if (i - lastPos > 0) + key += qs.slice(lastPos, i); + key += '%20'; + keyEncoded = true; + } else { + if (i - lastPos > 0) + value += qs.slice(lastPos, i); + value += '%20'; + valEncoded = true; + } + lastPos = i + 1; } + } - if (keys.indexOf(k) === -1) { - obj[k] = v; - keys.push(k); - } else if (Array.isArray(obj[k])) { - obj[k].push(v); + // Check if we have leftover key or value data + if (pairs > 0 && (lastPos < qs.length || eqIdx > 0)) { + if (lastPos < qs.length) { + if (eqIdx < eqLen) + key += qs.slice(lastPos); + else if (sepIdx < sepLen) + value += qs.slice(lastPos); + } + if (keyEncoded) + key = decodeStr(key, decode); + if (valEncoded) + value = decodeStr(value, decode); + // Use a key array lookup instead of using hasOwnProperty(), which is + // slower + if (keys.indexOf(key) === -1) { + obj[key] = value; + keys[keys.length] = key; } else { - obj[k] = [obj[k], v]; + const curValue = obj[key]; + // `instanceof Array` is used instead of Array.isArray() because it + // is ~15-20% faster with v8 4.7 and is safe to use because we are + // using it with values being created within this function + if (curValue instanceof Array) + curValue[curValue.length] = value; + else + obj[key] = [curValue, value]; } } @@ -255,6 +391,8 @@ QueryString.parse = QueryString.decode = function(qs, sep, eq, options) { }; +// v8 does not optimize functions with try-catch blocks, so we isolate them here +// to minimize the damage function decodeStr(s, decoder) { try { return decoder(s); diff --git a/lib/readline.js b/lib/readline.js index 0f9aabb2fec475..74656896314531 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -9,6 +9,7 @@ const kHistorySize = 30; const util = require('util'); +const debug = util.debuglog('readline'); const internalUtil = require('internal/util'); const inherits = util.inherits; const Buffer = require('buffer').Buffer; @@ -329,7 +330,7 @@ Interface.prototype._normalWrite = function(b) { this._line_buffer = null; } if (newPartContainsEnding) { - this._sawReturn = /\r$/.test(string); + this._sawReturn = string.endsWith('\r'); // got one or more newlines; process into "line" events var lines = string.split(lineEnding); @@ -375,12 +376,12 @@ Interface.prototype._tabComplete = function() { self.resume(); if (err) { - // XXX Log it somewhere? + debug('tab completion error %j', err); return; } - var completions = rv[0], - completeOn = rv[1]; // the text that was completed + const completions = rv[0]; + const completeOn = rv[1]; // the text that was completed if (completions && completions.length) { // Apply/show completions. if (completions.length === 1) { diff --git a/lib/repl.js b/lib/repl.js index 81afd27a4dbd00..baa41a85a7d248 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -21,17 +21,23 @@ 'use strict'; +const internalModule = require('internal/module'); +const internalUtil = require('internal/util'); const util = require('util'); const inherits = util.inherits; const Stream = require('stream'); const vm = require('vm'); const path = require('path'); const fs = require('fs'); -const rl = require('readline'); +const Interface = require('readline').Interface; const Console = require('console').Console; +const Module = require('module'); const domain = require('domain'); const debug = util.debuglog('repl'); +const parentModule = module; +const replMap = new WeakMap(); + try { // hack for require.resolve("./relative") to work properly. module.filename = path.resolve('repl'); @@ -58,14 +64,103 @@ function hasOwnProperty(obj, prop) { // This is the default "writer" value if none is passed in the REPL options. exports.writer = util.inspect; -exports._builtinLibs = ['assert', 'buffer', 'child_process', 'cluster', - 'crypto', 'dgram', 'dns', 'domain', 'events', 'fs', 'http', 'https', 'net', - 'os', 'path', 'punycode', 'querystring', 'readline', 'stream', - 'string_decoder', 'tls', 'tty', 'url', 'util', 'v8', 'vm', 'zlib']; +exports._builtinLibs = internalModule.builtinLibs; + + +const BLOCK_SCOPED_ERROR = 'Block-scoped declarations (let, const, function, ' + + 'class) not yet supported outside strict mode'; + + +class LineParser { + + constructor() { + this.reset(); + } + + reset() { + this._literal = null; + this.shouldFail = false; + this.blockComment = false; + this.regExpLiteral = false; + } + + parseLine(line) { + var previous = null; + this.shouldFail = false; + const wasWithinStrLiteral = this._literal !== null; + for (const current of line) { + if (previous === '\\') { + // valid escaping, skip processing. previous doesn't matter anymore + previous = null; + continue; + } -const BLOCK_SCOPED_ERROR = 'Block-scoped declarations (let, ' + - 'const, function, class) not yet supported outside strict mode'; + if (!this._literal) { + if (this.regExpLiteral && current === '/') { + this.regExpLiteral = false; + previous = null; + continue; + } + if (previous === '*' && current === '/') { + if (this.blockComment) { + this.blockComment = false; + previous = null; + continue; + } else { + this.shouldFail = true; + break; + } + } + + // ignore rest of the line if `current` and `previous` are `/`s + if (previous === current && previous === '/' && !this.blockComment) { + break; + } + + if (previous === '/') { + if (current === '*') { + this.blockComment = true; + } else { + this.regExpLiteral = true; + } + previous = null; + } + } + + if (this.blockComment || this.regExpLiteral) continue; + + if (current === this._literal) { + this._literal = null; + } else if (current === '\'' || current === '"') { + this._literal = this._literal || current; + } + + previous = current; + } + + const isWithinStrLiteral = this._literal !== null; + + if (!wasWithinStrLiteral && !isWithinStrLiteral) { + // Current line has nothing to do with String literals, trim both ends + line = line.trim(); + } else if (wasWithinStrLiteral && !isWithinStrLiteral) { + // was part of a string literal, but it is over now, trim only the end + line = line.trimRight(); + } else if (isWithinStrLiteral && !wasWithinStrLiteral) { + // was not part of a string literal, but it is now, trim only the start + line = line.trimLeft(); + } + + const lastChar = line.charAt(line.length - 1); + + this.shouldFail = this.shouldFail || + ((!this._literal && lastChar === '\\') || + (this._literal && lastChar !== '\\')); + + return line; + } +} function REPLServer(prompt, @@ -96,8 +191,6 @@ function REPLServer(prompt, prompt = options.prompt; dom = options.domain; replMode = options.replMode; - } else if (typeof prompt !== 'string') { - throw new Error('An options Object, or a prompt String are required'); } else { options = {}; } @@ -124,15 +217,19 @@ function REPLServer(prompt, eval_ = eval_ || defaultEval; function defaultEval(code, context, file, cb) { - var err, result, retry = false; + var err, result, retry = false, input = code, wrappedErr; // first, create the Script object to check the syntax + + if (code === '\n') + return cb(null); + while (true) { try { if (!/^\s*$/.test(code) && (self.replMode === exports.REPL_MODE_STRICT || retry)) { // "void 0" keeps the repl from returning "use strict" as the // result value for let/const statements. - code = `'use strict'; void 0; ${code}`; + code = `'use strict'; void 0;\n${code}`; } var script = vm.createScript(code, { filename: file, @@ -142,14 +239,23 @@ function REPLServer(prompt, debug('parse error %j', code, e); if (self.replMode === exports.REPL_MODE_MAGIC && e.message === BLOCK_SCOPED_ERROR && - !retry) { - retry = true; + !retry || self.wrappedCmd) { + if (self.wrappedCmd) { + self.wrappedCmd = false; + // unwrap and try again + code = `${input.substring(1, input.length - 2)}\n`; + wrappedErr = e; + } else { + retry = true; + } continue; } - if (isRecoverableError(e, self)) - err = new Recoverable(e); + // preserve original error for wrapped command + const error = wrappedErr || e; + if (isRecoverableError(error, self)) + err = new Recoverable(error); else - err = e; + err = error; } break; } @@ -189,11 +295,17 @@ function REPLServer(prompt, self._domain.on('error', function(e) { debug('domain error'); - self.outputStream.write((e.stack || e) + '\n'); - self._currentStringLiteral = null; - self.bufferedCommand = ''; - self.lines.level = []; - self.displayPrompt(); + const top = replMap.get(self); + internalUtil.decorateErrorStack(e); + if (e.stack && self.replMode === exports.REPL_MODE_STRICT) { + e.stack = e.stack.replace(/(\s+at\s+repl:)(\d+)/, + (_, pre, line) => pre + (line - 1)); + } + top.outputStream.write((e.stack || e) + '\n'); + top.lineParser.reset(); + top.bufferedCommand = ''; + top.lines.level = []; + top.displayPrompt(); }); if (!input && !output) { @@ -217,8 +329,7 @@ function REPLServer(prompt, self.outputStream = output; self.resetContext(); - // Initialize the current string literal found, to be null - self._currentStringLiteral = null; + self.lineParser = new LineParser(); self.bufferedCommand = ''; self.lines.level = []; @@ -226,7 +337,7 @@ function REPLServer(prompt, self.complete(text, callback); } - rl.Interface.call(this, { + Interface.call(this, { input: self.inputStream, output: self.outputStream, completer: complete, @@ -271,93 +382,27 @@ function REPLServer(prompt, sawSIGINT = false; return; } - self.output.write('(^C again to quit)\n'); + self.output.write('(To exit, press ^C again or type .exit)\n'); sawSIGINT = true; } else { sawSIGINT = false; } - self._currentStringLiteral = null; + self.lineParser.reset(); self.bufferedCommand = ''; self.lines.level = []; self.displayPrompt(); }); - function parseLine(line, currentStringLiteral) { - var previous = null, current = null; - - for (var i = 0; i < line.length; i += 1) { - if (previous === '\\') { - // if it is a valid escaping, then skip processing and the previous - // character doesn't matter anymore. - previous = null; - continue; - } - - current = line.charAt(i); - if (current === currentStringLiteral) { - currentStringLiteral = null; - } else if (current === '\'' || - current === '"' && - currentStringLiteral === null) { - currentStringLiteral = current; - } - previous = current; - } - - return currentStringLiteral; - } - - function getFinisherFunction(cmd, defaultFn) { - if ((self._currentStringLiteral === null && - cmd.charAt(cmd.length - 1) === '\\') || - (self._currentStringLiteral !== null && - cmd.charAt(cmd.length - 1) !== '\\')) { - - // If the line continuation is used outside string literal or if the - // string continuation happens with out line continuation, then fail hard. - // Even if the error is recoverable, get the underlying error and use it. - return function(e, ret) { - var error = e instanceof Recoverable ? e.err : e; - - if (arguments.length === 2) { - // using second argument only if it is actually passed. Otherwise - // `undefined` will be printed when invalid REPL commands are used. - return defaultFn(error, ret); - } - - return defaultFn(error); - }; - } - return defaultFn; - } - self.on('line', function(cmd) { debug('line %j', cmd); sawSIGINT = false; - var skipCatchall = false; - var finisherFn = finish; // leading whitespaces in template literals should not be trimmed. if (self._inTemplateLiteral) { self._inTemplateLiteral = false; } else { - const wasWithinStrLiteral = self._currentStringLiteral !== null; - self._currentStringLiteral = parseLine(cmd, self._currentStringLiteral); - const isWithinStrLiteral = self._currentStringLiteral !== null; - - if (!wasWithinStrLiteral && !isWithinStrLiteral) { - // Current line has nothing to do with String literals, trim both ends - cmd = cmd.trim(); - } else if (wasWithinStrLiteral && !isWithinStrLiteral) { - // was part of a string literal, but it is over now, trim only the end - cmd = cmd.trimRight(); - } else if (isWithinStrLiteral && !wasWithinStrLiteral) { - // was not part of a string literal, but it is now, trim only the start - cmd = cmd.trimLeft(); - } - - finisherFn = getFinisherFunction(cmd, finish); + cmd = self.lineParser.parseLine(cmd); } // Check to see if a REPL keyword was used. If it returns true, @@ -368,42 +413,41 @@ function REPLServer(prompt, var rest = matches && matches[2]; if (self.parseREPLKeyword(keyword, rest) === true) { return; - } else { + } else if (!self.bufferedCommand) { self.outputStream.write('Invalid REPL keyword\n'); - skipCatchall = true; + finish(null); + return; } } - if (!skipCatchall && (cmd || (!cmd && self.bufferedCommand))) { - var evalCmd = self.bufferedCommand + cmd; - if (/^\s*\{/.test(evalCmd) && /\}\s*$/.test(evalCmd)) { - // It's confusing for `{ a : 1 }` to be interpreted as a block - // statement rather than an object literal. So, we first try - // to wrap it in parentheses, so that it will be interpreted as - // an expression. - evalCmd = '(' + evalCmd + ')\n'; - } else { - // otherwise we just append a \n so that it will be either - // terminated, or continued onto the next expression if it's an - // unexpected end of input. - evalCmd = evalCmd + '\n'; - } - - debug('eval %j', evalCmd); - self.eval(evalCmd, self.context, 'repl', finisherFn); + var evalCmd = self.bufferedCommand + cmd; + if (/^\s*\{/.test(evalCmd) && /\}\s*$/.test(evalCmd)) { + // It's confusing for `{ a : 1 }` to be interpreted as a block + // statement rather than an object literal. So, we first try + // to wrap it in parentheses, so that it will be interpreted as + // an expression. + evalCmd = '(' + evalCmd + ')\n'; + self.wrappedCmd = true; } else { - finisherFn(null); + // otherwise we just append a \n so that it will be either + // terminated, or continued onto the next expression if it's an + // unexpected end of input. + evalCmd = evalCmd + '\n'; } + debug('eval %j', evalCmd); + self.eval(evalCmd, self.context, 'repl', finish); + function finish(e, ret) { debug('finish', e, ret); self.memory(cmd); - if (e && !self.bufferedCommand && cmd.trim().match(/^npm /)) { + self.wrappedCmd = false; + if (e && !self.bufferedCommand && cmd.trim().startsWith('npm ')) { self.outputStream.write('npm should be run outside of the ' + 'node repl, in your normal shell.\n' + '(Press Control-D to exit.)\n'); - self._currentStringLiteral = null; + self.lineParser.reset(); self.bufferedCommand = ''; self.displayPrompt(); return; @@ -411,7 +455,7 @@ function REPLServer(prompt, // If error was SyntaxError and not JSON.parse error if (e) { - if (e instanceof Recoverable) { + if (e instanceof Recoverable && !self.lineParser.shouldFail) { // Start buffering data like that: // { // ... x: 1 @@ -420,12 +464,12 @@ function REPLServer(prompt, self.displayPrompt(); return; } else { - self._domain.emit('error', e); + self._domain.emit('error', e.err || e); } } // Clear buffer if no SyntaxErrors - self._currentStringLiteral = null; + self.lineParser.reset(); self.bufferedCommand = ''; // If we got any output - print it (if no error) @@ -450,7 +494,7 @@ function REPLServer(prompt, self.displayPrompt(); } -inherits(REPLServer, rl.Interface); +inherits(REPLServer, Interface); exports.REPLServer = REPLServer; exports.REPL_MODE_SLOPPY = Symbol('repl-sloppy'); @@ -472,9 +516,24 @@ exports.start = function(prompt, ignoreUndefined, replMode); if (!exports.repl) exports.repl = repl; + replMap.set(repl, repl); return repl; }; +REPLServer.prototype.close = function replClose() { + if (this.terminal && this._flushing && !this._closingOnFlush) { + this._closingOnFlush = true; + this.once('flushHistory', () => + Interface.prototype.close.call(this) + ); + + return; + } + process.nextTick(() => + Interface.prototype.close.call(this) + ); +}; + REPLServer.prototype.createContext = function() { var context; if (this.useGlobal) { @@ -487,29 +546,17 @@ REPLServer.prototype.createContext = function() { context.global.global = context; } + const module = new Module(''); + module.paths = Module._resolveLookupPaths('', parentModule)[1]; + + const require = internalModule.makeRequireFunction.call(module); context.module = module; context.require = require; this.lines = []; this.lines.level = []; - // make built-in modules available directly - // (loaded lazily) - exports._builtinLibs.forEach(function(name) { - Object.defineProperty(context, name, { - get: function() { - var lib = require(name); - context._ = context[name] = lib; - return lib; - }, - // allow the creation of other globals with this name - set: function(val) { - delete context[name]; - context[name] = val; - }, - configurable: true - }); - }); + internalModule.addBuiltinLibsToObject(context); return context; }; @@ -525,7 +572,8 @@ REPLServer.prototype.displayPrompt = function(preserveCursor) { var prompt = this._initialPrompt; if (this.bufferedCommand.length) { prompt = '...'; - var levelInd = new Array(this.lines.level.length).join('..'); + const len = this.lines.level.length ? this.lines.level.length - 1 : 0; + const levelInd = '..'.repeat(len); prompt += levelInd + ' '; } @@ -560,7 +608,7 @@ ArrayStream.prototype.write = function() {}; const requireRE = /\brequire\s*\(['"](([\w\.\/-]+\/)?([\w\.\/-]*))/; const simpleExpressionRE = - /(([a-zA-Z_$](?:\w|\$)*)\.)*([a-zA-Z_$](?:\w|\$)*)\.?$/; + /^\s*(([a-zA-Z_$](?:\w|\$)*)\.)*([a-zA-Z_$](?:\w|\$)*)\.?$/; function intFilter(item) { // filters out anything not starting with A-Z, a-z, $ or _ @@ -601,6 +649,7 @@ REPLServer.prototype.complete = function(line, callback) { // all this is only profitable if the nested REPL // does not have a bufferedCommand if (!magic.bufferedCommand) { + replMap.set(magic, replMap.get(this)); return magic.complete(line, callback); } } @@ -610,7 +659,7 @@ REPLServer.prototype.complete = function(line, callback) { // list of completion lists, one for each inheritance "level" var completionGroups = []; - var completeOn, match, filter, i, group, c; + var completeOn, i, group, c; // REPL commands (e.g. ".break"). var match = null; @@ -625,7 +674,7 @@ REPLServer.prototype.complete = function(line, callback) { completionGroupsLoaded(); } else if (match = line.match(requireRE)) { // require('...') - var exts = Object.keys(require.extensions); + const exts = Object.keys(this.context.require.extensions); var indexRe = new RegExp('^index(' + exts.map(regexpEscape).join('|') + ')$'); @@ -876,7 +925,8 @@ REPLServer.prototype.memory = function memory(cmd) { // save the line so I can do magic later if (cmd) { // TODO should I tab the level? - self.lines.push(new Array(self.lines.level.length).join(' ') + cmd); + const len = self.lines.level.length ? self.lines.level.length - 1 : 0; + self.lines.push(' '.repeat(len) + cmd); } else { // I don't want to not change the format too much... self.lines.push(''); @@ -933,7 +983,7 @@ REPLServer.prototype.memory = function memory(cmd) { // self.lines.level.length === 0 // TODO? keep a log of level so that any syntax breaking lines can // be cleared on .break and in the case of a syntax error? - // TODO? if a log was kept, then I could clear the bufferedComand and + // TODO? if a log was kept, then I could clear the bufferedCommand and // eval these lines and throw the syntax error } else { self.lines.level = []; @@ -966,7 +1016,7 @@ function defineDefaultCommands(repl) { repl.defineCommand('break', { help: 'Sometimes you get stuck, this gets you out', action: function() { - this._currentStringLiteral = null; + this.lineParser.reset(); this.bufferedCommand = ''; this.displayPrompt(); } @@ -981,7 +1031,7 @@ function defineDefaultCommands(repl) { repl.defineCommand('clear', { help: clearMessage, action: function() { - this._currentStringLiteral = null; + this.lineParser.reset(); this.bufferedCommand = ''; if (!this.useGlobal) { this.outputStream.write('Clearing context...\n'); @@ -1038,6 +1088,9 @@ function defineDefaultCommands(repl) { self.write(line + '\n'); } }); + } else { + this.outputStream.write('Failed to load:' + file + + ' is not a valid file\n'); } } catch (e) { this.outputStream.write('Failed to load:' + file + '\n'); @@ -1063,7 +1116,7 @@ function regexpEscape(s) { REPLServer.prototype.convertToContext = function(cmd) { const scopeVar = /^\s*var\s*([_\w\$]+)(.*)$/m; const scopeFunc = /^\s*function\s*([_\w\$]+)/; - var self = this, matches; + var matches; // Replaces: var foo = "bar"; with: self.context.foo = bar; matches = scopeVar.exec(cmd); @@ -1072,9 +1125,9 @@ REPLServer.prototype.convertToContext = function(cmd) { } // Replaces: function foo() {}; with: foo = function foo() {}; - matches = scopeFunc.exec(self.bufferedCommand); + matches = scopeFunc.exec(this.bufferedCommand); if (matches && matches.length === 2) { - return matches[1] + ' = ' + self.bufferedCommand; + return matches[1] + ' = ' + this.bufferedCommand; } return cmd; @@ -1091,7 +1144,10 @@ function isRecoverableError(e, self) { self._inTemplateLiteral = true; return true; } - return /^(Unexpected end of input|Unexpected token)/.test(message); + + return message.startsWith('Unexpected end of input') || + message.startsWith('Unexpected token') || + message.startsWith('missing ) after argument list'); } return false; } diff --git a/lib/string_decoder.js b/lib/string_decoder.js index 0c9fdfb416dd4e..a0bfd535ad8895 100644 --- a/lib/string_decoder.js +++ b/lib/string_decoder.js @@ -69,6 +69,7 @@ StringDecoder.prototype.write = function(buffer) { var charReceived = this.charReceived; var surrogateSize = this.surrogateSize; var encoding = this.encoding; + var charCode; // if our last write ended with an incomplete multibyte character while (charLength) { // determine how many remaining bytes this buffer has to offer for this char @@ -96,7 +97,7 @@ StringDecoder.prototype.write = function(buffer) { charStr = charBuffer.toString(encoding, 0, charLength); // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - var charCode = charStr.charCodeAt(charStr.length - 1); + charCode = charStr.charCodeAt(charStr.length - 1); if (charCode >= 0xD800 && charCode <= 0xDBFF) { charLength += surrogateSize; charStr = ''; @@ -128,8 +129,8 @@ StringDecoder.prototype.write = function(buffer) { this.charLength = charLength; charStr += buffer.toString(encoding, 0, end); - var end = charStr.length - 1; - var charCode = charStr.charCodeAt(end); + end = charStr.length - 1; + charCode = charStr.charCodeAt(end); // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character if (charCode >= 0xD800 && charCode <= 0xDBFF) { charLength += surrogateSize; diff --git a/lib/timers.js b/lib/timers.js index 50ae477d59d30f..c02798f068968f 100644 --- a/lib/timers.js +++ b/lib/timers.js @@ -1,141 +1,285 @@ 'use strict'; -const Timer = process.binding('timer_wrap').Timer; +const TimerWrap = process.binding('timer_wrap').Timer; const L = require('internal/linkedlist'); -const assert = require('assert').ok; +const assert = require('assert'); const util = require('util'); const debug = util.debuglog('timer'); -const kOnTimeout = Timer.kOnTimeout | 0; +const kOnTimeout = TimerWrap.kOnTimeout | 0; // Timeout values > TIMEOUT_MAX are set to 1. const TIMEOUT_MAX = 2147483647; // 2^31-1 -// IDLE TIMEOUTS + +// HOW and WHY the timers implementation works the way it does. +// +// Timers are crucial to Node.js. Internally, any TCP I/O connection creates a +// timer so that we can time out of connections. Additionally, many user +// user libraries and applications also use timers. As such there may be a +// significantly large amount of timeouts scheduled at any given time. +// Therefore, it is very important that the timers implementation is performant +// and efficient. +// +// Note: It is suggested you first read though the lib/internal/linkedlist.js +// linked list implementation, since timers depend on it extensively. It can be +// somewhat counter-intuitive at first, as it is not actually a class. Instead, +// it is a set of helpers that operate on an existing object. +// +// In order to be as performant as possible, the architecture and data +// structures are designed so that they are optimized to handle the following +// use cases as efficiently as possible: + +// - Adding a new timer. (insert) +// - Removing an existing timer. (remove) +// - Handling a timer timing out. (timeout) +// +// Whenever possible, the implementation tries to make the complexity of these +// operations as close to constant-time as possible. +// (So that performance is not impacted by the number of scheduled timers.) +// +// Object maps are kept which contain linked lists keyed by their duration in +// milliseconds. +// The linked lists within also have some meta-properties, one of which is a +// TimerWrap C++ handle, which makes the call after the duration to process the +// list it is attached to. +// +// +// ╔════ > Object Map +// ║ +// ╠══ +// ║ refedLists: { '40': { }, '320': { etc } } (keys of millisecond duration) +// ╚══ ┌─────────┘ +// │ +// ╔══ │ +// ║ TimersList { _idleNext: { }, _idlePrev: (self), _timer: (TimerWrap) } +// ║ ┌────────────────┘ +// ║ ╔══ │ ^ +// ║ ║ { _idleNext: { }, _idlePrev: { }, _onTimeout: (callback) } +// ║ ║ ┌───────────┘ +// ║ ║ │ ^ +// ║ ║ { _idleNext: { etc }, _idlePrev: { }, _onTimeout: (callback) } +// ╠══ ╠══ +// ║ ║ +// ║ ╚════ > Actual JavaScript timeouts +// ║ +// ╚════ > Linked List +// +// +// With this, virtually constant-time insertion (append), removal, and timeout +// is possible in the JavaScript layer. Any one list of timers is able to be +// sorted by just appending to it because all timers within share the same +// duration. Therefore, any timer added later will always have been scheduled to +// timeout later, thus only needing to be appended. +// Removal from an object-property linked list is also virtually constant-time +// as can be seen in the lib/internal/linkedlist.js implementation. +// Timeouts only need to process any timers due to currently timeout, which will +// always be at the beginning of the list for reasons stated above. Any timers +// after the first one encountered that does not yet need to timeout will also +// always be due to timeout at a later time. +// +// Less-than constant time operations are thus contained in two places: +// TimerWrap's backing libuv timers implementation (a performant heap-based +// queue), and the object map lookup of a specific list by the duration of +// timers within (or creation of a new list). +// However, these operations combined have shown to be trivial in comparison to +// other alternative timers architectures. + + +// Object maps containing linked lists of timers, keyed and sorted by their +// duration in milliseconds. +// +// The difference between these two objects is that the former contains timers +// that will keep the process open if they are the only thing left, while the +// latter will not. +// +// - key = time in milliseconds +// - value = linked list +const refedLists = {}; +const unrefedLists = {}; + + +// Schedule or re-schedule a timer. +// The item must have been enroll()'d first. +const active = exports.active = function(item) { + insert(item, false); +}; + +// Internal APIs that need timeouts should use `_unrefActive()` instead of +// `active()` so that they do not unnecessarily keep the process open. +exports._unrefActive = function(item) { + insert(item, true); +}; + + +// The underlying logic for scheduling or re-scheduling a timer. // -// Because often many sockets will have the same idle timeout we will not -// use one timeout watcher per item. It is too much overhead. Instead -// we'll use a single watcher for all sockets with the same timeout value -// and a linked list. This technique is described in the libev manual: -// http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#Be_smart_about_timeouts - -// Object containing all lists, timers -// key = time in milliseconds -// value = list -var lists = {}; - - -// call this whenever the item is active (not idle) -// it will reset its timeout. -// the main function - creates lists on demand and the watchers associated -// with them. -exports.active = function(item) { +// Appends a timer onto the end of an existing timers list, or creates a new +// TimerWrap backed list if one does not already exist for the specified timeout +// duration. +function insert(item, unrefed) { const msecs = item._idleTimeout; if (msecs < 0 || msecs === undefined) return; - item._idleStart = Timer.now(); + item._idleStart = TimerWrap.now(); - var list; - - if (lists[msecs]) { - list = lists[msecs]; - } else { - list = new Timer(); - list.start(msecs, 0); + const lists = unrefed === true ? unrefedLists : refedLists; + // Use an existing list if there is one, otherwise we need to make a new one. + var list = lists[msecs]; + if (!list) { + debug('no %d list was found in insert, creating a new one', msecs); + // Make a new linked list of timers, and create a TimerWrap to schedule + // processing for the list. + list = new TimersList(msecs, unrefed); L.init(list); + list._timer._list = list; + + if (unrefed === true) list._timer.unref(); + list._timer.start(msecs, 0); lists[msecs] = list; - list.msecs = msecs; - list[kOnTimeout] = listOnTimeout; + list._timer[kOnTimeout] = listOnTimeout; } L.append(list, item); assert(!L.isEmpty(list)); // list is not empty -}; +} + +function TimersList(msecs, unrefed) { + this._idleNext = null; // Create the list with the linkedlist properties to + this._idlePrev = null; // prevent any unnecessary hidden class changes. + this._timer = new TimerWrap(); + this._unrefed = unrefed; + this.msecs = msecs; +} function listOnTimeout() { - var msecs = this.msecs; - var list = this; + var list = this._list; + var msecs = list.msecs; debug('timeout callback %d', msecs); - var now = Timer.now(); + var now = TimerWrap.now(); debug('now: %s', now); - var diff, first, threw; - while (first = L.peek(list)) { - diff = now - first._idleStart; + var diff, timer; + while (timer = L.peek(list)) { + diff = now - timer._idleStart; + + // Check if this loop iteration is too early for the next timer. + // This happens if there are more timers scheduled for later in the list. if (diff < msecs) { - list.start(msecs - diff, 0); + this.start(msecs - diff, 0); debug('%d list wait because diff is %d', msecs, diff); return; - } else { - L.remove(first); - assert(first !== L.peek(list)); + } + + // The actual logic for when a timeout happens. + + L.remove(timer); + assert(timer !== L.peek(list)); - if (!first._onTimeout) continue; + if (!timer._onTimeout) continue; - // v0.4 compatibility: if the timer callback throws and the + var domain = timer.domain; + if (domain) { + + // If the timer callback throws and the // domain or uncaughtException handler ignore the exception, // other timers that expire on this tick should still run. // - // https://github.com/joyent/node/issues/2631 - var domain = first.domain; - if (domain && domain._disposed) + // https://github.com/nodejs/node-v0.x-archive/issues/2631 + if (domain._disposed) continue; - try { - if (domain) - domain.enter(); - threw = true; - first._called = true; - first._onTimeout(); - if (domain) - domain.exit(); - threw = false; - } finally { - if (threw) { - // We need to continue processing after domain error handling - // is complete, but not by using whatever domain was left over - // when the timeout threw its exception. - var oldDomain = process.domain; - process.domain = null; - process.nextTick(listOnTimeoutNT, list); - process.domain = oldDomain; - } - } + domain.enter(); } + + tryOnTimeout(timer, list); + + if (domain) + domain.exit(); } + // If `L.peek(list)` returned nothing, the list was either empty or we have + // called all of the timer timeouts. + // As such, we can remove the list and clean up the TimerWrap C++ handle. debug('%d list empty', msecs); assert(L.isEmpty(list)); - list.close(); - delete lists[msecs]; + this.close(); + if (list._unrefed === true) { + delete unrefedLists[msecs]; + } else { + delete refedLists[msecs]; + } +} + + +// An optimization so that the try/finally only de-optimizes (since at least v8 +// 4.7) what is in this smaller function. +function tryOnTimeout(timer, list) { + timer._called = true; + var threw = true; + try { + timer._onTimeout(); + threw = false; + } finally { + if (!threw) return; + + // We need to continue processing after domain error handling + // is complete, but not by using whatever domain was left over + // when the timeout threw its exception. + const domain = process.domain; + process.domain = null; + // If we threw, we need to process the rest of the list in nextTick. + process.nextTick(listOnTimeoutNT, list); + process.domain = domain; + } } function listOnTimeoutNT(list) { - list[kOnTimeout](); + list._timer[kOnTimeout](); } -const unenroll = exports.unenroll = function(item) { +// A convenience function for re-using TimerWrap handles more easily. +// +// This mostly exists to fix https://github.com/nodejs/node/issues/1264. +// Handles in libuv take at least one `uv_run` to be registered as unreferenced. +// Re-using an existing handle allows us to skip that, so that a second `uv_run` +// will return no active handles, even when running `setTimeout(fn).unref()`. +function reuse(item) { L.remove(item); - var list = lists[item._idleTimeout]; - // if empty then stop the watcher - debug('unenroll'); + var list = refedLists[item._idleTimeout]; + // if empty - reuse the watcher if (list && L.isEmpty(list)) { + debug('reuse hit'); + list._timer.stop(); + delete refedLists[item._idleTimeout]; + return list._timer; + } + + return null; +} + + +// Remove a timer. Cancels the timeout and resets the relevant timer properties. +const unenroll = exports.unenroll = function(item) { + var handle = reuse(item); + if (handle) { debug('unenroll: list empty'); - list.close(); - delete lists[item._idleTimeout]; + handle.close(); } // if active is called later, then we want to make sure not to insert again item._idleTimeout = -1; }; -// Does not start the time, just sets up the members needed. +// Make a regular object able to act as a timer by setting some properties. +// This function does not start the timer, see `active()`. +// Using existing objects as timers slightly reduces object overhead. exports.enroll = function(item, msecs) { if (typeof msecs !== 'number') { throw new TypeError('msecs must be a number'); @@ -181,40 +325,40 @@ exports.setTimeout = function(callback, after) { case 2: break; case 3: - ontimeout = callback.bind(timer, arguments[2]); + ontimeout = () => callback.call(timer, arguments[2]); break; case 4: - ontimeout = callback.bind(timer, arguments[2], arguments[3]); + ontimeout = () => callback.call(timer, arguments[2], arguments[3]); break; case 5: ontimeout = - callback.bind(timer, arguments[2], arguments[3], arguments[4]); + () => callback.call(timer, arguments[2], arguments[3], arguments[4]); break; // slow case default: var args = new Array(length - 2); for (var i = 2; i < length; i++) args[i - 2] = arguments[i]; - ontimeout = callback.apply.bind(callback, timer, args); + ontimeout = () => callback.apply(timer, args); break; } timer._onTimeout = ontimeout; if (process.domain) timer.domain = process.domain; - exports.active(timer); + active(timer); return timer; }; -exports.clearTimeout = function(timer) { +const clearTimeout = exports.clearTimeout = function(timer) { if (timer && (timer[kOnTimeout] || timer._onTimeout)) { timer[kOnTimeout] = timer._onTimeout = null; if (timer instanceof Timeout) { timer.close(); // for after === 0 } else { - exports.unenroll(timer); + unenroll(timer); } } }; @@ -236,32 +380,32 @@ exports.setInterval = function(callback, repeat) { case 2: break; case 3: - ontimeout = callback.bind(timer, arguments[2]); + ontimeout = () => callback.call(timer, arguments[2]); break; case 4: - ontimeout = callback.bind(timer, arguments[2], arguments[3]); + ontimeout = () => callback.call(timer, arguments[2], arguments[3]); break; case 5: ontimeout = - callback.bind(timer, arguments[2], arguments[3], arguments[4]); + () => callback.call(timer, arguments[2], arguments[3], arguments[4]); break; default: var args = new Array(length - 2); for (var i = 2; i < length; i += 1) args[i - 2] = arguments[i]; - ontimeout = callback.apply.bind(callback, timer, args); + ontimeout = () => callback.apply(timer, args); break; } timer._onTimeout = wrapper; timer._repeat = ontimeout; if (process.domain) timer.domain = process.domain; - exports.active(timer); + active(timer); return timer; function wrapper() { - timer._repeat.call(this); + timer._repeat(); // Timer might be closed - no point in restarting it if (!timer._repeat) @@ -272,7 +416,7 @@ exports.setInterval = function(callback, repeat) { this._handle.start(repeat, 0); } else { timer._idleTimeout = repeat; - exports.active(timer); + active(timer); } } }; @@ -286,7 +430,7 @@ exports.clearInterval = function(timer) { }; -const Timeout = function(after) { +function Timeout(after) { this._called = false; this._idleTimeout = after; this._idlePrev = this; @@ -294,7 +438,7 @@ const Timeout = function(after) { this._idleStart = null; this._onTimeout = null; this._repeat = null; -}; +} function unrefdHandle() { @@ -307,17 +451,21 @@ function unrefdHandle() { Timeout.prototype.unref = function() { if (this._handle) { this._handle.unref(); - } else if (typeof(this._onTimeout) === 'function') { - var now = Timer.now(); + } else if (typeof this._onTimeout === 'function') { + var now = TimerWrap.now(); if (!this._idleStart) this._idleStart = now; var delay = this._idleStart + this._idleTimeout - now; if (delay < 0) delay = 0; - exports.unenroll(this); // Prevent running cb again when unref() is called during the same cb - if (this._called && !this._repeat) return; + if (this._called && !this._repeat) { + unenroll(this); + return; + } + + var handle = reuse(this); - this._handle = new Timer(); + this._handle = handle || new TimerWrap(); this._handle.owner = this; this._handle[kOnTimeout] = unrefdHandle; this._handle.start(delay, 0); @@ -339,7 +487,7 @@ Timeout.prototype.close = function() { this._handle[kOnTimeout] = null; this._handle.close(); } else { - exports.unenroll(this); + unenroll(this); } return this; }; @@ -363,23 +511,7 @@ function processImmediate() { if (domain) domain.enter(); - var threw = true; - try { - immediate._onImmediate(); - threw = false; - } finally { - if (threw) { - if (!L.isEmpty(queue)) { - // Handle any remaining on next tick, assuming we're still - // alive to do so. - while (!L.isEmpty(immediateQueue)) { - L.append(queue, L.shift(immediateQueue)); - } - immediateQueue = queue; - process.nextTick(processImmediate); - } - } - } + tryOnImmediate(immediate, queue); if (domain) domain.exit(); @@ -394,6 +526,26 @@ function processImmediate() { } +// An optimization so that the try/finally only de-optimizes (since at least v8 +// 4.7) what is in this smaller function. +function tryOnImmediate(immediate, queue) { + var threw = true; + try { + immediate._onImmediate(); + threw = false; + } finally { + if (threw && !L.isEmpty(queue)) { + // Handle any remaining on next tick, assuming we're still alive to do so. + while (!L.isEmpty(immediateQueue)) { + L.append(queue, L.shift(immediateQueue)); + } + immediateQueue = queue; + process.nextTick(processImmediate); + } + } +} + + function Immediate() { } Immediate.prototype.domain = undefined; @@ -467,152 +619,3 @@ exports.clearImmediate = function(immediate) { process._needImmediateCallback = false; } }; - - -// Internal APIs that need timeouts should use timers._unrefActive instead of -// timers.active as internal timeouts shouldn't hold the loop open - -var unrefList, unrefTimer; - -function _makeTimerTimeout(timer) { - var domain = timer.domain; - var msecs = timer._idleTimeout; - - L.remove(timer); - - // Timer has been unenrolled by another timer that fired at the same time, - // so don't make it timeout. - if (msecs <= 0) - return; - - if (!timer._onTimeout) - return; - - if (domain) { - if (domain._disposed) - return; - - domain.enter(); - } - - debug('unreftimer firing timeout'); - timer._called = true; - _runOnTimeout(timer); - - if (domain) - domain.exit(); -} - -function _runOnTimeout(timer) { - var threw = true; - try { - timer._onTimeout(); - threw = false; - } finally { - if (threw) process.nextTick(unrefTimeout); - } -} - -function unrefTimeout() { - var now = Timer.now(); - - debug('unrefTimer fired'); - - var timeSinceLastActive; - var nextTimeoutTime; - var nextTimeoutDuration; - var minNextTimeoutTime = TIMEOUT_MAX; - var timersToTimeout = []; - - // The actual timer fired and has not yet been rearmed, - // let's consider its next firing time is invalid for now. - // It may be set to a relevant time in the future once - // we scanned through the whole list of timeouts and if - // we find a timeout that needs to expire. - unrefTimer.when = -1; - - // Iterate over the list of timeouts, - // call the onTimeout callback for those expired, - // and rearm the actual timer if the next timeout to expire - // will expire before the current actual timer. - var cur = unrefList._idlePrev; - while (cur !== unrefList) { - timeSinceLastActive = now - cur._idleStart; - - if (timeSinceLastActive < cur._idleTimeout) { - // This timer hasn't expired yet, but check if its expiring time is - // earlier than the actual timer's expiring time - - nextTimeoutDuration = cur._idleTimeout - timeSinceLastActive; - nextTimeoutTime = now + nextTimeoutDuration; - if (minNextTimeoutTime === TIMEOUT_MAX || - (nextTimeoutTime < minNextTimeoutTime)) { - // We found a timeout that will expire earlier, - // store its next timeout time now so that we - // can rearm the actual timer accordingly when - // we scanned through the whole list. - minNextTimeoutTime = nextTimeoutTime; - } - } else { - // We found a timer that expired. Do not call its _onTimeout callback - // right now, as it could mutate any item of the list (including itself). - // Instead, add it to another list that will be processed once the list - // of current timers has been fully traversed. - timersToTimeout.push(cur); - } - - cur = cur._idlePrev; - } - - var nbTimersToTimeout = timersToTimeout.length; - for (var timerIdx = 0; timerIdx < nbTimersToTimeout; ++timerIdx) - _makeTimerTimeout(timersToTimeout[timerIdx]); - - - // Rearm the actual timer with the timeout delay - // of the earliest timeout found. - if (minNextTimeoutTime !== TIMEOUT_MAX) { - unrefTimer.start(minNextTimeoutTime - now, 0); - unrefTimer.when = minNextTimeoutTime; - debug('unrefTimer rescheduled'); - } else if (L.isEmpty(unrefList)) { - debug('unrefList is empty'); - } -} - - -exports._unrefActive = function(item) { - var msecs = item._idleTimeout; - if (!msecs || msecs < 0) return; - assert(msecs >= 0); - - L.remove(item); - - if (!unrefList) { - debug('unrefList initialized'); - unrefList = {}; - L.init(unrefList); - - debug('unrefTimer initialized'); - unrefTimer = new Timer(); - unrefTimer.unref(); - unrefTimer.when = -1; - unrefTimer[kOnTimeout] = unrefTimeout; - } - - var now = Timer.now(); - item._idleStart = now; - - var when = now + msecs; - - // If the actual timer is set to fire too late, or not set to fire at all, - // we need to make it fire earlier - if (unrefTimer.when === -1 || unrefTimer.when > when) { - unrefTimer.start(msecs, 0); - unrefTimer.when = when; - debug('unrefTimer scheduled'); - } - - debug('unrefList append to end'); - L.append(unrefList, item); -}; diff --git a/lib/tls.js b/lib/tls.js index 0d85a948dcc511..b7309a62deff09 100644 --- a/lib/tls.js +++ b/lib/tls.js @@ -2,7 +2,6 @@ const net = require('net'); const url = require('url'); -const util = require('util'); const binding = process.binding('crypto'); const Buffer = require('buffer').Buffer; const constants = require('constants'); @@ -33,27 +32,42 @@ exports.getCiphers = function() { // Convert protocols array into valid OpenSSL protocols list // ("\x06spdy/2\x08http/1.1\x08http/1.0") -exports.convertNPNProtocols = function convertNPNProtocols(NPNProtocols, out) { - // If NPNProtocols is Array - translate it into buffer - if (Array.isArray(NPNProtocols)) { - var buff = new Buffer(NPNProtocols.reduce(function(p, c) { - return p + 1 + Buffer.byteLength(c); - }, 0)); - - NPNProtocols.reduce(function(offset, c) { - var clen = Buffer.byteLength(c); - buff[offset] = clen; - buff.write(c, offset + 1); - - return offset + 1 + clen; - }, 0); - - NPNProtocols = buff; +function convertProtocols(protocols) { + var buff = new Buffer(protocols.reduce(function(p, c) { + return p + 1 + Buffer.byteLength(c); + }, 0)); + + protocols.reduce(function(offset, c) { + var clen = Buffer.byteLength(c); + buff[offset] = clen; + buff.write(c, offset + 1); + + return offset + 1 + clen; + }, 0); + + return buff; +} + +exports.convertNPNProtocols = function(protocols, out) { + // If protocols is Array - translate it into buffer + if (Array.isArray(protocols)) { + protocols = convertProtocols(protocols); } + // If it's already a Buffer - store it + if (protocols instanceof Buffer) { + out.NPNProtocols = protocols; + } +}; +exports.convertALPNProtocols = function(protocols, out) { + // If protocols is Array - translate it into buffer + if (Array.isArray(protocols)) { + protocols = convertProtocols(protocols); + } // If it's already a Buffer - store it - if (NPNProtocols instanceof Buffer) { - out.NPNProtocols = NPNProtocols; + if (protocols instanceof Buffer) { + // copy new buffer not to be modified by user + out.ALPNProtocols = new Buffer(protocols); } }; @@ -61,7 +75,7 @@ exports.checkServerIdentity = function checkServerIdentity(host, cert) { // Create regexp to much hostnames function regexpify(host, wildcards) { // Add trailing dot (make hostnames uniform) - if (!/\.$/.test(host)) host += '.'; + if (!host || !host.endsWith('.')) host += '.'; // The same applies to hostname with more than one wildcard, // if hostname has wildcard when wildcards are not allowed, @@ -91,12 +105,12 @@ exports.checkServerIdentity = function checkServerIdentity(host, cert) { return new RegExp('^' + re + '$', 'i'); } - var dnsNames = [], - uriNames = [], - ips = [], - matchCN = true, - valid = false, - reason = 'Unknown reason'; + var dnsNames = []; + var uriNames = []; + const ips = []; + var matchCN = true; + var valid = false; + var reason = 'Unknown reason'; // There're several names to perform check against: // CN and altnames in certificate extension @@ -126,13 +140,11 @@ exports.checkServerIdentity = function checkServerIdentity(host, cert) { return ip === host; }); if (!valid) { - reason = util.format('IP: %s is not in the cert\'s list: %s', - host, - ips.join(', ')); + reason = `IP: ${host} is not in the cert's list: ${ips.join(', ')}`; } } else if (cert.subject) { // Transform hostname to canonical form - if (!/\.$/.test(host)) host += '.'; + if (!host || !host.endsWith('.')) host += '.'; // Otherwise check all DNS/URI records from certificate // (with allowed wildcards) @@ -174,13 +186,11 @@ exports.checkServerIdentity = function checkServerIdentity(host, cert) { if (!valid) { if (cert.subjectaltname) { - reason = util.format('Host: %s is not in the cert\'s altnames: %s', - host, - cert.subjectaltname); + reason = + `Host: ${host} is not in the cert's altnames: ` + + `${cert.subjectaltname}`; } else { - reason = util.format('Host: %s is not cert\'s CN: %s', - host, - cert.subject.CN); + reason = `Host: ${host} is not cert's CN: ${cert.subject.CN}`; } } } else { @@ -189,8 +199,7 @@ exports.checkServerIdentity = function checkServerIdentity(host, cert) { if (!valid) { var err = new Error( - util.format('Hostname/IP doesn\'t match certificate\'s altnames: %j', - reason)); + `Hostname/IP doesn't match certificate's altnames: "${reason}"`); err.reason = reason; err.host = host; err.cert = cert; diff --git a/lib/url.js b/lib/url.js index 45155fee936bbf..9bb163e273a94a 100644 --- a/lib/url.js +++ b/lib/url.js @@ -34,24 +34,7 @@ const portPattern = /:[0-9]*$/; // Special case for a simple path URL const simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/; -// RFC 2396: characters reserved for delimiting URLs. -// We actually just auto-escape these. -const delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t']; - -// RFC 2396: characters not allowed for various reasons. -const unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims); - -// Allowed by RFCs, but cause of XSS attacks. Always escape these. -const autoEscape = ['\''].concat(unwise); - -// Characters that are never ever allowed in a hostname. -// Note that any invalid chars are also handled, but these -// are the ones that are *expected* to be seen, so we fast-path them. -const nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape); -const hostEndingChars = ['/', '?', '#']; const hostnameMaxLen = 255; -const hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/; -const hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/; // protocols that can allow "unsafe" and "unwise" chars. const unsafeProtocol = { 'javascript': true, @@ -65,14 +48,14 @@ const hostlessProtocol = { // protocols that always contain a // bit. const slashedProtocol = { 'http': true, - 'https': true, - 'ftp': true, - 'gopher': true, - 'file': true, 'http:': true, + 'https': true, 'https:': true, + 'ftp': true, 'ftp:': true, + 'gopher': true, 'gopher:': true, + 'file': true, 'file:': true }; const querystring = require('querystring'); @@ -93,23 +76,85 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { // Copy chrome, IE, opera backslash-handling behavior. // Back slashes before the query string get converted to forward slashes // See: https://code.google.com/p/chromium/issues/detail?id=25916 - var queryIndex = url.indexOf('?'), - splitter = - (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#', - uSplit = url.split(splitter), - slashRegex = /\\/g; - uSplit[0] = uSplit[0].replace(slashRegex, '/'); - url = uSplit.join(splitter); + var hasHash = false; + var start = -1; + var end = -1; + var rest = ''; + var lastPos = 0; + var i = 0; + for (var inWs = false, split = false; i < url.length; ++i) { + const code = url.charCodeAt(i); + + // Find first and last non-whitespace characters for trimming + const isWs = code === 32/* */ || + code === 9/*\t*/ || + code === 13/*\r*/ || + code === 10/*\n*/ || + code === 12/*\f*/ || + code === 160/*\u00A0*/ || + code === 65279/*\uFEFF*/; + if (start === -1) { + if (isWs) + continue; + lastPos = start = i; + } else { + if (inWs) { + if (!isWs) { + end = -1; + inWs = false; + } + } else if (isWs) { + end = i; + inWs = true; + } + } - var rest = url; + // Only convert backslashes while we haven't seen a split character + if (!split) { + switch (code) { + case 35: // '#' + hasHash = true; + // Fall through + case 63: // '?' + split = true; + break; + case 92: // '\\' + if (i - lastPos > 0) + rest += url.slice(lastPos, i); + rest += '/'; + lastPos = i + 1; + break; + } + } else if (!hasHash && code === 35/*#*/) { + hasHash = true; + } + } - // trim before proceeding. - // This is to support parse stuff like " http://foo.com \n" - rest = rest.trim(); + // Check if string was non-empty (including strings with only whitespace) + if (start !== -1) { + if (lastPos === start) { + // We didn't convert any backslashes + + if (end === -1) { + if (start === 0) + rest = url; + else + rest = url.slice(start); + } else { + rest = url.slice(start, end); + } + } else if (end === -1 && lastPos < url.length) { + // We converted some backslashes and have only part of the entire string + rest += url.slice(lastPos); + } else if (end !== -1 && lastPos < end) { + // We converted some backslashes and have only part of the entire string + rest += url.slice(lastPos, end); + } + } - if (!slashesDenoteHost && url.split('#').length === 1) { + if (!slashesDenoteHost && !hasHash) { // Try fast path regexp - var simplePath = simplePathPattern.exec(rest); + const simplePath = simplePathPattern.exec(rest); if (simplePath) { this.path = rest; this.href = rest; @@ -117,9 +162,9 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { if (simplePath[2]) { this.search = simplePath[2]; if (parseQueryString) { - this.query = querystring.parse(this.search.substr(1)); + this.query = querystring.parse(this.search.slice(1)); } else { - this.query = this.search.substr(1); + this.query = this.search.slice(1); } } else if (parseQueryString) { this.search = ''; @@ -134,17 +179,18 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { proto = proto[0]; var lowerProto = proto.toLowerCase(); this.protocol = lowerProto; - rest = rest.substr(proto.length); + rest = rest.slice(proto.length); } // figure out if it's got a host // user@server is *always* interpreted as a hostname, and url // resolution will treat //foo/bar as host=foo,path=bar because that's // how the browser resolves relative URLs. - if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { - var slashes = rest.substr(0, 2) === '//'; + if (slashesDenoteHost || proto || /^\/\/[^@\/]+@[^@\/]+/.test(rest)) { + var slashes = rest.charCodeAt(0) === 47/*/*/ && + rest.charCodeAt(1) === 47/*/*/; if (slashes && !(proto && hostlessProtocol[proto])) { - rest = rest.substr(2); + rest = rest.slice(2); this.slashes = true; } } @@ -167,95 +213,82 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { // v0.12 TODO(isaacs): This is not quite how Chrome does things. // Review our test case against browsers more comprehensively. - // find the first instance of any hostEndingChars var hostEnd = -1; - for (var i = 0; i < hostEndingChars.length; i++) { - var hec = rest.indexOf(hostEndingChars[i]); - if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) - hostEnd = hec; - } - - // at this point, either we have an explicit point where the - // auth portion cannot go past, or the last @ char is the decider. - var auth, atSign; - if (hostEnd === -1) { - // atSign can be anywhere. - atSign = rest.lastIndexOf('@'); - } else { - // atSign must be in auth portion. - // http://a@b/c@d => host:b auth:a path:/c@d - atSign = rest.lastIndexOf('@', hostEnd); + var atSign = -1; + var nonHost = -1; + for (i = 0; i < rest.length; ++i) { + switch (rest.charCodeAt(i)) { + case 9: // '\t' + case 10: // '\n' + case 13: // '\r' + case 32: // ' ' + case 34: // '"' + case 37: // '%' + case 39: // '\'' + case 59: // ';' + case 60: // '<' + case 62: // '>' + case 92: // '\\' + case 94: // '^' + case 96: // '`' + case 123: // '{' + case 124: // '|' + case 125: // '}' + // Characters that are never ever allowed in a hostname from RFC 2396 + if (nonHost === -1) + nonHost = i; + break; + case 35: // '#' + case 47: // '/' + case 63: // '?' + // Find the first instance of any host-ending characters + if (nonHost === -1) + nonHost = i; + hostEnd = i; + break; + case 64: // '@' + // At this point, either we have an explicit point where the + // auth portion cannot go past, or the last @ char is the decider. + atSign = i; + nonHost = -1; + break; + } + if (hostEnd !== -1) + break; } - - // Now we have a portion which is definitely the auth. - // Pull that off. + start = 0; if (atSign !== -1) { - auth = rest.slice(0, atSign); - rest = rest.slice(atSign + 1); - this.auth = decodeURIComponent(auth); + this.auth = decodeURIComponent(rest.slice(0, atSign)); + start = atSign + 1; } - - // the host is the remaining to the left of the first non-host char - hostEnd = -1; - for (var i = 0; i < nonHostChars.length; i++) { - var hec = rest.indexOf(nonHostChars[i]); - if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) - hostEnd = hec; + if (nonHost === -1) { + this.host = rest.slice(start); + rest = ''; + } else { + this.host = rest.slice(start, nonHost); + rest = rest.slice(nonHost); } - // if we still have not hit it, then the entire thing is a host. - if (hostEnd === -1) - hostEnd = rest.length; - - this.host = rest.slice(0, hostEnd); - rest = rest.slice(hostEnd); // pull out port. this.parseHost(); // we've indicated that there is a hostname, // so even if it's empty, it has to be present. - this.hostname = this.hostname || ''; + if (typeof this.hostname !== 'string') + this.hostname = ''; + + var hostname = this.hostname; // if hostname begins with [ and ends with ] // assume that it's an IPv6 address. - var ipv6Hostname = this.hostname[0] === '[' && - this.hostname[this.hostname.length - 1] === ']'; + var ipv6Hostname = hostname.charCodeAt(0) === 91/*[*/ && + hostname.charCodeAt(hostname.length - 1) === 93/*]*/; // validate a little. if (!ipv6Hostname) { - var hostparts = this.hostname.split(/\./); - for (var i = 0, l = hostparts.length; i < l; i++) { - var part = hostparts[i]; - if (!part) continue; - if (!part.match(hostnamePartPattern)) { - var newpart = ''; - for (var j = 0, k = part.length; j < k; j++) { - if (part.charCodeAt(j) > 127) { - // we replace non-ASCII char with a temporary placeholder - // we need this to make sure size of hostname is not - // broken by replacing non-ASCII by nothing - newpart += 'x'; - } else { - newpart += part[j]; - } - } - // we test again with ASCII char only - if (!newpart.match(hostnamePartPattern)) { - var validParts = hostparts.slice(0, i); - var notHost = hostparts.slice(i + 1); - var bit = part.match(hostnamePartStart); - if (bit) { - validParts.push(bit[1]); - notHost.unshift(bit[2]); - } - if (notHost.length) { - rest = '/' + notHost.join('.') + rest; - } - this.hostname = validParts.join('.'); - break; - } - } - } + const result = validateHostname(this, rest, hostname); + if (result !== undefined) + rest = result; } if (this.hostname.length > hostnameMaxLen) { @@ -280,7 +313,7 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { // strip [ and ] from the hostname // the host field still retains them, though if (ipv6Hostname) { - this.hostname = this.hostname.substr(1, this.hostname.length - 2); + this.hostname = this.hostname.slice(1, -1); if (rest[0] !== '/') { rest = '/' + rest; } @@ -290,53 +323,63 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { // now rest is set to the post-host stuff. // chop off any delim chars. if (!unsafeProtocol[lowerProto]) { - // First, make 100% sure that any "autoEscape" chars get // escaped, even if encodeURIComponent doesn't think they // need to be. - for (var i = 0, l = autoEscape.length; i < l; i++) { - var ae = autoEscape[i]; - if (rest.indexOf(ae) === -1) - continue; - var esc = encodeURIComponent(ae); - if (esc === ae) { - esc = escape(ae); - } - rest = rest.split(ae).join(esc); - } + const result = autoEscapeStr(rest); + if (result !== undefined) + rest = result; } - - // chop off from the tail first. - var hash = rest.indexOf('#'); - if (hash !== -1) { - // got a fragment string. - this.hash = rest.substr(hash); - rest = rest.slice(0, hash); + var questionIdx = -1; + var hashIdx = -1; + for (i = 0; i < rest.length; ++i) { + const code = rest.charCodeAt(i); + if (code === 35/*#*/) { + this.hash = rest.slice(i); + hashIdx = i; + break; + } else if (code === 63/*?*/ && questionIdx === -1) { + questionIdx = i; + } } - var qm = rest.indexOf('?'); - if (qm !== -1) { - this.search = rest.substr(qm); - this.query = rest.substr(qm + 1); + + if (questionIdx !== -1) { + if (hashIdx === -1) { + this.search = rest.slice(questionIdx); + this.query = rest.slice(questionIdx + 1); + } else { + this.search = rest.slice(questionIdx, hashIdx); + this.query = rest.slice(questionIdx + 1, hashIdx); + } if (parseQueryString) { this.query = querystring.parse(this.query); } - rest = rest.slice(0, qm); } else if (parseQueryString) { // no query string, but parseQueryString still requested this.search = ''; this.query = {}; } - if (rest) this.pathname = rest; + + var firstIdx = (questionIdx !== -1 && + (hashIdx === -1 || questionIdx < hashIdx) + ? questionIdx + : hashIdx); + if (firstIdx === -1) { + if (rest.length > 0) + this.pathname = rest; + } else if (firstIdx > 0) { + this.pathname = rest.slice(0, firstIdx); + } if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) { this.pathname = '/'; } - //to support http.request + // to support http.request if (this.pathname || this.search) { - var p = this.pathname || ''; - var s = this.search || ''; + const p = this.pathname || ''; + const s = this.search || ''; this.path = p + s; } @@ -345,6 +388,138 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { return this; }; +function validateHostname(self, rest, hostname) { + for (var i = 0, lastPos; i <= hostname.length; ++i) { + var code; + if (i < hostname.length) + code = hostname.charCodeAt(i); + if (code === 46/*.*/ || i === hostname.length) { + if (i - lastPos > 0) { + if (i - lastPos > 63) { + self.hostname = hostname.slice(0, lastPos + 63); + return '/' + hostname.slice(lastPos + 63) + rest; + } + } + lastPos = i + 1; + continue; + } else if ((code >= 48/*0*/ && code <= 57/*9*/) || + (code >= 97/*a*/ && code <= 122/*z*/) || + code === 45/*-*/ || + (code >= 65/*A*/ && code <= 90/*Z*/) || + code === 43/*+*/ || + code === 95/*_*/ || + code > 127) { + continue; + } + // Invalid host character + self.hostname = hostname.slice(0, i); + if (i < hostname.length) + return '/' + hostname.slice(i) + rest; + break; + } +} + +function autoEscapeStr(rest) { + var newRest = ''; + var lastPos = 0; + for (var i = 0; i < rest.length; ++i) { + // Automatically escape all delimiters and unwise characters from RFC 2396 + // Also escape single quotes in case of an XSS attack + switch (rest.charCodeAt(i)) { + case 9: // '\t' + if (i - lastPos > 0) + newRest += rest.slice(lastPos, i); + newRest += '%09'; + lastPos = i + 1; + break; + case 10: // '\n' + if (i - lastPos > 0) + newRest += rest.slice(lastPos, i); + newRest += '%0A'; + lastPos = i + 1; + break; + case 13: // '\r' + if (i - lastPos > 0) + newRest += rest.slice(lastPos, i); + newRest += '%0D'; + lastPos = i + 1; + break; + case 32: // ' ' + if (i - lastPos > 0) + newRest += rest.slice(lastPos, i); + newRest += '%20'; + lastPos = i + 1; + break; + case 34: // '"' + if (i - lastPos > 0) + newRest += rest.slice(lastPos, i); + newRest += '%22'; + lastPos = i + 1; + break; + case 39: // '\'' + if (i - lastPos > 0) + newRest += rest.slice(lastPos, i); + newRest += '%27'; + lastPos = i + 1; + break; + case 60: // '<' + if (i - lastPos > 0) + newRest += rest.slice(lastPos, i); + newRest += '%3C'; + lastPos = i + 1; + break; + case 62: // '>' + if (i - lastPos > 0) + newRest += rest.slice(lastPos, i); + newRest += '%3E'; + lastPos = i + 1; + break; + case 92: // '\\' + if (i - lastPos > 0) + newRest += rest.slice(lastPos, i); + newRest += '%5C'; + lastPos = i + 1; + break; + case 94: // '^' + if (i - lastPos > 0) + newRest += rest.slice(lastPos, i); + newRest += '%5E'; + lastPos = i + 1; + break; + case 96: // '`' + if (i - lastPos > 0) + newRest += rest.slice(lastPos, i); + newRest += '%60'; + lastPos = i + 1; + break; + case 123: // '{' + if (i - lastPos > 0) + newRest += rest.slice(lastPos, i); + newRest += '%7B'; + lastPos = i + 1; + break; + case 124: // '|' + if (i - lastPos > 0) + newRest += rest.slice(lastPos, i); + newRest += '%7C'; + lastPos = i + 1; + break; + case 125: // '}' + if (i - lastPos > 0) + newRest += rest.slice(lastPos, i); + newRest += '%7D'; + lastPos = i + 1; + break; + } + } + if (lastPos === 0) + return; + if (lastPos < rest.length) + return newRest + rest.slice(lastPos); + else + return newRest; +} + // format a parsed object into a url string function urlFormat(obj) { // ensure it's an object, and not a string url. @@ -365,16 +540,15 @@ function urlFormat(obj) { Url.prototype.format = function() { var auth = this.auth || ''; if (auth) { - auth = encodeURIComponent(auth); - auth = auth.replace(/%3A/i, ':'); + auth = encodeAuth(auth); auth += '@'; } - var protocol = this.protocol || '', - pathname = this.pathname || '', - hash = this.hash || '', - host = false, - query = ''; + var protocol = this.protocol || ''; + var pathname = this.pathname || ''; + var hash = this.hash || ''; + var host = false; + var query = ''; if (this.host) { host = auth + this.host; @@ -387,34 +561,55 @@ Url.prototype.format = function() { } } - if (this.query !== null && - typeof this.query === 'object' && - Object.keys(this.query).length) { + if (this.query !== null && typeof this.query === 'object') query = querystring.stringify(this.query); - } var search = this.search || (query && ('?' + query)) || ''; - if (protocol && protocol.substr(-1) !== ':') protocol += ':'; + if (protocol && protocol.charCodeAt(protocol.length - 1) !== 58/*:*/) + protocol += ':'; + + var newPathname = ''; + var lastPos = 0; + for (var i = 0; i < pathname.length; ++i) { + switch (pathname.charCodeAt(i)) { + case 35: // '#' + if (i - lastPos > 0) + newPathname += pathname.slice(lastPos, i); + newPathname += '%23'; + lastPos = i + 1; + break; + case 63: // '?' + if (i - lastPos > 0) + newPathname += pathname.slice(lastPos, i); + newPathname += '%3F'; + lastPos = i + 1; + break; + } + } + if (lastPos > 0) { + if (lastPos !== pathname.length) + pathname = newPathname + pathname.slice(lastPos); + else + pathname = newPathname; + } // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. // unless they had them to begin with. if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== false) { host = '//' + (host || ''); - if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; + if (pathname && pathname.charCodeAt(0) !== 47/*/*/) + pathname = '/' + pathname; } else if (!host) { host = ''; } - if (hash && hash.charAt(0) !== '#') hash = '#' + hash; - if (search && search.charAt(0) !== '?') search = '?' + search; - - pathname = pathname.replace(/[?#]/g, function(match) { - return encodeURIComponent(match); - }); search = search.replace('#', '%23'); + if (hash && hash.charCodeAt(0) !== 35/*#*/) hash = '#' + hash; + if (search && search.charCodeAt(0) !== 63/*?*/) search = '?' + search; + return protocol + host + pathname + search + hash; }; @@ -498,7 +693,7 @@ Url.prototype.resolveObject = function(relative) { if (!relative.host && !/^file:?$/.test(relative.protocol) && !hostlessProtocol[relative.protocol]) { - var relPath = (relative.pathname || '').split('/'); + const relPath = (relative.pathname || '').split('/'); while (relPath.length && !(relative.host = relPath.shift())); if (!relative.host) relative.host = ''; if (!relative.hostname) relative.hostname = ''; @@ -525,17 +720,17 @@ Url.prototype.resolveObject = function(relative) { return result; } - var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'), - isRelAbs = ( - relative.host || - relative.pathname && relative.pathname.charAt(0) === '/' - ), - mustEndAbs = (isRelAbs || isSourceAbs || - (result.host && relative.pathname)), - removeAllDots = mustEndAbs, - srcPath = result.pathname && result.pathname.split('/') || [], - relPath = relative.pathname && relative.pathname.split('/') || [], - psychotic = result.protocol && !slashedProtocol[result.protocol]; + var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'); + var isRelAbs = ( + relative.host || + relative.pathname && relative.pathname.charAt(0) === '/' + ); + var mustEndAbs = (isRelAbs || isSourceAbs || + (result.host && relative.pathname)); + var removeAllDots = mustEndAbs; + var srcPath = result.pathname && result.pathname.split('/') || []; + var relPath = relative.pathname && relative.pathname.split('/') || []; + var psychotic = result.protocol && !slashedProtocol[result.protocol]; // if the url is a non-slashed url, then relative // links like ../.. should be able @@ -586,10 +781,10 @@ Url.prototype.resolveObject = function(relative) { // Put this after the other two cases because it simplifies the booleans if (psychotic) { result.hostname = result.host = srcPath.shift(); - //occationaly the auth can get stuck only in host + //occasionally the auth can get stuck only in host //this especially happens in cases like //url.resolveObject('mailto:local1@domain1', 'local2@domain2') - var authInHost = result.host && result.host.indexOf('@') > 0 ? + const authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false; if (authInHost) { result.auth = authInHost.shift(); @@ -668,10 +863,10 @@ Url.prototype.resolveObject = function(relative) { if (psychotic) { result.hostname = result.host = isAbsolute ? '' : srcPath.length ? srcPath.shift() : ''; - //occationaly the auth can get stuck only in host + //occasionally the auth can get stuck only in host //this especially happens in cases like //url.resolveObject('mailto:local1@domain1', 'local2@domain2') - var authInHost = result.host && result.host.indexOf('@') > 0 ? + const authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false; if (authInHost) { result.auth = authInHost.shift(); @@ -709,9 +904,9 @@ Url.prototype.parseHost = function() { if (port) { port = port[0]; if (port !== ':') { - this.port = port.substr(1); + this.port = port.slice(1); } - host = host.substr(0, host.length - port.length); + host = host.slice(0, host.length - port.length); } if (host) this.hostname = host; }; @@ -722,3 +917,69 @@ function spliceOne(list, index) { list[i] = list[k]; list.pop(); } + +var hexTable = new Array(256); +for (var i = 0; i < 256; ++i) + hexTable[i] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase(); +function encodeAuth(str) { + // faster encodeURIComponent alternative for encoding auth uri components + var out = ''; + var lastPos = 0; + for (var i = 0; i < str.length; ++i) { + var c = str.charCodeAt(i); + + // These characters do not need escaping: + // ! - . _ ~ + // ' ( ) * : + // digits + // alpha (uppercase) + // alpha (lowercase) + if (c === 0x21 || c === 0x2D || c === 0x2E || c === 0x5F || c === 0x7E || + (c >= 0x27 && c <= 0x2A) || + (c >= 0x30 && c <= 0x3A) || + (c >= 0x41 && c <= 0x5A) || + (c >= 0x61 && c <= 0x7A)) { + continue; + } + + if (i - lastPos > 0) + out += str.slice(lastPos, i); + + lastPos = i + 1; + + // Other ASCII characters + if (c < 0x80) { + out += hexTable[c]; + continue; + } + + // Multi-byte characters ... + if (c < 0x800) { + out += hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]; + continue; + } + if (c < 0xD800 || c >= 0xE000) { + out += hexTable[0xE0 | (c >> 12)] + + hexTable[0x80 | ((c >> 6) & 0x3F)] + + hexTable[0x80 | (c & 0x3F)]; + continue; + } + // Surrogate pair + ++i; + var c2; + if (i < str.length) + c2 = str.charCodeAt(i) & 0x3FF; + else + c2 = 0; + c = 0x10000 + (((c & 0x3FF) << 10) | c2); + out += hexTable[0xF0 | (c >> 18)] + + hexTable[0x80 | ((c >> 12) & 0x3F)] + + hexTable[0x80 | ((c >> 6) & 0x3F)] + + hexTable[0x80 | (c & 0x3F)]; + } + if (lastPos === 0) + return str; + if (lastPos < str.length) + return out + str.slice(lastPos); + return out; +} diff --git a/lib/util.js b/lib/util.js index 399a4ee0a23828..d2bef3fc63b7ed 100644 --- a/lib/util.js +++ b/lib/util.js @@ -5,41 +5,77 @@ const Buffer = require('buffer').Buffer; const internalUtil = require('internal/util'); const binding = process.binding('util'); +const isError = internalUtil.isError; + var Debug; -const formatRegExp = /%[sdj%]/g; +function tryStringify(arg) { + try { + return JSON.stringify(arg); + } catch (_) { + return '[Circular]'; + } +} + exports.format = function(f) { if (typeof f !== 'string') { - var objects = []; - for (var i = 0; i < arguments.length; i++) { - objects.push(inspect(arguments[i])); + const objects = new Array(arguments.length); + for (var index = 0; index < arguments.length; index++) { + objects[index] = inspect(arguments[index]); } return objects.join(' '); } - if (arguments.length === 1) return f; - - var i = 1; - var args = arguments; - var len = args.length; - var str = String(f).replace(formatRegExp, function(x) { - if (x === '%%') return '%'; - if (i >= len) return x; - switch (x) { - case '%s': return String(args[i++]); - case '%d': return Number(args[i++]); - case '%j': - try { - return JSON.stringify(args[i++]); - } catch (_) { - return '[Circular]'; - } - // falls through - default: - return x; + var argLen = arguments.length; + + if (argLen === 1) return f; + + var str = ''; + var a = 1; + var lastPos = 0; + for (var i = 0; i < f.length;) { + if (f.charCodeAt(i) === 37/*'%'*/ && i + 1 < f.length) { + switch (f.charCodeAt(i + 1)) { + case 100: // 'd' + if (a >= argLen) + break; + if (lastPos < i) + str += f.slice(lastPos, i); + str += Number(arguments[a++]); + lastPos = i = i + 2; + continue; + case 106: // 'j' + if (a >= argLen) + break; + if (lastPos < i) + str += f.slice(lastPos, i); + str += tryStringify(arguments[a++]); + lastPos = i = i + 2; + continue; + case 115: // 's' + if (a >= argLen) + break; + if (lastPos < i) + str += f.slice(lastPos, i); + str += String(arguments[a++]); + lastPos = i = i + 2; + continue; + case 37: // '%' + if (lastPos < i) + str += f.slice(lastPos, i); + str += '%'; + lastPos = i = i + 2; + continue; + } } - }); - for (var x = args[i]; i < len; x = args[++i]) { + ++i; + } + if (lastPos === 0) + str = f; + else if (lastPos < f.length) + str += f.slice(lastPos); + while (a < argLen) { + const x = arguments[a++]; if (x === null || (typeof x !== 'object' && typeof x !== 'symbol')) { str += ' ' + x; } else { @@ -75,7 +111,7 @@ exports.debuglog = function(set) { /** - * Echos the value of a value. Trys to print the value out + * Echos the value of a value. Tries to print the value out * in the best way possible given the different types. * * @param {Object} obj The object to print out. @@ -159,11 +195,12 @@ function stylizeNoColor(str, styleType) { function arrayToHash(array) { - var hash = {}; + var hash = Object.create(null); - array.forEach(function(val, idx) { + for (var i = 0; i < array.length; i++) { + var val = array[i]; hash[val] = true; - }); + } return hash; } @@ -195,6 +232,7 @@ function ensureDebugIsInitialized() { function inspectPromise(p) { ensureDebugIsInitialized(); + // Only create a mirror if the object is a Promise. if (!binding.isPromise(p)) return null; const mirror = Debug.MakeMirror(p, true); @@ -250,7 +288,7 @@ function formatValue(ctx, value, recurseTimes) { if (typeof raw === 'string') { // for boxed Strings, we have to remove the 0-n indexed entries, - // since they just noisey up the output and are redundant + // since they just noisy up the output and are redundant keys = keys.filter(function(key) { return !(key >= 0 && key < raw.length); }); @@ -289,16 +327,19 @@ function formatValue(ctx, value, recurseTimes) { var constructor = getConstructorOf(value); var base = '', empty = false, braces, formatter; + // We can't compare constructors for various objects using a comparison like + // `constructor === Array` because the object could have come from a different + // context and thus the constructor won't match. Instead we check the + // constructor names (including those up the prototype chain where needed) to + // determine object types. if (Array.isArray(value)) { - // We can't use `constructor === Array` because this could - // have come from a Debug context. - // Otherwise, an Array will print "Array [...]". + // Unset the constructor to prevent "Array [...]" for ordinary arrays. if (constructor && constructor.name === 'Array') constructor = null; braces = ['[', ']']; empty = value.length === 0; formatter = formatArray; - } else if (value instanceof Set) { + } else if (binding.isSet(value)) { braces = ['{', '}']; // With `showHidden`, `length` will display as a hidden property for // arrays. For consistency's sake, do the same for `size`, even though this @@ -307,7 +348,7 @@ function formatValue(ctx, value, recurseTimes) { keys.unshift('size'); empty = value.size === 0; formatter = formatSet; - } else if (value instanceof Map) { + } else if (binding.isMap(value)) { braces = ['{', '}']; // Ditto. if (ctx.showHidden) @@ -315,8 +356,7 @@ function formatValue(ctx, value, recurseTimes) { empty = value.size === 0; formatter = formatMap; } else { - // Only create a mirror if the object superficially looks like a Promise. - var promiseInternals = value instanceof Promise && inspectPromise(value); + var promiseInternals = inspectPromise(value); if (promiseInternals) { braces = ['{', '}']; formatter = formatPromise; @@ -332,7 +372,8 @@ function formatValue(ctx, value, recurseTimes) { empty = false; formatter = formatCollectionIterator; } else { - if (constructor === Object) + // Unset the constructor to prevent "Object {...}" for ordinary objects. + if (constructor && constructor.name === 'Object') constructor = null; braces = ['{', '}']; empty = true; // No other data than keys. @@ -419,9 +460,12 @@ function formatPrimitive(ctx, value) { var type = typeof value; if (type === 'string') { - var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') - .replace(/'/g, "\\'") - .replace(/\\"/g, '"') + '\''; + var simple = '\'' + + JSON.stringify(value) + .replace(/^"|"$/g, '') + .replace(/'/g, "\\'") + .replace(/\\"/g, '"') + + '\''; return ctx.stylize(simple, 'string'); } if (type === 'number') { @@ -517,7 +561,7 @@ function formatCollectionIterator(ctx, value, recurseTimes, visibleKeys, keys) { var nextRecurseTimes = recurseTimes === null ? null : recurseTimes - 1; var vals = mirror.preview(); var output = []; - for (let o of vals) { + for (const o of vals) { output.push(formatValue(ctx, o, nextRecurseTimes)); } return output; @@ -575,13 +619,9 @@ function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { } if (str.indexOf('\n') > -1) { if (array) { - str = str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n').substr(2); + str = str.replace(/\n/g, '\n '); } else { - str = '\n' + str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n'); + str = str.replace(/(^|\n)/g, '\n '); } } } else { @@ -670,7 +710,7 @@ function isUndefined(arg) { exports.isUndefined = isUndefined; function isRegExp(re) { - return objectToString(re) === '[object RegExp]'; + return binding.isRegExp(re); } exports.isRegExp = isRegExp; @@ -680,13 +720,10 @@ function isObject(arg) { exports.isObject = isObject; function isDate(d) { - return objectToString(d) === '[object Date]'; + return binding.isDate(d); } exports.isDate = isDate; -function isError(e) { - return objectToString(e) === '[object Error]' || e instanceof Error; -} exports.isError = isError; function isFunction(arg) { @@ -702,10 +739,6 @@ exports.isPrimitive = isPrimitive; exports.isBuffer = Buffer.isBuffer; -function objectToString(o) { - return Object.prototype.toString.call(o); -} - function pad(n) { return n < 10 ? '0' + n.toString(10) : n.toString(10); @@ -761,14 +794,7 @@ exports.inherits = function(ctor, superCtor) { 'have a prototype.'); ctor.super_ = superCtor; - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); + Object.setPrototypeOf(ctor.prototype, superCtor.prototype); }; exports._extend = function(origin, add) { @@ -790,13 +816,6 @@ function hasOwnProperty(obj, prop) { // Deprecated old stuff. -exports.p = internalUtil.deprecate(function() { - for (var i = 0, len = arguments.length; i < len; ++i) { - console.error(exports.inspect(arguments[i])); - } -}, 'util.p is deprecated. Use console.error instead.'); - - exports.exec = internalUtil.deprecate(function() { return require('child_process').exec.apply(this, arguments); }, 'util.exec is deprecated. Use child_process.exec instead.'); diff --git a/lib/v8.js b/lib/v8.js index acadfa64e0650e..551b2ada98526e 100644 --- a/lib/v8.js +++ b/lib/v8.js @@ -16,9 +16,9 @@ const v8binding = process.binding('v8'); +// Properties for heap statistics buffer extraction. const heapStatisticsBuffer = new Uint32Array(v8binding.heapStatisticsArrayBuffer); - const kTotalHeapSizeIndex = v8binding.kTotalHeapSizeIndex; const kTotalHeapSizeExecutableIndex = v8binding.kTotalHeapSizeExecutableIndex; const kTotalPhysicalSizeIndex = v8binding.kTotalPhysicalSizeIndex; @@ -26,6 +26,18 @@ const kTotalAvailableSize = v8binding.kTotalAvailableSize; const kUsedHeapSizeIndex = v8binding.kUsedHeapSizeIndex; const kHeapSizeLimitIndex = v8binding.kHeapSizeLimitIndex; +// Properties for heap space statistics buffer extraction. +const heapSpaceStatisticsBuffer = + new Uint32Array(v8binding.heapSpaceStatisticsArrayBuffer); +const kHeapSpaces = v8binding.kHeapSpaces; +const kNumberOfHeapSpaces = kHeapSpaces.length; +const kHeapSpaceStatisticsPropertiesCount = + v8binding.kHeapSpaceStatisticsPropertiesCount; +const kSpaceSizeIndex = v8binding.kSpaceSizeIndex; +const kSpaceUsedSizeIndex = v8binding.kSpaceUsedSizeIndex; +const kSpaceAvailableSizeIndex = v8binding.kSpaceAvailableSizeIndex; +const kPhysicalSpaceSizeIndex = v8binding.kPhysicalSpaceSizeIndex; + exports.getHeapStatistics = function() { const buffer = heapStatisticsBuffer; @@ -42,3 +54,22 @@ exports.getHeapStatistics = function() { }; exports.setFlagsFromString = v8binding.setFlagsFromString; + +exports.getHeapSpaceStatistics = function() { + const heapSpaceStatistics = new Array(kNumberOfHeapSpaces); + const buffer = heapSpaceStatisticsBuffer; + v8binding.updateHeapSpaceStatisticsArrayBuffer(); + + for (let i = 0; i < kNumberOfHeapSpaces; i++) { + const propertyOffset = i * kHeapSpaceStatisticsPropertiesCount; + heapSpaceStatistics[i] = { + space_name: kHeapSpaces[i], + space_size: buffer[propertyOffset + kSpaceSizeIndex], + space_used_size: buffer[propertyOffset + kSpaceUsedSizeIndex], + space_available_size: buffer[propertyOffset + kSpaceAvailableSizeIndex], + physical_space_size: buffer[propertyOffset + kPhysicalSpaceSizeIndex] + }; + } + + return heapSpaceStatistics; +}; diff --git a/lib/zlib.js b/lib/zlib.js index a10d9118d6194e..d5c82f2fbba9ab 100644 --- a/lib/zlib.js +++ b/lib/zlib.js @@ -6,8 +6,8 @@ const binding = process.binding('zlib'); const util = require('util'); const assert = require('assert').ok; const kMaxLength = require('buffer').kMaxLength; -const kRangeErrorMessage = 'Cannot create final Buffer. ' + - 'It would be larger than 0x' + kMaxLength.toString(16) + ' bytes.'; +const kRangeErrorMessage = 'Cannot create final Buffer. It would be larger ' + + 'than 0x' + kMaxLength.toString(16) + ' bytes'; // zlib doesn't provide these, so kludge them in following the same // const naming scheme zlib uses. @@ -234,7 +234,7 @@ function zlibBufferSync(engine, buffer) { if (!(buffer instanceof Buffer)) throw new TypeError('Not a string or buffer'); - var flushFlag = binding.Z_FINISH; + var flushFlag = engine._finishFlushFlag; return engine._processChunk(buffer, flushFlag); } @@ -282,6 +282,14 @@ function Unzip(opts) { Zlib.call(this, opts, binding.UNZIP); } +function isValidFlushFlag(flag) { + return flag === binding.Z_NO_FLUSH || + flag === binding.Z_PARTIAL_FLUSH || + flag === binding.Z_SYNC_FLUSH || + flag === binding.Z_FULL_FLUSH || + flag === binding.Z_FINISH || + flag === binding.Z_BLOCK; +} // the Zlib class they all inherit from // This thing manages the queue of requests, and returns @@ -294,17 +302,16 @@ function Zlib(opts, mode) { Transform.call(this, opts); - if (opts.flush) { - if (opts.flush !== binding.Z_NO_FLUSH && - opts.flush !== binding.Z_PARTIAL_FLUSH && - opts.flush !== binding.Z_SYNC_FLUSH && - opts.flush !== binding.Z_FULL_FLUSH && - opts.flush !== binding.Z_FINISH && - opts.flush !== binding.Z_BLOCK) { - throw new Error('Invalid flush flag: ' + opts.flush); - } + if (opts.flush && !isValidFlushFlag(opts.flush)) { + throw new Error('Invalid flush flag: ' + opts.flush); } + if (opts.finishFlush && !isValidFlushFlag(opts.finishFlush)) { + throw new Error('Invalid flush flag: ' + opts.finishFlush); + } + this._flushFlag = opts.flush || binding.Z_NO_FLUSH; + this._finishFlushFlag = typeof opts.finishFlush !== 'undefined' ? + opts.finishFlush : binding.Z_FINISH; if (opts.chunkSize) { if (opts.chunkSize < exports.Z_MIN_CHUNK || @@ -444,10 +451,9 @@ Zlib.prototype.flush = function(kind, callback) { if (callback) this.once('end', callback); } else if (ws.needDrain) { - var self = this; - this.once('drain', function() { - self.flush(callback); - }); + if (callback) { + this.once('drain', () => this.flush(kind, callback)); + } } else { this._flushFlag = kind; this.write(new Buffer(0), '', callback); @@ -463,7 +469,9 @@ Zlib.prototype.close = function(callback) { this._closed = true; - this._handle.close(); + if (this._handle) { + this._handle.close(); + } process.nextTick(emitCloseNT, this); }; @@ -484,12 +492,13 @@ Zlib.prototype._transform = function(chunk, encoding, cb) { if (this._closed) return cb(new Error('zlib binding closed')); - // If it's the last chunk, or a final flush, we use the Z_FINISH flush flag. + // If it's the last chunk, or a final flush, we use the Z_FINISH flush flag + // (or whatever flag was provided using opts.finishFlush). // If it's explicitly flushing at some other time, then we use // Z_FULL_FLUSH. Otherwise, use Z_NO_FLUSH for maximum compression // goodness. if (last) - flushFlag = binding.Z_FINISH; + flushFlag = this._finishFlushFlag; else { flushFlag = this._flushFlag; // once we've flushed the last of the queue, stop flushing and diff --git a/node.gyp b/node.gyp index b35c8a508a7589..e689a71f70df4a 100644 --- a/node.gyp +++ b/node.gyp @@ -5,16 +5,18 @@ 'node_use_lttng%': 'false', 'node_use_etw%': 'false', 'node_use_perfctr%': 'false', - 'node_has_winsdk%': 'false', + 'node_no_browser_globals%': 'false', 'node_shared_zlib%': 'false', 'node_shared_http_parser%': 'false', 'node_shared_libuv%': 'false', 'node_use_openssl%': 'true', 'node_shared_openssl%': 'false', 'node_v8_options%': '', + 'node_enable_v8_vtunejit%': 'false', 'node_target_type%': 'executable', + 'node_core_target_name%': 'node', 'library_files': [ - 'src/node.js', + 'lib/internal/bootstrap_node.js', 'lib/_debug_agent.js', 'lib/_debugger.js', 'lib/assert.js', @@ -69,19 +71,37 @@ 'lib/vm.js', 'lib/zlib.js', 'lib/internal/child_process.js', + 'lib/internal/cluster.js', 'lib/internal/freelist.js', 'lib/internal/linkedlist.js', + 'lib/internal/net.js', 'lib/internal/module.js', + 'lib/internal/process/next_tick.js', + 'lib/internal/process/promises.js', + 'lib/internal/process/stdio.js', + 'lib/internal/process.js', 'lib/internal/repl.js', 'lib/internal/socket_list.js', 'lib/internal/util.js', + 'lib/internal/v8_prof_polyfill.js', + 'lib/internal/v8_prof_processor.js', 'lib/internal/streams/lazy_transform.js', + 'deps/v8/tools/splaytree.js', + 'deps/v8/tools/codemap.js', + 'deps/v8/tools/consarray.js', + 'deps/v8/tools/csvparser.js', + 'deps/v8/tools/profile.js', + 'deps/v8/tools/profile_view.js', + 'deps/v8/tools/logreader.js', + 'deps/v8/tools/tickprocessor.js', + 'deps/v8/tools/SourceMap.js', + 'deps/v8/tools/tickprocessor-driver.js', ], }, 'targets': [ { - 'target_name': 'node', + 'target_name': '<(node_core_target_name)', 'type': '<(node_target_type)', 'dependencies': [ @@ -116,6 +136,7 @@ 'src/node_javascript.cc', 'src/node_main.cc', 'src/node_os.cc', + 'src/node_revert.cc', 'src/node_util.cc', 'src/node_v8.cc', 'src/node_stat_watcher.cc', @@ -155,6 +176,7 @@ 'src/node_version.h', 'src/node_watchdog.h', 'src/node_wrap.h', + 'src/node_revert.h', 'src/node_i18n.h', 'src/pipe_wrap.h', 'src/tty_wrap.h', @@ -219,6 +241,13 @@ 'defines': [ 'NODE_HAVE_SMALL_ICU=1' ], }]], }], + [ 'node_enable_v8_vtunejit=="true" and (target_arch=="x64" or \ + target_arch=="ia32" or target_arch=="x32")', { + 'defines': [ 'NODE_ENABLE_VTUNE_PROFILING' ], + 'dependencies': [ + 'deps/v8/src/third_party/vtune/v8vtune.gyp:v8_vtune' + ], + }], [ 'node_use_openssl=="true"', { 'defines': [ 'HAVE_OPENSSL=1' ], 'sources': [ @@ -337,6 +366,9 @@ 'tools/msvs/genfiles/node_perfctr_provider.rc', ] } ], + [ 'node_no_browser_globals=="true"', { + 'defines': [ 'NODE_NO_BROWSER_GLOBALS' ], + } ], [ 'v8_postmortem_support=="true"', { 'dependencies': [ 'deps/v8/tools/gyp/v8.gyp:postmortem-metadata' ], 'conditions': [ @@ -437,7 +469,7 @@ 'target_name': 'node_etw', 'type': 'none', 'conditions': [ - [ 'node_use_etw=="true" and node_has_winsdk=="true"', { + [ 'node_use_etw=="true"', { 'actions': [ { 'action_name': 'node_etw', @@ -458,7 +490,7 @@ 'target_name': 'node_perfctr', 'type': 'none', 'conditions': [ - [ 'node_use_perfctr=="true" and node_has_winsdk=="true"', { + [ 'node_use_perfctr=="true"', { 'actions': [ { 'action_name': 'node_perfctr_man', @@ -503,7 +535,7 @@ }] ], 'action': [ - '<(python)', + 'python', 'tools/js2c.py', '<@(_outputs)', '<@(_inputs)', @@ -673,5 +705,53 @@ 'test/cctest/util.cc', ], } - ] # end targets + ], # end targets + + 'conditions': [ + ['OS=="aix"', { + 'targets': [ + { + 'target_name': 'node', + 'type': 'executable', + 'dependencies': ['<(node_core_target_name)', 'node_exp'], + + 'include_dirs': [ + 'src', + 'deps/v8/include', + ], + + 'sources': [ + 'src/node_main.cc', + '<@(library_files)', + # node.gyp is added to the project by default. + 'common.gypi', + ], + + 'ldflags': ['-Wl,-bbigtoc,-bE:<(PRODUCT_DIR)/node.exp'], + }, + { + 'target_name': 'node_exp', + 'type': 'none', + 'dependencies': [ + '<(node_core_target_name)', + ], + 'actions': [ + { + 'action_name': 'expfile', + 'inputs': [ + '<(OBJ_DIR)' + ], + 'outputs': [ + '<(PRODUCT_DIR)/node.exp' + ], + 'action': [ + 'sh', 'tools/create_expfile.sh', + '<@(_inputs)', '<@(_outputs)' + ], + } + ] + } + ], # end targets + }], # end aix section + ], # end conditions block } diff --git a/src/async-wrap-inl.h b/src/async-wrap-inl.h index cac8175889dfbf..cf7024e7e31461 100644 --- a/src/async-wrap-inl.h +++ b/src/async-wrap-inl.h @@ -17,7 +17,8 @@ inline AsyncWrap::AsyncWrap(Environment* env, v8::Local object, ProviderType provider, AsyncWrap* parent) - : BaseObject(env, object), bits_(static_cast(provider) << 1) { + : BaseObject(env, object), bits_(static_cast(provider) << 1), + uid_(env->get_async_wrap_uid()) { CHECK_NE(provider, PROVIDER_NONE); CHECK_GE(object->InternalFieldCount(), 1); @@ -39,23 +40,50 @@ inline AsyncWrap::AsyncWrap(Environment* env, v8::HandleScope scope(env->isolate()); v8::Local argv[] = { + v8::Integer::New(env->isolate(), get_uid()), v8::Int32::New(env->isolate(), provider), + Null(env->isolate()), Null(env->isolate()) }; - if (parent != nullptr) - argv[1] = parent->object(); + if (parent != nullptr) { + argv[2] = v8::Integer::New(env->isolate(), parent->get_uid()); + argv[3] = parent->object(); + } + + v8::TryCatch try_catch(env->isolate()); v8::MaybeLocal ret = - init_fn->Call(env->context(), object, ARRAY_SIZE(argv), argv); + init_fn->Call(env->context(), object, arraysize(argv), argv); - if (ret.IsEmpty()) - FatalError("node::AsyncWrap::AsyncWrap", "init hook threw"); + if (ret.IsEmpty()) { + ClearFatalExceptionHandlers(env); + FatalException(env->isolate(), try_catch); + } bits_ |= 1; // ran_init_callback() is true now. } +inline AsyncWrap::~AsyncWrap() { + if (!ran_init_callback()) + return; + + v8::Local fn = env()->async_hooks_destroy_function(); + if (!fn.IsEmpty()) { + v8::HandleScope scope(env()->isolate()); + v8::Local uid = v8::Integer::New(env()->isolate(), get_uid()); + v8::TryCatch try_catch(env()->isolate()); + v8::MaybeLocal ret = + fn->Call(env()->context(), v8::Null(env()->isolate()), 1, &uid); + if (ret.IsEmpty()) { + ClearFatalExceptionHandlers(env()); + FatalException(env()->isolate(), try_catch); + } + } +} + + inline bool AsyncWrap::ran_init_callback() const { return static_cast(bits_ & 1); } @@ -66,6 +94,11 @@ inline AsyncWrap::ProviderType AsyncWrap::provider_type() const { } +inline int64_t AsyncWrap::get_uid() const { + return uid_; +} + + inline v8::Local AsyncWrap::MakeCallback( const v8::Local symbol, int argc, diff --git a/src/async-wrap.cc b/src/async-wrap.cc index 4f27e5116dca8d..8129500a922d97 100644 --- a/src/async-wrap.cc +++ b/src/async-wrap.cc @@ -9,6 +9,7 @@ #include "v8-profiler.h" using v8::Array; +using v8::Boolean; using v8::Context; using v8::Function; using v8::FunctionCallbackInfo; @@ -17,6 +18,7 @@ using v8::HeapProfiler; using v8::Integer; using v8::Isolate; using v8::Local; +using v8::MaybeLocal; using v8::Object; using v8::RetainedObjectInfo; using v8::TryCatch; @@ -103,6 +105,9 @@ RetainedObjectInfo* WrapperInfo(uint16_t class_id, Local wrapper) { static void EnableHooksJS(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); + Local init_fn = env->async_hooks_init_function(); + if (init_fn.IsEmpty() || !init_fn->IsFunction()) + return env->ThrowTypeError("init callback is not assigned to a function"); env->async_hooks()->set_enable_callbacks(1); } @@ -116,13 +121,37 @@ static void DisableHooksJS(const FunctionCallbackInfo& args) { static void SetupHooks(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); - CHECK(args[0]->IsFunction()); - CHECK(args[1]->IsFunction()); - CHECK(args[2]->IsFunction()); - - env->set_async_hooks_init_function(args[0].As()); - env->set_async_hooks_pre_function(args[1].As()); - env->set_async_hooks_post_function(args[2].As()); + if (env->async_hooks()->callbacks_enabled()) + return env->ThrowError("hooks should not be set while also enabled"); + if (!args[0]->IsObject()) + return env->ThrowTypeError("first argument must be an object"); + + Local fn_obj = args[0].As(); + + Local init_v = fn_obj->Get( + env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "init")).ToLocalChecked(); + Local pre_v = fn_obj->Get( + env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "pre")).ToLocalChecked(); + Local post_v = fn_obj->Get( + env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "post")).ToLocalChecked(); + Local destroy_v = fn_obj->Get( + env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "destroy")).ToLocalChecked(); + + if (!init_v->IsFunction()) + return env->ThrowTypeError("init callback must be a function"); + + env->set_async_hooks_init_function(init_v.As()); + + if (pre_v->IsFunction()) + env->set_async_hooks_pre_function(pre_v.As()); + if (post_v->IsFunction()) + env->set_async_hooks_post_function(post_v.As()); + if (destroy_v->IsFunction()) + env->set_async_hooks_destroy_function(destroy_v.As()); } @@ -148,6 +177,7 @@ static void Initialize(Local target, env->set_async_hooks_init_function(Local()); env->set_async_hooks_pre_function(Local()); env->set_async_hooks_post_function(Local()); + env->set_async_hooks_destroy_function(Local()); } @@ -162,94 +192,97 @@ void LoadAsyncWrapperInfo(Environment* env) { Local AsyncWrap::MakeCallback(const Local cb, - int argc, - Local* argv) { + int argc, + Local* argv) { CHECK(env()->context() == env()->isolate()->GetCurrentContext()); Local pre_fn = env()->async_hooks_pre_function(); Local post_fn = env()->async_hooks_post_function(); + Local uid = Integer::New(env()->isolate(), get_uid()); Local context = object(); - Local process = env()->process_object(); Local domain; bool has_domain = false; + Environment::AsyncCallbackScope callback_scope(env()); + if (env()->using_domains()) { Local domain_v = context->Get(env()->domain_string()); has_domain = domain_v->IsObject(); if (has_domain) { domain = domain_v.As(); if (domain->Get(env()->disposed_string())->IsTrue()) - return Undefined(env()->isolate()); + return Local(); } } - TryCatch try_catch(env()->isolate()); - try_catch.SetVerbose(true); - if (has_domain) { Local enter_v = domain->Get(env()->enter_string()); if (enter_v->IsFunction()) { - enter_v.As()->Call(domain, 0, nullptr); - if (try_catch.HasCaught()) - return Undefined(env()->isolate()); + if (enter_v.As()->Call(domain, 0, nullptr).IsEmpty()) { + FatalError("node::AsyncWrap::MakeCallback", + "domain enter callback threw, please report this"); + } } } if (ran_init_callback() && !pre_fn.IsEmpty()) { - try_catch.SetVerbose(false); - pre_fn->Call(context, 0, nullptr); - if (try_catch.HasCaught()) - FatalError("node::AsyncWrap::MakeCallback", "pre hook threw"); - try_catch.SetVerbose(true); + TryCatch try_catch(env()->isolate()); + MaybeLocal ar = pre_fn->Call(env()->context(), context, 1, &uid); + if (ar.IsEmpty()) { + ClearFatalExceptionHandlers(env()); + FatalException(env()->isolate(), try_catch); + return Local(); + } } Local ret = cb->Call(context, argc, argv); - if (try_catch.HasCaught()) { - return Undefined(env()->isolate()); + if (ran_init_callback() && !post_fn.IsEmpty()) { + Local did_throw = Boolean::New(env()->isolate(), ret.IsEmpty()); + Local vals[] = { uid, did_throw }; + TryCatch try_catch(env()->isolate()); + MaybeLocal ar = + post_fn->Call(env()->context(), context, arraysize(vals), vals); + if (ar.IsEmpty()) { + ClearFatalExceptionHandlers(env()); + FatalException(env()->isolate(), try_catch); + return Local(); + } } - if (ran_init_callback() && !post_fn.IsEmpty()) { - try_catch.SetVerbose(false); - post_fn->Call(context, 0, nullptr); - if (try_catch.HasCaught()) - FatalError("node::AsyncWrap::MakeCallback", "post hook threw"); - try_catch.SetVerbose(true); + if (ret.IsEmpty()) { + return ret; } if (has_domain) { Local exit_v = domain->Get(env()->exit_string()); if (exit_v->IsFunction()) { - exit_v.As()->Call(domain, 0, nullptr); - if (try_catch.HasCaught()) - return Undefined(env()->isolate()); + if (exit_v.As()->Call(domain, 0, nullptr).IsEmpty()) { + FatalError("node::AsyncWrap::MakeCallback", + "domain exit callback threw, please report this"); + } } } - Environment::TickInfo* tick_info = env()->tick_info(); - - if (tick_info->in_tick()) { + if (callback_scope.in_makecallback()) { return ret; } + Environment::TickInfo* tick_info = env()->tick_info(); + if (tick_info->length() == 0) { env()->isolate()->RunMicrotasks(); } + Local process = env()->process_object(); + if (tick_info->length() == 0) { tick_info->set_index(0); return ret; } - tick_info->set_in_tick(true); - - env()->tick_callback_function()->Call(process, 0, nullptr); - - tick_info->set_in_tick(false); - - if (try_catch.HasCaught()) { - tick_info->set_last_threw(true); - return Undefined(env()->isolate()); + if (env()->tick_callback_function()->Call(process, 0, nullptr).IsEmpty()) { + return Local(); } return ret; diff --git a/src/async-wrap.h b/src/async-wrap.h index 330f3454f42d2c..cb0c9e211a8923 100644 --- a/src/async-wrap.h +++ b/src/async-wrap.h @@ -17,6 +17,7 @@ namespace node { V(FSREQWRAP) \ V(GETADDRINFOREQWRAP) \ V(GETNAMEINFOREQWRAP) \ + V(HTTPPARSER) \ V(JSSTREAM) \ V(PIPEWRAP) \ V(PIPECONNECTWRAP) \ @@ -51,10 +52,12 @@ class AsyncWrap : public BaseObject { ProviderType provider, AsyncWrap* parent = nullptr); - inline virtual ~AsyncWrap() override = default; + inline virtual ~AsyncWrap(); inline ProviderType provider_type() const; + inline int64_t get_uid() const; + // Only call these within a valid HandleScope. v8::Local MakeCallback(const v8::Local cb, int argc, @@ -76,6 +79,7 @@ class AsyncWrap : public BaseObject { // expected the context object will receive a _asyncQueue object property // that will be used to call pre/post in MakeCallback. uint32_t bits_; + const int64_t uid_; }; void LoadAsyncWrapperInfo(Environment* env); diff --git a/src/atomic-polyfill.h b/src/atomic-polyfill.h new file mode 100644 index 00000000000000..1c5f414fa13a81 --- /dev/null +++ b/src/atomic-polyfill.h @@ -0,0 +1,18 @@ +#ifndef SRC_ATOMIC_POLYFILL_H_ +#define SRC_ATOMIC_POLYFILL_H_ + +#include "util.h" + +namespace nonstd { + +template +struct atomic { + atomic() = default; + T exchange(T value) { return __sync_lock_test_and_set(&value_, value); } + T value_ = T(); + DISALLOW_COPY_AND_ASSIGN(atomic); +}; + +} // namespace nonstd + +#endif // SRC_ATOMIC_POLYFILL_H_ diff --git a/src/base-object.h b/src/base-object.h index 5a7b95827e8f11..4142b7e9b33080 100644 --- a/src/base-object.h +++ b/src/base-object.h @@ -9,8 +9,8 @@ class Environment; class BaseObject { public: - BaseObject(Environment* env, v8::Local handle); - virtual ~BaseObject(); + inline BaseObject(Environment* env, v8::Local handle); + inline virtual ~BaseObject(); // Returns the wrapped object. Returns an empty handle when // persistent.IsEmpty() is true. diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc index b004e67c4e8479..50ec19cb179af7 100644 --- a/src/cares_wrap.cc +++ b/src/cares_wrap.cc @@ -310,7 +310,7 @@ class QueryWrap : public AsyncWrap { Integer::New(env()->isolate(), 0), answer }; - MakeCallback(env()->oncomplete_string(), ARRAY_SIZE(argv), argv); + MakeCallback(env()->oncomplete_string(), arraysize(argv), argv); } void CallOnComplete(Local answer, Local family) { @@ -321,7 +321,7 @@ class QueryWrap : public AsyncWrap { answer, family }; - MakeCallback(env()->oncomplete_string(), ARRAY_SIZE(argv), argv); + MakeCallback(env()->oncomplete_string(), arraysize(argv), argv); } void ParseError(int status) { @@ -607,9 +607,9 @@ class QueryTxtWrap: public QueryWrap { void Parse(unsigned char* buf, int len) override { HandleScope handle_scope(env()->isolate()); Context::Scope context_scope(env()->context()); - struct ares_txt_reply* txt_out; + struct ares_txt_ext* txt_out; - int status = ares_parse_txt_reply(buf, len, &txt_out); + int status = ares_parse_txt_reply_ext(buf, len, &txt_out); if (status != ARES_SUCCESS) { ParseError(status); return; @@ -618,7 +618,7 @@ class QueryTxtWrap: public QueryWrap { Local txt_records = Array::New(env()->isolate()); Local txt_chunk; - ares_txt_reply* current = txt_out; + struct ares_txt_ext* current = txt_out; uint32_t i = 0; for (uint32_t j = 0; current != nullptr; current = current->next) { Local txt = OneByteString(env()->isolate(), current->txt); @@ -922,19 +922,12 @@ void AfterGetAddrInfo(uv_getaddrinfo_t* req, int status, struct addrinfo* res) { struct addrinfo *address; int n = 0; - // Count the number of responses. - for (address = res; address; address = address->ai_next) { - n++; - } - // Create the response array. - Local results = Array::New(env->isolate(), n); + Local results = Array::New(env->isolate()); char ip[INET6_ADDRSTRLEN]; const char *addr; - n = 0; - // Iterate over the IPv4 responses again this time creating javascript // strings for each IP and filling the results array. address = res; @@ -990,6 +983,10 @@ void AfterGetAddrInfo(uv_getaddrinfo_t* req, int status, struct addrinfo* res) { address = address->ai_next; } + // No responses were found to return + if (n == 0) { + argv[0] = Integer::New(env->isolate(), UV_EAI_NODATA); + } argv[1] = results; } @@ -997,7 +994,7 @@ void AfterGetAddrInfo(uv_getaddrinfo_t* req, int status, struct addrinfo* res) { uv_freeaddrinfo(res); // Make the callback into JavaScript - req_wrap->MakeCallback(env->oncomplete_string(), ARRAY_SIZE(argv), argv); + req_wrap->MakeCallback(env->oncomplete_string(), arraysize(argv), argv); delete req_wrap; } @@ -1028,7 +1025,7 @@ void AfterGetNameInfo(uv_getnameinfo_t* req, } // Make the callback into JavaScript - req_wrap->MakeCallback(env->oncomplete_string(), ARRAY_SIZE(argv), argv); + req_wrap->MakeCallback(env->oncomplete_string(), arraysize(argv), argv); delete req_wrap; } @@ -1047,6 +1044,27 @@ static void IsIP(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(rc); } +static void IsIPv4(const FunctionCallbackInfo& args) { + node::Utf8Value ip(args.GetIsolate(), args[0]); + char address_buffer[sizeof(struct in_addr)]; + + if (uv_inet_pton(AF_INET, *ip, &address_buffer) == 0) { + args.GetReturnValue().Set(true); + } else { + args.GetReturnValue().Set(false); + } +} + +static void IsIPv6(const FunctionCallbackInfo& args) { + node::Utf8Value ip(args.GetIsolate(), args[0]); + char address_buffer[sizeof(struct in6_addr)]; + + if (uv_inet_pton(AF_INET6, *ip, &address_buffer) == 0) { + args.GetReturnValue().Set(true); + } else { + args.GetReturnValue().Set(false); + } +} static void GetAddrInfo(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -1286,6 +1304,8 @@ static void Initialize(Local target, env->SetMethod(target, "getaddrinfo", GetAddrInfo); env->SetMethod(target, "getnameinfo", GetNameInfo); env->SetMethod(target, "isIP", IsIP); + env->SetMethod(target, "isIPv4", IsIPv4); + env->SetMethod(target, "isIPv6", IsIPv6); env->SetMethod(target, "strerror", StrError); env->SetMethod(target, "getServers", GetServers); diff --git a/src/debug-agent.cc b/src/debug-agent.cc index 3409fb2603ae9b..df6e75d07ff38c 100644 --- a/src/debug-agent.cc +++ b/src/debug-agent.cc @@ -22,7 +22,7 @@ #include "debug-agent.h" #include "node.h" -#include "node_internals.h" // ARRAY_SIZE +#include "node_internals.h" // arraysize #include "env.h" #include "env-inl.h" #include "v8.h" @@ -175,9 +175,9 @@ void Agent::WorkerRun() { isolate, &child_loop_, context, - ARRAY_SIZE(argv), + arraysize(argv), argv, - ARRAY_SIZE(argv), + arraysize(argv), argv); child_env_ = env; @@ -285,7 +285,6 @@ void Agent::ChildSignalCb(uv_async_t* signal) { } // Waiting for client, do not send anything just yet - // TODO(indutny): move this to js-land if (a->wait_) { a->messages_.PushFront(msg); // Push message back into the ready queue. break; @@ -302,7 +301,7 @@ void Agent::ChildSignalCb(uv_async_t* signal) { MakeCallback(isolate, api, "onmessage", - ARRAY_SIZE(argv), + arraysize(argv), argv); delete msg; } @@ -321,6 +320,8 @@ void Agent::EnqueueMessage(AgentMessage* message) { void Agent::MessageHandler(const v8::Debug::Message& message) { Isolate* isolate = message.GetIsolate(); Environment* env = Environment::GetCurrent(isolate); + if (env == nullptr) + return; // Called from a non-node context. Agent* a = env->debugger_agent(); CHECK_NE(a, nullptr); CHECK_EQ(isolate, a->parent_env()->isolate()); diff --git a/src/debug-agent.h b/src/debug-agent.h index f18683a8287f39..0c465b8e1b6996 100644 --- a/src/debug-agent.h +++ b/src/debug-agent.h @@ -109,7 +109,6 @@ class Agent { kRunning }; - // TODO(indutny): Verify that there are no races State state_; int port_; diff --git a/src/env-inl.h b/src/env-inl.h index 2d965f9a519232..05636e7d76a654 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -88,6 +88,19 @@ inline void Environment::AsyncHooks::set_enable_callbacks(uint32_t flag) { fields_[kEnableCallbacks] = flag; } +inline Environment::AsyncCallbackScope::AsyncCallbackScope(Environment* env) + : env_(env) { + env_->makecallback_cntr_++; +} + +inline Environment::AsyncCallbackScope::~AsyncCallbackScope() { + env_->makecallback_cntr_--; +} + +inline bool Environment::AsyncCallbackScope::in_makecallback() { + return env_->makecallback_cntr_ > 1; +} + inline Environment::DomainFlag::DomainFlag() { for (int i = 0; i < kFieldsCount; ++i) fields_[i] = 0; } @@ -104,7 +117,7 @@ inline uint32_t Environment::DomainFlag::count() const { return fields_[kCount]; } -inline Environment::TickInfo::TickInfo() : in_tick_(false), last_threw_(false) { +inline Environment::TickInfo::TickInfo() { for (int i = 0; i < kFieldsCount; ++i) fields_[i] = 0; } @@ -117,34 +130,18 @@ inline int Environment::TickInfo::fields_count() const { return kFieldsCount; } -inline bool Environment::TickInfo::in_tick() const { - return in_tick_; -} - inline uint32_t Environment::TickInfo::index() const { return fields_[kIndex]; } -inline bool Environment::TickInfo::last_threw() const { - return last_threw_; -} - inline uint32_t Environment::TickInfo::length() const { return fields_[kLength]; } -inline void Environment::TickInfo::set_in_tick(bool value) { - in_tick_ = value; -} - inline void Environment::TickInfo::set_index(uint32_t value) { fields_[kIndex] = value; } -inline void Environment::TickInfo::set_last_threw(bool value) { - last_threw_ = value; -} - inline Environment::ArrayBufferAllocatorInfo::ArrayBufferAllocatorInfo() { for (int i = 0; i < kFieldsCount; ++i) fields_[i] = 0; @@ -210,6 +207,8 @@ inline Environment::Environment(v8::Local context, using_domains_(false), printed_error_(false), trace_sync_io_(false), + makecallback_cntr_(0), + async_wrap_uid_(0), debugger_agent_(this), http_parser_buffer_(nullptr), context_(context->GetIsolate(), context) { @@ -241,6 +240,7 @@ inline Environment::~Environment() { isolate_data()->Put(); delete[] heap_statistics_buffer_; + delete[] heap_space_statistics_buffer_; delete[] http_parser_buffer_; } @@ -359,6 +359,10 @@ inline void Environment::set_trace_sync_io(bool value) { trace_sync_io_ = value; } +inline int64_t Environment::get_async_wrap_uid() { + return ++async_wrap_uid_; +} + inline uint32_t* Environment::heap_statistics_buffer() const { CHECK_NE(heap_statistics_buffer_, nullptr); return heap_statistics_buffer_; @@ -369,6 +373,17 @@ inline void Environment::set_heap_statistics_buffer(uint32_t* pointer) { heap_statistics_buffer_ = pointer; } +inline uint32_t* Environment::heap_space_statistics_buffer() const { + CHECK_NE(heap_space_statistics_buffer_, nullptr); + return heap_space_statistics_buffer_; +} + +inline void Environment::set_heap_space_statistics_buffer(uint32_t* pointer) { + CHECK_EQ(heap_space_statistics_buffer_, nullptr); // Should be set only once. + heap_space_statistics_buffer_ = pointer; +} + + inline char* Environment::http_parser_buffer() const { return http_parser_buffer_; } diff --git a/src/env.cc b/src/env.cc index e28866efd06894..8ba72ac2e0023e 100644 --- a/src/env.cc +++ b/src/env.cc @@ -1,6 +1,13 @@ #include "env.h" #include "env-inl.h" #include "v8.h" + +#if defined(_MSC_VER) +#define getpid GetCurrentProcessId +#else +#include +#endif + #include namespace node { @@ -11,6 +18,7 @@ using v8::Message; using v8::StackFrame; using v8::StackTrace; using v8::TryCatch; +using v8::Value; void Environment::PrintSyncTrace() const { if (!trace_sync_io_) @@ -56,38 +64,4 @@ void Environment::PrintSyncTrace() const { fflush(stderr); } - -bool Environment::KickNextTick() { - TickInfo* info = tick_info(); - - if (info->in_tick()) { - return true; - } - - if (info->length() == 0) { - isolate()->RunMicrotasks(); - } - - if (info->length() == 0) { - info->set_index(0); - return true; - } - - info->set_in_tick(true); - - // process nextTicks after call - TryCatch try_catch; - try_catch.SetVerbose(true); - tick_callback_function()->Call(process_object(), 0, nullptr); - - info->set_in_tick(false); - - if (try_catch.HasCaught()) { - info->set_last_threw(true); - return false; - } - - return true; -} - } // namespace node diff --git a/src/env.h b/src/env.h index 97652146fabf0d..980e8124323de4 100644 --- a/src/env.h +++ b/src/env.h @@ -38,10 +38,17 @@ namespace node { #define NODE_ISOLATE_SLOT 3 #endif +// The number of items passed to push_values_to_array_function has diminishing +// returns around 8. This should be used at all call sites using said function. +#ifndef NODE_PUSH_VAL_TO_ARRAY_MAX +#define NODE_PUSH_VAL_TO_ARRAY_MAX 8 +#endif + // Strings are per-isolate primitives but Environment proxies them // for the sake of convenience. Strings should be ASCII-only. #define PER_ISOLATE_STRING_PROPERTIES(V) \ V(address_string, "address") \ + V(alpn_buffer_string, "alpnBuffer") \ V(args_string, "args") \ V(argv_string, "argv") \ V(arrow_message_string, "arrowMessage") \ @@ -54,6 +61,10 @@ namespace node { V(buffer_string, "buffer") \ V(bytes_string, "bytes") \ V(bytes_parsed_string, "bytesParsed") \ + V(bytes_read_string, "bytesRead") \ + V(cached_data_string, "cachedData") \ + V(cached_data_produced_string, "cachedDataProduced") \ + V(cached_data_rejected_string, "cachedDataRejected") \ V(callback_string, "callback") \ V(change_string, "change") \ V(oncertcb_string, "oncertcb") \ @@ -130,6 +141,7 @@ namespace node { V(netmask_string, "netmask") \ V(nice_string, "nice") \ V(nlink_string, "nlink") \ + V(npn_buffer_string, "npnBuffer") \ V(nsname_string, "nsname") \ V(ocsp_request_string, "OCSPRequest") \ V(offset_string, "offset") \ @@ -166,6 +178,7 @@ namespace node { V(preference_string, "preference") \ V(priority_string, "priority") \ V(processed_string, "processed") \ + V(produce_cached_data_string, "produceCachedData") \ V(prototype_string, "prototype") \ V(raw_string, "raw") \ V(rdev_string, "rdev") \ @@ -180,6 +193,7 @@ namespace node { V(serial_string, "serial") \ V(scavenge_string, "scavenge") \ V(scopeid_string, "scopeid") \ + V(selected_npn_buffer_string, "selectedNpnBuffer") \ V(sent_shutdown_string, "sentShutdown") \ V(serial_number_string, "serialNumber") \ V(service_string, "service") \ @@ -205,6 +219,7 @@ namespace node { V(timestamp_string, "timestamp") \ V(title_string, "title") \ V(tls_npn_string, "tls_npn") \ + V(tls_alpn_string, "tls_alpn") \ V(tls_ocsp_string, "tls_ocsp") \ V(tls_sni_string, "tls_sni") \ V(tls_string, "tls") \ @@ -228,14 +243,16 @@ namespace node { #define ENVIRONMENT_STRONG_PERSISTENT_PROPERTIES(V) \ V(as_external, v8::External) \ + V(async_hooks_destroy_function, v8::Function) \ V(async_hooks_init_function, v8::Function) \ - V(async_hooks_pre_function, v8::Function) \ V(async_hooks_post_function, v8::Function) \ + V(async_hooks_pre_function, v8::Function) \ V(binding_cache_object, v8::Object) \ V(buffer_constructor_function, v8::Function) \ V(buffer_prototype_object, v8::Object) \ V(context, v8::Context) \ V(domain_array, v8::Array) \ + V(domains_stack_array, v8::Array) \ V(fs_stats_constructor_function, v8::Function) \ V(generic_internal_field_template, v8::ObjectTemplate) \ V(jsstream_constructor_template, v8::FunctionTemplate) \ @@ -243,6 +260,7 @@ namespace node { V(pipe_constructor_template, v8::FunctionTemplate) \ V(process_object, v8::Object) \ V(promise_reject_function, v8::Function) \ + V(push_values_to_array_function, v8::Function) \ V(script_context_constructor_template, v8::FunctionTemplate) \ V(script_data_constructor_function, v8::Function) \ V(secure_context_constructor_template, v8::FunctionTemplate) \ @@ -291,6 +309,19 @@ class Environment { DISALLOW_COPY_AND_ASSIGN(AsyncHooks); }; + class AsyncCallbackScope { + public: + explicit AsyncCallbackScope(Environment* env); + ~AsyncCallbackScope(); + + inline bool in_makecallback(); + + private: + Environment* env_; + + DISALLOW_COPY_AND_ASSIGN(AsyncCallbackScope); + }; + class DomainFlag { public: inline uint32_t* fields(); @@ -315,13 +346,9 @@ class Environment { public: inline uint32_t* fields(); inline int fields_count() const; - inline bool in_tick() const; - inline bool last_threw() const; inline uint32_t index() const; inline uint32_t length() const; - inline void set_in_tick(bool value); inline void set_index(uint32_t value); - inline void set_last_threw(bool value); private: friend class Environment; // So we can call the constructor. @@ -334,8 +361,6 @@ class Environment { }; uint32_t fields_[kFieldsCount]; - bool in_tick_; - bool last_threw_; DISALLOW_COPY_AND_ASSIGN(TickInfo); }; @@ -441,11 +466,14 @@ class Environment { void PrintSyncTrace() const; inline void set_trace_sync_io(bool value); - bool KickNextTick(); + inline int64_t get_async_wrap_uid(); inline uint32_t* heap_statistics_buffer() const; inline void set_heap_statistics_buffer(uint32_t* pointer); + inline uint32_t* heap_space_statistics_buffer() const; + inline void set_heap_space_statistics_buffer(uint32_t* pointer); + inline char* http_parser_buffer() const; inline void set_http_parser_buffer(char* buffer); @@ -536,6 +564,8 @@ class Environment { bool using_domains_; bool printed_error_; bool trace_sync_io_; + size_t makecallback_cntr_; + int64_t async_wrap_uid_; debugger::Agent debugger_agent_; HandleWrapQueue handle_wrap_queue_; @@ -545,6 +575,7 @@ class Environment { int handle_cleanup_waiting_; uint32_t* heap_statistics_buffer_ = nullptr; + uint32_t* heap_space_statistics_buffer_ = nullptr; char* http_parser_buffer_; diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc index 7768f94459c16a..a9f96389121c9e 100644 --- a/src/fs_event_wrap.cc +++ b/src/fs_event_wrap.cc @@ -159,7 +159,7 @@ void FSEventWrap::OnEvent(uv_fs_event_t* handle, const char* filename, argv[2] = OneByteString(env->isolate(), filename); } - wrap->MakeCallback(env->onchange_string(), ARRAY_SIZE(argv), argv); + wrap->MakeCallback(env->onchange_string(), arraysize(argv), argv); } diff --git a/src/js_stream.cc b/src/js_stream.cc index 25938f111ba6ac..e81709a8056965 100644 --- a/src/js_stream.cc +++ b/src/js_stream.cc @@ -75,7 +75,7 @@ int JSStream::DoShutdown(ShutdownWrap* req_wrap) { req_wrap->Dispatched(); Local res = - MakeCallback(env()->onshutdown_string(), ARRAY_SIZE(argv), argv); + MakeCallback(env()->onshutdown_string(), arraysize(argv), argv); return res->Int32Value(); } @@ -103,7 +103,7 @@ int JSStream::DoWrite(WriteWrap* w, w->Dispatched(); Local res = - MakeCallback(env()->onwrite_string(), ARRAY_SIZE(argv), argv); + MakeCallback(env()->onwrite_string(), arraysize(argv), argv); return res->Int32Value(); } diff --git a/src/node.cc b/src/node.cc index 1dfa854ed5bb99..32f45e633b2d98 100644 --- a/src/node.cc +++ b/src/node.cc @@ -6,6 +6,7 @@ #include "node_javascript.h" #include "node_version.h" #include "node_internals.h" +#include "node_revert.h" #if defined HAVE_PERFCTR #include "node_counters.h" @@ -43,6 +44,10 @@ #include "v8-profiler.h" #include "zlib.h" +#ifdef NODE_ENABLE_VTUNE_PROFILING +#include "../deps/v8/src/third_party/vtune/v8-vtune.h" +#endif + #include #include // PATH_MAX #include @@ -64,9 +69,8 @@ #if defined(_MSC_VER) #include #include -#include #define strcasecmp _stricmp -#define getpid _getpid +#define getpid GetCurrentProcessId #define umask _umask typedef int mode_t; #else @@ -86,6 +90,14 @@ typedef int mode_t; extern char **environ; #endif +#ifdef __APPLE__ +#include "atomic-polyfill.h" // NOLINT(build/include_order) +namespace node { template using atomic = nonstd::atomic; } +#else +#include +namespace node { template using atomic = std::atomic; } +#endif + namespace node { using v8::Array; @@ -103,7 +115,9 @@ using v8::Integer; using v8::Isolate; using v8::Local; using v8::Locker; +using v8::MaybeLocal; using v8::Message; +using v8::Null; using v8::Number; using v8::Object; using v8::ObjectTemplate; @@ -133,6 +147,9 @@ static const char** preload_modules = nullptr; static bool use_debug_agent = false; static bool debug_wait_connect = false; static int debug_port = 5858; +static const int v8_default_thread_pool_size = 4; +static int v8_thread_pool_size = v8_default_thread_pool_size; +static bool prof_process = false; static bool v8_is_profiling = false; static bool node_is_initialized = false; static node_module* modpending; @@ -153,10 +170,9 @@ static double prog_start_time; static bool debugger_running; static uv_async_t dispatch_debug_messages_async; -static Isolate* node_isolate = nullptr; +static node::atomic node_isolate; static v8::Platform* default_platform; - static void PrintErrorString(const char* format, ...) { va_list ap; va_start(ap, format); @@ -168,6 +184,7 @@ static void PrintErrorString(const char* format, ...) { stderr_handle == nullptr || uv_guess_handle(_fileno(stderr)) != UV_TTY) { vfprintf(stderr, format, ap); + va_end(ap); return; } @@ -675,6 +692,12 @@ const char *signo_string(int signo) { # endif #endif +#ifdef SIGINFO +# if !defined(SIGPWR) || SIGINFO != SIGPWR + SIGNO_CASE(SIGINFO); +# endif +#endif + #ifdef SIGSYS SIGNO_CASE(SIGSYS); #endif @@ -932,23 +955,58 @@ Local WinapiErrnoException(Isolate* isolate, void* ArrayBufferAllocator::Allocate(size_t size) { - if (env_ == nullptr || !env_->array_buffer_allocator_info()->no_zero_fill()) + if (env_ == nullptr || + !env_->array_buffer_allocator_info()->no_zero_fill() || + zero_fill_all_buffers) return calloc(size, 1); env_->array_buffer_allocator_info()->reset_fill_flag(); return malloc(size); } +static bool DomainHasErrorHandler(const Environment* env, + const Local& domain) { + HandleScope scope(env->isolate()); + + Local domain_event_listeners_v = domain->Get(env->events_string()); + if (!domain_event_listeners_v->IsObject()) + return false; + + Local domain_event_listeners_o = + domain_event_listeners_v.As(); + + Local domain_error_listeners_v = + domain_event_listeners_o->Get(env->error_string()); + + if (domain_error_listeners_v->IsFunction() || + (domain_error_listeners_v->IsArray() && + domain_error_listeners_v.As()->Length() > 0)) + return true; + + return false; +} + +static bool DomainsStackHasErrorHandler(const Environment* env) { + HandleScope scope(env->isolate()); -static bool IsDomainActive(const Environment* env) { if (!env->using_domains()) return false; - Local domain_array = env->domain_array().As(); - if (domain_array->Length() == 0) + Local domains_stack_array = env->domains_stack_array().As(); + if (domains_stack_array->Length() == 0) return false; - Local domain_v = domain_array->Get(0); - return !domain_v->IsNull(); + uint32_t domains_stack_length = domains_stack_array->Length(); + for (uint32_t i = domains_stack_length; i > 0; --i) { + Local domain_v = domains_stack_array->Get(i - 1); + if (!domain_v->IsObject()) + return false; + + Local domain = domain_v.As(); + if (DomainHasErrorHandler(env, domain)) + return true; + } + + return false; } @@ -962,7 +1020,7 @@ static bool ShouldAbortOnUncaughtException(Isolate* isolate) { bool isEmittingTopLevelDomainError = process_object->Get(emitting_top_level_domain_error_key)->BooleanValue(); - return !IsDomainActive(env) || isEmittingTopLevelDomainError; + return isEmittingTopLevelDomainError || !DomainsStackHasErrorHandler(env); } @@ -991,6 +1049,9 @@ void SetupDomainUse(const FunctionCallbackInfo& args) { CHECK(args[0]->IsArray()); env->set_domain_array(args[0].As()); + CHECK(args[1]->IsArray()); + env->set_domains_stack_array(args[1].As()); + // Do a little housekeeping. env->process_object()->Delete( FIXED_ONE_BYTE_STRING(args.GetIsolate(), "_setupDomainUse")); @@ -1009,6 +1070,17 @@ void RunMicrotasks(const FunctionCallbackInfo& args) { } +void SetupProcessObject(const FunctionCallbackInfo& args) { + Environment* env = Environment::GetCurrent(args); + + CHECK(args[0]->IsFunction()); + + env->set_push_values_to_array_function(args[0].As()); + env->process_object()->Delete( + FIXED_ONE_BYTE_STRING(env->isolate(), "_setupProcessObject")); +} + + void SetupNextTick(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -1048,7 +1120,7 @@ void PromiseRejectCallback(PromiseRejectMessage message) { Local args[] = { event, promise, value }; Local process = env->process_object(); - callback->Call(process, ARRAY_SIZE(args), args); + callback->Call(process, arraysize(args), args); } void SetupPromises(const FunctionCallbackInfo& args) { @@ -1066,10 +1138,10 @@ void SetupPromises(const FunctionCallbackInfo& args) { Local MakeCallback(Environment* env, - Local recv, - const Local callback, - int argc, - Local argv[]) { + Local recv, + const Local callback, + int argc, + Local argv[]) { // If you hit this assertion, you forgot to enter the v8::Context first. CHECK_EQ(env->context(), env->isolate()->GetCurrentContext()); @@ -1079,6 +1151,8 @@ Local MakeCallback(Environment* env, bool ran_init_callback = false; bool has_domain = false; + Environment::AsyncCallbackScope callback_scope(env); + // TODO(trevnorris): Adding "_asyncQueue" to the "this" in the init callback // is a horrible way to detect usage. Rethink how detection should happen. if (recv->IsObject()) { @@ -1099,51 +1173,80 @@ Local MakeCallback(Environment* env, } } - TryCatch try_catch; - try_catch.SetVerbose(true); - if (has_domain) { Local enter_v = domain->Get(env->enter_string()); if (enter_v->IsFunction()) { - enter_v.As()->Call(domain, 0, nullptr); - if (try_catch.HasCaught()) - return Undefined(env->isolate()); + if (enter_v.As()->Call(domain, 0, nullptr).IsEmpty()) { + FatalError("node::MakeCallback", + "domain enter callback threw, please report this"); + } } } if (ran_init_callback && !pre_fn.IsEmpty()) { - try_catch.SetVerbose(false); - pre_fn->Call(object, 0, nullptr); - if (try_catch.HasCaught()) - FatalError("node::MakeCallback", "pre hook threw"); - try_catch.SetVerbose(true); + TryCatch try_catch(env->isolate()); + MaybeLocal ar = pre_fn->Call(env->context(), object, 0, nullptr); + if (ar.IsEmpty()) { + ClearFatalExceptionHandlers(env); + FatalException(env->isolate(), try_catch); + return Local(); + } } Local ret = callback->Call(recv, argc, argv); if (ran_init_callback && !post_fn.IsEmpty()) { - try_catch.SetVerbose(false); - post_fn->Call(object, 0, nullptr); - if (try_catch.HasCaught()) - FatalError("node::MakeCallback", "post hook threw"); - try_catch.SetVerbose(true); + Local did_throw = Boolean::New(env->isolate(), ret.IsEmpty()); + // Currently there's no way to retrieve an uid from node::MakeCallback(). + // This needs to be fixed. + Local vals[] = + { Undefined(env->isolate()).As(), did_throw }; + TryCatch try_catch(env->isolate()); + MaybeLocal ar = + post_fn->Call(env->context(), object, arraysize(vals), vals); + if (ar.IsEmpty()) { + ClearFatalExceptionHandlers(env); + FatalException(env->isolate(), try_catch); + return Local(); + } + } + + if (ret.IsEmpty()) { + // NOTE: For backwards compatibility with public API we return Undefined() + // if the top level call threw. + return callback_scope.in_makecallback() ? + ret : Undefined(env->isolate()).As(); } if (has_domain) { Local exit_v = domain->Get(env->exit_string()); if (exit_v->IsFunction()) { - exit_v.As()->Call(domain, 0, nullptr); - if (try_catch.HasCaught()) - return Undefined(env->isolate()); + if (exit_v.As()->Call(domain, 0, nullptr).IsEmpty()) { + FatalError("node::MakeCallback", + "domain exit callback threw, please report this"); + } } } - if (try_catch.HasCaught()) { - return Undefined(env->isolate()); + if (callback_scope.in_makecallback()) { + return ret; + } + + Environment::TickInfo* tick_info = env->tick_info(); + + if (tick_info->length() == 0) { + env->isolate()->RunMicrotasks(); } - if (!env->KickNextTick()) + Local process = env->process_object(); + + if (tick_info->length() == 0) { + tick_info->set_index(0); + } + + if (env->tick_callback_function()->Call(process, 0, nullptr).IsEmpty()) { return Undefined(env->isolate()); + } return ret; } @@ -1422,8 +1525,6 @@ void AppendExceptionLine(Environment* env, arrow[off + 1] = '\0'; Local arrow_str = String::NewFromUtf8(env->isolate(), arrow); - Local msg; - Local stack; // Allocation failed, just print it out if (arrow_str.IsEmpty() || err_obj.IsEmpty() || !err_obj->IsNativeError()) @@ -1488,8 +1589,10 @@ static void ReportException(Environment* env, name.IsEmpty() || name->IsUndefined()) { // Not an error object. Just print as-is. - node::Utf8Value message(env->isolate(), er); - PrintErrorString("%s\n", *message); + String::Utf8Value message(er); + + PrintErrorString("%s\n", *message ? *message : + ""); } else { node::Utf8Value name_string(env->isolate(), name); node::Utf8Value message_string(env->isolate(), message); @@ -1546,11 +1649,24 @@ static void GetActiveRequests(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); Local ary = Array::New(args.GetIsolate()); - int i = 0; + Local ctx = env->context(); + Local fn = env->push_values_to_array_function(); + Local argv[NODE_PUSH_VAL_TO_ARRAY_MAX]; + size_t idx = 0; - for (auto w : *env->req_wrap_queue()) - if (w->persistent().IsEmpty() == false) - ary->Set(i++, w->object()); + for (auto w : *env->req_wrap_queue()) { + if (w->persistent().IsEmpty()) + continue; + argv[idx] = w->object(); + if (++idx >= arraysize(argv)) { + fn->Call(ctx, ary, idx, argv).ToLocalChecked(); + idx = 0; + } + } + + if (idx > 0) { + fn->Call(ctx, ary, idx, argv).ToLocalChecked(); + } args.GetReturnValue().Set(ary); } @@ -1562,7 +1678,10 @@ void GetActiveHandles(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); Local ary = Array::New(env->isolate()); - int i = 0; + Local ctx = env->context(); + Local fn = env->push_values_to_array_function(); + Local argv[NODE_PUSH_VAL_TO_ARRAY_MAX]; + size_t idx = 0; Local owner_sym = env->owner_string(); @@ -1573,7 +1692,14 @@ void GetActiveHandles(const FunctionCallbackInfo& args) { Local owner = object->Get(owner_sym); if (owner->IsUndefined()) owner = object; - ary->Set(i++, owner); + argv[idx] = owner; + if (++idx >= arraysize(argv)) { + fn->Call(ctx, ary, idx, argv).ToLocalChecked(); + idx = 0; + } + } + if (idx > 0) { + fn->Call(ctx, ary, idx, argv).ToLocalChecked(); } args.GetReturnValue().Set(ary); @@ -1760,7 +1886,6 @@ static gid_t gid_by_name(Isolate* isolate, Local value) { } } - static void GetUid(const FunctionCallbackInfo& args) { // uid_t is an uint32_t on all supported platforms. args.GetReturnValue().Set(static_cast(getuid())); @@ -2045,26 +2170,17 @@ void Kill(const FunctionCallbackInfo& args) { // and nanoseconds, to avoid any integer overflow possibility. // Pass in an Array from a previous hrtime() call to instead get a time diff. void Hrtime(const FunctionCallbackInfo& args) { - Environment* env = Environment::GetCurrent(args); - uint64_t t = uv_hrtime(); - if (args.Length() > 0) { - // return a time diff tuple - if (!args[0]->IsArray()) { - return env->ThrowTypeError( - "process.hrtime() only accepts an Array tuple."); - } - Local inArray = Local::Cast(args[0]); - uint64_t seconds = inArray->Get(0)->Uint32Value(); - uint64_t nanos = inArray->Get(1)->Uint32Value(); - t -= (seconds * NANOS_PER_SEC) + nanos; - } + Local ab = args[0].As()->Buffer(); + uint32_t* fields = static_cast(ab->GetContents().Data()); - Local tuple = Array::New(env->isolate(), 2); - tuple->Set(0, Integer::NewFromUnsigned(env->isolate(), t / NANOS_PER_SEC)); - tuple->Set(1, Integer::NewFromUnsigned(env->isolate(), t % NANOS_PER_SEC)); - args.GetReturnValue().Set(tuple); + // These three indices will contain the values for the hrtime tuple. The + // seconds value is broken into the upper/lower 32 bits and stored in two + // uint32 fields to be converted back in JS. + fields[0] = (t / NANOS_PER_SEC) >> 32; + fields[1] = (t / NANOS_PER_SEC) & 0xffffffff; + fields[2] = t % NANOS_PER_SEC; } extern "C" void node_module_register(void* m) { @@ -2267,6 +2383,25 @@ void OnMessage(Local message, Local error) { } +void ClearFatalExceptionHandlers(Environment* env) { + Local process = env->process_object(); + Local events = + process->Get(env->context(), env->events_string()).ToLocalChecked(); + + if (events->IsObject()) { + events.As()->Set( + env->context(), + OneByteString(env->isolate(), "uncaughtException"), + Undefined(env->isolate())).FromJust(); + } + + process->Set( + env->context(), + env->domain_string(), + Undefined(env->isolate())).FromJust(); +} + + static void Binding(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -2392,12 +2527,12 @@ static void EnvGetter(Local property, WCHAR buffer[32767]; // The maximum size allowed for environment variables. DWORD result = GetEnvironmentVariableW(reinterpret_cast(*key), buffer, - ARRAY_SIZE(buffer)); + arraysize(buffer)); // If result >= sizeof buffer the buffer was too small. That should never // happen. If result == 0 and result != ERROR_SUCCESS the variable was not // not found. if ((result > 0 || GetLastError() == ERROR_SUCCESS) && - result < ARRAY_SIZE(buffer)) { + result < arraysize(buffer)) { const uint16_t* two_byte_buffer = reinterpret_cast(buffer); Local rc = String::NewFromTwoByte(isolate, two_byte_buffer); return info.GetReturnValue().Set(rc); @@ -2476,23 +2611,35 @@ static void EnvDeleter(Local property, static void EnvEnumerator(const PropertyCallbackInfo& info) { - Isolate* isolate = info.GetIsolate(); + Environment* env = Environment::GetCurrent(info); + Isolate* isolate = env->isolate(); + Local ctx = env->context(); + Local fn = env->push_values_to_array_function(); + Local argv[NODE_PUSH_VAL_TO_ARRAY_MAX]; + size_t idx = 0; + #ifdef __POSIX__ int size = 0; while (environ[size]) size++; - Local envarr = Array::New(isolate, size); + Local envarr = Array::New(isolate); for (int i = 0; i < size; ++i) { const char* var = environ[i]; const char* s = strchr(var, '='); const int length = s ? s - var : strlen(var); - Local name = String::NewFromUtf8(isolate, - var, - String::kNormalString, - length); - envarr->Set(i, name); + argv[idx] = String::NewFromUtf8(isolate, + var, + String::kNormalString, + length); + if (++idx >= arraysize(argv)) { + fn->Call(ctx, envarr, idx, argv).ToLocalChecked(); + idx = 0; + } + } + if (idx > 0) { + fn->Call(ctx, envarr, idx, argv).ToLocalChecked(); } #else // _WIN32 WCHAR* environment = GetEnvironmentStringsW(); @@ -2500,7 +2647,6 @@ static void EnvEnumerator(const PropertyCallbackInfo& info) { return; // This should not happen. Local envarr = Array::New(isolate); WCHAR* p = environment; - int i = 0; while (*p) { WCHAR *s; if (*p == L'=') { @@ -2515,13 +2661,19 @@ static void EnvEnumerator(const PropertyCallbackInfo& info) { } const uint16_t* two_byte_buffer = reinterpret_cast(p); const size_t two_byte_buffer_len = s - p; - Local value = String::NewFromTwoByte(isolate, - two_byte_buffer, - String::kNormalString, - two_byte_buffer_len); - envarr->Set(i++, value); + argv[idx] = String::NewFromTwoByte(isolate, + two_byte_buffer, + String::kNormalString, + two_byte_buffer_len); + if (++idx >= arraysize(argv)) { + fn->Call(ctx, envarr, idx, argv).ToLocalChecked(); + idx = 0; + } p = s + wcslen(s) + 1; } + if (idx > 0) { + fn->Call(ctx, envarr, idx, argv).ToLocalChecked(); + } FreeEnvironmentStringsW(environment); #endif @@ -2552,6 +2704,13 @@ static Local GetFeatures(Environment* env) { #endif obj->Set(env->tls_npn_string(), tls_npn); +#ifdef TLSEXT_TYPE_application_layer_protocol_negotiation + Local tls_alpn = True(env->isolate()); +#else + Local tls_alpn = False(env->isolate()); +#endif + obj->Set(env->tls_alpn_string(), tls_alpn); + #ifdef SSL_CTRL_SET_TLSEXT_SERVERNAME_CB Local tls_sni = True(env->isolate()); #else @@ -2907,11 +3066,31 @@ void SetupProcessObject(Environment* env, READONLY_PROPERTY(process, "throwDeprecation", True(env->isolate())); } +#ifdef NODE_NO_BROWSER_GLOBALS + // configure --no-browser-globals + READONLY_PROPERTY(process, "_noBrowserGlobals", True(env->isolate())); +#endif // NODE_NO_BROWSER_GLOBALS + + // --prof-process + if (prof_process) { + READONLY_PROPERTY(process, "profProcess", True(env->isolate())); + } + // --trace-deprecation if (trace_deprecation) { READONLY_PROPERTY(process, "traceDeprecation", True(env->isolate())); } + // --security-revert flags +#define V(code, _, __) \ + do { \ + if (IsReverted(REVERT_ ## code)) { \ + READONLY_PROPERTY(process, "REVERT_" #code, True(env->isolate())); \ + } \ + } while (0); + REVERSIONS(V) +#undef V + size_t exec_path_len = 2 * PATH_MAX; char* exec_path = new char[exec_path_len]; Local exec_path_value; @@ -2979,6 +3158,7 @@ void SetupProcessObject(Environment* env, env->SetMethod(process, "binding", Binding); env->SetMethod(process, "_linkedBinding", LinkedBinding); + env->SetMethod(process, "_setupProcessObject", SetupProcessObject); env->SetMethod(process, "_setupNextTick", SetupNextTick); env->SetMethod(process, "_setupPromises", SetupPromises); env->SetMethod(process, "_setupDomainUse", SetupDomainUse); @@ -3084,8 +3264,12 @@ void LoadEnvironment(Environment* env) { env->SetMethod(env->process_object(), "_rawDebug", RawDebug); + // Expose the global object as a property on itself + // (Allows you to set stuff on `global` from anywhere in JavaScript.) + global->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "global"), global); + Local arg = env->process_object(); - f->Call(global, 1, &arg); + f->Call(Null(env->isolate()), 1, &arg); } static void PrintHelp(); @@ -3124,6 +3308,8 @@ static bool ParseDebugOpt(const char* arg) { } static void PrintHelp() { + // XXX: If you add an option here, please also add it to doc/node.1 and + // doc/api/cli.md printf("Usage: node [options] [ -e script | script.js ] [arguments] \n" " node debug script.js [arguments] \n" "\n" @@ -3136,14 +3322,19 @@ static void PrintHelp() { " does not appear to be a terminal\n" " -r, --require module to preload (option can be repeated)\n" " --no-deprecation silence deprecation warnings\n" + " --trace-deprecation show stack traces on deprecations\n" " --throw-deprecation throw an exception anytime a deprecated " "function is used\n" - " --trace-deprecation show stack traces on deprecations\n" " --trace-sync-io show stack trace when use of sync IO\n" " is detected after the first tick\n" " --track-heap-objects track heap object allocations for heap " "snapshots\n" + " --prof-process process v8 profiler output generated\n" + " using --prof\n" + " --zero-fill-buffers automatically zero-fill all newly allocated\n" + " Buffer and SlowBuffer instances\n" " --v8-options print v8 command line options\n" + " --v8-pool-size=num set v8's thread pool size\n" #if HAVE_OPENSSL " --tls-cipher-list=val use an alternative default TLS cipher list\n" #endif @@ -3158,19 +3349,19 @@ static void PrintHelp() { "\n" "Environment variables:\n" #ifdef _WIN32 - "NODE_PATH ';'-separated list of directories\n" + "NODE_PATH ';'-separated list of directories\n" #else - "NODE_PATH ':'-separated list of directories\n" + "NODE_PATH ':'-separated list of directories\n" #endif - " prefixed to the module search path.\n" - "NODE_DISABLE_COLORS set to 1 to disable colors in the REPL\n" + " prefixed to the module search path.\n" + "NODE_DISABLE_COLORS set to 1 to disable colors in the REPL\n" #if defined(NODE_HAVE_I18N_SUPPORT) - "NODE_ICU_DATA data path for ICU (Intl object) data\n" + "NODE_ICU_DATA data path for ICU (Intl object) data\n" #if !defined(NODE_HAVE_SMALL_ICU) - " (will extend linked-in data)\n" + " (will extend linked-in data)\n" #endif #endif - "NODE_REPL_HISTORY path to the persistent REPL history file\n" + "NODE_REPL_HISTORY path to the persistent REPL history file\n" "\n" "Documentation can be found at https://nodejs.org/\n"); } @@ -3214,7 +3405,8 @@ static void ParseArgs(int* argc, new_argv[0] = argv[0]; unsigned int index = 1; - while (index < nargs && argv[index][0] == '-') { + bool short_circuit = false; + while (index < nargs && argv[index][0] == '-' && !short_circuit) { const char* const arg = argv[index]; unsigned int args_consumed = 1; @@ -3275,9 +3467,19 @@ static void ParseArgs(int* argc, track_heap_objects = true; } else if (strcmp(arg, "--throw-deprecation") == 0) { throw_deprecation = true; + } else if (strncmp(arg, "--security-revert=", 18) == 0) { + const char* cve = arg + 18; + Revert(cve); + } else if (strcmp(arg, "--prof-process") == 0) { + prof_process = true; + short_circuit = true; + } else if (strcmp(arg, "--zero-fill-buffers") == 0) { + zero_fill_all_buffers = true; } else if (strcmp(arg, "--v8-options") == 0) { new_v8_argv[new_v8_argc] = "--help"; new_v8_argc += 1; + } else if (strncmp(arg, "--v8-pool-size=", 15) == 0) { + v8_thread_pool_size = atoi(arg + 15); #if HAVE_OPENSSL } else if (strncmp(arg, "--tls-cipher-list=", 18) == 0) { default_cipher_list = arg + 18; @@ -3365,35 +3567,53 @@ static void EnableDebug(Environment* env) { FIXED_ONE_BYTE_STRING(env->isolate(), "internalMessage"), message }; - MakeCallback(env, env->process_object(), "emit", ARRAY_SIZE(argv), argv); + MakeCallback(env, env->process_object(), "emit", arraysize(argv), argv); // Enabled debugger, possibly making it wait on a semaphore env->debugger_agent()->Enable(); } +// Called from an arbitrary thread. +static void TryStartDebugger() { + // Call only async signal-safe functions here! Don't retry the exchange, + // it will deadlock when the thread is interrupted inside a critical section. + if (auto isolate = node_isolate.exchange(nullptr)) { + v8::Debug::DebugBreak(isolate); + uv_async_send(&dispatch_debug_messages_async); + CHECK_EQ(nullptr, node_isolate.exchange(isolate)); + } +} + + // Called from the main thread. static void DispatchDebugMessagesAsyncCallback(uv_async_t* handle) { + // Synchronize with signal handler, see TryStartDebugger. + Isolate* isolate; + do { + isolate = node_isolate.exchange(nullptr); + } while (isolate == nullptr); + if (debugger_running == false) { fprintf(stderr, "Starting debugger agent.\n"); - HandleScope scope(node_isolate); - Environment* env = Environment::GetCurrent(node_isolate); + HandleScope scope(isolate); + Environment* env = Environment::GetCurrent(isolate); Context::Scope context_scope(env->context()); StartDebug(env, false); EnableDebug(env); } - Isolate::Scope isolate_scope(node_isolate); + + Isolate::Scope isolate_scope(isolate); v8::Debug::ProcessDebugMessages(); + CHECK_EQ(nullptr, node_isolate.exchange(isolate)); } #ifdef __POSIX__ static void EnableDebugSignalHandler(int signo) { - // Call only async signal-safe functions here! - v8::Debug::DebugBreak(*static_cast(&node_isolate)); - uv_async_send(&dispatch_debug_messages_async); + TryStartDebugger(); } @@ -3447,8 +3667,7 @@ static int RegisterDebugSignalHandler() { #ifdef _WIN32 DWORD WINAPI EnableDebugThreadProc(void* arg) { - v8::Debug::DebugBreak(*static_cast(&node_isolate)); - uv_async_send(&dispatch_debug_messages_async); + TryStartDebugger(); return 0; } @@ -3469,7 +3688,7 @@ static int RegisterDebugSignalHandler() { if (GetDebugSignalHandlerMappingName(pid, mapping_name, - ARRAY_SIZE(mapping_name)) < 0) { + arraysize(mapping_name)) < 0) { return -1; } @@ -3532,7 +3751,7 @@ static void DebugProcess(const FunctionCallbackInfo& args) { if (GetDebugSignalHandlerMappingName(pid, mapping_name, - ARRAY_SIZE(mapping_name)) < 0) { + arraysize(mapping_name)) < 0) { env->ThrowErrnoException(errno, "sprintf"); goto out; } @@ -3684,6 +3903,7 @@ void Init(int* argc, uv_async_init(uv_default_loop(), &dispatch_debug_messages_async, DispatchDebugMessagesAsyncCallback); + uv_unref(reinterpret_cast(&dispatch_debug_messages_async)); #if defined(NODE_V8_OPTIONS) // Should come before the call to V8::SetFlagsFromCommandLine() @@ -3808,7 +4028,7 @@ void EmitBeforeExit(Environment* env) { FIXED_ONE_BYTE_STRING(env->isolate(), "beforeExit"), process_object->Get(exit_code)->ToInteger(env->isolate()) }; - MakeCallback(env, process_object, "emit", ARRAY_SIZE(args), args); + MakeCallback(env, process_object, "emit", arraysize(args), args); } @@ -3827,7 +4047,7 @@ int EmitExit(Environment* env) { Integer::New(env->isolate(), code) }; - MakeCallback(env, process_object, "emit", ARRAY_SIZE(args), args); + MakeCallback(env, process_object, "emit", arraysize(args), args); // Reload exit code, it may be changed by `emit('exit')` return process_object->Get(exitCode)->Int32Value(); @@ -3960,6 +4180,9 @@ static void StartNodeInstance(void* arg) { Isolate::CreateParams params; ArrayBufferAllocator* array_buffer_allocator = new ArrayBufferAllocator(); params.array_buffer_allocator = array_buffer_allocator; +#ifdef NODE_ENABLE_VTUNE_PROFILING + params.code_event_handler = vTune::GetVtuneCodeEventHandler(); +#endif Isolate* isolate = Isolate::New(params); if (track_heap_objects) { isolate->GetHeapProfiler()->StartTrackingHeapObjects(true); @@ -3968,7 +4191,8 @@ static void StartNodeInstance(void* arg) { // Fetch a reference to the main isolate, so we have a reference to it // even when we need it to access it from another (debugger) thread. if (instance_data->is_main()) - node_isolate = isolate; + CHECK_EQ(nullptr, node_isolate.exchange(isolate)); + { Locker locker(isolate); Isolate::Scope isolate_scope(isolate); @@ -3978,23 +4202,23 @@ static void StartNodeInstance(void* arg) { array_buffer_allocator->set_env(env); Context::Scope context_scope(context); - node_isolate->SetAbortOnUncaughtExceptionCallback( + isolate->SetAbortOnUncaughtExceptionCallback( ShouldAbortOnUncaughtException); // Start debug agent when argv has --debug if (instance_data->use_debug_agent()) StartDebug(env, debug_wait_connect); - LoadEnvironment(env); + { + Environment::AsyncCallbackScope callback_scope(env); + LoadEnvironment(env); + } env->set_trace_sync_io(trace_sync_io); // Enable debugger - if (instance_data->use_debug_agent()) { + if (instance_data->use_debug_agent()) EnableDebug(env); - } else { - uv_unref(reinterpret_cast(&dispatch_debug_messages_async)); - } { SealHandleScope seal(isolate); @@ -4032,12 +4256,15 @@ static void StartNodeInstance(void* arg) { env = nullptr; } + if (instance_data->is_main()) { + // Synchronize with signal handler, see TryStartDebugger. + while (isolate != node_isolate.exchange(nullptr)); // NOLINT + } + CHECK_NE(isolate, nullptr); isolate->Dispose(); isolate = nullptr; delete array_buffer_allocator; - if (instance_data->is_main()) - node_isolate = nullptr; } int Start(int argc, char** argv) { @@ -4060,8 +4287,7 @@ int Start(int argc, char** argv) { V8::SetEntropySource(crypto::EntropySource); #endif - const int thread_pool_size = 4; - default_platform = v8::platform::CreateDefaultPlatform(thread_pool_size); + default_platform = v8::platform::CreateDefaultPlatform(v8_thread_pool_size); V8::InitializePlatform(default_platform); V8::Initialize(); diff --git a/src/node.h b/src/node.h index b5941ff06b27bd..ef1f629d20aa0e 100644 --- a/src/node.h +++ b/src/node.h @@ -96,7 +96,7 @@ NODE_EXTERN v8::Local UVException(v8::Isolate* isolate, const char* path, const char* dest); -NODE_DEPRECATED("Use UVException(isolate, ...)", +NODE_DEPRECATED("Use ErrnoException(isolate, ...)", inline v8::Local ErrnoException( int errorno, const char* syscall = NULL, diff --git a/src/node.js b/src/node.js deleted file mode 100644 index 7cfd2c035962a6..00000000000000 --- a/src/node.js +++ /dev/null @@ -1,962 +0,0 @@ -// Hello, and welcome to hacking node.js! -// -// This file is invoked by node::LoadEnvironment in src/node.cc, and is -// responsible for bootstrapping the node.js core. As special caution is given -// to the performance of the startup process, many dependencies are invoked -// lazily. - -'use strict'; - -(function(process) { - this.global = this; - - function startup() { - var EventEmitter = NativeModule.require('events'); - - process.__proto__ = Object.create(EventEmitter.prototype, { - constructor: { - value: process.constructor - } - }); - EventEmitter.call(process); - - process.EventEmitter = EventEmitter; // process.EventEmitter is deprecated - - // do this good and early, since it handles errors. - startup.processFatal(); - - startup.globalVariables(); - startup.globalTimeouts(); - startup.globalConsole(); - - startup.processAssert(); - startup.processConfig(); - startup.processNextTick(); - startup.processPromises(); - startup.processStdio(); - startup.processKillAndExit(); - startup.processSignalHandlers(); - - // Do not initialize channel in debugger agent, it deletes env variable - // and the main thread won't see it. - if (process.argv[1] !== '--debug-agent') - startup.processChannel(); - - startup.processRawDebug(); - - process.argv[0] = process.execPath; - - // There are various modes that Node can run in. The most common two - // are running from a script and running the REPL - but there are a few - // others like the debugger or running --eval arguments. Here we decide - // which mode we run in. - - if (NativeModule.exists('_third_party_main')) { - // To allow people to extend Node in different ways, this hook allows - // one to drop a file lib/_third_party_main.js into the build - // directory which will be executed instead of Node's normal loading. - process.nextTick(function() { - NativeModule.require('_third_party_main'); - }); - - } else if (process.argv[1] == 'debug') { - // Start the debugger agent - var d = NativeModule.require('_debugger'); - d.start(); - - } else if (process.argv[1] == '--debug-agent') { - // Start the debugger agent - var d = NativeModule.require('_debug_agent'); - d.start(); - - } else { - // There is user code to be run - - // If this is a worker in cluster mode, start up the communication - // channel. This needs to be done before any user code gets executed - // (including preload modules). - if (process.argv[1] && process.env.NODE_UNIQUE_ID) { - var cluster = NativeModule.require('cluster'); - cluster._setupWorker(); - - // Make sure it's not accidentally inherited by child processes. - delete process.env.NODE_UNIQUE_ID; - } - - if (process._eval != null) { - // User passed '-e' or '--eval' arguments to Node. - startup.preloadModules(); - evalScript('[eval]'); - } else if (process.argv[1]) { - // make process.argv[1] into a full path - var path = NativeModule.require('path'); - process.argv[1] = path.resolve(process.argv[1]); - - var Module = NativeModule.require('module'); - - // check if user passed `-c` or `--check` arguments to Node. - if (process._syntax_check_only != null) { - var vm = NativeModule.require('vm'); - var fs = NativeModule.require('fs'); - var internalModule = NativeModule.require('internal/module'); - // read the source - var filename = Module._resolveFilename(process.argv[1]); - var source = fs.readFileSync(filename, 'utf-8'); - // remove shebang and BOM - source = internalModule.stripBOM(source.replace(/^\#\!.*/, '')); - // compile the script, this will throw if it fails - new vm.Script(source, {filename: filename, displayErrors: true}); - process.exit(0); - } - - startup.preloadModules(); - if (global.v8debug && - process.execArgv.some(function(arg) { - return arg.match(/^--debug-brk(=[0-9]*)?$/); - })) { - - // XXX Fix this terrible hack! - // - // Give the client program a few ticks to connect. - // Otherwise, there's a race condition where `node debug foo.js` - // will not be able to connect in time to catch the first - // breakpoint message on line 1. - // - // A better fix would be to somehow get a message from the - // global.v8debug object about a connection, and runMain when - // that occurs. --isaacs - - var debugTimeout = +process.env.NODE_DEBUG_TIMEOUT || 50; - setTimeout(Module.runMain, debugTimeout); - - } else { - // Main entry point into most programs: - Module.runMain(); - } - - } else { - var Module = NativeModule.require('module'); - - // If -i or --interactive were passed, or stdin is a TTY. - if (process._forceRepl || NativeModule.require('tty').isatty(0)) { - // REPL - var cliRepl = Module.requireRepl(); - cliRepl.createInternalRepl(process.env, function(err, repl) { - if (err) { - throw err; - } - repl.on('exit', function() { - if (repl._flushing) { - repl.pause(); - return repl.once('flushHistory', function() { - process.exit(); - }); - } - process.exit(); - }); - }); - } else { - // Read all of stdin - execute it. - process.stdin.setEncoding('utf8'); - - var code = ''; - process.stdin.on('data', function(d) { - code += d; - }); - - process.stdin.on('end', function() { - process._eval = code; - evalScript('[stdin]'); - }); - } - } - } - } - - startup.globalVariables = function() { - global.process = process; - global.global = global; - global.GLOBAL = global; - global.root = global; - global.Buffer = NativeModule.require('buffer').Buffer; - process.domain = null; - process._exiting = false; - }; - - startup.globalTimeouts = function() { - const timers = NativeModule.require('timers'); - global.clearImmediate = timers.clearImmediate; - global.clearInterval = timers.clearInterval; - global.clearTimeout = timers.clearTimeout; - global.setImmediate = timers.setImmediate; - global.setInterval = timers.setInterval; - global.setTimeout = timers.setTimeout; - }; - - startup.globalConsole = function() { - global.__defineGetter__('console', function() { - return NativeModule.require('console'); - }); - }; - - - startup._lazyConstants = null; - - startup.lazyConstants = function() { - if (!startup._lazyConstants) { - startup._lazyConstants = process.binding('constants'); - } - return startup._lazyConstants; - }; - - startup.processFatal = function() { - - process._fatalException = function(er) { - var caught; - - if (process.domain && process.domain._errorHandler) - caught = process.domain._errorHandler(er) || caught; - - if (!caught) - caught = process.emit('uncaughtException', er); - - // If someone handled it, then great. otherwise, die in C++ land - // since that means that we'll exit the process, emit the 'exit' event - if (!caught) { - try { - if (!process._exiting) { - process._exiting = true; - process.emit('exit', 1); - } - } catch (er) { - // nothing to be done about it at this point. - } - - // if we handled an error, then make sure any ticks get processed - } else { - NativeModule.require('timers').setImmediate(process._tickCallback); - } - - return caught; - }; - }; - - var assert; - startup.processAssert = function() { - assert = process.assert = function(x, msg) { - if (!x) throw new Error(msg || 'assertion error'); - }; - }; - - startup.processConfig = function() { - // used for `process.config`, but not a real module - var config = NativeModule._source.config; - delete NativeModule._source.config; - - // strip the gyp comment line at the beginning - config = config.split('\n') - .slice(1) - .join('\n') - .replace(/"/g, '\\"') - .replace(/'/g, '"'); - - process.config = JSON.parse(config, function(key, value) { - if (value === 'true') return true; - if (value === 'false') return false; - return value; - }); - }; - - var addPendingUnhandledRejection; - var hasBeenNotifiedProperty = new WeakMap(); - startup.processNextTick = function() { - var nextTickQueue = []; - var pendingUnhandledRejections = []; - var microtasksScheduled = false; - - // Used to run V8's micro task queue. - var _runMicrotasks = {}; - - // *Must* match Environment::TickInfo::Fields in src/env.h. - var kIndex = 0; - var kLength = 1; - - process.nextTick = nextTick; - // Needs to be accessible from beyond this scope. - process._tickCallback = _tickCallback; - process._tickDomainCallback = _tickDomainCallback; - - // This tickInfo thing is used so that the C++ code in src/node.cc - // can have easy access to our nextTick state, and avoid unnecessary - // calls into JS land. - const tickInfo = process._setupNextTick(_tickCallback, _runMicrotasks); - - _runMicrotasks = _runMicrotasks.runMicrotasks; - - function tickDone() { - if (tickInfo[kLength] !== 0) { - if (tickInfo[kLength] <= tickInfo[kIndex]) { - nextTickQueue = []; - tickInfo[kLength] = 0; - } else { - nextTickQueue.splice(0, tickInfo[kIndex]); - tickInfo[kLength] = nextTickQueue.length; - } - } - tickInfo[kIndex] = 0; - } - - function scheduleMicrotasks() { - if (microtasksScheduled) - return; - - nextTickQueue.push({ - callback: runMicrotasksCallback, - domain: null - }); - - tickInfo[kLength]++; - microtasksScheduled = true; - } - - function runMicrotasksCallback() { - microtasksScheduled = false; - _runMicrotasks(); - - if (tickInfo[kIndex] < tickInfo[kLength] || - emitPendingUnhandledRejections()) - scheduleMicrotasks(); - } - - // Run callbacks that have no domain. - // Using domains will cause this to be overridden. - function _tickCallback() { - var callback, args, tock; - - do { - while (tickInfo[kIndex] < tickInfo[kLength]) { - tock = nextTickQueue[tickInfo[kIndex]++]; - callback = tock.callback; - args = tock.args; - // Using separate callback execution functions helps to limit the - // scope of DEOPTs caused by using try blocks and allows direct - // callback invocation with small numbers of arguments to avoid the - // performance hit associated with using `fn.apply()` - if (args === undefined) { - doNTCallback0(callback); - } else { - switch (args.length) { - case 1: - doNTCallback1(callback, args[0]); - break; - case 2: - doNTCallback2(callback, args[0], args[1]); - break; - case 3: - doNTCallback3(callback, args[0], args[1], args[2]); - break; - default: - doNTCallbackMany(callback, args); - } - } - if (1e4 < tickInfo[kIndex]) - tickDone(); - } - tickDone(); - _runMicrotasks(); - emitPendingUnhandledRejections(); - } while (tickInfo[kLength] !== 0); - } - - function _tickDomainCallback() { - var callback, domain, args, tock; - - do { - while (tickInfo[kIndex] < tickInfo[kLength]) { - tock = nextTickQueue[tickInfo[kIndex]++]; - callback = tock.callback; - domain = tock.domain; - args = tock.args; - if (domain) - domain.enter(); - // Using separate callback execution functions helps to limit the - // scope of DEOPTs caused by using try blocks and allows direct - // callback invocation with small numbers of arguments to avoid the - // performance hit associated with using `fn.apply()` - if (args === undefined) { - doNTCallback0(callback); - } else { - switch (args.length) { - case 1: - doNTCallback1(callback, args[0]); - break; - case 2: - doNTCallback2(callback, args[0], args[1]); - break; - case 3: - doNTCallback3(callback, args[0], args[1], args[2]); - break; - default: - doNTCallbackMany(callback, args); - } - } - if (1e4 < tickInfo[kIndex]) - tickDone(); - if (domain) - domain.exit(); - } - tickDone(); - _runMicrotasks(); - emitPendingUnhandledRejections(); - } while (tickInfo[kLength] !== 0); - } - - function doNTCallback0(callback) { - var threw = true; - try { - callback(); - threw = false; - } finally { - if (threw) - tickDone(); - } - } - - function doNTCallback1(callback, arg1) { - var threw = true; - try { - callback(arg1); - threw = false; - } finally { - if (threw) - tickDone(); - } - } - - function doNTCallback2(callback, arg1, arg2) { - var threw = true; - try { - callback(arg1, arg2); - threw = false; - } finally { - if (threw) - tickDone(); - } - } - - function doNTCallback3(callback, arg1, arg2, arg3) { - var threw = true; - try { - callback(arg1, arg2, arg3); - threw = false; - } finally { - if (threw) - tickDone(); - } - } - - function doNTCallbackMany(callback, args) { - var threw = true; - try { - callback.apply(null, args); - threw = false; - } finally { - if (threw) - tickDone(); - } - } - - function TickObject(c, args) { - this.callback = c; - this.domain = process.domain || null; - this.args = args; - } - - function nextTick(callback) { - // on the way out, don't bother. it won't get fired anyway. - if (process._exiting) - return; - - var args; - if (arguments.length > 1) { - args = []; - for (var i = 1; i < arguments.length; i++) - args.push(arguments[i]); - } - - nextTickQueue.push(new TickObject(callback, args)); - tickInfo[kLength]++; - } - - function emitPendingUnhandledRejections() { - var hadListeners = false; - while (pendingUnhandledRejections.length > 0) { - var promise = pendingUnhandledRejections.shift(); - var reason = pendingUnhandledRejections.shift(); - if (hasBeenNotifiedProperty.get(promise) === false) { - hasBeenNotifiedProperty.set(promise, true); - if (!process.emit('unhandledRejection', reason, promise)) { - // Nobody is listening. - // TODO(petkaantonov) Take some default action, see #830 - } else { - hadListeners = true; - } - } - } - return hadListeners; - } - - addPendingUnhandledRejection = function(promise, reason) { - pendingUnhandledRejections.push(promise, reason); - scheduleMicrotasks(); - }; - }; - - startup.processPromises = function() { - var promiseRejectEvent = process._promiseRejectEvent; - - function unhandledRejection(promise, reason) { - hasBeenNotifiedProperty.set(promise, false); - addPendingUnhandledRejection(promise, reason); - } - - function rejectionHandled(promise) { - var hasBeenNotified = hasBeenNotifiedProperty.get(promise); - if (hasBeenNotified !== undefined) { - hasBeenNotifiedProperty.delete(promise); - if (hasBeenNotified === true) { - process.nextTick(function() { - process.emit('rejectionHandled', promise); - }); - } - - } - } - - process._setupPromises(function(event, promise, reason) { - if (event === promiseRejectEvent.unhandled) - unhandledRejection(promise, reason); - else if (event === promiseRejectEvent.handled) - rejectionHandled(promise); - else - NativeModule.require('assert').fail('unexpected PromiseRejectEvent'); - }); - }; - - function evalScript(name) { - var Module = NativeModule.require('module'); - var path = NativeModule.require('path'); - - try { - var cwd = process.cwd(); - } catch (e) { - // getcwd(3) can fail if the current working directory has been deleted. - // Fall back to the directory name of the (absolute) executable path. - // It's not really correct but what are the alternatives? - var cwd = path.dirname(process.execPath); - } - - var module = new Module(name); - module.filename = path.join(cwd, name); - module.paths = Module._nodeModulePaths(cwd); - var script = process._eval; - var body = script; - script = 'global.__filename = ' + JSON.stringify(name) + ';\n' + - 'global.exports = exports;\n' + - 'global.module = module;\n' + - 'global.__dirname = __dirname;\n' + - 'global.require = require;\n' + - 'return require("vm").runInThisContext(' + - JSON.stringify(body) + ', { filename: ' + - JSON.stringify(name) + ' });\n'; - // Defer evaluation for a tick. This is a workaround for deferred - // events not firing when evaluating scripts from the command line, - // see https://github.com/nodejs/node/issues/1600. - process.nextTick(function() { - var result = module._compile(script, name + '-wrapper'); - if (process._print_eval) console.log(result); - }); - } - - function createWritableStdioStream(fd) { - var stream; - var tty_wrap = process.binding('tty_wrap'); - - // Note stream._type is used for test-module-load-list.js - - switch (tty_wrap.guessHandleType(fd)) { - case 'TTY': - var tty = NativeModule.require('tty'); - stream = new tty.WriteStream(fd); - stream._type = 'tty'; - break; - - case 'FILE': - var fs = NativeModule.require('fs'); - stream = new fs.SyncWriteStream(fd, { autoClose: false }); - stream._type = 'fs'; - break; - - case 'PIPE': - case 'TCP': - var net = NativeModule.require('net'); - stream = new net.Socket({ - fd: fd, - readable: false, - writable: true - }); - stream._type = 'pipe'; - break; - - default: - // Probably an error on in uv_guess_handle() - throw new Error('Implement me. Unknown stream file type!'); - } - - // For supporting legacy API we put the FD here. - stream.fd = fd; - - stream._isStdio = true; - - return stream; - } - - startup.processStdio = function() { - var stdin, stdout, stderr; - - process.__defineGetter__('stdout', function() { - if (stdout) return stdout; - stdout = createWritableStdioStream(1); - stdout.destroy = stdout.destroySoon = function(er) { - er = er || new Error('process.stdout cannot be closed.'); - stdout.emit('error', er); - }; - if (stdout.isTTY) { - process.on('SIGWINCH', function() { - stdout._refreshSize(); - }); - } - return stdout; - }); - - process.__defineGetter__('stderr', function() { - if (stderr) return stderr; - stderr = createWritableStdioStream(2); - stderr.destroy = stderr.destroySoon = function(er) { - er = er || new Error('process.stderr cannot be closed.'); - stderr.emit('error', er); - }; - if (stderr.isTTY) { - process.on('SIGWINCH', function() { - stderr._refreshSize(); - }); - } - return stderr; - }); - - process.__defineGetter__('stdin', function() { - if (stdin) return stdin; - - var tty_wrap = process.binding('tty_wrap'); - var fd = 0; - - switch (tty_wrap.guessHandleType(fd)) { - case 'TTY': - var tty = NativeModule.require('tty'); - stdin = new tty.ReadStream(fd, { - highWaterMark: 0, - readable: true, - writable: false - }); - break; - - case 'FILE': - var fs = NativeModule.require('fs'); - stdin = new fs.ReadStream(null, { fd: fd, autoClose: false }); - break; - - case 'PIPE': - case 'TCP': - var net = NativeModule.require('net'); - - // It could be that process has been started with an IPC channel - // sitting on fd=0, in such case the pipe for this fd is already - // present and creating a new one will lead to the assertion failure - // in libuv. - if (process._channel && process._channel.fd === fd) { - stdin = new net.Socket({ - handle: process._channel, - readable: true, - writable: false - }); - } else { - stdin = new net.Socket({ - fd: fd, - readable: true, - writable: false - }); - } - // Make sure the stdin can't be `.end()`-ed - stdin._writableState.ended = true; - break; - - default: - // Probably an error on in uv_guess_handle() - throw new Error('Implement me. Unknown stdin file type!'); - } - - // For supporting legacy API we put the FD here. - stdin.fd = fd; - - // stdin starts out life in a paused state, but node doesn't - // know yet. Explicitly to readStop() it to put it in the - // not-reading state. - if (stdin._handle && stdin._handle.readStop) { - stdin._handle.reading = false; - stdin.push(''); - stdin._handle.readStop(); - } - - // if the user calls stdin.pause(), then we need to stop reading - // immediately, so that the process can close down. - stdin.on('pause', function() { - if (!stdin._handle) - return; - stdin.push(''); - stdin._handle.reading = false; - stdin._handle.readStop(); - }); - - return stdin; - }); - - process.openStdin = function() { - process.stdin.resume(); - return process.stdin; - }; - }; - - startup.processKillAndExit = function() { - - process.exit = function(code) { - if (code || code === 0) - process.exitCode = code; - - if (!process._exiting) { - process._exiting = true; - process.emit('exit', process.exitCode || 0); - } - process.reallyExit(process.exitCode || 0); - }; - - process.kill = function(pid, sig) { - var err; - - if (pid != (pid | 0)) { - throw new TypeError('invalid pid'); - } - - // preserve null signal - if (0 === sig) { - err = process._kill(pid, 0); - } else { - sig = sig || 'SIGTERM'; - if (startup.lazyConstants()[sig] && - sig.slice(0, 3) === 'SIG') { - err = process._kill(pid, startup.lazyConstants()[sig]); - } else { - throw new Error('Unknown signal: ' + sig); - } - } - - if (err) { - var errnoException = NativeModule.require('util')._errnoException; - throw errnoException(err, 'kill'); - } - - return true; - }; - }; - - startup.processSignalHandlers = function() { - // Load events module in order to access prototype elements on process like - // process.addListener. - var signalWraps = {}; - - function isSignal(event) { - return event.slice(0, 3) === 'SIG' && - startup.lazyConstants().hasOwnProperty(event); - } - - // Detect presence of a listener for the special signal types - process.on('newListener', function(type, listener) { - if (isSignal(type) && - !signalWraps.hasOwnProperty(type)) { - var Signal = process.binding('signal_wrap').Signal; - var wrap = new Signal(); - - wrap.unref(); - - wrap.onsignal = function() { process.emit(type); }; - - var signum = startup.lazyConstants()[type]; - var err = wrap.start(signum); - if (err) { - wrap.close(); - var errnoException = NativeModule.require('util')._errnoException; - throw errnoException(err, 'uv_signal_start'); - } - - signalWraps[type] = wrap; - } - }); - - process.on('removeListener', function(type, listener) { - if (signalWraps.hasOwnProperty(type) && this.listenerCount(type) === 0) { - signalWraps[type].close(); - delete signalWraps[type]; - } - }); - }; - - - startup.processChannel = function() { - // If we were spawned with env NODE_CHANNEL_FD then load that up and - // start parsing data from that stream. - if (process.env.NODE_CHANNEL_FD) { - var fd = parseInt(process.env.NODE_CHANNEL_FD, 10); - assert(fd >= 0); - - // Make sure it's not accidentally inherited by child processes. - delete process.env.NODE_CHANNEL_FD; - - var cp = NativeModule.require('child_process'); - - // Load tcp_wrap to avoid situation where we might immediately receive - // a message. - // FIXME is this really necessary? - process.binding('tcp_wrap'); - - cp._forkChild(fd); - assert(process.send); - } - }; - - - startup.processRawDebug = function() { - var format = NativeModule.require('util').format; - var rawDebug = process._rawDebug; - process._rawDebug = function() { - rawDebug(format.apply(null, arguments)); - }; - }; - - // Load preload modules - startup.preloadModules = function() { - if (process._preload_modules) { - NativeModule.require('module')._preloadModules(process._preload_modules); - } - }; - - // Below you find a minimal module system, which is used to load the node - // core modules found in lib/*.js. All core modules are compiled into the - // node binary, so they can be loaded faster. - - var ContextifyScript = process.binding('contextify').ContextifyScript; - function runInThisContext(code, options) { - var script = new ContextifyScript(code, options); - return script.runInThisContext(); - } - - function NativeModule(id) { - this.filename = id + '.js'; - this.id = id; - this.exports = {}; - this.loaded = false; - } - - NativeModule._source = process.binding('natives'); - NativeModule._cache = {}; - - NativeModule.require = function(id) { - if (id == 'native_module') { - return NativeModule; - } - - var cached = NativeModule.getCached(id); - if (cached) { - return cached.exports; - } - - if (!NativeModule.exists(id)) { - throw new Error('No such native module ' + id); - } - - process.moduleLoadList.push('NativeModule ' + id); - - var nativeModule = new NativeModule(id); - - nativeModule.cache(); - nativeModule.compile(); - - return nativeModule.exports; - }; - - NativeModule.getCached = function(id) { - return NativeModule._cache[id]; - }; - - NativeModule.exists = function(id) { - return NativeModule._source.hasOwnProperty(id); - }; - - const EXPOSE_INTERNALS = process.execArgv.some(function(arg) { - return arg.match(/^--expose[-_]internals$/); - }); - - if (EXPOSE_INTERNALS) { - NativeModule.nonInternalExists = NativeModule.exists; - - NativeModule.isInternal = function(id) { - return false; - }; - } else { - NativeModule.nonInternalExists = function(id) { - return NativeModule.exists(id) && !NativeModule.isInternal(id); - }; - - NativeModule.isInternal = function(id) { - return id.startsWith('internal/'); - }; - } - - - NativeModule.getSource = function(id) { - return NativeModule._source[id]; - }; - - NativeModule.wrap = function(script) { - return NativeModule.wrapper[0] + script + NativeModule.wrapper[1]; - }; - - NativeModule.wrapper = [ - '(function (exports, require, module, __filename, __dirname) { ', - '\n});' - ]; - - NativeModule.prototype.compile = function() { - var source = NativeModule.getSource(this.id); - source = NativeModule.wrap(source); - - var fn = runInThisContext(source, { filename: this.filename }); - fn(this.exports, NativeModule.require, this, this.filename); - - this.loaded = true; - }; - - NativeModule.prototype.cache = function() { - NativeModule._cache[this.id] = this; - }; - - startup(); -}); diff --git a/src/node_buffer.cc b/src/node_buffer.cc index a472d0c95e9225..e4de81e1e8aafc 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -48,7 +48,21 @@ CHECK_NOT_OOB(end <= end_max); \ size_t length = end - start; +#define BUFFER_MALLOC(length) \ + zero_fill_all_buffers ? calloc(length, 1) : malloc(length) + +#define SWAP_BYTES(arr, a, b) \ + do { \ + const uint8_t lo = arr[a]; \ + arr[a] = arr[b]; \ + arr[b] = lo; \ + } while (0) + namespace node { + +// if true, all Buffer and SlowBuffer instances will automatically zero-fill +bool zero_fill_all_buffers = false; + namespace Buffer { using v8::ArrayBuffer; @@ -211,18 +225,30 @@ MaybeLocal New(Isolate* isolate, enum encoding enc) { EscapableHandleScope scope(isolate); - size_t length = StringBytes::Size(isolate, string, enc); - char* data = static_cast(malloc(length)); + const size_t length = StringBytes::Size(isolate, string, enc); + size_t actual = 0; + char* data = nullptr; - if (data == nullptr) - return Local(); + // malloc(0) and realloc(ptr, 0) have implementation-defined behavior in + // that the standard allows them to either return a unique pointer or a + // nullptr for zero-sized allocation requests. Normalize by always using + // a nullptr. + if (length > 0) { + data = static_cast(BUFFER_MALLOC(length)); - size_t actual = StringBytes::Write(isolate, data, length, string, enc); - CHECK(actual <= length); + if (data == nullptr) + return Local(); - if (actual < length) { - data = static_cast(realloc(data, actual)); - CHECK_NE(data, nullptr); + actual = StringBytes::Write(isolate, data, length, string, enc); + CHECK(actual <= length); + + if (actual == 0) { + free(data); + data = nullptr; + } else if (actual < length) { + data = static_cast(realloc(data, actual)); + CHECK_NE(data, nullptr); + } } Local buf; @@ -254,7 +280,7 @@ MaybeLocal New(Environment* env, size_t length) { void* data; if (length > 0) { - data = malloc(length); + data = BUFFER_MALLOC(length); if (data == nullptr) return Local(); } else { @@ -350,6 +376,11 @@ MaybeLocal New(Environment* env, } Local ab = ArrayBuffer::New(env->isolate(), data, length); + // `Neuter()`ing is required here to prevent materialization of the backing + // store in v8. `nullptr` buffers are not writable, so this is semantically + // correct. + if (data == nullptr) + ab->Neuter(); Local ui = Uint8Array::New(ab, 0, length); Maybe mb = ui->SetPrototype(env->context(), env->buffer_prototype_object()); @@ -412,7 +443,20 @@ void CreateFromArrayBuffer(const FunctionCallbackInfo& args) { if (!args[0]->IsArrayBuffer()) return env->ThrowTypeError("argument is not an ArrayBuffer"); Local ab = args[0].As(); - Local ui = Uint8Array::New(ab, 0, ab->ByteLength()); + + size_t ab_length = ab->ByteLength(); + size_t offset; + size_t max_length; + + CHECK_NOT_OOB(ParseArrayIndex(args[1], 0, &offset)); + CHECK_NOT_OOB(ParseArrayIndex(args[2], ab_length - offset, &max_length)); + + if (offset >= ab_length) + return env->ThrowRangeError("'offset' is out of bounds"); + if (max_length > ab_length - offset) + return env->ThrowRangeError("'length' is out of bounds"); + + Local ui = Uint8Array::New(ab, offset, max_length); Maybe mb = ui->SetPrototype(env->context(), env->buffer_prototype_object()); if (!mb.FromMaybe(false)) @@ -460,10 +504,11 @@ void StringSlice(const FunctionCallbackInfo& args) { // need to reorder on BE platforms. See http://nodejs.org/api/buffer.html // regarding Node's "ucs2" encoding specification. const bool aligned = (reinterpret_cast(data) % sizeof(*buf) == 0); - if (IsLittleEndian() && aligned) { - buf = reinterpret_cast(data); - } else { + if (IsLittleEndian() && !aligned) { // Make a copy to avoid unaligned accesses in v8::String::NewFromTwoByte(). + // This applies ONLY to little endian platforms, as misalignment will be + // handled by a byte-swapping operation in StringBytes::Encode on + // big endian platforms. uint16_t* copy = new uint16_t[length]; for (size_t i = 0, k = 0; i < length; i += 1, k += 2) { // Assumes that the input is little endian. @@ -473,6 +518,8 @@ void StringSlice(const FunctionCallbackInfo& args) { } buf = copy; release = true; + } else { + buf = reinterpret_cast(data); } args.GetReturnValue().Set(StringBytes::Encode(env->isolate(), buf, length)); @@ -550,42 +597,91 @@ void Copy(const FunctionCallbackInfo &args) { void Fill(const FunctionCallbackInfo& args) { - THROW_AND_RETURN_UNLESS_BUFFER(Environment::GetCurrent(args), args[0]); + Environment* env = Environment::GetCurrent(args); + + THROW_AND_RETURN_UNLESS_BUFFER(env, args[0]); SPREAD_ARG(args[0], ts_obj); size_t start = args[2]->Uint32Value(); size_t end = args[3]->Uint32Value(); - size_t length = end - start; - CHECK(length + start <= ts_obj_length); + size_t fill_length = end - start; + Local str_obj; + size_t str_length; + enum encoding enc; + CHECK(fill_length + start <= ts_obj_length); + + // First check if Buffer has been passed. + if (Buffer::HasInstance(args[1])) { + SPREAD_ARG(args[1], fill_obj); + str_length = fill_obj_length; + memcpy(ts_obj_data + start, fill_obj_data, MIN(str_length, fill_length)); + goto start_fill; + } - if (args[1]->IsNumber()) { + // Then coerce everything that's not a string. + if (!args[1]->IsString()) { int value = args[1]->Uint32Value() & 255; - memset(ts_obj_data + start, value, length); + memset(ts_obj_data + start, value, fill_length); return; } - node::Utf8Value str(args.GetIsolate(), args[1]); - size_t str_length = str.length(); - size_t in_there = str_length; - char* ptr = ts_obj_data + start + str_length; + str_obj = args[1]->ToString(env->isolate()); + enc = ParseEncoding(env->isolate(), args[4], UTF8); + str_length = + enc == UTF8 ? str_obj->Utf8Length() : + enc == UCS2 ? str_obj->Length() * sizeof(uint16_t) : str_obj->Length(); + + if (enc == HEX && str_length % 2 != 0) + return env->ThrowTypeError("Invalid hex string"); if (str_length == 0) return; - memcpy(ts_obj_data + start, *str, MIN(str_length, length)); + // Can't use StringBytes::Write() in all cases. For example if attempting + // to write a two byte character into a one byte Buffer. + if (enc == UTF8) { + node::Utf8Value str(env->isolate(), args[1]); + memcpy(ts_obj_data + start, *str, MIN(str_length, fill_length)); + + } else if (enc == UCS2) { + node::TwoByteValue str(env->isolate(), args[1]); + memcpy(ts_obj_data + start, *str, MIN(str_length, fill_length)); + + } else { + // Write initial String to Buffer, then use that memory to copy remainder + // of string. Correct the string length for cases like HEX where less than + // the total string length is written. + str_length = StringBytes::Write(env->isolate(), + ts_obj_data + start, + fill_length, + str_obj, + enc, + nullptr); + // This check is also needed in case Write() returns that no bytes could + // be written. + // TODO(trevnorris): Should this throw? Because of the string length was + // greater than 0 but couldn't be written then the string was invalid. + if (str_length == 0) + return; + } + + start_fill: - if (str_length >= length) + if (str_length >= fill_length) return; - while (in_there < length - in_there) { + + size_t in_there = str_length; + char* ptr = ts_obj_data + start + str_length; + + while (in_there < fill_length - in_there) { memcpy(ptr, ts_obj_data + start, in_there); ptr += in_there; in_there *= 2; } - if (in_there < length) { - memcpy(ptr, ts_obj_data + start, length - in_there); - in_there = length; + if (in_there < fill_length) { + memcpy(ptr, ts_obj_data + start, fill_length - in_there); } } @@ -713,12 +809,36 @@ void ReadDoubleBE(const FunctionCallbackInfo& args) { template -uint32_t WriteFloatGeneric(const FunctionCallbackInfo& args) { - SPREAD_ARG(args[0], ts_obj); +void WriteFloatGeneric(const FunctionCallbackInfo& args) { + Environment* env = Environment::GetCurrent(args); - T val = args[1]->NumberValue(); - uint32_t offset = args[2]->Uint32Value(); - CHECK_LE(offset + sizeof(T), ts_obj_length); + bool should_assert = args.Length() < 4; + + if (should_assert) { + THROW_AND_RETURN_UNLESS_BUFFER(env, args[0]); + } + + Local ts_obj = args[0].As(); + ArrayBuffer::Contents ts_obj_c = ts_obj->Buffer()->GetContents(); + const size_t ts_obj_offset = ts_obj->ByteOffset(); + const size_t ts_obj_length = ts_obj->ByteLength(); + char* const ts_obj_data = + static_cast(ts_obj_c.Data()) + ts_obj_offset; + if (ts_obj_length > 0) + CHECK_NE(ts_obj_data, nullptr); + + T val = args[1]->NumberValue(env->context()).FromMaybe(0); + size_t offset = args[2]->IntegerValue(env->context()).FromMaybe(0); + + size_t memcpy_num = sizeof(T); + + if (should_assert) { + CHECK_NOT_OOB(offset + memcpy_num >= memcpy_num); + CHECK_NOT_OOB(offset + memcpy_num <= ts_obj_length); + } + + if (offset + memcpy_num > ts_obj_length) + memcpy_num = ts_obj_length - offset; union NoAlias { T val; @@ -729,32 +849,27 @@ uint32_t WriteFloatGeneric(const FunctionCallbackInfo& args) { char* ptr = static_cast(ts_obj_data) + offset; if (endianness != GetEndianness()) Swizzle(na.bytes, sizeof(na.bytes)); - memcpy(ptr, na.bytes, sizeof(na.bytes)); - return offset + sizeof(na.bytes); + memcpy(ptr, na.bytes, memcpy_num); } void WriteFloatLE(const FunctionCallbackInfo& args) { - THROW_AND_RETURN_UNLESS_BUFFER(Environment::GetCurrent(args), args[0]); - args.GetReturnValue().Set(WriteFloatGeneric(args)); + WriteFloatGeneric(args); } void WriteFloatBE(const FunctionCallbackInfo& args) { - THROW_AND_RETURN_UNLESS_BUFFER(Environment::GetCurrent(args), args[0]); - args.GetReturnValue().Set(WriteFloatGeneric(args)); + WriteFloatGeneric(args); } void WriteDoubleLE(const FunctionCallbackInfo& args) { - THROW_AND_RETURN_UNLESS_BUFFER(Environment::GetCurrent(args), args[0]); - args.GetReturnValue().Set(WriteFloatGeneric(args)); + WriteFloatGeneric(args); } void WriteDoubleBE(const FunctionCallbackInfo& args) { - THROW_AND_RETURN_UNLESS_BUFFER(Environment::GetCurrent(args), args[0]); - args.GetReturnValue().Set(WriteFloatGeneric(args)); + WriteFloatGeneric(args); } @@ -765,6 +880,62 @@ void ByteLengthUtf8(const FunctionCallbackInfo &args) { args.GetReturnValue().Set(args[0].As()->Utf8Length()); } +// Normalize val to be an integer in the range of [1, -1] since +// implementations of memcmp() can vary by platform. +static int normalizeCompareVal(int val, size_t a_length, size_t b_length) { + if (val == 0) { + if (a_length > b_length) + return 1; + else if (a_length < b_length) + return -1; + } else { + if (val > 0) + return 1; + else + return -1; + } + return val; +} + +void CompareOffset(const FunctionCallbackInfo &args) { + Environment* env = Environment::GetCurrent(args); + + THROW_AND_RETURN_UNLESS_BUFFER(env, args[0]); + THROW_AND_RETURN_UNLESS_BUFFER(env, args[1]); + SPREAD_ARG(args[0], ts_obj); + SPREAD_ARG(args[1], target); + + size_t target_start; + size_t source_start; + size_t source_end; + size_t target_end; + + CHECK_NOT_OOB(ParseArrayIndex(args[2], 0, &target_start)); + CHECK_NOT_OOB(ParseArrayIndex(args[3], 0, &source_start)); + CHECK_NOT_OOB(ParseArrayIndex(args[4], target_length, &target_end)); + CHECK_NOT_OOB(ParseArrayIndex(args[5], ts_obj_length, &source_end)); + + if (source_start > ts_obj_length) + return env->ThrowRangeError("out of range index"); + if (target_start > target_length) + return env->ThrowRangeError("out of range index"); + + CHECK_LE(source_start, source_end); + CHECK_LE(target_start, target_end); + + size_t to_cmp = MIN(MIN(source_end - source_start, + target_end - target_start), + ts_obj_length - source_start); + + int val = normalizeCompareVal(to_cmp > 0 ? + memcmp(ts_obj_data + source_start, + target_data + target_start, + to_cmp) : 0, + source_end - source_start, + target_end - target_start); + + args.GetReturnValue().Set(val); +} void Compare(const FunctionCallbackInfo &args) { Environment* env = Environment::GetCurrent(args); @@ -776,22 +947,9 @@ void Compare(const FunctionCallbackInfo &args) { size_t cmp_length = MIN(obj_a_length, obj_b_length); - int val = cmp_length > 0 ? memcmp(obj_a_data, obj_b_data, cmp_length) : 0; - - // Normalize val to be an integer in the range of [1, -1] since - // implementations of memcmp() can vary by platform. - if (val == 0) { - if (obj_a_length > obj_b_length) - val = 1; - else if (obj_a_length < obj_b_length) - val = -1; - } else { - if (val > 0) - val = 1; - else - val = -1; - } - + int val = normalizeCompareVal(cmp_length > 0 ? + memcmp(obj_a_data, obj_b_data, cmp_length) : 0, + obj_a_length, obj_b_length); args.GetReturnValue().Set(val); } @@ -810,7 +968,9 @@ void IndexOfString(const FunctionCallbackInfo& args) { Local needle = args[1].As(); const char* haystack = ts_obj_data; const size_t haystack_length = ts_obj_length; - const size_t needle_length = needle->Utf8Length(); + // Extended latin-1 characters are 2 bytes in Utf8. + const size_t needle_length = + enc == BINARY ? needle->Length() : needle->Utf8Length(); if (needle_length == 0 || haystack_length == 0) { @@ -992,6 +1152,28 @@ void IndexOfNumber(const FunctionCallbackInfo& args) { : -1); } +void Swap16(const FunctionCallbackInfo& args) { + Environment* env = Environment::GetCurrent(args); + THROW_AND_RETURN_UNLESS_BUFFER(env, args.This()); + SPREAD_ARG(args.This(), ts_obj); + + for (size_t i = 0; i < ts_obj_length; i += 2) { + SWAP_BYTES(ts_obj_data, i, i + 1); + } + args.GetReturnValue().Set(args.This()); +} + +void Swap32(const FunctionCallbackInfo& args) { + Environment* env = Environment::GetCurrent(args); + THROW_AND_RETURN_UNLESS_BUFFER(env, args.This()); + SPREAD_ARG(args.This(), ts_obj); + + for (size_t i = 0; i < ts_obj_length; i += 4) { + SWAP_BYTES(ts_obj_data, i, i + 3); + SWAP_BYTES(ts_obj_data, i + 1, i + 2); + } + args.GetReturnValue().Set(args.This()); +} // pass Buffer object to load prototype methods void SetupBufferJS(const FunctionCallbackInfo& args) { @@ -1043,6 +1225,7 @@ void Initialize(Local target, env->SetMethod(target, "byteLengthUtf8", ByteLengthUtf8); env->SetMethod(target, "compare", Compare); + env->SetMethod(target, "compareOffset", CompareOffset); env->SetMethod(target, "fill", Fill); env->SetMethod(target, "indexOfBuffer", IndexOfBuffer); env->SetMethod(target, "indexOfNumber", IndexOfNumber); @@ -1058,6 +1241,9 @@ void Initialize(Local target, env->SetMethod(target, "writeFloatBE", WriteFloatBE); env->SetMethod(target, "writeFloatLE", WriteFloatLE); + env->SetMethod(target, "swap16", Swap16); + env->SetMethod(target, "swap32", Swap32); + target->Set(env->context(), FIXED_ONE_BYTE_STRING(env->isolate(), "kMaxLength"), Integer::NewFromUnsigned(env->isolate(), kMaxLength)).FromJust(); diff --git a/src/node_buffer.h b/src/node_buffer.h index 503cbb167547a5..686450d984e6f9 100644 --- a/src/node_buffer.h +++ b/src/node_buffer.h @@ -5,6 +5,9 @@ #include "v8.h" namespace node { + +extern bool zero_fill_all_buffers; + namespace Buffer { static const unsigned int kMaxLength = diff --git a/src/node_constants.cc b/src/node_constants.cc index 51c2ee814ae504..87443c95be1b6d 100644 --- a/src/node_constants.cc +++ b/src/node_constants.cc @@ -716,6 +716,10 @@ void DefineSignalConstants(Local target) { NODE_DEFINE_CONSTANT(target, SIGPWR); #endif +#ifdef SIGINFO + NODE_DEFINE_CONSTANT(target, SIGINFO); +#endif + #ifdef SIGSYS NODE_DEFINE_CONSTANT(target, SIGSYS); #endif @@ -864,6 +868,10 @@ void DefineOpenSSLConstants(Local target) { # ifndef OPENSSL_NO_ENGINE +# ifdef ENGINE_METHOD_RSA + NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_RSA); +# endif + # ifdef ENGINE_METHOD_DSA NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_DSA); # endif @@ -935,6 +943,11 @@ void DefineOpenSSLConstants(Local target) { NODE_DEFINE_CONSTANT(target, NPN_ENABLED); #endif +#ifdef TLSEXT_TYPE_application_layer_protocol_negotiation +#define ALPN_ENABLED 1 + NODE_DEFINE_CONSTANT(target, ALPN_ENABLED); +#endif + #ifdef RSA_PKCS1_PADDING NODE_DEFINE_CONSTANT(target, RSA_PKCS1_PADDING); #endif diff --git a/src/node_contextify.cc b/src/node_contextify.cc index 8880439c8a7e3f..1f2e73dc36cd16 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -13,6 +13,7 @@ namespace node { using v8::AccessType; using v8::Array; +using v8::ArrayBuffer; using v8::Boolean; using v8::Context; using v8::Debug; @@ -40,56 +41,37 @@ using v8::ScriptCompiler; using v8::ScriptOrigin; using v8::String; using v8::TryCatch; +using v8::Uint8Array; using v8::UnboundScript; using v8::V8; using v8::Value; -using v8::WeakCallbackData; +using v8::WeakCallbackInfo; class ContextifyContext { protected: - enum Kind { - kSandbox, - kContext, - kProxyGlobal - }; + // V8 reserves the first field in context objects for the debugger. We use the + // second field to hold a reference to the sandbox object. + enum { kSandboxObjectIndex = 1 }; Environment* const env_; - Persistent sandbox_; Persistent context_; - Persistent proxy_global_; - int references_; public: - explicit ContextifyContext(Environment* env, Local sandbox) - : env_(env), - sandbox_(env->isolate(), sandbox), - // Wait for sandbox_, proxy_global_, and context_ to die - references_(0) { - context_.Reset(env->isolate(), CreateV8Context(env)); - - sandbox_.SetWeak(this, WeakCallback); - sandbox_.MarkIndependent(); - references_++; + ContextifyContext(Environment* env, Local sandbox_obj) : env_(env) { + Local v8_context = CreateV8Context(env, sandbox_obj); + context_.Reset(env->isolate(), v8_context); // Allocation failure or maximum call stack size reached if (context_.IsEmpty()) return; - context_.SetWeak(this, WeakCallback); + context_.SetWeak(this, WeakCallback, v8::WeakCallbackType::kParameter); context_.MarkIndependent(); - references_++; - - proxy_global_.Reset(env->isolate(), context()->Global()); - proxy_global_.SetWeak(this, WeakCallback); - proxy_global_.MarkIndependent(); - references_++; } ~ContextifyContext() { context_.Reset(); - proxy_global_.Reset(); - sandbox_.Reset(); } @@ -103,6 +85,15 @@ class ContextifyContext { } + inline Local global_proxy() const { + return context()->Global(); + } + + + inline Local sandbox() const { + return Local::Cast(context()->GetEmbedderData(kSandboxObjectIndex)); + } + // XXX(isaacs): This function only exists because of a shortcoming of // the V8 SetNamedPropertyHandler function. // @@ -130,7 +121,7 @@ class ContextifyContext { Local context = PersistentToLocal(env()->isolate(), context_); Local global = context->Global()->GetPrototype()->ToObject(env()->isolate()); - Local sandbox = PersistentToLocal(env()->isolate(), sandbox_); + Local sandbox_obj = sandbox(); Local clone_property_method; @@ -138,7 +129,7 @@ class ContextifyContext { int length = names->Length(); for (int i = 0; i < length; i++) { Local key = names->Get(i)->ToString(env()->isolate()); - bool has = sandbox->HasOwnProperty(key); + bool has = sandbox_obj->HasOwnProperty(context, key).FromJust(); if (!has) { // Could also do this like so: // @@ -171,8 +162,8 @@ class ContextifyContext { clone_property_method = Local::Cast(script->Run()); CHECK(clone_property_method->IsFunction()); } - Local args[] = { global, key, sandbox }; - clone_property_method->Call(global, ARRAY_SIZE(args), args); + Local args[] = { global, key, sandbox_obj }; + clone_property_method->Call(global, arraysize(args), args); } } } @@ -195,14 +186,13 @@ class ContextifyContext { } - Local CreateV8Context(Environment* env) { + Local CreateV8Context(Environment* env, Local sandbox_obj) { EscapableHandleScope scope(env->isolate()); Local function_template = FunctionTemplate::New(env->isolate()); function_template->SetHiddenPrototype(true); - Local sandbox = PersistentToLocal(env->isolate(), sandbox_); - function_template->SetClassName(sandbox->GetConstructorName()); + function_template->SetClassName(sandbox_obj->GetConstructorName()); Local object_template = function_template->InstanceTemplate(); @@ -220,6 +210,17 @@ class ContextifyContext { CHECK(!ctx.IsEmpty()); ctx->SetSecurityToken(env->context()->GetSecurityToken()); + // We need to tie the lifetime of the sandbox object with the lifetime of + // newly created context. We do this by making them hold references to each + // other. The context can directly hold a reference to the sandbox as an + // embedder data field. However, we cannot hold a reference to a v8::Context + // directly in an Object, we instead hold onto the new context's global + // object instead (which then has a reference to the context). + ctx->SetEmbedderData(kSandboxObjectIndex, sandbox_obj); + sandbox_obj->SetHiddenValue( + FIXED_ONE_BYTE_STRING(env->isolate(), "_contextifyHiddenGlobal"), + ctx->Global()); + env->AssignToContext(ctx); return scope.Escape(ctx); @@ -239,37 +240,26 @@ class ContextifyContext { static void RunInDebugContext(const FunctionCallbackInfo& args) { - // Ensure that the debug context has an Environment assigned in case - // a fatal error is raised. The fatal exception handler in node.cc - // is not equipped to deal with contexts that don't have one and - // can't easily be taught that due to a deficiency in the V8 API: - // there is no way for the embedder to tell if the data index is - // in use. - struct ScopedEnvironment { - ScopedEnvironment(Local context, Environment* env) - : context_(context) { - const int index = Environment::kContextEmbedderDataIndex; - context->SetAlignedPointerInEmbedderData(index, env); - } - ~ScopedEnvironment() { - const int index = Environment::kContextEmbedderDataIndex; - context_->SetAlignedPointerInEmbedderData(index, nullptr); - } - Local context_; - }; - Local script_source(args[0]->ToString(args.GetIsolate())); if (script_source.IsEmpty()) return; // Exception pending. Local debug_context = Debug::GetDebugContext(); + Environment* env = Environment::GetCurrent(args); if (debug_context.IsEmpty()) { // Force-load the debug context. Debug::GetMirror(args.GetIsolate()->GetCurrentContext(), args[0]); debug_context = Debug::GetDebugContext(); CHECK(!debug_context.IsEmpty()); + // Ensure that the debug context has an Environment assigned in case + // a fatal error is raised. The fatal exception handler in node.cc + // is not equipped to deal with contexts that don't have one and + // can't easily be taught that due to a deficiency in the V8 API: + // there is no way for the embedder to tell if the data index is + // in use. + const int index = Environment::kContextEmbedderDataIndex; + debug_context->SetAlignedPointerInEmbedderData(index, env); } - Environment* env = Environment::GetCurrent(args); - ScopedEnvironment env_scope(debug_context, env); + Context::Scope context_scope(debug_context); Local'; +const y = 'foo⠊Set-Cookie: foo=bar'; + +var count = 0; + +const server = http.createServer((req, res) => { + switch (count++) { + case 0: + const loc = url.parse(req.url, true).query.lang; + assert.throws(common.mustCall(() => { + res.writeHead(302, {Location: `/foo?lang=${loc}`}); + })); + break; + case 1: + assert.throws(common.mustCall(() => { + res.writeHead(200, {'foo' : x}); + })); + break; + case 2: + assert.throws(common.mustCall(() => { + res.writeHead(200, {'foo' : y}); + })); + break; + default: + assert.fail(null, null, 'should not get to here.'); + } + if (count === 3) + server.close(); + res.end('ok'); +}); +server.listen(common.PORT, () => { + const end = 'HTTP/1.1\r\n\r\n'; + const client = net.connect({port: common.PORT}, () => { + client.write(`GET ${str} ${end}`); + client.write(`GET / ${end}`); + client.write(`GET / ${end}`); + client.end(); + }); +}); diff --git a/test/parallel/test-http-response-statuscode.js b/test/parallel/test-http-response-statuscode.js new file mode 100644 index 00000000000000..3314506339b564 --- /dev/null +++ b/test/parallel/test-http-response-statuscode.js @@ -0,0 +1,91 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +const MAX_REQUESTS = 12; +var reqNum = 0; + +const server = http.Server(common.mustCall(function(req, res) { + switch (reqNum) { + case 0: + assert.throws(common.mustCall(() => { + res.writeHead(-1); + }, /invalid status code/i)); + break; + case 1: + assert.throws(common.mustCall(() => { + res.writeHead(Infinity); + }, /invalid status code/i)); + break; + case 2: + assert.throws(common.mustCall(() => { + res.writeHead(NaN); + }, /invalid status code/i)); + break; + case 3: + assert.throws(common.mustCall(() => { + res.writeHead({}); + }, /invalid status code/i)); + break; + case 4: + assert.throws(common.mustCall(() => { + res.writeHead(99); + }, /invalid status code/i)); + break; + case 5: + assert.throws(common.mustCall(() => { + res.writeHead(1000); + }, /invalid status code/i)); + break; + case 6: + assert.throws(common.mustCall(() => { + res.writeHead('1000'); + }, /invalid status code/i)); + break; + case 7: + assert.throws(common.mustCall(() => { + res.writeHead(null); + }, /invalid status code/i)); + break; + case 8: + assert.throws(common.mustCall(() => { + res.writeHead(true); + }, /invalid status code/i)); + break; + case 9: + assert.throws(common.mustCall(() => { + res.writeHead([]); + }, /invalid status code/i)); + break; + case 10: + assert.throws(common.mustCall(() => { + res.writeHead('this is not valid'); + }, /invalid status code/i)); + break; + case 11: + assert.throws(common.mustCall(() => { + res.writeHead('404 this is not valid either'); + }, /invalid status code/i)); + this.close(); + break; + default: + throw new Error('Unexpected request'); + } + res.statusCode = 200; + res.end(); +}, MAX_REQUESTS)); +server.listen(); + +server.on('listening', function makeRequest() { + http.get({ + port: this.address().port + }, (res) => { + assert.strictEqual(res.statusCode, 200); + res.on('end', () => { + if (++reqNum < MAX_REQUESTS) + makeRequest.call(this); + }); + res.resume(); + }); +}); diff --git a/test/parallel/test-http-server-consumed-timeout.js b/test/parallel/test-http-server-consumed-timeout.js new file mode 100644 index 00000000000000..26110b32e7fba4 --- /dev/null +++ b/test/parallel/test-http-server-consumed-timeout.js @@ -0,0 +1,36 @@ +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +const server = http.createServer((req, res) => { + server.close(); + + res.writeHead(200); + res.flushHeaders(); + + req.setTimeout(common.platformTimeout(200), () => { + assert(false, 'Should not happen'); + }); + req.resume(); + req.once('end', common.mustCall(() => { + res.end(); + })); +}); + +server.listen(common.PORT, common.mustCall(() => { + const req = http.request({ + port: common.PORT, + method: 'POST' + }, (res) => { + const interval = setInterval(() => { + req.write('a'); + }, common.platformTimeout(25)); + setTimeout(() => { + clearInterval(interval); + req.end(); + }, common.platformTimeout(400)); + }); + req.write('.'); +})); diff --git a/test/parallel/test-http-server-multiheaders.js b/test/parallel/test-http-server-multiheaders.js index 7033ef8e7079f2..99d72988479928 100644 --- a/test/parallel/test-http-server-multiheaders.js +++ b/test/parallel/test-http-server-multiheaders.js @@ -16,6 +16,7 @@ var srv = http.createServer(function(req, res) { assert.equal(req.headers['x-bar'], 'banjo, bango'); assert.equal(req.headers['sec-websocket-protocol'], 'chat, share'); assert.equal(req.headers['sec-websocket-extensions'], 'foo; 1, bar; 2, baz'); + assert.equal(req.headers['constructor'], 'foo, bar, baz'); res.writeHead(200, {'Content-Type' : 'text/plain'}); res.end('EOF'); @@ -48,7 +49,10 @@ srv.listen(common.PORT, function() { ['sec-websocket-protocol', 'share'], ['sec-websocket-extensions', 'foo; 1'], ['sec-websocket-extensions', 'bar; 2'], - ['sec-websocket-extensions', 'baz'] + ['sec-websocket-extensions', 'baz'], + ['constructor', 'foo'], + ['constructor', 'bar'], + ['constructor', 'baz'], ] }); }); diff --git a/test/parallel/test-http-server-multiheaders2.js b/test/parallel/test-http-server-multiheaders2.js index 438e8ba759e8ba..bf54af3465319e 100644 --- a/test/parallel/test-http-server-multiheaders2.js +++ b/test/parallel/test-http-server-multiheaders2.js @@ -57,7 +57,6 @@ var srv = http.createServer(function(req, res) { assert.equal(req.headers[header.toLowerCase()], 'foo, bar', 'header parsed incorrectly: ' + header); }); - assert.equal(req.headers['content-length'], 0); res.writeHead(200, {'Content-Type' : 'text/plain'}); res.end('EOF'); @@ -75,10 +74,7 @@ var headers = [] .concat(multipleAllowed.map(makeHeader('foo'))) .concat(multipleForbidden.map(makeHeader('foo'))) .concat(multipleAllowed.map(makeHeader('bar'))) - .concat(multipleForbidden.map(makeHeader('bar'))) - // content-length is a special case since node.js - // is dropping connetions with non-numeric headers - .concat([['content-length', 0], ['content-length', 123]]); + .concat(multipleForbidden.map(makeHeader('bar'))); srv.listen(common.PORT, function() { http.get({ diff --git a/test/parallel/test-http-server-reject-chunked-with-content-length.js b/test/parallel/test-http-server-reject-chunked-with-content-length.js new file mode 100644 index 00000000000000..42cc1e83eb26d6 --- /dev/null +++ b/test/parallel/test-http-server-reject-chunked-with-content-length.js @@ -0,0 +1,31 @@ +'use strict'; + +const common = require('../common'); +const http = require('http'); +const net = require('net'); +const assert = require('assert'); + +const reqstr = 'POST / HTTP/1.1\r\n' + + 'Content-Length: 1\r\n' + + 'Transfer-Encoding: chunked\r\n\r\n'; + +const server = http.createServer((req, res) => { + assert.fail(null, null, 'callback should not be invoked'); +}); +server.on('clientError', common.mustCall((err) => { + assert(/^Parse Error/.test(err.message)); + assert.equal(err.code, 'HPE_UNEXPECTED_CONTENT_LENGTH'); + server.close(); +})); +server.listen(common.PORT, () => { + const client = net.connect({port: common.PORT}, () => { + client.write(reqstr); + client.end(); + }); + client.on('data', (data) => { + // Should not get to this point because the server should simply + // close the connection without returning any data. + assert.fail(null, null, 'no data should be returned by the server'); + }); + client.on('end', common.mustCall(() => {})); +}); diff --git a/test/parallel/test-http-server-reject-cr-no-lf.js b/test/parallel/test-http-server-reject-cr-no-lf.js new file mode 100644 index 00000000000000..fbb89f0ff3004d --- /dev/null +++ b/test/parallel/test-http-server-reject-cr-no-lf.js @@ -0,0 +1,33 @@ +'use strict'; + +const common = require('../common'); +const net = require('net'); +const http = require('http'); +const assert = require('assert'); + +const str = 'GET / HTTP/1.1\r\n' + + 'Dummy: Header\r' + + 'Content-Length: 1\r\n' + + '\r\n'; + + +const server = http.createServer((req, res) => { + assert.fail(null, null, 'this should not be called'); +}); +server.on('clientError', common.mustCall((err) => { + assert(/^Parse Error/.test(err.message)); + assert.equal(err.code, 'HPE_LF_EXPECTED'); + server.close(); +})); +server.listen(common.PORT, () => { + const client = net.connect({port:common.PORT}, () => { + client.on('data', (chunk) => { + assert.fail(null, null, 'this should not be called'); + }); + client.on('end', common.mustCall(() => { + server.close(); + })); + client.write(str); + client.end(); + }); +}); diff --git a/test/parallel/test-http-server-stale-close.js b/test/parallel/test-http-server-stale-close.js index a866d39c2cc735..349e869c1a4fbc 100644 --- a/test/parallel/test-http-server-stale-close.js +++ b/test/parallel/test-http-server-stale-close.js @@ -1,6 +1,5 @@ 'use strict'; var common = require('../common'); -var assert = require('assert'); var http = require('http'); var util = require('util'); var fork = require('child_process').fork; diff --git a/test/parallel/test-http-set-timeout-server.js b/test/parallel/test-http-set-timeout-server.js index 67db16d2a26111..d530503aa1e9aa 100644 --- a/test/parallel/test-http-set-timeout-server.js +++ b/test/parallel/test-http-set-timeout-server.js @@ -30,7 +30,9 @@ test(function serverTimeout(cb) { var server = http.createServer(function(req, res) { // just do nothing, we should get a timeout event. }); - server.listen(common.PORT); + server.listen(common.mustCall(function() { + http.get({ port: server.address().port }).on('error', function() {}); + })); var s = server.setTimeout(50, function(socket) { caughtTimeout = true; socket.destroy(); @@ -38,7 +40,6 @@ test(function serverTimeout(cb) { cb(); }); assert.ok(s instanceof http.Server); - http.get({ port: common.PORT }).on('error', function() {}); }); test(function serverRequestTimeout(cb) { @@ -56,11 +57,13 @@ test(function serverRequestTimeout(cb) { }); assert.ok(s instanceof http.IncomingMessage); }); - server.listen(common.PORT); - var req = http.request({ port: common.PORT, method: 'POST' }); - req.on('error', function() {}); - req.write('Hello'); - // req is in progress + server.listen(common.mustCall(function() { + var port = server.address().port; + var req = http.request({ port: port, method: 'POST' }); + req.on('error', function() {}); + req.write('Hello'); + // req is in progress + })); }); test(function serverResponseTimeout(cb) { @@ -78,8 +81,10 @@ test(function serverResponseTimeout(cb) { }); assert.ok(s instanceof http.OutgoingMessage); }); - server.listen(common.PORT); - http.get({ port: common.PORT }).on('error', function() {}); + server.listen(common.mustCall(function() { + var port = server.address().port; + http.get({ port: port }).on('error', function() {}); + })); }); test(function serverRequestNotTimeoutAfterEnd(cb) { @@ -104,8 +109,10 @@ test(function serverRequestNotTimeoutAfterEnd(cb) { server.close(); cb(); }); - server.listen(common.PORT); - http.get({ port: common.PORT }).on('error', function() {}); + server.listen(common.mustCall(function() { + var port = server.address().port; + http.get({ port: port }).on('error', function() {}); + })); }); test(function serverResponseTimeoutWithPipeline(cb) { @@ -125,12 +132,14 @@ test(function serverResponseTimeoutWithPipeline(cb) { server.close(); cb(); }); - server.listen(common.PORT); - var c = net.connect({ port: common.PORT, allowHalfOpen: true }, function() { - c.write('GET /1 HTTP/1.1\r\nHost: localhost\r\n\r\n'); - c.write('GET /2 HTTP/1.1\r\nHost: localhost\r\n\r\n'); - c.write('GET /3 HTTP/1.1\r\nHost: localhost\r\n\r\n'); - }); + server.listen(common.mustCall(function() { + var port = server.address().port; + var c = net.connect({ port: port, allowHalfOpen: true }, function() { + c.write('GET /1 HTTP/1.1\r\nHost: localhost\r\n\r\n'); + c.write('GET /2 HTTP/1.1\r\nHost: localhost\r\n\r\n'); + c.write('GET /3 HTTP/1.1\r\nHost: localhost\r\n\r\n'); + }); + })); }); test(function idleTimeout(cb) { @@ -158,9 +167,11 @@ test(function idleTimeout(cb) { cb(); }); assert.ok(s instanceof http.Server); - server.listen(common.PORT); - var c = net.connect({ port: common.PORT, allowHalfOpen: true }, function() { - c.write('GET /1 HTTP/1.1\r\nHost: localhost\r\n\r\n'); - // Keep-Alive - }); + server.listen(common.mustCall(function() { + var port = server.address().port; + var c = net.connect({ port: port, allowHalfOpen: true }, function() { + c.write('GET /1 HTTP/1.1\r\nHost: localhost\r\n\r\n'); + // Keep-Alive + }); + })); }); diff --git a/test/parallel/test-http-set-timeout.js b/test/parallel/test-http-set-timeout.js index 9bda60b2226443..ca238de43144e2 100644 --- a/test/parallel/test-http-set-timeout.js +++ b/test/parallel/test-http-set-timeout.js @@ -20,7 +20,7 @@ server.listen(common.PORT, function() { var errorTimer = setTimeout(function() { throw new Error('Timeout was not successful'); - }, 2000); + }, common.platformTimeout(2000)); var x = http.get({port: common.PORT, path: '/'}); x.on('error', function() { diff --git a/test/parallel/test-http-set-trailers.js b/test/parallel/test-http-set-trailers.js index 6f5c02f5605969..000df0189a9286 100644 --- a/test/parallel/test-http-set-trailers.js +++ b/test/parallel/test-http-set-trailers.js @@ -33,7 +33,7 @@ server.on('listening', function() { c.on('end', function() { c.end(); - assert.ok(! /x-foo/.test(res_buffer), 'Trailer in HTTP/1.0 response.'); + assert.ok(!/x-foo/.test(res_buffer), 'Trailer in HTTP/1.0 response.'); outstanding_reqs--; if (outstanding_reqs == 0) { server.close(); @@ -53,7 +53,7 @@ server.on('listening', function() { c.on('connect', function() { outstanding_reqs++; c.write('GET / HTTP/1.1\r\n\r\n'); - tid = setTimeout(assert.fail, 2000, 'Couldn\'t find last chunk.'); + tid = setTimeout(common.fail, 2000, 'Couldn\'t find last chunk.'); }); c.on('data', function(chunk) { diff --git a/test/parallel/test-http-status-code.js b/test/parallel/test-http-status-code.js index 19c36b0b2fd27f..5fedb529f82fcc 100644 --- a/test/parallel/test-http-status-code.js +++ b/test/parallel/test-http-status-code.js @@ -7,7 +7,7 @@ var http = require('http'); // ServerResponse.prototype.statusCode var testsComplete = 0; -var tests = [200, 202, 300, 404, 500]; +var tests = [200, 202, 300, 404, 451, 500]; var testIdx = 0; var s = http.createServer(function(req, res) { @@ -42,6 +42,6 @@ function nextTest() { process.on('exit', function() { - assert.equal(4, testsComplete); + assert.equal(5, testsComplete); }); diff --git a/test/parallel/test-http-timeout.js b/test/parallel/test-http-timeout.js index aab903420f0acc..abaa368045d14d 100644 --- a/test/parallel/test-http-timeout.js +++ b/test/parallel/test-http-timeout.js @@ -1,6 +1,5 @@ 'use strict'; var common = require('../common'); -var assert = require('assert'); var http = require('http'); @@ -24,20 +23,22 @@ server.listen(port, function() { var count = 0; function createRequest() { - var req = http.request({port: port, path: '/', agent: agent}, - function(res) { - req.clearTimeout(callback); - - res.on('end', function() { - count++; - - if (count == 11) { - server.close(); - } - }); - - res.resume(); - }); + const req = http.request( + {port: port, path: '/', agent: agent}, + function(res) { + req.clearTimeout(callback); + + res.on('end', function() { + count++; + + if (count == 11) { + server.close(); + } + }); + + res.resume(); + } + ); req.setTimeout(1000, callback); return req; diff --git a/test/parallel/test-http-unix-socket.js b/test/parallel/test-http-unix-socket.js index 98ed839241c2c6..bdac0566c33a42 100644 --- a/test/parallel/test-http-unix-socket.js +++ b/test/parallel/test-http-unix-socket.js @@ -1,7 +1,6 @@ 'use strict'; var common = require('../common'); var assert = require('assert'); -var fs = require('fs'); var http = require('http'); var status_ok = false; // status code == 200? diff --git a/test/parallel/test-http-upgrade-advertise.js b/test/parallel/test-http-upgrade-advertise.js new file mode 100644 index 00000000000000..fbc183f84b2ada --- /dev/null +++ b/test/parallel/test-http-upgrade-advertise.js @@ -0,0 +1,54 @@ +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +const tests = [ + { headers: {}, expected: 'regular' }, + { headers: { upgrade: 'h2c' }, expected: 'regular' }, + { headers: { connection: 'upgrade' }, expected: 'regular' }, + { headers: { connection: 'upgrade', upgrade: 'h2c' }, expected: 'upgrade' } +]; + +function fire() { + if (tests.length === 0) + return server.close(); + + const test = tests.shift(); + + const done = common.mustCall(function done(result) { + assert.equal(result, test.expected); + + fire(); + }); + + const req = http.request({ + port: common.PORT, + path: '/', + headers: test.headers + }, function onResponse(res) { + res.resume(); + done('regular'); + }); + + req.on('upgrade', function onUpgrade(res, socket) { + socket.destroy(); + done('upgrade'); + }); + + req.end(); +} + +const server = http.createServer(function(req, res) { + res.writeHead(200, { + Connection: 'upgrade, keep-alive', + Upgrade: 'h2c' + }); + res.end('hello world'); +}).on('upgrade', function(req, socket) { + socket.end('HTTP/1.1 101 Switching protocols\r\n' + + 'Connection: upgrade\r\n' + + 'Upgrade: h2c\r\n\r\n' + + 'ohai'); +}).listen(common.PORT, fire); diff --git a/test/parallel/test-http-upgrade-agent.js b/test/parallel/test-http-upgrade-agent.js index 84cfee90d528de..7590354f50b393 100644 --- a/test/parallel/test-http-upgrade-agent.js +++ b/test/parallel/test-http-upgrade-agent.js @@ -36,6 +36,7 @@ srv.listen(common.PORT, '127.0.0.1', function() { port: common.PORT, host: '127.0.0.1', headers: { + 'connection': 'upgrade', 'upgrade': 'websocket' } }; @@ -45,9 +46,14 @@ srv.listen(common.PORT, '127.0.0.1', function() { req.end(); req.on('upgrade', function(res, socket, upgradeHead) { - // XXX: This test isn't fantastic, as it assumes that the entire response - // from the server will arrive in a single data callback - assert.equal(upgradeHead, 'nurtzo'); + var recvData = upgradeHead; + socket.on('data', function(d) { + recvData += d; + }); + + socket.on('close', common.mustCall(function() { + assert.equal(recvData, 'nurtzo'); + })); console.log(res.headers); var expectedHeaders = { 'hello': 'world', diff --git a/test/parallel/test-http-upgrade-client.js b/test/parallel/test-http-upgrade-client.js index b8ba033f2e01cb..a45c06b44e04f0 100644 --- a/test/parallel/test-http-upgrade-client.js +++ b/test/parallel/test-http-upgrade-client.js @@ -32,11 +32,22 @@ var gotUpgrade = false; srv.listen(common.PORT, '127.0.0.1', function() { - var req = http.get({ port: common.PORT }); + var req = http.get({ + port: common.PORT, + headers: { + connection: 'upgrade', + upgrade: 'websocket' + } + }); req.on('upgrade', function(res, socket, upgradeHead) { - // XXX: This test isn't fantastic, as it assumes that the entire response - // from the server will arrive in a single data callback - assert.equal(upgradeHead, 'nurtzo'); + var recvData = upgradeHead; + socket.on('data', function(d) { + recvData += d; + }); + + socket.on('close', common.mustCall(function() { + assert.equal(recvData, 'nurtzo'); + })); console.log(res.headers); var expectedHeaders = {'hello': 'world', diff --git a/test/parallel/test-http-url.parse-https.request.js b/test/parallel/test-http-url.parse-https.request.js index 10c40ec0310708..df01ae64f81dba 100644 --- a/test/parallel/test-http-url.parse-https.request.js +++ b/test/parallel/test-http-url.parse-https.request.js @@ -10,7 +10,6 @@ var https = require('https'); var url = require('url'); var fs = require('fs'); -var clientRequest; // https options var httpsOptions = { diff --git a/test/parallel/test-http-url.parse-only-support-http-https-protocol.js b/test/parallel/test-http-url.parse-only-support-http-https-protocol.js index fd52a0b62d11de..0e997694aa7459 100644 --- a/test/parallel/test-http-url.parse-only-support-http-https-protocol.js +++ b/test/parallel/test-http-url.parse-only-support-http-https-protocol.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var http = require('http'); var url = require('url'); diff --git a/test/parallel/test-https-agent-disable-session-reuse.js b/test/parallel/test-https-agent-disable-session-reuse.js new file mode 100644 index 00000000000000..a4f9517bd52ff3 --- /dev/null +++ b/test/parallel/test-https-agent-disable-session-reuse.js @@ -0,0 +1,59 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); + +if (!common.hasCrypto) { + console.log('1..0 # Skipped: missing crypto'); + return; +} + +const TOTAL_REQS = 2; + +const https = require('https'); + +const fs = require('fs'); + +const options = { + key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), + cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') +}; + +const clientSessions = []; +var serverRequests = 0; + +const agent = new https.Agent({ + maxCachedSessions: 0 +}); + +const server = https.createServer(options, function(req, res) { + serverRequests++; + res.end('ok'); +}).listen(common.PORT, function() { + var waiting = TOTAL_REQS; + function request() { + const options = { + agent: agent, + port: common.PORT, + rejectUnauthorized: false + }; + + https.request(options, function(res) { + clientSessions.push(res.socket.getSession()); + + res.resume(); + res.on('end', function() { + if (--waiting !== 0) + return request(); + server.close(); + }); + }).end(); + } + request(); +}); + +process.on('exit', function() { + assert.equal(serverRequests, TOTAL_REQS); + assert.equal(clientSessions.length, TOTAL_REQS); + assert.notEqual(clientSessions[0].toString('hex'), + clientSessions[1].toString('hex')); +}); diff --git a/test/parallel/test-https-agent-servername.js b/test/parallel/test-https-agent-servername.js index 2be40836a04ea2..f7d5e5a40d8679 100644 --- a/test/parallel/test-https-agent-servername.js +++ b/test/parallel/test-https-agent-servername.js @@ -1,6 +1,5 @@ 'use strict'; var common = require('../common'); -var assert = require('assert'); if (!common.hasCrypto) { console.log('1..0 # Skipped: missing crypto'); diff --git a/test/parallel/test-https-agent-session-eviction.js b/test/parallel/test-https-agent-session-eviction.js new file mode 100644 index 00000000000000..df6fdc3658c2c9 --- /dev/null +++ b/test/parallel/test-https-agent-session-eviction.js @@ -0,0 +1,88 @@ +'use strict'; + +const common = require('../common'); + +if (!common.hasCrypto) { + console.log('1..0 # Skipped: missing crypto'); + return; +} + +const assert = require('assert'); +const https = require('https'); +const fs = require('fs'); +const constants = require('constants'); + +const options = { + key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), + cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem'), + secureOptions: constants.SSL_OP_NO_TICKET +}; + +// Create TLS1.2 server +https.createServer(options, function(req, res) { + res.end('ohai'); +}).listen(common.PORT, function() { + first(this); +}); + +// Do request and let agent cache the session +function first(server) { + const req = https.request({ + port: common.PORT, + rejectUnauthorized: false + }, function(res) { + res.resume(); + + server.close(function() { + faultyServer(); + }); + }); + req.end(); +} + +// Create TLS1 server +function faultyServer() { + options.secureProtocol = 'TLSv1_method'; + https.createServer(options, function(req, res) { + res.end('hello faulty'); + }).listen(common.PORT, function() { + second(this); + }); +} + +// Attempt to request using cached session +function second(server, session) { + const req = https.request({ + port: common.PORT, + rejectUnauthorized: false + }, function(res) { + res.resume(); + }); + + // Let it fail + req.on('error', common.mustCall(function(err) { + assert(/wrong version number/.test(err.message)); + + req.on('close', function() { + third(server); + }); + })); + req.end(); +} + +// Try on more time - session should be evicted! +function third(server) { + const req = https.request({ + port: common.PORT, + rejectUnauthorized: false + }, function(res) { + res.resume(); + assert(!req.socket.isSessionReused()); + server.close(); + }); + req.on('error', function(err) { + // never called + assert(false); + }); + req.end(); +} diff --git a/test/parallel/test-https-agent-sni.js b/test/parallel/test-https-agent-sni.js new file mode 100644 index 00000000000000..117075f68264b4 --- /dev/null +++ b/test/parallel/test-https-agent-sni.js @@ -0,0 +1,52 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); + +if (!common.hasCrypto) { + console.log('1..0 # Skipped: missing crypto'); + return; +} +const https = require('https'); + +const fs = require('fs'); + +const options = { + key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), + cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') +}; + +const TOTAL = 4; +var waiting = TOTAL; + +const server = https.Server(options, function(req, res) { + if (--waiting === 0) server.close(); + + res.writeHead(200, { + 'x-sni': req.socket.servername + }); + res.end('hello world'); +}); + +server.listen(common.PORT, function() { + function expectResponse(id) { + return common.mustCall(function(res) { + res.resume(); + assert.equal(res.headers['x-sni'], 'sni.' + id); + }); + } + + var agent = new https.Agent({ + maxSockets: 1 + }); + for (var j = 0; j < TOTAL; j++) { + https.get({ + agent: agent, + + path: '/', + port: common.PORT, + host: '127.0.0.1', + servername: 'sni.' + j, + rejectUnauthorized: false + }, expectResponse(j)); + } +}); diff --git a/test/parallel/test-https-agent.js b/test/parallel/test-https-agent.js index a3bb28975a3155..9dea313e42ed8e 100644 --- a/test/parallel/test-https-agent.js +++ b/test/parallel/test-https-agent.js @@ -23,8 +23,8 @@ var server = https.Server(options, function(req, res) { var responses = 0; -var N = 10; -var M = 10; +var N = 4; +var M = 4; server.listen(common.PORT, function() { for (var i = 0; i < N; i++) { diff --git a/test/parallel/test-https-byteswritten.js b/test/parallel/test-https-byteswritten.js index 5163eccc262ffa..4d42714f3dc4c0 100644 --- a/test/parallel/test-https-byteswritten.js +++ b/test/parallel/test-https-byteswritten.js @@ -2,7 +2,6 @@ var common = require('../common'); var assert = require('assert'); var fs = require('fs'); -var http = require('http'); if (!common.hasCrypto) { console.log('1..0 # Skipped: missing crypto'); @@ -19,7 +18,7 @@ var body = 'hello world\n'; var httpsServer = https.createServer(options, function(req, res) { res.on('finish', function() { - assert(typeof(req.connection.bytesWritten) === 'number'); + assert(typeof req.connection.bytesWritten === 'number'); assert(req.connection.bytesWritten > 0); httpsServer.close(); console.log('ok'); diff --git a/test/parallel/test-https-close.js b/test/parallel/test-https-close.js new file mode 100644 index 00000000000000..8a9a4f89960af0 --- /dev/null +++ b/test/parallel/test-https-close.js @@ -0,0 +1,56 @@ +'use strict'; +const common = require('../common'); +const fs = require('fs'); + +if (!common.hasCrypto) { + console.log('1..0 # Skipped: missing crypto'); + return; +} +const https = require('https'); + +const options = { + key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), + cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') +}; + +var connections = {}; + +var server = https.createServer(options, function(req, res) { + var interval = setInterval(function() { + res.write('data'); + }, 1000); + interval.unref(); +}); + +server.on('connection', function(connection) { + var key = connection.remoteAddress + ':' + connection.remotePort; + connection.on('close', function() { + delete connections[key]; + }); + connections[key] = connection; +}); + +function shutdown() { + server.close(common.mustCall(function() {})); + + for (var key in connections) { + connections[key].destroy(); + delete connections[key]; + } +} + +server.listen(common.PORT, function() { + var requestOptions = { + hostname: '127.0.0.1', + port: common.PORT, + path: '/', + method: 'GET', + rejectUnauthorized: false + }; + + var req = https.request(requestOptions, function(res) { + res.on('data', function(d) {}); + setImmediate(shutdown); + }); + req.end(); +}); diff --git a/test/parallel/test-https-eof-for-eom.js b/test/parallel/test-https-eof-for-eom.js index 0445625bace642..50d909373ff5b0 100644 --- a/test/parallel/test-https-eof-for-eom.js +++ b/test/parallel/test-https-eof-for-eom.js @@ -53,7 +53,7 @@ var bodyBuffer = ''; server.listen(common.PORT, function() { console.log('1) Making Request'); - var req = https.get({ + https.get({ port: common.PORT, rejectUnauthorized: false }, function(res) { diff --git a/test/parallel/test-https-host-headers.js b/test/parallel/test-https-host-headers.js index 0ea32f320e736b..1e71fd5b9ef5b7 100644 --- a/test/parallel/test-https-host-headers.js +++ b/test/parallel/test-https-host-headers.js @@ -8,12 +8,12 @@ if (!common.hasCrypto) { } var https = require('https'); -var fs = require('fs'), - options = { - key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), - cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') - }, - httpsServer = https.createServer(options, reqHandler); +const fs = require('fs'); +const options = { + key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), + cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') +}; +const httpsServer = https.createServer(options, reqHandler); function reqHandler(req, res) { console.log('Got request: ' + req.headers.host + ' ' + req.url); diff --git a/test/parallel/test-https-localaddress-bind-error.js b/test/parallel/test-https-localaddress-bind-error.js index 66551a780aed9e..f5bb1f84c310b3 100644 --- a/test/parallel/test-https-localaddress-bind-error.js +++ b/test/parallel/test-https-localaddress-bind-error.js @@ -28,7 +28,7 @@ var server = https.createServer(options, function(req, res) { }); server.listen(common.PORT, '127.0.0.1', function() { - var req = https.request({ + https.request({ host: 'localhost', port: common.PORT, path: '/', diff --git a/test/parallel/test-https-localaddress.js b/test/parallel/test-https-localaddress.js index a330c4881a9e47..bce65d58e296f2 100644 --- a/test/parallel/test-https-localaddress.js +++ b/test/parallel/test-https-localaddress.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'), - fs = require('fs'), - assert = require('assert'); +const common = require('../common'); +const fs = require('fs'); +const assert = require('assert'); if (!common.hasCrypto) { console.log('1..0 # Skipped: missing crypto'); diff --git a/test/parallel/test-https-socket-options.js b/test/parallel/test-https-socket-options.js index 44e179f27a800c..2adf8c798dff65 100644 --- a/test/parallel/test-https-socket-options.js +++ b/test/parallel/test-https-socket-options.js @@ -1,6 +1,5 @@ 'use strict'; var common = require('../common'); -var assert = require('assert'); if (!common.hasCrypto) { console.log('1..0 # Skipped: missing crypto'); @@ -9,7 +8,6 @@ if (!common.hasCrypto) { var https = require('https'); var fs = require('fs'); -var exec = require('child_process').exec; var http = require('http'); diff --git a/test/parallel/test-https-strict.js b/test/parallel/test-https-strict.js index 65ebfabde2bcdd..04561959de130f 100644 --- a/test/parallel/test-https-strict.js +++ b/test/parallel/test-https-strict.js @@ -110,7 +110,7 @@ function makeReq(path, port, error, host, ca) { path: path, ca: ca }; - var whichCa = 0; + if (!ca) { options.agent = agent0; } else { diff --git a/test/parallel/test-https-timeout-server-2.js b/test/parallel/test-https-timeout-server-2.js index 9970688fe7c1e8..a195ce1938b9cd 100644 --- a/test/parallel/test-https-timeout-server-2.js +++ b/test/parallel/test-https-timeout-server-2.js @@ -9,7 +9,6 @@ if (!common.hasCrypto) { } var https = require('https'); -var net = require('net'); var tls = require('tls'); var fs = require('fs'); @@ -18,7 +17,7 @@ var options = { cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') }; -var server = https.createServer(options, assert.fail); +var server = https.createServer(options, common.fail); server.on('secureConnection', function(cleartext) { var s = cleartext.setTimeout(50, function() { diff --git a/test/parallel/test-https-timeout-server.js b/test/parallel/test-https-timeout-server.js index 0db7ad533d9868..f6d5d75a88abbe 100644 --- a/test/parallel/test-https-timeout-server.js +++ b/test/parallel/test-https-timeout-server.js @@ -9,7 +9,6 @@ if (!common.hasCrypto) { var https = require('https'); var net = require('net'); -var tls = require('tls'); var fs = require('fs'); var clientErrors = 0; @@ -24,7 +23,7 @@ var options = { handshakeTimeout: 50 }; -var server = https.createServer(options, assert.fail); +var server = https.createServer(options, common.fail); server.on('clientError', function(err, conn) { // Don't hesitate to update the asserts if the internal structure of diff --git a/test/parallel/test-https-timeout.js b/test/parallel/test-https-timeout.js index 7f34c18bec0897..2b41dadaec7857 100644 --- a/test/parallel/test-https-timeout.js +++ b/test/parallel/test-https-timeout.js @@ -1,6 +1,5 @@ 'use strict'; var common = require('../common'); -var assert = require('assert'); if (!common.hasCrypto) { console.log('1..0 # Skipped: missing crypto'); @@ -9,7 +8,6 @@ if (!common.hasCrypto) { var https = require('https'); var fs = require('fs'); -var exec = require('child_process').exec; var options = { key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), diff --git a/test/parallel/test-https-truncate.js b/test/parallel/test-https-truncate.js index e77bf29ed25454..83506c65d6f3cc 100644 --- a/test/parallel/test-https-truncate.js +++ b/test/parallel/test-https-truncate.js @@ -9,7 +9,6 @@ if (!common.hasCrypto) { var https = require('https'); var fs = require('fs'); -var path = require('path'); var key = fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'); var cert = fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem'); diff --git a/test/parallel/test-internal-modules-expose.js b/test/parallel/test-internal-modules-expose.js index 4ece1d0c7b6f29..ed3cecb6f29719 100644 --- a/test/parallel/test-internal-modules-expose.js +++ b/test/parallel/test-internal-modules-expose.js @@ -1,7 +1,7 @@ 'use strict'; // Flags: --expose_internals -var common = require('../common'); +require('../common'); var assert = require('assert'); assert.equal(typeof require('internal/freelist').FreeList, 'function'); diff --git a/test/parallel/test-internal-modules.js b/test/parallel/test-internal-modules.js index 011b6f7132e9bf..5d93a381c7acdf 100644 --- a/test/parallel/test-internal-modules.js +++ b/test/parallel/test-internal-modules.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); assert.throws(function() { diff --git a/test/parallel/test-intl.js b/test/parallel/test-intl.js index 7288febf9e6bfd..551cc013131427 100644 --- a/test/parallel/test-intl.js +++ b/test/parallel/test-intl.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); // does node think that i18n was enabled? @@ -20,14 +20,14 @@ function haveLocale(loc) { } if (!haveIntl) { - var erMsg = + const erMsg = '"Intl" object is NOT present but v8_enable_i18n_support is ' + enablei18n; assert.equal(enablei18n, false, erMsg); console.log('1..0 # Skipped: Intl tests because Intl object not present.'); } else { - var erMsg = + const erMsg = '"Intl" object is present but v8_enable_i18n_support is ' + enablei18n + '. Is this test out of date?'; diff --git a/test/parallel/test-js-stream-call-properties.js b/test/parallel/test-js-stream-call-properties.js index c6b1adb3cb7a7a..280e5d9dabee66 100644 --- a/test/parallel/test-js-stream-call-properties.js +++ b/test/parallel/test-js-stream-call-properties.js @@ -1,6 +1,6 @@ 'use strict'; -const common = require('../common'); +require('../common'); const util = require('util'); const JSStream = process.binding('js_stream').JSStream; diff --git a/test/parallel/test-listen-fd-cluster.js b/test/parallel/test-listen-fd-cluster.js index f6d00c72a0f78c..419efc7c099bf0 100644 --- a/test/parallel/test-listen-fd-cluster.js +++ b/test/parallel/test-listen-fd-cluster.js @@ -4,7 +4,6 @@ var assert = require('assert'); var http = require('http'); var net = require('net'); var PORT = common.PORT; -var spawn = require('child_process').spawn; var cluster = require('cluster'); console.error('Cluster listen fd test', process.argv[2] || 'runner'); @@ -22,7 +21,6 @@ if (common.isWindows) { switch (process.argv[2]) { case 'master': return master(); case 'worker': return worker(); - case 'parent': return parent(); } var ok; diff --git a/test/parallel/test-listen-fd-ebadf.js b/test/parallel/test-listen-fd-ebadf.js index db905dfa35e966..51e09a7907f18e 100644 --- a/test/parallel/test-listen-fd-ebadf.js +++ b/test/parallel/test-listen-fd-ebadf.js @@ -9,8 +9,8 @@ process.on('exit', function() { assert.equal(gotError, 2); }); -net.createServer(assert.fail).listen({fd:2}).on('error', onError); -net.createServer(assert.fail).listen({fd:42}).on('error', onError); +net.createServer(common.fail).listen({fd:2}).on('error', onError); +net.createServer(common.fail).listen({fd:42}).on('error', onError); function onError(ex) { assert.equal(ex.code, 'EINVAL'); diff --git a/test/parallel/test-listen-fd-server.js b/test/parallel/test-listen-fd-server.js index d51d51ee8eb4de..3e0fa521f75334 100644 --- a/test/parallel/test-listen-fd-server.js +++ b/test/parallel/test-listen-fd-server.js @@ -4,7 +4,6 @@ var assert = require('assert'); var http = require('http'); var net = require('net'); var PORT = common.PORT; -var spawn = require('child_process').spawn; if (common.isWindows) { console.log('1..0 # Skipped: This test is disabled on windows.'); diff --git a/test/sequential/test-memory-usage-emfile.js b/test/parallel/test-memory-usage-emfile.js similarity index 86% rename from test/sequential/test-memory-usage-emfile.js rename to test/parallel/test-memory-usage-emfile.js index 6b439049805786..92c103669a9a85 100644 --- a/test/sequential/test-memory-usage-emfile.js +++ b/test/parallel/test-memory-usage-emfile.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var fs = require('fs'); diff --git a/test/parallel/test-memory-usage.js b/test/parallel/test-memory-usage.js index 8394fc16599ef3..f704c8812801ba 100644 --- a/test/parallel/test-memory-usage.js +++ b/test/parallel/test-memory-usage.js @@ -1,6 +1,8 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var r = process.memoryUsage(); -assert.equal(true, r['rss'] > 0); +assert.ok(r.rss > 0); +assert.ok(r.heapTotal > 0); +assert.ok(r.heapUsed > 0); diff --git a/test/parallel/test-microtask-queue-integration-domain.js b/test/parallel/test-microtask-queue-integration-domain.js index 7a4ad77cd321e3..1e07fa5d415ba3 100644 --- a/test/parallel/test-microtask-queue-integration-domain.js +++ b/test/parallel/test-microtask-queue-integration-domain.js @@ -1,18 +1,17 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); -var domain = require('domain'); + +// Requiring the domain module here changes the function that is used by node to +// call process.nextTick's callbacks to a variant that specifically handles +// domains. We want to test this specific variant in this test, and so even if +// the domain module is not used, this require call is needed and must not be +// removed. +require('domain'); var implementations = [ function(fn) { Promise.resolve().then(fn); - }, - function(fn) { - var obj = {}; - - Object.observe(obj, fn); - - obj.a = 1; } ]; diff --git a/test/parallel/test-microtask-queue-integration.js b/test/parallel/test-microtask-queue-integration.js index 37de5ee33b1477..2cc608d96aec3d 100644 --- a/test/parallel/test-microtask-queue-integration.js +++ b/test/parallel/test-microtask-queue-integration.js @@ -1,17 +1,10 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var implementations = [ function(fn) { Promise.resolve().then(fn); - }, - function(fn) { - var obj = {}; - - Object.observe(obj, fn); - - obj.a = 1; } ]; diff --git a/test/parallel/test-microtask-queue-run-domain.js b/test/parallel/test-microtask-queue-run-domain.js index 77534920ff1451..fb5139f71d65aa 100644 --- a/test/parallel/test-microtask-queue-run-domain.js +++ b/test/parallel/test-microtask-queue-run-domain.js @@ -1,7 +1,13 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); -var domain = require('domain'); + +// Requiring the domain module here changes the function that is used by node to +// call process.nextTick's callbacks to a variant that specifically handles +// domains. We want to test this specific variant in this test, and so even if +// the domain module is not used, this require call is needed and must not be +// removed. +require('domain'); function enqueueMicrotask(fn) { Promise.resolve().then(fn); diff --git a/test/parallel/test-microtask-queue-run-immediate-domain.js b/test/parallel/test-microtask-queue-run-immediate-domain.js index 2dea0a76cc1bf4..4a7729ab98a062 100644 --- a/test/parallel/test-microtask-queue-run-immediate-domain.js +++ b/test/parallel/test-microtask-queue-run-immediate-domain.js @@ -1,7 +1,13 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); -var domain = require('domain'); + +// Requiring the domain module here changes the function that is used by node to +// call process.nextTick's callbacks to a variant that specifically handles +// domains. We want to test this specific variant in this test, and so even if +// the domain module is not used, this require call is needed and must not be +// removed. +require('domain'); function enqueueMicrotask(fn) { Promise.resolve().then(fn); diff --git a/test/parallel/test-microtask-queue-run-immediate.js b/test/parallel/test-microtask-queue-run-immediate.js index cfd9cd3659ef00..479062ad4710f4 100644 --- a/test/parallel/test-microtask-queue-run-immediate.js +++ b/test/parallel/test-microtask-queue-run-immediate.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); function enqueueMicrotask(fn) { diff --git a/test/parallel/test-microtask-queue-run.js b/test/parallel/test-microtask-queue-run.js index ca758546c2bcfd..ce743d93003249 100644 --- a/test/parallel/test-microtask-queue-run.js +++ b/test/parallel/test-microtask-queue-run.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); function enqueueMicrotask(fn) { diff --git a/test/parallel/test-module-loading-error.js b/test/parallel/test-module-loading-error.js index 3756953a40dc3c..072a6aadcb8c62 100644 --- a/test/parallel/test-module-loading-error.js +++ b/test/parallel/test-module-loading-error.js @@ -1,15 +1,15 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); console.error('load test-module-loading-error.js'); var error_desc = { - win32: '%1 is not a valid Win32 application', - linux: 'file too short', - sunos: 'unknown file type' + win32: ['%1 is not a valid Win32 application'], + linux: ['file too short', 'Exec format error'], + sunos: ['unknown file type', 'not an ELF file'], + darwin: ['file too short'] }; - var dlerror_msg = error_desc[process.platform]; if (!dlerror_msg) { @@ -20,7 +20,9 @@ if (!dlerror_msg) { try { require('../fixtures/module-loading-error.node'); } catch (e) { - assert.notEqual(e.toString().indexOf(dlerror_msg), -1); + assert.strictEqual(dlerror_msg.some((errMsgCase) => { + return e.toString().indexOf(errMsgCase) !== -1; + }), true); } try { diff --git a/test/parallel/test-module-require-depth.js b/test/parallel/test-module-require-depth.js new file mode 100644 index 00000000000000..4d2ddac151be68 --- /dev/null +++ b/test/parallel/test-module-require-depth.js @@ -0,0 +1,13 @@ +// Flags: --expose_internals +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const internalModule = require('internal/module'); + +// Module one loads two too so the expected depth for two is, well, two. +assert.strictEqual(internalModule.requireDepth, 0); +const one = require(common.fixturesDir + '/module-require-depth/one'); +const two = require(common.fixturesDir + '/module-require-depth/two'); +assert.deepStrictEqual(one, { requireDepth: 1 }); +assert.deepStrictEqual(two, { requireDepth: 2 }); +assert.strictEqual(internalModule.requireDepth, 0); diff --git a/test/parallel/test-net-better-error-messages-listen-path.js b/test/parallel/test-net-better-error-messages-listen-path.js index 8a7e0220b36dfa..41d22c3fb9a4b5 100644 --- a/test/parallel/test-net-better-error-messages-listen-path.js +++ b/test/parallel/test-net-better-error-messages-listen-path.js @@ -3,8 +3,8 @@ var common = require('../common'); var assert = require('assert'); var net = require('net'); var fp = '/blah/fadfa'; -var server = net.createServer(assert.fail); -server.listen(fp, assert.fail); +var server = net.createServer(common.fail); +server.listen(fp, common.fail); server.on('error', common.mustCall(function(e) { assert.equal(e.address, fp); })); diff --git a/test/parallel/test-net-better-error-messages-listen.js b/test/parallel/test-net-better-error-messages-listen.js index 7e5fad925aeb92..44adce71a7d541 100644 --- a/test/parallel/test-net-better-error-messages-listen.js +++ b/test/parallel/test-net-better-error-messages-listen.js @@ -3,8 +3,8 @@ var common = require('../common'); var assert = require('assert'); var net = require('net'); -var server = net.createServer(assert.fail); -server.listen(1, '1.1.1.1', assert.fail); +var server = net.createServer(common.fail); +server.listen(1, '1.1.1.1', common.fail); server.on('error', common.mustCall(function(e) { assert.equal(e.address, '1.1.1.1'); assert.equal(e.port, 1); diff --git a/test/parallel/test-net-better-error-messages-path.js b/test/parallel/test-net-better-error-messages-path.js index 06cfecbd7c6af1..9222a1cc758aaa 100644 --- a/test/parallel/test-net-better-error-messages-path.js +++ b/test/parallel/test-net-better-error-messages-path.js @@ -5,7 +5,7 @@ var assert = require('assert'); var fp = '/tmp/fadagagsdfgsdf'; var c = net.connect(fp); -c.on('connect', assert.fail); +c.on('connect', common.fail); c.on('error', common.mustCall(function(e) { assert.equal(e.code, 'ENOENT'); diff --git a/test/parallel/test-net-better-error-messages-port-hostname.js b/test/parallel/test-net-better-error-messages-port-hostname.js index bdca6c2b3ca00d..9db6fb26f57285 100644 --- a/test/parallel/test-net-better-error-messages-port-hostname.js +++ b/test/parallel/test-net-better-error-messages-port-hostname.js @@ -5,7 +5,7 @@ var assert = require('assert'); var c = net.createConnection(common.PORT, '...'); -c.on('connect', assert.fail); +c.on('connect', common.fail); c.on('error', common.mustCall(function(e) { assert.equal(e.code, 'ENOTFOUND'); diff --git a/test/parallel/test-net-better-error-messages-port.js b/test/parallel/test-net-better-error-messages-port.js index 0f90089c0509fe..514e317fbb0b15 100644 --- a/test/parallel/test-net-better-error-messages-port.js +++ b/test/parallel/test-net-better-error-messages-port.js @@ -5,7 +5,7 @@ var assert = require('assert'); var c = net.createConnection(common.PORT); -c.on('connect', assert.fail); +c.on('connect', common.fail); c.on('error', common.mustCall(function(e) { assert.equal(e.code, 'ECONNREFUSED'); diff --git a/test/parallel/test-net-bytes-read.js b/test/parallel/test-net-bytes-read.js new file mode 100644 index 00000000000000..ba2bc160d0a982 --- /dev/null +++ b/test/parallel/test-net-bytes-read.js @@ -0,0 +1,37 @@ +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +const big = Buffer.alloc(1024 * 1024); + +const server = net.createServer((socket) => { + socket.end(big); + server.close(); +}).listen(common.PORT, () => { + let prev = 0; + + function checkRaise(value) { + assert(value > prev); + prev = value; + } + + const socket = net.connect(common.PORT, () => { + socket.on('data', (chunk) => { + checkRaise(socket.bytesRead); + }); + + socket.on('end', common.mustCall(() => { + assert.equal(socket.bytesRead, prev); + assert.equal(big.length, prev); + })); + + socket.on('close', common.mustCall(() => { + assert(!socket._handle); + assert.equal(socket.bytesRead, prev); + assert.equal(big.length, prev); + })); + }); + socket.end(); +}); diff --git a/test/parallel/test-net-connect-immediate-finish.js b/test/parallel/test-net-connect-immediate-finish.js index 086cf910422372..a5403732ec1d0d 100644 --- a/test/parallel/test-net-connect-immediate-finish.js +++ b/test/parallel/test-net-connect-immediate-finish.js @@ -1,21 +1,17 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); -var gotError = false; +const client = net.connect({host: '...', port: common.PORT}); -var client = net.connect({ - host: 'no.way.you.will.resolve.this', - port: common.PORT -}); - -client.once('error', function(err) { - gotError = true; -}); +client.once('error', common.mustCall(function(err) { + assert(err); + assert.strictEqual(err.code, err.errno); + assert.strictEqual(err.code, 'ENOTFOUND'); + assert.strictEqual(err.host, err.hostname); + assert.strictEqual(err.host, '...'); + assert.strictEqual(err.syscall, 'getaddrinfo'); +})); client.end(); - -process.on('exit', function() { - assert(gotError); -}); diff --git a/test/parallel/test-net-connect-local-error.js b/test/parallel/test-net-connect-local-error.js new file mode 100644 index 00000000000000..197b283bdf3621 --- /dev/null +++ b/test/parallel/test-net-connect-local-error.js @@ -0,0 +1,15 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +var client = net.connect({ + port: common.PORT + 1, + localPort: common.PORT, + localAddress: common.localhostIPv4 +}); + +client.on('error', common.mustCall(function onError(err) { + assert.equal(err.localPort, common.PORT); + assert.equal(err.localAddress, common.localhostIPv4); +})); diff --git a/test/parallel/test-net-connect-options-ipv6.js b/test/parallel/test-net-connect-options-ipv6.js index f0f7bc65b3c7eb..5cce7325f91967 100644 --- a/test/parallel/test-net-connect-options-ipv6.js +++ b/test/parallel/test-net-connect-options-ipv6.js @@ -1,57 +1,70 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var net = require('net'); -var dns = require('dns'); +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); if (!common.hasIPv6) { console.log('1..0 # Skipped: no IPv6 support'); return; } -var serverGotEnd = false; -var clientGotEnd = false; +const hosts = common.localIPv6Hosts; +var hostIdx = 0; +var host = hosts[hostIdx]; +var localhostTries = 10; -dns.lookup('localhost', 6, function(err) { - if (err) { - console.error('Looks like IPv6 is not really supported'); - console.error(err); - return; - } +const server = net.createServer({allowHalfOpen: true}, function(socket) { + socket.resume(); + socket.on('end', common.mustCall(function() {})); + socket.end(); +}); - var server = net.createServer({allowHalfOpen: true}, function(socket) { - socket.resume(); - socket.on('end', function() { - serverGotEnd = true; - }); - socket.end(); - }); +server.listen(common.PORT, '::1', tryConnect); - server.listen(common.PORT, '::1', function() { - var client = net.connect({ - host: 'localhost', - port: common.PORT, - family: 6, - allowHalfOpen: true - }, function() { - console.error('client connect cb'); - client.resume(); - client.on('end', function() { - clientGotEnd = true; - setTimeout(function() { - assert(client.writable); - client.end(); - }, 10); - }); - client.on('close', function() { - server.close(); - }); +function tryConnect() { + const client = net.connect({ + host: host, + port: common.PORT, + family: 6, + allowHalfOpen: true + }, function() { + console.error('client connect cb'); + client.resume(); + client.on('end', common.mustCall(function() { + setTimeout(function() { + assert(client.writable); + client.end(); + }, 10); + })); + client.on('close', function() { + server.close(); }); + }).on('error', function(err) { + // ENOTFOUND means we don't have the requested address. In this + // case we try the next one in the list and if we run out of + // candidates we assume IPv6 is not supported on the + // machine and skip the test. + // EAI_AGAIN means we tried to remotely resolve the address and + // timed out or hit some intermittent connectivity issue with the + // dns server. Although we are looking for local loopback addresses + // we may go remote since the list we search includes addresses that + // cover more than is available on any one distribution. The + // net is that if we get an EAI_AGAIN we were looking for an + // address which does not exist in this distribution so the error + // is not significant and we should just move on and try the + // next address in the list. + if ((err.syscall === 'getaddrinfo') && ((err.code === 'ENOTFOUND') || + (err.code === 'EAI_AGAIN'))) { + if (host !== 'localhost' || --localhostTries === 0) + host = hosts[++hostIdx]; + if (host) + tryConnect(); + else { + console.log('1..0 # Skipped: no IPv6 localhost support'); + server.close(); + } + return; + } + throw err; }); - - process.on('exit', function() { - console.error('exit', serverGotEnd, clientGotEnd); - assert(serverGotEnd); - assert(clientGotEnd); - }); -}); +} diff --git a/test/parallel/test-net-create-connection.js b/test/parallel/test-net-create-connection.js index c245ddc2ae7860..c69d4f17ddb73c 100644 --- a/test/parallel/test-net-create-connection.js +++ b/test/parallel/test-net-create-connection.js @@ -1,14 +1,15 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const dns = require('dns'); +const net = require('net'); -var tcpPort = common.PORT; -var expectedConnections = 7; +const tcpPort = common.PORT; +const expectedConnections = 7; var clientConnected = 0; var serverConnected = 0; -var server = net.createServer(function(socket) { +const server = net.createServer(function(socket) { socket.end(); if (++serverConnected === expectedConnections) { server.close(); @@ -22,7 +23,7 @@ server.listen(tcpPort, 'localhost', function() { function fail(opts, errtype, msg) { assert.throws(function() { - var client = net.createConnection(opts, cb); + net.createConnection(opts, cb); }, function(err) { return err instanceof errtype && msg === err.message; }); @@ -87,6 +88,10 @@ server.listen(tcpPort, 'localhost', function() { fail({ port: 65536 }, RangeError, 'port should be >= 0 and < 65536: 65536'); + + fail({ + hints: (dns.ADDRCONFIG | dns.V4MAPPED) + 42, + }, TypeError, 'invalid argument: hints must use valid flags'); }); // Try connecting to random ports, but do so once the server is closed diff --git a/test/parallel/test-net-dns-custom-lookup.js b/test/parallel/test-net-dns-custom-lookup.js index 008e831c61fc9c..a2ce3966ae1237 100644 --- a/test/parallel/test-net-dns-custom-lookup.js +++ b/test/parallel/test-net-dns-custom-lookup.js @@ -2,7 +2,6 @@ var common = require('../common'); var assert = require('assert'); var net = require('net'); -var dns = require('dns'); var ok = false; function check(addressType, cb) { diff --git a/test/parallel/test-net-dns-error.js b/test/parallel/test-net-dns-error.js index 17f251cec3b6af..eed59cddebb851 100644 --- a/test/parallel/test-net-dns-error.js +++ b/test/parallel/test-net-dns-error.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var net = require('net'); @@ -7,12 +7,7 @@ var net = require('net'); var expected_bad_connections = 1; var actual_bad_connections = 0; -var host = '********'; -host += host; -host += host; -host += host; -host += host; -host += host; +var host = '*'.repeat(256); function do_not_call() { throw new Error('This function should not have been called.'); diff --git a/test/parallel/test-net-dns-lookup-skip.js b/test/parallel/test-net-dns-lookup-skip.js index 1083ed9fc0ad8f..9b3ae15fc393ae 100644 --- a/test/parallel/test-net-dns-lookup-skip.js +++ b/test/parallel/test-net-dns-lookup-skip.js @@ -1,6 +1,5 @@ 'use strict'; var common = require('../common'); -var assert = require('assert'); var net = require('net'); function check(addressType) { @@ -11,7 +10,7 @@ function check(addressType) { var address = addressType === 4 ? '127.0.0.1' : '::1'; server.listen(common.PORT, address, function() { - net.connect(common.PORT, address).on('lookup', assert.fail); + net.connect(common.PORT, address).on('lookup', common.fail); }); } diff --git a/test/parallel/test-net-dns-lookup.js b/test/parallel/test-net-dns-lookup.js index 2bcff9143c092d..097bdf8ecae0e0 100644 --- a/test/parallel/test-net-dns-lookup.js +++ b/test/parallel/test-net-dns-lookup.js @@ -10,12 +10,14 @@ var server = net.createServer(function(client) { }); server.listen(common.PORT, '127.0.0.1', function() { - net.connect(common.PORT, 'localhost').on('lookup', function(err, ip, type) { - assert.equal(err, null); - assert.equal(ip, '127.0.0.1'); - assert.equal(type, '4'); - ok = true; - }); + net.connect(common.PORT, 'localhost') + .on('lookup', function(err, ip, type, host) { + assert.equal(err, null); + assert.equal(ip, '127.0.0.1'); + assert.equal(type, '4'); + assert.equal(host, 'localhost'); + ok = true; + }); }); process.on('exit', function() { diff --git a/test/parallel/test-net-end-without-connect.js b/test/parallel/test-net-end-without-connect.js index 2911591f9f486d..69abf486316ff2 100644 --- a/test/parallel/test-net-end-without-connect.js +++ b/test/parallel/test-net-end-without-connect.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var net = require('net'); var sock = new net.Socket(); diff --git a/test/parallel/test-net-error-twice.js b/test/parallel/test-net-error-twice.js index af92ca93206f18..28e90ddd611ba9 100644 --- a/test/parallel/test-net-error-twice.js +++ b/test/parallel/test-net-error-twice.js @@ -1,16 +1,24 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); -var buf = new Buffer(10 * 1024 * 1024); +const buf = new Buffer(10 * 1024 * 1024); buf.fill(0x62); -var errs = []; +const errs = []; +var clientSocket; +var serverSocket; + +function ready() { + if (clientSocket && serverSocket) { + clientSocket.destroy(); + serverSocket.write(buf); + } +} var srv = net.createServer(function onConnection(conn) { - conn.write(buf); conn.on('error', function(err) { errs.push(err); if (errs.length > 1 && errs[0] === errs[1]) @@ -19,11 +27,14 @@ var srv = net.createServer(function onConnection(conn) { conn.on('close', function() { srv.unref(); }); + serverSocket = conn; + ready(); }).listen(common.PORT, function() { var client = net.connect({ port: common.PORT }); client.on('connect', function() { - client.destroy(); + clientSocket = client; + ready(); }); }); diff --git a/test/parallel/test-net-internal.js b/test/parallel/test-net-internal.js new file mode 100644 index 00000000000000..b59b92d0fb2b94 --- /dev/null +++ b/test/parallel/test-net-internal.js @@ -0,0 +1,15 @@ +'use strict'; + +// Flags: --expose-internals + +require('../common'); +const assert = require('assert'); +const net = require('internal/net'); + +assert.strictEqual(net.isLegalPort(''), false); +assert.strictEqual(net.isLegalPort('0'), true); +assert.strictEqual(net.isLegalPort(0), true); +assert.strictEqual(net.isLegalPort(65536), false); +assert.strictEqual(net.isLegalPort('65535'), true); +assert.strictEqual(net.isLegalPort(undefined), false); +assert.strictEqual(net.isLegalPort(null), true); diff --git a/test/parallel/test-net-isip.js b/test/parallel/test-net-isip.js index 96177122b7ba21..6b159b59d8c8c0 100644 --- a/test/parallel/test-net-isip.js +++ b/test/parallel/test-net-isip.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var net = require('net'); @@ -31,11 +31,40 @@ assert.equal(net.isIP('0000:0000:0000:0000:0000:0000:12345:0000'), 0); assert.equal(net.isIP('0'), 0); assert.equal(net.isIP(), 0); assert.equal(net.isIP(''), 0); +assert.equal(net.isIP(null), 0); +assert.equal(net.isIP(123), 0); +assert.equal(net.isIP(true), 0); +assert.equal(net.isIP({}), 0); +assert.equal(net.isIP({ toString: () => '::2001:252:1:255.255.255.255' }), 6); +assert.equal(net.isIP({ toString: () => '127.0.0.1' }), 4); +assert.equal(net.isIP({ toString: () => 'bla' }), 0); assert.equal(net.isIPv4('127.0.0.1'), true); assert.equal(net.isIPv4('example.com'), false); assert.equal(net.isIPv4('2001:252:0:1::2008:6'), false); +assert.equal(net.isIPv4(), false); +assert.equal(net.isIPv4(''), false); +assert.equal(net.isIPv4(null), false); +assert.equal(net.isIPv4(123), false); +assert.equal(net.isIPv4(true), false); +assert.equal(net.isIPv4({}), false); +assert.equal(net.isIPv4({ + toString: () => '::2001:252:1:255.255.255.255' +}), false); +assert.equal(net.isIPv4({ toString: () => '127.0.0.1' }), true); +assert.equal(net.isIPv4({ toString: () => 'bla' }), false); assert.equal(net.isIPv6('127.0.0.1'), false); assert.equal(net.isIPv6('example.com'), false); assert.equal(net.isIPv6('2001:252:0:1::2008:6'), true); +assert.equal(net.isIPv6(), false); +assert.equal(net.isIPv6(''), false); +assert.equal(net.isIPv6(null), false); +assert.equal(net.isIPv6(123), false); +assert.equal(net.isIPv6(true), false); +assert.equal(net.isIPv6({}), false); +assert.equal(net.isIPv6({ + toString: () => '::2001:252:1:255.255.255.255' +}), true); +assert.equal(net.isIPv6({ toString: () => '127.0.0.1' }), false); +assert.equal(net.isIPv6({ toString: () => 'bla' }), false); diff --git a/test/parallel/test-net-keepalive.js b/test/parallel/test-net-keepalive.js index efbbc5ea7986bb..b05537ba052e10 100644 --- a/test/parallel/test-net-keepalive.js +++ b/test/parallel/test-net-keepalive.js @@ -4,8 +4,17 @@ var assert = require('assert'); var net = require('net'); var serverConnection; +var clientConnection; var echoServer = net.createServer(function(connection) { serverConnection = connection; + setTimeout(function() { + // make sure both connections are still open + assert.equal(serverConnection.readyState, 'open'); + assert.equal(clientConnection.readyState, 'open'); + serverConnection.end(); + clientConnection.end(); + echoServer.close(); + }, common.platformTimeout(100)); connection.setTimeout(0); assert.notEqual(connection.setKeepAlive, undefined); // send a keepalive packet after 50 ms @@ -17,15 +26,6 @@ var echoServer = net.createServer(function(connection) { echoServer.listen(common.PORT); echoServer.on('listening', function() { - var clientConnection = net.createConnection(common.PORT); + clientConnection = net.createConnection(common.PORT); clientConnection.setTimeout(0); - - setTimeout(function() { - // make sure both connections are still open - assert.equal(serverConnection.readyState, 'open'); - assert.equal(clientConnection.readyState, 'open'); - serverConnection.end(); - clientConnection.end(); - echoServer.close(); - }, common.platformTimeout(100)); }); diff --git a/test/parallel/test-net-large-string.js b/test/parallel/test-net-large-string.js index 387f3f4f8c1dd3..26227c8e759787 100644 --- a/test/parallel/test-net-large-string.js +++ b/test/parallel/test-net-large-string.js @@ -4,10 +4,7 @@ var assert = require('assert'); var net = require('net'); var kPoolSize = 40 * 1024; -var data = ''; -for (var i = 0; i < kPoolSize; ++i) { - data += 'あ'; // 3bytes -} +var data = 'あ'.repeat(kPoolSize); var receivedSize = 0; var encoding = 'UTF-8'; diff --git a/test/parallel/test-net-listen-close-server.js b/test/parallel/test-net-listen-close-server.js index 144ca58bbbe2b9..9cde6df1645d01 100644 --- a/test/parallel/test-net-listen-close-server.js +++ b/test/parallel/test-net-listen-close-server.js @@ -2,7 +2,6 @@ var common = require('../common'); var assert = require('assert'); var net = require('net'); -var gotError = false; var server = net.createServer(function(socket) { }); diff --git a/test/parallel/test-net-listen-error.js b/test/parallel/test-net-listen-error.js index 79cfc7da6c9255..4c4d27d703a9a6 100644 --- a/test/parallel/test-net-listen-error.js +++ b/test/parallel/test-net-listen-error.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var net = require('net'); var gotError = false; diff --git a/test/sequential/test-net-listen-exclusive-random-ports.js b/test/parallel/test-net-listen-exclusive-random-ports.js similarity index 95% rename from test/sequential/test-net-listen-exclusive-random-ports.js rename to test/parallel/test-net-listen-exclusive-random-ports.js index c32273a59b2a50..f46f9a01d773ce 100644 --- a/test/sequential/test-net-listen-exclusive-random-ports.js +++ b/test/parallel/test-net-listen-exclusive-random-ports.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var cluster = require('cluster'); var net = require('net'); diff --git a/test/parallel/test-net-listen-fd0.js b/test/parallel/test-net-listen-fd0.js index e326ac2b60beb1..1a6c4716eb6178 100644 --- a/test/parallel/test-net-listen-fd0.js +++ b/test/parallel/test-net-listen-fd0.js @@ -10,7 +10,7 @@ process.on('exit', function() { }); // this should fail with an async EINVAL error, not throw an exception -net.createServer(assert.fail).listen({fd:0}).on('error', function(e) { +net.createServer(common.fail).listen({fd:0}).on('error', function(e) { switch (e.code) { case 'EINVAL': case 'ENOTSOCK': diff --git a/test/parallel/test-net-listen-port-option.js b/test/parallel/test-net-listen-port-option.js index d1eddb6707c274..5c3bc8eb7956ae 100644 --- a/test/parallel/test-net-listen-port-option.js +++ b/test/parallel/test-net-listen-port-option.js @@ -14,7 +14,8 @@ net.Server().listen({ port: '' + common.PORT }, close); 1 / 0, -1 / 0, '+Infinity', - '-Infinity' ].forEach(function(port) { + '-Infinity' +].forEach(function(port) { assert.throws(function() { net.Server().listen({ port: port }, assert.fail); }, /port should be >= 0 and < 65536/i); diff --git a/test/parallel/test-net-listening.js b/test/parallel/test-net-listening.js new file mode 100644 index 00000000000000..a0efb099b3f11f --- /dev/null +++ b/test/parallel/test-net-listening.js @@ -0,0 +1,16 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +const server = net.createServer(); + +assert.strictEqual(server.listening, false); + +server.listen(common.PORT, common.mustCall(() => { + assert.strictEqual(server.listening, true); + + server.close(common.mustCall(() => { + assert.strictEqual(server.listening, false); + })); +})); diff --git a/test/parallel/test-net-local-address-port.js b/test/parallel/test-net-local-address-port.js index aa28d180dae6ff..728993ee1bb023 100644 --- a/test/parallel/test-net-local-address-port.js +++ b/test/parallel/test-net-local-address-port.js @@ -3,7 +3,7 @@ var common = require('../common'); var assert = require('assert'); var net = require('net'); -var conns = 0, conns_closed = 0; +var conns = 0; var server = net.createServer(function(socket) { conns++; diff --git a/test/parallel/test-net-localerror.js b/test/parallel/test-net-localerror.js index 45ec1fc9099955..ed7c9471e0397f 100644 --- a/test/parallel/test-net-localerror.js +++ b/test/parallel/test-net-localerror.js @@ -17,6 +17,6 @@ connect({ function connect(opts, msg) { assert.throws(function() { - var client = net.connect(opts); + net.connect(opts); }, msg); } diff --git a/test/sequential/test-net-localport.js b/test/parallel/test-net-localport.js similarity index 100% rename from test/sequential/test-net-localport.js rename to test/parallel/test-net-localport.js diff --git a/test/parallel/test-net-pause-resume-connecting.js b/test/parallel/test-net-pause-resume-connecting.js index fb3b66c8cf991c..6be20cecb91159 100644 --- a/test/parallel/test-net-pause-resume-connecting.js +++ b/test/parallel/test-net-pause-resume-connecting.js @@ -1,11 +1,11 @@ 'use strict'; -var common = require('../common'), - assert = require('assert'), - net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); -var connections = 0, - dataEvents = 0, - conn; +let connections = 0; +let dataEvents = 0; +let conn; // Server diff --git a/test/parallel/test-net-persistent-keepalive.js b/test/parallel/test-net-persistent-keepalive.js index a54833a8f56371..fccfb69c4b19f3 100644 --- a/test/parallel/test-net-persistent-keepalive.js +++ b/test/parallel/test-net-persistent-keepalive.js @@ -4,8 +4,17 @@ var assert = require('assert'); var net = require('net'); var serverConnection; +var clientConnection; var echoServer = net.createServer(function(connection) { serverConnection = connection; + setTimeout(function() { + // make sure both connections are still open + assert.equal(serverConnection.readyState, 'open'); + assert.equal(clientConnection.readyState, 'open'); + serverConnection.end(); + clientConnection.end(); + echoServer.close(); + }, 600); connection.setTimeout(0); assert.equal(typeof connection.setKeepAlive, 'function'); connection.on('end', function() { @@ -15,20 +24,11 @@ var echoServer = net.createServer(function(connection) { echoServer.listen(common.PORT); echoServer.on('listening', function() { - var clientConnection = new net.Socket(); + clientConnection = new net.Socket(); // send a keepalive packet after 1000 ms // and make sure it persists var s = clientConnection.setKeepAlive(true, 400); assert.ok(s instanceof net.Socket); clientConnection.connect(common.PORT); clientConnection.setTimeout(0); - - setTimeout(function() { - // make sure both connections are still open - assert.equal(serverConnection.readyState, 'open'); - assert.equal(clientConnection.readyState, 'open'); - serverConnection.end(); - clientConnection.end(); - echoServer.close(); - }, 600); }); diff --git a/test/parallel/test-net-pipe-connect-errors.js b/test/parallel/test-net-pipe-connect-errors.js index 81ad90ef829c07..8e341015d96b3f 100644 --- a/test/parallel/test-net-pipe-connect-errors.js +++ b/test/parallel/test-net-pipe-connect-errors.js @@ -19,10 +19,12 @@ if (common.isWindows) { // file instead emptyTxt = path.join(common.fixturesDir, 'empty.txt'); } else { - // use common.PIPE to ensure we stay within POSIX socket path length - // restrictions, even on CI common.refreshTmpDir(); - emptyTxt = common.PIPE + '.txt'; + // Keep the file name very short so tht we don't exceed the 108 char limit + // on CI for a POSIX socket. Even though this isn't actually a socket file, + // the error will be different from the one we are expecting if we exceed the + // limit. + emptyTxt = common.tmpDir + '0.txt'; function cleanup() { try { @@ -42,7 +44,8 @@ var notSocketClient = net.createConnection(emptyTxt, function() { }); notSocketClient.on('error', function(err) { - assert(err.code === 'ENOTSOCK' || err.code === 'ECONNREFUSED'); + assert(err.code === 'ENOTSOCK' || err.code === 'ECONNREFUSED', + `received ${err.code} instead of ENOTSOCK or ECONNREFUSED`); notSocketErrorFired = true; }); diff --git a/test/parallel/test-net-reconnect.js b/test/parallel/test-net-reconnect.js index b2e8f6ea8b4e3f..f8cdcbdc4e76dd 100644 --- a/test/parallel/test-net-reconnect.js +++ b/test/parallel/test-net-reconnect.js @@ -5,7 +5,6 @@ var assert = require('assert'); var net = require('net'); var N = 50; -var c = 0; var client_recv_count = 0; var client_end_count = 0; var disconnect_count = 0; diff --git a/test/sequential/test-net-server-bind.js b/test/parallel/test-net-server-bind.js similarity index 100% rename from test/sequential/test-net-server-bind.js rename to test/parallel/test-net-server-bind.js diff --git a/test/parallel/test-net-server-connections.js b/test/parallel/test-net-server-connections.js index 138a78defb260d..ae89d9aac7b3f7 100644 --- a/test/parallel/test-net-server-connections.js +++ b/test/parallel/test-net-server-connections.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var net = require('net'); diff --git a/test/parallel/test-net-server-max-connections.js b/test/parallel/test-net-server-max-connections.js index 8de27d13eb4f6b..2b418e1c3c7bf4 100644 --- a/test/parallel/test-net-server-max-connections.js +++ b/test/parallel/test-net-server-max-connections.js @@ -36,6 +36,35 @@ function makeConnection(index) { if (index + 1 < N) { makeConnection(index + 1); } + + c.on('close', function() { + console.error('closed %d', index); + closes++; + + if (closes < N / 2) { + assert.ok(server.maxConnections <= index, + index + + ' was one of the first closed connections ' + + 'but shouldnt have been'); + } + + if (closes === N / 2) { + var cb; + console.error('calling wait callback.'); + while (cb = waits.shift()) { + cb(); + } + server.close(); + } + + if (index < server.maxConnections) { + assert.equal(true, gotData, + index + ' didn\'t get data, but should have'); + } else { + assert.equal(false, gotData, + index + ' got data, but shouldn\'t have'); + } + }); }); c.on('end', function() { c.end(); }); @@ -46,36 +75,12 @@ function makeConnection(index) { }); c.on('error', function(e) { - console.error('error %d: %s', index, e); - }); - - c.on('close', function() { - console.error('closed %d', index); - closes++; - - if (closes < N / 2) { - assert.ok(server.maxConnections <= index, - index + - ' was one of the first closed connections ' + - 'but shouldnt have been'); - } - - if (closes === N / 2) { - var cb; - console.error('calling wait callback.'); - while (cb = waits.shift()) { - cb(); - } - server.close(); - } - - if (index < server.maxConnections) { - assert.equal(true, gotData, - index + ' didn\'t get data, but should have'); - } else { - assert.equal(false, gotData, - index + ' got data, but shouldn\'t have'); + // Retry if SmartOS and ECONNREFUSED. See + // https://github.com/nodejs/node/issues/2663. + if (common.isSunOS && (e.code === 'ECONNREFUSED')) { + c.connect(common.PORT); } + console.error('error %d: %s', index, e); }); } diff --git a/test/parallel/test-net-server-pause-on-connect.js b/test/parallel/test-net-server-pause-on-connect.js index 3f54ecea3c6fd2..f13500b3800e7f 100644 --- a/test/parallel/test-net-server-pause-on-connect.js +++ b/test/parallel/test-net-server-pause-on-connect.js @@ -1,13 +1,16 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var net = require('net'); -var msg = 'test'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); +const msg = 'test'; var stopped = true; -var server1 = net.createServer({pauseOnConnect: true}, function(socket) { +var server1Sock; + + +const server1ConnHandler = function(socket) { socket.on('data', function(data) { if (stopped) { - assert(false, 'data event should not have happened yet'); + common.fail('data event should not have happened yet'); } assert.equal(data.toString(), msg, 'invalid data received'); @@ -15,38 +18,34 @@ var server1 = net.createServer({pauseOnConnect: true}, function(socket) { server1.close(); }); - setTimeout(function() { - // After 50(ish) ms, the other socket should have already read the data. - assert.equal(read, true); - assert.equal(socket.bytesRead, 0, 'no data should have been read yet'); + server1Sock = socket; +}; - socket.resume(); - stopped = false; - }, common.platformTimeout(50)); -}); +const server1 = net.createServer({pauseOnConnect: true}, server1ConnHandler); -// read is a timing check, as server1's timer should fire after server2's -// connection receives the data. Note that this could be race-y. -var read = false; -var server2 = net.createServer({pauseOnConnect: false}, function(socket) { +const server2ConnHandler = function(socket) { socket.on('data', function(data) { - read = true; - assert.equal(data.toString(), msg, 'invalid data received'); socket.end(); server2.close(); + + assert.equal(server1Sock.bytesRead, 0, 'no data should have been read yet'); + server1Sock.resume(); + stopped = false; }); -}); +}; -server1.listen(common.PORT, function() { - net.createConnection({port: common.PORT}).write(msg); -}); +const server2 = net.createServer({pauseOnConnect: false}, server2ConnHandler); -server2.listen(common.PORT + 1, function() { - net.createConnection({port: common.PORT + 1}).write(msg); +server1.listen(common.PORT, function() { + const clientHandler = common.mustCall(function() { + server2.listen(common.PORT + 1, function() { + net.createConnection({port: common.PORT + 1}).write(msg); + }); + }); + net.createConnection({port: common.PORT}).write(msg, clientHandler); }); process.on('exit', function() { assert.equal(stopped, false); - assert.equal(read, true); }); diff --git a/test/parallel/test-net-server-unref-persistent.js b/test/parallel/test-net-server-unref-persistent.js index a071b625ef26d7..8e8f45f5fd7d20 100644 --- a/test/parallel/test-net-server-unref-persistent.js +++ b/test/parallel/test-net-server-unref-persistent.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var net = require('net'); var closed = false; diff --git a/test/parallel/test-net-settimeout.js b/test/parallel/test-net-settimeout.js index a1172b92e1dead..db0329deea0466 100644 --- a/test/parallel/test-net-settimeout.js +++ b/test/parallel/test-net-settimeout.js @@ -2,36 +2,30 @@ // This example sets a timeout then immediately attempts to disable the timeout // https://github.com/joyent/node/pull/2245 -var common = require('../common'); -var net = require('net'); -var assert = require('assert'); +const common = require('../common'); +const net = require('net'); +const assert = require('assert'); -var T = 100; +const T = 100; -var server = net.createServer(function(c) { +const server = net.createServer(common.mustCall((c) => { c.write('hello'); -}); -server.listen(common.PORT); +})); -var killers = [0]; - -var left = killers.length; -killers.forEach(function(killer) { - var socket = net.createConnection(common.PORT, 'localhost'); +server.listen(common.PORT); - var s = socket.setTimeout(T, function() { - socket.destroy(); - if (--left === 0) server.close(); - assert.ok(killer !== 0); - clearTimeout(timeout); - }); - assert.ok(s instanceof net.Socket); +const socket = net.createConnection(common.PORT, 'localhost'); - socket.setTimeout(killer); +const s = socket.setTimeout(T, () => { + common.fail('Socket timeout event is not expected to fire'); +}); +assert.ok(s instanceof net.Socket); - var timeout = setTimeout(function() { +socket.on('data', common.mustCall(() => { + setTimeout(function() { socket.destroy(); - if (--left === 0) server.close(); - assert.ok(killer === 0); + server.close(); }, T * 2); -}); +})); + +socket.setTimeout(0); diff --git a/test/parallel/test-net-socket-local-address.js b/test/parallel/test-net-socket-local-address.js index 4c0e31d08c4771..379bed363e75e8 100644 --- a/test/parallel/test-net-socket-local-address.js +++ b/test/parallel/test-net-socket-local-address.js @@ -1,34 +1,40 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +// skip test in FreeBSD jails +if (common.inFreeBSDJail) { + console.log('1..0 # Skipped: In a FreeBSD jail'); + return; +} var conns = 0; var clientLocalPorts = []; var serverRemotePorts = []; - -var server = net.createServer(function(socket) { +const client = new net.Socket(); +const server = net.createServer((socket) => { serverRemotePorts.push(socket.remotePort); - conns++; + socket.end(); }); -var client = new net.Socket(); - -server.on('close', function() { +server.on('close', common.mustCall(() => { assert.deepEqual(clientLocalPorts, serverRemotePorts, 'client and server should agree on the ports used'); - assert.equal(2, conns); -}); + assert.strictEqual(2, conns); +})); -server.listen(common.PORT, common.localhostIPv4, testConnect); +server.listen(common.PORT, common.localhostIPv4, connect); -function testConnect() { - if (conns == 2) { - return server.close(); +function connect() { + if (conns === 2) { + server.close(); + return; } - client.connect(common.PORT, common.localhostIPv4, function() { - clientLocalPorts.push(this.localPort); - this.once('close', testConnect); - this.destroy(); + + conns++; + client.once('close', connect); + client.connect(common.PORT, common.localhostIPv4, () => { + clientLocalPorts.push(client.localPort); }); } diff --git a/test/parallel/test-net-socket-timeout-unref.js b/test/parallel/test-net-socket-timeout-unref.js index c7e651afef015f..bbc2dffcc15336 100644 --- a/test/parallel/test-net-socket-timeout-unref.js +++ b/test/parallel/test-net-socket-timeout-unref.js @@ -1,28 +1,35 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var net = require('net'); -var server = net.createServer(function(c) { +// Test that unref'ed sockets with timeouts do not prevent exit. + +const common = require('../common'); +const net = require('net'); + +const server = net.createServer(function(c) { c.write('hello'); c.unref(); }); server.listen(common.PORT); server.unref(); -var timedout = false; +var connections = 0; +const sockets = []; +const delays = [8, 5, 3, 6, 2, 4]; -[8, 5, 3, 6, 2, 4].forEach(function(T) { - var socket = net.createConnection(common.PORT, 'localhost'); - socket.setTimeout(T * 1000, function() { - console.log(process._getActiveHandles()); - timedout = true; - socket.destroy(); - }); - socket.unref(); -}); +delays.forEach(function(T) { + const socket = net.createConnection(common.PORT, 'localhost'); + socket.on('connect', common.mustCall(function() { + if (++connections === delays.length) { + sockets.forEach(function(s) { + s.socket.setTimeout(s.timeout, function() { + s.socket.destroy(); + throw new Error('socket timed out unexpectedly'); + }); + + s.socket.unref(); + }); + } + })); -process.on('exit', function() { - assert.strictEqual(timedout, false, - 'Socket timeout should not hold loop open'); + sockets.push({socket: socket, timeout: T * 1000}); }); diff --git a/test/parallel/test-net-socket-timeout.js b/test/parallel/test-net-socket-timeout.js index 5ab11909b4c306..7cae61d71bc4a5 100644 --- a/test/parallel/test-net-socket-timeout.js +++ b/test/parallel/test-net-socket-timeout.js @@ -10,19 +10,19 @@ var nonNumericDelays = ['100', true, false, undefined, null, '', {}, noop, []]; var badRangeDelays = [-0.001, -1, -Infinity, Infinity, NaN]; var validDelays = [0, 0.001, 1, 1e6]; -for (var i = 0; i < nonNumericDelays.length; i++) { +for (let i = 0; i < nonNumericDelays.length; i++) { assert.throws(function() { s.setTimeout(nonNumericDelays[i], noop); }, TypeError); } -for (var i = 0; i < badRangeDelays.length; i++) { +for (let i = 0; i < badRangeDelays.length; i++) { assert.throws(function() { s.setTimeout(badRangeDelays[i], noop); }, RangeError); } -for (var i = 0; i < validDelays.length; i++) { +for (let i = 0; i < validDelays.length; i++) { assert.doesNotThrow(function() { s.setTimeout(validDelays[i], noop); }); @@ -41,7 +41,7 @@ server.listen(common.PORT, function() { }); var timer = setTimeout(function() { process.exit(1); - }, 200); + }, common.platformTimeout(200)); }); process.on('exit', function() { diff --git a/test/parallel/test-net-stream.js b/test/parallel/test-net-stream.js index 151b1b178f9adc..9075d99471540a 100644 --- a/test/parallel/test-net-stream.js +++ b/test/parallel/test-net-stream.js @@ -11,6 +11,7 @@ var s = new net.Stream(); s.server = new net.Server(); s.server.connections = 10; +s._server = s.server; assert.equal(10, s.server.connections); s.destroy(); @@ -38,14 +39,14 @@ var server = net.createServer(function(socket) { socket.end(); }).listen(common.PORT, function() { - var conn = net.connect(common.PORT); - conn.on('data', function(buf) { - conn.pause(); - setTimeout(function() { - conn.destroy(); - }, 20); - }); + var conn = net.connect(common.PORT); + conn.on('data', function(buf) { + conn.pause(); + setTimeout(function() { + conn.destroy(); + }, 20); }); +}); process.on('exit', function() { assert.equal(server.connections, 0); diff --git a/test/parallel/test-net-sync-cork.js b/test/parallel/test-net-sync-cork.js new file mode 100644 index 00000000000000..b5f52947cff24e --- /dev/null +++ b/test/parallel/test-net-sync-cork.js @@ -0,0 +1,41 @@ +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +const server = net.createServer(handle); + +const N = 100; +const buf = Buffer.alloc(2, 'a'); + +server.listen(common.PORT, function() { + const conn = net.connect(common.PORT); + + conn.on('connect', () => { + let res = true; + let i = 0; + for (; i < N && res; i++) { + conn.cork(); + conn.write(buf); + res = conn.write(buf); + conn.uncork(); + } + assert.equal(i, N); + conn.end(); + }); +}); + +process.on('exit', function() { + assert.equal(server.connections, 0); +}); + +function handle(socket) { + socket.resume(); + + socket.on('error', function(err) { + socket.destroy(); + }).on('close', function() { + server.close(); + }); +} diff --git a/test/parallel/test-next-tick-domain.js b/test/parallel/test-next-tick-domain.js index 4d53bba6c4f5cc..8f9d9bb4aa50f7 100644 --- a/test/parallel/test-next-tick-domain.js +++ b/test/parallel/test-next-tick-domain.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var origNextTick = process.nextTick; diff --git a/test/parallel/test-next-tick-errors.js b/test/parallel/test-next-tick-errors.js index eccd7a43a0825f..5898762eeb5e5a 100644 --- a/test/parallel/test-next-tick-errors.js +++ b/test/parallel/test-next-tick-errors.js @@ -1,16 +1,16 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); -var order = [], - exceptionHandled = false; +const order = []; +let exceptionHandled = false; // This nextTick function will throw an error. It should only be called once. // When it throws an error, it should still get removed from the queue. process.nextTick(function() { order.push('A'); // cause an error - what(); + what(); // eslint-disable-line no-undef }); // This nextTick function should remain in the queue when the first one diff --git a/test/parallel/test-next-tick-intentional-starvation.js b/test/parallel/test-next-tick-intentional-starvation.js index d4a8a1b7481329..414524e5405ecc 100644 --- a/test/parallel/test-next-tick-intentional-starvation.js +++ b/test/parallel/test-next-tick-intentional-starvation.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); // this is the inverse of test-next-tick-starvation. diff --git a/test/parallel/test-next-tick-ordering.js b/test/parallel/test-next-tick-ordering.js index c2b936a1061d52..63f8d37828e53c 100644 --- a/test/parallel/test-next-tick-ordering.js +++ b/test/parallel/test-next-tick-ordering.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var i; diff --git a/test/parallel/test-next-tick-ordering2.js b/test/parallel/test-next-tick-ordering2.js index 4252d623679f65..70f7611dbaddae 100644 --- a/test/parallel/test-next-tick-ordering2.js +++ b/test/parallel/test-next-tick-ordering2.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var order = []; diff --git a/test/parallel/test-next-tick.js b/test/parallel/test-next-tick.js index 54e7b88cf022ca..8b45e8c705fc84 100644 --- a/test/parallel/test-next-tick.js +++ b/test/parallel/test-next-tick.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var complete = 0; diff --git a/test/parallel/test-npm-install.js b/test/parallel/test-npm-install.js new file mode 100644 index 00000000000000..0c2e4df52f9863 --- /dev/null +++ b/test/parallel/test-npm-install.js @@ -0,0 +1,47 @@ +'use strict'; +const common = require('../common'); + +const path = require('path'); +const spawn = require('child_process').spawn; +const assert = require('assert'); +const fs = require('fs'); + +common.refreshTmpDir(); + +const npmPath = path.join( + common.testDir, + '..', + 'deps', + 'npm', + 'bin', + 'npm-cli.js' +); + +const args = [ + npmPath, + 'install' +]; + +const pkgContent = JSON.stringify({ + dependencies: { + 'package-name': common.fixturesDir + '/packages/main' + } +}); + +const pkgPath = path.join(common.tmpDir, 'package.json'); + +fs.writeFileSync(pkgPath, pkgContent); + +const proc = spawn(process.execPath, args, { + cwd: common.tmpDir +}); + +function handleExit(code, signalCode) { + assert.equal(code, 0, 'npm install should run without an error'); + assert.ok(signalCode === null, 'signalCode should be null'); + assert.doesNotThrow(function() { + fs.accessSync(common.tmpDir + '/node_modules/package-name'); + }); +} + +proc.on('exit', common.mustCall(handleExit)); diff --git a/test/parallel/test-os.js b/test/parallel/test-os.js index f7fe4634c40dca..15fd189f9be20e 100644 --- a/test/parallel/test-os.js +++ b/test/parallel/test-os.js @@ -13,7 +13,7 @@ if (common.isWindows) { process.env.TEMP = ''; assert.equal(os.tmpdir(), '/tmp'); process.env.TMP = ''; - var expected = (process.env.SystemRoot || process.env.windir) + '\\temp'; + const expected = (process.env.SystemRoot || process.env.windir) + '\\temp'; assert.equal(os.tmpdir(), expected); process.env.TEMP = '\\temp\\'; assert.equal(os.tmpdir(), '\\temp'); @@ -83,21 +83,25 @@ var interfaces = os.networkInterfaces(); console.error(interfaces); switch (platform) { case 'linux': - var filter = function(e) { return e.address == '127.0.0.1'; }; - var actual = interfaces.lo.filter(filter); - var expected = [{ address: '127.0.0.1', netmask: '255.0.0.0', - mac: '00:00:00:00:00:00', family: 'IPv4', - internal: true }]; - assert.deepEqual(actual, expected); - break; + { + const filter = function(e) { return e.address == '127.0.0.1'; }; + const actual = interfaces.lo.filter(filter); + const expected = [{ address: '127.0.0.1', netmask: '255.0.0.0', + mac: '00:00:00:00:00:00', family: 'IPv4', + internal: true }]; + assert.deepEqual(actual, expected); + break; + } case 'win32': - var filter = function(e) { return e.address == '127.0.0.1'; }; - var actual = interfaces['Loopback Pseudo-Interface 1'].filter(filter); - var expected = [{ address: '127.0.0.1', netmask: '255.0.0.0', - mac: '00:00:00:00:00:00', family: 'IPv4', - internal: true }]; - assert.deepEqual(actual, expected); - break; + { + const filter = function(e) { return e.address == '127.0.0.1'; }; + const actual = interfaces['Loopback Pseudo-Interface 1'].filter(filter); + const expected = [{ address: '127.0.0.1', netmask: '255.0.0.0', + mac: '00:00:00:00:00:00', family: 'IPv4', + internal: true }]; + assert.deepEqual(actual, expected); + break; + } } var EOL = os.EOL; diff --git a/test/parallel/test-path-parse-format.js b/test/parallel/test-path-parse-format.js index c8913d2dfc56e4..b8d1ce6cf90f98 100644 --- a/test/parallel/test-path-parse-format.js +++ b/test/parallel/test-path-parse-format.js @@ -19,7 +19,11 @@ var winPaths = [ '\\\\?\\UNC\\server\\share' ]; -var winSpecialCaseFormatTests = [ +const winSpecialCaseParseTests = [ + ['/foo/bar', {root: '/'}] +]; + +const winSpecialCaseFormatTests = [ [{dir: 'some\\dir'}, 'some\\dir\\'], [{base: 'index.html'}, 'index.html'], [{}, ''] @@ -35,7 +39,17 @@ var unixPaths = [ '.\\file', './file', 'C:\\foo', - '' + '/', + '', + '.', + '..', + '/foo', + '/foo.', + '/foo.bar', + '/.', + '/.foo', + '/.foo.bar', + '/foo/bar.baz', ]; var unixSpecialCaseFormatTests = [ @@ -63,24 +77,81 @@ var errors = [ message: /Parameter 'pathObject' must be an object, not boolean/}, {method: 'format', input: [1], message: /Parameter 'pathObject' must be an object, not number/}, - {method: 'format', input: [{root: true}], - message: /'pathObject.root' must be a string or undefined, not boolean/}, - {method: 'format', input: [{root: 12}], - message: /'pathObject.root' must be a string or undefined, not number/}, ]; checkParseFormat(path.win32, winPaths); checkParseFormat(path.posix, unixPaths); +checkSpecialCaseParseFormat(path.win32, winSpecialCaseParseTests); checkErrors(path.win32); checkErrors(path.posix); checkFormat(path.win32, winSpecialCaseFormatTests); checkFormat(path.posix, unixSpecialCaseFormatTests); +// Test removal of trailing path separators +const trailingTests = [ + [ path.win32.parse, + [['.\\', { root: '', dir: '', base: '.', ext: '', name: '.' }], + ['\\\\', { root: '\\', dir: '\\', base: '', ext: '', name: '' }], + ['\\\\', { root: '\\', dir: '\\', base: '', ext: '', name: '' }], + ['c:\\foo\\\\\\', + { root: 'c:\\', dir: 'c:\\', base: 'foo', ext: '', name: 'foo' }], + ['D:\\foo\\\\\\bar.baz', + { root: 'D:\\', + dir: 'D:\\foo\\\\', + base: 'bar.baz', + ext: '.baz', + name: 'bar' + } + ] + ] + ], + [ path.posix.parse, + [['./', { root: '', dir: '', base: '.', ext: '', name: '.' }], + ['//', { root: '/', dir: '/', base: '', ext: '', name: '' }], + ['///', { root: '/', dir: '/', base: '', ext: '', name: '' }], + ['/foo///', { root: '/', dir: '/', base: 'foo', ext: '', name: 'foo' }], + ['/foo///bar.baz', + { root: '/', dir: '/foo//', base: 'bar.baz', ext: '.baz', name: 'bar' } + ] + ] + ] +]; +const failures = []; +trailingTests.forEach(function(test) { + const parse = test[0]; + const os = parse === path.win32.parse ? 'win32' : 'posix'; + test[1].forEach(function(test) { + const actual = parse(test[0]); + const expected = test[1]; + const fn = `path.${os}.parse(`; + const message = fn + + JSON.stringify(test[0]) + + ')' + + '\n expect=' + JSON.stringify(expected) + + '\n actual=' + JSON.stringify(actual); + const actualKeys = Object.keys(actual); + const expectedKeys = Object.keys(expected); + let failed = (actualKeys.length !== expectedKeys.length); + if (!failed) { + for (let i = 0; i < actualKeys.length; ++i) { + const key = actualKeys[i]; + if (expectedKeys.indexOf(key) === -1 || actual[key] !== expected[key]) { + failed = true; + break; + } + } + } + if (failed) + failures.push('\n' + message); + }); +}); +assert.equal(failures.length, 0, failures.join('')); + function checkErrors(path) { errors.forEach(function(errorCase) { try { path[errorCase.method].apply(path, errorCase.input); - } catch(err) { + } catch (err) { assert.ok(err instanceof TypeError); assert.ok( errorCase.message.test(err.message), @@ -108,6 +179,17 @@ function checkParseFormat(path, paths) { }); } +function checkSpecialCaseParseFormat(path, testCases) { + testCases.forEach(function(testCase) { + const element = testCase[0]; + const expect = testCase[1]; + const output = path.parse(element); + Object.keys(expect).forEach(function(key) { + assert.strictEqual(output[key], expect[key]); + }); + }); +} + function checkFormat(path, testCases) { testCases.forEach(function(testCase) { assert.strictEqual(path.format(testCase[0]), testCase[1]); diff --git a/test/parallel/test-path-zero-length-strings.js b/test/parallel/test-path-zero-length-strings.js index 083eb3e7ac03c6..b08ef4809201eb 100644 --- a/test/parallel/test-path-zero-length-strings.js +++ b/test/parallel/test-path-zero-length-strings.js @@ -5,24 +5,28 @@ // directory. This test makes sure that the behaviour is intact between commits. // See: https://github.com/nodejs/node/pull/2106 -const common = require('../common'); +require('../common'); const assert = require('assert'); const path = require('path'); const pwd = process.cwd(); // join will internally ignore all the zero-length strings and it will return // '.' if the joined string is a zero-length string. -assert.equal(path.join(''), '.'); -assert.equal(path.join('', ''), '.'); +assert.equal(path.posix.join(''), '.'); +assert.equal(path.posix.join('', ''), '.'); +assert.equal(path.win32.join(''), '.'); +assert.equal(path.win32.join('', ''), '.'); assert.equal(path.join(pwd), pwd); assert.equal(path.join(pwd, ''), pwd); // normalize will return '.' if the input is a zero-length string -assert.equal(path.normalize(''), '.'); +assert.equal(path.posix.normalize(''), '.'); +assert.equal(path.win32.normalize(''), '.'); assert.equal(path.normalize(pwd), pwd); // Since '' is not a valid path in any of the common environments, return false -assert.equal(path.isAbsolute(''), false); +assert.equal(path.posix.isAbsolute(''), false); +assert.equal(path.win32.isAbsolute(''), false); // resolve, internally ignores all the zero-length strings and returns the // current working directory diff --git a/test/parallel/test-path.js b/test/parallel/test-path.js index c13b8d4efd1540..16f369cc857c89 100644 --- a/test/parallel/test-path.js +++ b/test/parallel/test-path.js @@ -1,11 +1,12 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); +const path = require('path'); -var path = require('path'); - -var f = __filename; +const f = __filename; +const failures = []; +// path.basename tests assert.equal(path.basename(f), 'test-path.js'); assert.equal(path.basename(f, '.js'), 'test-path'); assert.equal(path.basename(''), ''); @@ -21,6 +22,12 @@ assert.equal(path.win32.basename('\\basename.ext'), 'basename.ext'); assert.equal(path.win32.basename('basename.ext'), 'basename.ext'); assert.equal(path.win32.basename('basename.ext\\'), 'basename.ext'); assert.equal(path.win32.basename('basename.ext\\\\'), 'basename.ext'); +assert.equal(path.win32.basename('foo'), 'foo'); +assert.equal(path.win32.basename(null), 'null'); +assert.equal(path.win32.basename(true), 'true'); +assert.equal(path.win32.basename(1), '1'); +assert.equal(path.win32.basename(), 'undefined'); +assert.equal(path.win32.basename({}), '[object Object]'); // On unix a backslash is just treated as any other character. assert.equal(path.posix.basename('\\dir\\basename.ext'), '\\dir\\basename.ext'); @@ -28,25 +35,36 @@ assert.equal(path.posix.basename('\\basename.ext'), '\\basename.ext'); assert.equal(path.posix.basename('basename.ext'), 'basename.ext'); assert.equal(path.posix.basename('basename.ext\\'), 'basename.ext\\'); assert.equal(path.posix.basename('basename.ext\\\\'), 'basename.ext\\\\'); +assert.equal(path.posix.basename('foo'), 'foo'); +assert.equal(path.posix.basename(null), 'null'); +assert.equal(path.posix.basename(true), 'true'); +assert.equal(path.posix.basename(1), '1'); +assert.equal(path.posix.basename(), 'undefined'); +assert.equal(path.posix.basename({}), '[object Object]'); // POSIX filenames may include control characters // c.f. http://www.dwheeler.com/essays/fixing-unix-linux-filenames.html -if (!common.isWindows) { - var controlCharFilename = 'Icon' + String.fromCharCode(13); - assert.equal(path.basename('/a/b/' + controlCharFilename), - controlCharFilename); -} +const controlCharFilename = 'Icon' + String.fromCharCode(13); +assert.equal(path.posix.basename('/a/b/' + controlCharFilename), + controlCharFilename); -assert.equal(path.extname(f), '.js'); +// path.dirname tests assert.equal(path.dirname(f).substr(-13), common.isWindows ? 'test\\parallel' : 'test/parallel'); -assert.equal(path.dirname('/a/b/'), '/a'); -assert.equal(path.dirname('/a/b'), '/a'); -assert.equal(path.dirname('/a'), '/'); -assert.equal(path.dirname(''), '.'); -assert.equal(path.dirname('/'), '/'); -assert.equal(path.dirname('////'), '/'); + +assert.equal(path.posix.dirname('/a/b/'), '/a'); +assert.equal(path.posix.dirname('/a/b'), '/a'); +assert.equal(path.posix.dirname('/a'), '/'); +assert.equal(path.posix.dirname(''), '.'); +assert.equal(path.posix.dirname('/'), '/'); +assert.equal(path.posix.dirname('////'), '/'); +assert.equal(path.posix.dirname('foo'), '.'); +assert.equal(path.posix.dirname(null), '.'); +assert.equal(path.posix.dirname(true), '.'); +assert.equal(path.posix.dirname(1), '.'); +assert.equal(path.posix.dirname(), '.'); +assert.equal(path.posix.dirname({}), '.'); assert.equal(path.win32.dirname('c:\\'), 'c:\\'); assert.equal(path.win32.dirname('c:\\foo'), 'c:\\'); @@ -75,51 +93,88 @@ assert.equal(path.win32.dirname('\\\\unc\\share\\foo\\bar\\'), '\\\\unc\\share\\foo'); assert.equal(path.win32.dirname('\\\\unc\\share\\foo\\bar\\baz'), '\\\\unc\\share\\foo\\bar'); +assert.equal(path.win32.dirname('/a/b/'), '/a'); +assert.equal(path.win32.dirname('/a/b'), '/a'); +assert.equal(path.win32.dirname('/a'), '/'); +assert.equal(path.win32.dirname(''), '.'); +assert.equal(path.win32.dirname('/'), '/'); +assert.equal(path.win32.dirname('////'), '/'); +assert.equal(path.win32.dirname('foo'), '.'); +assert.equal(path.win32.dirname(null), '.'); +assert.equal(path.win32.dirname(true), '.'); +assert.equal(path.win32.dirname(1), '.'); +assert.equal(path.win32.dirname(), '.'); +assert.equal(path.win32.dirname({}), '.'); + + +// path.extname tests +[ + [f, '.js'], + ['', ''], + ['/path/to/file', ''], + ['/path/to/file.ext', '.ext'], + ['/path.to/file.ext', '.ext'], + ['/path.to/file', ''], + ['/path.to/.file', ''], + ['/path.to/.file.ext', '.ext'], + ['/path/to/f.ext', '.ext'], + ['/path/to/..ext', '.ext'], + ['/path/to/..', ''], + ['file', ''], + ['file.ext', '.ext'], + ['.file', ''], + ['.file.ext', '.ext'], + ['/file', ''], + ['/file.ext', '.ext'], + ['/.file', ''], + ['/.file.ext', '.ext'], + ['.path/file.ext', '.ext'], + ['file.ext.ext', '.ext'], + ['file.', '.'], + ['.', ''], + ['./', ''], + ['.file.ext', '.ext'], + ['.file', ''], + ['.file.', '.'], + ['.file..', '.'], + ['..', ''], + ['../', ''], + ['..file.ext', '.ext'], + ['..file', '.file'], + ['..file.', '.'], + ['..file..', '.'], + ['...', '.'], + ['...ext', '.ext'], + ['....', '.'], + ['file.ext/', '.ext'], + ['file.ext//', '.ext'], + ['file/', ''], + ['file//', ''], + ['file./', '.'], + ['file.//', '.'], +].forEach(function(test) { + [path.posix.extname, path.win32.extname].forEach(function(extname) { + let input = test[0]; + let os; + if (extname === path.win32.extname) { + input = input.replace(/\//g, '\\'); + os = 'win32'; + } else { + os = 'posix'; + } + const actual = extname(input); + const expected = test[1]; + const fn = `path.${os}.extname(`; + const message = fn + JSON.stringify(input) + ')' + + '\n expect=' + JSON.stringify(expected) + + '\n actual=' + JSON.stringify(actual); + if (actual !== expected) + failures.push('\n' + message); + }); +}); +assert.equal(failures.length, 0, failures.join('')); - -assert.equal(path.extname(''), ''); -assert.equal(path.extname('/path/to/file'), ''); -assert.equal(path.extname('/path/to/file.ext'), '.ext'); -assert.equal(path.extname('/path.to/file.ext'), '.ext'); -assert.equal(path.extname('/path.to/file'), ''); -assert.equal(path.extname('/path.to/.file'), ''); -assert.equal(path.extname('/path.to/.file.ext'), '.ext'); -assert.equal(path.extname('/path/to/f.ext'), '.ext'); -assert.equal(path.extname('/path/to/..ext'), '.ext'); -assert.equal(path.extname('file'), ''); -assert.equal(path.extname('file.ext'), '.ext'); -assert.equal(path.extname('.file'), ''); -assert.equal(path.extname('.file.ext'), '.ext'); -assert.equal(path.extname('/file'), ''); -assert.equal(path.extname('/file.ext'), '.ext'); -assert.equal(path.extname('/.file'), ''); -assert.equal(path.extname('/.file.ext'), '.ext'); -assert.equal(path.extname('.path/file.ext'), '.ext'); -assert.equal(path.extname('file.ext.ext'), '.ext'); -assert.equal(path.extname('file.'), '.'); -assert.equal(path.extname('.'), ''); -assert.equal(path.extname('./'), ''); -assert.equal(path.extname('.file.ext'), '.ext'); -assert.equal(path.extname('.file'), ''); -assert.equal(path.extname('.file.'), '.'); -assert.equal(path.extname('.file..'), '.'); -assert.equal(path.extname('..'), ''); -assert.equal(path.extname('../'), ''); -assert.equal(path.extname('..file.ext'), '.ext'); -assert.equal(path.extname('..file'), '.file'); -assert.equal(path.extname('..file.'), '.'); -assert.equal(path.extname('..file..'), '.'); -assert.equal(path.extname('...'), '.'); -assert.equal(path.extname('...ext'), '.ext'); -assert.equal(path.extname('....'), '.'); -assert.equal(path.extname('file.ext/'), '.ext'); -assert.equal(path.extname('file.ext//'), '.ext'); -assert.equal(path.extname('file/'), ''); -assert.equal(path.extname('file//'), ''); -assert.equal(path.extname('file./'), '.'); -assert.equal(path.extname('file.//'), '.'); - -// On windows, backspace is a path separator. +// On Windows, backslash is a path separator. assert.equal(path.win32.extname('.\\'), ''); assert.equal(path.win32.extname('..\\'), ''); assert.equal(path.win32.extname('file.ext\\'), '.ext'); @@ -128,8 +183,13 @@ assert.equal(path.win32.extname('file\\'), ''); assert.equal(path.win32.extname('file\\\\'), ''); assert.equal(path.win32.extname('file.\\'), '.'); assert.equal(path.win32.extname('file.\\\\'), '.'); +assert.equal(path.win32.extname(null), ''); +assert.equal(path.win32.extname(true), ''); +assert.equal(path.win32.extname(1), ''); +assert.equal(path.win32.extname(), ''); +assert.equal(path.win32.extname({}), ''); -// On unix, backspace is a valid name component like any other character. +// On *nix, backslash is a valid name component like any other character. assert.equal(path.posix.extname('.\\'), ''); assert.equal(path.posix.extname('..\\'), '.\\'); assert.equal(path.posix.extname('file.ext\\'), '.ext\\'); @@ -138,10 +198,16 @@ assert.equal(path.posix.extname('file\\'), ''); assert.equal(path.posix.extname('file\\\\'), ''); assert.equal(path.posix.extname('file.\\'), '.\\'); assert.equal(path.posix.extname('file.\\\\'), '.\\\\'); +assert.equal(path.posix.extname(null), ''); +assert.equal(path.posix.extname(true), ''); +assert.equal(path.posix.extname(1), ''); +assert.equal(path.posix.extname(), ''); +assert.equal(path.posix.extname({}), ''); + // path.join tests -var failures = []; -var joinTests = +const joinTests = [ + [ [path.posix.join, path.win32.join], // arguments result [[['.', 'x/b', '..', '/b/c.js'], 'x/b/c.js'], [['/.', 'x/b', '..', '/b/c.js'], '/x/b/c.js'], @@ -189,70 +255,93 @@ var joinTests = [['/', '', '/foo'], '/foo'], [['', '/', 'foo'], '/foo'], [['', '/', '/foo'], '/foo'] - ]; + ] + ] +]; // Windows-specific join tests -if (common.isWindows) { - joinTests = joinTests.concat( - [// UNC path expected - [['//foo/bar'], '//foo/bar/'], - [['\\/foo/bar'], '//foo/bar/'], - [['\\\\foo/bar'], '//foo/bar/'], +joinTests.push([ + path.win32.join, + joinTests[0][1].slice(0).concat( + [// arguments result + // UNC path expected + [['//foo/bar'], '\\\\foo\\bar\\'], + [['\\/foo/bar'], '\\\\foo\\bar\\'], + [['\\\\foo/bar'], '\\\\foo\\bar\\'], // UNC path expected - server and share separate - [['//foo', 'bar'], '//foo/bar/'], - [['//foo/', 'bar'], '//foo/bar/'], - [['//foo', '/bar'], '//foo/bar/'], + [['//foo', 'bar'], '\\\\foo\\bar\\'], + [['//foo/', 'bar'], '\\\\foo\\bar\\'], + [['//foo', '/bar'], '\\\\foo\\bar\\'], // UNC path expected - questionable - [['//foo', '', 'bar'], '//foo/bar/'], - [['//foo/', '', 'bar'], '//foo/bar/'], - [['//foo/', '', '/bar'], '//foo/bar/'], + [['//foo', '', 'bar'], '\\\\foo\\bar\\'], + [['//foo/', '', 'bar'], '\\\\foo\\bar\\'], + [['//foo/', '', '/bar'], '\\\\foo\\bar\\'], // UNC path expected - even more questionable - [['', '//foo', 'bar'], '//foo/bar/'], - [['', '//foo/', 'bar'], '//foo/bar/'], - [['', '//foo/', '/bar'], '//foo/bar/'], + [['', '//foo', 'bar'], '\\\\foo\\bar\\'], + [['', '//foo/', 'bar'], '\\\\foo\\bar\\'], + [['', '//foo/', '/bar'], '\\\\foo\\bar\\'], // No UNC path expected (no double slash in first component) - [['\\', 'foo/bar'], '/foo/bar'], - [['\\', '/foo/bar'], '/foo/bar'], - [['', '/', '/foo/bar'], '/foo/bar'], - // No UNC path expected (no non-slashes in first component - questionable) - [['//', 'foo/bar'], '/foo/bar'], - [['//', '/foo/bar'], '/foo/bar'], - [['\\\\', '/', '/foo/bar'], '/foo/bar'], + [['\\', 'foo/bar'], '\\foo\\bar'], + [['\\', '/foo/bar'], '\\foo\\bar'], + [['', '/', '/foo/bar'], '\\foo\\bar'], + // No UNC path expected (no non-slashes in first component - + // questionable) + [['//', 'foo/bar'], '\\foo\\bar'], + [['//', '/foo/bar'], '\\foo\\bar'], + [['\\\\', '/', '/foo/bar'], '\\foo\\bar'], [['//'], '/'], // No UNC path expected (share name missing - questionable). - [['//foo'], '/foo'], - [['//foo/'], '/foo/'], - [['//foo', '/'], '/foo/'], - [['//foo', '', '/'], '/foo/'], + [['//foo'], '\\foo'], + [['//foo/'], '\\foo\\'], + [['//foo', '/'], '\\foo\\'], + [['//foo', '', '/'], '\\foo\\'], // No UNC path expected (too many leading slashes - questionable) - [['///foo/bar'], '/foo/bar'], - [['////foo', 'bar'], '/foo/bar'], - [['\\\\\\/foo/bar'], '/foo/bar'], + [['///foo/bar'], '\\foo\\bar'], + [['////foo', 'bar'], '\\foo\\bar'], + [['\\\\\\/foo/bar'], '\\foo\\bar'], // Drive-relative vs drive-absolute paths. This merely describes the // status quo, rather than being obviously right [['c:'], 'c:.'], [['c:.'], 'c:.'], [['c:', ''], 'c:.'], [['', 'c:'], 'c:.'], - [['c:.', '/'], 'c:./'], + [['c:.', '/'], 'c:.\\'], [['c:.', 'file'], 'c:file'], - [['c:', '/'], 'c:/'], - [['c:', 'file'], 'c:/file'] - ]); -} - -// Run the join tests. + [['c:', '/'], 'c:\\'], + [['c:', 'file'], 'c:\\file'] + ] + ) +]); joinTests.forEach(function(test) { - var actual = path.join.apply(path, test[0]); - var expected = common.isWindows ? test[1].replace(/\//g, '\\') : test[1]; - var message = 'path.join(' + test[0].map(JSON.stringify).join(',') + ')' + - '\n expect=' + JSON.stringify(expected) + - '\n actual=' + JSON.stringify(actual); - if (actual !== expected) failures.push('\n' + message); - // assert.equal(actual, expected, message); + if (!Array.isArray(test[0])) + test[0] = [test[0]]; + test[0].forEach(function(join) { + test[1].forEach(function(test) { + const actual = join.apply(null, test[0]); + const expected = test[1]; + // For non-Windows specific tests with the Windows join(), we need to try + // replacing the slashes since the non-Windows specific tests' `expected` + // use forward slashes + let actualAlt; + let os; + if (join === path.win32.join) { + actualAlt = actual.replace(/\\/g, '/'); + os = 'win32'; + } else { + os = 'posix'; + } + const fn = `path.${os}.join(`; + const message = fn + test[0].map(JSON.stringify).join(',') + ')' + + '\n expect=' + JSON.stringify(expected) + + '\n actual=' + JSON.stringify(actual); + if (actual !== expected && actualAlt !== expected) + failures.push('\n' + message); + }); + }); }); assert.equal(failures.length, 0, failures.join('')); + // Test thrown TypeErrors var typeErrorTests = [true, false, 7, null, {}, undefined, [], NaN]; @@ -286,7 +375,7 @@ typeErrorTests.forEach(function(test) { }); -// path normalize tests +// path.normalize tests assert.equal(path.win32.normalize('./fixtures///b/../b/c.js'), 'fixtures\\b\\c.js'); assert.equal(path.win32.normalize('/foo/../../../bar'), '\\bar'); @@ -295,6 +384,7 @@ assert.equal(path.win32.normalize('a//b//./c'), 'a\\b\\c'); assert.equal(path.win32.normalize('a//b//.'), 'a\\b'); assert.equal(path.win32.normalize('//server/share/dir/file.ext'), '\\\\server\\share\\dir\\file.ext'); +assert.equal(path.win32.normalize('/a/b/c/../../../x/y/z'), '\\x\\y\\z'); assert.equal(path.posix.normalize('./fixtures///b/../b/c.js'), 'fixtures/b/c.js'); @@ -302,49 +392,76 @@ assert.equal(path.posix.normalize('/foo/../../../bar'), '/bar'); assert.equal(path.posix.normalize('a//b//../b'), 'a/b'); assert.equal(path.posix.normalize('a//b//./c'), 'a/b/c'); assert.equal(path.posix.normalize('a//b//.'), 'a/b'); +assert.equal(path.posix.normalize('/a/b/c/../../../x/y/z'), '/x/y/z'); +assert.equal(path.posix.normalize('///..//./foo/.//bar'), '/foo/bar'); + // path.resolve tests -if (common.isWindows) { - // windows - var resolveTests = - // arguments result - [[['c:/blah\\blah', 'd:/games', 'c:../a'], 'c:\\blah\\a'], - [['c:/ignore', 'd:\\a/b\\c/d', '\\e.exe'], 'd:\\e.exe'], - [['c:/ignore', 'c:/some/file'], 'c:\\some\\file'], - [['d:/ignore', 'd:some/dir//'], 'd:\\ignore\\some\\dir'], - [['.'], process.cwd()], - [['//server/share', '..', 'relative\\'], '\\\\server\\share\\relative'], - [['c:/', '//'], 'c:\\'], - [['c:/', '//dir'], 'c:\\dir'], - [['c:/', '//server/share'], '\\\\server\\share\\'], - [['c:/', '//server//share'], '\\\\server\\share\\'], - [['c:/', '///some//dir'], 'c:\\some\\dir'] - ]; -} else { - // Posix - var resolveTests = - // arguments result - [[['/var/lib', '../', 'file/'], '/var/file'], - [['/var/lib', '/../', 'file/'], '/file'], - [['a/b/c/', '../../..'], process.cwd()], - [['.'], process.cwd()], - [['/some/dir', '.', '/absolute/'], '/absolute']]; -} -var failures = []; +const resolveTests = [ + [ path.win32.resolve, + // arguments result + [[['c:/blah\\blah', 'd:/games', 'c:../a'], 'c:\\blah\\a'], + [['c:/ignore', 'd:\\a/b\\c/d', '\\e.exe'], 'd:\\e.exe'], + [['c:/ignore', 'c:/some/file'], 'c:\\some\\file'], + [['d:/ignore', 'd:some/dir//'], 'd:\\ignore\\some\\dir'], + [['.'], process.cwd()], + [['//server/share', '..', 'relative\\'], '\\\\server\\share\\relative'], + [['c:/', '//'], 'c:\\'], + [['c:/', '//dir'], 'c:\\dir'], + [['c:/', '//server/share'], '\\\\server\\share\\'], + [['c:/', '//server//share'], '\\\\server\\share\\'], + [['c:/', '///some//dir'], 'c:\\some\\dir'], + [['C:\\foo\\tmp.3\\', '..\\tmp.3\\cycles\\root.js'], + 'C:\\foo\\tmp.3\\cycles\\root.js'] + ] + ], + [ path.posix.resolve, + // arguments result + [[['/var/lib', '../', 'file/'], '/var/file'], + [['/var/lib', '/../', 'file/'], '/file'], + [['a/b/c/', '../../..'], process.cwd()], + [['.'], process.cwd()], + [['/some/dir', '.', '/absolute/'], '/absolute'], + [['/foo/tmp.3/', '../tmp.3/cycles/root.js'], '/foo/tmp.3/cycles/root.js'] + ] + ] +]; resolveTests.forEach(function(test) { - var actual = path.resolve.apply(path, test[0]); - var expected = test[1]; - var message = 'path.resolve(' + test[0].map(JSON.stringify).join(',') + ')' + - '\n expect=' + JSON.stringify(expected) + - '\n actual=' + JSON.stringify(actual); - if (actual !== expected) failures.push('\n' + message); - // assert.equal(actual, expected, message); + const resolve = test[0]; + test[1].forEach(function(test) { + const actual = resolve.apply(null, test[0]); + let actualAlt; + const os = resolve === path.win32.resolve ? 'win32' : 'posix'; + if (resolve === path.win32.resolve && !common.isWindows) + actualAlt = actual.replace(/\\/g, '/'); + else if (resolve !== path.win32.resolve && common.isWindows) + actualAlt = actual.replace(/\//g, '\\'); + + const expected = test[1]; + const fn = `path.${os}.resolve(`; + const message = fn + test[0].map(JSON.stringify).join(',') + ')' + + '\n expect=' + JSON.stringify(expected) + + '\n actual=' + JSON.stringify(actual); + if (actual !== expected && actualAlt !== expected) + failures.push('\n' + message); + }); }); assert.equal(failures.length, 0, failures.join('')); + // path.isAbsolute tests +assert.equal(path.win32.isAbsolute('/'), true); +assert.equal(path.win32.isAbsolute('//'), true); +assert.equal(path.win32.isAbsolute('//server'), true); assert.equal(path.win32.isAbsolute('//server/file'), true); assert.equal(path.win32.isAbsolute('\\\\server\\file'), true); +assert.equal(path.win32.isAbsolute('\\\\server'), true); +assert.equal(path.win32.isAbsolute('\\\\'), true); +assert.equal(path.win32.isAbsolute('c'), false); +assert.equal(path.win32.isAbsolute('c:'), false); +assert.equal(path.win32.isAbsolute('c:\\'), true); +assert.equal(path.win32.isAbsolute('c:/'), true); +assert.equal(path.win32.isAbsolute('c://'), true); assert.equal(path.win32.isAbsolute('C:/Users/'), true); assert.equal(path.win32.isAbsolute('C:\\Users\\'), true); assert.equal(path.win32.isAbsolute('C:cwd/another'), false); @@ -357,43 +474,72 @@ assert.equal(path.posix.isAbsolute('/home/foo/..'), true); assert.equal(path.posix.isAbsolute('bar/'), false); assert.equal(path.posix.isAbsolute('./baz'), false); + // path.relative tests -if (common.isWindows) { - // windows - var relativeTests = - // arguments result - [['c:/blah\\blah', 'd:/games', 'd:\\games'], - ['c:/aaaa/bbbb', 'c:/aaaa', '..'], - ['c:/aaaa/bbbb', 'c:/cccc', '..\\..\\cccc'], - ['c:/aaaa/bbbb', 'c:/aaaa/bbbb', ''], - ['c:/aaaa/bbbb', 'c:/aaaa/cccc', '..\\cccc'], - ['c:/aaaa/', 'c:/aaaa/cccc', 'cccc'], - ['c:/', 'c:\\aaaa\\bbbb', 'aaaa\\bbbb'], - ['c:/aaaa/bbbb', 'd:\\', 'd:\\']]; -} else { - // posix - var relativeTests = - // arguments result - [['/var/lib', '/var', '..'], - ['/var/lib', '/bin', '../../bin'], - ['/var/lib', '/var/lib', ''], - ['/var/lib', '/var/apache', '../apache'], - ['/var/', '/var/lib', 'lib'], - ['/', '/var/lib', 'var/lib']]; -} -var failures = []; +const relativeTests = [ + [ path.win32.relative, + // arguments result + [['c:/blah\\blah', 'd:/games', 'd:\\games'], + ['c:/aaaa/bbbb', 'c:/aaaa', '..'], + ['c:/aaaa/bbbb', 'c:/cccc', '..\\..\\cccc'], + ['c:/aaaa/bbbb', 'c:/aaaa/bbbb', ''], + ['c:/aaaa/bbbb', 'c:/aaaa/cccc', '..\\cccc'], + ['c:/aaaa/', 'c:/aaaa/cccc', 'cccc'], + ['c:/', 'c:\\aaaa\\bbbb', 'aaaa\\bbbb'], + ['c:/aaaa/bbbb', 'd:\\', 'd:\\'], + ['c:/AaAa/bbbb', 'c:/aaaa/bbbb', ''], + ['c:/aaaaa/', 'c:/aaaa/cccc', '..\\aaaa\\cccc'], + ['C:\\foo\\bar\\baz\\quux', 'C:\\', '..\\..\\..\\..'], + ['C:\\foo\\test', 'C:\\foo\\test\\bar\\package.json', 'bar\\package.json'], + ['C:\\foo\\bar\\baz-quux', 'C:\\foo\\bar\\baz', '..\\baz'], + ['C:\\foo\\bar\\baz', 'C:\\foo\\bar\\baz-quux', '..\\baz-quux'], + ['\\\\foo\\bar', '\\\\foo\\bar\\baz', 'baz'], + ['\\\\foo\\bar\\baz', '\\\\foo\\bar', '..'], + ['\\\\foo\\bar\\baz-quux', '\\\\foo\\bar\\baz', '..\\baz'], + ['\\\\foo\\bar\\baz', '\\\\foo\\bar\\baz-quux', '..\\baz-quux'], + ['C:\\baz-quux', 'C:\\baz', '..\\baz'], + ['C:\\baz', 'C:\\baz-quux', '..\\baz-quux'], + ['\\\\foo\\baz-quux', '\\\\foo\\baz', '..\\baz'], + ['\\\\foo\\baz', '\\\\foo\\baz-quux', '..\\baz-quux'] + ] + ], + [ path.posix.relative, + // arguments result + [['/var/lib', '/var', '..'], + ['/var/lib', '/bin', '../../bin'], + ['/var/lib', '/var/lib', ''], + ['/var/lib', '/var/apache', '../apache'], + ['/var/', '/var/lib', 'lib'], + ['/', '/var/lib', 'var/lib'], + ['/foo/test', '/foo/test/bar/package.json', 'bar/package.json'], + ['/Users/a/web/b/test/mails', '/Users/a/web/b', '../..'], + ['/foo/bar/baz-quux', '/foo/bar/baz', '../baz'], + ['/foo/bar/baz', '/foo/bar/baz-quux', '../baz-quux'], + ['/baz-quux', '/baz', '../baz'], + ['/baz', '/baz-quux', '../baz-quux'] + ] + ] +]; relativeTests.forEach(function(test) { - var actual = path.relative(test[0], test[1]); - var expected = test[2]; - var message = 'path.relative(' + - test.slice(0, 2).map(JSON.stringify).join(',') + - ')' + - '\n expect=' + JSON.stringify(expected) + - '\n actual=' + JSON.stringify(actual); - if (actual !== expected) failures.push('\n' + message); + const relative = test[0]; + test[1].forEach(function(test) { + const actual = relative(test[0], test[1]); + const expected = test[2]; + const os = relative === path.win32.relative ? 'win32' : 'posix'; + const fn = `path.${os}.relative(`; + const message = fn + + test.slice(0, 2).map(JSON.stringify).join(',') + + ')' + + '\n expect=' + JSON.stringify(expected) + + '\n actual=' + JSON.stringify(actual); + if (actual !== expected) + failures.push('\n' + message); + }); }); assert.equal(failures.length, 0, failures.join('')); + +// path.sep tests // windows assert.equal(path.win32.sep, '\\'); // posix @@ -402,11 +548,44 @@ assert.equal(path.posix.sep, '/'); // path.delimiter tests // windows assert.equal(path.win32.delimiter, ';'); - // posix assert.equal(path.posix.delimiter, ':'); +// path._makeLong tests +const emptyObj = {}; +assert.equal(path.posix._makeLong('/foo/bar'), '/foo/bar'); +assert.equal(path.posix._makeLong('foo/bar'), 'foo/bar'); +assert.equal(path.posix._makeLong(null), null); +assert.equal(path.posix._makeLong(true), true); +assert.equal(path.posix._makeLong(1), 1); +assert.equal(path.posix._makeLong(), undefined); +assert.equal(path.posix._makeLong(emptyObj), emptyObj); +if (common.isWindows) { + // These tests cause resolve() to insert the cwd, so we cannot test them from + // non-Windows platforms (easily) + assert.equal(path.win32._makeLong('foo\\bar').toLowerCase(), + '\\\\?\\' + process.cwd().toLowerCase() + '\\foo\\bar'); + assert.equal(path.win32._makeLong('foo/bar').toLowerCase(), + '\\\\?\\' + process.cwd().toLowerCase() + '\\foo\\bar'); + const currentDeviceLetter = path.parse(process.cwd()).root.substring(0, 2); + assert.equal(path.win32._makeLong(currentDeviceLetter).toLowerCase(), + '\\\\?\\' + process.cwd().toLowerCase()); + assert.equal(path.win32._makeLong('C').toLowerCase(), + '\\\\?\\' + process.cwd().toLowerCase() + '\\c'); +} +assert.equal(path.win32._makeLong('C:\\foo'), '\\\\?\\C:\\foo'); +assert.equal(path.win32._makeLong('C:/foo'), '\\\\?\\C:\\foo'); +assert.equal(path.win32._makeLong('\\\\foo\\bar'), '\\\\?\\UNC\\foo\\bar\\'); +assert.equal(path.win32._makeLong('//foo//bar'), '\\\\?\\UNC\\foo\\bar\\'); +assert.equal(path.win32._makeLong('\\\\?\\foo'), '\\\\?\\foo'); +assert.equal(path.win32._makeLong(null), null); +assert.equal(path.win32._makeLong(true), true); +assert.equal(path.win32._makeLong(1), 1); +assert.equal(path.win32._makeLong(), undefined); +assert.equal(path.win32._makeLong(emptyObj), emptyObj); + + if (common.isWindows) assert.deepEqual(path, path.win32, 'should be win32 path module'); else diff --git a/test/sequential/test-pipe-address.js b/test/parallel/test-pipe-address.js similarity index 100% rename from test/sequential/test-pipe-address.js rename to test/parallel/test-pipe-address.js diff --git a/test/sequential/test-pipe-head.js b/test/parallel/test-pipe-head.js similarity index 100% rename from test/sequential/test-pipe-head.js rename to test/parallel/test-pipe-head.js diff --git a/test/parallel/test-pipe-return-val.js b/test/parallel/test-pipe-return-val.js index 718d052cd24c27..eab5db8f70cf92 100644 --- a/test/parallel/test-pipe-return-val.js +++ b/test/parallel/test-pipe-return-val.js @@ -1,10 +1,9 @@ 'use strict'; // This test ensures SourceStream.pipe(DestStream) returns DestStream -var common = require('../common'); +require('../common'); var Stream = require('stream').Stream; var assert = require('assert'); -var util = require('util'); var sourceStream = new Stream(); var destStream = new Stream(); diff --git a/test/sequential/test-pipe-stream.js b/test/parallel/test-pipe-stream.js similarity index 99% rename from test/sequential/test-pipe-stream.js rename to test/parallel/test-pipe-stream.js index 693066c2fb25d0..6298495087ac06 100644 --- a/test/sequential/test-pipe-stream.js +++ b/test/parallel/test-pipe-stream.js @@ -65,4 +65,3 @@ function test(clazz, cb) { test(net.Stream, function() { test(net.Socket); }); - diff --git a/test/sequential/test-pipe-unref.js b/test/parallel/test-pipe-unref.js similarity index 100% rename from test/sequential/test-pipe-unref.js rename to test/parallel/test-pipe-unref.js diff --git a/test/parallel/test-preload.js b/test/parallel/test-preload.js index b4a3af78d8df3b..e7d89d124c798c 100644 --- a/test/parallel/test-preload.js +++ b/test/parallel/test-preload.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'), - assert = require('assert'), - path = require('path'), - child_process = require('child_process'); +const common = require('../common'); +const assert = require('assert'); +const path = require('path'); +const child_process = require('child_process'); var nodeBinary = process.argv[0]; @@ -21,6 +21,7 @@ var fixture = function(name) { var fixtureA = fixture('printA.js'); var fixtureB = fixture('printB.js'); var fixtureC = fixture('printC.js'); +const fixtureD = fixture('define-global.js'); var fixtureThrows = fixture('throws_error4.js'); // test preloading a single module works @@ -73,6 +74,18 @@ child_process.exec(nodeBinary + ' ' assert.equal(stdout, 'A\nB\nhello\n'); }); +// test that preload works with -i +const interactive = child_process.exec(nodeBinary + ' ' + + preloadOption([fixtureD]) + + '-i', + common.mustCall(function(err, stdout, stderr) { + assert.ifError(err); + assert.strictEqual(stdout, `> 'test'\n> `); + })); + +interactive.stdin.write('a\n'); +interactive.stdin.write('process.exit()\n'); + child_process.exec(nodeBinary + ' ' + '--require ' + fixture('cluster-preload.js') + ' ' + fixture('cluster-preload-test.js'), @@ -82,7 +95,6 @@ child_process.exec(nodeBinary + ' ' }); // https://github.com/nodejs/node/issues/1691 -var originalCwd = process.cwd(); process.chdir(path.join(__dirname, '../fixtures/')); child_process.exec(nodeBinary + ' ' + '--expose_debug_as=v8debug ' diff --git a/test/parallel/test-process-before-exit.js b/test/parallel/test-process-before-exit.js index eff96da98e4729..5d8855869a8e4a 100644 --- a/test/parallel/test-process-before-exit.js +++ b/test/parallel/test-process-before-exit.js @@ -1,6 +1,6 @@ 'use strict'; +require('../common'); var assert = require('assert'); -var common = require('../common'); var N = 5; var n = 0; diff --git a/test/parallel/test-process-binding.js b/test/parallel/test-process-binding.js index 5350a8c66932cb..722e9333aff60a 100644 --- a/test/parallel/test-process-binding.js +++ b/test/parallel/test-process-binding.js @@ -12,7 +12,7 @@ assert.throws( assert.doesNotThrow(function() { process.binding('buffer'); }, function(err) { - if ( (err instanceof Error) ) { + if (err instanceof Error) { return true; } }, 'unexpected error'); diff --git a/test/parallel/test-process-config.js b/test/parallel/test-process-config.js index 4fc3bcaa98afc8..cedd773dfbeaeb 100644 --- a/test/parallel/test-process-config.js +++ b/test/parallel/test-process-config.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var fs = require('fs'); var path = require('path'); diff --git a/test/parallel/test-process-emit.js b/test/parallel/test-process-emit.js new file mode 100644 index 00000000000000..f4f6d546f15cfa --- /dev/null +++ b/test/parallel/test-process-emit.js @@ -0,0 +1,22 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const sym = Symbol(); + +process.on('normal', common.mustCall((data) => { + assert.strictEqual(data, 'normalData'); +})); + +process.on(sym, common.mustCall((data) => { + assert.strictEqual(data, 'symbolData'); +})); + +process.on('SIGPIPE', common.mustCall((data) => { + assert.strictEqual(data, 'signalData'); +})); + +process.emit('normal', 'normalData'); +process.emit(sym, 'symbolData'); +process.emit('SIGPIPE', 'signalData'); + +assert.strictEqual(isNaN(process._eventsCount), false); diff --git a/test/parallel/test-process-env.js b/test/parallel/test-process-env.js index 7e927d09bae668..b5e62324ac15db 100644 --- a/test/parallel/test-process-env.js +++ b/test/parallel/test-process-env.js @@ -4,7 +4,7 @@ // first things first, set the timezone; see tzset(3) process.env.TZ = 'Europe/Amsterdam'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; @@ -31,12 +31,12 @@ if (process.argv[2] == 'you-are-the-child') { assert.equal(42, process.env.NODE_PROCESS_ENV); assert.equal('asdf', process.env.hasOwnProperty); var hasOwnProperty = Object.prototype.hasOwnProperty; - var has = hasOwnProperty.call(process.env, 'hasOwnProperty'); + const has = hasOwnProperty.call(process.env, 'hasOwnProperty'); assert.equal(true, has); process.exit(0); } else { assert.equal(Object.prototype.hasOwnProperty, process.env.hasOwnProperty); - var has = process.env.hasOwnProperty('hasOwnProperty'); + const has = process.env.hasOwnProperty('hasOwnProperty'); assert.equal(false, has); process.env.hasOwnProperty = 'asdf'; diff --git a/test/parallel/test-process-exit-code.js b/test/parallel/test-process-exit-code.js index fea8c2d4fcdc5d..8d657528d05561 100644 --- a/test/parallel/test-process-exit-code.js +++ b/test/parallel/test-process-exit-code.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); switch (process.argv[2]) { diff --git a/test/parallel/test-process-exit.js b/test/parallel/test-process-exit.js index 999eefc1eff518..0ea36f158eaf9b 100644 --- a/test/parallel/test-process-exit.js +++ b/test/parallel/test-process-exit.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); // calling .exit() from within "exit" should not overflow the call stack diff --git a/test/parallel/test-process-getactivehandles.js b/test/parallel/test-process-getactivehandles.js new file mode 100644 index 00000000000000..e257439f7ba035 --- /dev/null +++ b/test/parallel/test-process-getactivehandles.js @@ -0,0 +1,47 @@ +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); +const NUM = 8; +const connections = []; +const clients = []; +var clients_counter = 0; + +const server = net.createServer(function listener(c) { + connections.push(c); +}).listen(common.PORT, makeConnection); + + +function makeConnection() { + if (clients_counter >= NUM) return; + net.connect(common.PORT, function connected() { + clientConnected(this); + makeConnection(); + }); +} + + +function clientConnected(client) { + clients.push(client); + if (++clients_counter >= NUM) + checkAll(); +} + + +function checkAll() { + const handles = process._getActiveHandles(); + + clients.forEach(function(item) { + assert.ok(handles.indexOf(item) > -1); + item.destroy(); + }); + + connections.forEach(function(item) { + assert.ok(handles.indexOf(item) > -1); + item.end(); + }); + + assert.ok(handles.indexOf(server) > -1); + server.close(); +} diff --git a/test/parallel/test-process-getactiverequests.js b/test/parallel/test-process-getactiverequests.js new file mode 100644 index 00000000000000..30773f8f11380a --- /dev/null +++ b/test/parallel/test-process-getactiverequests.js @@ -0,0 +1,10 @@ +'use strict'; + +require('../common'); +const assert = require('assert'); +const fs = require('fs'); + +for (let i = 0; i < 12; i++) + fs.open(__filename, 'r', function() { }); + +assert.equal(12, process._getActiveRequests().length); diff --git a/test/parallel/test-process-getgroups.js b/test/parallel/test-process-getgroups.js index b18b5a0f2f90d4..08eab8d5a8afe2 100644 --- a/test/parallel/test-process-getgroups.js +++ b/test/parallel/test-process-getgroups.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var exec = require('child_process').exec; diff --git a/test/parallel/test-process-hrtime.js b/test/parallel/test-process-hrtime.js index 0e2c5b110e9292..db16be0ad9e812 100644 --- a/test/parallel/test-process-hrtime.js +++ b/test/parallel/test-process-hrtime.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); // the default behavior, return an Array "tuple" of numbers @@ -24,3 +24,6 @@ function validateTuple(tuple) { assert(isFinite(v)); }); } + +const diff = process.hrtime([0, 1e9 - 1]); +assert(diff[1] >= 0); // https://github.com/nodejs/node/issues/4751 diff --git a/test/parallel/test-process-kill-null.js b/test/parallel/test-process-kill-null.js index 65dab752f12e6d..2516773f08786a 100644 --- a/test/parallel/test-process-kill-null.js +++ b/test/parallel/test-process-kill-null.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; diff --git a/test/parallel/test-process-kill-pid.js b/test/parallel/test-process-kill-pid.js index f193e979166da7..5c11be2903c4a7 100644 --- a/test/parallel/test-process-kill-pid.js +++ b/test/parallel/test-process-kill-pid.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); // test variants of pid diff --git a/test/parallel/test-process-next-tick.js b/test/parallel/test-process-next-tick.js index e7b5f8f3fe886e..6b20cfbe93377b 100644 --- a/test/parallel/test-process-next-tick.js +++ b/test/parallel/test-process-next-tick.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var N = 2; var tickCount = 0; diff --git a/test/parallel/test-process-raw-debug.js b/test/parallel/test-process-raw-debug.js index f849457d643894..ab461902911a93 100644 --- a/test/parallel/test-process-raw-debug.js +++ b/test/parallel/test-process-raw-debug.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var os = require('os'); diff --git a/test/parallel/test-process-wrap.js b/test/parallel/test-process-wrap.js index bf3dfe4e8b1651..b5d4dc35e4fe00 100644 --- a/test/parallel/test-process-wrap.js +++ b/test/parallel/test-process-wrap.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var Process = process.binding('process_wrap').Process; var Pipe = process.binding('pipe_wrap').Pipe; diff --git a/test/parallel/test-promises-unhandled-rejections.js b/test/parallel/test-promises-unhandled-rejections.js index e5b3e6f35c0d45..5da2bff00acaa2 100644 --- a/test/parallel/test-promises-unhandled-rejections.js +++ b/test/parallel/test-promises-unhandled-rejections.js @@ -164,7 +164,7 @@ asyncTest('Catching a promise rejection after setImmediate is not' + }); _reject(e); setImmediate(function() { - promise.then(assert.fail, function() {}); + promise.then(common.fail, function() {}); }); }); @@ -176,7 +176,7 @@ asyncTest('When re-throwing new errors in a promise catch, only the' + assert.strictEqual(e2, reason); assert.strictEqual(promise2, promise); }); - var promise2 = Promise.reject(e).then(assert.fail, function(reason) { + var promise2 = Promise.reject(e).then(common.fail, function(reason) { assert.strictEqual(e, reason); throw e2; }); @@ -185,12 +185,11 @@ asyncTest('When re-throwing new errors in a promise catch, only the' + asyncTest('Test params of unhandledRejection for a synchronously-rejected' + 'promise', function(done) { var e = new Error(); - var e2 = new Error(); onUnhandledSucceed(done, function(reason, promise) { assert.strictEqual(e, reason); assert.strictEqual(promise, promise); }); - var promise = Promise.reject(e); + Promise.reject(e); }); asyncTest('When re-throwing new errors in a promise catch, only the ' + @@ -206,7 +205,7 @@ asyncTest('When re-throwing new errors in a promise catch, only the ' + setTimeout(function() { reject(e); }, 1); - }).then(assert.fail, function(reason) { + }).then(common.fail, function(reason) { assert.strictEqual(e, reason); throw e2; }); @@ -225,7 +224,7 @@ asyncTest('When re-throwing new errors in a promise catch, only the re-thrown' + setTimeout(function() { reject(e); process.nextTick(function() { - promise2 = promise.then(assert.fail, function(reason) { + promise2 = promise.then(common.fail, function(reason) { assert.strictEqual(e, reason); throw e2; }); @@ -235,23 +234,27 @@ asyncTest('When re-throwing new errors in a promise catch, only the re-thrown' + var promise2; }); -asyncTest('unhandledRejection should not be triggered if a promise catch is' + - ' attached synchronously upon the promise\'s creation', - function(done) { - var e = new Error(); - onUnhandledFail(done); - Promise.reject(e).then(assert.fail, function() {}); -}); - -asyncTest('unhandledRejection should not be triggered if a promise catch is' + - ' attached synchronously upon the promise\'s creation', - function(done) { - var e = new Error(); - onUnhandledFail(done); - new Promise(function(_, reject) { - reject(e); - }).then(assert.fail, function() {}); -}); +asyncTest( + 'unhandledRejection should not be triggered if a promise catch is' + + ' attached synchronously upon the promise\'s creation', + function(done) { + var e = new Error(); + onUnhandledFail(done); + Promise.reject(e).then(common.fail, function() {}); + } +); + +asyncTest( + 'unhandledRejection should not be triggered if a promise catch is' + + ' attached synchronously upon the promise\'s creation', + function(done) { + var e = new Error(); + onUnhandledFail(done); + new Promise(function(_, reject) { + reject(e); + }).then(common.fail, function() {}); + } +); asyncTest('Attaching a promise catch in a process.nextTick is soon enough to' + ' prevent unhandledRejection', function(done) { @@ -259,7 +262,7 @@ asyncTest('Attaching a promise catch in a process.nextTick is soon enough to' + onUnhandledFail(done); var promise = Promise.reject(e); process.nextTick(function() { - promise.then(assert.fail, function() {}); + promise.then(common.fail, function() {}); }); }); @@ -271,7 +274,7 @@ asyncTest('Attaching a promise catch in a process.nextTick is soon enough to' + reject(e); }); process.nextTick(function() { - promise.then(assert.fail, function() {}); + promise.then(common.fail, function() {}); }); }); @@ -302,7 +305,7 @@ asyncTest('catching a promise which is asynchronously rejected (via' + reject(e); }, 1); }); - }).then(assert.fail, function(reason) { + }).then(common.fail, function(reason) { assert.strictEqual(e, reason); }); }); @@ -313,7 +316,7 @@ asyncTest('Catching a rejected promise derived from throwing in a' + onUnhandledFail(done); Promise.resolve().then(function() { throw e; - }).then(assert.fail, function(reason) { + }).then(common.fail, function(reason) { assert.strictEqual(e, reason); }); }); @@ -325,7 +328,7 @@ asyncTest('Catching a rejected promise derived from returning a' + onUnhandledFail(done); Promise.resolve().then(function() { return Promise.reject(e); - }).then(assert.fail, function(reason) { + }).then(common.fail, function(reason) { assert.strictEqual(e, reason); }); }); @@ -361,43 +364,47 @@ asyncTest('A rejected promise derived from throwing in a fulfillment handler' + }); }); -asyncTest('A rejected promise derived from returning a synchronously-rejected' + - ' promise in a fulfillment handler does trigger unhandledRejection', - function(done) { - var e = new Error(); - var _promise; - onUnhandledSucceed(done, function(reason, promise) { - assert.strictEqual(e, reason); - assert.strictEqual(_promise, promise); - }); - _promise = Promise.resolve().then(function() { - return Promise.reject(e); - }); -}); +asyncTest( + 'A rejected promise derived from returning a synchronously-rejected' + + ' promise in a fulfillment handler does trigger unhandledRejection', + function(done) { + var e = new Error(); + var _promise; + onUnhandledSucceed(done, function(reason, promise) { + assert.strictEqual(e, reason); + assert.strictEqual(_promise, promise); + }); + _promise = Promise.resolve().then(function() { + return Promise.reject(e); + }); + } +); // Combinations with Promise.all asyncTest('Catching the Promise.all() of a collection that includes a' + 'rejected promise prevents unhandledRejection', function(done) { var e = new Error(); onUnhandledFail(done); - Promise.all([Promise.reject(e)]).then(assert.fail, function() {}); + Promise.all([Promise.reject(e)]).then(common.fail, function() {}); }); -asyncTest('Catching the Promise.all() of a collection that includes a ' + - 'nextTick-async rejected promise prevents unhandledRejection', - function(done) { - var e = new Error(); - onUnhandledFail(done); - var p = new Promise(function(_, reject) { +asyncTest( + 'Catching the Promise.all() of a collection that includes a ' + + 'nextTick-async rejected promise prevents unhandledRejection', + function(done) { + var e = new Error(); + onUnhandledFail(done); + var p = new Promise(function(_, reject) { + process.nextTick(function() { + reject(e); + }); + }); + p = Promise.all([p]); process.nextTick(function() { - reject(e); + p.then(common.fail, function() {}); }); - }); - p = Promise.all([p]); - process.nextTick(function() { - p.then(assert.fail, function() {}); - }); -}); + } +); asyncTest('Failing to catch the Promise.all() of a collection that includes' + ' a rejected promise triggers unhandledRejection for the returned' + @@ -430,7 +437,7 @@ asyncTest('Waiting setTimeout(, 10) to catch a promise causes an' + throw e; }); setTimeout(function() { - thePromise.then(assert.fail, function(reason) { + thePromise.then(common.fail, function(reason) { assert.strictEqual(e, reason); }); }, 10); @@ -448,7 +455,7 @@ asyncTest('Waiting for some combination of process.nextTick + promise' + Promise.resolve().then(function() { process.nextTick(function() { Promise.resolve().then(function() { - a.catch(function() {}); + a.catch(function() {}); }); }); }); @@ -467,7 +474,7 @@ asyncTest('Waiting for some combination of process.nextTick + promise' + Promise.resolve().then(function() { process.nextTick(function() { Promise.resolve().then(function() { - a.catch(function() {}); + a.catch(function() {}); }); }); }); @@ -487,7 +494,7 @@ asyncTest('Waiting for some combination of process.nextTick + promise ' + Promise.resolve().then(function() { process.nextTick(function() { Promise.resolve().then(function() { - a.catch(function() {}); + a.catch(function() {}); }); }); }); @@ -507,33 +514,35 @@ asyncTest('Waiting for some combination of promise microtasks + ' + process.nextTick(function() { Promise.resolve().then(function() { process.nextTick(function() { - a.catch(function() {}); + a.catch(function() {}); }); }); }); }); }); -asyncTest('Waiting for some combination of promise microtasks +' + - ' process.nextTick to attach a catch handler is still soon enough' + - ' to prevent unhandledRejection: inside setImmediate', - function(done) { - var e = new Error(); - onUnhandledFail(done); +asyncTest( + 'Waiting for some combination of promise microtasks +' + + ' process.nextTick to attach a catch handler is still soon enough' + + ' to prevent unhandledRejection: inside setImmediate', + function(done) { + var e = new Error(); + onUnhandledFail(done); - setImmediate(function() { - var a = Promise.reject(e); - Promise.resolve().then(function() { - process.nextTick(function() { - Promise.resolve().then(function() { - process.nextTick(function() { - a.catch(function() {}); + setImmediate(function() { + var a = Promise.reject(e); + Promise.resolve().then(function() { + process.nextTick(function() { + Promise.resolve().then(function() { + process.nextTick(function() { + a.catch(function() {}); + }); }); }); }); }); - }); -}); + } +); asyncTest('Waiting for some combination of promise microtasks +' + ' process.nextTick to attach a catch handler is still soon enough' + @@ -547,7 +556,7 @@ asyncTest('Waiting for some combination of promise microtasks +' + process.nextTick(function() { Promise.resolve().then(function() { process.nextTick(function() { - a.catch(function() {}); + a.catch(function() {}); }); }); }); @@ -613,28 +622,30 @@ asyncTest('setImmediate + promise microtasks is too late to attach a catch' + }); }); -asyncTest('Promise unhandledRejection handler does not interfere with domain' + - ' error handlers being given exceptions thrown from nextTick.', - function(done) { - var d = domain.create(); - var domainReceivedError; - d.on('error', function(e) { - domainReceivedError = e; - }); - d.run(function() { - var e = new Error('error'); - var domainError = new Error('domain error'); - onUnhandledSucceed(done, function(reason, promise) { - assert.strictEqual(reason, e); - assert.strictEqual(domainReceivedError, domainError); - d.dispose(); +asyncTest( + 'Promise unhandledRejection handler does not interfere with domain' + + ' error handlers being given exceptions thrown from nextTick.', + function(done) { + var d = domain.create(); + var domainReceivedError; + d.on('error', function(e) { + domainReceivedError = e; }); - var a = Promise.reject(e); - process.nextTick(function() { - throw domainError; + d.run(function() { + var e = new Error('error'); + var domainError = new Error('domain error'); + onUnhandledSucceed(done, function(reason, promise) { + assert.strictEqual(reason, e); + assert.strictEqual(domainReceivedError, domainError); + d.dispose(); + }); + Promise.reject(e); + process.nextTick(function() { + throw domainError; + }); }); - }); -}); + } +); asyncTest('nextTick is immediately scheduled when called inside an event' + ' handler', function(done) { diff --git a/test/parallel/test-punycode.js b/test/parallel/test-punycode.js index 179bca51ec2fe0..42927549eae395 100644 --- a/test/parallel/test-punycode.js +++ b/test/parallel/test-punycode.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var punycode = require('punycode'); var assert = require('assert'); diff --git a/test/parallel/test-querystring-maxKeys-non-finite.js b/test/parallel/test-querystring-maxKeys-non-finite.js new file mode 100644 index 00000000000000..aab7c45f1b6bed --- /dev/null +++ b/test/parallel/test-querystring-maxKeys-non-finite.js @@ -0,0 +1,55 @@ +'use strict'; +// This test was originally written to test a regression +// that was introduced by +// https://github.com/nodejs/node/pull/2288#issuecomment-179543894 +require('../common'); + +const assert = require('assert'); +const parse = require('querystring').parse; + +/* +taken from express-js/body-parser +https://github.com/expressjs/body-parser/ +blob/ed25264fb494cf0c8bc992b8257092cd4f694d5e/test/urlencoded.js#L636-L651 +*/ +function createManyParams(count) { + var str = ''; + + if (count === 0) { + return str; + } + + str += '0=0'; + + for (var i = 1; i < count; i++) { + var n = i.toString(36); + str += '&' + n + '=' + n; + } + + return str; +} + +const count = 10000; +const originalMaxLength = 1000; +const params = createManyParams(count); + +// thealphanerd +// 27def4f introduced a change to parse that would cause Inifity +// to be passed to String.prototype.split as an argument for limit +// In this instance split will always return an empty array +// this test confirms that the output of parse is the expected length +// when passed Infinity as the argument for maxKeys +const resultInfinity = parse(params, undefined, undefined, {maxKeys: Infinity}); +const resultNaN = parse(params, undefined, undefined, {maxKeys: NaN}); +const resultInfinityString = parse(params, undefined, undefined, { + maxKeys: 'Infinity' +}); +const resultNaNString = parse(params, undefined, undefined, {maxKeys: 'NaN'}); + +// Non Finite maxKeys should return the length of input +assert.equal(Object.keys(resultInfinity).length, count); +assert.equal(Object.keys(resultNaN).length, count); +// Strings maxKeys should return the maxLength +// defined by parses internals +assert.equal(Object.keys(resultInfinityString).length, originalMaxLength); +assert.equal(Object.keys(resultNaNString).length, originalMaxLength); diff --git a/test/parallel/test-querystring-multichar-separator.js b/test/parallel/test-querystring-multichar-separator.js new file mode 100644 index 00000000000000..488b5ac56aefa0 --- /dev/null +++ b/test/parallel/test-querystring-multichar-separator.js @@ -0,0 +1,24 @@ +'use strict'; +require('../common'); +const assert = require('assert'); +const qs = require('querystring'); + +assert.deepEqual( + qs.parse('foo=>bar&&bar=>baz', '&&', '=>'), + {foo: 'bar', bar: 'baz'} +); + +assert.strictEqual( + qs.stringify({foo: 'bar', bar: 'baz'}, '&&', '=>'), + 'foo=>bar&&bar=>baz' +); + +assert.deepEqual( + qs.parse('foo==>bar, bar==>baz', ', ', '==>'), + {foo: 'bar', bar: 'baz'} +); + +assert.strictEqual( + qs.stringify({foo: 'bar', bar: 'baz'}, ', ', '==>'), + 'foo==>bar, bar==>baz' +); diff --git a/test/parallel/test-querystring.js b/test/parallel/test-querystring.js index 66497ac2d3b6db..24992b4c69a33a 100644 --- a/test/parallel/test-querystring.js +++ b/test/parallel/test-querystring.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); // test using assert @@ -139,6 +139,11 @@ qsWeirdObjects.forEach(function(testCase) { assert.equal(testCase[1], qs.stringify(testCase[0])); }); +// invalid surrogate pair throws URIError +assert.throws(function() { + qs.stringify({ foo: '\udc00' }); +}, URIError); + // coerce numbers to string assert.strictEqual('foo=0', qs.stringify({ foo: 0 })); assert.strictEqual('foo=0', qs.stringify({ foo: -0 })); @@ -148,29 +153,32 @@ assert.strictEqual('foo=', qs.stringify({ foo: NaN })); assert.strictEqual('foo=', qs.stringify({ foo: Infinity })); // nested -var f = qs.stringify({ - a: 'b', - q: qs.stringify({ - x: 'y', - y: 'z' - }) -}); -assert.equal(f, 'a=b&q=x%3Dy%26y%3Dz'); +{ + const f = qs.stringify({ + a: 'b', + q: qs.stringify({ + x: 'y', + y: 'z' + }) + }); + assert.equal(f, 'a=b&q=x%3Dy%26y%3Dz'); +} assert.doesNotThrow(function() { qs.parse(undefined); }); // nested in colon -var f = qs.stringify({ - a: 'b', - q: qs.stringify({ - x: 'y', - y: 'z' - }, ';', ':') -}, ';', ':'); -assert.equal(f, 'a:b;q:x%3Ay%3By%3Az'); - +{ + const f = qs.stringify({ + a: 'b', + q: qs.stringify({ + x: 'y', + y: 'z' + }, ';', ':') + }, ';', ':'); + assert.equal(f, 'a:b;q:x%3Ay%3By%3Az'); +} assert.deepEqual({}, qs.parse()); @@ -182,12 +190,11 @@ assert.equal( // Test removing limit function testUnlimitedKeys() { - var query = {}, - url; + const query = {}; for (var i = 0; i < 2000; i++) query[i] = i; - url = qs.stringify(query); + const url = qs.stringify(query); assert.equal( Object.keys(qs.parse(url, null, null, { maxKeys: 0 })).length, @@ -246,3 +253,6 @@ qs.unescape = function(str) { }; assert.deepEqual(qs.parse('foo=bor'), {f__: 'b_r'}); qs.unescape = prevUnescape; + +// test separator and "equals" parsing order +assert.deepEqual(qs.parse('foo&bar', '&', '&'), { foo: '', bar: '' }); diff --git a/test/parallel/test-readdouble.js b/test/parallel/test-readdouble.js index c0dab8956593fe..6c55a65007aa88 100644 --- a/test/parallel/test-readdouble.js +++ b/test/parallel/test-readdouble.js @@ -2,7 +2,7 @@ /* * Tests to verify we're reading in doubles correctly */ -var common = require('../common'); +require('../common'); var ASSERT = require('assert'); /* diff --git a/test/parallel/test-readfloat.js b/test/parallel/test-readfloat.js index 5572bbf18e291b..468faf76029613 100644 --- a/test/parallel/test-readfloat.js +++ b/test/parallel/test-readfloat.js @@ -2,7 +2,7 @@ /* * Tests to verify we're reading in floats correctly */ -var common = require('../common'); +require('../common'); var ASSERT = require('assert'); /* diff --git a/test/parallel/test-readint.js b/test/parallel/test-readint.js index 233128d792d068..b3997f74f17721 100644 --- a/test/parallel/test-readint.js +++ b/test/parallel/test-readint.js @@ -2,7 +2,7 @@ /* * Tests to verify we're reading in signed integers correctly */ -var common = require('../common'); +require('../common'); var ASSERT = require('assert'); /* diff --git a/test/parallel/test-readline-interface.js b/test/parallel/test-readline-interface.js index 6d79879615fa28..5e9842acb00084 100644 --- a/test/parallel/test-readline-interface.js +++ b/test/parallel/test-readline-interface.js @@ -259,7 +259,7 @@ function isWarned(emitter) { }); try { fi.emit('data', 'fooX'); - } catch(e) { } + } catch (e) { } fi.emit('data', 'bar'); assert.equal(keys.join(''), 'fooXbar'); rli.close(); @@ -296,7 +296,7 @@ function isWarned(emitter) { rli.question(expectedLines.join('\n'), function() { rli.close(); }); - var cursorPos = rli._getCursorPos(); + cursorPos = rli._getCursorPos(); assert.equal(cursorPos.rows, expectedLines.length - 1); assert.equal(cursorPos.cols, expectedLines.slice(-1)[0].length); rli.close(); diff --git a/test/parallel/test-readline-keys.js b/test/parallel/test-readline-keys.js index 5cac38a1d7db42..e026c0b583cd9e 100644 --- a/test/parallel/test-readline-keys.js +++ b/test/parallel/test-readline-keys.js @@ -1,6 +1,5 @@ 'use strict'; require('../common'); -var EventEmitter = require('events').EventEmitter; var PassThrough = require('stream').PassThrough; var assert = require('assert'); var inherits = require('util').inherits; @@ -16,7 +15,7 @@ inherits(FakeInput, PassThrough); var fi = new FakeInput(); var fo = new FakeInput(); -var rli = new Interface({ input: fi, output: fo, terminal: true }); +new Interface({ input: fi, output: fo, terminal: true }); var keys = []; fi.on('keypress', function(s, k) { diff --git a/test/parallel/test-readline-undefined-columns.js b/test/parallel/test-readline-undefined-columns.js index 73945af8bc52b9..f3197ff59a9a55 100644 --- a/test/parallel/test-readline-undefined-columns.js +++ b/test/parallel/test-readline-undefined-columns.js @@ -11,7 +11,7 @@ const readline = require('readline'); const iStream = new PassThrough(); const oStream = new PassThrough(); -const rli = readline.createInterface({ +readline.createInterface({ terminal: true, input: iStream, output: oStream, @@ -28,8 +28,8 @@ oStream.on('data', function(data) { oStream.on('end', function() { const expect = 'process.stdout\r\n' + - 'process.stdin\r\n' + - 'process.stderr'; + 'process.stdin\r\n' + + 'process.stderr'; assert(new RegExp(expect).test(output)); }); diff --git a/test/parallel/test-readuint.js b/test/parallel/test-readuint.js index b984541bfe9eb0..154af1841a98cd 100644 --- a/test/parallel/test-readuint.js +++ b/test/parallel/test-readuint.js @@ -3,7 +3,7 @@ * A battery of tests to help us read a series of uints */ -var common = require('../common'); +require('../common'); var ASSERT = require('assert'); /* diff --git a/test/parallel/test-ref-unref-return.js b/test/parallel/test-ref-unref-return.js index a82a433ab1af05..89ac52d2bcaa50 100644 --- a/test/parallel/test-ref-unref-return.js +++ b/test/parallel/test-ref-unref-return.js @@ -1,8 +1,8 @@ 'use strict'; +require('../common'); var assert = require('assert'); var net = require('net'); var dgram = require('dgram'); -var common = require('../common'); assert.ok((new net.Server()).ref() instanceof net.Server); assert.ok((new net.Server()).unref() instanceof net.Server); diff --git a/test/sequential/test-regress-GH-1531.js b/test/parallel/test-regress-GH-1531.js similarity index 100% rename from test/sequential/test-regress-GH-1531.js rename to test/parallel/test-regress-GH-1531.js diff --git a/test/sequential/test-regress-GH-1899.js b/test/parallel/test-regress-GH-1899.js similarity index 99% rename from test/sequential/test-regress-GH-1899.js rename to test/parallel/test-regress-GH-1899.js index 98396aae13b8f9..3f9d936e632b0a 100644 --- a/test/sequential/test-regress-GH-1899.js +++ b/test/parallel/test-regress-GH-1899.js @@ -17,4 +17,3 @@ child.on('exit', function(code, signal) { assert.equal(code, 0); assert.equal(output, 'hello, world!\n'); }); - diff --git a/test/parallel/test-regress-GH-2245.js b/test/parallel/test-regress-GH-2245.js new file mode 100644 index 00000000000000..1ee26983ae336e --- /dev/null +++ b/test/parallel/test-regress-GH-2245.js @@ -0,0 +1,28 @@ +/* eslint-disable strict */ +require('../common'); +var assert = require('assert'); + +/* +In Node.js 0.10, a bug existed that caused strict functions to not capture +their environment when evaluated. When run in 0.10 `test()` fails with a +`ReferenceError`. See https://github.com/nodejs/node/issues/2245 for details. +*/ + +function test() { + + var code = [ + 'var foo = {m: 1};', + '', + 'function bar() {', + '\'use strict\';', + 'return foo; // foo isn\'t captured in 0.10', + '};' + ].join('\n'); + + eval(code); + + return bar(); // eslint-disable-line no-undef + +} + +assert.deepEqual(test(), {m: 1}); diff --git a/test/parallel/test-regress-GH-3238.js b/test/parallel/test-regress-GH-3238.js new file mode 100644 index 00000000000000..e6fe030bda9a10 --- /dev/null +++ b/test/parallel/test-regress-GH-3238.js @@ -0,0 +1,22 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const cluster = require('cluster'); + +if (cluster.isMaster) { + function forkWorker(action) { + const worker = cluster.fork({ action }); + worker.on('disconnect', common.mustCall(() => { + assert.strictEqual(worker.suicide, true); + })); + + worker.on('exit', common.mustCall(() => { + assert.strictEqual(worker.suicide, true); + })); + } + + forkWorker('disconnect'); + forkWorker('kill'); +} else { + cluster.worker[process.env.action](); +} diff --git a/test/sequential/test-regress-GH-3542.js b/test/parallel/test-regress-GH-3542.js similarity index 81% rename from test/sequential/test-regress-GH-3542.js rename to test/parallel/test-regress-GH-3542.js index 2025645ae75d92..77b8cdd69817ac 100644 --- a/test/sequential/test-regress-GH-3542.js +++ b/test/parallel/test-regress-GH-3542.js @@ -1,9 +1,9 @@ 'use strict'; -var common = require('../common'), - assert = require('assert'), - fs = require('fs'), - path = require('path'), - succeeded = 0; +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); +const path = require('path'); +let succeeded = 0; // This test is only relevant on Windows. if (!common.isWindows) { diff --git a/test/parallel/test-regress-GH-4256.js b/test/parallel/test-regress-GH-4256.js index 1a4a78b3c0781d..a312fb277fdad5 100644 --- a/test/parallel/test-regress-GH-4256.js +++ b/test/parallel/test-regress-GH-4256.js @@ -1,6 +1,6 @@ 'use strict'; require('../common'); process.domain = null; -var timer = setTimeout(function() { +setTimeout(function() { console.log('this console.log statement should not make node crash'); }, 1); diff --git a/test/sequential/test-regress-GH-4948.js b/test/parallel/test-regress-GH-4948.js similarity index 100% rename from test/sequential/test-regress-GH-4948.js rename to test/parallel/test-regress-GH-4948.js diff --git a/test/parallel/test-regress-GH-6235.js b/test/parallel/test-regress-GH-6235.js index 2f2f17d9698fc9..0bf9b8965d1184 100644 --- a/test/parallel/test-regress-GH-6235.js +++ b/test/parallel/test-regress-GH-6235.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); assert.doesNotThrow(function() { diff --git a/test/sequential/test-regress-GH-746.js b/test/parallel/test-regress-GH-746.js similarity index 99% rename from test/sequential/test-regress-GH-746.js rename to test/parallel/test-regress-GH-746.js index 4b79f3c4e355d1..0070be30f8329f 100644 --- a/test/sequential/test-regress-GH-746.js +++ b/test/parallel/test-regress-GH-746.js @@ -27,4 +27,3 @@ server.listen(common.PORT, function() { process.on('exit', function() { assert.ok(accepted); }); - diff --git a/test/parallel/test-regress-GH-7511.js b/test/parallel/test-regress-GH-7511.js index 0e5c4ded011a43..6194da291c7ae4 100644 --- a/test/parallel/test-regress-GH-7511.js +++ b/test/parallel/test-regress-GH-7511.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'), - assert = require('assert'), - vm = require('vm'); +require('../common'); +const assert = require('assert'); +const vm = require('vm'); assert.doesNotThrow(function() { var context = vm.createContext({ process: process }); diff --git a/test/parallel/test-regress-GH-819.js b/test/parallel/test-regress-GH-819.js new file mode 100644 index 00000000000000..20ca75c793ce24 --- /dev/null +++ b/test/parallel/test-regress-GH-819.js @@ -0,0 +1,7 @@ +'use strict'; +require('../common'); +var net = require('net'); + +// Connect to something that we need to DNS resolve +var c = net.createConnection(80, 'google.com'); +c.destroy(); diff --git a/test/parallel/test-regress-GH-897.js b/test/parallel/test-regress-GH-897.js index 4b7ba61f9ceca9..1b46994dc37d94 100644 --- a/test/parallel/test-regress-GH-897.js +++ b/test/parallel/test-regress-GH-897.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var t = Date.now(); diff --git a/test/parallel/test-repl-.save.load.js b/test/parallel/test-repl-.save.load.js index f63b61bf41e15b..6d28015b385e15 100644 --- a/test/parallel/test-repl-.save.load.js +++ b/test/parallel/test-repl-.save.load.js @@ -1,6 +1,5 @@ 'use strict'; var assert = require('assert'); -var util = require('util'); var join = require('path').join; var fs = require('fs'); var common = require('../common'); @@ -9,24 +8,9 @@ common.refreshTmpDir(); var repl = require('repl'); -// A stream to push an array into a REPL -function ArrayStream() { - this.run = function(data) { - var self = this; - data.forEach(function(line) { - self.emit('data', line + '\n'); - }); - }; -} -util.inherits(ArrayStream, require('stream').Stream); -ArrayStream.prototype.readable = true; -ArrayStream.prototype.writable = true; -ArrayStream.prototype.resume = function() {}; -ArrayStream.prototype.write = function() {}; - var works = [['inner.one'], 'inner.o']; -var putIn = new ArrayStream(); +const putIn = new common.ArrayStream(); var testMe = repl.start('', putIn); @@ -76,6 +60,14 @@ putIn.write = function(data) { }; putIn.run(['.load ' + loadFile]); +// throw error on loading directory +loadFile = common.tmpDir; +putIn.write = function(data) { + assert.equal(data, 'Failed to load:' + loadFile + ' is not a valid file\n'); + putIn.write = function() {}; +}; +putIn.run(['.load ' + loadFile]); + // clear the REPL putIn.run(['.clear']); diff --git a/test/parallel/test-repl-autolibs.js b/test/parallel/test-repl-autolibs.js index e37f2d036ece4d..15f779d3b12269 100644 --- a/test/parallel/test-repl-autolibs.js +++ b/test/parallel/test-repl-autolibs.js @@ -1,26 +1,14 @@ -/* eslint-disable required-modules */ 'use strict'; +const common = require('../common'); var assert = require('assert'); var util = require('util'); var repl = require('repl'); -// A stream to push an array into a REPL -function ArrayStream() { - this.run = function(data) { - var self = this; - data.forEach(function(line) { - self.emit('data', line + '\n'); - }); - }; -} -util.inherits(ArrayStream, require('stream').Stream); -ArrayStream.prototype.readable = true; -ArrayStream.prototype.writable = true; -ArrayStream.prototype.resume = function() {}; -ArrayStream.prototype.write = function() {}; +// This test adds global variables +common.globalCheck = false; -var putIn = new ArrayStream(); -var testMe = repl.start('', putIn, null, true); +const putIn = new common.ArrayStream(); +repl.start('', putIn, null, true); test1(); diff --git a/test/parallel/test-repl-console.js b/test/parallel/test-repl-console.js index e66fcb1621adc5..609822703fef1e 100644 --- a/test/parallel/test-repl-console.js +++ b/test/parallel/test-repl-console.js @@ -1,13 +1,10 @@ 'use strict'; -var common = require('../common'), - assert = require('assert'), - Stream = require('stream'), - repl = require('repl'); +const common = require('../common'); +const assert = require('assert'); +const repl = require('repl'); -// create a dummy stream that does nothing -var stream = new Stream(); -stream.write = stream.pause = stream.resume = function() {}; -stream.readable = stream.writable = true; +// Create a dummy stream that does nothing +const stream = new common.ArrayStream(); var r = repl.start({ input: stream, diff --git a/test/parallel/test-repl-definecommand.js b/test/parallel/test-repl-definecommand.js new file mode 100644 index 00000000000000..c0e1b3269a39d2 --- /dev/null +++ b/test/parallel/test-repl-definecommand.js @@ -0,0 +1,43 @@ +'use strict'; + +require('../common'); + +const stream = require('stream'); +const assert = require('assert'); +const repl = require('repl'); + +var output = ''; +const inputStream = new stream.PassThrough(); +const outputStream = new stream.PassThrough(); +outputStream.on('data', function(d) { + output += d; +}); + +const r = repl.start({ + input: inputStream, + output: outputStream, + terminal: true +}); + +r.defineCommand('say1', { + help: 'help for say1', + action: function(thing) { + output = ''; + this.write('hello ' + thing); + this.displayPrompt(); + } +}); + +r.defineCommand('say2', function() { + output = ''; + this.write('hello from say2'); + this.displayPrompt(); +}); + +inputStream.write('.help\n'); +assert(/\nsay1\thelp for say1\n/.test(output), 'help for say1 not present'); +assert(/\nsay2\t\n/.test(output), 'help for say2 not present'); +inputStream.write('.say1 node developer\n'); +assert(/> hello node developer/.test(output), 'say1 outputted incorrectly'); +inputStream.write('.say2 node developer\n'); +assert(/> hello from say2/.test(output), 'say2 outputted incorrectly'); diff --git a/test/parallel/test-repl-domain.js b/test/parallel/test-repl-domain.js index 7528f502878f63..adc8478beef4af 100644 --- a/test/parallel/test-repl-domain.js +++ b/test/parallel/test-repl-domain.js @@ -1,27 +1,10 @@ 'use strict'; -var assert = require('assert'); var common = require('../common'); -var util = require('util'); var repl = require('repl'); -// A stream to push an array into a REPL -function ArrayStream() { - this.run = function(data) { - var self = this; - data.forEach(function(line) { - self.emit('data', line + '\n'); - }); - }; -} -util.inherits(ArrayStream, require('stream').Stream); -ArrayStream.prototype.readable = true; -ArrayStream.prototype.writable = true; -ArrayStream.prototype.resume = function() {}; -ArrayStream.prototype.write = function() {}; - -var putIn = new ArrayStream(); -var testMe = repl.start('', putIn); +const putIn = new common.ArrayStream(); +repl.start('', putIn); putIn.write = function(data) { // Don't use assert for this because the domain might catch it, and diff --git a/test/parallel/test-repl-end-emits-exit.js b/test/parallel/test-repl-end-emits-exit.js index e4bc4da78c142d..7f2c4b9eb2893f 100644 --- a/test/parallel/test-repl-end-emits-exit.js +++ b/test/parallel/test-repl-end-emits-exit.js @@ -1,15 +1,12 @@ 'use strict'; -var common = require('../common'), - assert = require('assert'), - Stream = require('stream'), - repl = require('repl'), - terminalExit = 0, - regularExit = 0; - -// create a dummy stream that does nothing -var stream = new Stream(); -stream.write = stream.pause = stream.resume = function() {}; -stream.readable = stream.writable = true; +const common = require('../common'); +const assert = require('assert'); +const repl = require('repl'); +let terminalExit = 0; +let regularExit = 0; + +// Create a dummy stream that does nothing +const stream = new common.ArrayStream(); function testTerminalMode() { var r1 = repl.start({ diff --git a/test/parallel/test-repl-envvars.js b/test/parallel/test-repl-envvars.js index 6073144085843d..759b4e15a12f46 100644 --- a/test/parallel/test-repl-envvars.js +++ b/test/parallel/test-repl-envvars.js @@ -2,36 +2,38 @@ // Flags: --expose-internals -const common = require('../common'); +require('../common'); const stream = require('stream'); const REPL = require('internal/repl'); const assert = require('assert'); const inspect = require('util').inspect; -const tests = [{ - env: {}, - expected: { terminal: true, useColors: true } -}, -{ - env: { NODE_DISABLE_COLORS: '1' }, - expected: { terminal: true, useColors: false } -}, -{ - env: { NODE_NO_READLINE: '1' }, - expected: { terminal: false, useColors: false } -}, -{ - env: { TERM: 'dumb' }, - expected: { terminal: true, useColors: false } -}, -{ - env: { NODE_NO_READLINE: '1', NODE_DISABLE_COLORS: '1' }, - expected: { terminal: false, useColors: false } -}, -{ - env: { NODE_NO_READLINE: '0' }, - expected: { terminal: true, useColors: true } -}]; +const tests = [ + { + env: {}, + expected: { terminal: true, useColors: true } + }, + { + env: { NODE_DISABLE_COLORS: '1' }, + expected: { terminal: true, useColors: false } + }, + { + env: { NODE_NO_READLINE: '1' }, + expected: { terminal: false, useColors: false } + }, + { + env: { TERM: 'dumb' }, + expected: { terminal: true, useColors: false } + }, + { + env: { NODE_NO_READLINE: '1', NODE_DISABLE_COLORS: '1' }, + expected: { terminal: false, useColors: false } + }, + { + env: { NODE_NO_READLINE: '0' }, + expected: { terminal: true, useColors: true } + } +]; function run(test) { const env = test.env; diff --git a/test/parallel/test-repl-eval-scope.js b/test/parallel/test-repl-eval-scope.js new file mode 100644 index 00000000000000..b9bace5f7d982a --- /dev/null +++ b/test/parallel/test-repl-eval-scope.js @@ -0,0 +1,23 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const repl = require('repl'); + +{ + const stream = new common.ArrayStream(); + const options = { + eval: common.mustCall((cmd, context) => { + assert.strictEqual(cmd, '.scope\n'); + assert.deepStrictEqual(context, {animal: 'Sterrance'}); + }), + input: stream, + output: stream, + terminal: true + }; + + const r = repl.start(options); + r.context = {animal: 'Sterrance'}; + + stream.emit('data', '\t'); + stream.emit('.exit\n'); +} diff --git a/test/parallel/test-repl-eval.js b/test/parallel/test-repl-eval.js new file mode 100644 index 00000000000000..7e5c7d39946c67 --- /dev/null +++ b/test/parallel/test-repl-eval.js @@ -0,0 +1,29 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const repl = require('repl'); + +{ + let evalCalledWithExpectedArgs = false; + + const options = { + eval: common.mustCall((cmd, context) => { + // Assertions here will not cause the test to exit with an error code + // so set a boolean that is checked in process.on('exit',...) instead. + evalCalledWithExpectedArgs = (cmd === 'foo\n' && context.foo === 'bar'); + }) + }; + + const r = repl.start(options); + r.context = {foo: 'bar'}; + + try { + r.write('foo\n'); + } finally { + r.write('.exit\n'); + } + + process.on('exit', () => { + assert(evalCalledWithExpectedArgs); + }); +} diff --git a/test/parallel/test-repl-harmony.js b/test/parallel/test-repl-harmony.js index 6bc5cb57aa1187..a5928800381cfe 100644 --- a/test/parallel/test-repl-harmony.js +++ b/test/parallel/test-repl-harmony.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; diff --git a/test/parallel/test-repl-null.js b/test/parallel/test-repl-null.js new file mode 100644 index 00000000000000..337e194447d1f8 --- /dev/null +++ b/test/parallel/test-repl-null.js @@ -0,0 +1,17 @@ +'use strict'; +require('../common'); +const repl = require('repl'); +const assert = require('assert'); + +var replserver = new repl.REPLServer(); + +replserver._inTemplateLiteral = true; + +// `null` gets treated like an empty string. (Should it? You have to do some +// strange business to get it into the REPL. Maybe it should really throw?) + +assert.doesNotThrow(() => { + replserver.emit('line', null); +}); + +replserver.emit('line', '.exit'); diff --git a/test/parallel/test-repl-options.js b/test/parallel/test-repl-options.js index 5bc37d2d7117f3..70244802dd0f45 100644 --- a/test/parallel/test-repl-options.js +++ b/test/parallel/test-repl-options.js @@ -1,15 +1,12 @@ 'use strict'; -var common = require('../common'), - assert = require('assert'), - Stream = require('stream'), - repl = require('repl'); +const common = require('../common'); +const assert = require('assert'); +const repl = require('repl'); common.globalCheck = false; -// create a dummy stream that does nothing -var stream = new Stream(); -stream.write = stream.pause = stream.resume = function() {}; -stream.readable = stream.writable = true; +// Create a dummy stream that does nothing +const stream = new common.ArrayStream(); // 1, mostly defaults var r1 = repl.start({ @@ -80,3 +77,17 @@ var r3 = repl.start({ assert.equal(r3.replMode, repl.REPL_MODE_MAGIC); assert.equal(r3.historySize, 50); + +// Verify that defaults are used when no arguments are provided +const r4 = repl.start(); + +assert.strictEqual(r4._prompt, '> '); +assert.strictEqual(r4.input, process.stdin); +assert.strictEqual(r4.output, process.stdout); +assert.strictEqual(r4.terminal, !!r4.output.isTTY); +assert.strictEqual(r4.useColors, r4.terminal); +assert.strictEqual(r4.useGlobal, false); +assert.strictEqual(r4.ignoreUndefined, false); +assert.strictEqual(r4.replMode, repl.REPL_MODE_SLOPPY); +assert.strictEqual(r4.historySize, 30); +r4.close(); diff --git a/test/parallel/test-repl-persistent-history.js b/test/parallel/test-repl-persistent-history.js new file mode 100644 index 00000000000000..e8b6d416f00ec4 --- /dev/null +++ b/test/parallel/test-repl-persistent-history.js @@ -0,0 +1,290 @@ +'use strict'; + +// Flags: --expose-internals + +const common = require('../common'); +const stream = require('stream'); +const REPL = require('internal/repl'); +const assert = require('assert'); +const fs = require('fs'); +const path = require('path'); +const os = require('os'); + +common.refreshTmpDir(); + +// Mock os.homedir() +os.homedir = function() { + return common.tmpDir; +}; + +// Create an input stream specialized for testing an array of actions +class ActionStream extends stream.Stream { + run(data) { + const _iter = data[Symbol.iterator](); + const self = this; + + function doAction() { + const next = _iter.next(); + if (next.done) { + // Close the repl. Note that it must have a clean prompt to do so. + setImmediate(function() { + self.emit('keypress', '', { ctrl: true, name: 'd' }); + }); + return; + } + const action = next.value; + + if (typeof action === 'object') { + self.emit('keypress', '', action); + } else { + self.emit('data', action + '\n'); + } + setImmediate(doAction); + } + setImmediate(doAction); + } + resume() {} + pause() {} +} +ActionStream.prototype.readable = true; + + +// Mock keys +const UP = { name: 'up' }; +const ENTER = { name: 'enter' }; +const CLEAR = { ctrl: true, name: 'u' }; +// Common message bits +const prompt = '> '; +const replDisabled = '\nPersistent history support disabled. Set the ' + + 'NODE_REPL_HISTORY environment\nvariable to a valid, ' + + 'user-writable path to enable.\n'; +const convertMsg = '\nConverting old JSON repl history to line-separated ' + + 'history.\nThe new repl history file can be found at ' + + path.join(common.tmpDir, '.node_repl_history') + '.\n'; +const homedirErr = '\nError: Could not get the home directory.\n' + + 'REPL session history will not be persisted.\n'; +const replFailedRead = '\nError: Could not open history file.\n' + + 'REPL session history will not be persisted.\n'; +const sameHistoryFilePaths = '\nThe old repl history file has the same name ' + + 'and location as the new one i.e., ' + + path.join(common.tmpDir, '.node_repl_history') + + ' and is empty.\nUsing it as is.\n'; +// File paths +const fixtures = path.join(common.testDir, 'fixtures'); +const historyFixturePath = path.join(fixtures, '.node_repl_history'); +const historyPath = path.join(common.tmpDir, '.fixture_copy_repl_history'); +const historyPathFail = path.join(common.tmpDir, '.node_repl\u0000_history'); +const oldHistoryPath = path.join(fixtures, 'old-repl-history-file.json'); +const enoentHistoryPath = path.join(fixtures, 'enoent-repl-history-file.json'); +const emptyHistoryPath = path.join(fixtures, '.empty-repl-history-file'); +const defaultHistoryPath = path.join(common.tmpDir, '.node_repl_history'); + +const tests = [ + { + env: { NODE_REPL_HISTORY: '' }, + test: [UP], + expected: [prompt, replDisabled, prompt] + }, + { + env: { NODE_REPL_HISTORY: ' ' }, + test: [UP], + expected: [prompt, replDisabled, prompt] + }, + { + env: { NODE_REPL_HISTORY: '', + NODE_REPL_HISTORY_FILE: enoentHistoryPath }, + test: [UP], + expected: [prompt, replDisabled, prompt] + }, + { + env: { NODE_REPL_HISTORY: '', + NODE_REPL_HISTORY_FILE: oldHistoryPath }, + test: [UP], + expected: [prompt, replDisabled, prompt] + }, + { + env: { NODE_REPL_HISTORY_FILE: emptyHistoryPath }, + test: [UP], + expected: [prompt, convertMsg, prompt] + }, + { + env: { NODE_REPL_HISTORY_FILE: defaultHistoryPath }, + test: [UP], + expected: [prompt, sameHistoryFilePaths, prompt] + }, + { + env: { NODE_REPL_HISTORY: historyPath }, + test: [UP, CLEAR], + expected: [prompt, prompt + '\'you look fabulous today\'', prompt] + }, + { + env: { NODE_REPL_HISTORY: historyPath, + NODE_REPL_HISTORY_FILE: oldHistoryPath }, + test: [UP, CLEAR], + expected: [prompt, prompt + '\'you look fabulous today\'', prompt] + }, + { + env: { NODE_REPL_HISTORY: historyPath, + NODE_REPL_HISTORY_FILE: '' }, + test: [UP, CLEAR], + expected: [prompt, prompt + '\'you look fabulous today\'', prompt] + }, + { + env: {}, + test: [UP], + expected: [prompt] + }, + { + env: { NODE_REPL_HISTORY_FILE: oldHistoryPath }, + test: [UP, CLEAR, '\'42\'', ENTER], + expected: [prompt, convertMsg, prompt, prompt + '\'=^.^=\'', prompt, '\'', + '4', '2', '\'', '\'42\'\n', prompt, prompt], + after: function ensureHistoryFixture() { + // XXX(Fishrock123) Make sure nothing weird happened to our fixture + // or it's temporary copy. + // Sometimes this test used to erase the fixture and I'm not sure why. + const history = fs.readFileSync(historyFixturePath, 'utf8'); + assert.strictEqual(history, + '\'you look fabulous today\'\n\'Stay Fresh~\'\n'); + const historyCopy = fs.readFileSync(historyPath, 'utf8'); + assert.strictEqual(historyCopy, '\'you look fabulous today\'' + os.EOL + + '\'Stay Fresh~\'' + os.EOL); + } + }, + { // Requires the above testcase + env: {}, + test: [UP, UP, ENTER], + expected: [prompt, prompt + '\'42\'', prompt + '\'=^.^=\'', '\'=^.^=\'\n', + prompt] + }, + { + env: { NODE_REPL_HISTORY: historyPath, + NODE_REPL_HISTORY_SIZE: 1 }, + test: [UP, UP, CLEAR], + expected: [prompt, prompt + '\'you look fabulous today\'', prompt] + }, + { + env: { NODE_REPL_HISTORY_FILE: oldHistoryPath, + NODE_REPL_HISTORY_SIZE: 1 }, + test: [UP, UP, UP, CLEAR], + expected: [prompt, convertMsg, prompt, prompt + '\'=^.^=\'', prompt] + }, + { + env: { NODE_REPL_HISTORY: historyPathFail, + NODE_REPL_HISTORY_SIZE: 1 }, + test: [UP], + expected: [prompt, replFailedRead, prompt, replDisabled, prompt] + }, + { // Make sure this is always the last test, since we change os.homedir() + before: function mockHomedirFailure() { + // Mock os.homedir() failure + os.homedir = function() { + throw new Error('os.homedir() failure'); + }; + }, + env: {}, + test: [UP], + expected: [prompt, homedirErr, prompt, replDisabled, prompt] + } +]; +const numtests = tests.length; + + +var testsNotRan = tests.length; + +process.on('beforeExit', () => + assert.strictEqual(testsNotRan, 0) +); + +function cleanupTmpFile() { + try { + // Write over the file, clearing any history + fs.writeFileSync(defaultHistoryPath, ''); + } catch (err) { + if (err.code === 'ENOENT') return true; + throw err; + } + return true; +} + +// Copy our fixture to the tmp directory +fs.createReadStream(historyFixturePath) + .pipe(fs.createWriteStream(historyPath)).on('unpipe', () => runTest()); + +function runTest(assertCleaned) { + const opts = tests.shift(); + if (!opts) return; // All done + + if (assertCleaned) { + try { + assert.strictEqual(fs.readFileSync(defaultHistoryPath, 'utf8'), ''); + } catch (e) { + if (e.code !== 'ENOENT') { + console.error(`Failed test # ${numtests - tests.length}`); + throw e; + } + } + } + + const env = opts.env; + const test = opts.test; + const expected = opts.expected; + const after = opts.after; + const before = opts.before; + + if (before) before(); + + REPL.createInternalRepl(env, { + input: new ActionStream(), + output: new stream.Writable({ + write(chunk, _, next) { + const output = chunk.toString(); + + // Ignore escapes and blank lines + if (output.charCodeAt(0) === 27 || /^[\r\n]+$/.test(output)) + return next(); + + try { + assert.strictEqual(output, expected.shift()); + } catch (err) { + console.error(`Failed test # ${numtests - tests.length}`); + throw err; + } + next(); + } + }), + prompt: prompt, + useColors: false, + terminal: true + }, function(err, repl) { + if (err) { + console.error(`Failed test # ${numtests - tests.length}`); + throw err; + } + + repl.once('close', () => { + if (repl._flushing) { + repl.once('flushHistory', onClose); + return; + } + + onClose(); + }); + + function onClose() { + const cleaned = after ? after() : cleanupTmpFile(); + + try { + // Ensure everything that we expected was output + assert.strictEqual(expected.length, 0); + testsNotRan--; + setImmediate(runTest, cleaned); + } catch (err) { + console.error(`Failed test # ${numtests - tests.length}`); + throw err; + } + } + + repl.inputStream.run(test); + }); +} diff --git a/test/parallel/test-repl-require-cache.js b/test/parallel/test-repl-require-cache.js index d9b4d71d484640..8a5d384935efd4 100644 --- a/test/parallel/test-repl-require-cache.js +++ b/test/parallel/test-repl-require-cache.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'), - assert = require('assert'), - repl = require('repl'); +require('../common'); +const assert = require('assert'); +const repl = require('repl'); // https://github.com/joyent/node/issues/3226 diff --git a/test/parallel/test-repl-require.js b/test/parallel/test-repl-require.js new file mode 100644 index 00000000000000..c964951c2cacd8 --- /dev/null +++ b/test/parallel/test-repl-require.js @@ -0,0 +1,33 @@ +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +process.chdir(common.fixturesDir); +const repl = require('repl'); + +const server = net.createServer((conn) => { + repl.start('', conn).on('exit', () => { + conn.destroy(); + server.close(); + }); +}); + +const host = common.localhostIPv4; +const port = common.PORT; +const options = { host, port }; + +var answer = ''; +server.listen(options, function() { + const conn = net.connect(options); + conn.setEncoding('utf8'); + conn.on('data', (data) => answer += data); + conn.write('require("baz")\n.exit\n'); +}); + +process.on('exit', function() { + assert.strictEqual(false, /Cannot find module/.test(answer)); + assert.strictEqual(false, /Error/.test(answer)); + assert.strictEqual(true, /eye catcher/.test(answer)); +}); diff --git a/test/parallel/test-repl-reset-event.js b/test/parallel/test-repl-reset-event.js index e6d4eed1385b10..0bd43dcd6c370e 100644 --- a/test/parallel/test-repl-reset-event.js +++ b/test/parallel/test-repl-reset-event.js @@ -4,12 +4,9 @@ common.globalCheck = false; var assert = require('assert'); var repl = require('repl'); -var Stream = require('stream'); -// create a dummy stream that does nothing -var dummy = new Stream(); -dummy.write = dummy.pause = dummy.resume = function() {}; -dummy.readable = dummy.writable = true; +// Create a dummy stream that does nothing +const dummy = new common.ArrayStream(); function testReset(cb) { var r = repl.start({ diff --git a/test/parallel/test-repl-setprompt.js b/test/parallel/test-repl-setprompt.js index f2c65583b3656b..2708a3e6af5448 100644 --- a/test/parallel/test-repl-setprompt.js +++ b/test/parallel/test-repl-setprompt.js @@ -1,5 +1,5 @@ 'use strict'; -const common = require('../common'); +require('../common'); const assert = require('assert'); const spawn = require('child_process').spawn; const os = require('os'); diff --git a/test/parallel/test-repl-syntax-error-handling.js b/test/parallel/test-repl-syntax-error-handling.js index 66e8fb6b352c56..10166b4f06a692 100644 --- a/test/parallel/test-repl-syntax-error-handling.js +++ b/test/parallel/test-repl-syntax-error-handling.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); switch (process.argv[2]) { diff --git a/test/parallel/test-repl-syntax-error-stack.js b/test/parallel/test-repl-syntax-error-stack.js new file mode 100644 index 00000000000000..ebf0b2e4d8aed1 --- /dev/null +++ b/test/parallel/test-repl-syntax-error-stack.js @@ -0,0 +1,26 @@ +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const path = require('path'); +const repl = require('repl'); +let found = false; + +process.on('exit', () => { + assert.strictEqual(found, true); +}); + +common.ArrayStream.prototype.write = function(output) { + if (/var foo bar;/.test(output)) + found = true; +}; + +const putIn = new common.ArrayStream(); +repl.start('', putIn); +let file = path.resolve(__dirname, '../fixtures/syntax/bad_syntax'); + +if (common.isWindows) + file = file.replace(/\\/g, '\\\\'); + +putIn.run(['.clear']); +putIn.run([`require('${file}');`]); diff --git a/test/parallel/test-repl-tab-complete-crash.js b/test/parallel/test-repl-tab-complete-crash.js new file mode 100644 index 00000000000000..ce283757438192 --- /dev/null +++ b/test/parallel/test-repl-tab-complete-crash.js @@ -0,0 +1,27 @@ +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const repl = require('repl'); + +var referenceErrorCount = 0; + +common.ArrayStream.prototype.write = function(msg) { + if (msg.startsWith('ReferenceError: ')) { + referenceErrorCount++; + } +}; + +const putIn = new common.ArrayStream(); +const testMe = repl.start('', putIn); + +// https://github.com/nodejs/node/issues/3346 +// Tab-completion for an undefined variable inside a function should report a +// ReferenceError. +putIn.run(['.clear']); +putIn.run(['function () {']); +testMe.complete('arguments.'); + +process.on('exit', function() { + assert.strictEqual(referenceErrorCount, 1); +}); diff --git a/test/parallel/test-repl-tab-complete.js b/test/parallel/test-repl-tab-complete.js index 1cb6e7791d3c2b..551e7b6fa72b88 100644 --- a/test/parallel/test-repl-tab-complete.js +++ b/test/parallel/test-repl-tab-complete.js @@ -4,7 +4,6 @@ var common = require('../common'); var assert = require('assert'); -var util = require('util'); var repl = require('repl'); var referenceErrors = 0; var expectedReferenceErrors = 0; @@ -20,23 +19,8 @@ process.on('exit', function() { assert.strictEqual(referenceErrors, expectedReferenceErrors); }); -// A stream to push an array into a REPL -function ArrayStream() { - this.run = function(data) { - var self = this; - data.forEach(function(line) { - self.emit('data', line + '\n'); - }); - }; -} -util.inherits(ArrayStream, require('stream').Stream); -ArrayStream.prototype.readable = true; -ArrayStream.prototype.writable = true; -ArrayStream.prototype.resume = function() {}; -ArrayStream.prototype.write = function() {}; - var works = [['inner.one'], 'inner.o']; -var putIn = new ArrayStream(); +const putIn = new common.ArrayStream(); var testMe = repl.start('', putIn); // Some errors are passed to the domain, but do not callback @@ -194,7 +178,7 @@ var spaceTimeout = setTimeout(function() { }, 1000); testMe.complete(' ', common.mustCall(function(error, data) { - assert.deepEqual(data, [[], undefined]); + assert.deepStrictEqual(data, [[], undefined]); clearTimeout(spaceTimeout); })); @@ -246,79 +230,32 @@ putIn.run([ testMe.complete('proxy.', common.mustCall(function(error, data) { assert.strictEqual(error, null); - assert.deepEqual(data, [[], 'proxy.']); })); // Make sure tab completion does not include integer members of an Array -var array_elements = [ [ - 'ary.__defineGetter__', - 'ary.__defineSetter__', - 'ary.__lookupGetter__', - 'ary.__lookupSetter__', - 'ary.__proto__', - 'ary.constructor', - 'ary.hasOwnProperty', - 'ary.isPrototypeOf', - 'ary.propertyIsEnumerable', - 'ary.toLocaleString', - 'ary.toString', - 'ary.valueOf', - '', - 'ary.concat', - 'ary.copyWithin', - 'ary.entries', - 'ary.every', - 'ary.fill', - 'ary.filter', - 'ary.find', - 'ary.findIndex', - 'ary.forEach', - 'ary.indexOf', - 'ary.join', - 'ary.keys', - 'ary.lastIndexOf', - 'ary.length', - 'ary.map', - 'ary.pop', - 'ary.push', - 'ary.reduce', - 'ary.reduceRight', - 'ary.reverse', - 'ary.shift', - 'ary.slice', - 'ary.some', - 'ary.sort', - 'ary.splice', - 'ary.unshift' ], - 'ary.']; - putIn.run(['.clear']); putIn.run(['var ary = [1,2,3];']); testMe.complete('ary.', common.mustCall(function(error, data) { - assert.deepEqual(data, array_elements); + assert.strictEqual(data[0].indexOf('ary.0'), -1); + assert.strictEqual(data[0].indexOf('ary.1'), -1); + assert.strictEqual(data[0].indexOf('ary.2'), -1); })); // Make sure tab completion does not include integer keys in an object -var obj_elements = [ [ - 'obj.__defineGetter__', - 'obj.__defineSetter__', - 'obj.__lookupGetter__', - 'obj.__lookupSetter__', - 'obj.__proto__', - 'obj.constructor', - 'obj.hasOwnProperty', - 'obj.isPrototypeOf', - 'obj.propertyIsEnumerable', - 'obj.toLocaleString', - 'obj.toString', - 'obj.valueOf', - '', - 'obj.a' ], - 'obj.' ]; putIn.run(['.clear']); putIn.run(['var obj = {1:"a","1a":"b",a:"b"};']); testMe.complete('obj.', common.mustCall(function(error, data) { - assert.deepEqual(data, obj_elements); + assert.strictEqual(data[0].indexOf('obj.1'), -1); + assert.strictEqual(data[0].indexOf('obj.1a'), -1); + assert.notStrictEqual(data[0].indexOf('obj.a'), -1); +})); + +// Don't try to complete results of non-simple expressions +putIn.run(['.clear']); +putIn.run(['function a() {}']); + +testMe.complete('a().b.', common.mustCall((error, data) => { + assert.deepStrictEqual(data, [[], undefined]); })); diff --git a/test/parallel/test-repl-tab.js b/test/parallel/test-repl-tab.js index 1ab3b4743913bd..6474d8e4088167 100644 --- a/test/parallel/test-repl-tab.js +++ b/test/parallel/test-repl-tab.js @@ -1,7 +1,6 @@ 'use strict'; require('../common'); var assert = require('assert'); -var util = require('util'); var repl = require('repl'); var zlib = require('zlib'); diff --git a/test/parallel/test-repl-unexpected-token-recoverable.js b/test/parallel/test-repl-unexpected-token-recoverable.js index 4cfaa5136b6a55..84668c8657c453 100644 --- a/test/parallel/test-repl-unexpected-token-recoverable.js +++ b/test/parallel/test-repl-unexpected-token-recoverable.js @@ -2,7 +2,7 @@ /* * This is a regression test for https://github.com/joyent/node/issues/8874. */ -var common = require('../common'); +require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; diff --git a/test/parallel/test-repl.js b/test/parallel/test-repl.js index 43e144d87ce441..02ce8169caf3fe 100644 --- a/test/parallel/test-repl.js +++ b/test/parallel/test-repl.js @@ -5,17 +5,17 @@ var assert = require('assert'); common.globalCheck = false; common.refreshTmpDir(); -var net = require('net'), - repl = require('repl'), - message = 'Read, Eval, Print Loop', - prompt_unix = 'node via Unix socket> ', - prompt_tcp = 'node via TCP socket> ', - prompt_multiline = '... ', - prompt_npm = 'npm should be run outside of the ' + - 'node repl, in your normal shell.\n' + - '(Press Control-D to exit.)\n', - expect_npm = prompt_npm + prompt_unix, - server_tcp, server_unix, client_tcp, client_unix, timer; +const net = require('net'); +const repl = require('repl'); +const message = 'Read, Eval, Print Loop'; +const prompt_unix = 'node via Unix socket> '; +const prompt_tcp = 'node via TCP socket> '; +const prompt_multiline = '... '; +const prompt_npm = 'npm should be run outside of the ' + + 'node repl, in your normal shell.\n' + + '(Press Control-D to exit.)\n'; +const expect_npm = prompt_npm + prompt_unix; +var server_tcp, server_unix, client_tcp, client_unix, replServer; // absolute path to test/fixtures/a.js @@ -24,7 +24,7 @@ var moduleFilename = require('path').join(common.fixturesDir, 'a'); console.error('repl test'); // function for REPL to run -invoke_me = function(arg) { +global.invoke_me = function(arg) { return 'invoked ' + arg; }; @@ -45,12 +45,19 @@ function send_expect(list) { function clean_up() { client_tcp.end(); client_unix.end(); - clearTimeout(timer); +} + +function strict_mode_error_test() { + send_expect([ + { client: client_unix, send: 'ref = 1', + expect: /^ReferenceError:\sref\sis\snot\sdefined\n\s+at\srepl:1:5/ }, + ]); } function error_test() { // The other stuff is done so reuse unix socket var read_buffer = ''; + var run_strict_test = true; client_unix.removeAllListeners('data'); client_unix.on('data', function(data) { @@ -72,6 +79,10 @@ function error_test() { read_buffer = ''; if (client_unix.list && client_unix.list.length > 0) { send_expect(client_unix.list); + } else if (run_strict_test) { + replServer.replMode = repl.REPL_MODE_STRICT; + run_strict_test = false; + strict_mode_error_test(); } else { console.error('End of Error test, running TCP test.'); tcp_test(); @@ -83,6 +94,10 @@ function error_test() { read_buffer = ''; if (client_unix.list && client_unix.list.length > 0) { send_expect(client_unix.list); + } else if (run_strict_test) { + replServer.replMode = repl.REPL_MODE_STRICT; + run_strict_test = false; + strict_mode_error_test(); } else { console.error('End of Error test, running TCP test.\n'); tcp_test(); @@ -117,6 +132,11 @@ function error_test() { expect: prompt_multiline }, { client: client_unix, send: '+ ".2"}`', expect: `'io.js 1.0.2'\n${prompt_unix}` }, + // Dot prefix in multiline commands aren't treated as commands + { client: client_unix, send: '("a"', + expect: prompt_multiline }, + { client: client_unix, send: '.charAt(0))', + expect: `'a'\n${prompt_unix}` }, // Floating point numbers are not interpreted as REPL commands. { client: client_unix, send: '.1234', expect: '0.1234' }, @@ -180,6 +200,13 @@ function error_test() { expect: prompt_multiline }, { client: client_unix, send: '})()', expect: '1' }, + // Multiline function call + { client: client_unix, send: 'function f(){}; f(f(1,', + expect: prompt_multiline }, + { client: client_unix, send: '2)', + expect: prompt_multiline }, + { client: client_unix, send: ')', + expect: 'undefined\n' + prompt_unix }, // npm prompt error message { client: client_unix, send: 'npm install foobar', expect: expect_npm }, @@ -250,6 +277,53 @@ function error_test() { { client: client_unix, send: 'function x() {\nreturn \'\\\\\';\n }', expect: prompt_multiline + prompt_multiline + 'undefined\n' + prompt_unix }, + // regression tests for https://github.com/nodejs/node/issues/3421 + { client: client_unix, send: 'function x() {\n//\'\n }', + expect: prompt_multiline + prompt_multiline + + 'undefined\n' + prompt_unix }, + { client: client_unix, send: 'function x() {\n//"\n }', + expect: prompt_multiline + prompt_multiline + + 'undefined\n' + prompt_unix }, + { client: client_unix, send: 'function x() {//\'\n }', + expect: prompt_multiline + 'undefined\n' + prompt_unix }, + { client: client_unix, send: 'function x() {//"\n }', + expect: prompt_multiline + 'undefined\n' + prompt_unix }, + { client: client_unix, send: 'function x() {\nvar i = "\'";\n }', + expect: prompt_multiline + prompt_multiline + + 'undefined\n' + prompt_unix }, + { client: client_unix, send: 'function x(/*optional*/) {}', + expect: 'undefined\n' + prompt_unix }, + { client: client_unix, send: 'function x(/* // 5 */) {}', + expect: 'undefined\n' + prompt_unix }, + { client: client_unix, send: '// /* 5 */', + expect: 'undefined\n' + prompt_unix }, + { client: client_unix, send: '"//"', + expect: '\'//\'\n' + prompt_unix }, + { client: client_unix, send: '"data /*with*/ comment"', + expect: '\'data /*with*/ comment\'\n' + prompt_unix }, + { client: client_unix, send: 'function x(/*fn\'s optional params*/) {}', + expect: 'undefined\n' + prompt_unix }, + { client: client_unix, send: '/* \'\n"\n\'"\'\n*/', + expect: 'undefined\n' + prompt_unix }, + // REPL should get a normal require() function, not one that allows + // access to internal modules without the --expose_internals flag. + { client: client_unix, send: 'require("internal/repl")', + expect: /^Error: Cannot find module 'internal\/repl'/ }, + // REPL should handle quotes within regexp literal in multiline mode + { client: client_unix, send: "function x(s) {\nreturn s.replace(/'/,'');\n}", + expect: prompt_multiline + prompt_multiline + + 'undefined\n' + prompt_unix }, + { client: client_unix, send: "function x(s) {\nreturn s.replace(/\'/,'');\n}", + expect: prompt_multiline + prompt_multiline + + 'undefined\n' + prompt_unix }, + { client: client_unix, send: 'function x(s) {\nreturn s.replace(/"/,"");\n}', + expect: prompt_multiline + prompt_multiline + + 'undefined\n' + prompt_unix }, + { client: client_unix, send: 'function x(s) {\nreturn s.replace(/.*/,"");\n}', + expect: prompt_multiline + prompt_multiline + + 'undefined\n' + prompt_unix }, + { client: client_unix, send: '{ var x = 4; }', + expect: 'undefined\n' + prompt_unix }, ]); } @@ -324,12 +398,13 @@ function unix_test() { socket.end(); }); - repl.start({ + replServer = repl.start({ prompt: prompt_unix, input: socket, output: socket, useGlobal: true - }).context.message = message; + }); + replServer.context.message = message; }); server_unix.on('listening', function() { @@ -387,7 +462,3 @@ function unix_test() { } unix_test(); - -timer = setTimeout(function() { - assert.fail(null, null, 'Timeout'); -}, 5000); diff --git a/test/parallel/test-require-cache.js b/test/parallel/test-require-cache.js index f2245345e3e4bd..7ea68dd0515799 100644 --- a/test/parallel/test-require-cache.js +++ b/test/parallel/test-require-cache.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); (function testInjectFakeModule() { diff --git a/test/parallel/test-require-extensions-main.js b/test/parallel/test-require-extensions-main.js index 198fa6a8c52d37..0376082262dd78 100644 --- a/test/parallel/test-require-extensions-main.js +++ b/test/parallel/test-require-extensions-main.js @@ -1,5 +1,4 @@ 'use strict'; var common = require('../common'); -var assert = require('assert'); require(common.fixturesDir + '/require-bin/bin/req.js'); diff --git a/test/parallel/test-require-long-path.js b/test/parallel/test-require-long-path.js index 1f7e28cba2960c..c30a76a5a9e099 100644 --- a/test/parallel/test-require-long-path.js +++ b/test/parallel/test-require-long-path.js @@ -3,6 +3,11 @@ const common = require('../common'); const fs = require('fs'); const path = require('path'); +if (!common.isWindows) { + console.log('1..0 # Skipped: this test is Windows-specific.'); + return; +} + // make a path that is more than 260 chars long. const dirNameLen = Math.max(260 - common.tmpDir.length, 1); const dirName = path.join(common.tmpDir, 'x'.repeat(dirNameLen)); diff --git a/test/sequential/test-setproctitle.js b/test/parallel/test-setproctitle.js similarity index 96% rename from test/sequential/test-setproctitle.js rename to test/parallel/test-setproctitle.js index 11395f4fdbc52f..40107f5774962f 100644 --- a/test/sequential/test-setproctitle.js +++ b/test/parallel/test-setproctitle.js @@ -7,7 +7,7 @@ if ('linux freebsd darwin'.indexOf(process.platform) === -1) { return; } -var common = require('../common'); +require('../common'); var assert = require('assert'); var exec = require('child_process').exec; var path = require('path'); diff --git a/test/sequential/test-sigint-infinite-loop.js b/test/parallel/test-sigint-infinite-loop.js similarity index 96% rename from test/sequential/test-sigint-infinite-loop.js rename to test/parallel/test-sigint-infinite-loop.js index 8211aeb69ec5db..a284367e563b26 100644 --- a/test/sequential/test-sigint-infinite-loop.js +++ b/test/parallel/test-sigint-infinite-loop.js @@ -2,7 +2,7 @@ // This test is to assert that we can SIGINT a script which loops forever. // Ref(http): // groups.google.com/group/nodejs-dev/browse_thread/thread/e20f2f8df0296d3f -var common = require('../common'); +require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; @@ -35,4 +35,3 @@ process.on('exit', function() { assert.ok(sentKill); assert.ok(gotChildExit); }); - diff --git a/test/parallel/test-signal-handler.js b/test/parallel/test-signal-handler.js index bcd8256272005b..dc37a8a1f6704a 100644 --- a/test/parallel/test-signal-handler.js +++ b/test/parallel/test-signal-handler.js @@ -10,8 +10,8 @@ if (common.isWindows) { console.log('process.pid: ' + process.pid); -var first = 0, - second = 0; +let first = 0; +let second = 0; var sighup = false; diff --git a/test/parallel/test-signal-safety.js b/test/parallel/test-signal-safety.js index 549c26662f717a..7938ae04d6591b 100644 --- a/test/parallel/test-signal-safety.js +++ b/test/parallel/test-signal-safety.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var Signal = process.binding('signal_wrap').Signal; diff --git a/test/sequential/test-socket-write-after-fin-error.js b/test/parallel/test-socket-write-after-fin-error.js similarity index 100% rename from test/sequential/test-socket-write-after-fin-error.js rename to test/parallel/test-socket-write-after-fin-error.js diff --git a/test/sequential/test-socket-write-after-fin.js b/test/parallel/test-socket-write-after-fin.js similarity index 100% rename from test/sequential/test-socket-write-after-fin.js rename to test/parallel/test-socket-write-after-fin.js diff --git a/test/parallel/test-stdin-child-proc.js b/test/parallel/test-stdin-child-proc.js new file mode 100644 index 00000000000000..35ae0c99d3c8ff --- /dev/null +++ b/test/parallel/test-stdin-child-proc.js @@ -0,0 +1,13 @@ +'use strict'; +// This tests that pausing and resuming stdin does not hang and timeout +// when done in a child process. See test/parallel/test-stdin-pause-resume.js +const common = require('../common'); +const assert = require('assert'); +const child_process = require('child_process'); +const path = require('path'); +const cp = child_process.spawn(process.execPath, + [path.resolve(__dirname, 'test-stdin-pause-resume.js')]); + +cp.on('exit', common.mustCall((code) => { + assert.equal(code, 0); +})); diff --git a/test/sequential/test-stdin-from-file.js b/test/parallel/test-stdin-from-file.js similarity index 94% rename from test/sequential/test-stdin-from-file.js rename to test/parallel/test-stdin-from-file.js index 07b044769b3791..d6e3afeae6fdee 100644 --- a/test/sequential/test-stdin-from-file.js +++ b/test/parallel/test-stdin-from-file.js @@ -6,10 +6,10 @@ var childProcess = require('child_process'); var fs = require('fs'); var stdoutScript = join(common.fixturesDir, 'echo-close-check.js'); -var tmpFile = join(common.fixturesDir, 'stdin.txt'); +var tmpFile = join(common.tmpDir, 'stdin.txt'); var cmd = '"' + process.argv[0] + '" "' + stdoutScript + '" < "' + - tmpFile + '"'; + tmpFile + '"'; var string = 'abc\nümlaut.\nsomething else\n' + '南越国是前203年至前111年存在于岭南地区的一个国家,国都位于番禺,' + @@ -24,6 +24,8 @@ var string = 'abc\nümlaut.\nsomething else\n' + '有效的改善了岭南地区落后的政治、##济现状。\n'; +common.refreshTmpDir(); + console.log(cmd + '\n\n'); try { diff --git a/test/parallel/test-stdin-hang.js b/test/parallel/test-stdin-hang.js index 4818a9ee952026..bb43d52506e5dc 100644 --- a/test/parallel/test-stdin-hang.js +++ b/test/parallel/test-stdin-hang.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); // This test *only* verifies that invoking the stdin getter does not // cause node to hang indefinitely. diff --git a/test/parallel/test-stdin-pipe-large.js b/test/parallel/test-stdin-pipe-large.js new file mode 100644 index 00000000000000..5f4a2f10c8dd6d --- /dev/null +++ b/test/parallel/test-stdin-pipe-large.js @@ -0,0 +1,23 @@ +'use strict'; +// See https://github.com/nodejs/node/issues/5927 + +const common = require('../common'); +const assert = require('assert'); +const spawn = require('child_process').spawn; + +if (process.argv[2] === 'child') { + process.stdin.pipe(process.stdout); + return; +} + +const child = spawn(process.execPath, [__filename, 'child'], { stdio: 'pipe' }); + +const expectedBytes = 1024 * 1024; +let readBytes = 0; + +child.stdin.end(Buffer.alloc(expectedBytes)); + +child.stdout.on('data', (chunk) => readBytes += chunk.length); +child.stdout.on('end', common.mustCall(() => { + assert.strictEqual(readBytes, expectedBytes); +})); diff --git a/test/sequential/test-stdin-pipe-resume.js b/test/parallel/test-stdin-pipe-resume.js similarity index 95% rename from test/sequential/test-stdin-pipe-resume.js rename to test/parallel/test-stdin-pipe-resume.js index dbac78d78c5e12..cb288070450a1f 100644 --- a/test/sequential/test-stdin-pipe-resume.js +++ b/test/parallel/test-stdin-pipe-resume.js @@ -1,6 +1,6 @@ 'use strict'; // This tests that piping stdin will cause it to resume() as well. -var common = require('../common'); +require('../common'); var assert = require('assert'); if (process.argv[2] === 'child') { @@ -25,4 +25,3 @@ if (process.argv[2] === 'child') { child.stdin.end(); }, 10); } - diff --git a/test/sequential/test-stdin-script-child.js b/test/parallel/test-stdin-script-child.js similarity index 94% rename from test/sequential/test-stdin-script-child.js rename to test/parallel/test-stdin-script-child.js index c5d5d6d44281e3..ad65734364e707 100644 --- a/test/sequential/test-stdin-script-child.js +++ b/test/parallel/test-stdin-script-child.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; diff --git a/test/parallel/test-stdio-closed.js b/test/parallel/test-stdio-closed.js index 9249ea797be01b..bf9a57bd688ffc 100644 --- a/test/parallel/test-stdio-closed.js +++ b/test/parallel/test-stdio-closed.js @@ -18,7 +18,7 @@ if (process.argv[2] === 'child') { } // Run the script in a shell but close stdout and stderr. -var cmd = '"' + process.execPath + '" "' + __filename + '" child 1>&- 2>&-'; +var cmd = `"${process.execPath}" "${__filename}" child 1>&- 2>&-`; var proc = spawn('/bin/sh', ['-c', cmd], { stdio: 'inherit' }); proc.on('exit', common.mustCall(function(exitCode) { diff --git a/test/parallel/test-stdio-readable-writable.js b/test/parallel/test-stdio-readable-writable.js index f8a8923498cb03..7b9b69d309aec5 100644 --- a/test/parallel/test-stdio-readable-writable.js +++ b/test/parallel/test-stdio-readable-writable.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); assert(process.stdout.writable); diff --git a/test/sequential/test-stdout-cannot-be-closed-child-process-pipe.js b/test/parallel/test-stdout-cannot-be-closed-child-process-pipe.js similarity index 94% rename from test/sequential/test-stdout-cannot-be-closed-child-process-pipe.js rename to test/parallel/test-stdout-cannot-be-closed-child-process-pipe.js index c6f5aecd40e262..a138108fae7e01 100644 --- a/test/sequential/test-stdout-cannot-be-closed-child-process-pipe.js +++ b/test/parallel/test-stdout-cannot-be-closed-child-process-pipe.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); if (process.argv[2] === 'child') diff --git a/test/sequential/test-stdout-close-catch.js b/test/parallel/test-stdout-close-catch.js similarity index 97% rename from test/sequential/test-stdout-close-catch.js rename to test/parallel/test-stdout-close-catch.js index f0ecf9a7c4b725..470fa9843cb9de 100644 --- a/test/sequential/test-stdout-close-catch.js +++ b/test/parallel/test-stdout-close-catch.js @@ -3,7 +3,6 @@ var common = require('../common'); var assert = require('assert'); var path = require('path'); var child_process = require('child_process'); -var fs = require('fs'); var testScript = path.join(common.fixturesDir, 'catch-stdout-error.js'); diff --git a/test/parallel/test-stdout-close-unref.js b/test/parallel/test-stdout-close-unref.js index 12a031562bf6f0..67c6141c963088 100644 --- a/test/parallel/test-stdout-close-unref.js +++ b/test/parallel/test-stdout-close-unref.js @@ -1,16 +1,30 @@ 'use strict'; -var assert = require('assert'); -var common = require('../common'); +const common = require('../common'); +const assert = require('assert'); +const spawn = require('child_process').spawn; -var errs = 0; +if (process.argv[2] === 'child') { + var errs = 0; -process.stdin.resume(); -process.stdin._handle.close(); -process.stdin._handle.unref(); // Should not segfault. -process.stdin.on('error', function(err) { - errs++; -}); + process.stdin.resume(); + process.stdin._handle.close(); + process.stdin._handle.unref(); // Should not segfault. + process.stdin.on('error', function(err) { + errs++; + }); -process.on('exit', function() { - assert.strictEqual(errs, 1); -}); + process.on('exit', function() { + assert.strictEqual(errs, 1); + }); + return; +} + +// Use spawn so that we can be sure that stdin has a _handle property. +// Refs: https://github.com/nodejs/node/pull/5916 +const proc = spawn(process.execPath, [__filename, 'child'], { stdio: 'pipe' }); + +proc.stderr.pipe(process.stderr); +proc.on('exit', common.mustCall(function(exitCode) { + if (exitCode !== 0) + process.exitCode = exitCode; +})); diff --git a/test/sequential/test-stdout-stderr-reading.js b/test/parallel/test-stdout-stderr-reading.js similarity index 98% rename from test/sequential/test-stdout-stderr-reading.js rename to test/parallel/test-stdout-stderr-reading.js index 82fd51cedda1de..2cc029c501c162 100644 --- a/test/sequential/test-stdout-stderr-reading.js +++ b/test/parallel/test-stdout-stderr-reading.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); // verify that stdout is never read from. diff --git a/test/sequential/test-stdout-to-file.js b/test/parallel/test-stdout-to-file.js similarity index 100% rename from test/sequential/test-stdout-to-file.js rename to test/parallel/test-stdout-to-file.js diff --git a/test/parallel/test-stream-big-packet.js b/test/parallel/test-stream-big-packet.js index a9f6064c7e7277..e64f4aa34fd481 100644 --- a/test/parallel/test-stream-big-packet.js +++ b/test/parallel/test-stream-big-packet.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var util = require('util'); var stream = require('stream'); @@ -8,7 +8,7 @@ var passed = false; function PassThrough() { stream.Transform.call(this); -}; +} util.inherits(PassThrough, stream.Transform); PassThrough.prototype._transform = function(chunk, encoding, done) { this.push(chunk); @@ -17,7 +17,7 @@ PassThrough.prototype._transform = function(chunk, encoding, done) { function TestStream() { stream.Transform.call(this); -}; +} util.inherits(TestStream, stream.Transform); TestStream.prototype._transform = function(chunk, encoding, done) { if (!passed) { diff --git a/test/parallel/test-stream-big-push.js b/test/parallel/test-stream-big-push.js index e02ff98d3c7454..b46665efc94ff5 100644 --- a/test/parallel/test-stream-big-push.js +++ b/test/parallel/test-stream-big-push.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var stream = require('stream'); var str = 'asdfasdfasdfasdfasdf'; diff --git a/test/parallel/test-stream-duplex.js b/test/parallel/test-stream-duplex.js index 0e8789d6bf5555..200de24877bf79 100644 --- a/test/parallel/test-stream-duplex.js +++ b/test/parallel/test-stream-duplex.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var Duplex = require('stream').Transform; diff --git a/test/parallel/test-stream-end-paused.js b/test/parallel/test-stream-end-paused.js index 585d6c327fd592..9cc32db880ea88 100644 --- a/test/parallel/test-stream-end-paused.js +++ b/test/parallel/test-stream-end-paused.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var gotEnd = false; diff --git a/test/parallel/test-stream-ispaused.js b/test/parallel/test-stream-ispaused.js index 8112dc733a7205..38f8da3fd512e4 100644 --- a/test/parallel/test-stream-ispaused.js +++ b/test/parallel/test-stream-ispaused.js @@ -1,6 +1,6 @@ 'use strict'; +require('../common'); var assert = require('assert'); -var common = require('../common'); var stream = require('stream'); diff --git a/test/parallel/test-stream-pipe-after-end.js b/test/parallel/test-stream-pipe-after-end.js index 4bead73f68ce5b..258c9330a96018 100644 --- a/test/parallel/test-stream-pipe-after-end.js +++ b/test/parallel/test-stream-pipe-after-end.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var Readable = require('_stream_readable'); diff --git a/test/parallel/test-stream-pipe-await-drain.js b/test/parallel/test-stream-pipe-await-drain.js new file mode 100644 index 00000000000000..fba99ed4563c14 --- /dev/null +++ b/test/parallel/test-stream-pipe-await-drain.js @@ -0,0 +1,40 @@ +'use strict'; +const common = require('../common'); +const stream = require('stream'); + +// This is very similar to test-stream-pipe-cleanup-pause.js. + +const reader = new stream.Readable(); +const writer1 = new stream.Writable(); +const writer2 = new stream.Writable(); + +// 560000 is chosen here because it is larger than the (default) highWaterMark +// and will cause `.write()` to return false +// See: https://github.com/nodejs/node/issues/5820 +const buffer = Buffer.allocUnsafe(560000); + +reader._read = function(n) {}; + +writer1._write = common.mustCall(function(chunk, encoding, cb) { + this.emit('chunk-received'); + cb(); +}, 1); +writer1.once('chunk-received', function() { + setImmediate(function() { + // This one should *not* get through to writer1 because writer2 is not + // "done" processing. + reader.push(buffer); + }); +}); + +// A "slow" consumer: +writer2._write = common.mustCall(function(chunk, encoding, cb) { + // Not calling cb here to "simulate" slow stream. + + // This should be called exactly once, since the first .write() call + // will return false. +}, 1); + +reader.pipe(writer1); +reader.pipe(writer2); +reader.push(buffer); diff --git a/test/parallel/test-stream-pipe-cleanup-pause.js b/test/parallel/test-stream-pipe-cleanup-pause.js index b38f57a4ff0ba1..332930c813a3dd 100644 --- a/test/parallel/test-stream-pipe-cleanup-pause.js +++ b/test/parallel/test-stream-pipe-cleanup-pause.js @@ -1,6 +1,5 @@ 'use strict'; const common = require('../common'); -const assert = require('assert'); const stream = require('stream'); const reader = new stream.Readable(); diff --git a/test/parallel/test-stream-pipe-cleanup.js b/test/parallel/test-stream-pipe-cleanup.js index 08da96f92c3a0f..251695c9f723ab 100644 --- a/test/parallel/test-stream-pipe-cleanup.js +++ b/test/parallel/test-stream-pipe-cleanup.js @@ -2,7 +2,7 @@ // This test asserts that Stream.prototype.pipe does not leave listeners // hanging on the source or dest. -var common = require('../common'); +require('../common'); var stream = require('stream'); var assert = require('assert'); var util = require('util'); diff --git a/test/parallel/test-stream-pipe-error-handling.js b/test/parallel/test-stream-pipe-error-handling.js index 031a0da7e395db..88a70fb58e2cf1 100644 --- a/test/parallel/test-stream-pipe-error-handling.js +++ b/test/parallel/test-stream-pipe-error-handling.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var Stream = require('stream').Stream; @@ -38,7 +38,6 @@ var Stream = require('stream').Stream; })(); (function testErrorWithRemovedListenerThrows() { - var EE = require('events').EventEmitter; var R = Stream.Readable; var W = Stream.Writable; @@ -73,7 +72,6 @@ var Stream = require('stream').Stream; })(); (function testErrorWithRemovedListenerThrows() { - var EE = require('events').EventEmitter; var R = Stream.Readable; var W = Stream.Writable; diff --git a/test/parallel/test-stream-pipe-event.js b/test/parallel/test-stream-pipe-event.js index 0d10533b0c496a..d8601dd04a4d8e 100644 --- a/test/parallel/test-stream-pipe-event.js +++ b/test/parallel/test-stream-pipe-event.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var stream = require('stream'); var assert = require('assert'); var util = require('util'); diff --git a/test/parallel/test-stream-pipe-without-listenerCount.js b/test/parallel/test-stream-pipe-without-listenerCount.js index d7a6a6b653a6bf..872be6d7be5ce8 100644 --- a/test/parallel/test-stream-pipe-without-listenerCount.js +++ b/test/parallel/test-stream-pipe-without-listenerCount.js @@ -16,4 +16,4 @@ r.on('error', common.mustCall(noop)); w.on('error', common.mustCall(noop)); r.pipe(w); -function noop() {}; +function noop() {} diff --git a/test/parallel/test-stream-push-order.js b/test/parallel/test-stream-push-order.js index d67233aff7a498..f09cf95f370bce 100644 --- a/test/parallel/test-stream-push-order.js +++ b/test/parallel/test-stream-push-order.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var Readable = require('stream').Readable; var assert = require('assert'); @@ -21,7 +21,7 @@ s._read = function(n) { } }; -var v = s.read(0); +s.read(0); // ACTUALLY [1, 3, 5, 6, 4, 2] diff --git a/test/parallel/test-stream-push-strings.js b/test/parallel/test-stream-push-strings.js index 0d9c0653c0dc66..21621ff3fd114f 100644 --- a/test/parallel/test-stream-push-strings.js +++ b/test/parallel/test-stream-push-strings.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var Readable = require('stream').Readable; diff --git a/test/parallel/test-stream-readable-constructor-set-methods.js b/test/parallel/test-stream-readable-constructor-set-methods.js index 928ce31a8ebe7b..fb2114f44dad19 100644 --- a/test/parallel/test-stream-readable-constructor-set-methods.js +++ b/test/parallel/test-stream-readable-constructor-set-methods.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var Readable = require('stream').Readable; diff --git a/test/parallel/test-stream-readable-event.js b/test/parallel/test-stream-readable-event.js index 965fc82c05a1d9..10d314f4eec254 100644 --- a/test/parallel/test-stream-readable-event.js +++ b/test/parallel/test-stream-readable-event.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var Readable = require('stream').Readable; diff --git a/test/parallel/test-stream-readable-flow-recursion.js b/test/parallel/test-stream-readable-flow-recursion.js index 07edd579f1deea..57e295e5383550 100644 --- a/test/parallel/test-stream-readable-flow-recursion.js +++ b/test/parallel/test-stream-readable-flow-recursion.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); // this test verifies that passing a huge number to read(size) diff --git a/test/parallel/test-stream-transform-constructor-set-methods.js b/test/parallel/test-stream-transform-constructor-set-methods.js index c24c273b6f20e1..bf76b93690c840 100644 --- a/test/parallel/test-stream-transform-constructor-set-methods.js +++ b/test/parallel/test-stream-transform-constructor-set-methods.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var Transform = require('stream').Transform; diff --git a/test/parallel/test-stream-transform-objectmode-falsey-value.js b/test/parallel/test-stream-transform-objectmode-falsey-value.js index 762f0500ad3e60..eeb3d3f4ccc692 100644 --- a/test/parallel/test-stream-transform-objectmode-falsey-value.js +++ b/test/parallel/test-stream-transform-objectmode-falsey-value.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var stream = require('stream'); diff --git a/test/parallel/test-stream-transform-split-objectmode.js b/test/parallel/test-stream-transform-split-objectmode.js index 24833ece051e9e..4e33028da2f7de 100644 --- a/test/parallel/test-stream-transform-split-objectmode.js +++ b/test/parallel/test-stream-transform-split-objectmode.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var Transform = require('stream').Transform; diff --git a/test/parallel/test-stream-unshift-empty-chunk.js b/test/parallel/test-stream-unshift-empty-chunk.js index a7dcad425310b1..0da979e337486e 100644 --- a/test/parallel/test-stream-unshift-empty-chunk.js +++ b/test/parallel/test-stream-unshift-empty-chunk.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); // This test verifies that stream.unshift(Buffer(0)) or diff --git a/test/parallel/test-stream-unshift-read-race.js b/test/parallel/test-stream-unshift-read-race.js index 90f519b5b5d738..8239a380def66c 100644 --- a/test/parallel/test-stream-unshift-read-race.js +++ b/test/parallel/test-stream-unshift-read-race.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); // This test verifies that: @@ -13,7 +13,6 @@ var stream = require('stream'); var hwm = 10; var r = stream.Readable({ highWaterMark: hwm }); var chunks = 10; -var t = (chunks * 5); var data = new Buffer(chunks * hwm + Math.ceil(hwm / 2)); for (var i = 0; i < data.length; i++) { diff --git a/test/parallel/test-stream-wrap-encoding.js b/test/parallel/test-stream-wrap-encoding.js new file mode 100644 index 00000000000000..d23faaab4a65f3 --- /dev/null +++ b/test/parallel/test-stream-wrap-encoding.js @@ -0,0 +1,23 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); + +const StreamWrap = require('_stream_wrap'); +const Duplex = require('stream').Duplex; + +const stream = new Duplex({ + read: function() { + }, + write: function() { + } +}); + +stream.setEncoding('ascii'); + +const wrap = new StreamWrap(stream); + +wrap.on('error', common.mustCall(function(err) { + assert(/StringDecoder/.test(err.message)); +})); + +stream.push('ohai'); diff --git a/test/parallel/test-stream-wrap.js b/test/parallel/test-stream-wrap.js index e7a7ecddd2385d..5a8b75d4dc1f19 100644 --- a/test/parallel/test-stream-wrap.js +++ b/test/parallel/test-stream-wrap.js @@ -1,5 +1,5 @@ 'use strict'; -const common = require('../common'); +require('../common'); const assert = require('assert'); const StreamWrap = require('_stream_wrap'); diff --git a/test/parallel/test-stream-writable-change-default-encoding.js b/test/parallel/test-stream-writable-change-default-encoding.js index a6fcda3e62a517..d1d4af5b824baf 100644 --- a/test/parallel/test-stream-writable-change-default-encoding.js +++ b/test/parallel/test-stream-writable-change-default-encoding.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var stream = require('stream'); @@ -8,7 +8,7 @@ var util = require('util'); function MyWritable(fn, options) { stream.Writable.call(this, options); this.fn = fn; -}; +} util.inherits(MyWritable, stream.Writable); diff --git a/test/parallel/test-stream-writable-constructor-set-methods.js b/test/parallel/test-stream-writable-constructor-set-methods.js index 47fc458ce9713b..4a5f90216070c5 100644 --- a/test/parallel/test-stream-writable-constructor-set-methods.js +++ b/test/parallel/test-stream-writable-constructor-set-methods.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var Writable = require('stream').Writable; diff --git a/test/parallel/test-stream-writable-decoded-encoding.js b/test/parallel/test-stream-writable-decoded-encoding.js index b637838c0c65be..75d5d424766323 100644 --- a/test/parallel/test-stream-writable-decoded-encoding.js +++ b/test/parallel/test-stream-writable-decoded-encoding.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var stream = require('stream'); @@ -8,7 +8,7 @@ var util = require('util'); function MyWritable(fn, options) { stream.Writable.call(this, options); this.fn = fn; -}; +} util.inherits(MyWritable, stream.Writable); @@ -17,7 +17,7 @@ MyWritable.prototype._write = function(chunk, encoding, callback) { callback(); }; -;(function decodeStringsTrue() { +(function decodeStringsTrue() { var m = new MyWritable(function(isBuffer, type, enc) { assert(isBuffer); assert.equal(type, 'object'); @@ -28,7 +28,7 @@ MyWritable.prototype._write = function(chunk, encoding, callback) { m.end(); })(); -;(function decodeStringsFalse() { +(function decodeStringsFalse() { var m = new MyWritable(function(isBuffer, type, enc) { assert(!isBuffer); assert.equal(type, 'string'); diff --git a/test/parallel/test-stream-writev.js b/test/parallel/test-stream-writev.js index f73270f2ff53ba..295bed2959398c 100644 --- a/test/parallel/test-stream-writev.js +++ b/test/parallel/test-stream-writev.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var stream = require('stream'); @@ -30,11 +30,9 @@ function test(decode, uncork, multi, next) { function cnt(msg) { expectCount++; var expect = expectCount; - var called = false; return function(er) { if (er) throw er; - called = true; counter++; assert.equal(counter, expect); }; @@ -45,25 +43,24 @@ function test(decode, uncork, multi, next) { assert(false, 'Should not call _write'); }; - var expectChunks = decode ? - [ - { encoding: 'buffer', - chunk: [104, 101, 108, 108, 111, 44, 32] }, - { encoding: 'buffer', - chunk: [119, 111, 114, 108, 100] }, - { encoding: 'buffer', - chunk: [33] }, - { encoding: 'buffer', - chunk: [10, 97, 110, 100, 32, 116, 104, 101, 110, 46, 46, 46] }, - { encoding: 'buffer', - chunk: [250, 206, 190, 167, 222, 173, 190, 239, 222, 202, 251, 173]} - ] : [ - { encoding: 'ascii', chunk: 'hello, ' }, - { encoding: 'utf8', chunk: 'world' }, - { encoding: 'buffer', chunk: [33] }, - { encoding: 'binary', chunk: '\nand then...' }, - { encoding: 'hex', chunk: 'facebea7deadbeefdecafbad' } - ]; + var expectChunks = decode ? [ + { encoding: 'buffer', + chunk: [104, 101, 108, 108, 111, 44, 32] }, + { encoding: 'buffer', + chunk: [119, 111, 114, 108, 100] }, + { encoding: 'buffer', + chunk: [33] }, + { encoding: 'buffer', + chunk: [10, 97, 110, 100, 32, 116, 104, 101, 110, 46, 46, 46] }, + { encoding: 'buffer', + chunk: [250, 206, 190, 167, 222, 173, 190, 239, 222, 202, 251, 173]} + ] : [ + { encoding: 'ascii', chunk: 'hello, ' }, + { encoding: 'utf8', chunk: 'world' }, + { encoding: 'buffer', chunk: [33] }, + { encoding: 'binary', chunk: '\nand then...' }, + { encoding: 'hex', chunk: 'facebea7deadbeefdecafbad' } + ]; var actualChunks; w._writev = function(chunks, cb) { diff --git a/test/parallel/test-stream2-base64-single-char-read-end.js b/test/parallel/test-stream2-base64-single-char-read-end.js index 2d60877de83662..0f9f56b3e70730 100644 --- a/test/parallel/test-stream2-base64-single-char-read-end.js +++ b/test/parallel/test-stream2-base64-single-char-read-end.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var R = require('_stream_readable'); var W = require('_stream_writable'); var assert = require('assert'); @@ -17,7 +17,7 @@ src._read = function(n) { src.push(new Buffer('1')); src.push(null); }); - }; + } }; dst._write = function(chunk, enc, cb) { diff --git a/test/parallel/test-stream2-compatibility.js b/test/parallel/test-stream2-compatibility.js index 9eab7b713bf167..2d62d639077634 100644 --- a/test/parallel/test-stream2-compatibility.js +++ b/test/parallel/test-stream2-compatibility.js @@ -1,10 +1,10 @@ 'use strict'; -var common = require('../common'); +require('../common'); var R = require('_stream_readable'); +var W = require('_stream_writable'); var assert = require('assert'); var util = require('util'); -var EE = require('events').EventEmitter; var ondataCalled = 0; @@ -29,4 +29,25 @@ var reader = new TestReader(); setImmediate(function() { assert.equal(ondataCalled, 1); console.log('ok'); + reader.push(null); +}); + +function TestWriter() { + W.apply(this); + this.write('foo'); + this.end(); +} + +util.inherits(TestWriter, W); + +TestWriter.prototype._write = function(chunk, enc, cb) { + cb(); +}; + +var writer = new TestWriter(); + +process.on('exit', function() { + assert.strictEqual(reader.readable, false); + assert.strictEqual(writer.writable, false); + console.log('ok'); }); diff --git a/test/parallel/test-stream2-decode-partial.js b/test/parallel/test-stream2-decode-partial.js new file mode 100644 index 00000000000000..b58e192b9c33bb --- /dev/null +++ b/test/parallel/test-stream2-decode-partial.js @@ -0,0 +1,23 @@ +'use strict'; +require('../common'); +const Readable = require('_stream_readable'); +const assert = require('assert'); + +var buf = ''; +const euro = new Buffer([0xE2, 0x82, 0xAC]); +const cent = new Buffer([0xC2, 0xA2]); +const source = Buffer.concat([euro, cent]); + +const readable = Readable({ encoding: 'utf8' }); +readable.push(source.slice(0, 2)); +readable.push(source.slice(2, 4)); +readable.push(source.slice(4, 6)); +readable.push(null); + +readable.on('data', function(data) { + buf += data; +}); + +process.on('exit', function() { + assert.strictEqual(buf, '€¢'); +}); diff --git a/test/parallel/test-stream2-finish-pipe.js b/test/parallel/test-stream2-finish-pipe.js index 913bb7b0b4db09..63c78759cab60d 100644 --- a/test/parallel/test-stream2-finish-pipe.js +++ b/test/parallel/test-stream2-finish-pipe.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var stream = require('stream'); var Buffer = require('buffer').Buffer; diff --git a/test/sequential/test-stream2-httpclient-response-end.js b/test/parallel/test-stream2-httpclient-response-end.js similarity index 99% rename from test/sequential/test-stream2-httpclient-response-end.js rename to test/parallel/test-stream2-httpclient-response-end.js index 15d7fba27f63af..b778af58e2eec8 100644 --- a/test/sequential/test-stream2-httpclient-response-end.js +++ b/test/parallel/test-stream2-httpclient-response-end.js @@ -29,4 +29,3 @@ process.on('exit', function() { assert(readable_event); assert(end_event); }); - diff --git a/test/parallel/test-stream2-large-read-stall.js b/test/parallel/test-stream2-large-read-stall.js index 4cd89599fee730..6a38baac5dacbc 100644 --- a/test/parallel/test-stream2-large-read-stall.js +++ b/test/parallel/test-stream2-large-read-stall.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); // If everything aligns so that you do a read(n) of exactly the @@ -53,9 +53,6 @@ function push() { setTimeout(push); } -// start the flow -var ret = r.read(0); - process.on('exit', function() { assert.equal(pushes, PUSHCOUNT + 1); assert(endEmitted); diff --git a/test/parallel/test-stream2-objects.js b/test/parallel/test-stream2-objects.js index a2f554a0b8a004..e67359eff2b29e 100644 --- a/test/parallel/test-stream2-objects.js +++ b/test/parallel/test-stream2-objects.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var Readable = require('_stream_readable'); var Writable = require('_stream_writable'); var assert = require('assert'); @@ -167,8 +167,6 @@ test('read(0) for object streams', function(t) { r.push('foobar'); r.push(null); - var v = r.read(0); - r.pipe(toArray(function(array) { assert.deepEqual(array, ['foobar']); diff --git a/test/parallel/test-stream2-pipe-error-handling.js b/test/parallel/test-stream2-pipe-error-handling.js index 9eddbdd90d00c3..7d7cfb6b2b3307 100644 --- a/test/parallel/test-stream2-pipe-error-handling.js +++ b/test/parallel/test-stream2-pipe-error-handling.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var stream = require('stream'); diff --git a/test/parallel/test-stream2-pipe-error-once-listener.js b/test/parallel/test-stream2-pipe-error-once-listener.js index f2ecb87ce97a75..d046c5ea55e498 100644 --- a/test/parallel/test-stream2-pipe-error-once-listener.js +++ b/test/parallel/test-stream2-pipe-error-once-listener.js @@ -1,6 +1,5 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +require('../common'); var util = require('util'); var stream = require('stream'); diff --git a/test/parallel/test-stream2-push.js b/test/parallel/test-stream2-push.js index b58bce143585f4..e4603e688ecf55 100644 --- a/test/parallel/test-stream2-push.js +++ b/test/parallel/test-stream2-push.js @@ -1,17 +1,16 @@ 'use strict'; -var common = require('../common'); +require('../common'); var stream = require('stream'); var Readable = stream.Readable; var Writable = stream.Writable; var assert = require('assert'); -var util = require('util'); var EE = require('events').EventEmitter; // a mock thing a bit like the net.Socket/tcp_wrap.handle interaction -var stream = new Readable({ +stream = new Readable({ highWaterMark: 16, encoding: 'utf8' }); diff --git a/test/parallel/test-stream2-read-sync-stack.js b/test/parallel/test-stream2-read-sync-stack.js index e912e1039ff558..4bce87ffb9dffd 100644 --- a/test/parallel/test-stream2-read-sync-stack.js +++ b/test/parallel/test-stream2-read-sync-stack.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var Readable = require('stream').Readable; var r = new Readable(); diff --git a/test/parallel/test-stream2-readable-empty-buffer-no-eof.js b/test/parallel/test-stream2-readable-empty-buffer-no-eof.js index 8e4001f8022f1c..18012df3a41d89 100644 --- a/test/parallel/test-stream2-readable-empty-buffer-no-eof.js +++ b/test/parallel/test-stream2-readable-empty-buffer-no-eof.js @@ -1,14 +1,14 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); -var Readable = require('stream').Readable; +const Readable = require('stream').Readable; test1(); test2(); function test1() { - var r = new Readable(); + const r = new Readable(); // should not end when we get a Buffer(0) or '' as the _read result // that just means that there is *temporarily* no data, but to go @@ -20,9 +20,9 @@ function test1() { // r.read(0) again later, otherwise there is no more work being done // and the process just exits. - var buf = new Buffer(5); - buf.fill('x'); - var reads = 5; + const buf = Buffer(5).fill('x'); + let reads = 5; + const timeout = common.platformTimeout(50); r._read = function(n) { switch (reads--) { case 0: @@ -30,15 +30,15 @@ function test1() { case 1: return r.push(buf); case 2: - setTimeout(r.read.bind(r, 0), 50); + setTimeout(r.read.bind(r, 0), timeout); return r.push(new Buffer(0)); // Not-EOF! case 3: - setTimeout(r.read.bind(r, 0), 50); + setTimeout(r.read.bind(r, 0), timeout); return process.nextTick(function() { return r.push(new Buffer(0)); }); case 4: - setTimeout(r.read.bind(r, 0), 50); + setTimeout(r.read.bind(r, 0), timeout); return setTimeout(function() { return r.push(new Buffer(0)); }); @@ -51,9 +51,9 @@ function test1() { } }; - var results = []; + const results = []; function flow() { - var chunk; + let chunk; while (null !== (chunk = r.read())) results.push(chunk + ''); } diff --git a/test/parallel/test-stream2-readable-from-list.js b/test/parallel/test-stream2-readable-from-list.js index a8d9fb38f25090..ab9d9c5d72cae1 100644 --- a/test/parallel/test-stream2-readable-from-list.js +++ b/test/parallel/test-stream2-readable-from-list.js @@ -1,6 +1,6 @@ 'use strict'; +require('../common'); var assert = require('assert'); -var common = require('../common'); var fromList = require('_stream_readable')._fromList; // tiny node-tap lookalike. @@ -39,8 +39,6 @@ process.nextTick(run); test('buffers', function(t) { - // have a length - var len = 16; var list = [ new Buffer('foog'), new Buffer('bark'), new Buffer('bazy'), @@ -69,8 +67,6 @@ test('buffers', function(t) { }); test('strings', function(t) { - // have a length - var len = 16; var list = [ 'foog', 'bark', 'bazy', diff --git a/test/parallel/test-stream2-readable-legacy-drain.js b/test/parallel/test-stream2-readable-legacy-drain.js index 4218bace2b878f..399771e46a11ed 100644 --- a/test/parallel/test-stream2-readable-legacy-drain.js +++ b/test/parallel/test-stream2-readable-legacy-drain.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var Stream = require('stream'); diff --git a/test/parallel/test-stream2-readable-non-empty-end.js b/test/parallel/test-stream2-readable-non-empty-end.js index 46d6f92f2b9df2..1953503ef9be2e 100644 --- a/test/parallel/test-stream2-readable-non-empty-end.js +++ b/test/parallel/test-stream2-readable-non-empty-end.js @@ -1,6 +1,6 @@ 'use strict'; +require('../common'); var assert = require('assert'); -var common = require('../common'); var Readable = require('_stream_readable'); var len = 0; diff --git a/test/parallel/test-stream2-readable-wrap-empty.js b/test/parallel/test-stream2-readable-wrap-empty.js index 60417ca893300d..d2bf8f3f306f6d 100644 --- a/test/parallel/test-stream2-readable-wrap-empty.js +++ b/test/parallel/test-stream2-readable-wrap-empty.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var Readable = require('_stream_readable'); diff --git a/test/parallel/test-stream2-readable-wrap.js b/test/parallel/test-stream2-readable-wrap.js index 8e3e04b966010f..acf1cfdb030439 100644 --- a/test/parallel/test-stream2-readable-wrap.js +++ b/test/parallel/test-stream2-readable-wrap.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var Readable = require('_stream_readable'); diff --git a/test/parallel/test-stream2-set-encoding.js b/test/parallel/test-stream2-set-encoding.js index ea9a315cb1a6e1..40e09035a98e90 100644 --- a/test/parallel/test-stream2-set-encoding.js +++ b/test/parallel/test-stream2-set-encoding.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var R = require('_stream_readable'); var util = require('util'); diff --git a/test/parallel/test-stream2-transform.js b/test/parallel/test-stream2-transform.js index e45c913c94f559..11ee45915c8395 100644 --- a/test/parallel/test-stream2-transform.js +++ b/test/parallel/test-stream2-transform.js @@ -1,6 +1,6 @@ 'use strict'; +require('../common'); var assert = require('assert'); -var common = require('../common'); var PassThrough = require('_stream_passthrough'); var Transform = require('_stream_transform'); @@ -303,13 +303,10 @@ test('passthrough event emission', function(t) { var pt = new PassThrough(); var emits = 0; pt.on('readable', function() { - var state = pt._readableState; console.error('>>> emit readable %d', emits); emits++; }); - var i = 0; - pt.write(new Buffer('foog')); console.error('need emit 0'); diff --git a/test/parallel/test-stream2-unpipe-leak.js b/test/parallel/test-stream2-unpipe-leak.js index 15b510e7f643cc..3b529bac1f2e9c 100644 --- a/test/parallel/test-stream2-unpipe-leak.js +++ b/test/parallel/test-stream2-unpipe-leak.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var stream = require('stream'); diff --git a/test/parallel/test-stream2-writable.js b/test/parallel/test-stream2-writable.js index 1d87d7f920c052..81e57d06eb3bec 100644 --- a/test/parallel/test-stream2-writable.js +++ b/test/parallel/test-stream2-writable.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var W = require('_stream_writable'); var D = require('_stream_duplex'); var assert = require('assert'); diff --git a/test/parallel/test-stream3-pause-then-read.js b/test/parallel/test-stream3-pause-then-read.js index 135629a243d66c..0aee70f6832c7f 100644 --- a/test/parallel/test-stream3-pause-then-read.js +++ b/test/parallel/test-stream3-pause-then-read.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var stream = require('stream'); @@ -42,7 +42,7 @@ function read100() { function readn(n, then) { console.error('read %d', n); expectEndingData -= n; - ;(function read() { + (function read() { var c = r.read(n); if (!c) r.once('readable', read); diff --git a/test/parallel/test-string-decoder-end.js b/test/parallel/test-string-decoder-end.js index c3afb88d778b39..a064250dcdd39f 100644 --- a/test/parallel/test-string-decoder-end.js +++ b/test/parallel/test-string-decoder-end.js @@ -43,7 +43,7 @@ function testBuf(encoding, buf) { // write the whole buffer at once. var res2 = ''; - var s = new SD(encoding); + s = new SD(encoding); res2 += s.write(buf); res2 += s.end(); diff --git a/test/parallel/test-string-decoder.js b/test/parallel/test-string-decoder.js index 0b22d3dd04efc9..9d0034e2fc9c7d 100644 --- a/test/parallel/test-string-decoder.js +++ b/test/parallel/test-string-decoder.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var StringDecoder = require('string_decoder').StringDecoder; diff --git a/test/parallel/test-stringbytes-external-at-max.js b/test/parallel/test-stringbytes-external-at-max.js index 6678e5355224b3..5467d05a20104a 100644 --- a/test/parallel/test-stringbytes-external-at-max.js +++ b/test/parallel/test-stringbytes-external-at-max.js @@ -1,22 +1,32 @@ 'use strict'; +// Flags: --expose-gc -require('../common'); +const common = require('../common'); const assert = require('assert'); // v8 fails silently if string length > v8::String::kMaxLength // v8::String::kMaxLength defined in v8.h const kStringMaxLength = process.binding('buffer').kStringMaxLength; -try { - new Buffer(kStringMaxLength * 3); -} catch(e) { - assert.equal(e.message, 'Invalid array buffer length'); - console.log( - '1..0 # Skipped: intensive toString tests due to memory confinements'); +const skipMessage = + '1..0 # Skipped: intensive toString tests due to memory confinements'; +if (!common.enoughTestMem) { + console.log(skipMessage); return; } +assert(typeof gc === 'function', 'Run this test with --expose-gc'); -const buf = new Buffer(kStringMaxLength); +try { + var buf = new Buffer(kStringMaxLength); + // Try to allocate memory first then force gc so future allocations succeed. + new Buffer(2 * kStringMaxLength); + gc(); +} catch (e) { + // If the exception is not due to memory confinement then rethrow it. + if (e.message !== 'Invalid array buffer length') throw (e); + console.log(skipMessage); + return; +} const maxString = buf.toString('binary'); assert.equal(maxString.length, kStringMaxLength); diff --git a/test/parallel/test-stringbytes-external-exceed-max-by-1-ascii.js b/test/parallel/test-stringbytes-external-exceed-max-by-1-ascii.js deleted file mode 100644 index e982cf9eb092fd..00000000000000 --- a/test/parallel/test-stringbytes-external-exceed-max-by-1-ascii.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -require('../common'); -const assert = require('assert'); - -// v8 fails silently if string length > v8::String::kMaxLength -// v8::String::kMaxLength defined in v8.h -const kStringMaxLength = process.binding('buffer').kStringMaxLength; - -try { - new Buffer(kStringMaxLength * 3); -} catch(e) { - assert.equal(e.message, 'Invalid array buffer length'); - console.log( - '1..0 # Skipped: intensive toString tests due to memory confinements'); - return; -} - -const buf = new Buffer(kStringMaxLength + 1); - -assert.throws(function() { - buf.toString('ascii'); -}, /toString failed/); diff --git a/test/parallel/test-stringbytes-external-exceed-max-by-1-base64.js b/test/parallel/test-stringbytes-external-exceed-max-by-1-base64.js deleted file mode 100644 index 43a3358759e249..00000000000000 --- a/test/parallel/test-stringbytes-external-exceed-max-by-1-base64.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -require('../common'); -const assert = require('assert'); - -// v8 fails silently if string length > v8::String::kMaxLength -// v8::String::kMaxLength defined in v8.h -const kStringMaxLength = process.binding('buffer').kStringMaxLength; - -try { - new Buffer(kStringMaxLength * 3); -} catch(e) { - assert.equal(e.message, 'Invalid array buffer length'); - console.log( - '1..0 # Skipped: intensive toString tests due to memory confinements'); - return; -} - -const buf = new Buffer(kStringMaxLength + 1); - -assert.throws(function() { - buf.toString('base64'); -}, /toString failed/); diff --git a/test/parallel/test-stringbytes-external-exceed-max-by-1-binary.js b/test/parallel/test-stringbytes-external-exceed-max-by-1-binary.js deleted file mode 100644 index 9d0d2c3e897057..00000000000000 --- a/test/parallel/test-stringbytes-external-exceed-max-by-1-binary.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -require('../common'); -const assert = require('assert'); - -// v8 fails silently if string length > v8::String::kMaxLength -// v8::String::kMaxLength defined in v8.h -const kStringMaxLength = process.binding('buffer').kStringMaxLength; - -try { - new Buffer(kStringMaxLength * 3); -} catch(e) { - assert.equal(e.message, 'Invalid array buffer length'); - console.log( - '1..0 # Skipped: intensive toString tests due to memory confinements'); - return; -} - -const buf = new Buffer(kStringMaxLength + 1); - -assert.throws(function() { - buf.toString('binary'); -}, /toString failed/); - -var maxString = buf.toString('binary', 1); -assert.equal(maxString.length, kStringMaxLength); -// Free the memory early instead of at the end of the next assignment -maxString = undefined; - -maxString = buf.toString('binary', 0, kStringMaxLength); -assert.equal(maxString.length, kStringMaxLength); diff --git a/test/parallel/test-stringbytes-external-exceed-max-by-1-hex.js b/test/parallel/test-stringbytes-external-exceed-max-by-1-hex.js deleted file mode 100644 index 2937b4aab85813..00000000000000 --- a/test/parallel/test-stringbytes-external-exceed-max-by-1-hex.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -require('../common'); -const assert = require('assert'); - -// v8 fails silently if string length > v8::String::kMaxLength -// v8::String::kMaxLength defined in v8.h -const kStringMaxLength = process.binding('buffer').kStringMaxLength; - -try { - new Buffer(kStringMaxLength * 3); -} catch(e) { - assert.equal(e.message, 'Invalid array buffer length'); - console.log( - '1..0 # Skipped: intensive toString tests due to memory confinements'); - return; -} - -const buf = new Buffer(kStringMaxLength + 1); - -assert.throws(function() { - buf.toString('hex'); -}, /toString failed/); diff --git a/test/parallel/test-stringbytes-external-exceed-max-by-1-utf8.js b/test/parallel/test-stringbytes-external-exceed-max-by-1-utf8.js deleted file mode 100644 index ee297a880dacbd..00000000000000 --- a/test/parallel/test-stringbytes-external-exceed-max-by-1-utf8.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -require('../common'); -const assert = require('assert'); - -// v8 fails silently if string length > v8::String::kMaxLength -// v8::String::kMaxLength defined in v8.h -const kStringMaxLength = process.binding('buffer').kStringMaxLength; - -try { - new Buffer(kStringMaxLength * 3); -} catch(e) { - assert.equal(e.message, 'Invalid array buffer length'); - console.log( - '1..0 # Skipped: intensive toString tests due to memory confinements'); - return; -} - -const buf = new Buffer(kStringMaxLength + 1); - -assert.throws(function() { - buf.toString(); -}, /toString failed|Invalid array buffer length/); - -assert.throws(function() { - buf.toString('utf8'); -}, /toString failed/); diff --git a/test/parallel/test-stringbytes-external-exceed-max-by-2.js b/test/parallel/test-stringbytes-external-exceed-max-by-2.js deleted file mode 100644 index 879e4ae91dfb60..00000000000000 --- a/test/parallel/test-stringbytes-external-exceed-max-by-2.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -require('../common'); -const assert = require('assert'); - -// v8 fails silently if string length > v8::String::kMaxLength -// v8::String::kMaxLength defined in v8.h -const kStringMaxLength = process.binding('buffer').kStringMaxLength; - -try { - new Buffer(kStringMaxLength * 3); -} catch(e) { - assert.equal(e.message, 'Invalid array buffer length'); - console.log( - '1..0 # Skipped: intensive toString tests due to memory confinements'); - return; -} - -const buf2 = new Buffer(kStringMaxLength + 2); - -const maxString = buf2.toString('utf16le'); -assert.equal(maxString.length, (kStringMaxLength + 2) / 2); diff --git a/test/parallel/test-stringbytes-external-exceed-max.js b/test/parallel/test-stringbytes-external-exceed-max.js deleted file mode 100644 index 0a6f585b66f3ad..00000000000000 --- a/test/parallel/test-stringbytes-external-exceed-max.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -require('../common'); -const assert = require('assert'); - -// v8 fails silently if string length > v8::String::kMaxLength -// v8::String::kMaxLength defined in v8.h -const kStringMaxLength = process.binding('buffer').kStringMaxLength; - -try { - new Buffer(kStringMaxLength * 3); -} catch(e) { - assert.equal(e.message, 'Invalid array buffer length'); - console.log( - '1..0 # Skipped: intensive toString tests due to memory confinements'); - return; -} - -const buf0 = new Buffer(kStringMaxLength * 2 + 2); - -assert.throws(function() { - buf0.toString('utf16le'); -}, /toString failed/); diff --git a/test/parallel/test-stringbytes-external.js b/test/parallel/test-stringbytes-external.js index ba3f0c5d1d9ade..f9bd78378e3414 100644 --- a/test/parallel/test-stringbytes-external.js +++ b/test/parallel/test-stringbytes-external.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); // minimum string size to overflow into external string space var EXTERN_APEX = 0xFBEE9; @@ -22,9 +22,9 @@ write_str = Array(size).join(write_str); ucs2_control = Array(size).join(ucs2_control); // check resultant buffer and output string -var b = new Buffer(write_str, 'ucs2'); +b = new Buffer(write_str, 'ucs2'); // check fist Buffer created from write string -for (var i = 0; i < b.length; i += 2) { +for (let i = 0; i < b.length; i += 2) { assert.equal(b[i], 0x61); assert.equal(b[i + 1], 0); } @@ -39,7 +39,7 @@ var c_ucs = new Buffer(b_ucs, 'ucs2'); // make sure they're the same length assert.equal(c_bin.length, c_ucs.length); // make sure Buffers from externals are the same -for (var i = 0; i < c_bin.length; i++) { +for (let i = 0; i < c_bin.length; i++) { assert.equal(c_bin[i], c_ucs[i]); } // check resultant strings diff --git a/test/sequential/test-sync-fileread.js b/test/parallel/test-sync-fileread.js similarity index 85% rename from test/sequential/test-sync-fileread.js rename to test/parallel/test-sync-fileread.js index 24a80d96c2601b..6208e4c619efc7 100644 --- a/test/sequential/test-sync-fileread.js +++ b/test/parallel/test-sync-fileread.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var path = require('path'); var fs = require('fs'); diff --git a/test/parallel/test-sys.js b/test/parallel/test-sys.js index add692d7367f8c..3e28f020333c20 100644 --- a/test/parallel/test-sys.js +++ b/test/parallel/test-sys.js @@ -1,7 +1,7 @@ 'use strict'; require('../common'); var assert = require('assert'); -var sys = require('sys'); +var sys = require('sys'); // eslint-disable-line no-restricted-modules var util = require('util'); assert.strictEqual(sys, util); diff --git a/test/sequential/test-tcp-wrap-connect.js b/test/parallel/test-tcp-wrap-connect.js similarity index 100% rename from test/sequential/test-tcp-wrap-connect.js rename to test/parallel/test-tcp-wrap-connect.js diff --git a/test/sequential/test-tcp-wrap-listen.js b/test/parallel/test-tcp-wrap-listen.js similarity index 94% rename from test/sequential/test-tcp-wrap-listen.js rename to test/parallel/test-tcp-wrap-listen.js index a2c07a7a9ce2a2..aa9d810130fd43 100644 --- a/test/sequential/test-tcp-wrap-listen.js +++ b/test/parallel/test-tcp-wrap-listen.js @@ -12,7 +12,7 @@ assert.equal(0, r); server.listen(128); -var slice, sliceCount = 0, eofCount = 0; +var sliceCount = 0, eofCount = 0; var writeCount = 0; var recvCount = 0; @@ -38,8 +38,8 @@ server.onconnection = function(err, client) { var req = new WriteWrap(); req.async = false; - var err = client.writeBuffer(req, buffer); - assert.equal(err, 0); + const returnCode = client.writeBuffer(req, buffer); + assert.equal(returnCode, 0); client.pendingWrites.push(req); console.log('client.writeQueueSize: ' + client.writeQueueSize); @@ -65,7 +65,7 @@ server.onconnection = function(err, client) { writeCount++; console.log('write ' + writeCount); maybeCloseClient(); - }; + } sliceCount++; } else { diff --git a/test/parallel/test-tick-processor.js b/test/parallel/test-tick-processor.js index cd110e1a87ed3d..b22e2ec14a3c6e 100644 --- a/test/parallel/test-tick-processor.js +++ b/test/parallel/test-tick-processor.js @@ -1,14 +1,21 @@ 'use strict'; var fs = require('fs'); var assert = require('assert'); -var path = require('path'); var cp = require('child_process'); var common = require('../common'); +// TODO(mhdawson) Currently the test-tick-processor functionality in V8 +// depends on addresses being smaller than a full 64 bits. Aix supports +// the full 64 bits and the result is that it does not process the +// addresses correctly and runs out of memory +// Disabling until we get a fix upstreamed into V8 +if (common.isAix) { + console.log('1..0 # Skipped: Aix address range too big for scripts.'); + return; +} + common.refreshTmpDir(); process.chdir(common.tmpDir); -var processor = - path.join(common.testDir, '..', 'tools', 'v8-prof', 'tick-processor.js'); // Unknown checked for to prevent flakiness, if pattern is not found, // then a large number of unknown ticks should be present runTest(/LazyCompile.*\[eval\]:1|.*% UNKNOWN/, @@ -20,9 +27,11 @@ runTest(/LazyCompile.*\[eval\]:1|.*% UNKNOWN/, }; setTimeout(function() { process.exit(0); }, 2000); f();`); -if (process.platform === 'win32' || - process.platform === 'sunos' || - process.platform === 'freebsd') { +if (common.isWindows || + common.isSunOS || + common.isAix || + common.isLinuxPPCBE || + common.isFreeBSD) { console.log('1..0 # Skipped: C++ symbols are not mapped for this os.'); return; } @@ -43,9 +52,9 @@ function runTest(pattern, code) { assert.fail(null, null, 'There should be a single log file.'); } var log = matches[0]; - var out = cp.execSync(process.execPath + ' ' + processor + - ' --call-graph-size=10 ' + log, + var out = cp.execSync(process.execPath + + ' --prof-process --call-graph-size=10 ' + log, {encoding: 'utf8'}); - assert(out.match(pattern)); + assert(pattern.test(out)); fs.unlinkSync(log); } diff --git a/test/parallel/test-timers-active.js b/test/parallel/test-timers-active.js index acddc2f41a45e8..d8faa1f5a33483 100644 --- a/test/parallel/test-timers-active.js +++ b/test/parallel/test-timers-active.js @@ -1,5 +1,5 @@ 'use strict'; -const common = require('../common'); +require('../common'); const assert = require('assert'); const active = require('timers').active; diff --git a/test/parallel/test-timers-api-refs.js b/test/parallel/test-timers-api-refs.js new file mode 100644 index 00000000000000..c062369444b1e0 --- /dev/null +++ b/test/parallel/test-timers-api-refs.js @@ -0,0 +1,21 @@ +'use strict'; +const common = require('../common'); +const timers = require('timers'); + +// delete global APIs to make sure they're not relied on by the internal timers +// code +delete global.setTimeout; +delete global.clearTimeout; +delete global.setInterval; +delete global.clearInterval; +delete global.setImmediate; +delete global.clearImmediate; + +const timeoutCallback = () => { timers.clearTimeout(timeout); }; +const timeout = timers.setTimeout(common.mustCall(timeoutCallback), 1); + +const intervalCallback = () => { timers.clearInterval(interval); }; +const interval = timers.setInterval(common.mustCall(intervalCallback), 1); + +const immediateCallback = () => { timers.clearImmediate(immediate); }; +const immediate = timers.setImmediate(immediateCallback); diff --git a/test/parallel/test-timers-args.js b/test/parallel/test-timers-args.js index abb785ea0fc79c..ae11e35ba2784d 100644 --- a/test/parallel/test-timers-args.js +++ b/test/parallel/test-timers-args.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); function range(n) { diff --git a/test/parallel/test-timers-immediate-queue.js b/test/parallel/test-timers-immediate-queue.js index a71472d46442ab..62482d510a6608 100644 --- a/test/parallel/test-timers-immediate-queue.js +++ b/test/parallel/test-timers-immediate-queue.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); // setImmediate should run clear its queued cbs once per event loop turn diff --git a/test/parallel/test-timers-immediate.js b/test/parallel/test-timers-immediate.js index bcfc4616ac6264..4512ff47fb75a6 100644 --- a/test/parallel/test-timers-immediate.js +++ b/test/parallel/test-timers-immediate.js @@ -1,22 +1,21 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); -var immediateA = false, - immediateB = false, - immediateC = [], - before; +let immediateA = false; +let immediateB = false; +let immediateC = []; setImmediate(function() { try { immediateA = process.hrtime(before); - } catch(e) { + } catch (e) { console.log('failed to get hrtime with offset'); } clearImmediate(immediateB); }); -before = process.hrtime(); +const before = process.hrtime(); immediateB = setImmediate(function() { immediateB = true; diff --git a/test/parallel/test-timers-linked-list.js b/test/parallel/test-timers-linked-list.js index 0c76af970a1fb7..b5ff9f56bf0700 100644 --- a/test/parallel/test-timers-linked-list.js +++ b/test/parallel/test-timers-linked-list.js @@ -2,9 +2,9 @@ // Flags: --expose-internals -const common = require('../common'); +require('../common'); const assert = require('assert'); -const L = require('_linklist'); +const L = require('_linklist'); // eslint-disable-line no-restricted-modules const internalL = require('internal/linkedlist'); assert.strictEqual(L, internalL); diff --git a/test/parallel/test-timers-non-integer-delay.js b/test/parallel/test-timers-non-integer-delay.js index 97b2c0734f60d5..b42053db3b1895 100644 --- a/test/parallel/test-timers-non-integer-delay.js +++ b/test/parallel/test-timers-non-integer-delay.js @@ -16,7 +16,6 @@ */ require('../common'); -var assert = require('assert'); var TIMEOUT_DELAY = 1.1; var NB_TIMEOUTS_FIRED = 50; diff --git a/test/parallel/test-timers-now.js b/test/parallel/test-timers-now.js index 466bd064b8decf..8a47e397ce97a8 100644 --- a/test/parallel/test-timers-now.js +++ b/test/parallel/test-timers-now.js @@ -1,6 +1,6 @@ 'use strict'; -const common = require('../common'); +require('../common'); const assert = require('assert'); // Return value of Timer.now() should easily fit in a SMI right after start-up. diff --git a/test/parallel/test-timers-ordering.js b/test/parallel/test-timers-ordering.js index 730a78a072c663..cef91e58e78c3d 100644 --- a/test/parallel/test-timers-ordering.js +++ b/test/parallel/test-timers-ordering.js @@ -1,15 +1,12 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var Timer = process.binding('timer_wrap').Timer; -var i; - var N = 30; var last_i = 0; var last_ts = 0; -var start = Timer.now(); var f = function(i) { if (i <= N) { diff --git a/test/parallel/test-timers-reset-process-domain-on-throw.js b/test/parallel/test-timers-reset-process-domain-on-throw.js new file mode 100644 index 00000000000000..ab3ffd3596ed53 --- /dev/null +++ b/test/parallel/test-timers-reset-process-domain-on-throw.js @@ -0,0 +1,45 @@ +'use strict'; + +// This test makes sure that when throwing from within a timer's callback, +// its active domain at the time of the throw is not the process' active domain +// for the next timers that need to be processed on the same turn of the event +// loop. + +const common = require('../common'); +const assert = require('assert'); +const domain = require('domain'); + +// Use the same timeout value so that both timers' callbacks are called during +// the same invocation of the underlying native timer's callback (listOnTimeout +// in lib/timers.js). +setTimeout(err, 50); +setTimeout(common.mustCall(secondTimer), 50); + +function err() { + const d = domain.create(); + d.on('error', handleDomainError); + d.run(err2); + + function err2() { + // this function doesn't exist, and throws an error as a result. + err3(); // eslint-disable-line no-undef + } + + function handleDomainError(e) { + // In the domain's error handler, the current active domain should be the + // domain within which the error was thrown. + assert.equal(process.domain, d); + } +} + +function secondTimer() { + // secondTimer was scheduled before any domain had been created, so its + // callback should not have any active domain set when it runs. + if (process.domain !== null) { + console.log('process.domain should be null in this timer callback, but ' + + 'instead is:', process.domain); + // Do not use assert here, as it throws errors and if a domain with an error + // handler is active, then asserting wouldn't make the test fail. + process.exit(1); + } +} diff --git a/test/parallel/test-timers-socket-timeout-removes-other-socket-unref-timer.js b/test/parallel/test-timers-socket-timeout-removes-other-socket-unref-timer.js index 081688cfa5e812..a26b548385e5f6 100644 --- a/test/parallel/test-timers-socket-timeout-removes-other-socket-unref-timer.js +++ b/test/parallel/test-timers-socket-timeout-removes-other-socket-unref-timer.js @@ -5,7 +5,6 @@ */ const common = require('../common'); -const assert = require('assert'); const net = require('net'); const clients = []; @@ -40,7 +39,7 @@ server.listen(common.PORT, common.localhostIPv4, function() { if (nbClientsEnded === 2) { server.close(); } - }; + } const client1 = net.connect({ port: common.PORT }); client1.on('end', addEndedClient); diff --git a/test/parallel/test-timers-this.js b/test/parallel/test-timers-this.js index 1882f116fecd2d..e21167581e8944 100644 --- a/test/parallel/test-timers-this.js +++ b/test/parallel/test-timers-this.js @@ -2,8 +2,8 @@ require('../common'); var assert = require('assert'); -var immediateThis, intervalThis, timeoutThis, - immediateArgsThis, intervalArgsThis, timeoutArgsThis; +let immediateThis, intervalThis, timeoutThis; +let immediateArgsThis, intervalArgsThis, timeoutArgsThis; var immediateHandler = setImmediate(function() { immediateThis = this; diff --git a/test/parallel/test-timers-uncaught-exception.js b/test/parallel/test-timers-uncaught-exception.js index 794b3b923be1df..6b6dc583715849 100644 --- a/test/parallel/test-timers-uncaught-exception.js +++ b/test/parallel/test-timers-uncaught-exception.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var exceptions = 0; diff --git a/test/parallel/test-timers-unref-active-unenrolled-disposed.js b/test/parallel/test-timers-unref-active-unenrolled-disposed.js index ac22cd6e6a7144..675da017173e88 100644 --- a/test/parallel/test-timers-unref-active-unenrolled-disposed.js +++ b/test/parallel/test-timers-unref-active-unenrolled-disposed.js @@ -9,7 +9,7 @@ const domain = require('domain'); // Crazy stuff to keep the process open, // then close it when we are actually done. -const TEST_DURATION = common.platformTimeout(100); +const TEST_DURATION = common.platformTimeout(1000); const keepOpen = setTimeout(function() { throw new Error('Test timed out. keepOpen was not canceled.'); }, TEST_DURATION); diff --git a/test/parallel/test-timers-unref-active.js b/test/parallel/test-timers-unref-active.js index 08f28b0153fecb..69027277ea0ff2 100644 --- a/test/parallel/test-timers-unref-active.js +++ b/test/parallel/test-timers-unref-active.js @@ -15,7 +15,7 @@ * all 10 timeouts had the time to expire. */ -const common = require('../common'); +require('../common'); const timers = require('timers'); const assert = require('assert'); @@ -31,7 +31,7 @@ var nbTimeouts = 0; * and thus expect 5 timers to be able to fire in under 100 ms. */ const N = 5; -const TEST_DURATION = 100; +const TEST_DURATION = 1000; timers.unenroll(someObject); timers.enroll(someObject, 1); diff --git a/test/parallel/test-timers-unref-call.js b/test/parallel/test-timers-unref-call.js index b348330d200d65..edd5865e8f610b 100644 --- a/test/parallel/test-timers-unref-call.js +++ b/test/parallel/test-timers-unref-call.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var Timer = process.binding('timer_wrap').Timer; Timer.now = function() { return ++Timer.now.ticks; }; diff --git a/test/parallel/test-timers-unref-remove-other-unref-timers-only-one-fires.js b/test/parallel/test-timers-unref-remove-other-unref-timers-only-one-fires.js index aead4a4e7def64..971c485a4cf986 100644 --- a/test/parallel/test-timers-unref-remove-other-unref-timers-only-one-fires.js +++ b/test/parallel/test-timers-unref-remove-other-unref-timers-only-one-fires.js @@ -10,7 +10,7 @@ * This behavior is a private implementation detail and should not be * considered public interface. */ -const common = require('../common'); +require('../common'); const timers = require('timers'); const assert = require('assert'); diff --git a/test/parallel/test-timers-unref-remove-other-unref-timers.js b/test/parallel/test-timers-unref-remove-other-unref-timers.js index f727d5f86fd7b3..dcc50a5171ad28 100644 --- a/test/parallel/test-timers-unref-remove-other-unref-timers.js +++ b/test/parallel/test-timers-unref-remove-other-unref-timers.js @@ -7,11 +7,10 @@ * considered public interface. */ const common = require('../common'); -const assert = require('assert'); const timers = require('timers'); const foo = { - _onTimeout: assert.fail + _onTimeout: common.fail }; const bar = { diff --git a/test/parallel/test-timers-unref.js b/test/parallel/test-timers-unref.js index c0b24a4275be86..570c51b9ac7a5f 100644 --- a/test/parallel/test-timers-unref.js +++ b/test/parallel/test-timers-unref.js @@ -1,13 +1,13 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); -var interval_fired = false, - timeout_fired = false, - unref_interval = false, - unref_timer = false, - unref_callbacks = 0, - interval, check_unref, checks = 0; +let interval_fired = false; +let timeout_fired = false; +let unref_interval = false; +let unref_timer = false; +let unref_callbacks = 0; +let checks = 0; var LONG_TIME = 10 * 1000; var SHORT_TIME = 100; @@ -28,7 +28,7 @@ setTimeout(function() { timeout_fired = true; }, LONG_TIME).unref(); -interval = setInterval(function() { +const interval = setInterval(function() { unref_interval = true; clearInterval(interval); }, SHORT_TIME); @@ -38,7 +38,7 @@ setTimeout(function() { unref_timer = true; }, SHORT_TIME).unref(); -check_unref = setInterval(function() { +const check_unref = setInterval(function() { if (checks > 5 || (unref_interval && unref_timer)) clearInterval(check_unref); checks += 1; diff --git a/test/parallel/test-timers-unrefd-interval-still-fires.js b/test/parallel/test-timers-unrefd-interval-still-fires.js index 98bd278b451613..39bb2cdb138205 100644 --- a/test/parallel/test-timers-unrefd-interval-still-fires.js +++ b/test/parallel/test-timers-unrefd-interval-still-fires.js @@ -2,19 +2,26 @@ /* * This test is a regression test for joyent/node#8900. */ -require('../common'); -var assert = require('assert'); +const common = require('../common'); -var N = 5; +const TEST_DURATION = common.platformTimeout(1000); +const N = 3; var nbIntervalFired = 0; -var timer = setInterval(function() { + +const keepOpen = setTimeout(() => { + console.error('[FAIL] Interval fired %d/%d times.', nbIntervalFired, N); + throw new Error('Test timed out. keepOpen was not canceled.'); +}, TEST_DURATION); + +const timer = setInterval(() => { ++nbIntervalFired; - if (nbIntervalFired === N) + if (nbIntervalFired === N) { clearInterval(timer); + timer._onTimeout = () => { + throw new Error('Unrefd interval fired after being cleared.'); + }; + clearTimeout(keepOpen); + } }, 1); timer.unref(); - -setTimeout(function onTimeout() { - assert.strictEqual(nbIntervalFired, N); -}, 100); diff --git a/test/parallel/test-timers-unrefed-in-beforeexit.js b/test/parallel/test-timers-unrefed-in-beforeexit.js new file mode 100644 index 00000000000000..0ac3311816fb4d --- /dev/null +++ b/test/parallel/test-timers-unrefed-in-beforeexit.js @@ -0,0 +1,20 @@ +'use strict'; + +require('../common'); +const assert = require('assert'); + +var once = 0; + +process.on('beforeExit', () => { + if (once > 1) + throw new RangeError('beforeExit should only have been called once!'); + + setTimeout(() => {}, 1).unref(); + once++; +}); + +process.on('exit', (code) => { + if (code !== 0) return; + + assert.strictEqual(once, 1); +}); diff --git a/test/parallel/test-timers-zero-timeout.js b/test/parallel/test-timers-zero-timeout.js index 1c84814363a641..ab0c38f6084277 100644 --- a/test/parallel/test-timers-zero-timeout.js +++ b/test/parallel/test-timers-zero-timeout.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); // https://github.com/joyent/node/issues/2079 - zero timeout drops extra args @@ -7,7 +7,7 @@ var assert = require('assert'); var ncalled = 0; setTimeout(f, 0, 'foo', 'bar', 'baz'); - var timer = setTimeout(function() {}, 0); + setTimeout(function() {}, 0); function f(a, b, c) { assert.equal(a, 'foo'); diff --git a/test/parallel/test-timers.js b/test/parallel/test-timers.js index e784e262959d97..0b379e0eb45ad0 100644 --- a/test/parallel/test-timers.js +++ b/test/parallel/test-timers.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var inputs = [ diff --git a/test/parallel/test-tls-0-dns-altname.js b/test/parallel/test-tls-0-dns-altname.js index 61458142bc0115..793b56426f9463 100644 --- a/test/parallel/test-tls-0-dns-altname.js +++ b/test/parallel/test-tls-0-dns-altname.js @@ -9,9 +9,6 @@ if (!common.hasCrypto) { var tls = require('tls'); var fs = require('fs'); -var net = require('net'); - -var common = require('../common'); var requests = 0; diff --git a/test/parallel/test-tls-alpn-server-client.js b/test/parallel/test-tls-alpn-server-client.js new file mode 100644 index 00000000000000..a9fe0b84d4ca5f --- /dev/null +++ b/test/parallel/test-tls-alpn-server-client.js @@ -0,0 +1,540 @@ +'use strict'; +const common = require('../common'); + +if (!common.hasCrypto) { + console.log('1..0 # Skipped: missing crypto'); + return; +} + +if (!process.features.tls_alpn) { + console.error('Skipping because node compiled without OpenSSL or ' + + 'with old OpenSSL version.'); + process.exit(0); +} + +const assert = require('assert'); +const fs = require('fs'); +const tls = require('tls'); + +function filenamePEM(n) { + return require('path').join(common.fixturesDir, 'keys', n + '.pem'); +} + +function loadPEM(n) { + return fs.readFileSync(filenamePEM(n)); +} + +var serverPort = common.PORT; +var serverIP = common.localhostIPv4; + +function checkResults(result, expected) { + assert.strictEqual(result.server.ALPN, expected.server.ALPN); + assert.strictEqual(result.server.NPN, expected.server.NPN); + assert.strictEqual(result.client.ALPN, expected.client.ALPN); + assert.strictEqual(result.client.NPN, expected.client.NPN); +} + +function runTest(clientsOptions, serverOptions, cb) { + serverOptions.key = loadPEM('agent2-key'); + serverOptions.cert = loadPEM('agent2-cert'); + var results = []; + var index = 0; + var server = tls.createServer(serverOptions, function(c) { + results[index].server = {ALPN: c.alpnProtocol, NPN: c.npnProtocol}; + }); + + server.listen(serverPort, serverIP, function() { + connectClient(clientsOptions); + }); + + function connectClient(options) { + var opt = options.shift(); + opt.port = serverPort; + opt.host = serverIP; + opt.rejectUnauthorized = false; + + results[index] = {}; + var client = tls.connect(opt, function() { + results[index].client = {ALPN: client.alpnProtocol, + NPN: client.npnProtocol}; + client.destroy(); + if (options.length) { + index++; + connectClient(options); + } else { + server.close(); + cb(results); + } + }); + } + +} + +// Server: ALPN/NPN, Client: ALPN/NPN +function Test1() { + var serverOptions = { + ALPNProtocols: ['a', 'b', 'c'], + NPNProtocols: ['a', 'b', 'c'] + }; + + var clientsOptions = [{ + ALPNProtocols: ['a', 'b', 'c'], + NPNProtocols: ['a', 'b', 'c'] + }, { + ALPNProtocols: ['c', 'b', 'e'], + NPNProtocols: ['c', 'b', 'e'] + }, { + ALPNProtocols: ['first-priority-unsupported', 'x', 'y'], + NPNProtocols: ['first-priority-unsupported', 'x', 'y'] + }]; + + runTest(clientsOptions, serverOptions, function(results) { + // 'a' is selected by ALPN + checkResults(results[0], + {server: {ALPN: 'a', NPN: false}, + client: {ALPN: 'a', NPN: undefined}}); + // 'b' is selected by ALPN + checkResults(results[1], + {server: {ALPN: 'b', NPN: false}, + client: {ALPN: 'b', NPN: undefined}}); + // nothing is selected by ALPN + checkResults(results[2], + {server: {ALPN: false, NPN: false}, + client: {ALPN: false, NPN: undefined}}); + // execute next test + Test2(); + }); +} + +// Server: ALPN/NPN, Client: ALPN +function Test2() { + var serverOptions = { + ALPNProtocols: ['a', 'b', 'c'], + NPNProtocols: ['a', 'b', 'c'] + }; + + var clientsOptions = [{ + ALPNProtocols: ['a', 'b', 'c'] + }, { + ALPNProtocols: ['c', 'b', 'e'] + }, { + ALPNProtocols: ['first-priority-unsupported', 'x', 'y'] + }]; + + runTest(clientsOptions, serverOptions, function(results) { + // 'a' is selected by ALPN + checkResults(results[0], + {server: {ALPN: 'a', NPN: false}, + client: {ALPN: 'a', NPN: undefined}}); + // 'b' is selected by ALPN + checkResults(results[1], + {server: {ALPN: 'b', NPN: false}, + client: {ALPN: 'b', NPN: undefined}}); + // nothing is selected by ALPN + checkResults(results[2], + {server: {ALPN: false, NPN: false}, + client: {ALPN: false, NPN: undefined}}); + // execute next test + Test3(); + }); +} + +// Server: ALPN/NPN, Client: NPN +function Test3() { + var serverOptions = { + ALPNProtocols: ['a', 'b', 'c'], + NPNProtocols: ['a', 'b', 'c'] + }; + + var clientsOptions = [{ + NPNProtocols: ['a', 'b', 'c'] + }, { + NPPNProtocols: ['c', 'b', 'e'] + }, { + NPPNProtocols: ['first-priority-unsupported', 'x', 'y'] + }]; + + runTest(clientsOptions, serverOptions, function(results) { + // 'a' is selected by NPN + checkResults(results[0], + {server: {ALPN: false, NPN: 'a'}, + client: {ALPN: false, NPN: 'a'}}); + // nothing is selected by ALPN + checkResults(results[1], + {server: {ALPN: false, NPN: 'http/1.1'}, + client: {ALPN: false, NPN: false}}); + // nothing is selected by ALPN + checkResults(results[2], + {server: {ALPN: false, NPN: 'http/1.1'}, + client: {ALPN: false, NPN: false}}); + // execute next test + Test4(); + }); +} + +// Server: ALPN/NPN, Client: Nothing +function Test4() { + var serverOptions = { + ALPNProtocols: ['a', 'b', 'c'], + NPNProtocols: ['a', 'b', 'c'] + }; + + var clientsOptions = [{}, {}, {}]; + + runTest(clientsOptions, serverOptions, function(results) { + // nothing is selected by ALPN + checkResults(results[0], + {server: {ALPN: false, NPN: 'http/1.1'}, + client: {ALPN: false, NPN: false}}); + // nothing is selected by ALPN + checkResults(results[1], + {server: {ALPN: false, NPN: 'http/1.1'}, + client: {ALPN: false, NPN: false}}); + // nothing is selected by ALPN + checkResults(results[2], + {server: {ALPN: false, NPN: 'http/1.1'}, + client: {ALPN: false, NPN: false}}); + // execute next test + Test5(); + }); +} + +// Server: ALPN, Client: ALPN/NPN +function Test5() { + var serverOptions = { + ALPNProtocols: ['a', 'b', 'c'] + }; + + var clientsOptions = [{ + ALPNProtocols: ['a', 'b', 'c'], + NPNProtocols: ['a', 'b', 'c'] + }, { + ALPNProtocols: ['c', 'b', 'e'], + NPNProtocols: ['c', 'b', 'e'] + }, { + ALPNProtocols: ['first-priority-unsupported', 'x', 'y'], + NPNProtocols: ['first-priority-unsupported', 'x', 'y'] + }]; + + runTest(clientsOptions, serverOptions, function(results) { + // 'a' is selected by ALPN + checkResults(results[0], {server: {ALPN: 'a', NPN: false}, + client: {ALPN: 'a', NPN: undefined}}); + // 'b' is selected by ALPN + checkResults(results[1], {server: {ALPN: 'b', NPN: false}, + client: {ALPN: 'b', NPN: undefined}}); + // nothing is selected by ALPN + checkResults(results[2], {server: {ALPN: false, NPN: false}, + client: {ALPN: false, NPN: undefined}}); + // execute next test + Test6(); + }); +} + +// Server: ALPN, Client: ALPN +function Test6() { + var serverOptions = { + ALPNProtocols: ['a', 'b', 'c'] + }; + + var clientsOptions = [{ + ALPNProtocols: ['a', 'b', 'c'] + }, { + ALPNProtocols: ['c', 'b', 'e'] + }, { + ALPNProtocols: ['first-priority-unsupported', 'x', 'y'] + }]; + + runTest(clientsOptions, serverOptions, function(results) { + // 'a' is selected by ALPN + checkResults(results[0], {server: {ALPN: 'a', NPN: false}, + client: {ALPN: 'a', NPN: undefined}}); + // 'b' is selected by ALPN + checkResults(results[1], {server: {ALPN: 'b', NPN: false}, + client: {ALPN: 'b', NPN: undefined}}); + // nothing is selected by ALPN + checkResults(results[2], {server: {ALPN: false, NPN: false}, + client: {ALPN: false, NPN: undefined}}); + // execute next test + Test7(); + }); +} + +// Server: ALPN, Client: NPN +function Test7() { + var serverOptions = { + ALPNProtocols: ['a', 'b', 'c'] + }; + + var clientsOptions = [{ + NPNProtocols: ['a', 'b', 'c'] + }, { + NPNProtocols: ['c', 'b', 'e'] + }, { + NPNProtocols: ['first-priority-unsupported', 'x', 'y'] + }]; + + runTest(clientsOptions, serverOptions, function(results) { + // nothing is selected by ALPN + checkResults(results[0], {server: {ALPN: false, NPN: 'a'}, + client: {ALPN: false, NPN: false}}); + // nothing is selected by ALPN + checkResults(results[1], {server: {ALPN: false, NPN: 'c'}, + client: {ALPN: false, NPN: false}}); + // nothing is selected by ALPN + checkResults(results[2], + {server: {ALPN: false, NPN: 'first-priority-unsupported'}, + client: {ALPN: false, NPN: false}}); + // execute next test + Test8(); + }); +} + +// Server: ALPN, Client: Nothing +function Test8() { + var serverOptions = { + ALPNProtocols: ['a', 'b', 'c'] + }; + + var clientsOptions = [{}, {}, {}]; + + runTest(clientsOptions, serverOptions, function(results) { + // nothing is selected by ALPN + checkResults(results[0], {server: {ALPN: false, NPN: 'http/1.1'}, + client: {ALPN: false, NPN: false}}); + // nothing is selected by ALPN + checkResults(results[1], {server: {ALPN: false, NPN: 'http/1.1'}, + client: {ALPN: false, NPN: false}}); + // nothing is selected by ALPN + checkResults(results[2], + {server: {ALPN: false, NPN: 'http/1.1'}, + client: {ALPN: false, NPN: false}}); + // execute next test + Test9(); + }); +} + +// Server: NPN, Client: ALPN/NPN +function Test9() { + var serverOptions = { + NPNProtocols: ['a', 'b', 'c'] + }; + + var clientsOptions = [{ + ALPNrotocols: ['a', 'b', 'c'], + NPNProtocols: ['a', 'b', 'c'] + }, { + ALPNProtocols: ['c', 'b', 'e'], + NPNProtocols: ['c', 'b', 'e'] + }, { + ALPNProtocols: ['first-priority-unsupported', 'x', 'y'], + NPNProtocols: ['first-priority-unsupported', 'x', 'y'] + }]; + + runTest(clientsOptions, serverOptions, function(results) { + // 'a' is selected by NPN + checkResults(results[0], {server: {ALPN: false, NPN: 'a'}, + client: {ALPN: false, NPN: 'a'}}); + // 'b' is selected by NPN + checkResults(results[1], {server: {ALPN: false, NPN: 'b'}, + client: {ALPN: false, NPN: 'b'}}); + // nothing is selected + checkResults(results[2], + {server: {ALPN: false, NPN: 'first-priority-unsupported'}, + client: {ALPN: false, NPN: false}}); + // execute next test + Test10(); + }); +} + +// Server: NPN, Client: ALPN +function Test10() { + var serverOptions = { + NPNProtocols: ['a', 'b', 'c'] + }; + + var clientsOptions = [{ + ALPNProtocols: ['a', 'b', 'c'] + }, { + ALPNProtocols: ['c', 'b', 'e'] + }, { + ALPNProtocols: ['first-priority-unsupported', 'x', 'y'] + }]; + + runTest(clientsOptions, serverOptions, function(results) { + // nothing is selected + checkResults(results[0], {server: {ALPN: false, NPN: 'http/1.1'}, + client: {ALPN: false, NPN: false}}); + // nothing is selected + checkResults(results[1], {server: {ALPN: false, NPN: 'http/1.1'}, + client: {ALPN: false, NPN: false}}); + // nothing is selected + checkResults(results[2], {server: {ALPN: false, NPN: 'http/1.1'}, + client: {ALPN: false, NPN: false}}); + // execute next test + Test11(); + }); +} + +// Server: NPN, Client: NPN +function Test11() { + var serverOptions = { + NPNProtocols: ['a', 'b', 'c'] + }; + + var clientsOptions = [{ + NPNProtocols: ['a', 'b', 'c'] + }, { + NPNProtocols: ['c', 'b', 'e'] + }, { + NPNProtocols: ['first-priority-unsupported', 'x', 'y'] + }]; + + runTest(clientsOptions, serverOptions, function(results) { + // 'a' is selected by NPN + checkResults(results[0], {server: {ALPN: false, NPN: 'a'}, + client: {ALPN: false, NPN: 'a'}}); + // 'b' is selected by NPN + checkResults(results[1], {server: {ALPN: false, NPN: 'b'}, + client: {ALPN: false, NPN: 'b'}}); + // nothing is selected + checkResults(results[2], + {server: {ALPN: false, NPN: 'first-priority-unsupported'}, + client: {ALPN: false, NPN: false}}); + // execute next test + Test12(); + }); +} + +// Server: NPN, Client: Nothing +function Test12() { + var serverOptions = { + NPNProtocols: ['a', 'b', 'c'] + }; + + var clientsOptions = [{}, {}, {}]; + + runTest(clientsOptions, serverOptions, function(results) { + // nothing is selected + checkResults(results[0], {server: {ALPN: false, NPN: 'http/1.1'}, + client: {ALPN: false, NPN: false}}); + // nothing is selected + checkResults(results[1], {server: {ALPN: false, NPN: 'http/1.1'}, + client: {ALPN: false, NPN: false}}); + // nothing is selected + checkResults(results[2], + {server: {ALPN: false, NPN: 'http/1.1'}, + client: {ALPN: false, NPN: false}}); + // execute next test + Test13(); + }); +} + +// Server: Nothing, Client: ALPN/NPN +function Test13() { + var serverOptions = {}; + + var clientsOptions = [{ + ALPNrotocols: ['a', 'b', 'c'], + NPNProtocols: ['a', 'b', 'c'] + }, { + ALPNProtocols: ['c', 'b', 'e'], + NPNProtocols: ['c', 'b', 'e'] + }, { + ALPNProtocols: ['first-priority-unsupported', 'x', 'y'], + NPNProtocols: ['first-priority-unsupported', 'x', 'y'] + }]; + + runTest(clientsOptions, serverOptions, function(results) { + // nothing is selected + checkResults(results[0], {server: {ALPN: false, NPN: 'a'}, + client: {ALPN: false, NPN: false}}); + // nothing is selected + checkResults(results[1], {server: {ALPN: false, NPN: 'c'}, + client: {ALPN: false, NPN: false}}); + // nothing is selected + checkResults(results[2], + {server: {ALPN: false, NPN: 'first-priority-unsupported'}, + client: {ALPN: false, NPN: false}}); + // execute next test + Test14(); + }); +} + +// Server: Nothing, Client: ALPN +function Test14() { + var serverOptions = {}; + + var clientsOptions = [{ + ALPNrotocols: ['a', 'b', 'c'] + }, { + ALPNProtocols: ['c', 'b', 'e'] + }, { + ALPNProtocols: ['first-priority-unsupported', 'x', 'y'] + }]; + + runTest(clientsOptions, serverOptions, function(results) { + // nothing is selected + checkResults(results[0], {server: {ALPN: false, NPN: 'http/1.1'}, + client: {ALPN: false, NPN: false}}); + // nothing is selected + checkResults(results[1], {server: {ALPN: false, NPN: 'http/1.1'}, + client: {ALPN: false, NPN: false}}); + // nothing is selected + checkResults(results[2], + {server: {ALPN: false, NPN: 'http/1.1'}, + client: {ALPN: false, NPN: false}}); + // execute next test + Test15(); + }); +} + +// Server: Nothing, Client: NPN +function Test15() { + var serverOptions = {}; + + var clientsOptions = [{ + NPNProtocols: ['a', 'b', 'c'] + }, { + NPNProtocols: ['c', 'b', 'e'] + }, { + NPNProtocols: ['first-priority-unsupported', 'x', 'y'] + }]; + + runTest(clientsOptions, serverOptions, function(results) { + // nothing is selected + checkResults(results[0], {server: {ALPN: false, NPN: 'a'}, + client: {ALPN: false, NPN: false}}); + // nothing is selected + checkResults(results[1], {server: {ALPN: false, NPN: 'c'}, + client: {ALPN: false, NPN: false}}); + // nothing is selected + checkResults(results[2], + {server: {ALPN: false, NPN: 'first-priority-unsupported'}, + client: {ALPN: false, NPN: false}}); + // execute next test + Test16(); + }); +} + +// Server: Nothing, Client: Nothing +function Test16() { + var serverOptions = {}; + + var clientsOptions = [{}, {}, {}]; + + runTest(clientsOptions, serverOptions, function(results) { + // nothing is selected + checkResults(results[0], {server: {ALPN: false, NPN: 'http/1.1'}, + client: {ALPN: false, NPN: false}}); + // nothing is selected + checkResults(results[1], {server: {ALPN: false, NPN: 'http/1.1'}, + client: {ALPN: false, NPN: false}}); + // nothing is selected + checkResults(results[2], + {server: {ALPN: false, NPN: 'http/1.1'}, + client: {ALPN: false, NPN: false}}); + }); +} + +Test1(); diff --git a/test/parallel/test-tls-async-cb-after-socket-end.js b/test/parallel/test-tls-async-cb-after-socket-end.js index 87258cb32c5085..d89a4e9930ca6a 100644 --- a/test/parallel/test-tls-async-cb-after-socket-end.js +++ b/test/parallel/test-tls-async-cb-after-socket-end.js @@ -2,7 +2,6 @@ var common = require('../common'); -var assert = require('assert'); var path = require('path'); var fs = require('fs'); var constants = require('constants'); @@ -36,9 +35,9 @@ server.on('resumeSession', function(id, cb) { next(); }); -server.listen(1443, function() { +server.listen(common.PORT, function() { var clientOpts = { - port: 1443, + port: common.PORT, rejectUnauthorized: false, session: false }; diff --git a/test/parallel/test-tls-cert-regression.js b/test/parallel/test-tls-cert-regression.js index 6e546600b68f6c..4406e53ab0f616 100644 --- a/test/parallel/test-tls-cert-regression.js +++ b/test/parallel/test-tls-cert-regression.js @@ -9,26 +9,29 @@ if (!common.hasCrypto) { var tls = require('tls'); -var cert = '-----BEGIN CERTIFICATE-----\n' + - 'MIIBfjCCASgCCQDmmNjAojbDQjANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJB\n' + - 'VTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0\n' + - 'cyBQdHkgTHRkMCAXDTE0MDExNjE3NTMxM1oYDzIyODcxMDMxMTc1MzEzWjBFMQsw\n' + - 'CQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJu\n' + - 'ZXQgV2lkZ2l0cyBQdHkgTHRkMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAPKwlfMX\n' + - '6HGZIt1xm7fna72eWcOYfUfSxSugghvqYgJt2Oi3lH+wsU1O9FzRIVmpeIjDXhbp\n' + - 'Mjsa1HtzSiccPXsCAwEAATANBgkqhkiG9w0BAQUFAANBAHOoKy0NkyfiYH7Ne5ka\n' + - 'uvCyndyeB4d24FlfqEUlkfaWCZlNKRaV9YhLDiEg3BcIreFo4brtKQfZzTRs0GVm\n' + - 'KHg=\n' + - '-----END CERTIFICATE-----'; -var key = '-----BEGIN RSA PRIVATE KEY-----\n' + - 'MIIBPQIBAAJBAPKwlfMX6HGZIt1xm7fna72eWcOYfUfSxSugghvqYgJt2Oi3lH+w\n' + - 'sU1O9FzRIVmpeIjDXhbpMjsa1HtzSiccPXsCAwEAAQJBAM4uU9aJE0OfdE1p/X+K\n' + - 'LrCT3XMdFCJ24GgmHyOURtwDy18upQJecDVdcZp16fjtOPmaW95GoYRyifB3R4I5\n' + - 'RxECIQD7jRM9slCSVV8xp9kOJQNpHjhRQYVGBn+pyllS2sb+RQIhAPb7Y+BIccri\n' + - 'NWnuhwCW8hA7Fkj/kaBdAwyW7L3Tvui/AiEAiqLCovMecre4Yi6GcsQ1b/6mvSmm\n' + - 'IOS+AT6zIfXPTB0CIQCJKGR3ymN/Qw5crL1GQ41cHCQtF9ickOq/lBUW+j976wIh\n' + - 'AOaJnkQrmurlRdePX6LvN/LgGAQoxwovfjcOYNnZsIVY\n' + - '-----END RSA PRIVATE KEY-----'; +var cert = +`-----BEGIN CERTIFICATE----- +MIIBfjCCASgCCQDmmNjAojbDQjANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJB +VTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0 +cyBQdHkgTHRkMCAXDTE0MDExNjE3NTMxM1oYDzIyODcxMDMxMTc1MzEzWjBFMQsw +CQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJu +ZXQgV2lkZ2l0cyBQdHkgTHRkMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAPKwlfMX +6HGZIt1xm7fna72eWcOYfUfSxSugghvqYgJt2Oi3lH+wsU1O9FzRIVmpeIjDXhbp +Mjsa1HtzSiccPXsCAwEAATANBgkqhkiG9w0BAQUFAANBAHOoKy0NkyfiYH7Ne5ka +uvCyndyeB4d24FlfqEUlkfaWCZlNKRaV9YhLDiEg3BcIreFo4brtKQfZzTRs0GVm +KHg= +-----END CERTIFICATE-----`; + +var key = +`-----BEGIN RSA PRIVATE KEY----- +MIIBPQIBAAJBAPKwlfMX6HGZIt1xm7fna72eWcOYfUfSxSugghvqYgJt2Oi3lH+w +sU1O9FzRIVmpeIjDXhbpMjsa1HtzSiccPXsCAwEAAQJBAM4uU9aJE0OfdE1p/X+K +LrCT3XMdFCJ24GgmHyOURtwDy18upQJecDVdcZp16fjtOPmaW95GoYRyifB3R4I5 +RxECIQD7jRM9slCSVV8xp9kOJQNpHjhRQYVGBn+pyllS2sb+RQIhAPb7Y+BIccri +NWnuhwCW8hA7Fkj/kaBdAwyW7L3Tvui/AiEAiqLCovMecre4Yi6GcsQ1b/6mvSmm +IOS+AT6zIfXPTB0CIQCJKGR3ymN/Qw5crL1GQ41cHCQtF9ickOq/lBUW+j976wIh +AOaJnkQrmurlRdePX6LvN/LgGAQoxwovfjcOYNnZsIVY +-----END RSA PRIVATE KEY-----`; function test(cert, key, cb) { var server = tls.createServer({ diff --git a/test/parallel/test-tls-cipher-list.js b/test/parallel/test-tls-cipher-list.js index 9ae8fefa0f4351..70c99dd91e439c 100644 --- a/test/parallel/test-tls-cipher-list.js +++ b/test/parallel/test-tls-cipher-list.js @@ -12,17 +12,17 @@ const defaultCoreList = require('constants').defaultCoreCipherList; function doCheck(arg, check) { var out = ''; - var arg = arg.concat([ + arg = arg.concat([ '-pe', 'require("constants").defaultCipherList' ]); spawn(process.execPath, arg, {}). - on('error', assert.fail). + on('error', common.fail). stdout.on('data', function(chunk) { out += chunk; }).on('end', function() { assert.equal(out.trim(), check); - }).on('error', assert.fail); + }).on('error', common.fail); } // test the default unmodified version diff --git a/test/parallel/test-tls-client-default-ciphers.js b/test/parallel/test-tls-client-default-ciphers.js index e38671fd6f9de1..9905fc45bdcd24 100644 --- a/test/parallel/test-tls-client-default-ciphers.js +++ b/test/parallel/test-tls-client-default-ciphers.js @@ -19,7 +19,7 @@ function test1() { }; try { - var s = tls.connect(common.PORT); + tls.connect(common.PORT); } catch (e) { assert(e instanceof Done); } diff --git a/test/parallel/test-tls-client-mindhsize.js b/test/parallel/test-tls-client-mindhsize.js index fde3de512cdc26..0921a373c2a8dc 100644 --- a/test/parallel/test-tls-client-mindhsize.js +++ b/test/parallel/test-tls-client-mindhsize.js @@ -75,6 +75,18 @@ function testDHE2048() { testDHE1024(); +assert.throws(() => test(512, true, assert.fail), + /DH parameter is less than 1024 bits/); + +[0, -1, -Infinity, NaN].forEach((minDHSize) => { + assert.throws(() => tls.connect({ minDHSize }), + /minDHSize is not a positive number/); +}); + +[true, false, null, undefined, {}, [], '', '1'].forEach((minDHSize) => { + assert.throws(() => tls.connect({ minDHSize }), /minDHSize is not a number/); +}); + process.on('exit', function() { assert.equal(nsuccess, 1); assert.equal(nerror, 1); diff --git a/test/parallel/test-tls-close-error.js b/test/parallel/test-tls-close-error.js index 5c5a797c280a7d..bd38cb55f7a17b 100644 --- a/test/parallel/test-tls-close-error.js +++ b/test/parallel/test-tls-close-error.js @@ -10,7 +10,6 @@ if (!common.hasCrypto) { var tls = require('tls'); var fs = require('fs'); -var net = require('net'); var errorCount = 0; var closeCount = 0; diff --git a/test/parallel/test-tls-close-notify.js b/test/parallel/test-tls-close-notify.js index 5cc3021ab8dd7e..5545f4512d5f39 100644 --- a/test/parallel/test-tls-close-notify.js +++ b/test/parallel/test-tls-close-notify.js @@ -9,7 +9,6 @@ if (!common.hasCrypto) { var tls = require('tls'); var fs = require('fs'); -var net = require('net'); var ended = 0; diff --git a/test/parallel/test-tls-connect-no-host.js b/test/parallel/test-tls-connect-no-host.js index 75870bea98b4b5..a6ead6ea6dceae 100644 --- a/test/parallel/test-tls-connect-no-host.js +++ b/test/parallel/test-tls-connect-no-host.js @@ -23,12 +23,12 @@ tls.createServer({ }).listen(common.PORT); var socket = tls.connect({ - port: common.PORT, - ca: cert, - // No host set here. 'localhost' is the default, - // but tls.checkServerIdentity() breaks before the fix with: - // Error: Hostname/IP doesn't match certificate's altnames: - // "Host: undefined. is not cert's CN: localhost" + port: common.PORT, + ca: cert, + // No host set here. 'localhost' is the default, + // but tls.checkServerIdentity() breaks before the fix with: + // Error: Hostname/IP doesn't match certificate's altnames: + // "Host: undefined. is not cert's CN: localhost" }, function() { assert(socket.authorized); process.exit(); diff --git a/test/parallel/test-tls-connect-secure-context.js b/test/parallel/test-tls-connect-secure-context.js new file mode 100644 index 00000000000000..c7519ed770fd50 --- /dev/null +++ b/test/parallel/test-tls-connect-secure-context.js @@ -0,0 +1,37 @@ +'use strict'; +const common = require('../common'); + +if (!common.hasCrypto) { + console.log('1..0 # Skipped: missing crypto'); + return; +} +const tls = require('tls'); + +const fs = require('fs'); +const path = require('path'); + +const keysDir = path.join(common.fixturesDir, 'keys'); + +const ca = fs.readFileSync(path.join(keysDir, 'ca1-cert.pem')); +const cert = fs.readFileSync(path.join(keysDir, 'agent1-cert.pem')); +const key = fs.readFileSync(path.join(keysDir, 'agent1-key.pem')); + +const server = tls.createServer({ + cert: cert, + key: key +}, function(c) { + c.end(); +}).listen(common.PORT, function() { + const secureContext = tls.createSecureContext({ + ca: ca + }); + + const socket = tls.connect({ + secureContext: secureContext, + servername: 'agent1', + port: common.PORT + }, common.mustCall(function() { + server.close(); + socket.end(); + })); +}); diff --git a/test/parallel/test-tls-connect-stream-writes.js b/test/parallel/test-tls-connect-stream-writes.js index 4187c9b439e2f1..8fabc7edaeeda0 100644 --- a/test/parallel/test-tls-connect-stream-writes.js +++ b/test/parallel/test-tls-connect-stream-writes.js @@ -1,16 +1,15 @@ 'use strict'; -var assert = require('assert'), - fs = require('fs'), - path = require('path'), - tls = require('tls'), - stream = require('stream'), - net = require('net'); - -var common = require('../common'); +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); +const path = require('path'); +const tls = require('tls'); +const stream = require('stream'); +const net = require('net'); var server; -var cert_dir = path.resolve(__dirname, '../fixtures'), - options = { key: fs.readFileSync(cert_dir + '/test_key.pem'), +var cert_dir = path.resolve(__dirname, '../fixtures'); +var options = { key: fs.readFileSync(cert_dir + '/test_key.pem'), cert: fs.readFileSync(cert_dir + '/test_cert.pem'), ca: [ fs.readFileSync(cert_dir + '/test_ca.pem') ], ciphers: 'AES256-GCM-SHA384' }; diff --git a/test/parallel/test-tls-destroy-whilst-write.js b/test/parallel/test-tls-destroy-whilst-write.js index f42ed1d4ea7702..26c20264735926 100644 --- a/test/parallel/test-tls-destroy-whilst-write.js +++ b/test/parallel/test-tls-destroy-whilst-write.js @@ -1,5 +1,4 @@ 'use strict'; -var assert = require('assert'); var common = require('../common'); if (!common.hasCrypto) { diff --git a/test/parallel/test-tls-ecdh.js b/test/parallel/test-tls-ecdh.js index ce9af395c563ec..a6e16114b955ae 100644 --- a/test/parallel/test-tls-ecdh.js +++ b/test/parallel/test-tls-ecdh.js @@ -14,7 +14,7 @@ var fs = require('fs'); var options = { key: fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem'), cert: fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem'), - ciphers: '-ALL:ECDHE-RSA-RC4-SHA', + ciphers: '-ALL:ECDHE-RSA-AES128-SHA256', ecdhCurve: 'prime256v1' }; diff --git a/test/parallel/test-tls-econnreset.js b/test/parallel/test-tls-econnreset.js index 6ef629a159a948..d60d3852a8aa51 100644 --- a/test/parallel/test-tls-econnreset.js +++ b/test/parallel/test-tls-econnreset.js @@ -8,38 +8,41 @@ if (!common.hasCrypto) { } var tls = require('tls'); -var cacert = '-----BEGIN CERTIFICATE-----\n' + - 'MIIBxTCCAX8CAnXnMA0GCSqGSIb3DQEBBQUAMH0xCzAJBgNVBAYTAlVTMQswCQYD\n' + - 'VQQIEwJDQTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQU3Ryb25n\n' + - 'TG9vcCwgSW5jLjESMBAGA1UECxMJU3Ryb25nT3BzMRowGAYDVQQDExFjYS5zdHJv\n' + - 'bmdsb29wLmNvbTAeFw0xNDAxMTcyMjE1MDdaFw00MTA2MDMyMjE1MDdaMH0xCzAJ\n' + - 'BgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEZ\n' + - 'MBcGA1UEChMQU3Ryb25nTG9vcCwgSW5jLjESMBAGA1UECxMJU3Ryb25nT3BzMRow\n' + - 'GAYDVQQDExFjYS5zdHJvbmdsb29wLmNvbTBMMA0GCSqGSIb3DQEBAQUAAzsAMDgC\n' + - 'MQDKbQ6rIR5t1q1v4Ha36jrq0IkyUohy9EYNvLnXUly1PGqxby0ILlAVJ8JawpY9\n' + - 'AVkCAwEAATANBgkqhkiG9w0BAQUFAAMxALA1uS4CqQXRSAyYTfio5oyLGz71a+NM\n' + - '+0AFLBwh5AQjhGd0FcenU4OfHxyDEOJT/Q==\n' + - '-----END CERTIFICATE-----\n'; +var cacert = +`-----BEGIN CERTIFICATE----- +MIIBxTCCAX8CAnXnMA0GCSqGSIb3DQEBBQUAMH0xCzAJBgNVBAYTAlVTMQswCQYD +VQQIEwJDQTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQU3Ryb25n +TG9vcCwgSW5jLjESMBAGA1UECxMJU3Ryb25nT3BzMRowGAYDVQQDExFjYS5zdHJv +bmdsb29wLmNvbTAeFw0xNDAxMTcyMjE1MDdaFw00MTA2MDMyMjE1MDdaMH0xCzAJ +BgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEZ +MBcGA1UEChMQU3Ryb25nTG9vcCwgSW5jLjESMBAGA1UECxMJU3Ryb25nT3BzMRow +GAYDVQQDExFjYS5zdHJvbmdsb29wLmNvbTBMMA0GCSqGSIb3DQEBAQUAAzsAMDgC +MQDKbQ6rIR5t1q1v4Ha36jrq0IkyUohy9EYNvLnXUly1PGqxby0ILlAVJ8JawpY9 +AVkCAwEAATANBgkqhkiG9w0BAQUFAAMxALA1uS4CqQXRSAyYTfio5oyLGz71a+NM ++0AFLBwh5AQjhGd0FcenU4OfHxyDEOJT/Q== +-----END CERTIFICATE-----`; -var cert = '-----BEGIN CERTIFICATE-----\n' + - 'MIIBfDCCATYCAgQaMA0GCSqGSIb3DQEBBQUAMH0xCzAJBgNVBAYTAlVTMQswCQYD\n' + - 'VQQIEwJDQTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQU3Ryb25n\n' + - 'TG9vcCwgSW5jLjESMBAGA1UECxMJU3Ryb25nT3BzMRowGAYDVQQDExFjYS5zdHJv\n' + - 'bmdsb29wLmNvbTAeFw0xNDAxMTcyMjE1MDdaFw00MTA2MDMyMjE1MDdaMBkxFzAV\n' + - 'BgNVBAMTDnN0cm9uZ2xvb3AuY29tMEwwDQYJKoZIhvcNAQEBBQADOwAwOAIxAMfk\n' + - 'I0LWU15pPUwIQNMnRVhhOibi0TQmAau8FBtgwEfGK01WpfGUaJr1a41K8Uq7xwID\n' + - 'AQABoxkwFzAVBgNVHREEDjAMhwQAAAAAhwR/AAABMA0GCSqGSIb3DQEBBQUAAzEA\n' + - 'cGpYrhkrb7mIh9DNhV0qp7pGjqBzlHqB7KQXw2luLDp//6dyHBMexDCQznkhZKRU\n' + - '-----END CERTIFICATE-----\n'; +var cert = +`-----BEGIN CERTIFICATE----- +MIIBfDCCATYCAgQaMA0GCSqGSIb3DQEBBQUAMH0xCzAJBgNVBAYTAlVTMQswCQYD +VQQIEwJDQTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQU3Ryb25n +TG9vcCwgSW5jLjESMBAGA1UECxMJU3Ryb25nT3BzMRowGAYDVQQDExFjYS5zdHJv +bmdsb29wLmNvbTAeFw0xNDAxMTcyMjE1MDdaFw00MTA2MDMyMjE1MDdaMBkxFzAV +BgNVBAMTDnN0cm9uZ2xvb3AuY29tMEwwDQYJKoZIhvcNAQEBBQADOwAwOAIxAMfk +I0LWU15pPUwIQNMnRVhhOibi0TQmAau8FBtgwEfGK01WpfGUaJr1a41K8Uq7xwID +AQABoxkwFzAVBgNVHREEDjAMhwQAAAAAhwR/AAABMA0GCSqGSIb3DQEBBQUAAzEA +cGpYrhkrb7mIh9DNhV0qp7pGjqBzlHqB7KQXw2luLDp//6dyHBMexDCQznkhZKRU +-----END CERTIFICATE-----`; -var key = '-----BEGIN RSA PRIVATE KEY-----\n' + - 'MIH0AgEAAjEAx+QjQtZTXmk9TAhA0ydFWGE6JuLRNCYBq7wUG2DAR8YrTVal8ZRo\n' + - 'mvVrjUrxSrvHAgMBAAECMBCGccvSwC2r8Z9Zh1JtirQVxaL1WWpAQfmVwLe0bAgg\n' + - '/JWMU/6hS36TsYyZMxwswQIZAPTAfht/zDLb7Hwgu2twsS1Ra9w/yyvtlwIZANET\n' + - '26votwJAHK1yUrZGA5nnp5qcmQ/JUQIZAII5YV/UUZvF9D/fUplJ7puENPWNY9bN\n' + - 'pQIZAMMwxuS3XiO7two2sQF6W+JTYyX1DPCwAQIZAOYg1TvEGT38k8e8jygv8E8w\n' + - 'YqrWTeQFNQ==\n' + - '-----END RSA PRIVATE KEY-----\n'; +var key = +`-----BEGIN RSA PRIVATE KEY----- +MIH0AgEAAjEAx+QjQtZTXmk9TAhA0ydFWGE6JuLRNCYBq7wUG2DAR8YrTVal8ZRo +mvVrjUrxSrvHAgMBAAECMBCGccvSwC2r8Z9Zh1JtirQVxaL1WWpAQfmVwLe0bAgg +/JWMU/6hS36TsYyZMxwswQIZAPTAfht/zDLb7Hwgu2twsS1Ra9w/yyvtlwIZANET +26votwJAHK1yUrZGA5nnp5qcmQ/JUQIZAII5YV/UUZvF9D/fUplJ7puENPWNY9bN +pQIZAMMwxuS3XiO7two2sQF6W+JTYyX1DPCwAQIZAOYg1TvEGT38k8e8jygv8E8w +YqrWTeQFNQ== +-----END RSA PRIVATE KEY-----`; var ca = [ cert, cacert ]; diff --git a/test/parallel/test-tls-external-accessor.js b/test/parallel/test-tls-external-accessor.js new file mode 100644 index 00000000000000..919af0e8f33e4f --- /dev/null +++ b/test/parallel/test-tls-external-accessor.js @@ -0,0 +1,24 @@ +'use strict'; + +const common = require('../common'); +const assert = require('assert'); + +if (!common.hasCrypto) { + console.log('1..0 # Skipped: missing crypto'); + return; +} + +// Ensure accessing ._external doesn't hit an assert in the accessor method. +const tls = require('tls'); +{ + const pctx = tls.createSecureContext().context; + const cctx = Object.create(pctx); + assert.throws(() => cctx._external, /incompatible receiver/); + pctx._external; +} +{ + const pctx = tls.createSecurePair().credentials.context; + const cctx = Object.create(pctx); + assert.throws(() => cctx._external, /incompatible receiver/); + pctx._external; +} diff --git a/test/parallel/test-tls-fast-writing.js b/test/parallel/test-tls-fast-writing.js index 009fa40b631ee5..2a0130c162228d 100644 --- a/test/parallel/test-tls-fast-writing.js +++ b/test/parallel/test-tls-fast-writing.js @@ -20,10 +20,10 @@ var server = tls.createServer(options, onconnection); var gotChunk = false; var gotDrain = false; -var timer = setTimeout(function() { +setTimeout(function() { console.log('not ok - timed out'); process.exit(1); -}, common.platformTimeout(500)); +}, common.platformTimeout(1000)); function onconnection(conn) { conn.on('data', function(c) { diff --git a/test/parallel/test-tls-getcipher.js b/test/parallel/test-tls-getcipher.js index 62209c771cb48c..646d396eca9a86 100644 --- a/test/parallel/test-tls-getcipher.js +++ b/test/parallel/test-tls-getcipher.js @@ -9,7 +9,7 @@ if (!common.hasCrypto) { var tls = require('tls'); var fs = require('fs'); -var cipher_list = ['RC4-SHA', 'AES256-SHA']; +var cipher_list = ['AES128-SHA256', 'AES256-SHA256']; var cipher_version_pattern = /TLS|SSL/; var options = { key: fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem'), diff --git a/test/parallel/test-tls-getprotocol.js b/test/parallel/test-tls-getprotocol.js new file mode 100644 index 00000000000000..67592143ee4875 --- /dev/null +++ b/test/parallel/test-tls-getprotocol.js @@ -0,0 +1,43 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); + +if (!common.hasCrypto) { + console.log('1..0 # Skipped: missing crypto'); + return; +} + +const tls = require('tls'); +const fs = require('fs'); + +const clientConfigs = [ + { secureProtocol: 'TLSv1_method', version: 'TLSv1' }, + { secureProtocol: 'TLSv1_1_method', version: 'TLSv1.1' }, + { secureProtocol: 'TLSv1_2_method', version: 'TLSv1.2' } +]; + +const serverConfig = { + key: fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem'), + cert: fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem') +}; + +const server = tls.createServer(serverConfig, common.mustCall(function() { + +}, clientConfigs.length)).listen(common.PORT, common.localhostIPv4, function() { + let connected = 0; + clientConfigs.forEach(function(v) { + tls.connect({ + host: common.localhostIPv4, + port: common.PORT, + rejectUnauthorized: false, + secureProtocol: v.secureProtocol + }, common.mustCall(function() { + assert.strictEqual(this.getProtocol(), v.version); + this.on('end', common.mustCall(function() { + assert.strictEqual(this.getProtocol(), null); + })).end(); + if (++connected === clientConfigs.length) + server.close(); + })); + }); +}); diff --git a/test/parallel/test-tls-handshake-error.js b/test/parallel/test-tls-handshake-error.js index f33177455f8943..f65440ed93b1a3 100644 --- a/test/parallel/test-tls-handshake-error.js +++ b/test/parallel/test-tls-handshake-error.js @@ -10,7 +10,6 @@ if (!common.hasCrypto) { var tls = require('tls'); var fs = require('fs'); -var net = require('net'); var errorCount = 0; var closeCount = 0; diff --git a/test/parallel/test-tls-handshake-nohang.js b/test/parallel/test-tls-handshake-nohang.js index ae07551ef98088..374ac02a2f45b5 100644 --- a/test/parallel/test-tls-handshake-nohang.js +++ b/test/parallel/test-tls-handshake-nohang.js @@ -1,6 +1,5 @@ 'use strict'; var common = require('../common'); -var assert = require('assert'); if (!common.hasCrypto) { console.log('1..0 # Skipped: missing crypto'); diff --git a/test/parallel/test-tls-honorcipherorder.js b/test/parallel/test-tls-honorcipherorder.js new file mode 100644 index 00000000000000..28c930b07edc28 --- /dev/null +++ b/test/parallel/test-tls-honorcipherorder.js @@ -0,0 +1,98 @@ +'use strict'; +var common = require('../common'); +var assert = require('assert'); + +if (!common.hasCrypto) { + console.log('1..0 # Skipped: missing crypto'); + return; +} +var tls = require('tls'); + +var fs = require('fs'); +var nconns = 0; + +// We explicitly set TLS version to 1.2 so as to be safe when the +// default method is updated in the future +var SSL_Method = 'TLSv1_2_method'; +var localhost = '127.0.0.1'; + +process.on('exit', function() { + assert.equal(nconns, 6); +}); + +function test(honorCipherOrder, clientCipher, expectedCipher, cb) { + var soptions = { + secureProtocol: SSL_Method, + key: fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem'), + cert: fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem'), + ciphers: 'AES256-SHA256:AES128-GCM-SHA256:AES128-SHA256:' + + 'ECDHE-RSA-AES128-GCM-SHA256', + honorCipherOrder: !!honorCipherOrder + }; + + var server = tls.createServer(soptions, function(cleartextStream) { + nconns++; + + // End socket to send CLOSE_NOTIFY and TCP FIN packet, otherwise + // it may hang for ~30 seconds in FIN_WAIT_1 state (at least on OSX). + cleartextStream.end(); + }); + server.listen(common.PORT, localhost, function() { + var coptions = { + rejectUnauthorized: false, + secureProtocol: SSL_Method + }; + if (clientCipher) { + coptions.ciphers = clientCipher; + } + var client = tls.connect(common.PORT, localhost, coptions, function() { + var cipher = client.getCipher(); + client.end(); + server.close(); + assert.equal(cipher.name, expectedCipher); + if (cb) cb(); + }); + }); +} + +test1(); + +function test1() { + // Client has the preference of cipher suites by default + test(false, 'AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256', + 'AES128-GCM-SHA256', test2); +} + +function test2() { + // Server has the preference of cipher suites, and AES256-SHA256 is + // the server's top choice. + test(true, 'AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256', + 'AES256-SHA256', test3); +} + +function test3() { + // Server has the preference of cipher suites. AES128-GCM-SHA256 is given + // higher priority over AES128-SHA256 among client cipher suites. + test(true, 'AES128-SHA256:AES128-GCM-SHA256', 'AES128-GCM-SHA256', test4); + +} + +function test4() { + // As client has only one cipher, server has no choice, irrespective + // of honorCipherOrder. + test(true, 'AES128-SHA256', 'AES128-SHA256', test5); +} + +function test5() { + // Client did not explicitly set ciphers and client offers + // tls.DEFAULT_CIPHERS. All ciphers of the server are included in the + // default list so the negotiated cipher is selected according to the + // server's top preference of AES256-SHA256. + test(true, null, 'AES256-SHA256', test6); +} + +function test6() { + // Ensure that `tls.DEFAULT_CIPHERS` is used + tls.DEFAULT_CIPHERS = 'ECDHE-RSA-AES128-GCM-SHA256'; + test(true, null, 'ECDHE-RSA-AES128-GCM-SHA256'); +} diff --git a/test/parallel/test-tls-inception.js b/test/parallel/test-tls-inception.js index df03cf934fcef6..8946f52bdd63d4 100644 --- a/test/parallel/test-tls-inception.js +++ b/test/parallel/test-tls-inception.js @@ -12,8 +12,9 @@ var fs = require('fs'); var path = require('path'); var net = require('net'); -var options, a, b, portA, portB; -var gotHello = false; +var options, a, b; + +var body = new Buffer(400000).fill('A'); options = { key: fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem')), @@ -31,18 +32,14 @@ a = tls.createServer(options, function(socket) { dest.pipe(socket); socket.pipe(dest); - dest.on('close', function() { + dest.on('end', function() { socket.destroy(); }); }); // the "target" server b = tls.createServer(options, function(socket) { - socket.end('hello'); -}); - -process.on('exit', function() { - assert(gotHello); + socket.end(body); }); a.listen(common.PORT, function() { @@ -59,14 +56,15 @@ a.listen(common.PORT, function() { rejectUnauthorized: false }); ssl.setEncoding('utf8'); - ssl.once('data', function(data) { - assert.equal('hello', data); - gotHello = true; + var buf = ''; + ssl.on('data', function(data) { + buf += data; }); - ssl.on('end', function() { + ssl.on('end', common.mustCall(function() { + assert.equal(buf, body); ssl.end(); a.close(); b.close(); - }); + })); }); }); diff --git a/test/parallel/test-tls-invoke-queued.js b/test/parallel/test-tls-invoke-queued.js index f833108ea3f9e0..efa5c0aa9aa31d 100644 --- a/test/parallel/test-tls-invoke-queued.js +++ b/test/parallel/test-tls-invoke-queued.js @@ -9,7 +9,6 @@ if (!common.hasCrypto) { var tls = require('tls'); var fs = require('fs'); -var net = require('net'); var received = ''; diff --git a/test/parallel/test-tls-junk-server.js b/test/parallel/test-tls-junk-server.js new file mode 100644 index 00000000000000..4eb8129a11dfd6 --- /dev/null +++ b/test/parallel/test-tls-junk-server.js @@ -0,0 +1,29 @@ +'use strict'; +const common = require('../common'); + +if (!common.hasCrypto) { + console.log('1..0 # Skipped: missing crypto'); + return; +} + +const assert = require('assert'); +const https = require('https'); +const net = require('net'); + +const server = net.createServer(function(s) { + s.once('data', function() { + s.end('I was waiting for you, hello!', function() { + s.destroy(); + }); + }); +}); + +server.listen(common.PORT, function() { + const req = https.request({ port: common.PORT }); + req.end(); + + req.once('error', common.mustCall(function(err) { + assert(/unknown protocol/.test(err.message)); + server.close(); + })); +}); diff --git a/test/parallel/test-tls-key-mismatch.js b/test/parallel/test-tls-key-mismatch.js index f7919c545aefb1..2e17a4931078c7 100644 --- a/test/parallel/test-tls-key-mismatch.js +++ b/test/parallel/test-tls-key-mismatch.js @@ -14,8 +14,6 @@ var options = { cert: fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem') }; -var cert = null; - assert.throws(function() { tls.createSecureContext(options); }); diff --git a/test/parallel/test-tls-legacy-onselect.js b/test/parallel/test-tls-legacy-onselect.js index 6f1e9a91a8344c..d3b20d5d8a4cef 100644 --- a/test/parallel/test-tls-legacy-onselect.js +++ b/test/parallel/test-tls-legacy-onselect.js @@ -9,18 +9,8 @@ if (!common.hasCrypto) { var tls = require('tls'); var net = require('net'); -var fs = require('fs'); - var success = false; -function filenamePEM(n) { - return require('path').join(common.fixturesDir, 'keys', n + '.pem'); -} - -function loadPEM(n) { - return fs.readFileSync(filenamePEM(n)); -} - var server = net.Server(function(raw) { var pair = tls.createSecurePair(null, true, false, false); pair.on('error', function() {}); diff --git a/test/parallel/test-tls-max-send-fragment.js b/test/parallel/test-tls-max-send-fragment.js index cc9413b81e78d6..746994a69ca421 100644 --- a/test/parallel/test-tls-max-send-fragment.js +++ b/test/parallel/test-tls-max-send-fragment.js @@ -9,9 +9,6 @@ if (!common.hasCrypto) { var tls = require('tls'); var fs = require('fs'); -var net = require('net'); - -var common = require('../common'); var buf = new Buffer(10000); var received = 0; diff --git a/test/parallel/test-tls-multi-key.js b/test/parallel/test-tls-multi-key.js index 4c9fb4285f6ddb..17b409f284dcba 100644 --- a/test/parallel/test-tls-multi-key.js +++ b/test/parallel/test-tls-multi-key.js @@ -35,8 +35,8 @@ var server = tls.createServer(options, function(conn) { rejectUnauthorized: false }, function() { ciphers.push(rsa.getCipher()); - ecdsa.destroy(); - rsa.destroy(); + ecdsa.end(); + rsa.end(); server.close(); }); }); diff --git a/test/parallel/test-tls-no-rsa-key.js b/test/parallel/test-tls-no-rsa-key.js index 61e8a3b7ca3658..ff9806cdb02614 100644 --- a/test/parallel/test-tls-no-rsa-key.js +++ b/test/parallel/test-tls-no-rsa-key.js @@ -23,9 +23,16 @@ var server = tls.createServer(options, function(conn) { var c = tls.connect(common.PORT, { rejectUnauthorized: false }, function() { + c.on('end', common.mustCall(function() { + c.end(); + server.close(); + })); + + c.on('data', function(data) { + assert.equal(data, 'ok'); + }); + cert = c.getPeerCertificate(); - c.destroy(); - server.close(); }); }); diff --git a/test/parallel/test-tls-no-sslv3.js b/test/parallel/test-tls-no-sslv3.js index 9777397758e3fb..44a8b4e2c0f920 100644 --- a/test/parallel/test-tls-no-sslv3.js +++ b/test/parallel/test-tls-no-sslv3.js @@ -18,7 +18,9 @@ if (common.opensslCli === false) { var cert = fs.readFileSync(common.fixturesDir + '/test_cert.pem'); var key = fs.readFileSync(common.fixturesDir + '/test_key.pem'); -var server = tls.createServer({ cert: cert, key: key }, assert.fail); +var server = tls.createServer({ cert: cert, key: key }, common.fail); +var errors = []; +var stderr = ''; server.listen(common.PORT, '127.0.0.1', function() { var address = this.address().address + ':' + this.address().port; @@ -34,13 +36,25 @@ server.listen(common.PORT, '127.0.0.1', function() { if (common.isWindows) args.push('-no_rand_screen'); - var client = spawn(common.opensslCli, args, { stdio: 'inherit' }); + var client = spawn(common.opensslCli, args, { stdio: 'pipe' }); + client.stdout.pipe(process.stdout); + client.stderr.pipe(process.stderr); + client.stderr.setEncoding('utf8'); + client.stderr.on('data', (data) => stderr += data); + client.once('exit', common.mustCall(function(exitCode) { assert.equal(exitCode, 1); server.close(); })); }); -server.once('clientError', common.mustCall(function(err, conn) { - assert(/:wrong version number/.test(err.message)); -})); +server.on('clientError', (err) => errors.push(err)); + +process.on('exit', function() { + if (/unknown option -ssl3/.test(stderr)) { + console.log('1..0 # Skipped: `openssl s_client -ssl3` not supported.'); + } else { + assert.equal(errors.length, 1); + assert(/:wrong version number/.test(errors[0].message)); + } +}); diff --git a/test/parallel/test-tls-npn-server-client.js b/test/parallel/test-tls-npn-server-client.js index 0a0453633af9ae..d74d65c8b03bd7 100644 --- a/test/parallel/test-tls-npn-server-client.js +++ b/test/parallel/test-tls-npn-server-client.js @@ -5,9 +5,9 @@ if (!process.features.tls_npn) { return; } -var common = require('../common'), - assert = require('assert'), - fs = require('fs'); +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); if (!common.hasCrypto) { console.log('1..0 # Skipped: missing crypto'); @@ -69,8 +69,8 @@ var clientsOptions = [{ rejectUnauthorized: false }]; -var serverResults = [], - clientsResults = []; +const serverResults = []; +const clientsResults = []; var server = tls.createServer(serverOptions, function(c) { serverResults.push(c.npnProtocol); @@ -85,7 +85,7 @@ function startTest() { callback(); }); - }; + } connectClient(clientsOptions[0], function() { connectClient(clientsOptions[1], function() { diff --git a/test/parallel/test-tls-ocsp-callback.js b/test/parallel/test-tls-ocsp-callback.js index d970b2ab013446..e9443f45357995 100644 --- a/test/parallel/test-tls-ocsp-callback.js +++ b/test/parallel/test-tls-ocsp-callback.js @@ -22,11 +22,7 @@ var constants = require('constants'); var fs = require('fs'); var join = require('path').join; -test({ response: false }, function() { - test({ response: 'hello world' }, function() { - test({ ocsp: false }); - }); -}); +var pfx = fs.readFileSync(join(common.fixturesDir, 'keys', 'agent1-pfx.pem')); function test(testOptions, cb) { @@ -45,7 +41,13 @@ function test(testOptions, cb) { var clientSecure = 0; var ocspCount = 0; var ocspResponse; - var session; + + if (testOptions.pfx) { + delete options.key; + delete options.cert; + options.pfx = testOptions.pfx; + options.passphrase = testOptions.passphrase; + } var server = tls.createServer(options, function(cleartext) { cleartext.on('error', function(er) { @@ -106,3 +108,23 @@ function test(testOptions, cb) { assert.equal(ocspCount, 1); }); } + +var tests = [ + { response: false }, + { response: 'hello world' }, + { ocsp: false } +]; + +if (!common.hasFipsCrypto) { + tests.push({ pfx: pfx, passphrase: 'sample', response: 'hello pfx' }); +} + +function runTests(i) { + if (i === tests.length) return; + + test(tests[i], common.mustCall(function() { + runTests(i + 1); + })); +} + +runTests(0); diff --git a/test/parallel/test-tls-parse-cert-string.js b/test/parallel/test-tls-parse-cert-string.js new file mode 100644 index 00000000000000..6607d6974c95b3 --- /dev/null +++ b/test/parallel/test-tls-parse-cert-string.js @@ -0,0 +1,26 @@ +'use strict'; + +require('../common'); +const assert = require('assert'); +const tls = require('tls'); + +const singles = 'C=US\nST=CA\nL=SF\nO=Node.js Foundation\nOU=Node.js\n' + + 'CN=ca1\nemailAddress=ry@clouds.org'; +const singlesOut = tls.parseCertString(singles); +assert.deepEqual(singlesOut, { + C: 'US', + ST: 'CA', + L: 'SF', + O: 'Node.js Foundation', + OU: 'Node.js', + CN: 'ca1', + emailAddress: 'ry@clouds.org' +}); + +const doubles = 'OU=Domain Control Validated\nOU=PositiveSSL Wildcard\n' + + 'CN=*.nodejs.org'; +const doublesOut = tls.parseCertString(doubles); +assert.deepEqual(doublesOut, { + OU: [ 'Domain Control Validated', 'PositiveSSL Wildcard' ], + CN: '*.nodejs.org' +}); diff --git a/test/parallel/test-tls-peer-certificate-encoding.js b/test/parallel/test-tls-peer-certificate-encoding.js index 96cb6944ef6a97..32b1583a0c4840 100644 --- a/test/parallel/test-tls-peer-certificate-encoding.js +++ b/test/parallel/test-tls-peer-certificate-encoding.js @@ -11,7 +11,6 @@ var tls = require('tls'); var fs = require('fs'); var util = require('util'); var join = require('path').join; -var spawn = require('child_process').spawn; var options = { key: fs.readFileSync(join(common.fixturesDir, 'keys', 'agent5-key.pem')), diff --git a/test/parallel/test-tls-peer-certificate-multi-keys.js b/test/parallel/test-tls-peer-certificate-multi-keys.js index fca7a1a77dda67..50ce9037f8d755 100644 --- a/test/parallel/test-tls-peer-certificate-multi-keys.js +++ b/test/parallel/test-tls-peer-certificate-multi-keys.js @@ -11,7 +11,6 @@ var tls = require('tls'); var fs = require('fs'); var util = require('util'); var join = require('path').join; -var spawn = require('child_process').spawn; var options = { key: fs.readFileSync(join(common.fixturesDir, 'agent.key')), diff --git a/test/parallel/test-tls-peer-certificate.js b/test/parallel/test-tls-peer-certificate.js index 3cb0eef2d56268..e043c5933b98ed 100644 --- a/test/parallel/test-tls-peer-certificate.js +++ b/test/parallel/test-tls-peer-certificate.js @@ -11,7 +11,6 @@ var tls = require('tls'); var fs = require('fs'); var util = require('util'); var join = require('path').join; -var spawn = require('child_process').spawn; var options = { key: fs.readFileSync(join(common.fixturesDir, 'keys', 'agent1-key.pem')), @@ -39,6 +38,8 @@ server.listen(common.PORT, function() { assert.equal(peerCert.subject.emailAddress, 'ry@tinyclouds.org'); assert.equal(peerCert.serialNumber, '9A84ABCFB8A72AC0'); assert.equal(peerCert.exponent, '0x10001'); + assert.equal(peerCert.fingerprint, + '8D:06:3A:B3:E5:8B:85:29:72:4F:7D:1B:54:CD:95:19:3C:EF:6F:AA'); assert.deepEqual(peerCert.infoAccess['OCSP - URI'], [ 'http://ocsp.nodejs.org/' ]); diff --git a/test/parallel/test-tls-pfx-gh-5100-regr.js b/test/parallel/test-tls-pfx-gh-5100-regr.js new file mode 100644 index 00000000000000..865ac2ba3f299a --- /dev/null +++ b/test/parallel/test-tls-pfx-gh-5100-regr.js @@ -0,0 +1,36 @@ +'use strict'; + +const common = require('../common'); + +if (!common.hasCrypto) { + console.log('1..0 # Skipped: node compiled without crypto.'); + return; +} + +const assert = require('assert'); +const tls = require('tls'); +const fs = require('fs'); +const path = require('path'); + +const pfx = fs.readFileSync( + path.join(common.fixturesDir, 'keys', 'agent1-pfx.pem')); + +const server = tls.createServer({ + pfx: pfx, + passphrase: 'sample', + requestCert: true, + rejectUnauthorized: false +}, common.mustCall(function(c) { + assert(c.authorizationError === null, 'authorizationError must be null'); + c.end(); +})).listen(common.PORT, function() { + var client = tls.connect({ + port: common.PORT, + pfx: pfx, + passphrase: 'sample', + rejectUnauthorized: false + }, function() { + client.end(); + server.close(); + }); +}); diff --git a/test/parallel/test-tls-regr-gh-5108.js b/test/parallel/test-tls-regr-gh-5108.js new file mode 100644 index 00000000000000..5efcb76eab9c7f --- /dev/null +++ b/test/parallel/test-tls-regr-gh-5108.js @@ -0,0 +1,42 @@ +'use strict'; +const common = require('../common'); + +if (!common.hasCrypto) { + console.log('1..0 # Skipped: missing crypto'); + return; +} + +const assert = require('assert'); +const tls = require('tls'); +const fs = require('fs'); + +const options = { + key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), + cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') +}; + + +const server = tls.createServer(options, function(s) { + s.end('hello'); +}).listen(common.PORT, function() { + const opts = { + port: common.PORT, + rejectUnauthorized: false + }; + const client = tls.connect(opts, function() { + putImmediate(client); + }); +}); + + +function putImmediate(client) { + setImmediate(function() { + if (client.ssl) { + const fd = client.ssl.fd; + assert(!!fd); + putImmediate(client); + } else { + server.close(); + } + }); +} diff --git a/test/parallel/test-tls-request-timeout.js b/test/parallel/test-tls-request-timeout.js index a9b1c78c91a0bf..0db2a613afc9e4 100644 --- a/test/parallel/test-tls-request-timeout.js +++ b/test/parallel/test-tls-request-timeout.js @@ -29,7 +29,7 @@ var server = tls.Server(options, function(socket) { }); server.listen(common.PORT, function() { - var socket = tls.connect({ + tls.connect({ port: common.PORT, rejectUnauthorized: false }); diff --git a/test/parallel/test-tls-securepair-fiftharg.js b/test/parallel/test-tls-securepair-fiftharg.js new file mode 100644 index 00000000000000..b4610117889cc2 --- /dev/null +++ b/test/parallel/test-tls-securepair-fiftharg.js @@ -0,0 +1,27 @@ +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); +const tls = require('tls'); + +const sslcontext = tls.createSecureContext({ + cert: fs.readFileSync(common.fixturesDir + '/test_cert.pem'), + key: fs.readFileSync(common.fixturesDir + '/test_key.pem') +}); + +var catchedServername; +const pair = tls.createSecurePair(sslcontext, true, false, false, { + SNICallback: common.mustCall(function(servername, cb) { + catchedServername = servername; + }) +}); + +// captured traffic from browser's request to https://www.google.com +const sslHello = fs.readFileSync(common.fixturesDir + '/google_ssl_hello.bin'); + +pair.encrypted.write(sslHello); + +process.on('exit', function() { + assert.strictEqual('www.google.com', catchedServername); +}); diff --git a/test/parallel/test-tls-server-connection-server.js b/test/parallel/test-tls-server-connection-server.js new file mode 100644 index 00000000000000..534a16a440ca6c --- /dev/null +++ b/test/parallel/test-tls-server-connection-server.js @@ -0,0 +1,34 @@ +'use strict'; +const common = require('../common'); + +if (!common.hasCrypto) { + console.log('1..0 # Skipped: missing crypto'); + return; +} + +const assert = require('assert'); +const tls = require('tls'); +const fs = require('fs'); + +const options = { + key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), + cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') +}; + +const server = tls.createServer(options, function(s) { + s.end('hello'); +}).listen(common.PORT, function() { + const opts = { + port: common.PORT, + rejectUnauthorized: false + }; + + server.on('connection', common.mustCall(function(socket) { + assert(socket.server === server); + server.close(); + })); + + const client = tls.connect(opts, function() { + client.end(); + }); +}); diff --git a/test/parallel/test-tls-server-verify.js b/test/parallel/test-tls-server-verify.js index fed77357dae04a..c9d4d263f5be7d 100644 --- a/test/parallel/test-tls-server-verify.js +++ b/test/parallel/test-tls-server-verify.js @@ -87,15 +87,14 @@ var testCases = renegotiate: false, CAs: ['ca2-cert'], crl: 'ca2-crl', - clients: - [ + clients: [ { name: 'agent1', shouldReject: true, shouldAuth: false }, { name: 'agent2', shouldReject: true, shouldAuth: false }, { name: 'agent3', shouldReject: false, shouldAuth: true }, // Agent4 has a cert in the CRL. { name: 'agent4', shouldReject: true, shouldAuth: false }, { name: 'nocert', shouldReject: true } - ] + ] } ]; diff --git a/test/parallel/test-tls-set-ciphers.js b/test/parallel/test-tls-set-ciphers.js index a303f6fb277d74..696644cdc43a5b 100644 --- a/test/parallel/test-tls-set-ciphers.js +++ b/test/parallel/test-tls-set-ciphers.js @@ -19,7 +19,7 @@ var fs = require('fs'); var options = { key: fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem'), cert: fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem'), - ciphers: 'RC4-MD5' + ciphers: 'DES-CBC3-SHA' }; var reply = 'I AM THE WALRUS'; // something recognizable diff --git a/test/parallel/test-tls-sni-option.js b/test/parallel/test-tls-sni-option.js index 8ebc0c3af44705..83e62133363677 100644 --- a/test/parallel/test-tls-sni-option.js +++ b/test/parallel/test-tls-sni-option.js @@ -5,9 +5,9 @@ if (!process.features.tls_sni) { return; } -var common = require('../common'), - assert = require('assert'), - fs = require('fs'); +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); if (!common.hasCrypto) { console.log('1..0 # Skipped: missing crypto'); @@ -26,6 +26,8 @@ function loadPEM(n) { var serverOptions = { key: loadPEM('agent2-key'), cert: loadPEM('agent2-cert'), + requestCert: true, + rejectUnauthorized: false, SNICallback: function(servername, callback) { var context = SNIContexts[servername]; @@ -46,7 +48,8 @@ var serverOptions = { var SNIContexts = { 'a.example.com': { key: loadPEM('agent1-key'), - cert: loadPEM('agent1-cert') + cert: loadPEM('agent1-cert'), + ca: [ loadPEM('ca2-cert') ] }, 'b.example.com': { key: loadPEM('agent3-key'), @@ -66,6 +69,13 @@ var clientsOptions = [{ ca: [loadPEM('ca1-cert')], servername: 'a.example.com', rejectUnauthorized: false +}, { + port: serverPort, + key: loadPEM('agent4-key'), + cert: loadPEM('agent4-cert'), + ca: [loadPEM('ca1-cert')], + servername: 'a.example.com', + rejectUnauthorized: false }, { port: serverPort, key: loadPEM('agent2-key'), @@ -89,15 +99,15 @@ var clientsOptions = [{ rejectUnauthorized: false }]; -var serverResults = [], - clientResults = [], - serverErrors = [], - clientErrors = [], - serverError, - clientError; +const serverResults = []; +const clientResults = []; +const serverErrors = []; +const clientErrors = []; +let serverError; +let clientError; var server = tls.createServer(serverOptions, function(c) { - serverResults.push(c.servername); + serverResults.push({ sni: c.servername, authorized: c.authorized }); }); server.on('clientError', function(err) { @@ -136,7 +146,7 @@ function startTest() { else connectClient(i + 1, callback); } - }; + } connectClient(0, function() { server.close(); @@ -144,9 +154,16 @@ function startTest() { } process.on('exit', function() { - assert.deepEqual(serverResults, ['a.example.com', 'b.example.com', - 'c.wrong.com', null]); - assert.deepEqual(clientResults, [true, true, false, false]); - assert.deepEqual(clientErrors, [null, null, null, 'socket hang up']); - assert.deepEqual(serverErrors, [null, null, null, 'Invalid SNI context']); + assert.deepEqual(serverResults, [ + { sni: 'a.example.com', authorized: false }, + { sni: 'a.example.com', authorized: true }, + { sni: 'b.example.com', authorized: false }, + { sni: 'c.wrong.com', authorized: false }, + null + ]); + assert.deepEqual(clientResults, [true, true, true, false, false]); + assert.deepEqual(clientErrors, [null, null, null, null, 'socket hang up']); + assert.deepEqual(serverErrors, [ + null, null, null, null, 'Invalid SNI context' + ]); }); diff --git a/test/parallel/test-tls-sni-server-client.js b/test/parallel/test-tls-sni-server-client.js index bad5e108784353..733713c8e72df8 100644 --- a/test/parallel/test-tls-sni-server-client.js +++ b/test/parallel/test-tls-sni-server-client.js @@ -5,9 +5,9 @@ if (!process.features.tls_sni) { return; } -var common = require('../common'), - assert = require('assert'), - fs = require('fs'); +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); if (!common.hasCrypto) { console.log('1..0 # Skipped: missing crypto'); @@ -73,8 +73,8 @@ var clientsOptions = [{ rejectUnauthorized: false }]; -var serverResults = [], - clientResults = []; +const serverResults = []; +const clientResults = []; var server = tls.createServer(serverOptions, function(c) { serverResults.push(c.servername); @@ -103,7 +103,7 @@ function startTest() { // Continue start(); }); - }; + } start(); } diff --git a/test/parallel/test-tls-socket-default-options.js b/test/parallel/test-tls-socket-default-options.js new file mode 100644 index 00000000000000..c2c6e518bbc4d8 --- /dev/null +++ b/test/parallel/test-tls-socket-default-options.js @@ -0,0 +1,55 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); + +if (!common.hasCrypto) { + console.log('1..0 # Skipped: missing crypto'); + return; +} +const tls = require('tls'); + +const fs = require('fs'); + +const sent = 'hello world'; + +const serverOptions = { + isServer: true, + key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), + cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') +}; + +function testSocketOptions(socket, socketOptions) { + let received = ''; + const server = tls.createServer(serverOptions, function(s) { + s.on('data', function(chunk) { + received += chunk; + }); + + s.on('end', function() { + server.close(); + s.destroy(); + assert.equal(received, sent); + setImmediate(runTests); + }); + }).listen(common.PORT, function() { + const c = new tls.TLSSocket(socket, socketOptions); + c.connect(common.PORT, function() { + c.end(sent); + }); + }); + +} + +const testArgs = [ + [], + [undefined, {}] +]; + +let n = 0; +function runTests() { + if (n++ < testArgs.length) { + testSocketOptions.apply(null, testArgs[n]); + } +} + +runTests(); diff --git a/test/parallel/test-tls-ticket-cluster.js b/test/parallel/test-tls-ticket-cluster.js index fc0f1d5e858d00..1fd1776ca8199f 100644 --- a/test/parallel/test-tls-ticket-cluster.js +++ b/test/parallel/test-tls-ticket-cluster.js @@ -42,7 +42,6 @@ if (cluster.isMaster) { function fork() { var worker = cluster.fork(); - var workerReqCount = 0; worker.on('message', function(msg) { console.error('[master] got %j', msg); if (msg === 'reused') { diff --git a/test/parallel/test-tls-timeout-server.js b/test/parallel/test-tls-timeout-server.js index ee932c9b1fca6d..e3ed246386647f 100644 --- a/test/parallel/test-tls-timeout-server.js +++ b/test/parallel/test-tls-timeout-server.js @@ -23,7 +23,7 @@ var options = { handshakeTimeout: 50 }; -var server = tls.createServer(options, assert.fail); +var server = tls.createServer(options, common.fail); server.on('clientError', function(err, conn) { conn.destroy(); diff --git a/test/parallel/test-tls-two-cas-one-string.js b/test/parallel/test-tls-two-cas-one-string.js new file mode 100644 index 00000000000000..ba9b3609c2653d --- /dev/null +++ b/test/parallel/test-tls-two-cas-one-string.js @@ -0,0 +1,35 @@ +'use strict'; + +const common = require('../common'); +const tls = require('tls'); +const fs = require('fs'); + +const ca1 = + fs.readFileSync(`${common.fixturesDir}/keys/ca1-cert.pem`, 'utf8'); +const ca2 = + fs.readFileSync(`${common.fixturesDir}/keys/ca2-cert.pem`, 'utf8'); +const cert = + fs.readFileSync(`${common.fixturesDir}/keys/agent3-cert.pem`, 'utf8'); +const key = + fs.readFileSync(`${common.fixturesDir}/keys/agent3-key.pem`, 'utf8'); + +function test(ca, next) { + const server = tls.createServer({ ca, cert, key }, function(conn) { + this.close(); + conn.end(); + }); + + server.addContext('agent3', { ca, cert, key }); + + const host = common.localhostIPv4; + const port = common.PORT; + server.listen(port, host, function() { + tls.connect({ servername: 'agent3', host, port, ca }); + }); + + server.once('close', next); +} + +const array = [ca1, ca2]; +const string = ca1 + '\n' + ca2; +test(array, () => test(string, () => {})); diff --git a/test/parallel/test-tls-zero-clear-in.js b/test/parallel/test-tls-zero-clear-in.js index 33db08a78567fb..652d6d176d7324 100644 --- a/test/parallel/test-tls-zero-clear-in.js +++ b/test/parallel/test-tls-zero-clear-in.js @@ -22,7 +22,7 @@ var server = tls.createServer({ }, function(c) { // Nop setTimeout(function() { - c.destroy(); + c.end(); server.close(); }, 20); }).listen(common.PORT, function() { diff --git a/test/parallel/test-tty-stdout-end.js b/test/parallel/test-tty-stdout-end.js index 57f9c03ec449e9..a33a2e5ed27209 100644 --- a/test/parallel/test-tty-stdout-end.js +++ b/test/parallel/test-tty-stdout-end.js @@ -1,6 +1,6 @@ 'use strict'; // Can't test this when 'make test' doesn't assign a tty to the stdout. -const common = require('../common'); +require('../common'); const assert = require('assert'); const shouldThrow = function() { diff --git a/test/parallel/test-tty-wrap.js b/test/parallel/test-tty-wrap.js index dbe7b6890fd218..5e124dc89f7b87 100644 --- a/test/parallel/test-tty-wrap.js +++ b/test/parallel/test-tty-wrap.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var TTY = process.binding('tty_wrap').TTY; diff --git a/test/parallel/test-url.js b/test/parallel/test-url.js index 5098c7e46ab6e6..760303e98bb6bb 100644 --- a/test/parallel/test-url.js +++ b/test/parallel/test-url.js @@ -1,18 +1,17 @@ /* eslint-disable max-len */ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); -var url = require('url'), - util = require('util'); +var url = require('url'); // URLs to parse, and expected data // { url : parsed } var parseTests = { - '//some_path' : { - 'href': '//some_path', - 'pathname': '//some_path', - 'path': '//some_path' + '//some_path': { + href: '//some_path', + pathname: '//some_path', + path: '//some_path' }, 'http:\\\\evil-phisher\\foo.html#h\\a\\s\\h': { @@ -61,496 +60,495 @@ var parseTests = { href: 'http://evil-phisher/foo.html' }, - 'HTTP://www.example.com/' : { - 'href': 'http://www.example.com/', - 'protocol': 'http:', - 'slashes': true, - 'host': 'www.example.com', - 'hostname': 'www.example.com', - 'pathname': '/', - 'path': '/' - }, - - 'HTTP://www.example.com' : { - 'href': 'http://www.example.com/', - 'protocol': 'http:', - 'slashes': true, - 'host': 'www.example.com', - 'hostname': 'www.example.com', - 'pathname': '/', - 'path': '/' - }, - - 'http://www.ExAmPlE.com/' : { - 'href': 'http://www.example.com/', - 'protocol': 'http:', - 'slashes': true, - 'host': 'www.example.com', - 'hostname': 'www.example.com', - 'pathname': '/', - 'path': '/' - }, - - 'http://user:pw@www.ExAmPlE.com/' : { - 'href': 'http://user:pw@www.example.com/', - 'protocol': 'http:', - 'slashes': true, - 'auth': 'user:pw', - 'host': 'www.example.com', - 'hostname': 'www.example.com', - 'pathname': '/', - 'path': '/' - }, - - 'http://USER:PW@www.ExAmPlE.com/' : { - 'href': 'http://USER:PW@www.example.com/', - 'protocol': 'http:', - 'slashes': true, - 'auth': 'USER:PW', - 'host': 'www.example.com', - 'hostname': 'www.example.com', - 'pathname': '/', - 'path': '/' - }, - - 'http://user@www.example.com/' : { - 'href': 'http://user@www.example.com/', - 'protocol': 'http:', - 'slashes': true, - 'auth': 'user', - 'host': 'www.example.com', - 'hostname': 'www.example.com', - 'pathname': '/', - 'path': '/' - }, - - 'http://user%3Apw@www.example.com/' : { - 'href': 'http://user:pw@www.example.com/', - 'protocol': 'http:', - 'slashes': true, - 'auth': 'user:pw', - 'host': 'www.example.com', - 'hostname': 'www.example.com', - 'pathname': '/', - 'path': '/' - }, - - 'http://x.com/path?that\'s#all, folks' : { - 'href': 'http://x.com/path?that%27s#all,%20folks', - 'protocol': 'http:', - 'slashes': true, - 'host': 'x.com', - 'hostname': 'x.com', - 'search': '?that%27s', - 'query': 'that%27s', - 'pathname': '/path', - 'hash': '#all,%20folks', - 'path': '/path?that%27s' - }, - - 'HTTP://X.COM/Y' : { - 'href': 'http://x.com/Y', - 'protocol': 'http:', - 'slashes': true, - 'host': 'x.com', - 'hostname': 'x.com', - 'pathname': '/Y', - 'path': '/Y' + 'HTTP://www.example.com/': { + href: 'http://www.example.com/', + protocol: 'http:', + slashes: true, + host: 'www.example.com', + hostname: 'www.example.com', + pathname: '/', + path: '/' + }, + + 'HTTP://www.example.com': { + href: 'http://www.example.com/', + protocol: 'http:', + slashes: true, + host: 'www.example.com', + hostname: 'www.example.com', + pathname: '/', + path: '/' + }, + + 'http://www.ExAmPlE.com/': { + href: 'http://www.example.com/', + protocol: 'http:', + slashes: true, + host: 'www.example.com', + hostname: 'www.example.com', + pathname: '/', + path: '/' + }, + + 'http://user:pw@www.ExAmPlE.com/': { + href: 'http://user:pw@www.example.com/', + protocol: 'http:', + slashes: true, + auth: 'user:pw', + host: 'www.example.com', + hostname: 'www.example.com', + pathname: '/', + path: '/' + }, + + 'http://USER:PW@www.ExAmPlE.com/': { + href: 'http://USER:PW@www.example.com/', + protocol: 'http:', + slashes: true, + auth: 'USER:PW', + host: 'www.example.com', + hostname: 'www.example.com', + pathname: '/', + path: '/' + }, + + 'http://user@www.example.com/': { + href: 'http://user@www.example.com/', + protocol: 'http:', + slashes: true, + auth: 'user', + host: 'www.example.com', + hostname: 'www.example.com', + pathname: '/', + path: '/' + }, + + 'http://user%3Apw@www.example.com/': { + href: 'http://user:pw@www.example.com/', + protocol: 'http:', + slashes: true, + auth: 'user:pw', + host: 'www.example.com', + hostname: 'www.example.com', + pathname: '/', + path: '/' + }, + + 'http://x.com/path?that\'s#all, folks': { + href: 'http://x.com/path?that%27s#all,%20folks', + protocol: 'http:', + slashes: true, + host: 'x.com', + hostname: 'x.com', + search: '?that%27s', + query: 'that%27s', + pathname: '/path', + hash: '#all,%20folks', + path: '/path?that%27s' + }, + + 'HTTP://X.COM/Y': { + href: 'http://x.com/Y', + protocol: 'http:', + slashes: true, + host: 'x.com', + hostname: 'x.com', + pathname: '/Y', + path: '/Y' }, // + not an invalid host character // per https://url.spec.whatwg.org/#host-parsing - 'http://x.y.com+a/b/c' : { - 'href': 'http://x.y.com+a/b/c', - 'protocol': 'http:', - 'slashes': true, - 'host': 'x.y.com+a', - 'hostname': 'x.y.com+a', - 'pathname': '/b/c', - 'path': '/b/c' + 'http://x.y.com+a/b/c': { + href: 'http://x.y.com+a/b/c', + protocol: 'http:', + slashes: true, + host: 'x.y.com+a', + hostname: 'x.y.com+a', + pathname: '/b/c', + path: '/b/c' }, // an unexpected invalid char in the hostname. - 'HtTp://x.y.cOm;a/b/c?d=e#f gi' : { - 'href': 'http://x.y.com/;a/b/c?d=e#f%20g%3Ch%3Ei', - 'protocol': 'http:', - 'slashes': true, - 'host': 'x.y.com', - 'hostname': 'x.y.com', - 'pathname': ';a/b/c', - 'search': '?d=e', - 'query': 'd=e', - 'hash': '#f%20g%3Ch%3Ei', - 'path': ';a/b/c?d=e' + 'HtTp://x.y.cOm;a/b/c?d=e#f gi': { + href: 'http://x.y.com/;a/b/c?d=e#f%20g%3Ch%3Ei', + protocol: 'http:', + slashes: true, + host: 'x.y.com', + hostname: 'x.y.com', + pathname: ';a/b/c', + search: '?d=e', + query: 'd=e', + hash: '#f%20g%3Ch%3Ei', + path: ';a/b/c?d=e' }, // make sure that we don't accidentally lcast the path parts. - 'HtTp://x.y.cOm;A/b/c?d=e#f gi' : { - 'href': 'http://x.y.com/;A/b/c?d=e#f%20g%3Ch%3Ei', - 'protocol': 'http:', - 'slashes': true, - 'host': 'x.y.com', - 'hostname': 'x.y.com', - 'pathname': ';A/b/c', - 'search': '?d=e', - 'query': 'd=e', - 'hash': '#f%20g%3Ch%3Ei', - 'path': ';A/b/c?d=e' + 'HtTp://x.y.cOm;A/b/c?d=e#f gi': { + href: 'http://x.y.com/;A/b/c?d=e#f%20g%3Ch%3Ei', + protocol: 'http:', + slashes: true, + host: 'x.y.com', + hostname: 'x.y.com', + pathname: ';A/b/c', + search: '?d=e', + query: 'd=e', + hash: '#f%20g%3Ch%3Ei', + path: ';A/b/c?d=e' }, 'http://x...y...#p': { - 'href': 'http://x...y.../#p', - 'protocol': 'http:', - 'slashes': true, - 'host': 'x...y...', - 'hostname': 'x...y...', - 'hash': '#p', - 'pathname': '/', - 'path': '/' + href: 'http://x...y.../#p', + protocol: 'http:', + slashes: true, + host: 'x...y...', + hostname: 'x...y...', + hash: '#p', + pathname: '/', + path: '/' }, 'http://x/p/"quoted"': { - 'href': 'http://x/p/%22quoted%22', - 'protocol': 'http:', - 'slashes': true, - 'host': 'x', - 'hostname': 'x', - 'pathname': '/p/%22quoted%22', - 'path': '/p/%22quoted%22' + href: 'http://x/p/%22quoted%22', + protocol: 'http:', + slashes: true, + host: 'x', + hostname: 'x', + pathname: '/p/%22quoted%22', + path: '/p/%22quoted%22' }, ' Is a URL!': { - 'href': '%3Chttp://goo.corn/bread%3E%20Is%20a%20URL!', - 'pathname': '%3Chttp://goo.corn/bread%3E%20Is%20a%20URL!', - 'path': '%3Chttp://goo.corn/bread%3E%20Is%20a%20URL!' - }, - - 'http://www.narwhaljs.org/blog/categories?id=news' : { - 'href': 'http://www.narwhaljs.org/blog/categories?id=news', - 'protocol': 'http:', - 'slashes': true, - 'host': 'www.narwhaljs.org', - 'hostname': 'www.narwhaljs.org', - 'search': '?id=news', - 'query': 'id=news', - 'pathname': '/blog/categories', - 'path': '/blog/categories?id=news' - }, - - 'http://mt0.google.com/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=' : { - 'href': 'http://mt0.google.com/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=', - 'protocol': 'http:', - 'slashes': true, - 'host': 'mt0.google.com', - 'hostname': 'mt0.google.com', - 'pathname': '/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=', - 'path': '/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=' - }, - - 'http://mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=' : { - 'href': 'http://mt0.google.com/vt/lyrs=m@114???&hl=en&src=api' + - '&x=2&y=2&z=3&s=', - 'protocol': 'http:', - 'slashes': true, - 'host': 'mt0.google.com', - 'hostname': 'mt0.google.com', - 'search': '???&hl=en&src=api&x=2&y=2&z=3&s=', - 'query': '??&hl=en&src=api&x=2&y=2&z=3&s=', - 'pathname': '/vt/lyrs=m@114', - 'path': '/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=' - }, - - 'http://user:pass@mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=': - { - 'href': 'http://user:pass@mt0.google.com/vt/lyrs=m@114???' + - '&hl=en&src=api&x=2&y=2&z=3&s=', - 'protocol': 'http:', - 'slashes': true, - 'host': 'mt0.google.com', - 'auth': 'user:pass', - 'hostname': 'mt0.google.com', - 'search': '???&hl=en&src=api&x=2&y=2&z=3&s=', - 'query': '??&hl=en&src=api&x=2&y=2&z=3&s=', - 'pathname': '/vt/lyrs=m@114', - 'path': '/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=' - }, - - 'file:///etc/passwd' : { - 'href': 'file:///etc/passwd', - 'slashes': true, - 'protocol': 'file:', - 'pathname': '/etc/passwd', - 'hostname': '', - 'host': '', - 'path': '/etc/passwd' - }, - - 'file://localhost/etc/passwd' : { - 'href': 'file://localhost/etc/passwd', - 'protocol': 'file:', - 'slashes': true, - 'pathname': '/etc/passwd', - 'hostname': 'localhost', - 'host': 'localhost', - 'path': '/etc/passwd' - }, - - 'file://foo/etc/passwd' : { - 'href': 'file://foo/etc/passwd', - 'protocol': 'file:', - 'slashes': true, - 'pathname': '/etc/passwd', - 'hostname': 'foo', - 'host': 'foo', - 'path': '/etc/passwd' - }, - - 'file:///etc/node/' : { - 'href': 'file:///etc/node/', - 'slashes': true, - 'protocol': 'file:', - 'pathname': '/etc/node/', - 'hostname': '', - 'host': '', - 'path': '/etc/node/' - }, - - 'file://localhost/etc/node/' : { - 'href': 'file://localhost/etc/node/', - 'protocol': 'file:', - 'slashes': true, - 'pathname': '/etc/node/', - 'hostname': 'localhost', - 'host': 'localhost', - 'path': '/etc/node/' - }, - - 'file://foo/etc/node/' : { - 'href': 'file://foo/etc/node/', - 'protocol': 'file:', - 'slashes': true, - 'pathname': '/etc/node/', - 'hostname': 'foo', - 'host': 'foo', - 'path': '/etc/node/' - }, - - 'http:/baz/../foo/bar' : { - 'href': 'http:/baz/../foo/bar', - 'protocol': 'http:', - 'pathname': '/baz/../foo/bar', - 'path': '/baz/../foo/bar' - }, - - 'http://user:pass@example.com:8000/foo/bar?baz=quux#frag' : { - 'href': 'http://user:pass@example.com:8000/foo/bar?baz=quux#frag', - 'protocol': 'http:', - 'slashes': true, - 'host': 'example.com:8000', - 'auth': 'user:pass', - 'port': '8000', - 'hostname': 'example.com', - 'hash': '#frag', - 'search': '?baz=quux', - 'query': 'baz=quux', - 'pathname': '/foo/bar', - 'path': '/foo/bar?baz=quux' - }, - - '//user:pass@example.com:8000/foo/bar?baz=quux#frag' : { - 'href': '//user:pass@example.com:8000/foo/bar?baz=quux#frag', - 'slashes': true, - 'host': 'example.com:8000', - 'auth': 'user:pass', - 'port': '8000', - 'hostname': 'example.com', - 'hash': '#frag', - 'search': '?baz=quux', - 'query': 'baz=quux', - 'pathname': '/foo/bar', - 'path': '/foo/bar?baz=quux' - }, - - '/foo/bar?baz=quux#frag' : { - 'href': '/foo/bar?baz=quux#frag', - 'hash': '#frag', - 'search': '?baz=quux', - 'query': 'baz=quux', - 'pathname': '/foo/bar', - 'path': '/foo/bar?baz=quux' - }, - - 'http:/foo/bar?baz=quux#frag' : { - 'href': 'http:/foo/bar?baz=quux#frag', - 'protocol': 'http:', - 'hash': '#frag', - 'search': '?baz=quux', - 'query': 'baz=quux', - 'pathname': '/foo/bar', - 'path': '/foo/bar?baz=quux' - }, - - 'mailto:foo@bar.com?subject=hello' : { - 'href': 'mailto:foo@bar.com?subject=hello', - 'protocol': 'mailto:', - 'host': 'bar.com', - 'auth' : 'foo', - 'hostname' : 'bar.com', - 'search': '?subject=hello', - 'query': 'subject=hello', - 'path': '?subject=hello' - }, - - 'javascript:alert(\'hello\');' : { - 'href': 'javascript:alert(\'hello\');', - 'protocol': 'javascript:', - 'pathname': 'alert(\'hello\');', - 'path': 'alert(\'hello\');' - }, - - 'xmpp:isaacschlueter@jabber.org' : { - 'href': 'xmpp:isaacschlueter@jabber.org', - 'protocol': 'xmpp:', - 'host': 'jabber.org', - 'auth': 'isaacschlueter', - 'hostname': 'jabber.org' - }, - - 'http://atpass:foo%40bar@127.0.0.1:8080/path?search=foo#bar' : { - 'href' : 'http://atpass:foo%40bar@127.0.0.1:8080/path?search=foo#bar', - 'protocol' : 'http:', - 'slashes': true, - 'host' : '127.0.0.1:8080', - 'auth' : 'atpass:foo@bar', - 'hostname' : '127.0.0.1', - 'port' : '8080', - 'pathname': '/path', - 'search' : '?search=foo', - 'query' : 'search=foo', - 'hash' : '#bar', - 'path': '/path?search=foo' + href: '%3Chttp://goo.corn/bread%3E%20Is%20a%20URL!', + pathname: '%3Chttp://goo.corn/bread%3E%20Is%20a%20URL!', + path: '%3Chttp://goo.corn/bread%3E%20Is%20a%20URL!' + }, + + 'http://www.narwhaljs.org/blog/categories?id=news': { + href: 'http://www.narwhaljs.org/blog/categories?id=news', + protocol: 'http:', + slashes: true, + host: 'www.narwhaljs.org', + hostname: 'www.narwhaljs.org', + search: '?id=news', + query: 'id=news', + pathname: '/blog/categories', + path: '/blog/categories?id=news' + }, + + 'http://mt0.google.com/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=': { + href: 'http://mt0.google.com/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=', + protocol: 'http:', + slashes: true, + host: 'mt0.google.com', + hostname: 'mt0.google.com', + pathname: '/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=', + path: '/vt/lyrs=m@114&hl=en&src=api&x=2&y=2&z=3&s=' + }, + + 'http://mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=': { + href: 'http://mt0.google.com/vt/lyrs=m@114???&hl=en&src=api' + + '&x=2&y=2&z=3&s=', + protocol: 'http:', + slashes: true, + host: 'mt0.google.com', + hostname: 'mt0.google.com', + search: '???&hl=en&src=api&x=2&y=2&z=3&s=', + query: '??&hl=en&src=api&x=2&y=2&z=3&s=', + pathname: '/vt/lyrs=m@114', + path: '/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=' + }, + + 'http://user:pass@mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=': { + href: 'http://user:pass@mt0.google.com/vt/lyrs=m@114???' + + '&hl=en&src=api&x=2&y=2&z=3&s=', + protocol: 'http:', + slashes: true, + host: 'mt0.google.com', + auth: 'user:pass', + hostname: 'mt0.google.com', + search: '???&hl=en&src=api&x=2&y=2&z=3&s=', + query: '??&hl=en&src=api&x=2&y=2&z=3&s=', + pathname: '/vt/lyrs=m@114', + path: '/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=' + }, + + 'file:///etc/passwd': { + href: 'file:///etc/passwd', + slashes: true, + protocol: 'file:', + pathname: '/etc/passwd', + hostname: '', + host: '', + path: '/etc/passwd' + }, + + 'file://localhost/etc/passwd': { + href: 'file://localhost/etc/passwd', + protocol: 'file:', + slashes: true, + pathname: '/etc/passwd', + hostname: 'localhost', + host: 'localhost', + path: '/etc/passwd' + }, + + 'file://foo/etc/passwd': { + href: 'file://foo/etc/passwd', + protocol: 'file:', + slashes: true, + pathname: '/etc/passwd', + hostname: 'foo', + host: 'foo', + path: '/etc/passwd' + }, + + 'file:///etc/node/': { + href: 'file:///etc/node/', + slashes: true, + protocol: 'file:', + pathname: '/etc/node/', + hostname: '', + host: '', + path: '/etc/node/' + }, + + 'file://localhost/etc/node/': { + href: 'file://localhost/etc/node/', + protocol: 'file:', + slashes: true, + pathname: '/etc/node/', + hostname: 'localhost', + host: 'localhost', + path: '/etc/node/' + }, + + 'file://foo/etc/node/': { + href: 'file://foo/etc/node/', + protocol: 'file:', + slashes: true, + pathname: '/etc/node/', + hostname: 'foo', + host: 'foo', + path: '/etc/node/' + }, + + 'http:/baz/../foo/bar': { + href: 'http:/baz/../foo/bar', + protocol: 'http:', + pathname: '/baz/../foo/bar', + path: '/baz/../foo/bar' + }, + + 'http://user:pass@example.com:8000/foo/bar?baz=quux#frag': { + href: 'http://user:pass@example.com:8000/foo/bar?baz=quux#frag', + protocol: 'http:', + slashes: true, + host: 'example.com:8000', + auth: 'user:pass', + port: '8000', + hostname: 'example.com', + hash: '#frag', + search: '?baz=quux', + query: 'baz=quux', + pathname: '/foo/bar', + path: '/foo/bar?baz=quux' + }, + + '//user:pass@example.com:8000/foo/bar?baz=quux#frag': { + href: '//user:pass@example.com:8000/foo/bar?baz=quux#frag', + slashes: true, + host: 'example.com:8000', + auth: 'user:pass', + port: '8000', + hostname: 'example.com', + hash: '#frag', + search: '?baz=quux', + query: 'baz=quux', + pathname: '/foo/bar', + path: '/foo/bar?baz=quux' + }, + + '/foo/bar?baz=quux#frag': { + href: '/foo/bar?baz=quux#frag', + hash: '#frag', + search: '?baz=quux', + query: 'baz=quux', + pathname: '/foo/bar', + path: '/foo/bar?baz=quux' + }, + + 'http:/foo/bar?baz=quux#frag': { + href: 'http:/foo/bar?baz=quux#frag', + protocol: 'http:', + hash: '#frag', + search: '?baz=quux', + query: 'baz=quux', + pathname: '/foo/bar', + path: '/foo/bar?baz=quux' + }, + + 'mailto:foo@bar.com?subject=hello': { + href: 'mailto:foo@bar.com?subject=hello', + protocol: 'mailto:', + host: 'bar.com', + auth: 'foo', + hostname: 'bar.com', + search: '?subject=hello', + query: 'subject=hello', + path: '?subject=hello' + }, + + 'javascript:alert(\'hello\');': { + href: 'javascript:alert(\'hello\');', + protocol: 'javascript:', + pathname: 'alert(\'hello\');', + path: 'alert(\'hello\');' + }, + + 'xmpp:isaacschlueter@jabber.org': { + href: 'xmpp:isaacschlueter@jabber.org', + protocol: 'xmpp:', + host: 'jabber.org', + auth: 'isaacschlueter', + hostname: 'jabber.org' + }, + + 'http://atpass:foo%40bar@127.0.0.1:8080/path?search=foo#bar': { + href: 'http://atpass:foo%40bar@127.0.0.1:8080/path?search=foo#bar', + protocol: 'http:', + slashes: true, + host: '127.0.0.1:8080', + auth: 'atpass:foo@bar', + hostname: '127.0.0.1', + port: '8080', + pathname: '/path', + search: '?search=foo', + query: 'search=foo', + hash: '#bar', + path: '/path?search=foo' }, 'svn+ssh://foo/bar': { - 'href': 'svn+ssh://foo/bar', - 'host': 'foo', - 'hostname': 'foo', - 'protocol': 'svn+ssh:', - 'pathname': '/bar', - 'path': '/bar', - 'slashes': true + href: 'svn+ssh://foo/bar', + host: 'foo', + hostname: 'foo', + protocol: 'svn+ssh:', + pathname: '/bar', + path: '/bar', + slashes: true }, 'dash-test://foo/bar': { - 'href': 'dash-test://foo/bar', - 'host': 'foo', - 'hostname': 'foo', - 'protocol': 'dash-test:', - 'pathname': '/bar', - 'path': '/bar', - 'slashes': true + href: 'dash-test://foo/bar', + host: 'foo', + hostname: 'foo', + protocol: 'dash-test:', + pathname: '/bar', + path: '/bar', + slashes: true }, 'dash-test:foo/bar': { - 'href': 'dash-test:foo/bar', - 'host': 'foo', - 'hostname': 'foo', - 'protocol': 'dash-test:', - 'pathname': '/bar', - 'path': '/bar' + href: 'dash-test:foo/bar', + host: 'foo', + hostname: 'foo', + protocol: 'dash-test:', + pathname: '/bar', + path: '/bar' }, 'dot.test://foo/bar': { - 'href': 'dot.test://foo/bar', - 'host': 'foo', - 'hostname': 'foo', - 'protocol': 'dot.test:', - 'pathname': '/bar', - 'path': '/bar', - 'slashes': true + href: 'dot.test://foo/bar', + host: 'foo', + hostname: 'foo', + protocol: 'dot.test:', + pathname: '/bar', + path: '/bar', + slashes: true }, 'dot.test:foo/bar': { - 'href': 'dot.test:foo/bar', - 'host': 'foo', - 'hostname': 'foo', - 'protocol': 'dot.test:', - 'pathname': '/bar', - 'path': '/bar' + href: 'dot.test:foo/bar', + host: 'foo', + hostname: 'foo', + protocol: 'dot.test:', + pathname: '/bar', + path: '/bar' }, // IDNA tests - 'http://www.日本語.com/' : { - 'href': 'http://www.xn--wgv71a119e.com/', - 'protocol': 'http:', - 'slashes': true, - 'host': 'www.xn--wgv71a119e.com', - 'hostname': 'www.xn--wgv71a119e.com', - 'pathname': '/', - 'path': '/' - }, - - 'http://example.Bücher.com/' : { - 'href': 'http://example.xn--bcher-kva.com/', - 'protocol': 'http:', - 'slashes': true, - 'host': 'example.xn--bcher-kva.com', - 'hostname': 'example.xn--bcher-kva.com', - 'pathname': '/', - 'path': '/' - }, - - 'http://www.Äffchen.com/' : { - 'href': 'http://www.xn--ffchen-9ta.com/', - 'protocol': 'http:', - 'slashes': true, - 'host': 'www.xn--ffchen-9ta.com', - 'hostname': 'www.xn--ffchen-9ta.com', - 'pathname': '/', - 'path': '/' - }, - - 'http://www.Äffchen.cOm;A/b/c?d=e#f gi' : { - 'href': 'http://www.xn--ffchen-9ta.com/;A/b/c?d=e#f%20g%3Ch%3Ei', - 'protocol': 'http:', - 'slashes': true, - 'host': 'www.xn--ffchen-9ta.com', - 'hostname': 'www.xn--ffchen-9ta.com', - 'pathname': ';A/b/c', - 'search': '?d=e', - 'query': 'd=e', - 'hash': '#f%20g%3Ch%3Ei', - 'path': ';A/b/c?d=e' - }, - - 'http://SÉLIER.COM/' : { - 'href': 'http://xn--slier-bsa.com/', - 'protocol': 'http:', - 'slashes': true, - 'host': 'xn--slier-bsa.com', - 'hostname': 'xn--slier-bsa.com', - 'pathname': '/', - 'path': '/' - }, - - 'http://ليهمابتكلموشعربي؟.ي؟/' : { - 'href': 'http://xn--egbpdaj6bu4bxfgehfvwxn.xn--egb9f/', - 'protocol': 'http:', - 'slashes': true, - 'host': 'xn--egbpdaj6bu4bxfgehfvwxn.xn--egb9f', - 'hostname': 'xn--egbpdaj6bu4bxfgehfvwxn.xn--egb9f', - 'pathname': '/', - 'path': '/' - }, - - 'http://➡.ws/➡' : { - 'href': 'http://xn--hgi.ws/➡', - 'protocol': 'http:', - 'slashes': true, - 'host': 'xn--hgi.ws', - 'hostname': 'xn--hgi.ws', - 'pathname': '/➡', - 'path': '/➡' + 'http://www.日本語.com/': { + href: 'http://www.xn--wgv71a119e.com/', + protocol: 'http:', + slashes: true, + host: 'www.xn--wgv71a119e.com', + hostname: 'www.xn--wgv71a119e.com', + pathname: '/', + path: '/' + }, + + 'http://example.Bücher.com/': { + href: 'http://example.xn--bcher-kva.com/', + protocol: 'http:', + slashes: true, + host: 'example.xn--bcher-kva.com', + hostname: 'example.xn--bcher-kva.com', + pathname: '/', + path: '/' + }, + + 'http://www.Äffchen.com/': { + href: 'http://www.xn--ffchen-9ta.com/', + protocol: 'http:', + slashes: true, + host: 'www.xn--ffchen-9ta.com', + hostname: 'www.xn--ffchen-9ta.com', + pathname: '/', + path: '/' + }, + + 'http://www.Äffchen.cOm;A/b/c?d=e#f gi': { + href: 'http://www.xn--ffchen-9ta.com/;A/b/c?d=e#f%20g%3Ch%3Ei', + protocol: 'http:', + slashes: true, + host: 'www.xn--ffchen-9ta.com', + hostname: 'www.xn--ffchen-9ta.com', + pathname: ';A/b/c', + search: '?d=e', + query: 'd=e', + hash: '#f%20g%3Ch%3Ei', + path: ';A/b/c?d=e' + }, + + 'http://SÉLIER.COM/': { + href: 'http://xn--slier-bsa.com/', + protocol: 'http:', + slashes: true, + host: 'xn--slier-bsa.com', + hostname: 'xn--slier-bsa.com', + pathname: '/', + path: '/' + }, + + 'http://ليهمابتكلموشعربي؟.ي؟/': { + href: 'http://xn--egbpdaj6bu4bxfgehfvwxn.xn--egb9f/', + protocol: 'http:', + slashes: true, + host: 'xn--egbpdaj6bu4bxfgehfvwxn.xn--egb9f', + hostname: 'xn--egbpdaj6bu4bxfgehfvwxn.xn--egb9f', + pathname: '/', + path: '/' + }, + + 'http://➡.ws/➡': { + href: 'http://xn--hgi.ws/➡', + protocol: 'http:', + slashes: true, + host: 'xn--hgi.ws', + hostname: 'xn--hgi.ws', + pathname: '/➡', + path: '/➡' }, 'http://bucket_name.s3.amazonaws.com/image.jpg': { @@ -560,7 +558,7 @@ var parseTests = { hostname: 'bucket_name.s3.amazonaws.com', pathname: '/image.jpg', href: 'http://bucket_name.s3.amazonaws.com/image.jpg', - 'path': '/image.jpg' + path: '/image.jpg' }, 'git+http://github.com/joyent/node.git': { @@ -577,216 +575,216 @@ var parseTests = { //be parse into auth@hostname, but here there is no //way to make it work in url.parse, I add the test to be explicit 'local1@domain1': { - 'pathname': 'local1@domain1', - 'path': 'local1@domain1', - 'href': 'local1@domain1' + pathname: 'local1@domain1', + path: 'local1@domain1', + href: 'local1@domain1' }, //While this may seem counter-intuitive, a browser will parse // as a path. - 'www.example.com' : { - 'href': 'www.example.com', - 'pathname': 'www.example.com', - 'path': 'www.example.com' + 'www.example.com': { + href: 'www.example.com', + pathname: 'www.example.com', + path: 'www.example.com' }, // ipv6 support '[fe80::1]': { - 'href': '[fe80::1]', - 'pathname': '[fe80::1]', - 'path': '[fe80::1]' + href: '[fe80::1]', + pathname: '[fe80::1]', + path: '[fe80::1]' }, 'coap://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]': { - 'protocol': 'coap:', - 'slashes': true, - 'host': '[fedc:ba98:7654:3210:fedc:ba98:7654:3210]', - 'hostname': 'fedc:ba98:7654:3210:fedc:ba98:7654:3210', - 'href': 'coap://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/', - 'pathname': '/', - 'path': '/' + protocol: 'coap:', + slashes: true, + host: '[fedc:ba98:7654:3210:fedc:ba98:7654:3210]', + hostname: 'fedc:ba98:7654:3210:fedc:ba98:7654:3210', + href: 'coap://[fedc:ba98:7654:3210:fedc:ba98:7654:3210]/', + pathname: '/', + path: '/' }, 'coap://[1080:0:0:0:8:800:200C:417A]:61616/': { - 'protocol': 'coap:', - 'slashes': true, - 'host': '[1080:0:0:0:8:800:200c:417a]:61616', - 'port': '61616', - 'hostname': '1080:0:0:0:8:800:200c:417a', - 'href': 'coap://[1080:0:0:0:8:800:200c:417a]:61616/', - 'pathname': '/', - 'path': '/' + protocol: 'coap:', + slashes: true, + host: '[1080:0:0:0:8:800:200c:417a]:61616', + port: '61616', + hostname: '1080:0:0:0:8:800:200c:417a', + href: 'coap://[1080:0:0:0:8:800:200c:417a]:61616/', + pathname: '/', + path: '/' }, 'http://user:password@[3ffe:2a00:100:7031::1]:8080': { - 'protocol': 'http:', - 'slashes': true, - 'auth': 'user:password', - 'host': '[3ffe:2a00:100:7031::1]:8080', - 'port': '8080', - 'hostname': '3ffe:2a00:100:7031::1', - 'href': 'http://user:password@[3ffe:2a00:100:7031::1]:8080/', - 'pathname': '/', - 'path': '/' + protocol: 'http:', + slashes: true, + auth: 'user:password', + host: '[3ffe:2a00:100:7031::1]:8080', + port: '8080', + hostname: '3ffe:2a00:100:7031::1', + href: 'http://user:password@[3ffe:2a00:100:7031::1]:8080/', + pathname: '/', + path: '/' }, 'coap://u:p@[::192.9.5.5]:61616/.well-known/r?n=Temperature': { - 'protocol': 'coap:', - 'slashes': true, - 'auth': 'u:p', - 'host': '[::192.9.5.5]:61616', - 'port': '61616', - 'hostname': '::192.9.5.5', - 'href': 'coap://u:p@[::192.9.5.5]:61616/.well-known/r?n=Temperature', - 'search': '?n=Temperature', - 'query': 'n=Temperature', - 'pathname': '/.well-known/r', - 'path': '/.well-known/r?n=Temperature' + protocol: 'coap:', + slashes: true, + auth: 'u:p', + host: '[::192.9.5.5]:61616', + port: '61616', + hostname: '::192.9.5.5', + href: 'coap://u:p@[::192.9.5.5]:61616/.well-known/r?n=Temperature', + search: '?n=Temperature', + query: 'n=Temperature', + pathname: '/.well-known/r', + path: '/.well-known/r?n=Temperature' }, // empty port 'http://example.com:': { - 'protocol': 'http:', - 'slashes': true, - 'host': 'example.com', - 'hostname': 'example.com', - 'href': 'http://example.com/', - 'pathname': '/', - 'path': '/' + protocol: 'http:', + slashes: true, + host: 'example.com', + hostname: 'example.com', + href: 'http://example.com/', + pathname: '/', + path: '/' }, 'http://example.com:/a/b.html': { - 'protocol': 'http:', - 'slashes': true, - 'host': 'example.com', - 'hostname': 'example.com', - 'href': 'http://example.com/a/b.html', - 'pathname': '/a/b.html', - 'path': '/a/b.html' + protocol: 'http:', + slashes: true, + host: 'example.com', + hostname: 'example.com', + href: 'http://example.com/a/b.html', + pathname: '/a/b.html', + path: '/a/b.html' }, 'http://example.com:?a=b': { - 'protocol': 'http:', - 'slashes': true, - 'host': 'example.com', - 'hostname': 'example.com', - 'href': 'http://example.com/?a=b', - 'search': '?a=b', - 'query': 'a=b', - 'pathname': '/', - 'path': '/?a=b' + protocol: 'http:', + slashes: true, + host: 'example.com', + hostname: 'example.com', + href: 'http://example.com/?a=b', + search: '?a=b', + query: 'a=b', + pathname: '/', + path: '/?a=b' }, 'http://example.com:#abc': { - 'protocol': 'http:', - 'slashes': true, - 'host': 'example.com', - 'hostname': 'example.com', - 'href': 'http://example.com/#abc', - 'hash': '#abc', - 'pathname': '/', - 'path': '/' + protocol: 'http:', + slashes: true, + host: 'example.com', + hostname: 'example.com', + href: 'http://example.com/#abc', + hash: '#abc', + pathname: '/', + path: '/' }, 'http://[fe80::1]:/a/b?a=b#abc': { - 'protocol': 'http:', - 'slashes': true, - 'host': '[fe80::1]', - 'hostname': 'fe80::1', - 'href': 'http://[fe80::1]/a/b?a=b#abc', - 'search': '?a=b', - 'query': 'a=b', - 'hash': '#abc', - 'pathname': '/a/b', - 'path': '/a/b?a=b' + protocol: 'http:', + slashes: true, + host: '[fe80::1]', + hostname: 'fe80::1', + href: 'http://[fe80::1]/a/b?a=b#abc', + search: '?a=b', + query: 'a=b', + hash: '#abc', + pathname: '/a/b', + path: '/a/b?a=b' }, 'http://-lovemonsterz.tumblr.com/rss': { - 'protocol': 'http:', - 'slashes': true, - 'host': '-lovemonsterz.tumblr.com', - 'hostname': '-lovemonsterz.tumblr.com', - 'href': 'http://-lovemonsterz.tumblr.com/rss', - 'pathname': '/rss', - 'path': '/rss', + protocol: 'http:', + slashes: true, + host: '-lovemonsterz.tumblr.com', + hostname: '-lovemonsterz.tumblr.com', + href: 'http://-lovemonsterz.tumblr.com/rss', + pathname: '/rss', + path: '/rss', }, 'http://-lovemonsterz.tumblr.com:80/rss': { - 'protocol': 'http:', - 'slashes': true, - 'port': '80', - 'host': '-lovemonsterz.tumblr.com:80', - 'hostname': '-lovemonsterz.tumblr.com', - 'href': 'http://-lovemonsterz.tumblr.com:80/rss', - 'pathname': '/rss', - 'path': '/rss', + protocol: 'http:', + slashes: true, + port: '80', + host: '-lovemonsterz.tumblr.com:80', + hostname: '-lovemonsterz.tumblr.com', + href: 'http://-lovemonsterz.tumblr.com:80/rss', + pathname: '/rss', + path: '/rss', }, 'http://user:pass@-lovemonsterz.tumblr.com/rss': { - 'protocol': 'http:', - 'slashes': true, - 'auth': 'user:pass', - 'host': '-lovemonsterz.tumblr.com', - 'hostname': '-lovemonsterz.tumblr.com', - 'href': 'http://user:pass@-lovemonsterz.tumblr.com/rss', - 'pathname': '/rss', - 'path': '/rss', + protocol: 'http:', + slashes: true, + auth: 'user:pass', + host: '-lovemonsterz.tumblr.com', + hostname: '-lovemonsterz.tumblr.com', + href: 'http://user:pass@-lovemonsterz.tumblr.com/rss', + pathname: '/rss', + path: '/rss', }, 'http://user:pass@-lovemonsterz.tumblr.com:80/rss': { - 'protocol': 'http:', - 'slashes': true, - 'auth': 'user:pass', - 'port': '80', - 'host': '-lovemonsterz.tumblr.com:80', - 'hostname': '-lovemonsterz.tumblr.com', - 'href': 'http://user:pass@-lovemonsterz.tumblr.com:80/rss', - 'pathname': '/rss', - 'path': '/rss', + protocol: 'http:', + slashes: true, + auth: 'user:pass', + port: '80', + host: '-lovemonsterz.tumblr.com:80', + hostname: '-lovemonsterz.tumblr.com', + href: 'http://user:pass@-lovemonsterz.tumblr.com:80/rss', + pathname: '/rss', + path: '/rss', }, 'http://_jabber._tcp.google.com/test': { - 'protocol': 'http:', - 'slashes': true, - 'host': '_jabber._tcp.google.com', - 'hostname': '_jabber._tcp.google.com', - 'href': 'http://_jabber._tcp.google.com/test', - 'pathname': '/test', - 'path': '/test', + protocol: 'http:', + slashes: true, + host: '_jabber._tcp.google.com', + hostname: '_jabber._tcp.google.com', + href: 'http://_jabber._tcp.google.com/test', + pathname: '/test', + path: '/test', }, 'http://user:pass@_jabber._tcp.google.com/test': { - 'protocol': 'http:', - 'slashes': true, - 'auth': 'user:pass', - 'host': '_jabber._tcp.google.com', - 'hostname': '_jabber._tcp.google.com', - 'href': 'http://user:pass@_jabber._tcp.google.com/test', - 'pathname': '/test', - 'path': '/test', + protocol: 'http:', + slashes: true, + auth: 'user:pass', + host: '_jabber._tcp.google.com', + hostname: '_jabber._tcp.google.com', + href: 'http://user:pass@_jabber._tcp.google.com/test', + pathname: '/test', + path: '/test', }, 'http://_jabber._tcp.google.com:80/test': { - 'protocol': 'http:', - 'slashes': true, - 'port': '80', - 'host': '_jabber._tcp.google.com:80', - 'hostname': '_jabber._tcp.google.com', - 'href': 'http://_jabber._tcp.google.com:80/test', - 'pathname': '/test', - 'path': '/test', + protocol: 'http:', + slashes: true, + port: '80', + host: '_jabber._tcp.google.com:80', + hostname: '_jabber._tcp.google.com', + href: 'http://_jabber._tcp.google.com:80/test', + pathname: '/test', + path: '/test', }, 'http://user:pass@_jabber._tcp.google.com:80/test': { - 'protocol': 'http:', - 'slashes': true, - 'auth': 'user:pass', - 'port': '80', - 'host': '_jabber._tcp.google.com:80', - 'hostname': '_jabber._tcp.google.com', - 'href': 'http://user:pass@_jabber._tcp.google.com:80/test', - 'pathname': '/test', - 'path': '/test', + protocol: 'http:', + slashes: true, + auth: 'user:pass', + port: '80', + host: '_jabber._tcp.google.com:80', + hostname: '_jabber._tcp.google.com', + href: 'http://user:pass@_jabber._tcp.google.com:80/test', + pathname: '/test', + path: '/test', }, 'http://x:1/\' <>"`/{}|\\^~`/': { @@ -853,14 +851,29 @@ var parseTests = { pathname: '/:npm/npm', path: '/:npm/npm', href: 'git+ssh://git@github.com/:npm/npm' + }, + + 'https://*': { + protocol: 'https:', + slashes: true, + auth: null, + host: '', + port: null, + hostname: '', + hash: null, + search: null, + query: null, + pathname: '/*', + path: '/*', + href: 'https:///*' } }; -for (var u in parseTests) { - var actual = url.parse(u); - var spaced = url.parse(' \t ' + u + '\n\t'); - var expected = parseTests[u]; +for (const u in parseTests) { + let actual = url.parse(u); + const spaced = url.parse(` \t ${u}\n\t`); + let expected = parseTests[u]; Object.keys(actual).forEach(function(i) { if (expected[i] === undefined && actual[i] === null) { @@ -871,34 +884,34 @@ for (var u in parseTests) { assert.deepEqual(actual, expected); assert.deepEqual(spaced, expected); - var expected = parseTests[u].href, - actual = url.format(parseTests[u]); + expected = parseTests[u].href; + actual = url.format(parseTests[u]); assert.equal(actual, expected, 'format(' + u + ') == ' + u + '\nactual:' + actual); } var parseTestsWithQueryString = { - '/foo/bar?baz=quux#frag' : { - 'href': '/foo/bar?baz=quux#frag', - 'hash': '#frag', - 'search': '?baz=quux', - 'query': { - 'baz': 'quux' + '/foo/bar?baz=quux#frag': { + href: '/foo/bar?baz=quux#frag', + hash: '#frag', + search: '?baz=quux', + query: { + baz: 'quux' }, - 'pathname': '/foo/bar', - 'path': '/foo/bar?baz=quux' - }, - 'http://example.com' : { - 'href': 'http://example.com/', - 'protocol': 'http:', - 'slashes': true, - 'host': 'example.com', - 'hostname': 'example.com', - 'query': {}, - 'search': '', - 'pathname': '/', - 'path': '/' + pathname: '/foo/bar', + path: '/foo/bar?baz=quux' + }, + 'http://example.com': { + href: 'http://example.com/', + protocol: 'http:', + slashes: true, + host: 'example.com', + hostname: 'example.com', + query: {}, + search: '', + pathname: '/', + path: '/' }, '/example': { protocol: null, @@ -929,10 +942,10 @@ var parseTestsWithQueryString = { href: '/example?query=value' } }; -for (var u in parseTestsWithQueryString) { - var actual = url.parse(u, true); - var expected = parseTestsWithQueryString[u]; - for (var i in actual) { +for (const u in parseTestsWithQueryString) { + const actual = url.parse(u, true); + const expected = parseTestsWithQueryString[u]; + for (const i in actual) { if (actual[i] === null && expected[i] === undefined) { expected[i] = null; } @@ -944,147 +957,147 @@ for (var u in parseTestsWithQueryString) { // some extra formatting tests, just to verify // that it'll format slightly wonky content to a valid url. var formatTests = { - 'http://example.com?' : { - 'href': 'http://example.com/?', - 'protocol': 'http:', - 'slashes': true, - 'host': 'example.com', - 'hostname': 'example.com', - 'search': '?', - 'query': {}, - 'pathname': '/' - }, - 'http://example.com?foo=bar#frag' : { - 'href': 'http://example.com/?foo=bar#frag', - 'protocol': 'http:', - 'host': 'example.com', - 'hostname': 'example.com', - 'hash': '#frag', - 'search': '?foo=bar', - 'query': 'foo=bar', - 'pathname': '/' - }, - 'http://example.com?foo=@bar#frag' : { - 'href': 'http://example.com/?foo=@bar#frag', - 'protocol': 'http:', - 'host': 'example.com', - 'hostname': 'example.com', - 'hash': '#frag', - 'search': '?foo=@bar', - 'query': 'foo=@bar', - 'pathname': '/' - }, - 'http://example.com?foo=/bar/#frag' : { - 'href': 'http://example.com/?foo=/bar/#frag', - 'protocol': 'http:', - 'host': 'example.com', - 'hostname': 'example.com', - 'hash': '#frag', - 'search': '?foo=/bar/', - 'query': 'foo=/bar/', - 'pathname': '/' - }, - 'http://example.com?foo=?bar/#frag' : { - 'href': 'http://example.com/?foo=?bar/#frag', - 'protocol': 'http:', - 'host': 'example.com', - 'hostname': 'example.com', - 'hash': '#frag', - 'search': '?foo=?bar/', - 'query': 'foo=?bar/', - 'pathname': '/' - }, - 'http://example.com#frag=?bar/#frag' : { - 'href': 'http://example.com/#frag=?bar/#frag', - 'protocol': 'http:', - 'host': 'example.com', - 'hostname': 'example.com', - 'hash': '#frag=?bar/#frag', - 'pathname': '/' - }, - 'http://google.com" onload="alert(42)/' : { - 'href': 'http://google.com/%22%20onload=%22alert(42)/', - 'protocol': 'http:', - 'host': 'google.com', - 'pathname': '/%22%20onload=%22alert(42)/' - }, - 'http://a.com/a/b/c?s#h' : { - 'href': 'http://a.com/a/b/c?s#h', - 'protocol': 'http', - 'host': 'a.com', - 'pathname': 'a/b/c', - 'hash': 'h', - 'search': 's' - }, - 'xmpp:isaacschlueter@jabber.org' : { - 'href': 'xmpp:isaacschlueter@jabber.org', - 'protocol': 'xmpp:', - 'host': 'jabber.org', - 'auth': 'isaacschlueter', - 'hostname': 'jabber.org' - }, - 'http://atpass:foo%40bar@127.0.0.1/' : { - 'href': 'http://atpass:foo%40bar@127.0.0.1/', - 'auth': 'atpass:foo@bar', - 'hostname': '127.0.0.1', - 'protocol': 'http:', - 'pathname': '/' - }, - 'http://atslash%2F%40:%2F%40@foo/' : { - 'href': 'http://atslash%2F%40:%2F%40@foo/', - 'auth': 'atslash/@:/@', - 'hostname': 'foo', - 'protocol': 'http:', - 'pathname': '/' + 'http://example.com?': { + href: 'http://example.com/?', + protocol: 'http:', + slashes: true, + host: 'example.com', + hostname: 'example.com', + search: '?', + query: {}, + pathname: '/' + }, + 'http://example.com?foo=bar#frag': { + href: 'http://example.com/?foo=bar#frag', + protocol: 'http:', + host: 'example.com', + hostname: 'example.com', + hash: '#frag', + search: '?foo=bar', + query: 'foo=bar', + pathname: '/' + }, + 'http://example.com?foo=@bar#frag': { + href: 'http://example.com/?foo=@bar#frag', + protocol: 'http:', + host: 'example.com', + hostname: 'example.com', + hash: '#frag', + search: '?foo=@bar', + query: 'foo=@bar', + pathname: '/' + }, + 'http://example.com?foo=/bar/#frag': { + href: 'http://example.com/?foo=/bar/#frag', + protocol: 'http:', + host: 'example.com', + hostname: 'example.com', + hash: '#frag', + search: '?foo=/bar/', + query: 'foo=/bar/', + pathname: '/' + }, + 'http://example.com?foo=?bar/#frag': { + href: 'http://example.com/?foo=?bar/#frag', + protocol: 'http:', + host: 'example.com', + hostname: 'example.com', + hash: '#frag', + search: '?foo=?bar/', + query: 'foo=?bar/', + pathname: '/' + }, + 'http://example.com#frag=?bar/#frag': { + href: 'http://example.com/#frag=?bar/#frag', + protocol: 'http:', + host: 'example.com', + hostname: 'example.com', + hash: '#frag=?bar/#frag', + pathname: '/' + }, + 'http://google.com" onload="alert(42)/': { + href: 'http://google.com/%22%20onload=%22alert(42)/', + protocol: 'http:', + host: 'google.com', + pathname: '/%22%20onload=%22alert(42)/' + }, + 'http://a.com/a/b/c?s#h': { + href: 'http://a.com/a/b/c?s#h', + protocol: 'http', + host: 'a.com', + pathname: 'a/b/c', + hash: 'h', + search: 's' + }, + 'xmpp:isaacschlueter@jabber.org': { + href: 'xmpp:isaacschlueter@jabber.org', + protocol: 'xmpp:', + host: 'jabber.org', + auth: 'isaacschlueter', + hostname: 'jabber.org' + }, + 'http://atpass:foo%40bar@127.0.0.1/': { + href: 'http://atpass:foo%40bar@127.0.0.1/', + auth: 'atpass:foo@bar', + hostname: '127.0.0.1', + protocol: 'http:', + pathname: '/' + }, + 'http://atslash%2F%40:%2F%40@foo/': { + href: 'http://atslash%2F%40:%2F%40@foo/', + auth: 'atslash/@:/@', + hostname: 'foo', + protocol: 'http:', + pathname: '/' }, 'svn+ssh://foo/bar': { - 'href': 'svn+ssh://foo/bar', - 'hostname': 'foo', - 'protocol': 'svn+ssh:', - 'pathname': '/bar', - 'slashes': true + href: 'svn+ssh://foo/bar', + hostname: 'foo', + protocol: 'svn+ssh:', + pathname: '/bar', + slashes: true }, 'dash-test://foo/bar': { - 'href': 'dash-test://foo/bar', - 'hostname': 'foo', - 'protocol': 'dash-test:', - 'pathname': '/bar', - 'slashes': true + href: 'dash-test://foo/bar', + hostname: 'foo', + protocol: 'dash-test:', + pathname: '/bar', + slashes: true }, 'dash-test:foo/bar': { - 'href': 'dash-test:foo/bar', - 'hostname': 'foo', - 'protocol': 'dash-test:', - 'pathname': '/bar' + href: 'dash-test:foo/bar', + hostname: 'foo', + protocol: 'dash-test:', + pathname: '/bar' }, 'dot.test://foo/bar': { - 'href': 'dot.test://foo/bar', - 'hostname': 'foo', - 'protocol': 'dot.test:', - 'pathname': '/bar', - 'slashes': true + href: 'dot.test://foo/bar', + hostname: 'foo', + protocol: 'dot.test:', + pathname: '/bar', + slashes: true }, 'dot.test:foo/bar': { - 'href': 'dot.test:foo/bar', - 'hostname': 'foo', - 'protocol': 'dot.test:', - 'pathname': '/bar' + href: 'dot.test:foo/bar', + hostname: 'foo', + protocol: 'dot.test:', + pathname: '/bar' }, // ipv6 support 'coap:u:p@[::1]:61616/.well-known/r?n=Temperature': { - 'href': 'coap:u:p@[::1]:61616/.well-known/r?n=Temperature', - 'protocol': 'coap:', - 'auth': 'u:p', - 'hostname': '::1', - 'port': '61616', - 'pathname': '/.well-known/r', - 'search': 'n=Temperature' + href: 'coap:u:p@[::1]:61616/.well-known/r?n=Temperature', + protocol: 'coap:', + auth: 'u:p', + hostname: '::1', + port: '61616', + pathname: '/.well-known/r', + search: 'n=Temperature' }, 'coap:[fedc:ba98:7654:3210:fedc:ba98:7654:3210]:61616/s/stopButton': { - 'href': 'coap:[fedc:ba98:7654:3210:fedc:ba98:7654:3210]:61616/s/stopButton', - 'protocol': 'coap', - 'host': '[fedc:ba98:7654:3210:fedc:ba98:7654:3210]:61616', - 'pathname': '/s/stopButton' + href: 'coap:[fedc:ba98:7654:3210:fedc:ba98:7654:3210]:61616/s/stopButton', + protocol: 'coap', + host: '[fedc:ba98:7654:3210:fedc:ba98:7654:3210]:61616', + pathname: '/s/stopButton' }, // encode context-specific delimiters in path and query, but do not touch @@ -1092,7 +1105,7 @@ var formatTests = { // // `#`,`?` in path - '/path/to/%%23%3F+=&.txt?foo=theA1#bar' : { + '/path/to/%%23%3F+=&.txt?foo=theA1#bar': { href : '/path/to/%%23%3F+=&.txt?foo=theA1#bar', pathname: '/path/to/%#?+=&.txt', query: { @@ -1102,7 +1115,7 @@ var formatTests = { }, // `#`,`?` in path + `#` in query - '/path/to/%%23%3F+=&.txt?foo=the%231#bar' : { + '/path/to/%%23%3F+=&.txt?foo=the%231#bar': { href : '/path/to/%%23%3F+=&.txt?foo=the%231#bar', pathname: '/path/to/%#?+=&.txt', query: { @@ -1131,11 +1144,11 @@ var formatTests = { pathname: '/fooA100%mBr', } }; -for (var u in formatTests) { - var expect = formatTests[u].href; +for (const u in formatTests) { + const expect = formatTests[u].href; delete formatTests[u].href; - var actual = url.format(u); - var actualObj = url.format(formatTests[u]); + const actual = url.format(u); + const actualObj = url.format(formatTests[u]); assert.equal(actual, expect, 'wonky format(' + u + ') == ' + expect + '\nactual:' + actual); @@ -1195,8 +1208,8 @@ var relativeTests = [ ['http://localhost', 'file://foo/Users', 'file://foo/Users'] ]; relativeTests.forEach(function(relativeTest) { - var a = url.resolve(relativeTest[0], relativeTest[1]), - e = relativeTest[2]; + const a = url.resolve(relativeTest[0], relativeTest[1]); + const e = relativeTest[2]; assert.equal(a, e, 'resolve(' + [relativeTest[0], relativeTest[1]] + ') == ' + e + '\n actual=' + a); @@ -1505,8 +1518,8 @@ var relativeTests2 = [ 'http://diff:auth@www.example.com/'] ]; relativeTests2.forEach(function(relativeTest) { - var a = url.resolve(relativeTest[1], relativeTest[0]), - e = relativeTest[2]; + const a = url.resolve(relativeTest[1], relativeTest[0]); + const e = relativeTest[2]; assert.equal(a, e, 'resolve(' + [relativeTest[1], relativeTest[0]] + ') == ' + e + '\n actual=' + a); @@ -1515,13 +1528,10 @@ relativeTests2.forEach(function(relativeTest) { //if format and parse are inverse operations then //resolveObject(parse(x), y) == parse(resolve(x, y)) -//host and hostname are special, in this case a '' value is important -var emptyIsImportant = {'host': true, 'hostname': ''}; - //format: [from, path, expected] relativeTests.forEach(function(relativeTest) { - var actual = url.resolveObject(url.parse(relativeTest[0]), relativeTest[1]), - expected = url.parse(relativeTest[2]); + var actual = url.resolveObject(url.parse(relativeTest[0]), relativeTest[1]); + var expected = url.parse(relativeTest[2]); assert.deepEqual(actual, expected); @@ -1548,13 +1558,13 @@ if (relativeTests2[181][0] === './/g' && relativeTests2.splice(181, 1); } relativeTests2.forEach(function(relativeTest) { - var actual = url.resolveObject(url.parse(relativeTest[1]), relativeTest[0]), - expected = url.parse(relativeTest[2]); + var actual = url.resolveObject(url.parse(relativeTest[1]), relativeTest[0]); + var expected = url.parse(relativeTest[2]); assert.deepEqual(actual, expected); - var expected = relativeTest[2], - actual = url.format(actual); + expected = relativeTest[2]; + actual = url.format(actual); assert.equal(actual, expected, 'format(' + relativeTest[1] + ') == ' + expected + @@ -1571,8 +1581,8 @@ var throws = [ 0, function() {} ]; -for (var i = 0; i < throws.length; i++) { +for (let i = 0; i < throws.length; i++) { assert.throws(function() { url.format(throws[i]); }, TypeError); -}; +} assert(url.format('') === ''); assert(url.format({}) === ''); diff --git a/test/parallel/test-utf8-scripts.js b/test/parallel/test-utf8-scripts.js index 3a891283509b9e..a9db5d10e4fde7 100644 --- a/test/parallel/test-utf8-scripts.js +++ b/test/parallel/test-utf8-scripts.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); // üäö diff --git a/test/parallel/test-util-decorate-error-stack.js b/test/parallel/test-util-decorate-error-stack.js new file mode 100644 index 00000000000000..017a5ab6afe807 --- /dev/null +++ b/test/parallel/test-util-decorate-error-stack.js @@ -0,0 +1,36 @@ +// Flags: --expose_internals +'use strict'; +require('../common'); +const assert = require('assert'); +const internalUtil = require('internal/util'); + +assert.doesNotThrow(function() { + internalUtil.decorateErrorStack(); + internalUtil.decorateErrorStack(null); + internalUtil.decorateErrorStack(1); + internalUtil.decorateErrorStack(true); +}); + +// Verify that a stack property is not added to non-Errors +const obj = {}; +internalUtil.decorateErrorStack(obj); +assert.strictEqual(obj.stack, undefined); + +// Verify that the stack is decorated when possible +let err; + +try { + require('../fixtures/syntax/bad_syntax'); +} catch (e) { + err = e; + assert(!/var foo bar;/.test(err.stack)); + internalUtil.decorateErrorStack(err); +} + +assert(/var foo bar;/.test(err.stack)); + +// Verify that the stack is unchanged when there is no arrow message +err = new Error('foo'); +const originalStack = err.stack; +internalUtil.decorateErrorStack(err); +assert.strictEqual(originalStack, err.stack); diff --git a/test/parallel/test-util-format.js b/test/parallel/test-util-format.js index 6761671e1997bd..00028ddbb74728 100644 --- a/test/parallel/test-util-format.js +++ b/test/parallel/test-util-format.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var util = require('util'); var symbol = Symbol('foo'); diff --git a/test/parallel/test-util-inherits.js b/test/parallel/test-util-inherits.js new file mode 100644 index 00000000000000..a3c5786fe261d0 --- /dev/null +++ b/test/parallel/test-util-inherits.js @@ -0,0 +1,80 @@ +'use strict'; + +require('../common'); +const assert = require('assert'); +const inherits = require('util').inherits; + +// super constructor +function A() { + this._a = 'a'; +} +A.prototype.a = function() { return this._a; }; + +// one level of inheritance +function B(value) { + A.call(this); + this._b = value; +} +inherits(B, A); +B.prototype.b = function() { return this._b; }; + +assert.strictEqual(B.super_, A); + +const b = new B('b'); +assert.strictEqual(b.a(), 'a'); +assert.strictEqual(b.b(), 'b'); +assert.strictEqual(b.constructor, B); + + // two levels of inheritance +function C() { + B.call(this, 'b'); + this._c = 'c'; +} +inherits(C, B); +C.prototype.c = function() { return this._c; }; +C.prototype.getValue = function() { return this.a() + this.b() + this.c(); }; + +assert.strictEqual(C.super_, B); + +const c = new C(); +assert.strictEqual(c.getValue(), 'abc'); +assert.strictEqual(c.constructor, C); + +// inherits can be called after setting prototype properties +function D() { + C.call(this); + this._d = 'd'; +} + +D.prototype.d = function() { return this._d; }; +inherits(D, C); + +assert.strictEqual(D.super_, C); + +const d = new D(); +assert.strictEqual(d.c(), 'c'); +assert.strictEqual(d.d(), 'd'); +assert.strictEqual(d.constructor, D); + +// ES6 classes can inherit from a constructor function +class E { + constructor() { + D.call(this); + this._e = 'e'; + } + e() { return this._e; } +} +inherits(E, D); + +assert.strictEqual(E.super_, D); + +const e = new E(); +assert.strictEqual(e.getValue(), 'abc'); +assert.strictEqual(e.d(), 'd'); +assert.strictEqual(e.e(), 'e'); +assert.strictEqual(e.constructor, E); + +// should throw with invalid arguments +assert.throws(function() { inherits(A, {}); }, TypeError); +assert.throws(function() { inherits(A, null); }, TypeError); +assert.throws(function() { inherits(null, A); }, TypeError); diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js index 444c0168a42fa7..e0264c34f7b685 100644 --- a/test/parallel/test-util-inspect.js +++ b/test/parallel/test-util-inspect.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var util = require('util'); @@ -45,24 +45,26 @@ assert.equal(util.inspect(Object.create({}, // the following ways this hash is displayed. // See http://codereview.chromium.org/9124004/ -var out = util.inspect(Object.create({}, - {visible: {value: 1, enumerable: true}, hidden: {value: 2}}), true); -if (out !== '{ [hidden]: 2, visible: 1 }' && - out !== '{ visible: 1, [hidden]: 2 }') { - assert.ok(false); +{ + const out = util.inspect(Object.create({}, + {visible: {value: 1, enumerable: true}, hidden: {value: 2}}), true); + if (out !== '{ [hidden]: 2, visible: 1 }' && + out !== '{ visible: 1, [hidden]: 2 }') { + assert.ok(false); + } } - // Objects without prototype -var out = util.inspect(Object.create(null, - { name: {value: 'Tim', enumerable: true}, - hidden: {value: 'secret'}}), true); -if (out !== "{ [hidden]: 'secret', name: 'Tim' }" && - out !== "{ name: 'Tim', [hidden]: 'secret' }") { - assert(false); +{ + const out = util.inspect(Object.create(null, + { name: {value: 'Tim', enumerable: true}, + hidden: {value: 'secret'}}), true); + if (out !== "{ [hidden]: 'secret', name: 'Tim' }" && + out !== "{ name: 'Tim', [hidden]: 'secret' }") { + assert(false); + } } - assert.equal( util.inspect(Object.create(null, {name: {value: 'Tim', enumerable: true}, @@ -129,17 +131,29 @@ assert.equal(util.inspect(a, true), '[ \'foo\', , \'baz\', [length]: 3 ]'); assert.equal(util.inspect(new Array(5)), '[ , , , , ]'); // test for Array constructor in different context -const Debug = require('vm').runInDebugContext('Debug'); -var map = new Map(); -map.set(1, 2); -var mirror = Debug.MakeMirror(map.entries(), true); -var vals = mirror.preview(); -var valsOutput = []; -for (let o of vals) { - valsOutput.push(o); +{ + const Debug = require('vm').runInDebugContext('Debug'); + const map = new Map(); + map.set(1, 2); + const mirror = Debug.MakeMirror(map.entries(), true); + const vals = mirror.preview(); + const valsOutput = []; + for (const o of vals) { + valsOutput.push(o); + } + + assert.strictEqual(util.inspect(valsOutput), '[ [ 1, 2 ] ]'); } -assert.strictEqual(util.inspect(valsOutput), '[ [ 1, 2 ] ]'); +// test for other constructors in different context +var obj = require('vm').runInNewContext('(function(){return {}})()', {}); +assert.strictEqual(util.inspect(obj), '{}'); +obj = require('vm').runInNewContext('var m=new Map();m.set(1,2);m', {}); +assert.strictEqual(util.inspect(obj), 'Map { 1 => 2 }'); +obj = require('vm').runInNewContext('var s=new Set();s.add(1);s.add(2);s', {}); +assert.strictEqual(util.inspect(obj), 'Set { 1, 2 }'); +obj = require('vm').runInNewContext('fn=function(){};new Promise(fn,fn)', {}); +assert.strictEqual(util.inspect(obj), 'Promise { }'); // test for property descriptors var getter = Object.create(null, { @@ -168,7 +182,7 @@ assert.equal(util.inspect(new Error('FAIL')), '[Error: FAIL]'); assert.equal(util.inspect(new TypeError('FAIL')), '[TypeError: FAIL]'); assert.equal(util.inspect(new SyntaxError('FAIL')), '[SyntaxError: FAIL]'); try { - undef(); + undef(); // eslint-disable-line no-undef } catch (e) { assert.equal(util.inspect(e), '[ReferenceError: undef is not defined]'); } @@ -202,8 +216,10 @@ assert.doesNotThrow(function() { }); // GH-2225 -var x = { inspect: util.inspect }; -assert.ok(util.inspect(x).indexOf('inspect') != -1); +{ + const x = { inspect: util.inspect }; + assert.ok(util.inspect(x).indexOf('inspect') != -1); +} // util.inspect should not display the escaped value of a key. var w = { @@ -251,39 +267,41 @@ assert.doesNotThrow(function() { }); // new API, accepts an "options" object -var subject = { foo: 'bar', hello: 31, a: { b: { c: { d: 0 } } } }; -Object.defineProperty(subject, 'hidden', { enumerable: false, value: null }); - -assert(util.inspect(subject, { showHidden: false }).indexOf('hidden') === -1); -assert(util.inspect(subject, { showHidden: true }).indexOf('hidden') !== -1); -assert(util.inspect(subject, { colors: false }).indexOf('\u001b[32m') === -1); -assert(util.inspect(subject, { colors: true }).indexOf('\u001b[32m') !== -1); -assert(util.inspect(subject, { depth: 2 }).indexOf('c: [Object]') !== -1); -assert(util.inspect(subject, { depth: 0 }).indexOf('a: [Object]') !== -1); -assert(util.inspect(subject, { depth: null }).indexOf('{ d: 0 }') !== -1); - -// "customInspect" option can enable/disable calling inspect() on objects -subject = { inspect: function() { return 123; } }; - -assert(util.inspect(subject, - { customInspect: true }).indexOf('123') !== -1); -assert(util.inspect(subject, - { customInspect: true }).indexOf('inspect') === -1); -assert(util.inspect(subject, - { customInspect: false }).indexOf('123') === -1); -assert(util.inspect(subject, - { customInspect: false }).indexOf('inspect') !== -1); - -// custom inspect() functions should be able to return other Objects -subject.inspect = function() { return { foo: 'bar' }; }; - -assert.equal(util.inspect(subject), '{ foo: \'bar\' }'); - -subject.inspect = function(depth, opts) { - assert.strictEqual(opts.customInspectOptions, true); -}; +{ + let subject = { foo: 'bar', hello: 31, a: { b: { c: { d: 0 } } } }; + Object.defineProperty(subject, 'hidden', { enumerable: false, value: null }); + + assert(util.inspect(subject, { showHidden: false }).indexOf('hidden') === -1); + assert(util.inspect(subject, { showHidden: true }).indexOf('hidden') !== -1); + assert(util.inspect(subject, { colors: false }).indexOf('\u001b[32m') === -1); + assert(util.inspect(subject, { colors: true }).indexOf('\u001b[32m') !== -1); + assert(util.inspect(subject, { depth: 2 }).indexOf('c: [Object]') !== -1); + assert(util.inspect(subject, { depth: 0 }).indexOf('a: [Object]') !== -1); + assert(util.inspect(subject, { depth: null }).indexOf('{ d: 0 }') !== -1); + + // "customInspect" option can enable/disable calling inspect() on objects + subject = { inspect: function() { return 123; } }; + + assert(util.inspect(subject, + { customInspect: true }).indexOf('123') !== -1); + assert(util.inspect(subject, + { customInspect: true }).indexOf('inspect') === -1); + assert(util.inspect(subject, + { customInspect: false }).indexOf('123') === -1); + assert(util.inspect(subject, + { customInspect: false }).indexOf('inspect') !== -1); + + // custom inspect() functions should be able to return other Objects + subject.inspect = function() { return { foo: 'bar' }; }; + + assert.equal(util.inspect(subject), '{ foo: \'bar\' }'); + + subject.inspect = function(depth, opts) { + assert.strictEqual(opts.customInspectOptions, true); + }; -util.inspect(subject, { customInspectOptions: true }); + util.inspect(subject, { customInspectOptions: true }); +} // util.inspect with "colors" option should produce as many lines as without it function test_lines(input) { @@ -343,8 +361,8 @@ if (typeof Symbol !== 'undefined') { assert.equal(util.inspect([Symbol()]), '[ Symbol() ]'); assert.equal(util.inspect({ foo: Symbol() }), '{ foo: Symbol() }'); - var options = { showHidden: true }; - var subject = {}; + const options = { showHidden: true }; + let subject = {}; subject[Symbol('symbol')] = 42; @@ -357,7 +375,6 @@ if (typeof Symbol !== 'undefined') { assert.equal(util.inspect(subject), '[ 1, 2, 3 ]'); assert.equal(util.inspect(subject, options), '[ 1, 2, 3, [length]: 3, [Symbol(symbol)]: 42 ]'); - } // test Set @@ -368,13 +385,15 @@ set.bar = 42; assert.equal(util.inspect(set, true), 'Set { \'foo\', [size]: 1, bar: 42 }'); // test Map -assert.equal(util.inspect(new Map()), 'Map {}'); -assert.equal(util.inspect(new Map([[1, 'a'], [2, 'b'], [3, 'c']])), - 'Map { 1 => \'a\', 2 => \'b\', 3 => \'c\' }'); -var map = new Map([['foo', null]]); -map.bar = 42; -assert.equal(util.inspect(map, true), - 'Map { \'foo\' => null, [size]: 1, bar: 42 }'); +{ + assert.equal(util.inspect(new Map()), 'Map {}'); + assert.equal(util.inspect(new Map([[1, 'a'], [2, 'b'], [3, 'c']])), + 'Map { 1 => \'a\', 2 => \'b\', 3 => \'c\' }'); + const map = new Map([['foo', null]]); + map.bar = 42; + assert.equal(util.inspect(map, true), + 'Map { \'foo\' => null, [size]: 1, bar: 42 }'); +} // test Promise assert.equal(util.inspect(Promise.resolve(3)), 'Promise { 3 }'); @@ -447,41 +466,50 @@ checkAlignment(new Map(big_array.map(function(y) { return [y, null]; }))); // Test display of constructors - -class ObjectSubclass {} -class ArraySubclass extends Array {} -class SetSubclass extends Set {} -class MapSubclass extends Map {} -class PromiseSubclass extends Promise {} - -var x = new ObjectSubclass(); -x.foo = 42; -assert.equal(util.inspect(x), - 'ObjectSubclass { foo: 42 }'); -assert.equal(util.inspect(new ArraySubclass(1, 2, 3)), - 'ArraySubclass [ 1, 2, 3 ]'); -assert.equal(util.inspect(new SetSubclass([1, 2, 3])), - 'SetSubclass { 1, 2, 3 }'); -assert.equal(util.inspect(new MapSubclass([['foo', 42]])), - 'MapSubclass { \'foo\' => 42 }'); -assert.equal(util.inspect(new PromiseSubclass(function() {})), - 'PromiseSubclass { }'); +{ + class ObjectSubclass {} + class ArraySubclass extends Array {} + class SetSubclass extends Set {} + class MapSubclass extends Map {} + class PromiseSubclass extends Promise {} + + const x = new ObjectSubclass(); + x.foo = 42; + assert.equal(util.inspect(x), + 'ObjectSubclass { foo: 42 }'); + assert.equal(util.inspect(new ArraySubclass(1, 2, 3)), + 'ArraySubclass [ 1, 2, 3 ]'); + assert.equal(util.inspect(new SetSubclass([1, 2, 3])), + 'SetSubclass { 1, 2, 3 }'); + assert.equal(util.inspect(new MapSubclass([['foo', 42]])), + 'MapSubclass { \'foo\' => 42 }'); + assert.equal(util.inspect(new PromiseSubclass(function() {})), + 'PromiseSubclass { }'); +} // Corner cases. -var x = { constructor: 42 }; -assert.equal(util.inspect(x), '{ constructor: 42 }'); - -var x = {}; -Object.defineProperty(x, 'constructor', { - get: function() { - throw new Error('should not access constructor'); - }, - enumerable: true -}); -assert.equal(util.inspect(x), '{ constructor: [Getter] }'); +{ + const x = { constructor: 42 }; + assert.equal(util.inspect(x), '{ constructor: 42 }'); +} -var x = new (function() {}); -assert.equal(util.inspect(x), '{}'); +{ + const x = {}; + Object.defineProperty(x, 'constructor', { + get: function() { + throw new Error('should not access constructor'); + }, + enumerable: true + }); + assert.equal(util.inspect(x), '{ constructor: [Getter] }'); +} -var x = Object.create(null); -assert.equal(util.inspect(x), '{}'); +{ + const x = new function() {}; + assert.equal(util.inspect(x), '{}'); +} + +{ + const x = Object.create(null); + assert.equal(util.inspect(x), '{}'); +} diff --git a/test/parallel/test-util-internal.js b/test/parallel/test-util-internal.js new file mode 100644 index 00000000000000..b557356716a004 --- /dev/null +++ b/test/parallel/test-util-internal.js @@ -0,0 +1,32 @@ +'use strict'; +// Flags: --expose_internals + +require('../common'); +const assert = require('assert'); +const internalUtil = require('internal/util'); + +function getHiddenValue(obj, name) { + return function() { + internalUtil.getHiddenValue(obj, name); + }; +} + +assert.throws(getHiddenValue(), /obj must be an object/); +assert.throws(getHiddenValue(null, 'foo'), /obj must be an object/); +assert.throws(getHiddenValue(undefined, 'foo'), /obj must be an object/); +assert.throws(getHiddenValue('bar', 'foo'), /obj must be an object/); +assert.throws(getHiddenValue(85, 'foo'), /obj must be an object/); +assert.throws(getHiddenValue({}), /name must be a string/); +assert.throws(getHiddenValue({}, null), /name must be a string/); +assert.throws(getHiddenValue({}, []), /name must be a string/); +assert.deepEqual(internalUtil.getHiddenValue({}, 'foo'), undefined); + +let arrowMessage; + +try { + require('../fixtures/syntax/bad_syntax'); +} catch (err) { + arrowMessage = internalUtil.getHiddenValue(err, 'arrowMessage'); +} + +assert(/bad_syntax\.js:1/.test(arrowMessage)); diff --git a/test/parallel/test-util-log.js b/test/parallel/test-util-log.js index fbea5e5a31dbe4..b9e3d9ce3505e0 100644 --- a/test/parallel/test-util-log.js +++ b/test/parallel/test-util-log.js @@ -28,9 +28,9 @@ var tests = [ // test util.log() tests.forEach(function(test) { util.log(test.input); - var result = strings.shift().trim(), - re = (/[0-9]{1,2} [A-Z][a-z]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} - (.+)$/), - match = re.exec(result); + const result = strings.shift().trim(); + const re = (/[0-9]{1,2} [A-Z][a-z]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} - (.+)$/); + const match = re.exec(result); assert.ok(match); assert.equal(match[1], test.output); }); diff --git a/test/parallel/test-util.js b/test/parallel/test-util.js index 79e104546b7f37..864361d80a6dfa 100644 --- a/test/parallel/test-util.js +++ b/test/parallel/test-util.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var util = require('util'); var context = require('vm').runInNewContext; @@ -83,10 +83,3 @@ assert.deepEqual(util._extend({a:1}, true), {a:1}); assert.deepEqual(util._extend({a:1}, false), {a:1}); assert.deepEqual(util._extend({a:1}, {b:2}), {a:1, b:2}); assert.deepEqual(util._extend({a:1, b:2}, {b:3}), {a:1, b:3}); - -// inherits -var ctor = function() {}; -assert.throws(function() { util.inherits(ctor, {}); }, TypeError); -assert.throws(function() { util.inherits(ctor, null); }, TypeError); -assert.throws(function() { util.inherits(null, ctor); }, TypeError); -assert.doesNotThrow(function() { util.inherits(ctor, ctor); }, TypeError); diff --git a/test/parallel/test-v8-flag-type-check.js b/test/parallel/test-v8-flag-type-check.js index 68bf30dba3cdbc..3724944821343c 100644 --- a/test/parallel/test-v8-flag-type-check.js +++ b/test/parallel/test-v8-flag-type-check.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var v8 = require('v8'); diff --git a/test/parallel/test-v8-flags.js b/test/parallel/test-v8-flags.js index d21cbc6c2635a5..cee924d5b13068 100644 --- a/test/parallel/test-v8-flags.js +++ b/test/parallel/test-v8-flags.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var v8 = require('v8'); var vm = require('vm'); diff --git a/test/parallel/test-v8-stats.js b/test/parallel/test-v8-stats.js index fc4a6df30f8ed8..f6d7933f0636c4 100644 --- a/test/parallel/test-v8-stats.js +++ b/test/parallel/test-v8-stats.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var v8 = require('v8'); @@ -15,3 +15,22 @@ assert.deepEqual(Object.keys(s).sort(), keys); keys.forEach(function(key) { assert.equal(typeof s[key], 'number'); }); + + +const expectedHeapSpaces = [ + 'new_space', + 'old_space', + 'code_space', + 'map_space', + 'large_object_space' +]; +const heapSpaceStatistics = v8.getHeapSpaceStatistics(); +const actualHeapSpaceNames = heapSpaceStatistics.map((s) => s.space_name); +assert.deepEqual(actualHeapSpaceNames.sort(), expectedHeapSpaces.sort()); +heapSpaceStatistics.forEach((heapSpace) => { + assert.strictEqual(typeof heapSpace.space_name, 'string'); + assert.strictEqual(typeof heapSpace.space_size, 'number'); + assert.strictEqual(typeof heapSpace.space_used_size, 'number'); + assert.strictEqual(typeof heapSpace.space_available_size, 'number'); + assert.strictEqual(typeof heapSpace.physical_space_size, 'number'); +}); diff --git a/test/parallel/test-vm-basic.js b/test/parallel/test-vm-basic.js index 96c615c44af10c..f08c8383b84a18 100644 --- a/test/parallel/test-vm-basic.js +++ b/test/parallel/test-vm-basic.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var vm = require('vm'); @@ -18,7 +18,7 @@ assert.strictEqual(result, 'function'); // Test 2: vm.runInContext var sandbox2 = { foo: 'bar' }; var context = vm.createContext(sandbox2); -var result = vm.runInContext( +result = vm.runInContext( 'baz = foo; this.typeofProcess = typeof process; typeof Object;', context ); @@ -30,7 +30,7 @@ assert.deepEqual(sandbox2, { assert.strictEqual(result, 'function'); // Test 3: vm.runInThisContext -var result = vm.runInThisContext( +result = vm.runInThisContext( 'vmResult = "foo"; Object.prototype.toString.call(process);' ); assert.strictEqual(global.vmResult, 'foo'); @@ -38,7 +38,7 @@ assert.strictEqual(result, '[object process]'); delete global.vmResult; // Test 4: vm.runInNewContext -var result = vm.runInNewContext( +result = vm.runInNewContext( 'vmResult = "foo"; typeof process;' ); assert.strictEqual(global.vmResult, undefined); diff --git a/test/parallel/test-vm-cached-data.js b/test/parallel/test-vm-cached-data.js new file mode 100644 index 00000000000000..924f0826845e3a --- /dev/null +++ b/test/parallel/test-vm-cached-data.js @@ -0,0 +1,74 @@ +'use strict'; +require('../common'); +const assert = require('assert'); +const vm = require('vm'); +const Buffer = require('buffer').Buffer; + +function getSource(tag) { + return `(function ${tag}() { return \'${tag}\'; })`; +} + +function produce(source) { + const script = new vm.Script(source, { + produceCachedData: true + }); + assert(!script.cachedDataProduced || script.cachedData instanceof Buffer); + + return script.cachedData; +} + +function testProduceConsume() { + const source = getSource('original'); + + const data = produce(source); + + // It should consume code cache + const script = new vm.Script(source, { + cachedData: data + }); + assert(!script.cachedDataRejected); + assert.equal(script.runInThisContext()(), 'original'); +} +testProduceConsume(); + +function testProduceMultiple() { + const source = getSource('original'); + + produce(source); + produce(source); + produce(source); +} +testProduceMultiple(); + +function testRejectInvalid() { + const source = getSource('invalid'); + + const data = produce(source); + + // It should reject invalid code cache + const script = new vm.Script(getSource('invalid_1'), { + cachedData: data + }); + assert(script.cachedDataRejected); + assert.equal(script.runInThisContext()(), 'invalid_1'); +} +testRejectInvalid(); + +function testRejectSlice() { + const source = getSource('slice'); + + const data = produce(source).slice(4); + + const script = new vm.Script(source, { + cachedData: data + }); + assert(script.cachedDataRejected); +} +testRejectSlice(); + +// It should throw on non-Buffer cachedData +assert.throws(() => { + new vm.Script('function abc() {}', { + cachedData: 'ohai' + }); +}); diff --git a/test/parallel/test-vm-context-async-script.js b/test/parallel/test-vm-context-async-script.js index e146d48343aa60..b09eda85209807 100644 --- a/test/parallel/test-vm-context-async-script.js +++ b/test/parallel/test-vm-context-async-script.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/parallel/test-vm-context-property-forwarding.js b/test/parallel/test-vm-context-property-forwarding.js index 5fcd64b8ba9094..4034441615ca9e 100644 --- a/test/parallel/test-vm-context-property-forwarding.js +++ b/test/parallel/test-vm-context-property-forwarding.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/parallel/test-vm-context.js b/test/parallel/test-vm-context.js index 45e19e6638892e..3fe3cf1b66a88e 100644 --- a/test/parallel/test-vm-context.js +++ b/test/parallel/test-vm-context.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var vm = require('vm'); @@ -60,3 +60,15 @@ var ctx = {}; Object.defineProperty(ctx, 'b', { configurable: false }); ctx = vm.createContext(ctx); assert.equal(script.runInContext(ctx), false); + +// Error on the first line of a module should +// have the correct line and column number +assert.throws(function() { + vm.runInContext('throw new Error()', context, { + filename: 'expected-filename.js', + lineOffset: 32, + columnOffset: 123 + }); +}, function(err) { + return /expected-filename.js:33:130/.test(err.stack); +}, 'Expected appearance of proper offset in Error stack'); diff --git a/test/parallel/test-vm-create-and-run-in-context.js b/test/parallel/test-vm-create-and-run-in-context.js index 01df6ad4531e4a..15efc8f527b8c9 100644 --- a/test/parallel/test-vm-create-and-run-in-context.js +++ b/test/parallel/test-vm-create-and-run-in-context.js @@ -1,5 +1,6 @@ 'use strict'; -var common = require('../common'); +// Flags: --expose-gc +require('../common'); var assert = require('assert'); var vm = require('vm'); @@ -18,3 +19,11 @@ console.error('test updating context'); result = vm.runInContext('var foo = 3;', context); assert.equal(3, context.foo); assert.equal('lala', context.thing); + +// https://github.com/nodejs/node/issues/5768 +console.error('run in contextified sandbox without referencing the context'); +var sandbox = {x: 1}; +vm.createContext(sandbox); +gc(); +vm.runInContext('x = 2', sandbox); +// Should not crash. diff --git a/test/parallel/test-vm-create-context-accessors.js b/test/parallel/test-vm-create-context-accessors.js index 678cf3fbd2128e..d2e7d7bd8eacc2 100644 --- a/test/parallel/test-vm-create-context-accessors.js +++ b/test/parallel/test-vm-create-context-accessors.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/parallel/test-vm-create-context-arg.js b/test/parallel/test-vm-create-context-arg.js index d44eeec18decd5..a0c29762330133 100644 --- a/test/parallel/test-vm-create-context-arg.js +++ b/test/parallel/test-vm-create-context-arg.js @@ -1,15 +1,15 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var vm = require('vm'); assert.throws(function() { - var ctx = vm.createContext('string is not supported'); + vm.createContext('string is not supported'); }, TypeError); assert.doesNotThrow(function() { - var ctx = vm.createContext({ a: 1 }); - ctx = vm.createContext([0, 1, 2, 3]); + vm.createContext({ a: 1 }); + vm.createContext([0, 1, 2, 3]); }); assert.doesNotThrow(function() { diff --git a/test/parallel/test-vm-create-context-circular-reference.js b/test/parallel/test-vm-create-context-circular-reference.js index cb6a90dcaef321..851bebdb088adf 100644 --- a/test/parallel/test-vm-create-context-circular-reference.js +++ b/test/parallel/test-vm-create-context-circular-reference.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/parallel/test-vm-cross-context.js b/test/parallel/test-vm-cross-context.js index 20a3792b28578e..5674f582426f1f 100644 --- a/test/parallel/test-vm-cross-context.js +++ b/test/parallel/test-vm-cross-context.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/parallel/test-vm-debug-context.js b/test/parallel/test-vm-debug-context.js index 0f15d40ef14c59..07335fad56a1f7 100644 --- a/test/parallel/test-vm-debug-context.js +++ b/test/parallel/test-vm-debug-context.js @@ -10,7 +10,7 @@ assert.throws(function() { }, /SyntaxError/); assert.throws(function() { - vm.runInDebugContext({ toString: assert.fail }); + vm.runInDebugContext({ toString: common.fail }); }, /AssertionError/); assert.throws(function() { @@ -21,8 +21,8 @@ assert.throws(function() { vm.runInDebugContext('(function(f) { f(f) })(function(f) { f(f) })'); }, /RangeError/); -assert.equal(typeof(vm.runInDebugContext('this')), 'object'); -assert.equal(typeof(vm.runInDebugContext('Debug')), 'object'); +assert.equal(typeof vm.runInDebugContext('this'), 'object'); +assert.equal(typeof vm.runInDebugContext('Debug'), 'object'); assert.strictEqual(vm.runInDebugContext(), undefined); assert.strictEqual(vm.runInDebugContext(0), 0); @@ -53,12 +53,30 @@ assert.strictEqual(vm.runInDebugContext(undefined), undefined); assert.equal(breaks, 1); })(); +// Can set listeners and breakpoints on a single line file +(function() { + const Debug = vm.runInDebugContext('Debug'); + const fn = require(common.fixturesDir + '/exports-function-with-param'); + let called = false; + + Debug.setListener(function(event, state, data) { + if (data.constructor.name === 'BreakEvent') { + called = true; + } + }); + + Debug.setBreakPoint(fn); + fn('foo'); + assert.strictEqual(Debug.showBreakPoints(fn), '(arg) { [B0]return arg; }'); + assert.strictEqual(called, true); +})(); + // See https://github.com/nodejs/node/issues/1190, fatal errors should not // crash the process. var script = common.fixturesDir + '/vm-run-in-debug-context.js'; var proc = spawn(process.execPath, [script]); var data = []; -proc.stdout.on('data', assert.fail); +proc.stdout.on('data', common.fail); proc.stderr.on('data', data.push.bind(data)); proc.stderr.once('end', common.mustCall(function() { var haystack = Buffer.concat(data).toString('utf8'); @@ -69,9 +87,9 @@ proc.once('exit', common.mustCall(function(exitCode, signalCode) { assert.equal(signalCode, null); })); -var proc = spawn(process.execPath, [script, 'handle-fatal-exception']); -proc.stdout.on('data', assert.fail); -proc.stderr.on('data', assert.fail); +proc = spawn(process.execPath, [script, 'handle-fatal-exception']); +proc.stdout.on('data', common.fail); +proc.stderr.on('data', common.fail); proc.once('exit', common.mustCall(function(exitCode, signalCode) { assert.equal(exitCode, 42); assert.equal(signalCode, null); diff --git a/test/parallel/test-vm-function-declaration.js b/test/parallel/test-vm-function-declaration.js index 5ff194e12dd8d8..fd41be7564aab0 100644 --- a/test/parallel/test-vm-function-declaration.js +++ b/test/parallel/test-vm-function-declaration.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/parallel/test-vm-global-define-property.js b/test/parallel/test-vm-global-define-property.js index f7f3e4f3df7d76..71e6ae9eaa0b73 100644 --- a/test/parallel/test-vm-global-define-property.js +++ b/test/parallel/test-vm-global-define-property.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/parallel/test-vm-global-identity.js b/test/parallel/test-vm-global-identity.js index 647edb22b44db0..7d90408b64c2c7 100644 --- a/test/parallel/test-vm-global-identity.js +++ b/test/parallel/test-vm-global-identity.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/parallel/test-vm-harmony-proxies.js b/test/parallel/test-vm-harmony-proxies.js index 2f008615ebaf54..71d9faffd9cedf 100644 --- a/test/parallel/test-vm-harmony-proxies.js +++ b/test/parallel/test-vm-harmony-proxies.js @@ -1,19 +1,19 @@ 'use strict'; // Flags: --harmony_proxies -var common = require('../common'); +require('../common'); var assert = require('assert'); var vm = require('vm'); // src/node_contextify.cc filters out the Proxy object from the parent // context. Make sure that the new context has a Proxy object of its own. var sandbox = {}; -var result = vm.runInNewContext('this.Proxy = Proxy', sandbox); +vm.runInNewContext('this.Proxy = Proxy', sandbox); assert(typeof sandbox.Proxy === 'object'); assert(sandbox.Proxy !== Proxy); // Unless we copy the Proxy object explicitly, of course. -var sandbox = { Proxy: Proxy }; -var result = vm.runInNewContext('this.Proxy = Proxy', sandbox); +sandbox = { Proxy: Proxy }; +vm.runInNewContext('this.Proxy = Proxy', sandbox); assert(typeof sandbox.Proxy === 'object'); assert(sandbox.Proxy === Proxy); diff --git a/test/parallel/test-vm-harmony-symbols.js b/test/parallel/test-vm-harmony-symbols.js index 86fde1b978ffb2..456a28f4d54215 100644 --- a/test/parallel/test-vm-harmony-symbols.js +++ b/test/parallel/test-vm-harmony-symbols.js @@ -1,16 +1,16 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var vm = require('vm'); // The sandbox should have its own Symbol constructor. var sandbox = {}; -var result = vm.runInNewContext('this.Symbol = Symbol', sandbox); +vm.runInNewContext('this.Symbol = Symbol', sandbox); assert(typeof sandbox.Symbol === 'function'); assert(sandbox.Symbol !== Symbol); // Unless we copy the Symbol constructor explicitly, of course. -var sandbox = { Symbol: Symbol }; -var result = vm.runInNewContext('this.Symbol = Symbol', sandbox); +sandbox = { Symbol: Symbol }; +vm.runInNewContext('this.Symbol = Symbol', sandbox); assert(typeof sandbox.Symbol === 'function'); assert(sandbox.Symbol === Symbol); diff --git a/test/parallel/test-vm-is-context.js b/test/parallel/test-vm-is-context.js index 5a46a452b91634..cc106a15fbfc61 100644 --- a/test/parallel/test-vm-is-context.js +++ b/test/parallel/test-vm-is-context.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/parallel/test-vm-new-script-new-context.js b/test/parallel/test-vm-new-script-new-context.js index e3cc6e91cb432a..2af8f05f1c5236 100644 --- a/test/parallel/test-vm-new-script-new-context.js +++ b/test/parallel/test-vm-new-script-new-context.js @@ -1,15 +1,15 @@ -/* eslint-disable strict */ -var common = require('../common'); -var assert = require('assert'); -var Script = require('vm').Script; +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const Script = require('vm').Script; common.globalCheck = false; console.error('run a string'); var script = new Script('\'passed\';'); console.error('script created'); -var result1 = script.runInNewContext(); -var result2 = script.runInNewContext(); +const result1 = script.runInNewContext(); +const result2 = script.runInNewContext(); assert.equal('passed', result1); assert.equal('passed', result2); @@ -21,36 +21,37 @@ assert.throws(function() { console.error('undefined reference'); -var error; script = new Script('foo.bar = 5;'); assert.throws(function() { script.runInNewContext(); }, /not defined/); -hello = 5; +global.hello = 5; script = new Script('hello = 2'); script.runInNewContext(); -assert.equal(5, hello); +assert.equal(5, global.hello); console.error('pass values in and out'); -code = 'foo = 1;' + - 'bar = 2;' + - 'if (baz !== 3) throw new Error(\'test fail\');'; -foo = 2; -obj = { foo: 0, baz: 3 }; -script = new Script(code); -var baz = script.runInNewContext(obj); -assert.equal(1, obj.foo); -assert.equal(2, obj.bar); -assert.equal(2, foo); +global.code = 'foo = 1;' + + 'bar = 2;' + + 'if (baz !== 3) throw new Error(\'test fail\');'; +global.foo = 2; +global.obj = { foo: 0, baz: 3 }; +script = new Script(global.code); +/* eslint-disable no-unused-vars */ +var baz = script.runInNewContext(global.obj); +/* eslint-enable no-unused-vars */ +assert.equal(1, global.obj.foo); +assert.equal(2, global.obj.bar); +assert.equal(2, global.foo); console.error('call a function by reference'); script = new Script('f()'); -function changeFoo() { foo = 100; } +function changeFoo() { global.foo = 100; } script.runInNewContext({ f: changeFoo }); -assert.equal(foo, 100); +assert.equal(global.foo, 100); console.error('modify an object by reference'); script = new Script('f.a = 2'); diff --git a/test/parallel/test-vm-new-script-this-context.js b/test/parallel/test-vm-new-script-this-context.js index 16d8acd1ca6700..d225fb0d4025d0 100644 --- a/test/parallel/test-vm-new-script-this-context.js +++ b/test/parallel/test-vm-new-script-this-context.js @@ -1,13 +1,13 @@ -/* eslint-disable strict */ -var common = require('../common'); -var assert = require('assert'); -var Script = require('vm').Script; +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const Script = require('vm').Script; common.globalCheck = false; console.error('run a string'); var script = new Script('\'passed\';'); -var result = script.runInThisContext(script); +const result = script.runInThisContext(script); assert.equal('passed', result); console.error('thrown error'); @@ -16,26 +16,26 @@ assert.throws(function() { script.runInThisContext(script); }); -hello = 5; +global.hello = 5; script = new Script('hello = 2'); script.runInThisContext(script); -assert.equal(2, hello); +assert.equal(2, global.hello); console.error('pass values'); -code = 'foo = 1;' + - 'bar = 2;' + - 'if (typeof baz !== \'undefined\') throw new Error(\'test fail\');'; -foo = 2; -obj = { foo: 0, baz: 3 }; -script = new Script(code); +global.code = 'foo = 1;' + + 'bar = 2;' + + 'if (typeof baz !== "undefined") throw new Error("test fail");'; +global.foo = 2; +global.obj = { foo: 0, baz: 3 }; +script = new Script(global.code); script.runInThisContext(script); -assert.equal(0, obj.foo); -assert.equal(2, bar); -assert.equal(1, foo); +assert.equal(0, global.obj.foo); +assert.equal(2, global.bar); +assert.equal(1, global.foo); console.error('call a function'); -f = function() { foo = 100; }; +global.f = function() { global.foo = 100; }; script = new Script('f()'); script.runInThisContext(script); -assert.equal(100, foo); +assert.equal(100, global.foo); diff --git a/test/parallel/test-vm-preserves-property.js b/test/parallel/test-vm-preserves-property.js index 85ce2d6e8165c8..9786ee54a7cffd 100644 --- a/test/parallel/test-vm-preserves-property.js +++ b/test/parallel/test-vm-preserves-property.js @@ -1,6 +1,6 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/parallel/test-vm-run-in-new-context.js b/test/parallel/test-vm-run-in-new-context.js index da14a041face31..1467ea1e17d808 100644 --- a/test/parallel/test-vm-run-in-new-context.js +++ b/test/parallel/test-vm-run-in-new-context.js @@ -1,16 +1,16 @@ -/* eslint-disable strict */ +'use strict'; // Flags: --expose-gc -var common = require('../common'); -var assert = require('assert'); -var vm = require('vm'); +const common = require('../common'); +const assert = require('assert'); +const vm = require('vm'); assert.equal(typeof gc, 'function', 'Run this test with --expose-gc'); common.globalCheck = false; console.error('run a string'); -var result = vm.runInNewContext('\'passed\';'); +const result = vm.runInNewContext('\'passed\';'); assert.equal('passed', result); console.error('thrown error'); @@ -18,26 +18,28 @@ assert.throws(function() { vm.runInNewContext('throw new Error(\'test\');'); }); -hello = 5; +global.hello = 5; vm.runInNewContext('hello = 2'); -assert.equal(5, hello); +assert.equal(5, global.hello); console.error('pass values in and out'); -code = 'foo = 1;' + - 'bar = 2;' + - 'if (baz !== 3) throw new Error(\'test fail\');'; -foo = 2; -obj = { foo: 0, baz: 3 }; -var baz = vm.runInNewContext(code, obj); -assert.equal(1, obj.foo); -assert.equal(2, obj.bar); -assert.equal(2, foo); +global.code = 'foo = 1;' + + 'bar = 2;' + + 'if (baz !== 3) throw new Error(\'test fail\');'; +global.foo = 2; +global.obj = { foo: 0, baz: 3 }; +/* eslint-disable no-unused-vars */ +var baz = vm.runInNewContext(global.code, global.obj); +/* eslint-enable no-unused-vars */ +assert.equal(1, global.obj.foo); +assert.equal(2, global.obj.bar); +assert.equal(2, global.foo); console.error('call a function by reference'); -function changeFoo() { foo = 100; } +function changeFoo() { global.foo = 100; } vm.runInNewContext('f()', { f: changeFoo }); -assert.equal(foo, 100); +assert.equal(global.foo, 100); console.error('modify an object by reference'); var f = { a: 1 }; diff --git a/test/parallel/test-vm-static-this.js b/test/parallel/test-vm-static-this.js index fb9cb764f8422c..a3cf2d820c3423 100644 --- a/test/parallel/test-vm-static-this.js +++ b/test/parallel/test-vm-static-this.js @@ -14,23 +14,25 @@ assert.throws(function() { vm.runInThisContext('throw new Error(\'test\');'); }, /test/); -hello = 5; +global.hello = 5; vm.runInThisContext('hello = 2'); -assert.equal(2, hello); +assert.equal(2, global.hello); console.error('pass values'); -code = 'foo = 1;' + - 'bar = 2;' + - 'if (typeof baz !== \'undefined\') throw new Error(\'test fail\');'; -foo = 2; -obj = { foo: 0, baz: 3 }; +var code = 'foo = 1;' + + 'bar = 2;' + + 'if (typeof baz !== \'undefined\') throw new Error(\'test fail\');'; +global.foo = 2; +global.obj = { foo: 0, baz: 3 }; +/* eslint-disable no-unused-vars */ var baz = vm.runInThisContext(code); -assert.equal(0, obj.foo); -assert.equal(2, bar); -assert.equal(1, foo); +/* eslint-enable no-unused-vars */ +assert.equal(0, global.obj.foo); +assert.equal(2, global.bar); +assert.equal(1, global.foo); console.error('call a function'); -f = function() { foo = 100; }; +global.f = function() { global.foo = 100; }; vm.runInThisContext('f()'); -assert.equal(100, foo); +assert.equal(100, global.foo); diff --git a/test/parallel/test-vm-symbols.js b/test/parallel/test-vm-symbols.js index d7d0ffe3af6157..d3419af559a2f2 100644 --- a/test/parallel/test-vm-symbols.js +++ b/test/parallel/test-vm-symbols.js @@ -1,6 +1,6 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/parallel/test-vm-syntax-error-message.js b/test/parallel/test-vm-syntax-error-message.js index 4b48b0d474a88d..75748b24e193ee 100644 --- a/test/parallel/test-vm-syntax-error-message.js +++ b/test/parallel/test-vm-syntax-error-message.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var child_process = require('child_process'); diff --git a/test/sequential/test-vm-syntax-error-stderr.js b/test/parallel/test-vm-syntax-error-stderr.js similarity index 100% rename from test/sequential/test-vm-syntax-error-stderr.js rename to test/parallel/test-vm-syntax-error-stderr.js diff --git a/test/parallel/test-vm-timeout.js b/test/parallel/test-vm-timeout.js index e9511e59230a84..b4dd57bb54d234 100644 --- a/test/parallel/test-vm-timeout.js +++ b/test/parallel/test-vm-timeout.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var vm = require('vm'); diff --git a/test/parallel/test-writedouble.js b/test/parallel/test-writedouble.js index 2a9ab11107f147..4e86182137de29 100644 --- a/test/parallel/test-writedouble.js +++ b/test/parallel/test-writedouble.js @@ -2,7 +2,7 @@ /* * Tests to verify we're writing doubles correctly */ -var common = require('../common'); +require('../common'); var ASSERT = require('assert'); function test(clazz) { diff --git a/test/parallel/test-writefloat.js b/test/parallel/test-writefloat.js index 948bf4910208a5..0cb748d603d0ff 100644 --- a/test/parallel/test-writefloat.js +++ b/test/parallel/test-writefloat.js @@ -2,7 +2,7 @@ /* * Tests to verify we're writing floats correctly */ -var common = require('../common'); +require('../common'); var ASSERT = require('assert'); function test(clazz) { diff --git a/test/parallel/test-writeint.js b/test/parallel/test-writeint.js index ee981a157ad761..d05a90d48b5ac6 100644 --- a/test/parallel/test-writeint.js +++ b/test/parallel/test-writeint.js @@ -2,7 +2,7 @@ /* * Tests to verify we're writing signed integers correctly */ -var common = require('../common'); +require('../common'); var ASSERT = require('assert'); function test8(clazz) { diff --git a/test/parallel/test-writeuint.js b/test/parallel/test-writeuint.js index 22579ceecaef2d..843cc423072225 100644 --- a/test/parallel/test-writeuint.js +++ b/test/parallel/test-writeuint.js @@ -2,7 +2,7 @@ /* * A battery of tests to help us read a series of uints */ -var common = require('../common'); +require('../common'); var ASSERT = require('assert'); /* @@ -122,6 +122,25 @@ function test32(clazz) { } +function testUint(clazz) { + const data = new clazz(8); + var val = 1; + + // Test 0 to 5 bytes. + for (var i = 0; i <= 5; i++) { + const errmsg = `byteLength: ${i}`; + ASSERT.throws(function() { + data.writeUIntBE(val, 0, i); + }, /value is out of bounds/, errmsg); + ASSERT.throws(function() { + data.writeUIntLE(val, 0, i); + }, /value is out of bounds/, errmsg); + val *= 0x100; + } +} + + test8(Buffer); test16(Buffer); test32(Buffer); +testUint(Buffer); diff --git a/test/sequential/test-zerolengthbufferbug.js b/test/parallel/test-zerolengthbufferbug.js similarity index 99% rename from test/sequential/test-zerolengthbufferbug.js rename to test/parallel/test-zerolengthbufferbug.js index de36444180b1ec..c56240011d76dd 100644 --- a/test/sequential/test-zerolengthbufferbug.js +++ b/test/parallel/test-zerolengthbufferbug.js @@ -34,4 +34,3 @@ process.on('exit', function() { assert.ok(gotResponse); assert.equal(0, resBodySize); }); - diff --git a/test/parallel/test-zlib-close-after-error.js b/test/parallel/test-zlib-close-after-error.js new file mode 100644 index 00000000000000..2570ca266a6754 --- /dev/null +++ b/test/parallel/test-zlib-close-after-error.js @@ -0,0 +1,14 @@ +'use strict'; +// https://github.com/nodejs/node/issues/6034 + +const common = require('../common'); +const assert = require('assert'); +const zlib = require('zlib'); + +const decompress = zlib.createGunzip(15); + +decompress.on('error', common.mustCall((err) => { + assert.doesNotThrow(() => decompress.close()); +})); + +decompress.write('something invalid'); diff --git a/test/parallel/test-zlib-close-after-write.js b/test/parallel/test-zlib-close-after-write.js index c02ff33fb5eb63..b47deddd8889e9 100644 --- a/test/parallel/test-zlib-close-after-write.js +++ b/test/parallel/test-zlib-close-after-write.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var zlib = require('zlib'); diff --git a/test/parallel/test-zlib-const.js b/test/parallel/test-zlib-const.js index 511eca613a5229..b7eb31d2c5f48c 100644 --- a/test/parallel/test-zlib-const.js +++ b/test/parallel/test-zlib-const.js @@ -1,5 +1,5 @@ /* eslint-disable strict */ -var common = require('../common'); +require('../common'); var assert = require('assert'); var zlib = require('zlib'); diff --git a/test/parallel/test-zlib-convenience-methods.js b/test/parallel/test-zlib-convenience-methods.js index 5808bdf04a8f14..70c102efd2862c 100644 --- a/test/parallel/test-zlib-convenience-methods.js +++ b/test/parallel/test-zlib-convenience-methods.js @@ -1,7 +1,7 @@ 'use strict'; // test convenience methods with and without options supplied -var common = require('../common'); +require('../common'); var assert = require('assert'); var zlib = require('zlib'); diff --git a/test/parallel/test-zlib-dictionary.js b/test/parallel/test-zlib-dictionary.js index 109f4273f767d0..1a491c2ca1f261 100644 --- a/test/parallel/test-zlib-dictionary.js +++ b/test/parallel/test-zlib-dictionary.js @@ -1,12 +1,11 @@ 'use strict'; // test compression/decompression with dictionary -var common = require('../common'); -var assert = require('assert'); -var zlib = require('zlib'); -var path = require('path'); +require('../common'); +const assert = require('assert'); +const zlib = require('zlib'); -var spdyDict = new Buffer([ +const spdyDict = new Buffer([ 'optionsgetheadpostputdeletetraceacceptaccept-charsetaccept-encodingaccept-', 'languageauthorizationexpectfromhostif-modified-sinceif-matchif-none-matchi', 'f-rangeif-unmodifiedsincemax-forwardsproxy-authorizationrangerefererteuser', @@ -22,54 +21,69 @@ var spdyDict = new Buffer([ '.1statusversionurl\0' ].join('')); -var deflate = zlib.createDeflate({ dictionary: spdyDict }); - -var input = [ +const input = [ 'HTTP/1.1 200 Ok', 'Server: node.js', 'Content-Length: 0', '' ].join('\r\n'); -var called = 0; - -// -// We'll use clean-new inflate stream each time -// and .reset() old dirty deflate one -// -function run(num) { - var inflate = zlib.createInflate({ dictionary: spdyDict }); - - if (num === 2) { - deflate.reset(); - deflate.removeAllListeners('data'); - } +function basicDictionaryTest() { + let output = ''; + const deflate = zlib.createDeflate({ dictionary: spdyDict }); + const inflate = zlib.createInflate({ dictionary: spdyDict }); - // Put data into deflate stream deflate.on('data', function(chunk) { inflate.write(chunk); }); - // Get data from inflate stream - var output = []; inflate.on('data', function(chunk) { - output.push(chunk); + output += chunk; + }); + + deflate.on('end', function() { + inflate.end(); }); + inflate.on('end', function() { - called++; + assert.equal(input, output); + }); + + deflate.write(input); + deflate.end(); +} - assert.equal(output.join(''), input); +function deflateResetDictionaryTest() { + let doneReset = false; + let output = ''; + const deflate = zlib.createDeflate({ dictionary: spdyDict }); + const inflate = zlib.createInflate({ dictionary: spdyDict }); - if (num < 2) run(num + 1); + deflate.on('data', function(chunk) { + if (doneReset) + inflate.write(chunk); + }); + + inflate.on('data', function(chunk) { + output += chunk; + }); + + deflate.on('end', function() { + inflate.end(); + }); + + inflate.on('end', function() { + assert.equal(input, output); }); deflate.write(input); deflate.flush(function() { - inflate.end(); + deflate.reset(); + doneReset = true; + deflate.write(input); + deflate.end(); }); } -run(1); -process.on('exit', function() { - assert.equal(called, 2); -}); +basicDictionaryTest(); +deflateResetDictionaryTest(); diff --git a/test/parallel/test-zlib-flush-drain.js b/test/parallel/test-zlib-flush-drain.js new file mode 100644 index 00000000000000..14a42e76cc3874 --- /dev/null +++ b/test/parallel/test-zlib-flush-drain.js @@ -0,0 +1,48 @@ +'use strict'; +require('../common'); +const assert = require('assert'); +const zlib = require('zlib'); + +const bigData = new Buffer(10240).fill('x'); + +const opts = { + level: 0, + highWaterMark: 16 +}; + +const deflater = zlib.createDeflate(opts); + +// shim deflater.flush so we can count times executed +var flushCount = 0; +var drainCount = 0; + +const flush = deflater.flush; +deflater.flush = function(kind, callback) { + flushCount++; + flush.call(this, kind, callback); +}; + +deflater.write(bigData); + +const ws = deflater._writableState; +const beforeFlush = ws.needDrain; +var afterFlush = ws.needDrain; + +deflater.flush(function(err) { + afterFlush = ws.needDrain; +}); + +deflater.on('drain', function() { + drainCount++; +}); + +process.once('exit', function() { + assert.equal(beforeFlush, true, + 'before calling flush the writable stream should need to drain'); + assert.equal(afterFlush, false, + 'after calling flush the writable stream should not need to drain'); + assert.equal(drainCount, 1, + 'the deflater should have emitted a single drain event'); + assert.equal(flushCount, 2, + 'flush should be called twice'); +}); diff --git a/test/parallel/test-zlib-flush-flags.js b/test/parallel/test-zlib-flush-flags.js new file mode 100644 index 00000000000000..08c79f138b5a58 --- /dev/null +++ b/test/parallel/test-zlib-flush-flags.js @@ -0,0 +1,28 @@ +'use strict'; +require('../common'); +const assert = require('assert'); +const zlib = require('zlib'); + +assert.doesNotThrow(() => { + zlib.createGzip({ flush: zlib.Z_SYNC_FLUSH }); +}); + +assert.throws(() => { + zlib.createGzip({ flush: 'foobar' }); +}, /Invalid flush flag: foobar/); + +assert.throws(() => { + zlib.createGzip({ flush: 10000 }); +}, /Invalid flush flag: 10000/); + +assert.doesNotThrow(() => { + zlib.createGzip({ finishFlush: zlib.Z_SYNC_FLUSH }); +}); + +assert.throws(() => { + zlib.createGzip({ finishFlush: 'foobar' }); +}, /Invalid flush flag: foobar/); + +assert.throws(() => { + zlib.createGzip({ finishFlush: 10000 }); +}, /Invalid flush flag: 10000/); diff --git a/test/parallel/test-zlib-flush.js b/test/parallel/test-zlib-flush.js index 6281b8eb21feb2..69f734617e925e 100644 --- a/test/parallel/test-zlib-flush.js +++ b/test/parallel/test-zlib-flush.js @@ -5,18 +5,18 @@ var zlib = require('zlib'); var path = require('path'); var fs = require('fs'); -var file = fs.readFileSync(path.resolve(common.fixturesDir, 'person.jpg')), - chunkSize = 16, - opts = { level: 0 }, - deflater = zlib.createDeflate(opts); +const file = fs.readFileSync(path.resolve(common.fixturesDir, 'person.jpg')); +const chunkSize = 16; +const opts = { level: 0 }; +const deflater = zlib.createDeflate(opts); -var chunk = file.slice(0, chunkSize), - expectedNone = new Buffer([0x78, 0x01]), - blkhdr = new Buffer([0x00, 0x10, 0x00, 0xef, 0xff]), - adler32 = new Buffer([0x00, 0x00, 0x00, 0xff, 0xff]), - expectedFull = Buffer.concat([blkhdr, chunk, adler32]), - actualNone, - actualFull; +const chunk = file.slice(0, chunkSize); +const expectedNone = new Buffer([0x78, 0x01]); +const blkhdr = new Buffer([0x00, 0x10, 0x00, 0xef, 0xff]); +const adler32 = new Buffer([0x00, 0x00, 0x00, 0xff, 0xff]); +const expectedFull = Buffer.concat([blkhdr, chunk, adler32]); +let actualNone; +let actualFull; deflater.write(chunk, function() { deflater.flush(zlib.Z_NO_FLUSH, function() { diff --git a/test/parallel/test-zlib-from-concatenated-gzip.js b/test/parallel/test-zlib-from-concatenated-gzip.js new file mode 100644 index 00000000000000..b5007820c8d0d7 --- /dev/null +++ b/test/parallel/test-zlib-from-concatenated-gzip.js @@ -0,0 +1,80 @@ +'use strict'; +// Test unzipping a gzip file that contains multiple concatenated "members" + +const common = require('../common'); +const assert = require('assert'); +const zlib = require('zlib'); +const path = require('path'); +const fs = require('fs'); + +const abcEncoded = zlib.gzipSync('abc'); +const defEncoded = zlib.gzipSync('def'); + +const data = Buffer.concat([ + abcEncoded, + defEncoded +]); + +assert.equal(zlib.gunzipSync(data).toString(), 'abcdef'); + +zlib.gunzip(data, common.mustCall((err, result) => { + assert.ifError(err); + assert.equal(result, 'abcdef', 'result should match original string'); +})); + +zlib.unzip(data, common.mustCall((err, result) => { + assert.ifError(err); + assert.equal(result, 'abcdef', 'result should match original string'); +})); + +// Multi-member support does not apply to zlib inflate/deflate. +zlib.unzip(Buffer.concat([ + zlib.deflateSync('abc'), + zlib.deflateSync('def') +]), common.mustCall((err, result) => { + assert.ifError(err); + assert.equal(result, 'abc', 'result should match contents of first "member"'); +})); + +// files that have the "right" magic bytes for starting a new gzip member +// in the middle of themselves, even if they are part of a single +// regularly compressed member +const pmmFileZlib = path.join(common.fixturesDir, 'pseudo-multimember-gzip.z'); +const pmmFileGz = path.join(common.fixturesDir, 'pseudo-multimember-gzip.gz'); + +const pmmExpected = zlib.inflateSync(fs.readFileSync(pmmFileZlib)); +const pmmResultBuffers = []; + +fs.createReadStream(pmmFileGz) + .pipe(zlib.createGunzip()) + .on('error', (err) => { + assert.ifError(err); + }) + .on('data', (data) => pmmResultBuffers.push(data)) + .on('finish', common.mustCall(() => { + assert.deepStrictEqual(Buffer.concat(pmmResultBuffers), pmmExpected, + 'result should match original random garbage'); + })); + +// test that the next gzip member can wrap around the input buffer boundary +[0, 1, 2, 3, 4, defEncoded.length].forEach((offset) => { + const resultBuffers = []; + + const unzip = zlib.createGunzip() + .on('error', (err) => { + assert.ifError(err); + }) + .on('data', (data) => resultBuffers.push(data)) + .on('finish', common.mustCall(() => { + assert.strictEqual(Buffer.concat(resultBuffers).toString(), 'abcdef', + `result should match original input (offset = ${offset})`); + })); + + // first write: write "abc" + the first bytes of "def" + unzip.write(Buffer.concat([ + abcEncoded, defEncoded.slice(0, offset) + ])); + + // write remaining bytes of "def" + unzip.end(defEncoded.slice(offset)); +}); diff --git a/test/parallel/test-zlib-from-gzip-with-trailing-garbage.js b/test/parallel/test-zlib-from-gzip-with-trailing-garbage.js new file mode 100644 index 00000000000000..8310564350a354 --- /dev/null +++ b/test/parallel/test-zlib-from-gzip-with-trailing-garbage.js @@ -0,0 +1,51 @@ +'use strict'; +// test unzipping a gzip file that has trailing garbage + +const common = require('../common'); +const assert = require('assert'); +const zlib = require('zlib'); + +// should ignore trailing null-bytes +let data = Buffer.concat([ + zlib.gzipSync('abc'), + zlib.gzipSync('def'), + Buffer(10).fill(0) +]); + +assert.equal(zlib.gunzipSync(data).toString(), 'abcdef'); + +zlib.gunzip(data, common.mustCall((err, result) => { + assert.ifError(err); + assert.equal(result, 'abcdef', 'result should match original string'); +})); + +// if the trailing garbage happens to look like a gzip header, it should +// throw an error. +data = Buffer.concat([ + zlib.gzipSync('abc'), + zlib.gzipSync('def'), + Buffer([0x1f, 0x8b, 0xff, 0xff]), + Buffer(10).fill(0) +]); + +assert.equal(zlib.gunzipSync(data).toString(), 'abcdef'); + +zlib.gunzip(data, common.mustCall((err, result) => { + assert.ifError(err); + assert.equal(result, 'abcdef', 'result should match original string'); +})); + +// In this case the trailing junk is too short to be a gzip segment +// So we ignore it and decompression succeeds. +data = Buffer.concat([ + zlib.gzipSync('abc'), + zlib.gzipSync('def'), + Buffer([0x1f, 0x8b, 0xff, 0xff]) +]); + +assert.equal(zlib.gunzipSync(data).toString(), 'abcdef'); + +zlib.gunzip(data, common.mustCall((err, result) => { + assert.ifError(err); + assert.equal(result, 'abcdef', 'result should match original string'); +})); diff --git a/test/parallel/test-zlib-from-string.js b/test/parallel/test-zlib-from-string.js index 49f4d139c148d9..1c9f0eb012d261 100644 --- a/test/parallel/test-zlib-from-string.js +++ b/test/parallel/test-zlib-from-string.js @@ -1,31 +1,36 @@ 'use strict'; // test compressing and uncompressing a string with zlib -var common = require('../common'); +require('../common'); var assert = require('assert'); var zlib = require('zlib'); -var inputString = 'ΩΩLorem ipsum dolor sit amet, consectetur adipiscing el' + - 'it. Morbi faucibus, purus at gravida dictum, libero arcu convallis la' + - 'cus, in commodo libero metus eu nisi. Nullam commodo, neque nec porta' + - ' placerat, nisi est fermentum augue, vitae gravida tellus sapien sit ' + - 'amet tellus. Aenean non diam orci. Proin quis elit turpis. Suspendiss' + - 'e non diam ipsum. Suspendisse nec ullamcorper odio. Vestibulum arcu m' + - 'i, sodales non suscipit id, ultrices ut massa. Sed ac sem sit amet ar' + - 'cu malesuada fermentum. Nunc sed. '; -var expectedBase64Deflate = 'eJxdUUtOQzEMvMoc4OndgT0gJCT2buJWlpI4jePeqZfpm' + - 'XAKLRKbLOzx/HK73q6vOrhCunlF1qIDJhNUeW5I2ozT5OkDlKWLJWkncJG5403HQXAkT3' + - 'Jw29B9uIEmToMukglZ0vS6ociBh4JG8sV4oVLEUCitK2kxq1WzPnChHDzsaGKy491Lofo' + - 'AbWh8do43oeuYhB5EPCjcLjzYJo48KrfQBvnJecNFJvHT1+RSQsGoC7dn2t/xjhduTA1N' + - 'WyQIZR0pbHwMDatnD+crPqKSqGPHp1vnlsWM/07ubf7bheF7kqSj84Bm0R1fYTfaK8vqq' + - 'qfKBtNMhe3OZh6N95CTvMX5HJJi4xOVzCgUOIMSLH7wmeOHaFE4RdpnGavKtrB5xzfO/Ll9'; -var expectedBase64Gzip = 'H4sIAAAAAAAAA11RS05DMQy8yhzg6d2BPSAkJPZu4laWkjiN' + - '496pl+mZcAotEpss7PH8crverq86uEK6eUXWogMmE1R5bkjajNPk6QOUpYslaSdwkbnjT' + - 'cdBcCRPcnDb0H24gSZOgy6SCVnS9LqhyIGHgkbyxXihUsRQKK0raTGrVbM+cKEcPOxoYr' + - 'Lj3Uuh+gBtaHx2jjeh65iEHkQ8KNwuPNgmjjwqt9AG+cl5w0Um8dPX5FJCwagLt2fa3/G' + - 'OF25MDU1bJAhlHSlsfAwNq2cP5ys+opKoY8enW+eWxYz/Tu5t/tuF4XuSpKPzgGbRHV9h' + - 'N9ory+qqp8oG00yF7c5mHo33kJO8xfkckmLjE5XMKBQ4gxIsfvCZ44doUThF2mcZq8q2s' + - 'HnHNzRtagj5AQAA'; +var inputString = 'ΩΩLorem ipsum dolor sit amet, consectetur adipiscing elit.' + + ' Morbi faucibus, purus at gravida dictum, libero arcu conv' + + 'allis lacus, in commodo libero metus eu nisi. Nullam commo' + + 'do, neque nec porta placerat, nisi est fermentum augue, vi' + + 'tae gravida tellus sapien sit amet tellus. Aenean non diam' + + ' orci. Proin quis elit turpis. Suspendisse non diam ipsum.' + + ' Suspendisse nec ullamcorper odio. Vestibulum arcu mi, sod' + + 'ales non suscipit id, ultrices ut massa. Sed ac sem sit am' + + 'et arcu malesuada fermentum. Nunc sed. '; +var expectedBase64Deflate = 'eJxdUUtOQzEMvMoc4OndgT0gJCT2buJWlpI4jePeqZfpmXAK' + + 'LRKbLOzx/HK73q6vOrhCunlF1qIDJhNUeW5I2ozT5OkDlKWL' + + 'JWkncJG5403HQXAkT3Jw29B9uIEmToMukglZ0vS6ociBh4JG' + + '8sV4oVLEUCitK2kxq1WzPnChHDzsaGKy491LofoAbWh8do43' + + 'oeuYhB5EPCjcLjzYJo48KrfQBvnJecNFJvHT1+RSQsGoC7dn' + + '2t/xjhduTA1NWyQIZR0pbHwMDatnD+crPqKSqGPHp1vnlsWM' + + '/07ubf7bheF7kqSj84Bm0R1fYTfaK8vqqqfKBtNMhe3OZh6N' + + '95CTvMX5HJJi4xOVzCgUOIMSLH7wmeOHaFE4RdpnGavKtrB5' + + 'xzfO/Ll9'; +var expectedBase64Gzip = 'H4sIAAAAAAAAA11RS05DMQy8yhzg6d2BPSAkJPZu4laWkjiN496' + + 'pl+mZcAotEpss7PH8crverq86uEK6eUXWogMmE1R5bkjajNPk6Q' + + 'OUpYslaSdwkbnjTcdBcCRPcnDb0H24gSZOgy6SCVnS9LqhyIGHg' + + 'kbyxXihUsRQKK0raTGrVbM+cKEcPOxoYrLj3Uuh+gBtaHx2jjeh' + + '65iEHkQ8KNwuPNgmjjwqt9AG+cl5w0Um8dPX5FJCwagLt2fa3/G' + + 'OF25MDU1bJAhlHSlsfAwNq2cP5ys+opKoY8enW+eWxYz/Tu5t/t' + + 'uF4XuSpKPzgGbRHV9hN9ory+qqp8oG00yF7c5mHo33kJO8xfkck' + + 'mLjE5XMKBQ4gxIsfvCZ44doUThF2mcZq8q2sHnHNzRtagj5AQAA'; zlib.deflate(inputString, function(err, buffer) { assert.equal(buffer.toString('base64'), expectedBase64Deflate, diff --git a/test/parallel/test-zlib-invalid-input.js b/test/parallel/test-zlib-invalid-input.js index e1e81bacc1a499..91d4efd38831ac 100644 --- a/test/parallel/test-zlib-invalid-input.js +++ b/test/parallel/test-zlib-invalid-input.js @@ -1,9 +1,9 @@ 'use strict'; // test uncompressing invalid input -var common = require('../common'), - assert = require('assert'), - zlib = require('zlib'); +require('../common'); +const assert = require('assert'); +const zlib = require('zlib'); var nonStringInputs = [1, true, {a: 1}, ['a']]; diff --git a/test/parallel/test-zlib-params.js b/test/parallel/test-zlib-params.js index f349c8dbd0afec..8a2b7da851225a 100644 --- a/test/parallel/test-zlib-params.js +++ b/test/parallel/test-zlib-params.js @@ -5,16 +5,16 @@ var zlib = require('zlib'); var path = require('path'); var fs = require('fs'); -var file = fs.readFileSync(path.resolve(common.fixturesDir, 'person.jpg')), - chunkSize = 24 * 1024, - opts = { level: 9, strategy: zlib.Z_DEFAULT_STRATEGY }, - deflater = zlib.createDeflate(opts); +const file = fs.readFileSync(path.resolve(common.fixturesDir, 'person.jpg')); +const chunkSize = 12 * 1024; +const opts = { level: 9, strategy: zlib.Z_DEFAULT_STRATEGY }; +const deflater = zlib.createDeflate(opts); -var chunk1 = file.slice(0, chunkSize), - chunk2 = file.slice(chunkSize), - blkhdr = new Buffer([0x00, 0x48, 0x82, 0xb7, 0x7d]), - expected = Buffer.concat([blkhdr, chunk2]), - actual; +const chunk1 = file.slice(0, chunkSize); +const chunk2 = file.slice(chunkSize); +const blkhdr = new Buffer([0x00, 0x5a, 0x82, 0xa5, 0x7d]); +const expected = Buffer.concat([blkhdr, chunk2]); +let actual; deflater.write(chunk1, function() { deflater.params(0, zlib.Z_DEFAULT_STRATEGY, function() { diff --git a/test/parallel/test-zlib-truncated.js b/test/parallel/test-zlib-truncated.js new file mode 100644 index 00000000000000..da82acb6575b05 --- /dev/null +++ b/test/parallel/test-zlib-truncated.js @@ -0,0 +1,67 @@ +'use strict'; +// tests zlib streams with truncated compressed input + +require('../common'); +const assert = require('assert'); +const zlib = require ('zlib'); + +const inputString = 'ΩΩLorem ipsum dolor sit amet, consectetur adipiscing eli' + + 't. Morbi faucibus, purus at gravida dictum, libero arcu ' + + 'convallis lacus, in commodo libero metus eu nisi. Nullam' + + ' commodo, neque nec porta placerat, nisi est fermentum a' + + 'ugue, vitae gravida tellus sapien sit amet tellus. Aenea' + + 'n non diam orci. Proin quis elit turpis. Suspendisse non' + + ' diam ipsum. Suspendisse nec ullamcorper odio. Vestibulu' + + 'm arcu mi, sodales non suscipit id, ultrices ut massa. S' + + 'ed ac sem sit amet arcu malesuada fermentum. Nunc sed. '; + +[ + { comp: 'gzip', decomp: 'gunzip', decompSync: 'gunzipSync' }, + { comp: 'gzip', decomp: 'unzip', decompSync: 'unzipSync' }, + { comp: 'deflate', decomp: 'inflate', decompSync: 'inflateSync' }, + { comp: 'deflateRaw', decomp: 'inflateRaw', decompSync: 'inflateRawSync' } +].forEach(function(methods) { + zlib[methods.comp](inputString, function(err, compressed) { + assert(!err); + const truncated = compressed.slice(0, compressed.length / 2); + + // sync sanity + assert.doesNotThrow(function() { + const decompressed = zlib[methods.decompSync](compressed); + assert.equal(decompressed, inputString); + }); + + // async sanity + zlib[methods.decomp](compressed, function(err, result) { + assert.ifError(err); + assert.equal(result, inputString); + }); + + // sync truncated input test + assert.throws(function() { + zlib[methods.decompSync](truncated); + }, /unexpected end of file/); + + // async truncated input test + zlib[methods.decomp](truncated, function(err, result) { + assert(/unexpected end of file/.test(err.message)); + }); + + const syncFlushOpt = { finishFlush: zlib.Z_SYNC_FLUSH }; + + // sync truncated input test, finishFlush = Z_SYNC_FLUSH + assert.doesNotThrow(function() { + const result = zlib[methods.decompSync](truncated, syncFlushOpt) + .toString(); + assert.equal(result, inputString.substr(0, result.length)); + }); + + // async truncated input test, finishFlush = Z_SYNC_FLUSH + zlib[methods.decomp](truncated, syncFlushOpt, function(err, decompressed) { + assert.ifError(err); + + const result = decompressed.toString(); + assert.equal(result, inputString.substr(0, result.length)); + }); + }); +}); diff --git a/test/parallel/test-zlib-unzip-one-byte-chunks.js b/test/parallel/test-zlib-unzip-one-byte-chunks.js new file mode 100644 index 00000000000000..f1b1c0f5084be9 --- /dev/null +++ b/test/parallel/test-zlib-unzip-one-byte-chunks.js @@ -0,0 +1,28 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const zlib = require('zlib'); + +const data = Buffer.concat([ + zlib.gzipSync('abc'), + zlib.gzipSync('def') +]); + +const resultBuffers = []; + +const unzip = zlib.createUnzip() + .on('error', (err) => { + assert.ifError(err); + }) + .on('data', (data) => resultBuffers.push(data)) + .on('finish', common.mustCall(() => { + assert.deepStrictEqual(Buffer.concat(resultBuffers).toString(), 'abcdef', + 'result should match original string'); + })); + +for (let i = 0; i < data.length; i++) { + // Write each single byte individually. + unzip.write(Buffer.from([data[i]])); +} + +unzip.end(); diff --git a/test/parallel/test-zlib-write-after-close.js b/test/parallel/test-zlib-write-after-close.js index a1d9adb6d9b996..b1d35935e8ab19 100644 --- a/test/parallel/test-zlib-write-after-close.js +++ b/test/parallel/test-zlib-write-after-close.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var zlib = require('zlib'); diff --git a/test/parallel/test-zlib-write-after-flush.js b/test/parallel/test-zlib-write-after-flush.js index 4c53ca49ebf758..fa70c5f14dee6c 100644 --- a/test/parallel/test-zlib-write-after-flush.js +++ b/test/parallel/test-zlib-write-after-flush.js @@ -1,8 +1,7 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var zlib = require('zlib'); -var fs = require('fs'); var gzip = zlib.createGzip(); var gunz = zlib.createUnzip(); diff --git a/test/parallel/test-zlib-zero-byte.js b/test/parallel/test-zlib-zero-byte.js index 9aa260a7f3149d..826a9c7c79793d 100644 --- a/test/parallel/test-zlib-zero-byte.js +++ b/test/parallel/test-zlib-zero-byte.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var zlib = require('zlib'); diff --git a/test/parallel/test-zlib.js b/test/parallel/test-zlib.js index b3f193d0a60b2c..caaa62c69ae70b 100644 --- a/test/parallel/test-zlib.js +++ b/test/parallel/test-zlib.js @@ -42,7 +42,7 @@ var testFiles = ['person.jpg', 'elipses.txt', 'empty.txt']; if (process.env.FAST) { zlibPairs = [[zlib.Gzip, zlib.Unzip]]; - var testFiles = ['person.jpg']; + testFiles = ['person.jpg']; } var tests = {}; @@ -125,11 +125,10 @@ SlowStream.prototype.resume = function() { SlowStream.prototype.end = function(chunk) { // walk over the chunk in blocks. - var self = this; - self.chunk = chunk; - self.length = chunk.length; - self.resume(); - return self.ended; + this.chunk = chunk; + this.length = chunk.length; + this.resume(); + return this.ended; }; @@ -166,9 +165,9 @@ Object.keys(tests).forEach(function(file) { // verify that the same exact buffer comes out the other end. buf.on('data', function(c) { var msg = file + ' ' + - chunkSize + ' ' + - JSON.stringify(opts) + ' ' + - Def.name + ' -> ' + Inf.name; + chunkSize + ' ' + + JSON.stringify(opts) + ' ' + + Def.name + ' -> ' + Inf.name; var ok = true; var testNum = ++done; for (var i = 0; i < Math.max(c.length, test.length); i++) { diff --git a/test/pummel/test-crypto-dh.js b/test/pummel/test-crypto-dh.js index a223e45c866bcd..6ebfb878be0631 100644 --- a/test/pummel/test-crypto-dh.js +++ b/test/pummel/test-crypto-dh.js @@ -1,10 +1,9 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); +const crypto = require('crypto'); -try { - var crypto = require('crypto'); -} catch (e) { +if (!common.hasCrypto) { console.log('1..0 # Skipped: node compiled without OpenSSL.'); return; } @@ -20,27 +19,30 @@ assert.throws(function() { }); var hashes = { - modp1 : 'b4b330a6ffeacfbd861e7fe2135b4431', - modp2 : '7c3c5cad8b9f378d88f1dd64a4b6413a', - modp5 : 'b1d2acc22c542e08669a5c5ae812694d', - modp14 : '8d041538cecc1a7d915ba4b718f8ad20', - modp15 : 'dc3b93def24e078c4fbf92d5e14ba69b', - modp16 : 'a273487f46f699461f613b3878d9dfd9', - modp17 : 'dc76e09935310348c492de9bd82014d0', - modp18 : 'db08973bfd2371758a69db180871c993' + modp1 : '630e9acd2cc63f7e80d8507624ba60ac0757201a', + modp2 : '18f7aa964484137f57bca64b21917a385b6a0b60', + modp5 : 'c0a8eec0c2c8a5ec2f9c26f9661eb339a010ec61', + modp14 : 'af5455606fe74cec49782bb374e4c63c9b1d132c', + modp15 : '7bdd39e5cdbb9748113933e5c2623b559c534e74', + modp16 : 'daea5277a7ad0116e734a8e0d2f297ef759d1161', + modp17 : '3b62aaf0142c2720f0bf26a9589b0432c00eadc1', + modp18 : 'a870b491bbbec9b131ae9878d07449d32e54f160' }; -for (var name in hashes) { +for (const name in hashes) { var group = crypto.getDiffieHellman(name); var private_key = group.getPrime('hex'); var hash1 = hashes[name]; - var hash2 = crypto.createHash('md5') + var hash2 = crypto.createHash('sha1') .update(private_key.toUpperCase()).digest('hex'); assert.equal(hash1, hash2); assert.equal(group.getGenerator('hex'), '02'); } -for (var name in hashes) { +for (const name in hashes) { + // modp1 is 768 bits, FIPS requires >= 1024 + if (name == 'modp1' && common.hasFipsCrypto) + continue; var group1 = crypto.getDiffieHellman(name); var group2 = crypto.getDiffieHellman(name); group1.generateKeys(); diff --git a/test/pummel/test-dh-regr.js b/test/pummel/test-dh-regr.js index 1b4f0090e3847e..e6b2f82bd9e465 100644 --- a/test/pummel/test-dh-regr.js +++ b/test/pummel/test-dh-regr.js @@ -8,11 +8,11 @@ if (!common.hasCrypto) { } var crypto = require('crypto'); -var p = crypto.createDiffieHellman(256).getPrime(); +var p = crypto.createDiffieHellman(1024).getPrime(); for (var i = 0; i < 2000; i++) { - var a = crypto.createDiffieHellman(p), - b = crypto.createDiffieHellman(p); + const a = crypto.createDiffieHellman(p); + const b = crypto.createDiffieHellman(p); a.generateKeys(); b.generateKeys(); diff --git a/test/pummel/test-dtrace-jsstack.js b/test/pummel/test-dtrace-jsstack.js index 67194a3dd77f53..f53c950baa32e9 100644 --- a/test/pummel/test-dtrace-jsstack.js +++ b/test/pummel/test-dtrace-jsstack.js @@ -1,8 +1,7 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var os = require('os'); -var util = require('util'); if (os.type() != 'SunOS') { console.log('1..0 # Skipped: no DTRACE support'); @@ -13,10 +12,9 @@ if (os.type() != 'SunOS') { * Some functions to create a recognizable stack. */ var frames = [ 'stalloogle', 'bagnoogle', 'doogle' ]; -var expected; var stalloogle = function(str) { - expected = str; + global.expected = str; os.loadavg(); }; @@ -34,8 +32,6 @@ var doogle = function() { }; var spawn = require('child_process').spawn; -var prefix = '/var/tmp/node'; -var corefile = prefix + '.' + process.pid; /* * We're going to use DTrace to stop us, gcore us, and set us running again diff --git a/test/pummel/test-exec.js b/test/pummel/test-exec.js index 0ff1e2a7cf61b7..90abaf6caaa1db 100644 --- a/test/pummel/test-exec.js +++ b/test/pummel/test-exec.js @@ -3,13 +3,14 @@ var common = require('../common'); var assert = require('assert'); var exec = require('child_process').exec; +var SLEEP3_COMMAND; if (!common.isWindows) { // Unix. - var SLEEP3_COMMAND = 'sleep 3'; + SLEEP3_COMMAND = 'sleep 3'; } else { // Windows: `choice` is a command built into cmd.exe. Use another cmd process // to create a process tree, so we can catch bugs related to it. - var SLEEP3_COMMAND = 'cmd /c choice /t 3 /c X /d X'; + SLEEP3_COMMAND = 'cmd /c choice /t 3 /c X /d X'; } @@ -17,19 +18,21 @@ var success_count = 0; var error_count = 0; -exec('"' + process.execPath + '" -p -e process.versions', - function(err, stdout, stderr) { - if (err) { - error_count++; - console.log('error!: ' + err.code); - console.log('stdout: ' + JSON.stringify(stdout)); - console.log('stderr: ' + JSON.stringify(stderr)); - assert.equal(false, err.killed); - } else { - success_count++; - console.dir(stdout); +exec( + '"' + process.execPath + '" -p -e process.versions', + function(err, stdout, stderr) { + if (err) { + error_count++; + console.log('error!: ' + err.code); + console.log('stdout: ' + JSON.stringify(stdout)); + console.log('stderr: ' + JSON.stringify(stderr)); + assert.equal(false, err.killed); + } else { + success_count++; + console.dir(stdout); + } } -}); +); exec('thisisnotavalidcommand', function(err, stdout, stderr) { diff --git a/test/pummel/test-fs-watch-file-slow.js b/test/pummel/test-fs-watch-file-slow.js index cd4b16bf310b99..c21785f233c58f 100644 --- a/test/pummel/test-fs-watch-file-slow.js +++ b/test/pummel/test-fs-watch-file-slow.js @@ -19,19 +19,19 @@ catch (e) { fs.watchFile(FILENAME, {interval:TIMEOUT - 250}, function(curr, prev) { console.log([curr, prev]); switch (++nevents) { - case 1: - assert.equal(common.fileExists(FILENAME), false); - break; - case 2: - case 3: - assert.equal(common.fileExists(FILENAME), true); - break; - case 4: - assert.equal(common.fileExists(FILENAME), false); - fs.unwatchFile(FILENAME); - break; - default: - assert(0); + case 1: + assert.equal(common.fileExists(FILENAME), false); + break; + case 2: + case 3: + assert.equal(common.fileExists(FILENAME), true); + break; + case 4: + assert.equal(common.fileExists(FILENAME), false); + fs.unwatchFile(FILENAME); + break; + default: + assert(0); } }); diff --git a/test/pummel/test-fs-watch-file.js b/test/pummel/test-fs-watch-file.js index 7b57803dd4ec93..4e08e9e9d1cc9b 100644 --- a/test/pummel/test-fs-watch-file.js +++ b/test/pummel/test-fs-watch-file.js @@ -9,7 +9,6 @@ var watchSeenTwo = 0; var watchSeenThree = 0; var watchSeenFour = 0; -var startDir = process.cwd(); var testDir = common.tmpDir; var filenameOne = 'watch.txt'; diff --git a/test/pummel/test-fs-watch-non-recursive.js b/test/pummel/test-fs-watch-non-recursive.js index 6adb193928e44f..ead7de9e28dc47 100644 --- a/test/pummel/test-fs-watch-non-recursive.js +++ b/test/pummel/test-fs-watch-non-recursive.js @@ -1,6 +1,5 @@ 'use strict'; var common = require('../common'); -var assert = require('assert'); var path = require('path'); var fs = require('fs'); @@ -19,7 +18,7 @@ try { fs.mkdirSync(testsubdir, 0o700); } catch (e) {} // Need a grace period, else the mkdirSync() above fires off an event. setTimeout(function() { - var watcher = fs.watch(testDir, { persistent: true }, assert.fail); + var watcher = fs.watch(testDir, { persistent: true }, common.fail); setTimeout(function() { fs.writeFileSync(filepath, 'test'); }, 100); diff --git a/test/pummel/test-http-client-reconnect-bug.js b/test/pummel/test-http-client-reconnect-bug.js index bd852e45f19410..7b9b8b0da1bcb0 100644 --- a/test/pummel/test-http-client-reconnect-bug.js +++ b/test/pummel/test-http-client-reconnect-bug.js @@ -1,10 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); - -var net = require('net'), - util = require('util'), - http = require('http'); +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); +const http = require('http'); var errorCount = 0; var eofCount = 0; diff --git a/test/pummel/test-http-upload-timeout.js b/test/pummel/test-http-upload-timeout.js index 08132e3c7594d1..6e5a7ed0506ffd 100644 --- a/test/pummel/test-http-upload-timeout.js +++ b/test/pummel/test-http-upload-timeout.js @@ -2,11 +2,10 @@ // This tests setTimeout() by having multiple clients connecting and sending // data in random intervals. Clients are also randomly disconnecting until there // are no more clients left. If no false timeout occurs, this test has passed. -var common = require('../common'), - assert = require('assert'), - http = require('http'), - server = http.createServer(), - connections = 0; +const common = require('../common'); +const http = require('http'); +const server = http.createServer(); +let connections = 0; server.on('request', function(req, res) { req.socket.setTimeout(1000); diff --git a/test/pummel/test-https-large-response.js b/test/pummel/test-https-large-response.js index 4a15b29cd19467..1979c6737f76b3 100644 --- a/test/pummel/test-https-large-response.js +++ b/test/pummel/test-https-large-response.js @@ -16,12 +16,9 @@ var options = { }; var reqCount = 0; -var body = ''; process.stdout.write('build body...'); -for (var i = 0; i < 1024 * 1024; i++) { - body += 'hello world\n'; -} +var body = 'hello world\n'.repeat(1024 * 1024); process.stdout.write('done\n'); var server = https.createServer(options, function(req, res) { diff --git a/test/pummel/test-https-no-reader.js b/test/pummel/test-https-no-reader.js index 753687e67a5589..d9d2b64cc73d62 100644 --- a/test/pummel/test-https-no-reader.js +++ b/test/pummel/test-https-no-reader.js @@ -18,8 +18,6 @@ var options = { }; var buf = new Buffer(1024 * 1024); -var sent = 0; -var received = 0; var server = https.createServer(options, function(req, res) { res.writeHead(200); @@ -30,7 +28,6 @@ var server = https.createServer(options, function(req, res) { }); server.listen(common.PORT, function() { - var resumed = false; var req = https.request({ method: 'POST', port: common.PORT, diff --git a/test/pummel/test-keep-alive.js b/test/pummel/test-keep-alive.js index c2ec7fd81f1691..46190555b27263 100644 --- a/test/pummel/test-keep-alive.js +++ b/test/pummel/test-keep-alive.js @@ -5,7 +5,6 @@ var common = require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; var http = require('http'); -var path = require('path'); var url = require('url'); if (common.isWindows) { diff --git a/test/pummel/test-net-many-clients.js b/test/pummel/test-net-many-clients.js index 6d9dde1ddbc863..cb766ec1a47c63 100644 --- a/test/pummel/test-net-many-clients.js +++ b/test/pummel/test-net-many-clients.js @@ -11,10 +11,7 @@ var connections_per_client = 5; // measured var total_connections = 0; -var body = ''; -for (var i = 0; i < bytes; i++) { - body += 'C'; -} +var body = 'C'.repeat(bytes); var server = net.createServer(function(c) { console.log('connected'); diff --git a/test/pummel/test-net-throttle.js b/test/pummel/test-net-throttle.js index 54956b789aed93..d2f32ec25b6ff2 100644 --- a/test/pummel/test-net-throttle.js +++ b/test/pummel/test-net-throttle.js @@ -1,18 +1,15 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var net = require('net'); +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); -var N = 1024 * 1024; -var part_N = N / 3; +const N = 1024 * 1024; +const part_N = N / 3; var chars_recved = 0; var npauses = 0; console.log('build big string'); -var body = ''; -for (var i = 0; i < N; i++) { - body += 'C'; -} +const body = 'C'.repeat(N); console.log('start server on port ' + common.PORT); diff --git a/test/pummel/test-next-tick-infinite-calls.js b/test/pummel/test-next-tick-infinite-calls.js index d4fdb3496423eb..18223885d6cc19 100644 --- a/test/pummel/test-next-tick-infinite-calls.js +++ b/test/pummel/test-next-tick-infinite-calls.js @@ -1,6 +1,5 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +require('../common'); var complete = 0; diff --git a/test/pummel/test-process-hrtime.js b/test/pummel/test-process-hrtime.js index 4fd66c03907aac..04225bae421b1a 100644 --- a/test/pummel/test-process-hrtime.js +++ b/test/pummel/test-process-hrtime.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var start = process.hrtime(); diff --git a/test/pummel/test-process-uptime.js b/test/pummel/test-process-uptime.js index a80806c2099cb1..8d2d88b74f736f 100644 --- a/test/pummel/test-process-uptime.js +++ b/test/pummel/test-process-uptime.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); console.error(process.uptime()); diff --git a/test/pummel/test-regress-GH-814.js b/test/pummel/test-regress-GH-814.js index 4ed4b31ae28143..820903d68873e7 100644 --- a/test/pummel/test-regress-GH-814.js +++ b/test/pummel/test-regress-GH-814.js @@ -46,7 +46,7 @@ var timeToQuit = Date.now() + 8e3; //Test during no more than this seconds. } } else { - throw Error("Buffer GC'ed test -> FAIL"); + throw new Error("Buffer GC'ed test -> FAIL"); } if (Date.now() < timeToQuit) { diff --git a/test/pummel/test-regress-GH-814_2.js b/test/pummel/test-regress-GH-814_2.js index 9de1a2c3f3b86b..d7c6d947919d59 100644 --- a/test/pummel/test-regress-GH-814_2.js +++ b/test/pummel/test-regress-GH-814_2.js @@ -21,7 +21,7 @@ function tailCB(data) { console.error('[FAIL]\n DATA -> '); console.error(data); console.error('\n'); - throw Error('Buffers GC test -> FAIL'); + throw new Error('Buffers GC test -> FAIL'); } } diff --git a/test/pummel/test-regress-GH-892.js b/test/pummel/test-regress-GH-892.js index 67f9dd95aebe5f..11cab1b8b6230e 100644 --- a/test/pummel/test-regress-GH-892.js +++ b/test/pummel/test-regress-GH-892.js @@ -17,11 +17,7 @@ var https = require('https'); var fs = require('fs'); -var PORT = 8000; - - var bytesExpected = 1024 * 1024 * 32; -var gotResponse = false; var started = false; diff --git a/test/pummel/test-stream-pipe-multi.js b/test/pummel/test-stream-pipe-multi.js index 807e3c1415154e..4524f8ca0b68c0 100644 --- a/test/pummel/test-stream-pipe-multi.js +++ b/test/pummel/test-stream-pipe-multi.js @@ -2,7 +2,7 @@ // Test that having a bunch of streams piping in parallel // doesn't break anything. -var common = require('../common'); +require('../common'); var assert = require('assert'); var Stream = require('stream').Stream; var rr = []; @@ -49,11 +49,11 @@ process.on('exit', function() { assert.equal(cnt, rclosed, 'readable streams closed'); }); -for (var i = 0; i < chunkSize; i++) { - chunkSize[i] = i % 256; +for (let i = 0; i < chunkSize; i++) { + data[i] = i; } -for (var i = 0; i < cnt; i++) { +for (let i = 0; i < cnt; i++) { var r = new FakeStream(); r.on('close', function() { console.error(this.ID, 'read close'); diff --git a/test/pummel/test-stream2-basic.js b/test/pummel/test-stream2-basic.js index fe921dc0058374..564a3f7f42d5a0 100644 --- a/test/pummel/test-stream2-basic.js +++ b/test/pummel/test-stream2-basic.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var R = require('_stream_readable'); var assert = require('assert'); @@ -157,7 +157,6 @@ test('pipe', function(t) { 'xxxxx' ]; var w = new TestWriter(); - var flush = true; w.on('end', function(received) { t.same(received, expect); @@ -439,7 +438,6 @@ test('adding readable triggers data flow', function(t) { r.push(new Buffer('asdf')); }; - var called = false; r.on('readable', function() { onReadable = true; r.read(); diff --git a/test/pummel/test-timer-wrap.js b/test/pummel/test-timer-wrap.js index 62ba69d3fde033..d2e96e066d2fb1 100644 --- a/test/pummel/test-timer-wrap.js +++ b/test/pummel/test-timer-wrap.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var timeouts = 0; diff --git a/test/pummel/test-timer-wrap2.js b/test/pummel/test-timer-wrap2.js index b289a85644a068..87497b2685f5d3 100644 --- a/test/pummel/test-timer-wrap2.js +++ b/test/pummel/test-timer-wrap2.js @@ -1,9 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +require('../common'); // Test that allocating a timer does not increase the loop's reference // count. var Timer = process.binding('timer_wrap').Timer; -var t = new Timer(); +new Timer(); diff --git a/test/pummel/test-timers.js b/test/pummel/test-timers.js index 2225da91edcf5f..3525c827a9e6b7 100644 --- a/test/pummel/test-timers.js +++ b/test/pummel/test-timers.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var WINDOW = 200; // why is does this need to be so big? @@ -30,7 +30,7 @@ clearTimeout(id); setInterval(function() { interval_count += 1; - var endtime = new Date( ); + var endtime = new Date(); var diff = endtime - starttime; assert.ok(diff > 0); @@ -91,12 +91,12 @@ function t() { expectedTimeouts--; } -var w = setTimeout(t, 200); -var x = setTimeout(t, 200); +setTimeout(t, 200); +setTimeout(t, 200); var y = setTimeout(t, 200); clearTimeout(y); -var z = setTimeout(t, 200); +setTimeout(t, 200); clearTimeout(y); diff --git a/test/pummel/test-tls-securepair-client.js b/test/pummel/test-tls-securepair-client.js index aaf8e628d6a2bc..3d33ef8f21623f 100644 --- a/test/pummel/test-tls-securepair-client.js +++ b/test/pummel/test-tls-securepair-client.js @@ -17,9 +17,7 @@ var join = require('path').join; var net = require('net'); var assert = require('assert'); var fs = require('fs'); -var crypto = require('crypto'); var tls = require('tls'); -var exec = require('child_process').exec; var spawn = require('child_process').spawn; test1(); @@ -47,8 +45,6 @@ function test(keyfn, certfn, check, next) { // EADDRINUSE. var PORT = common.PORT + 5; - var connections = 0; - keyfn = join(common.fixturesDir, keyfn); var key = fs.readFileSync(keyfn).toString(); diff --git a/test/pummel/test-tls-server-large-request.js b/test/pummel/test-tls-server-large-request.js index d7663e936de78a..cb740c63ed7d68 100644 --- a/test/pummel/test-tls-server-large-request.js +++ b/test/pummel/test-tls-server-large-request.js @@ -24,7 +24,7 @@ var options = { function Mediator() { stream.Writable.call(this); this.buf = ''; -}; +} util.inherits(Mediator, stream.Writable); Mediator.prototype._write = function write(data, enc, cb) { diff --git a/test/pummel/test-tls-throttle.js b/test/pummel/test-tls-throttle.js index 67efb61b7e66aa..0e5cd455c8c4c4 100644 --- a/test/pummel/test-tls-throttle.js +++ b/test/pummel/test-tls-throttle.js @@ -12,16 +12,10 @@ if (!common.hasCrypto) { var tls = require('tls'); var fs = require('fs'); - -var body = ''; - process.stdout.write('build body...'); -for (var i = 0; i < 1024 * 1024; i++) { - body += 'hello world\n'; -} +var body = 'hello world\n'.repeat(1024 * 1024); process.stdout.write('done\n'); - var options = { key: fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem'), cert: fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem') diff --git a/test/pummel/test-vm-memleak.js b/test/pummel/test-vm-memleak.js index f93f34127f9219..c6623991922da9 100644 --- a/test/pummel/test-vm-memleak.js +++ b/test/pummel/test-vm-memleak.js @@ -1,8 +1,8 @@ 'use strict'; // Flags: --max_old_space_size=32 +require('../common'); var assert = require('assert'); -var common = require('../common'); var start = Date.now(); var maxMem = 0; diff --git a/test/pummel/test-watch-file.js b/test/pummel/test-watch-file.js index 1d0ef77d543e43..b87711c7a17c45 100644 --- a/test/pummel/test-watch-file.js +++ b/test/pummel/test-watch-file.js @@ -6,7 +6,6 @@ var fs = require('fs'); var path = require('path'); var f = path.join(common.fixturesDir, 'x.txt'); -var f2 = path.join(common.fixturesDir, 'x2.txt'); console.log('watching for changes of ' + f); diff --git a/test/sequential/sequential.status b/test/sequential/sequential.status index e7f0ca2b323992..a8db7594934708 100644 --- a/test/sequential/sequential.status +++ b/test/sequential/sequential.status @@ -5,16 +5,21 @@ prefix sequential # sample-test : PASS,FLAKY [true] # This section applies to all platforms -test-repl-persistent-history : PASS,FLAKY [$system==win32] [$system==linux] -test-vm-syntax-error-stderr : PASS,FLAKY [$system==macos] [$system==solaris] # Also applies to SmartOS +test-http-regr-gh-2928 : PASS,FLAKY [$system==freebsd] +# fs-watch currently needs special configuration on AIX and we +# want to improve under https://github.com/nodejs/node/issues/5085. +# Tests are disabled so CI can be green and we can spot other +# regressions until this work is complete +[$system==aix] +test-fs-watch : FAIL,PASS diff --git a/test/sequential/test-child-process-emfile.js b/test/sequential/test-child-process-emfile.js index ae7964d9e7a7d6..2ac0b6c0b23a73 100644 --- a/test/sequential/test-child-process-emfile.js +++ b/test/sequential/test-child-process-emfile.js @@ -1,30 +1,46 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var spawn = require('child_process').spawn; -var fs = require('fs'); +const common = require('../common'); +const assert = require('assert'); +const child_process = require('child_process'); +const fs = require('fs'); if (common.isWindows) { console.log('1..0 # Skipped: no RLIMIT_NOFILE on Windows'); return; } -var openFds = []; +const ulimit = Number(child_process.execSync('ulimit -Hn')); +if (ulimit > 64 || Number.isNaN(ulimit)) { + // Sorry about this nonsense. It can be replaced if + // https://github.com/nodejs/node-v0.x-archive/pull/2143#issuecomment-2847886 + // ever happens. + const result = child_process.spawnSync( + '/bin/sh', + ['-c', `ulimit -n 64 && '${process.execPath}' '${__filename}'`] + ); + assert.strictEqual(result.stdout.toString(), ''); + assert.strictEqual(result.stderr.toString(), ''); + assert.strictEqual(result.status, 0); + assert.strictEqual(result.error, undefined); + return; +} + +const openFds = []; for (;;) { try { openFds.push(fs.openSync(__filename, 'r')); } catch (err) { - assert(err.code === 'EMFILE' || err.code === 'ENFILE'); + assert(err.code === 'EMFILE'); break; } } // Should emit an error, not throw. -var proc = spawn(process.execPath, ['-e', '0']); +const proc = child_process.spawn(process.execPath, ['-e', '0']); proc.on('error', common.mustCall(function(err) { - assert(err.code === 'EMFILE' || err.code === 'ENFILE'); + assert.strictEqual(err.code, 'EMFILE'); })); proc.on('exit', function() { diff --git a/test/sequential/test-child-process-execsync.js b/test/sequential/test-child-process-execsync.js index 0bc4e02c65edb8..6c7df10ffb09a7 100644 --- a/test/sequential/test-child-process-execsync.js +++ b/test/sequential/test-child-process-execsync.js @@ -1,7 +1,6 @@ 'use strict'; var common = require('../common'); var assert = require('assert'); -var os = require('os'); var execSync = require('child_process').execSync; var execFileSync = require('child_process').execFileSync; @@ -13,8 +12,7 @@ var start = Date.now(); var err; var caught = false; -try -{ +try { var cmd = `"${process.execPath}" -e "setTimeout(function(){}, ${SLEEP});"`; var ret = execSync(cmd, {timeout: TIMER}); } catch (e) { @@ -40,7 +38,7 @@ var msgBuf = new Buffer(msg + '\n'); cmd = `"${process.execPath}" -e "console.log(\'${msg}\');"`; -var ret = execSync(cmd); +ret = execSync(cmd); assert.strictEqual(ret.length, msgBuf.length); assert.deepEqual(ret, msgBuf, 'execSync result buffer should match'); diff --git a/test/sequential/test-child-process-fork-getconnections.js b/test/sequential/test-child-process-fork-getconnections.js index 934df28d7988b7..8928ef6c744ba4 100644 --- a/test/sequential/test-child-process-fork-getconnections.js +++ b/test/sequential/test-child-process-fork-getconnections.js @@ -6,12 +6,12 @@ const net = require('net'); const count = 12; if (process.argv[2] === 'child') { - let sockets = []; + const sockets = []; process.on('message', function(m, socket) { function sendClosed(id) { process.send({ id: id, status: 'closed'}); - }; + } if (m.cmd === 'new') { assert(socket); @@ -42,7 +42,7 @@ if (process.argv[2] === 'child') { }); const server = net.createServer(); - let sockets = []; + const sockets = []; let sent = 0; server.on('connection', function(socket) { @@ -56,9 +56,9 @@ if (process.argv[2] === 'child') { let disconnected = 0; server.on('listening', function() { - let j = count, client; + let j = count; while (j--) { - client = net.connect(common.PORT, '127.0.0.1'); + const client = net.connect(common.PORT, '127.0.0.1'); client.on('close', function() { disconnected += 1; }); @@ -82,7 +82,7 @@ if (process.argv[2] === 'child') { }); sent++; child.send({ id: i, cmd: 'close' }); - }; + } let closeEmitted = false; server.on('close', function() { diff --git a/test/sequential/test-debugger-util-regression.js b/test/sequential/test-debugger-util-regression.js new file mode 100644 index 00000000000000..a2461a480c9466 --- /dev/null +++ b/test/sequential/test-debugger-util-regression.js @@ -0,0 +1,70 @@ +'use strict'; +const path = require('path'); +const spawn = require('child_process').spawn; +const assert = require('assert'); + +const common = require('../common'); + +const fixture = path.join( + common.fixturesDir, + 'debugger-util-regression-fixture.js' +); + +const args = [ + 'debug', + `--port=${common.PORT}`, + fixture +]; + +const proc = spawn(process.execPath, args, { stdio: 'pipe' }); +proc.stdout.setEncoding('utf8'); +proc.stderr.setEncoding('utf8'); + +function fail() { + common.fail('the program should not hang'); +} + +const timer = setTimeout(fail, common.platformTimeout(4000)); + +let stdout = ''; +let stderr = ''; + +let nextCount = 0; + +proc.stdout.on('data', (data) => { + stdout += data; + if (stdout.includes('> 1') && nextCount < 1 || + stdout.includes('> 2') && nextCount < 2 || + stdout.includes('> 3') && nextCount < 3 || + stdout.includes('> 4') && nextCount < 4) { + nextCount++; + proc.stdin.write('n\n'); + } + else if (stdout.includes('{ a: \'b\' }')) { + clearTimeout(timer); + proc.stdin.write('.exit\n'); + } + else if (stdout.includes('program terminated')) { + // Catch edge case present in v4.x + // process will terminate after call to util.inspect + common.fail('the program should not terminate'); + } +}); + +proc.stderr.on('data', (data) => stderr += data); + +// FIXME +// This test has been periodically failing on certain systems due to +// uncaught errors on proc.stdin. This will stop the process from +// exploding but is still not an elegant solution. Likely a deeper bug +// causing this problem. +proc.stdin.on('error', (err) => { + console.error(err); +}); + +process.on('exit', (code) => { + assert.equal(code, 0, 'the program should exit cleanly'); + assert.equal(stdout.includes('{ a: \'b\' }'), true, + 'the debugger should print the result of util.inspect'); + assert.equal(stderr, '', 'stderr should be empty'); +}); diff --git a/test/sequential/test-deprecation-flags.js b/test/sequential/test-deprecation-flags.js index ca325654c55d80..77c2af569bc92f 100644 --- a/test/sequential/test-deprecation-flags.js +++ b/test/sequential/test-deprecation-flags.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var execFile = require('child_process').execFile; var depmod = require.resolve('../fixtures/deprecated.js'); @@ -16,8 +16,8 @@ execFile(node, normal, function(er, stdout, stderr) { console.error('normal: show deprecation warning'); assert.equal(er, null); assert.equal(stdout, ''); - assert.equal(stderr, '(node) util.p is deprecated. Use console.error ' + - 'instead.\n\'This is deprecated\'\n'); + assert.equal(stderr, '(node) util.debug is deprecated. Use console.error ' + + 'instead.\nDEBUG: This is deprecated\n'); console.log('normal ok'); }); @@ -25,7 +25,7 @@ execFile(node, noDep, function(er, stdout, stderr) { console.error('--no-deprecation: silence deprecations'); assert.equal(er, null); assert.equal(stdout, ''); - assert.equal(stderr, '\'This is deprecated\'\n'); + assert.equal(stderr, 'DEBUG: This is deprecated\n'); console.log('silent ok'); }); @@ -36,8 +36,8 @@ execFile(node, traceDep, function(er, stdout, stderr) { var stack = stderr.trim().split('\n'); // just check the top and bottom. assert.equal(stack[0], - 'Trace: util.p is deprecated. Use console.error instead.'); - assert.equal(stack.pop(), '\'This is deprecated\''); + 'Trace: util.debug is deprecated. Use console.error instead.'); + assert.equal(stack.pop(), 'DEBUG: This is deprecated'); console.log('trace ok'); }); diff --git a/test/sequential/test-dgram-pingpong.js b/test/sequential/test-dgram-pingpong.js new file mode 100644 index 00000000000000..5760024c0c5c70 --- /dev/null +++ b/test/sequential/test-dgram-pingpong.js @@ -0,0 +1,46 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const dgram = require('dgram'); + +function pingPongTest(port, host) { + + const server = dgram.createSocket('udp4', common.mustCall((msg, rinfo) => { + assert.strictEqual('PING', msg.toString('ascii')); + server.send('PONG', 0, 4, rinfo.port, rinfo.address); + })); + + server.on('error', function(e) { + throw e; + }); + + server.on('listening', function() { + console.log('server listening on ' + port); + + const client = dgram.createSocket('udp4'); + + client.on('message', function(msg) { + assert.strictEqual('PONG', msg.toString('ascii')); + + client.close(); + server.close(); + }); + + client.on('error', function(e) { + throw e; + }); + + console.log('Client sending to ' + port); + + function clientSend() { + client.send('PING', 0, 4, port, 'localhost'); + } + + clientSend(); + }); + server.bind(port, host); + return server; +} + +const server = pingPongTest(common.PORT, 'localhost'); +server.on('close', common.mustCall(pingPongTest.bind(undefined, common.PORT))); diff --git a/test/sequential/test-fs-watch-recursive.js b/test/sequential/test-fs-watch-recursive.js deleted file mode 100644 index 3e6e4b44f4ed24..00000000000000 --- a/test/sequential/test-fs-watch-recursive.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; -var common = require('../common'); -var assert = require('assert'); -var path = require('path'); -var fs = require('fs'); - -if (process.platform === 'darwin' || common.isWindows) { - var watchSeenOne = 0; - - var testDir = common.tmpDir; - - var filenameOne = 'watch.txt'; - var testsubdirName = 'testsubdir'; - var testsubdir = path.join(testDir, testsubdirName); - var relativePathOne = path.join('testsubdir', filenameOne); - var filepathOne = path.join(testsubdir, filenameOne); - - common.refreshTmpDir(); - - process.on('exit', function() { - assert.ok(watchSeenOne > 0); - }); - - function cleanup() { - try { fs.unlinkSync(filepathOne); } catch (e) { } - try { fs.rmdirSync(testsubdir); } catch (e) { } - }; - - try { fs.mkdirSync(testsubdir, 0o700); } catch (e) {} - - assert.doesNotThrow(function() { - var watcher = fs.watch(testDir, {recursive: true}); - watcher.on('change', function(event, filename) { - assert.ok('change' === event || 'rename' === event); - - // Ignore stale events generated by mkdir and other tests - if (filename !== relativePathOne) - return; - - watcher.close(); - cleanup(); - ++watchSeenOne; - }); - }); - - setTimeout(function() { - fs.writeFileSync(filepathOne, 'world'); - }, 10); -} else { - console.log('1..0 # Skipped: recursive option is darwin/windows specific'); -} diff --git a/test/sequential/test-fs-watch.js b/test/sequential/test-fs-watch.js index 385cf47686f2a8..51d737ddbeede8 100644 --- a/test/sequential/test-fs-watch.js +++ b/test/sequential/test-fs-watch.js @@ -51,9 +51,9 @@ assert.doesNotThrow( } ); -setTimeout(function() { +setImmediate(function() { fs.writeFileSync(filepathOne, 'world'); -}, 20); +}); process.chdir(testDir); @@ -74,17 +74,16 @@ assert.doesNotThrow( } ); -setTimeout(function() { +setImmediate(function() { fs.writeFileSync(filepathTwoAbs, 'pardner'); -}, 20); +}); -try { fs.unlinkSync(filepathThree); } catch (e) {} -try { fs.mkdirSync(testsubdir, 0o700); } catch (e) {} +fs.mkdirSync(testsubdir, 0o700); assert.doesNotThrow( function() { var watcher = fs.watch(testsubdir, function(event, filename) { - var renameEv = process.platform === 'sunos' ? 'change' : 'rename'; + var renameEv = common.isSunOS ? 'change' : 'rename'; assert.equal(renameEv, event); if (expectFilePath) { assert.equal('newfile.txt', filename); @@ -97,10 +96,10 @@ assert.doesNotThrow( } ); -setTimeout(function() { +setImmediate(function() { var fd = fs.openSync(filepathThree, 'w'); fs.closeSync(fd); -}, 20); +}); // https://github.com/joyent/node/issues/2293 - non-persistent watcher should // not block the event loop @@ -126,20 +125,3 @@ assert.throws(function() { w.stop(); }, TypeError); oldhandle.stop(); // clean up - -assert.throws(function() { - fs.watch('non-existent-file'); -}, function(err) { - assert(err); - assert(/non-existent-file/.test(err)); - assert.equal(err.filename, 'non-existent-file'); - return true; -}); - -var watcher = fs.watch(__filename); -watcher.on('error', common.mustCall(function(err) { - assert(err); - assert(/non-existent-file/.test(err)); - assert.equal(err.filename, 'non-existent-file'); -})); -watcher._handle.onchange(-1, 'ENOENT', 'non-existent-file'); diff --git a/test/sequential/test-http-pipeline-flood.js b/test/sequential/test-http-pipeline-flood.js deleted file mode 100644 index cb9fc97a865b70..00000000000000 --- a/test/sequential/test-http-pipeline-flood.js +++ /dev/null @@ -1,92 +0,0 @@ -'use strict'; -var common = require('../common'); -var assert = require('assert'); - -switch (process.argv[2]) { - case undefined: - return parent(); - case 'child': - return child(); - default: - throw new Error('wtf'); -} - -function parent() { - var http = require('http'); - var bigResponse = new Buffer(10240).fill('x'); - var gotTimeout = false; - var childClosed = false; - var requests = 0; - var connections = 0; - - var server = http.createServer(function(req, res) { - requests++; - res.setHeader('content-length', bigResponse.length); - res.end(bigResponse); - }); - - server.on('connection', function(conn) { - connections++; - }); - - // kill the connection after a bit, verifying that the - // flood of requests was eventually halted. - server.setTimeout(200, function(conn) { - gotTimeout = true; - conn.destroy(); - }); - - server.listen(common.PORT, function() { - var spawn = require('child_process').spawn; - var args = [__filename, 'child']; - var child = spawn(process.execPath, args, { stdio: 'inherit' }); - child.on('close', function(code) { - assert(!code); - childClosed = true; - server.close(); - }); - }); - - process.on('exit', function() { - assert(gotTimeout); - assert(childClosed); - assert.equal(connections, 1); - // The number of requests we end up processing before the outgoing - // connection backs up and requires a drain is implementation-dependent. - // We can safely assume is more than 250. - console.log('server got %d requests', requests); - assert(requests >= 250); - console.log('ok'); - }); -} - -function child() { - var net = require('net'); - - var gotEpipe = false; - var conn = net.connect({ port: common.PORT }); - - var req = 'GET / HTTP/1.1\r\nHost: localhost:' + - common.PORT + '\r\nAccept: */*\r\n\r\n'; - - req = new Array(10241).join(req); - - conn.on('connect', function() { - write(); - }); - - conn.on('drain', write); - - conn.on('error', function(er) { - gotEpipe = true; - }); - - process.on('exit', function() { - assert(gotEpipe); - console.log('ok - child'); - }); - - function write() { - while (false !== conn.write(req, 'ascii')); - } -} diff --git a/test/sequential/test-http-regr-gh-2928.js b/test/sequential/test-http-regr-gh-2928.js new file mode 100644 index 00000000000000..b4ae7054d72bb9 --- /dev/null +++ b/test/sequential/test-http-regr-gh-2928.js @@ -0,0 +1,63 @@ +// This test is designed to fail with a segmentation fault in Node.js 4.1.0 and +// execute without issues in Node.js 4.1.1 and up. + +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const httpCommon = require('_http_common'); +const HTTPParser = process.binding('http_parser').HTTPParser; +const net = require('net'); + +const COUNT = httpCommon.parsers.max + 1; + +const parsers = new Array(COUNT); +for (var i = 0; i < parsers.length; i++) + parsers[i] = httpCommon.parsers.alloc(); + +var gotRequests = 0; +var gotResponses = 0; + +function execAndClose() { + if (parsers.length === 0) + return; + process.stdout.write('.'); + + const parser = parsers.pop(); + parser.reinitialize(HTTPParser.RESPONSE); + + const socket = net.connect(common.PORT); + socket.on('error', (e) => { + // If SmartOS and ECONNREFUSED, then retry. See + // https://github.com/nodejs/node/issues/2663. + if (common.isSunOS && e.code === 'ECONNREFUSED') { + parsers.push(parser); + socket.destroy(); + setImmediate(execAndClose); + return; + } + throw e; + }); + + parser.consume(socket._handle._externalStream); + + parser.onIncoming = function onIncoming() { + process.stdout.write('+'); + gotResponses++; + parser.unconsume(socket._handle._externalStream); + httpCommon.freeParser(parser); + socket.destroy(); + setImmediate(execAndClose); + }; +} + +var server = net.createServer(function(c) { + if (++gotRequests === COUNT) + server.close(); + c.end('HTTP/1.1 200 OK\r\n\r\n', function() { + c.destroySoon(); + }); +}).listen(common.PORT, execAndClose); + +process.on('exit', function() { + assert.equal(gotResponses, COUNT); +}); diff --git a/test/sequential/test-init.js b/test/sequential/test-init.js index f68c001f64fffa..6bb727ea1f6184 100644 --- a/test/sequential/test-init.js +++ b/test/sequential/test-init.js @@ -1,9 +1,9 @@ 'use strict'; (function() { - var assert = require('assert'), - child = require('child_process'), - util = require('util'), - common = require('../common'); + const assert = require('assert'); + const child = require('child_process'); + const util = require('util'); + const common = require('../common'); if (process.env['TEST_INIT']) { util.print('Loaded successfully!'); } else { diff --git a/test/sequential/test-module-loading.js b/test/sequential/test-module-loading.js index d53de512f2510a..d4799691b4e5be 100644 --- a/test/sequential/test-module-loading.js +++ b/test/sequential/test-module-loading.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var path = require('path'); var fs = require('fs'); @@ -33,38 +33,38 @@ var d4 = require('../fixtures/b/d'); assert.equal(false, false, 'testing the test program.'); -assert.equal(true, common.indirectInstanceOf(a.A, Function)); +assert.ok(a.A instanceof Function); assert.equal('A', a.A()); -assert.equal(true, common.indirectInstanceOf(a.C, Function)); +assert.ok(a.C instanceof Function); assert.equal('C', a.C()); -assert.equal(true, common.indirectInstanceOf(a.D, Function)); +assert.ok(a.D instanceof Function); assert.equal('D', a.D()); -assert.equal(true, common.indirectInstanceOf(d.D, Function)); +assert.ok(d.D instanceof Function); assert.equal('D', d.D()); -assert.equal(true, common.indirectInstanceOf(d2.D, Function)); +assert.ok(d2.D instanceof Function); assert.equal('D', d2.D()); -assert.equal(true, common.indirectInstanceOf(d3.D, Function)); +assert.ok(d3.D instanceof Function); assert.equal('D', d3.D()); -assert.equal(true, common.indirectInstanceOf(d4.D, Function)); +assert.ok(d4.D instanceof Function); assert.equal('D', d4.D()); assert.ok((new a.SomeClass()) instanceof c.SomeClass); console.error('test index.js modules ids and relative loading'); -var one = require('../fixtures/nested-index/one'), - two = require('../fixtures/nested-index/two'); +const one = require('../fixtures/nested-index/one'); +const two = require('../fixtures/nested-index/two'); assert.notEqual(one.hello, two.hello); console.error('test index.js in a folder with a trailing slash'); -var three = require('../fixtures/nested-index/three'), - threeFolder = require('../fixtures/nested-index/three/'), - threeIndex = require('../fixtures/nested-index/three/index.js'); +const three = require('../fixtures/nested-index/three'); +const threeFolder = require('../fixtures/nested-index/three/'); +const threeIndex = require('../fixtures/nested-index/three/index.js'); assert.equal(threeFolder, threeIndex); assert.notEqual(threeFolder, three); @@ -75,8 +75,8 @@ assert.equal(require('../fixtures/packages/main-index').ok, 'ok', 'Failed loading package with index.js in main subdir'); console.error('test cycles containing a .. path'); -var root = require('../fixtures/cycles/root'), - foo = require('../fixtures/cycles/folder/foo'); +const root = require('../fixtures/cycles/root'); +const foo = require('../fixtures/cycles/folder/foo'); assert.equal(root.foo, foo); assert.equal(root.sayHello(), root.hello); @@ -88,7 +88,7 @@ require('../fixtures/node_modules/foo'); console.error('test name clashes'); // this one exists and should import the local module var my_path = require('../fixtures/path'); -assert.ok(common.indirectInstanceOf(my_path.path_func, Function)); +assert.ok(my_path.path_func instanceof Function); // this one does not exist and should throw assert.throws(function() { require('./utils'); }); @@ -137,8 +137,8 @@ try { // Check load order is as expected console.error('load order'); -var loadOrder = '../fixtures/module-load-order/', - msg = 'Load order incorrect.'; +const loadOrder = '../fixtures/module-load-order/'; +const msg = 'Load order incorrect.'; require.extensions['.reg'] = require.extensions['.js']; require.extensions['.reg2'] = require.extensions['.js']; @@ -252,22 +252,22 @@ assert.throws(function() { assert.throws(function() { console.error('require empty string'); require(''); -}, 'missing path'); +}, /missing path/); process.on('exit', function() { - assert.ok(common.indirectInstanceOf(a.A, Function)); + assert.ok(a.A instanceof Function); assert.equal('A done', a.A()); - assert.ok(common.indirectInstanceOf(a.C, Function)); + assert.ok(a.C instanceof Function); assert.equal('C done', a.C()); - assert.ok(common.indirectInstanceOf(a.D, Function)); + assert.ok(a.D instanceof Function); assert.equal('D done', a.D()); - assert.ok(common.indirectInstanceOf(d.D, Function)); + assert.ok(d.D instanceof Function); assert.equal('D done', d.D()); - assert.ok(common.indirectInstanceOf(d2.D, Function)); + assert.ok(d2.D instanceof Function); assert.equal('D done', d2.D()); assert.equal(true, errorThrown); @@ -279,3 +279,11 @@ process.on('exit', function() { // #1440 Loading files with a byte order marker. assert.equal(42, require('../fixtures/utf8-bom.js')); assert.equal(42, require('../fixtures/utf8-bom.json')); + +// Error on the first line of a module should +// have the correct line number +assert.throws(function() { + require('../fixtures/test-error-first-line-offset.js'); +}, function(err) { + return /test-error-first-line-offset.js:1:/.test(err.stack); +}, 'Expected appearance of proper offset in Error stack'); diff --git a/test/sequential/test-net-GH-5504.js b/test/sequential/test-net-GH-5504.js index 9526993dfd12c2..179b3ae3c2e241 100644 --- a/test/sequential/test-net-GH-5504.js +++ b/test/sequential/test-net-GH-5504.js @@ -1,6 +1,5 @@ 'use strict'; var common = require('../common'); -var assert = require('assert'); // this test only fails with CentOS 6.3 using kernel version 2.6.32 // On other linuxes and darwin, the `read` call gets an ECONNRESET in diff --git a/test/sequential/test-pump-file2tcp.js b/test/sequential/test-pump-file2tcp.js index f5949085e0aec3..f99ae1c5d79ea6 100644 --- a/test/sequential/test-pump-file2tcp.js +++ b/test/sequential/test-pump-file2tcp.js @@ -28,7 +28,6 @@ server.listen(common.PORT, function() { }); var buffer = ''; -var count = 0; server.on('listening', function() { }); diff --git a/test/sequential/test-regress-GH-1697.js b/test/sequential/test-regress-GH-1697.js index ff5754f357dfc1..bafd389fa8deee 100644 --- a/test/sequential/test-regress-GH-1697.js +++ b/test/sequential/test-regress-GH-1697.js @@ -1,8 +1,7 @@ 'use strict'; -var common = require('../common'); -var net = require('net'), - cp = require('child_process'), - util = require('util'); +const common = require('../common'); +const net = require('net'); +const cp = require('child_process'); if (process.argv[2] === 'server') { // Server @@ -31,8 +30,8 @@ if (process.argv[2] === 'server') { serverProcess.stdout.once('data', function() { var client = net.createConnection(common.PORT, '127.0.0.1'); client.on('connect', function() { - var alot = new Buffer(1024), - alittle = new Buffer(1); + const alot = new Buffer(1024); + const alittle = new Buffer(1); for (var i = 0; i < 100; i++) { client.write(alot); diff --git a/test/sequential/test-regress-GH-1726.js b/test/sequential/test-regress-GH-1726.js index 859ab6cc5e4253..c5f0bba1335264 100644 --- a/test/sequential/test-regress-GH-1726.js +++ b/test/sequential/test-regress-GH-1726.js @@ -4,7 +4,7 @@ // exit when its child exits. // https://github.com/joyent/node/issues/1726 -var common = require('../common'); +require('../common'); var assert = require('assert'); var ch = require('child_process'); diff --git a/test/sequential/test-regress-GH-819.js b/test/sequential/test-regress-GH-819.js deleted file mode 100644 index e459587d97cba9..00000000000000 --- a/test/sequential/test-regress-GH-819.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; -var common = require('../common'); -var net = require('net'); -var assert = require('assert'); - -// Connect to something that we need to DNS resolve -var c = net.createConnection(80, 'google.com'); -c.destroy(); diff --git a/test/sequential/test-repl-persistent-history.js b/test/sequential/test-repl-persistent-history.js deleted file mode 100644 index ef433912da5a65..00000000000000 --- a/test/sequential/test-repl-persistent-history.js +++ /dev/null @@ -1,200 +0,0 @@ -'use strict'; - -// Flags: --expose-internals - -const common = require('../common'); -const stream = require('stream'); -const REPL = require('internal/repl'); -const assert = require('assert'); -const fs = require('fs'); -const util = require('util'); -const path = require('path'); -const os = require('os'); - -common.refreshTmpDir(); - -// Mock os.homedir() -os.homedir = function() { - return common.tmpDir; -}; - -// Create an input stream specialized for testing an array of actions -class ActionStream extends stream.Stream { - run(data) { - const _iter = data[Symbol.iterator](); - const self = this; - - function doAction() { - const next = _iter.next(); - if (next.done) { - // Close the repl. Note that it must have a clean prompt to do so. - setImmediate(function() { - self.emit('keypress', '', { ctrl: true, name: 'd' }); - }); - return; - } - const action = next.value; - - if (typeof action === 'object') { - self.emit('keypress', '', action); - } else { - self.emit('data', action + '\n'); - } - setImmediate(doAction); - } - setImmediate(doAction); - } - resume() {} - pause() {} -} -ActionStream.prototype.readable = true; - - -// Mock keys -const UP = { name: 'up' }; -const ENTER = { name: 'enter' }; -const CLEAR = { ctrl: true, name: 'u' }; -// Common message bits -const prompt = '> '; -const replDisabled = '\nPersistent history support disabled. Set the ' + - 'NODE_REPL_HISTORY environment\nvariable to a valid, ' + - 'user-writable path to enable.\n'; -const convertMsg = '\nConverting old JSON repl history to line-separated ' + - 'history.\nThe new repl history file can be found at ' + - path.join(common.tmpDir, '.node_repl_history') + '.\n'; -const homedirErr = '\nError: Could not get the home directory.\n' + - 'REPL session history will not be persisted.\n'; -// File paths -const fixtures = path.join(common.testDir, 'fixtures'); -const historyFixturePath = path.join(fixtures, '.node_repl_history'); -const historyPath = path.join(common.tmpDir, '.fixture_copy_repl_history'); -const oldHistoryPath = path.join(fixtures, 'old-repl-history-file.json'); -const enoentHistoryPath = path.join(fixtures, 'enoent-repl-history-file.json'); - - -const tests = [{ - env: { NODE_REPL_HISTORY: '' }, - test: [UP], - expected: [prompt, replDisabled, prompt] -}, -{ - env: { NODE_REPL_HISTORY: '', - NODE_REPL_HISTORY_FILE: enoentHistoryPath }, - test: [UP], - expected: [prompt, replDisabled, prompt] -}, -{ - env: { NODE_REPL_HISTORY: '', - NODE_REPL_HISTORY_FILE: oldHistoryPath }, - test: [UP], - expected: [prompt, replDisabled, prompt] -}, -{ - env: { NODE_REPL_HISTORY: historyPath }, - test: [UP, CLEAR], - expected: [prompt, prompt + '\'you look fabulous today\'', prompt] -}, -{ - env: { NODE_REPL_HISTORY: historyPath, - NODE_REPL_HISTORY_FILE: oldHistoryPath }, - test: [UP, CLEAR], - expected: [prompt, prompt + '\'you look fabulous today\'', prompt] -}, -{ - env: { NODE_REPL_HISTORY: historyPath, - NODE_REPL_HISTORY_FILE: '' }, - test: [UP, CLEAR], - expected: [prompt, prompt + '\'you look fabulous today\'', prompt] -}, -{ - env: {}, - test: [UP], - expected: [prompt] -}, -{ - env: { NODE_REPL_HISTORY_FILE: oldHistoryPath }, - test: [UP, CLEAR, '\'42\'', ENTER/*, function(cb) { - // XXX(Fishrock123) Allow the REPL to save to disk. - // There isn't a way to do this programmatically right now. - setTimeout(cb, 50); - }*/], - expected: [prompt, convertMsg, prompt, prompt + '\'=^.^=\'', prompt, '\'', - '4', '2', '\'', '\'42\'\n', prompt, prompt], - after: function ensureHistoryFixture() { - // XXX(Fishrock123) Make sure nothing weird happened to our fixture - // or it's temporary copy. - // Sometimes this test used to erase the fixture and I'm not sure why. - const history = fs.readFileSync(historyFixturePath, 'utf8'); - assert.strictEqual(history, - '\'you look fabulous today\'\n\'Stay Fresh~\'\n'); - const historyCopy = fs.readFileSync(historyPath, 'utf8'); - assert.strictEqual(historyCopy, '\'you look fabulous today\'' + os.EOL + - '\'Stay Fresh~\'' + os.EOL); - } -}, -{ - env: {}, - test: [UP, UP, ENTER], - expected: [prompt, prompt + '\'42\'', prompt + '\'=^.^=\'', '\'=^.^=\'\n', - prompt] -}, -{ // Make sure this is always the last test, since we change os.homedir() - before: function mockHomedirFailure() { - // Mock os.homedir() failure - os.homedir = function() { - throw new Error('os.homedir() failure'); - }; - }, - env: {}, - test: [UP], - expected: [prompt, homedirErr, prompt, replDisabled, prompt] -}]; - - -// Copy our fixture to the tmp directory -fs.createReadStream(historyFixturePath) - .pipe(fs.createWriteStream(historyPath)).on('unpipe', runTest); - -function runTest() { - const opts = tests.shift(); - if (!opts) return; // All done - - const env = opts.env; - const test = opts.test; - const expected = opts.expected; - const after = opts.after; - const before = opts.before; - - if (before) before(); - - REPL.createInternalRepl(env, { - input: new ActionStream(), - output: new stream.Writable({ - write(chunk, _, next) { - const output = chunk.toString(); - - // Ignore escapes and blank lines - if (output.charCodeAt(0) === 27 || /^[\r\n]+$/.test(output)) - return next(); - - assert.strictEqual(output, expected.shift()); - next(); - } - }), - prompt: prompt, - useColors: false, - terminal: true - }, function(err, repl) { - if (err) throw err; - - if (after) repl.on('close', after); - - repl.on('close', function() { - // Ensure everything that we expected was output - assert.strictEqual(expected.length, 0); - setImmediate(runTest); - }); - - repl.inputStream.run(test); - }); -} diff --git a/test/sequential/test-require-cache-without-stat.js b/test/sequential/test-require-cache-without-stat.js index c602ab82b11f4d..2571583f7690b5 100644 --- a/test/sequential/test-require-cache-without-stat.js +++ b/test/sequential/test-require-cache-without-stat.js @@ -35,14 +35,14 @@ var counterBefore = counter; // Now load the module a bunch of times with equivalent paths. // stat should not be called. -for (var i = 0; i < 100; i++) { +for (let i = 0; i < 100; i++) { require(common.fixturesDir + '/a'); require('../fixtures/a.js'); require('./../fixtures/a.js'); } // Do the same with a built-in module -for (var i = 0; i < 100; i++) { +for (let i = 0; i < 100; i++) { require('http'); } diff --git a/test/sequential/test-stdin-child-proc.js b/test/sequential/test-stdin-child-proc.js index 93bf265b8b0020..0189e94d5d4c8c 100644 --- a/test/sequential/test-stdin-child-proc.js +++ b/test/sequential/test-stdin-child-proc.js @@ -1,7 +1,7 @@ 'use strict'; // This tests that pausing and resuming stdin does not hang and timeout // when done in a child process. See test/simple/test-stdin-pause-resume.js -var common = require('../common'); +require('../common'); var child_process = require('child_process'); var path = require('path'); child_process.spawn(process.execPath, diff --git a/test/sequential/test-stream2-fs.js b/test/sequential/test-stream2-fs.js index 96ab97174b2478..e775dd7c0ab690 100644 --- a/test/sequential/test-stream2-fs.js +++ b/test/sequential/test-stream2-fs.js @@ -1,6 +1,5 @@ 'use strict'; var common = require('../common'); -var R = require('_stream_readable'); var assert = require('assert'); var fs = require('fs'); @@ -41,7 +40,6 @@ var w = new TestWriter(); w.on('results', function(res) { console.error(res, w.length); assert.equal(w.length, size); - var l = 0; assert.deepEqual(res.map(function(c) { return c.length; }), expectLengths); diff --git a/test/sequential/test-stream2-stderr-sync.js b/test/sequential/test-stream2-stderr-sync.js index ccbdc55e4feaf9..c7daaa6b083205 100644 --- a/test/sequential/test-stream2-stderr-sync.js +++ b/test/sequential/test-stream2-stderr-sync.js @@ -1,11 +1,7 @@ 'use strict'; // Make sure that sync writes to stderr get processed before exiting. -var common = require('../common'); -var assert = require('assert'); -var util = require('util'); - -var errnoException = util._errnoException; +require('../common'); function parent() { var spawn = require('child_process').spawn; diff --git a/test/sequential/test-stringbytes-external-exceed-max-by-1-ascii.js b/test/sequential/test-stringbytes-external-exceed-max-by-1-ascii.js new file mode 100644 index 00000000000000..af47a8e779a7a4 --- /dev/null +++ b/test/sequential/test-stringbytes-external-exceed-max-by-1-ascii.js @@ -0,0 +1,33 @@ +'use strict'; +// Flags: --expose-gc + +const common = require('../common'); +const assert = require('assert'); + +const skipMessage = + '1..0 # Skipped: intensive toString tests due to memory confinements'; +if (!common.enoughTestMem) { + console.log(skipMessage); + return; +} +assert(typeof gc === 'function', 'Run this test with --expose-gc'); + +// v8 fails silently if string length > v8::String::kMaxLength +// v8::String::kMaxLength defined in v8.h +const kStringMaxLength = process.binding('buffer').kStringMaxLength; + +try { + var buf = new Buffer(kStringMaxLength + 1); + // Try to allocate memory first then force gc so future allocations succeed. + new Buffer(2 * kStringMaxLength); + gc(); +} catch (e) { + // If the exception is not due to memory confinement then rethrow it. + if (e.message !== 'Invalid array buffer length') throw (e); + console.log(skipMessage); + return; +} + +assert.throws(function() { + buf.toString('ascii'); +}, /toString failed/); diff --git a/test/sequential/test-stringbytes-external-exceed-max-by-1-base64.js b/test/sequential/test-stringbytes-external-exceed-max-by-1-base64.js new file mode 100644 index 00000000000000..fb599875a0459b --- /dev/null +++ b/test/sequential/test-stringbytes-external-exceed-max-by-1-base64.js @@ -0,0 +1,33 @@ +'use strict'; +// Flags: --expose-gc + +const common = require('../common'); +const assert = require('assert'); + +const skipMessage = + '1..0 # Skipped: intensive toString tests due to memory confinements'; +if (!common.enoughTestMem) { + console.log(skipMessage); + return; +} +assert(typeof gc === 'function', 'Run this test with --expose-gc'); + +// v8 fails silently if string length > v8::String::kMaxLength +// v8::String::kMaxLength defined in v8.h +const kStringMaxLength = process.binding('buffer').kStringMaxLength; + +try { + var buf = new Buffer(kStringMaxLength + 1); + // Try to allocate memory first then force gc so future allocations succeed. + new Buffer(2 * kStringMaxLength); + gc(); +} catch (e) { + // If the exception is not due to memory confinement then rethrow it. + if (e.message !== 'Invalid array buffer length') throw (e); + console.log(skipMessage); + return; +} + +assert.throws(function() { + buf.toString('base64'); +}, /toString failed/); diff --git a/test/sequential/test-stringbytes-external-exceed-max-by-1-binary.js b/test/sequential/test-stringbytes-external-exceed-max-by-1-binary.js new file mode 100644 index 00000000000000..f4904b672cfea7 --- /dev/null +++ b/test/sequential/test-stringbytes-external-exceed-max-by-1-binary.js @@ -0,0 +1,41 @@ +'use strict'; +// Flags: --expose-gc + +const common = require('../common'); +const assert = require('assert'); + +const skipMessage = + '1..0 # Skipped: intensive toString tests due to memory confinements'; +if (!common.enoughTestMem) { + console.log(skipMessage); + return; +} +assert(typeof gc === 'function', 'Run this test with --expose-gc'); + +// v8 fails silently if string length > v8::String::kMaxLength +// v8::String::kMaxLength defined in v8.h +const kStringMaxLength = process.binding('buffer').kStringMaxLength; + +try { + var buf = new Buffer(kStringMaxLength + 1); + // Try to allocate memory first then force gc so future allocations succeed. + new Buffer(2 * kStringMaxLength); + gc(); +} catch (e) { + // If the exception is not due to memory confinement then rethrow it. + if (e.message !== 'Invalid array buffer length') throw (e); + console.log(skipMessage); + return; +} + +assert.throws(function() { + buf.toString('binary'); +}, /toString failed/); + +var maxString = buf.toString('binary', 1); +assert.equal(maxString.length, kStringMaxLength); +// Free the memory early instead of at the end of the next assignment +maxString = undefined; + +maxString = buf.toString('binary', 0, kStringMaxLength); +assert.equal(maxString.length, kStringMaxLength); diff --git a/test/sequential/test-stringbytes-external-exceed-max-by-1-hex.js b/test/sequential/test-stringbytes-external-exceed-max-by-1-hex.js new file mode 100644 index 00000000000000..9dd9d23565acf2 --- /dev/null +++ b/test/sequential/test-stringbytes-external-exceed-max-by-1-hex.js @@ -0,0 +1,33 @@ +'use strict'; +// Flags: --expose-gc + +const common = require('../common'); +const assert = require('assert'); + +const skipMessage = + '1..0 # Skipped: intensive toString tests due to memory confinements'; +if (!common.enoughTestMem) { + console.log(skipMessage); + return; +} +assert(typeof gc === 'function', 'Run this test with --expose-gc'); + +// v8 fails silently if string length > v8::String::kMaxLength +// v8::String::kMaxLength defined in v8.h +const kStringMaxLength = process.binding('buffer').kStringMaxLength; + +try { + var buf = new Buffer(kStringMaxLength + 1); + // Try to allocate memory first then force gc so future allocations succeed. + new Buffer(2 * kStringMaxLength); + gc(); +} catch (e) { + // If the exception is not due to memory confinement then rethrow it. + if (e.message !== 'Invalid array buffer length') throw (e); + console.log(skipMessage); + return; +} + +assert.throws(function() { + buf.toString('hex'); +}, /toString failed/); diff --git a/test/sequential/test-stringbytes-external-exceed-max-by-1-utf8.js b/test/sequential/test-stringbytes-external-exceed-max-by-1-utf8.js new file mode 100644 index 00000000000000..3ff6f4978878ee --- /dev/null +++ b/test/sequential/test-stringbytes-external-exceed-max-by-1-utf8.js @@ -0,0 +1,37 @@ +'use strict'; +// Flags: --expose-gc + +const common = require('../common'); +const assert = require('assert'); + +const skipMessage = + '1..0 # Skipped: intensive toString tests due to memory confinements'; +if (!common.enoughTestMem) { + console.log(skipMessage); + return; +} +assert(typeof gc === 'function', 'Run this test with --expose-gc'); + +// v8 fails silently if string length > v8::String::kMaxLength +// v8::String::kMaxLength defined in v8.h +const kStringMaxLength = process.binding('buffer').kStringMaxLength; + +try { + var buf = new Buffer(kStringMaxLength + 1); + // Try to allocate memory first then force gc so future allocations succeed. + new Buffer(2 * kStringMaxLength); + gc(); +} catch (e) { + // If the exception is not due to memory confinement then rethrow it. + if (e.message !== 'Invalid array buffer length') throw (e); + console.log(skipMessage); + return; +} + +assert.throws(function() { + buf.toString(); +}, /toString failed|Invalid array buffer length/); + +assert.throws(function() { + buf.toString('utf8'); +}, /toString failed/); diff --git a/test/sequential/test-stringbytes-external-exceed-max-by-2.js b/test/sequential/test-stringbytes-external-exceed-max-by-2.js new file mode 100644 index 00000000000000..1ac5a5c7fe1ced --- /dev/null +++ b/test/sequential/test-stringbytes-external-exceed-max-by-2.js @@ -0,0 +1,32 @@ +'use strict'; +// Flags: --expose-gc + +const common = require('../common'); +const assert = require('assert'); + +const skipMessage = + '1..0 # Skipped: intensive toString tests due to memory confinements'; +if (!common.enoughTestMem) { + console.log(skipMessage); + return; +} +assert(typeof gc === 'function', 'Run this test with --expose-gc'); + +// v8 fails silently if string length > v8::String::kMaxLength +// v8::String::kMaxLength defined in v8.h +const kStringMaxLength = process.binding('buffer').kStringMaxLength; + +try { + var buf = new Buffer(kStringMaxLength + 2); + // Try to allocate memory first then force gc so future allocations succeed. + new Buffer(2 * kStringMaxLength); + gc(); +} catch (e) { + // If the exception is not due to memory confinement then rethrow it. + if (e.message !== 'Invalid array buffer length') throw (e); + console.log(skipMessage); + return; +} + +const maxString = buf.toString('utf16le'); +assert.equal(maxString.length, (kStringMaxLength + 2) / 2); diff --git a/test/sequential/test-stringbytes-external-exceed-max.js b/test/sequential/test-stringbytes-external-exceed-max.js new file mode 100644 index 00000000000000..61666b8ebc6b48 --- /dev/null +++ b/test/sequential/test-stringbytes-external-exceed-max.js @@ -0,0 +1,33 @@ +'use strict'; +// Flags: --expose-gc + +const common = require('../common'); +const assert = require('assert'); + +const skipMessage = + '1..0 # Skipped: intensive toString tests due to memory confinements'; +if (!common.enoughTestMem) { + console.log(skipMessage); + return; +} +assert(typeof gc === 'function', 'Run this test with --expose-gc'); + +// v8 fails silently if string length > v8::String::kMaxLength +// v8::String::kMaxLength defined in v8.h +const kStringMaxLength = process.binding('buffer').kStringMaxLength; + +try { + var buf = new Buffer(kStringMaxLength * 2 + 2); + // Try to allocate memory first then force gc so future allocations succeed. + new Buffer(2 * kStringMaxLength); + gc(); +} catch (e) { + // If the exception is not due to memory confinement then rethrow it. + if (e.message !== 'Invalid array buffer length') throw (e); + console.log(skipMessage); + return; +} + +assert.throws(function() { + buf.toString('utf16le'); +}, /toString failed/); diff --git a/test/sequential/test-tls-honorcipherorder.js b/test/sequential/test-tls-honorcipherorder.js deleted file mode 100644 index cac697c5b02d91..00000000000000 --- a/test/sequential/test-tls-honorcipherorder.js +++ /dev/null @@ -1,93 +0,0 @@ -'use strict'; -var common = require('../common'); -var assert = require('assert'); - -if (!common.hasCrypto) { - console.log('1..0 # Skipped: missing crypto'); - return; -} -var tls = require('tls'); - -var fs = require('fs'); -var nconns = 0; -// test only in TLSv1 to use DES which is no longer supported TLSv1.2 -// to be safe when the default method is updated in the future -var SSL_Method = 'TLSv1_method'; -var localhost = '127.0.0.1'; - -process.on('exit', function() { - assert.equal(nconns, 6); -}); - -function test(honorCipherOrder, clientCipher, expectedCipher, cb) { - var soptions = { - secureProtocol: SSL_Method, - key: fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem'), - cert: fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem'), - ciphers: 'DES-CBC-SHA:AES256-SHA:RC4-SHA:ECDHE-RSA-AES256-SHA', - honorCipherOrder: !!honorCipherOrder - }; - - var server = tls.createServer(soptions, function(cleartextStream) { - nconns++; - - // End socket to send CLOSE_NOTIFY and TCP FIN packet, otherwise - // it may hang for ~30 seconds in FIN_WAIT_1 state (at least on OSX). - cleartextStream.end(); - }); - server.listen(common.PORT, localhost, function() { - var coptions = { - rejectUnauthorized: false, - secureProtocol: SSL_Method - }; - if (clientCipher) { - coptions.ciphers = clientCipher; - } - var client = tls.connect(common.PORT, localhost, coptions, function() { - var cipher = client.getCipher(); - client.end(); - server.close(); - assert.equal(cipher.name, expectedCipher); - if (cb) cb(); - }); - }); -} - -test1(); - -function test1() { - // Client has the preference of cipher suites by default - test(false, 'AES256-SHA:DES-CBC-SHA:RC4-SHA', 'AES256-SHA', test2); -} - -function test2() { - // Server has the preference of cipher suites where DES-CBC-SHA is in - // the first. - test(true, 'AES256-SHA:DES-CBC-SHA:RC4-SHA', 'DES-CBC-SHA', test3); -} - -function test3() { - // Server has the preference of cipher suites. RC4-SHA is given - // higher priority over DES-CBC-SHA among client cipher suites. - test(true, 'RC4-SHA:AES256-SHA', 'AES256-SHA', test4); -} - -function test4() { - // As client has only one cipher, server has no choice in regardless - // of honorCipherOrder. - test(true, 'RC4-SHA', 'RC4-SHA', test5); -} - -function test5() { - // Client did not explicitly set ciphers. Ensure that client defaults to - // sane ciphers. Even though server gives top priority to DES-CBC-SHA - // it should not be negotiated because it's not in default client ciphers. - test(true, null, 'AES256-SHA', test6); -} - -function test6() { - // Ensure that `tls.DEFAULT_CIPHERS` is used - SSL_Method = 'TLSv1_2_method'; - tls.DEFAULT_CIPHERS = 'ECDHE-RSA-AES256-SHA'; - test(true, null, 'ECDHE-RSA-AES256-SHA'); -} diff --git a/test/sequential/test-util-debug.js b/test/sequential/test-util-debug.js index 02d30449a9944b..5f0306e5e01645 100644 --- a/test/sequential/test-util-debug.js +++ b/test/sequential/test-util-debug.js @@ -1,5 +1,5 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); if (process.argv[2] === 'child') diff --git a/test/sequential/test-vm-timeout-rethrow.js b/test/sequential/test-vm-timeout-rethrow.js index dd513b5a694de0..f0f9c0b9c51063 100644 --- a/test/sequential/test-vm-timeout-rethrow.js +++ b/test/sequential/test-vm-timeout-rethrow.js @@ -6,8 +6,8 @@ var spawn = require('child_process').spawn; if (process.argv[2] === 'child') { var code = 'var j = 0;\n' + - 'for (var i = 0; i < 1000000; i++) j += add(i, i + 1);\n' + - 'j;'; + 'for (var i = 0; i < 1000000; i++) j += add(i, i + 1);\n' + + 'j;'; var ctx = vm.createContext({ add: function(x, y) { diff --git a/test/timers/test-timers-reliability.js b/test/timers/test-timers-reliability.js index b4332468bc2ec3..11c2ced15bf782 100644 --- a/test/timers/test-timers-reliability.js +++ b/test/timers/test-timers-reliability.js @@ -1,7 +1,7 @@ 'use strict'; // FaketimeFlags: --exclude-monotonic -f '2014-07-21 09:00:00' -var common = require('../common'); +require('../common'); var Timer = process.binding('timer_wrap').Timer; var assert = require('assert'); @@ -32,7 +32,7 @@ var intervalFired = false; */ var monoTimer = new Timer(); -monoTimer.ontimeout = function() { +monoTimer[Timer.kOnTimeout] = function() { /* * Make sure that setTimeout's and setInterval's callbacks have * already fired, otherwise it means that they are vulnerable to @@ -44,7 +44,7 @@ monoTimer.ontimeout = function() { monoTimer.start(300, 0); -var timer = setTimeout(function() { +setTimeout(function() { timerFired = true; }, 200); diff --git a/tools/certdata.txt b/tools/certdata.txt index d3209db50f0a2d..d6d4b4fbb7ec8f 100644 --- a/tools/certdata.txt +++ b/tools/certdata.txt @@ -187,9 +187,9 @@ END CKA_SERIAL_NUMBER MULTILINE_OCTAL \002\004\065\336\364\317 END -CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_TRUSTED_DELEGATOR +CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_MUST_VERIFY_TRUST CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_TRUSTED_DELEGATOR -CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_TRUSTED_DELEGATOR +CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_MUST_VERIFY_TRUST CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE # Distrust "Distrust a pb.com certificate that does not comply with the baseline requirements." @@ -220,252 +220,6 @@ CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_NOT_TRUSTED CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_NOT_TRUSTED CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE -# -# Certificate "Digital Signature Trust Co. Global CA 1" -# -# Issuer: OU=DSTCA E1,O=Digital Signature Trust Co.,C=US -# Serial Number: 913315222 (0x36701596) -# Subject: OU=DSTCA E1,O=Digital Signature Trust Co.,C=US -# Not Valid Before: Thu Dec 10 18:10:23 1998 -# Not Valid After : Mon Dec 10 18:40:23 2018 -# Fingerprint (MD5): 25:7A:BA:83:2E:B6:A2:0B:DA:FE:F5:02:0F:08:D7:AD -# Fingerprint (SHA1): 81:96:8B:3A:EF:1C:DC:70:F5:FA:32:69:C2:92:A3:63:5B:D1:23:D3 -CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "Digital Signature Trust Co. Global CA 1" -CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509 -CKA_SUBJECT MULTILINE_OCTAL -\060\106\061\013\060\011\006\003\125\004\006\023\002\125\123\061 -\044\060\042\006\003\125\004\012\023\033\104\151\147\151\164\141 -\154\040\123\151\147\156\141\164\165\162\145\040\124\162\165\163 -\164\040\103\157\056\061\021\060\017\006\003\125\004\013\023\010 -\104\123\124\103\101\040\105\061 -END -CKA_ID UTF8 "0" -CKA_ISSUER MULTILINE_OCTAL -\060\106\061\013\060\011\006\003\125\004\006\023\002\125\123\061 -\044\060\042\006\003\125\004\012\023\033\104\151\147\151\164\141 -\154\040\123\151\147\156\141\164\165\162\145\040\124\162\165\163 -\164\040\103\157\056\061\021\060\017\006\003\125\004\013\023\010 -\104\123\124\103\101\040\105\061 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\004\066\160\025\226 -END -CKA_VALUE MULTILINE_OCTAL -\060\202\003\051\060\202\002\222\240\003\002\001\002\002\004\066 -\160\025\226\060\015\006\011\052\206\110\206\367\015\001\001\005 -\005\000\060\106\061\013\060\011\006\003\125\004\006\023\002\125 -\123\061\044\060\042\006\003\125\004\012\023\033\104\151\147\151 -\164\141\154\040\123\151\147\156\141\164\165\162\145\040\124\162 -\165\163\164\040\103\157\056\061\021\060\017\006\003\125\004\013 -\023\010\104\123\124\103\101\040\105\061\060\036\027\015\071\070 -\061\062\061\060\061\070\061\060\062\063\132\027\015\061\070\061 -\062\061\060\061\070\064\060\062\063\132\060\106\061\013\060\011 -\006\003\125\004\006\023\002\125\123\061\044\060\042\006\003\125 -\004\012\023\033\104\151\147\151\164\141\154\040\123\151\147\156 -\141\164\165\162\145\040\124\162\165\163\164\040\103\157\056\061 -\021\060\017\006\003\125\004\013\023\010\104\123\124\103\101\040 -\105\061\060\201\235\060\015\006\011\052\206\110\206\367\015\001 -\001\001\005\000\003\201\213\000\060\201\207\002\201\201\000\240 -\154\201\251\317\064\036\044\335\376\206\050\314\336\203\057\371 -\136\324\102\322\350\164\140\146\023\230\006\034\251\121\022\151 -\157\061\125\271\111\162\000\010\176\323\245\142\104\067\044\231 -\217\331\203\110\217\231\155\225\023\273\103\073\056\111\116\210 -\067\301\273\130\177\376\341\275\370\273\141\315\363\107\300\231 -\246\361\363\221\350\170\174\000\313\141\311\104\047\161\151\125 -\112\176\111\115\355\242\243\276\002\114\000\312\002\250\356\001 -\002\061\144\017\122\055\023\164\166\066\265\172\264\055\161\002 -\001\003\243\202\001\044\060\202\001\040\060\021\006\011\140\206 -\110\001\206\370\102\001\001\004\004\003\002\000\007\060\150\006 -\003\125\035\037\004\141\060\137\060\135\240\133\240\131\244\127 -\060\125\061\013\060\011\006\003\125\004\006\023\002\125\123\061 -\044\060\042\006\003\125\004\012\023\033\104\151\147\151\164\141 -\154\040\123\151\147\156\141\164\165\162\145\040\124\162\165\163 -\164\040\103\157\056\061\021\060\017\006\003\125\004\013\023\010 -\104\123\124\103\101\040\105\061\061\015\060\013\006\003\125\004 -\003\023\004\103\122\114\061\060\053\006\003\125\035\020\004\044 -\060\042\200\017\061\071\071\070\061\062\061\060\061\070\061\060 -\062\063\132\201\017\062\060\061\070\061\062\061\060\061\070\061 -\060\062\063\132\060\013\006\003\125\035\017\004\004\003\002\001 -\006\060\037\006\003\125\035\043\004\030\060\026\200\024\152\171 -\176\221\151\106\030\023\012\002\167\245\131\133\140\230\045\016 -\242\370\060\035\006\003\125\035\016\004\026\004\024\152\171\176 -\221\151\106\030\023\012\002\167\245\131\133\140\230\045\016\242 -\370\060\014\006\003\125\035\023\004\005\060\003\001\001\377\060 -\031\006\011\052\206\110\206\366\175\007\101\000\004\014\060\012 -\033\004\126\064\056\060\003\002\004\220\060\015\006\011\052\206 -\110\206\367\015\001\001\005\005\000\003\201\201\000\042\022\330 -\172\035\334\201\006\266\011\145\262\207\310\037\136\264\057\351 -\304\036\362\074\301\273\004\220\021\112\203\116\176\223\271\115 -\102\307\222\046\240\134\064\232\070\162\370\375\153\026\076\040 -\356\202\213\061\052\223\066\205\043\210\212\074\003\150\323\311 -\011\017\115\374\154\244\332\050\162\223\016\211\200\260\175\376 -\200\157\145\155\030\063\227\213\302\153\211\356\140\075\310\233 -\357\177\053\062\142\163\223\313\074\343\173\342\166\170\105\274 -\241\223\004\273\206\237\072\133\103\172\303\212\145 -END - -# Trust for Certificate "Digital Signature Trust Co. Global CA 1" -# Issuer: OU=DSTCA E1,O=Digital Signature Trust Co.,C=US -# Serial Number: 913315222 (0x36701596) -# Subject: OU=DSTCA E1,O=Digital Signature Trust Co.,C=US -# Not Valid Before: Thu Dec 10 18:10:23 1998 -# Not Valid After : Mon Dec 10 18:40:23 2018 -# Fingerprint (MD5): 25:7A:BA:83:2E:B6:A2:0B:DA:FE:F5:02:0F:08:D7:AD -# Fingerprint (SHA1): 81:96:8B:3A:EF:1C:DC:70:F5:FA:32:69:C2:92:A3:63:5B:D1:23:D3 -CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "Digital Signature Trust Co. Global CA 1" -CKA_CERT_SHA1_HASH MULTILINE_OCTAL -\201\226\213\072\357\034\334\160\365\372\062\151\302\222\243\143 -\133\321\043\323 -END -CKA_CERT_MD5_HASH MULTILINE_OCTAL -\045\172\272\203\056\266\242\013\332\376\365\002\017\010\327\255 -END -CKA_ISSUER MULTILINE_OCTAL -\060\106\061\013\060\011\006\003\125\004\006\023\002\125\123\061 -\044\060\042\006\003\125\004\012\023\033\104\151\147\151\164\141 -\154\040\123\151\147\156\141\164\165\162\145\040\124\162\165\163 -\164\040\103\157\056\061\021\060\017\006\003\125\004\013\023\010 -\104\123\124\103\101\040\105\061 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\004\066\160\025\226 -END -CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_MUST_VERIFY_TRUST -CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_TRUSTED_DELEGATOR -CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_MUST_VERIFY_TRUST -CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE - -# -# Certificate "Digital Signature Trust Co. Global CA 3" -# -# Issuer: OU=DSTCA E2,O=Digital Signature Trust Co.,C=US -# Serial Number: 913232846 (0x366ed3ce) -# Subject: OU=DSTCA E2,O=Digital Signature Trust Co.,C=US -# Not Valid Before: Wed Dec 09 19:17:26 1998 -# Not Valid After : Sun Dec 09 19:47:26 2018 -# Fingerprint (MD5): 93:C2:8E:11:7B:D4:F3:03:19:BD:28:75:13:4A:45:4A -# Fingerprint (SHA1): AB:48:F3:33:DB:04:AB:B9:C0:72:DA:5B:0C:C1:D0:57:F0:36:9B:46 -CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "Digital Signature Trust Co. Global CA 3" -CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509 -CKA_SUBJECT MULTILINE_OCTAL -\060\106\061\013\060\011\006\003\125\004\006\023\002\125\123\061 -\044\060\042\006\003\125\004\012\023\033\104\151\147\151\164\141 -\154\040\123\151\147\156\141\164\165\162\145\040\124\162\165\163 -\164\040\103\157\056\061\021\060\017\006\003\125\004\013\023\010 -\104\123\124\103\101\040\105\062 -END -CKA_ID UTF8 "0" -CKA_ISSUER MULTILINE_OCTAL -\060\106\061\013\060\011\006\003\125\004\006\023\002\125\123\061 -\044\060\042\006\003\125\004\012\023\033\104\151\147\151\164\141 -\154\040\123\151\147\156\141\164\165\162\145\040\124\162\165\163 -\164\040\103\157\056\061\021\060\017\006\003\125\004\013\023\010 -\104\123\124\103\101\040\105\062 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\004\066\156\323\316 -END -CKA_VALUE MULTILINE_OCTAL -\060\202\003\051\060\202\002\222\240\003\002\001\002\002\004\066 -\156\323\316\060\015\006\011\052\206\110\206\367\015\001\001\005 -\005\000\060\106\061\013\060\011\006\003\125\004\006\023\002\125 -\123\061\044\060\042\006\003\125\004\012\023\033\104\151\147\151 -\164\141\154\040\123\151\147\156\141\164\165\162\145\040\124\162 -\165\163\164\040\103\157\056\061\021\060\017\006\003\125\004\013 -\023\010\104\123\124\103\101\040\105\062\060\036\027\015\071\070 -\061\062\060\071\061\071\061\067\062\066\132\027\015\061\070\061 -\062\060\071\061\071\064\067\062\066\132\060\106\061\013\060\011 -\006\003\125\004\006\023\002\125\123\061\044\060\042\006\003\125 -\004\012\023\033\104\151\147\151\164\141\154\040\123\151\147\156 -\141\164\165\162\145\040\124\162\165\163\164\040\103\157\056\061 -\021\060\017\006\003\125\004\013\023\010\104\123\124\103\101\040 -\105\062\060\201\235\060\015\006\011\052\206\110\206\367\015\001 -\001\001\005\000\003\201\213\000\060\201\207\002\201\201\000\277 -\223\217\027\222\357\063\023\030\353\020\177\116\026\277\377\006 -\217\052\205\274\136\371\044\246\044\210\266\003\267\301\303\137 -\003\133\321\157\256\176\102\352\146\043\270\143\203\126\373\050 -\055\341\070\213\264\356\250\001\341\316\034\266\210\052\042\106 -\205\373\237\247\160\251\107\024\077\316\336\145\360\250\161\367 -\117\046\154\214\274\306\265\357\336\111\047\377\110\052\175\350 -\115\003\314\307\262\122\306\027\061\023\073\265\115\333\310\304 -\366\303\017\044\052\332\014\235\347\221\133\200\315\224\235\002 -\001\003\243\202\001\044\060\202\001\040\060\021\006\011\140\206 -\110\001\206\370\102\001\001\004\004\003\002\000\007\060\150\006 -\003\125\035\037\004\141\060\137\060\135\240\133\240\131\244\127 -\060\125\061\013\060\011\006\003\125\004\006\023\002\125\123\061 -\044\060\042\006\003\125\004\012\023\033\104\151\147\151\164\141 -\154\040\123\151\147\156\141\164\165\162\145\040\124\162\165\163 -\164\040\103\157\056\061\021\060\017\006\003\125\004\013\023\010 -\104\123\124\103\101\040\105\062\061\015\060\013\006\003\125\004 -\003\023\004\103\122\114\061\060\053\006\003\125\035\020\004\044 -\060\042\200\017\061\071\071\070\061\062\060\071\061\071\061\067 -\062\066\132\201\017\062\060\061\070\061\062\060\071\061\071\061 -\067\062\066\132\060\013\006\003\125\035\017\004\004\003\002\001 -\006\060\037\006\003\125\035\043\004\030\060\026\200\024\036\202 -\115\050\145\200\074\311\101\156\254\065\056\132\313\336\356\370 -\071\133\060\035\006\003\125\035\016\004\026\004\024\036\202\115 -\050\145\200\074\311\101\156\254\065\056\132\313\336\356\370\071 -\133\060\014\006\003\125\035\023\004\005\060\003\001\001\377\060 -\031\006\011\052\206\110\206\366\175\007\101\000\004\014\060\012 -\033\004\126\064\056\060\003\002\004\220\060\015\006\011\052\206 -\110\206\367\015\001\001\005\005\000\003\201\201\000\107\215\203 -\255\142\362\333\260\236\105\042\005\271\242\326\003\016\070\162 -\347\236\374\173\346\223\266\232\245\242\224\310\064\035\221\321 -\305\327\364\012\045\017\075\170\201\236\017\261\147\304\220\114 -\143\335\136\247\342\272\237\365\367\115\245\061\173\234\051\055 -\114\376\144\076\354\266\123\376\352\233\355\202\333\164\165\113 -\007\171\156\036\330\031\203\163\336\365\076\320\265\336\347\113 -\150\175\103\056\052\040\341\176\240\170\104\236\010\365\230\371 -\307\177\033\033\326\006\040\002\130\241\303\242\003 -END - -# Trust for Certificate "Digital Signature Trust Co. Global CA 3" -# Issuer: OU=DSTCA E2,O=Digital Signature Trust Co.,C=US -# Serial Number: 913232846 (0x366ed3ce) -# Subject: OU=DSTCA E2,O=Digital Signature Trust Co.,C=US -# Not Valid Before: Wed Dec 09 19:17:26 1998 -# Not Valid After : Sun Dec 09 19:47:26 2018 -# Fingerprint (MD5): 93:C2:8E:11:7B:D4:F3:03:19:BD:28:75:13:4A:45:4A -# Fingerprint (SHA1): AB:48:F3:33:DB:04:AB:B9:C0:72:DA:5B:0C:C1:D0:57:F0:36:9B:46 -CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "Digital Signature Trust Co. Global CA 3" -CKA_CERT_SHA1_HASH MULTILINE_OCTAL -\253\110\363\063\333\004\253\271\300\162\332\133\014\301\320\127 -\360\066\233\106 -END -CKA_CERT_MD5_HASH MULTILINE_OCTAL -\223\302\216\021\173\324\363\003\031\275\050\165\023\112\105\112 -END -CKA_ISSUER MULTILINE_OCTAL -\060\106\061\013\060\011\006\003\125\004\006\023\002\125\123\061 -\044\060\042\006\003\125\004\012\023\033\104\151\147\151\164\141 -\154\040\123\151\147\156\141\164\165\162\145\040\124\162\165\163 -\164\040\103\157\056\061\021\060\017\006\003\125\004\013\023\010 -\104\123\124\103\101\040\105\062 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\004\066\156\323\316 -END -CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_MUST_VERIFY_TRUST -CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_TRUSTED_DELEGATOR -CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_MUST_VERIFY_TRUST -CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE - # # Certificate "Verisign Class 3 Public Primary Certification Authority" # @@ -1890,170 +1644,6 @@ CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_NOT_TRUSTED CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_NOT_TRUSTED CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE -# -# Certificate "Verisign Class 4 Public Primary Certification Authority - G3" -# -# Issuer: CN=VeriSign Class 4 Public Primary Certification Authority - G3,OU="(c) 1999 VeriSign, Inc. - For authorized use only",OU=VeriSign Trust Network,O="VeriSign, Inc.",C=US -# Serial Number:00:ec:a0:a7:8b:6e:75:6a:01:cf:c4:7c:cc:2f:94:5e:d7 -# Subject: CN=VeriSign Class 4 Public Primary Certification Authority - G3,OU="(c) 1999 VeriSign, Inc. - For authorized use only",OU=VeriSign Trust Network,O="VeriSign, Inc.",C=US -# Not Valid Before: Fri Oct 01 00:00:00 1999 -# Not Valid After : Wed Jul 16 23:59:59 2036 -# Fingerprint (MD5): DB:C8:F2:27:2E:B1:EA:6A:29:23:5D:FE:56:3E:33:DF -# Fingerprint (SHA1): C8:EC:8C:87:92:69:CB:4B:AB:39:E9:8D:7E:57:67:F3:14:95:73:9D -CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "Verisign Class 4 Public Primary Certification Authority - G3" -CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509 -CKA_SUBJECT MULTILINE_OCTAL -\060\201\312\061\013\060\011\006\003\125\004\006\023\002\125\123 -\061\027\060\025\006\003\125\004\012\023\016\126\145\162\151\123 -\151\147\156\054\040\111\156\143\056\061\037\060\035\006\003\125 -\004\013\023\026\126\145\162\151\123\151\147\156\040\124\162\165 -\163\164\040\116\145\164\167\157\162\153\061\072\060\070\006\003 -\125\004\013\023\061\050\143\051\040\061\071\071\071\040\126\145 -\162\151\123\151\147\156\054\040\111\156\143\056\040\055\040\106 -\157\162\040\141\165\164\150\157\162\151\172\145\144\040\165\163 -\145\040\157\156\154\171\061\105\060\103\006\003\125\004\003\023 -\074\126\145\162\151\123\151\147\156\040\103\154\141\163\163\040 -\064\040\120\165\142\154\151\143\040\120\162\151\155\141\162\171 -\040\103\145\162\164\151\146\151\143\141\164\151\157\156\040\101 -\165\164\150\157\162\151\164\171\040\055\040\107\063 -END -CKA_ID UTF8 "0" -CKA_ISSUER MULTILINE_OCTAL -\060\201\312\061\013\060\011\006\003\125\004\006\023\002\125\123 -\061\027\060\025\006\003\125\004\012\023\016\126\145\162\151\123 -\151\147\156\054\040\111\156\143\056\061\037\060\035\006\003\125 -\004\013\023\026\126\145\162\151\123\151\147\156\040\124\162\165 -\163\164\040\116\145\164\167\157\162\153\061\072\060\070\006\003 -\125\004\013\023\061\050\143\051\040\061\071\071\071\040\126\145 -\162\151\123\151\147\156\054\040\111\156\143\056\040\055\040\106 -\157\162\040\141\165\164\150\157\162\151\172\145\144\040\165\163 -\145\040\157\156\154\171\061\105\060\103\006\003\125\004\003\023 -\074\126\145\162\151\123\151\147\156\040\103\154\141\163\163\040 -\064\040\120\165\142\154\151\143\040\120\162\151\155\141\162\171 -\040\103\145\162\164\151\146\151\143\141\164\151\157\156\040\101 -\165\164\150\157\162\151\164\171\040\055\040\107\063 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\021\000\354\240\247\213\156\165\152\001\317\304\174\314\057 -\224\136\327 -END -CKA_VALUE MULTILINE_OCTAL -\060\202\004\032\060\202\003\002\002\021\000\354\240\247\213\156 -\165\152\001\317\304\174\314\057\224\136\327\060\015\006\011\052 -\206\110\206\367\015\001\001\005\005\000\060\201\312\061\013\060 -\011\006\003\125\004\006\023\002\125\123\061\027\060\025\006\003 -\125\004\012\023\016\126\145\162\151\123\151\147\156\054\040\111 -\156\143\056\061\037\060\035\006\003\125\004\013\023\026\126\145 -\162\151\123\151\147\156\040\124\162\165\163\164\040\116\145\164 -\167\157\162\153\061\072\060\070\006\003\125\004\013\023\061\050 -\143\051\040\061\071\071\071\040\126\145\162\151\123\151\147\156 -\054\040\111\156\143\056\040\055\040\106\157\162\040\141\165\164 -\150\157\162\151\172\145\144\040\165\163\145\040\157\156\154\171 -\061\105\060\103\006\003\125\004\003\023\074\126\145\162\151\123 -\151\147\156\040\103\154\141\163\163\040\064\040\120\165\142\154 -\151\143\040\120\162\151\155\141\162\171\040\103\145\162\164\151 -\146\151\143\141\164\151\157\156\040\101\165\164\150\157\162\151 -\164\171\040\055\040\107\063\060\036\027\015\071\071\061\060\060 -\061\060\060\060\060\060\060\132\027\015\063\066\060\067\061\066 -\062\063\065\071\065\071\132\060\201\312\061\013\060\011\006\003 -\125\004\006\023\002\125\123\061\027\060\025\006\003\125\004\012 -\023\016\126\145\162\151\123\151\147\156\054\040\111\156\143\056 -\061\037\060\035\006\003\125\004\013\023\026\126\145\162\151\123 -\151\147\156\040\124\162\165\163\164\040\116\145\164\167\157\162 -\153\061\072\060\070\006\003\125\004\013\023\061\050\143\051\040 -\061\071\071\071\040\126\145\162\151\123\151\147\156\054\040\111 -\156\143\056\040\055\040\106\157\162\040\141\165\164\150\157\162 -\151\172\145\144\040\165\163\145\040\157\156\154\171\061\105\060 -\103\006\003\125\004\003\023\074\126\145\162\151\123\151\147\156 -\040\103\154\141\163\163\040\064\040\120\165\142\154\151\143\040 -\120\162\151\155\141\162\171\040\103\145\162\164\151\146\151\143 -\141\164\151\157\156\040\101\165\164\150\157\162\151\164\171\040 -\055\040\107\063\060\202\001\042\060\015\006\011\052\206\110\206 -\367\015\001\001\001\005\000\003\202\001\017\000\060\202\001\012 -\002\202\001\001\000\255\313\245\021\151\306\131\253\361\217\265 -\031\017\126\316\314\265\037\040\344\236\046\045\113\340\163\145 -\211\131\336\320\203\344\365\017\265\273\255\361\174\350\041\374 -\344\350\014\356\174\105\042\031\166\222\264\023\267\040\133\011 -\372\141\256\250\362\245\215\205\302\052\326\336\146\066\322\233 -\002\364\250\222\140\174\234\151\264\217\044\036\320\206\122\366 -\062\234\101\130\036\042\275\315\105\142\225\010\156\320\146\335 -\123\242\314\360\020\334\124\163\213\004\241\106\063\063\134\027 -\100\271\236\115\323\363\276\125\203\350\261\211\216\132\174\232 -\226\042\220\073\210\045\362\322\123\210\002\014\013\170\362\346 -\067\027\113\060\106\007\344\200\155\246\330\226\056\350\054\370 -\021\263\070\015\146\246\233\352\311\043\133\333\216\342\363\023 -\216\032\131\055\252\002\360\354\244\207\146\334\301\077\365\330 -\271\364\354\202\306\322\075\225\035\345\300\117\204\311\331\243 -\104\050\006\152\327\105\254\360\153\152\357\116\137\370\021\202 -\036\070\143\064\146\120\324\076\223\163\372\060\303\146\255\377 -\223\055\227\357\003\002\003\001\000\001\060\015\006\011\052\206 -\110\206\367\015\001\001\005\005\000\003\202\001\001\000\217\372 -\045\153\117\133\344\244\116\047\125\253\042\025\131\074\312\265 -\012\324\112\333\253\335\241\137\123\305\240\127\071\302\316\107 -\053\276\072\310\126\277\302\331\047\020\072\261\005\074\300\167 -\061\273\072\323\005\173\155\232\034\060\214\200\313\223\223\052 -\203\253\005\121\202\002\000\021\147\153\363\210\141\107\137\003 -\223\325\133\015\340\361\324\241\062\065\205\262\072\333\260\202 -\253\321\313\012\274\117\214\133\305\113\000\073\037\052\202\246 -\176\066\205\334\176\074\147\000\265\344\073\122\340\250\353\135 -\025\371\306\155\360\255\035\016\205\267\251\232\163\024\132\133 -\217\101\050\300\325\350\055\115\244\136\315\252\331\355\316\334 -\330\325\074\102\035\027\301\022\135\105\070\303\070\363\374\205 -\056\203\106\110\262\327\040\137\222\066\217\347\171\017\230\136 -\231\350\360\320\244\273\365\123\275\052\316\131\260\257\156\177 -\154\273\322\036\000\260\041\355\370\101\142\202\271\330\262\304 -\273\106\120\363\061\305\217\001\250\164\353\365\170\047\332\347 -\367\146\103\363\236\203\076\040\252\303\065\140\221\316 -END - -# Trust for Certificate "Verisign Class 4 Public Primary Certification Authority - G3" -# Issuer: CN=VeriSign Class 4 Public Primary Certification Authority - G3,OU="(c) 1999 VeriSign, Inc. - For authorized use only",OU=VeriSign Trust Network,O="VeriSign, Inc.",C=US -# Serial Number:00:ec:a0:a7:8b:6e:75:6a:01:cf:c4:7c:cc:2f:94:5e:d7 -# Subject: CN=VeriSign Class 4 Public Primary Certification Authority - G3,OU="(c) 1999 VeriSign, Inc. - For authorized use only",OU=VeriSign Trust Network,O="VeriSign, Inc.",C=US -# Not Valid Before: Fri Oct 01 00:00:00 1999 -# Not Valid After : Wed Jul 16 23:59:59 2036 -# Fingerprint (MD5): DB:C8:F2:27:2E:B1:EA:6A:29:23:5D:FE:56:3E:33:DF -# Fingerprint (SHA1): C8:EC:8C:87:92:69:CB:4B:AB:39:E9:8D:7E:57:67:F3:14:95:73:9D -CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "Verisign Class 4 Public Primary Certification Authority - G3" -CKA_CERT_SHA1_HASH MULTILINE_OCTAL -\310\354\214\207\222\151\313\113\253\071\351\215\176\127\147\363 -\024\225\163\235 -END -CKA_CERT_MD5_HASH MULTILINE_OCTAL -\333\310\362\047\056\261\352\152\051\043\135\376\126\076\063\337 -END -CKA_ISSUER MULTILINE_OCTAL -\060\201\312\061\013\060\011\006\003\125\004\006\023\002\125\123 -\061\027\060\025\006\003\125\004\012\023\016\126\145\162\151\123 -\151\147\156\054\040\111\156\143\056\061\037\060\035\006\003\125 -\004\013\023\026\126\145\162\151\123\151\147\156\040\124\162\165 -\163\164\040\116\145\164\167\157\162\153\061\072\060\070\006\003 -\125\004\013\023\061\050\143\051\040\061\071\071\071\040\126\145 -\162\151\123\151\147\156\054\040\111\156\143\056\040\055\040\106 -\157\162\040\141\165\164\150\157\162\151\172\145\144\040\165\163 -\145\040\157\156\154\171\061\105\060\103\006\003\125\004\003\023 -\074\126\145\162\151\123\151\147\156\040\103\154\141\163\163\040 -\064\040\120\165\142\154\151\143\040\120\162\151\155\141\162\171 -\040\103\145\162\164\151\146\151\143\141\164\151\157\156\040\101 -\165\164\150\157\162\151\164\171\040\055\040\107\063 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\021\000\354\240\247\213\156\165\152\001\317\304\174\314\057 -\224\136\327 -END -CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_TRUSTED_DELEGATOR -CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_TRUSTED_DELEGATOR -CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_TRUSTED_DELEGATOR -CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE - # # Certificate "Entrust.net Premium 2048 Secure Server CA" # @@ -4024,169 +3614,6 @@ CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_TRUSTED_DELEGATOR CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_TRUSTED_DELEGATOR CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE -# -# Certificate "UTN-USER First-Network Applications" -# -# Issuer: CN=UTN-USERFirst-Network Applications,OU=http://www.usertrust.com,O=The USERTRUST Network,L=Salt Lake City,ST=UT,C=US -# Serial Number:44:be:0c:8b:50:00:24:b4:11:d3:36:30:4b:c0:33:77 -# Subject: CN=UTN-USERFirst-Network Applications,OU=http://www.usertrust.com,O=The USERTRUST Network,L=Salt Lake City,ST=UT,C=US -# Not Valid Before: Fri Jul 09 18:48:39 1999 -# Not Valid After : Tue Jul 09 18:57:49 2019 -# Fingerprint (MD5): BF:60:59:A3:5B:BA:F6:A7:76:42:DA:6F:1A:7B:50:CF -# Fingerprint (SHA1): 5D:98:9C:DB:15:96:11:36:51:65:64:1B:56:0F:DB:EA:2A:C2:3E:F1 -CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "UTN-USER First-Network Applications" -CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509 -CKA_SUBJECT MULTILINE_OCTAL -\060\201\243\061\013\060\011\006\003\125\004\006\023\002\125\123 -\061\013\060\011\006\003\125\004\010\023\002\125\124\061\027\060 -\025\006\003\125\004\007\023\016\123\141\154\164\040\114\141\153 -\145\040\103\151\164\171\061\036\060\034\006\003\125\004\012\023 -\025\124\150\145\040\125\123\105\122\124\122\125\123\124\040\116 -\145\164\167\157\162\153\061\041\060\037\006\003\125\004\013\023 -\030\150\164\164\160\072\057\057\167\167\167\056\165\163\145\162 -\164\162\165\163\164\056\143\157\155\061\053\060\051\006\003\125 -\004\003\023\042\125\124\116\055\125\123\105\122\106\151\162\163 -\164\055\116\145\164\167\157\162\153\040\101\160\160\154\151\143 -\141\164\151\157\156\163 -END -CKA_ID UTF8 "0" -CKA_ISSUER MULTILINE_OCTAL -\060\201\243\061\013\060\011\006\003\125\004\006\023\002\125\123 -\061\013\060\011\006\003\125\004\010\023\002\125\124\061\027\060 -\025\006\003\125\004\007\023\016\123\141\154\164\040\114\141\153 -\145\040\103\151\164\171\061\036\060\034\006\003\125\004\012\023 -\025\124\150\145\040\125\123\105\122\124\122\125\123\124\040\116 -\145\164\167\157\162\153\061\041\060\037\006\003\125\004\013\023 -\030\150\164\164\160\072\057\057\167\167\167\056\165\163\145\162 -\164\162\165\163\164\056\143\157\155\061\053\060\051\006\003\125 -\004\003\023\042\125\124\116\055\125\123\105\122\106\151\162\163 -\164\055\116\145\164\167\157\162\153\040\101\160\160\154\151\143 -\141\164\151\157\156\163 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\020\104\276\014\213\120\000\044\264\021\323\066\060\113\300 -\063\167 -END -CKA_VALUE MULTILINE_OCTAL -\060\202\004\144\060\202\003\114\240\003\002\001\002\002\020\104 -\276\014\213\120\000\044\264\021\323\066\060\113\300\063\167\060 -\015\006\011\052\206\110\206\367\015\001\001\005\005\000\060\201 -\243\061\013\060\011\006\003\125\004\006\023\002\125\123\061\013 -\060\011\006\003\125\004\010\023\002\125\124\061\027\060\025\006 -\003\125\004\007\023\016\123\141\154\164\040\114\141\153\145\040 -\103\151\164\171\061\036\060\034\006\003\125\004\012\023\025\124 -\150\145\040\125\123\105\122\124\122\125\123\124\040\116\145\164 -\167\157\162\153\061\041\060\037\006\003\125\004\013\023\030\150 -\164\164\160\072\057\057\167\167\167\056\165\163\145\162\164\162 -\165\163\164\056\143\157\155\061\053\060\051\006\003\125\004\003 -\023\042\125\124\116\055\125\123\105\122\106\151\162\163\164\055 -\116\145\164\167\157\162\153\040\101\160\160\154\151\143\141\164 -\151\157\156\163\060\036\027\015\071\071\060\067\060\071\061\070 -\064\070\063\071\132\027\015\061\071\060\067\060\071\061\070\065 -\067\064\071\132\060\201\243\061\013\060\011\006\003\125\004\006 -\023\002\125\123\061\013\060\011\006\003\125\004\010\023\002\125 -\124\061\027\060\025\006\003\125\004\007\023\016\123\141\154\164 -\040\114\141\153\145\040\103\151\164\171\061\036\060\034\006\003 -\125\004\012\023\025\124\150\145\040\125\123\105\122\124\122\125 -\123\124\040\116\145\164\167\157\162\153\061\041\060\037\006\003 -\125\004\013\023\030\150\164\164\160\072\057\057\167\167\167\056 -\165\163\145\162\164\162\165\163\164\056\143\157\155\061\053\060 -\051\006\003\125\004\003\023\042\125\124\116\055\125\123\105\122 -\106\151\162\163\164\055\116\145\164\167\157\162\153\040\101\160 -\160\154\151\143\141\164\151\157\156\163\060\202\001\042\060\015 -\006\011\052\206\110\206\367\015\001\001\001\005\000\003\202\001 -\017\000\060\202\001\012\002\202\001\001\000\263\373\221\241\344 -\066\125\205\254\006\064\133\240\232\130\262\370\265\017\005\167 -\203\256\062\261\166\222\150\354\043\112\311\166\077\343\234\266 -\067\171\003\271\253\151\215\007\045\266\031\147\344\260\033\030 -\163\141\112\350\176\315\323\057\144\343\246\174\014\372\027\200 -\243\015\107\211\117\121\161\057\356\374\077\371\270\026\200\207 -\211\223\045\040\232\103\202\151\044\166\050\131\065\241\035\300 -\177\203\006\144\026\040\054\323\111\244\205\264\300\141\177\121 -\010\370\150\025\221\200\313\245\325\356\073\072\364\204\004\136 -\140\131\247\214\064\162\356\270\170\305\321\073\022\112\157\176 -\145\047\271\244\125\305\271\157\103\244\305\035\054\231\300\122 -\244\170\114\025\263\100\230\010\153\103\306\001\260\172\173\365 -\153\034\042\077\313\357\377\250\320\072\113\166\025\236\322\321 -\306\056\343\333\127\033\062\242\270\157\350\206\246\077\160\253 -\345\160\222\253\104\036\100\120\373\234\243\142\344\154\156\240 -\310\336\342\200\102\372\351\057\350\316\062\004\217\174\215\267 -\034\243\065\074\025\335\236\303\256\227\245\002\003\001\000\001 -\243\201\221\060\201\216\060\013\006\003\125\035\017\004\004\003 -\002\001\306\060\017\006\003\125\035\023\001\001\377\004\005\060 -\003\001\001\377\060\035\006\003\125\035\016\004\026\004\024\372 -\206\311\333\340\272\351\170\365\113\250\326\025\337\360\323\341 -\152\024\074\060\117\006\003\125\035\037\004\110\060\106\060\104 -\240\102\240\100\206\076\150\164\164\160\072\057\057\143\162\154 -\056\165\163\145\162\164\162\165\163\164\056\143\157\155\057\125 -\124\116\055\125\123\105\122\106\151\162\163\164\055\116\145\164 -\167\157\162\153\101\160\160\154\151\143\141\164\151\157\156\163 -\056\143\162\154\060\015\006\011\052\206\110\206\367\015\001\001 -\005\005\000\003\202\001\001\000\244\363\045\314\321\324\221\203 -\042\320\314\062\253\233\226\116\064\221\124\040\045\064\141\137 -\052\002\025\341\213\252\377\175\144\121\317\012\377\274\175\330 -\041\152\170\313\057\121\157\370\102\035\063\275\353\265\173\224 -\303\303\251\240\055\337\321\051\037\035\376\217\077\273\250\105 -\052\177\321\156\125\044\342\273\002\373\061\077\276\350\274\354 -\100\053\370\001\324\126\070\344\312\104\202\265\141\040\041\147 -\145\366\360\013\347\064\370\245\302\234\243\134\100\037\205\223 -\225\006\336\117\324\047\251\266\245\374\026\315\163\061\077\270 -\145\047\317\324\123\032\360\254\156\237\117\005\014\003\201\247 -\204\051\304\132\275\144\127\162\255\073\317\067\030\246\230\306 -\255\006\264\334\010\243\004\325\051\244\226\232\022\147\112\214 -\140\105\235\361\043\232\260\000\234\150\265\230\120\323\357\216 -\056\222\145\261\110\076\041\276\025\060\052\015\265\014\243\153 -\077\256\177\127\365\037\226\174\337\157\335\202\060\054\145\033 -\100\112\315\150\271\162\354\161\166\354\124\216\037\205\014\001 -\152\372\246\070\254\037\304\204 -END - -# Trust for Certificate "UTN-USER First-Network Applications" -# Issuer: CN=UTN-USERFirst-Network Applications,OU=http://www.usertrust.com,O=The USERTRUST Network,L=Salt Lake City,ST=UT,C=US -# Serial Number:44:be:0c:8b:50:00:24:b4:11:d3:36:30:4b:c0:33:77 -# Subject: CN=UTN-USERFirst-Network Applications,OU=http://www.usertrust.com,O=The USERTRUST Network,L=Salt Lake City,ST=UT,C=US -# Not Valid Before: Fri Jul 09 18:48:39 1999 -# Not Valid After : Tue Jul 09 18:57:49 2019 -# Fingerprint (MD5): BF:60:59:A3:5B:BA:F6:A7:76:42:DA:6F:1A:7B:50:CF -# Fingerprint (SHA1): 5D:98:9C:DB:15:96:11:36:51:65:64:1B:56:0F:DB:EA:2A:C2:3E:F1 -CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "UTN-USER First-Network Applications" -CKA_CERT_SHA1_HASH MULTILINE_OCTAL -\135\230\234\333\025\226\021\066\121\145\144\033\126\017\333\352 -\052\302\076\361 -END -CKA_CERT_MD5_HASH MULTILINE_OCTAL -\277\140\131\243\133\272\366\247\166\102\332\157\032\173\120\317 -END -CKA_ISSUER MULTILINE_OCTAL -\060\201\243\061\013\060\011\006\003\125\004\006\023\002\125\123 -\061\013\060\011\006\003\125\004\010\023\002\125\124\061\027\060 -\025\006\003\125\004\007\023\016\123\141\154\164\040\114\141\153 -\145\040\103\151\164\171\061\036\060\034\006\003\125\004\012\023 -\025\124\150\145\040\125\123\105\122\124\122\125\123\124\040\116 -\145\164\167\157\162\153\061\041\060\037\006\003\125\004\013\023 -\030\150\164\164\160\072\057\057\167\167\167\056\165\163\145\162 -\164\162\165\163\164\056\143\157\155\061\053\060\051\006\003\125 -\004\003\023\042\125\124\116\055\125\123\105\122\106\151\162\163 -\164\055\116\145\164\167\157\162\153\040\101\160\160\154\151\143 -\141\164\151\157\156\163 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\020\104\276\014\213\120\000\044\264\021\323\066\060\113\300 -\063\167 -END -CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_MUST_VERIFY_TRUST -CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_MUST_VERIFY_TRUST -CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_MUST_VERIFY_TRUST -CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE - # # Certificate "Visa eCommerce Root" # @@ -5922,198 +5349,38 @@ CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_TRUSTED_DELEGATOR CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE # -# Certificate "UTN DATACorp SGC Root CA" +# Certificate "UTN USERFirst Email Root CA" # -# Issuer: CN=UTN - DATACorp SGC,OU=http://www.usertrust.com,O=The USERTRUST Network,L=Salt Lake City,ST=UT,C=US -# Serial Number:44:be:0c:8b:50:00:21:b4:11:d3:2a:68:06:a9:ad:69 -# Subject: CN=UTN - DATACorp SGC,OU=http://www.usertrust.com,O=The USERTRUST Network,L=Salt Lake City,ST=UT,C=US -# Not Valid Before: Thu Jun 24 18:57:21 1999 -# Not Valid After : Mon Jun 24 19:06:30 2019 -# Fingerprint (MD5): B3:A5:3E:77:21:6D:AC:4A:C0:C9:FB:D5:41:3D:CA:06 -# Fingerprint (SHA1): 58:11:9F:0E:12:82:87:EA:50:FD:D9:87:45:6F:4F:78:DC:FA:D6:D4 +# Issuer: CN=UTN-USERFirst-Client Authentication and Email,OU=http://www.usertrust.com,O=The USERTRUST Network,L=Salt Lake City,ST=UT,C=US +# Serial Number:44:be:0c:8b:50:00:24:b4:11:d3:36:25:25:67:c9:89 +# Subject: CN=UTN-USERFirst-Client Authentication and Email,OU=http://www.usertrust.com,O=The USERTRUST Network,L=Salt Lake City,ST=UT,C=US +# Not Valid Before: Fri Jul 09 17:28:50 1999 +# Not Valid After : Tue Jul 09 17:36:58 2019 +# Fingerprint (MD5): D7:34:3D:EF:1D:27:09:28:E1:31:02:5B:13:2B:DD:F7 +# Fingerprint (SHA1): B1:72:B1:A5:6D:95:F9:1F:E5:02:87:E1:4D:37:EA:6A:44:63:76:8A CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE CKA_TOKEN CK_BBOOL CK_TRUE CKA_PRIVATE CK_BBOOL CK_FALSE CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "UTN DATACorp SGC Root CA" +CKA_LABEL UTF8 "UTN USERFirst Email Root CA" CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509 CKA_SUBJECT MULTILINE_OCTAL -\060\201\223\061\013\060\011\006\003\125\004\006\023\002\125\123 +\060\201\256\061\013\060\011\006\003\125\004\006\023\002\125\123 \061\013\060\011\006\003\125\004\010\023\002\125\124\061\027\060 \025\006\003\125\004\007\023\016\123\141\154\164\040\114\141\153 \145\040\103\151\164\171\061\036\060\034\006\003\125\004\012\023 \025\124\150\145\040\125\123\105\122\124\122\125\123\124\040\116 \145\164\167\157\162\153\061\041\060\037\006\003\125\004\013\023 \030\150\164\164\160\072\057\057\167\167\167\056\165\163\145\162 -\164\162\165\163\164\056\143\157\155\061\033\060\031\006\003\125 -\004\003\023\022\125\124\116\040\055\040\104\101\124\101\103\157 -\162\160\040\123\107\103 +\164\162\165\163\164\056\143\157\155\061\066\060\064\006\003\125 +\004\003\023\055\125\124\116\055\125\123\105\122\106\151\162\163 +\164\055\103\154\151\145\156\164\040\101\165\164\150\145\156\164 +\151\143\141\164\151\157\156\040\141\156\144\040\105\155\141\151 +\154 END CKA_ID UTF8 "0" CKA_ISSUER MULTILINE_OCTAL -\060\201\223\061\013\060\011\006\003\125\004\006\023\002\125\123 -\061\013\060\011\006\003\125\004\010\023\002\125\124\061\027\060 -\025\006\003\125\004\007\023\016\123\141\154\164\040\114\141\153 -\145\040\103\151\164\171\061\036\060\034\006\003\125\004\012\023 -\025\124\150\145\040\125\123\105\122\124\122\125\123\124\040\116 -\145\164\167\157\162\153\061\041\060\037\006\003\125\004\013\023 -\030\150\164\164\160\072\057\057\167\167\167\056\165\163\145\162 -\164\162\165\163\164\056\143\157\155\061\033\060\031\006\003\125 -\004\003\023\022\125\124\116\040\055\040\104\101\124\101\103\157 -\162\160\040\123\107\103 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\020\104\276\014\213\120\000\041\264\021\323\052\150\006\251 -\255\151 -END -CKA_VALUE MULTILINE_OCTAL -\060\202\004\136\060\202\003\106\240\003\002\001\002\002\020\104 -\276\014\213\120\000\041\264\021\323\052\150\006\251\255\151\060 -\015\006\011\052\206\110\206\367\015\001\001\005\005\000\060\201 -\223\061\013\060\011\006\003\125\004\006\023\002\125\123\061\013 -\060\011\006\003\125\004\010\023\002\125\124\061\027\060\025\006 -\003\125\004\007\023\016\123\141\154\164\040\114\141\153\145\040 -\103\151\164\171\061\036\060\034\006\003\125\004\012\023\025\124 -\150\145\040\125\123\105\122\124\122\125\123\124\040\116\145\164 -\167\157\162\153\061\041\060\037\006\003\125\004\013\023\030\150 -\164\164\160\072\057\057\167\167\167\056\165\163\145\162\164\162 -\165\163\164\056\143\157\155\061\033\060\031\006\003\125\004\003 -\023\022\125\124\116\040\055\040\104\101\124\101\103\157\162\160 -\040\123\107\103\060\036\027\015\071\071\060\066\062\064\061\070 -\065\067\062\061\132\027\015\061\071\060\066\062\064\061\071\060 -\066\063\060\132\060\201\223\061\013\060\011\006\003\125\004\006 -\023\002\125\123\061\013\060\011\006\003\125\004\010\023\002\125 -\124\061\027\060\025\006\003\125\004\007\023\016\123\141\154\164 -\040\114\141\153\145\040\103\151\164\171\061\036\060\034\006\003 -\125\004\012\023\025\124\150\145\040\125\123\105\122\124\122\125 -\123\124\040\116\145\164\167\157\162\153\061\041\060\037\006\003 -\125\004\013\023\030\150\164\164\160\072\057\057\167\167\167\056 -\165\163\145\162\164\162\165\163\164\056\143\157\155\061\033\060 -\031\006\003\125\004\003\023\022\125\124\116\040\055\040\104\101 -\124\101\103\157\162\160\040\123\107\103\060\202\001\042\060\015 -\006\011\052\206\110\206\367\015\001\001\001\005\000\003\202\001 -\017\000\060\202\001\012\002\202\001\001\000\337\356\130\020\242 -\053\156\125\304\216\277\056\106\011\347\340\010\017\056\053\172 -\023\224\033\275\366\266\200\216\145\005\223\000\036\274\257\342 -\017\216\031\015\022\107\354\254\255\243\372\056\160\370\336\156 -\373\126\102\025\236\056\134\357\043\336\041\271\005\166\047\031 -\017\117\326\303\234\264\276\224\031\143\362\246\021\012\353\123 -\110\234\276\362\051\073\026\350\032\240\114\246\311\364\030\131 -\150\300\160\362\123\000\300\136\120\202\245\126\157\066\371\112 -\340\104\206\240\115\116\326\107\156\111\112\313\147\327\246\304 -\005\271\216\036\364\374\377\315\347\066\340\234\005\154\262\063 -\042\025\320\264\340\314\027\300\262\300\364\376\062\077\051\052 -\225\173\330\362\247\116\017\124\174\241\015\200\263\011\003\301 -\377\134\335\136\232\076\274\256\274\107\212\152\256\161\312\037 -\261\052\270\137\102\005\013\354\106\060\321\162\013\312\351\126 -\155\365\357\337\170\276\141\272\262\245\256\004\114\274\250\254 -\151\025\227\275\357\353\264\214\277\065\370\324\303\321\050\016 -\134\072\237\160\030\063\040\167\304\242\257\002\003\001\000\001 -\243\201\253\060\201\250\060\013\006\003\125\035\017\004\004\003 -\002\001\306\060\017\006\003\125\035\023\001\001\377\004\005\060 -\003\001\001\377\060\035\006\003\125\035\016\004\026\004\024\123 -\062\321\263\317\177\372\340\361\240\135\205\116\222\322\236\105 -\035\264\117\060\075\006\003\125\035\037\004\066\060\064\060\062 -\240\060\240\056\206\054\150\164\164\160\072\057\057\143\162\154 -\056\165\163\145\162\164\162\165\163\164\056\143\157\155\057\125 -\124\116\055\104\101\124\101\103\157\162\160\123\107\103\056\143 -\162\154\060\052\006\003\125\035\045\004\043\060\041\006\010\053 -\006\001\005\005\007\003\001\006\012\053\006\001\004\001\202\067 -\012\003\003\006\011\140\206\110\001\206\370\102\004\001\060\015 -\006\011\052\206\110\206\367\015\001\001\005\005\000\003\202\001 -\001\000\047\065\227\000\212\213\050\275\306\063\060\036\051\374 -\342\367\325\230\324\100\273\140\312\277\253\027\054\011\066\177 -\120\372\101\334\256\226\072\012\043\076\211\131\311\243\007\355 -\033\067\255\374\174\276\121\111\132\336\072\012\124\010\026\105 -\302\231\261\207\315\214\150\340\151\003\351\304\116\230\262\073 -\214\026\263\016\240\014\230\120\233\223\251\160\011\310\054\243 -\217\337\002\344\340\161\072\361\264\043\162\240\252\001\337\337 -\230\076\024\120\240\061\046\275\050\351\132\060\046\165\371\173 -\140\034\215\363\315\120\046\155\004\047\232\337\325\015\105\107 -\051\153\054\346\166\331\251\051\175\062\335\311\066\074\275\256 -\065\361\021\236\035\273\220\077\022\107\116\216\327\176\017\142 -\163\035\122\046\070\034\030\111\375\060\164\232\304\345\042\057 -\330\300\215\355\221\172\114\000\217\162\177\135\332\335\033\213 -\105\153\347\335\151\227\250\305\126\114\017\014\366\237\172\221 -\067\366\227\202\340\335\161\151\377\166\077\140\115\074\317\367 -\231\371\306\127\364\311\125\071\170\272\054\171\311\246\210\053 -\364\010 -END - -# Trust for Certificate "UTN DATACorp SGC Root CA" -# Issuer: CN=UTN - DATACorp SGC,OU=http://www.usertrust.com,O=The USERTRUST Network,L=Salt Lake City,ST=UT,C=US -# Serial Number:44:be:0c:8b:50:00:21:b4:11:d3:2a:68:06:a9:ad:69 -# Subject: CN=UTN - DATACorp SGC,OU=http://www.usertrust.com,O=The USERTRUST Network,L=Salt Lake City,ST=UT,C=US -# Not Valid Before: Thu Jun 24 18:57:21 1999 -# Not Valid After : Mon Jun 24 19:06:30 2019 -# Fingerprint (MD5): B3:A5:3E:77:21:6D:AC:4A:C0:C9:FB:D5:41:3D:CA:06 -# Fingerprint (SHA1): 58:11:9F:0E:12:82:87:EA:50:FD:D9:87:45:6F:4F:78:DC:FA:D6:D4 -CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "UTN DATACorp SGC Root CA" -CKA_CERT_SHA1_HASH MULTILINE_OCTAL -\130\021\237\016\022\202\207\352\120\375\331\207\105\157\117\170 -\334\372\326\324 -END -CKA_CERT_MD5_HASH MULTILINE_OCTAL -\263\245\076\167\041\155\254\112\300\311\373\325\101\075\312\006 -END -CKA_ISSUER MULTILINE_OCTAL -\060\201\223\061\013\060\011\006\003\125\004\006\023\002\125\123 -\061\013\060\011\006\003\125\004\010\023\002\125\124\061\027\060 -\025\006\003\125\004\007\023\016\123\141\154\164\040\114\141\153 -\145\040\103\151\164\171\061\036\060\034\006\003\125\004\012\023 -\025\124\150\145\040\125\123\105\122\124\122\125\123\124\040\116 -\145\164\167\157\162\153\061\041\060\037\006\003\125\004\013\023 -\030\150\164\164\160\072\057\057\167\167\167\056\165\163\145\162 -\164\162\165\163\164\056\143\157\155\061\033\060\031\006\003\125 -\004\003\023\022\125\124\116\040\055\040\104\101\124\101\103\157 -\162\160\040\123\107\103 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\020\104\276\014\213\120\000\041\264\021\323\052\150\006\251 -\255\151 -END -CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_TRUSTED_DELEGATOR -CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_MUST_VERIFY_TRUST -CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_MUST_VERIFY_TRUST -CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE - -# -# Certificate "UTN USERFirst Email Root CA" -# -# Issuer: CN=UTN-USERFirst-Client Authentication and Email,OU=http://www.usertrust.com,O=The USERTRUST Network,L=Salt Lake City,ST=UT,C=US -# Serial Number:44:be:0c:8b:50:00:24:b4:11:d3:36:25:25:67:c9:89 -# Subject: CN=UTN-USERFirst-Client Authentication and Email,OU=http://www.usertrust.com,O=The USERTRUST Network,L=Salt Lake City,ST=UT,C=US -# Not Valid Before: Fri Jul 09 17:28:50 1999 -# Not Valid After : Tue Jul 09 17:36:58 2019 -# Fingerprint (MD5): D7:34:3D:EF:1D:27:09:28:E1:31:02:5B:13:2B:DD:F7 -# Fingerprint (SHA1): B1:72:B1:A5:6D:95:F9:1F:E5:02:87:E1:4D:37:EA:6A:44:63:76:8A -CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "UTN USERFirst Email Root CA" -CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509 -CKA_SUBJECT MULTILINE_OCTAL -\060\201\256\061\013\060\011\006\003\125\004\006\023\002\125\123 -\061\013\060\011\006\003\125\004\010\023\002\125\124\061\027\060 -\025\006\003\125\004\007\023\016\123\141\154\164\040\114\141\153 -\145\040\103\151\164\171\061\036\060\034\006\003\125\004\012\023 -\025\124\150\145\040\125\123\105\122\124\122\125\123\124\040\116 -\145\164\167\157\162\153\061\041\060\037\006\003\125\004\013\023 -\030\150\164\164\160\072\057\057\167\167\167\056\165\163\145\162 -\164\162\165\163\164\056\143\157\155\061\066\060\064\006\003\125 -\004\003\023\055\125\124\116\055\125\123\105\122\106\151\162\163 -\164\055\103\154\151\145\156\164\040\101\165\164\150\145\156\164 -\151\143\141\164\151\157\156\040\141\156\144\040\105\155\141\151 -\154 -END -CKA_ID UTF8 "0" -CKA_ISSUER MULTILINE_OCTAL -\060\201\256\061\013\060\011\006\003\125\004\006\023\002\125\123 +\060\201\256\061\013\060\011\006\003\125\004\006\023\002\125\123 \061\013\060\011\006\003\125\004\010\023\002\125\124\061\027\060 \025\006\003\125\004\007\023\016\123\141\154\164\040\114\141\153 \145\040\103\151\164\171\061\036\060\034\006\003\125\004\012\023 @@ -9442,327 +8709,6 @@ CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_MUST_VERIFY_TRUST CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_MUST_VERIFY_TRUST CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE -# -# Certificate "TURKTRUST Certificate Services Provider Root 1" -# -# Issuer: O=(c) 2005 T..RKTRUST Bilgi ..leti..im ve Bili..im G..venli..i Hiz...,L=ANKARA,C=TR,CN=T..RKTRUST Elektronik Sertifika Hizmet Sa..lay..c..s.. -# Serial Number: 1 (0x1) -# Subject: O=(c) 2005 T..RKTRUST Bilgi ..leti..im ve Bili..im G..venli..i Hiz...,L=ANKARA,C=TR,CN=T..RKTRUST Elektronik Sertifika Hizmet Sa..lay..c..s.. -# Not Valid Before: Fri May 13 10:27:17 2005 -# Not Valid After : Sun Mar 22 10:27:17 2015 -# Fingerprint (MD5): F1:6A:22:18:C9:CD:DF:CE:82:1D:1D:B7:78:5C:A9:A5 -# Fingerprint (SHA1): 79:98:A3:08:E1:4D:65:85:E6:C2:1E:15:3A:71:9F:BA:5A:D3:4A:D9 -CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "TURKTRUST Certificate Services Provider Root 1" -CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509 -CKA_SUBJECT MULTILINE_OCTAL -\060\201\267\061\077\060\075\006\003\125\004\003\014\066\124\303 -\234\122\113\124\122\125\123\124\040\105\154\145\153\164\162\157 -\156\151\153\040\123\145\162\164\151\146\151\153\141\040\110\151 -\172\155\145\164\040\123\141\304\237\154\141\171\304\261\143\304 -\261\163\304\261\061\013\060\011\006\003\125\004\006\014\002\124 -\122\061\017\060\015\006\003\125\004\007\014\006\101\116\113\101 -\122\101\061\126\060\124\006\003\125\004\012\014\115\050\143\051 -\040\062\060\060\065\040\124\303\234\122\113\124\122\125\123\124 -\040\102\151\154\147\151\040\304\260\154\145\164\151\305\237\151 -\155\040\166\145\040\102\151\154\151\305\237\151\155\040\107\303 -\274\166\145\156\154\151\304\237\151\040\110\151\172\155\145\164 -\154\145\162\151\040\101\056\305\236\056 -END -CKA_ID UTF8 "0" -CKA_ISSUER MULTILINE_OCTAL -\060\201\267\061\077\060\075\006\003\125\004\003\014\066\124\303 -\234\122\113\124\122\125\123\124\040\105\154\145\153\164\162\157 -\156\151\153\040\123\145\162\164\151\146\151\153\141\040\110\151 -\172\155\145\164\040\123\141\304\237\154\141\171\304\261\143\304 -\261\163\304\261\061\013\060\011\006\003\125\004\006\014\002\124 -\122\061\017\060\015\006\003\125\004\007\014\006\101\116\113\101 -\122\101\061\126\060\124\006\003\125\004\012\014\115\050\143\051 -\040\062\060\060\065\040\124\303\234\122\113\124\122\125\123\124 -\040\102\151\154\147\151\040\304\260\154\145\164\151\305\237\151 -\155\040\166\145\040\102\151\154\151\305\237\151\155\040\107\303 -\274\166\145\156\154\151\304\237\151\040\110\151\172\155\145\164 -\154\145\162\151\040\101\056\305\236\056 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\001\001 -END -CKA_VALUE MULTILINE_OCTAL -\060\202\003\373\060\202\002\343\240\003\002\001\002\002\001\001 -\060\015\006\011\052\206\110\206\367\015\001\001\005\005\000\060 -\201\267\061\077\060\075\006\003\125\004\003\014\066\124\303\234 -\122\113\124\122\125\123\124\040\105\154\145\153\164\162\157\156 -\151\153\040\123\145\162\164\151\146\151\153\141\040\110\151\172 -\155\145\164\040\123\141\304\237\154\141\171\304\261\143\304\261 -\163\304\261\061\013\060\011\006\003\125\004\006\014\002\124\122 -\061\017\060\015\006\003\125\004\007\014\006\101\116\113\101\122 -\101\061\126\060\124\006\003\125\004\012\014\115\050\143\051\040 -\062\060\060\065\040\124\303\234\122\113\124\122\125\123\124\040 -\102\151\154\147\151\040\304\260\154\145\164\151\305\237\151\155 -\040\166\145\040\102\151\154\151\305\237\151\155\040\107\303\274 -\166\145\156\154\151\304\237\151\040\110\151\172\155\145\164\154 -\145\162\151\040\101\056\305\236\056\060\036\027\015\060\065\060 -\065\061\063\061\060\062\067\061\067\132\027\015\061\065\060\063 -\062\062\061\060\062\067\061\067\132\060\201\267\061\077\060\075 -\006\003\125\004\003\014\066\124\303\234\122\113\124\122\125\123 -\124\040\105\154\145\153\164\162\157\156\151\153\040\123\145\162 -\164\151\146\151\153\141\040\110\151\172\155\145\164\040\123\141 -\304\237\154\141\171\304\261\143\304\261\163\304\261\061\013\060 -\011\006\003\125\004\006\014\002\124\122\061\017\060\015\006\003 -\125\004\007\014\006\101\116\113\101\122\101\061\126\060\124\006 -\003\125\004\012\014\115\050\143\051\040\062\060\060\065\040\124 -\303\234\122\113\124\122\125\123\124\040\102\151\154\147\151\040 -\304\260\154\145\164\151\305\237\151\155\040\166\145\040\102\151 -\154\151\305\237\151\155\040\107\303\274\166\145\156\154\151\304 -\237\151\040\110\151\172\155\145\164\154\145\162\151\040\101\056 -\305\236\056\060\202\001\042\060\015\006\011\052\206\110\206\367 -\015\001\001\001\005\000\003\202\001\017\000\060\202\001\012\002 -\202\001\001\000\312\122\005\326\143\003\330\034\137\335\322\173 -\135\362\014\140\141\133\153\073\164\053\170\015\175\105\275\042 -\164\350\214\003\301\306\021\052\075\225\274\251\224\260\273\221 -\227\310\151\174\204\305\264\221\154\154\023\152\244\125\255\244 -\205\350\225\176\263\000\257\000\302\005\030\365\160\235\066\213 -\256\313\344\033\201\177\223\210\373\152\125\273\175\205\222\316 -\272\130\237\333\062\305\275\135\357\042\112\057\101\007\176\111 -\141\263\206\354\116\246\101\156\204\274\003\354\365\073\034\310 -\037\302\356\250\356\352\022\112\215\024\317\363\012\340\120\071 -\371\010\065\370\021\131\255\347\042\352\113\312\024\006\336\102 -\272\262\231\363\055\124\210\020\006\352\341\032\076\075\147\037 -\373\316\373\174\202\350\021\135\112\301\271\024\352\124\331\146 -\233\174\211\175\004\232\142\311\351\122\074\236\234\357\322\365 -\046\344\346\345\030\174\213\156\337\154\314\170\133\117\162\262 -\313\134\077\214\005\215\321\114\214\255\222\307\341\170\177\145 -\154\111\006\120\054\236\062\302\327\112\306\165\212\131\116\165 -\157\107\136\301\002\003\001\000\001\243\020\060\016\060\014\006 -\003\125\035\023\004\005\060\003\001\001\377\060\015\006\011\052 -\206\110\206\367\015\001\001\005\005\000\003\202\001\001\000\025 -\365\125\377\067\226\200\131\041\244\374\241\025\114\040\366\324 -\137\332\003\044\374\317\220\032\364\041\012\232\356\072\261\152 -\357\357\370\140\321\114\066\146\105\035\363\146\002\164\004\173 -\222\060\250\336\012\166\017\357\225\156\275\311\067\346\032\015 -\254\211\110\133\314\203\066\302\365\106\134\131\202\126\264\325 -\376\043\264\330\124\034\104\253\304\247\345\024\316\074\101\141 -\174\103\346\315\304\201\011\213\044\373\124\045\326\026\250\226 -\014\147\007\157\263\120\107\343\034\044\050\335\052\230\244\141 -\376\333\352\022\067\274\001\032\064\205\275\156\117\347\221\162 -\007\104\205\036\130\312\124\104\335\367\254\271\313\211\041\162 -\333\217\300\151\051\227\052\243\256\030\043\227\034\101\052\213 -\174\052\301\174\220\350\251\050\300\323\221\306\255\050\207\100 -\150\265\377\354\247\322\323\070\030\234\323\175\151\135\360\306 -\245\036\044\033\243\107\374\151\007\150\347\344\232\264\355\017 -\241\207\207\002\316\207\322\110\116\341\274\377\313\361\162\222 -\104\144\003\045\352\336\133\156\237\311\362\116\254\335\307 -END - -# Trust for Certificate "TURKTRUST Certificate Services Provider Root 1" -# Issuer: O=(c) 2005 T..RKTRUST Bilgi ..leti..im ve Bili..im G..venli..i Hiz...,L=ANKARA,C=TR,CN=T..RKTRUST Elektronik Sertifika Hizmet Sa..lay..c..s.. -# Serial Number: 1 (0x1) -# Subject: O=(c) 2005 T..RKTRUST Bilgi ..leti..im ve Bili..im G..venli..i Hiz...,L=ANKARA,C=TR,CN=T..RKTRUST Elektronik Sertifika Hizmet Sa..lay..c..s.. -# Not Valid Before: Fri May 13 10:27:17 2005 -# Not Valid After : Sun Mar 22 10:27:17 2015 -# Fingerprint (MD5): F1:6A:22:18:C9:CD:DF:CE:82:1D:1D:B7:78:5C:A9:A5 -# Fingerprint (SHA1): 79:98:A3:08:E1:4D:65:85:E6:C2:1E:15:3A:71:9F:BA:5A:D3:4A:D9 -CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "TURKTRUST Certificate Services Provider Root 1" -CKA_CERT_SHA1_HASH MULTILINE_OCTAL -\171\230\243\010\341\115\145\205\346\302\036\025\072\161\237\272 -\132\323\112\331 -END -CKA_CERT_MD5_HASH MULTILINE_OCTAL -\361\152\042\030\311\315\337\316\202\035\035\267\170\134\251\245 -END -CKA_ISSUER MULTILINE_OCTAL -\060\201\267\061\077\060\075\006\003\125\004\003\014\066\124\303 -\234\122\113\124\122\125\123\124\040\105\154\145\153\164\162\157 -\156\151\153\040\123\145\162\164\151\146\151\153\141\040\110\151 -\172\155\145\164\040\123\141\304\237\154\141\171\304\261\143\304 -\261\163\304\261\061\013\060\011\006\003\125\004\006\014\002\124 -\122\061\017\060\015\006\003\125\004\007\014\006\101\116\113\101 -\122\101\061\126\060\124\006\003\125\004\012\014\115\050\143\051 -\040\062\060\060\065\040\124\303\234\122\113\124\122\125\123\124 -\040\102\151\154\147\151\040\304\260\154\145\164\151\305\237\151 -\155\040\166\145\040\102\151\154\151\305\237\151\155\040\107\303 -\274\166\145\156\154\151\304\237\151\040\110\151\172\155\145\164 -\154\145\162\151\040\101\056\305\236\056 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\001\001 -END -CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_TRUSTED_DELEGATOR -CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_TRUSTED_DELEGATOR -CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_TRUSTED_DELEGATOR -CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE - -# -# Certificate "TURKTRUST Certificate Services Provider Root 2" -# -# Issuer: O=T..RKTRUST Bilgi ..leti..im ve Bili..im G..venli..i Hizmetleri A...,L=Ankara,C=TR,CN=T..RKTRUST Elektronik Sertifika Hizmet Sa..lay..c..s.. -# Serial Number: 1 (0x1) -# Subject: O=T..RKTRUST Bilgi ..leti..im ve Bili..im G..venli..i Hizmetleri A...,L=Ankara,C=TR,CN=T..RKTRUST Elektronik Sertifika Hizmet Sa..lay..c..s.. -# Not Valid Before: Mon Nov 07 10:07:57 2005 -# Not Valid After : Wed Sep 16 10:07:57 2015 -# Fingerprint (MD5): 37:A5:6E:D4:B1:25:84:97:B7:FD:56:15:7A:F9:A2:00 -# Fingerprint (SHA1): B4:35:D4:E1:11:9D:1C:66:90:A7:49:EB:B3:94:BD:63:7B:A7:82:B7 -CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "TURKTRUST Certificate Services Provider Root 2" -CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509 -CKA_SUBJECT MULTILINE_OCTAL -\060\201\276\061\077\060\075\006\003\125\004\003\014\066\124\303 -\234\122\113\124\122\125\123\124\040\105\154\145\153\164\162\157 -\156\151\153\040\123\145\162\164\151\146\151\153\141\040\110\151 -\172\155\145\164\040\123\141\304\237\154\141\171\304\261\143\304 -\261\163\304\261\061\013\060\011\006\003\125\004\006\023\002\124 -\122\061\017\060\015\006\003\125\004\007\014\006\101\156\153\141 -\162\141\061\135\060\133\006\003\125\004\012\014\124\124\303\234 -\122\113\124\122\125\123\124\040\102\151\154\147\151\040\304\260 -\154\145\164\151\305\237\151\155\040\166\145\040\102\151\154\151 -\305\237\151\155\040\107\303\274\166\145\156\154\151\304\237\151 -\040\110\151\172\155\145\164\154\145\162\151\040\101\056\305\236 -\056\040\050\143\051\040\113\141\163\304\261\155\040\062\060\060 -\065 -END -CKA_ID UTF8 "0" -CKA_ISSUER MULTILINE_OCTAL -\060\201\276\061\077\060\075\006\003\125\004\003\014\066\124\303 -\234\122\113\124\122\125\123\124\040\105\154\145\153\164\162\157 -\156\151\153\040\123\145\162\164\151\146\151\153\141\040\110\151 -\172\155\145\164\040\123\141\304\237\154\141\171\304\261\143\304 -\261\163\304\261\061\013\060\011\006\003\125\004\006\023\002\124 -\122\061\017\060\015\006\003\125\004\007\014\006\101\156\153\141 -\162\141\061\135\060\133\006\003\125\004\012\014\124\124\303\234 -\122\113\124\122\125\123\124\040\102\151\154\147\151\040\304\260 -\154\145\164\151\305\237\151\155\040\166\145\040\102\151\154\151 -\305\237\151\155\040\107\303\274\166\145\156\154\151\304\237\151 -\040\110\151\172\155\145\164\154\145\162\151\040\101\056\305\236 -\056\040\050\143\051\040\113\141\163\304\261\155\040\062\060\060 -\065 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\001\001 -END -CKA_VALUE MULTILINE_OCTAL -\060\202\004\074\060\202\003\044\240\003\002\001\002\002\001\001 -\060\015\006\011\052\206\110\206\367\015\001\001\005\005\000\060 -\201\276\061\077\060\075\006\003\125\004\003\014\066\124\303\234 -\122\113\124\122\125\123\124\040\105\154\145\153\164\162\157\156 -\151\153\040\123\145\162\164\151\146\151\153\141\040\110\151\172 -\155\145\164\040\123\141\304\237\154\141\171\304\261\143\304\261 -\163\304\261\061\013\060\011\006\003\125\004\006\023\002\124\122 -\061\017\060\015\006\003\125\004\007\014\006\101\156\153\141\162 -\141\061\135\060\133\006\003\125\004\012\014\124\124\303\234\122 -\113\124\122\125\123\124\040\102\151\154\147\151\040\304\260\154 -\145\164\151\305\237\151\155\040\166\145\040\102\151\154\151\305 -\237\151\155\040\107\303\274\166\145\156\154\151\304\237\151\040 -\110\151\172\155\145\164\154\145\162\151\040\101\056\305\236\056 -\040\050\143\051\040\113\141\163\304\261\155\040\062\060\060\065 -\060\036\027\015\060\065\061\061\060\067\061\060\060\067\065\067 -\132\027\015\061\065\060\071\061\066\061\060\060\067\065\067\132 -\060\201\276\061\077\060\075\006\003\125\004\003\014\066\124\303 -\234\122\113\124\122\125\123\124\040\105\154\145\153\164\162\157 -\156\151\153\040\123\145\162\164\151\146\151\153\141\040\110\151 -\172\155\145\164\040\123\141\304\237\154\141\171\304\261\143\304 -\261\163\304\261\061\013\060\011\006\003\125\004\006\023\002\124 -\122\061\017\060\015\006\003\125\004\007\014\006\101\156\153\141 -\162\141\061\135\060\133\006\003\125\004\012\014\124\124\303\234 -\122\113\124\122\125\123\124\040\102\151\154\147\151\040\304\260 -\154\145\164\151\305\237\151\155\040\166\145\040\102\151\154\151 -\305\237\151\155\040\107\303\274\166\145\156\154\151\304\237\151 -\040\110\151\172\155\145\164\154\145\162\151\040\101\056\305\236 -\056\040\050\143\051\040\113\141\163\304\261\155\040\062\060\060 -\065\060\202\001\042\060\015\006\011\052\206\110\206\367\015\001 -\001\001\005\000\003\202\001\017\000\060\202\001\012\002\202\001 -\001\000\251\066\176\303\221\103\114\303\031\230\010\310\307\130 -\173\117\026\214\245\316\111\001\037\163\016\254\165\023\246\372 -\236\054\040\336\330\220\016\012\321\151\322\047\373\252\167\237 -\047\122\045\342\313\135\330\330\203\120\027\175\212\265\202\077 -\004\216\264\325\360\111\247\144\267\036\056\137\040\234\120\165 -\117\257\341\265\101\024\364\230\222\210\307\345\345\144\107\141 -\107\171\375\300\121\361\301\231\347\334\316\152\373\257\265\001 -\060\334\106\034\357\212\354\225\357\334\377\257\020\034\353\235 -\330\260\252\152\205\030\015\027\311\076\277\361\233\320\011\211 -\102\375\240\102\264\235\211\121\125\051\317\033\160\274\204\124 -\255\301\023\037\230\364\056\166\140\213\135\077\232\255\312\014 -\277\247\126\133\217\167\270\325\236\171\111\222\077\340\361\227 -\044\172\154\233\027\017\155\357\123\230\221\053\344\017\276\131 -\171\007\170\273\227\225\364\237\151\324\130\207\012\251\343\314 -\266\130\031\237\046\041\261\304\131\215\262\101\165\300\255\151 -\316\234\000\010\362\066\377\076\360\241\017\032\254\024\375\246 -\140\017\002\003\001\000\001\243\103\060\101\060\035\006\003\125 -\035\016\004\026\004\024\331\067\263\116\005\375\331\317\237\022 -\026\256\266\211\057\353\045\072\210\034\060\017\006\003\125\035 -\017\001\001\377\004\005\003\003\007\006\000\060\017\006\003\125 -\035\023\001\001\377\004\005\060\003\001\001\377\060\015\006\011 -\052\206\110\206\367\015\001\001\005\005\000\003\202\001\001\000 -\162\140\226\267\311\334\330\051\136\043\205\137\262\263\055\166 -\373\210\327\027\376\173\155\105\270\366\205\154\237\042\374\052 -\020\042\354\252\271\060\366\253\130\326\071\020\061\231\051\000 -\275\211\146\101\373\164\336\221\301\030\013\237\265\141\313\235 -\072\276\365\250\224\243\042\125\156\027\111\377\322\051\361\070 -\046\135\357\245\252\072\371\161\173\346\332\130\035\323\164\302 -\001\372\076\151\130\137\255\313\150\276\024\056\233\154\300\266 -\334\240\046\372\167\032\342\044\332\032\067\340\147\255\321\163 -\203\015\245\032\035\156\022\222\176\204\142\000\027\275\274\045 -\030\127\362\327\251\157\131\210\274\064\267\056\205\170\235\226 -\334\024\303\054\212\122\233\226\214\122\146\075\206\026\213\107 -\270\121\011\214\352\175\315\210\162\263\140\063\261\360\012\104 -\357\017\365\011\067\210\044\016\054\153\040\072\242\372\021\362 -\100\065\234\104\150\143\073\254\063\157\143\274\054\273\362\322 -\313\166\175\175\210\330\035\310\005\035\156\274\224\251\146\214 -\167\161\307\372\221\372\057\121\236\351\071\122\266\347\004\102 -END - -# Trust for Certificate "TURKTRUST Certificate Services Provider Root 2" -# Issuer: O=T..RKTRUST Bilgi ..leti..im ve Bili..im G..venli..i Hizmetleri A...,L=Ankara,C=TR,CN=T..RKTRUST Elektronik Sertifika Hizmet Sa..lay..c..s.. -# Serial Number: 1 (0x1) -# Subject: O=T..RKTRUST Bilgi ..leti..im ve Bili..im G..venli..i Hizmetleri A...,L=Ankara,C=TR,CN=T..RKTRUST Elektronik Sertifika Hizmet Sa..lay..c..s.. -# Not Valid Before: Mon Nov 07 10:07:57 2005 -# Not Valid After : Wed Sep 16 10:07:57 2015 -# Fingerprint (MD5): 37:A5:6E:D4:B1:25:84:97:B7:FD:56:15:7A:F9:A2:00 -# Fingerprint (SHA1): B4:35:D4:E1:11:9D:1C:66:90:A7:49:EB:B3:94:BD:63:7B:A7:82:B7 -CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "TURKTRUST Certificate Services Provider Root 2" -CKA_CERT_SHA1_HASH MULTILINE_OCTAL -\264\065\324\341\021\235\034\146\220\247\111\353\263\224\275\143 -\173\247\202\267 -END -CKA_CERT_MD5_HASH MULTILINE_OCTAL -\067\245\156\324\261\045\204\227\267\375\126\025\172\371\242\000 -END -CKA_ISSUER MULTILINE_OCTAL -\060\201\276\061\077\060\075\006\003\125\004\003\014\066\124\303 -\234\122\113\124\122\125\123\124\040\105\154\145\153\164\162\157 -\156\151\153\040\123\145\162\164\151\146\151\153\141\040\110\151 -\172\155\145\164\040\123\141\304\237\154\141\171\304\261\143\304 -\261\163\304\261\061\013\060\011\006\003\125\004\006\023\002\124 -\122\061\017\060\015\006\003\125\004\007\014\006\101\156\153\141 -\162\141\061\135\060\133\006\003\125\004\012\014\124\124\303\234 -\122\113\124\122\125\123\124\040\102\151\154\147\151\040\304\260 -\154\145\164\151\305\237\151\155\040\166\145\040\102\151\154\151 -\305\237\151\155\040\107\303\274\166\145\156\154\151\304\237\151 -\040\110\151\172\155\145\164\154\145\162\151\040\101\056\305\236 -\056\040\050\143\051\040\113\141\163\304\261\155\040\062\060\060 -\065 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\001\001 -END -CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_TRUSTED_DELEGATOR -CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_TRUSTED_DELEGATOR -CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_TRUSTED_DELEGATOR -CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE - # # Certificate "SwissSign Platinum CA - G2" # @@ -12868,30 +11814,30 @@ CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_TRUSTED_DELEGATOR CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE # -# Certificate "TC TrustCenter Class 2 CA II" +# Certificate "TC TrustCenter Class 3 CA II" # -# Issuer: CN=TC TrustCenter Class 2 CA II,OU=TC TrustCenter Class 2 CA,O=TC TrustCenter GmbH,C=DE -# Serial Number:2e:6a:00:01:00:02:1f:d7:52:21:2c:11:5c:3b -# Subject: CN=TC TrustCenter Class 2 CA II,OU=TC TrustCenter Class 2 CA,O=TC TrustCenter GmbH,C=DE -# Not Valid Before: Thu Jan 12 14:38:43 2006 +# Issuer: CN=TC TrustCenter Class 3 CA II,OU=TC TrustCenter Class 3 CA,O=TC TrustCenter GmbH,C=DE +# Serial Number:4a:47:00:01:00:02:e5:a0:5d:d6:3f:00:51:bf +# Subject: CN=TC TrustCenter Class 3 CA II,OU=TC TrustCenter Class 3 CA,O=TC TrustCenter GmbH,C=DE +# Not Valid Before: Thu Jan 12 14:41:57 2006 # Not Valid After : Wed Dec 31 22:59:59 2025 -# Fingerprint (MD5): CE:78:33:5C:59:78:01:6E:18:EA:B9:36:A0:B9:2E:23 -# Fingerprint (SHA1): AE:50:83:ED:7C:F4:5C:BC:8F:61:C6:21:FE:68:5D:79:42:21:15:6E +# Fingerprint (MD5): 56:5F:AA:80:61:12:17:F6:67:21:E6:2B:6D:61:56:8E +# Fingerprint (SHA1): 80:25:EF:F4:6E:70:C8:D4:72:24:65:84:FE:40:3B:8A:8D:6A:DB:F5 CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE CKA_TOKEN CK_BBOOL CK_TRUE CKA_PRIVATE CK_BBOOL CK_FALSE CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "TC TrustCenter Class 2 CA II" +CKA_LABEL UTF8 "TC TrustCenter Class 3 CA II" CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509 CKA_SUBJECT MULTILINE_OCTAL \060\166\061\013\060\011\006\003\125\004\006\023\002\104\105\061 \034\060\032\006\003\125\004\012\023\023\124\103\040\124\162\165 \163\164\103\145\156\164\145\162\040\107\155\142\110\061\042\060 \040\006\003\125\004\013\023\031\124\103\040\124\162\165\163\164 -\103\145\156\164\145\162\040\103\154\141\163\163\040\062\040\103 +\103\145\156\164\145\162\040\103\154\141\163\163\040\063\040\103 \101\061\045\060\043\006\003\125\004\003\023\034\124\103\040\124 \162\165\163\164\103\145\156\164\145\162\040\103\154\141\163\163 -\040\062\040\103\101\040\111\111 +\040\063\040\103\101\040\111\111 END CKA_ID UTF8 "0" CKA_ISSUER MULTILINE_OCTAL @@ -12899,223 +11845,67 @@ CKA_ISSUER MULTILINE_OCTAL \034\060\032\006\003\125\004\012\023\023\124\103\040\124\162\165 \163\164\103\145\156\164\145\162\040\107\155\142\110\061\042\060 \040\006\003\125\004\013\023\031\124\103\040\124\162\165\163\164 -\103\145\156\164\145\162\040\103\154\141\163\163\040\062\040\103 +\103\145\156\164\145\162\040\103\154\141\163\163\040\063\040\103 \101\061\045\060\043\006\003\125\004\003\023\034\124\103\040\124 \162\165\163\164\103\145\156\164\145\162\040\103\154\141\163\163 -\040\062\040\103\101\040\111\111 +\040\063\040\103\101\040\111\111 END CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\016\056\152\000\001\000\002\037\327\122\041\054\021\134\073 +\002\016\112\107\000\001\000\002\345\240\135\326\077\000\121\277 END CKA_VALUE MULTILINE_OCTAL -\060\202\004\252\060\202\003\222\240\003\002\001\002\002\016\056 -\152\000\001\000\002\037\327\122\041\054\021\134\073\060\015\006 +\060\202\004\252\060\202\003\222\240\003\002\001\002\002\016\112 +\107\000\001\000\002\345\240\135\326\077\000\121\277\060\015\006 \011\052\206\110\206\367\015\001\001\005\005\000\060\166\061\013 \060\011\006\003\125\004\006\023\002\104\105\061\034\060\032\006 \003\125\004\012\023\023\124\103\040\124\162\165\163\164\103\145 \156\164\145\162\040\107\155\142\110\061\042\060\040\006\003\125 \004\013\023\031\124\103\040\124\162\165\163\164\103\145\156\164 -\145\162\040\103\154\141\163\163\040\062\040\103\101\061\045\060 +\145\162\040\103\154\141\163\163\040\063\040\103\101\061\045\060 \043\006\003\125\004\003\023\034\124\103\040\124\162\165\163\164 -\103\145\156\164\145\162\040\103\154\141\163\163\040\062\040\103 +\103\145\156\164\145\162\040\103\154\141\163\163\040\063\040\103 \101\040\111\111\060\036\027\015\060\066\060\061\061\062\061\064 -\063\070\064\063\132\027\015\062\065\061\062\063\061\062\062\065 +\064\061\065\067\132\027\015\062\065\061\062\063\061\062\062\065 \071\065\071\132\060\166\061\013\060\011\006\003\125\004\006\023 \002\104\105\061\034\060\032\006\003\125\004\012\023\023\124\103 \040\124\162\165\163\164\103\145\156\164\145\162\040\107\155\142 \110\061\042\060\040\006\003\125\004\013\023\031\124\103\040\124 \162\165\163\164\103\145\156\164\145\162\040\103\154\141\163\163 -\040\062\040\103\101\061\045\060\043\006\003\125\004\003\023\034 +\040\063\040\103\101\061\045\060\043\006\003\125\004\003\023\034 \124\103\040\124\162\165\163\164\103\145\156\164\145\162\040\103 -\154\141\163\163\040\062\040\103\101\040\111\111\060\202\001\042 +\154\141\163\163\040\063\040\103\101\040\111\111\060\202\001\042 \060\015\006\011\052\206\110\206\367\015\001\001\001\005\000\003 -\202\001\017\000\060\202\001\012\002\202\001\001\000\253\200\207 -\233\216\360\303\174\207\327\350\044\202\021\263\074\335\103\142 -\356\370\303\105\332\350\341\240\137\321\052\262\352\223\150\337 -\264\310\326\103\351\304\165\131\177\374\341\035\370\061\160\043 -\033\210\236\047\271\173\375\072\322\311\251\351\024\057\220\276 -\003\122\301\111\315\366\375\344\010\146\013\127\212\242\102\240 -\270\325\177\151\134\220\062\262\227\015\312\112\334\106\076\002 -\125\211\123\343\032\132\313\066\306\007\126\367\214\317\021\364 -\114\273\060\160\004\225\245\366\071\214\375\163\201\010\175\211 -\136\062\036\042\251\042\105\113\260\146\056\060\314\237\145\375 -\374\313\201\251\361\340\073\257\243\206\321\211\352\304\105\171 -\120\135\256\351\041\164\222\115\213\131\202\217\224\343\351\112 -\361\347\111\260\024\343\365\142\313\325\162\275\037\271\322\237 -\240\315\250\372\001\310\331\015\337\332\374\107\235\263\310\124 -\337\111\112\361\041\251\376\030\116\356\110\324\031\273\357\175 -\344\342\235\313\133\266\156\377\343\315\132\347\164\202\005\272 -\200\045\070\313\344\151\236\257\101\252\032\204\365\002\003\001 +\202\001\017\000\060\202\001\012\002\202\001\001\000\264\340\273 +\121\273\071\134\213\004\305\114\171\034\043\206\061\020\143\103 +\125\047\077\306\105\307\244\075\354\011\015\032\036\040\302\126 +\036\336\033\067\007\060\042\057\157\361\006\361\253\255\326\310 +\253\141\243\057\103\304\260\262\055\374\303\226\151\173\176\212 +\344\314\300\071\022\220\102\140\311\314\065\150\356\332\137\220 +\126\137\315\034\115\133\130\111\353\016\001\117\144\372\054\074 +\211\130\330\057\056\342\260\150\351\042\073\165\211\326\104\032 +\145\362\033\227\046\035\050\155\254\350\275\131\035\053\044\366 +\326\204\003\146\210\044\000\170\140\361\370\253\376\002\262\153 +\373\042\373\065\346\026\321\255\366\056\022\344\372\065\152\345 +\031\271\135\333\073\036\032\373\323\377\025\024\010\330\011\152 +\272\105\235\024\171\140\175\257\100\212\007\163\263\223\226\323 +\164\064\215\072\067\051\336\134\354\365\356\056\061\302\040\334 +\276\361\117\177\043\122\331\133\342\144\331\234\252\007\010\265 +\105\275\321\320\061\301\253\124\237\251\322\303\142\140\003\361 +\273\071\112\222\112\075\012\271\235\305\240\376\067\002\003\001 \000\001\243\202\001\064\060\202\001\060\060\017\006\003\125\035 \023\001\001\377\004\005\060\003\001\001\377\060\016\006\003\125 \035\017\001\001\377\004\004\003\002\001\006\060\035\006\003\125 -\035\016\004\026\004\024\343\253\124\114\200\241\333\126\103\267 -\221\112\313\363\202\172\023\134\010\253\060\201\355\006\003\125 +\035\016\004\026\004\024\324\242\374\237\263\303\330\003\323\127 +\134\007\244\320\044\247\300\362\000\324\060\201\355\006\003\125 \035\037\004\201\345\060\201\342\060\201\337\240\201\334\240\201 \331\206\065\150\164\164\160\072\057\057\167\167\167\056\164\162 \165\163\164\143\145\156\164\145\162\056\144\145\057\143\162\154 -\057\166\062\057\164\143\137\143\154\141\163\163\137\062\137\143 +\057\166\062\057\164\143\137\143\154\141\163\163\137\063\137\143 \141\137\111\111\056\143\162\154\206\201\237\154\144\141\160\072 \057\057\167\167\167\056\164\162\165\163\164\143\145\156\164\145 \162\056\144\145\057\103\116\075\124\103\045\062\060\124\162\165 \163\164\103\145\156\164\145\162\045\062\060\103\154\141\163\163 -\045\062\060\062\045\062\060\103\101\045\062\060\111\111\054\117 -\075\124\103\045\062\060\124\162\165\163\164\103\145\156\164\145 -\162\045\062\060\107\155\142\110\054\117\125\075\162\157\157\164 -\143\145\162\164\163\054\104\103\075\164\162\165\163\164\143\145 -\156\164\145\162\054\104\103\075\144\145\077\143\145\162\164\151 -\146\151\143\141\164\145\122\145\166\157\143\141\164\151\157\156 -\114\151\163\164\077\142\141\163\145\077\060\015\006\011\052\206 -\110\206\367\015\001\001\005\005\000\003\202\001\001\000\214\327 -\337\176\356\033\200\020\263\203\365\333\021\352\153\113\250\222 -\030\331\367\007\071\365\054\276\006\165\172\150\123\025\034\352 -\112\355\136\374\043\262\023\240\323\011\377\366\366\056\153\101 -\161\171\315\342\155\375\256\131\153\205\035\270\116\042\232\355 -\146\071\156\113\224\346\125\374\013\033\213\167\301\123\023\146 -\211\331\050\326\213\363\105\112\143\267\375\173\013\141\135\270 -\155\276\303\334\133\171\322\355\206\345\242\115\276\136\164\174 -\152\355\026\070\037\177\130\201\132\032\353\062\210\055\262\363 -\071\167\200\257\136\266\141\165\051\333\043\115\210\312\120\050 -\313\205\322\323\020\242\131\156\323\223\124\000\172\242\106\225 -\206\005\234\251\031\230\345\061\162\014\000\342\147\331\100\340 -\044\063\173\157\054\271\134\253\145\235\054\254\166\352\065\231 -\365\227\271\017\044\354\307\166\041\050\145\256\127\350\007\210 -\165\112\126\240\322\005\072\244\346\215\222\210\054\363\362\341 -\301\306\141\333\101\305\307\233\367\016\032\121\105\302\141\153 -\334\144\047\027\214\132\267\332\164\050\315\227\344\275 -END - -# Trust for Certificate "TC TrustCenter Class 2 CA II" -# Issuer: CN=TC TrustCenter Class 2 CA II,OU=TC TrustCenter Class 2 CA,O=TC TrustCenter GmbH,C=DE -# Serial Number:2e:6a:00:01:00:02:1f:d7:52:21:2c:11:5c:3b -# Subject: CN=TC TrustCenter Class 2 CA II,OU=TC TrustCenter Class 2 CA,O=TC TrustCenter GmbH,C=DE -# Not Valid Before: Thu Jan 12 14:38:43 2006 -# Not Valid After : Wed Dec 31 22:59:59 2025 -# Fingerprint (MD5): CE:78:33:5C:59:78:01:6E:18:EA:B9:36:A0:B9:2E:23 -# Fingerprint (SHA1): AE:50:83:ED:7C:F4:5C:BC:8F:61:C6:21:FE:68:5D:79:42:21:15:6E -CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "TC TrustCenter Class 2 CA II" -CKA_CERT_SHA1_HASH MULTILINE_OCTAL -\256\120\203\355\174\364\134\274\217\141\306\041\376\150\135\171 -\102\041\025\156 -END -CKA_CERT_MD5_HASH MULTILINE_OCTAL -\316\170\063\134\131\170\001\156\030\352\271\066\240\271\056\043 -END -CKA_ISSUER MULTILINE_OCTAL -\060\166\061\013\060\011\006\003\125\004\006\023\002\104\105\061 -\034\060\032\006\003\125\004\012\023\023\124\103\040\124\162\165 -\163\164\103\145\156\164\145\162\040\107\155\142\110\061\042\060 -\040\006\003\125\004\013\023\031\124\103\040\124\162\165\163\164 -\103\145\156\164\145\162\040\103\154\141\163\163\040\062\040\103 -\101\061\045\060\043\006\003\125\004\003\023\034\124\103\040\124 -\162\165\163\164\103\145\156\164\145\162\040\103\154\141\163\163 -\040\062\040\103\101\040\111\111 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\016\056\152\000\001\000\002\037\327\122\041\054\021\134\073 -END -CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_TRUSTED_DELEGATOR -CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_TRUSTED_DELEGATOR -CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_TRUSTED_DELEGATOR -CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE - -# -# Certificate "TC TrustCenter Class 3 CA II" -# -# Issuer: CN=TC TrustCenter Class 3 CA II,OU=TC TrustCenter Class 3 CA,O=TC TrustCenter GmbH,C=DE -# Serial Number:4a:47:00:01:00:02:e5:a0:5d:d6:3f:00:51:bf -# Subject: CN=TC TrustCenter Class 3 CA II,OU=TC TrustCenter Class 3 CA,O=TC TrustCenter GmbH,C=DE -# Not Valid Before: Thu Jan 12 14:41:57 2006 -# Not Valid After : Wed Dec 31 22:59:59 2025 -# Fingerprint (MD5): 56:5F:AA:80:61:12:17:F6:67:21:E6:2B:6D:61:56:8E -# Fingerprint (SHA1): 80:25:EF:F4:6E:70:C8:D4:72:24:65:84:FE:40:3B:8A:8D:6A:DB:F5 -CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "TC TrustCenter Class 3 CA II" -CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509 -CKA_SUBJECT MULTILINE_OCTAL -\060\166\061\013\060\011\006\003\125\004\006\023\002\104\105\061 -\034\060\032\006\003\125\004\012\023\023\124\103\040\124\162\165 -\163\164\103\145\156\164\145\162\040\107\155\142\110\061\042\060 -\040\006\003\125\004\013\023\031\124\103\040\124\162\165\163\164 -\103\145\156\164\145\162\040\103\154\141\163\163\040\063\040\103 -\101\061\045\060\043\006\003\125\004\003\023\034\124\103\040\124 -\162\165\163\164\103\145\156\164\145\162\040\103\154\141\163\163 -\040\063\040\103\101\040\111\111 -END -CKA_ID UTF8 "0" -CKA_ISSUER MULTILINE_OCTAL -\060\166\061\013\060\011\006\003\125\004\006\023\002\104\105\061 -\034\060\032\006\003\125\004\012\023\023\124\103\040\124\162\165 -\163\164\103\145\156\164\145\162\040\107\155\142\110\061\042\060 -\040\006\003\125\004\013\023\031\124\103\040\124\162\165\163\164 -\103\145\156\164\145\162\040\103\154\141\163\163\040\063\040\103 -\101\061\045\060\043\006\003\125\004\003\023\034\124\103\040\124 -\162\165\163\164\103\145\156\164\145\162\040\103\154\141\163\163 -\040\063\040\103\101\040\111\111 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\016\112\107\000\001\000\002\345\240\135\326\077\000\121\277 -END -CKA_VALUE MULTILINE_OCTAL -\060\202\004\252\060\202\003\222\240\003\002\001\002\002\016\112 -\107\000\001\000\002\345\240\135\326\077\000\121\277\060\015\006 -\011\052\206\110\206\367\015\001\001\005\005\000\060\166\061\013 -\060\011\006\003\125\004\006\023\002\104\105\061\034\060\032\006 -\003\125\004\012\023\023\124\103\040\124\162\165\163\164\103\145 -\156\164\145\162\040\107\155\142\110\061\042\060\040\006\003\125 -\004\013\023\031\124\103\040\124\162\165\163\164\103\145\156\164 -\145\162\040\103\154\141\163\163\040\063\040\103\101\061\045\060 -\043\006\003\125\004\003\023\034\124\103\040\124\162\165\163\164 -\103\145\156\164\145\162\040\103\154\141\163\163\040\063\040\103 -\101\040\111\111\060\036\027\015\060\066\060\061\061\062\061\064 -\064\061\065\067\132\027\015\062\065\061\062\063\061\062\062\065 -\071\065\071\132\060\166\061\013\060\011\006\003\125\004\006\023 -\002\104\105\061\034\060\032\006\003\125\004\012\023\023\124\103 -\040\124\162\165\163\164\103\145\156\164\145\162\040\107\155\142 -\110\061\042\060\040\006\003\125\004\013\023\031\124\103\040\124 -\162\165\163\164\103\145\156\164\145\162\040\103\154\141\163\163 -\040\063\040\103\101\061\045\060\043\006\003\125\004\003\023\034 -\124\103\040\124\162\165\163\164\103\145\156\164\145\162\040\103 -\154\141\163\163\040\063\040\103\101\040\111\111\060\202\001\042 -\060\015\006\011\052\206\110\206\367\015\001\001\001\005\000\003 -\202\001\017\000\060\202\001\012\002\202\001\001\000\264\340\273 -\121\273\071\134\213\004\305\114\171\034\043\206\061\020\143\103 -\125\047\077\306\105\307\244\075\354\011\015\032\036\040\302\126 -\036\336\033\067\007\060\042\057\157\361\006\361\253\255\326\310 -\253\141\243\057\103\304\260\262\055\374\303\226\151\173\176\212 -\344\314\300\071\022\220\102\140\311\314\065\150\356\332\137\220 -\126\137\315\034\115\133\130\111\353\016\001\117\144\372\054\074 -\211\130\330\057\056\342\260\150\351\042\073\165\211\326\104\032 -\145\362\033\227\046\035\050\155\254\350\275\131\035\053\044\366 -\326\204\003\146\210\044\000\170\140\361\370\253\376\002\262\153 -\373\042\373\065\346\026\321\255\366\056\022\344\372\065\152\345 -\031\271\135\333\073\036\032\373\323\377\025\024\010\330\011\152 -\272\105\235\024\171\140\175\257\100\212\007\163\263\223\226\323 -\164\064\215\072\067\051\336\134\354\365\356\056\061\302\040\334 -\276\361\117\177\043\122\331\133\342\144\331\234\252\007\010\265 -\105\275\321\320\061\301\253\124\237\251\322\303\142\140\003\361 -\273\071\112\222\112\075\012\271\235\305\240\376\067\002\003\001 -\000\001\243\202\001\064\060\202\001\060\060\017\006\003\125\035 -\023\001\001\377\004\005\060\003\001\001\377\060\016\006\003\125 -\035\017\001\001\377\004\004\003\002\001\006\060\035\006\003\125 -\035\016\004\026\004\024\324\242\374\237\263\303\330\003\323\127 -\134\007\244\320\044\247\300\362\000\324\060\201\355\006\003\125 -\035\037\004\201\345\060\201\342\060\201\337\240\201\334\240\201 -\331\206\065\150\164\164\160\072\057\057\167\167\167\056\164\162 -\165\163\164\143\145\156\164\145\162\056\144\145\057\143\162\154 -\057\166\062\057\164\143\137\143\154\141\163\163\137\063\137\143 -\141\137\111\111\056\143\162\154\206\201\237\154\144\141\160\072 -\057\057\167\167\167\056\164\162\165\163\164\143\145\156\164\145 -\162\056\144\145\057\103\116\075\124\103\045\062\060\124\162\165 -\163\164\103\145\156\164\145\162\045\062\060\103\154\141\163\163 -\045\062\060\063\045\062\060\103\101\045\062\060\111\111\054\117 +\045\062\060\063\045\062\060\103\101\045\062\060\111\111\054\117 \075\124\103\045\062\060\124\162\165\163\164\103\145\156\164\145 \162\045\062\060\107\155\142\110\054\117\125\075\162\157\157\164 \143\145\162\164\163\054\104\103\075\164\162\165\163\164\143\145 @@ -13179,150 +11969,6 @@ CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_TRUSTED_DELEGATOR CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_MUST_VERIFY_TRUST CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE -# -# Certificate "TC TrustCenter Universal CA I" -# -# Issuer: CN=TC TrustCenter Universal CA I,OU=TC TrustCenter Universal CA,O=TC TrustCenter GmbH,C=DE -# Serial Number:1d:a2:00:01:00:02:ec:b7:60:80:78:8d:b6:06 -# Subject: CN=TC TrustCenter Universal CA I,OU=TC TrustCenter Universal CA,O=TC TrustCenter GmbH,C=DE -# Not Valid Before: Wed Mar 22 15:54:28 2006 -# Not Valid After : Wed Dec 31 22:59:59 2025 -# Fingerprint (MD5): 45:E1:A5:72:C5:A9:36:64:40:9E:F5:E4:58:84:67:8C -# Fingerprint (SHA1): 6B:2F:34:AD:89:58:BE:62:FD:B0:6B:5C:CE:BB:9D:D9:4F:4E:39:F3 -CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "TC TrustCenter Universal CA I" -CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509 -CKA_SUBJECT MULTILINE_OCTAL -\060\171\061\013\060\011\006\003\125\004\006\023\002\104\105\061 -\034\060\032\006\003\125\004\012\023\023\124\103\040\124\162\165 -\163\164\103\145\156\164\145\162\040\107\155\142\110\061\044\060 -\042\006\003\125\004\013\023\033\124\103\040\124\162\165\163\164 -\103\145\156\164\145\162\040\125\156\151\166\145\162\163\141\154 -\040\103\101\061\046\060\044\006\003\125\004\003\023\035\124\103 -\040\124\162\165\163\164\103\145\156\164\145\162\040\125\156\151 -\166\145\162\163\141\154\040\103\101\040\111 -END -CKA_ID UTF8 "0" -CKA_ISSUER MULTILINE_OCTAL -\060\171\061\013\060\011\006\003\125\004\006\023\002\104\105\061 -\034\060\032\006\003\125\004\012\023\023\124\103\040\124\162\165 -\163\164\103\145\156\164\145\162\040\107\155\142\110\061\044\060 -\042\006\003\125\004\013\023\033\124\103\040\124\162\165\163\164 -\103\145\156\164\145\162\040\125\156\151\166\145\162\163\141\154 -\040\103\101\061\046\060\044\006\003\125\004\003\023\035\124\103 -\040\124\162\165\163\164\103\145\156\164\145\162\040\125\156\151 -\166\145\162\163\141\154\040\103\101\040\111 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\016\035\242\000\001\000\002\354\267\140\200\170\215\266\006 -END -CKA_VALUE MULTILINE_OCTAL -\060\202\003\335\060\202\002\305\240\003\002\001\002\002\016\035 -\242\000\001\000\002\354\267\140\200\170\215\266\006\060\015\006 -\011\052\206\110\206\367\015\001\001\005\005\000\060\171\061\013 -\060\011\006\003\125\004\006\023\002\104\105\061\034\060\032\006 -\003\125\004\012\023\023\124\103\040\124\162\165\163\164\103\145 -\156\164\145\162\040\107\155\142\110\061\044\060\042\006\003\125 -\004\013\023\033\124\103\040\124\162\165\163\164\103\145\156\164 -\145\162\040\125\156\151\166\145\162\163\141\154\040\103\101\061 -\046\060\044\006\003\125\004\003\023\035\124\103\040\124\162\165 -\163\164\103\145\156\164\145\162\040\125\156\151\166\145\162\163 -\141\154\040\103\101\040\111\060\036\027\015\060\066\060\063\062 -\062\061\065\065\064\062\070\132\027\015\062\065\061\062\063\061 -\062\062\065\071\065\071\132\060\171\061\013\060\011\006\003\125 -\004\006\023\002\104\105\061\034\060\032\006\003\125\004\012\023 -\023\124\103\040\124\162\165\163\164\103\145\156\164\145\162\040 -\107\155\142\110\061\044\060\042\006\003\125\004\013\023\033\124 -\103\040\124\162\165\163\164\103\145\156\164\145\162\040\125\156 -\151\166\145\162\163\141\154\040\103\101\061\046\060\044\006\003 -\125\004\003\023\035\124\103\040\124\162\165\163\164\103\145\156 -\164\145\162\040\125\156\151\166\145\162\163\141\154\040\103\101 -\040\111\060\202\001\042\060\015\006\011\052\206\110\206\367\015 -\001\001\001\005\000\003\202\001\017\000\060\202\001\012\002\202 -\001\001\000\244\167\043\226\104\257\220\364\061\247\020\364\046 -\207\234\363\070\331\017\136\336\317\101\350\061\255\306\164\221 -\044\226\170\036\011\240\233\232\225\112\112\365\142\174\002\250 -\312\254\373\132\004\166\071\336\137\361\371\263\277\363\003\130 -\125\322\252\267\343\004\042\321\370\224\332\042\010\000\215\323 -\174\046\135\314\167\171\347\054\170\071\250\046\163\016\242\135 -\045\151\205\117\125\016\232\357\306\271\104\341\127\075\337\037 -\124\042\345\157\145\252\063\204\072\363\316\172\276\125\227\256 -\215\022\017\024\063\342\120\160\303\111\207\023\274\121\336\327 -\230\022\132\357\072\203\063\222\006\165\213\222\174\022\150\173 -\160\152\017\265\233\266\167\133\110\131\235\344\357\132\255\363 -\301\236\324\327\105\116\312\126\064\041\274\076\027\133\157\167 -\014\110\001\103\051\260\335\077\226\156\346\225\252\014\300\040 -\266\375\076\066\047\234\343\134\317\116\201\334\031\273\221\220 -\175\354\346\227\004\036\223\314\042\111\327\227\206\266\023\012 -\074\103\043\167\176\360\334\346\315\044\037\073\203\233\064\072 -\203\064\343\002\003\001\000\001\243\143\060\141\060\037\006\003 -\125\035\043\004\030\060\026\200\024\222\244\165\054\244\236\276 -\201\104\353\171\374\212\305\225\245\353\020\165\163\060\017\006 -\003\125\035\023\001\001\377\004\005\060\003\001\001\377\060\016 -\006\003\125\035\017\001\001\377\004\004\003\002\001\206\060\035 -\006\003\125\035\016\004\026\004\024\222\244\165\054\244\236\276 -\201\104\353\171\374\212\305\225\245\353\020\165\163\060\015\006 -\011\052\206\110\206\367\015\001\001\005\005\000\003\202\001\001 -\000\050\322\340\206\325\346\370\173\360\227\334\042\153\073\225 -\024\126\017\021\060\245\232\117\072\260\072\340\006\313\145\365 -\355\306\227\047\376\045\362\127\346\136\225\214\076\144\140\025 -\132\177\057\015\001\305\261\140\375\105\065\317\360\262\277\006 -\331\357\132\276\263\142\041\264\327\253\065\174\123\076\246\047 -\361\241\055\332\032\043\235\314\335\354\074\055\236\047\064\135 -\017\302\066\171\274\311\112\142\055\355\153\331\175\101\103\174 -\266\252\312\355\141\261\067\202\025\011\032\212\026\060\330\354 -\311\326\107\162\170\113\020\106\024\216\137\016\257\354\307\057 -\253\020\327\266\361\156\354\206\262\302\350\015\222\163\334\242 -\364\017\072\277\141\043\020\211\234\110\100\156\160\000\263\323 -\272\067\104\130\021\172\002\152\210\360\067\064\360\031\351\254 -\324\145\163\366\151\214\144\224\072\171\205\051\260\026\053\014 -\202\077\006\234\307\375\020\053\236\017\054\266\236\343\025\277 -\331\066\034\272\045\032\122\075\032\354\042\014\034\340\244\242 -\075\360\350\071\317\201\300\173\355\135\037\157\305\320\013\327 -\230 -END - -# Trust for Certificate "TC TrustCenter Universal CA I" -# Issuer: CN=TC TrustCenter Universal CA I,OU=TC TrustCenter Universal CA,O=TC TrustCenter GmbH,C=DE -# Serial Number:1d:a2:00:01:00:02:ec:b7:60:80:78:8d:b6:06 -# Subject: CN=TC TrustCenter Universal CA I,OU=TC TrustCenter Universal CA,O=TC TrustCenter GmbH,C=DE -# Not Valid Before: Wed Mar 22 15:54:28 2006 -# Not Valid After : Wed Dec 31 22:59:59 2025 -# Fingerprint (MD5): 45:E1:A5:72:C5:A9:36:64:40:9E:F5:E4:58:84:67:8C -# Fingerprint (SHA1): 6B:2F:34:AD:89:58:BE:62:FD:B0:6B:5C:CE:BB:9D:D9:4F:4E:39:F3 -CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "TC TrustCenter Universal CA I" -CKA_CERT_SHA1_HASH MULTILINE_OCTAL -\153\057\064\255\211\130\276\142\375\260\153\134\316\273\235\331 -\117\116\071\363 -END -CKA_CERT_MD5_HASH MULTILINE_OCTAL -\105\341\245\162\305\251\066\144\100\236\365\344\130\204\147\214 -END -CKA_ISSUER MULTILINE_OCTAL -\060\171\061\013\060\011\006\003\125\004\006\023\002\104\105\061 -\034\060\032\006\003\125\004\012\023\023\124\103\040\124\162\165 -\163\164\103\145\156\164\145\162\040\107\155\142\110\061\044\060 -\042\006\003\125\004\013\023\033\124\103\040\124\162\165\163\164 -\103\145\156\164\145\162\040\125\156\151\166\145\162\163\141\154 -\040\103\101\061\046\060\044\006\003\125\004\003\023\035\124\103 -\040\124\162\165\163\164\103\145\156\164\145\162\040\125\156\151 -\166\145\162\163\141\154\040\103\101\040\111 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\016\035\242\000\001\000\002\354\267\140\200\170\215\266\006 -END -CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_TRUSTED_DELEGATOR -CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_TRUSTED_DELEGATOR -CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_TRUSTED_DELEGATOR -CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE - # # Certificate "Deutsche Telekom Root CA 2" # @@ -13717,7 +12363,7 @@ CKA_SERIAL_NUMBER MULTILINE_OCTAL \002\021\000\307\050\107\011\263\270\154\105\214\035\372\044\365 \066\116\351 END -CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_TRUSTED_DELEGATOR +CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_MUST_VERIFY_TRUST CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_MUST_VERIFY_TRUST CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_TRUSTED_DELEGATOR CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE @@ -14341,132 +12987,6 @@ CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_MUST_VERIFY_TRUST CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_MUST_VERIFY_TRUST CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE -# -# Certificate "Buypass Class 3 CA 1" -# -# Issuer: CN=Buypass Class 3 CA 1,O=Buypass AS-983163327,C=NO -# Serial Number: 2 (0x2) -# Subject: CN=Buypass Class 3 CA 1,O=Buypass AS-983163327,C=NO -# Not Valid Before: Mon May 09 14:13:03 2005 -# Not Valid After : Sat May 09 14:13:03 2015 -# Fingerprint (MD5): DF:3C:73:59:81:E7:39:50:81:04:4C:34:A2:CB:B3:7B -# Fingerprint (SHA1): 61:57:3A:11:DF:0E:D8:7E:D5:92:65:22:EA:D0:56:D7:44:B3:23:71 -CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "Buypass Class 3 CA 1" -CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509 -CKA_SUBJECT MULTILINE_OCTAL -\060\113\061\013\060\011\006\003\125\004\006\023\002\116\117\061 -\035\060\033\006\003\125\004\012\014\024\102\165\171\160\141\163 -\163\040\101\123\055\071\070\063\061\066\063\063\062\067\061\035 -\060\033\006\003\125\004\003\014\024\102\165\171\160\141\163\163 -\040\103\154\141\163\163\040\063\040\103\101\040\061 -END -CKA_ID UTF8 "0" -CKA_ISSUER MULTILINE_OCTAL -\060\113\061\013\060\011\006\003\125\004\006\023\002\116\117\061 -\035\060\033\006\003\125\004\012\014\024\102\165\171\160\141\163 -\163\040\101\123\055\071\070\063\061\066\063\063\062\067\061\035 -\060\033\006\003\125\004\003\014\024\102\165\171\160\141\163\163 -\040\103\154\141\163\163\040\063\040\103\101\040\061 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\001\002 -END -CKA_VALUE MULTILINE_OCTAL -\060\202\003\123\060\202\002\073\240\003\002\001\002\002\001\002 -\060\015\006\011\052\206\110\206\367\015\001\001\005\005\000\060 -\113\061\013\060\011\006\003\125\004\006\023\002\116\117\061\035 -\060\033\006\003\125\004\012\014\024\102\165\171\160\141\163\163 -\040\101\123\055\071\070\063\061\066\063\063\062\067\061\035\060 -\033\006\003\125\004\003\014\024\102\165\171\160\141\163\163\040 -\103\154\141\163\163\040\063\040\103\101\040\061\060\036\027\015 -\060\065\060\065\060\071\061\064\061\063\060\063\132\027\015\061 -\065\060\065\060\071\061\064\061\063\060\063\132\060\113\061\013 -\060\011\006\003\125\004\006\023\002\116\117\061\035\060\033\006 -\003\125\004\012\014\024\102\165\171\160\141\163\163\040\101\123 -\055\071\070\063\061\066\063\063\062\067\061\035\060\033\006\003 -\125\004\003\014\024\102\165\171\160\141\163\163\040\103\154\141 -\163\163\040\063\040\103\101\040\061\060\202\001\042\060\015\006 -\011\052\206\110\206\367\015\001\001\001\005\000\003\202\001\017 -\000\060\202\001\012\002\202\001\001\000\244\216\327\164\331\051 -\144\336\137\037\207\200\221\352\116\071\346\031\306\104\013\200 -\325\013\257\123\007\213\022\275\346\147\360\002\261\211\366\140 -\212\304\133\260\102\321\300\041\250\313\341\233\357\144\121\266 -\247\317\025\365\164\200\150\004\220\240\130\242\346\164\246\123 -\123\125\110\143\077\222\126\335\044\116\216\370\272\053\377\363 -\064\212\236\050\327\064\237\254\057\326\017\361\244\057\275\122 -\262\111\205\155\071\065\360\104\060\223\106\044\363\266\347\123 -\373\274\141\257\251\243\024\373\302\027\027\204\154\340\174\210 -\370\311\034\127\054\360\075\176\224\274\045\223\204\350\232\000 -\232\105\005\102\127\200\364\116\316\331\256\071\366\310\123\020 -\014\145\072\107\173\140\302\326\372\221\311\306\161\154\275\221 -\207\074\221\206\111\253\363\017\240\154\046\166\136\034\254\233 -\161\345\215\274\233\041\036\234\326\070\176\044\200\025\061\202 -\226\261\111\323\142\067\133\210\014\012\142\064\376\247\110\176 -\231\261\060\213\220\067\225\034\250\037\245\054\215\364\125\310 -\333\335\131\012\302\255\170\240\364\213\002\003\001\000\001\243 -\102\060\100\060\017\006\003\125\035\023\001\001\377\004\005\060 -\003\001\001\377\060\035\006\003\125\035\016\004\026\004\024\070 -\024\346\310\360\251\244\003\364\116\076\042\243\133\362\326\340 -\255\100\164\060\016\006\003\125\035\017\001\001\377\004\004\003 -\002\001\006\060\015\006\011\052\206\110\206\367\015\001\001\005 -\005\000\003\202\001\001\000\001\147\243\214\311\045\075\023\143 -\135\026\157\354\241\076\011\134\221\025\052\052\331\200\041\117 -\005\334\273\245\211\253\023\063\052\236\070\267\214\157\002\162 -\143\307\163\167\036\011\006\272\073\050\173\244\107\311\141\153 -\010\010\040\374\212\005\212\037\274\272\306\302\376\317\156\354 -\023\063\161\147\056\151\372\251\054\077\146\300\022\131\115\013 -\124\002\222\204\273\333\022\357\203\160\160\170\310\123\372\337 -\306\306\377\334\210\057\007\300\111\235\062\127\140\323\362\366 -\231\051\137\347\252\001\314\254\063\250\034\012\273\221\304\003 -\240\157\266\064\371\206\323\263\166\124\230\364\112\201\263\123 -\235\115\100\354\345\167\023\105\257\133\252\037\330\057\114\202 -\173\376\052\304\130\273\117\374\236\375\003\145\032\052\016\303 -\245\040\026\224\153\171\246\242\022\264\273\032\244\043\172\137 -\360\256\204\044\344\363\053\373\212\044\243\047\230\145\332\060 -\165\166\374\031\221\350\333\353\233\077\062\277\100\227\007\046 -\272\314\363\224\205\112\172\047\223\317\220\102\324\270\133\026 -\246\347\313\100\003\335\171 -END - -# Trust for Certificate "Buypass Class 3 CA 1" -# Issuer: CN=Buypass Class 3 CA 1,O=Buypass AS-983163327,C=NO -# Serial Number: 2 (0x2) -# Subject: CN=Buypass Class 3 CA 1,O=Buypass AS-983163327,C=NO -# Not Valid Before: Mon May 09 14:13:03 2005 -# Not Valid After : Sat May 09 14:13:03 2015 -# Fingerprint (MD5): DF:3C:73:59:81:E7:39:50:81:04:4C:34:A2:CB:B3:7B -# Fingerprint (SHA1): 61:57:3A:11:DF:0E:D8:7E:D5:92:65:22:EA:D0:56:D7:44:B3:23:71 -CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "Buypass Class 3 CA 1" -CKA_CERT_SHA1_HASH MULTILINE_OCTAL -\141\127\072\021\337\016\330\176\325\222\145\042\352\320\126\327 -\104\263\043\161 -END -CKA_CERT_MD5_HASH MULTILINE_OCTAL -\337\074\163\131\201\347\071\120\201\004\114\064\242\313\263\173 -END -CKA_ISSUER MULTILINE_OCTAL -\060\113\061\013\060\011\006\003\125\004\006\023\002\116\117\061 -\035\060\033\006\003\125\004\012\014\024\102\165\171\160\141\163 -\163\040\101\123\055\071\070\063\061\066\063\063\062\067\061\035 -\060\033\006\003\125\004\003\014\024\102\165\171\160\141\163\163 -\040\103\154\141\163\163\040\063\040\103\101\040\061 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\001\002 -END -CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_TRUSTED_DELEGATOR -CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_MUST_VERIFY_TRUST -CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_MUST_VERIFY_TRUST -CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE - # # Certificate "EBG Elektronik Sertifika Hizmet Saglayicisi" # @@ -17468,184 +15988,40 @@ CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_TRUSTED_DELEGATOR CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE # -# Certificate "TC TrustCenter Universal CA III" +# Certificate "Autoridad de Certificacion Firmaprofesional CIF A62634068" # -# Issuer: CN=TC TrustCenter Universal CA III,OU=TC TrustCenter Universal CA,O=TC TrustCenter GmbH,C=DE -# Serial Number:63:25:00:01:00:02:14:8d:33:15:02:e4:6c:f4 -# Subject: CN=TC TrustCenter Universal CA III,OU=TC TrustCenter Universal CA,O=TC TrustCenter GmbH,C=DE -# Not Valid Before: Wed Sep 09 08:15:27 2009 -# Not Valid After : Mon Dec 31 23:59:59 2029 -# Fingerprint (MD5): 9F:DD:DB:AB:FF:8E:FF:45:21:5F:F0:6C:9D:8F:FE:2B -# Fingerprint (SHA1): 96:56:CD:7B:57:96:98:95:D0:E1:41:46:68:06:FB:B8:C6:11:06:87 +# Issuer: CN=Autoridad de Certificacion Firmaprofesional CIF A62634068,C=ES +# Serial Number:53:ec:3b:ee:fb:b2:48:5f +# Subject: CN=Autoridad de Certificacion Firmaprofesional CIF A62634068,C=ES +# Not Valid Before: Wed May 20 08:38:15 2009 +# Not Valid After : Tue Dec 31 08:38:15 2030 +# Fingerprint (MD5): 73:3A:74:7A:EC:BB:A3:96:A6:C2:E4:E2:C8:9B:C0:C3 +# Fingerprint (SHA1): AE:C5:FB:3F:C8:E1:BF:C4:E5:4F:03:07:5A:9A:E8:00:B7:F7:B6:FA CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE CKA_TOKEN CK_BBOOL CK_TRUE CKA_PRIVATE CK_BBOOL CK_FALSE CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "TC TrustCenter Universal CA III" +CKA_LABEL UTF8 "Autoridad de Certificacion Firmaprofesional CIF A62634068" CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509 CKA_SUBJECT MULTILINE_OCTAL -\060\173\061\013\060\011\006\003\125\004\006\023\002\104\105\061 -\034\060\032\006\003\125\004\012\023\023\124\103\040\124\162\165 -\163\164\103\145\156\164\145\162\040\107\155\142\110\061\044\060 -\042\006\003\125\004\013\023\033\124\103\040\124\162\165\163\164 -\103\145\156\164\145\162\040\125\156\151\166\145\162\163\141\154 -\040\103\101\061\050\060\046\006\003\125\004\003\023\037\124\103 -\040\124\162\165\163\164\103\145\156\164\145\162\040\125\156\151 -\166\145\162\163\141\154\040\103\101\040\111\111\111 +\060\121\061\013\060\011\006\003\125\004\006\023\002\105\123\061 +\102\060\100\006\003\125\004\003\014\071\101\165\164\157\162\151 +\144\141\144\040\144\145\040\103\145\162\164\151\146\151\143\141 +\143\151\157\156\040\106\151\162\155\141\160\162\157\146\145\163 +\151\157\156\141\154\040\103\111\106\040\101\066\062\066\063\064 +\060\066\070 END CKA_ID UTF8 "0" CKA_ISSUER MULTILINE_OCTAL -\060\173\061\013\060\011\006\003\125\004\006\023\002\104\105\061 -\034\060\032\006\003\125\004\012\023\023\124\103\040\124\162\165 -\163\164\103\145\156\164\145\162\040\107\155\142\110\061\044\060 -\042\006\003\125\004\013\023\033\124\103\040\124\162\165\163\164 -\103\145\156\164\145\162\040\125\156\151\166\145\162\163\141\154 -\040\103\101\061\050\060\046\006\003\125\004\003\023\037\124\103 -\040\124\162\165\163\164\103\145\156\164\145\162\040\125\156\151 -\166\145\162\163\141\154\040\103\101\040\111\111\111 +\060\121\061\013\060\011\006\003\125\004\006\023\002\105\123\061 +\102\060\100\006\003\125\004\003\014\071\101\165\164\157\162\151 +\144\141\144\040\144\145\040\103\145\162\164\151\146\151\143\141 +\143\151\157\156\040\106\151\162\155\141\160\162\157\146\145\163 +\151\157\156\141\154\040\103\111\106\040\101\066\062\066\063\064 +\060\066\070 END CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\016\143\045\000\001\000\002\024\215\063\025\002\344\154\364 -END -CKA_VALUE MULTILINE_OCTAL -\060\202\003\341\060\202\002\311\240\003\002\001\002\002\016\143 -\045\000\001\000\002\024\215\063\025\002\344\154\364\060\015\006 -\011\052\206\110\206\367\015\001\001\005\005\000\060\173\061\013 -\060\011\006\003\125\004\006\023\002\104\105\061\034\060\032\006 -\003\125\004\012\023\023\124\103\040\124\162\165\163\164\103\145 -\156\164\145\162\040\107\155\142\110\061\044\060\042\006\003\125 -\004\013\023\033\124\103\040\124\162\165\163\164\103\145\156\164 -\145\162\040\125\156\151\166\145\162\163\141\154\040\103\101\061 -\050\060\046\006\003\125\004\003\023\037\124\103\040\124\162\165 -\163\164\103\145\156\164\145\162\040\125\156\151\166\145\162\163 -\141\154\040\103\101\040\111\111\111\060\036\027\015\060\071\060 -\071\060\071\060\070\061\065\062\067\132\027\015\062\071\061\062 -\063\061\062\063\065\071\065\071\132\060\173\061\013\060\011\006 -\003\125\004\006\023\002\104\105\061\034\060\032\006\003\125\004 -\012\023\023\124\103\040\124\162\165\163\164\103\145\156\164\145 -\162\040\107\155\142\110\061\044\060\042\006\003\125\004\013\023 -\033\124\103\040\124\162\165\163\164\103\145\156\164\145\162\040 -\125\156\151\166\145\162\163\141\154\040\103\101\061\050\060\046 -\006\003\125\004\003\023\037\124\103\040\124\162\165\163\164\103 -\145\156\164\145\162\040\125\156\151\166\145\162\163\141\154\040 -\103\101\040\111\111\111\060\202\001\042\060\015\006\011\052\206 -\110\206\367\015\001\001\001\005\000\003\202\001\017\000\060\202 -\001\012\002\202\001\001\000\302\332\234\142\260\271\161\022\260 -\013\310\032\127\262\256\203\024\231\263\064\113\233\220\242\305 -\347\347\057\002\240\115\055\244\372\205\332\233\045\205\055\100 -\050\040\155\352\340\275\261\110\203\042\051\104\237\116\203\356 -\065\121\023\163\164\325\274\362\060\146\224\123\300\100\066\057 -\014\204\145\316\017\156\302\130\223\350\054\013\072\351\301\216 -\373\362\153\312\074\342\234\116\216\344\371\175\323\047\237\033 -\325\147\170\207\055\177\013\107\263\307\350\311\110\174\257\057 -\314\012\331\101\357\237\376\232\341\262\256\371\123\265\345\351 -\106\237\140\343\337\215\323\177\373\226\176\263\265\162\370\113 -\255\010\171\315\151\211\100\047\365\052\301\255\103\354\244\123 -\310\141\266\367\322\171\052\147\030\166\110\155\133\045\001\321 -\046\305\267\127\151\043\025\133\141\212\255\360\033\055\331\257 -\134\361\046\220\151\251\325\014\100\365\063\200\103\217\234\243 -\166\052\105\264\257\277\177\076\207\077\166\305\315\052\336\040 -\305\026\130\313\371\033\365\017\313\015\021\122\144\270\322\166 -\142\167\203\361\130\237\377\002\003\001\000\001\243\143\060\141 -\060\037\006\003\125\035\043\004\030\060\026\200\024\126\347\341 -\133\045\103\200\340\366\214\341\161\274\216\345\200\057\304\110 -\342\060\017\006\003\125\035\023\001\001\377\004\005\060\003\001 -\001\377\060\016\006\003\125\035\017\001\001\377\004\004\003\002 -\001\006\060\035\006\003\125\035\016\004\026\004\024\126\347\341 -\133\045\103\200\340\366\214\341\161\274\216\345\200\057\304\110 -\342\060\015\006\011\052\206\110\206\367\015\001\001\005\005\000 -\003\202\001\001\000\203\307\257\352\177\115\012\074\071\261\150 -\276\173\155\211\056\351\263\011\347\030\127\215\205\232\027\363 -\166\102\120\023\017\307\220\157\063\255\305\111\140\053\154\111 -\130\031\324\342\276\267\277\253\111\274\224\310\253\276\050\154 -\026\150\340\310\227\106\040\240\150\147\140\210\071\040\121\330 -\150\001\021\316\247\366\021\007\366\354\354\254\032\037\262\146 -\156\126\147\140\172\164\136\300\155\227\066\256\265\015\135\146 -\163\300\045\062\105\330\112\006\007\217\304\267\007\261\115\006 -\015\341\245\353\364\165\312\272\234\320\275\263\323\062\044\114 -\356\176\342\166\004\113\111\123\330\362\351\124\063\374\345\161 -\037\075\024\134\226\113\361\072\362\000\273\154\264\372\226\125 -\010\210\011\301\314\221\031\051\260\040\055\377\313\070\244\100 -\341\027\276\171\141\200\377\007\003\206\114\116\173\006\237\021 -\206\215\211\356\047\304\333\342\274\031\216\013\303\303\023\307 -\055\003\143\073\323\350\344\242\052\302\202\010\224\026\124\360 -\357\037\047\220\045\270\015\016\050\033\107\167\107\275\034\250 -\045\361\224\264\146 -END - -# Trust for Certificate "TC TrustCenter Universal CA III" -# Issuer: CN=TC TrustCenter Universal CA III,OU=TC TrustCenter Universal CA,O=TC TrustCenter GmbH,C=DE -# Serial Number:63:25:00:01:00:02:14:8d:33:15:02:e4:6c:f4 -# Subject: CN=TC TrustCenter Universal CA III,OU=TC TrustCenter Universal CA,O=TC TrustCenter GmbH,C=DE -# Not Valid Before: Wed Sep 09 08:15:27 2009 -# Not Valid After : Mon Dec 31 23:59:59 2029 -# Fingerprint (MD5): 9F:DD:DB:AB:FF:8E:FF:45:21:5F:F0:6C:9D:8F:FE:2B -# Fingerprint (SHA1): 96:56:CD:7B:57:96:98:95:D0:E1:41:46:68:06:FB:B8:C6:11:06:87 -CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "TC TrustCenter Universal CA III" -CKA_CERT_SHA1_HASH MULTILINE_OCTAL -\226\126\315\173\127\226\230\225\320\341\101\106\150\006\373\270 -\306\021\006\207 -END -CKA_CERT_MD5_HASH MULTILINE_OCTAL -\237\335\333\253\377\216\377\105\041\137\360\154\235\217\376\053 -END -CKA_ISSUER MULTILINE_OCTAL -\060\173\061\013\060\011\006\003\125\004\006\023\002\104\105\061 -\034\060\032\006\003\125\004\012\023\023\124\103\040\124\162\165 -\163\164\103\145\156\164\145\162\040\107\155\142\110\061\044\060 -\042\006\003\125\004\013\023\033\124\103\040\124\162\165\163\164 -\103\145\156\164\145\162\040\125\156\151\166\145\162\163\141\154 -\040\103\101\061\050\060\046\006\003\125\004\003\023\037\124\103 -\040\124\162\165\163\164\103\145\156\164\145\162\040\125\156\151 -\166\145\162\163\141\154\040\103\101\040\111\111\111 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\016\143\045\000\001\000\002\024\215\063\025\002\344\154\364 -END -CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_MUST_VERIFY_TRUST -CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_MUST_VERIFY_TRUST -CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_MUST_VERIFY_TRUST -CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE - -# -# Certificate "Autoridad de Certificacion Firmaprofesional CIF A62634068" -# -# Issuer: CN=Autoridad de Certificacion Firmaprofesional CIF A62634068,C=ES -# Serial Number:53:ec:3b:ee:fb:b2:48:5f -# Subject: CN=Autoridad de Certificacion Firmaprofesional CIF A62634068,C=ES -# Not Valid Before: Wed May 20 08:38:15 2009 -# Not Valid After : Tue Dec 31 08:38:15 2030 -# Fingerprint (MD5): 73:3A:74:7A:EC:BB:A3:96:A6:C2:E4:E2:C8:9B:C0:C3 -# Fingerprint (SHA1): AE:C5:FB:3F:C8:E1:BF:C4:E5:4F:03:07:5A:9A:E8:00:B7:F7:B6:FA -CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "Autoridad de Certificacion Firmaprofesional CIF A62634068" -CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509 -CKA_SUBJECT MULTILINE_OCTAL -\060\121\061\013\060\011\006\003\125\004\006\023\002\105\123\061 -\102\060\100\006\003\125\004\003\014\071\101\165\164\157\162\151 -\144\141\144\040\144\145\040\103\145\162\164\151\146\151\143\141 -\143\151\157\156\040\106\151\162\155\141\160\162\157\146\145\163 -\151\157\156\141\154\040\103\111\106\040\101\066\062\066\063\064 -\060\066\070 -END -CKA_ID UTF8 "0" -CKA_ISSUER MULTILINE_OCTAL -\060\121\061\013\060\011\006\003\125\004\006\023\002\105\123\061 -\102\060\100\006\003\125\004\003\014\071\101\165\164\157\162\151 -\144\141\144\040\144\145\040\103\145\162\164\151\146\151\143\141 -\143\151\157\156\040\106\151\162\155\141\160\162\157\146\145\163 -\151\157\156\141\154\040\103\111\106\040\101\066\062\066\063\064 -\060\066\070 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\010\123\354\073\356\373\262\110\137 +\002\010\123\354\073\356\373\262\110\137 END CKA_VALUE MULTILINE_OCTAL \060\202\006\024\060\202\003\374\240\003\002\001\002\002\010\123 @@ -21538,152 +19914,6 @@ CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_TRUSTED_DELEGATOR CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_TRUSTED_DELEGATOR CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE -# -# Certificate "A-Trust-nQual-03" -# -# Issuer: CN=A-Trust-nQual-03,OU=A-Trust-nQual-03,O=A-Trust Ges. f. Sicherheitssysteme im elektr. Datenverkehr GmbH,C=AT -# Serial Number: 93214 (0x16c1e) -# Subject: CN=A-Trust-nQual-03,OU=A-Trust-nQual-03,O=A-Trust Ges. f. Sicherheitssysteme im elektr. Datenverkehr GmbH,C=AT -# Not Valid Before: Wed Aug 17 22:00:00 2005 -# Not Valid After : Mon Aug 17 22:00:00 2015 -# Fingerprint (MD5): 49:63:AE:27:F4:D5:95:3D:D8:DB:24:86:B8:9C:07:53 -# Fingerprint (SHA1): D3:C0:63:F2:19:ED:07:3E:34:AD:5D:75:0B:32:76:29:FF:D5:9A:F2 -CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "A-Trust-nQual-03" -CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509 -CKA_SUBJECT MULTILINE_OCTAL -\060\201\215\061\013\060\011\006\003\125\004\006\023\002\101\124 -\061\110\060\106\006\003\125\004\012\014\077\101\055\124\162\165 -\163\164\040\107\145\163\056\040\146\056\040\123\151\143\150\145 -\162\150\145\151\164\163\163\171\163\164\145\155\145\040\151\155 -\040\145\154\145\153\164\162\056\040\104\141\164\145\156\166\145 -\162\153\145\150\162\040\107\155\142\110\061\031\060\027\006\003 -\125\004\013\014\020\101\055\124\162\165\163\164\055\156\121\165 -\141\154\055\060\063\061\031\060\027\006\003\125\004\003\014\020 -\101\055\124\162\165\163\164\055\156\121\165\141\154\055\060\063 -END -CKA_ID UTF8 "0" -CKA_ISSUER MULTILINE_OCTAL -\060\201\215\061\013\060\011\006\003\125\004\006\023\002\101\124 -\061\110\060\106\006\003\125\004\012\014\077\101\055\124\162\165 -\163\164\040\107\145\163\056\040\146\056\040\123\151\143\150\145 -\162\150\145\151\164\163\163\171\163\164\145\155\145\040\151\155 -\040\145\154\145\153\164\162\056\040\104\141\164\145\156\166\145 -\162\153\145\150\162\040\107\155\142\110\061\031\060\027\006\003 -\125\004\013\014\020\101\055\124\162\165\163\164\055\156\121\165 -\141\154\055\060\063\061\031\060\027\006\003\125\004\003\014\020 -\101\055\124\162\165\163\164\055\156\121\165\141\154\055\060\063 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\003\001\154\036 -END -CKA_VALUE MULTILINE_OCTAL -\060\202\003\317\060\202\002\267\240\003\002\001\002\002\003\001 -\154\036\060\015\006\011\052\206\110\206\367\015\001\001\005\005 -\000\060\201\215\061\013\060\011\006\003\125\004\006\023\002\101 -\124\061\110\060\106\006\003\125\004\012\014\077\101\055\124\162 -\165\163\164\040\107\145\163\056\040\146\056\040\123\151\143\150 -\145\162\150\145\151\164\163\163\171\163\164\145\155\145\040\151 -\155\040\145\154\145\153\164\162\056\040\104\141\164\145\156\166 -\145\162\153\145\150\162\040\107\155\142\110\061\031\060\027\006 -\003\125\004\013\014\020\101\055\124\162\165\163\164\055\156\121 -\165\141\154\055\060\063\061\031\060\027\006\003\125\004\003\014 -\020\101\055\124\162\165\163\164\055\156\121\165\141\154\055\060 -\063\060\036\027\015\060\065\060\070\061\067\062\062\060\060\060 -\060\132\027\015\061\065\060\070\061\067\062\062\060\060\060\060 -\132\060\201\215\061\013\060\011\006\003\125\004\006\023\002\101 -\124\061\110\060\106\006\003\125\004\012\014\077\101\055\124\162 -\165\163\164\040\107\145\163\056\040\146\056\040\123\151\143\150 -\145\162\150\145\151\164\163\163\171\163\164\145\155\145\040\151 -\155\040\145\154\145\153\164\162\056\040\104\141\164\145\156\166 -\145\162\153\145\150\162\040\107\155\142\110\061\031\060\027\006 -\003\125\004\013\014\020\101\055\124\162\165\163\164\055\156\121 -\165\141\154\055\060\063\061\031\060\027\006\003\125\004\003\014 -\020\101\055\124\162\165\163\164\055\156\121\165\141\154\055\060 -\063\060\202\001\042\060\015\006\011\052\206\110\206\367\015\001 -\001\001\005\000\003\202\001\017\000\060\202\001\012\002\202\001 -\001\000\255\075\141\156\003\363\220\073\300\101\013\204\200\315 -\354\052\243\235\153\273\156\302\102\204\367\121\024\341\240\250 -\055\121\243\121\362\336\043\360\064\104\377\224\353\314\005\043 -\225\100\271\007\170\245\045\366\012\275\105\206\350\331\275\300 -\004\216\205\104\141\357\177\247\311\372\301\045\314\205\054\143 -\077\005\140\163\111\005\340\140\170\225\020\113\334\371\021\131 -\316\161\177\100\233\212\252\044\337\013\102\342\333\126\274\112 -\322\245\014\233\267\103\076\335\203\323\046\020\002\317\352\043 -\304\111\116\345\323\351\264\210\253\014\256\142\222\324\145\207 -\331\152\327\364\205\237\344\063\042\045\245\345\310\063\272\303 -\307\101\334\137\306\152\314\000\016\155\062\250\266\207\066\000 -\142\167\233\036\037\064\313\220\074\170\210\164\005\353\171\365 -\223\161\145\312\235\307\153\030\055\075\134\116\347\325\370\077 -\061\175\217\207\354\012\042\057\043\351\376\273\175\311\340\364 -\354\353\174\304\260\303\055\142\265\232\161\326\261\152\350\354 -\331\355\325\162\354\276\127\001\316\005\125\237\336\321\140\210 -\020\263\002\003\001\000\001\243\066\060\064\060\017\006\003\125 -\035\023\001\001\377\004\005\060\003\001\001\377\060\021\006\003 -\125\035\016\004\012\004\010\104\152\225\147\125\171\021\117\060 -\016\006\003\125\035\017\001\001\377\004\004\003\002\001\006\060 -\015\006\011\052\206\110\206\367\015\001\001\005\005\000\003\202 -\001\001\000\125\324\124\321\131\110\134\263\223\205\252\277\143 -\057\344\200\316\064\243\064\142\076\366\330\356\147\210\061\004 -\003\157\013\324\007\373\116\165\017\323\056\323\300\027\307\306 -\050\354\006\015\021\044\016\016\245\135\277\214\262\023\226\161 -\334\324\316\016\015\012\150\062\154\271\101\061\031\253\261\007 -\173\115\230\323\134\260\321\360\247\102\240\265\304\216\257\376 -\361\077\364\357\117\106\000\166\353\002\373\371\235\322\100\226 -\307\210\072\270\237\021\171\363\200\145\250\275\037\323\170\201 -\240\121\114\067\264\246\135\045\160\321\146\311\150\371\056\021 -\024\150\361\124\230\010\254\046\222\017\336\211\236\324\372\263 -\171\053\322\243\171\324\354\213\254\207\123\150\102\114\121\121 -\164\036\033\047\056\343\365\037\051\164\115\355\257\367\341\222 -\231\201\350\276\072\307\027\120\366\267\306\374\233\260\212\153 -\326\210\003\221\217\006\167\072\205\002\335\230\325\103\170\077 -\306\060\025\254\233\153\313\127\267\211\121\213\072\350\311\204 -\014\333\261\120\040\012\032\112\272\152\032\275\354\033\310\305 -\204\232\315 -END - -# Trust for Certificate "A-Trust-nQual-03" -# Issuer: CN=A-Trust-nQual-03,OU=A-Trust-nQual-03,O=A-Trust Ges. f. Sicherheitssysteme im elektr. Datenverkehr GmbH,C=AT -# Serial Number: 93214 (0x16c1e) -# Subject: CN=A-Trust-nQual-03,OU=A-Trust-nQual-03,O=A-Trust Ges. f. Sicherheitssysteme im elektr. Datenverkehr GmbH,C=AT -# Not Valid Before: Wed Aug 17 22:00:00 2005 -# Not Valid After : Mon Aug 17 22:00:00 2015 -# Fingerprint (MD5): 49:63:AE:27:F4:D5:95:3D:D8:DB:24:86:B8:9C:07:53 -# Fingerprint (SHA1): D3:C0:63:F2:19:ED:07:3E:34:AD:5D:75:0B:32:76:29:FF:D5:9A:F2 -CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "A-Trust-nQual-03" -CKA_CERT_SHA1_HASH MULTILINE_OCTAL -\323\300\143\362\031\355\007\076\064\255\135\165\013\062\166\051 -\377\325\232\362 -END -CKA_CERT_MD5_HASH MULTILINE_OCTAL -\111\143\256\047\364\325\225\075\330\333\044\206\270\234\007\123 -END -CKA_ISSUER MULTILINE_OCTAL -\060\201\215\061\013\060\011\006\003\125\004\006\023\002\101\124 -\061\110\060\106\006\003\125\004\012\014\077\101\055\124\162\165 -\163\164\040\107\145\163\056\040\146\056\040\123\151\143\150\145 -\162\150\145\151\164\163\163\171\163\164\145\155\145\040\151\155 -\040\145\154\145\153\164\162\056\040\104\141\164\145\156\166\145 -\162\153\145\150\162\040\107\155\142\110\061\031\060\027\006\003 -\125\004\013\014\020\101\055\124\162\165\163\164\055\156\121\165 -\141\154\055\060\063\061\031\060\027\006\003\125\004\003\014\020 -\101\055\124\162\165\163\164\055\156\121\165\141\154\055\060\063 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\003\001\154\036 -END -CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_TRUSTED_DELEGATOR -CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_MUST_VERIFY_TRUST -CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_MUST_VERIFY_TRUST -CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE - # # Certificate "TWCA Root Certification Authority" # @@ -26489,182 +24719,6 @@ CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_TRUSTED_DELEGATOR CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_TRUSTED_DELEGATOR CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE -# -# Certificate "SG TRUST SERVICES RACINE" -# -# Issuer: C=FR,O=SG TRUST SERVICES,OU=0002 43525289500022,CN=SG TRUST SERVICES RACINE -# Serial Number:3e:d5:51:19:e6:4d:ce:7e -# Subject: C=FR,O=SG TRUST SERVICES,OU=0002 43525289500022,CN=SG TRUST SERVICES RACINE -# Not Valid Before: Mon Sep 06 12:53:42 2010 -# Not Valid After : Thu Sep 05 12:53:42 2030 -# Fingerprint (MD5): 25:EF:CF:48:4A:84:B7:30:9F:60:D3:1D:56:91:2F:E1 -# Fingerprint (SHA1): 0C:62:8F:5C:55:70:B1:C9:57:FA:FD:38:3F:B0:3D:7B:7D:D7:B9:C6 -CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "SG TRUST SERVICES RACINE" -CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509 -CKA_SUBJECT MULTILINE_OCTAL -\060\152\061\041\060\037\006\003\125\004\003\023\030\123\107\040 -\124\122\125\123\124\040\123\105\122\126\111\103\105\123\040\122 -\101\103\111\116\105\061\034\060\032\006\003\125\004\013\023\023 -\060\060\060\062\040\064\063\065\062\065\062\070\071\065\060\060 -\060\062\062\061\032\060\030\006\003\125\004\012\023\021\123\107 -\040\124\122\125\123\124\040\123\105\122\126\111\103\105\123\061 -\013\060\011\006\003\125\004\006\023\002\106\122 -END -CKA_ID UTF8 "0" -CKA_ISSUER MULTILINE_OCTAL -\060\152\061\041\060\037\006\003\125\004\003\023\030\123\107\040 -\124\122\125\123\124\040\123\105\122\126\111\103\105\123\040\122 -\101\103\111\116\105\061\034\060\032\006\003\125\004\013\023\023 -\060\060\060\062\040\064\063\065\062\065\062\070\071\065\060\060 -\060\062\062\061\032\060\030\006\003\125\004\012\023\021\123\107 -\040\124\122\125\123\124\040\123\105\122\126\111\103\105\123\061 -\013\060\011\006\003\125\004\006\023\002\106\122 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\010\076\325\121\031\346\115\316\176 -END -CKA_VALUE MULTILINE_OCTAL -\060\202\006\031\060\202\004\001\240\003\002\001\002\002\010\076 -\325\121\031\346\115\316\176\060\015\006\011\052\206\110\206\367 -\015\001\001\013\005\000\060\152\061\041\060\037\006\003\125\004 -\003\023\030\123\107\040\124\122\125\123\124\040\123\105\122\126 -\111\103\105\123\040\122\101\103\111\116\105\061\034\060\032\006 -\003\125\004\013\023\023\060\060\060\062\040\064\063\065\062\065 -\062\070\071\065\060\060\060\062\062\061\032\060\030\006\003\125 -\004\012\023\021\123\107\040\124\122\125\123\124\040\123\105\122 -\126\111\103\105\123\061\013\060\011\006\003\125\004\006\023\002 -\106\122\060\036\027\015\061\060\060\071\060\066\061\062\065\063 -\064\062\132\027\015\063\060\060\071\060\065\061\062\065\063\064 -\062\132\060\152\061\041\060\037\006\003\125\004\003\023\030\123 -\107\040\124\122\125\123\124\040\123\105\122\126\111\103\105\123 -\040\122\101\103\111\116\105\061\034\060\032\006\003\125\004\013 -\023\023\060\060\060\062\040\064\063\065\062\065\062\070\071\065 -\060\060\060\062\062\061\032\060\030\006\003\125\004\012\023\021 -\123\107\040\124\122\125\123\124\040\123\105\122\126\111\103\105 -\123\061\013\060\011\006\003\125\004\006\023\002\106\122\060\202 -\002\042\060\015\006\011\052\206\110\206\367\015\001\001\001\005 -\000\003\202\002\017\000\060\202\002\012\002\202\002\001\000\332 -\250\126\002\354\174\225\360\116\351\012\322\267\007\243\042\213 -\120\263\271\056\031\075\127\333\031\252\322\053\344\316\102\342 -\154\241\344\135\045\036\063\035\266\105\321\264\372\131\212\126 -\160\311\155\010\166\151\160\232\346\307\234\010\060\023\376\346 -\321\222\150\141\076\114\021\362\156\362\261\173\127\126\113\011 -\275\334\017\331\161\014\350\232\067\336\042\020\034\231\136\326 -\261\027\007\323\244\071\055\302\032\163\375\312\113\051\007\302 -\171\051\310\310\046\256\054\304\374\043\310\113\342\206\126\017 -\050\375\266\207\033\150\137\071\144\105\375\150\203\154\165\044 -\036\074\165\231\141\372\322\024\370\251\113\261\330\175\247\170 -\322\023\142\145\265\326\276\176\152\003\274\265\262\374\144\060 -\303\320\302\231\075\231\244\323\315\321\261\304\123\207\173\114 -\023\023\146\177\277\325\145\123\150\371\134\036\345\264\377\066 -\231\105\243\237\142\300\177\021\202\001\124\336\017\145\245\071 -\256\235\110\114\211\243\020\073\340\346\203\365\260\332\054\036 -\172\034\134\037\000\254\314\253\247\140\144\263\306\305\173\307 -\125\106\164\074\220\201\016\112\216\131\235\124\260\110\261\122 -\114\073\230\356\253\332\064\267\123\315\111\332\057\353\225\276 -\014\127\021\366\226\114\004\171\134\231\325\345\344\276\157\352 -\107\356\121\113\357\042\046\256\265\330\021\252\103\273\170\277 -\013\176\264\335\317\164\035\045\251\211\143\261\342\064\201\304 -\210\065\070\342\002\015\017\023\311\325\052\202\025\360\212\304 -\103\062\126\344\123\035\035\254\266\317\175\233\226\135\036\144 -\351\164\163\304\126\344\026\112\122\155\222\071\323\341\115\016 -\077\142\271\336\255\265\035\145\271\135\122\376\135\011\251\234 -\264\244\014\331\057\105\166\245\317\216\152\232\236\252\260\021 -\241\353\141\306\353\077\036\374\146\264\022\235\106\177\062\026 -\211\276\161\105\257\221\041\331\375\223\277\264\002\221\102\377 -\111\037\355\213\025\150\335\037\216\254\233\335\202\005\234\104 -\151\026\144\027\126\137\101\017\112\117\004\017\145\120\206\223 -\227\354\105\277\135\302\034\334\317\304\330\072\346\170\005\320 -\305\125\125\251\136\376\253\072\041\273\345\162\024\367\013\002 -\003\001\000\001\243\201\302\060\201\277\060\035\006\003\125\035 -\016\004\026\004\024\051\040\313\361\303\017\332\006\216\023\223 -\207\376\137\140\032\051\273\363\266\060\017\006\003\125\035\023 -\001\001\377\004\005\060\003\001\001\377\060\037\006\003\125\035 -\043\004\030\060\026\200\024\051\040\313\361\303\017\332\006\216 -\023\223\207\376\137\140\032\051\273\363\266\060\021\006\003\125 -\035\040\004\012\060\010\060\006\006\004\125\035\040\000\060\111 -\006\003\125\035\037\004\102\060\100\060\076\240\074\240\072\206 -\070\150\164\164\160\072\057\057\143\162\154\056\163\147\164\162 -\165\163\164\163\145\162\166\151\143\145\163\056\143\157\155\057 -\162\141\143\151\156\145\055\107\162\157\165\160\145\123\107\057 -\114\141\164\145\163\164\103\122\114\060\016\006\003\125\035\017 -\001\001\377\004\004\003\002\001\006\060\015\006\011\052\206\110 -\206\367\015\001\001\013\005\000\003\202\002\001\000\114\106\147 -\340\104\120\365\305\266\272\262\121\012\045\023\035\267\307\210 -\056\037\271\053\144\240\313\223\210\122\131\252\140\365\314\051 -\122\027\377\004\347\067\264\061\021\106\176\053\036\154\247\213 -\074\107\232\136\364\252\135\220\073\105\075\237\112\311\212\173 -\216\300\356\076\171\213\222\243\310\224\112\270\050\021\153\246 -\045\137\135\275\307\310\373\203\117\125\061\346\134\360\023\174 -\343\275\177\052\054\067\067\224\111\257\204\037\024\047\242\130 -\020\217\012\071\067\032\022\040\101\217\031\366\251\037\031\355 -\262\064\262\255\175\063\104\213\137\012\007\103\362\166\105\105 -\055\255\344\215\016\000\375\004\010\252\347\153\373\027\275\260 -\010\126\016\065\052\162\360\263\347\115\072\117\015\334\363\140 -\022\263\070\144\214\333\371\341\046\215\057\357\116\350\044\107 -\076\066\064\212\151\017\050\153\213\207\306\275\205\046\371\323 -\353\151\041\126\140\221\326\367\340\142\302\250\161\256\056\336 -\146\043\265\122\106\246\244\110\067\054\177\001\026\127\021\367 -\047\015\016\345\017\326\220\105\341\036\077\041\334\322\374\026 -\030\023\076\115\152\262\046\152\100\136\045\170\375\070\364\254 -\130\172\067\033\230\100\004\307\216\311\324\304\147\141\261\230 -\256\360\315\016\334\271\257\145\203\173\012\004\212\077\141\252 -\367\135\101\206\346\306\114\302\117\072\134\126\352\050\073\247 -\104\317\310\112\144\365\162\140\055\343\103\270\112\340\165\074 -\062\344\252\026\327\021\271\301\105\331\233\146\143\146\345\042 -\267\064\356\272\325\164\057\045\144\363\201\124\313\167\336\127 -\324\223\343\254\007\061\072\076\134\003\203\127\123\307\360\376 -\150\330\045\120\115\022\310\346\341\225\215\147\253\074\223\077 -\027\002\272\070\327\236\367\060\245\075\075\104\001\063\032\232 -\237\216\320\237\361\356\060\210\163\357\256\044\031\272\227\163 -\025\301\354\161\014\204\144\265\173\354\274\151\076\244\155\011 -\026\066\312\112\071\212\313\247\173\306\035\176\347\063\210\311 -\276\060\155\234\205\225\041\351\107\073\006\176\201\342\352\106 -\346\160\130\200\346\250\362\235\013\151\321\063\211\131\060\363 -\144\323\013\366\316\053\011\373\175\020\166\056\020 -END - -# Trust for "SG TRUST SERVICES RACINE" -# Issuer: C=FR,O=SG TRUST SERVICES,OU=0002 43525289500022,CN=SG TRUST SERVICES RACINE -# Serial Number:3e:d5:51:19:e6:4d:ce:7e -# Subject: C=FR,O=SG TRUST SERVICES,OU=0002 43525289500022,CN=SG TRUST SERVICES RACINE -# Not Valid Before: Mon Sep 06 12:53:42 2010 -# Not Valid After : Thu Sep 05 12:53:42 2030 -# Fingerprint (MD5): 25:EF:CF:48:4A:84:B7:30:9F:60:D3:1D:56:91:2F:E1 -# Fingerprint (SHA1): 0C:62:8F:5C:55:70:B1:C9:57:FA:FD:38:3F:B0:3D:7B:7D:D7:B9:C6 -CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "SG TRUST SERVICES RACINE" -CKA_CERT_SHA1_HASH MULTILINE_OCTAL -\014\142\217\134\125\160\261\311\127\372\375\070\077\260\075\173 -\175\327\271\306 -END -CKA_CERT_MD5_HASH MULTILINE_OCTAL -\045\357\317\110\112\204\267\060\237\140\323\035\126\221\057\341 -END -CKA_ISSUER MULTILINE_OCTAL -\060\152\061\041\060\037\006\003\125\004\003\023\030\123\107\040 -\124\122\125\123\124\040\123\105\122\126\111\103\105\123\040\122 -\101\103\111\116\105\061\034\060\032\006\003\125\004\013\023\023 -\060\060\060\062\040\064\063\065\062\065\062\070\071\065\060\060 -\060\062\062\061\032\060\030\006\003\125\004\012\023\021\123\107 -\040\124\122\125\123\124\040\123\105\122\126\111\103\105\123\061 -\013\060\011\006\003\125\004\006\023\002\106\122 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\010\076\325\121\031\346\115\316\176 -END -CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_MUST_VERIFY_TRUST -CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_TRUSTED_DELEGATOR -CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_MUST_VERIFY_TRUST -CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE - # # Certificate "ACCVRAIZ1" # @@ -29839,164 +27893,6 @@ CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_TRUSTED_DELEGATOR CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_TRUSTED_DELEGATOR CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE -# -# Certificate "USERTrust-temporary-intermediate-after-1024bit-removal" -# -# Issuer: CN=AddTrust External CA Root,OU=AddTrust External TTP Network,O=AddTrust AB,C=SE -# Serial Number:5d:20:61:8e:8c:0e:b9:34:40:93:b9:b1:d8:63:95:b6 -# Subject: CN=USERTrust Legacy Secure Server CA,O=The USERTRUST Network,L=Salt Lake City,ST=UT,C=US -# Not Valid Before: Tue Aug 05 00:00:00 2014 -# Not Valid After : Sun Nov 01 23:59:59 2015 -# Fingerprint (SHA-256): 92:96:6E:83:44:D2:FB:3A:28:0E:B8:60:4D:81:40:77:4C:E1:A0:57:C5:82:BE:BC:83:4D:03:02:E8:59:BC:43 -# Fingerprint (SHA1): 7C:2F:91:E2:BB:96:68:A9:C6:F6:BD:10:19:2C:6B:52:5A:1B:BA:48 -CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "USERTrust-temporary-intermediate-after-1024bit-removal" -CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509 -CKA_SUBJECT MULTILINE_OCTAL -\060\177\061\013\060\011\006\003\125\004\006\023\002\125\123\061 -\013\060\011\006\003\125\004\010\023\002\125\124\061\027\060\025 -\006\003\125\004\007\023\016\123\141\154\164\040\114\141\153\145 -\040\103\151\164\171\061\036\060\034\006\003\125\004\012\023\025 -\124\150\145\040\125\123\105\122\124\122\125\123\124\040\116\145 -\164\167\157\162\153\061\052\060\050\006\003\125\004\003\023\041 -\125\123\105\122\124\162\165\163\164\040\114\145\147\141\143\171 -\040\123\145\143\165\162\145\040\123\145\162\166\145\162\040\103 -\101 -END -CKA_ID UTF8 "0" -CKA_ISSUER MULTILINE_OCTAL -\060\157\061\013\060\011\006\003\125\004\006\023\002\123\105\061 -\024\060\022\006\003\125\004\012\023\013\101\144\144\124\162\165 -\163\164\040\101\102\061\046\060\044\006\003\125\004\013\023\035 -\101\144\144\124\162\165\163\164\040\105\170\164\145\162\156\141 -\154\040\124\124\120\040\116\145\164\167\157\162\153\061\042\060 -\040\006\003\125\004\003\023\031\101\144\144\124\162\165\163\164 -\040\105\170\164\145\162\156\141\154\040\103\101\040\122\157\157 -\164 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\020\135\040\141\216\214\016\271\064\100\223\271\261\330\143 -\225\266 -END -CKA_VALUE MULTILINE_OCTAL -\060\202\004\231\060\202\003\201\240\003\002\001\002\002\020\135 -\040\141\216\214\016\271\064\100\223\271\261\330\143\225\266\060 -\015\006\011\052\206\110\206\367\015\001\001\005\005\000\060\157 -\061\013\060\011\006\003\125\004\006\023\002\123\105\061\024\060 -\022\006\003\125\004\012\023\013\101\144\144\124\162\165\163\164 -\040\101\102\061\046\060\044\006\003\125\004\013\023\035\101\144 -\144\124\162\165\163\164\040\105\170\164\145\162\156\141\154\040 -\124\124\120\040\116\145\164\167\157\162\153\061\042\060\040\006 -\003\125\004\003\023\031\101\144\144\124\162\165\163\164\040\105 -\170\164\145\162\156\141\154\040\103\101\040\122\157\157\164\060 -\036\027\015\061\064\060\070\060\065\060\060\060\060\060\060\132 -\027\015\061\065\061\061\060\061\062\063\065\071\065\071\132\060 -\177\061\013\060\011\006\003\125\004\006\023\002\125\123\061\013 -\060\011\006\003\125\004\010\023\002\125\124\061\027\060\025\006 -\003\125\004\007\023\016\123\141\154\164\040\114\141\153\145\040 -\103\151\164\171\061\036\060\034\006\003\125\004\012\023\025\124 -\150\145\040\125\123\105\122\124\122\125\123\124\040\116\145\164 -\167\157\162\153\061\052\060\050\006\003\125\004\003\023\041\125 -\123\105\122\124\162\165\163\164\040\114\145\147\141\143\171\040 -\123\145\143\165\162\145\040\123\145\162\166\145\162\040\103\101 -\060\202\001\042\060\015\006\011\052\206\110\206\367\015\001\001 -\001\005\000\003\202\001\017\000\060\202\001\012\002\202\001\001 -\000\331\115\040\072\346\051\060\206\362\351\206\211\166\064\116 -\150\037\226\104\367\321\371\326\202\116\246\070\236\356\313\133 -\341\216\056\275\362\127\200\375\311\077\374\220\163\104\274\217 -\273\127\133\345\055\037\024\060\165\066\365\177\274\317\126\364 -\177\201\377\256\221\315\330\322\152\313\227\371\367\315\220\152 -\105\055\304\273\244\205\023\150\127\137\357\051\272\052\312\352 -\365\314\244\004\233\143\315\000\353\375\355\215\335\043\306\173 -\036\127\035\066\177\037\010\232\015\141\333\132\154\161\002\123 -\050\302\372\215\375\253\273\263\361\215\164\113\337\275\275\314 -\006\223\143\011\225\302\020\172\235\045\220\062\235\001\302\071 -\123\260\340\025\153\307\327\164\345\244\042\233\344\224\377\204 -\221\373\055\263\031\103\055\223\017\234\022\011\344\147\271\047 -\172\062\255\172\052\314\101\130\300\156\131\137\356\070\053\027 -\042\234\211\372\156\347\345\127\065\364\132\355\222\225\223\055 -\371\314\044\077\245\034\075\047\275\042\003\163\314\365\312\363 -\251\364\334\376\317\351\320\134\320\017\253\207\374\203\375\310 -\251\002\003\001\000\001\243\202\001\037\060\202\001\033\060\037 -\006\003\125\035\043\004\030\060\026\200\024\255\275\230\172\064 -\264\046\367\372\304\046\124\357\003\275\340\044\313\124\032\060 -\035\006\003\125\035\016\004\026\004\024\257\244\100\257\237\026 -\376\253\061\375\373\325\227\213\365\221\243\044\206\026\060\016 -\006\003\125\035\017\001\001\377\004\004\003\002\001\206\060\022 -\006\003\125\035\023\001\001\377\004\010\060\006\001\001\377\002 -\001\000\060\035\006\003\125\035\045\004\026\060\024\006\010\053 -\006\001\005\005\007\003\001\006\010\053\006\001\005\005\007\003 -\002\060\031\006\003\125\035\040\004\022\060\020\060\016\006\014 -\053\006\001\004\001\262\061\001\002\001\003\004\060\104\006\003 -\125\035\037\004\075\060\073\060\071\240\067\240\065\206\063\150 -\164\164\160\072\057\057\143\162\154\056\165\163\145\162\164\162 -\165\163\164\056\143\157\155\057\101\144\144\124\162\165\163\164 -\105\170\164\145\162\156\141\154\103\101\122\157\157\164\056\143 -\162\154\060\065\006\010\053\006\001\005\005\007\001\001\004\051 -\060\047\060\045\006\010\053\006\001\005\005\007\060\001\206\031 -\150\164\164\160\072\057\057\157\143\163\160\056\165\163\145\162 -\164\162\165\163\164\056\143\157\155\060\015\006\011\052\206\110 -\206\367\015\001\001\005\005\000\003\202\001\001\000\204\256\055 -\150\070\021\154\203\121\142\300\221\302\230\274\306\073\372\245 -\305\275\073\011\346\156\140\157\060\003\206\042\032\262\213\363 -\306\316\036\273\033\171\340\026\024\115\322\232\005\113\377\217 -\354\360\050\051\352\052\004\035\075\257\021\022\325\111\230\120 -\102\237\141\146\072\266\100\231\004\014\153\020\062\351\367\317 -\206\130\117\055\315\323\254\176\350\133\152\203\174\015\240\234 -\134\120\066\165\015\155\176\102\267\337\246\334\220\134\157\043 -\116\227\035\363\042\165\277\003\065\346\135\177\307\371\233\054 -\207\366\216\326\045\226\131\235\317\352\020\036\357\156\352\132 -\233\167\030\064\314\201\167\257\232\207\302\012\345\345\236\023 -\225\123\275\275\111\032\245\166\022\366\334\362\221\267\351\032 -\341\274\115\075\225\161\175\370\215\174\076\003\117\123\355\376 -\122\375\312\137\223\341\032\001\033\002\267\163\116\272\146\351 -\170\213\120\376\021\313\321\147\320\042\117\167\352\315\024\025 -\100\256\146\135\350\056\177\036\210\157\125\171\326\271\176\343 -\265\375\221\240\300\362\046\207\113\057\235\365\240 -END - -# Trust for "USERTrust-temporary-intermediate-after-1024bit-removal" -# Issuer: CN=AddTrust External CA Root,OU=AddTrust External TTP Network,O=AddTrust AB,C=SE -# Serial Number:5d:20:61:8e:8c:0e:b9:34:40:93:b9:b1:d8:63:95:b6 -# Subject: CN=USERTrust Legacy Secure Server CA,O=The USERTRUST Network,L=Salt Lake City,ST=UT,C=US -# Not Valid Before: Tue Aug 05 00:00:00 2014 -# Not Valid After : Sun Nov 01 23:59:59 2015 -# Fingerprint (SHA-256): 92:96:6E:83:44:D2:FB:3A:28:0E:B8:60:4D:81:40:77:4C:E1:A0:57:C5:82:BE:BC:83:4D:03:02:E8:59:BC:43 -# Fingerprint (SHA1): 7C:2F:91:E2:BB:96:68:A9:C6:F6:BD:10:19:2C:6B:52:5A:1B:BA:48 -CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST -CKA_TOKEN CK_BBOOL CK_TRUE -CKA_PRIVATE CK_BBOOL CK_FALSE -CKA_MODIFIABLE CK_BBOOL CK_FALSE -CKA_LABEL UTF8 "USERTrust-temporary-intermediate-after-1024bit-removal" -CKA_CERT_SHA1_HASH MULTILINE_OCTAL -\174\057\221\342\273\226\150\251\306\366\275\020\031\054\153\122 -\132\033\272\110 -END -CKA_CERT_MD5_HASH MULTILINE_OCTAL -\131\153\146\214\004\251\341\013\017\356\105\245\220\044\037\016 -END -CKA_ISSUER MULTILINE_OCTAL -\060\157\061\013\060\011\006\003\125\004\006\023\002\123\105\061 -\024\060\022\006\003\125\004\012\023\013\101\144\144\124\162\165 -\163\164\040\101\102\061\046\060\044\006\003\125\004\013\023\035 -\101\144\144\124\162\165\163\164\040\105\170\164\145\162\156\141 -\154\040\124\124\120\040\116\145\164\167\157\162\153\061\042\060 -\040\006\003\125\004\003\023\031\101\144\144\124\162\165\163\164 -\040\105\170\164\145\162\156\141\154\040\103\101\040\122\157\157 -\164 -END -CKA_SERIAL_NUMBER MULTILINE_OCTAL -\002\020\135\040\141\216\214\016\271\064\100\223\271\261\330\143 -\225\266 -END -CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_MUST_VERIFY_TRUST -CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_MUST_VERIFY_TRUST -CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_MUST_VERIFY_TRUST -CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE - # # Certificate "VeriSign-C3SSA-G2-temporary-intermediate-after-1024bit-removal" # @@ -31590,3 +29486,868 @@ CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_NOT_TRUSTED CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_NOT_TRUSTED CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_NOT_TRUSTED CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE + +# +# Certificate "TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı H5" +# +# Issuer: CN=T..RKTRUST Elektronik Sertifika Hizmet Sa..lay..c..s.. H5,O=T..RKTRUST Bilgi ..leti..im ve Bili..im G..venli..i Hizmetleri A....,L=Ankara,C=TR +# Serial Number:00:8e:17:fe:24:20:81 +# Subject: CN=T..RKTRUST Elektronik Sertifika Hizmet Sa..lay..c..s.. H5,O=T..RKTRUST Bilgi ..leti..im ve Bili..im G..venli..i Hizmetleri A....,L=Ankara,C=TR +# Not Valid Before: Tue Apr 30 08:07:01 2013 +# Not Valid After : Fri Apr 28 08:07:01 2023 +# Fingerprint (SHA-256): 49:35:1B:90:34:44:C1:85:CC:DC:5C:69:3D:24:D8:55:5C:B2:08:D6:A8:14:13:07:69:9F:4A:F0:63:19:9D:78 +# Fingerprint (SHA1): C4:18:F6:4D:46:D1:DF:00:3D:27:30:13:72:43:A9:12:11:C6:75:FB +CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE +CKA_TOKEN CK_BBOOL CK_TRUE +CKA_PRIVATE CK_BBOOL CK_FALSE +CKA_MODIFIABLE CK_BBOOL CK_FALSE +CKA_LABEL UTF8 "TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı H5" +CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509 +CKA_SUBJECT MULTILINE_OCTAL +\060\201\261\061\013\060\011\006\003\125\004\006\023\002\124\122 +\061\017\060\015\006\003\125\004\007\014\006\101\156\153\141\162 +\141\061\115\060\113\006\003\125\004\012\014\104\124\303\234\122 +\113\124\122\125\123\124\040\102\151\154\147\151\040\304\260\154 +\145\164\151\305\237\151\155\040\166\145\040\102\151\154\151\305 +\237\151\155\040\107\303\274\166\145\156\154\151\304\237\151\040 +\110\151\172\155\145\164\154\145\162\151\040\101\056\305\236\056 +\061\102\060\100\006\003\125\004\003\014\071\124\303\234\122\113 +\124\122\125\123\124\040\105\154\145\153\164\162\157\156\151\153 +\040\123\145\162\164\151\146\151\153\141\040\110\151\172\155\145 +\164\040\123\141\304\237\154\141\171\304\261\143\304\261\163\304 +\261\040\110\065 +END +CKA_ID UTF8 "0" +CKA_ISSUER MULTILINE_OCTAL +\060\201\261\061\013\060\011\006\003\125\004\006\023\002\124\122 +\061\017\060\015\006\003\125\004\007\014\006\101\156\153\141\162 +\141\061\115\060\113\006\003\125\004\012\014\104\124\303\234\122 +\113\124\122\125\123\124\040\102\151\154\147\151\040\304\260\154 +\145\164\151\305\237\151\155\040\166\145\040\102\151\154\151\305 +\237\151\155\040\107\303\274\166\145\156\154\151\304\237\151\040 +\110\151\172\155\145\164\154\145\162\151\040\101\056\305\236\056 +\061\102\060\100\006\003\125\004\003\014\071\124\303\234\122\113 +\124\122\125\123\124\040\105\154\145\153\164\162\157\156\151\153 +\040\123\145\162\164\151\146\151\153\141\040\110\151\172\155\145 +\164\040\123\141\304\237\154\141\171\304\261\143\304\261\163\304 +\261\040\110\065 +END +CKA_SERIAL_NUMBER MULTILINE_OCTAL +\002\007\000\216\027\376\044\040\201 +END +CKA_VALUE MULTILINE_OCTAL +\060\202\004\047\060\202\003\017\240\003\002\001\002\002\007\000 +\216\027\376\044\040\201\060\015\006\011\052\206\110\206\367\015 +\001\001\013\005\000\060\201\261\061\013\060\011\006\003\125\004 +\006\023\002\124\122\061\017\060\015\006\003\125\004\007\014\006 +\101\156\153\141\162\141\061\115\060\113\006\003\125\004\012\014 +\104\124\303\234\122\113\124\122\125\123\124\040\102\151\154\147 +\151\040\304\260\154\145\164\151\305\237\151\155\040\166\145\040 +\102\151\154\151\305\237\151\155\040\107\303\274\166\145\156\154 +\151\304\237\151\040\110\151\172\155\145\164\154\145\162\151\040 +\101\056\305\236\056\061\102\060\100\006\003\125\004\003\014\071 +\124\303\234\122\113\124\122\125\123\124\040\105\154\145\153\164 +\162\157\156\151\153\040\123\145\162\164\151\146\151\153\141\040 +\110\151\172\155\145\164\040\123\141\304\237\154\141\171\304\261 +\143\304\261\163\304\261\040\110\065\060\036\027\015\061\063\060 +\064\063\060\060\070\060\067\060\061\132\027\015\062\063\060\064 +\062\070\060\070\060\067\060\061\132\060\201\261\061\013\060\011 +\006\003\125\004\006\023\002\124\122\061\017\060\015\006\003\125 +\004\007\014\006\101\156\153\141\162\141\061\115\060\113\006\003 +\125\004\012\014\104\124\303\234\122\113\124\122\125\123\124\040 +\102\151\154\147\151\040\304\260\154\145\164\151\305\237\151\155 +\040\166\145\040\102\151\154\151\305\237\151\155\040\107\303\274 +\166\145\156\154\151\304\237\151\040\110\151\172\155\145\164\154 +\145\162\151\040\101\056\305\236\056\061\102\060\100\006\003\125 +\004\003\014\071\124\303\234\122\113\124\122\125\123\124\040\105 +\154\145\153\164\162\157\156\151\153\040\123\145\162\164\151\146 +\151\153\141\040\110\151\172\155\145\164\040\123\141\304\237\154 +\141\171\304\261\143\304\261\163\304\261\040\110\065\060\202\001 +\042\060\015\006\011\052\206\110\206\367\015\001\001\001\005\000 +\003\202\001\017\000\060\202\001\012\002\202\001\001\000\244\045 +\031\341\145\236\353\110\041\120\112\010\345\021\360\132\272\046 +\377\203\131\316\104\052\057\376\341\316\140\003\374\215\003\245 +\355\377\153\250\272\314\064\006\237\131\065\366\354\054\273\235 +\373\215\122\151\343\234\047\020\123\363\244\002\305\247\371\021 +\032\151\165\156\303\035\213\321\230\215\223\207\247\161\227\015 +\041\307\231\371\122\323\054\143\135\125\274\350\037\001\110\271 +\140\376\102\112\366\310\200\256\315\146\172\236\105\212\150\167 +\342\110\150\237\242\332\361\341\301\020\237\353\074\051\201\247 +\341\062\010\324\240\005\261\214\373\215\226\000\016\076\045\337 +\123\206\042\073\374\364\275\363\011\176\167\354\206\353\017\063 +\345\103\117\364\124\165\155\051\231\056\146\132\103\337\313\134 +\312\310\345\070\361\176\073\065\235\017\364\305\132\241\314\363 +\040\200\044\323\127\354\025\272\165\045\233\350\144\113\263\064 +\204\357\004\270\366\311\154\252\002\076\266\125\342\062\067\137 +\374\146\227\137\315\326\236\307\040\277\115\306\254\077\165\137 +\034\355\062\234\174\151\000\151\221\343\043\030\123\351\002\003 +\001\000\001\243\102\060\100\060\035\006\003\125\035\016\004\026 +\004\024\126\231\007\036\323\254\014\151\144\264\014\120\107\336 +\103\054\276\040\300\373\060\016\006\003\125\035\017\001\001\377 +\004\004\003\002\001\006\060\017\006\003\125\035\023\001\001\377 +\004\005\060\003\001\001\377\060\015\006\011\052\206\110\206\367 +\015\001\001\013\005\000\003\202\001\001\000\236\105\166\173\027 +\110\062\362\070\213\051\275\356\226\112\116\201\030\261\121\107 +\040\315\320\144\261\016\311\331\001\331\011\316\310\231\334\150 +\045\023\324\134\362\243\350\004\376\162\011\307\013\252\035\045 +\125\176\226\232\127\267\272\305\021\172\031\346\247\176\075\205 +\016\365\371\056\051\057\347\371\154\130\026\127\120\045\366\076 +\056\076\252\355\167\161\252\252\231\226\106\012\256\216\354\052 +\121\026\260\136\315\352\147\004\034\130\060\365\140\212\275\246 +\275\115\345\226\264\374\102\211\001\153\366\160\310\120\071\014 +\055\325\146\331\310\322\263\062\267\033\031\155\313\063\371\337 +\245\346\025\204\067\360\302\362\145\226\222\220\167\360\255\364 +\220\351\021\170\327\223\211\300\075\013\272\051\364\350\231\235 +\162\216\355\235\057\356\222\175\241\361\377\135\272\063\140\205 +\142\376\007\002\241\204\126\106\276\226\012\232\023\327\041\114 +\267\174\007\237\116\116\077\221\164\373\047\235\021\314\335\346 +\261\312\161\115\023\027\071\046\305\051\041\053\223\051\152\226 +\372\253\101\341\113\266\065\013\300\233\025 +END + +# Trust for "TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı H5" +# Issuer: CN=T..RKTRUST Elektronik Sertifika Hizmet Sa..lay..c..s.. H5,O=T..RKTRUST Bilgi ..leti..im ve Bili..im G..venli..i Hizmetleri A....,L=Ankara,C=TR +# Serial Number:00:8e:17:fe:24:20:81 +# Subject: CN=T..RKTRUST Elektronik Sertifika Hizmet Sa..lay..c..s.. H5,O=T..RKTRUST Bilgi ..leti..im ve Bili..im G..venli..i Hizmetleri A....,L=Ankara,C=TR +# Not Valid Before: Tue Apr 30 08:07:01 2013 +# Not Valid After : Fri Apr 28 08:07:01 2023 +# Fingerprint (SHA-256): 49:35:1B:90:34:44:C1:85:CC:DC:5C:69:3D:24:D8:55:5C:B2:08:D6:A8:14:13:07:69:9F:4A:F0:63:19:9D:78 +# Fingerprint (SHA1): C4:18:F6:4D:46:D1:DF:00:3D:27:30:13:72:43:A9:12:11:C6:75:FB +CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST +CKA_TOKEN CK_BBOOL CK_TRUE +CKA_PRIVATE CK_BBOOL CK_FALSE +CKA_MODIFIABLE CK_BBOOL CK_FALSE +CKA_LABEL UTF8 "TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı H5" +CKA_CERT_SHA1_HASH MULTILINE_OCTAL +\304\030\366\115\106\321\337\000\075\047\060\023\162\103\251\022 +\021\306\165\373 +END +CKA_CERT_MD5_HASH MULTILINE_OCTAL +\332\160\216\360\042\337\223\046\366\137\237\323\025\006\122\116 +END +CKA_ISSUER MULTILINE_OCTAL +\060\201\261\061\013\060\011\006\003\125\004\006\023\002\124\122 +\061\017\060\015\006\003\125\004\007\014\006\101\156\153\141\162 +\141\061\115\060\113\006\003\125\004\012\014\104\124\303\234\122 +\113\124\122\125\123\124\040\102\151\154\147\151\040\304\260\154 +\145\164\151\305\237\151\155\040\166\145\040\102\151\154\151\305 +\237\151\155\040\107\303\274\166\145\156\154\151\304\237\151\040 +\110\151\172\155\145\164\154\145\162\151\040\101\056\305\236\056 +\061\102\060\100\006\003\125\004\003\014\071\124\303\234\122\113 +\124\122\125\123\124\040\105\154\145\153\164\162\157\156\151\153 +\040\123\145\162\164\151\146\151\153\141\040\110\151\172\155\145 +\164\040\123\141\304\237\154\141\171\304\261\143\304\261\163\304 +\261\040\110\065 +END +CKA_SERIAL_NUMBER MULTILINE_OCTAL +\002\007\000\216\027\376\044\040\201 +END +CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_TRUSTED_DELEGATOR +CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_MUST_VERIFY_TRUST +CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_TRUSTED_DELEGATOR +CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE + +# +# Certificate "TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı H6" +# +# Issuer: CN=T..RKTRUST Elektronik Sertifika Hizmet Sa..lay..c..s.. H6,O=T..RKTRUST Bilgi ..leti..im ve Bili..im G..venli..i Hizmetleri A....,L=Ankara,C=TR +# Serial Number:7d:a1:f2:65:ec:8a +# Subject: CN=T..RKTRUST Elektronik Sertifika Hizmet Sa..lay..c..s.. H6,O=T..RKTRUST Bilgi ..leti..im ve Bili..im G..venli..i Hizmetleri A....,L=Ankara,C=TR +# Not Valid Before: Wed Dec 18 09:04:10 2013 +# Not Valid After : Sat Dec 16 09:04:10 2023 +# Fingerprint (SHA-256): 8D:E7:86:55:E1:BE:7F:78:47:80:0B:93:F6:94:D2:1D:36:8C:C0:6E:03:3E:7F:AB:04:BB:5E:B9:9D:A6:B7:00 +# Fingerprint (SHA1): 8A:5C:8C:EE:A5:03:E6:05:56:BA:D8:1B:D4:F6:C9:B0:ED:E5:2F:E0 +CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE +CKA_TOKEN CK_BBOOL CK_TRUE +CKA_PRIVATE CK_BBOOL CK_FALSE +CKA_MODIFIABLE CK_BBOOL CK_FALSE +CKA_LABEL UTF8 "TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı H6" +CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509 +CKA_SUBJECT MULTILINE_OCTAL +\060\201\261\061\013\060\011\006\003\125\004\006\023\002\124\122 +\061\017\060\015\006\003\125\004\007\014\006\101\156\153\141\162 +\141\061\115\060\113\006\003\125\004\012\014\104\124\303\234\122 +\113\124\122\125\123\124\040\102\151\154\147\151\040\304\260\154 +\145\164\151\305\237\151\155\040\166\145\040\102\151\154\151\305 +\237\151\155\040\107\303\274\166\145\156\154\151\304\237\151\040 +\110\151\172\155\145\164\154\145\162\151\040\101\056\305\236\056 +\061\102\060\100\006\003\125\004\003\014\071\124\303\234\122\113 +\124\122\125\123\124\040\105\154\145\153\164\162\157\156\151\153 +\040\123\145\162\164\151\146\151\153\141\040\110\151\172\155\145 +\164\040\123\141\304\237\154\141\171\304\261\143\304\261\163\304 +\261\040\110\066 +END +CKA_ID UTF8 "0" +CKA_ISSUER MULTILINE_OCTAL +\060\201\261\061\013\060\011\006\003\125\004\006\023\002\124\122 +\061\017\060\015\006\003\125\004\007\014\006\101\156\153\141\162 +\141\061\115\060\113\006\003\125\004\012\014\104\124\303\234\122 +\113\124\122\125\123\124\040\102\151\154\147\151\040\304\260\154 +\145\164\151\305\237\151\155\040\166\145\040\102\151\154\151\305 +\237\151\155\040\107\303\274\166\145\156\154\151\304\237\151\040 +\110\151\172\155\145\164\154\145\162\151\040\101\056\305\236\056 +\061\102\060\100\006\003\125\004\003\014\071\124\303\234\122\113 +\124\122\125\123\124\040\105\154\145\153\164\162\157\156\151\153 +\040\123\145\162\164\151\146\151\153\141\040\110\151\172\155\145 +\164\040\123\141\304\237\154\141\171\304\261\143\304\261\163\304 +\261\040\110\066 +END +CKA_SERIAL_NUMBER MULTILINE_OCTAL +\002\006\175\241\362\145\354\212 +END +CKA_VALUE MULTILINE_OCTAL +\060\202\004\046\060\202\003\016\240\003\002\001\002\002\006\175 +\241\362\145\354\212\060\015\006\011\052\206\110\206\367\015\001 +\001\013\005\000\060\201\261\061\013\060\011\006\003\125\004\006 +\023\002\124\122\061\017\060\015\006\003\125\004\007\014\006\101 +\156\153\141\162\141\061\115\060\113\006\003\125\004\012\014\104 +\124\303\234\122\113\124\122\125\123\124\040\102\151\154\147\151 +\040\304\260\154\145\164\151\305\237\151\155\040\166\145\040\102 +\151\154\151\305\237\151\155\040\107\303\274\166\145\156\154\151 +\304\237\151\040\110\151\172\155\145\164\154\145\162\151\040\101 +\056\305\236\056\061\102\060\100\006\003\125\004\003\014\071\124 +\303\234\122\113\124\122\125\123\124\040\105\154\145\153\164\162 +\157\156\151\153\040\123\145\162\164\151\146\151\153\141\040\110 +\151\172\155\145\164\040\123\141\304\237\154\141\171\304\261\143 +\304\261\163\304\261\040\110\066\060\036\027\015\061\063\061\062 +\061\070\060\071\060\064\061\060\132\027\015\062\063\061\062\061 +\066\060\071\060\064\061\060\132\060\201\261\061\013\060\011\006 +\003\125\004\006\023\002\124\122\061\017\060\015\006\003\125\004 +\007\014\006\101\156\153\141\162\141\061\115\060\113\006\003\125 +\004\012\014\104\124\303\234\122\113\124\122\125\123\124\040\102 +\151\154\147\151\040\304\260\154\145\164\151\305\237\151\155\040 +\166\145\040\102\151\154\151\305\237\151\155\040\107\303\274\166 +\145\156\154\151\304\237\151\040\110\151\172\155\145\164\154\145 +\162\151\040\101\056\305\236\056\061\102\060\100\006\003\125\004 +\003\014\071\124\303\234\122\113\124\122\125\123\124\040\105\154 +\145\153\164\162\157\156\151\153\040\123\145\162\164\151\146\151 +\153\141\040\110\151\172\155\145\164\040\123\141\304\237\154\141 +\171\304\261\143\304\261\163\304\261\040\110\066\060\202\001\042 +\060\015\006\011\052\206\110\206\367\015\001\001\001\005\000\003 +\202\001\017\000\060\202\001\012\002\202\001\001\000\235\260\150 +\326\350\275\024\226\243\000\012\232\361\364\307\314\221\115\161 +\170\167\271\367\041\046\025\163\121\026\224\011\107\005\342\063 +\365\150\232\065\377\334\113\057\062\307\260\355\342\202\345\157 +\332\332\352\254\306\006\317\045\015\101\201\366\301\070\042\275 +\371\261\245\246\263\001\274\077\120\027\053\366\351\146\125\324 +\063\263\134\370\103\040\170\223\125\026\160\031\062\346\211\327 +\144\353\275\110\120\375\366\320\101\003\302\164\267\375\366\200 +\317\133\305\253\244\326\225\022\233\347\227\023\062\003\351\324 +\253\103\133\026\355\063\042\144\051\266\322\223\255\057\154\330 +\075\266\366\035\016\064\356\322\175\251\125\017\040\364\375\051 +\273\221\133\034\175\306\102\070\155\102\050\155\324\001\373\315 +\210\227\111\176\270\363\203\370\265\230\057\263\047\013\110\136 +\126\347\116\243\063\263\104\326\245\362\030\224\355\034\036\251 +\225\134\142\112\370\015\147\121\251\257\041\325\370\062\235\171 +\272\032\137\345\004\125\115\023\106\377\362\317\164\307\032\143 +\155\303\037\027\022\303\036\020\076\140\010\263\061\002\003\001 +\000\001\243\102\060\100\060\035\006\003\125\035\016\004\026\004 +\024\335\125\027\023\366\254\350\110\041\312\357\265\257\321\000 +\062\355\236\214\265\060\016\006\003\125\035\017\001\001\377\004 +\004\003\002\001\006\060\017\006\003\125\035\023\001\001\377\004 +\005\060\003\001\001\377\060\015\006\011\052\206\110\206\367\015 +\001\001\013\005\000\003\202\001\001\000\157\130\015\227\103\252 +\026\124\076\277\251\337\222\105\077\205\013\273\126\323\014\122 +\314\310\277\166\147\136\346\252\263\247\357\271\254\264\020\024 +\015\164\176\075\155\255\321\175\320\232\251\245\312\030\073\002 +\100\056\052\234\120\024\213\376\127\176\127\134\021\011\113\066 +\105\122\367\075\254\024\375\104\337\213\227\043\324\303\301\356 +\324\123\225\376\054\112\376\015\160\252\273\213\057\055\313\062 +\243\202\362\124\337\330\362\335\327\110\162\356\112\243\051\226 +\303\104\316\156\265\222\207\166\244\273\364\222\154\316\054\024 +\011\146\216\215\255\026\265\307\033\011\141\073\343\040\242\003 +\200\216\255\176\121\000\116\307\226\206\373\103\230\167\175\050 +\307\217\330\052\156\347\204\157\227\101\051\000\026\136\115\342 +\023\352\131\300\143\147\072\104\373\230\374\004\323\060\162\246 +\366\207\011\127\255\166\246\035\143\232\375\327\145\310\170\203 +\053\165\073\245\133\270\015\135\177\276\043\256\126\125\224\130 +\357\037\201\214\052\262\315\346\233\143\236\030\274\345\153\006 +\264\013\230\113\050\136\257\210\130\313 +END + +# Trust for "TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı H6" +# Issuer: CN=T..RKTRUST Elektronik Sertifika Hizmet Sa..lay..c..s.. H6,O=T..RKTRUST Bilgi ..leti..im ve Bili..im G..venli..i Hizmetleri A....,L=Ankara,C=TR +# Serial Number:7d:a1:f2:65:ec:8a +# Subject: CN=T..RKTRUST Elektronik Sertifika Hizmet Sa..lay..c..s.. H6,O=T..RKTRUST Bilgi ..leti..im ve Bili..im G..venli..i Hizmetleri A....,L=Ankara,C=TR +# Not Valid Before: Wed Dec 18 09:04:10 2013 +# Not Valid After : Sat Dec 16 09:04:10 2023 +# Fingerprint (SHA-256): 8D:E7:86:55:E1:BE:7F:78:47:80:0B:93:F6:94:D2:1D:36:8C:C0:6E:03:3E:7F:AB:04:BB:5E:B9:9D:A6:B7:00 +# Fingerprint (SHA1): 8A:5C:8C:EE:A5:03:E6:05:56:BA:D8:1B:D4:F6:C9:B0:ED:E5:2F:E0 +CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST +CKA_TOKEN CK_BBOOL CK_TRUE +CKA_PRIVATE CK_BBOOL CK_FALSE +CKA_MODIFIABLE CK_BBOOL CK_FALSE +CKA_LABEL UTF8 "TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı H6" +CKA_CERT_SHA1_HASH MULTILINE_OCTAL +\212\134\214\356\245\003\346\005\126\272\330\033\324\366\311\260 +\355\345\057\340 +END +CKA_CERT_MD5_HASH MULTILINE_OCTAL +\370\305\356\052\153\276\225\215\010\367\045\112\352\161\076\106 +END +CKA_ISSUER MULTILINE_OCTAL +\060\201\261\061\013\060\011\006\003\125\004\006\023\002\124\122 +\061\017\060\015\006\003\125\004\007\014\006\101\156\153\141\162 +\141\061\115\060\113\006\003\125\004\012\014\104\124\303\234\122 +\113\124\122\125\123\124\040\102\151\154\147\151\040\304\260\154 +\145\164\151\305\237\151\155\040\166\145\040\102\151\154\151\305 +\237\151\155\040\107\303\274\166\145\156\154\151\304\237\151\040 +\110\151\172\155\145\164\154\145\162\151\040\101\056\305\236\056 +\061\102\060\100\006\003\125\004\003\014\071\124\303\234\122\113 +\124\122\125\123\124\040\105\154\145\153\164\162\157\156\151\153 +\040\123\145\162\164\151\146\151\153\141\040\110\151\172\155\145 +\164\040\123\141\304\237\154\141\171\304\261\143\304\261\163\304 +\261\040\110\066 +END +CKA_SERIAL_NUMBER MULTILINE_OCTAL +\002\006\175\241\362\145\354\212 +END +CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_TRUSTED_DELEGATOR +CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_MUST_VERIFY_TRUST +CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_MUST_VERIFY_TRUST +CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE + +# +# Certificate "Certinomis - Root CA" +# +# Issuer: CN=Certinomis - Root CA,OU=0002 433998903,O=Certinomis,C=FR +# Serial Number: 1 (0x1) +# Subject: CN=Certinomis - Root CA,OU=0002 433998903,O=Certinomis,C=FR +# Not Valid Before: Mon Oct 21 09:17:18 2013 +# Not Valid After : Fri Oct 21 09:17:18 2033 +# Fingerprint (SHA-256): 2A:99:F5:BC:11:74:B7:3C:BB:1D:62:08:84:E0:1C:34:E5:1C:CB:39:78:DA:12:5F:0E:33:26:88:83:BF:41:58 +# Fingerprint (SHA1): 9D:70:BB:01:A5:A4:A0:18:11:2E:F7:1C:01:B9:32:C5:34:E7:88:A8 +CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE +CKA_TOKEN CK_BBOOL CK_TRUE +CKA_PRIVATE CK_BBOOL CK_FALSE +CKA_MODIFIABLE CK_BBOOL CK_FALSE +CKA_LABEL UTF8 "Certinomis - Root CA" +CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509 +CKA_SUBJECT MULTILINE_OCTAL +\060\132\061\013\060\011\006\003\125\004\006\023\002\106\122\061 +\023\060\021\006\003\125\004\012\023\012\103\145\162\164\151\156 +\157\155\151\163\061\027\060\025\006\003\125\004\013\023\016\060 +\060\060\062\040\064\063\063\071\071\070\071\060\063\061\035\060 +\033\006\003\125\004\003\023\024\103\145\162\164\151\156\157\155 +\151\163\040\055\040\122\157\157\164\040\103\101 +END +CKA_ID UTF8 "0" +CKA_ISSUER MULTILINE_OCTAL +\060\132\061\013\060\011\006\003\125\004\006\023\002\106\122\061 +\023\060\021\006\003\125\004\012\023\012\103\145\162\164\151\156 +\157\155\151\163\061\027\060\025\006\003\125\004\013\023\016\060 +\060\060\062\040\064\063\063\071\071\070\071\060\063\061\035\060 +\033\006\003\125\004\003\023\024\103\145\162\164\151\156\157\155 +\151\163\040\055\040\122\157\157\164\040\103\101 +END +CKA_SERIAL_NUMBER MULTILINE_OCTAL +\002\001\001 +END +CKA_VALUE MULTILINE_OCTAL +\060\202\005\222\060\202\003\172\240\003\002\001\002\002\001\001 +\060\015\006\011\052\206\110\206\367\015\001\001\013\005\000\060 +\132\061\013\060\011\006\003\125\004\006\023\002\106\122\061\023 +\060\021\006\003\125\004\012\023\012\103\145\162\164\151\156\157 +\155\151\163\061\027\060\025\006\003\125\004\013\023\016\060\060 +\060\062\040\064\063\063\071\071\070\071\060\063\061\035\060\033 +\006\003\125\004\003\023\024\103\145\162\164\151\156\157\155\151 +\163\040\055\040\122\157\157\164\040\103\101\060\036\027\015\061 +\063\061\060\062\061\060\071\061\067\061\070\132\027\015\063\063 +\061\060\062\061\060\071\061\067\061\070\132\060\132\061\013\060 +\011\006\003\125\004\006\023\002\106\122\061\023\060\021\006\003 +\125\004\012\023\012\103\145\162\164\151\156\157\155\151\163\061 +\027\060\025\006\003\125\004\013\023\016\060\060\060\062\040\064 +\063\063\071\071\070\071\060\063\061\035\060\033\006\003\125\004 +\003\023\024\103\145\162\164\151\156\157\155\151\163\040\055\040 +\122\157\157\164\040\103\101\060\202\002\042\060\015\006\011\052 +\206\110\206\367\015\001\001\001\005\000\003\202\002\017\000\060 +\202\002\012\002\202\002\001\000\324\314\011\012\054\077\222\366 +\177\024\236\013\234\232\152\035\100\060\144\375\252\337\016\036 +\006\133\237\120\205\352\315\215\253\103\147\336\260\372\176\200 +\226\236\204\170\222\110\326\343\071\356\316\344\131\130\227\345 +\056\047\230\352\223\250\167\233\112\360\357\164\200\055\353\060 +\037\265\331\307\200\234\142\047\221\210\360\112\211\335\334\210 +\346\024\371\325\003\057\377\225\333\275\237\354\054\372\024\025 +\131\225\012\306\107\174\151\030\271\247\003\371\312\166\251\317 +\307\157\264\136\005\376\356\301\122\262\165\062\207\354\355\051 +\146\073\363\112\026\202\366\326\232\333\162\230\351\336\360\305 +\114\245\253\265\352\001\342\214\056\144\177\144\157\375\243\045 +\223\213\310\242\016\111\215\064\360\037\354\130\105\056\064\252 +\204\120\275\347\262\112\023\270\260\017\256\070\135\260\251\033 +\346\163\311\132\241\331\146\100\252\251\115\246\064\002\255\204 +\176\262\043\301\373\052\306\147\364\064\266\260\225\152\063\117 +\161\104\265\255\300\171\063\210\340\277\355\243\240\024\264\234 +\011\260\012\343\140\276\370\370\146\210\315\133\361\167\005\340 +\265\163\156\301\175\106\056\216\113\047\246\315\065\012\375\345 +\115\175\252\052\243\051\307\132\150\004\350\345\326\223\244\142 +\302\305\346\364\117\306\371\237\032\215\202\111\031\212\312\131 +\103\072\350\015\062\301\364\114\023\003\157\156\246\077\221\163 +\313\312\163\157\022\040\213\356\300\202\170\336\113\056\302\111 +\303\035\355\026\366\044\364\047\033\134\127\061\334\125\356\250 +\036\157\154\254\342\105\314\127\127\212\165\127\031\340\265\130 +\231\111\066\061\074\063\001\155\026\112\315\270\052\203\204\206 +\233\371\140\322\037\155\221\003\323\140\246\325\075\232\335\167 +\220\075\065\244\237\017\136\365\122\104\151\271\300\272\334\317 +\175\337\174\331\304\254\206\042\062\274\173\153\221\357\172\370 +\027\150\260\342\123\125\140\055\257\076\302\203\330\331\011\053 +\360\300\144\333\207\213\221\314\221\353\004\375\166\264\225\232 +\346\024\006\033\325\064\035\276\330\377\164\034\123\205\231\340 +\131\122\112\141\355\210\236\153\111\211\106\176\040\132\331\347 +\112\345\152\356\322\145\021\103\002\003\001\000\001\243\143\060 +\141\060\016\006\003\125\035\017\001\001\377\004\004\003\002\001 +\006\060\017\006\003\125\035\023\001\001\377\004\005\060\003\001 +\001\377\060\035\006\003\125\035\016\004\026\004\024\357\221\114 +\365\245\303\060\350\057\010\352\323\161\042\244\222\150\170\164 +\331\060\037\006\003\125\035\043\004\030\060\026\200\024\357\221 +\114\365\245\303\060\350\057\010\352\323\161\042\244\222\150\170 +\164\331\060\015\006\011\052\206\110\206\367\015\001\001\013\005 +\000\003\202\002\001\000\176\075\124\332\042\135\032\130\076\073 +\124\047\272\272\314\310\343\032\152\352\076\371\022\353\126\137 +\075\120\316\340\352\110\046\046\317\171\126\176\221\034\231\077 +\320\241\221\034\054\017\117\230\225\131\123\275\320\042\330\210 +\135\234\067\374\373\144\301\170\214\213\232\140\011\352\325\372 +\041\137\320\164\145\347\120\305\277\056\271\013\013\255\265\260 +\027\246\022\214\324\142\170\352\126\152\354\012\322\100\303\074 +\005\060\076\115\224\267\237\112\003\323\175\047\113\266\376\104 +\316\372\031\063\032\155\244\102\321\335\314\310\310\327\026\122 +\203\117\065\224\263\022\125\175\345\342\102\353\344\234\223\011 +\300\114\133\007\253\307\155\021\240\120\027\224\043\250\265\012 +\222\017\262\172\301\140\054\070\314\032\246\133\377\362\014\343 +\252\037\034\334\270\240\223\047\336\143\343\177\041\237\072\345 +\236\372\340\023\152\165\353\226\134\142\221\224\216\147\123\266 +\211\370\022\011\313\157\122\133\003\162\206\120\225\010\324\215 +\207\206\025\037\225\044\330\244\157\232\316\244\235\233\155\322 +\262\166\006\206\306\126\010\305\353\011\332\066\302\033\133\101 +\276\141\052\343\160\346\270\246\370\266\132\304\275\041\367\377 +\252\137\241\154\166\071\146\326\352\114\125\341\000\063\233\023 +\230\143\311\157\320\001\040\011\067\122\347\014\117\076\315\274 +\365\137\226\047\247\040\002\225\340\056\350\007\101\005\037\025 +\156\326\260\344\031\340\017\002\223\000\047\162\305\213\321\124 +\037\135\112\303\100\227\176\125\246\174\301\063\004\024\001\035 +\111\040\151\013\031\223\235\156\130\042\367\100\014\106\014\043 +\143\363\071\322\177\166\121\247\364\310\241\361\014\166\042\043 +\106\122\051\055\342\243\101\007\126\151\230\322\005\011\274\151 +\307\132\141\315\217\201\140\025\115\200\335\220\342\175\304\120 +\362\214\073\156\112\307\306\346\200\053\074\201\274\021\200\026 +\020\047\327\360\315\077\171\314\163\052\303\176\123\221\326\156 +\370\365\363\307\320\121\115\216\113\245\133\346\031\027\073\326 +\201\011\334\042\334\356\216\271\304\217\123\341\147\273\063\270 +\210\025\106\317\355\151\065\377\165\015\106\363\316\161\341\305 +\153\206\102\006\271\101 +END + +# Trust for "Certinomis - Root CA" +# Issuer: CN=Certinomis - Root CA,OU=0002 433998903,O=Certinomis,C=FR +# Serial Number: 1 (0x1) +# Subject: CN=Certinomis - Root CA,OU=0002 433998903,O=Certinomis,C=FR +# Not Valid Before: Mon Oct 21 09:17:18 2013 +# Not Valid After : Fri Oct 21 09:17:18 2033 +# Fingerprint (SHA-256): 2A:99:F5:BC:11:74:B7:3C:BB:1D:62:08:84:E0:1C:34:E5:1C:CB:39:78:DA:12:5F:0E:33:26:88:83:BF:41:58 +# Fingerprint (SHA1): 9D:70:BB:01:A5:A4:A0:18:11:2E:F7:1C:01:B9:32:C5:34:E7:88:A8 +CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST +CKA_TOKEN CK_BBOOL CK_TRUE +CKA_PRIVATE CK_BBOOL CK_FALSE +CKA_MODIFIABLE CK_BBOOL CK_FALSE +CKA_LABEL UTF8 "Certinomis - Root CA" +CKA_CERT_SHA1_HASH MULTILINE_OCTAL +\235\160\273\001\245\244\240\030\021\056\367\034\001\271\062\305 +\064\347\210\250 +END +CKA_CERT_MD5_HASH MULTILINE_OCTAL +\024\012\375\215\250\050\265\070\151\333\126\176\141\042\003\077 +END +CKA_ISSUER MULTILINE_OCTAL +\060\132\061\013\060\011\006\003\125\004\006\023\002\106\122\061 +\023\060\021\006\003\125\004\012\023\012\103\145\162\164\151\156 +\157\155\151\163\061\027\060\025\006\003\125\004\013\023\016\060 +\060\060\062\040\064\063\063\071\071\070\071\060\063\061\035\060 +\033\006\003\125\004\003\023\024\103\145\162\164\151\156\157\155 +\151\163\040\055\040\122\157\157\164\040\103\101 +END +CKA_SERIAL_NUMBER MULTILINE_OCTAL +\002\001\001 +END +CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_TRUSTED_DELEGATOR +CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_MUST_VERIFY_TRUST +CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_MUST_VERIFY_TRUST +CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE + +# +# Certificate "OISTE WISeKey Global Root GB CA" +# +# Issuer: CN=OISTE WISeKey Global Root GB CA,OU=OISTE Foundation Endorsed,O=WISeKey,C=CH +# Serial Number:76:b1:20:52:74:f0:85:87:46:b3:f8:23:1a:f6:c2:c0 +# Subject: CN=OISTE WISeKey Global Root GB CA,OU=OISTE Foundation Endorsed,O=WISeKey,C=CH +# Not Valid Before: Mon Dec 01 15:00:32 2014 +# Not Valid After : Thu Dec 01 15:10:31 2039 +# Fingerprint (SHA-256): 6B:9C:08:E8:6E:B0:F7:67:CF:AD:65:CD:98:B6:21:49:E5:49:4A:67:F5:84:5E:7B:D1:ED:01:9F:27:B8:6B:D6 +# Fingerprint (SHA1): 0F:F9:40:76:18:D3:D7:6A:4B:98:F0:A8:35:9E:0C:FD:27:AC:CC:ED +CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE +CKA_TOKEN CK_BBOOL CK_TRUE +CKA_PRIVATE CK_BBOOL CK_FALSE +CKA_MODIFIABLE CK_BBOOL CK_FALSE +CKA_LABEL UTF8 "OISTE WISeKey Global Root GB CA" +CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509 +CKA_SUBJECT MULTILINE_OCTAL +\060\155\061\013\060\011\006\003\125\004\006\023\002\103\110\061 +\020\060\016\006\003\125\004\012\023\007\127\111\123\145\113\145 +\171\061\042\060\040\006\003\125\004\013\023\031\117\111\123\124 +\105\040\106\157\165\156\144\141\164\151\157\156\040\105\156\144 +\157\162\163\145\144\061\050\060\046\006\003\125\004\003\023\037 +\117\111\123\124\105\040\127\111\123\145\113\145\171\040\107\154 +\157\142\141\154\040\122\157\157\164\040\107\102\040\103\101 +END +CKA_ID UTF8 "0" +CKA_ISSUER MULTILINE_OCTAL +\060\155\061\013\060\011\006\003\125\004\006\023\002\103\110\061 +\020\060\016\006\003\125\004\012\023\007\127\111\123\145\113\145 +\171\061\042\060\040\006\003\125\004\013\023\031\117\111\123\124 +\105\040\106\157\165\156\144\141\164\151\157\156\040\105\156\144 +\157\162\163\145\144\061\050\060\046\006\003\125\004\003\023\037 +\117\111\123\124\105\040\127\111\123\145\113\145\171\040\107\154 +\157\142\141\154\040\122\157\157\164\040\107\102\040\103\101 +END +CKA_SERIAL_NUMBER MULTILINE_OCTAL +\002\020\166\261\040\122\164\360\205\207\106\263\370\043\032\366 +\302\300 +END +CKA_VALUE MULTILINE_OCTAL +\060\202\003\265\060\202\002\235\240\003\002\001\002\002\020\166 +\261\040\122\164\360\205\207\106\263\370\043\032\366\302\300\060 +\015\006\011\052\206\110\206\367\015\001\001\013\005\000\060\155 +\061\013\060\011\006\003\125\004\006\023\002\103\110\061\020\060 +\016\006\003\125\004\012\023\007\127\111\123\145\113\145\171\061 +\042\060\040\006\003\125\004\013\023\031\117\111\123\124\105\040 +\106\157\165\156\144\141\164\151\157\156\040\105\156\144\157\162 +\163\145\144\061\050\060\046\006\003\125\004\003\023\037\117\111 +\123\124\105\040\127\111\123\145\113\145\171\040\107\154\157\142 +\141\154\040\122\157\157\164\040\107\102\040\103\101\060\036\027 +\015\061\064\061\062\060\061\061\065\060\060\063\062\132\027\015 +\063\071\061\062\060\061\061\065\061\060\063\061\132\060\155\061 +\013\060\011\006\003\125\004\006\023\002\103\110\061\020\060\016 +\006\003\125\004\012\023\007\127\111\123\145\113\145\171\061\042 +\060\040\006\003\125\004\013\023\031\117\111\123\124\105\040\106 +\157\165\156\144\141\164\151\157\156\040\105\156\144\157\162\163 +\145\144\061\050\060\046\006\003\125\004\003\023\037\117\111\123 +\124\105\040\127\111\123\145\113\145\171\040\107\154\157\142\141 +\154\040\122\157\157\164\040\107\102\040\103\101\060\202\001\042 +\060\015\006\011\052\206\110\206\367\015\001\001\001\005\000\003 +\202\001\017\000\060\202\001\012\002\202\001\001\000\330\027\267 +\034\112\044\052\326\227\261\312\342\036\373\175\070\357\230\365 +\262\071\230\116\047\270\021\135\173\322\045\224\210\202\025\046 +\152\033\061\273\250\133\041\041\053\330\017\116\237\132\361\261 +\132\344\171\326\062\043\053\341\123\314\231\105\134\173\117\255 +\274\277\207\112\013\113\227\132\250\366\110\354\175\173\015\315 +\041\006\337\236\025\375\101\212\110\267\040\364\241\172\033\127 +\324\135\120\377\272\147\330\043\231\037\310\077\343\336\377\157 +\133\167\261\153\156\270\311\144\367\341\312\101\106\016\051\161 +\320\271\043\374\311\201\137\116\367\157\337\277\204\255\163\144 +\273\267\102\216\151\366\324\166\035\176\235\247\270\127\212\121 +\147\162\327\324\250\270\225\124\100\163\003\366\352\364\353\376 +\050\102\167\077\235\043\033\262\266\075\200\024\007\114\056\117 +\367\325\012\026\015\275\146\103\067\176\043\103\171\303\100\206 +\365\114\051\332\216\232\255\015\245\004\207\210\036\205\343\351 +\123\325\233\310\213\003\143\170\353\340\031\112\156\273\057\153 +\063\144\130\223\255\151\277\217\033\357\202\110\307\002\003\001 +\000\001\243\121\060\117\060\013\006\003\125\035\017\004\004\003 +\002\001\206\060\017\006\003\125\035\023\001\001\377\004\005\060 +\003\001\001\377\060\035\006\003\125\035\016\004\026\004\024\065 +\017\310\066\143\136\342\243\354\371\073\146\025\316\121\122\343 +\221\232\075\060\020\006\011\053\006\001\004\001\202\067\025\001 +\004\003\002\001\000\060\015\006\011\052\206\110\206\367\015\001 +\001\013\005\000\003\202\001\001\000\100\114\373\207\262\231\201 +\220\176\235\305\260\260\046\315\210\173\053\062\215\156\270\041 +\161\130\227\175\256\067\024\257\076\347\367\232\342\175\366\161 +\230\231\004\252\103\164\170\243\343\111\141\076\163\214\115\224 +\340\371\161\304\266\026\016\123\170\037\326\242\207\057\002\071 +\201\051\074\257\025\230\041\060\376\050\220\000\214\321\341\313 +\372\136\310\375\370\020\106\073\242\170\102\221\027\164\125\012 +\336\120\147\115\146\321\247\377\375\331\300\265\250\243\212\316 +\146\365\017\103\315\247\053\127\173\143\106\152\252\056\122\330 +\364\355\341\155\255\051\220\170\110\272\341\043\252\243\211\354 +\265\253\226\300\264\113\242\035\227\236\172\362\156\100\161\337 +\150\361\145\115\316\174\005\337\123\145\251\245\360\261\227\004 +\160\025\106\003\230\324\322\277\124\264\240\130\175\122\157\332 +\126\046\142\324\330\333\211\061\157\034\360\042\302\323\142\034 +\065\315\114\151\025\124\032\220\230\336\353\036\137\312\167\307 +\313\216\075\103\151\234\232\130\320\044\073\337\033\100\226\176 +\065\255\201\307\116\161\272\210\023 +END + +# Trust for "OISTE WISeKey Global Root GB CA" +# Issuer: CN=OISTE WISeKey Global Root GB CA,OU=OISTE Foundation Endorsed,O=WISeKey,C=CH +# Serial Number:76:b1:20:52:74:f0:85:87:46:b3:f8:23:1a:f6:c2:c0 +# Subject: CN=OISTE WISeKey Global Root GB CA,OU=OISTE Foundation Endorsed,O=WISeKey,C=CH +# Not Valid Before: Mon Dec 01 15:00:32 2014 +# Not Valid After : Thu Dec 01 15:10:31 2039 +# Fingerprint (SHA-256): 6B:9C:08:E8:6E:B0:F7:67:CF:AD:65:CD:98:B6:21:49:E5:49:4A:67:F5:84:5E:7B:D1:ED:01:9F:27:B8:6B:D6 +# Fingerprint (SHA1): 0F:F9:40:76:18:D3:D7:6A:4B:98:F0:A8:35:9E:0C:FD:27:AC:CC:ED +CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST +CKA_TOKEN CK_BBOOL CK_TRUE +CKA_PRIVATE CK_BBOOL CK_FALSE +CKA_MODIFIABLE CK_BBOOL CK_FALSE +CKA_LABEL UTF8 "OISTE WISeKey Global Root GB CA" +CKA_CERT_SHA1_HASH MULTILINE_OCTAL +\017\371\100\166\030\323\327\152\113\230\360\250\065\236\014\375 +\047\254\314\355 +END +CKA_CERT_MD5_HASH MULTILINE_OCTAL +\244\353\271\141\050\056\267\057\230\260\065\046\220\231\121\035 +END +CKA_ISSUER MULTILINE_OCTAL +\060\155\061\013\060\011\006\003\125\004\006\023\002\103\110\061 +\020\060\016\006\003\125\004\012\023\007\127\111\123\145\113\145 +\171\061\042\060\040\006\003\125\004\013\023\031\117\111\123\124 +\105\040\106\157\165\156\144\141\164\151\157\156\040\105\156\144 +\157\162\163\145\144\061\050\060\046\006\003\125\004\003\023\037 +\117\111\123\124\105\040\127\111\123\145\113\145\171\040\107\154 +\157\142\141\154\040\122\157\157\164\040\107\102\040\103\101 +END +CKA_SERIAL_NUMBER MULTILINE_OCTAL +\002\020\166\261\040\122\164\360\205\207\106\263\370\043\032\366 +\302\300 +END +CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_TRUSTED_DELEGATOR +CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_TRUSTED_DELEGATOR +CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_TRUSTED_DELEGATOR +CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE + +# +# Certificate "Certification Authority of WoSign G2" +# +# Issuer: CN=Certification Authority of WoSign G2,O=WoSign CA Limited,C=CN +# Serial Number:6b:25:da:8a:88:9d:7c:bc:0f:05:b3:b1:7a:61:45:44 +# Subject: CN=Certification Authority of WoSign G2,O=WoSign CA Limited,C=CN +# Not Valid Before: Sat Nov 08 00:58:58 2014 +# Not Valid After : Tue Nov 08 00:58:58 2044 +# Fingerprint (SHA-256): D4:87:A5:6F:83:B0:74:82:E8:5E:96:33:94:C1:EC:C2:C9:E5:1D:09:03:EE:94:6B:02:C3:01:58:1E:D9:9E:16 +# Fingerprint (SHA1): FB:ED:DC:90:65:B7:27:20:37:BC:55:0C:9C:56:DE:BB:F2:78:94:E1 +CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE +CKA_TOKEN CK_BBOOL CK_TRUE +CKA_PRIVATE CK_BBOOL CK_FALSE +CKA_MODIFIABLE CK_BBOOL CK_FALSE +CKA_LABEL UTF8 "Certification Authority of WoSign G2" +CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509 +CKA_SUBJECT MULTILINE_OCTAL +\060\130\061\013\060\011\006\003\125\004\006\023\002\103\116\061 +\032\060\030\006\003\125\004\012\023\021\127\157\123\151\147\156 +\040\103\101\040\114\151\155\151\164\145\144\061\055\060\053\006 +\003\125\004\003\023\044\103\145\162\164\151\146\151\143\141\164 +\151\157\156\040\101\165\164\150\157\162\151\164\171\040\157\146 +\040\127\157\123\151\147\156\040\107\062 +END +CKA_ID UTF8 "0" +CKA_ISSUER MULTILINE_OCTAL +\060\130\061\013\060\011\006\003\125\004\006\023\002\103\116\061 +\032\060\030\006\003\125\004\012\023\021\127\157\123\151\147\156 +\040\103\101\040\114\151\155\151\164\145\144\061\055\060\053\006 +\003\125\004\003\023\044\103\145\162\164\151\146\151\143\141\164 +\151\157\156\040\101\165\164\150\157\162\151\164\171\040\157\146 +\040\127\157\123\151\147\156\040\107\062 +END +CKA_SERIAL_NUMBER MULTILINE_OCTAL +\002\020\153\045\332\212\210\235\174\274\017\005\263\261\172\141 +\105\104 +END +CKA_VALUE MULTILINE_OCTAL +\060\202\003\174\060\202\002\144\240\003\002\001\002\002\020\153 +\045\332\212\210\235\174\274\017\005\263\261\172\141\105\104\060 +\015\006\011\052\206\110\206\367\015\001\001\013\005\000\060\130 +\061\013\060\011\006\003\125\004\006\023\002\103\116\061\032\060 +\030\006\003\125\004\012\023\021\127\157\123\151\147\156\040\103 +\101\040\114\151\155\151\164\145\144\061\055\060\053\006\003\125 +\004\003\023\044\103\145\162\164\151\146\151\143\141\164\151\157 +\156\040\101\165\164\150\157\162\151\164\171\040\157\146\040\127 +\157\123\151\147\156\040\107\062\060\036\027\015\061\064\061\061 +\060\070\060\060\065\070\065\070\132\027\015\064\064\061\061\060 +\070\060\060\065\070\065\070\132\060\130\061\013\060\011\006\003 +\125\004\006\023\002\103\116\061\032\060\030\006\003\125\004\012 +\023\021\127\157\123\151\147\156\040\103\101\040\114\151\155\151 +\164\145\144\061\055\060\053\006\003\125\004\003\023\044\103\145 +\162\164\151\146\151\143\141\164\151\157\156\040\101\165\164\150 +\157\162\151\164\171\040\157\146\040\127\157\123\151\147\156\040 +\107\062\060\202\001\042\060\015\006\011\052\206\110\206\367\015 +\001\001\001\005\000\003\202\001\017\000\060\202\001\012\002\202 +\001\001\000\276\305\304\240\042\200\111\117\277\331\207\021\306 +\123\341\273\017\275\140\177\257\366\202\016\037\334\260\216\075 +\227\340\120\074\217\072\357\146\073\105\007\233\040\370\343\327 +\045\206\065\220\026\242\135\157\060\031\010\207\013\177\006\262 +\235\142\217\336\257\222\245\140\324\053\200\232\122\077\365\232 +\203\351\064\132\313\331\325\142\134\346\016\340\337\006\230\016 +\200\174\312\264\035\023\210\153\016\250\044\167\003\320\356\133 +\363\312\151\221\065\071\126\305\155\343\367\075\117\136\223\070 +\044\312\030\351\044\313\222\003\335\314\034\075\011\160\344\040 +\344\361\256\254\273\163\151\243\143\072\017\105\017\241\112\232 +\302\321\143\254\313\020\370\075\346\116\050\267\353\304\225\261 +\254\375\136\253\372\101\313\135\235\113\334\364\174\166\357\147 +\177\000\172\215\322\240\032\134\115\042\341\265\332\335\166\263 +\324\166\337\136\270\213\230\310\024\124\314\153\027\222\267\340 +\112\277\111\224\141\013\070\220\217\135\044\154\045\173\073\171 +\331\342\176\235\255\237\230\241\006\374\170\024\140\127\370\356 +\200\167\261\002\003\001\000\001\243\102\060\100\060\016\006\003 +\125\035\017\001\001\377\004\004\003\002\001\006\060\017\006\003 +\125\035\023\001\001\377\004\005\060\003\001\001\377\060\035\006 +\003\125\035\016\004\026\004\024\372\140\251\353\145\305\335\026 +\024\010\116\014\017\215\233\340\367\144\257\147\060\015\006\011 +\052\206\110\206\367\015\001\001\013\005\000\003\202\001\001\000 +\127\303\172\066\202\234\215\230\342\253\100\252\107\217\307\247 +\133\355\174\347\075\146\132\073\061\273\337\363\026\063\221\374 +\174\173\245\302\246\146\343\252\260\267\047\230\077\111\327\140 +\147\147\077\066\117\112\313\361\024\372\132\207\050\034\355\217 +\101\062\306\225\371\175\332\275\173\133\302\260\041\343\217\106 +\334\041\070\103\164\114\373\060\370\027\162\301\062\374\310\221 +\027\304\314\130\067\116\013\314\132\367\041\065\050\203\154\140 +\055\104\353\122\214\120\075\265\154\022\327\372\011\273\154\262 +\112\261\305\211\344\374\323\122\330\141\027\376\172\224\204\217 +\171\266\063\131\272\017\304\013\342\160\240\113\170\056\372\310 +\237\375\257\221\145\012\170\070\025\345\227\027\024\335\371\340 +\054\064\370\070\320\204\042\000\300\024\121\030\053\002\334\060 +\132\360\350\001\174\065\072\043\257\010\344\257\252\216\050\102 +\111\056\360\365\231\064\276\355\017\113\030\341\322\044\074\273 +\135\107\267\041\362\215\321\012\231\216\343\156\076\255\160\340 +\217\271\312\314\156\201\061\366\173\234\172\171\344\147\161\030 +END + +# Trust for "Certification Authority of WoSign G2" +# Issuer: CN=Certification Authority of WoSign G2,O=WoSign CA Limited,C=CN +# Serial Number:6b:25:da:8a:88:9d:7c:bc:0f:05:b3:b1:7a:61:45:44 +# Subject: CN=Certification Authority of WoSign G2,O=WoSign CA Limited,C=CN +# Not Valid Before: Sat Nov 08 00:58:58 2014 +# Not Valid After : Tue Nov 08 00:58:58 2044 +# Fingerprint (SHA-256): D4:87:A5:6F:83:B0:74:82:E8:5E:96:33:94:C1:EC:C2:C9:E5:1D:09:03:EE:94:6B:02:C3:01:58:1E:D9:9E:16 +# Fingerprint (SHA1): FB:ED:DC:90:65:B7:27:20:37:BC:55:0C:9C:56:DE:BB:F2:78:94:E1 +CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST +CKA_TOKEN CK_BBOOL CK_TRUE +CKA_PRIVATE CK_BBOOL CK_FALSE +CKA_MODIFIABLE CK_BBOOL CK_FALSE +CKA_LABEL UTF8 "Certification Authority of WoSign G2" +CKA_CERT_SHA1_HASH MULTILINE_OCTAL +\373\355\334\220\145\267\047\040\067\274\125\014\234\126\336\273 +\362\170\224\341 +END +CKA_CERT_MD5_HASH MULTILINE_OCTAL +\310\034\175\031\252\313\161\223\362\120\370\122\250\036\272\140 +END +CKA_ISSUER MULTILINE_OCTAL +\060\130\061\013\060\011\006\003\125\004\006\023\002\103\116\061 +\032\060\030\006\003\125\004\012\023\021\127\157\123\151\147\156 +\040\103\101\040\114\151\155\151\164\145\144\061\055\060\053\006 +\003\125\004\003\023\044\103\145\162\164\151\146\151\143\141\164 +\151\157\156\040\101\165\164\150\157\162\151\164\171\040\157\146 +\040\127\157\123\151\147\156\040\107\062 +END +CKA_SERIAL_NUMBER MULTILINE_OCTAL +\002\020\153\045\332\212\210\235\174\274\017\005\263\261\172\141 +\105\104 +END +CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_TRUSTED_DELEGATOR +CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_TRUSTED_DELEGATOR +CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_TRUSTED_DELEGATOR +CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE + +# +# Certificate "CA WoSign ECC Root" +# +# Issuer: CN=CA WoSign ECC Root,O=WoSign CA Limited,C=CN +# Serial Number:68:4a:58:70:80:6b:f0:8f:02:fa:f6:de:e8:b0:90:90 +# Subject: CN=CA WoSign ECC Root,O=WoSign CA Limited,C=CN +# Not Valid Before: Sat Nov 08 00:58:58 2014 +# Not Valid After : Tue Nov 08 00:58:58 2044 +# Fingerprint (SHA-256): 8B:45:DA:1C:06:F7:91:EB:0C:AB:F2:6B:E5:88:F5:FB:23:16:5C:2E:61:4B:F8:85:56:2D:0D:CE:50:B2:9B:02 +# Fingerprint (SHA1): D2:7A:D2:BE:ED:94:C0:A1:3C:C7:25:21:EA:5D:71:BE:81:19:F3:2B +CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE +CKA_TOKEN CK_BBOOL CK_TRUE +CKA_PRIVATE CK_BBOOL CK_FALSE +CKA_MODIFIABLE CK_BBOOL CK_FALSE +CKA_LABEL UTF8 "CA WoSign ECC Root" +CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509 +CKA_SUBJECT MULTILINE_OCTAL +\060\106\061\013\060\011\006\003\125\004\006\023\002\103\116\061 +\032\060\030\006\003\125\004\012\023\021\127\157\123\151\147\156 +\040\103\101\040\114\151\155\151\164\145\144\061\033\060\031\006 +\003\125\004\003\023\022\103\101\040\127\157\123\151\147\156\040 +\105\103\103\040\122\157\157\164 +END +CKA_ID UTF8 "0" +CKA_ISSUER MULTILINE_OCTAL +\060\106\061\013\060\011\006\003\125\004\006\023\002\103\116\061 +\032\060\030\006\003\125\004\012\023\021\127\157\123\151\147\156 +\040\103\101\040\114\151\155\151\164\145\144\061\033\060\031\006 +\003\125\004\003\023\022\103\101\040\127\157\123\151\147\156\040 +\105\103\103\040\122\157\157\164 +END +CKA_SERIAL_NUMBER MULTILINE_OCTAL +\002\020\150\112\130\160\200\153\360\217\002\372\366\336\350\260 +\220\220 +END +CKA_VALUE MULTILINE_OCTAL +\060\202\002\011\060\202\001\217\240\003\002\001\002\002\020\150 +\112\130\160\200\153\360\217\002\372\366\336\350\260\220\220\060 +\012\006\010\052\206\110\316\075\004\003\003\060\106\061\013\060 +\011\006\003\125\004\006\023\002\103\116\061\032\060\030\006\003 +\125\004\012\023\021\127\157\123\151\147\156\040\103\101\040\114 +\151\155\151\164\145\144\061\033\060\031\006\003\125\004\003\023 +\022\103\101\040\127\157\123\151\147\156\040\105\103\103\040\122 +\157\157\164\060\036\027\015\061\064\061\061\060\070\060\060\065 +\070\065\070\132\027\015\064\064\061\061\060\070\060\060\065\070 +\065\070\132\060\106\061\013\060\011\006\003\125\004\006\023\002 +\103\116\061\032\060\030\006\003\125\004\012\023\021\127\157\123 +\151\147\156\040\103\101\040\114\151\155\151\164\145\144\061\033 +\060\031\006\003\125\004\003\023\022\103\101\040\127\157\123\151 +\147\156\040\105\103\103\040\122\157\157\164\060\166\060\020\006 +\007\052\206\110\316\075\002\001\006\005\053\201\004\000\042\003 +\142\000\004\341\375\216\270\103\044\253\226\173\205\302\272\013 +\255\215\340\072\343\044\271\322\261\276\210\072\312\277\112\270 +\371\357\054\057\257\121\120\074\107\165\154\370\224\267\233\374 +\050\036\305\124\314\143\235\026\113\123\301\347\040\253\315\254 +\045\322\177\217\302\301\132\202\136\060\213\172\124\316\003\265 +\221\177\252\224\320\321\212\110\314\202\005\046\241\325\121\022 +\326\173\066\243\102\060\100\060\016\006\003\125\035\017\001\001 +\377\004\004\003\002\001\006\060\017\006\003\125\035\023\001\001 +\377\004\005\060\003\001\001\377\060\035\006\003\125\035\016\004 +\026\004\024\252\375\325\132\243\366\207\213\062\205\375\321\062 +\133\200\105\223\363\003\270\060\012\006\010\052\206\110\316\075 +\004\003\003\003\150\000\060\145\002\061\000\344\244\204\260\201 +\325\075\260\164\254\224\244\350\016\075\000\164\114\241\227\153 +\371\015\121\074\241\331\073\364\015\253\251\237\276\116\162\312 +\205\324\331\354\265\062\105\030\157\253\255\002\060\175\307\367 +\151\143\057\241\341\230\357\023\020\321\171\077\321\376\352\073 +\177\336\126\364\220\261\025\021\330\262\042\025\320\057\303\046 +\056\153\361\221\262\220\145\364\232\346\220\356\112 +END + +# Trust for "CA WoSign ECC Root" +# Issuer: CN=CA WoSign ECC Root,O=WoSign CA Limited,C=CN +# Serial Number:68:4a:58:70:80:6b:f0:8f:02:fa:f6:de:e8:b0:90:90 +# Subject: CN=CA WoSign ECC Root,O=WoSign CA Limited,C=CN +# Not Valid Before: Sat Nov 08 00:58:58 2014 +# Not Valid After : Tue Nov 08 00:58:58 2044 +# Fingerprint (SHA-256): 8B:45:DA:1C:06:F7:91:EB:0C:AB:F2:6B:E5:88:F5:FB:23:16:5C:2E:61:4B:F8:85:56:2D:0D:CE:50:B2:9B:02 +# Fingerprint (SHA1): D2:7A:D2:BE:ED:94:C0:A1:3C:C7:25:21:EA:5D:71:BE:81:19:F3:2B +CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST +CKA_TOKEN CK_BBOOL CK_TRUE +CKA_PRIVATE CK_BBOOL CK_FALSE +CKA_MODIFIABLE CK_BBOOL CK_FALSE +CKA_LABEL UTF8 "CA WoSign ECC Root" +CKA_CERT_SHA1_HASH MULTILINE_OCTAL +\322\172\322\276\355\224\300\241\074\307\045\041\352\135\161\276 +\201\031\363\053 +END +CKA_CERT_MD5_HASH MULTILINE_OCTAL +\200\306\123\356\141\202\050\162\360\377\041\271\027\312\262\040 +END +CKA_ISSUER MULTILINE_OCTAL +\060\106\061\013\060\011\006\003\125\004\006\023\002\103\116\061 +\032\060\030\006\003\125\004\012\023\021\127\157\123\151\147\156 +\040\103\101\040\114\151\155\151\164\145\144\061\033\060\031\006 +\003\125\004\003\023\022\103\101\040\127\157\123\151\147\156\040 +\105\103\103\040\122\157\157\164 +END +CKA_SERIAL_NUMBER MULTILINE_OCTAL +\002\020\150\112\130\160\200\153\360\217\002\372\366\336\350\260 +\220\220 +END +CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_TRUSTED_DELEGATOR +CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_TRUSTED_DELEGATOR +CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_TRUSTED_DELEGATOR +CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE diff --git a/tools/cpplint.py b/tools/cpplint.py index 4c4f577b34c9d7..a66c1cb193ac47 100644 --- a/tools/cpplint.py +++ b/tools/cpplint.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2.4 +#!/usr/bin/env python # # Copyright (c) 2009 Google Inc. All rights reserved. # @@ -88,7 +88,8 @@ import string import sys import unicodedata - +import logging +logger = logging.getLogger('testrunner') _USAGE = """ Syntax: cpplint.py [--verbose=#] [--output=vs7] [--filter=-x,+y,...] @@ -139,6 +140,9 @@ the top-level categories like 'build' and 'whitespace' will also be printed. If 'detailed' is provided, then a count is provided for each category like 'build/class'. + + logfile=filename + Write TAP output to a logfile. """ # We categorize each error message we print. Here are the categories. @@ -195,6 +199,7 @@ 'whitespace/comments', 'whitespace/end_of_line', 'whitespace/ending_newline', + 'whitespace/if-one-line', 'whitespace/indent', 'whitespace/labels', 'whitespace/line_length', @@ -541,6 +546,11 @@ def SetFilters(self, filters): raise ValueError('Every filter in --filters must start with + or -' ' (%s does not)' % filt) + def setOutputFile(self, filename): + """attempts to create a file which we write output to.""" + fh = logging.FileHandler(filename, mode='wb') + logger.addHandler(fh) + def ResetErrorCounts(self): """Sets the module's error statistic back to zero.""" self.error_count = 0 @@ -558,10 +568,11 @@ def IncrementErrorCount(self, category): def PrintErrorCounts(self): """Print a summary of errors by category, and the total.""" - for category, count in self.errors_by_category.iteritems(): - sys.stderr.write('Category \'%s\' errors found: %d\n' % - (category, count)) - sys.stderr.write('Total errors found: %d\n' % self.error_count) + if not _cpplint_state.output_format == 'tap': + for category, count in self.errors_by_category.iteritems(): + sys.stderr.write('Category \'%s\' errors found: %d\n' % + (category, count)) + sys.stderr.write('Total errors found: %d\n' % self.error_count) _cpplint_state = _CppLintState() @@ -608,6 +619,9 @@ def _SetFilters(filters): """ _cpplint_state.SetFilters(filters) +def _setOutputFile(filename): + _cpplint_state.setOutputFile(filename) + class _FunctionState(object): """Tracks current function name and the number of lines in its body.""" @@ -786,6 +800,15 @@ def Error(filename, linenum, category, confidence, message): if _cpplint_state.output_format == 'vs7': sys.stderr.write('%s(%s): %s [%s] [%d]\n' % ( filename, linenum, message, category, confidence)) + elif _cpplint_state.output_format == 'tap': + template = ('not ok %s\n' + ' ---\n' + ' message: %s\n' + ' data:\n' + ' line: %d\n' + ' ruleId: %s\n' + ' ...') + logger.info(template % (filename, message, linenum, category)) else: sys.stderr.write('%s:%s: %s [%s] [%d]\n' % ( filename, linenum, message, category, confidence)) @@ -2069,7 +2092,7 @@ def CheckStyle(filename, clean_lines, linenum, file_extension, error): initial_spaces += 1 if line and line[-1].isspace(): error(filename, linenum, 'whitespace/end_of_line', 4, - 'Line ends in whitespace. Consider deleting these extra spaces.') + 'Line ends in whitespace. Consider deleting these extra spaces.') # There are certain situations we allow one space, notably for labels elif ((initial_spaces == 1 or initial_spaces == 3) and not Match(r'\s*\w+\s*:\s*$', cleansed_line)): @@ -3002,8 +3025,6 @@ def ProcessFile(filename, vlevel): 'One or more unexpected \\r (^M) found;' 'better to use only a \\n') - sys.stderr.write('Done processing %s\n' % filename) - def PrintUsage(message): """Prints a brief usage string and exits, optionally with an error message. @@ -3041,7 +3062,8 @@ def ParseArguments(args): try: (opts, filenames) = getopt.getopt(args, '', ['help', 'output=', 'verbose=', 'counting=', - 'filter=']) + 'filter=', + 'logfile=']) except getopt.GetoptError: PrintUsage('Invalid arguments.') @@ -3049,13 +3071,14 @@ def ParseArguments(args): output_format = _OutputFormat() filters = '' counting_style = '' + output_filename = '' for (opt, val) in opts: if opt == '--help': PrintUsage(None) elif opt == '--output': - if not val in ('emacs', 'vs7'): - PrintUsage('The only allowed output formats are emacs and vs7.') + if not val in ('emacs', 'vs7', 'tap'): + PrintUsage('The only allowed output formats are emacs, vs7 and tap.') output_format = val elif opt == '--verbose': verbosity = int(val) @@ -3067,6 +3090,8 @@ def ParseArguments(args): if val not in ('total', 'toplevel', 'detailed'): PrintUsage('Valid counting options are total, toplevel, and detailed') counting_style = val + elif opt == '--logfile': + output_filename = val if not filenames: PrintUsage('No files were specified.') @@ -3075,6 +3100,8 @@ def ParseArguments(args): _SetVerboseLevel(verbosity) _SetFilters(filters) _SetCountingStyle(counting_style) + if output_filename: + _setOutputFile(output_filename) return filenames @@ -3089,6 +3116,14 @@ def main(): codecs.getwriter('utf8'), 'replace') + + ch = logging.StreamHandler(sys.stdout) + logger.addHandler(ch) + logger.setLevel(logging.INFO) + + if _cpplint_state.output_format == 'tap': + logger.info('TAP version 13') + _cpplint_state.ResetErrorCounts() for filename in filenames: ProcessFile(filename, _cpplint_state.verbose_level) diff --git a/tools/create_android_makefiles b/tools/create_android_makefiles new file mode 100755 index 00000000000000..abf2ecf083c307 --- /dev/null +++ b/tools/create_android_makefiles @@ -0,0 +1,46 @@ +#!/bin/bash +# Run this script ONLY inside an Android build system +# and after you ran lunch command! + +if [ -z "$ANDROID_BUILD_TOP" ]; then + echo "Run lunch before running this script!" + exit 1 +fi + +if [ -z "$1" ]; then + ARCH="arm" +else + ARCH="$1" +fi + +if [ $ARCH = "x86" ]; then + TARGET_ARCH="ia32" +else + TARGET_ARCH="$ARCH" +fi + +cd $(dirname $0)/.. + +./configure \ + --without-snapshot \ + --openssl-no-asm \ + --dest-cpu=$TARGET_ARCH \ + --dest-os=android + +export GYP_GENERATORS="android" +export GYP_GENERATOR_FLAGS="limit_to_target_all=true" +GYP_DEFINES="target_arch=$TARGET_ARCH" +GYP_DEFINES+=" v8_target_arch=$TARGET_ARCH" +GYP_DEFINES+=" android_target_arch=$ARCH" +GYP_DEFINES+=" host_os=linux OS=android" +export GYP_DEFINES + +./deps/npm/node_modules/node-gyp/gyp/gyp \ + -Icommon.gypi \ + -Iconfig.gypi \ + --depth=. \ + -Dcomponent=static_library \ + -Dlibrary=static_library \ + node.gyp + +echo -e "LOCAL_PATH := \$(call my-dir)\n\ninclude \$(LOCAL_PATH)/GypAndroid.mk" > Android.mk diff --git a/tools/create_expfile.sh b/tools/create_expfile.sh new file mode 100755 index 00000000000000..ff4420a9e87218 --- /dev/null +++ b/tools/create_expfile.sh @@ -0,0 +1,48 @@ +#!/bin/sh +# This script writes out all the exported symbols to a file +# AIX needs this as sybmols are not exported by an +# executable by default and we need to list +# them specifically in order to export them +# so that they can be used by native add-ons +# +# The raw symbol data is objtained by using nm on +# the .a files which make up the node executable +# +# -Xany makes sure we get symbols on both +# 32 bit and 64 bit as by default we'd only get those +# for 32 bit +# +# -g selects only exported symbols +# +# -C, -B and -p ensure the output is in a format we +# can easily parse and convert into the symbol we need +# +# -C suppresses the demangling of C++ names +# -B gives us output in BSD format +# -p displays the info in a standard portable output format +# +# We only include symbols if they are of the +# following types and don't start with a dot. +# +# T - Global text symbol +# D - Global data symbol +# B - Gobal bss symbol. +# +# the final sort allows us to remove any duplicates +# +# We need to exclude gtest libraries as they are not +# linked into the node executable +# +echo "Searching $1 to write out expfile to $2" + +# this special sequence must be at the start of the exp file +echo "#!." > $2 + +# pull the symbols from the .a files +find $1 -name "*.a" | grep -v gtest \ + | xargs nm -Xany -BCpg \ + | awk '{ + if ((($2 == "T") || ($2 == "D") || ($2 == "B")) && + (substr($3,1,1) != ".")) { print $3 } + }' \ + | sort -u >> $2 diff --git a/tools/doc/README.md b/tools/doc/README.md index 67ff2e1df510b2..fd041f001e6931 100644 --- a/tools/doc/README.md +++ b/tools/doc/README.md @@ -1,6 +1,6 @@ Here's how the node docs work. -1:1 relationship from `lib/.js` to `doc/api/.markdown` +1:1 relationship from `lib/.js` to `doc/api/.md` Each type of heading has a description block. @@ -69,28 +69,3 @@ Each type of heading has a description block. * Events have (list of arguments, description) * Methods have (list of arguments, description) * Properties have (type, description) - -## Stability ratings: 0-5 - -These can show up below any section heading, and apply to that section. - -0 - Deprecated. This feature is known to be problematic, and changes are -planned. Do not rely on it. Use of the feature may cause warnings. Backwards -compatibility should not be expected. - -1 - Experimental. This feature was introduced recently, and may change -or be removed in future versions. Please try it out and provide feedback. -If it addresses a use-case that is important to you, tell the node core team. - -2 - Unstable. The API is in the process of settling, but has not yet had -sufficient real-world testing to be considered stable. Backwards-compatibility -will be maintained if reasonable. - -3 - Stable. The API has proven satisfactory, but cleanup in the underlying -code may cause minor changes. Backwards-compatibility is guaranteed. - -4 - API Frozen. This API has been tested extensively in production and is -unlikely to ever have to change. - -5 - Locked. Unless serious bugs are found, this code will not ever -change. Please do not suggest changes in this area, they will be refused. diff --git a/tools/doc/addon-verify.js b/tools/doc/addon-verify.js index 4d1aaab3cc75a6..a6dca436383231 100644 --- a/tools/doc/addon-verify.js +++ b/tools/doc/addon-verify.js @@ -1,31 +1,36 @@ -var fs = require('fs'); -var path = require('path'); -var marked = require('marked'); +'use strict'; -var doc = path.resolve(__dirname, '..', '..', 'doc', 'api', 'addons.markdown'); -var verifyDir = path.resolve(__dirname, '..', '..', 'test', 'addons'); +const fs = require('fs'); +const path = require('path'); +const marked = require('marked'); -var contents = fs.readFileSync(doc).toString(); +const rootDir = path.resolve(__dirname, '..', '..'); +const doc = path.resolve(rootDir, 'doc', 'api', 'addons.md'); +const verifyDir = path.resolve(rootDir, 'test', 'addons'); -var tokens = marked.lexer(contents, {}); -var files = null; -var id = 0; +const contents = fs.readFileSync(doc).toString(); + +const tokens = marked.lexer(contents, {}); +let files = null; +let id = 0; // Just to make sure that all examples will be processed tokens.push({ type: 'heading' }); var oldDirs = fs.readdirSync(verifyDir); oldDirs = oldDirs.filter(function(dir) { - return /^doc-/.test(dir); + return /^\d{2}_/.test(dir); }).map(function(dir) { return path.resolve(verifyDir, dir); }); for (var i = 0; i < tokens.length; i++) { var token = tokens[i]; - if (token.type === 'heading') { + if (token.type === 'heading' && token.text) { + const blockName = token.text; if (files && Object.keys(files).length !== 0) { verifyFiles(files, + blockName, console.log.bind(null, 'wrote'), function(err) { if (err) throw err; }); } @@ -48,16 +53,36 @@ function once(fn) { }; } -function verifyFiles(files, onprogress, ondone) { - var dir = path.resolve(verifyDir, 'doc-' + id++); +function verifyFiles(files, blockName, onprogress, ondone) { + // must have a .cc and a .js to be a valid test + if (!Object.keys(files).some((name) => /\.cc$/.test(name)) || + !Object.keys(files).some((name) => /\.js$/.test(name))) { + return; + } + + blockName = blockName + .toLowerCase() + .replace(/\s/g, '_') + .replace(/[^a-z\d_]/g, ''); + const dir = path.resolve( + verifyDir, + `${(++id < 10 ? '0' : '') + id}_${blockName}` + ); files = Object.keys(files).map(function(name) { + if (name === 'test.js') { + files[name] = `'use strict'; +require('../../common'); +${files[name]} +`; + } return { path: path.resolve(dir, name), name: name, content: files[name] }; }); + files.push({ path: path.resolve(dir, 'binding.gyp'), content: JSON.stringify({ diff --git a/tools/doc/generate.js b/tools/doc/generate.js index 7e47f4b0c2abb5..ff14cbd5e8979b 100644 --- a/tools/doc/generate.js +++ b/tools/doc/generate.js @@ -1,7 +1,7 @@ +'use strict'; + var processIncludes = require('./preprocess.js'); -var marked = require('marked'); var fs = require('fs'); -var path = require('path'); // parse the args. // Don't use nopt or whatever for this. It's simple enough. @@ -11,7 +11,7 @@ var format = 'json'; var template = null; var inputFile = null; -args.forEach(function (arg) { +args.forEach(function(arg) { if (!arg.match(/^\-\-/)) { inputFile = arg; } else if (arg.match(/^\-\-format=/)) { @@ -19,7 +19,7 @@ args.forEach(function (arg) { } else if (arg.match(/^\-\-template=/)) { template = arg.replace(/^\-\-template=/, ''); } -}) +}); if (!inputFile) { @@ -35,8 +35,6 @@ fs.readFile(inputFile, 'utf8', function(er, input) { }); - - function next(er, input) { if (er) throw er; switch (format) { diff --git a/tools/doc/html.js b/tools/doc/html.js index 9877fb4d3cd4f7..99a8cbf21a014b 100644 --- a/tools/doc/html.js +++ b/tools/doc/html.js @@ -1,12 +1,22 @@ +'use strict'; + var fs = require('fs'); var marked = require('marked'); var path = require('path'); var preprocess = require('./preprocess.js'); +var typeParser = require('./type-parser.js'); module.exports = toHTML; // TODO(chrisdickinson): never stop vomitting / fix this. -var gtocPath = path.resolve(path.join(__dirname, '..', '..', 'doc', 'api', '_toc.markdown')); +var gtocPath = path.resolve(path.join( + __dirname, + '..', + '..', + 'doc', + 'api', + '_toc.md' +)); var gtocLoading = null; var gtocData = null; @@ -55,15 +65,19 @@ function loadGtoc(cb) { } function toID(filename) { - return filename.replace('.html', '').replace(/[^\w\-]/g, '-').replace(/-+/g, '-'); + return filename + .replace('.html', '') + .replace(/[^\w\-]/g, '-') + .replace(/-+/g, '-'); } function render(lexed, filename, template, cb) { // get the section var section = getSection(lexed); - filename = path.basename(filename, '.markdown'); + filename = path.basename(filename, '.md'); + parseText(lexed); lexed = parseLists(lexed); // generate the table of contents. @@ -85,13 +99,23 @@ function render(lexed, filename, template, cb) { // content has to be the last thing we do with // the lexed tokens, because it's destructive. - content = marked.parser(lexed); + const content = marked.parser(lexed); template = template.replace(/__CONTENT__/g, content); cb(null, template); }); } +// handle general body-text replacements +// for example, link man page references to the actual page +function parseText(lexed) { + lexed.forEach(function(tok) { + if (tok.text && tok.type !== 'code') { + tok.text = linkManPages(tok.text); + tok.text = linkJsTypeDocs(tok.text); + } + }); +} // just update the list item text in-place. // lists that come right after a heading are what we're after. @@ -106,7 +130,8 @@ function parseLists(input) { output.push({ type: 'html', text: tok.text }); return; } - if (state === null) { + if (state === null || + (state === 'AFTERHEADING' && tok.type === 'heading')) { if (tok.type === 'heading') { state = 'AFTERHEADING'; } @@ -135,16 +160,13 @@ function parseLists(input) { } if (tok.type === 'list_end') { depth--; + output.push(tok); if (depth === 0) { state = null; output.push({ type:'html', text: '' }); } - output.push(tok); return; } - if (tok.text) { - tok.text = parseListItem(tok.text); - } } output.push(tok); }); @@ -153,12 +175,40 @@ function parseLists(input) { } -function parseListItem(text) { +// Syscalls which appear in the docs, but which only exist in BSD / OSX +var BSD_ONLY_SYSCALLS = new Set(['lchmod']); + +// Handle references to man pages, eg "open(2)" or "lchmod(2)" +// Returns modified text, with such refs replace with HTML links, for example +// 'open(2)' +function linkManPages(text) { + return text.replace(/ ([a-z]+)\((\d)\)/gm, function(match, name, number) { + // name consists of lowercase letters, number is a single digit + var displayAs = name + '(' + number + ')'; + if (BSD_ONLY_SYSCALLS.has(name)) { + return ' ' + displayAs + ''; + } else { + return ' ' + displayAs + ''; + } + }); +} + +function linkJsTypeDocs(text) { var parts = text.split('`'); var i; + var typeMatches; + // Handle types, for example the source Markdown might say + // "This argument should be a {Number} or {String}" for (i = 0; i < parts.length; i += 2) { - parts[i] = parts[i].replace(/\{([^\}]+)\}/, '$1'); + typeMatches = parts[i].match(/\{([^\}]+)\}/g); + if (typeMatches) { + typeMatches.forEach(function(typeMatch) { + parts[i] = parts[i].replace(typeMatch, typeParser.toLink(typeMatch)); + }); + } } //XXX maybe put more stuff here? @@ -166,14 +216,15 @@ function parseListItem(text) { } function parseAPIHeader(text) { - text = text.replace(/(.*:)\s(\d)([\s\S]*)/, - '
      $1 $2$3
      '); + text = text.replace( + /(.*:)\s(\d)([\s\S]*)/, + '
      $1 $2$3
      ' + ); return text; } // section is just the first heading function getSection(lexed) { - var section = ''; for (var i = 0, l = lexed.length; i < l; i++) { var tok = lexed[i]; if (tok.type === 'heading') return tok.text; @@ -183,7 +234,6 @@ function getSection(lexed) { function buildToc(lexed, filename, cb) { - var indent = 0; var toc = []; var depth = 0; lexed.forEach(function(tok) { @@ -219,4 +269,3 @@ function getId(text) { } return text; } - diff --git a/tools/doc/json.js b/tools/doc/json.js index 4c57aefd797eba..3d08026daaabd8 100644 --- a/tools/doc/json.js +++ b/tools/doc/json.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = doJSON; // Take the lexed input, and return a JSON-encoded object @@ -12,7 +14,7 @@ function doJSON(input, filename, cb) { var current = root; var state = null; var lexed = marked.lexer(input); - lexed.forEach(function (tok) { + lexed.forEach(function(tok) { var type = tok.type; var text = tok.text; @@ -31,7 +33,7 @@ function doJSON(input, filename, cb) { if (type === 'heading' && !text.trim().match(/^example/i)) { if (tok.depth - depth > 1) { - return cb(new Error('Inappropriate heading level\n'+ + return cb(new Error('Inappropriate heading level\n' + JSON.stringify(tok))); } @@ -77,7 +79,7 @@ function doJSON(input, filename, cb) { // // If one of these isnt' found, then anything that comes between // here and the next heading should be parsed as the desc. - var stability + var stability; if (state === 'AFTERHEADING') { if (type === 'code' && (stability = text.match(/^Stability: ([0-5])(?:\s*-\s*)?(.*)$/))) { @@ -125,7 +127,7 @@ function doJSON(input, filename, cb) { finishSection(current, stack[stack.length - 1]); } - return cb(null, root) + return cb(null, root); } @@ -146,7 +148,7 @@ function doJSON(input, filename, cb) { // { type: 'list_item_end' }, // { type: 'list_item_start' }, // { type: 'text', -// text: 'silent: Boolean, whether or not to send output to parent\'s stdio.' }, +// text: 'silent: Boolean, whether to send output to parent\'s stdio.' }, // { type: 'text', text: 'Default: `false`' }, // { type: 'space' }, // { type: 'list_item_end' }, @@ -168,7 +170,7 @@ function doJSON(input, filename, cb) { // desc: 'string arguments passed to worker.' }, // { name: 'silent', // type: 'boolean', -// desc: 'whether or not to send output to parent\'s stdio.', +// desc: 'whether to send output to parent\'s stdio.', // default: 'false' } ] } ] function processList(section) { @@ -181,15 +183,14 @@ function processList(section) { list.forEach(function(tok) { var type = tok.type; if (type === 'space') return; - if (type === 'list_item_start') { + if (type === 'list_item_start' || type === 'loose_item_start') { + var n = {}; if (!current) { - var n = {}; values.push(n); current = n; } else { current.options = current.options || []; stack.push(current); - var n = {}; current.options.push(n); current = n; } @@ -231,7 +232,7 @@ function processList(section) { // each item is an argument, unless the name is 'return', // in which case it's the return value. section.signatures = section.signatures || []; - var sig = {} + var sig = {}; section.signatures.push(sig); sig.params = values.filter(function(v) { if (v.name === 'return') { @@ -248,7 +249,7 @@ function processList(section) { // copy the data up to the section. var value = values[0] || {}; delete value.name; - section.typeof = value.type; + section.typeof = value.type || section.typeof; delete value.type; Object.keys(value).forEach(function(k) { section[k] = value[k]; @@ -259,6 +260,14 @@ function processList(section) { // event: each item is an argument. section.params = values; break; + + default: + if (section.list.length > 0) { + section.desc = section.desc || []; + for (var i = 0; i < section.list.length; i++) { + section.desc.push(section.list[i]); + } + } } // section.listParsed = values; @@ -271,21 +280,30 @@ function parseSignature(text, sig) { var params = text.match(paramExpr); if (!params) return; params = params[1]; - // the [ is irrelevant. ] indicates optionalness. - params = params.replace(/\[/g, ''); - params = params.split(/,/) + params = params.split(/,/); + var optionalLevel = 0; + var optionalCharDict = {'[': 1, ' ': 0, ']': -1}; params.forEach(function(p, i, _) { p = p.trim(); if (!p) return; var param = sig.params[i]; var optional = false; var def; - // [foo] -> optional - if (p.charAt(p.length - 1) === ']') { - optional = true; - p = p.substr(0, p.length - 1); - p = p.trim(); + + // for grouped optional params such as someMethod(a[, b[, c]]) + var pos; + for (pos = 0; pos < p.length; pos++) { + if (optionalCharDict[p[pos]] === undefined) { break; } + optionalLevel += optionalCharDict[p[pos]]; + } + p = p.substring(pos); + optional = (optionalLevel > 0); + for (pos = p.length - 1; pos >= 0; pos--) { + if (optionalCharDict[p[pos]] === undefined) { break; } + optionalLevel += optionalCharDict[p[pos]]; } + p = p.substring(0, pos + 1); + var eq = p.indexOf('='); if (eq !== -1) { def = p.substr(eq + 1); @@ -362,7 +380,7 @@ function parseListItem(item) { function finishSection(section, parent) { if (!section || !parent) { - throw new Error('Invalid finishSection call\n'+ + throw new Error('Invalid finishSection call\n' + JSON.stringify(section) + '\n' + JSON.stringify(parent)); } @@ -405,7 +423,7 @@ function finishSection(section, parent) { // properties are a bit special. // their "type" is the type of object, not "property" if (section.properties) { - section.properties.forEach(function (p) { + section.properties.forEach(function(p) { if (p.typeof) p.type = p.typeof; else delete p.type; delete p.typeof; @@ -476,14 +494,14 @@ function deepCopy(src, dest) { function deepCopy_(src) { if (!src) return src; if (Array.isArray(src)) { - var c = new Array(src.length); + const c = new Array(src.length); src.forEach(function(v, i) { c[i] = deepCopy_(v); }); return c; } if (typeof src === 'object') { - var c = {}; + const c = {}; Object.keys(src).forEach(function(k) { c[k] = deepCopy_(src[k]); }); @@ -502,7 +520,7 @@ var classMethExpr = /^class\s*method\s*:?[^\.]+\.([^ \.\(\)]+)\([^\)]*\)\s*?$/i; var methExpr = /^(?:method:?\s*)?(?:[^\.]+\.)?([^ \.\(\)]+)\([^\)]*\)\s*?$/i; -var newExpr = /^new ([A-Z][a-z]+)\([^\)]*\)\s*?$/; +var newExpr = /^new ([A-Z][a-zA-Z]+)\([^\)]*\)\s*?$/; var paramExpr = /\((.*)\);?$/; function newSection(tok) { diff --git a/tools/doc/preprocess.js b/tools/doc/preprocess.js index 7ace95a0ad0186..295737a2a53aee 100644 --- a/tools/doc/preprocess.js +++ b/tools/doc/preprocess.js @@ -1,3 +1,5 @@ +'use strict'; + module.exports = preprocess; var path = require('path'); @@ -8,7 +10,7 @@ var includeData = {}; function preprocess(inputFile, input, cb) { input = stripComments(input); - processIncludes(inputFile, input, function (err, data) { + processIncludes(inputFile, input, function(err, data) { if (err) return cb(err); cb(null, data); @@ -28,7 +30,7 @@ function processIncludes(inputFile, input, cb) { if (incCount === 0) cb(null, input); includes.forEach(function(include) { var fname = include.replace(/^@include\s+/, ''); - if (!fname.match(/\.markdown$/)) fname += '.markdown'; + if (!fname.match(/\.md$/)) fname += '.md'; if (includeData.hasOwnProperty(fname)) { input = input.split(include).join(includeData[fname]); @@ -47,7 +49,7 @@ function processIncludes(inputFile, input, cb) { if (er) return cb(errState = er); incCount--; includeData[fname] = inc; - input = input.split(include+'\n').join(includeData[fname]+'\n'); + input = input.split(include + '\n').join(includeData[fname] + '\n'); if (incCount === 0) { return cb(null, input); } diff --git a/tools/doc/type-parser.js b/tools/doc/type-parser.js new file mode 100644 index 00000000000000..a5698892b8e4f9 --- /dev/null +++ b/tools/doc/type-parser.js @@ -0,0 +1,60 @@ +'use strict'; +const nodeDocUrl = ''; +const jsDocUrl = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/' + + 'Reference/Global_Objects/'; +const jsPrimitiveUrl = 'https://developer.mozilla.org/en-US/docs/Web/' + + 'JavaScript/Data_structures'; +const jsPrimitives = [ + 'Number', 'String', 'Boolean', 'Null', 'Symbol' +]; +const jsGlobalTypes = [ + 'Error', 'Object', 'Function', 'Array', 'Uint8Array', + 'Uint16Array', 'Uint32Array', 'Int8Array', 'Int16Array', 'Int32Array', + 'Uint8ClampedArray', 'Float32Array', 'Float64Array', 'Date', 'RegExp', + 'ArrayBuffer', 'DataView', 'Promise', 'EvalError', 'RangeError', + 'ReferenceError', 'SyntaxError', 'TypeError', 'URIError' +]; +const typeMap = { + 'Buffer': 'buffer.html#buffer_class_buffer', + 'Handle': 'net.html#net_server_listen_handle_backlog_callback', + 'Stream': 'stream.html#stream_stream', + 'stream.Writable': 'stream.html#stream_class_stream_writable', + 'stream.Readable': 'stream.html#stream_class_stream_readable', + 'ChildProcess': 'child_process.html#child_process_class_childprocess', + 'cluster.Worker': 'cluster.html#cluster_class_worker', + 'dgram.Socket': 'dgram.html#dgram_class_dgram_socket', + 'net.Socket': 'net.html#net_class_net_socket', + 'EventEmitter': 'events.html#events_class_events_eventemitter', + 'Timer': 'timers.html#timers_timers' +}; + +module.exports = { + toLink: function(typeInput) { + const typeLinks = []; + typeInput = typeInput.replace('{', '').replace('}', ''); + const typeTexts = typeInput.split('|'); + + typeTexts.forEach(function(typeText) { + typeText = typeText.trim(); + if (typeText) { + let typeUrl = null; + if (jsPrimitives.indexOf(typeText) !== -1) { + typeUrl = jsPrimitiveUrl + '#' + typeText + '_type'; + } else if (jsGlobalTypes.indexOf(typeText) !== -1) { + typeUrl = jsDocUrl + typeText; + } else if (typeMap[typeText]) { + typeUrl = nodeDocUrl + typeMap[typeText]; + } + + if (typeUrl) { + typeLinks.push('<' + + typeText + '>'); + } else { + typeLinks.push('<' + typeText + '>'); + } + } + }); + + return typeLinks.length ? typeLinks.join(' | ') : typeInput; + } +}; diff --git a/tools/eslint-rules/align-multiline-assignment.js b/tools/eslint-rules/align-multiline-assignment.js new file mode 100644 index 00000000000000..8e2f5ed1ee7e90 --- /dev/null +++ b/tools/eslint-rules/align-multiline-assignment.js @@ -0,0 +1,67 @@ +/** + * @fileoverview Align multiline variable assignments + * @author Rich Trott + */ +'use strict'; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ +function getBinaryExpressionStarts(binaryExpression, starts) { + function getStartsFromOneSide(side, starts) { + starts.push(side.loc.start); + if (side.type === 'BinaryExpression') { + starts = getBinaryExpressionStarts(side, starts); + } + return starts; + } + + starts = getStartsFromOneSide(binaryExpression.left, starts); + starts = getStartsFromOneSide(binaryExpression.right, starts); + return starts; +} + +function checkExpressionAlignment(expression) { + if (!expression) + return; + + var msg = ''; + + switch (expression.type) { + case 'BinaryExpression': + var starts = getBinaryExpressionStarts(expression, []); + var startLine = starts[0].line; + const startColumn = starts[0].column; + starts.forEach((loc) => { + if (loc.line > startLine) { + startLine = loc.line; + if (loc.column !== startColumn) { + msg = 'Misaligned multiline assignment'; + } + } + }); + break; + } + return msg; +} + +function testAssignment(context, node) { + const msg = checkExpressionAlignment(node.right); + if (msg) + context.report(node, msg); +} + +function testDeclaration(context, node) { + node.declarations.forEach((declaration) => { + const msg = checkExpressionAlignment(declaration.init); + if (msg) + context.report(node, msg); + }); +} + +module.exports = function(context) { + return { + 'AssignmentExpression': (node) => testAssignment(context, node), + 'VariableDeclaration': (node) => testDeclaration(context, node) + }; +}; diff --git a/tools/eslint-rules/assert-fail-single-argument.js b/tools/eslint-rules/assert-fail-single-argument.js new file mode 100644 index 00000000000000..4ce790238181cc --- /dev/null +++ b/tools/eslint-rules/assert-fail-single-argument.js @@ -0,0 +1,30 @@ +/** + * @fileoverview Prohibit use of a single argument only in `assert.fail()`. It + * is almost always an error. + * @author Rich Trott + */ +'use strict'; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +const msg = 'assert.fail() message should be third argument'; + +function isAssert(node) { + return node.callee.object && node.callee.object.name === 'assert'; +} + +function isFail(node) { + return node.callee.property && node.callee.property.name === 'fail'; +} + +module.exports = function(context) { + return { + 'CallExpression': function(node) { + if (isAssert(node) && isFail(node) && node.arguments.length === 1) { + context.report(node, msg); + } + } + }; +}; diff --git a/tools/eslint-rules/new-with-error.js b/tools/eslint-rules/new-with-error.js new file mode 100644 index 00000000000000..655f34bf080956 --- /dev/null +++ b/tools/eslint-rules/new-with-error.js @@ -0,0 +1,31 @@ +/** + * @fileoverview Require `throw new Error()` rather than `throw Error()` + * @author Rich Trott + */ +'use strict'; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + + var errorList = context.options.length !== 0 ? context.options : ['Error']; + + return { + 'ThrowStatement': function(node) { + if (node.argument.type === 'CallExpression' && + errorList.indexOf(node.argument.callee.name) !== -1) { + context.report(node, 'Use new keyword when throwing.'); + } + } + }; +}; + +module.exports.schema = { + 'type': 'array', + 'additionalItems': { + 'type': 'string' + }, + 'uniqueItems': true +}; diff --git a/tools/eslint-rules/require-buffer.js b/tools/eslint-rules/require-buffer.js index 4fec765d7e9a18..c9818cb758f7bd 100644 --- a/tools/eslint-rules/require-buffer.js +++ b/tools/eslint-rules/require-buffer.js @@ -1,16 +1,19 @@ 'use strict'; -const msg = 'Use const Buffer = require(\'buffer\').Buffer; ' + - 'at the beginning of this file'; - module.exports = function(context) { + function flagIt(reference) { + const msg = 'Use const Buffer = require(\'buffer\').Buffer; ' + + 'at the beginning of this file'; + context.report(reference.identifier, msg); + } + return { 'Program:exit': function() { - context.getScope().through.forEach(function(ref) { - if (ref.identifier.name === 'Buffer') { - context.report(ref.identifier, msg); - } - }); + const globalScope = context.getScope(); + const variable = globalScope.set.get('Buffer'); + if (variable) { + variable.references.forEach(flagIt); + } } }; }; diff --git a/tools/eslint-rules/required-modules.js b/tools/eslint-rules/required-modules.js index 647726bf9a2424..3e4a8e8aadfc82 100644 --- a/tools/eslint-rules/required-modules.js +++ b/tools/eslint-rules/required-modules.js @@ -92,11 +92,6 @@ module.exports = function(context) { module.exports.schema = { 'type': 'array', - 'items': [ - { - 'enum': [0, 1, 2] - } - ], 'additionalItems': { 'type': 'string' }, diff --git a/tools/eslint/CHANGELOG.md b/tools/eslint/CHANGELOG.md new file mode 100644 index 00000000000000..9454793b4245da --- /dev/null +++ b/tools/eslint/CHANGELOG.md @@ -0,0 +1,2892 @@ +v2.7.0 - April 4, 2016 + +* 134cb1f Revert "Update: adds nestedBinaryExpressions for no-extra-parens rule (fixes #3065)" (Ilya Volodin) +* 7e80867 Docs: Update sentence in fixable rules (Mark Pedrotti) +* 1b6d5a3 Update: adds nestedBinaryExpressions for no-extra-parens (fixes #3065) (Nick Fisher) +* 4f93c32 Docs: Clarify `array-bracket-spacing` with newlines (fixes #5768) (alberto) +* 161ddac Fix: remove `console.dir` (fixes #5770) (Toru Nagashima) +* 0c33f6a Fix: indent rule uses wrong node for class indent level (fixes #5764) (Paul O’Shannessy) + +v2.6.0 - April 1, 2016 + +* ce2accd Fix: vars-on-top now accepts exported variables (fixes #5711) (Olmo Kramer) +* 7aacba7 Update: Deprecate option `maximum` in favor of `max` (fixes #5685) (Vitor Balocco) +* 5fe6fca Fix: no-useless-escape \B regex escape (fixes #5750) (Onur Temizkan) +* 9b73ffd Update: `destructuring` option of `prefer-const` rule (fixes #5594) (Toru Nagashima) +* 8ac9206 Docs: Typo in `sort-imports` (alberto) +* 12902c5 Fix: valid-jsdoc crash w/ Field & Array Type (fixes #5745) (fixes #5746) (Burak Yigit Kaya) +* 2c8b65a Docs: Edit examples for a few rules (Mark Pedrotti) +* d736bc2 Fix: Treat SwitchCase like a block in lines-around-comment (fixes #5718) (Scott O'Hara) +* 24a61a4 Update: make `no-useless-escape` allowing line breaks (fixes #5689) (Toru Nagashima) +* 4ecd45e Fix: Ensure proper lookup of config files (fixes #5175, fixes #5468) (Nicholas C. Zakas) +* 088e26b Fix: Update doctrine to allow hyphens in JSDoc names (fixes #5612) (Kai Cataldo) +* 692fd5d Upgrade: Old Chalk.JS deprecated method (fixes #5716) (Morris Singer) +* f59d91d Update: no-param-reassign error msgs (fixes #5705) (Isaac Levy) +* c1b16cd Fix: Object spread throws error in key-spacing rule. (fixes #5724) (Ziad El Khoury Hanna) +* 3091613 Docs: Correct explanation about properties (James Monger) +* cb0f0be Fix: Lint issue with `valid-jsdoc` rule (refs #5188) (Gyandeep Singh) +* aba1954 Build: Ignore jsdoc folder internally (fixes #5714) (alberto) +* a35f127 Fix: Lint for eslint project in regards to vars (refs #5188) (Gyandeep Singh) +* d9ab4f0 Fix: Windows scoped package configs (fixes #5644) (Nicholas C. Zakas) +* 8d0cd0d Update: Basic valid-jsdoc default parameter support (fixes #5658) (Tom Andrews) + +v2.5.3 - March 28, 2016 + +* 8749ac5 Build: Disable bundling dependencies (fixes #5687) (Nicholas C. Zakas) + +v2.5.2 - March 28, 2016 + +* 1cc7f8e Docs: Remove mention of minimatch for .eslintignore (Ian VanSchooten) +* 5bd69a9 Docs: Reorder FAQ in README (alberto) +* 98e6bd9 Fix: Correct default for indentation in `eslint --init` (fixes #5698) (alberto) +* 679095e Fix: make the default of `options.cwd` in runtime (fixes #5694) (Toru Nagashima) +* 4f06f2f Docs: Distinguish examples in rules under Best Practices part 2 (Mark Pedrotti) +* 013a18e Build: Fix bundling script (fixes #5680) (Nicholas C. Zakas) +* 8c5d954 Docs: Typo fix (István Donkó) +* 09659d6 Docs: Use string severity (Kenneth Williams) +* a4ae769 Docs: Manual changelog update for v2.5.1 (Nicholas C. Zakas) +* c41fab9 Fix: don't use path.extname with undefined value (fixes #5678) (Myles Borins) + +v2.5.1 - March 25, 2016 + +* Build: No functional changes, just republished with a working package. + +v2.5.0 - March 25, 2016 + +* 7021aa9 Fix: lines-around-comment in ESLint repo, part 2 (refs #5188) (Kevin Partington) +* 095c435 Docs: Remove ES2016 from experimental section of README (Kevin Partington) +* 646f863 Build: Bundle dependencies in package.json (fixes #5013) (Nicholas C. Zakas) +* ea06868 Docs: Clarify --ext does not apply to globs (fixes #5452) (Ian VanSchooten) +* 569c478 Build: Fix phantomjs CI problems (fixes #5666) (alberto) +* 6022426 Docs: Add link to chat room in README primary links (alberto) +* 2fbb530 Docs: Add link to "Proposing a Rule Change" in README (alberto) +* 25bf491 Upgrade: globals 9.x (fixes #5668) (Toru Nagashima) +* d6f8409 New: Rule - No useless escape (fixes #5460) (Onur Temizkan) +* 12a43f1 Docs: remove brace expansion from configuring.md (refs #5314) (Jonathan Haines) +* 92d1749 New: max-statements-per-line (fixes #5424) (Kenneth Williams) +* aaf324a Fix: missing support for json sub configs (fixes #5413) (Noam Okman) +* 48ad5fe Update: Add 'caughtErrors' to rule no-unused-vars (fixes #3837) (vamshi) +* ad90c2b Fix: incorrect config message (fixes #5653) (s0ph1e) +* a551831 Docs: Distinguish examples in rules under Node.js and CommonJS (Mark Pedrotti) +* 83cd651 Upgrade: chai to 3.5.0 (fixes #5647) (alberto) +* 32748dc Fix: `radix` rule false positive at shadowed variables (fixes #5639) (Toru Nagashima) +* 66db38d Fix: `--no-ignore` should not un-ignore default ignores (fixes #5547) (alberto) +* e3e06f3 Docs: Distinguish examples in rules under Best Practices part 4 (Mark Pedrotti) +* a9f0865 Docs: Update no-sequences rule docs for clarity (fixes #5536) (Kai Cataldo) +* bae7b30 Docs: Add michaelficarra as committer (alberto) +* e2990e7 Docs: Consistent wording in rules README (alberto) +* 49b4d2a Docs: Update team list with new members (Ilya Volodin) +* d0ae66c Update: Allow autoconfiguration for JSX code (fixes #5511) (Ian VanSchooten) +* 38a0a64 Docs: Clarify `linebreak-style` docs (fixes #5628) (alberto) +* 4b7305e Fix: Allow default ignored files to be unignored (fixes #5410) (Ian VanSchooten) +* 4b05ce6 Update: Enforce repo coding conventions via ESLint (refs #5188) (Kevin Partington) +* 051b255 Docs: Remove or rewrite references to former ecmaFeatures (Mark Pedrotti) +* 9a22625 Fix: `prefer-const` false positive at non-blocked if (fixes #5610) (Toru Nagashima) +* b1fd482 Fix: leading comments added from previous node (fixes #5531) (Kai Cataldo) +* c335650 Docs: correct the no-confusing-arrow docs (Daniel Norman) +* e94b77d Fix: Respect 'ignoreTrailingComments' in max-len rule (fixes #5563) (Vamshi Krishna) +* 9289ef8 Fix: handle personal package.json without config (fixes #5496) (Denny Christochowitz) +* 87d74b2 Fix: `prefer-const` got to not change scopes (refs #5284) (Toru Nagashima) +* 5a881e7 Docs: Fix typo in code snippet for no-unmodified-loop-condition rule (Chris Rebert) +* 03037c2 Update: Overrides for space-unary-ops (fixes #5060) (Afnan Fahim) +* 24d986a Update: replace MD5 hashing of cache files with MurmurHash (fixes #5522) (Michael Ficarra) +* f405030 Fix: Ensure allowing `await` as a property name (fixes #5564) (Toru Nagashima) +* aefc90c Fix: `no-useless-constructor` clash (fixes #5573) (Toru Nagashima) +* 9eaa20d Docs: Fix typo in CLI help message (ryym) +* a7c3e67 Docs: Invalid json in `configuring.md` (alberto) +* 4e50332 Docs: Make `prefer-template` examples consistent. (alberto) +* cfc14a9 Fix: valid-jsdoc correctly checks type union (fixes #5260) (Kai Cataldo) +* 689cb7d Fix: `quote-props` false positive on certain keys (fixes #5532) (Burak Yigit Kaya) +* 167a03a Fix: `brace-style` erroneously ignoring certain errors (fixes #5197) (Burak Yigit Kaya) +* 3133f28 Fix: object-curly-spacing doesn't know types (fixes #5537) (fixes #5538) (Burak Yigit Kaya) +* d0ca171 Docs: Separate parser and config questions in issue template (Kevin Partington) +* bc769ca Fix: Improve file path resolution (fixes #5314) (Ian VanSchooten) +* 9ca8567 Docs: Distinguish examples in rules under Best Practices part 3 (Mark Pedrotti) +* b9c69f1 Docs: Distinguish examples in rules under Variables part 2 (Mark Pedrotti) +* c289414 New: `no-duplicate-imports` rule (fixes #3478) (Simen Bekkhus) + +v2.4.0 - March 11, 2016 + +* 97b2466 Fix: estraverse/escope to work with unknowns (fixes #5476) (Nicholas C. Zakas) +* 641b3f7 Fix: validate the type of severity level (fixes #5499) (Shinnosuke Watanabe) +* 9ee8869 Docs: no-unused-expressions - add more edge unusable and usable examples (Brett Zamir) +* 56bf864 Docs: Create parity between no-sequences examples (Brett Zamir) +* 13ef1c7 New: add `--parser-options` to CLI (fixes #5495) (Jordan Harband) +* ae1ee54 Docs: fix func-style arrow exception option (Craig Martin) +* 91852fd Docs: no-lone-blocks - show non-problematic (and problematic) label (Brett Zamir) +* b34458f Docs: Rearrange rules for better categories (and improve rule summaries) (Brett Zamir) +* 1198b26 Docs: Minor README clarifications (Brett Zamir) +* 03e6869 Fix: newline-before-return: bug with comment (fixes #5480) (mustafa) +* ad100fd Fix: overindent in VariableDeclarator parens or brackets (fixes #5492) (David Greenspan) +* 9b8e04b Docs: Replace all node references to Node.js which is the official name (Brett Zamir) +* cc1f2f0 Docs: Minor fixes in no-new-func (Brett Zamir) +* 6ab81d4 Docs: Distinguish examples in rules under Best Practices part 1 (Mark Pedrotti) +* 9c6c70c Update: add `allowParens` option to `no-confusing-arrow` (fixes #5332) (Burak Yigit Kaya) +* 979c096 Docs: Document linebreak-style as fixable. (Afnan Fahim) +* 9f18a81 Fix: Ignore destructuring assignment in `object-shorthand` (fixes #5488) (alberto) +* 5d9a798 Docs: README.md, prefer-const; change modified to reassigned (Michiel de Bruijne) +* 38eb7f1 Fix: key-spacing checks ObjectExpression is multiline (fixes #5479) (Kevin Partington) +* 9592c45 Fix: `no-unmodified-loop-condition` false positive (fixes #5445) (Toru Nagashima) + +v2.3.0 - March 4, 2016 + +* 1b2c6e0 Update: Proposed no-magic-numbers option: ignoreJSXNumbers (fixes #5348) (Brandon Beeks) +* 63c0b7d Docs: Fix incorrect environment ref. in Rules in Plugins. (fixes #5421) (Jesse McCarthy) +* 124c447 Build: Add additional linebreak to docs (fixes #5464) (Ilya Volodin) +* 0d3831b Docs: Add RuleTester parserOptions migration steps (Kevin Partington) +* 50f4d5a Fix: extends chain (fixes #5411) (Toru Nagashima) +* 0547072 Update: Replace getLast() with lodash.last() (fixes #5456) (Jordan Eldredge) +* 8c29946 Docs: Distinguish examples in rules under Possible Errors part 1 (Mark Pedrotti) +* 5319b4a Docs: Distinguish examples in rules under Possible Errors part 2 (Mark Pedrotti) +* 1da2420 Fix: crash when SourceCode object was reused (fixes #5007) (Toru Nagashima) +* 9e9daab New: newline-before-return rule (fixes #5009) (Kai Cataldo) +* e1bbe45 Fix: Check space after anonymous generator star (fixes #5435) (alberto) +* 119e0ed Docs: Distinguish examples in rules under Variables (Mark Pedrotti) +* 905c049 Fix: `no-undef` false positive at new.target (fixes #5420) (Toru Nagashima) +* 4a67b9a Update: Add ES7 support (fixes #5401) (Brandon Mills) +* 89c757d Docs: Replace ecmaFeatures with parserOptions in working-with-rules (Kevin Partington) +* 804c08e Docs: Add parserOptions to RuleTester section of working-with-rules (Kevin Partington) +* 1982c50 Docs: Document string option for `no-unused-vars`. (alberto) +* 4f82b2b Update: Support classes in `padded-blocks` (fixes #5092) (alberto) +* ed5564f Docs: Specify results of `no-unused-var` with `args` (fixes #5334) (chinesedfan) +* de0a4ef Fix: `getFormatter` throws an error when called as static (fixes #5378) (cowchimp) +* 78f7ca9 Fix: Prevent crash from swallowing console.log (fixes #5381) (Ian VanSchooten) +* 34b648d Fix: remove tests which have invalid syntax (fixes #5405) (Toru Nagashima) +* 7de5ae4 Docs: Missing allow option in docs (Scott O'Hara) +* cf14c71 Fix: `no-useless-constructor` rule crashes sometimes (fixes #5290) (Burak Yigit Kaya) +* 70e3a02 Update: Allow string severity in config (fixes #3626) (Nicholas C. Zakas) +* 13c7c19 Update: Exclude ES5 constructors from consistent-return (fixes #5379) (Kevin Locke) +* 784d3bf Fix: Location info in `dot-notation` rule (fixes #5397) (Gyandeep Singh) +* 6280b2d Update: Support switch statements in padded-blocks (fixes #5056) (alberto) +* 25a5b2c Fix: Allow irregular whitespace in comments (fixes #5368) (Christophe Porteneuve) +* 560c0d9 New: no-restricted-globals rule implementation (fixes #3966) (Benoît Zugmeyer) +* c5bb478 Fix: `constructor-super` false positive after a loop (fixes #5394) (Toru Nagashima) +* 6c0c4aa Docs: Add Issue template (fixes #5313) (Kai Cataldo) +* 1170e67 Fix: indent rule doesn't handle constructor instantiation (fixes #5384) (Nate Cavanaugh) +* 6bc9932 Fix: Avoid magic numbers in rule options (fixes #4182) (Brandon Beeks) +* 694e1c1 Fix: Add tests to cover default magic number tests (fixes #5385) (Brandon Beeks) +* 0b5349d Fix: .eslintignore paths should be absolute (fixes #5362) (alberto) +* 8f6c2e7 Update: Better error message for plugins (refs #5221) (Nicholas C. Zakas) +* 972d41b Update: Improve error message for rule-tester (fixes #5369) (Jeroen Engels) +* fe3f6bd Fix: `no-self-assign` false positive at shorthand (fixes #5371) (Toru Nagashima) +* 2376291 Docs: Missing space in `no-fallthrough` doc. (alberto) +* 5aedb87 Docs: Add mysticatea as reviewer (Nicholas C. Zakas) +* 1f9fd10 Update: no-invalid-regexp allows custom flags (fixes #5249) (Afnan Fahim) +* f1eab9b Fix: Support for dash and slash in `valid-jsdoc` (fixes #1598) (Gyandeep Singh) +* cd12a4b Fix:`newline-per-chained-call` should only warn on methods (fixes #5289) (Burak Yigit Kaya) +* 0d1377d Docs: Add missing `symbol` type into valid list (Plusb Preco) +* 6aa2380 Update: prefer-const; change modified to reassigned (fixes #5350) (Michiel de Bruijne) +* d1d62c6 Fix: indent check for else keyword with Stroustrup style (fixes #5218) (Gyandeep Singh) +* 7932f78 Build: Fix commit message validation (fixes #5340) (Nicholas C. Zakas) +* 1c347f5 Fix: Cleanup temp files from tests (fixes #5338) (Nick) +* 2f3e1ae Build: Change rules to warnings in perf test (fixes #5330) (Brandon Mills) +* 36f40c2 Docs: Achieve consistent order of h2 in rule pages (Mark Pedrotti) + +v2.2.0 - February 19, 2016 + +* 45a22b5 Docs: remove esprima-fb from suggested parsers (Henry Zhu) +* a4d9cd3 Docs: Fix semi rule typo (Brandon Mills) +* 9d005c0 Docs: Correct option name in `no-implicit-coercion` rule (Neil Kistner) +* 2977248 Fix: Do not cache `.eslintrc.js` (fixes #5067) (Nick) +* 211eb8f Fix: no-multi-spaces conflicts with smart tabs (fixes #2077) (Afnan Fahim) +* 6dc9483 Fix: Crash in `constructor-super` (fixes #5319) (Burak Yigit Kaya) +* 3f48875 Docs: Fix yield star spacing examples (Dmitriy Lazarev) +* 4dab76e Docs: Update `preferType` heading to keep code format (fixes #5307) (chinesedfan) +* 7020b82 Fix: `sort-imports` warned between default and members (fixes #5305) (Toru Nagashima) +* 2f4cd1c Fix: `constructor-super` and `no-this-before-super` false (fixes #5261) (Toru Nagashima) +* 59e9c5b New: eslint-disable-next-line (fixes #5206) (Kai Cataldo) +* afb6708 Fix: `indent` rule forgot about some CallExpressions (fixes #5295) (Burak Yigit Kaya) +* d18d406 Docs: Update PR creation bot message (fixes #5268) (Nicholas C. Zakas) +* 0b1cd19 Fix: Ignore parser option if set to default parser (fixes #5241) (Kai Cataldo) + +v2.1.0 - February 15, 2016 + +* 7981ef5 Build: Fix release script (Nicholas C. Zakas) +* c9c34ea Fix: Skip computed members in `newline-per-chained-call` (fixes #5245) (Burak Yigit Kaya) +* b32ddad Build: `npm run perf` command should check the exit code (fixes #5279) (Burak Yigit Kaya) +* 6580d1c Docs: Fix incorrect `api.verify` JSDoc for `config` param (refs #5104) (Burak Yigit Kaya) +* 1f47868 Docs: Update yield-star-spacing documentation for 2.0.0 (fixes #5272) (Burak Yigit Kaya) +* 29da8aa Fix: `newline-after-var` crash on a switch statement (fixes #5277) (Toru Nagashima) +* 86c5a20 Fix: `func-style` should ignore ExportDefaultDeclarations (fixes #5183) (Burak Yigit Kaya) +* ba287aa Fix: Consolidate try/catches to top levels (fixes #5243) (Ian VanSchooten) +* 3ef5da1 Docs: Update no-magic-numbers#ignorearrayindexes. (KazuakiM) +* 0d6850e Update: Allow var declaration at end of block (fixes #5246) (alberto) +* c1e3a73 Fix: Popular style init handles missing package.json keys (refs #5243) (Brandon Mills) +* 68c6e22 Docs: fix default value of `keyword-spacing`'s overrides option. (Toru Nagashima) +* 00fe46f Upgrade: inquirer (fixes #5265) (Bogdan Chadkin) +* ef729d7 Docs: Remove option that is not being used in max-len rule (Thanos Lefteris) +* 4a5ddd5 Docs: Fix rule config above examples for require-jsdoc (Thanos Lefteris) +* c5cbc1b Docs: Add rule config above each example in jsx-quotes (Thanos Lefteris) +* f0aceba Docs: Correct alphabetical ordering in rule list (Randy Coulman) +* 1651ffa Docs: update migrating to 2.0.0 (fixes #5232) (Toru Nagashima) +* 9078537 Fix: `indent` on variable declaration with separate array (fixes #5237) (Burak Yigit Kaya) +* f8868b2 Docs: Typo fix in consistent-this rule doc fixes #5240 (Nicolas Froidure) +* 44f6915 Fix: ESLint Bot mentions the wrong person for extra info (fixes #5229) (Burak Yigit Kaya) +* c612a8e Fix: `no-empty-function` crash (fixes #5227) (Toru Nagashima) +* ae663b6 Docs: Add links for issue documentation (Nicholas C. Zakas) +* 717bede Build: Switch to using eslint-release (fixes #5223) (Nicholas C. Zakas) +* 980e139 Fix: Combine all answers for processAnswers (fixes #5220) (Ian VanSchooten) +* 1f2a1d5 Docs: Remove inline errors from doc examples (fixes #4104) (Burak Yigit Kaya) + +v2.0.0 - February 12, 2016 + +* cc3a66b Docs: Issue message when more info is needed (Nicholas C. Zakas) +* 2bc40fa Docs: Simplify hierarchy of headings in rule pages (Mark Pedrotti) +* 1666254 Docs: Add note about only-whitespace rule for `--fix` (fixes #4774) (Burak Yigit Kaya) +* 2fa09d2 Docs: Add `quotes` to related section of `prefer-template` (fixes #5192) (Burak Yigit Kaya) +* 7b12995 Fix: `key-spacing` not enforcing no-space in minimum mode (fixes #5008) (Burak Yigit Kaya) +* c1c4f4d Breaking: new `no-empty-function` rule (fixes #5161) (Toru Nagashima) + +v2.0.0-rc.1 - February 9, 2016 + +* 4dad82a Update: Adding shared environment for node and browser (refs #5196) (Eli White) +* b46c893 Fix: Config file relative paths (fixes #5164, fixes #5160) (Nicholas C. Zakas) +* aa5b2ac Fix: no-whitespace-before-property fixes (fixes #5167) (Kai Cataldo) +* 4e99924 Update: Replace several dependencies with lodash (fixes #5012) (Gajus Kuizinas) +* 718dc68 Docs: Remove periods in rules' README for consistency. (alberto) +* 7a47085 Docs: Correct `arrow-spacing` overview. (alberto) +* a4cde1b Docs: Clarify global-require inside try/catch (fixes #3834) (Brandon Mills) +* fd07925 Docs: Clarify docs for api.verify (fixes #5101, fixes #5104) (Burak Yigit Kaya) +* 413247f New: Add a --print-config flag (fixes #5099) (Christopher Crouzet) +* efeef42 Update: Implement auto fix for space-in-parens (fixes #5050) (alberto) +* e07fdd4 Fix: code path analysis and labels (fixes #5171) (Toru Nagashima) +* 2417bb2 Fix: `no-unmodified-loop-condition` false positive (fixes #5166) (Toru Nagashima) +* fae1884 Fix: Allow same-line comments in padded-blocks (fixes #5055) (Brandon Mills) +* a24d8ad Fix: Improve autoconfig logging (fixes #5119) (Ian VanSchooten) +* e525923 Docs: Correct obvious inconsistencies in rules h2 elements (Mark Pedrotti) +* 9675b5e Docs: `avoid-escape` does not allow backticks (fixes #5147) (alberto) +* a03919a Fix: `no-unexpected-multiline` false positive (fixes #5148) (Feross Aboukhadijeh) +* 74360d6 Docs: Note no-empty applies to empty block statements (fixes #5105) (alberto) +* 6eeaa3f Build: Remove pending tests (fixes #5126) (Ian VanSchooten) +* 02c83df Docs: Update docs/rules/no-plusplus.md (Sheldon Griffin) +* 0c4de5c New: Added "table" formatter (fixes #4037) (Gajus Kuizinas) +* 0a59926 Update: 'implied strict mode' ecmaFeature (fixes #4832) (Nick Evans) +* 53a6eb3 Fix: Handle singular case in rule-tester error message (fixes #5141) (Bryan Smith) +* 97ac91c Build: Increment eslint-config-eslint (Nicholas C. Zakas) + +v2.0.0-rc.0 - February 2, 2016 + +* 973c499 Fix: `sort-imports` crash (fixes #5130) (Toru Nagashima) +* e64b2c2 Breaking: remove `no-empty-label` (fixes #5042) (Toru Nagashima) +* 79ebbc9 Breaking: update `eslint:recommended` (fixes #5103) (Toru Nagashima) +* e1d7368 New: `no-extra-label` rule (fixes #5059) (Toru Nagashima) +* c83b48c Fix: find ignore file only in cwd (fixes #5087) (Nicholas C. Zakas) +* 3a24240 Docs: Fix jsdoc param names to match function param names (Thanos Lefteris) +* 1d79746 Docs: Replace ecmaFeatures setting with link to config page (Thanos Lefteris) +* e96ffd2 New: `template-curly-spacing` rule (fixes #5049) (Toru Nagashima) +* 4b02902 Update: Extended no-console rule (fixes #5095) (EricHenry) +* 757651e Docs: Remove reference to rules enabled by default (fixes #5100) (Brandon Mills) +* 0d87f5d Docs: Clarify eslint-disable comments only affect rules (fixes #5005) (Brandon Mills) +* 1e791a2 New: `no-self-assign` rule (fixes #4729) (Toru Nagashima) +* c706eb9 Fix: reduced `no-loop-func` false positive (fixes #5044) (Toru Nagashima) +* 3275e86 Update: Add extra aliases to consistent-this rule (fixes #4492) (Zachary Alexander Belford) +* a227360 Docs: Replace joyent org with nodejs (Thanos Lefteris) +* b2aedfe New: Rule to enforce newline after each call in the chain (fixes #4538) (Rajendra Patil) +* d67bfdd New: `no-unused-labels` rule (fixes #5052) (Toru Nagashima) + +v2.0.0-beta.3 - January 29, 2016 + +* 86a3e3d Update: Remove blank lines at beginning of files (fixes #5045) (Jared Sohn) +* 4fea752 New: Autoconfiguration from source inspection (fixes #3567) (Ian VanSchooten) +* 519f39f Breaking: Remove deprecated rules (fixes #5032) (Gyandeep Singh) +* c75ee4a New: Add support for configs in plugins (fixes #3659) (Ilya Volodin) +* 361377f Fix: `prefer-const` false positive reading before writing (fixes #5074) (Toru Nagashima) +* ff2551d Build: Improve `npm run perf` command (fixes #5028) (Toru Nagashima) +* bcca69b Update: add int32Hint option to `no-bitwise` rule (fixes #4873) (Maga D. Zandaqo) +* e3f2683 Update: config extends dependency lookup (fixes #5023) (Nicholas C. Zakas) +* a327a06 Fix: Indent rule for allman brace style scenario (fixes #5064) (Gyandeep Singh) +* afdff6d Fix: `no-extra-bind` false positive (fixes #5058) (Toru Nagashima) +* c1fad4f Update: add autofix support for spaced-comment (fixes #4969, fixes #5030) (Maga D. Zandaqo) +* 889b942 Revert "Docs: Update readme for legend describing rules icons (refs #4355)" (Nicholas C. Zakas) +* b0f21a0 Fix: `keyword-spacing` false positive in template strings (fixes #5043) (Toru Nagashima) +* 53fa5d1 Fix: `prefer-const` false positive in a loop condition (fixes #5024) (Toru Nagashima) +* 385d399 Docs: Update readme for legend describing rules icons (Kai Cataldo) +* 505f1a6 Update: Allow parser to be relative to config (fixes #4985) (Nicholas C. Zakas) +* 79e8a0b New: `one-var-declaration-per-line` rule (fixes #1622) (alberto) +* 654e6e1 Update: Check extra Boolean calls in no-extra-boolean-cast (fixes #3650) (Andrew Sutton) + +v2.0.0-beta.2 - January 22, 2016 + +* 3fa834f Docs: Fix formatter links (fixes #5006) (Gyandeep Singh) +* 54b1bc8 Docs: Fix link in strict.md (fixes #5026) (Nick Evans) +* e0c5cf7 Upgrade: Espree to 3.0.0 (fixes #5018) (Ilya Volodin) +* 69f149d Docs: language tweaks (Andres Kalle) +* 2b33c74 Update: valid-jsdoc to not require @return in constructors (fixes #4976) (Maga D. Zandaqo) +* 6ac2e01 Docs: Fix description of exported comment (Mickael Jeanroy) +* 29392f8 New: allow-multiline option on comma-dangle (fixes #4967) (Alberto Gimeno) +* 05b8cb3 Update: Module overrides all 'strict' rule options (fixes #4936) (Nick Evans) +* 8470474 New: Add metadata to few test rules (fixes #4494) (Ilya Volodin) +* ba11c1b Docs: Add Algolia as sponsor to README (Nicholas C. Zakas) +* b28a19d Breaking: Plugins envs and config removal (fixes #4782, fixes #4952) (Nicholas C. Zakas) +* a456077 Docs: newline-after-var doesn't allow invalid options. (alberto) +* 3e6a24e Breaking: Change `strict` default mode to "safe" (fixes #4961) (alberto) +* 5b96265 Breaking: Update eslint:recommended (fixes #4953) (alberto) +* 7457a4e Upgrade: glob to 6.x (fixes #4991) (Gyandeep Singh) +* d3f4bdd Build: Cleanup for code coverage (fixes #4983) (Gyandeep Singh) +* b8fbaa0 Fix: multiple message in TAP formatter (fixes #4975) (Simon Degraeve) +* 990f8da Fix: `getNodeByRangeIndex` performance issue (fixes #4989) (Toru Nagashima) +* 8ac1dac Build: Update markdownlint dependency to 0.1.0 (fixes #4988) (David Anson) +* 5cd5429 Fix: function expression doc in call expression (fixes #4964) (Tim Schaub) +* 4173baa Fix: `no-dupe-class-members` false positive (fixes #4981) (Toru Nagashima) +* 12fe803 Breaking: Supports Unicode BOM (fixes #4878) (Toru Nagashima) +* 1fc80e9 Build: Increment eslint-config-eslint (Nicholas C. Zakas) +* e0a9024 Update: Report newline between template tag and literal (fixes #4210) (Rajendra Patil) +* da3336c Update: Rules should get `sourceType` from Program node (fixes #4960) (Nick Evans) +* a2ac359 Update: Make jsx-quotes fixable (refs #4377) (Gabriele Petronella) +* ee1014d Fix: Incorrect error location for object-curly-spacing (fixes #4957) (alberto) +* b52ed17 Fix: Incorrect error location for space-in-parens (fixes #4956) (alberto) +* 9c1bafb Fix: Columns of parse errors are off by 1 (fixes #4896) (alberto) +* 5e4841e New: 'id-blacklist' rule (fixes #3358) (Keith Cirkel) +* 700b8bc Update: Add "allow" option to allow specific operators (fixes #3308) (Rajendra Patil) +* d82eeb1 Update: Add describe around rule tester blocks (fixes #4907) (Ilya Volodin) +* 2967402 Update: Add minimum value to integer values in schema (fixes #4941) (Ilya Volodin) +* 7b632f8 Upgrade: Globals to ^8.18.0 (fixes #4728) (Gyandeep Singh) +* 86e6e57 Fix: Incorrect error at EOF for no-multiple-empty-lines (fixes #4917) (alberto) +* 7f058f3 Fix: Incorrect location for padded-blocks (fixes #4913) (alberto) +* b3de8f7 Fix: Do not show ignore messages for default ignored files (fixes #4931) (Gyandeep Singh) +* b1360da Update: Support multiLine and singleLine options (fixes #4697) (Rajendra Patil) +* 82fbe09 Docs: Small semantic issue in documentation example (fixes #4937) (Marcelo Zarate) +* 13a4e30 Docs: Formatting inconsistencies (fixes #4912) (alberto) +* d487013 Update: Option to allow extra parens for cond assign (fixes #3317) (alberto) +* 0f469b4 Fix: JSDoc for function expression on object property (fixes #4900) (Tim Schaub) +* c2dee27 Update: Add module tests to no-extra-semi (fixes #4915) (Nicholas C. Zakas) +* 5a633bf Update: Add `preferType` option to `valid-jsdoc` rule (fixes #3056) (Gyandeep Singh) +* ebd01b7 Build: Fix version number on release (fixes #4921) (Nicholas C. Zakas) +* 2d626a3 Docs: Fix typo in changelog (Nicholas C. Zakas) +* c4c4139 Fix: global-require no longer warns if require is shadowed (fixes #4812) (Kevin Partington) +* bbf7f27 New: provide config.parser via `parserName` on RuleContext (fixes #3670) (Ben Mosher) + +v2.0.0-beta.1 - January 11, 2016 + +* 6c70d84 Build: Fix prerelease script (fixes #4919) (Nicholas C. Zakas) +* d5c9435 New: 'sort-imports' rule (refs #3143) (Christian Schuller) +* a8cfd56 Fix: remove duplicate of eslint-config-eslint (fixes #4909) (Toru Nagashima) +* 19a9fbb Breaking: `space-before-blocks` ignores after keywords (fixes #1338) (Toru Nagashima) +* c275b41 Fix: no-extra-parens ExpressionStatement restricted prods (fixes #4902) (Michael Ficarra) +* b795850 Breaking: don't load ~/.eslintrc when using --config flag (fixes #4881) (alberto) +* 3906481 Build: Add AppVeyor CI (fixes #4894) (Gyandeep Singh) +* 6390862 Docs: Fix missing footnote (Yoshiya Hinosawa) +* e5e06f8 Fix: Jsdoc comment for multi-line function expressions (fixes #4889) (Gyandeep Singh) +* 7c9be60 Fix: Fix path errors in windows (fixes #4888) (Gyandeep Singh) +* a1840e7 Fix: gray text was invisible on Solarized Dark theme (fixes #4886) (Jack Leigh) +* fc9f528 Docs: Modify unnecessary flag docs in quote-props (Matija Marohnić) +* 186e8f0 Update: Ignore camelcase in object destructuring (fixes #3185) (alberto) +* 7c97201 Upgrade: doctrine version to 1.1.0 (fixes #4854) (Tim Schaub) +* ceaf324 New: Add no-new-symbol rule (fixes #4862) (alberto) +* e2f2b66 Breaking: Remove defaults from `eslint:recommended` (fixes #4809) (Ian VanSchooten) +* 0b3c01e Docs: Specify default for func-style (fixes #4834) (Ian VanSchooten) +* 008ea39 Docs: Document default for operator assignment (fixes #4835) (alberto) +* b566f56 Docs: no-new-func typo (alberto) +* 1569695 Update: Adds default 'that' for consistent-this (fixes #4833) (alberto) +* f7b28b7 Docs: clarify `requireReturn` option for valid-jsdoc rule (fixes #4859) (Tim Schaub) +* 407f329 Build: Fix prerelease script (Nicholas C. Zakas) +* 688f277 Fix: Set proper exit code for Node > 0.10 (fixes #4691) (Nicholas C. Zakas) +* 58715e9 Fix: Use single quotes in context.report messages (fixes #4845) (Joe Lencioni) +* 5b7586b Fix: do not require a @return tag for @interface (fixes #4860) (Tim Schaub) +* d43f26c Breaking: migrate from minimatch to node-ignore (fixes #2365) (Stefan Grönke) +* c07ca39 Breaking: merges keyword spacing rules (fixes #3869) (Toru Nagashima) +* 871f534 Upgrade: Optionator version to 0.8.1 (fixes #4851) (Eric Johnson) +* 82d4cd9 Update: Add atomtest env (fixes #4848) (Andres Suarez) +* 9c9beb5 Update: Add "ignore" override for operator-linebreak (fixes #4294) (Rajendra Patil) +* 9c03abc Update: Add "allowCall" option (fixes #4011) (Rajendra Patil) +* 29516f1 Docs: fix migration guide for no-arrow-condition rule (Peter Newnham) +* 2ef7549 Docs: clarify remedy to some prefer-const errors (Turadg Aleahmad) +* 1288ba4 Update: Add default limit to `complexity` (fixes #4808) (Ian VanSchooten) +* d3e8179 Fix: env is rewritten by modules (fixes #4814) (Toru Nagashima) +* fd72aba Docs: Example fix for `no-extra-parens` rule (fixes #3527) (Gyandeep Singh) +* 315f272 Fix: Change max-warnings type to Int (fixes #4660) (George Zahariev) +* 5050768 Update: Ask for `commonjs` under config init (fixes #3553) (Gyandeep Singh) +* 4665256 New: Add no-whitespace-before-property rule (fixes #1086) (Kai Cataldo) +* f500d7d Fix: allow extending @scope/eslint/file (fixes #4800) (André Cruz) +* 5ab564e New: 'ignoreArrayIndexes' option for 'no-magic-numbers' (fixes #4370) (Christian Schuller) +* 97cdb95 New: Add no-useless-constructor rule (fixes #4785) (alberto) +* b9bcbaf Fix: Bug in no-extra-bind (fixes #4806) (Andres Kalle) +* 246a6d2 Docs: Documentation fix (Andres Kalle) +* 9ea6b36 Update: Ignore case in jsdoc tags (fixes #4576) (alberto) +* acdda24 Fix: ignore argument parens in no-unexpected-multiline (fixes #4658) (alberto) +* 4931f56 Update: optionally allow bitwise operators (fixes #4742) (Swaagie) + +v2.0.0-alpha-2 - December 23, 2015 + +* Build: Add prerelease script (Nicholas C. Zakas) +* Update: Allow to omit semi for one-line blocks (fixes #4385) (alberto) +* Fix: Handle getters and setters in key-spacing (fixes #4792) (Brandon Mills) +* Fix: ObjectRestSpread throws error in key-spacing rule (fixes #4763) (Ziad El Khoury Hanna) +* Docs: Typo in generator-star (alberto) +* Fix: Backtick behavior in quotes rule (fixes #3090) (Nicholas C. Zakas) +* Fix: Empty schemas forbid any options (fixes #4789) (Brandon Mills) +* Fix: Remove `isMarkedAsUsed` function name (fixes #4783) (Gyandeep Singh) +* Fix: support arrow functions in no-return-assign (fixes #4743) (alberto) +* Docs: Add license header to Working with Rules guide (Brandon Mills) +* Fix: RuleTester to show parsing errors (fixes #4779) (Nicholas C. Zakas) +* Docs: Escape underscores in no-path-concat (alberto) +* Update: configuration for classes in space-before-blocks (fixes #4089) (alberto) +* Docs: Typo in no-useless-concat (alberto) +* Docs: fix typos, suggests (molee1905) +* Docs: Typos in space-before-keywords and space-unary-ops (fixes #4771) (alberto) +* Upgrade: beefy to ^2.0.0, fixes installation errors (fixes #4760) (Kai Cataldo) +* Docs: Typo in no-unexpected-multiline (fixes #4756) (alberto) +* Update: option to ignore top-level max statements (fixes #4309) (alberto) +* Update: Implement auto fix for semi-spacing rule (fixes #3829) (alberto) +* Fix: small typos in code examples (Plusb Preco) +* Docs: Add section on file extensions to user-guide/configuring (adam) +* Fix: Comma first issue in `indent` (fixes #4739, fixes #3456) (Gyandeep Singh) +* Fix: no-constant-condition false positive (fixes #4737) (alberto) +* Fix: Add source property for fatal errors (fixes #3325) (Gyandeep Singh) +* New: Add a comment length option to the max-len rule (fixes #4665) (Ian) +* Docs: RuleTester doesn't require any tests (fixes #4681) (alberto) +* Fix: Remove path analysis from debug log (fixes #4631) (Ilya Volodin) +* Fix: Set null to property ruleId when fatal is true (fixes #4722) (Sébastien Règne) +* New: Visual Studio compatible formatter (fixes #4708) (rhpijnacker) +* New: Add greasemonkey environment (fixes #4715) (silverwind) +* Fix: always-multiline for comma-dangle import (fixes #4704) (Nicholas C. Zakas) +* Fix: Check 1tbs non-block else (fixes #4692) (Nicholas C. Zakas) +* Fix: Apply environment configs last (fixes #3915) (Nicholas C. Zakas) +* New: `no-unmodified-loop-condition` rule (fixes #4523) (Toru Nagashima) +* Breaking: deprecate `no-arrow-condition` rule (fixes #4417) (Luke Karrys) +* Update: Add cwd option for cli-engine (fixes #4472) (Ilya Volodin) +* New: Add no-confusing-arrow rule (refs #4417) (Luke Karrys) +* Fix: ensure `ConfigOps.merge` do a deep copy (fixes #4682) (Toru Nagashima) +* Fix: `no-invalid-this` allows this in static method (fixes #4669) (Toru Nagashima) +* Fix: Export class syntax for `require-jsdoc` rule (fixes #4667) (Gyandeep Singh) +* Update: Add "safe" mode to strict (fixes #3306) (Brandon Mills) + +v2.0.0-alpha-1 - December 11, 2015 + +* Breaking: Correct links between variables and references (fixes #4615) (Toru Nagashima) +* Fix: Update rule tests for parser options (fixes #4673) (Nicholas C. Zakas) +* Breaking: Implement parserOptions (fixes #4641) (Nicholas C. Zakas) +* Fix: max-len rule overestimates the width of some tabs (fixes #4661) (Nick Evans) +* New: Add no-implicit-globals rule (fixes #4542) (Joshua Peek) +* Update: `no-use-before-define` checks invalid initializer (fixes #4280) (Toru Nagashima) +* Fix: Use oneValuePerFlag for --ignore-pattern option (fixes #4507) (George Zahariev) +* New: `array-callback-return` rule (fixes #1128) (Toru Nagashima) +* Upgrade: Handlebars to >= 4.0.5 for security reasons (fixes #4642) (Jacques Favreau) +* Update: Add class body support to `indent` rule (fixes #4372) (Gyandeep Singh) +* Breaking: Remove space-after-keyword newline check (fixes #4149) (Nicholas C. Zakas) +* Breaking: Treat package.json like the rest of configs (fixes #4451) (Ilya Volodin) +* Docs: writing mistake (molee1905) +* Update: Add 'method' option to no-empty (fixes #4605) (Kai Cataldo) +* Breaking: Remove autofix from eqeqeq (fixes #4578) (Ilya Volodin) +* Breaking: Remove ES6 global variables from builtins (fixes #4085) (Brandon Mills) +* Fix: Handle forbidden LineTerminators in no-extra-parens (fixes #4229) (Brandon Mills) +* Update: Option to ignore constructor Fns object-shorthand (fixes #4487) (Kai Cataldo) +* Fix: Check YieldExpression argument in no-extra-parens (fixes #4608) (Brandon Mills) +* Fix: Do not cache `package.json` (fixes #4611) (Spain) +* Build: Consume no-underscore-dangle allowAfterThis option (fixes #4599) (Kevin Partington) +* New: Add no-restricted-imports rule (fixes #3196) (Guy Ellis) +* Docs: no-extra-semi no longer refers to deprecated rule (fixes #4598) (Kevin Partington) +* Fix: `consistent-return` checks the last (refs #3530, fixes #3373) (Toru Nagashima) +* Update: add class option to `no-use-before-define` (fixes #3944) (Toru Nagashima) +* Breaking: Simplify rule schemas (fixes #3625) (Nicholas C. Zakas) +* Docs: Update docs/rules/no-plusplus.md (Xiangyun Chi) +* Breaking: added bower_components to default ignore (fixes #3550) (Julian Laval) +* Fix: `no-unreachable` with the code path (refs #3530, fixes #3939) (Toru Nagashima) +* Fix: `no-this-before-super` with the code path analysis (refs #3530) (Toru Nagashima) +* Fix: `no-fallthrough` with the code path analysis (refs #3530) (Toru Nagashima) +* Fix: `constructor-super` with the code path analysis (refs #3530) (Toru Nagashima) +* Breaking: Switch to Espree 3.0.0 (fixes #4334) (Nicholas C. Zakas) +* Breaking: Freeze context object (fixes #4495) (Nicholas C. Zakas) +* Docs: Add Code of Conduct (fixes #3095) (Nicholas C. Zakas) +* Breaking: Remove warnings of readonly from `no-undef` (fixes #4504) (Toru Nagashima) +* Update: allowAfterThis option in no-underscore-dangle (fixes #3435) (just-boris) +* Fix: Adding options unit tests for --ignore-pattern (refs #4507) (Kevin Partington) +* Breaking: Implement yield-star-spacing rule (fixes #4115) (Bryan Smith) +* New: `prefer-rest-params` rule (fixes #4108) (Toru Nagashima) +* Update: `prefer-const` begins to cover separating init (fixes #4474) (Toru Nagashima) +* Fix: `no-eval` come to catch indirect eval (fixes #4399, fixes #4441) (Toru Nagashima) +* Breaking: Default no-magic-numbers to none. (fixes #4193) (alberto) +* Breaking: Allow empty arrow body (fixes #4411) (alberto) +* New: Code Path Analysis (fixes #3530) (Toru Nagashima) + +v1.10.3 - December 1, 2015 + +* Docs: Update strict rule docs (fixes #4583) (Nicholas C. Zakas) +* Docs: Reference .eslintrc.* in contributing docs (fixes #4532) (Kai Cataldo) +* Fix: Add for-of to `curly` rule (fixes #4571) (Kai Cataldo) +* Fix: Ignore space before function in array start (fixes #4569) (alberto) + +v1.10.2 - November 27, 2015 + +* Upgrade: escope@3.3.0 (refs #4485) (Nicholas C. Zakas) +* Upgrade: Pinned down js-yaml to avoid breaking dep (fixes #4553) (alberto) +* Fix: lines-around-comment with multiple comments (fixes #3509) (alberto) +* Upgrade: doctrine@0.7.1 (fixes #4545) (Kevin Partington) +* Fix: Bugfix for eqeqeq autofix (fixes #4540) (Kevin Partington) +* Fix: Add for-in to `curly` rule (fixes #4436) (Kai Cataldo) +* Fix: `valid-jsdoc` unneeded require check fix (fixes #4527) (Gyandeep Singh) +* Fix: `brace-style` ASI fix for if-else condition (fixes #4520) (Gyandeep Singh) +* Build: Add branch update during release process (fixes #4491) (Gyandeep Singh) +* Build: Allow revert commits in commit messages (fixes #4452) (alberto) +* Fix: Incorrect location in no-fallthrough (fixes #4516) (alberto) +* Fix: `no-spaced-func` had been crashed (fixes #4508) (Toru Nagashima) +* Fix: Add a RestProperty test of `no-undef` (fixes #3271) (Toru Nagashima) +* Docs: Load badge from HTTPS (Brian J Brennan) +* Build: Update eslint bot messages (fixes #4497) (Nicholas C. Zakas) + +v1.10.1 - November 20, 2015 + +* Fix: Revert freezing context object (refs #4495) (Nicholas C. Zakas) +* 1.10.0 (Nicholas C. Zakas) + +v1.10.0 - November 20, 2015 + +* Docs: Remove dupes from changelog (Nicholas C. Zakas) +* Update: --init to create extensioned files (fixes #4476) (Nicholas C. Zakas) +* Docs: Update description of exported comment (fixes #3916) (Nicholas C. Zakas) +* Docs: Move legacy rules to stylistic (files #4111) (Nicholas C. Zakas) +* Docs: Clean up description of recommended rules (fixes #4365) (Nicholas C. Zakas) +* Docs: Fix home directory config description (fixes #4398) (Nicholas C. Zakas) +* Update: Add class support to `require-jsdoc` rule (fixes #4268) (Gyandeep Singh) +* Update: return type error in `valid-jsdoc` rule (fixes #4443) (Gyandeep Singh) +* Update: Display errors at the place where fix should go (fixes #4470) (nightwing) +* Docs: Fix typo in default `cacheLocation` value (Andrew Hutchings) +* Fix: Handle comments in block-spacing (fixes #4387) (alberto) +* Update: Accept array for `ignorePattern` (fixes #3982) (Jesse McCarthy) +* Update: replace label and break with IIFE and return (fixes #4459) (Ilya Panasenko) +* Fix: space-before-keywords false positive (fixes #4449) (alberto) +* Fix: Improves performance (refs #3530) (Toru Nagashima) +* Fix: Autofix quotes produces invalid javascript (fixes #4380) (nightwing) +* Docs: Update indent.md (Nathan Brown) +* New: Disable comment config option (fixes #3901) (Matthew Riley MacPherson) +* New: Config files with extensions (fixes #4045, fixes #4263) (Nicholas C. Zakas) +* Revert "Update: Add JSX exceptions to no-extra-parens (fixes #4229)" (Brandon Mills) +* Update: Add JSX exceptions to no-extra-parens (fixes #4229) (Brandon Mills) +* Docs: Replace link to deprecated rule with newer rule (Andrew Marshall) +* Fix: `no-extend-native` crashed at empty defineProperty (fixes #4438) (Toru Nagashima) +* Fix: Support empty if blocks in lines-around-comment (fixes #4339) (alberto) +* Fix: `curly` warns wrong location for `else` (fixes #4362) (Toru Nagashima) +* Fix: `id-length` properties never option (fixes #4347) (Toru Nagashima) +* Docs: missing close rbracket in example (@storkme) +* Revert "Update: Allow empty arrow body (fixes #4411)" (Nicholas C. Zakas) +* Fix: eqeqeq autofix avoids clashes with space-infix-ops (fixes #4423) (Kevin Partington) +* Docs: Document semi-spacing behaviour (fixes #4404) (alberto) +* Update: Allow empty arrow body (fixes #4411) (alberto) +* Fix: Handle comments in comma-spacing (fixes #4389) (alberto) +* Update: Refactor eslint.verify args (fixes #4395) (Nicholas C. Zakas) +* Fix: no-undef-init should ignore const (fixes #4284) (Nicholas C. Zakas) +* Fix: Add the missing "as-needed" docs to the radix rule (fixes #4364) (Michał Gołębiowski) +* Fix: Display singular/plural version of "line" in message (fixes #4359) (Marius Schulz) +* Update: Add Popular Style Guides (fixes #4320) (Jamund Ferguson) +* Fix: eslint.report can be called w/o node if loc provided (fixes #4220) (Kevin Partington) +* Update: no-implicit-coercion validate AssignmentExpression (fixes #4348) (Ilya Panasenko) + +v1.9.0 - November 6, 2015 + +* Update: Make radix accept a "as-needed" option (fixes #4048) (Michał Gołębiowski) +* Fix: Update the message to include number of lines (fixes #4342) (Brian Delahunty) +* Docs: ASI causes problem whether semicolons are used or not (Thai Pangsakulyanont) +* Fix: Fixer to not overlap ranges among fix objects (fixes #4321) (Gyandeep Singh) +* Update: Add default to `max-nested-callbacks` (fixes #4297) (alberto) +* Fix: Check comments in space-in-parens (fixes #4302) (alberto) +* Update: Add quotes to error messages to improve clarity (fixes #4313) (alberto) +* Fix: tests failing due to differences in temporary paths (fixes #4324) (alberto) +* Fix: Make tests compatible with Windows (fixes #4315) (Ian VanSchooten) +* Update: Extract glob and filesystem logic from cli-engine (fixes #4305) (Ian VanSchooten) +* Build: Clarify commit-check messages (fixes #4256) (Ian VanSchooten) +* Upgrade: Upgrade various dependencies (fixes #4303) (Gyandeep Singh) +* Build: Add node 5 to travis build (fixes #4310) (Gyandeep Singh) +* Fix: ensure using correct estraverse (fixes #3951) (Toru Nagashima) +* Docs: update docs about using gitignore (Mateusz Derks) +* Update: Detect and fix wrong linebreaks (fixes #3981) (alberto) +* New: Add no-case-declarations rule (fixes #4278) (Erik Arvidsson) + +v1.8.0 - October 30, 2015 + +* Fix: Check for node property before testing type (fixes #4298) (Ian VanSchooten) +* Docs: Specify 'double' as default for quotes (fixes #4270) (Ian VanSchooten) +* Fix: Missing errors in space-in-parens (fixes #4257, fixes #3996) (alberto) +* Docs: fixed typo (Mathieu M-Gosselin) +* Fix: `cacheLocation` handles paths in windows style. (fixes #4285) (royriojas) +* Docs: fixed typo (mpal9000) +* Update: Add support for class in `valid-jsdoc` rule (fixes #4279) (Gyandeep Singh) +* Update: cache-file accepts a directory. (fixes #4241) (royriojas) +* Update: Add `maxEOF` to no-multiple-empty-lines (fixes #4235) (Adrien Vergé) +* Update: fix option for comma-spacing (fixes #4232) (HIPP Edgar (PRESTA EXT)) +* Docs: Fix use of wrong word in configuration doc (Jérémie Astori) +* Fix: Prepare config before verifying SourceCode (fixes #4230) (Ian VanSchooten) +* Update: RuleTester come to check AST was not modified (fixes #4156) (Toru Nagashima) +* Fix: wrong count for 'no-multiple-empty-lines' on last line (fixes #4228) (alberto) +* Update: Add `allow` option to `no-shadow` rule (fixes #3035) (Gyandeep Singh) +* Doc: Correct the spelling of Alberto's surname (alberto) +* Docs: Add alberto as a committer (Gyandeep Singh) +* Build: Do not stub console in testing (fixes #1328) (Gyandeep Singh) +* Fix: Check node exists before checking type (fixes #4231) (Ian VanSchooten) +* Update: Option to exclude afterthoughts from no-plusplus (fixes #4093) (Brody McKee) +* New: Add rule no-arrow-condition (fixes #3280) (Luke Karrys) +* Update: Add linebreak style option to eol-last (fixes #4148) (alberto) +* New: arrow-body-style rule (fixes #4109) (alberto) + +v1.7.3 - October 21, 2015 + +* Fix: Support comma-first style in key-spacing (fixes #3877) (Brandon Mills) +* Fix: no-magic-numbers: variable declarations (fixes #4192) (Ilya Panasenko) +* Fix: Support ES6 shorthand in key-spacing (fixes #3678) (Brandon Mills) +* Fix: `indent` array with memberExpression (fixes #4203) (Gyandeep Singh) +* Fix: `indent` param function on sameline (fixes #4174) (Gyandeep Singh) +* Fix: no-multiple-empty-lines fails when empty line at EOF (fixes #4214) (alberto) +* Fix: `comma-dangle` false positive (fixes #4200) (Nicholas C. Zakas) +* Fix: `valid-jsdoc` prefer problem (fixes #4205) (Nicholas C. Zakas) +* Docs: Add missing single-quote (Kevin Lamping) +* Fix: correct no-multiple-empty-lines at EOF (fixes #4140) (alberto) + +v1.7.2 - October 19, 2015 + +* Fix: comma-dangle confused by parens (fixes #4195) (Nicholas C. Zakas) +* Fix: no-mixed-spaces-and-tabs (fixes #4189, fixes #4190) (alberto) +* Fix: no-extend-native disallow using Object.properties (fixes #4180) (Nathan Woltman) +* Fix: no-magic-numbers should ignore Number.parseInt (fixes #4167) (Henry Zhu) + +v1.7.1 - October 16, 2015 + +* Fix: id-match schema (fixes #4155) (Nicholas C. Zakas) +* Fix: no-magic-numbers should ignore parseInt (fixes #4167) (Nicholas C. Zakas) +* Fix: `indent` param function fix (fixes #4165, fixes #4164) (Gyandeep Singh) + +v1.7.0 - October 16, 2015 + +* Fix: array-bracket-spacing for empty array (fixes #4141) (alberto) +* Fix: `indent` arrow function check fix (fixes #4142) (Gyandeep Singh) +* Update: Support .js files for config (fixes #3102) (Gyandeep Singh) +* Fix: Make eslint-config-eslint work (fixes #4145) (Nicholas C. Zakas) +* Fix: `prefer-arrow-callback` had been wrong at arguments (fixes #4095) (Toru Nagashima) +* Docs: Update various rules docs (Nicholas C. Zakas) +* New: Create eslint-config-eslint (fixes #3525) (Nicholas C. Zakas) +* Update: RuleTester allows string errors in invalid cases (fixes #4117) (Kevin Partington) +* Docs: Reference no-unexpected-multiline in semi (fixes #4114) (alberto) +* Update: added exceptions to `lines-around-comment` rule. (fixes #2965) (Mathieu M-Gosselin) +* Update: Add `matchDescription` option to `valid-jsdoc` (fixes #2449) (Gyandeep Singh) +* Fix: check for objects or arrays in array-bracket-spacing (fixes #4083) (alberto) +* Docs: Alphabetize Rules lists (Kenneth Chung) +* Fix: message templates fail when no parameters are passed (fixes #4080) (Ilya Volodin) +* Fix: `indent` multi-line function call (fixes #4073, fixes #4075) (Gyandeep Singh) +* Docs: Improve comma-dangle documentation (Gilad Peleg) +* Fix: no-mixed-tabs-and-spaces fails with some comments (fixes #4086) (alberto) +* Fix: `semi` to check for do-while loops (fixes #4090) (Gyandeep Singh) +* Build: Fix path related failures on Windows in tests (fixes #4061) (Burak Yigit Kaya) +* Fix: `no-unused-vars` had been missing some parameters (fixes #4047) (Toru Nagashima) +* Fix: no-mixed-spaces-and-tabs with comments and templates (fixes #4077) (alberto) +* Update: Add `allow` option for `no-underscore-dangle` rule (fixes #2135) (Gyandeep Singh) +* Update: `allowArrowFunctions` option for `func-style` rule (fixes #1897) (Gyandeep Singh) +* Fix: Ignore template literals in no-mixed-tabs-and-spaces (fixes #4054) (Nicholas C. Zakas) +* Build: Enable CodeClimate (fixes #4068) (Nicholas C. Zakas) +* Fix: `no-cond-assign` had needed double parens in `for` (fixes #4023) (Toru Nagashima) +* Update: Ignore end of function in newline-after-var (fixes #3682) (alberto) +* Build: Performance perf to not ignore jshint file (refs #3765) (Gyandeep Singh) +* Fix: id-match bug incorrectly errors on `NewExpression` (fixes #4042) (Burak Yigit Kaya) +* Fix: `no-trailing-spaces` autofix to handle linebreaks (fixes #4050) (Gyandeep Singh) +* Fix: renamed no-magic-number to no-magic-numbers (fixes #4053) (Vincent Lemeunier) +* New: add "consistent" option to the "curly" rule (fixes #2390) (Benoît Zugmeyer) +* Update: Option to ignore for loops in init-declarations (fixes #3641) (alberto) +* Update: Add webextensions environment (fixes #4051) (Blake Winton) +* Fix: no-cond-assign should report assignment location (fixes #4040) (alberto) +* New: no-empty-pattern rule (fixes #3668) (alberto) +* Upgrade: Upgrade globals to 8.11.0 (fixes #3599) (Burak Yigit Kaya) +* Docs: Re-tag JSX code fences (fixes #4020) (Brandon Mills) +* New: no-magic-number rule (fixes #4027) (Vincent Lemeunier) +* Docs: Remove list of users from README (fixes #3881) (Brandon Mills) +* Fix: `no-redeclare` and `no-sahadow` for builtin globals (fixes #3971) (Toru Nagashima) +* Build: Add `.eslintignore` file for the project (fixes #3765) (Gyandeep Singh) + +v1.6.0 - October 2, 2015 + +* Fix: cache is basically not working (fixes #4008) (Richard Hansen) +* Fix: a test failure on Windows (fixes #3968) (Toru Nagashima) +* Fix: `no-invalid-this` had been missing globals in node (fixes #3961) (Toru Nagashima) +* Fix: `curly` with `multi` had false positive (fixes #3856) (Toru Nagashima) +* Build: Add load performance check inside perf function (fixes #3994) (Gyandeep Singh) +* Fix: space-before-keywords fails with super keyword (fixes #3946) (alberto) +* Fix: CLI should not fail on account of ignored files (fixes #3978) (Dominic Barnes) +* Fix: brace-style rule incorrectly flagging switch (fixes #4002) (Aparajita Fishman) +* Update: Implement auto fix for space-unary-ops rule (fixes #3976) (alberto) +* Update: Implement auto fix for computed-property-spacing (fixes #3975) (alberto) +* Update: Implement auto fix for no-multi-spaces rule (fixes #3979) (alberto) +* Fix: Report shorthand method names in complexity rule (fixes #3955) (Tijn Kersjes) +* Docs: Add note about typeof check for isNaN (fixes #3985) (Daniel Lo Nigro) +* Update: ESLint reports parsing errors with clear prefix. (fixes #3555) (Kevin Partington) +* Build: Update markdownlint dependency (fixes #3954) (David Anson) +* Update: `no-mixed-require` to have non boolean option (fixes #3922) (Gyandeep Singh) +* Fix: trailing spaces auto fix to check for line breaks (fixes #3940) (Gyandeep Singh) +* Update: Add `typeof` option to `no-undef` rule (fixes #3684) (Gyandeep Singh) +* Docs: Fix explanation and typos for accessor-pairs (alberto) +* Docs: Fix typos for camelcase (alberto) +* Docs: Fix typos for max-statements (Danny Guo) +* Update: Implement auto fix for object-curly-spacing (fixes #3857) (alberto) +* Update: Implement auto fix for array-bracket-spacing rule (fixes #3858) (alberto) +* Fix: Add schema to `global-require` rule (fixes #3923) (Gyandeep Singh) +* Update: Apply lazy loading for rules (fixes #3930) (Gyandeep Singh) +* Docs: Fix typo for arrow-spacing (Danny Guo) +* Docs: Fix typos for wrap-regex (Danny Guo) +* Docs: Fix explanation for space-before-keywords (Danny Guo) +* Docs: Fix typos for operator-linebreak (Danny Guo) +* Docs: Fix typos for callback-return (Danny Guo) +* Fix: no-trailing-spaces autofix to account for blank lines (fixes #3912) (Gyandeep Singh) +* Docs: Fix example in no-negated-condition.md (fixes #3908) (alberto) +* Update:warn message use @return when prefer.returns=return (fixes #3889) (闲耘™) +* Update: Implement auto fix for generator-star-spacing rule (fixes #3873) (alberto) +* Update: Implement auto fix for arrow-spacing rule (fixes #3860) (alberto) +* Update: Implement auto fix for block-spacing rule (fixes #3859) (alberto) +* Fix: Support allman style for switch statement (fixes #3903) (Gyandeep Singh) +* New: no-negated-condition rule (fixes #3740) (alberto) +* Docs: Fix typo in blog post template (Nicholas C. Zakas) +* Update: Add env 'nashorn' to support Java 8 Nashorn Engine (fixes #3874) (Benjamin Winterberg) +* Docs: Prepare for rule doc linting (refs #2271) (Ian VanSchooten) + +v1.5.1 - September 22, 2015 + +* Fix: valid-jsdoc fix for param with properties (fixes #3476) (Gyandeep Singh) +* Fix: valid-jsdoc error with square braces (fixes #2270) (Gyandeep Singh) +* Upgrade: `doctrine` to 0.7.0 (fixes #3891) (Gyandeep Singh) +* Fix: `space-before-keywords` had been wrong on getters (fixes #3854) (Toru Nagashima) +* Fix: `no-dupe-args` had been wrong for nested destructure (fixes #3867) (Toru Nagashima) +* Docs: io.js is the new Node.js (thefourtheye) +* Docs: Fix method signature on working-with-rules docs (fixes #3862) (alberto) +* Docs: Add related ternary links (refs #3835) (Ian VanSchooten) +* Fix: don’t ignore config if cwd is the home dir (fixes #3846) (Mathias Schreck) +* Fix: `func-style` had been warning arrows with `this` (fixes #3819) (Toru Nagashima) +* Fix: `space-before-keywords`; allow opening curly braces (fixes #3789) (Marko Raatikka) +* Build: Fix broken .gitattributes generation (fixes #3566) (Nicholas C. Zakas) +* Build: Fix formatter docs generation (fixes #3847) (Nicholas C. Zakas) + +v1.5.0 - September 18, 2015 + +* Fix: invalidate cache when config changes. (fixes #3770) (royriojas) +* Fix: function body indent issues (fixes #3614, fixes #3799) (Gyandeep Singh) +* Update: Add configuration option to `space-before-blocks` (fixes #3758) (Phil Vargas) +* Fix: space checking between tokens (fixes #2211) (Nicholas C. Zakas) +* Fix: env-specified ecmaFeatures had been wrong (fixes #3735) (Toru Nagashima) +* Docs: Change example wording from warnings to problems (fixes #3676) (Ian VanSchooten) +* Build: Generate formatter example docs (fixes #3560) (Ian VanSchooten) +* New: Add --debug flag to CLI (fixes #2692) (Nicholas C. Zakas) +* Docs: Update no-undef-init docs (fixes #3170) (Nicholas C. Zakas) +* Docs: Update no-unused-expressions docs (fixes #3685) (Nicholas C. Zakas) +* Docs: Clarify node types in no-multi-spaces (fixes #3781) (Nicholas C. Zakas) +* Docs: Update new-cap docs (fixes #3798) (Nicholas C. Zakas) +* Fix: `space-before-blocks` had conflicted `arrow-spacing` (fixes #3769) (Toru Nagashima) +* Fix: `comma-dangle` had not been checking imports/exports (fixes #3794) (Toru Nagashima) +* Fix: tests fail due to differences in temporary paths. (fixes #3778) (royriojas) +* Fix: Directory ignoring should work (fixes #3812) (Nicholas C. Zakas) +* Fix: Ensure **/node_modules works in ignore files (fixes #3788) (Nicholas C. Zakas) +* Update: Implement auto fix for `space-infix-ops` rule (fixes #3801) (Gyandeep Singh) +* Fix: `no-warning-comments` can't be set via config comment (fixes #3619) (Burak Yigit Kaya) +* Update: `key-spacing` should allow 1+ around colon (fixes #3363) (Burak Yigit Kaya) +* Fix: false alarm of semi-spacing with semi set to never (fixes #1983) (Chen Yicai) +* Fix: Ensure ./ works correctly with CLI (fixes #3792) (Nicholas C. Zakas) +* Docs: add more examples + tests for block-scoped-var (fixes #3791) (JT) +* Update: Implement auto fix for `indent` rule (fixes #3734) (Gyandeep Singh) +* Fix: `space-before-keywords` fails to handle some cases (fixes #3756) (Marko Raatikka) +* Docs: Add if-else example (fixes #3722) (Ian VanSchooten) +* Fix: jsx-quotes exception for attributes without value (fixes #3793) (Mathias Schreck) +* Docs: Fix closing code fence on cli docs (Ian VanSchooten) +* Update: Implement auto fix for `space-before-blocks` rule (fixes #3776) (Gyandeep Singh) +* Update: Implement auto fix for `space-after-keywords` rule (fixes #3773) (Gyandeep Singh) +* Fix: `semi-spacing` had conflicted with `block-spacing` (fixes #3721) (Toru Nagashima) +* Update: Implement auto fix for `space-before-keywords` rule (fixes #3771) (Gyandeep Singh) +* Update: auto fix for space-before-function-paren rule (fixes #3766) (alberto) +* Update: Implement auto fix for `no-extra-semi` rule (fixes #3745) (Gyandeep Singh) +* Update: Refactors the traversing logic (refs #3530) (Toru Nagashima) +* Update: Implement auto fix for `space-return-throw-case` (fixes #3732) (Gyandeep Singh) +* Update: Implement auto fix for `no-spaced-func` rule (fixes #3728) (Gyandeep Singh) +* Update: Implement auto fix for `eol-last` rule (fixes #3725) (Gyandeep Singh) +* Update: Implement auto fix for `no-trailing-spaces` rule (fixes #3723) (Gyandeep Singh) + +v1.4.3 - September 15, 2015 + +* Fix: Directory ignoring should work (fixes #3812) (Nicholas C. Zakas) +* Fix: jsx-quotes exception for attributes without value (fixes #3793) (Mathias Schreck) + +v1.4.2 - September 15, 2015 + +* Fix: Ensure **/node_modules works in ignore files (fixes #3788) (Nicholas C. Zakas) +* Fix: Ensure ./ works correctly with CLI (fixes #3792) (Nicholas C. Zakas) + +v1.4.1 - September 11, 2015 + +* Fix: CLIEngine default cache parameter name (fixes #3755) (Daniel G. Taylor) +* Fix: Glob pattern from .eslintignore not applied (fixes #3750) (Burak Yigit Kaya) +* Fix: Skip JSDoc from NewExpression (fixes #3744) (Nicholas C. Zakas) +* Docs: Shorten and simplify autocomment for new issues (Nicholas C. Zakas) + +v1.4.0 - September 11, 2015 + +* Docs: Add new formatters to API docs (Ian VanSchooten) +* New: Implement autofixing (fixes #3134) (Nicholas C. Zakas) +* Fix: Remove temporary `"allow-null"` (fixes #3705) (Toru Nagashima) +* Fix: `no-unused-vars` had been crashed at `/*global $foo*/` (fixes #3714) (Toru Nagashima) +* Build: check-commit now checks commit message length. (fixes #3706) (Kevin Partington) +* Fix: make getScope acquire innermost scope (fixes #3700) (voideanvalue) +* Docs: Fix spelling mistake (domharrington) +* Fix: Allow whitespace in rule message parameters. (fixes #3690) (Kevin Partington) +* Fix: Eqeqeq rule with no option does not warn on 'a == null' (fixes #3699) (fediev) +* Fix: `no-unused-expressions` with `allowShortCircuit` false positive if left has no effect (fixes #3675) (Toru Nagashima) +* Update: Add Node 4 to travis builds (fixes #3697) (Ian VanSchooten) +* Fix: Not check for punctuator if on same line as last var (fixes #3694) (Gyandeep Singh) +* Docs: Make `quotes` docs clearer (fixes #3646) (Nicholas C. Zakas) +* Build: Increase mocha timeout (fixes #3692) (Nicholas C. Zakas) +* Fix: `no-extra-bind` to flag all arrow funcs (fixes #3672) (Nicholas C. Zakas) +* Docs: Update README with release and sponsor info (Nicholas C. Zakas) +* Fix: `object-curly-spacing` had been crashing on an empty object pattern (fixes #3658) (Toru Nagashima) +* Fix: `no-extra-parens` false positive at IIFE with member accessing (fixes #3653) (Toru Nagashima) +* Fix: `comma-dangle` with `"always"`/`"always-multiline"` false positive after a rest element (fixes #3627) (Toru Nagashima) +* New: `jsx-quotes` rule (fixes #2011) (Mathias Schreck) +* Docs: Add linting for second half of rule docs (refs #2271) (Ian VanSchooten) +* Fix: `no-unused-vars` had not shown correct locations for `/*global` (fixes #3617) (Toru Nagashima) +* Fix: `space-after-keywords` not working for `catch` (fixes #3654) (Burak Yigit Kaya) +* Fix: Incorrectly warning about ignored files (fixes #3649) (Burak Yigit Kaya) +* Fix: Indent rule VariableDeclarator doesn't apply to arrow functions (fixes #3661) (Burak Yigit Kaya) +* Upgrade: Consuming handlebars@^4.0.0 (fixes #3632) (Kevin Partington) +* Docs: Fixing typos in plugin processor section. (fixes #3648) (Kevin Partington) +* Fix: Invalid env keys would cause an unhandled exception.(fixes #3265) (Ray Booysen) +* Docs: Fixing broken link in documentation (Ilya Volodin) +* Update: Check for default assignment in no-unneeded-ternary (fixes #3232) (cjihrig) +* Fix: `consistent-as-needed` mode with `keyword: true` (fixes #3636) (Alex Guerrero) +* New: Implement cache in order to only operate on changed files since previous run. (fixes #2998) (Roy Riojas) +* Update: Grouping related CLI options. (fixes #3612) (Kevin Partington) +* Update: Using @override does not require @param or @returns (fixes #3629) (Whitney Young) +* Docs: Use eslint-env in no-undef (fixes #3616) (Ian VanSchooten) +* New: `require-jsdoc` rule (fixes #1842) (Gyandeep Singh) +* New: Support glob path on command line (fixes #3402) (Burak Yigit Kaya) +* Update: Short circuit and ternary support in no-unused-expressions (fixes #2733) (David Warkentin) +* Docs: Replace to npmjs.com (Ryuichi Okumura) +* Fix: `indent` should only indent chain calls if the first call is single line (fixes #3591) (Burak Yigit Kaya) +* Fix: `quote-props` should not crash for object rest spread syntax (fixes #3595) (Joakim Carlstein) +* Update: Use `globals` module for the `commonjs` globals (fixes #3606) (Sindre Sorhus) +* New: `no-restricted-syntax` rule to forbid certain syntax (fixes #2422) (Burak Yigit Kaya) +* Fix: `no-useless-concat` false positive at numbers (fixes #3575, fixes #3589) (Toru Nagashima) +* New: Add --max-warnings flag to CLI (fixes #2769) (Kevin Partington) +* New: Add `parser` as an option (fixes #3127) (Gyandeep Singh) +* New: `space-before-keywords` rule (fixes #1631) (Marko Raatikka) +* Update: Allowing inline comments to disable eslint rules (fixes #3472) (Whitney Young) +* Docs: Including for(;;) as valid case in no-constant-condition (Kevin Partington) +* Update: Add quotes around the label in `no-redeclare` error messages (fixes #3583) (Ian VanSchooten) +* Docs: correct contributing URL (Dieter Luypaert) +* Fix: line number for duplicate object keys error (fixes #3573) (Elliot Lynde) +* New: global-require rule (fixes #2318) (Jamund Ferguson) + +v1.3.1 - August 29, 2015 + +* Fix: `indent` to not crash on empty files (fixes #3570) (Gyandeep Singh) +* Fix: Remove unused config file (fixes #2227) (Gyandeep Singh) + +v1.3.0 - August 28, 2015 + +* Build: Autogenerate release blog post (fixes #3562) (Nicholas C. Zakas) +* New: `no-useless-concat` rule (fixes #3506) (Henry Zhu) +* Update: Add `keywords` flag to `consistent-as-needed` mode in `quote-props` (fixes #3532) (Burak Yigit Kaya) +* Update: adds `numbers` option to quote-props (fixes #2914) (Jose Roberto Vidal) +* Fix: `quote-props` rule should ignore computed and shorthand properties (fixes #3557) (fixes #3544) (Burak Yigit Kaya) +* Docs: Add config comments for rule examples 'accessor-pairs' to 'no-extra-semi' (refs #2271) (Ian VanSchooten) +* Update: Return to accept `undefined` type (fixes #3382) (Gyandeep Singh) +* New: Added HTML formatter (fixes #3505) (Julian Laval) +* Fix: check space after yield keyword in space-unary-ops (fixes #2707) (Mathias Schreck) +* Docs: (curly) Fix broken code in example (Kent C. Dodds) +* Update: Quote var name in `no-unused-vars` error messages (refs #3526) (Burak Yigit Kaya) +* Update: Move methods to SourceCode (fixes #3516) (Nicholas C. Zakas) +* Fix: Don't try too hard to find fault in `no-implicit-coercion` (refs #3402) (Burak Yigit Kaya) +* Fix: Detect ternary operator in operator-linebreak rule (fixes #3274) (Burak Yigit Kaya) +* Docs: Clearer plugin rule configuration (fixes #2022) (Nicholas C. Zakas) +* Update: Add quotes around the label in `no-empty-label` error reports (fixes #3526) (Burak Yigit Kaya) +* Docs: Turn off Liquid in example (Nicholas C. Zakas) +* Docs: Mention CommonJS along with Node.js (fixes #3388) (Nicholas C. Zakas) +* Docs: Make it clear which rules are recommended (fixes #3398) (Nicholas C. Zakas) +* Docs: Add links to JSON Schema resources (fixes #3411) (Nicholas C. Zakas) +* Docs: Add more info to migration guide (fixes #3439) (Nicholas C. Zakas) +* Fix: ASI indentation issue (fixes #3514) (Burak Yigit Kaya) +* Fix: Make `no-implicit-coercion` smarter about numerical expressions (fixes #3510) (Burak Yigit Kaya) +* Fix: `prefer-template` had not been handling TemplateLiteral as literal node (fixes #3507) (Toru Nagashima) +* Update: `newline-after-var` Allow comment + blank after var (fixes #2852) (Ian VanSchooten) +* Update: Add `unnecessary` option to `quote-props` (fixes #3381) (Burak Yigit Kaya) +* Fix: `indent` shouldn't check the last line unless it is a punctuator (fixes #3498) (Burak Yigit Kaya) +* Fix: `indent` rule does not indent when doing multi-line chain calls (fixes #3279) (Burak Yigit Kaya) +* Fix: sort-vars rule fails when memo is undefined (fixes #3474) (Burak Yigit Kaya) +* Fix: `brace-style` doesn't report some closing brace errors (fixes #3486) (Burak Yigit Kaya) +* Update: separate options for block and line comments in `spaced-comment` rule (fixes #2897) (Burak Yigit Kaya) +* Fix: `indent` does not check FunctionDeclaration nodes properly (fixes #3173) (Burak Yigit Kaya) +* Update: Added "properties" option to `id-length` rule to ignore property names. (fixes #3450) (Mathieu M-Gosselin) +* Update: add new ignore pattern options to no-unused-vars (fixes #2321) (Mathias Schreck) +* New: Protractor environment (fixes #3457) (James Whitney) +* Docs: Added section to shareable config (Gregory Waxman) +* Update: Allow pre-parsed code (fixes #1025, fixes #948) (Nicholas C. Zakas) + +v1.2.1 - August 20, 2015 + +* Fix: "key-spacing" crashes eslint on object literal shorthand properties (fixes #3463) (Burak Yigit Kaya) +* Fix: ignore leading space check for `null` elements in comma-spacing (fixes #3392) (Mathias Schreck) +* Fix: `prefer-arrow-callback` false positive at recursive functions (fixes #3454) (Toru Nagashima) +* Fix: one-var rule doesn’t have default options (fixes #3449) (Burak Yigit Kaya) +* Fix: Refactor `no-duplicate-case` to be simpler and more efficient (fixes #3440) (Burak Yigit Kaya) +* Docs: Fix trailing spaces in README (Nicholas C. Zakas) +* Docs: Update gyandeeps and add byk (Nicholas C. Zakas) +* Docs: Update plugins documentation for 1.0.0 (Nicholas C. Zakas) +* Docs: `object-curly-spacing` doc is inaccurate about exceptions (Burak Yigit Kaya) +* Fix: `object-curly-spacing` shows the incorrect column for opening brace (fixes #3438) (Burak Yigit Kaya) + +v1.2.0 - August 18, 2015 + +* Update: add support for semicolon in comma-first setup in indent rule (fixes #3423) (Burak Yigit Kaya) +* Docs: better JSDoc for indent rule (Burak Yigit Kaya) +* Docs: Document the second argument of `CLIEngine.executeOnText()` (Sindre Sorhus) +* New: `no-dupe-class-members` rule (fixes #3294) (Toru Nagashima) +* Fix: exclude `AssignmentExpression` and `Property` nodes from extra indentation on first line (fixes #3391) (Burak Yigit Kaya) +* Update: Separate indent options for var, let and const (fixes #3339) (Burak Yigit Kaya) +* Fix: Add AssignmentPattern to space-infix-ops (fixes #3380) (Burak Yigit Kaya) +* Docs: Fix typo: exception label (tienslebien) +* Update: Clean up tests for CLI config support (refs #2543) (Gyandeep Singh) +* New: `block-spacing` rule (fixes #3303) (Toru Nagashima) +* Docs: Update docs for no-iterator (fixes #3405) (Nicholas C. Zakas) +* Upgrade: bump `espree` dependency to `2.2.4` (fixes #3403) (Burak Yigit Kaya) +* Fix: false positive on switch 'no duplicate case', (fixes #3408) (Cristian Carlesso) +* Fix: `valid-jsdoc` test does not recognize aliases for `@param` (fixes #3399) (Burak Yigit Kaya) +* New: enable `-c` flag to accept a shareable config (fixes #2543) (Shinnosuke Watanabe) +* Fix: Apply plugin given in CLI (fixes #3383) (Ian VanSchooten) +* New: Add commonjs environment (fixes #3377) (Nicholas C. Zakas) +* Docs: Update no-unused-var docs (Nicholas C. Zakas) +* Fix: trailing commas in object-curly-spacing for import/export (fixes #3324) (Henry Zhu) +* Update: Make `baseConfig` to behave as other config options (fixes #3371) (Gyandeep Singh) +* Docs: Add "Compatibility" section to linebreak-style (Vitor Balocco) +* New: `prefer-arrow-callback` rule (fixes #3140) (Toru Nagashima) +* Docs: Clarify what an unused var is (fixes #2342) (Nicholas C. Zakas) +* Docs: Mention double-byte character limitation in max-len (fixes #2370) (Nicholas C. Zakas) +* Fix: object curly spacing incorrectly warning for import with default and multiple named specifiers (fixes #3370) (Luke Karrys) +* Fix: Indent rule errors with array of objects (fixes #3329) (Burak Yigit Kaya) +* Update: Make it clear that `space-infix-ops` support `const` (fixes #3299) (Burak Yigit Kaya) +* New: `prefer-template` rule (fixes #3014) (Toru Nagashima) +* Docs: Clarify `no-process-env` docs (fixes #3318) (Nicholas C. Zakas) +* Docs: Fix arrow name typo (fixes #3309) (Nicholas C. Zakas) +* Update: Improve error message for `indent` rule violation (fixes #3340) (Burak Yigit Kaya) +* Fix: radix rule does not apply for Number.parseInt (ES6) (fixes #3364) (Burak Yigit Kaya) +* Fix: `key-spacing.align` doesn't pay attention to non-whitespace before key (fixes #3267) (Burak Yigit Kaya) +* Fix: arrow-parens & destructuring/default params (fixes #3353) (Jamund Ferguson) +* Update: Add support for Allman to brace-style rule, brackets on newline (fixes #3347) (Burak Yigit Kaya) +* Fix: Regression no-catch-shadow (1.1.0) (fixes #3322) (Burak Yigit Kaya) +* Docs: remove note outdated in 1.0.0 (Denis Sokolov) +* Build: automatically convert line endings in release script (fixes #2642) (Burak Yigit Kaya) +* Update: allow disabling new-cap on object methods (fixes #3172) (Burak Yigit Kaya) +* Update: Improve checkstyle format (fixes #3183) (Burak Yigit Kaya) +* Fix: Indent rule errors if an array literal starts a new statement (fixes #3328) (Burak Yigit Kaya) +* Update: Improve validation error messages (fixes #3193) (Burak Yigit Kaya) +* Docs: fix syntax error in space-before-function-paren (Fabrício Matté) +* Fix: `indent` rule to check for last line correctly (fixes #3327) (Gyandeep Singh) +* Fix: Inconsistent off-by-one errors with column numbers (fixes #3231) (Burak Yigit Kaya) +* Fix: Keyword "else" must not be followed by a newline (fixes #3226) (Burak Yigit Kaya) +* Fix: `id-length` does not work for most of the new ES6 patterns (fixes #3286) (Burak Yigit Kaya) +* Fix: Spaced Comment Exceptions Not Working (fixes #3276) (Jamund Ferguson) + +v1.1.0 - August 7, 2015 + +* Update: Added as-needed option to arrow-parens (fixes #3277) (Jamund Ferguson) +* Fix: curly-spacing missing import case (fixes #3302) (Jamund Ferguson) +* Fix: `eslint-env` in comments had not been setting `ecmaFeatures` (fixes #2134) (Toru Nagashima) +* Fix: `es6` env had been missing `spread` and `newTarget` (fixes #3281) (Toru Nagashima) +* Fix: Report no-spaced-func on last token before paren (fixes #3289) (Benjamin Woodruff) +* Fix: Check for null elements in indent rule (fixes #3272) (Gyandeep Singh) +* Docs: Use backticks for option heading (Gyandeep Singh) +* Fix: `no-invalid-this` had been missing jsdoc comment (fixes #3287) (Toru Nagashima) +* Fix: `indent` rule for multi-line objects and arrays (fixes #3236) (Gyandeep Singh) +* Update: add new `multi-or-nest` option for the `curly` rule (fixes #1806) (Ivan Nikulin) +* Fix: `no-cond-assign` had been missing simplest pattern (fixes #3249) (Toru Nagashima) +* Fix: id-length rule doesn't catch violations in arrow function parameters (fixes #3275) (Burak Yigit Kaya) +* New: Added grep-style formatter (fixes #2991) (Nobody Really) +* Update: Split out generic AST methods into utility (fixes #962) (Gyandeep Singh) +* Fix: `accessor-pairs` false positive (fixes #3262) (Toru Nagashima) +* Fix: `context.getScope()` returns correct scope in blockBindings (fixes #3254) (Toru Nagashima) +* Update: Expose `getErrorResults` as a static method on `CLIEngine` (fixes #3242) (Gyandeep Singh) +* Update: Expose `getFormatter` as a static method on `CLIEngine` (fixes #3239) (Gyandeep Singh) +* Docs: use correct encoding for id-match.md (fixes #3246) (Matthieu Larcher) +* Docs: place id-match rule at correct place in README.md (fixes #3245) (Matthieu Larcher) +* Docs: Update no-proto.md (Joe Zimmerman) +* Docs: Fix typo in object-shorthand docs (Gunnar Lium) +* Upgrade: inquirer dependency (fixes #3241) (Gyandeep Singh) +* Fix: `indent` rule for objects and nested one line blocks (fixes #3238, fixes #3237) (Gyandeep Singh) +* Docs: Fix wrong options in examples of key-spacing (keik) +* Docs: Adds missing "not" to semi.md (Marius Schulz) +* Docs: Update no-multi-spaces.md (Kenneth Powers) +* Fix: `indent` to not error on same line nodes (fixes #3228) (Gyandeep Singh) +* New: Jest environment (fixes #3212) (Darshak Parikh) + +v1.0.0 - July 31, 2015 + +* Update: merge `no-reserved-keys` into `quote-props` (fixes #1539) (Jose Roberto Vidal) +* Fix: `indent` error message (fixes #3220) (Gyandeep Singh) +* Update: Add embertest env (fixes #3205) (ismay) +* Docs: Correct documentation errors for `id-length` rule. (Jess Telford) +* Breaking: `indent` rule to have node specific options (fixes #3210) (Gyandeep Singh) +* Fix: space-after-keyword shouldn't allow newlines (fixes #3198) (Brandon Mills) +* New: Add JSON formatter (fixes #3036) (Burak Yigit Kaya) +* Breaking: Switch to RuleTester (fixes #3186) (Nicholas C. Zakas) +* Breaking: remove duplicate warnings of `no-undef` from `block-scoped-var` (fixes #3201) (Toru Nagashima) +* Fix: `init-declarations` ignores in for-in/of (fixes #3202) (Toru Nagashima) +* Fix: `quotes` with `"backtick"` ignores ModuleSpecifier and LiteralPropertyName (fixes #3181) (Toru Nagashima) +* Fix: space-in-parens in Template Strings (fixes #3182) (Ian VanSchooten) +* Fix: Check for concatenation in no-throw-literal (fixes #3099, fixes #3101) (Ian VanSchooten) +* Build: Remove `eslint-tester` from devDependencies (fixes #3189) (Gyandeep Singh) +* Fix: Use new ESLintTester (fixes #3187) (Nicholas C. Zakas) +* Update: `new-cap` supports fullnames (fixes #2584) (Toru Nagashima) +* Fix: Non object rule options merge (fixes #3179) (Gyandeep Singh) +* New: add id-match rule (fixes #2829) (Matthieu Larcher) +* Fix: Rule options merge (fixes #3175) (Gyandeep Singh) +* Fix: `spaced-comment` allows a mix of markers and exceptions (fixes #2895) (Toru Nagashima) +* Fix: `block-scoped-var` issues (fixes #2253, fixes #2747, fixes #2967) (Toru Nagashima) +* New: Add id-length rule (fixes #2784) (Burak Yigit Kaya) +* Update: New parameters for quote-props rule (fixes #1283, fixes #1658) (Tomasz Olędzki) + +v1.0.0-rc-3 - July 24, 2015 + +* Fix: Make Chai and Mocha as a dependency (fixes #3156) (Gyandeep Singh) +* Fix: traverse `ExperimentalSpread/RestProperty.argument` (fixes #3157) (Toru Nagashima) +* Fix: Check shareable config package prefix correctly (fixes #3146) (Gyandeep Singh) +* Update: move redeclaration checking for builtins (fixes #3070) (Toru Nagashima) +* Fix: `quotes` with `"backtick"` allows directive prologues (fixes #3132) (Toru Nagashima) +* Fix: `ESLintTester` path in exposed API (fixes #3149) (Gyandeep Singh) +* Docs: Remove AppVeyor badge (Gyandeep Singh) +* Fix: Check no-new-func on CallExpressions (fixes #3145) (Benjamin Woodruff) + +v1.0.0-rc-2 - July 23, 2015 + +* Docs: Mention eslint-tester in migration guide (Nicholas C. Zakas) +* Docs: Mention variables defined in a global comment (fixes #3137) (William Becker) +* Docs: add documentation about custom-formatters. (fixes #1260) (royriojas) +* Fix: Multi-line variable declarations indent (fixes #3139) (Gyandeep Singh) +* Fix: handles blocks in no-use-before-define (fixes #2960) (Jose Roberto Vidal) +* Update: `props` option of `no-param-reassign` (fixes #1600) (Toru Nagashima) +* New: Support shared configs named `@scope/eslint-config`, with shortcuts of `@scope` and `@scope/` (fixes #3123) (Jordan Harband) +* New: Add ignorePattern, ignoreComments, and ignoreUrls options to max-len (fixes #2934, fixes #2221, fixes #1661) (Benjamin Woodruff) +* Build: Increase Windows Mocha timeout (fixes #3133) (Ian VanSchooten) +* Docs: incorrect syntax in the example for rule «one-var» (Alexander Burtsev) +* Build: Check commit message format at end of tests (fixes #3058) (Ian VanSchooten) +* Update: Move eslint-tester into repo (fixes #3110) (Nicholas C. Zakas) +* Fix: Not load configs outside config with `root: true` (fixes #3109) (Gyandeep Singh) +* Docs: Add config information to README (fixes #3074) (Nicholas C. Zakas) +* Docs: Add mysticatea as committer (Nicholas C. Zakas) +* Docs: Grammar fixes in rule descriptions (refs #3038) (Greg Cochard) +* Fix: Update sort-vars to ignore Array and ObjectPattern (fixes #2954) (Harry Ho) +* Fix: block-scoped-var rule incorrectly flagging break/continue with label (fixes #3082) (Aparajita Fishman) +* Fix: spaces trigger wrong in `no-useless-call` and `prefer-spread` (fixes #3054) (Toru Nagashima) +* Fix: `arrow-spacing` allow multi-spaces and line-endings (fixes #3079) (Toru Nagashima) +* Fix: add missing loop scopes to one-var (fixes #3073) (Jose Roberto Vidal) +* New: the `no-invalid-this` rule (fixes #2815) (Toru Nagashima) +* Fix: allow empty loop body in no-extra-semi (fixes #3075) (Mathias Schreck) +* Update: Add qunit to environments (fixes #2870) (Nicholas C. Zakas) +* Fix: `space-before-blocks` to consider classes (fixes #3062) (Gyandeep Singh) +* Fix: Include phantomjs globals (fixes #3064) (Linus Unnebäck) +* Fix: no-else-return handles multiple else-if blocks (fixes #3015) (Jose Roberto Vidal) +* Fix: `no-*-assgin` rules support destructuring (fixes #3029) (Toru Nagashima) +* New: the `no-implicit-coercion` rule (fixes #1621) (Toru Nagashima) +* Fix: Make no-implied-eval match more types of strings (fixes #2898) (Benjamin Woodruff) +* Docs: Clarify that bot message is automatic (Ian VanSchooten) +* Fix: Skip rest properties in no-dupe-keys (fixes 3042) (Nicholas C. Zakas) +* Docs: New issue template (fixes #3048) (Nicholas C. Zakas) +* Fix: strict rule supports classes (fixes #2977) (Toru Nagashima) +* New: the `prefer-reflect` rule (fixes #2939) (Keith Cirkel) +* Docs: make grammar consistent in rules index (Greg Cochard) +* Docs: Fix unmatched paren in rule description (Greg Cochard) +* Docs: Small typo fix in no-useless-call documentation (Paul O’Shannessy) +* Build: readd phantomjs dependency with locked down version (fixes #3026) (Mathias Schreck) +* Docs: Add IanVS as committer (Nicholas C. Zakas) +* docs: additional computed-property-spacing documentation (fixes #2941) (Jamund Ferguson) +* Docs: Add let and const examples for newline-after-var (fixes #3020) (James Whitney) +* Build: Remove unnecessary phantomjs devDependency (fixes #3021) (Gyandeep Singh) +* Update: added shared builtins list (fixes #2972) (Jose Roberto Vidal) + +v1.0.0-rc-1 - July 15, 2015 + +* Upgrade: Espree to 2.2.0 (fixes #3011) (Nicholas C. Zakas) +* Docs: fix a typo (bartmichu) +* Fix: indent rule should recognize single line statements with ASI (fixes #3001, fixes #3000) (Mathias Schreck) +* Update: Handle CRLF line endings in spaced-comment rule - 2 (fixes #3005) (Burak Yigit Kaya) +* Fix: Indent rule error on empty block body (fixes #2999) (Gyandeep Singh) +* New: the `no-class-assign` rule (fixes #2718) (Toru Nagashima) +* New: the `no-const-assign` rule (fixes #2719) (Toru Nagashima) +* Docs: Add 1.0.0 migration guide (fixes #2994) (Nicholas C. Zakas) +* Docs: Update changelog for 0.24.1 (fixes #2976) (Nicholas C. Zakas) +* Breaking: Remove deprecated rules (fixes #1898) (Ian VanSchooten) +* Fix: multi-line + fat arrow indent (fixes #2239) (Gyandeep Singh) +* Breaking: Create eslint:recommended and add to --init (fixes #2713) (Greg Cochard) +* Fix: Indent rule (fixes #1797, fixes #1799, fixes #2248, fixes #2343, fixes #2278, fixes #1800) (Gyandeep Singh) +* New: `context.getDeclaredVariables(node)` (fixes #2801) (Toru Nagashima) +* New: the `no-useless-call` rule (fixes #1925) (Toru Nagashima) +* New: the `prefer-spread` rule (fixes #2946) (Toru Nagashima) +* Fix: `valid-jsdoc` counts `return` for arrow expressions (fixes #2952) (Toru Nagashima) +* New: Add exported comment option (fixes #1200) (Jamund Ferguson) +* Breaking: Default to --reset behavior (fixes #2100) (Brandon Mills) +* New: Add arrow-parens and arrow-spacing rule (fixes #2628) (Jxck) +* Fix: Shallow cloning issues in eslint config (fixes #2961) (Gyandeep Singh) +* Add: Warn on missing rule definition or deprecation (fixes #1549) (Ian VanSchooten) +* Update: adding some tests for no-redeclare to test named functions (fixes #2953) (Dominic Barnes) +* New: Add support for root: true in config files (fixes #2736) (Ian VanSchooten) +* Fix: workaround for leading and trailing comments in padded-block (fixes #2336 and fixes #2788) (Mathias Schreck) +* Fix: object-shorthand computed props (fixes #2937) (Jamund Ferguson) +* Fix: Remove invalid check inside `getJSDocComment` function (fixes #2938) (Gyandeep Singh) +* Docs: Clarify when not to use space-before-blocks (Ian VanSchooten) +* Update: `no-loop-func` allows block-scoped variables (fixes #2517) (Toru Nagashima) +* Docs: remove mistaken "off by default" (Jan Schär) +* Build: Add appveyor CI system (fixes #2923) (Gyandeep Singh) +* Docs: Fix typo in the shareable configs doc (Siddharth Kannan) +* Fix: max-len to report correct column number (fixes #2926) (Mathias Schreck) +* Fix: add destructuring support to comma-dangle rule (fixes #2911) (Mathias Schreck) +* Docs: clarification in no-unused-vars (Jan Schär) +* Fix: `no-redeclare` checks module scopes (fixes #2903) (Toru Nagashima) +* Docs: missing quotes in JSON (Jan Schär) +* Breaking: Switch to 1-based columns (fixes #2284) (Nicholas C. Zakas) +* Docs: array-bracket-spacing examples used space-in-brackets (Brandon Mills) +* Docs: Add spaced-line-comment deprecation notice (Brandon Mills) +* Docs: Add space-in-brackets deprecation notice (Brandon Mills) +* Fix: Include execScript in no-implied-eval rule (fixes #2873) (Frederik Braun) +* Fix: Support class syntax for line-around-comment rule (fixes #2894) (Gyandeep Singh) +* Fix: lines-around-comment was crashing in some cases due to a missing check (fixes #2892) (Mathieu M-Gosselin) +* New: Add init-declarations rule (fixes #2606) (cjihrig) +* Docs: Fix typo in array-bracket-spacing rule (zallek) +* Fix: Added missing export syntax support to the block-scoped-var rule. (fixes #2887) (Mathieu M-Gosselin) +* Build: gensite target supports rule removal (refs #1898) (Brandon Mills) +* Update: Handle CRLF line endings in spaced-comment rule (fixes #2884) (David Anson) +* Update: Attach parent in getNodeByRangeIndex (fixes #2863) (Brandon Mills) +* Docs: Fix typo (Bryan Smith) +* New: Add serviceworker environment (fixes #2557) (Gyandeep Singh) +* Fix: Yoda should ignore comparisons where both sides are constants (fixes #2867) (cjihrig) +* Update: Loosens regex rules around intentional fall through comments (Fixes #2811) (greg5green) +* Update: Add missing schema to rules (fixes #2858) (Ilya Volodin) +* New: `require-yield` rule (fixes #2822) (Toru Nagashima) +* New: add callback-return rule (fixes #994) (Jamund Ferguson) + +v0.24.1 - July 10, 2015 + +* Docs: Clarify when not to use space-before-blocks (Ian VanSchooten) +* Docs: remove mistaken "off by default" (Jan Schär) +* Docs: remove mistaken "off by default" (Jan Schär) +* Docs: Fix typo in the shareable configs doc (Siddharth Kannan) +* Docs: clarification in no-unused-vars (Jan Schär) +* Docs: missing quotes in JSON (Jan Schär) +* Fix: Revert 1-based column changes in tests for patch (refs #2284) (Nicholas C. Zakas) +* Fix: Shallow cloning issues in eslint config (fixes #2961) (Gyandeep Singh) +* Fix: object-shorthand computed props (fixes #2937) (Jamund Ferguson) +* Fix: Remove invalid check inside `getJSDocComment` function (fixes #2938) (Gyandeep Singh) +* Fix: max-len to report correct column number (fixes #2926) (Mathias Schreck) +* Fix: add destructuring support to comma-dangle rule (fixes #2911) (Mathias Schreck) +* Fix: `no-redeclare` checks module scopes (fixes #2903) (Toru Nagashima) +* Fix: Include execScript in no-implied-eval rule (fixes #2873) (Frederik Braun) +* Fix: Support class syntax for line-around-comment rule (fixes #2894) (Gyandeep Singh) +* Fix: lines-around-comment was crashing in some cases due to a missing check (fixes #2892) (Mathieu M-Gosselin) +* Fix: Added missing export syntax support to the block-scoped-var rule. (fixes #2887) (Mathieu M-Gosselin) +* Fix: Yoda should ignore comparisons where both sides are constants (fixes #2867) (cjihrig) +* Docs: array-bracket-spacing examples used space-in-brackets (Brandon Mills) +* Docs: Add spaced-line-comment deprecation notice (Brandon Mills) +* Docs: Add space-in-brackets deprecation notice (Brandon Mills) + +v0.24.0 - June 26, 2015 + +* Upgrade: eslint-tester to 0.8.1 (Nicholas C. Zakas) +* Fix: no-dupe-args sparse array crash (fixes #2848) (Chris Walker) +* Fix: space-after-keywords should ignore extra parens (fixes #2847) (Mathias Schreck) +* New: add no-unexpected-multiline rule (fixes #746) (Glen Mailer) +* Update: refactor handle-callback-err to improve performance (fixes #2841) (Mathias Schreck) +* Fix: Add --init to the CLI options (fixes #2817) (Gyandeep Singh) +* Update: Add `except-parens` option to `no-return-assign` rule (fixes #2809) (Toru Nagashima) +* Fix: handle-callback-err missing arrow functions (fixes #2823) (Jamund Ferguson) +* Fix: `no-extra-semi` in class bodies (fixes #2794) (Toru Nagashima) +* Fix: Check type to be file when looking for config files (fixes #2790) (Gyandeep Singh) +* Fix: valid-jsdoc to work for object getters (fixes #2407) (Gyandeep Singh) +* Update: Add an option as an object to `generator-star-spacing` rule (fixes #2787) (Toru Nagashima) +* Build: Update markdownlint dependency (David Anson) +* Fix: context report message to handle more scenarios (fixes #2746) (Gyandeep Singh) +* Update: Ignore JsDoc comments by default for `spaced-comment` (fixes #2766) (Gyandeep Singh) +* Fix: one-var 'never' option for mixed initialization (Fixes #2786) (Ian VanSchooten) +* Docs: Fix a minor typo in a prefer-const example (jviide) +* Fix: comma-dangle always-multiline: no comma right before the last brace (fixes #2091) (Benoît Zugmeyer) +* Fix: Allow blocked comments with markers and new-line (fixes #2777) (Gyandeep Singh) +* Docs: small fix in quote-props examples (Jose Roberto Vidal) +* Fix: object-shorthand rule should not warn for NFEs (fixes #2748) (Michael Ficarra) +* Fix: arraysInObjects for object-curly-spacing (fixes #2752) (Jamund Ferguson) +* Docs: Clarify --rule description (fixes #2773) (Nicholas C. Zakas) +* Fix: object literals in arrow function bodies (fixes #2702) (Jose Roberto Vidal) +* New: `constructor-super` rule (fixes #2720) (Toru Nagashima) +* New: `no-this-before-super` rule (fixes #2721) (Toru Nagashima) +* Fix: space-unary-ops flags expressions starting w/ keyword (fixes #2764) (Michael Ficarra) +* Update: Add block options to `lines-around-comment` rule (fixes #2667) (Gyandeep Singh) +* New: array-bracket-spacing (fixes #2226) (Jamund Ferguson) +* Fix: No-shadow rule duplicating error messages (fixes #2706) (Aliaksei Shytkin) + +v0.23.0 - June 14, 2015 + +* Build: Comment out auto publishing of release notes (refs #2640) (Ilya Volodin) +* Fix: "extends" within package.json (fixes #2754) (Gyandeep Singh) +* Upgrade: globals@8.0.0 (fixes #2759) (silverwind) +* Docs: eol-last docs fix (fixes #2755) (Gyandeep Singh) +* Docs: btmills is a reviewer (Nicholas C. Zakas) +* Build: Revert lock io.js to v2.1.0 (refs #2745) (Brandon Mills) +* New: computed-property-spacing (refs #2226) (Jamund Ferguson) +* Build: Pin Sinon version (fixes #2742) (Ilya Volodin) +* Fix: `prefer-const` treats `for-in`/`for-of` with the same way (Fixes #2739) (Toru Nagashima) +* Docs: Add links to team members profile (Gyandeep Singh) +* Docs: add team and ES7 info to readme (Nicholas C. Zakas) +* Fix: don't try to strip "line:" prefix from parser errors with no such prefix (fixes #2698) (Tim Cuthbertson) +* Fix: never ignore config comment options (fixes #2725) (Brandon Mills) +* Update: Add clarification to spaced-comment (refs #2588) (Greg Cochard) +* Update: Add markers to spaced-comment (fixes #2588) (Greg Cochard) +* Fix: no-trailing-spaces now handles skipBlankLines (fixes #2575) (Greg Cochard) +* Docs: Mark global-strict on by default (fixes #2629) (Ilya Volodin) +* New: Allow extends to be an array (fixes #2699) (Justin Morris) +* New: globals@7.1.0 (fixes #2682) (silverwind) +* New: `prefer-const` rule (fixes #2333) (Toru Nagashima) +* Fix: remove hard-coded list of unary keywords in space-unary-ops rule (fixes #2696) (Tim Cuthbertson) +* Breaking: Automatically validate rule options (fixes #2595) (Brandon Mills) +* Update: no-lone-blocks does not report block-level scopes (fixes #2119) (Jose Roberto Vidal) +* Update: yoda onlyEquality option (fixes #2638) (Denis Sokolov) +* Docs: update comment to align with source code it's referencing (Michael Ficarra) +* Fix: Misconfigured default option for lines-around-comment rule (fixes #2677) (Gyandeep Singh) +* Fix: `no-shadow` allows shadowing in the TDZ (fixes #2568) (Toru Nagashima) +* New: spaced-comment rule (fixes #1088) (Gyandeep Singh) +* Fix: Check unused vars in exported functions (fixes #2678) (Gyandeep Singh) +* Build: Stringify payload of release notes (fixes #2640) (Greg Cochard) +* Fix: Allowing u flag in regex to properly lint no-empty-character-class (fixes #2679) (Dominic Barnes) +* Docs: deprecate no-wrap-func (fixes #2644) (Jose Roberto Vidal) +* Docs: Fixing grammar: then -> than (E) +* Fix: trailing commas in object-curly-spacing (fixes #2647) (Jamund Ferguson) +* Docs: be consistent about deprecation status (Matthew Dapena-Tretter) +* Docs: Fix mistakes in object-curly-spacing docs (Matthew Dapena-Tretter) +* New: run processors when calling executeOnText (fixes #2331) (Mordy Tikotzky) +* Update: move executeOnText() tests to the correct describe block (fixes #2648) (Mordy Tikotzky) +* Update: add tests to assert that the preprocessor is running (fixes #2651) (Mordy Tikotzky) +* Build: Lock io.js to v2.1.0 (fixes #2653) (Ilya Volodin) + +v0.22.1 - May 30, 2015 + +* Build: Remove release notes auto-publish (refs #2640) (Ilya Volodin) + +v0.22.0 - May 30, 2015 + +* Upgrade: escope 3.1.0 (fixes #2310, #2405) (Toru Nagashima) +* Fix: “consistent-this” incorrectly flagging destructuring of `this` (fixes #2633) (David Aurelio) +* Upgrade: eslint-tester to 0.7.0 (Ilya Volodin) +* Update: allow shadowed references in no-alert (fixes #1105) (Mathias Schreck) +* Fix: no-multiple-empty-lines and template strings (fixes #2605) (Jamund Ferguson) +* New: object-curly-spacing (fixes #2225) (Jamund Ferguson) +* Docs: minor fix for one-var rule (Jamund Ferguson) +* Fix: Shared config being clobbered by other config (fixes #2592) (Dominic Barnes) +* Update: adds "functions" option to no-extra-parens (fixes #2477) (Jose Roberto Vidal) +* Docs: Fix json formatting for lines-around-comments rule (Gyandeep Singh) +* Fix: Improve around function/class names of `no-shadow` (fixes #2556, #2552) (Toru Nagashima) +* Fix: Improve code coverage (fixes #2590) (Ilya Volodin) +* Fix: Allow scoped configs to have sub-configs (fixes #2594) (Greg Cochard) +* Build: Add auto-update of release tag on github (fixes #2566) (Greg Cochard) +* New: lines-around-comment (fixes #1344) (Jamund Ferguson) +* Build: Unblock build by increasing code coverage (Ilya Volodin) +* New: accessor-pairs rule to object initializations (fixes #1638) (Gyandeep Singh) +* Fix: counting of variables statements in one-var (fixes #2570) (Mathias Schreck) +* Build: Add sudo:false for Travis (fixes #2582) (Ilya Volodin) +* New: Add rule schemas (refs #2179) (Brandon Mills) +* Docs: Fix typo in shareable-configs example (fixes #2571) (Ted Piotrowski) +* Build: Relax markdownlint rules by disabling style-only items (David Anson) +* Fix: Object shorthand rule incorrectly flagging getters/setters (fixes #2563) (Brad Dougherty) +* New: Add config validator (refs #2179) (Brandon Mills) +* New: Add worker environment (fixes #2442) (Ilya Volodin) +* New no-empty-character class (fixes #2508) (Jamund Ferguson) +* New: Adds --ignore-pattern option. (fixes #1742) (Patrick McElhaney) + +v0.21.2 - May 18, 2015 + +* 0.21.2 (Nicholas C. Zakas) +* Fix: one-var exception for ForStatement.init (fixes #2505) (Brandon Mills) +* Fix: Don't throw spurious shadow errors for classes (fixes #2545) (Jimmy Jia) +* Fix: valid-jsdoc rule to support exported functions (fixes #2522) (Gyandeep Singh) +* Fix: Allow scoped packages in configuration extends (fixes #2544) (Eric Isakson) +* Docs: Add chatroom to FAQ (Nicholas C. Zakas) +* Docs: Move Gitter badge (Nicholas C. Zakas) + +v0.21.1 - May 15, 2015 + +* 0.21.1 (Nicholas C. Zakas) +* Fix: loc obj in report fn expects column (fixes #2481) (Varun Verma) +* Build: Make sure that all md files end with empty line (fixes #2520) (Ilya Volodin) +* Added Gitter badge (The Gitter Badger) +* Fix: forced no-shadow to check all scopes (fixes #2294) (Jose Roberto Vidal) +* Fix: --init indent setting (fixes #2493) (Nicholas C. Zakas) +* Docs: Mention bundling multiple shareable configs (Nicholas C. Zakas) +* Fix: Not to override the required extended config object directly (fixes #2487) (Gyandeep Singh) +* Build: Update markdownlint dependency (David Anson) +* Docs: added recursive function example to no-unused-vars (Jose Roberto Vidal) +* Docs: Fix typo (then -> than) (Vladimir Agafonkin) +* Revert "Fix: sanitise Jekyll interpolation during site generation (fixes #2297)" (Nicholas C. Zakas) +* Fix: dot-location should use correct dot token (fixes #2504) (Mathias Schreck) +* Fix: Stop linebreak-style from crashing (fixes #2490) (James Whitney) +* Fix: rule no-duplicate-case problem with CallExpressions. (fixes #2499) (Matthias Osswald) +* Fix: Enable full support for eslint-env comments (refs #2134) (Ilya Volodin) +* Build: Speed up site generation (fixes #2475) (Ilya Volodin) +* Docs: Fixing trailing spaces (Fixes #2478) (Ilya Volodin) +* Docs: Update README FAQs (Nicholas C. Zakas) +* Fix: Allow comment before comma for comma-spacing rule (fixes #2408) (Gyandeep Singh) + +v0.21.0 - May 9, 2015 + +* 0.21.0 (Nicholas C. Zakas) +* New: Shareable configs (fixes #2415) (Nicholas C. Zakas) +* Fix: Edge cases for no-wrap-func (fixes #2466) (Nicholas C. Zakas) +* Docs: Update ecmaFeatures description (Nicholas C. Zakas) +* New: Add dot-location rule. (fixes #1884) (Greg Cochard) +* New: Add addPlugin method to CLI-engine (Fixes #1971) (Ilya Volodin) +* Breaking: Do not check unset declaration types (Fixes #2448) (Ilya Volodin) +* Fix: no-redeclare switch scoping (fixes #2337) (Nicholas C. Zakas) +* Fix: Check extra scope in no-use-before-define (fixes #2372) (Nicholas C. Zakas) +* Fix: Ensure baseConfig isn't changed (fixes #2380) (Nicholas C. Zakas) +* Fix: Don't warn for member expression functions (fixes #2402) (Nicholas C. Zakas) +* New: Adds skipBlankLines option to the no-trailing-spaces rule (fixes #2303) (Andrew Vaughan) +* Fix: Adding exception for last line (Refs #2423) (Greg Cochard) +* Fix: crash on 0 max (fixes #2423) (gcochard) +* Fix object-shorthand arrow functions (fixes #2414) (Jamund Ferguson) +* Fix: Improves detection of self-referential functions (fixes #2363) (Jose Roberto Vidal) +* Update: key-spacing groups must be consecutive lines (fixes #1728) (Brandon Mills) +* Docs: grammar fix in no-sync (Tony Lukasavage) +* Docs: Update configuring.md to fix incorrect link. (Ans) +* New: Check --stdin-filename by ignore settings (fixes #2432) (Aliaksei Shytkin) +* Fix: `no-loop-func` rule allows functions at init part (fixes #2427) (Toru Nagashima) +* New: Add init command (fixes #2302) (Ilya Volodin) +* Fix: no-irregular-whitespace should work with irregular line breaks (fixes #2316) (Mathias Schreck) +* Fix: generator-star-spacing with class methods (fixes #2351) (Brandon Mills) +* New: no-unneeded-ternary rule to disallow boolean literals in conditional expressions (fixes #2391) (Gyandeep Singh) +* Docs: Add `restParams` to `ecmaFeatures` options list (refs: #2346) (Bogdan Savluk) +* Fix: space-in-brackets Cannot read property 'range' (fixes #2392) (Gyandeep Singh) +* Docs: Sort the rules (Lukas Böcker) +* Add: Exception option for `no-extend-native` and `no-native-reassign` (fixes #2355) (Gyandeep Singh) +* Fix: space-in-brackets import declaration (fixes #2378) (Gyandeep Singh) +* Update: Add uninitialized and initialized options (fixes #2206) (Ian VanSchooten) +* Fix: brace-style to not warn about curly mix ifStatements (fixes #1739) (Gyandeep Singh) +* Fix: npm run profile script should use espree (fixes #2150) (Mathias Schreck) +* New: Add support for extending configurations (fixes #1637) (Espen Hovlandsdal) +* Fix: Include string literal keys in object-shorthand (Fixes #2374) (Jamund Ferguson) +* Docs: Specify language for all code fences, enable corresponding markdownlint rule. (David Anson) +* New: linebreak-style rule (fixes #1255) (Erik Müller) +* Update: Add "none" option to operator-linebreak rule (fixes #2295) (Casey Visco) +* Fix: sanitise Jekyll interpolation during site generation (fixes #2297) (Michael Ficarra) + +v0.20.0 - April 24, 2015 + +* 0.20.0 (Nicholas C. Zakas) +* Fix: support arrow functions in no-extra-parens (fixes #2367) (Michael Ficarra) +* Fix: Column position in space-infix-ops rule (fixes #2354) (Gyandeep Singh) +* Fix: allow plugins to be namespaced (fixes #2360) (Seth Pollack) +* Update: one-var: enable let & const (fixes #2301) (Joey Baker) +* Docs: Add meteor to avaiable environments list (bartmichu) +* Update: Use `Object.assign()` polyfill for all object merging (fixes #2348) (Sindre Sorhus) +* Docs: Update markdownlint dependency, resolve/suppress new issues. (David Anson) +* Fix: newline-after-var declare and export (fixes #2325) (Gyandeep Singh) +* Docs: Some typos and grammar. (AlexKVal) +* Fix: newline-after-var to ignore declare in for specifiers (fixes #2317) (Gyandeep Singh) +* New: add --stdin-filename option (fixes #1950) (Mordy Tikotzky) +* Fix: Load .eslintrc in $HOME only if no other .eslintrc is found (fixes #2279) (Jasper Woudenberg) +* Fix: Add `v8` module to no-mixed-requires rule (fixes #2320) (Gyandeep Singh) +* Fix: key-spacing with single properties (fixes #2311) (Brandon Mills) +* Docs: `no-invalid-regexp`: add `ecmaFeatures` flags for `u`/`y` (Jordan Harband) +* New: object-shorthand rule (refs: #1617) (Jamund Ferguson) +* Update: backticks support for quotes rule (fixes #2153) (borislavjivkov) +* Fix: space-in-brackets to work with modules (fixes #2216) (Nicholas C. Zakas) + +v0.19.0 - April 11, 2015 + +* 0.19.0 (Nicholas C. Zakas) +* Upgrade: Espree to 2.0.1 (Nicholas C. Zakas) +* Docs: Update one-var documentation (fixes #2210) (Nicholas C. Zakas) +* Update: Add test for no-undef (fixes #2214) (Nicholas C. Zakas) +* Fix: Report better location for padded-blocks error (fixes #2224) (Nicholas C. Zakas) +* Fix: Don't check concise methods in quote-props (fixes #2251) (Nicholas C. Zakas) +* Fix: Consider tabs for space-in-parens rule (fixes #2191) (Josh Quintana) +* Fix: block-scoped-var to work with classes (fixes #2280) (Nicholas C. Zakas) +* Docs: Remove trailing spaces, enable corresponding markdownlint rule. (David Anson) +* Fix: padded-blocks with ASI (fixes #2273) (Brandon Mills) +* Fix: Handle comment lines in newline-after-var (fixed #2237) (Casey Visco) +* Docs: Standardize on '*' for unordered lists, enable corresponding markdownlint rule. (David Anson) +* Fix: no-undef and no-underscore-dangle to use double quotes (fixes #2258) (Gyandeep Singh) +* Docs: Improve grammar and style in comma-dangle.md (Nate Eagleson) +* Docs: Improve grammar and style in padded-blocks.md (Nate Eagleson) +* Docs: Update URL in no-wrap-func.md to resolve 404 (Nate Eagleson) +* Docs: Fix typo in command-line-interface.md (Nate Eagleson) +* Docs: Fix typo in working-with-rules.md (Nate Eagleson) +* Docs: Remove hard tabs from *.md, enable corresponding markdownlint rule. (David Anson) +* Fix: Function id missing in parent scope when using ecmaFeature `modules` for rule block-scoped-var (fixes #2242) (Michael Ferris) +* Fix: Ignore single lines for vertical alignment (fixes #2018) (Ian VanSchooten) +* Fix: Allow inline comments in newline-after-var rule (fixes #2229) (Casey Visco) +* Upgrade: Espree 2.0.0 and escope 3.0.0 (fixes #2234, fixes #2201, fixes (Nicholas C. Zakas) +* Docs: Update --no-ignore warning (Brandon Mills) +* Build: Remove jshint files (fixes #2222) (Jeff Tan) +* Docs: no-empty fix comment change (refs #2188) (Gyandeep Singh) +* Fix: duplicate semi and no-extra-semi errors (fixes #2207) (Brandon Mills) +* Docs: Update processors description (Nicholas C. Zakas) +* Fix: semi error on export declaration (fixes #2194) (Brandon Mills) +* New: operator-linebreak rule (fixes #1405) (Benoît Zugmeyer) +* Docs: Fixing broken links in documentation (Ilya Volodin) +* Upgrade: Espree to 0.12.3 (fixes #2195) (Gyandeep Singh) +* Fix: camelcase rule with {properties: never} shouldn't check assignment (fixes #2189) (Gyandeep Singh) +* New: Allow modifying base config (fixes #2143) (Meo) +* New: no-continue rule (fixes #1945) (borislavjivkov) +* Fix: `no-empty` rule should allow any comments (fixes #2188) (Gyandeep Singh) +* Docs: Fix spell in camelcase doc (fixes #2190) (Gyandeep Singh) +* Fix: Require semicolon after import/export statements (fixes #2174) (Gyandeep Singh) +* Build: Add linting of Markdown files to "npm test" script (fixes #2182) (David Anson) +* Build: Fixing site generation (Ilya Volodin) +* Build: Fix gensite task to work even if files are missing (Nicholas C. Zakas) + +v0.18.0 - March 28, 2015 + +* 0.18.0 (Nicholas C. Zakas) +* Fix: Mark variables as used in module scope (fixes #2137) (Nicholas C. Zakas) +* Fix: arrow functions need wrapping (fixes #2113) (Nicholas C. Zakas) +* Fix: Don't crash on empty array pattern item (fixes #2111) (Nicholas C. Zakas) +* Fix: Don't error on destructured params (fixes #2051) (Nicholas C. Zakas) +* Docs: Fixing broken links (Ilya Volodin) +* Fix: no-constant-condition should not flag += (fixes #2155) (Nicholas C. Zakas) +* Fix: Ensure piped in code will trigger correct errors (fixes #2154) (Nicholas C. Zakas) +* Fix: block-scoped-var to handle imports (fixes #2087) (Nicholas C. Zakas) +* Fix: no-dupe-args to work with destructuring (fixes #2148) (Nicholas C. Zakas) +* Fix: key-spacing crash on computed properties (fixes #2120) (Brandon Mills) +* Fix: indent crash on caseless switch (fixes #2144) (Brandon Mills) +* Fix: Don't warn about destructured catch params (fixes #2125) (Nicholas C. Zakas) +* Update: Omit setter param from no-unused-vars (fixes #2133) (Nicholas C. Zakas) +* Docs: Cleaning dead links (Ilya Volodin) +* Docs: Moving documentation out of the repository and modifying build scripts (Ilya Volodin) +* Docs: Update link to Documentation (Kate Lizogubova) +* Docs: Adding back deprecated space-unary-word-ops documentation (Ilya Volodin) +* Fix: Unused recursive functions should be flagged (issue2095) (Nicholas C. Zakas) +* Breaking: Remove JSX support from no-undef (fixes #2093) (Nicholas C. Zakas) +* Fix: markVariableAsUsed() should work in Node.js env (fixes #2089) (Nicholas C. Zakas) +* New: Add "always" and "never" options to "one-var" rule. (fixes #1619) (Danny Fritz) +* New: newline-after-var rule (fixes #2057) (Gopal Venkatesan) +* Fix: func-names with ES6 classes (fixes #2103) (Marsup) +* Fix: Add "Error" to the "new-cap" rule exceptions (fixes #2098) (Mickaël Tricot) +* Fix: vars-on-top conflict with ES6 import (fixes #2099) (Gyandeep Singh) +* Docs: Fixed JSON syntax (Sajin) +* New: space-before-function-paren rule (fixes #2028) (Brandon Mills) +* Breaking: rule no-empty also checking for empty catch blocks. (fixes #1841) (Dieter Oberkofler) +* Update: rule camelcase to allow snake_case in object literals. (fixes #1919) (Dieter Oberkofler) +* New: Added option int32Hint for space-infix-ops (fixes #1295) (Kirill Efimov) +* New: no-param-reassign rule (fixes #1599) (Nat Burns) + +v0.17.1 - March 17, 2015 + +* 0.17.1 (Nicholas C. Zakas) +* Fix: no-func-assign should not fail on import declarations (fixes #2060) (Igor Zalutsky) +* Fix: block-scoped-var to work with destructuring (fixes #2059) (Nicholas C. Zakas) +* Fix: no-redeclare should check Node.js scope (fixes #2064) (Nicholas C. Zakas) +* Fix: space-before-function-parentheses generator methods (fixes #2082) (Brandon Mills) +* Fix: Method name resolution in complexity rule (fixes #2049) (Nicholas C. Zakas) +* Fix: no-unused-vars crash from escope workaround (fixes #2042) (Brandon Mills) +* Fix: restrict dot-notation keywords to actual ES3 keywords (fixes #2075) (Michael Ficarra) +* Fix: block-scoped-var to work with classes (fixes #2048) (Nicholas C. Zakas) +* Docs: Update no-new documentation (fixes #2044) (Nicholas C. Zakas) +* Fix: yoda range exceptions with this (fixes #2063) (Brandon Mills) +* Docs: Fix documentation on configuring eslint with comments (Miguel Ping) +* Fix: rule no-duplicate-case problem with MemberExpressions. (fixes #2038) (Dieter Oberkofler) +* Fix: Exempt \0 from no-octal-escape (fixes #1923) (Michael Ficarra) + +v0.17.0 - March 14, 2015 + +* 0.17.0 (Nicholas C. Zakas) +* Fix: module import specifiers should be defined (refs #1978) (Nicholas C. Zakas) +* Fix: Ignore super in no-undef (refs #1968) (Nicholas C. Zakas) +* Upgrade: Espree to v0.12.0 (refs #1968) (Nicholas C. Zakas) +* Fix: destructured arguments should work in block-scoped-var (fixes #1996) (Nicholas C. Zakas) +* Fix: Line breaking with just carriage return (fixes #2005) (Nicholas C. Zakas) +* Fix: location of new-cap error messages (fixes #2025) (Mathias Schreck) +* Breaking: Stop checking JSX variable use, expose API instead (fixes #1911) (Glen Mailer) +* Fix: Check spacing of class methods (fixes #1989) (Nicholas C. Zakas) +* New: no-duplicate-case rule to disallow a duplicate case label (fixes #2015) (Dieter Oberkofler) +* Clarify issue requirement for doc pull requests (Ian) +* Add quotes around object key (Ian) +* Fix: Add comma-dangle allow-multiline (fixes #1984) (Keith Cirkel) +* Fix: Don't explode on default export function (fixes #1985) (Nicholas C. Zakas) +* Update: Add AST node exceptions to comma-style. (fixes #1932) (Evan Simmons) +* Docs: Add spread operator to available language options (Nicholas C. Zakas) +* New: generator-star-spacing rule (fixes #1680, fixes #1949) (Brandon Mills) + +v0.16.2 - March 10, 2015 + +* 0.16.2 (Nicholas C. Zakas) +* Fix: Ensure globalReturn isn't on when node:false (fixes #1995) (Nicholas C. Zakas) +* Downgrade: escope pegged to 2.0.6 (refs #2001) (Nicholas C. Zakas) +* Upgrade: escope to 2.0.7 (fixes #1978) (Nicholas C. Zakas) +* Docs: Update descriptive text for --no-ignore option. (David Anson) +* Upgrade: estraverse to latest for ESTree support (fixes #1986) (Nicholas C. Zakas) +* Fix: Global block-scope-var check should work (fixes #1980) (Nicholas C. Zakas) +* Fix: Don't warn about parens around yield (fixes #1981) (Nicholas C. Zakas) + +v0.16.1 - March 8, 2015 + +* 0.16.1 (Nicholas C. Zakas) +* Fix: Node.js scoping in block-scoped-var (fixes #1969) (Nicholas C. Zakas) +* Update: Enable ES6 scoping for more options (Nicholas C. Zakas) +* Fix: Ensure all export nodes are traversable (fixes #1965) (Nicholas C. Zakas) +* Fix: Ensure class names are marked as used (fixes #1967) (Nicholas C. Zakas) +* Fix: remove typo that caused a crash (fixes #1963) (Fabricio C Zuardi) +* Docs: Added missing "are" (Sean Wilkinson) + +v0.16.0 - March 7, 2015 + +* 0.16.0 (Nicholas C. Zakas) +* Fix: Pass correct sourceType to escope (fixes #1959) (Nicholas C. Zakas) +* Fix: Scoping for Node.js (fixes #892) (Nicholas C. Zakas) +* Fix: strict rule should honor module code (fixes #1956) (Nicholas C. Zakas) +* New: Add es6 environment (fixes #1864, fixes #1944) (Nicholas C. Zakas) +* Docs: Update ecmaFeatures list (fixes #1942) (Nicholas C. Zakas) +* Fix: Make no-unused-vars ignore exports (fixes #1903) (Nicholas C. Zakas) +* Upgrade: Espree to v1.11.0 (Nicholas C. Zakas) +* Fix: Comment configuration of rule doesn't work (fixes #1792) (Jary) +* Fix: Rest args should work in no-undef and block-scoped-var (fixes #1543) (Nicholas C. Zakas) +* Breaking: change no-comma-dangle to comma-dangle (fixes #1350) (Mathias Schreck) +* Update: space-before-function-parentheses to support generators (fixes #1929) (Brandon Mills) +* New: Adding support for "// eslint-disable-line rule" style comments (Billy Matthews) +* Fix: Use unversioned sinon file in browser test (fixes #1947) (Nicholas C. Zakas) +* Docs: Add mention of compatible parsers (Nicholas C. Zakas) +* Fix: Better error when given null as rule config (fixes #1760) (Glen Mailer) +* Update: no-empty to check TryStatement.handler (fixes #1930) (Brandon Mills) +* Fix: space-before-function-parentheses and object methods (fixes #1920) (Brandon Mills) +* New: no-dupe-args rule (fixes #1880) (Jamund Ferguson) +* Fix: comma-spacing should ignore JSX text (fixes #1916) (Brandon Mills) +* Breaking: made eol-last less strict (fixes #1460) (Glen Mailer) +* New: generator-star middle option (fixes #1808) (Jamund Ferguson) +* Upgrade: Espree to 1.10.0 for classes support (Nicholas C. Zakas) +* Docs: no-plusplus.md - auto semicolon insertion (Miroslav Obradović) +* Docs: Use union types in TokenStore JSDoc (refs #1878) (Brandon Mills) +* Fix: block-scoped-var to work with destructuring (fixes #1863) (Nicholas C. Zakas) +* Docs: Update docs for token-related methods (fixes #1878) (Nicholas C. Zakas) +* Update: Remove preferGlobal from package.json (fixes #1877) (Nicholas C. Zakas) +* Fix: allow block bindings in no-inner-declarations (fixes #1893) (Roberto Vidal) +* Fix: getScope and no-use-before-define for arrow functions (fixes #1895) (Brandon Mills) +* Fix: Make no-inner-declarations look for arrow functions (fixes #1892) (Brandon Mills) +* Breaking: Change no-space-before-semi to semi-spacing and add "after" option (fixes #1671) (Mathias Schreck) +* Update: Add support for custom preprocessors (fixes #1817) (Ilya Volodin) + +v0.15.1 - February 26, 2015 + +* 0.15.1 (Nicholas C. Zakas) +* Build: Fix release task (Nicholas C. Zakas) +* Fix: check all semicolons in no-space-before-semi (fixes #1885) (Mathias Schreck) +* Fix: Refactor comma-spacing (fixes #1587, fixes #1845) (Roberto Vidal) +* Fix: Allow globalReturn in consistent-return (fixes #1868) (Brandon Mills) +* Fix: semi rule should check throw statements (fixes #1873) (Mathias Schreck) +* Docs: Added HolidayCheck AG as user (0xPIT) +* Upgrade: `chalk` to 1.0.0 (Sindre Sorhus) +* Docs: Add CustomInk to the list of companies (Derek Lindahl) +* Docs: Alphabetize project & company usage list (Derek Lindahl) +* Docs: fix typo (Henry Zhu) +* Docs: Fix typo (Brenard Cubacub) + +v0.15.0 - February 21, 2015 + +* 0.15.0 (Nicholas C. Zakas) +* Upgrade: Espree to 1.9.1 (fixes #1816, fixes #1805) (Nicholas C. Zakas) +* Fix: make rules work with for-of statements (fixes #1859) (Mathias Schreck) +* Fix: Enable globalReturn for Node.js environment (fixes #1158) (Nicholas C. Zakas) +* Fix: Location of extra paren message (fixes #1814) (Nicholas C. Zakas) +* Fix: Remove unnecessary file exists check (fixes #1831) (Nicholas C. Zakas) +* Fix: Don't count else-if in max-depth (fixes #1835) (Nicholas C. Zakas) +* Fix: Don't flag for-of statement (fixes #1852) (Nicholas C. Zakas) +* Build: Test using io.js as well (Nicholas C. Zakas) +* Change customformat value to path (suisho) +* Docs: Add a missing word in the Contributing doc (Ben Linskey) +* Docs: Fix typo in wrap-iife rule doc title (Ben Linskey) +* Docs: Update pages to fix rendering of lists (David Anson) +* Fix: new-cap should allow defining exceptions (fixes #1424) (Brian Di Palma) +* Update: Add requireReturnDescription for valid-jsdoc (fixes #1833) (Brian Di Palma) +* New: rule no-throw-literal added (fixes #1791) (Dieter Oberkofler) +* New: multi-line option for the curly rule (fixes #1812) (Hugo Wood) +* Docs: fix typo in configuring docs (mendenhallmagic) +* Update: Backslashes in path (fixes #1818) (Jan Schär) +* Docs: Update pages to fix rendering of lists and fenced code blocks (David Anson) +* Docs: add webpack loader to the docs/integrations page (Maxime Thirouin) +* Breaking: space-before-function-parentheses replaces space-after-function-name and checkFunctionKeyword (fixes #1618) (Mathias Schreck) + +v0.14.1 - February 8, 2015 + +* 0.14.1 (Nicholas C. Zakas) +* Fix: Exit code should be 1 for any number of errors (fixes #1795) (Nicholas C. Zakas) +* Fix: Check indentation of first line (fixes #1796) (Nicholas C. Zakas) +* Fix: strict rules shouldn't throw on arrow functions (fixes #1789) (Nicholas C. Zakas) + +v0.14.0 - February 7, 2015 + +* 0.14.0 (Nicholas C. Zakas) +* Update: Fix indentation of comment (Nicholas C. Zakas) +* Fix: comma-spacing for template literals (fixes #1736) (Nicholas C. Zakas) +* Build: Add Node.js 0.12 testing (Nicholas C. Zakas) +* Breaking: Remove node from results (fixes #957) (Nicholas C. Zakas) +* Breaking: Exit code is now error count (Nicholas C. Zakas) +* Docs: Correct getFormatter() documentation (refs #1723) (Nicholas C. Zakas) +* Update: Make rules work with arrow functions (fixes #1508, fixes #1509, fixes #1493) (Nicholas C. Zakas) +* Fix: Ensure template string references count (fixes #1542) (Nicholas C. Zakas) +* Fix: no-undef to work with arrow functions (fixes #1604) (Nicholas C. Zakas) +* Upgrade: Espree to version 1.8.0 (Nicholas C. Zakas) +* Fix: Don't throw error for arguments (fixes #1759) (Nicholas C. Zakas) +* Fix: Don't warn on computed nonliteral properties (fixes #1762) (Nicholas C. Zakas) +* New: Allow parser to be configured (fixes #1624) (Nicholas C. Zakas) +* Docs: Added double quotes for JSON keys for comma-spacing and key-spacing rule (Dmitry Polovka) +* New: Rule indent (fixes #1022) (Dmitriy Shekhovtsov) +* Revert "New: Rule indent (fixes #1022)" (Nicholas C. Zakas) +* Update: fix eslint indentations (fixes #1770) (Dmitriy Shekhovtsov) +* Fix: Scoping issues for no-unused-vars (fixes #1741) (Nicholas C. Zakas) +* Docs: Added `eslint-enable` inline (Ivan Fraixedes) +* New: Add predefined Meteor globals (fixes #1763) (Johan Brook) +* New: Rule indent (fixes #1022) (Dmitriy Shekhovtsov) +* Update: Check all assignments for consistent-this (fixes #1513) (Timothy Jones) +* Fix: Support exceptions in no-multi-spaces (fixes #1755) (Brandon Mills) +* Docs: Forgotten parentheses in code snippet (Ivan Fraixedes) +* Update: CLIEngine results include warning and error count (fixes #1732) (gyandeeps) +* Fix: Scoping issues for no-unused-vars (fixes #1733) (Nicholas C. Zakas) +* Update: Add getNodeByRangeIndex method (refs #1755) (Brandon Mills) +* Update: Replace getTokenByRange(Index->Start) (refs #1721) (Brandon Mills) +* Update: Fast-path for empty input (fixes #546) (Nicholas C. Zakas) +* Fix: Allow single line else-if (fixes #1739) (Nicholas C. Zakas) +* Fix: Don't crash when $HOME isn't set (fixes #1465) (Nicholas C. Zakas) +* Fix: Make no-multi-spaces work for every case (fixes #1603, fixes #1659) (Nicholas C. Zakas) +* Breaking: Show error and warning counts in stylish summary (fixes #1746) (Brandon Mills) +* Docs: fixed typo in no-lone-blocks docs (Vitor Balocco) +* Docs: fixed typo in consistent-return docs (Vitor Balocco) +* Breaking: remove implied eval check from no-eval (fixes #1202) (Mathias Schreck) +* Update: Improve CLIEngine.getFormatter() (refs #1723) (Nicholas C. Zakas) +* Docs: Add Backbone plugin link (Ilya Volodin) +* Docs: use npm's keyword route (Tom Vincent) +* Build: Update sitegen script (Closes #1725) (Ilya Volodin) + +v0.13.0 - January 24, 2015 + +* 0.13.0 (Nicholas C. Zakas) +* Update: The rule spaced-line-comment now also allows tabs and not only spaces as whitespace. (fixes #1713) (Dieter Oberkofler) +* Docs: add Jasmine rules and eslintplugin npm links (Tom Vincent) +* Fix: Make no-redeclare work with let (fixes #917) (Nicholas C. Zakas) +* Update: Add CLIEngine.getFormatter() (fixes #1653) (Nicholas C. Zakas) +* Breaking: Update escope (fixes #1642) (Nicholas C. Zakas) +* Update: Switch to using estraverse-fb (fixes #1712) (Nicholas C. Zakas) +* Docs: Update README FAQ (Nicholas C. Zakas) +* Update: no-warning-comments matches on whole word only (fixes #1709) (Nick Fisher) +* Build: Add JSDoc generation (fixes #1363) (Nicholas C. Zakas) +* Docs: Add more info about context (fixes #1330) (Nicholas C. Zakas) +* Upgrade: Espree to 1.7.1 (fixes #1706) (Nicholas C. Zakas) +* Docs: Make CLA notice more prominent (Nicholas C. Zakas) +* Update: Added globals for: phantom,jquery, prototypejs, shelljs (fixes #1704) (Dmitriy Shekhovtsov) +* Docs: Fixed example for the space-return-throw-case rule (mpal9000) +* Fix: Except object literal methods from func-names (fixes #1699) (Brandon Mills) +* Update: use global strict mode everywhere (fixes #1691) (Brandon Mills) +* Update: Add allowPattern option for dot-notation rule (fixes #1679) (Tim Schaub) +* Fix: Missing undeclared variables in JSX (fixes #1676) (Yannick Croissant) +* Fix: no-unused-expressions rule incorrectly flagging yield (fixes #1672) (Rémi Gérard-Marchant) +* Update: Combine strict mode rules (fixes #1246) (Brandon Mills) +* Fix: disregards leading './' in ignore pattern or file name (fixes #1685) (Chris Montrois) +* Upgrade: globals module to latest (fixes #1670) (Nicholas C. Zakas) +* Fix: generator-star should allow params (fixes #1677) (Brandon Mills) +* Fix: no-unused-vars for JSX (fixes #1673 and fixes #1534) (Yannick Croissant) +* Docs: Add angularjs-eslint link into the integration doc (Emmanuel DEMEY) + +v0.12.0 - January 17, 2015 + +* 0.12.0 (Nicholas C. Zakas) +* Fix: Track JSX global variable correctly (fixes #1534) (Nicholas C. Zakas) +* Fix: Property regex flag checking (fixes #1537) (Nicholas C. Zakas) +* Docs: Add angularjs-eslint link into the integration doc (Emmanuel DEMEY) +* Update: Expose ecmaFeatures on context (fixes #1648) (Nicholas C. Zakas) +* Docs: Added Fitbit to the list of companies (Igor Zalutsky) +* New: gen-star rule (refs #1617) (Jamund Ferguson) +* New: no-var rule (refs #1617) (Jamund Ferguson) +* Fix: Support JSX spread operator (fixes #1634) (Nicholas C. Zakas) +* Docs: Document ecmaFeatures (Nicholas C. Zakas) +* Upgrade: several dependencies (fixes #1377) (Nicholas C. Zakas) +* Fix: Broken JSX test (Nicholas C. Zakas) +* Fix: no-bitwise reports on bitwise assignment expressions (fixes #1643) (Mathias Schreck) +* Fix: Find JSXIdentifier refs in no-unused-vars (fixes #1534) (Nicholas C. Zakas) +* Update: Add a couple JSX tests (Nicholas C. Zakas) +* Fix: quotes rule ignores JSX literals (fixes #1477) (Nicholas C. Zakas) +* Fix: Don't warn on JSX literals with newlines (fixes #1533) (Nicholas C. Zakas) +* Update: Fully enable JSX support (fixes #1640) (Nicholas C. Zakas) +* Breaking: Allow parser feature flips (fixes #1602) (Nicholas C. Zakas) +* Fix: Allow comments in key-spacing groups (fixes #1632) (Brandon Mills) +* Fix: block-scoped-var reports labels (fixes #1630) (Michael Ficarra) +* Docs: add newline to no-process-env (fixes #1627) (Tom Vincent) +* Fix: Update optionator, --no in help (fixes #1134) (George Zahariev) +* Fix: Allow individual newlines in space-in-brackets (fixes #1614) (Brandon Mills) +* Docs: Correct alignment in example project tree (Tim Schaub) +* Docs: Remove references to Esprima (Nicholas C. Zakas) +* Docs: Remove illegal code fence (Nicholas C. Zakas) + +v0.11.0 - December 30, 2014 + +* 0.11.0 (Nicholas C. Zakas) +* Fix: Adding regexp literal exception (fixes #1589) (Greg Cochard) +* Fix: padded-blocks incorrectly complained on comments (fixes #1416) (Mathias Schreck) +* Fix: column location of key-spacing with additional tokens (fixes #1458) (Mathias Schreck) +* Build: tag correct commit (refs #1606) (Mathias Schreck) +* Upgrade: Updat Espree to 1.3.1 (Nicholas C. Zakas) +* Fix: add es3 config option to dot-notation rule (fixes #1484) (Michael Ficarra) +* Fix: valid-jsdoc should recognize @class (fixes #1585) (Nicholas C. Zakas) +* Update: Switch to use Espree (fixes #1595) (Nicholas C. Zakas) +* Fix: brace-style stroustrup should report on cuddled elseif (fixes #1583) (Ian Christian Myers) +* New: Configuration via package.json (fixes #698) (Michael Mclaughlin) +* Update: Set environments w/ globals (fixes #1577) (Elan Shanker) +* Fix: yoda treats negative numbers as literals (fixes #1571) (Brandon Mills) +* Fix: function arguments now count towards no-shadow check (fixes #1584) (Glen Mailer) +* Fix: check if next statement is on newline when warning against extra semicolons. (fixes #1580) (Evan You) +* Update: add yoda exception for range tests (fixes #1561) (Brandon Mills) +* New: space-after-function-name (fixes #1340) (Roberto Vidal) + +v0.10.2 - December 12, 2014 + +* 0.10.2 (Nicholas C. Zakas) +* Fix: detect for...in in no-loop-func (fixes #1573) (Greg Cochard) +* Update: simplify comma-spacing logic (fixes #1562) (Brandon Mills) +* Fix: operator-assignment addition is non-commutative (fixes#1556) (Brandon Mills) +* 0.10.1 (Nicholas C. Zakas) +* Update: Add new-cap exception configurations. (Fixes #1487) - `newCapsAllowed` - `nonNewCapsAllowed` (Jordan Harband) + +v0.10.1 - December 6, 2014 + +* 0.10.1 (Nicholas C. Zakas) +* Docs: Fix v0.10.0 changelog (Nicholas C. Zakas) +* Build: Ensure changelog works with large semver versions (Nicholas C. Zakas) +* Fix: comma-spacing and comma-style to work with array literals (fixes #1492) (Nicholas C. Zakas) +* Update: better operator regex in use-isnan rule (fixes #1551) (Michael Ficarra) +* Fix: wrong op index in no-multi-spaces (fixes #1547) (Brandon Mills) +* Fix: Restrict use-isnan violations to comparison operators. (Fixes #1535) (Jordan Harband) +* Fix: comma-spacing has false positives when parenthesis are used (fixes #1457) (Jamund Ferguson) +* Docs: alphabetize the "Stylistic Issues" section (Jeff Williams) +* Build: make the "gensite" target work when DOCS_DIR does not exist (fixes #1530) (Jeff Williams) +* Docs: badges should only refer to master branch (Mathias Schreck) +* Fix: prevent crash on empty blocks in no-else-return (fixes #1527) (Mathias Schreck) +* Build: Fix md to html conversion regex (fixes #1525) (Brandon Mills) +* 0.10.0 (Nicholas C. Zakas) + +v0.10.0 - November 27, 2014 + +* 0.10.0 (Nicholas C. Zakas) +* Fix: Add Object and Function as exceptions in new-cap (refs #1487) (Nicholas C. Zakas) +* Breaking: Allow extensionless files to be passed on CLI (fixes #1131) (Nicholas C. Zakas) +* Fix: typo: iffe to iife, none to non (Michael Ficarra) +* Update: refactor tokens API (refs #1212) (Brandon Mills) +* New: Allow other file extensions (fixes #801) (Nicholas C. Zakas) +* Update: Add Event to browser globals (fixes #1474) (Nicholas C. Zakas) +* Fix: check function call arguments in comma-spacing (fixes #1515) (Mathias Schreck) +* Update: Add no-cond-assign option to disallow nested assignments in conditionals (fixes #1444) (Jeff Williams) +* Fix: crash in no-multi-spaces on empty array elements (fixes #1418) (Brandon Mills) +* Fix: Don't explode on directory traversal (fixes #1452) (Nicholas C. Zakas) +* Fix: no-fallthrough should work when semis are missing (fixes #1447) (Nicholas C. Zakas) +* Fix: JSDoc parsing by updating doctrine (fixes #1442) (Nicholas C. Zakas) +* Update: restore the "runs" global present in Jasmine 1.3 (fixes #1498) (Michał Gołębiowski) +* Fix: ignore undefined identifiers in typeof (fixes #1482) (Mathias Schreck) +* Fix: Ignoring empty comments. (fixes #1488) (Greg Cochard) +* New: Add space-unary-ops rules (#1346) (Marcin Kumorek) +* Update: Remove shebang workaround in spaced-line-comment (fixes #1433) (Michael Ficarra) +* Docs: change 'and' to 'an' in docs/rules/valid-jsdoc.md (fixes #1441) (Michael Ficarra) +* Update: Add `beforeAll` and `afterAll` to the Jasmine globals (fixes #1478) (Gyandeep Singh) +* Update: Add exception options to space-in-parens (fixes #1368) (David Clark) +* Build: Add check for license issues (fixes #782) (Brandon Mills) +* Docs: update badges (Yoshua Wuyts) +* Docs: Update pages to fix rendering of lists and fenced code blocks (David Anson) +* Fix: env rules merging for command line config (fixes #1271) (Roberto Vidal) +* Fix: Collect variables declare in switch-case.(fixes #1453) (chris) +* Fix: remove extra capture group (Nate-Wilkins) +* Update: allow distinct alignment groups in key-spacing (fixes #1439) (Brandon Mills) +* Fix: message for numeric property names in quote-props (fixes #1459) (Brandon Mills) +* Docs: Remove assumption about the rule config (Alexander Schmidt) +* New: Add ability to time individual rules (fixes #1437) (Brandon Mills) +* Fix: single quotes (Nate-Wilkins) +* Docs: Fix broken code fences in key-spacing docs (Brandon Mills) +* Docs: Explain .eslintignore features (fixes #1094) (Brandon Mills) +* Breaking: ignore node_modules by default (fixes #1163) (Brandon Mills) +* Fix: Adds clamping to getSource beforeCount (fixes #1427) (Greg Gianforcaro) +* New: add no-inline-comment rule (fixes #1366) (Greg Cochard) +* Fix: '.md' to '.html' with anchors (fixes #1415) (Nate-Wilkins) +* Build: Filter and sort versions in gensite (fixes #1430) (Brandon Mills) +* Build: Escape period in regex (fixes #1428) (Brandon Mills) +* Revert "Fix: '.md' to '.html' with anchors (fixes #1415)" (Nicholas C. Zakas) +* 0.9.2 (Nicholas C. Zakas) +* New: Add operator-assignment rule (fixes #1420) (Brandon Mills) + +v0.9.2 - November 1, 2014 + +* 0.9.2 (Nicholas C. Zakas) +* Fix: '.md' to '.html' with anchors (fixes #1415) (Nate-Wilkins) +* Fix: Allow line breaks in key-spacing rule (fixes #1407) (Brandon Mills) +* Build: add coveralls integration (fixes #1411) (Mathias Schreck) +* Fix: add severity flag for ignored file warning (fixes #1401) (Mathias Schreck) +* Fix: Keep sinon at ~1.10.3 (fixes #1406) (Brandon Mills) +* Fix: ! negates .eslintignore patterns (fixes #1093) (Brandon Mills) +* Fix: let fs.stat throw if a file does not exist (fixes #1296) (Mathias Schreck) +* Fix: check switch statements in space-before-blocks (fixes #1397) (Mathias Schreck) +* Docs: fix rule name in example configuration (Mathias Schreck) +* Fix: disable colors during test run (fixes #1395) (Mathias Schreck) +* New: add isPathIgnored method to CLIEngine (fixes #1392) (Mathias Schreck) +* Docs: changing eslint to ESLint and add missing backtick (Mathias Schreck) +* Docs: Documents the functionality to load a custom formatter from a file (Adam Baldwin) +* 0.9.1 (Nicholas C. Zakas) +* Update: Option type for mixed tabs and spaces (fixes #1374) (Max Nordlund) +* Fix: Nested occurrences of no-else-return now show multiple reports (fixes #1369) (Jordan Hawker) + +v0.9.1 - October 25, 2014 + +* 0.9.1 (Nicholas C. Zakas) +* Docs: fix link on governance model (azu) +* Fix: plugins without rulesConfig causes crash (fixes #1388) (Mathias Schreck) +* 0.9.0 (Nicholas C. Zakas) + +v0.9.0 - October 24, 2014 + +* 0.9.0 (Nicholas C. Zakas) +* New: Allow reading from STDIN (fixes #368) (Nicholas C. Zakas) +* New: add --quiet option (fixes #905) (Mathias Schreck) +* Update: Add support for plugin default configuration (fixes #1358) (Ilya Volodin) +* Fix: Make sure shebang comment node is removed (fixes #1352) (Nicholas C. Zakas) +* New: Adding in rule for irregular whitespace checking. (fixes #1024) (Jonathan Kingston) +* Fix: space-in-parens should not throw for multiline statements (fixes #1351) (Jary) +* Docs: Explain global vs. local plugins (fixes #1238) (Nicholas C. Zakas) +* Docs: Add docs on Node.js API (fixes #1247) (Nicholas C. Zakas) +* Docs: Add recommended keywords for plugins (fixes #1248) (Nicholas C. Zakas) +* Update: Add CLIEngine#getConfigForFile (fixes #1309) (Nicholas C. Zakas) +* Update: turn on comma-style for project (fixes #1316) (Nicholas C. Zakas) +* Fix: Ensure messages are sorted by line (fixes #1343) (Nicholas C. Zakas) +* Update: Added arraysInObjects and objectsInObjects options to space-in-brackets rule (fixes #1265, fixes #1302) (vegetableman) +* Breaking: Removed comma spacing check from space-infix-ops (fixes #1361) (vegetableman) +* Fix: addressed linting errors (Nicholas C. Zakas) +* Docs: Add Contributor Model (fixes #1341) (Nicholas C. Zakas) +* Docs: Add reference to CLA (Nicholas C. Zakas) +* Build: add version numbers to docs (fixes #1170) (Mathias Schreck) +* Fix: no-fallthrough incorrectly flagged falls through annotations (fixes #1353) (Mathias Schreck) +* Build: separate site publishing form generation (fixes #1356) (Mathias Schreck) +* New: Add key-spacing rule (fixes #1280) (Brandon Mills) +* New: add spaced-line-comment rule (fixes #1345) (Greg Cochard) +* Docs: added more Related Rules sections (fixes #1347) (Delapouite) +* Fix: resolve linting issue in (fixes #1339) (Nicholas C. Zakas) +* New: add space-before-blocks rule (fixes #1277) (Mathias Schreck) +* Docs: Remove moot integration plugins (Sindre Sorhus) +* New: add rule for multiple empty lines (fixes #1254) (Greg Cochard) +* Fix: no-shadow rule should consider function expressions (fixes #1322) (Mathias Schreck) +* Update: remove globals present only in Jasmine plugins (fixes #1326) (Michał Gołębiowski) +* New: added no-multi-spaces rule (fixes #630) (vegetableman) +* New: Added comma-spacing rule (Fixes #628, Fixes #1319) (vegetableman) +* New: add rule for padded blocks (fixes #1278) (Mathias Schreck) +* Docs: fix eqeqeq isNullCheck comment (Denis Sokolov) +* Fix: no-comma-dangle violation in unit test and Makefile.js/lint not checking return codes (fixes #1306) (David Anson) +* Fix: allow comma-last with object properties having line breaks (fixes #1314) (vegetableman) +* New: Added comma-style rule (fixes #1282) (vegetableman) +* Update: add space after function keyword check (fixes #1276) (Mathias Schreck) +* Update: Add missing environments and fix sorting/grouping of rules (fixes #1307, fixes #1308) (David Anson) +* Docs: Fix sorting of rules within each section (David Anson) +* Docs: Correct a few misspelled words (David Anson) +* Docs: Update multiple pages to fix rendering of fenced code blocks (David Anson) +* New: Added no-process-env rule (fixes #657) (vegetableman) +* Fix: add rule ensuring #1258 is fixed by recent rewrite (fixes #1258) (Michael Ficarra) +* Update: split propertyName from singleValue in space-in-brackets (fixes #1253) (Michael Ficarra) +* Update: add "as-needed" option to quote-props rule (fixes #1279) (Michael Ficarra) +* Docs: fixed broken link and changed warning level to error level (vegetableman) +* Docs: Added "the native web" to the list of companies that use ESLint. (Golo Roden) +* Docs: Add BountySource badge to README (Nicholas C. Zakas) +* 0.8.2 (Nicholas C. Zakas) + +v0.8.2 - September 20, 2014 + +* 0.8.2 (Nicholas C. Zakas) +* Docs: Updated contribution guidelines to add accepted/bounty issues descriptions (Nicholas C. Zakas) +* Docs: Update README with links and FAQs (Nicholas C. Zakas) +* Docs: add finally to space-after-keywords documentation (Mathias Schreck) +* New: add ignoreCase option to sort-vars (fixes #1272) (Mathias Schreck) +* Docs: fix typo (Barry Handelman) +* Docs: Fix broken Markdown on configuration page (Nicholas C. Zakas) +* Docs: Fix reference to wrong rule name (Harry Wolff) +* Upgrade: Most dev dependencies (Nicholas C. Zakas) +* Upgrade: shelljs to 0.3.0 (Nicholas C. Zakas) +* Upgrade: doctrine to 0.5.2 (Nicholas C. Zakas) +* Upgrade: esprima to 1.2.2 (Nicholas C. Zakas) +* Upgrade: eslint-tester to latest (Nicholas C. Zakas) +* Fix: Load .eslintrc in directory with $HOME as an ancestor (fixes #1266) (Beau Gunderson) +* Fix: load .eslintrc from HOME (fixes #1262) (Beau Gunderson) +* New: Add sharable rule settings (fixes #1233) (Ilya Volodin) +* Upgrade: upgrade outdated dependencies (fixes #1251) (Mathias Schreck) +* Docs: fix typo in no-ex-assign documentation (Michael Ficarra) +* Docs: add intellij plugin to integrations (ido) +* Docs: Changing NPM to npm (Peter deHaan) +* Fix: strict should check function expressions (fixes #1244) (Brandon Mills) +* Docs: fix vars-on-top documentation (fixes #1234) (Mathias Schreck) +* 0.8.1 (Nicholas C. Zakas) +* Docs: Fixed a typo in brace-style.md (Anton Antonov) + +v0.8.1 - September 9, 2014 + +* 0.8.1 (Nicholas C. Zakas) +* Fix: Ensure exit code is 1 when there's a syntax error (fixes #1239) (Nicholas C. Zakas) +* Docs: fix up vars-on-top documentation (fixes #1234) (Michael Ficarra) +* Fix: vars-on-top directive support (fixes #1235) (Michael Ficarra) +* Fix: Avoid mutating node.range in max-len (fixes #1224) (Brandon Mills) +* Docs: Typo, add missing quotation mark (Ádám Lippai) +* Update: space-in-brackets to allow exceptions (fixes #1142) (Brandyn Bennett) +* 0.8.0 (Nicholas C. Zakas) + +v0.8.0 - September 5, 2014 + +* 0.8.0 (Nicholas C. Zakas) +* Perf-related revert "Fix: Speed up tokens API (refs #1212)" (Nicholas C. Zakas) +* Fix: no-fallthrough: continue affects control flow, too (fixes #1220) (Michael Ficarra) +* Fix: rewrite no-unused-vars rule (refs #1212) (Michael Ficarra) +* Fix: Error when there's a \r in .eslintrc (#1172) (Gyandeep Singh) +* Added rule disallowing reserved words being used as keys (fixes #1144) (Emil Bay) +* Fix: rewrite no-spaced-func rule (refs #1212) (Michael Ficarra) +* Fix: Speed up getScope() (refs #1212) (Brandon Mills) +* Fix: no-extra-strict behavior for named function expressions (fixes #1209) (Mathias Schreck) +* Add Date.UTC to allowed capitalized functions (David Brockman Smoliansky) +* New: Adding 'vars-on-top' rule (fixes #1148) (Gyandeep Singh) +* Fix: Speed up tokens API (refs #1212) (Brandon Mills) +* Docs: document plugin usage (fixes #1117) (Mathias Schreck) +* New: accept plugins from cli (fixes #1113) (Mathias Schreck) +* Docs: fix some typos. (Mathias Schreck) +* New: Load plugins from configs (fixes #1115). (Mathias Schreck) +* Fix: no-unused-expressions better directive detection (fixes #1195) (Michael Ficarra) +* Fix: no-unused-expressions directive support (fixes #1185) (Michael Ficarra) +* Update: Add 'allowSingleLine' option to brace-style (fixes #1089) (John Gozde) +* Docs: Spell checking and one extra closing curly in code example (Juga Paazmaya) +* Fix: mergeConfigs ensures the plugins property exists (fixes #1191). (Mathias Schreck) +* Update: Declare ES6 collections (Map, Set, WeakMap, WeakSet) as built-in globals (fixes #1189) (Michał Gołębiowski) +* New: Adding 'plugin' CLI option (fixes #1112) (Greg) +* Fix: Correct a typo in the error message in tests (Michał Gołębiowski) +* New: Add no-extra-bind rule to flag unnecessary bind calls (fixes #982) (Bence Dányi) +* Fix: Useless bind call in cli-engine (fixes #1181) (Bence Dányi) +* Docs: Updates `amd` description (fixes #1175) (James Whitney) +* New: Adds support for the `jasmine` env (fixes #1176) (James Whitney) +* Fix: for-in support to no-empty-label rule (fixes #1161) (Marc Harter) +* docs: Update link (Mathias Bynens) +* Fix: crash when loading empty eslintrc file (fixes #1164) (Michael Ficarra) +* Fix: no-unused-var should respect compound assignments (fixes #1166) (Michael Ficarra) +* Update: ES3 `ReservedWord`s (fixes #1151) Adds ES3 `ReservedWord`s to the list of keywords in the `dot-notation` rule (fixes #1151) (Emil Bay) +* Update: Update comment parser to read rule slashes (fixes #1116) (Jary) +* New: add no-void rule (fixes #1017). (Mike Sidorov) +* New: Add rules.import() (fixes #1114) (Mathias Schreck) +* New: Make mergeConfigs() merge plugin entries (fixes #1111) (Mathias Schreck) +* Breaking: Change no-global-strict to global-strict and add "always" option (fixes #989) (Brandon Mills) +* Fix: no-unreachable should check top-level statements (fixes #1138) (Brandon Mills) +* Fix: Speed up no-unreachable (fixes #1135) (Brandon Mills) +* New: advanced handle-callback-err configuration (fixes #1124) (Mathias Schreck) +* New: Expose CLIEngine (fixes #1083) (Gyandeep Singh) +* Docs: Add link to new Atom linter (fixes #1125) (Gil Pedersen) +* Fix: space-after-keywords checks finally of TryStatement (fixes #1122) (Michael Ficarra) +* Fix: space-after-keywords checks while of DoWhileStatement (fixes #1120) (Michael Ficarra) +* Fix: space-after-keywords w/ "never" should allow else-if (fixes #1118) (Michael Ficarra) +* Fix: dot-notation rule flags non-keyword reserved words (fixes #1102) (Michael Ficarra) +* Update: Use xml-escape instead of inline helper (Ref #848) (jrajav) +* Update: Added comments support to .eslintignore (fixes #1084) (Vitaly Puzrin) +* Update: enabled 'no-trailing-spaces' rule by default (fixes #1051) (Vitaly Puzrin) +* Breaking: Ignore children of all patterns by adding "/**" (Fixes #1069) (jrajav) +* Fix: skip dot files and ignored dirs on traverse (fixes #1077, related to #814) (Vitaly Puzrin) +* Docs: Added Gruntjs plugin on integrations page (Gyandeep Singh) +* Fix: don't break node offsets if hasbang present (fixes #1078) (Vitaly Puzrin) +* Build: Exclude readme/index from rules Resources generation (Fixes #1072) (jrajav) +* Docs: Change eol-last examples to `
      ` (Fixes #1068) (jrajav)
      +* 0.7.4 (Nicholas C. Zakas)
      +* New: space-in-parens rule (Closes #627) (jrajav)
      +
      +v0.7.4 - July 10, 2014
      +
      +* 0.7.4 (Nicholas C. Zakas)
      +* Docs: Fix 'lintinging' typo and ref links (Tom Vincent)
      +* Fix: Transform envs option to object in Config (Fixes #1064) (jrajav)
      +* 0.7.3 (Nicholas C. Zakas)
      +
      +v0.7.3 - July 9, 2014
      +
      +* 0.7.3 (Nicholas C. Zakas)
      +* Update: Address code review comment for strict rule (refs #1011) (Nicholas C. Zakas)
      +* Docs: Update copyright policy (Nicholas C. Zakas)
      +* Docs: Update documentation for max-len to include description of second option (fixes #1006) (Nicholas C. Zakas)
      +* Fix: Avoid double warnings for strict rule (fixes #1011) (Nicholas C. Zakas)
      +* Fix: Check envs for true/false (Fixes #1059) (jrajav)
      +* 0.7.2 (Nicholas C. Zakas)
      +
      +v0.7.2 - July 8, 2014
      +
      +* 0.7.2 (Nicholas C. Zakas)
      +* Fix: no-mixed-spaces-and-tabs incorrectly flagging multiline comments (fixes #1055) (Nicholas C. Zakas)
      +* Fix: new-cap error that throws on non-string member (fixes #1056) (Nicholas C. Zakas)
      +* Fix: Always make globals an object (Fixes #1049) (jrajav)
      +* 0.7.1 (Nicholas C. Zakas)
      +
      +v0.7.1 - July 7, 2014
      +
      +* 0.7.1 (Nicholas C. Zakas)
      +* Docs: Add Related Rules sections (Fixes #990) (jrajav)
      +* Fix: Check output file isn't dir, fix tests (Fixes #1034) (jrajav)
      +* Docs: Updated documentation for several rules (Nicholas C. Zakas)
      +* Docs: Updated contributor guide and dev env setup guide (Nicholas C. Zakas)
      +* Breaking: Implement configuration hierarchy (fixes #963) (Nicholas C. Zakas)
      +* Update: greatly simplify eqeqeq's operator finding logic (fixes #1037) (Michael Ficarra)
      +* New: Add getSourceLines() to core and rule context (fixed #1005) (Jary)
      +* Build + Docs: Adding generated resource links to rule docs (Fixes #1021) (jrajav)
      +* Fix: Ignore unused params for args: 'none' (Fixes #1026) (jrajav)
      +* Fix: Point eqeqeq error at operator (Fixes #1029) (jrajav)
      +* New: report output to a file (fixes #1027) (Gyandeep Singh)
      +* Breaking: CLIEngine abstraction for CLI operations; formatters no longer are passed configs (fixes #935) (Nicholas C. Zakas)
      +* Fix: Allow stdout to drain before exiting (fixes #317) (Nicholas C. Zakas)
      +* New: add no-undefined rule (fixes #1020) (Michael Ficarra)
      +* New: Added no-mixed-spaces-and-tabs rule (fixes #1003) (Jary)
      +* New: Added no-trailing-spaces rule (fixes #995) (Vitaly Puzrin)
      +* Update: Factor ignores out of Config (fixes #958) (jrajav)
      +* Fix: rewrite eol-last rule (fixes #1007) (fixes #1008) (Michael Ficarra)
      +* Fix: add additional IIFE exception in no-extra-parens (fixes #1004) (Michael Ficarra)
      +* Docs: Removed reference to brace-style Stroustrup default (fixes #1000) (Caleb Troughton)
      +* New: Added eol-last rule (Fixes #996) (Vitaly Puzrin)
      +* Fix: Put rule severity in messages (Fixes #984); deprecates passing full config to Formatters (jrajav)
      +* Fix: no-unused-vars to check only file globals (fixes #975) (Aliaksei Shytkin)
      +* Build: Makefile - Check for rule ids in docs titles (Fixes #969) (Delapouite)
      +* Docs: guard-for-in - added missing id in title (Fixes #969) (Delapouite)
      +* Breaking: Change 'no-yoda' rule to 'yoda' and add "always" option (Fixes #959) (jrajav)
      +* Fix: Fixes no-unused-vars to check /*globals*/ (Fixes #955) (jrajav)
      +* Update: no-eval to also warn on setTimeout and setInterval (fixes #721) (Nicholas C. Zakas)
      +* Remove: experimental match() method (Nicholas C. Zakas)
      +* Update: space-in-brackets now always allows empty object and array literals to have no spaces (fixes #797) (Nicholas C. Zakas)
      +* New: Allow the cli parameter "color" and "no-color" (fixes #954) (Tom Gallacher)
      +* Fix: valid-jsdoc no more warning for multi-level params (Fixes #925) (Delapouite)
      +* Update: Search parent directories for .eslintignore (Fixes #933) (jrajav)
      +* Fix: Correct order of arguments passed to assert.equal (fixes #945) (Michał Gołębiowski)
      +* Update: Write the summary in stylish formatter in yellow if no errors (fixes #906); test coloring of messages (Michał Gołębiowski)
      +* Fix: Corrects configs merging into base config (Fixes #838) (jrajav)
      +* Fix: Adding check if char is non-alphabetic to new-cap (Fixes #940) (jrajav)
      +* Docs: Update about page description (fixes #936) (Nicholas C. Zakas)
      +* Docs: Add '/', forgotten in first commit (Fixes #931) (jrajav)
      +* Update: Rule `new-cap` checks capitalized functions (fixes #904) (Aliaksei Shytkin)
      +* Docs: Mention allowed semicolons in "never" mode for 'semi' rule (fixes #931) (jrajav)
      +* Docs: Mention Yeoman generator in dev setup (fixes #914) (Nicholas C. Zakas)
      +* Build: Remove flaky perf test from Travis (Nicholas C. Zakas)
      +* Breaking: Refactor .eslintignore functionality (refs #928, fixes #901, fixes #837, fixes #853) (Nicholas C. Zakas)
      +* 0.6.2 (Nicholas C. Zakas)
      +* Breaking: Remove JSON support for .eslintignore (fixes #883) (icebox)
      +
      +v0.6.2 - May 23, 2014
      +
      +* 0.6.2 (Nicholas C. Zakas)
      +* Fix: Adding per-environment rule configs to docs and doc validation (Fixes #918) (jrajav)
      +* Docs: Updated contribution guidelines (Nicholas C. Zakas)
      +* Docs: Update description of eqeqeq to mention special cases (fixes #924) (Nicholas C. Zakas)
      +* Fix: block-scoped-var CatchClause handling (fixes #922) (Michael Ficarra)
      +* Fix: block-scoped-var respects decls in for and for-in (fixes #919) (Michael Ficarra)
      +* Update: Implement eqeqeq option "allow-null" (fixes #910) (Michał Gołębiowski)
      +* Fix: new-cap should allow non-alpha characters (fixes #897) (Michael Ficarra)
      +* Update: Refactor ESLintTester to fix dependency hell (fixes #602) (Nicholas C. Zakas)
      +* Fix: Merge configs with ancestors (Fixes #820) (jrajav)
      +* Fix: no-fallthrough should respect block statements in case statements (fixes #893) (Nicholas C. Zakas)
      +* Docs: Fix layout issue in configuration docs (fixes #889) (Nicholas C. Zakas)
      +* Build: Enable default-case rule (fixes #881) (icebox)
      +* Build: Enable space-after-keywords (fixes #884) (icebox)
      +* Fix api double emit on comment nodes (fixes #876) (Aliaksei Shytkin)
      +* 0.6.1 (Nicholas C. Zakas)
      +
      +v0.6.1 - May 17, 2014
      +
      +* 0.6.1 (Nicholas C. Zakas)
      +* Upgrade: Optionator to 0.4.0 (fixes #885) (Nicholas C. Zakas)
      +* 0.6.0 (Nicholas C. Zakas)
      +
      +v0.6.0 - May 17, 2014
      +
      +* 0.6.0 (Nicholas C. Zakas)
      +* Fix: Remove -r alias for --rule (fixes #882) (Nicholas C. Zakas)
      +* Docs: Update dev setup, contributing, default-case descriptions (Nicholas C. Zakas)
      +* Update: valid-jsdoc now allows you to optionally turn off parameter description checks (fixes #822) (Nicholas C. Zakas)
      +* Breaking: brace-style now disallows block statements where curlies are on the same line (fixes #758) (Nicholas C. Zakas)
      +* Add linting Makefile.js (fixes #870) (icebox)
      +* add rule flag, closes #692 (George Zahariev)
      +* Add check between rules doc and index (fixes #865) (icebox)
      +* Add Build Next mention in integrations README. (icebox)
      +* document new IIFE exception for no-extra parens added as part of #655 (Michael Ficarra)
      +* (fixes #622) Add rule ID on documentation pages (Delapouite)
      +* fixes #655: add IIFE exception to no-extra-parens (Michael Ficarra)
      +* add new rule "no-new-require" (Wil Moore III)
      +* exit with non-zero status when tests fail (fixes #858) (Márton Salomváry)
      +* removed unicode zero width space character from messages (fixes #857) (Márton Salomváry)
      +* Change: --rulesdir now can be specified multiple times (fixes #830) (Nicholas C. Zakas)
      +* Update: Node 0.8 no longer supported (fixes #734) (Nicholas C. Zakas)
      +* Update: Add typed arrays into builtin environment globals (fixes #846) (Nicholas C. Zakas)
      +* Fix: Add prototype methods to global scope (fixes #700) (Nicholas C. Zakas)
      +* Rule: no-restricted-modules (fixes #791) (Christian)
      +* Upgrade: Esprima to 1.2 (fixes #842) (Nicholas C. Zakas)
      +* Docs: reporting level 2 is an error (fixes #843) (Brandon Mills)
      +* Upgrade: Esprima to 1.2, switch to using Esprima comment attachment (fixes #730) (Nicholas C. Zakas)
      +* Fix: Semi rule incorrectly flagging extra semicolon (fixes #840) (Nicholas C. Zakas)
      +* Build: Update Travis to only test Node 0.10 (refs #734) (Nicholas C. Zakas)
      +* Add "nofunc" option (fixes #829) (Conrad Zimmerman)
      +* Rule: no-inner-declarations (fixes #587) (Brandon Mills)
      +* Rule 'block-scoped-var': correct scope for functions, arguments (fixes #832) (Aliaksei Shytkin)
      +* Rule: default-case (fixes #787) (Aliaksei Shytkin)
      +* Ignored files are excluded unless --force is passed on the CLI (Nick Fisher)
      +* Fixes a typo and a broken link in the documentation (Nick Fisher)
      +* Replaces .some() with .indexOf() where appropriate (Nick Fisher)
      +* Fix correct config merge for array values (fixes #819) (Aliaksei Shytkin)
      +* Remove warning about ESLint being in Alpha (Nick Fisher)
      +* Adds `space-after-keywords` rule (fixes #807) (Nick Fisher)
      +* Rule: no-lonely-if (fixes #790) (Brandon Mills)
      +* Add ignore comments in file (fixes #305) (Aliaksei Shytkin)
      +* 0.5.1 (Nicholas C. Zakas)
      +* Change: no-unused-vars default to 'all' (fixes #760) (Nicholas C. Zakas)
      +
      +v0.5.1 - April 17, 2014
      +
      +* 0.5.1 (Nicholas C. Zakas)
      +* Fix general config not to be modified by comment config in files (fixes #806) (Aliaksei Shytkin)
      +* SVG badges (Ryuichi Okumura)
      +* fixes #804: clean up implementation of #803 (which fixed #781) (Michael Ficarra)
      +* Build: Fix perf test to take median of three runs (fixes #781) (Nicholas C. Zakas)
      +* Fix: --reset will now properly ignore default rules in environments.json (fixes #800) (Nicholas C. Zakas)
      +* Docs: Updated contributor guidelines (Nicholas C. Zakas)
      +* Added Mocha global variables for TDD style. Fixes #793. (Golo Roden)
      +* Rule: no-sequences (fixes #561) (Brandon Mills)
      +* Change .eslintingore to plain text (fixes #761) (Brandon Mills)
      +* Change 'no-spaced-func' message (fixes #762) (Aliaksei Shytkin)
      +* Rule 'block-scoped-var' works correct when object inits (fixes #783) (Aliaksei Shytkin)
      +* Build: Always build docs site on top of origin/master (Nicholas C. Zakas)
      +* 0.5.0 (Nicholas C. Zakas)
      +
      +v0.5.0 - April 10, 2014
      +
      +* 0.5.0 (Nicholas C. Zakas)
      +* Build: Bump perf limit so Travis won't fail every time (fixes #780) (Nicholas C. Zakas)
      +* Add tests to cover 100% of eslint.js (Aliaksei Shytkin)
      +* Fix: Make sure no-path-concat doesn't flag non-concat operations (fixes #776) (Nicholas C. Zakas)
      +* Rule 'no-unused-var' in functional expression with identifier (fixes #775) (Aliaksei Shytkin)
      +* Rule: valid-typeof (Ian Christian Myers)
      +* Add global cli flag (ref #692) (Brandon Mills)
      +* update to latest Optionator (George Zahariev)
      +* Add options for rule 'no-unused-vars' to check all arguments in functions (fixes #728) (Aliaksei Shytkin)
      +* Fix: Cleanup package.json (Nicholas C. Zakas)
      +* New: Experimental support for CSS Auron (fixes #765) (Nicholas C. Zakas)
      +* Lint tests on build (fixes #764) (Aliaksei Shytkin)
      +* Rule block-scoped-var works correct with object properties (fixes #755) (Aliaksei Shytkin)
      +* Breaking: implement eslint-env and remove jshint/jslint environment comment support (fixes #759) (Aliaksei Shytkin)
      +* readme: npm i -> npm install (Linus Unnebäck)
      +* Add env flag to cli options summary (fixes #752) (Brandon Mills)
      +* Fix: Give the perf test a better calculated budget (fixes #749) (Nicholas C. Zakas)
      +* give the `env` flag type `[String]`, improve code (fixes #748) (George Zahariev)
      +* fixes #735: add new, more efficient getTokens interfaces (Michael Ficarra)
      +* Add --env cli flag (ref #692) (Brandon Mills)
      +* Fixes #740 - Make sure callbacks exist before marking them as 'handled'. (mstuart)
      +* fixes #743: wrap-regex rule warns on regex used in dynamic member access (Michael Ficarra)
      +* replace tab indents with 4 spaces in lib/rules/handle-callback-err.js (Michael Ficarra)
      +* Adding homepage and bugs links to package.json (Peter deHaan)
      +* JSDoc for rules (Anton Rudeshko)
      +* 0.4.5 (Nicholas C. Zakas)
      +
      +v0.4.5 - March 29, 2014
      +
      +* 0.4.5 (Nicholas C. Zakas)
      +* Build: Add perf check into Travis build to better monitor performance regressions (fixes #732) (Nicholas C. Zakas)
      +* Fix: Make sure semi reports correct location of missing semicolon (fixes #726) (Nicholas C. Zakas)
      +* Add --no-eslintrc cli flag (ref #717) (Brandon Mills)
      +* Fix #716 crash with reset flag (Brandon Mills)
      +* Fixed JSON formatting and highlighting (Anton Rudeshko (Tesla))
      +* fixes #723: block-scoped-var throws on unnamed function expression (Michael Ficarra)
      +* Fix: Make stroustrup brace-style closing message make sense (fixes #719) (Nicholas C. Zakas)
      +* no-comma-dangle reports correct line number (Andrey Popp)
      +* Upgrade: Esprima to 1.1.1 and EScope to 1.0.1 (fixes #718) (Nicholas C. Zakas)
      +* Add reset cli flag (refs #692) (Brandon Mills)
      +* Relax eqeqeq null check (fixes #669) (Brandon Mills)
      +* 0.4.4 (Nicholas C. Zakas)
      +* New Rule: handle-callback-err (fixes #567) (Jamund Ferguson)
      +
      +v0.4.4 - March 25, 2014
      +
      +* 0.4.4 (Nicholas C. Zakas)
      +* Fix no-used-vars to report FunctionExpression params (fixes #697). (Andrey Popp)
      +* fixes #711: eslint reports wrong line number for files with shebang (Michael Ficarra)
      +* Fix for no-unused-vars and MemberExpression (Andrey Popp)
      +* added no-warning-comments rule (Alexander Schmidt)
      +* fixes #699: brace-style does not check function expressions (Michael Ficarra)
      +* rewrite block-scoped-var (Michael Ficarra)
      +* recommend using hasOwnProperty from Object.prototype in guard-for-in docs (Michael Ficarra)
      +* change conf/environments.json spacing to be simpler and more consistent (Michael Ficarra)
      +* Update API to use context.getFilename() instead of .filename. (Loren Segal)
      +* Small changes, JSDoc is clarified (Aliaksei Shytkin)
      +* Move FileFinder to separate file (Aliaksei Shytkin)
      +* Cache if file is not found (Aliaksei Shytkin)
      +* Use cache on config files seach (Aliaksei Shytkin)
      +* Added .eslintignore to load from parents folders (fixes #681) (Aliaksei Shytkin)
      +* fix 'node-modules' typo in docs (Fred K. Schott)
      +* Upgrade to the latest version of doctrine. (Brian Di Palma)
      +* Document optional filename and default it to `input`. (Loren Segal)
      +* Fix: Compatibility for Node 0.8 (Nicholas C. Zakas)
      +* Update: Makefile.js now uses shelljs-nodecli (Nicholas C. Zakas)
      +* #681 apply all .eslintignore exclusions (Aliaksei Shytkin)
      +* Add RuleContext.filename property (for eslint/eslint#468). (Loren Segal)
      +* 0.4.3 (Nicholas C. Zakas)
      +
      +v0.4.3 - March 18, 2014
      +
      +* 0.4.3 (Nicholas C. Zakas)
      +* fixes #682: rewrite no-constant-condition rule (Michael Ficarra)
      +* Fixes #673 allow configuration of @return errors via requireReturn - (fixes #673) (Brian Di Palma)
      +* Tweaking inline code formatting for "if, while, dowhile" (Peter deHaan)
      +* Fixes #677 getJSDocComment() should not search beyond FunctionExpression or FunctionDeclaration parent nodes. (Brian Di Palma)
      +* Relaxed enforcement of camelcase rule (Ian Christian Myers)
      +* Fixing issue #675. Incorrect triggering of no-else-return rule. (Brian Di Palma)
      +* Added style option for wrap-iife (Mathias Schreck)
      +* Fix: Issues with named function expressions in no-unused-vars and no-shadow (fixes #662) (Nicholas C. Zakas)
      +* Update: camelcase rule now doesn't flag function calls (fixes #656) (Nicholas C. Zakas)
      +* Updating documentation description for: no-space-before-semi rule, changing rules to exempt strings with semicolons and test for that condition. Fixes #629. (Jonathan Kingston)
      +* Adding in rule no-space-before-semi to prevent spaces before semicolons. fixes #629 (Jonathan Kingston)
      +* show NPM version (Paul Verest)
      +* adapt code formatting (Mathias Schreck)
      +* Added a TextMate 2 integration to the docs (Nate Silva)
      +* 0.4.2 (Nicholas C. Zakas)
      +
      +v0.4.2 - March 3, 2014
      +
      +* 0.4.2 (Nicholas C. Zakas)
      +* fixes #651: disable no-catch-shadow rule in node environment (Michael Ficarra)
      +* Fixed context.report message parsing (Ian Christian Myers)
      +* fixe #648: wrap-iife rule should actually check that IIFEs are wrapped (Michael Ficarra)
      +* Added "stroustrup" option for brace-style (Ian Christian Myers)
      +* 0.4.1 (Nicholas C. Zakas)
      +
      +v0.4.1 - February 27, 2014
      +
      +* 0.4.1 (Nicholas C. Zakas)
      +* Created space-in-brackets rule (Ian Christian Myers)
      +* Update: Allow valid-jsdoc to specify replacement tags (fixes #637) (Nicholas C. Zakas)
      +* Fix: Ensure getJSDocComment() works for all function declarations (fixes #638) (Nicholas C. Zakas)
      +* Added broccoli-eslint to integration docs (Christian)
      +* fixes #634: getters/setters shouldn't trigger no-dupe-keys (Michael Ficarra)
      +* Update: semi to also enforce not using semicolons (fixes #618) (Nicholas C. Zakas)
      +* New Rule: no-constant-condition  - removed SwitchStatement discriminant check  - removed AssignmentExpression with right Identifier  - fixed copy paste error  - added DoWhileStatement, ForStatement based on discussion: https://github.com/eslint/eslint/pull/624 (fixes #621) (Christian)
      +* New Rule: no-constant-condition (fixes #621) (Christian)
      +* Adding mimosa-eslint to Build System list (dbashford)
      +* Fix: Make sure semi flags return statements without a semicolon (fixes #616) (Nicholas C. Zakas)
      +* Fix: stylish formatter blue text -> white text (fixes #607) (Nicholas C. Zakas)
      +* Fix: radix rule should warn (not throw error) when parseInt() is called without arguments (fixes #611) (Nicholas C. Zakas)
      +* Update README.md (Dmitry)
      +* Adding JSDoc comments for TAP format helper functions (Jonathan Kingston)
      +* Updating documentation to include TAP format option (Jonathan Kingston)
      +* Fixing validation issues to TAP formatter (Jonathan Kingston)
      +* Adding TAP formatter and basic tests (Jonathan Kingston)
      +* Docs: Updated integrations page (Nicholas C. Zakas)
      +* 0.4.0 (Nicholas C. Zakas)
      +
      +v0.4.0 - February 12, 2014
      +
      +* 0.4.0 (Nicholas C. Zakas)
      +* Change: Switch :after to :exit (fixes #605) (Nicholas C. Zakas)
      +* Fix: Make sure no-unused-vars doesn't get confused by nested functions (fixes #584) (Nicholas C. Zakas)
      +* Update: .eslintrc to check more things (Nicholas C. Zakas)
      +* Fix: Make sure JSDoc parser accepts JSDoc3-style optional parameters (Nicholas C. Zakas)
      +* Docs: Update documentation with linking instructions for ESLintTester (Nicholas C. Zakas)
      +* New Rule: valid-jsdoc (fixes #536) (Nicholas C. Zakas)
      +* #595 improved func-names documentation (Kyle Nunery)
      +* #595 added more func-names tests (Kyle Nunery)
      +* #595 fix rule message and add more tests (Kyle Nunery)
      +* use optionator for option parsing, not optimist (George Zahariev)
      +* Include instructions for working with ESLintTester (Nicholas C. Zakas)
      +* #595 remove needless 'function Foo() {}' in tests (Kyle Nunery)
      +* #595 fix whitespace (Kyle Nunery)
      +* #595 fix markdown for js code blocks (Kyle Nunery)
      +* Adding information about Yeomen generator (Ilya Volodin)
      +* #595 add docs for rule func-names (Kyle Nunery)
      +* #595 add func-names rule (Kyle Nunery)
      +* migrate variables array to map (Brandon Mills)
      +* Perf: Move try-catch out of verify() function to allow V8 optimization (refs #574) (Nicholas C. Zakas)
      +* Docs: Added instructions for running npm run profile (Nicholas C. Zakas)
      +* refactor variable name lookup into a separate function (Brandon Mills)
      +* optimize findVariable() in no-unused-vars (Brandon Mills)
      +* move to tests/bench (Chris Dickinson)
      +* add `npm run profile`. (Chris Dickinson)
      +* #586 refactor based on https://github.com/eslint/eslint/pull/590#discussion_r9476367 (Christian)
      +* #586 added no-unreachable jsdoc, documentation note on hoisting case (Christian)
      +* #586 add hoisting check to no-unreachable (Christian)
      +* readme: Remove stray asterisk (Timo Tijhof)
      +* #580 Remove eslint.getAllComments(), related docs, related tests (Christian)
      +* Added test for bug fix #582. Test Passes (Shmueli Englard)
      +* Added curly braces to if statment (Shmueli Englard)
      +* Added new test for fix to #582 (fixes 582) (Shmueli Englard)
      +* Bug #582: Added check if node.value isn't a string just exit (Shmueli Englard)
      +* Update Rule: implement curly options for single-statement bodies (fixes #511) (Nicholas C. Zakas)
      +* New Rule: no-extra-boolean-cast (fixes #557) (Brandon Mills)
      +* New Rule: no-sparse-arrays (fixes #499) (Nicholas C. Zakas)
      +* Fix: no-spaced-func is now an error (Nicholas C. Zakas)
      +* New Rule: no-process-exit (fixes #568) (Nicholas C. Zakas)
      +* New Rule: no-labels (fixes #550) (Nicholas C. Zakas)
      +* New Rule: no-lone-blocks (fixes #512) (Brandon Mills)
      +* Added Emacs/Flycheck integration (Nikolai Prokoschenko)
      +* Build: Add perf test (Nicholas C. Zakas)
      +* Fix: no-cond-assign shouldn't throw error when there's a for loop with an empty conditional (fixes #53) (Nicholas C. Zakas)
      +* Docs: Add docs for no-regex-spaces and all doc errors now break build (closes #562) (Nicholas C. Zakas)
      +* Rename: regex-spaces to no-regex-spaces (Nicholas C. Zakas)
      +* Docs: Add docs for no-underscore-dangle (refs #562) (Nicholas C. Zakas)
      +* Docs: Add docs for no-undef-init (refs #562) (Nicholas C. Zakas)
      +* Docs: Add docs for no-return-assign (refs #562) (Nicholas C. Zakas)
      +* Fix: Misspelling in no-return-assign message (Nicholas C. Zakas)
      +* Docs: Add docs for no-new-wrappers (refs #562) (Nicholas C. Zakas)
      +* Docs: Add docs for no-new-object (refs #562) (Nicholas C. Zakas)
      +* Docs: Add docs for no-implied-eval (refs #562) (Nicholas C. Zakas)
      +* Docs: Updated documentation for developing rules (Nicholas C. Zakas)
      +* Testing: Move ESLintTester to be external dependency (fixes #480) (Nicholas C. Zakas)
      +* Docs: Add list of known integrations (Nicholas C. Zakas)
      +* Fix #570 (dmp42)
      +* document no-array-constructor rule (Michael Ficarra)
      +* fixes #500: no-array-constructor should not flag 1-argument construction (Michael Ficarra)
      +* fixes #501: no-array-constructor recognises CallExpression form (Michael Ficarra)
      +* rename no-new-array rule to no-array-constructor; ref #501 (Michael Ficarra)
      +* Fix: Make radix rule warn on invalid second parameter (fixes #563) (Nicholas C. Zakas)
      +* Docs: Added no-floating-decimal docs (refs #562) (Nicholas C. Zakas)
      +* New Rule: no-path-concat (fixes #540) (Nicholas C. Zakas)
      +* Docs: Add some missing rule docs (refs #562) (Nicholas C. Zakas)
      +* Fix: CLI should not output anything when there are no warnings (fixes #558) (Nicholas C. Zakas)
      +* New Rule: no-yoda (fixes #504) (Nicholas C. Zakas)
      +* New Rule: consistent-return (fixes #481) (Nicholas C. Zakas)
      +* Rewrite configuration documentation to include information about globals (fixes #555) (Nicholas C. Zakas)
      +* Allow YAML configuration files (fixes #491) (Nicholas C. Zakas)
      +* 0.3.0 (Nicholas C. Zakas)
      +
      +v0.3.0 - January 20, 2014
      +
      +* 0.3.0 (Nicholas C. Zakas)
      +* Config: Allow comments in JSON configuration files (fixes #492) (Nicholas C. Zakas)
      +* Bug: max-len fix to report correct line number (fixes #552) (Nicholas C. Zakas)
      +* Build: Use browserify to create browser-ready ESLint (fixes #119) (Nicholas C. Zakas)
      +* Docs: Ensure all rules have entry on top-level rules index page (Nicholas C. Zakas)
      +* Docs: Add docs for no-fallthrough rule (Nicholas C. Zakas)
      +* Update README.md (Peter deHaan)
      +* Update README.md (Peter deHaan)
      +* Update package.json (Peter deHaan)
      +* Docs: Added documentation for semi rule (Nicholas C. Zakas)
      +* Build: Reset branch coverage target (Nicholas C. Zakas)
      +* Update build system to generate eslint.org during release (Nicholas C. Zakas)
      +* Updated setup doc (Nicholas C. Zakas)
      +* Fix #525 & #528 (Mangled Deutz)
      +* Improve no-negated-in-lhs description (David Bruant)
      +* Fixing typo (David Bruant)
      +* Update no-new.md (Tamas Fodor)
      +* Update no-extra-semi.md (Tamas Fodor)
      +* Fixing broken links in documentation (Ilya Volodin)
      +* Update about page (Nicholas C. Zakas)
      +* Site generation build step and documentation updates to support it (fixes #478) (Nicholas C. Zakas)
      +* Change message for brace-style rule (fixes #490) (Nicholas C. Zakas)
      +* Add question about ES6 support to FAQ (fixes #530) (Nicholas C. Zakas)
      +* Set unlimited number of listeners for event emitter (fixes #524) (Nicholas C. Zakas)
      +* Add support for comment events (fixes #531) Add :after events for comments (Nicholas C. Zakas)
      +* Add :after events for comments (Nicholas C. Zakas)
      +* Allow config files to have any name (fixes #486). (Aparajita Fishman)
      +* List available formatters (fixes #533). (Aparajita Fishman)
      +* Add support for comment events (fixes #531) (Nicholas C. Zakas)
      +* Add Stylish formatter and make it default. Fixes #517 (Sindre Sorhus)
      +* Fix missing code exit (Mangled Deutz)
      +* Added unit test for calling Config.getConfig with no arguments. (Aparajita Fishman)
      +* Typo (Mangled Deutz)
      +* Fixed docs typo (Nicholas C. Zakas)
      +* Mark functions as used when any method is called on them (Nicholas C. Zakas)
      +* Fixed: Config.getConfig is called either with a file path or with no args (fixes #520) (Aparajita Fishman)
      +* Fix minor bug in no-empty rule (Nicholas C. Zakas)
      +* add more info for failure messages (Nicholas C. Zakas)
      +* Add ruleId to all formatters output (fixes #472) (Nicholas C. Zakas)
      +* Remove unused code (Nicholas C. Zakas)
      +* Correctly handle case with both finally and catch in no-empty (Nicholas C. Zakas)
      +* Update documentation for no-unused-vars (Nicholas C. Zakas)
      +* Ensure that bound function expressions are reported as being used (fixes #510) (Nicholas C. Zakas)
      +* Allow empty catch/finally blocks (fixes #514) and update documentation (fixes #513) (Nicholas C. Zakas)
      +* Updated contribution guidelines (Nicholas C. Zakas)
      +* Add default setting for no-cond-assign (Nicholas C. Zakas)
      +* Add build step to check rule consistency (Nicholas C. Zakas)
      +* update docs: explicit cli args are exempt from eslintignore exclusions (Michael Ficarra)
      +* fixes #505: no-cond-assign should ignore doubly parenthesised tests (Michael Ficarra)
      +* Renamed unnecessary-strict to no-extra-strict (Nicholas C. Zakas)
      +* Fixed missing documentation links (Nicholas C. Zakas)
      +* Add build task to check for missing docs and tests for rules (Nicholas C. Zakas)
      +* Slight reorganization of rule groups (Nicholas C. Zakas)
      +* Added one-var and sorted some rules (Nicholas C. Zakas)
      +* Updated Travis badge for new location (Nicholas C. Zakas)
      +* fixes #494: allow shebangs in processed JS files (Michael Ficarra)
      +* fixes #496: lint ignored files when explicitly specified via the CLI (Michael Ficarra)
      +* More tests (Ilya Volodin)
      +* Upgrade Istanbul (Ilya Volodin)
      +* fixes #495: holey arrays cause no-comma-dangle rule to throw (Michael Ficarra)
      +* Documentation and minor changes (Ilya Volodin)
      +* Adding missing package registration (Ilya Volodin)
      +* Adding support for .eslintignore and .jshintignore (Closes #484) (Ilya Volodin)
      +* fixes #482: brace-style bug with multiline conditions (Michael Ficarra)
      +* Switching Travis to use ESLint (Closes #462) (Ilya Volodin)
      +* 0.2.0 (Nicholas C. Zakas)
      +
      +v0.2.0 - January 1, 2014
      +
      +* 0.2.0 (Nicholas C. Zakas)
      +* Bump code coverage checks (Nicholas C. Zakas)
      +* Take care of unreachable code in case statement (Nicholas C. Zakas)
      +* Updated rule messaging and added extra tests (Nicholas C. Zakas)
      +* Fixing eslint errors and unittests (Ilya Volodin)
      +* Rule: max-nested-callbacks (Ian Christian Myers)
      +* Fix fall-through rule with nested switch statements (fixes #430) (Nicholas C. Zakas)
      +* Fixed trailing comma (Nicholas C. Zakas)
      +* Added more tests for func-style (Nicholas C. Zakas)
      +* Fixed documentation for func-style (Nicholas C. Zakas)
      +* Fixed linting error (Nicholas C. Zakas)
      +* Rule to enforce function style (fixes #460) (Nicholas C. Zakas)
      +* Rule is off by default. Updated documentation (Ilya Volodin)
      +* Rule: sort variables. Closes #457 (Ilya Volodin)
      +* Update architecture.md (Nicholas C. Zakas)
      +* Change quotes option to avoid-escapes and update docs (fixes #199) (Brandon Payton)
      +* Add allow-avoiding-escaped-quotes option to quotes rule (fixes #199) (Brandon Payton)
      +* Update no-empty-class.md (Nicholas C. Zakas)
      +* Updated titles on all rule documentation (fixes #348) (Nicholas C. Zakas)
      +* Fixing eslint errors in codebase (Ilya Volodin)
      +* fixes #464: space-infix-ops checks for VariableDeclarator init spacing (Michael Ficarra)
      +* Add options to no-unused-vars. Fixes #367 (Ilya Volodin)
      +* rename escape function to xmlEscape in checkstyle formatter (Michael Ficarra)
      +* The semi rule now reports correct line number (Ian Christian Myers)
      +* context.report now takes optional location (Ian Christian Myers)
      +* fixes #454: escape values for XML in checkstyle formatter (Michael Ficarra)
      +* Add color to Mocha test reporting (Ian Christian Myers)
      +* Rule no-nested-ternary (Ian Christian Myers)
      +* Fixing no-unused-var and no-redeclare (Ilya Volodin)
      +* fixes #449: no-mixed-requires throws TypeError when grouping is enabled (Michael Ficarra)
      +* Fixed reported line number for trailing comma error (Ian Christian Myers)
      +* Update doc title for quote (Matthew DuVall)
      +* fixes #446: join paths without additional delimiters (Michael Ficarra)
      +* docs: add documentation for quotes rule (Matthew DuVall)
      +* minor style changes to lib/rules/space-infix-ops.js as requested in #444 (Michael Ficarra)
      +* remove "function invalid(){ return D }" from some tests (Michael Ficarra)
      +* fixes #429: require spaces around infix operators; enabled by default (Michael Ficarra)
      +* simplify fix for #442 (Michael Ficarra)
      +* Fix broken test, ensure tests get run before a release is pushed (Nicholas C. Zakas)
      +* 0.1.4 (Nicholas C. Zakas)
      +
      +v0.1.4 - December 5, 2013
      +
      +* 0.1.4 (Nicholas C. Zakas)
      +* Add release scripts to package.json (Nicholas C. Zakas)
      +* Fixed release error in Makefile (Nicholas C. Zakas)
      +* Fix JSHint warnings (Nicholas C. Zakas)
      +* Make sure 'default' isn't flagged by no-space-returns-throw rule (fixes #442) (Nicholas C. Zakas)
      +* Fixing documentation (Ilya Volodin)
      +* Fixing disabling rules with invalid comments Closes #435 (Ilya Volodin)
      +* improve assertion on wrong number of errors (Christoph Neuroth)
      +* fixes #431: no-unused-expressions should not flag statement level void (Michael Ficarra)
      +* fixes #437: fragile no-extend-native rule (Michael Ficarra)
      +* change space-* rule documentation headers to be more descriptive (Michael Ficarra)
      +* Moved to tabs, added comments, a few more tests (Jamund Ferguson)
      +* split GH-332 rule into space-unary-word-ops and space-return-throw-case (Michael Ficarra)
      +* fixes #346: validate strings passed to the RegExp constructor (Michael Ficarra)
      +* change some documentation extensions from js to md (Michael Ficarra)
      +* fixes #332: unary word operators must be followed by whitespace (Michael Ficarra)
      +* Add some docs (Jamund Ferguson)
      +* DRYing cli tests and improving code coverage (Ilya Volodin)
      +* fixes #371: add no-shadow-restricted-names rule (Michael Ficarra)
      +* Added Support for Object.defineProperty() checking (Jamund Ferguson)
      +* fixes #333: add rule to disallow gratuitously parenthesised expressions (Michael Ficarra)
      +* improve rule test coverage (Michael Ficarra)
      +* No Extend Native (Jamund Ferguson)
      +* change getTokens 2nd/3rd arguments to count tokens, not characters (Michael Ficarra)
      +* fixes #416: no-fallthrough flagging last case + reporting wrong line num (Michael Ficarra)
      +* fixes #415: fix unnecessary-strict rule false positives (Michael Ficarra)
      +* Add missing dependency (Nicholas C. Zakas)
      +* Update docs related to running unit tests (Nicholas C. Zakas)
      +* Add JSHint as missing dependency (Nicholas C. Zakas)
      +* Switch to using ShellJS makefile (fixes #418) (Nicholas C. Zakas)
      +* Updated documentation to reflect test changes (refs #417) (Nicholas C. Zakas)
      +* Change to eslintTester.addRuleTest (fixes #417) (Nicholas C. Zakas)
      +* Fix false positives for no-script-url (fixes #400) (Nicholas C. Zakas)
      +* Fix lint warning (Nicholas C. Zakas)
      +* Fixing ESLint warnings, introducing Makefile.js (not yet wired in) (Nicholas C. Zakas)
      +* fixes #384: include builtin module list to avoid repl dependency (Michael Ficarra)
      +* 0.1.3 (Nicholas C. Zakas)
      +
      +v0.1.3 - November 25, 2013
      +
      +* 0.1.3 (Nicholas C. Zakas)
      +* Updated changelog (Nicholas C. Zakas)
      +* Vows is gone. Mocha is now default (Ilya Volodin)
      +* fixes #412: remove last remaining false positives in no-spaced-func (Michael Ficarra)
      +* fixes #407: no-spaced-func rule flagging non-argument-list spaced parens (Michael Ficarra)
      +* Add no-extra-semi to configuration (fixes #386) (Nicholas C. Zakas)
      +* Converting formatter tests and core (Ilya Volodin)
      +* Don't output anything when there are no errors in compact formatter (fixes #408) (Nicholas C. Zakas)
      +* Removing Node 0.11 test - it fails all the time (Nicholas C. Zakas)
      +* Completing conversion of rule's tests to mocha (Ilya Volodin)
      +* added mocha conversion tests for strict, quote-props and one-var; enhanced one of the invalid one-var tests that was expecting two messages (Michael Paulukonis)
      +
      +
      +v0.1.2 - November 23, 2013
      +
      +* 0.1.2 (Nicholas C. Zakas)
      +* added mocha tests for radix and quotes; fixed some of the internals on quotes from vows annotations (Michael Paulukonis)
      +* added tests for regex-spaces, strict, unnecessary-strict; fixed some types in overview/author notes in other tests. (Michael Paulukonis)
      +* Converting unittests to mocha (Ilya Volodin)
      +* mocha conversions of tests for 'use-isnan' and 'wrap-iife' (Michael Paulukonis)
      +* added mocha tests semi.js and wrap-regex.js (Michael Paulukonis)
      +* Converting more tests to mocha (Ilya Volodin)
      +* Update CONTRIBUTING.md (Nicholas C. Zakas)
      +* Cleaning up eslintTester (Ilya Volodin)
      +* DRYing unittests and converting them to mocha (Ilya Volodin)
      +* Reformatted Gruntfile (Nicholas C. Zakas)
      +* Add tests to config load order: base, env, user. (icebox)
      +* Fixing indent in gruntfile (Ilya Volodin)
      +* Removing jake, adding Grunt, Travis now runs grunt (Ilya Volodin)
      +* Add rules per environments to config. (icebox)
      +* Add globals property to the environments. (icebox)
      +* Fix error about IIFE if the function is in a new (Marsup)
      +* Fix a broken link in the docs (Brian J Brennan)
      +* Add test coverage for additional cases, fix open paren at beginning of expr (Matthew DuVall)
      +* Fixing no-undef for eval use case (Ilya Volodin)
      +* fixes #372: disallow negated left operand in `in` operator (Michael Ficarra)
      +* Fixing no-self-compare rule to check for operator (Ilya Volodin)
      +* bug: open parens in args causes no-spaced-func to trigger (Matthew DuVall)
      +* fixes #369: restrict UnaryExpressions to delete in no-unused-expressions (Michael Ficarra)
      +* Make sure delete operator isn't flagged as unused expression (fixes #364) (Nicholas C. Zakas)
      +* Don't flag ++ or -- as unused expressions (fixes #366) (Nicholas C. Zakas)
      +* Ensure that 'use strict' isn't flagged as an unused expression (fixes #361) (Nicholas C. Zakas)
      +* Increase test coverage for strict-related rules (refs #361) (Nicholas C. Zakas)
      +* Up code coverage numbers (Nicholas C. Zakas)
      +* Fixes error in new-cap rule when 'new' is used without a constructor (fixes #360) (Nicholas C. Zakas)
      +* added files array in package json (Christian)
      +* removed unused jshint dependency (Christian)
      +* Add test coverage for new Foo constructor usage (Matt DuVall)
      +* Pull code coverage up by removing unused method (Matt DuVall)
      +* recognise CallExpression variant of RegExp ctor in no-control-regex rule (Michael Ficarra)
      +* Merge smart-eqeqeq into eqeqeq (Matt DuVall)
      +* Catch additional cases for a.b, new F, iife (Matt DuVall)
      +* 0.2.0-dev (Nicholas C. Zakas)
      +* Version 0.1.0 (Nicholas C. Zakas)
      +* rule: no-spaced-func disallow spaces between function identifier and application (Matt DuVall)
      +
      +v0.1.1 - November 09, 2013
      +
      +* Ensure mergeConfigs() doesn't thrown an error when keys are missing in base config (fixes #358) (Nicholas C. Zakas)
      +
      +v0.1.0 - November 03, 2013
      +
      +* Version 0.1.0 (Nicholas C. Zakas)
      +* Updated Readme for v0.1.0 (Nicholas C. Zakas)
      +* Bump code coverage verification to 95% across the board (Nicholas C. Zakas)
      +* Fixed broken links (Nicholas C. Zakas)
      +* Added information about runtime rules (Nicholas C. Zakas)
      +* Added documentation about configuration files (Nicholas C. Zakas)
      +* Added description of -v option (Nicholas C. Zakas)
      +* Updated architecture documentation (Nicholas C. Zakas)
      +* Fix bug in no-control-regex (fixes #347) (Nicholas C. Zakas)
      +* Fix link to architecture doc in readme (azu)
      +* Rule: No control characters in regular expressions (fixes #338) (Nicholas C. Zakas)
      +* Add escaping \= test (Matt DuVall)
      +* Add docs for rule (Matt DuVall)
      +* rule: no-div-regex for catching ambiguous division operators in regexes (Matt DuVall)
      +* Change context-var to block-scoped-var (Matt DuVall)
      +* Implement config.globals (Oleg Grenrus)
      +* Add 'config-declared global' test (Oleg Grenrus)
      +* Adding ability to separate rules with comma (Ilya Volodin)
      +* Added rule for missing 'use strict' (fixes #321) (Nicholas C. Zakas)
      +* Fixing unittests and finishing code (Ilya Volodin)
      +* Disabling/enabling rules through comments (Ilya Volodin)
      +* Rename rule to context-var and add documentation (Matt DuVall)
      +* Added link to no-global-strict doc in readme (Nicholas C. Zakas)
      +* Add try-catch scoping with tests (Matt DuVall)
      +* Fix linting error (Matt DuVall)
      +* Store FunctionDeclarations in scope as they can be used as literals (Matt DuVall)
      +* Fix to use getTokens and add test for MemberExpression usage (Matt DuVall)
      +* rule: block-scope-var to check for variables declared in block-scope (Matt DuVall)
      +* no-unused-expressions rule: add test and doc mention for `a && b()` (Michael Ficarra)
      +* rule: wrap-regex for parens around regular expression literals (Matt DuVall)
      +* fixes #308: implement no-unused-expressions rule; ref. jshint rule W030 (Michael Ficarra)
      +* Updated change log script to filter out merge messages (Nicholas C. Zakas)
      +* Updated changelog (Nicholas C. Zakas)
      +* 0.1.0-dev (Nicholas C. Zakas)
      +
      +v0.0.9 - October 5, 2013
      +
      +* Version 0.0.9 release (Nicholas C. Zakas)
      +* Added rule for no global strict mode (fixes #322) (Nicholas C. Zakas)
      +* Change default on to be errors instead of warnings (fixes #326) (Nicholas C. Zakas)
      +* Fixed bug where JSHint was using the wrong file in lint task (Nicholas C. Zakas)
      +* Updated docs for no-unused vars rule. (Andrew de Andrade)
      +* Removed console.log in tests. (Andrew de Andrade)
      +* Added link to roadmap and JSHint feature parity list. (Andrew de Andrade)
      +* Fixed warning when unused var declared as param in FunctionExpression/Declaration can be ignored because later param is used (Andrew de Andrade)
      +* Rename test for smartereqeqeq.js to smarter-eqeqeq.js (Andrew de Andrade)
      +* Keep test filename inline with rule name (Andrew de Andrade)
      +* Added further instructions for multiline test cases. (Andrew de Andrade)
      +* Protecting private method (Seth McLaughlin)
      +* Updating look up algorithm for local config files (Seth McLaughlin)
      +* Fixing ESLint errors (Ilya Volodin)
      +* Implemented local default config file (Seth McLaughlin)
      +* Upgrading escope version and fixing related bugs (Ilya Volodin)
      +* Fixing assignment during initialization issue (Ilya Volodin)
      +* add plain-English regexp description to no-empty-class rule (Michael Ficarra)
      +* fixes #289: no-empty-class flags regexps with... flags (Michael Ficarra)
      +* Rule: no-catch-shadow (Ian Christian Myers)
      +* Update no-empty for compatibility with esprima@1.0.4 (fixes #290) (Mark Macdonald)
      +* Fixing bug with _ in MemberExpression (Ilya Volodin)
      +* Rule: no-func-assign (Ian Christian Myers)
      +* Fix false warning from no-undef rule (fixes #283) (Mark Macdonald)
      +* Adding eslint to jake (Ilya Volodin)
      +* Rule no redeclare (Ilya Volodin)
      +* Fixing no use before define issues (Ilya Volodin)
      +* Rule: no-octal-escape (Ian Christian Myers)
      +* Fix for `no-proto` and `no-iterator` false positive (Ian Christian Myers)
      +* Rule: no-iterator (Ian Christian Myers)
      +* Fixing type in guard-for-in documentation (Ilya Volodin)
      +* Rule No use before define (Ilya Volodin)
      +* Added documentation for the `no-new` rule (Ian Christian Myers)
      +* Added documentation for the `no-eval` rule (Ian Christian Myers)
      +* Added documentation for the `no-caller` rule (Ian Christian Myers)
      +* Added documentation for the `no-bitwise` rule (Ian Christian Myers)
      +* simplify no-empty-class rule (Michael Ficarra)
      +* Fix `no-empty-class` false negatives (Ian Christian Myers)
      +* Added documentation for the `no-alert` rule (Ian Christian Myers)
      +* Added documentation for the `new-parens` rule (Ian Christian Myers)
      +* Added documentation for the `max-params` rule (Ian Christian Myers)
      +* Added documentation for `max-len` rule (Ian Christian Myers)
      +* Created link from rules README.md to no-plusplus.md documentation (Ian Christian Myers)
      +* Added documentation for `guard-for-in` rule (Ian Christian Myers)
      +* Added documentation for `dot-notation` rule (Ian Christian Myers)
      +* Added documentation for `curly` rule (Ian Christian Myers)
      +* Updated `camelcase` rule documentation (Ian Christian Myers)
      +* Added documentation for `complexity` rule (Ian Christian Myers)
      +* Changed `no-dangle` documentation to `no-comma-dangle` (Ian Christian Myers)
      +* Rule: no-empty-class (Ian Christian Myers)
      +* Increased test coverage for max-depth (Ian Christian Myers)
      +* Increased test coverage for no-shadow (Ian Christian Myers)
      +* Increased test coverage on no-mixed-requires (Ian Christian Myers)
      +* Added docs for eqeqeq and no-with (fixes #262) (Raphael Pigulla)
      +* Create camelcase.md (Micah Eschbacher)
      +* Fix issues with function in no-unused-vars (Ilya Volodin)
      +* Rule: No shadow (Ilya Volodin)
      +* fixes #252: semi rule errors on VariableDeclarations in ForInStatements (Michael Ficarra)
      +* rule: max-len to lint maximum length of a line (Matt DuVall)
      +* Fixes #249 (Raphael Pigulla)
      +* Merge branch 'master' of https://github.com/beardtwizzle/eslint (Jonathan Mahoney)
      +* Re-add lines that were accidentally deleted from config (Jonathan Mahoney)
      +* Add support for pre-defined environment globals (re: #228) (Jonathan Mahoney)
      +* Rule: no-else-return (Ian Christian Myers)
      +* Re-add lines that were accidentally deleted from config (Jonathan Mahoney)
      +* Add support for pre-defined environment globals (re: #228) (Jonathan Mahoney)
      +* Fix no-unused-vars to report correct line numbers (Ilya Volodin)
      +* Rule: no proto (Ilya Volodin)
      +* Rule: No Script URL (Ilya Volodin)
      +* Rule: max-depth (Ian Christian Myers)
      +* Fix: Error severity for rules with options. (Ian Christian Myers)
      +* Rule: No wrap func (Ilya Volodin)
      +* bug: Fixes semi rule for VariableDeclaration in ForStatement (Matt DuVall)
      +* Individual perf tests for rules (Ilya Volodin)
      +* Fix loading rules from a rules directory (Ian Christian Myers)
      +* Rule no-mixed-requires (fixes #221) (Raphael Pigulla)
      +* bug: Add ForStatement for no-cond-assign check (Matthew DuVall)
      +* JSLint XML formatter now escapes special characters in the evidence and reason attributes. (Ian Christian Myers)
      +* Formatter: JSLint XML (Ian Christian Myers)
      +* Refactored `max-statements` rule. (Ian Christian Myers)
      +* Fix tests broken due to new rule message text (James Allardice)
      +* Merge branch 'master' into match-jshint-messages (James Allardice)
      +* Refactored `one-var` rule. (Ian Christian Myers)
      +* split eslint.define into eslint.defineRule and eslint.defineRules (Michael Ficarra)
      +* Removed unnecessary rules.js test. (Ian Christian Myers)
      +* Rule: one-var (Ian Christian Myers)
      +* Rule: No unused variables (Ilya Volodin)
      +* expose interface for defining new rules at runtime without fs access (Michael Ficarra)
      +* disallow 00 in no-octal rule (Michael Ficarra)
      +* Increased test coverage for `lib/cli.js`. (Ian Christian Myers)
      +* Increased test coverage for `lib/rules.js` (Ian Christian Myers)
      +* Increased test coverage for jUnit formatter. (Ian Christian Myers)
      +* scripts/bundle: output bundle+map to /build directory (Michael Ficarra)
      +* add test for 0X... hex literals in no-octal tests (Michael Ficarra)
      +* fixes #200: no-octals should not see leading-0 floats as violations (Michael Ficarra)
      +* add back tests for loading rules from a directory (Michael Ficarra)
      +* add back in ability to load rules from a directory (Michael Ficarra)
      +* Increased test coverage for `complexity` rule. (Ian Christian Myers)
      +* Increased test coverage for `max-params` rule. (Ian Christian Myers)
      +* also output source map when generating bundle (Michael Ficarra)
      +* Rule: unnecessary-strict (Ian Christian Myers)
      +* Improve performance of getTokens (Ilya Volodin)
      +* Performance jake task (Ilya Volodin)
      +* don't force explicit listing of rules; generate listing for bundle (Michael Ficarra)
      +* Rule: no-dupe-keys (Ian Christian Myers)
      +* fixes #145: create a browser bundle (Michael Ficarra)
      +* Fixing no-caller bug (Ilya Volodin)
      +* Check for use of underscore library as an exception for var declarations (Matthew DuVall)
      +* Merge branch 'master' of https://github.com/nzakas/eslint into no-underscore-dangle (Matthew DuVall)
      +* Fixing spelling (Ilya Volodin)
      +* Rule: no-empty-label (Ilya Volodin)
      +* Add builtin globals to the global scope (fixes #185) (Mark Macdonald)
      +* Rule: no-loop-func (Ilya Volodin)
      +* Merge branch 'master' of https://github.com/nzakas/eslint into no-underscore-dangle (Matt DuVall)
      +* Use proper node declarations and __proto__ exception (Matt DuVall)
      +* Updating no-undef patch (see pull request #164) - Simplify parseBoolean() - Make knowledge of```/*jshint*/``` and ```/*global */``` internal to eslint object - Put user-declared globals in Program scope (Mark Macdonald)
      +* Rule: no-eq-null (Ian Christian Myers)
      +* fixed broken merge (Raphael Pigulla)
      +* fixes #143 (Raphael Pigulla)
      +* added consistent-this rule (Raphael Pigulla)
      +* Rule: no-sync to encourage async usage (Matt DuVall)
      +* Update eslint.json with no-underscore-dangle rule (Matt DuVall)
      +* Rule: no-underscore-dangle for func/var declarations (Matt DuVall)
      +* Warn on finding the bitwise NOT operator (James Allardice)
      +* Updating no-undef patch (see pull request #164) 3. Move parsing of ```/*global */``` and ```/*jshint */``` to eslint.js (Mark Macdonald)
      +* Warn on finding a bitwise shift operator (fixes #170) (James Allardice)
      +* Fix broken test (James Allardice)
      +* Add support for the do-while statement to the curly rule (closes #167) (James Allardice)
      +* Removing nasty leading underscores (Patrick Brosset)
      +* Added tests and test cases for a few files (Patrick Brosset)
      +* CLI: -f now accepts a file path (Ian Christian Myers)
      +* Updating no-undef patch (see pull request #164) 1. Move predefined globals to ```conf/environments.json``` 2. Move mixin() to ```lib/util.js``` (Mark Macdonald)
      +* Match messages to JS[LH]int where appropriate, and ensure consistent message formatting (closes #163) (James Allardice)
      +* Add support for the do-while statement to the curly rule (closes #167) (James Allardice)
      +* Removing nasty leading underscores (Patrick Brosset)
      +* Added tests and test cases for a few files (Patrick Brosset)
      +* Merge branch 'master' of github.com:nzakas/jscheck (Nicholas C. Zakas)
      +* Added acceptance criteria for rules to docs (Nicholas C. Zakas)
      +* Add no-undef (fixes #6) (Mark Macdonald)
      +* Fixing no-self-compare (Ilya Volodin)
      +* Rule: No multiline strings (Ilya Volodin)
      +* CLI refactor to remove process.exit(), file not found now a regular error message, updated formatters to handle this case (Nicholas C. Zakas)
      +* Rule: no-self-compare (Ilya Volodin)
      +* Rule: No unnecessary semicolons (fixes #158) (Nicholas C. Zakas)
      +* Fixed error in no-ex-assign when return statement as found in catch clause (Nicholas C. Zakas)
      +* Rename no-exc-assign to no-ex-assign and add to config (Nicholas C. Zakas)
      +* Renamed count-spaces to regex-spaces (Nicholas C. Zakas)
      +* Documentation updates (Nicholas C. Zakas)
      +* Put all rules into strict mode and update docs accordingly (Nicholas C. Zakas)
      +* Merge branch 'master' of github.com:nzakas/jscheck (Nicholas C. Zakas)
      +* Ensure getScope() works properly when called from Program node (fixes #148) (Nicholas C. Zakas)
      +* Rule: wrap-iife (Ilya Volodin)
      +* add additional test for no-cond-assign rule (Stephen Murray)
      +* Merge branch 'master' of github.com:nzakas/jscheck (Nicholas C. Zakas)
      +* Experimental support for Jake as a build system (fixes #151) (Nicholas C. Zakas)
      +* fixes #152 (Stephen Murray)
      +* add docs for no-exc-assign (Stephen Murray)
      +* Merge branch 'master' of https://github.com/nzakas/eslint into no-new-object-array-literals (Matt DuVall)
      +* Merge branch 'master' of https://github.com/nzakas/eslint into count-spaces (Matt DuVall)
      +* Added a test for getting global scope from Program node (refs #148) (Nicholas C. Zakas)
      +* Add positive test case for `object.Array` (Matthew DuVall)
      +* Only support space characters for repetitions (Matthew DuVall)
      +* fix line length per code conventions (Stephen Murray)
      +* fix indentation per code conventions (Stephen Murray)
      +* fixes #149 (Stephen Murray)
      +* Rule: no-ternary (Ian Christian Myers)
      +* Check that the return statement has an argument before checking its type (James Allardice)
      +* Rule: count-spaces for multiple spaces in regular expressions (Matt DuVall)
      +* Update eslint.json configuration file for literal rules (Matt DuVall)
      +* Created no-label-var rule. (Ian Christian Myers)
      +* Rule: no-new-array and no-new-object (Matt DuVall)
      +* Added ability to retrieve scope using escope. (Ian Christian Myers)
      +* Corrected unused arguments (Patrick Brosset)
      +* Reporting function complexity on function:after and using array push/pop to handle nesting (Patrick Brosset)
      +* Fixing style issues discovered while npm testing (Patrick Brosset)
      +* First draft proposal for a cyclomatic complexity ESLint rule (Patrick Brosset)
      +* Corrected file extension on no-plusplus rule documentation. (Ian Christian Myers)
      +* Documentation for no-delete-var rule. Closes #129 (Ilya Volodin)
      +* Rule: max-statements (Ian Christian Myers)
      +* Better documentation for the `no-plusplus` rule. (Ian Christian Myers)
      +* Rule: no-plusplus (Ian Christian Myers)
      +* Rule: no assignment in return statement (Ilya Volodin)
      +* Updating max-params rule name (Ilya Volodin)
      +* Rule: Function has too many parameters (Ilya Volodin)
      +* Removing merge originals (Ilya Volodin)
      +* Rebasing on master (Ilya Volodin)
      +* Rule: Variables should not be deleted (Ilya Volodin)
      +* Fixes incorrect reporting of missing semicolon (Ian Christian Myers)
      +* Rebase against master branch (Mathias Bynens)
      +* Rule to warn on use of Math and JSON as functions (James Allardice)
      +* Formatter: Checkstyle (Ian Christian Myers)
      +* docs: Clean up structure (Mathias Bynens)
      +* Merging no-native-reassign and no-redefine (Ilya Volodin)
      +* Rule: no native reassignment (Ilya Volodin)
      +* 0.0.8-dev (Nicholas C. Zakas)
      +* v0.0.7 released (Nicholas C. Zakas)
      +* Updated Tests, etc. (Jamund Ferguson)
      +* Added jUnit Support (Fixes #16) (Jamund Ferguson)
      +
      +v0.0.7 - July 22, 2013
      +
      +* 0.0.7 (Nicholas C. Zakas)
      +* Add code coverage checks to npm test and update rule tests to have better coverage (Nicholas C. Zakas)
      +* Fixed CLI output on serial programatic executions (Ian Christian Myers)
      +* Removes line length from code style convention docs (Josh Perez)
      +* Adds escapeRegExp and fixes documentation (Josh Perez)
      +* Add quotes rule and test coverage for configuration options (Matt DuVall)
      +* Adds templating for lint messages and refactors rules to use it (Josh Perez)
      +* Fixes lint rules for unchecked test file (Josh Perez)
      +* Changes dotnotation rule to match JSHint style (Josh Perez)
      +* Change configInfo to options and add test coverage (Matt DuVall)
      +* Merge branch 'master' of https://github.com/nzakas/eslint into optional-args-for-rule (Matt DuVall)
      +* Adds dot notation lint rule (Josh Perez)
      +* Strip trailing underscores in camelcase rule - Fixes #94 (Patrick Brosset)
      +* add mailing list link (Douglas Campos)
      +* Strip leading underscores in camelcase rule - Fixes #94 (Patrick Brosset)
      +* Created no-dangle rule. (Ian Christian Myers)
      +* Fixed rule name (James Allardice)
      +* Make sure the callee type is Identifier (James Allardice)
      +* Add rule for implied eval via setTimeout/Interval (James Allardice)
      +* Fix rule name in config (James Allardice)
      +* Fixes #90 -- updates docstrings (Stephen Murray)
      +* Fixes issue with fs.existsSync on NodeJS 0.6 (Ian Christian Myers)
      +* Fixing -c config option. (Ian Christian Myers)
      +* Allow arrays to be passed as multiple args to rule (Matt DuVall)
      +* Test to make sure empty case with one line break is safe (Matt DuVall)
      +* Rule: The Function constructor is eval (Ilya Volodin)
      +* Enabled require("eslint") and exposed out CLI. (Ian Christian Myers)
      +* Adds test and fix for issue #82 (Mark Macdonald)
      +* Merge branch 'master' of https://github.com/nzakas/eslint into ok (Yusuke Suzuki)
      +* Created brace-style rule. (Ian Christian Myers)
      +* Formatters can now process multiple files at once (Jamund Ferguson)
      +* Rule: Do not use 'new' for side effects (Ilya Volodin)
      +* Adds smarter-eqeqeq rule (Josh Perez)
      +* Add EditorConfig file for consistent editor/IDE behavior (Jed Hunsaker)
      +* Fix the positive case for no-unreachable where there is no return statement at all, or if the return is at the end. Those cases should not return any errors. The error condition was not be checked before throwing the rule error. (Joel Feenstra)
      +* Adds test and fix for no-octal on 0 literal (Mark Macdonald)
      +* Don't report no-empty warnings when a parent is FunctionExpression / FunctionDeclaration (Yusuke Suzuki)
      +* Add api.getAncestors (Yusuke Suzuki)
      +* Ensure estraverse version 1.2.0 or later (Yusuke Suzuki)
      +* Fixes no-alert lint rule for non identifier calls (Josh Perez)
      +* Fixes exception when init is null (Josh Perez)
      +* Fixes no-octal check to only check for numbers (Josh Perez)
      +* 0.0.7-dev (Nicholas C. Zakas)
      +* 0.0.6 (Nicholas C. Zakas)
      +* Follow the rule naming conventions (James Allardice)
      +* Add rule for missing radix argument to parseInt (James Allardice)
      +* Allow return, falls-through comment, and throw for falls-through (Matt DuVall)
      +* Merge branch 'master' of https://github.com/nzakas/eslint into rule-fall-through (Matt DuVall)
      +* Globals are not good, declare len (Matt DuVall)
      +* Rule to add no-fall-through (Matt DuVall)
      +
      +v0.0.6 - July 16, 2013
      +
      +* 0.0.6 (Nicholas C. Zakas)
      +* Changed semi rule to use tokens instead of source (Nicholas C. Zakas)
      +* Renaming new-parens rule (Ilya Volodin)
      +* Renaming no-new-wrappers rule and adding tests (Ilya Volodin)
      +* Add license URL (Nick Schonning)
      +* Remove unused sinon requires (Nick Schonning)
      +* Remove redundant JSHint directives (Nick Schonning)
      +* Rule: Do not use constructor for wrapper objects (Ilya Volodin)
      +* Test node 0.11 unstable but allow it to fail (Nick Schonning)
      +* Rule: Constructor should use parentheses (Ilya Volodin)
      +* Fix reference to "CSS Lint" in Contributing documentation (Brian McKenna)
      +* Add git attributes file for line endings (Andy Hu)
      +* Rename to create an 'index' file in GH web view (Evan Goer)
      +* Avoid accidentally creating a markdown link (Evan Goer)
      +* Add headings and correct internal links (Evan Goer)
      +* Add wiki files to docs directory (Evan Goer)
      +* Add rules for leading/trailing decimal points (James Allardice)
      +* Add rule to prevent comparisons with value NaN (James Allardice)
      +* Fixing jshint error (Ilya Volodin)
      +* Rule: no octal literals (Ilya Volodin)
      +* Rule: no undefined when initializing variables (Ilya Volodin)
      +* Updated CONTRIBUTING.md (Nicholas C. Zakas)
      +* Make sure namespaces are honored in new-cap (Nicholas C. Zakas)
      +* Make sure no-empty also checks for ';;' (Nicholas C. Zakas)
      +* Add CLI option to output version (Nicholas C. Zakas)
      +* Updated contribution guidelines (Nicholas C. Zakas)
      +* Fixing jshint complaints. (Joel Feenstra)
      +* Converting to a switch statement and declaring variables. (Joel Feenstra)
      +* Added .jshintrc file (until ESLint can lint itself) and cleaned up JSHint warnings (Nicholas C. Zakas)
      +* Merge branch 'master' of github.com:nzakas/jscheck (Nicholas C. Zakas)
      +* A bit of cleanup (Nicholas C. Zakas)
      +* Add unreachable code detection for switch cases and after continue/break. (Joel Feenstra)
      +* Add support for detecting unreachable code after a throw or return statement. (Joel Feenstra)
      +* Fix curly brace check when an if statement is the alternate. (Joel Feenstra)
      +* Check for empty switch statements with no cases. (Matt DuVall)
      +* Added CONTRIBUTING.md (Nicholas C. Zakas)
      +* Added rule to check for missing semicolons (fixes #9) (Nicholas C. Zakas)
      +* Verify that file paths exist before reading the file (Matt DuVall)
      +* Added guard-for-in rule (fixes #1) (Nicholas C. Zakas)
      +* Run linting with npm test as well (Nicholas C. Zakas)
      +* Removed foo.txt (Nicholas C. Zakas)
      +* Updated config file with new no-caller ID (Nicholas C. Zakas)
      +* Changed name of no-arg to no-caller (Nicholas C. Zakas)
      +* Increased test coverage (Nicholas C. Zakas)
      +* Got npm test to work with istanbul, huzzah\! (Nicholas C. Zakas)
      +* Moved /config to /conf (Nicholas C. Zakas)
      +* Added script to auto-generate changelog (Nicholas C. Zakas)
      +* Add `quote-props` rule (Mathias Bynens)
      +* Cleaned up relationship between bin/eslint, lib/cli.js, and lib/eslint.js (Nicholas C. Zakas)
      +* Add problem count to compact formatter (Nicholas C. Zakas)
      +* Fix merge conflict (Nicholas C. Zakas)
      +* Change reporters to formatters, add format command line option. Also added tests for compact format. (Nicholas C. Zakas)
      +* Change reporters to formatters, add format command line option (Nicholas C. Zakas)
      +* Start development of 0.0.6-dev (Nicholas C. Zakas)
      diff --git a/tools/eslint/README.md b/tools/eslint/README.md
      index bb4cc9c8e5a270..a7864f8abbc6bf 100644
      --- a/tools/eslint/README.md
      +++ b/tools/eslint/README.md
      @@ -1,5 +1,6 @@
       [![NPM version][npm-image]][npm-url]
       [![build status][travis-image]][travis-url]
      +[![Build status][appveyor-image]][appveyor-url]
       [![Test coverage][coveralls-image]][coveralls-url]
       [![Downloads][downloads-image]][downloads-url]
       [![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=282608)](https://www.bountysource.com/trackers/282608-eslint?utm_source=282608&utm_medium=shield&utm_campaign=TRACKER_BADGE)
      @@ -7,7 +8,7 @@
       
       # ESLint
       
      -[Website](http://eslint.org) | [Configuring](http://eslint.org/docs/user-guide/configuring) | [Rules](http://eslint.org/docs/rules/) | [Contributing](http://eslint.org/docs/developer-guide/contributing) | [Twitter](https://twitter.com/geteslint) | [Mailing List](https://groups.google.com/group/eslint)
      +[Website](http://eslint.org) | [Configuring](http://eslint.org/docs/user-guide/configuring) | [Rules](http://eslint.org/docs/rules/) | [Contributing](http://eslint.org/docs/developer-guide/contributing) | [Reporting Bugs](http://eslint.org/docs/developer-guide/contributing/reporting-bugs) | [Twitter](https://twitter.com/geteslint) | [Mailing List](https://groups.google.com/group/eslint) | [Chat Room](https://gitter.im/eslint/eslint)
       
       ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. In many ways, it is similar to JSLint and JSHint with a few exceptions:
       
      @@ -31,6 +32,32 @@ After that, you can run ESLint on any JavaScript file:
       
           eslint test.js test2.js
       
      +## Configuration
      +
      +After running `eslint --init`, you'll have a `.eslintrc` file in your directory. In it, you'll see some rules configured like this:
      +
      +```json
      +{
      +    "rules": {
      +        "semi": ["error", "always"],
      +        "quotes": ["error", "double"]
      +    }
      +}
      +```
      +
      +The names `"semi"` and `"quotes"` are the names of [rules](http://eslint.org/docs/rules) in ESLint. The number is the error level of the rule and can be one of the three values:
      +
      +* `"off"` or `0` - turn the rule off
      +* `"warn"` or `1` - turn the rule on as a warning (doesn't affect exit code)
      +* `"error"` or `2` - turn the rule on as an error (exit code will be 1)
      +
      +The three error levels allow you fine-grained control over how ESLint applies rules (for more configuration options and details, see the [configuration docs](http://eslint.org/docs/user-guide/configuring)).
      +
      +## Sponsors
      +
      +* Development is sponsored by [Box](https://box.com)
      +* Site search ([eslint.org](http://eslint.org)) is sponsored by [Algolia](https://www.algolia.com)
      +
       ## Team
       
       These folks keep the project moving and are resources for help:
      @@ -38,10 +65,28 @@ These folks keep the project moving and are resources for help:
       * Nicholas C. Zakas ([@nzakas](https://github.com/nzakas)) - project lead
       * Ilya Volodin ([@ilyavolodin](https://github.com/ilyavolodin)) - reviewer
       * Brandon Mills ([@btmills](https://github.com/btmills)) - reviewer
      +* Gyandeep Singh ([@gyandeeps](https://github.com/gyandeeps)) - reviewer
      +* Toru Nagashima ([@mysticatea](https://github.com/mysticatea)) - reviewer
       * Mathias Schreck ([@lo1tuma](https://github.com/lo1tuma)) - committer
      -* Gyandeep Singh ([@gyandeeps](https://github.com/gyandeeps)) - committer
       * Jamund Ferguson ([@xjamundx](https://github.com/xjamundx)) - committer
      +* Ian VanSchooten ([@ianvs](https://github.com/ianvs)) - committer
      +* Burak Yiğit Kaya ([@byk](https://github.com/byk)) - committer
      +* Alberto Rodríguez ([@alberto](https://github.com/alberto)) - committer
      +* Kai Cataldo ([@kaicataldo](https://github.com/kaicataldo)) - committer
      +* Michael Ficarra ([@michaelficarra](https://github.com/michaelficarra)) - committer
      +
      +## Releases
      +
      +We have scheduled releases every two weeks on Friday or Saturday.
      +
      +## Filing Issues
       
      +Before filing an issue, please be sure to read the guidelines for what you're reporting:
      +
      +* [Bug Report](http://eslint.org/docs/developer-guide/contributing/reporting-bugs)
      +* [Propose a New Rule](http://eslint.org/docs/developer-guide/contributing/new-rules)
      +* [Proposing a Rule Change](http://eslint.org/docs/developer-guide/contributing/rule-changes)
      +* [Request a Change](http://eslint.org/docs/developer-guide/contributing/changes)
       
       ## Frequently Asked Questions
       
      @@ -67,45 +112,35 @@ If you are using both JSHint and JSCS on your files, then using just ESLint will
       
       ESLint does both traditional linting (looking for problematic patterns) and style checking (enforcement of conventions). You can use it for both.
       
      -### Who is using ESLint?
      -
      -The following projects are using ESLint to validate their JavaScript:
      -
      -* [Drupal](https://www.drupal.org/node/2274223)
      -* [Esprima](https://github.com/ariya/esprima)
      -* [io.js](https://github.com/iojs/io.js/commit/f9dd34d301ab385ae316769b85ef916f9b70b6f6)
      -* [WebKit](https://bugs.webkit.org/show_bug.cgi?id=125048)
      -
      -In addition, the following companies are using ESLint internally to validate their JavaScript:
      +### Does ESLint support JSX?
       
      -* [Box](https://box.com)
      -* [CustomInk](https://customink.com)
      -* [Fitbit](http://www.fitbit.com)
      -* [HolidayCheck](http://holidaycheck.de)
      -* [the native web](http://www.thenativeweb.io)
      +Yes, ESLint natively supports parsing JSX syntax (this must be enabled in [configuration](http://eslint.org/docs/user-guide/configuring).). Please note that supporting JSX syntax *is not* the same as supporting React. React applies specific semantics to JSX syntax that ESLint doesn't recognize. We recommend using [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react) if you are using React and want React semantics.
       
       ### What about ECMAScript 6 support?
       
       ESLint has full support for ECMAScript 6. By default, this support is off. You can enable ECMAScript 6 support through [configuration](http://eslint.org/docs/user-guide/configuring).
       
      -### Does ESLint support JSX?
      -
      -Yes, ESLint natively supports parsing JSX syntax (this must be enabled in [configuration](http://eslint.org/docs/user-guide/configuring).). Please note that supporting JSX syntax *is not* the same as supporting React. React applies specific semantics to JSX syntax that ESLint doesn't recognize. We recommend using [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react) if you are using React and want React semantics.
      -
      -### What about ECMAScript 7/2016 and experimental features?
      +### What about experimental features?
       
       ESLint doesn't natively support experimental ECMAScript language features. You can use [babel-eslint](https://github.com/babel/babel-eslint) to use any option available in Babel.
       
      +Once a language feature has been adopted into the ECMAScript standard, we will accept
      +issues and pull requests related to the new feature, subject to our [contributing
      +guidelines](http://eslint.org/docs/developer-guide/contributing). Until then, please use
      +the appropriate parser and plugin(s) for your experimental feature.
      +
       ### Where to ask for help?
       
       Join our [Mailing List](https://groups.google.com/group/eslint) or [Chatroom](https://gitter.im/eslint/eslint)
       
       
       [npm-image]: https://img.shields.io/npm/v/eslint.svg?style=flat-square
      -[npm-url]: https://npmjs.org/package/eslint
      +[npm-url]: https://www.npmjs.com/package/eslint
       [travis-image]: https://img.shields.io/travis/eslint/eslint/master.svg?style=flat-square
       [travis-url]: https://travis-ci.org/eslint/eslint
      +[appveyor-image]: https://ci.appveyor.com/api/projects/status/iwxmiobcvbw3b0av/branch/master?svg=true
      +[appveyor-url]: https://ci.appveyor.com/project/nzakas/eslint/branch/master
       [coveralls-image]: https://img.shields.io/coveralls/eslint/eslint/master.svg?style=flat-square
       [coveralls-url]: https://coveralls.io/r/eslint/eslint?branch=master
      -[downloads-image]: http://img.shields.io/npm/dm/eslint.svg?style=flat-square
      -[downloads-url]: https://npmjs.org/package/eslint
      +[downloads-image]: https://img.shields.io/npm/dm/eslint.svg?style=flat-square
      +[downloads-url]: https://www.npmjs.com/package/eslint
      diff --git a/tools/eslint/bin/eslint.js b/tools/eslint/bin/eslint.js
      old mode 100755
      new mode 100644
      index 5e0cc800c8c603..19e5720a711f92
      --- a/tools/eslint/bin/eslint.js
      +++ b/tools/eslint/bin/eslint.js
      @@ -1,11 +1,58 @@
       #!/usr/bin/env node
      -var concat = require("concat-stream"),
      -    configInit = require("../lib/config-initializer"),
      -    cli = require("../lib/cli");
      +
      +/**
      + * @fileoverview Main CLI that is run via the eslint command.
      + * @author Nicholas C. Zakas
      + * @copyright 2013 Nicholas C. Zakas. All rights reserved.
      + * See LICENSE file in root directory for full license.
      + */
      +
      +"use strict";
      +
      +//------------------------------------------------------------------------------
      +// Helpers
      +//------------------------------------------------------------------------------
       
       var exitCode = 0,
           useStdIn = (process.argv.indexOf("--stdin") > -1),
      -    init = (process.argv.indexOf("--init") > -1);
      +    init = (process.argv.indexOf("--init") > -1),
      +    debug = (process.argv.indexOf("--debug") > -1);
      +
      +// must do this initialization *before* other requires in order to work
      +if (debug) {
      +    require("debug").enable("eslint:*,-eslint:code-path");
      +}
      +
      +//------------------------------------------------------------------------------
      +// Requirements
      +//------------------------------------------------------------------------------
      +
      +// now we can safely include the other modules that use debug
      +var concat = require("concat-stream"),
      +    cli = require("../lib/cli"),
      +    path = require("path"),
      +    fs = require("fs");
      +
      +//------------------------------------------------------------------------------
      +// Execution
      +//------------------------------------------------------------------------------
      +
      +process.on("uncaughtException", function(err){
      +    // lazy load
      +    var lodash = require("lodash");
      +
      +    if (typeof err.messageTemplate === "string" && err.messageTemplate.length > 0) {
      +        var template = lodash.template(fs.readFileSync(path.resolve(__dirname, "../messages/" + err.messageTemplate + ".txt"), "utf-8"));
      +
      +        console.log("\nOops! Something went wrong! :(");
      +        console.log("\n" + template(err.messageData || {}));
      +    } else {
      +        console.log(err.message);
      +        console.log(err.stack);
      +    }
      +
      +    process.exit(1);
      +});
       
       if (useStdIn) {
           process.stdin.pipe(concat({ encoding: "string" }, function(text) {
      @@ -18,13 +65,13 @@ if (useStdIn) {
               }
           }));
       } else if (init) {
      +    var configInit = require("../lib/config/config-initializer");
           configInit.initializeConfig(function(err) {
               if (err) {
                   exitCode = 1;
                   console.error(err.message);
                   console.error(err.stack);
               } else {
      -            console.log("Successfully created .eslintrc file in " + process.cwd());
                   exitCode = 0;
               }
           });
      @@ -32,10 +79,16 @@ if (useStdIn) {
           exitCode = cli.execute(process.argv);
       }
       
      -/*
      - * Wait for the stdout buffer to drain.
      - * See https://github.com/eslint/eslint/issues/317
      - */
      -process.on("exit", function() {
      -    process.exit(exitCode);
      -});
      +// https://github.com/eslint/eslint/issues/4691
      +// In Node.js >= 0.12, you can use a cleaner way
      +if ("exitCode" in process) {
      +    process.exitCode = exitCode;
      +} else {
      +    /*
      +     * Wait for the stdout buffer to drain.
      +     * See https://github.com/eslint/eslint/issues/317
      +     */
      +    process.on("exit", function() {
      +        process.exit(exitCode);
      +    });
      +}
      diff --git a/tools/eslint/conf/blank-script.json b/tools/eslint/conf/blank-script.json
      new file mode 100644
      index 00000000000000..d7d7d37ba89472
      --- /dev/null
      +++ b/tools/eslint/conf/blank-script.json
      @@ -0,0 +1,21 @@
      +{
      +  "type": "Program",
      +  "body": [],
      +  "sourceType": "script",
      +  "range": [
      +    0,
      +    0
      +  ],
      +  "loc": {
      +    "start": {
      +      "line": 0,
      +      "column": 0
      +    },
      +    "end": {
      +      "line": 0,
      +      "column": 0
      +    }
      +  },
      +  "comments": [],
      +  "tokens": []
      +}
      diff --git a/tools/eslint/conf/cli-options.js b/tools/eslint/conf/cli-options.js
      new file mode 100644
      index 00000000000000..02d1f53542a435
      --- /dev/null
      +++ b/tools/eslint/conf/cli-options.js
      @@ -0,0 +1,32 @@
      +/**
      + * @fileoverview Default CLIEngineOptions.
      + * @author Ian VanSchooten
      + * @copyright 2016 Ian VanSchooten. All rights reserved.
      + * See LICENSE in root directory for full license.
      + */
      +
      +"use strict";
      +
      +var DEFAULT_PARSER = require("../conf/eslint.json").parser;
      +
      +module.exports = {
      +    configFile: null,
      +    baseConfig: false,
      +    rulePaths: [],
      +    useEslintrc: true,
      +    envs: [],
      +    globals: [],
      +    rules: {},
      +    extensions: [".js"],
      +    ignore: true,
      +    ignorePath: null,
      +    parser: DEFAULT_PARSER,
      +    cache: false,
      +    // in order to honor the cacheFile option if specified
      +    // this option should not have a default value otherwise
      +    // it will always be used
      +    cacheLocation: "",
      +    cacheFile: ".eslintcache",
      +    fix: false,
      +    allowInlineConfig: true
      +};
      diff --git a/tools/eslint/conf/environments.js b/tools/eslint/conf/environments.js
      index 5b01dc7ad6b37a..13c6da81f1afc2 100644
      --- a/tools/eslint/conf/environments.js
      +++ b/tools/eslint/conf/environments.js
      @@ -5,29 +5,40 @@
        */
       "use strict";
       
      +//------------------------------------------------------------------------------
      +// Requirements
      +//------------------------------------------------------------------------------
      +
       var globals = require("globals");
       
      +//------------------------------------------------------------------------------
      +// Public Interface
      +//------------------------------------------------------------------------------
      +
       module.exports = {
      -    builtin: globals.builtin,
      +    builtin: globals.es5,
           browser: {
               globals: globals.browser
           },
           node: {
               globals: globals.node,
      -        ecmaFeatures: {
      -            globalReturn: true
      -        },
      -        rules: {
      -            "no-catch-shadow": 0,
      -            "no-console": 0,
      -            "no-mixed-requires": 2,
      -            "no-new-require": 2,
      -            "no-path-concat": 2,
      -            "no-process-exit": 2,
      -            "global-strict": [0, "always"],
      -            "handle-callback-err": [2, "err"]
      +        parserOptions: {
      +            ecmaFeatures: {
      +                globalReturn: true
      +            }
      +        }
      +    },
      +    commonjs: {
      +        globals: globals.commonjs,
      +        parserOptions: {
      +            ecmaFeatures: {
      +                globalReturn: true
      +            }
               }
           },
      +    "shared-node-browser": {
      +        globals: globals["shared-node-browser"]
      +    },
           worker: {
               globals: globals.worker
           },
      @@ -40,12 +51,18 @@ module.exports = {
           jasmine: {
               globals: globals.jasmine
           },
      +    jest: {
      +        globals: globals.jest
      +    },
           phantomjs: {
      -        globals: globals.phantom
      +        globals: globals.phantomjs
           },
           jquery: {
               globals: globals.jquery
           },
      +    qunit: {
      +        globals: globals.qunit
      +    },
           prototypejs: {
               globals: globals.prototypejs
           },
      @@ -58,30 +75,34 @@ module.exports = {
           mongo: {
               globals: globals.mongo
           },
      +    protractor: {
      +        globals: globals.protractor
      +    },
           applescript: {
               globals: globals.applescript
           },
      +    nashorn: {
      +        globals: globals.nashorn
      +    },
      +    serviceworker: {
      +        globals: globals.serviceworker
      +    },
      +    atomtest: {
      +        globals: globals.atomtest
      +    },
      +    embertest: {
      +        globals: globals.embertest
      +    },
      +    webextensions: {
      +        globals: globals.webextensions
      +    },
           es6: {
      -        ecmaFeatures: {
      -            arrowFunctions: true,
      -            blockBindings: true,
      -            regexUFlag: true,
      -            regexYFlag: true,
      -            templateStrings: true,
      -            binaryLiterals: true,
      -            octalLiterals: true,
      -            unicodeCodePointEscapes: true,
      -            superInFunctions: true,
      -            defaultParams: true,
      -            restParams: true,
      -            forOf: true,
      -            objectLiteralComputedProperties: true,
      -            objectLiteralShorthandMethods: true,
      -            objectLiteralShorthandProperties: true,
      -            objectLiteralDuplicateProperties: true,
      -            generators: true,
      -            destructuring: true,
      -            classes: true
      +        globals: globals.es6,
      +        parserOptions: {
      +            ecmaVersion: 6
               }
      +    },
      +    greasemonkey: {
      +        globals: globals.greasemonkey
           }
       };
      diff --git a/tools/eslint/conf/eslint.json b/tools/eslint/conf/eslint.json
      index 28dc73ca09fb56..21af92e0da9859 100644
      --- a/tools/eslint/conf/eslint.json
      +++ b/tools/eslint/conf/eslint.json
      @@ -1,186 +1,215 @@
       {
      -    "ecmaFeatures": {},
           "parser": "espree",
      -    "env": {
      -        "browser": false,
      -        "node": false,
      -        "amd": false,
      -        "mocha": false,
      -        "jasmine": false
      -    },
      -
      +    "ecmaFeatures": {},
           "rules": {
      -        "no-alert": 2,
      -        "no-array-constructor": 2,
      -        "no-bitwise": 0,
      -        "no-caller": 2,
      -        "no-catch-shadow": 2,
      -        "no-comma-dangle": 0,
      -        "no-cond-assign": 2,
      -        "no-console": 2,
      -        "no-constant-condition": 2,
      -        "no-continue": 0,
      -        "no-control-regex": 2,
      -        "no-debugger": 2,
      -        "no-delete-var": 2,
      -        "no-div-regex": 0,
      -        "no-dupe-keys": 2,
      -        "no-dupe-args": 2,
      -        "no-duplicate-case": 2,
      -        "no-else-return": 0,
      -        "no-empty": 2,
      -        "no-empty-class": 0,
      -        "no-empty-character-class": 2,
      -        "no-empty-label": 2,
      -        "no-eq-null": 0,
      -        "no-eval": 2,
      -        "no-ex-assign": 2,
      -        "no-extend-native": 2,
      -        "no-extra-bind": 2,
      -        "no-extra-boolean-cast": 2,
      -        "no-extra-parens": 0,
      -        "no-extra-semi": 2,
      -        "no-extra-strict": 2,
      -        "no-fallthrough": 2,
      -        "no-floating-decimal": 0,
      -        "no-func-assign": 2,
      -        "no-implied-eval": 2,
      -        "no-inline-comments": 0,
      -        "no-inner-declarations": [2, "functions"],
      -        "no-invalid-regexp": 2,
      -        "no-irregular-whitespace": 2,
      -        "no-iterator": 2,
      -        "no-label-var": 2,
      -        "no-labels": 2,
      -        "no-lone-blocks": 2,
      -        "no-lonely-if": 0,
      -        "no-loop-func": 2,
      -        "no-mixed-requires": [0, false],
      -        "no-mixed-spaces-and-tabs": [2, false],
      -        "linebreak-style": [0, "unix"],
      -        "no-multi-spaces": 2,
      -        "no-multi-str": 2,
      -        "no-multiple-empty-lines": [0, {"max": 2}],
      -        "no-native-reassign": 2,
      -        "no-negated-in-lhs": 2,
      -        "no-nested-ternary": 0,
      -        "no-new": 2,
      -        "no-new-func": 2,
      -        "no-new-object": 2,
      -        "no-new-require": 0,
      -        "no-new-wrappers": 2,
      -        "no-obj-calls": 2,
      -        "no-octal": 2,
      -        "no-octal-escape": 2,
      -        "no-param-reassign": 0,
      -        "no-path-concat": 0,
      -        "no-plusplus": 0,
      -        "no-process-env": 0,
      -        "no-process-exit": 2,
      -        "no-proto": 2,
      -        "no-redeclare": 2,
      -        "no-regex-spaces": 2,
      -        "no-reserved-keys": 0,
      -        "no-restricted-modules": 0,
      -        "no-return-assign": 2,
      -        "no-script-url": 2,
      -        "no-self-compare": 0,
      -        "no-sequences": 2,
      -        "no-shadow": 2,
      -        "no-shadow-restricted-names": 2,
      -        "no-space-before-semi": 0,
      -        "no-spaced-func": 2,
      -        "no-sparse-arrays": 2,
      -        "no-sync": 0,
      -        "no-ternary": 0,
      -        "no-trailing-spaces": 2,
      -        "no-this-before-super": 0,
      -        "no-throw-literal": 0,
      -        "no-undef": 2,
      -        "no-undef-init": 2,
      -        "no-undefined": 0,
      -        "no-unexpected-multiline": 0,
      -        "no-underscore-dangle": 2,
      -        "no-unneeded-ternary": 0,
      -        "no-unreachable": 2,
      -        "no-unused-expressions": 2,
      -        "no-unused-vars": [2, {"vars": "all", "args": "after-used"}],
      -        "no-use-before-define": 2,
      -        "no-void": 0,
      -        "no-var": 0,
      -        "prefer-const": 0,
      -        "no-warning-comments": [0, { "terms": ["todo", "fixme", "xxx"], "location": "start" }],
      -        "no-with": 2,
      -        "no-wrap-func": 2,
      -
      -        "array-bracket-spacing": [0, "never"],
      -        "accessor-pairs": 0,
      -        "block-scoped-var": 0,
      -        "brace-style": [0, "1tbs"],
      -        "camelcase": 2,
      -        "comma-dangle": [2, "never"],
      -        "comma-spacing": 2,
      -        "comma-style": 0,
      -        "complexity": [0, 11],
      -        "computed-property-spacing": [0, "never"],
      -        "consistent-return": 2,
      -        "consistent-this": [0, "that"],
      -        "constructor-super": 0,
      -        "curly": [2, "all"],
      -        "default-case": 0,
      -        "dot-location": 0,
      -        "dot-notation": [2, { "allowKeywords": true }],
      -        "eol-last": 2,
      -        "eqeqeq": 2,
      -        "func-names": 0,
      -        "func-style": [0, "declaration"],
      -        "generator-star": 0,
      -        "generator-star-spacing": 0,
      -        "global-strict": [2, "never"],
      -        "guard-for-in": 0,
      -        "handle-callback-err": 0,
      -        "indent": 0,
      -        "key-spacing": [2, { "beforeColon": false, "afterColon": true }],
      -        "lines-around-comment": 0,
      -        "max-depth": [0, 4],
      -        "max-len": [0, 80, 4],
      -        "max-nested-callbacks": [0, 2],
      -        "max-params": [0, 3],
      -        "max-statements": [0, 10],
      -        "new-cap": 2,
      -        "new-parens": 2,
      -        "newline-after-var": 0,
      -        "object-curly-spacing": [0, "never"],
      -        "object-shorthand": 0,
      -        "one-var": 0,
      -        "operator-assignment": [0, "always"],
      -        "operator-linebreak": 0,
      -        "padded-blocks": 0,
      -        "quote-props": 0,
      -        "quotes": [2, "double"],
      -        "radix": 0,
      -        "semi": 2,
      -        "semi-spacing": [2, {"before": false, "after": true}],
      -        "sort-vars": 0,
      -        "space-after-function-name": [0, "never"],
      -        "space-after-keywords": [0, "always"],
      -        "space-before-blocks": [0, "always"],
      -        "space-before-function-paren": [0, "always"],
      -        "space-before-function-parentheses": [0, "always"],
      -        "space-in-brackets": [0, "never"],
      -        "space-in-parens": [0, "never"],
      -        "space-infix-ops": 2,
      -        "space-return-throw-case": 2,
      -        "space-unary-ops": [2, { "words": true, "nonwords": false }],
      -        "spaced-comment": 0,
      -        "spaced-line-comment": [0, "always"],
      -        "strict": 2,
      -        "use-isnan": 2,
      -        "valid-jsdoc": 0,
      -        "valid-typeof": 2,
      -        "vars-on-top": 0,
      -        "wrap-iife": 0,
      -        "wrap-regex": 0,
      -        "yoda": [2, "never"]
      +        "no-alert": "off",
      +        "no-array-constructor": "off",
      +        "no-bitwise": "off",
      +        "no-caller": "off",
      +        "no-case-declarations": "error",
      +        "no-catch-shadow": "off",
      +        "no-class-assign": "error",
      +        "no-cond-assign": "error",
      +        "no-confusing-arrow": "off",
      +        "no-console": "error",
      +        "no-const-assign": "error",
      +        "no-constant-condition": "error",
      +        "no-continue": "off",
      +        "no-control-regex": "error",
      +        "no-debugger": "error",
      +        "no-delete-var": "error",
      +        "no-div-regex": "off",
      +        "no-dupe-class-members": "error",
      +        "no-dupe-keys": "error",
      +        "no-dupe-args": "error",
      +        "no-duplicate-case": "error",
      +        "no-duplicate-imports": "off",
      +        "no-else-return": "off",
      +        "no-empty": "error",
      +        "no-empty-character-class": "error",
      +        "no-empty-function": "off",
      +        "no-empty-pattern": "error",
      +        "no-eq-null": "off",
      +        "no-eval": "off",
      +        "no-ex-assign": "error",
      +        "no-extend-native": "off",
      +        "no-extra-bind": "off",
      +        "no-extra-boolean-cast": "error",
      +        "no-extra-label": "off",
      +        "no-extra-parens": "off",
      +        "no-extra-semi": "error",
      +        "no-fallthrough": "error",
      +        "no-floating-decimal": "off",
      +        "no-func-assign": "error",
      +        "no-implicit-coercion": "off",
      +        "no-implicit-globals": "off",
      +        "no-implied-eval": "off",
      +        "no-inline-comments": "off",
      +        "no-inner-declarations": "error",
      +        "no-invalid-regexp": "error",
      +        "no-invalid-this": "off",
      +        "no-irregular-whitespace": "error",
      +        "no-iterator": "off",
      +        "no-label-var": "off",
      +        "no-labels": "off",
      +        "no-lone-blocks": "off",
      +        "no-lonely-if": "off",
      +        "no-loop-func": "off",
      +        "no-mixed-requires": "off",
      +        "no-mixed-spaces-and-tabs": "error",
      +        "linebreak-style": "off",
      +        "no-multi-spaces": "off",
      +        "no-multi-str": "off",
      +        "no-multiple-empty-lines": "off",
      +        "no-native-reassign": "off",
      +        "no-negated-condition": "off",
      +        "no-negated-in-lhs": "error",
      +        "no-nested-ternary": "off",
      +        "no-new": "off",
      +        "no-new-func": "off",
      +        "no-new-object": "off",
      +        "no-new-require": "off",
      +        "no-new-symbol": "error",
      +        "no-new-wrappers": "off",
      +        "no-obj-calls": "error",
      +        "no-octal": "error",
      +        "no-octal-escape": "off",
      +        "no-param-reassign": "off",
      +        "no-path-concat": "off",
      +        "no-plusplus": "off",
      +        "no-process-env": "off",
      +        "no-process-exit": "off",
      +        "no-proto": "off",
      +        "no-redeclare": "error",
      +        "no-regex-spaces": "error",
      +        "no-restricted-globals": "off",
      +        "no-restricted-imports": "off",
      +        "no-restricted-modules": "off",
      +        "no-restricted-syntax": "off",
      +        "no-return-assign": "off",
      +        "no-script-url": "off",
      +        "no-self-assign": "error",
      +        "no-self-compare": "off",
      +        "no-sequences": "off",
      +        "no-shadow": "off",
      +        "no-shadow-restricted-names": "off",
      +        "no-whitespace-before-property": "off",
      +        "no-spaced-func": "off",
      +        "no-sparse-arrays": "error",
      +        "no-sync": "off",
      +        "no-ternary": "off",
      +        "no-trailing-spaces": "off",
      +        "no-this-before-super": "error",
      +        "no-throw-literal": "off",
      +        "no-undef": "error",
      +        "no-undef-init": "off",
      +        "no-undefined": "off",
      +        "no-unexpected-multiline": "error",
      +        "no-underscore-dangle": "off",
      +        "no-unmodified-loop-condition": "off",
      +        "no-unneeded-ternary": "off",
      +        "no-unreachable": "error",
      +        "no-unused-expressions": "off",
      +        "no-unused-labels": "error",
      +        "no-unused-vars": "error",
      +        "no-use-before-define": "off",
      +        "no-useless-call": "off",
      +        "no-useless-concat": "off",
      +        "no-useless-constructor": "off",
      +        "no-useless-escape": "off",
      +        "no-void": "off",
      +        "no-var": "off",
      +        "no-warning-comments": "off",
      +        "no-with": "off",
      +        "no-magic-numbers": "off",
      +        "array-bracket-spacing": "off",
      +        "array-callback-return": "off",
      +        "arrow-body-style": "off",
      +        "arrow-parens": "off",
      +        "arrow-spacing": "off",
      +        "accessor-pairs": "off",
      +        "block-scoped-var": "off",
      +        "block-spacing": "off",
      +        "brace-style": "off",
      +        "callback-return": "off",
      +        "camelcase": "off",
      +        "comma-dangle": "error",
      +        "comma-spacing": "off",
      +        "comma-style": "off",
      +        "complexity": ["off", 11],
      +        "computed-property-spacing": "off",
      +        "consistent-return": "off",
      +        "consistent-this": "off",
      +        "constructor-super": "error",
      +        "curly": "off",
      +        "default-case": "off",
      +        "dot-location": "off",
      +        "dot-notation": "off",
      +        "eol-last": "off",
      +        "eqeqeq": "off",
      +        "func-names": "off",
      +        "func-style": "off",
      +        "generator-star-spacing": "off",
      +        "global-require": "off",
      +        "guard-for-in": "off",
      +        "handle-callback-err": "off",
      +        "id-length": "off",
      +        "indent": "off",
      +        "init-declarations": "off",
      +        "jsx-quotes": "off",
      +        "key-spacing": "off",
      +        "keyword-spacing": "off",
      +        "lines-around-comment": "off",
      +        "max-depth": "off",
      +        "max-len": "off",
      +        "max-nested-callbacks": "off",
      +        "max-params": "off",
      +        "max-statements": "off",
      +        "max-statements-per-line": "off",
      +        "new-cap": "off",
      +        "new-parens": "off",
      +        "newline-after-var": "off",
      +        "newline-before-return": "off",
      +        "newline-per-chained-call": "off",
      +        "object-curly-spacing": ["off", "never"],
      +        "object-shorthand": "off",
      +        "one-var": "off",
      +        "one-var-declaration-per-line": "off",
      +        "operator-assignment": "off",
      +        "operator-linebreak": "off",
      +        "padded-blocks": "off",
      +        "prefer-arrow-callback": "off",
      +        "prefer-const": "off",
      +        "prefer-reflect": "off",
      +        "prefer-rest-params": "off",
      +        "prefer-spread": "off",
      +        "prefer-template": "off",
      +        "quote-props": "off",
      +        "quotes": "off",
      +        "radix": "off",
      +        "id-match": "off",
      +        "id-blacklist": "off",
      +        "require-jsdoc": "off",
      +        "require-yield": "off",
      +        "semi": "off",
      +        "semi-spacing": "off",
      +        "sort-vars": "off",
      +        "sort-imports": "off",
      +        "space-before-blocks": "off",
      +        "space-before-function-paren": "off",
      +        "space-in-parens": "off",
      +        "space-infix-ops": "off",
      +        "space-unary-ops": "off",
      +        "spaced-comment": "off",
      +        "strict": "off",
      +        "template-curly-spacing": "off",
      +        "use-isnan": "error",
      +        "valid-jsdoc": "off",
      +        "valid-typeof": "error",
      +        "vars-on-top": "off",
      +        "wrap-iife": "off",
      +        "wrap-regex": "off",
      +        "yield-star-spacing": "off",
      +        "yoda": "off"
           }
       }
      diff --git a/tools/eslint/conf/json-schema-schema.json b/tools/eslint/conf/json-schema-schema.json
      new file mode 100644
      index 00000000000000..85eb502a680ed0
      --- /dev/null
      +++ b/tools/eslint/conf/json-schema-schema.json
      @@ -0,0 +1,150 @@
      +{
      +    "id": "http://json-schema.org/draft-04/schema#",
      +    "$schema": "http://json-schema.org/draft-04/schema#",
      +    "description": "Core schema meta-schema",
      +    "definitions": {
      +        "schemaArray": {
      +            "type": "array",
      +            "minItems": 1,
      +            "items": { "$ref": "#" }
      +        },
      +        "positiveInteger": {
      +            "type": "integer",
      +            "minimum": 0
      +        },
      +        "positiveIntegerDefault0": {
      +            "allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]
      +        },
      +        "simpleTypes": {
      +            "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]
      +        },
      +        "stringArray": {
      +            "type": "array",
      +            "items": { "type": "string" },
      +            "minItems": 1,
      +            "uniqueItems": true
      +        }
      +    },
      +    "type": "object",
      +    "properties": {
      +        "id": {
      +            "type": "string",
      +            "format": "uri"
      +        },
      +        "$schema": {
      +            "type": "string",
      +            "format": "uri"
      +        },
      +        "title": {
      +            "type": "string"
      +        },
      +        "description": {
      +            "type": "string"
      +        },
      +        "default": {},
      +        "multipleOf": {
      +            "type": "number",
      +            "minimum": 0,
      +            "exclusiveMinimum": true
      +        },
      +        "maximum": {
      +            "type": "number"
      +        },
      +        "exclusiveMaximum": {
      +            "type": "boolean",
      +            "default": false
      +        },
      +        "minimum": {
      +            "type": "number"
      +        },
      +        "exclusiveMinimum": {
      +            "type": "boolean",
      +            "default": false
      +        },
      +        "maxLength": { "$ref": "#/definitions/positiveInteger" },
      +        "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
      +        "pattern": {
      +            "type": "string",
      +            "format": "regex"
      +        },
      +        "additionalItems": {
      +            "anyOf": [
      +                { "type": "boolean" },
      +                { "$ref": "#" }
      +            ],
      +            "default": {}
      +        },
      +        "items": {
      +            "anyOf": [
      +                { "$ref": "#" },
      +                { "$ref": "#/definitions/schemaArray" }
      +            ],
      +            "default": {}
      +        },
      +        "maxItems": { "$ref": "#/definitions/positiveInteger" },
      +        "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },
      +        "uniqueItems": {
      +            "type": "boolean",
      +            "default": false
      +        },
      +        "maxProperties": { "$ref": "#/definitions/positiveInteger" },
      +        "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
      +        "required": { "$ref": "#/definitions/stringArray" },
      +        "additionalProperties": {
      +            "anyOf": [
      +                { "type": "boolean" },
      +                { "$ref": "#" }
      +            ],
      +            "default": {}
      +        },
      +        "definitions": {
      +            "type": "object",
      +            "additionalProperties": { "$ref": "#" },
      +            "default": {}
      +        },
      +        "properties": {
      +            "type": "object",
      +            "additionalProperties": { "$ref": "#" },
      +            "default": {}
      +        },
      +        "patternProperties": {
      +            "type": "object",
      +            "additionalProperties": { "$ref": "#" },
      +            "default": {}
      +        },
      +        "dependencies": {
      +            "type": "object",
      +            "additionalProperties": {
      +                "anyOf": [
      +                    { "$ref": "#" },
      +                    { "$ref": "#/definitions/stringArray" }
      +                ]
      +            }
      +        },
      +        "enum": {
      +            "type": "array",
      +            "minItems": 1,
      +            "uniqueItems": true
      +        },
      +        "type": {
      +            "anyOf": [
      +                { "$ref": "#/definitions/simpleTypes" },
      +                {
      +                    "type": "array",
      +                    "items": { "$ref": "#/definitions/simpleTypes" },
      +                    "minItems": 1,
      +                    "uniqueItems": true
      +                }
      +            ]
      +        },
      +        "allOf": { "$ref": "#/definitions/schemaArray" },
      +        "anyOf": { "$ref": "#/definitions/schemaArray" },
      +        "oneOf": { "$ref": "#/definitions/schemaArray" },
      +        "not": { "$ref": "#" }
      +    },
      +    "dependencies": {
      +        "exclusiveMaximum": [ "maximum" ],
      +        "exclusiveMinimum": [ "minimum" ]
      +    },
      +    "default": {}
      +}
      diff --git a/tools/eslint/conf/replacements.json b/tools/eslint/conf/replacements.json
      new file mode 100644
      index 00000000000000..c047811e602d41
      --- /dev/null
      +++ b/tools/eslint/conf/replacements.json
      @@ -0,0 +1,22 @@
      +{
      +    "rules": {
      +        "generator-star": ["generator-star-spacing"],
      +        "global-strict": ["strict"],
      +        "no-arrow-condition": ["no-confusing-arrow", "no-constant-condition"],
      +        "no-comma-dangle": ["comma-dangle"],
      +        "no-empty-class": ["no-empty-character-class"],
      +        "no-empty-label": ["no-labels"],
      +        "no-extra-strict": ["strict"],
      +        "no-reserved-keys": ["quote-props"],
      +        "no-space-before-semi": ["semi-spacing"],
      +        "no-wrap-func": ["no-extra-parens"],
      +        "space-after-function-name": ["space-before-function-paren"],
      +        "space-after-keywords": ["keyword-spacing"],
      +        "space-before-function-parentheses": ["space-before-function-paren"],
      +        "space-before-keywords": ["keyword-spacing"],
      +        "space-in-brackets": ["object-curly-spacing", "array-bracket-spacing", "computed-property-spacing"],
      +        "space-return-throw-case": ["keyword-spacing"],
      +        "space-unary-word-ops": ["space-unary-ops"],
      +        "spaced-line-comment": ["spaced-comment"]
      +    }
      +}
      diff --git a/tools/eslint/lib/api.js b/tools/eslint/lib/api.js
      index 160319ef59adf2..664e9a5b40ee95 100644
      --- a/tools/eslint/lib/api.js
      +++ b/tools/eslint/lib/api.js
      @@ -7,7 +7,7 @@
       
       module.exports = {
           linter: require("./eslint"),
      -    cli: require("./cli"),
           CLIEngine: require("./cli-engine"),
      -    validator: require("./config-validator")
      +    RuleTester: require("./testers/rule-tester"),
      +    SourceCode: require("./util/source-code")
       };
      diff --git a/tools/eslint/lib/ast-utils.js b/tools/eslint/lib/ast-utils.js
      new file mode 100644
      index 00000000000000..63b1fb628fd80d
      --- /dev/null
      +++ b/tools/eslint/lib/ast-utils.js
      @@ -0,0 +1,466 @@
      +/**
      + * @fileoverview Common utils for AST.
      + * @author Gyandeep Singh
      + * @copyright 2015 Gyandeep Singh. All rights reserved.
      + * See LICENSE file in root directory for full license.
      + */
      +
      +"use strict";
      +
      +//------------------------------------------------------------------------------
      +// Requirements
      +//------------------------------------------------------------------------------
      +
      +var esutils = require("esutils");
      +
      +//------------------------------------------------------------------------------
      +// Helpers
      +//------------------------------------------------------------------------------
      +
      +var anyFunctionPattern = /^(?:Function(?:Declaration|Expression)|ArrowFunctionExpression)$/;
      +var arrayOrTypedArrayPattern = /Array$/;
      +var arrayMethodPattern = /^(?:every|filter|find|findIndex|forEach|map|some)$/;
      +var bindOrCallOrApplyPattern = /^(?:bind|call|apply)$/;
      +var breakableTypePattern = /^(?:(?:Do)?While|For(?:In|Of)?|Switch)Statement$/;
      +var thisTagPattern = /^[\s\*]*@this/m;
      +
      +/**
      + * Checks reference if is non initializer and writable.
      + * @param {Reference} reference - A reference to check.
      + * @param {int} index - The index of the reference in the references.
      + * @param {Reference[]} references - The array that the reference belongs to.
      + * @returns {boolean} Success/Failure
      + * @private
      + */
      +function isModifyingReference(reference, index, references) {
      +    var identifier = reference.identifier,
      +        modifyingDifferentIdentifier;
      +
      +    /*
      +     * Destructuring assignments can have multiple default value, so
      +     * possibly there are multiple writeable references for the same
      +     * identifier.
      +     */
      +    modifyingDifferentIdentifier = index === 0 ||
      +        references[index - 1].identifier !== identifier;
      +
      +    return (identifier &&
      +        reference.init === false &&
      +        reference.isWrite() &&
      +        modifyingDifferentIdentifier
      +    );
      +}
      +
      +/**
      + * Checks whether or not a node is a constructor.
      + * @param {ASTNode} node - A function node to check.
      + * @returns {boolean} Wehether or not a node is a constructor.
      + */
      +function isES5Constructor(node) {
      +    return (
      +        node.id &&
      +        node.id.name[0] === node.id.name[0].toLocaleUpperCase()
      +    );
      +}
      +
      +/**
      + * Finds a function node from ancestors of a node.
      + * @param {ASTNode} node - A start node to find.
      + * @returns {Node|null} A found function node.
      + */
      +function getUpperFunction(node) {
      +    while (node) {
      +        if (anyFunctionPattern.test(node.type)) {
      +            return node;
      +        }
      +        node = node.parent;
      +    }
      +    return null;
      +}
      +
      +/**
      + * Checks whether or not a node is `null` or `undefined`.
      + * @param {ASTNode} node - A node to check.
      + * @returns {boolean} Whether or not the node is a `null` or `undefined`.
      + * @public
      + */
      +function isNullOrUndefined(node) {
      +    return (
      +        (node.type === "Literal" && node.value === null) ||
      +        (node.type === "Identifier" && node.name === "undefined") ||
      +        (node.type === "UnaryExpression" && node.operator === "void")
      +    );
      +}
      +
      +/**
      + * Checks whether or not a node is callee.
      + * @param {ASTNode} node - A node to check.
      + * @returns {boolean} Whether or not the node is callee.
      + */
      +function isCallee(node) {
      +    return node.parent.type === "CallExpression" && node.parent.callee === node;
      +}
      +
      +/**
      + * Checks whether or not a node is `Reclect.apply`.
      + * @param {ASTNode} node - A node to check.
      + * @returns {boolean} Whether or not the node is a `Reclect.apply`.
      + */
      +function isReflectApply(node) {
      +    return (
      +        node.type === "MemberExpression" &&
      +        node.object.type === "Identifier" &&
      +        node.object.name === "Reflect" &&
      +        node.property.type === "Identifier" &&
      +        node.property.name === "apply" &&
      +        node.computed === false
      +    );
      +}
      +
      +/**
      + * Checks whether or not a node is `Array.from`.
      + * @param {ASTNode} node - A node to check.
      + * @returns {boolean} Whether or not the node is a `Array.from`.
      + */
      +function isArrayFromMethod(node) {
      +    return (
      +        node.type === "MemberExpression" &&
      +        node.object.type === "Identifier" &&
      +        arrayOrTypedArrayPattern.test(node.object.name) &&
      +        node.property.type === "Identifier" &&
      +        node.property.name === "from" &&
      +        node.computed === false
      +    );
      +}
      +
      +/**
      + * Checks whether or not a node is a method which has `thisArg`.
      + * @param {ASTNode} node - A node to check.
      + * @returns {boolean} Whether or not the node is a method which has `thisArg`.
      + */
      +function isMethodWhichHasThisArg(node) {
      +    while (node) {
      +        if (node.type === "Identifier") {
      +            return arrayMethodPattern.test(node.name);
      +        }
      +        if (node.type === "MemberExpression" && !node.computed) {
      +            node = node.property;
      +            continue;
      +        }
      +
      +        break;
      +    }
      +
      +    return false;
      +}
      +
      +/**
      + * Checks whether or not a node has a `@this` tag in its comments.
      + * @param {ASTNode} node - A node to check.
      + * @param {SourceCode} sourceCode - A SourceCode instance to get comments.
      + * @returns {boolean} Whether or not the node has a `@this` tag in its comments.
      + */
      +function hasJSDocThisTag(node, sourceCode) {
      +    var jsdocComment = sourceCode.getJSDocComment(node);
      +
      +    if (jsdocComment && thisTagPattern.test(jsdocComment.value)) {
      +        return true;
      +    }
      +
      +    // Checks `@this` in its leading comments for callbacks,
      +    // because callbacks don't have its JSDoc comment.
      +    // e.g.
      +    //     sinon.test(/* @this sinon.Sandbox */function() { this.spy(); });
      +    return sourceCode.getComments(node).leading.some(function(comment) {
      +        return thisTagPattern.test(comment.value);
      +    });
      +}
      +
      +/**
      + * Determines if a node is surrounded by parentheses.
      + * @param {RuleContext} context The context object passed to the rule
      + * @param {ASTNode} node The node to be checked.
      + * @returns {boolean} True if the node is parenthesised.
      + * @private
      + */
      +function isParenthesised(context, node) {
      +    var previousToken = context.getTokenBefore(node),
      +        nextToken = context.getTokenAfter(node);
      +
      +    return Boolean(previousToken && nextToken) &&
      +        previousToken.value === "(" && previousToken.range[1] <= node.range[0] &&
      +        nextToken.value === ")" && nextToken.range[0] >= node.range[1];
      +}
      +
      +//------------------------------------------------------------------------------
      +// Public Interface
      +//------------------------------------------------------------------------------
      +
      +module.exports = {
      +
      +    /**
      +     * Determines whether two adjacent tokens are on the same line.
      +     * @param {Object} left - The left token object.
      +     * @param {Object} right - The right token object.
      +     * @returns {boolean} Whether or not the tokens are on the same line.
      +     * @public
      +     */
      +    isTokenOnSameLine: function(left, right) {
      +        return left.loc.end.line === right.loc.start.line;
      +    },
      +
      +    isNullOrUndefined: isNullOrUndefined,
      +    isCallee: isCallee,
      +    isES5Constructor: isES5Constructor,
      +    getUpperFunction: getUpperFunction,
      +    isArrayFromMethod: isArrayFromMethod,
      +    isParenthesised: isParenthesised,
      +
      +    /**
      +     * Checks whether or not a given node is a string literal.
      +     * @param {ASTNode} node - A node to check.
      +     * @returns {boolean} `true` if the node is a string literal.
      +     */
      +    isStringLiteral: function(node) {
      +        return (
      +            (node.type === "Literal" && typeof node.value === "string") ||
      +            node.type === "TemplateLiteral"
      +        );
      +    },
      +
      +    /**
      +     * Checks whether a given node is a breakable statement or not.
      +     * The node is breakable if the node is one of the following type:
      +     *
      +     * - DoWhileStatement
      +     * - ForInStatement
      +     * - ForOfStatement
      +     * - ForStatement
      +     * - SwitchStatement
      +     * - WhileStatement
      +     *
      +     * @param {ASTNode} node - A node to check.
      +     * @returns {boolean} `true` if the node is breakable.
      +     */
      +    isBreakableStatement: function(node) {
      +        return breakableTypePattern.test(node.type);
      +    },
      +
      +    /**
      +     * Gets the label if the parent node of a given node is a LabeledStatement.
      +     *
      +     * @param {ASTNode} node - A node to get.
      +     * @returns {string|null} The label or `null`.
      +     */
      +    getLabel: function(node) {
      +        if (node.parent.type === "LabeledStatement") {
      +            return node.parent.label.name;
      +        }
      +        return null;
      +    },
      +
      +    /**
      +     * Gets references which are non initializer and writable.
      +     * @param {Reference[]} references - An array of references.
      +     * @returns {Reference[]} An array of only references which are non initializer and writable.
      +     * @public
      +     */
      +    getModifyingReferences: function(references) {
      +        return references.filter(isModifyingReference);
      +    },
      +
      +    /**
      +     * Validate that a string passed in is surrounded by the specified character
      +     * @param  {string} val The text to check.
      +     * @param  {string} character The character to see if it's surrounded by.
      +     * @returns {boolean} True if the text is surrounded by the character, false if not.
      +     * @private
      +     */
      +    isSurroundedBy: function(val, character) {
      +        return val[0] === character && val[val.length - 1] === character;
      +    },
      +
      +    /**
      +     * Returns whether the provided node is an ESLint directive comment or not
      +     * @param {LineComment|BlockComment} node The node to be checked
      +     * @returns {boolean} `true` if the node is an ESLint directive comment
      +     */
      +    isDirectiveComment: function(node) {
      +        var comment = node.value.trim();
      +
      +        return (
      +            node.type === "Line" && comment.indexOf("eslint-") === 0 ||
      +            node.type === "Block" && (
      +                comment.indexOf("global ") === 0 ||
      +                comment.indexOf("eslint ") === 0 ||
      +                comment.indexOf("eslint-") === 0
      +            )
      +        );
      +    },
      +
      +    /**
      +     * Gets the trailing statement of a given node.
      +     *
      +     *     if (code)
      +     *         consequent;
      +     *
      +     * When taking this `IfStatement`, returns `consequent;` statement.
      +     *
      +     * @param {ASTNode} A node to get.
      +     * @returns {ASTNode|null} The trailing statement's node.
      +     */
      +    getTrailingStatement: esutils.ast.trailingStatement,
      +
      +    /**
      +     * Finds the variable by a given name in a given scope and its upper scopes.
      +     *
      +     * @param {escope.Scope} initScope - A scope to start find.
      +     * @param {string} name - A variable name to find.
      +     * @returns {escope.Variable|null} A found variable or `null`.
      +     */
      +    getVariableByName: function(initScope, name) {
      +        var scope = initScope;
      +
      +        while (scope) {
      +            var variable = scope.set.get(name);
      +
      +            if (variable) {
      +                return variable;
      +            }
      +
      +            scope = scope.upper;
      +        }
      +
      +        return null;
      +    },
      +
      +    /**
      +     * Checks whether or not a given function node is the default `this` binding.
      +     *
      +     * First, this checks the node:
      +     *
      +     * - The function name does not start with uppercase (it's a constructor).
      +     * - The function does not have a JSDoc comment that has a @this tag.
      +     *
      +     * Next, this checks the location of the node.
      +     * If the location is below, this judges `this` is valid.
      +     *
      +     * - The location is not on an object literal.
      +     * - The location does not assign to a property.
      +     * - The location is not on an ES2015 class.
      +     * - The location does not call its `bind`/`call`/`apply` method directly.
      +     * - The function is not a callback of array methods (such as `.forEach()`) if `thisArg` is given.
      +     *
      +     * @param {ASTNode} node - A function node to check.
      +     * @param {SourceCode} sourceCode - A SourceCode instance to get comments.
      +     * @returns {boolean} The function node is the default `this` binding.
      +     */
      +    isDefaultThisBinding: function(node, sourceCode) {
      +        if (isES5Constructor(node) || hasJSDocThisTag(node, sourceCode)) {
      +            return false;
      +        }
      +
      +        while (node) {
      +            var parent = node.parent;
      +
      +            switch (parent.type) {
      +
      +                /*
      +                 * Looks up the destination.
      +                 * e.g., obj.foo = nativeFoo || function foo() { ... };
      +                 */
      +                case "LogicalExpression":
      +                case "ConditionalExpression":
      +                    node = parent;
      +                    break;
      +
      +                // If the upper function is IIFE, checks the destination of the return value.
      +                // e.g.
      +                //   obj.foo = (function() {
      +                //     // setup...
      +                //     return function foo() { ... };
      +                //   })();
      +                case "ReturnStatement":
      +                    var func = getUpperFunction(parent);
      +
      +                    if (func === null || !isCallee(func)) {
      +                        return true;
      +                    }
      +                    node = func.parent;
      +                    break;
      +
      +                // e.g.
      +                //   var obj = { foo() { ... } };
      +                //   var obj = { foo: function() { ... } };
      +                case "Property":
      +                    return false;
      +
      +                // e.g.
      +                //   obj.foo = foo() { ... };
      +                case "AssignmentExpression":
      +                    return (
      +                        parent.right !== node ||
      +                        parent.left.type !== "MemberExpression"
      +                    );
      +
      +                // e.g.
      +                //   class A { constructor() { ... } }
      +                //   class A { foo() { ... } }
      +                //   class A { get foo() { ... } }
      +                //   class A { set foo() { ... } }
      +                //   class A { static foo() { ... } }
      +                case "MethodDefinition":
      +                    return false;
      +
      +                // e.g.
      +                //   var foo = function foo() { ... }.bind(obj);
      +                //   (function foo() { ... }).call(obj);
      +                //   (function foo() { ... }).apply(obj, []);
      +                case "MemberExpression":
      +                    return (
      +                        parent.object !== node ||
      +                        parent.property.type !== "Identifier" ||
      +                        !bindOrCallOrApplyPattern.test(parent.property.name) ||
      +                        !isCallee(parent) ||
      +                        parent.parent.arguments.length === 0 ||
      +                        isNullOrUndefined(parent.parent.arguments[0])
      +                    );
      +
      +                // e.g.
      +                //   Reflect.apply(function() {}, obj, []);
      +                //   Array.from([], function() {}, obj);
      +                //   list.forEach(function() {}, obj);
      +                case "CallExpression":
      +                    if (isReflectApply(parent.callee)) {
      +                        return (
      +                            parent.arguments.length !== 3 ||
      +                            parent.arguments[0] !== node ||
      +                            isNullOrUndefined(parent.arguments[1])
      +                        );
      +                    }
      +                    if (isArrayFromMethod(parent.callee)) {
      +                        return (
      +                            parent.arguments.length !== 3 ||
      +                            parent.arguments[1] !== node ||
      +                            isNullOrUndefined(parent.arguments[2])
      +                        );
      +                    }
      +                    if (isMethodWhichHasThisArg(parent.callee)) {
      +                        return (
      +                            parent.arguments.length !== 2 ||
      +                            parent.arguments[0] !== node ||
      +                            isNullOrUndefined(parent.arguments[1])
      +                        );
      +                    }
      +                    return true;
      +
      +                // Otherwise `this` is default.
      +                default:
      +                    return true;
      +            }
      +        }
      +
      +        /* istanbul ignore next */
      +        return true;
      +    }
      +};
      diff --git a/tools/eslint/lib/cli-engine.js b/tools/eslint/lib/cli-engine.js
      index fce73c6bba7297..2cc62f955eac5f 100644
      --- a/tools/eslint/lib/cli-engine.js
      +++ b/tools/eslint/lib/cli-engine.js
      @@ -2,6 +2,7 @@
        * @fileoverview Main CLI object.
        * @author Nicholas C. Zakas
        * @copyright 2014 Nicholas C. Zakas. All rights reserved.
      + * See LICENSE in root directory for full license.
        */
       
       "use strict";
      @@ -19,16 +20,25 @@
       var fs = require("fs"),
           path = require("path"),
       
      -    assign = require("object-assign"),
      +    lodash = require("lodash"),
           debug = require("debug"),
      +    isAbsolute = require("path-is-absolute"),
       
           rules = require("./rules"),
           eslint = require("./eslint"),
      -    traverse = require("./util/traverse"),
      +    defaultOptions = require("../conf/cli-options"),
           IgnoredPaths = require("./ignored-paths"),
           Config = require("./config"),
      -    util = require("./util"),
      -    validator = require("./config-validator");
      +    Plugins = require("./config/plugins"),
      +    fileEntryCache = require("file-entry-cache"),
      +    globUtil = require("./util/glob-util"),
      +    SourceCodeFixer = require("./util/source-code-fixer"),
      +    validator = require("./config/config-validator"),
      +    stringify = require("json-stable-stringify"),
      +    hash = require("./util/hash"),
      +
      +    pkg = require("../package.json");
      +
       
       //------------------------------------------------------------------------------
       // Typedefs
      @@ -38,8 +48,7 @@ var fs = require("fs"),
        * The options to configure a CLI engine with.
        * @typedef {Object} CLIEngineOptions
        * @property {string} configFile The configuration file to use.
      - * @property {boolean} reset True disables all default rules and environments.
      - * @property {boolean|object} baseConfig Base config object. False disables all default rules and environments.
      + * @property {boolean|object} baseConfig Base config object. True enables recommend rules and environments.
        * @property {boolean} ignore False disables use of .eslintignore.
        * @property {string[]} rulePaths An array of directories to load custom rules from.
        * @property {boolean} useEslintrc False disables looking for .eslintrc
      @@ -63,60 +72,12 @@ var fs = require("fs"),
        * @property {LintMessage[]} messages All of the messages for the result.
        */
       
      -//------------------------------------------------------------------------------
      -// Private
      -//------------------------------------------------------------------------------
      -
      -
      -var defaultOptions = {
      -        configFile: null,
      -        reset: false,
      -        baseConfig: require(path.resolve(__dirname, "..", "conf", "eslint.json")),
      -        rulePaths: [],
      -        useEslintrc: true,
      -        envs: [],
      -        globals: [],
      -        rules: {},
      -        extensions: [".js"],
      -        ignore: true,
      -        ignorePath: null
      -    },
      -    loadedPlugins = Object.create(null);
      -
       //------------------------------------------------------------------------------
       // Helpers
       //------------------------------------------------------------------------------
       
       debug = debug("eslint:cli-engine");
       
      -/**
      - * Load the given plugins if they are not loaded already.
      - * @param {string[]} pluginNames An array of plugin names which should be loaded.
      - * @returns {void}
      - */
      -function loadPlugins(pluginNames) {
      -    if (pluginNames) {
      -        pluginNames.forEach(function (pluginName) {
      -            var pluginNamespace = util.getNamespace(pluginName),
      -                pluginNameWithoutNamespace = util.removeNameSpace(pluginName),
      -                pluginNameWithoutPrefix = util.removePluginPrefix(pluginNameWithoutNamespace),
      -                plugin;
      -
      -            if (!loadedPlugins[pluginNameWithoutPrefix]) {
      -                debug("Load plugin " + pluginNameWithoutPrefix);
      -
      -                plugin = require(pluginNamespace + util.PLUGIN_NAME_PREFIX + pluginNameWithoutPrefix);
      -                // if this plugin has rules, import them
      -                if (plugin.rules) {
      -                    rules.import(plugin.rules, pluginNameWithoutPrefix);
      -                }
      -
      -                loadedPlugins[pluginNameWithoutPrefix] = plugin;
      -            }
      -        });
      -    }
      -}
      -
       /**
        * It will calculate the error and warning count for collection of messages per file
        * @param {Object[]} messages - Collection of messages
      @@ -159,10 +120,12 @@ function calculateStatsPerRun(results) {
        * @param {string} text The source code to check.
        * @param {Object} configHelper The configuration options for ESLint.
        * @param {string} filename An optional string representing the texts filename.
      + * @param {boolean} fix Indicates if fixes should be processed.
      + * @param {boolean} allowInlineConfig Allow/ignore comments that change config.
        * @returns {Result} The results for linting on this text.
        * @private
        */
      -function processText(text, configHelper, filename) {
      +function processText(text, configHelper, filename, fix, allowInlineConfig) {
       
           // clear all existing settings for a new file
           eslint.reset();
      @@ -171,17 +134,25 @@ function processText(text, configHelper, filename) {
               config,
               messages,
               stats,
      -        fileExtension = path.extname(filename),
      -        processor;
      +        fileExtension,
      +        processor,
      +        loadedPlugins,
      +        fixedResult;
       
           if (filename) {
               filePath = path.resolve(filename);
      +        fileExtension = path.extname(filename);
           }
       
           filename = filename || "";
           debug("Linting " + filename);
           config = configHelper.getConfig(filePath);
      -    loadPlugins(config.plugins);
      +
      +    if (config.plugins) {
      +        Plugins.loadAll(config.plugins);
      +    }
      +
      +    loadedPlugins = Plugins.getAll();
       
           for (var plugin in loadedPlugins) {
               if (loadedPlugins[plugin].processors && Object.keys(loadedPlugins[plugin].processors).indexOf(fileExtension) >= 0) {
      @@ -191,24 +162,49 @@ function processText(text, configHelper, filename) {
           }
       
           if (processor) {
      +        debug("Using processor");
               var parsedBlocks = processor.preprocess(text, filename);
               var unprocessedMessages = [];
      +
               parsedBlocks.forEach(function(block) {
      -            unprocessedMessages.push(eslint.verify(block, config, filename));
      +            unprocessedMessages.push(eslint.verify(block, config, {
      +                filename: filename,
      +                allowInlineConfig: allowInlineConfig
      +            }));
               });
      +
      +        // TODO(nzakas): Figure out how fixes might work for processors
      +
               messages = processor.postprocess(unprocessedMessages, filename);
      +
           } else {
      -        messages = eslint.verify(text, config, filename);
      +
      +        messages = eslint.verify(text, config, {
      +            filename: filename,
      +            allowInlineConfig: allowInlineConfig
      +        });
      +
      +        if (fix) {
      +            debug("Generating fixed text for " + filename);
      +            fixedResult = SourceCodeFixer.applyFixes(eslint.getSourceCode(), messages);
      +            messages = fixedResult.messages;
      +        }
           }
       
           stats = calculateStatsPerFile(messages);
       
      -    return {
      +    var result = {
               filePath: filename,
               messages: messages,
               errorCount: stats.errorCount,
               warningCount: stats.warningCount
           };
      +
      +    if (fixedResult && fixedResult.fixed) {
      +        result.output = fixedResult.output;
      +    }
      +
      +    return result;
       }
       
       /**
      @@ -216,14 +212,17 @@ function processText(text, configHelper, filename) {
        * exist, so no need to check that here.
        * @param {string} filename The filename of the file being checked.
        * @param {Object} configHelper The configuration options for ESLint.
      + * @param {Object} options The CLIEngine options object.
        * @returns {Result} The results for linting on this file.
        * @private
        */
      -function processFile(filename, configHelper) {
      +function processFile(filename, configHelper, options) {
       
      -    var text = fs.readFileSync(path.resolve(filename), "utf8");
      +    var text = fs.readFileSync(path.resolve(filename), "utf8"),
      +        result = processText(text, configHelper, filename, options.fix, options.allowInlineConfig);
      +
      +    return result;
       
      -    return processText(text, configHelper, filename);
       }
       
       /**
      @@ -234,12 +233,12 @@ function processFile(filename, configHelper) {
        */
       function createIgnoreResult(filePath) {
           return {
      -        filePath: filePath,
      +        filePath: path.resolve(filePath),
               messages: [
                   {
                       fatal: false,
                       severity: 1,
      -                message: "File ignored because of your .eslintignore file. Use --no-ignore to override."
      +                message: "File ignored because of a matching ignore pattern. Use --no-ignore to override."
                   }
               ],
               errorCount: 0,
      @@ -247,6 +246,91 @@ function createIgnoreResult(filePath) {
           };
       }
       
      +
      +/**
      + * Checks if the given message is an error message.
      + * @param {object} message The message to check.
      + * @returns {boolean} Whether or not the message is an error message.
      + * @private
      + */
      +function isErrorMessage(message) {
      +    return message.severity === 2;
      +}
      +
      +
      +/**
      + * return the cacheFile to be used by eslint, based on whether the provided parameter is
      + * a directory or looks like a directory (ends in `path.sep`), in which case the file
      + * name will be the `cacheFile/.cache_hashOfCWD`
      + *
      + * if cacheFile points to a file or looks like a file then in will just use that file
      + *
      + * @param {string} cacheFile The name of file to be used to store the cache
      + * @param {string} cwd Current working directory
      + * @returns {string} the resolved path to the cache file
      + */
      +function getCacheFile(cacheFile, cwd) {
      +
      +    /*
      +     * make sure the path separators are normalized for the environment/os
      +     * keeping the trailing path separator if present
      +     */
      +    cacheFile = path.normalize(cacheFile);
      +
      +    var resolvedCacheFile = path.resolve(cwd, cacheFile);
      +    var looksLikeADirectory = cacheFile[cacheFile.length - 1 ] === path.sep;
      +
      +    /**
      +     * return the name for the cache file in case the provided parameter is a directory
      +     * @returns {string} the resolved path to the cacheFile
      +     */
      +    function getCacheFileForDirectory() {
      +        return path.join(resolvedCacheFile, ".cache_" + hash(cwd));
      +    }
      +
      +    var fileStats;
      +
      +    try {
      +        fileStats = fs.lstatSync(resolvedCacheFile);
      +    } catch (ex) {
      +        fileStats = null;
      +    }
      +
      +
      +    /*
      +     * in case the file exists we need to verify if the provided path
      +     * is a directory or a file. If it is a directory we want to create a file
      +     * inside that directory
      +     */
      +    if (fileStats) {
      +
      +        /*
      +         * is a directory or is a file, but the original file the user provided
      +         * looks like a directory but `path.resolve` removed the `last path.sep`
      +         * so we need to still treat this like a directory
      +         */
      +        if (fileStats.isDirectory() || looksLikeADirectory) {
      +            return getCacheFileForDirectory();
      +        }
      +
      +        // is file so just use that file
      +        return resolvedCacheFile;
      +    }
      +
      +    /*
      +     * here we known the file or directory doesn't exist,
      +     * so we will try to infer if its a directory if it looks like a directory
      +     * for the current operating system.
      +     */
      +
      +    // if the last character passed is a path separator we assume is a directory
      +    if (looksLikeADirectory) {
      +        return getCacheFileForDirectory();
      +    }
      +
      +    return resolvedCacheFile;
      +}
      +
       //------------------------------------------------------------------------------
       // Public Interface
       //------------------------------------------------------------------------------
      @@ -258,17 +342,40 @@ function createIgnoreResult(filePath) {
        */
       function CLIEngine(options) {
       
      +    options = lodash.assign(
      +        Object.create(null),
      +        defaultOptions,
      +        {cwd: process.cwd()},
      +        options
      +    );
      +
           /**
            * Stored options for this instance
            * @type {Object}
            */
      -    this.options = assign(Object.create(defaultOptions), options || {});
      +    this.options = options;
      +
      +    var cacheFile = getCacheFile(this.options.cacheLocation || this.options.cacheFile, this.options.cwd);
      +
      +    /**
      +     * Cache used to avoid operating on files that haven't changed since the
      +     * last successful execution (e.g., file passed linting with no errors and
      +     * no warnings).
      +     * @type {Object}
      +     */
      +    this._fileCache = fileEntryCache.create(cacheFile);
      +
      +    if (!this.options.cache) {
      +        this._fileCache.destroy();
      +    }
       
           // load in additional rules
           if (this.options.rulePaths) {
      +        var cwd = this.options.cwd;
      +
               this.options.rulePaths.forEach(function(rulesdir) {
                   debug("Loading rules from " + rulesdir);
      -            rules.load(rulesdir);
      +            rules.load(rulesdir, cwd);
               });
           }
       
      @@ -277,6 +384,81 @@ function CLIEngine(options) {
           }.bind(this));
       }
       
      +/**
      + * Returns the formatter representing the given format or null if no formatter
      + * with the given name can be found.
      + * @param {string} [format] The name of the format to load or the path to a
      + *      custom formatter.
      + * @returns {Function} The formatter function or null if not found.
      + */
      +CLIEngine.getFormatter = function(format) {
      +
      +    var formatterPath;
      +
      +    // default is stylish
      +    format = format || "stylish";
      +
      +    // only strings are valid formatters
      +    if (typeof format === "string") {
      +
      +        // replace \ with / for Windows compatibility
      +        format = format.replace(/\\/g, "/");
      +
      +        // if there's a slash, then it's a file
      +        if (format.indexOf("/") > -1) {
      +            var cwd = this.options ? this.options.cwd : process.cwd();
      +
      +            formatterPath = path.resolve(cwd, format);
      +        } else {
      +            formatterPath = "./formatters/" + format;
      +        }
      +
      +        try {
      +            return require(formatterPath);
      +        } catch (ex) {
      +            return null;
      +        }
      +
      +    } else {
      +        return null;
      +    }
      +};
      +
      +/**
      + * Returns results that only contains errors.
      + * @param {LintResult[]} results The results to filter.
      + * @returns {LintResult[]} The filtered results.
      + */
      +CLIEngine.getErrorResults = function(results) {
      +    var filtered = [];
      +
      +    results.forEach(function(result) {
      +        var filteredMessages = result.messages.filter(isErrorMessage);
      +
      +        if (filteredMessages.length > 0) {
      +            filtered.push({
      +                filePath: result.filePath,
      +                messages: filteredMessages
      +            });
      +        }
      +    });
      +
      +    return filtered;
      +};
      +
      +/**
      + * Outputs fixes from the given results to files.
      + * @param {Object} report The report object created by CLIEngine.
      + * @returns {void}
      + */
      +CLIEngine.outputFixes = function(report) {
      +    report.results.filter(function(result) {
      +        return result.hasOwnProperty("output");
      +    }).forEach(function(result) {
      +        fs.writeFileSync(result.filePath, result.output);
      +    });
      +};
      +
       CLIEngine.prototype = {
       
           constructor: CLIEngine,
      @@ -288,51 +470,170 @@ CLIEngine.prototype = {
            * @returns {void}
            */
           addPlugin: function(name, pluginobject) {
      -        var pluginNameWithoutPrefix = util.removePluginPrefix(util.removeNameSpace(name));
      -        if (pluginobject.rules) {
      -            rules.import(pluginobject.rules, pluginNameWithoutPrefix);
      -        }
      -        loadedPlugins[pluginNameWithoutPrefix] = pluginobject;
      +        Plugins.define(name, pluginobject);
      +    },
      +
      +    /**
      +     * Resolves the patterns passed into executeOnFiles() into glob-based patterns
      +     * for easier handling.
      +     * @param {string[]} patterns The file patterns passed on the command line.
      +     * @returns {string[]} The equivalent glob patterns.
      +     */
      +    resolveFileGlobPatterns: function(patterns) {
      +        return globUtil.resolveFileGlobPatterns(patterns, this.options);
           },
       
           /**
            * Executes the current configuration on an array of file and directory names.
      -     * @param {string[]} files An array of file and directory names.
      +     * @param {string[]} patterns An array of file and directory names.
            * @returns {Object} The results for all files that were linted.
            */
      -    executeOnFiles: function(files) {
      -
      +    executeOnFiles: function(patterns) {
               var results = [],
      -            processed = [],
      +            processed = {},
                   options = this.options,
      +            fileCache = this._fileCache,
                   configHelper = new Config(options),
      -            ignoredPaths = IgnoredPaths.load(options),
      -            exclude = ignoredPaths.contains.bind(ignoredPaths),
      -            stats;
      +            fileList,
      +            stats,
      +            startTime,
      +            prevConfig; // the previous configuration used
      +
      +        /**
      +         * Calculates the hash of the config file used to validate a given file
      +         * @param  {string} filename The path of the file to retrieve a config object for to calculate the hash
      +         * @returns {string}         the hash of the config
      +         */
      +        function hashOfConfigFor(filename) {
      +            var config = configHelper.getConfig(filename);
      +
      +            if (!prevConfig) {
      +                prevConfig = {};
      +            }
      +
      +            // reuse the previously hashed config if the config hasn't changed
      +            if (prevConfig.config !== config) {
      +
      +                /*
      +                 * config changed so we need to calculate the hash of the config
      +                 * and the hash of the plugins being used
      +                 */
      +                prevConfig.config = config;
      +
      +                var eslintVersion = pkg.version;
      +
      +                prevConfig.hash = hash(eslintVersion + "_" + stringify(config));
      +            }
      +
      +            return prevConfig.hash;
      +        }
      +
      +        /**
      +         * Executes the linter on a file defined by the `filename`. Skips
      +         * unsupported file extensions and any files that are already linted.
      +         * @param {string} filename The resolved filename of the file to be linted
      +         * @param {boolean} warnIgnored always warn when a file is ignored
      +         * @returns {void}
      +         */
      +        function executeOnFile(filename, warnIgnored) {
      +            var hashOfConfig;
      +
      +            if (warnIgnored) {
      +                results.push(createIgnoreResult(filename));
      +                return;
      +            }
      +
      +            if (options.cache) {
      +
      +                /*
      +                 * get the descriptor for this file
      +                 * with the metadata and the flag that determines if
      +                 * the file has changed
      +                 */
      +                var descriptor = fileCache.getFileDescriptor(filename);
      +                var meta = descriptor.meta || {};
       
      -        traverse({
      -            files: files,
      -            extensions: options.extensions,
      -            exclude: options.ignore ? exclude : false
      -        }, function(filename) {
      +                hashOfConfig = hashOfConfigFor(filename);
      +
      +                var changed = descriptor.changed || meta.hashOfConfig !== hashOfConfig;
      +
      +                if (!changed) {
      +                    debug("Skipping file since hasn't changed: " + filename);
      +
      +                    /*
      +                     * Adding the filename to the processed hashmap
      +                     * so the reporting is not affected (showing a warning about .eslintignore being used
      +                     * when it is not really used)
      +                     */
      +                    processed[filename] = true;
      +
      +                    /*
      +                     * Add the the cached results (always will be 0 error and
      +                     * 0 warnings). We should not cache results for files that
      +                     * failed, in order to guarantee that next execution will
      +                     * process those files as well.
      +                     */
      +                    results.push(descriptor.meta.results);
      +
      +                    // move to the next file
      +                    return;
      +                }
      +            }
       
                   debug("Processing " + filename);
       
      -            processed.push(filename);
      -            results.push(processFile(filename, configHelper));
      -        });
      +            processed[filename] = true;
      +
      +            var res = processFile(filename, configHelper, options);
      +
      +            if (options.cache) {
      +
      +                /*
      +                 * if a file contains errors or warnings we don't want to
      +                 * store the file in the cache so we can guarantee that
      +                 * next execution will also operate on this file
      +                 */
      +                if (res.errorCount > 0 || res.warningCount > 0) {
      +                    debug("File has problems, skipping it: " + filename);
       
      -        // only warn for files explicitly passed on the command line
      -        if (options.ignore) {
      -            files.forEach(function(file) {
      -                if (fs.statSync(path.resolve(file)).isFile() && processed.indexOf(file) === -1) {
      -                    results.push(createIgnoreResult(file));
      +                    // remove the entry from the cache
      +                    fileCache.removeEntry(filename);
      +                } else {
      +
      +                    /*
      +                     * since the file passed we store the result here
      +                     * TODO: check this as we might not need to store the
      +                     * successful runs as it will always should be 0 errors and
      +                     * 0 warnings.
      +                     */
      +                    descriptor.meta.hashOfConfig = hashOfConfig;
      +                    descriptor.meta.results = res;
                       }
      -            });
      +            }
      +
      +            results.push(res);
               }
       
      +        startTime = Date.now();
      +
      +
      +
      +        patterns = this.resolveFileGlobPatterns(patterns);
      +        fileList = globUtil.listFilesToProcess(patterns, options);
      +        fileList.forEach(function(fileInfo) {
      +            executeOnFile(fileInfo.filename, fileInfo.ignored);
      +        });
      +
               stats = calculateStatsPerRun(results);
       
      +        if (options.cache) {
      +
      +            // persist the cache to disk
      +            fileCache.reconcile();
      +        }
      +
      +        debug("Linting complete in: " + (Date.now() - startTime) + "ms");
      +
               return {
                   results: results,
                   errorCount: stats.errorCount,
      @@ -352,13 +653,17 @@ CLIEngine.prototype = {
                   stats,
                   options = this.options,
                   configHelper = new Config(options),
      -            ignoredPaths = IgnoredPaths.load(options),
      -            exclude = ignoredPaths.contains.bind(ignoredPaths);
      +            ignoredPaths = new IgnoredPaths(options);
      +
      +        // resolve filename based on options.cwd (for reporting, ignoredPaths also resolves)
      +        if (filename && !isAbsolute(filename)) {
      +            filename = path.resolve(options.cwd, filename);
      +        }
      +        if (filename && (options.ignore !== false) && ignoredPaths.contains(filename)) {
       
      -        if (filename && options.ignore && exclude(filename)) {
                   results.push(createIgnoreResult(filename));
               } else {
      -            results.push(processText(text, configHelper, filename));
      +            results.push(processText(text, configHelper, filename, options.fix, options.allowInlineConfig));
               }
       
               stats = calculateStatsPerRun(results);
      @@ -379,6 +684,7 @@ CLIEngine.prototype = {
            */
           getConfigForFile: function(filePath) {
               var configHelper = new Config(this.options);
      +
               return configHelper.getConfig(filePath);
           },
       
      @@ -387,54 +693,19 @@ CLIEngine.prototype = {
            * @param {string} filePath The path of the file to check.
            * @returns {boolean} Whether or not the given path is ignored.
            */
      -    isPathIgnored: function (filePath) {
      +    isPathIgnored: function(filePath) {
               var ignoredPaths;
      +        var resolvedPath = path.resolve(this.options.cwd, filePath);
       
               if (this.options.ignore) {
      -            ignoredPaths = IgnoredPaths.load(this.options);
      -            return ignoredPaths.contains(filePath);
      +            ignoredPaths = new IgnoredPaths(this.options);
      +            return ignoredPaths.contains(resolvedPath);
               }
       
               return false;
           },
       
      -    /**
      -     * Returns the formatter representing the given format or null if no formatter
      -     * with the given name can be found.
      -     * @param {string} [format] The name of the format to load or the path to a
      -     *      custom formatter.
      -     * @returns {Function} The formatter function or null if not found.
      -     */
      -    getFormatter: function(format) {
      -
      -        var formatterPath;
      -
      -        // default is stylish
      -        format = format || "stylish";
      -
      -        // only strings are valid formatters
      -        if (typeof format === "string") {
      -
      -            // replace \ with / for Windows compatibility
      -            format = format.replace(/\\/g, "/");
      -
      -            // if there's a slash, then it's a file
      -            if (format.indexOf("/") > -1) {
      -                formatterPath = path.resolve(process.cwd(), format);
      -            } else {
      -                formatterPath = "./formatters/" + format;
      -            }
      -
      -            try {
      -                return require(formatterPath);
      -            } catch (ex) {
      -                return null;
      -            }
      -
      -        } else {
      -            return null;
      -        }
      -    }
      +    getFormatter: CLIEngine.getFormatter
       
       };
       
      diff --git a/tools/eslint/lib/cli.js b/tools/eslint/lib/cli.js
      index a6d08caf956da1..adb70d8ce18390 100644
      --- a/tools/eslint/lib/cli.js
      +++ b/tools/eslint/lib/cli.js
      @@ -22,7 +22,8 @@ var fs = require("fs"),
       
           options = require("./options"),
           CLIEngine = require("./cli-engine"),
      -    mkdirp = require("mkdirp");
      +    mkdirp = require("mkdirp"),
      +    log = require("./logging");
       
       //------------------------------------------------------------------------------
       // Helpers
      @@ -48,8 +49,14 @@ function translateOptions(cliOptions) {
               ignorePattern: cliOptions.ignorePattern,
               configFile: cliOptions.config,
               rulePaths: cliOptions.rulesdir,
      -        reset: cliOptions.reset,
      -        useEslintrc: cliOptions.eslintrc
      +        useEslintrc: cliOptions.eslintrc,
      +        parser: cliOptions.parser,
      +        parserOptions: cliOptions.parserOptions,
      +        cache: cliOptions.cache,
      +        cacheFile: cliOptions.cacheFile,
      +        cacheLocation: cliOptions.cacheLocation,
      +        fix: cliOptions.fix,
      +        allowInlineConfig: cliOptions.inlineConfig
           };
       }
       
      @@ -69,7 +76,7 @@ function printResults(engine, results, format, outputFile) {
       
           formatter = engine.getFormatter(format);
           if (!formatter) {
      -        console.error("Could not find formatter '%s'.", format);
      +        log.error("Could not find formatter '%s'.", format);
               return false;
           }
       
      @@ -80,7 +87,7 @@ function printResults(engine, results, format, outputFile) {
                   filePath = path.resolve(process.cwd(), outputFile);
       
                   if (fs.existsSync(filePath) && fs.statSync(filePath).isDirectory()) {
      -                console.error("Cannot write to output file path, it is a directory: %s", outputFile);
      +                log.error("Cannot write to output file path, it is a directory: %s", outputFile);
                       return false;
                   }
       
      @@ -88,11 +95,11 @@ function printResults(engine, results, format, outputFile) {
                       mkdirp.sync(path.dirname(filePath));
                       fs.writeFileSync(filePath, output);
                   } catch (ex) {
      -                console.error("There was a problem writing the output file:\n%s", ex);
      +                log.error("There was a problem writing the output file:\n%s", ex);
                       return false;
                   }
               } else {
      -            console.log(output);
      +            log.info(output);
               }
           }
       
      @@ -100,37 +107,6 @@ function printResults(engine, results, format, outputFile) {
       
       }
       
      -/**
      - * Checks if the given message is an error message.
      - * @param {object} message The message to check.
      - * @returns {boolean} Whether or not the message is an error message.
      - */
      -function isErrorMessage(message) {
      -    return message.severity === 2;
      -}
      -
      -/**
      - * Returns results that only contains errors.
      - * @param {LintResult[]} results The results to filter.
      - * @returns {LintResult[]} The filtered results.
      - */
      -function getErrorResults(results) {
      -    var filtered = [];
      -
      -    results.forEach(function (result) {
      -        var filteredMessages = result.messages.filter(isErrorMessage);
      -
      -        if (filteredMessages.length > 0) {
      -            filtered.push({
      -                filePath: result.filePath,
      -                messages: filteredMessages
      -            });
      -        }
      -    });
      -
      -    return filtered;
      -}
      -
       //------------------------------------------------------------------------------
       // Public Interface
       //------------------------------------------------------------------------------
      @@ -151,13 +127,14 @@ var cli = {
       
               var currentOptions,
                   files,
      -            result,
      -            engine;
      +            report,
      +            engine,
      +            tooManyWarnings;
       
               try {
                   currentOptions = options.parse(args);
               } catch (error) {
      -            console.error(error.message);
      +            log.error(error.message);
                   return 1;
               }
       
      @@ -165,24 +142,60 @@ var cli = {
       
               if (currentOptions.version) { // version from package.json
       
      -            console.log("v" + require("../package.json").version);
      +            log.info("v" + require("../package.json").version);
       
               } else if (currentOptions.help || (!files.length && !text)) {
       
      -            console.log(options.generateHelp());
      +            log.info(options.generateHelp());
       
               } else {
       
      -            engine = new CLIEngine(translateOptions(currentOptions));
                   debug("Running on " + (text ? "text" : "files"));
       
      -            result = text ? engine.executeOnText(text, currentOptions.stdinFilename) : engine.executeOnFiles(files);
      +            // disable --fix for piped-in code until we know how to do it correctly
      +            if (text && currentOptions.fix) {
      +                log.error("The --fix option is not available for piped-in code.");
      +                return 1;
      +            }
      +
      +            engine = new CLIEngine(translateOptions(currentOptions));
      +            if (currentOptions.printConfig) {
      +                if (files.length !== 1) {
      +                    log.error("The --print-config option requires a " +
      +                        "single file as positional argument.");
      +                    return 1;
      +                }
      +
      +                if (text) {
      +                    log.error("The --print-config option is not available for piped-in code.");
      +                    return 1;
      +                }
      +
      +                var fileConfig = engine.getConfigForFile(files[0]);
      +
      +                log.info(JSON.stringify(fileConfig, null, "  "));
      +                return 0;
      +            }
      +
      +            report = text ? engine.executeOnText(text, currentOptions.stdinFilename) : engine.executeOnFiles(files);
      +            if (currentOptions.fix) {
      +                debug("Fix mode enabled - applying fixes");
      +                CLIEngine.outputFixes(report);
      +            }
      +
                   if (currentOptions.quiet) {
      -                result.results = getErrorResults(result.results);
      +                debug("Quiet mode enabled - filtering out warnings");
      +                report.results = CLIEngine.getErrorResults(report.results);
                   }
       
      -            if (printResults(engine, result.results, currentOptions.format, currentOptions.outputFile)) {
      -                return result.errorCount ? 1 : 0;
      +            if (printResults(engine, report.results, currentOptions.format, currentOptions.outputFile)) {
      +                tooManyWarnings = currentOptions.maxWarnings >= 0 && report.warningCount > currentOptions.maxWarnings;
      +
      +                if (!report.errorCount && tooManyWarnings) {
      +                    log.error("ESLint found too many warnings (maximum: %s).", currentOptions.maxWarnings);
      +                }
      +
      +                return (report.errorCount || tooManyWarnings) ? 1 : 0;
                   } else {
                       return 1;
                   }
      diff --git a/tools/eslint/lib/code-path-analysis/code-path-analyzer.js b/tools/eslint/lib/code-path-analysis/code-path-analyzer.js
      new file mode 100644
      index 00000000000000..afb9980430a6b0
      --- /dev/null
      +++ b/tools/eslint/lib/code-path-analysis/code-path-analyzer.js
      @@ -0,0 +1,658 @@
      +/**
      + * @fileoverview A class of the code path analyzer.
      + * @author Toru Nagashima
      + * @copyright 2015 Toru Nagashima. All rights reserved.
      + * See LICENSE file in root directory for full license.
      + */
      +
      +"use strict";
      +
      +//------------------------------------------------------------------------------
      +// Requirements
      +//------------------------------------------------------------------------------
      +
      +var assert = require("assert"),
      +    CodePath = require("./code-path"),
      +    CodePathSegment = require("./code-path-segment"),
      +    IdGenerator = require("./id-generator"),
      +    debug = require("./debug-helpers"),
      +    astUtils = require("../ast-utils");
      +
      +//------------------------------------------------------------------------------
      +// Helpers
      +//------------------------------------------------------------------------------
      +
      +/**
      + * Checks whether or not a given node is a `case` node (not `default` node).
      + *
      + * @param {ASTNode} node - A `SwitchCase` node to check.
      + * @returns {boolean} `true` if the node is a `case` node (not `default` node).
      + */
      +function isCaseNode(node) {
      +    return Boolean(node.test);
      +}
      +
      +/**
      + * Checks whether or not a given logical expression node goes different path
      + * between the `true` case and the `false` case.
      + *
      + * @param {ASTNode} node - A node to check.
      + * @returns {boolean} `true` if the node is a test of a choice statement.
      + */
      +function isForkingByTrueOrFalse(node) {
      +    var parent = node.parent;
      +
      +    switch (parent.type) {
      +        case "ConditionalExpression":
      +        case "IfStatement":
      +        case "WhileStatement":
      +        case "DoWhileStatement":
      +        case "ForStatement":
      +            return parent.test === node;
      +
      +        case "LogicalExpression":
      +            return true;
      +
      +        default:
      +            return false;
      +    }
      +}
      +
      +/**
      + * Gets the boolean value of a given literal node.
      + *
      + * This is used to detect infinity loops (e.g. `while (true) {}`).
      + * Statements preceded by an infinity loop are unreachable if the loop didn't
      + * have any `break` statement.
      + *
      + * @param {ASTNode} node - A node to get.
      + * @returns {boolean|undefined} a boolean value if the node is a Literal node,
      + *   otherwise `undefined`.
      + */
      +function getBooleanValueIfSimpleConstant(node) {
      +    if (node.type === "Literal") {
      +        return Boolean(node.value);
      +    }
      +    return void 0;
      +}
      +
      +/**
      + * Checks that a given identifier node is a reference or not.
      + *
      + * This is used to detect the first throwable node in a `try` block.
      + *
      + * @param {ASTNode} node - An Identifier node to check.
      + * @returns {boolean} `true` if the node is a reference.
      + */
      +function isIdentifierReference(node) {
      +    var parent = node.parent;
      +
      +    switch (parent.type) {
      +        case "LabeledStatement":
      +        case "BreakStatement":
      +        case "ContinueStatement":
      +        case "ArrayPattern":
      +        case "RestElement":
      +        case "ImportSpecifier":
      +        case "ImportDefaultSpecifier":
      +        case "ImportNamespaceSpecifier":
      +        case "CatchClause":
      +            return false;
      +
      +        case "FunctionDeclaration":
      +        case "FunctionExpression":
      +        case "ArrowFunctionExpression":
      +        case "ClassDeclaration":
      +        case "ClassExpression":
      +        case "VariableDeclarator":
      +            return parent.id !== node;
      +
      +        case "Property":
      +        case "MethodDefinition":
      +            return (
      +                parent.key !== node ||
      +                parent.computed ||
      +                parent.shorthand
      +            );
      +
      +        case "AssignmentPattern":
      +            return parent.key !== node;
      +
      +        default:
      +            return true;
      +    }
      +}
      +
      +/**
      + * Updates the current segment with the head segment.
      + * This is similar to local branches and tracking branches of git.
      + *
      + * To separate the current and the head is in order to not make useless segments.
      + *
      + * In this process, both "onCodePathSegmentStart" and "onCodePathSegmentEnd"
      + * events are fired.
      + *
      + * @param {CodePathAnalyzer} analyzer - The instance.
      + * @param {ASTNode} node - The current AST node.
      + * @returns {void}
      + */
      +function forwardCurrentToHead(analyzer, node) {
      +    var codePath = analyzer.codePath;
      +    var state = CodePath.getState(codePath);
      +    var currentSegments = state.currentSegments;
      +    var headSegments = state.headSegments;
      +    var end = Math.max(currentSegments.length, headSegments.length);
      +    var i, currentSegment, headSegment;
      +
      +    // Fires leaving events.
      +    for (i = 0; i < end; ++i) {
      +        currentSegment = currentSegments[i];
      +        headSegment = headSegments[i];
      +
      +        if (currentSegment !== headSegment && currentSegment) {
      +            debug.dump("onCodePathSegmentEnd " + currentSegment.id);
      +
      +            if (currentSegment.reachable) {
      +                analyzer.emitter.emit(
      +                    "onCodePathSegmentEnd",
      +                    currentSegment,
      +                    node);
      +            }
      +        }
      +    }
      +
      +    // Update state.
      +    state.currentSegments = headSegments;
      +
      +    // Fires entering events.
      +    for (i = 0; i < end; ++i) {
      +        currentSegment = currentSegments[i];
      +        headSegment = headSegments[i];
      +
      +        if (currentSegment !== headSegment && headSegment) {
      +            debug.dump("onCodePathSegmentStart " + headSegment.id);
      +
      +            CodePathSegment.markUsed(headSegment);
      +            if (headSegment.reachable) {
      +                analyzer.emitter.emit(
      +                    "onCodePathSegmentStart",
      +                    headSegment,
      +                    node);
      +            }
      +        }
      +    }
      +
      +}
      +
      +/**
      + * Updates the current segment with empty.
      + * This is called at the last of functions or the program.
      + *
      + * @param {CodePathAnalyzer} analyzer - The instance.
      + * @param {ASTNode} node - The current AST node.
      + * @returns {void}
      + */
      +function leaveFromCurrentSegment(analyzer, node) {
      +    var state = CodePath.getState(analyzer.codePath);
      +    var currentSegments = state.currentSegments;
      +
      +    for (var i = 0; i < currentSegments.length; ++i) {
      +        var currentSegment = currentSegments[i];
      +
      +        debug.dump("onCodePathSegmentEnd " + currentSegment.id);
      +        if (currentSegment.reachable) {
      +            analyzer.emitter.emit(
      +                "onCodePathSegmentEnd",
      +                currentSegment,
      +                node);
      +        }
      +    }
      +
      +    state.currentSegments = [];
      +}
      +
      +/**
      + * Updates the code path due to the position of a given node in the parent node
      + * thereof.
      + *
      + * For example, if the node is `parent.consequent`, this creates a fork from the
      + * current path.
      + *
      + * @param {CodePathAnalyzer} analyzer - The instance.
      + * @param {ASTNode} node - The current AST node.
      + * @returns {void}
      + */
      +function preprocess(analyzer, node) {
      +    var codePath = analyzer.codePath;
      +    var state = CodePath.getState(codePath);
      +    var parent = node.parent;
      +
      +    switch (parent.type) {
      +        case "LogicalExpression":
      +            if (parent.right === node) {
      +                state.makeLogicalRight();
      +            }
      +            break;
      +
      +        case "ConditionalExpression":
      +        case "IfStatement":
      +
      +            /*
      +             * Fork if this node is at `consequent`/`alternate`.
      +             * `popForkContext()` exists at `IfStatement:exit` and
      +             * `ConditionalExpression:exit`.
      +             */
      +            if (parent.consequent === node) {
      +                state.makeIfConsequent();
      +            } else if (parent.alternate === node) {
      +                state.makeIfAlternate();
      +            }
      +            break;
      +
      +        case "SwitchCase":
      +            if (parent.consequent[0] === node) {
      +                state.makeSwitchCaseBody(false, !parent.test);
      +            }
      +            break;
      +
      +        case "TryStatement":
      +            if (parent.handler === node) {
      +                state.makeCatchBlock();
      +            } else if (parent.finalizer === node) {
      +                state.makeFinallyBlock();
      +            }
      +            break;
      +
      +        case "WhileStatement":
      +            if (parent.test === node) {
      +                state.makeWhileTest(getBooleanValueIfSimpleConstant(node));
      +            } else {
      +                assert(parent.body === node);
      +                state.makeWhileBody();
      +            }
      +            break;
      +
      +        case "DoWhileStatement":
      +            if (parent.body === node) {
      +                state.makeDoWhileBody();
      +            } else {
      +                assert(parent.test === node);
      +                state.makeDoWhileTest(getBooleanValueIfSimpleConstant(node));
      +            }
      +            break;
      +
      +        case "ForStatement":
      +            if (parent.test === node) {
      +                state.makeForTest(getBooleanValueIfSimpleConstant(node));
      +            } else if (parent.update === node) {
      +                state.makeForUpdate();
      +            } else if (parent.body === node) {
      +                state.makeForBody();
      +            }
      +            break;
      +
      +        case "ForInStatement":
      +        case "ForOfStatement":
      +            if (parent.left === node) {
      +                state.makeForInOfLeft();
      +            } else if (parent.right === node) {
      +                state.makeForInOfRight();
      +            } else {
      +                assert(parent.body === node);
      +                state.makeForInOfBody();
      +            }
      +            break;
      +
      +        case "AssignmentPattern":
      +
      +            /*
      +             * Fork if this node is at `right`.
      +             * `left` is executed always, so it uses the current path.
      +             * `popForkContext()` exists at `AssignmentPattern:exit`.
      +             */
      +            if (parent.right === node) {
      +                state.pushForkContext();
      +                state.forkBypassPath();
      +                state.forkPath();
      +            }
      +            break;
      +
      +        default:
      +            break;
      +    }
      +}
      +
      +/**
      + * Updates the code path due to the type of a given node in entering.
      + *
      + * @param {CodePathAnalyzer} analyzer - The instance.
      + * @param {ASTNode} node - The current AST node.
      + * @returns {void}
      + */
      +function processCodePathToEnter(analyzer, node) {
      +    var codePath = analyzer.codePath;
      +    var state = codePath && CodePath.getState(codePath);
      +    var parent = node.parent;
      +
      +    switch (node.type) {
      +        case "Program":
      +        case "FunctionDeclaration":
      +        case "FunctionExpression":
      +        case "ArrowFunctionExpression":
      +            if (codePath) {
      +
      +                // Emits onCodePathSegmentStart events if updated.
      +                forwardCurrentToHead(analyzer, node);
      +                debug.dumpState(node, state, false);
      +            }
      +
      +            // Create the code path of this scope.
      +            codePath = analyzer.codePath = new CodePath(
      +                analyzer.idGenerator.next(),
      +                codePath,
      +                analyzer.onLooped
      +            );
      +            state = CodePath.getState(codePath);
      +
      +            // Emits onCodePathStart events.
      +            debug.dump("onCodePathStart " + codePath.id);
      +            analyzer.emitter.emit("onCodePathStart", codePath, node);
      +            break;
      +
      +        case "LogicalExpression":
      +            state.pushChoiceContext(node.operator, isForkingByTrueOrFalse(node));
      +            break;
      +
      +        case "ConditionalExpression":
      +        case "IfStatement":
      +            state.pushChoiceContext("test", false);
      +            break;
      +
      +        case "SwitchStatement":
      +            state.pushSwitchContext(
      +                node.cases.some(isCaseNode),
      +                astUtils.getLabel(node));
      +            break;
      +
      +        case "TryStatement":
      +            state.pushTryContext(Boolean(node.finalizer));
      +            break;
      +
      +        case "SwitchCase":
      +
      +            /*
      +             * Fork if this node is after the 2st node in `cases`.
      +             * It's similar to `else` blocks.
      +             * The next `test` node is processed in this path.
      +             */
      +            if (parent.discriminant !== node && parent.cases[0] !== node) {
      +                state.forkPath();
      +            }
      +            break;
      +
      +        case "WhileStatement":
      +        case "DoWhileStatement":
      +        case "ForStatement":
      +        case "ForInStatement":
      +        case "ForOfStatement":
      +            state.pushLoopContext(node.type, astUtils.getLabel(node));
      +            break;
      +
      +        case "LabeledStatement":
      +            if (!astUtils.isBreakableStatement(node.body)) {
      +                state.pushBreakContext(false, node.label.name);
      +            }
      +            break;
      +
      +        default:
      +            break;
      +    }
      +
      +    // Emits onCodePathSegmentStart events if updated.
      +    forwardCurrentToHead(analyzer, node);
      +    debug.dumpState(node, state, false);
      +}
      +
      +/**
      + * Updates the code path due to the type of a given node in leaving.
      + *
      + * @param {CodePathAnalyzer} analyzer - The instance.
      + * @param {ASTNode} node - The current AST node.
      + * @returns {void}
      + */
      +function processCodePathToExit(analyzer, node) {
      +    var codePath = analyzer.codePath;
      +    var state = CodePath.getState(codePath);
      +    var dontForward = false;
      +
      +    switch (node.type) {
      +        case "IfStatement":
      +        case "ConditionalExpression":
      +        case "LogicalExpression":
      +            state.popChoiceContext();
      +            break;
      +
      +        case "SwitchStatement":
      +            state.popSwitchContext();
      +            break;
      +
      +        case "SwitchCase":
      +
      +            /*
      +             * This is the same as the process at the 1st `consequent` node in
      +             * `preprocess` function.
      +             * Must do if this `consequent` is empty.
      +             */
      +            if (node.consequent.length === 0) {
      +                state.makeSwitchCaseBody(true, !node.test);
      +            }
      +            if (state.forkContext.reachable) {
      +                dontForward = true;
      +            }
      +            break;
      +
      +        case "TryStatement":
      +            state.popTryContext();
      +            break;
      +
      +        case "BreakStatement":
      +            forwardCurrentToHead(analyzer, node);
      +            state.makeBreak(node.label && node.label.name);
      +            dontForward = true;
      +            break;
      +
      +        case "ContinueStatement":
      +            forwardCurrentToHead(analyzer, node);
      +            state.makeContinue(node.label && node.label.name);
      +            dontForward = true;
      +            break;
      +
      +        case "ReturnStatement":
      +            forwardCurrentToHead(analyzer, node);
      +            state.makeReturn();
      +            dontForward = true;
      +            break;
      +
      +        case "ThrowStatement":
      +            forwardCurrentToHead(analyzer, node);
      +            state.makeThrow();
      +            dontForward = true;
      +            break;
      +
      +        case "Identifier":
      +            if (isIdentifierReference(node)) {
      +                state.makeFirstThrowablePathInTryBlock();
      +                dontForward = true;
      +            }
      +            break;
      +
      +        case "CallExpression":
      +        case "MemberExpression":
      +        case "NewExpression":
      +            state.makeFirstThrowablePathInTryBlock();
      +            break;
      +
      +        case "WhileStatement":
      +        case "DoWhileStatement":
      +        case "ForStatement":
      +        case "ForInStatement":
      +        case "ForOfStatement":
      +            state.popLoopContext();
      +            break;
      +
      +        case "AssignmentPattern":
      +            state.popForkContext();
      +            break;
      +
      +        case "LabeledStatement":
      +            if (!astUtils.isBreakableStatement(node.body)) {
      +                state.popBreakContext();
      +            }
      +            break;
      +
      +        default:
      +            break;
      +    }
      +
      +    /*
      +     * Skip updating the current segment to avoid creating useless segments if
      +     * the node type is the same as the parent node type.
      +     */
      +    if (!dontForward && (!node.parent || node.type !== node.parent.type)) {
      +
      +        // Emits onCodePathSegmentStart events if updated.
      +        forwardCurrentToHead(analyzer, node);
      +    }
      +    debug.dumpState(node, state, true);
      +}
      +
      +/**
      + * Updates the code path to finalize the current code path.
      + *
      + * @param {CodePathAnalyzer} analyzer - The instance.
      + * @param {ASTNode} node - The current AST node.
      + * @returns {void}
      + */
      +function postprocess(analyzer, node) {
      +    switch (node.type) {
      +        case "Program":
      +        case "FunctionDeclaration":
      +        case "FunctionExpression":
      +        case "ArrowFunctionExpression":
      +            var codePath = analyzer.codePath;
      +
      +            // Mark the current path as the final node.
      +            CodePath.getState(codePath).makeFinal();
      +
      +            // Emits onCodePathSegmentEnd event of the current segments.
      +            leaveFromCurrentSegment(analyzer, node);
      +
      +            // Emits onCodePathEnd event of this code path.
      +            debug.dump("onCodePathEnd " + codePath.id);
      +            analyzer.emitter.emit("onCodePathEnd", codePath, node);
      +            debug.dumpDot(codePath);
      +
      +            codePath = analyzer.codePath = analyzer.codePath.upper;
      +            if (codePath) {
      +                debug.dumpState(node, CodePath.getState(codePath), true);
      +            }
      +            break;
      +
      +        default:
      +            break;
      +    }
      +}
      +
      +//------------------------------------------------------------------------------
      +// Public Interface
      +//------------------------------------------------------------------------------
      +
      +/**
      + * The class to analyze code paths.
      + * This class implements the EventGenerator interface.
      + *
      + * @constructor
      + * @param {EventGenerator} eventGenerator - An event generator to wrap.
      + */
      +function CodePathAnalyzer(eventGenerator) {
      +    this.original = eventGenerator;
      +    this.emitter = eventGenerator.emitter;
      +    this.codePath = null;
      +    this.idGenerator = new IdGenerator("s");
      +    this.currentNode = null;
      +    this.onLooped = this.onLooped.bind(this);
      +}
      +
      +CodePathAnalyzer.prototype = {
      +    constructor: CodePathAnalyzer,
      +
      +    /**
      +     * Does the process to enter a given AST node.
      +     * This updates state of analysis and calls `enterNode` of the wrapped.
      +     *
      +     * @param {ASTNode} node - A node which is entering.
      +     * @returns {void}
      +     */
      +    enterNode: function(node) {
      +        this.currentNode = node;
      +
      +        // Updates the code path due to node's position in its parent node.
      +        if (node.parent) {
      +            preprocess(this, node);
      +        }
      +
      +        // Updates the code path.
      +        // And emits onCodePathStart/onCodePathSegmentStart events.
      +        processCodePathToEnter(this, node);
      +
      +        // Emits node events.
      +        this.original.enterNode(node);
      +
      +        this.currentNode = null;
      +    },
      +
      +    /**
      +     * Does the process to leave a given AST node.
      +     * This updates state of analysis and calls `leaveNode` of the wrapped.
      +     *
      +     * @param {ASTNode} node - A node which is leaving.
      +     * @returns {void}
      +     */
      +    leaveNode: function(node) {
      +        this.currentNode = node;
      +
      +        // Updates the code path.
      +        // And emits onCodePathStart/onCodePathSegmentStart events.
      +        processCodePathToExit(this, node);
      +
      +        // Emits node events.
      +        this.original.leaveNode(node);
      +
      +        // Emits the last onCodePathStart/onCodePathSegmentStart events.
      +        postprocess(this, node);
      +
      +        this.currentNode = null;
      +    },
      +
      +    /**
      +     * This is called on a code path looped.
      +     * Then this raises a looped event.
      +     *
      +     * @param {CodePathSegment} fromSegment - A segment of prev.
      +     * @param {CodePathSegment} toSegment - A segment of next.
      +     * @returns {void}
      +     */
      +    onLooped: function(fromSegment, toSegment) {
      +        if (fromSegment.reachable && toSegment.reachable) {
      +            debug.dump("onCodePathSegmentLoop " + fromSegment.id + " -> " + toSegment.id);
      +            this.emitter.emit(
      +                "onCodePathSegmentLoop",
      +                fromSegment,
      +                toSegment,
      +                this.currentNode
      +            );
      +        }
      +    }
      +};
      +
      +module.exports = CodePathAnalyzer;
      diff --git a/tools/eslint/lib/code-path-analysis/code-path-segment.js b/tools/eslint/lib/code-path-analysis/code-path-segment.js
      new file mode 100644
      index 00000000000000..ea292efc36cf7f
      --- /dev/null
      +++ b/tools/eslint/lib/code-path-analysis/code-path-segment.js
      @@ -0,0 +1,236 @@
      +/**
      + * @fileoverview A class of the code path segment.
      + * @author Toru Nagashima
      + * @copyright 2015 Toru Nagashima. All rights reserved.
      + * See LICENSE file in root directory for full license.
      + */
      +
      +"use strict";
      +
      +//------------------------------------------------------------------------------
      +// Requirements
      +//------------------------------------------------------------------------------
      +
      +var assert = require("assert"),
      +    debug = require("./debug-helpers");
      +
      +//------------------------------------------------------------------------------
      +// Helpers
      +//------------------------------------------------------------------------------
      +
      +/**
      + * Replaces unused segments with the previous segments of each unused segment.
      + *
      + * @param {CodePathSegment[]} segments - An array of segments to replace.
      + * @returns {CodePathSegment[]} The replaced array.
      + */
      +function flattenUnusedSegments(segments) {
      +    var done = Object.create(null);
      +    var retv = [];
      +
      +    for (var i = 0; i < segments.length; ++i) {
      +        var segment = segments[i];
      +
      +        // Ignores duplicated.
      +        if (done[segment.id]) {
      +            continue;
      +        }
      +
      +        // Use previous segments if unused.
      +        if (!segment.internal.used) {
      +            for (var j = 0; j < segment.allPrevSegments.length; ++j) {
      +                var prevSegment = segment.allPrevSegments[j];
      +
      +                if (!done[prevSegment.id]) {
      +                    done[prevSegment.id] = true;
      +                    retv.push(prevSegment);
      +                }
      +            }
      +        } else {
      +            done[segment.id] = true;
      +            retv.push(segment);
      +        }
      +    }
      +
      +    return retv;
      +}
      +
      +/**
      + * Checks whether or not a given segment is reachable.
      + *
      + * @param {CodePathSegment} segment - A segment to check.
      + * @returns {boolean} `true` if the segment is reachable.
      + */
      +function isReachable(segment) {
      +    return segment.reachable;
      +}
      +
      +//------------------------------------------------------------------------------
      +// Public Interface
      +//------------------------------------------------------------------------------
      +
      +/**
      + * A code path segment.
      + *
      + * @constructor
      + * @param {string} id - An identifier.
      + * @param {CodePathSegment[]} allPrevSegments - An array of the previous segments.
      + *   This array includes unreachable segments.
      + * @param {boolean} reachable - A flag which shows this is reachable.
      + */
      +function CodePathSegment(id, allPrevSegments, reachable) {
      +
      +    /**
      +     * The identifier of this code path.
      +     * Rules use it to store additional information of each rule.
      +     * @type {string}
      +     */
      +    this.id = id;
      +
      +    /**
      +     * An array of the next segments.
      +     * @type {CodePathSegment[]}
      +     */
      +    this.nextSegments = [];
      +
      +    /**
      +     * An array of the previous segments.
      +     * @type {CodePathSegment[]}
      +     */
      +    this.prevSegments = allPrevSegments.filter(isReachable);
      +
      +    /**
      +     * An array of the next segments.
      +     * This array includes unreachable segments.
      +     * @type {CodePathSegment[]}
      +     */
      +    this.allNextSegments = [];
      +
      +    /**
      +     * An array of the previous segments.
      +     * This array includes unreachable segments.
      +     * @type {CodePathSegment[]}
      +     */
      +    this.allPrevSegments = allPrevSegments;
      +
      +    /**
      +     * A flag which shows this is reachable.
      +     * @type {boolean}
      +     */
      +    this.reachable = reachable;
      +
      +    // Internal data.
      +    Object.defineProperty(this, "internal", {value: {
      +        used: false,
      +        loopedPrevSegments: []
      +    }});
      +
      +    /* istanbul ignore if */
      +    if (debug.enabled) {
      +        this.internal.nodes = [];
      +        this.internal.exitNodes = [];
      +    }
      +}
      +
      +CodePathSegment.prototype = {
      +    constructor: CodePathSegment,
      +
      +    /**
      +     * Checks a given previous segment is coming from the end of a loop.
      +     *
      +     * @param {CodePathSegment} segment - A previous segment to check.
      +     * @returns {boolean} `true` if the segment is coming from the end of a loop.
      +     */
      +    isLoopedPrevSegment: function(segment) {
      +        return this.internal.loopedPrevSegments.indexOf(segment) !== -1;
      +    }
      +};
      +
      +/**
      + * Creates the root segment.
      + *
      + * @param {string} id - An identifier.
      + * @returns {CodePathSegment} The created segment.
      + */
      +CodePathSegment.newRoot = function(id) {
      +    return new CodePathSegment(id, [], true);
      +};
      +
      +/**
      + * Creates a segment that follows given segments.
      + *
      + * @param {string} id - An identifier.
      + * @param {CodePathSegment[]} allPrevSegments - An array of the previous segments.
      + * @returns {CodePathSegment} The created segment.
      + */
      +CodePathSegment.newNext = function(id, allPrevSegments) {
      +    return new CodePathSegment(
      +        id,
      +        flattenUnusedSegments(allPrevSegments),
      +        allPrevSegments.some(isReachable));
      +};
      +
      +/**
      + * Creates an unreachable segment that follows given segments.
      + *
      + * @param {string} id - An identifier.
      + * @param {CodePathSegment[]} allPrevSegments - An array of the previous segments.
      + * @returns {CodePathSegment} The created segment.
      + */
      +CodePathSegment.newUnreachable = function(id, allPrevSegments) {
      +    return new CodePathSegment(id, flattenUnusedSegments(allPrevSegments), false);
      +};
      +
      +/**
      + * Creates a segment that follows given segments.
      + * This factory method does not connect with `allPrevSegments`.
      + * But this inherits `reachable` flag.
      + *
      + * @param {string} id - An identifier.
      + * @param {CodePathSegment[]} allPrevSegments - An array of the previous segments.
      + * @returns {CodePathSegment} The created segment.
      + */
      +CodePathSegment.newDisconnected = function(id, allPrevSegments) {
      +    return new CodePathSegment(id, [], allPrevSegments.some(isReachable));
      +};
      +
      +/**
      + * Makes a given segment being used.
      + *
      + * And this function registers the segment into the previous segments as a next.
      + *
      + * @param {CodePathSegment} segment - A segment to mark.
      + * @returns {void}
      + */
      +CodePathSegment.markUsed = function(segment) {
      +    assert(!segment.internal.used, segment.id + " is marked twice.");
      +    segment.internal.used = true;
      +
      +    var i;
      +
      +    if (segment.reachable) {
      +        for (i = 0; i < segment.allPrevSegments.length; ++i) {
      +            var prevSegment = segment.allPrevSegments[i];
      +
      +            prevSegment.allNextSegments.push(segment);
      +            prevSegment.nextSegments.push(segment);
      +        }
      +    } else {
      +        for (i = 0; i < segment.allPrevSegments.length; ++i) {
      +            segment.allPrevSegments[i].allNextSegments.push(segment);
      +        }
      +    }
      +};
      +
      +/**
      + * Marks a previous segment as looped.
      + *
      + * @param {CodePathSegment} segment - A segment.
      + * @param {CodePathSegment} prevSegment - A previous segment to mark.
      + * @returns {void}
      + */
      +CodePathSegment.markPrevSegmentAsLooped = function(segment, prevSegment) {
      +    segment.internal.loopedPrevSegments.push(prevSegment);
      +};
      +
      +module.exports = CodePathSegment;
      diff --git a/tools/eslint/lib/code-path-analysis/code-path-state.js b/tools/eslint/lib/code-path-analysis/code-path-state.js
      new file mode 100644
      index 00000000000000..b620ed718bd542
      --- /dev/null
      +++ b/tools/eslint/lib/code-path-analysis/code-path-state.js
      @@ -0,0 +1,1430 @@
      +/**
      + * @fileoverview A class to manage state of generating a code path.
      + * @author Toru Nagashima
      + * @copyright 2015 Toru Nagashima. All rights reserved.
      + * See LICENSE file in root directory for full license.
      + */
      +
      +"use strict";
      +
      +//------------------------------------------------------------------------------
      +// Requirements
      +//------------------------------------------------------------------------------
      +
      +var CodePathSegment = require("./code-path-segment"),
      +    ForkContext = require("./fork-context");
      +
      +//------------------------------------------------------------------------------
      +// Helpers
      +//------------------------------------------------------------------------------
      +
      +/**
      + * Adds given segments into the `dest` array.
      + * If the `others` array does not includes the given segments, adds to the `all`
      + * array as well.
      + *
      + * This adds only reachable and used segments.
      + *
      + * @param {CodePathSegment[]} dest - A destination array (`returnedSegments` or `thrownSegments`).
      + * @param {CodePathSegment[]} others - Another destination array (`returnedSegments` or `thrownSegments`).
      + * @param {CodePathSegment[]} all - The unified destination array (`finalSegments`).
      + * @param {CodePathSegment[]} segments - Segments to add.
      + * @returns {void}
      + */
      +function addToReturnedOrThrown(dest, others, all, segments) {
      +    for (var i = 0; i < segments.length; ++i) {
      +        var segment = segments[i];
      +
      +        dest.push(segment);
      +        if (others.indexOf(segment) === -1) {
      +            all.push(segment);
      +        }
      +    }
      +}
      +
      +/**
      + * Gets a loop-context for a `continue` statement.
      + *
      + * @param {CodePathState} state - A state to get.
      + * @param {string} label - The label of a `continue` statement.
      + * @returns {LoopContext} A loop-context for a `continue` statement.
      + */
      +function getContinueContext(state, label) {
      +    if (!label) {
      +        return state.loopContext;
      +    }
      +
      +    var context = state.loopContext;
      +
      +    while (context) {
      +        if (context.label === label) {
      +            return context;
      +        }
      +        context = context.upper;
      +    }
      +
      +    /* istanbul ignore next: foolproof (syntax error) */
      +    return null;
      +}
      +
      +/**
      + * Gets a context for a `break` statement.
      + *
      + * @param {CodePathState} state - A state to get.
      + * @param {string} label - The label of a `break` statement.
      + * @returns {LoopContext|SwitchContext} A context for a `break` statement.
      + */
      +function getBreakContext(state, label) {
      +    var context = state.breakContext;
      +
      +    while (context) {
      +        if (label ? context.label === label : context.breakable) {
      +            return context;
      +        }
      +        context = context.upper;
      +    }
      +
      +    /* istanbul ignore next: foolproof (syntax error) */
      +    return null;
      +}
      +
      +/**
      + * Gets a context for a `return` statement.
      + *
      + * @param {CodePathState} state - A state to get.
      + * @returns {TryContext|CodePathState} A context for a `return` statement.
      + */
      +function getReturnContext(state) {
      +    var context = state.tryContext;
      +
      +    while (context) {
      +        if (context.hasFinalizer && context.position !== "finally") {
      +            return context;
      +        }
      +        context = context.upper;
      +    }
      +
      +    return state;
      +}
      +
      +/**
      + * Gets a context for a `throw` statement.
      + *
      + * @param {CodePathState} state - A state to get.
      + * @returns {TryContext|CodePathState} A context for a `throw` statement.
      + */
      +function getThrowContext(state) {
      +    var context = state.tryContext;
      +
      +    while (context) {
      +        if (context.position === "try" ||
      +            (context.hasFinalizer && context.position === "catch")
      +        ) {
      +            return context;
      +        }
      +        context = context.upper;
      +    }
      +
      +    return state;
      +}
      +
      +/**
      + * Removes a given element from a given array.
      + *
      + * @param {any[]} xs - An array to remove the specific element.
      + * @param {any} x - An element to be removed.
      + * @returns {void}
      + */
      +function remove(xs, x) {
      +    xs.splice(xs.indexOf(x), 1);
      +}
      +
      +/**
      + * Disconnect given segments.
      + *
      + * This is used in a process for switch statements.
      + * If there is the "default" chunk before other cases, the order is different
      + * between node's and running's.
      + *
      + * @param {CodePathSegment[]} prevSegments - Forward segments to disconnect.
      + * @param {CodePathSegment[]} nextSegments - Backward segments to disconnect.
      + * @returns {void}
      + */
      +function removeConnection(prevSegments, nextSegments) {
      +    for (var i = 0; i < prevSegments.length; ++i) {
      +        var prevSegment = prevSegments[i];
      +        var nextSegment = nextSegments[i];
      +
      +        remove(prevSegment.nextSegments, nextSegment);
      +        remove(prevSegment.allNextSegments, nextSegment);
      +        remove(nextSegment.prevSegments, prevSegment);
      +        remove(nextSegment.allPrevSegments, prevSegment);
      +    }
      +}
      +
      +/**
      + * Creates looping path.
      + *
      + * @param {CodePathState} state - The instance.
      + * @param {CodePathSegment[]} fromSegments - Segments which are source.
      + * @param {CodePathSegment[]} toSegments - Segments which are destination.
      + * @returns {void}
      + */
      +function makeLooped(state, fromSegments, toSegments) {
      +    var end = Math.min(fromSegments.length, toSegments.length);
      +
      +    for (var i = 0; i < end; ++i) {
      +        var fromSegment = fromSegments[i];
      +        var toSegment = toSegments[i];
      +
      +        if (toSegment.reachable) {
      +            fromSegment.nextSegments.push(toSegment);
      +        }
      +        if (fromSegment.reachable) {
      +            toSegment.prevSegments.push(fromSegment);
      +        }
      +        fromSegment.allNextSegments.push(toSegment);
      +        toSegment.allPrevSegments.push(fromSegment);
      +
      +        if (toSegment.allPrevSegments.length >= 2) {
      +            CodePathSegment.markPrevSegmentAsLooped(toSegment, fromSegment);
      +        }
      +
      +        state.notifyLooped(fromSegment, toSegment);
      +    }
      +}
      +
      +/**
      + * Finalizes segments of `test` chunk of a ForStatement.
      + *
      + * - Adds `false` paths to paths which are leaving from the loop.
      + * - Sets `true` paths to paths which go to the body.
      + *
      + * @param {LoopContext} context - A loop context to modify.
      + * @param {ChoiceContext} choiceContext - A choice context of this loop.
      + * @param {CodePathSegment[]} head - The current head paths.
      + * @returns {void}
      + */
      +function finalizeTestSegmentsOfFor(context, choiceContext, head) {
      +    if (!choiceContext.processed) {
      +        choiceContext.trueForkContext.add(head);
      +        choiceContext.falseForkContext.add(head);
      +    }
      +
      +    if (context.test !== true) {
      +        context.brokenForkContext.addAll(choiceContext.falseForkContext);
      +    }
      +    context.endOfTestSegments = choiceContext.trueForkContext.makeNext(0, -1);
      +}
      +
      +//------------------------------------------------------------------------------
      +// Public Interface
      +//------------------------------------------------------------------------------
      +
      +/**
      + * A class which manages state to analyze code paths.
      + *
      + * @constructor
      + * @param {IdGenerator} idGenerator - An id generator to generate id for code
      + *   path segments.
      + * @param {function} onLooped - A callback function to notify looping.
      + */
      +function CodePathState(idGenerator, onLooped) {
      +    this.idGenerator = idGenerator;
      +    this.notifyLooped = onLooped;
      +    this.forkContext = ForkContext.newRoot(idGenerator);
      +    this.choiceContext = null;
      +    this.switchContext = null;
      +    this.tryContext = null;
      +    this.loopContext = null;
      +    this.breakContext = null;
      +
      +    this.currentSegments = [];
      +    this.initialSegment = this.forkContext.head[0];
      +
      +    // returnedSegments and thrownSegments push elements into finalSegments also.
      +    var final = this.finalSegments = [];
      +    var returned = this.returnedForkContext = [];
      +    var thrown = this.thrownForkContext = [];
      +
      +    returned.add = addToReturnedOrThrown.bind(null, returned, thrown, final);
      +    thrown.add = addToReturnedOrThrown.bind(null, thrown, returned, final);
      +}
      +
      +CodePathState.prototype = {
      +    constructor: CodePathState,
      +
      +    /**
      +     * The head segments.
      +     * @type {CodePathSegment[]}
      +     */
      +    get headSegments() {
      +        return this.forkContext.head;
      +    },
      +
      +    /**
      +     * The parent forking context.
      +     * This is used for the root of new forks.
      +     * @type {ForkContext}
      +     */
      +    get parentForkContext() {
      +        var current = this.forkContext;
      +
      +        return current && current.upper;
      +    },
      +
      +    /**
      +     * Creates and stacks new forking context.
      +     *
      +     * @param {boolean} forkLeavingPath - A flag which shows being in a
      +     *   "finally" block.
      +     * @returns {ForkContext} The created context.
      +     */
      +    pushForkContext: function(forkLeavingPath) {
      +        this.forkContext = ForkContext.newEmpty(
      +            this.forkContext,
      +            forkLeavingPath
      +        );
      +
      +        return this.forkContext;
      +    },
      +
      +    /**
      +     * Pops and merges the last forking context.
      +     * @returns {ForkContext} The last context.
      +     */
      +    popForkContext: function() {
      +        var lastContext = this.forkContext;
      +
      +        this.forkContext = lastContext.upper;
      +        this.forkContext.replaceHead(lastContext.makeNext(0, -1));
      +
      +        return lastContext;
      +    },
      +
      +    /**
      +     * Creates a new path.
      +     * @returns {void}
      +     */
      +    forkPath: function() {
      +        this.forkContext.add(this.parentForkContext.makeNext(-1, -1));
      +    },
      +
      +    /**
      +     * Creates a bypass path.
      +     * This is used for such as IfStatement which does not have "else" chunk.
      +     *
      +     * @returns {void}
      +     */
      +    forkBypassPath: function() {
      +        this.forkContext.add(this.parentForkContext.head);
      +    },
      +
      +    //--------------------------------------------------------------------------
      +    // ConditionalExpression, LogicalExpression, IfStatement
      +    //--------------------------------------------------------------------------
      +
      +    /**
      +     * Creates a context for ConditionalExpression, LogicalExpression,
      +     * IfStatement, WhileStatement, DoWhileStatement, or ForStatement.
      +     *
      +     * LogicalExpressions have cases that it goes different paths between the
      +     * `true` case and the `false` case.
      +     *
      +     * For Example:
      +     *
      +     *     if (a || b) {
      +     *         foo();
      +     *     } else {
      +     *         bar();
      +     *     }
      +     *
      +     * In this case, `b` is evaluated always in the code path of the `else`
      +     * block, but it's not so in the code path of the `if` block.
      +     * So there are 3 paths.
      +     *
      +     *     a -> foo();
      +     *     a -> b -> foo();
      +     *     a -> b -> bar();
      +     *
      +     * @param {string} kind - A kind string.
      +     *   If the new context is LogicalExpression's, this is `"&&"` or `"||"`.
      +     *   If it's IfStatement's or ConditionalExpression's, this is `"test"`.
      +     *   Otherwise, this is `"loop"`.
      +     * @param {boolean} isForkingAsResult - A flag that shows that goes different
      +     *   paths between `true` and `false`.
      +     * @returns {void}
      +     */
      +    pushChoiceContext: function(kind, isForkingAsResult) {
      +        this.choiceContext = {
      +            upper: this.choiceContext,
      +            kind: kind,
      +            isForkingAsResult: isForkingAsResult,
      +            trueForkContext: ForkContext.newEmpty(this.forkContext),
      +            falseForkContext: ForkContext.newEmpty(this.forkContext),
      +            processed: false
      +        };
      +    },
      +
      +    /**
      +     * Pops the last choice context and finalizes it.
      +     *
      +     * @returns {ChoiceContext} The popped context.
      +     */
      +    popChoiceContext: function() {
      +        var context = this.choiceContext;
      +
      +        this.choiceContext = context.upper;
      +
      +        var forkContext = this.forkContext;
      +        var headSegments = forkContext.head;
      +
      +        switch (context.kind) {
      +            case "&&":
      +            case "||":
      +
      +                /*
      +                 * If any result were not transferred from child contexts,
      +                 * this sets the head segments to both cases.
      +                 * The head segments are the path of the right-hand operand.
      +                 */
      +                if (!context.processed) {
      +                    context.trueForkContext.add(headSegments);
      +                    context.falseForkContext.add(headSegments);
      +                }
      +
      +                /*
      +                 * Transfers results to upper context if this context is in
      +                 * test chunk.
      +                 */
      +                if (context.isForkingAsResult) {
      +                    var parentContext = this.choiceContext;
      +
      +                    parentContext.trueForkContext.addAll(context.trueForkContext);
      +                    parentContext.falseForkContext.addAll(context.falseForkContext);
      +                    parentContext.processed = true;
      +
      +                    return context;
      +                }
      +
      +                break;
      +
      +            case "test":
      +                if (!context.processed) {
      +
      +                    /*
      +                     * The head segments are the path of the `if` block here.
      +                     * Updates the `true` path with the end of the `if` block.
      +                     */
      +                    context.trueForkContext.clear();
      +                    context.trueForkContext.add(headSegments);
      +                } else {
      +
      +                    /*
      +                     * The head segments are the path of the `else` block here.
      +                     * Updates the `false` path with the end of the `else`
      +                     * block.
      +                     */
      +                    context.falseForkContext.clear();
      +                    context.falseForkContext.add(headSegments);
      +                }
      +
      +                break;
      +
      +            case "loop":
      +
      +                /*
      +                 * Loops are addressed in popLoopContext().
      +                 * This is called from popLoopContext().
      +                 */
      +                return context;
      +
      +            /* istanbul ignore next */
      +            default:
      +                throw new Error("unreachable");
      +        }
      +
      +        // Merges all paths.
      +        var prevForkContext = context.trueForkContext;
      +
      +        prevForkContext.addAll(context.falseForkContext);
      +        forkContext.replaceHead(prevForkContext.makeNext(0, -1));
      +
      +        return context;
      +    },
      +
      +    /**
      +     * Makes a code path segment of the right-hand operand of a logical
      +     * expression.
      +     *
      +     * @returns {void}
      +     */
      +    makeLogicalRight: function() {
      +        var context = this.choiceContext;
      +        var forkContext = this.forkContext;
      +
      +        if (context.processed) {
      +
      +            /*
      +             * This got segments already from the child choice context.
      +             * Creates the next path from own true/false fork context.
      +             */
      +            var prevForkContext =
      +                context.kind === "&&" ? context.trueForkContext :
      +                /* kind === "||" */ context.falseForkContext;
      +
      +            forkContext.replaceHead(prevForkContext.makeNext(0, -1));
      +            prevForkContext.clear();
      +
      +            context.processed = false;
      +        } else {
      +
      +            /*
      +             * This did not get segments from the child choice context.
      +             * So addresses the head segments.
      +             * The head segments are the path of the left-hand operand.
      +             */
      +            if (context.kind === "&&") {
      +
      +                // The path does short-circuit if false.
      +                context.falseForkContext.add(forkContext.head);
      +            } else {
      +
      +                // The path does short-circuit if true.
      +                context.trueForkContext.add(forkContext.head);
      +            }
      +
      +            forkContext.replaceHead(forkContext.makeNext(-1, -1));
      +        }
      +    },
      +
      +    /**
      +     * Makes a code path segment of the `if` block.
      +     *
      +     * @returns {void}
      +     */
      +    makeIfConsequent: function() {
      +        var context = this.choiceContext;
      +        var forkContext = this.forkContext;
      +
      +        /*
      +         * If any result were not transferred from child contexts,
      +         * this sets the head segments to both cases.
      +         * The head segments are the path of the test expression.
      +         */
      +        if (!context.processed) {
      +            context.trueForkContext.add(forkContext.head);
      +            context.falseForkContext.add(forkContext.head);
      +        }
      +
      +        context.processed = false;
      +
      +        // Creates new path from the `true` case.
      +        forkContext.replaceHead(
      +            context.trueForkContext.makeNext(0, -1)
      +        );
      +    },
      +
      +    /**
      +     * Makes a code path segment of the `else` block.
      +     *
      +     * @returns {void}
      +     */
      +    makeIfAlternate: function() {
      +        var context = this.choiceContext;
      +        var forkContext = this.forkContext;
      +
      +        /*
      +         * The head segments are the path of the `if` block.
      +         * Updates the `true` path with the end of the `if` block.
      +         */
      +        context.trueForkContext.clear();
      +        context.trueForkContext.add(forkContext.head);
      +        context.processed = true;
      +
      +        // Creates new path from the `false` case.
      +        forkContext.replaceHead(
      +            context.falseForkContext.makeNext(0, -1)
      +        );
      +    },
      +
      +    //--------------------------------------------------------------------------
      +    // SwitchStatement
      +    //--------------------------------------------------------------------------
      +
      +    /**
      +     * Creates a context object of SwitchStatement and stacks it.
      +     *
      +     * @param {boolean} hasCase - `true` if the switch statement has one or more
      +     *   case parts.
      +     * @param {string|null} label - The label text.
      +     * @returns {void}
      +     */
      +    pushSwitchContext: function(hasCase, label) {
      +        this.switchContext = {
      +            upper: this.switchContext,
      +            hasCase: hasCase,
      +            defaultSegments: null,
      +            defaultBodySegments: null,
      +            foundDefault: false,
      +            lastIsDefault: false,
      +            countForks: 0
      +        };
      +
      +        this.pushBreakContext(true, label);
      +    },
      +
      +    /**
      +     * Pops the last context of SwitchStatement and finalizes it.
      +     *
      +     * - Disposes all forking stack for `case` and `default`.
      +     * - Creates the next code path segment from `context.brokenForkContext`.
      +     * - If the last `SwitchCase` node is not a `default` part, creates a path
      +     *   to the `default` body.
      +     *
      +     * @returns {void}
      +     */
      +    popSwitchContext: function() {
      +        var context = this.switchContext;
      +
      +        this.switchContext = context.upper;
      +
      +        var forkContext = this.forkContext;
      +        var brokenForkContext = this.popBreakContext().brokenForkContext;
      +
      +        if (context.countForks === 0) {
      +
      +            /*
      +             * When there is only one `default` chunk and there is one or more
      +             * `break` statements, even if forks are nothing, it needs to merge
      +             * those.
      +             */
      +            if (!brokenForkContext.empty) {
      +                brokenForkContext.add(forkContext.makeNext(-1, -1));
      +                forkContext.replaceHead(brokenForkContext.makeNext(0, -1));
      +            }
      +
      +            return;
      +        }
      +
      +        var lastSegments = forkContext.head;
      +
      +        this.forkBypassPath();
      +        var lastCaseSegments = forkContext.head;
      +
      +        /*
      +         * `brokenForkContext` is used to make the next segment.
      +         * It must add the last segment into `brokenForkContext`.
      +         */
      +        brokenForkContext.add(lastSegments);
      +
      +        /*
      +         * A path which is failed in all case test should be connected to path
      +         * of `default` chunk.
      +         */
      +        if (!context.lastIsDefault) {
      +            if (context.defaultBodySegments) {
      +
      +                /*
      +                 * Remove a link from `default` label to its chunk.
      +                 * It's false route.
      +                 */
      +                removeConnection(context.defaultSegments, context.defaultBodySegments);
      +                makeLooped(this, lastCaseSegments, context.defaultBodySegments);
      +            } else {
      +
      +                /*
      +                 * It handles the last case body as broken if `default` chunk
      +                 * does not exist.
      +                 */
      +                brokenForkContext.add(lastCaseSegments);
      +            }
      +        }
      +
      +        // Pops the segment context stack until the entry segment.
      +        for (var i = 0; i < context.countForks; ++i) {
      +            this.forkContext = this.forkContext.upper;
      +        }
      +
      +        /*
      +         * Creates a path from all brokenForkContext paths.
      +         * This is a path after switch statement.
      +         */
      +        this.forkContext.replaceHead(brokenForkContext.makeNext(0, -1));
      +    },
      +
      +    /**
      +     * Makes a code path segment for a `SwitchCase` node.
      +     *
      +     * @param {boolean} isEmpty - `true` if the body is empty.
      +     * @param {boolean} isDefault - `true` if the body is the default case.
      +     * @returns {void}
      +     */
      +    makeSwitchCaseBody: function(isEmpty, isDefault) {
      +        var context = this.switchContext;
      +
      +        if (!context.hasCase) {
      +            return;
      +        }
      +
      +        /*
      +         * Merge forks.
      +         * The parent fork context has two segments.
      +         * Those are from the current case and the body of the previous case.
      +         */
      +        var parentForkContext = this.forkContext;
      +        var forkContext = this.pushForkContext();
      +
      +        forkContext.add(parentForkContext.makeNext(0, -1));
      +
      +        /*
      +         * Save `default` chunk info.
      +         * If the `default` label is not at the last, we must make a path from
      +         * the last `case` to the `default` chunk.
      +         */
      +        if (isDefault) {
      +            context.defaultSegments = parentForkContext.head;
      +            if (isEmpty) {
      +                context.foundDefault = true;
      +            } else {
      +                context.defaultBodySegments = forkContext.head;
      +            }
      +        } else {
      +            if (!isEmpty && context.foundDefault) {
      +                context.foundDefault = false;
      +                context.defaultBodySegments = forkContext.head;
      +            }
      +        }
      +
      +        context.lastIsDefault = isDefault;
      +        context.countForks += 1;
      +    },
      +
      +    //--------------------------------------------------------------------------
      +    // TryStatement
      +    //--------------------------------------------------------------------------
      +
      +    /**
      +     * Creates a context object of TryStatement and stacks it.
      +     *
      +     * @param {boolean} hasFinalizer - `true` if the try statement has a
      +     *   `finally` block.
      +     * @returns {void}
      +     */
      +    pushTryContext: function(hasFinalizer) {
      +        this.tryContext = {
      +            upper: this.tryContext,
      +            position: "try",
      +            hasFinalizer: hasFinalizer,
      +
      +            returnedForkContext: hasFinalizer
      +                ? ForkContext.newEmpty(this.forkContext)
      +                : null,
      +
      +            thrownForkContext: ForkContext.newEmpty(this.forkContext),
      +            lastOfTryIsReachable: false,
      +            lastOfCatchIsReachable: false
      +        };
      +    },
      +
      +    /**
      +     * Pops the last context of TryStatement and finalizes it.
      +     *
      +     * @returns {void}
      +     */
      +    popTryContext: function() {
      +        var context = this.tryContext;
      +
      +        this.tryContext = context.upper;
      +
      +        if (context.position === "catch") {
      +
      +            // Merges two paths from the `try` block and `catch` block merely.
      +            this.popForkContext();
      +            return;
      +        }
      +
      +        /*
      +         * The following process is executed only when there is the `finally`
      +         * block.
      +         */
      +
      +        var returned = context.returnedForkContext;
      +        var thrown = context.thrownForkContext;
      +
      +        if (returned.empty && thrown.empty) {
      +            return;
      +        }
      +
      +        // Separate head to normal paths and leaving paths.
      +        var headSegments = this.forkContext.head;
      +
      +        this.forkContext = this.forkContext.upper;
      +        var normalSegments = headSegments.slice(0, headSegments.length / 2 | 0);
      +        var leavingSegments = headSegments.slice(headSegments.length / 2 | 0);
      +
      +        // Forwards the leaving path to upper contexts.
      +        if (!returned.empty) {
      +            getReturnContext(this).returnedForkContext.add(leavingSegments);
      +        }
      +        if (!thrown.empty) {
      +            getThrowContext(this).thrownForkContext.add(leavingSegments);
      +        }
      +
      +        // Sets the normal path as the next.
      +        this.forkContext.replaceHead(normalSegments);
      +
      +        // If both paths of the `try` block and the `catch` block are
      +        // unreachable, the next path becomes unreachable as well.
      +        if (!context.lastOfTryIsReachable && !context.lastOfCatchIsReachable) {
      +            this.forkContext.makeUnreachable();
      +        }
      +    },
      +
      +    /**
      +     * Makes a code path segment for a `catch` block.
      +     *
      +     * @returns {void}
      +     */
      +    makeCatchBlock: function() {
      +        var context = this.tryContext;
      +        var forkContext = this.forkContext;
      +        var thrown = context.thrownForkContext;
      +
      +        // Update state.
      +        context.position = "catch";
      +        context.thrownForkContext = ForkContext.newEmpty(forkContext);
      +        context.lastOfTryIsReachable = forkContext.reachable;
      +
      +        // Merge thrown paths.
      +        thrown.add(forkContext.head);
      +        var thrownSegments = thrown.makeNext(0, -1);
      +
      +        // Fork to a bypass and the merged thrown path.
      +        this.pushForkContext();
      +        this.forkBypassPath();
      +        this.forkContext.add(thrownSegments);
      +    },
      +
      +    /**
      +     * Makes a code path segment for a `finally` block.
      +     *
      +     * In the `finally` block, parallel paths are created. The parallel paths
      +     * are used as leaving-paths. The leaving-paths are paths from `return`
      +     * statements and `throw` statements in a `try` block or a `catch` block.
      +     *
      +     * @returns {void}
      +     */
      +    makeFinallyBlock: function() {
      +        var context = this.tryContext;
      +        var forkContext = this.forkContext;
      +        var returned = context.returnedForkContext;
      +        var thrown = context.thrownForkContext;
      +        var headOfLeavingSegments = forkContext.head;
      +
      +        // Update state.
      +        if (context.position === "catch") {
      +
      +            // Merges two paths from the `try` block and `catch` block.
      +            this.popForkContext();
      +            forkContext = this.forkContext;
      +
      +            context.lastOfCatchIsReachable = forkContext.reachable;
      +        } else {
      +            context.lastOfTryIsReachable = forkContext.reachable;
      +        }
      +        context.position = "finally";
      +
      +        if (returned.empty && thrown.empty) {
      +
      +            // This path does not leave.
      +            return;
      +        }
      +
      +        /*
      +         * Create a parallel segment from merging returned and thrown.
      +         * This segment will leave at the end of this finally block.
      +         */
      +        var segments = forkContext.makeNext(-1, -1);
      +        var j;
      +
      +        for (var i = 0; i < forkContext.count; ++i) {
      +            var prevSegsOfLeavingSegment = [headOfLeavingSegments[i]];
      +
      +            for (j = 0; j < returned.segmentsList.length; ++j) {
      +                prevSegsOfLeavingSegment.push(returned.segmentsList[j][i]);
      +            }
      +            for (j = 0; j < thrown.segmentsList.length; ++j) {
      +                prevSegsOfLeavingSegment.push(thrown.segmentsList[j][i]);
      +            }
      +
      +            segments.push(CodePathSegment.newNext(
      +                this.idGenerator.next(),
      +                prevSegsOfLeavingSegment));
      +        }
      +
      +        this.pushForkContext(true);
      +        this.forkContext.add(segments);
      +    },
      +
      +    /**
      +     * Makes a code path segment from the first throwable node to the `catch`
      +     * block or the `finally` block.
      +     *
      +     * @returns {void}
      +     */
      +    makeFirstThrowablePathInTryBlock: function() {
      +        var forkContext = this.forkContext;
      +
      +        if (!forkContext.reachable) {
      +            return;
      +        }
      +
      +        var context = getThrowContext(this);
      +
      +        if (context === this ||
      +            context.position !== "try" ||
      +            !context.thrownForkContext.empty
      +        ) {
      +            return;
      +        }
      +
      +        context.thrownForkContext.add(forkContext.head);
      +        forkContext.replaceHead(forkContext.makeNext(-1, -1));
      +    },
      +
      +    //--------------------------------------------------------------------------
      +    // Loop Statements
      +    //--------------------------------------------------------------------------
      +
      +    /**
      +     * Creates a context object of a loop statement and stacks it.
      +     *
      +     * @param {string} type - The type of the node which was triggered. One of
      +     *   `WhileStatement`, `DoWhileStatement`, `ForStatement`, `ForInStatement`,
      +     *   and `ForStatement`.
      +     * @param {string|null} label - A label of the node which was triggered.
      +     * @returns {void}
      +     */
      +    pushLoopContext: function(type, label) {
      +        var forkContext = this.forkContext;
      +        var breakContext = this.pushBreakContext(true, label);
      +
      +        switch (type) {
      +            case "WhileStatement":
      +                this.pushChoiceContext("loop", false);
      +                this.loopContext = {
      +                    upper: this.loopContext,
      +                    type: type,
      +                    label: label,
      +                    test: void 0,
      +                    continueDestSegments: null,
      +                    brokenForkContext: breakContext.brokenForkContext
      +                };
      +                break;
      +
      +            case "DoWhileStatement":
      +                this.pushChoiceContext("loop", false);
      +                this.loopContext = {
      +                    upper: this.loopContext,
      +                    type: type,
      +                    label: label,
      +                    test: void 0,
      +                    entrySegments: null,
      +                    continueForkContext: ForkContext.newEmpty(forkContext),
      +                    brokenForkContext: breakContext.brokenForkContext
      +                };
      +                break;
      +
      +            case "ForStatement":
      +                this.pushChoiceContext("loop", false);
      +                this.loopContext = {
      +                    upper: this.loopContext,
      +                    type: type,
      +                    label: label,
      +                    test: void 0,
      +                    endOfInitSegments: null,
      +                    testSegments: null,
      +                    endOfTestSegments: null,
      +                    updateSegments: null,
      +                    endOfUpdateSegments: null,
      +                    continueDestSegments: null,
      +                    brokenForkContext: breakContext.brokenForkContext
      +                };
      +                break;
      +
      +            case "ForInStatement":
      +            case "ForOfStatement":
      +                this.loopContext = {
      +                    upper: this.loopContext,
      +                    type: type,
      +                    label: label,
      +                    prevSegments: null,
      +                    leftSegments: null,
      +                    endOfLeftSegments: null,
      +                    continueDestSegments: null,
      +                    brokenForkContext: breakContext.brokenForkContext
      +                };
      +                break;
      +
      +            /* istanbul ignore next */
      +            default:
      +                throw new Error("unknown type: \"" + type + "\"");
      +        }
      +    },
      +
      +    /**
      +     * Pops the last context of a loop statement and finalizes it.
      +     *
      +     * @returns {void}
      +     */
      +    popLoopContext: function() {
      +        var context = this.loopContext;
      +
      +        this.loopContext = context.upper;
      +
      +        var forkContext = this.forkContext;
      +        var brokenForkContext = this.popBreakContext().brokenForkContext;
      +        var choiceContext;
      +
      +        // Creates a looped path.
      +        switch (context.type) {
      +            case "WhileStatement":
      +            case "ForStatement":
      +                choiceContext = this.popChoiceContext();
      +                makeLooped(
      +                    this,
      +                    forkContext.head,
      +                    context.continueDestSegments);
      +                break;
      +
      +            case "DoWhileStatement":
      +                choiceContext = this.popChoiceContext();
      +
      +                if (!choiceContext.processed) {
      +                    choiceContext.trueForkContext.add(forkContext.head);
      +                    choiceContext.falseForkContext.add(forkContext.head);
      +                }
      +                if (context.test !== true) {
      +                    brokenForkContext.addAll(choiceContext.falseForkContext);
      +                }
      +
      +                // `true` paths go to looping.
      +                var segmentsList = choiceContext.trueForkContext.segmentsList;
      +
      +                for (var i = 0; i < segmentsList.length; ++i) {
      +                    makeLooped(
      +                        this,
      +                        segmentsList[i],
      +                        context.entrySegments);
      +                }
      +                break;
      +
      +            case "ForInStatement":
      +            case "ForOfStatement":
      +                brokenForkContext.add(forkContext.head);
      +                makeLooped(
      +                    this,
      +                    forkContext.head,
      +                    context.leftSegments);
      +                break;
      +
      +            /* istanbul ignore next */
      +            default:
      +                throw new Error("unreachable");
      +        }
      +
      +        // Go next.
      +        if (brokenForkContext.empty) {
      +            forkContext.replaceHead(forkContext.makeUnreachable(-1, -1));
      +        } else {
      +            forkContext.replaceHead(brokenForkContext.makeNext(0, -1));
      +        }
      +    },
      +
      +    /**
      +     * Makes a code path segment for the test part of a WhileStatement.
      +     *
      +     * @param {boolean|undefined} test - The test value (only when constant).
      +     * @returns {void}
      +     */
      +    makeWhileTest: function(test) {
      +        var context = this.loopContext;
      +        var forkContext = this.forkContext;
      +        var testSegments = forkContext.makeNext(0, -1);
      +
      +        // Update state.
      +        context.test = test;
      +        context.continueDestSegments = testSegments;
      +        forkContext.replaceHead(testSegments);
      +    },
      +
      +    /**
      +     * Makes a code path segment for the body part of a WhileStatement.
      +     *
      +     * @returns {void}
      +     */
      +    makeWhileBody: function() {
      +        var context = this.loopContext;
      +        var choiceContext = this.choiceContext;
      +        var forkContext = this.forkContext;
      +
      +        if (!choiceContext.processed) {
      +            choiceContext.trueForkContext.add(forkContext.head);
      +            choiceContext.falseForkContext.add(forkContext.head);
      +        }
      +
      +        // Update state.
      +        if (context.test !== true) {
      +            context.brokenForkContext.addAll(choiceContext.falseForkContext);
      +        }
      +        forkContext.replaceHead(choiceContext.trueForkContext.makeNext(0, -1));
      +    },
      +
      +    /**
      +     * Makes a code path segment for the body part of a DoWhileStatement.
      +     *
      +     * @returns {void}
      +     */
      +    makeDoWhileBody: function() {
      +        var context = this.loopContext;
      +        var forkContext = this.forkContext;
      +        var bodySegments = forkContext.makeNext(-1, -1);
      +
      +        // Update state.
      +        context.entrySegments = bodySegments;
      +        forkContext.replaceHead(bodySegments);
      +    },
      +
      +    /**
      +     * Makes a code path segment for the test part of a DoWhileStatement.
      +     *
      +     * @param {boolean|undefined} test - The test value (only when constant).
      +     * @returns {void}
      +     */
      +    makeDoWhileTest: function(test) {
      +        var context = this.loopContext;
      +        var forkContext = this.forkContext;
      +
      +        context.test = test;
      +
      +        // Creates paths of `continue` statements.
      +        if (!context.continueForkContext.empty) {
      +            context.continueForkContext.add(forkContext.head);
      +            var testSegments = context.continueForkContext.makeNext(0, -1);
      +
      +            forkContext.replaceHead(testSegments);
      +        }
      +    },
      +
      +    /**
      +     * Makes a code path segment for the test part of a ForStatement.
      +     *
      +     * @param {boolean|undefined} test - The test value (only when constant).
      +     * @returns {void}
      +     */
      +    makeForTest: function(test) {
      +        var context = this.loopContext;
      +        var forkContext = this.forkContext;
      +        var endOfInitSegments = forkContext.head;
      +        var testSegments = forkContext.makeNext(-1, -1);
      +
      +        // Update state.
      +        context.test = test;
      +        context.endOfInitSegments = endOfInitSegments;
      +        context.continueDestSegments = context.testSegments = testSegments;
      +        forkContext.replaceHead(testSegments);
      +    },
      +
      +    /**
      +     * Makes a code path segment for the update part of a ForStatement.
      +     *
      +     * @returns {void}
      +     */
      +    makeForUpdate: function() {
      +        var context = this.loopContext;
      +        var choiceContext = this.choiceContext;
      +        var forkContext = this.forkContext;
      +
      +        // Make the next paths of the test.
      +        if (context.testSegments) {
      +            finalizeTestSegmentsOfFor(
      +                context,
      +                choiceContext,
      +                forkContext.head);
      +        } else {
      +            context.endOfInitSegments = forkContext.head;
      +        }
      +
      +        // Update state.
      +        var updateSegments = forkContext.makeDisconnected(-1, -1);
      +
      +        context.continueDestSegments = context.updateSegments = updateSegments;
      +        forkContext.replaceHead(updateSegments);
      +    },
      +
      +    /**
      +     * Makes a code path segment for the body part of a ForStatement.
      +     *
      +     * @returns {void}
      +     */
      +    makeForBody: function() {
      +        var context = this.loopContext;
      +        var choiceContext = this.choiceContext;
      +        var forkContext = this.forkContext;
      +
      +        // Update state.
      +        if (context.updateSegments) {
      +            context.endOfUpdateSegments = forkContext.head;
      +
      +            // `update` -> `test`
      +            if (context.testSegments) {
      +                makeLooped(
      +                    this,
      +                    context.endOfUpdateSegments,
      +                    context.testSegments);
      +            }
      +        } else if (context.testSegments) {
      +            finalizeTestSegmentsOfFor(
      +                context,
      +                choiceContext,
      +                forkContext.head);
      +        } else {
      +            context.endOfInitSegments = forkContext.head;
      +        }
      +
      +        var bodySegments = context.endOfTestSegments;
      +
      +        if (!bodySegments) {
      +
      +            /*
      +             * If there is not the `test` part, the `body` path comes from the
      +             * `init` part and the `update` part.
      +             */
      +            var prevForkContext = ForkContext.newEmpty(forkContext);
      +
      +            prevForkContext.add(context.endOfInitSegments);
      +            if (context.endOfUpdateSegments) {
      +                prevForkContext.add(context.endOfUpdateSegments);
      +            }
      +
      +            bodySegments = prevForkContext.makeNext(0, -1);
      +        }
      +        context.continueDestSegments = context.continueDestSegments || bodySegments;
      +        forkContext.replaceHead(bodySegments);
      +    },
      +
      +    /**
      +     * Makes a code path segment for the left part of a ForInStatement and a
      +     * ForOfStatement.
      +     *
      +     * @returns {void}
      +     */
      +    makeForInOfLeft: function() {
      +        var context = this.loopContext;
      +        var forkContext = this.forkContext;
      +        var leftSegments = forkContext.makeDisconnected(-1, -1);
      +
      +        // Update state.
      +        context.prevSegments = forkContext.head;
      +        context.leftSegments = context.continueDestSegments = leftSegments;
      +        forkContext.replaceHead(leftSegments);
      +    },
      +
      +    /**
      +     * Makes a code path segment for the right part of a ForInStatement and a
      +     * ForOfStatement.
      +     *
      +     * @returns {void}
      +     */
      +    makeForInOfRight: function() {
      +        var context = this.loopContext;
      +        var forkContext = this.forkContext;
      +        var temp = ForkContext.newEmpty(forkContext);
      +
      +        temp.add(context.prevSegments);
      +        var rightSegments = temp.makeNext(-1, -1);
      +
      +        // Update state.
      +        context.endOfLeftSegments = forkContext.head;
      +        forkContext.replaceHead(rightSegments);
      +    },
      +
      +    /**
      +     * Makes a code path segment for the body part of a ForInStatement and a
      +     * ForOfStatement.
      +     *
      +     * @returns {void}
      +     */
      +    makeForInOfBody: function() {
      +        var context = this.loopContext;
      +        var forkContext = this.forkContext;
      +        var temp = ForkContext.newEmpty(forkContext);
      +
      +        temp.add(context.endOfLeftSegments);
      +        var bodySegments = temp.makeNext(-1, -1);
      +
      +        // Make a path: `right` -> `left`.
      +        makeLooped(this, forkContext.head, context.leftSegments);
      +
      +        // Update state.
      +        context.brokenForkContext.add(forkContext.head);
      +        forkContext.replaceHead(bodySegments);
      +    },
      +
      +    //--------------------------------------------------------------------------
      +    // Control Statements
      +    //--------------------------------------------------------------------------
      +
      +    /**
      +     * Creates new context for BreakStatement.
      +     *
      +     * @param {boolean} breakable - The flag to indicate it can break by
      +     *      an unlabeled BreakStatement.
      +     * @param {string|null} label - The label of this context.
      +     * @returns {object} The new context.
      +     */
      +    pushBreakContext: function(breakable, label) {
      +        this.breakContext = {
      +            upper: this.breakContext,
      +            breakable: breakable,
      +            label: label,
      +            brokenForkContext: ForkContext.newEmpty(this.forkContext)
      +        };
      +        return this.breakContext;
      +    },
      +
      +    /**
      +     * Removes the top item of the break context stack.
      +     *
      +     * @returns {object} The removed context.
      +     */
      +    popBreakContext: function() {
      +        var context = this.breakContext;
      +        var forkContext = this.forkContext;
      +
      +        this.breakContext = context.upper;
      +
      +        // Process this context here for other than switches and loops.
      +        if (!context.breakable) {
      +            var brokenForkContext = context.brokenForkContext;
      +
      +            if (!brokenForkContext.empty) {
      +                brokenForkContext.add(forkContext.head);
      +                forkContext.replaceHead(brokenForkContext.makeNext(0, -1));
      +            }
      +        }
      +
      +        return context;
      +    },
      +
      +    /**
      +     * Makes a path for a `break` statement.
      +     *
      +     * It registers the head segment to a context of `break`.
      +     * It makes new unreachable segment, then it set the head with the segment.
      +     *
      +     * @param {string} label - A label of the break statement.
      +     * @returns {void}
      +     */
      +    makeBreak: function(label) {
      +        var forkContext = this.forkContext;
      +
      +        if (!forkContext.reachable) {
      +            return;
      +        }
      +
      +        var context = getBreakContext(this, label);
      +
      +        /* istanbul ignore else: foolproof (syntax error) */
      +        if (context) {
      +            context.brokenForkContext.add(forkContext.head);
      +        }
      +
      +        forkContext.replaceHead(forkContext.makeUnreachable(-1, -1));
      +    },
      +
      +    /**
      +     * Makes a path for a `continue` statement.
      +     *
      +     * It makes a looping path.
      +     * It makes new unreachable segment, then it set the head with the segment.
      +     *
      +     * @param {string} label - A label of the continue statement.
      +     * @returns {void}
      +     */
      +    makeContinue: function(label) {
      +        var forkContext = this.forkContext;
      +
      +        if (!forkContext.reachable) {
      +            return;
      +        }
      +
      +        var context = getContinueContext(this, label);
      +
      +        /* istanbul ignore else: foolproof (syntax error) */
      +        if (context) {
      +            if (context.continueDestSegments) {
      +                makeLooped(this, forkContext.head, context.continueDestSegments);
      +
      +                // If the context is a for-in/of loop, this effects a break also.
      +                if (context.type === "ForInStatement" ||
      +                    context.type === "ForOfStatement"
      +                ) {
      +                    context.brokenForkContext.add(forkContext.head);
      +                }
      +            } else {
      +                context.continueForkContext.add(forkContext.head);
      +            }
      +        }
      +        forkContext.replaceHead(forkContext.makeUnreachable(-1, -1));
      +    },
      +
      +    /**
      +     * Makes a path for a `return` statement.
      +     *
      +     * It registers the head segment to a context of `return`.
      +     * It makes new unreachable segment, then it set the head with the segment.
      +     *
      +     * @returns {void}
      +     */
      +    makeReturn: function() {
      +        var forkContext = this.forkContext;
      +
      +        if (forkContext.reachable) {
      +            getReturnContext(this).returnedForkContext.add(forkContext.head);
      +            forkContext.replaceHead(forkContext.makeUnreachable(-1, -1));
      +        }
      +    },
      +
      +    /**
      +     * Makes a path for a `throw` statement.
      +     *
      +     * It registers the head segment to a context of `throw`.
      +     * It makes new unreachable segment, then it set the head with the segment.
      +     *
      +     * @returns {void}
      +     */
      +    makeThrow: function() {
      +        var forkContext = this.forkContext;
      +
      +        if (forkContext.reachable) {
      +            getThrowContext(this).thrownForkContext.add(forkContext.head);
      +            forkContext.replaceHead(forkContext.makeUnreachable(-1, -1));
      +        }
      +    },
      +
      +    /**
      +     * Makes the final path.
      +     * @returns {void}
      +     */
      +    makeFinal: function() {
      +        var segments = this.currentSegments;
      +
      +        if (segments.length > 0 && segments[0].reachable) {
      +            this.returnedForkContext.add(segments);
      +        }
      +    }
      +};
      +
      +module.exports = CodePathState;
      diff --git a/tools/eslint/lib/code-path-analysis/code-path.js b/tools/eslint/lib/code-path-analysis/code-path.js
      new file mode 100644
      index 00000000000000..2b45ed944f8497
      --- /dev/null
      +++ b/tools/eslint/lib/code-path-analysis/code-path.js
      @@ -0,0 +1,236 @@
      +/**
      + * @fileoverview A class of the code path.
      + * @author Toru Nagashima
      + * @copyright 2015 Toru Nagashima. All rights reserved.
      + * See LICENSE file in root directory for full license.
      + */
      +
      +"use strict";
      +
      +//------------------------------------------------------------------------------
      +// Requirements
      +//------------------------------------------------------------------------------
      +
      +var CodePathState = require("./code-path-state");
      +var IdGenerator = require("./id-generator");
      +
      +//------------------------------------------------------------------------------
      +// Public Interface
      +//------------------------------------------------------------------------------
      +
      +/**
      + * A code path.
      + *
      + * @constructor
      + * @param {string} id - An identifier.
      + * @param {CodePath|null} upper - The code path of the upper function scope.
      + * @param {function} onLooped - A callback function to notify looping.
      + */
      +function CodePath(id, upper, onLooped) {
      +
      +    /**
      +     * The identifier of this code path.
      +     * Rules use it to store additional information of each rule.
      +     * @type {string}
      +     */
      +    this.id = id;
      +
      +    /**
      +     * The code path of the upper function scope.
      +     * @type {CodePath|null}
      +     */
      +    this.upper = upper;
      +
      +    /**
      +     * The code paths of nested function scopes.
      +     * @type {CodePath[]}
      +     */
      +    this.childCodePaths = [];
      +
      +    // Initializes internal state.
      +    Object.defineProperty(
      +        this,
      +        "internal",
      +        {value: new CodePathState(new IdGenerator(id + "_"), onLooped)});
      +
      +    // Adds this into `childCodePaths` of `upper`.
      +    if (upper) {
      +        upper.childCodePaths.push(this);
      +    }
      +}
      +
      +CodePath.prototype = {
      +    constructor: CodePath,
      +
      +    /**
      +     * The initial code path segment.
      +     * @type {CodePathSegment}
      +     */
      +    get initialSegment() {
      +        return this.internal.initialSegment;
      +    },
      +
      +    /**
      +     * Final code path segments.
      +     * This array is a mix of `returnedSegments` and `thrownSegments`.
      +     * @type {CodePathSegment[]}
      +     */
      +    get finalSegments() {
      +        return this.internal.finalSegments;
      +    },
      +
      +    /**
      +     * Final code path segments which is with `return` statements.
      +     * This array contains the last path segment if it's reachable.
      +     * Since the reachable last path returns `undefined`.
      +     * @type {CodePathSegment[]}
      +     */
      +    get returnedSegments() {
      +        return this.internal.returnedForkContext;
      +    },
      +
      +    /**
      +     * Final code path segments which is with `throw` statements.
      +     * @type {CodePathSegment[]}
      +     */
      +    get thrownSegments() {
      +        return this.internal.thrownForkContext;
      +    },
      +
      +    /**
      +     * Current code path segments.
      +     * @type {CodePathSegment[]}
      +     */
      +    get currentSegments() {
      +        return this.internal.currentSegments;
      +    },
      +
      +    /**
      +     * Traverses all segments in this code path.
      +     *
      +     *     codePath.traverseSegments(function(segment, controller) {
      +     *         // do something.
      +     *     });
      +     *
      +     * This method enumerates segments in order from the head.
      +     *
      +     * The `controller` object has two methods.
      +     *
      +     * - `controller.skip()` - Skip the following segments in this branch.
      +     * - `controller.break()` - Skip all following segments.
      +     *
      +     * @param {object} [options] - Omittable.
      +     * @param {CodePathSegment} [options.first] - The first segment to traverse.
      +     * @param {CodePathSegment} [options.last] - The last segment to traverse.
      +     * @param {function} callback - A callback function.
      +     * @returns {void}
      +     */
      +    traverseSegments: function(options, callback) {
      +        if (typeof options === "function") {
      +            callback = options;
      +            options = null;
      +        }
      +
      +        options = options || {};
      +        var startSegment = options.first || this.internal.initialSegment;
      +        var lastSegment = options.last;
      +
      +        var item = null;
      +        var index = 0;
      +        var end = 0;
      +        var segment = null;
      +        var visited = Object.create(null);
      +        var stack = [[startSegment, 0]];
      +        var skippedSegment = null;
      +        var broken = false;
      +        var controller = {
      +            skip: function() {
      +                if (stack.length <= 1) {
      +                    broken = true;
      +                } else {
      +                    skippedSegment = stack[stack.length - 2][0];
      +                }
      +            },
      +            break: function() {
      +                broken = true;
      +            }
      +        };
      +
      +        /**
      +         * Checks a given previous segment has been visited.
      +         * @param {CodePathSegment} prevSegment - A previous segment to check.
      +         * @returns {boolean} `true` if the segment has been visited.
      +         */
      +        function isVisited(prevSegment) {
      +            return (
      +                visited[prevSegment.id] ||
      +                segment.isLoopedPrevSegment(prevSegment)
      +            );
      +        }
      +
      +        while (stack.length > 0) {
      +            item = stack[stack.length - 1];
      +            segment = item[0];
      +            index = item[1];
      +
      +            if (index === 0) {
      +
      +                // Skip if this segment has been visited already.
      +                if (visited[segment.id]) {
      +                    stack.pop();
      +                    continue;
      +                }
      +
      +                // Skip if all previous segments have not been visited.
      +                if (segment !== startSegment &&
      +                    segment.prevSegments.length > 0 &&
      +                    !segment.prevSegments.every(isVisited)
      +                ) {
      +                    stack.pop();
      +                    continue;
      +                }
      +
      +                // Reset the flag of skipping if all branches have been skipped.
      +                if (skippedSegment && segment.prevSegments.indexOf(skippedSegment) !== -1) {
      +                    skippedSegment = null;
      +                }
      +                visited[segment.id] = true;
      +
      +                // Call the callback when the first time.
      +                if (!skippedSegment) {
      +                    callback.call(this, segment, controller); // eslint-disable-line callback-return
      +                    if (segment === lastSegment) {
      +                        controller.skip();
      +                    }
      +                    if (broken) {
      +                        break;
      +                    }
      +                }
      +            }
      +
      +            // Update the stack.
      +            end = segment.nextSegments.length - 1;
      +            if (index < end) {
      +                item[1] += 1;
      +                stack.push([segment.nextSegments[index], 0]);
      +            } else if (index === end) {
      +                item[0] = segment.nextSegments[index];
      +                item[1] = 0;
      +            } else {
      +                stack.pop();
      +            }
      +        }
      +    }
      +};
      +
      +/**
      + * Gets the state of a given code path.
      + *
      + * @param {CodePath} codePath - A code path to get.
      + * @returns {CodePathState} The state of the code path.
      + */
      +CodePath.getState = function getState(codePath) {
      +    return codePath.internal;
      +};
      +
      +module.exports = CodePath;
      diff --git a/tools/eslint/lib/code-path-analysis/debug-helpers.js b/tools/eslint/lib/code-path-analysis/debug-helpers.js
      new file mode 100644
      index 00000000000000..6ecfabe955d92d
      --- /dev/null
      +++ b/tools/eslint/lib/code-path-analysis/debug-helpers.js
      @@ -0,0 +1,201 @@
      +/**
      + * @fileoverview Helpers to debug for code path analysis.
      + * @author Toru Nagashima
      + * @copyright 2015 Toru Nagashima. All rights reserved.
      + * See LICENSE file in root directory for full license.
      + */
      +
      +"use strict";
      +
      +//------------------------------------------------------------------------------
      +// Requirements
      +//------------------------------------------------------------------------------
      +
      +var debug = require("debug")("eslint:code-path");
      +
      +//------------------------------------------------------------------------------
      +// Helpers
      +//------------------------------------------------------------------------------
      +
      +/**
      + * Gets id of a given segment.
      + * @param {CodePathSegment} segment - A segment to get.
      + * @returns {string} Id of the segment.
      + */
      +/* istanbul ignore next */
      +function getId(segment) { // eslint-disable-line require-jsdoc
      +    return segment.id + (segment.reachable ? "" : "!");
      +}
      +
      +//------------------------------------------------------------------------------
      +// Public Interface
      +//------------------------------------------------------------------------------
      +
      +module.exports = {
      +
      +    /**
      +     * A flag that debug dumping is enabled or not.
      +     * @type {boolean}
      +     */
      +    enabled: debug.enabled,
      +
      +    /**
      +     * Dumps given objects.
      +     *
      +     * @param {...any} args - objects to dump.
      +     * @returns {void}
      +     */
      +    dump: debug,
      +
      +    /**
      +     * Dumps the current analyzing state.
      +     *
      +     * @param {ASTNode} node - A node to dump.
      +     * @param {CodePathState} state - A state to dump.
      +     * @param {boolean} leaving - A flag whether or not it's leaving
      +     * @returns {void}
      +     */
      +    dumpState: !debug.enabled ? debug : /* istanbul ignore next */ function(node, state, leaving) {
      +        for (var i = 0; i < state.currentSegments.length; ++i) {
      +            var segInternal = state.currentSegments[i].internal;
      +
      +            if (leaving) {
      +                segInternal.exitNodes.push(node);
      +            } else {
      +                segInternal.nodes.push(node);
      +            }
      +        }
      +
      +        debug(
      +            state.currentSegments.map(getId).join(",") + ") " +
      +            node.type + (leaving ? ":exit" : "")
      +        );
      +    },
      +
      +    /**
      +     * Dumps a DOT code of a given code path.
      +     * The DOT code can be visialized with Graphvis.
      +     *
      +     * @param {CodePath} codePath - A code path to dump.
      +     * @returns {void}
      +     * @see http://www.graphviz.org
      +     * @see http://www.webgraphviz.com
      +     */
      +    dumpDot: !debug.enabled ? debug : /* istanbul ignore next */ function(codePath) {
      +        var text =
      +            "\n" +
      +            "digraph {\n" +
      +            "node[shape=box,style=\"rounded,filled\",fillcolor=white];\n" +
      +            "initial[label=\"\",shape=circle,style=filled,fillcolor=black,width=0.25,height=0.25];\n";
      +
      +        if (codePath.returnedSegments.length > 0) {
      +            text += "final[label=\"\",shape=doublecircle,style=filled,fillcolor=black,width=0.25,height=0.25];\n";
      +        }
      +        if (codePath.thrownSegments.length > 0) {
      +            text += "thrown[label=\"✘\",shape=circle,width=0.3,height=0.3,fixedsize];\n";
      +        }
      +
      +        var traceMap = Object.create(null);
      +        var arrows = this.makeDotArrows(codePath, traceMap);
      +
      +        for (var id in traceMap) { // eslint-disable-line guard-for-in
      +            var segment = traceMap[id];
      +
      +            text += id + "[";
      +
      +            if (segment.reachable) {
      +                text += "label=\"";
      +            } else {
      +                text += "style=\"rounded,dashed,filled\",fillcolor=\"#FF9800\",label=\"<>\\n";
      +            }
      +
      +            if (segment.internal.nodes.length > 0) {
      +                text += segment.internal.nodes.map(function(node) {
      +                    switch (node.type) {
      +                        case "Identifier": return node.type + " (" + node.name + ")";
      +                        case "Literal": return node.type + " (" + node.value + ")";
      +                        default: return node.type;
      +                    }
      +                }).join("\\n");
      +            } else if (segment.internal.exitNodes.length > 0) {
      +                text += segment.internal.exitNodes.map(function(node) {
      +                    switch (node.type) {
      +                        case "Identifier": return node.type + ":exit (" + node.name + ")";
      +                        case "Literal": return node.type + ":exit (" + node.value + ")";
      +                        default: return node.type + ":exit";
      +                    }
      +                }).join("\\n");
      +            } else {
      +                text += "????";
      +            }
      +
      +            text += "\"];\n";
      +        }
      +
      +        text += arrows + "\n";
      +        text += "}";
      +        debug("DOT", text);
      +    },
      +
      +    /**
      +     * Makes a DOT code of a given code path.
      +     * The DOT code can be visialized with Graphvis.
      +     *
      +     * @param {CodePath} codePath - A code path to make DOT.
      +     * @param {object} traceMap - Optional. A map to check whether or not segments had been done.
      +     * @returns {string} A DOT code of the code path.
      +     */
      +    makeDotArrows: function(codePath, traceMap) {
      +        var stack = [[codePath.initialSegment, 0]];
      +        var done = traceMap || Object.create(null);
      +        var lastId = codePath.initialSegment.id;
      +        var text = "initial->" + codePath.initialSegment.id;
      +
      +        while (stack.length > 0) {
      +            var item = stack.pop();
      +            var segment = item[0];
      +            var index = item[1];
      +
      +            if (done[segment.id] && index === 0) {
      +                continue;
      +            }
      +            done[segment.id] = segment;
      +
      +            var nextSegment = segment.allNextSegments[index];
      +
      +            if (!nextSegment) {
      +                continue;
      +            }
      +
      +            if (lastId === segment.id) {
      +                text += "->" + nextSegment.id;
      +            } else {
      +                text += ";\n" + segment.id + "->" + nextSegment.id;
      +            }
      +            lastId = nextSegment.id;
      +
      +            stack.unshift([segment, 1 + index]);
      +            stack.push([nextSegment, 0]);
      +        }
      +
      +        codePath.returnedSegments.forEach(function(finalSegment) {
      +            if (lastId === finalSegment.id) {
      +                text += "->final";
      +            } else {
      +                text += ";\n" + finalSegment.id + "->final";
      +            }
      +            lastId = null;
      +        });
      +
      +        codePath.thrownSegments.forEach(function(finalSegment) {
      +            if (lastId === finalSegment.id) {
      +                text += "->thrown";
      +            } else {
      +                text += ";\n" + finalSegment.id + "->thrown";
      +            }
      +            lastId = null;
      +        });
      +
      +        return text + ";";
      +    }
      +};
      diff --git a/tools/eslint/lib/code-path-analysis/fork-context.js b/tools/eslint/lib/code-path-analysis/fork-context.js
      new file mode 100644
      index 00000000000000..af82e68e0c7d4f
      --- /dev/null
      +++ b/tools/eslint/lib/code-path-analysis/fork-context.js
      @@ -0,0 +1,264 @@
      +/**
      + * @fileoverview A class to operate forking.
      + *
      + * This is state of forking.
      + * This has a fork list and manages it.
      + *
      + * @author Toru Nagashima
      + * @copyright 2015 Toru Nagashima. All rights reserved.
      + * See LICENSE file in root directory for full license.
      + */
      +
      +"use strict";
      +
      +//------------------------------------------------------------------------------
      +// Requirements
      +//------------------------------------------------------------------------------
      +
      +var assert = require("assert"),
      +    CodePathSegment = require("./code-path-segment");
      +
      +//------------------------------------------------------------------------------
      +// Helpers
      +//------------------------------------------------------------------------------
      +
      +/**
      + * Gets whether or not a given segment is reachable.
      + *
      + * @param {CodePathSegment} segment - A segment to get.
      + * @returns {boolean} `true` if the segment is reachable.
      + */
      +function isReachable(segment) {
      +    return segment.reachable;
      +}
      +
      +/**
      + * Creates new segments from the specific range of `context.segmentsList`.
      + *
      + * When `context.segmentsList` is `[[a, b], [c, d], [e, f]]`, `begin` is `0`, and
      + * `end` is `-1`, this creates `[g, h]`. This `g` is from `a`, `c`, and `e`.
      + * This `h` is from `b`, `d`, and `f`.
      + *
      + * @param {ForkContext} context - An instance.
      + * @param {number} begin - The first index of the previous segments.
      + * @param {number} end - The last index of the previous segments.
      + * @param {function} create - A factory function of new segments.
      + * @returns {CodePathSegment[]} New segments.
      + */
      +function makeSegments(context, begin, end, create) {
      +    var list = context.segmentsList;
      +
      +    if (begin < 0) {
      +        begin = list.length + begin;
      +    }
      +    if (end < 0) {
      +        end = list.length + end;
      +    }
      +
      +    var segments = [];
      +
      +    for (var i = 0; i < context.count; ++i) {
      +        var allPrevSegments = [];
      +
      +        for (var j = begin; j <= end; ++j) {
      +            allPrevSegments.push(list[j][i]);
      +        }
      +
      +        segments.push(create(context.idGenerator.next(), allPrevSegments));
      +    }
      +
      +    return segments;
      +}
      +
      +/**
      + * `segments` becomes doubly in a `finally` block. Then if a code path exits by a
      + * control statement (such as `break`, `continue`) from the `finally` block, the
      + * destination's segments may be half of the source segments. In that case, this
      + * merges segments.
      + *
      + * @param {ForkContext} context - An instance.
      + * @param {CodePathSegment[]} segments - Segments to merge.
      + * @returns {CodePathSegment[]} The merged segments.
      + */
      +function mergeExtraSegments(context, segments) {
      +    while (segments.length > context.count) {
      +        var merged = [];
      +
      +        for (var i = 0, length = segments.length / 2 | 0; i < length; ++i) {
      +            merged.push(CodePathSegment.newNext(
      +                context.idGenerator.next(),
      +                [segments[i], segments[i + length]]
      +            ));
      +        }
      +        segments = merged;
      +    }
      +    return segments;
      +}
      +
      +//------------------------------------------------------------------------------
      +// Public Interface
      +//------------------------------------------------------------------------------
      +
      +/**
      + * A class to manage forking.
      + *
      + * @constructor
      + * @param {IdGenerator} idGenerator - An identifier generator for segments.
      + * @param {ForkContext|null} upper - An upper fork context.
      + * @param {number} count - A number of parallel segments.
      + */
      +function ForkContext(idGenerator, upper, count) {
      +    this.idGenerator = idGenerator;
      +    this.upper = upper;
      +    this.count = count;
      +    this.segmentsList = [];
      +}
      +
      +ForkContext.prototype = {
      +    constructor: ForkContext,
      +
      +    /**
      +     * The head segments.
      +     * @type {CodePathSegment[]}
      +     */
      +    get head() {
      +        var list = this.segmentsList;
      +
      +        return list.length === 0 ? [] : list[list.length - 1];
      +    },
      +
      +    /**
      +     * A flag which shows empty.
      +     * @type {boolean}
      +     */
      +    get empty() {
      +        return this.segmentsList.length === 0;
      +    },
      +
      +    /**
      +     * A flag which shows reachable.
      +     * @type {boolean}
      +     */
      +    get reachable() {
      +        var segments = this.head;
      +
      +        return segments.length > 0 && segments.some(isReachable);
      +    },
      +
      +    /**
      +     * Creates new segments from this context.
      +     *
      +     * @param {number} begin - The first index of previous segments.
      +     * @param {number} end - The last index of previous segments.
      +     * @returns {CodePathSegment[]} New segments.
      +     */
      +    makeNext: function(begin, end) {
      +        return makeSegments(this, begin, end, CodePathSegment.newNext);
      +    },
      +
      +    /**
      +     * Creates new segments from this context.
      +     * The new segments is always unreachable.
      +     *
      +     * @param {number} begin - The first index of previous segments.
      +     * @param {number} end - The last index of previous segments.
      +     * @returns {CodePathSegment[]} New segments.
      +     */
      +    makeUnreachable: function(begin, end) {
      +        return makeSegments(this, begin, end, CodePathSegment.newUnreachable);
      +    },
      +
      +    /**
      +     * Creates new segments from this context.
      +     * The new segments don't have connections for previous segments.
      +     * But these inherit the reachable flag from this context.
      +     *
      +     * @param {number} begin - The first index of previous segments.
      +     * @param {number} end - The last index of previous segments.
      +     * @returns {CodePathSegment[]} New segments.
      +     */
      +    makeDisconnected: function(begin, end) {
      +        return makeSegments(this, begin, end, CodePathSegment.newDisconnected);
      +    },
      +
      +    /**
      +     * Adds segments into this context.
      +     * The added segments become the head.
      +     *
      +     * @param {CodePathSegment[]} segments - Segments to add.
      +     * @returns {void}
      +     */
      +    add: function(segments) {
      +        assert(segments.length >= this.count, segments.length + " >= " + this.count);
      +
      +        this.segmentsList.push(mergeExtraSegments(this, segments));
      +    },
      +
      +    /**
      +     * Replaces the head segments with given segments.
      +     * The current head segments are removed.
      +     *
      +     * @param {CodePathSegment[]} segments - Segments to add.
      +     * @returns {void}
      +     */
      +    replaceHead: function(segments) {
      +        assert(segments.length >= this.count, segments.length + " >= " + this.count);
      +
      +        this.segmentsList.splice(-1, 1, mergeExtraSegments(this, segments));
      +    },
      +
      +    /**
      +     * Adds all segments of a given fork context into this context.
      +     *
      +     * @param {ForkContext} context - A fork context to add.
      +     * @returns {void}
      +     */
      +    addAll: function(context) {
      +        assert(context.count === this.count);
      +
      +        var source = context.segmentsList;
      +
      +        for (var i = 0; i < source.length; ++i) {
      +            this.segmentsList.push(source[i]);
      +        }
      +    },
      +
      +    /**
      +     * Clears all secments in this context.
      +     *
      +     * @returns {void}
      +     */
      +    clear: function() {
      +        this.segmentsList = [];
      +    }
      +};
      +
      +/**
      + * Creates the root fork context.
      + *
      + * @param {IdGenerator} idGenerator - An identifier generator for segments.
      + * @returns {ForkContext} New fork context.
      + */
      +ForkContext.newRoot = function(idGenerator) {
      +    var context = new ForkContext(idGenerator, null, 1);
      +
      +    context.add([CodePathSegment.newRoot(idGenerator.next())]);
      +
      +    return context;
      +};
      +
      +/**
      + * Creates an empty fork context preceded by a given context.
      + *
      + * @param {ForkContext} parentContext - The parent fork context.
      + * @param {boolean} forkLeavingPath - A flag which shows inside of `finally` block.
      + * @returns {ForkContext} New fork context.
      + */
      +ForkContext.newEmpty = function(parentContext, forkLeavingPath) {
      +    return new ForkContext(
      +        parentContext.idGenerator,
      +        parentContext,
      +        (forkLeavingPath ? 2 : 1) * parentContext.count);
      +};
      +
      +module.exports = ForkContext;
      diff --git a/tools/eslint/lib/code-path-analysis/id-generator.js b/tools/eslint/lib/code-path-analysis/id-generator.js
      new file mode 100644
      index 00000000000000..530ea95844593e
      --- /dev/null
      +++ b/tools/eslint/lib/code-path-analysis/id-generator.js
      @@ -0,0 +1,45 @@
      +/**
      + * @fileoverview A class of identifiers generator for code path segments.
      + *
      + * Each rule uses the identifier of code path segments to store additional
      + * information of the code path.
      + *
      + * @author Toru Nagashima
      + * @copyright 2015 Toru Nagashima. All rights reserved.
      + * See LICENSE file in root directory for full license.
      + */
      +
      +"use strict";
      +
      +//------------------------------------------------------------------------------
      +// Public Interface
      +//------------------------------------------------------------------------------
      +
      +/**
      + * A generator for unique ids.
      + *
      + * @constructor
      + * @param {string} prefix - Optional. A prefix of generated ids.
      + */
      +function IdGenerator(prefix) {
      +    this.prefix = String(prefix);
      +    this.n = 0;
      +}
      +
      +/**
      + * Generates id.
      + *
      + * @returns {string} A generated id.
      + */
      +IdGenerator.prototype.next = function() {
      +    this.n = 1 + this.n | 0;
      +
      +    /* istanbul ignore if */
      +    if (this.n < 0) {
      +        this.n = 1;
      +    }
      +
      +    return this.prefix + this.n;
      +};
      +
      +module.exports = IdGenerator;
      diff --git a/tools/eslint/lib/config-initializer.js b/tools/eslint/lib/config-initializer.js
      deleted file mode 100644
      index 56723cd5baf442..00000000000000
      --- a/tools/eslint/lib/config-initializer.js
      +++ /dev/null
      @@ -1,145 +0,0 @@
      -/**
      - * @fileoverview Config initialization wizard.
      - * @author Ilya Volodin
      - * @copyright 2015 Ilya Volodin. All rights reserved.
      - */
      -
      -"use strict";
      -
      -var exec = require("child_process").exec,
      -    fs = require("fs"),
      -    inquirer = require("inquirer"),
      -    yaml = require("js-yaml");
      -
      -/* istanbul ignore next: hard to test fs function */
      -/**
      - * Create .eslintrc file in the current working directory
      - * @param {object} config object that contains user's answers
      - * @param {bool} isJson should config file be json or yaml
      - * @param {function} callback function to call once the file is written.
      - * @returns {void}
      - */
      -function writeFile(config, isJson, callback) {
      -    try {
      -        fs.writeFileSync("./.eslintrc", isJson ? JSON.stringify(config, null, 4) : yaml.safeDump(config));
      -    } catch (e) {
      -        callback(e);
      -        return;
      -    }
      -    if (config.plugins && config.plugins.indexOf("react") >= 0) {
      -        exec("npm i eslint-plugin-react --save-dev", callback);
      -    } else {
      -        callback();
      -    }
      -}
      -
      -/**
      - * process user's answers and create config object
      - * @param {object} answers answers received from inquirer
      - * @returns {object} config object
      - */
      -function processAnswers(answers) {
      -    var config = {rules: {}, env: {}};
      -    config.rules.indent = [2, answers.indent];
      -    config.rules.quotes = [2, answers.quotes];
      -    config.rules["linebreak-style"] = [2, answers.linebreak];
      -    config.rules.semi = [2, answers.semi ? "always" : "never"];
      -    if (answers.es6) {
      -        config.env.es6 = true;
      -    }
      -    answers.env.forEach(function(env) {
      -        config.env[env] = true;
      -    });
      -    if (answers.jsx) {
      -        config.ecmaFeatures = {jsx: true};
      -        if (answers.react) {
      -            config.plugins = ["react"];
      -        }
      -    }
      -    return config;
      -}
      -
      -/* istanbul ignore next: no need to test inquirer*/
      -/**
      - * Ask use a few questions on command prompt
      - * @param {function} callback callback function when file has been written
      - * @returns {void}
      - */
      -function promptUser(callback) {
      -    inquirer.prompt([
      -        {
      -            type: "list",
      -            name: "indent",
      -            message: "What style of indentation do you use?",
      -            default: "tabs",
      -            choices: [{name: "Tabs", value: "tab"}, {name: "Spaces", value: 4}]
      -        },
      -        {
      -            type: "list",
      -            name: "quotes",
      -            message: "What quotes do you use for strings?",
      -            default: "double",
      -            choices: [{name: "Double", value: "double"}, {name: "Single", value: "single"}]
      -        },
      -        {
      -            type: "list",
      -            name: "linebreak",
      -            message: "What line endings do you use?",
      -            default: "unix",
      -            choices: [{name: "Unix", value: "unix"}, {name: "Windows", value: "windows"}]
      -        },
      -        {
      -            type: "confirm",
      -            name: "semi",
      -            message: "Do you require semicolons?",
      -            default: true
      -        },
      -        {
      -            type: "confirm",
      -            name: "es6",
      -            message: "Are you using ECMAScript 6 features?",
      -            default: false
      -        },
      -        {
      -            type: "checkbox",
      -            name: "env",
      -            message: "Where will your code run?",
      -            default: ["browser"],
      -            choices: [{name: "Node", value: "node"}, {name: "Browser", value: "browser"}]
      -        },
      -        {
      -            type: "confirm",
      -            name: "jsx",
      -            message: "Do you use JSX?",
      -            default: false
      -        },
      -        {
      -            type: "confirm",
      -            name: "react",
      -            message: "Do you use React",
      -            default: false,
      -            when: function (answers) {
      -                return answers.jsx;
      -            }
      -        },
      -        {
      -            type: "list",
      -            name: "format",
      -            message: "What format do you want your config file to be in?",
      -            default: "JSON",
      -            choices: ["JSON", "YAML"]
      -        }
      -    ], function(answers) {
      -        var config = processAnswers(answers);
      -        writeFile(config, answers.format === "JSON", callback);
      -    });
      -}
      -
      -var init = {
      -    processAnswers: processAnswers,
      -    initializeConfig: /* istanbul ignore next */ function(callback) {
      -        promptUser(callback);
      -    }
      -};
      -
      -module.exports = init;
      diff --git a/tools/eslint/lib/config-validator.js b/tools/eslint/lib/config-validator.js
      deleted file mode 100644
      index cece433c7cce00..00000000000000
      --- a/tools/eslint/lib/config-validator.js
      +++ /dev/null
      @@ -1,110 +0,0 @@
      -/**
      - * @fileoverview Validates configs.
      - * @author Brandon Mills
      - * @copyright 2015 Brandon Mills
      - */
      -
      -"use strict";
      -
      -var rules = require("./rules"),
      -    schemaValidator = require("is-my-json-valid");
      -
      -var validators = {
      -    rules: Object.create(null)
      -};
      -
      -/**
      - * Gets a complete options schema for a rule.
      - * @param {string} id The rule's unique name.
      - * @returns {object} JSON Schema for the rule's options.
      - */
      -function getRuleOptionsSchema(id) {
      -    var rule = rules.get(id),
      -        schema = rule && rule.schema;
      -
      -    if (!schema) {
      -        return {
      -            "type": "array",
      -            "items": [
      -                {
      -                    "enum": [0, 1, 2]
      -                }
      -            ],
      -            "minItems": 1
      -        };
      -    }
      -
      -    // Given a tuple of schemas, insert warning level at the beginning
      -    if (Array.isArray(schema)) {
      -        return {
      -            "type": "array",
      -            "items": [
      -                {
      -                    "enum": [0, 1, 2]
      -                }
      -            ].concat(schema),
      -            "minItems": 1,
      -            "maxItems": schema.length + 1
      -        };
      -    }
      -
      -    // Given a full schema, leave it alone
      -    return schema;
      -}
      -
      -/**
      - * Validates a rule's options against its schema.
      - * @param {string} id The rule's unique name.
      - * @param {array|number} options The given options for the rule.
      - * @param {string} source The name of the configuration source.
      - * @returns {void}
      - */
      -function validateRuleOptions(id, options, source) {
      -    var validateRule = validators.rules[id],
      -        message;
      -
      -    if (!validateRule) {
      -        validateRule = schemaValidator(getRuleOptionsSchema(id), { verbose: true });
      -        validators.rules[id] = validateRule;
      -    }
      -
      -    if (typeof options === "number") {
      -        options = [options];
      -    }
      -
      -    validateRule(options);
      -
      -    if (validateRule.errors) {
      -        message = [
      -            source, ":\n",
      -            "\tConfiguration for rule \"", id, "\" is invalid:\n"
      -        ];
      -        validateRule.errors.forEach(function (error) {
      -            message.push(
      -                "\tValue \"", error.value, "\" ", error.message, ".\n"
      -            );
      -        });
      -
      -        throw new Error(message.join(""));
      -    }
      -}
      -
      -/**
      - * Validates an entire config object.
      - * @param {object} config The config object to validate.
      - * @param {string} source The location to report with any errors.
      - * @returns {void}
      - */
      -function validate(config, source) {
      -    if (typeof config.rules === "object") {
      -        Object.keys(config.rules).forEach(function (id) {
      -            validateRuleOptions(id, config.rules[id], source);
      -        });
      -    }
      -}
      -
      -module.exports = {
      -    getRuleOptionsSchema: getRuleOptionsSchema,
      -    validate: validate,
      -    validateRuleOptions: validateRuleOptions
      -};
      diff --git a/tools/eslint/lib/config.js b/tools/eslint/lib/config.js
      index a4f8d0e87cd011..cf14717d4f617d 100644
      --- a/tools/eslint/lib/config.js
      +++ b/tools/eslint/lib/config.js
      @@ -1,9 +1,10 @@
       /**
        * @fileoverview Responsible for loading config files
        * @author Seth McLaughlin
      - * @copyright 2014 Nicholas C. Zakas. All rights reserved.
      - * @copyright 2013 Seth McLaughlin. All rights reserved.
      + * @copyright 2014-2016 Nicholas C. Zakas. All rights reserved.
        * @copyright 2014 Michael McLaughlin. All rights reserved.
      + * @copyright 2013 Seth McLaughlin. All rights reserved.
      + * See LICENSE in root directory for full license.
        */
       "use strict";
       
      @@ -11,33 +12,21 @@
       // Requirements
       //------------------------------------------------------------------------------
       
      -var fs = require("fs"),
      -    path = require("path"),
      -    environments = require("../conf/environments"),
      -    util = require("./util"),
      +var path = require("path"),
      +    ConfigOps = require("./config/config-ops"),
      +    ConfigFile = require("./config/config-file"),
      +    Plugins = require("./config/plugins"),
           FileFinder = require("./file-finder"),
      -    stripComments = require("strip-json-comments"),
      -    assign = require("object-assign"),
           debug = require("debug"),
      -    yaml = require("js-yaml"),
           userHome = require("user-home"),
      -    isAbsolutePath = require("path-is-absolute"),
      -    validator = require("./config-validator");
      +    isResolvable = require("is-resolvable"),
      +    pathIsInside = require("path-is-inside");
       
       //------------------------------------------------------------------------------
       // Constants
       //------------------------------------------------------------------------------
       
      -var LOCAL_CONFIG_FILENAME = ".eslintrc",
      -    PACKAGE_CONFIG_FILENAME = "package.json",
      -    PACKAGE_CONFIG_FIELD_NAME = "eslintConfig",
      -    PERSONAL_CONFIG_PATH = userHome ? path.join(userHome, LOCAL_CONFIG_FILENAME) : null;
      -
      -//------------------------------------------------------------------------------
      -// Private
      -//------------------------------------------------------------------------------
      -
      -var loadedPlugins = Object.create(null);
      +var PERSONAL_CONFIG_DIR = userHome || null;
       
       //------------------------------------------------------------------------------
       // Helpers
      @@ -46,155 +35,62 @@ var loadedPlugins = Object.create(null);
       debug = debug("eslint:config");
       
       /**
      - * Determines if a given string represents a filepath or not using the same
      - * conventions as require(), meaning that the first character must be nonalphanumeric
      - * and not the @ sign which is used for scoped packages to be considered a file path.
      - * @param {string} filePath The string to check.
      - * @returns {boolean} True if it's a filepath, false if not.
      + * Check if item is an javascript object
      + * @param {*} item object to check for
      + * @returns {boolean} True if its an object
        * @private
        */
      -function isFilePath(filePath) {
      -    return isAbsolutePath(filePath) || !/\w|@/.test(filePath[0]);
      +function isObject(item) {
      +    return typeof item === "object" && !Array.isArray(item) && item !== null;
       }
       
       /**
        * Load and parse a JSON config object from a file.
      - * @param {string} filePath the path to the JSON config file
      + * @param {string|Object} configToLoad the path to the JSON config file or the config object itself.
        * @returns {Object} the parsed config object (empty object if there was a parse error)
        * @private
        */
      -function loadConfig(filePath) {
      -    var config = {};
      -
      -    if (filePath) {
      -
      -        if (isFilePath(filePath)) {
      -            try {
      -                config = yaml.safeLoad(stripComments(fs.readFileSync(filePath, "utf8"))) || {};
      -            } catch (e) {
      -                debug("Error reading YAML file: " + filePath);
      -                e.message = "Cannot read config file: " + filePath + "\nError: " + e.message;
      -                throw e;
      -            }
      -
      -            if (path.basename(filePath) === PACKAGE_CONFIG_FILENAME) {
      -                config = config[PACKAGE_CONFIG_FIELD_NAME] || {};
      -            }
      -
      -        } else {
      -
      -            // it's a package
      -            if (filePath.indexOf("eslint-config-") === -1) {
      -                if (filePath.indexOf("@") === 0) {
      -                    // for scoped packages, insert the eslint-config after the first /
      -                    filePath = filePath.replace(/^([^\/]+\/)(.*)$/, "$1eslint-config-$2");
      -                } else {
      -                    filePath = "eslint-config-" + filePath;
      -                }
      -            }
      -
      -            config = util.mergeConfigs(config, require(filePath));
      -        }
      +function loadConfig(configToLoad) {
      +    var config = {},
      +        filePath = "";
       
      -        validator.validate(config, filePath);
      +    if (configToLoad) {
       
      -        // If an `extends` property is defined, it represents a configuration file to use as
      -        // a "parent". Load the referenced file and merge the configuration recursively.
      -        if (config.extends) {
      -            var configExtends = config.extends;
      +        if (isObject(configToLoad)) {
      +            config = configToLoad;
       
      -            if (!Array.isArray(config.extends)) {
      -                configExtends = [config.extends];
      +            if (config.extends) {
      +                config = ConfigFile.applyExtends(config, filePath);
                   }
      -
      -            // Make the last element in an array take the highest precedence
      -            config = configExtends.reduceRight(function (previousValue, parentPath) {
      -
      -                if (isFilePath(parentPath)) {
      -                    // If the `extends` path is relative, use the directory of the current configuration
      -                    // file as the reference point. Otherwise, use as-is.
      -                    parentPath = (!isAbsolutePath(parentPath) ?
      -                        path.join(path.dirname(filePath), parentPath) :
      -                        parentPath
      -                    );
      -                }
      -
      -                try {
      -                    return util.mergeConfigs(loadConfig(parentPath), previousValue);
      -                } catch (e) {
      -                    // If the file referenced by `extends` failed to load, add the path to the
      -                    // configuration file that referenced it to the error message so the user is
      -                    // able to see where it was referenced from, then re-throw
      -                    e.message += "\nReferenced from: " + filePath;
      -                    throw e;
      -                }
      -
      -            }, config);
      -
      +        } else {
      +            filePath = configToLoad;
      +            config = ConfigFile.load(filePath);
               }
       
      -
           }
       
      -
           return config;
       }
       
      -/**
      - * Load configuration for all plugins provided.
      - * @param {string[]} pluginNames An array of plugin names which should be loaded.
      - * @returns {Object} all plugin configurations merged together
      - */
      -function getPluginsConfig(pluginNames) {
      -    var pluginConfig = {};
      -
      -    pluginNames.forEach(function (pluginName) {
      -        var pluginNamespace = util.getNamespace(pluginName),
      -            pluginNameWithoutNamespace = util.removeNameSpace(pluginName),
      -            pluginNameWithoutPrefix = util.removePluginPrefix(pluginNameWithoutNamespace),
      -            plugin = {},
      -            rules = {};
      -
      -        if (!loadedPlugins[pluginNameWithoutPrefix]) {
      -            try {
      -                plugin = require(pluginNamespace + util.PLUGIN_NAME_PREFIX + pluginNameWithoutPrefix);
      -                loadedPlugins[pluginNameWithoutPrefix] = plugin;
      -            } catch(err) {
      -                debug("Failed to load plugin configuration for " + pluginNameWithoutPrefix + ". Proceeding without it.");
      -                plugin = { rulesConfig: {}};
      -            }
      -        } else {
      -            plugin = loadedPlugins[pluginNameWithoutPrefix];
      -        }
      -
      -        if (!plugin.rulesConfig) {
      -            plugin.rulesConfig = {};
      -        }
      -
      -        Object.keys(plugin.rulesConfig).forEach(function(item) {
      -            rules[pluginNameWithoutPrefix + "/" + item] = plugin.rulesConfig[item];
      -        });
      -
      -        pluginConfig = util.mergeConfigs(pluginConfig, rules);
      -    });
      -
      -    return {rules: pluginConfig};
      -}
      -
       /**
        * Get personal config object from ~/.eslintrc.
        * @returns {Object} the personal config object (empty object if there is no personal config)
        * @private
        */
       function getPersonalConfig() {
      -    var config = {};
      +    var config,
      +        filename;
      +
      +    if (PERSONAL_CONFIG_DIR) {
      +        filename = ConfigFile.getFilenameForDirectory(PERSONAL_CONFIG_DIR);
       
      -    if (PERSONAL_CONFIG_PATH && fs.existsSync(PERSONAL_CONFIG_PATH)) {
      -        debug("Using personal config");
      -        config = loadConfig(PERSONAL_CONFIG_PATH);
      +        if (filename) {
      +            debug("Using personal config");
      +            config = loadConfig(filename);
      +        }
           }
       
      -    return config;
      +    return config || {};
       }
       
       /**
      @@ -210,76 +106,45 @@ function getLocalConfig(thisConfig, directory) {
               localConfigFile,
               config = {},
               localConfigFiles = thisConfig.findLocalConfigFiles(directory),
      -        numFiles = localConfigFiles.length;
      +        numFiles = localConfigFiles.length,
      +        rootPath,
      +        projectConfigPath = ConfigFile.getFilenameForDirectory(thisConfig.options.cwd);
       
           for (i = 0; i < numFiles; i++) {
       
               localConfigFile = localConfigFiles[i];
       
      -        // Don't consider the personal config file in the home directory.
      -        if (localConfigFile === PERSONAL_CONFIG_PATH) {
      +        // Don't consider the personal config file in the home directory,
      +        // except if the home directory is the same as the current working directory
      +        if (path.dirname(localConfigFile) === PERSONAL_CONFIG_DIR && localConfigFile !== projectConfigPath) {
      +            continue;
      +        }
      +
      +        // If root flag is set, don't consider file if it is above root
      +        if (rootPath && !pathIsInside(path.dirname(localConfigFile), rootPath)) {
                   continue;
               }
       
               debug("Loading " + localConfigFile);
               localConfig = loadConfig(localConfigFile);
       
      -        // Don't consider a local config file found if the config is empty.
      -        if (!Object.keys(localConfig).length) {
      +        // Don't consider a local config file found if the config is null
      +        if (!localConfig) {
                   continue;
               }
       
      +        // Check for root flag
      +        if (localConfig.root === true) {
      +            rootPath = path.dirname(localConfigFile);
      +        }
      +
               found = true;
               debug("Using " + localConfigFile);
      -        config = util.mergeConfigs(localConfig, config);
      +        config = ConfigOps.merge(localConfig, config);
           }
       
           // Use the personal config file if there are no other local config files found.
      -    return found ? config : util.mergeConfigs(config, getPersonalConfig());
      -}
      -
      -/**
      - * Creates an environment config based on the specified environments.
      - * @param {Object} envs The environment settings.
      - * @param {boolean} reset The value of the command line reset option. If true,
      - *      rules are not automatically merged into the config.
      - * @returns {Object} A configuration object with the appropriate rules and globals
      - *      set.
      - * @private
      - */
      -function createEnvironmentConfig(envs, reset) {
      -
      -    var envConfig = {
      -        globals: {},
      -        env: envs || {},
      -        rules: {},
      -        ecmaFeatures: {}
      -    };
      -
      -    if (envs) {
      -        Object.keys(envs).filter(function (name) {
      -            return envs[name];
      -        }).forEach(function(name) {
      -            var environment = environments[name];
      -
      -            if (environment) {
      -
      -                if (!reset && environment.rules) {
      -                    assign(envConfig.rules, environment.rules);
      -                }
      -
      -                if (environment.globals) {
      -                    assign(envConfig.globals, environment.globals);
      -                }
      -
      -                if (environment.ecmaFeatures) {
      -                    assign(envConfig.ecmaFeatures, environment.ecmaFeatures);
      -                }
      -            }
      -        });
      -    }
      -
      -    return envConfig;
      +    return found || thisConfig.useSpecificConfig ? config : ConfigOps.merge(config, getPersonalConfig());
       }
       
       //------------------------------------------------------------------------------
      @@ -291,7 +156,6 @@ function createEnvironmentConfig(envs, reset) {
        * @constructor
        * @class Config
        * @param {Object} options Options to be passed in
      - * @param {string} [cwd] current working directory. Defaults to process.cwd()
        */
       function Config(options) {
           var useConfig;
      @@ -301,29 +165,29 @@ function Config(options) {
           this.ignore = options.ignore;
           this.ignorePath = options.ignorePath;
           this.cache = {};
      +    this.parser = options.parser;
      +    this.parserOptions = options.parserOptions || {};
       
      -    if (options.reset || options.baseConfig === false) {
      -        // If `options.reset` is truthy or `options.baseConfig` is set to `false`,
      -        // disable all default rules and environments
      -        this.baseConfig = { rules: {} };
      -    } else {
      -        // If `options.baseConfig` is an object, just use it,
      -        // otherwise use default base config from `conf/eslint.json`
      -        this.baseConfig = options.baseConfig ||
      -                require(path.resolve(__dirname, "..", "conf", "eslint.json"));
      -    }
      +    this.baseConfig = options.baseConfig ? loadConfig(options.baseConfig) : { rules: {} };
       
           this.useEslintrc = (options.useEslintrc !== false);
       
      -    this.env = (options.envs || []).reduce(function (envs, name) {
      +    this.env = (options.envs || []).reduce(function(envs, name) {
               envs[name] = true;
               return envs;
           }, {});
       
      -    this.globals = (options.globals || []).reduce(function (globals, def) {
      -        // Default "foo" to false and handle "foo:false" and "foo:true"
      +    /*
      +     * Handle declared globals.
      +     * For global variable foo, handle "foo:false" and "foo:true" to set
      +     * whether global is writable.
      +     * If user declares "foo", convert to "foo:false".
      +     */
      +    this.globals = (options.globals || []).reduce(function(globals, def) {
               var parts = def.split(":");
      +
               globals[parts[0]] = (parts.length > 1 && parts[1] === "true");
      +
               return globals;
           }, {});
       
      @@ -332,7 +196,11 @@ function Config(options) {
       
           if (useConfig) {
               debug("Using command line config " + useConfig);
      -        this.useSpecificConfig = loadConfig(path.resolve(process.cwd(), useConfig));
      +        if (isResolvable(useConfig) || isResolvable("eslint-config-" + useConfig) || useConfig.charAt(0) === "@") {
      +            this.useSpecificConfig = loadConfig(useConfig);
      +        } else {
      +            this.useSpecificConfig = loadConfig(path.resolve(this.options.cwd, useConfig));
      +        }
           }
       }
       
      @@ -342,11 +210,10 @@ function Config(options) {
        * @param {string} filePath a file in whose directory we start looking for a local config
        * @returns {Object} config object
        */
      -Config.prototype.getConfig = function (filePath) {
      +Config.prototype.getConfig = function(filePath) {
           var config,
               userConfig,
      -        directory = filePath ? path.dirname(filePath) : process.cwd(),
      -        pluginConfig;
      +        directory = filePath ? path.dirname(filePath) : this.options.cwd;
       
           debug("Constructing config for " + (filePath ? filePath : "text"));
       
      @@ -357,7 +224,7 @@ Config.prototype.getConfig = function (filePath) {
               return config;
           }
       
      -    // Step 1: Determine user-specified config from .eslintrc and package.json files
      +    // Step 1: Determine user-specified config from .eslintrc.* and package.json files
           if (this.useEslintrc) {
               debug("Using .eslintrc and package.json files");
               userConfig = getLocalConfig(this, directory);
      @@ -367,43 +234,41 @@ Config.prototype.getConfig = function (filePath) {
           }
       
           // Step 2: Create a copy of the baseConfig
      -    config = util.mergeConfigs({}, this.baseConfig);
      -
      -    // Step 3: Merge in environment-specific globals and rules from .eslintrc files
      -    config = util.mergeConfigs(config, createEnvironmentConfig(userConfig.env, this.options.reset));
      +    config = ConfigOps.merge({parser: this.parser, parserOptions: this.parserOptions}, this.baseConfig);
       
      -    // Step 4: Merge in the user-specified configuration from .eslintrc and package.json
      -    config = util.mergeConfigs(config, userConfig);
      +    // Step 3: Merge in the user-specified configuration from .eslintrc and package.json
      +    config = ConfigOps.merge(config, userConfig);
       
      -    // Step 5: Merge in command line config file
      +    // Step 4: Merge in command line config file
           if (this.useSpecificConfig) {
               debug("Merging command line config file");
       
      -        if (this.useSpecificConfig.env) {
      -            config = util.mergeConfigs(config, createEnvironmentConfig(this.useSpecificConfig.env, this.options.reset));
      -        }
      -
      -        config = util.mergeConfigs(config, this.useSpecificConfig);
      +        config = ConfigOps.merge(config, this.useSpecificConfig);
           }
       
      -    // Step 6: Merge in command line environments
      +    // Step 5: Merge in command line environments
           debug("Merging command line environment settings");
      -    config = util.mergeConfigs(config, createEnvironmentConfig(this.env, this.options.reset));
      +    config = ConfigOps.merge(config, { env: this.env });
       
      -    // Step 7: Merge in command line rules
      +    // Step 6: Merge in command line rules
           if (this.options.rules) {
               debug("Merging command line rules");
      -        config = util.mergeConfigs(config, { rules: this.options.rules });
      +        config = ConfigOps.merge(config, { rules: this.options.rules });
           }
       
      -    // Step 8: Merge in command line globals
      -    config = util.mergeConfigs(config, { globals: this.globals });
      +    // Step 7: Merge in command line globals
      +    config = ConfigOps.merge(config, { globals: this.globals });
       
      +    // Step 8: Merge in command line plugins
      +    if (this.options.plugins) {
      +        debug("Merging command line plugins");
      +        Plugins.loadAll(this.options.plugins);
      +        config = ConfigOps.merge(config, { plugins: this.options.plugins });
      +    }
       
      -    // Step 9: Merge in plugin specific rules in reverse
      -    if (config.plugins) {
      -        pluginConfig = getPluginsConfig(config.plugins);
      -        config = util.mergeConfigs(pluginConfig, config);
      +    // Step 9: Apply environments to the config if present
      +    if (config.env) {
      +        config = ConfigOps.applyEnvironments(config);
           }
       
           this.cache[directory] = config;
      @@ -416,10 +281,10 @@ Config.prototype.getConfig = function (filePath) {
        * @param {string} directory The directory to start searching from.
        * @returns {string[]} The paths of local config files found.
        */
      -Config.prototype.findLocalConfigFiles = function (directory) {
      +Config.prototype.findLocalConfigFiles = function(directory) {
       
           if (!this.localConfigFinder) {
      -        this.localConfigFinder = new FileFinder(LOCAL_CONFIG_FILENAME, PACKAGE_CONFIG_FILENAME);
      +        this.localConfigFinder = new FileFinder(ConfigFile.CONFIG_FILES, this.options.cwd);
           }
       
           return this.localConfigFinder.findAllInDirectoryAndParents(directory);
      diff --git a/tools/eslint/lib/config/autoconfig.js b/tools/eslint/lib/config/autoconfig.js
      new file mode 100644
      index 00000000000000..ccb9f1a2fe7e2b
      --- /dev/null
      +++ b/tools/eslint/lib/config/autoconfig.js
      @@ -0,0 +1,368 @@
      +/**
      + * @fileoverview Used for creating a suggested configuration based on project code.
      + * @author Ian VanSchooten
      + * @copyright 2015 Ian VanSchooten. All rights reserved.
      + * See LICENSE in root directory for full license.
      + */
      +
      +"use strict";
      +
      +//------------------------------------------------------------------------------
      +// Requirements
      +//------------------------------------------------------------------------------
      +
      +var lodash = require("lodash"),
      +    debug = require("debug"),
      +    eslint = require("../eslint"),
      +    configRule = require("./config-rule"),
      +    ConfigOps = require("./config-ops"),
      +    recConfig = require("../../conf/eslint.json");
      +
      +//------------------------------------------------------------------------------
      +// Data
      +//------------------------------------------------------------------------------
      +
      +var MAX_CONFIG_COMBINATIONS = 17, // 16 combinations + 1 for severity only
      +    RECOMMENDED_CONFIG_NAME = "eslint:recommended";
      +
      +//------------------------------------------------------------------------------
      +// Private
      +//------------------------------------------------------------------------------
      +
      +debug = debug("eslint:autoconfig");
      +
      +/**
      + * Information about a rule configuration, in the context of a Registry.
      + *
      + * @typedef {Object}     registryItem
      + * @param   {ruleConfig} config        A valid configuration for the rule
      + * @param   {number}     specificity   The number of elements in the ruleConfig array
      + * @param   {number}     errorCount    The number of errors encountered when linting with the config
      + */
      +
      + /**
      +  * This callback is used to measure execution status in a progress bar
      +  * @callback progressCallback
      +  * @param {number} The total number of times the callback will be called.
      +  */
      +
      +/**
      + * Create registryItems for rules
      + * @param   {rulesConfig} rulesConfig Hash of rule names and arrays of ruleConfig items
      + * @returns {Object}                  registryItems for each rule in provided rulesConfig
      + */
      +function makeRegistryItems(rulesConfig) {
      +    return Object.keys(rulesConfig).reduce(function(accumulator, ruleId) {
      +        accumulator[ruleId] = rulesConfig[ruleId].map(function(config) {
      +            return {
      +                config: config,
      +                specificity: config.length || 1,
      +                errorCount: void 0
      +            };
      +        });
      +        return accumulator;
      +    }, {});
      +}
      +
      +/**
      +* Creates an object in which to store rule configs and error counts
      +*
      +* Unless a rulesConfig is provided at construction, the registry will not contain
      +* any rules, only methods.  This will be useful for building up registries manually.
      +*
      +* @constructor
      +* @class   Registry
      +* @param   {rulesConfig} [rulesConfig] Hash of rule names and arrays of possible configurations
      +*/
      +function Registry(rulesConfig) {
      +    this.rules = (rulesConfig) ? makeRegistryItems(rulesConfig) : {};
      +}
      +
      +Registry.prototype = {
      +
      +    constructor: Registry,
      +
      +    /**
      +     * Populate the registry with core rule configs.
      +     *
      +     * It will set the registry's `rule` property to an object having rule names
      +     * as keys and an array of registryItems as values.
      +     *
      +     * @returns {void}
      +     */
      +    populateFromCoreRules: function() {
      +        var rulesConfig = configRule.createCoreRuleConfigs();
      +
      +        this.rules = makeRegistryItems(rulesConfig);
      +    },
      +
      +    /**
      +     * Creates sets of rule configurations which can be used for linting
      +     * and initializes registry errors to zero for those configurations (side effect).
      +     *
      +     * This combines as many rules together as possible, such that the first sets
      +     * in the array will have the highest number of rules configured, and later sets
      +     * will have fewer and fewer, as not all rules have the same number of possible
      +     * configurations.
      +     *
      +     * The length of the returned array will be <= MAX_CONFIG_COMBINATIONS.
      +     *
      +     * @param   {Object}   registry The autoconfig registry
      +     * @returns {Object[]}          "rules" configurations to use for linting
      +     */
      +    buildRuleSets: function() {
      +        var idx = 0,
      +            ruleIds = Object.keys(this.rules),
      +            ruleSets = [];
      +
      +        /**
      +         * Add a rule configuration from the registry to the ruleSets
      +         *
      +         * This is broken out into its own function so that it doesn't need to be
      +         * created inside of the while loop.
      +         *
      +         * @param   {string} rule The ruleId to add.
      +         * @returns {void}
      +         */
      +        var addRuleToRuleSet = function(rule) {
      +
      +            /*
      +             * This check ensures that there is a rule configuration and that
      +             * it has fewer than the max combinations allowed.
      +             * If it has too many configs, we will only use the most basic of
      +             * the possible configurations.
      +             */
      +            var hasFewCombos = (this.rules[rule].length <= MAX_CONFIG_COMBINATIONS);
      +
      +            if (this.rules[rule][idx] && (hasFewCombos || this.rules[rule][idx].specificity <= 2)) {
      +
      +                /*
      +                 * If the rule has too many possible combinations, only take
      +                 * simple ones, avoiding objects.
      +                 */
      +                if (!hasFewCombos && typeof this.rules[rule][idx].config[1] === "object") {
      +                    return;
      +                }
      +
      +                ruleSets[idx] = ruleSets[idx] || {};
      +                ruleSets[idx][rule] = this.rules[rule][idx].config;
      +
      +                /*
      +                 * Initialize errorCount to zero, since this is a config which
      +                 * will be linted.
      +                 */
      +                this.rules[rule][idx].errorCount = 0;
      +            }
      +        }.bind(this);
      +
      +        while (ruleSets.length === idx) {
      +            ruleIds.forEach(addRuleToRuleSet);
      +            idx += 1;
      +        }
      +
      +        return ruleSets;
      +    },
      +
      +    /**
      +     * Remove all items from the registry with a non-zero number of errors
      +     *
      +     * Note: this also removes rule configurations which were not linted
      +     * (meaning, they have an undefined errorCount).
      +     *
      +     * @returns {void}
      +     */
      +    stripFailingConfigs: function() {
      +        var ruleIds = Object.keys(this.rules),
      +            newRegistry = new Registry();
      +
      +        newRegistry.rules = lodash.assign({}, this.rules);
      +        ruleIds.forEach(function(ruleId) {
      +            var errorFreeItems = newRegistry.rules[ruleId].filter(function(registryItem) {
      +                return (registryItem.errorCount === 0);
      +            });
      +
      +            if (errorFreeItems.length > 0) {
      +                newRegistry.rules[ruleId] = errorFreeItems;
      +            } else {
      +                delete newRegistry.rules[ruleId];
      +            }
      +        });
      +
      +        return newRegistry;
      +    },
      +
      +    /**
      +     * Removes rule configurations which were not included in a ruleSet
      +     *
      +     * @returns {void}
      +     */
      +    stripExtraConfigs: function() {
      +        var ruleIds = Object.keys(this.rules),
      +            newRegistry = new Registry();
      +
      +        newRegistry.rules = lodash.assign({}, this.rules);
      +        ruleIds.forEach(function(ruleId) {
      +            newRegistry.rules[ruleId] = newRegistry.rules[ruleId].filter(function(registryItem) {
      +                return (typeof registryItem.errorCount !== "undefined");
      +            });
      +        });
      +
      +        return newRegistry;
      +    },
      +
      +    /**
      +     * Creates a registry of rules which had no error-free configs.
      +     * The new registry is intended to be analyzed to determine whether its rules
      +     * should be disabled or set to warning.
      +     *
      +     * @returns {Registry}  A registry of failing rules.
      +     */
      +    getFailingRulesRegistry: function() {
      +        var ruleIds = Object.keys(this.rules),
      +            failingRegistry = new Registry();
      +
      +        ruleIds.forEach(function(ruleId) {
      +            var failingConfigs = this.rules[ruleId].filter(function(registryItem) {
      +                return (registryItem.errorCount > 0);
      +            });
      +
      +            if (failingConfigs && failingConfigs.length === this.rules[ruleId].length) {
      +                failingRegistry.rules[ruleId] = failingConfigs;
      +            }
      +        }.bind(this));
      +
      +        return failingRegistry;
      +    },
      +
      +    /**
      +     * Create an eslint config for any rules which only have one configuration
      +     * in the registry.
      +     *
      +     * @returns {Object} An eslint config with rules section populated
      +     */
      +    createConfig: function() {
      +        var ruleIds = Object.keys(this.rules),
      +            config = {rules: {}};
      +
      +        ruleIds.forEach(function(ruleId) {
      +            if (this.rules[ruleId].length === 1) {
      +                config.rules[ruleId] = this.rules[ruleId][0].config;
      +            }
      +        }.bind(this));
      +
      +        return config;
      +    },
      +
      +    /**
      +     * Return a cloned registry containing only configs with a desired specificity
      +     *
      +     * @param   {number} specificity Only keep configs with this specificity
      +     * @returns {Registry}           A registry of rules
      +     */
      +    filterBySpecificity: function(specificity) {
      +        var ruleIds = Object.keys(this.rules),
      +            newRegistry = new Registry();
      +
      +        newRegistry.rules = lodash.assign({}, this.rules);
      +        ruleIds.forEach(function(ruleId) {
      +            newRegistry.rules[ruleId] = this.rules[ruleId].filter(function(registryItem) {
      +                return (registryItem.specificity === specificity);
      +            });
      +        }.bind(this));
      +
      +        return newRegistry;
      +    },
      +
      +    /**
      +     * Lint SourceCodes against all configurations in the registry, and record results
      +     *
      +     * @param   {Object[]} sourceCodes  SourceCode objects for each filename
      +     * @param   {Object}   config       ESLint config object
      +     * @param   {progressCallback} [cb] Optional callback for reporting execution status
      +     * @returns {Registry}              New registry with errorCount populated
      +     */
      +    lintSourceCode: function(sourceCodes, config, cb) {
      +        var totalFilesLinting,
      +            lintConfig,
      +            ruleSets,
      +            ruleSetIdx,
      +            filenames,
      +            lintedRegistry;
      +
      +        lintedRegistry = new Registry();
      +        lintedRegistry.rules = lodash.assign({}, this.rules);
      +
      +        ruleSets = lintedRegistry.buildRuleSets();
      +
      +        lintedRegistry = lintedRegistry.stripExtraConfigs();
      +
      +        debug("Linting with all possible rule combinations");
      +
      +        filenames = Object.keys(sourceCodes);
      +
      +        totalFilesLinting = filenames.length * ruleSets.length;
      +
      +        filenames.forEach(function(filename) {
      +            debug("Linting file: " + filename);
      +
      +            ruleSetIdx = 0;
      +
      +            ruleSets.forEach(function(ruleSet) {
      +                lintConfig = lodash.assign({}, config, {rules: ruleSet});
      +                var lintResults = eslint.verify(sourceCodes[filename], lintConfig);
      +
      +                lintResults.forEach(function(result) {
      +                    lintedRegistry.rules[result.ruleId][ruleSetIdx].errorCount += 1;
      +                });
      +
      +                ruleSetIdx += 1;
      +
      +                if (cb) {
      +                    cb(totalFilesLinting);  // eslint-disable-line callback-return
      +                }
      +            });
      +
      +            // Deallocate for GC
      +            sourceCodes[filename] = null;
      +        });
      +
      +        return lintedRegistry;
      +    }
      +};
      +
      +/**
      + * Extract rule configuration into eslint:recommended where possible.
      + *
      + * This will return a new config with `"extends": "eslint:recommended"` and
      + * only the rules which have configurations different from the recommended config.
      + *
      + * @param   {Object} config config object
      + * @returns {Object}        config object using `"extends": "eslint:recommended"`
      + */
      +function extendFromRecommended(config) {
      +    var newConfig = lodash.assign({}, config);
      +
      +    ConfigOps.normalizeToStrings(newConfig);
      +
      +    var recRules = Object.keys(recConfig.rules).filter(function(ruleId) {
      +        return ConfigOps.isErrorSeverity(recConfig.rules[ruleId]);
      +    });
      +
      +    recRules.forEach(function(ruleId) {
      +        if (lodash.isEqual(recConfig.rules[ruleId], newConfig.rules[ruleId])) {
      +            delete newConfig.rules[ruleId];
      +        }
      +    });
      +    newConfig.extends = RECOMMENDED_CONFIG_NAME;
      +    return newConfig;
      +}
      +
      +
      +//------------------------------------------------------------------------------
      +// Public Interface
      +//------------------------------------------------------------------------------
      +
      +module.exports = {
      +    Registry: Registry,
      +    extendFromRecommended: extendFromRecommended
      +};
      diff --git a/tools/eslint/lib/config/config-file.js b/tools/eslint/lib/config/config-file.js
      new file mode 100644
      index 00000000000000..f5ef3e88c6e3d5
      --- /dev/null
      +++ b/tools/eslint/lib/config/config-file.js
      @@ -0,0 +1,576 @@
      +/**
      + * @fileoverview Helper to locate and load configuration files.
      + * @author Nicholas C. Zakas
      + * @copyright 2015 Nicholas C. Zakas. All rights reserved.
      + * See LICENSE file in root directory for full license.
      + */
      +
      +/* eslint no-use-before-define: 0 */
      +
      +"use strict";
      +
      +//------------------------------------------------------------------------------
      +// Requirements
      +//------------------------------------------------------------------------------
      +
      +var debug = require("debug"),
      +    fs = require("fs"),
      +    path = require("path"),
      +    ConfigOps = require("./config-ops"),
      +    validator = require("./config-validator"),
      +    Plugins = require("./plugins"),
      +    pathUtil = require("../util/path-util"),
      +    ModuleResolver = require("../util/module-resolver"),
      +    pathIsInside = require("path-is-inside"),
      +    stripComments = require("strip-json-comments"),
      +    stringify = require("json-stable-stringify"),
      +    isAbsolutePath = require("path-is-absolute"),
      +    defaultOptions = require("../../conf/eslint.json"),
      +    requireUncached = require("require-uncached");
      +
      +
      +//------------------------------------------------------------------------------
      +// Helpers
      +//------------------------------------------------------------------------------
      +
      +/**
      + * Determines sort order for object keys for json-stable-stringify
      + *
      + * see: https://github.com/substack/json-stable-stringify#cmp
      + *
      + * @param   {Object} a The first comparison object ({key: akey, value: avalue})
      + * @param   {Object} b The second comparison object ({key: bkey, value: bvalue})
      + * @returns {number}   1 or -1, used in stringify cmp method
      + */
      +function sortByKey(a, b) {
      +    return a.key > b.key ? 1 : -1;
      +}
      +
      +//------------------------------------------------------------------------------
      +// Private
      +//------------------------------------------------------------------------------
      +
      +var CONFIG_FILES = [
      +    ".eslintrc.js",
      +    ".eslintrc.yaml",
      +    ".eslintrc.yml",
      +    ".eslintrc.json",
      +    ".eslintrc",
      +    "package.json"
      +];
      +
      +var resolver = new ModuleResolver();
      +
      +debug = debug("eslint:config-file");
      +
      +/**
      + * Convenience wrapper for synchronously reading file contents.
      + * @param {string} filePath The filename to read.
      + * @returns {string} The file contents.
      + * @private
      + */
      +function readFile(filePath) {
      +    return fs.readFileSync(filePath, "utf8");
      +}
      +
      +/**
      + * Determines if a given string represents a filepath or not using the same
      + * conventions as require(), meaning that the first character must be nonalphanumeric
      + * and not the @ sign which is used for scoped packages to be considered a file path.
      + * @param {string} filePath The string to check.
      + * @returns {boolean} True if it's a filepath, false if not.
      + * @private
      + */
      +function isFilePath(filePath) {
      +    return isAbsolutePath(filePath) || !/\w|@/.test(filePath.charAt(0));
      +}
      +
      +/**
      + * Loads a YAML configuration from a file.
      + * @param {string} filePath The filename to load.
      + * @returns {Object} The configuration object from the file.
      + * @throws {Error} If the file cannot be read.
      + * @private
      + */
      +function loadYAMLConfigFile(filePath) {
      +    debug("Loading YAML config file: " + filePath);
      +
      +    // lazy load YAML to improve performance when not used
      +    var yaml = require("js-yaml");
      +
      +    try {
      +
      +        // empty YAML file can be null, so always use
      +        return yaml.safeLoad(readFile(filePath)) || {};
      +    } catch (e) {
      +        debug("Error reading YAML file: " + filePath);
      +        e.message = "Cannot read config file: " + filePath + "\nError: " + e.message;
      +        throw e;
      +    }
      +}
      +
      +/**
      + * Loads a JSON configuration from a file.
      + * @param {string} filePath The filename to load.
      + * @returns {Object} The configuration object from the file.
      + * @throws {Error} If the file cannot be read.
      + * @private
      + */
      +function loadJSONConfigFile(filePath) {
      +    debug("Loading JSON config file: " + filePath);
      +
      +    try {
      +        return JSON.parse(stripComments(readFile(filePath)));
      +    } catch (e) {
      +        debug("Error reading JSON file: " + filePath);
      +        e.message = "Cannot read config file: " + filePath + "\nError: " + e.message;
      +        throw e;
      +    }
      +}
      +
      +/**
      + * Loads a legacy (.eslintrc) configuration from a file.
      + * @param {string} filePath The filename to load.
      + * @returns {Object} The configuration object from the file.
      + * @throws {Error} If the file cannot be read.
      + * @private
      + */
      +function loadLegacyConfigFile(filePath) {
      +    debug("Loading config file: " + filePath);
      +
      +    // lazy load YAML to improve performance when not used
      +    var yaml = require("js-yaml");
      +
      +    try {
      +        return yaml.safeLoad(stripComments(readFile(filePath))) || /* istanbul ignore next */ {};
      +    } catch (e) {
      +        debug("Error reading YAML file: " + filePath);
      +        e.message = "Cannot read config file: " + filePath + "\nError: " + e.message;
      +        throw e;
      +    }
      +}
      +
      +/**
      + * Loads a JavaScript configuration from a file.
      + * @param {string} filePath The filename to load.
      + * @returns {Object} The configuration object from the file.
      + * @throws {Error} If the file cannot be read.
      + * @private
      + */
      +function loadJSConfigFile(filePath) {
      +    debug("Loading JS config file: " + filePath);
      +    try {
      +        return requireUncached(filePath);
      +    } catch (e) {
      +        debug("Error reading JavaScript file: " + filePath);
      +        e.message = "Cannot read config file: " + filePath + "\nError: " + e.message;
      +        throw e;
      +    }
      +}
      +
      +/**
      + * Loads a configuration from a package.json file.
      + * @param {string} filePath The filename to load.
      + * @returns {Object} The configuration object from the file.
      + * @throws {Error} If the file cannot be read.
      + * @private
      + */
      +function loadPackageJSONConfigFile(filePath) {
      +    debug("Loading package.json config file: " + filePath);
      +    try {
      +        return loadJSONConfigFile(filePath).eslintConfig || null;
      +    } catch (e) {
      +        debug("Error reading package.json file: " + filePath);
      +        e.message = "Cannot read config file: " + filePath + "\nError: " + e.message;
      +        throw e;
      +    }
      +}
      +
      +/**
      + * Loads a configuration file regardless of the source. Inspects the file path
      + * to determine the correctly way to load the config file.
      + * @param {Object} file The path to the configuration.
      + * @returns {Object} The configuration information.
      + * @private
      + */
      +function loadConfigFile(file) {
      +    var config,
      +        filePath = file.filePath;
      +
      +    switch (path.extname(filePath)) {
      +        case ".js":
      +            config = loadJSConfigFile(filePath);
      +            if (file.configName) {
      +                config = config.configs[file.configName];
      +            }
      +            break;
      +
      +        case ".json":
      +            if (path.basename(filePath) === "package.json") {
      +                config = loadPackageJSONConfigFile(filePath);
      +                if (config === null) {
      +                    return null;
      +                }
      +            } else {
      +                config = loadJSONConfigFile(filePath);
      +            }
      +            break;
      +
      +        case ".yaml":
      +        case ".yml":
      +            config = loadYAMLConfigFile(filePath);
      +            break;
      +
      +        default:
      +            config = loadLegacyConfigFile(filePath);
      +    }
      +
      +    return ConfigOps.merge(ConfigOps.createEmptyConfig(), config);
      +}
      +
      +/**
      + * Writes a configuration file in JSON format.
      + * @param {Object} config The configuration object to write.
      + * @param {string} filePath The filename to write to.
      + * @returns {void}
      + * @private
      + */
      +function writeJSONConfigFile(config, filePath) {
      +    debug("Writing JSON config file: " + filePath);
      +
      +    var content = stringify(config, {cmp: sortByKey, space: 4});
      +
      +    fs.writeFileSync(filePath, content, "utf8");
      +}
      +
      +/**
      + * Writes a configuration file in YAML format.
      + * @param {Object} config The configuration object to write.
      + * @param {string} filePath The filename to write to.
      + * @returns {void}
      + * @private
      + */
      +function writeYAMLConfigFile(config, filePath) {
      +    debug("Writing YAML config file: " + filePath);
      +
      +    // lazy load YAML to improve performance when not used
      +    var yaml = require("js-yaml");
      +
      +    var content = yaml.safeDump(config, {sortKeys: true});
      +
      +    fs.writeFileSync(filePath, content, "utf8");
      +}
      +
      +/**
      + * Writes a configuration file in JavaScript format.
      + * @param {Object} config The configuration object to write.
      + * @param {string} filePath The filename to write to.
      + * @returns {void}
      + * @private
      + */
      +function writeJSConfigFile(config, filePath) {
      +    debug("Writing JS config file: " + filePath);
      +
      +    var content = "module.exports = " + stringify(config, {cmp: sortByKey, space: 4}) + ";";
      +
      +    fs.writeFileSync(filePath, content, "utf8");
      +}
      +
      +/**
      + * Writes a configuration file.
      + * @param {Object} config The configuration object to write.
      + * @param {string} filePath The filename to write to.
      + * @returns {void}
      + * @throws {Error} When an unknown file type is specified.
      + * @private
      + */
      +function write(config, filePath) {
      +    switch (path.extname(filePath)) {
      +        case ".js":
      +            writeJSConfigFile(config, filePath);
      +            break;
      +
      +        case ".json":
      +            writeJSONConfigFile(config, filePath);
      +            break;
      +
      +        case ".yaml":
      +        case ".yml":
      +            writeYAMLConfigFile(config, filePath);
      +            break;
      +
      +        default:
      +            throw new Error("Can't write to unknown file type.");
      +    }
      +}
      +
      +/**
      + * Determines the base directory for node packages referenced in a config file.
      + * This does not include node_modules in the path so it can be used for all
      + * references relative to a config file.
      + * @param {string} configFilePath The config file referencing the file.
      + * @returns {string} The base directory for the file path.
      + * @private
      + */
      +function getBaseDir(configFilePath) {
      +
      +    // calculates the path of the project including ESLint as dependency
      +    var projectPath = path.resolve(__dirname, "../../../");
      +
      +    if (configFilePath && pathIsInside(configFilePath, projectPath)) {
      +
      +        // be careful of https://github.com/substack/node-resolve/issues/78
      +        return path.join(path.resolve(configFilePath));
      +    }
      +
      +    /*
      +     * default to ESLint project path since it's unlikely that plugins will be
      +     * in this directory
      +     */
      +    return path.join(projectPath);
      +}
      +
      +/**
      + * Determines the lookup path, including node_modules, for package
      + * references relative to a config file.
      + * @param {string} configFilePath The config file referencing the file.
      + * @returns {string} The lookup path for the file path.
      + * @private
      + */
      +function getLookupPath(configFilePath) {
      +    var basedir = getBaseDir(configFilePath);
      +
      +    return path.join(basedir, "node_modules");
      +}
      +
      +/**
      + * Applies values from the "extends" field in a configuration file.
      + * @param {Object} config The configuration information.
      + * @param {string} filePath The file path from which the configuration information
      + *      was loaded.
      + * @param {string} [relativeTo] The path to resolve relative to.
      + * @returns {Object} A new configuration object with all of the "extends" fields
      + *      loaded and merged.
      + * @private
      + */
      +function applyExtends(config, filePath, relativeTo) {
      +    var configExtends = config.extends;
      +
      +    // normalize into an array for easier handling
      +    if (!Array.isArray(config.extends)) {
      +        configExtends = [config.extends];
      +    }
      +
      +    // Make the last element in an array take the highest precedence
      +    config = configExtends.reduceRight(function(previousValue, parentPath) {
      +
      +        if (parentPath === "eslint:recommended") {
      +
      +            /*
      +             * Add an explicit substitution for eslint:recommended to conf/eslint.json
      +             * this lets us use the eslint.json file as the recommended rules
      +             */
      +            parentPath = path.resolve(__dirname, "../../conf/eslint.json");
      +        } else if (isFilePath(parentPath)) {
      +
      +            /*
      +             * If the `extends` path is relative, use the directory of the current configuration
      +             * file as the reference point. Otherwise, use as-is.
      +             */
      +            parentPath = (!isAbsolutePath(parentPath) ?
      +                path.join(path.dirname(filePath), parentPath) :
      +                parentPath
      +            );
      +        }
      +
      +        try {
      +            debug("Loading " + parentPath);
      +            return ConfigOps.merge(load(parentPath, false, relativeTo), previousValue);
      +        } catch (e) {
      +
      +            /*
      +             * If the file referenced by `extends` failed to load, add the path
      +             * to the configuration file that referenced it to the error
      +             * message so the user is able to see where it was referenced from,
      +             * then re-throw.
      +             */
      +            e.message += "\nReferenced from: " + filePath;
      +            throw e;
      +        }
      +
      +    }, config);
      +
      +    return config;
      +}
      +
      +/**
      + * Brings package name to correct format based on prefix
      + * @param {string} name The name of the package.
      + * @param {string} prefix Can be either "eslint-plugin" or "eslint-config
      + * @returns {string} Normalized name of the package
      + * @private
      + */
      +function normalizePackageName(name, prefix) {
      +
      +    /*
      +     * On Windows, name can come in with Windows slashes instead of Unix slashes.
      +     * Normalize to Unix first to avoid errors later on.
      +     * https://github.com/eslint/eslint/issues/5644
      +     */
      +    if (name.indexOf("\\") > -1) {
      +        name = pathUtil.convertPathToPosix(name);
      +    }
      +
      +    if (name.charAt(0) === "@") {
      +
      +        /*
      +         * it's a scoped package
      +         * package name is "eslint-config", or just a username
      +         */
      +        var scopedPackageShortcutRegex = new RegExp("^(@[^\/]+)(?:\/(?:" + prefix + ")?)?$"),
      +            scopedPackageNameRegex = new RegExp("^" + prefix + "(-|$)");
      +
      +        if (scopedPackageShortcutRegex.test(name)) {
      +            name = name.replace(scopedPackageShortcutRegex, "$1/" + prefix);
      +        } else if (!scopedPackageNameRegex.test(name.split("/")[1])) {
      +
      +            /*
      +             * for scoped packages, insert the eslint-config after the first / unless
      +             * the path is already @scope/eslint or @scope/eslint-config-xxx
      +             */
      +            name = name.replace(/^@([^\/]+)\/(.*)$/, "@$1/" + prefix + "-$2");
      +        }
      +    } else if (name.indexOf(prefix + "-") !== 0) {
      +        name = prefix + "-" + name;
      +    }
      +
      +    return name;
      +}
      +
      +/**
      + * Resolves a configuration file path into the fully-formed path, whether filename
      + * or package name.
      + * @param {string} filePath The filepath to resolve.
      + * @param {string} [relativeTo] The path to resolve relative to.
      + * @returns {Object} A path that can be used directly to load the configuration.
      + * @private
      + */
      +function resolve(filePath, relativeTo) {
      +    if (isFilePath(filePath)) {
      +        return { filePath: path.resolve(relativeTo || "", filePath) };
      +    } else {
      +        var normalizedPackageName;
      +
      +        if (filePath.indexOf("plugin:") === 0) {
      +            var packagePath = filePath.substr(7, filePath.lastIndexOf("/") - 7);
      +            var configName = filePath.substr(filePath.lastIndexOf("/") + 1, filePath.length - filePath.lastIndexOf("/") - 1);
      +
      +            normalizedPackageName = normalizePackageName(packagePath, "eslint-plugin");
      +            debug("Attempting to resolve " + normalizedPackageName);
      +            filePath = resolver.resolve(normalizedPackageName, getLookupPath(relativeTo));
      +            return { filePath: filePath, configName: configName };
      +        } else {
      +            normalizedPackageName = normalizePackageName(filePath, "eslint-config");
      +            debug("Attempting to resolve " + normalizedPackageName);
      +            filePath = resolver.resolve(normalizedPackageName, getLookupPath(relativeTo));
      +            return { filePath: filePath };
      +        }
      +    }
      +
      +}
      +
      +/**
      + * Loads a configuration file from the given file path.
      + * @param {string} filePath The filename or package name to load the configuration
      + *      information from.
      + * @param {boolean} [applyEnvironments=false] Set to true to merge in environment settings.
      + * @param {string} [relativeTo] The path to resolve relative to.
      + * @returns {Object} The configuration information.
      + * @private
      + */
      +function load(filePath, applyEnvironments, relativeTo) {
      +    var resolvedPath = resolve(filePath, relativeTo),
      +        dirname = path.dirname(resolvedPath.filePath),
      +        basedir = getBaseDir(dirname),
      +        lookupPath = getLookupPath(dirname),
      +        config = loadConfigFile(resolvedPath);
      +
      +    if (config) {
      +
      +        // ensure plugins are properly loaded first
      +        if (config.plugins) {
      +            Plugins.loadAll(config.plugins);
      +        }
      +
      +        // remove parser from config if it is the default parser
      +        if (config.parser === defaultOptions.parser) {
      +            config.parser = null;
      +        }
      +
      +        // include full path of parser if present
      +        if (config.parser) {
      +            if (isFilePath(config.parser)) {
      +                config.parser = path.resolve(basedir || "", config.parser);
      +            } else {
      +                config.parser = resolver.resolve(config.parser, lookupPath);
      +            }
      +        }
      +
      +        // validate the configuration before continuing
      +        validator.validate(config, filePath);
      +
      +        /*
      +         * If an `extends` property is defined, it represents a configuration file to use as
      +         * a "parent". Load the referenced file and merge the configuration recursively.
      +         */
      +        if (config.extends) {
      +            config = applyExtends(config, filePath, basedir);
      +        }
      +
      +        if (config.env && applyEnvironments) {
      +
      +            // Merge in environment-specific globals and parserOptions.
      +            config = ConfigOps.applyEnvironments(config);
      +        }
      +
      +    }
      +
      +    return config;
      +}
      +
      +//------------------------------------------------------------------------------
      +// Public Interface
      +//------------------------------------------------------------------------------
      +
      +module.exports = {
      +
      +    getBaseDir: getBaseDir,
      +    getLookupPath: getLookupPath,
      +    load: load,
      +    resolve: resolve,
      +    write: write,
      +    applyExtends: applyExtends,
      +    normalizePackageName: normalizePackageName,
      +    CONFIG_FILES: CONFIG_FILES,
      +
      +    /**
      +     * Retrieves the configuration filename for a given directory. It loops over all
      +     * of the valid configuration filenames in order to find the first one that exists.
      +     * @param {string} directory The directory to check for a config file.
      +     * @returns {?string} The filename of the configuration file for the directory
      +     *      or null if there is no configuration file in the directory.
      +     */
      +    getFilenameForDirectory: function(directory) {
      +
      +        var filename;
      +
      +        for (var i = 0, len = CONFIG_FILES.length; i < len; i++) {
      +            filename = path.join(directory, CONFIG_FILES[i]);
      +            if (fs.existsSync(filename)) {
      +                return filename;
      +            }
      +        }
      +
      +        return null;
      +    }
      +};
      diff --git a/tools/eslint/lib/config/config-initializer.js b/tools/eslint/lib/config/config-initializer.js
      new file mode 100644
      index 00000000000000..f1d5121e4ab4bb
      --- /dev/null
      +++ b/tools/eslint/lib/config/config-initializer.js
      @@ -0,0 +1,479 @@
      +/**
      + * @fileoverview Config initialization wizard.
      + * @author Ilya Volodin
      + * @copyright 2015 Ilya Volodin. All rights reserved.
      + */
      +
      +"use strict";
      +
      +//------------------------------------------------------------------------------
      +// Requirements
      +//------------------------------------------------------------------------------
      +
      +var util = require("util"),
      +    debug = require("debug"),
      +    lodash = require("lodash"),
      +    inquirer = require("inquirer"),
      +    ProgressBar = require("progress"),
      +    autoconfig = require("./autoconfig.js"),
      +    ConfigFile = require("./config-file"),
      +    ConfigOps = require("./config-ops"),
      +    getSourceCodeOfFiles = require("../util/source-code-util").getSourceCodeOfFiles,
      +    npmUtil = require("../util/npm-util"),
      +    recConfig = require("../../conf/eslint.json"),
      +    log = require("../logging");
      +
      +debug = debug("eslint:config-initializer");
      +
      +//------------------------------------------------------------------------------
      +// Private
      +//------------------------------------------------------------------------------
      +
      +/* istanbul ignore next: hard to test fs function */
      +/**
      + * Create .eslintrc file in the current working directory
      + * @param {Object} config object that contains user's answers
      + * @param {string} format The file format to write to.
      + * @returns {void}
      + */
      +function writeFile(config, format) {
      +
      +    // default is .js
      +    var extname = ".js";
      +
      +    if (format === "YAML") {
      +        extname = ".yml";
      +    } else if (format === "JSON") {
      +        extname = ".json";
      +    }
      +
      +
      +    ConfigFile.write(config, "./.eslintrc" + extname);
      +    log.info("Successfully created .eslintrc" + extname + " file in " + process.cwd());
      +}
      +
      +/**
      + * Synchronously install necessary plugins, configs, parsers, etc. based on the config
      + * @param   {Object} config  config object
      + * @returns {void}
      + */
      +function installModules(config) {
      +    var modules = [],
      +        installStatus,
      +        modulesToInstall;
      +
      +    // Create a list of modules which should be installed based on config
      +    if (config.plugins) {
      +        modules = modules.concat(config.plugins.map(function(name) {
      +            return "eslint-plugin-" + name;
      +        }));
      +    }
      +    if (config.extends && config.extends.indexOf("eslint:") === -1) {
      +        modules.push("eslint-config-" + config.extends);
      +    }
      +
      +    // Determine which modules are already installed
      +    if (modules.length === 0) {
      +        return;
      +    }
      +    installStatus = npmUtil.checkDevDeps(modules);
      +
      +    // Install packages which aren't already installed
      +    modulesToInstall = Object.keys(installStatus).filter(function(module) {
      +        return installStatus[module] === false;
      +    });
      +    if (modulesToInstall.length > 0) {
      +        log.info("Installing " + modulesToInstall.join(", "));
      +        npmUtil.installSyncSaveDev(modulesToInstall);
      +    }
      +}
      +
      +/**
      + * Set the `rules` of a config by examining a user's source code
      + *
      + * Note: This clones the config object and returns a new config to avoid mutating
      + * the original config parameter.
      + *
      + * @param   {Object} answers  answers received from inquirer
      + * @param   {Object} config   config object
      + * @returns {Object}          config object with configured rules
      + */
      +function configureRules(answers, config) {
      +    var BAR_TOTAL = 20,
      +        BAR_SOURCE_CODE_TOTAL = 4;
      +
      +    var newConfig = lodash.assign({}, config),
      +        bar,
      +        patterns,
      +        sourceCodes,
      +        fileQty,
      +        registry,
      +        failingRegistry,
      +        disabledConfigs = {},
      +        singleConfigs,
      +        specTwoConfigs,
      +        specThreeConfigs,
      +        defaultConfigs;
      +
      +    // Set up a progress bar, as this process can take a long time
      +    bar = new ProgressBar("Determining Config: :percent [:bar] :elapseds elapsed, eta :etas ", {
      +        width: 30,
      +        total: BAR_TOTAL
      +    });
      +    bar.tick(0); // Shows the progress bar
      +
      +    // Get the SourceCode of all chosen files
      +    patterns = answers.patterns.split(/[\s]+/);
      +    try {
      +        sourceCodes = getSourceCodeOfFiles(patterns, { baseConfig: newConfig, useEslintrc: false }, function(total) {
      +            bar.tick((BAR_SOURCE_CODE_TOTAL / total));
      +        });
      +    } catch (e) {
      +        log.info("\n");
      +        throw e;
      +    }
      +    fileQty = Object.keys(sourceCodes).length;
      +    if (fileQty === 0) {
      +        log.info("\n");
      +        throw new Error("Automatic Configuration failed.  No files were able to be parsed.");
      +    }
      +
      +    // Create a registry of rule configs
      +    registry = new autoconfig.Registry();
      +    registry.populateFromCoreRules();
      +
      +    // Lint all files with each rule config in the registry
      +    registry = registry.lintSourceCode(sourceCodes, newConfig, function(total) {
      +        bar.tick((BAR_TOTAL - BAR_SOURCE_CODE_TOTAL) / total); // Subtract out ticks used at beginning
      +    });
      +    debug("\nRegistry: " + util.inspect(registry.rules, {depth: null}));
      +
      +    // Create a list of recommended rules, because we don't want to disable them
      +    var recRules = Object.keys(recConfig.rules).filter(function(ruleId) {
      +        return ConfigOps.isErrorSeverity(recConfig.rules[ruleId]);
      +    });
      +
      +    // Find and disable rules which had no error-free configuration
      +    failingRegistry = registry.getFailingRulesRegistry();
      +
      +    Object.keys(failingRegistry.rules).forEach(function(ruleId) {
      +
      +        // If the rule is recommended, set it to error, otherwise disable it
      +        disabledConfigs[ruleId] = (recRules.indexOf(ruleId) !== -1) ? 2 : 0;
      +    });
      +
      +    // Now that we know which rules to disable, strip out configs with errors
      +    registry = registry.stripFailingConfigs();
      +
      +    // If there is only one config that results in no errors for a rule, we should use it.
      +    // createConfig will only add rules that have one configuration in the registry.
      +    singleConfigs = registry.createConfig().rules;
      +
      +    // The "sweet spot" for number of options in a config seems to be two (severity plus one option).
      +    // Very often, a third option (usually an object) is available to address
      +    // edge cases, exceptions, or unique situations. We will prefer to use a config with
      +    // specificity of two.
      +    specTwoConfigs = registry.filterBySpecificity(2).createConfig().rules;
      +
      +    // Maybe a specific combination using all three options works
      +    specThreeConfigs = registry.filterBySpecificity(3).createConfig().rules;
      +
      +    // If all else fails, try to use the default (severity only)
      +    defaultConfigs = registry.filterBySpecificity(1).createConfig().rules;
      +
      +    // Combine configs in reverse priority order (later take precedence)
      +    newConfig.rules = lodash.assign({}, disabledConfigs, defaultConfigs, specThreeConfigs, specTwoConfigs, singleConfigs);
      +
      +    // Make sure progress bar has finished (floating point rounding)
      +    bar.update(BAR_TOTAL);
      +
      +    // Log out some stats to let the user know what happened
      +    var finalRuleIds = Object.keys(newConfig.rules),
      +        totalRules = finalRuleIds.length;
      +    var enabledRules = finalRuleIds.filter(function(ruleId) {
      +        return (newConfig.rules[ruleId] !== 0);
      +    }).length;
      +    var resultMessage = [
      +        "\nEnabled " + enabledRules + " out of " + totalRules,
      +        "rules based on " + fileQty,
      +        "file" + ((fileQty === 1) ? "." : "s.")
      +    ].join(" ");
      +
      +    log.info(resultMessage);
      +
      +    ConfigOps.normalizeToStrings(newConfig);
      +    return newConfig;
      +}
      +
      +/**
      + * process user's answers and create config object
      + * @param {Object} answers answers received from inquirer
      + * @returns {Object} config object
      + */
      +function processAnswers(answers) {
      +    var config = {rules: {}, env: {}};
      +
      +    if (answers.es6) {
      +        config.env.es6 = true;
      +        if (answers.modules) {
      +            config.parserOptions = config.parserOptions || {};
      +            config.parserOptions.sourceType = "module";
      +        }
      +    }
      +    if (answers.commonjs) {
      +        config.env.commonjs = true;
      +    }
      +    answers.env.forEach(function(env) {
      +        config.env[env] = true;
      +    });
      +    if (answers.jsx) {
      +        config.parserOptions = config.parserOptions || {};
      +        config.parserOptions.ecmaFeatures = config.parserOptions.ecmaFeatures || {};
      +        config.parserOptions.ecmaFeatures.jsx = true;
      +        if (answers.react) {
      +            config.plugins = ["react"];
      +            config.parserOptions.ecmaFeatures.experimentalObjectRestSpread = true;
      +        }
      +    }
      +
      +    if (answers.source === "prompt") {
      +        config.extends = "eslint:recommended";
      +        config.rules.indent = ["error", answers.indent];
      +        config.rules.quotes = ["error", answers.quotes];
      +        config.rules["linebreak-style"] = ["error", answers.linebreak];
      +        config.rules.semi = ["error", answers.semi ? "always" : "never"];
      +    }
      +
      +    installModules(config);
      +
      +    if (answers.source === "auto") {
      +        config = configureRules(answers, config);
      +        config = autoconfig.extendFromRecommended(config);
      +    }
      +
      +    ConfigOps.normalizeToStrings(config);
      +    return config;
      +}
      +
      +/**
      + * process user's style guide of choice and return an appropriate config object.
      + * @param {string} guide name of the chosen style guide
      + * @returns {Object} config object
      + */
      +function getConfigForStyleGuide(guide) {
      +    var guides = {
      +        google: {extends: "google"},
      +        airbnb: {extends: "airbnb", plugins: ["react"]},
      +        standard: {extends: "standard", plugins: ["standard"]}
      +    };
      +
      +    if (!guides[guide]) {
      +        throw new Error("You referenced an unsupported guide.");
      +    }
      +
      +    installModules(guides[guide]);
      +
      +    return guides[guide];
      +}
      +
      +/* istanbul ignore next: no need to test inquirer*/
      +/**
      + * Ask use a few questions on command prompt
      + * @param {function} callback callback function when file has been written
      + * @returns {void}
      + */
      +function promptUser(callback) {
      +    var config;
      +
      +    inquirer.prompt([
      +        {
      +            type: "list",
      +            name: "source",
      +            message: "How would you like to configure ESLint?",
      +            default: "prompt",
      +            choices: [
      +                {name: "Answer questions about your style", value: "prompt"},
      +                {name: "Use a popular style guide", value: "guide"},
      +                {name: "Inspect your JavaScript file(s)", value: "auto"}
      +            ]
      +        },
      +        {
      +            type: "list",
      +            name: "styleguide",
      +            message: "Which style guide do you want to follow?",
      +            choices: [{name: "Google", value: "google"}, {name: "AirBnB", value: "airbnb"}, {name: "Standard", value: "standard"}],
      +            when: function(answers) {
      +                return answers.source === "guide";
      +            }
      +        },
      +        {
      +            type: "input",
      +            name: "patterns",
      +            message: "Which file(s), path(s), or glob(s) should be examined?",
      +            when: function(answers) {
      +                return (answers.source === "auto");
      +            },
      +            validate: function(input) {
      +                if (input.trim().length === 0 && input.trim() !== ",") {
      +                    return "You must tell us what code to examine. Try again.";
      +                }
      +                return true;
      +            }
      +        },
      +        {
      +            type: "list",
      +            name: "format",
      +            message: "What format do you want your config file to be in?",
      +            default: "JavaScript",
      +            choices: ["JavaScript", "YAML", "JSON"],
      +            when: function(answers) {
      +                return (answers.source === "guide" || answers.source === "auto");
      +            }
      +        }
      +    ], function(earlyAnswers) {
      +
      +        // early exit if you are using a style guide
      +        if (earlyAnswers.source === "guide") {
      +            try {
      +                config = getConfigForStyleGuide(earlyAnswers.styleguide);
      +                writeFile(config, earlyAnswers.format);
      +            } catch (err) {
      +                callback(err);
      +                return;
      +            }
      +            return;
      +        }
      +
      +        // continue with the questions otherwise...
      +        inquirer.prompt([
      +            {
      +                type: "confirm",
      +                name: "es6",
      +                message: "Are you using ECMAScript 6 features?",
      +                default: false
      +            },
      +            {
      +                type: "confirm",
      +                name: "modules",
      +                message: "Are you using ES6 modules?",
      +                default: false,
      +                when: function(answers) {
      +                    return answers.es6 === true;
      +                }
      +            },
      +            {
      +                type: "checkbox",
      +                name: "env",
      +                message: "Where will your code run?",
      +                default: ["browser"],
      +                choices: [{name: "Node", value: "node"}, {name: "Browser", value: "browser"}]
      +            },
      +            {
      +                type: "confirm",
      +                name: "commonjs",
      +                message: "Do you use CommonJS?",
      +                default: false,
      +                when: function(answers) {
      +                    return answers.env.some(function(env) {
      +                        return env === "browser";
      +                    });
      +                }
      +            },
      +            {
      +                type: "confirm",
      +                name: "jsx",
      +                message: "Do you use JSX?",
      +                default: false
      +            },
      +            {
      +                type: "confirm",
      +                name: "react",
      +                message: "Do you use React",
      +                default: false,
      +                when: function(answers) {
      +                    return answers.jsx;
      +                }
      +            }
      +        ], function(secondAnswers) {
      +
      +            // early exit if you are using automatic style generation
      +            if (earlyAnswers.source === "auto") {
      +                try {
      +                    var combinedAnswers = lodash.assign({}, earlyAnswers, secondAnswers);
      +
      +                    config = processAnswers(combinedAnswers);
      +                    installModules(config);
      +                    writeFile(config, earlyAnswers.format);
      +                } catch (err) {
      +                    callback(err);
      +                    return;
      +                }
      +                return;
      +            }
      +
      +            // continue with the style questions otherwise...
      +            inquirer.prompt([
      +                {
      +                    type: "list",
      +                    name: "indent",
      +                    message: "What style of indentation do you use?",
      +                    default: "tab",
      +                    choices: [{name: "Tabs", value: "tab"}, {name: "Spaces", value: 4}]
      +                },
      +                {
      +                    type: "list",
      +                    name: "quotes",
      +                    message: "What quotes do you use for strings?",
      +                    default: "double",
      +                    choices: [{name: "Double", value: "double"}, {name: "Single", value: "single"}]
      +                },
      +                {
      +                    type: "list",
      +                    name: "linebreak",
      +                    message: "What line endings do you use?",
      +                    default: "unix",
      +                    choices: [{name: "Unix", value: "unix"}, {name: "Windows", value: "windows"}]
      +                },
      +                {
      +                    type: "confirm",
      +                    name: "semi",
      +                    message: "Do you require semicolons?",
      +                    default: true
      +                },
      +                {
      +                    type: "list",
      +                    name: "format",
      +                    message: "What format do you want your config file to be in?",
      +                    default: "JavaScript",
      +                    choices: ["JavaScript", "YAML", "JSON"]
      +                }
      +            ], function(answers) {
      +                try {
      +                    var totalAnswers = lodash.assign({}, earlyAnswers, secondAnswers, answers);
      +
      +                    config = processAnswers(totalAnswers);
      +                    installModules(config);
      +                    writeFile(config, answers.format);
      +                } catch (err) {
      +                    callback(err);
      +                    return;
      +                }
      +                return;
      +            });
      +        });
      +    });
      +}
      +
      +//------------------------------------------------------------------------------
      +// Public Interface
      +//------------------------------------------------------------------------------
      +
      +var init = {
      +    getConfigForStyleGuide: getConfigForStyleGuide,
      +    processAnswers: processAnswers,
      +    initializeConfig: /* istanbul ignore next */ function(callback) {
      +        promptUser(callback);
      +    }
      +};
      +
      +module.exports = init;
      diff --git a/tools/eslint/lib/config/config-ops.js b/tools/eslint/lib/config/config-ops.js
      new file mode 100644
      index 00000000000000..6cf406ce57fa18
      --- /dev/null
      +++ b/tools/eslint/lib/config/config-ops.js
      @@ -0,0 +1,255 @@
      +/**
      + * @fileoverview Config file operations. This file must be usable in the browser,
      + * so no Node-specific code can be here.
      + * @author Nicholas C. Zakas
      + * @copyright 2015 Nicholas C. Zakas. All rights reserved.
      + * See LICENSE file in root directory for full license.
      + */
      +"use strict";
      +
      +//------------------------------------------------------------------------------
      +// Requirements
      +//------------------------------------------------------------------------------
      +
      +var lodash = require("lodash"),
      +    debug = require("debug"),
      +    Environments = require("./environments");
      +
      +//------------------------------------------------------------------------------
      +// Private
      +//------------------------------------------------------------------------------
      +
      +debug = debug("eslint:config-ops");
      +
      +var RULE_SEVERITY_STRINGS = ["off", "warn", "error"],
      +    RULE_SEVERITY = RULE_SEVERITY_STRINGS.reduce(function(map, value, index) {
      +        map[value] = index;
      +        return map;
      +    }, {});
      +
      +//------------------------------------------------------------------------------
      +// Public Interface
      +//------------------------------------------------------------------------------
      +
      +module.exports = {
      +
      +    /**
      +     * Creates an empty configuration object suitable for merging as a base.
      +     * @returns {Object} A configuration object.
      +     */
      +    createEmptyConfig: function() {
      +        return {
      +            globals: {},
      +            env: {},
      +            rules: {},
      +            parserOptions: {}
      +        };
      +    },
      +
      +    /**
      +     * Creates an environment config based on the specified environments.
      +     * @param {Object} env The environment settings.
      +     * @returns {Object} A configuration object with the appropriate rules and globals
      +     *      set.
      +     */
      +    createEnvironmentConfig: function(env) {
      +
      +        var envConfig = this.createEmptyConfig();
      +
      +        if (env) {
      +
      +            envConfig.env = env;
      +
      +            Object.keys(env).filter(function(name) {
      +                return env[name];
      +            }).forEach(function(name) {
      +                var environment = Environments.get(name);
      +
      +                if (environment) {
      +                    debug("Creating config for environment " + name);
      +                    if (environment.globals) {
      +                        lodash.assign(envConfig.globals, environment.globals);
      +                    }
      +
      +                    if (environment.parserOptions) {
      +                        lodash.assign(envConfig.parserOptions, environment.parserOptions);
      +                    }
      +                }
      +            });
      +        }
      +
      +        return envConfig;
      +    },
      +
      +    /**
      +     * Given a config with environment settings, applies the globals and
      +     * ecmaFeatures to the configuration and returns the result.
      +     * @param {Object} config The configuration information.
      +     * @returns {Object} The updated configuration information.
      +     */
      +    applyEnvironments: function(config) {
      +        if (config.env && typeof config.env === "object") {
      +            debug("Apply environment settings to config");
      +            return this.merge(this.createEnvironmentConfig(config.env), config);
      +        }
      +
      +        return config;
      +    },
      +
      +    /**
      +     * Merges two config objects. This will not only add missing keys, but will also modify values to match.
      +     * @param {Object} target config object
      +     * @param {Object} src config object. Overrides in this config object will take priority over base.
      +     * @param {boolean} [combine] Whether to combine arrays or not
      +     * @param {boolean} [isRule] Whether its a rule
      +     * @returns {Object} merged config object.
      +     */
      +    merge: function deepmerge(target, src, combine, isRule) {
      +
      +        /*
      +         The MIT License (MIT)
      +
      +         Copyright (c) 2012 Nicholas Fisher
      +
      +         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.
      +         */
      +
      +        /*
      +         * This code is taken from deepmerge repo
      +         * (https://github.com/KyleAMathews/deepmerge)
      +         * and modified to meet our needs.
      +         */
      +        var array = Array.isArray(src) || Array.isArray(target);
      +        var dst = array && [] || {};
      +
      +        combine = !!combine;
      +        isRule = !!isRule;
      +        if (array) {
      +            target = target || [];
      +
      +            // src could be a string, so check for array
      +            if (isRule && Array.isArray(src) && src.length > 1) {
      +                dst = dst.concat(src);
      +            } else {
      +                dst = dst.concat(target);
      +            }
      +            if (typeof src !== "object" && !Array.isArray(src)) {
      +                src = [src];
      +            }
      +            Object.keys(src).forEach(function(e, i) {
      +                e = src[i];
      +                if (typeof dst[i] === "undefined") {
      +                    dst[i] = e;
      +                } else if (typeof e === "object") {
      +                    if (isRule) {
      +                        dst[i] = e;
      +                    } else {
      +                        dst[i] = deepmerge(target[i], e, combine, isRule);
      +                    }
      +                } else {
      +                    if (!combine) {
      +                        dst[i] = e;
      +                    } else {
      +                        if (dst.indexOf(e) === -1) {
      +                            dst.push(e);
      +                        }
      +                    }
      +                }
      +            });
      +        } else {
      +            if (target && typeof target === "object") {
      +                Object.keys(target).forEach(function(key) {
      +                    dst[key] = target[key];
      +                });
      +            }
      +            Object.keys(src).forEach(function(key) {
      +                if (Array.isArray(src[key]) || Array.isArray(target[key])) {
      +                    dst[key] = deepmerge(target[key], src[key], key === "plugins", isRule);
      +                } else if (typeof src[key] !== "object" || !src[key] || key === "exported" || key === "astGlobals") {
      +                    dst[key] = src[key];
      +                } else {
      +                    dst[key] = deepmerge(target[key] || {}, src[key], combine, key === "rules");
      +                }
      +            });
      +        }
      +
      +        return dst;
      +    },
      +
      +    /**
      +     * Converts new-style severity settings (off, warn, error) into old-style
      +     * severity settings (0, 1, 2) for all rules. Assumption is that severity
      +     * values have already been validated as correct.
      +     * @param {Object} config The config object to normalize.
      +     * @returns {void}
      +     */
      +    normalize: function(config) {
      +
      +        if (config.rules) {
      +            Object.keys(config.rules).forEach(function(ruleId) {
      +                var ruleConfig = config.rules[ruleId];
      +
      +                if (typeof ruleConfig === "string") {
      +                    config.rules[ruleId] = RULE_SEVERITY[ruleConfig.toLowerCase()] || 0;
      +                } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === "string") {
      +                    ruleConfig[0] = RULE_SEVERITY[ruleConfig[0].toLowerCase()] || 0;
      +                }
      +            });
      +        }
      +    },
      +
      +    /**
      +     * Converts old-style severity settings (0, 1, 2) into new-style
      +     * severity settings (off, warn, error) for all rules. Assumption is that severity
      +     * values have already been validated as correct.
      +     * @param {Object} config The config object to normalize.
      +     * @returns {void}
      +     */
      +    normalizeToStrings: function(config) {
      +
      +        if (config.rules) {
      +            Object.keys(config.rules).forEach(function(ruleId) {
      +                var ruleConfig = config.rules[ruleId];
      +
      +                if (typeof ruleConfig === "number") {
      +                    config.rules[ruleId] = RULE_SEVERITY_STRINGS[ruleConfig] || RULE_SEVERITY_STRINGS[0];
      +                } else if (Array.isArray(ruleConfig) && typeof ruleConfig[0] === "number") {
      +                    ruleConfig[0] = RULE_SEVERITY_STRINGS[ruleConfig[0]] || RULE_SEVERITY_STRINGS[0];
      +                }
      +            });
      +        }
      +    },
      +
      +    /**
      +     * Determines if the severity for the given rule configuration represents an error.
      +     * @param {int|string|Array} ruleConfig The configuration for an individual rule.
      +     * @returns {boolean} True if the rule represents an error, false if not.
      +     */
      +    isErrorSeverity: function(ruleConfig) {
      +
      +        var severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;
      +
      +        if (typeof severity === "string") {
      +            severity = RULE_SEVERITY[severity.toLowerCase()] || 0;
      +        }
      +
      +        return (typeof severity === "number" && severity === 2);
      +    }
      +
      +};
      diff --git a/tools/eslint/lib/config/config-rule.js b/tools/eslint/lib/config/config-rule.js
      new file mode 100644
      index 00000000000000..513e0f4bda309b
      --- /dev/null
      +++ b/tools/eslint/lib/config/config-rule.js
      @@ -0,0 +1,325 @@
      +/**
      + * @fileoverview Create configurations for a rule
      + * @author Ian VanSchooten
      + * @copyright 2016 Ian VanSchooten. All rights reserved.
      + * See LICENSE in root directory for full license.
      + */
      +
      +"use strict";
      +
      +//------------------------------------------------------------------------------
      +// Requirements
      +//------------------------------------------------------------------------------
      +
      +var rules = require("../rules"),
      +    loadRules = require("../load-rules");
      +
      +
      +//------------------------------------------------------------------------------
      +// Helpers
      +//------------------------------------------------------------------------------
      +
      +/**
      + * Wrap all of the elements of an array into arrays.
      + * @param   {*[]}     xs Any array.
      + * @returns {Array[]}    An array of arrays.
      + */
      +function explodeArray(xs) {
      +    return xs.reduce(function(accumulator, x) {
      +        accumulator.push([x]);
      +        return accumulator;
      +    }, []);
      +}
      +
      +/**
      + * Mix two arrays such that each element of the second array is concatenated
      + * onto each element of the first array.
      + *
      + * For example:
      + * combineArrays([a, [b, c]], [x, y]); // -> [[a, x], [a, y], [b, c, x], [b, c, y]]
      + *
      + * @param   {array} arr1 The first array to combine.
      + * @param   {array} arr2 The second array to combine.
      + * @returns {array}      A mixture of the elements of the first and second arrays.
      + */
      +function combineArrays(arr1, arr2) {
      +    var res = [];
      +
      +    if (arr1.length === 0) {
      +        return explodeArray(arr2);
      +    }
      +    if (arr2.length === 0) {
      +        return explodeArray(arr1);
      +    }
      +    arr1.forEach(function(x1) {
      +        arr2.forEach(function(x2) {
      +            res.push([].concat(x1, x2));
      +        });
      +    });
      +    return res;
      +}
      +
      +/**
      + * Group together valid rule configurations based on object properties
      + *
      + * e.g.:
      + * groupByProperty([
      + *     {before: true},
      + *     {before: false},
      + *     {after: true},
      + *     {after: false}
      + * ]);
      + *
      + * will return:
      + * [
      + *     [{before: true}, {before: false}],
      + *     [{after: true}, {after: false}]
      + * ]
      + *
      + * @param   {Object[]} objects Array of objects, each with one property/value pair
      + * @returns {Array[]}          Array of arrays of objects grouped by property
      + */
      +function groupByProperty(objects) {
      +    var groupedObj = objects.reduce(function(accumulator, obj) {
      +        var prop = Object.keys(obj)[0];
      +
      +        accumulator[prop] = accumulator[prop] ? accumulator[prop].concat(obj) : [obj];
      +        return accumulator;
      +    }, {});
      +
      +    return Object.keys(groupedObj).map(function(prop) {
      +        return groupedObj[prop];
      +    });
      +}
      +
      +
      +//------------------------------------------------------------------------------
      +// Private
      +//------------------------------------------------------------------------------
      +
      +/**
      + * Configuration settings for a rule.
      + *
      + * A configuration can be a single number (severity), or an array where the first
      + * element in the array is the severity, and is the only required element.
      + * Configs may also have one or more additional elements to specify rule
      + * configuration or options.
      + *
      + * @typedef {array|number} ruleConfig
      + * @param {number}  0  The rule's severity (0, 1, 2).
      + */
      +
      +/**
      + * Object whose keys are rule names and values are arrays of valid ruleConfig items
      + * which should be linted against the target source code to determine error counts.
      + * (a ruleConfigSet.ruleConfigs).
      + *
      + * e.g. rulesConfig = {
      + *     "comma-dangle": [2, [2, "always"], [2, "always-multiline"], [2, "never"]],
      + *     "no-console": [2]
      + * }
      + * @typedef rulesConfig
      + */
      +
      +
      +/**
      + * Create valid rule configurations by combining two arrays,
      + * with each array containing multiple objects each with a
      + * single property/value pair and matching properties.
      + *
      + * e.g.:
      + * combinePropertyObjects(
      + *     [{before: true}, {before: false}],
      + *     [{after: true}, {after: false}]
      + * );
      + *
      + * will return:
      + * [
      + *     {before: true, after: true},
      + *     {before: true, after: false},
      + *     {before: false, after: true},
      + *     {before: false, after: false}
      + * ]
      + *
      + * @param   {Object[]} objArr1 Single key/value objects, all with the same key
      + * @param   {Object[]} objArr2 Single key/value objects, all with another key
      + * @returns {Object[]}         Combined objects for each combination of input properties and values
      + */
      +function combinePropertyObjects(objArr1, objArr2) {
      +    var res = [];
      +
      +    if (objArr1.length === 0) {
      +        return objArr2;
      +    }
      +    if (objArr2.length === 0) {
      +        return objArr1;
      +    }
      +    objArr1.forEach(function(obj1) {
      +        objArr2.forEach(function(obj2) {
      +            var combinedObj = {};
      +            var obj1Props = Object.keys(obj1);
      +            var obj2Props = Object.keys(obj2);
      +
      +            obj1Props.forEach(function(prop1) {
      +                combinedObj[prop1] = obj1[prop1];
      +            });
      +            obj2Props.forEach(function(prop2) {
      +                combinedObj[prop2] = obj2[prop2];
      +            });
      +            res.push(combinedObj);
      +        });
      +    });
      +    return res;
      +}
      +
      + /**
      +  * Creates a new instance of a rule configuration set
      +  *
      +  * A rule configuration set is an array of configurations that are valid for a
      +  * given rule.  For example, the configuration set for the "semi" rule could be:
      +  *
      +  * ruleConfigSet.ruleConfigs // -> [[2], [2, "always"], [2, "never"]]
      +  *
      +  * @param {ruleConfig[]} configs Valid rule configurations
      +  * @constructor
      +  */
      +function RuleConfigSet(configs) {
      +
      +    /**
      +    * Stored valid rule configurations for this instance
      +    * @type {array}
      +    */
      +    this.ruleConfigs = configs || [];
      +
      +}
      +
      +RuleConfigSet.prototype = {
      +
      +    constructor: RuleConfigSet,
      +
      +    /**
      +    * Add a severity level to the front of all configs in the instance.
      +    * This should only be called after all configs have been added to the instance.
      +    *
      +    * @param {number} [severity=2] The level of severity for the rule (0, 1, 2)
      +    * @returns {void}
      +    */
      +    addErrorSeverity: function(severity) {
      +        severity = severity || 2;
      +
      +        this.ruleConfigs = this.ruleConfigs.map(function(config) {
      +            config.unshift(severity);
      +            return config;
      +        });
      +
      +        // Add a single config at the beginning consisting of only the severity
      +        this.ruleConfigs.unshift(severity);
      +    },
      +
      +    /**
      +    * Add rule configs from an array of strings (schema enums)
      +    * @param  {string[]} enums Array of valid rule options (e.g. ["always", "never"])
      +    * @returns {void}
      +    */
      +    addEnums: function(enums) {
      +        this.ruleConfigs = this.ruleConfigs.concat(combineArrays(this.ruleConfigs, enums));
      +    },
      +
      +    /**
      +    * Add rule configurations from a schema object
      +    * @param  {Object} obj Schema item with type === "object"
      +    * @returns {void}
      +    */
      +    addObject: function(obj) {
      +        var objectConfigSet = {
      +            objectConfigs: [],
      +            add: function(property, values) {
      +                var optionObj;
      +
      +                for (var idx = 0; idx < values.length; idx++) {
      +                    optionObj = {};
      +                    optionObj[property] = values[idx];
      +                    this.objectConfigs.push(optionObj);
      +                }
      +            },
      +
      +            combine: function() {
      +                this.objectConfigs = groupByProperty(this.objectConfigs).reduce(function(accumulator, objArr) {
      +                    return combinePropertyObjects(accumulator, objArr);
      +                }, []);
      +            }
      +        };
      +
      +        /*
      +         * The object schema could have multiple independent properties.
      +         * If any contain enums or booleans, they can be added and then combined
      +         */
      +        Object.keys(obj.properties).forEach(function(prop) {
      +            if (obj.properties[prop].enum) {
      +                objectConfigSet.add(prop, obj.properties[prop].enum);
      +            }
      +            if (obj.properties[prop].type && obj.properties[prop].type === "boolean") {
      +                objectConfigSet.add(prop, [true, false]);
      +            }
      +        });
      +        objectConfigSet.combine();
      +
      +        if (objectConfigSet.objectConfigs.length > 0) {
      +            this.ruleConfigs = this.ruleConfigs.concat(combineArrays(this.ruleConfigs, objectConfigSet.objectConfigs));
      +        }
      +    }
      +};
      +
      +/**
      +* Generate valid rule configurations based on a schema object
      +* @param   {Object} schema  A rule's schema object
      +* @returns {array[]}        Valid rule configurations
      +*/
      +function generateConfigsFromSchema(schema) {
      +    var configSet = new RuleConfigSet();
      +
      +    if (Array.isArray(schema)) {
      +        schema.forEach(function(opt) {
      +            if (opt.enum) {
      +                configSet.addEnums(opt.enum);
      +            }
      +
      +            if (opt.type && opt.type === "object") {
      +                configSet.addObject(opt);
      +            }
      +
      +            if (opt.oneOf) {
      +
      +                // TODO (IanVS): not yet implemented
      +            }
      +        });
      +    }
      +    configSet.addErrorSeverity();
      +    return configSet.ruleConfigs;
      +}
      +
      +/**
      +* Generate possible rule configurations for all of the core rules
      +* @returns {rulesConfig} Hash of rule names and arrays of possible configurations
      +*/
      +function createCoreRuleConfigs() {
      +    var ruleList = loadRules();
      +
      +    return Object.keys(ruleList).reduce(function(accumulator, id) {
      +        var rule = rules.get(id);
      +        var schema = (typeof rule === "function") ? rule.schema : rule.meta.schema;
      +
      +        accumulator[id] = generateConfigsFromSchema(schema);
      +        return accumulator;
      +    }, {});
      +}
      +
      +
      +//------------------------------------------------------------------------------
      +// Public Interface
      +//------------------------------------------------------------------------------
      +
      +module.exports = {
      +    generateConfigsFromSchema: generateConfigsFromSchema,
      +    createCoreRuleConfigs: createCoreRuleConfigs
      +};
      diff --git a/tools/eslint/lib/config/config-validator.js b/tools/eslint/lib/config/config-validator.js
      new file mode 100644
      index 00000000000000..d273b26683c375
      --- /dev/null
      +++ b/tools/eslint/lib/config/config-validator.js
      @@ -0,0 +1,180 @@
      +/**
      + * @fileoverview Validates configs.
      + * @author Brandon Mills
      + * @copyright 2015 Brandon Mills
      + * See LICENSE file in root directory for full license.
      + */
      +
      +"use strict";
      +
      +//------------------------------------------------------------------------------
      +// Requirements
      +//------------------------------------------------------------------------------
      +
      +var rules = require("../rules"),
      +    Environments = require("./environments"),
      +    schemaValidator = require("is-my-json-valid"),
      +    util = require("util");
      +
      +var validators = {
      +    rules: Object.create(null)
      +};
      +
      +//------------------------------------------------------------------------------
      +// Private
      +//------------------------------------------------------------------------------
      +
      +/**
      + * Gets a complete options schema for a rule.
      + * @param {string} id The rule's unique name.
      + * @returns {object} JSON Schema for the rule's options.
      + */
      +function getRuleOptionsSchema(id) {
      +    var rule = rules.get(id),
      +        schema = rule && rule.schema || rule && rule.meta && rule.meta.schema;
      +
      +    // Given a tuple of schemas, insert warning level at the beginning
      +    if (Array.isArray(schema)) {
      +        if (schema.length) {
      +            return {
      +                "type": "array",
      +                "items": schema,
      +                "minItems": 0,
      +                "maxItems": schema.length
      +            };
      +        } else {
      +            return {
      +                "type": "array",
      +                "minItems": 0,
      +                "maxItems": 0
      +            };
      +        }
      +    }
      +
      +    // Given a full schema, leave it alone
      +    return schema || null;
      +}
      +
      +/**
      + * Validates a rule's options against its schema.
      + * @param {string} id The rule's unique name.
      + * @param {array|number} options The given options for the rule.
      + * @param {string} source The name of the configuration source.
      + * @returns {void}
      + */
      +function validateRuleOptions(id, options, source) {
      +    var validateRule = validators.rules[id],
      +        message,
      +        severity,
      +        localOptions,
      +        schema = getRuleOptionsSchema(id),
      +        validSeverity = true;
      +
      +    if (!validateRule && schema) {
      +        validateRule = schemaValidator(schema, { verbose: true });
      +        validators.rules[id] = validateRule;
      +    }
      +
      +    // if it's not an array, it should be just a severity
      +    if (Array.isArray(options)) {
      +        localOptions = options.concat();    // clone
      +        severity = localOptions.shift();
      +    } else {
      +        severity = options;
      +        localOptions = [];
      +    }
      +
      +    validSeverity = (
      +        severity === 0 || severity === 1 || severity === 2 ||
      +        (typeof severity === "string" && /^(?:off|warn|error)$/i.test(severity))
      +    );
      +
      +    if (validateRule) {
      +        validateRule(localOptions);
      +    }
      +
      +    if ((validateRule && validateRule.errors) || !validSeverity) {
      +        message = [
      +            source, ":\n",
      +            "\tConfiguration for rule \"", id, "\" is invalid:\n"
      +        ];
      +
      +        if (!validSeverity) {
      +            message.push(
      +                "\tSeverity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '",
      +                util.inspect(severity).replace(/'/g, "\"").replace(/\n/g, ""),
      +                "').\n"
      +            );
      +        }
      +
      +        if (validateRule && validateRule.errors) {
      +            validateRule.errors.forEach(function(error) {
      +                message.push(
      +                    "\tValue \"", error.value, "\" ", error.message, ".\n"
      +                );
      +            });
      +        }
      +
      +        throw new Error(message.join(""));
      +    }
      +}
      +
      +/**
      + * Validates an environment object
      + * @param {object} environment The environment config object to validate.
      + * @param {string} source The location to report with any errors.
      + * @returns {void}
      + */
      +function validateEnvironment(environment, source) {
      +
      +    // not having an environment is ok
      +    if (!environment) {
      +        return;
      +    }
      +
      +    if (Array.isArray(environment)) {
      +        throw new Error("Environment must not be an array");
      +    }
      +
      +    if (typeof environment === "object") {
      +        Object.keys(environment).forEach(function(env) {
      +            if (!Environments.get(env)) {
      +                var message = [
      +                    source, ":\n",
      +                    "\tEnvironment key \"", env, "\" is unknown\n"
      +                ];
      +
      +                throw new Error(message.join(""));
      +            }
      +        });
      +    } else {
      +        throw new Error("Environment must be an object");
      +    }
      +}
      +
      +/**
      + * Validates an entire config object.
      + * @param {object} config The config object to validate.
      + * @param {string} source The location to report with any errors.
      + * @returns {void}
      + */
      +function validate(config, source) {
      +
      +    if (typeof config.rules === "object") {
      +        Object.keys(config.rules).forEach(function(id) {
      +            validateRuleOptions(id, config.rules[id], source);
      +        });
      +    }
      +
      +    validateEnvironment(config.env, source);
      +}
      +
      +//------------------------------------------------------------------------------
      +// Public Interface
      +//------------------------------------------------------------------------------
      +
      +module.exports = {
      +    getRuleOptionsSchema: getRuleOptionsSchema,
      +    validate: validate,
      +    validateRuleOptions: validateRuleOptions
      +};
      diff --git a/tools/eslint/lib/config/environments.js b/tools/eslint/lib/config/environments.js
      new file mode 100644
      index 00000000000000..6470eec1b38bc8
      --- /dev/null
      +++ b/tools/eslint/lib/config/environments.js
      @@ -0,0 +1,87 @@
      +/**
      + * @fileoverview Environments manager
      + * @author Nicholas C. Zakas
      + * @copyright 2016 Nicholas C. Zakas. All rights reserved.
      + * See LICENSE file in root directory for full license.
      + */
      +"use strict";
      +
      +//------------------------------------------------------------------------------
      +// Requirements
      +//------------------------------------------------------------------------------
      +
      +var debug = require("debug"),
      +    envs = require("../../conf/environments");
      +
      +//------------------------------------------------------------------------------
      +// Private
      +//------------------------------------------------------------------------------
      +
      +debug = debug("eslint:enviroments");
      +
      +var environments = Object.create(null);
      +
      +/**
      + * Loads the default environments.
      + * @returns {void}
      + * @private
      + */
      +function load() {
      +    Object.keys(envs).forEach(function(envName) {
      +        environments[envName] = envs[envName];
      +    });
      +}
      +
      +// always load default environments upfront
      +load();
      +
      +//------------------------------------------------------------------------------
      +// Public Interface
      +//------------------------------------------------------------------------------
      +
      +module.exports = {
      +
      +    load: load,
      +
      +    /**
      +     * Gets the environment with the given name.
      +     * @param {string} name The name of the environment to retrieve.
      +     * @returns {Object?} The environment object or null if not found.
      +     */
      +    get: function(name) {
      +        return environments[name] || null;
      +    },
      +
      +    /**
      +     * Defines an environment.
      +     * @param {string} name The name of the environment.
      +     * @param {Object} env The environment settings.
      +     * @returns {void}
      +     */
      +    define: function(name, env) {
      +        environments[name] = env;
      +    },
      +
      +    /**
      +     * Imports all environments from a plugin.
      +     * @param {Object} plugin The plugin object.
      +     * @param {string} pluginName The name of the plugin.
      +     * @returns {void}
      +     */
      +    importPlugin: function(plugin, pluginName) {
      +        if (plugin.environments) {
      +            Object.keys(plugin.environments).forEach(function(envName) {
      +                this.define(pluginName + "/" + envName, plugin.environments[envName]);
      +            }, this);
      +        }
      +    },
      +
      +    /**
      +     * Resets all environments. Only use for tests!
      +     * @returns {void}
      +     */
      +    testReset: function() {
      +        environments = Object.create(null);
      +        load();
      +    }
      +};
      diff --git a/tools/eslint/lib/config/plugins.js b/tools/eslint/lib/config/plugins.js
      new file mode 100644
      index 00000000000000..d1bfbd83fa0c37
      --- /dev/null
      +++ b/tools/eslint/lib/config/plugins.js
      @@ -0,0 +1,148 @@
      +/**
      + * @fileoverview Plugins manager
      + * @author Nicholas C. Zakas
      + * @copyright 2016 Nicholas C. Zakas. All rights reserved.
      + * See LICENSE file in root directory for full license.
      + */
      +"use strict";
      +
      +//------------------------------------------------------------------------------
      +// Requirements
      +//------------------------------------------------------------------------------
      +
      +var debug = require("debug"),
      +    Environments = require("./environments"),
      +    rules = require("../rules");
      +
      +//------------------------------------------------------------------------------
      +// Private
      +//------------------------------------------------------------------------------
      +
      +debug = debug("eslint:plugins");
      +
      +var plugins = Object.create(null);
      +
      +var PLUGIN_NAME_PREFIX = "eslint-plugin-",
      +    NAMESPACE_REGEX = /^@.*\//i;
      +
      +/**
      + * Removes the prefix `eslint-plugin-` from a plugin name.
      + * @param {string} pluginName The name of the plugin which may have the prefix.
      + * @returns {string} The name of the plugin without prefix.
      + */
      +function removePrefix(pluginName) {
      +    return pluginName.indexOf(PLUGIN_NAME_PREFIX) === 0 ? pluginName.substring(PLUGIN_NAME_PREFIX.length) : pluginName;
      +}
      +
      +/**
      + * Gets the scope (namespace) of a plugin.
      + * @param {string} pluginName The name of the plugin which may have the prefix.
      + * @returns {string} The name of the plugins namepace if it has one.
      + */
      +function getNamespace(pluginName) {
      +    return pluginName.match(NAMESPACE_REGEX) ? pluginName.match(NAMESPACE_REGEX)[0] : "";
      +}
      +
      +/**
      + * Removes the namespace from a plugin name.
      + * @param {string} pluginName The name of the plugin which may have the prefix.
      + * @returns {string} The name of the plugin without the namespace.
      + */
      +function removeNamespace(pluginName) {
      +    return pluginName.replace(NAMESPACE_REGEX, "");
      +}
      +
      +//------------------------------------------------------------------------------
      +// Public Interface
      +//------------------------------------------------------------------------------
      +
      +module.exports = {
      +
      +    removePrefix: removePrefix,
      +    getNamespace: getNamespace,
      +    removeNamespace: removeNamespace,
      +
      +    /**
      +     * Defines a plugin with a given name rather than loading from disk.
      +     * @param {string} pluginName The name of the plugin to load.
      +     * @param {Object} plugin The plugin object.
      +     * @returns {void}
      +     */
      +    define: function(pluginName, plugin) {
      +        var pluginNameWithoutNamespace = removeNamespace(pluginName),
      +            pluginNameWithoutPrefix = removePrefix(pluginNameWithoutNamespace);
      +
      +        plugins[pluginNameWithoutPrefix] = plugin;
      +
      +        // load up environments and rules
      +        Environments.importPlugin(plugin, pluginNameWithoutPrefix);
      +
      +        if (plugin.rules) {
      +            rules.import(plugin.rules, pluginNameWithoutPrefix);
      +        }
      +    },
      +
      +    /**
      +     * Gets a plugin with the given name.
      +     * @param {string} pluginName The name of the plugin to retrieve.
      +     * @returns {Object} The plugin or null if not loaded.
      +     */
      +    get: function(pluginName) {
      +        return plugins[pluginName] || null;
      +    },
      +
      +    /**
      +     * Returns all plugins that are loaded.
      +     * @returns {Object} The plugins cache.
      +     */
      +    getAll: function() {
      +        return plugins;
      +    },
      +
      +    /**
      +     * Loads a plugin with the given name.
      +     * @param {string} pluginName The name of the plugin to load.
      +     * @returns {void}
      +     * @throws {Error} If the plugin cannot be loaded.
      +     */
      +    load: function(pluginName) {
      +        var pluginNamespace = getNamespace(pluginName),
      +            pluginNameWithoutNamespace = removeNamespace(pluginName),
      +            pluginNameWithoutPrefix = removePrefix(pluginNameWithoutNamespace),
      +            plugin = null;
      +
      +        if (!plugins[pluginNameWithoutPrefix]) {
      +            try {
      +                plugin = require(pluginNamespace + PLUGIN_NAME_PREFIX + pluginNameWithoutPrefix);
      +            } catch (err) {
      +                debug("Failed to load plugin eslint-plugin-" + pluginNameWithoutPrefix + ". Proceeding without it.");
      +                err.message = "Failed to load plugin " + pluginName + ": " + err.message;
      +                err.messageTemplate = "plugin-missing";
      +                err.messageData = {
      +                    pluginName: pluginNameWithoutPrefix
      +                };
      +                throw err;
      +            }
      +
      +            this.define(pluginName, plugin);
      +        }
      +    },
      +
      +    /**
      +     * Loads all plugins from an array.
      +     * @param {string[]} pluginNames An array of plugins names.
      +     * @returns {void}
      +     * @throws {Error} If a plugin cannot be loaded.
      +     */
      +    loadAll: function(pluginNames) {
      +        pluginNames.forEach(this.load, this);
      +    },
      +
      +    /**
      +     * Resets plugin information. Use for tests only.
      +     * @returns {void}
      +     */
      +    testReset: function() {
      +        plugins = Object.create(null);
      +    }
      +};
      diff --git a/tools/eslint/lib/eslint.js b/tools/eslint/lib/eslint.js
      index 28f6d036d86ac0..b3e6c7483b23d8 100644
      --- a/tools/eslint/lib/eslint.js
      +++ b/tools/eslint/lib/eslint.js
      @@ -1,6 +1,8 @@
       /**
        * @fileoverview Main ESLint object.
        * @author Nicholas C. Zakas
      + * @copyright 2013 Nicholas C. Zakas. All rights reserved.
      + * See LICENSE file in root directory for full license.
        */
       "use strict";
       
      @@ -8,18 +10,25 @@
       // Requirements
       //------------------------------------------------------------------------------
       
      -var estraverse = require("estraverse-fb"),
      +var lodash = require("lodash"),
      +    Traverser = require("./util/traverser"),
           escope = require("escope"),
      -    environments = require("../conf/environments"),
      -    assign = require("object-assign"),
      +    Environments = require("./config/environments"),
      +    blankScriptAST = require("../conf/blank-script.json"),
           rules = require("./rules"),
      -    util = require("./util"),
           RuleContext = require("./rule-context"),
           timing = require("./timing"),
      -    createTokenStore = require("./token-store.js"),
      +    SourceCode = require("./util/source-code"),
      +    NodeEventGenerator = require("./util/node-event-generator"),
      +    CommentEventGenerator = require("./util/comment-event-generator"),
           EventEmitter = require("events").EventEmitter,
      -    escapeRegExp = require("escape-string-regexp"),
      -    validator = require("./config-validator");
      +    ConfigOps = require("./config/config-ops"),
      +    validator = require("./config/config-validator"),
      +    replacements = require("../conf/replacements.json"),
      +    assert = require("assert"),
      +    CodePathAnalyzer = require("./code-path-analysis/code-path-analyzer");
      +
      +var DEFAULT_PARSER = require("../conf/eslint.json").parser;
       
       //------------------------------------------------------------------------------
       // Helpers
      @@ -29,26 +38,34 @@ var estraverse = require("estraverse-fb"),
        * Parses a list of "name:boolean_value" or/and "name" options divided by comma or
        * whitespace.
        * @param {string} string The string to parse.
      + * @param {Comment} comment The comment node which has the string.
        * @returns {Object} Result map object of names and boolean values
        */
      -function parseBooleanConfig(string) {
      +function parseBooleanConfig(string, comment) {
           var items = {};
      +
           // Collapse whitespace around : to make parsing easier
           string = string.replace(/\s*:\s*/g, ":");
      +
           // Collapse whitespace around ,
           string = string.replace(/\s*,\s*/g, ",");
      +
           string.split(/\s|,+/).forEach(function(name) {
               if (!name) {
                   return;
               }
               var pos = name.indexOf(":"),
                   value;
      +
               if (pos !== -1) {
                   value = name.substring(pos + 1, name.length);
                   name = name.substring(0, pos);
               }
       
      -        items[name] = (value === "true");
      +        items[name] = {
      +            value: (value === "true"),
      +            comment: comment
      +        };
       
           });
           return items;
      @@ -63,17 +80,20 @@ function parseBooleanConfig(string) {
        */
       function parseJsonConfig(string, location, messages) {
           var items = {};
      +
           string = string.replace(/([a-zA-Z0-9\-\/]+):/g, "\"$1\":").replace(/(\]|[0-9])\s+(?=")/, "$1,");
           try {
               items = JSON.parse("{" + string + "}");
      -    } catch(ex) {
      +    } catch (ex) {
       
               messages.push({
      +            ruleId: null,
                   fatal: true,
                   severity: 2,
      +            source: null,
                   message: "Failed to parse JSON from '" + string + "': " + ex.message,
                   line: location.start.line,
      -            column: location.start.column
      +            column: location.start.column + 1
               });
       
           }
      @@ -88,8 +108,10 @@ function parseJsonConfig(string, location, messages) {
        */
       function parseListConfig(string) {
           var items = {};
      +
           // Collapse whitespace around ,
           string = string.replace(/\s*,\s*/g, ",");
      +
           string.split(/,+/).forEach(function(name) {
               name = name.trim();
               if (!name) {
      @@ -100,25 +122,6 @@ function parseListConfig(string) {
           return items;
       }
       
      -/**
      - * @param {Scope} scope The scope object to check.
      - * @param {string} name The name of the variable to look up.
      - * @returns {Variable} The variable object if found or null if not.
      - */
      -function getVariable(scope, name) {
      -    var variable = null;
      -    scope.variables.some(function(v) {
      -        if (v.name === name) {
      -            variable = v;
      -            return true;
      -        } else {
      -            return false;
      -        }
      -
      -    });
      -    return variable;
      -}
      -
       /**
        * Ensures that variables representing built-in properties of the Global Object,
        * and any globals declared by special block comments, are present in the global
      @@ -130,41 +133,83 @@ function getVariable(scope, name) {
        */
       function addDeclaredGlobals(program, globalScope, config) {
           var declaredGlobals = {},
      +        exportedGlobals = {},
               explicitGlobals = {},
      -        builtin = environments.builtin;
      +        builtin = Environments.get("builtin");
       
      -    assign(declaredGlobals, builtin);
      +    lodash.assign(declaredGlobals, builtin);
       
      -    Object.keys(config.env).forEach(function (name) {
      +    Object.keys(config.env).forEach(function(name) {
               if (config.env[name]) {
      -            var environmentGlobals = environments[name] && environments[name].globals;
      +            var env = Environments.get(name),
      +                environmentGlobals = env && env.globals;
      +
                   if (environmentGlobals) {
      -                assign(declaredGlobals, environmentGlobals);
      +                lodash.assign(declaredGlobals, environmentGlobals);
                   }
               }
           });
       
      -    assign(declaredGlobals, config.globals);
      -    assign(explicitGlobals, config.astGlobals);
      +    lodash.assign(exportedGlobals, config.exported);
      +    lodash.assign(declaredGlobals, config.globals);
      +    lodash.assign(explicitGlobals, config.astGlobals);
       
           Object.keys(declaredGlobals).forEach(function(name) {
      -        var variable = getVariable(globalScope, name);
      +        var variable = globalScope.set.get(name);
      +
               if (!variable) {
                   variable = new escope.Variable(name, globalScope);
                   variable.eslintExplicitGlobal = false;
                   globalScope.variables.push(variable);
      +            globalScope.set.set(name, variable);
               }
               variable.writeable = declaredGlobals[name];
           });
       
           Object.keys(explicitGlobals).forEach(function(name) {
      -        var variable = getVariable(globalScope, name);
      +        var variable = globalScope.set.get(name);
      +
               if (!variable) {
                   variable = new escope.Variable(name, globalScope);
                   variable.eslintExplicitGlobal = true;
      +            variable.eslintExplicitGlobalComment = explicitGlobals[name].comment;
                   globalScope.variables.push(variable);
      +            globalScope.set.set(name, variable);
      +        }
      +        variable.writeable = explicitGlobals[name].value;
      +    });
      +
      +    // mark all exported variables as such
      +    Object.keys(exportedGlobals).forEach(function(name) {
      +        var variable = globalScope.set.get(name);
      +
      +        if (variable) {
      +            variable.eslintUsed = true;
      +        }
      +    });
      +
      +    /*
      +     * "through" contains all references which definitions cannot be found.
      +     * Since we augment the global scope using configuration, we need to update
      +     * references and remove the ones that were added by configuration.
      +     */
      +    globalScope.through = globalScope.through.filter(function(reference) {
      +        var name = reference.identifier.name;
      +        var variable = globalScope.set.get(name);
      +
      +        if (variable) {
      +
      +            /*
      +             * Links the variable and the reference.
      +             * And this reference is removed from `Scope#through`.
      +             */
      +            reference.resolved = variable;
      +            variable.references.push(reference);
      +
      +            return false;
               }
      -        variable.writeable = explicitGlobals[name];
      +
      +        return true;
           });
       }
       
      @@ -209,15 +254,17 @@ function enableReporting(reportingConfig, start, rulesToEnable) {
           if (rulesToEnable.length) {
               rulesToEnable.forEach(function(rule) {
                   for (i = reportingConfig.length - 1; i >= 0; i--) {
      -                if (!reportingConfig[i].end && reportingConfig[i].rule === rule ) {
      +                if (!reportingConfig[i].end && reportingConfig[i].rule === rule) {
                           reportingConfig[i].end = start;
                           break;
                       }
                   }
               });
           } else {
      +
               // find all previous disabled locations if they was started as list of rules
               var prevStart;
      +
               for (i = reportingConfig.length - 1; i >= 0; i--) {
                   if (prevStart && prevStart !== reportingConfig[i].start) {
                       break;
      @@ -240,11 +287,12 @@ function enableReporting(reportingConfig, start, rulesToEnable) {
        * @param {Object} config The existing configuration data.
        * @param {Object[]} reportingConfig The existing reporting configuration data.
        * @param {Object[]} messages The messages queue.
      - * @returns {void}
      + * @returns {object} Modified config object
        */
       function modifyConfigsFromComments(filename, ast, config, reportingConfig, messages) {
       
           var commentConfig = {
      +        exported: {},
               astGlobals: {},
               rules: {},
               env: {}
      @@ -254,20 +302,24 @@ function modifyConfigsFromComments(filename, ast, config, reportingConfig, messa
           ast.comments.forEach(function(comment) {
       
               var value = comment.value.trim();
      -        var match = /^(eslint-\w+|eslint-\w+-\w+|eslint|globals?)(\s|$)/.exec(value);
      +        var match = /^(eslint(-\w+){0,3}|exported|globals?)(\s|$)/.exec(value);
       
               if (match) {
                   value = value.substring(match.index + match[1].length);
       
                   if (comment.type === "Block") {
                       switch (match[1]) {
      +                    case "exported":
      +                        lodash.assign(commentConfig.exported, parseBooleanConfig(value, comment));
      +                        break;
      +
                           case "globals":
                           case "global":
      -                        assign(commentConfig.astGlobals, parseBooleanConfig(value));
      +                        lodash.assign(commentConfig.astGlobals, parseBooleanConfig(value, comment));
                               break;
       
                           case "eslint-env":
      -                        assign(commentConfig.env, parseListConfig(value));
      +                        lodash.assign(commentConfig.env, parseListConfig(value));
                               break;
       
                           case "eslint-disable":
      @@ -280,8 +332,10 @@ function modifyConfigsFromComments(filename, ast, config, reportingConfig, messa
       
                           case "eslint":
                               var items = parseJsonConfig(value, comment.loc, messages);
      +
                               Object.keys(items).forEach(function(name) {
                                   var ruleValue = items[name];
      +
                                   validator.validateRuleOptions(name, ruleValue, filename + " line " + comment.loc.start.line);
                                   commentRules[name] = ruleValue;
                               });
      @@ -289,25 +343,29 @@ function modifyConfigsFromComments(filename, ast, config, reportingConfig, messa
       
                           // no default
                       }
      -            } else {
      -                // comment.type === "Line"
      +            } else {        // comment.type === "Line"
                       if (match[1] === "eslint-disable-line") {
                           disableReporting(reportingConfig, { "line": comment.loc.start.line, "column": 0 }, Object.keys(parseListConfig(value)));
                           enableReporting(reportingConfig, comment.loc.end, Object.keys(parseListConfig(value)));
      +                } else if (match[1] === "eslint-disable-next-line") {
      +                    disableReporting(reportingConfig, comment.loc.start, Object.keys(parseListConfig(value)));
      +                    enableReporting(reportingConfig, { "line": comment.loc.start.line + 2 }, Object.keys(parseListConfig(value)));
                       }
                   }
               }
           });
       
           // apply environment configs
      -    Object.keys(commentConfig.env).forEach(function (name) {
      -        if (environments[name]) {
      -            util.mergeConfigs(commentConfig, environments[name]);
      +    Object.keys(commentConfig.env).forEach(function(name) {
      +        var env = Environments.get(name);
      +
      +        if (env) {
      +            commentConfig = ConfigOps.merge(commentConfig, env);
               }
           });
      -    assign(commentConfig.rules, commentRules);
      +    lodash.assign(commentConfig.rules, commentRules);
       
      -    util.mergeConfigs(config, commentConfig);
      +    return ConfigOps.merge(config, commentConfig);
       }
       
       /**
      @@ -322,6 +380,7 @@ function isDisabledByReportingConfig(reportingConfig, ruleId, location) {
           for (var i = 0, c = reportingConfig.length; i < c; i++) {
       
               var ignore = reportingConfig[i];
      +
               if ((!ignore.rule || ignore.rule === ruleId) &&
                   (location.line > ignore.start.line || (location.line === ignore.start.line && location.column >= ignore.start.column)) &&
                   (!ignore.end || (location.line < ignore.end.line || (location.line === ignore.end.line && location.column <= ignore.end.column)))) {
      @@ -343,12 +402,13 @@ function prepareConfig(config) {
           delete config.global;
       
           var copiedRules = {},
      -        ecmaFeatures = {},
      +        parserOptions = {},
               preparedConfig;
       
           if (typeof config.rules === "object") {
               Object.keys(config.rules).forEach(function(k) {
                   var rule = config.rules[k];
      +
                   if (rule === null) {
                       throw new Error("Invalid config for rule '" + k + "'\.");
                   }
      @@ -360,32 +420,123 @@ function prepareConfig(config) {
               });
           }
       
      -    // merge in environment ecmaFeatures
      +    // merge in environment parserOptions
           if (typeof config.env === "object") {
      -        Object.keys(config.env).forEach(function(env) {
      -            if (config.env[env] && environments[env].ecmaFeatures) {
      -                assign(ecmaFeatures, environments[env].ecmaFeatures);
      +        Object.keys(config.env).forEach(function(envName) {
      +            var env = Environments.get(envName);
      +
      +            if (config.env[envName] && env && env.parserOptions) {
      +                parserOptions = ConfigOps.merge(parserOptions, env.parserOptions);
                   }
               });
           }
       
           preparedConfig = {
               rules: copiedRules,
      -        parser: config.parser || "espree",
      -        globals: util.mergeConfigs({}, config.globals),
      -        env: util.mergeConfigs({}, config.env || {}),
      -        settings: util.mergeConfigs({}, config.settings || {}),
      -        ecmaFeatures: util.mergeConfigs(ecmaFeatures, config.ecmaFeatures || {})
      +        parser: config.parser || DEFAULT_PARSER,
      +        globals: ConfigOps.merge({}, config.globals),
      +        env: ConfigOps.merge({}, config.env || {}),
      +        settings: ConfigOps.merge({}, config.settings || {}),
      +        parserOptions: ConfigOps.merge(parserOptions, config.parserOptions || {})
           };
       
      -    // can't have global return inside of modules
      -    if (preparedConfig.ecmaFeatures.modules) {
      -        preparedConfig.ecmaFeatures.globalReturn = false;
      +    if (preparedConfig.parserOptions.sourceType === "module") {
      +        if (!preparedConfig.parserOptions.ecmaFeatures) {
      +            preparedConfig.parserOptions.ecmaFeatures = {};
      +        }
      +
      +        // can't have global return inside of modules
      +        preparedConfig.parserOptions.ecmaFeatures.globalReturn = false;
      +
      +        // also need at least ES6 for modules
      +        if (!preparedConfig.parserOptions.ecmaVersion || preparedConfig.parserOptions.ecmaVersion < 6) {
      +            preparedConfig.parserOptions.ecmaVersion = 6;
      +        }
           }
       
           return preparedConfig;
       }
       
      +/**
      + * Provide a stub rule with a given message
      + * @param  {string} message The message to be displayed for the rule
      + * @returns {Function}      Stub rule function
      + */
      +function createStubRule(message) {
      +
      +    /**
      +     * Creates a fake rule object
      +     * @param {object} context context object for each rule
      +     * @returns {object} collection of node to listen on
      +     */
      +    function createRuleModule(context) {
      +        return {
      +            Program: function(node) {
      +                context.report(node, message);
      +            }
      +        };
      +    }
      +
      +    if (message) {
      +        return createRuleModule;
      +    } else {
      +        throw new Error("No message passed to stub rule");
      +    }
      +}
      +
      +/**
      + * Provide a rule replacement message
      + * @param  {string} ruleId Name of the rule
      + * @returns {string}       Message detailing rule replacement
      + */
      +function getRuleReplacementMessage(ruleId) {
      +    if (ruleId in replacements.rules) {
      +        var newRules = replacements.rules[ruleId];
      +
      +        return "Rule \'" + ruleId + "\' was removed and replaced by: " + newRules.join(", ");
      +    }
      +
      +    return null;
      +}
      +
      +var eslintEnvPattern = /\/\*\s*eslint-env\s(.+?)\*\//g;
      +
      +/**
      + * Checks whether or not there is a comment which has "eslint-env *" in a given text.
      + * @param {string} text - A source code text to check.
      + * @returns {object|null} A result of parseListConfig() with "eslint-env *" comment.
      + */
      +function findEslintEnv(text) {
      +    var match, retv;
      +
      +    eslintEnvPattern.lastIndex = 0;
      +
      +    while ((match = eslintEnvPattern.exec(text))) {
      +        retv = lodash.assign(retv || {}, parseListConfig(match[1]));
      +    }
      +
      +    return retv;
      +}
      +
      +/**
      + * Strips Unicode BOM from a given text.
      + *
      + * @param {string} text - A text to strip.
      + * @returns {string} The stripped text.
      + */
      +function stripUnicodeBOM(text) {
      +
      +    /*
      +     * Check Unicode BOM.
      +     * In JavaScript, string data is stored as UTF-16, so BOM is 0xFEFF.
      +     * http://www.ecma-international.org/ecma-262/6.0/#sec-unicode-format-control-characters
      +     */
      +    if (text.charCodeAt(0) === 0xFEFF) {
      +        return text.slice(1);
      +    }
      +    return text;
      +}
      +
       //------------------------------------------------------------------------------
       // Public Interface
       //------------------------------------------------------------------------------
      @@ -398,19 +549,14 @@ module.exports = (function() {
       
           var api = Object.create(new EventEmitter()),
               messages = [],
      -        currentText = null,
      -        currentTextLines = [],
               currentConfig = null,
      -        currentTokens = null,
               currentScopes = null,
               scopeMap = null,
               scopeManager = null,
               currentFilename = null,
      -        controller = null,
      +        traverser = null,
               reportingConfig = [],
      -        commentLocsEnter = [],
      -        commentLocsExit = [],
      -        currentAST = null;
      +        sourceCode = null;
       
           /**
            * Parses text into an AST. Moved out here because the try-catch prevents
      @@ -423,14 +569,24 @@ module.exports = (function() {
            */
           function parse(text, config) {
       
      -        var parser;
      +        var parser,
      +            parserOptions = {
      +                loc: true,
      +                range: true,
      +                raw: true,
      +                tokens: true,
      +                comment: true,
      +                attachComment: true
      +            };
       
               try {
                   parser = require(config.parser);
               } catch (ex) {
                   messages.push({
      +                ruleId: null,
                       fatal: true,
                       severity: 2,
      +                source: null,
                       message: ex.message,
                       line: 0,
                       column: 0
      @@ -439,6 +595,11 @@ module.exports = (function() {
                   return null;
               }
       
      +        // merge in any additional parser options
      +        if (config.parserOptions) {
      +            parserOptions = lodash.assign({}, config.parserOptions, parserOptions);
      +        }
      +
               /*
                * Check for parsing errors first. If there's a parsing error, nothing
                * else can happen. However, a parsing error does not throw an error
      @@ -446,25 +607,19 @@ module.exports = (function() {
                * problem that ESLint identified just like any other.
                */
               try {
      -            return parser.parse(text, {
      -                loc: true,
      -                range: true,
      -                raw: true,
      -                tokens: true,
      -                comment: true,
      -                attachComment: true,
      -                ecmaFeatures: config.ecmaFeatures
      -            });
      +            return parser.parse(text, parserOptions);
               } catch (ex) {
       
                   // If the message includes a leading line number, strip it:
                   var message = ex.message.replace(/^line \d+:/i, "").trim();
      +            var source = (ex.lineNumber) ? SourceCode.splitLines(text)[ex.lineNumber - 1] : null;
       
                   messages.push({
      +                ruleId: null,
                       fatal: true,
                       severity: 2,
      -
      -                message: message,
      +                source: source,
      +                message: "Parsing error: " + message,
       
                       line: ex.lineNumber,
                       column: ex.column
      @@ -474,46 +629,6 @@ module.exports = (function() {
               }
           }
       
      -    /**
      -     * Check collection of comments to prevent double event for comment as
      -     * leading and trailing, then emit event if passing
      -     * @param {ASTNode[]} comments Collection of comment nodes
      -     * @param {Object[]} locs List of locations of previous comment nodes
      -     * @param {string} eventName Event name postfix
      -     * @returns {void}
      -     */
      -    function emitComments(comments, locs, eventName) {
      -
      -        if (comments.length) {
      -            comments.forEach(function(node) {
      -                if (locs.indexOf(node.loc) >= 0) {
      -                    locs.splice(locs.indexOf(node.loc), 1);
      -                } else {
      -                    locs.push(node.loc);
      -                    api.emit(node.type + eventName, node);
      -                }
      -            });
      -        }
      -    }
      -
      -    /**
      -     * Shortcut to check and emit enter of comment nodes
      -     * @param {ASTNode[]} comments Collection of comment nodes
      -     * @returns {void}
      -     */
      -    function emitCommentsEnter(comments) {
      -        emitComments(comments, commentLocsEnter, "Comment");
      -    }
      -
      -    /**
      -     * Shortcut to check and emit exit of comment nodes
      -     * @param {ASTNode[]} comments Collection of comment nodes
      -     * @returns {void}
      -     */
      -    function emitCommentsExit(comments) {
      -        emitComments(comments, commentLocsExit, "Comment:exit");
      -    }
      -
           /**
            * Get the severity level of a rule (0 - none, 1 - warning, 2 - error)
            * Returns 0 if the rule config is not valid (an Array or a number)
      @@ -553,118 +668,176 @@ module.exports = (function() {
           api.reset = function() {
               this.removeAllListeners();
               messages = [];
      -        currentAST = null;
               currentConfig = null;
      -        currentText = null;
      -        currentTextLines = [];
      -        currentTokens = null;
               currentScopes = null;
               scopeMap = null;
               scopeManager = null;
      -        controller = null;
      +        traverser = null;
               reportingConfig = [];
      -        commentLocsEnter = [];
      -        commentLocsExit = [];
      +        sourceCode = null;
           };
       
      +    /**
      +     * Configuration object for the `verify` API. A JS representation of the eslintrc files.
      +     * @typedef {Object} ESLintConfig
      +     * @property {Object} rules The rule configuration to verify against.
      +     * @property {string} [parser] Parser to use when generatig the AST.
      +     * @property {Object} [parserOptions] Options for the parsed used.
      +     * @property {Object} [settings] Global settings passed to each rule.
      +     * @property {Object} [env] The environment to verify in.
      +     * @property {Object} [globals] Available globalsto the code.
      +     */
      +
           /**
            * Verifies the text against the rules specified by the second argument.
      -     * @param {string} text The JavaScript text to verify.
      -     * @param {Object} config An object whose keys specify the rules to use.
      -     * @param {string=} filename The optional filename of the file being checked.
      -     *      If this is not set, the filename will default to '' in the rule context.
      -     * @param {boolean=} saveState Indicates if the state from the last run should be saved.
      +     * @param {string|SourceCode} textOrSourceCode The text to parse or a SourceCode object.
      +     * @param {ESLintConfig} config An ESLintConfig instance to configure everything.
      +     * @param {(string|Object)} [filenameOrOptions] The optional filename of the file being checked.
      +     *      If this is not set, the filename will default to '' in the rule context. If
      +     *      an object, then it has "filename", "saveState", and "allowInlineConfig" properties.
      +     * @param {boolean} [saveState] Indicates if the state from the last run should be saved.
            *      Mostly useful for testing purposes.
      +     * @param {boolean} [filenameOrOptions.allowInlineConfig] Allow/disallow inline comments' ability to change config once it is set. Defaults to true if not supplied.
      +     *      Useful if you want to validate JS without comments overriding rules.
            * @returns {Object[]} The results as an array of messages or null if no messages.
            */
      -    api.verify = function(text, config, filename, saveState) {
      +    api.verify = function(textOrSourceCode, config, filenameOrOptions, saveState) {
       
               var ast,
                   shebang,
                   ecmaFeatures,
      -            ecmaVersion;
      -
      -        // set the current parsed filename
      -        currentFilename = filename;
      +            ecmaVersion,
      +            allowInlineConfig,
      +            text = (typeof textOrSourceCode === "string") ? textOrSourceCode : null;
      +
      +        // evaluate arguments
      +        if (typeof filenameOrOptions === "object") {
      +            currentFilename = filenameOrOptions.filename;
      +            allowInlineConfig = filenameOrOptions.allowInlineConfig;
      +            saveState = filenameOrOptions.saveState;
      +        } else {
      +            currentFilename = filenameOrOptions;
      +        }
       
               if (!saveState) {
                   this.reset();
               }
       
      -        // there's no input, just exit here
      -        if (text.trim().length === 0) {
      -            currentText = text;
      -            return messages;
      +        // search and apply "eslint-env *".
      +        var envInFile = findEslintEnv(text || textOrSourceCode.text);
      +
      +        if (envInFile) {
      +            if (!config || !config.env) {
      +                config = lodash.assign({}, config || {}, {env: envInFile});
      +            } else {
      +                config = lodash.assign({}, config);
      +                config.env = lodash.assign({}, config.env, envInFile);
      +            }
               }
       
               // process initial config to make it safe to extend
               config = prepareConfig(config || {});
       
      -        ast = parse(text.replace(/^#!([^\r\n]+)/, function(match, captured) {
      -            shebang = captured;
      -            return "//" + captured;
      -        }), config);
      +        // only do this for text
      +        if (text !== null) {
      +
      +            // there's no input, just exit here
      +            if (text.trim().length === 0) {
      +                sourceCode = new SourceCode(text, blankScriptAST);
      +                return messages;
      +            }
      +
      +            ast = parse(
      +                stripUnicodeBOM(text).replace(/^#!([^\r\n]+)/, function(match, captured) {
      +                    shebang = captured;
      +                    return "//" + captured;
      +                }),
      +                config
      +            );
      +
      +            if (ast) {
      +                sourceCode = new SourceCode(text, ast);
      +            }
      +
      +        } else {
      +            sourceCode = textOrSourceCode;
      +            ast = sourceCode.ast;
      +        }
       
               // if espree failed to parse the file, there's no sense in setting up rules
               if (ast) {
       
      -            currentAST = ast;
      -
                   // parse global comments and modify config
      -            modifyConfigsFromComments(filename, ast, config, reportingConfig, messages);
      +            if (allowInlineConfig !== false) {
      +                config = modifyConfigsFromComments(currentFilename, ast, config, reportingConfig, messages);
      +            }
      +
      +            // ensure that severities are normalized in the config
      +            ConfigOps.normalize(config);
       
                   // enable appropriate rules
                   Object.keys(config.rules).filter(function(key) {
                       return getRuleSeverity(config.rules[key]) > 0;
                   }).forEach(function(key) {
      -
      -                var ruleCreator = rules.get(key),
      -                    severity = getRuleSeverity(config.rules[key]),
      -                    options = getRuleOptions(config.rules[key]),
      +                var ruleCreator,
      +                    severity,
      +                    options,
                           rule;
       
      -                if (ruleCreator) {
      -                    try {
      -                        rule = ruleCreator(new RuleContext(
      -                            key, api, severity, options,
      -                            config.settings, config.ecmaFeatures
      -                        ));
      -
      -                        // add all the node types as listeners
      -                        Object.keys(rule).forEach(function(nodeType) {
      -                            api.on(nodeType, timing.enabled
      -                                ? timing.time(key, rule[nodeType])
      -                                : rule[nodeType]
      -                            );
      -                        });
      -                    } catch(ex) {
      -                        ex.message = "Error while loading rule '" + key + "': " + ex.message;
      -                        throw ex;
      +                ruleCreator = rules.get(key);
      +
      +                if (!ruleCreator) {
      +                    var replacementMsg = getRuleReplacementMessage(key);
      +
      +                    if (replacementMsg) {
      +                        ruleCreator = createStubRule(replacementMsg);
      +                    } else {
      +                        ruleCreator = createStubRule("Definition for rule '" + key + "' was not found");
                           }
      +                    rules.define(key, ruleCreator);
      +                }
       
      -                } else {
      -                    throw new Error("Definition for rule '" + key + "' was not found.");
      +                severity = getRuleSeverity(config.rules[key]);
      +                options = getRuleOptions(config.rules[key]);
      +
      +                try {
      +                    var ruleContext = new RuleContext(
      +                        key, api, severity, options,
      +                        config.settings, config.parserOptions, config.parser, ruleCreator.meta);
      +
      +                    rule = ruleCreator.create ? ruleCreator.create(ruleContext) :
      +                        ruleCreator(ruleContext);
      +
      +                    // add all the node types as listeners
      +                    Object.keys(rule).forEach(function(nodeType) {
      +                        api.on(nodeType, timing.enabled
      +                            ? timing.time(key, rule[nodeType])
      +                            : rule[nodeType]
      +                        );
      +                    });
      +                } catch (ex) {
      +                    ex.message = "Error while loading rule '" + key + "': " + ex.message;
      +                    throw ex;
                       }
                   });
       
                   // save config so rules can access as necessary
                   currentConfig = config;
      -            currentText = text;
      -            controller = new estraverse.Controller();
      -
      -            ecmaFeatures = currentConfig.ecmaFeatures;
      -            ecmaVersion = (ecmaFeatures.blockBindings || ecmaFeatures.classes ||
      -                    ecmaFeatures.modules || ecmaFeatures.defaultParams ||
      -                    ecmaFeatures.destructuring) ? 6 : 5;
      +            traverser = new Traverser();
       
      +            ecmaFeatures = currentConfig.parserOptions.ecmaFeatures || {};
      +            ecmaVersion = currentConfig.parserOptions.ecmaVersion || 5;
       
      -            // gather data that may be needed by the rules
      +            // gather scope data that may be needed by the rules
                   scopeManager = escope.analyze(ast, {
                       ignoreEval: true,
                       nodejsScope: ecmaFeatures.globalReturn,
      +                impliedStrict: ecmaFeatures.impliedStrict,
                       ecmaVersion: ecmaVersion,
      -                sourceType: ecmaFeatures.modules ? "module" : "script"
      +                sourceType: currentConfig.parserOptions.sourceType || "script",
      +                fallback: Traverser.getKeys
                   });
      +
                   currentScopes = scopeManager.scopes;
       
                   /*
      @@ -672,31 +845,19 @@ module.exports = (function() {
                    * lookup in getScope.
                    */
                   scopeMap = [];
      -            currentScopes.forEach(function (scope, index) {
      +
      +            currentScopes.forEach(function(scope, index) {
                       var range = scope.block.range[0];
       
      -                // Sometimes two scopes are returned for a given node. This is
      -                // handled later in a known way, so just don't overwrite here.
      +                /*
      +                 * Sometimes two scopes are returned for a given node. This is
      +                 * handled later in a known way, so just don't overwrite here.
      +                 */
                       if (!scopeMap[range]) {
                           scopeMap[range] = index;
                       }
                   });
       
      -            /*
      -             * Split text here into array of lines so
      -             * it's not being done repeatedly
      -             * by individual rules.
      -             */
      -            currentTextLines = currentText.split(/\r\n|\r|\n|\u2028|\u2029/g);
      -
      -            // Freezing so array isn't accidentally changed by a rule.
      -            Object.freeze(currentTextLines);
      -
      -            currentTokens = createTokenStore(ast.tokens);
      -            Object.keys(currentTokens).forEach(function(method) {
      -                api[method] = currentTokens[method];
      -            });
      -
                   // augment global scope with declared global variables
                   addDeclaredGlobals(ast, currentScopes[0], currentConfig);
       
      @@ -709,31 +870,26 @@ module.exports = (function() {
                       }
                   }
       
      +            var eventGenerator = new NodeEventGenerator(api);
      +
      +            eventGenerator = new CodePathAnalyzer(eventGenerator);
      +            eventGenerator = new CommentEventGenerator(eventGenerator, sourceCode);
      +
                   /*
      -             * Each node has a type property. Whenever a particular type of node is found,
      -             * an event is fired. This allows any listeners to automatically be informed
      -             * that this type of node has been found and react accordingly.
      +             * Each node has a type property. Whenever a particular type of
      +             * node is found, an event is fired. This allows any listeners to
      +             * automatically be informed that this type of node has been found
      +             * and react accordingly.
                    */
      -            controller.traverse(ast, {
      +            traverser.traverse(ast, {
                       enter: function(node, parent) {
      -
      -                    var comments = api.getComments(node);
      -
      -                    emitCommentsEnter(comments.leading);
                           node.parent = parent;
      -                    api.emit(node.type, node);
      -                    emitCommentsEnter(comments.trailing);
      +                    eventGenerator.enterNode(node);
                       },
                       leave: function(node) {
      -
      -                    var comments = api.getComments(node);
      -
      -                    emitCommentsExit(comments.trailing);
      -                    api.emit(node.type + ":exit", node);
      -                    emitCommentsExit(comments.leading);
      +                    eventGenerator.leaveNode(node);
                       }
                   });
      -
               }
       
               // sort by line and column
      @@ -761,200 +917,108 @@ module.exports = (function() {
            * @param {string} message The actual message.
            * @param {Object} opts Optional template data which produces a formatted message
            *     with symbols being replaced by this object's values.
      +     * @param {Object} fix A fix command description.
      +     * @param {Object} meta Metadata of the rule
            * @returns {void}
            */
      -    api.report = function(ruleId, severity, node, location, message, opts) {
      +    api.report = function(ruleId, severity, node, location, message, opts, fix, meta) {
      +        if (node) {
      +            assert.strictEqual(typeof node, "object", "Node must be an object");
      +        }
       
               if (typeof location === "string") {
      +            assert.ok(node, "Node must be provided when reporting error if location is not provided");
      +
      +            meta = fix;
      +            fix = opts;
                   opts = message;
                   message = location;
                   location = node.loc.start;
               }
       
      -        Object.keys(opts || {}).forEach(function (key) {
      -            var rx = new RegExp(escapeRegExp("{{" + key + "}}"), "g");
      -            message = message.replace(rx, opts[key]);
      -        });
      +        // else, assume location was provided, so node may be omitted
       
               if (isDisabledByReportingConfig(reportingConfig, ruleId, location)) {
                   return;
               }
       
      -        messages.push({
      +        if (opts) {
      +            message = message.replace(/\{\{\s*(.+?)\s*\}\}/g, function(fullMatch, term) {
      +                if (term in opts) {
      +                    return opts[term];
      +                }
      +
      +                // Preserve old behavior: If parameter name not provided, don't replace it.
      +                return fullMatch;
      +            });
      +        }
      +
      +        var problem = {
                   ruleId: ruleId,
                   severity: severity,
                   message: message,
                   line: location.line,
      -            column: location.column,
      -            nodeType: node.type,
      -            source: currentTextLines[location.line - 1] || ""
      -        });
      -    };
      +            column: location.column + 1,   // switch to 1-base instead of 0-base
      +            nodeType: node && node.type,
      +            source: sourceCode.lines[location.line - 1] || ""
      +        };
       
      -    /**
      -     * Gets the source code for the given node.
      -     * @param {ASTNode=} node The AST node to get the text for.
      -     * @param {int=} beforeCount The number of characters before the node to retrieve.
      -     * @param {int=} afterCount The number of characters after the node to retrieve.
      -     * @returns {string} The text representing the AST node.
      -     */
      -    api.getSource = function(node, beforeCount, afterCount) {
      -        if (node) {
      -            return (currentText !== null) ? currentText.slice(Math.max(node.range[0] - (beforeCount || 0), 0),
      -                node.range[1] + (afterCount || 0)) : null;
      -        } else {
      -            return currentText;
      +        // ensure there's range and text properties as well as metadata switch, otherwise it's not a valid fix
      +        if (fix && Array.isArray(fix.range) && (typeof fix.text === "string") && (!meta || !meta.docs || meta.docs.fixable)) {
      +            problem.fix = fix;
               }
       
      +        messages.push(problem);
           };
       
           /**
      -     * Gets the entire source text split into an array of lines.
      -     * @returns {Array} The source text as an array of lines.
      -     */
      -    api.getSourceLines = function() {
      -        return currentTextLines;
      -    };
      -
      -    /**
      -     * Retrieves an array containing all comments in the source code.
      -     * @returns {ASTNode[]} An array of comment nodes.
      +     * Gets the SourceCode object representing the parsed source.
      +     * @returns {SourceCode} The SourceCode object.
            */
      -    api.getAllComments = function() {
      -        return currentAST.comments;
      +    api.getSourceCode = function() {
      +        return sourceCode;
           };
       
      -    /**
      -     * Gets all comments for the given node.
      -     * @param {ASTNode} node The AST node to get the comments for.
      -     * @returns {Object} The list of comments indexed by their position.
      -     */
      -    api.getComments = function(node) {
      -
      -        var leadingComments = node.leadingComments || [],
      -            trailingComments = node.trailingComments || [];
      -
      -        /*
      -         * espree adds a "comments" array on Program nodes rather than
      -         * leadingComments/trailingComments. Comments are only left in the
      -         * Program node comments array if there is no executable code.
      -         */
      -        if (node.type === "Program") {
      -            if (node.body.length === 0) {
      -                leadingComments = node.comments;
      -            }
      -        }
      -
      -        return {
      -            leading: leadingComments,
      -            trailing: trailingComments
      -        };
      +    // methods that exist on SourceCode object
      +    var externalMethods = {
      +        getSource: "getText",
      +        getSourceLines: "getLines",
      +        getAllComments: "getAllComments",
      +        getNodeByRangeIndex: "getNodeByRangeIndex",
      +        getComments: "getComments",
      +        getJSDocComment: "getJSDocComment",
      +        getFirstToken: "getFirstToken",
      +        getFirstTokens: "getFirstTokens",
      +        getLastToken: "getLastToken",
      +        getLastTokens: "getLastTokens",
      +        getTokenAfter: "getTokenAfter",
      +        getTokenBefore: "getTokenBefore",
      +        getTokenByRangeStart: "getTokenByRangeStart",
      +        getTokens: "getTokens",
      +        getTokensAfter: "getTokensAfter",
      +        getTokensBefore: "getTokensBefore",
      +        getTokensBetween: "getTokensBetween"
           };
       
      -    /**
      -     * Retrieves the JSDoc comment for a given node.
      -     * @param {ASTNode} node The AST node to get the comment for.
      -     * @returns {ASTNode} The BlockComment node containing the JSDoc for the
      -     *      given node or null if not found.
      -     */
      -    api.getJSDocComment = function(node) {
      -
      -        var parent = node.parent,
      -            line = node.loc.start.line;
      +    // copy over methods
      +    Object.keys(externalMethods).forEach(function(methodName) {
      +        var exMethodName = externalMethods[methodName];
       
      -        /**
      -         * Finds a JSDoc comment node in an array of comment nodes.
      -         * @param {ASTNode[]} comments The array of comment nodes to search.
      -         * @returns {ASTNode} The node if found, null if not.
      -         * @private
      -         */
      -        function findJSDocComment(comments) {
      -
      -            if (comments) {
      -                for (var i = comments.length - 1; i >= 0; i--) {
      -                    if (comments[i].type === "Block" && comments[i].value.charAt(0) === "*") {
      -
      -                        if (line - comments[i].loc.end.line <= 1) {
      -                            return comments[i];
      -                        } else {
      -                            break;
      -                        }
      -                    }
      -                }
      +        // All functions expected to have less arguments than 5.
      +        api[methodName] = function(a, b, c, d, e) {
      +            if (sourceCode) {
      +                return sourceCode[exMethodName](a, b, c, d, e);
                   }
      -
                   return null;
      -        }
      -
      -        /**
      -         * Check to see if its a ES6 export declaration
      -         * @param {ASTNode} astNode - any node
      -         * @returns {boolean} whether the given node represents a export declaration
      -         */
      -        function looksLikeExport(astNode) {
      -            return astNode.type === "ExportDefaultDeclaration" || astNode.type === "ExportNamedDeclaration" ||
      -                astNode.type === "ExportAllDeclaration" || astNode.type === "ExportSpecifier";
      -        }
      -
      -        switch (node.type) {
      -            case "FunctionDeclaration":
      -                if (looksLikeExport(parent)) {
      -                    return findJSDocComment(parent.leadingComments);
      -                } else {
      -                    return findJSDocComment(node.leadingComments);
      -                }
      -                break;
      -
      -            case "ArrowFunctionExpression":
      -            case "FunctionExpression":
      -
      -                if (parent.type !== "CallExpression" || parent.callee !== node) {
      -                    while (parent && !parent.leadingComments && !/Function/.test(parent.type)) {
      -                        parent = parent.parent;
      -                    }
      -
      -                    return parent && (parent.type !== "FunctionDeclaration") ? findJSDocComment(parent.leadingComments) : null;
      -                }
      -
      -                // falls through
      -
      -            default:
      -                return null;
      -        }
      -    };
      +        };
      +    });
       
           /**
            * Gets nodes that are ancestors of current node.
            * @returns {ASTNode[]} Array of objects representing ancestors.
            */
           api.getAncestors = function() {
      -        return controller.parents();
      -    };
      -
      -    /**
      -     * Gets the deepest node containing a range index.
      -     * @param {int} index Range index of the desired node.
      -     * @returns {ASTNode} [description]
      -     */
      -    api.getNodeByRangeIndex = function(index) {
      -        var result = null;
      -
      -        estraverse.traverse(controller.root, {
      -            enter: function (node) {
      -                if (node.range[0] <= index && index < node.range[1]) {
      -                    result = node;
      -                } else {
      -                    this.skip();
      -                }
      -            },
      -            leave: function (node) {
      -                if (node === result) {
      -                    this.break();
      -                }
      -            }
      -        });
      -
      -        return result;
      +        return traverser.parents();
           };
       
           /**
      @@ -962,23 +1026,30 @@ module.exports = (function() {
            * @returns {Object} An object representing the current node's scope.
            */
           api.getScope = function() {
      -        var parents = controller.parents(),
      +        var parents = traverser.parents(),
                   scope = currentScopes[0];
       
               // Don't do this for Program nodes - they have no parents
               if (parents.length) {
       
      -            // if current node is function declaration, add it to the list
      -            var current = controller.current();
      -            if (["FunctionDeclaration", "FunctionExpression",
      -                    "ArrowFunctionExpression", "SwitchStatement"].indexOf(current.type) >= 0) {
      -                parents.push(current);
      +            // if current node introduces a scope, add it to the list
      +            var current = traverser.current();
      +
      +            if (currentConfig.parserOptions.ecmaVersion >= 6) {
      +                if (["BlockStatement", "SwitchStatement", "CatchClause", "FunctionDeclaration", "FunctionExpression", "ArrowFunctionExpression"].indexOf(current.type) >= 0) {
      +                    parents.push(current);
      +                }
      +            } else {
      +                if (["FunctionDeclaration", "FunctionExpression", "ArrowFunctionExpression"].indexOf(current.type) >= 0) {
      +                    parents.push(current);
      +                }
                   }
       
                   // Ascend the current node's parents
                   for (var i = parents.length - 1; i >= 0; --i) {
       
      -                scope = scopeManager.acquire(parents[i]);
      +                // Get the innermost scope
      +                scope = scopeManager.acquire(parents[i], true);
                       if (scope) {
                           if (scope.type === "function-expression-name") {
                               return scope.childScopes[0];
      @@ -1002,7 +1073,8 @@ module.exports = (function() {
            */
           api.markVariableAsUsed = function(name) {
               var scope = this.getScope(),
      -            specialScope = currentConfig.ecmaFeatures.globalReturn || currentConfig.ecmaFeatures.modules,
      +            hasGlobalReturn = currentConfig.parserOptions.ecmaFeatures && currentConfig.parserOptions.ecmaFeatures.globalReturn,
      +            specialScope = hasGlobalReturn || currentConfig.parserOptions.sourceType === "module",
                   variables,
                   i,
                   len;
      @@ -1020,7 +1092,7 @@ module.exports = (function() {
                           return true;
                       }
                   }
      -        } while ( (scope = scope.upper) );
      +        } while ((scope = scope.upper));
       
               return false;
           };
      @@ -1067,6 +1139,29 @@ module.exports = (function() {
               return require("../conf/eslint.json");
           };
       
      +    /**
      +     * Gets variables that are declared by a specified node.
      +     *
      +     * The variables are its `defs[].node` or `defs[].parent` is same as the specified node.
      +     * Specifically, below:
      +     *
      +     * - `VariableDeclaration` - variables of its all declarators.
      +     * - `VariableDeclarator` - variables.
      +     * - `FunctionDeclaration`/`FunctionExpression` - its function name and parameters.
      +     * - `ArrowFunctionExpression` - its parameters.
      +     * - `ClassDeclaration`/`ClassExpression` - its class name.
      +     * - `CatchClause` - variables of its exception.
      +     * - `ImportDeclaration` - variables of  its all specifiers.
      +     * - `ImportSpecifier`/`ImportDefaultSpecifier`/`ImportNamespaceSpecifier` - a variable.
      +     * - others - always an empty array.
      +     *
      +     * @param {ASTNode} node A node to get.
      +     * @returns {escope.Variable[]} Variables that are declared by the node.
      +     */
      +    api.getDeclaredVariables = function(node) {
      +        return (scopeManager && scopeManager.getDeclaredVariables(node)) || [];
      +    };
      +
           return api;
       
       }());
      diff --git a/tools/eslint/lib/file-finder.js b/tools/eslint/lib/file-finder.js
      index f4b8a5ce7aaf75..9e24659df7030d 100644
      --- a/tools/eslint/lib/file-finder.js
      +++ b/tools/eslint/lib/file-finder.js
      @@ -2,6 +2,8 @@
        * @fileoverview Util class to find config files.
        * @author Aliaksei Shytkin
        * @copyright 2014 Michael McLaughlin. All rights reserved.
      + * @copyright 2014 Aliaksei Shytkin. All rights reserved.
      + * See LICENSE in root directory for full license.
        */
       "use strict";
       
      @@ -38,33 +40,57 @@ function getDirectoryEntries(directory) {
       /**
        * FileFinder
        * @constructor
      - * @param {...string} arguments The basename(s) of the file(s) to find.
      + * @param {string[]} files The basename(s) of the file(s) to find.
      + * @param {stirng} cwd Current working directory
        */
      -function FileFinder() {
      -    this.fileNames = Array.prototype.slice.call(arguments);
      +function FileFinder(files, cwd) {
      +    this.fileNames = Array.isArray(files) ? files : [files];
      +    this.cwd = cwd || process.cwd();
           this.cache = {};
       }
       
      +/**
      + * Create a hash of filenames from a directory listing
      + * @param {string[]} entries Array of directory entries.
      + * @param {string} directory Path to a current directory.
      + * @param {string[]} supportedConfigs List of support filenames.
      + * @returns {Object} Hashmap of filenames
      + */
      +function normalizeDirectoryEntries(entries, directory, supportedConfigs) {
      +    var fileHash = {};
      +
      +    entries.forEach(function(entry) {
      +        if (supportedConfigs.indexOf(entry) >= 0) {
      +            var resolvedEntry = path.resolve(directory, entry);
      +
      +            if (fs.statSync(resolvedEntry).isFile()) {
      +                fileHash[entry] = resolvedEntry;
      +            }
      +        }
      +    });
      +    return fileHash;
      +}
      +
       /**
        * Find one instance of a specified file name in directory or in a parent directory.
        * Cache the results.
        * Does not check if a matching directory entry is a file, and intentionally
        * only searches for the first file name in this.fileNames.
        * Is currently used by lib/ignored_paths.js to find an .eslintignore file.
      - * @param  {string} directory The directory to start the search from.
      + * @param {string} directory The directory to start the search from.
        * @returns {string} Path of the file found, or an empty string if not found.
        */
      -FileFinder.prototype.findInDirectoryOrParents = function (directory) {
      +FileFinder.prototype.findInDirectoryOrParents = function(directory) {
           var cache = this.cache,
               child,
               dirs,
               filePath,
               i,
      -        name,
      +        names,
               searched;
       
           if (!directory) {
      -        directory = process.cwd();
      +        directory = this.cwd;
           }
       
           if (cache.hasOwnProperty(directory)) {
      @@ -73,21 +99,28 @@ FileFinder.prototype.findInDirectoryOrParents = function (directory) {
       
           dirs = [];
           searched = 0;
      -    name = this.fileNames[0];
      +    names = this.fileNames;
      +
      +    (function() {
      +        while (directory !== child) {
      +            dirs[searched++] = directory;
      +            var filesMap = normalizeDirectoryEntries(getDirectoryEntries(directory), directory, names);
      +
      +            if (Object.keys(filesMap).length) {
      +                for (var k = 0; k < names.length; k++) {
      +                    if (filesMap[names[k]]) {
      +                        filePath = filesMap[names[k]];
      +                        return;
      +                    }
      +                }
      +            }
       
      -    while (directory !== child) {
      -        dirs[searched++] = directory;
      +            child = directory;
       
      -        if (getDirectoryEntries(directory).indexOf(name) !== -1 && fs.statSync(path.resolve(directory, name)).isFile()) {
      -            filePath = path.resolve(directory, name);
      -            break;
      +            // Assign parent directory to directory.
      +            directory = path.dirname(directory);
               }
      -
      -        child = directory;
      -
      -        // Assign parent directory to directory.
      -        directory = path.dirname(directory);
      -    }
      +    }());
       
           for (i = 0; i < searched; i++) {
               cache[dirs[i]] = filePath;
      @@ -105,20 +138,18 @@ FileFinder.prototype.findInDirectoryOrParents = function (directory) {
        * @param  {string} directory The directory to start the search from.
        * @returns {string[]} The file paths found.
        */
      -FileFinder.prototype.findAllInDirectoryAndParents = function (directory) {
      +FileFinder.prototype.findAllInDirectoryAndParents = function(directory) {
           var cache = this.cache,
               child,
               dirs,
      -        name,
               fileNames,
      -        fileNamesCount,
               filePath,
               i,
               j,
               searched;
       
           if (!directory) {
      -        directory = process.cwd();
      +        directory = this.cwd;
           }
       
           if (cache.hasOwnProperty(directory)) {
      @@ -128,21 +159,25 @@ FileFinder.prototype.findAllInDirectoryAndParents = function (directory) {
           dirs = [];
           searched = 0;
           fileNames = this.fileNames;
      -    fileNamesCount = fileNames.length;
       
           do {
               dirs[searched++] = directory;
               cache[directory] = [];
       
      -        for (i = 0; i < fileNamesCount; i++) {
      -            name = fileNames[i];
      +        var filesMap = normalizeDirectoryEntries(getDirectoryEntries(directory), directory, fileNames);
      +
      +        if (Object.keys(filesMap).length) {
      +            for (var k = 0; k < fileNames.length; k++) {
      +
      +                if (filesMap[fileNames[k]]) {
      +                    filePath = filesMap[fileNames[k]];
       
      -            if (getDirectoryEntries(directory).indexOf(name) !== -1 && fs.statSync(path.resolve(directory, name)).isFile()) {
      -                filePath = path.resolve(directory, name);
      +                    // Add the file path to the cache of each directory searched.
      +                    for (j = 0; j < searched; j++) {
      +                        cache[dirs[j]].push(filePath);
      +                    }
       
      -                // Add the file path to the cache of each directory searched.
      -                for (j = 0; j < searched; j++) {
      -                    cache[dirs[j]].push(filePath);
      +                    break;
                       }
                   }
               }
      diff --git a/tools/eslint/lib/formatters/checkstyle.js b/tools/eslint/lib/formatters/checkstyle.js
      index 5e98c8b1312b6d..0bb9627adf2bd5 100644
      --- a/tools/eslint/lib/formatters/checkstyle.js
      +++ b/tools/eslint/lib/formatters/checkstyle.js
      @@ -8,6 +8,12 @@
       // Helper Functions
       //------------------------------------------------------------------------------
       
      +/**
      + * Returns the severity of warning or error
      + * @param {object} message message object to examine
      + * @returns {string} severity level
      + * @private
      + */
       function getMessageType(message) {
           if (message.fatal || message.severity === 2) {
               return "error";
      @@ -16,6 +22,12 @@ function getMessageType(message) {
           }
       }
       
      +/**
      + * Returns the escaped value for a character
      + * @param {string} s string to examine
      + * @returns {string} severity level
      + * @private
      + */
       function xmlEscape(s) {
           return ("" + s).replace(/[<>&"']/g, function(c) {
               switch (c) {
      @@ -29,7 +41,8 @@ function xmlEscape(s) {
                       return """;
                   case "'":
                       return "'";
      -            // no default
      +            default:
      +                throw new Error("unreachable");
               }
           });
       }
      @@ -55,7 +68,8 @@ module.exports = function(results) {
                       "column=\"" + xmlEscape(message.column) + "\" " +
                       "severity=\"" + xmlEscape(getMessageType(message)) + "\" " +
                       "message=\"" + xmlEscape(message.message) +
      -                (message.ruleId ? " (" + message.ruleId + ")" : "") + "\" />";
      +                (message.ruleId ? " (" + message.ruleId + ")" : "") + "\" " +
      +                "source=\"" + (message.ruleId ? xmlEscape("eslint.rules." + message.ruleId) : "") + "\" />";
               });
       
               output += "";
      diff --git a/tools/eslint/lib/formatters/compact.js b/tools/eslint/lib/formatters/compact.js
      index b7c2fc7e25f4cf..0c31b073e3fefd 100644
      --- a/tools/eslint/lib/formatters/compact.js
      +++ b/tools/eslint/lib/formatters/compact.js
      @@ -8,6 +8,12 @@
       // Helper Functions
       //------------------------------------------------------------------------------
       
      +/**
      + * Returns the severity of warning or error
      + * @param {object} message message object to examine
      + * @returns {string} severity level
      + * @private
      + */
       function getMessageType(message) {
           if (message.fatal || message.severity === 2) {
               return "Error";
      @@ -29,6 +35,7 @@ module.exports = function(results) {
           results.forEach(function(result) {
       
               var messages = result.messages;
      +
               total += messages.length;
       
               messages.forEach(function(message) {
      diff --git a/tools/eslint/lib/formatters/html-template-message.html b/tools/eslint/lib/formatters/html-template-message.html
      new file mode 100644
      index 00000000000000..0683172748495b
      --- /dev/null
      +++ b/tools/eslint/lib/formatters/html-template-message.html
      @@ -0,0 +1,8 @@
      +
      +    <%= lineNumber %>:<%= columnNumber %>
      +    <%= severityName %>
      +    <%- message %>
      +    
      +        <%= ruleId %>
      +    
      +
      diff --git a/tools/eslint/lib/formatters/html-template-page.html b/tools/eslint/lib/formatters/html-template-page.html
      new file mode 100644
      index 00000000000000..39e15562e97e81
      --- /dev/null
      +++ b/tools/eslint/lib/formatters/html-template-page.html
      @@ -0,0 +1,113 @@
      +
      +    
      +        ESLint Report
      +        
      +    
      +    
      +        
      +

      ESLint Report

      +
      + <%= reportSummary %> - Generated on <%= date %> +
      +
      + + + <%= results %> + +
      + + + diff --git a/tools/eslint/lib/formatters/html-template-result.html b/tools/eslint/lib/formatters/html-template-result.html new file mode 100644 index 00000000000000..f4a55933c2047e --- /dev/null +++ b/tools/eslint/lib/formatters/html-template-result.html @@ -0,0 +1,6 @@ + + + [+] <%- filePath %> + <%- summary %> + + diff --git a/tools/eslint/lib/formatters/html.js b/tools/eslint/lib/formatters/html.js new file mode 100644 index 00000000000000..e8b5cd78deeb70 --- /dev/null +++ b/tools/eslint/lib/formatters/html.js @@ -0,0 +1,132 @@ +/** + * @fileoverview HTML reporter + * @author Julian Laval + * @copyright 2015 Julian Laval. All rights reserved. + */ +"use strict"; + +var lodash = require("lodash"); +var fs = require("fs"); +var path = require("path"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +var pageTemplate = lodash.template(fs.readFileSync(path.join(__dirname, "html-template-page.html"), "utf-8")); +var messageTemplate = lodash.template(fs.readFileSync(path.join(__dirname, "html-template-message.html"), "utf-8")); +var resultTemplate = lodash.template(fs.readFileSync(path.join(__dirname, "html-template-result.html"), "utf-8")); + +/** + * Given a word and a count, append an s if count is not one. + * @param {string} word A word in its singular form. + * @param {int} count A number controlling whether word should be pluralized. + * @returns {string} The original word with an s on the end if count is not one. + */ +function pluralize(word, count) { + return (count === 1 ? word : word + "s"); +} + +/** + * Renders text along the template of x problems (x errors, x warnings) + * @param {string} totalErrors Total errors + * @param {string} totalWarnings Total warnings + * @returns {string} The formatted string, pluralized where necessary + */ +function renderSummary(totalErrors, totalWarnings) { + var totalProblems = totalErrors + totalWarnings; + var renderedText = totalProblems + " " + pluralize("problem", totalProblems); + + if (totalProblems !== 0) { + renderedText += " (" + totalErrors + " " + pluralize("error", totalErrors) + ", " + totalWarnings + " " + pluralize("warning", totalWarnings) + ")"; + } + return renderedText; +} + +/** + * Get the color based on whether there are errors/warnings... + * @param {string} totalErrors Total errors + * @param {string} totalWarnings Total warnings + * @returns {int} The color code (0 = green, 1 = yellow, 2 = red) + */ +function renderColor(totalErrors, totalWarnings) { + if (totalErrors !== 0) { + return 2; + } else if (totalWarnings !== 0) { + return 1; + } + return 0; +} + +/** + * Get HTML (table rows) describing the messages. + * @param {Array} messages Messages. + * @param {int} parentIndex Index of the parent HTML row. + * @returns {string} HTML (table rows) describing the messages. + */ +function renderMessages(messages, parentIndex) { + + /** + * Get HTML (table row) describing a message. + * @param {Object} message Message. + * @returns {string} HTML (table row) describing a message. + */ + return lodash.map(messages, function(message) { + var lineNumber, + columnNumber; + + lineNumber = message.line || 0; + columnNumber = message.column || 0; + + return messageTemplate({ + parentIndex: parentIndex, + lineNumber: lineNumber, + columnNumber: columnNumber, + severityNumber: message.severity, + severityName: message.severity === 1 ? "Warning" : "Error", + message: message.message, + ruleId: message.ruleId + }); + }).join("\n"); +} + +/** + * @param {Array} results Test results. + * @returns {string} HTML string describing the results. + */ +function renderResults(results) { + return lodash.map(results, function(result, index) { + return resultTemplate({ + index: index, + color: renderColor(result.errorCount, result.warningCount), + filePath: result.filePath, + summary: renderSummary(result.errorCount, result.warningCount) + + }) + renderMessages(result.messages, index); + }).join("\n"); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + var totalErrors, + totalWarnings; + + totalErrors = 0; + totalWarnings = 0; + + // Iterate over results to get totals + results.forEach(function(result) { + totalErrors += result.errorCount; + totalWarnings += result.warningCount; + }); + + return pageTemplate({ + date: new Date(), + reportColor: renderColor(totalErrors, totalWarnings), + reportSummary: renderSummary(totalErrors, totalWarnings), + results: renderResults(results) + }); +}; diff --git a/tools/eslint/lib/formatters/jslint-xml.js b/tools/eslint/lib/formatters/jslint-xml.js index 26aa2de0b5b8ec..483172ca5d8f23 100644 --- a/tools/eslint/lib/formatters/jslint-xml.js +++ b/tools/eslint/lib/formatters/jslint-xml.js @@ -4,7 +4,7 @@ */ "use strict"; -var xmlescape = require("xml-escape"); +var lodash = require("lodash"); //------------------------------------------------------------------------------ // Public Interface @@ -25,8 +25,8 @@ module.exports = function(results) { messages.forEach(function(message) { output += ""; }); diff --git a/tools/eslint/lib/formatters/json.js b/tools/eslint/lib/formatters/json.js new file mode 100644 index 00000000000000..c1101970efa468 --- /dev/null +++ b/tools/eslint/lib/formatters/json.js @@ -0,0 +1,14 @@ +/** + * @fileoverview JSON reporter + * @author Burak Yigit Kaya aka BYK + * @copyright 2015 Burak Yigit Kaya. All rights reserved. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + return JSON.stringify(results); +}; diff --git a/tools/eslint/lib/formatters/junit.js b/tools/eslint/lib/formatters/junit.js index 7ee94135f6a84f..c53fd8141baf5a 100644 --- a/tools/eslint/lib/formatters/junit.js +++ b/tools/eslint/lib/formatters/junit.js @@ -4,12 +4,18 @@ */ "use strict"; -var xmlescape = require("xml-escape"); +var lodash = require("lodash"); //------------------------------------------------------------------------------ // Helper Functions //------------------------------------------------------------------------------ +/** + * Returns the severity of warning or error + * @param {object} message message object to examine + * @returns {string} severity level + * @private + */ function getMessageType(message) { if (message.fatal || message.severity === 2) { return "Error"; @@ -39,12 +45,13 @@ module.exports = function(results) { messages.forEach(function(message) { var type = message.fatal ? "error" : "failure"; + output += ""; - output += "<" + type + " message=\"" + xmlescape(message.message || "") + "\">"; + output += "<" + type + " message=\"" + lodash.escape(message.message || "") + "\">"; output += ""; output += ""; diff --git a/tools/eslint/lib/formatters/stylish.js b/tools/eslint/lib/formatters/stylish.js index 59e01d0b3ef563..d8645755bf9dc4 100644 --- a/tools/eslint/lib/formatters/stylish.js +++ b/tools/eslint/lib/formatters/stylish.js @@ -62,7 +62,7 @@ module.exports = function(results) { message.column || 0, messageType, message.message.replace(/\.$/, ""), - chalk.gray(message.ruleId || "") + chalk.dim(message.ruleId || "") ]; }), { @@ -73,7 +73,7 @@ module.exports = function(results) { } ).split("\n").map(function(el) { return el.replace(/(\d+)\s+(\d+)/, function(m, p1, p2) { - return chalk.gray(p1 + ":" + p2); + return chalk.dim(p1 + ":" + p2); }); }).join("\n") + "\n\n"; }); diff --git a/tools/eslint/lib/formatters/table.js b/tools/eslint/lib/formatters/table.js new file mode 100644 index 00000000000000..faa691c6ea4866 --- /dev/null +++ b/tools/eslint/lib/formatters/table.js @@ -0,0 +1,159 @@ +/** + * @fileoverview "table reporter. + * @author Gajus Kuizinas + * @copyright 2016 Gajus Kuizinas . All rights reserved. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var chalk, + table, + pluralize; + +chalk = require("chalk"); +table = require("table").default; +pluralize = require("pluralize"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Draws text table. + * @param {Array} messages Error messages relating to a specific file. + * @returns {string} A text table. + */ +function drawTable(messages) { + var rows; + + rows = []; + + if (messages.length === 0) { + return ""; + } + + rows.push([ + chalk.bold("Line"), + chalk.bold("Column"), + chalk.bold("Type"), + chalk.bold("Message"), + chalk.bold("Rule ID") + ]); + + messages.forEach(function(message) { + var messageType; + + if (message.fatal || message.severity === 2) { + messageType = chalk.red("error"); + } else { + messageType = chalk.yellow("warning"); + } + + rows.push([ + message.line || 0, + message.column || 0, + messageType, + message.message, + message.ruleId || "" + ]); + }); + + return table(rows, { + columns: { + 0: { + width: 8, + wrapWord: true + }, + 1: { + width: 8, + wrapWord: true + }, + 2: { + width: 8, + wrapWord: true + }, + 3: { + paddingRight: 5, + width: 50, + wrapWord: true + }, + 4: { + width: 20, + wrapWord: true + } + }, + drawHorizontalLine: function(index) { + return index === 1; + } + }); +} + +/** + * Draws a report (multiple tables). + * @param {Array} results Report results for every file. + * @returns {string} A column of text tables. + */ +function drawReport(results) { + var files; + + files = results.map(function(result) { + if (!result.messages.length) { + return ""; + } + + return "\n" + result.filePath + "\n\n" + drawTable(result.messages); + }); + + files = files.filter(function(content) { + return content.trim(); + }); + + return files.join(""); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(report) { + var result, + errorCount, + warningCount; + + result = ""; + errorCount = 0; + warningCount = 0; + + report.forEach(function(fileReport) { + errorCount += fileReport.errorCount; + warningCount += fileReport.warningCount; + }); + + if (errorCount || warningCount) { + result = drawReport(report); + } + + result += "\n" + table([ + [ + chalk.red(pluralize("Error", errorCount, true)) + ], + [ + chalk.yellow(pluralize("Warning", warningCount, true)) + ] + ], { + columns: { + 0: { + width: 110, + wrapWord: true + } + }, + drawHorizontalLine: function() { + return true; + } + }); + + return result; +}; diff --git a/tools/eslint/lib/formatters/tap.js b/tools/eslint/lib/formatters/tap.js index ecb6960c375a73..d898e30393ec5e 100644 --- a/tools/eslint/lib/formatters/tap.js +++ b/tools/eslint/lib/formatters/tap.js @@ -31,6 +31,7 @@ function getMessageType(message) { function outputDiagnostics(diagnostic) { var prefix = " "; var output = prefix + "---\n"; + output += prefix + yaml.safeDump(diagnostic).split("\n").join("\n" + prefix); output += "...\n"; return output; @@ -66,7 +67,10 @@ module.exports = function(results) { // The first error will be logged as message key // This is to adhere to TAP 13 loosely defined specification of having a message key if ("message" in diagnostics) { - diagnostics.messages = [diagnostic]; + if (typeof diagnostics.messages === "undefined") { + diagnostics.messages = []; + } + diagnostics.messages.push(diagnostic); } else { diagnostics = diagnostic; } diff --git a/tools/eslint/lib/formatters/unix.js b/tools/eslint/lib/formatters/unix.js new file mode 100644 index 00000000000000..ba2e31f2f80db1 --- /dev/null +++ b/tools/eslint/lib/formatters/unix.js @@ -0,0 +1,60 @@ +/** + * @fileoverview unix-style formatter. + * @author oshi-shinobu + * @copyright 2015 oshi-shinobu. All rights reserved. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Helper Functions +//------------------------------------------------------------------------------ + +/** + * Returns a canonical error level string based upon the error message passed in. + * @param {object} message Individual error message provided by eslint + * @returns {String} Error level string + */ +function getMessageType(message) { + if (message.fatal || message.severity === 2) { + return "Error"; + } else { + return "Warning"; + } +} + + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + + var output = "", + total = 0; + + results.forEach(function(result) { + + var messages = result.messages; + + total += messages.length; + + messages.forEach(function(message) { + + output += result.filePath + ":"; + output += (message.line || 0) + ":"; + output += (message.column || 0) + ":"; + output += " " + message.message + " "; + output += "[" + getMessageType(message) + + (message.ruleId ? "/" + message.ruleId : "") + "]"; + output += "\n"; + + }); + + }); + + if (total > 0) { + output += "\n" + total + " problem" + (total !== 1 ? "s" : ""); + } + + return output; +}; diff --git a/tools/eslint/lib/formatters/visualstudio.js b/tools/eslint/lib/formatters/visualstudio.js new file mode 100644 index 00000000000000..d0a3d99eb793ee --- /dev/null +++ b/tools/eslint/lib/formatters/visualstudio.js @@ -0,0 +1,65 @@ +/** + * @fileoverview Visual Studio compatible formatter + * @author Ronald Pijnacker + * @copyright 2015 Ronald Pijnacker. All rights reserved. + * See LICENSE file in root directory for full license. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helper Functions +//------------------------------------------------------------------------------ + +/** + * Returns the severity of warning or error + * @param {object} message message object to examine + * @returns {string} severity level + * @private + */ +function getMessageType(message) { + if (message.fatal || message.severity === 2) { + return "error"; + } else { + return "warning"; + } +} + + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = function(results) { + + var output = "", + total = 0; + + results.forEach(function(result) { + + var messages = result.messages; + + total += messages.length; + + messages.forEach(function(message) { + + output += result.filePath; + output += "(" + (message.line || 0); + output += message.column ? "," + message.column : ""; + output += "): " + getMessageType(message); + output += message.ruleId ? " " + message.ruleId : ""; + output += " : " + message.message; + output += "\n"; + + }); + + }); + + if (total === 0) { + output += "no problems"; + } else { + output += "\n" + total + " problem" + (total !== 1 ? "s" : ""); + } + + return output; +}; diff --git a/tools/eslint/lib/ignored-paths.js b/tools/eslint/lib/ignored-paths.js index 6d57da2776d16c..d907b49589d3b5 100644 --- a/tools/eslint/lib/ignored-paths.js +++ b/tools/eslint/lib/ignored-paths.js @@ -8,10 +8,12 @@ // Requirements //------------------------------------------------------------------------------ -var fs = require("fs"), +var lodash = require("lodash"), + fs = require("fs"), + path = require("path"), debug = require("debug"), - minimatch = require("minimatch"), - FileFinder = require("./file-finder"); + ignore = require("ignore"), + pathUtil = require("./util/path-util"); debug = debug("eslint:ignored-paths"); @@ -21,51 +23,44 @@ debug = debug("eslint:ignored-paths"); //------------------------------------------------------------------------------ var ESLINT_IGNORE_FILENAME = ".eslintignore"; +var DEFAULT_IGNORE_PATTERNS = [ + "/node_modules/*", + "/bower_components/*" +]; +var DEFAULT_OPTIONS = { + dotfiles: false, + cwd: process.cwd() +}; //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ + /** - * Load and parse ignore patterns from the file at the given path - * @param {string} filepath Path to the ignore file. - * @returns {string[]} An array of ignore patterns or an empty array if no ignore file. + * Find an ignore file in the current directory. + * @param {stirng} cwd Current working directory + * @returns {string} Path of ignore file or an empty string. */ -function loadIgnoreFile(filepath) { - var ignorePatterns = []; +function findIgnoreFile(cwd) { + cwd = cwd || DEFAULT_OPTIONS.cwd; - function nonEmpty(line) { - return line.trim() !== "" && line[0] !== "#"; - } + var ignoreFilePath = path.resolve(cwd, ESLINT_IGNORE_FILENAME); - if (filepath) { - try { - ignorePatterns = fs.readFileSync(filepath, "utf8").split(/\r?\n/).filter(nonEmpty); - } catch (e) { - e.message = "Cannot read ignore file: " + filepath + "\nError: " + e.message; - throw e; - } - } - - return ["node_modules/**"].concat(ignorePatterns); + return fs.existsSync(ignoreFilePath) ? ignoreFilePath : ""; } -var ignoreFileFinder; - /** - * Find an ignore file in the current directory or a parent directory. - * @returns {string} Path of ignore file or an empty string. + * Merge options with defaults + * @param {object} options Options to merge with DEFAULT_OPTIONS constant + * @returns {object} Merged options */ -function findIgnoreFile() { - if (!ignoreFileFinder) { - ignoreFileFinder = new FileFinder(ESLINT_IGNORE_FILENAME); - } - - return ignoreFileFinder.findInDirectoryOrParents(); +function mergeDefaultOptions(options) { + options = (options || {}); + return lodash.assign({}, DEFAULT_OPTIONS, options); } - //------------------------------------------------------------------------------ // Public Interface //------------------------------------------------------------------------------ @@ -74,64 +69,123 @@ function findIgnoreFile() { * IgnoredPaths * @constructor * @class IgnoredPaths - * @param {Array} patterns to be matched against file paths + * @param {Object} options object containing 'ignore', 'ignorePath' and 'patterns' properties */ -function IgnoredPaths(patterns) { - this.patterns = patterns; -} +function IgnoredPaths(options) { + + options = mergeDefaultOptions(options); + + /** + * add pattern to node-ignore instance + * @param {object} ig, instance of node-ignore + * @param {string} pattern, pattern do add to ig + * @returns {array} raw ignore rules + */ + function addPattern(ig, pattern) { + return ig.addPattern(pattern); + } -/** - * IgnoredPaths initializer - * @param {Object} options object containing 'ignore' and 'ignorePath' properties - * @returns {IgnoredPaths} object, with patterns loaded from the ignore file - */ -IgnoredPaths.load = function (options) { - var patterns; + /** + * add ignore file to node-ignore instance + * @param {object} ig, instance of node-ignore + * @param {string} filepath, file to add to ig + * @returns {array} raw ignore rules + */ + function addIgnoreFile(ig, filepath) { + ig.ignoreFiles.push(filepath); + return ig.add(fs.readFileSync(filepath, "utf8")); + } + + this.defaultPatterns = DEFAULT_IGNORE_PATTERNS.concat(options.patterns || []); + this.baseDir = options.cwd; - options = options || {}; + this.ig = { + custom: ignore(), + default: ignore() + }; - if (options.ignore) { - patterns = loadIgnoreFile(options.ignorePath || findIgnoreFile()); - } else { - patterns = []; + // Add a way to keep track of ignored files. This was present in node-ignore + // 2.x, but dropped for now as of 3.0.10. + this.ig.custom.ignoreFiles = []; + this.ig.default.ignoreFiles = []; + + if (options.dotfiles !== true) { + + /* + * ignore files beginning with a dot, but not files in a parent or + * ancestor directory (which in relative format will begin with `../`). + */ + addPattern(this.ig.default, [".*", "!../"]); } - if (options.ignorePattern) { - patterns.push(options.ignorePattern); + addPattern(this.ig.default, this.defaultPatterns); + + if (options.ignore !== false) { + var ignorePath; + + if (options.ignorePattern) { + addPattern(this.ig.custom, options.ignorePattern); + addPattern(this.ig.default, options.ignorePattern); + } + + if (options.ignorePath) { + debug("Using specific ignore file"); + + try { + fs.statSync(options.ignorePath); + ignorePath = options.ignorePath; + } catch (e) { + e.message = "Cannot read ignore file: " + options.ignorePath + "\nError: " + e.message; + throw e; + } + } else { + debug("Looking for ignore file in " + options.cwd); + ignorePath = findIgnoreFile(options.cwd); + + try { + fs.statSync(ignorePath); + debug("Loaded ignore file " + ignorePath); + } catch (e) { + debug("Could not find ignore file in cwd"); + this.options = options; + } + } + + if (ignorePath) { + debug("Adding " + ignorePath); + this.baseDir = path.dirname(path.resolve(options.cwd, ignorePath)); + addIgnoreFile(this.ig.custom, ignorePath); + addIgnoreFile(this.ig.default, ignorePath); + } + } - return new IgnoredPaths(patterns); -}; + this.options = options; + +} /** - * Determine whether a file path is included in the configured ignore patterns + * Determine whether a file path is included in the default or custom ignore patterns * @param {string} filepath Path to check + * @param {string} [category=null] check 'default', 'custom' or both (null) * @returns {boolean} true if the file path matches one or more patterns, false otherwise */ -IgnoredPaths.prototype.contains = function (filepath) { - if (this.patterns === null) { - throw new Error("No ignore patterns loaded, call 'load' first"); - } +IgnoredPaths.prototype.contains = function(filepath, category) { - filepath = filepath.replace("\\", "/"); - filepath = filepath.replace(/^\.\//, ""); - return this.patterns.reduce(function(ignored, pattern) { - var negated = pattern[0] === "!", - matches; + var result = false; + var absolutePath = path.resolve(this.options.cwd, filepath); + var relativePath = pathUtil.getRelativePath(absolutePath, this.options.cwd); - if (negated) { - pattern = pattern.slice(1); - } + if ((typeof category === "undefined") || (category === "default")) { + result = result || (this.ig.default.filter([relativePath]).length === 0); + } - // Remove leading "current folder" prefix - if (pattern.indexOf("./") === 0) { - pattern = pattern.slice(2); - } + if ((typeof category === "undefined") || (category === "custom")) { + result = result || (this.ig.custom.filter([relativePath]).length === 0); + } - matches = minimatch(filepath, pattern) || minimatch(filepath, pattern + "/**"); + return result; - return matches ? !negated : ignored; - }, false); }; module.exports = IgnoredPaths; diff --git a/tools/eslint/lib/load-rules.js b/tools/eslint/lib/load-rules.js index 62183f344d3b68..6691dbba4b350a 100644 --- a/tools/eslint/lib/load-rules.js +++ b/tools/eslint/lib/load-rules.js @@ -18,22 +18,24 @@ var fs = require("fs"), /** * Load all rule modules from specified directory. - * @param {String} [rulesDir] Path to rules directory, may be relative. Defaults to `lib/rules`. + * @param {string} [rulesDir] Path to rules directory, may be relative. Defaults to `lib/rules`. + * @param {string} cwd Current working directory * @returns {Object} Loaded rule modules by rule ids (file names). */ -module.exports = function(rulesDir) { +module.exports = function(rulesDir, cwd) { if (!rulesDir) { rulesDir = path.join(__dirname, "rules"); } else { - rulesDir = path.resolve(process.cwd(), rulesDir); + rulesDir = path.resolve(cwd, rulesDir); } var rules = Object.create(null); + fs.readdirSync(rulesDir).forEach(function(file) { if (path.extname(file) !== ".js") { return; } - rules[file.slice(0, -3)] = require(path.join(rulesDir, file)); + rules[file.slice(0, -3)] = path.join(rulesDir, file); }); return rules; }; diff --git a/tools/eslint/lib/logging.js b/tools/eslint/lib/logging.js new file mode 100644 index 00000000000000..f0ded092955c63 --- /dev/null +++ b/tools/eslint/lib/logging.js @@ -0,0 +1,26 @@ +/** + * @fileoverview Handle logging for ESLint + * @author Gyandeep Singh + * @copyright 2015 Gyandeep Singh. All rights reserved. + */ +"use strict"; + +/* istanbul ignore next */ +module.exports = { + + /** + * Cover for console.log + * @returns {void} + */ + info: function() { + console.log.apply(console, Array.prototype.slice.call(arguments)); + }, + + /** + * Cover for console.error + * @returns {void} + */ + error: function() { + console.error.apply(console, Array.prototype.slice.call(arguments)); + } +}; diff --git a/tools/eslint/lib/options.js b/tools/eslint/lib/options.js index 58111090b6e191..e7f70ea0925dab 100644 --- a/tools/eslint/lib/options.js +++ b/tools/eslint/lib/options.js @@ -1,6 +1,7 @@ /** * @fileoverview Options configuration for optionator. * @author George Zahariev + * See LICENSE in root directory for full license. */ "use strict"; @@ -17,116 +18,207 @@ var optionator = require("optionator"); // exports "parse(args)", "generateHelp()", and "generateHelpForOption(optionName)" module.exports = optionator({ prepend: "eslint [options] file.js [file.js] [dir]", - concatRepeatedArrays: true, - mergeRepeatedObjects: true, - options: [{ - heading: "Options" - }, { - option: "help", - alias: "h", - type: "Boolean", - description: "Show help" - }, { - option: "config", - alias: "c", - type: "path::String", - description: "Use configuration from this file" - }, { - option: "rulesdir", - type: "[path::String]", - description: "Use additional rules from this directory" - }, { - option: "format", - alias: "f", - type: "String", - default: "stylish", - description: "Use a specific output format" - }, { - option: "version", - alias: "v", - type: "Boolean", - description: "Outputs the version number" - }, { - option: "reset", - type: "Boolean", - default: "false", - description: "Set all default rules to off" - }, { - option: "eslintrc", - type: "Boolean", - default: "true", - description: "Disable use of configuration from .eslintrc" - }, { - option: "env", - type: "[String]", - description: "Specify environments" - }, { - option: "ext", - type: "[String]", - default: ".js", - description: "Specify JavaScript file extensions" - }, { - option: "plugin", - type: "[String]", - description: "Specify plugins" - }, { - option: "global", - type: "[String]", - description: "Define global variables" - }, { - option: "rule", - type: "Object", - description: "Specify rules" + defaults: { + concatRepeatedArrays: true, + mergeRepeatedObjects: true }, - { - option: "ignore-path", - type: "path::String", - description: "Specify path of ignore file" - }, - { - option: "ignore", - type: "Boolean", - default: "true", - description: "Disable use of .eslintignore" - }, - { - option: "ignore-pattern", - type: "String", - description: "Pattern of files to ignore (in addition to those in .eslintignore)" - }, - { - option: "color", - type: "Boolean", - default: "true", - description: "Disable color in piped output" - }, - { - option: "output-file", - alias: "o", - type: "path::String", - description: "Specify file to write report to" - }, - { - option: "quiet", - type: "Boolean", - default: "false", - description: "Report errors only" - }, - { - option: "stdin", - type: "Boolean", - default: "false", - description: "Lint code provided on " - }, - { - option: "stdin-filename", - type: "String", - description: "Specify filename to process STDIN as" - }, - { - option: "init", - type: "Boolean", - default: "false", - description: "Run config initialization wizard" - }] + options: [ + { + heading: "Basic configuration" + }, + { + option: "config", + alias: "c", + type: "path::String", + description: "Use configuration from this file or shareable config" + }, + { + option: "eslintrc", + type: "Boolean", + default: "true", + description: "Disable use of configuration from .eslintrc" + }, + { + option: "env", + type: "[String]", + description: "Specify environments" + }, + { + option: "ext", + type: "[String]", + default: ".js", + description: "Specify JavaScript file extensions" + }, + { + option: "global", + type: "[String]", + description: "Define global variables" + }, + { + option: "parser", + type: "String", + default: "espree", + description: "Specify the parser to be used" + }, + { + option: "parser-options", + type: "Object", + description: "Specify parser options" + }, + { + heading: "Caching" + }, + { + option: "cache", + type: "Boolean", + default: "false", + description: "Only check changed files" + }, + { + option: "cache-file", + type: "path::String", + default: ".eslintcache", + description: "Path to the cache file. Deprecated: use --cache-location" + }, + { + option: "cache-location", + type: "path::String", + description: "Path to the cache file or directory" + }, + { + heading: "Specifying rules and plugins" + }, + { + option: "rulesdir", + type: "[path::String]", + description: "Use additional rules from this directory" + }, + { + option: "plugin", + type: "[String]", + description: "Specify plugins" + }, + { + option: "rule", + type: "Object", + description: "Specify rules" + }, + { + heading: "Ignoring files" + }, + { + option: "ignore-path", + type: "path::String", + description: "Specify path of ignore file" + }, + { + option: "ignore", + type: "Boolean", + default: "true", + description: "Disable use of .eslintignore" + }, + { + option: "ignore-pattern", + type: "[String]", + description: "Pattern of files to ignore (in addition to those in .eslintignore)", + concatRepeatedArrays: [true, { + oneValuePerFlag: true + }] + }, + { + heading: "Using stdin" + }, + { + option: "stdin", + type: "Boolean", + default: "false", + description: "Lint code provided on " + }, + { + option: "stdin-filename", + type: "String", + description: "Specify filename to process STDIN as" + }, + { + heading: "Handling warnings" + }, + { + option: "quiet", + type: "Boolean", + default: "false", + description: "Report errors only" + }, + { + option: "max-warnings", + type: "Int", + default: "-1", + description: "Number of warnings to trigger nonzero exit code" + }, + { + heading: "Output" + }, + { + option: "output-file", + alias: "o", + type: "path::String", + description: "Specify file to write report to" + }, + { + option: "format", + alias: "f", + type: "String", + default: "stylish", + description: "Use a specific output format" + }, + { + option: "color", + type: "Boolean", + default: "true", + description: "Disable color in piped output" + }, + { + heading: "Miscellaneous" + }, + { + option: "init", + type: "Boolean", + default: "false", + description: "Run config initialization wizard" + }, + { + option: "fix", + type: "Boolean", + default: false, + description: "Automatically fix problems" + }, + { + option: "debug", + type: "Boolean", + default: false, + description: "Output debugging information" + }, + { + option: "help", + alias: "h", + type: "Boolean", + description: "Show help" + }, + { + option: "version", + alias: "v", + type: "Boolean", + description: "Output the version number" + }, + { + option: "inline-config", + type: "Boolean", + default: "true", + description: "Allow comments to change eslint config/rules" + }, + { + option: "print-config", + type: "Boolean", + description: "Print the configuration to be used" + } + ] }); diff --git a/tools/eslint/lib/rule-context.js b/tools/eslint/lib/rule-context.js index 0513685f6d6acb..03f5b886fdbdbb 100644 --- a/tools/eslint/lib/rule-context.js +++ b/tools/eslint/lib/rule-context.js @@ -1,37 +1,60 @@ /** * @fileoverview RuleContext utility for rules * @author Nicholas C. Zakas + * @copyright 2013 Nicholas C. Zakas. All rights reserved. + * See LICENSE file in root directory for full license. */ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var RuleFixer = require("./util/rule-fixer"); + //------------------------------------------------------------------------------ // Constants //------------------------------------------------------------------------------ var PASSTHROUGHS = [ - "getAllComments", - "getAncestors", - "getComments", - "getFilename", - "getFirstToken", - "getFirstTokens", - "getJSDocComment", - "getLastToken", - "getLastTokens", - "getNodeByRangeIndex", - "getScope", - "getSource", - "getSourceLines", - "getTokenAfter", - "getTokenBefore", - "getTokenByRangeStart", - "getTokens", - "getTokensAfter", - "getTokensBefore", - "getTokensBetween", - "markVariableAsUsed", - "isMarkedAsUsed" - ]; + "getAllComments", + "getAncestors", + "getComments", + "getDeclaredVariables", + "getFilename", + "getFirstToken", + "getFirstTokens", + "getJSDocComment", + "getLastToken", + "getLastTokens", + "getNodeByRangeIndex", + "getScope", + "getSource", + "getSourceLines", + "getTokenAfter", + "getTokenBefore", + "getTokenByRangeStart", + "getTokens", + "getTokensAfter", + "getTokensBefore", + "getTokensBetween", + "markVariableAsUsed" +]; + +//------------------------------------------------------------------------------ +// Typedefs +//------------------------------------------------------------------------------ + +/** + * An error message description + * @typedef {Object} MessageDescriptor + * @property {string} nodeType The type of node. + * @property {Location} loc The location of the problem. + * @property {string} message The problem message. + * @property {Object} [data] Optional data to use to fill in placeholders in the + * message. + * @property {Function} fix The function to call that creates a fix command. + */ //------------------------------------------------------------------------------ // Rule Definition @@ -43,65 +66,95 @@ var PASSTHROUGHS = [ * @param {string} ruleId The ID of the rule using this object. * @param {eslint} eslint The eslint object. * @param {number} severity The configured severity level of the rule. - * @param {array} options The configuration information to be added to the rule. - * @param {object} settings The configuration settings passed from the config file. - * @param {object} ecmaFeatures The ecmaFeatures settings passed from the config file. + * @param {Array} options The configuration information to be added to the rule. + * @param {Object} settings The configuration settings passed from the config file. + * @param {Object} parserOptions The parserOptions settings passed from the config file. + * @param {Object} parserPath The parser setting passed from the config file. + * @param {Object} meta The metadata of the rule */ -function RuleContext(ruleId, eslint, severity, options, settings, ecmaFeatures) { +function RuleContext(ruleId, eslint, severity, options, settings, parserOptions, parserPath, meta) { - /** - * The read-only ID of the rule. - */ - Object.defineProperty(this, "id", { - value: ruleId - }); + // public. + this.id = ruleId; + this.options = options; + this.settings = settings; + this.parserOptions = parserOptions; + this.parserPath = parserPath; + this.meta = meta; - /** - * The read-only options of the rule - */ - Object.defineProperty(this, "options", { - value: options - }); + // private. + this.eslint = eslint; + this.severity = severity; - /** - * The read-only settings shared between all rules - */ - Object.defineProperty(this, "settings", { - value: settings - }); + Object.freeze(this); +} + +RuleContext.prototype = { + constructor: RuleContext, /** - * The read-only ecmaFeatures shared across all rules + * Passthrough to eslint.getSourceCode(). + * @returns {SourceCode} The SourceCode object for the code. */ - Object.defineProperty(this, "ecmaFeatures", { - value: Object.create(ecmaFeatures) - }); - Object.freeze(this.ecmaFeatures); - - // copy over passthrough methods - PASSTHROUGHS.forEach(function(name) { - this[name] = function() { - return eslint[name].apply(eslint, arguments); - }; - }, this); + getSourceCode: function() { + return this.eslint.getSourceCode(); + }, /** * Passthrough to eslint.report() that automatically assigns the rule ID and severity. - * @param {ASTNode} node The AST node related to the message. + * @param {ASTNode|MessageDescriptor} nodeOrDescriptor The AST node related to the message or a message + * descriptor. * @param {Object=} location The location of the error. * @param {string} message The message to display to the user. * @param {Object} opts Optional template data which produces a formatted message * with symbols being replaced by this object's values. * @returns {void} */ - this.report = function(node, location, message, opts) { - eslint.report(ruleId, severity, node, location, message, opts); - }; + report: function(nodeOrDescriptor, location, message, opts) { + var descriptor, + fix = null; -} + // check to see if it's a new style call + if (arguments.length === 1) { + descriptor = nodeOrDescriptor; -RuleContext.prototype = { - constructor: RuleContext + // if there's a fix specified, get it + if (typeof descriptor.fix === "function") { + fix = descriptor.fix(new RuleFixer()); + } + + this.eslint.report( + this.id, + this.severity, + descriptor.node, + descriptor.loc || descriptor.node.loc.start, + descriptor.message, + descriptor.data, + fix, + this.meta + ); + + return; + } + + // old style call + this.eslint.report( + this.id, + this.severity, + nodeOrDescriptor, + location, + message, + opts, + this.meta + ); + } }; +// Copy over passthrough methods. All functions will have 5 or fewer parameters. +PASSTHROUGHS.forEach(function(name) { + this[name] = function(a, b, c, d, e) { + return this.eslint[name](a, b, c, d, e); + }; +}, RuleContext.prototype); + module.exports = RuleContext; diff --git a/tools/eslint/lib/rules.js b/tools/eslint/lib/rules.js index eef942fcf15473..24a8fd8a497bb9 100644 --- a/tools/eslint/lib/rules.js +++ b/tools/eslint/lib/rules.js @@ -23,7 +23,7 @@ var rules = Object.create(null); /** * Registers a rule module for rule id in storage. - * @param {String} ruleId Rule id (file name). + * @param {string} ruleId Rule id (file name). * @param {Function} ruleModule Rule handler. * @returns {void} */ @@ -31,53 +31,72 @@ function define(ruleId, ruleModule) { rules[ruleId] = ruleModule; } -exports.define = define; - /** * Loads and registers all rules from passed rules directory. - * @param {String} [rulesDir] Path to rules directory, may be relative. Defaults to `lib/rules`. + * @param {string} [rulesDir] Path to rules directory, may be relative. Defaults to `lib/rules`. + * @param {string} cwd Current working directory * @returns {void} */ -function load(rulesDir) { - var newRules = loadRules(rulesDir); +function load(rulesDir, cwd) { + var newRules = loadRules(rulesDir, cwd); + Object.keys(newRules).forEach(function(ruleId) { define(ruleId, newRules[ruleId]); }); } -exports.load = load; - /** * Registers all given rules of a plugin. * @param {Object} pluginRules A key/value map of rule definitions. - * @param {String} pluginName The name of the plugin without prefix (`eslint-plugin-`). + * @param {string} pluginName The name of the plugin without prefix (`eslint-plugin-`). * @returns {void} */ -exports.import = function (pluginRules, pluginName) { - Object.keys(pluginRules).forEach(function (ruleId) { +function importPlugin(pluginRules, pluginName) { + Object.keys(pluginRules).forEach(function(ruleId) { var qualifiedRuleId = pluginName + "/" + ruleId, rule = pluginRules[ruleId]; define(qualifiedRuleId, rule); }); -}; +} /** * Access rule handler by id (file name). - * @param {String} ruleId Rule id (file name). + * @param {string} ruleId Rule id (file name). * @returns {Function} Rule handler. */ -exports.get = function(ruleId) { - return rules[ruleId]; -}; +function get(ruleId) { + if (typeof rules[ruleId] === "string") { + return require(rules[ruleId]); + } else { + return rules[ruleId]; + } +} /** * Reset rules storage. * Should be used only in tests. * @returns {void} */ -exports.testClear = function() { +function testClear() { rules = Object.create(null); +} + +module.exports = { + define: define, + load: load, + import: importPlugin, + get: get, + testClear: testClear, + + /** + * Resets rules to its starting state. Use for tests only. + * @returns {void} + */ + testReset: function() { + testClear(); + load(); + } }; //------------------------------------------------------------------------------ diff --git a/tools/eslint/lib/rules/accessor-pairs.js b/tools/eslint/lib/rules/accessor-pairs.js index 42734acf9a2fa5..8f8f5293dc2c0c 100644 --- a/tools/eslint/lib/rules/accessor-pairs.js +++ b/tools/eslint/lib/rules/accessor-pairs.js @@ -7,59 +7,151 @@ "use strict"; //------------------------------------------------------------------------------ -// Rule Definition +// Helpers //------------------------------------------------------------------------------ -module.exports = function(context) { - var config = context.options[0] || {}; - var checkGetWithoutSet = config.getWithoutSet === true; - var checkSetWithoutGet = config.setWithoutGet !== false; +/** + * Checks whether or not a given node is an `Identifier` node which was named a given name. + * @param {ASTNode} node - A node to check. + * @param {string} name - An expected name of the node. + * @returns {boolean} `true` if the node is an `Identifier` node which was named as expected. + */ +function isIdentifier(node, name) { + return node.type === "Identifier" && node.name === name; +} + +/** + * Checks whether or not a given node is an argument of a specified method call. + * @param {ASTNode} node - A node to check. + * @param {number} index - An expected index of the node in arguments. + * @param {string} object - An expected name of the object of the method. + * @param {string} property - An expected name of the method. + * @returns {boolean} `true` if the node is an argument of the specified method call. + */ +function isArgumentOfMethodCall(node, index, object, property) { + var parent = node.parent; + + return ( + parent.type === "CallExpression" && + parent.callee.type === "MemberExpression" && + parent.callee.computed === false && + isIdentifier(parent.callee.object, object) && + isIdentifier(parent.callee.property, property) && + parent.arguments[index] === node + ); +} + +/** + * Checks whether or not a given node is a property descriptor. + * @param {ASTNode} node - A node to check. + * @returns {boolean} `true` if the node is a property descriptor. + */ +function isPropertyDescriptor(node) { + + // Object.defineProperty(obj, "foo", {set: ...}) + if (isArgumentOfMethodCall(node, 2, "Object", "defineProperty") || + isArgumentOfMethodCall(node, 2, "Reflect", "defineProperty") + ) { + return true; + } - /** - * Checks a object expression to see if it has setter and getter both present or none. - * @param {ASTNode} node The node to check. - * @returns {void} - * @private + /* + * Object.defineProperties(obj, {foo: {set: ...}}) + * Object.create(proto, {foo: {set: ...}}) */ - function checkLonelySetGet(node) { - var isSetPresent = false; - var isGetPresent = false; - var propLength = node.properties.length; + node = node.parent.parent; - for (var i = 0; i < propLength; i++) { - var propToCheck = node.properties[i].kind === "init" ? node.properties[i].key.name : node.properties[i].kind; + return node.type === "ObjectExpression" && ( + isArgumentOfMethodCall(node, 1, "Object", "create") || + isArgumentOfMethodCall(node, 1, "Object", "defineProperties") + ); +} - switch (propToCheck) { - case "set": - isSetPresent = true; - break; +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ - case "get": - isGetPresent = true; - break; +module.exports = { + meta: { + docs: { + description: "Enforces getter/setter pairs in objects", + category: "Best Practices", + recommended: false + }, + schema: [{ + "type": "object", + "properties": { + "getWithoutSet": { + "type": "boolean" + }, + "setWithoutGet": { + "type": "boolean" + } + }, + "additionalProperties": false + }] + }, + create: function(context) { + var config = context.options[0] || {}; + var checkGetWithoutSet = config.getWithoutSet === true; + var checkSetWithoutGet = config.setWithoutGet !== false; - default: - // Do nothing - } + /** + * Checks a object expression to see if it has setter and getter both present or none. + * @param {ASTNode} node The node to check. + * @returns {void} + * @private + */ + function checkLonelySetGet(node) { + var isSetPresent = false; + var isGetPresent = false; + var isDescriptor = isPropertyDescriptor(node); - if (isSetPresent && isGetPresent) { - break; - } - } + for (var i = 0, end = node.properties.length; i < end; i++) { + var property = node.properties[i]; - if (checkSetWithoutGet && isSetPresent && !isGetPresent) { - context.report(node, "Getter is not present"); - } else if (checkGetWithoutSet && isGetPresent && !isSetPresent) { - context.report(node, "Setter is not present"); - } - } + var propToCheck = ""; + + if (property.kind === "init") { + if (isDescriptor && !property.computed) { + propToCheck = property.key.name; + } + } else { + propToCheck = property.kind; + } + + switch (propToCheck) { + case "set": + isSetPresent = true; + break; - return { - "ObjectExpression": function (node) { - if (checkSetWithoutGet || checkGetWithoutSet) { - checkLonelySetGet(node); + case "get": + isGetPresent = true; + break; + + default: + + // Do nothing + } + + if (isSetPresent && isGetPresent) { + break; + } + } + + if (checkSetWithoutGet && isSetPresent && !isGetPresent) { + context.report(node, "Getter is not present"); + } else if (checkGetWithoutSet && isGetPresent && !isSetPresent) { + context.report(node, "Setter is not present"); } } - }; + return { + "ObjectExpression": function(node) { + if (checkSetWithoutGet || checkGetWithoutSet) { + checkLonelySetGet(node); + } + } + }; + } }; diff --git a/tools/eslint/lib/rules/array-bracket-spacing.js b/tools/eslint/lib/rules/array-bracket-spacing.js index eaec76e294d08d..617d6279b1d4c1 100644 --- a/tools/eslint/lib/rules/array-bracket-spacing.js +++ b/tools/eslint/lib/rules/array-bracket-spacing.js @@ -8,173 +8,212 @@ */ "use strict"; +var astUtils = require("../ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ -module.exports = function(context) { - var spaced = context.options[0] === "always"; - - /** - * Determines whether an option is set, relative to the spacing option. - * If spaced is "always", then check whether option is set to false. - * If spaced is "never", then check whether option is set to true. - * @param {Object} option - The option to exclude. - * @returns {boolean} Whether or not the property is excluded. - */ - function isOptionSet(option) { - return context.options[1] != null ? context.options[1][option] === !spaced : false; - } - - var options = { - spaced: spaced, - singleElementException: isOptionSet("singleValue"), - objectsInArraysException: isOptionSet("objectsInArrays"), - arraysInArraysException: isOptionSet("arraysInArrays") - }; - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Determines whether two adjacent tokens are have whitespace between them. - * @param {Object} left - The left token object. - * @param {Object} right - The right token object. - * @returns {boolean} Whether or not there is space between the tokens. - */ - function isSpaced(left, right) { - return left.range[1] < right.range[0]; - } +module.exports = { + meta: { + docs: { + description: "Enforce spacing inside array brackets", + category: "Stylistic Issues", + recommended: false, + fixable: "whitespace" + }, + schema: [ + { + "enum": ["always", "never"] + }, + { + "type": "object", + "properties": { + "singleValue": { + "type": "boolean" + }, + "objectsInArrays": { + "type": "boolean" + }, + "arraysInArrays": { + "type": "boolean" + } + }, + "additionalProperties": false + } + ] + }, + create: function(context) { + var spaced = context.options[0] === "always", + sourceCode = context.getSourceCode(); + + /** + * Determines whether an option is set, relative to the spacing option. + * If spaced is "always", then check whether option is set to false. + * If spaced is "never", then check whether option is set to true. + * @param {Object} option - The option to exclude. + * @returns {boolean} Whether or not the property is excluded. + */ + function isOptionSet(option) { + return context.options[1] ? context.options[1][option] === !spaced : false; + } - /** - * Determines whether two adjacent tokens are on the same line. - * @param {Object} left - The left token object. - * @param {Object} right - The right token object. - * @returns {boolean} Whether or not the tokens are on the same line. - */ - function isSameLine(left, right) { - return left.loc.start.line === right.loc.start.line; - } + var options = { + spaced: spaced, + singleElementException: isOptionSet("singleValue"), + objectsInArraysException: isOptionSet("objectsInArrays"), + arraysInArraysException: isOptionSet("arraysInArrays") + }; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports that there shouldn't be a space after the first token + * @param {ASTNode} node - The node to report in the event of an error. + * @param {Token} token - The token to use for the report. + * @returns {void} + */ + function reportNoBeginningSpace(node, token) { + context.report({ + node: node, + loc: token.loc.start, + message: "There should be no space after '" + token.value + "'", + fix: function(fixer) { + var nextToken = context.getSourceCode().getTokenAfter(token); + + return fixer.removeRange([token.range[1], nextToken.range[0]]); + } + }); + } - /** - * Reports that there shouldn't be a space after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportNoBeginningSpace(node, token) { - context.report(node, token.loc.start, - "There should be no space after '" + token.value + "'"); - } + /** + * Reports that there shouldn't be a space before the last token + * @param {ASTNode} node - The node to report in the event of an error. + * @param {Token} token - The token to use for the report. + * @returns {void} + */ + function reportNoEndingSpace(node, token) { + context.report({ + node: node, + loc: token.loc.start, + message: "There should be no space before '" + token.value + "'", + fix: function(fixer) { + var previousToken = context.getSourceCode().getTokenBefore(token); + + return fixer.removeRange([previousToken.range[1], token.range[0]]); + } + }); + } - /** - * Reports that there shouldn't be a space before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportNoEndingSpace(node, token) { - context.report(node, token.loc.start, - "There should be no space before '" + token.value + "'"); - } + /** + * Reports that there should be a space after the first token + * @param {ASTNode} node - The node to report in the event of an error. + * @param {Token} token - The token to use for the report. + * @returns {void} + */ + function reportRequiredBeginningSpace(node, token) { + context.report({ + node: node, + loc: token.loc.start, + message: "A space is required after '" + token.value + "'", + fix: function(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } - /** - * Reports that there should be a space after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportRequiredBeginningSpace(node, token) { - context.report(node, token.loc.start, - "A space is required after '" + token.value + "'"); - } + /** + * Reports that there should be a space before the last token + * @param {ASTNode} node - The node to report in the event of an error. + * @param {Token} token - The token to use for the report. + * @returns {void} + */ + function reportRequiredEndingSpace(node, token) { + context.report({ + node: node, + loc: token.loc.start, + message: "A space is required before '" + token.value + "'", + fix: function(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } - /** - * Reports that there should be a space before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportRequiredEndingSpace(node, token) { - context.report(node, token.loc.start, - "A space is required before '" + token.value + "'"); - } + /** + * Determines if a node is an object type + * @param {ASTNode} node - The node to check. + * @returns {boolean} Whether or not the node is an object type. + */ + function isObjectType(node) { + return node && (node.type === "ObjectExpression" || node.type === "ObjectPattern"); + } - /** - * Validates the spacing around array brackets - * @param {ASTNode} node - The node we're checking for spacing - * @returns {void} - */ - function validateArraySpacing(node) { - if (node.elements.length === 0) { - return; + /** + * Determines if a node is an array type + * @param {ASTNode} node - The node to check. + * @returns {boolean} Whether or not the node is an array type. + */ + function isArrayType(node) { + return node && (node.type === "ArrayExpression" || node.type === "ArrayPattern"); } - var first = context.getFirstToken(node), - second = context.getFirstToken(node, 1), - penultimate = context.getLastToken(node, 1), - last = context.getLastToken(node); - - var openingBracketMustBeSpaced = - options.objectsInArraysException && second.value === "{" || - options.arraysInArraysException && second.value === "[" || - options.singleElementException && node.elements.length === 1 - ? !options.spaced : options.spaced; - - var closingBracketMustBeSpaced = - options.objectsInArraysException && penultimate.value === "}" || - options.arraysInArraysException && penultimate.value === "]" || - options.singleElementException && node.elements.length === 1 - ? !options.spaced : options.spaced; - - if (isSameLine(first, second)) { - if (openingBracketMustBeSpaced && !isSpaced(first, second)) { - reportRequiredBeginningSpace(node, first); - } - if (!openingBracketMustBeSpaced && isSpaced(first, second)) { - reportNoBeginningSpace(node, first); + /** + * Validates the spacing around array brackets + * @param {ASTNode} node - The node we're checking for spacing + * @returns {void} + */ + function validateArraySpacing(node) { + if (options.spaced && node.elements.length === 0) { + return; } - } - if (isSameLine(penultimate, last)) { - if (closingBracketMustBeSpaced && !isSpaced(penultimate, last)) { - reportRequiredEndingSpace(node, last); + var first = context.getFirstToken(node), + second = context.getFirstToken(node, 1), + penultimate = context.getLastToken(node, 1), + last = context.getLastToken(node), + firstElement = node.elements[0], + lastElement = node.elements[node.elements.length - 1]; + + var openingBracketMustBeSpaced = + options.objectsInArraysException && isObjectType(firstElement) || + options.arraysInArraysException && isArrayType(firstElement) || + options.singleElementException && node.elements.length === 1 + ? !options.spaced : options.spaced; + + var closingBracketMustBeSpaced = + options.objectsInArraysException && isObjectType(lastElement) || + options.arraysInArraysException && isArrayType(lastElement) || + options.singleElementException && node.elements.length === 1 + ? !options.spaced : options.spaced; + + if (astUtils.isTokenOnSameLine(first, second)) { + if (openingBracketMustBeSpaced && !sourceCode.isSpaceBetweenTokens(first, second)) { + reportRequiredBeginningSpace(node, first); + } + if (!openingBracketMustBeSpaced && sourceCode.isSpaceBetweenTokens(first, second)) { + reportNoBeginningSpace(node, first); + } } - if (!closingBracketMustBeSpaced && isSpaced(penultimate, last)) { - reportNoEndingSpace(node, last); + + if (first !== penultimate && astUtils.isTokenOnSameLine(penultimate, last)) { + if (closingBracketMustBeSpaced && !sourceCode.isSpaceBetweenTokens(penultimate, last)) { + reportRequiredEndingSpace(node, last); + } + if (!closingBracketMustBeSpaced && sourceCode.isSpaceBetweenTokens(penultimate, last)) { + reportNoEndingSpace(node, last); + } } } - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - return { - ArrayPattern: validateArraySpacing, - ArrayExpression: validateArraySpacing - }; + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- -}; - -module.exports.schema = [ - { - "enum": ["always", "never"] - }, - { - "type": "object", - "properties": { - "singleValue": { - "type": "boolean" - }, - "objectsInArrays": { - "type": "boolean" - }, - "arraysInArrays": { - "type": "boolean" - } - }, - "additionalProperties": false + return { + ArrayPattern: validateArraySpacing, + ArrayExpression: validateArraySpacing + }; } -]; +}; diff --git a/tools/eslint/lib/rules/array-callback-return.js b/tools/eslint/lib/rules/array-callback-return.js new file mode 100644 index 00000000000000..01fe01dd851d81 --- /dev/null +++ b/tools/eslint/lib/rules/array-callback-return.js @@ -0,0 +1,241 @@ +/** + * @fileoverview Rule to enforce return statements in callbacks of array's methods + * @author Toru Nagashima + * @copyright 2015 Toru Nagashima. All rights reserved. + * See LICENSE file in root directory for full license. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var astUtils = require("../ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +var TARGET_NODE_TYPE = /^(?:Arrow)?FunctionExpression$/; +var TARGET_METHODS = /^(?:every|filter|find(?:Index)?|map|reduce(?:Right)?|some|sort)$/; + +/** + * Checks a given code path segment is reachable. + * + * @param {CodePathSegment} segment - A segment to check. + * @returns {boolean} `true` if the segment is reachable. + */ +function isReachable(segment) { + return segment.reachable; +} + +/** + * Gets a readable location. + * + * - FunctionExpression -> the function name or `function` keyword. + * - ArrowFunctionExpression -> `=>` token. + * + * @param {ASTNode} node - A function node to get. + * @param {SourceCode} sourceCode - A source code to get tokens. + * @returns {ASTNode|Token} The node or the token of a location. + */ +function getLocation(node, sourceCode) { + if (node.type === "ArrowFunctionExpression") { + return sourceCode.getTokenBefore(node.body); + } + return node.id || node; +} + +/** + * Gets the name of a given node if the node is a Identifier node. + * + * @param {ASTNode} node - A node to get. + * @returns {string} The name of the node, or an empty string. + */ +function getIdentifierName(node) { + return node.type === "Identifier" ? node.name : ""; +} + +/** + * Gets the value of a given node if the node is a Literal node or a + * TemplateLiteral node. + * + * @param {ASTNode} node - A node to get. + * @returns {string} The value of the node, or an empty string. + */ +function getConstantStringValue(node) { + switch (node.type) { + case "Literal": + return String(node.value); + + case "TemplateLiteral": + return node.expressions.length === 0 + ? node.quasis[0].value.cooked + : ""; + + default: + return ""; + } +} + +/** + * Checks a given node is a MemberExpression node which has the specified name's + * property. + * + * @param {ASTNode} node - A node to check. + * @returns {boolean} `true` if the node is a MemberExpression node which has + * the specified name's property + */ +function isTargetMethod(node) { + return ( + node.type === "MemberExpression" && + TARGET_METHODS.test( + (node.computed ? getConstantStringValue : getIdentifierName)(node.property) + ) + ); +} + +/** + * Checks whether or not a given node is a function expression which is the + * callback of an array method. + * + * @param {ASTNode} node - A node to check. This is one of + * FunctionExpression or ArrowFunctionExpression. + * @returns {boolean} `true` if the node is the callback of an array method. + */ +function isCallbackOfArrayMethod(node) { + while (node) { + var parent = node.parent; + + switch (parent.type) { + + /* + * Looks up the destination. e.g., + * foo.every(nativeFoo || function foo() { ... }); + */ + case "LogicalExpression": + case "ConditionalExpression": + node = parent; + break; + + // If the upper function is IIFE, checks the destination of the return value. + // e.g. + // foo.every((function() { + // // setup... + // return function callback() { ... }; + // })()); + case "ReturnStatement": + var func = astUtils.getUpperFunction(parent); + + if (func === null || !astUtils.isCallee(func)) { + return false; + } + node = func.parent; + break; + + // e.g. + // Array.from([], function() {}); + // list.every(function() {}); + case "CallExpression": + if (astUtils.isArrayFromMethod(parent.callee)) { + return ( + parent.arguments.length >= 2 && + parent.arguments[1] === node + ); + } + if (isTargetMethod(parent.callee)) { + return ( + parent.arguments.length >= 1 && + parent.arguments[0] === node + ); + } + return false; + + // Otherwise this node is not target. + default: + return false; + } + } + + /* istanbul ignore next: unreachable */ + return false; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var funcInfo = { + upper: null, + codePath: null, + hasReturn: false, + shouldCheck: false + }; + + /** + * Checks whether or not the last code path segment is reachable. + * Then reports this function if the segment is reachable. + * + * If the last code path segment is reachable, there are paths which are not + * returned or thrown. + * + * @param {ASTNode} node - A node to check. + * @returns {void} + */ + function checkLastSegment(node) { + if (funcInfo.shouldCheck && + funcInfo.codePath.currentSegments.some(isReachable) + ) { + context.report({ + node: node, + loc: getLocation(node, context.getSourceCode()).loc.start, + message: funcInfo.hasReturn + ? "Expected to return a value at the end of this function." + : "Expected to return a value in this function." + }); + } + } + + return { + + // Stacks this function's information. + "onCodePathStart": function(codePath, node) { + funcInfo = { + upper: funcInfo, + codePath: codePath, + hasReturn: false, + shouldCheck: + TARGET_NODE_TYPE.test(node.type) && + node.body.type === "BlockStatement" && + isCallbackOfArrayMethod(node) + }; + }, + + // Pops this function's information. + "onCodePathEnd": function() { + funcInfo = funcInfo.upper; + }, + + // Checks the return statement is valid. + "ReturnStatement": function(node) { + if (funcInfo.shouldCheck) { + funcInfo.hasReturn = true; + + if (!node.argument) { + context.report({ + node: node, + message: "Expected a return value." + }); + } + } + }, + + // Reports a given function if the last path is reachable. + "FunctionExpression:exit": checkLastSegment, + "ArrowFunctionExpression:exit": checkLastSegment + }; +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/arrow-body-style.js b/tools/eslint/lib/rules/arrow-body-style.js new file mode 100644 index 00000000000000..3acf4942cab6c1 --- /dev/null +++ b/tools/eslint/lib/rules/arrow-body-style.js @@ -0,0 +1,59 @@ +/** + * @fileoverview Rule to require braces in arrow function body. + * @author Alberto Rodríguez + * @copyright 2015 Alberto Rodríguez. All rights reserved. + * See LICENSE file in root directory for full license. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var always = context.options[0] === "always"; + var asNeeded = !context.options[0] || context.options[0] === "as-needed"; + + /** + * Determines whether a arrow function body needs braces + * @param {ASTNode} node The arrow function node. + * @returns {void} + */ + function validate(node) { + var arrowBody = node.body; + + if (arrowBody.type === "BlockStatement") { + var blockBody = arrowBody.body; + + if (blockBody.length !== 1) { + return; + } + + if (asNeeded && blockBody[0].type === "ReturnStatement") { + context.report({ + node: node, + loc: arrowBody.loc.start, + message: "Unexpected block statement surrounding arrow body." + }); + } + } else { + if (always) { + context.report({ + node: node, + loc: arrowBody.loc.start, + message: "Expected block statement surrounding arrow body." + }); + } + } + } + + return { + "ArrowFunctionExpression": validate + }; +}; + +module.exports.schema = [ + { + "enum": ["always", "as-needed"] + } +]; diff --git a/tools/eslint/lib/rules/arrow-parens.js b/tools/eslint/lib/rules/arrow-parens.js new file mode 100644 index 00000000000000..2332dda12134c2 --- /dev/null +++ b/tools/eslint/lib/rules/arrow-parens.js @@ -0,0 +1,52 @@ +/** + * @fileoverview Rule to require parens in arrow function arguments. + * @author Jxck + * @copyright 2015 Jxck. All rights reserved. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var message = "Expected parentheses around arrow function argument."; + var asNeededMessage = "Unexpected parentheses around single function argument"; + var asNeeded = context.options[0] === "as-needed"; + + /** + * Determines whether a arrow function argument end with `)` + * @param {ASTNode} node The arrow function node. + * @returns {void} + */ + function parens(node) { + var token = context.getFirstToken(node); + + // as-needed: x => x + if (asNeeded && node.params.length === 1 && node.params[0].type === "Identifier") { + if (token.type === "Punctuator" && token.value === "(") { + context.report(node, asNeededMessage); + } + return; + } + + if (token.type === "Identifier") { + var after = context.getTokenAfter(token); + + // (x) => x + if (after.value !== ")") { + context.report(node, message); + } + } + } + + return { + "ArrowFunctionExpression": parens + }; +}; + +module.exports.schema = [ + { + "enum": ["always", "as-needed"] + } +]; diff --git a/tools/eslint/lib/rules/arrow-spacing.js b/tools/eslint/lib/rules/arrow-spacing.js new file mode 100644 index 00000000000000..e1ea0daaa40a1c --- /dev/null +++ b/tools/eslint/lib/rules/arrow-spacing.js @@ -0,0 +1,133 @@ +/** + * @fileoverview Rule to define spacing before/after arrow function's arrow. + * @author Jxck + * @copyright 2015 Jxck. All rights reserved. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + + // merge rules with default + var rule = { before: true, after: true }, + option = context.options[0] || {}; + + rule.before = option.before !== false; + rule.after = option.after !== false; + + /** + * Get tokens of arrow(`=>`) and before/after arrow. + * @param {ASTNode} node The arrow function node. + * @returns {Object} Tokens of arrow and before/after arrow. + */ + function getTokens(node) { + var t = context.getFirstToken(node); + var before; + + while (t.type !== "Punctuator" || t.value !== "=>") { + before = t; + t = context.getTokenAfter(t); + } + var after = context.getTokenAfter(t); + + return { before: before, arrow: t, after: after }; + } + + /** + * Count spaces before/after arrow(`=>`) token. + * @param {Object} tokens Tokens before/after arrow. + * @returns {Object} count of space before/after arrow. + */ + function countSpaces(tokens) { + var before = tokens.arrow.range[0] - tokens.before.range[1]; + var after = tokens.after.range[0] - tokens.arrow.range[1]; + + return { before: before, after: after }; + } + + /** + * Determines whether space(s) before after arrow(`=>`) is satisfy rule. + * if before/after value is `true`, there should be space(s). + * if before/after value is `false`, there should be no space. + * @param {ASTNode} node The arrow function node. + * @returns {void} + */ + function spaces(node) { + var tokens = getTokens(node); + var countSpace = countSpaces(tokens); + + if (rule.before) { + + // should be space(s) before arrow + if (countSpace.before === 0) { + context.report({ + node: tokens.before, + message: "Missing space before =>", + fix: function(fixer) { + return fixer.insertTextBefore(tokens.arrow, " "); + } + }); + } + } else { + + // should be no space before arrow + if (countSpace.before > 0) { + context.report({ + node: tokens.before, + message: "Unexpected space before =>", + fix: function(fixer) { + return fixer.removeRange([tokens.before.range[1], tokens.arrow.range[0]]); + } + }); + } + } + + if (rule.after) { + + // should be space(s) after arrow + if (countSpace.after === 0) { + context.report({ + node: tokens.after, + message: "Missing space after =>", + fix: function(fixer) { + return fixer.insertTextAfter(tokens.arrow, " "); + } + }); + } + } else { + + // should be no space after arrow + if (countSpace.after > 0) { + context.report({ + node: tokens.after, + message: "Unexpected space after =>", + fix: function(fixer) { + return fixer.removeRange([tokens.arrow.range[1], tokens.after.range[0]]); + } + }); + } + } + } + + return { + "ArrowFunctionExpression": spaces + }; +}; + +module.exports.schema = [ + { + "type": "object", + "properties": { + "before": { + "type": "boolean" + }, + "after": { + "type": "boolean" + } + }, + "additionalProperties": false + } +]; diff --git a/tools/eslint/lib/rules/block-scoped-var.js b/tools/eslint/lib/rules/block-scoped-var.js index a463b12daf61bf..42d8422a007ca9 100644 --- a/tools/eslint/lib/rules/block-scoped-var.js +++ b/tools/eslint/lib/rules/block-scoped-var.js @@ -1,6 +1,8 @@ /** * @fileoverview Rule to check for "block scoped" variables by binding context * @author Matt DuVall + * @copyright 2015 Toru Nagashima. All rights reserved. + * @copyright 2015 Mathieu M-Gosselin. All rights reserved. */ "use strict"; @@ -9,310 +11,98 @@ //------------------------------------------------------------------------------ module.exports = function(context) { - - var scopeStack = []; - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Determines whether an identifier is in declaration position or is a non-declaration reference. - * @param {ASTNode} id The identifier. - * @param {ASTNode} parent The identifier's parent AST node. - * @returns {Boolean} true when the identifier is in declaration position. - */ - function isDeclaration(id, parent) { - switch (parent.type) { - case "FunctionDeclaration": - case "FunctionExpression": - return parent.params.indexOf(id) > -1 || id === parent.id; - - case "VariableDeclarator": - return id === parent.id; - - case "CatchClause": - return id === parent.param; - - default: - return false; - } - } - - /** - * Determines whether an identifier is in property position. - * @param {ASTNode} id The identifier. - * @param {ASTNode} parent The identifier's parent AST node. - * @returns {Boolean} true when the identifier is in property position. - */ - function isProperty(id, parent) { - switch (parent.type) { - case "MemberExpression": - return id === parent.property && !parent.computed; - - case "Property": - return id === parent.key; - - default: - return false; - } - } + var stack = []; /** - * Pushes a new scope object on the scope stack. + * Makes a block scope. + * @param {ASTNode} node - A node of a scope. * @returns {void} */ - function pushScope() { - scopeStack.push([]); + function enterScope(node) { + stack.push(node.range); } /** - * Removes the topmost scope object from the scope stack. + * Pops the last block scope. * @returns {void} */ - function popScope() { - scopeStack.pop(); + function exitScope() { + stack.pop(); } /** - * Declares the given names in the topmost scope object. - * @param {[String]} names A list of names to declare. + * Reports a given reference. + * @param {escope.Reference} reference - A reference to report. * @returns {void} */ - function declare(names) { - [].push.apply(scopeStack[scopeStack.length - 1], names); - } - - //-------------------------------------------------------------------------- - // Public API - //-------------------------------------------------------------------------- + function report(reference) { + var identifier = reference.identifier; - /** - * Declares all relevant identifiers for module imports. - * @param {ASTNode} node The AST node representing an import. - * @returns {void} - * @private - */ - function declareImports(node) { - declare([node.local.name]); - - if (node.imported && node.imported.name !== node.local.name) { - declare([node.imported.name]); - } + context.report( + identifier, + "'{{name}}' used outside of binding context.", + {name: identifier.name}); } /** - * Declares all relevant identifiers for classes. - * @param {ASTNode} node The AST node representing a class. + * Finds and reports references which are outside of valid scopes. + * @param {ASTNode} node - A node to get variables. * @returns {void} - * @private */ - function declareClass(node) { - - if (node.id) { - declare([node.id.name]); + function checkForVariables(node) { + if (node.kind !== "var") { + return; } - pushScope(); - } + // Defines a predicate to check whether or not a given reference is outside of valid scope. + var scopeRange = stack[stack.length - 1]; - /** - * Declares all relevant identifiers for classes. - * @param {ASTNode} node The AST node representing a class. - * @returns {void} - * @private - */ - function declareClassMethod(node) { - pushScope(); - - declare([node.key.name]); - } + /** + * Check if a reference is out of scope + * @param {ASTNode} reference node to examine + * @returns {boolean} True is its outside the scope + * @private + */ + function isOutsideOfScope(reference) { + var idRange = reference.identifier.range; - /** - * Add declarations based on the type of node being passed. - * @param {ASTNode} node The node containing declarations. - * @returns {void} - * @private - */ - function declareByNodeType(node) { - - var declarations = []; - - switch (node.type) { - case "Identifier": - declarations.push(node.name); - break; - - case "ObjectPattern": - node.properties.forEach(function(property) { - declarations.push(property.key.name); - if (property.value) { - declarations.push(property.value.name); - } - }); - break; - - case "ArrayPattern": - node.elements.forEach(function(element) { - if (element) { - declarations.push(element.name); - } - }); - break; - - case "AssignmentPattern": - declareByNodeType(node.left); - break; - - case "RestElement": - declareByNodeType(node.argument); - break; - - // no default + return idRange[0] < scopeRange[0] || idRange[1] > scopeRange[1]; } - declare(declarations); + // Gets declared variables, and checks its references. + var variables = context.getDeclaredVariables(node); - } - - /** - * Adds declarations of the function parameters and pushes the scope - * @param {ASTNode} node The node containing declarations. - * @returns {void} - * @private - */ - function functionHandler(node) { - pushScope(); - - node.params.forEach(function(param) { - declareByNodeType(param); - }); - - declare(node.rest ? [node.rest.name] : []); - declare(["arguments"]); - } - - /** - * Adds declaration of the function name in its parent scope then process the function - * @param {ASTNode} node The node containing declarations. - * @returns {void} - * @private - */ - function functionDeclarationHandler(node) { - declare(node.id ? [node.id.name] : []); - functionHandler(node); - } - - /** - * Process function declarations and declares its name in its own scope - * @param {ASTNode} node The node containing declarations. - * @returns {void} - * @private - */ - function functionExpressionHandler(node) { - functionHandler(node); - declare(node.id ? [node.id.name] : []); - } - - function variableDeclarationHandler(node) { - node.declarations.forEach(function(declaration) { - declareByNodeType(declaration.id); - }); + for (var i = 0; i < variables.length; ++i) { + // Reports. + variables[i] + .references + .filter(isOutsideOfScope) + .forEach(report); + } } return { - "Program": function() { - var scope = context.getScope(); - scopeStack = [scope.variables.map(function(v) { - return v.name; - })]; - - // global return creates another scope - if (context.ecmaFeatures.globalReturn) { - scope = scope.childScopes[0]; - scopeStack.push(scope.variables.map(function(v) { - return v.name; - })); - } - }, - - "ImportSpecifier": declareImports, - "ImportDefaultSpecifier": declareImports, - "ImportNamespaceSpecifier": declareImports, - - "BlockStatement": function(node) { - var statements = node.body; - pushScope(); - statements.forEach(function(stmt) { - if (stmt.type === "VariableDeclaration") { - variableDeclarationHandler(stmt); - } else if (stmt.type === "FunctionDeclaration") { - declare([stmt.id.name]); - } - }); - }, - - "VariableDeclaration": function (node) { - variableDeclarationHandler(node); - }, - - "BlockStatement:exit": popScope, - - "CatchClause": function(node) { - pushScope(); - declare([node.param.name]); + "Program": function(node) { + stack = [node.range]; }, - "CatchClause:exit": popScope, - - "FunctionDeclaration": functionDeclarationHandler, - "FunctionDeclaration:exit": popScope, - - "ClassDeclaration": declareClass, - "ClassDeclaration:exit": popScope, - - "ClassExpression": declareClass, - "ClassExpression:exit": popScope, - - "MethodDefinition": declareClassMethod, - "MethodDefinition:exit": popScope, - - "FunctionExpression": functionExpressionHandler, - "FunctionExpression:exit": popScope, - // Arrow functions cannot have names - "ArrowFunctionExpression": functionHandler, - "ArrowFunctionExpression:exit": popScope, - - "ForStatement": function() { - pushScope(); - }, - "ForStatement:exit": popScope, - - "ForInStatement": function() { - pushScope(); - }, - "ForInStatement:exit": popScope, - - "ForOfStatement": function() { - pushScope(); - }, - "ForOfStatement:exit": popScope, - - "Identifier": function(node) { - var ancestor = context.getAncestors().pop(); - if (isDeclaration(node, ancestor) || isProperty(node, ancestor) || ancestor.type === "LabeledStatement") { - return; - } - - for (var i = 0, l = scopeStack.length; i < l; i++) { - if (scopeStack[i].indexOf(node.name) > -1) { - return; - } - } - - context.report(node, "\"" + node.name + "\" used outside of binding context."); - } + // Manages scopes. + "BlockStatement": enterScope, + "BlockStatement:exit": exitScope, + "ForStatement": enterScope, + "ForStatement:exit": exitScope, + "ForInStatement": enterScope, + "ForInStatement:exit": exitScope, + "ForOfStatement": enterScope, + "ForOfStatement:exit": exitScope, + "SwitchStatement": enterScope, + "SwitchStatement:exit": exitScope, + "CatchClause": enterScope, + "CatchClause:exit": exitScope, + + // Finds and reports references which are outside of valid scope. + "VariableDeclaration": checkForVariables }; }; diff --git a/tools/eslint/lib/rules/block-spacing.js b/tools/eslint/lib/rules/block-spacing.js new file mode 100644 index 00000000000000..5e9d990253409f --- /dev/null +++ b/tools/eslint/lib/rules/block-spacing.js @@ -0,0 +1,120 @@ +/** + * @fileoverview A rule to disallow or enforce spaces inside of single line blocks. + * @author Toru Nagashima + * @copyright 2015 Toru Nagashima. All rights reserved. + */ + +"use strict"; + +var util = require("../ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var always = (context.options[0] !== "never"), + message = always ? "Requires a space" : "Unexpected space(s)", + sourceCode = context.getSourceCode(); + + /** + * Gets the open brace token from a given node. + * @param {ASTNode} node - A BlockStatement/SwitchStatement node to get. + * @returns {Token} The token of the open brace. + */ + function getOpenBrace(node) { + if (node.type === "SwitchStatement") { + if (node.cases.length > 0) { + return context.getTokenBefore(node.cases[0]); + } + return context.getLastToken(node, 1); + } + return context.getFirstToken(node); + } + + /** + * Checks whether or not: + * - given tokens are on same line. + * - there is/isn't a space between given tokens. + * @param {Token} left - A token to check. + * @param {Token} right - The token which is next to `left`. + * @returns {boolean} + * When the option is `"always"`, `true` if there are one or more spaces between given tokens. + * When the option is `"never"`, `true` if there are not any spaces between given tokens. + * If given tokens are not on same line, it's always `true`. + */ + function isValid(left, right) { + return ( + !util.isTokenOnSameLine(left, right) || + sourceCode.isSpaceBetweenTokens(left, right) === always + ); + } + + /** + * Reports invalid spacing style inside braces. + * @param {ASTNode} node - A BlockStatement/SwitchStatement node to get. + * @returns {void} + */ + function checkSpacingInsideBraces(node) { + + // Gets braces and the first/last token of content. + var openBrace = getOpenBrace(node); + var closeBrace = context.getLastToken(node); + var firstToken = sourceCode.getTokenOrCommentAfter(openBrace); + var lastToken = sourceCode.getTokenOrCommentBefore(closeBrace); + + // Skip if the node is invalid or empty. + if (openBrace.type !== "Punctuator" || + openBrace.value !== "{" || + closeBrace.type !== "Punctuator" || + closeBrace.value !== "}" || + firstToken === closeBrace + ) { + return; + } + + // Skip line comments for option never + if (!always && firstToken.type === "Line") { + return; + } + + // Check. + if (!isValid(openBrace, firstToken)) { + context.report({ + node: node, + loc: openBrace.loc.start, + message: message + " after '{'.", + fix: function(fixer) { + if (always) { + return fixer.insertTextBefore(firstToken, " "); + } + + return fixer.removeRange([openBrace.range[1], firstToken.range[0]]); + } + }); + } + if (!isValid(lastToken, closeBrace)) { + context.report({ + node: node, + loc: closeBrace.loc.start, + message: message + " before '}'.", + fix: function(fixer) { + if (always) { + return fixer.insertTextAfter(lastToken, " "); + } + + return fixer.removeRange([lastToken.range[1], closeBrace.range[0]]); + } + }); + } + } + + return { + BlockStatement: checkSpacingInsideBraces, + SwitchStatement: checkSpacingInsideBraces + }; +}; + +module.exports.schema = [ + {enum: ["always", "never"]} +]; diff --git a/tools/eslint/lib/rules/brace-style.js b/tools/eslint/lib/rules/brace-style.js index 2e56377f05001b..4887d66b8d8592 100644 --- a/tools/eslint/lib/rules/brace-style.js +++ b/tools/eslint/lib/rules/brace-style.js @@ -10,14 +10,16 @@ //------------------------------------------------------------------------------ module.exports = function(context) { - var style = context.options[0] || "1tbs"; - var params = context.options[1] || {}; + var style = context.options[0] || "1tbs", + params = context.options[1] || {}, + sourceCode = context.getSourceCode(); var OPEN_MESSAGE = "Opening curly brace does not appear on the same line as controlling statement.", + OPEN_MESSAGE_ALLMAN = "Opening curly brace appears on the same line as controlling statement.", BODY_MESSAGE = "Statement inside of curly braces should be on next line.", CLOSE_MESSAGE = "Closing curly brace does not appear on the same line as the subsequent block.", CLOSE_MESSAGE_SINGLE = "Closing curly brace should be on the same line as opening curly brace or on the line after the previous block.", - CLOSE_MESSAGE_STROUSTRUP = "Closing curly brace appears on the same line as the subsequent block."; + CLOSE_MESSAGE_STROUSTRUP_ALLMAN = "Closing curly brace appears on the same line as the subsequent block."; //-------------------------------------------------------------------------- // Helpers @@ -55,30 +57,42 @@ module.exports = function(context) { var blockProperties = arguments; return function(node) { - [].forEach.call(blockProperties, function(blockProp) { - var block = node[blockProp], previousToken, curlyToken, curlyTokenEnd, curlyTokensOnSameLine; - block = node[blockProp]; - - if (isBlock(block)) { - - previousToken = context.getTokenBefore(block); - curlyToken = context.getFirstToken(block); - curlyTokenEnd = context.getLastToken(block); - curlyTokensOnSameLine = curlyToken.loc.start.line === curlyTokenEnd.loc.start.line; - - if (previousToken.loc.start.line !== curlyToken.loc.start.line) { - context.report(node, OPEN_MESSAGE); - } else if (block.body.length && params.allowSingleLine) { - - if (curlyToken.loc.start.line === block.body[0].loc.start.line && !curlyTokensOnSameLine) { - context.report(block.body[0], BODY_MESSAGE); - } else if (curlyTokenEnd.loc.start.line === block.body[block.body.length - 1].loc.start.line && !curlyTokensOnSameLine) { - context.report(block.body[block.body.length - 1], CLOSE_MESSAGE_SINGLE); - } - - } else if (block.body.length && curlyToken.loc.start.line === block.body[0].loc.start.line) { - context.report(block.body[0], BODY_MESSAGE); - } + Array.prototype.forEach.call(blockProperties, function(blockProp) { + var block = node[blockProp], + previousToken, + curlyToken, + curlyTokenEnd, + allOnSameLine; + + if (!isBlock(block)) { + return; + } + + previousToken = sourceCode.getTokenBefore(block); + curlyToken = sourceCode.getFirstToken(block); + curlyTokenEnd = sourceCode.getLastToken(block); + allOnSameLine = previousToken.loc.start.line === curlyTokenEnd.loc.start.line; + + if (allOnSameLine && params.allowSingleLine) { + return; + } + + if (style !== "allman" && previousToken.loc.start.line !== curlyToken.loc.start.line) { + context.report(node, OPEN_MESSAGE); + } else if (style === "allman" && previousToken.loc.start.line === curlyToken.loc.start.line) { + context.report(node, OPEN_MESSAGE_ALLMAN); + } + + if (!block.body.length) { + return; + } + + if (curlyToken.loc.start.line === block.body[0].loc.start.line) { + context.report(block.body[0], BODY_MESSAGE); + } + + if (curlyTokenEnd.loc.start.line === block.body[block.body.length - 1].loc.start.line) { + context.report(block.body[block.body.length - 1], CLOSE_MESSAGE_SINGLE); } }); }; @@ -91,29 +105,22 @@ module.exports = function(context) { * @private */ function checkIfStatement(node) { - var tokens, - alternateIsBlock = false, - alternateIsIfBlock = false; + var tokens; checkBlock("consequent", "alternate")(node); if (node.alternate) { - alternateIsBlock = isBlock(node.alternate); - alternateIsIfBlock = node.alternate.type === "IfStatement" && isBlock(node.alternate.consequent); - - if (alternateIsBlock || alternateIsIfBlock) { - tokens = context.getTokensBefore(node.alternate, 2); + tokens = sourceCode.getTokensBefore(node.alternate, 2); - if (style === "1tbs") { - if (tokens[0].loc.start.line !== tokens[1].loc.start.line && isCurlyPunctuator(tokens[0]) ) { - context.report(node.alternate, CLOSE_MESSAGE); - } - } else if (style === "stroustrup") { - if (tokens[0].loc.start.line === tokens[1].loc.start.line) { - context.report(node.alternate, CLOSE_MESSAGE_STROUSTRUP); - } + if (style === "1tbs") { + if (tokens[0].loc.start.line !== tokens[1].loc.start.line && + node.consequent.type === "BlockStatement" && + isCurlyPunctuator(tokens[0])) { + context.report(node.alternate, CLOSE_MESSAGE); } + } else if (tokens[0].loc.start.line === tokens[1].loc.start.line) { + context.report(node.alternate, CLOSE_MESSAGE_STROUSTRUP_ALLMAN); } } @@ -131,15 +138,13 @@ module.exports = function(context) { checkBlock("block", "finalizer")(node); if (isBlock(node.finalizer)) { - tokens = context.getTokensBefore(node.finalizer, 2); + tokens = sourceCode.getTokensBefore(node.finalizer, 2); if (style === "1tbs") { if (tokens[0].loc.start.line !== tokens[1].loc.start.line) { context.report(node.finalizer, CLOSE_MESSAGE); } - } else if (style === "stroustrup") { - if (tokens[0].loc.start.line === tokens[1].loc.start.line) { - context.report(node.finalizer, CLOSE_MESSAGE_STROUSTRUP); - } + } else if (tokens[0].loc.start.line === tokens[1].loc.start.line) { + context.report(node.finalizer, CLOSE_MESSAGE_STROUSTRUP_ALLMAN); } } } @@ -151,8 +156,8 @@ module.exports = function(context) { * @private */ function checkCatchClause(node) { - var previousToken = context.getTokenBefore(node), - firstToken = context.getFirstToken(node); + var previousToken = sourceCode.getTokenBefore(node), + firstToken = sourceCode.getFirstToken(node); checkBlock("body")(node); @@ -161,9 +166,9 @@ module.exports = function(context) { if (previousToken.loc.start.line !== firstToken.loc.start.line) { context.report(node, CLOSE_MESSAGE); } - } else if (style === "stroustrup") { + } else { if (previousToken.loc.start.line === firstToken.loc.start.line) { - context.report(node, CLOSE_MESSAGE_STROUSTRUP); + context.report(node, CLOSE_MESSAGE_STROUSTRUP_ALLMAN); } } } @@ -177,16 +182,17 @@ module.exports = function(context) { */ function checkSwitchStatement(node) { var tokens; + if (node.cases && node.cases.length) { - tokens = context.getTokensBefore(node.cases[0], 2); - if (tokens[0].loc.start.line !== tokens[1].loc.start.line) { - context.report(node, OPEN_MESSAGE); - } + tokens = sourceCode.getTokensBefore(node.cases[0], 2); } else { - tokens = context.getLastTokens(node, 3); - if (tokens[0].loc.start.line !== tokens[1].loc.start.line) { - context.report(node, OPEN_MESSAGE); - } + tokens = sourceCode.getLastTokens(node, 3); + } + + if (style !== "allman" && tokens[0].loc.start.line !== tokens[1].loc.start.line) { + context.report(node, OPEN_MESSAGE); + } else if (style === "allman" && tokens[0].loc.start.line === tokens[1].loc.start.line) { + context.report(node, OPEN_MESSAGE_ALLMAN); } } @@ -214,7 +220,7 @@ module.exports = function(context) { module.exports.schema = [ { - "enum": ["1tbs", "stroustrup"] + "enum": ["1tbs", "stroustrup", "allman"] }, { "type": "object", diff --git a/tools/eslint/lib/rules/callback-return.js b/tools/eslint/lib/rules/callback-return.js new file mode 100644 index 00000000000000..7680386cf4d46f --- /dev/null +++ b/tools/eslint/lib/rules/callback-return.js @@ -0,0 +1,144 @@ +/** + * @fileoverview Enforce return after a callback. + * @author Jamund Ferguson + * @copyright 2015 Jamund Ferguson. All rights reserved. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + + var callbacks = context.options[0] || ["callback", "cb", "next"]; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Find the closest parent matching a list of types. + * @param {ASTNode} node The node whose parents we are searching + * @param {Array} types The node types to match + * @returns {ASTNode} The matched node or undefined. + */ + function findClosestParentOfType(node, types) { + if (!node.parent) { + return null; + } + if (types.indexOf(node.parent.type) === -1) { + return findClosestParentOfType(node.parent, types); + } + return node.parent; + } + + /** + * Check to see if a CallExpression is in our callback list. + * @param {ASTNode} node The node to check against our callback names list. + * @returns {Boolean} Whether or not this function matches our callback name. + */ + function isCallback(node) { + return node.callee.type === "Identifier" && callbacks.indexOf(node.callee.name) > -1; + } + + /** + * Determines whether or not the callback is part of a callback expression. + * @param {ASTNode} node The callback node + * @param {ASTNode} parentNode The expression node + * @returns {boolean} Whether or not this is part of a callback expression + */ + function isCallbackExpression(node, parentNode) { + + // ensure the parent node exists and is an expression + if (!parentNode || parentNode.type !== "ExpressionStatement") { + return false; + } + + // cb() + if (parentNode.expression === node) { + return true; + } + + // special case for cb && cb() and similar + if (parentNode.expression.type === "BinaryExpression" || parentNode.expression.type === "LogicalExpression") { + if (parentNode.expression.right === node) { + return true; + } + } + + return false; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + "CallExpression": function(node) { + + // if we"re not a callback we can return + if (!isCallback(node)) { + return; + } + + // find the closest block, return or loop + var closestBlock = findClosestParentOfType(node, ["BlockStatement", "ReturnStatement", "ArrowFunctionExpression"]) || {}, + lastItem, parentType; + + // if our parent is a return we know we're ok + if (closestBlock.type === "ReturnStatement") { + return; + } + + // arrow functions don't always have blocks and implicitly return + if (closestBlock.type === "ArrowFunctionExpression") { + return; + } + + // block statements are part of functions and most if statements + if (closestBlock.type === "BlockStatement") { + + // find the last item in the block + lastItem = closestBlock.body[closestBlock.body.length - 1]; + + // if the callback is the last thing in a block that might be ok + if (isCallbackExpression(node, lastItem)) { + + parentType = closestBlock.parent.type; + + // but only if the block is part of a function + if (parentType === "FunctionExpression" || + parentType === "FunctionDeclaration" || + parentType === "ArrowFunctionExpression" + ) { + return; + } + + } + + // ending a block with a return is also ok + if (lastItem.type === "ReturnStatement") { + + // but only if the callback is immediately before + if (isCallbackExpression(node, closestBlock.body[closestBlock.body.length - 2])) { + return; + } + } + + } + + // as long as you're the child of a function at this point you should be asked to return + if (findClosestParentOfType(node, ["FunctionDeclaration", "FunctionExpression", "ArrowFunctionExpression"])) { + context.report(node, "Expected return with your callback function."); + } + + } + + }; +}; + +module.exports.schema = [{ + type: "array", + items: { type: "string" } +}]; diff --git a/tools/eslint/lib/rules/camelcase.js b/tools/eslint/lib/rules/camelcase.js index 3091b815ca7306..d8f87fcf3fe964 100644 --- a/tools/eslint/lib/rules/camelcase.js +++ b/tools/eslint/lib/rules/camelcase.js @@ -16,6 +16,9 @@ module.exports = function(context) { // Helpers //-------------------------------------------------------------------------- + // contains reported nodes to avoid reporting twice on destructuring with shorthand notation + var reported = []; + /** * Checks if a string contains an underscore and isn't all upper-case * @param {String} name The string to check. @@ -35,7 +38,10 @@ module.exports = function(context) { * @private */ function report(node) { - context.report(node, "Identifier '{{name}}' is not in camel case.", { name: node.name }); + if (reported.indexOf(node) < 0) { + reported.push(node); + context.report(node, "Identifier '{{name}}' is not in camel case.", { name: node.name }); + } } var options = context.options[0] || {}, @@ -49,7 +55,10 @@ module.exports = function(context) { "Identifier": function(node) { - // Leading and trailing underscores are commonly used to flag private/protected identifiers, strip them + /* + * Leading and trailing underscores are commonly used to flag + * private/protected identifiers, strip them + */ var name = node.name.replace(/^_+|_+$/g, ""), effectiveParent = (node.parent.type === "MemberExpression") ? node.parent.parent : node.parent; @@ -84,6 +93,11 @@ module.exports = function(context) { return; } + if (node.parent.parent && node.parent.parent.type === "ObjectPattern" && + node.parent.key === node && node.parent.value !== node) { + return; + } + if (isUnderscored(name) && effectiveParent.type !== "CallExpression") { report(node); } diff --git a/tools/eslint/lib/rules/comma-dangle.js b/tools/eslint/lib/rules/comma-dangle.js index 1c8f79ea9e0a16..4aab8939304585 100644 --- a/tools/eslint/lib/rules/comma-dangle.js +++ b/tools/eslint/lib/rules/comma-dangle.js @@ -1,65 +1,226 @@ /** * @fileoverview Rule to forbid or enforce dangling commas. * @author Ian Christian Myers + * @copyright 2015 Toru Nagashima * @copyright 2015 Mathias Schreck * @copyright 2013 Ian Christian Myers + * See LICENSE file in root directory for full license. */ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var lodash = require("lodash"); + +/** + * Checks whether or not a trailing comma is allowed in a given node. + * `ArrayPattern` which has `RestElement` disallows it. + * + * @param {ASTNode} node - A node to check. + * @param {ASTNode} lastItem - The node of the last element in the given node. + * @returns {boolean} `true` if a trailing comma is allowed. + */ +function isTrailingCommaAllowed(node, lastItem) { + switch (node.type) { + case "ArrayPattern": + + // TODO(t-nagashima): Remove SpreadElement after https://github.com/eslint/espree/issues/194 was fixed. + return ( + lastItem.type !== "RestElement" && + lastItem.type !== "SpreadElement" + ); + + // TODO(t-nagashima): Remove this case after https://github.com/eslint/espree/issues/195 was fixed. + case "ArrayExpression": + return ( + node.parent.type !== "ForOfStatement" || + node.parent.left !== node || + lastItem.type !== "SpreadElement" + ); + + default: + return true; + } +} + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ -module.exports = function (context) { - var allowDangle = context.options[0]; - var forbidDangle = allowDangle !== "always-multiline" && allowDangle !== "always"; +module.exports = function(context) { + var mode = context.options[0]; var UNEXPECTED_MESSAGE = "Unexpected trailing comma."; var MISSING_MESSAGE = "Missing trailing comma."; /** - * Checks the given node for trailing comma and reports violations. - * @param {ASTNode} node The node of an ObjectExpression or ArrayExpression + * Checks whether or not a given node is multiline. + * This rule handles a given node as multiline when the closing parenthesis + * and the last element are not on the same line. + * + * @param {ASTNode} node - A node to check. + * @returns {boolean} `true` if the node is multiline. + */ + function isMultiline(node) { + var lastItem = lodash.last(node.properties || node.elements || node.specifiers); + + if (!lastItem) { + return false; + } + + var sourceCode = context.getSourceCode(), + penultimateToken = sourceCode.getLastToken(lastItem), + lastToken = sourceCode.getTokenAfter(penultimateToken); + + // parentheses are a pain + while (lastToken.value === ")") { + penultimateToken = lastToken; + lastToken = sourceCode.getTokenAfter(lastToken); + } + + if (lastToken.value === ",") { + penultimateToken = lastToken; + lastToken = sourceCode.getTokenAfter(lastToken); + } + + return lastToken.loc.end.line !== penultimateToken.loc.end.line; + } + + /** + * Reports a trailing comma if it exists. + * + * @param {ASTNode} node - A node to check. Its type is one of + * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, + * ImportDeclaration, and ExportNamedDeclaration. * @returns {void} */ - function checkForTrailingComma(node) { - var items = node.properties || node.elements, - length = items.length, - lastTokenOnNewLine, - lastItem, - penultimateToken, - hasDanglingComma; - - if (length) { - lastItem = items[length - 1]; - if (lastItem) { - penultimateToken = context.getLastToken(node, 1); - hasDanglingComma = penultimateToken.value === ","; - - if (forbidDangle && hasDanglingComma) { - context.report(lastItem, penultimateToken.loc.start, UNEXPECTED_MESSAGE); - } else if (allowDangle === "always-multiline") { - lastTokenOnNewLine = node.loc.end.line !== penultimateToken.loc.end.line; - if (hasDanglingComma && !lastTokenOnNewLine) { - context.report(lastItem, penultimateToken.loc.start, UNEXPECTED_MESSAGE); - } else if (!hasDanglingComma && lastTokenOnNewLine) { - context.report(lastItem, penultimateToken.loc.end, MISSING_MESSAGE); - } - } else if (allowDangle === "always" && !hasDanglingComma) { - context.report(lastItem, lastItem.loc.end, MISSING_MESSAGE); - } - } + function forbidTrailingComma(node) { + var lastItem = lodash.last(node.properties || node.elements || node.specifiers); + + if (!lastItem || (node.type === "ImportDeclaration" && lastItem.type !== "ImportSpecifier")) { + return; + } + + var sourceCode = context.getSourceCode(), + trailingToken; + + // last item can be surrounded by parentheses for object and array literals + if (node.type === "ObjectExpression" || node.type === "ArrayExpression") { + trailingToken = sourceCode.getTokenBefore(sourceCode.getLastToken(node)); + } else { + trailingToken = sourceCode.getTokenAfter(lastItem); + } + + if (trailingToken.value === ",") { + context.report( + lastItem, + trailingToken.loc.start, + UNEXPECTED_MESSAGE); } } + /** + * Reports the last element of a given node if it does not have a trailing + * comma. + * + * If a given node is `ArrayPattern` which has `RestElement`, the trailing + * comma is disallowed, so report if it exists. + * + * @param {ASTNode} node - A node to check. Its type is one of + * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, + * ImportDeclaration, and ExportNamedDeclaration. + * @returns {void} + */ + function forceTrailingComma(node) { + var lastItem = lodash.last(node.properties || node.elements || node.specifiers); + + if (!lastItem || (node.type === "ImportDeclaration" && lastItem.type !== "ImportSpecifier")) { + return; + } + if (!isTrailingCommaAllowed(node, lastItem)) { + forbidTrailingComma(node); + return; + } + + var sourceCode = context.getSourceCode(), + trailingToken; + + // last item can be surrounded by parentheses for object and array literals + if (node.type === "ObjectExpression" || node.type === "ArrayExpression") { + trailingToken = sourceCode.getTokenBefore(sourceCode.getLastToken(node)); + } else { + trailingToken = sourceCode.getTokenAfter(lastItem); + } + + if (trailingToken.value !== ",") { + context.report( + lastItem, + lastItem.loc.end, + MISSING_MESSAGE); + } + } + + /** + * If a given node is multiline, reports the last element of a given node + * when it does not have a trailing comma. + * Otherwise, reports a trailing comma if it exists. + * + * @param {ASTNode} node - A node to check. Its type is one of + * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, + * ImportDeclaration, and ExportNamedDeclaration. + * @returns {void} + */ + function forceTrailingCommaIfMultiline(node) { + if (isMultiline(node)) { + forceTrailingComma(node); + } else { + forbidTrailingComma(node); + } + } + + /** + * Only if a given node is not multiline, reports the last element of a given node + * when it does not have a trailing comma. + * Otherwise, reports a trailing comma if it exists. + * + * @param {ASTNode} node - A node to check. Its type is one of + * ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern, + * ImportDeclaration, and ExportNamedDeclaration. + * @returns {void} + */ + function allowTrailingCommaIfMultiline(node) { + if (!isMultiline(node)) { + forbidTrailingComma(node); + } + } + + // Chooses a checking function. + var checkForTrailingComma; + + if (mode === "always") { + checkForTrailingComma = forceTrailingComma; + } else if (mode === "always-multiline") { + checkForTrailingComma = forceTrailingCommaIfMultiline; + } else if (mode === "only-multiline") { + checkForTrailingComma = allowTrailingCommaIfMultiline; + } else { + checkForTrailingComma = forbidTrailingComma; + } + return { "ObjectExpression": checkForTrailingComma, - "ArrayExpression": checkForTrailingComma + "ObjectPattern": checkForTrailingComma, + "ArrayExpression": checkForTrailingComma, + "ArrayPattern": checkForTrailingComma, + "ImportDeclaration": checkForTrailingComma, + "ExportNamedDeclaration": checkForTrailingComma }; }; module.exports.schema = [ { - "enum": ["always", "always-multiline", "never"] + "enum": ["always", "always-multiline", "only-multiline", "never"] } ]; diff --git a/tools/eslint/lib/rules/comma-spacing.js b/tools/eslint/lib/rules/comma-spacing.js index 5204801504a2e5..7d2b2d794933ab 100644 --- a/tools/eslint/lib/rules/comma-spacing.js +++ b/tools/eslint/lib/rules/comma-spacing.js @@ -5,12 +5,17 @@ */ "use strict"; +var astUtils = require("../ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = function(context) { + var sourceCode = context.getSourceCode(); + var tokensAndComments = sourceCode.tokensAndComments; + var options = { before: context.options[0] ? !!context.options[0].before : false, after: context.options[0] ? !!context.options[0].after : true @@ -20,47 +25,8 @@ module.exports = function(context) { // Helpers //-------------------------------------------------------------------------- - // the index of the last comment that was checked - var lastCommentIndex = 0; - var allComments; - - /** - * Determines the length of comment between 2 tokens - * @param {Object} left - The left token object. - * @param {Object} right - The right token object. - * @returns {number} Length of comment in between tokens - */ - function getCommentLengthBetweenTokens(left, right) { - return allComments.reduce(function(val, comment) { - if (left.range[1] <= comment.range[0] && comment.range[1] <= right.range[0]) { - val = val + comment.range[1] - comment.range[0]; - } - return val; - }, 0); - } - - /** - * Determines whether two adjacent tokens have whitespace between them. - * @param {Object} left - The left token object. - * @param {Object} right - The right token object. - * @returns {boolean} Whether or not there is space between the tokens. - */ - function isSpaced(left, right) { - var punctuationLength = context.getTokensBetween(left, right).length; // the length of any parenthesis - var commentLenth = getCommentLengthBetweenTokens(left, right); - return (left.range[1] + punctuationLength + commentLenth) < right.range[0]; - } - - /** - * Checks whether two tokens are on the same line. - * @param {ASTNode} left The leftmost token. - * @param {ASTNode} right The rightmost token. - * @returns {boolean} True if the tokens are on the same line, false if not. - * @private - */ - function isSameLine(left, right) { - return left.loc.end.line === right.loc.start.line; - } + // list of comma tokens to ignore for the check of leading whitespace + var commaTokensToIgnore = []; /** * Determines if a given token is a comma operator. @@ -76,13 +42,39 @@ module.exports = function(context) { * Reports a spacing error with an appropriate message. * @param {ASTNode} node The binary expression node to report. * @param {string} dir Is the error "before" or "after" the comma? + * @param {ASTNode} otherNode The node at the left or right of `node` * @returns {void} * @private */ - function report(node, dir) { - context.report(node, options[dir] ? - "A space is required " + dir + " ','." : - "There should be no space " + dir + " ','."); + function report(node, dir, otherNode) { + context.report({ + node: node, + fix: function(fixer) { + if (options[dir]) { + if (dir === "before") { + return fixer.insertTextBefore(node, " "); + } else { + return fixer.insertTextAfter(node, " "); + } + } else { + var start, end; + var newText = ""; + + if (dir === "before") { + start = otherNode.range[1]; + end = node.range[0]; + } else { + start = node.range[1]; + end = otherNode.range[0]; + } + + return fixer.replaceTextRange([start, end], newText); + } + }, + message: options[dir] ? + "A space is required " + dir + " ','." : + "There should be no space " + dir + " ','." + }); } /** @@ -96,47 +88,46 @@ module.exports = function(context) { * @private */ function validateCommaItemSpacing(tokens, reportItem) { - if (tokens.left && isSameLine(tokens.left, tokens.comma) && - (options.before !== isSpaced(tokens.left, tokens.comma)) + if (tokens.left && astUtils.isTokenOnSameLine(tokens.left, tokens.comma) && + (options.before !== sourceCode.isSpaceBetweenTokens(tokens.left, tokens.comma)) ) { - report(reportItem, "before"); + report(reportItem, "before", tokens.left); + } + + if (tokens.right && !options.after && tokens.right.type === "Line") { + return; } - if (tokens.right && isSameLine(tokens.comma, tokens.right) && - (options.after !== isSpaced(tokens.comma, tokens.right)) + + if (tokens.right && astUtils.isTokenOnSameLine(tokens.comma, tokens.right) && + (options.after !== sourceCode.isSpaceBetweenTokens(tokens.comma, tokens.right)) ) { - report(reportItem, "after"); + report(reportItem, "after", tokens.right); } } /** - * Determines if a given source index is in a comment or not by checking - * the index against the comment range. Since the check goes straight - * through the file, once an index is passed a certain comment, we can - * go to the next comment to check that. - * @param {int} index The source index to check. - * @param {ASTNode[]} comments An array of comment nodes. - * @returns {boolean} True if the index is within a comment, false if not. - * @private + * Adds null elements of the given ArrayExpression or ArrayPattern node to the ignore list. + * @param {ASTNode} node An ArrayExpression or ArrayPattern node. + * @returns {void} */ - function isIndexInComment(index, comments) { - - var comment; + function addNullElementsToIgnoreList(node) { + var previousToken = context.getFirstToken(node); - while (lastCommentIndex < comments.length) { + node.elements.forEach(function(element) { + var token; - comment = comments[lastCommentIndex]; + if (element === null) { + token = context.getTokenAfter(previousToken); - if (comment.range[0] <= index && index < comment.range[1]) { - return true; - } else if (index > comment.range[1]) { - lastCommentIndex++; + if (isComma(token)) { + commaTokensToIgnore.push(token); + } } else { - break; + token = context.getTokenAfter(element); } - } - - return false; + previousToken = token; + }); } //-------------------------------------------------------------------------- @@ -144,33 +135,34 @@ module.exports = function(context) { //-------------------------------------------------------------------------- return { - "Program": function() { + "Program:exit": function() { - var source = context.getSource(), - pattern = /,/g, - commaToken, - previousToken, + var previousToken, nextToken; - allComments = context.getAllComments(); - while (pattern.test(source)) { - - // do not flag anything inside of comments - if (!isIndexInComment(pattern.lastIndex, allComments)) { - commaToken = context.getTokenByRangeStart(pattern.lastIndex - 1); - - if (commaToken && commaToken.type !== "JSXText") { - previousToken = context.getTokenBefore(commaToken); - nextToken = context.getTokenAfter(commaToken); - validateCommaItemSpacing({ - comma: commaToken, - left: isComma(previousToken) ? null : previousToken, - right: isComma(nextToken) ? null : nextToken - }, commaToken); - } + tokensAndComments.forEach(function(token, i) { + + if (!isComma(token)) { + return; } - } - } + + if (token && token.type === "JSXText") { + return; + } + + previousToken = tokensAndComments[i - 1]; + nextToken = tokensAndComments[i + 1]; + + validateCommaItemSpacing({ + comma: token, + left: isComma(previousToken) || commaTokensToIgnore.indexOf(token) > -1 ? null : previousToken, + right: isComma(nextToken) ? null : nextToken + }, token); + }); + }, + "ArrayExpression": addNullElementsToIgnoreList, + "ArrayPattern": addNullElementsToIgnoreList + }; }; diff --git a/tools/eslint/lib/rules/comma-style.js b/tools/eslint/lib/rules/comma-style.js index 52e0ac47b0fa81..af001372c55249 100644 --- a/tools/eslint/lib/rules/comma-style.js +++ b/tools/eslint/lib/rules/comma-style.js @@ -7,6 +7,8 @@ "use strict"; +var astUtils = require("../ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ @@ -24,17 +26,6 @@ module.exports = function(context) { // Helpers //-------------------------------------------------------------------------- - /** - * Checks whether two tokens are on the same line. - * @param {ASTNode} left The leftmost token. - * @param {ASTNode} right The rightmost token. - * @returns {boolean} True if the tokens are on the same line, false if not. - * @private - */ - function isSameLine(left, right) { - return left.loc.end.line === right.loc.start.line; - } - /** * Determines if a given token is a comma operator. * @param {ASTNode} token The token to check. @@ -57,13 +48,13 @@ module.exports = function(context) { function validateCommaItemSpacing(previousItemToken, commaToken, currentItemToken, reportItem) { // if single line - if (isSameLine(commaToken, currentItemToken) && - isSameLine(previousItemToken, commaToken)) { + if (astUtils.isTokenOnSameLine(commaToken, currentItemToken) && + astUtils.isTokenOnSameLine(previousItemToken, commaToken)) { return; - } else if (!isSameLine(commaToken, currentItemToken) && - !isSameLine(previousItemToken, commaToken)) { + } else if (!astUtils.isTokenOnSameLine(commaToken, currentItemToken) && + !astUtils.isTokenOnSameLine(previousItemToken, commaToken)) { // lone comma context.report(reportItem, { @@ -71,11 +62,11 @@ module.exports = function(context) { column: commaToken.loc.start.column }, "Bad line breaking before and after ','."); - } else if (style === "first" && !isSameLine(commaToken, currentItemToken)) { + } else if (style === "first" && !astUtils.isTokenOnSameLine(commaToken, currentItemToken)) { context.report(reportItem, "',' should be placed first."); - } else if (style === "last" && isSameLine(commaToken, currentItemToken)) { + } else if (style === "last" && astUtils.isTokenOnSameLine(commaToken, currentItemToken)) { context.report(reportItem, { line: commaToken.loc.end.line, diff --git a/tools/eslint/lib/rules/complexity.js b/tools/eslint/lib/rules/complexity.js index b4e52784cbd237..0cbdd0aad29303 100644 --- a/tools/eslint/lib/rules/complexity.js +++ b/tools/eslint/lib/rules/complexity.js @@ -11,8 +11,18 @@ //------------------------------------------------------------------------------ module.exports = function(context) { + var option = context.options[0], + THRESHOLD = 20; - var THRESHOLD = context.options[0]; + if (typeof option === "object" && option.hasOwnProperty("maximum") && typeof option.maximum === "number") { + THRESHOLD = option.maximum; + } + if (typeof option === "object" && option.hasOwnProperty("max") && typeof option.max === "number") { + THRESHOLD = option.max; + } + if (typeof option === "number") { + THRESHOLD = option; + } //-------------------------------------------------------------------------- // Helpers @@ -21,18 +31,28 @@ module.exports = function(context) { // Using a stack to store complexity (handling nested functions) var fns = []; - // When parsing a new function, store it in our function stack + /** + * When parsing a new function, store it in our function stack + * @returns {void} + * @private + */ function startFunction() { fns.push(1); } + /** + * Evaluate the node at the end of function + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ function endFunction(node) { var complexity = fns.pop(), name = "anonymous"; if (node.id) { name = node.id.name; - } else if (node.parent.type === "MethodDefinition") { + } else if (node.parent.type === "MethodDefinition" || node.parent.type === "Property") { name = node.parent.key.name; } @@ -41,20 +61,39 @@ module.exports = function(context) { } } + /** + * Increase the complexity of the function in context + * @returns {void} + * @private + */ function increaseComplexity() { if (fns.length) { - fns[fns.length - 1] ++; + fns[fns.length - 1]++; } } + /** + * Increase the switch complexity in context + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ function increaseSwitchComplexity(node) { + // Avoiding `default` if (node.test) { increaseComplexity(node); } } + /** + * Increase the logical path complexity in context + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ function increaseLogicalComplexity(node) { + // Avoiding && if (node.operator === "||") { increaseComplexity(node); @@ -89,6 +128,25 @@ module.exports = function(context) { module.exports.schema = [ { - "type": "integer" + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "object", + "properties": { + "maximum": { + "type": "integer", + "minimum": 0 + }, + "max": { + "type": "integer", + "minimum": 0 + } + }, + "additionalProperties": false + } + ] } ]; diff --git a/tools/eslint/lib/rules/computed-property-spacing.js b/tools/eslint/lib/rules/computed-property-spacing.js index 653a40eb0411a2..6462dfb90ee8f3 100644 --- a/tools/eslint/lib/rules/computed-property-spacing.js +++ b/tools/eslint/lib/rules/computed-property-spacing.js @@ -5,57 +5,54 @@ */ "use strict"; +var astUtils = require("../ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = function(context) { + var sourceCode = context.getSourceCode(); var propertyNameMustBeSpaced = context.options[0] === "always"; // default is "never" //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- - /** - * Determines whether two adjacent tokens are have whitespace between them. - * @param {Object} left - The left token object. - * @param {Object} right - The right token object. - * @returns {boolean} Whether or not there is space between the tokens. - */ - function isSpaced(left, right) { - return left.range[1] < right.range[0]; - } - - /** - * Determines whether two adjacent tokens are on the same line. - * @param {Object} left - The left token object. - * @param {Object} right - The right token object. - * @returns {boolean} Whether or not the tokens are on the same line. - */ - function isSameLine(left, right) { - return left.loc.start.line === right.loc.start.line; - } - /** * Reports that there shouldn't be a space after the first token * @param {ASTNode} node - The node to report in the event of an error. * @param {Token} token - The token to use for the report. + * @param {Token} tokenAfter - The token after `token`. * @returns {void} */ - function reportNoBeginningSpace(node, token) { - context.report(node, token.loc.start, - "There should be no space after '" + token.value + "'"); + function reportNoBeginningSpace(node, token, tokenAfter) { + context.report({ + node: node, + loc: token.loc.start, + message: "There should be no space after '" + token.value + "'", + fix: function(fixer) { + return fixer.removeRange([token.range[1], tokenAfter.range[0]]); + } + }); } /** * Reports that there shouldn't be a space before the last token * @param {ASTNode} node - The node to report in the event of an error. * @param {Token} token - The token to use for the report. + * @param {Token} tokenBefore - The token before `token`. * @returns {void} */ - function reportNoEndingSpace(node, token) { - context.report(node, token.loc.start, - "There should be no space before '" + token.value + "'"); + function reportNoEndingSpace(node, token, tokenBefore) { + context.report({ + node: node, + loc: token.loc.start, + message: "There should be no space before '" + token.value + "'", + fix: function(fixer) { + return fixer.removeRange([tokenBefore.range[1], token.range[0]]); + } + }); } /** @@ -65,8 +62,14 @@ module.exports = function(context) { * @returns {void} */ function reportRequiredBeginningSpace(node, token) { - context.report(node, token.loc.start, - "A space is required after '" + token.value + "'"); + context.report({ + node: node, + loc: token.loc.start, + message: "A space is required after '" + token.value + "'", + fix: function(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); } /** @@ -76,8 +79,14 @@ module.exports = function(context) { * @returns {void} */ function reportRequiredEndingSpace(node, token) { - context.report(node, token.loc.start, - "A space is required before '" + token.value + "'"); + context.report({ + node: node, + loc: token.loc.start, + message: "A space is required before '" + token.value + "'", + fix: function(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); } /** @@ -99,26 +108,26 @@ module.exports = function(context) { last = context.getLastToken(property), after = context.getTokenAfter(property); - if (isSameLine(before, first)) { + if (astUtils.isTokenOnSameLine(before, first)) { if (propertyNameMustBeSpaced) { - if (!isSpaced(before, first) && isSameLine(before, first)) { + if (!sourceCode.isSpaceBetweenTokens(before, first) && astUtils.isTokenOnSameLine(before, first)) { reportRequiredBeginningSpace(node, before); } } else { - if (isSpaced(before, first)) { - reportNoBeginningSpace(node, before); + if (sourceCode.isSpaceBetweenTokens(before, first)) { + reportNoBeginningSpace(node, before, first); } } } - if (isSameLine(last, after)) { + if (astUtils.isTokenOnSameLine(last, after)) { if (propertyNameMustBeSpaced) { - if (!isSpaced(last, after) && isSameLine(last, after)) { + if (!sourceCode.isSpaceBetweenTokens(last, after) && astUtils.isTokenOnSameLine(last, after)) { reportRequiredEndingSpace(node, after); } } else { - if (isSpaced(last, after)) { - reportNoEndingSpace(node, after); + if (sourceCode.isSpaceBetweenTokens(last, after)) { + reportNoEndingSpace(node, after, last); } } } diff --git a/tools/eslint/lib/rules/consistent-return.js b/tools/eslint/lib/rules/consistent-return.js index e5eb5f9b469232..af0b58230405d6 100644 --- a/tools/eslint/lib/rules/consistent-return.js +++ b/tools/eslint/lib/rules/consistent-return.js @@ -5,71 +5,122 @@ "use strict"; //------------------------------------------------------------------------------ -// Rule Definition +// Requirements //------------------------------------------------------------------------------ -module.exports = function(context) { +var astUtils = require("../ast-utils"); - var functions = []; +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- +/** + * Checks whether or not a given code path segment is unreachable. + * @param {CodePathSegment} segment - A CodePathSegment to check. + * @returns {boolean} `true` if the segment is unreachable. + */ +function isUnreachable(segment) { + return !segment.reachable; +} - /** - * Marks entrance into a function by pushing a new object onto the functions - * stack. - * @returns {void} - * @private - */ - function enterFunction() { - functions.push({}); - } +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var funcInfo = null; /** - * Marks exit of a function by popping off the functions stack. + * Checks whether of not the implicit returning is consistent if the last + * code path segment is reachable. + * + * @param {ASTNode} node - A program/function node to check. * @returns {void} - * @private */ - function exitFunction() { - functions.pop(); - } + function checkLastSegment(node) { + var loc, type; + + /* + * Skip if it expected no return value or unreachable. + * When unreachable, all paths are returned or thrown. + */ + if (!funcInfo.hasReturnValue || + funcInfo.codePath.currentSegments.every(isUnreachable) || + astUtils.isES5Constructor(node) + ) { + return; + } + // Adjust a location and a message. + if (node.type === "Program") { + + // The head of program. + loc = {line: 1, column: 0}; + type = "program"; + } else if (node.type === "ArrowFunctionExpression") { + + // `=>` token + loc = context.getSourceCode().getTokenBefore(node.body).loc.start; + type = "function"; + } else if ( + node.parent.type === "MethodDefinition" || + (node.parent.type === "Property" && node.parent.method) + ) { + + // Method name. + loc = node.parent.key.loc.start; + type = "method"; + } else { + + // Function name or `function` keyword. + loc = (node.id || node).loc.start; + type = "function"; + } - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- + // Reports. + context.report({ + node: node, + loc: loc, + message: "Expected to return a value at the end of this {{type}}.", + data: {type: type} + }); + } return { - "Program": enterFunction, - "FunctionDeclaration": enterFunction, - "FunctionExpression": enterFunction, - "ArrowFunctionExpression": enterFunction, - - "Program:exit": exitFunction, - "FunctionDeclaration:exit": exitFunction, - "FunctionExpression:exit": exitFunction, - "ArrowFunctionExpression:exit": exitFunction, - + // Initializes/Disposes state of each code path. + "onCodePathStart": function(codePath) { + funcInfo = { + upper: funcInfo, + codePath: codePath, + hasReturn: false, + hasReturnValue: false, + message: "" + }; + }, + "onCodePathEnd": function() { + funcInfo = funcInfo.upper; + }, + + // Reports a given return statement if it's inconsistent. "ReturnStatement": function(node) { - - var returnInfo = functions[functions.length - 1], - returnTypeDefined = "type" in returnInfo; - - if (returnTypeDefined) { - - if (returnInfo.type !== !!node.argument) { - context.report(node, "Expected " + (returnInfo.type ? "a" : "no") + " return value."); - } - - } else { - returnInfo.type = !!node.argument; + var hasReturnValue = Boolean(node.argument); + + if (!funcInfo.hasReturn) { + funcInfo.hasReturn = true; + funcInfo.hasReturnValue = hasReturnValue; + funcInfo.message = "Expected " + (hasReturnValue ? "a" : "no") + " return value."; + } else if (funcInfo.hasReturnValue !== hasReturnValue) { + context.report({node: node, message: funcInfo.message}); } + }, - } + // Reports a given program/function if the implicit returning is not consistent. + "Program:exit": checkLastSegment, + "FunctionDeclaration:exit": checkLastSegment, + "FunctionExpression:exit": checkLastSegment, + "ArrowFunctionExpression:exit": checkLastSegment }; - }; module.exports.schema = []; diff --git a/tools/eslint/lib/rules/consistent-this.js b/tools/eslint/lib/rules/consistent-this.js index bcf7fefb051c1a..09c6a91d1a944b 100644 --- a/tools/eslint/lib/rules/consistent-this.js +++ b/tools/eslint/lib/rules/consistent-this.js @@ -11,15 +11,22 @@ //------------------------------------------------------------------------------ module.exports = function(context) { - var alias = context.options[0]; + var aliases = []; + + if (context.options.length === 0) { + aliases.push("that"); + } else { + aliases = context.options; + } /** * Reports that a variable declarator or assignment expression is assigning * a non-'this' value to the specified alias. * @param {ASTNode} node - The assigning node. + * @param {string} alias - the name of the alias that was incorrectly used. * @returns {void} */ - function reportBadAssignment(node) { + function reportBadAssignment(node, alias) { context.report(node, "Designated alias '{{alias}}' is not assigned to 'this'.", { alias: alias }); @@ -36,9 +43,9 @@ module.exports = function(context) { function checkAssignment(node, name, value) { var isThis = value.type === "ThisExpression"; - if (name === alias) { + if (aliases.indexOf(name) !== -1) { if (!isThis || node.operator && node.operator !== "=") { - reportBadAssignment(node); + reportBadAssignment(node, name); } } else if (isThis) { context.report(node, @@ -49,42 +56,53 @@ module.exports = function(context) { /** * Ensures that a variable declaration of the alias in a program or function * is assigned to the correct value. + * @param {string} alias alias the check the assignment of. + * @param {object} scope scope of the current code we are checking. + * @private + * @returns {void} + */ + function checkWasAssigned(alias, scope) { + var variable = scope.set.get(alias); + + if (!variable) { + return; + } + + if (variable.defs.some(function(def) { + return def.node.type === "VariableDeclarator" && + def.node.init !== null; + })) { + return; + } + + // The alias has been declared and not assigned: check it was + // assigned later in the same scope. + if (!variable.references.some(function(reference) { + var write = reference.writeExpr; + + return ( + reference.from === scope && + write && write.type === "ThisExpression" && + write.parent.operator === "=" + ); + })) { + variable.defs.map(function(def) { + return def.node; + }).forEach(function(node) { + reportBadAssignment(node, alias); + }); + } + } + + /** + * Check each alias to ensure that is was assinged to the correct value. * @returns {void} */ function ensureWasAssigned() { var scope = context.getScope(); - scope.variables.some(function (variable) { - var lookup; - - if (variable.name === alias) { - if (variable.defs.some(function (def) { - return def.node.type === "VariableDeclarator" && - def.node.init !== null; - })) { - return true; - } - - lookup = scope.type === "global" ? scope : variable; - - // The alias has been declared and not assigned: check it was - // assigned later in the same scope. - if (!lookup.references.some(function (reference) { - var write = reference.writeExpr; - - if (reference.from === scope && - write && write.type === "ThisExpression" && - write.parent.operator === "=") { - return true; - } - })) { - variable.defs.map(function (def) { - return def.node; - }).forEach(reportBadAssignment); - } - - return true; - } + aliases.forEach(function(alias) { + checkWasAssigned(alias, scope); }); } @@ -93,7 +111,7 @@ module.exports = function(context) { "FunctionExpression:exit": ensureWasAssigned, "FunctionDeclaration:exit": ensureWasAssigned, - "VariableDeclarator": function (node) { + "VariableDeclarator": function(node) { var id = node.id; var isDestructuring = id.type === "ArrayPattern" || id.type === "ObjectPattern"; @@ -103,7 +121,7 @@ module.exports = function(context) { } }, - "AssignmentExpression": function (node) { + "AssignmentExpression": function(node) { if (node.left.type === "Identifier") { checkAssignment(node, node.left.name, node.right); } @@ -112,8 +130,11 @@ module.exports = function(context) { }; -module.exports.schema = [ - { - "type": "string" - } -]; +module.exports.schema = { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "uniqueItems": true +}; diff --git a/tools/eslint/lib/rules/constructor-super.js b/tools/eslint/lib/rules/constructor-super.js index a8c77a15a5e950..9e0b9eac8e82d2 100644 --- a/tools/eslint/lib/rules/constructor-super.js +++ b/tools/eslint/lib/rules/constructor-super.js @@ -6,101 +6,296 @@ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var astUtils = require("../ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given node is a constructor. + * @param {ASTNode} node - A node to check. This node type is one of + * `Program`, `FunctionDeclaration`, `FunctionExpression`, and + * `ArrowFunctionExpression`. + * @returns {boolean} `true` if the node is a constructor. + */ +function isConstructorFunction(node) { + return ( + node.type === "FunctionExpression" && + node.parent.type === "MethodDefinition" && + node.parent.kind === "constructor" + ); +} + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = function(context) { - /** - * Searches a class node from ancestors of a node. - * @param {Node} node - A node to get. - * @returns {ClassDeclaration|ClassExpression|null} the found class node or `null`. + /* + * {{hasExtends: boolean, scope: Scope, codePath: CodePath}[]} + * Information for each constructor. + * - upper: Information of the upper constructor. + * - hasExtends: A flag which shows whether own class has a valid `extends` + * part. + * - scope: The scope of own class. + * - codePath: The code path object of the constructor. */ - function getClassInAncestor(node) { - while (node != null) { - if (node.type === "ClassDeclaration" || node.type === "ClassExpression") { - return node; - } - node = node.parent; - } - /* istanbul ignore next */ - return null; - } + var funcInfo = null; + + /* + * {Map} + * Information for each code path segment. + * - calledInSomePaths: A flag of be called `super()` in some code paths. + * - calledInEveryPaths: A flag of be called `super()` in all code paths. + * - validNodes: + */ + var segInfoMap = Object.create(null); /** - * Checks whether or not a node is the null literal. - * @param {Node} node - A node to check. - * @returns {boolean} whether or not a node is the null literal. + * Gets the flag which shows `super()` is called in some paths. + * @param {CodePathSegment} segment - A code path segment to get. + * @returns {boolean} The flag which shows `super()` is called in some paths */ - function isNullLiteral(node) { - return node != null && node.type === "Literal" && node.value === null; + function isCalledInSomePath(segment) { + return segInfoMap[segment.id].calledInSomePaths; } /** - * Checks whether or not the current traversal context is on constructors. - * @param {{scope: Scope}} item - A checking context to check. - * @returns {boolean} whether or not the current traversal context is on constructors. + * Gets the flag which shows `super()` is called in all paths. + * @param {CodePathSegment} segment - A code path segment to get. + * @returns {boolean} The flag which shows `super()` is called in all paths. */ - function isOnConstructor(item) { - return item != null && item.scope === context.getScope().variableScope.upper.variableScope; - } + function isCalledInEveryPath(segment) { - // A stack for checking context. - var stack = []; + /* + * If specific segment is the looped segment of the current segment, + * skip the segment. + * If not skipped, this never becomes true after a loop. + */ + if (segment.nextSegments.length === 1 && + segment.nextSegments[0].isLoopedPrevSegment(segment) + ) { + return true; + } + return segInfoMap[segment.id].calledInEveryPaths; + } return { + + /** + * Stacks a constructor information. + * @param {CodePath} codePath - A code path which was started. + * @param {ASTNode} node - The current node. + * @returns {void} + */ + "onCodePathStart": function(codePath, node) { + if (isConstructorFunction(node)) { + + // Class > ClassBody > MethodDefinition > FunctionExpression + var classNode = node.parent.parent.parent; + + funcInfo = { + upper: funcInfo, + isConstructor: true, + hasExtends: Boolean( + classNode.superClass && + !astUtils.isNullOrUndefined(classNode.superClass) + ), + codePath: codePath + }; + } else { + funcInfo = { + upper: funcInfo, + isConstructor: false, + hasExtends: false, + codePath: codePath + }; + } + }, + /** - * Start checking. - * @param {MethodDefinition} node - A target node. + * Pops a constructor information. + * And reports if `super()` lacked. + * @param {CodePath} codePath - A code path which was ended. + * @param {ASTNode} node - The current node. * @returns {void} */ - "MethodDefinition": function(node) { - if (node.kind !== "constructor") { + "onCodePathEnd": function(codePath, node) { + + // Skip if own class which has a valid `extends` part. + var hasExtends = funcInfo.hasExtends; + + funcInfo = funcInfo.upper; + + if (!hasExtends) { return; } - stack.push({ - superCallings: [], - scope: context.getScope().variableScope - }); + + // Reports if `super()` lacked. + var segments = codePath.returnedSegments; + var calledInEveryPaths = segments.every(isCalledInEveryPath); + var calledInSomePaths = segments.some(isCalledInSomePath); + + if (!calledInEveryPaths) { + context.report({ + message: calledInSomePaths ? + "Lacked a call of 'super()' in some code paths." : + "Expected to call 'super()'.", + node: node.parent + }); + } }, /** - * Checks the result, then reports invalid/missing `super()`. - * @param {MethodDefinition} node - A target node. + * Initialize information of a given code path segment. + * @param {CodePathSegment} segment - A code path segment to initialize. * @returns {void} */ - "MethodDefinition:exit": function(node) { - if (node.kind !== "constructor") { + "onCodePathSegmentStart": function(segment) { + + /* + * Skip if this is not in a constructor of a class which has a + * valid `extends` part. + */ + if (!(funcInfo && funcInfo.isConstructor && funcInfo.hasExtends)) { return; } - var result = stack.pop(); - var classNode = getClassInAncestor(node); - /* istanbul ignore if */ - if (classNode == null) { + // Initialize info. + var info = segInfoMap[segment.id] = { + calledInSomePaths: false, + calledInEveryPaths: false, + validNodes: [] + }; + + // When there are previous segments, aggregates these. + var prevSegments = segment.prevSegments; + + if (prevSegments.length > 0) { + info.calledInSomePaths = prevSegments.some(isCalledInSomePath); + info.calledInEveryPaths = prevSegments.every(isCalledInEveryPath); + } + }, + + /** + * Update information of the code path segment when a code path was + * looped. + * @param {CodePathSegment} fromSegment - The code path segment of the + * end of a loop. + * @param {CodePathSegment} toSegment - A code path segment of the head + * of a loop. + * @returns {void} + */ + "onCodePathSegmentLoop": function(fromSegment, toSegment) { + + /* + * Skip if this is not in a constructor of a class which has a + * valid `extends` part. + */ + if (!(funcInfo && funcInfo.isConstructor && funcInfo.hasExtends)) { return; } - if (classNode.superClass === null || isNullLiteral(classNode.superClass)) { - result.superCallings.forEach(function(superCalling) { - context.report(superCalling, "unexpected `super()`."); + // Update information inside of the loop. + var isRealLoop = toSegment.prevSegments.length >= 2; + + funcInfo.codePath.traverseSegments( + {first: toSegment, last: fromSegment}, + function(segment) { + var info = segInfoMap[segment.id]; + + // Updates flags. + var prevSegments = segment.prevSegments; + + info.calledInSomePaths = prevSegments.some(isCalledInSomePath); + info.calledInEveryPaths = prevSegments.every(isCalledInEveryPath); + + // If flags become true anew, reports the valid nodes. + if (info.calledInSomePaths || isRealLoop) { + var nodes = info.validNodes; + + info.validNodes = []; + + for (var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + + context.report({ + message: "Unexpected duplicate 'super()'.", + node: node + }); + } + } + } + ); + }, + + /** + * Checks for a call of `super()`. + * @param {ASTNode} node - A CallExpression node to check. + * @returns {void} + */ + "CallExpression:exit": function(node) { + + // Skip if the node is not `super()`. + if (node.callee.type !== "Super") { + return; + } + + // Skip if this is not in a constructor. + if (!(funcInfo && funcInfo.isConstructor)) { + return; + } + + // Reports if needed. + if (funcInfo.hasExtends) { + + /* + * This class has a valid `extends` part. + * Checks duplicate `super()`; + */ + var segments = funcInfo.codePath.currentSegments; + var duplicate = false; + + for (var i = 0; i < segments.length; ++i) { + var info = segInfoMap[segments[i].id]; + + duplicate = duplicate || info.calledInSomePaths; + info.calledInSomePaths = info.calledInEveryPaths = true; + } + + if (duplicate) { + context.report({ + message: "Unexpected duplicate 'super()'.", + node: node + }); + } else { + info.validNodes.push(node); + } + } else { + + /* + * This class does not have a valid `extends` part. + * Disallow `super()`. + */ + context.report({ + message: "Unexpected 'super()'.", + node: node }); - } else if (result.superCallings.length === 0) { - context.report(node.key, "this constructor requires `super()`."); } }, /** - * Checks the result of checking, then reports invalid/missing `super()`. - * @param {MethodDefinition} node - A target node. + * Resets state. * @returns {void} */ - "CallExpression": function(node) { - var item = stack[stack.length - 1]; - if (isOnConstructor(item) && node.callee.type === "Super") { - item.superCallings.push(node); - } + "Program:exit": function() { + segInfoMap = Object.create(null); } }; }; diff --git a/tools/eslint/lib/rules/curly.js b/tools/eslint/lib/rules/curly.js index df7ad4c570310e..5253a3fb6bbdbf 100644 --- a/tools/eslint/lib/rules/curly.js +++ b/tools/eslint/lib/rules/curly.js @@ -1,9 +1,16 @@ /** * @fileoverview Rule to flag statements without curly braces * @author Nicholas C. Zakas + * @copyright 2015 Ivan Nikulin. All rights reserved. */ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var astUtils = require("../ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ @@ -12,6 +19,8 @@ module.exports = function(context) { var multiOnly = (context.options[0] === "multi"); var multiLine = (context.options[0] === "multi-line"); + var multiOrNest = (context.options[0] === "multi-or-nest"); + var consistent = (context.options[1] === "consistent"); //-------------------------------------------------------------------------- // Helpers @@ -26,49 +35,199 @@ module.exports = function(context) { function isCollapsedOneLiner(node) { var before = context.getTokenBefore(node), last = context.getLastToken(node); + return before.loc.start.line === last.loc.end.line; } /** - * Checks the body of a node to see if it's a block statement. Depending on - * the rule options, reports the appropriate problems. + * Determines if a given node is a one-liner. + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node is a one-liner. + * @private + */ + function isOneLiner(node) { + var first = context.getFirstToken(node), + last = context.getLastToken(node); + + return first.loc.start.line === last.loc.end.line; + } + + /** + * Gets the `else` keyword token of a given `IfStatement` node. + * @param {ASTNode} node - A `IfStatement` node to get. + * @returns {Token} The `else` keyword token. + */ + function getElseKeyword(node) { + var sourceCode = context.getSourceCode(); + var token = sourceCode.getTokenAfter(node.consequent); + + while (token.type !== "Keyword" || token.value !== "else") { + token = sourceCode.getTokenAfter(token); + } + + return token; + } + + /** + * Checks a given IfStatement node requires braces of the consequent chunk. + * This returns `true` when below: + * + * 1. The given node has the `alternate` node. + * 2. There is a `IfStatement` which doesn't have `alternate` node in the + * trailing statement chain of the `consequent` node. + * + * @param {ASTNode} node - A IfStatement node to check. + * @returns {boolean} `true` if the node requires braces of the consequent chunk. + */ + function requiresBraceOfConsequent(node) { + if (node.alternate && node.consequent.type === "BlockStatement") { + if (node.consequent.body.length >= 2) { + return true; + } + + node = node.consequent.body[0]; + while (node) { + if (node.type === "IfStatement" && !node.alternate) { + return true; + } + node = astUtils.getTrailingStatement(node); + } + } + + return false; + } + + /** + * Reports "Expected { after ..." error + * @param {ASTNode} node The node to report. + * @param {string} name The name to report. + * @param {string} suffix Additional string to add to the end of a report. + * @returns {void} + * @private + */ + function reportExpectedBraceError(node, name, suffix) { + context.report({ + node: node, + loc: (name !== "else" ? node : getElseKeyword(node)).loc.start, + message: "Expected { after '{{name}}'{{suffix}}.", + data: { + name: name, + suffix: (suffix ? " " + suffix : "") + } + }); + } + + /** + * Reports "Unnecessary { after ..." error + * @param {ASTNode} node The node to report. + * @param {string} name The name to report. + * @param {string} suffix Additional string to add to the end of a report. + * @returns {void} + * @private + */ + function reportUnnecessaryBraceError(node, name, suffix) { + context.report({ + node: node, + loc: (name !== "else" ? node : getElseKeyword(node)).loc.start, + message: "Unnecessary { after '{{name}}'{{suffix}}.", + data: { + name: name, + suffix: (suffix ? " " + suffix : "") + } + }); + } + + /** + * Prepares to check the body of a node to see if it's a block statement. * @param {ASTNode} node The node to report if there's a problem. * @param {ASTNode} body The body node to check for blocks. * @param {string} name The name to report if there's a problem. * @param {string} suffix Additional string to add to the end of a report. - * @returns {void} + * @returns {object} a prepared check object, with "actual", "expected", "check" properties. + * "actual" will be `true` or `false` whether the body is already a block statement. + * "expected" will be `true` or `false` if the body should be a block statement or not, or + * `null` if it doesn't matter, depending on the rule options. It can be modified to change + * the final behavior of "check". + * "check" will be a function reporting appropriate problems depending on the other + * properties. */ - function checkBody(node, body, name, suffix) { + function prepareCheck(node, body, name, suffix) { var hasBlock = (body.type === "BlockStatement"); + var expected = null; - if (multiOnly) { + if (node.type === "IfStatement" && node.consequent === body && requiresBraceOfConsequent(node)) { + expected = true; + } else if (multiOnly) { if (hasBlock && body.body.length === 1) { - context.report(node, "Unnecessary { after '{{name}}'{{suffix}}.", - { - name: name, - suffix: (suffix ? " " + suffix : "") - } - ); + expected = false; } } else if (multiLine) { - if (!hasBlock && !isCollapsedOneLiner(body)) { - context.report(node, "Expected { after '{{name}}'{{suffix}}.", - { - name: name, - suffix: (suffix ? " " + suffix : "") - } - ); + if (!isCollapsedOneLiner(body)) { + expected = true; + } + } else if (multiOrNest) { + if (hasBlock && body.body.length === 1 && isOneLiner(body.body[0])) { + expected = false; + } else if (!isOneLiner(body)) { + expected = true; } } else { - if (!hasBlock) { - context.report(node, "Expected { after '{{name}}'{{suffix}}.", - { - name: name, - suffix: (suffix ? " " + suffix : "") + expected = true; + } + + return { + actual: hasBlock, + expected: expected, + check: function() { + if (this.expected !== null && this.expected !== this.actual) { + if (this.expected) { + reportExpectedBraceError(node, name, suffix); + } else { + reportUnnecessaryBraceError(node, name, suffix); } - ); + } + } + }; + } + + /** + * Prepares to check the bodies of a "if", "else if" and "else" chain. + * @param {ASTNode} node The first IfStatement node of the chain. + * @returns {object[]} prepared checks for each body of the chain. See `prepareCheck` for more + * information. + */ + function prepareIfChecks(node) { + var preparedChecks = []; + + do { + preparedChecks.push(prepareCheck(node, node.consequent, "if", "condition")); + if (node.alternate && node.alternate.type !== "IfStatement") { + preparedChecks.push(prepareCheck(node, node.alternate, "else")); + break; } + node = node.alternate; + } while (node); + + if (consistent) { + + /* + * If any node should have or already have braces, make sure they + * all have braces. + * If all nodes shouldn't have braces, make sure they don't. + */ + var expected = preparedChecks.some(function(preparedCheck) { + if (preparedCheck.expected !== null) { + return preparedCheck.expected; + } + return preparedCheck.actual; + }); + + preparedChecks.forEach(function(preparedCheck) { + preparedCheck.expected = expected; + }); } + + return preparedChecks; } //-------------------------------------------------------------------------- @@ -76,34 +235,60 @@ module.exports = function(context) { //-------------------------------------------------------------------------- return { - "IfStatement": function(node) { - - checkBody(node, node.consequent, "if", "condition"); - - if (node.alternate && node.alternate.type !== "IfStatement") { - checkBody(node, node.alternate, "else"); + if (node.parent.type !== "IfStatement") { + prepareIfChecks(node).forEach(function(preparedCheck) { + preparedCheck.check(); + }); } - }, "WhileStatement": function(node) { - checkBody(node, node.body, "while", "condition"); + prepareCheck(node, node.body, "while", "condition").check(); }, - "DoWhileStatement": function (node) { - checkBody(node, node.body, "do"); + "DoWhileStatement": function(node) { + prepareCheck(node, node.body, "do").check(); }, "ForStatement": function(node) { - checkBody(node, node.body, "for", "condition"); + prepareCheck(node, node.body, "for", "condition").check(); + }, + + "ForInStatement": function(node) { + prepareCheck(node, node.body, "for-in").check(); + }, + + "ForOfStatement": function(node) { + prepareCheck(node, node.body, "for-of").check(); } }; - }; -module.exports.schema = [ - { - "enum": ["all", "multi", "multi-line"] - } -]; +module.exports.schema = { + "anyOf": [ + { + "type": "array", + "items": [ + { + "enum": ["all"] + } + ], + "minItems": 0, + "maxItems": 1 + }, + { + "type": "array", + "items": [ + { + "enum": ["multi", "multi-line", "multi-or-nest"] + }, + { + "enum": ["consistent"] + } + ], + "minItems": 0, + "maxItems": 2 + } + ] +}; diff --git a/tools/eslint/lib/rules/default-case.js b/tools/eslint/lib/rules/default-case.js index e8a748401e570d..6bcc791238a3e7 100644 --- a/tools/eslint/lib/rules/default-case.js +++ b/tools/eslint/lib/rules/default-case.js @@ -34,8 +34,11 @@ module.exports = function(context) { "SwitchStatement": function(node) { if (!node.cases.length) { - // skip check of empty switch because there is no easy way - // to extract comments inside it now + + /* + * skip check of empty switch because there is no easy way + * to extract comments inside it now + */ return; } @@ -49,6 +52,7 @@ module.exports = function(context) { var comments; var lastCase = last(node.cases); + comments = context.getComments(lastCase).trailing; if (comments.length) { diff --git a/tools/eslint/lib/rules/dot-location.js b/tools/eslint/lib/rules/dot-location.js index 6e83b984887293..89e82269aa874e 100644 --- a/tools/eslint/lib/rules/dot-location.js +++ b/tools/eslint/lib/rules/dot-location.js @@ -6,26 +6,19 @@ "use strict"; +var astUtils = require("../ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ -module.exports = function (context) { +module.exports = function(context) { var config = context.options[0], - // default to onObject if no preference is passed - onObject = config === "object" || !config; + onObject; - /** - * Checks whether two tokens are on the same line. - * @param {Object} left The leftmost token. - * @param {Object} right The rightmost token. - * @returns {boolean} True if the tokens are on the same line, false if not. - * @private - */ - function isSameLine(left, right) { - return left.loc.end.line === right.loc.start.line; - } + // default to onObject if no preference is passed + onObject = config === "object" || !config; /** * Reports if the dot between object and property is on the correct loccation. @@ -39,10 +32,10 @@ module.exports = function (context) { if (dot.type === "Punctuator" && dot.value === ".") { if (onObject) { - if (!isSameLine(obj, dot)) { + if (!astUtils.isTokenOnSameLine(obj, dot)) { context.report(node, dot.loc.start, "Expected dot to be on same line as object."); } - } else if (!isSameLine(dot, prop)) { + } else if (!astUtils.isTokenOnSameLine(dot, prop)) { context.report(node, dot.loc.start, "Expected dot to be on same line as property."); } } @@ -61,3 +54,9 @@ module.exports = function (context) { "MemberExpression": checkNode }; }; + +module.exports.schema = [ + { + "enum": ["object", "property"] + } +]; diff --git a/tools/eslint/lib/rules/dot-notation.js b/tools/eslint/lib/rules/dot-notation.js index 2198cd75470f37..f4d0bca6d280da 100644 --- a/tools/eslint/lib/rules/dot-notation.js +++ b/tools/eslint/lib/rules/dot-notation.js @@ -9,73 +9,14 @@ //------------------------------------------------------------------------------ var validIdentifier = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/; -var keywords = [ - "this", - "function", - "if", - "return", - "var", - "else", - "for", - "new", - "in", - "typeof", - "while", - "case", - "break", - "try", - "catch", - "delete", - "throw", - "switch", - "continue", - "default", - "instanceof", - "do", - "void", - "finally", - "with", - "debugger", - "implements", - "interface", - "package", - "private", - "protected", - "public", - "static", - "class", - "enum", - "export", - "extends", - "import", - "super", - "true", - "false", - "null", - "abstract", - "boolean", - "byte", - "char", - "const", - "double", - "final", - "float", - "goto", - "int", - "long", - "native", - "short", - "synchronized", - "throws", - "transient", - "volatile" -]; +var keywords = require("../util/keywords"); module.exports = function(context) { var options = context.options[0] || {}; var allowKeywords = options.allowKeywords === void 0 || !!options.allowKeywords; var allowPattern; + if (options.allowPattern) { allowPattern = new RegExp(options.allowPattern); } @@ -89,7 +30,7 @@ module.exports = function(context) { (allowKeywords || keywords.indexOf("" + node.property.value) === -1) ) { if (!(allowPattern && allowPattern.test(node.property.value))) { - context.report(node, "[" + JSON.stringify(node.property.value) + "] is better written in dot notation."); + context.report(node.property, "[" + JSON.stringify(node.property.value) + "] is better written in dot notation."); } } if ( @@ -97,7 +38,7 @@ module.exports = function(context) { !node.computed && keywords.indexOf("" + node.property.name) !== -1 ) { - context.report(node, "." + node.property.name + " is a syntax error."); + context.report(node.property, "." + node.property.name + " is a syntax error."); } } }; diff --git a/tools/eslint/lib/rules/eol-last.js b/tools/eslint/lib/rules/eol-last.js index 2f68b8a7df1e2c..fe5b0aa425bfff 100644 --- a/tools/eslint/lib/rules/eol-last.js +++ b/tools/eslint/lib/rules/eol-last.js @@ -17,17 +17,25 @@ module.exports = function(context) { return { "Program": function checkBadEOF(node) { - // Get the whole source code, not for node only. - var src = context.getSource(), location = {column: 1}; - if (src.length === 0) { - return; - } + // Get the whole source code, not for node only. + var src = context.getSource(), + location = {column: 1}, + linebreakStyle = context.options[0] || "unix", + linebreak = linebreakStyle === "unix" ? "\n" : "\r\n"; if (src[src.length - 1] !== "\n") { + // file is not newline-terminated location.line = src.split(/\n/g).length; - context.report(node, location, "Newline required at end of file but not found."); + context.report({ + node: node, + loc: location, + message: "Newline required at end of file but not found.", + fix: function(fixer) { + return fixer.insertTextAfterRange([0, src.length], linebreak); + } + }); } } @@ -35,4 +43,8 @@ module.exports = function(context) { }; -module.exports.schema = []; +module.exports.schema = [ + { + "enum": ["unix", "windows"] + } +]; diff --git a/tools/eslint/lib/rules/eqeqeq.js b/tools/eslint/lib/rules/eqeqeq.js index 1576d6c1ab500c..613a3e18edc88e 100644 --- a/tools/eslint/lib/rules/eqeqeq.js +++ b/tools/eslint/lib/rules/eqeqeq.js @@ -1,6 +1,8 @@ /** * @fileoverview Rule to flag statements that use != and == instead of !== and === * @author Nicholas C. Zakas + * @copyright 2013 Nicholas C. Zakas. All rights reserved. + * See LICENSE file in root directory for full license. */ "use strict"; @@ -61,6 +63,7 @@ module.exports = function(context) { */ function getOperatorLocation(node) { var opToken = context.getTokenAfter(node.left); + return {line: opToken.loc.start.line, column: opToken.loc.start.column}; } @@ -71,7 +74,7 @@ module.exports = function(context) { } if (context.options[0] === "smart" && (isTypeOfBinary(node) || - areLiteralsAndSameType(node)) || isNullCheck(node)) { + areLiteralsAndSameType(node) || isNullCheck(node))) { return; } @@ -79,11 +82,13 @@ module.exports = function(context) { return; } - context.report( - node, getOperatorLocation(node), - "Expected '{{op}}=' and instead saw '{{op}}'.", - {op: node.operator} - ); + context.report({ + node: node, + loc: getOperatorLocation(node), + message: "Expected '{{op}}=' and instead saw '{{op}}'.", + data: { op: node.operator } + }); + } }; diff --git a/tools/eslint/lib/rules/func-style.js b/tools/eslint/lib/rules/func-style.js index c9d64b6d00bff4..661c0157388b1f 100644 --- a/tools/eslint/lib/rules/func-style.js +++ b/tools/eslint/lib/rules/func-style.js @@ -12,38 +12,73 @@ module.exports = function(context) { var style = context.options[0], - enforceDeclarations = (style === "declaration"); + allowArrowFunctions = context.options[1] && context.options[1].allowArrowFunctions === true, + enforceDeclarations = (style === "declaration"), + stack = []; - return { + var nodesToCheck = { + "Program": function() { + stack = []; + }, "FunctionDeclaration": function(node) { - if (!enforceDeclarations) { + stack.push(false); + + if (!enforceDeclarations && node.parent.type !== "ExportDefaultDeclaration") { context.report(node, "Expected a function expression."); } }, + "FunctionDeclaration:exit": function() { + stack.pop(); + }, - "FunctionExpression": function() { - var parent = context.getAncestors().pop(); + "FunctionExpression": function(node) { + stack.push(false); - if (enforceDeclarations && parent.type === "VariableDeclarator") { - context.report(parent, "Expected a function declaration."); + if (enforceDeclarations && node.parent.type === "VariableDeclarator") { + context.report(node.parent, "Expected a function declaration."); } }, + "FunctionExpression:exit": function() { + stack.pop(); + }, - "ArrowFunctionExpression": function() { - var parent = context.getAncestors().pop(); - - if (enforceDeclarations && parent.type === "VariableDeclarator") { - context.report(parent, "Expected a function declaration."); + "ThisExpression": function() { + if (stack.length > 0) { + stack[stack.length - 1] = true; } } - }; + if (!allowArrowFunctions) { + nodesToCheck.ArrowFunctionExpression = function() { + stack.push(false); + }; + + nodesToCheck["ArrowFunctionExpression:exit"] = function(node) { + var hasThisExpr = stack.pop(); + + if (enforceDeclarations && !hasThisExpr && node.parent.type === "VariableDeclarator") { + context.report(node.parent, "Expected a function declaration."); + } + }; + } + + return nodesToCheck; + }; module.exports.schema = [ { "enum": ["declaration", "expression"] + }, + { + "type": "object", + "properties": { + "allowArrowFunctions": { + "type": "boolean" + } + }, + "additionalProperties": false } ]; diff --git a/tools/eslint/lib/rules/generator-star-spacing.js b/tools/eslint/lib/rules/generator-star-spacing.js index 1769f300449bce..94f2ca1f6968e8 100644 --- a/tools/eslint/lib/rules/generator-star-spacing.js +++ b/tools/eslint/lib/rules/generator-star-spacing.js @@ -14,7 +14,7 @@ module.exports = function(context) { var mode = (function(option) { - if (option == null || typeof option === "string") { + if (!option || typeof option === "string") { return { before: { before: true, after: false }, after: { before: false, after: true }, @@ -36,14 +36,25 @@ module.exports = function(context) { */ function checkSpacing(side, leftToken, rightToken) { if (!!(rightToken.range[0] - leftToken.range[1]) !== mode[side]) { - context.report( - leftToken.value === "*" ? leftToken : rightToken, - "{{type}} space {{side}} *.", - { - type: mode[side] ? "Missing" : "Unexpected", - side: side + var after = leftToken.value === "*"; + var spaceRequired = mode[side]; + var node = after ? leftToken : rightToken; + var type = spaceRequired ? "Missing" : "Unexpected"; + var message = type + " space " + side + " *."; + + context.report({ + node: node, + message: message, + fix: function(fixer) { + if (spaceRequired) { + if (after) { + return fixer.insertTextAfter(node, " "); + } + return fixer.insertTextBefore(node, " "); + } + return fixer.removeRange([leftToken.range[1], rightToken.range[0]]); } - ); + }); } } @@ -71,11 +82,8 @@ module.exports = function(context) { checkSpacing("before", prevToken, starToken); } - // Only check after when followed by an identifier nextToken = context.getTokenAfter(starToken); - if (nextToken.type === "Identifier") { - checkSpacing("after", starToken, nextToken); - } + checkSpacing("after", starToken, nextToken); } return { diff --git a/tools/eslint/lib/rules/generator-star.js b/tools/eslint/lib/rules/generator-star.js deleted file mode 100644 index d6f3d2cdc58b6f..00000000000000 --- a/tools/eslint/lib/rules/generator-star.js +++ /dev/null @@ -1,76 +0,0 @@ -/** - * @fileoverview Rule to check for the position of the * in your generator functions - * @author Jamund Ferguson - * @copyright 2014 Jamund Ferguson. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var position = context.options[0] || "end"; - - /** - * Check the position of the star compared to the expected position. - * @param {ASTNode} node - the entire function node - * @returns {void} - */ - function checkStarPosition(node) { - var starToken; - - if (!node.generator) { - return; - } - - // Blocked, pending decision to fix or work around in eslint/espree#36 - if (context.getAncestors().pop().method) { - return; - } - - starToken = context.getFirstToken(node, 1); - - // check for function *name() {} - if (position === "end") { - - // * starts where the next identifier begins - if (starToken.range[1] !== context.getTokenAfter(starToken).range[0]) { - context.report(node, "Expected a space before *."); - } - } - - // check for function* name() {} - if (position === "start") { - - // * begins where the previous identifier ends - if (starToken.range[0] !== context.getTokenBefore(starToken).range[1]) { - context.report(node, "Expected no space before *."); - } - } - - // check for function * name() {} - if (position === "middle") { - - // must be a space before and afer the * - if (starToken.range[0] <= context.getTokenBefore(starToken).range[1] || - starToken.range[1] >= context.getTokenAfter(starToken).range[0]) { - context.report(node, "Expected spaces around *."); - } - } - } - - return { - "FunctionDeclaration": checkStarPosition, - "FunctionExpression": checkStarPosition - }; - -}; - -module.exports.schema = [ - { - "enum": ["start", "middle", "end"] - } -]; diff --git a/tools/eslint/lib/rules/global-require.js b/tools/eslint/lib/rules/global-require.js new file mode 100644 index 00000000000000..d6939644581deb --- /dev/null +++ b/tools/eslint/lib/rules/global-require.js @@ -0,0 +1,70 @@ +/** + * @fileoverview Rule for disallowing require() outside of the top-level module context + * @author Jamund Ferguson + * @copyright 2015 Jamund Ferguson. All rights reserved. + */ + +"use strict"; + +var ACCEPTABLE_PARENTS = [ + "AssignmentExpression", + "VariableDeclarator", + "MemberExpression", + "ExpressionStatement", + "CallExpression", + "ConditionalExpression", + "Program", + "VariableDeclaration" +]; + +/** + * Finds the escope reference in the given scope. + * @param {Object} scope The scope to search. + * @param {ASTNode} node The identifier node. + * @returns {Reference|null} Returns the found reference or null if none were found. + */ +function findReference(scope, node) { + var references = scope.references.filter(function(reference) { + return reference.identifier.range[0] === node.range[0] && + reference.identifier.range[1] === node.range[1]; + }); + + /* istanbul ignore else: correctly returns null */ + if (references.length === 1) { + return references[0]; + } else { + return null; + } +} + +/** + * Checks if the given identifier node is shadowed in the given scope. + * @param {Object} scope The current scope. + * @param {ASTNode} node The identifier node to check. + * @returns {boolean} Whether or not the name is shadowed. + */ +function isShadowed(scope, node) { + var reference = findReference(scope, node); + + return reference && reference.resolved && reference.resolved.defs.length > 0; +} + +module.exports = function(context) { + return { + "CallExpression": function(node) { + var currentScope = context.getScope(), + isGoodRequire; + + if (node.callee.name === "require" && !isShadowed(currentScope, node.callee)) { + isGoodRequire = context.getAncestors().every(function(parent) { + return ACCEPTABLE_PARENTS.indexOf(parent.type) > -1; + }); + if (!isGoodRequire) { + context.report(node, "Unexpected require()."); + } + } + } + }; +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/global-strict.js b/tools/eslint/lib/rules/global-strict.js deleted file mode 100644 index 97980f6fed2364..00000000000000 --- a/tools/eslint/lib/rules/global-strict.js +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @fileoverview Rule to flag or require global strict mode. - * @author Nicholas C. Zakas - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var mode = context.options[0]; - - if (mode === "always") { - - return { - "Program": function(node) { - if (node.body.length > 0) { - var statement = node.body[0]; - - if (!(statement.type === "ExpressionStatement" && statement.expression.value === "use strict")) { - context.report(node, "Use the global form of \"use strict\"."); - } - } - } - }; - - } else { // mode = "never" - - return { - "ExpressionStatement": function(node) { - var parent = context.getAncestors().pop(); - - if (node.expression.value === "use strict" && parent.type === "Program") { - context.report(node, "Use the function form of \"use strict\"."); - } - } - }; - - } - -}; - -module.exports.schema = [ - { - "enum": ["always", "never"] - } -]; diff --git a/tools/eslint/lib/rules/handle-callback-err.js b/tools/eslint/lib/rules/handle-callback-err.js index 438ea93c074f22..622288c99625af 100644 --- a/tools/eslint/lib/rules/handle-callback-err.js +++ b/tools/eslint/lib/rules/handle-callback-err.js @@ -22,6 +22,7 @@ module.exports = function(context) { */ function isPattern(stringToCheck) { var firstChar = stringToCheck[0]; + return firstChar === "^"; } @@ -33,6 +34,7 @@ module.exports = function(context) { function matchesConfiguredErrorName(name) { if (isPattern(errorArgument)) { var regexp = new RegExp(errorArgument); + return regexp.test(name); } return name === errorArgument; @@ -44,7 +46,7 @@ module.exports = function(context) { * @returns {array} All parameters of the given scope. */ function getParameters(scope) { - return scope.variables.filter(function (variable) { + return scope.variables.filter(function(variable) { return variable.defs[0] && variable.defs[0].type === "Parameter"; }); } diff --git a/tools/eslint/lib/rules/id-blacklist.js b/tools/eslint/lib/rules/id-blacklist.js new file mode 100644 index 00000000000000..42eaf53786ff7d --- /dev/null +++ b/tools/eslint/lib/rules/id-blacklist.js @@ -0,0 +1,110 @@ +/** + * @fileoverview Rule that warns when identifier names that are + blacklisted in the configuration are used. + * @author Keith Cirkel (http://keithcirkel.co.uk) + * Based on id-match rule: + * @author Matthieu Larcher + * @copyright 2015 Matthieu Larcher. All rights reserved. + * See LICENSE in root directory for full license. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + var blacklist = context.options; + + + /** + * Checks if a string matches the provided pattern + * @param {String} name The string to check. + * @returns {boolean} if the string is a match + * @private + */ + function isInvalid(name) { + return blacklist.indexOf(name) !== -1; + } + + /** + * Verifies if we should report an error or not based on the effective + * parent node and the identifier name. + * @param {ASTNode} effectiveParent The effective parent node of the node to be reported + * @param {String} name The identifier name of the identifier node + * @returns {boolean} whether an error should be reported or not + */ + function shouldReport(effectiveParent, name) { + return effectiveParent.type !== "CallExpression" + && effectiveParent.type !== "NewExpression" && + isInvalid(name); + } + + /** + * Reports an AST node as a rule violation. + * @param {ASTNode} node The node to report. + * @returns {void} + * @private + */ + function report(node) { + context.report(node, "Identifier '{{name}}' is blacklisted", { + name: node.name + }); + } + + return { + + "Identifier": function(node) { + var name = node.name, + effectiveParent = (node.parent.type === "MemberExpression") ? node.parent.parent : node.parent; + + // MemberExpressions get special rules + if (node.parent.type === "MemberExpression") { + + // Always check object names + if (node.parent.object.type === "Identifier" && + node.parent.object.name === node.name) { + if (isInvalid(name)) { + report(node); + } + + // Report AssignmentExpressions only if they are the left side of the assignment + } else if (effectiveParent.type === "AssignmentExpression" && + (effectiveParent.right.type !== "MemberExpression" || + effectiveParent.left.type === "MemberExpression" && + effectiveParent.left.property.name === node.name)) { + if (isInvalid(name)) { + report(node); + } + } + + // Properties have their own rules + } else if (node.parent.type === "Property") { + + if (shouldReport(effectiveParent, name)) { + report(node); + } + + // Report anything that is a match and not a CallExpression + } else if (shouldReport(effectiveParent, name)) { + report(node); + } + } + + }; + +}; +module.exports.schema = { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true +}; diff --git a/tools/eslint/lib/rules/id-length.js b/tools/eslint/lib/rules/id-length.js new file mode 100644 index 00000000000000..783ef55c39ced9 --- /dev/null +++ b/tools/eslint/lib/rules/id-length.js @@ -0,0 +1,109 @@ +/** + * @fileoverview Rule that warns when identifier names are shorter or longer + * than the values provided in configuration. + * @author Burak Yigit Kaya aka BYK + * @copyright 2015 Burak Yigit Kaya. All rights reserved. + * @copyright 2015 Mathieu M-Gosselin. All rights reserved. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var options = context.options[0] || {}; + var minLength = typeof options.min !== "undefined" ? options.min : 2; + var maxLength = typeof options.max !== "undefined" ? options.max : Infinity; + var properties = options.properties !== "never"; + var exceptions = (options.exceptions ? options.exceptions : []) + .reduce(function(obj, item) { + obj[item] = true; + + return obj; + }, {}); + + var SUPPORTED_EXPRESSIONS = { + "MemberExpression": properties && function(parent) { + return !parent.computed && ( + + // regular property assignment + parent.parent.left === parent || ( + + // or the last identifier in an ObjectPattern destructuring + parent.parent.type === "Property" && parent.parent.value === parent && + parent.parent.parent.type === "ObjectPattern" && parent.parent.parent.parent.left === parent.parent.parent + ) + ); + }, + "AssignmentPattern": function(parent, node) { + return parent.left === node; + }, + "VariableDeclarator": function(parent, node) { + return parent.id === node; + }, + "Property": properties && function(parent, node) { + return parent.key === node; + }, + "ImportDefaultSpecifier": true, + "RestElement": true, + "FunctionExpression": true, + "ArrowFunctionExpression": true, + "ClassDeclaration": true, + "FunctionDeclaration": true, + "MethodDefinition": true, + "CatchClause": true + }; + + return { + Identifier: function(node) { + var name = node.name; + var parent = node.parent; + + var isShort = name.length < minLength; + var isLong = name.length > maxLength; + + if (!(isShort || isLong) || exceptions[name]) { + return; // Nothing to report + } + + var isValidExpression = SUPPORTED_EXPRESSIONS[parent.type]; + + if (isValidExpression && (isValidExpression === true || isValidExpression(parent, node))) { + context.report( + node, + isShort ? + "Identifier name '{{name}}' is too short. (< {{min}})" : + "Identifier name '{{name}}' is too long. (> {{max}})", + { name: name, min: minLength, max: maxLength } + ); + } + } + }; +}; + +module.exports.schema = [ + { + "type": "object", + "properties": { + "min": { + "type": "number" + }, + "max": { + "type": "number" + }, + "exceptions": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "properties": { + "enum": ["always", "never"] + } + }, + "additionalProperties": false + } +]; diff --git a/tools/eslint/lib/rules/id-match.js b/tools/eslint/lib/rules/id-match.js new file mode 100644 index 00000000000000..df6fe6c8015c56 --- /dev/null +++ b/tools/eslint/lib/rules/id-match.js @@ -0,0 +1,131 @@ +/** + * @fileoverview Rule to flag non-matching identifiers + * @author Matthieu Larcher + * @copyright 2015 Matthieu Larcher. All rights reserved. + * See LICENSE in root directory for full license. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + var pattern = context.options[0] || "^.+$", + regexp = new RegExp(pattern); + + var options = context.options[1] || {}, + properties = options.properties; + + // cast to boolean and default to false + properties = !!properties; + + + /** + * Checks if a string matches the provided pattern + * @param {String} name The string to check. + * @returns {boolean} if the string is a match + * @private + */ + function isInvalid(name) { + return !regexp.test(name); + } + + /** + * Verifies if we should report an error or not based on the effective + * parent node and the identifier name. + * @param {ASTNode} effectiveParent The effective parent node of the node to be reported + * @param {String} name The identifier name of the identifier node + * @returns {boolean} whether an error should be reported or not + */ + function shouldReport(effectiveParent, name) { + return effectiveParent.type !== "CallExpression" + && effectiveParent.type !== "NewExpression" && + isInvalid(name); + } + + /** + * Reports an AST node as a rule violation. + * @param {ASTNode} node The node to report. + * @returns {void} + * @private + */ + function report(node) { + context.report(node, "Identifier '{{name}}' does not match the pattern '{{pattern}}'.", { + name: node.name, + pattern: pattern + }); + } + + return { + + "Identifier": function(node) { + var name = node.name, + effectiveParent = (node.parent.type === "MemberExpression") ? node.parent.parent : node.parent; + + // MemberExpressions get special rules + if (node.parent.type === "MemberExpression") { + + // return early if properties is false + if (!properties) { + return; + } + + // Always check object names + if (node.parent.object.type === "Identifier" && + node.parent.object.name === node.name) { + if (isInvalid(name)) { + report(node); + } + + // Report AssignmentExpressions only if they are the left side of the assignment + } else if (effectiveParent.type === "AssignmentExpression" && + (effectiveParent.right.type !== "MemberExpression" || + effectiveParent.left.type === "MemberExpression" && + effectiveParent.left.property.name === node.name)) { + if (isInvalid(name)) { + report(node); + } + } + + // Properties have their own rules + } else if (node.parent.type === "Property") { + + // return early if properties is false + if (!properties) { + return; + } + + if (shouldReport(effectiveParent, name)) { + report(node); + } + + // Report anything that is a match and not a CallExpression + } else if (shouldReport(effectiveParent, name)) { + report(node); + } + } + + }; + +}; + +module.exports.schema = [ + { + "type": "string" + }, + { + "type": "object", + "properties": { + "properties": { + "type": "boolean" + } + } + } +]; diff --git a/tools/eslint/lib/rules/indent.js b/tools/eslint/lib/rules/indent.js index d0cf27cca344c5..24a6241f59dd6b 100644 --- a/tools/eslint/lib/rules/indent.js +++ b/tools/eslint/lib/rules/indent.js @@ -1,463 +1,726 @@ /** * @fileoverview This option sets a specific tab width for your code - * This rule has been ported and modified from JSCS. - * @author Dmitriy Shekhovtsov - * @copyright 2015 Dmitriy Shekhovtsov. All rights reserved. - * @copyright 2013 Dulin Marat and other contributors. - * - * 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. - */ -/*eslint no-use-before-define:[2, "nofunc"]*/ + + * This rule has been ported and modified from nodeca. + * @author Vitaly Puzrin + * @author Gyandeep Singh + * @copyright 2015 Vitaly Puzrin. All rights reserved. + * @copyright 2015 Gyandeep Singh. All rights reserved. + Copyright (C) 2014 by Vitaly Puzrin + + 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. +*/ + "use strict"; //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ +var util = require("util"); +var lodash = require("lodash"); -module.exports = function (context) { - // indentation defaults: 4 spaces - var indentChar = " "; - var indentSize = 4; - var options = {indentSwitchCase: false}; +module.exports = function(context) { - var lines = null; - var indentStack = [0]; - var linesToCheck = null; - var breakIndents = null; + var MESSAGE = "Expected indentation of {{needed}} {{type}} {{characters}} but found {{gotten}}."; + var DEFAULT_VARIABLE_INDENT = 1; + + var indentType = "space"; + var indentSize = 4; + var options = { + SwitchCase: 0, + VariableDeclarator: { + var: DEFAULT_VARIABLE_INDENT, + let: DEFAULT_VARIABLE_INDENT, + const: DEFAULT_VARIABLE_INDENT + } + }; if (context.options.length) { if (context.options[0] === "tab") { - indentChar = "\t"; indentSize = 1; + indentType = "tab"; } else /* istanbul ignore else : this will be caught by options validation */ if (typeof context.options[0] === "number") { indentSize = context.options[0]; + indentType = "space"; } if (context.options[1]) { var opts = context.options[1]; - options.indentSwitchCase = opts.indentSwitchCase === true; + + options.SwitchCase = opts.SwitchCase || 0; + var variableDeclaratorRules = opts.VariableDeclarator; + + if (typeof variableDeclaratorRules === "number") { + options.VariableDeclarator = { + var: variableDeclaratorRules, + let: variableDeclaratorRules, + const: variableDeclaratorRules + }; + } else if (typeof variableDeclaratorRules === "object") { + lodash.assign(options.VariableDeclarator, variableDeclaratorRules); + } } } - var blockParents = [ - "IfStatement", - "WhileStatement", - "DoWhileStatement", - "ForStatement", - "ForInStatement", - "ForOfStatement", - "FunctionDeclaration", - "FunctionExpression", - "ArrowExpression", - "CatchClause", - "WithStatement" - ]; - - var indentableNodes = { - BlockStatement: "body", - Program: "body", - ObjectExpression: "properties", - ArrayExpression: "elements", - SwitchStatement: "cases" + var indentPattern = { + normal: indentType === "space" ? /^ +/ : /^\t+/, + excludeCommas: indentType === "space" ? /^[ ,]+/ : /^[\t,]+/ }; - if (options.indentSwitchCase) { - indentableNodes.SwitchCase = "consequent"; - } - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- + var caseIndentStore = {}; /** - * Mark line to be checked - * @param {Number} line - line number + * Reports a given indent violation and properly pluralizes the message + * @param {ASTNode} node Node violating the indent rule + * @param {int} needed Expected indentation character count + * @param {int} gotten Indentation character count in the actual node/code + * @param {Object=} loc Error line and column location + * @param {boolean} isLastNodeCheck Is the error for last node check * @returns {void} */ - function markCheckLine(line) { - linesToCheck[line].check = true; - } + function report(node, needed, gotten, loc, isLastNodeCheck) { + var msgContext = { + needed: needed, + type: indentType, + characters: needed === 1 ? "character" : "characters", + gotten: gotten + }; + var indentChar = indentType === "space" ? " " : "\t"; + + /** + * Responsible for fixing the indentation issue fix + * @returns {Function} function to be executed by the fixer + * @private + */ + function getFixerFunction() { + var rangeToFix = []; + + if (needed > gotten) { + var spaces = "" + new Array(needed - gotten + 1).join(indentChar); // replace with repeat in future + + if (isLastNodeCheck === true) { + rangeToFix = [ + node.range[1] - 1, + node.range[1] - 1 + ]; + } else { + rangeToFix = [ + node.range[0], + node.range[0] + ]; + } - /** - * Mark line with targeted node to be checked - * @param {ASTNode} checkNode - targeted node - * @returns {void} - */ - function markCheck(checkNode) { - markCheckLine(checkNode.loc.start.line - 1); + return function(fixer) { + return fixer.insertTextBeforeRange(rangeToFix, spaces); + }; + } else { + if (isLastNodeCheck === true) { + rangeToFix = [ + node.range[1] - (gotten - needed) - 1, + node.range[1] - 1 + ]; + } else { + rangeToFix = [ + node.range[0] - (gotten - needed), + node.range[0] + ]; + } + + return function(fixer) { + return fixer.removeRange(rangeToFix); + }; + } + } + + if (loc) { + context.report({ + node: node, + loc: loc, + message: MESSAGE, + data: msgContext, + fix: getFixerFunction() + }); + } else { + context.report({ + node: node, + message: MESSAGE, + data: msgContext, + fix: getFixerFunction() + }); + } } /** - * Sets pushing indent of current node - * @param {ASTNode} node - targeted node - * @param {Number} indents - indents count to push - * @returns {void} + * Get node indent + * @param {ASTNode|Token} node Node to examine + * @param {boolean} [byLastLine=false] get indent of node's last line + * @param {boolean} [excludeCommas=false] skip comma on start of line + * @returns {int} Indent */ - function markPush(node, indents) { - linesToCheck[node.loc.start.line - 1].push.push(indents); + function getNodeIndent(node, byLastLine, excludeCommas) { + var token = byLastLine ? context.getLastToken(node) : context.getFirstToken(node); + var src = context.getSource(token, token.loc.start.column); + var regExp = excludeCommas ? indentPattern.excludeCommas : indentPattern.normal; + var indent = regExp.exec(src); + + return indent ? indent[0].length : 0; } /** - * Marks line as outdent, end of block statement for example - * @param {ASTNode} node - targeted node - * @param {Number} outdents - count of outedents in targeted line - * @returns {void} + * Checks node is the first in its own start line. By default it looks by start line. + * @param {ASTNode} node The node to check + * @param {boolean} [byEndLocation=false] Lookup based on start position or end + * @returns {boolean} true if its the first in the its start line */ - function markPop(node, outdents) { - linesToCheck[node.loc.end.line - 1].pop.push(outdents); + function isNodeFirstInLine(node, byEndLocation) { + var firstToken = byEndLocation === true ? context.getLastToken(node, 1) : context.getTokenBefore(node), + startLine = byEndLocation === true ? node.loc.end.line : node.loc.start.line, + endLine = firstToken ? firstToken.loc.end.line : -1; + + return startLine !== endLine; } /** - * Set alt push for current node - * @param {ASTNode} node - targeted node + * Check indent for node + * @param {ASTNode} node Node to check + * @param {int} indent needed indent + * @param {boolean} [excludeCommas=false] skip comma on start of line * @returns {void} */ - function markPushAlt(node) { - linesToCheck[node.loc.start.line - 1].pushAltLine.push(node.loc.end.line - 1); + function checkNodeIndent(node, indent, excludeCommas) { + var nodeIndent = getNodeIndent(node, false, excludeCommas); + + if ( + node.type !== "ArrayExpression" && node.type !== "ObjectExpression" && + nodeIndent !== indent && isNodeFirstInLine(node) + ) { + report(node, indent, nodeIndent); + } } /** - * Marks end of node block to be checked - * and marks targeted node as indent pushing - * @param {ASTNode} pushNode - targeted node - * @param {Number} indents - indent count to push + * Check indent for nodes list + * @param {ASTNode[]} nodes list of node objects + * @param {int} indent needed indent + * @param {boolean} [excludeCommas=false] skip comma on start of line * @returns {void} */ - function markPushAndEndCheck(pushNode, indents) { - markPush(pushNode, indents); - markCheckLine(pushNode.loc.end.line - 1); + function checkNodesIndent(nodes, indent, excludeCommas) { + nodes.forEach(function(node) { + if (node.type === "IfStatement" && node.alternate) { + var elseToken = context.getTokenBefore(node.alternate); + + checkNodeIndent(elseToken, indent, excludeCommas); + } + checkNodeIndent(node, indent, excludeCommas); + }); } /** - * Mark node as switch case statement - * and set push\pop indentation changes - * @param {ASTNode} caseNode - targeted node - * @param {ASTNode[]} children - consequent child nodes of case node + * Check last node line indent this detects, that block closed correctly + * @param {ASTNode} node Node to examine + * @param {int} lastLineIndent needed indent * @returns {void} */ - function markCase(caseNode, children) { - var outdentNode = getCaseOutdent(children); - - if (outdentNode) { - // If a case statement has a `break` as a direct child and it is the - // first one encountered, use it as the example for all future case indentation - if (breakIndents === null) { - breakIndents = (caseNode.loc.start.column === outdentNode.loc.start.column) ? 1 : 0; - } - markPop(outdentNode, breakIndents); - } else { - markPop(caseNode, 0); + function checkLastNodeLineIndent(node, lastLineIndent) { + var lastToken = context.getLastToken(node); + var endIndent = getNodeIndent(lastToken, true); + + if (endIndent !== lastLineIndent && isNodeFirstInLine(node, true)) { + report( + node, + lastLineIndent, + endIndent, + { line: lastToken.loc.start.line, column: lastToken.loc.start.column }, + true + ); } } /** - * Mark child nodes to be checked later of targeted node, - * only if child node not in same line as targeted one - * (if child and parent nodes wrote in single line) - * @param {ASTNode} node - targeted node + * Check first node line indent is correct + * @param {ASTNode} node Node to examine + * @param {int} firstLineIndent needed indent * @returns {void} */ - function markChildren(node) { - getChildren(node).forEach(function(childNode) { - if (childNode.loc.start.line !== node.loc.start.line || node.type === "Program") { - markCheck(childNode); - } - }); + function checkFirstNodeLineIndent(node, firstLineIndent) { + var startIndent = getNodeIndent(node, false); + + if (startIndent !== firstLineIndent && isNodeFirstInLine(node)) { + report( + node, + firstLineIndent, + startIndent, + { line: node.loc.start.line, column: node.loc.start.column } + ); + } } /** - * Mark child block as scope pushing and mark to check - * @param {ASTNode} node - target node - * @param {String} property - target node property containing child - * @returns {void} + * Returns the VariableDeclarator based on the current node + * if not present then return null + * @param {ASTNode} node node to examine + * @returns {ASTNode|void} if found then node otherwise null */ - function markAlternateBlockStatement(node, property) { - var child = node[property]; - if (child && child.type === "BlockStatement") { - markCheck(child); + function getVariableDeclaratorNode(node) { + var parent = node.parent; + + while (parent.type !== "VariableDeclarator" && parent.type !== "Program") { + parent = parent.parent; } + + return parent.type === "VariableDeclarator" ? parent : null; } /** - * Checks whether node is multiline or single line - * @param {ASTNode} node - target node - * @returns {boolean} - is multiline node + * Check to see if the node is part of the multi-line variable declaration. + * Also if its on the same line as the varNode + * @param {ASTNode} node node to check + * @param {ASTNode} varNode variable declaration node to check against + * @returns {boolean} True if all the above condition satisfy */ - function isMultiline(node) { - return node.loc.start.line !== node.loc.end.line; + function isNodeInVarOnTop(node, varNode) { + return varNode && + varNode.parent.loc.start.line === node.loc.start.line && + varNode.parent.declarations.length > 1; } /** - * Get switch case statement outdent node if any - * @param {ASTNode[]} caseChildren - case statement childs - * @returns {ASTNode} - outdent node + * Check to see if the argument before the callee node is multi-line and + * there should only be 1 argument before the callee node + * @param {ASTNode} node node to check + * @returns {boolean} True if arguments are multi-line */ - function getCaseOutdent(caseChildren) { - var outdentNode; - caseChildren.some(function(node) { - if (node.type === "BreakStatement") { - outdentNode = node; - return true; - } - }); + function isArgBeforeCalleeNodeMultiline(node) { + var parent = node.parent; + + if (parent.arguments.length >= 2 && parent.arguments[1] === node) { + return parent.arguments[0].loc.end.line > parent.arguments[0].loc.start.line; + } - return outdentNode; + return false; } /** - * Returns block containing node - * @param {ASTNode} node - targeted node - * @returns {ASTNode} - block node + * Check indent for function block content + * @param {ASTNode} node node to examine + * @returns {void} */ - function getBlockNodeToMark(node) { - var parent = node.parent; + function checkIndentInFunctionBlock(node) { + + /* + * Search first caller in chain. + * Ex.: + * + * Models <- Identifier + * .User + * .find() + * .exec(function() { + * // function body + * }); + * + * Looks for 'Models' + */ + var calleeNode = node.parent; // FunctionExpression + var indent; + + if (calleeNode.parent && + (calleeNode.parent.type === "Property" || + calleeNode.parent.type === "ArrayExpression")) { + + // If function is part of array or object, comma can be put at left + indent = getNodeIndent(calleeNode, false, false); + } else { + + // If function is standalone, simple calculate indent + indent = getNodeIndent(calleeNode); + } - // The parent of an else is the entire if/else block. To avoid over indenting - // in the case of a non-block if with a block else, mark push where the else starts, - // not where the if starts! - if (parent.type === "IfStatement" && parent.alternate === node) { - return node; + if (calleeNode.parent.type === "CallExpression") { + var calleeParent = calleeNode.parent; + + if (calleeNode.type !== "FunctionExpression" && calleeNode.type !== "ArrowFunctionExpression") { + if (calleeParent && calleeParent.loc.start.line < node.loc.start.line) { + indent = getNodeIndent(calleeParent); + } + } else { + if (isArgBeforeCalleeNodeMultiline(calleeNode) && + calleeParent.callee.loc.start.line === calleeParent.callee.loc.end.line && + !isNodeFirstInLine(calleeNode)) { + indent = getNodeIndent(calleeParent); + } + } } - // The end line to check of a do while statement needs to be the location of the - // closing curly brace, not the while statement, to avoid marking the last line of - // a multiline while as a line to check. - if (parent.type === "DoWhileStatement") { - return node; + // function body indent should be indent + indent size + indent += indentSize; + + // check if the node is inside a variable + var parentVarNode = getVariableDeclaratorNode(node); + + if (parentVarNode && isNodeInVarOnTop(node, parentVarNode)) { + indent += indentSize * options.VariableDeclarator[parentVarNode.parent.kind]; } - // Detect bare blocks: a block whose parent doesn"t expect blocks in its syntax specifically. - if (blockParents.indexOf(parent.type) === -1) { - return node; + if (node.body.length > 0) { + checkNodesIndent(node.body, indent); } - return parent; + checkLastNodeLineIndent(node, indent - indentSize); } + /** - * Get node's children - * @param {ASTNode} node - current node - * @returns {ASTNode[]} - children + * Checks if the given node starts and ends on the same line + * @param {ASTNode} node The node to check + * @returns {boolean} Whether or not the block starts and ends on the same line. */ - function getChildren(node) { - var childrenProperty = indentableNodes[node.type]; - return node[childrenProperty]; + function isSingleLineNode(node) { + var lastToken = context.getLastToken(node), + startLine = node.loc.start.line, + endLine = lastToken.loc.end.line; + + return startLine === endLine; } /** - * Gets indentation in line `i` - * @param {Number} i - number of line to get indentation - * @returns {Number} - count of indentation symbols + * Check to see if the first element inside an array is an object and on the same line as the node + * If the node is not an array then it will return false. + * @param {ASTNode} node node to check + * @returns {boolean} success/failure */ - function getIndentationFromLine(i) { - var rNotIndentChar = new RegExp("[^" + indentChar + "]"); - var firstContent = lines[i].search(rNotIndentChar); - if (firstContent === -1) { - firstContent = lines[i].length; + function isFirstArrayElementOnSameLine(node) { + if (node.type === "ArrayExpression" && node.elements[0]) { + return node.elements[0].loc.start.line === node.loc.start.line && node.elements[0].type === "ObjectExpression"; + } else { + return false; } - return firstContent; } /** - * Compares expected and actual indentation - * and reports any violations - * @param {ASTNode} node - node used only for reporting + * Check indent for array block content or object block content + * @param {ASTNode} node node to examine * @returns {void} */ - function checkIndentations(node) { - linesToCheck.forEach(function(line, i) { - var actualIndentation = getIndentationFromLine(i); - var expectedIndentation = getExpectedIndentation(line, actualIndentation); - - if (line.check) { - - if (actualIndentation !== expectedIndentation) { - context.report(node, - {line: i + 1, column: expectedIndentation}, - "Expected indentation of " + expectedIndentation + " characters."); - // correct the indentation so that future lines - // can be validated appropriately - actualIndentation = expectedIndentation; + function checkIndentInArrayOrObjectBlock(node) { + + // Skip inline + if (isSingleLineNode(node)) { + return; + } + + var elements = (node.type === "ArrayExpression") ? node.elements : node.properties; + + // filter out empty elements example would be [ , 2] so remove first element as espree considers it as null + elements = elements.filter(function(elem) { + return elem !== null; + }); + + // Skip if first element is in same line with this node + if (elements.length > 0 && elements[0].loc.start.line === node.loc.start.line) { + return; + } + + var nodeIndent; + var elementsIndent; + var parentVarNode = getVariableDeclaratorNode(node); + + // TODO - come up with a better strategy in future + if (isNodeFirstInLine(node)) { + var parent = node.parent; + var effectiveParent = parent; + + if (parent.type === "MemberExpression") { + if (isNodeFirstInLine(parent)) { + effectiveParent = parent.parent.parent; + } else { + effectiveParent = parent.parent; } } + nodeIndent = getNodeIndent(effectiveParent); + if (parentVarNode && parentVarNode.loc.start.line !== node.loc.start.line) { + if (parent.type !== "VariableDeclarator" || parentVarNode === parentVarNode.parent.declarations[0]) { + if (parent.type === "VariableDeclarator" && parentVarNode.loc.start.line === effectiveParent.loc.start.line) { + nodeIndent = nodeIndent + (indentSize * options.VariableDeclarator[parentVarNode.parent.kind]); + } else if ( + parent.type === "ObjectExpression" || + parent.type === "ArrayExpression" || + parent.type === "CallExpression" || + parent.type === "ArrowFunctionExpression" || + parent.type === "NewExpression" + ) { + nodeIndent = nodeIndent + indentSize; + } + } + } else if (!parentVarNode && !isFirstArrayElementOnSameLine(parent) && effectiveParent.type !== "MemberExpression" && effectiveParent.type !== "ExpressionStatement" && effectiveParent.type !== "AssignmentExpression" && effectiveParent.type !== "Property") { + nodeIndent = nodeIndent + indentSize; + } + + elementsIndent = nodeIndent + indentSize; + + checkFirstNodeLineIndent(node, nodeIndent); + } else { + nodeIndent = getNodeIndent(node); + elementsIndent = nodeIndent + indentSize; + } + + /* + * Check if the node is a multiple variable declaration; if so, then + * make sure indentation takes that into account. + */ + if (isNodeInVarOnTop(node, parentVarNode)) { + elementsIndent += indentSize * options.VariableDeclarator[parentVarNode.parent.kind]; + } - if (line.push.length) { - pushExpectedIndentations(line, actualIndentation); + // Comma can be placed before property name + checkNodesIndent(elements, elementsIndent, true); + + if (elements.length > 0) { + + // Skip last block line check if last item in same line + if (elements[elements.length - 1].loc.end.line === node.loc.end.line) { + return; } - }); + } + + checkLastNodeLineIndent(node, elementsIndent - indentSize); } /** - * Counts expected indentation for given line number - * @param {Number} line - line number - * @param {Number} actual - actual indentation - * @returns {number} - expected indentation + * Check if the node or node body is a BlockStatement or not + * @param {ASTNode} node node to test + * @returns {boolean} True if it or its body is a block statement */ - function getExpectedIndentation(line, actual) { - var outdent = indentSize * Math.max.apply(null, line.pop); + function isNodeBodyBlock(node) { + return node.type === "BlockStatement" || node.type === "ClassBody" || (node.body && node.body.type === "BlockStatement") || + (node.consequent && node.consequent.type === "BlockStatement"); + } - var idx = indentStack.length - 1; - var expected = indentStack[idx]; + /** + * Check indentation for blocks + * @param {ASTNode} node node to check + * @returns {void} + */ + function blockIndentationCheck(node) { - if (!Array.isArray(expected)) { - expected = [expected]; + // Skip inline blocks + if (isSingleLineNode(node)) { + return; } - expected = expected.map(function(value) { - if (line.pop.length) { - value -= outdent; - } + if (node.parent && ( + node.parent.type === "FunctionExpression" || + node.parent.type === "FunctionDeclaration" || + node.parent.type === "ArrowFunctionExpression" + )) { + checkIndentInFunctionBlock(node); + return; + } - return value; - }).reduce(function(previous, current) { - // when the expected is an array, resolve the value - // back into a Number by checking both values are the actual indentation - return actual === current ? current : previous; - }); + var indent; + var nodesToCheck = []; - indentStack[idx] = expected; + /* + * For this statements we should check indent from statement beginning, + * not from the beginning of the block. + */ + var statementsWithProperties = [ + "IfStatement", "WhileStatement", "ForStatement", "ForInStatement", "ForOfStatement", "DoWhileStatement", "ClassDeclaration" + ]; - line.pop.forEach(function() { - indentStack.pop(); - }); + if (node.parent && statementsWithProperties.indexOf(node.parent.type) !== -1 && isNodeBodyBlock(node)) { + indent = getNodeIndent(node.parent); + } else { + indent = getNodeIndent(node); + } + + if (node.type === "IfStatement" && node.consequent.type !== "BlockStatement") { + nodesToCheck = [node.consequent]; + } else if (util.isArray(node.body)) { + nodesToCheck = node.body; + } else { + nodesToCheck = [node.body]; + } + + if (nodesToCheck.length > 0) { + checkNodesIndent(nodesToCheck, indent + indentSize); + } - return expected; + if (node.type === "BlockStatement") { + checkLastNodeLineIndent(node, indent); + } } /** - * Store in stack expected indentations - * @param {Number} line - current line - * @param {Number} actualIndentation - actual indentation at current line + * Filter out the elements which are on the same line of each other or the node. + * basically have only 1 elements from each line except the variable declaration line. + * @param {ASTNode} node Variable declaration node + * @returns {ASTNode[]} Filtered elements + */ + function filterOutSameLineVars(node) { + return node.declarations.reduce(function(finalCollection, elem) { + var lastElem = finalCollection[finalCollection.length - 1]; + + if ((elem.loc.start.line !== node.loc.start.line && !lastElem) || + (lastElem && lastElem.loc.start.line !== elem.loc.start.line)) { + finalCollection.push(elem); + } + + return finalCollection; + }, []); + } + + /** + * Check indentation for variable declarations + * @param {ASTNode} node node to examine * @returns {void} */ - function pushExpectedIndentations(line, actualIndentation) { - var indents = Math.max.apply(null, line.push); - var expected = actualIndentation + (indentSize * indents); - - // when a line has alternate indentations, push an array of possible values - // on the stack, to be resolved when checked against an actual indentation - if (line.pushAltLine.length) { - expected = [expected]; - line.pushAltLine.forEach(function(altLine) { - expected.push(getIndentationFromLine(altLine) + (indentSize * indents)); - }); + function checkIndentInVariableDeclarations(node) { + var elements = filterOutSameLineVars(node); + var nodeIndent = getNodeIndent(node); + var lastElement = elements[elements.length - 1]; + + var elementsIndent = nodeIndent + indentSize * options.VariableDeclarator[node.kind]; + + // Comma can be placed before declaration + checkNodesIndent(elements, elementsIndent, true); + + // Only check the last line if there is any token after the last item + if (context.getLastToken(node).loc.end.line <= lastElement.loc.end.line) { + return; } - line.push.forEach(function() { - indentStack.push(expected); - }); + var tokenBeforeLastElement = context.getTokenBefore(lastElement); + + if (tokenBeforeLastElement.value === ",") { + + // Special case for comma-first syntax where the semicolon is indented + checkLastNodeLineIndent(node, getNodeIndent(tokenBeforeLastElement)); + } else { + checkLastNodeLineIndent(node, elementsIndent - indentSize); + } } - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- + /** + * Check and decide whether to check for indentation for blockless nodes + * Scenarios are for or while statements without braces around them + * @param {ASTNode} node node to examine + * @returns {void} + */ + function blockLessNodes(node) { + if (node.body.type !== "BlockStatement") { + blockIndentationCheck(node); + } + } - return { - "Program": function (node) { - lines = context.getSourceLines(); - linesToCheck = lines.map(function () { - return { - push: [], - pushAltLine: [], - pop: [], - check: false - }; - }); + /** + * Returns the expected indentation for the case statement + * @param {ASTNode} node node to examine + * @param {int} [switchIndent] indent for switch statement + * @returns {int} indent size + */ + function expectedCaseIndent(node, switchIndent) { + var switchNode = (node.type === "SwitchStatement") ? node : node.parent; + var caseIndent; - if (!isMultiline(node)) { - return; + if (caseIndentStore[switchNode.loc.start.line]) { + return caseIndentStore[switchNode.loc.start.line]; + } else { + if (typeof switchIndent === "undefined") { + switchIndent = getNodeIndent(switchNode); } - markChildren(node); - }, - "Program:exit": function (node) { - checkIndentations(node); - }, - - "BlockStatement": function (node) { - if (!isMultiline(node)) { - return; + if (switchNode.cases.length > 0 && options.SwitchCase === 0) { + caseIndent = switchIndent; + } else { + caseIndent = switchIndent + (indentSize * options.SwitchCase); } - markChildren(node); - markPop(node, 1); + caseIndentStore[switchNode.loc.start.line] = caseIndent; + return caseIndent; + } + } - markPushAndEndCheck(getBlockNodeToMark(node), 1); - }, + return { + "Program": function(node) { + if (node.body.length > 0) { - "IfStatement": function (node) { - markAlternateBlockStatement(node, "alternate"); + // Root nodes should have no indent + checkNodesIndent(node.body, getNodeIndent(node)); + } }, - "TryStatement": function (node) { - markAlternateBlockStatement(node, "handler"); - markAlternateBlockStatement(node, "finalizer"); - }, + "ClassBody": blockIndentationCheck, - "SwitchStatement": function (node) { - if (!isMultiline(node)) { - return; - } + "BlockStatement": blockIndentationCheck, - var indents = 1; - var children = getChildren(node); + "WhileStatement": blockLessNodes, - if (children.length && node.loc.start.column === children[0].loc.start.column) { - indents = 0; - } + "ForStatement": blockLessNodes, - markChildren(node); - markPop(node, indents); - markPushAndEndCheck(node, indents); - }, + "ForInStatement": blockLessNodes, - "SwitchCase": function (node) { - if (!options.indentSwitchCase) { - return; - } + "ForOfStatement": blockLessNodes, - if (!isMultiline(node)) { - return; - } + "DoWhileStatement": blockLessNodes, - var children = getChildren(node); + "IfStatement": function(node) { + if (node.consequent.type !== "BlockStatement" && node.consequent.loc.start.line > node.loc.start.line) { + blockIndentationCheck(node); + } + }, - if (children.length === 1 && children[0].type === "BlockStatement") { - return; + "VariableDeclaration": function(node) { + if (node.declarations[node.declarations.length - 1].loc.start.line > node.declarations[0].loc.start.line) { + checkIndentInVariableDeclarations(node); } + }, - markPush(node, 1); - markCheck(node); - markChildren(node); + "ObjectExpression": function(node) { + checkIndentInArrayOrObjectBlock(node); + }, - markCase(node, children); + "ArrayExpression": function(node) { + checkIndentInArrayOrObjectBlock(node); }, - // indentations inside of function expressions can be offset from - // either the start of the function or the end of the function, therefore - // mark all starting lines of functions as potential indentations - "FunctionDeclaration": function (node) { - markPushAlt(node); + "SwitchStatement": function(node) { + + // Switch is not a 'BlockStatement' + var switchIndent = getNodeIndent(node); + var caseIndent = expectedCaseIndent(node, switchIndent); + + checkNodesIndent(node.cases, caseIndent); + + + checkLastNodeLineIndent(node, switchIndent); }, - "FunctionExpression": function (node) { - markPushAlt(node); + + "SwitchCase": function(node) { + + // Skip inline cases + if (isSingleLineNode(node)) { + return; + } + var caseIndent = expectedCaseIndent(node); + + checkNodesIndent(node.consequent, caseIndent + indentSize); } }; @@ -470,15 +733,42 @@ module.exports.schema = [ "enum": ["tab"] }, { - "type": "integer" + "type": "integer", + "minimum": 0 } ] }, { "type": "object", "properties": { - "indentSwitchCase": { - "type": "boolean" + "SwitchCase": { + "type": "integer", + "minimum": 0 + }, + "VariableDeclarator": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "object", + "properties": { + "var": { + "type": "integer", + "minimum": 0 + }, + "let": { + "type": "integer", + "minimum": 0 + }, + "const": { + "type": "integer", + "minimum": 0 + } + } + } + ] } }, "additionalProperties": false diff --git a/tools/eslint/lib/rules/init-declarations.js b/tools/eslint/lib/rules/init-declarations.js new file mode 100644 index 00000000000000..10fbf185c160c4 --- /dev/null +++ b/tools/eslint/lib/rules/init-declarations.js @@ -0,0 +1,116 @@ +/** + * @fileoverview A rule to control the style of variable initializations. + * @author Colin Ihrig + * @copyright 2015 Colin Ihrig. All rights reserved. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given node is a for loop. + * @param {ASTNode} block - A node to check. + * @returns {boolean} `true` when the node is a for loop. + */ +function isForLoop(block) { + return block.type === "ForInStatement" || + block.type === "ForOfStatement" || + block.type === "ForStatement"; +} + +/** + * Checks whether or not a given declarator node has its initializer. + * @param {ASTNode} node - A declarator node to check. + * @returns {boolean} `true` when the node has its initializer. + */ +function isInitialized(node) { + var declaration = node.parent; + var block = declaration.parent; + + if (isForLoop(block)) { + if (block.type === "ForStatement") { + return block.init === declaration; + } + return block.left === declaration; + } + return Boolean(node.init); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + + var MODE_ALWAYS = "always", + MODE_NEVER = "never"; + + var mode = context.options[0] || MODE_ALWAYS; + var params = context.options[1] || {}; + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + "VariableDeclaration:exit": function(node) { + + var kind = node.kind, + declarations = node.declarations; + + for (var i = 0; i < declarations.length; ++i) { + var declaration = declarations[i], + id = declaration.id, + initialized = isInitialized(declaration), + isIgnoredForLoop = params.ignoreForLoopInit && isForLoop(node.parent); + + if (id.type !== "Identifier") { + continue; + } + + if (mode === MODE_ALWAYS && !initialized) { + context.report(declaration, "Variable '" + id.name + "' should be initialized on declaration."); + } else if (mode === MODE_NEVER && kind !== "const" && initialized && !isIgnoredForLoop) { + context.report(declaration, "Variable '" + id.name + "' should not be initialized on declaration."); + } + } + } + }; +}; + +module.exports.schema = { + "anyOf": [ + { + "type": "array", + "items": [ + { + "enum": ["always"] + } + ], + "minItems": 0, + "maxItems": 1 + }, + { + "type": "array", + "items": [ + { + "enum": ["never"] + }, + { + "type": "object", + "properties": { + "ignoreForLoopInit": { + "type": "boolean" + } + }, + "additionalProperties": false + } + ], + "minItems": 0, + "maxItems": 2 + } + ] +}; diff --git a/tools/eslint/lib/rules/jsx-quotes.js b/tools/eslint/lib/rules/jsx-quotes.js new file mode 100644 index 00000000000000..486aa818622901 --- /dev/null +++ b/tools/eslint/lib/rules/jsx-quotes.js @@ -0,0 +1,75 @@ +/** + * @fileoverview A rule to ensure consistent quotes used in jsx syntax. + * @author Mathias Schreck + * @copyright 2015 Mathias Schreck + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var astUtils = require("../ast-utils"); + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +var QUOTE_SETTINGS = { + "prefer-double": { + quote: "\"", + description: "singlequote", + convert: function(str) { + return str.replace(/'/g, "\""); + } + }, + "prefer-single": { + quote: "'", + description: "doublequote", + convert: function(str) { + return str.replace(/"/g, "'"); + } + } +}; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var quoteOption = context.options[0] || "prefer-double", + setting = QUOTE_SETTINGS[quoteOption]; + + /** + * Checks if the given string literal node uses the expected quotes + * @param {ASTNode} node - A string literal node. + * @returns {boolean} Whether or not the string literal used the expected quotes. + * @public + */ + function usesExpectedQuotes(node) { + return node.value.indexOf(setting.quote) !== -1 || astUtils.isSurroundedBy(node.raw, setting.quote); + } + + return { + "JSXAttribute": function(node) { + var attributeValue = node.value; + + if (attributeValue && astUtils.isStringLiteral(attributeValue) && !usesExpectedQuotes(attributeValue)) { + context.report({ + node: attributeValue, + message: "Unexpected usage of " + setting.description + ".", + fix: function(fixer) { + return fixer.replaceText(attributeValue, setting.convert(attributeValue.raw)); + } + }); + } + } + }; +}; + +module.exports.schema = [ + { + "enum": [ "prefer-single", "prefer-double" ] + } +]; diff --git a/tools/eslint/lib/rules/key-spacing.js b/tools/eslint/lib/rules/key-spacing.js index 5ba944ea4ed5e7..c317e4a2c81156 100644 --- a/tools/eslint/lib/rules/key-spacing.js +++ b/tools/eslint/lib/rules/key-spacing.js @@ -72,13 +72,43 @@ function isSingleLine(node) { return (node.loc.end.line === node.loc.start.line); } +/** Sets option values from the configured options with defaults + * @param {Object} toOptions Object to be initialized + * @param {Object} fromOptions Object to be initialized from + * @returns {Object} The object with correctly initialized options and values + */ +function initOptions(toOptions, fromOptions) { + toOptions.mode = fromOptions.mode || "strict"; + + // Set align if exists - multiLine case + if (typeof fromOptions.align !== "undefined") { + toOptions.align = fromOptions.align; + } + + // Set value of beforeColon + if (typeof fromOptions.beforeColon !== "undefined") { + toOptions.beforeColon = +fromOptions.beforeColon; + } else { + toOptions.beforeColon = 0; + } + + // Set value of afterColon + if (typeof fromOptions.afterColon !== "undefined") { + toOptions.afterColon = +fromOptions.afterColon; + } else { + toOptions.afterColon = 1; + } + + return toOptions; +} + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ var messages = { - key: "{{error}} space after {{computed}}key \"{{key}}\".", - value: "{{error}} space before value for {{computed}}key \"{{key}}\"." + key: "{{error}} space after {{computed}}key '{{key}}'.", + value: "{{error}} space before value for {{computed}}key '{{key}}'." }; module.exports = function(context) { @@ -93,9 +123,54 @@ module.exports = function(context) { */ var options = context.options[0] || {}, - align = options.align, - beforeColon = +!!options.beforeColon, // Defaults to false - afterColon = +!(options.afterColon === false); // Defaults to true + multiLineOptions = initOptions({}, (options.multiLine || options)), + singleLineOptions = initOptions({}, (options.singleLine || options)); + + /** + * Determines if the given property is key-value property. + * @param {ASTNode} property Property node to check. + * @returns {Boolean} Whether the property is a key-value property. + */ + function isKeyValueProperty(property) { + return !( + property.method || + property.shorthand || + property.kind !== "init" || + property.type !== "Property" // Could be "ExperimentalSpreadProperty" or "SpreadProperty" + ); + } + + /** + * Starting from the given a node (a property.key node here) looks forward + * until it finds the last token before a colon punctuator and returns it. + * @param {ASTNode} node The node to start looking from. + * @returns {ASTNode} The last token before a colon punctuator. + */ + function getLastTokenBeforeColon(node) { + var prevNode; + + while (node && (node.type !== "Punctuator" || node.value !== ":")) { + prevNode = node; + node = context.getTokenAfter(node); + } + + return prevNode; + } + + /** + * Starting from the given a node (a property.key node here) looks forward + * until it finds the colon punctuator and returns it. + * @param {ASTNode} node The node to start looking from. + * @returns {ASTNode} The colon punctuator. + */ + function getNextColon(node) { + + while (node && (node.type !== "Punctuator" || node.value !== ":")) { + node = context.getTokenAfter(node); + } + + return node; + } /** * Gets an object literal property's key as the identifier name or string value. @@ -119,15 +194,21 @@ module.exports = function(context) { * @param {string} side Side being verified - either "key" or "value". * @param {string} whitespace Actual whitespace string. * @param {int} expected Expected whitespace length. + * @param {string} mode Value of the mode as "strict" or "minimum" * @returns {void} */ - function report(property, side, whitespace, expected) { + function report(property, side, whitespace, expected, mode) { var diff = whitespace.length - expected, key = property.key, - firstTokenAfterColon = context.getTokenAfter(key, 1), + firstTokenAfterColon = context.getTokenAfter(getNextColon(key)), location = side === "key" ? key.loc.start : firstTokenAfterColon.loc.start; - if (diff && !(expected && containsLineTerminator(whitespace))) { + if (( + diff && mode === "strict" || + diff < 0 && mode === "minimum" || + diff > 0 && !expected && mode === "minimum") && + !(expected && containsLineTerminator(whitespace)) + ) { context.report(property[side], location, messages[side], { error: diff > 0 ? "Extra" : "Missing", computed: property.computed ? "computed " : "", @@ -143,26 +224,12 @@ module.exports = function(context) { * @returns {int} Width of the key. */ function getKeyWidth(property) { - var key = property.key, - startToken, endToken; - - // [computed]: value - if (property.computed) { - startToken = context.getTokenBefore(key); - endToken = context.getTokenAfter(key); - return endToken.range[1] - startToken.range[0]; - } + var startToken, endToken; - // name: value - if (key.type === "Identifier") { - return key.name.length; - } + startToken = context.getFirstToken(property); + endToken = getLastTokenBeforeColon(property.key); - // "literal": value - // 42: value - if (key.type === "Literal") { - return key.raw.length; - } + return endToken.range[1] - startToken.range[0]; } /** @@ -181,6 +248,7 @@ module.exports = function(context) { afterColon: whitespace[2] }; } + return null; } /** @@ -204,7 +272,9 @@ module.exports = function(context) { } return groups; - }, [[]]); + }, [ + [] + ]); } /** @@ -216,7 +286,11 @@ module.exports = function(context) { var length = properties.length, widths = properties.map(getKeyWidth), // Width of keys, including quotes targetWidth = Math.max.apply(null, widths), - i, property, whitespace, width; + i, property, whitespace, width, + align = multiLineOptions.align, + beforeColon = multiLineOptions.beforeColon, + afterColon = multiLineOptions.afterColon, + mode = multiLineOptions.mode; // Conditionally include one space before or after colon targetWidth += (align === "colon" ? beforeColon : afterColon); @@ -224,19 +298,16 @@ module.exports = function(context) { for (i = 0; i < length; i++) { property = properties[i]; whitespace = getPropertyWhitespace(property); - - if (!whitespace) { - continue; // Object literal getters/setters lack a colon - } - - width = widths[i]; - - if (align === "value") { - report(property, "key", whitespace.beforeColon, beforeColon); - report(property, "value", whitespace.afterColon, targetWidth - width); - } else { // align = "colon" - report(property, "key", whitespace.beforeColon, targetWidth - width); - report(property, "value", whitespace.afterColon, afterColon); + if (whitespace) { // Object literal getters/setters lack a colon + width = widths[i]; + + if (align === "value") { + report(property, "key", whitespace.beforeColon, beforeColon, mode); + report(property, "value", whitespace.afterColon, targetWidth - width, mode); + } else { // align = "colon" + report(property, "key", whitespace.beforeColon, targetWidth - width, mode); + report(property, "value", whitespace.afterColon, afterColon, mode); + } } } } @@ -248,20 +319,22 @@ module.exports = function(context) { */ function verifyAlignment(node) { createGroups(node).forEach(function(group) { - verifyGroupAlignment(group); + verifyGroupAlignment(group.filter(isKeyValueProperty)); }); } /** * Verifies spacing of property conforms to specified options. * @param {ASTNode} node Property node being evaluated. + * @param {Object} lineOptions Configured singleLine or multiLine options * @returns {void} */ - function verifySpacing(node) { - var whitespace = getPropertyWhitespace(node); - if (whitespace) { // Object literal getters/setters lack colons - report(node, "key", whitespace.beforeColon, beforeColon); - report(node, "value", whitespace.afterColon, afterColon); + function verifySpacing(node, lineOptions) { + var actual = getPropertyWhitespace(node); + + if (actual) { // Object literal getters/setters lack colons + report(node, "key", actual.beforeColon, lineOptions.beforeColon, lineOptions.mode); + report(node, "value", actual.afterColon, lineOptions.afterColon, lineOptions.mode); } } @@ -274,7 +347,7 @@ module.exports = function(context) { var length = properties.length; for (var i = 0; i < length; i++) { - verifySpacing(properties[i]); + verifySpacing(properties[i], singleLineOptions); } } @@ -282,23 +355,23 @@ module.exports = function(context) { // Public API //-------------------------------------------------------------------------- - if (align) { // Verify vertical alignment + if (multiLineOptions.align) { // Verify vertical alignment return { "ObjectExpression": function(node) { if (isSingleLine(node)) { - verifyListSpacing(node.properties); + verifyListSpacing(node.properties.filter(isKeyValueProperty)); } else { verifyAlignment(node); } } }; - } else { // Strictly obey beforeColon and afterColon in each property + } else { // Obey beforeColon and afterColon in each property as configured return { - "Property": function (node) { - verifySpacing(node); + "Property": function(node) { + verifySpacing(node, isSingleLine(node.parent) ? singleLineOptions : multiLineOptions); } }; @@ -306,20 +379,64 @@ module.exports = function(context) { }; -module.exports.schema = [ - { - "type": "object", - "properties": { - "align": { - "enum": ["colon", "value"] - }, - "beforeColon": { - "type": "boolean" +module.exports.schema = [{ + "anyOf": [ + { + "type": "object", + "properties": { + "align": { + "enum": ["colon", "value"] + }, + "mode": { + "enum": ["strict", "minimum"] + }, + "beforeColon": { + "type": "boolean" + }, + "afterColon": { + "type": "boolean" + } }, - "afterColon": { - "type": "boolean" - } + "additionalProperties": false }, - "additionalProperties": false - } -]; + { + "type": "object", + "properties": { + "singleLine": { + "type": "object", + "properties": { + "mode": { + "enum": ["strict", "minimum"] + }, + "beforeColon": { + "type": "boolean" + }, + "afterColon": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "multiLine": { + "type": "object", + "properties": { + "align": { + "enum": ["colon", "value"] + }, + "mode": { + "enum": ["strict", "minimum"] + }, + "beforeColon": { + "type": "boolean" + }, + "afterColon": { + "type": "boolean" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] +}]; diff --git a/tools/eslint/lib/rules/keyword-spacing.js b/tools/eslint/lib/rules/keyword-spacing.js new file mode 100644 index 00000000000000..2630b46f9684c2 --- /dev/null +++ b/tools/eslint/lib/rules/keyword-spacing.js @@ -0,0 +1,534 @@ +/** + * @fileoverview Rule to enforce spacing before and after keywords. + * @author Toru Nagashima + * @copyright 2015 Toru Nagashima. All rights reserved. + * See LICENSE file in root directory for full license. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var astUtils = require("../ast-utils"), + keywords = require("../util/keywords"); + +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +var PREV_TOKEN = /^[\)\]\}>]$/; +var NEXT_TOKEN = /^(?:[\(\[\{<~!]|\+\+?|--?)$/; +var PREV_TOKEN_M = /^[\)\]\}>*]$/; +var NEXT_TOKEN_M = /^[\{*]$/; +var TEMPLATE_OPEN_PAREN = /\$\{$/; +var TEMPLATE_CLOSE_PAREN = /^\}/; +var CHECK_TYPE = /^(?:JSXElement|RegularExpression|String|Template)$/; +var KEYS = keywords.concat(["as", "await", "from", "get", "let", "of", "set", "yield"]); + +// check duplications. +(function() { + KEYS.sort(); + for (var i = 1; i < KEYS.length; ++i) { + if (KEYS[i] === KEYS[i - 1]) { + throw new Error("Duplication was found in the keyword list: " + KEYS[i]); + } + } +}()); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given token is a "Template" token ends with "${". + * + * @param {Token} token - A token to check. + * @returns {boolean} `true` if the token is a "Template" token ends with "${". + */ +function isOpenParenOfTemplate(token) { + return token.type === "Template" && TEMPLATE_OPEN_PAREN.test(token.value); +} + +/** + * Checks whether or not a given token is a "Template" token starts with "}". + * + * @param {Token} token - A token to check. + * @returns {boolean} `true` if the token is a "Template" token starts with "}". + */ +function isCloseParenOfTemplate(token) { + return token.type === "Template" && TEMPLATE_CLOSE_PAREN.test(token.value); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var sourceCode = context.getSourceCode(); + + /** + * Reports a given token if there are not space(s) before the token. + * + * @param {Token} token - A token to report. + * @param {RegExp|undefined} pattern - Optional. A pattern of the previous + * token to check. + * @returns {void} + */ + function expectSpaceBefore(token, pattern) { + pattern = pattern || PREV_TOKEN; + + var prevToken = sourceCode.getTokenBefore(token); + + if (prevToken && + (CHECK_TYPE.test(prevToken.type) || pattern.test(prevToken.value)) && + !isOpenParenOfTemplate(prevToken) && + astUtils.isTokenOnSameLine(prevToken, token) && + !sourceCode.isSpaceBetweenTokens(prevToken, token) + ) { + context.report({ + loc: token.loc.start, + message: "Expected space(s) before \"{{value}}\".", + data: token, + fix: function(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } + } + + /** + * Reports a given token if there are space(s) before the token. + * + * @param {Token} token - A token to report. + * @param {RegExp|undefined} pattern - Optional. A pattern of the previous + * token to check. + * @returns {void} + */ + function unexpectSpaceBefore(token, pattern) { + pattern = pattern || PREV_TOKEN; + + var prevToken = sourceCode.getTokenBefore(token); + + if (prevToken && + (CHECK_TYPE.test(prevToken.type) || pattern.test(prevToken.value)) && + !isOpenParenOfTemplate(prevToken) && + astUtils.isTokenOnSameLine(prevToken, token) && + sourceCode.isSpaceBetweenTokens(prevToken, token) + ) { + context.report({ + loc: token.loc.start, + message: "Unexpected space(s) before \"{{value}}\".", + data: token, + fix: function(fixer) { + return fixer.removeRange([prevToken.range[1], token.range[0]]); + } + }); + } + } + + /** + * Reports a given token if there are not space(s) after the token. + * + * @param {Token} token - A token to report. + * @param {RegExp|undefined} pattern - Optional. A pattern of the next + * token to check. + * @returns {void} + */ + function expectSpaceAfter(token, pattern) { + pattern = pattern || NEXT_TOKEN; + + var nextToken = sourceCode.getTokenAfter(token); + + if (nextToken && + (CHECK_TYPE.test(nextToken.type) || pattern.test(nextToken.value)) && + !isCloseParenOfTemplate(nextToken) && + astUtils.isTokenOnSameLine(token, nextToken) && + !sourceCode.isSpaceBetweenTokens(token, nextToken) + ) { + context.report({ + loc: token.loc.start, + message: "Expected space(s) after \"{{value}}\".", + data: token, + fix: function(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } + } + + /** + * Reports a given token if there are space(s) after the token. + * + * @param {Token} token - A token to report. + * @param {RegExp|undefined} pattern - Optional. A pattern of the next + * token to check. + * @returns {void} + */ + function unexpectSpaceAfter(token, pattern) { + pattern = pattern || NEXT_TOKEN; + + var nextToken = sourceCode.getTokenAfter(token); + + if (nextToken && + (CHECK_TYPE.test(nextToken.type) || pattern.test(nextToken.value)) && + !isCloseParenOfTemplate(nextToken) && + astUtils.isTokenOnSameLine(token, nextToken) && + sourceCode.isSpaceBetweenTokens(token, nextToken) + ) { + context.report({ + loc: token.loc.start, + message: "Unexpected space(s) after \"{{value}}\".", + data: token, + fix: function(fixer) { + return fixer.removeRange([token.range[1], nextToken.range[0]]); + } + }); + } + } + + /** + * Parses the option object and determines check methods for each keyword. + * + * @param {object|undefined} options - The option object to parse. + * @returns {object} - Normalized option object. + * Keys are keywords (there are for every keyword). + * Values are instances of `{"before": function, "after": function}`. + */ + function parseOptions(options) { + var before = !options || options.before !== false; + var after = !options || options.after !== false; + var defaultValue = { + before: before ? expectSpaceBefore : unexpectSpaceBefore, + after: after ? expectSpaceAfter : unexpectSpaceAfter + }; + var overrides = (options && options.overrides) || {}; + var retv = Object.create(null); + + for (var i = 0; i < KEYS.length; ++i) { + var key = KEYS[i]; + var override = overrides[key]; + + if (override) { + var thisBefore = ("before" in override) ? override.before : before; + var thisAfter = ("after" in override) ? override.after : after; + + retv[key] = { + before: thisBefore ? expectSpaceBefore : unexpectSpaceBefore, + after: thisAfter ? expectSpaceAfter : unexpectSpaceAfter + }; + } else { + retv[key] = defaultValue; + } + } + + return retv; + } + + var checkMethodMap = parseOptions(context.options[0]); + + /** + * Reports a given token if usage of spacing followed by the token is + * invalid. + * + * @param {Token} token - A token to report. + * @param {RegExp|undefined} pattern - Optional. A pattern of the previous + * token to check. + * @returns {void} + */ + function checkSpacingBefore(token, pattern) { + checkMethodMap[token.value].before(token, pattern); + } + + /** + * Reports a given token if usage of spacing preceded by the token is + * invalid. + * + * @param {Token} token - A token to report. + * @param {RegExp|undefined} pattern - Optional. A pattern of the next + * token to check. + * @returns {void} + */ + function checkSpacingAfter(token, pattern) { + checkMethodMap[token.value].after(token, pattern); + } + + /** + * Reports a given token if usage of spacing around the token is invalid. + * + * @param {Token} token - A token to report. + * @returns {void} + */ + function checkSpacingAround(token) { + checkSpacingBefore(token); + checkSpacingAfter(token); + } + + /** + * Reports the first token of a given node if the first token is a keyword + * and usage of spacing around the token is invalid. + * + * @param {ASTNode|null} node - A node to report. + * @returns {void} + */ + function checkSpacingAroundFirstToken(node) { + var firstToken = node && sourceCode.getFirstToken(node); + + if (firstToken && firstToken.type === "Keyword") { + checkSpacingAround(firstToken); + } + } + + /** + * Reports the first token of a given node if the first token is a keyword + * and usage of spacing followed by the token is invalid. + * + * This is used for unary operators (e.g. `typeof`), `function`, and `super`. + * Other rules are handling usage of spacing preceded by those keywords. + * + * @param {ASTNode|null} node - A node to report. + * @returns {void} + */ + function checkSpacingBeforeFirstToken(node) { + var firstToken = node && sourceCode.getFirstToken(node); + + if (firstToken && firstToken.type === "Keyword") { + checkSpacingBefore(firstToken); + } + } + + /** + * Reports the previous token of a given node if the token is a keyword and + * usage of spacing around the token is invalid. + * + * @param {ASTNode|null} node - A node to report. + * @returns {void} + */ + function checkSpacingAroundTokenBefore(node) { + if (node) { + var token = sourceCode.getTokenBefore(node); + + while (token.type !== "Keyword") { + token = sourceCode.getTokenBefore(token); + } + + checkSpacingAround(token); + } + } + + /** + * Reports `class` and `extends` keywords of a given node if usage of + * spacing around those keywords is invalid. + * + * @param {ASTNode} node - A node to report. + * @returns {void} + */ + function checkSpacingForClass(node) { + checkSpacingAroundFirstToken(node); + checkSpacingAroundTokenBefore(node.superClass); + } + + /** + * Reports `if` and `else` keywords of a given node if usage of spacing + * around those keywords is invalid. + * + * @param {ASTNode} node - A node to report. + * @returns {void} + */ + function checkSpacingForIfStatement(node) { + checkSpacingAroundFirstToken(node); + checkSpacingAroundTokenBefore(node.alternate); + } + + /** + * Reports `try`, `catch`, and `finally` keywords of a given node if usage + * of spacing around those keywords is invalid. + * + * @param {ASTNode} node - A node to report. + * @returns {void} + */ + function checkSpacingForTryStatement(node) { + checkSpacingAroundFirstToken(node); + checkSpacingAroundFirstToken(node.handler); + checkSpacingAroundTokenBefore(node.finalizer); + } + + /** + * Reports `do` and `while` keywords of a given node if usage of spacing + * around those keywords is invalid. + * + * @param {ASTNode} node - A node to report. + * @returns {void} + */ + function checkSpacingForDoWhileStatement(node) { + checkSpacingAroundFirstToken(node); + checkSpacingAroundTokenBefore(node.test); + } + + /** + * Reports `for` and `in` keywords of a given node if usage of spacing + * around those keywords is invalid. + * + * @param {ASTNode} node - A node to report. + * @returns {void} + */ + function checkSpacingForForInStatement(node) { + checkSpacingAroundFirstToken(node); + checkSpacingAroundTokenBefore(node.right); + } + + /** + * Reports `for` and `of` keywords of a given node if usage of spacing + * around those keywords is invalid. + * + * @param {ASTNode} node - A node to report. + * @returns {void} + */ + function checkSpacingForForOfStatement(node) { + checkSpacingAroundFirstToken(node); + + // `of` is not a keyword token. + var token = sourceCode.getTokenBefore(node.right); + + while (token.value !== "of") { + token = sourceCode.getTokenBefore(token); + } + checkSpacingAround(token); + } + + /** + * Reports `import`, `export`, `as`, and `from` keywords of a given node if + * usage of spacing around those keywords is invalid. + * + * This rule handles the `*` token in module declarations. + * + * import*as A from "./a"; /*error Expected space(s) after "import". + * error Expected space(s) before "as". + * + * @param {ASTNode} node - A node to report. + * @returns {void} + */ + function checkSpacingForModuleDeclaration(node) { + var firstToken = sourceCode.getFirstToken(node); + + checkSpacingBefore(firstToken, PREV_TOKEN_M); + checkSpacingAfter(firstToken, NEXT_TOKEN_M); + + if (node.source) { + var fromToken = sourceCode.getTokenBefore(node.source); + + checkSpacingBefore(fromToken, PREV_TOKEN_M); + checkSpacingAfter(fromToken, NEXT_TOKEN_M); + } + } + + /** + * Reports `as` keyword of a given node if usage of spacing around this + * keyword is invalid. + * + * @param {ASTNode} node - A node to report. + * @returns {void} + */ + function checkSpacingForImportNamespaceSpecifier(node) { + var asToken = sourceCode.getFirstToken(node, 1); + + checkSpacingBefore(asToken, PREV_TOKEN_M); + } + + /** + * Reports `static`, `get`, and `set` keywords of a given node if usage of + * spacing around those keywords is invalid. + * + * @param {ASTNode} node - A node to report. + * @returns {void} + */ + function checkSpacingForProperty(node) { + if (node.static) { + checkSpacingAroundFirstToken(node); + } + if (node.kind === "get" || node.kind === "set") { + var token = sourceCode.getFirstToken( + node, + node.static ? 1 : 0 + ); + + checkSpacingAround(token); + } + } + + return { + + // Statements + DebuggerStatement: checkSpacingAroundFirstToken, + WithStatement: checkSpacingAroundFirstToken, + + // Statements - Control flow + BreakStatement: checkSpacingAroundFirstToken, + ContinueStatement: checkSpacingAroundFirstToken, + ReturnStatement: checkSpacingAroundFirstToken, + ThrowStatement: checkSpacingAroundFirstToken, + TryStatement: checkSpacingForTryStatement, + + // Statements - Choice + IfStatement: checkSpacingForIfStatement, + SwitchStatement: checkSpacingAroundFirstToken, + SwitchCase: checkSpacingAroundFirstToken, + + // Statements - Loops + DoWhileStatement: checkSpacingForDoWhileStatement, + ForInStatement: checkSpacingForForInStatement, + ForOfStatement: checkSpacingForForOfStatement, + ForStatement: checkSpacingAroundFirstToken, + WhileStatement: checkSpacingAroundFirstToken, + + // Statements - Declarations + ClassDeclaration: checkSpacingForClass, + ExportNamedDeclaration: checkSpacingForModuleDeclaration, + ExportDefaultDeclaration: checkSpacingAroundFirstToken, + ExportAllDeclaration: checkSpacingForModuleDeclaration, + FunctionDeclaration: checkSpacingBeforeFirstToken, + ImportDeclaration: checkSpacingForModuleDeclaration, + VariableDeclaration: checkSpacingAroundFirstToken, + + // Expressions + ClassExpression: checkSpacingForClass, + FunctionExpression: checkSpacingBeforeFirstToken, + NewExpression: checkSpacingBeforeFirstToken, + Super: checkSpacingBeforeFirstToken, + ThisExpression: checkSpacingBeforeFirstToken, + UnaryExpression: checkSpacingBeforeFirstToken, + YieldExpression: checkSpacingBeforeFirstToken, + + // Others + ImportNamespaceSpecifier: checkSpacingForImportNamespaceSpecifier, + MethodDefinition: checkSpacingForProperty, + Property: checkSpacingForProperty + }; +}; + +module.exports.schema = [ + { + "type": "object", + "properties": { + "before": {"type": "boolean"}, + "after": {"type": "boolean"}, + "overrides": { + "type": "object", + "properties": KEYS.reduce(function(retv, key) { + retv[key] = { + "type": "object", + "properties": { + "before": {"type": "boolean"}, + "after": {"type": "boolean"} + }, + "additionalProperties": false + }; + return retv; + }, {}), + "additionalProperties": false + } + }, + "additionalProperties": false + } +]; diff --git a/tools/eslint/lib/rules/linebreak-style.js b/tools/eslint/lib/rules/linebreak-style.js index b9afe7a4ba7965..7643ea77109739 100644 --- a/tools/eslint/lib/rules/linebreak-style.js +++ b/tools/eslint/lib/rules/linebreak-style.js @@ -1,5 +1,5 @@ /** - * @fileoverview Rule to forbid mixing LF and LFCR line breaks. + * @fileoverview Rule to enforce a single linebreak style. * @author Erik Mueller * @copyright 2015 Varun Verma. All rights reserverd. * @copyright 2015 James Whitney. All rights reserved. @@ -12,26 +12,62 @@ // Rule Definition //------------------------------------------------------------------------------ -module.exports = function (context) { +module.exports = function(context) { + var EXPECTED_LF_MSG = "Expected linebreaks to be 'LF' but found 'CRLF'.", EXPECTED_CRLF_MSG = "Expected linebreaks to be 'CRLF' but found 'LF'."; + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Builds a fix function that replaces text at the specified range in the source text. + * @param {int[]} range The range to replace + * @param {string} text The text to insert. + * @returns {function} Fixer function + * @private + */ + function createFix(range, text) { + return function(fixer) { + return fixer.replaceTextRange(range, text); + }; + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + return { "Program": function checkForlinebreakStyle(node) { var linebreakStyle = context.options[0] || "unix", expectedLF = linebreakStyle === "unix", - linebreaks = context.getSource().match(/\r\n|\r|\n|\u2028|\u2029/g), - lineOfError = -1; + expectedLFChars = expectedLF ? "\n" : "\r\n", + source = context.getSource(), + pattern = /\r\n|\r|\n|\u2028|\u2029/g, + match, + index, + range; - if (linebreaks !== null) { - lineOfError = linebreaks.indexOf(expectedLF ? "\r\n" : "\n"); - } + var i = 0; + + while ((match = pattern.exec(source)) !== null) { + i++; + if (match[0] === expectedLFChars) { + continue; + } - if (lineOfError !== -1) { - context.report(node, { - line: lineOfError + 1, - column: context.getSourceLines()[lineOfError].length - }, expectedLF ? EXPECTED_LF_MSG : EXPECTED_CRLF_MSG); + index = match.index; + range = [index, index + match[0].length]; + context.report({ + node: node, + loc: { + line: i, + column: context.getSourceLines()[i - 1].length + }, + message: expectedLF ? EXPECTED_LF_MSG : EXPECTED_CRLF_MSG, + fix: createFix(range, expectedLFChars) + }); } } }; diff --git a/tools/eslint/lib/rules/lines-around-comment.js b/tools/eslint/lib/rules/lines-around-comment.js index 655d83765923dd..16d220c954241c 100644 --- a/tools/eslint/lib/rules/lines-around-comment.js +++ b/tools/eslint/lib/rules/lines-around-comment.js @@ -1,10 +1,22 @@ /** * @fileoverview Enforces empty lines around comments. * @author Jamund Ferguson + * @copyright 2015 Mathieu M-Gosselin. All rights reserved. * @copyright 2015 Jamund Ferguson. All rights reserved. + * @copyright 2015 Gyandeep Singh. All rights reserved. */ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + /** * Return an array with with any line numbers that are empty. * @param {Array} lines An array of each line of the file. @@ -21,6 +33,7 @@ function getEmptyLineNums(lines) { }).map(function(line) { return line.num; }); + return emptyLines; } @@ -31,9 +44,11 @@ function getEmptyLineNums(lines) { */ function getCommentLineNums(comments) { var lines = []; - comments.forEach(function (token) { + + comments.forEach(function(token) { var start = token.loc.start.line; var end = token.loc.end.line; + lines.push(start, end); }); return lines; @@ -55,7 +70,8 @@ function contains(val, array) { module.exports = function(context) { - var options = context.options[0] || {}; + var options = context.options[0] ? lodash.assign({}, context.options[0]) : {}; + options.beforeLineComment = options.beforeLineComment || false; options.afterLineComment = options.afterLineComment || false; options.beforeBlockComment = typeof options.beforeBlockComment !== "undefined" ? options.beforeBlockComment : true; @@ -63,60 +79,140 @@ module.exports = function(context) { options.allowBlockStart = options.allowBlockStart || false; options.allowBlockEnd = options.allowBlockEnd || false; + var sourceCode = context.getSourceCode(); + /** - * Returns whether or not comments are not on lines starting with or ending with code + * Returns whether or not comments are on lines starting with or ending with code * @param {ASTNode} node The comment node to check. * @returns {boolean} True if the comment is not alone. */ function codeAroundComment(node) { + var token; - var lines = context.getSourceLines(); + token = node; + do { + token = sourceCode.getTokenOrCommentBefore(token); + } while (token && (token.type === "Block" || token.type === "Line")); - // Get the whole line and cut it off at the start of the comment - var startLine = lines[node.loc.start.line - 1]; - var endLine = lines[node.loc.end.line - 1]; + if (token && token.loc.end.line === node.loc.start.line) { + return true; + } - var preamble = startLine.slice(0, node.loc.start.column).trim(); + token = node; + do { + token = sourceCode.getTokenOrCommentAfter(token); + } while (token && (token.type === "Block" || token.type === "Line")); - // Also check after the comment - var postamble = endLine.slice(node.loc.end.column).trim(); + if (token && token.loc.start.line === node.loc.end.line) { + return true; + } - // Should be false if there was only whitespace around the comment - return !!(preamble || postamble); + return false; } /** - * Returns whether or not comments are at the block start or not. + * Returns whether or not comments are inside a node type or not. * @param {ASTNode} node The Comment node. - * @returns {boolean} True if the comment is at block start. + * @param {ASTNode} parent The Comment parent node. + * @param {string} nodeType The parent type to check against. + * @returns {boolean} True if the comment is inside nodeType. */ - function isCommentAtBlockStart(node) { + function isCommentInsideNodeType(node, parent, nodeType) { + return parent.type === nodeType || + (parent.body && parent.body.type === nodeType) || + (parent.consequent && parent.consequent.type === nodeType); + } + + /** + * Returns whether or not comments are at the parent start or not. + * @param {ASTNode} node The Comment node. + * @param {string} nodeType The parent type to check against. + * @returns {boolean} True if the comment is at parent start. + */ + function isCommentAtParentStart(node, nodeType) { var ancestors = context.getAncestors(); var parent; if (ancestors.length) { parent = ancestors.pop(); } - return parent && (parent.type === "BlockStatement" || parent.body.type === "BlockStatement") && + + return parent && isCommentInsideNodeType(node, parent, nodeType) && node.loc.start.line - parent.loc.start.line === 1; } /** - * Returns whether or not comments are at the block end or not. + * Returns whether or not comments are at the parent end or not. * @param {ASTNode} node The Comment node. - * @returns {boolean} True if the comment is at block end. + * @param {string} nodeType The parent type to check against. + * @returns {boolean} True if the comment is at parent end. */ - function isCommentAtBlockEnd(node) { + function isCommentAtParentEnd(node, nodeType) { var ancestors = context.getAncestors(); var parent; if (ancestors.length) { parent = ancestors.pop(); } - return parent && (parent.type === "BlockStatement" || parent.body.type === "BlockStatement") && + + return parent && isCommentInsideNodeType(node, parent, nodeType) && parent.loc.end.line - node.loc.end.line === 1; } + /** + * Returns whether or not comments are at the block start or not. + * @param {ASTNode} node The Comment node. + * @returns {boolean} True if the comment is at block start. + */ + function isCommentAtBlockStart(node) { + return isCommentAtParentStart(node, "ClassBody") || isCommentAtParentStart(node, "BlockStatement") || isCommentAtParentStart(node, "SwitchCase"); + } + + /** + * Returns whether or not comments are at the block end or not. + * @param {ASTNode} node The Comment node. + * @returns {boolean} True if the comment is at block end. + */ + function isCommentAtBlockEnd(node) { + return isCommentAtParentEnd(node, "ClassBody") || isCommentAtParentEnd(node, "BlockStatement") || isCommentAtParentEnd(node, "SwitchCase") || isCommentAtParentEnd(node, "SwitchStatement"); + } + + /** + * Returns whether or not comments are at the object start or not. + * @param {ASTNode} node The Comment node. + * @returns {boolean} True if the comment is at object start. + */ + function isCommentAtObjectStart(node) { + return isCommentAtParentStart(node, "ObjectExpression") || isCommentAtParentStart(node, "ObjectPattern"); + } + + /** + * Returns whether or not comments are at the object end or not. + * @param {ASTNode} node The Comment node. + * @returns {boolean} True if the comment is at object end. + */ + function isCommentAtObjectEnd(node) { + return isCommentAtParentEnd(node, "ObjectExpression") || isCommentAtParentEnd(node, "ObjectPattern"); + } + + /** + * Returns whether or not comments are at the array start or not. + * @param {ASTNode} node The Comment node. + * @returns {boolean} True if the comment is at array start. + */ + function isCommentAtArrayStart(node) { + return isCommentAtParentStart(node, "ArrayExpression") || isCommentAtParentStart(node, "ArrayPattern"); + } + + /** + * Returns whether or not comments are at the array end or not. + * @param {ASTNode} node The Comment node. + * @returns {boolean} True if the comment is at array end. + */ + function isCommentAtArrayEnd(node) { + return isCommentAtParentEnd(node, "ArrayExpression") || isCommentAtParentEnd(node, "ArrayPattern"); + } + /** * Checks if a comment node has lines around it (ignores inline comments) * @param {ASTNode} node The Comment node. @@ -142,7 +238,14 @@ module.exports = function(context) { commentIsNotAlone = codeAroundComment(node); var blockStartAllowed = options.allowBlockStart && isCommentAtBlockStart(node), - blockEndAllowed = options.allowBlockEnd && isCommentAtBlockEnd(node); + blockEndAllowed = options.allowBlockEnd && isCommentAtBlockEnd(node), + objectStartAllowed = options.allowObjectStart && isCommentAtObjectStart(node), + objectEndAllowed = options.allowObjectEnd && isCommentAtObjectEnd(node), + arrayStartAllowed = options.allowArrayStart && isCommentAtArrayStart(node), + arrayEndAllowed = options.allowArrayEnd && isCommentAtArrayEnd(node); + + var exceptionStartAllowed = blockStartAllowed || objectStartAllowed || arrayStartAllowed; + var exceptionEndAllowed = blockEndAllowed || objectEndAllowed || arrayEndAllowed; // ignore top of the file and bottom of the file if (prevLineNum < 1) { @@ -158,12 +261,12 @@ module.exports = function(context) { } // check for newline before - if (!blockStartAllowed && before && !contains(prevLineNum, commentAndEmptyLines)) { + if (!exceptionStartAllowed && before && !contains(prevLineNum, commentAndEmptyLines)) { context.report(node, "Expected line before comment."); } // check for newline after - if (!blockEndAllowed && after && !contains(nextLineNum, commentAndEmptyLines)) { + if (!exceptionEndAllowed && after && !contains(nextLineNum, commentAndEmptyLines)) { context.report(node, "Expected line after comment."); } @@ -217,6 +320,18 @@ module.exports.schema = [ }, "allowBlockEnd": { "type": "boolean" + }, + "allowObjectStart": { + "type": "boolean" + }, + "allowObjectEnd": { + "type": "boolean" + }, + "allowArrayStart": { + "type": "boolean" + }, + "allowArrayEnd": { + "type": "boolean" } }, "additionalProperties": false diff --git a/tools/eslint/lib/rules/max-depth.js b/tools/eslint/lib/rules/max-depth.js index 5b630ed2e5a650..22fa2f5f0b27f1 100644 --- a/tools/eslint/lib/rules/max-depth.js +++ b/tools/eslint/lib/rules/max-depth.js @@ -17,16 +17,43 @@ module.exports = function(context) { //-------------------------------------------------------------------------- var functionStack = [], - maxDepth = context.options[0] || 4; + option = context.options[0], + maxDepth = 4; + if (typeof option === "object" && option.hasOwnProperty("maximum") && typeof option.maximum === "number") { + maxDepth = option.maximum; + } + if (typeof option === "object" && option.hasOwnProperty("max") && typeof option.max === "number") { + maxDepth = option.max; + } + if (typeof option === "number") { + maxDepth = option; + } + + /** + * When parsing a new function, store it in our function stack + * @returns {void} + * @private + */ function startFunction() { functionStack.push(0); } + /** + * When parsing is done then pop out the reference + * @returns {void} + * @private + */ function endFunction() { functionStack.pop(); } + /** + * Save the block and Evaluate the node + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ function pushBlock(node) { var len = ++functionStack[functionStack.length - 1]; @@ -36,6 +63,11 @@ module.exports = function(context) { } } + /** + * Pop the saved block + * @returns {void} + * @private + */ function popBlock() { functionStack[functionStack.length - 1]--; } @@ -84,6 +116,25 @@ module.exports = function(context) { module.exports.schema = [ { - "type": "integer" + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "object", + "properties": { + "maximum": { + "type": "integer", + "minimum": 0 + }, + "max": { + "type": "integer", + "minimum": 0 + } + }, + "additionalProperties": false + } + ] } ]; diff --git a/tools/eslint/lib/rules/max-len.js b/tools/eslint/lib/rules/max-len.js index 8d0400dcea64c1..610cdf2bacfd3a 100644 --- a/tools/eslint/lib/rules/max-len.js +++ b/tools/eslint/lib/rules/max-len.js @@ -12,43 +12,176 @@ module.exports = function(context) { + /* + * Inspired by http://tools.ietf.org/html/rfc3986#appendix-B, however: + * - They're matching an entire string that we know is a URI + * - We're matching part of a string where we think there *might* be a URL + * - We're only concerned about URLs, as picking out any URI would cause + * too many false positives + * - We don't care about matching the entire URL, any small segment is fine + */ + var URL_REGEXP = /[^:/?#]:\/\/[^?#]/; + /** - * Creates a string that is made up of repeating a given string a certain - * number of times. This uses exponentiation of squares to achieve significant - * performance gains over the more traditional implementation of such - * functionality. - * @param {string} str The string to repeat. - * @param {int} num The number of times to repeat the string. - * @returns {string} The created string. + * Computes the length of a line that may contain tabs. The width of each + * tab will be the number of spaces to the next tab stop. + * @param {string} line The line. + * @param {int} tabWidth The width of each tab stop in spaces. + * @returns {int} The computed line length. * @private */ - function stringRepeat(str, num) { - var result = ""; - for (num |= 0; num > 0; num >>>= 1, str += str) { - if (num & 1) { - result += str; - } - } - return result; + function computeLineLength(line, tabWidth) { + var extraCharacterCount = 0; + + line.replace(/\t/g, function(match, offset) { + var totalOffset = offset + extraCharacterCount, + previousTabStopOffset = tabWidth ? totalOffset % tabWidth : 0, + spaceCount = tabWidth - previousTabStopOffset; + + extraCharacterCount += spaceCount - 1; // -1 for the replaced tab + }); + return line.length + extraCharacterCount; } - var tabWidth = context.options[1] || 4; + // The options object must be the last option specified… + var lastOption = context.options[context.options.length - 1]; + var options = typeof lastOption === "object" ? Object.create(lastOption) : {}; - var maxLength = context.options[0] || 80, - tabString = stringRepeat(" ", tabWidth); + // …but max code length… + if (typeof context.options[0] === "number") { + options.code = context.options[0]; + } + + // …and tabWidth can be optionally specified directly as integers. + if (typeof context.options[1] === "number") { + options.tabWidth = context.options[1]; + } + + var maxLength = options.code || 80, + tabWidth = options.tabWidth || 4, + ignorePattern = options.ignorePattern || null, + ignoreComments = options.ignoreComments || false, + ignoreTrailingComments = options.ignoreTrailingComments || options.ignoreComments || false, + ignoreUrls = options.ignoreUrls || false, + maxCommentLength = options.comments; + + if (ignorePattern) { + ignorePattern = new RegExp(ignorePattern); + } //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- + + /** + * Tells if a given comment is trailing: it starts on the current line and + * extends to or past the end of the current line. + * @param {string} line The source line we want to check for a trailing comment on + * @param {number} lineNumber The one-indexed line number for line + * @param {ASTNode} comment The comment to inspect + * @returns {boolean} If the comment is trailing on the given line + */ + function isTrailingComment(line, lineNumber, comment) { + return comment && + (comment.loc.start.line === lineNumber && lineNumber <= comment.loc.end.line) && + (comment.loc.end.line > lineNumber || comment.loc.end.column === line.length); + } + + /** + * Tells if a comment encompasses the entire line. + * @param {string} line The source line with a trailing comment + * @param {number} lineNumber The one-indexed line number this is on + * @param {ASTNode} comment The comment to remove + * @returns {boolean} If the comment covers the entire line + */ + function isFullLineComment(line, lineNumber, comment) { + var start = comment.loc.start, + end = comment.loc.end; + + return comment && + (start.line < lineNumber || (start.line === lineNumber && start.column === 0)) && + (end.line > lineNumber || end.column === line.length); + } + + /** + * Gets the line after the comment and any remaining trailing whitespace is + * stripped. + * @param {string} line The source line with a trailing comment + * @param {number} lineNumber The one-indexed line number this is on + * @param {ASTNode} comment The comment to remove + * @returns {string} Line without comment and trailing whitepace + */ + function stripTrailingComment(line, lineNumber, comment) { + + // loc.column is zero-indexed + return line.slice(0, comment.loc.start.column).replace(/\s+$/, ""); + } + + /** + * Check the program for max length + * @param {ASTNode} node Node to examine + * @returns {void} + * @private + */ function checkProgramForMaxLength(node) { - var lines = context.getSourceLines(); - // Replace the tabs - // Split (honors line-ending) - // Iterate + // split (honors line-ending) + var lines = context.getSourceLines(), + + // list of comments to ignore + comments = ignoreComments || maxCommentLength || ignoreTrailingComments ? context.getAllComments() : [], + + // we iterate over comments in parallel with the lines + commentsIndex = 0; + lines.forEach(function(line, i) { - if (line.replace(/\t/g, tabString).length > maxLength) { - context.report(node, { line: i + 1, col: 1 }, "Line " + (i + 1) + " exceeds the maximum line length of " + maxLength + "."); + + // i is zero-indexed, line numbers are one-indexed + var lineNumber = i + 1; + + /* + * if we're checking comment length; we need to know whether this + * line is a comment + */ + var lineIsComment = false; + + /* + * We can short-circuit the comment checks if we're already out of + * comments to check. + */ + if (commentsIndex < comments.length) { + + // iterate over comments until we find one past the current line + do { + var comment = comments[++commentsIndex]; + } while (comment && comment.loc.start.line <= lineNumber); + + // and step back by one + comment = comments[--commentsIndex]; + + if (isFullLineComment(line, lineNumber, comment)) { + lineIsComment = true; + } else if (ignoreTrailingComments && isTrailingComment(line, lineNumber, comment)) { + line = stripTrailingComment(line, lineNumber, comment); + } + } + if (ignorePattern && ignorePattern.test(line) || + ignoreUrls && URL_REGEXP.test(line)) { + + // ignore this line + return; + } + + var lineLength = computeLineLength(line, tabWidth); + + if (lineIsComment && ignoreComments) { + return; + } + + if (lineIsComment && lineLength > maxCommentLength) { + context.report(node, { line: lineNumber, column: 0 }, "Line " + (i + 1) + " exceeds the maximum comment line length of " + maxCommentLength + "."); + } else if (lineLength > maxLength) { + context.report(node, { line: lineNumber, column: 0 }, "Line " + (i + 1) + " exceeds the maximum line length of " + maxLength + "."); } }); } @@ -64,13 +197,49 @@ module.exports = function(context) { }; -module.exports.schema = [ - { - "type": "integer", - "minimum": 0 +var OPTIONS_SCHEMA = { + "type": "object", + "properties": { + "code": { + "type": "integer", + "minimum": 0 + }, + "comments": { + "type": "integer", + "minimum": 0 + }, + "tabWidth": { + "type": "integer", + "minimum": 0 + }, + "ignorePattern": { + "type": "string" + }, + "ignoreComments": { + "type": "boolean" + }, + "ignoreUrls": { + "type": "boolean" + }, + "ignoreTrailingComments": { + "type": "boolean" + } }, - { - "type": "integer", - "minimum": 0 - } + "additionalProperties": false +}; + +var OPTIONS_OR_INTEGER_SCHEMA = { + "anyOf": [ + OPTIONS_SCHEMA, + { + "type": "integer", + "minimum": 0 + } + ] +}; + +module.exports.schema = [ + OPTIONS_OR_INTEGER_SCHEMA, + OPTIONS_OR_INTEGER_SCHEMA, + OPTIONS_SCHEMA ]; diff --git a/tools/eslint/lib/rules/max-nested-callbacks.js b/tools/eslint/lib/rules/max-nested-callbacks.js index 2caff10764a455..21b411b25138f4 100644 --- a/tools/eslint/lib/rules/max-nested-callbacks.js +++ b/tools/eslint/lib/rules/max-nested-callbacks.js @@ -15,8 +15,18 @@ module.exports = function(context) { //-------------------------------------------------------------------------- // Constants //-------------------------------------------------------------------------- + var option = context.options[0], + THRESHOLD = 10; - var THRESHOLD = context.options[0]; + if (typeof option === "object" && option.hasOwnProperty("maximum") && typeof option.maximum === "number") { + THRESHOLD = option.maximum; + } + if (typeof option === "object" && option.hasOwnProperty("max") && typeof option.max === "number") { + THRESHOLD = option.max; + } + if (typeof option === "number") { + THRESHOLD = option; + } //-------------------------------------------------------------------------- // Helpers @@ -39,6 +49,7 @@ module.exports = function(context) { if (callbackStack.length > THRESHOLD) { var opts = {num: callbackStack.length, max: THRESHOLD}; + context.report(node, "Too many nested callbacks ({{num}}). Maximum allowed is {{max}}.", opts); } } @@ -68,6 +79,25 @@ module.exports = function(context) { module.exports.schema = [ { - "type": "integer" + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "object", + "properties": { + "maximum": { + "type": "integer", + "minimum": 0 + }, + "max": { + "type": "integer", + "minimum": 0 + } + }, + "additionalProperties": false + } + ] } ]; diff --git a/tools/eslint/lib/rules/max-params.js b/tools/eslint/lib/rules/max-params.js index c09fba06d06c83..d1cfe470922933 100644 --- a/tools/eslint/lib/rules/max-params.js +++ b/tools/eslint/lib/rules/max-params.js @@ -13,7 +13,18 @@ module.exports = function(context) { - var numParams = context.options[0] || 3; + var option = context.options[0], + numParams = 3; + + if (typeof option === "object" && option.hasOwnProperty("maximum") && typeof option.maximum === "number") { + numParams = option.maximum; + } + if (typeof option === "object" && option.hasOwnProperty("max") && typeof option.max === "number") { + numParams = option.max; + } + if (typeof option === "number") { + numParams = option; + } /** * Checks a function to see if it has too many parameters. @@ -40,6 +51,25 @@ module.exports = function(context) { module.exports.schema = [ { - "type": "integer" + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "object", + "properties": { + "maximum": { + "type": "integer", + "minimum": 0 + }, + "max": { + "type": "integer", + "minimum": 0 + } + }, + "additionalProperties": false + } + ] } ]; diff --git a/tools/eslint/lib/rules/max-statements-per-line.js b/tools/eslint/lib/rules/max-statements-per-line.js new file mode 100644 index 00000000000000..465c5a00b0eebb --- /dev/null +++ b/tools/eslint/lib/rules/max-statements-per-line.js @@ -0,0 +1,106 @@ +/** + * @fileoverview Specify the maximum number of statements allowed per line. + * @author Kenneth Williams + * @copyright 2016 Kenneth Williams. All rights reserved. + * @copyright 2016 Michael Ficarra. All rights reserved. + * See LICENSE file in root directory for full license. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + + var options = context.options[0] || {}, + lastStatementLine = 0, + numberOfStatementsOnThisLine = 0, + maxStatementsPerLine = typeof options.max !== "undefined" ? options.max : 1; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports a node + * @param {ASTNode} node The node to report + * @returns {void} + * @private + */ + function report(node) { + context.report( + node, + "This line has too many statements. Maximum allowed is {{max}}.", + { max: maxStatementsPerLine }); + } + + /** + * Enforce a maximum number of statements per line + * @param {ASTNode} nodes Array of nodes to evaluate + * @returns {void} + * @private + */ + function enforceMaxStatementsPerLine(nodes) { + if (nodes.length < 1) { + return; + } + + for (var i = 0, l = nodes.length; i < l; ++i) { + var currentStatement = nodes[i]; + + if (currentStatement.loc.start.line === lastStatementLine) { + ++numberOfStatementsOnThisLine; + } else { + numberOfStatementsOnThisLine = 1; + lastStatementLine = currentStatement.loc.end.line; + } + if (numberOfStatementsOnThisLine === maxStatementsPerLine + 1) { + report(currentStatement); + } + } + } + + /** + * Check each line in the body of a node + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkLinesInBody(node) { + enforceMaxStatementsPerLine(node.body); + } + + /** + * Check each line in the consequent of a switch case + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ + function checkLinesInConsequent(node) { + enforceMaxStatementsPerLine(node.consequent); + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + "Program": checkLinesInBody, + "BlockStatement": checkLinesInBody, + "SwitchCase": checkLinesInConsequent + }; + +}; + +module.exports.schema = [ + { + "type": "object", + "properties": { + "max": { + "type": "integer" + } + }, + "additionalProperties": false + } +]; diff --git a/tools/eslint/lib/rules/max-statements.js b/tools/eslint/lib/rules/max-statements.js index 8c7f4fd31b15f2..e608958ebae6d0 100644 --- a/tools/eslint/lib/rules/max-statements.js +++ b/tools/eslint/lib/rules/max-statements.js @@ -17,21 +17,69 @@ module.exports = function(context) { //-------------------------------------------------------------------------- var functionStack = [], - maxStatements = context.options[0] || 10; + option = context.options[0], + maxStatements = 10, + ignoreTopLevelFunctions = context.options[1] && context.options[1].ignoreTopLevelFunctions || false, + topLevelFunctions = []; + if (typeof option === "object" && option.hasOwnProperty("maximum") && typeof option.maximum === "number") { + maxStatements = option.maximum; + } + if (typeof option === "object" && option.hasOwnProperty("max") && typeof option.max === "number") { + maxStatements = option.max; + } + if (typeof option === "number") { + maxStatements = option; + } + + /** + * Reports a node if it has too many statements + * @param {ASTNode} node node to evaluate + * @param {int} count Number of statements in node + * @param {int} max Maximum number of statements allowed + * @returns {void} + * @private + */ + function reportIfTooManyStatements(node, count, max) { + if (count > max) { + context.report( + node, + "This function has too many statements ({{count}}). Maximum allowed is {{max}}.", + { count: count, max: max }); + } + } + + /** + * When parsing a new function, store it in our function stack + * @returns {void} + * @private + */ function startFunction() { functionStack.push(0); } + /** + * Evaluate the node at the end of function + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ function endFunction(node) { var count = functionStack.pop(); - if (count > maxStatements) { - context.report(node, "This function has too many statements ({{count}}). Maximum allowed is {{max}}.", - { count: count, max: maxStatements }); + if (ignoreTopLevelFunctions && functionStack.length === 0) { + topLevelFunctions.push({ node: node, count: count}); + } else { + reportIfTooManyStatements(node, count, maxStatements); } } + /** + * Increment the count of the functions + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ function countStatements(node) { functionStack[functionStack.length - 1] += node.body.length; } @@ -49,13 +97,54 @@ module.exports = function(context) { "FunctionDeclaration:exit": endFunction, "FunctionExpression:exit": endFunction, - "ArrowFunctionExpression:exit": endFunction + "ArrowFunctionExpression:exit": endFunction, + + "Program:exit": function() { + if (topLevelFunctions.length === 1) { + return; + } + + topLevelFunctions.forEach(function(element) { + var count = element.count; + var node = element.node; + + reportIfTooManyStatements(node, count, maxStatements); + }); + } }; }; module.exports.schema = [ { - "type": "integer" + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "object", + "properties": { + "maximum": { + "type": "integer", + "minimum": 0 + }, + "max": { + "type": "integer", + "minimum": 0 + } + }, + "additionalProperties": false + } + ] + }, + { + "type": "object", + "properties": { + "ignoreTopLevelFunctions": { + "type": "boolean" + } + }, + "additionalProperties": false } ]; diff --git a/tools/eslint/lib/rules/new-cap.js b/tools/eslint/lib/rules/new-cap.js index 3f47d9a5edb82e..f43c59fd99951a 100644 --- a/tools/eslint/lib/rules/new-cap.js +++ b/tools/eslint/lib/rules/new-cap.js @@ -7,6 +7,16 @@ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + var CAPS_ALLOWED = [ "Array", "Boolean", @@ -28,6 +38,8 @@ var CAPS_ALLOWED = [ * @returns {string[]} Returns obj[key] if it's an Array, otherwise `fallback` */ function checkArray(obj, key, fallback) { + + /* istanbul ignore if */ if (Object.prototype.hasOwnProperty.call(obj, key) && !Array.isArray(obj[key])) { throw new TypeError(key + ", if provided, must be an Array"); } @@ -66,9 +78,11 @@ function calculateCapIsNewExceptions(config) { module.exports = function(context) { - var config = context.options[0] || {}; + var config = context.options[0] ? lodash.assign({}, context.options[0]) : {}; + config.newIsCap = config.newIsCap !== false; config.capIsNew = config.capIsNew !== false; + var skipProperties = config.properties === false; var newIsCapExceptions = checkArray(config, "newIsCapExceptions", []).reduce(invert, {}); @@ -117,6 +131,7 @@ module.exports = function(context) { var firstCharUpper = firstChar.toUpperCase(); if (firstCharLower === firstCharUpper) { + // char has no uppercase variant, so it's non-alphabetic return "non-alpha"; } else if (firstChar === firstCharLower) { @@ -134,15 +149,18 @@ module.exports = function(context) { * @returns {Boolean} Returns true if the callee may be capitalized */ function isCapAllowed(allowedMap, node, calleeName) { - if (allowedMap[calleeName]) { + if (allowedMap[calleeName] || allowedMap[context.getSource(node.callee)]) { return true; } + if (calleeName === "UTC" && node.callee.type === "MemberExpression") { + // allow if callee is Date.UTC return node.callee.object.type === "Identifier" && node.callee.object.name === "Date"; } - return false; + + return skipProperties && node.callee.type === "MemberExpression"; } /** @@ -169,9 +187,11 @@ module.exports = function(context) { listeners.NewExpression = function(node) { var constructorName = extractNameFromExpression(node); + if (constructorName) { var capitalization = getCap(constructorName); var isAllowed = capitalization !== "lower" || isCapAllowed(newIsCapExceptions, node, constructorName); + if (!isAllowed) { report(node, "A constructor name should not start with a lowercase letter."); } @@ -183,9 +203,11 @@ module.exports = function(context) { listeners.CallExpression = function(node) { var calleeName = extractNameFromExpression(node); + if (calleeName) { var capitalization = getCap(calleeName); var isAllowed = capitalization !== "upper" || isCapAllowed(capIsNewExceptions, node, calleeName); + if (!isAllowed) { report(node, "A function with a name starting with an uppercase letter should only be used as a constructor."); } @@ -217,6 +239,9 @@ module.exports.schema = [ "items": { "type": "string" } + }, + "properties": { + "type": "boolean" } }, "additionalProperties": false diff --git a/tools/eslint/lib/rules/new-parens.js b/tools/eslint/lib/rules/new-parens.js index 903564b5d77078..13c8e3d8248b3e 100644 --- a/tools/eslint/lib/rules/new-parens.js +++ b/tools/eslint/lib/rules/new-parens.js @@ -18,6 +18,7 @@ module.exports = function(context) { var prenticesTokens = tokens.filter(function(token) { return token.value === "(" || token.value === ")"; }); + if (prenticesTokens.length < 2) { context.report(node, "Missing '()' invoking a constructor"); } diff --git a/tools/eslint/lib/rules/newline-after-var.js b/tools/eslint/lib/rules/newline-after-var.js index e1ade14bdeda97..34431e2c8cddcd 100644 --- a/tools/eslint/lib/rules/newline-after-var.js +++ b/tools/eslint/lib/rules/newline-after-var.js @@ -3,6 +3,7 @@ * @author Gopal Venkatesan * @copyright 2015 Gopal Venkatesan. All rights reserved. * @copyright 2015 Casey Visco. All rights reserved. + * @copyright 2015 Ian VanSchooten. All rights reserved. */ "use strict"; @@ -16,14 +17,16 @@ module.exports = function(context) { var ALWAYS_MESSAGE = "Expected blank line after variable declarations.", NEVER_MESSAGE = "Unexpected blank line after variable declarations."; - // Default `mode` to "always". This means that invalid options will also - // be treated as "always" and the only special case is "never" + var sourceCode = context.getSourceCode(); + + // Default `mode` to "always". var mode = context.options[0] === "never" ? "never" : "always"; - // Cache line numbers of comments for faster lookup - var comments = context.getAllComments().map(function (token) { - return token.loc.start.line; - }); + // Cache starting and ending line numbers of comments for faster lookup + var commentEndLine = context.getAllComments().reduce(function(result, token) { + result[token.loc.start.line] = token.loc.end.line; + return result; + }, {}); //-------------------------------------------------------------------------- @@ -61,6 +64,35 @@ module.exports = function(context) { nodeType === "ExportDefaultDeclaration" || nodeType === "ExportAllDeclaration"; } + /** + * Determine if provided node is the last of their parent block. + * @private + * @param {ASTNode} node - node to test + * @returns {boolean} True if `node` is last of their parent block. + */ + function isLastNode(node) { + var token = sourceCode.getTokenAfter(node); + + return !token || (token.type === "Punctuator" && token.value === "}"); + } + + /** + * Determine if a token starts more than one line after a comment ends + * @param {token} token The token being checked + * @param {integer} commentStartLine The line number on which the comment starts + * @returns {boolean} True if `token` does not start immediately after a comment + */ + function hasBlankLineAfterComment(token, commentStartLine) { + var commentEnd = commentEndLine[commentStartLine]; + + // If there's another comment, repeat check for blank line + if (commentEndLine[commentEnd + 1]) { + return hasBlankLineAfterComment(token, commentEnd + 1); + } + + return (token.loc.start.line > commentEndLine[commentStartLine] + 1); + } + /** * Checks that a blank line exists after a variable declaration when mode is * set to "always", or checks that there is no blank line when mode is set @@ -70,8 +102,8 @@ module.exports = function(context) { * @returns {void} */ function checkForBlankLine(node) { - var lastToken = context.getLastToken(node), - nextToken = context.getTokenAfter(node), + var lastToken = sourceCode.getLastToken(node), + nextToken = sourceCode.getTokenAfter(node), nextLineNum = lastToken.loc.end.line + 1, noNextLineToken, hasNextLineComment; @@ -97,15 +129,26 @@ module.exports = function(context) { return; } + // Ignore if it is last statement in a block + if (isLastNode(node)) { + return; + } + // Next statement is not a `var`... noNextLineToken = nextToken.loc.start.line > nextLineNum; - hasNextLineComment = comments.indexOf(nextLineNum) >= 0; + hasNextLineComment = (typeof commentEndLine[nextLineNum] !== "undefined"); if (mode === "never" && noNextLineToken && !hasNextLineComment) { context.report(node, NEVER_MESSAGE, { identifier: node.name }); } - if (mode === "always" && (!noNextLineToken || hasNextLineComment)) { + // Token on the next line, or comment without blank line + if ( + mode === "always" && ( + !noNextLineToken || + hasNextLineComment && !hasBlankLineAfterComment(nextToken, nextLineNum) + ) + ) { context.report(node, ALWAYS_MESSAGE, { identifier: node.name }); } } diff --git a/tools/eslint/lib/rules/newline-before-return.js b/tools/eslint/lib/rules/newline-before-return.js new file mode 100644 index 00000000000000..6cc2944a435c19 --- /dev/null +++ b/tools/eslint/lib/rules/newline-before-return.js @@ -0,0 +1,143 @@ + +/** + * @fileoverview Rule to require newlines before `return` statement + * @author Kai Cataldo + * @copyright 2016 Kai Cataldo. All rights reserved. + * See LICENSE file in root directory for full license. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Tests whether node is preceded by supplied tokens + * @param {ASTNode} node - node to check + * @param {array} testTokens - array of tokens to test against + * @returns {boolean} Whether or not the node is preceded by one of the supplied tokens + * @private + */ + function isPrecededByTokens(node, testTokens) { + var tokenBefore = sourceCode.getTokenBefore(node); + + return testTokens.some(function(token) { + return tokenBefore.value === token; + }); + } + + /** + * Checks whether node is the first node after statement or in block + * @param {ASTNode} node - node to check + * @returns {boolean} Whether or not the node is the first node after statement or in block + * @private + */ + function isFirstNode(node) { + var parentType = node.parent.type; + + if (node.parent.body) { + return Array.isArray(node.parent.body) + ? node.parent.body[0] === node + : node.parent.body === node; + } + + if (parentType === "IfStatement") { + return isPrecededByTokens(node, ["else", ")"]); + } else if (parentType === "DoWhileStatement") { + return isPrecededByTokens(node, ["do"]); + } else if (parentType === "SwitchCase") { + return isPrecededByTokens(node, [":"]); + } else { + return isPrecededByTokens(node, [")"]); + } + } + + /** + * Returns the number of lines of comments that precede the node + * @param {ASTNode} node - node to check for overlapping comments + * @param {token} tokenBefore - previous token to check for overlapping comments + * @returns {number} Number of lines of comments that precede the node + * @private + */ + function calcCommentLines(node, tokenBefore) { + var comments = sourceCode.getComments(node).leading; + var numLinesComments = 0; + + if (!comments.length) { + return numLinesComments; + } + + comments.forEach(function(comment) { + numLinesComments++; + + if (comment.type === "Block") { + numLinesComments += comment.loc.end.line - comment.loc.start.line; + } + + // avoid counting lines with inline comments twice + if (comment.loc.start.line === tokenBefore.loc.end.line) { + numLinesComments--; + } + + if (comment.loc.end.line === node.loc.start.line) { + numLinesComments--; + } + }); + + return numLinesComments; + } + + /** + * Checks whether node is preceded by a newline + * @param {ASTNode} node - node to check + * @returns {boolean} Whether or not the node is preceded by a newline + * @private + */ + function hasNewlineBefore(node) { + var tokenBefore = sourceCode.getTokenBefore(node); + var lineNumTokenBefore = tokenBefore.loc.end.line; + var lineNumNode = node.loc.start.line; + var commentLines = calcCommentLines(node, tokenBefore); + + return (lineNumNode - lineNumTokenBefore - commentLines) > 1; + } + + /** + * Reports expected/unexpected newline before return statement + * @param {ASTNode} node - the node to report in the event of an error + * @param {boolean} isExpected - whether the newline is expected or not + * @returns {void} + * @private + */ + function reportError(node, isExpected) { + var expected = isExpected ? "Expected" : "Unexpected"; + + context.report({ + node: node, + message: expected + " newline before return statement." + }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + ReturnStatement: function(node) { + if (isFirstNode(node) && hasNewlineBefore(node)) { + reportError(node, false); + } else if (!isFirstNode(node) && !hasNewlineBefore(node)) { + reportError(node, true); + } + } + }; +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/newline-per-chained-call.js b/tools/eslint/lib/rules/newline-per-chained-call.js new file mode 100644 index 00000000000000..f7df4c29d66112 --- /dev/null +++ b/tools/eslint/lib/rules/newline-per-chained-call.js @@ -0,0 +1,56 @@ +/** + * @fileoverview Rule to ensure newline per method call when chaining calls + * @author Rajendra Patil + * @author Burak Yigit Kaya + * @copyright 2016 Rajendra Patil. All rights reserved. + * @copyright 2016 Burak Yigit Kaya. All rights reserved. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + + var options = context.options[0] || {}, + ignoreChainWithDepth = options.ignoreChainWithDepth || 2; + + return { + "CallExpression:exit": function(node) { + if (!node.callee || node.callee.type !== "MemberExpression") { + return; + } + + var callee = node.callee; + var parent = callee.object; + var depth = 1; + + while (parent && parent.callee) { + depth += 1; + parent = parent.callee.object; + } + + if (depth > ignoreChainWithDepth && callee.property.loc.start.line === callee.object.loc.end.line) { + context.report( + callee.property, + callee.property.loc.start, + "Expected line break after `" + context.getSource(callee.object).replace(/\r\n|\r|\n/g, "\\n") + "`." + ); + } + } + }; +}; + +module.exports.schema = [{ + "type": "object", + "properties": { + "ignoreChainWithDepth": { + "type": "integer", + "minimum": 1, + "maximum": 10 + } + }, + "additionalProperties": false +}]; diff --git a/tools/eslint/lib/rules/no-alert.js b/tools/eslint/lib/rules/no-alert.js index 7d041eaf748b7c..ea1e689544840a 100644 --- a/tools/eslint/lib/rules/no-alert.js +++ b/tools/eslint/lib/rules/no-alert.js @@ -33,7 +33,7 @@ function report(context, node, identifierName) { /** * Returns the property name of a MemberExpression. * @param {ASTNode} memberExpressionNode The MemberExpression node. - * @returns {string|undefined} Returns the property name if available, undefined else. + * @returns {string|null} Returns the property name if available, null else. */ function getPropertyName(memberExpressionNode) { if (memberExpressionNode.computed) { @@ -43,16 +43,17 @@ function getPropertyName(memberExpressionNode) { } else { return memberExpressionNode.property.name; } + return null; } /** * Finds the escope reference in the given scope. * @param {Object} scope The scope to search. * @param {ASTNode} node The identifier node. - * @returns {Reference|undefined} Returns the found reference or undefined if none were found. + * @returns {Reference|null} Returns the found reference or null if none were found. */ function findReference(scope, node) { - var references = scope.references.filter(function (reference) { + var references = scope.references.filter(function(reference) { return reference.identifier.range[0] === node.range[0] && reference.identifier.range[1] === node.range[1]; }); @@ -60,18 +61,7 @@ function findReference(scope, node) { if (references.length === 1) { return references[0]; } -} - -/** - * Checks if the given identifier name is shadowed in the given global scope. - * @param {Object} globalScope The global scope. - * @param {string} identifierName The identifier name to check - * @returns {boolean} Whether or not the name is shadowed globally. - */ -function isGloballyShadowed(globalScope, identifierName) { - return globalScope.variables.some(function (variable) { - return variable.name === identifierName && variable.defs.length > 0; - }); + return null; } /** @@ -82,16 +72,9 @@ function isGloballyShadowed(globalScope, identifierName) { * @returns {boolean} Whether or not the name is shadowed. */ function isShadowed(scope, globalScope, node) { - var reference = findReference(scope, node), - identifierName = node.name; + var reference = findReference(scope, node); - if (reference) { - if (reference.resolved || isGloballyShadowed(globalScope, identifierName)) { - return true; - } - } - - return false; + return reference && reference.resolved && reference.resolved.defs.length > 0; } /** @@ -120,7 +103,7 @@ module.exports = function(context) { return { - "Program": function () { + "Program": function() { globalScope = context.getScope(); }, diff --git a/tools/eslint/lib/rules/no-array-constructor.js b/tools/eslint/lib/rules/no-array-constructor.js index b7167a49e5914e..ecf5837228b12a 100644 --- a/tools/eslint/lib/rules/no-array-constructor.js +++ b/tools/eslint/lib/rules/no-array-constructor.js @@ -11,6 +11,12 @@ module.exports = function(context) { + /** + * Disallow construction of dense arrays using the Array constructor + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ function check(node) { if ( node.arguments.length !== 1 && diff --git a/tools/eslint/lib/rules/no-bitwise.js b/tools/eslint/lib/rules/no-bitwise.js index 439b7be4b20385..9655525396e7e3 100644 --- a/tools/eslint/lib/rules/no-bitwise.js +++ b/tools/eslint/lib/rules/no-bitwise.js @@ -5,17 +5,23 @@ "use strict"; +// +// Set of bitwise operators. +// +var BITWISE_OPERATORS = [ + "^", "|", "&", "<<", ">>", ">>>", + "^=", "|=", "&=", "<<=", ">>=", ">>>=", + "~" +]; + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = function(context) { - - var BITWISE_OPERATORS = [ - "^", "|", "&", "<<", ">>", ">>>", - "^=", "|=", "&=", "<<=", ">>=", ">>>=", - "~" - ]; + var options = context.options[0] || {}; + var allowed = options.allow || []; + var int32Hint = options.int32Hint === true; /** * Reports an unexpected use of a bitwise operator. @@ -35,13 +41,32 @@ module.exports = function(context) { return BITWISE_OPERATORS.indexOf(node.operator) !== -1; } + /** + * Checks if exceptions were provided, e.g. `{ allow: ['~', '|'] }`. + * @param {ASTNode} node The node to check. + * @returns {boolean} Whether or not the node has a bitwise operator. + */ + function allowedOperator(node) { + return allowed.indexOf(node.operator) !== -1; + } + + /** + * Checks if the given bitwise operator is used for integer typecasting, i.e. "|0" + * @param {ASTNode} node The node to check. + * @returns {boolean} whether the node is used in integer typecasting. + */ + function isInt32Hint(node) { + return int32Hint && node.operator === "|" && node.right && + node.right.type === "Literal" && node.right.value === 0; + } + /** * Report if the given node contains a bitwise operator. - * @param {ASTNode} node The node to check. + * @param {ASTNode} node The node to check. * @returns {void} */ function checkNodeForBitwiseOperator(node) { - if (hasBitwiseOperator(node)) { + if (hasBitwiseOperator(node) && !allowedOperator(node) && !isInt32Hint(node)) { report(node); } } @@ -54,4 +79,21 @@ module.exports = function(context) { }; -module.exports.schema = []; +module.exports.schema = [ + { + "type": "object", + "properties": { + "allow": { + "type": "array", + "items": { + "enum": BITWISE_OPERATORS + }, + "uniqueItems": true + }, + "int32Hint": { + "type": "boolean" + } + }, + "additionalProperties": false + } +]; diff --git a/tools/eslint/lib/rules/no-case-declarations.js b/tools/eslint/lib/rules/no-case-declarations.js new file mode 100644 index 00000000000000..4969d4f1bf1a32 --- /dev/null +++ b/tools/eslint/lib/rules/no-case-declarations.js @@ -0,0 +1,48 @@ +/** + * @fileoverview Rule to flag use of an lexical declarations inside a case clause + * @author Erik Arvidsson + * @copyright 2015 Erik Arvidsson. All rights reserved. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + + /** + * Checks whether or not a node is a lexical declaration. + * @param {ASTNode} node A direct child statement of a switch case. + * @returns {boolean} Whether or not the node is a lexical declaration. + */ + function isLexicalDeclaration(node) { + switch (node.type) { + case "FunctionDeclaration": + case "ClassDeclaration": + return true; + case "VariableDeclaration": + return node.kind !== "var"; + default: + return false; + } + } + + return { + "SwitchCase": function(node) { + for (var i = 0; i < node.consequent.length; i++) { + var statement = node.consequent[i]; + + if (isLexicalDeclaration(statement)) { + context.report({ + node: node, + message: "Unexpected lexical declaration in case block." + }); + } + } + } + }; + +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-catch-shadow.js b/tools/eslint/lib/rules/no-catch-shadow.js index 5776cd1780cb95..88eeb02fa6182c 100644 --- a/tools/eslint/lib/rules/no-catch-shadow.js +++ b/tools/eslint/lib/rules/no-catch-shadow.js @@ -5,6 +5,12 @@ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var astUtils = require("../ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ @@ -15,20 +21,14 @@ module.exports = function(context) { // Helpers //-------------------------------------------------------------------------- + /** + * Check if the parameters are been shadowed + * @param {object} scope current scope + * @param {string} name parameter name + * @returns {boolean} True is its been shadowed + */ function paramIsShadowing(scope, name) { - var found = scope.variables.some(function(variable) { - return variable.name === name; - }); - - if (found) { - return true; - } - - if (scope.upper) { - return paramIsShadowing(scope.upper, name); - } - - return false; + return astUtils.getVariableByName(scope, name) !== null; } //-------------------------------------------------------------------------- @@ -40,6 +40,12 @@ module.exports = function(context) { "CatchClause": function(node) { var scope = context.getScope(); + // When blockBindings is enabled, CatchClause creates its own scope + // so start from one upper scope to exclude the current node + if (scope.block === node) { + scope = scope.upper; + } + if (paramIsShadowing(scope, node.param.name)) { context.report(node, "Value of '{{name}}' may be overwritten in IE 8 and earlier.", { name: node.param.name }); diff --git a/tools/eslint/lib/rules/no-class-assign.js b/tools/eslint/lib/rules/no-class-assign.js new file mode 100644 index 00000000000000..82f8e31fc34265 --- /dev/null +++ b/tools/eslint/lib/rules/no-class-assign.js @@ -0,0 +1,48 @@ +/** + * @fileoverview A rule to disallow modifying variables of class declarations + * @author Toru Nagashima + * @copyright 2015 Toru Nagashima. All rights reserved. + */ + +"use strict"; + +var astUtils = require("../ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + + /** + * Finds and reports references that are non initializer and writable. + * @param {Variable} variable - A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + astUtils.getModifyingReferences(variable.references).forEach(function(reference) { + context.report( + reference.identifier, + "'{{name}}' is a class.", + {name: reference.identifier.name}); + + }); + } + + /** + * Finds and reports references that are non initializer and writable. + * @param {ASTNode} node - A ClassDeclaration/ClassExpression node to check. + * @returns {void} + */ + function checkForClass(node) { + context.getDeclaredVariables(node).forEach(checkVariable); + } + + return { + "ClassDeclaration": checkForClass, + "ClassExpression": checkForClass + }; + +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-comma-dangle.js b/tools/eslint/lib/rules/no-comma-dangle.js deleted file mode 100644 index 899529efe8a07e..00000000000000 --- a/tools/eslint/lib/rules/no-comma-dangle.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @fileoverview Rule to flag trailing commas in object literals. - * @author Ian Christian Myers - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - //------------------------------------------------------------------------- - // Helpers - //------------------------------------------------------------------------- - - function checkForTrailingComma(node) { - var items = node.properties || node.elements, - length = items.length, - lastItem, penultimateToken; - - if (length) { - lastItem = items[length - 1]; - if (lastItem) { - penultimateToken = context.getLastToken(node, 1); - if (penultimateToken.value === ",") { - context.report(lastItem, penultimateToken.loc.start, "Trailing comma."); - } - } - } - } - - //-------------------------------------------------------------------------- - // Public API - //-------------------------------------------------------------------------- - - return { - "ObjectExpression": checkForTrailingComma, - "ArrayExpression": checkForTrailingComma - }; - -}; - -module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-cond-assign.js b/tools/eslint/lib/rules/no-cond-assign.js index 2dc6251e39eac4..f4bb8425cc77e1 100644 --- a/tools/eslint/lib/rules/no-cond-assign.js +++ b/tools/eslint/lib/rules/no-cond-assign.js @@ -38,11 +38,11 @@ module.exports = function(context) { function findConditionalAncestor(node) { var currentAncestor = node; - while ((currentAncestor = currentAncestor.parent)) { + do { if (isConditionalTestExpression(currentAncestor)) { return currentAncestor.parent; } - } + } while ((currentAncestor = currentAncestor.parent)); return null; } @@ -80,9 +80,20 @@ module.exports = function(context) { * @returns {void} */ function testForAssign(node) { - if (node.test && (node.test.type === "AssignmentExpression") && !isParenthesisedTwice(node.test)) { + if (node.test && + (node.test.type === "AssignmentExpression") && + (node.type === "ForStatement" ? + !isParenthesised(node.test) : + !isParenthesisedTwice(node.test) + ) + ) { + // must match JSHint's error message - context.report(node, "Expected a conditional expression and instead saw an assignment."); + context.report({ + node: node, + loc: node.test.loc.start, + message: "Expected a conditional expression and instead saw an assignment." + }); } } diff --git a/tools/eslint/lib/rules/no-confusing-arrow.js b/tools/eslint/lib/rules/no-confusing-arrow.js new file mode 100644 index 00000000000000..8756cf431d39fc --- /dev/null +++ b/tools/eslint/lib/rules/no-confusing-arrow.js @@ -0,0 +1,77 @@ +/** + * @fileoverview A rule to warn against using arrow functions when they could be + * confused with comparisions + * @author Jxck + * @copyright 2015 Luke Karrys. All rights reserved. + * The MIT License (MIT) + + * Copyright (c) 2015 Jxck + + * 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. + */ + +"use strict"; + +var astUtils = require("../ast-utils.js"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a node is a conditional expression. + * @param {ASTNode} node - node to test + * @returns {boolean} `true` if the node is a conditional expression. + */ +function isConditional(node) { + return node && node.type === "ConditionalExpression"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var config = context.options[0] || {}; + + /** + * Reports if an arrow function contains an ambiguous conditional. + * @param {ASTNode} node - A node to check and report. + * @returns {void} + */ + function checkArrowFunc(node) { + var body = node.body; + + if (isConditional(body) && !(config.allowParens && astUtils.isParenthesised(context, body))) { + context.report(node, "Arrow function used ambiguously with a conditional expression."); + } + } + + return { + "ArrowFunctionExpression": checkArrowFunc + }; +}; + +module.exports.schema = [{ + type: "object", + properties: { + allowParens: {type: "boolean"} + }, + additionalProperties: false +}]; diff --git a/tools/eslint/lib/rules/no-console.js b/tools/eslint/lib/rules/no-console.js index 5de6adadbf4982..3efbbd4f24f5f7 100644 --- a/tools/eslint/lib/rules/no-console.js +++ b/tools/eslint/lib/rules/no-console.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to flag use of console object * @author Nicholas C. Zakas + * @copyright 2016 Eric Correia. All rights reserved. */ "use strict"; @@ -16,12 +17,40 @@ module.exports = function(context) { "MemberExpression": function(node) { if (node.object.name === "console") { - context.report(node, "Unexpected console statement."); - } + var blockConsole = true; + + if (context.options.length > 0) { + var allowedProperties = context.options[0].allow; + var passedProperty = node.property.name; + var propertyIsAllowed = (allowedProperties.indexOf(passedProperty) > -1); + + if (propertyIsAllowed) { + blockConsole = false; + } + } + if (blockConsole) { + context.report(node, "Unexpected console statement."); + } + } } }; }; -module.exports.schema = []; +module.exports.schema = [ + { + "type": "object", + "properties": { + "allow": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1, + "uniqueItems": true + } + }, + "additionalProperties": false + } +]; diff --git a/tools/eslint/lib/rules/no-const-assign.js b/tools/eslint/lib/rules/no-const-assign.js new file mode 100644 index 00000000000000..d10e1b26d6cd32 --- /dev/null +++ b/tools/eslint/lib/rules/no-const-assign.js @@ -0,0 +1,41 @@ +/** + * @fileoverview A rule to disallow modifying variables that are declared using `const` + * @author Toru Nagashima + * @copyright 2015 Toru Nagashima. All rights reserved. + */ + +"use strict"; + +var astUtils = require("../ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + + /** + * Finds and reports references that are non initializer and writable. + * @param {Variable} variable - A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + astUtils.getModifyingReferences(variable.references).forEach(function(reference) { + context.report( + reference.identifier, + "'{{name}}' is constant.", + {name: reference.identifier.name}); + }); + } + + return { + "VariableDeclaration": function(node) { + if (node.kind === "const") { + context.getDeclaredVariables(node).forEach(checkVariable); + } + } + }; + +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-constant-condition.js b/tools/eslint/lib/rules/no-constant-condition.js index 0fe0845de49eb1..a8251d1f9595f5 100644 --- a/tools/eslint/lib/rules/no-constant-condition.js +++ b/tools/eslint/lib/rules/no-constant-condition.js @@ -30,15 +30,20 @@ module.exports = function(context) { case "ObjectExpression": case "ArrayExpression": return true; + case "UnaryExpression": return isConstant(node.argument); + case "BinaryExpression": case "LogicalExpression": - return isConstant(node.left) && isConstant(node.right); + return isConstant(node.left) && isConstant(node.right) && node.operator !== "in"; + case "AssignmentExpression": return (node.operator === "=") && isConstant(node.right); + case "SequenceExpression": return isConstant(node.expressions[node.expressions.length - 1]); + // no default } return false; diff --git a/tools/eslint/lib/rules/no-control-regex.js b/tools/eslint/lib/rules/no-control-regex.js index cd57f73451082c..98d22840196090 100644 --- a/tools/eslint/lib/rules/no-control-regex.js +++ b/tools/eslint/lib/rules/no-control-regex.js @@ -11,15 +11,22 @@ module.exports = function(context) { + /** + * Get the regex expression + * @param {ASTNode} node node to evaluate + * @returns {*} Regex if found else null + * @private + */ function getRegExp(node) { - if (node.value instanceof RegExp) { return node.value; } else if (typeof node.value === "string") { var parent = context.getAncestors().pop(); + if ((parent.type === "NewExpression" || parent.type === "CallExpression") && - parent.callee.type === "Identifier" && parent.callee.name === "RegExp") { + parent.callee.type === "Identifier" && parent.callee.name === "RegExp" + ) { // there could be an invalid regular expression string try { @@ -27,20 +34,14 @@ module.exports = function(context) { } catch (ex) { return null; } - } - } else { - return null; } + return null; } - - return { - "Literal": function(node) { - var computedValue, regex = getRegExp(node); diff --git a/tools/eslint/lib/rules/no-dupe-args.js b/tools/eslint/lib/rules/no-dupe-args.js index cb6e558154c56b..5de9b500b65fa1 100644 --- a/tools/eslint/lib/rules/no-dupe-args.js +++ b/tools/eslint/lib/rules/no-dupe-args.js @@ -2,6 +2,8 @@ * @fileoverview Rule to flag duplicate arguments * @author Jamund Ferguson * @copyright 2015 Jamund Ferguson. All rights reserved. + * @copyright 2015 Toru Nagashima. All rights reserved. + * See LICENSE file in root directory for full license. */ "use strict"; @@ -16,6 +18,15 @@ module.exports = function(context) { // Helpers //-------------------------------------------------------------------------- + /** + * Checks whether or not a given definition is a parameter's. + * @param {escope.DefEntry} def - A definition to check. + * @returns {boolean} `true` if the definition is a parameter's. + */ + function isParameter(def) { + return def.type === "Parameter"; + } + /** * Determines if a given node has duplicate parameters. * @param {ASTNode} node The node to check. @@ -23,56 +34,31 @@ module.exports = function(context) { * @private */ function checkParams(node) { - var params = {}, - dups = {}; - - - /** - * Marks a given param as either seen or duplicated. - * @param {string} name The name of the param to mark. - * @returns {void} - * @private - */ - function markParam(name) { - if (params.hasOwnProperty(name)) { - dups[name] = 1; - } else { - params[name] = 1; - } - } - - // loop through and find each duplicate param - node.params.forEach(function(param) { + var variables = context.getDeclaredVariables(node); + var keyMap = Object.create(null); - switch (param.type) { - case "Identifier": - markParam(param.name); - break; + for (var i = 0; i < variables.length; ++i) { + var variable = variables[i]; - case "ObjectPattern": - param.properties.forEach(function(property) { - markParam(property.key.name); - }); - break; + // TODO(nagashima): Remove this duplication check after https://github.com/estools/escope/pull/79 + var key = "$" + variable.name; // to avoid __proto__. - case "ArrayPattern": - param.elements.forEach(function(element) { + if (!isParameter(variable.defs[0]) || keyMap[key]) { + continue; + } + keyMap[key] = true; - // Arrays can be sparse (unwanted arguments) - if (element !== null) { - markParam(element.name); - } - }); - break; + // Checks and reports duplications. + var defs = variable.defs.filter(isParameter); - // no default + if (defs.length >= 2) { + context.report({ + node: node, + message: "Duplicate param '{{name}}'.", + data: {name: variable.name} + }); } - }); - - // log an error for each duplicate (not 2 for each) - Object.keys(dups).forEach(function(currentParam) { - context.report(node, "Duplicate param '{{key}}'.", { key: currentParam }); - }); + } } //-------------------------------------------------------------------------- diff --git a/tools/eslint/lib/rules/no-dupe-class-members.js b/tools/eslint/lib/rules/no-dupe-class-members.js new file mode 100644 index 00000000000000..d61b05136d0f1d --- /dev/null +++ b/tools/eslint/lib/rules/no-dupe-class-members.js @@ -0,0 +1,100 @@ +/** + * @fileoverview A rule to disallow duplicate name in class members. + * @author Toru Nagashima + * @copyright 2015 Toru Nagashima. All rights reserved. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var stack = []; + + /** + * Gets state of a given member name. + * @param {string} name - A name of a member. + * @param {boolean} isStatic - A flag which specifies that is a static member. + * @returns {object} A state of a given member name. + * - retv.init {boolean} A flag which shows the name is declared as normal member. + * - retv.get {boolean} A flag which shows the name is declared as getter. + * - retv.set {boolean} A flag which shows the name is declared as setter. + */ + function getState(name, isStatic) { + var stateMap = stack[stack.length - 1]; + var key = "$" + name; // to avoid "__proto__". + + if (!stateMap[key]) { + stateMap[key] = { + nonStatic: {init: false, get: false, set: false}, + static: {init: false, get: false, set: false} + }; + } + + return stateMap[key][isStatic ? "static" : "nonStatic"]; + } + + /** + * Gets the name text of a given node. + * + * @param {ASTNode} node - A node to get the name. + * @returns {string} The name text of the node. + */ + function getName(node) { + switch (node.type) { + case "Identifier": return node.name; + case "Literal": return String(node.value); + + /* istanbul ignore next: syntax error */ + default: return ""; + } + } + + return { + + // Initializes the stack of state of member declarations. + "Program": function() { + stack = []; + }, + + // Initializes state of member declarations for the class. + "ClassBody": function() { + stack.push(Object.create(null)); + }, + + // Disposes the state for the class. + "ClassBody:exit": function() { + stack.pop(); + }, + + // Reports the node if its name has been declared already. + "MethodDefinition": function(node) { + if (node.computed) { + return; + } + + var name = getName(node.key); + var state = getState(name, node.static); + var isDuplicate = false; + + if (node.kind === "get") { + isDuplicate = (state.init || state.get); + state.get = true; + } else if (node.kind === "set") { + isDuplicate = (state.init || state.set); + state.set = true; + } else { + isDuplicate = (state.init || state.get || state.set); + state.init = true; + } + + if (isDuplicate) { + context.report(node, "Duplicate name '{{name}}'.", {name: name}); + } + } + }; +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-dupe-keys.js b/tools/eslint/lib/rules/no-dupe-keys.js index 1f86c10d6ce187..e07f081b4b8570 100644 --- a/tools/eslint/lib/rules/no-dupe-keys.js +++ b/tools/eslint/lib/rules/no-dupe-keys.js @@ -22,13 +22,18 @@ module.exports = function(context) { var nodeProps = Object.create(null); node.properties.forEach(function(property) { + + if (property.type !== "Property") { + return; + } + var keyName = property.key.name || property.key.value, key = property.kind + "-" + keyName, checkProperty = (!property.computed || property.key.type === "Literal"); if (checkProperty) { if (nodeProps[key]) { - context.report(node, "Duplicate key '{{key}}'.", { key: keyName }); + context.report(node, property.loc.start, "Duplicate key '{{key}}'.", { key: keyName }); } else { nodeProps[key] = true; } diff --git a/tools/eslint/lib/rules/no-duplicate-case.js b/tools/eslint/lib/rules/no-duplicate-case.js index 978e63cade4241..d56fca7696600d 100644 --- a/tools/eslint/lib/rules/no-duplicate-case.js +++ b/tools/eslint/lib/rules/no-duplicate-case.js @@ -1,7 +1,9 @@ /** * @fileoverview Rule to disallow a duplicate case label. - * @author Dieter Oberkofler + * @author Dieter Oberkofler + * @author Burak Yigit Kaya * @copyright 2015 Dieter Oberkofler. All rights reserved. + * @copyright 2015 Burak Yigit Kaya. All rights reserved. */ "use strict"; @@ -12,56 +14,21 @@ module.exports = function(context) { - /** - * Get a hash value for the node - * @param {ASTNode} node The node. - * @returns {string} A hash value for the node. - * @private - */ - function getHash(node) { - if (node.type === "Literal") { - return node.type + typeof node.value + node.value; - } else if (node.type === "Identifier") { - return node.type + typeof node.name + node.name; - } else if (node.type === "MemberExpression") { - return node.type + getHash(node.object) + getHash(node.property); - } else if (node.type === "CallExpression") { - return node.type + getHash(node.callee) + node.arguments.map(getHash).join(""); - } else if (node.type === "BinaryExpression") { - return node.type + getHash(node.left) + node.operator + getHash(node.right); - } else if (node.type === "ConditionalExpression") { - return node.type + getHash(node.test) + getHash(node.consequent) + getHash(node.alternate); - } - } - - var switchStatement = []; - return { + "SwitchStatement": function(node) { + var mapping = {}; - "SwitchStatement": function(/*node*/) { - switchStatement.push({}); - }, - - "SwitchStatement:exit": function(/*node*/) { - switchStatement.pop(); - }, + node.cases.forEach(function(switchCase) { + var key = context.getSource(switchCase.test); - "SwitchCase": function(node) { - var currentSwitch = switchStatement[switchStatement.length - 1], - hashValue; - - if (node.test) { - hashValue = getHash(node.test); - if (typeof hashValue !== "undefined" && currentSwitch.hasOwnProperty(hashValue)) { - context.report(node, "Duplicate case label."); + if (mapping[key]) { + context.report(switchCase, "Duplicate case label."); } else { - currentSwitch[hashValue] = true; + mapping[key] = switchCase; } - } + }); } - }; - }; module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-duplicate-imports.js b/tools/eslint/lib/rules/no-duplicate-imports.js new file mode 100644 index 00000000000000..6c0edbb9990e08 --- /dev/null +++ b/tools/eslint/lib/rules/no-duplicate-imports.js @@ -0,0 +1,126 @@ +/** + * @fileoverview Restrict usage of duplicate imports. + * @author Simen Bekkhus + * @copyright 2016 Simen Bekkhus. All rights reserved. + * See LICENSE file in root directory for full license. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +/** + * Returns the name of the module imported or re-exported. + * + * @param {ASTNode} node - A node to get. + * @returns {string} the name of the module, or empty string if no name. + */ +function getValue(node) { + if (node && node.source && node.source.value) { + return node.source.value.trim(); + } + + return ""; +} + +/** + * Checks if the name of the import or export exists in the given array, and reports if so. + * + * @param {RuleContext} context - The ESLint rule context object. + * @param {ASTNode} node - A node to get. + * @param {string} value - The name of the imported or exported module. + * @param {string[]} array - The array containing other imports or exports in the file. + * @param {string} message - A message to be reported after the name of the module + * + * @returns {void} No return value + */ +function checkAndReport(context, node, value, array, message) { + if (array.indexOf(value) !== -1) { + context.report({ + node: node, + message: "'{{module}}' " + message, + data: {module: value} + }); + } +} + +/** + * @callback nodeCallback + * @param {ASTNode} node - A node to handle. + */ + +/** + * Returns a function handling the imports of a given file + * + * @param {RuleContext} context - The ESLint rule context object. + * @param {boolean} includeExports - Whether or not to check for exports in addition to imports. + * @param {string[]} importsInFile - The array containing other imports in the file. + * @param {string[]} exportsInFile - The array containing other exports in the file. + * + * @returns {nodeCallback} A function passed to ESLint to handle the statement. + */ +function handleImports(context, includeExports, importsInFile, exportsInFile) { + return function(node) { + var value = getValue(node); + + if (value) { + checkAndReport(context, node, value, importsInFile, "import is duplicated."); + + if (includeExports) { + checkAndReport(context, node, value, exportsInFile, "import is duplicated as export."); + } + + importsInFile.push(value); + } + }; +} + +/** + * Returns a function handling the exports of a given file + * + * @param {RuleContext} context - The ESLint rule context object. + * @param {string[]} importsInFile - The array containing other imports in the file. + * @param {string[]} exportsInFile - The array containing other exports in the file. + * + * @returns {nodeCallback} A function passed to ESLint to handle the statement. + */ +function handleExports(context, importsInFile, exportsInFile) { + return function(node) { + var value = getValue(node); + + if (value) { + checkAndReport(context, node, value, exportsInFile, "export is duplicated."); + checkAndReport(context, node, value, importsInFile, "export is duplicated as import."); + + exportsInFile.push(value); + } + }; +} + +module.exports = function(context) { + var includeExports = (context.options[0] || {}).includeExports, + importsInFile = [], + exportsInFile = []; + + var handlers = { + "ImportDeclaration": handleImports(context, includeExports, importsInFile, exportsInFile) + }; + + if (includeExports) { + handlers.ExportNamedDeclaration = handleExports(context, importsInFile, exportsInFile); + handlers.ExportAllDeclaration = handleExports(context, importsInFile, exportsInFile); + } + + return handlers; +}; + +module.exports.schema = [{ + "type": "object", + "properties": { + "includeExports": { + "type": "boolean" + } + }, + "additionalProperties": false +}]; diff --git a/tools/eslint/lib/rules/no-else-return.js b/tools/eslint/lib/rules/no-else-return.js index df674c4753c5b6..33a519e4e0b79c 100644 --- a/tools/eslint/lib/rules/no-else-return.js +++ b/tools/eslint/lib/rules/no-else-return.js @@ -80,15 +80,34 @@ module.exports = function(context) { /** * Check the consequent/body node to make sure it is not * a ReturnStatement or an IfStatement that returns on both - * code paths. If it is, display the context report. + * code paths. * * @param {Node} node The consequent or body node * @param {Node} alternate The alternate node - * @returns {void} + * @returns {boolean} `true` if it is a Return/If node that always returns. */ - function checkForReturnOrIf(node, alternate) { - if (checkForReturn(node) || checkForIf(node)) { - displayReport(alternate); + function checkForReturnOrIf(node) { + return checkForReturn(node) || checkForIf(node); + } + + + /** + * Check whether a node returns in every codepath. + * @param {Node} node The node to be checked + * @returns {boolean} `true` if it returns on every codepath. + */ + function alwaysReturns(node) { + if (node.type === "BlockStatement") { + + // If we have a BlockStatement, check each consequent body node. + return node.body.some(checkForReturnOrIf); + } else { + + /* + * If not a block statement, make sure the consequent isn't a + * ReturnStatement or an IfStatement with returns on both paths. + */ + return checkForReturnOrIf(node); } } @@ -98,23 +117,27 @@ module.exports = function(context) { return { - "IfStatement": function (node) { - // Don't bother finding a ReturnStatement, if there's no `else` - // or if the alternate is also an if (indicating an else if). - if (hasElse(node)) { - var consequent = node.consequent, - alternate = node.alternate; - // If we have a BlockStatement, check each consequent body node. - if (consequent.type === "BlockStatement") { - var body = consequent.body; - body.forEach(function (bodyNode) { - checkForReturnOrIf(bodyNode, alternate); - }); - // If not a block statement, make sure the consequent isn't a ReturnStatement - // or an IfStatement with returns on both paths - } else { - checkForReturnOrIf(consequent, alternate); + "IfStatement": function(node) { + var parent = context.getAncestors().pop(), + consequents, + alternate; + + // Only "top-level" if statements are checked, meaning the first `if` + // in a `if-else-if-...` chain. + if (parent.type === "IfStatement" && parent.alternate === node) { + return; + } + + for (consequents = []; node.type === "IfStatement"; node = node.alternate) { + if (!node.alternate) { + return; } + consequents.push(node.consequent); + alternate = node.alternate; + } + + if (consequents.every(alwaysReturns)) { + displayReport(alternate); } } diff --git a/tools/eslint/lib/rules/no-empty-character-class.js b/tools/eslint/lib/rules/no-empty-character-class.js index ccb01bd40c801e..d6341a124a4e98 100644 --- a/tools/eslint/lib/rules/no-empty-character-class.js +++ b/tools/eslint/lib/rules/no-empty-character-class.js @@ -33,6 +33,7 @@ module.exports = function(context) { "Literal": function(node) { var token = context.getFirstToken(node); + if (token.type === "RegularExpression" && !regex.test(token.value)) { context.report(node, "Empty class."); } @@ -41,3 +42,5 @@ module.exports = function(context) { }; }; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-empty-class.js b/tools/eslint/lib/rules/no-empty-class.js deleted file mode 100644 index 94564f44988830..00000000000000 --- a/tools/eslint/lib/rules/no-empty-class.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @fileoverview Rule to flag the use of empty character classes in regular expressions - * @author Ian Christian Myers - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -/* -plain-English description of the following regexp: -0. `^` fix the match at the beginning of the string -1. `\/`: the `/` that begins the regexp -2. `([^\\[]|\\.|\[([^\\\]]|\\.)+\])*`: regexp contents; 0 or more of the following - 2.0. `[^\\[]`: any character that's not a `\` or a `[` (anything but escape sequences and character classes) - 2.1. `\\.`: an escape sequence - 2.2. `\[([^\\\]]|\\.)+\]`: a character class that isn't empty -3. `\/` the `/` that ends the regexp -4. `[gimy]*`: optional regexp flags -5. `$`: fix the match at the end of the string -*/ -var regex = /^\/([^\\[]|\\.|\[([^\\\]]|\\.)+\])*\/[gimy]*$/; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "Literal": function(node) { - var token = context.getFirstToken(node); - if (token.type === "RegularExpression" && !regex.test(token.value)) { - context.report(node, "Empty class."); - } - } - - }; - -}; - -module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-empty-function.js b/tools/eslint/lib/rules/no-empty-function.js new file mode 100644 index 00000000000000..9ff304d4d7d664 --- /dev/null +++ b/tools/eslint/lib/rules/no-empty-function.js @@ -0,0 +1,150 @@ +/** + * @fileoverview Rule to disallow empty functions. + * @author Toru Nagashima + * @copyright 2016 Toru Nagashima. All rights reserved. + * See LICENSE file in root directory for full license. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +var ALLOW_OPTIONS = Object.freeze([ + "functions", + "arrowFunctions", + "generatorFunctions", + "methods", + "generatorMethods", + "getters", + "setters", + "constructors" +]); +var SHOW_KIND = Object.freeze({ + functions: "function", + arrowFunctions: "arrow function", + generatorFunctions: "generator function", + asyncFunctions: "async function", + methods: "method", + generatorMethods: "generator method", + asyncMethods: "async method", + getters: "getter", + setters: "setter", + constructors: "constructor" +}); + +/** + * Gets the kind of a given function node. + * + * @param {ASTNode} node - A function node to get. This is one of + * an ArrowFunctionExpression, a FunctionDeclaration, or a + * FunctionExpression. + * @returns {string} The kind of the function. This is one of "functions", + * "arrowFunctions", "generatorFunctions", "asyncFunctions", "methods", + * "generatorMethods", "asyncMethods", "getters", "setters", and + * "constructors". + */ +function getKind(node) { + var parent = node.parent; + var kind = ""; + + if (node.type === "ArrowFunctionExpression") { + return "arrowFunctions"; + } + + // Detects main kind. + if (parent.type === "Property") { + if (parent.kind === "get") { + return "getters"; + } + if (parent.kind === "set") { + return "setters"; + } + kind = parent.method ? "methods" : "functions"; + + } else if (parent.type === "MethodDefinition") { + if (parent.kind === "get") { + return "getters"; + } + if (parent.kind === "set") { + return "setters"; + } + if (parent.kind === "constructor") { + return "constructors"; + } + kind = "methods"; + + } else { + kind = "functions"; + } + + // Detects prefix. + var prefix = ""; + + if (node.generator) { + prefix = "generator"; + } else if (node.async) { + prefix = "async"; + } else { + return kind; + } + return prefix + kind[0].toUpperCase() + kind.slice(1); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var options = context.options[0] || {}; + var allowed = options.allow || []; + + /** + * Reports a given function node if the node matches the following patterns. + * + * - Not allowed by options. + * - The body is empty. + * - The body doesn't have any comments. + * + * @param {ASTNode} node - A function node to report. This is one of + * an ArrowFunctionExpression, a FunctionDeclaration, or a + * FunctionExpression. + * @returns {void} + */ + function reportIfEmpty(node) { + var kind = getKind(node); + + if (allowed.indexOf(kind) === -1 && + node.body.type === "BlockStatement" && + node.body.body.length === 0 && + context.getComments(node.body).trailing.length === 0 + ) { + context.report({ + node: node, + loc: node.body.loc.start, + message: "Unexpected empty " + SHOW_KIND[kind] + "." + }); + } + } + + return { + ArrowFunctionExpression: reportIfEmpty, + FunctionDeclaration: reportIfEmpty, + FunctionExpression: reportIfEmpty + }; +}; + +module.exports.schema = [ + { + type: "object", + properties: { + allow: { + type: "array", + items: {enum: ALLOW_OPTIONS}, + uniqueItems: true + } + }, + additionalProperties: false + } +]; diff --git a/tools/eslint/lib/rules/no-empty-label.js b/tools/eslint/lib/rules/no-empty-label.js deleted file mode 100644 index f15694f6d0dc8c..00000000000000 --- a/tools/eslint/lib/rules/no-empty-label.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @fileoverview Rule to flag when label is not used for a loop or switch - * @author Ilya Volodin - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - return { - - "LabeledStatement": function(node) { - var type = node.body.type; - - if (type !== "ForStatement" && type !== "WhileStatement" && type !== "DoWhileStatement" && type !== "SwitchStatement" && type !== "ForInStatement" && type !== "ForOfStatement") { - context.report(node, "Unexpected label {{l}}", {l: node.label.name}); - } - } - }; - -}; - -module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-empty-pattern.js b/tools/eslint/lib/rules/no-empty-pattern.js new file mode 100644 index 00000000000000..aa8515ad191317 --- /dev/null +++ b/tools/eslint/lib/rules/no-empty-pattern.js @@ -0,0 +1,28 @@ +/** + * @fileoverview Rule to disallow an empty pattern + * @author Alberto Rodríguez + * @copyright 2015 Alberto Rodríguez. All rights reserved. + * See LICENSE file in root directory for full license. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + return { + "ObjectPattern": function(node) { + if (node.properties.length === 0) { + context.report(node, "Unexpected empty object pattern."); + } + }, + "ArrayPattern": function(node) { + if (node.elements.length === 0) { + context.report(node, "Unexpected empty array pattern."); + } + } + }; +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-empty.js b/tools/eslint/lib/rules/no-empty.js index 7f1adf58384277..df40433d7b7114 100644 --- a/tools/eslint/lib/rules/no-empty.js +++ b/tools/eslint/lib/rules/no-empty.js @@ -10,13 +10,11 @@ // Rule Definition //------------------------------------------------------------------------------ -module.exports = function(context) { +var FUNCTION_TYPE = /^(?:ArrowFunctionExpression|Function(?:Declaration|Expression))$/; +module.exports = function(context) { return { - "BlockStatement": function(node) { - var parent = node.parent, - parentType = parent.type; // if the body is not empty, we can just return immediately if (node.body.length !== 0) { @@ -24,7 +22,7 @@ module.exports = function(context) { } // a function is generally allowed to be empty - if (parentType === "FunctionDeclaration" || parentType === "FunctionExpression" || parentType === "ArrowFunctionExpression") { + if (FUNCTION_TYPE.test(node.parent.type)) { return; } diff --git a/tools/eslint/lib/rules/no-eval.js b/tools/eslint/lib/rules/no-eval.js index 2347abfc91ab7b..7c47c892f95859 100644 --- a/tools/eslint/lib/rules/no-eval.js +++ b/tools/eslint/lib/rules/no-eval.js @@ -1,26 +1,301 @@ /** * @fileoverview Rule to flag use of eval() statement * @author Nicholas C. Zakas + * @copyright 2015 Toru Nagashima. All rights reserved. * @copyright 2015 Mathias Schreck. All rights reserved. * @copyright 2013 Nicholas C. Zakas. All rights reserved. */ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var astUtils = require("../ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +var candidatesOfGlobalObject = Object.freeze([ + "global", + "window" +]); + +/** + * Checks a given node is a Identifier node of the specified name. + * + * @param {ASTNode} node - A node to check. + * @param {string} name - A name to check. + * @returns {boolean} `true` if the node is a Identifier node of the name. + */ +function isIdentifier(node, name) { + return node.type === "Identifier" && node.name === name; +} + +/** + * Checks a given node is a Literal node of the specified string value. + * + * @param {ASTNode} node - A node to check. + * @param {string} name - A name to check. + * @returns {boolean} `true` if the node is a Literal node of the name. + */ +function isConstant(node, name) { + switch (node.type) { + case "Literal": + return node.value === name; + + case "TemplateLiteral": + return ( + node.expressions.length === 0 && + node.quasis[0].value.cooked === name + ); + + default: + return false; + } +} + +/** + * Checks a given node is a MemberExpression node which has the specified name's + * property. + * + * @param {ASTNode} node - A node to check. + * @param {string} name - A name to check. + * @returns {boolean} `true` if the node is a MemberExpression node which has + * the specified name's property + */ +function isMember(node, name) { + return ( + node.type === "MemberExpression" && + (node.computed ? isConstant : isIdentifier)(node.property, name) + ); +} + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = function(context) { + var allowIndirect = Boolean( + context.options[0] && + context.options[0].allowIndirect + ); + var sourceCode = context.getSourceCode(); + var funcInfo = null; + + /** + * Pushs a variable scope (Program or Function) information to the stack. + * + * This is used in order to check whether or not `this` binding is a + * reference to the global object. + * + * @param {ASTNode} node - A node of the scope. This is one of Program, + * FunctionDeclaration, FunctionExpression, and ArrowFunctionExpression. + * @returns {void} + */ + function enterVarScope(node) { + var strict = context.getScope().isStrict; + + funcInfo = { + upper: funcInfo, + node: node, + strict: strict, + defaultThis: false, + initialized: strict + }; + } + + /** + * Pops a variable scope from the stack. + * + * @returns {void} + */ + function exitVarScope() { + funcInfo = funcInfo.upper; + } + + /** + * Reports a given node. + * + * `node` is `Identifier` or `MemberExpression`. + * The parent of `node` might be `CallExpression`. + * + * The location of the report is always `eval` `Identifier` (or possibly + * `Literal`). The type of the report is `CallExpression` if the parent is + * `CallExpression`. Otherwise, it's the given node type. + * + * @param {ASTNode} node - A node to report. + * @returns {void} + */ + function report(node) { + var locationNode = node; + var parent = node.parent; + + if (node.type === "MemberExpression") { + locationNode = node.property; + } + if (parent.type === "CallExpression" && parent.callee === node) { + node = parent; + } + + context.report({ + node: node, + loc: locationNode.loc.start, + message: "eval can be harmful." + }); + } + + /** + * Reports accesses of `eval` via the global object. + * + * @param {escope.Scope} globalScope - The global scope. + * @returns {void} + */ + function reportAccessingEvalViaGlobalObject(globalScope) { + for (var i = 0; i < candidatesOfGlobalObject.length; ++i) { + var name = candidatesOfGlobalObject[i]; + var variable = astUtils.getVariableByName(globalScope, name); + + if (!variable) { + continue; + } + + var references = variable.references; + + for (var j = 0; j < references.length; ++j) { + var identifier = references[j].identifier; + var node = identifier.parent; + + // To detect code like `window.window.eval`. + while (isMember(node, name)) { + node = node.parent; + } + + // Reports. + if (isMember(node, "eval")) { + report(node); + } + } + } + } + + /** + * Reports all accesses of `eval` (excludes direct calls to eval). + * + * @param {escope.Scope} globalScope - The global scope. + * @returns {void} + */ + function reportAccessingEval(globalScope) { + var variable = astUtils.getVariableByName(globalScope, "eval"); + + if (!variable) { + return; + } + + var references = variable.references; + + for (var i = 0; i < references.length; ++i) { + var reference = references[i]; + var id = reference.identifier; + + if (id.name === "eval" && !astUtils.isCallee(id)) { + + // Is accessing to eval (excludes direct calls to eval) + report(id); + } + } + } + + if (allowIndirect) { + + // Checks only direct calls to eval. It's simple! + return { + "CallExpression:exit": function(node) { + var callee = node.callee; + + if (isIdentifier(callee, "eval")) { + report(callee); + } + } + }; + } return { - "CallExpression": function(node) { - if (node.callee.name === "eval") { - context.report(node, "eval can be harmful."); + "CallExpression:exit": function(node) { + var callee = node.callee; + + if (isIdentifier(callee, "eval")) { + report(callee); + } + }, + + "Program": function(node) { + var scope = context.getScope(), + features = context.parserOptions.ecmaFeatures || {}, + strict = + scope.isStrict || + node.sourceType === "module" || + (features.globalReturn && scope.childScopes[0].isStrict); + + funcInfo = { + upper: null, + node: node, + strict: strict, + defaultThis: true, + initialized: true + }; + }, + + "Program:exit": function() { + var globalScope = context.getScope(); + + exitVarScope(); + reportAccessingEval(globalScope); + reportAccessingEvalViaGlobalObject(globalScope); + }, + + "FunctionDeclaration": enterVarScope, + "FunctionDeclaration:exit": exitVarScope, + "FunctionExpression": enterVarScope, + "FunctionExpression:exit": exitVarScope, + "ArrowFunctionExpression": enterVarScope, + "ArrowFunctionExpression:exit": exitVarScope, + + "ThisExpression": function(node) { + if (!isMember(node.parent, "eval")) { + return; + } + + /* + * `this.eval` is found. + * Checks whether or not the value of `this` is the global object. + */ + if (!funcInfo.initialized) { + funcInfo.initialized = true; + funcInfo.defaultThis = astUtils.isDefaultThisBinding( + funcInfo.node, + sourceCode + ); + } + + if (!funcInfo.strict && funcInfo.defaultThis) { + + // `this.eval` is possible built-in `eval`. + report(node.parent); } } }; }; -module.exports.schema = []; +module.exports.schema = [ + { + "type": "object", + "properties": { + "allowIndirect": {"type": "boolean"} + }, + "additionalProperties": false + } +]; diff --git a/tools/eslint/lib/rules/no-ex-assign.js b/tools/eslint/lib/rules/no-ex-assign.js index e9fd94bb775bf4..e658e475b46b27 100644 --- a/tools/eslint/lib/rules/no-ex-assign.js +++ b/tools/eslint/lib/rules/no-ex-assign.js @@ -5,36 +5,31 @@ "use strict"; +var astUtils = require("../ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = function(context) { - var catchStack = []; + /** + * Finds and reports references that are non initializer and writable. + * @param {Variable} variable - A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + astUtils.getModifyingReferences(variable.references).forEach(function(reference) { + context.report( + reference.identifier, + "Do not assign to the exception parameter."); + }); + } return { - "CatchClause": function(node) { - catchStack.push(node.param.name); - }, - - "CatchClause:exit": function() { - catchStack.pop(); - }, - - "AssignmentExpression": function(node) { - - if (catchStack.length > 0) { - - var exceptionName = catchStack[catchStack.length - 1]; - - if (node.left.name && node.left.name === exceptionName) { - context.report(node, "Do not assign to the exception parameter."); - } - } + context.getDeclaredVariables(node).forEach(checkVariable); } - }; }; diff --git a/tools/eslint/lib/rules/no-extend-native.js b/tools/eslint/lib/rules/no-extend-native.js index 28404194b4dd45..cf2cf33f3a02e5 100644 --- a/tools/eslint/lib/rules/no-extend-native.js +++ b/tools/eslint/lib/rules/no-extend-native.js @@ -9,11 +9,7 @@ // Requirements //------------------------------------------------------------------------------ -var BUILTINS = [ - "Object", "Function", "Array", "String", "Boolean", "Number", "Date", - "RegExp", "Error", "EvalError", "RangeError", "ReferenceError", - "SyntaxError", "TypeError", "URIError" -]; +var globals = require("globals"); //------------------------------------------------------------------------------ // Rule Definition @@ -23,10 +19,12 @@ module.exports = function(context) { var config = context.options[0] || {}; var exceptions = config.exceptions || []; - var modifiedBuiltins = BUILTINS; + var modifiedBuiltins = Object.keys(globals.builtin).filter(function(builtin) { + return builtin[0].toUpperCase() === builtin[0]; + }); if (exceptions.length) { - modifiedBuiltins = BUILTINS.filter(function(builtIn) { + modifiedBuiltins = modifiedBuiltins.filter(function(builtIn) { return exceptions.indexOf(builtIn) === -1; }); } @@ -35,7 +33,8 @@ module.exports = function(context) { // handle the Array.prototype.extra style case "AssignmentExpression": function(node) { - var lhs = node.left, affectsProto; + var lhs = node.left, + affectsProto; if (lhs.type !== "MemberExpression" || lhs.object.type !== "MemberExpression") { return; @@ -56,22 +55,21 @@ module.exports = function(context) { }); }, - // handle the Object.defineProperty(Array.prototype) case + // handle the Object.definePropert[y|ies](Array.prototype) case "CallExpression": function(node) { var callee = node.callee, subject, object; - // only worry about Object.defineProperty + // only worry about Object.definePropert[y|ies] if (callee.type === "MemberExpression" && callee.object.name === "Object" && - callee.property.name === "defineProperty") { + (callee.property.name === "defineProperty" || callee.property.name === "defineProperties")) { // verify the object being added to is a native prototype subject = node.arguments[0]; - object = subject.object; - + object = subject && subject.object; if (object && object.type === "Identifier" && (modifiedBuiltins.indexOf(object.name) > -1) && diff --git a/tools/eslint/lib/rules/no-extra-bind.js b/tools/eslint/lib/rules/no-extra-bind.js index 58ba05b74187df..cd800eabd7733a 100644 --- a/tools/eslint/lib/rules/no-extra-bind.js +++ b/tools/eslint/lib/rules/no-extra-bind.js @@ -2,6 +2,8 @@ * @fileoverview Rule to flag unnecessary bind calls * @author Bence Dányi * @copyright 2014 Bence Dányi. All rights reserved. + * @copyright 2016 Toru Nagashima. All rights reserved. + * See LICENSE in root directory for full license. */ "use strict"; @@ -10,72 +12,138 @@ //------------------------------------------------------------------------------ module.exports = function(context) { + var scopeInfo = null; - var scope = [{ - depth: -1, - found: 0 - }]; + /** + * Reports a given function node. + * + * @param {ASTNode} node - A node to report. This is a FunctionExpression or + * an ArrowFunctionExpression. + * @returns {void} + */ + function report(node) { + context.report({ + node: node.parent.parent, + message: "The function binding is unnecessary.", + loc: node.parent.property.loc.start + }); + } + + /** + * Gets the property name of a given node. + * If the property name is dynamic, this returns an empty string. + * + * @param {ASTNode} node - A node to check. This is a MemberExpression. + * @returns {string} The property name of the node. + */ + function getPropertyName(node) { + if (node.computed) { + switch (node.property.type) { + case "Literal": + return String(node.property.value); + case "TemplateLiteral": + if (node.property.expressions.length === 0) { + return node.property.quasis[0].value.cooked; + } + + // fallthrough + default: + return false; + } + } + return node.property.name; + } /** - * Get the topmost scope - * @returns {Object} The topmost scope + * Checks whether or not a given function node is the callee of `.bind()` + * method. + * + * e.g. `(function() {}.bind(foo))` + * + * @param {ASTNode} node - A node to report. This is a FunctionExpression or + * an ArrowFunctionExpression. + * @returns {boolean} `true` if the node is the callee of `.bind()` method. */ - function getTopScope() { - return scope[scope.length - 1]; + function isCalleeOfBindMethod(node) { + var parent = node.parent; + var grandparent = parent.parent; + + return ( + grandparent && + grandparent.type === "CallExpression" && + grandparent.callee === parent && + grandparent.arguments.length === 1 && + parent.type === "MemberExpression" && + parent.object === node && + getPropertyName(parent) === "bind" + ); } /** - * Increment the depth of the top scope + * Adds a scope information object to the stack. + * + * @param {ASTNode} node - A node to add. This node is a FunctionExpression + * or a FunctionDeclaration node. * @returns {void} */ - function incrementScopeDepth() { - var top = getTopScope(); - top.depth++; + function enterFunction(node) { + scopeInfo = { + isBound: isCalleeOfBindMethod(node), + thisFound: false, + upper: scopeInfo + }; } /** - * Decrement the depth of the top scope + * Removes the scope information object from the top of the stack. + * At the same time, this reports the function node if the function has + * `.bind()` and the `this` keywords found. + * + * @param {ASTNode} node - A node to remove. This node is a + * FunctionExpression or a FunctionDeclaration node. * @returns {void} */ - function decrementScopeDepth() { - var top = getTopScope(); - top.depth--; + function exitFunction(node) { + if (scopeInfo.isBound && !scopeInfo.thisFound) { + report(node); + } + + scopeInfo = scopeInfo.upper; } - return { - "CallExpression": function(node) { - if (node.arguments.length === 1 && - node.callee.type === "MemberExpression" && - node.callee.property.name === "bind" && - /FunctionExpression$/.test(node.callee.object.type)) { - scope.push({ - call: node, - depth: -1, - found: 0 - }); - } - }, - "CallExpression:exit": function(node) { - var top = getTopScope(); - if (top.call === node && top.found === 0) { - context.report(node, "The function binding is unnecessary."); - scope.pop(); - } - }, - "ArrowFunctionExpression": incrementScopeDepth, - "ArrowFunctionExpression:exit": decrementScopeDepth, - "FunctionExpression": incrementScopeDepth, - "FunctionExpression:exit": decrementScopeDepth, - "FunctionDeclaration": incrementScopeDepth, - "FunctionDeclaration:exit": decrementScopeDepth, - "ThisExpression": function() { - var top = getTopScope(); - if (top.depth === 0) { - top.found++; - } + /** + * Reports a given arrow function if the function is callee of `.bind()` + * method. + * + * @param {ASTNode} node - A node to report. This node is an + * ArrowFunctionExpression. + * @returns {void} + */ + function exitArrowFunction(node) { + if (isCalleeOfBindMethod(node)) { + report(node); } - }; + } + /** + * Set the mark as the `this` keyword was found in this scope. + * + * @returns {void} + */ + function markAsThisFound() { + if (scopeInfo) { + scopeInfo.thisFound = true; + } + } + + return { + "ArrowFunctionExpression:exit": exitArrowFunction, + "FunctionDeclaration": enterFunction, + "FunctionDeclaration:exit": exitFunction, + "FunctionExpression": enterFunction, + "FunctionExpression:exit": exitFunction, + "ThisExpression": markAsThisFound + }; }; module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-extra-boolean-cast.js b/tools/eslint/lib/rules/no-extra-boolean-cast.js index d27f3609a9a2a7..c7ee1adc6b87fb 100644 --- a/tools/eslint/lib/rules/no-extra-boolean-cast.js +++ b/tools/eslint/lib/rules/no-extra-boolean-cast.js @@ -11,8 +11,36 @@ module.exports = function(context) { + // Node types which have a test which will coerce values to booleans. + var BOOLEAN_NODE_TYPES = [ + "IfStatement", + "DoWhileStatement", + "WhileStatement", + "ConditionalExpression", + "ForStatement" + ]; + + /** + * Check if a node is in a context where its value would be coerced to a boolean at runtime. + * + * @param {Object} node The node + * @param {Object} parent Its parent + * @returns {Boolean} If it is in a boolean context + */ + function isInBooleanContext(node, parent) { + return ( + (BOOLEAN_NODE_TYPES.indexOf(parent.type) !== -1 && + node === parent.test) || + + // ! + (parent.type === "UnaryExpression" && + parent.operator === "!") + ); + } + + return { - "UnaryExpression": function (node) { + "UnaryExpression": function(node) { var ancestors = context.getAncestors(), parent = ancestors.pop(), grandparent = ancestors.pop(); @@ -24,44 +52,25 @@ module.exports = function(context) { return; } - // if () ... - if (grandparent.type === "IfStatement") { - context.report(node, "Redundant double negation in an if statement condition."); - - // do ... while () - } else if (grandparent.type === "DoWhileStatement") { - context.report(node, "Redundant double negation in a do while loop condition."); - - // while () ... - } else if (grandparent.type === "WhileStatement") { - context.report(node, "Redundant double negation in a while loop condition."); - - // ? ... : ... - } else if ((grandparent.type === "ConditionalExpression" && - parent === grandparent.test)) { - context.report(node, "Redundant double negation in a ternary condition."); + if (isInBooleanContext(parent, grandparent) || - // for (...; ; ...) ... - } else if ((grandparent.type === "ForStatement" && - parent === grandparent.test)) { - context.report(node, "Redundant double negation in a for loop condition."); - - // ! - } else if ((grandparent.type === "UnaryExpression" && - grandparent.operator === "!")) { - context.report(node, "Redundant multiple negation."); - - // Boolean() - } else if ((grandparent.type === "CallExpression" && + // Boolean() and new Boolean() + ((grandparent.type === "CallExpression" || grandparent.type === "NewExpression") && grandparent.callee.type === "Identifier" && - grandparent.callee.name === "Boolean")) { - context.report(node, "Redundant double negation in call to Boolean()."); + grandparent.callee.name === "Boolean") + ) { + context.report(node, "Redundant double negation."); + } + }, + "CallExpression": function(node) { + var parent = node.parent; - // new Boolean() - } else if ((grandparent.type === "NewExpression" && - grandparent.callee.type === "Identifier" && - grandparent.callee.name === "Boolean")) { - context.report(node, "Redundant double negation in Boolean constructor call."); + if (node.callee.type !== "Identifier" || node.callee.name !== "Boolean") { + return; + } + + if (isInBooleanContext(node, parent)) { + context.report(node, "Redundant Boolean call."); } } }; diff --git a/tools/eslint/lib/rules/no-extra-label.js b/tools/eslint/lib/rules/no-extra-label.js new file mode 100644 index 00000000000000..c11a7035764d30 --- /dev/null +++ b/tools/eslint/lib/rules/no-extra-label.js @@ -0,0 +1,132 @@ +/** + * @fileoverview Rule to disallow unnecessary labels + * @author Toru Nagashima + * @copyright 2016 Toru Nagashima. All rights reserved. + * See LICENSE file in root directory for full license. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var astUtils = require("../ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var scopeInfo = null; + + /** + * Creates a new scope with a breakable statement. + * + * @param {ASTNode} node - A node to create. This is a BreakableStatement. + * @returns {void} + */ + function enterBreakableStatement(node) { + scopeInfo = { + label: astUtils.getLabel(node), + breakable: true, + upper: scopeInfo + }; + } + + /** + * Removes the top scope of the stack. + * + * @returns {void} + */ + function exitBreakableStatement() { + scopeInfo = scopeInfo.upper; + } + + /** + * Creates a new scope with a labeled statement. + * + * This ignores it if the body is a breakable statement. + * In this case it's handled in the `enterBreakableStatement` function. + * + * @param {ASTNode} node - A node to create. This is a LabeledStatement. + * @returns {void} + */ + function enterLabeledStatement(node) { + if (!astUtils.isBreakableStatement(node.body)) { + scopeInfo = { + label: node.label.name, + breakable: false, + upper: scopeInfo + }; + } + } + + /** + * Removes the top scope of the stack. + * + * This ignores it if the body is a breakable statement. + * In this case it's handled in the `exitBreakableStatement` function. + * + * @param {ASTNode} node - A node. This is a LabeledStatement. + * @returns {void} + */ + function exitLabeledStatement(node) { + if (!astUtils.isBreakableStatement(node.body)) { + scopeInfo = scopeInfo.upper; + } + } + + /** + * Reports a given control node if it's unnecessary. + * + * @param {ASTNode} node - A node. This is a BreakStatement or a + * ContinueStatement. + * @returns {void} + */ + function reportIfUnnecessary(node) { + if (!node.label) { + return; + } + + var labelNode = node.label; + var label = labelNode.name; + var info = scopeInfo; + + while (info) { + if (info.breakable || info.label === label) { + if (info.breakable && info.label === label) { + context.report({ + node: labelNode, + message: "This label '{{name}}' is unnecessary.", + data: labelNode + }); + } + return; + } + + info = info.upper; + } + } + + return { + "WhileStatement": enterBreakableStatement, + "WhileStatement:exit": exitBreakableStatement, + "DoWhileStatement": enterBreakableStatement, + "DoWhileStatement:exit": exitBreakableStatement, + "ForStatement": enterBreakableStatement, + "ForStatement:exit": exitBreakableStatement, + "ForInStatement": enterBreakableStatement, + "ForInStatement:exit": exitBreakableStatement, + "ForOfStatement": enterBreakableStatement, + "ForOfStatement:exit": exitBreakableStatement, + "SwitchStatement": enterBreakableStatement, + "SwitchStatement:exit": exitBreakableStatement, + "LabeledStatement": enterLabeledStatement, + "LabeledStatement:exit": exitLabeledStatement, + "BreakStatement": reportIfUnnecessary, + "ContinueStatement": reportIfUnnecessary + }; +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-extra-parens.js b/tools/eslint/lib/rules/no-extra-parens.js index 12b4c5d8761a51..50f5160b208c56 100644 --- a/tools/eslint/lib/rules/no-extra-parens.js +++ b/tools/eslint/lib/rules/no-extra-parens.js @@ -2,6 +2,7 @@ * @fileoverview Disallow parenthesising higher precedence subexpressions. * @author Michael Ficarra * @copyright 2014 Michael Ficarra. All rights reserved. + * See LICENSE file in root directory for full license. */ "use strict"; @@ -9,9 +10,13 @@ // Rule Definition //------------------------------------------------------------------------------ -module.exports = function(context) { +var astUtils = require("../ast-utils.js"); +module.exports = function(context) { + var isParenthesised = astUtils.isParenthesised.bind(astUtils, context); var ALL_NODES = context.options[0] !== "functions"; + var EXCEPT_COND_ASSIGN = ALL_NODES && context.options[1] && context.options[1].conditionalAssign === false; + var sourceCode = context.getSourceCode(); /** * Determines if this rule should be enforced for a node given the current configuration. @@ -23,21 +28,6 @@ module.exports = function(context) { return ALL_NODES || node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression"; } - /** - * Determines if a node is surrounded by parentheses. - * @param {ASTNode} node - The node to be checked. - * @returns {boolean} True if the node is parenthesised. - * @private - */ - function isParenthesised(node) { - var previousToken = context.getTokenBefore(node), - nextToken = context.getTokenAfter(node); - - return previousToken && nextToken && - previousToken.value === "(" && previousToken.range[1] <= node.range[0] && - nextToken.value === ")" && nextToken.range[0] >= node.range[1]; - } - /** * Determines if a node is surrounded by parentheses twice. * @param {ASTNode} node - The node to be checked. @@ -74,6 +64,101 @@ module.exports = function(context) { return ruleApplies(node) && isParenthesisedTwice(node); } + /** + * Determines if a node test expression is allowed to have a parenthesised assignment + * @param {ASTNode} node - The node to be checked. + * @returns {boolean} True if the assignment can be parenthesised. + * @private + */ + function isCondAssignException(node) { + return EXCEPT_COND_ASSIGN && node.test.type === "AssignmentExpression"; + } + + /** + * Determines if a node following a [no LineTerminator here] restriction is + * surrounded by (potentially) invalid extra parentheses. + * @param {Token} token - The token preceding the [no LineTerminator here] restriction. + * @param {ASTNode} node - The node to be checked. + * @returns {boolean} True if the node is incorrectly parenthesised. + * @private + */ + function hasExcessParensNoLineTerminator(token, node) { + if (token.loc.end.line === node.loc.start.line) { + return hasExcessParens(node); + } + + return hasDoubleExcessParens(node); + } + + /** + * Checks whether or not a given node is located at the head of ExpressionStatement. + * @param {ASTNode} node - A node to check. + * @returns {boolean} `true` if the node is located at the head of ExpressionStatement. + */ + function isHeadOfExpressionStatement(node) { + var parent = node.parent; + + while (parent) { + switch (parent.type) { + case "SequenceExpression": + if (parent.expressions[0] !== node || isParenthesised(node)) { + return false; + } + break; + + case "UnaryExpression": + case "UpdateExpression": + if (parent.prefix || isParenthesised(node)) { + return false; + } + break; + + case "BinaryExpression": + case "LogicalExpression": + if (parent.left !== node || isParenthesised(node)) { + return false; + } + break; + + case "ConditionalExpression": + if (parent.test !== node || isParenthesised(node)) { + return false; + } + break; + + case "CallExpression": + if (parent.callee !== node || isParenthesised(node)) { + return false; + } + break; + + case "MemberExpression": + if (parent.object !== node || isParenthesised(node)) { + return false; + } + break; + + case "ExpressionStatement": + return true; + + default: + return false; + } + + node = parent; + parent = parent.parent; + } + + /* istanbul ignore next */ + throw new Error("unreachable"); + } + + /** + * Get the precedence level based on the node type + * @param {ASTNode} node node to evaluate + * @returns {int} precedence level + * @private + */ function precedence(node) { switch (node.type) { @@ -94,11 +179,14 @@ module.exports = function(context) { return 4; case "&&": return 5; + // no default } /* falls through */ + case "BinaryExpression": + switch (node.operator) { case "|": return 6; @@ -129,41 +217,69 @@ module.exports = function(context) { case "/": case "%": return 13; + // no default } + /* falls through */ + case "UnaryExpression": return 14; + case "UpdateExpression": return 15; + case "CallExpression": + // IIFE is allowed to have parens in any position (#655) if (node.callee.type === "FunctionExpression") { return -1; } return 16; + case "NewExpression": return 17; + // no default } return 18; } + /** + * Report the node + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ function report(node) { var previousToken = context.getTokenBefore(node); + context.report(node, previousToken.loc.start, "Gratuitous parentheses around expression."); } + /** + * Evaluate Unary update + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ function dryUnaryUpdate(node) { if (hasExcessParens(node.argument) && precedence(node.argument) >= precedence(node)) { report(node.argument); } } + /** + * Evaluate a new call + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ function dryCallNew(node) { if (hasExcessParens(node.callee) && precedence(node.callee) >= precedence(node) && !( node.type === "CallExpression" && node.callee.type === "FunctionExpression" && + // One set of parentheses are allowed for a function expression !hasDoubleExcessParens(node.callee) )) { @@ -182,8 +298,15 @@ module.exports = function(context) { } } + /** + * Evaluate binary logicals + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ function dryBinaryLogical(node) { var prec = precedence(node); + if (hasExcessParens(node.left) && precedence(node.left) >= prec) { report(node.left); } @@ -200,6 +323,7 @@ module.exports = function(context) { } }); }, + "ArrowFunctionExpression": function(node) { if (node.body.type !== "BlockStatement") { if (node.body.type !== "ObjectExpression" && hasExcessParens(node.body) && precedence(node.body) >= precedence({type: "AssignmentExpression"})) { @@ -207,20 +331,23 @@ module.exports = function(context) { return; } - // Object literals *must* be parenthesized + // Object literals *must* be parenthesised if (node.body.type === "ObjectExpression" && hasDoubleExcessParens(node.body)) { report(node.body); return; } } }, + "AssignmentExpression": function(node) { if (hasExcessParens(node.right) && precedence(node.right) >= precedence(node)) { report(node.right); } }, + "BinaryExpression": dryBinaryLogical, "CallExpression": dryCallNew, + "ConditionalExpression": function(node) { if (hasExcessParens(node.test) && precedence(node.test) >= precedence({type: "LogicalExpression", operator: "||"})) { report(node.test); @@ -232,38 +359,55 @@ module.exports = function(context) { report(node.alternate); } }, + "DoWhileStatement": function(node) { - if (hasDoubleExcessParens(node.test)) { + if (hasDoubleExcessParens(node.test) && !isCondAssignException(node)) { report(node.test); } }, + "ExpressionStatement": function(node) { - var firstToken; - if (hasExcessParens(node.expression) && node.expression.type !== "CallExpression") { - firstToken = context.getFirstToken(node.expression); - // Pure object literals ({}) do not need parentheses but - // member expressions do ({}.toString()) - if (firstToken.value !== "{" || node.expression.type === "ObjectExpression") { + var firstToken, secondToken, firstTokens; + + if (hasExcessParens(node.expression)) { + firstTokens = context.getFirstTokens(node.expression, 2); + firstToken = firstTokens[0]; + secondToken = firstTokens[1]; + + if ( + !firstToken || + firstToken.value !== "{" && + firstToken.value !== "function" && + firstToken.value !== "class" && + ( + firstToken.value !== "let" || + !secondToken || + secondToken.value !== "[" + ) + ) { report(node.expression); } } }, + "ForInStatement": function(node) { if (hasExcessParens(node.right)) { report(node.right); } }, + "ForOfStatement": function(node) { if (hasExcessParens(node.right)) { report(node.right); } }, + "ForStatement": function(node) { if (node.init && hasExcessParens(node.init)) { report(node.init); } - if (node.test && hasExcessParens(node.test)) { + if (node.test && hasExcessParens(node.test) && !isCondAssignException(node)) { report(node.test); } @@ -271,12 +415,15 @@ module.exports = function(context) { report(node.update); } }, + "IfStatement": function(node) { - if (hasDoubleExcessParens(node.test)) { + if (hasDoubleExcessParens(node.test) && !isCondAssignException(node)) { report(node.test); } }, + "LogicalExpression": dryBinaryLogical, + "MemberExpression": function(node) { if ( hasExcessParens(node.object) && @@ -288,9 +435,15 @@ module.exports = function(context) { typeof node.object.value === "number" && /^[0-9]+$/.test(context.getFirstToken(node.object).value)) || + // RegExp literal is allowed to have parens (#1589) (node.object.type === "Literal" && node.object.regex) ) + ) && + !( + (node.object.type === "FunctionExpression" || node.object.type === "ClassExpression") && + isHeadOfExpressionStatement(node) && + !hasDoubleExcessParens(node.object) ) ) { report(node.object); @@ -299,22 +452,31 @@ module.exports = function(context) { report(node.property); } }, + "NewExpression": dryCallNew, + "ObjectExpression": function(node) { [].forEach.call(node.properties, function(e) { var v = e.value; + if (v && hasExcessParens(v) && precedence(v) >= precedence({type: "AssignmentExpression"})) { report(v); } }); }, + "ReturnStatement": function(node) { - if (node.argument && hasExcessParens(node.argument) && + var returnToken = sourceCode.getFirstToken(node); + + if (node.argument && + hasExcessParensNoLineTerminator(returnToken, node.argument) && + // RegExp literal is allowed to have parens (#1589) !(node.argument.type === "Literal" && node.argument.regex)) { report(node.argument); } }, + "SequenceExpression": function(node) { [].forEach.call(node.expressions, function(e) { if (hasExcessParens(e) && precedence(e) >= precedence(node)) { @@ -322,47 +484,97 @@ module.exports = function(context) { } }); }, + "SwitchCase": function(node) { if (node.test && hasExcessParens(node.test)) { report(node.test); } }, + "SwitchStatement": function(node) { if (hasDoubleExcessParens(node.discriminant)) { report(node.discriminant); } }, + "ThrowStatement": function(node) { - if (hasExcessParens(node.argument)) { + var throwToken = sourceCode.getFirstToken(node); + + if (hasExcessParensNoLineTerminator(throwToken, node.argument)) { report(node.argument); } }, + "UnaryExpression": dryUnaryUpdate, "UpdateExpression": dryUnaryUpdate, + "VariableDeclarator": function(node) { if (node.init && hasExcessParens(node.init) && precedence(node.init) >= precedence({type: "AssignmentExpression"}) && + // RegExp literal is allowed to have parens (#1589) !(node.init.type === "Literal" && node.init.regex)) { report(node.init); } }, + "WhileStatement": function(node) { - if (hasDoubleExcessParens(node.test)) { + if (hasDoubleExcessParens(node.test) && !isCondAssignException(node)) { report(node.test); } }, + "WithStatement": function(node) { if (hasDoubleExcessParens(node.object)) { report(node.object); } + }, + + "YieldExpression": function(node) { + var yieldToken; + + if (node.argument) { + yieldToken = sourceCode.getFirstToken(node); + + if ((precedence(node.argument) >= precedence(node) && + hasExcessParensNoLineTerminator(yieldToken, node.argument)) || + hasDoubleExcessParens(node.argument)) { + report(node.argument); + } + } } }; }; -module.exports.schema = [ - { - "enum": ["all", "functions"] - } -]; +module.exports.schema = { + "anyOf": [ + { + "type": "array", + "items": [ + { + "enum": ["functions"] + } + ], + "minItems": 0, + "maxItems": 1 + }, + { + "type": "array", + "items": [ + { + "enum": ["all"] + }, + { + "type": "object", + "properties": { + "conditionalAssign": {"type": "boolean"} + }, + "additionalProperties": false + } + ], + "minItems": 0, + "maxItems": 2 + } + ] +}; diff --git a/tools/eslint/lib/rules/no-extra-semi.js b/tools/eslint/lib/rules/no-extra-semi.js index a3897ef2275073..9639ae178eaaf8 100644 --- a/tools/eslint/lib/rules/no-extra-semi.js +++ b/tools/eslint/lib/rules/no-extra-semi.js @@ -17,7 +17,13 @@ module.exports = function(context) { * @returns {void} */ function report(nodeOrToken) { - context.report(nodeOrToken, "Unnecessary semicolon."); + context.report({ + node: nodeOrToken, + message: "Unnecessary semicolon.", + fix: function(fixer) { + return fixer.remove(nodeOrToken); + } + }); } /** @@ -39,12 +45,20 @@ module.exports = function(context) { } return { + /** - * Reports this empty statement. + * Reports this empty statement, except if the parent node is a loop. * @param {Node} node - A EmptyStatement node to be reported. * @returns {void} */ - "EmptyStatement": report, + "EmptyStatement": function(node) { + var parent = node.parent, + allowedParentTypes = ["ForStatement", "ForInStatement", "ForOfStatement", "WhileStatement", "DoWhileStatement"]; + + if (allowedParentTypes.indexOf(parent.type) === -1) { + report(node); + } + }, /** * Checks tokens from the head of this class body to the first MethodDefinition or the end of this class body. diff --git a/tools/eslint/lib/rules/no-extra-strict.js b/tools/eslint/lib/rules/no-extra-strict.js deleted file mode 100644 index a6b3bc1855ee5b..00000000000000 --- a/tools/eslint/lib/rules/no-extra-strict.js +++ /dev/null @@ -1,86 +0,0 @@ -/** - * @fileoverview Rule to flag unnecessary strict directives. - * @author Ian Christian Myers - * @copyright 2014 Ian Christian Myers. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - function directives(block) { - var ds = [], body = block.body, e, i, l; - - if (body) { - for (i = 0, l = body.length; i < l; ++i) { - e = body[i]; - - if ( - e.type === "ExpressionStatement" && - e.expression.type === "Literal" && - typeof e.expression.value === "string" - ) { - ds.push(e.expression); - } else { - break; - } - } - } - - return ds; - } - - function isStrict(directive) { - return directive.value === "use strict"; - } - - function checkForUnnecessaryUseStrict(node) { - var useStrictDirectives = directives(node).filter(isStrict), - scope, - upper; - - switch (useStrictDirectives.length) { - case 0: - break; - - case 1: - scope = context.getScope(); - upper = scope.upper; - - if (upper && upper.functionExpressionScope) { - upper = upper.upper; - } - - if (upper && upper.isStrict) { - context.report(useStrictDirectives[0], "Unnecessary 'use strict'."); - } - break; - - default: - context.report(useStrictDirectives[1], "Multiple 'use strict' directives."); - } - } - - return { - - "Program": checkForUnnecessaryUseStrict, - - "ArrowFunctionExpression": function(node) { - checkForUnnecessaryUseStrict(node.body); - }, - - "FunctionExpression": function(node) { - checkForUnnecessaryUseStrict(node.body); - }, - - "FunctionDeclaration": function(node) { - checkForUnnecessaryUseStrict(node.body); - } - }; - -}; - -module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-fallthrough.js b/tools/eslint/lib/rules/no-fallthrough.js index e5974420385871..1e5d40c7ff77f0 100644 --- a/tools/eslint/lib/rules/no-fallthrough.js +++ b/tools/eslint/lib/rules/no-fallthrough.js @@ -4,94 +4,92 @@ */ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ -var FALLTHROUGH_COMMENT = /falls\sthrough/; +var lodash = require("lodash"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +var FALLTHROUGH_COMMENT = /falls?\s?through/i; + +/** + * Checks whether or not a given node has a fallthrough comment. + * @param {ASTNode} node - A SwitchCase node to get comments. + * @param {RuleContext} context - A rule context which stores comments. + * @returns {boolean} `true` if the node has a fallthrough comment. + */ +function hasFallthroughComment(node, context) { + var sourceCode = context.getSourceCode(); + var comment = lodash.last(sourceCode.getComments(node).leading); + + return Boolean(comment && FALLTHROUGH_COMMENT.test(comment.value)); +} + +/** + * Checks whether or not a given code path segment is reachable. + * @param {CodePathSegment} segment - A CodePathSegment to check. + * @returns {boolean} `true` if the segment is reachable. + */ +function isReachable(segment) { + return segment.reachable; +} //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = function(context) { + var currentCodePath = null; - var switches = []; + /* + * We need to use leading comments of the next SwitchCase node because + * trailing comments is wrong if semicolons are omitted. + */ + var fallthroughCase = null; return { + "onCodePathStart": function(codePath) { + currentCodePath = codePath; + }, + "onCodePathEnd": function() { + currentCodePath = currentCodePath.upper; + }, "SwitchCase": function(node) { - var consequent = node.consequent, - switchData = switches[switches.length - 1], - i, - comments, - comment; - /* - * Some developers wrap case bodies in blocks, so if there is just one - * node and it's a block statement, check inside. + * Checks whether or not there is a fallthrough comment. + * And reports the previous fallthrough node if that does not exist. */ - if (consequent.length === 1 && consequent[0].type === "BlockStatement") { - consequent = consequent[0]; + if (fallthroughCase && !hasFallthroughComment(node, context)) { + context.report({ + message: "Expected a 'break' statement before '{{type}}'.", + data: {type: node.test ? "case" : "default"}, + node: node + }); } + fallthroughCase = null; + }, - // checking on previous case - if (!switchData.lastCaseClosed) { - - // a fall through comment will be the last trailing comment of the last case - comments = context.getComments(switchData.lastCase).trailing; - comment = comments[comments.length - 1]; - - // unless the user doesn't like semicolons, in which case it's first leading comment of this case - if (!comment) { - comments = context.getComments(node).leading; - comment = comments[comments.length - 1]; - } - - // check for comment - if (!comment || !FALLTHROUGH_COMMENT.test(comment.value)) { - - context.report(switchData.lastCase, - "Expected a \"break\" statement before \"{{code}}\".", - { code: node.test ? "case" : "default" }); - } - } - - // now dealing with the current case - switchData.lastCaseClosed = false; - switchData.lastCase = node; - - // try to verify using statements - go backwards as a fast path for the search - if (consequent.length) { - for (i = consequent.length - 1; i >= 0; i--) { - if (/(?:Break|Continue|Return|Throw)Statement/.test(consequent[i].type)) { - switchData.lastCaseClosed = true; - break; - } - } - } else { - // the case statement has no statements, so it must logically fall through - switchData.lastCaseClosed = true; - } + "SwitchCase:exit": function(node) { /* - * Any warnings are triggered when the next SwitchCase occurs. - * There is no need to warn on the last SwitchCase, since it can't - * fall through to anything. + * `reachable` meant fall through because statements preceded by + * `break`, `return`, or `throw` are unreachable. + * And allows empty cases and the last case. */ - }, - - "SwitchStatement": function(node) { - switches.push({ - node: node, - lastCaseClosed: true, - lastCase: null - }); - }, - - "SwitchStatement:exit": function() { - switches.pop(); + if (currentCodePath.currentSegments.some(isReachable) && + node.consequent.length > 0 && + lodash.last(node.parent.cases) !== node + ) { + fallthroughCase = node; + } } }; - }; module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-func-assign.js b/tools/eslint/lib/rules/no-func-assign.js index a711f572a1f1f8..f72c8c0150762a 100644 --- a/tools/eslint/lib/rules/no-func-assign.js +++ b/tools/eslint/lib/rules/no-func-assign.js @@ -6,78 +6,52 @@ "use strict"; +var astUtils = require("../ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = function(context) { - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /* - * Walk the scope chain looking for either a FunctionDeclaration or a - * VariableDeclaration with the same name as left-hand side of the - * AssignmentExpression. If we find the FunctionDeclaration first, then we - * warn, because a FunctionDeclaration is trying to become a Variable or a - * FunctionExpression. If we find a VariableDeclaration first, then we have - * a legitimate shadow variable. + /** + * Reports a reference if is non initializer and writable. + * @param {References} references - Collection of reference to check. + * @returns {void} */ - function checkIfIdentifierIsFunction(scope, name) { - var variable, - def, - i, - j; - - // Loop over all of the identifiers available in scope. - for (i = 0; i < scope.variables.length; i++) { - variable = scope.variables[i]; - - // For each identifier, see if it was defined in _this_ scope. - for (j = 0; j < variable.defs.length; j++) { - def = variable.defs[j]; - - // Identifier is a function and was declared in this scope - if (def.type === "FunctionName" && def.name.name === name) { - return true; - } - - // Identifier is a variable and was declared in this scope. This - // is a legitimate shadow variable. - if (def.name && def.name.name === name) { - return false; - } - } - } + function checkReference(references) { + astUtils.getModifyingReferences(references).forEach(function(reference) { + context.report( + reference.identifier, + "'{{name}}' is a function.", + {name: reference.identifier.name}); + }); + } - // Check the upper scope. - if (scope.upper) { - return checkIfIdentifierIsFunction(scope.upper, name); + /** + * Finds and reports references that are non initializer and writable. + * @param {Variable} variable - A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + if (variable.defs[0].type === "FunctionName") { + checkReference(variable.references); } - - // We've reached the global scope and haven't found anything. - return false; } - //-------------------------------------------------------------------------- - // Public API - //-------------------------------------------------------------------------- + /** + * Checks parameters of a given function node. + * @param {ASTNode} node - A function node to check. + * @returns {void} + */ + function checkForFunction(node) { + context.getDeclaredVariables(node).forEach(checkVariable); + } return { - - "AssignmentExpression": function(node) { - var scope = context.getScope(), - name = node.left.name; - - if (checkIfIdentifierIsFunction(scope, name)) { - context.report(node, "'{{name}}' is a function.", { name: name }); - } - - } - + "FunctionDeclaration": checkForFunction, + "FunctionExpression": checkForFunction }; - }; module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-implicit-coercion.js b/tools/eslint/lib/rules/no-implicit-coercion.js new file mode 100644 index 00000000000000..2bc96485c305b7 --- /dev/null +++ b/tools/eslint/lib/rules/no-implicit-coercion.js @@ -0,0 +1,247 @@ +/** + * @fileoverview A rule to disallow the type conversions with shorter notations. + * @author Toru Nagashima + * @copyright 2015 Toru Nagashima. All rights reserved. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +var INDEX_OF_PATTERN = /^(?:i|lastI)ndexOf$/; +var ALLOWABLE_OPERATORS = ["~", "!!", "+", "*"]; + +/** + * Parses and normalizes an option object. + * @param {object} options - An option object to parse. + * @returns {object} The parsed and normalized option object. + */ +function parseOptions(options) { + options = options || {}; + return { + boolean: "boolean" in options ? Boolean(options.boolean) : true, + number: "number" in options ? Boolean(options.number) : true, + string: "string" in options ? Boolean(options.string) : true, + allow: options.allow || [] + }; +} + +/** + * Checks whether or not a node is a double logical nigating. + * @param {ASTNode} node - An UnaryExpression node to check. + * @returns {boolean} Whether or not the node is a double logical nigating. + */ +function isDoubleLogicalNegating(node) { + return ( + node.operator === "!" && + node.argument.type === "UnaryExpression" && + node.argument.operator === "!" + ); +} + +/** + * Checks whether or not a node is a binary negating of `.indexOf()` method calling. + * @param {ASTNode} node - An UnaryExpression node to check. + * @returns {boolean} Whether or not the node is a binary negating of `.indexOf()` method calling. + */ +function isBinaryNegatingOfIndexOf(node) { + return ( + node.operator === "~" && + node.argument.type === "CallExpression" && + node.argument.callee.type === "MemberExpression" && + node.argument.callee.property.type === "Identifier" && + INDEX_OF_PATTERN.test(node.argument.callee.property.name) + ); +} + +/** + * Checks whether or not a node is a multiplying by one. + * @param {BinaryExpression} node - A BinaryExpression node to check. + * @returns {boolean} Whether or not the node is a multiplying by one. + */ +function isMultiplyByOne(node) { + return node.operator === "*" && ( + node.left.type === "Literal" && node.left.value === 1 || + node.right.type === "Literal" && node.right.value === 1 + ); +} + +/** + * Checks whether the result of a node is numeric or not + * @param {ASTNode} node The node to test + * @returns {boolean} true if the node is a number literal or a `Number()`, `parseInt` or `parseFloat` call + */ +function isNumeric(node) { + return ( + node.type === "Literal" && typeof node.value === "number" || + node.type === "CallExpression" && ( + node.callee.name === "Number" || + node.callee.name === "parseInt" || + node.callee.name === "parseFloat" + ) + ); +} + +/** + * Returns the first non-numeric operand in a BinaryExpression. Designed to be + * used from bottom to up since it walks up the BinaryExpression trees using + * node.parent to find the result. + * @param {BinaryExpression} node The BinaryExpression node to be walked up on + * @returns {ASTNode|null} The first non-numeric item in the BinaryExpression tree or null + */ +function getNonNumericOperand(node) { + var left = node.left, + right = node.right; + + if (right.type !== "BinaryExpression" && !isNumeric(right)) { + return right; + } + + if (left.type !== "BinaryExpression" && !isNumeric(left)) { + return left; + } + + return null; +} + +/** + * Checks whether or not a node is a concatenating with an empty string. + * @param {ASTNode} node - A BinaryExpression node to check. + * @returns {boolean} Whether or not the node is a concatenating with an empty string. + */ +function isConcatWithEmptyString(node) { + return node.operator === "+" && ( + (node.left.type === "Literal" && node.left.value === "") || + (node.right.type === "Literal" && node.right.value === "") + ); +} + +/** + * Checks whether or not a node is appended with an empty string. + * @param {ASTNode} node - An AssignmentExpression node to check. + * @returns {boolean} Whether or not the node is appended with an empty string. + */ +function isAppendEmptyString(node) { + return node.operator === "+=" && node.right.type === "Literal" && node.right.value === ""; +} + +/** + * Gets a node that is the left or right operand of a node, is not the specified literal. + * @param {ASTNode} node - A BinaryExpression node to get. + * @param {any} value - A literal value to check. + * @returns {ASTNode} A node that is the left or right operand of the node, is not the specified literal. + */ +function getOtherOperand(node, value) { + if (node.left.type === "Literal" && node.left.value === value) { + return node.right; + } + return node.left; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var options = parseOptions(context.options[0]), + operatorAllowed = false; + + return { + "UnaryExpression": function(node) { + + // !!foo + operatorAllowed = options.allow.indexOf("!!") >= 0; + if (!operatorAllowed && options.boolean && isDoubleLogicalNegating(node)) { + context.report( + node, + "use `Boolean({{code}})` instead.", { + code: context.getSource(node.argument.argument) + }); + } + + // ~foo.indexOf(bar) + operatorAllowed = options.allow.indexOf("~") >= 0; + if (!operatorAllowed && options.boolean && isBinaryNegatingOfIndexOf(node)) { + context.report( + node, + "use `{{code}} !== -1` instead.", { + code: context.getSource(node.argument) + }); + } + + // +foo + operatorAllowed = options.allow.indexOf("+") >= 0; + if (!operatorAllowed && options.number && node.operator === "+" && !isNumeric(node.argument)) { + context.report( + node, + "use `Number({{code}})` instead.", { + code: context.getSource(node.argument) + }); + } + }, + + // Use `:exit` to prevent double reporting + "BinaryExpression:exit": function(node) { + + // 1 * foo + operatorAllowed = options.allow.indexOf("*") >= 0; + var nonNumericOperand = !operatorAllowed && options.number && isMultiplyByOne(node) && getNonNumericOperand(node); + + if (nonNumericOperand) { + context.report( + node, + "use `Number({{code}})` instead.", { + code: context.getSource(nonNumericOperand) + }); + } + + // "" + foo + operatorAllowed = options.allow.indexOf("+") >= 0; + if (!operatorAllowed && options.string && isConcatWithEmptyString(node)) { + context.report( + node, + "use `String({{code}})` instead.", { + code: context.getSource(getOtherOperand(node, "")) + }); + } + }, + + "AssignmentExpression": function(node) { + + // foo += "" + operatorAllowed = options.allow.indexOf("+") >= 0; + if (options.string && isAppendEmptyString(node)) { + context.report( + node, + "use `{{code}} = String({{code}})` instead.", { + code: context.getSource(getOtherOperand(node, "")) + }); + } + } + }; +}; + +module.exports.schema = [{ + "type": "object", + "properties": { + "boolean": { + "type": "boolean" + }, + "number": { + "type": "boolean" + }, + "string": { + "type": "boolean" + }, + "allow": { + "type": "array", + "items": { + "enum": ALLOWABLE_OPERATORS + }, + "uniqueItems": true + } + }, + "additionalProperties": false +}]; diff --git a/tools/eslint/lib/rules/no-implicit-globals.js b/tools/eslint/lib/rules/no-implicit-globals.js new file mode 100644 index 00000000000000..045ebffed20bd2 --- /dev/null +++ b/tools/eslint/lib/rules/no-implicit-globals.js @@ -0,0 +1,47 @@ +/** + * @fileoverview Rule to check for implicit global variables and functions. + * @author Joshua Peek + * @copyright 2015 Joshua Peek. All rights reserved. + * See LICENSE file in root directory for full license. +*/ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + return { + "Program": function() { + var scope = context.getScope(); + + scope.variables.forEach(function(variable) { + if (variable.writeable) { + return; + } + + variable.defs.forEach(function(def) { + if (def.type === "FunctionName" || (def.type === "Variable" && def.parent.kind === "var")) { + context.report(def.node, "Implicit global variable, assign as global property instead."); + } + }); + }); + + scope.implicit.variables.forEach(function(variable) { + var scopeVariable = scope.set.get(variable.name); + + if (scopeVariable && scopeVariable.writeable) { + return; + } + + variable.defs.forEach(function(def) { + context.report(def.node, "Implicit global variable, assign as global property instead."); + }); + }); + } + }; + +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-implied-eval.js b/tools/eslint/lib/rules/no-implied-eval.js index 7fdc2f114ded38..eea0f7fe4180a1 100644 --- a/tools/eslint/lib/rules/no-implied-eval.js +++ b/tools/eslint/lib/rules/no-implied-eval.js @@ -12,51 +12,92 @@ //------------------------------------------------------------------------------ module.exports = function(context) { - var IMPLIED_EVAL = /set(?:Timeout|Interval)/; + var CALLEE_RE = /set(?:Timeout|Interval)|execScript/; + + /* + * Figures out if we should inspect a given binary expression. Is a stack + * of stacks, where the first element in each substack is a CallExpression. + */ + var impliedEvalAncestorsStack = []; //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- /** - * Checks if the first argument of a given CallExpression node is a string literal. - * @param {ASTNode} node The CallExpression node the check. - * @returns {boolean} True if the first argument is a string literal, false if not. + * Get the last element of an array, without modifying arr, like pop(), but non-destructive. + * @param {array} arr What to inspect + * @returns {*} The last element of arr + * @private */ - function hasStringLiteralArgument(node) { - var firstArgument = node.arguments[0]; - - return firstArgument && firstArgument.type === "Literal" && typeof firstArgument.value === "string"; + function last(arr) { + return arr ? arr[arr.length - 1] : null; } /** - * Checks if the given MemberExpression node is window.setTimeout or window.setInterval. + * Checks if the given MemberExpression node is a potentially implied eval identifier on window. * @param {ASTNode} node The MemberExpression node to check. - * @returns {boolean} Whether or not the given node is window.set*. + * @returns {boolean} Whether or not the given node is potentially an implied eval. + * @private */ - function isSetMemberExpression(node) { + function isImpliedEvalMemberExpression(node) { var object = node.object, property = node.property, - hasSetPropertyName = IMPLIED_EVAL.test(property.name) || IMPLIED_EVAL.test(property.value); - - return object.name === "window" && hasSetPropertyName; + hasImpliedEvalName = CALLEE_RE.test(property.name) || CALLEE_RE.test(property.value); + return object.name === "window" && hasImpliedEvalName; } /** - * Determines if a node represents a call to setTimeout/setInterval with - * a string argument. - * @param {ASTNode} node The node to check. + * Determines if a node represents a call to a potentially implied eval. + * + * This checks the callee name and that there's an argument, but not the type of the argument. + * + * @param {ASTNode} node The CallExpression to check. * @returns {boolean} True if the node matches, false if not. * @private */ - function isImpliedEval(node) { + function isImpliedEvalCallExpression(node) { var isMemberExpression = (node.callee.type === "MemberExpression"), isIdentifier = (node.callee.type === "Identifier"), - isSetMethod = (isIdentifier && IMPLIED_EVAL.test(node.callee.name)) || - (isMemberExpression && isSetMemberExpression(node.callee)); + isImpliedEvalCallee = + (isIdentifier && CALLEE_RE.test(node.callee.name)) || + (isMemberExpression && isImpliedEvalMemberExpression(node.callee)); - return isSetMethod && hasStringLiteralArgument(node); + return isImpliedEvalCallee && node.arguments.length; + } + + /** + * Checks that the parent is a direct descendent of an potential implied eval CallExpression, and if the parent is a CallExpression, that we're the first argument. + * @param {ASTNode} node The node to inspect the parent of. + * @returns {boolean} Was the parent a direct descendent, and is the child therefore potentially part of a dangerous argument? + * @private + */ + function hasImpliedEvalParent(node) { + + // make sure our parent is marked + return node.parent === last(last(impliedEvalAncestorsStack)) && + + // if our parent is a CallExpression, make sure we're the first argument + (node.parent.type !== "CallExpression" || node === node.parent.arguments[0]); + } + + /** + * Checks if our parent is marked as part of an implied eval argument. If + * so, collapses the top of impliedEvalAncestorsStack and reports on the + * original CallExpression. + * @param {ASTNode} node The CallExpression to check. + * @returns {boolean} True if the node matches, false if not. + * @private + */ + function checkString(node) { + if (hasImpliedEvalParent(node)) { + + // remove the entire substack, to avoid duplicate reports + var substack = impliedEvalAncestorsStack.pop(); + + context.report(substack[0], "Implied eval. Consider passing a function instead of a string."); + } } //-------------------------------------------------------------------------- @@ -65,9 +106,44 @@ module.exports = function(context) { return { "CallExpression": function(node) { - if (isImpliedEval(node)) { - context.report(node, "Implied eval. Consider passing a function instead of a string."); + if (isImpliedEvalCallExpression(node)) { + + // call expressions create a new substack + impliedEvalAncestorsStack.push([node]); + } + }, + + "CallExpression:exit": function(node) { + if (node === last(last(impliedEvalAncestorsStack))) { + + /* Destroys the entire sub-stack, rather than just using + * last(impliedEvalAncestorsStack).pop(), as a CallExpression is + * always the bottom of a impliedEvalAncestorsStack substack. + */ + impliedEvalAncestorsStack.pop(); + } + }, + + "BinaryExpression": function(node) { + if (node.operator === "+" && hasImpliedEvalParent(node)) { + last(impliedEvalAncestorsStack).push(node); + } + }, + + "BinaryExpression:exit": function(node) { + if (node === last(last(impliedEvalAncestorsStack))) { + last(impliedEvalAncestorsStack).pop(); + } + }, + + "Literal": function(node) { + if (typeof node.value === "string") { + checkString(node); } + }, + + "TemplateLiteral": function(node) { + checkString(node); } }; diff --git a/tools/eslint/lib/rules/no-inline-comments.js b/tools/eslint/lib/rules/no-inline-comments.js index 3941fd24c0fc21..4048802bc8c46a 100644 --- a/tools/eslint/lib/rules/no-inline-comments.js +++ b/tools/eslint/lib/rules/no-inline-comments.js @@ -5,6 +5,8 @@ */ "use strict"; +var astUtils = require("../ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ @@ -28,8 +30,11 @@ module.exports = function(context) { // Also check after the comment var postamble = endLine.slice(node.loc.end.column).trim(); + // Check that this comment isn't an ESLint directive + var isDirective = astUtils.isDirectiveComment(node); + // Should be empty if there was only whitespace around the comment - if (preamble || postamble) { + if (!isDirective && (preamble || postamble)) { context.report(node, "Unexpected comment inline with code."); } } diff --git a/tools/eslint/lib/rules/no-inner-declarations.js b/tools/eslint/lib/rules/no-inner-declarations.js index f5503eea8e7f61..8dcd3e827c9b55 100644 --- a/tools/eslint/lib/rules/no-inner-declarations.js +++ b/tools/eslint/lib/rules/no-inner-declarations.js @@ -29,8 +29,10 @@ module.exports = function(context) { } return { + // Type of containing ancestor type: ancestor.type, + // Separation between ancestor and node distance: generation }; diff --git a/tools/eslint/lib/rules/no-invalid-regexp.js b/tools/eslint/lib/rules/no-invalid-regexp.js index 63608c6c47497e..014e70583877e7 100644 --- a/tools/eslint/lib/rules/no-invalid-regexp.js +++ b/tools/eslint/lib/rules/no-invalid-regexp.js @@ -17,24 +17,47 @@ var espree = require("espree"); module.exports = function(context) { + var options = context.options[0], + allowedFlags = ""; + + if (options && options.allowConstructorFlags) { + allowedFlags = options.allowConstructorFlags.join(""); + } + + /** + * Check if node is a string + * @param {ASTNode} node node to evaluate + * @returns {boolean} True if its a string + * @private + */ function isString(node) { return node && node.type === "Literal" && typeof node.value === "string"; } + /** + * Validate strings passed to the RegExp constructor + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ function check(node) { if (node.callee.type === "Identifier" && node.callee.name === "RegExp" && isString(node.arguments[0])) { var flags = isString(node.arguments[1]) ? node.arguments[1].value : ""; + if (allowedFlags) { + flags = flags.replace(new RegExp("[" + allowedFlags + "]", "gi"), ""); + } + try { void new RegExp(node.arguments[0].value); - } catch(e) { + } catch (e) { context.report(node, e.message); } if (flags) { try { - espree.parse("/./" + flags, { ecmaFeatures: context.ecmaFeatures }); + espree.parse("/./" + flags, context.parserOptions); } catch (ex) { context.report(node, "Invalid flags supplied to RegExp constructor '" + flags + "'"); } @@ -50,4 +73,15 @@ module.exports = function(context) { }; -module.exports.schema = []; +module.exports.schema = [{ + "type": "object", + "properties": { + "allowConstructorFlags": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false +}]; diff --git a/tools/eslint/lib/rules/no-invalid-this.js b/tools/eslint/lib/rules/no-invalid-this.js new file mode 100644 index 00000000000000..0a9e535542c298 --- /dev/null +++ b/tools/eslint/lib/rules/no-invalid-this.js @@ -0,0 +1,114 @@ +/** + * @fileoverview A rule to disallow `this` keywords outside of classes or class-like objects. + * @author Toru Nagashima + * @copyright 2015 Toru Nagashima. All rights reserved. + * See LICENSE file in root directory for full license. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var astUtils = require("../ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var stack = [], + sourceCode = context.getSourceCode(); + + /** + * Gets the current checking context. + * + * The return value has a flag that whether or not `this` keyword is valid. + * The flag is initialized when got at the first time. + * + * @returns {{valid: boolean}} + * an object which has a flag that whether or not `this` keyword is valid. + */ + stack.getCurrent = function() { + var current = this[this.length - 1]; + + if (!current.init) { + current.init = true; + current.valid = !astUtils.isDefaultThisBinding( + current.node, + sourceCode); + } + return current; + }; + + /** + * Pushs new checking context into the stack. + * + * The checking context is not initialized yet. + * Because most functions don't have `this` keyword. + * When `this` keyword was found, the checking context is initialized. + * + * @param {ASTNode} node - A function node that was entered. + * @returns {void} + */ + function enterFunction(node) { + + // `this` can be invalid only under strict mode. + stack.push({ + init: !context.getScope().isStrict, + node: node, + valid: true + }); + } + + /** + * Pops the current checking context from the stack. + * @returns {void} + */ + function exitFunction() { + stack.pop(); + } + + return { + + /* + * `this` is invalid only under strict mode. + * Modules is always strict mode. + */ + "Program": function(node) { + var scope = context.getScope(), + features = context.parserOptions.ecmaFeatures || {}; + + stack.push({ + init: true, + node: node, + valid: !( + scope.isStrict || + node.sourceType === "module" || + (features.globalReturn && scope.childScopes[0].isStrict) + ) + }); + }, + + "Program:exit": function() { + stack.pop(); + }, + + "FunctionDeclaration": enterFunction, + "FunctionDeclaration:exit": exitFunction, + "FunctionExpression": enterFunction, + "FunctionExpression:exit": exitFunction, + + // Reports if `this` of the current context is invalid. + "ThisExpression": function(node) { + var current = stack.getCurrent(); + + if (current && !current.valid) { + context.report(node, "Unexpected 'this'."); + } + } + }; +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-irregular-whitespace.js b/tools/eslint/lib/rules/no-irregular-whitespace.js index bfb30b8667ba9f..a849f060bd9e96 100644 --- a/tools/eslint/lib/rules/no-irregular-whitespace.js +++ b/tools/eslint/lib/rules/no-irregular-whitespace.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to disalow whitespace that is not a tab or space, whitespace inside strings and comments are allowed * @author Jonathan Kingston + * @author Christophe Porteneuve * @copyright 2014 Jonathan Kingston. All rights reserved. */ @@ -18,18 +19,26 @@ module.exports = function(context) { // Module store of errors that we have found var errors = []; + // Comment nodes. We accumulate these as we go, so we can be sure to trigger them after the whole `Program` entity is parsed, even for top-of-file comments. + var commentNodes = []; + + // Lookup the `skipComments` option, which defaults to `false`. + var options = context.options[0] || {}; + var skipComments = !!options.skipComments; + /** * Removes errors that occur inside a string node * @param {ASTNode} node to check for matching errors. * @returns {void} * @private */ - function removeStringError(node) { + function removeWhitespaceError(node) { var locStart = node.loc.start; var locEnd = node.loc.end; - errors = errors.filter(function (error) { + errors = errors.filter(function(error) { var errorLoc = error[1]; + if (errorLoc.line >= locStart.line && errorLoc.line <= locEnd.line) { if (errorLoc.column >= locStart.column && (errorLoc.column <= locEnd.column || errorLoc.line < locEnd.line)) { return false; @@ -40,20 +49,33 @@ module.exports = function(context) { } /** - * Checks nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors + * Checks identifier or literal nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors * @param {ASTNode} node to check for matching errors. * @returns {void} * @private */ - function removeInvalidNodeErrors(node) { + function removeInvalidNodeErrorsInIdentifierOrLiteral(node) { if (typeof node.value === "string") { + // If we have irregular characters remove them from the errors list if (node.raw.match(irregularWhitespace) || node.raw.match(irregularLineTerminators)) { - removeStringError(node); + removeWhitespaceError(node); } } } + /** + * Checks comment nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors + * @param {ASTNode} node to check for matching errors. + * @returns {void} + * @private + */ + function removeInvalidNodeErrorsInComment(node) { + if (node.value.match(irregularWhitespace) || node.value.match(irregularLineTerminators)) { + removeWhitespaceError(node); + } + } + /** * Checks the program source for irregular whitespace * @param {ASTNode} node The program node @@ -63,7 +85,7 @@ module.exports = function(context) { function checkForIrregularWhitespace(node) { var sourceLines = context.getSourceLines(); - sourceLines.forEach(function (sourceLine, lineIndex) { + sourceLines.forEach(function(sourceLine, lineIndex) { var lineNumber = lineIndex + 1, location, match; @@ -107,29 +129,69 @@ module.exports = function(context) { } } + /** + * Stores a comment node (`LineComment` or `BlockComment`) for later stripping of errors within; a necessary deferring of processing to deal with top-of-file comments. + * @param {ASTNode} node The comment node + * @returns {void} + * @private + */ + function rememberCommentNode(node) { + commentNodes.push(node); + } + + /** + * A no-op function to act as placeholder for comment accumulation when the `skipComments` option is `false`. + * @returns {void} + * @private + */ + function noop() {} + return { - "Program": function (node) { - /** - * As we can easily fire warnings for all white space issues with all the source its simpler to fire them here - * This means we can check all the application code without having to worry about issues caused in the parser tokens - * When writing this code also evaluating per node was missing out connecting tokens in some cases - * We can later filter the errors when they are found to be not an issue in nodes we don't care about + "Program": function(node) { + + /* + * As we can easily fire warnings for all white space issues with + * all the source its simpler to fire them here. + * This means we can check all the application code without having + * to worry about issues caused in the parser tokens. + * When writing this code also evaluating per node was missing out + * connecting tokens in some cases. + * We can later filter the errors when they are found to be not an + * issue in nodes we don't care about. */ checkForIrregularWhitespace(node); checkForIrregularLineTerminators(node); }, - "Identifier": removeInvalidNodeErrors, - "Literal": removeInvalidNodeErrors, - "Program:exit": function () { + "Identifier": removeInvalidNodeErrorsInIdentifierOrLiteral, + "Literal": removeInvalidNodeErrorsInIdentifierOrLiteral, + "LineComment": skipComments ? rememberCommentNode : noop, + "BlockComment": skipComments ? rememberCommentNode : noop, + "Program:exit": function() { + + if (skipComments) { + + // First strip errors occurring in comment nodes. We have to do this post-`Program` to deal with top-of-file comments. + commentNodes.forEach(removeInvalidNodeErrorsInComment); + } // If we have any errors remaining report on them - errors.forEach(function (error) { - context.report.apply(this, error); + errors.forEach(function(error) { + context.report.apply(context, error); }); } }; }; -module.exports.schema = []; +module.exports.schema = [ + { + "type": "object", + "properties": { + "skipComments": { + "type": "boolean" + } + }, + "additionalProperties": false + } +]; diff --git a/tools/eslint/lib/rules/no-label-var.js b/tools/eslint/lib/rules/no-label-var.js index 8aa944e7a85b5b..20fbfc182df41f 100644 --- a/tools/eslint/lib/rules/no-label-var.js +++ b/tools/eslint/lib/rules/no-label-var.js @@ -5,6 +5,12 @@ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var astUtils = require("../ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ @@ -15,28 +21,15 @@ module.exports = function(context) { // Helpers //-------------------------------------------------------------------------- - function findIdentifier(scope, identifier) { - var found = false; - - scope.variables.forEach(function(variable) { - if (variable.name === identifier) { - found = true; - } - }); - - scope.references.forEach(function(reference) { - if (reference.identifier.name === identifier) { - found = true; - } - }); - - // If we have not found the identifier in this scope, check the parent - // scope. - if (scope.upper && !found) { - return findIdentifier(scope.upper, identifier); - } - - return found; + /** + * Check if the identifier is present inside current scope + * @param {object} scope current scope + * @param {string} name To evaluate + * @returns {boolean} True if its present + * @private + */ + function findIdentifier(scope, name) { + return astUtils.getVariableByName(scope, name) !== null; } //-------------------------------------------------------------------------- diff --git a/tools/eslint/lib/rules/no-labels.js b/tools/eslint/lib/rules/no-labels.js index c083f032f65de9..fe42c3d886d594 100644 --- a/tools/eslint/lib/rules/no-labels.js +++ b/tools/eslint/lib/rules/no-labels.js @@ -1,44 +1,135 @@ /** * @fileoverview Disallow Labeled Statements * @author Nicholas C. Zakas + * @copyright 2014 Nicholas C. Zakas. All rights reserved. + * See LICENSE in root directory for full license. */ "use strict"; +//------------------------------------------------------------------------------ +// Constants +//------------------------------------------------------------------------------ + +var LOOP_TYPES = /^(?:While|DoWhile|For|ForIn|ForOf)Statement$/; + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = function(context) { + var options = context.options[0]; + var allowLoop = Boolean(options && options.allowLoop); + var allowSwitch = Boolean(options && options.allowSwitch); + var scopeInfo = null; + + /** + * Gets the kind of a given node. + * + * @param {ASTNode} node - A node to get. + * @returns {string} The kind of the node. + */ + function getBodyKind(node) { + var type = node.type; + + if (LOOP_TYPES.test(type)) { + return "loop"; + } + if (type === "SwitchStatement") { + return "switch"; + } + return "other"; + } + + /** + * Checks whether the label of a given kind is allowed or not. + * + * @param {string} kind - A kind to check. + * @returns {boolean} `true` if the kind is allowed. + */ + function isAllowed(kind) { + switch (kind) { + case "loop": return allowLoop; + case "switch": return allowSwitch; + default: return false; + } + } + + /** + * Checks whether a given name is a label of a loop or not. + * + * @param {string} label - A name of a label to check. + * @returns {boolean} `true` if the name is a label of a loop. + */ + function getKind(label) { + var info = scopeInfo; + + while (info) { + if (info.label === label) { + return info.kind; + } + info = info.upper; + } + + /* istanbul ignore next: syntax error */ + return "other"; + } //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- return { - "LabeledStatement": function(node) { - context.report(node, "Unexpected labeled statement."); + scopeInfo = { + label: node.label.name, + kind: getBodyKind(node.body), + upper: scopeInfo + }; }, - "BreakStatement": function(node) { - - if (node.label) { - context.report(node, "Unexpected label in break statement."); + "LabeledStatement:exit": function(node) { + if (!isAllowed(scopeInfo.kind)) { + context.report({ + node: node, + message: "Unexpected labeled statement." + }); } + scopeInfo = scopeInfo.upper; }, - "ContinueStatement": function(node) { - - if (node.label) { - context.report(node, "Unexpected label in continue statement."); + "BreakStatement": function(node) { + if (node.label && !isAllowed(getKind(node.label.name))) { + context.report({ + node: node, + message: "Unexpected label in break statement." + }); } + }, + "ContinueStatement": function(node) { + if (node.label && !isAllowed(getKind(node.label.name))) { + context.report({ + node: node, + message: "Unexpected label in continue statement." + }); + } } - - }; }; -module.exports.schema = []; +module.exports.schema = [ + { + type: "object", + properties: { + allowLoop: { + type: "boolean" + }, + allowSwitch: { + type: "boolean" + } + }, + additionalProperties: false + } +]; diff --git a/tools/eslint/lib/rules/no-lone-blocks.js b/tools/eslint/lib/rules/no-lone-blocks.js index 22fd1ec064fd81..976a817b5e3075 100644 --- a/tools/eslint/lib/rules/no-lone-blocks.js +++ b/tools/eslint/lib/rules/no-lone-blocks.js @@ -24,6 +24,7 @@ module.exports = function(context) { */ function report(node) { var parent = context.getAncestors().pop(); + context.report(node, parent.type === "Program" ? "Block is redundant." : "Nested block is redundant." @@ -36,6 +37,7 @@ module.exports = function(context) { */ function isLoneBlock() { var parent = context.getAncestors().pop(); + return parent.type === "BlockStatement" || parent.type === "Program"; } @@ -66,7 +68,7 @@ module.exports = function(context) { }; // ES6: report blocks without block-level bindings - if (context.ecmaFeatures.blockBindings || context.ecmaFeatures.classes) { + if (context.parserOptions.ecmaVersion >= 6) { ruleDef = { "BlockStatement": function(node) { if (isLoneBlock(node)) { @@ -80,9 +82,7 @@ module.exports = function(context) { } } }; - } - if (context.ecmaFeatures.blockBindings) { ruleDef.VariableDeclaration = function(node) { if (node.kind === "let" || node.kind === "const") { markLoneBlock(node); @@ -94,9 +94,7 @@ module.exports = function(context) { markLoneBlock(node); } }; - } - if (context.ecmaFeatures.classes) { ruleDef.ClassDeclaration = markLoneBlock; } diff --git a/tools/eslint/lib/rules/no-loop-func.js b/tools/eslint/lib/rules/no-loop-func.js index e8f5262090be42..0ab2fb853ac4e6 100644 --- a/tools/eslint/lib/rules/no-loop-func.js +++ b/tools/eslint/lib/rules/no-loop-func.js @@ -6,44 +6,175 @@ "use strict"; +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets the containing loop node of a specified node. + * + * We don't need to check nested functions, so this ignores those. + * `Scope.through` contains references of nested functions. + * + * @param {ASTNode} node - An AST node to get. + * @returns {ASTNode|null} The containing loop node of the specified node, or + * `null`. + */ +function getContainingLoopNode(node) { + var parent = node.parent; + + while (parent) { + switch (parent.type) { + case "WhileStatement": + case "DoWhileStatement": + return parent; + + case "ForStatement": + + // `init` is outside of the loop. + if (parent.init !== node) { + return parent; + } + break; + + case "ForInStatement": + case "ForOfStatement": + + // `right` is outside of the loop. + if (parent.right !== node) { + return parent; + } + break; + + case "ArrowFunctionExpression": + case "FunctionExpression": + case "FunctionDeclaration": + + // We don't need to check nested functions. + return null; + + default: + break; + } + + node = parent; + parent = node.parent; + } + + return null; +} + +/** + * Gets the containing loop node of a given node. + * If the loop was nested, this returns the most outer loop. + * + * @param {ASTNode} node - A node to get. This is a loop node. + * @param {ASTNode|null} excludedNode - A node that the result node should not + * include. + * @returns {ASTNode} The most outer loop node. + */ +function getTopLoopNode(node, excludedNode) { + var retv = null; + var border = excludedNode ? excludedNode.range[1] : 0; + + while (node && node.range[0] >= border) { + retv = node; + node = getContainingLoopNode(node); + } + + return retv; +} + +/** + * Checks whether a given reference which refers to an upper scope's variable is + * safe or not. + * + * @param {ASTNode} funcNode - A target function node. + * @param {ASTNode} loopNode - A containing loop node. + * @param {escope.Reference} reference - A reference to check. + * @returns {boolean} `true` if the reference is safe or not. + */ +function isSafe(funcNode, loopNode, reference) { + var variable = reference.resolved; + var definition = variable && variable.defs[0]; + var declaration = definition && definition.parent; + var kind = (declaration && declaration.type === "VariableDeclaration") + ? declaration.kind + : ""; + + // Variables which are declared by `const` is safe. + if (kind === "const") { + return true; + } + + // Variables which are declared by `let` in the loop is safe. + // It's a different instance from the next loop step's. + if (kind === "let" && + declaration.range[0] > loopNode.range[0] && + declaration.range[1] < loopNode.range[1] + ) { + return true; + } + + // WriteReferences which exist after this border are unsafe because those + // can modify the variable. + var border = getTopLoopNode( + loopNode, + (kind === "let") ? declaration : null + ).range[0]; + + /** + * Checks whether a given reference is safe or not. + * The reference is every reference of the upper scope's variable we are + * looking now. + * + * It's safeafe if the reference matches one of the following condition. + * - is readonly. + * - doesn't exist inside a local function and after the border. + * + * @param {escope.Reference} upperRef - A reference to check. + * @returns {boolean} `true` if the reference is safe. + */ + function isSafeReference(upperRef) { + var id = upperRef.identifier; + + return ( + !upperRef.isWrite() || + variable.scope.variableScope === upperRef.from.variableScope && + id.range[0] < border + ); + } + + return Boolean(variable) && variable.references.every(isSafeReference); +} + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = function(context) { + /** - * Reports if the given node has an ancestor node which is a loop. + * Reports functions which match the following condition: + * + * - has a loop node in ancestors. + * - has any references which refers to an unsafe variable. + * * @param {ASTNode} node The AST node to check. * @returns {boolean} Whether or not the node is within a loop. */ function checkForLoops(node) { - var ancestors = context.getAncestors(); - - /** - * Checks if the given node is a loop and current context is in the loop. - * @param {ASTNode} ancestor The AST node to check. - * @param {number} index The index of ancestor in ancestors. - * @returns {boolean} Whether or not the node is a loop and current context is in the loop. - */ - function isInLoop(ancestor, index) { - switch (ancestor.type) { - case "ForStatement": - return ancestor.init !== ancestors[index + 1]; - - case "ForInStatement": - case "ForOfStatement": - return ancestor.right !== ancestors[index + 1]; - - case "WhileStatement": - case "DoWhileStatement": - return true; - - default: - return false; - } + var loopNode = getContainingLoopNode(node); + + if (!loopNode) { + return; } - if (ancestors.some(isInLoop)) { + var references = context.getScope().through; + + if (references.length > 0 && + !references.every(isSafe.bind(null, node, loopNode)) + ) { context.report(node, "Don't make functions within a loop"); } } diff --git a/tools/eslint/lib/rules/no-magic-numbers.js b/tools/eslint/lib/rules/no-magic-numbers.js new file mode 100644 index 00000000000000..e7532bd51ecd84 --- /dev/null +++ b/tools/eslint/lib/rules/no-magic-numbers.js @@ -0,0 +1,159 @@ +/** + * @fileoverview Rule to flag statements that use magic numbers (adapted from https://github.com/danielstjules/buddy.js) + * @author Vincent Lemeunier + * @copyright 2015 Vincent Lemeunier. All rights reserved. + * + * This rule was adapted from danielstjules/buddy.js + * The MIT License (MIT) + * + * Copyright (c) 2014 Daniel St. Jules + * + * 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. + * + * See LICENSE file in root directory for full license. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var config = context.options[0] || {}, + detectObjects = !!config.detectObjects, + enforceConst = !!config.enforceConst, + ignore = config.ignore || [], + ignoreArrayIndexes = !!config.ignoreArrayIndexes; + + /** + * Returns whether the node is number literal + * @param {Node} node - the node literal being evaluated + * @returns {boolean} true if the node is a number literal + */ + function isNumber(node) { + return typeof node.value === "number"; + } + + /** + * Returns whether the number should be ignored + * @param {number} num - the number + * @returns {boolean} true if the number should be ignored + */ + function shouldIgnoreNumber(num) { + return ignore.indexOf(num) !== -1; + } + + /** + * Returns whether the number should be ignored when used as a radix within parseInt() or Number.parseInt() + * @param {ASTNode} parent - the non-"UnaryExpression" parent + * @param {ASTNode} node - the node literal being evaluated + * @returns {boolean} true if the number should be ignored + */ + function shouldIgnoreParseInt(parent, node) { + return parent.type === "CallExpression" && node === parent.arguments[1] && + (parent.callee.name === "parseInt" || + parent.callee.type === "MemberExpression" && + parent.callee.object.name === "Number" && + parent.callee.property.name === "parseInt"); + } + + /** + * Returns whether the number should be ignored when used to define a JSX prop + * @param {ASTNode} parent - the non-"UnaryExpression" parent + * @returns {boolean} true if the number should be ignored + */ + function shouldIgnoreJSXNumbers(parent) { + return parent.type.indexOf("JSX") === 0; + } + + /** + * Returns whether the number should be ignored when used as an array index with enabled 'ignoreArrayIndexes' option. + * @param {ASTNode} parent - the non-"UnaryExpression" parent. + * @returns {boolean} true if the number should be ignored + */ + function shouldIgnoreArrayIndexes(parent) { + return parent.type === "MemberExpression" && ignoreArrayIndexes; + } + + return { + "Literal": function(node) { + var parent = node.parent, + value = node.value, + raw = node.raw, + okTypes = detectObjects ? [] : ["ObjectExpression", "Property", "AssignmentExpression"]; + + if (!isNumber(node)) { + return; + } + + // For negative magic numbers: update the value and parent node + if (parent.type === "UnaryExpression" && parent.operator === "-") { + node = parent; + parent = node.parent; + value = -value; + raw = "-" + raw; + } + + if (shouldIgnoreNumber(value) || + shouldIgnoreParseInt(parent, node) || + shouldIgnoreArrayIndexes(parent) || + shouldIgnoreJSXNumbers(parent)) { + return; + } + + if (parent.type === "VariableDeclarator") { + if (enforceConst && parent.parent.kind !== "const") { + context.report({ + node: node, + message: "Number constants declarations must use 'const'" + }); + } + } else if (okTypes.indexOf(parent.type) === -1) { + context.report({ + node: node, + message: "No magic number: " + raw + }); + } + } + }; +}; + +module.exports.schema = [{ + "type": "object", + "properties": { + "detectObjects": { + "type": "boolean" + }, + "enforceConst": { + "type": "boolean" + }, + "ignore": { + "type": "array", + "items": { + "type": "number" + }, + "uniqueItems": true + }, + "ignoreArrayIndexes": { + "type": "boolean" + } + }, + "additionalProperties": false +}]; diff --git a/tools/eslint/lib/rules/no-mixed-requires.js b/tools/eslint/lib/rules/no-mixed-requires.js index fe2309691c0a24..63494d95256bb7 100644 --- a/tools/eslint/lib/rules/no-mixed-requires.js +++ b/tools/eslint/lib/rules/no-mixed-requires.js @@ -11,14 +11,29 @@ module.exports = function(context) { + var grouping = false, + allowCall = false, + options = context.options[0]; + + if (typeof options === "object") { + grouping = options.grouping; + allowCall = options.allowCall; + } else { + grouping = !!options; + } + /** * Returns the list of built-in modules. * * @returns {string[]} An array of built-in Node.js modules. */ function getBuiltinModules() { - // This list is generated using `require("repl")._builtinLibs.concat('repl').sort()` - // This particular list is as per nodejs v0.12.2 and iojs v0.7.1 + + /* + * This list is generated using: + * `require("repl")._builtinLibs.concat('repl').sort()` + * This particular list is as per nodejs v0.12.2 and iojs v0.7.1 + */ return [ "assert", "buffer", "child_process", "cluster", "crypto", "dgram", "dns", "domain", "events", "fs", "http", "https", @@ -46,6 +61,7 @@ module.exports = function(context) { */ function getDeclarationType(initExpression) { if (!initExpression) { + // "var x;" return DECL_UNINITIALIZED; } @@ -54,9 +70,18 @@ module.exports = function(context) { initExpression.callee.type === "Identifier" && initExpression.callee.name === "require" ) { + // "var x = require('util');" return DECL_REQUIRE; + } else if (allowCall && + initExpression.type === "CallExpression" && + initExpression.callee.type === "CallExpression" + ) { + + // "var x = require('diagnose')('sub-module');" + return getDeclarationType(initExpression.callee); } else if (initExpression.type === "MemberExpression") { + // "var x = require('glob').Glob;" return getDeclarationType(initExpression.object); } @@ -72,9 +97,11 @@ module.exports = function(context) { */ function inferModuleType(initExpression) { if (initExpression.type === "MemberExpression") { + // "var x = require('glob').Glob;" return inferModuleType(initExpression.object); } else if (initExpression.arguments.length === 0) { + // "var x = require();" return REQ_COMPUTED; } @@ -82,17 +109,21 @@ module.exports = function(context) { var arg = initExpression.arguments[0]; if (arg.type !== "Literal" || typeof arg.value !== "string") { + // "var x = require(42);" return REQ_COMPUTED; } if (BUILTIN_MODULES.indexOf(arg.value) !== -1) { + // "var fs = require('fs');" return REQ_CORE; } else if (/^\.{0,2}\//.test(arg.value)) { + // "var utils = require('./utils');" return REQ_FILE; } else { + // "var async = require('async');" return REQ_MODULE; } @@ -107,8 +138,9 @@ module.exports = function(context) { function isMixed(declarations) { var contains = {}; - declarations.forEach(function (declaration) { + declarations.forEach(function(declaration) { var type = getDeclarationType(declaration.init); + contains[type] = true; }); @@ -127,7 +159,7 @@ module.exports = function(context) { function isGrouped(declarations) { var found = {}; - declarations.forEach(function (declaration) { + declarations.forEach(function(declaration) { if (getDeclarationType(declaration.init) === DECL_REQUIRE) { found[inferModuleType(declaration.init)] = true; } @@ -140,7 +172,6 @@ module.exports = function(context) { return { "VariableDeclaration": function(node) { - var grouping = !!context.options[0]; if (isMixed(node.declarations)) { context.report( @@ -160,6 +191,22 @@ module.exports = function(context) { module.exports.schema = [ { - "type": "boolean" + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "object", + "properties": { + "grouping": { + "type": "boolean" + }, + "allowCall": { + "type": "boolean" + } + }, + "additionalProperties": false + } + ] } ]; diff --git a/tools/eslint/lib/rules/no-mixed-spaces-and-tabs.js b/tools/eslint/lib/rules/no-mixed-spaces-and-tabs.js index b6e29bacf21dac..b7b191cf02b42d 100644 --- a/tools/eslint/lib/rules/no-mixed-spaces-and-tabs.js +++ b/tools/eslint/lib/rules/no-mixed-spaces-and-tabs.js @@ -3,6 +3,7 @@ * @author Jary Niebur * @copyright 2014 Nicholas C. Zakas. All rights reserved. * @copyright 2014 Jary Niebur. All rights reserved. + * See LICENSE in root directory for full license. */ "use strict"; @@ -12,7 +13,8 @@ module.exports = function(context) { - var smartTabs; + var smartTabs, + ignoredLocs = []; switch (context.options[0]) { case true: // Support old syntax, maybe add deprecation warning here @@ -23,8 +25,35 @@ module.exports = function(context) { smartTabs = false; } - var COMMENT_START = /^\s*\/\*/, - MAYBE_COMMENT = /^\s*\*/; + /** + * Determines if a given line and column are before a location. + * @param {Location} loc The location object from an AST node. + * @param {int} line The line to check. + * @param {int} column The column to check. + * @returns {boolean} True if the line and column are before the location, false if not. + * @private + */ + function beforeLoc(loc, line, column) { + if (line < loc.start.line) { + return true; + } + return line === loc.start.line && column < loc.start.column; + } + + /** + * Determines if a given line and column are after a location. + * @param {Location} loc The location object from an AST node. + * @param {int} line The line to check. + * @param {int} column The column to check. + * @returns {boolean} True if the line and column are after the location, false if not. + * @private + */ + function afterLoc(loc, line, column) { + if (line > loc.end.line) { + return true; + } + return line === loc.end.line && column > loc.end.column; + } //-------------------------------------------------------------------------- // Public @@ -32,7 +61,12 @@ module.exports = function(context) { return { - "Program": function(node) { + "TemplateElement": function(node) { + ignoredLocs.push(node.loc); + }, + + "Program:exit": function(node) { + /* * At least one space followed by a tab * or the reverse before non-tab/-space @@ -40,9 +74,27 @@ module.exports = function(context) { */ var regex = /^(?=[\t ]*(\t | \t))/, match, - lines = context.getSourceLines(); + lines = context.getSourceLines(), + comments = context.getAllComments(); + + comments.forEach(function(comment) { + ignoredLocs.push(comment.loc); + }); + + ignoredLocs.sort(function(first, second) { + if (beforeLoc(first, second.start.line, second.start.column)) { + return 1; + } + + if (beforeLoc(second, first.start.line, second.start.column)) { + return -1; + } + + return 0; + }); if (smartTabs) { + /* * At least one space followed by a tab * before non-tab/-space characters begin. @@ -54,11 +106,21 @@ module.exports = function(context) { match = regex.exec(line); if (match) { - - if (!MAYBE_COMMENT.test(line) && !COMMENT_START.test(lines[i - 1])) { - context.report(node, { line: i + 1, column: match.index + 1 }, "Mixed spaces and tabs."); + var lineNumber = i + 1, + column = match.index + 1; + + for (var j = 0; j < ignoredLocs.length; j++) { + if (beforeLoc(ignoredLocs[j], lineNumber, column)) { + continue; + } + if (afterLoc(ignoredLocs[j], lineNumber, column)) { + continue; + } + + return; } + context.report(node, { line: lineNumber, column: column }, "Mixed spaces and tabs."); } }); } diff --git a/tools/eslint/lib/rules/no-multi-spaces.js b/tools/eslint/lib/rules/no-multi-spaces.js index f4d469859bd5ce..e57bdd3910da56 100644 --- a/tools/eslint/lib/rules/no-multi-spaces.js +++ b/tools/eslint/lib/rules/no-multi-spaces.js @@ -20,7 +20,7 @@ module.exports = function(context) { lastCommentIndex = 0; if (options && options.exceptions) { - Object.keys(options.exceptions).forEach(function (key) { + Object.keys(options.exceptions).forEach(function(key) { if (options.exceptions[key]) { exceptions[key] = true; } else { @@ -70,26 +70,46 @@ module.exports = function(context) { var source = context.getSource(), allComments = context.getAllComments(), - pattern = /[^\n\r\u2028\u2029 ] {2,}/g, // note: repeating space + pattern = /[^\n\r\u2028\u2029\t ].? {2,}/g, // note: repeating space token, + previousToken, parent; + + /** + * Creates a fix function that removes the multiple spaces between the two tokens + * @param {RuleFixer} leftToken left token + * @param {RuleFixer} rightToken right token + * @returns {function} fix function + * @private + */ + function createFix(leftToken, rightToken) { + return function(fixer) { + return fixer.replaceTextRange([leftToken.range[1], rightToken.range[0]], " "); + }; + } + while (pattern.test(source)) { // do not flag anything inside of comments if (!isIndexInComment(pattern.lastIndex, allComments)) { token = context.getTokenByRangeStart(pattern.lastIndex); - if (token) { + previousToken = context.getTokenBefore(token); + if (hasExceptions) { parent = context.getNodeByRangeIndex(pattern.lastIndex - 1); } if (!parent || !exceptions[parent.type]) { - context.report(token, token.loc.start, - "Multiple spaces found before '{{value}}'.", - { value: token.value }); + context.report({ + node: token, + loc: token.loc.start, + message: "Multiple spaces found before '{{value}}'.", + data: { value: token.value }, + fix: createFix(previousToken, token) + }); } } diff --git a/tools/eslint/lib/rules/no-multiple-empty-lines.js b/tools/eslint/lib/rules/no-multiple-empty-lines.js index 4b293fac301488..34b9b8eff93ffd 100644 --- a/tools/eslint/lib/rules/no-multiple-empty-lines.js +++ b/tools/eslint/lib/rules/no-multiple-empty-lines.js @@ -13,13 +13,17 @@ module.exports = function(context) { // Use options.max or 2 as default - var numLines = 2; + var max = 2, + maxEOF, + maxBOF; // store lines that appear empty but really aren't var notEmpty = []; if (context.options.length) { - numLines = context.options[0].max; + max = context.options[0].max; + maxEOF = context.options[0].maxEOF; + maxBOF = context.options[0].maxBOF; } //-------------------------------------------------------------------------- @@ -31,6 +35,7 @@ module.exports = function(context) { "TemplateLiteral": function(node) { var start = node.loc.start.line; var end = node.loc.end.line; + while (start <= end) { notEmpty.push(start); start++; @@ -43,22 +48,52 @@ module.exports = function(context) { lastLocation, blankCounter = 0, location, - trimmedLines = lines.map(function(str) { - return str.trim(); - }); + firstOfEndingBlankLines, + firstNonBlankLine = -1, + trimmedLines = []; + + lines.forEach(function(str, i) { + var trimmed = str.trim(); + + if ((firstNonBlankLine === -1) && (trimmed !== "")) { + firstNonBlankLine = i; + } + + trimmedLines.push(trimmed); + }); // add the notEmpty lines in there with a placeholder notEmpty.forEach(function(x, i) { trimmedLines[i] = x; }); - // swallow the final newline, as some editors add it automatically - // and we don't want it to cause an issue - if (trimmedLines[trimmedLines.length - 1] === "") { - trimmedLines = trimmedLines.slice(0, -1); + if (typeof maxEOF === "undefined") { + + /* + * Swallow the final newline, as some editors add it + * automatically and we don't want it to cause an issue + */ + if (trimmedLines[trimmedLines.length - 1] === "") { + trimmedLines = trimmedLines.slice(0, -1); + } + + firstOfEndingBlankLines = trimmedLines.length; + } else { + + // save the number of the first of the last blank lines + firstOfEndingBlankLines = trimmedLines.length; + while (trimmedLines[firstOfEndingBlankLines - 1] === "" + && firstOfEndingBlankLines > 0) { + firstOfEndingBlankLines--; + } } // Aggregate and count blank lines + if (firstNonBlankLine > maxBOF) { + context.report(node, 0, + "Too many blank lines at the beginning of file. Max of " + maxBOF + " allowed."); + } + lastLocation = currentLocation; currentLocation = trimmedLines.indexOf("", currentLocation + 1); while (currentLocation !== -1) { @@ -67,12 +102,31 @@ module.exports = function(context) { if (lastLocation === currentLocation - 1) { blankCounter++; } else { - if (blankCounter >= numLines) { - location = { - line: lastLocation + 1, - column: lines[lastLocation].length - }; - context.report(node, location, "Multiple blank lines not allowed."); + location = { + line: lastLocation + 1, + column: 1 + }; + + if (lastLocation < firstOfEndingBlankLines) { + + // within the file, not at the end + if (blankCounter >= max) { + context.report({ + node: node, + loc: location, + message: "More than " + max + " blank " + (max === 1 ? "line" : "lines") + " not allowed." + }); + } + } else { + + // inside the last blank lines + if (blankCounter > maxEOF) { + context.report({ + node: node, + loc: location, + message: "Too many blank lines at the end of file. Max of " + maxEOF + " allowed." + }); + } } // Finally, reset the blank counter @@ -89,7 +143,16 @@ module.exports.schema = [ "type": "object", "properties": { "max": { - "type": "integer" + "type": "integer", + "minimum": 0 + }, + "maxEOF": { + "type": "integer", + "minimum": 0 + }, + "maxBOF": { + "type": "integer", + "minimum": 0 } }, "required": ["max"], diff --git a/tools/eslint/lib/rules/no-native-reassign.js b/tools/eslint/lib/rules/no-native-reassign.js index 1cbbbcbb850f3c..b4323369e42c03 100644 --- a/tools/eslint/lib/rules/no-native-reassign.js +++ b/tools/eslint/lib/rules/no-native-reassign.js @@ -10,39 +10,52 @@ //------------------------------------------------------------------------------ module.exports = function(context) { + var config = context.options[0]; + var exceptions = (config && config.exceptions) || []; - var NATIVE_OBJECTS = ["Array", "Boolean", "Date", "decodeURI", - "decodeURIComponent", "encodeURI", "encodeURIComponent", - "Error", "eval", "EvalError", "Function", "isFinite", - "isNaN", "JSON", "Math", "Number", "Object", "parseInt", - "parseFloat", "RangeError", "ReferenceError", "RegExp", - "String", "SyntaxError", "TypeError", "URIError", - "Map", "NaN", "Set", "WeakMap", "Infinity", "undefined"]; - var config = context.options[0] || {}; - var exceptions = config.exceptions || []; - var modifiedNativeObjects = NATIVE_OBJECTS; - - if (exceptions.length) { - modifiedNativeObjects = NATIVE_OBJECTS.filter(function(builtIn) { - return exceptions.indexOf(builtIn) === -1; - }); + /** + * Reports write references. + * @param {Reference} reference - A reference to check. + * @param {int} index - The index of the reference in the references. + * @param {Reference[]} references - The array that the reference belongs to. + * @returns {void} + */ + function checkReference(reference, index, references) { + var identifier = reference.identifier; + + if (reference.init === false && + reference.isWrite() && + + // Destructuring assignments can have multiple default value, + // so possibly there are multiple writeable references for the same identifier. + (index === 0 || references[index - 1].identifier !== identifier) + ) { + context.report({ + node: identifier, + message: "{{name}} is a read-only native object.", + data: identifier + }); + } } - return { + /** + * Reports write references if a given variable is readonly builtin. + * @param {Variable} variable - A variable to check. + * @returns {void} + */ + function checkVariable(variable) { + if (variable.writeable === false && exceptions.indexOf(variable.name) === -1) { + variable.references.forEach(checkReference); + } + } - "AssignmentExpression": function(node) { - if (modifiedNativeObjects.indexOf(node.left.name) >= 0) { - context.report(node, node.left.name + " is a read-only native object."); - } - }, + return { + "Program": function() { + var globalScope = context.getScope(); - "VariableDeclarator": function(node) { - if (modifiedNativeObjects.indexOf(node.id.name) >= 0) { - context.report(node, "Redefinition of '{{nativeObject}}'.", { nativeObject: node.id.name }); - } + globalScope.variables.forEach(checkVariable); } }; - }; module.exports.schema = [ @@ -51,9 +64,7 @@ module.exports.schema = [ "properties": { "exceptions": { "type": "array", - "items": { - "type": "string" - }, + "items": {"type": "string"}, "uniqueItems": true } }, diff --git a/tools/eslint/lib/rules/no-negated-condition.js b/tools/eslint/lib/rules/no-negated-condition.js new file mode 100644 index 00000000000000..0d5b283e54aef6 --- /dev/null +++ b/tools/eslint/lib/rules/no-negated-condition.js @@ -0,0 +1,74 @@ +/** + * @fileoverview Rule to disallow a negated condition + * @author Alberto Rodríguez + * @copyright 2015 Alberto Rodríguez. All rights reserved. + * See LICENSE file in root directory for full license. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + + /** + * Determines if a given node is an if-else without a condition on the else + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node has an else without an if. + * @private + */ + function hasElseWithoutCondition(node) { + return node.alternate && node.alternate.type !== "IfStatement"; + } + + /** + * Determines if a given node is a negated unary expression + * @param {Object} test The test object to check. + * @returns {boolean} True if the node is a negated unary expression. + * @private + */ + function isNegatedUnaryExpression(test) { + return test.type === "UnaryExpression" && test.operator === "!"; + } + + /** + * Determines if a given node is a negated binary expression + * @param {Test} test The test to check. + * @returns {boolean} True if the node is a negated binary expression. + * @private + */ + function isNegatedBinaryExpression(test) { + return test.type === "BinaryExpression" && + (test.operator === "!=" || test.operator === "!=="); + } + + /** + * Determines if a given node has a negated if expression + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node has a negated if expression. + * @private + */ + function isNegatedIf(node) { + return isNegatedUnaryExpression(node.test) || isNegatedBinaryExpression(node.test); + } + + return { + "IfStatement": function(node) { + if (!hasElseWithoutCondition(node)) { + return; + } + + if (isNegatedIf(node)) { + context.report(node, "Unexpected negated condition."); + } + }, + "ConditionalExpression": function(node) { + if (isNegatedIf(node)) { + context.report(node, "Unexpected negated condition."); + } + } + }; +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-negated-in-lhs.js b/tools/eslint/lib/rules/no-negated-in-lhs.js index 7d476a582a8949..67be9bb06d386e 100644 --- a/tools/eslint/lib/rules/no-negated-in-lhs.js +++ b/tools/eslint/lib/rules/no-negated-in-lhs.js @@ -15,7 +15,7 @@ module.exports = function(context) { "BinaryExpression": function(node) { if (node.operator === "in" && node.left.type === "UnaryExpression" && node.left.operator === "!") { - context.report(node, "The `in` expression's left operand is negated"); + context.report(node, "The 'in' expression's left operand is negated"); } } }; diff --git a/tools/eslint/lib/rules/no-new-func.js b/tools/eslint/lib/rules/no-new-func.js index c7900e0c8f4b1f..cbc0248fb11b70 100644 --- a/tools/eslint/lib/rules/no-new-func.js +++ b/tools/eslint/lib/rules/no-new-func.js @@ -11,13 +11,25 @@ module.exports = function(context) { - return { + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- - "NewExpression": function(node) { - if (node.callee.name === "Function") { - context.report(node, "The Function constructor is eval."); - } + /** + * Checks if the callee is the Function constructor, and if so, reports an issue. + * @param {ASTNode} node The node to check and report on + * @returns {void} + * @private + */ + function validateCallee(node) { + if (node.callee.name === "Function") { + context.report(node, "The Function constructor is eval."); } + } + + return { + "NewExpression": validateCallee, + "CallExpression": validateCallee }; }; diff --git a/tools/eslint/lib/rules/no-new-symbol.js b/tools/eslint/lib/rules/no-new-symbol.js new file mode 100644 index 00000000000000..143deec0a3c996 --- /dev/null +++ b/tools/eslint/lib/rules/no-new-symbol.js @@ -0,0 +1,35 @@ +/** + * @fileoverview Rule to disallow use of the new operator with the `Symbol` object + * @author Alberto Rodríguez + * @copyright 2016 Alberto Rodríguez. All rights reserved. + * See LICENSE file in root directory for full license. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + + return { + "Program:exit": function() { + var globalScope = context.getScope(); + var variable = globalScope.set.get("Symbol"); + + if (variable && variable.defs.length === 0) { + variable.references.forEach(function(ref) { + var node = ref.identifier; + + if (node.parent && node.parent.type === "NewExpression") { + context.report(node, "`Symbol` cannot be called as a constructor."); + } + }); + } + } + }; + +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-new-wrappers.js b/tools/eslint/lib/rules/no-new-wrappers.js index da609572da39f8..88c22c13c4b3f3 100644 --- a/tools/eslint/lib/rules/no-new-wrappers.js +++ b/tools/eslint/lib/rules/no-new-wrappers.js @@ -15,6 +15,7 @@ module.exports = function(context) { "NewExpression": function(node) { var wrapperObjects = ["String", "Number", "Boolean", "Math", "JSON"]; + if (wrapperObjects.indexOf(node.callee.name) > -1) { context.report(node, "Do not use {{fn}} as a constructor.", { fn: node.callee.name }); } diff --git a/tools/eslint/lib/rules/no-obj-calls.js b/tools/eslint/lib/rules/no-obj-calls.js index f3845c508fb75f..e8f1c94611295b 100644 --- a/tools/eslint/lib/rules/no-obj-calls.js +++ b/tools/eslint/lib/rules/no-obj-calls.js @@ -16,6 +16,7 @@ module.exports = function(context) { if (node.callee.type === "Identifier") { var name = node.callee.name; + if (name === "Math" || name === "JSON") { context.report(node, "'{{name}}' is not a function.", { name: name }); } diff --git a/tools/eslint/lib/rules/no-param-reassign.js b/tools/eslint/lib/rules/no-param-reassign.js index c425246535261c..9c7dc0bff23a11 100644 --- a/tools/eslint/lib/rules/no-param-reassign.js +++ b/tools/eslint/lib/rules/no-param-reassign.js @@ -9,79 +9,130 @@ // Rule Definition //------------------------------------------------------------------------------ -module.exports = function(context) { +var stopNodePattern = /(?:Statement|Declaration|Function(?:Expression)?|Program)$/; - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- +module.exports = function(context) { + var props = context.options[0] && Boolean(context.options[0].props); /** - * Finds the declaration for a given variable by name, searching up the scope tree. - * @param {Scope} scope The scope in which to search. - * @param {String} name The name of the variable. - * @returns {Variable} The declaration information for the given variable, or null if no declaration was found. + * Checks whether or not the reference modifies properties of its variable. + * @param {Reference} reference - A reference to check. + * @returns {boolean} Whether or not the reference modifies properties of its variable. */ - function findDeclaration(scope, name) { - var variables = scope.variables; + function isModifyingProp(reference) { + var node = reference.identifier; + var parent = node.parent; + + while (parent && !stopNodePattern.test(parent.type)) { + switch (parent.type) { + + // e.g. foo.a = 0; + case "AssignmentExpression": + return parent.left === node; + + // e.g. ++foo.a; + case "UpdateExpression": + return true; + + // e.g. delete foo.a; + case "UnaryExpression": + if (parent.operator === "delete") { + return true; + } + break; + + // EXCLUDES: e.g. cache.get(foo.a).b = 0; + case "CallExpression": + if (parent.callee !== node) { + return false; + } + break; - for (var i = 0; i < variables.length; i++) { - if (variables[i].name === name) { - return variables[i]; + // EXCLUDES: e.g. cache[foo.a] = 0; + case "MemberExpression": + if (parent.property === node) { + return false; + } + break; + + default: + break; } - } - if (scope.upper) { - return findDeclaration(scope.upper, name); - } else { - return null; + node = parent; + parent = node.parent; } + + return false; } /** - * Determines if a given variable is declared as a function parameter. - * @param {Variable} variable The variable declaration. - * @returns {boolean} True if the variable is a function parameter, false otherwise. + * Reports a reference if is non initializer and writable. + * @param {Reference} reference - A reference to check. + * @param {int} index - The index of the reference in the references. + * @param {Reference[]} references - The array that the reference belongs to. + * @returns {void} */ - function isParameter(variable) { - var defs = variable.defs; + function checkReference(reference, index, references) { + var identifier = reference.identifier; + + if (identifier && + !reference.init && - for (var i = 0; i < defs.length; i++) { - if (defs[i].type === "Parameter") { - return true; + // Destructuring assignments can have multiple default value, + // so possibly there are multiple writeable references for the same identifier. + (index === 0 || references[index - 1].identifier !== identifier) + ) { + if (reference.isWrite()) { + context.report( + identifier, + "Assignment to function parameter '{{name}}'.", + {name: identifier.name}); + } else if (props && isModifyingProp(reference)) { + context.report( + identifier, + "Assignment to property of function parameter '{{name}}'.", + {name: identifier.name}); } } - - return false; } /** - * Checks whether a given node is an assignment to a function parameter. - * If so, a linting error will be reported. - * @param {ASTNode} node The node to check. - * @param {String} name The name of the variable being assigned to. + * Finds and reports references that are non initializer and writable. + * @param {Variable} variable - A variable to check. * @returns {void} */ - function checkParameter(node, name) { - var declaration = findDeclaration(context.getScope(), name); - - if (declaration && isParameter(declaration)) { - context.report(node, "Assignment to function parameter '{{name}}'.", { name: name }); + function checkVariable(variable) { + if (variable.defs[0].type === "Parameter") { + variable.references.forEach(checkReference); } } - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- + /** + * Checks parameters of a given function node. + * @param {ASTNode} node - A function node to check. + * @returns {void} + */ + function checkForFunction(node) { + context.getDeclaredVariables(node).forEach(checkVariable); + } return { - "AssignmentExpression": function(node) { - checkParameter(node, node.left.name); - }, - "UpdateExpression": function(node) { - checkParameter(node, node.argument.name); - } + // `:exit` is needed for the `node.parent` property of identifier nodes. + "FunctionDeclaration:exit": checkForFunction, + "FunctionExpression:exit": checkForFunction, + "ArrowFunctionExpression:exit": checkForFunction }; + }; -module.exports.schema = []; +module.exports.schema = [ + { + "type": "object", + "properties": { + "props": {"type": "boolean"} + }, + "additionalProperties": false + } +]; diff --git a/tools/eslint/lib/rules/no-plusplus.js b/tools/eslint/lib/rules/no-plusplus.js index de8e861034dddd..42df6a5f2d3d0b 100644 --- a/tools/eslint/lib/rules/no-plusplus.js +++ b/tools/eslint/lib/rules/no-plusplus.js @@ -1,6 +1,7 @@ /** * @fileoverview Rule to flag use of unary increment and decrement operators. * @author Ian Christian Myers + * @author Brody McKee (github.com/mrmckeb) */ "use strict"; @@ -11,9 +12,19 @@ module.exports = function(context) { + var config = context.options[0], + allowInForAfterthought = false; + + if (typeof config === "object") { + allowInForAfterthought = config.allowForLoopAfterthoughts === true; + } + return { "UpdateExpression": function(node) { + if (allowInForAfterthought && node.parent.type === "ForStatement") { + return; + } context.report(node, "Unary operator '" + node.operator + "' used."); } @@ -21,4 +32,14 @@ module.exports = function(context) { }; -module.exports.schema = []; +module.exports.schema = [ + { + "type": "object", + "properties": { + "allowForLoopAfterthoughts": { + "type": "boolean" + } + }, + "additionalProperties": false + } +]; diff --git a/tools/eslint/lib/rules/no-redeclare.js b/tools/eslint/lib/rules/no-redeclare.js index 80a6783ad5a023..83a6eed9f03205 100644 --- a/tools/eslint/lib/rules/no-redeclare.js +++ b/tools/eslint/lib/rules/no-redeclare.js @@ -10,22 +10,31 @@ //------------------------------------------------------------------------------ module.exports = function(context) { + var options = { + builtinGlobals: Boolean(context.options[0] && context.options[0].builtinGlobals) + }; /** * Find variables in a given scope and flag redeclared ones. - * @param {Scope} scope An escope scope object. + * @param {Scope} scope - An escope scope object. * @returns {void} * @private */ function findVariablesInScope(scope) { scope.variables.forEach(function(variable) { - if (variable.identifiers && variable.identifiers.length > 1) { + var hasBuiltin = options.builtinGlobals && "writeable" in variable; + var count = (hasBuiltin ? 1 : 0) + variable.identifiers.length; + + if (count >= 2) { variable.identifiers.sort(function(a, b) { return a.range[1] - b.range[1]; }); - for (var i = 1, l = variable.identifiers.length; i < l; i++) { - context.report(variable.identifiers[i], "{{a}} is already defined", {a: variable.name}); + for (var i = (hasBuiltin ? 0 : 1), l = variable.identifiers.length; i < l; i++) { + context.report( + variable.identifiers[i], + "'{{a}}' is already defined", + {a: variable.name}); } } }); @@ -33,36 +42,55 @@ module.exports = function(context) { } /** - * Find variables in a given node's associated scope. - * @param {ASTNode} node The node to check. + * Find variables in the current scope. + * @param {ASTNode} node - The Program node. * @returns {void} * @private */ - function findVariables(node) { - var scope = context.getScope(); - - findVariablesInScope(scope); + function checkForGlobal(node) { + var scope = context.getScope(), + parserOptions = context.parserOptions, + ecmaFeatures = parserOptions.ecmaFeatures || {}; - // globalReturn means one extra scope to check - if (node.type === "Program" && context.ecmaFeatures.globalReturn) { + // Nodejs env or modules has a special scope. + if (ecmaFeatures.globalReturn || node.sourceType === "module") { findVariablesInScope(scope.childScopes[0]); + } else { + findVariablesInScope(scope); } } - if (context.ecmaFeatures.blockBindings) { + /** + * Find variables in the current scope. + * @returns {void} + * @private + */ + function checkForBlock() { + findVariablesInScope(context.getScope()); + } + + if (context.parserOptions.ecmaVersion >= 6) { return { - "Program": findVariables, - "BlockStatement": findVariables, - "SwitchStatement": findVariables + "Program": checkForGlobal, + "BlockStatement": checkForBlock, + "SwitchStatement": checkForBlock }; } else { return { - "Program": findVariables, - "FunctionDeclaration": findVariables, - "FunctionExpression": findVariables, - "ArrowFunctionExpression": findVariables + "Program": checkForGlobal, + "FunctionDeclaration": checkForBlock, + "FunctionExpression": checkForBlock, + "ArrowFunctionExpression": checkForBlock }; } }; -module.exports.schema = []; +module.exports.schema = [ + { + "type": "object", + "properties": { + "builtinGlobals": {"type": "boolean"} + }, + "additionalProperties": false + } +]; diff --git a/tools/eslint/lib/rules/no-reserved-keys.js b/tools/eslint/lib/rules/no-reserved-keys.js deleted file mode 100644 index 9165442b59466a..00000000000000 --- a/tools/eslint/lib/rules/no-reserved-keys.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @fileoverview Rule to disallow reserved words being used as keys - * @author Emil Bay - * @copyright 2014 Emil Bay. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var MESSAGE = "Reserved word '{{key}}' used as key."; - - var reservedWords = [ - "abstract", - "boolean", "break", "byte", - "case", "catch", "char", "class", "const", "continue", - "debugger", "default", "delete", "do", "double", - "else", "enum", "export", "extends", - "final", "finally", "float", "for", "function", - "goto", - "if", "implements", "import", "in", "instanceof", "int", "interface", - "long", - "native", "new", - "package", "private", "protected", "public", - "return", - "short", "static", "super", "switch", "synchronized", - "this", "throw", "throws", "transient", "try", "typeof", - "var", "void", "volatile", - "while", "with" - ]; - - return { - - "ObjectExpression": function(node) { - node.properties.forEach(function(property) { - - if (property.key.type === "Identifier") { - var keyName = property.key.name; - - if (reservedWords.indexOf("" + keyName) !== -1) { - context.report(node, MESSAGE, { key: keyName }); - } - } - - }); - - } - }; - -}; - -module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-restricted-globals.js b/tools/eslint/lib/rules/no-restricted-globals.js new file mode 100644 index 00000000000000..3cb64a485e9a10 --- /dev/null +++ b/tools/eslint/lib/rules/no-restricted-globals.js @@ -0,0 +1,71 @@ +/** + * @fileoverview Restrict usage of specified globals. + * @author Benoît Zugmeyer + * @copyright 2016 Benoît Zugmeyer. All rights reserved. + * See LICENSE file in root directory for full license. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var restrictedGlobals = context.options; + + // if no globals are restricted we don't need to check + if (restrictedGlobals.length === 0) { + return {}; + } + + /** + * Report a variable to be used as a restricted global. + * @param {Reference} reference the variable reference + * @returns {void} + * @private + */ + function reportReference(reference) { + context.report(reference.identifier, "Unexpected use of '{{name}}'", { + name: reference.identifier.name + }); + } + + /** + * Check if the given name is a restricted global name. + * @param {string} name name of a variable + * @returns {boolean} whether the variable is a restricted global or not + * @private + */ + function isRestricted(name) { + return restrictedGlobals.indexOf(name) >= 0; + } + + return { + "Program": function() { + var scope = context.getScope(); + + // Report variables declared elsewhere (ex: variables defined as "global" by eslint) + scope.variables.forEach(function(variable) { + if (!variable.defs.length && isRestricted(variable.name)) { + variable.references.forEach(reportReference); + } + }); + + // Report variables not declared at all + scope.through.forEach(function(reference) { + if (isRestricted(reference.identifier.name)) { + reportReference(reference); + } + }); + + } + }; +}; + +module.exports.schema = { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true +}; diff --git a/tools/eslint/lib/rules/no-restricted-imports.js b/tools/eslint/lib/rules/no-restricted-imports.js new file mode 100644 index 00000000000000..0ecd2b310813ed --- /dev/null +++ b/tools/eslint/lib/rules/no-restricted-imports.js @@ -0,0 +1,43 @@ +/** + * @fileoverview Restrict usage of specified node imports. + * @author Guy Ellis + * @copyright 2015 Guy Ellis. All rights reserved. + * See LICENSE file in root directory for full license. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var restrictedImports = context.options; + + // if no imports are restricted we don"t need to check + if (restrictedImports.length === 0) { + return {}; + } + + return { + "ImportDeclaration": function(node) { + if (node && node.source && node.source.value) { + + var value = node.source.value.trim(); + + if (restrictedImports.indexOf(value) !== -1) { + context.report(node, "'{{importName}}' import is restricted from being used.", { + importName: value + }); + } + } + } + }; +}; + +module.exports.schema = { + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true +}; diff --git a/tools/eslint/lib/rules/no-restricted-modules.js b/tools/eslint/lib/rules/no-restricted-modules.js index b2213ea00dbdc2..97097c41b05172 100644 --- a/tools/eslint/lib/rules/no-restricted-modules.js +++ b/tools/eslint/lib/rules/no-restricted-modules.js @@ -8,7 +8,8 @@ // Rule Definition //------------------------------------------------------------------------------ -module.exports = function (context) { +module.exports = function(context) { + // trim restricted module names var restrictedModules = context.options; @@ -57,7 +58,7 @@ module.exports = function (context) { } return { - "CallExpression": function (node) { + "CallExpression": function(node) { if (isRequireCall(node)) { var restrictedModuleName = getRestrictedModuleName(node); @@ -73,12 +74,7 @@ module.exports = function (context) { module.exports.schema = { "type": "array", - "items": [ - { - "enum": [0, 1, 2] - } - ], - "additionalItems": { + "items": { "type": "string" }, "uniqueItems": true diff --git a/tools/eslint/lib/rules/no-restricted-syntax.js b/tools/eslint/lib/rules/no-restricted-syntax.js new file mode 100644 index 00000000000000..52175835c89677 --- /dev/null +++ b/tools/eslint/lib/rules/no-restricted-syntax.js @@ -0,0 +1,44 @@ +/** + * @fileoverview Rule to flag use of certain node types + * @author Burak Yigit Kaya + * @copyright 2015 Burak Yigit Kaya. All rights reserved. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +var nodeTypes = require("espree").Syntax; + +module.exports = function(context) { + + /** + * Generates a warning from the provided node, saying that node type is not allowed. + * @param {ASTNode} node The node to warn on + * @returns {void} + */ + function warn(node) { + context.report(node, "Using '{{type}}' is not allowed.", node); + } + + return context.options.reduce(function(result, nodeType) { + result[nodeType] = warn; + + return result; + }, {}); + +}; + +module.exports.schema = { + "type": "array", + "items": [ + { + "enum": Object.keys(nodeTypes).map(function(k) { + return nodeTypes[k]; + }) + } + ], + "uniqueItems": true, + "minItems": 0 +}; diff --git a/tools/eslint/lib/rules/no-return-assign.js b/tools/eslint/lib/rules/no-return-assign.js index d3133357ad183d..dc02897d4101d3 100644 --- a/tools/eslint/lib/rules/no-return-assign.js +++ b/tools/eslint/lib/rules/no-return-assign.js @@ -14,7 +14,7 @@ * @returns {boolean} Whether or not the node is an `AssignmentExpression`. */ function isAssignment(node) { - return node != null && node.type === "AssignmentExpression"; + return node && node.type === "AssignmentExpression"; } /** @@ -37,10 +37,31 @@ function isEnclosedInParens(node, context) { module.exports = function(context) { var always = (context.options[0] || "except-parens") !== "except-parens"; + /** + * Check whether return statement contains assignment + * @param {ASTNode} nodeToCheck node to check + * @param {ASTNode} nodeToReport node to report + * @param {string} message message to report + * @returns {void} + * @private + */ + function checkForAssignInReturn(nodeToCheck, nodeToReport, message) { + if (isAssignment(nodeToCheck) && (always || !isEnclosedInParens(nodeToCheck, context))) { + context.report(nodeToReport, message); + } + } + return { "ReturnStatement": function(node) { - if (isAssignment(node.argument) && (always || !isEnclosedInParens(node.argument, context))) { - context.report(node, "Return statement should not contain assignment."); + var message = "Return statement should not contain assignment."; + + checkForAssignInReturn(node.argument, node, message); + }, + "ArrowFunctionExpression": function(node) { + if (node.body.type !== "BlockStatement") { + var message = "Arrow function should not return assignment."; + + checkForAssignInReturn(node.body, node, message); } } }; diff --git a/tools/eslint/lib/rules/no-script-url.js b/tools/eslint/lib/rules/no-script-url.js index 72521aecf1975a..9526061b24fe3e 100644 --- a/tools/eslint/lib/rules/no-script-url.js +++ b/tools/eslint/lib/rules/no-script-url.js @@ -2,8 +2,8 @@ * @fileoverview Rule to flag when using javascript: urls * @author Ilya Volodin */ -/*jshint scripturl: true */ -/*eslint no-script-url: 0*/ +/* jshint scripturl: true */ +/* eslint no-script-url: 0 */ "use strict"; diff --git a/tools/eslint/lib/rules/no-self-assign.js b/tools/eslint/lib/rules/no-self-assign.js new file mode 100644 index 00000000000000..2a03cab4072cf2 --- /dev/null +++ b/tools/eslint/lib/rules/no-self-assign.js @@ -0,0 +1,125 @@ +/** + * @fileoverview Rule to disallow assignments where both sides are exactly the same + * @author Toru Nagashima + * @copyright 2016 Toru Nagashima. All rights reserved. + * See LICENSE file in root directory for full license. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Traverses 2 Pattern nodes in parallel, then reports self-assignments. + * + * @param {ASTNode|null} left - A left node to traverse. This is a Pattern or + * a Property. + * @param {ASTNode|null} right - A right node to traverse. This is a Pattern or + * a Property. + * @param {function} report - A callback function to report. + * @returns {void} + */ +function eachSelfAssignment(left, right, report) { + var i, j; + + if (!left || !right) { + + // do nothing + } else if ( + left.type === "Identifier" && + right.type === "Identifier" && + left.name === right.name + ) { + report(right); + } else if ( + left.type === "ArrayPattern" && + right.type === "ArrayExpression" + ) { + var end = Math.min(left.elements.length, right.elements.length); + + for (i = 0; i < end; ++i) { + var rightElement = right.elements[i]; + + eachSelfAssignment(left.elements[i], rightElement, report); + + // After a spread element, those indices are unknown. + if (rightElement && rightElement.type === "SpreadElement") { + break; + } + } + } else if ( + left.type === "RestElement" && + right.type === "SpreadElement" + ) { + eachSelfAssignment(left.argument, right.argument, report); + } else if ( + left.type === "ObjectPattern" && + right.type === "ObjectExpression" && + right.properties.length >= 1 + ) { + + // Gets the index of the last spread property. + // It's possible to overwrite properties followed by it. + var startJ = 0; + + for (i = right.properties.length - 1; i >= 0; --i) { + if (right.properties[i].type === "ExperimentalSpreadProperty") { + startJ = i + 1; + break; + } + } + + for (i = 0; i < left.properties.length; ++i) { + for (j = startJ; j < right.properties.length; ++j) { + eachSelfAssignment( + left.properties[i], + right.properties[j], + report + ); + } + } + } else if ( + left.type === "Property" && + right.type === "Property" && + !left.computed && + !right.computed && + right.kind === "init" && + !right.method && + left.key.name === right.key.name + ) { + eachSelfAssignment(left.value, right.value, report); + } +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + + /** + * Reports a given node as self assignments. + * + * @param {ASTNode} node - A node to report. This is an Identifier node. + * @returns {void} + */ + function report(node) { + context.report({ + node: node, + message: "'{{name}}' is assigned to itself.", + data: node + }); + } + + return { + "AssignmentExpression": function(node) { + if (node.operator === "=") { + eachSelfAssignment(node.left, node.right, report); + } + } + }; +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-self-compare.js b/tools/eslint/lib/rules/no-self-compare.js index 6d8e11a5950261..9ab99d48f87d52 100644 --- a/tools/eslint/lib/rules/no-self-compare.js +++ b/tools/eslint/lib/rules/no-self-compare.js @@ -16,6 +16,7 @@ module.exports = function(context) { "BinaryExpression": function(node) { var operators = ["===", "==", "!==", "!=", ">", "<", ">=", "<="]; + if (operators.indexOf(node.operator) > -1 && (node.left.type === "Identifier" && node.right.type === "Identifier" && node.left.name === node.right.name || node.left.type === "Literal" && node.right.type === "Literal" && node.left.value === node.right.value)) { diff --git a/tools/eslint/lib/rules/no-sequences.js b/tools/eslint/lib/rules/no-sequences.js index 9f7bfe3e7d14a2..032c879f8e5d49 100644 --- a/tools/eslint/lib/rules/no-sequences.js +++ b/tools/eslint/lib/rules/no-sequences.js @@ -34,7 +34,7 @@ module.exports = function(context) { * @returns {boolean} True if parens around node belong to parent node. */ function requiresExtraParens(node) { - return node.parent && parenthesized[node.parent.type] != null && + return node.parent && parenthesized[node.parent.type] && node === node.parent[parenthesized[node.parent.type]]; } @@ -68,6 +68,7 @@ module.exports = function(context) { return { "SequenceExpression": function(node) { + // Always allow sequences in for statement update if (node.parent.type === "ForStatement" && (node === node.parent.init || node === node.parent.update)) { @@ -85,7 +86,9 @@ module.exports = function(context) { } } - context.report(node, "Unexpected use of comma operator."); + var child = context.getTokenAfter(node.expressions[0]); + + context.report(node, child.loc.start, "Unexpected use of comma operator."); } }; diff --git a/tools/eslint/lib/rules/no-shadow-restricted-names.js b/tools/eslint/lib/rules/no-shadow-restricted-names.js index ff3d058ce41fd7..e39cd00f472e7f 100644 --- a/tools/eslint/lib/rules/no-shadow-restricted-names.js +++ b/tools/eslint/lib/rules/no-shadow-restricted-names.js @@ -13,9 +13,15 @@ module.exports = function(context) { var RESTRICTED = ["undefined", "NaN", "Infinity", "arguments", "eval"]; + /** + * Check if the node name is present inside the restricted list + * @param {ASTNode} id id to evaluate + * @returns {void} + * @private + */ function checkForViolation(id) { if (RESTRICTED.indexOf(id.name) > -1) { - context.report(id, "Shadowing of global property \"" + id.name + "\"."); + context.report(id, "Shadowing of global property '" + id.name + "'."); } } @@ -24,9 +30,6 @@ module.exports = function(context) { checkForViolation(node.id); }, "ArrowFunctionExpression": function(node) { - if (node.id) { - checkForViolation(node.id); - } [].map.call(node.params, checkForViolation); }, "FunctionExpression": function(node) { diff --git a/tools/eslint/lib/rules/no-shadow.js b/tools/eslint/lib/rules/no-shadow.js index 060c668d570600..16432d6b02c6c0 100644 --- a/tools/eslint/lib/rules/no-shadow.js +++ b/tools/eslint/lib/rules/no-shadow.js @@ -6,6 +6,12 @@ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var astUtils = require("../ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ @@ -13,9 +19,21 @@ module.exports = function(context) { var options = { - hoist: (context.options[0] && context.options[0].hoist) || "functions" + builtinGlobals: Boolean(context.options[0] && context.options[0].builtinGlobals), + hoist: (context.options[0] && context.options[0].hoist) || "functions", + allow: (context.options[0] && context.options[0].allow) || [] }; + /** + * Check if variable name is allowed. + * + * @param {ASTNode} variable The variable to check. + * @returns {boolean} Whether or not the variable name is allowed. + */ + function isAllowed(variable) { + return options.allow.indexOf(variable.name) !== -1; + } + /** * Checks if a variable of the class name in the class scope of ClassDeclaration. * @@ -27,6 +45,7 @@ module.exports = function(context) { */ function isDuplicatedClassNameVariable(variable) { var block = variable.scope.block; + return block.type === "ClassDeclaration" && block.id === variable.identifiers[0]; } @@ -49,8 +68,8 @@ module.exports = function(context) { var inner = innerDef && innerDef.name.range; return ( - outer != null && - inner != null && + outer && + inner && outer[0] < inner[0] && inner[1] < outer[1] && ((innerDef.type === "FunctionName" && innerDef.node.type === "FunctionExpression") || innerDef.node.type === "ClassExpression") && @@ -65,6 +84,7 @@ module.exports = function(context) { */ function getNameRange(variable) { var def = variable.defs[0]; + return def && def.name.range; } @@ -78,86 +98,58 @@ module.exports = function(context) { var outerDef = scopeVar.defs[0]; var inner = getNameRange(variable); var outer = getNameRange(scopeVar); + return ( - inner != null && - outer != null && + inner && + outer && inner[1] < outer[0] && + // Excepts FunctionDeclaration if is {"hoist":"function"}. - (options.hoist !== "functions" || outerDef == null || outerDef.node.type !== "FunctionDeclaration") + (options.hoist !== "functions" || !outerDef || outerDef.node.type !== "FunctionDeclaration") ); } - /** - * Checks if a variable is contained in the list of given scope variables. - * @param {Object} variable The variable to check. - * @param {Array} scopeVars The scope variables to look for. - * @returns {boolean} Whether or not the variable is contains in the list of scope variables. - */ - function isContainedInScopeVars(variable, scopeVars) { - return scopeVars.some(function (scopeVar) { - return ( - scopeVar.identifiers.length > 0 && - variable.name === scopeVar.name && - !isDuplicatedClassNameVariable(scopeVar) && - !isOnInitializer(variable, scopeVar) && - !(options.hoist !== "all" && isInTdz(variable, scopeVar)) - ); - }); - } - - /** - * Checks if the given variables are shadowed in the given scope. - * @param {Array} variables The variables to look for - * @param {Object} scope The scope to be checked. - * @returns {Array} Variables which are not declared in the given scope. - */ - function checkShadowsInScope(variables, scope) { - - var passedVars = []; - - variables.forEach(function (variable) { - // "arguments" is a special case that has no identifiers (#1759) - if (variable.identifiers.length > 0 && isContainedInScopeVars(variable, scope.variables)) { - context.report( - variable.identifiers[0], - "{{name}} is already declared in the upper scope.", - {name: variable.name}); - } else { - passedVars.push(variable); - } - }); - - return passedVars; - } - /** * Checks the current context for shadowed variables. * @param {Scope} scope - Fixme * @returns {void} */ function checkForShadows(scope) { - var variables = scope.variables.filter(function(variable) { - return ( - // Skip "arguments". - variable.identifiers.length > 0 && - // Skip variables of a class name in the class scope of ClassDeclaration. - !isDuplicatedClassNameVariable(variable) - ); - }); - - // iterate through the array of variables and find duplicates with the upper scope - var upper = scope.upper; - while (upper && variables.length) { - variables = checkShadowsInScope(variables, upper); - upper = upper.upper; + var variables = scope.variables; + + for (var i = 0; i < variables.length; ++i) { + var variable = variables[i]; + + // Skips "arguments" or variables of a class name in the class scope of ClassDeclaration. + if (variable.identifiers.length === 0 || + isDuplicatedClassNameVariable(variable) || + isAllowed(variable) + ) { + continue; + } + + // Gets shadowed variable. + var shadowed = astUtils.getVariableByName(scope.upper, variable.name); + + if (shadowed && + (shadowed.identifiers.length > 0 || (options.builtinGlobals && "writeable" in shadowed)) && + !isOnInitializer(variable, shadowed) && + !(options.hoist !== "all" && isInTdz(variable, shadowed)) + ) { + context.report({ + node: variable.identifiers[0], + message: "'{{name}}' is already declared in the upper scope.", + data: variable + }); + } } } return { - "Program:exit": function () { - var globalScope = context.getScope(), - stack = globalScope.childScopes.slice(), - scope; + "Program:exit": function() { + var globalScope = context.getScope(); + var stack = globalScope.childScopes.slice(); + var scope; while (stack.length) { scope = stack.pop(); @@ -173,9 +165,15 @@ module.exports.schema = [ { "type": "object", "properties": { - "hoist": { - "enum": ["all", "functions", "never"] + "builtinGlobals": {"type": "boolean"}, + "hoist": {"enum": ["all", "functions", "never"]}, + "allow": { + "type": "array", + "items": { + "type": "string" + } } - } + }, + "additionalProperties": false } ]; diff --git a/tools/eslint/lib/rules/no-space-before-semi.js b/tools/eslint/lib/rules/no-space-before-semi.js deleted file mode 100644 index 4c2fffd9027e55..00000000000000 --- a/tools/eslint/lib/rules/no-space-before-semi.js +++ /dev/null @@ -1,98 +0,0 @@ -/** - * @fileoverview Rule to disallow whitespace before the semicolon - * @author Jonathan Kingston - * @copyright 2015 Mathias Schreck - * @copyright 2014 Jonathan Kingston - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - /** - * Determines whether two adjacent tokens are have whitespace between them. - * @param {Object} left - The left token object. - * @param {Object} right - The right token object. - * @returns {boolean} Whether or not there is space between the tokens. - */ - function isSpaced(left, right) { - return left.range[1] < right.range[0]; - } - - /** - * Checks whether two tokens are on the same line. - * @param {Object} left The leftmost token. - * @param {Object} right The rightmost token. - * @returns {boolean} True if the tokens are on the same line, false if not. - * @private - */ - function isSameLine(left, right) { - return left.loc.end.line === right.loc.start.line; - } - - /** - * Checks if a given token has leading whitespace. - * @param {Object} token The token to check. - * @returns {boolean} True if the given token has leading space, false if not. - */ - function hasLeadingSpace(token) { - var tokenBefore = context.getTokenBefore(token); - return isSameLine(tokenBefore, token) && isSpaced(tokenBefore, token); - } - - /** - * Checks if the given token is a semicolon. - * @param {Token} token The token to check. - * @returns {boolean} Whether or not the given token is a semicolon. - */ - function isSemicolon(token) { - return token.type === "Punctuator" && token.value === ";"; - } - - /** - * Reports if the given token has leading space. - * @param {Token} token The semicolon token to check. - * @param {ASTNode} node The corresponding node of the token. - * @returns {void} - */ - function checkSemiTokenForLeadingSpace(token, node) { - if (isSemicolon(token) && hasLeadingSpace(token)) { - context.report(node, token.loc.start, "Unexpected whitespace before semicolon."); - } - } - - /** - * Checks leading space before the semicolon with the assumption that the last token is the semicolon. - * @param {ASTNode} node The node to check. - * @returns {void} - */ - function checkNode(node) { - var token = context.getLastToken(node); - checkSemiTokenForLeadingSpace(token, node); - } - - return { - "VariableDeclaration": checkNode, - "ExpressionStatement": checkNode, - "BreakStatement": checkNode, - "ContinueStatement": checkNode, - "DebuggerStatement": checkNode, - "ReturnStatement": checkNode, - "ThrowStatement": checkNode, - "ForStatement": function (node) { - if (node.init) { - checkSemiTokenForLeadingSpace(context.getTokenAfter(node.init), node); - } - - if (node.test) { - checkSemiTokenForLeadingSpace(context.getTokenAfter(node.test), node); - } - } - }; -}; - -module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-spaced-func.js b/tools/eslint/lib/rules/no-spaced-func.js index cd3e8f975d3c8f..551a3c609717c5 100644 --- a/tools/eslint/lib/rules/no-spaced-func.js +++ b/tools/eslint/lib/rules/no-spaced-func.js @@ -11,19 +11,42 @@ module.exports = function(context) { + var sourceCode = context.getSourceCode(); + + /** + * Check if open space is present in a function name + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ function detectOpenSpaces(node) { - var lastCalleeToken = context.getLastToken(node.callee); - var tokens = context.getTokens(node); - var i = tokens.indexOf(lastCalleeToken), l = tokens.length; - while (i < l && tokens[i].value !== "(") { - ++i; - } - if (i >= l) { - return; + var lastCalleeToken = sourceCode.getLastToken(node.callee), + prevToken = lastCalleeToken, + parenToken = sourceCode.getTokenAfter(lastCalleeToken); + + // advances to an open parenthesis. + while ( + parenToken && + parenToken.range[1] < node.range[1] && + parenToken.value !== "(" + ) { + prevToken = parenToken; + parenToken = sourceCode.getTokenAfter(parenToken); } + // look for a space between the callee and the open paren - if (tokens[i - 1].range[1] !== tokens[i].range[0]) { - context.report(node, "Unexpected space between function name and paren."); + if (parenToken && + parenToken.range[1] < node.range[1] && + sourceCode.isSpaceBetweenTokens(prevToken, parenToken) + ) { + context.report({ + node: node, + loc: lastCalleeToken.loc.start, + message: "Unexpected space between function name and paren.", + fix: function(fixer) { + return fixer.removeRange([prevToken.range[1], parenToken.range[0]]); + } + }); } } diff --git a/tools/eslint/lib/rules/no-sync.js b/tools/eslint/lib/rules/no-sync.js index c26e003f6ef2cb..481514b83d492b 100644 --- a/tools/eslint/lib/rules/no-sync.js +++ b/tools/eslint/lib/rules/no-sync.js @@ -3,7 +3,7 @@ * @author Matt DuVall */ -/*jshint node:true*/ +/* jshint node:true */ "use strict"; diff --git a/tools/eslint/lib/rules/no-this-before-super.js b/tools/eslint/lib/rules/no-this-before-super.js index bd0836eec78cd2..4e6c47fda8d851 100644 --- a/tools/eslint/lib/rules/no-this-before-super.js +++ b/tools/eslint/lib/rules/no-this-before-super.js @@ -6,137 +6,275 @@ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var astUtils = require("../ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given node is a constructor. + * @param {ASTNode} node - A node to check. This node type is one of + * `Program`, `FunctionDeclaration`, `FunctionExpression`, and + * `ArrowFunctionExpression`. + * @returns {boolean} `true` if the node is a constructor. + */ +function isConstructorFunction(node) { + return ( + node.type === "FunctionExpression" && + node.parent.type === "MethodDefinition" && + node.parent.kind === "constructor" + ); +} + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = function(context) { - /** - * Searches a class node that a node is belonging to. - * @param {Node} node - A node to start searching. - * @returns {ClassDeclaration|ClassExpression|null} the found class node, or `null`. + /* + * Information for each constructor. + * - upper: Information of the upper constructor. + * - hasExtends: A flag which shows whether the owner class has a valid + * `extends` part. + * - scope: The scope of the owner class. + * - codePath: The code path of this constructor. */ - function getClassInAncestor(node) { - while (node != null) { - if (node.type === "ClassDeclaration" || node.type === "ClassExpression") { - return node; - } - node = node.parent; - } - /* istanbul ignore next */ - return null; - } + var funcInfo = null; + + /* + * Information for each code path segment. + * Each key is the id of a code path segment. + * Each value is an object: + * - superCalled: The flag which shows `super()` called in all code paths. + * - invalidNodes: The array of invalid ThisExpression and Super nodes. + */ + var segInfoMap = Object.create(null); /** - * Checks whether or not a node is the null literal. - * @param {Node} node - A node to check. - * @returns {boolean} whether or not a node is the null literal. + * Gets whether or not `super()` is called in a given code path segment. + * @param {CodePathSegment} segment - A code path segment to get. + * @returns {boolean} `true` if `super()` is called. */ - function isNullLiteral(node) { - return node != null && node.type === "Literal" && node.value === null; + function isCalled(segment) { + return segInfoMap[segment.id].superCalled; } /** - * Checks whether or not a node is the callee of a call expression. - * @param {Node} node - A node to check. - * @returns {boolean} whether or not a node is the callee of a call expression. + * Checks whether or not this is in a constructor. + * @returns {boolean} `true` if this is in a constructor. */ - function isCallee(node) { - return node != null && node.parent.type === "CallExpression" && node.parent.callee === node; + function isInConstructorOfDerivedClass() { + return Boolean(funcInfo && funcInfo.isConstructor && funcInfo.hasExtends); } /** - * Checks whether or not the current traversal context is before `super()`. - * @param {object} item - A checking context. - * @returns {boolean} whether or not the current traversal context is before `super()`. + * Checks whether or not this is before `super()` is called. + * @returns {boolean} `true` if this is before `super()` is called. */ - function isBeforeSuperCalling(item) { + function isBeforeCallOfSuper() { return ( - item != null && - item.scope === context.getScope().variableScope.upper.variableScope && - item.superCalled === false + isInConstructorOfDerivedClass(funcInfo) && + !funcInfo.codePath.currentSegments.every(isCalled) ); } - var stack = []; + /** + * Sets a given node as invalid. + * @param {ASTNode} node - A node to set as invalid. This is one of + * a ThisExpression and a Super. + * @returns {void} + */ + function setInvalid(node) { + var segments = funcInfo.codePath.currentSegments; + + for (var i = 0; i < segments.length; ++i) { + segInfoMap[segments[i].id].invalidNodes.push(node); + } + } + + /** + * Sets the current segment as `super` was called. + * @returns {void} + */ + function setSuperCalled() { + var segments = funcInfo.codePath.currentSegments; + + for (var i = 0; i < segments.length; ++i) { + segInfoMap[segments[i].id].superCalled = true; + } + } return { + /** - * Start checking. - * @param {MethodDefinition} node - A target node. + * Adds information of a constructor into the stack. + * @param {CodePath} codePath - A code path which was started. + * @param {ASTNode} node - The current node. * @returns {void} */ - "MethodDefinition": function(node) { - if (node.kind !== "constructor") { + "onCodePathStart": function(codePath, node) { + if (isConstructorFunction(node)) { + + // Class > ClassBody > MethodDefinition > FunctionExpression + var classNode = node.parent.parent.parent; + + funcInfo = { + upper: funcInfo, + isConstructor: true, + hasExtends: Boolean( + classNode.superClass && + !astUtils.isNullOrUndefined(classNode.superClass) + ), + codePath: codePath + }; + } else { + funcInfo = { + upper: funcInfo, + isConstructor: false, + hasExtends: false, + codePath: codePath + }; + } + }, + + /** + * Removes the top of stack item. + * + * And this treverses all segments of this code path then reports every + * invalid node. + * + * @param {CodePath} codePath - A code path which was ended. + * @param {ASTNode} node - The current node. + * @returns {void} + */ + "onCodePathEnd": function(codePath) { + var isDerivedClass = funcInfo.hasExtends; + + funcInfo = funcInfo.upper; + if (!isDerivedClass) { return; } - stack.push({ - thisOrSuperBeforeSuperCalled: [], - superCalled: false, - scope: context.getScope().variableScope + + codePath.traverseSegments(function(segment, controller) { + var info = segInfoMap[segment.id]; + + for (var i = 0; i < info.invalidNodes.length; ++i) { + var invalidNode = info.invalidNodes[i]; + + context.report({ + message: "'{{kind}}' is not allowed before 'super()'.", + node: invalidNode, + data: { + kind: invalidNode.type === "Super" ? "super" : "this" + } + }); + } + + if (info.superCalled) { + controller.skip(); + } }); }, /** - * Treats the result of checking and reports invalid `this`/`super`. - * @param {MethodDefinition} node - A target node. + * Initialize information of a given code path segment. + * @param {CodePathSegment} segment - A code path segment to initialize. * @returns {void} */ - "MethodDefinition:exit": function(node) { - if (node.kind !== "constructor") { + "onCodePathSegmentStart": function(segment) { + if (!isInConstructorOfDerivedClass(funcInfo)) { return; } - var result = stack.pop(); - // Skip if it has no extends or `extends null`. - var classNode = getClassInAncestor(node); - if (classNode == null || classNode.superClass == null || isNullLiteral(classNode.superClass)) { + // Initialize info. + segInfoMap[segment.id] = { + superCalled: ( + segment.prevSegments.length > 0 && + segment.prevSegments.every(isCalled) + ), + invalidNodes: [] + }; + }, + + /** + * Update information of the code path segment when a code path was + * looped. + * @param {CodePathSegment} fromSegment - The code path segment of the + * end of a loop. + * @param {CodePathSegment} toSegment - A code path segment of the head + * of a loop. + * @returns {void} + */ + "onCodePathSegmentLoop": function(fromSegment, toSegment) { + if (!isInConstructorOfDerivedClass(funcInfo)) { return; } - // Reports. - result.thisOrSuperBeforeSuperCalled.forEach(function(thisOrSuper) { - var type = (thisOrSuper.type === "Super" ? "super" : "this"); - context.report(thisOrSuper, "\"{{type}}\" is not allowed before super()", {type: type}); - }); + // Update information inside of the loop. + funcInfo.codePath.traverseSegments( + {first: toSegment, last: fromSegment}, + function(segment, controller) { + var info = segInfoMap[segment.id]; + + if (info.superCalled) { + info.invalidNodes = []; + controller.skip(); + } else if ( + segment.prevSegments.length > 0 && + segment.prevSegments.every(isCalled) + ) { + info.superCalled = true; + info.invalidNodes = []; + } + } + ); }, /** - * Marks the node if is before `super()`. - * @param {ThisExpression} node - A target node. + * Reports if this is before `super()`. + * @param {ASTNode} node - A target node. * @returns {void} */ "ThisExpression": function(node) { - var item = stack[stack.length - 1]; - if (isBeforeSuperCalling(item)) { - item.thisOrSuperBeforeSuperCalled.push(node); + if (isBeforeCallOfSuper()) { + setInvalid(node); } }, /** - * Marks the node if is before `super()`. (exclude `super()` itself) - * @param {Super} node - A target node. + * Reports if this is before `super()`. + * @param {ASTNode} node - A target node. * @returns {void} */ "Super": function(node) { - var item = stack[stack.length - 1]; - if (isBeforeSuperCalling(item) && isCallee(node) === false) { - item.thisOrSuperBeforeSuperCalled.push(node); + if (!astUtils.isCallee(node) && isBeforeCallOfSuper()) { + setInvalid(node); } }, /** * Marks `super()` called. - * To catch `super(this.a);`, marks on `CallExpression:exit`. - * @param {CallExpression} node - A target node. + * @param {ASTNode} node - A target node. * @returns {void} */ "CallExpression:exit": function(node) { - var item = stack[stack.length - 1]; - if (isBeforeSuperCalling(item) && node.callee.type === "Super") { - item.superCalled = true; + if (node.callee.type === "Super" && isBeforeCallOfSuper()) { + setSuperCalled(); } + }, + + /** + * Resets state. + * @returns {void} + */ + "Program:exit": function() { + segInfoMap = Object.create(null); } }; }; diff --git a/tools/eslint/lib/rules/no-throw-literal.js b/tools/eslint/lib/rules/no-throw-literal.js index a04784ae8f251c..745850dc8dd30e 100644 --- a/tools/eslint/lib/rules/no-throw-literal.js +++ b/tools/eslint/lib/rules/no-throw-literal.js @@ -1,11 +1,50 @@ /** * @fileoverview Rule to restrict what can be thrown as an exception. * @author Dieter Oberkofler + * @copyright 2015 Ian VanSchooten. All rights reserved. * @copyright 2015 Dieter Oberkofler. All rights reserved. */ "use strict"; +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Determine if a node has a possiblity to be an Error object + * @param {ASTNode} node ASTNode to check + * @returns {boolean} True if there is a chance it contains an Error obj + */ +function couldBeError(node) { + switch (node.type) { + case "Identifier": + case "CallExpression": + case "NewExpression": + case "MemberExpression": + case "TaggedTemplateExpression": + case "YieldExpression": + return true; // possibly an error object. + + case "AssignmentExpression": + return couldBeError(node.right); + + case "SequenceExpression": + var exprs = node.expressions; + + return exprs.length !== 0 && couldBeError(exprs[exprs.length - 1]); + + case "LogicalExpression": + return couldBeError(node.left) || couldBeError(node.right); + + case "ConditionalExpression": + return couldBeError(node.consequent) || couldBeError(node.alternate); + + default: + return false; + } +} + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ @@ -15,9 +54,8 @@ module.exports = function(context) { return { "ThrowStatement": function(node) { - - if (node.argument.type === "Literal") { - context.report(node, "Do not throw a literal."); + if (!couldBeError(node.argument)) { + context.report(node, "Expected an object to be thrown."); } else if (node.argument.type === "Identifier") { if (node.argument.name === "undefined") { context.report(node, "Do not throw undefined."); diff --git a/tools/eslint/lib/rules/no-trailing-spaces.js b/tools/eslint/lib/rules/no-trailing-spaces.js index a54cfe8cce8033..af30610f94e759 100644 --- a/tools/eslint/lib/rules/no-trailing-spaces.js +++ b/tools/eslint/lib/rules/no-trailing-spaces.js @@ -13,11 +13,36 @@ module.exports = function(context) { var BLANK_CLASS = "[ \t\u00a0\u2000-\u200b\u2028\u2029\u3000]", SKIP_BLANK = "^" + BLANK_CLASS + "*$", - NONBLANK = BLANK_CLASS + "$"; + NONBLANK = BLANK_CLASS + "+$"; var options = context.options[0] || {}, skipBlankLines = options.skipBlankLines || false; + /** + * Report the error message + * @param {ASTNode} node node to report + * @param {int[]} location range information + * @param {int[]} fixRange Range based on the whole program + * @returns {void} + */ + function report(node, location, fixRange) { + + /* + * Passing node is a bit dirty, because message data will contain big + * text in `source`. But... who cares :) ? + * One more kludge will not make worse the bloody wizardry of this + * plugin. + */ + context.report({ + node: node, + loc: location, + message: "Trailing spaces not allowed.", + fix: function(fixer) { + return fixer.removeRange(fixRange); + } + }); + } + //-------------------------------------------------------------------------- // Public @@ -33,11 +58,22 @@ module.exports = function(context) { var src = context.getSource(), re = new RegExp(NONBLANK), skipMatch = new RegExp(SKIP_BLANK), - matches, lines = src.split(/\r?\n/), location; + matches, + lines = src.split(/\r?\n/), + linebreaks = context.getSource().match(/\r\n|\r|\n|\u2028|\u2029/g), + location, + totalLength = 0, + fixRange = []; for (var i = 0, ii = lines.length; i < ii; i++) { - matches = re.exec(lines[i]); + + // Always add linebreak length to line length to accommodate for line break (\n or \r\n) + // Because during the fix time they also reserve one spot in the array. + // Usually linebreak length is 2 for \r\n (CRLF) and 1 for \n (LF) + var linebreakLength = linebreaks && linebreaks[i] ? linebreaks[i].length : 1; + var lineLength = lines[i].length + linebreakLength; + if (matches) { // If the line has only whitespace, and skipBlankLines @@ -47,14 +83,15 @@ module.exports = function(context) { } location = { line: i + 1, - column: lines[i].length - matches[0].length + 1 + column: matches.index }; - // Passing node is a bit dirty, because message data will contain - // big text in `source`. But... who cares :) ? - // One more kludge will not make worse the bloody wizardry of this plugin. - context.report(node, location, "Trailing spaces not allowed."); + fixRange = [totalLength + location.column, totalLength + lineLength - linebreakLength]; + + report(node, location, fixRange); } + + totalLength += lineLength; } } diff --git a/tools/eslint/lib/rules/no-undef-init.js b/tools/eslint/lib/rules/no-undef-init.js index fc08c9b5088ac8..1348c641e362a8 100644 --- a/tools/eslint/lib/rules/no-undef-init.js +++ b/tools/eslint/lib/rules/no-undef-init.js @@ -1,6 +1,8 @@ /** * @fileoverview Rule to flag when initializing to undefined * @author Ilya Volodin + * @copyright 2013 Ilya Volodin. All rights reserved. + * See LICENSE in root directory for full license. */ "use strict"; @@ -14,10 +16,10 @@ module.exports = function(context) { return { "VariableDeclarator": function(node) { - var name = node.id.name; - var init = node.init && node.init.name; + var name = node.id.name, + init = node.init && node.init.name; - if (init === "undefined") { + if (init === "undefined" && node.parent.kind !== "const") { context.report(node, "It's not necessary to initialize '{{name}}' to undefined.", { name: name }); } } diff --git a/tools/eslint/lib/rules/no-undef.js b/tools/eslint/lib/rules/no-undef.js index 7e15cfaf21db28..c3a88725678e75 100644 --- a/tools/eslint/lib/rules/no-undef.js +++ b/tools/eslint/lib/rules/no-undef.js @@ -6,43 +6,10 @@ */ "use strict"; -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -// none! - //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ -function isImplicitGlobal(variable) { - return variable.defs.every(function(def) { - return def.type === "ImplicitGlobalVariable"; - }); -} - -/** - * Gets the declared variable, defined in `scope`, that `ref` refers to. - * @param {Scope} scope The scope in which to search. - * @param {Reference} ref The reference to find in the scope. - * @returns {Variable} The variable, or null if ref refers to an undeclared variable. - */ -function getDeclaredGlobalVariable(scope, ref) { - var declaredGlobal = null; - scope.variables.some(function(variable) { - if (variable.name === ref.identifier.name) { - // If it's an implicit global, it must have a `writeable` field (indicating it was declared) - if (!isImplicitGlobal(variable) || {}.hasOwnProperty.call(variable, "writeable")) { - declaredGlobal = variable; - return true; - } - } - return false; - }); - return declaredGlobal; -} - /** * Checks if the given node is the argument of a typeof operator. * @param {ASTNode} node The AST node being checked. @@ -50,6 +17,7 @@ function getDeclaredGlobalVariable(scope, ref) { */ function hasTypeOfOperator(node) { var parent = node.parent; + return parent.type === "UnaryExpression" && parent.operator === "typeof"; } @@ -58,35 +26,38 @@ function hasTypeOfOperator(node) { //------------------------------------------------------------------------------ module.exports = function(context) { - - var NOT_DEFINED_MESSAGE = "\"{{name}}\" is not defined.", - READ_ONLY_MESSAGE = "\"{{name}}\" is read only."; + var options = context.options[0]; + var considerTypeOf = options && options.typeof === true || false; return { - - "Program:exit": function(/*node*/) { - + "Program:exit": function(/* node */) { var globalScope = context.getScope(); globalScope.through.forEach(function(ref) { - var variable = getDeclaredGlobalVariable(globalScope, ref), - name = ref.identifier.name; + var identifier = ref.identifier; - if (hasTypeOfOperator(ref.identifier)) { + if (!considerTypeOf && hasTypeOfOperator(identifier)) { return; } - if (!variable) { - context.report(ref.identifier, NOT_DEFINED_MESSAGE, { name: name }); - } else if (ref.isWrite() && variable.writeable === false) { - context.report(ref.identifier, READ_ONLY_MESSAGE, { name: name }); - } + context.report({ + node: identifier, + message: "'{{name}}' is not defined.", + data: identifier + }); }); - } - }; - }; -module.exports.schema = []; +module.exports.schema = [ + { + "type": "object", + "properties": { + "typeof": { + "type": "boolean" + } + }, + "additionalProperties": false + } +]; diff --git a/tools/eslint/lib/rules/no-undefined.js b/tools/eslint/lib/rules/no-undefined.js index 222be573d229ca..a44eabf1b1fa82 100644 --- a/tools/eslint/lib/rules/no-undefined.js +++ b/tools/eslint/lib/rules/no-undefined.js @@ -15,6 +15,7 @@ module.exports = function(context) { "Identifier": function(node) { if (node.name === "undefined") { var parent = context.getAncestors().pop(); + if (!parent || parent.type !== "MemberExpression" || node !== parent.property || parent.computed) { context.report(node, "Unexpected use of undefined."); } diff --git a/tools/eslint/lib/rules/no-underscore-dangle.js b/tools/eslint/lib/rules/no-underscore-dangle.js index 38ad52f74fc4c2..6401e93e3780b2 100644 --- a/tools/eslint/lib/rules/no-underscore-dangle.js +++ b/tools/eslint/lib/rules/no-underscore-dangle.js @@ -11,50 +11,105 @@ module.exports = function(context) { + var options = context.options[0] || {}; + var ALLOWED_VARIABLES = options.allow ? options.allow : []; + var allowAfterThis = typeof options.allowAfterThis !== "undefined" ? options.allowAfterThis : false; + //------------------------------------------------------------------------- // Helpers //------------------------------------------------------------------------- + /** + * Check if identifier is present inside the allowed option + * @param {string} identifier name of the node + * @returns {boolean} true if its is present + * @private + */ + function isAllowed(identifier) { + return ALLOWED_VARIABLES.some(function(ident) { + return ident === identifier; + }); + } + + /** + * Check if identifier has a underscore at the end + * @param {ASTNode} identifier node to evaluate + * @returns {boolean} true if its is present + * @private + */ function hasTrailingUnderscore(identifier) { var len = identifier.length; return identifier !== "_" && (identifier[0] === "_" || identifier[len - 1] === "_"); } + /** + * Check if identifier is a special case member expression + * @param {ASTNode} identifier node to evaluate + * @returns {boolean} true if its is a special case + * @private + */ function isSpecialCaseIdentifierForMemberExpression(identifier) { return identifier === "__proto__"; } + /** + * Check if identifier is a special case variable expression + * @param {ASTNode} identifier node to evaluate + * @returns {boolean} true if its is a special case + * @private + */ function isSpecialCaseIdentifierInVariableExpression(identifier) { + // Checks for the underscore library usage here return identifier === "_"; } + /** + * Check if function has a underscore at the end + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ function checkForTrailingUnderscoreInFunctionDeclaration(node) { if (node.id) { var identifier = node.id.name; - if (typeof identifier !== "undefined" && hasTrailingUnderscore(identifier)) { - context.report(node, "Unexpected dangling \"_\" in \"" + identifier + "\"."); + if (typeof identifier !== "undefined" && hasTrailingUnderscore(identifier) && !isAllowed(identifier)) { + context.report(node, "Unexpected dangling '_' in '" + identifier + "'."); } } } + /** + * Check if variable expression has a underscore at the end + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ function checkForTrailingUnderscoreInVariableExpression(node) { var identifier = node.id.name; if (typeof identifier !== "undefined" && hasTrailingUnderscore(identifier) && - !isSpecialCaseIdentifierInVariableExpression(identifier)) { - context.report(node, "Unexpected dangling \"_\" in \"" + identifier + "\"."); + !isSpecialCaseIdentifierInVariableExpression(identifier) && !isAllowed(identifier)) { + context.report(node, "Unexpected dangling '_' in '" + identifier + "'."); } } + /** + * Check if member expression has a underscore at the end + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ function checkForTrailingUnderscoreInMemberExpression(node) { - var identifier = node.property.name; + var identifier = node.property.name, + isMemberOfThis = node.object.type === "ThisExpression"; if (typeof identifier !== "undefined" && hasTrailingUnderscore(identifier) && - !isSpecialCaseIdentifierForMemberExpression(identifier)) { - context.report(node, "Unexpected dangling \"_\" in \"" + identifier + "\"."); + !(isMemberOfThis && allowAfterThis) && + !isSpecialCaseIdentifierForMemberExpression(identifier) && !isAllowed(identifier)) { + context.report(node, "Unexpected dangling '_' in '" + identifier + "'."); } } @@ -70,4 +125,20 @@ module.exports = function(context) { }; -module.exports.schema = []; +module.exports.schema = [ + { + "type": "object", + "properties": { + "allow": { + "type": "array", + "items": { + "type": "string" + } + }, + "allowAfterThis": { + "type": "boolean" + } + }, + "additionalProperties": false + } +]; diff --git a/tools/eslint/lib/rules/no-unexpected-multiline.js b/tools/eslint/lib/rules/no-unexpected-multiline.js index 202182c35008b7..312376a334ac30 100644 --- a/tools/eslint/lib/rules/no-unexpected-multiline.js +++ b/tools/eslint/lib/rules/no-unexpected-multiline.js @@ -12,21 +12,28 @@ module.exports = function(context) { var FUNCTION_MESSAGE = "Unexpected newline between function and ( of function call."; var PROPERTY_MESSAGE = "Unexpected newline between object and [ of property access."; + var TAGGED_TEMPLATE_MESSAGE = "Unexpected newline between template tag and template literal."; /** - * Check to see if the bracket prior to the node is continuing the previous + * Check to see if there is a newline between the node and the following open bracket * line's expression * @param {ASTNode} node The node to check. * @param {string} msg The error message to use. * @returns {void} * @private */ - function checkForBreakBefore(node, msg) { - var tokens = context.getTokensBefore(node, 2); - var paren = tokens[1]; - var before = tokens[0]; - if (paren.loc.start.line !== before.loc.end.line) { - context.report(node, paren.loc.start, msg, { char: paren.value }); + function checkForBreakAfter(node, msg) { + var nodeExpressionEnd = node; + var openParen = context.getTokenAfter(node); + + // Move along until the end of the wrapped expression + while (openParen.value === ")") { + nodeExpressionEnd = openParen; + openParen = context.getTokenAfter(nodeExpressionEnd); + } + + if (openParen.loc.start.line !== nodeExpressionEnd.loc.end.line) { + context.report(node, openParen.loc.start, msg, { char: openParen.value }); } } @@ -40,16 +47,21 @@ module.exports = function(context) { if (!node.computed) { return; } + checkForBreakAfter(node.object, PROPERTY_MESSAGE); + }, - checkForBreakBefore(node.property, PROPERTY_MESSAGE); + "TaggedTemplateExpression": function(node) { + if (node.tag.loc.end.line === node.quasi.loc.start.line) { + return; + } + context.report(node, node.loc.start, TAGGED_TEMPLATE_MESSAGE); }, "CallExpression": function(node) { if (node.arguments.length === 0) { return; } - - checkForBreakBefore(node.arguments[0], FUNCTION_MESSAGE); + checkForBreakAfter(node.callee, FUNCTION_MESSAGE); } }; diff --git a/tools/eslint/lib/rules/no-unmodified-loop-condition.js b/tools/eslint/lib/rules/no-unmodified-loop-condition.js new file mode 100644 index 00000000000000..47a0e3885a38e1 --- /dev/null +++ b/tools/eslint/lib/rules/no-unmodified-loop-condition.js @@ -0,0 +1,359 @@ +/** + * @fileoverview Rule to disallow use of unmodified expressions in loop conditions + * @author Toru Nagashima + * @copyright 2015 Toru Nagashima. All rights reserved. + * See LICENSE file in root directory for full license. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var Map = require("es6-map"), + Traverser = require("../util/traverser"), + astUtils = require("../ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +var pushAll = Function.apply.bind(Array.prototype.push); +var SENTINEL_PATTERN = /(?:(?:Call|Class|Function|Member|New|Yield)Expression|Statement|Declaration)$/; +var LOOP_PATTERN = /^(?:DoWhile|For|While)Statement$/; +var GROUP_PATTERN = /^(?:BinaryExpression|ConditionalExpression)$/; +var SKIP_PATTERN = /^(?:ArrowFunction|Class|Function)Expression$/; +var DYNAMIC_PATTERN = /^(?:Call|Member|New|TaggedTemplate|Yield)Expression$/; + +/** + * @typedef {object} LoopConditionInfo + * @property {escope.Reference} reference - The reference. + * @property {ASTNode} group - BinaryExpression or ConditionalExpression nodes + * that the reference is belonging to. + * @property {function} isInLoop - The predicate which checks a given reference + * is in this loop. + * @property {boolean} modified - The flag that the reference is modified in + * this loop. + */ + +/** + * Checks whether or not a given reference is a write reference. + * + * @param {escope.Reference} reference - A reference to check. + * @returns {boolean} `true` if the reference is a write reference. + */ +function isWriteReference(reference) { + if (reference.init) { + var def = reference.resolved && reference.resolved.defs[0]; + + if (!def || def.type !== "Variable" || def.parent.kind !== "var") { + return false; + } + } + return reference.isWrite(); +} + +/** + * Checks whether or not a given loop condition info does not have the modified + * flag. + * + * @param {LoopConditionInfo} condition - A loop condition info to check. + * @returns {boolean} `true` if the loop condition info is "unmodified". + */ +function isUnmodified(condition) { + return !condition.modified; +} + +/** + * Checks whether or not a given loop condition info does not have the modified + * flag and does not have the group this condition belongs to. + * + * @param {LoopConditionInfo} condition - A loop condition info to check. + * @returns {boolean} `true` if the loop condition info is "unmodified". + */ +function isUnmodifiedAndNotBelongToGroup(condition) { + return !(condition.modified || condition.group); +} + +/** + * Checks whether or not a given reference is inside of a given node. + * + * @param {ASTNode} node - A node to check. + * @param {escope.Reference} reference - A reference to check. + * @returns {boolean} `true` if the reference is inside of the node. + */ +function isInRange(node, reference) { + var or = node.range; + var ir = reference.identifier.range; + + return or[0] <= ir[0] && ir[1] <= or[1]; +} + +/** + * Checks whether or not a given reference is inside of a loop node's condition. + * + * @param {ASTNode} node - A node to check. + * @param {escope.Reference} reference - A reference to check. + * @returns {boolean} `true` if the reference is inside of the loop node's + * condition. + */ +var isInLoop = { + WhileStatement: isInRange, + DoWhileStatement: isInRange, + ForStatement: function(node, reference) { + return ( + isInRange(node, reference) && + !(node.init && isInRange(node.init, reference)) + ); + } +}; + +/** + * Checks whether or not a given group node has any dynamic elements. + * + * @param {ASTNode} root - A node to check. + * This node is one of BinaryExpression or ConditionalExpression. + * @returns {boolean} `true` if the node is dynamic. + */ +function hasDynamicExpressions(root) { + var retv = false, + traverser = new Traverser(); + + traverser.traverse(root, { + enter: function(node) { + if (DYNAMIC_PATTERN.test(node.type)) { + retv = true; + this.break(); + } else if (SKIP_PATTERN.test(node.type)) { + this.skip(); + } + } + }); + + return retv; +} + +/** + * Creates the loop condition information from a given reference. + * + * @param {escope.Reference} reference - A reference to create. + * @returns {LoopConditionInfo|null} Created loop condition info, or null. + */ +function toLoopCondition(reference) { + if (reference.init) { + return null; + } + + var group = null; + var child = reference.identifier; + var node = child.parent; + + while (node) { + if (SENTINEL_PATTERN.test(node.type)) { + if (LOOP_PATTERN.test(node.type) && node.test === child) { + + // This reference is inside of a loop condition. + return { + reference: reference, + group: group, + isInLoop: isInLoop[node.type].bind(null, node), + modified: false + }; + } + + // This reference is outside of a loop condition. + break; + } + + /* + * If it's inside of a group, OK if either operand is modified. + * So stores the group this reference belongs to. + */ + if (GROUP_PATTERN.test(node.type)) { + + // If this expression is dynamic, no need to check. + if (hasDynamicExpressions(node)) { + break; + } else { + group = node; + } + } + + child = node; + node = node.parent; + } + + return null; +} + +/** + * Gets the function which encloses a given reference. + * This supports only FunctionDeclaration. + * + * @param {escope.Reference} reference - A reference to get. + * @returns {ASTNode|null} The function node or null. + */ +function getEncloseFunctionDeclaration(reference) { + var node = reference.identifier; + + while (node) { + if (node.type === "FunctionDeclaration") { + return node.id ? node : null; + } + + node = node.parent; + } + + return null; +} + +/** + * Updates the "modified" flags of given loop conditions with given modifiers. + * + * @param {LoopConditionInfo[]} conditions - The loop conditions to be updated. + * @param {escope.Reference[]} modifiers - The references to update. + * @returns {void} + */ +function updateModifiedFlag(conditions, modifiers) { + var funcNode, funcVar; + + for (var i = 0; i < conditions.length; ++i) { + var condition = conditions[i]; + + for (var j = 0; !condition.modified && j < modifiers.length; ++j) { + var modifier = modifiers[j], + inLoop; + + /* + * Besides checking for the condition being in the loop, we want to + * check the function that this modifier is belonging to is called + * in the loop. + * FIXME: This should probably be extracted to a function. + */ + inLoop = condition.isInLoop(modifier) || Boolean( + (funcNode = getEncloseFunctionDeclaration(modifier)) && + (funcVar = astUtils.getVariableByName(modifier.from.upper, funcNode.id.name)) && + funcVar.references.some(condition.isInLoop) + ); + condition.modified = inLoop; + } + } +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var groupMap = null; + + /** + * Reports a given condition info. + * + * @param {LoopConditionInfo} condition - A loop condition info to report. + * @returns {void} + */ + function report(condition) { + var node = condition.reference.identifier; + + context.report({ + node: node, + message: "'{{name}}' is not modified in this loop.", + data: node + }); + } + + /** + * Registers given conditions to the group the condition belongs to. + * + * @param {LoopConditionInfo[]} conditions - A loop condition info to + * register. + * @returns {void} + */ + function registerConditionsToGroup(conditions) { + for (var i = 0; i < conditions.length; ++i) { + var condition = conditions[i]; + + if (condition.group) { + var group = groupMap.get(condition.group); + + if (!group) { + group = []; + groupMap.set(condition.group, group); + } + group.push(condition); + } + } + } + + /** + * Reports references which are inside of unmodified groups. + * + * @param {LoopConditionInfo[]} conditions - A loop condition info to report. + * @returns {void} + */ + function checkConditionsInGroup(conditions) { + if (conditions.every(isUnmodified)) { + conditions.forEach(report); + } + } + + /** + * Finds unmodified references which are inside of a loop condition. + * Then reports the references which are outside of groups. + * + * @param {escope.Variable} variable - A variable to report. + * @returns {void} + */ + function checkReferences(variable) { + + // Gets references that exist in loop conditions. + var conditions = variable + .references + .map(toLoopCondition) + .filter(Boolean); + + if (conditions.length === 0) { + return; + } + + // Registers the conditions to belonging groups. + registerConditionsToGroup(conditions); + + // Check the conditions are modified. + var modifiers = variable.references.filter(isWriteReference); + + if (modifiers.length > 0) { + updateModifiedFlag(conditions, modifiers); + } + + /* + * Reports the conditions which are not belonging to groups. + * Others will be reported after all variables are done. + */ + conditions + .filter(isUnmodifiedAndNotBelongToGroup) + .forEach(report); + } + + return { + "Program:exit": function() { + var queue = [context.getScope()]; + + groupMap = new Map(); + + var scope; + + while ((scope = queue.pop())) { + pushAll(queue, scope.childScopes); + scope.variables.forEach(checkReferences); + } + + groupMap.forEach(checkConditionsInGroup); + groupMap = null; + } + }; +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-unneeded-ternary.js b/tools/eslint/lib/rules/no-unneeded-ternary.js index 6aa944673138d3..fcbff265f91db0 100644 --- a/tools/eslint/lib/rules/no-unneeded-ternary.js +++ b/tools/eslint/lib/rules/no-unneeded-ternary.js @@ -12,17 +12,8 @@ //------------------------------------------------------------------------------ module.exports = function(context) { - - /** - * Reports an AST node as a rule violation. - * @param {ASTNode} mainNode The node to report. - * @param {object} culpritNode - The token which has a problem - * @returns {void} - * @private - */ - function report(mainNode, culpritNode) { - context.report(mainNode, culpritNode.loc.start, "Unnecessary use of boolean literals in conditional expression"); - } + var options = context.options[0] || {}; + var defaultAssignment = options.defaultAssignment !== false; /** * Test if the node is a boolean literal @@ -34,15 +25,38 @@ module.exports = function(context) { return node.type === "Literal" && typeof node.value === "boolean"; } + /** + * Test if the node matches the pattern id ? id : expression + * @param {ASTNode} node - The ConditionalExpression to check. + * @returns {boolean} True if the pattern is matched, and false otherwise + * @private + */ + function matchesDefaultAssignment(node) { + return node.test.type === "Identifier" && + node.consequent.type === "Identifier" && + node.test.name === node.consequent.name; + } + return { "ConditionalExpression": function(node) { - if (isBooleanLiteral(node.alternate) && isBooleanLiteral(node.consequent)) { - report(node, node.consequent); + context.report(node, node.consequent.loc.start, "Unnecessary use of boolean literals in conditional expression"); + } else if (!defaultAssignment && matchesDefaultAssignment(node)) { + context.report(node, node.consequent.loc.start, "Unnecessary use of conditional expression for default assignment"); } } }; }; -module.exports.schema = []; +module.exports.schema = [ + { + "type": "object", + "properties": { + "defaultAssignment": { + "type": "boolean" + } + }, + "additionalProperties": false + } +]; diff --git a/tools/eslint/lib/rules/no-unreachable.js b/tools/eslint/lib/rules/no-unreachable.js index 1f169a64d53b31..ce3f4ba01fb265 100644 --- a/tools/eslint/lib/rules/no-unreachable.js +++ b/tools/eslint/lib/rules/no-unreachable.js @@ -1,6 +1,8 @@ /** * @fileoverview Checks for unreachable code due to return, throws, break, and continue. * @author Joel Feenstra + * @copyright 2015 Toru Nagashima. All rights reserved. + * See LICENSE file in root directory for full license. */ "use strict"; @@ -8,91 +10,85 @@ // Helpers //------------------------------------------------------------------------------ - -function report(context, node, unreachableType) { - var keyword; - switch (unreachableType) { - case "BreakStatement": - keyword = "break"; - break; - case "ContinueStatement": - keyword = "continue"; - break; - case "ReturnStatement": - keyword = "return"; - break; - case "ThrowStatement": - keyword = "throw"; - break; - default: - return; - } - context.report(node, "Found unexpected statement after a {{type}}.", { type: keyword }); +/** + * Checks whether or not a given variable declarator has the initializer. + * @param {ASTNode} node - A VariableDeclarator node to check. + * @returns {boolean} `true` if the node has the initializer. + */ +function isInitialized(node) { + return Boolean(node.init); } +/** + * Checks whether or not a given code path segment is unreachable. + * @param {CodePathSegment} segment - A CodePathSegment to check. + * @returns {boolean} `true` if the segment is unreachable. + */ +function isUnreachable(segment) { + return !segment.reachable; +} //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = function(context) { + var currentCodePath = null; /** - * Checks if a node is an exception for no-unreachable because of variable/function hoisting - * @param {ASTNode} node The AST node to check. - * @returns {boolean} if the node doesn't trigger unreachable - * @private + * Reports a given node if it's unreachable. + * @param {ASTNode} node - A statement node to report. + * @returns {void} */ - function isUnreachableAllowed(node) { - return node.type === "FunctionDeclaration" || - node.type === "VariableDeclaration" && - node.declarations.every(function(declaration) { - return declaration.type === "VariableDeclarator" && declaration.init === null; - }); + function reportIfUnreachable(node) { + if (currentCodePath.currentSegments.every(isUnreachable)) { + context.report({message: "Unreachable code.", node: node}); + } } - /* - * Verifies that the given node is the last node or followed exclusively by - * hoisted declarations - * @param {ASTNode} node Node that should be the last node - * @returns {void} - * @private - */ - function checkNode(node) { - var parent = context.getAncestors().pop(); - var field, i, sibling; + return { - switch (parent.type) { - case "SwitchCase": - field = "consequent"; - break; - case "Program": - case "BlockStatement": - field = "body"; - break; - default: - return; - } + // Manages the current code path. + "onCodePathStart": function(codePath) { + currentCodePath = codePath; + }, - for (i = parent[field].length - 1; i >= 0; i--) { - sibling = parent[field][i]; - if (sibling === node) { - return; // Found the last reachable statement, all done - } + "onCodePathEnd": function() { + currentCodePath = currentCodePath.upper; + }, + + // Registers for all statement nodes (excludes FunctionDeclaration). + BlockStatement: reportIfUnreachable, + BreakStatement: reportIfUnreachable, + ClassDeclaration: reportIfUnreachable, + ContinueStatement: reportIfUnreachable, + DebuggerStatement: reportIfUnreachable, + DoWhileStatement: reportIfUnreachable, + EmptyStatement: reportIfUnreachable, + ExpressionStatement: reportIfUnreachable, + ForInStatement: reportIfUnreachable, + ForOfStatement: reportIfUnreachable, + ForStatement: reportIfUnreachable, + IfStatement: reportIfUnreachable, + ImportDeclaration: reportIfUnreachable, + LabeledStatement: reportIfUnreachable, + ReturnStatement: reportIfUnreachable, + SwitchStatement: reportIfUnreachable, + ThrowStatement: reportIfUnreachable, + TryStatement: reportIfUnreachable, - if (!isUnreachableAllowed(sibling)) { - report(context, sibling, node.type); + VariableDeclaration: function(node) { + if (node.kind !== "var" || node.declarations.some(isInitialized)) { + reportIfUnreachable(node); } - } - } + }, - return { - "ReturnStatement": checkNode, - "ThrowStatement": checkNode, - "ContinueStatement": checkNode, - "BreakStatement": checkNode + WhileStatement: reportIfUnreachable, + WithStatement: reportIfUnreachable, + ExportNamedDeclaration: reportIfUnreachable, + ExportDefaultDeclaration: reportIfUnreachable, + ExportAllDeclaration: reportIfUnreachable }; - }; module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-unused-expressions.js b/tools/eslint/lib/rules/no-unused-expressions.js index f78cf30196be74..3da55602f02b7e 100644 --- a/tools/eslint/lib/rules/no-unused-expressions.js +++ b/tools/eslint/lib/rules/no-unused-expressions.js @@ -10,10 +10,13 @@ //------------------------------------------------------------------------------ module.exports = function(context) { + var config = context.options[0] || {}, + allowShortCircuit = config.allowShortCircuit || false, + allowTernary = config.allowTernary || false; /** * @param {ASTNode} node - any node - * @returns {Boolean} whether the given node structurally represents a directive + * @returns {boolean} whether the given node structurally represents a directive */ function looksLikeDirective(node) { return node.type === "ExpressionStatement" && @@ -45,27 +48,43 @@ module.exports = function(context) { /** * @param {ASTNode} node - any node * @param {ASTNode[]} ancestors - the given node's ancestors - * @returns {Boolean} whether the given node is considered a directive in its current position + * @returns {boolean} whether the given node is considered a directive in its current position */ function isDirective(node, ancestors) { var parent = ancestors[ancestors.length - 1], grandparent = ancestors[ancestors.length - 2]; + return (parent.type === "Program" || parent.type === "BlockStatement" && (/Function/.test(grandparent.type))) && directives(parent).indexOf(node) >= 0; } - return { - "ExpressionStatement": function(node) { + /** + * Determines whether or not a given node is a valid expression. Recurses on short circuit eval and ternary nodes if enabled by flags. + * @param {ASTNode} node - any node + * @returns {boolean} whether the given node is a valid expression + */ + function isValidExpression(node) { + if (allowTernary) { + + // Recursive check for ternary and logical expressions + if (node.type === "ConditionalExpression") { + return isValidExpression(node.consequent) && isValidExpression(node.alternate); + } + } + if (allowShortCircuit) { + if (node.type === "LogicalExpression") { + return isValidExpression(node.right); + } + } - var type = node.expression.type, - ancestors = context.getAncestors(); + return /^(?:Assignment|Call|New|Update|Yield)Expression$/.test(node.type) || + (node.type === "UnaryExpression" && ["delete", "void"].indexOf(node.operator) >= 0); + } - if ( - !/^(?:Assignment|Call|New|Update|Yield)Expression$/.test(type) && - (type !== "UnaryExpression" || ["delete", "void"].indexOf(node.expression.operator) < 0) && - !isDirective(node, ancestors) - ) { + return { + "ExpressionStatement": function(node) { + if (!isValidExpression(node.expression) && !isDirective(node, context.getAncestors())) { context.report(node, "Expected an assignment or function call and instead saw an expression."); } } @@ -73,4 +92,17 @@ module.exports = function(context) { }; -module.exports.schema = []; +module.exports.schema = [ + { + "type": "object", + "properties": { + "allowShortCircuit": { + "type": "boolean" + }, + "allowTernary": { + "type": "boolean" + } + }, + "additionalProperties": false + } +]; diff --git a/tools/eslint/lib/rules/no-unused-labels.js b/tools/eslint/lib/rules/no-unused-labels.js new file mode 100644 index 00000000000000..e53b333f2e79b3 --- /dev/null +++ b/tools/eslint/lib/rules/no-unused-labels.js @@ -0,0 +1,82 @@ +/** + * @fileoverview Rule to disallow unused labels. + * @author Toru Nagashima + * @copyright 2016 Toru Nagashima. All rights reserved. + * See LICENSE file in root directory for full license. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var scopeInfo = null; + + /** + * Adds a scope info to the stack. + * + * @param {ASTNode} node - A node to add. This is a LabeledStatement. + * @returns {void} + */ + function enterLabeledScope(node) { + scopeInfo = { + label: node.label.name, + used: false, + upper: scopeInfo + }; + } + + /** + * Removes the top of the stack. + * At the same time, this reports the label if it's never used. + * + * @param {ASTNode} node - A node to report. This is a LabeledStatement. + * @returns {void} + */ + function exitLabeledScope(node) { + if (!scopeInfo.used) { + context.report({ + node: node.label, + message: "'{{name}}:' is defined but never used.", + data: node.label + }); + } + + scopeInfo = scopeInfo.upper; + } + + /** + * Marks the label of a given node as used. + * + * @param {ASTNode} node - A node to mark. This is a BreakStatement or + * ContinueStatement. + * @returns {void} + */ + function markAsUsed(node) { + if (!node.label) { + return; + } + + var label = node.label.name; + var info = scopeInfo; + + while (info) { + if (info.label === label) { + info.used = true; + break; + } + info = info.upper; + } + } + + return { + "LabeledStatement": enterLabeledScope, + "LabeledStatement:exit": exitLabeledScope, + "BreakStatement": markAsUsed, + "ContinueStatement": markAsUsed + }; +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-unused-vars.js b/tools/eslint/lib/rules/no-unused-vars.js index 6b3b7f334e206f..fa889d1975164e 100644 --- a/tools/eslint/lib/rules/no-unused-vars.js +++ b/tools/eslint/lib/rules/no-unused-vars.js @@ -5,25 +5,47 @@ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var lodash = require("lodash"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = function(context) { - var MESSAGE = "{{name}} is defined but never used"; + var MESSAGE = "'{{name}}' is defined but never used"; var config = { vars: "all", - args: "after-used" + args: "after-used", + caughtErrors: "none" }; - if (context.options[0]) { - if (typeof context.options[0] === "string") { - config.vars = context.options[0]; + var firstOption = context.options[0]; + + if (firstOption) { + if (typeof firstOption === "string") { + config.vars = firstOption; } else { - config.vars = context.options[0].vars || config.vars; - config.args = context.options[0].args || config.args; + config.vars = firstOption.vars || config.vars; + config.args = firstOption.args || config.args; + config.caughtErrors = firstOption.caughtErrors || config.caughtErrors; + + if (firstOption.varsIgnorePattern) { + config.varsIgnorePattern = new RegExp(firstOption.varsIgnorePattern); + } + + if (firstOption.argsIgnorePattern) { + config.argsIgnorePattern = new RegExp(firstOption.argsIgnorePattern); + } + + if (firstOption.caughtErrorsIgnorePattern) { + config.caughtErrorsIgnorePattern = new RegExp(firstOption.caughtErrorsIgnorePattern); + } } } @@ -31,7 +53,6 @@ module.exports = function(context) { // Helpers //-------------------------------------------------------------------------- - /** * Determines if a given variable is being exported from a module. * @param {Variable} variable - EScope variable object. @@ -45,9 +66,10 @@ module.exports = function(context) { if (definition) { var node = definition.node; + if (node.type === "VariableDeclarator") { node = node.parent; - } else if (definition.type === "Parameter" && node.type === "FunctionDeclaration") { + } else if (definition.type === "Parameter") { return false; } @@ -77,7 +99,7 @@ module.exports = function(context) { function isSelfReference(ref, nodes) { var scope = ref.from; - while (scope != null) { + while (scope) { if (nodes.indexOf(scope.block) >= 0) { return true; } @@ -94,56 +116,27 @@ module.exports = function(context) { * @param {Reference[]} references - The variable references to check. * @returns {boolean} True if the variable is used */ - function isUsedVariable(variable, references) { - var functionNodes = variable.defs.filter(function (def) { - return def.type === "FunctionName"; - }).map(function (def) { - return def.node; - }), + function isUsedVariable(variable) { + var functionNodes = variable.defs.filter(function(def) { + return def.type === "FunctionName"; + }).map(function(def) { + return def.node; + }), isFunctionDefinition = functionNodes.length > 0; - return references.some(function (ref) { + return variable.references.some(function(ref) { return isReadRef(ref) && !(isFunctionDefinition && isSelfReference(ref, functionNodes)); }); } - /** - * Gets unresolved references. - * They contains var's, function's, and explicit global variable's. - * If `config.vars` is not "all", returns empty map. - * @param {Scope} scope - the global scope. - * @returns {object} Unresolved references. Keys of the object is its variable name. Values of the object is an array of its references. - * @private - */ - function collectUnresolvedReferences(scope) { - var unresolvedRefs = Object.create(null); - - if (config.vars === "all") { - for (var i = 0, l = scope.through.length; i < l; ++i) { - var ref = scope.through[i]; - var name = ref.identifier.name; - - if (isReadRef(ref)) { - if (!unresolvedRefs[name]) { - unresolvedRefs[name] = []; - } - unresolvedRefs[name].push(ref); - } - } - } - - return unresolvedRefs; - } - /** * Gets an array of variables without read references. * @param {Scope} scope - an escope Scope object. - * @param {object} unresolvedRefs - a map of each variable name and its references. * @param {Variable[]} unusedVars - an array that saving result. * @returns {Variable[]} unused variables of the scope and descendant scopes. * @private */ - function collectUnusedVariables(scope, unresolvedRefs, unusedVars) { + function collectUnusedVariables(scope, unusedVars) { var variables = scope.variables; var childScopes = scope.childScopes; var i, l; @@ -156,10 +149,12 @@ module.exports = function(context) { if (scope.type === "class" && scope.block.id === variable.identifiers[0]) { continue; } - // skip function expression names + + // skip function expression names and variables marked with markVariableAsUsed() if (scope.functionExpressionScope || variable.eslintUsed) { continue; } + // skip implicit "arguments" variable if (scope.type === "function" && variable.name === "arguments" && variable.identifiers.length === 0) { continue; @@ -167,62 +162,135 @@ module.exports = function(context) { // explicit global variables don't have definitions. var def = variable.defs[0]; - if (def != null) { + + if (def) { var type = def.type; // skip catch variables if (type === "CatchClause") { - continue; - } - - // skip any setter argument - if (type === "Parameter" && def.node.parent.type === "Property" && def.node.parent.kind === "set") { - continue; + if (config.caughtErrors === "none") { + continue; + } + + // skip ignored parameters + if (config.caughtErrorsIgnorePattern && config.caughtErrorsIgnorePattern.test(def.name.name)) { + continue; + } } - // if "args" option is "none", skip any parameter - if (config.args === "none" && type === "Parameter") { - continue; - } - - // if "args" option is "after-used", skip all but the last parameter - if (config.args === "after-used" && type === "Parameter" && def.index < def.node.params.length - 1) { - continue; + if (type === "Parameter") { + + // skip any setter argument + if (def.node.parent.type === "Property" && def.node.parent.kind === "set") { + continue; + } + + // if "args" option is "none", skip any parameter + if (config.args === "none") { + continue; + } + + // skip ignored parameters + if (config.argsIgnorePattern && config.argsIgnorePattern.test(def.name.name)) { + continue; + } + + // if "args" option is "after-used", skip all but the last parameter + if (config.args === "after-used" && def.index < def.node.params.length - 1) { + continue; + } + } else { + + // skip ignored variables + if (config.varsIgnorePattern && config.varsIgnorePattern.test(def.name.name)) { + continue; + } } } - // On global, variables without let/const/class are unresolved. - var references = (scope.type === "global" ? unresolvedRefs[variable.name] : null) || variable.references; - if (!isUsedVariable(variable, references) && !isExported(variable)) { + if (!isUsedVariable(variable) && !isExported(variable)) { unusedVars.push(variable); } } } for (i = 0, l = childScopes.length; i < l; ++i) { - collectUnusedVariables(childScopes[i], unresolvedRefs, unusedVars); + collectUnusedVariables(childScopes[i], unusedVars); } return unusedVars; } + /** + * Gets the index of a given variable name in a given comment. + * @param {escope.Variable} variable - A variable to get. + * @param {ASTNode} comment - A comment node which includes the variable name. + * @returns {number} The index of the variable name's location. + */ + function getColumnInComment(variable, comment) { + var namePattern = new RegExp("[\\s,]" + lodash.escapeRegExp(variable.name) + "(?:$|[\\s,:])", "g"); + + // To ignore the first text "global". + namePattern.lastIndex = comment.value.indexOf("global") + 6; + + // Search a given variable name. + var match = namePattern.exec(comment.value); + + return match ? match.index + 1 : 0; + } + + /** + * Creates the correct location of a given variables. + * The location is at its name string in a `/*global` comment. + * + * @param {escope.Variable} variable - A variable to get its location. + * @returns {{line: number, column: number}} The location object for the variable. + */ + function getLocation(variable) { + var comment = variable.eslintExplicitGlobalComment; + var baseLoc = comment.loc.start; + var column = getColumnInComment(variable, comment); + var prefix = comment.value.slice(0, column); + var lineInComment = (prefix.match(/\n/g) || []).length; + + if (lineInComment > 0) { + column -= 1 + prefix.lastIndexOf("\n"); + } else { + + // 2 is for `/*` + column += baseLoc.column + 2; + } + + return { + line: baseLoc.line + lineInComment, + column: column + }; + } + //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- return { "Program:exit": function(programNode) { - var globalScope = context.getScope(); - var unresolvedRefs = collectUnresolvedReferences(globalScope); - var unusedVars = collectUnusedVariables(globalScope, unresolvedRefs, []); + var unusedVars = collectUnusedVariables(context.getScope(), []); for (var i = 0, l = unusedVars.length; i < l; ++i) { var unusedVar = unusedVars[i]; if (unusedVar.eslintExplicitGlobal) { - context.report(programNode, MESSAGE, unusedVar); + context.report({ + node: programNode, + loc: getLocation(unusedVar), + message: MESSAGE, + data: unusedVar + }); } else if (unusedVar.defs.length > 0) { - context.report(unusedVar.identifiers[0], MESSAGE, unusedVar); + context.report({ + node: unusedVar.identifiers[0], + message: MESSAGE, + data: unusedVar + }); } } } @@ -242,8 +310,20 @@ module.exports.schema = [ "vars": { "enum": ["all", "local"] }, + "varsIgnorePattern": { + "type": "string" + }, "args": { "enum": ["all", "after-used", "none"] + }, + "argsIgnorePattern": { + "type": "string" + }, + "caughtErrors": { + "enum": ["all", "none"] + }, + "caughtErrorsIgnorePattern": { + "type": "string" } } } diff --git a/tools/eslint/lib/rules/no-use-before-define.js b/tools/eslint/lib/rules/no-use-before-define.js index baf0780e711481..b8f67144c579f0 100644 --- a/tools/eslint/lib/rules/no-use-before-define.js +++ b/tools/eslint/lib/rules/no-use-before-define.js @@ -7,35 +7,137 @@ "use strict"; //------------------------------------------------------------------------------ -// Constants +// Helpers //------------------------------------------------------------------------------ -var NO_FUNC = "nofunc"; +var SENTINEL_TYPE = /^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/; + +/** + * Parses a given value as options. + * + * @param {any} options - A value to parse. + * @returns {object} The parsed options. + */ +function parseOptions(options) { + var functions = true; + var classes = true; + + if (typeof options === "string") { + functions = (options !== "nofunc"); + } else if (typeof options === "object" && options !== null) { + functions = options.functions !== false; + classes = options.classes !== false; + } + + return {functions: functions, classes: classes}; +} + +/** + * @returns {boolean} `false`. + */ +function alwaysFalse() { + return false; +} + +/** + * Checks whether or not a given variable is a function declaration. + * + * @param {escope.Variable} variable - A variable to check. + * @returns {boolean} `true` if the variable is a function declaration. + */ +function isFunction(variable) { + return variable.defs[0].type === "FunctionName"; +} + +/** + * Checks whether or not a given variable is a class declaration in an upper function scope. + * + * @param {escope.Variable} variable - A variable to check. + * @param {escope.Reference} reference - A reference to check. + * @returns {boolean} `true` if the variable is a class declaration. + */ +function isOuterClass(variable, reference) { + return ( + variable.defs[0].type === "ClassName" && + variable.scope.variableScope !== reference.from.variableScope + ); +} + +/** + * Checks whether or not a given variable is a function declaration or a class declaration in an upper function scope. + * + * @param {escope.Variable} variable - A variable to check. + * @param {escope.Reference} reference - A reference to check. + * @returns {boolean} `true` if the variable is a function declaration or a class declaration. + */ +function isFunctionOrOuterClass(variable, reference) { + return isFunction(variable, reference) || isOuterClass(variable, reference); +} + +/** + * Checks whether or not a given location is inside of the range of a given node. + * + * @param {ASTNode} node - An node to check. + * @param {number} location - A location to check. + * @returns {boolean} `true` if the location is inside of the range of the node. + */ +function isInRange(node, location) { + return node && node.range[0] <= location && location <= node.range[1]; +} + +/** + * Checks whether or not a given reference is inside of the initializers of a given variable. + * + * @param {Variable} variable - A variable to check. + * @param {Reference} reference - A reference to check. + * @returns {boolean} `true` if the reference is inside of the initializers. + */ +function isInInitializer(variable, reference) { + if (variable.scope !== reference.from) { + return false; + } + + var node = variable.identifiers[0].parent; + var location = reference.identifier.range[1]; + + while (node) { + if (node.type === "VariableDeclarator") { + if (isInRange(node.init, location)) { + return true; + } + break; + } else if (node.type === "AssignmentPattern") { + if (isInRange(node.right, location)) { + return true; + } + } else if (SENTINEL_TYPE.test(node.type)) { + break; + } + + node = node.parent; + } + + return false; +} //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = function(context) { + var options = parseOptions(context.options[0]); - /** - * Finds variable declarations in a given scope. - * @param {string} name The variable name to find. - * @param {Scope} scope The scope to search in. - * @returns {Object} The variable declaration object. - * @private - */ - function findDeclaration(name, scope) { - // try searching in the current scope first - for (var i = 0, l = scope.variables.length; i < l; i++) { - if (scope.variables[i].name === name) { - return scope.variables[i]; - } - } - // check if there's upper scope and call recursivly till we find the variable - if (scope.upper) { - return findDeclaration(name, scope.upper); - } + // Defines a function which checks whether or not a reference is allowed according to the option. + var isAllowed; + + if (options.functions && options.classes) { + isAllowed = alwaysFalse; + } else if (options.functions) { + isAllowed = isOuterClass; + } else if (options.classes) { + isAllowed = isFunction; + } else { + isAllowed = isFunctionOrOuterClass; } /** @@ -45,32 +147,33 @@ module.exports = function(context) { * @private */ function findVariablesInScope(scope) { - var typeOption = context.options[0]; + scope.references.forEach(function(reference) { + var variable = reference.resolved; - function checkLocationAndReport(reference, declaration) { - if (typeOption !== NO_FUNC || declaration.defs[0].type !== "FunctionName") { - if (declaration.identifiers[0].range[1] > reference.identifier.range[1]) { - context.report(reference.identifier, "{{a}} was used before it was defined", {a: reference.identifier.name}); - } + // Skips when the reference is: + // - initialization's. + // - referring to an undefined variable. + // - referring to a global environment variable (there're no identifiers). + // - located preceded by the variable (except in initializers). + // - allowed by options. + if (reference.init || + !variable || + variable.identifiers.length === 0 || + (variable.identifiers[0].range[1] < reference.identifier.range[1] && !isInInitializer(variable, reference)) || + isAllowed(variable, reference) + ) { + return; } - } - scope.references.forEach(function(reference) { - // if the reference is resolved check for declaration location - // if not, it could be function invocation, try to find manually - if (reference.resolved && reference.resolved.identifiers.length > 0) { - checkLocationAndReport(reference, reference.resolved); - } else { - var declaration = findDeclaration(reference.identifier.name, scope); - // if there're no identifiers, this is a global environment variable - if (declaration && declaration.identifiers.length !== 0) { - checkLocationAndReport(reference, declaration); - } - } + // Reports. + context.report({ + node: reference.identifier, + message: "'{{name}}' was used before it was defined", + data: reference.identifier + }); }); } - /** * Validates variables inside of a node's scope. * @param {ASTNode} node The node to check. @@ -79,27 +182,56 @@ module.exports = function(context) { */ function findVariables() { var scope = context.getScope(); + findVariablesInScope(scope); } - return { - "Program": function() { - var scope = context.getScope(); + var ruleDefinition = { + "Program:exit": function(node) { + var scope = context.getScope(), + ecmaFeatures = context.parserOptions.ecmaFeatures || {}; + findVariablesInScope(scope); // both Node.js and Modules have an extra scope - if (context.ecmaFeatures.globalReturn || context.ecmaFeatures.modules) { + if (ecmaFeatures.globalReturn || node.sourceType === "module") { findVariablesInScope(scope.childScopes[0]); } - }, - "FunctionExpression": findVariables, - "FunctionDeclaration": findVariables, - "ArrowFunctionExpression": findVariables + } }; + + if (context.parserOptions.ecmaVersion >= 6) { + ruleDefinition["BlockStatement:exit"] = + ruleDefinition["SwitchStatement:exit"] = findVariables; + + ruleDefinition["ArrowFunctionExpression:exit"] = function(node) { + if (node.body.type !== "BlockStatement") { + findVariables(node); + } + }; + } else { + ruleDefinition["FunctionExpression:exit"] = + ruleDefinition["FunctionDeclaration:exit"] = + ruleDefinition["ArrowFunctionExpression:exit"] = findVariables; + } + + return ruleDefinition; }; module.exports.schema = [ { - "enum": ["nofunc"] + "oneOf": [ + { + "enum": ["nofunc"] + }, + { + "type": "object", + "properties": { + "functions": {"type": "boolean"}, + "classes": {"type": "boolean"} + }, + "additionalProperties": false + } + ] } ]; diff --git a/tools/eslint/lib/rules/no-useless-call.js b/tools/eslint/lib/rules/no-useless-call.js new file mode 100644 index 00000000000000..fe6afd6d2487cc --- /dev/null +++ b/tools/eslint/lib/rules/no-useless-call.js @@ -0,0 +1,96 @@ +/** + * @fileoverview A rule to disallow unnecessary `.call()` and `.apply()`. + * @author Toru Nagashima + * @copyright 2015 Toru Nagashima. All rights reserved. + */ + +"use strict"; + +var astUtils = require("../ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a node is a `.call()`/`.apply()`. + * @param {ASTNode} node - A CallExpression node to check. + * @returns {boolean} Whether or not the node is a `.call()`/`.apply()`. + */ +function isCallOrNonVariadicApply(node) { + return ( + node.callee.type === "MemberExpression" && + node.callee.property.type === "Identifier" && + node.callee.computed === false && + ( + (node.callee.property.name === "call" && node.arguments.length >= 1) || + (node.callee.property.name === "apply" && node.arguments.length === 2 && node.arguments[1].type === "ArrayExpression") + ) + ); +} + +/** + * Checks whether or not the tokens of two given nodes are same. + * @param {ASTNode} left - A node 1 to compare. + * @param {ASTNode} right - A node 2 to compare. + * @param {RuleContext} context - The ESLint rule context object. + * @returns {boolean} the source code for the given node. + */ +function equalTokens(left, right, context) { + var tokensL = context.getTokens(left); + var tokensR = context.getTokens(right); + + if (tokensL.length !== tokensR.length) { + return false; + } + for (var i = 0; i < tokensL.length; ++i) { + if (tokensL[i].type !== tokensR[i].type || + tokensL[i].value !== tokensR[i].value + ) { + return false; + } + } + + return true; +} + +/** + * Checks whether or not `thisArg` is not changed by `.call()`/`.apply()`. + * @param {ASTNode|null} expectedThis - The node that is the owner of the applied function. + * @param {ASTNode} thisArg - The node that is given to the first argument of the `.call()`/`.apply()`. + * @param {RuleContext} context - The ESLint rule context object. + * @returns {boolean} Whether or not `thisArg` is not changed by `.call()`/`.apply()`. + */ +function isValidThisArg(expectedThis, thisArg, context) { + if (!expectedThis) { + return astUtils.isNullOrUndefined(thisArg); + } + return equalTokens(expectedThis, thisArg, context); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + return { + "CallExpression": function(node) { + if (!isCallOrNonVariadicApply(node)) { + return; + } + + var applied = node.callee.object; + var expectedThis = (applied.type === "MemberExpression") ? applied.object : null; + var thisArg = node.arguments[0]; + + if (isValidThisArg(expectedThis, thisArg, context)) { + context.report( + node, + "unnecessary '.{{name}}()'.", + {name: node.callee.property.name}); + } + } + }; +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-useless-concat.js b/tools/eslint/lib/rules/no-useless-concat.js new file mode 100644 index 00000000000000..96baf51a4e0ccf --- /dev/null +++ b/tools/eslint/lib/rules/no-useless-concat.js @@ -0,0 +1,94 @@ +/** + * @fileoverview disallow unncessary concatenation of template strings + * @author Henry Zhu + * @copyright 2015 Henry Zhu. All rights reserved. + * See LICENSE file in root directory for full license. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var astUtils = require("../ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given node is a concatenation. + * @param {ASTNode} node - A node to check. + * @returns {boolean} `true` if the node is a concatenation. + */ +function isConcatenation(node) { + return node.type === "BinaryExpression" && node.operator === "+"; +} + +/** + * Get's the right most node on the left side of a BinaryExpression with + operator. + * @param {ASTNode} node - A BinaryExpression node to check. + * @returns {ASTNode} node + */ +function getLeft(node) { + var left = node.left; + + while (isConcatenation(left)) { + left = left.right; + } + return left; +} + +/** + * Get's the left most node on the right side of a BinaryExpression with + operator. + * @param {ASTNode} node - A BinaryExpression node to check. + * @returns {ASTNode} node + */ +function getRight(node) { + var right = node.right; + + while (isConcatenation(right)) { + right = right.left; + } + return right; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + return { + BinaryExpression: function(node) { + + // check if not concatenation + if (node.operator !== "+") { + return; + } + + // account for the `foo + "a" + "b"` case + var left = getLeft(node); + var right = getRight(node); + + if (astUtils.isStringLiteral(left) && + astUtils.isStringLiteral(right) && + astUtils.isTokenOnSameLine(left, right) + ) { + + // move warning location to operator + var operatorToken = context.getTokenAfter(left); + + while (operatorToken.value !== "+") { + operatorToken = context.getTokenAfter(operatorToken); + } + + context.report( + node, + operatorToken.loc.start, + "Unexpected string concatenation of literals."); + } + } + }; +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-useless-constructor.js b/tools/eslint/lib/rules/no-useless-constructor.js new file mode 100644 index 00000000000000..244f2b458f646e --- /dev/null +++ b/tools/eslint/lib/rules/no-useless-constructor.js @@ -0,0 +1,174 @@ +/** + * @fileoverview Rule to flag the use of redundant constructors in classes. + * @author Alberto Rodríguez + * @copyright 2015 Alberto Rodríguez. All rights reserved. + * See LICENSE file in root directory for full license. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether a given array of statements is a single call of `super`. + * + * @param {ASTNode[]} body - An array of statements to check. + * @returns {boolean} `true` if the body is a single call of `super`. + */ +function isSingleSuperCall(body) { + return ( + body.length === 1 && + body[0].type === "ExpressionStatement" && + body[0].expression.type === "CallExpression" && + body[0].expression.callee.type === "Super" + ); +} + +/** + * Checks whether a given node is a pattern which doesn't have any side effects. + * Default parameters and Destructuring parameters can have side effects. + * + * @param {ASTNode} node - A pattern node. + * @returns {boolean} `true` if the node doesn't have any side effects. + */ +function isSimple(node) { + return node.type === "Identifier" || node.type === "RestElement"; +} + +/** + * Checks whether a given array of expressions is `...arguments` or not. + * `super(...arguments)` passes all arguments through. + * + * @param {ASTNode[]} superArgs - An array of expressions to check. + * @returns {boolean} `true` if the superArgs is `...arguments`. + */ +function isSpreadArguments(superArgs) { + return ( + superArgs.length === 1 && + superArgs[0].type === "SpreadElement" && + superArgs[0].argument.type === "Identifier" && + superArgs[0].argument.name === "arguments" + ); +} + +/** + * Checks whether given 2 nodes are identifiers which have the same name or not. + * + * @param {ASTNode} ctorParam - A node to check. + * @param {ASTNode} superArg - A node to check. + * @returns {boolean} `true` if the nodes are identifiers which have the same + * name. + */ +function isValidIdentifierPair(ctorParam, superArg) { + return ( + ctorParam.type === "Identifier" && + superArg.type === "Identifier" && + ctorParam.name === superArg.name + ); +} + +/** + * Checks whether given 2 nodes are a rest/spread pair which has the same values. + * + * @param {ASTNode} ctorParam - A node to check. + * @param {ASTNode} superArg - A node to check. + * @returns {boolean} `true` if the nodes are a rest/spread pair which has the + * same values. + */ +function isValidRestSpreadPair(ctorParam, superArg) { + return ( + ctorParam.type === "RestElement" && + superArg.type === "SpreadElement" && + isValidIdentifierPair(ctorParam.argument, superArg.argument) + ); +} + +/** + * Checks whether given 2 nodes have the same value or not. + * + * @param {ASTNode} ctorParam - A node to check. + * @param {ASTNode} superArg - A node to check. + * @returns {boolean} `true` if the nodes have the same value or not. + */ +function isValidPair(ctorParam, superArg) { + return ( + isValidIdentifierPair(ctorParam, superArg) || + isValidRestSpreadPair(ctorParam, superArg) + ); +} + +/** + * Checks whether the parameters of a constructor and the arguments of `super()` + * have the same values or not. + * + * @param {ASTNode} ctorParams - The parameters of a constructor to check. + * @param {ASTNode} superArgs - The arguments of `super()` to check. + * @returns {boolean} `true` if those have the same values. + */ +function isPassingThrough(ctorParams, superArgs) { + if (ctorParams.length !== superArgs.length) { + return false; + } + + for (var i = 0; i < ctorParams.length; ++i) { + if (!isValidPair(ctorParams[i], superArgs[i])) { + return false; + } + } + + return true; +} + +/** + * Checks whether the constructor body is a redundant super call. + * + * @param {Array} body - constructor body content. + * @param {Array} ctorParams - The params to check against super call. + * @returns {boolean} true if the construtor body is redundant + */ +function isRedundantSuperCall(body, ctorParams) { + return ( + isSingleSuperCall(body) && + ctorParams.every(isSimple) && + ( + isSpreadArguments(body[0].expression.arguments) || + isPassingThrough(ctorParams, body[0].expression.arguments) + ) + ); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + + /** + * Checks whether a node is a redundant constructor + * @param {ASTNode} node - node to check + * @returns {void} + */ + function checkForConstructor(node) { + if (node.kind !== "constructor") { + return; + } + + var body = node.value.body.body; + var ctorParams = node.value.params; + var superClass = node.parent.parent.superClass; + + if (superClass ? isRedundantSuperCall(body, ctorParams) : (body.length === 0)) { + context.report({ + node: node, + message: "Useless constructor." + }); + } + } + + return { + "MethodDefinition": checkForConstructor + }; +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-useless-escape.js b/tools/eslint/lib/rules/no-useless-escape.js new file mode 100644 index 00000000000000..a6f5daa71c444d --- /dev/null +++ b/tools/eslint/lib/rules/no-useless-escape.js @@ -0,0 +1,108 @@ +/** + * @fileoverview Look for useless escapes in strings and regexes + * @author Onur Temizkan + * @copyright 2016 Onur Temizkan. All rights reserved. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +var VALID_STRING_ESCAPES = [ + "\\", + "n", + "r", + "v", + "t", + "b", + "f", + "u", + "x", + "\n", + "\r" +]; + +var VALID_REGEX_ESCAPES = [ + "\\", + ".", + "-", + "^", + "$", + "*", + "+", + "?", + "{", + "}", + "[", + "]", + "|", + "(", + ")", + "b", + "B", + "c", + "d", + "D", + "f", + "n", + "r", + "s", + "S", + "t", + "v", + "w", + "W", + "x", + "u" +]; + +module.exports = function(context) { + + /** + * Checks if the escape character in given slice is unnecessary. + * + * @private + * @param {string} elm - string slice to validate. + * @param {ASTNode} node - node to validate. + * @returns {void} + * @this escapes_quote_node + */ + function validate(elm) { + var escapeNotFound = this.escapes.indexOf(elm[1]) === -1; + var isQuoteEscape = elm[1] === this.node.raw[0]; + + if (escapeNotFound && !isQuoteEscape) { + context.report(this.node, "Unnecessary escape character: " + elm); + } + } + + /** + * Checks if a node has an escape. + * + * @param {ASTNode} node - node to check. + * @returns {void} + */ + function check(node) { + var nodeEscapes; + + if (typeof node.value === "string") { + nodeEscapes = VALID_STRING_ESCAPES; + } else if (node.regex) { + nodeEscapes = VALID_REGEX_ESCAPES; + } else { + return; + } + + (node.raw.match(/\\[^\d]/g) || []).forEach(validate, { + "escapes": nodeEscapes, + "node": node + }); + } + return { + "Literal": check + }; +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-var.js b/tools/eslint/lib/rules/no-var.js index 53d9cc27ae122b..05cb6e99eca58e 100644 --- a/tools/eslint/lib/rules/no-var.js +++ b/tools/eslint/lib/rules/no-var.js @@ -13,7 +13,7 @@ module.exports = function(context) { return { - "VariableDeclaration": function (node) { + "VariableDeclaration": function(node) { if (node.kind === "var") { context.report(node, "Unexpected var, use let or const instead."); } diff --git a/tools/eslint/lib/rules/no-warning-comments.js b/tools/eslint/lib/rules/no-warning-comments.js index 5e842bc754f927..02450229d9f59c 100644 --- a/tools/eslint/lib/rules/no-warning-comments.js +++ b/tools/eslint/lib/rules/no-warning-comments.js @@ -5,15 +5,18 @@ "use strict"; +var astUtils = require("../ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ -module.exports = function (context) { +module.exports = function(context) { var configuration = context.options[0] || {}, warningTerms = configuration.terms || ["todo", "fixme", "xxx"], location = configuration.location || "start", + selfConfigRegEx = /\bno-warning-comments\b/, warningRegExps; /** @@ -26,16 +29,27 @@ module.exports = function (context) { */ function convertToRegExp(term) { var escaped = term.replace(/[-\/\\$\^*+?.()|\[\]{}]/g, "\\$&"), - // If the term ends in a word character (a-z0-9_), ensure a word boundary at the end, so that substrings do - // not get falsely matched. eg "todo" in a string such as "mastodon". - // If the term ends in a non-word character, then \b won't match on the boundary to the next non-word - // character, which would likely be a space. For example `/\bFIX!\b/.test('FIX! blah') === false`. - // In these cases, use no bounding match. Same applies for the prefix, handled below. - suffix = /\w$/.test(term) ? "\\b" : "", + suffix, prefix; + /* + * If the term ends in a word character (a-z0-9_), ensure a word + * boundary at the end, so that substrings do not get falsely + * matched. eg "todo" in a string such as "mastodon". + * If the term ends in a non-word character, then \b won't match on + * the boundary to the next non-word character, which would likely + * be a space. For example `/\bFIX!\b/.test('FIX! blah') === false`. + * In these cases, use no bounding match. Same applies for the + * prefix, handled below. + */ + suffix = /\w$/.test(term) ? "\\b" : ""; + if (location === "start") { - // When matching at the start, ignore leading whitespace, and there's no need to worry about word boundaries + + /* + * When matching at the start, ignore leading whitespace, and + * there's no need to worry about word boundaries. + */ prefix = "^\\s*"; } else if (/^\w/.test(term)) { prefix = "\\b"; @@ -54,7 +68,7 @@ module.exports = function (context) { function commentContainsWarningTerm(comment) { var matches = []; - warningRegExps.forEach(function (regex, index) { + warningRegExps.forEach(function(regex, index) { if (regex.test(comment)) { matches.push(warningTerms[index]); } @@ -69,10 +83,14 @@ module.exports = function (context) { * @returns {void} undefined. */ function checkComment(node) { + if (astUtils.isDirectiveComment(node) && selfConfigRegEx.test(node.value)) { + return; + } + var matches = commentContainsWarningTerm(node.value); - matches.forEach(function (matchedTerm) { - context.report(node, "Unexpected " + matchedTerm + " comment."); + matches.forEach(function(matchedTerm) { + context.report(node, "Unexpected '" + matchedTerm + "' comment."); }); } diff --git a/tools/eslint/lib/rules/no-whitespace-before-property.js b/tools/eslint/lib/rules/no-whitespace-before-property.js new file mode 100644 index 00000000000000..0910f2fce42212 --- /dev/null +++ b/tools/eslint/lib/rules/no-whitespace-before-property.js @@ -0,0 +1,81 @@ +/** + * @fileoverview Rule to disallow whitespace before properties + * @author Kai Cataldo + * @copyright 2015 Kai Cataldo. All rights reserved. + * See LICENSE file in root directory for full license. + */ +"use strict"; + +var astUtils = require("../ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Finds opening bracket token of node's computed property + * @param {ASTNode} node - the node to check + * @returns {Token} opening bracket token of node's computed property + * @private + */ + function findOpeningBracket(node) { + var token = sourceCode.getTokenBefore(node.property); + + while (token.value !== "[") { + token = sourceCode.getTokenBefore(token); + } + return token; + } + + /** + * Reports whitespace before property token + * @param {ASTNode} node - the node to report in the event of an error + * @returns {void} + * @private + */ + function reportError(node) { + context.report({ + node: node, + message: "Unexpected whitespace before property {{propName}}.", + data: { + propName: sourceCode.getText(node.property) + } + }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + MemberExpression: function(node) { + var rightToken; + var leftToken; + + if (!astUtils.isTokenOnSameLine(node.object, node.property)) { + return; + } + + if (node.computed) { + rightToken = findOpeningBracket(node); + leftToken = sourceCode.getTokenBefore(rightToken); + } else { + rightToken = sourceCode.getFirstToken(node.property); + leftToken = sourceCode.getTokenBefore(rightToken, 1); + } + + if (sourceCode.isSpaceBetweenTokens(leftToken, rightToken)) { + reportError(node); + } + } + }; +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-wrap-func.js b/tools/eslint/lib/rules/no-wrap-func.js deleted file mode 100644 index d69a743c98e565..00000000000000 --- a/tools/eslint/lib/rules/no-wrap-func.js +++ /dev/null @@ -1,65 +0,0 @@ -/** - * @fileoverview Rule to flag wrapping non-iife in parens - * @author Ilya Volodin - * @copyright 2013 Ilya Volodin. All rights reserved. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - /** - * Checks a function expression to see if its surrounded by parens. - * @param {ASTNode} node The node to check. - * @returns {void} - * @private - */ - function checkFunction(node) { - var previousToken, nextToken, isCall; - - if (node.type === "ArrowFunctionExpression" && - /(?:Call|New|Logical|Binary|Conditional|Update)Expression/.test(node.parent.type) - ) { - return; - } - - // (function() {}).foo - if (node.parent.type === "MemberExpression" && node.parent.object === node) { - return; - } - - // (function(){})() - isCall = /CallExpression|NewExpression/.test(node.parent.type); - if (isCall && node.parent.callee === node) { - return; - } - - previousToken = context.getTokenBefore(node); - nextToken = context.getTokenAfter(node); - - // f(function(){}) and new f(function(){}) - if (isCall) { - - // if the previousToken is right after the callee - if (node.parent.callee.range[1] === previousToken.range[0]) { - return; - } - } - - if (previousToken.value === "(" && nextToken.value === ")") { - context.report(node, "Wrapping non-IIFE function literals in parens is unnecessary."); - } - } - - return { - "ArrowFunctionExpression": checkFunction, - "FunctionExpression": checkFunction - }; - -}; - -module.exports.schema = []; diff --git a/tools/eslint/lib/rules/object-curly-spacing.js b/tools/eslint/lib/rules/object-curly-spacing.js index d4d200d36ee619..8a7b9aefeeb3aa 100644 --- a/tools/eslint/lib/rules/object-curly-spacing.js +++ b/tools/eslint/lib/rules/object-curly-spacing.js @@ -5,15 +5,20 @@ * @copyright 2014 Michael Ficarra. No rights reserved. * @copyright 2014 Vignesh Anand. All rights reserved. * @copyright 2015 Jamund Ferguson. All rights reserved. + * @copyright 2015 Toru Nagashima. All rights reserved. + * See LICENSE file in root directory for full license. */ "use strict"; +var astUtils = require("../ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = function(context) { - var spaced = context.options[0] === "always"; + var spaced = context.options[0] === "always", + sourceCode = context.getSourceCode(); /** * Determines whether an option is set, relative to the spacing option. @@ -23,7 +28,7 @@ module.exports = function(context) { * @returns {boolean} Whether or not the property is excluded. */ function isOptionSet(option) { - return context.options[1] != null ? context.options[1][option] === !spaced : false; + return context.options[1] ? context.options[1][option] === !spaced : false; } var options = { @@ -36,26 +41,6 @@ module.exports = function(context) { // Helpers //-------------------------------------------------------------------------- - /** - * Determines whether two adjacent tokens are have whitespace between them. - * @param {Object} left - The left token object. - * @param {Object} right - The right token object. - * @returns {boolean} Whether or not there is space between the tokens. - */ - function isSpaced(left, right) { - return left.range[1] < right.range[0]; - } - - /** - * Determines whether two adjacent tokens are on the same line. - * @param {Object} left - The left token object. - * @param {Object} right - The right token object. - * @returns {boolean} Whether or not the tokens are on the same line. - */ - function isSameLine(left, right) { - return left.loc.start.line === right.loc.start.line; - } - /** * Reports that there shouldn't be a space after the first token * @param {ASTNode} node - The node to report in the event of an error. @@ -63,8 +48,16 @@ module.exports = function(context) { * @returns {void} */ function reportNoBeginningSpace(node, token) { - context.report(node, token.loc.start, - "There should be no space after '" + token.value + "'"); + context.report({ + node: node, + loc: token.loc.start, + message: "There should be no space after '" + token.value + "'", + fix: function(fixer) { + var nextToken = context.getSourceCode().getTokenAfter(token); + + return fixer.removeRange([token.range[1], nextToken.range[0]]); + } + }); } /** @@ -74,8 +67,16 @@ module.exports = function(context) { * @returns {void} */ function reportNoEndingSpace(node, token) { - context.report(node, token.loc.start, - "There should be no space before '" + token.value + "'"); + context.report({ + node: node, + loc: token.loc.start, + message: "There should be no space before '" + token.value + "'", + fix: function(fixer) { + var previousToken = context.getSourceCode().getTokenBefore(token); + + return fixer.removeRange([previousToken.range[1], token.range[0]]); + } + }); } /** @@ -85,8 +86,14 @@ module.exports = function(context) { * @returns {void} */ function reportRequiredBeginningSpace(node, token) { - context.report(node, token.loc.start, - "A space is required after '" + token.value + "'"); + context.report({ + node: node, + loc: token.loc.start, + message: "A space is required after '" + token.value + "'", + fix: function(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); } /** @@ -96,8 +103,14 @@ module.exports = function(context) { * @returns {void} */ function reportRequiredEndingSpace(node, token) { - context.report(node, token.loc.start, - "A space is required before '" + token.value + "'"); + context.report({ + node: node, + loc: token.loc.start, + message: "A space is required before '" + token.value + "'", + fix: function(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); } /** @@ -110,104 +123,140 @@ module.exports = function(context) { * @returns {void} */ function validateBraceSpacing(node, first, second, penultimate, last) { - var closingCurlyBraceMustBeSpaced = - options.arraysInObjectsException && penultimate.value === "]" || - options.objectsInObjectsException && penultimate.value === "}" - ? !options.spaced : options.spaced; - - if (isSameLine(first, second)) { - if (options.spaced && !isSpaced(first, second)) { + var shouldCheckPenultimate, + penultimateType, + closingCurlyBraceMustBeSpaced, + firstSpaced, + lastSpaced; + + if (astUtils.isTokenOnSameLine(first, second)) { + firstSpaced = sourceCode.isSpaceBetweenTokens(first, second); + if (options.spaced && !firstSpaced) { reportRequiredBeginningSpace(node, first); } - if (!options.spaced && isSpaced(first, second)) { + if (!options.spaced && firstSpaced) { reportNoBeginningSpace(node, first); } } - if (isSameLine(penultimate, last)) { - if (closingCurlyBraceMustBeSpaced && !isSpaced(penultimate, last)) { + if (astUtils.isTokenOnSameLine(penultimate, last)) { + shouldCheckPenultimate = ( + options.arraysInObjectsException && penultimate.value === "]" || + options.objectsInObjectsException && penultimate.value === "}" + ); + penultimateType = shouldCheckPenultimate && sourceCode.getNodeByRangeIndex(penultimate.start).type; + + closingCurlyBraceMustBeSpaced = ( + options.arraysInObjectsException && penultimateType === "ArrayExpression" || + options.objectsInObjectsException && penultimateType === "ObjectExpression" + ) ? !options.spaced : options.spaced; + + lastSpaced = sourceCode.isSpaceBetweenTokens(penultimate, last); + + if (closingCurlyBraceMustBeSpaced && !lastSpaced) { reportRequiredEndingSpace(node, last); } - if (!closingCurlyBraceMustBeSpaced && isSpaced(penultimate, last)) { + if (!closingCurlyBraceMustBeSpaced && lastSpaced) { reportNoEndingSpace(node, last); } } } - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- + /** + * Reports a given object node if spacing in curly braces is invalid. + * @param {ASTNode} node - An ObjectExpression or ObjectPattern node to check. + * @returns {void} + */ + function checkForObject(node) { + if (node.properties.length === 0) { + return; + } - return { + var first = sourceCode.getFirstToken(node), + last = sourceCode.getLastToken(node), + second = sourceCode.getTokenAfter(first), + penultimate = sourceCode.getTokenBefore(last); - // var {x} = y; - ObjectPattern: function(node) { - var firstSpecifier = node.properties[0], - lastSpecifier = node.properties[node.properties.length - 1]; - - var first = context.getTokenBefore(firstSpecifier), - second = context.getFirstToken(firstSpecifier), - penultimate = context.getLastToken(lastSpecifier), - last = context.getTokenAfter(lastSpecifier); - - // support trailing commas - if (last.value === ",") { - penultimate = last; - last = context.getTokenAfter(last); - } + validateBraceSpacing(node, first, second, penultimate, last); + } - validateBraceSpacing(node, first, second, penultimate, last); - }, + /** + * Reports a given import node if spacing in curly braces is invalid. + * @param {ASTNode} node - An ImportDeclaration node to check. + * @returns {void} + */ + function checkForImport(node) { + if (node.specifiers.length === 0) { + return; + } - // import {y} from 'x'; - ImportDeclaration: function(node) { + var firstSpecifier = node.specifiers[0], + lastSpecifier = node.specifiers[node.specifiers.length - 1]; - var firstSpecifier = node.specifiers[0], - lastSpecifier = node.specifiers[node.specifiers.length - 1]; + if (lastSpecifier.type !== "ImportSpecifier") { + return; + } + if (firstSpecifier.type !== "ImportSpecifier") { + firstSpecifier = node.specifiers[1]; + } - // don't do anything for namespace or default imports - if (firstSpecifier && lastSpecifier && firstSpecifier.type === "ImportSpecifier" && lastSpecifier.type === "ImportSpecifier") { - var first = context.getTokenBefore(firstSpecifier), - second = context.getFirstToken(firstSpecifier), - penultimate = context.getLastToken(lastSpecifier), - last = context.getTokenAfter(lastSpecifier); + var first = sourceCode.getTokenBefore(firstSpecifier), + last = sourceCode.getTokenAfter(lastSpecifier); - validateBraceSpacing(node, first, second, penultimate, last); - } + // to support a trailing comma. + if (last.value === ",") { + last = sourceCode.getTokenAfter(last); + } - }, + var second = sourceCode.getTokenAfter(first), + penultimate = sourceCode.getTokenBefore(last); - // export {name} from 'yo'; - ExportNamedDeclaration: function(node) { - if (!node.specifiers.length) { - return; - } + validateBraceSpacing(node, first, second, penultimate, last); + } - var firstSpecifier = node.specifiers[0], - lastSpecifier = node.specifiers[node.specifiers.length - 1], - first = context.getTokenBefore(firstSpecifier), - second = context.getFirstToken(firstSpecifier), - penultimate = context.getLastToken(lastSpecifier), - last = context.getTokenAfter(lastSpecifier); + /** + * Reports a given export node if spacing in curly braces is invalid. + * @param {ASTNode} node - An ExportNamedDeclaration node to check. + * @returns {void} + */ + function checkForExport(node) { + if (node.specifiers.length === 0) { + return; + } - validateBraceSpacing(node, first, second, penultimate, last); + var firstSpecifier = node.specifiers[0], + lastSpecifier = node.specifiers[node.specifiers.length - 1], + first = sourceCode.getTokenBefore(firstSpecifier), + last = sourceCode.getTokenAfter(lastSpecifier); - }, + // to support a trailing comma. + if (last.value === ",") { + last = sourceCode.getTokenAfter(last); + } - // var y = {x: 'y'} - ObjectExpression: function(node) { - if (node.properties.length === 0) { - return; - } + var second = sourceCode.getTokenAfter(first), + penultimate = sourceCode.getTokenBefore(last); - var first = context.getFirstToken(node), - second = context.getFirstToken(node, 1), - penultimate = context.getLastToken(node, 1), - last = context.getLastToken(node); + validateBraceSpacing(node, first, second, penultimate, last); + } - validateBraceSpacing(node, first, second, penultimate, last); - } + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + // var {x} = y; + ObjectPattern: checkForObject, + + // var y = {x: 'y'} + ObjectExpression: checkForObject, + + // import {y} from 'x'; + ImportDeclaration: checkForImport, + // export {name} from 'yo'; + ExportNamedDeclaration: checkForExport }; }; diff --git a/tools/eslint/lib/rules/object-shorthand.js b/tools/eslint/lib/rules/object-shorthand.js index 6244332e4f73cd..c6ffa0f8f34a72 100644 --- a/tools/eslint/lib/rules/object-shorthand.js +++ b/tools/eslint/lib/rules/object-shorthand.js @@ -16,14 +16,31 @@ var OPTIONS = { //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ - module.exports = function(context) { - var APPLY = context.options[0] || OPTIONS.always; var APPLY_TO_METHODS = APPLY === OPTIONS.methods || APPLY === OPTIONS.always; var APPLY_TO_PROPS = APPLY === OPTIONS.properties || APPLY === OPTIONS.always; var APPLY_NEVER = APPLY === OPTIONS.never; + var PARAMS = context.options[1] || {}; + var IGNORE_CONSTRUCTORS = PARAMS.ignoreConstructors; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Determines if the first character of the name is a capital letter. + * @param {string} name The name of the node to evaluate. + * @returns {boolean} True if the first character of the property name is a capital letter, false if not. + * @private + */ + function isConstructor(name) { + var firstChar = name.charAt(0); + + return firstChar === firstChar.toUpperCase(); + } + //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- @@ -33,6 +50,11 @@ module.exports = function(context) { var isConciseProperty = node.method || node.shorthand, type; + // Ignore destructuring assignment + if (node.parent.type === "ObjectPattern") { + return; + } + // if we're "never" and concise we should warn now if (APPLY_NEVER && isConciseProperty) { type = node.method ? "method" : "property"; @@ -44,11 +66,15 @@ module.exports = function(context) { return; } - if (node.kind === "get" || node.kind === "set") { + // getters, setters and computed properties are ignored + if (node.kind === "get" || node.kind === "set" || node.computed) { return; } - if (node.value.type === "FunctionExpression" && node.value.id == null && APPLY_TO_METHODS) { + if (node.value.type === "FunctionExpression" && !node.value.id && APPLY_TO_METHODS) { + if (IGNORE_CONSTRUCTORS && isConstructor(node.key.name)) { + return; + } // {x: function(){}} should be written as {x() {}} context.report(node, "Expected method shorthand."); @@ -66,8 +92,36 @@ module.exports = function(context) { }; -module.exports.schema = [ - { - "enum": ["always", "methods", "properties", "never"] - } -]; +module.exports.schema = { + "anyOf": [ + { + "type": "array", + "items": [ + { + "enum": ["always", "methods", "properties", "never"] + } + ], + "minItems": 0, + "maxItems": 1 + }, + { + "type": "array", + "items": [ + { + "enum": ["always", "methods"] + }, + { + "type": "object", + "properties": { + "ignoreConstructors": { + "type": "boolean" + } + }, + "additionalProperties": false + } + ], + "minItems": 0, + "maxItems": 2 + } + ] +}; diff --git a/tools/eslint/lib/rules/one-var-declaration-per-line.js b/tools/eslint/lib/rules/one-var-declaration-per-line.js new file mode 100644 index 00000000000000..2f763485d7e3f9 --- /dev/null +++ b/tools/eslint/lib/rules/one-var-declaration-per-line.js @@ -0,0 +1,75 @@ +/** + * @fileoverview Rule to check multiple var declarations per line + * @author Alberto Rodríguez + * @copyright 2016 Alberto Rodríguez. All rights reserved. + * See LICENSE file in root directory for full license. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + + var ERROR_MESSAGE = "Expected variable declaration to be on a new line."; + var always = context.options[0] === "always"; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + + /** + * Determine if provided keyword is a variant of for specifiers + * @private + * @param {string} keyword - keyword to test + * @returns {boolean} True if `keyword` is a variant of for specifier + */ + function isForTypeSpecifier(keyword) { + return keyword === "ForStatement" || keyword === "ForInStatement" || keyword === "ForOfStatement"; + } + + /** + * Checks newlines around variable declarations. + * @private + * @param {ASTNode} node - `VariableDeclaration` node to test + * @returns {void} + */ + function checkForNewLine(node) { + if (isForTypeSpecifier(node.parent.type)) { + return; + } + + var declarations = node.declarations; + var prev; + + declarations.forEach(function(current) { + if (prev && prev.loc.end.line === current.loc.start.line) { + if (always || prev.init || current.init) { + context.report({ + node: node, + message: ERROR_MESSAGE, + loc: current.loc.start + }); + } + } + prev = current; + }); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + "VariableDeclaration": checkForNewLine + }; + +}; + +module.exports.schema = [ + { + "enum": ["always", "initializations"] + } +]; diff --git a/tools/eslint/lib/rules/one-var.js b/tools/eslint/lib/rules/one-var.js index 1457e826cccd33..d7cccbfe9da09f 100644 --- a/tools/eslint/lib/rules/one-var.js +++ b/tools/eslint/lib/rules/one-var.js @@ -18,7 +18,7 @@ module.exports = function(context) { var MODE_ALWAYS = "always", MODE_NEVER = "never"; - var mode = context.options[0]; + var mode = context.options[0] || MODE_ALWAYS; var options = { }; @@ -144,6 +144,7 @@ module.exports = function(context) { */ function getCurrentScope(statementType) { var currentScope; + if (statementType === "var") { currentScope = functionStack[functionStack.length - 1]; } else if (statementType === "let") { @@ -162,6 +163,7 @@ module.exports = function(context) { */ function countDeclarations(declarations) { var counts = { uninitialized: 0, initialized: 0 }; + for (var i = 0; i < declarations.length; i++) { if (declarations[i].init === null) { counts.uninitialized++; @@ -217,6 +219,8 @@ module.exports = function(context) { "ArrowFunctionExpression": startFunction, "BlockStatement": startBlock, "ForStatement": startBlock, + "ForInStatement": startBlock, + "ForOfStatement": startBlock, "SwitchStatement": startBlock, "VariableDeclaration": function(node) { @@ -244,18 +248,24 @@ module.exports = function(context) { } } } + // never if (parent.type !== "ForStatement" || parent.init !== node) { var totalDeclarations = declarationCounts.uninitialized + declarationCounts.initialized; + if (totalDeclarations > 1) { - // both initialized and uninitialized + if (options[type].initialized === MODE_NEVER && options[type].uninitialized === MODE_NEVER) { + + // both initialized and uninitialized context.report(node, "Split '" + type + "' declarations into multiple statements."); - // initialized } else if (options[type].initialized === MODE_NEVER && declarationCounts.initialized > 0) { + + // initialized context.report(node, "Split initialized '" + type + "' declarations into multiple statements."); - // uninitialized } else if (options[type].uninitialized === MODE_NEVER && declarationCounts.uninitialized > 0) { + + // uninitialized context.report(node, "Split uninitialized '" + type + "' declarations into multiple statements."); } } @@ -263,6 +273,8 @@ module.exports = function(context) { }, "ForStatement:exit": endBlock, + "ForOfStatement:exit": endBlock, + "ForInStatement:exit": endBlock, "SwitchStatement:exit": endBlock, "BlockStatement:exit": endBlock, "Program:exit": endFunction, diff --git a/tools/eslint/lib/rules/operator-assignment.js b/tools/eslint/lib/rules/operator-assignment.js index aa9e032ae2b2e5..9656846019d3a0 100644 --- a/tools/eslint/lib/rules/operator-assignment.js +++ b/tools/eslint/lib/rules/operator-assignment.js @@ -53,13 +53,19 @@ function same(a, b) { switch (a.type) { case "Identifier": return a.name === b.name; + case "Literal": return a.value === b.value; + case "MemberExpression": - // x[0] = x[0] - // x[y] = x[y] - // x.y = x.y + + /* + * x[0] = x[0] + * x[y] = x[y] + * x.y = x.y + */ return same(a.object, b.object) && same(a.property, b.property); + default: return false; } diff --git a/tools/eslint/lib/rules/operator-linebreak.js b/tools/eslint/lib/rules/operator-linebreak.js index c70b09ad5c922a..aa3c03692839ba 100644 --- a/tools/eslint/lib/rules/operator-linebreak.js +++ b/tools/eslint/lib/rules/operator-linebreak.js @@ -6,37 +6,41 @@ "use strict"; +var lodash = require("lodash"), + astUtils = require("../ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = function(context) { - var style = context.options[0] || "after"; + var usedDefaultGlobal = !context.options[0]; + var globalStyle = context.options[0] || "after"; + var options = context.options[1] || {}; + var styleOverrides = options.overrides ? lodash.assign({}, options.overrides) : {}; + + if (usedDefaultGlobal && !styleOverrides["?"]) { + styleOverrides["?"] = "before"; + } + + if (usedDefaultGlobal && !styleOverrides[":"]) { + styleOverrides[":"] = "before"; + } //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- - /** - * Checks whether two tokens are on the same line. - * @param {ASTNode} left The leftmost token. - * @param {ASTNode} right The rightmost token. - * @returns {boolean} True if the tokens are on the same line, false if not. - * @private - */ - function isSameLine(left, right) { - return left.loc.end.line === right.loc.start.line; - } - /** * Checks the operator placement - * @param {ASTNode} node The binary operator node to check + * @param {ASTNode} node The node to check + * @param {ASTNode} leftSide The node that comes before the operator in `node` * @private * @returns {void} */ - function validateBinaryExpression(node) { - var leftToken = context.getLastToken(node.left || node.id); + function validateNode(node, leftSide) { + var leftToken = context.getLastToken(leftSide); var operatorToken = context.getTokenAfter(leftToken); // When the left part of a binary expression is a single expression wrapped in @@ -51,15 +55,17 @@ module.exports = function(context) { var rightToken = context.getTokenAfter(operatorToken); var operator = operatorToken.value; + var operatorStyleOverride = styleOverrides[operator]; + var style = operatorStyleOverride || globalStyle; // if single line - if (isSameLine(leftToken, operatorToken) && - isSameLine(operatorToken, rightToken)) { + if (astUtils.isTokenOnSameLine(leftToken, operatorToken) && + astUtils.isTokenOnSameLine(operatorToken, rightToken)) { return; - } else if (!isSameLine(leftToken, operatorToken) && - !isSameLine(operatorToken, rightToken)) { + } else if (operatorStyleOverride !== "ignore" && !astUtils.isTokenOnSameLine(leftToken, operatorToken) && + !astUtils.isTokenOnSameLine(operatorToken, rightToken)) { // lone operator context.report(node, { @@ -67,14 +73,14 @@ module.exports = function(context) { column: operatorToken.loc.end.column }, "Bad line breaking before and after '" + operator + "'."); - } else if (style === "before" && isSameLine(leftToken, operatorToken)) { + } else if (style === "before" && astUtils.isTokenOnSameLine(leftToken, operatorToken)) { context.report(node, { line: operatorToken.loc.end.line, column: operatorToken.loc.end.column }, "'" + operator + "' should be placed at the beginning of the line."); - } else if (style === "after" && isSameLine(operatorToken, rightToken)) { + } else if (style === "after" && astUtils.isTokenOnSameLine(operatorToken, rightToken)) { context.report(node, { line: operatorToken.loc.end.line, @@ -91,6 +97,15 @@ module.exports = function(context) { } } + /** + * Validates a binary expression using `validateNode` + * @param {BinaryExpression|LogicalExpression|AssignmentExpression} node node to be validated + * @returns {void} + */ + function validateBinaryExpression(node) { + validateNode(node, node.left); + } + //-------------------------------------------------------------------------- // Public //-------------------------------------------------------------------------- @@ -99,16 +114,35 @@ module.exports = function(context) { "BinaryExpression": validateBinaryExpression, "LogicalExpression": validateBinaryExpression, "AssignmentExpression": validateBinaryExpression, - "VariableDeclarator": function (node) { + "VariableDeclarator": function(node) { if (node.init) { - validateBinaryExpression(node); + validateNode(node, node.id); } + }, + "ConditionalExpression": function(node) { + validateNode(node, node.test); + validateNode(node, node.consequent); } }; }; module.exports.schema = [ { - "enum": ["after", "before", "none"] + "enum": ["after", "before", "none", null] + }, + { + "type": "object", + "properties": { + "overrides": { + "type": "object", + "properties": { + "anyOf": { + "type": "string", + "enum": ["after", "before", "none", "ignore"] + } + } + } + }, + "additionalProperties": false } ]; diff --git a/tools/eslint/lib/rules/padded-blocks.js b/tools/eslint/lib/rules/padded-blocks.js index edb44637bea92f..f245a858f072e6 100644 --- a/tools/eslint/lib/rules/padded-blocks.js +++ b/tools/eslint/lib/rules/padded-blocks.js @@ -10,89 +10,209 @@ // Rule Definition //------------------------------------------------------------------------------ -module.exports = function (context) { - var requirePadding = context.options[0] !== "never"; +module.exports = function(context) { + var options = {}; + var config = context.options[0] || "always"; + + if (typeof config === "string") { + options.blocks = config === "always"; + } else { + if (config.hasOwnProperty("blocks")) { + options.blocks = config.blocks === "always"; + } + if (config.hasOwnProperty("switches")) { + options.switches = config.switches === "always"; + } + if (config.hasOwnProperty("classes")) { + options.classes = config.classes === "always"; + } + } var ALWAYS_MESSAGE = "Block must be padded by blank lines.", NEVER_MESSAGE = "Block must not be padded by blank lines."; + var sourceCode = context.getSourceCode(); + /** - * Checks if the given non empty block node has a blank line before its first child node. - * @param {ASTNode} node The AST node of a BlockStatement. - * @returns {boolean} Whether or not the block starts with a blank line. + * Gets the open brace token from a given node. + * @param {ASTNode} node - A BlockStatement or SwitchStatement node from which to get the open brace. + * @returns {Token} The token of the open brace. */ - function isBlockTopPadded(node) { - var blockStart = node.loc.start.line, - first = node.body[0], - firstLine = first.loc.start.line, - expectedFirstLine = blockStart + 2, - leadingComments = context.getComments(first).leading; - - if (leadingComments.length > 0) { - firstLine = leadingComments[0].loc.start.line; + function getOpenBrace(node) { + if (node.type === "SwitchStatement") { + return sourceCode.getTokenBefore(node.cases[0]); } + return sourceCode.getFirstToken(node); + } + /** + * Checks if the given parameter is a comment node + * @param {ASTNode|Token} node An AST node or token + * @returns {boolean} True if node is a comment + */ + function isComment(node) { + return node.type === "Line" || node.type === "Block"; + } + + /** + * Checks if the given token has a blank line after it. + * @param {Token} token The token to check. + * @returns {boolean} Whether or not the token is followed by a blank line. + */ + function isTokenTopPadded(token) { + var tokenStartLine = token.loc.start.line, + expectedFirstLine = tokenStartLine + 2, + first, + firstLine; + + first = token; + do { + first = sourceCode.getTokenOrCommentAfter(first); + } while (isComment(first) && first.loc.start.line === tokenStartLine); + + firstLine = first.loc.start.line; return expectedFirstLine <= firstLine; } /** - * Checks if the given non empty block node has a blank line after its last child node. - * @param {ASTNode} node The AST node of a BlockStatement. - * @returns {boolean} Whether or not the block ends with a blank line. + * Checks if the given token is preceeded by a blank line. + * @param {Token} token The token to check + * @returns {boolean} Whether or not the token is preceeded by a blank line */ - function isBlockBottomPadded(node) { - var blockEnd = node.loc.end.line, - last = node.body[node.body.length - 1], - lastLine = context.getLastToken(last).loc.end.line, + function isTokenBottomPadded(token) { + var blockEnd = token.loc.end.line, expectedLastLine = blockEnd - 2, - trailingComments = context.getComments(last).trailing; + last, + lastLine; - if (trailingComments.length > 0) { - lastLine = trailingComments[trailingComments.length - 1].loc.end.line; - } + last = token; + do { + last = sourceCode.getTokenOrCommentBefore(last); + } while (isComment(last) && last.loc.end.line === blockEnd); + lastLine = last.loc.end.line; return lastLine <= expectedLastLine; } + /** + * Checks if a node should be padded, according to the rule config. + * @param {ASTNode} node The AST node to check. + * @returns {boolean} True if the node should be padded, false otherwise. + */ + function requirePaddingFor(node) { + switch (node.type) { + case "BlockStatement": + return options.blocks; + case "SwitchStatement": + return options.switches; + case "ClassBody": + return options.classes; + + /* istanbul ignore next */ + default: + throw new Error("unreachable"); + } + } + /** * Checks the given BlockStatement node to be padded if the block is not empty. * @param {ASTNode} node The AST node of a BlockStatement. * @returns {void} undefined. */ function checkPadding(node) { - if (node.body.length > 0) { - - var blockHasTopPadding = isBlockTopPadded(node), - blockHasBottomPadding = isBlockBottomPadded(node); - - if (requirePadding) { - if (!blockHasTopPadding) { - context.report(node, ALWAYS_MESSAGE); - } - - if (!blockHasBottomPadding) { - context.report(node, node.loc.end, ALWAYS_MESSAGE); - } - } else { - if (blockHasTopPadding) { - context.report(node, NEVER_MESSAGE); - } - - if (blockHasBottomPadding) { - context.report(node, node.loc.end, NEVER_MESSAGE); - } + var openBrace = getOpenBrace(node), + closeBrace = sourceCode.getLastToken(node), + blockHasTopPadding = isTokenTopPadded(openBrace), + blockHasBottomPadding = isTokenBottomPadded(closeBrace); + + if (requirePaddingFor(node)) { + if (!blockHasTopPadding) { + context.report({ + node: node, + loc: { line: openBrace.loc.start.line, column: openBrace.loc.start.column }, + message: ALWAYS_MESSAGE + }); + } + if (!blockHasBottomPadding) { + context.report({ + node: node, + loc: {line: closeBrace.loc.end.line, column: closeBrace.loc.end.column - 1 }, + message: ALWAYS_MESSAGE + }); + } + } else { + if (blockHasTopPadding) { + context.report({ + node: node, + loc: { line: openBrace.loc.start.line, column: openBrace.loc.start.column }, + message: NEVER_MESSAGE + }); + } + + if (blockHasBottomPadding) { + context.report({ + node: node, + loc: {line: closeBrace.loc.end.line, column: closeBrace.loc.end.column - 1 }, + message: NEVER_MESSAGE + }); } } } - return { - "BlockStatement": checkPadding - }; + var rule = {}; + if (options.hasOwnProperty("switches")) { + rule.SwitchStatement = function(node) { + if (node.cases.length === 0) { + return; + } + checkPadding(node); + }; + } + + if (options.hasOwnProperty("blocks")) { + rule.BlockStatement = function(node) { + if (node.body.length === 0) { + return; + } + checkPadding(node); + }; + } + + if (options.hasOwnProperty("classes")) { + rule.ClassBody = function(node) { + if (node.body.length === 0) { + return; + } + checkPadding(node); + }; + } + + return rule; }; module.exports.schema = [ { - "enum": ["always", "never"] + "oneOf": [ + { + "enum": ["always", "never"] + }, + { + "type": "object", + "properties": { + "blocks": { + "enum": ["always", "never"] + }, + "switches": { + "enum": ["always", "never"] + }, + "classes": { + "enum": ["always", "never"] + } + }, + "additionalProperties": false, + "minProperties": 1 + } + ] } ]; diff --git a/tools/eslint/lib/rules/prefer-arrow-callback.js b/tools/eslint/lib/rules/prefer-arrow-callback.js new file mode 100644 index 00000000000000..a51fa6026e30e3 --- /dev/null +++ b/tools/eslint/lib/rules/prefer-arrow-callback.js @@ -0,0 +1,228 @@ +/** + * @fileoverview A rule to suggest using arrow functions as callbacks. + * @author Toru Nagashima + * @copyright 2015 Toru Nagashima. All rights reserved. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given variable is a function name. + * @param {escope.Variable} variable - A variable to check. + * @returns {boolean} `true` if the variable is a function name. + */ +function isFunctionName(variable) { + return variable && variable.defs[0].type === "FunctionName"; +} + +/** + * Checks whether or not a given MetaProperty node equals to a given value. + * @param {ASTNode} node - A MetaProperty node to check. + * @param {string} metaName - The name of `MetaProperty.meta`. + * @param {string} propertyName - The name of `MetaProperty.property`. + * @returns {boolean} `true` if the node is the specific value. + */ +function checkMetaProperty(node, metaName, propertyName) { + + // TODO: Remove this if block after https://github.com/eslint/espree/issues/206 was fixed. + if (typeof node.meta === "string") { + return node.meta === metaName && node.property === propertyName; + } + return node.meta.name === metaName && node.property.name === propertyName; +} + +/** + * Gets the variable object of `arguments` which is defined implicitly. + * @param {escope.Scope} scope - A scope to get. + * @returns {escope.Variable} The found variable object. + */ +function getVariableOfArguments(scope) { + var variables = scope.variables; + + for (var i = 0; i < variables.length; ++i) { + var variable = variables[i]; + + if (variable.name === "arguments") { + + /* + * If there was a parameter which is named "arguments", the + * implicit "arguments" is not defined. + * So does fast return with null. + */ + return (variable.identifiers.length === 0) ? variable : null; + } + } + + /* istanbul ignore next */ + return null; +} + +/** + * Checkes whether or not a given node is a callback. + * @param {ASTNode} node - A node to check. + * @returns {object} + * {boolean} retv.isCallback - `true` if the node is a callback. + * {boolean} retv.isLexicalThis - `true` if the node is with `.bind(this)`. + */ +function getCallbackInfo(node) { + var retv = {isCallback: false, isLexicalThis: false}; + var parent = node.parent; + + while (node) { + switch (parent.type) { + + // Checks parents recursively. + + case "LogicalExpression": + case "ConditionalExpression": + break; + + // Checks whether the parent node is `.bind(this)` call. + case "MemberExpression": + if (parent.object === node && + !parent.property.computed && + parent.property.type === "Identifier" && + parent.property.name === "bind" && + parent.parent.type === "CallExpression" && + parent.parent.callee === parent + ) { + retv.isLexicalThis = ( + parent.parent.arguments.length === 1 && + parent.parent.arguments[0].type === "ThisExpression" + ); + node = parent; + parent = parent.parent; + } else { + return retv; + } + break; + + // Checks whether the node is a callback. + case "CallExpression": + case "NewExpression": + if (parent.callee !== node) { + retv.isCallback = true; + } + return retv; + + default: + return retv; + } + + node = parent; + parent = parent.parent; + } + + /* istanbul ignore next */ + throw new Error("unreachable"); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + + /* + * {Array<{this: boolean, super: boolean, meta: boolean}>} + * - this - A flag which shows there are one or more ThisExpression. + * - super - A flag which shows there are one or more Super. + * - meta - A flag which shows there are one or more MethProperty. + */ + var stack = []; + + /** + * Pushes new function scope with all `false` flags. + * @returns {void} + */ + function enterScope() { + stack.push({this: false, super: false, meta: false}); + } + + /** + * Pops a function scope from the stack. + * @returns {{this: boolean, super: boolean, meta: boolean}} The information of the last scope. + */ + function exitScope() { + return stack.pop(); + } + + return { + + // Reset internal state. + Program: function() { + stack = []; + }, + + // If there are below, it cannot replace with arrow functions merely. + ThisExpression: function() { + var info = stack[stack.length - 1]; + + if (info) { + info.this = true; + } + }, + + Super: function() { + var info = stack[stack.length - 1]; + + if (info) { + info.super = true; + } + }, + + MetaProperty: function(node) { + var info = stack[stack.length - 1]; + + if (info && checkMetaProperty(node, "new", "target")) { + info.meta = true; + } + }, + + // To skip nested scopes. + FunctionDeclaration: enterScope, + "FunctionDeclaration:exit": exitScope, + + // Main. + FunctionExpression: enterScope, + "FunctionExpression:exit": function(node) { + var scopeInfo = exitScope(); + + // Skip generators. + if (node.generator) { + return; + } + + // Skip recursive functions. + var nameVar = context.getDeclaredVariables(node)[0]; + + if (isFunctionName(nameVar) && nameVar.references.length > 0) { + return; + } + + // Skip if it's using arguments. + var variable = getVariableOfArguments(context.getScope()); + + if (variable && variable.references.length > 0) { + return; + } + + // Reports if it's a callback which can replace with arrows. + var callbackInfo = getCallbackInfo(node); + + if (callbackInfo.isCallback && + (!scopeInfo.this || callbackInfo.isLexicalThis) && + !scopeInfo.super && + !scopeInfo.meta + ) { + context.report(node, "Unexpected function expression."); + } + } + }; +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/prefer-const.js b/tools/eslint/lib/rules/prefer-const.js index ee7eba14b7b6a4..ae55b516450756 100644 --- a/tools/eslint/lib/rules/prefer-const.js +++ b/tools/eslint/lib/rules/prefer-const.js @@ -1,91 +1,268 @@ /** - * @fileoverview A rule to suggest using of const declaration for variables that are never modified after declared. + * @fileoverview A rule to suggest using of const declaration for variables that are never reassigned after declared. * @author Toru Nagashima * @copyright 2015 Toru Nagashima. All rights reserved. */ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var Map = require("es6-map"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +var PATTERN_TYPE = /^(?:.+?Pattern|RestElement|Property)$/; +var DECLARATION_HOST_TYPE = /^(?:Program|BlockStatement|SwitchCase)$/; +var DESTRUCTURING_HOST_TYPE = /^(?:VariableDeclarator|AssignmentExpression)$/; + +/** + * Adds multiple items to the tail of an array. + * + * @param {any[]} array - A destination to add. + * @param {any[]} values - Items to be added. + * @returns {void} + */ +var pushAll = Function.apply.bind(Array.prototype.push); + +/** + * Checks whether a given node is located at `ForStatement.init` or not. + * + * @param {ASTNode} node - A node to check. + * @returns {boolean} `true` if the node is located at `ForStatement.init`. + */ +function isInitOfForStatement(node) { + return node.parent.type === "ForStatement" && node.parent.init === node; +} + +/** + * Checks whether a given Identifier node becomes a VariableDeclaration or not. + * + * @param {ASTNode} identifier - An Identifier node to check. + * @returns {boolean} `true` if the node can become a VariableDeclaration. + */ +function canBecomeVariableDeclaration(identifier) { + var node = identifier.parent; + + while (PATTERN_TYPE.test(node.type)) { + node = node.parent; + } + + return ( + node.type === "VariableDeclarator" || + ( + node.type === "AssignmentExpression" && + node.parent.type === "ExpressionStatement" && + DECLARATION_HOST_TYPE.test(node.parent.parent.type) + ) + ); +} + +/** + * Gets the WriteReference of a given variable if the variable should be + * declared as const. + * + * @param {escope.Variable} variable - A variable to get. + * @returns {escope.Reference|null} The singular WriteReference or null. + */ +function getWriteReferenceIfShouldBeConst(variable) { + if (variable.eslintUsed) { + return null; + } + + // Finds the singular WriteReference. + var retv = null; + var references = variable.references; + + for (var i = 0; i < references.length; ++i) { + var reference = references[i]; + + if (reference.isWrite()) { + var isReassigned = Boolean( + retv && retv.identifier !== reference.identifier + ); + + if (isReassigned) { + return null; + } + retv = reference; + } + } + + // Checks the writer is located in the same scope and can be modified to + // const. + var isSameScopeAndCanBecomeVariableDeclaration = Boolean( + retv && + retv.from === variable.scope && + canBecomeVariableDeclaration(retv.identifier) + ); + + return isSameScopeAndCanBecomeVariableDeclaration ? retv : null; +} + +/** + * Gets the VariableDeclarator/AssignmentExpression node that a given reference + * belongs to. + * This is used to detect a mix of reassigned and never reassigned in a + * destructuring. + * + * @param {escope.Reference} reference - A reference to get. + * @returns {ASTNode|null} A VariableDeclarator/AssignmentExpression node or + * null. + */ +function getDestructuringHost(reference) { + if (!reference.isWrite()) { + return null; + } + var node = reference.identifier.parent; + + while (PATTERN_TYPE.test(node.type)) { + node = node.parent; + } + + if (!DESTRUCTURING_HOST_TYPE.test(node.type)) { + return null; + } + return node; +} + +/** + * Groups by the VariableDeclarator/AssignmentExpression node that each + * reference of given variables belongs to. + * This is used to detect a mix of reassigned and never reassigned in a + * destructuring. + * + * @param {escope.Variable[]} variables - Variables to group by destructuring. + * @returns {Map} Grouped references. + */ +function groupByDestructuring(variables) { + var writersMap = new Map(); + + for (var i = 0; i < variables.length; ++i) { + var variable = variables[i]; + var references = variable.references; + var writer = getWriteReferenceIfShouldBeConst(variable); + var prevId = null; + + for (var j = 0; j < references.length; ++j) { + var reference = references[j]; + var id = reference.identifier; + + // Avoid counting a reference twice or more for default values of + // destructuring. + if (id === prevId) { + continue; + } + prevId = id; + + // Add the writer into the destructuring group. + var group = getDestructuringHost(reference); + + if (group) { + if (writersMap.has(group)) { + writersMap.get(group).push(writer); + } else { + writersMap.set(group, [writer]); + } + } + } + } + + return writersMap; +} + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = function(context) { + var options = context.options[0] || {}; + var checkingMixedDestructuring = options.destructuring !== "all"; + var variables = null; /** - * Checks whether a reference is the initializer. - * @param {Reference} reference - A reference to check. - * @returns {boolean} Whether or not the reference is the initializer. + * Reports a given reference. + * + * @param {escope.Reference} reference - A reference to report. + * @returns {void} */ - function isInitializer(reference) { - return reference.init === true; - } + function report(reference) { + var id = reference.identifier; - /** - * Checks whether a reference is read-only or the initializer. - * @param {Reference} reference - A reference to check. - * @returns {boolean} Whether or not the reference is read-only or the initializer. - */ - function isReadOnlyOrInitializer(reference) { - return reference.isReadOnly() || reference.init === true; + context.report({ + node: id, + message: "'{{name}}' is never reassigned, use 'const' instead.", + data: id + }); } /** - * Searches and reports variables that are never modified after declared. - * @param {Scope} scope - A scope of the search domain. + * Reports a given variable if the variable should be declared as const. + * + * @param {escope.Variable} variable - A variable to report. * @returns {void} */ - function checkForVariables(scope) { - // Skip the TDZ type. - if (scope.type === "TDZ") { - return; - } + function checkVariable(variable) { + var writer = getWriteReferenceIfShouldBeConst(variable); - var variables = scope.variables; - for (var i = 0, end = variables.length; i < end; ++i) { - var variable = variables[i]; - var def = variable.defs[0]; - var declaration = def && def.parent; - var statement = declaration && declaration.parent; - var references = variable.references; - var identifier = variable.identifiers[0]; - - if (statement != null && - identifier != null && - declaration.type === "VariableDeclaration" && - declaration.kind === "let" && - (statement.type !== "ForStatement" || statement.init !== declaration) && - references.some(isInitializer) && - references.every(isReadOnlyOrInitializer) - ) { - context.report( - identifier, - "`{{name}}` is never modified, use `const` instead.", - {name: identifier.name}); - } + if (writer) { + report(writer); } } /** - * Adds multiple items to the tail of an array. - * @param {any[]} array - A destination to add. - * @param {any[]} values - Items to be added. + * Reports given references if all of the reference should be declared as + * const. + * + * The argument 'writers' is an array of references. + * This reference is the result of + * 'getWriteReferenceIfShouldBeConst(variable)', so it's nullable. + * In simple declaration or assignment cases, the length of the array is 1. + * In destructuring cases, the length of the array can be 2 or more. + * + * @param {(escope.Reference|null)[]} writers - References which are grouped + * by destructuring to report. * @returns {void} */ - var pushAll = Function.apply.bind(Array.prototype.push); + function checkGroup(writers) { + if (writers.every(Boolean)) { + writers.forEach(report); + } + } return { - "Program:exit": function () { - var stack = [context.getScope()]; - while (stack.length) { - var scope = stack.pop(); - pushAll(stack, scope.childScopes); + "Program": function() { + variables = []; + }, + + "Program:exit": function() { + if (checkingMixedDestructuring) { + variables.forEach(checkVariable); + } else { + groupByDestructuring(variables).forEach(checkGroup); + } + + variables = null; + }, - checkForVariables(scope); + "VariableDeclaration": function(node) { + if (node.kind === "let" && !isInitOfForStatement(node)) { + pushAll(variables, context.getDeclaredVariables(node)); } } }; - }; -module.exports.schema = []; +module.exports.schema = [ + { + type: "object", + properties: { + destructuring: {enum: ["any", "all"]} + }, + additionalProperties: false + } +]; diff --git a/tools/eslint/lib/rules/prefer-reflect.js b/tools/eslint/lib/rules/prefer-reflect.js new file mode 100644 index 00000000000000..83b805a30d99b9 --- /dev/null +++ b/tools/eslint/lib/rules/prefer-reflect.js @@ -0,0 +1,102 @@ +/** + * @fileoverview Rule to suggest using "Reflect" api over Function/Object methods + * @author Keith Cirkel + * @copyright 2015 Keith Cirkel. All rights reserved. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var existingNames = { + "apply": "Function.prototype.apply", + "call": "Function.prototype.call", + "defineProperty": "Object.defineProperty", + "getOwnPropertyDescriptor": "Object.getOwnPropertyDescriptor", + "getPrototypeOf": "Object.getPrototypeOf", + "setPrototypeOf": "Object.setPrototypeOf", + "isExtensible": "Object.isExtensible", + "getOwnPropertyNames": "Object.getOwnPropertyNames", + "preventExtensions": "Object.preventExtensions" + }; + + var reflectSubsitutes = { + "apply": "Reflect.apply", + "call": "Reflect.apply", + "defineProperty": "Reflect.defineProperty", + "getOwnPropertyDescriptor": "Reflect.getOwnPropertyDescriptor", + "getPrototypeOf": "Reflect.getPrototypeOf", + "setPrototypeOf": "Reflect.setPrototypeOf", + "isExtensible": "Reflect.isExtensible", + "getOwnPropertyNames": "Reflect.getOwnPropertyNames", + "preventExtensions": "Reflect.preventExtensions" + }; + + var exceptions = (context.options[0] || {}).exceptions || []; + + /** + * Reports the Reflect violation based on the `existing` and `substitute` + * @param {Object} node The node that violates the rule. + * @param {string} existing The existing method name that has been used. + * @param {string} substitute The Reflect substitute that should be used. + * @returns {void} + */ + function report(node, existing, substitute) { + context.report(node, "Avoid using {{existing}}, instead use {{substitute}}", { + existing: existing, + substitute: substitute + }); + } + + return { + "CallExpression": function(node) { + var methodName = (node.callee.property || {}).name; + var isReflectCall = (node.callee.object || {}).name === "Reflect"; + var hasReflectSubsitute = reflectSubsitutes.hasOwnProperty(methodName); + var userConfiguredException = exceptions.indexOf(methodName) !== -1; + + if (hasReflectSubsitute && !isReflectCall && !userConfiguredException) { + report(node, existingNames[methodName], reflectSubsitutes[methodName]); + } + }, + "UnaryExpression": function(node) { + var isDeleteOperator = node.operator === "delete"; + var targetsIdentifier = node.argument.type === "Identifier"; + var userConfiguredException = exceptions.indexOf("delete") !== -1; + + if (isDeleteOperator && !targetsIdentifier && !userConfiguredException) { + report(node, "the delete keyword", "Reflect.deleteProperty"); + } + } + }; + +}; + +module.exports.schema = [ + { + "type": "object", + "properties": { + "exceptions": { + "type": "array", + "items": { + "enum": [ + "apply", + "call", + "delete", + "defineProperty", + "getOwnPropertyDescriptor", + "getPrototypeOf", + "setPrototypeOf", + "isExtensible", + "getOwnPropertyNames", + "preventExtensions" + ] + }, + "uniqueItems": true + } + }, + "additionalProperties": false + } +]; diff --git a/tools/eslint/lib/rules/prefer-rest-params.js b/tools/eslint/lib/rules/prefer-rest-params.js new file mode 100644 index 00000000000000..d52c1164cbf7d4 --- /dev/null +++ b/tools/eslint/lib/rules/prefer-rest-params.js @@ -0,0 +1,75 @@ +/** + * @fileoverview Rule to + * @author Toru Nagashima + * @copyright 2015 Toru Nagashima. All rights reserved. + * See LICENSE file in root directory for full license. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets the variable object of `arguments` which is defined implicitly. + * @param {escope.Scope} scope - A scope to get. + * @returns {escope.Variable} The found variable object. + */ +function getVariableOfArguments(scope) { + var variables = scope.variables; + + for (var i = 0; i < variables.length; ++i) { + var variable = variables[i]; + + if (variable.name === "arguments") { + + // If there was a parameter which is named "arguments", the implicit "arguments" is not defined. + // So does fast return with null. + return (variable.identifiers.length === 0) ? variable : null; + } + } + + /* istanbul ignore next : unreachable */ + return null; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + + /** + * Reports a given reference. + * + * @param {escope.Reference} reference - A reference to report. + * @returns {void} + */ + function report(reference) { + context.report({ + node: reference.identifier, + message: "Use the rest parameters instead of 'arguments'." + }); + } + + /** + * Reports references of the implicit `arguments` variable if exist. + * + * @returns {void} + */ + function checkForArguments() { + var argumentsVar = getVariableOfArguments(context.getScope()); + + if (argumentsVar) { + argumentsVar.references.forEach(report); + } + } + + return { + FunctionDeclaration: checkForArguments, + FunctionExpression: checkForArguments + }; +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/prefer-spread.js b/tools/eslint/lib/rules/prefer-spread.js new file mode 100644 index 00000000000000..de0cbbe5320498 --- /dev/null +++ b/tools/eslint/lib/rules/prefer-spread.js @@ -0,0 +1,92 @@ +/** + * @fileoverview A rule to suggest using of the spread operator instead of `.apply()`. + * @author Toru Nagashima + * @copyright 2015 Toru Nagashima. All rights reserved. + */ + +"use strict"; + +var astUtils = require("../ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a node is a `.apply()` for variadic. + * @param {ASTNode} node - A CallExpression node to check. + * @returns {boolean} Whether or not the node is a `.apply()` for variadic. + */ +function isVariadicApplyCalling(node) { + return ( + node.callee.type === "MemberExpression" && + node.callee.property.type === "Identifier" && + node.callee.property.name === "apply" && + node.callee.computed === false && + node.arguments.length === 2 && + node.arguments[1].type !== "ArrayExpression" + ); +} + +/** + * Checks whether or not the tokens of two given nodes are same. + * @param {ASTNode} left - A node 1 to compare. + * @param {ASTNode} right - A node 2 to compare. + * @param {RuleContext} context - The ESLint rule context object. + * @returns {boolean} the source code for the given node. + */ +function equalTokens(left, right, context) { + var tokensL = context.getTokens(left); + var tokensR = context.getTokens(right); + + if (tokensL.length !== tokensR.length) { + return false; + } + for (var i = 0; i < tokensL.length; ++i) { + if (tokensL[i].type !== tokensR[i].type || + tokensL[i].value !== tokensR[i].value + ) { + return false; + } + } + + return true; +} + +/** + * Checks whether or not `thisArg` is not changed by `.apply()`. + * @param {ASTNode|null} expectedThis - The node that is the owner of the applied function. + * @param {ASTNode} thisArg - The node that is given to the first argument of the `.apply()`. + * @param {RuleContext} context - The ESLint rule context object. + * @returns {boolean} Whether or not `thisArg` is not changed by `.apply()`. + */ +function isValidThisArg(expectedThis, thisArg, context) { + if (!expectedThis) { + return astUtils.isNullOrUndefined(thisArg); + } + return equalTokens(expectedThis, thisArg, context); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + return { + "CallExpression": function(node) { + if (!isVariadicApplyCalling(node)) { + return; + } + + var applied = node.callee.object; + var expectedThis = (applied.type === "MemberExpression") ? applied.object : null; + var thisArg = node.arguments[0]; + + if (isValidThisArg(expectedThis, thisArg, context)) { + context.report(node, "use the spread operator instead of the '.apply()'."); + } + } + }; +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/prefer-template.js b/tools/eslint/lib/rules/prefer-template.js new file mode 100644 index 00000000000000..19b3d10c0ab7a6 --- /dev/null +++ b/tools/eslint/lib/rules/prefer-template.js @@ -0,0 +1,97 @@ +/** + * @fileoverview A rule to suggest using template literals instead of string concatenation. + * @author Toru Nagashima + * @copyright 2015 Toru Nagashima. All rights reserved. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var astUtils = require("../ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks whether or not a given node is a concatenation. + * @param {ASTNode} node - A node to check. + * @returns {boolean} `true` if the node is a concatenation. + */ +function isConcatenation(node) { + return node.type === "BinaryExpression" && node.operator === "+"; +} + +/** + * Gets the top binary expression node for concatenation in parents of a given node. + * @param {ASTNode} node - A node to get. + * @returns {ASTNode} the top binary expression node in parents of a given node. + */ +function getTopConcatBinaryExpression(node) { + while (isConcatenation(node.parent)) { + node = node.parent; + } + return node; +} + +/** + * Checks whether or not a given binary expression has non string literals. + * @param {ASTNode} node - A node to check. + * @returns {boolean} `true` if the node has non string literals. + */ +function hasNonStringLiteral(node) { + if (isConcatenation(node)) { + + // `left` is deeper than `right` normally. + return hasNonStringLiteral(node.right) || hasNonStringLiteral(node.left); + } + return !astUtils.isStringLiteral(node); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var done = Object.create(null); + + /** + * Reports if a given node is string concatenation with non string literals. + * + * @param {ASTNode} node - A node to check. + * @returns {void} + */ + function checkForStringConcat(node) { + if (!astUtils.isStringLiteral(node) || !isConcatenation(node.parent)) { + return; + } + + var topBinaryExpr = getTopConcatBinaryExpression(node.parent); + + // Checks whether or not this node had been checked already. + if (done[topBinaryExpr.range[0]]) { + return; + } + done[topBinaryExpr.range[0]] = true; + + if (hasNonStringLiteral(topBinaryExpr)) { + context.report( + topBinaryExpr, + "Unexpected string concatenation."); + } + } + + return { + Program: function() { + done = Object.create(null); + }, + + Literal: checkForStringConcat, + TemplateLiteral: checkForStringConcat + }; +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/quote-props.js b/tools/eslint/lib/rules/quote-props.js index 225dbfe8f86acf..f3453adb063af2 100644 --- a/tools/eslint/lib/rules/quote-props.js +++ b/tools/eslint/lib/rules/quote-props.js @@ -2,6 +2,7 @@ * @fileoverview Rule to flag non-quoted property names in object literals. * @author Mathias Bynens * @copyright 2014 Brandon Mills. All rights reserved. + * @copyright 2015 Tomasz Olędzki. All rights reserved. */ "use strict"; @@ -9,7 +10,8 @@ // Requirements //------------------------------------------------------------------------------ -var espree = require("espree"); +var espree = require("espree"), + keywords = require("../util/keywords"); //------------------------------------------------------------------------------ // Rule Definition @@ -17,17 +19,54 @@ var espree = require("espree"); module.exports = function(context) { - var MODE = context.options[0]; + var MODE = context.options[0], + KEYWORDS = context.options[1] && context.options[1].keywords, + CHECK_UNNECESSARY = !context.options[1] || context.options[1].unnecessary !== false, + NUMBERS = context.options[1] && context.options[1].numbers, + + MESSAGE_UNNECESSARY = "Unnecessarily quoted property '{{property}}' found.", + MESSAGE_UNQUOTED = "Unquoted property '{{property}}' found.", + MESSAGE_NUMERIC = "Unquoted number literal '{{property}}' used as key.", + MESSAGE_RESERVED = "Unquoted reserved word '{{property}}' used as key."; + + + /** + * Checks whether a certain string constitutes an ES3 token + * @param {string} tokenStr - The string to be checked. + * @returns {boolean} `true` if it is an ES3 token. + */ + function isKeyword(tokenStr) { + return keywords.indexOf(tokenStr) >= 0; + } + + /** + * Checks if an espree-tokenized key has redundant quotes (i.e. whether quotes are unnecessary) + * @param {string} rawKey The raw key value from the source + * @param {espreeTokens} tokens The espree-tokenized node key + * @param {boolean} [skipNumberLiterals=false] Indicates whether number literals should be checked + * @returns {boolean} Whether or not a key has redundant quotes. + * @private + */ + function areQuotesRedundant(rawKey, tokens, skipNumberLiterals) { + return tokens.length === 1 && tokens[0].start === 0 && tokens[0].end === rawKey.length && + (["Identifier", "Keyword", "Null", "Boolean"].indexOf(tokens[0].type) >= 0 || + (tokens[0].type === "Numeric" && !skipNumberLiterals && "" + +tokens[0].value === tokens[0].value)); + } /** * Ensures that a property's key is quoted only when necessary * @param {ASTNode} node Property AST node * @returns {void} */ - function asNeeded(node) { + function checkUnnecessaryQuotes(node) { var key = node.key, + isKeywordToken, tokens; + if (node.method || node.computed || node.shorthand) { + return; + } + if (key.type === "Literal" && typeof key.value === "string") { try { tokens = espree.tokenize(key.value); @@ -35,12 +74,23 @@ module.exports = function(context) { return; } - if (tokens.length === 1 && - (["Identifier", "Null", "Boolean"].indexOf(tokens[0].type) >= 0 || - (tokens[0].type === "Numeric" && "" + +tokens[0].value === tokens[0].value)) - ) { - context.report(node, "Unnecessarily quoted property `{{value}}` found.", key); + if (tokens.length !== 1) { + return; + } + + isKeywordToken = isKeyword(tokens[0].value); + + if (isKeywordToken && KEYWORDS) { + return; } + + if (CHECK_UNNECESSARY && areQuotesRedundant(key.value, tokens, NUMBERS)) { + context.report(node, MESSAGE_UNNECESSARY, {property: key.value}); + } + } else if (KEYWORDS && key.type === "Identifier" && isKeyword(key.name)) { + context.report(node, MESSAGE_RESERVED, {property: key.name}); + } else if (NUMBERS && key.type === "Literal" && typeof key.value === "number") { + context.report(node, MESSAGE_NUMERIC, {property: key.value}); } } @@ -49,24 +99,125 @@ module.exports = function(context) { * @param {ASTNode} node Property AST node * @returns {void} */ - function always(node) { + function checkOmittedQuotes(node) { var key = node.key; - if (!node.method && !(key.type === "Literal" && typeof key.value === "string")) { - context.report(node, "Unquoted property `{{key}}` found.", { - key: key.name || key.value + if (!node.method && !node.computed && !node.shorthand && !(key.type === "Literal" && typeof key.value === "string")) { + context.report(node, MESSAGE_UNQUOTED, { + property: key.name || key.value }); } } + /** + * Ensures that an object's keys are consistently quoted, optionally checks for redundancy of quotes + * @param {ASTNode} node Property AST node + * @param {boolean} checkQuotesRedundancy Whether to check quotes' redundancy + * @returns {void} + */ + function checkConsistency(node, checkQuotesRedundancy) { + var quotes = false, + lackOfQuotes = false, + necessaryQuotes = false; + + node.properties.forEach(function(property) { + var key = property.key, + tokens; + + if (!key || property.method || property.computed || property.shorthand) { + return; + } + + if (key.type === "Literal" && typeof key.value === "string") { + + quotes = true; + + if (checkQuotesRedundancy) { + try { + tokens = espree.tokenize(key.value); + } catch (e) { + necessaryQuotes = true; + return; + } + + necessaryQuotes = necessaryQuotes || !areQuotesRedundant(key.value, tokens) || KEYWORDS && isKeyword(tokens[0].value); + } + } else if (KEYWORDS && checkQuotesRedundancy && key.type === "Identifier" && isKeyword(key.name)) { + necessaryQuotes = true; + context.report(node, "Properties should be quoted as '{{property}}' is a reserved word.", {property: key.name}); + } else { + lackOfQuotes = true; + } + + if (quotes && lackOfQuotes) { + context.report(node, "Inconsistently quoted property '{{key}}' found.", { + key: key.name || key.value + }); + } + }); + + if (checkQuotesRedundancy && quotes && !necessaryQuotes) { + context.report(node, "Properties shouldn't be quoted as all quotes are redundant."); + } + } + return { - "Property": MODE === "as-needed" ? asNeeded : always + "Property": function(node) { + if (MODE === "always" || !MODE) { + checkOmittedQuotes(node); + } + if (MODE === "as-needed") { + checkUnnecessaryQuotes(node); + } + }, + "ObjectExpression": function(node) { + if (MODE === "consistent") { + checkConsistency(node, false); + } + if (MODE === "consistent-as-needed") { + checkConsistency(node, true); + } + } }; }; -module.exports.schema = [ - { - "enum": ["always", "as-needed"] - } -]; +module.exports.schema = { + "anyOf": [ + { + "type": "array", + "items": [ + { + "enum": ["always", "as-needed", "consistent", "consistent-as-needed"] + } + ], + "minItems": 0, + "maxItems": 1 + }, + { + "type": "array", + "items": [ + { + "enum": ["always", "as-needed", "consistent", "consistent-as-needed"] + }, + { + "type": "object", + "properties": { + "keywords": { + "type": "boolean" + }, + "unnecessary": { + "type": "boolean" + }, + "numbers": { + "type": "boolean" + } + }, + "additionalProperties": false + } + ], + "minItems": 0, + "maxItems": 2 + } + ] +}; diff --git a/tools/eslint/lib/rules/quotes.js b/tools/eslint/lib/rules/quotes.js index 7d4626b9aedc13..b5cce4bbfea2d9 100644 --- a/tools/eslint/lib/rules/quotes.js +++ b/tools/eslint/lib/rules/quotes.js @@ -1,10 +1,18 @@ /** * @fileoverview A rule to choose between single and double quote marks * @author Matt DuVall , Brandon Payton + * @copyright 2013 Matt DuVall. All rights reserved. + * See LICENSE file in root directory for full license. */ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var astUtils = require("../ast-utils"); + //------------------------------------------------------------------------------ // Constants //------------------------------------------------------------------------------ @@ -27,7 +35,40 @@ var QUOTE_SETTINGS = { } }; -var AVOID_ESCAPE = "avoid-escape"; +/** + * Switches quoting of javascript string between ' " and ` + * escaping and unescaping as necessary. + * Only escaping of the minimal set of characters is changed. + * Note: escaping of newlines when switching from backtick to other quotes is not handled. + * @param {string} str - A string to convert. + * @returns {string} The string with changed quotes. + * @private + */ +QUOTE_SETTINGS.double.convert = +QUOTE_SETTINGS.single.convert = +QUOTE_SETTINGS.backtick.convert = function(str) { + var newQuote = this.quote; + var oldQuote = str[0]; + + if (newQuote === oldQuote) { + return str; + } + return newQuote + str.slice(1, -1).replace(/\\(\${|\r\n?|\n|.)|["'`]|\${|(\r\n?|\n)/g, function(match, escaped, newline) { + if (escaped === oldQuote || oldQuote === "`" && escaped === "${") { + return escaped; // unescape + } + if (match === newQuote || newQuote === "`" && match === "${") { + return "\\" + match; // escape + } + if (newline && oldQuote === "`") { + return "\\n"; // escape newlines + } + return match; + }) + newQuote; +}; + +var AVOID_ESCAPE = "avoid-escape", + FUNCTION_TYPE = /^(?:Arrow)?Function(?:Declaration|Expression)$/; //------------------------------------------------------------------------------ // Rule Definition @@ -35,16 +76,10 @@ var AVOID_ESCAPE = "avoid-escape"; module.exports = function(context) { - /** - * Validate that a string passed in is surrounded by the specified character - * @param {string} val The text to check. - * @param {string} character The character to see if it's surrounded by. - * @returns {boolean} True if the text is surrounded by the character, false if not. - * @private - */ - function isSurroundedBy(val, character) { - return val[0] === character && val[val.length - 1] === character; - } + var quoteOption = context.options[0], + settings = QUOTE_SETTINGS[quoteOption || "double"], + avoidEscape = context.options[1] === AVOID_ESCAPE, + sourceCode = context.getSourceCode(); /** * Determines if a given node is part of JSX syntax. @@ -56,27 +91,127 @@ module.exports = function(context) { return node.type.indexOf("JSX") === 0; } + /** + * Checks whether or not a given node is a directive. + * The directive is a `ExpressionStatement` which has only a string literal. + * @param {ASTNode} node - A node to check. + * @returns {boolean} Whether or not the node is a directive. + * @private + */ + function isDirective(node) { + return ( + node.type === "ExpressionStatement" && + node.expression.type === "Literal" && + typeof node.expression.value === "string" + ); + } + + /** + * Checks whether or not a given node is a part of directive prologues. + * See also: http://www.ecma-international.org/ecma-262/6.0/#sec-directive-prologues-and-the-use-strict-directive + * @param {ASTNode} node - A node to check. + * @returns {boolean} Whether or not the node is a part of directive prologues. + * @private + */ + function isPartOfDirectivePrologue(node) { + var block = node.parent.parent; + + if (block.type !== "Program" && (block.type !== "BlockStatement" || !FUNCTION_TYPE.test(block.parent.type))) { + return false; + } + + // Check the node is at a prologue. + for (var i = 0; i < block.body.length; ++i) { + var statement = block.body[i]; + + if (statement === node.parent) { + return true; + } + if (!isDirective(statement)) { + break; + } + } + + return false; + } + + /** + * Checks whether or not a given node is allowed as non backtick. + * @param {ASTNode} node - A node to check. + * @returns {boolean} Whether or not the node is allowed as non backtick. + * @private + */ + function isAllowedAsNonBacktick(node) { + var parent = node.parent; + + switch (parent.type) { + + // Directive Prologues. + case "ExpressionStatement": + return isPartOfDirectivePrologue(node); + + // LiteralPropertyName. + case "Property": + return parent.key === node && !parent.computed; + + // ModuleSpecifier. + case "ImportDeclaration": + case "ExportNamedDeclaration": + case "ExportAllDeclaration": + return parent.source === node; + + // Others don't allow. + default: + return false; + } + } + return { "Literal": function(node) { var val = node.value, rawVal = node.raw, - quoteOption = context.options[0], - settings = QUOTE_SETTINGS[quoteOption || "double"], - avoidEscape = context.options[1] === AVOID_ESCAPE, isValid; if (settings && typeof val === "string") { - isValid = isJSXElement(node.parent) || isSurroundedBy(rawVal, settings.quote); + isValid = (quoteOption === "backtick" && isAllowedAsNonBacktick(node)) || + isJSXElement(node.parent) || + astUtils.isSurroundedBy(rawVal, settings.quote); if (!isValid && avoidEscape) { - isValid = isSurroundedBy(rawVal, settings.alternateQuote) && rawVal.indexOf(settings.quote) >= 0; + isValid = astUtils.isSurroundedBy(rawVal, settings.alternateQuote) && rawVal.indexOf(settings.quote) >= 0; } if (!isValid) { - context.report(node, "Strings must use " + settings.description + "."); + context.report({ + node: node, + message: "Strings must use " + settings.description + ".", + fix: function(fixer) { + return fixer.replaceText(node, settings.convert(node.raw)); + } + }); } } + }, + + "TemplateLiteral": function(node) { + + // If backticks are expected or it's a tagged template, then this shouldn't throw an errors + if (quoteOption === "backtick" || node.parent.type === "TaggedTemplateExpression") { + return; + } + + var shouldWarn = node.quasis.length === 1 && (node.quasis[0].value.cooked.indexOf("\n") === -1); + + if (shouldWarn) { + context.report({ + node: node, + message: "Strings must use " + settings.description + ".", + fix: function(fixer) { + return fixer.replaceText(node, settings.convert(sourceCode.getText(node))); + } + }); + } } }; diff --git a/tools/eslint/lib/rules/radix.js b/tools/eslint/lib/rules/radix.js index ac93b9e60788f3..23a2f71d445409 100644 --- a/tools/eslint/lib/rules/radix.js +++ b/tools/eslint/lib/rules/radix.js @@ -5,37 +5,157 @@ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var astUtils = require("../ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +var MODE_ALWAYS = "always", + MODE_AS_NEEDED = "as-needed"; + +/** + * Checks whether a given variable is shadowed or not. + * + * @param {escope.Variable} variable - A variable to check. + * @returns {boolean} `true` if the variable is shadowed. + */ +function isShadowed(variable) { + return variable.defs.length >= 1; +} + +/** + * Checks whether a given node is a MemberExpression of `parseInt` method or not. + * + * @param {ASTNode} node - A node to check. + * @returns {boolean} `true` if the node is a MemberExpression of `parseInt` + * method. + */ +function isParseIntMethod(node) { + return ( + node.type === "MemberExpression" && + !node.computed && + node.property.type === "Identifier" && + node.property.name === "parseInt" + ); +} + +/** + * Checks whether a given node is a valid value of radix or not. + * + * The following values are invalid. + * + * - A literal except numbers. + * - undefined. + * + * @param {ASTNode} radix - A node of radix to check. + * @returns {boolean} `true` if the node is valid. + */ +function isValidRadix(radix) { + return !( + (radix.type === "Literal" && typeof radix.value !== "number") || + (radix.type === "Identifier" && radix.name === "undefined") + ); +} + +/** + * Checks whether a given node is a default value of radix or not. + * + * @param {ASTNode} radix - A node of radix to check. + * @returns {boolean} `true` if the node is the literal node of `10`. + */ +function isDefaultRadix(radix) { + return radix.type === "Literal" && radix.value === 10; +} + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = function(context) { + var mode = context.options[0] || MODE_ALWAYS; - return { - "CallExpression": function(node) { + /** + * Checks the arguments of a given CallExpression node and reports it if it + * offends this rule. + * + * @param {ASTNode} node - A CallExpression node to check. + * @returns {void} + */ + function checkArguments(node) { + var args = node.arguments; - var radix; + switch (args.length) { + case 0: + context.report({ + node: node, + message: "Missing parameters." + }); + break; - if (node.callee.name === "parseInt") { + case 1: + if (mode === MODE_ALWAYS) { + context.report({ + node: node, + message: "Missing radix parameter." + }); + } + break; - if (node.arguments.length < 2) { - context.report(node, "Missing radix parameter."); - } else { + default: + if (mode === MODE_AS_NEEDED && isDefaultRadix(args[1])) { + context.report({ + node: node, + message: "Redundant radix parameter." + }); + } else if (!isValidRadix(args[1])) { + context.report({ + node: node, + message: "Invalid radix parameter." + }); + } + break; + } + } - radix = node.arguments[1]; + return { + "Program:exit": function() { + var scope = context.getScope(); + var variable; + + // Check `parseInt()` + variable = astUtils.getVariableByName(scope, "parseInt"); + if (!isShadowed(variable)) { + variable.references.forEach(function(reference) { + var node = reference.identifier; - // don't allow non-numeric literals or undefined - if ((radix.type === "Literal" && typeof radix.value !== "number") || - (radix.type === "Identifier" && radix.name === "undefined") - ) { - context.report(node, "Invalid radix parameter."); + if (astUtils.isCallee(node)) { + checkArguments(node.parent); } - } + }); + } + // Check `Number.parseInt()` + variable = astUtils.getVariableByName(scope, "Number"); + if (!isShadowed(variable)) { + variable.references.forEach(function(reference) { + var node = reference.identifier.parent; + + if (isParseIntMethod(node) && astUtils.isCallee(node)) { + checkArguments(node.parent); + } + }); } } }; - }; -module.exports.schema = []; +module.exports.schema = [ + { + "enum": ["always", "as-needed"] + } +]; diff --git a/tools/eslint/lib/rules/require-jsdoc.js b/tools/eslint/lib/rules/require-jsdoc.js new file mode 100644 index 00000000000000..bac4475e9efa1b --- /dev/null +++ b/tools/eslint/lib/rules/require-jsdoc.js @@ -0,0 +1,97 @@ +/** + * @fileoverview Rule to check for jsdoc presence. + * @author Gyandeep Singh + * @copyright 2015 Gyandeep Singh. All rights reserved. + */ +"use strict"; + +var lodash = require("lodash"); + +module.exports = function(context) { + var source = context.getSourceCode(); + var DEFAULT_OPTIONS = { + "FunctionDeclaration": true, + "MethodDefinition": false, + "ClassDeclaration": false + }; + var options = lodash.assign(DEFAULT_OPTIONS, context.options[0] && context.options[0].require || {}); + + /** + * Report the error message + * @param {ASTNode} node node to report + * @returns {void} + */ + function report(node) { + context.report(node, "Missing JSDoc comment."); + } + + /** + * Check if the jsdoc comment is present for class methods + * @param {ASTNode} node node to examine + * @returns {void} + */ + function checkClassMethodJsDoc(node) { + if (node.parent.type === "MethodDefinition") { + var jsdocComment = source.getJSDocComment(node); + + if (!jsdocComment) { + report(node); + } + } + } + + /** + * Check if the jsdoc comment is present or not. + * @param {ASTNode} node node to examine + * @returns {void} + */ + function checkJsDoc(node) { + var jsdocComment = source.getJSDocComment(node); + + if (!jsdocComment) { + report(node); + } + } + + return { + "FunctionDeclaration": function(node) { + if (options.FunctionDeclaration) { + checkJsDoc(node); + } + }, + "FunctionExpression": function(node) { + if (options.MethodDefinition) { + checkClassMethodJsDoc(node); + } + }, + "ClassDeclaration": function(node) { + if (options.ClassDeclaration) { + checkJsDoc(node); + } + } + }; +}; + +module.exports.schema = [ + { + "type": "object", + "properties": { + "require": { + "type": "object", + "properties": { + "ClassDeclaration": { + "type": "boolean" + }, + "MethodDefinition": { + "type": "boolean" + }, + "FunctionDeclaration": { + "type": "boolean" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } +]; diff --git a/tools/eslint/lib/rules/require-yield.js b/tools/eslint/lib/rules/require-yield.js new file mode 100644 index 00000000000000..b293ee4c9e1875 --- /dev/null +++ b/tools/eslint/lib/rules/require-yield.js @@ -0,0 +1,64 @@ +/** + * @fileoverview Rule to flag the generator functions that does not have yield. + * @author Toru Nagashima + * @copyright 2015 Toru Nagashima. All rights reserved. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var stack = []; + + /** + * If the node is a generator function, start counting `yield` keywords. + * @param {Node} node - A function node to check. + * @returns {void} + */ + function beginChecking(node) { + if (node.generator) { + stack.push(0); + } + } + + /** + * If the node is a generator function, end counting `yield` keywords, then + * reports result. + * @param {Node} node - A function node to check. + * @returns {void} + */ + function endChecking(node) { + if (!node.generator) { + return; + } + + var countYield = stack.pop(); + + if (countYield === 0 && node.body.body.length > 0) { + context.report( + node, + "This generator function does not have 'yield'."); + } + } + + return { + "FunctionDeclaration": beginChecking, + "FunctionDeclaration:exit": endChecking, + "FunctionExpression": beginChecking, + "FunctionExpression:exit": endChecking, + + // Increases the count of `yield` keyword. + "YieldExpression": function() { + + /* istanbul ignore else */ + if (stack.length > 0) { + stack[stack.length - 1] += 1; + } + } + }; +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/semi-spacing.js b/tools/eslint/lib/rules/semi-spacing.js index fddebfcf3296fa..37fbc6f3c5cc0c 100644 --- a/tools/eslint/lib/rules/semi-spacing.js +++ b/tools/eslint/lib/rules/semi-spacing.js @@ -6,15 +6,18 @@ "use strict"; +var astUtils = require("../ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ -module.exports = function (context) { +module.exports = function(context) { var config = context.options[0], requireSpaceBefore = false, - requireSpaceAfter = true; + requireSpaceAfter = true, + sourceCode = context.getSourceCode(); if (typeof config === "object") { if (config.hasOwnProperty("before")) { @@ -25,27 +28,6 @@ module.exports = function (context) { } } - /** - * Determines whether two adjacent tokens have whitespace between them. - * @param {Object} left - The left token object. - * @param {Object} right - The right token object. - * @returns {boolean} Whether or not there is space between the tokens. - */ - function isSpaced(left, right) { - return left.range[1] < right.range[0]; - } - - /** - * Checks whether two tokens are on the same line. - * @param {Object} left The leftmost token. - * @param {Object} right The rightmost token. - * @returns {boolean} True if the tokens are on the same line, false if not. - * @private - */ - function isSameLine(left, right) { - return left.loc.end.line === right.loc.start.line; - } - /** * Checks if a given token has leading whitespace. * @param {Object} token The token to check. @@ -53,7 +35,8 @@ module.exports = function (context) { */ function hasLeadingSpace(token) { var tokenBefore = context.getTokenBefore(token); - return tokenBefore && isSameLine(tokenBefore, token) && isSpaced(tokenBefore, token); + + return tokenBefore && astUtils.isTokenOnSameLine(tokenBefore, token) && sourceCode.isSpaceBetweenTokens(tokenBefore, token); } /** @@ -63,7 +46,8 @@ module.exports = function (context) { */ function hasTrailingSpace(token) { var tokenAfter = context.getTokenAfter(token); - return tokenAfter && isSameLine(token, tokenAfter) && isSpaced(token, tokenAfter); + + return tokenAfter && astUtils.isTokenOnSameLine(token, tokenAfter) && sourceCode.isSpaceBetweenTokens(token, tokenAfter); } /** @@ -73,7 +57,34 @@ module.exports = function (context) { */ function isLastTokenInCurrentLine(token) { var tokenAfter = context.getTokenAfter(token); - return !(tokenAfter && isSameLine(token, tokenAfter)); + + return !(tokenAfter && astUtils.isTokenOnSameLine(token, tokenAfter)); + } + + /** + * Checks if the given token is the first token in its line + * @param {Token} token The token to check. + * @returns {boolean} Whether or not the token is the first in its line. + */ + function isFirstTokenInCurrentLine(token) { + var tokenBefore = context.getTokenBefore(token); + + return !(tokenBefore && astUtils.isTokenOnSameLine(token, tokenBefore)); + } + + /** + * Checks if the next token of a given token is a closing parenthesis. + * @param {Token} token The token to check. + * @returns {boolean} Whether or not the next token of a given token is a closing parenthesis. + */ + function isBeforeClosingParen(token) { + var nextToken = context.getTokenAfter(token); + + return ( + nextToken && + nextToken.type === "Punctuator" && + (nextToken.value === "}" || nextToken.value === ")") + ); } /** @@ -99,22 +110,54 @@ module.exports = function (context) { if (hasLeadingSpace(token)) { if (!requireSpaceBefore) { - context.report(node, location, "Unexpected whitespace before semicolon."); + context.report({ + node: node, + loc: location, + message: "Unexpected whitespace before semicolon.", + fix: function(fixer) { + var tokenBefore = context.getTokenBefore(token); + + return fixer.removeRange([tokenBefore.range[1], token.range[0]]); + } + }); } } else { if (requireSpaceBefore) { - context.report(node, location, "Missing whitespace before semicolon."); + context.report({ + node: node, + loc: location, + message: "Missing whitespace before semicolon.", + fix: function(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); } } - if (!isLastTokenInCurrentLine(token)) { + if (!isFirstTokenInCurrentLine(token) && !isLastTokenInCurrentLine(token) && !isBeforeClosingParen(token)) { if (hasTrailingSpace(token)) { if (!requireSpaceAfter) { - context.report(node, location, "Unexpected whitespace after semicolon."); + context.report({ + node: node, + loc: location, + message: "Unexpected whitespace after semicolon.", + fix: function(fixer) { + var tokenAfter = context.getTokenAfter(token); + + return fixer.removeRange([token.range[1], tokenAfter.range[0]]); + } + }); } } else { if (requireSpaceAfter) { - context.report(node, location, "Missing whitespace after semicolon."); + context.report({ + node: node, + loc: location, + message: "Missing whitespace after semicolon.", + fix: function(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); } } } @@ -128,6 +171,7 @@ module.exports = function (context) { */ function checkNode(node) { var token = context.getLastToken(node); + checkSemicolonSpacing(token, node); } @@ -139,7 +183,7 @@ module.exports = function (context) { "DebuggerStatement": checkNode, "ReturnStatement": checkNode, "ThrowStatement": checkNode, - "ForStatement": function (node) { + "ForStatement": function(node) { if (node.init) { checkSemicolonSpacing(context.getTokenAfter(node.init), node); } diff --git a/tools/eslint/lib/rules/semi.js b/tools/eslint/lib/rules/semi.js index 7cd19632f55ba3..2986f406e64b13 100644 --- a/tools/eslint/lib/rules/semi.js +++ b/tools/eslint/lib/rules/semi.js @@ -1,17 +1,22 @@ /** * @fileoverview Rule to flag missing semicolons. * @author Nicholas C. Zakas + * @copyright 2013 Nicholas C. Zakas. All rights reserved. + * See LICENSE file in root directory for full license. */ "use strict"; //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ + module.exports = function(context) { var OPT_OUT_PATTERN = /[\[\(\/\+\-]/; // One of [(/+- - - var always = context.options[0] !== "never"; + var options = context.options[1]; + var never = context.options[0] === "never", + exceptOneLine = options && options.omitLastInOneLineBlock === true, + sourceCode = context.getSourceCode(); //-------------------------------------------------------------------------- // Helpers @@ -20,11 +25,36 @@ module.exports = function(context) { /** * Reports a semicolon error with appropriate location and message. * @param {ASTNode} node The node with an extra or missing semicolon. + * @param {boolean} missing True if the semicolon is missing. * @returns {void} */ - function report(node) { - var message = always ? "Missing semicolon." : "Extra semicolon."; - context.report(node, context.getLastToken(node).loc.end, message); + function report(node, missing) { + var message, + fix, + lastToken = sourceCode.getLastToken(node), + loc = lastToken.loc; + + if (!missing) { + message = "Missing semicolon."; + loc = loc.end; + fix = function(fixer) { + return fixer.insertTextAfter(lastToken, ";"); + }; + } else { + message = "Extra semicolon."; + loc = loc.start; + fix = function(fixer) { + return fixer.remove(lastToken); + }; + } + + context.report({ + node: node, + loc: loc, + message: message, + fix: fix + }); + } /** @@ -64,6 +94,24 @@ module.exports = function(context) { return (lastTokenLine !== nextTokenLine && !isOptOutToken) || isDivider; } + /** + * Checks a node to see if it's in a one-liner block statement. + * @param {ASTNode} node The node to check. + * @returns {boolean} whether the node is in a one-liner block statement. + */ + function isOneLinerBlock(node) { + var nextToken = context.getTokenAfter(node); + + if (!nextToken || nextToken.value !== "}") { + return false; + } + + var parent = node.parent; + + return parent && parent.type === "BlockStatement" && + parent.loc.start.line === parent.loc.end.line; + } + /** * Checks a node to see if it's followed by a semicolon. * @param {ASTNode} node The node to check. @@ -72,13 +120,19 @@ module.exports = function(context) { function checkForSemicolon(node) { var lastToken = context.getLastToken(node); - if (always) { - if (!isSemicolon(lastToken)) { - report(node); + if (never) { + if (isUnnecessarySemicolon(lastToken)) { + report(node, true); } } else { - if (isUnnecessarySemicolon(lastToken)) { - report(node); + if (!isSemicolon(lastToken)) { + if (!exceptOneLine || !isOneLinerBlock(node)) { + report(node); + } + } else { + if (exceptOneLine && isOneLinerBlock(node)) { + report(node, true); + } } } } @@ -105,22 +159,22 @@ module.exports = function(context) { //-------------------------------------------------------------------------- return { - "VariableDeclaration": checkForSemicolonForVariableDeclaration, "ExpressionStatement": checkForSemicolon, "ReturnStatement": checkForSemicolon, "ThrowStatement": checkForSemicolon, + "DoWhileStatement": checkForSemicolon, "DebuggerStatement": checkForSemicolon, "BreakStatement": checkForSemicolon, "ContinueStatement": checkForSemicolon, "ImportDeclaration": checkForSemicolon, "ExportAllDeclaration": checkForSemicolon, - "ExportNamedDeclaration": function (node) { + "ExportNamedDeclaration": function(node) { if (!node.declaration) { checkForSemicolon(node); } }, - "ExportDefaultDeclaration": function (node) { + "ExportDefaultDeclaration": function(node) { if (!/(?:Class|Function)Declaration/.test(node.declaration.type)) { checkForSemicolon(node); } @@ -129,8 +183,34 @@ module.exports = function(context) { }; -module.exports.schema = [ - { - "enum": ["always", "never"] - } -]; +module.exports.schema = { + "anyOf": [ + { + "type": "array", + "items": [ + { + "enum": ["never"] + } + ], + "minItems": 0, + "maxItems": 1 + }, + { + "type": "array", + "items": [ + { + "enum": ["always"] + }, + { + "type": "object", + "properties": { + "omitLastInOneLineBlock": {"type": "boolean"} + }, + "additionalProperties": false + } + ], + "minItems": 0, + "maxItems": 2 + } + ] +}; diff --git a/tools/eslint/lib/rules/sort-imports.js b/tools/eslint/lib/rules/sort-imports.js new file mode 100644 index 00000000000000..4e8807cedb725e --- /dev/null +++ b/tools/eslint/lib/rules/sort-imports.js @@ -0,0 +1,167 @@ +/** + * @fileoverview Rule to require sorting of import declarations + * @author Christian Schuller + * @copyright 2015 Christian Schuller. All rights reserved. + * See LICENSE file in root directory for full license. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + + var configuration = context.options[0] || {}, + ignoreCase = configuration.ignoreCase || false, + ignoreMemberSort = configuration.ignoreMemberSort || false, + memberSyntaxSortOrder = configuration.memberSyntaxSortOrder || ["none", "all", "multiple", "single"], + previousDeclaration = null; + + /** + * Gets the used member syntax style. + * + * import "my-module.js" --> none + * import * as myModule from "my-module.js" --> all + * import {myMember} from "my-module.js" --> single + * import {foo, bar} from "my-module.js" --> multiple + * + * @param {ASTNode} node - the ImportDeclaration node. + * @returns {string} used member parameter style, ["all", "multiple", "single"] + */ + function usedMemberSyntax(node) { + if (node.specifiers.length === 0) { + return "none"; + } else if (node.specifiers[0].type === "ImportNamespaceSpecifier") { + return "all"; + } else if (node.specifiers.length === 1) { + return "single"; + } else { + return "multiple"; + } + } + + /** + * Gets the group by member parameter index for given declaration. + * @param {ASTNode} node - the ImportDeclaration node. + * @returns {number} the declaration group by member index. + */ + function getMemberParameterGroupIndex(node) { + return memberSyntaxSortOrder.indexOf(usedMemberSyntax(node)); + } + + /** + * Gets the local name of the first imported module. + * @param {ASTNode} node - the ImportDeclaration node. + * @returns {?string} the local name of the first imported module. + */ + function getFirstLocalMemberName(node) { + if (node.specifiers[0]) { + return node.specifiers[0].local.name; + } else { + return null; + } + } + + return { + "ImportDeclaration": function(node) { + if (previousDeclaration) { + var currentLocalMemberName = getFirstLocalMemberName(node), + currentMemberSyntaxGroupIndex = getMemberParameterGroupIndex(node), + previousLocalMemberName = getFirstLocalMemberName(previousDeclaration), + previousMemberSyntaxGroupIndex = getMemberParameterGroupIndex(previousDeclaration); + + if (ignoreCase) { + previousLocalMemberName = previousLocalMemberName && previousLocalMemberName.toLowerCase(); + currentLocalMemberName = currentLocalMemberName && currentLocalMemberName.toLowerCase(); + } + + // When the current declaration uses a different member syntax, + // then check if the ordering is correct. + // Otherwise, make a default string compare (like rule sort-vars to be consistent) of the first used local member name. + if (currentMemberSyntaxGroupIndex !== previousMemberSyntaxGroupIndex) { + if (currentMemberSyntaxGroupIndex < previousMemberSyntaxGroupIndex) { + context.report({ + node: node, + message: "Expected '{{syntaxA}}' syntax before '{{syntaxB}}' syntax.", + data: { + syntaxA: memberSyntaxSortOrder[currentMemberSyntaxGroupIndex], + syntaxB: memberSyntaxSortOrder[previousMemberSyntaxGroupIndex] + } + }); + } + } else { + if (previousLocalMemberName && + currentLocalMemberName && + currentLocalMemberName < previousLocalMemberName + ) { + context.report({ + node: node, + message: "Imports should be sorted alphabetically." + }); + } + } + } + + // Multiple members of an import declaration should also be sorted alphabetically. + if (!ignoreMemberSort && node.specifiers.length > 1) { + var previousSpecifier = null; + var previousSpecifierName = null; + + for (var i = 0; i < node.specifiers.length; ++i) { + var currentSpecifier = node.specifiers[i]; + + if (currentSpecifier.type !== "ImportSpecifier") { + continue; + } + + var currentSpecifierName = currentSpecifier.local.name; + + if (ignoreCase) { + currentSpecifierName = currentSpecifierName.toLowerCase(); + } + + if (previousSpecifier && currentSpecifierName < previousSpecifierName) { + context.report({ + node: currentSpecifier, + message: "Member '{{memberName}}' of the import declaration should be sorted alphabetically.", + data: { + memberName: currentSpecifier.local.name + } + }); + } + + previousSpecifier = currentSpecifier; + previousSpecifierName = currentSpecifierName; + } + } + + previousDeclaration = node; + } + }; +}; + +module.exports.schema = [ + { + "type": "object", + "properties": { + "ignoreCase": { + "type": "boolean" + }, + "memberSyntaxSortOrder": { + "type": "array", + "items": { + "enum": ["none", "all", "multiple", "single"] + }, + "uniqueItems": true, + "minItems": 4, + "maxItems": 4 + }, + "ignoreMemberSort": { + "type": "boolean" + } + }, + "additionalProperties": false + } +]; diff --git a/tools/eslint/lib/rules/sort-vars.js b/tools/eslint/lib/rules/sort-vars.js index 0a699f2ccda3a4..9aa85c8cbd09e2 100644 --- a/tools/eslint/lib/rules/sort-vars.js +++ b/tools/eslint/lib/rules/sort-vars.js @@ -17,6 +17,10 @@ module.exports = function(context) { return { "VariableDeclaration": function(node) { node.declarations.reduce(function(memo, decl) { + if (decl.id.type === "ObjectPattern" || decl.id.type === "ArrayPattern") { + return memo; + } + var lastVariableName = memo.id.name, currenVariableName = decl.id.name; diff --git a/tools/eslint/lib/rules/space-after-function-name.js b/tools/eslint/lib/rules/space-after-function-name.js deleted file mode 100644 index 15d2286a2ad552..00000000000000 --- a/tools/eslint/lib/rules/space-after-function-name.js +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @fileoverview Rule to enforce consistent spacing after function names - * @author Roberto Vidal - * @copyright 2014 Roberto Vidal. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var requiresSpace = context.options[0] === "always"; - - /** - * Reports if the give named function node has the correct spacing after its name - * - * @param {ASTNode} node The node to which the potential problem belongs. - * @returns {void} - */ - function check(node) { - var tokens = context.getFirstTokens(node, 3), - hasSpace = tokens[1].range[1] < tokens[2].range[0]; - - if (hasSpace !== requiresSpace) { - context.report(node, "Function name \"{{name}}\" must {{not}}be followed by whitespace.", { - name: node.id.name, - not: requiresSpace ? "" : "not " - }); - } - } - - return { - "FunctionDeclaration": check, - "FunctionExpression": function (node) { - if (node.id) { - check(node); - } - } - }; - -}; - -module.exports.schema = [ - { - "enum": ["always", "never"] - } -]; diff --git a/tools/eslint/lib/rules/space-after-keywords.js b/tools/eslint/lib/rules/space-after-keywords.js deleted file mode 100644 index 007f80ca7158a8..00000000000000 --- a/tools/eslint/lib/rules/space-after-keywords.js +++ /dev/null @@ -1,82 +0,0 @@ -/** - * @fileoverview Rule to enforce the number of spaces after certain keywords - * @author Nick Fisher - * @copyright 2014 Nick Fisher. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - // unless the first option is `"never"`, then a space is required - var requiresSpace = context.options[0] !== "never"; - - /** - * Check if the separation of two adjacent tokens meets the spacing rules, and report a problem if not. - * - * @param {ASTNode} node The node to which the potential problem belongs. - * @param {Token} left The first token. - * @param {Token} right The second token - * @returns {void} - */ - function checkTokens(node, left, right) { - var hasSpace = left.range[1] < right.range[0], - value = left.value; - - if (hasSpace !== requiresSpace) { - context.report(node, "Keyword \"{{value}}\" must {{not}}be followed by whitespace.", { - value: value, - not: requiresSpace ? "" : "not " - }); - } - } - - /** - * Check if the given node (`if`, `for`, `while`, etc), has the correct spacing after it. - * @param {ASTNode} node The node to check. - * @returns {void} - */ - function check(node) { - var tokens = context.getFirstTokens(node, 2); - checkTokens(node, tokens[0], tokens[1]); - } - - return { - "IfStatement": function (node) { - check(node); - // check the `else` - if (node.alternate && node.alternate.type !== "IfStatement") { - checkTokens(node.alternate, context.getTokenBefore(node.alternate), context.getFirstToken(node.alternate)); - } - }, - "ForStatement": check, - "ForOfStatement": check, - "ForInStatement": check, - "WhileStatement": check, - "DoWhileStatement": function (node) { - check(node); - // check the `while` - var whileTokens = context.getTokensAfter(node.body, 2); - checkTokens(node, whileTokens[0], whileTokens[1]); - }, - "SwitchStatement": check, - "TryStatement": function (node) { - check(node); - // check the `finally` - if (node.finalizer) { - checkTokens(node.finalizer, context.getTokenBefore(node.finalizer), context.getFirstToken(node.finalizer)); - } - }, - "CatchStatement": check, - "WithStatement": check - }; -}; - -module.exports.schema = [ - { - "enum": ["always", "never"] - } -]; diff --git a/tools/eslint/lib/rules/space-before-blocks.js b/tools/eslint/lib/rules/space-before-blocks.js index 799770537dd122..c7fbec83316172 100644 --- a/tools/eslint/lib/rules/space-before-blocks.js +++ b/tools/eslint/lib/rules/space-before-blocks.js @@ -6,31 +6,38 @@ "use strict"; +var astUtils = require("../ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ -module.exports = function (context) { - var requireSpace = context.options[0] !== "never"; +module.exports = function(context) { + var config = context.options[0], + sourceCode = context.getSourceCode(), + checkFunctions = true, + checkKeywords = true, + checkClasses = true; - /** - * Determines whether two adjacent tokens are have whitespace between them. - * @param {Object} left - The left token object. - * @param {Object} right - The right token object. - * @returns {boolean} Whether or not there is space between the tokens. - */ - function isSpaced(left, right) { - return left.range[1] < right.range[0]; + if (typeof config === "object") { + checkFunctions = config.functions !== "never"; + checkKeywords = config.keywords !== "never"; + checkClasses = config.classes !== "never"; + } else if (config === "never") { + checkFunctions = false; + checkKeywords = false; + checkClasses = false; } /** - * Determines whether two adjacent tokens are on the same line. - * @param {Object} left - The left token object. - * @param {Object} right - The right token object. - * @returns {boolean} Whether or not the tokens are on the same line. + * Checks whether or not a given token is an arrow operator (=>) or a keyword + * in order to avoid to conflict with `arrow-spacing` and `keyword-spacing`. + * + * @param {Token} token - A token to check. + * @returns {boolean} `true` if the token is an arrow operator. */ - function isSameLine(left, right) { - return left.loc.start.line === right.loc.start.line; + function isConflicted(token) { + return (token.type === "Punctuator" && token.value === "=>") || token.type === "Keyword"; } /** @@ -40,18 +47,40 @@ module.exports = function (context) { */ function checkPrecedingSpace(node) { var precedingToken = context.getTokenBefore(node), - hasSpace; + hasSpace, + parent, + requireSpace; - if (precedingToken && isSameLine(precedingToken, node)) { - hasSpace = isSpaced(precedingToken, node); + if (precedingToken && !isConflicted(precedingToken) && astUtils.isTokenOnSameLine(precedingToken, node)) { + hasSpace = sourceCode.isSpaceBetweenTokens(precedingToken, node); + parent = context.getAncestors().pop(); + if (parent.type === "FunctionExpression" || parent.type === "FunctionDeclaration") { + requireSpace = checkFunctions; + } else if (node.type === "ClassBody") { + requireSpace = checkClasses; + } else { + requireSpace = checkKeywords; + } if (requireSpace) { if (!hasSpace) { - context.report(node, "Missing space before opening brace."); + context.report({ + node: node, + message: "Missing space before opening brace.", + fix: function(fixer) { + return fixer.insertTextBefore(node, " "); + } + }); } } else { if (hasSpace) { - context.report(node, "Unexpected space before opening brace."); + context.report({ + node: node, + message: "Unexpected space before opening brace.", + fix: function(fixer) { + return fixer.removeRange([precedingToken.range[1], node.range[0]]); + } + }); } } } @@ -79,6 +108,7 @@ module.exports = function (context) { return { "BlockStatement": checkPrecedingSpace, + "ClassBody": checkPrecedingSpace, "SwitchStatement": checkSpaceBeforeCaseBlock }; @@ -86,6 +116,25 @@ module.exports = function (context) { module.exports.schema = [ { - "enum": ["always", "never"] + "oneOf": [ + { + "enum": ["always", "never"] + }, + { + "type": "object", + "properties": { + "keywords": { + "enum": ["always", "never"] + }, + "functions": { + "enum": ["always", "never"] + }, + "classes": { + "enum": ["always", "never"] + } + }, + "additionalProperties": false + } + ] } ]; diff --git a/tools/eslint/lib/rules/space-before-function-paren.js b/tools/eslint/lib/rules/space-before-function-paren.js index fde281c88cb37b..b96acb6678c42e 100644 --- a/tools/eslint/lib/rules/space-before-function-paren.js +++ b/tools/eslint/lib/rules/space-before-function-paren.js @@ -2,6 +2,7 @@ * @fileoverview Rule to validate spacing before function paren. * @author Mathias Schreck * @copyright 2015 Mathias Schreck + * See LICENSE in root directory for full license. */ "use strict"; @@ -12,6 +13,7 @@ module.exports = function(context) { var configuration = context.options[0], + sourceCode = context.getSourceCode(), requireAnonymousFunctionSpacing = true, requireNamedFunctionSpacing = true; @@ -23,16 +25,6 @@ module.exports = function(context) { requireNamedFunctionSpacing = false; } - /** - * Determines whether two adjacent tokens are have whitespace between them. - * @param {Object} left - The left token object. - * @param {Object} right - The right token object. - * @returns {boolean} Whether or not there is space between the tokens. - */ - function isSpaced(left, right) { - return left.range[1] < right.range[0]; - } - /** * Determines whether a function has a name. * @param {ASTNode} node The function node. @@ -45,7 +37,7 @@ module.exports = function(context) { return true; } - parent = context.getAncestors().pop(); + parent = node.parent; return parent.type === "MethodDefinition" || (parent.type === "Property" && ( @@ -63,7 +55,6 @@ module.exports = function(context) { */ function validateSpacingBeforeParentheses(node) { var isNamed = isNamedFunction(node), - tokens, leftToken, rightToken, location; @@ -72,40 +63,34 @@ module.exports = function(context) { return; } - tokens = context.getTokens(node); - - if (node.generator) { - if (node.id) { - leftToken = tokens[2]; - rightToken = tokens[3]; - } else { - // Object methods are named but don't have an id - leftToken = context.getTokenBefore(node); - rightToken = tokens[0]; - } - } else if (isNamed) { - if (node.id) { - leftToken = tokens[1]; - rightToken = tokens[2]; - } else { - // Object methods are named but don't have an id - leftToken = context.getTokenBefore(node); - rightToken = tokens[0]; - } - } else { - leftToken = tokens[0]; - rightToken = tokens[1]; + rightToken = sourceCode.getFirstToken(node); + while (rightToken.value !== "(") { + rightToken = sourceCode.getTokenAfter(rightToken); } - + leftToken = context.getTokenBefore(rightToken); location = leftToken.loc.end; - if (isSpaced(leftToken, rightToken)) { + if (sourceCode.isSpaceBetweenTokens(leftToken, rightToken)) { if ((isNamed && !requireNamedFunctionSpacing) || (!isNamed && !requireAnonymousFunctionSpacing)) { - context.report(node, location, "Unexpected space before function parentheses."); + context.report({ + node: node, + loc: location, + message: "Unexpected space before function parentheses.", + fix: function(fixer) { + return fixer.removeRange([leftToken.range[1], rightToken.range[0]]); + } + }); } } else { if ((isNamed && requireNamedFunctionSpacing) || (!isNamed && requireAnonymousFunctionSpacing)) { - context.report(node, location, "Missing space before function parentheses."); + context.report({ + node: node, + loc: location, + message: "Missing space before function parentheses.", + fix: function(fixer) { + return fixer.insertTextAfter(leftToken, " "); + } + }); } } } diff --git a/tools/eslint/lib/rules/space-before-function-parentheses.js b/tools/eslint/lib/rules/space-before-function-parentheses.js deleted file mode 100644 index 9d275c62887756..00000000000000 --- a/tools/eslint/lib/rules/space-before-function-parentheses.js +++ /dev/null @@ -1,139 +0,0 @@ -/** - * @fileoverview Rule to validate spacing before function parentheses. - * @author Mathias Schreck - * @copyright 2015 Mathias Schreck - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var configuration = context.options[0], - requireAnonymousFunctionSpacing = true, - requireNamedFunctionSpacing = true; - - if (typeof configuration === "object") { - requireAnonymousFunctionSpacing = configuration.anonymous !== "never"; - requireNamedFunctionSpacing = configuration.named !== "never"; - } else if (configuration === "never") { - requireAnonymousFunctionSpacing = false; - requireNamedFunctionSpacing = false; - } - - /** - * Determines whether two adjacent tokens are have whitespace between them. - * @param {Object} left - The left token object. - * @param {Object} right - The right token object. - * @returns {boolean} Whether or not there is space between the tokens. - */ - function isSpaced(left, right) { - return left.range[1] < right.range[0]; - } - - /** - * Determines whether a function has a name. - * @param {ASTNode} node The function node. - * @returns {boolean} Whether the function has a name. - */ - function isNamedFunction(node) { - var parent; - - if (node.id) { - return true; - } - - parent = context.getAncestors().pop(); - return parent.type === "MethodDefinition" || - (parent.type === "Property" && - ( - parent.kind === "get" || - parent.kind === "set" || - parent.method - ) - ); - } - - /** - * Validates the spacing before function parentheses. - * @param {ASTNode} node The node to be validated. - * @returns {void} - */ - function validateSpacingBeforeParentheses(node) { - var isNamed = isNamedFunction(node), - tokens, - leftToken, - rightToken, - location; - - if (node.generator && !isNamed) { - return; - } - - tokens = context.getTokens(node); - - if (node.generator) { - if (node.id) { - leftToken = tokens[2]; - rightToken = tokens[3]; - } else { - // Object methods are named but don't have an id - leftToken = context.getTokenBefore(node); - rightToken = tokens[0]; - } - } else if (isNamed) { - if (node.id) { - leftToken = tokens[1]; - rightToken = tokens[2]; - } else { - // Object methods are named but don't have an id - leftToken = context.getTokenBefore(node); - rightToken = tokens[0]; - } - } else { - leftToken = tokens[0]; - rightToken = tokens[1]; - } - - location = leftToken.loc.end; - - if (isSpaced(leftToken, rightToken)) { - if ((isNamed && !requireNamedFunctionSpacing) || (!isNamed && !requireAnonymousFunctionSpacing)) { - context.report(node, location, "Unexpected space before function parentheses."); - } - } else { - if ((isNamed && requireNamedFunctionSpacing) || (!isNamed && requireAnonymousFunctionSpacing)) { - context.report(node, location, "Missing space before function parentheses."); - } - } - } - - return { - "FunctionDeclaration": validateSpacingBeforeParentheses, - "FunctionExpression": validateSpacingBeforeParentheses - }; -}; - -module.exports.schema = [ - { - "oneOf": [ - { - "enum": ["always", "never"] - }, - { - "type": "object", - "properties": { - "anonymous": { - "enum": ["always", "never"] - }, - "named": { - "enum": ["always", "never"] - } - }, - "additionalProperties": false - } - ] - } -]; diff --git a/tools/eslint/lib/rules/space-in-brackets.js b/tools/eslint/lib/rules/space-in-brackets.js deleted file mode 100644 index aac889c95d262c..00000000000000 --- a/tools/eslint/lib/rules/space-in-brackets.js +++ /dev/null @@ -1,305 +0,0 @@ -/** - * @fileoverview Disallows or enforces spaces inside of brackets. - * @author Ian Christian Myers - * @copyright 2014 Brandyn Bennett. All rights reserved. - * @copyright 2014 Michael Ficarra. No rights reserved. - * @copyright 2014 Vignesh Anand. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var spaced = context.options[0] === "always"; - - /** - * Determines whether an option is set, relative to the spacing option. - * If spaced is "always", then check whether option is set to false. - * If spaced is "never", then check whether option is set to true. - * @param {Object} option - The option to exclude. - * @returns {boolean} Whether or not the property is excluded. - */ - function isOptionSet(option) { - return context.options[1] != null ? context.options[1][option] === !spaced : false; - } - - var options = { - spaced: spaced, - singleElementException: isOptionSet("singleValue"), - objectsInArraysException: isOptionSet("objectsInArrays"), - arraysInArraysException: isOptionSet("arraysInArrays"), - arraysInObjectsException: isOptionSet("arraysInObjects"), - objectsInObjectsException: isOptionSet("objectsInObjects"), - propertyNameException: isOptionSet("propertyName") - }; - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Determines whether two adjacent tokens are have whitespace between them. - * @param {Object} left - The left token object. - * @param {Object} right - The right token object. - * @returns {boolean} Whether or not there is space between the tokens. - */ - function isSpaced(left, right) { - return left.range[1] < right.range[0]; - } - - /** - * Determines whether two adjacent tokens are on the same line. - * @param {Object} left - The left token object. - * @param {Object} right - The right token object. - * @returns {boolean} Whether or not the tokens are on the same line. - */ - function isSameLine(left, right) { - return left.loc.start.line === right.loc.start.line; - } - - /** - * Reports that there shouldn't be a space after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportNoBeginningSpace(node, token) { - context.report(node, token.loc.start, - "There should be no space after '" + token.value + "'"); - } - - /** - * Reports that there shouldn't be a space before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportNoEndingSpace(node, token) { - context.report(node, token.loc.start, - "There should be no space before '" + token.value + "'"); - } - - /** - * Reports that there should be a space after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportRequiredBeginningSpace(node, token) { - context.report(node, token.loc.start, - "A space is required after '" + token.value + "'"); - } - - /** - * Reports that there should be a space before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportRequiredEndingSpace(node, token) { - context.report(node, token.loc.start, - "A space is required before '" + token.value + "'"); - } - - - /** - * Determines if spacing in curly braces is valid. - * @param {ASTNode} node The AST node to check. - * @param {Token} first The first token to check (should be the opening brace) - * @param {Token} second The second token to check (should be first after the opening brace) - * @param {Token} penultimate The penultimate token to check (should be last before closing brace) - * @param {Token} last The last token to check (should be closing brace) - * @returns {void} - */ - function validateBraceSpacing(node, first, second, penultimate, last) { - var closingCurlyBraceMustBeSpaced = - options.arraysInObjectsException && penultimate.value === "]" || - options.objectsInObjectsException && penultimate.value === "}" - ? !options.spaced : options.spaced; - - if (isSameLine(first, second)) { - if (options.spaced && !isSpaced(first, second)) { - reportRequiredBeginningSpace(node, first); - } - if (!options.spaced && isSpaced(first, second)) { - reportNoBeginningSpace(node, first); - } - } - - if (isSameLine(penultimate, last)) { - if (closingCurlyBraceMustBeSpaced && !isSpaced(penultimate, last)) { - reportRequiredEndingSpace(node, last); - } - if (!closingCurlyBraceMustBeSpaced && isSpaced(penultimate, last)) { - reportNoEndingSpace(node, last); - } - } - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - - MemberExpression: function(node) { - if (!node.computed) { - return; - } - - var property = node.property, - before = context.getTokenBefore(property), - first = context.getFirstToken(property), - last = context.getLastToken(property), - after = context.getTokenAfter(property); - - var propertyNameMustBeSpaced = options.propertyNameException ? - !options.spaced : options.spaced; - - if (isSameLine(before, first)) { - if (propertyNameMustBeSpaced) { - if (!isSpaced(before, first) && isSameLine(before, first)) { - reportRequiredBeginningSpace(node, before); - } - } else { - if (isSpaced(before, first)) { - reportNoBeginningSpace(node, before); - } - } - } - - if (isSameLine(last, after)) { - if (propertyNameMustBeSpaced) { - if (!isSpaced(last, after) && isSameLine(last, after)) { - reportRequiredEndingSpace(node, after); - } - } else { - if (isSpaced(last, after)) { - reportNoEndingSpace(node, after); - } - } - } - }, - - ArrayExpression: function(node) { - if (node.elements.length === 0) { - return; - } - - var first = context.getFirstToken(node), - second = context.getFirstToken(node, 1), - penultimate = context.getLastToken(node, 1), - last = context.getLastToken(node); - - var openingBracketMustBeSpaced = - options.objectsInArraysException && second.value === "{" || - options.arraysInArraysException && second.value === "[" || - options.singleElementException && node.elements.length === 1 - ? !options.spaced : options.spaced; - - var closingBracketMustBeSpaced = - options.objectsInArraysException && penultimate.value === "}" || - options.arraysInArraysException && penultimate.value === "]" || - options.singleElementException && node.elements.length === 1 - ? !options.spaced : options.spaced; - - if (isSameLine(first, second)) { - if (openingBracketMustBeSpaced && !isSpaced(first, second)) { - reportRequiredBeginningSpace(node, first); - } - if (!openingBracketMustBeSpaced && isSpaced(first, second)) { - reportNoBeginningSpace(node, first); - } - } - - if (isSameLine(penultimate, last)) { - if (closingBracketMustBeSpaced && !isSpaced(penultimate, last)) { - reportRequiredEndingSpace(node, last); - } - if (!closingBracketMustBeSpaced && isSpaced(penultimate, last)) { - reportNoEndingSpace(node, last); - } - } - }, - - ImportDeclaration: function(node) { - - var firstSpecifier = node.specifiers[0], - lastSpecifier = node.specifiers[node.specifiers.length - 1]; - - // don't do anything for namespace or default imports - if (firstSpecifier && lastSpecifier && firstSpecifier.type === "ImportSpecifier" && lastSpecifier.type === "ImportSpecifier") { - var first = context.getTokenBefore(firstSpecifier), - second = context.getFirstToken(firstSpecifier), - penultimate = context.getLastToken(lastSpecifier), - last = context.getTokenAfter(lastSpecifier); - - validateBraceSpacing(node, first, second, penultimate, last); - } - - }, - - ExportNamedDeclaration: function(node) { - if (!node.specifiers.length) { - return; - } - - var firstSpecifier = node.specifiers[0], - lastSpecifier = node.specifiers[node.specifiers.length - 1], - first = context.getTokenBefore(firstSpecifier), - second = context.getFirstToken(firstSpecifier), - penultimate = context.getLastToken(lastSpecifier), - last = context.getTokenAfter(lastSpecifier); - - validateBraceSpacing(node, first, second, penultimate, last); - - }, - - ObjectExpression: function(node) { - if (node.properties.length === 0) { - return; - } - - var first = context.getFirstToken(node), - second = context.getFirstToken(node, 1), - penultimate = context.getLastToken(node, 1), - last = context.getLastToken(node); - - validateBraceSpacing(node, first, second, penultimate, last); - } - - }; - -}; - -module.exports.schema = [ - { - "enum": ["always", "never"] - }, - { - "type": "object", - "properties": { - "singleValue": { - "type": "boolean" - }, - "objectsInArrays": { - "type": "boolean" - }, - "arraysInArrays": { - "type": "boolean" - }, - "arraysInObjects": { - "type": "boolean" - }, - "objectsInObjects": { - "type": "boolean" - }, - "propertyName": { - "type": "boolean" - } - }, - "additionalProperties": false - } -]; diff --git a/tools/eslint/lib/rules/space-in-parens.js b/tools/eslint/lib/rules/space-in-parens.js index 407d763b322953..bd15a41f3c66ba 100644 --- a/tools/eslint/lib/rules/space-in-parens.js +++ b/tools/eslint/lib/rules/space-in-parens.js @@ -6,6 +6,8 @@ */ "use strict"; +var astUtils = require("../ast-utils"); + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ @@ -14,249 +16,237 @@ module.exports = function(context) { var MISSING_SPACE_MESSAGE = "There must be a space inside this paren.", REJECTED_SPACE_MESSAGE = "There should be no spaces inside this paren.", - exceptionsArray = (context.options.length === 2) ? context.options[1].exceptions : [], + ALWAYS = context.options[0] === "always", + + exceptionsArrayOptions = (context.options.length === 2) ? context.options[1].exceptions : [], options = {}, - rejectedSpaceRegExp, - missingSpaceRegExp, - spaceChecks; - - if (exceptionsArray && exceptionsArray.length) { - options.braceException = exceptionsArray.indexOf("{}") !== -1 || false; - options.bracketException = exceptionsArray.indexOf("[]") !== -1 || false; - options.parenException = exceptionsArray.indexOf("()") !== -1 || false; - options.empty = exceptionsArray.indexOf("empty") !== -1 || false; + exceptions; + + if (exceptionsArrayOptions.length) { + options.braceException = exceptionsArrayOptions.indexOf("{}") !== -1; + options.bracketException = exceptionsArrayOptions.indexOf("[]") !== -1; + options.parenException = exceptionsArrayOptions.indexOf("()") !== -1; + options.empty = exceptionsArrayOptions.indexOf("empty") !== -1; } /** - * Used with the `never` option to produce, given the exception options, - * two regular expressions to check for missing and rejected spaces. + * Produces an object with the opener and closer exception values * @param {Object} opts The exception options - * @returns {Object} `missingSpace` and `rejectedSpace` regular expressions + * @returns {Object} `openers` and `closers` exception values * @private */ - function getNeverChecks(opts) { - var missingSpaceOpeners = [], - missingSpaceClosers = [], - rejectedSpaceOpeners = ["\\s"], - rejectedSpaceClosers = ["\\s"], - missingSpaceCheck, - rejectedSpaceCheck; - - // Populate openers and closers - if (opts.braceException) { - missingSpaceOpeners.push("\\{"); - missingSpaceClosers.push("\\}"); - rejectedSpaceOpeners.push("\\{"); - rejectedSpaceClosers.push("\\}"); - } - if (opts.bracketException) { - missingSpaceOpeners.push("\\["); - missingSpaceClosers.push("\\]"); - rejectedSpaceOpeners.push("\\["); - rejectedSpaceClosers.push("\\]"); - } - if (opts.parenException) { - missingSpaceOpeners.push("\\("); - missingSpaceClosers.push("\\)"); - rejectedSpaceOpeners.push("\\("); - rejectedSpaceClosers.push("\\)"); - } - if (opts.empty) { - missingSpaceOpeners.push("\\)"); - missingSpaceClosers.push("\\("); - rejectedSpaceOpeners.push("\\)"); - rejectedSpaceClosers.push("\\("); - } + function getExceptions() { + var openers = [], + closers = []; - if (missingSpaceOpeners.length) { - missingSpaceCheck = "\\((" + missingSpaceOpeners.join("|") + ")"; - if (missingSpaceClosers.length) { - missingSpaceCheck += "|"; - } - } - if (missingSpaceClosers.length) { - missingSpaceCheck += "(" + missingSpaceClosers.join("|") + ")\\)"; + if (options.braceException) { + openers.push("{"); + closers.push("}"); } - // compose the rejected regexp - rejectedSpaceCheck = "\\( +[^" + rejectedSpaceOpeners.join("") + "]"; - rejectedSpaceCheck += "|[^" + rejectedSpaceClosers.join("") + "] +\\)"; - - return { - // e.g. \((\{)|(\})\) --- where {} is an exception - missingSpace: missingSpaceCheck || ".^", - // e.g. \( +[^ \n\r\{]|[^ \n\r\}] +\) --- where {} is an exception - rejectedSpace: rejectedSpaceCheck - }; - } - - /** - * Used with the `always` option to produce, given the exception options, - * two regular expressions to check for missing and rejected spaces. - * @param {Object} opts The exception options - * @returns {Object} `missingSpace` and `rejectedSpace` regular expressions - * @private - */ - function getAlwaysChecks(opts) { - var missingSpaceOpeners = ["\\s", "\\)"], - missingSpaceClosers = ["\\s", "\\("], - rejectedSpaceOpeners = [], - rejectedSpaceClosers = [], - missingSpaceCheck, - rejectedSpaceCheck; - - // Populate openers and closers - if (opts.braceException) { - missingSpaceOpeners.push("\\{"); - missingSpaceClosers.push("\\}"); - rejectedSpaceOpeners.push(" \\{"); - rejectedSpaceClosers.push("\\} "); - } - if (opts.bracketException) { - missingSpaceOpeners.push("\\["); - missingSpaceClosers.push("\\]"); - rejectedSpaceOpeners.push(" \\["); - rejectedSpaceClosers.push("\\] "); - } - if (opts.parenException) { - missingSpaceOpeners.push("\\("); - missingSpaceClosers.push("\\)"); - rejectedSpaceOpeners.push(" \\("); - rejectedSpaceClosers.push("\\) "); - } - if (opts.empty) { - rejectedSpaceOpeners.push(" \\)"); - rejectedSpaceClosers.push("\\( "); + if (options.bracketException) { + openers.push("["); + closers.push("]"); } - // compose the allowed regexp - missingSpaceCheck = "\\([^" + missingSpaceOpeners.join("") + "]"; - missingSpaceCheck += "|[^" + missingSpaceClosers.join("") + "]\\)"; - - // compose the rejected regexp - if (rejectedSpaceOpeners.length) { - rejectedSpaceCheck = "\\((" + rejectedSpaceOpeners.join("|") + ")"; - if (rejectedSpaceClosers.length) { - rejectedSpaceCheck += "|"; - } + if (options.parenException) { + openers.push("("); + closers.push(")"); } - if (rejectedSpaceClosers.length) { - rejectedSpaceCheck += "(" + rejectedSpaceClosers.join("|") + ")\\)"; + + if (options.empty) { + openers.push(")"); + closers.push("("); } return { - // e.g. \([^ \)\r\n\{]|[^ \(\r\n\}]\) --- where {} is an exception - missingSpace: missingSpaceCheck, - // e.g. \(( \{})|(\} )\) --- where {} is an excpetion - rejectedSpace: rejectedSpaceCheck || ".^" + openers: openers, + closers: closers }; } - spaceChecks = (context.options[0] === "always") ? getAlwaysChecks(options) : getNeverChecks(options); - missingSpaceRegExp = new RegExp(spaceChecks.missingSpace, "mg"); - rejectedSpaceRegExp = new RegExp(spaceChecks.rejectedSpace, "mg"); - - //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- - - var skipRanges = []; + var sourceCode = context.getSourceCode(); /** - * Adds the range of a node to the set to be skipped when checking parens - * @param {ASTNode} node The node to skip - * @returns {void} - * @private + * Determines if a token is one of the exceptions for the opener paren + * @param {Object} token The token to check + * @returns {boolean} True if the token is one of the exceptions for the opener paren */ - function addSkipRange(node) { - skipRanges.push(node.range); + function isOpenerException(token) { + return token.type === "Punctuator" && exceptions.openers.indexOf(token.value) >= 0; } /** - * Sorts the skipRanges array. Must be called before shouldSkip - * @returns {void} - * @private + * Determines if a token is one of the exceptions for the closer paren + * @param {Object} token The token to check + * @returns {boolean} True if the token is one of the exceptions for the closer paren */ - function sortSkipRanges() { - skipRanges.sort(function (a, b) { - return a[0] - b[0]; - }); + function isCloserException(token) { + return token.type === "Punctuator" && exceptions.closers.indexOf(token.value) >= 0; } /** - * Checks if a certain position in the source should be skipped - * @param {Number} pos The 0-based index in the source - * @returns {boolean} whether the position should be skipped - * @private + * Determines if an opener paren should have a missing space after it + * @param {Object} left The paren token + * @param {Object} right The token after it + * @returns {boolean} True if the paren should have a space */ - function shouldSkip(pos) { - var i, len, range; - for (i = 0, len = skipRanges.length; i < len; i += 1) { - range = skipRanges[i]; - if (pos < range[0]) { - break; - } else if (pos < range[1]) { - return true; + function shouldOpenerHaveSpace(left, right) { + if (sourceCode.isSpaceBetweenTokens(left, right)) { + return false; + } + + if (ALWAYS) { + if (right.type === "Punctuator" && right.value === ")") { + return false; } + return !isOpenerException(right); + } else { + return isOpenerException(right); } - return false; } + /** + * Determines if an closer paren should have a missing space after it + * @param {Object} left The token before the paren + * @param {Object} right The paren token + * @returns {boolean} True if the paren should have a space + */ + function shouldCloserHaveSpace(left, right) { + if (left.type === "Punctuator" && left.value === "(") { + return false; + } - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- + if (sourceCode.isSpaceBetweenTokens(left, right)) { + return false; + } - return { + if (ALWAYS) { + return !isCloserException(left); + } else { + return isCloserException(left); + } + } - "Program:exit": function checkParenSpaces(node) { + /** + * Determines if an opener paren should not have an existing space after it + * @param {Object} left The paren token + * @param {Object} right The token after it + * @returns {boolean} True if the paren should reject the space + */ + function shouldOpenerRejectSpace(left, right) { + if (right.type === "Line") { + return false; + } - var nextMatch, - nextLine, - column, - line = 1, - source = context.getSource(), - pos = 0; + if (!astUtils.isTokenOnSameLine(left, right)) { + return false; + } - function checkMatch(match, message) { - if (source.charAt(match.index) !== "(") { - // Matched a closing paren pattern - match.index += 1; - } + if (!sourceCode.isSpaceBetweenTokens(left, right)) { + return false; + } - if (!shouldSkip(match.index)) { - while ((nextLine = source.indexOf("\n", pos)) !== -1 && nextLine < match.index) { - pos = nextLine + 1; - line += 1; - } - column = match.index - pos; + if (ALWAYS) { + return isOpenerException(right); + } else { + return !isOpenerException(right); + } + } - context.report(node, { line: line, column: column }, message); - } - } + /** + * Determines if an closer paren should not have an existing space after it + * @param {Object} left The token before the paren + * @param {Object} right The paren token + * @returns {boolean} True if the paren should reject the space + */ + function shouldCloserRejectSpace(left, right) { + if (left.type === "Punctuator" && left.value === "(") { + return false; + } - sortSkipRanges(); + if (!astUtils.isTokenOnSameLine(left, right)) { + return false; + } - while ((nextMatch = rejectedSpaceRegExp.exec(source)) !== null) { - checkMatch(nextMatch, REJECTED_SPACE_MESSAGE); - } + if (!sourceCode.isSpaceBetweenTokens(left, right)) { + return false; + } - while ((nextMatch = missingSpaceRegExp.exec(source)) !== null) { - checkMatch(nextMatch, MISSING_SPACE_MESSAGE); - } + if (ALWAYS) { + return isCloserException(left); + } else { + return !isCloserException(left); + } + } - }, + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + return { + "Program": function checkParenSpaces(node) { + var tokens, prevToken, nextToken; - // These nodes can contain parentheses that this rule doesn't care about + exceptions = getExceptions(); + tokens = sourceCode.tokensAndComments; - LineComment: addSkipRange, + tokens.forEach(function(token, i) { + prevToken = tokens[i - 1]; + nextToken = tokens[i + 1]; - BlockComment: addSkipRange, + if (token.type !== "Punctuator") { + return; + } - Literal: addSkipRange + if (token.value !== "(" && token.value !== ")") { + return; + } + if (token.value === "(" && shouldOpenerHaveSpace(token, nextToken)) { + context.report({ + node: node, + loc: token.loc.start, + message: MISSING_SPACE_MESSAGE, + fix: function(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } else if (token.value === "(" && shouldOpenerRejectSpace(token, nextToken)) { + context.report({ + node: node, + loc: token.loc.start, + message: REJECTED_SPACE_MESSAGE, + fix: function(fixer) { + return fixer.removeRange([token.range[1], nextToken.range[0]]); + } + }); + } else if (token.value === ")" && shouldCloserHaveSpace(prevToken, token)) { + + // context.report(node, token.loc.start, MISSING_SPACE_MESSAGE); + context.report({ + node: node, + loc: token.loc.start, + message: MISSING_SPACE_MESSAGE, + fix: function(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } else if (token.value === ")" && shouldCloserRejectSpace(prevToken, token)) { + context.report({ + node: node, + loc: token.loc.start, + message: REJECTED_SPACE_MESSAGE, + fix: function(fixer) { + return fixer.removeRange([prevToken.range[1], token.range[0]]); + } + }); + } + }); + } }; }; diff --git a/tools/eslint/lib/rules/space-infix-ops.js b/tools/eslint/lib/rules/space-infix-ops.js index 4c094c7280c114..dee07ee31ae75f 100644 --- a/tools/eslint/lib/rules/space-infix-ops.js +++ b/tools/eslint/lib/rules/space-infix-ops.js @@ -15,7 +15,7 @@ module.exports = function(context) { "*", "/", "%", "+", "-", "<<", ">>", ">>>", "<", "<=", ">", ">=", "in", "instanceof", "==", "!=", "===", "!==", "&", "^", "|", "&&", "||", "=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", "&=", "^=", "|=", - "?", ":", "," + "?", ":", ",", "**" ]; /** @@ -26,7 +26,9 @@ module.exports = function(context) { * @private */ function getFirstNonSpacedToken(left, right) { - var op, tokens = context.getTokensBetween(left, right, 1); + var op, + tokens = context.getTokensBetween(left, right, 1); + for (var i = 1, l = tokens.length - 1; i < l; ++i) { op = tokens[i]; if ( @@ -48,9 +50,36 @@ module.exports = function(context) { * @private */ function report(mainNode, culpritToken) { - context.report(mainNode, culpritToken.loc.start, "Infix operators must be spaced."); + context.report({ + node: mainNode, + loc: culpritToken.loc.start, + message: "Infix operators must be spaced.", + fix: function(fixer) { + var previousToken = context.getTokenBefore(culpritToken); + var afterToken = context.getTokenAfter(culpritToken); + var fixString = ""; + + if (culpritToken.range[0] - previousToken.range[1] === 0) { + fixString = " "; + } + + fixString += culpritToken.value; + + if (afterToken.range[0] - culpritToken.range[1] === 0) { + fixString += " "; + } + + return fixer.replaceText(culpritToken, fixString); + } + }); } + /** + * Check if the node is binary then report + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ function checkBinary(node) { var nonSpacedNode = getFirstNonSpacedToken(node.left, node.right); @@ -61,6 +90,12 @@ module.exports = function(context) { } } + /** + * Check if the node is conditional + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ function checkConditional(node) { var nonSpacedConsequesntNode = getFirstNonSpacedToken(node.test, node.consequent); var nonSpacedAlternateNode = getFirstNonSpacedToken(node.consequent, node.alternate); @@ -72,6 +107,12 @@ module.exports = function(context) { } } + /** + * Check if the node is a variable + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ function checkVar(node) { var nonSpacedNode; @@ -85,6 +126,7 @@ module.exports = function(context) { return { "AssignmentExpression": checkBinary, + "AssignmentPattern": checkBinary, "BinaryExpression": checkBinary, "LogicalExpression": checkBinary, "ConditionalExpression": checkConditional, diff --git a/tools/eslint/lib/rules/space-return-throw-case.js b/tools/eslint/lib/rules/space-return-throw-case.js deleted file mode 100644 index 8b1bb984cf46a7..00000000000000 --- a/tools/eslint/lib/rules/space-return-throw-case.js +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @fileoverview Require spaces following return, throw, and case - * @author Michael Ficarra - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - function check(node) { - var tokens = context.getFirstTokens(node, 2), - value = tokens[0].value; - - if (tokens[0].range[1] >= tokens[1].range[0]) { - context.report(node, "Keyword \"" + value + "\" must be followed by whitespace."); - } - } - - return { - "ReturnStatement": function(node) { - if (node.argument) { - check(node); - } - }, - "SwitchCase": function(node) { - if (node.test) { - check(node); - } - }, - "ThrowStatement": check - }; - -}; - -module.exports.schema = []; diff --git a/tools/eslint/lib/rules/space-unary-ops.js b/tools/eslint/lib/rules/space-unary-ops.js index 48d146b779b134..d5412e36f3abde 100644 --- a/tools/eslint/lib/rules/space-unary-ops.js +++ b/tools/eslint/lib/rules/space-unary-ops.js @@ -17,12 +17,13 @@ module.exports = function(context) { //-------------------------------------------------------------------------- /** - * Check if the parent unary operator is "!" in order to know if it's "!!" convert to Boolean or just "!" negation + * Check if the node is the first "!" in a "!!" convert to Boolean expression * @param {ASTnode} node AST node - * @returns {boolean} Whether or not the parent is unary "!" operator + * @returns {boolean} Whether or not the node is first "!" in "!!" */ - function isParentUnaryBangExpression(node) { - return node && node.parent && node.parent.type === "UnaryExpression" && node.parent.operator === "!"; + function isFirstBangInBangBangExpression(node) { + return node && node.type === "UnaryExpression" && node.argument.operator === "!" && + node.argument && node.argument.type === "UnaryExpression" && node.argument.operator === "!"; } /** @@ -34,29 +35,175 @@ module.exports = function(context) { return node.argument && node.argument.type && node.argument.type === "ObjectExpression"; } + /** + * Checks if an override exists for a given operator. + * @param {ASTnode} node AST node + * @param {string} operator Operator + * @returns {boolean} Whether or not an override has been provided for the operator + */ + function overrideExistsForOperator(node, operator) { + return options.overrides && options.overrides.hasOwnProperty(operator); + } + + /** + * Gets the value that the override was set to for this operator + * @param {ASTnode} node AST node + * @param {string} operator Operator + * @returns {boolean} Whether or not an override enforces a space with this operator + */ + function overrideEnforcesSpaces(node, operator) { + return options.overrides[operator]; + } + + /** + * Verify Unary Word Operator has spaces after the word operator + * @param {ASTnode} node AST node + * @param {object} firstToken first token from the AST node + * @param {object} secondToken second token from the AST node + * @param {string} word The word to be used for reporting + * @returns {void} + */ + function verifyWordHasSpaces(node, firstToken, secondToken, word) { + if (secondToken.range[0] === firstToken.range[1]) { + context.report({ + node: node, + message: "Unary word operator '" + word + "' must be followed by whitespace.", + fix: function(fixer) { + return fixer.insertTextAfter(firstToken, " "); + } + }); + } + } + + /** + * Verify Unary Word Operator doesn't have spaces after the word operator + * @param {ASTnode} node AST node + * @param {object} firstToken first token from the AST node + * @param {object} secondToken second token from the AST node + * @param {string} word The word to be used for reporting + * @returns {void} + */ + function verifyWordDoesntHaveSpaces(node, firstToken, secondToken, word) { + if (isArgumentObjectExpression(node)) { + if (secondToken.range[0] > firstToken.range[1]) { + context.report({ + node: node, + message: "Unexpected space after unary word operator '" + word + "'.", + fix: function(fixer) { + return fixer.removeRange([firstToken.range[1], secondToken.range[0]]); + } + }); + } + } + } + /** * Check Unary Word Operators for spaces after the word operator * @param {ASTnode} node AST node * @param {object} firstToken first token from the AST node * @param {object} secondToken second token from the AST node + * @param {string} word The word to be used for reporting + * @returns {void} + */ + function checkUnaryWordOperatorForSpaces(node, firstToken, secondToken, word) { + word = word || firstToken.value; + + if (overrideExistsForOperator(node, word)) { + if (overrideEnforcesSpaces(node, word)) { + verifyWordHasSpaces(node, firstToken, secondToken, word); + } else { + verifyWordDoesntHaveSpaces(node, firstToken, secondToken, word); + } + } else if (options.words) { + verifyWordHasSpaces(node, firstToken, secondToken, word); + } else { + verifyWordDoesntHaveSpaces(node, firstToken, secondToken, word); + } + } + + /** + * Verifies YieldExpressions satisfy spacing requirements + * @param {ASTnode} node AST node + * @returns {void} + */ + function checkForSpacesAfterYield(node) { + var tokens = context.getFirstTokens(node, 3), + word = "yield"; + + if (!node.argument || node.delegate) { + return; + } + + checkUnaryWordOperatorForSpaces(node, tokens[0], tokens[1], word); + } + + /** + * Verifies UnaryExpression, UpdateExpression and NewExpression have spaces before or after the operator + * @param {ASTnode} node AST node + * @param {object} firstToken First token in the expression + * @param {object} secondToken Second token in the expression * @returns {void} */ - function checkUnaryWordOperatorForSpaces(node, firstToken, secondToken) { - if (options.words) { - if (secondToken.range[0] === firstToken.range[1]) { - context.report(node, "Unary word operator \"" + firstToken.value + "\" must be followed by whitespace."); + function verifyNonWordsHaveSpaces(node, firstToken, secondToken) { + if (node.prefix) { + if (isFirstBangInBangBangExpression(node)) { + return; + } + if (firstToken.range[1] === secondToken.range[0]) { + context.report({ + node: node, + message: "Unary operator '" + firstToken.value + "' must be followed by whitespace.", + fix: function(fixer) { + return fixer.insertTextAfter(firstToken, " "); + } + }); + } + } else { + if (firstToken.range[1] === secondToken.range[0]) { + context.report({ + node: node, + message: "Space is required before unary expressions '" + secondToken.value + "'.", + fix: function(fixer) { + return fixer.insertTextBefore(secondToken, " "); + } + }); } } + } - if (!options.words && isArgumentObjectExpression(node)) { + /** + * Verifies UnaryExpression, UpdateExpression and NewExpression don't have spaces before or after the operator + * @param {ASTnode} node AST node + * @param {object} firstToken First token in the expression + * @param {object} secondToken Second token in the expression + * @returns {void} + */ + function verifyNonWordsDontHaveSpaces(node, firstToken, secondToken) { + if (node.prefix) { if (secondToken.range[0] > firstToken.range[1]) { - context.report(node, "Unexpected space after unary word operator \"" + firstToken.value + "\"."); + context.report({ + node: node, + message: "Unexpected space after unary operator '" + firstToken.value + "'.", + fix: function(fixer) { + return fixer.removeRange([firstToken.range[1], secondToken.range[0]]); + } + }); + } + } else { + if (secondToken.range[0] > firstToken.range[1]) { + context.report({ + node: node, + message: "Unexpected space before unary operator '" + secondToken.value + "'.", + fix: function(fixer) { + return fixer.removeRange([firstToken.range[1], secondToken.range[0]]); + } + }); } } } /** - * Checks UnaryExpression, UpdateExpression and NewExpression for spaces before and after the operator + * Verifies UnaryExpression, UpdateExpression and NewExpression satisfy spacing requirements * @param {ASTnode} node AST node * @returns {void} */ @@ -67,32 +214,21 @@ module.exports = function(context) { if ((node.type === "NewExpression" || node.prefix) && firstToken.type === "Keyword") { checkUnaryWordOperatorForSpaces(node, firstToken, secondToken); - return void 0; + return; } - if (options.nonwords) { - if (node.prefix) { - if (isParentUnaryBangExpression(node)) { - return void 0; - } - if (firstToken.range[1] === secondToken.range[0]) { - context.report(node, "Unary operator \"" + firstToken.value + "\" must be followed by whitespace."); - } + var operator = node.prefix ? tokens[0].value : tokens[1].value; + + if (overrideExistsForOperator(node, operator)) { + if (overrideEnforcesSpaces(node, operator)) { + verifyNonWordsHaveSpaces(node, firstToken, secondToken); } else { - if (firstToken.range[1] === secondToken.range[0]) { - context.report(node, "Space is required before unary expressions \"" + secondToken.value + "\"."); - } + verifyNonWordsDontHaveSpaces(node, firstToken, secondToken); } + } else if (options.nonwords) { + verifyNonWordsHaveSpaces(node, firstToken, secondToken); } else { - if (node.prefix) { - if (secondToken.range[0] > firstToken.range[1]) { - context.report(node, "Unexpected space after unary operator \"" + firstToken.value + "\"."); - } - } else { - if (secondToken.range[0] > firstToken.range[1]) { - context.report(node, "Unexpected space before unary operator \"" + secondToken.value + "\"."); - } - } + verifyNonWordsDontHaveSpaces(node, firstToken, secondToken); } } @@ -103,7 +239,8 @@ module.exports = function(context) { return { "UnaryExpression": checkForSpaces, "UpdateExpression": checkForSpaces, - "NewExpression": checkForSpaces + "NewExpression": checkForSpaces, + "YieldExpression": checkForSpacesAfterYield }; }; @@ -117,6 +254,12 @@ module.exports.schema = [ }, "nonwords": { "type": "boolean" + }, + "overrides": { + "type": "object", + "additionalProperties": { + "type": "boolean" + } } }, "additionalProperties": false diff --git a/tools/eslint/lib/rules/spaced-comment.js b/tools/eslint/lib/rules/spaced-comment.js index a57cd8699d095b..73f0861c8f39c9 100644 --- a/tools/eslint/lib/rules/spaced-comment.js +++ b/tools/eslint/lib/rules/spaced-comment.js @@ -1,111 +1,237 @@ /** * @fileoverview Source code for spaced-comments rule * @author Gyandeep Singh + * @copyright 2015 Toru Nagashima. All rights reserved. * @copyright 2015 Gyandeep Singh. All rights reserved. * @copyright 2014 Greg Cochard. All rights reserved. */ "use strict"; +var lodash = require("lodash"); + //------------------------------------------------------------------------------ -// Rule Definition +// Helpers //------------------------------------------------------------------------------ -module.exports = function(context) { +/** + * Escapes the control characters of a given string. + * @param {string} s - A string to escape. + * @returns {string} An escaped string. + */ +function escape(s) { + var isOneChar = s.length === 1; - // Unless the first option is never, require a space - var requireSpace = context.options[0] !== "never"; + s = lodash.escapeRegExp(s); + return isOneChar ? s : "(?:" + s + ")"; +} - // Default to match anything, so all will fail if there are no exceptions - var exceptionMatcher = new RegExp(" "); - var markerMatcher = new RegExp(" "); - var jsDocMatcher = new RegExp("((^(\\*)))[ \\n]"); +/** + * Escapes the control characters of a given string. + * And adds a repeat flag. + * @param {string} s - A string to escape. + * @returns {string} An escaped string. + */ +function escapeAndRepeat(s) { + return escape(s) + "+"; +} - // Fetch the options dict - var hasOptions = context.options.length === 2; - var optionsDict = hasOptions ? context.options[1] : {}; +/** + * Parses `markers` option. + * If markers don't include `"*"`, this adds `"*"` to allow JSDoc comments. + * @param {string[]} [markers] - A marker list. + * @returns {string[]} A marker list. + */ +function parseMarkersOption(markers) { + markers = markers ? markers.slice(0) : []; - // Grab the exceptions array and build a RegExp matcher for it - var hasExceptions = hasOptions && optionsDict.exceptions && optionsDict.exceptions.length; - var unescapedExceptions = hasExceptions ? optionsDict.exceptions : []; - var exceptions; + // `*` is a marker for JSDoc comments. + if (markers.indexOf("*") === -1) { + markers.push("*"); + } - // Now do the same for markers - var hasMarkers = hasOptions && optionsDict.markers && optionsDict.markers.length; - var unescapedMarkers = hasMarkers ? optionsDict.markers : []; - var markers; + return markers; +} - function escaper(s) { - return s.replace(/([.*+?${}()|\^\[\]\/\\])/g, "\\$1"); - } +/** + * Creates RegExp object for `always` mode. + * Generated pattern is below: + * + * 1. First, a marker or nothing. + * 2. Next, a space or an exception pattern sequence. + * + * @param {string[]} markers - A marker list. + * @param {string[]} exceptions - A exception pattern list. + * @returns {RegExp} A RegExp object for `always` mode. + */ +function createAlwaysStylePattern(markers, exceptions) { + var pattern = "^"; - if (hasExceptions) { - exceptions = unescapedExceptions.map(escaper); - exceptionMatcher = new RegExp("(^(" + exceptions.join(")+$)|(^(") + ")+$)"); - } + /* + * A marker or nothing. + * ["*"] ==> "\*?" + * ["*", "!"] ==> "(?:\*|!)?" + * ["*", "/", "!<"] ==> "(?:\*|\/|(?:!<))?" ==> https://jex.im/regulex/#!embed=false&flags=&re=(%3F%3A%5C*%7C%5C%2F%7C(%3F%3A!%3C))%3F + */ + if (markers.length === 1) { - if (hasMarkers) { - markers = unescapedMarkers.map(escaper); + // the marker. + pattern += escape(markers[0]); + } else { - // the markerMatcher includes any markers in the list, followed by space/tab - markerMatcher = new RegExp("((^(" + markers.join("))|(^(") + ")))[ \\t\\n]"); + // one of markers. + pattern += "(?:"; + pattern += markers.map(escape).join("|"); + pattern += ")"; } - /** - * Check to see if the block comment is jsDoc comment - * @param {ASTNode} node comment node - * @returns {boolean} True if its jsdoc comment - * @private + pattern += "?"; // or nothing. + + /* + * A space or an exception pattern sequence. + * [] ==> "\s" + * ["-"] ==> "(?:\s|\-+$)" + * ["-", "="] ==> "(?:\s|(?:\-+|=+)$)" + * ["-", "=", "--=="] ==> "(?:\s|(?:\-+|=+|(?:\-\-==)+)$)" ==> https://jex.im/regulex/#!embed=false&flags=&re=(%3F%3A%5Cs%7C(%3F%3A%5C-%2B%7C%3D%2B%7C(%3F%3A%5C-%5C-%3D%3D)%2B)%24) */ - function isJsdoc(node) { - // make sure comment type is block and it start with /**\n - return node.type === "Block" && jsDocMatcher.test(node.value); + if (exceptions.length === 0) { + + // a space. + pattern += "\\s"; + } else { + + // a space or... + pattern += "(?:\\s|"; + + if (exceptions.length === 1) { + + // a sequence of the exception pattern. + pattern += escapeAndRepeat(exceptions[0]); + } else { + + // a sequence of one of exception patterns. + pattern += "(?:"; + pattern += exceptions.map(escapeAndRepeat).join("|"); + pattern += ")"; + } + + pattern += "(?:$|[\n\r]))"; // the sequence continues until the end. } + return new RegExp(pattern); +} - function checkCommentForSpace(node) { - var commentIdentifier = node.type === "Block" ? "/*" : "//"; +/** + * Creates RegExp object for `never` mode. + * Generated pattern is below: + * + * 1. First, a marker or nothing (captured). + * 2. Next, a space or a tab. + * + * @param {string[]} markers - A marker list. + * @returns {RegExp} A RegExp object for `never` mode. + */ +function createNeverStylePattern(markers) { + var pattern = "^(" + markers.map(escape).join("|") + ")?[ \t]+"; - if (requireSpace) { + return new RegExp(pattern); +} - // If length is zero, ignore it - if (node.value.length === 0) { - return; - } +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ - // if comment is jsdoc style then ignore it - if (isJsdoc(node)) { - return; - } +module.exports = function(context) { - // Check for markers now, and short-circuit if found - if (hasMarkers && markerMatcher.test(node.value)) { - return; - } + // Unless the first option is never, require a space + var requireSpace = context.options[0] !== "never"; + + /* + * Parse the second options. + * If markers don't include `"*"`, it's added automatically for JSDoc + * comments. + */ + var config = context.options[1] || {}; + var styleRules = ["block", "line"].reduce(function(rule, type) { + var markers = parseMarkersOption(config[type] && config[type].markers || config.markers); + var exceptions = config[type] && config[type].exceptions || config.exceptions || []; + + // Create RegExp object for valid patterns. + rule[type] = { + regex: requireSpace ? createAlwaysStylePattern(markers, exceptions) : createNeverStylePattern(markers), + hasExceptions: exceptions.length > 0, + markers: new RegExp("^(" + markers.map(escape).join("|") + ")") + }; + + return rule; + }, {}); + + /** + * Reports a spacing error with an appropriate message. + * @param {ASTNode} node - A comment node to check. + * @param {string} message - An error message to report + * @param {Array} match - An array of match results for markers. + * @returns {void} + */ + function report(node, message, match) { + var type = node.type.toLowerCase(), + commentIdentifier = type === "block" ? "/*" : "//"; + + context.report({ + node: node, + fix: function(fixer) { + var start = node.range[0], + end = start + 2; - // Space expected and not found - if (node.value.indexOf(" ") !== 0 && node.value.indexOf("\t") !== 0 && node.value.indexOf("\n") !== 0) { - - /* - * Do two tests; one for space starting the line, - * and one for a comment comprised only of exceptions - */ - if (hasExceptions && !exceptionMatcher.test(node.value)) { - context.report(node, "Expected exception block, space or tab after " + commentIdentifier + " in comment."); - } else if (!hasExceptions) { - context.report(node, "Expected space or tab after " + commentIdentifier + " in comment."); + if (requireSpace) { + if (match) { + end += match[0].length; + } + return fixer.insertTextAfterRange([start, end], " "); + } else { + end += match[0].length; + return fixer.replaceTextRange([start, end], commentIdentifier + (match[1] ? match[1] : "")); } - } + }, + message: message + }); + } - } else { + /** + * Reports a given comment if it's invalid. + * @param {ASTNode} node - a comment node to check. + * @returns {void} + */ + function checkCommentForSpace(node) { + var type = node.type.toLowerCase(), + rule = styleRules[type], + commentIdentifier = type === "block" ? "/*" : "//"; + + // Ignores empty comments. + if (node.value.length === 0) { + return; + } + + // Checks. + if (requireSpace) { + if (!rule.regex.test(node.value)) { + var hasMarker = rule.markers.exec(node.value); + var marker = hasMarker ? commentIdentifier + hasMarker[0] : commentIdentifier; - if (node.value.indexOf(" ") === 0 || node.value.indexOf("\t") === 0) { - context.report(node, "Unexpected space or tab after " + commentIdentifier + " in comment."); + if (rule.hasExceptions) { + report(node, "Expected exception block, space or tab after '" + marker + "' in comment.", hasMarker); + } else { + report(node, "Expected space or tab after '" + marker + "' in comment.", hasMarker); + } } - // there won't be a space or tab after commentIdentifier here, but check for the markers and whitespace - if (hasMarkers && markerMatcher.test(node.value)) { - var matches = node.value.match(markerMatcher), match = matches.length ? matches[0] : ""; + } else { + var matched = rule.regex.exec(node.value); - context.report(node, "Unexpected space or tab after marker (" + match + ") in comment."); + if (matched) { + if (!matched[1]) { + report(node, "Unexpected space or tab after '" + commentIdentifier + "' in comment.", matched); + } else { + report(node, "Unexpected space or tab after marker (" + matched[1] + ") in comment.", matched); + } } } } @@ -136,6 +262,42 @@ module.exports.schema = [ "items": { "type": "string" } + }, + "line": { + "type": "object", + "properties": { + "exceptions": { + "type": "array", + "items": { + "type": "string" + } + }, + "markers": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "block": { + "type": "object", + "properties": { + "exceptions": { + "type": "array", + "items": { + "type": "string" + } + }, + "markers": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false } }, "additionalProperties": false diff --git a/tools/eslint/lib/rules/spaced-line-comment.js b/tools/eslint/lib/rules/spaced-line-comment.js deleted file mode 100644 index 1e2d952f294469..00000000000000 --- a/tools/eslint/lib/rules/spaced-line-comment.js +++ /dev/null @@ -1,89 +0,0 @@ -/** - * @fileoverview Enforces or disallows a space beginning a single-line comment. - * @author Greg Cochard - * @copyright 2014 Greg Cochard. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - // Unless the first option is never, require a space - var requireSpace = context.options[0] !== "never"; - - // Default to match anything, so all will fail if there are no exceptions - var exceptionMatcher = new RegExp(" "); - - // Grab the exceptions array and build a RegExp matcher for it - var hasExceptions = context.options.length === 2; - var unescapedExceptions = hasExceptions ? context.options[1].exceptions : []; - var exceptions; - - if (unescapedExceptions.length) { - exceptions = unescapedExceptions.map(function(s) { - return s.replace(/([.*+?${}()|\^\[\]\/\\])/g, "\\$1"); - }); - exceptionMatcher = new RegExp("(^(" + exceptions.join(")+$)|(^(") + ")+$)"); - } - - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - - "LineComment": function checkCommentForSpace(node) { - - if (requireSpace) { - - // If length is zero, ignore it - if (node.value.length === 0) { - return; - } - - // Space expected and not found - if (node.value.indexOf(" ") !== 0 && node.value.indexOf("\t") !== 0) { - - /* - * Do two tests; one for space starting the line, - * and one for a comment comprised only of exceptions - */ - if (hasExceptions && !exceptionMatcher.test(node.value)) { - context.report(node, "Expected exception block, space or tab after // in comment."); - } else if (!hasExceptions) { - context.report(node, "Expected space or tab after // in comment."); - } - } - - } else { - - if (node.value.indexOf(" ") === 0 || node.value.indexOf("\t") === 0) { - context.report(node, "Unexpected space or tab after // in comment."); - } - } - } - - }; -}; - -module.exports.schema = [ - { - "enum": ["always", "never"] - }, - { - "type": "object", - "properties": { - "exceptions": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false - } -]; diff --git a/tools/eslint/lib/rules/strict.js b/tools/eslint/lib/rules/strict.js index a398d7dbecf9dc..81f1cfbf8caffd 100644 --- a/tools/eslint/lib/rules/strict.js +++ b/tools/eslint/lib/rules/strict.js @@ -8,16 +8,25 @@ "use strict"; +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var lodash = require("lodash"); + //------------------------------------------------------------------------------ // Helpers //------------------------------------------------------------------------------ var messages = { - function: "Use the function form of \"use strict\".", - global: "Use the global form of \"use strict\".", - multiple: "Multiple \"use strict\" directives.", + function: "Use the function form of 'use strict'.", + global: "Use the global form of 'use strict'.", + multiple: "Multiple 'use strict' directives.", never: "Strict mode is not permitted.", - unnecessary: "Unnecessary \"use strict\" directive." + unnecessary: "Unnecessary 'use strict' directive.", + module: "'use strict' is unnecessary inside of modules.", + implied: "'use strict' is unnecessary when implied strict mode is enabled.", + unnecessaryInClasses: "'use strict' is unnecessary inside of classes." }; /** @@ -53,190 +62,153 @@ function getUseStrictDirectives(statements) { module.exports = function(context) { - var mode = context.options[0], - isModule = context.ecmaFeatures.modules, - modes = {}, - scopes = []; + var mode = context.options[0] || "safe", + ecmaFeatures = context.parserOptions.ecmaFeatures || {}, + scopes = [], + classScopes = [], + rule; + + if (ecmaFeatures.impliedStrict) { + mode = "implied"; + } else if (mode === "safe") { + mode = ecmaFeatures.globalReturn ? "global" : "function"; + } /** - * Report a node or array of nodes with a given message. - * @param {(ASTNode|ASTNode[])} nodes Node or nodes to report. + * Report a slice of an array of nodes with a given message. + * @param {ASTNode[]} nodes Nodes. + * @param {string} start Index to start from. + * @param {string} end Index to end before. * @param {string} message Message to display. * @returns {void} */ - function report(nodes, message) { + function reportSlice(nodes, start, end, message) { var i; - if (Array.isArray(nodes)) { - for (i = 0; i < nodes.length; i++) { - context.report(nodes[i], message); - } - } else { - context.report(nodes, message); + for (i = start; i < end; i++) { + context.report(nodes[i], message); } } - //-------------------------------------------------------------------------- - // "deprecated" mode (default) - //-------------------------------------------------------------------------- - - /** - * Determines if a given node is "use strict". - * @param {ASTNode} node The node to check. - * @returns {boolean} True if the node is a strict pragma, false if not. - * @void - */ - function isStrictPragma(node) { - return (node && node.type === "ExpressionStatement" && - node.expression.value === "use strict"); - } - /** - * When you enter a scope, push the strict value from the previous scope - * onto the stack. - * @param {ASTNode} node The AST node being checked. + * Report all nodes in an array with a given message. + * @param {ASTNode[]} nodes Nodes. + * @param {string} message Message to display. * @returns {void} - * @private */ - function enterScope(node) { - - var isStrict = false, - isProgram = (node.type === "Program"), - isParentGlobal = scopes.length === 1, - isParentStrict = scopes.length ? scopes[scopes.length - 1] : false; - - // look for the "use strict" pragma - if (isModule) { - isStrict = true; - } else if (isProgram) { - isStrict = isStrictPragma(node.body[0]) || isParentStrict; - } else { - isStrict = node.body.body && isStrictPragma(node.body.body[0]) || isParentStrict; - } - - scopes.push(isStrict); - - // never warn if the parent is strict or the function is strict - if (!isParentStrict && !isStrict && isParentGlobal) { - context.report(node, "Missing \"use strict\" statement."); - } + function reportAll(nodes, message) { + reportSlice(nodes, 0, nodes.length, message); } /** - * When you exit a scope, pop off the top scope and see if it's true or - * false. + * Report all nodes in an array, except the first, with a given message. + * @param {ASTNode[]} nodes Nodes. + * @param {string} message Message to display. * @returns {void} - * @private */ - function exitScope() { - scopes.pop(); + function reportAllExceptFirst(nodes, message) { + reportSlice(nodes, 1, nodes.length, message); } - modes.deprecated = { - "Program": enterScope, - "FunctionDeclaration": enterScope, - "FunctionExpression": enterScope, - "ArrowFunctionExpression": enterScope, - - "Program:exit": exitScope, - "FunctionDeclaration:exit": exitScope, - "FunctionExpression:exit": exitScope, - "ArrowFunctionExpression:exit": exitScope - }; - - //-------------------------------------------------------------------------- - // "never" mode - //-------------------------------------------------------------------------- - - modes.never = { - "Program": function(node) { - report(getUseStrictDirectives(node.body), messages.never); - }, - "FunctionDeclaration": function(node) { - report(getUseStrictDirectives(node.body.body), messages.never); - }, - "FunctionExpression": function(node) { - report(getUseStrictDirectives(node.body.body), messages.never); - } - }; - - //-------------------------------------------------------------------------- - // "global" mode - //-------------------------------------------------------------------------- - - modes.global = { - "Program": function(node) { - var useStrictDirectives = getUseStrictDirectives(node.body); - - if (!isModule && node.body.length && useStrictDirectives.length < 1) { - report(node, messages.global); - } else if (isModule) { - report(useStrictDirectives, messages.unnecessary); - } else { - report(useStrictDirectives.slice(1), messages.multiple); - } - }, - "FunctionDeclaration": function(node) { - report(getUseStrictDirectives(node.body.body), messages.global); - }, - "FunctionExpression": function(node) { - report(getUseStrictDirectives(node.body.body), messages.global); - } - }; - - //-------------------------------------------------------------------------- - // "function" mode - //-------------------------------------------------------------------------- - /** - * Entering a function pushes a new nested scope onto the stack. The new - * scope is true if the nested function is strict mode code. + * Entering a function in 'function' mode pushes a new nested scope onto the + * stack. The new scope is true if the nested function is strict mode code. * @param {ASTNode} node The function declaration or expression. + * @param {ASTNode[]} useStrictDirectives The Use Strict Directives of the node. * @returns {void} */ - function enterFunction(node) { - var useStrictDirectives = getUseStrictDirectives(node.body.body), - isParentGlobal = scopes.length === 0, - isParentStrict = isModule || (scopes.length && scopes[scopes.length - 1]), - isStrict = useStrictDirectives.length > 0 || isModule; + function enterFunctionInFunctionMode(node, useStrictDirectives) { + var isInClass = classScopes.length > 0, + isParentGlobal = scopes.length === 0 && classScopes.length === 0, + isParentStrict = scopes.length > 0 && scopes[scopes.length - 1], + isStrict = useStrictDirectives.length > 0; if (isStrict) { - if (isParentStrict && useStrictDirectives.length) { - report(useStrictDirectives[0], messages.unnecessary); + if (isParentStrict) { + context.report(useStrictDirectives[0], messages.unnecessary); + } else if (isInClass) { + context.report(useStrictDirectives[0], messages.unnecessaryInClasses); } - report(useStrictDirectives.slice(1), messages.multiple); - } else if (isParentGlobal && !isModule) { - report(node, messages.function); + reportAllExceptFirst(useStrictDirectives, messages.multiple); + } else if (isParentGlobal) { + context.report(node, messages.function); } scopes.push(isParentStrict || isStrict); } /** - * Exiting a function pops its scope off the stack. + * Exiting a function in 'function' mode pops its scope off the stack. * @returns {void} */ - function exitFunction() { + function exitFunctionInFunctionMode() { scopes.pop(); } - modes.function = { + /** + * Enter a function and either: + * - Push a new nested scope onto the stack (in 'function' mode). + * - Report all the Use Strict Directives (in the other modes). + * @param {ASTNode} node The function declaration or expression. + * @returns {void} + */ + function enterFunction(node) { + var isBlock = node.body.type === "BlockStatement", + useStrictDirectives = isBlock ? + getUseStrictDirectives(node.body.body) : []; + + if (mode === "function") { + enterFunctionInFunctionMode(node, useStrictDirectives); + } else { + reportAll(useStrictDirectives, messages[mode]); + } + } + + rule = { "Program": function(node) { - report(getUseStrictDirectives(node.body), messages.function); + var useStrictDirectives = getUseStrictDirectives(node.body); + + if (node.sourceType === "module") { + mode = "module"; + } + + if (mode === "global") { + if (node.body.length > 0 && useStrictDirectives.length === 0) { + context.report(node, messages.global); + } + reportAllExceptFirst(useStrictDirectives, messages.multiple); + } else { + reportAll(useStrictDirectives, messages[mode]); + } }, "FunctionDeclaration": enterFunction, "FunctionExpression": enterFunction, - "FunctionDeclaration:exit": exitFunction, - "FunctionExpression:exit": exitFunction + "ArrowFunctionExpression": enterFunction }; - return modes[mode || "deprecated"]; + if (mode === "function") { + lodash.assign(rule, { + + // Inside of class bodies are always strict mode. + "ClassBody": function() { + classScopes.push(true); + }, + "ClassBody:exit": function() { + classScopes.pop(); + }, + + "FunctionDeclaration:exit": exitFunctionInFunctionMode, + "FunctionExpression:exit": exitFunctionInFunctionMode, + "ArrowFunctionExpression:exit": exitFunctionInFunctionMode + }); + } + return rule; }; module.exports.schema = [ { - "enum": ["never", "global", "function"] + "enum": ["never", "global", "function", "safe"] } ]; diff --git a/tools/eslint/lib/rules/template-curly-spacing.js b/tools/eslint/lib/rules/template-curly-spacing.js new file mode 100644 index 00000000000000..4f5f9e1a4187c0 --- /dev/null +++ b/tools/eslint/lib/rules/template-curly-spacing.js @@ -0,0 +1,105 @@ +/** + * @fileoverview Rule to enforce spacing around embedded expressions of template strings + * @author Toru Nagashima + * @copyright 2016 Toru Nagashima. All rights reserved. + * See LICENSE file in root directory for full license. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var astUtils = require("../ast-utils"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +var OPEN_PAREN = /\$\{$/; +var CLOSE_PAREN = /^\}/; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var sourceCode = context.getSourceCode(); + var always = context.options[0] === "always"; + var prefix = always ? "Expected" : "Unexpected"; + + /** + * Checks spacing before `}` of a given token. + * @param {Token} token - A token to check. This is a Template token. + * @returns {void} + */ + function checkSpacingBefore(token) { + var prevToken = sourceCode.getTokenBefore(token); + + if (prevToken && + CLOSE_PAREN.test(token.value) && + astUtils.isTokenOnSameLine(prevToken, token) && + sourceCode.isSpaceBetweenTokens(prevToken, token) !== always + ) { + context.report({ + loc: token.loc.start, + message: prefix + " space(s) before '}'.", + fix: function(fixer) { + if (always) { + return fixer.insertTextBefore(token, " "); + } + return fixer.removeRange([ + prevToken.range[1], + token.range[0] + ]); + } + }); + } + } + + /** + * Checks spacing after `${` of a given token. + * @param {Token} token - A token to check. This is a Template token. + * @returns {void} + */ + function checkSpacingAfter(token) { + var nextToken = sourceCode.getTokenAfter(token); + + if (nextToken && + OPEN_PAREN.test(token.value) && + astUtils.isTokenOnSameLine(token, nextToken) && + sourceCode.isSpaceBetweenTokens(token, nextToken) !== always + ) { + context.report({ + loc: { + line: token.loc.end.line, + column: token.loc.end.column - 2 + }, + message: prefix + " space(s) after '${'.", + fix: function(fixer) { + if (always) { + return fixer.insertTextAfter(token, " "); + } + return fixer.removeRange([ + token.range[1], + nextToken.range[0] + ]); + } + }); + } + } + + return { + TemplateElement: function(node) { + var token = sourceCode.getFirstToken(node); + + checkSpacingBefore(token); + checkSpacingAfter(token); + } + }; +}; + +module.exports.schema = [ + {enum: ["always", "never"]} +]; diff --git a/tools/eslint/lib/rules/use-isnan.js b/tools/eslint/lib/rules/use-isnan.js index f5c327f4bcdb0b..7d65f9c0d85921 100644 --- a/tools/eslint/lib/rules/use-isnan.js +++ b/tools/eslint/lib/rules/use-isnan.js @@ -11,10 +11,10 @@ // Rule Definition //------------------------------------------------------------------------------ -module.exports = function (context) { +module.exports = function(context) { return { - "BinaryExpression": function (node) { + "BinaryExpression": function(node) { if (/^(?:[<>]|[!=]=)=?$/.test(node.operator) && (node.left.name === "NaN" || node.right.name === "NaN")) { context.report(node, "Use the isNaN function to compare with NaN."); } diff --git a/tools/eslint/lib/rules/valid-jsdoc.js b/tools/eslint/lib/rules/valid-jsdoc.js index bab6037d17663b..299095064dc4c2 100644 --- a/tools/eslint/lib/rules/valid-jsdoc.js +++ b/tools/eslint/lib/rules/valid-jsdoc.js @@ -19,11 +19,15 @@ module.exports = function(context) { var options = context.options[0] || {}, prefer = options.prefer || {}, + sourceCode = context.getSourceCode(), // these both default to true, so you have to explicitly make them false requireReturn = options.requireReturn !== false, requireParamDescription = options.requireParamDescription !== false, - requireReturnDescription = options.requireReturnDescription !== false; + requireReturnDescription = options.requireReturnDescription !== false, + requireReturnType = options.requireReturnType !== false, + preferType = options.preferType || {}, + checkPreferType = Object.keys(preferType).length !== 0; //-------------------------------------------------------------------------- // Helpers @@ -32,13 +36,27 @@ module.exports = function(context) { // Using a stack to store if a function returns or not (handling nested functions) var fns = []; + /** + * Check if node type is a Class + * @param {ASTNode} node node to check. + * @returns {boolean} True is its a class + * @private + */ + function isTypeClass(node) { + return node.type === "ClassExpression" || node.type === "ClassDeclaration"; + } + /** * When parsing a new function, store it in our function stack. + * @param {ASTNode} node A function node to check. * @returns {void} * @private */ - function startFunction() { - fns.push({returnPresent: false}); + function startFunction(node) { + fns.push({ + returnPresent: (node.type === "ArrowFunctionExpression" && node.body.type !== "BlockStatement") || + isTypeClass(node) + }); } /** @@ -55,6 +73,105 @@ module.exports = function(context) { } } + /** + * Check if return tag type is void or undefined + * @param {Object} tag JSDoc tag + * @returns {boolean} True if its of type void or undefined + * @private + */ + function isValidReturnType(tag) { + return tag.type === null || tag.type.name === "void" || tag.type.type === "UndefinedLiteral"; + } + + /** + * Check if type should be validated based on some exceptions + * @param {Object} type JSDoc tag + * @returns {boolean} True if it can be validated + * @private + */ + function canTypeBeValidated(type) { + return type !== "UndefinedLiteral" && // {undefined} as there is no name property available. + type !== "NullLiteral" && // {null} + type !== "NullableLiteral" && // {?} + type !== "FunctionType" && // {function(a)} + type !== "AllLiteral"; // {*} + } + + /** + * Extract the current and expected type based on the input type object + * @param {Object} type JSDoc tag + * @returns {Object} current and expected type object + * @private + */ + function getCurrentExpectedTypes(type) { + var currentType; + var expectedType; + + if (type.name) { + currentType = type.name; + } else if (type.expression) { + currentType = type.expression.name; + } + + expectedType = currentType && preferType[currentType]; + + return { + currentType: currentType, + expectedType: expectedType + }; + } + + /** + * Check if return tag type is void or undefined + * @param {Object} jsdocNode JSDoc node + * @param {Object} type JSDoc tag + * @returns {void} + * @private + */ + function validateType(jsdocNode, type) { + if (!type || !canTypeBeValidated(type.type)) { + return; + } + + var typesToCheck = []; + var elements = []; + + switch (type.type) { + case "TypeApplication": // {Array.} + elements = type.applications[0].type === "UnionType" ? type.applications[0].elements : type.applications; + typesToCheck.push(getCurrentExpectedTypes(type)); + break; + case "RecordType": // {{20:String}} + elements = type.fields; + break; + case "UnionType": // {String|number|Test} + case "ArrayType": // {[String, number, Test]} + elements = type.elements; + break; + case "FieldType": // Array.<{count: number, votes: number}> + typesToCheck.push(getCurrentExpectedTypes(type.value)); + break; + default: + typesToCheck.push(getCurrentExpectedTypes(type)); + } + + elements.forEach(validateType.bind(null, jsdocNode)); + + typesToCheck.forEach(function(typeToCheck) { + if (typeToCheck.expectedType && + typeToCheck.expectedType !== typeToCheck.currentType) { + context.report({ + node: jsdocNode, + message: "Use '{{expectedType}}' instead of '{{currentType}}'.", + data: { + currentType: typeToCheck.currentType, + expectedType: typeToCheck.expectedType + } + }); + } + }); + } + /** * Validate the JSDoc node and output warnings if anything is wrong. * @param {ASTNode} node The AST node to check. @@ -62,10 +179,12 @@ module.exports = function(context) { * @private */ function checkJSDoc(node) { - var jsdocNode = context.getJSDocComment(node), + var jsdocNode = sourceCode.getJSDocComment(node), functionData = fns.pop(), hasReturns = false, hasConstructor = false, + isInterface = false, + isOverride = false, params = Object.create(null), jsdoc; @@ -91,9 +210,11 @@ module.exports = function(context) { jsdoc.tags.forEach(function(tag) { - switch (tag.title) { + switch (tag.title.toLowerCase()) { case "param": + case "arg": + case "argument": if (!tag.type) { context.report(jsdocNode, "Missing JSDoc parameter type for '{{name}}'.", { name: tag.name }); } @@ -113,14 +234,14 @@ module.exports = function(context) { case "returns": hasReturns = true; - if (!requireReturn && !functionData.returnPresent && tag.type.name !== "void" && tag.type.name !== "undefined") { + if (!requireReturn && !functionData.returnPresent && (tag.type === null || !isValidReturnType(tag))) { context.report(jsdocNode, "Unexpected @" + tag.title + " tag; function has no return statement."); } else { - if (!tag.type) { + if (requireReturnType && !tag.type) { context.report(jsdocNode, "Missing JSDoc return type."); } - if (tag.type.name !== "void" && !tag.description && requireReturnDescription) { + if (!isValidReturnType(tag) && !tag.description && requireReturnDescription) { context.report(jsdocNode, "Missing JSDoc return description."); } } @@ -132,43 +253,72 @@ module.exports = function(context) { hasConstructor = true; break; + case "override": + case "inheritdoc": + isOverride = true; + break; + + case "interface": + isInterface = true; + break; + // no default } // check tag preferences - if (prefer.hasOwnProperty(tag.title)) { + if (prefer.hasOwnProperty(tag.title) && tag.title !== prefer[tag.title]) { context.report(jsdocNode, "Use @{{name}} instead.", { name: prefer[tag.title] }); } + // validate the types + if (checkPreferType && tag.type) { + validateType(jsdocNode, tag.type); + } }); // check for functions missing @returns - if (!hasReturns && !hasConstructor && node.parent.kind !== "get") { + if (!isOverride && !hasReturns && !hasConstructor && !isInterface && + node.parent.kind !== "get" && node.parent.kind !== "constructor" && + node.parent.kind !== "set" && !isTypeClass(node)) { if (requireReturn || functionData.returnPresent) { - context.report(jsdocNode, "Missing JSDoc @returns for function."); + context.report(jsdocNode, "Missing JSDoc @" + (prefer.returns || "returns") + " for function."); } } // check the parameters var jsdocParams = Object.keys(params); - node.params.forEach(function(param, i) { - var name = param.name; - - // TODO(nzakas): Figure out logical things to do with destructured, default, rest params - if (param.type === "Identifier") { - if (jsdocParams[i] && (name !== jsdocParams[i])) { - context.report(jsdocNode, "Expected JSDoc for '{{name}}' but found '{{jsdocName}}'.", { - name: name, - jsdocName: jsdocParams[i] - }); - } else if (!params[name]) { - context.report(jsdocNode, "Missing JSDoc for parameter '{{name}}'.", { - name: name - }); + if (node.params) { + node.params.forEach(function(param, i) { + var name = param.name; + + if (param.type === "AssignmentPattern") { + name = param.left.name; + } + + // TODO(nzakas): Figure out logical things to do with destructured, default, rest params + if (param.type === "Identifier" || param.type === "AssignmentPattern") { + if (jsdocParams[i] && (name !== jsdocParams[i])) { + context.report(jsdocNode, "Expected JSDoc for '{{name}}' but found '{{jsdocName}}'.", { + name: name, + jsdocName: jsdocParams[i] + }); + } else if (!params[name] && !isOverride) { + context.report(jsdocNode, "Missing JSDoc for parameter '{{name}}'.", { + name: name + }); + } } + }); + } + + if (options.matchDescription) { + var regex = new RegExp(options.matchDescription); + + if (!regex.test(jsdoc.description)) { + context.report(jsdocNode, "JSDoc description does not satisfy the regex pattern."); } - }); + } } @@ -182,9 +332,13 @@ module.exports = function(context) { "ArrowFunctionExpression": startFunction, "FunctionExpression": startFunction, "FunctionDeclaration": startFunction, + "ClassExpression": startFunction, + "ClassDeclaration": startFunction, "ArrowFunctionExpression:exit": checkJSDoc, "FunctionExpression:exit": checkJSDoc, "FunctionDeclaration:exit": checkJSDoc, + "ClassExpression:exit": checkJSDoc, + "ClassDeclaration:exit": checkJSDoc, "ReturnStatement": addReturn }; @@ -200,6 +354,12 @@ module.exports.schema = [ "type": "string" } }, + "preferType": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, "requireReturn": { "type": "boolean" }, @@ -208,6 +368,12 @@ module.exports.schema = [ }, "requireReturnDescription": { "type": "boolean" + }, + "matchDescription": { + "type": "string" + }, + "requireReturnType": { + "type": "boolean" } }, "additionalProperties": false diff --git a/tools/eslint/lib/rules/valid-typeof.js b/tools/eslint/lib/rules/valid-typeof.js index cbeb7b12e8f800..d67a46bf3dd7ce 100644 --- a/tools/eslint/lib/rules/valid-typeof.js +++ b/tools/eslint/lib/rules/valid-typeof.js @@ -19,7 +19,7 @@ module.exports = function(context) { return { - "UnaryExpression": function (node) { + "UnaryExpression": function(node) { var parent, sibling; if (node.operator === "typeof") { diff --git a/tools/eslint/lib/rules/vars-on-top.js b/tools/eslint/lib/rules/vars-on-top.js index 5917c674ec4680..ae009f85ad4c27 100644 --- a/tools/eslint/lib/rules/vars-on-top.js +++ b/tools/eslint/lib/rules/vars-on-top.js @@ -11,8 +11,8 @@ // Rule Definition //------------------------------------------------------------------------------ -module.exports = function (context) { - var errorMessage = "All \"var\" declarations must be at the top of the function scope."; +module.exports = function(context) { + var errorMessage = "All 'var' declarations must be at the top of the function scope."; //-------------------------------------------------------------------------- // Helpers @@ -44,7 +44,8 @@ module.exports = function (context) { * @returns {Boolean} True if var is on top otherwise false */ function isVarOnTop(node, statements) { - var i = 0, l = statements.length; + var i = 0, + l = statements.length; // skip over directives for (; i < l; ++i) { @@ -54,13 +55,17 @@ module.exports = function (context) { } for (; i < l; ++i) { - if (statements[i].type !== "VariableDeclaration") { + if (statements[i].type !== "VariableDeclaration" && + (statements[i].type !== "ExportNamedDeclaration" || + statements[i].declaration.type !== "VariableDeclaration")) { return false; } if (statements[i] === node) { return true; } } + + return false; } /** @@ -95,13 +100,19 @@ module.exports = function (context) { //-------------------------------------------------------------------------- return { - "VariableDeclaration": function (node) { + "VariableDeclaration": function(node) { var ancestors = context.getAncestors(); var parent = ancestors.pop(); var grandParent = ancestors.pop(); - if (node.kind === "var") {// check variable is `var` type and not `let` or `const` - if (parent.type === "Program") {// That means its a global variable + if (node.kind === "var") { // check variable is `var` type and not `let` or `const` + if (parent.type === "ExportNamedDeclaration") { + node = parent; + parent = grandParent; + grandParent = ancestors.pop(); + } + + if (parent.type === "Program") { // That means its a global variable globalVarCheck(node, parent); } else { blockScopeVarCheck(node, parent, grandParent); diff --git a/tools/eslint/lib/rules/wrap-iife.js b/tools/eslint/lib/rules/wrap-iife.js index 6291425efb86f9..ac5c8a45f02a01 100644 --- a/tools/eslint/lib/rules/wrap-iife.js +++ b/tools/eslint/lib/rules/wrap-iife.js @@ -14,9 +14,16 @@ module.exports = function(context) { var style = context.options[0] || "outside"; + /** + * Check if the node is wrapped in () + * @param {ASTNode} node node to evaluate + * @returns {boolean} True if it is wrapped + * @private + */ function wrapped(node) { var previousToken = context.getTokenBefore(node), nextToken = context.getTokenAfter(node); + return previousToken && previousToken.value === "(" && nextToken && nextToken.value === ")"; } diff --git a/tools/eslint/lib/rules/yield-star-spacing.js b/tools/eslint/lib/rules/yield-star-spacing.js new file mode 100644 index 00000000000000..c69594ae15a7d2 --- /dev/null +++ b/tools/eslint/lib/rules/yield-star-spacing.js @@ -0,0 +1,102 @@ +/** + * @fileoverview Rule to check the spacing around the * in yield* expressions. + * @author Bryan Smith + * @copyright 2015 Bryan Smith. All rights reserved. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var sourceCode = context.getSourceCode(); + + var mode = (function(option) { + if (!option || typeof option === "string") { + return { + before: { before: true, after: false }, + after: { before: false, after: true }, + both: { before: true, after: true }, + neither: { before: false, after: false } + }[option || "after"]; + } + return option; + }(context.options[0])); + + /** + * Checks the spacing between two tokens before or after the star token. + * @param {string} side Either "before" or "after". + * @param {Token} leftToken `function` keyword token if side is "before", or + * star token if side is "after". + * @param {Token} rightToken Star token if side is "before", or identifier + * token if side is "after". + * @returns {void} + */ + function checkSpacing(side, leftToken, rightToken) { + if (sourceCode.isSpaceBetweenTokens(leftToken, rightToken) !== mode[side]) { + var after = leftToken.value === "*"; + var spaceRequired = mode[side]; + var node = after ? leftToken : rightToken; + var type = spaceRequired ? "Missing" : "Unexpected"; + var message = type + " space " + side + " *."; + + context.report({ + node: node, + message: message, + fix: function(fixer) { + if (spaceRequired) { + if (after) { + return fixer.insertTextAfter(node, " "); + } + return fixer.insertTextBefore(node, " "); + } + return fixer.removeRange([leftToken.range[1], rightToken.range[0]]); + } + }); + } + } + + /** + * Enforces the spacing around the star if node is a yield* expression. + * @param {ASTNode} node A yield expression node. + * @returns {void} + */ + function checkExpression(node) { + if (!node.delegate) { + return; + } + + var tokens = sourceCode.getFirstTokens(node, 3); + var yieldToken = tokens[0]; + var starToken = tokens[1]; + var nextToken = tokens[2]; + + checkSpacing("before", yieldToken, starToken); + checkSpacing("after", starToken, nextToken); + } + + return { + "YieldExpression": checkExpression + }; + +}; + +module.exports.schema = [ + { + "oneOf": [ + { + "enum": ["before", "after", "both", "neither"] + }, + { + "type": "object", + "properties": { + "before": {"type": "boolean"}, + "after": {"type": "boolean"} + }, + "additionalProperties": false + } + ] + } +]; diff --git a/tools/eslint/lib/rules/yoda.js b/tools/eslint/lib/rules/yoda.js index ab5e7d04c92bdb..a5ff4a962632c4 100644 --- a/tools/eslint/lib/rules/yoda.js +++ b/tools/eslint/lib/rules/yoda.js @@ -96,15 +96,20 @@ function same(a, b) { switch (a.type) { case "Identifier": return a.name === b.name; + case "Literal": return a.value === b.value; + case "MemberExpression": + // x[0] = x[0] // x[y] = x[y] // x.y = x.y return same(a.object, b.object) && same(a.property, b.property); + case "ThisExpression": return true; + default: return false; } @@ -114,7 +119,7 @@ function same(a, b) { // Rule Definition //------------------------------------------------------------------------------ -module.exports = function (context) { +module.exports = function(context) { // Default to "never" (!always) if no option var always = (context.options[0] === "always"); @@ -197,6 +202,7 @@ module.exports = function (context) { // Comparisons must always be yoda-style: if ("blue" === color) if ( (node.right.type === "Literal" || looksLikeLiteral(node.right)) && + !(node.left.type === "Literal" || looksLikeLiteral(node.left)) && !(!isEqualityOperator(node.operator) && onlyEquality) && isComparisonOperator(node.operator) && !(exceptRange && isRangeTest(context.getAncestors().pop())) @@ -209,6 +215,7 @@ module.exports = function (context) { // Comparisons must never be yoda-style (default) if ( (node.left.type === "Literal" || looksLikeLiteral(node.left)) && + !(node.right.type === "Literal" || looksLikeLiteral(node.right)) && !(!isEqualityOperator(node.operator) && onlyEquality) && isComparisonOperator(node.operator) && !(exceptRange && isRangeTest(context.getAncestors().pop())) diff --git a/tools/eslint/lib/testers/event-generator-tester.js b/tools/eslint/lib/testers/event-generator-tester.js new file mode 100644 index 00000000000000..c275a74b7607e9 --- /dev/null +++ b/tools/eslint/lib/testers/event-generator-tester.js @@ -0,0 +1,64 @@ +/** + * @fileoverview Helpers to test EventGenerator interface. + * @author Toru Nagashima + * @copyright 2015 Toru Nagashima. All rights reserved. + * See LICENSE file in root directory for full license. + */ +"use strict"; + +/* global describe, it */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var assert = require("assert"); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + + /** + * Overrideable `describe` function to test. + * @param {string} text - A description. + * @param {function} method - A test logic. + * @returns {any} The returned value with the test logic. + */ + describe: (typeof describe === "function") ? describe : /* istanbul ignore next */ function(text, method) { + return method.apply(this); + }, + + /** + * Overrideable `it` function to test. + * @param {string} text - A description. + * @param {function} method - A test logic. + * @returns {any} The returned value with the test logic. + */ + it: (typeof it === "function") ? it : /* istanbul ignore next */ function(text, method) { + return method.apply(this); + }, + + /** + * Does some tests to check a given object implements the EventGenerator interface. + * @param {object} instance - An object to check. + * @returns {void} + */ + testEventGeneratorInterface: function(instance) { + this.describe("should implement EventGenerator interface", function() { + this.it("should have `emitter` property.", function() { + assert.equal(typeof instance.emitter, "object"); + assert.equal(typeof instance.emitter.emit, "function"); + }); + + this.it("should have `enterNode` property.", function() { + assert.equal(typeof instance.enterNode, "function"); + }); + + this.it("should have `leaveNode` property.", function() { + assert.equal(typeof instance.leaveNode, "function"); + }); + }.bind(this)); + } +}; diff --git a/tools/eslint/lib/testers/rule-tester.js b/tools/eslint/lib/testers/rule-tester.js new file mode 100644 index 00000000000000..ce4ca1c4ba8a84 --- /dev/null +++ b/tools/eslint/lib/testers/rule-tester.js @@ -0,0 +1,463 @@ +/** + * @fileoverview Mocha test wrapper + * @author Ilya Volodin + * @copyright 2015 Kevin Partington. All rights reserved. + * @copyright 2015 Nicholas C. Zakas. All rights reserved. + * @copyright 2014 Ilya Volodin. All rights reserved. + * See LICENSE file in root directory for full license. + */ +"use strict"; + +/* global describe, it */ + +/* + * This is a wrapper around mocha to allow for DRY unittests for eslint + * Format: + * RuleTester.add("{ruleName}", { + * valid: [ + * "{code}", + * { code: "{code}", options: {options}, global: {globals}, globals: {globals}, parser: "{parser}", settings: {settings} } + * ], + * invalid: [ + * { code: "{code}", errors: {numErrors} }, + * { code: "{code}", errors: ["{errorMessage}"] }, + * { code: "{code}", options: {options}, global: {globals}, parser: "{parser}", settings: {settings}, errors: [{ message: "{errorMessage}", type: "{errorNodeType}"}] } + * ] + * }); + * + * Variables: + * {code} - String that represents the code to be tested + * {options} - Arguments that are passed to the configurable rules. + * {globals} - An object representing a list of variables that are + * registered as globals + * {parser} - String representing the parser to use + * {settings} - An object representing global settings for all rules + * {numErrors} - If failing case doesn't need to check error message, + * this integer will specify how many errors should be + * received + * {errorMessage} - Message that is returned by the rule on failure + * {errorNodeType} - AST node type that is returned by they rule as + * a cause of the failure. + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var lodash = require("lodash"), + assert = require("assert"), + util = require("util"), + validator = require("../config/config-validator"), + validate = require("is-my-json-valid"), + eslint = require("../eslint"), + rules = require("../rules"), + metaSchema = require("../../conf/json-schema-schema.json"), + SourceCodeFixer = require("../util/source-code-fixer"); + +//------------------------------------------------------------------------------ +// Private Members +//------------------------------------------------------------------------------ + +/* + * testerDefaultConfig must not be modified as it allows to reset the tester to + * the initial default configuration + */ +var testerDefaultConfig = { rules: {} }; +var defaultConfig = { rules: {} }; + +/* + * List every parameters possible on a test case that are not related to eslint + * configuration + */ +var RuleTesterParameters = [ + "code", + "filename", + "options", + "args", + "errors" +]; + +var validateSchema = validate(metaSchema, { verbose: true }); + +var hasOwnProperty = Function.call.bind(Object.hasOwnProperty); + +/** + * Clones a given value deeply. + * Note: This ignores `parent` property. + * + * @param {any} x - A value to clone. + * @returns {any} A cloned value. + */ +function cloneDeeplyExcludesParent(x) { + if (typeof x === "object" && x !== null) { + if (Array.isArray(x)) { + return x.map(cloneDeeplyExcludesParent); + } + + var retv = {}; + + for (var key in x) { + if (key !== "parent" && hasOwnProperty(x, key)) { + retv[key] = cloneDeeplyExcludesParent(x[key]); + } + } + + return retv; + } + + return x; +} + +/** + * Freezes a given value deeply. + * + * @param {any} x - A value to freeze. + * @returns {void} + */ +function freezeDeeply(x) { + if (typeof x === "object" && x !== null) { + if (Array.isArray(x)) { + x.forEach(freezeDeeply); + } else { + for (var key in x) { + if (key !== "parent" && hasOwnProperty(x, key)) { + freezeDeeply(x[key]); + } + } + } + Object.freeze(x); + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Creates a new instance of RuleTester. + * @param {Object} [testerConfig] Optional, extra configuration for the tester + * @constructor + */ +function RuleTester(testerConfig) { + + /** + * The configuration to use for this tester. Combination of the tester + * configuration and the default configuration. + * @type {Object} + */ + this.testerConfig = lodash.merge( + + // we have to clone because merge uses the first argument for recipient + lodash.cloneDeep(defaultConfig), + testerConfig + ); +} + +/** + * Set the configuration to use for all future tests + * @param {Object} config the configuration to use. + * @returns {void} + */ +RuleTester.setDefaultConfig = function(config) { + if (typeof config !== "object") { + throw new Error("RuleTester.setDefaultConfig: config must be an object"); + } + defaultConfig = config; + + // Make sure the rules object exists since it is assumed to exist later + defaultConfig.rules = defaultConfig.rules || {}; +}; + +/** + * Get the current configuration used for all tests + * @returns {Object} the current configuration + */ +RuleTester.getDefaultConfig = function() { + return defaultConfig; +}; + +/** + * Reset the configuration to the initial configuration of the tester removing + * any changes made until now. + * @returns {void} + */ +RuleTester.resetDefaultConfig = function() { + defaultConfig = lodash.cloneDeep(testerDefaultConfig); +}; + +// default separators for testing +RuleTester.describe = (typeof describe === "function") ? describe : /* istanbul ignore next */ function(text, method) { + return method.apply(this); +}; + +RuleTester.it = (typeof it === "function") ? it : /* istanbul ignore next */ function(text, method) { + return method.apply(this); +}; + +RuleTester.prototype = { + + /** + * Define a rule for one particular run of tests. + * @param {string} name The name of the rule to define. + * @param {Function} rule The rule definition. + * @returns {void} + */ + defineRule: function(name, rule) { + eslint.defineRule(name, rule); + }, + + /** + * Adds a new rule test to execute. + * @param {string} ruleName The name of the rule to run. + * @param {Function} rule The rule to test. + * @param {Object} test The collection of tests to run. + * @returns {void} + */ + run: function(ruleName, rule, test) { + + var testerConfig = this.testerConfig, + result = {}; + + /* eslint-disable no-shadow */ + + /** + * Run the rule for the given item + * @param {string} ruleName name of the rule + * @param {string|object} item Item to run the rule against + * @returns {object} Eslint run result + * @private + */ + function runRuleForItem(ruleName, item) { + var config = lodash.cloneDeep(testerConfig), + code, filename, schema, beforeAST, afterAST; + + if (typeof item === "string") { + code = item; + } else { + code = item.code; + + // Assumes everything on the item is a config except for the + // parameters used by this tester + var itemConfig = lodash.omit(item, RuleTesterParameters); + + // Create the config object from the tester config and this item + // specific configurations. + config = lodash.merge( + config, + itemConfig + ); + } + + if (item.filename) { + filename = item.filename; + } + + if (item.options) { + var options = item.options.concat(); + + options.unshift(1); + config.rules[ruleName] = options; + } else { + config.rules[ruleName] = 1; + } + + eslint.defineRule(ruleName, rule); + + schema = validator.getRuleOptionsSchema(ruleName); + + if (schema) { + validateSchema(schema); + + if (validateSchema.errors) { + throw new Error([ + "Schema for rule " + ruleName + " is invalid:" + ].concat(validateSchema.errors.map(function(error) { + return "\t" + error.field + ": " + error.message; + })).join("\n")); + } + } + + validator.validate(config, "rule-tester"); + + /* + * Setup AST getters. + * The goal is to check whether or not AST was modified when + * running the rule under test. + */ + eslint.reset(); + eslint.on("Program", function(node) { + beforeAST = cloneDeeplyExcludesParent(node); + + eslint.on("Program:exit", function(node) { + afterAST = cloneDeeplyExcludesParent(node); + }); + }); + + // Freezes rule-context properties. + var originalGet = rules.get; + + try { + rules.get = function(ruleId) { + var rule = originalGet(ruleId); + + if (typeof rule === "function") { + return function(context) { + Object.freeze(context); + freezeDeeply(context.options); + freezeDeeply(context.settings); + freezeDeeply(context.parserOptions); + + return rule(context); + }; + } else { + return { + meta: rule.meta, + create: function(context) { + Object.freeze(context); + freezeDeeply(context.options); + freezeDeeply(context.settings); + freezeDeeply(context.parserOptions); + + return rule.create(context); + } + }; + } + }; + + return { + messages: eslint.verify(code, config, filename, true), + beforeAST: beforeAST, + afterAST: afterAST + }; + } finally { + rules.get = originalGet; + } + } + + /** + * Check if the template is valid or not + * all valid cases go through this + * @param {string} ruleName name of the rule + * @param {string|object} item Item to run the rule against + * @returns {void} + * @private + */ + function testValidTemplate(ruleName, item) { + var result = runRuleForItem(ruleName, item); + var messages = result.messages; + + assert.equal(messages.length, 0, util.format("Should have no errors but had %d: %s", + messages.length, util.inspect(messages))); + + assert.deepEqual( + result.beforeAST, + result.afterAST, + "Rule should not modify AST." + ); + } + + /** + * Check if the template is invalid or not + * all invalid cases go through this. + * @param {string} ruleName name of the rule + * @param {string|object} item Item to run the rule against + * @returns {void} + * @private + */ + function testInvalidTemplate(ruleName, item) { + assert.ok(item.errors || item.errors === 0, + "Did not specify errors for an invalid test of " + ruleName); + + var result = runRuleForItem(ruleName, item); + var messages = result.messages; + + + + if (typeof item.errors === "number") { + assert.equal(messages.length, item.errors, util.format("Should have %d error%s but had %d: %s", + item.errors, item.errors === 1 ? "" : "s", messages.length, util.inspect(messages))); + } else { + assert.equal(messages.length, item.errors.length, + util.format("Should have %d error%s but had %d: %s", + item.errors.length, item.errors.length === 1 ? "" : "s", messages.length, util.inspect(messages))); + + for (var i = 0, l = item.errors.length; i < l; i++) { + assert.ok(!("fatal" in messages[i]), "A fatal parsing error occurred: " + messages[i].message); + assert.equal(messages[i].ruleId, ruleName, "Error rule name should be the same as the name of the rule being tested"); + + if (typeof item.errors[i] === "string") { + + // Just an error message. + assert.equal(messages[i].message, item.errors[i], "Error message should be " + item.errors[i]); + } else if (typeof item.errors[i] === "object") { + + /* + * Error object. + * This may have a message, node type, line, and/or + * column. + */ + if (item.errors[i].message) { + assert.equal(messages[i].message, item.errors[i].message, "Error message should be " + item.errors[i].message); + } + + if (item.errors[i].type) { + assert.equal(messages[i].nodeType, item.errors[i].type, "Error type should be " + item.errors[i].type); + } + + if (item.errors[i].hasOwnProperty("line")) { + assert.equal(messages[i].line, item.errors[i].line, "Error line should be " + item.errors[i].line); + } + + if (item.errors[i].hasOwnProperty("column")) { + assert.equal(messages[i].column, item.errors[i].column, "Error column should be " + item.errors[i].column); + } + } else { + + // Only string or object errors are valid. + assert.fail(messages[i], null, "Error should be a string or object."); + } + } + + if (item.hasOwnProperty("output")) { + var fixResult = SourceCodeFixer.applyFixes(eslint.getSourceCode(), messages); + + assert.equal(fixResult.output, item.output, "Output is incorrect."); + } + + } + + assert.deepEqual( + result.beforeAST, + result.afterAST, + "Rule should not modify AST." + ); + } + + /* + * This creates a mocha test suite and pipes all supplied info through + * one of the templates above. + */ + RuleTester.describe(ruleName, function() { + RuleTester.describe("valid", function() { + test.valid.forEach(function(valid) { + RuleTester.it(valid.code || valid, function() { + testValidTemplate(ruleName, valid); + }); + }); + }); + + RuleTester.describe("invalid", function() { + test.invalid.forEach(function(invalid) { + RuleTester.it(invalid.code, function() { + testInvalidTemplate(ruleName, invalid); + }); + }); + }); + }); + + return result.suite; + } +}; + + +module.exports = RuleTester; diff --git a/tools/eslint/lib/timing.js b/tools/eslint/lib/timing.js index 06e8da70b97e58..c1346480fd8a30 100644 --- a/tools/eslint/lib/timing.js +++ b/tools/eslint/lib/timing.js @@ -11,11 +11,27 @@ //------------------------------------------------------------------------------ /* istanbul ignore next */ +/** + * Align the string to left + * @param {string} str string to evaluate + * @param {int} len length of the string + * @param {string} ch delimiter character + * @returns {string} modified string + * @private + */ function alignLeft(str, len, ch) { return str + new Array(len - str.length + 1).join(ch || " "); } /* istanbul ignore next */ +/** + * Align the string to right + * @param {string} str string to evaluate + * @param {int} len length of the string + * @param {string} ch delimiter character + * @returns {string} modified string + * @private + */ function alignRight(str, len, ch) { return new Array(len - str.length + 1).join(ch || " ") + str; } @@ -30,11 +46,18 @@ var HEADERS = ["Rule", "Time (ms)", "Relative"]; var ALIGN = [alignLeft, alignRight, alignRight]; /* istanbul ignore next */ +/** + * display the data + * @param {object} data Data object to be displayed + * @returns {string} modified string + * @private + */ function display(data) { var total = 0; var rows = Object.keys(data) .map(function(key) { var time = data[key]; + total += time; return [key, time]; }) @@ -51,8 +74,12 @@ function display(data) { rows.unshift(HEADERS); var widths = []; + rows.forEach(function(row) { - var len = row.length, i, n; + var len = row.length, + i, + n; + for (i = 0; i < len; i++) { n = row[i].length; if (!widths[i] || n > widths[i]) { @@ -66,6 +93,7 @@ function display(data) { return ALIGN[index](cell, widths[index]); }).join(" | "); }); + table.splice(1, 0, widths.map(function(w, index) { if (index !== 0 && index !== widths.length - 1) { w++; @@ -82,6 +110,13 @@ module.exports = (function() { var data = Object.create(null); + /** + * Time the run + * @param {*} key key from the data object + * @param {Function} fn function to be called + * @returns {Function} function to be executed + * @private + */ function time(key, fn) { if (typeof data[key] === "undefined") { data[key] = 0; @@ -89,6 +124,7 @@ module.exports = (function() { return function() { var t = process.hrtime(); + fn.apply(null, Array.prototype.slice.call(arguments)); t = process.hrtime(t); data[key] += t[0] * 1e3 + t[1] / 1e6; diff --git a/tools/eslint/lib/token-store.js b/tools/eslint/lib/token-store.js index 6a0149414236b7..91409b7eedde19 100644 --- a/tools/eslint/lib/token-store.js +++ b/tools/eslint/lib/token-store.js @@ -76,6 +76,7 @@ module.exports = function(tokens) { */ api.getTokensBefore = function(node, beforeCount) { var first = starts[node.range[0]]; + return get(first - (beforeCount || 0), first); }; @@ -100,6 +101,7 @@ module.exports = function(tokens) { */ api.getTokensAfter = function(node, afterCount) { var start = lastTokenIndex(node) + 1; + return get(start, start + (afterCount || 0)); }; @@ -136,6 +138,7 @@ module.exports = function(tokens) { */ api.getFirstTokens = function(node, count) { var first = starts[node.range[0]]; + return get( first, Math.min(lastTokenIndex(node) + 1, first + (count || 0)) @@ -160,6 +163,7 @@ module.exports = function(tokens) { */ api.getLastTokens = function(node, count) { var last = lastTokenIndex(node) + 1; + return get(Math.max(starts[node.range[0]], last - (count || 0)), last); }; diff --git a/tools/eslint/lib/util.js b/tools/eslint/lib/util.js deleted file mode 100644 index 9fe594a4aed093..00000000000000 --- a/tools/eslint/lib/util.js +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @fileoverview Common utilities. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Constants -//------------------------------------------------------------------------------ - -var PLUGIN_NAME_PREFIX = "eslint-plugin-", - NAMESPACE_REGEX = /^@.*\//i; - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -/** - * Merges two config objects. This will not only add missing keys, but will also modify values to match. - * @param {Object} base config object - * @param {Object} custom config object. Overrides in this config object will take priority over base. - * @returns {Object} merged config object. - */ -exports.mergeConfigs = function mergeConfigs(base, custom) { - - Object.keys(custom).forEach(function (key) { - var property = custom[key]; - - if (key === "plugins") { - if (!base[key]) { - base[key] = []; - } - - property.forEach(function (plugin) { - // skip duplicates - if (base[key].indexOf(plugin) === -1) { - base[key].push(plugin); - } - }); - return; - } - - if (Array.isArray(base[key]) && !Array.isArray(property) && typeof property === "number") { - // assume that we are just overriding first attribute - base[key][0] = custom[key]; - return; - } - - if (typeof property === "object" && !Array.isArray(property) && property !== null) { - // base[key] might not exist, so be careful with recursion here - base[key] = mergeConfigs(base[key] || {}, custom[key]); - } else { - base[key] = custom[key]; - } - }); - - return base; -}; - -/** - * Removes the prefix `eslint-plugin-` from a plugin name. - * @param {string} pluginName The name of the plugin which may have the prefix. - * @returns {string} The name of the plugin without prefix. - */ -exports.removePluginPrefix = function removePluginPrefix(pluginName) { - return pluginName.indexOf(PLUGIN_NAME_PREFIX) === 0 ? pluginName.substring(PLUGIN_NAME_PREFIX.length) : pluginName; -}; - -/** - * @param {string} pluginName The name of the plugin which may have the prefix. - * @returns {string} The name of the plugins namepace if it has one. - */ -exports.getNamespace = function getNamespace(pluginName) { - return pluginName.match(NAMESPACE_REGEX) ? pluginName.match(NAMESPACE_REGEX)[0] : ""; -}; - -/** - * Removes the namespace from a plugin name. - * @param {string} pluginName The name of the plugin which may have the prefix. - * @returns {string} The name of the plugin without the namespace. - */ -exports.removeNameSpace = function removeNameSpace(pluginName) { - return pluginName.replace(NAMESPACE_REGEX, ""); -}; - -exports.PLUGIN_NAME_PREFIX = PLUGIN_NAME_PREFIX; diff --git a/tools/eslint/lib/util/comment-event-generator.js b/tools/eslint/lib/util/comment-event-generator.js new file mode 100644 index 00000000000000..90bbfe9f2f444e --- /dev/null +++ b/tools/eslint/lib/util/comment-event-generator.js @@ -0,0 +1,117 @@ +/** + * @fileoverview The event generator for comments. + * @author Toru Nagashima + * @copyright 2015 Toru Nagashima. All rights reserved. + * See LICENSE file in root directory for full license. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Check collection of comments to prevent double event for comment as + * leading and trailing, then emit event if passing + * @param {ASTNode[]} comments - Collection of comment nodes + * @param {EventEmitter} emitter - The event emitter which is the destination of events. + * @param {Object[]} locs - List of locations of previous comment nodes + * @param {string} eventName - Event name postfix + * @returns {void} + */ +function emitComments(comments, emitter, locs, eventName) { + if (comments.length > 0) { + comments.forEach(function(node) { + var index = locs.indexOf(node.loc); + + if (index >= 0) { + locs.splice(index, 1); + } else { + locs.push(node.loc); + emitter.emit(node.type + eventName, node); + } + }); + } +} + +/** + * Shortcut to check and emit enter of comment nodes + * @param {CommentEventGenerator} generator - A generator to emit. + * @param {ASTNode[]} comments - Collection of comment nodes + * @returns {void} + */ +function emitCommentsEnter(generator, comments) { + emitComments( + comments, + generator.emitter, + generator.commentLocsEnter, + "Comment"); +} + +/** + * Shortcut to check and emit exit of comment nodes + * @param {CommentEventGenerator} generator - A generator to emit. + * @param {ASTNode[]} comments Collection of comment nodes + * @returns {void} + */ +function emitCommentsExit(generator, comments) { + emitComments( + comments, + generator.emitter, + generator.commentLocsExit, + "Comment:exit"); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * The event generator for comments. + * This is the decorator pattern. + * This generates events of comments before/after events which are generated the original generator. + * + * @param {EventGenerator} originalEventGenerator - An event generator which is the decoration target. + * @param {SourceCode} sourceCode - A source code which has comments. + * @returns {CommentEventGenerator} new instance. + */ +function CommentEventGenerator(originalEventGenerator, sourceCode) { + this.original = originalEventGenerator; + this.emitter = originalEventGenerator.emitter; + this.sourceCode = sourceCode; + this.commentLocsEnter = []; + this.commentLocsExit = []; +} + +CommentEventGenerator.prototype = { + constructor: CommentEventGenerator, + + /** + * Emits an event of entering comments. + * @param {ASTNode} node - A node which was entered. + * @returns {void} + */ + enterNode: function enterNode(node) { + var comments = this.sourceCode.getComments(node); + + emitCommentsEnter(this, comments.leading); + this.original.enterNode(node); + emitCommentsEnter(this, comments.trailing); + }, + + /** + * Emits an event of leaving comments. + * @param {ASTNode} node - A node which was left. + * @returns {void} + */ + leaveNode: function leaveNode(node) { + var comments = this.sourceCode.getComments(node); + + emitCommentsExit(this, comments.trailing); + this.original.leaveNode(node); + emitCommentsExit(this, comments.leading); + } +}; + +module.exports = CommentEventGenerator; diff --git a/tools/eslint/lib/util/glob-util.js b/tools/eslint/lib/util/glob-util.js new file mode 100644 index 00000000000000..9a704d6308b833 --- /dev/null +++ b/tools/eslint/lib/util/glob-util.js @@ -0,0 +1,177 @@ +/** + * @fileoverview Utilities for working with globs and the filesystem. + * @author Ian VanSchooten + * @copyright 2015 Ian VanSchooten. All rights reserved. + * See LICENSE in root directory for full license. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var debug = require("debug"), + fs = require("fs"), + path = require("path"), + glob = require("glob"), + shell = require("shelljs"), + + pathUtil = require("./path-util"), + IgnoredPaths = require("../ignored-paths"); + +debug = debug("eslint:glob-util"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Checks if a provided path is a directory and returns a glob string matching + * all files under that directory if so, the path itself otherwise. + * + * Reason for this is that `glob` needs `/**` to collect all the files under a + * directory where as our previous implementation without `glob` simply walked + * a directory that is passed. So this is to maintain backwards compatibility. + * + * Also makes sure all path separators are POSIX style for `glob` compatibility. + * + * @param {object} [options] An options object + * @param {string[]} [options.extensions=[".js"]] An array of accepted extensions + * @param {string} [options.cwd=process.cwd()] The cwd to use to resolve relative pathnames + * @returns {Function} A function that takes a pathname and returns a glob that + * matches all files with the provided extensions if + * pathname is a directory. + */ +function processPath(options) { + var cwd = (options && options.cwd) || process.cwd(); + var extensions = (options && options.extensions) || [".js"]; + + extensions = extensions.map(function(ext) { + return ext.charAt(0) === "." ? ext.substr(1) : ext; + }); + + var suffix = "/**"; + + if (extensions.length === 1) { + suffix += "/*." + extensions[0]; + } else { + suffix += "/*.{" + extensions.join(",") + "}"; + } + + /** + * A function that converts a directory name to a glob pattern + * + * @param {string} pathname The directory path to be modified + * @returns {string} The glob path or the file path itself + * @private + */ + return function(pathname) { + var newPath = pathname; + var resolvedPath = path.resolve(cwd, pathname); + + if (shell.test("-d", resolvedPath)) { + newPath = pathname.replace(/[\/\\]$/, "") + suffix; + } + + return pathUtil.convertPathToPosix(newPath); + }; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Resolves any directory patterns into glob-based patterns for easier handling. + * @param {string[]} patterns File patterns (such as passed on the command line). + * @param {Object} options An options object. + * @returns {string[]} The equivalent glob patterns and filepath strings. + */ +function resolveFileGlobPatterns(patterns, options) { + + var processPathExtensions = processPath(options); + + return patterns.map(processPathExtensions); +} + +/** + * Build a list of absolute filesnames on which ESLint will act. + * Ignored files are excluded from the results, as are duplicates. + * + * @param {string[]} globPatterns Glob patterns. + * @param {Object} [options] An options object. + * @param {string} [options.cwd] CWD (considered for relative filenames) + * @param {boolean} [options.ignore] False disables use of .eslintignore. + * @param {string} [options.ignorePath] The ignore file to use instead of .eslintignore. + * @param {string} [options.ignorePattern] A pattern of files to ignore. + * @returns {string[]} Resolved absolute filenames. + */ +function listFilesToProcess(globPatterns, options) { + var ignoredPaths, + files = [], + added = {}, + globOptions; + + var cwd = (options && options.cwd) || process.cwd(); + + /** + * Executes the linter on a file defined by the `filename`. Skips + * unsupported file extensions and any files that are already linted. + * @param {string} filename The file to be processed + * @param {boolean} shouldWarnIgnored Whether or not a report should be made if + * the file is ignored + * @returns {void} + */ + function addFile(filename, shouldWarnIgnored) { + var ignored = false; + var isSilentlyIgnored; + + if (options.ignore !== false) { + if (ignoredPaths.contains(filename, "default")) { + isSilentlyIgnored = true; + } + if (ignoredPaths.contains(filename, "custom")) { + if (shouldWarnIgnored) { + ignored = true; + } else { + isSilentlyIgnored = true; + } + } + if (isSilentlyIgnored && !ignored) { + return; + } + } + if (added[filename]) { + return; + } + files.push({filename: filename, ignored: ignored}); + added[filename] = true; + } + + options = options || { ignore: true, dotfiles: true }; + ignoredPaths = new IgnoredPaths(options); + globOptions = { + nodir: true, + cwd: cwd + }; + + debug("Creating list of files to process."); + globPatterns.forEach(function(pattern) { + var file = path.resolve(cwd, pattern); + + if (shell.test("-f", file)) { + addFile(fs.realpathSync(file), !shell.test("-d", file)); + } else { + glob.sync(pattern, globOptions).forEach(function(globMatch) { + addFile(path.resolve(cwd, globMatch), false); + }); + } + }); + + return files; +} + +module.exports = { + resolveFileGlobPatterns: resolveFileGlobPatterns, + listFilesToProcess: listFilesToProcess +}; diff --git a/tools/eslint/lib/util/hash.js b/tools/eslint/lib/util/hash.js new file mode 100644 index 00000000000000..b0271bbf03dcbb --- /dev/null +++ b/tools/eslint/lib/util/hash.js @@ -0,0 +1,37 @@ +/** + * @fileoverview Defining the hashing function in one place. + * @author Michael Ficarra + * @copyright 2016 Michael Ficarra. All rights reserved. + * See LICENSE file in root directory for full license. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var murmur = require("imurmurhash"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/** + * hash the given string + * @param {string} str the string to hash + * @returns {string} the hash + */ +function hash(str) { + return murmur(str).result().toString(36); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = hash; diff --git a/tools/eslint/lib/util/keywords.js b/tools/eslint/lib/util/keywords.js new file mode 100644 index 00000000000000..dde29c6b76c06a --- /dev/null +++ b/tools/eslint/lib/util/keywords.js @@ -0,0 +1,68 @@ +/** + * @fileoverview A shared list of ES3 keywords. + * @author Josh Perez + * @copyright 2015 Jose Roberto Vidal. All rights reserved. + */ +"use strict"; + +module.exports = [ + "abstract", + "boolean", + "break", + "byte", + "case", + "catch", + "char", + "class", + "const", + "continue", + "debugger", + "default", + "delete", + "do", + "double", + "else", + "enum", + "export", + "extends", + "false", + "final", + "finally", + "float", + "for", + "function", + "goto", + "if", + "implements", + "import", + "in", + "instanceof", + "int", + "interface", + "long", + "native", + "new", + "null", + "package", + "private", + "protected", + "public", + "return", + "short", + "static", + "super", + "switch", + "synchronized", + "this", + "throw", + "throws", + "transient", + "true", + "try", + "typeof", + "var", + "void", + "volatile", + "while", + "with" +]; diff --git a/tools/eslint/lib/util/module-resolver.js b/tools/eslint/lib/util/module-resolver.js new file mode 100644 index 00000000000000..9df544cf2b6840 --- /dev/null +++ b/tools/eslint/lib/util/module-resolver.js @@ -0,0 +1,87 @@ +/** + * @fileoverview Implements the Node.js require.resolve algorithm + * @author Nicholas C. Zakas + * @copyright 2016 Nicholas C. Zakas. All rights reserved. + * See LICENSE file in root directory for full license. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var lodash = require("lodash"), + Module = require("module"); + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +var DEFAULT_OPTIONS = { + + /* + * module.paths is an array of paths to search for resolving things relative + * to this file. Module.globalPaths contains all of the special Node.js + * directories that can also be searched for modules. + */ + lookupPaths: module.paths.concat(Module.globalPaths) +}; + +/** + * Resolves modules based on a set of options. + * @param {Object} options The options for resolving modules. + * @param {string[]} options.lookupPaths An array of paths to include in the + * lookup with the highest priority paths coming first. + * @constructor + */ +function ModuleResolver(options) { + options = options || {}; + + this.options = lodash.assign({}, DEFAULT_OPTIONS, options); +} + +ModuleResolver.prototype = { + + /** + * Resolves the file location of a given module relative to the configured + * lookup paths. + * @param {string} name The module name to resolve. + * @param {string} extraLookupPath An extra path to look into for the module. + * This path is used with the highest priority. + * @returns {string} The resolved file path for the module. + * @throws {Error} If the module cannot be resolved. + */ + resolve: function(name, extraLookupPath) { + + /* + * First, clone the lookup paths so we're not messing things up for + * subsequent calls to this function. Then, move the extraLookupPath to the + * top of the lookup paths list so it will be searched first. + */ + var lookupPaths = this.options.lookupPaths.concat(); + + lookupPaths.unshift(extraLookupPath); + + /** + * Module._findPath is an internal method to Node.js, then one they use to + * lookup file paths when require() is called. So, we are hooking into the + * exact same logic that Node.js uses. + */ + var result = Module._findPath(name, lookupPaths); // eslint-disable-line no-underscore-dangle + + if (!result) { + throw new Error("Cannot find module '" + name + "'"); + } + + return result; + + } + +}; + +//------------------------------------------------------------------------------ +// Public API +//------------------------------------------------------------------------------ + +module.exports = ModuleResolver; diff --git a/tools/eslint/lib/util/node-event-generator.js b/tools/eslint/lib/util/node-event-generator.js new file mode 100644 index 00000000000000..002bd29dfe3ed0 --- /dev/null +++ b/tools/eslint/lib/util/node-event-generator.js @@ -0,0 +1,55 @@ +/** + * @fileoverview The event generator for AST nodes. + * @author Toru Nagashima + * @copyright 2015 Toru Nagashima. All rights reserved. + * See LICENSE file in root directory for full license. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * The event generator for AST nodes. + * This implements below interface. + * + * ```ts + * interface EventGenerator { + * emitter: EventEmitter; + * enterNode(node: ASTNode): void; + * leaveNode(node: ASTNode): void; + * } + * ``` + * + * @param {EventEmitter} emitter - An event emitter which is the destination of events. + * @returns {NodeEventGenerator} new instance. + */ +function NodeEventGenerator(emitter) { + this.emitter = emitter; +} + +NodeEventGenerator.prototype = { + constructor: NodeEventGenerator, + + /** + * Emits an event of entering AST node. + * @param {ASTNode} node - A node which was entered. + * @returns {void} + */ + enterNode: function enterNode(node) { + this.emitter.emit(node.type, node); + }, + + /** + * Emits an event of leaving AST node. + * @param {ASTNode} node - A node which was left. + * @returns {void} + */ + leaveNode: function leaveNode(node) { + this.emitter.emit(node.type + ":exit", node); + } +}; + +module.exports = NodeEventGenerator; diff --git a/tools/eslint/lib/util/npm-util.js b/tools/eslint/lib/util/npm-util.js new file mode 100644 index 00000000000000..c45f0790115347 --- /dev/null +++ b/tools/eslint/lib/util/npm-util.js @@ -0,0 +1,129 @@ +/** + * @fileoverview Utility for executing npm commands. + * @author Ian VanSchooten + * @copyright 2016 Ilya Volodin. All rights reserved. + * See LICENSE file in root directory for full license. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var fs = require("fs"), + path = require("path"), + shell = require("shelljs"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Find the closest package.json file, starting at process.cwd (by default), + * and working up to root. + * + * @param {string} [startDir=process.cwd()] Starting directory + * @returns {string} Absolute path to closest package.json file + */ +function findPackageJson(startDir) { + var dir = path.resolve(startDir || process.cwd()); + + do { + var pkgfile = path.join(dir, "package.json"); + + if (!fs.existsSync(pkgfile)) { + dir = path.join(dir, ".."); + continue; + } + return pkgfile; + } while (dir !== path.resolve(dir, "..")); + return null; +} + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/** + * Install node modules synchronously and save to devDependencies in package.json + * @param {string|string[]} packages Node module or modules to install + * @returns {void} + */ +function installSyncSaveDev(packages) { + if (Array.isArray(packages)) { + packages = packages.join(" "); + } + shell.exec("npm i --save-dev " + packages, {stdio: "inherit"}); +} + +/** + * Check whether node modules are include in a project's package.json. + * + * @param {string[]} packages Array of node module names + * @param {Object} opt Options Object + * @param {boolean} opt.dependencies Set to true to check for direct dependencies + * @param {boolean} opt.devDependencies Set to true to check for development dependencies + * @param {boolean} opt.startdir Directory to begin searching from + * @returns {Object} An object whose keys are the module names + * and values are booleans indicating installation. + */ +function check(packages, opt) { + var deps = []; + var pkgJson = (opt) ? findPackageJson(opt.startDir) : findPackageJson(); + + if (!pkgJson) { + throw new Error("Could not find a package.json file. Run 'npm init' to create one."); + } + var fileJson = JSON.parse(fs.readFileSync(pkgJson, "utf8")); + + if (opt.devDependencies && typeof fileJson.devDependencies === "object") { + deps = deps.concat(Object.keys(fileJson.devDependencies)); + } + if (opt.dependencies && typeof fileJson.dependencies === "object") { + deps = deps.concat(Object.keys(fileJson.dependencies)); + } + return packages.reduce(function(status, pkg) { + status[pkg] = deps.indexOf(pkg) !== -1; + return status; + }, {}); +} + +/** + * Check whether node modules are included in the dependencies of a project's + * package.json. + * + * Convienience wrapper around check(). + * + * @param {string[]} packages Array of node modules to check. + * @param {string} rootDir The directory contianing a package.json + * @returns {Object} An object whose keys are the module names + * and values are booleans indicating installation. + */ +function checkDeps(packages, rootDir) { + return check(packages, {dependencies: true, startDir: rootDir}); +} + +/** + * Check whether node modules are included in the devDependencies of a project's + * package.json. + * + * Convienience wrapper around check(). + * + * @param {string[]} packages Array of node modules to check. + * @returns {Object} An object whose keys are the module names + * and values are booleans indicating installation. + */ +function checkDevDeps(packages) { + return check(packages, {devDependencies: true}); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + installSyncSaveDev: installSyncSaveDev, + checkDeps: checkDeps, + checkDevDeps: checkDevDeps +}; diff --git a/tools/eslint/lib/util/path-util.js b/tools/eslint/lib/util/path-util.js new file mode 100644 index 00000000000000..d1c8197adfb1f2 --- /dev/null +++ b/tools/eslint/lib/util/path-util.js @@ -0,0 +1,77 @@ +/** + * @fileoverview Common helpers for operations on filenames and paths + * @author Ian VanSchooten + * @copyright 2016 Ian VanSchooten. All rights reserved. + * See LICENSE in root directory for full license. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var path = require("path"), + isAbsolute = require("path-is-absolute"); + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/** + * Replace Windows with posix style paths + * + * @param {string} filepath Path to convert + * @returns {string} Converted filepath + */ +function convertPathToPosix(filepath) { + var normalizedFilepath = path.normalize(filepath); + var posixFilepath = normalizedFilepath.replace(/\\/g, "/"); + + return posixFilepath; +} + +/** + * Converts an absolute filepath to a relative path from a given base path + * + * For example, if the filepath is `/my/awesome/project/foo.bar`, + * and the base directory is `/my/awesome/project/`, + * then this function should return `foo.bar`. + * + * path.relative() does something similar, but it requires a baseDir (`from` argument). + * This function makes it optional and just removes a leading slash if the baseDir is not given. + * + * It does not take into account symlinks (for now). + * + * @param {string} filepath Path to convert to relative path. If already relative, + * it will be assumed to be relative to process.cwd(), + * converted to absolute, and then processed. + * @param {string} [baseDir] Absolute base directory to resolve the filepath from. + * If not provided, all this function will do is remove + * a leading slash. + * @returns {string} Relative filepath + */ +function getRelativePath(filepath, baseDir) { + var relativePath; + + if (!isAbsolute(filepath)) { + filepath = path.resolve(filepath); + } + if (baseDir) { + if (!isAbsolute(baseDir)) { + throw new Error("baseDir should be an absolute path"); + } + relativePath = path.relative(baseDir, filepath); + } else { + relativePath = filepath.replace(/^\//, ""); + } + return relativePath; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + convertPathToPosix: convertPathToPosix, + getRelativePath: getRelativePath +}; diff --git a/tools/eslint/lib/util/rule-fixer.js b/tools/eslint/lib/util/rule-fixer.js new file mode 100644 index 00000000000000..0f9ef9adf3c73f --- /dev/null +++ b/tools/eslint/lib/util/rule-fixer.js @@ -0,0 +1,147 @@ +/** + * @fileoverview An object that creates fix commands for rules. + * @author Nicholas C. Zakas + * @copyright 2015 Nicholas C. Zakas. All rights reserved. + * See LICENSE file in root directory for full license. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +// none! + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Creates a fix command that inserts text at the specified index in the source text. + * @param {int} index The 0-based index at which to insert the new text. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + * @private + */ +function insertTextAt(index, text) { + return { + range: [index, index], + text: text + }; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Creates code fixing commands for rules. + * @constructor + */ +function RuleFixer() { + Object.freeze(this); +} + +RuleFixer.prototype = { + constructor: RuleFixer, + + /** + * Creates a fix command that inserts text after the given node or token. + * The fix is not applied until applyFixes() is called. + * @param {ASTNode|Token} nodeOrToken The node or token to insert after. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + insertTextAfter: function(nodeOrToken, text) { + return this.insertTextAfterRange(nodeOrToken.range, text); + }, + + /** + * Creates a fix command that inserts text after the specified range in the source text. + * The fix is not applied until applyFixes() is called. + * @param {int[]} range The range to replace, first item is start of range, second + * is end of range. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + insertTextAfterRange: function(range, text) { + return insertTextAt(range[1], text); + }, + + /** + * Creates a fix command that inserts text before the given node or token. + * The fix is not applied until applyFixes() is called. + * @param {ASTNode|Token} nodeOrToken The node or token to insert before. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + insertTextBefore: function(nodeOrToken, text) { + return this.insertTextBeforeRange(nodeOrToken.range, text); + }, + + /** + * Creates a fix command that inserts text before the specified range in the source text. + * The fix is not applied until applyFixes() is called. + * @param {int[]} range The range to replace, first item is start of range, second + * is end of range. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + insertTextBeforeRange: function(range, text) { + return insertTextAt(range[0], text); + }, + + /** + * Creates a fix command that replaces text at the node or token. + * The fix is not applied until applyFixes() is called. + * @param {ASTNode|Token} nodeOrToken The node or token to remove. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + replaceText: function(nodeOrToken, text) { + return this.replaceTextRange(nodeOrToken.range, text); + }, + + /** + * Creates a fix command that replaces text at the specified range in the source text. + * The fix is not applied until applyFixes() is called. + * @param {int[]} range The range to replace, first item is start of range, second + * is end of range. + * @param {string} text The text to insert. + * @returns {Object} The fix command. + */ + replaceTextRange: function(range, text) { + return { + range: range, + text: text + }; + }, + + /** + * Creates a fix command that removes the node or token from the source. + * The fix is not applied until applyFixes() is called. + * @param {ASTNode|Token} nodeOrToken The node or token to remove. + * @returns {Object} The fix command. + */ + remove: function(nodeOrToken) { + return this.removeRange(nodeOrToken.range); + }, + + /** + * Creates a fix command that removes the specified range of text from the source. + * The fix is not applied until applyFixes() is called. + * @param {int[]} range The range to remove, first item is start of range, second + * is end of range. + * @returns {Object} The fix command. + */ + removeRange: function(range) { + return { + range: range, + text: "" + }; + } + +}; + + +module.exports = RuleFixer; diff --git a/tools/eslint/lib/util/source-code-fixer.js b/tools/eslint/lib/util/source-code-fixer.js new file mode 100644 index 00000000000000..0ea68d382b2e36 --- /dev/null +++ b/tools/eslint/lib/util/source-code-fixer.js @@ -0,0 +1,143 @@ +/** + * @fileoverview An object that caches and applies source code fixes. + * @author Nicholas C. Zakas + * @copyright 2015 Nicholas C. Zakas. All rights reserved. + * See LICENSE file in root directory for full license. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var debug = require("debug")("eslint:text-fixer"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +var BOM = "\uFEFF"; + +/** + * Compares items in a messages array by line and column. + * @param {Message} a The first message. + * @param {Message} b The second message. + * @returns {int} -1 if a comes before b, 1 if a comes after b, 0 if equal. + * @private + */ +function compareMessagesByLocation(a, b) { + var lineDiff = a.line - b.line; + + if (lineDiff === 0) { + return a.column - b.column; + } else { + return lineDiff; + } +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Utility for apply fixes to source code. + * @constructor + */ +function SourceCodeFixer() { + Object.freeze(this); +} + +/** + * Applies the fixes specified by the messages to the given text. Tries to be + * smart about the fixes and won't apply fixes over the same area in the text. + * @param {SourceCode} sourceCode The source code to apply the changes to. + * @param {Message[]} messages The array of messages reported by ESLint. + * @returns {Object} An object containing the fixed text and any unfixed messages. + */ +SourceCodeFixer.applyFixes = function(sourceCode, messages) { + + debug("Applying fixes"); + + if (!sourceCode) { + debug("No source code to fix"); + return { + fixed: false, + messages: messages, + output: "" + }; + } + + // clone the array + var remainingMessages = [], + fixes = [], + text = sourceCode.text, + lastFixPos = text.length + 1, + prefix = (sourceCode.hasBOM ? BOM : ""); + + messages.forEach(function(problem) { + if (problem.hasOwnProperty("fix")) { + fixes.push(problem); + } else { + remainingMessages.push(problem); + } + }); + + if (fixes.length) { + debug("Found fixes to apply"); + + // sort in reverse order of occurrence + fixes.sort(function(a, b) { + if (a.fix.range[1] <= b.fix.range[0]) { + return 1; + } else { + return -1; + } + }); + + // split into array of characters for easier manipulation + var chars = text.split(""); + + fixes.forEach(function(problem) { + var fix = problem.fix; + var start = fix.range[0]; + var end = fix.range[1]; + var insertionText = fix.text; + + if (end < lastFixPos) { + if (start < 0) { + + // Remove BOM. + prefix = ""; + start = 0; + } + + if (start === 0 && insertionText[0] === BOM) { + + // Set BOM. + prefix = BOM; + insertionText = insertionText.slice(1); + } + + chars.splice(start, end - start, insertionText); + lastFixPos = start; + } else { + remainingMessages.push(problem); + } + }); + + return { + fixed: true, + messages: remainingMessages.sort(compareMessagesByLocation), + output: prefix + chars.join("") + }; + } else { + debug("No fixes to apply"); + return { + fixed: false, + messages: messages, + output: prefix + text + }; + } +}; + +module.exports = SourceCodeFixer; diff --git a/tools/eslint/lib/util/source-code-util.js b/tools/eslint/lib/util/source-code-util.js new file mode 100644 index 00000000000000..b12b095f17d0cd --- /dev/null +++ b/tools/eslint/lib/util/source-code-util.js @@ -0,0 +1,114 @@ +/** + * @fileoverview Tools for obtaining SourceCode objects. + * @author Ian VanSchooten + * @copyright 2016 Ian VanSchooten. All rights reserved. + * See LICENSE in root directory for full license. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var lodash = require("lodash"), + debug = require("debug"), + CLIEngine = require("../cli-engine"), + eslint = require("../eslint"), + globUtil = require("./glob-util"), + defaultOptions = require("../../conf/cli-options"); + +debug = debug("eslint:source-code-util"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Get the SourceCode object for a single file + * @param {string} filename The fully resolved filename to get SourceCode from. + * @param {Object} options A CLIEngine options object. + * @returns {Array} Array of the SourceCode object representing the file + * and fatal error message. + */ +function getSourceCodeOfFile(filename, options) { + debug("getting sourceCode of", filename); + var opts = lodash.assign({}, options, { rules: {}}); + var cli = new CLIEngine(opts); + var results = cli.executeOnFiles([filename]); + + if (results && results.results[0] && results.results[0].messages[0] && results.results[0].messages[0].fatal) { + var msg = results.results[0].messages[0]; + + throw new Error("(" + filename + ":" + msg.line + ":" + msg.column + ") " + msg.message); + } + var sourceCode = eslint.getSourceCode(); + + return sourceCode; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + + +/** + * This callback is used to measure execution status in a progress bar + * @callback progressCallback + * @param {number} The total number of times the callback will be called. + */ + +/** + * Gets the SourceCode of a single file, or set of files. + * @param {string[]|string} patterns A filename, directory name, or glob, + * or an array of them + * @param {Object} [options] A CLIEngine options object. If not provided, + * the default cli options will be used. + * @param {progressCallback} [cb] Callback for reporting execution status + * @returns {Object} The SourceCode of all processed files. + */ +function getSourceCodeOfFiles(patterns, options, cb) { + var sourceCodes = {}, + filenames, + opts; + + if (typeof patterns === "string") { + patterns = [patterns]; + } + + defaultOptions = lodash.assign({}, defaultOptions, {cwd: process.cwd()}); + + if (typeof options === "undefined") { + opts = defaultOptions; + } else if (typeof options === "function") { + cb = options; + opts = defaultOptions; + } else if (typeof options === "object") { + opts = lodash.assign({}, defaultOptions, options); + } + debug("constructed options:", opts); + patterns = globUtil.resolveFileGlobPatterns(patterns, opts); + + filenames = globUtil.listFilesToProcess(patterns, opts).reduce(function(files, fileInfo) { + return !fileInfo.ignored ? files.concat(fileInfo.filename) : files; + }, []); + if (filenames.length === 0) { + debug("Did not find any files matching pattern(s): " + patterns); + } + filenames.forEach(function(filename) { + var sourceCode = getSourceCodeOfFile(filename, opts); + + if (sourceCode) { + debug("got sourceCode of", filename); + sourceCodes[filename] = sourceCode; + } + if (cb) { + cb(filenames.length); // eslint-disable-line callback-return + } + }); + return sourceCodes; +} + +module.exports = { + getSourceCodeOfFiles: getSourceCodeOfFiles +}; diff --git a/tools/eslint/lib/util/source-code.js b/tools/eslint/lib/util/source-code.js new file mode 100644 index 00000000000000..a79bd5b531bcab --- /dev/null +++ b/tools/eslint/lib/util/source-code.js @@ -0,0 +1,306 @@ +/** + * @fileoverview Abstraction of JavaScript source code. + * @author Nicholas C. Zakas + * @copyright 2015 Nicholas C. Zakas. All rights reserved. + * See LICENSE file in root directory for full license. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var lodash = require("lodash"), + createTokenStore = require("../token-store.js"), + Traverser = require("./traverser"); + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +/** + * Validates that the given AST has the required information. + * @param {ASTNode} ast The Program node of the AST to check. + * @throws {Error} If the AST doesn't contain the correct information. + * @returns {void} + * @private + */ +function validate(ast) { + + if (!ast.tokens) { + throw new Error("AST is missing the tokens array."); + } + + if (!ast.comments) { + throw new Error("AST is missing the comments array."); + } + + if (!ast.loc) { + throw new Error("AST is missing location information."); + } + + if (!ast.range) { + throw new Error("AST is missing range information"); + } +} + +/** + * Finds a JSDoc comment node in an array of comment nodes. + * @param {ASTNode[]} comments The array of comment nodes to search. + * @param {int} line Line number to look around + * @returns {ASTNode} The node if found, null if not. + * @private + */ +function findJSDocComment(comments, line) { + + if (comments) { + for (var i = comments.length - 1; i >= 0; i--) { + if (comments[i].type === "Block" && comments[i].value.charAt(0) === "*") { + + if (line - comments[i].loc.end.line <= 1) { + return comments[i]; + } else { + break; + } + } + } + } + + return null; +} + +/** + * Check to see if its a ES6 export declaration + * @param {ASTNode} astNode - any node + * @returns {boolean} whether the given node represents a export declaration + * @private + */ +function looksLikeExport(astNode) { + return astNode.type === "ExportDefaultDeclaration" || astNode.type === "ExportNamedDeclaration" || + astNode.type === "ExportAllDeclaration" || astNode.type === "ExportSpecifier"; +} + + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Represents parsed source code. + * @param {string} text - The source code text. + * @param {ASTNode} ast - The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped. + * @constructor + */ +function SourceCode(text, ast) { + validate(ast); + + /** + * The flag to indicate that the source code has Unicode BOM. + * @type boolean + */ + this.hasBOM = (text.charCodeAt(0) === 0xFEFF); + + /** + * The original text source code. + * BOM was stripped from this text. + * @type string + */ + this.text = (this.hasBOM ? text.slice(1) : text); + + /** + * The parsed AST for the source code. + * @type ASTNode + */ + this.ast = ast; + + /** + * The source code split into lines according to ECMA-262 specification. + * This is done to avoid each rule needing to do so separately. + * @type string[] + */ + this.lines = SourceCode.splitLines(this.text); + + this.tokensAndComments = ast.tokens.concat(ast.comments).sort(function(left, right) { + return left.range[0] - right.range[0]; + }); + + // create token store methods + var tokenStore = createTokenStore(ast.tokens); + + Object.keys(tokenStore).forEach(function(methodName) { + this[methodName] = tokenStore[methodName]; + }, this); + + var tokensAndCommentsStore = createTokenStore(this.tokensAndComments); + + this.getTokenOrCommentBefore = tokensAndCommentsStore.getTokenBefore; + this.getTokenOrCommentAfter = tokensAndCommentsStore.getTokenAfter; + + // don't allow modification of this object + Object.freeze(this); + Object.freeze(this.lines); +} + +/** + * Split the source code into multiple lines based on the line delimiters + * @param {string} text Source code as a string + * @returns {string[]} Array of source code lines + * @public + */ +SourceCode.splitLines = function(text) { + return text.split(/\r\n|\r|\n|\u2028|\u2029/g); +}; + +SourceCode.prototype = { + constructor: SourceCode, + + /** + * Gets the source code for the given node. + * @param {ASTNode=} node The AST node to get the text for. + * @param {int=} beforeCount The number of characters before the node to retrieve. + * @param {int=} afterCount The number of characters after the node to retrieve. + * @returns {string} The text representing the AST node. + */ + getText: function(node, beforeCount, afterCount) { + if (node) { + return this.text.slice(Math.max(node.range[0] - (beforeCount || 0), 0), + node.range[1] + (afterCount || 0)); + } else { + return this.text; + } + + }, + + /** + * Gets the entire source text split into an array of lines. + * @returns {Array} The source text as an array of lines. + */ + getLines: function() { + return this.lines; + }, + + /** + * Retrieves an array containing all comments in the source code. + * @returns {ASTNode[]} An array of comment nodes. + */ + getAllComments: function() { + return this.ast.comments; + }, + + /** + * Gets all comments for the given node. + * @param {ASTNode} node The AST node to get the comments for. + * @returns {Object} The list of comments indexed by their position. + * @public + */ + getComments: function(node) { + + var leadingComments = node.leadingComments || [], + trailingComments = node.trailingComments || []; + + /* + * espree adds a "comments" array on Program nodes rather than + * leadingComments/trailingComments. Comments are only left in the + * Program node comments array if there is no executable code. + */ + if (node.type === "Program") { + if (node.body.length === 0) { + leadingComments = node.comments; + } + } + + return { + leading: leadingComments, + trailing: trailingComments + }; + }, + + /** + * Retrieves the JSDoc comment for a given node. + * @param {ASTNode} node The AST node to get the comment for. + * @returns {ASTNode} The BlockComment node containing the JSDoc for the + * given node or null if not found. + * @public + */ + getJSDocComment: function(node) { + + var parent = node.parent; + + switch (node.type) { + case "ClassDeclaration": + case "FunctionDeclaration": + if (looksLikeExport(parent)) { + return findJSDocComment(parent.leadingComments, parent.loc.start.line); + } + return findJSDocComment(node.leadingComments, node.loc.start.line); + + case "ClassExpression": + return findJSDocComment(parent.parent.leadingComments, parent.parent.loc.start.line); + + case "ArrowFunctionExpression": + case "FunctionExpression": + + if (parent.type !== "CallExpression" && parent.type !== "NewExpression") { + while (parent && !parent.leadingComments && !/Function/.test(parent.type) && parent.type !== "MethodDefinition" && parent.type !== "Property") { + parent = parent.parent; + } + + return parent && (parent.type !== "FunctionDeclaration") ? findJSDocComment(parent.leadingComments, parent.loc.start.line) : null; + } else if (node.leadingComments) { + return findJSDocComment(node.leadingComments, node.loc.start.line); + } + + // falls through + + default: + return null; + } + }, + + /** + * Gets the deepest node containing a range index. + * @param {int} index Range index of the desired node. + * @returns {ASTNode} The node if found or null if not found. + */ + getNodeByRangeIndex: function(index) { + var result = null, + resultParent = null, + traverser = new Traverser(); + + traverser.traverse(this.ast, { + enter: function(node, parent) { + if (node.range[0] <= index && index < node.range[1]) { + result = node; + resultParent = parent; + } else { + this.skip(); + } + }, + leave: function(node) { + if (node === result) { + this.break(); + } + } + }); + + return result ? lodash.assign({parent: resultParent}, result) : null; + }, + + /** + * Determines if two tokens have at least one whitespace character + * between them. This completely disregards comments in making the + * determination, so comments count as zero-length substrings. + * @param {Token} first The token to check after. + * @param {Token} second The token to check before. + * @returns {boolean} True if there is only space between tokens, false + * if there is anything other than whitespace between tokens. + */ + isSpaceBetweenTokens: function(first, second) { + var text = this.text.slice(first.range[1], second.range[0]); + + return /\s/.test(text.replace(/\/\*.*?\*\//g, "")); + } +}; + + +module.exports = SourceCode; diff --git a/tools/eslint/lib/util/traverse.js b/tools/eslint/lib/util/traverse.js deleted file mode 100644 index ba5520e341bb46..00000000000000 --- a/tools/eslint/lib/util/traverse.js +++ /dev/null @@ -1,105 +0,0 @@ -/** - * @fileoverview Simple directory traversal logic. - * @author Nicholas C. Zakas - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var fs = require("fs"), - path = require("path"), - debug = require("debug"); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -debug = debug("eslint:traverse"); - -/** - * Walks a path recursively calling the callback on each file. - * @param {string} name The file or directory path. - * @param {string[]} extensions The file extensions that should cause the callback - * to be called. - * @param {Function} exclude The function to check if file/path should be excluded. - * @param {Function} callback The function to call on each file. - * @returns {void} - * @private - */ -function walk(name, extensions, exclude, callback) { - - var stat, basename; - - stat = fs.statSync(name); - - function traverse(dir, stack) { - stack.push(dir); - - fs.readdirSync(path.join.apply(path, stack)).forEach(function(file) { - var filePath, fileStat; - - // skip all hidded things (dirs, files, links) - if (file[0] === ".") { - return; - } - - filePath = path.join.apply(path, stack.concat([file])); - fileStat = fs.statSync(filePath); - - // if this file or directory is excluded from linting, skip over it. - if (exclude && exclude(filePath)) { - // console.log("Ignoring " + filePath); - debug("Ignoring " + filePath); - return; - } - - // only call callback for files with correct extensions - if (fileStat.isFile() && extensions.indexOf(path.extname(filePath)) > -1) { - callback(filePath); - } else if (fileStat.isDirectory()) { - traverse(file, stack); - } - }); - stack.pop(); - } - - basename = path.basename(name); - - // don't ignore cases like 'eslint ./' - if ((basename !== "." && basename !== ".." && basename[0] === ".") || - (exclude && exclude(name))) { - - debug("Ignoring " + name); - return; - } - - // always call callback for any files that are passed on the command line - if (stat.isFile()) { - callback(name); - } else { - traverse(name, []); - } -} - -/** - * Traverses multiple directories and calls a callback on each file. - * @param {Object} options The option for the traversal. - * param {string[]} options.files An array of file and directory paths to traverse. - * param {Function} options.exclude The function to check if file/path should be excluded. - * @param {Function} callback A function to call for each file. - * @returns {void} - */ -module.exports = function traverse(options, callback) { - - var files = options.files, - exclude = options.exclude, - extensions = options.extensions; - - files.forEach(function(file) { - walk(file, extensions, exclude, callback); - }); - -}; diff --git a/tools/eslint/lib/util/traverser.js b/tools/eslint/lib/util/traverser.js new file mode 100644 index 00000000000000..74cfbec2b2371c --- /dev/null +++ b/tools/eslint/lib/util/traverser.js @@ -0,0 +1,56 @@ +/** + * @fileoverview Wrapper around estraverse + * @author Nicholas C. Zakas + * @copyright 2016 Nicholas C. Zakas. All rights reserved. + * See LICENSE in root directory for full license. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var estraverse = require("estraverse"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +var KEY_BLACKLIST = [ + "parent", + "leadingComments", + "trailingComments" +]; + +/** + * Wrapper around an estraverse controller that ensures the correct keys + * are visited. + * @constructor + */ +function Traverser() { + + var controller = Object.create(new estraverse.Controller()), + originalTraverse = controller.traverse; + + // intercept call to traverse() and add the fallback key to the visitor + controller.traverse = function(node, visitor) { + visitor.fallback = Traverser.getKeys; + return originalTraverse.call(this, node, visitor); + }; + + return controller; +} + +/** + * Calculates the keys to use for traversal. + * @param {ASTNode} node The node to read keys from. + * @returns {string[]} An array of keys to visit on the node. + * @private + */ +Traverser.getKeys = function(node) { + return Object.keys(node).filter(function(key) { + return KEY_BLACKLIST.indexOf(key) === -1; + }); +}; + +module.exports = Traverser; diff --git a/tools/eslint/messages/plugin-missing.txt b/tools/eslint/messages/plugin-missing.txt new file mode 100644 index 00000000000000..56679528c9bc3f --- /dev/null +++ b/tools/eslint/messages/plugin-missing.txt @@ -0,0 +1,9 @@ +ESLint couldn't find the plugin "eslint-plugin-<%- pluginName %>". This can happen for a couple different reasons: + +1. If ESLint is installed globally, then make sure eslint-plugin-<%- pluginName %> is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin. + +2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following: + + npm i eslint-plugin-<%- pluginName %>@latest --save-dev + +If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team. diff --git a/tools/eslint/node_modules/.bin/acorn b/tools/eslint/node_modules/.bin/acorn new file mode 120000 index 00000000000000..cf76760386200f --- /dev/null +++ b/tools/eslint/node_modules/.bin/acorn @@ -0,0 +1 @@ +../acorn/bin/acorn \ No newline at end of file diff --git a/tools/eslint/node_modules/.bin/esparse b/tools/eslint/node_modules/.bin/esparse index 409161d5acda89..7423b18b24efb0 120000 --- a/tools/eslint/node_modules/.bin/esparse +++ b/tools/eslint/node_modules/.bin/esparse @@ -1 +1 @@ -../espree/bin/esparse.js \ No newline at end of file +../esprima/bin/esparse.js \ No newline at end of file diff --git a/tools/eslint/node_modules/.bin/esvalidate b/tools/eslint/node_modules/.bin/esvalidate index 939b663b96f147..16069effbc99a3 120000 --- a/tools/eslint/node_modules/.bin/esvalidate +++ b/tools/eslint/node_modules/.bin/esvalidate @@ -1 +1 @@ -../espree/bin/esvalidate.js \ No newline at end of file +../esprima/bin/esvalidate.js \ No newline at end of file diff --git a/tools/eslint/node_modules/.bin/rimraf b/tools/eslint/node_modules/.bin/rimraf new file mode 120000 index 00000000000000..4cd49a49ddfc17 --- /dev/null +++ b/tools/eslint/node_modules/.bin/rimraf @@ -0,0 +1 @@ +../rimraf/bin.js \ No newline at end of file diff --git a/tools/eslint/node_modules/.bin/shjs b/tools/eslint/node_modules/.bin/shjs new file mode 120000 index 00000000000000..a0449975bf894c --- /dev/null +++ b/tools/eslint/node_modules/.bin/shjs @@ -0,0 +1 @@ +../shelljs/bin/shjs \ No newline at end of file diff --git a/tools/eslint/node_modules/.bin/user-home b/tools/eslint/node_modules/.bin/user-home deleted file mode 120000 index d72d76bb49f555..00000000000000 --- a/tools/eslint/node_modules/.bin/user-home +++ /dev/null @@ -1 +0,0 @@ -../user-home/cli.js \ No newline at end of file diff --git a/tools/eslint/node_modules/acorn-jsx/LICENSE b/tools/eslint/node_modules/acorn-jsx/LICENSE new file mode 100644 index 00000000000000..6d1e4f4541504a --- /dev/null +++ b/tools/eslint/node_modules/acorn-jsx/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2012-2014 by Ingvar Stepanyan + +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/eslint/node_modules/acorn-jsx/README.md b/tools/eslint/node_modules/acorn-jsx/README.md new file mode 100644 index 00000000000000..6b3826d3fcbdb5 --- /dev/null +++ b/tools/eslint/node_modules/acorn-jsx/README.md @@ -0,0 +1,42 @@ +# Acorn-JSX + +[![Build Status](https://travis-ci.org/RReverser/acorn-jsx.svg?branch=master)](https://travis-ci.org/RReverser/acorn-jsx) +[![NPM version](https://img.shields.io/npm/v/acorn-jsx.svg)](https://www.npmjs.org/package/acorn-jsx) + +This is plugin for [Acorn](http://marijnhaverbeke.nl/acorn/) - a tiny, fast JavaScript parser, written completely in JavaScript. + +It was created as an experimental alternative, faster [React.js JSX](http://facebook.github.io/react/docs/jsx-in-depth.html) parser. + +According to [benchmarks](https://github.com/RReverser/acorn-jsx/blob/master/test/bench.html), Acorn-JSX is 2x faster than official [Esprima-based parser](https://github.com/facebook/esprima) when location tracking is turned on in both (call it "source maps enabled mode"). At the same time, it consumes all the ES6+JSX syntax that can be consumed by Esprima-FB (this is proved by [official tests](https://github.com/RReverser/acorn-jsx/blob/master/test/tests-jsx.js)). + +**UPDATE [14-Apr-2015]**: Facebook implementation started [deprecation process](https://github.com/facebook/esprima/issues/111) in favor of Acorn + Acorn-JSX + Babel for parsing and transpiling JSX syntax. + +## Transpiler + +Please note that this tool only parses source code to JSX AST, which is useful for various language tools and services. If you want to transpile your code to regular ES5-compliant JavaScript with source map, check out the [babel transpiler](https://babeljs.io/) which uses `acorn-jsx` under the hood. + +## Usage + +You can use module directly in order to get Acorn instance with plugin installed: + +```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 } +}); +``` + +## License + +This plugin is issued under the [MIT license](./LICENSE). diff --git a/tools/eslint/node_modules/acorn-jsx/index.js b/tools/eslint/node_modules/acorn-jsx/index.js new file mode 100644 index 00000000000000..58c8677740ce26 --- /dev/null +++ b/tools/eslint/node_modules/acorn-jsx/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./inject')(require('acorn')); diff --git a/tools/eslint/node_modules/acorn-jsx/inject.js b/tools/eslint/node_modules/acorn-jsx/inject.js new file mode 100644 index 00000000000000..bfe0358097d3d2 --- /dev/null +++ b/tools/eslint/node_modules/acorn-jsx/inject.js @@ -0,0 +1,417 @@ +'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.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.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() { + var startPos = this.start, startLoc = this.startLoc; + var node = this.jsx_parseNamespacedName(); + 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 = []; + node.name = this.jsx_parseElementName(); + 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, 'JSXOpeningElement'); + }; + + // 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, 'JSXElement'); + }; + + // 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) { + instance.extend('parseExprAtom', function(inner) { + return function(refShortHandDefaultPos) { + if (this.type === tt.jsxText) + return this.parseLiteral(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.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/eslint/node_modules/acorn-jsx/node_modules/.bin/acorn b/tools/eslint/node_modules/acorn-jsx/node_modules/.bin/acorn new file mode 120000 index 00000000000000..cf76760386200f --- /dev/null +++ b/tools/eslint/node_modules/acorn-jsx/node_modules/.bin/acorn @@ -0,0 +1 @@ +../acorn/bin/acorn \ No newline at end of file diff --git a/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/.tern-project b/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/.tern-project new file mode 100644 index 00000000000000..6718ce07e1c8a0 --- /dev/null +++ b/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/.tern-project @@ -0,0 +1,6 @@ +{ + "plugins": { + "node": true, + "es_modules": true + } +} \ No newline at end of file diff --git a/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/AUTHORS b/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/AUTHORS new file mode 100644 index 00000000000000..0e8f48b695eaa7 --- /dev/null +++ b/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/AUTHORS @@ -0,0 +1,43 @@ +List of Acorn contributors. Updated before every release. + +Adrian Rakovsky +Alistair Braidwood +Andres Suarez +Aparajita Fishman +Arian Stolwijk +Artem Govorov +Brandon Mills +Charles Hughes +Conrad Irwin +David Bonnet +ForbesLindesay +Forbes Lindesay +Gilad Peleg +impinball +Ingvar Stepanyan +Jesse McCarthy +Jiaxing Wang +Joel Kemp +Johannes Herr +Jürg Lehni +keeyipchan +Kevin Kwok +krator +Marijn Haverbeke +Martin Carlberg +Mathias Bynens +Mathieu 'p01' Henri +Max Schaefer +Max Zerzouri +Mihai Bazon +Mike Rennie +Nick Fitzgerald +Oskar Schöldström +Paul Harper +Peter Rust +PlNG +r-e-d +Rich Harris +Sebastian McKenzie +Timothy Gu +zsjforcn diff --git a/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/LICENSE b/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/LICENSE new file mode 100644 index 00000000000000..d4c7fc583804df --- /dev/null +++ b/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/LICENSE @@ -0,0 +1,19 @@ +Copyright (C) 2012-2014 by various contributors (see AUTHORS) + +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/eslint/node_modules/acorn-jsx/node_modules/acorn/README.md b/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/README.md new file mode 100644 index 00000000000000..12680abf6b3cc7 --- /dev/null +++ b/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/README.md @@ -0,0 +1,396 @@ +# Acorn + +[![Build Status](https://travis-ci.org/ternjs/acorn.svg?branch=master)](https://travis-ci.org/ternjs/acorn) +[![NPM version](https://img.shields.io/npm/v/acorn.svg)](https://www.npmjs.com/package/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. + +## Community + +Acorn is open source software released under an +[MIT license](https://github.com/ternjs/acorn/blob/master/LICENSE). + +You are welcome to +[report bugs](https://github.com/ternjs/acorn/issues) or create pull +requests on [github](https://github.com/ternjs/acorn). For questions +and discussion, please use the +[Tern discussion forum](https://discuss.ternjs.net). + +## Installation + +The easiest way to install acorn is with [`npm`][npm]. + +[npm]: https://www.npmjs.com/ + +```sh +npm install acorn +``` + +Alternately, download the source. + +```sh +git clone https://github.com/ternjs/acorn.git +``` + +## 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. + +### Main parser + +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]. + +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}` +object referring to that same position. + +[estree]: https://github.com/estree/estree + +- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be + either 3, 5, or 6. This influences support for strict mode, the set + of reserved words, and support for new syntax features. Default is 5. + +- **sourceType**: Indicate the mode the code should be parsed in. Can be + either `"script"` or `"module"`. + +- **onInsertedSemicolon**: If given a callback, that callback will be + called whenever a missing semicolon is inserted by the parser. The + callback will be given the character offset of the point where the + semicolon is inserted as argument, and if `locations` is on, also a + `{line, column}` object representing this position. + +- **onTrailingComma**: Like `onInsertedSemicolon`, but for trailing + commas. + +- **allowReserved**: If `false`, using a reserved word will generate + an error. Defaults to `true` for `ecmaVersion` 3, `false` for higher + versions. When given the value `"never"`, reserved words and + keywords can also not be used as property names (as in Internet + Explorer's old parser). + +- **allowReturnOutsideFunction**: By default, a return statement at + the top level raises an error. Set this to `true` to accept such + code. + +- **allowImportExportEverywhere**: By default, `import` and `export` + declarations can only appear at a program's top level. Setting this + option to `true` allows them anywhere where a statement is allowed. + +- **allowHashBang**: When this is enabled (off by default), if the + code starts with the characters `#!` (as in a shellscript), the + first line will be treated as a comment. + +- **locations**: When `true`, each node has a `loc` object attached + with `start` and `end` subobjects, each of which contains the + one-based line and zero-based column numbers in `{line, column}` + form. Default is `false`. + +- **onToken**: If a function is passed for this option, each found + token will be passed in same format as tokens returned from + `tokenizer().getToken()`. + + If array is passed, each found token is pushed to it. + + Note that you are not allowed to call the parser from the + callback—that will corrupt its internal state. + +- **onComment**: If a function is passed for this option, whenever a + comment is encountered the function will be called with the + following parameters: + + - `block`: `true` if the comment is a block comment, false if it + is a line comment. + - `text`: The content of the comment. + - `start`: Character offset of the start of the comment. + - `end`: Character offset of the end of the comment. + + When the `locations` options is on, the `{line, column}` locations + of the comment’s start and end are passed as two additional + parameters. + + If array is passed for this option, each found comment is pushed + to it as object in Esprima format: + + ```javascript + { + "type": "Line" | "Block", + "value": "comment text", + "start": Number, + "end": Number, + // If `locations` option is on: + "loc": { + "start": {line: Number, column: Number} + "end": {line: Number, column: Number} + }, + // If `ranges` option is on: + "range": [Number, Number] + } + ``` + + Note that you are not allowed to call the parser from the + callback—that will corrupt its internal state. + +- **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`. + +- **program**: It is possible to parse multiple files into a single + AST by passing the tree produced by parsing the first file as the + `program` option in subsequent parses. This will add the toplevel + forms of the parsed file to the "Program" (top) node of an existing + parse tree. + +- **sourceFile**: When the `locations` option is `true`, you can pass + this option to add a `source` attribute in every node’s `loc` + object. Note that the contents of this option are not examined or + processed in any way; you are free to use whatever format you + choose. + +- **directSourceFile**: Like `sourceFile`, but a `sourceFile` property + will be added directly to the nodes, rather than the `loc` object. + +- **preserveParens**: If this option is `true`, parenthesized expressions + are represented by (non-standard) `ParenthesizedExpression` nodes + 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 +`locations` option is enabled and `range` property when the `ranges` +option is enabled). When the token's type is `tokTypes.eof`, you +should stop calling the method, since it will keep returning that same +token forever. + +In ES6 environment, returned result can be used as any other +protocol-compliant iterable: + +```javascript +for (let token of acorn.tokenizer(str)) { + // iterate over the tokens +} + +// transform code to array of tokens: +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.) + +**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 callbacks in the `state` parameter. + +**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`. + +**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). + +## Command line interface + +The `bin/acorn` utility can be used to parse a file from the command +line. It accepts as arguments its input file and the following +options: + +- `--ecma3|--ecma5|--ecma6`: Sets the ECMAScript version to parse. Default is + version 5. + +- `--module`: Sets the parsing mode to `"module"`. Is set to `"script"` otherwise. + +- `--locations`: Attaches a "loc" object to each node with "start" and + "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. + +- `--compact`: No whitespace is used in the AST output. + +- `--silent`: Do not output the AST, just return the exit status. + +- `--help`: Print the usage information and quit. + +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) + } +}) +``` + +There is a proof-of-concept JSX plugin in the [`acorn-jsx`](https://github.com/RReverser/acorn-jsx) project. diff --git a/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/bin/acorn b/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/bin/acorn new file mode 100755 index 00000000000000..db079096d3749a --- /dev/null +++ b/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/bin/acorn @@ -0,0 +1,71 @@ +#!/usr/bin/env node +"use strict"; + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj["default"] = obj; return newObj; } } + +var _path = require("path"); + +var _fs = require("fs"); + +var _distAcornJs = require("../dist/acorn.js"); + +var acorn = _interopRequireWildcard(_distAcornJs); + +var infile = undefined, + forceFile = undefined, + silent = false, + compact = false, + tokenize = false; +var options = {}; + +function help(status) { + var print = status == 0 ? console.log : console.error; + print("usage: " + (0, _path.basename)(process.argv[1]) + " [--ecma3|--ecma5|--ecma6]"); + print(" [--tokenize] [--locations] [---allow-hash-bang] [--compact] [--silent] [--module] [--help] [--] [infile]"); + process.exit(status); +} + +for (var i = 2; i < process.argv.length; ++i) { + var arg = process.argv[i]; + if ((arg == "-" || arg[0] != "-") && !infile) infile = arg;else if (arg == "--" && !infile && i + 2 == process.argv.length) forceFile = infile = process.argv[++i];else if (arg == "--ecma3") options.ecmaVersion = 3;else if (arg == "--ecma5") options.ecmaVersion = 5;else if (arg == "--ecma6") options.ecmaVersion = 6;else if (arg == "--locations") options.locations = true;else if (arg == "--allow-hash-bang") options.allowHashBang = true;else if (arg == "--silent") silent = true;else if (arg == "--compact") compact = true;else if (arg == "--help") help(0);else if (arg == "--tokenize") tokenize = true;else if (arg == "--module") options.sourceType = 'module';else help(1); +} + +function run(code) { + var result = undefined; + if (!tokenize) { + try { + result = acorn.parse(code, options); + } catch (e) { + console.error(e.message);process.exit(1); + } + } else { + result = []; + var tokenizer = acorn.tokenizer(code, options), + token = undefined; + while (true) { + try { + token = tokenizer.getToken(); + } catch (e) { + console.error(e.message);process.exit(1); + } + result.push(token); + if (token.type == acorn.tokTypes.eof) break; + } + } + if (!silent) console.log(JSON.stringify(result, null, compact ? null : 2)); +} + +if (forceFile || infile && infile != "-") { + run((0, _fs.readFileSync)(infile, "utf8")); +} else { + (function () { + var code = ""; + process.stdin.resume(); + process.stdin.on("data", function (chunk) { + return code += chunk; + }); + process.stdin.on("end", function () { + return run(code); + }); + })(); +} \ No newline at end of file diff --git a/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/bin/build-acorn.js b/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/bin/build-acorn.js new file mode 100644 index 00000000000000..71f2cf941f5b4d --- /dev/null +++ b/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/bin/build-acorn.js @@ -0,0 +1,82 @@ +var fs = require("fs"), path = require("path") +var stream = require("stream") + +var browserify = require("browserify") +var babel = require('babel-core') +var babelify = require("babelify").configure({loose: "all"}) + +process.chdir(path.resolve(__dirname, "..")) + +browserify({standalone: "acorn"}) + .plugin(require('browserify-derequire')) + .transform(babelify) + .require("./src/index.js", {entry: true}) + .bundle() + .on("error", function (err) { console.log("Error: " + err.message) }) + .pipe(fs.createWriteStream("dist/acorn.js")) + +var ACORN_PLACEHOLDER = "this_function_call_should_be_replaced_with_a_call_to_load_acorn()"; +function acornShimPrepare(file) { + var tr = new stream.Transform + if (file == path.resolve(__dirname, "../src/index.js")) { + var sent = false + tr._transform = function(chunk, _, callback) { + if (!sent) { + sent = true + callback(null, ACORN_PLACEHOLDER); + } else { + callback() + } + } + } else { + tr._transform = function(chunk, _, callback) { callback(null, chunk) } + } + return tr +} +function acornShimComplete() { + var tr = new stream.Transform + var buffer = ""; + tr._transform = function(chunk, _, callback) { + buffer += chunk.toString("utf8"); + callback(); + }; + tr._flush = function (callback) { + tr.push(buffer.replace(ACORN_PLACEHOLDER, "module.exports = typeof acorn != 'undefined' ? acorn : require(\"./acorn\")")); + callback(null); + }; + return tr; +} + +browserify({standalone: "acorn.loose"}) + .plugin(require('browserify-derequire')) + .transform(acornShimPrepare) + .transform(babelify) + .require("./src/loose/index.js", {entry: true}) + .bundle() + .on("error", function (err) { console.log("Error: " + err.message) }) + .pipe(acornShimComplete()) + .pipe(fs.createWriteStream("dist/acorn_loose.js")) + +browserify({standalone: "acorn.walk"}) + .plugin(require('browserify-derequire')) + .transform(acornShimPrepare) + .transform(babelify) + .require("./src/walk/index.js", {entry: true}) + .bundle() + .on("error", function (err) { console.log("Error: " + err.message) }) + .pipe(acornShimComplete()) + .pipe(fs.createWriteStream("dist/walk.js")) + +babel.transformFile("./src/bin/acorn.js", function (err, result) { + if (err) return console.log("Error: " + err.message) + fs.writeFile("bin/acorn", result.code, function (err) { + if (err) return console.log("Error: " + err.message) + + // Make bin/acorn executable + if (process.platform === 'win32') + return + var stat = fs.statSync("bin/acorn") + var newPerm = stat.mode | parseInt('111', 8) + fs.chmodSync("bin/acorn", newPerm) + }) +}) diff --git a/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/bin/generate-identifier-regex.js b/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/bin/generate-identifier-regex.js new file mode 100644 index 00000000000000..0d7c50fc384ee5 --- /dev/null +++ b/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/bin/generate-identifier-regex.js @@ -0,0 +1,47 @@ +// Note: run `npm install unicode-7.0.0` first. + +// Which Unicode version should be used? +var version = '7.0.0'; + +var start = require('unicode-' + version + '/properties/ID_Start/code-points') + .filter(function(ch) { return ch > 127; }); +var cont = [0x200c, 0x200d].concat(require('unicode-' + version + '/properties/ID_Continue/code-points') + .filter(function(ch) { return ch > 127 && start.indexOf(ch) == -1; })); + +function pad(str, width) { + while (str.length < width) str = "0" + str; + return str; +} + +function esc(code) { + var hex = code.toString(16); + if (hex.length <= 2) return "\\x" + pad(hex, 2); + else return "\\u" + pad(hex, 4); +} + +function generate(chars) { + var astral = [], re = ""; + for (var i = 0, at = 0x10000; i < chars.length; i++) { + var from = chars[i], to = from; + while (i < chars.length - 1 && chars[i + 1] == to + 1) { + i++; + to++; + } + if (to <= 0xffff) { + if (from == to) re += esc(from); + else if (from + 1 == to) re += esc(from) + esc(to); + else re += esc(from) + "-" + esc(to); + } else { + astral.push(from - at, to - from); + at = to; + } + } + return {nonASCII: re, astral: astral}; +} + +var startData = generate(start), contData = generate(cont); + +console.log(" var nonASCIIidentifierStartChars = \"" + startData.nonASCII + "\";"); +console.log(" var nonASCIIidentifierChars = \"" + contData.nonASCII + "\";"); +console.log(" var astralIdentifierStartCodes = " + JSON.stringify(startData.astral) + ";"); +console.log(" var astralIdentifierCodes = " + JSON.stringify(contData.astral) + ";"); diff --git a/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/bin/update_authors.sh b/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/bin/update_authors.sh new file mode 100755 index 00000000000000..466c8db5867cba --- /dev/null +++ b/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/bin/update_authors.sh @@ -0,0 +1,6 @@ +# Combine existing list of authors with everyone known in git, sort, add header. +tail --lines=+3 AUTHORS > AUTHORS.tmp +git log --format='%aN' | grep -v abraidwood >> AUTHORS.tmp +echo -e "List of Acorn contributors. Updated before every release.\n" > AUTHORS +sort -u AUTHORS.tmp >> AUTHORS +rm -f AUTHORS.tmp diff --git a/tools/eslint/node_modules/doctrine/coverage/lcov.info b/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/dist/.keep similarity index 100% rename from tools/eslint/node_modules/doctrine/coverage/lcov.info rename to tools/eslint/node_modules/acorn-jsx/node_modules/acorn/dist/.keep diff --git a/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/dist/acorn.js b/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/dist/acorn.js new file mode 100644 index 00000000000000..9419f862ae779e --- /dev/null +++ b/tools/eslint/node_modules/acorn-jsx/node_modules/acorn/dist/acorn.js @@ -0,0 +1,3340 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.acorn = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 6 && (prop.computed || prop.method || prop.shorthand)) return; + var key = prop.key;var name = undefined; + switch (key.type) { + case "Identifier": + name = key.name;break; + case "Literal": + name = String(key.value);break; + default: + return; + } + var kind = prop.kind; + + if (this.options.ecmaVersion >= 6) { + if (name === "__proto__" && kind === "init") { + if (propHash.proto) this.raise(key.start, "Redefinition of __proto__ property"); + propHash.proto = true; + } + return; + } + name = "$" + name; + var other = propHash[name]; + if (other) { + var isGetSet = kind !== "init"; + if ((this.strict || isGetSet) && other[kind] || !(isGetSet ^ other.init)) this.raise(key.start, "Redefinition of property"); + } else { + other = propHash[name] = { + init: false, + get: false, + set: false + }; + } + other[kind] = true; +}; + +// ### Expression parsing + +// These nest, from the most general expression type at the top to +// 'atomic', nondivisible expression types at the bottom. Most of +// the functions will simply let the function(s) below them parse, +// and, *if* the syntactic construct they handle is present, wrap +// the AST node that the inner parser gave them in another node. + +// Parse a full expression. The optional arguments are used to +// forbid the `in` operator (in for loops initalization expressions) +// and provide reference for storing '=' operator inside shorthand +// property assignment in contexts where both object expression +// and object pattern might appear (so it's possible to raise +// delayed syntax error at correct position). + +pp.parseExpression = function (noIn, refDestructuringErrors) { + var startPos = this.start, + startLoc = this.startLoc; + var expr = this.parseMaybeAssign(noIn, refDestructuringErrors); + if (this.type === _tokentype.types.comma) { + var node = this.startNodeAt(startPos, startLoc); + node.expressions = [expr]; + while (this.eat(_tokentype.types.comma)) node.expressions.push(this.parseMaybeAssign(noIn, refDestructuringErrors)); + return this.finishNode(node, "SequenceExpression"); + } + return expr; +}; + +// Parse an assignment expression. This includes applications of +// operators like `+=`. + +pp.parseMaybeAssign = function (noIn, refDestructuringErrors, afterLeftParse) { + if (this.type == _tokentype.types._yield && this.inGenerator) return this.parseYield(); + + var validateDestructuring = false; + if (!refDestructuringErrors) { + refDestructuringErrors = { shorthandAssign: 0, trailingComma: 0 }; + validateDestructuring = true; + } + var startPos = this.start, + startLoc = this.startLoc; + if (this.type == _tokentype.types.parenL || this.type == _tokentype.types.name) this.potentialArrowAt = this.start; + var left = this.parseMaybeConditional(noIn, refDestructuringErrors); + if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc); + if (this.type.isAssign) { + if (validateDestructuring) this.checkPatternErrors(refDestructuringErrors, true); + var node = this.startNodeAt(startPos, startLoc); + node.operator = this.value; + node.left = this.type === _tokentype.types.eq ? this.toAssignable(left) : left; + refDestructuringErrors.shorthandAssign = 0; // reset because shorthand default was used correctly + this.checkLVal(left); + this.next(); + node.right = this.parseMaybeAssign(noIn); + return this.finishNode(node, "AssignmentExpression"); + } else { + if (validateDestructuring) this.checkExpressionErrors(refDestructuringErrors, true); + } + return left; +}; + +// Parse a ternary conditional (`?:`) operator. + +pp.parseMaybeConditional = function (noIn, refDestructuringErrors) { + var startPos = this.start, + startLoc = this.startLoc; + var expr = this.parseExprOps(noIn, refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) return expr; + if (this.eat(_tokentype.types.question)) { + var node = this.startNodeAt(startPos, startLoc); + node.test = expr; + node.consequent = this.parseMaybeAssign(); + this.expect(_tokentype.types.colon); + node.alternate = this.parseMaybeAssign(noIn); + return this.finishNode(node, "ConditionalExpression"); + } + return expr; +}; + +// Start the precedence parser. + +pp.parseExprOps = function (noIn, refDestructuringErrors) { + var startPos = this.start, + startLoc = this.startLoc; + var expr = this.parseMaybeUnary(refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) return expr; + return this.parseExprOp(expr, startPos, startLoc, -1, noIn); +}; + +// Parse binary operators with the operator precedence parsing +// algorithm. `left` is the left-hand side of the operator. +// `minPrec` provides context that allows the function to stop and +// defer further parser to one of its callers when it encounters an +// operator that has a lower precedence than the set it is parsing. + +pp.parseExprOp = function (left, leftStartPos, leftStartLoc, minPrec, noIn) { + var prec = this.type.binop; + if (prec != null && (!noIn || this.type !== _tokentype.types._in)) { + if (prec > minPrec) { + var node = this.startNodeAt(leftStartPos, leftStartLoc); + node.left = left; + node.operator = this.value; + var op = this.type; + this.next(); + var startPos = this.start, + startLoc = this.startLoc; + node.right = this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, prec, noIn); + this.finishNode(node, op === _tokentype.types.logicalOR || op === _tokentype.types.logicalAND ? "LogicalExpression" : "BinaryExpression"); + return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn); + } + } + return left; +}; + +// Parse unary operators, both prefix and postfix. + +pp.parseMaybeUnary = function (refDestructuringErrors) { + if (this.type.prefix) { + var node = this.startNode(), + update = this.type === _tokentype.types.incDec; + node.operator = this.value; + node.prefix = true; + this.next(); + node.argument = this.parseMaybeUnary(); + this.checkExpressionErrors(refDestructuringErrors, true); + if (update) this.checkLVal(node.argument);else if (this.strict && node.operator === "delete" && node.argument.type === "Identifier") this.raise(node.start, "Deleting local variable in strict mode"); + return this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); + } + var startPos = this.start, + startLoc = this.startLoc; + var expr = this.parseExprSubscripts(refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) return expr; + while (this.type.postfix && !this.canInsertSemicolon()) { + var node = this.startNodeAt(startPos, startLoc); + node.operator = this.value; + node.prefix = false; + node.argument = expr; + this.checkLVal(expr); + this.next(); + expr = this.finishNode(node, "UpdateExpression"); + } + return expr; +}; + +// Parse call, dot, and `[]`-subscript expressions. + +pp.parseExprSubscripts = function (refDestructuringErrors) { + var startPos = this.start, + startLoc = this.startLoc; + var expr = this.parseExprAtom(refDestructuringErrors); + var skipArrowSubscripts = expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")"; + if (this.checkExpressionErrors(refDestructuringErrors) || skipArrowSubscripts) return expr; + return this.parseSubscripts(expr, startPos, startLoc); +}; + +pp.parseSubscripts = function (base, startPos, startLoc, noCalls) { + for (;;) { + if (this.eat(_tokentype.types.dot)) { + var node = this.startNodeAt(startPos, startLoc); + node.object = base; + node.property = this.parseIdent(true); + node.computed = false; + base = this.finishNode(node, "MemberExpression"); + } else if (this.eat(_tokentype.types.bracketL)) { + var node = this.startNodeAt(startPos, startLoc); + node.object = base; + node.property = this.parseExpression(); + node.computed = true; + this.expect(_tokentype.types.bracketR); + base = this.finishNode(node, "MemberExpression"); + } else if (!noCalls && this.eat(_tokentype.types.parenL)) { + var node = this.startNodeAt(startPos, startLoc); + node.callee = base; + node.arguments = this.parseExprList(_tokentype.types.parenR, false); + base = this.finishNode(node, "CallExpression"); + } else if (this.type === _tokentype.types.backQuote) { + var node = this.startNodeAt(startPos, startLoc); + node.tag = base; + node.quasi = this.parseTemplate(); + base = this.finishNode(node, "TaggedTemplateExpression"); + } else { + return base; + } + } +}; + +// Parse an atomic expression — either a single token that is an +// expression, an expression started by a keyword like `function` or +// `new`, or an expression wrapped in punctuation like `()`, `[]`, +// or `{}`. + +pp.parseExprAtom = function (refDestructuringErrors) { + var node = undefined, + canBeArrow = this.potentialArrowAt == this.start; + switch (this.type) { + case _tokentype.types._super: + if (!this.inFunction) this.raise(this.start, "'super' outside of function or class"); + case _tokentype.types._this: + var type = this.type === _tokentype.types._this ? "ThisExpression" : "Super"; + node = this.startNode(); + this.next(); + return this.finishNode(node, type); + + case _tokentype.types._yield: + if (this.inGenerator) this.unexpected(); + + case _tokentype.types.name: + var startPos = this.start, + startLoc = this.startLoc; + var id = this.parseIdent(this.type !== _tokentype.types.name); + if (canBeArrow && !this.canInsertSemicolon() && this.eat(_tokentype.types.arrow)) return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id]); + return id; + + case _tokentype.types.regexp: + var value = this.value; + node = this.parseLiteral(value.value); + node.regex = { pattern: value.pattern, flags: value.flags }; + return node; + + case _tokentype.types.num:case _tokentype.types.string: + return this.parseLiteral(this.value); + + case _tokentype.types._null:case _tokentype.types._true:case _tokentype.types._false: + node = this.startNode(); + node.value = this.type === _tokentype.types._null ? null : this.type === _tokentype.types._true; + node.raw = this.type.keyword; + this.next(); + return this.finishNode(node, "Literal"); + + case _tokentype.types.parenL: + return this.parseParenAndDistinguishExpression(canBeArrow); + + case _tokentype.types.bracketL: + node = this.startNode(); + this.next(); + // check whether this is array comprehension or regular array + if (this.options.ecmaVersion >= 7 && this.type === _tokentype.types._for) { + return this.parseComprehension(node, false); + } + node.elements = this.parseExprList(_tokentype.types.bracketR, true, true, refDestructuringErrors); + return this.finishNode(node, "ArrayExpression"); + + case _tokentype.types.braceL: + return this.parseObj(false, refDestructuringErrors); + + case _tokentype.types._function: + node = this.startNode(); + this.next(); + return this.parseFunction(node, false); + + case _tokentype.types._class: + return this.parseClass(this.startNode(), false); + + case _tokentype.types._new: + return this.parseNew(); + + case _tokentype.types.backQuote: + return this.parseTemplate(); + + default: + this.unexpected(); + } +}; + +pp.parseLiteral = function (value) { + var node = this.startNode(); + node.value = value; + node.raw = this.input.slice(this.start, this.end); + this.next(); + return this.finishNode(node, "Literal"); +}; + +pp.parseParenExpression = function () { + this.expect(_tokentype.types.parenL); + var val = this.parseExpression(); + this.expect(_tokentype.types.parenR); + return val; +}; + +pp.parseParenAndDistinguishExpression = function (canBeArrow) { + var startPos = this.start, + startLoc = this.startLoc, + val = undefined; + if (this.options.ecmaVersion >= 6) { + this.next(); + + if (this.options.ecmaVersion >= 7 && this.type === _tokentype.types._for) { + return this.parseComprehension(this.startNodeAt(startPos, startLoc), true); + } + + var innerStartPos = this.start, + innerStartLoc = this.startLoc; + var exprList = [], + first = true; + var refDestructuringErrors = { shorthandAssign: 0, trailingComma: 0 }, + spreadStart = undefined, + innerParenStart = undefined; + while (this.type !== _tokentype.types.parenR) { + first ? first = false : this.expect(_tokentype.types.comma); + if (this.type === _tokentype.types.ellipsis) { + spreadStart = this.start; + exprList.push(this.parseParenItem(this.parseRest())); + break; + } else { + if (this.type === _tokentype.types.parenL && !innerParenStart) { + innerParenStart = this.start; + } + exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem)); + } + } + var innerEndPos = this.start, + innerEndLoc = this.startLoc; + this.expect(_tokentype.types.parenR); + + if (canBeArrow && !this.canInsertSemicolon() && this.eat(_tokentype.types.arrow)) { + this.checkPatternErrors(refDestructuringErrors, true); + if (innerParenStart) this.unexpected(innerParenStart); + return this.parseParenArrowList(startPos, startLoc, exprList); + } + + if (!exprList.length) this.unexpected(this.lastTokStart); + if (spreadStart) this.unexpected(spreadStart); + this.checkExpressionErrors(refDestructuringErrors, true); + + if (exprList.length > 1) { + val = this.startNodeAt(innerStartPos, innerStartLoc); + val.expressions = exprList; + this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); + } else { + val = exprList[0]; + } + } else { + val = this.parseParenExpression(); + } + + if (this.options.preserveParens) { + var par = this.startNodeAt(startPos, startLoc); + par.expression = val; + return this.finishNode(par, "ParenthesizedExpression"); + } else { + return val; + } +}; + +pp.parseParenItem = function (item) { + return item; +}; + +pp.parseParenArrowList = function (startPos, startLoc, exprList) { + return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList); +}; + +// New's precedence is slightly tricky. It must allow its argument to +// be a `[]` or dot subscript expression, but not a call — at least, +// not without wrapping it in parentheses. Thus, it uses the noCalls +// argument to parseSubscripts to prevent it from consuming the +// argument list. + +var empty = []; + +pp.parseNew = function () { + var node = this.startNode(); + var meta = this.parseIdent(true); + if (this.options.ecmaVersion >= 6 && this.eat(_tokentype.types.dot)) { + node.meta = meta; + node.property = this.parseIdent(true); + if (node.property.name !== "target") this.raise(node.property.start, "The only valid meta property for new is new.target"); + if (!this.inFunction) this.raise(node.start, "new.target can only be used in functions"); + return this.finishNode(node, "MetaProperty"); + } + var startPos = this.start, + startLoc = this.startLoc; + node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); + if (this.eat(_tokentype.types.parenL)) node.arguments = this.parseExprList(_tokentype.types.parenR, false);else node.arguments = empty; + return this.finishNode(node, "NewExpression"); +}; + +// Parse template expression. + +pp.parseTemplateElement = function () { + var elem = this.startNode(); + elem.value = { + raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, '\n'), + cooked: this.value + }; + this.next(); + elem.tail = this.type === _tokentype.types.backQuote; + return this.finishNode(elem, "TemplateElement"); +}; + +pp.parseTemplate = function () { + var node = this.startNode(); + this.next(); + node.expressions = []; + var curElt = this.parseTemplateElement(); + node.quasis = [curElt]; + while (!curElt.tail) { + this.expect(_tokentype.types.dollarBraceL); + node.expressions.push(this.parseExpression()); + this.expect(_tokentype.types.braceR); + node.quasis.push(curElt = this.parseTemplateElement()); + } + this.next(); + return this.finishNode(node, "TemplateLiteral"); +}; + +// Parse an object literal or binding pattern. + +pp.parseObj = function (isPattern, refDestructuringErrors) { + var node = this.startNode(), + first = true, + propHash = {}; + node.properties = []; + this.next(); + while (!this.eat(_tokentype.types.braceR)) { + if (!first) { + this.expect(_tokentype.types.comma); + if (this.afterTrailingComma(_tokentype.types.braceR)) break; + } else first = false; + + var prop = this.startNode(), + isGenerator = undefined, + startPos = undefined, + startLoc = undefined; + if (this.options.ecmaVersion >= 6) { + prop.method = false; + prop.shorthand = false; + if (isPattern || refDestructuringErrors) { + startPos = this.start; + startLoc = this.startLoc; + } + if (!isPattern) isGenerator = this.eat(_tokentype.types.star); + } + this.parsePropertyName(prop); + this.parsePropertyValue(prop, isPattern, isGenerator, startPos, startLoc, refDestructuringErrors); + this.checkPropClash(prop, propHash); + node.properties.push(this.finishNode(prop, "Property")); + } + return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression"); +}; + +pp.parsePropertyValue = function (prop, isPattern, isGenerator, startPos, startLoc, refDestructuringErrors) { + if (this.eat(_tokentype.types.colon)) { + prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); + prop.kind = "init"; + } else if (this.options.ecmaVersion >= 6 && this.type === _tokentype.types.parenL) { + if (isPattern) this.unexpected(); + prop.kind = "init"; + prop.method = true; + prop.value = this.parseMethod(isGenerator); + } else if (this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.type != _tokentype.types.comma && this.type != _tokentype.types.braceR)) { + if (isGenerator || isPattern) this.unexpected(); + prop.kind = prop.key.name; + this.parsePropertyName(prop); + prop.value = this.parseMethod(false); + var paramCount = prop.kind === "get" ? 0 : 1; + if (prop.value.params.length !== paramCount) { + var start = prop.value.start; + if (prop.kind === "get") this.raise(start, "getter should have no params");else this.raise(start, "setter should have exactly one param"); + } + if (prop.kind === "set" && prop.value.params[0].type === "RestElement") this.raise(prop.value.params[0].start, "Setter cannot use rest params"); + } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { + prop.kind = "init"; + if (isPattern) { + if (this.keywords.test(prop.key.name) || (this.strict ? this.reservedWordsStrictBind : this.reservedWords).test(prop.key.name)) this.raise(prop.key.start, "Binding " + prop.key.name); + prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); + } else if (this.type === _tokentype.types.eq && refDestructuringErrors) { + if (!refDestructuringErrors.shorthandAssign) refDestructuringErrors.shorthandAssign = this.start; + prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); + } else { + prop.value = prop.key; + } + prop.shorthand = true; + } else this.unexpected(); +}; + +pp.parsePropertyName = function (prop) { + if (this.options.ecmaVersion >= 6) { + if (this.eat(_tokentype.types.bracketL)) { + prop.computed = true; + prop.key = this.parseMaybeAssign(); + this.expect(_tokentype.types.bracketR); + return prop.key; + } else { + prop.computed = false; + } + } + return prop.key = this.type === _tokentype.types.num || this.type === _tokentype.types.string ? this.parseExprAtom() : this.parseIdent(true); +}; + +// Initialize empty function node. + +pp.initFunction = function (node) { + node.id = null; + if (this.options.ecmaVersion >= 6) { + node.generator = false; + node.expression = false; + } +}; + +// Parse object or class method. + +pp.parseMethod = function (isGenerator) { + var node = this.startNode(); + this.initFunction(node); + this.expect(_tokentype.types.parenL); + node.params = this.parseBindingList(_tokentype.types.parenR, false, false); + if (this.options.ecmaVersion >= 6) node.generator = isGenerator; + this.parseFunctionBody(node, false); + return this.finishNode(node, "FunctionExpression"); +}; + +// Parse arrow function expression with given parameters. + +pp.parseArrowExpression = function (node, params) { + this.initFunction(node); + node.params = this.toAssignableList(params, true); + this.parseFunctionBody(node, true); + return this.finishNode(node, "ArrowFunctionExpression"); +}; + +// Parse function body and check parameters. + +pp.parseFunctionBody = function (node, isArrowFunction) { + var isExpression = isArrowFunction && this.type !== _tokentype.types.braceL; + + if (isExpression) { + node.body = this.parseMaybeAssign(); + node.expression = true; + } else { + // Start a new scope with regard to labels and the `inFunction` + // flag (restore them to their old value afterwards). + var oldInFunc = this.inFunction, + oldInGen = this.inGenerator, + oldLabels = this.labels; + this.inFunction = true;this.inGenerator = node.generator;this.labels = []; + node.body = this.parseBlock(true); + node.expression = false; + this.inFunction = oldInFunc;this.inGenerator = oldInGen;this.labels = oldLabels; + } + + // If this is a strict mode function, verify that argument names + // are not repeated, and it does not try to bind the words `eval` + // or `arguments`. + if (this.strict || !isExpression && node.body.body.length && this.isUseStrict(node.body.body[0])) { + var oldStrict = this.strict; + this.strict = true; + if (node.id) this.checkLVal(node.id, true); + this.checkParams(node); + this.strict = oldStrict; + } else if (isArrowFunction) { + this.checkParams(node); + } +}; + +// Checks function params for various disallowed patterns such as using "eval" +// or "arguments" and duplicate parameters. + +pp.checkParams = function (node) { + var nameHash = {}; + for (var i = 0; i < node.params.length; i++) { + this.checkLVal(node.params[i], true, nameHash); + } +}; + +// Parses a comma-separated list of expressions, and returns them as +// an array. `close` is the token type that ends the list, and +// `allowEmpty` can be turned on to allow subsequent commas with +// nothing in between them to be parsed as `null` (which is needed +// for array literals). + +pp.parseExprList = function (close, allowTrailingComma, allowEmpty, refDestructuringErrors) { + var elts = [], + first = true; + while (!this.eat(close)) { + if (!first) { + this.expect(_tokentype.types.comma); + if (this.type === close && refDestructuringErrors && !refDestructuringErrors.trailingComma) { + refDestructuringErrors.trailingComma = this.lastTokStart; + } + if (allowTrailingComma && this.afterTrailingComma(close)) break; + } else first = false; + + var elt = undefined; + if (allowEmpty && this.type === _tokentype.types.comma) elt = null;else if (this.type === _tokentype.types.ellipsis) elt = this.parseSpread(refDestructuringErrors);else elt = this.parseMaybeAssign(false, refDestructuringErrors); + elts.push(elt); + } + return elts; +}; + +// Parse the next token as an identifier. If `liberal` is true (used +// when parsing properties), it will also convert keywords into +// identifiers. + +pp.parseIdent = function (liberal) { + var node = this.startNode(); + if (liberal && this.options.allowReserved == "never") liberal = false; + if (this.type === _tokentype.types.name) { + if (!liberal && (this.strict ? this.reservedWordsStrict : this.reservedWords).test(this.value) && (this.options.ecmaVersion >= 6 || this.input.slice(this.start, this.end).indexOf("\\") == -1)) this.raise(this.start, "The keyword '" + this.value + "' is reserved"); + node.name = this.value; + } else if (liberal && this.type.keyword) { + node.name = this.type.keyword; + } else { + this.unexpected(); + } + this.next(); + return this.finishNode(node, "Identifier"); +}; + +// Parses yield expression inside generator. + +pp.parseYield = function () { + var node = this.startNode(); + this.next(); + if (this.type == _tokentype.types.semi || this.canInsertSemicolon() || this.type != _tokentype.types.star && !this.type.startsExpr) { + node.delegate = false; + node.argument = null; + } else { + node.delegate = this.eat(_tokentype.types.star); + node.argument = this.parseMaybeAssign(); + } + return this.finishNode(node, "YieldExpression"); +}; + +// Parses array and generator comprehensions. + +pp.parseComprehension = function (node, isGenerator) { + node.blocks = []; + while (this.type === _tokentype.types._for) { + var block = this.startNode(); + this.next(); + this.expect(_tokentype.types.parenL); + block.left = this.parseBindingAtom(); + this.checkLVal(block.left, true); + this.expectContextual("of"); + block.right = this.parseExpression(); + this.expect(_tokentype.types.parenR); + node.blocks.push(this.finishNode(block, "ComprehensionBlock")); + } + node.filter = this.eat(_tokentype.types._if) ? this.parseParenExpression() : null; + node.body = this.parseExpression(); + this.expect(isGenerator ? _tokentype.types.parenR : _tokentype.types.bracketR); + node.generator = isGenerator; + return this.finishNode(node, "ComprehensionExpression"); +}; + +},{"./state":10,"./tokentype":14}],2:[function(_dereq_,module,exports){ +// This is a trick taken from Esprima. It turns out that, on +// non-Chrome browsers, to check whether a string is in a set, a +// predicate containing a big ugly `switch` statement is faster than +// a regular expression, and on Chrome the two are about on par. +// This function uses `eval` (non-lexical) to produce such a +// predicate from a space-separated string of words. +// +// It starts by sorting the words by length. + +// Reserved word lists for various dialects of the language + +"use strict"; + +exports.__esModule = true; +exports.isIdentifierStart = isIdentifierStart; +exports.isIdentifierChar = isIdentifierChar; +var reservedWords = { + 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", + 5: "class enum extends super const export import", + 6: "enum", + strict: "implements interface let package private protected public static yield", + strictBind: "eval arguments" +}; + +exports.reservedWords = reservedWords; +// And the keywords + +var 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"; + +var keywords = { + 5: ecma5AndLessKeywords, + 6: ecma5AndLessKeywords + " let const class extends export import yield super" +}; + +exports.keywords = keywords; +// ## Character categories + +// Big ugly regular expressions that match characters in the +// whitespace, identifier, and identifier-start categories. These +// are only applied when a character is found to actually have a +// code point above 128. +// Generated by `bin/generate-identifier-regex.js`. + +var nonASCIIidentifierStartChars = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢲऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ"; +var nonASCIIidentifierChars = "‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏ᦰ-ᧀᧈᧉ᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷼-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︭︳︴﹍-﹏0-9_"; + +var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); +var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); + +nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; + +// These are a run-length and offset encoded representation of the +// >0xffff code points that are a valid part of identifiers. The +// offset starts at 0x10000, and each pair of numbers represents an +// offset to the next range, and then a size of the range. They were +// generated by tools/generate-identifier-regex.js +var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 17, 26, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 99, 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, 98, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 26, 45, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 955, 52, 76, 44, 33, 24, 27, 35, 42, 34, 4, 0, 13, 47, 15, 3, 22, 0, 38, 17, 2, 24, 133, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 32, 4, 287, 47, 21, 1, 2, 0, 185, 46, 82, 47, 21, 0, 60, 42, 502, 63, 32, 0, 449, 56, 1288, 920, 104, 110, 2962, 1070, 13266, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 881, 68, 12, 0, 67, 12, 16481, 1, 3071, 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, 1340, 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, 16355, 541]; +var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 1306, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 52, 0, 13, 2, 49, 13, 16, 9, 83, 11, 168, 11, 6, 9, 8, 2, 57, 0, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 316, 19, 13, 9, 214, 6, 3, 8, 112, 16, 16, 9, 82, 12, 9, 9, 535, 9, 20855, 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, 4305, 6, 792618, 239]; + +// This has a complexity linear to the value of the code. The +// assumption is that looking up astral identifier characters is +// rare. +function isInAstralSet(code, set) { + var pos = 0x10000; + for (var i = 0; i < set.length; i += 2) { + pos += set[i]; + if (pos > code) return false; + pos += set[i + 1]; + if (pos >= code) return true; + } +} + +// Test whether a given character code starts an identifier. + +function isIdentifierStart(code, astral) { + if (code < 65) return code === 36; + if (code < 91) return true; + if (code < 97) return code === 95; + if (code < 123) return true; + if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)); + if (astral === false) return false; + return isInAstralSet(code, astralIdentifierStartCodes); +} + +// Test whether a given character is part of an identifier. + +function isIdentifierChar(code, astral) { + if (code < 48) return code === 36; + if (code < 58) return true; + if (code < 65) return false; + if (code < 91) return true; + if (code < 97) return code === 95; + if (code < 123) return true; + if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)); + if (astral === false) return false; + return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); +} + +},{}],3:[function(_dereq_,module,exports){ +// Acorn is a tiny, fast JavaScript parser written in JavaScript. +// +// Acorn was written by Marijn Haverbeke, Ingvar Stepanyan, and +// various contributors and released under an MIT license. +// +// Git repositories for Acorn are available at +// +// http://marijnhaverbeke.nl/git/acorn +// https://github.com/ternjs/acorn.git +// +// Please use the [github bug tracker][ghbt] to report issues. +// +// [ghbt]: https://github.com/ternjs/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 + +"use strict"; + +exports.__esModule = true; +exports.parse = parse; +exports.parseExpressionAt = parseExpressionAt; +exports.tokenizer = tokenizer; + +var _state = _dereq_("./state"); + +_dereq_("./parseutil"); + +_dereq_("./statement"); + +_dereq_("./lval"); + +_dereq_("./expression"); + +_dereq_("./location"); + +exports.Parser = _state.Parser; +exports.plugins = _state.plugins; + +var _options = _dereq_("./options"); + +exports.defaultOptions = _options.defaultOptions; + +var _locutil = _dereq_("./locutil"); + +exports.Position = _locutil.Position; +exports.SourceLocation = _locutil.SourceLocation; +exports.getLineInfo = _locutil.getLineInfo; + +var _node = _dereq_("./node"); + +exports.Node = _node.Node; + +var _tokentype = _dereq_("./tokentype"); + +exports.TokenType = _tokentype.TokenType; +exports.tokTypes = _tokentype.types; + +var _tokencontext = _dereq_("./tokencontext"); + +exports.TokContext = _tokencontext.TokContext; +exports.tokContexts = _tokencontext.types; + +var _identifier = _dereq_("./identifier"); + +exports.isIdentifierChar = _identifier.isIdentifierChar; +exports.isIdentifierStart = _identifier.isIdentifierStart; + +var _tokenize = _dereq_("./tokenize"); + +exports.Token = _tokenize.Token; + +var _whitespace = _dereq_("./whitespace"); + +exports.isNewLine = _whitespace.isNewLine; +exports.lineBreak = _whitespace.lineBreak; +exports.lineBreakG = _whitespace.lineBreakG; +var version = "2.7.0"; + +exports.version = version; +// The main exported interface (under `self.acorn` when in the +// browser) is a `parse` function that takes a code string and +// returns an abstract syntax tree as specified by [Mozilla parser +// API][api]. +// +// [api]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API + +function parse(input, options) { + return new _state.Parser(options, input).parse(); +} + +// This function tries to parse a single expression at a given +// offset in a string. Useful for parsing mixed-language formats +// that embed JavaScript expressions. + +function parseExpressionAt(input, pos, options) { + var p = new _state.Parser(options, input, pos); + p.nextToken(); + return p.parseExpression(); +} + +// 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 _state.Parser(options, input); +} + +},{"./expression":1,"./identifier":2,"./location":4,"./locutil":5,"./lval":6,"./node":7,"./options":8,"./parseutil":9,"./state":10,"./statement":11,"./tokencontext":12,"./tokenize":13,"./tokentype":14,"./whitespace":16}],4:[function(_dereq_,module,exports){ +"use strict"; + +var _state = _dereq_("./state"); + +var _locutil = _dereq_("./locutil"); + +var pp = _state.Parser.prototype; + +// This function is used to raise exceptions on parse errors. It +// takes an offset integer (into the current `input`) to indicate +// the location of the error, attaches the position to the end +// of the error message, and then raises a `SyntaxError` with that +// message. + +pp.raise = function (pos, message) { + var loc = _locutil.getLineInfo(this.input, pos); + message += " (" + loc.line + ":" + loc.column + ")"; + var err = new SyntaxError(message); + err.pos = pos;err.loc = loc;err.raisedAt = this.pos; + throw err; +}; + +pp.curPosition = function () { + if (this.options.locations) { + return new _locutil.Position(this.curLine, this.pos - this.lineStart); + } +}; + +},{"./locutil":5,"./state":10}],5:[function(_dereq_,module,exports){ +"use strict"; + +exports.__esModule = true; +exports.getLineInfo = getLineInfo; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var _whitespace = _dereq_("./whitespace"); + +// These are used when `options.locations` is on, for the +// `startLoc` and `endLoc` properties. + +var Position = (function () { + function Position(line, col) { + _classCallCheck(this, Position); + + this.line = line; + this.column = col; + } + + Position.prototype.offset = function offset(n) { + return new Position(this.line, this.column + n); + }; + + return Position; +})(); + +exports.Position = Position; + +var SourceLocation = function SourceLocation(p, start, end) { + _classCallCheck(this, SourceLocation); + + this.start = start; + this.end = end; + if (p.sourceFile !== null) this.source = p.sourceFile; +} + +// The `getLineInfo` function is mostly useful when the +// `locations` option is off (for performance reasons) and you +// want to find the line/column position for a given character +// offset. `input` should be the code string that the offset refers +// into. + +; + +exports.SourceLocation = SourceLocation; + +function getLineInfo(input, offset) { + for (var line = 1, cur = 0;;) { + _whitespace.lineBreakG.lastIndex = cur; + var match = _whitespace.lineBreakG.exec(input); + if (match && match.index < offset) { + ++line; + cur = match.index + match[0].length; + } else { + return new Position(line, offset - cur); + } + } +} + +},{"./whitespace":16}],6:[function(_dereq_,module,exports){ +"use strict"; + +var _tokentype = _dereq_("./tokentype"); + +var _state = _dereq_("./state"); + +var _util = _dereq_("./util"); + +var pp = _state.Parser.prototype; + +// Convert existing expression atom to assignable pattern +// if possible. + +pp.toAssignable = function (node, isBinding) { + if (this.options.ecmaVersion >= 6 && node) { + switch (node.type) { + case "Identifier": + case "ObjectPattern": + case "ArrayPattern": + break; + + case "ObjectExpression": + node.type = "ObjectPattern"; + for (var i = 0; i < node.properties.length; i++) { + var prop = node.properties[i]; + if (prop.kind !== "init") this.raise(prop.key.start, "Object pattern can't contain getter or setter"); + this.toAssignable(prop.value, isBinding); + } + break; + + case "ArrayExpression": + node.type = "ArrayPattern"; + this.toAssignableList(node.elements, isBinding); + break; + + case "AssignmentExpression": + if (node.operator === "=") { + node.type = "AssignmentPattern"; + delete node.operator; + // falls through to AssignmentPattern + } else { + this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); + break; + } + + case "AssignmentPattern": + if (node.right.type === "YieldExpression") this.raise(node.right.start, "Yield expression cannot be a default value"); + break; + + case "ParenthesizedExpression": + node.expression = this.toAssignable(node.expression, isBinding); + break; + + case "MemberExpression": + if (!isBinding) break; + + default: + this.raise(node.start, "Assigning to rvalue"); + } + } + return node; +}; + +// Convert list of expression atoms to binding list. + +pp.toAssignableList = function (exprList, isBinding) { + var end = exprList.length; + if (end) { + var last = exprList[end - 1]; + if (last && last.type == "RestElement") { + --end; + } else if (last && last.type == "SpreadElement") { + last.type = "RestElement"; + var arg = last.argument; + this.toAssignable(arg, isBinding); + if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern") this.unexpected(arg.start); + --end; + } + + if (isBinding && last.type === "RestElement" && last.argument.type !== "Identifier") this.unexpected(last.argument.start); + } + for (var i = 0; i < end; i++) { + var elt = exprList[i]; + if (elt) this.toAssignable(elt, isBinding); + } + return exprList; +}; + +// Parses spread element. + +pp.parseSpread = function (refDestructuringErrors) { + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeAssign(refDestructuringErrors); + return this.finishNode(node, "SpreadElement"); +}; + +pp.parseRest = function (allowNonIdent) { + var node = this.startNode(); + this.next(); + + // RestElement inside of a function parameter must be an identifier + if (allowNonIdent) node.argument = this.type === _tokentype.types.name ? this.parseIdent() : this.unexpected();else node.argument = this.type === _tokentype.types.name || this.type === _tokentype.types.bracketL ? this.parseBindingAtom() : this.unexpected(); + + return this.finishNode(node, "RestElement"); +}; + +// Parses lvalue (assignable) atom. + +pp.parseBindingAtom = function () { + if (this.options.ecmaVersion < 6) return this.parseIdent(); + switch (this.type) { + case _tokentype.types.name: + return this.parseIdent(); + + case _tokentype.types.bracketL: + var node = this.startNode(); + this.next(); + node.elements = this.parseBindingList(_tokentype.types.bracketR, true, true); + return this.finishNode(node, "ArrayPattern"); + + case _tokentype.types.braceL: + return this.parseObj(true); + + default: + this.unexpected(); + } +}; + +pp.parseBindingList = function (close, allowEmpty, allowTrailingComma, allowNonIdent) { + var elts = [], + first = true; + while (!this.eat(close)) { + if (first) first = false;else this.expect(_tokentype.types.comma); + if (allowEmpty && this.type === _tokentype.types.comma) { + elts.push(null); + } else if (allowTrailingComma && this.afterTrailingComma(close)) { + break; + } else if (this.type === _tokentype.types.ellipsis) { + var rest = this.parseRest(allowNonIdent); + this.parseBindingListItem(rest); + elts.push(rest); + this.expect(close); + break; + } else { + var elem = this.parseMaybeDefault(this.start, this.startLoc); + this.parseBindingListItem(elem); + elts.push(elem); + } + } + return elts; +}; + +pp.parseBindingListItem = function (param) { + return param; +}; + +// Parses assignment pattern around given atom if possible. + +pp.parseMaybeDefault = function (startPos, startLoc, left) { + left = left || this.parseBindingAtom(); + if (this.options.ecmaVersion < 6 || !this.eat(_tokentype.types.eq)) return left; + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.right = this.parseMaybeAssign(); + return this.finishNode(node, "AssignmentPattern"); +}; + +// Verify that a node is an lval — something that can be assigned +// to. + +pp.checkLVal = function (expr, isBinding, checkClashes) { + switch (expr.type) { + case "Identifier": + if (this.strict && this.reservedWordsStrictBind.test(expr.name)) this.raise(expr.start, (isBinding ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); + if (checkClashes) { + if (_util.has(checkClashes, expr.name)) this.raise(expr.start, "Argument name clash"); + checkClashes[expr.name] = true; + } + break; + + case "MemberExpression": + if (isBinding) this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " member expression"); + break; + + case "ObjectPattern": + for (var i = 0; i < expr.properties.length; i++) { + this.checkLVal(expr.properties[i].value, isBinding, checkClashes); + }break; + + case "ArrayPattern": + for (var i = 0; i < expr.elements.length; i++) { + var elem = expr.elements[i]; + if (elem) this.checkLVal(elem, isBinding, checkClashes); + } + break; + + case "AssignmentPattern": + this.checkLVal(expr.left, isBinding, checkClashes); + break; + + case "RestElement": + this.checkLVal(expr.argument, isBinding, checkClashes); + break; + + case "ParenthesizedExpression": + this.checkLVal(expr.expression, isBinding, checkClashes); + break; + + default: + this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " rvalue"); + } +}; + +},{"./state":10,"./tokentype":14,"./util":15}],7:[function(_dereq_,module,exports){ +"use strict"; + +exports.__esModule = true; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var _state = _dereq_("./state"); + +var _locutil = _dereq_("./locutil"); + +var Node = function Node(parser, pos, loc) { + _classCallCheck(this, Node); + + this.type = ""; + this.start = pos; + this.end = 0; + if (parser.options.locations) this.loc = new _locutil.SourceLocation(parser, loc); + if (parser.options.directSourceFile) this.sourceFile = parser.options.directSourceFile; + if (parser.options.ranges) this.range = [pos, 0]; +} + +// Start an AST node, attaching a start offset. + +; + +exports.Node = Node; +var pp = _state.Parser.prototype; + +pp.startNode = function () { + return new Node(this, this.start, this.startLoc); +}; + +pp.startNodeAt = function (pos, loc) { + return new Node(this, pos, loc); +}; + +// Finish an AST node, adding `type` and `end` properties. + +function finishNodeAt(node, type, pos, loc) { + node.type = type; + node.end = pos; + if (this.options.locations) node.loc.end = loc; + if (this.options.ranges) node.range[1] = pos; + return node; +} + +pp.finishNode = function (node, type) { + return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc); +}; + +// Finish node at given position + +pp.finishNodeAt = function (node, type, pos, loc) { + return finishNodeAt.call(this, node, type, pos, loc); +}; + +},{"./locutil":5,"./state":10}],8:[function(_dereq_,module,exports){ +"use strict"; + +exports.__esModule = true; +exports.getOptions = getOptions; + +var _util = _dereq_("./util"); + +var _locutil = _dereq_("./locutil"); + +// A second optional argument can be given to further configure +// the parser process. These options are recognized: + +var defaultOptions = { + // `ecmaVersion` indicates the ECMAScript version to parse. Must + // be either 3, or 5, or 6. This influences support for strict + // mode, the set of reserved words, support for getters and + // setters and other features. + ecmaVersion: 5, + // Source type ("script" or "module") for different semantics + sourceType: "script", + // `onInsertedSemicolon` can be a callback that will be called + // when a semicolon is automatically inserted. It will be passed + // th position of the comma as an offset, and if `locations` is + // enabled, it is given the location as a `{line, column}` object + // as second argument. + onInsertedSemicolon: null, + // `onTrailingComma` is similar to `onInsertedSemicolon`, but for + // trailing commas. + onTrailingComma: null, + // By default, reserved words are only enforced if ecmaVersion >= 5. + // Set `allowReserved` to a boolean value to explicitly turn this on + // an off. When this option has the value "never", reserved words + // and keywords can also not be used as property names. + allowReserved: null, + // When enabled, a return at the top level is not considered an + // error. + allowReturnOutsideFunction: false, + // When enabled, import/export statements are not constrained to + // appearing at the top of the program. + allowImportExportEverywhere: false, + // When enabled, hashbang directive in the beginning of file + // is allowed and treated as a line comment. + allowHashBang: false, + // When `locations` is on, `loc` properties holding objects with + // `start` and `end` properties in `{line, column}` form (with + // line being 1-based and column 0-based) will be attached to the + // nodes. + locations: false, + // A function can be passed as `onToken` option, which will + // cause Acorn to call that function with object in the same + // format as tokens returned from `tokenizer().getToken()`. Note + // that you are not allowed to call the parser from the + // callback—that will corrupt its internal state. + onToken: null, + // A function can be passed as `onComment` option, which will + // cause Acorn to call that function with `(block, text, start, + // end)` parameters whenever a comment is skipped. `block` is a + // boolean indicating whether this is a block (`/* */`) comment, + // `text` is the content of the comment, and `start` and `end` are + // character offsets that denote the start and end of the comment. + // When the `locations` option is on, two more parameters are + // passed, the full `{line, column}` locations of the start and + // end of the comments. Note that you are not allowed to call the + // parser from the callback—that will corrupt its internal state. + onComment: null, + // Nodes have their start and end characters offsets recorded in + // `start` and `end` properties (directly on the node, rather than + // the `loc` object, which holds line/column data. To also add a + // [semi-standardized][range] `range` property holding a `[start, + // end]` array with the same numbers, set the `ranges` option to + // `true`. + // + // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 + ranges: false, + // It is possible to parse multiple files into a single AST by + // passing the tree produced by parsing the first file as + // `program` option in subsequent parses. This will add the + // toplevel forms of the parsed file to the `Program` (top) node + // of an existing parse tree. + program: null, + // When `locations` is on, you can pass this to record the source + // file in every node's `loc` object. + sourceFile: null, + // This value, if given, is stored in every node, whether + // `locations` is on or off. + directSourceFile: null, + // When enabled, parenthesized expressions are represented by + // (non-standard) ParenthesizedExpression nodes + preserveParens: false, + plugins: {} +}; + +exports.defaultOptions = defaultOptions; +// Interpret and default an options object + +function getOptions(opts) { + var options = {}; + for (var opt in defaultOptions) { + options[opt] = opts && _util.has(opts, opt) ? opts[opt] : defaultOptions[opt]; + }if (options.allowReserved == null) options.allowReserved = options.ecmaVersion < 5; + + if (_util.isArray(options.onToken)) { + (function () { + var tokens = options.onToken; + options.onToken = function (token) { + return tokens.push(token); + }; + })(); + } + if (_util.isArray(options.onComment)) options.onComment = pushComment(options, options.onComment); + + return options; +} + +function pushComment(options, array) { + return function (block, text, start, end, startLoc, endLoc) { + var comment = { + type: block ? 'Block' : 'Line', + value: text, + start: start, + end: end + }; + if (options.locations) comment.loc = new _locutil.SourceLocation(this, startLoc, endLoc); + if (options.ranges) comment.range = [start, end]; + array.push(comment); + }; +} + +},{"./locutil":5,"./util":15}],9:[function(_dereq_,module,exports){ +"use strict"; + +var _tokentype = _dereq_("./tokentype"); + +var _state = _dereq_("./state"); + +var _whitespace = _dereq_("./whitespace"); + +var pp = _state.Parser.prototype; + +// ## Parser utilities + +// Test whether a statement node is the string literal `"use strict"`. + +pp.isUseStrict = function (stmt) { + return this.options.ecmaVersion >= 5 && stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && stmt.expression.raw.slice(1, -1) === "use strict"; +}; + +// Predicate that tests whether the next token is of the given +// type, and if yes, consumes it as a side effect. + +pp.eat = function (type) { + if (this.type === type) { + this.next(); + return true; + } else { + return false; + } +}; + +// Tests whether parsed token is a contextual keyword. + +pp.isContextual = function (name) { + return this.type === _tokentype.types.name && this.value === name; +}; + +// Consumes contextual keyword if possible. + +pp.eatContextual = function (name) { + return this.value === name && this.eat(_tokentype.types.name); +}; + +// Asserts that following token is given contextual keyword. + +pp.expectContextual = function (name) { + if (!this.eatContextual(name)) this.unexpected(); +}; + +// Test whether a semicolon can be inserted at the current position. + +pp.canInsertSemicolon = function () { + return this.type === _tokentype.types.eof || this.type === _tokentype.types.braceR || _whitespace.lineBreak.test(this.input.slice(this.lastTokEnd, this.start)); +}; + +pp.insertSemicolon = function () { + if (this.canInsertSemicolon()) { + if (this.options.onInsertedSemicolon) this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); + return true; + } +}; + +// Consume a semicolon, or, failing that, see if we are allowed to +// pretend that there is a semicolon at this position. + +pp.semicolon = function () { + if (!this.eat(_tokentype.types.semi) && !this.insertSemicolon()) this.unexpected(); +}; + +pp.afterTrailingComma = function (tokType) { + if (this.type == tokType) { + if (this.options.onTrailingComma) this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); + this.next(); + return true; + } +}; + +// Expect a token of a given type. If found, consume it, otherwise, +// raise an unexpected token error. + +pp.expect = function (type) { + this.eat(type) || this.unexpected(); +}; + +// Raise an unexpected token error. + +pp.unexpected = function (pos) { + this.raise(pos != null ? pos : this.start, "Unexpected token"); +}; + +pp.checkPatternErrors = function (refDestructuringErrors, andThrow) { + var pos = refDestructuringErrors && refDestructuringErrors.trailingComma; + if (!andThrow) return !!pos; + if (pos) this.raise(pos, "Trailing comma is not permitted in destructuring patterns"); +}; + +pp.checkExpressionErrors = function (refDestructuringErrors, andThrow) { + var pos = refDestructuringErrors && refDestructuringErrors.shorthandAssign; + if (!andThrow) return !!pos; + if (pos) this.raise(pos, "Shorthand property assignments are valid only in destructuring patterns"); +}; + +},{"./state":10,"./tokentype":14,"./whitespace":16}],10:[function(_dereq_,module,exports){ +"use strict"; + +exports.__esModule = true; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var _identifier = _dereq_("./identifier"); + +var _tokentype = _dereq_("./tokentype"); + +var _whitespace = _dereq_("./whitespace"); + +var _options = _dereq_("./options"); + +// Registered plugins +var plugins = {}; + +exports.plugins = plugins; +function keywordRegexp(words) { + return new RegExp("^(" + words.replace(/ /g, "|") + ")$"); +} + +var Parser = (function () { + function Parser(options, input, startPos) { + _classCallCheck(this, Parser); + + this.options = options = _options.getOptions(options); + this.sourceFile = options.sourceFile; + this.keywords = keywordRegexp(_identifier.keywords[options.ecmaVersion >= 6 ? 6 : 5]); + var reserved = options.allowReserved ? "" : _identifier.reservedWords[options.ecmaVersion] + (options.sourceType == "module" ? " await" : ""); + this.reservedWords = keywordRegexp(reserved); + var reservedStrict = (reserved ? reserved + " " : "") + _identifier.reservedWords.strict; + this.reservedWordsStrict = keywordRegexp(reservedStrict); + this.reservedWordsStrictBind = keywordRegexp(reservedStrict + " " + _identifier.reservedWords.strictBind); + this.input = String(input); + + // Used to signal to callers of `readWord1` whether the word + // contained any escape sequences. This is needed because words with + // 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. + if (startPos) { + this.pos = startPos; + this.lineStart = Math.max(0, this.input.lastIndexOf("\n", startPos)); + this.curLine = this.input.slice(0, this.lineStart).split(_whitespace.lineBreak).length; + } else { + this.pos = this.lineStart = 0; + this.curLine = 1; + } + + // Properties of the current token: + // Its type + this.type = _tokentype.types.eof; + // For tokens that include more information than their type, the value + this.value = null; + // Its start and end offset + this.start = this.end = this.pos; + // And, if locations are used, the {line, column} object + // corresponding to those offsets + this.startLoc = this.endLoc = this.curPosition(); + + // Position information for the previous token + this.lastTokEndLoc = this.lastTokStartLoc = null; + this.lastTokStart = this.lastTokEnd = this.pos; + + // The context stack is used to superficially track syntactic + // context to predict whether a regular expression is allowed in a + // given position. + this.context = this.initialContext(); + this.exprAllowed = true; + + // Figure out if it's a module code. + this.strict = this.inModule = options.sourceType === "module"; + + // Used to signify the start of a potential arrow function + this.potentialArrowAt = -1; + + // Flags to track whether we are in a function, a generator. + this.inFunction = this.inGenerator = false; + // Labels in scope. + this.labels = []; + + // If enabled, skip leading hashbang line. + if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === '#!') this.skipLineComment(2); + } + + // 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); + }; + + Parser.prototype.extend = function extend(name, f) { + this[name] = f(this[name]); + }; + + Parser.prototype.loadPlugins = function loadPlugins(pluginConfigs) { + for (var _name in pluginConfigs) { + var plugin = plugins[_name]; + if (!plugin) throw new Error("Plugin '" + _name + "' not found"); + plugin(this, pluginConfigs[_name]); + } + }; + + Parser.prototype.parse = function parse() { + var node = this.options.program || this.startNode(); + this.nextToken(); + return this.parseTopLevel(node); + }; + + return Parser; +})(); + +exports.Parser = Parser; + +},{"./identifier":2,"./options":8,"./tokentype":14,"./whitespace":16}],11:[function(_dereq_,module,exports){ +"use strict"; + +var _tokentype = _dereq_("./tokentype"); + +var _state = _dereq_("./state"); + +var _whitespace = _dereq_("./whitespace"); + +var pp = _state.Parser.prototype; + +// ### Statement parsing + +// Parse a program. Initializes the parser, reads any number of +// statements, and wraps them in a Program node. Optionally takes a +// `program` argument. If present, the statements will be appended +// to its body instead of creating a new node. + +pp.parseTopLevel = function (node) { + var first = true; + if (!node.body) node.body = []; + while (this.type !== _tokentype.types.eof) { + var stmt = this.parseStatement(true, true); + node.body.push(stmt); + if (first) { + if (this.isUseStrict(stmt)) this.setStrict(true); + first = false; + } + } + this.next(); + if (this.options.ecmaVersion >= 6) { + node.sourceType = this.options.sourceType; + } + return this.finishNode(node, "Program"); +}; + +var loopLabel = { kind: "loop" }, + switchLabel = { kind: "switch" }; + +// Parse a single statement. +// +// If expecting a statement and finding a slash operator, parse a +// regular expression literal. This is to handle cases like +// `if (foo) /blah/.exec(foo)`, where looking at the previous token +// does not help. + +pp.parseStatement = function (declaration, topLevel) { + var starttype = this.type, + node = this.startNode(); + + // Most types of statements are recognized by the keyword they + // start with. Many are trivial to parse, some require a bit of + // complexity. + + switch (starttype) { + case _tokentype.types._break:case _tokentype.types._continue: + return this.parseBreakContinueStatement(node, starttype.keyword); + case _tokentype.types._debugger: + return this.parseDebuggerStatement(node); + case _tokentype.types._do: + return this.parseDoStatement(node); + case _tokentype.types._for: + return this.parseForStatement(node); + case _tokentype.types._function: + if (!declaration && this.options.ecmaVersion >= 6) this.unexpected(); + return this.parseFunctionStatement(node); + case _tokentype.types._class: + if (!declaration) this.unexpected(); + return this.parseClass(node, true); + case _tokentype.types._if: + return this.parseIfStatement(node); + case _tokentype.types._return: + return this.parseReturnStatement(node); + case _tokentype.types._switch: + return this.parseSwitchStatement(node); + case _tokentype.types._throw: + return this.parseThrowStatement(node); + case _tokentype.types._try: + return this.parseTryStatement(node); + case _tokentype.types._let:case _tokentype.types._const: + if (!declaration) this.unexpected(); // NOTE: falls through to _var + case _tokentype.types._var: + return this.parseVarStatement(node, starttype); + case _tokentype.types._while: + return this.parseWhileStatement(node); + case _tokentype.types._with: + return this.parseWithStatement(node); + case _tokentype.types.braceL: + return this.parseBlock(); + case _tokentype.types.semi: + return this.parseEmptyStatement(node); + case _tokentype.types._export: + case _tokentype.types._import: + if (!this.options.allowImportExportEverywhere) { + if (!topLevel) this.raise(this.start, "'import' and 'export' may only appear at the top level"); + if (!this.inModule) this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); + } + return starttype === _tokentype.types._import ? this.parseImport(node) : this.parseExport(node); + + // If the statement does not start with a statement keyword or a + // brace, it's an ExpressionStatement or LabeledStatement. We + // simply start parsing an expression, and afterwards, if the + // next token is a colon and the expression was a simple + // Identifier node, we switch to interpreting it as a label. + default: + var maybeName = this.value, + expr = this.parseExpression(); + if (starttype === _tokentype.types.name && expr.type === "Identifier" && this.eat(_tokentype.types.colon)) return this.parseLabeledStatement(node, maybeName, expr);else return this.parseExpressionStatement(node, expr); + } +}; + +pp.parseBreakContinueStatement = function (node, keyword) { + var isBreak = keyword == "break"; + this.next(); + if (this.eat(_tokentype.types.semi) || this.insertSemicolon()) node.label = null;else if (this.type !== _tokentype.types.name) this.unexpected();else { + node.label = this.parseIdent(); + this.semicolon(); + } + + // Verify that there is an actual destination to break or + // continue to. + for (var i = 0; i < this.labels.length; ++i) { + var lab = this.labels[i]; + if (node.label == null || lab.name === node.label.name) { + if (lab.kind != null && (isBreak || lab.kind === "loop")) break; + if (node.label && isBreak) break; + } + } + if (i === this.labels.length) this.raise(node.start, "Unsyntactic " + keyword); + return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); +}; + +pp.parseDebuggerStatement = function (node) { + this.next(); + this.semicolon(); + return this.finishNode(node, "DebuggerStatement"); +}; + +pp.parseDoStatement = function (node) { + this.next(); + this.labels.push(loopLabel); + node.body = this.parseStatement(false); + this.labels.pop(); + this.expect(_tokentype.types._while); + node.test = this.parseParenExpression(); + if (this.options.ecmaVersion >= 6) this.eat(_tokentype.types.semi);else this.semicolon(); + return this.finishNode(node, "DoWhileStatement"); +}; + +// Disambiguating between a `for` and a `for`/`in` or `for`/`of` +// loop is non-trivial. Basically, we have to parse the init `var` +// statement or expression, disallowing the `in` operator (see +// the second parameter to `parseExpression`), and then check +// whether the next token is `in` or `of`. When there is no init +// part (semicolon immediately after the opening parenthesis), it +// is a regular `for` loop. + +pp.parseForStatement = function (node) { + this.next(); + this.labels.push(loopLabel); + this.expect(_tokentype.types.parenL); + if (this.type === _tokentype.types.semi) return this.parseFor(node, null); + if (this.type === _tokentype.types._var || this.type === _tokentype.types._let || this.type === _tokentype.types._const) { + var _init = this.startNode(), + varKind = this.type; + this.next(); + this.parseVar(_init, true, varKind); + this.finishNode(_init, "VariableDeclaration"); + if ((this.type === _tokentype.types._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && _init.declarations.length === 1 && !(varKind !== _tokentype.types._var && _init.declarations[0].init)) return this.parseForIn(node, _init); + return this.parseFor(node, _init); + } + var refDestructuringErrors = { shorthandAssign: 0, trailingComma: 0 }; + var init = this.parseExpression(true, refDestructuringErrors); + if (this.type === _tokentype.types._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) { + this.checkPatternErrors(refDestructuringErrors, true); + this.toAssignable(init); + this.checkLVal(init); + return this.parseForIn(node, init); + } else { + this.checkExpressionErrors(refDestructuringErrors, true); + } + return this.parseFor(node, init); +}; + +pp.parseFunctionStatement = function (node) { + this.next(); + return this.parseFunction(node, true); +}; + +pp.parseIfStatement = function (node) { + this.next(); + node.test = this.parseParenExpression(); + node.consequent = this.parseStatement(false); + node.alternate = this.eat(_tokentype.types._else) ? this.parseStatement(false) : null; + return this.finishNode(node, "IfStatement"); +}; + +pp.parseReturnStatement = function (node) { + if (!this.inFunction && !this.options.allowReturnOutsideFunction) this.raise(this.start, "'return' outside of function"); + this.next(); + + // In `return` (and `break`/`continue`), the keywords with + // optional arguments, we eagerly look for a semicolon or the + // possibility to insert one. + + if (this.eat(_tokentype.types.semi) || this.insertSemicolon()) node.argument = null;else { + node.argument = this.parseExpression();this.semicolon(); + } + return this.finishNode(node, "ReturnStatement"); +}; + +pp.parseSwitchStatement = function (node) { + this.next(); + node.discriminant = this.parseParenExpression(); + node.cases = []; + this.expect(_tokentype.types.braceL); + this.labels.push(switchLabel); + + // Statements under must be grouped (by label) in SwitchCase + // nodes. `cur` is used to keep the node that we are currently + // adding statements to. + + for (var cur, sawDefault = false; this.type != _tokentype.types.braceR;) { + if (this.type === _tokentype.types._case || this.type === _tokentype.types._default) { + var isCase = this.type === _tokentype.types._case; + if (cur) this.finishNode(cur, "SwitchCase"); + node.cases.push(cur = this.startNode()); + cur.consequent = []; + this.next(); + if (isCase) { + cur.test = this.parseExpression(); + } else { + if (sawDefault) this.raise(this.lastTokStart, "Multiple default clauses"); + sawDefault = true; + cur.test = null; + } + this.expect(_tokentype.types.colon); + } else { + if (!cur) this.unexpected(); + cur.consequent.push(this.parseStatement(true)); + } + } + if (cur) this.finishNode(cur, "SwitchCase"); + this.next(); // Closing brace + this.labels.pop(); + return this.finishNode(node, "SwitchStatement"); +}; + +pp.parseThrowStatement = function (node) { + this.next(); + if (_whitespace.lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) this.raise(this.lastTokEnd, "Illegal newline after throw"); + node.argument = this.parseExpression(); + this.semicolon(); + return this.finishNode(node, "ThrowStatement"); +}; + +// Reused empty array added for node fields that are always empty. + +var empty = []; + +pp.parseTryStatement = function (node) { + this.next(); + node.block = this.parseBlock(); + node.handler = null; + if (this.type === _tokentype.types._catch) { + var clause = this.startNode(); + this.next(); + this.expect(_tokentype.types.parenL); + clause.param = this.parseBindingAtom(); + this.checkLVal(clause.param, true); + this.expect(_tokentype.types.parenR); + clause.body = this.parseBlock(); + node.handler = this.finishNode(clause, "CatchClause"); + } + node.finalizer = this.eat(_tokentype.types._finally) ? this.parseBlock() : null; + if (!node.handler && !node.finalizer) this.raise(node.start, "Missing catch or finally clause"); + return this.finishNode(node, "TryStatement"); +}; + +pp.parseVarStatement = function (node, kind) { + this.next(); + this.parseVar(node, false, kind); + this.semicolon(); + return this.finishNode(node, "VariableDeclaration"); +}; + +pp.parseWhileStatement = function (node) { + this.next(); + node.test = this.parseParenExpression(); + this.labels.push(loopLabel); + node.body = this.parseStatement(false); + this.labels.pop(); + return this.finishNode(node, "WhileStatement"); +}; + +pp.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); + return this.finishNode(node, "WithStatement"); +}; + +pp.parseEmptyStatement = function (node) { + this.next(); + return this.finishNode(node, "EmptyStatement"); +}; + +pp.parseLabeledStatement = function (node, maybeName, expr) { + for (var i = 0; i < this.labels.length; ++i) { + if (this.labels[i].name === maybeName) this.raise(expr.start, "Label '" + maybeName + "' is already declared"); + }var kind = this.type.isLoop ? "loop" : this.type === _tokentype.types._switch ? "switch" : null; + for (var i = this.labels.length - 1; i >= 0; i--) { + var label = this.labels[i]; + if (label.statementStart == node.start) { + label.statementStart = this.start; + label.kind = kind; + } else break; + } + this.labels.push({ name: maybeName, kind: kind, statementStart: this.start }); + node.body = this.parseStatement(true); + this.labels.pop(); + node.label = expr; + return this.finishNode(node, "LabeledStatement"); +}; + +pp.parseExpressionStatement = function (node, expr) { + node.expression = expr; + this.semicolon(); + return this.finishNode(node, "ExpressionStatement"); +}; + +// Parse a semicolon-enclosed block of statements, handling `"use +// strict"` declarations when `allowStrict` is true (used for +// function bodies). + +pp.parseBlock = function (allowStrict) { + var node = this.startNode(), + first = true, + oldStrict = undefined; + node.body = []; + this.expect(_tokentype.types.braceL); + while (!this.eat(_tokentype.types.braceR)) { + var stmt = this.parseStatement(true); + node.body.push(stmt); + if (first && allowStrict && this.isUseStrict(stmt)) { + oldStrict = this.strict; + this.setStrict(this.strict = true); + } + first = false; + } + if (oldStrict === false) this.setStrict(false); + return this.finishNode(node, "BlockStatement"); +}; + +// Parse a regular `for` loop. The disambiguation code in +// `parseStatement` will already have parsed the init statement or +// expression. + +pp.parseFor = function (node, init) { + node.init = init; + this.expect(_tokentype.types.semi); + node.test = this.type === _tokentype.types.semi ? null : this.parseExpression(); + this.expect(_tokentype.types.semi); + node.update = this.type === _tokentype.types.parenR ? null : this.parseExpression(); + this.expect(_tokentype.types.parenR); + node.body = this.parseStatement(false); + this.labels.pop(); + return this.finishNode(node, "ForStatement"); +}; + +// Parse a `for`/`in` and `for`/`of` loop, which are almost +// same from parser's perspective. + +pp.parseForIn = function (node, init) { + var type = this.type === _tokentype.types._in ? "ForInStatement" : "ForOfStatement"; + this.next(); + node.left = init; + node.right = this.parseExpression(); + this.expect(_tokentype.types.parenR); + node.body = this.parseStatement(false); + this.labels.pop(); + return this.finishNode(node, type); +}; + +// Parse a list of variable declarations. + +pp.parseVar = function (node, isFor, kind) { + node.declarations = []; + node.kind = kind.keyword; + for (;;) { + var decl = this.startNode(); + this.parseVarId(decl); + if (this.eat(_tokentype.types.eq)) { + decl.init = this.parseMaybeAssign(isFor); + } else if (kind === _tokentype.types._const && !(this.type === _tokentype.types._in || this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + this.unexpected(); + } else if (decl.id.type != "Identifier" && !(isFor && (this.type === _tokentype.types._in || this.isContextual("of")))) { + this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value"); + } else { + decl.init = null; + } + node.declarations.push(this.finishNode(decl, "VariableDeclarator")); + if (!this.eat(_tokentype.types.comma)) break; + } + return node; +}; + +pp.parseVarId = function (decl) { + decl.id = this.parseBindingAtom(); + this.checkLVal(decl.id, true); +}; + +// Parse a function declaration or literal (depending on the +// `isStatement` parameter). + +pp.parseFunction = function (node, isStatement, allowExpressionBody) { + this.initFunction(node); + if (this.options.ecmaVersion >= 6) node.generator = this.eat(_tokentype.types.star); + if (isStatement || this.type === _tokentype.types.name) node.id = this.parseIdent(); + this.parseFunctionParams(node); + this.parseFunctionBody(node, allowExpressionBody); + return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); +}; + +pp.parseFunctionParams = function (node) { + this.expect(_tokentype.types.parenL); + node.params = this.parseBindingList(_tokentype.types.parenR, false, false, true); +}; + +// Parse a class declaration or literal (depending on the +// `isStatement` parameter). + +pp.parseClass = function (node, isStatement) { + this.next(); + this.parseClassId(node, isStatement); + this.parseClassSuper(node); + var classBody = this.startNode(); + var hadConstructor = false; + classBody.body = []; + this.expect(_tokentype.types.braceL); + while (!this.eat(_tokentype.types.braceR)) { + if (this.eat(_tokentype.types.semi)) continue; + var method = this.startNode(); + var isGenerator = this.eat(_tokentype.types.star); + var isMaybeStatic = this.type === _tokentype.types.name && this.value === "static"; + this.parsePropertyName(method); + method["static"] = isMaybeStatic && this.type !== _tokentype.types.parenL; + if (method["static"]) { + if (isGenerator) this.unexpected(); + isGenerator = this.eat(_tokentype.types.star); + this.parsePropertyName(method); + } + method.kind = "method"; + var isGetSet = false; + if (!method.computed) { + var key = method.key; + + if (!isGenerator && key.type === "Identifier" && this.type !== _tokentype.types.parenL && (key.name === "get" || key.name === "set")) { + isGetSet = true; + method.kind = key.name; + key = this.parsePropertyName(method); + } + if (!method["static"] && (key.type === "Identifier" && key.name === "constructor" || key.type === "Literal" && key.value === "constructor")) { + if (hadConstructor) this.raise(key.start, "Duplicate constructor in the same class"); + if (isGetSet) this.raise(key.start, "Constructor can't have get/set modifier"); + if (isGenerator) this.raise(key.start, "Constructor can't be a generator"); + method.kind = "constructor"; + hadConstructor = true; + } + } + this.parseClassMethod(classBody, method, isGenerator); + if (isGetSet) { + var paramCount = method.kind === "get" ? 0 : 1; + if (method.value.params.length !== paramCount) { + var start = method.value.start; + if (method.kind === "get") this.raise(start, "getter should have no params");else this.raise(start, "setter should have exactly one param"); + } + if (method.kind === "set" && method.value.params[0].type === "RestElement") this.raise(method.value.params[0].start, "Setter cannot use rest params"); + } + } + node.body = this.finishNode(classBody, "ClassBody"); + return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); +}; + +pp.parseClassMethod = function (classBody, method, isGenerator) { + method.value = this.parseMethod(isGenerator); + classBody.body.push(this.finishNode(method, "MethodDefinition")); +}; + +pp.parseClassId = function (node, isStatement) { + node.id = this.type === _tokentype.types.name ? this.parseIdent() : isStatement ? this.unexpected() : null; +}; + +pp.parseClassSuper = function (node) { + node.superClass = this.eat(_tokentype.types._extends) ? this.parseExprSubscripts() : null; +}; + +// Parses module export declaration. + +pp.parseExport = function (node) { + this.next(); + // export * from '...' + if (this.eat(_tokentype.types.star)) { + this.expectContextual("from"); + node.source = this.type === _tokentype.types.string ? this.parseExprAtom() : this.unexpected(); + this.semicolon(); + return this.finishNode(node, "ExportAllDeclaration"); + } + if (this.eat(_tokentype.types._default)) { + // export default ... + var expr = this.parseMaybeAssign(); + var needsSemi = true; + if (expr.type == "FunctionExpression" || expr.type == "ClassExpression") { + needsSemi = false; + if (expr.id) { + expr.type = expr.type == "FunctionExpression" ? "FunctionDeclaration" : "ClassDeclaration"; + } + } + node.declaration = expr; + if (needsSemi) this.semicolon(); + return this.finishNode(node, "ExportDefaultDeclaration"); + } + // export var|const|let|function|class ... + if (this.shouldParseExportStatement()) { + node.declaration = this.parseStatement(true); + node.specifiers = []; + node.source = null; + } else { + // export { x, y as z } [from '...'] + node.declaration = null; + node.specifiers = this.parseExportSpecifiers(); + if (this.eatContextual("from")) { + node.source = this.type === _tokentype.types.string ? this.parseExprAtom() : this.unexpected(); + } else { + // check for keywords used as local names + for (var i = 0; i < node.specifiers.length; i++) { + if (this.keywords.test(node.specifiers[i].local.name) || this.reservedWords.test(node.specifiers[i].local.name)) { + this.unexpected(node.specifiers[i].local.start); + } + } + + node.source = null; + } + this.semicolon(); + } + return this.finishNode(node, "ExportNamedDeclaration"); +}; + +pp.shouldParseExportStatement = function () { + return this.type.keyword; +}; + +// Parses a comma-separated list of module exports. + +pp.parseExportSpecifiers = function () { + var nodes = [], + first = true; + // export { x, y as z } [from '...'] + this.expect(_tokentype.types.braceL); + while (!this.eat(_tokentype.types.braceR)) { + if (!first) { + this.expect(_tokentype.types.comma); + if (this.afterTrailingComma(_tokentype.types.braceR)) break; + } else first = false; + + var node = this.startNode(); + node.local = this.parseIdent(this.type === _tokentype.types._default); + node.exported = this.eatContextual("as") ? this.parseIdent(true) : node.local; + nodes.push(this.finishNode(node, "ExportSpecifier")); + } + return nodes; +}; + +// Parses import declaration. + +pp.parseImport = function (node) { + this.next(); + // import '...' + if (this.type === _tokentype.types.string) { + node.specifiers = empty; + node.source = this.parseExprAtom(); + } else { + node.specifiers = this.parseImportSpecifiers(); + this.expectContextual("from"); + node.source = this.type === _tokentype.types.string ? this.parseExprAtom() : this.unexpected(); + } + this.semicolon(); + return this.finishNode(node, "ImportDeclaration"); +}; + +// Parses a comma-separated list of module imports. + +pp.parseImportSpecifiers = function () { + var nodes = [], + first = true; + if (this.type === _tokentype.types.name) { + // import defaultObj, { x, y as z } from '...' + var node = this.startNode(); + node.local = this.parseIdent(); + this.checkLVal(node.local, true); + nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); + if (!this.eat(_tokentype.types.comma)) return nodes; + } + if (this.type === _tokentype.types.star) { + var node = this.startNode(); + this.next(); + this.expectContextual("as"); + node.local = this.parseIdent(); + this.checkLVal(node.local, true); + nodes.push(this.finishNode(node, "ImportNamespaceSpecifier")); + return nodes; + } + this.expect(_tokentype.types.braceL); + while (!this.eat(_tokentype.types.braceR)) { + if (!first) { + this.expect(_tokentype.types.comma); + if (this.afterTrailingComma(_tokentype.types.braceR)) break; + } else first = false; + + var node = this.startNode(); + node.imported = this.parseIdent(true); + if (this.eatContextual("as")) { + node.local = this.parseIdent(); + } else { + node.local = node.imported; + if (this.isKeyword(node.local.name)) this.unexpected(node.local.start); + if (this.reservedWordsStrict.test(node.local.name)) this.raise(node.local.start, "The keyword '" + node.local.name + "' is reserved"); + } + this.checkLVal(node.local, true); + nodes.push(this.finishNode(node, "ImportSpecifier")); + } + return nodes; +}; + +},{"./state":10,"./tokentype":14,"./whitespace":16}],12:[function(_dereq_,module,exports){ +// The algorithm used to determine whether a regexp can appear at a +// given point in the program is loosely based on sweet.js' approach. +// See https://github.com/mozilla/sweet.js/wiki/design + +"use strict"; + +exports.__esModule = true; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var _state = _dereq_("./state"); + +var _tokentype = _dereq_("./tokentype"); + +var _whitespace = _dereq_("./whitespace"); + +var TokContext = function TokContext(token, isExpr, preserveSpace, override) { + _classCallCheck(this, TokContext); + + this.token = token; + this.isExpr = !!isExpr; + this.preserveSpace = !!preserveSpace; + this.override = override; +}; + +exports.TokContext = TokContext; +var types = { + b_stat: new TokContext("{", false), + b_expr: new TokContext("{", true), + b_tmpl: new TokContext("${", true), + p_stat: new TokContext("(", false), + p_expr: new TokContext("(", true), + q_tmpl: new TokContext("`", true, true, function (p) { + return p.readTmplToken(); + }), + f_expr: new TokContext("function", true) +}; + +exports.types = types; +var pp = _state.Parser.prototype; + +pp.initialContext = function () { + return [types.b_stat]; +}; + +pp.braceIsBlock = function (prevType) { + if (prevType === _tokentype.types.colon) { + var _parent = this.curContext(); + if (_parent === types.b_stat || _parent === types.b_expr) return !_parent.isExpr; + } + if (prevType === _tokentype.types._return) return _whitespace.lineBreak.test(this.input.slice(this.lastTokEnd, this.start)); + if (prevType === _tokentype.types._else || prevType === _tokentype.types.semi || prevType === _tokentype.types.eof || prevType === _tokentype.types.parenR) return true; + if (prevType == _tokentype.types.braceL) return this.curContext() === types.b_stat; + return !this.exprAllowed; +}; + +pp.updateContext = function (prevType) { + var update = undefined, + type = this.type; + if (type.keyword && prevType == _tokentype.types.dot) this.exprAllowed = false;else if (update = type.updateContext) update.call(this, prevType);else this.exprAllowed = type.beforeExpr; +}; + +// Token-specific context update code + +_tokentype.types.parenR.updateContext = _tokentype.types.braceR.updateContext = function () { + if (this.context.length == 1) { + this.exprAllowed = true; + return; + } + var out = this.context.pop(); + if (out === types.b_stat && this.curContext() === types.f_expr) { + this.context.pop(); + this.exprAllowed = false; + } else if (out === types.b_tmpl) { + this.exprAllowed = true; + } else { + this.exprAllowed = !out.isExpr; + } +}; + +_tokentype.types.braceL.updateContext = function (prevType) { + this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr); + this.exprAllowed = true; +}; + +_tokentype.types.dollarBraceL.updateContext = function () { + this.context.push(types.b_tmpl); + this.exprAllowed = true; +}; + +_tokentype.types.parenL.updateContext = function (prevType) { + var statementParens = prevType === _tokentype.types._if || prevType === _tokentype.types._for || prevType === _tokentype.types._with || prevType === _tokentype.types._while; + this.context.push(statementParens ? types.p_stat : types.p_expr); + this.exprAllowed = true; +}; + +_tokentype.types.incDec.updateContext = function () { + // tokExprAllowed stays unchanged +}; + +_tokentype.types._function.updateContext = function () { + if (this.curContext() !== types.b_stat) this.context.push(types.f_expr); + this.exprAllowed = false; +}; + +_tokentype.types.backQuote.updateContext = function () { + if (this.curContext() === types.q_tmpl) this.context.pop();else this.context.push(types.q_tmpl); + this.exprAllowed = false; +}; + +},{"./state":10,"./tokentype":14,"./whitespace":16}],13:[function(_dereq_,module,exports){ +"use strict"; + +exports.__esModule = true; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var _identifier = _dereq_("./identifier"); + +var _tokentype = _dereq_("./tokentype"); + +var _state = _dereq_("./state"); + +var _locutil = _dereq_("./locutil"); + +var _whitespace = _dereq_("./whitespace"); + +// Object type used to represent tokens. Note that normally, tokens +// simply exist as properties on the parser object. This is only +// used for the onToken callback and the external tokenizer. + +var Token = function Token(p) { + _classCallCheck(this, Token); + + this.type = p.type; + this.value = p.value; + this.start = p.start; + this.end = p.end; + if (p.options.locations) this.loc = new _locutil.SourceLocation(p, p.startLoc, p.endLoc); + if (p.options.ranges) this.range = [p.start, p.end]; +} + +// ## Tokenizer + +; + +exports.Token = Token; +var pp = _state.Parser.prototype; + +// Are we running under Rhino? +var isRhino = typeof Packages == "object" && Object.prototype.toString.call(Packages) == "[object JavaPackage]"; + +// Move to the next token + +pp.next = function () { + if (this.options.onToken) this.options.onToken(new Token(this)); + + this.lastTokEnd = this.end; + this.lastTokStart = this.start; + this.lastTokEndLoc = this.endLoc; + this.lastTokStartLoc = this.startLoc; + this.nextToken(); +}; + +pp.getToken = function () { + this.next(); + return new Token(this); +}; + +// If we're in an ES6 environment, make parsers iterable +if (typeof Symbol !== "undefined") pp[Symbol.iterator] = function () { + var self = this; + return { next: function next() { + var token = self.getToken(); + return { + done: token.type === _tokentype.types.eof, + value: token + }; + } }; +}; + +// Toggle strict mode. Re-reads the next number or string to please +// pedantic tests (`"use strict"; 010;` should fail). + +pp.setStrict = function (strict) { + this.strict = strict; + if (this.type !== _tokentype.types.num && this.type !== _tokentype.types.string) return; + this.pos = this.start; + if (this.options.locations) { + while (this.pos < this.lineStart) { + this.lineStart = this.input.lastIndexOf("\n", this.lineStart - 2) + 1; + --this.curLine; + } + } + this.nextToken(); +}; + +pp.curContext = function () { + return this.context[this.context.length - 1]; +}; + +// Read a single token, updating the parser object's token-related +// properties. + +pp.nextToken = function () { + var curContext = this.curContext(); + if (!curContext || !curContext.preserveSpace) this.skipSpace(); + + this.start = this.pos; + if (this.options.locations) this.startLoc = this.curPosition(); + if (this.pos >= this.input.length) return this.finishToken(_tokentype.types.eof); + + if (curContext.override) return curContext.override(this);else this.readToken(this.fullCharCodeAtPos()); +}; + +pp.readToken = function (code) { + // Identifier or keyword. '\uXXXX' sequences are allowed in + // identifiers, so '\' also dispatches to that. + if (_identifier.isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */) return this.readWord(); + + return this.getTokenFromCode(code); +}; + +pp.fullCharCodeAtPos = function () { + var code = this.input.charCodeAt(this.pos); + if (code <= 0xd7ff || code >= 0xe000) return code; + var next = this.input.charCodeAt(this.pos + 1); + return (code << 10) + next - 0x35fdc00; +}; + +pp.skipBlockComment = function () { + var startLoc = this.options.onComment && this.curPosition(); + var start = this.pos, + end = this.input.indexOf("*/", this.pos += 2); + if (end === -1) this.raise(this.pos - 2, "Unterminated comment"); + this.pos = end + 2; + if (this.options.locations) { + _whitespace.lineBreakG.lastIndex = start; + var match = undefined; + while ((match = _whitespace.lineBreakG.exec(this.input)) && match.index < this.pos) { + ++this.curLine; + this.lineStart = match.index + match[0].length; + } + } + if (this.options.onComment) this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos, startLoc, this.curPosition()); +}; + +pp.skipLineComment = function (startSkip) { + var start = this.pos; + var startLoc = this.options.onComment && this.curPosition(); + var ch = this.input.charCodeAt(this.pos += startSkip); + while (this.pos < this.input.length && ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233) { + ++this.pos; + ch = this.input.charCodeAt(this.pos); + } + if (this.options.onComment) this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos, startLoc, this.curPosition()); +}; + +// Called at the start of the parse and after every token. Skips +// whitespace and comments, and. + +pp.skipSpace = function () { + loop: while (this.pos < this.input.length) { + var ch = this.input.charCodeAt(this.pos); + switch (ch) { + case 32:case 160: + // ' ' + ++this.pos; + break; + case 13: + if (this.input.charCodeAt(this.pos + 1) === 10) { + ++this.pos; + } + case 10:case 8232:case 8233: + ++this.pos; + if (this.options.locations) { + ++this.curLine; + this.lineStart = this.pos; + } + break; + case 47: + // '/' + switch (this.input.charCodeAt(this.pos + 1)) { + case 42: + // '*' + this.skipBlockComment(); + break; + case 47: + this.skipLineComment(2); + break; + default: + break loop; + } + break; + default: + if (ch > 8 && ch < 14 || ch >= 5760 && _whitespace.nonASCIIwhitespace.test(String.fromCharCode(ch))) { + ++this.pos; + } else { + break loop; + } + } + } +}; + +// Called at the end of every token. Sets `end`, `val`, and +// maintains `context` and `exprAllowed`, and skips the space after +// the token, so that the next one's `start` will point at the +// right position. + +pp.finishToken = function (type, val) { + this.end = this.pos; + if (this.options.locations) this.endLoc = this.curPosition(); + var prevType = this.type; + this.type = type; + this.value = val; + + this.updateContext(prevType); +}; + +// ### Token reading + +// This is the function that is called to fetch the next token. It +// is somewhat obscure, because it works in character codes rather +// than characters, and because operator parsing has been inlined +// into it. +// +// All in the name of speed. +// +pp.readToken_dot = function () { + var next = this.input.charCodeAt(this.pos + 1); + if (next >= 48 && next <= 57) return this.readNumber(true); + var next2 = this.input.charCodeAt(this.pos + 2); + if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { + // 46 = dot '.' + this.pos += 3; + return this.finishToken(_tokentype.types.ellipsis); + } else { + ++this.pos; + return this.finishToken(_tokentype.types.dot); + } +}; + +pp.readToken_slash = function () { + // '/' + var next = this.input.charCodeAt(this.pos + 1); + if (this.exprAllowed) { + ++this.pos;return this.readRegexp(); + } + if (next === 61) return this.finishOp(_tokentype.types.assign, 2); + return this.finishOp(_tokentype.types.slash, 1); +}; + +pp.readToken_mult_modulo = function (code) { + // '%*' + var next = this.input.charCodeAt(this.pos + 1); + if (next === 61) return this.finishOp(_tokentype.types.assign, 2); + return this.finishOp(code === 42 ? _tokentype.types.star : _tokentype.types.modulo, 1); +}; + +pp.readToken_pipe_amp = function (code) { + // '|&' + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) return this.finishOp(code === 124 ? _tokentype.types.logicalOR : _tokentype.types.logicalAND, 2); + if (next === 61) return this.finishOp(_tokentype.types.assign, 2); + return this.finishOp(code === 124 ? _tokentype.types.bitwiseOR : _tokentype.types.bitwiseAND, 1); +}; + +pp.readToken_caret = function () { + // '^' + var next = this.input.charCodeAt(this.pos + 1); + if (next === 61) return this.finishOp(_tokentype.types.assign, 2); + return this.finishOp(_tokentype.types.bitwiseXOR, 1); +}; + +pp.readToken_plus_min = function (code) { + // '+-' + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { + if (next == 45 && this.input.charCodeAt(this.pos + 2) == 62 && _whitespace.lineBreak.test(this.input.slice(this.lastTokEnd, this.pos))) { + // A `-->` line comment + this.skipLineComment(3); + this.skipSpace(); + return this.nextToken(); + } + return this.finishOp(_tokentype.types.incDec, 2); + } + if (next === 61) return this.finishOp(_tokentype.types.assign, 2); + return this.finishOp(_tokentype.types.plusMin, 1); +}; + +pp.readToken_lt_gt = function (code) { + // '<>' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(_tokentype.types.assign, size + 1); + return this.finishOp(_tokentype.types.bitShift, size); + } + if (next == 33 && code == 60 && this.input.charCodeAt(this.pos + 2) == 45 && this.input.charCodeAt(this.pos + 3) == 45) { + if (this.inModule) this.unexpected(); + // `` line comment + this.skipLineComment(3) + this.skipSpace() + return this.nextToken() + } + return this.finishOp(tt.incDec, 2) + } + if (next === 61) return this.finishOp(tt.assign, 2) + return this.finishOp(tt.plusMin, 1) +} + +pp.readToken_lt_gt = function(code) { // '<>' + let next = this.input.charCodeAt(this.pos + 1) + let size = 1 + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2 + if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1) + return this.finishOp(tt.bitShift, size) + } + if (next == 33 && code == 60 && this.input.charCodeAt(this.pos + 2) == 45 && + this.input.charCodeAt(this.pos + 3) == 45) { + if (this.inModule) this.unexpected() + // `` line comment + this.skipLineComment(3); + this.skipSpace(); + return this.nextToken(); + } + return this.finishOp(_tokentype.types.incDec, 2); + } + if (next === 61) return this.finishOp(_tokentype.types.assign, 2); + return this.finishOp(_tokentype.types.plusMin, 1); +}; + +pp.readToken_lt_gt = function (code) { + // '<>' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(_tokentype.types.assign, size + 1); + return this.finishOp(_tokentype.types.bitShift, size); + } + if (next == 33 && code == 60 && this.input.charCodeAt(this.pos + 2) == 45 && this.input.charCodeAt(this.pos + 3) == 45) { + if (this.inModule) this.unexpected(); + // `` line comment + this.skipLineComment(3) + this.skipSpace() + return this.nextToken() + } + return this.finishOp(tt.incDec, 2) + } + if (next === 61) return this.finishOp(tt.assign, 2) + return this.finishOp(tt.plusMin, 1) +} + +pp.readToken_lt_gt = function(code) { // '<>' + let next = this.input.charCodeAt(this.pos + 1) + let size = 1 + if (next === code) { + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2 + if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1) + return this.finishOp(tt.bitShift, size) + } + if (next == 33 && code == 60 && this.input.charCodeAt(this.pos + 2) == 45 && + this.input.charCodeAt(this.pos + 3) == 45) { + if (this.inModule) this.unexpected() + // ` - -Streams can be either [Readable][], [Writable][], or both ([Duplex][]). - -All streams are EventEmitters, but they also have other custom methods -and properties depending on whether they are Readable, Writable, or -Duplex. - -If a stream is both Readable and Writable, then it implements all of -the methods and events below. So, a [Duplex][] or [Transform][] stream is -fully described by this API, though their implementation may be -somewhat different. - -It is not necessary to implement Stream interfaces in order to consume -streams in your programs. If you **are** implementing streaming -interfaces in your own program, please also refer to -[API for Stream Implementors][] below. - -Almost all io.js programs, no matter how simple, use Streams in some -way. Here is an example of using Streams in an io.js program: - -```javascript -var http = require('http'); - -var server = http.createServer(function (req, res) { - // req is an http.IncomingMessage, which is a Readable Stream - // res is an http.ServerResponse, which is a Writable Stream - - var body = ''; - // we want to get the data as utf8 strings - // If you don't set an encoding, then you'll get Buffer objects - req.setEncoding('utf8'); - - // Readable streams emit 'data' events once a listener is added - req.on('data', function (chunk) { - body += chunk; - }); - - // the end event tells you that you have entire body - req.on('end', function () { - try { - var data = JSON.parse(body); - } catch (er) { - // uh oh! bad json! - res.statusCode = 400; - return res.end('error: ' + er.message); - } - - // write back something interesting to the user: - res.write(typeof data); - res.end(); - }); -}); - -server.listen(1337); - -// $ curl localhost:1337 -d '{}' -// object -// $ curl localhost:1337 -d '"foo"' -// string -// $ curl localhost:1337 -d 'not json' -// error: Unexpected token o -``` - -### Class: stream.Readable - - - -The Readable stream interface is the abstraction for a *source* of -data that you are reading from. In other words, data comes *out* of a -Readable stream. - -A Readable stream will not start emitting data until you indicate that -you are ready to receive it. - -Readable streams have two "modes": a **flowing mode** and a **paused -mode**. When in flowing mode, data is read from the underlying system -and provided to your program as fast as possible. In paused mode, you -must explicitly call `stream.read()` to get chunks of data out. -Streams start out in paused mode. - -**Note**: If no data event handlers are attached, and there are no -[`pipe()`][] destinations, and the stream is switched into flowing -mode, then data will be lost. - -You can switch to flowing mode by doing any of the following: - -* Adding a [`'data'` event][] handler to listen for data. -* Calling the [`resume()`][] method to explicitly open the flow. -* Calling the [`pipe()`][] method to send the data to a [Writable][]. - -You can switch back to paused mode by doing either of the following: - -* If there are no pipe destinations, by calling the [`pause()`][] - method. -* If there are pipe destinations, by removing any [`'data'` event][] - handlers, and removing all pipe destinations by calling the - [`unpipe()`][] method. - -Note that, for backwards compatibility reasons, removing `'data'` -event handlers will **not** automatically pause the stream. Also, if -there are piped destinations, then calling `pause()` will not -guarantee that the stream will *remain* paused once those -destinations drain and ask for more data. - -Examples of readable streams include: - -* [http responses, on the client](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_http_incomingmessage) -* [http requests, on the server](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_http_incomingmessage) -* [fs read streams](https://iojs.org/dist/v2.3.0/doc/api/fs.html#fs_class_fs_readstream) -* [zlib streams][] -* [crypto streams][] -* [tcp sockets][] -* [child process stdout and stderr][] -* [process.stdin][] - -#### Event: 'readable' - -When a chunk of data can be read from the stream, it will emit a -`'readable'` event. - -In some cases, listening for a `'readable'` event will cause some data -to be read into the internal buffer from the underlying system, if it -hadn't already. - -```javascript -var readable = getReadableStreamSomehow(); -readable.on('readable', function() { - // there is some data to read now -}); -``` - -Once the internal buffer is drained, a `readable` event will fire -again when more data is available. - -#### Event: 'data' - -* `chunk` {Buffer | String} The chunk of data. - -Attaching a `data` event listener to a stream that has not been -explicitly paused will switch the stream into flowing mode. Data will -then be passed as soon as it is available. - -If you just want to get all the data out of the stream as fast as -possible, this is the best way to do so. - -```javascript -var readable = getReadableStreamSomehow(); -readable.on('data', function(chunk) { - console.log('got %d bytes of data', chunk.length); -}); -``` - -#### Event: 'end' - -This event fires when there will be no more data to read. - -Note that the `end` event **will not fire** unless the data is -completely consumed. This can be done by switching into flowing mode, -or by calling `read()` repeatedly until you get to the end. - -```javascript -var readable = getReadableStreamSomehow(); -readable.on('data', function(chunk) { - console.log('got %d bytes of data', chunk.length); -}); -readable.on('end', function() { - console.log('there will be no more data.'); -}); -``` - -#### Event: 'close' - -Emitted when the underlying resource (for example, the backing file -descriptor) has been closed. Not all streams will emit this. - -#### Event: 'error' - -* {Error Object} - -Emitted if there was an error receiving data. - -#### readable.read([size]) - -* `size` {Number} Optional argument to specify how much data to read. -* Return {String | Buffer | null} - -The `read()` method pulls some data out of the internal buffer and -returns it. If there is no data available, then it will return -`null`. - -If you pass in a `size` argument, then it will return that many -bytes. If `size` bytes are not available, then it will return `null`. - -If you do not specify a `size` argument, then it will return all the -data in the internal buffer. - -This method should only be called in paused mode. In flowing mode, -this method is called automatically until the internal buffer is -drained. - -```javascript -var readable = getReadableStreamSomehow(); -readable.on('readable', function() { - var chunk; - while (null !== (chunk = readable.read())) { - console.log('got %d bytes of data', chunk.length); - } -}); -``` - -If this method returns a data chunk, then it will also trigger the -emission of a [`'data'` event][]. - -#### readable.setEncoding(encoding) - -* `encoding` {String} The encoding to use. -* Return: `this` - -Call this function to cause the stream to return strings of the -specified encoding instead of Buffer objects. For example, if you do -`readable.setEncoding('utf8')`, then the output data will be -interpreted as UTF-8 data, and returned as strings. If you do -`readable.setEncoding('hex')`, then the data will be encoded in -hexadecimal string format. - -This properly handles multi-byte characters that would otherwise be -potentially mangled if you simply pulled the Buffers directly and -called `buf.toString(encoding)` on them. If you want to read the data -as strings, always use this method. - -```javascript -var readable = getReadableStreamSomehow(); -readable.setEncoding('utf8'); -readable.on('data', function(chunk) { - assert.equal(typeof chunk, 'string'); - console.log('got %d characters of string data', chunk.length); -}); -``` - -#### readable.resume() - -* Return: `this` - -This method will cause the readable stream to resume emitting `data` -events. - -This method will switch the stream into flowing mode. If you do *not* -want to consume the data from a stream, but you *do* want to get to -its `end` event, you can call [`readable.resume()`][] to open the flow of -data. - -```javascript -var readable = getReadableStreamSomehow(); -readable.resume(); -readable.on('end', function() { - console.log('got to the end, but did not read anything'); -}); -``` - -#### readable.pause() - -* Return: `this` - -This method will cause a stream in flowing mode to stop emitting -`data` events, switching out of flowing mode. Any data that becomes -available will remain in the internal buffer. - -```javascript -var readable = getReadableStreamSomehow(); -readable.on('data', function(chunk) { - console.log('got %d bytes of data', chunk.length); - readable.pause(); - console.log('there will be no more data for 1 second'); - setTimeout(function() { - console.log('now data will start flowing again'); - readable.resume(); - }, 1000); -}); -``` - -#### readable.isPaused() - -* Return: `Boolean` - -This method returns whether or not the `readable` has been **explicitly** -paused by client code (using `readable.pause()` without a corresponding -`readable.resume()`). - -```javascript -var readable = new stream.Readable - -readable.isPaused() // === false -readable.pause() -readable.isPaused() // === true -readable.resume() -readable.isPaused() // === false -``` - -#### readable.pipe(destination[, options]) - -* `destination` {[Writable][] Stream} The destination for writing data -* `options` {Object} Pipe options - * `end` {Boolean} End the writer when the reader ends. Default = `true` - -This method pulls all the data out of a readable stream, and writes it -to the supplied destination, automatically managing the flow so that -the destination is not overwhelmed by a fast readable stream. - -Multiple destinations can be piped to safely. - -```javascript -var readable = getReadableStreamSomehow(); -var writable = fs.createWriteStream('file.txt'); -// All the data from readable goes into 'file.txt' -readable.pipe(writable); -``` - -This function returns the destination stream, so you can set up pipe -chains like so: - -```javascript -var r = fs.createReadStream('file.txt'); -var z = zlib.createGzip(); -var w = fs.createWriteStream('file.txt.gz'); -r.pipe(z).pipe(w); -``` - -For example, emulating the Unix `cat` command: - -```javascript -process.stdin.pipe(process.stdout); -``` - -By default [`end()`][] is called on the destination when the source stream -emits `end`, so that `destination` is no longer writable. Pass `{ end: -false }` as `options` to keep the destination stream open. - -This keeps `writer` open so that "Goodbye" can be written at the -end. - -```javascript -reader.pipe(writer, { end: false }); -reader.on('end', function() { - writer.end('Goodbye\n'); -}); -``` - -Note that `process.stderr` and `process.stdout` are never closed until -the process exits, regardless of the specified options. - -#### readable.unpipe([destination]) - -* `destination` {[Writable][] Stream} Optional specific stream to unpipe - -This method will remove the hooks set up for a previous `pipe()` call. - -If the destination is not specified, then all pipes are removed. - -If the destination is specified, but no pipe is set up for it, then -this is a no-op. - -```javascript -var readable = getReadableStreamSomehow(); -var writable = fs.createWriteStream('file.txt'); -// All the data from readable goes into 'file.txt', -// but only for the first second -readable.pipe(writable); -setTimeout(function() { - console.log('stop writing to file.txt'); - readable.unpipe(writable); - console.log('manually close the file stream'); - writable.end(); -}, 1000); -``` - -#### readable.unshift(chunk) - -* `chunk` {Buffer | String} Chunk of data to unshift onto the read queue - -This is useful in certain cases where a stream is being consumed by a -parser, which needs to "un-consume" some data that it has -optimistically pulled out of the source, so that the stream can be -passed on to some other party. - -If you find that you must often call `stream.unshift(chunk)` in your -programs, consider implementing a [Transform][] stream instead. (See API -for Stream Implementors, below.) - -```javascript -// Pull off a header delimited by \n\n -// use unshift() if we get too much -// Call the callback with (error, header, stream) -var StringDecoder = require('string_decoder').StringDecoder; -function parseHeader(stream, callback) { - stream.on('error', callback); - stream.on('readable', onReadable); - var decoder = new StringDecoder('utf8'); - var header = ''; - function onReadable() { - var chunk; - while (null !== (chunk = stream.read())) { - var str = decoder.write(chunk); - if (str.match(/\n\n/)) { - // found the header boundary - var split = str.split(/\n\n/); - header += split.shift(); - var remaining = split.join('\n\n'); - var buf = new Buffer(remaining, 'utf8'); - if (buf.length) - stream.unshift(buf); - stream.removeListener('error', callback); - stream.removeListener('readable', onReadable); - // now the body of the message can be read from the stream. - callback(null, header, stream); - } else { - // still reading the header. - header += str; - } - } - } -} -``` - -#### readable.wrap(stream) - -* `stream` {Stream} An "old style" readable stream - -Versions of Node.js prior to v0.10 had streams that did not implement the -entire Streams API as it is today. (See "Compatibility" below for -more information.) - -If you are using an older io.js library that emits `'data'` events and -has a [`pause()`][] method that is advisory only, then you can use the -`wrap()` method to create a [Readable][] stream that uses the old stream -as its data source. - -You will very rarely ever need to call this function, but it exists -as a convenience for interacting with old io.js programs and libraries. - -For example: - -```javascript -var OldReader = require('./old-api-module.js').OldReader; -var oreader = new OldReader; -var Readable = require('stream').Readable; -var myReader = new Readable().wrap(oreader); - -myReader.on('readable', function() { - myReader.read(); // etc. -}); -``` - - -### Class: stream.Writable - - - -The Writable stream interface is an abstraction for a *destination* -that you are writing data *to*. - -Examples of writable streams include: - -* [http requests, on the client](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_class_http_clientrequest) -* [http responses, on the server](https://iojs.org/dist/v2.3.0/doc/api/http.html#http_class_http_serverresponse) -* [fs write streams](https://iojs.org/dist/v2.3.0/doc/api/fs.html#fs_class_fs_writestream) -* [zlib streams][] -* [crypto streams][] -* [tcp sockets][] -* [child process stdin](https://iojs.org/dist/v2.3.0/doc/api/child_process.html#child_process_child_stdin) -* [process.stdout][], [process.stderr][] - -#### writable.write(chunk[, encoding][, callback]) - -* `chunk` {String | Buffer} The data to write -* `encoding` {String} The encoding, if `chunk` is a String -* `callback` {Function} Callback for when this chunk of data is flushed -* Returns: {Boolean} True if the data was handled completely. - -This method writes some data to the underlying system, and calls the -supplied callback once the data has been fully handled. - -The return value indicates if you should continue writing right now. -If the data had to be buffered internally, then it will return -`false`. Otherwise, it will return `true`. - -This return value is strictly advisory. You MAY continue to write, -even if it returns `false`. However, writes will be buffered in -memory, so it is best not to do this excessively. Instead, wait for -the `drain` event before writing more data. - -#### Event: 'drain' - -If a [`writable.write(chunk)`][] call returns false, then the `drain` -event will indicate when it is appropriate to begin writing more data -to the stream. - -```javascript -// Write the data to the supplied writable stream 1MM times. -// Be attentive to back-pressure. -function writeOneMillionTimes(writer, data, encoding, callback) { - var i = 1000000; - write(); - function write() { - var ok = true; - do { - i -= 1; - if (i === 0) { - // last time! - writer.write(data, encoding, callback); - } else { - // see if we should continue, or wait - // don't pass the callback, because we're not done yet. - ok = writer.write(data, encoding); - } - } while (i > 0 && ok); - if (i > 0) { - // had to stop early! - // write some more once it drains - writer.once('drain', write); - } - } -} -``` - -#### writable.cork() - -Forces buffering of all writes. - -Buffered data will be flushed either at `.uncork()` or at `.end()` call. - -#### writable.uncork() - -Flush all data, buffered since `.cork()` call. - -#### writable.setDefaultEncoding(encoding) - -* `encoding` {String} The new default encoding - -Sets the default encoding for a writable stream. - -#### writable.end([chunk][, encoding][, callback]) - -* `chunk` {String | Buffer} Optional data to write -* `encoding` {String} The encoding, if `chunk` is a String -* `callback` {Function} Optional callback for when the stream is finished - -Call this method when no more data will be written to the stream. If -supplied, the callback is attached as a listener on the `finish` event. - -Calling [`write()`][] after calling [`end()`][] will raise an error. - -```javascript -// write 'hello, ' and then end with 'world!' -var file = fs.createWriteStream('example.txt'); -file.write('hello, '); -file.end('world!'); -// writing more now is not allowed! -``` - -#### Event: 'finish' - -When the [`end()`][] method has been called, and all data has been flushed -to the underlying system, this event is emitted. - -```javascript -var writer = getWritableStreamSomehow(); -for (var i = 0; i < 100; i ++) { - writer.write('hello, #' + i + '!\n'); -} -writer.end('this is the end\n'); -writer.on('finish', function() { - console.error('all writes are now complete.'); -}); -``` - -#### Event: 'pipe' - -* `src` {[Readable][] Stream} source stream that is piping to this writable - -This is emitted whenever the `pipe()` method is called on a readable -stream, adding this writable to its set of destinations. - -```javascript -var writer = getWritableStreamSomehow(); -var reader = getReadableStreamSomehow(); -writer.on('pipe', function(src) { - console.error('something is piping into the writer'); - assert.equal(src, reader); -}); -reader.pipe(writer); -``` - -#### Event: 'unpipe' - -* `src` {[Readable][] Stream} The source stream that [unpiped][] this writable - -This is emitted whenever the [`unpipe()`][] method is called on a -readable stream, removing this writable from its set of destinations. - -```javascript -var writer = getWritableStreamSomehow(); -var reader = getReadableStreamSomehow(); -writer.on('unpipe', function(src) { - console.error('something has stopped piping into the writer'); - assert.equal(src, reader); -}); -reader.pipe(writer); -reader.unpipe(writer); -``` - -#### Event: 'error' - -* {Error object} - -Emitted if there was an error when writing or piping data. - -### Class: stream.Duplex - -Duplex streams are streams that implement both the [Readable][] and -[Writable][] interfaces. See above for usage. - -Examples of Duplex streams include: - -* [tcp sockets][] -* [zlib streams][] -* [crypto streams][] - - -### Class: stream.Transform - -Transform streams are [Duplex][] streams where the output is in some way -computed from the input. They implement both the [Readable][] and -[Writable][] interfaces. See above for usage. - -Examples of Transform streams include: - -* [zlib streams][] -* [crypto streams][] - - -## API for Stream Implementors - - - -To implement any sort of stream, the pattern is the same: - -1. Extend the appropriate parent class in your own subclass. (The - [`util.inherits`][] method is particularly helpful for this.) -2. Call the appropriate parent class constructor in your constructor, - to be sure that the internal mechanisms are set up properly. -2. Implement one or more specific methods, as detailed below. - -The class to extend and the method(s) to implement depend on the sort -of stream class you are writing: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      -

      Use-case

      -
      -

      Class

      -
      -

      Method(s) to implement

      -
      -

      Reading only

      -
      -

      [Readable](#stream_class_stream_readable_1)

      -
      -

      [_read][]

      -
      -

      Writing only

      -
      -

      [Writable](#stream_class_stream_writable_1)

      -
      -

      [_write][], _writev

      -
      -

      Reading and writing

      -
      -

      [Duplex](#stream_class_stream_duplex_1)

      -
      -

      [_read][], [_write][], _writev

      -
      -

      Operate on written data, then read the result

      -
      -

      [Transform](#stream_class_stream_transform_1)

      -
      -

      _transform, _flush

      -
      - -In your implementation code, it is very important to never call the -methods described in [API for Stream Consumers][] above. Otherwise, you -can potentially cause adverse side effects in programs that consume -your streaming interfaces. - -### Class: stream.Readable - - - -`stream.Readable` is an abstract class designed to be extended with an -underlying implementation of the [`_read(size)`][] method. - -Please see above under [API for Stream Consumers][] for how to consume -streams in your programs. What follows is an explanation of how to -implement Readable streams in your programs. - -#### Example: A Counting Stream - - - -This is a basic example of a Readable stream. It emits the numerals -from 1 to 1,000,000 in ascending order, and then ends. - -```javascript -var Readable = require('stream').Readable; -var util = require('util'); -util.inherits(Counter, Readable); - -function Counter(opt) { - Readable.call(this, opt); - this._max = 1000000; - this._index = 1; -} - -Counter.prototype._read = function() { - var i = this._index++; - if (i > this._max) - this.push(null); - else { - var str = '' + i; - var buf = new Buffer(str, 'ascii'); - this.push(buf); - } -}; -``` - -#### Example: SimpleProtocol v1 (Sub-optimal) - -This is similar to the `parseHeader` function described above, but -implemented as a custom stream. Also, note that this implementation -does not convert the incoming data to a string. - -However, this would be better implemented as a [Transform][] stream. See -below for a better implementation. - -```javascript -// A parser for a simple data protocol. -// The "header" is a JSON object, followed by 2 \n characters, and -// then a message body. -// -// NOTE: This can be done more simply as a Transform stream! -// Using Readable directly for this is sub-optimal. See the -// alternative example below under the Transform section. - -var Readable = require('stream').Readable; -var util = require('util'); - -util.inherits(SimpleProtocol, Readable); - -function SimpleProtocol(source, options) { - if (!(this instanceof SimpleProtocol)) - return new SimpleProtocol(source, options); - - Readable.call(this, options); - this._inBody = false; - this._sawFirstCr = false; - - // source is a readable stream, such as a socket or file - this._source = source; - - var self = this; - source.on('end', function() { - self.push(null); - }); - - // give it a kick whenever the source is readable - // read(0) will not consume any bytes - source.on('readable', function() { - self.read(0); - }); - - this._rawHeader = []; - this.header = null; -} - -SimpleProtocol.prototype._read = function(n) { - if (!this._inBody) { - var chunk = this._source.read(); - - // if the source doesn't have data, we don't have data yet. - if (chunk === null) - return this.push(''); - - // check if the chunk has a \n\n - var split = -1; - for (var i = 0; i < chunk.length; i++) { - if (chunk[i] === 10) { // '\n' - if (this._sawFirstCr) { - split = i; - break; - } else { - this._sawFirstCr = true; - } - } else { - this._sawFirstCr = false; - } - } - - if (split === -1) { - // still waiting for the \n\n - // stash the chunk, and try again. - this._rawHeader.push(chunk); - this.push(''); - } else { - this._inBody = true; - var h = chunk.slice(0, split); - this._rawHeader.push(h); - var header = Buffer.concat(this._rawHeader).toString(); - try { - this.header = JSON.parse(header); - } catch (er) { - this.emit('error', new Error('invalid simple protocol data')); - return; - } - // now, because we got some extra data, unshift the rest - // back into the read queue so that our consumer will see it. - var b = chunk.slice(split); - this.unshift(b); - - // and let them know that we are done parsing the header. - this.emit('header', this.header); - } - } else { - // from there on, just provide the data to our consumer. - // careful not to push(null), since that would indicate EOF. - var chunk = this._source.read(); - if (chunk) this.push(chunk); - } -}; - -// Usage: -// var parser = new SimpleProtocol(source); -// Now parser is a readable stream that will emit 'header' -// with the parsed header data. -``` - - -#### new stream.Readable([options]) - -* `options` {Object} - * `highWaterMark` {Number} The maximum number of bytes to store in - the internal buffer before ceasing to read from the underlying - resource. Default=16kb, or 16 for `objectMode` streams - * `encoding` {String} If specified, then buffers will be decoded to - strings using the specified encoding. Default=null - * `objectMode` {Boolean} Whether this stream should behave - as a stream of objects. Meaning that stream.read(n) returns - a single value instead of a Buffer of size n. Default=false - -In classes that extend the Readable class, make sure to call the -Readable constructor so that the buffering settings can be properly -initialized. - -#### readable.\_read(size) - -* `size` {Number} Number of bytes to read asynchronously - -Note: **Implement this function, but do NOT call it directly.** - -This function should NOT be called directly. It should be implemented -by child classes, and only called by the internal Readable class -methods. - -All Readable stream implementations must provide a `_read` method to -fetch data from the underlying resource. - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -When data is available, put it into the read queue by calling -`readable.push(chunk)`. If `push` returns false, then you should stop -reading. When `_read` is called again, you should start pushing more -data. - -The `size` argument is advisory. Implementations where a "read" is a -single call that returns data can use this to know how much data to -fetch. Implementations where that is not relevant, such as TCP or -TLS, may ignore this argument, and simply provide data whenever it -becomes available. There is no need, for example to "wait" until -`size` bytes are available before calling [`stream.push(chunk)`][]. - -#### readable.push(chunk[, encoding]) - -* `chunk` {Buffer | null | String} Chunk of data to push into the read queue -* `encoding` {String} Encoding of String chunks. Must be a valid - Buffer encoding, such as `'utf8'` or `'ascii'` -* return {Boolean} Whether or not more pushes should be performed - -Note: **This function should be called by Readable implementors, NOT -by consumers of Readable streams.** - -The `_read()` function will not be called again until at least one -`push(chunk)` call is made. - -The `Readable` class works by putting data into a read queue to be -pulled out later by calling the `read()` method when the `'readable'` -event fires. - -The `push()` method will explicitly insert some data into the read -queue. If it is called with `null` then it will signal the end of the -data (EOF). - -This API is designed to be as flexible as possible. For example, -you may be wrapping a lower-level source which has some sort of -pause/resume mechanism, and a data callback. In those cases, you -could wrap the low-level source object by doing something like this: - -```javascript -// source is an object with readStop() and readStart() methods, -// and an `ondata` member that gets called when it has data, and -// an `onend` member that gets called when the data is over. - -util.inherits(SourceWrapper, Readable); - -function SourceWrapper(options) { - Readable.call(this, options); - - this._source = getLowlevelSourceObject(); - var self = this; - - // Every time there's data, we push it into the internal buffer. - this._source.ondata = function(chunk) { - // if push() returns false, then we need to stop reading from source - if (!self.push(chunk)) - self._source.readStop(); - }; - - // When the source ends, we push the EOF-signaling `null` chunk - this._source.onend = function() { - self.push(null); - }; -} - -// _read will be called when the stream wants to pull more data in -// the advisory size argument is ignored in this case. -SourceWrapper.prototype._read = function(size) { - this._source.readStart(); -}; -``` - - -### Class: stream.Writable - - - -`stream.Writable` is an abstract class designed to be extended with an -underlying implementation of the [`_write(chunk, encoding, callback)`][] method. - -Please see above under [API for Stream Consumers][] for how to consume -writable streams in your programs. What follows is an explanation of -how to implement Writable streams in your programs. - -#### new stream.Writable([options]) - -* `options` {Object} - * `highWaterMark` {Number} Buffer level when [`write()`][] starts - returning false. Default=16kb, or 16 for `objectMode` streams - * `decodeStrings` {Boolean} Whether or not to decode strings into - Buffers before passing them to [`_write()`][]. Default=true - * `objectMode` {Boolean} Whether or not the `write(anyObj)` is - a valid operation. If set you can write arbitrary data instead - of only `Buffer` / `String` data. Default=false - -In classes that extend the Writable class, make sure to call the -constructor so that the buffering settings can be properly -initialized. - -#### writable.\_write(chunk, encoding, callback) - -* `chunk` {Buffer | String} The chunk to be written. Will **always** - be a buffer unless the `decodeStrings` option was set to `false`. -* `encoding` {String} If the chunk is a string, then this is the - encoding type. If chunk is a buffer, then this is the special - value - 'buffer', ignore it in this case. -* `callback` {Function} Call this function (optionally with an error - argument) when you are done processing the supplied chunk. - -All Writable stream implementations must provide a [`_write()`][] -method to send data to the underlying resource. - -Note: **This function MUST NOT be called directly.** It should be -implemented by child classes, and called by the internal Writable -class methods only. - -Call the callback using the standard `callback(error)` pattern to -signal that the write completed successfully or with an error. - -If the `decodeStrings` flag is set in the constructor options, then -`chunk` may be a string rather than a Buffer, and `encoding` will -indicate the sort of string that it is. This is to support -implementations that have an optimized handling for certain string -data encodings. If you do not explicitly set the `decodeStrings` -option to `false`, then you can safely ignore the `encoding` argument, -and assume that `chunk` will always be a Buffer. - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -#### writable.\_writev(chunks, callback) - -* `chunks` {Array} The chunks to be written. Each chunk has following - format: `{ chunk: ..., encoding: ... }`. -* `callback` {Function} Call this function (optionally with an error - argument) when you are done processing the supplied chunks. - -Note: **This function MUST NOT be called directly.** It may be -implemented by child classes, and called by the internal Writable -class methods only. - -This function is completely optional to implement. In most cases it is -unnecessary. If implemented, it will be called with all the chunks -that are buffered in the write queue. - - -### Class: stream.Duplex - - - -A "duplex" stream is one that is both Readable and Writable, such as a -TCP socket connection. - -Note that `stream.Duplex` is an abstract class designed to be extended -with an underlying implementation of the `_read(size)` and -[`_write(chunk, encoding, callback)`][] methods as you would with a -Readable or Writable stream class. - -Since JavaScript doesn't have multiple prototypal inheritance, this -class prototypally inherits from Readable, and then parasitically from -Writable. It is thus up to the user to implement both the lowlevel -`_read(n)` method as well as the lowlevel -[`_write(chunk, encoding, callback)`][] method on extension duplex classes. - -#### new stream.Duplex(options) - -* `options` {Object} Passed to both Writable and Readable - constructors. Also has the following fields: - * `allowHalfOpen` {Boolean} Default=true. If set to `false`, then - the stream will automatically end the readable side when the - writable side ends and vice versa. - * `readableObjectMode` {Boolean} Default=false. Sets `objectMode` - for readable side of the stream. Has no effect if `objectMode` - is `true`. - * `writableObjectMode` {Boolean} Default=false. Sets `objectMode` - for writable side of the stream. Has no effect if `objectMode` - is `true`. - -In classes that extend the Duplex class, make sure to call the -constructor so that the buffering settings can be properly -initialized. - - -### Class: stream.Transform - -A "transform" stream is a duplex stream where the output is causally -connected in some way to the input, such as a [zlib][] stream or a -[crypto][] stream. - -There is no requirement that the output be the same size as the input, -the same number of chunks, or arrive at the same time. For example, a -Hash stream will only ever have a single chunk of output which is -provided when the input is ended. A zlib stream will produce output -that is either much smaller or much larger than its input. - -Rather than implement the [`_read()`][] and [`_write()`][] methods, Transform -classes must implement the `_transform()` method, and may optionally -also implement the `_flush()` method. (See below.) - -#### new stream.Transform([options]) - -* `options` {Object} Passed to both Writable and Readable - constructors. - -In classes that extend the Transform class, make sure to call the -constructor so that the buffering settings can be properly -initialized. - -#### transform.\_transform(chunk, encoding, callback) - -* `chunk` {Buffer | String} The chunk to be transformed. Will **always** - be a buffer unless the `decodeStrings` option was set to `false`. -* `encoding` {String} If the chunk is a string, then this is the - encoding type. If chunk is a buffer, then this is the special - value - 'buffer', ignore it in this case. -* `callback` {Function} Call this function (optionally with an error - argument and data) when you are done processing the supplied chunk. - -Note: **This function MUST NOT be called directly.** It should be -implemented by child classes, and called by the internal Transform -class methods only. - -All Transform stream implementations must provide a `_transform` -method to accept input and produce output. - -`_transform` should do whatever has to be done in this specific -Transform class, to handle the bytes being written, and pass them off -to the readable portion of the interface. Do asynchronous I/O, -process things, and so on. - -Call `transform.push(outputChunk)` 0 or more times to generate output -from this input chunk, depending on how much data you want to output -as a result of this chunk. - -Call the callback function only when the current chunk is completely -consumed. Note that there may or may not be output as a result of any -particular input chunk. If you supply output as the second argument to the -callback, it will be passed to push method, in other words the following are -equivalent: - -```javascript -transform.prototype._transform = function (data, encoding, callback) { - this.push(data); - callback(); -} - -transform.prototype._transform = function (data, encoding, callback) { - callback(null, data); -} -``` - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -#### transform.\_flush(callback) - -* `callback` {Function} Call this function (optionally with an error - argument) when you are done flushing any remaining data. - -Note: **This function MUST NOT be called directly.** It MAY be implemented -by child classes, and if so, will be called by the internal Transform -class methods only. - -In some cases, your transform operation may need to emit a bit more -data at the end of the stream. For example, a `Zlib` compression -stream will store up some internal state so that it can optimally -compress the output. At the end, however, it needs to do the best it -can with what is left, so that the data will be complete. - -In those cases, you can implement a `_flush` method, which will be -called at the very end, after all the written data is consumed, but -before emitting `end` to signal the end of the readable side. Just -like with `_transform`, call `transform.push(chunk)` zero or more -times, as appropriate, and call `callback` when the flush operation is -complete. - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -#### Events: 'finish' and 'end' - -The [`finish`][] and [`end`][] events are from the parent Writable -and Readable classes respectively. The `finish` event is fired after -`.end()` is called and all chunks have been processed by `_transform`, -`end` is fired after all data has been output which is after the callback -in `_flush` has been called. - -#### Example: `SimpleProtocol` parser v2 - -The example above of a simple protocol parser can be implemented -simply by using the higher level [Transform][] stream class, similar to -the `parseHeader` and `SimpleProtocol v1` examples above. - -In this example, rather than providing the input as an argument, it -would be piped into the parser, which is a more idiomatic io.js stream -approach. - -```javascript -var util = require('util'); -var Transform = require('stream').Transform; -util.inherits(SimpleProtocol, Transform); - -function SimpleProtocol(options) { - if (!(this instanceof SimpleProtocol)) - return new SimpleProtocol(options); - - Transform.call(this, options); - this._inBody = false; - this._sawFirstCr = false; - this._rawHeader = []; - this.header = null; -} - -SimpleProtocol.prototype._transform = function(chunk, encoding, done) { - if (!this._inBody) { - // check if the chunk has a \n\n - var split = -1; - for (var i = 0; i < chunk.length; i++) { - if (chunk[i] === 10) { // '\n' - if (this._sawFirstCr) { - split = i; - break; - } else { - this._sawFirstCr = true; - } - } else { - this._sawFirstCr = false; - } - } - - if (split === -1) { - // still waiting for the \n\n - // stash the chunk, and try again. - this._rawHeader.push(chunk); - } else { - this._inBody = true; - var h = chunk.slice(0, split); - this._rawHeader.push(h); - var header = Buffer.concat(this._rawHeader).toString(); - try { - this.header = JSON.parse(header); - } catch (er) { - this.emit('error', new Error('invalid simple protocol data')); - return; - } - // and let them know that we are done parsing the header. - this.emit('header', this.header); - - // now, because we got some extra data, emit this first. - this.push(chunk.slice(split)); - } - } else { - // from there on, just provide the data to our consumer as-is. - this.push(chunk); - } - done(); -}; - -// Usage: -// var parser = new SimpleProtocol(); -// source.pipe(parser) -// Now parser is a readable stream that will emit 'header' -// with the parsed header data. -``` - - -### Class: stream.PassThrough - -This is a trivial implementation of a [Transform][] stream that simply -passes the input bytes across to the output. Its purpose is mainly -for examples and testing, but there are occasionally use cases where -it can come in handy as a building block for novel sorts of streams. - - -## Simplified Constructor API - - - -In simple cases there is now the added benefit of being able to construct a stream without inheritance. - -This can be done by passing the appropriate methods as constructor options: - -Examples: - -### Readable -```javascript -var readable = new stream.Readable({ - read: function(n) { - // sets this._read under the hood - } -}); -``` - -### Writable -```javascript -var writable = new stream.Writable({ - write: function(chunk, encoding, next) { - // sets this._write under the hood - } -}); - -// or - -var writable = new stream.Writable({ - writev: function(chunks, next) { - // sets this._writev under the hood - } -}); -``` - -### Duplex -```javascript -var duplex = new stream.Duplex({ - read: function(n) { - // sets this._read under the hood - }, - write: function(chunk, encoding, next) { - // sets this._write under the hood - } -}); - -// or - -var duplex = new stream.Duplex({ - read: function(n) { - // sets this._read under the hood - }, - writev: function(chunks, next) { - // sets this._writev under the hood - } -}); -``` - -### Transform -```javascript -var transform = new stream.Transform({ - transform: function(chunk, encoding, next) { - // sets this._transform under the hood - }, - flush: function(done) { - // sets this._flush under the hood - } -}); -``` - -## Streams: Under the Hood - - - -### Buffering - - - -Both Writable and Readable streams will buffer data on an internal -object called `_writableState.buffer` or `_readableState.buffer`, -respectively. - -The amount of data that will potentially be buffered depends on the -`highWaterMark` option which is passed into the constructor. - -Buffering in Readable streams happens when the implementation calls -[`stream.push(chunk)`][]. If the consumer of the Stream does not call -`stream.read()`, then the data will sit in the internal queue until it -is consumed. - -Buffering in Writable streams happens when the user calls -[`stream.write(chunk)`][] repeatedly, even when `write()` returns `false`. - -The purpose of streams, especially with the `pipe()` method, is to -limit the buffering of data to acceptable levels, so that sources and -destinations of varying speed will not overwhelm the available memory. - -### `stream.read(0)` - -There are some cases where you want to trigger a refresh of the -underlying readable stream mechanisms, without actually consuming any -data. In that case, you can call `stream.read(0)`, which will always -return null. - -If the internal read buffer is below the `highWaterMark`, and the -stream is not currently reading, then calling `read(0)` will trigger -a low-level `_read` call. - -There is almost never a need to do this. However, you will see some -cases in io.js's internals where this is done, particularly in the -Readable stream class internals. - -### `stream.push('')` - -Pushing a zero-byte string or Buffer (when not in [Object mode][]) has an -interesting side effect. Because it *is* a call to -[`stream.push()`][], it will end the `reading` process. However, it -does *not* add any data to the readable buffer, so there's nothing for -a user to consume. - -Very rarely, there are cases where you have no data to provide now, -but the consumer of your stream (or, perhaps, another bit of your own -code) will know when to check again, by calling `stream.read(0)`. In -those cases, you *may* call `stream.push('')`. - -So far, the only use case for this functionality is in the -[tls.CryptoStream][] class, which is deprecated in io.js v1.0. If you -find that you have to use `stream.push('')`, please consider another -approach, because it almost certainly indicates that something is -horribly wrong. - -### Compatibility with Older Node.js Versions - - - -In versions of Node.js prior to v0.10, the Readable stream interface was -simpler, but also less powerful and less useful. - -* Rather than waiting for you to call the `read()` method, `'data'` - events would start emitting immediately. If you needed to do some - I/O to decide how to handle data, then you had to store the chunks - in some kind of buffer so that they would not be lost. -* The [`pause()`][] method was advisory, rather than guaranteed. This - meant that you still had to be prepared to receive `'data'` events - even when the stream was in a paused state. - -In io.js v1.0 and Node.js v0.10, the Readable class described below was added. -For backwards compatibility with older Node.js programs, Readable streams -switch into "flowing mode" when a `'data'` event handler is added, or -when the [`resume()`][] method is called. The effect is that, even if -you are not using the new `read()` method and `'readable'` event, you -no longer have to worry about losing `'data'` chunks. - -Most programs will continue to function normally. However, this -introduces an edge case in the following conditions: - -* No [`'data'` event][] handler is added. -* The [`resume()`][] method is never called. -* The stream is not piped to any writable destination. - -For example, consider the following code: - -```javascript -// WARNING! BROKEN! -net.createServer(function(socket) { - - // we add an 'end' method, but never consume the data - socket.on('end', function() { - // It will never get here. - socket.end('I got your message (but didnt read it)\n'); - }); - -}).listen(1337); -``` - -In versions of Node.js prior to v0.10, the incoming message data would be -simply discarded. However, in io.js v1.0 and Node.js v0.10 and beyond, -the socket will remain paused forever. - -The workaround in this situation is to call the `resume()` method to -start the flow of data: - -```javascript -// Workaround -net.createServer(function(socket) { - - socket.on('end', function() { - socket.end('I got your message (but didnt read it)\n'); - }); - - // start the flow of data, discarding it. - socket.resume(); - -}).listen(1337); -``` - -In addition to new Readable streams switching into flowing mode, -pre-v0.10 style streams can be wrapped in a Readable class using the -`wrap()` method. - - -### Object Mode - - - -Normally, Streams operate on Strings and Buffers exclusively. - -Streams that are in **object mode** can emit generic JavaScript values -other than Buffers and Strings. - -A Readable stream in object mode will always return a single item from -a call to `stream.read(size)`, regardless of what the size argument -is. - -A Writable stream in object mode will always ignore the `encoding` -argument to `stream.write(data, encoding)`. - -The special value `null` still retains its special value for object -mode streams. That is, for object mode readable streams, `null` as a -return value from `stream.read()` indicates that there is no more -data, and [`stream.push(null)`][] will signal the end of stream data -(`EOF`). - -No streams in io.js core are object mode streams. This pattern is only -used by userland streaming libraries. - -You should set `objectMode` in your stream child class constructor on -the options object. Setting `objectMode` mid-stream is not safe. - -For Duplex streams `objectMode` can be set exclusively for readable or -writable side with `readableObjectMode` and `writableObjectMode` -respectively. These options can be used to implement parsers and -serializers with Transform streams. - -```javascript -var util = require('util'); -var StringDecoder = require('string_decoder').StringDecoder; -var Transform = require('stream').Transform; -util.inherits(JSONParseStream, Transform); - -// Gets \n-delimited JSON string data, and emits the parsed objects -function JSONParseStream() { - if (!(this instanceof JSONParseStream)) - return new JSONParseStream(); - - Transform.call(this, { readableObjectMode : true }); - - this._buffer = ''; - this._decoder = new StringDecoder('utf8'); -} - -JSONParseStream.prototype._transform = function(chunk, encoding, cb) { - this._buffer += this._decoder.write(chunk); - // split on newlines - var lines = this._buffer.split(/\r?\n/); - // keep the last partial line buffered - this._buffer = lines.pop(); - for (var l = 0; l < lines.length; l++) { - var line = lines[l]; - try { - var obj = JSON.parse(line); - } catch (er) { - this.emit('error', er); - return; - } - // push the parsed object out to the readable consumer - this.push(obj); - } - cb(); -}; - -JSONParseStream.prototype._flush = function(cb) { - // Just handle any leftover - var rem = this._buffer.trim(); - if (rem) { - try { - var obj = JSON.parse(rem); - } catch (er) { - this.emit('error', er); - return; - } - // push the parsed object out to the readable consumer - this.push(obj); - } - cb(); -}; -``` - - -[EventEmitter]: https://iojs.org/dist/v2.3.0/doc/api/events.html#events_class_events_eventemitter -[Object mode]: #stream_object_mode -[`stream.push(chunk)`]: #stream_readable_push_chunk_encoding -[`stream.push(null)`]: #stream_readable_push_chunk_encoding -[`stream.push()`]: #stream_readable_push_chunk_encoding -[`unpipe()`]: #stream_readable_unpipe_destination -[unpiped]: #stream_readable_unpipe_destination -[tcp sockets]: https://iojs.org/dist/v2.3.0/doc/api/net.html#net_class_net_socket -[zlib streams]: zlib.html -[zlib]: zlib.html -[crypto streams]: crypto.html -[crypto]: crypto.html -[tls.CryptoStream]: https://iojs.org/dist/v2.3.0/doc/api/tls.html#tls_class_cryptostream -[process.stdin]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stdin -[stdout]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stdout -[process.stdout]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stdout -[process.stderr]: https://iojs.org/dist/v2.3.0/doc/api/process.html#process_process_stderr -[child process stdout and stderr]: https://iojs.org/dist/v2.3.0/doc/api/child_process.html#child_process_child_stdout -[API for Stream Consumers]: #stream_api_for_stream_consumers -[API for Stream Implementors]: #stream_api_for_stream_implementors -[Readable]: #stream_class_stream_readable -[Writable]: #stream_class_stream_writable -[Duplex]: #stream_class_stream_duplex -[Transform]: #stream_class_stream_transform -[`end`]: #stream_event_end -[`finish`]: #stream_event_finish -[`_read(size)`]: #stream_readable_read_size_1 -[`_read()`]: #stream_readable_read_size_1 -[_read]: #stream_readable_read_size_1 -[`writable.write(chunk)`]: #stream_writable_write_chunk_encoding_callback -[`write(chunk, encoding, callback)`]: #stream_writable_write_chunk_encoding_callback -[`write()`]: #stream_writable_write_chunk_encoding_callback -[`stream.write(chunk)`]: #stream_writable_write_chunk_encoding_callback -[`_write(chunk, encoding, callback)`]: #stream_writable_write_chunk_encoding_callback_1 -[`_write()`]: #stream_writable_write_chunk_encoding_callback_1 -[_write]: #stream_writable_write_chunk_encoding_callback_1 -[`util.inherits`]: https://iojs.org/dist/v2.3.0/doc/api/util.html#util_util_inherits_constructor_superconstructor -[`end()`]: #stream_writable_end_chunk_encoding_callback -[`'data'` event]: #stream_event_data -[`resume()`]: #stream_readable_resume -[`readable.resume()`]: #stream_readable_resume -[`pause()`]: #stream_readable_pause -[`unpipe()`]: #stream_readable_unpipe_destination -[`pipe()`]: #stream_readable_pipe_destination_options diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md deleted file mode 100644 index 83275f192e4077..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +++ /dev/null @@ -1,60 +0,0 @@ -# streams WG Meeting 2015-01-30 - -## Links - -* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg -* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 -* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ - -## Agenda - -Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. - -* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) -* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) -* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) -* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) - -## Minutes - -### adopt a charter - -* group: +1's all around - -### What versioning scheme should be adopted? -* group: +1’s 3.0.0 -* domenic+group: pulling in patches from other sources where appropriate -* mikeal: version independently, suggesting versions for io.js -* mikeal+domenic: work with TC to notify in advance of changes -simpler stream creation - -### streamline creation of streams -* sam: streamline creation of streams -* domenic: nice simple solution posted - but, we lose the opportunity to change the model - may not be backwards incompatible (double check keys) - - **action item:** domenic will check - -### remove implicit flowing of streams on(‘data’) -* add isFlowing / isPaused -* mikeal: worrying that we’re documenting polyfill methods – confuses users -* domenic: more reflective API is probably good, with warning labels for users -* new section for mad scientists (reflective stream access) -* calvin: name the “third state” -* mikeal: maybe borrow the name from whatwg? -* domenic: we’re missing the “third state” -* consensus: kind of difficult to name the third state -* mikeal: figure out differences in states / compat -* mathias: always flow on data – eliminates third state - * explore what it breaks - -**action items:** -* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) -* ask rod/build for infrastructure -* **chris**: explore the “flow on data” approach -* add isPaused/isFlowing -* add new docs section -* move isPaused to that section - - diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/duplex.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/duplex.js deleted file mode 100644 index ca807af87620dd..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/duplex.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_duplex.js") diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js deleted file mode 100644 index 69558af037cd66..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js +++ /dev/null @@ -1,82 +0,0 @@ -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - -'use strict'; - -/**/ -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) keys.push(key); - return keys; -} -/**/ - - -module.exports = Duplex; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - - - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var Readable = require('./_stream_readable'); -var Writable = require('./_stream_writable'); - -util.inherits(Duplex, Readable); - -var keys = objectKeys(Writable.prototype); -for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) - Duplex.prototype[method] = Writable.prototype[method]; -} - -function Duplex(options) { - if (!(this instanceof Duplex)) - return new Duplex(options); - - Readable.call(this, options); - Writable.call(this, options); - - if (options && options.readable === false) - this.readable = false; - - if (options && options.writable === false) - this.writable = false; - - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) - this.allowHalfOpen = false; - - this.once('end', onend); -} - -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) - return; - - // no more data can be written. - // But allow more writes to happen in this tick. - processNextTick(onEndNT, this); -} - -function onEndNT(self) { - self.end(); -} - -function forEach (xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js deleted file mode 100644 index bddfdd01537a40..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js +++ /dev/null @@ -1,27 +0,0 @@ -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. - -'use strict'; - -module.exports = PassThrough; - -var Transform = require('./_stream_transform'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) - return new PassThrough(options); - - Transform.call(this, options); -} - -PassThrough.prototype._transform = function(chunk, encoding, cb) { - cb(null, chunk); -}; diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js deleted file mode 100644 index 8070e03d8efaf5..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js +++ /dev/null @@ -1,956 +0,0 @@ -'use strict'; - -module.exports = Readable; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - - -/**/ -var isArray = require('isarray'); -/**/ - - -/**/ -var Buffer = require('buffer').Buffer; -/**/ - -Readable.ReadableState = ReadableState; - -var EE = require('events').EventEmitter; - -/**/ -if (!EE.listenerCount) EE.listenerCount = function(emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - - - -/**/ -var Stream; - (function (){try{ -Stream = require('st' + 'ream'); -}catch(_){Stream = require('events').EventEmitter;}}()) -/**/ - -var Buffer = require('buffer').Buffer; - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - - - -/**/ -var debug = require('util'); -if (debug && debug.debuglog) { - debug = debug.debuglog('stream'); -} else { - debug = function () {}; -} -/**/ - -var StringDecoder; - -util.inherits(Readable, Stream); - -function ReadableState(options, stream) { - var Duplex = require('./_stream_duplex'); - - options = options || {}; - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - - if (stream instanceof Duplex) - this.objectMode = this.objectMode || !!options.readableObjectMode; - - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; - - // cast to ints. - this.highWaterMark = ~~this.highWaterMark; - - this.buffer = []; - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // when piping, we only care about 'readable' events that happen - // after read()ing all the bytes and not getting any pushback. - this.ranOut = false; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) - StringDecoder = require('string_decoder/').StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} - -function Readable(options) { - var Duplex = require('./_stream_duplex'); - - if (!(this instanceof Readable)) - return new Readable(options); - - this._readableState = new ReadableState(options, this); - - // legacy - this.readable = true; - - if (options && typeof options.read === 'function') - this._read = options.read; - - Stream.call(this); -} - -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function(chunk, encoding) { - var state = this._readableState; - - if (!state.objectMode && typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = new Buffer(chunk, encoding); - encoding = ''; - } - } - - return readableAddChunk(this, state, chunk, encoding, false); -}; - -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function(chunk) { - var state = this._readableState; - return readableAddChunk(this, state, chunk, '', true); -}; - -Readable.prototype.isPaused = function() { - return this._readableState.flowing === false; -}; - -function readableAddChunk(stream, state, chunk, encoding, addToFront) { - var er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (state.ended && !addToFront) { - var e = new Error('stream.push() after EOF'); - stream.emit('error', e); - } else if (state.endEmitted && addToFront) { - var e = new Error('stream.unshift() after end event'); - stream.emit('error', e); - } else { - if (state.decoder && !addToFront && !encoding) - chunk = state.decoder.write(chunk); - - if (!addToFront) - state.reading = false; - - // if we want the data now, just emit it. - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) - state.buffer.unshift(chunk); - else - state.buffer.push(chunk); - - if (state.needReadable) - emitReadable(stream); - } - - maybeReadMore(stream, state); - } - } else if (!addToFront) { - state.reading = false; - } - - return needMoreData(state); -} - - - -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && - (state.needReadable || - state.length < state.highWaterMark || - state.length === 0); -} - -// backwards compatibility. -Readable.prototype.setEncoding = function(enc) { - if (!StringDecoder) - StringDecoder = require('string_decoder/').StringDecoder; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; -}; - -// Don't raise the hwm > 128MB -var MAX_HWM = 0x800000; -function roundUpToNextPowerOf2(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 - n--; - for (var p = 1; p < 32; p <<= 1) n |= n >> p; - n++; - } - return n; -} - -function howMuchToRead(n, state) { - if (state.length === 0 && state.ended) - return 0; - - if (state.objectMode) - return n === 0 ? 0 : 1; - - if (n === null || isNaN(n)) { - // only flow one buffer at a time - if (state.flowing && state.buffer.length) - return state.buffer[0].length; - else - return state.length; - } - - if (n <= 0) - return 0; - - // If we're asking for more than the target buffer level, - // then raise the water mark. Bump up to the next highest - // power of 2, to prevent increasing it excessively in tiny - // amounts. - if (n > state.highWaterMark) - state.highWaterMark = roundUpToNextPowerOf2(n); - - // don't have that much. return null, unless we've ended. - if (n > state.length) { - if (!state.ended) { - state.needReadable = true; - return 0; - } else { - return state.length; - } - } - - return n; -} - -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function(n) { - debug('read', n); - var state = this._readableState; - var nOrig = n; - - if (typeof n !== 'number' || n > 0) - state.emittedReadable = false; - - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && - state.needReadable && - (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) - endReadable(this); - else - emitReadable(this); - return null; - } - - n = howMuchToRead(n, state); - - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) - endReadable(this); - return null; - } - - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); - - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } - - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } - - if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) - state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - } - - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (doRead && !state.reading) - n = howMuchToRead(nOrig, state); - - var ret; - if (n > 0) - ret = fromList(n, state); - else - ret = null; - - if (ret === null) { - state.needReadable = true; - n = 0; - } - - state.length -= n; - - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (state.length === 0 && !state.ended) - state.needReadable = true; - - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended && state.length === 0) - endReadable(this); - - if (ret !== null) - this.emit('data', ret); - - return ret; -}; - -function chunkInvalid(state, chunk) { - var er = null; - if (!(Buffer.isBuffer(chunk)) && - typeof chunk !== 'string' && - chunk !== null && - chunk !== undefined && - !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} - - -function onEofChunk(stream, state) { - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); -} - -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) - processNextTick(emitReadable_, stream); - else - emitReadable_(stream); - } -} - -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); -} - - -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - processNextTick(maybeReadMore_, stream, state); - } -} - -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && - state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break; - else - len = state.length; - } - state.readingMore = false; -} - -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function(n) { - this.emit('error', new Error('not implemented')); -}; - -Readable.prototype.pipe = function(dest, pipeOpts) { - var src = this; - var state = this._readableState; - - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - - var doEnd = (!pipeOpts || pipeOpts.end !== false) && - dest !== process.stdout && - dest !== process.stderr; - - var endFn = doEnd ? onend : cleanup; - if (state.endEmitted) - processNextTick(endFn); - else - src.once('end', endFn); - - dest.on('unpipe', onunpipe); - function onunpipe(readable) { - debug('onunpipe'); - if (readable === src) { - cleanup(); - } - } - - function onend() { - debug('onend'); - dest.end(); - } - - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', cleanup); - src.removeListener('data', ondata); - - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && - (!dest._writableState || dest._writableState.needDrain)) - ondrain(); - } - - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - var ret = dest.write(chunk); - if (false === ret) { - debug('false write response, pause', - src._readableState.awaitDrain); - src._readableState.awaitDrain++; - src.pause(); - } - } - - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EE.listenerCount(dest, 'error') === 0) - dest.emit('error', er); - } - // This is a brutally ugly hack to make sure that our error handler - // is attached before any userland ones. NEVER DO THIS. - if (!dest._events || !dest._events.error) - dest.on('error', onerror); - else if (isArray(dest._events.error)) - dest._events.error.unshift(onerror); - else - dest._events.error = [onerror, dest._events.error]; - - - - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); - - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } - - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } - - return dest; -}; - -function pipeOnDrain(src) { - return function() { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) - state.awaitDrain--; - if (state.awaitDrain === 0 && EE.listenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; -} - - -Readable.prototype.unpipe = function(dest) { - var state = this._readableState; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) - return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) - return this; - - if (!dest) - dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) - dest.emit('unpipe', this); - return this; - } - - // slow case. multiple pipe destinations. - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - - for (var i = 0; i < len; i++) - dests[i].emit('unpipe', this); - return this; - } - - // try to find the right one. - var i = indexOf(state.pipes, dest); - if (i === -1) - return this; - - state.pipes.splice(i, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) - state.pipes = state.pipes[0]; - - dest.emit('unpipe', this); - - return this; -}; - -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function(ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - - // If listening to data, and it has not explicitly been paused, - // then call resume to start the flow of data on the next tick. - if (ev === 'data' && false !== this._readableState.flowing) { - this.resume(); - } - - if (ev === 'readable' && this.readable) { - var state = this._readableState; - if (!state.readableListening) { - state.readableListening = true; - state.emittedReadable = false; - state.needReadable = true; - if (!state.reading) { - processNextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this, state); - } - } - } - - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; - -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} - -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function() { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - resume(this, state); - } - return this; -}; - -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - processNextTick(resume_, stream, state); - } -} - -function resume_(stream, state) { - if (!state.reading) { - debug('resume read 0'); - stream.read(0); - } - - state.resumeScheduled = false; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) - stream.read(0); -} - -Readable.prototype.pause = function() { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - return this; -}; - -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - if (state.flowing) { - do { - var chunk = stream.read(); - } while (null !== chunk && state.flowing); - } -} - -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function(stream) { - var state = this._readableState; - var paused = false; - - var self = this; - stream.on('end', function() { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) - self.push(chunk); - } - - self.push(null); - }); - - stream.on('data', function(chunk) { - debug('wrapped data'); - if (state.decoder) - chunk = state.decoder.write(chunk); - - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) - return; - else if (!state.objectMode && (!chunk || !chunk.length)) - return; - - var ret = self.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); - - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function(method) { return function() { - return stream[method].apply(stream, arguments); - }; }(i); - } - } - - // proxy certain important events. - var events = ['error', 'close', 'destroy', 'pause', 'resume']; - forEach(events, function(ev) { - stream.on(ev, self.emit.bind(self, ev)); - }); - - // when we try to consume some more bytes, simply unpause the - // underlying stream. - self._read = function(n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); - } - }; - - return self; -}; - - - -// exposed for testing purposes only. -Readable._fromList = fromList; - -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -function fromList(n, state) { - var list = state.buffer; - var length = state.length; - var stringMode = !!state.decoder; - var objectMode = !!state.objectMode; - var ret; - - // nothing in the list, definitely empty. - if (list.length === 0) - return null; - - if (length === 0) - ret = null; - else if (objectMode) - ret = list.shift(); - else if (!n || n >= length) { - // read it all, truncate the array. - if (stringMode) - ret = list.join(''); - else - ret = Buffer.concat(list, length); - list.length = 0; - } else { - // read just some of it. - if (n < list[0].length) { - // just take a part of the first list item. - // slice is the same for buffers and strings. - var buf = list[0]; - ret = buf.slice(0, n); - list[0] = buf.slice(n); - } else if (n === list[0].length) { - // first list is a perfect match - ret = list.shift(); - } else { - // complex case. - // we have enough to cover it, but it spans past the first buffer. - if (stringMode) - ret = ''; - else - ret = new Buffer(n); - - var c = 0; - for (var i = 0, l = list.length; i < l && c < n; i++) { - var buf = list[0]; - var cpy = Math.min(n - c, buf.length); - - if (stringMode) - ret += buf.slice(0, cpy); - else - buf.copy(ret, c, 0, cpy); - - if (cpy < buf.length) - list[0] = buf.slice(cpy); - else - list.shift(); - - c += cpy; - } - } - } - - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) - throw new Error('endReadable called on non-empty stream'); - - if (!state.endEmitted) { - state.ended = true; - processNextTick(endReadableNT, state, stream); - } -} - -function endReadableNT(state, stream) { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } -} - -function forEach (xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} - -function indexOf (xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - return -1; -} diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js deleted file mode 100644 index 3675d18d915610..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js +++ /dev/null @@ -1,197 +0,0 @@ -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. - -'use strict'; - -module.exports = Transform; - -var Duplex = require('./_stream_duplex'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(Transform, Duplex); - - -function TransformState(stream) { - this.afterTransform = function(er, data) { - return afterTransform(stream, er, data); - }; - - this.needTransform = false; - this.transforming = false; - this.writecb = null; - this.writechunk = null; -} - -function afterTransform(stream, er, data) { - var ts = stream._transformState; - ts.transforming = false; - - var cb = ts.writecb; - - if (!cb) - return stream.emit('error', new Error('no writecb in Transform class')); - - ts.writechunk = null; - ts.writecb = null; - - if (data !== null && data !== undefined) - stream.push(data); - - if (cb) - cb(er); - - var rs = stream._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - stream._read(rs.highWaterMark); - } -} - - -function Transform(options) { - if (!(this instanceof Transform)) - return new Transform(options); - - Duplex.call(this, options); - - this._transformState = new TransformState(this); - - // when the writable side finishes, then flush out anything remaining. - var stream = this; - - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; - - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; - - if (options) { - if (typeof options.transform === 'function') - this._transform = options.transform; - - if (typeof options.flush === 'function') - this._flush = options.flush; - } - - this.once('prefinish', function() { - if (typeof this._flush === 'function') - this._flush(function(er) { - done(stream, er); - }); - else - done(stream); - }); -} - -Transform.prototype.push = function(chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; - -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function(chunk, encoding, cb) { - throw new Error('not implemented'); -}; - -Transform.prototype._write = function(chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || - rs.needReadable || - rs.length < rs.highWaterMark) - this._read(rs.highWaterMark); - } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function(n) { - var ts = this._transformState; - - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; - - -function done(stream, er) { - if (er) - return stream.emit('error', er); - - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - var ws = stream._writableState; - var ts = stream._transformState; - - if (ws.length) - throw new Error('calling transform done when ws.length != 0'); - - if (ts.transforming) - throw new Error('calling transform done when still transforming'); - - return stream.push(null); -} diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js deleted file mode 100644 index 41b866d89898aa..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js +++ /dev/null @@ -1,517 +0,0 @@ -// A bit simpler than readable streams. -// Implement an async ._write(chunk, cb), and it'll handle all -// the drain event emission and buffering. - -'use strict'; - -module.exports = Writable; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - - -/**/ -var Buffer = require('buffer').Buffer; -/**/ - -Writable.WritableState = WritableState; - - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - - - -/**/ -var Stream; - (function (){try{ -Stream = require('st' + 'ream'); -}catch(_){Stream = require('events').EventEmitter;}}()) -/**/ - -var Buffer = require('buffer').Buffer; - -util.inherits(Writable, Stream); - -function nop() {} - -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} - -function WritableState(options, stream) { - var Duplex = require('./_stream_duplex'); - - options = options || {}; - - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; - - if (stream instanceof Duplex) - this.objectMode = this.objectMode || !!options.writableObjectMode; - - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; - - // cast to ints. - this.highWaterMark = ~~this.highWaterMark; - - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; - - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; - - // a flag to see when we're in the middle of a write. - this.writing = false; - - // when true all writes will be buffered until .uncork() call - this.corked = 0; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; - - // the callback that's passed to _write(chunk,cb) - this.onwrite = function(er) { - onwrite(stream, er); - }; - - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; - - this.bufferedRequest = null; - this.lastBufferedRequest = null; - - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; - - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; - - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; -} - -WritableState.prototype.getBuffer = function writableStateGetBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; - } - return out; -}; - -(function (){try { -Object.defineProperty(WritableState.prototype, 'buffer', { - get: require('util-deprecate')(function() { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use ' + - '_writableState.getBuffer() instead.') -}); -}catch(_){}}()); - - -function Writable(options) { - var Duplex = require('./_stream_duplex'); - - // Writable ctor is applied to Duplexes, though they're not - // instanceof Writable, they're instanceof Readable. - if (!(this instanceof Writable) && !(this instanceof Duplex)) - return new Writable(options); - - this._writableState = new WritableState(options, this); - - // legacy. - this.writable = true; - - if (options) { - if (typeof options.write === 'function') - this._write = options.write; - - if (typeof options.writev === 'function') - this._writev = options.writev; - } - - Stream.call(this); -} - -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function() { - this.emit('error', new Error('Cannot pipe. Not readable.')); -}; - - -function writeAfterEnd(stream, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - processNextTick(cb, er); -} - -// If we get something that is not a buffer, string, null, or undefined, -// and we're not in objectMode, then that's an error. -// Otherwise stream chunks are all considered to be of length=1, and the -// watermarks determine how many objects to keep in the buffer, rather than -// how many bytes or characters. -function validChunk(stream, state, chunk, cb) { - var valid = true; - - if (!(Buffer.isBuffer(chunk)) && - typeof chunk !== 'string' && - chunk !== null && - chunk !== undefined && - !state.objectMode) { - var er = new TypeError('Invalid non-string/buffer chunk'); - stream.emit('error', er); - processNextTick(cb, er); - valid = false; - } - return valid; -} - -Writable.prototype.write = function(chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (Buffer.isBuffer(chunk)) - encoding = 'buffer'; - else if (!encoding) - encoding = state.defaultEncoding; - - if (typeof cb !== 'function') - cb = nop; - - if (state.ended) - writeAfterEnd(this, cb); - else if (validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, chunk, encoding, cb); - } - - return ret; -}; - -Writable.prototype.cork = function() { - var state = this._writableState; - - state.corked++; -}; - -Writable.prototype.uncork = function() { - var state = this._writableState; - - if (state.corked) { - state.corked--; - - if (!state.writing && - !state.corked && - !state.finished && - !state.bufferProcessing && - state.bufferedRequest) - clearBuffer(this, state); - } -}; - -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') - encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', -'ucs2', 'ucs-2','utf16le', 'utf-16le', 'raw'] -.indexOf((encoding + '').toLowerCase()) > -1)) - throw new TypeError('Unknown encoding: ' + encoding); - this._writableState.defaultEncoding = encoding; -}; - -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && - state.decodeStrings !== false && - typeof chunk === 'string') { - chunk = new Buffer(chunk, encoding); - } - return chunk; -} - -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, chunk, encoding, cb) { - chunk = decodeChunk(state, chunk, encoding); - - if (Buffer.isBuffer(chunk)) - encoding = 'buffer'; - var len = state.objectMode ? 1 : chunk.length; - - state.length += len; - - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) - state.needDrain = true; - - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - - return ret; -} - -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) - stream._writev(chunk, state.onwrite); - else - stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} - -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - if (sync) - processNextTick(cb, er); - else - cb(er); - - stream._writableState.errorEmitted = true; - stream.emit('error', er); -} - -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} - -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - - onwriteStateUpdate(state); - - if (er) - onwriteError(stream, state, sync, er, cb); - else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state); - - if (!finished && - !state.corked && - !state.bufferProcessing && - state.bufferedRequest) { - clearBuffer(stream, state); - } - - if (sync) { - processNextTick(afterWrite, stream, state, finished, cb); - } else { - afterWrite(stream, state, finished, cb); - } - } -} - -function afterWrite(stream, state, finished, cb) { - if (!finished) - onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} - -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} - - -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var buffer = []; - var cbs = []; - while (entry) { - cbs.push(entry.callback); - buffer.push(entry); - entry = entry.next; - } - - // count the one we are adding, as well. - // TODO(isaacs) clean this up - state.pendingcb++; - state.lastBufferedRequest = null; - doWrite(stream, state, true, state.length, buffer, '', function(err) { - for (var i = 0; i < cbs.length; i++) { - state.pendingcb--; - cbs[i](err); - } - }); - - // Clear buffer - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } - } - - if (entry === null) - state.lastBufferedRequest = null; - } - state.bufferedRequest = entry; - state.bufferProcessing = false; -} - -Writable.prototype._write = function(chunk, encoding, cb) { - cb(new Error('not implemented')); -}; - -Writable.prototype._writev = null; - -Writable.prototype.end = function(chunk, encoding, cb) { - var state = this._writableState; - - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (chunk !== null && chunk !== undefined) - this.write(chunk, encoding); - - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); - } - - // ignore unnecessary end() calls. - if (!state.ending && !state.finished) - endWritable(this, state, cb); -}; - - -function needFinish(state) { - return (state.ending && - state.length === 0 && - state.bufferedRequest === null && - !state.finished && - !state.writing); -} - -function prefinish(stream, state) { - if (!state.prefinished) { - state.prefinished = true; - stream.emit('prefinish'); - } -} - -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - if (state.pendingcb === 0) { - prefinish(stream, state); - state.finished = true; - stream.emit('finish'); - } else { - prefinish(stream, state); - } - } - return need; -} - -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) - processNextTick(cb); - else - stream.once('finish', cb); - } - state.ended = true; -} diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/README.md b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/README.md deleted file mode 100644 index 5a76b4149c5eb5..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# core-util-is - -The `util.is*` functions introduced in Node v0.12. diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/float.patch b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/float.patch deleted file mode 100644 index a06d5c05f75fd5..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/float.patch +++ /dev/null @@ -1,604 +0,0 @@ -diff --git a/lib/util.js b/lib/util.js -index a03e874..9074e8e 100644 ---- a/lib/util.js -+++ b/lib/util.js -@@ -19,430 +19,6 @@ - // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - // USE OR OTHER DEALINGS IN THE SOFTWARE. - --var formatRegExp = /%[sdj%]/g; --exports.format = function(f) { -- if (!isString(f)) { -- var objects = []; -- for (var i = 0; i < arguments.length; i++) { -- objects.push(inspect(arguments[i])); -- } -- return objects.join(' '); -- } -- -- var i = 1; -- var args = arguments; -- var len = args.length; -- var str = String(f).replace(formatRegExp, function(x) { -- if (x === '%%') return '%'; -- if (i >= len) return x; -- switch (x) { -- case '%s': return String(args[i++]); -- case '%d': return Number(args[i++]); -- case '%j': -- try { -- return JSON.stringify(args[i++]); -- } catch (_) { -- return '[Circular]'; -- } -- default: -- return x; -- } -- }); -- for (var x = args[i]; i < len; x = args[++i]) { -- if (isNull(x) || !isObject(x)) { -- str += ' ' + x; -- } else { -- str += ' ' + inspect(x); -- } -- } -- return str; --}; -- -- --// Mark that a method should not be used. --// Returns a modified function which warns once by default. --// If --no-deprecation is set, then it is a no-op. --exports.deprecate = function(fn, msg) { -- // Allow for deprecating things in the process of starting up. -- if (isUndefined(global.process)) { -- return function() { -- return exports.deprecate(fn, msg).apply(this, arguments); -- }; -- } -- -- if (process.noDeprecation === true) { -- return fn; -- } -- -- var warned = false; -- function deprecated() { -- if (!warned) { -- if (process.throwDeprecation) { -- throw new Error(msg); -- } else if (process.traceDeprecation) { -- console.trace(msg); -- } else { -- console.error(msg); -- } -- warned = true; -- } -- return fn.apply(this, arguments); -- } -- -- return deprecated; --}; -- -- --var debugs = {}; --var debugEnviron; --exports.debuglog = function(set) { -- if (isUndefined(debugEnviron)) -- debugEnviron = process.env.NODE_DEBUG || ''; -- set = set.toUpperCase(); -- if (!debugs[set]) { -- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { -- var pid = process.pid; -- debugs[set] = function() { -- var msg = exports.format.apply(exports, arguments); -- console.error('%s %d: %s', set, pid, msg); -- }; -- } else { -- debugs[set] = function() {}; -- } -- } -- return debugs[set]; --}; -- -- --/** -- * Echos the value of a value. Trys to print the value out -- * in the best way possible given the different types. -- * -- * @param {Object} obj The object to print out. -- * @param {Object} opts Optional options object that alters the output. -- */ --/* legacy: obj, showHidden, depth, colors*/ --function inspect(obj, opts) { -- // default options -- var ctx = { -- seen: [], -- stylize: stylizeNoColor -- }; -- // legacy... -- if (arguments.length >= 3) ctx.depth = arguments[2]; -- if (arguments.length >= 4) ctx.colors = arguments[3]; -- if (isBoolean(opts)) { -- // legacy... -- ctx.showHidden = opts; -- } else if (opts) { -- // got an "options" object -- exports._extend(ctx, opts); -- } -- // set default options -- if (isUndefined(ctx.showHidden)) ctx.showHidden = false; -- if (isUndefined(ctx.depth)) ctx.depth = 2; -- if (isUndefined(ctx.colors)) ctx.colors = false; -- if (isUndefined(ctx.customInspect)) ctx.customInspect = true; -- if (ctx.colors) ctx.stylize = stylizeWithColor; -- return formatValue(ctx, obj, ctx.depth); --} --exports.inspect = inspect; -- -- --// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics --inspect.colors = { -- 'bold' : [1, 22], -- 'italic' : [3, 23], -- 'underline' : [4, 24], -- 'inverse' : [7, 27], -- 'white' : [37, 39], -- 'grey' : [90, 39], -- 'black' : [30, 39], -- 'blue' : [34, 39], -- 'cyan' : [36, 39], -- 'green' : [32, 39], -- 'magenta' : [35, 39], -- 'red' : [31, 39], -- 'yellow' : [33, 39] --}; -- --// Don't use 'blue' not visible on cmd.exe --inspect.styles = { -- 'special': 'cyan', -- 'number': 'yellow', -- 'boolean': 'yellow', -- 'undefined': 'grey', -- 'null': 'bold', -- 'string': 'green', -- 'date': 'magenta', -- // "name": intentionally not styling -- 'regexp': 'red' --}; -- -- --function stylizeWithColor(str, styleType) { -- var style = inspect.styles[styleType]; -- -- if (style) { -- return '\u001b[' + inspect.colors[style][0] + 'm' + str + -- '\u001b[' + inspect.colors[style][1] + 'm'; -- } else { -- return str; -- } --} -- -- --function stylizeNoColor(str, styleType) { -- return str; --} -- -- --function arrayToHash(array) { -- var hash = {}; -- -- array.forEach(function(val, idx) { -- hash[val] = true; -- }); -- -- return hash; --} -- -- --function formatValue(ctx, value, recurseTimes) { -- // Provide a hook for user-specified inspect functions. -- // Check that value is an object with an inspect function on it -- if (ctx.customInspect && -- value && -- isFunction(value.inspect) && -- // Filter out the util module, it's inspect function is special -- value.inspect !== exports.inspect && -- // Also filter out any prototype objects using the circular check. -- !(value.constructor && value.constructor.prototype === value)) { -- var ret = value.inspect(recurseTimes, ctx); -- if (!isString(ret)) { -- ret = formatValue(ctx, ret, recurseTimes); -- } -- return ret; -- } -- -- // Primitive types cannot have properties -- var primitive = formatPrimitive(ctx, value); -- if (primitive) { -- return primitive; -- } -- -- // Look up the keys of the object. -- var keys = Object.keys(value); -- var visibleKeys = arrayToHash(keys); -- -- if (ctx.showHidden) { -- keys = Object.getOwnPropertyNames(value); -- } -- -- // Some type of object without properties can be shortcutted. -- if (keys.length === 0) { -- if (isFunction(value)) { -- var name = value.name ? ': ' + value.name : ''; -- return ctx.stylize('[Function' + name + ']', 'special'); -- } -- if (isRegExp(value)) { -- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); -- } -- if (isDate(value)) { -- return ctx.stylize(Date.prototype.toString.call(value), 'date'); -- } -- if (isError(value)) { -- return formatError(value); -- } -- } -- -- var base = '', array = false, braces = ['{', '}']; -- -- // Make Array say that they are Array -- if (isArray(value)) { -- array = true; -- braces = ['[', ']']; -- } -- -- // Make functions say that they are functions -- if (isFunction(value)) { -- var n = value.name ? ': ' + value.name : ''; -- base = ' [Function' + n + ']'; -- } -- -- // Make RegExps say that they are RegExps -- if (isRegExp(value)) { -- base = ' ' + RegExp.prototype.toString.call(value); -- } -- -- // Make dates with properties first say the date -- if (isDate(value)) { -- base = ' ' + Date.prototype.toUTCString.call(value); -- } -- -- // Make error with message first say the error -- if (isError(value)) { -- base = ' ' + formatError(value); -- } -- -- if (keys.length === 0 && (!array || value.length == 0)) { -- return braces[0] + base + braces[1]; -- } -- -- if (recurseTimes < 0) { -- if (isRegExp(value)) { -- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); -- } else { -- return ctx.stylize('[Object]', 'special'); -- } -- } -- -- ctx.seen.push(value); -- -- var output; -- if (array) { -- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); -- } else { -- output = keys.map(function(key) { -- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); -- }); -- } -- -- ctx.seen.pop(); -- -- return reduceToSingleString(output, base, braces); --} -- -- --function formatPrimitive(ctx, value) { -- if (isUndefined(value)) -- return ctx.stylize('undefined', 'undefined'); -- if (isString(value)) { -- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') -- .replace(/'/g, "\\'") -- .replace(/\\"/g, '"') + '\''; -- return ctx.stylize(simple, 'string'); -- } -- if (isNumber(value)) { -- // Format -0 as '-0'. Strict equality won't distinguish 0 from -0, -- // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 . -- if (value === 0 && 1 / value < 0) -- return ctx.stylize('-0', 'number'); -- return ctx.stylize('' + value, 'number'); -- } -- if (isBoolean(value)) -- return ctx.stylize('' + value, 'boolean'); -- // For some reason typeof null is "object", so special case here. -- if (isNull(value)) -- return ctx.stylize('null', 'null'); --} -- -- --function formatError(value) { -- return '[' + Error.prototype.toString.call(value) + ']'; --} -- -- --function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { -- var output = []; -- for (var i = 0, l = value.length; i < l; ++i) { -- if (hasOwnProperty(value, String(i))) { -- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, -- String(i), true)); -- } else { -- output.push(''); -- } -- } -- keys.forEach(function(key) { -- if (!key.match(/^\d+$/)) { -- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, -- key, true)); -- } -- }); -- return output; --} -- -- --function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { -- var name, str, desc; -- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; -- if (desc.get) { -- if (desc.set) { -- str = ctx.stylize('[Getter/Setter]', 'special'); -- } else { -- str = ctx.stylize('[Getter]', 'special'); -- } -- } else { -- if (desc.set) { -- str = ctx.stylize('[Setter]', 'special'); -- } -- } -- if (!hasOwnProperty(visibleKeys, key)) { -- name = '[' + key + ']'; -- } -- if (!str) { -- if (ctx.seen.indexOf(desc.value) < 0) { -- if (isNull(recurseTimes)) { -- str = formatValue(ctx, desc.value, null); -- } else { -- str = formatValue(ctx, desc.value, recurseTimes - 1); -- } -- if (str.indexOf('\n') > -1) { -- if (array) { -- str = str.split('\n').map(function(line) { -- return ' ' + line; -- }).join('\n').substr(2); -- } else { -- str = '\n' + str.split('\n').map(function(line) { -- return ' ' + line; -- }).join('\n'); -- } -- } -- } else { -- str = ctx.stylize('[Circular]', 'special'); -- } -- } -- if (isUndefined(name)) { -- if (array && key.match(/^\d+$/)) { -- return str; -- } -- name = JSON.stringify('' + key); -- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { -- name = name.substr(1, name.length - 2); -- name = ctx.stylize(name, 'name'); -- } else { -- name = name.replace(/'/g, "\\'") -- .replace(/\\"/g, '"') -- .replace(/(^"|"$)/g, "'"); -- name = ctx.stylize(name, 'string'); -- } -- } -- -- return name + ': ' + str; --} -- -- --function reduceToSingleString(output, base, braces) { -- var numLinesEst = 0; -- var length = output.reduce(function(prev, cur) { -- numLinesEst++; -- if (cur.indexOf('\n') >= 0) numLinesEst++; -- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; -- }, 0); -- -- if (length > 60) { -- return braces[0] + -- (base === '' ? '' : base + '\n ') + -- ' ' + -- output.join(',\n ') + -- ' ' + -- braces[1]; -- } -- -- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; --} -- -- - // NOTE: These type checking functions intentionally don't use `instanceof` - // because it is fragile and can be easily faked with `Object.create()`. - function isArray(ar) { -@@ -522,166 +98,10 @@ function isPrimitive(arg) { - exports.isPrimitive = isPrimitive; - - function isBuffer(arg) { -- return arg instanceof Buffer; -+ return Buffer.isBuffer(arg); - } - exports.isBuffer = isBuffer; - - function objectToString(o) { - return Object.prototype.toString.call(o); --} -- -- --function pad(n) { -- return n < 10 ? '0' + n.toString(10) : n.toString(10); --} -- -- --var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', -- 'Oct', 'Nov', 'Dec']; -- --// 26 Feb 16:19:34 --function timestamp() { -- var d = new Date(); -- var time = [pad(d.getHours()), -- pad(d.getMinutes()), -- pad(d.getSeconds())].join(':'); -- return [d.getDate(), months[d.getMonth()], time].join(' '); --} -- -- --// log is just a thin wrapper to console.log that prepends a timestamp --exports.log = function() { -- console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); --}; -- -- --/** -- * Inherit the prototype methods from one constructor into another. -- * -- * The Function.prototype.inherits from lang.js rewritten as a standalone -- * function (not on Function.prototype). NOTE: If this file is to be loaded -- * during bootstrapping this function needs to be rewritten using some native -- * functions as prototype setup using normal JavaScript does not work as -- * expected during bootstrapping (see mirror.js in r114903). -- * -- * @param {function} ctor Constructor function which needs to inherit the -- * prototype. -- * @param {function} superCtor Constructor function to inherit prototype from. -- */ --exports.inherits = function(ctor, superCtor) { -- ctor.super_ = superCtor; -- ctor.prototype = Object.create(superCtor.prototype, { -- constructor: { -- value: ctor, -- enumerable: false, -- writable: true, -- configurable: true -- } -- }); --}; -- --exports._extend = function(origin, add) { -- // Don't do anything if add isn't an object -- if (!add || !isObject(add)) return origin; -- -- var keys = Object.keys(add); -- var i = keys.length; -- while (i--) { -- origin[keys[i]] = add[keys[i]]; -- } -- return origin; --}; -- --function hasOwnProperty(obj, prop) { -- return Object.prototype.hasOwnProperty.call(obj, prop); --} -- -- --// Deprecated old stuff. -- --exports.p = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- console.error(exports.inspect(arguments[i])); -- } --}, 'util.p: Use console.error() instead'); -- -- --exports.exec = exports.deprecate(function() { -- return require('child_process').exec.apply(this, arguments); --}, 'util.exec is now called `child_process.exec`.'); -- -- --exports.print = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stdout.write(String(arguments[i])); -- } --}, 'util.print: Use console.log instead'); -- -- --exports.puts = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stdout.write(arguments[i] + '\n'); -- } --}, 'util.puts: Use console.log instead'); -- -- --exports.debug = exports.deprecate(function(x) { -- process.stderr.write('DEBUG: ' + x + '\n'); --}, 'util.debug: Use console.error instead'); -- -- --exports.error = exports.deprecate(function(x) { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stderr.write(arguments[i] + '\n'); -- } --}, 'util.error: Use console.error instead'); -- -- --exports.pump = exports.deprecate(function(readStream, writeStream, callback) { -- var callbackCalled = false; -- -- function call(a, b, c) { -- if (callback && !callbackCalled) { -- callback(a, b, c); -- callbackCalled = true; -- } -- } -- -- readStream.addListener('data', function(chunk) { -- if (writeStream.write(chunk) === false) readStream.pause(); -- }); -- -- writeStream.addListener('drain', function() { -- readStream.resume(); -- }); -- -- readStream.addListener('end', function() { -- writeStream.end(); -- }); -- -- readStream.addListener('close', function() { -- call(); -- }); -- -- readStream.addListener('error', function(err) { -- writeStream.end(); -- call(err); -- }); -- -- writeStream.addListener('error', function(err) { -- readStream.destroy(); -- call(err); -- }); --}, 'util.pump(): Use readableStream.pipe() instead'); -- -- --var uv; --exports._errnoException = function(err, syscall) { -- if (isUndefined(uv)) uv = process.binding('uv'); -- var errname = uv.errname(err); -- var e = new Error(syscall + ' ' + errname); -- e.code = errname; -- e.errno = errname; -- e.syscall = syscall; -- return e; --}; -+} \ No newline at end of file diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/lib/util.js deleted file mode 100644 index 9074e8ebcb61e9..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/lib/util.js +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. -function isArray(ar) { - return Array.isArray(ar); -} -exports.isArray = isArray; - -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; - -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; - -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; - -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; - -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; - -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; - -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return isObject(re) && objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return isObject(d) && objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; - -function isError(e) { - return isObject(e) && - (objectToString(e) === '[object Error]' || e instanceof Error); -} -exports.isError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; - -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -function isBuffer(arg) { - return Buffer.isBuffer(arg); -} -exports.isBuffer = isBuffer; - -function objectToString(o) { - return Object.prototype.toString.call(o); -} \ No newline at end of file diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json deleted file mode 100644 index 89ff535fd78717..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "core-util-is", - "version": "1.0.1", - "description": "The `util.is*` functions introduced in Node v0.12.", - "main": "lib/util.js", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/core-util-is.git" - }, - "keywords": [ - "util", - "isBuffer", - "isArray", - "isNumber", - "isString", - "isRegExp", - "isThis", - "isThat", - "polyfill" - ], - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/isaacs/core-util-is/issues" - }, - "readme": "# core-util-is\n\nThe `util.is*` functions introduced in Node v0.12.\n", - "readmeFilename": "README.md", - "homepage": "https://github.com/isaacs/core-util-is", - "_id": "core-util-is@1.0.1", - "_from": "core-util-is@>=1.0.0 <1.1.0", - "scripts": {} -} diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/util.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/util.js deleted file mode 100644 index 007fa10575636d..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/util.js +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. -function isArray(ar) { - return Array.isArray(ar); -} -exports.isArray = isArray; - -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; - -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; - -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; - -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; - -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; - -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; - -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return isObject(re) && objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return isObject(d) && objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; - -function isError(e) { - return isObject(e) && objectToString(e) === '[object Error]'; -} -exports.isError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; - -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -function isBuffer(arg) { - return arg instanceof Buffer; -} -exports.isBuffer = isBuffer; - -function objectToString(o) { - return Object.prototype.toString.call(o); -} diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/README.md b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/README.md deleted file mode 100644 index 052a62b8d7b7ae..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -# isarray - -`Array#isArray` for older browsers. - -## Usage - -```js -var isArray = require('isarray'); - -console.log(isArray([])); // => true -console.log(isArray({})); // => false -``` - -## Installation - -With [npm](http://npmjs.org) do - -```bash -$ npm install isarray -``` - -Then bundle for the browser with -[browserify](https://github.com/substack/browserify). - -With [component](http://component.io) do - -```bash -$ component install juliangruber/isarray -``` - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/build/build.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/build/build.js deleted file mode 100644 index ec58596aeebe4e..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/build/build.js +++ /dev/null @@ -1,209 +0,0 @@ - -/** - * Require the given path. - * - * @param {String} path - * @return {Object} exports - * @api public - */ - -function require(path, parent, orig) { - var resolved = require.resolve(path); - - // lookup failed - if (null == resolved) { - orig = orig || path; - parent = parent || 'root'; - var err = new Error('Failed to require "' + orig + '" from "' + parent + '"'); - err.path = orig; - err.parent = parent; - err.require = true; - throw err; - } - - var module = require.modules[resolved]; - - // perform real require() - // by invoking the module's - // registered function - if (!module.exports) { - module.exports = {}; - module.client = module.component = true; - module.call(this, module.exports, require.relative(resolved), module); - } - - return module.exports; -} - -/** - * Registered modules. - */ - -require.modules = {}; - -/** - * Registered aliases. - */ - -require.aliases = {}; - -/** - * Resolve `path`. - * - * Lookup: - * - * - PATH/index.js - * - PATH.js - * - PATH - * - * @param {String} path - * @return {String} path or null - * @api private - */ - -require.resolve = function(path) { - if (path.charAt(0) === '/') path = path.slice(1); - var index = path + '/index.js'; - - var paths = [ - path, - path + '.js', - path + '.json', - path + '/index.js', - path + '/index.json' - ]; - - for (var i = 0; i < paths.length; i++) { - var path = paths[i]; - if (require.modules.hasOwnProperty(path)) return path; - } - - if (require.aliases.hasOwnProperty(index)) { - return require.aliases[index]; - } -}; - -/** - * Normalize `path` relative to the current path. - * - * @param {String} curr - * @param {String} path - * @return {String} - * @api private - */ - -require.normalize = function(curr, path) { - var segs = []; - - if ('.' != path.charAt(0)) return path; - - curr = curr.split('/'); - path = path.split('/'); - - for (var i = 0; i < path.length; ++i) { - if ('..' == path[i]) { - curr.pop(); - } else if ('.' != path[i] && '' != path[i]) { - segs.push(path[i]); - } - } - - return curr.concat(segs).join('/'); -}; - -/** - * Register module at `path` with callback `definition`. - * - * @param {String} path - * @param {Function} definition - * @api private - */ - -require.register = function(path, definition) { - require.modules[path] = definition; -}; - -/** - * Alias a module definition. - * - * @param {String} from - * @param {String} to - * @api private - */ - -require.alias = function(from, to) { - if (!require.modules.hasOwnProperty(from)) { - throw new Error('Failed to alias "' + from + '", it does not exist'); - } - require.aliases[to] = from; -}; - -/** - * Return a require function relative to the `parent` path. - * - * @param {String} parent - * @return {Function} - * @api private - */ - -require.relative = function(parent) { - var p = require.normalize(parent, '..'); - - /** - * lastIndexOf helper. - */ - - function lastIndexOf(arr, obj) { - var i = arr.length; - while (i--) { - if (arr[i] === obj) return i; - } - return -1; - } - - /** - * The relative require() itself. - */ - - function localRequire(path) { - var resolved = localRequire.resolve(path); - return require(resolved, parent, path); - } - - /** - * Resolve relative to the parent. - */ - - localRequire.resolve = function(path) { - var c = path.charAt(0); - if ('/' == c) return path.slice(1); - if ('.' == c) return require.normalize(p, path); - - // resolve deps by returning - // the dep in the nearest "deps" - // directory - var segs = parent.split('/'); - var i = lastIndexOf(segs, 'deps') + 1; - if (!i) i = 0; - path = segs.slice(0, i + 1).join('/') + '/deps/' + path; - return path; - }; - - /** - * Check if module is defined at `path`. - */ - - localRequire.exists = function(path) { - return require.modules.hasOwnProperty(localRequire.resolve(path)); - }; - - return localRequire; -}; -require.register("isarray/index.js", function(exports, require, module){ -module.exports = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; -}; - -}); -require.alias("isarray/index.js", "isarray/index.js"); - diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/component.json b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/component.json deleted file mode 100644 index 9e31b683889015..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name" : "isarray", - "description" : "Array#isArray for older browsers", - "version" : "0.0.1", - "repository" : "juliangruber/isarray", - "homepage": "https://github.com/juliangruber/isarray", - "main" : "index.js", - "scripts" : [ - "index.js" - ], - "dependencies" : {}, - "keywords": ["browser","isarray","array"], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT" -} diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/index.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/index.js deleted file mode 100644 index 5f5ad45d46dda9..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/index.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; -}; diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/package.json b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/package.json deleted file mode 100644 index 25c8581bee19f6..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "isarray", - "description": "Array#isArray for older browsers", - "version": "0.0.1", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/isarray.git" - }, - "homepage": "https://github.com/juliangruber/isarray", - "main": "index.js", - "scripts": { - "test": "tap test/*.js" - }, - "dependencies": {}, - "devDependencies": { - "tap": "*" - }, - "keywords": [ - "browser", - "isarray", - "array" - ], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT", - "_id": "isarray@0.0.1", - "dist": { - "shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", - "tarball": "http://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" - }, - "_from": "isarray@0.0.1", - "_npmVersion": "1.2.18", - "_npmUser": { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - "maintainers": [ - { - "name": "juliangruber", - "email": "julian@juliangruber.com" - } - ], - "directories": {}, - "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", - "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "readme": "\n# isarray\n\n`Array#isArray` for older browsers.\n\n## Usage\n\n```js\nvar isArray = require('isarray');\n\nconsole.log(isArray([])); // => true\nconsole.log(isArray({})); // => false\n```\n\n## Installation\n\nWith [npm](http://npmjs.org) do\n\n```bash\n$ npm install isarray\n```\n\nThen bundle for the browser with\n[browserify](https://github.com/substack/browserify).\n\nWith [component](http://component.io) do\n\n```bash\n$ component install juliangruber/isarray\n```\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber <julian@juliangruber.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/juliangruber/isarray/issues" - } -} diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml deleted file mode 100644 index 5ac98855343cee..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" - - "0.11" - - "0.12" - - "iojs" diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/index.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/index.js deleted file mode 100644 index 3eb2f33d0cee43..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/index.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; -module.exports = nextTick; - -function nextTick(fn) { - var args = new Array(arguments.length - 1); - var i = 0; - while (i < arguments.length) { - args[i++] = arguments[i]; - } - process.nextTick(function afterTick() { - fn.apply(null, args); - }); -} diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json deleted file mode 100644 index 02e4a2c65462da..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "process-nextick-args", - "version": "1.0.1", - "description": "process.nextTick but always with args", - "main": "index.js", - "scripts": { - "test": "node test.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/calvinmetcalf/process-nextick-args.git" - }, - "author": "", - "license": "MIT", - "bugs": { - "url": "https://github.com/calvinmetcalf/process-nextick-args/issues" - }, - "homepage": "https://github.com/calvinmetcalf/process-nextick-args", - "devDependencies": { - "tap": "~0.2.6" - }, - "gitHead": "b7c95b21096503e76a1b7f4f60920d32d8378eeb", - "_id": "process-nextick-args@1.0.1", - "_shasum": "918a5ab4a7744340b83ff416101ba53c5c531879", - "_from": "process-nextick-args@>=1.0.0 <1.1.0", - "_npmVersion": "2.0.0", - "_npmUser": { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - }, - "maintainers": [ - { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - } - ], - "dist": { - "shasum": "918a5ab4a7744340b83ff416101ba53c5c531879", - "tarball": "http://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/readme.md b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/readme.md deleted file mode 100644 index 71390efbe685d0..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/readme.md +++ /dev/null @@ -1,18 +0,0 @@ -process-nexttick-args -===== - -[![Build Status](https://travis-ci.org/calvinmetcalf/process-nextick-args.svg?branch=master)](https://travis-ci.org/calvinmetcalf/process-nextick-args) - -```bash -npm install --save process-nexttick-args -``` - -Always be able to pass arguments to process.nextTick, no matter the platform - -```js -var nextTick = require('process-nexttick-args'); - -nextTick(function (a, b, c) { - console.log(a, b, c); -}, 'step', 3, 'profit'); -``` diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/test.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/test.js deleted file mode 100644 index 729f775ff5094c..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/test.js +++ /dev/null @@ -1,17 +0,0 @@ -var test = require("tap").test; -var nextTick = require('./'); - -test('should work', function (t) { - t.plan(5); - nextTick(function (a) { - t.ok(a); - nextTick(function (thing) { - t.equals(thing, 7); - }, 7); - }, true); - nextTick(function (a, b, c) { - t.equals(a, 'step'); - t.equals(b, 3); - t.equals(c, 'profit'); - }, 'step', 3, 'profit'); -}); diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/.npmignore b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/.npmignore deleted file mode 100644 index 206320cc1d21b9..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -build -test diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/LICENSE b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/LICENSE deleted file mode 100644 index 6de584a48f5c89..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright Joyent, Inc. and other Node contributors. - -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/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/README.md b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/README.md deleted file mode 100644 index 4d2aa001501107..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/README.md +++ /dev/null @@ -1,7 +0,0 @@ -**string_decoder.js** (`require('string_decoder')`) from Node.js core - -Copyright Joyent, Inc. and other Node contributors. See LICENCE file for details. - -Version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.** - -The *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version. \ No newline at end of file diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/index.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/index.js deleted file mode 100644 index b00e54fb790982..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/index.js +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -var Buffer = require('buffer').Buffer; - -var isBufferEncoding = Buffer.isEncoding - || function(encoding) { - switch (encoding && encoding.toLowerCase()) { - case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; - default: return false; - } - } - - -function assertEncoding(encoding) { - if (encoding && !isBufferEncoding(encoding)) { - throw new Error('Unknown encoding: ' + encoding); - } -} - -// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. CESU-8 is handled as part of the UTF-8 encoding. -// -// @TODO Handling all encodings inside a single object makes it very difficult -// to reason about this code, so it should be split up in the future. -// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code -// points as used by CESU-8. -var StringDecoder = exports.StringDecoder = function(encoding) { - this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); - assertEncoding(encoding); - switch (this.encoding) { - case 'utf8': - // CESU-8 represents each of Surrogate Pair by 3-bytes - this.surrogateSize = 3; - break; - case 'ucs2': - case 'utf16le': - // UTF-16 represents each of Surrogate Pair by 2-bytes - this.surrogateSize = 2; - this.detectIncompleteChar = utf16DetectIncompleteChar; - break; - case 'base64': - // Base-64 stores 3 bytes in 4 chars, and pads the remainder. - this.surrogateSize = 3; - this.detectIncompleteChar = base64DetectIncompleteChar; - break; - default: - this.write = passThroughWrite; - return; - } - - // Enough space to store all bytes of a single character. UTF-8 needs 4 - // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). - this.charBuffer = new Buffer(6); - // Number of bytes received for the current incomplete multi-byte character. - this.charReceived = 0; - // Number of bytes expected for the current incomplete multi-byte character. - this.charLength = 0; -}; - - -// write decodes the given buffer and returns it as JS string that is -// guaranteed to not contain any partial multi-byte characters. Any partial -// character found at the end of the buffer is buffered up, and will be -// returned when calling write again with the remaining bytes. -// -// Note: Converting a Buffer containing an orphan surrogate to a String -// currently works, but converting a String to a Buffer (via `new Buffer`, or -// Buffer#write) will replace incomplete surrogates with the unicode -// replacement character. See https://codereview.chromium.org/121173009/ . -StringDecoder.prototype.write = function(buffer) { - var charStr = ''; - // if our last write ended with an incomplete multibyte character - while (this.charLength) { - // determine how many remaining bytes this buffer has to offer for this char - var available = (buffer.length >= this.charLength - this.charReceived) ? - this.charLength - this.charReceived : - buffer.length; - - // add the new bytes to the char buffer - buffer.copy(this.charBuffer, this.charReceived, 0, available); - this.charReceived += available; - - if (this.charReceived < this.charLength) { - // still not enough chars in this buffer? wait for more ... - return ''; - } - - // remove bytes belonging to the current character from the buffer - buffer = buffer.slice(available, buffer.length); - - // get the character that was split - charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); - - // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - var charCode = charStr.charCodeAt(charStr.length - 1); - if (charCode >= 0xD800 && charCode <= 0xDBFF) { - this.charLength += this.surrogateSize; - charStr = ''; - continue; - } - this.charReceived = this.charLength = 0; - - // if there are no more bytes in this buffer, just emit our char - if (buffer.length === 0) { - return charStr; - } - break; - } - - // determine and set charLength / charReceived - this.detectIncompleteChar(buffer); - - var end = buffer.length; - if (this.charLength) { - // buffer the incomplete character bytes we got - buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); - end -= this.charReceived; - } - - charStr += buffer.toString(this.encoding, 0, end); - - var end = charStr.length - 1; - var charCode = charStr.charCodeAt(end); - // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - if (charCode >= 0xD800 && charCode <= 0xDBFF) { - var size = this.surrogateSize; - this.charLength += size; - this.charReceived += size; - this.charBuffer.copy(this.charBuffer, size, 0, size); - buffer.copy(this.charBuffer, 0, 0, size); - return charStr.substring(0, end); - } - - // or just emit the charStr - return charStr; -}; - -// detectIncompleteChar determines if there is an incomplete UTF-8 character at -// the end of the given buffer. If so, it sets this.charLength to the byte -// length that character, and sets this.charReceived to the number of bytes -// that are available for this character. -StringDecoder.prototype.detectIncompleteChar = function(buffer) { - // determine how many bytes we have to check at the end of this buffer - var i = (buffer.length >= 3) ? 3 : buffer.length; - - // Figure out if one of the last i bytes of our buffer announces an - // incomplete char. - for (; i > 0; i--) { - var c = buffer[buffer.length - i]; - - // See http://en.wikipedia.org/wiki/UTF-8#Description - - // 110XXXXX - if (i == 1 && c >> 5 == 0x06) { - this.charLength = 2; - break; - } - - // 1110XXXX - if (i <= 2 && c >> 4 == 0x0E) { - this.charLength = 3; - break; - } - - // 11110XXX - if (i <= 3 && c >> 3 == 0x1E) { - this.charLength = 4; - break; - } - } - this.charReceived = i; -}; - -StringDecoder.prototype.end = function(buffer) { - var res = ''; - if (buffer && buffer.length) - res = this.write(buffer); - - if (this.charReceived) { - var cr = this.charReceived; - var buf = this.charBuffer; - var enc = this.encoding; - res += buf.slice(0, cr).toString(enc); - } - - return res; -}; - -function passThroughWrite(buffer) { - return buffer.toString(this.encoding); -} - -function utf16DetectIncompleteChar(buffer) { - this.charReceived = buffer.length % 2; - this.charLength = this.charReceived ? 2 : 0; -} - -function base64DetectIncompleteChar(buffer) { - this.charReceived = buffer.length % 3; - this.charLength = this.charReceived ? 3 : 0; -} diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json deleted file mode 100644 index 0364d54ba46af6..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "string_decoder", - "version": "0.10.31", - "description": "The string_decoder module from Node core", - "main": "index.js", - "dependencies": {}, - "devDependencies": { - "tap": "~0.4.8" - }, - "scripts": { - "test": "tap test/simple/*.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/rvagg/string_decoder.git" - }, - "homepage": "https://github.com/rvagg/string_decoder", - "keywords": [ - "string", - "decoder", - "browser", - "browserify" - ], - "license": "MIT", - "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0", - "bugs": { - "url": "https://github.com/rvagg/string_decoder/issues" - }, - "_id": "string_decoder@0.10.31", - "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "_from": "string_decoder@>=0.10.0 <0.11.0", - "_npmVersion": "1.4.23", - "_npmUser": { - "name": "rvagg", - "email": "rod@vagg.org" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - }, - { - "name": "rvagg", - "email": "rod@vagg.org" - } - ], - "dist": { - "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/History.md b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/History.md deleted file mode 100644 index ec010299b1b259..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/History.md +++ /dev/null @@ -1,11 +0,0 @@ - -1.0.1 / 2014-11-25 -================== - - * browser: use `console.warn()` for deprecation calls - * browser: more jsdocs - -1.0.0 / 2014-04-30 -================== - - * initial commit diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/LICENSE b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/LICENSE deleted file mode 100644 index 6a60e8c225c9ba..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Nathan Rajlich - -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/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/README.md b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/README.md deleted file mode 100644 index 75622fa7c250a6..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/README.md +++ /dev/null @@ -1,53 +0,0 @@ -util-deprecate -============== -### The Node.js `util.deprecate()` function with browser support - -In Node.js, this module simply re-exports the `util.deprecate()` function. - -In the web browser (i.e. via browserify), a browser-specific implementation -of the `util.deprecate()` function is used. - - -## API - -A `deprecate()` function is the only thing exposed by this module. - -``` javascript -// setup: -exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead'); - - -// users see: -foo(); -// foo() is deprecated, use bar() instead -foo(); -foo(); -``` - - -## License - -(The MIT License) - -Copyright (c) 2014 Nathan Rajlich - -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/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/browser.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/browser.js deleted file mode 100644 index 55fa5a4bc6056a..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/browser.js +++ /dev/null @@ -1,62 +0,0 @@ - -/** - * Module exports. - */ - -module.exports = deprecate; - -/** - * Mark that a method should not be used. - * Returns a modified function which warns once by default. - * - * If `localStorage.noDeprecation = true` is set, then it is a no-op. - * - * If `localStorage.throwDeprecation = true` is set, then deprecated functions - * will throw an Error when invoked. - * - * If `localStorage.traceDeprecation = true` is set, then deprecated functions - * will invoke `console.trace()` instead of `console.error()`. - * - * @param {Function} fn - the function to deprecate - * @param {String} msg - the string to print to the console when `fn` is invoked - * @returns {Function} a new "deprecated" version of `fn` - * @api public - */ - -function deprecate (fn, msg) { - if (config('noDeprecation')) { - return fn; - } - - var warned = false; - function deprecated() { - if (!warned) { - if (config('throwDeprecation')) { - throw new Error(msg); - } else if (config('traceDeprecation')) { - console.trace(msg); - } else { - console.warn(msg); - } - warned = true; - } - return fn.apply(this, arguments); - } - - return deprecated; -} - -/** - * Checks `localStorage` for boolean values for the given `name`. - * - * @param {String} name - * @returns {Boolean} - * @api private - */ - -function config (name) { - if (!global.localStorage) return false; - var val = global.localStorage[name]; - if (null == val) return false; - return String(val).toLowerCase() === 'true'; -} diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/node.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/node.js deleted file mode 100644 index 5e6fcff5ddd3fb..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/node.js +++ /dev/null @@ -1,6 +0,0 @@ - -/** - * For Node.js, simply re-export the core `util.deprecate` function. - */ - -module.exports = require('util').deprecate; diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json deleted file mode 100644 index ea487da0e43000..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "util-deprecate", - "version": "1.0.1", - "description": "The Node.js `util.deprecate()` function with browser support", - "main": "node.js", - "browser": "browser.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/util-deprecate.git" - }, - "keywords": [ - "util", - "deprecate", - "browserify", - "browser", - "node" - ], - "author": { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://n8.io/" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/TooTallNate/util-deprecate/issues" - }, - "homepage": "https://github.com/TooTallNate/util-deprecate", - "gitHead": "6e923f7d98a0afbe5b9c7db9d0f0029c1936746c", - "_id": "util-deprecate@1.0.1", - "_shasum": "3556a3d13c4c6aa7983d7e2425478197199b7881", - "_from": "util-deprecate@>=1.0.1 <1.1.0", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - }, - "maintainers": [ - { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - } - ], - "dist": { - "shasum": "3556a3d13c4c6aa7983d7e2425478197199b7881", - "tarball": "http://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/package.json b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/package.json deleted file mode 100644 index 1b3c1718145d2a..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/package.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "readable-stream", - "version": "2.0.1", - "description": "Streams3, a user-land copy of the stream library from iojs v2.x", - "main": "readable.js", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "process-nextick-args": "~1.0.0", - "string_decoder": "~0.10.x", - "util-deprecate": "~1.0.1" - }, - "devDependencies": { - "tap": "~0.2.6", - "tape": "~4.0.0", - "zuul": "~3.0.0" - }, - "scripts": { - "test": "tap test/parallel/*.js", - "browser": "zuul --browser-name $BROWSER_NAME --browser-version $BROWSER_VERSION -- test/browser.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/nodejs/readable-stream.git" - }, - "keywords": [ - "readable", - "stream", - "pipe" - ], - "browser": { - "util": false - }, - "license": "MIT", - "gitHead": "d175d0f68745a5014fc9c41b25b8e0e959269126", - "bugs": { - "url": "https://github.com/nodejs/readable-stream/issues" - }, - "homepage": "https://github.com/nodejs/readable-stream#readme", - "_id": "readable-stream@2.0.1", - "_shasum": "633479b7bd2fbe7a1e869825b40a0b333b9f2bfc", - "_from": "readable-stream@>=2.0.0 <2.1.0", - "_npmVersion": "2.11.1", - "_nodeVersion": "2.3.0", - "_npmUser": { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - }, - "dist": { - "shasum": "633479b7bd2fbe7a1e869825b40a0b333b9f2bfc", - "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.1.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - }, - { - "name": "rvagg", - "email": "rod@vagg.org" - }, - { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/passthrough.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/passthrough.js deleted file mode 100644 index 27e8d8a55165f9..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/passthrough.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_passthrough.js") diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/readable.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/readable.js deleted file mode 100644 index 6222a579864dd2..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/readable.js +++ /dev/null @@ -1,12 +0,0 @@ -var Stream = (function (){ - try { - return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify - } catch(_){} -}()); -exports = module.exports = require('./lib/_stream_readable.js'); -exports.Stream = Stream || exports; -exports.Readable = exports; -exports.Writable = require('./lib/_stream_writable.js'); -exports.Duplex = require('./lib/_stream_duplex.js'); -exports.Transform = require('./lib/_stream_transform.js'); -exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/transform.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/transform.js deleted file mode 100644 index 5d482f0780e993..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/transform.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_transform.js") diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/writable.js b/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/writable.js deleted file mode 100644 index e1e9efdf3c12e9..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/writable.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_writable.js") diff --git a/tools/eslint/node_modules/concat-stream/node_modules/typedarray/.travis.yml b/tools/eslint/node_modules/concat-stream/node_modules/typedarray/.travis.yml deleted file mode 100644 index cc4dba29d959a2..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/typedarray/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" diff --git a/tools/eslint/node_modules/concat-stream/node_modules/typedarray/example/tarray.js b/tools/eslint/node_modules/concat-stream/node_modules/typedarray/example/tarray.js deleted file mode 100644 index 8423d7c9b1c327..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/typedarray/example/tarray.js +++ /dev/null @@ -1,4 +0,0 @@ -var Uint8Array = require('../').Uint8Array; -var ua = new Uint8Array(5); -ua[1] = 256 + 55; -console.log(ua[1]); diff --git a/tools/eslint/node_modules/concat-stream/node_modules/typedarray/package.json b/tools/eslint/node_modules/concat-stream/node_modules/typedarray/package.json deleted file mode 100644 index fe413b9b80a2f4..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/typedarray/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "typedarray", - "version": "0.0.6", - "description": "TypedArray polyfill for old browsers", - "main": "index.js", - "devDependencies": { - "tape": "~2.3.2" - }, - "scripts": { - "test": "tape test/*.js test/server/*.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/substack/typedarray.git" - }, - "homepage": "https://github.com/substack/typedarray", - "keywords": [ - "ArrayBuffer", - "DataView", - "Float32Array", - "Float64Array", - "Int8Array", - "Int16Array", - "Int32Array", - "Uint8Array", - "Uint8ClampedArray", - "Uint16Array", - "Uint32Array", - "typed", - "array", - "polyfill" - ], - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "license": "MIT", - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/6..latest", - "firefox/16..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "readme": "# typedarray\n\nTypedArray polyfill ripped from [this\nmodule](https://raw.github.com/inexorabletash/polyfill).\n\n[![build status](https://secure.travis-ci.org/substack/typedarray.png)](http://travis-ci.org/substack/typedarray)\n\n[![testling badge](https://ci.testling.com/substack/typedarray.png)](https://ci.testling.com/substack/typedarray)\n\n# example\n\n``` js\nvar Uint8Array = require('typedarray').Uint8Array;\nvar ua = new Uint8Array(5);\nua[1] = 256 + 55;\nconsole.log(ua[1]);\n```\n\noutput:\n\n```\n55\n```\n\n# methods\n\n``` js\nvar TA = require('typedarray')\n```\n\nThe `TA` object has the following constructors:\n\n* TA.ArrayBuffer\n* TA.DataView\n* TA.Float32Array\n* TA.Float64Array\n* TA.Int8Array\n* TA.Int16Array\n* TA.Int32Array\n* TA.Uint8Array\n* TA.Uint8ClampedArray\n* TA.Uint16Array\n* TA.Uint32Array\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install typedarray\n```\n\nTo use this module in the browser, compile with\n[browserify](http://browserify.org)\nor download a UMD build from browserify CDN:\n\nhttp://wzrd.in/standalone/typedarray@latest\n\n# license\n\nMIT\n", - "readmeFilename": "readme.markdown", - "bugs": { - "url": "https://github.com/substack/typedarray/issues" - }, - "_id": "typedarray@0.0.6", - "_shasum": "867ac74e3864187b1d3d47d996a78ec5c8830777", - "_from": "typedarray@>=0.0.5 <0.1.0", - "_resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz" -} diff --git a/tools/eslint/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js b/tools/eslint/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js deleted file mode 100644 index 425950f9fc9ed7..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js +++ /dev/null @@ -1,19 +0,0 @@ -var test = require('tape'); -var vm = require('vm'); -var fs = require('fs'); -var src = fs.readFileSync(__dirname + '/../../index.js', 'utf8'); - -test('u8a without globals', function (t) { - var c = { - module: { exports: {} }, - }; - c.exports = c.module.exports; - vm.runInNewContext(src, c); - var TA = c.module.exports; - var ua = new(TA.Uint8Array)(5); - - t.equal(ua.length, 5); - ua[1] = 256 + 55; - t.equal(ua[1], 55); - t.end(); -}); diff --git a/tools/eslint/node_modules/concat-stream/node_modules/typedarray/test/tarray.js b/tools/eslint/node_modules/concat-stream/node_modules/typedarray/test/tarray.js deleted file mode 100644 index df596a34f23c0e..00000000000000 --- a/tools/eslint/node_modules/concat-stream/node_modules/typedarray/test/tarray.js +++ /dev/null @@ -1,10 +0,0 @@ -var TA = require('../'); -var test = require('tape'); - -test('tiny u8a test', function (t) { - var ua = new(TA.Uint8Array)(5); - t.equal(ua.length, 5); - ua[1] = 256 + 55; - t.equal(ua[1], 55); - t.end(); -}); diff --git a/tools/eslint/node_modules/concat-stream/package.json b/tools/eslint/node_modules/concat-stream/package.json index caa06817b0e47a..7a377b67e53a17 100644 --- a/tools/eslint/node_modules/concat-stream/package.json +++ b/tools/eslint/node_modules/concat-stream/package.json @@ -1,81 +1,106 @@ { - "name": "concat-stream", - "version": "1.5.0", - "description": "writable stream that concatenates strings or binary data and calls a callback with the result", - "tags": [ - "stream", - "simple", - "util", - "utility" + "_args": [ + [ + "concat-stream@^1.4.6", + "/Users/silverwind/git/node/tools/package/package" + ] ], - "author": { - "name": "Max Ogden", - "email": "max@maxogden.com" + "_from": "concat-stream@>=1.4.6 <2.0.0", + "_id": "concat-stream@1.5.1", + "_inCache": true, + "_installable": true, + "_location": "/concat-stream", + "_nodeVersion": "4.0.0", + "_npmUser": { + "email": "max@maxogden.com", + "name": "maxogden" }, - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/maxogden/concat-stream.git" + "_npmVersion": "2.14.2", + "_phantomChildren": {}, + "_requested": { + "name": "concat-stream", + "raw": "concat-stream@^1.4.6", + "rawSpec": "^1.4.6", + "scope": null, + "spec": ">=1.4.6 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.1.tgz", + "_shasum": "f3b80acf9e1f48e3875c0688b41b6c31602eea1c", + "_shrinkwrap": null, + "_spec": "concat-stream@^1.4.6", + "_where": "/Users/silverwind/git/node/tools/package/package", + "author": { + "email": "max@maxogden.com", + "name": "Max Ogden" }, "bugs": { "url": "http://github.com/maxogden/concat-stream/issues" }, + "dependencies": { + "inherits": "~2.0.1", + "readable-stream": "~2.0.0", + "typedarray": "~0.0.5" + }, + "description": "writable stream that concatenates strings or binary data and calls a callback with the result", + "devDependencies": { + "tape": "~2.3.2" + }, + "directories": {}, + "dist": { + "shasum": "f3b80acf9e1f48e3875c0688b41b6c31602eea1c", + "tarball": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.1.tgz" + }, "engines": [ "node >= 0.8" ], - "main": "index.js", "files": [ "index.js" ], - "scripts": { - "test": "tape test/*.js test/server/*.js" - }, + "gitHead": "522adc12d82f57c691a5f946fbc8ba08718dcdcb", + "homepage": "https://github.com/maxogden/concat-stream#readme", "license": "MIT", - "dependencies": { - "inherits": "~2.0.1", - "typedarray": "~0.0.5", - "readable-stream": "~2.0.0" + "main": "index.js", + "maintainers": [ + { + "name": "maxogden", + "email": "max@maxogden.com" + } + ], + "name": "concat-stream", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/maxogden/concat-stream.git" }, - "devDependencies": { - "tape": "~2.3.2" + "scripts": { + "test": "tape test/*.js test/server/*.js" }, + "tags": [ + "simple", + "stream", + "util", + "utility" + ], "testling": { - "files": "test/*.js", "browsers": [ - "ie/8..latest", - "firefox/17..latest", - "firefox/nightly", + "android-browser/4.2..latest", "chrome/22..latest", "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", + "firefox/17..latest", + "firefox/nightly", + "ie/8..latest", "ipad/6.0..latest", "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "gitHead": "7cb37c8ddc0fd2ea03c104d07d44d84b83a31185", - "homepage": "https://github.com/maxogden/concat-stream#readme", - "_id": "concat-stream@1.5.0", - "_shasum": "53f7d43c51c5e43f81c8fdd03321c631be68d611", - "_from": "concat-stream@>=1.4.6 <2.0.0", - "_npmVersion": "2.9.0", - "_nodeVersion": "1.8.2", - "_npmUser": { - "name": "maxogden", - "email": "max@maxogden.com" - }, - "maintainers": [ - { - "name": "maxogden", - "email": "max@maxogden.com" - } - ], - "dist": { - "shasum": "53f7d43c51c5e43f81c8fdd03321c631be68d611", - "tarball": "http://registry.npmjs.org/concat-stream/-/concat-stream-1.5.0.tgz" + "opera/12..latest", + "opera/next", + "safari/5.1..latest" + ], + "files": "test/*.js" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.0.tgz", - "readme": "ERROR: No README data found!" + "version": "1.5.1" } diff --git a/tools/eslint/node_modules/concat-stream/readme.md b/tools/eslint/node_modules/concat-stream/readme.md index 69234d52a535bb..1a16af94c40736 100644 --- a/tools/eslint/node_modules/concat-stream/readme.md +++ b/tools/eslint/node_modules/concat-stream/readme.md @@ -1,6 +1,6 @@ # concat-stream -Writable stream that concatenates strings or binary data and calls a callback with the result. Not a transform stream -- more of a stream sink. +Writable stream that concatenates all the data from a stream and calls a callback with the result. Use this when you want to collect all the data from a stream into a single buffer. [![Build Status](https://travis-ci.org/maxogden/concat-stream.svg?branch=master)](https://travis-ci.org/maxogden/concat-stream) @@ -14,6 +14,10 @@ Only use this if you know you can fit all of the output of your stream into a si There are also `objectMode` streams that emit things other than Buffers, and you can concatenate these too. See below for details. +## Related + +`stream-each` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. + ### examples #### Buffers @@ -89,6 +93,8 @@ If you don't specify an encoding, and the types can't be inferred (e.g. you writ `concat-stream` does not handle errors for you, so you must handle errors on whatever streams you pipe into `concat-stream`. This is a general rule when programming with node.js streams: always handle errors on each and every stream. Since `concat-stream` is not itself a stream it does not emit errors. +We recommend using [`end-of-stream`](https://npmjs.org/end-of-stream) or [`pump`](https://npmjs.org/pump) for writing error tolerant stream code. + # license MIT LICENSE diff --git a/tools/eslint/node_modules/core-util-is/LICENSE b/tools/eslint/node_modules/core-util-is/LICENSE new file mode 100644 index 00000000000000..d8d7f9437dbf5a --- /dev/null +++ b/tools/eslint/node_modules/core-util-is/LICENSE @@ -0,0 +1,19 @@ +Copyright Node.js contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/README.md b/tools/eslint/node_modules/core-util-is/README.md similarity index 100% rename from deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/README.md rename to tools/eslint/node_modules/core-util-is/README.md diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/float.patch b/tools/eslint/node_modules/core-util-is/float.patch similarity index 100% rename from deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/float.patch rename to tools/eslint/node_modules/core-util-is/float.patch diff --git a/tools/eslint/node_modules/core-util-is/lib/util.js b/tools/eslint/node_modules/core-util-is/lib/util.js new file mode 100644 index 00000000000000..ff4c851c075a2f --- /dev/null +++ b/tools/eslint/node_modules/core-util-is/lib/util.js @@ -0,0 +1,107 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. + +function isArray(arg) { + if (Array.isArray) { + return Array.isArray(arg); + } + return objectToString(arg) === '[object Array]'; +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = Buffer.isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} diff --git a/tools/eslint/node_modules/core-util-is/package.json b/tools/eslint/node_modules/core-util-is/package.json new file mode 100644 index 00000000000000..586ac59398b627 --- /dev/null +++ b/tools/eslint/node_modules/core-util-is/package.json @@ -0,0 +1,86 @@ +{ + "_args": [ + [ + "core-util-is@~1.0.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/readable-stream" + ] + ], + "_from": "core-util-is@>=1.0.0 <1.1.0", + "_id": "core-util-is@1.0.2", + "_inCache": true, + "_installable": true, + "_location": "/core-util-is", + "_nodeVersion": "4.0.0", + "_npmUser": { + "email": "i@izs.me", + "name": "isaacs" + }, + "_npmVersion": "3.3.2", + "_phantomChildren": {}, + "_requested": { + "name": "core-util-is", + "raw": "core-util-is@~1.0.0", + "rawSpec": "~1.0.0", + "scope": null, + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/readable-stream" + ], + "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "_shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", + "_shrinkwrap": null, + "_spec": "core-util-is@~1.0.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/readable-stream", + "author": { + "email": "i@izs.me", + "name": "Isaac Z. Schlueter", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/core-util-is/issues" + }, + "dependencies": {}, + "description": "The `util.is*` functions introduced in Node v0.12.", + "devDependencies": { + "tap": "^2.3.0" + }, + "directories": {}, + "dist": { + "shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", + "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" + }, + "gitHead": "a177da234df5638b363ddc15fa324619a38577c8", + "homepage": "https://github.com/isaacs/core-util-is#readme", + "keywords": [ + "isArray", + "isBuffer", + "isNumber", + "isRegExp", + "isString", + "isThat", + "isThis", + "polyfill", + "util" + ], + "license": "MIT", + "main": "lib/util.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "core-util-is", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/core-util-is.git" + }, + "scripts": { + "test": "tap test.js" + }, + "version": "1.0.2" +} diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/.lint b/tools/eslint/node_modules/d/.lint similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/.lint rename to tools/eslint/node_modules/d/.lint diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/LICENCE b/tools/eslint/node_modules/d/LICENCE similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/LICENCE rename to tools/eslint/node_modules/d/LICENCE diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/README.md b/tools/eslint/node_modules/d/README.md similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/README.md rename to tools/eslint/node_modules/d/README.md diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/auto-bind.js b/tools/eslint/node_modules/d/auto-bind.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/auto-bind.js rename to tools/eslint/node_modules/d/auto-bind.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/index.js b/tools/eslint/node_modules/d/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/index.js rename to tools/eslint/node_modules/d/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/lazy.js b/tools/eslint/node_modules/d/lazy.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/lazy.js rename to tools/eslint/node_modules/d/lazy.js diff --git a/tools/eslint/node_modules/d/package.json b/tools/eslint/node_modules/d/package.json new file mode 100644 index 00000000000000..f5b006a2967663 --- /dev/null +++ b/tools/eslint/node_modules/d/package.json @@ -0,0 +1,89 @@ +{ + "_args": [ + [ + "d@~0.1.1", + "/Users/silverwind/git/node/tools/package/package/node_modules/es6-map" + ] + ], + "_from": "d@>=0.1.1 <0.2.0", + "_id": "d@0.1.1", + "_inCache": true, + "_installable": true, + "_location": "/d", + "_npmUser": { + "email": "medikoo+npm@medikoo.com", + "name": "medikoo" + }, + "_npmVersion": "1.4.3", + "_phantomChildren": {}, + "_requested": { + "name": "d", + "raw": "d@~0.1.1", + "rawSpec": "~0.1.1", + "scope": null, + "spec": ">=0.1.1 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/es6-iterator", + "/es6-map", + "/es6-set", + "/es6-symbol", + "/es6-weak-map", + "/event-emitter" + ], + "_resolved": "https://registry.npmjs.org/d/-/d-0.1.1.tgz", + "_shasum": "da184c535d18d8ee7ba2aa229b914009fae11309", + "_shrinkwrap": null, + "_spec": "d@~0.1.1", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/es6-map", + "author": { + "email": "medyk@medikoo.com", + "name": "Mariusz Nowak", + "url": "http://www.medikoo.com/" + }, + "bugs": { + "url": "https://github.com/medikoo/d/issues" + }, + "dependencies": { + "es5-ext": "~0.10.2" + }, + "description": "Property descriptor factory", + "devDependencies": { + "tad": "~0.1.21" + }, + "directories": {}, + "dist": { + "shasum": "da184c535d18d8ee7ba2aa229b914009fae11309", + "tarball": "http://registry.npmjs.org/d/-/d-0.1.1.tgz" + }, + "homepage": "https://github.com/medikoo/d", + "keywords": [ + "descriptor", + "descriptors", + "ecma", + "ecmascript", + "es", + "meta", + "properties", + "property" + ], + "license": "MIT", + "maintainers": [ + { + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" + } + ], + "name": "d", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/medikoo/d.git" + }, + "scripts": { + "test": "node node_modules/tad/bin/tad" + }, + "version": "0.1.1" +} diff --git a/tools/eslint/node_modules/debug/.jshintrc b/tools/eslint/node_modules/debug/.jshintrc deleted file mode 100644 index 299877f26aeb6c..00000000000000 --- a/tools/eslint/node_modules/debug/.jshintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "laxbreak": true -} diff --git a/tools/eslint/node_modules/debug/.npmignore b/tools/eslint/node_modules/debug/.npmignore deleted file mode 100644 index 7e6163db02e5e7..00000000000000 --- a/tools/eslint/node_modules/debug/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -support -test -examples -example -*.sock -dist diff --git a/tools/eslint/node_modules/debug/History.md b/tools/eslint/node_modules/debug/History.md deleted file mode 100644 index 854c9711c6fd68..00000000000000 --- a/tools/eslint/node_modules/debug/History.md +++ /dev/null @@ -1,195 +0,0 @@ - -2.2.0 / 2015-05-09 -================== - - * package: update "ms" to v0.7.1 (#202, @dougwilson) - * README: add logging to file example (#193, @DanielOchoa) - * README: fixed a typo (#191, @amir-s) - * browser: expose `storage` (#190, @stephenmathieson) - * Makefile: add a `distclean` target (#189, @stephenmathieson) - -2.1.3 / 2015-03-13 -================== - - * Updated stdout/stderr example (#186) - * Updated example/stdout.js to match debug current behaviour - * Renamed example/stderr.js to stdout.js - * Update Readme.md (#184) - * replace high intensity foreground color for bold (#182, #183) - -2.1.2 / 2015-03-01 -================== - - * dist: recompile - * update "ms" to v0.7.0 - * package: update "browserify" to v9.0.3 - * component: fix "ms.js" repo location - * changed bower package name - * updated documentation about using debug in a browser - * fix: security error on safari (#167, #168, @yields) - -2.1.1 / 2014-12-29 -================== - - * browser: use `typeof` to check for `console` existence - * browser: check for `console.log` truthiness (fix IE 8/9) - * browser: add support for Chrome apps - * Readme: added Windows usage remarks - * Add `bower.json` to properly support bower install - -2.1.0 / 2014-10-15 -================== - - * node: implement `DEBUG_FD` env variable support - * package: update "browserify" to v6.1.0 - * package: add "license" field to package.json (#135, @panuhorsmalahti) - -2.0.0 / 2014-09-01 -================== - - * package: update "browserify" to v5.11.0 - * node: use stderr rather than stdout for logging (#29, @stephenmathieson) - -1.0.4 / 2014-07-15 -================== - - * dist: recompile - * example: remove `console.info()` log usage - * example: add "Content-Type" UTF-8 header to browser example - * browser: place %c marker after the space character - * browser: reset the "content" color via `color: inherit` - * browser: add colors support for Firefox >= v31 - * debug: prefer an instance `log()` function over the global one (#119) - * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) - -1.0.3 / 2014-07-09 -================== - - * Add support for multiple wildcards in namespaces (#122, @seegno) - * browser: fix lint - -1.0.2 / 2014-06-10 -================== - - * browser: update color palette (#113, @gscottolson) - * common: make console logging function configurable (#108, @timoxley) - * node: fix %o colors on old node <= 0.8.x - * Makefile: find node path using shell/which (#109, @timoxley) - -1.0.1 / 2014-06-06 -================== - - * browser: use `removeItem()` to clear localStorage - * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) - * package: add "contributors" section - * node: fix comment typo - * README: list authors - -1.0.0 / 2014-06-04 -================== - - * make ms diff be global, not be scope - * debug: ignore empty strings in enable() - * node: make DEBUG_COLORS able to disable coloring - * *: export the `colors` array - * npmignore: don't publish the `dist` dir - * Makefile: refactor to use browserify - * package: add "browserify" as a dev dependency - * Readme: add Web Inspector Colors section - * node: reset terminal color for the debug content - * node: map "%o" to `util.inspect()` - * browser: map "%j" to `JSON.stringify()` - * debug: add custom "formatters" - * debug: use "ms" module for humanizing the diff - * Readme: add "bash" syntax highlighting - * browser: add Firebug color support - * browser: add colors for WebKit browsers - * node: apply log to `console` - * rewrite: abstract common logic for Node & browsers - * add .jshintrc file - -0.8.1 / 2014-04-14 -================== - - * package: re-add the "component" section - -0.8.0 / 2014-03-30 -================== - - * add `enable()` method for nodejs. Closes #27 - * change from stderr to stdout - * remove unnecessary index.js file - -0.7.4 / 2013-11-13 -================== - - * remove "browserify" key from package.json (fixes something in browserify) - -0.7.3 / 2013-10-30 -================== - - * fix: catch localStorage security error when cookies are blocked (Chrome) - * add debug(err) support. Closes #46 - * add .browser prop to package.json. Closes #42 - -0.7.2 / 2013-02-06 -================== - - * fix package.json - * fix: Mobile Safari (private mode) is broken with debug - * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript - -0.7.1 / 2013-02-05 -================== - - * add repository URL to package.json - * add DEBUG_COLORED to force colored output - * add browserify support - * fix component. Closes #24 - -0.7.0 / 2012-05-04 -================== - - * Added .component to package.json - * Added debug.component.js build - -0.6.0 / 2012-03-16 -================== - - * Added support for "-" prefix in DEBUG [Vinay Pulim] - * Added `.enabled` flag to the node version [TooTallNate] - -0.5.0 / 2012-02-02 -================== - - * Added: humanize diffs. Closes #8 - * Added `debug.disable()` to the CS variant - * Removed padding. Closes #10 - * Fixed: persist client-side variant again. Closes #9 - -0.4.0 / 2012-02-01 -================== - - * Added browser variant support for older browsers [TooTallNate] - * Added `debug.enable('project:*')` to browser variant [TooTallNate] - * Added padding to diff (moved it to the right) - -0.3.0 / 2012-01-26 -================== - - * Added millisecond diff when isatty, otherwise UTC string - -0.2.0 / 2012-01-22 -================== - - * Added wildcard support - -0.1.0 / 2011-12-02 -================== - - * Added: remove colors unless stderr isatty [TooTallNate] - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/tools/eslint/node_modules/debug/bower.json b/tools/eslint/node_modules/debug/bower.json deleted file mode 100644 index 6af573ff5c260d..00000000000000 --- a/tools/eslint/node_modules/debug/bower.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "visionmedia-debug", - "main": "dist/debug.js", - "version": "2.2.0", - "homepage": "https://github.com/visionmedia/debug", - "authors": [ - "TJ Holowaychuk " - ], - "description": "visionmedia-debug", - "moduleType": [ - "amd", - "es6", - "globals", - "node" - ], - "keywords": [ - "visionmedia", - "debug" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/tools/eslint/node_modules/debug/component.json b/tools/eslint/node_modules/debug/component.json deleted file mode 100644 index ca1063724a4498..00000000000000 --- a/tools/eslint/node_modules/debug/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "debug", - "repo": "visionmedia/debug", - "description": "small debugging utility", - "version": "2.2.0", - "keywords": [ - "debug", - "log", - "debugger" - ], - "main": "browser.js", - "scripts": [ - "browser.js", - "debug.js" - ], - "dependencies": { - "rauchg/ms.js": "0.7.1" - } -} diff --git a/tools/eslint/node_modules/debug/node_modules/ms/.npmignore b/tools/eslint/node_modules/debug/node_modules/ms/.npmignore deleted file mode 100644 index d1aa0ce42e1360..00000000000000 --- a/tools/eslint/node_modules/debug/node_modules/ms/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -node_modules -test -History.md -Makefile -component.json diff --git a/tools/eslint/node_modules/debug/node_modules/ms/package.json b/tools/eslint/node_modules/debug/node_modules/ms/package.json deleted file mode 100644 index 253335e6234907..00000000000000 --- a/tools/eslint/node_modules/debug/node_modules/ms/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "ms", - "version": "0.7.1", - "description": "Tiny ms conversion utility", - "repository": { - "type": "git", - "url": "git://github.com/guille/ms.js.git" - }, - "main": "./index", - "devDependencies": { - "mocha": "*", - "expect.js": "*", - "serve": "*" - }, - "component": { - "scripts": { - "ms/index.js": "index.js" - } - }, - "gitHead": "713dcf26d9e6fd9dbc95affe7eff9783b7f1b909", - "bugs": { - "url": "https://github.com/guille/ms.js/issues" - }, - "homepage": "https://github.com/guille/ms.js", - "_id": "ms@0.7.1", - "scripts": {}, - "_shasum": "9cd13c03adbff25b65effde7ce864ee952017098", - "_from": "ms@0.7.1", - "_npmVersion": "2.7.5", - "_nodeVersion": "0.12.2", - "_npmUser": { - "name": "rauchg", - "email": "rauchg@gmail.com" - }, - "maintainers": [ - { - "name": "rauchg", - "email": "rauchg@gmail.com" - } - ], - "dist": { - "shasum": "9cd13c03adbff25b65effde7ce864ee952017098", - "tarball": "http://registry.npmjs.org/ms/-/ms-0.7.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/tools/eslint/node_modules/debug/package.json b/tools/eslint/node_modules/debug/package.json index 63571929d5841d..3679ef340ad474 100644 --- a/tools/eslint/node_modules/debug/package.json +++ b/tools/eslint/node_modules/debug/package.json @@ -1,19 +1,51 @@ { - "name": "debug", - "version": "2.2.0", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/debug.git" + "_args": [ + [ + "debug@^2.1.1", + "/Users/silverwind/git/node/tools/package/package" + ] + ], + "_from": "debug@>=2.1.1 <3.0.0", + "_id": "debug@2.2.0", + "_inCache": true, + "_installable": true, + "_location": "/debug", + "_nodeVersion": "0.12.2", + "_npmUser": { + "email": "nathan@tootallnate.net", + "name": "tootallnate" }, - "description": "small debugging utility", - "keywords": [ - "debug", - "log", - "debugger" + "_npmVersion": "2.7.4", + "_phantomChildren": {}, + "_requested": { + "name": "debug", + "raw": "debug@^2.1.1", + "rawSpec": "^2.1.1", + "scope": null, + "spec": ">=2.1.1 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/" ], + "_resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "_shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", + "_shrinkwrap": null, + "_spec": "debug@^2.1.1", + "_where": "/Users/silverwind/git/node/tools/package/package", "author": { - "name": "TJ Holowaychuk", - "email": "tj@vision-media.ca" + "email": "tj@vision-media.ca", + "name": "TJ Holowaychuk" + }, + "browser": "./browser.js", + "bugs": { + "url": "https://github.com/visionmedia/debug/issues" + }, + "component": { + "scripts": { + "debug/debug.js": "debug.js", + "debug/index.js": "browser.js" + } }, "contributors": [ { @@ -22,37 +54,28 @@ "url": "http://n8.io" } ], - "license": "MIT", "dependencies": { "ms": "0.7.1" }, + "description": "small debugging utility", "devDependencies": { "browserify": "9.0.3", "mocha": "*" }, - "main": "./node.js", - "browser": "./browser.js", - "component": { - "scripts": { - "debug/index.js": "browser.js", - "debug/debug.js": "debug.js" - } + "directories": {}, + "dist": { + "shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", + "tarball": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz" }, "gitHead": "b38458422b5aa8aa6d286b10dfe427e8a67e2b35", - "bugs": { - "url": "https://github.com/visionmedia/debug/issues" - }, "homepage": "https://github.com/visionmedia/debug", - "_id": "debug@2.2.0", - "scripts": {}, - "_shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", - "_from": "debug@>=2.1.1 <3.0.0", - "_npmVersion": "2.7.4", - "_nodeVersion": "0.12.2", - "_npmUser": { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - }, + "keywords": [ + "debug", + "debugger", + "log" + ], + "license": "MIT", + "main": "./node.js", "maintainers": [ { "name": "tjholowaychuk", @@ -63,11 +86,13 @@ "email": "nathan@tootallnate.net" } ], - "dist": { - "shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", - "tarball": "http://registry.npmjs.org/debug/-/debug-2.2.0.tgz" + "name": "debug", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "readme": "ERROR: No README data found!" + "scripts": {}, + "version": "2.2.0" } diff --git a/tools/eslint/node_modules/optionator/node_modules/deep-is/LICENSE b/tools/eslint/node_modules/deep-is/LICENSE similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/deep-is/LICENSE rename to tools/eslint/node_modules/deep-is/LICENSE diff --git a/tools/eslint/node_modules/optionator/node_modules/deep-is/README.markdown b/tools/eslint/node_modules/deep-is/README.markdown similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/deep-is/README.markdown rename to tools/eslint/node_modules/deep-is/README.markdown diff --git a/tools/eslint/node_modules/optionator/node_modules/deep-is/index.js b/tools/eslint/node_modules/deep-is/index.js similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/deep-is/index.js rename to tools/eslint/node_modules/deep-is/index.js diff --git a/tools/eslint/node_modules/deep-is/package.json b/tools/eslint/node_modules/deep-is/package.json new file mode 100644 index 00000000000000..2f22a3fb5acbf1 --- /dev/null +++ b/tools/eslint/node_modules/deep-is/package.json @@ -0,0 +1,112 @@ +{ + "_args": [ + [ + "deep-is@~0.1.3", + "/Users/silverwind/git/node/tools/package/package/node_modules/optionator" + ] + ], + "_from": "deep-is@>=0.1.3 <0.2.0", + "_id": "deep-is@0.1.3", + "_inCache": true, + "_installable": true, + "_location": "/deep-is", + "_npmUser": { + "email": "thlorenz@gmx.de", + "name": "thlorenz" + }, + "_npmVersion": "1.4.14", + "_phantomChildren": {}, + "_requested": { + "name": "deep-is", + "raw": "deep-is@~0.1.3", + "rawSpec": "~0.1.3", + "scope": null, + "spec": ">=0.1.3 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/optionator" + ], + "_resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "_shasum": "b369d6fb5dbc13eecf524f91b070feedc357cf34", + "_shrinkwrap": null, + "_spec": "deep-is@~0.1.3", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/optionator", + "author": { + "email": "thlorenz@gmx.de", + "name": "Thorsten Lorenz", + "url": "http://thlorenz.com" + }, + "bugs": { + "url": "https://github.com/thlorenz/deep-is/issues" + }, + "dependencies": {}, + "description": "node's assert.deepEqual algorithm except for NaN being equal to NaN", + "devDependencies": { + "tape": "~1.0.2" + }, + "directories": { + "example": "example", + "lib": ".", + "test": "test" + }, + "dist": { + "shasum": "b369d6fb5dbc13eecf524f91b070feedc357cf34", + "tarball": "http://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz" + }, + "gitHead": "f126057628423458636dec9df3d621843b9ac55e", + "homepage": "https://github.com/thlorenz/deep-is", + "keywords": [ + "compare", + "equal", + "equality" + ], + "license": { + "type": "MIT", + "url": "https://github.com/thlorenz/deep-is/blob/master/LICENSE" + }, + "main": "index.js", + "maintainers": [ + { + "name": "thlorenz", + "email": "thlorenz@gmx.de" + } + ], + "name": "deep-is", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/thlorenz/deep-is.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "testling": { + "browsers": { + "chrome": [ + 10, + 22 + ], + "ff": [ + 10, + 15, + 3.5 + ], + "ie": [ + 6, + 7, + 8, + 9 + ], + "opera": [ + 12 + ], + "safari": [ + 5.1 + ] + }, + "files": "test/*.js" + }, + "version": "0.1.3" +} diff --git a/tools/eslint/node_modules/del/index.js b/tools/eslint/node_modules/del/index.js new file mode 100644 index 00000000000000..5f3c980939048f --- /dev/null +++ b/tools/eslint/node_modules/del/index.js @@ -0,0 +1,72 @@ +'use strict'; +var path = require('path'); +var globby = require('globby'); +var isPathCwd = require('is-path-cwd'); +var isPathInCwd = require('is-path-in-cwd'); +var objectAssign = require('object-assign'); +var Promise = require('pinkie-promise'); +var pify = require('pify'); +var rimraf = require('rimraf'); +var rimrafP = pify(rimraf, Promise); + +function safeCheck(file) { + if (isPathCwd(file)) { + throw new Error('Cannot delete the current working directory. Can be overriden with the `force` option.'); + } + + if (!isPathInCwd(file)) { + throw new Error('Cannot delete files/folders outside the current working directory. Can be overriden with the `force` option.'); + } +} + +module.exports = function (patterns, opts) { + opts = objectAssign({}, opts); + + var force = opts.force; + delete opts.force; + + var dryRun = opts.dryRun; + delete opts.dryRun; + + return globby(patterns, opts).then(function (files) { + return Promise.all(files.map(function (file) { + if (!force) { + safeCheck(file); + } + + file = path.resolve(opts.cwd || '', file); + + if (dryRun) { + return Promise.resolve(file); + } + + return rimrafP(file).then(function () { + return file; + }); + })); + }); +}; + +module.exports.sync = function (patterns, opts) { + opts = objectAssign({}, opts); + + var force = opts.force; + delete opts.force; + + var dryRun = opts.dryRun; + delete opts.dryRun; + + return globby.sync(patterns, opts).map(function (file) { + if (!force) { + safeCheck(file); + } + + file = path.resolve(opts.cwd || '', file); + + if (!dryRun) { + rimraf.sync(file); + } + + return file; + }); +}; diff --git a/tools/eslint/node_modules/inquirer/node_modules/ansi-regex/license b/tools/eslint/node_modules/del/license similarity index 100% rename from tools/eslint/node_modules/inquirer/node_modules/ansi-regex/license rename to tools/eslint/node_modules/del/license diff --git a/tools/eslint/node_modules/del/package.json b/tools/eslint/node_modules/del/package.json new file mode 100644 index 00000000000000..8e37d5b8d9a885 --- /dev/null +++ b/tools/eslint/node_modules/del/package.json @@ -0,0 +1,121 @@ +{ + "_args": [ + [ + "del@^2.0.2", + "/Users/silverwind/git/node/tools/package/package/node_modules/flat-cache" + ] + ], + "_from": "del@>=2.0.2 <3.0.0", + "_id": "del@2.2.0", + "_inCache": true, + "_installable": true, + "_location": "/del", + "_nodeVersion": "4.2.1", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_npmVersion": "2.14.7", + "_phantomChildren": {}, + "_requested": { + "name": "del", + "raw": "del@^2.0.2", + "rawSpec": "^2.0.2", + "scope": null, + "spec": ">=2.0.2 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/flat-cache" + ], + "_resolved": "https://registry.npmjs.org/del/-/del-2.2.0.tgz", + "_shasum": "9a50f04bf37325e283b4f44e985336c252456bd5", + "_shrinkwrap": null, + "_spec": "del@^2.0.2", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/flat-cache", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/del/issues" + }, + "dependencies": { + "globby": "^4.0.0", + "is-path-cwd": "^1.0.0", + "is-path-in-cwd": "^1.0.0", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "rimraf": "^2.2.8" + }, + "description": "Delete files/folders using globs", + "devDependencies": { + "fs-extra": "^0.26.2", + "mocha": "*", + "path-exists": "^2.0.0", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "9a50f04bf37325e283b4f44e985336c252456bd5", + "tarball": "https://registry.npmjs.org/del/-/del-2.2.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "f364db4622f69856d9b7d26c8830335e607924fe", + "homepage": "https://github.com/sindresorhus/del", + "keywords": [ + "clean", + "cleaning", + "cleanup", + "del", + "delete", + "destroy", + "dir", + "directory", + "file", + "files", + "filesystem", + "folder", + "fs", + "glob", + "gulpfriendly", + "remove", + "rimraf", + "rm", + "rmdir", + "rmrf", + "trash", + "unlink" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "del", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/del.git" + }, + "scripts": { + "test": "xo && mocha" + }, + "version": "2.2.0", + "xo": { + "envs": [ + "mocha", + "node" + ] + } +} diff --git a/tools/eslint/node_modules/del/readme.md b/tools/eslint/node_modules/del/readme.md new file mode 100644 index 00000000000000..c4a64ee25e799e --- /dev/null +++ b/tools/eslint/node_modules/del/readme.md @@ -0,0 +1,100 @@ +# del [![Build Status](https://travis-ci.org/sindresorhus/del.svg?branch=master)](https://travis-ci.org/sindresorhus/del) + +> Delete files and folders using [globs](https://github.com/isaacs/minimatch#usage) + +Pretty much [rimraf](https://github.com/isaacs/rimraf) with a Promise API and support for multiple files and globbing. It also protects you against deleting the current working directory and above. + + +## Install + +``` +$ npm install --save del +``` + + +## Usage + +```js +const del = require('del'); + +del(['tmp/*.js', '!tmp/unicorn.js']).then(paths => { + console.log('Deleted files and folders:\n', paths.join('\n')); +}); +``` + + +## Beware + +The glob pattern `**` matches all children and *the parent*. + +So this won't work: + +```js +del.sync(['public/assets/**', '!public/assets/goat.png']); +``` + +You have to explicitly ignore the parent directories too: + +```js +del.sync(['public/assets/**', '!public/assets', '!public/assets/goat.png']); +``` + +Suggestions on how to improve this welcome! + + +## API + +### del(patterns, [options]) + +Returns a promise for an array of deleted paths. + +### del.sync(patterns, [options]) + +Returns an array of deleted paths. + +#### patterns + +Type: `string`, `array` + +See supported minimatch [patterns](https://github.com/isaacs/minimatch#usage). + +- [Pattern examples with expected matches](https://github.com/sindresorhus/multimatch/blob/master/test.js) +- [Quick globbing pattern overview](https://github.com/sindresorhus/multimatch#globbing-patterns) + +#### options + +Type: `object` + +See the `node-glob` [options](https://github.com/isaacs/node-glob#options). + +##### force + +Type: `boolean` +Default: `false` + +Allow deleting the current working directory and files/folders outside it. + +##### dryRun + +Type: `boolean` +Default: `false` + +See what would be deleted. + +```js +const del = require('del'); + +del(['tmp/*.js'], {dryRun: true}).then(paths => { + console.log('Files and folders that would be deleted:\n', paths.join('\n')); +}); +``` + + +## CLI + +See [trash-cli](https://github.com/sindresorhus/trash-cli). + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/eslint/node_modules/doctrine/.jshintrc b/tools/eslint/node_modules/doctrine/.jshintrc deleted file mode 100644 index 3ecc7bcde648da..00000000000000 --- a/tools/eslint/node_modules/doctrine/.jshintrc +++ /dev/null @@ -1,28 +0,0 @@ -{ - "curly": true, - "eqeqeq": true, - "immed": true, - "indent": 4, - "eqnull": true, - "latedef": true, - "noarg": true, - "noempty": true, - "quotmark": "single", - "undef": true, - "unused": "vars", - "strict": true, - "trailing": true, - "validthis": true, - "bitwise": true, - "plusplus": false, - "nomen": true, - - "onevar": true, - - "node": true, - "predef": [ - "doctrine", - "parseTypeExpression", - "parseTop" - ] -} diff --git a/tools/eslint/node_modules/doctrine/.npmignore b/tools/eslint/node_modules/doctrine/.npmignore deleted file mode 100644 index ba73eea1540866..00000000000000 --- a/tools/eslint/node_modules/doctrine/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules - -*.iml \ No newline at end of file diff --git a/tools/eslint/node_modules/doctrine/.scripted b/tools/eslint/node_modules/doctrine/.scripted deleted file mode 100644 index 89683cd30f259a..00000000000000 --- a/tools/eslint/node_modules/doctrine/.scripted +++ /dev/null @@ -1,6 +0,0 @@ -{ - "editor": { - "expandtab": true, - "tabsize": 4 - } -} \ No newline at end of file diff --git a/tools/eslint/node_modules/doctrine/.travis.yml b/tools/eslint/node_modules/doctrine/.travis.yml deleted file mode 100644 index 93b0f3ee42b34f..00000000000000 --- a/tools/eslint/node_modules/doctrine/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js -node_js: - - 0.10 -after_script: - - npm run coveralls -git: - depth: 10 diff --git a/tools/eslint/node_modules/doctrine/CONTRIBUTING.md b/tools/eslint/node_modules/doctrine/CONTRIBUTING.md deleted file mode 100644 index 6e0978475e0fdb..00000000000000 --- a/tools/eslint/node_modules/doctrine/CONTRIBUTING.md +++ /dev/null @@ -1,5 +0,0 @@ -Project license(s): 2-clause BSD license - -* You will only Submit Contributions where You have authored 100% of the content. -* You will only Submit Contributions to which You have the necessary rights. This means that if You are employed You have received the necessary permissions from Your employer to make the Contributions. -* Whatever content You Contribute will be provided under the Project License(s). diff --git a/tools/eslint/node_modules/doctrine/README.md b/tools/eslint/node_modules/doctrine/README.md index bade0907b60c76..bc6dcf91907faf 100644 --- a/tools/eslint/node_modules/doctrine/README.md +++ b/tools/eslint/node_modules/doctrine/README.md @@ -1,29 +1,54 @@ -doctrine ([doctrine](http://github.com/Constellation/doctrine)) is JSDoc parser. +[![NPM version][npm-image]][npm-url] +[![build status][travis-image]][travis-url] +[![Test coverage][coveralls-image]][coveralls-url] +[![Downloads][downloads-image]][downloads-url] +[![Join the chat at https://gitter.im/eslint/doctrine](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/eslint/doctrine?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![Build Status](https://travis-ci.org/Constellation/doctrine.svg?branch=master)](https://travis-ci.org/Constellation/doctrine) -[![Coverage Status](https://img.shields.io/coveralls/Constellation/doctrine.svg)](https://coveralls.io/r/Constellation/doctrine?branch=master) -[![Dependency Status](https://david-dm.org/Constellation/doctrine.svg)](https://david-dm.org/Constellation/doctrine) -[![devDependency Status](https://david-dm.org/Constellation/doctrine/dev-status.svg)](https://david-dm.org/Constellation/doctrine#info=devDependencies) -[![Gitter chat](https://badges.gitter.im/Constellation/doctrine.png)](https://gitter.im/Constellation/doctrine) +# Doctrine -It is now used by content assist system of [Eclipse Orion](http://www.eclipse.org/orion/) ([detail](http://planetorion.org/news/2012/10/orion-1-0-release/)). And used as JSDoc validator in [ESLint](http://eslint.org/). +Doctrine is a [JSDoc](http://usejsdoc.org) parser that parses documentation comments from JavaScript (you need to pass in the comment, not a whole JavaScript file). -Doctrine can be used in a web browser with using browserify. -or in a Node.js application via the package manager: +## Installation - npm install doctrine +You can install Doctrine using [npm](https://npmjs.com): -simple example: +``` +$ npm install doctrine --save-dev +``` + +Doctrine can also be used in web browsers using [Browserify](http://browserify.org). + +## Usage + +Require doctrine inside of your JavaScript: + +```js +var doctrine = require("doctrine"); +``` - doctrine.parse( - [ - "/**", - " * This function comment is parsed by doctrine", - " * @param {{ok:String}} userName", - "*/" - ].join('\n'), { unwrap: true }); +### parse() -and gets following information +The primary method is `parse()`, which accepts two arguments: the JSDoc comment to parse and an optional options object. The available options are: + +* `unwrap` - set to `true` to delete the leading `/**`, any `*` that begins a line, and the trailing `*/` from the source text. Default: `false`. +* `tags` - an array of tags to return. When specified, Doctrine returns only tags in this array. For example, if `tags` is `["param"]`, then only `@param` tags will be returned. Default: `null`. +* `recoverable` - set to `true` to keep parsing even when syntax errors occur. Default: `false`. +* `sloppy` - set to `true` to allow optional parameters to be specified in brackets (`@param {string} [foo]`). Default: `false`. +* `lineNumbers` - set to `true` to add `lineNumber` to each node, specifying the line on which the node is found in the source. Default: `false`. + +Here's a simple example: + +```js +var ast = doctrine.parse( + [ + "/**", + " * This function comment is parsed by doctrine", + " * @param {{ok:String}} userName", + "*/" + ].join('\n'), { unwrap: true }); +``` + +This example returns the following AST: { "description": "This function comment is parsed by doctrine", @@ -49,65 +74,24 @@ and gets following information ] } -see [demo page](http://constellation.github.com/doctrine/demo/index.html) more detail. - -### Options - -#### doctrine.parse -We can pass options to `doctrine.parse(comment, options)`. -```js -{ - unwrap: boolean, // default: false - tags: [ string ] | null, // default: null - recoverable: boolean, // default: false - sloppy: boolean, // default: false - lineNumbers: boolean // default: false -} -``` - -##### unwrap - -When `unwrap` is `true`, doctrine attempt to unwrap comment specific string from a provided comment text. (removes `/**`, `*/` and `*`) -For example, `unwrap` transforms -``` -/** - * @param use - */ -``` -to -``` -@param use -``` -If a provided comment has these comment specific strings, you need to specify this `unwrap` option to `true`. +See the [demo page](http://eslint.org/doctrine/demo/) more detail. -##### tags +## Team -When `tags` array is specified, doctrine only produce tags that is specified in this array. -For example, if you specify `[ 'param' ]`, doctrine only produces `param` tags. -If null is specified, doctrine produces all tags that doctrine can recognize. +These folks keep the project moving and are resources for help: -##### recoverable +* Nicholas C. Zakas ([@nzakas](https://github.com/nzakas)) - project lead +* Yusuke Suzuki ([@constellation](https://github.com/constellation)) - reviewer -When `recoverable` is `true`, doctrine becomes `recoverable` - When failing to parse jsdoc comment, doctrine recovers its state and attempt to continue parsing. +## Contributing -##### sloppy +Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/doctrine/issues). -When `sloppy` is `true`, -``` -@param String [foo] -``` -'s `[foo]` is interpreted as a optional parameter, not interpreted as a name of this `@param`. +## Frequently Asked Questions -##### lineNumbers +### Can I pass a whole JavaScript file to Doctrine? -When `lineNumbers` is `true`, parsed tags will include a `lineNumber` property indicating the line (relative to the start of the comment block) where each tag is located in the source. So, given the following comment: -``` -/** - * @param {String} foo - * @return {number} - */ -``` -The `@param` tag will have `lineNumber: 1`, and the `@return` tag will have `lineNumber: 2`. +No. Doctrine can only parse JSDoc comments, so you'll need to pass just the JSDoc comment to Doctrine in order to work. ### License @@ -174,3 +158,17 @@ some of extensions is derived from closure-compiler Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ + + +### Where to ask for help? + +Join our [Chatroom](https://gitter.im/eslint/doctrine) + +[npm-image]: https://img.shields.io/npm/v/doctrine.svg?style=flat-square +[npm-url]: https://www.npmjs.com/package/doctrine +[travis-image]: https://img.shields.io/travis/eslint/doctrine/master.svg?style=flat-square +[travis-url]: https://travis-ci.org/eslint/doctrine +[coveralls-image]: https://img.shields.io/coveralls/eslint/doctrine/master.svg?style=flat-square +[coveralls-url]: https://coveralls.io/r/eslint/doctrine?branch=master +[downloads-image]: http://img.shields.io/npm/dm/doctrine.svg?style=flat-square +[downloads-url]: https://www.npmjs.com/package/doctrine diff --git a/tools/eslint/node_modules/doctrine/coverage/coverage-final.json b/tools/eslint/node_modules/doctrine/coverage/coverage-final.json deleted file mode 100644 index 2c63c0851048d8..00000000000000 --- a/tools/eslint/node_modules/doctrine/coverage/coverage-final.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} diff --git a/tools/eslint/node_modules/doctrine/coverage/lcov-report/base.css b/tools/eslint/node_modules/doctrine/coverage/lcov-report/base.css deleted file mode 100644 index 7fb882722004fb..00000000000000 --- a/tools/eslint/node_modules/doctrine/coverage/lcov-report/base.css +++ /dev/null @@ -1,182 +0,0 @@ -body, html { - margin:0; padding: 0; -} -body { - font-family: Helvetica Neue, Helvetica,Arial; - font-size: 10pt; -} -div.header, div.footer { - background: #eee; - padding: 1em; -} -div.header { - z-index: 100; - position: fixed; - top: 0; - border-bottom: 1px solid #666; - width: 100%; -} -div.footer { - border-top: 1px solid #666; -} -div.body { - margin-top: 10em; -} -div.meta { - font-size: 90%; - text-align: center; -} -h1, h2, h3 { - font-weight: normal; -} -h1 { - font-size: 12pt; -} -h2 { - font-size: 10pt; -} -pre { - font-family: Consolas, Menlo, Monaco, monospace; - margin: 0; - padding: 0; - line-height: 14px; - font-size: 14px; - -moz-tab-size: 2; - -o-tab-size: 2; - tab-size: 2; -} - -div.path { font-size: 110%; } -div.path a:link, div.path a:visited { color: #000; } -table.coverage { border-collapse: collapse; margin:0; padding: 0 } - -table.coverage td { - margin: 0; - padding: 0; - color: #111; - vertical-align: top; -} -table.coverage td.line-count { - width: 50px; - text-align: right; - padding-right: 5px; -} -table.coverage td.line-coverage { - color: #777 !important; - text-align: right; - border-left: 1px solid #666; - border-right: 1px solid #666; -} - -table.coverage td.text { -} - -table.coverage td span.cline-any { - display: inline-block; - padding: 0 5px; - width: 40px; -} -table.coverage td span.cline-neutral { - background: #eee; -} -table.coverage td span.cline-yes { - background: #b5d592; - color: #999; -} -table.coverage td span.cline-no { - background: #fc8c84; -} - -.cstat-yes { color: #111; } -.cstat-no { background: #fc8c84; color: #111; } -.fstat-no { background: #ffc520; color: #111 !important; } -.cbranch-no { background: yellow !important; color: #111; } - -.cstat-skip { background: #ddd; color: #111; } -.fstat-skip { background: #ddd; color: #111 !important; } -.cbranch-skip { background: #ddd !important; color: #111; } - -.missing-if-branch { - display: inline-block; - margin-right: 10px; - position: relative; - padding: 0 4px; - background: black; - color: yellow; -} - -.skip-if-branch { - display: none; - margin-right: 10px; - position: relative; - padding: 0 4px; - background: #ccc; - color: white; -} - -.missing-if-branch .typ, .skip-if-branch .typ { - color: inherit !important; -} - -.entity, .metric { font-weight: bold; } -.metric { display: inline-block; border: 1px solid #333; padding: 0.3em; background: white; } -.metric small { font-size: 80%; font-weight: normal; color: #666; } - -div.coverage-summary table { border-collapse: collapse; margin: 3em; font-size: 110%; } -div.coverage-summary td, div.coverage-summary table th { margin: 0; padding: 0.25em 1em; border-top: 1px solid #666; border-bottom: 1px solid #666; } -div.coverage-summary th { text-align: left; border: 1px solid #666; background: #eee; font-weight: normal; } -div.coverage-summary th.file { border-right: none !important; } -div.coverage-summary th.pic { border-left: none !important; text-align: right; } -div.coverage-summary th.pct { border-right: none !important; } -div.coverage-summary th.abs { border-left: none !important; text-align: right; } -div.coverage-summary td.pct { text-align: right; border-left: 1px solid #666; } -div.coverage-summary td.abs { text-align: right; font-size: 90%; color: #444; border-right: 1px solid #666; } -div.coverage-summary td.file { text-align: right; border-left: 1px solid #666; white-space: nowrap; } -div.coverage-summary td.pic { min-width: 120px !important; } -div.coverage-summary a:link { text-decoration: none; color: #000; } -div.coverage-summary a:visited { text-decoration: none; color: #333; } -div.coverage-summary a:hover { text-decoration: underline; } -div.coverage-summary tfoot td { border-top: 1px solid #666; } - -div.coverage-summary .sorter { - height: 10px; - width: 7px; - display: inline-block; - margin-left: 0.5em; - background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; -} -div.coverage-summary .sorted .sorter { - background-position: 0 -20px; -} -div.coverage-summary .sorted-desc .sorter { - background-position: 0 -10px; -} - -.high { background: #b5d592 !important; } -.medium { background: #ffe87c !important; } -.low { background: #fc8c84 !important; } - -span.cover-fill, span.cover-empty { - display:inline-block; - border:1px solid #444; - background: white; - height: 12px; -} -span.cover-fill { - background: #ccc; - border-right: 1px solid #444; -} -span.cover-empty { - background: white; - border-left: none; -} -span.cover-full { - border-right: none !important; -} -pre.prettyprint { - border: none !important; - padding: 0 !important; - margin: 0 !important; -} -.com { color: #999 !important; } -.ignore-none { color: #999; font-weight: normal; } \ No newline at end of file diff --git a/tools/eslint/node_modules/doctrine/coverage/lcov-report/index.html b/tools/eslint/node_modules/doctrine/coverage/lcov-report/index.html deleted file mode 100644 index d9988170680795..00000000000000 --- a/tools/eslint/node_modules/doctrine/coverage/lcov-report/index.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - Code coverage report for All files - - - - - - - - -
      -

      Code coverage report for All files

      -

      - - Statements: 100% (0 / 0)      - - - Branches: 100% (0 / 0)      - - - Functions: 100% (0 / 0)      - - - Lines: 100% (0 / 0)      - - Ignored: none      -

      -
      -
      -
      -
      - - - - - - - - - - - - - - - - -
      FileStatementsBranchesFunctionsLines
      -
      -
      - - - - - - - - diff --git a/tools/eslint/node_modules/doctrine/coverage/lcov-report/prettify.css b/tools/eslint/node_modules/doctrine/coverage/lcov-report/prettify.css deleted file mode 100644 index b317a7cda31a44..00000000000000 --- a/tools/eslint/node_modules/doctrine/coverage/lcov-report/prettify.css +++ /dev/null @@ -1 +0,0 @@ -.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/tools/eslint/node_modules/doctrine/coverage/lcov-report/prettify.js b/tools/eslint/node_modules/doctrine/coverage/lcov-report/prettify.js deleted file mode 100644 index ef51e03866898f..00000000000000 --- a/tools/eslint/node_modules/doctrine/coverage/lcov-report/prettify.js +++ /dev/null @@ -1 +0,0 @@ -window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/tools/eslint/node_modules/doctrine/coverage/lcov-report/sort-arrow-sprite.png b/tools/eslint/node_modules/doctrine/coverage/lcov-report/sort-arrow-sprite.png deleted file mode 100644 index 03f704a609c6fd..00000000000000 Binary files a/tools/eslint/node_modules/doctrine/coverage/lcov-report/sort-arrow-sprite.png and /dev/null differ diff --git a/tools/eslint/node_modules/doctrine/coverage/lcov-report/sorter.js b/tools/eslint/node_modules/doctrine/coverage/lcov-report/sorter.js deleted file mode 100644 index 6afb736c39fb15..00000000000000 --- a/tools/eslint/node_modules/doctrine/coverage/lcov-report/sorter.js +++ /dev/null @@ -1,156 +0,0 @@ -var addSorting = (function () { - "use strict"; - var cols, - currentSort = { - index: 0, - desc: false - }; - - // returns the summary table element - function getTable() { return document.querySelector('.coverage-summary table'); } - // returns the thead element of the summary table - function getTableHeader() { return getTable().querySelector('thead tr'); } - // returns the tbody element of the summary table - function getTableBody() { return getTable().querySelector('tbody'); } - // returns the th element for nth column - function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; } - - // loads all columns - function loadColumns() { - var colNodes = getTableHeader().querySelectorAll('th'), - colNode, - cols = [], - col, - i; - - for (i = 0; i < colNodes.length; i += 1) { - colNode = colNodes[i]; - col = { - key: colNode.getAttribute('data-col'), - sortable: !colNode.getAttribute('data-nosort'), - type: colNode.getAttribute('data-type') || 'string' - }; - cols.push(col); - if (col.sortable) { - col.defaultDescSort = col.type === 'number'; - colNode.innerHTML = colNode.innerHTML + ''; - } - } - return cols; - } - // attaches a data attribute to every tr element with an object - // of data values keyed by column name - function loadRowData(tableRow) { - var tableCols = tableRow.querySelectorAll('td'), - colNode, - col, - data = {}, - i, - val; - for (i = 0; i < tableCols.length; i += 1) { - colNode = tableCols[i]; - col = cols[i]; - val = colNode.getAttribute('data-value'); - if (col.type === 'number') { - val = Number(val); - } - data[col.key] = val; - } - return data; - } - // loads all row data - function loadData() { - var rows = getTableBody().querySelectorAll('tr'), - i; - - for (i = 0; i < rows.length; i += 1) { - rows[i].data = loadRowData(rows[i]); - } - } - // sorts the table using the data for the ith column - function sortByIndex(index, desc) { - var key = cols[index].key, - sorter = function (a, b) { - a = a.data[key]; - b = b.data[key]; - return a < b ? -1 : a > b ? 1 : 0; - }, - finalSorter = sorter, - tableBody = document.querySelector('.coverage-summary tbody'), - rowNodes = tableBody.querySelectorAll('tr'), - rows = [], - i; - - if (desc) { - finalSorter = function (a, b) { - return -1 * sorter(a, b); - }; - } - - for (i = 0; i < rowNodes.length; i += 1) { - rows.push(rowNodes[i]); - tableBody.removeChild(rowNodes[i]); - } - - rows.sort(finalSorter); - - for (i = 0; i < rows.length; i += 1) { - tableBody.appendChild(rows[i]); - } - } - // removes sort indicators for current column being sorted - function removeSortIndicators() { - var col = getNthColumn(currentSort.index), - cls = col.className; - - cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); - col.className = cls; - } - // adds sort indicators for current column being sorted - function addSortIndicators() { - getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; - } - // adds event listeners for all sorter widgets - function enableUI() { - var i, - el, - ithSorter = function ithSorter(i) { - var col = cols[i]; - - return function () { - var desc = col.defaultDescSort; - - if (currentSort.index === i) { - desc = !currentSort.desc; - } - sortByIndex(i, desc); - removeSortIndicators(); - currentSort.index = i; - currentSort.desc = desc; - addSortIndicators(); - }; - }; - for (i =0 ; i < cols.length; i += 1) { - if (cols[i].sortable) { - el = getNthColumn(i).querySelector('.sorter'); - if (el.addEventListener) { - el.addEventListener('click', ithSorter(i)); - } else { - el.attachEvent('onclick', ithSorter(i)); - } - } - } - } - // adds sorting functionality to the UI - return function () { - if (!getTable()) { - return; - } - cols = loadColumns(); - loadData(cols); - addSortIndicators(); - enableUI(); - }; -})(); - -window.addEventListener('load', addSorting); diff --git a/tools/eslint/node_modules/doctrine/eslint.json b/tools/eslint/node_modules/doctrine/eslint.json deleted file mode 100644 index 330835b9bf7eb2..00000000000000 --- a/tools/eslint/node_modules/doctrine/eslint.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "env": { - "node": true - }, - "rules": { - "quotes": [2, "single"], - "valid-jsdoc": [2, true], - "brace-style": [2, true], - "semi": [2, true], - "no-bitwise": [2, true], - "camelcase": [2, true], - "curly": [2, true], - "eqeqeq": [2, "allow-null"], - "wrap-iife": [2, true], - "eqeqeq": [2, true], - "strict": [2, true], - "no-unused-vars": [2, true], - "no-underscore-dangle": [0, false], - "no-use-before-define": [0, false], - "no-constant-condition": [0, false] - } -} diff --git a/tools/eslint/node_modules/doctrine/gulpfile.js b/tools/eslint/node_modules/doctrine/gulpfile.js deleted file mode 100644 index a68d0ff930d1b7..00000000000000 --- a/tools/eslint/node_modules/doctrine/gulpfile.js +++ /dev/null @@ -1,120 +0,0 @@ -/* - Copyright (C) 2014 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -'use strict'; - -var gulp = require('gulp'); -var mocha = require('gulp-mocha'); -var jshint = require('gulp-jshint'); -var eslint = require('gulp-eslint'); -var istanbul = require('gulp-istanbul'); -var bump = require('gulp-bump'); -var filter = require('gulp-filter'); -var git = require('gulp-git'); -var tagVersion = require('gulp-tag-version'); - -var SRC = [ 'lib/*.js' ]; - -var TEST = [ 'test/*.js' ]; - -var LINT = [ - 'gulpfile.js' -].concat(SRC); - -var ESLINT_OPTION = { - 'rules': { - 'quotes': 0, - 'eqeqeq': 0, - 'no-use-before-define': 0, - 'no-underscore-dangle': 0, - 'no-shadow': 0, - 'no-constant-condition': 0, - 'no-multi-spaces': 0, - 'dot-notation': [2, {'allowKeywords': false}] - }, - 'env': { - 'node': true - } -}; - -gulp.task('test', function (cb) { - gulp.src(SRC) - .pipe(istanbul()) // Covering files - .on('finish', function () { - gulp.src(TEST) - .pipe(mocha({ - reporter: 'spec', - timeout: 100000 // 100s - })) - .pipe(istanbul.writeReports()) // Creating the reports after tests runned - .on('end', cb); - }); -}); - -gulp.task('lint', function () { - return gulp.src(LINT) - .pipe(jshint('.jshintrc')) - .pipe(jshint.reporter(require('jshint-stylish'))) - .pipe(jshint.reporter('fail')) - .pipe(eslint(ESLINT_OPTION)) - .pipe(eslint.formatEach('compact', process.stderr)) - .pipe(eslint.failOnError()); -}); - - -/** - * Bumping version number and tagging the repository with it. - * Please read http://semver.org/ - * - * You can use the commands - * - * gulp patch # makes v0.1.0 -> v0.1.1 - * gulp feature # makes v0.1.1 -> v0.2.0 - * gulp release # makes v0.2.1 -> v1.0.0 - * - * To bump the version numbers accordingly after you did a patch, - * introduced a feature or made a backwards-incompatible release. - */ - -function inc(importance) { - // get all the files to bump version in - return gulp.src(['./package.json']) - // bump the version number in those files - .pipe(bump({type: importance})) - // save it back to filesystem - .pipe(gulp.dest('./')) - // commit the changed version number - .pipe(git.commit('Bumps package version')) - // read only one file to get the version number - .pipe(filter('package.json')) - // **tag it in the repository** - .pipe(tagVersion({ prefix: '' })); -} - -gulp.task('patch', [ 'travis' ], function () { return inc('patch'); }); -gulp.task('minor', [ 'travis' ], function () { return inc('minor'); }); -gulp.task('major', [ 'travis' ], function () { return inc('major'); }); - -gulp.task('travis', [ 'lint', 'test' ]); -gulp.task('default', [ 'travis' ]); diff --git a/tools/eslint/node_modules/doctrine/lib/doctrine.js b/tools/eslint/node_modules/doctrine/lib/doctrine.js index dd3cccb263ce71..f82331df092fbb 100644 --- a/tools/eslint/node_modules/doctrine/lib/doctrine.js +++ b/tools/eslint/node_modules/doctrine/lib/doctrine.js @@ -70,6 +70,10 @@ return title === 'param' || title === 'argument' || title === 'arg'; } + function isReturnTitle(title) { + return title === 'return' || title === 'returns'; + } + function isProperty(title) { return title === 'property' || title === 'prop'; } @@ -88,10 +92,10 @@ } function isTypeParameterRequired(title) { - return isParamTitle(title) || title === 'define' || title === 'enum' || - title === 'implements' || title === 'return' || - title === 'this' || title === 'type' || title === 'typedef' || - title === 'returns' || isProperty(title); + return isParamTitle(title) || isReturnTitle(title) || + title === 'define' || title === 'enum' || + title === 'implements' || title === 'this' || + title === 'type' || title === 'typedef' || isProperty(title); } // Consider deprecation instead using 'isTypeParameterRequired' and 'Rules' declaration to pick when a type is optional/required @@ -159,7 +163,7 @@ index += 1; } - return result; + return result.replace(/\s+$/, ''); } // JSDoc Tag Parser @@ -202,7 +206,6 @@ while (last < length) { ch = source.charCodeAt(last); if (esutils.code.isLineTerminator(ch) && !(ch === 0x0D /* '\r' */ && source.charCodeAt(last + 1) === 0x0A /* '\n' */)) { - lineNumber += 1; waiting = true; } else if (waiting) { if (ch === 0x40 /* '@' */) { @@ -324,8 +327,14 @@ name += scanIdentifier(last); } + if(source.charCodeAt(index) === 0x5B /* '[' */ && source.charCodeAt(index + 1) === 0x5D /* ']' */){ + name += advance(); + name += advance(); + } while (source.charCodeAt(index) === 0x2E /* '.' */ || + source.charCodeAt(index) === 0x2F /* '/' */ || source.charCodeAt(index) === 0x23 /* '#' */ || + source.charCodeAt(index) === 0x2D /* '-' */ || source.charCodeAt(index) === 0x7E /* '~' */) { name += advance(); name += scanIdentifier(last); @@ -333,17 +342,37 @@ } if (useBrackets) { + skipWhiteSpace(last); // do we have a default value for this? if (source.charCodeAt(index) === 0x3D /* '=' */) { - // consume the '='' symbol name += advance(); + skipWhiteSpace(last); + + var ch; + var bracketDepth = 1; // scan in the default value - while (index < last && source.charCodeAt(index) !== 0x5D /* ']' */) { + while (index < last) { + ch = source.charCodeAt(index); + + if (esutils.code.isWhiteSpace(ch)) { + skipWhiteSpace(last); + ch = source.charCodeAt(index); + } + + if (ch === 0x5B /* '[' */) { + bracketDepth++; + } else if (ch === 0x5D /* ']' */ && + --bracketDepth === 0) { + break; + } + name += advance(); } } + skipWhiteSpace(last); + if (index >= last || source.charCodeAt(index) !== 0x5D /* ']' */) { // we never found a closing ']' return null; @@ -409,7 +438,7 @@ try { this._tag.type = parseType(this._title, this._last); if (!this._tag.type) { - if (!isParamTitle(this._title)) { + if (!isParamTitle(this._title) && !isReturnTitle(this._title)) { if (!this.addError('Missing or invalid tag type')) { return false; } @@ -514,6 +543,22 @@ return true; }; + TagParser.prototype.parseCaption = function parseDescription() { + var description = trim(sliceSource(source, index, this._last)); + var captionStartTag = ''; + var captionEndTag = ''; + var captionStart = description.indexOf(captionStartTag); + var captionEnd = description.indexOf(captionEndTag); + if (captionStart >= 0 && captionEnd >= 0) { + this._tag.caption = trim(description.substring( + captionStart + captionStartTag.length, captionEnd)); + this._tag.description = trim(description.substring(captionEnd + captionEndTag.length)); + } else { + this._tag.description = description; + } + return true; + }; + TagParser.prototype.parseKind = function parseKind() { var kind, kinds; kinds = { @@ -551,6 +596,23 @@ return true; }; + TagParser.prototype.parseThis = function parseAccess() { + // this name may be a name expression (e.g. {foo.bar}) + // or a name path (e.g. foo.bar) + var value = trim(sliceSource(source, index, this._last)); + if (value && value.charAt(0) === '{') { + var gotType = this.parseType(); + if (gotType && this._tag.type.type === 'NameExpression') { + this._tag.name = this._tag.type.name; + return true; + } else { + return this.addError('Invalid name for this'); + } + } else { + return this.parseNamePath(); + } + }; + TagParser.prototype.parseVariation = function parseVariation() { var variation, text; text = trim(sliceSource(source, index, this._last)); @@ -581,7 +643,9 @@ // un-fix potentially sloppy declaration if (isParamTitle(this._title) && !this._tag.type && description && description.charAt(0) === '[') { this._tag.type = this._extra.name; - this._tag.name = undefined; + if (!this._tag.name) { + this._tag.name = undefined; + } if (!sloppy) { if (!this.addError('Missing or invalid tag name')) { @@ -606,6 +670,8 @@ 'class': ['parseType', 'parseNamePathOptional', 'ensureEnd'], // Synonym: http://usejsdoc.org/tags-extends.html 'extends': ['parseType', 'parseNamePathOptional', 'ensureEnd'], + // http://usejsdoc.org/tags-example.html + 'example': ['parseCaption'], // http://usejsdoc.org/tags-deprecated.html 'deprecated': ['parseDescription'], // http://usejsdoc.org/tags-global.html @@ -653,9 +719,11 @@ // http://usejsdoc.org/tags-summary.html 'summary': ['parseDescription'], // http://usejsdoc.org/tags-this.html - 'this': ['parseNamePath', 'ensureEnd'], + 'this': ['parseThis', 'ensureEnd'], // http://usejsdoc.org/tags-todo.html 'todo': ['parseDescription'], + // http://usejsdoc.org/tags-typedef.html + 'typedef': ['parseType', 'parseNamePathOptional'], // http://usejsdoc.org/tags-variation.html 'variation': ['parseVariation'], // http://usejsdoc.org/tags-version.html @@ -689,13 +757,11 @@ } } - // Seek global index to end of this tag. - index = this._last; return this._tag; }; function parseTag(options) { - var title, parser; + var title, parser, tag; // skip to tag if (!skipToTag()) { @@ -707,14 +773,20 @@ // construct tag parser parser = new TagParser(options, title); - return parser.parse(); + tag = parser.parse(); + + // Seek global index to end of this tag. + while (index < parser._last) { + advance(); + } + return tag; } // // Parse JSDoc // - function scanJSDocDescription() { + function scanJSDocDescription(preserveWhitespace) { var description = '', ch, atAllowed; atAllowed = true; @@ -733,7 +805,8 @@ description += advance(); } - return trim(description); + + return preserveWhitespace ? description : trim(description); } function parse(comment, options) { @@ -772,7 +845,7 @@ sloppy = options.sloppy; strict = options.strict; - description = scanJSDocDescription(); + description = scanJSDocDescription(options.preserveWhitespace); while (true) { tag = parseTag(options); diff --git a/tools/eslint/node_modules/doctrine/lib/typed.js b/tools/eslint/node_modules/doctrine/lib/typed.js index 2b02000e634412..b8eada510b7641 100644 --- a/tools/eslint/node_modules/doctrine/lib/typed.js +++ b/tools/eslint/node_modules/doctrine/lib/typed.js @@ -1000,7 +1000,7 @@ return expr; } - elements = [ expr ]; + elements = [expr]; consume(Token.PIPE); while (true) { elements.push(parseTypeExpression()); diff --git a/tools/eslint/node_modules/doctrine/node_modules/esutils/package.json b/tools/eslint/node_modules/doctrine/node_modules/esutils/package.json index b01fe6004b1ea8..7be24707557b1d 100644 --- a/tools/eslint/node_modules/doctrine/node_modules/esutils/package.json +++ b/tools/eslint/node_modules/doctrine/node_modules/esutils/package.json @@ -1,66 +1,92 @@ { - "name": "esutils", + "_args": [ + [ + "esutils@^1.1.6", + "/Users/silverwind/git/node/tools/package/package/node_modules/doctrine" + ] + ], + "_from": "esutils@>=1.1.6 <2.0.0", + "_id": "esutils@1.1.6", + "_inCache": true, + "_installable": true, + "_location": "/doctrine/esutils", + "_npmUser": { + "email": "utatane.tea@gmail.com", + "name": "constellation" + }, + "_npmVersion": "2.0.0-alpha-5", + "_phantomChildren": {}, + "_requested": { + "name": "esutils", + "raw": "esutils@^1.1.6", + "rawSpec": "^1.1.6", + "scope": null, + "spec": ">=1.1.6 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/doctrine" + ], + "_resolved": "https://registry.npmjs.org/esutils/-/esutils-1.1.6.tgz", + "_shasum": "c01ccaa9ae4b897c6d0c3e210ae52f3c7a844375", + "_shrinkwrap": null, + "_spec": "esutils@^1.1.6", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/doctrine", + "bugs": { + "url": "https://github.com/Constellation/esutils/issues" + }, + "dependencies": {}, "description": "utility box for ECMAScript language tools", - "homepage": "https://github.com/Constellation/esutils", - "main": "lib/utils.js", - "version": "1.1.6", - "engines": { - "node": ">=0.10.0" + "devDependencies": { + "chai": "~1.7.2", + "coffee-script": "~1.6.3", + "jshint": "2.1.5", + "mocha": "~1.12.0", + "regenerate": "~0.5.4", + "unicode-6.3.0": "~0.1.1" }, "directories": { "lib": "./lib" }, + "dist": { + "shasum": "c01ccaa9ae4b897c6d0c3e210ae52f3c7a844375", + "tarball": "http://registry.npmjs.org/esutils/-/esutils-1.1.6.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, "files": [ "LICENSE.BSD", "README.md", "lib" ], + "gitHead": "a91c5ed6199d1019ef071f610848fcd5103ef153", + "homepage": "https://github.com/Constellation/esutils", + "licenses": [ + { + "type": "BSD", + "url": "http://github.com/Constellation/esutils/raw/master/LICENSE.BSD" + } + ], + "main": "lib/utils.js", "maintainers": [ { "name": "constellation", "email": "utatane.tea@gmail.com" } ], + "name": "esutils", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git+ssh://git@github.com/Constellation/esutils.git" }, - "devDependencies": { - "mocha": "~1.12.0", - "chai": "~1.7.2", - "jshint": "2.1.5", - "coffee-script": "~1.6.3", - "unicode-6.3.0": "~0.1.1", - "regenerate": "~0.5.4" - }, - "licenses": [ - { - "type": "BSD", - "url": "http://github.com/Constellation/esutils/raw/master/LICENSE.BSD" - } - ], "scripts": { - "test": "npm run-script lint && npm run-script unit-test", + "generate-regex": "node tools/generate-identifier-regex.js", "lint": "jshint lib/*.js", - "unit-test": "mocha --compilers coffee:coffee-script -R spec", - "generate-regex": "node tools/generate-identifier-regex.js" - }, - "gitHead": "a91c5ed6199d1019ef071f610848fcd5103ef153", - "bugs": { - "url": "https://github.com/Constellation/esutils/issues" - }, - "_id": "esutils@1.1.6", - "_shasum": "c01ccaa9ae4b897c6d0c3e210ae52f3c7a844375", - "_from": "esutils@>=1.1.6 <2.0.0", - "_npmVersion": "2.0.0-alpha-5", - "_npmUser": { - "name": "constellation", - "email": "utatane.tea@gmail.com" - }, - "dist": { - "shasum": "c01ccaa9ae4b897c6d0c3e210ae52f3c7a844375", - "tarball": "http://registry.npmjs.org/esutils/-/esutils-1.1.6.tgz" + "test": "npm run-script lint && npm run-script unit-test", + "unit-test": "mocha --compilers coffee:coffee-script -R spec" }, - "_resolved": "https://registry.npmjs.org/esutils/-/esutils-1.1.6.tgz", - "readme": "ERROR: No README data found!" + "version": "1.1.6" } diff --git a/tools/eslint/node_modules/doctrine/node_modules/isarray/README.md b/tools/eslint/node_modules/doctrine/node_modules/isarray/README.md deleted file mode 100644 index 052a62b8d7b7ae..00000000000000 --- a/tools/eslint/node_modules/doctrine/node_modules/isarray/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -# isarray - -`Array#isArray` for older browsers. - -## Usage - -```js -var isArray = require('isarray'); - -console.log(isArray([])); // => true -console.log(isArray({})); // => false -``` - -## Installation - -With [npm](http://npmjs.org) do - -```bash -$ npm install isarray -``` - -Then bundle for the browser with -[browserify](https://github.com/substack/browserify). - -With [component](http://component.io) do - -```bash -$ component install juliangruber/isarray -``` - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/tools/eslint/node_modules/doctrine/node_modules/isarray/build/build.js b/tools/eslint/node_modules/doctrine/node_modules/isarray/build/build.js deleted file mode 100644 index ec58596aeebe4e..00000000000000 --- a/tools/eslint/node_modules/doctrine/node_modules/isarray/build/build.js +++ /dev/null @@ -1,209 +0,0 @@ - -/** - * Require the given path. - * - * @param {String} path - * @return {Object} exports - * @api public - */ - -function require(path, parent, orig) { - var resolved = require.resolve(path); - - // lookup failed - if (null == resolved) { - orig = orig || path; - parent = parent || 'root'; - var err = new Error('Failed to require "' + orig + '" from "' + parent + '"'); - err.path = orig; - err.parent = parent; - err.require = true; - throw err; - } - - var module = require.modules[resolved]; - - // perform real require() - // by invoking the module's - // registered function - if (!module.exports) { - module.exports = {}; - module.client = module.component = true; - module.call(this, module.exports, require.relative(resolved), module); - } - - return module.exports; -} - -/** - * Registered modules. - */ - -require.modules = {}; - -/** - * Registered aliases. - */ - -require.aliases = {}; - -/** - * Resolve `path`. - * - * Lookup: - * - * - PATH/index.js - * - PATH.js - * - PATH - * - * @param {String} path - * @return {String} path or null - * @api private - */ - -require.resolve = function(path) { - if (path.charAt(0) === '/') path = path.slice(1); - var index = path + '/index.js'; - - var paths = [ - path, - path + '.js', - path + '.json', - path + '/index.js', - path + '/index.json' - ]; - - for (var i = 0; i < paths.length; i++) { - var path = paths[i]; - if (require.modules.hasOwnProperty(path)) return path; - } - - if (require.aliases.hasOwnProperty(index)) { - return require.aliases[index]; - } -}; - -/** - * Normalize `path` relative to the current path. - * - * @param {String} curr - * @param {String} path - * @return {String} - * @api private - */ - -require.normalize = function(curr, path) { - var segs = []; - - if ('.' != path.charAt(0)) return path; - - curr = curr.split('/'); - path = path.split('/'); - - for (var i = 0; i < path.length; ++i) { - if ('..' == path[i]) { - curr.pop(); - } else if ('.' != path[i] && '' != path[i]) { - segs.push(path[i]); - } - } - - return curr.concat(segs).join('/'); -}; - -/** - * Register module at `path` with callback `definition`. - * - * @param {String} path - * @param {Function} definition - * @api private - */ - -require.register = function(path, definition) { - require.modules[path] = definition; -}; - -/** - * Alias a module definition. - * - * @param {String} from - * @param {String} to - * @api private - */ - -require.alias = function(from, to) { - if (!require.modules.hasOwnProperty(from)) { - throw new Error('Failed to alias "' + from + '", it does not exist'); - } - require.aliases[to] = from; -}; - -/** - * Return a require function relative to the `parent` path. - * - * @param {String} parent - * @return {Function} - * @api private - */ - -require.relative = function(parent) { - var p = require.normalize(parent, '..'); - - /** - * lastIndexOf helper. - */ - - function lastIndexOf(arr, obj) { - var i = arr.length; - while (i--) { - if (arr[i] === obj) return i; - } - return -1; - } - - /** - * The relative require() itself. - */ - - function localRequire(path) { - var resolved = localRequire.resolve(path); - return require(resolved, parent, path); - } - - /** - * Resolve relative to the parent. - */ - - localRequire.resolve = function(path) { - var c = path.charAt(0); - if ('/' == c) return path.slice(1); - if ('.' == c) return require.normalize(p, path); - - // resolve deps by returning - // the dep in the nearest "deps" - // directory - var segs = parent.split('/'); - var i = lastIndexOf(segs, 'deps') + 1; - if (!i) i = 0; - path = segs.slice(0, i + 1).join('/') + '/deps/' + path; - return path; - }; - - /** - * Check if module is defined at `path`. - */ - - localRequire.exists = function(path) { - return require.modules.hasOwnProperty(localRequire.resolve(path)); - }; - - return localRequire; -}; -require.register("isarray/index.js", function(exports, require, module){ -module.exports = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; -}; - -}); -require.alias("isarray/index.js", "isarray/index.js"); - diff --git a/tools/eslint/node_modules/doctrine/node_modules/isarray/component.json b/tools/eslint/node_modules/doctrine/node_modules/isarray/component.json deleted file mode 100644 index 9e31b683889015..00000000000000 --- a/tools/eslint/node_modules/doctrine/node_modules/isarray/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name" : "isarray", - "description" : "Array#isArray for older browsers", - "version" : "0.0.1", - "repository" : "juliangruber/isarray", - "homepage": "https://github.com/juliangruber/isarray", - "main" : "index.js", - "scripts" : [ - "index.js" - ], - "dependencies" : {}, - "keywords": ["browser","isarray","array"], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT" -} diff --git a/tools/eslint/node_modules/doctrine/node_modules/isarray/index.js b/tools/eslint/node_modules/doctrine/node_modules/isarray/index.js deleted file mode 100644 index 5f5ad45d46dda9..00000000000000 --- a/tools/eslint/node_modules/doctrine/node_modules/isarray/index.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = Array.isArray || function (arr) { - return Object.prototype.toString.call(arr) == '[object Array]'; -}; diff --git a/tools/eslint/node_modules/doctrine/node_modules/isarray/package.json b/tools/eslint/node_modules/doctrine/node_modules/isarray/package.json deleted file mode 100644 index 25c8581bee19f6..00000000000000 --- a/tools/eslint/node_modules/doctrine/node_modules/isarray/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "isarray", - "description": "Array#isArray for older browsers", - "version": "0.0.1", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/isarray.git" - }, - "homepage": "https://github.com/juliangruber/isarray", - "main": "index.js", - "scripts": { - "test": "tap test/*.js" - }, - "dependencies": {}, - "devDependencies": { - "tap": "*" - }, - "keywords": [ - "browser", - "isarray", - "array" - ], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT", - "_id": "isarray@0.0.1", - "dist": { - "shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", - "tarball": "http://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" - }, - "_from": "isarray@0.0.1", - "_npmVersion": "1.2.18", - "_npmUser": { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - "maintainers": [ - { - "name": "juliangruber", - "email": "julian@juliangruber.com" - } - ], - "directories": {}, - "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", - "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "readme": "\n# isarray\n\n`Array#isArray` for older browsers.\n\n## Usage\n\n```js\nvar isArray = require('isarray');\n\nconsole.log(isArray([])); // => true\nconsole.log(isArray({})); // => false\n```\n\n## Installation\n\nWith [npm](http://npmjs.org) do\n\n```bash\n$ npm install isarray\n```\n\nThen bundle for the browser with\n[browserify](https://github.com/substack/browserify).\n\nWith [component](http://component.io) do\n\n```bash\n$ component install juliangruber/isarray\n```\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber <julian@juliangruber.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/juliangruber/isarray/issues" - } -} diff --git a/tools/eslint/node_modules/doctrine/package.json b/tools/eslint/node_modules/doctrine/package.json index 7de168c4eabd37..79835fa71b58e3 100644 --- a/tools/eslint/node_modules/doctrine/package.json +++ b/tools/eslint/node_modules/doctrine/package.json @@ -1,71 +1,113 @@ { - "name": "doctrine", + "_args": [ + [ + "doctrine@^1.2.1", + "/Users/silverwind/git/node/tools/package/package" + ] + ], + "_from": "doctrine@>=1.2.1 <2.0.0", + "_id": "doctrine@1.2.1", + "_inCache": true, + "_installable": true, + "_location": "/doctrine", + "_nodeVersion": "0.12.9", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/doctrine-1.2.1.tgz_1459275509740_0.26917822007089853" + }, + "_npmUser": { + "email": "nicholas@nczconsulting.com", + "name": "nzakas" + }, + "_npmVersion": "2.14.9", + "_phantomChildren": {}, + "_requested": { + "name": "doctrine", + "raw": "doctrine@^1.2.1", + "rawSpec": "^1.2.1", + "scope": null, + "spec": ">=1.2.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.2.1.tgz", + "_shasum": "ac0c649d70b9501e16e97acb7ec4e27168f746a3", + "_shrinkwrap": null, + "_spec": "doctrine@^1.2.1", + "_where": "/Users/silverwind/git/node/tools/package/package", + "bugs": { + "url": "https://github.com/eslint/doctrine/issues" + }, + "dependencies": { + "esutils": "^1.1.6", + "isarray": "^1.0.0" + }, "description": "JSDoc parser", - "homepage": "http://github.com/Constellation/doctrine.html", - "main": "lib/doctrine.js", - "version": "0.6.4", - "engines": { - "node": ">=0.10.0" + "devDependencies": { + "coveralls": "^2.11.2", + "dateformat": "^1.0.11", + "eslint": "^1.10.3", + "eslint-release": "^0.3.0", + "istanbul": "^0.4.1", + "linefix": "^0.1.1", + "mocha": "^2.3.3", + "npm-license": "^0.3.1", + "semver": "^5.0.3", + "shelljs": "^0.5.3", + "shelljs-nodecli": "^0.1.1", + "should": "^5.0.1" }, "directories": { "lib": "./lib" }, + "dist": { + "shasum": "ac0c649d70b9501e16e97acb7ec4e27168f746a3", + "tarball": "https://registry.npmjs.org/doctrine/-/doctrine-1.2.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "LICENSE.BSD", + "LICENSE.closure-compiler", + "LICENSE.esprima", + "README.md", + "lib" + ], + "gitHead": "18dba10454f17acbc49ae3c0628119734cb34952", + "homepage": "https://github.com/eslint/doctrine", + "licenses": [ + { + "type": "BSD", + "url": "http://github.com/eslint/doctrine/raw/master/LICENSE.BSD" + } + ], + "main": "lib/doctrine.js", "maintainers": [ { "name": "constellation", "email": "utatane.tea@gmail.com" + }, + { + "name": "nzakas", + "email": "nicholas@nczconsulting.com" } ], + "name": "doctrine", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", "repository": { "type": "git", - "url": "git+ssh://git@github.com/Constellation/doctrine.git" + "url": "git+ssh://git@github.com/eslint/doctrine.git" }, - "devDependencies": { - "coveralls": "^2.11.2", - "gulp": "^3.8.10", - "gulp-bump": "^0.1.13", - "gulp-eslint": "^0.5.0", - "gulp-filter": "^2.0.2", - "gulp-git": "^1.0.0", - "gulp-istanbul": "^0.6.0", - "gulp-jshint": "^1.9.0", - "gulp-mocha": "^2.0.0", - "gulp-tag-version": "^1.2.1", - "jshint-stylish": "^1.0.0", - "should": "^5.0.1" - }, - "licenses": [ - { - "type": "BSD", - "url": "http://github.com/Constellation/doctrine/raw/master/LICENSE.BSD" - } - ], "scripts": { - "test": "gulp", - "unit-test": "gulp test", - "lint": "gulp lint", - "coveralls": "cat ./coverage/lcov.info | coveralls && rm -rf ./coverage" - }, - "dependencies": { - "esutils": "^1.1.6", - "isarray": "0.0.1" - }, - "gitHead": "0835299b485ecdfa908d20628d6c8900144590ff", - "bugs": { - "url": "https://github.com/Constellation/doctrine/issues" - }, - "_id": "doctrine@0.6.4", - "_shasum": "81428491a942ef18b0492056eda3800eee57d61d", - "_from": "doctrine@>=0.6.2 <0.7.0", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "constellation", - "email": "utatane.tea@gmail.com" - }, - "dist": { - "shasum": "81428491a942ef18b0492056eda3800eee57d61d", - "tarball": "http://registry.npmjs.org/doctrine/-/doctrine-0.6.4.tgz" + "alpharelease": "eslint-prerelease alpha", + "betarelease": "eslint-prerelease beta", + "lint": "eslint lib/", + "release": "eslint-release", + "test": "npm run lint && node Makefile.js test" }, - "_resolved": "https://registry.npmjs.org/doctrine/-/doctrine-0.6.4.tgz", - "readme": "ERROR: No README data found!" + "version": "1.2.1" } diff --git a/tools/eslint/node_modules/doctrine/test/midstream.js b/tools/eslint/node_modules/doctrine/test/midstream.js deleted file mode 100644 index 2e71bd14e1098e..00000000000000 --- a/tools/eslint/node_modules/doctrine/test/midstream.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright (C) 2014 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/*global require describe it*/ -/*jslint node:true */ -'use strict'; - -var fs = require('fs'), - path = require('path'), - root = path.join(path.dirname(fs.realpathSync(__filename)), '..'), - doctrine = require(root); -require('should'); - -describe('midstream', function () { - it('parseType', function () { - var res = doctrine.parseType('string name', { midstream: true }); - res.should.eql({ - "expression": { - "name": "string", - "type": "NameExpression" - }, - "index": 6 - }); - }); - - it('parseParamType', function () { - var res = doctrine.parseParamType('...test ok', { midstream: true }); - res.should.eql({ - "expression": { - "expression": { - "name": "test", - "type": "NameExpression" - }, - "type": "RestType" - }, - "index": 7 - }); - }); -}); - -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/eslint/node_modules/doctrine/test/parse.js b/tools/eslint/node_modules/doctrine/test/parse.js deleted file mode 100644 index 851e67c0d9a87e..00000000000000 --- a/tools/eslint/node_modules/doctrine/test/parse.js +++ /dev/null @@ -1,2219 +0,0 @@ -/* - Copyright (C) 2013 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/*global require describe it*/ -/*jslint node:true */ -'use strict'; - -var fs = require('fs'), - path = require('path'), - root = path.join(path.dirname(fs.realpathSync(__filename)), '..'), - doctrine = require(root); -require('should'); - -describe('parse', function () { - it('alias', function () { - var res = doctrine.parse('/** @alias */', { unwrap: true }); - res.tags.should.have.length(0); - }); - - it('alias with name', function () { - var res = doctrine.parse('/** @alias aliasName */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'alias'); - res.tags[0].should.have.property('name', 'aliasName'); - }); - - it('alias with namepath', function () { - var res = doctrine.parse('/** @alias aliasName.OK */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'alias'); - res.tags[0].should.have.property('name', 'aliasName.OK'); - }); - - it('const', function () { - var res = doctrine.parse('/** @const */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'const'); - }); - - it('const with name', function () { - var res = doctrine.parse('/** @const constname */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'const'); - res.tags[0].should.have.property('name', 'constname'); - }); - - it('constant with name', function () { - var res = doctrine.parse('/** @constant constname */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'constant'); - res.tags[0].should.have.property('name', 'constname'); - }); - - it('const with type and name', function () { - var res = doctrine.parse('/** @const {String} constname */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'const'); - res.tags[0].should.have.property('name', 'constname'); - res.tags[0].should.have.property('type'); - res.tags[0].type.should.eql({ - type: 'NameExpression', - name: 'String' - }); - }); - - it('constant with type and name', function () { - var res = doctrine.parse('/** @constant {String} constname */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'constant'); - res.tags[0].should.have.property('name', 'constname'); - res.tags[0].should.have.property('type'); - res.tags[0].type.should.eql({ - type: 'NameExpression', - name: 'String' - }); - }); - - it('const multiple', function () { - var res = doctrine.parse("/**@const\n @const*/", { unwrap: true }); - res.tags.should.have.length(2); - res.tags[0].should.have.property('title', 'const'); - res.tags[1].should.have.property('title', 'const'); - }); - - it('const double', function () { - var res = doctrine.parse("/**@const\n @const*/", { unwrap: true }); - res.tags.should.have.length(2); - res.tags[0].should.have.property('title', 'const'); - res.tags[1].should.have.property('title', 'const'); - }); - - it('const triple', function () { - var res = doctrine.parse( - [ - "/**", - " * @const @const", - " * @const @const", - " * @const @const", - " */" - ].join('\n'), { unwrap: true }); - res.tags.should.have.length(3); - res.tags[0].should.have.property('title', 'const'); - res.tags[1].should.have.property('title', 'const'); - res.tags[2].should.have.property('title', 'const'); - }); - - it('constructor', function () { - var res = doctrine.parse('/** @constructor */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'constructor'); - }); - - it('constructor with type', function () { - var res = doctrine.parse('/** @constructor {Object} */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'constructor'); - res.tags[0].type.should.eql({ - type: 'NameExpression', - name: 'Object' - }); - }); - - it('constructor with type and name', function () { - var res = doctrine.parse('/** @constructor {Object} objName */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'constructor'); - res.tags[0].should.have.property('name', 'objName'); - res.tags[0].type.should.eql({ - type: 'NameExpression', - name: 'Object' - }); - }); - - it('class', function () { - var res = doctrine.parse('/** @class */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'class'); - }); - - it('class with type', function () { - var res = doctrine.parse('/** @class {Object} */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'class'); - res.tags[0].type.should.eql({ - type: 'NameExpression', - name: 'Object' - }); - }); - - it('class with type and name', function () { - var res = doctrine.parse('/** @class {Object} objName */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'class'); - res.tags[0].should.have.property('name', 'objName'); - res.tags[0].type.should.eql({ - type: 'NameExpression', - name: 'Object' - }); - }); - - it('deprecated', function () { - var res = doctrine.parse('/** @deprecated */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'deprecated'); - }); - - it('deprecated', function () { - var res = doctrine.parse('/** @deprecated some text here describing why it is deprecated */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'deprecated'); - res.tags[0].should.have.property('description', 'some text here describing why it is deprecated'); - }); - - it('func', function () { - var res = doctrine.parse('/** @func */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'func'); - }); - - it('func with name', function () { - var res = doctrine.parse('/** @func thingName.func */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'func'); - res.tags[0].should.have.property('name', 'thingName.func'); - }); - - it('func with type', function () { - var res = doctrine.parse('/** @func {Object} thingName.func */', { unwrap: true }); - res.tags.should.have.length(0); - // func does not accept type - }); - - it('function', function () { - var res = doctrine.parse('/** @function */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'function'); - }); - - it('function with name', function () { - var res = doctrine.parse('/** @function thingName.function */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'function'); - res.tags[0].should.have.property('name', 'thingName.function'); - }); - - it('function with type', function () { - var res = doctrine.parse('/** @function {Object} thingName.function */', { unwrap: true }); - res.tags.should.have.length(0); - // function does not accept type - }); - - it('member', function () { - var res = doctrine.parse('/** @member */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'member'); - }); - - it('member with name', function () { - var res = doctrine.parse('/** @member thingName.name */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'member'); - res.tags[0].should.have.property('name', 'thingName.name'); - }); - - it('member with type', function () { - var res = doctrine.parse('/** @member {Object} thingName.name */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'member'); - res.tags[0].should.have.property('name', 'thingName.name'); - res.tags[0].should.have.property('type'); - res.tags[0].type.should.eql({ - type: 'NameExpression', - name: 'Object' - }); - }); - - it('method', function () { - var res = doctrine.parse('/** @method */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'method'); - }); - - it('method with name', function () { - var res = doctrine.parse('/** @method thingName.function */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'method'); - res.tags[0].should.have.property('name', 'thingName.function'); - }); - - it('method with type', function () { - var res = doctrine.parse('/** @method {Object} thingName.function */', { unwrap: true }); - res.tags.should.have.length(0); - // method does not accept type - }); - - it('mixes', function () { - var res = doctrine.parse('/** @mixes */', { unwrap: true }); - res.tags.should.have.length(0); - }); - - it('mixes with name', function () { - var res = doctrine.parse('/** @mixes thingName */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'mixes'); - res.tags[0].should.have.property('name', 'thingName'); - }); - - it('mixes with namepath', function () { - var res = doctrine.parse('/** @mixes thingName.name */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'mixes'); - res.tags[0].should.have.property('name', 'thingName.name'); - }); - - it('mixin', function () { - var res = doctrine.parse('/** @mixin */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'mixin'); - }); - - it('mixin with name', function () { - var res = doctrine.parse('/** @mixin thingName */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'mixin'); - res.tags[0].should.have.property('name', 'thingName'); - }); - - it('mixin with namepath', function () { - var res = doctrine.parse('/** @mixin thingName.name */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'mixin'); - res.tags[0].should.have.property('name', 'thingName.name'); - }); - - it('module', function () { - var res = doctrine.parse('/** @module */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'module'); - }); - - it('module with name', function () { - var res = doctrine.parse('/** @module thingName.name */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'module'); - res.tags[0].should.have.property('name', 'thingName.name'); - }); - - it('module with type', function () { - var res = doctrine.parse('/** @module {Object} thingName.name */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'module'); - res.tags[0].should.have.property('name', 'thingName.name'); - res.tags[0].should.have.property('type'); - res.tags[0].type.should.eql({ - type: 'NameExpression', - name: 'Object' - }); - }); - - it('name', function () { - var res = doctrine.parse('/** @name thingName.name */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'name'); - res.tags[0].should.have.property('name', 'thingName.name'); - }); - - it('name', function () { - var res = doctrine.parse('/** @name thingName#name */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'name'); - res.tags[0].should.have.property('name', 'thingName#name'); - }); - - it('name', function () { - var res = doctrine.parse('/** @name thingName~name */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'name'); - res.tags[0].should.have.property('name', 'thingName~name'); - }); - - it('name', function () { - var res = doctrine.parse('/** @name {thing} thingName.name */', { unwrap: true }); - // name does not accept type - res.tags.should.have.length(0); - }); - - it('namespace', function () { - var res = doctrine.parse('/** @namespace */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'namespace'); - }); - - it('namespace with name', function () { - var res = doctrine.parse('/** @namespace thingName.name */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'namespace'); - res.tags[0].should.have.property('name', 'thingName.name'); - }); - - it('namespace with type', function () { - var res = doctrine.parse('/** @namespace {Object} thingName.name */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'namespace'); - res.tags[0].should.have.property('name', 'thingName.name'); - res.tags[0].should.have.property('type'); - res.tags[0].type.should.eql({ - type: 'NameExpression', - name: 'Object' - }); - }); - - it('param', function () { - var res = doctrine.parse( - [ - "/**", - " * @param {String} userName", - "*/" - ].join('\n'), { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'param'); - res.tags[0].should.have.property('name', 'userName'); - res.tags[0].should.have.property('type'); - res.tags[0].type.should.eql({ - type: 'NameExpression', - name: 'String' - }); - }); - - it('param with properties', function () { - var res = doctrine.parse( - [ - "/**", - " * @param {String} user.name", - "*/" - ].join('\n'), { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'param'); - res.tags[0].should.have.property('name', 'user.name'); - res.tags[0].should.have.property('type'); - res.tags[0].type.should.eql({ - type: 'NameExpression', - name: 'String' - }); - }); - - it('arg with properties', function () { - var res = doctrine.parse( - [ - "/**", - " * @arg {String} user.name", - "*/" - ].join('\n'), { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'arg'); - res.tags[0].should.have.property('name', 'user.name'); - res.tags[0].should.have.property('type'); - res.tags[0].type.should.eql({ - type: 'NameExpression', - name: 'String' - }); - }); - - it('argument with properties', function () { - var res = doctrine.parse( - [ - "/**", - " * @argument {String} user.name", - "*/" - ].join('\n'), { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'argument'); - res.tags[0].should.have.property('name', 'user.name'); - res.tags[0].should.have.property('type'); - res.tags[0].type.should.eql({ - type: 'NameExpression', - name: 'String' - }); - }); - - it('param typeless', function () { - var res = doctrine.parse( - [ - "/**", - " * @param userName", - "*/" - ].join('\n'), { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.eql({ - title: 'param', - type: null, - name: 'userName', - description: null - }); - - var res = doctrine.parse( - [ - "/**", - " * @param userName Something descriptive", - "*/" - ].join('\n'), { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.eql({ - title: 'param', - type: null, - name: 'userName', - description: 'Something descriptive' - }); - - var res = doctrine.parse( - [ - "/**", - " * @param user.name Something descriptive", - "*/" - ].join('\n'), { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.eql({ - title: 'param', - type: null, - name: 'user.name', - description: 'Something descriptive' - }); - }); - - it('param broken', function () { - var res = doctrine.parse( - [ - "/**", - " * @param {String} userName", - " * @param {String userName", - "*/" - ].join('\n'), { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'param'); - res.tags[0].should.have.property('name', 'userName'); - res.tags[0].should.have.property('type'); - res.tags[0].type.should.eql({ - type: 'NameExpression', - name: 'String' - }); - }); - - it('param record', function () { - var res = doctrine.parse( - [ - "/**", - " * @param {{ok:String}} userName", - "*/" - ].join('\n'), { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'param'); - res.tags[0].should.have.property('name', 'userName'); - res.tags[0].should.have.property('type'); - res.tags[0].type.should.eql({ - type: 'RecordType', - fields: [{ - type: 'FieldType', - key: 'ok', - value: { - type: 'NameExpression', - name: 'String' - } - }] - }); - }); - - it('param record broken', function () { - var res = doctrine.parse( - [ - "/**", - " * @param {{ok:String} userName", - "*/" - ].join('\n'), { unwrap: true }); - res.tags.should.be.empty; - }); - - it('param multiple lines', function () { - var res = doctrine.parse( - [ - "/**", - " * @param {string|", - " * number} userName", - " * }}", - "*/" - ].join('\n'), { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'param'); - res.tags[0].should.have.property('name', 'userName'); - res.tags[0].should.have.property('type'); - res.tags[0].type.should.eql({ - type: 'UnionType', - elements: [{ - type: 'NameExpression', - name: 'string' - }, { - type: 'NameExpression', - name: 'number' - }] - }); - }); - - it('param without braces', function () { - var res = doctrine.parse( - [ - "/**", - " * @param string name description", - "*/" - ].join('\n'), { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'param'); - res.tags[0].should.have.property('name', 'string'); - res.tags[0].should.have.property('type', null); - res.tags[0].should.have.property('description', 'name description'); - }); - - it('param w/ hyphen before description', function () { - var res = doctrine.parse( - [ - "/**", - " * @param {string} name - description", - "*/" - ].join('\n'), { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.eql({ - title: 'param', - type: { - type: 'NameExpression', - name: 'string' - }, - name: 'name', - description: 'description' - }); - }); - - it('param w/ hyphen + leading space before description', function () { - var res = doctrine.parse( - [ - "/**", - " * @param {string} name - description", - "*/" - ].join('\n'), { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.eql({ - title: 'param', - type: { - type: 'NameExpression', - name: 'string' - }, - name: 'name', - description: ' description' - }); - }); - - it('description and param separated by blank line', function () { - var res = doctrine.parse( - [ - "/**", - " * Description", - " * blah blah blah", - " *", - " * @param {string} name description", - "*/" - ].join('\n'), { unwrap: true }); - res.description.should.eql('Description\nblah blah blah'); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'param'); - res.tags[0].should.have.property('name', 'name'); - res.tags[0].should.have.property('type'); - res.tags[0].type.should.eql({ - type: 'NameExpression', - name: 'string' - }); - res.tags[0].should.have.property('description', 'description'); - }); - - it('regular block comment instead of jsdoc-style block comment', function () { - var res = doctrine.parse( - [ - "/*", - " * Description", - " * blah blah blah", - "*/" - ].join('\n'), { unwrap: true }); - res.description.should.eql("Description\nblah blah blah"); - }); - - it('augments', function () { - var res = doctrine.parse('/** @augments */', { unwrap: true }); - res.tags.should.have.length(1); - }); - - it('augments with name', function () { - var res = doctrine.parse('/** @augments ClassName */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'augments'); - res.tags[0].should.have.property('name', 'ClassName'); - }); - - it('augments with type', function () { - var res = doctrine.parse('/** @augments {ClassName} */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'augments'); - res.tags[0].should.have.property('type', { - type: 'NameExpression', - name: 'ClassName' - }); - }); - - it('augments with name', function () { - var res = doctrine.parse('/** @augments ClassName.OK */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'augments'); - res.tags[0].should.have.property('name', 'ClassName.OK'); - }); - - it('extends', function () { - var res = doctrine.parse('/** @extends */', { unwrap: true }); - res.tags.should.have.length(1); - }); - - it('extends with name', function () { - var res = doctrine.parse('/** @extends ClassName */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'extends'); - res.tags[0].should.have.property('name', 'ClassName'); - }); - - it('extends with type', function () { - var res = doctrine.parse('/** @extends {ClassName} */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'extends'); - res.tags[0].should.have.property('type', { - type: 'NameExpression', - name: 'ClassName' - }); - }); - - it('extends with namepath', function () { - var res = doctrine.parse('/** @extends ClassName.OK */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'extends'); - res.tags[0].should.have.property('name', 'ClassName.OK'); - }); - - it('prop', function () { - var res = doctrine.parse( - [ - "/**", - " * @prop {string} thingName - does some stuff", - "*/" - ].join('\n'), { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'prop'); - res.tags[0].should.have.property('description', 'does some stuff'); - res.tags[0].type.should.have.property('name', 'string'); - res.tags[0].should.have.property('name', 'thingName'); - }); - - it('prop without type', function () { - var res = doctrine.parse( - [ - "/**", - " * @prop thingName - does some stuff", - "*/" - ].join('\n'), { unwrap: true }); - res.tags.should.have.length(0); - }); - - - it('property', function () { - var res = doctrine.parse( - [ - "/**", - " * @property {string} thingName - does some stuff", - "*/" - ].join('\n'), { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'property'); - res.tags[0].should.have.property('description', 'does some stuff'); - res.tags[0].type.should.have.property('name', 'string'); - res.tags[0].should.have.property('name', 'thingName'); - }); - - it('property without type', function () { - var res = doctrine.parse( - [ - "/**", - " * @property thingName - does some stuff", - "*/" - ].join('\n'), { unwrap: true }); - res.tags.should.have.length(0); - }); - - it('property with nested name', function () { - var res = doctrine.parse( - [ - "/**", - " * @property {string} thingName.name - does some stuff", - "*/" - ].join('\n'), { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'property'); - res.tags[0].should.have.property('description', 'does some stuff'); - res.tags[0].type.should.have.property('name', 'string'); - res.tags[0].should.have.property('name', 'thingName.name'); - }); - - it('throws', function () { - var res = doctrine.parse( - [ - "/**", - " * @throws {Error} if something goes wrong", - " */" - ].join('\n'), { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'throws'); - res.tags[0].should.have.property('description', 'if something goes wrong'); - res.tags[0].type.should.have.property('name', 'Error'); - }); - - it('throws without type', function () { - var res = doctrine.parse( - [ - "/**", - " * @throws if something goes wrong", - " */" - ].join('\n'), { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'throws'); - res.tags[0].should.have.property('description', 'if something goes wrong'); - }); - - it('kind', function () { - var res = doctrine.parse('/** @kind class */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'kind'); - res.tags[0].should.have.property('kind', 'class'); - }); - - it('kind error', function () { - var res = doctrine.parse('/** @kind ng */', { unwrap: true, recoverable: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('errors'); - res.tags[0].errors.should.have.length(1); - res.tags[0].errors[0].should.equal('Invalid kind name \'ng\''); - }); - - it('todo', function () { - var res = doctrine.parse('/** @todo Write the documentation */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'todo'); - res.tags[0].should.have.property('description', 'Write the documentation'); - }); - - it('summary', function () { - // japanese lang - var res = doctrine.parse('/** @summary ゆるゆり3期おめでとー */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'summary'); - res.tags[0].should.have.property('description', 'ゆるゆり3期おめでとー'); - }); - - it('variation', function () { - // japanese lang - var res = doctrine.parse('/** @variation 42 */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'variation'); - res.tags[0].should.have.property('variation', 42); - }); - - it('variation error', function () { - // japanese lang - var res = doctrine.parse('/** @variation Animation */', { unwrap: true, recoverable: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('errors'); - res.tags[0].errors.should.have.length(1); - res.tags[0].errors[0].should.equal('Invalid variation \'Animation\''); - }); - - it('access', function () { - var res = doctrine.parse('/** @access public */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'access'); - res.tags[0].should.have.property('access', 'public'); - }); - - it('access error', function () { - var res = doctrine.parse('/** @access ng */', { unwrap: true, recoverable: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('errors'); - res.tags[0].errors.should.have.length(1); - res.tags[0].errors[0].should.equal('Invalid access name \'ng\''); - }); - - it('public', function () { - var res = doctrine.parse('/** @public */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'public'); - }); - - it('public type and description', function () { - var res = doctrine.parse('/** @public {number} ok */', { unwrap: true, recoverable: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'public'); - res.tags[0].should.have.property('description', 'ok'); - res.tags[0].should.have.property('type'); - res.tags[0].type.should.eql({ - type: 'NameExpression', - name: 'number' - }); - }); - - it('protected', function () { - var res = doctrine.parse('/** @protected */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'protected'); - }); - - it('protected type and description', function () { - var res = doctrine.parse('/** @protected {number} ok */', { unwrap: true, recoverable: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'protected'); - res.tags[0].should.have.property('description', 'ok'); - res.tags[0].should.have.property('type'); - res.tags[0].type.should.eql({ - type: 'NameExpression', - name: 'number' - }); - }); - - it('private', function () { - var res = doctrine.parse('/** @private */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'private'); - }); - - it('private type and description', function () { - var res = doctrine.parse('/** @private {number} ok */', { unwrap: true, recoverable: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'private'); - res.tags[0].should.have.property('description', 'ok'); - res.tags[0].should.have.property('type'); - res.tags[0].type.should.eql({ - type: 'NameExpression', - name: 'number' - }); - }); - - it('readonly', function () { - var res = doctrine.parse('/** @readonly */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'readonly'); - }); - - it('readonly error', function () { - var res = doctrine.parse('/** @readonly ng */', { unwrap: true, recoverable: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('errors'); - res.tags[0].errors.should.have.length(1); - res.tags[0].errors[0].should.equal('Unknown content \'ng\''); - }); - - it('requires', function () { - var res = doctrine.parse('/** @requires */', { unwrap: true }); - res.tags.should.have.length(0); - }); - - it('requires with module name', function () { - var res = doctrine.parse('/** @requires name.path */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'requires'); - res.tags[0].should.have.property('name', 'name.path'); - }); - - it('global', function () { - var res = doctrine.parse('/** @global */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'global'); - }); - - it('global error', function () { - var res = doctrine.parse('/** @global ng */', { unwrap: true, recoverable: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('errors'); - res.tags[0].errors.should.have.length(1); - res.tags[0].errors[0].should.equal('Unknown content \'ng\''); - }); - - it('inner', function () { - var res = doctrine.parse('/** @inner */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'inner'); - }); - - it('inner error', function () { - var res = doctrine.parse('/** @inner ng */', { unwrap: true, recoverable: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('errors'); - res.tags[0].errors.should.have.length(1); - res.tags[0].errors[0].should.equal('Unknown content \'ng\''); - }); - - it('instance', function () { - var res = doctrine.parse('/** @instance */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'instance'); - }); - - it('instance error', function () { - var res = doctrine.parse('/** @instance ng */', { unwrap: true, recoverable: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('errors'); - res.tags[0].errors.should.have.length(1); - res.tags[0].errors[0].should.equal('Unknown content \'ng\''); - }); - - it('since', function () { - var res = doctrine.parse('/** @since 1.2.1 */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'since'); - res.tags[0].should.have.property('description', '1.2.1'); - }); - - it('static', function () { - var res = doctrine.parse('/** @static */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'static'); - }); - - it('static error', function () { - var res = doctrine.parse('/** @static ng */', { unwrap: true, recoverable: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('errors'); - res.tags[0].errors.should.have.length(1); - res.tags[0].errors[0].should.equal('Unknown content \'ng\''); - }); - - it('this', function () { - var res = doctrine.parse( - [ - "/**", - " * @this thingName", - "*/" - ].join('\n'), { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'this'); - res.tags[0].should.have.property('name', 'thingName'); - }); - - it('this with namepath', function () { - var res = doctrine.parse( - [ - "/**", - " * @this thingName.name", - "*/" - ].join('\n'), { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'this'); - res.tags[0].should.have.property('name', 'thingName.name'); - }); - - it('this error', function () { - var res = doctrine.parse( - [ - "/**", - " * @this", - "*/" - ].join('\n'), { unwrap: true, recoverable: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'this'); - res.tags[0].should.have.property('errors'); - res.tags[0].errors.should.have.length(1); - res.tags[0].errors[0].should.equal('Missing or invalid tag name'); - }); - - it('var', function () { - var res = doctrine.parse('/** @var */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'var'); - }); - - it('var with name', function () { - var res = doctrine.parse('/** @var thingName.name */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'var'); - res.tags[0].should.have.property('name', 'thingName.name'); - }); - - it('var with type', function () { - var res = doctrine.parse('/** @var {Object} thingName.name */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'var'); - res.tags[0].should.have.property('name', 'thingName.name'); - res.tags[0].should.have.property('type'); - res.tags[0].type.should.eql({ - type: 'NameExpression', - name: 'Object' - }); - }); - - it('version', function () { - var res = doctrine.parse('/** @version 1.2.1 */', { unwrap: true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'version'); - res.tags[0].should.have.property('description', '1.2.1'); - }); - - it('incorrect name', function () { - var res = doctrine.parse('/** @name thingName#%name */', { unwrap: true }); - // name does not accept type - res.tags.should.have.length(0); - res.should.eql({ - "description": "", - "tags": [ - ] - }); - }); -}); - -describe('parseType', function () { - it('union type closure-compiler extended', function () { - var type = doctrine.parseType("string|number"); - type.should.eql({ - type: 'UnionType', - elements: [{ - type: 'NameExpression', - name: 'string' - }, { - type: 'NameExpression', - name: 'number' - }] - }); - }); - - it('empty union type', function () { - var type = doctrine.parseType("()"); - type.should.eql({ - type: 'UnionType', - elements: [] - }); - }); - - it('comma last array type', function () { - var type = doctrine.parseType("[string,]"); - type.should.eql({ - type: 'ArrayType', - elements: [{ - type: 'NameExpression', - name: 'string' - }] - }); - }); - - it('array type of all literal', function () { - var type = doctrine.parseType("[*]"); - type.should.eql({ - type: 'ArrayType', - elements: [{ - type: 'AllLiteral' - }] - }); - }); - - it('array type of nullable literal', function () { - var type = doctrine.parseType("[?]"); - type.should.eql({ - type: 'ArrayType', - elements: [{ - type: 'NullableLiteral' - }] - }); - }); - - it('comma last record type', function () { - var type = doctrine.parseType("{,}"); - type.should.eql({ - type: 'RecordType', - fields: [] - }); - }); - - it('type application', function () { - var type = doctrine.parseType("Array."); - type.should.eql({ - type: 'TypeApplication', - expression: { - type: 'NameExpression', - name: 'Array' - }, - applications: [{ - type: 'NameExpression', - name: 'String' - }] - }); - }); - - it('type application with NullableLiteral', function () { - var type = doctrine.parseType("Array"); - type.should.eql({ - type: 'TypeApplication', - expression: { - type: 'NameExpression', - name: 'Array' - }, - applications: [{ - type: 'NullableLiteral' - }] - }); - }); - - it('type application with multiple patterns', function () { - var type = doctrine.parseType("Array."); - type.should.eql({ - type: 'TypeApplication', - expression: { - type: 'NameExpression', - name: 'Array' - }, - applications: [{ - type: 'NameExpression', - name: 'String' - }, { - type: 'NameExpression', - name: 'Number' - }] - }); - }); - - it('type application without dot', function () { - var type = doctrine.parseType("Array"); - type.should.eql({ - type: 'TypeApplication', - expression: { - type: 'NameExpression', - name: 'Array' - }, - applications: [{ - type: 'NameExpression', - name: 'String' - }] - }); - }); - - it('array-style type application', function () { - var type = doctrine.parseType("String[]"); - type.should.eql({ - type: 'TypeApplication', - expression: { - type: 'NameExpression', - name: 'Array' - }, - applications: [{ - type: 'NameExpression', - name: 'String' - }] - }); - }); - - it('function type simple', function () { - var type = doctrine.parseType("function()"); - type.should.eql({ - "type": "FunctionType", - "params": [], - "result": null - }); - }); - - it('function type with name', function () { - var type = doctrine.parseType("function(a)"); - type.should.eql({ - "type": "FunctionType", - "params": [ - { - "type": "NameExpression", - "name": "a" - } - ], - "result": null - }); - }); - it('function type with name and type', function () { - var type = doctrine.parseType("function(a:b)"); - type.should.eql({ - "type": "FunctionType", - "params": [ - { - "type": "ParameterType", - "name": "a", - "expression": { - "type": "NameExpression", - "name": "b" - } - } - ], - "result": null - }); - }); - it('function type with optional param', function () { - var type = doctrine.parseType("function(a=)"); - type.should.eql({ - "type": "FunctionType", - "params": [ - { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "a" - } - } - ], - "result": null - }); - }); - it('function type with optional param name and type', function () { - var type = doctrine.parseType("function(a:b=)"); - type.should.eql({ - "type": "FunctionType", - "params": [ - { - "type": "OptionalType", - "expression": { - "type": "ParameterType", - "name": "a", - "expression": { - "type": "NameExpression", - "name": "b" - } - } - } - ], - "result": null - }); - }); - it('function type with rest param', function () { - var type = doctrine.parseType("function(...a)"); - type.should.eql({ - "type": "FunctionType", - "params": [ - { - "type": "RestType", - "expression": { - "type": "NameExpression", - "name": "a" - } - } - ], - "result": null - }); - }); - it('function type with rest param name and type', function () { - var type = doctrine.parseType("function(...a:b)"); - type.should.eql({ - "type": "FunctionType", - "params": [ - { - "type": "RestType", - "expression": { - "type": "ParameterType", - "name": "a", - "expression": { - "type": "NameExpression", - "name": "b" - } - } - } - ], - "result": null - }); - }); - - it('function type with optional rest param', function () { - var type = doctrine.parseType("function(...a=)"); - type.should.eql({ - "type": "FunctionType", - "params": [ - { - "type": "RestType", - "expression": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "a" - } - } - } - ], - "result": null - }); - }); - it('function type with optional rest param name and type', function () { - var type = doctrine.parseType("function(...a:b=)"); - type.should.eql({ - "type": "FunctionType", - "params": [ - { - "type": "RestType", - "expression": { - "type": "OptionalType", - "expression": { - "type": "ParameterType", - "name": "a", - "expression": { - "type": "NameExpression", - "name": "b" - } - } - } - }], - "result": null - }); - }); - - it('string value in type', function () { - var type; - - type = doctrine.parseType("{'ok':String}"); - type.should.eql({ - "fields": [ - { - "key": "ok", - "type": "FieldType", - "value": { - "name": "String", - "type": "NameExpression" - } - } - ], - "type": "RecordType" - }); - - type = doctrine.parseType('{"\\r\\n\\t\\u2028\\x20\\u20\\b\\f\\v\\\r\n\\\n\\0\\07\\012\\o":String}'); - type.should.eql({ - "fields": [ - { - "key": "\r\n\t\u2028\x20u20\b\f\v\0\u0007\u000ao", - "type": "FieldType", - "value": { - "name": "String", - "type": "NameExpression" - } - } - ], - "type": "RecordType" - }); - - doctrine.parseType.bind(doctrine, "{'ok\":String}").should.throw('unexpected quote'); - doctrine.parseType.bind(doctrine, "{'o\n':String}").should.throw('unexpected quote'); - }); - - it('number value in type', function () { - var type; - - type = doctrine.parseType("{20:String}"); - type.should.eql({ - "fields": [ - { - "key": "20", - "type": "FieldType", - "value": { - "name": "String", - "type": "NameExpression" - } - } - ], - "type": "RecordType" - }); - - type = doctrine.parseType("{.2:String, 30:Number, 0x20:String}"); - type.should.eql({ - "fields": [ - { - "key": "0.2", - "type": "FieldType", - "value": { - "name": "String", - "type": "NameExpression" - } - }, - { - "key": "30", - "type": "FieldType", - "value": { - "name": "Number", - "type": "NameExpression" - } - }, - { - "key": "32", - "type": "FieldType", - "value": { - "name": "String", - "type": "NameExpression" - } - } - ], - "type": "RecordType" - }); - - - type = doctrine.parseType("{0X2:String, 0:Number, 100e200:String, 10e-20:Number}"); - type.should.eql({ - "fields": [ - { - "key": "2", - "type": "FieldType", - "value": { - "name": "String", - "type": "NameExpression" - } - }, - { - "key": "0", - "type": "FieldType", - "value": { - "name": "Number", - "type": "NameExpression" - } - }, - { - "key": "1e+202", - "type": "FieldType", - "value": { - "name": "String", - "type": "NameExpression" - } - }, - { - "key": "1e-19", - "type": "FieldType", - "value": { - "name": "Number", - "type": "NameExpression" - } - } - ], - "type": "RecordType" - }); - - - doctrine.parseType.bind(doctrine, "{0x:String}").should.throw('unexpected token'); - doctrine.parseType.bind(doctrine, "{0x").should.throw('unexpected token'); - doctrine.parseType.bind(doctrine, "{0xd").should.throw('unexpected token'); - doctrine.parseType.bind(doctrine, "{0x2_:").should.throw('unexpected token'); - doctrine.parseType.bind(doctrine, "{021:").should.throw('unexpected token'); - doctrine.parseType.bind(doctrine, "{021_:").should.throw('unexpected token'); - doctrine.parseType.bind(doctrine, "{021").should.throw('unexpected token'); - doctrine.parseType.bind(doctrine, "{08").should.throw('unexpected token'); - doctrine.parseType.bind(doctrine, "{0y").should.throw('unexpected token'); - doctrine.parseType.bind(doctrine, "{0").should.throw('unexpected token'); - doctrine.parseType.bind(doctrine, "{100e2").should.throw('unexpected token'); - doctrine.parseType.bind(doctrine, "{100e-2").should.throw('unexpected token'); - doctrine.parseType.bind(doctrine, "{100e-200:").should.throw('unexpected token'); - doctrine.parseType.bind(doctrine, "{100e:").should.throw('unexpected token'); - doctrine.parseType.bind(doctrine, "function(number=, string)").should.throw('not reach to EOF'); - }); - - it('dotted type', function () { - var type; - type = doctrine.parseType("Cocoa.Cappuccino"); - type.should.eql({ - "name": "Cocoa.Cappuccino", - "type": "NameExpression" - }); - }); - - it('rest array type', function () { - var type; - type = doctrine.parseType("[string,...string]"); - type.should.eql({ - "elements": [ - { - "name": "string", - "type": "NameExpression" - }, - { - "expression": { - "name": "string", - "type": "NameExpression" - }, - "type": "RestType" - } - ], - "type": "ArrayType" - }); - }); - - it ('nullable type', function () { - var type; - type = doctrine.parseType("string?"); - type.should.eql({ - "expression": { - "name": "string", - "type": "NameExpression" - }, - "prefix": false, - "type": "NullableType" - }); - }); - - it ('non-nullable type', function () { - var type; - type = doctrine.parseType("string!"); - type.should.eql({ - "expression": { - "name": "string", - "type": "NameExpression" - }, - "prefix": false, - "type": "NonNullableType" - }); - }); - - it ('toplevel multiple pipe type', function () { - var type; - type = doctrine.parseType("string|number|Test"); - type.should.eql({ - "elements": [ - { - "name": "string", - "type": "NameExpression" - }, - { - "name": "number", - "type": "NameExpression" - }, - { - "name": "Test", - "type": "NameExpression" - } - ], - "type": "UnionType" - }); - }); - - it('illegal tokens', function () { - doctrine.parseType.bind(doctrine, ".").should.throw('unexpected token'); - doctrine.parseType.bind(doctrine, ".d").should.throw('unexpected token'); - doctrine.parseType.bind(doctrine, "(").should.throw('unexpected token'); - doctrine.parseType.bind(doctrine, "Test.").should.throw('unexpected token'); - }); -}); - -describe('parseParamType', function () { - it('question', function () { - var type = doctrine.parseParamType("?"); - type.should.eql({ - type: 'NullableLiteral' - }); - }); - - it('question option', function () { - var type = doctrine.parseParamType("?="); - type.should.eql({ - type: 'OptionalType', - expression: { - type: 'NullableLiteral' - } - }); - }); - - it('function option parameters former', function () { - var type = doctrine.parseParamType("function(?, number)"); - type.should.eql({ - type: 'FunctionType', - params: [{ - type: 'NullableLiteral' - }, { - type: 'NameExpression', - name: 'number' - }], - result: null - }); - }); - - it('function option parameters latter', function () { - var type = doctrine.parseParamType("function(number, ?)"); - type.should.eql({ - type: 'FunctionType', - params: [{ - type: 'NameExpression', - name: 'number' - }, { - type: 'NullableLiteral' - }], - result: null - }); - }); - - it('function type union', function () { - var type = doctrine.parseParamType("function(): ?|number"); - type.should.eql({ - type: 'UnionType', - elements: [{ - type: 'FunctionType', - params: [], - result: { - type: 'NullableLiteral' - } - }, { - type: 'NameExpression', - name: 'number' - }] - }); - }); -}); - -describe('invalid', function () { - it('empty union pipe', function () { - doctrine.parseType.bind(doctrine, "(|)").should.throw(); - doctrine.parseType.bind(doctrine, "(string|)").should.throw(); - doctrine.parseType.bind(doctrine, "(string||)").should.throw(); - }); - - it('comma only array type', function () { - doctrine.parseType.bind(doctrine, "[,]").should.throw(); - }); - - it('comma only record type', function () { - doctrine.parseType.bind(doctrine, "{,,}").should.throw(); - }); - - it('incorrect bracket', function () { - doctrine.parseParamType.bind(doctrine, "int[").should.throw(); - }); -}); - -describe('tags option', function() { - it ('only param', function() { - var res = doctrine.parse( - [ - "/**", - " * @const @const", - " * @param {String} y", - " */" - ].join('\n'), { tags: ['param'], unwrap:true }); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'param'); - res.tags[0].should.have.property('name', 'y'); - }); - - it ('param and type', function() { - var res = doctrine.parse( - [ - "/**", - " * @const x", - " * @param {String} y", - " * @type {String} ", - " */" - ].join('\n'), { tags: ['param', 'type'], unwrap:true }); - res.tags.should.have.length(2); - res.tags[0].should.have.property('title', 'param'); - res.tags[0].should.have.property('name', 'y'); - res.tags[1].should.have.property('title', 'type'); - res.tags[1].should.have.property('type'); - res.tags[1].type.should.have.property('name', 'String'); - }); - -}); - -describe('invalid tags', function() { - it ('bad tag 1', function() { - doctrine.parse.bind(doctrine, - [ - "/**", - " * @param {String} hucairz", - " */" - ].join('\n'), { tags: 1, unwrap:true }).should.throw(); - }); - - it ('bad tag 2', function() { - doctrine.parse.bind(doctrine, - [ - "/**", - " * @param {String} hucairz", - " */" - ].join('\n'), { tags: ['a', 1], unwrap:true }).should.throw(); - }); -}); - -describe('optional params', function() { - - // should fail since sloppy option not set - it('failure 0', function() { - doctrine.parse( - ["/**", " * @param {String} [val]", " */"].join('\n'), { - unwrap: true - }).should.eql({ - "description": "", - "tags": [] - }); - }); - - it('failure 1', function() { - doctrine.parse( - ["/**", " * @param [val", " */"].join('\n'), { - unwrap: true, sloppy: true - }).should.eql({ - "description": "", - "tags": [] - }); - }); - - it('success 1', function() { - doctrine.parse( - ["/**", " * @param {String} [val]", " */"].join('\n'), { - unwrap: true, sloppy: true - }).should.eql({ - "description": "", - "tags": [{ - "title": "param", - "description": null, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "String" - } - }, - "name": "val" - }] - }); - }); - it('success 2', function() { - doctrine.parse( - ["/**", " * @param {String=} val", " */"].join('\n'), { - unwrap: true, sloppy: true - }).should.eql({ - "description": "", - "tags": [{ - "title": "param", - "description": null, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "String" - } - }, - "name": "val" - }] - }); - }); - - it('success 3', function() { - doctrine.parse( - ["/**", " * @param {String=} [val=abc] some description", " */"].join('\n'), - { unwrap: true, sloppy: true} - ).should.eql({ - "description": "", - "tags": [{ - "title": "param", - "description": "some description", - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "String" - } - }, - "name": "val", - "default": "abc" - }] - }); - }); - - it('line numbers', function() { - var res = doctrine.parse( - [ - "/**", - " * @param {string} foo", - " * @returns {string}", - " *", - " * @example", - " * f('blah'); // => undefined", - " */" - ].join('\n'), - { unwrap: true, lineNumbers: true } - ); - - res.tags[0].should.have.property('lineNumber', 1); - res.tags[1].should.have.property('lineNumber', 2); - res.tags[2].should.have.property('lineNumber', 4); - }); - - it('should handle \\r\\n line endings correctly', function() { - var res = doctrine.parse( - [ - "/**", - " * @param {string} foo", - " * @returns {string}", - " *", - " * @example", - " * f('blah'); // => undefined", - " */" - ].join('\r\n'), - { unwrap: true, lineNumbers: true } - ); - - res.tags[0].should.have.property('lineNumber', 1); - res.tags[1].should.have.property('lineNumber', 2); - res.tags[2].should.have.property('lineNumber', 4); - }); -}); - -describe('recovery tests', function() { - it ('params 2', function () { - var res = doctrine.parse( - [ - "@param f", - "@param {string} f2" - ].join('\n'), { recoverable: true }); - - // ensure both parameters are OK - res.tags.should.have.length(2); - res.tags[0].should.have.property('title', 'param'); - res.tags[0].should.have.property('type', null); - res.tags[0].should.have.property('name', 'f'); - - res.tags[1].should.have.property('title', 'param'); - res.tags[1].should.have.property('type'); - res.tags[1].type.should.have.property('name', 'string'); - res.tags[1].type.should.have.property('type', 'NameExpression'); - res.tags[1].should.have.property('name', 'f2'); - }); - - it ('params 2', function () { - var res = doctrine.parse( - [ - "@param string f", - "@param {string} f2" - ].join('\n'), { recoverable: true }); - - // ensure first parameter is OK even with invalid type name - res.tags.should.have.length(2); - res.tags[0].should.have.property('title', 'param'); - res.tags[0].should.have.property('type', null); - res.tags[0].should.have.property('name', 'string'); - res.tags[0].should.have.property('description', 'f'); - - res.tags[1].should.have.property('title', 'param'); - res.tags[1].should.have.property('type'); - res.tags[1].type.should.have.property('name', 'string'); - res.tags[1].type.should.have.property('type', 'NameExpression'); - res.tags[1].should.have.property('name', 'f2'); - }); - - it ('return 1', function() { - var res = doctrine.parse( - [ - "@returns" - ].join('\n'), { recoverable: true }); - - // return tag should exist - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'returns'); - res.tags[0].should.have.property('type', null); - }); - it ('return 2', function() { - var res = doctrine.parse( - [ - "@returns", - "@param {string} f2" - ].join('\n'), { recoverable: true }); - - // return tag should exist as well as next tag - res.tags.should.have.length(2); - res.tags[0].should.have.property('title', 'returns'); - res.tags[0].should.have.property('type', null); - - res.tags[1].should.have.property('title', 'param'); - res.tags[1].should.have.property('type'); - res.tags[1].type.should.have.property('name', 'string'); - res.tags[1].type.should.have.property('type', 'NameExpression'); - res.tags[1].should.have.property('name', 'f2'); - }); - - it ('extra @ 1', function() { - var res = doctrine.parse( - [ - "@", - "@returns", - "@param {string} f2" - ].join('\n'), { recoverable: true }); - - // empty tag name shouldn't affect subsequent tags - res.tags.should.have.length(3); - res.tags[0].should.have.property('title', ''); - res.tags[0].should.not.have.property('type'); - - res.tags[1].should.have.property('title', 'returns'); - res.tags[1].should.have.property('type', null); - - res.tags[2].should.have.property('title', 'param'); - res.tags[2].should.have.property('type'); - res.tags[2].type.should.have.property('name', 'string'); - res.tags[2].type.should.have.property('type', 'NameExpression'); - res.tags[2].should.have.property('name', 'f2'); - }); - - it ('extra @ 2', function() { - var res = doctrine.parse( - [ - "@ invalid name", - "@param {string} f2" - ].join('\n'), { recoverable: true }); - - // empty tag name shouldn't affect subsequent tags - res.tags.should.have.length(2); - res.tags[0].should.have.property('title', ''); - res.tags[0].should.not.have.property('type'); - res.tags[0].should.not.have.property('name'); - res.tags[0].should.have.property('description', 'invalid name'); - - res.tags[1].should.have.property('title', 'param'); - res.tags[1].should.have.property('type'); - res.tags[1].type.should.have.property('name', 'string'); - res.tags[1].type.should.have.property('type', 'NameExpression'); - res.tags[1].should.have.property('name', 'f2'); - }); - - it ('invalid tag 1', function() { - var res = doctrine.parse( - [ - "@111 invalid name", - "@param {string} f2" - ].join('\n'), { recoverable: true }); - - // invalid tag name shouldn't affect subsequent tags - res.tags.should.have.length(2); - res.tags[0].should.have.property('title', '111'); - res.tags[0].should.not.have.property('type'); - res.tags[0].should.not.have.property('name'); - res.tags[0].should.have.property('description', 'invalid name'); - - res.tags[1].should.have.property('title', 'param'); - res.tags[1].should.have.property('type'); - res.tags[1].type.should.have.property('name', 'string'); - res.tags[1].type.should.have.property('type', 'NameExpression'); - res.tags[1].should.have.property('name', 'f2'); - }); - - it ('invalid tag 1', function() { - var res = doctrine.parse( - [ - "@111", - "@param {string} f2" - ].join('\n'), { recoverable: true }); - - // invalid tag name shouldn't affect subsequent tags - res.tags.should.have.length(2); - res.tags[0].should.have.property('title', '111'); - res.tags[0].should.not.have.property('type'); - res.tags[0].should.not.have.property('name'); - res.tags[0].should.have.property('description', null); - - res.tags[1].should.have.property('title', 'param'); - res.tags[1].should.have.property('type'); - res.tags[1].type.should.have.property('name', 'string'); - res.tags[1].type.should.have.property('type', 'NameExpression'); - res.tags[1].should.have.property('name', 'f2'); - }); - - it ('should not crash on bad type in @param without name', function() { - var res = doctrine.parse("@param {Function(DOMNode)}", { recoverable: true }); - res.tags.should.have.length(1); - res.tags[0].should.eql({ - "description": null, - "errors": [ - "not reach to EOF", - "Missing or invalid tag name" - ], - "name": null, - "title": "param", - "type": null - }); - }); - - it ('should not crash on bad type in @param in sloppy mode', function() { - var res = doctrine.parse("@param {int[} [x]", { sloppy: true, recoverable: true }); - res.tags.should.have.length(1); - res.tags[0].should.eql({ - "description": null, - "errors": [ - "expected an array-style type declaration (int[])" - ], - "name": "x", - "title": "param", - "type": null - }); - }); -}); - -describe('exported Syntax', function() { - it ('members', function () { - doctrine.Syntax.should.eql({ - NullableLiteral: 'NullableLiteral', - AllLiteral: 'AllLiteral', - NullLiteral: 'NullLiteral', - UndefinedLiteral: 'UndefinedLiteral', - VoidLiteral: 'VoidLiteral', - UnionType: 'UnionType', - ArrayType: 'ArrayType', - RecordType: 'RecordType', - FieldType: 'FieldType', - FunctionType: 'FunctionType', - ParameterType: 'ParameterType', - RestType: 'RestType', - NonNullableType: 'NonNullableType', - OptionalType: 'OptionalType', - NullableType: 'NullableType', - NameExpression: 'NameExpression', - TypeApplication: 'TypeApplication' - }); - }); -}); - -describe('@ mark contained descriptions', function () { - it ('comment description #10', function () { - doctrine.parse( - [ - '/**', - ' * Prevents the default action. It is equivalent to', - ' * {@code e.preventDefault()}, but can be used as the callback argument of', - ' * {@link goog.events.listen} without declaring another function.', - ' * @param {!goog.events.Event} e An event.', - ' */' - ].join('\n'), - { unwrap: true, sloppy: true }).should.eql({ - 'description': 'Prevents the default action. It is equivalent to\n{@code e.preventDefault()}, but can be used as the callback argument of\n{@link goog.events.listen} without declaring another function.', - 'tags': [{ - 'title': 'param', - 'description': 'An event.', - 'type': { - 'type': 'NonNullableType', - 'expression': { - 'type': 'NameExpression', - 'name': 'goog.events.Event' - }, - 'prefix': true - }, - 'name': 'e' - }] - }); - }); - - it ('tag description', function () { - doctrine.parse( - [ - '/**', - ' * Prevents the default action. It is equivalent to', - ' * @param {!goog.events.Event} e An event.', - ' * {@code e.preventDefault()}, but can be used as the callback argument of', - ' * {@link goog.events.listen} without declaring another function.', - ' */' - ].join('\n'), - { unwrap: true, sloppy: true }).should.eql({ - 'description': 'Prevents the default action. It is equivalent to', - 'tags': [{ - 'title': 'param', - 'description': 'An event.\n{@code e.preventDefault()}, but can be used as the callback argument of\n{@link goog.events.listen} without declaring another function.', - 'type': { - 'type': 'NonNullableType', - 'expression': { - 'type': 'NameExpression', - 'name': 'goog.events.Event' - }, - 'prefix': true - }, - 'name': 'e' - }] - }); - }); -}); - -describe('function', function () { - it ('recognize "function" type', function () { - var res = doctrine.parse( - [ - "@param {function} foo description", - ].join('\n'), {}); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'param'); - res.tags[0].should.have.property('type'); - res.tags[0].type.should.eql({ - "name": "function", - "type": "NameExpression" - }); - res.tags[0].should.have.property('name', 'foo'); - res.tags[0].should.have.property('description', 'description'); - }); -}); - -describe('tagged namepaths', function () { - it ('recognize module:', function () { - var res = doctrine.parse( - [ - "@alias module:Foo.bar" - ].join('\n'), {}); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'alias'); - res.tags[0].should.have.property('name', 'module:Foo.bar'); - res.tags[0].should.have.property('description', null); - }); - - it ('recognize external:', function () { - var res = doctrine.parse( - [ - "@param {external:Foo.bar} baz description" - ].join('\n'), {}); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'param'); - res.tags[0].type.should.eql({ - "name": "external:Foo.bar", - "type": "NameExpression" - }); - res.tags[0].should.have.property('name', 'baz'); - res.tags[0].should.have.property('description', 'description'); - }); - - it ('recognize event:', function () { - var res = doctrine.parse( - [ - "@function event:Foo.bar" - ].join('\n'), {}); - res.tags.should.have.length(1); - res.tags[0].should.have.property('title', 'function'); - res.tags[0].should.have.property('name', 'event:Foo.bar'); - res.tags[0].should.have.property('description', null); - }); - - it ('invalid bogus:', function () { - var res = doctrine.parse( - [ - "@method bogus:Foo.bar" - ].join('\n'), {}); - res.tags.should.have.length(0); - }); -}); - -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/eslint/node_modules/doctrine/test/strict.js b/tools/eslint/node_modules/doctrine/test/strict.js deleted file mode 100644 index f6008d52f91f56..00000000000000 --- a/tools/eslint/node_modules/doctrine/test/strict.js +++ /dev/null @@ -1,168 +0,0 @@ -/* - Copyright (C) 2014 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/*global require describe it*/ -/*jslint node:true */ -'use strict'; - -var fs = require('fs'), - path = require('path'), - root = path.join(path.dirname(fs.realpathSync(__filename)), '..'), - doctrine = require(root); -require('should'); - -describe('strict parse', function () { - // https://github.com/Constellation/doctrine/issues/21 - it('unbalanced braces', function () { - (function () { - doctrine.parse( - [ - "/**", - " * @param {const", - " */" - ].join('\n'), { unwrap: true, strict: true }); - }).should.throw('Braces are not balanced'); - - (function () { - doctrine.parse( - [ - "/**", - " * @param {const", - " */" - ].join('\n'), { unwrap: true }); - }).should.not.throw(); - - (function () { - doctrine.parse( - [ - "/**", - " * Description", - " * @param {string name Param description", - " * @param {int} foo Bar", - " */" - ].join('\n'), { unwrap: true, strict: true }); - }).should.throw('Braces are not balanced'); - - (function () { - doctrine.parse( - [ - "/**", - " * Description", - " * @param {string name Param description", - " * @param {int} foo Bar", - " */" - ].join('\n'), { unwrap: true }); - }).should.not.throw(); - - (function () { - doctrine.parse( - [ - "/**", - " * Description", - " * @returns {int", - " */" - ].join('\n'), { unwrap: true, strict: true }); - }).should.throw('Braces are not balanced'); - - (function () { - doctrine.parse( - [ - "/**", - " * Description", - " * @returns {int", - " */" - ].join('\n'), { unwrap: true }); - }).should.not.throw(); - }); - - // https://github.com/Constellation/doctrine/issues/21 - it('incorrect tag starting with @@', function () { - (function () { - doctrine.parse( - [ - "/**", - " * @@version", - " */" - ].join('\n'), { unwrap: true, strict: true }); - }).should.throw('Missing or invalid title'); - - (function () { - doctrine.parse( - [ - "/**", - " * @@version", - " */" - ].join('\n'), { unwrap: true }); - }).should.not.throw(); - - (function () { - doctrine.parse( - [ - "/**", - " * Description", - " * @@param {string} name Param description", - " */" - ].join('\n'), { unwrap: true, strict: true }); - }).should.throw('Missing or invalid title'); - - (function () { - doctrine.parse( - [ - "/**", - " * Description", - " * @@param {string} name Param description", - " */" - ].join('\n'), { unwrap: true }); - }).should.not.throw(); - - (function () { - doctrine.parse( - [ - "/**", - " * Description", - " * @kind ng", - " */" - ].join('\n'), { unwrap: true, strict: true }); - }).should.throw('Invalid kind name \'ng\''); - - (function () { - doctrine.parse( - [ - "/**", - " * Description", - " * @variation Animation", - " */" - ].join('\n'), { unwrap: true, strict: true }); - }).should.throw('Invalid variation \'Animation\''); - - (function () { - doctrine.parse( - [ - "/**", - " * Description", - " * @access ng", - " */" - ].join('\n'), { unwrap: true, strict: true }); - }).should.throw('Invalid access name \'ng\''); - }); -}); diff --git a/tools/eslint/node_modules/doctrine/test/stringify.js b/tools/eslint/node_modules/doctrine/test/stringify.js deleted file mode 100644 index 0f3a43ed83e8bd..00000000000000 --- a/tools/eslint/node_modules/doctrine/test/stringify.js +++ /dev/null @@ -1,413 +0,0 @@ -/* - Copyright (C) 2013 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/*global require describe it*/ -/*jslint node:true */ -'use strict'; - -var fs = require('fs'), - path = require('path'), - root = path.join(path.dirname(fs.realpathSync(__filename)), '..'), - doctrine = require(root), - assert = require('assert'); -require('should'); - -// tests for the stringify function. -// ensure that we can parse and then stringify and the results are identical -describe('stringify', function () { - - function testStringify(text) { - it (text, function() { - var result = doctrine.parse("@param {" + text + "} name"); - // console.log("Parse Tree: " + JSON.stringify(result, null, " ")); - var stringed = doctrine.type.stringify(result.tags[0].type, {compact:true}); - stringed.should.equal(text); - }); - } - - // simple - testStringify("String"); - testStringify("*"); - testStringify("null"); - testStringify("undefined"); - testStringify("void"); - //testStringify("?="); // Failing - - // rest - testStringify("...string"); - testStringify("...[string]"); - testStringify("...[[string]]"); - - // optional, nullable, nonnullable - testStringify("string="); - testStringify("?string"); - testStringify("!string"); - testStringify("!string="); - - // type applications - testStringify("Array."); - testStringify("Array."); - - // union types - testStringify("()"); - testStringify("(String|Number)"); - - // Arrays - testStringify("[String]"); - testStringify("[String,Number]"); - testStringify("[(String|Number)]"); - - // Record types - testStringify("{a}"); - testStringify("{a:String}"); - testStringify("{a:String,b}"); - testStringify("{a:String,b:object}"); - testStringify("{a:String,b:foo.bar.baz}"); - testStringify("{a:(String|Number),b,c:Array.}"); - testStringify("...{a:(String|Number),b,c:Array.}"); - testStringify("{a:(String|Number),b,c:Array.}="); - - // fn types - testStringify("function(a)"); - testStringify("function(a):String"); - testStringify("function(a:number):String"); - testStringify("function(a:number,b:Array.<(String|Number|Object)>):String"); - testStringify("function(a:number,callback:function(a:Array.<(String|Number|Object)>):boolean):String"); - testStringify("function(a:(string|number),this:string,new:true):function():number"); - testStringify("function(a:(string|number),this:string,new:true):function(a:function(val):result):number"); -}); - -describe('literals', function() { - it('NullableLiteral', function () { - doctrine.type.stringify({ - type: doctrine.Syntax.NullableLiteral - }).should.equal('?'); - }); - - it('AllLiteral', function () { - doctrine.type.stringify({ - type: doctrine.Syntax.AllLiteral - }).should.equal('*'); - }); - - it('NullLiteral', function () { - doctrine.type.stringify({ - type: doctrine.Syntax.NullLiteral - }).should.equal('null'); - }); - - it('UndefinedLiteral', function () { - doctrine.type.stringify({ - type: doctrine.Syntax.UndefinedLiteral - }).should.equal('undefined'); - }); -}); - -describe('Expression', function () { - it('NameExpression', function () { - doctrine.type.stringify({ - type: doctrine.Syntax.NameExpression, - name: 'this.is.valid' - }).should.equal('this.is.valid'); - - doctrine.type.stringify({ - type: doctrine.Syntax.NameExpression, - name: 'String' - }).should.equal('String'); - }); - - it('ArrayType', function () { - doctrine.type.stringify({ - type: doctrine.Syntax.ArrayType, - elements: [{ - type: doctrine.Syntax.NameExpression, - name: 'String' - }] - }).should.equal('[String]'); - - doctrine.type.stringify({ - type: doctrine.Syntax.ArrayType, - elements: [{ - type: doctrine.Syntax.NameExpression, - name: 'String' - }, { - type: doctrine.Syntax.NameExpression, - name: 'Number' - }] - }).should.equal('[String, Number]'); - - doctrine.type.stringify({ - type: doctrine.Syntax.ArrayType, - elements: [] - }).should.equal('[]'); - }); - - it('RecordType', function () { - doctrine.type.stringify({ - type: doctrine.Syntax.RecordType, - fields: [{ - type: doctrine.Syntax.FieldType, - key: 'name', - value: null - }] - }).should.equal('{name}'); - - doctrine.type.stringify({ - type: doctrine.Syntax.RecordType, - fields: [{ - type: doctrine.Syntax.FieldType, - key: 'name', - value: { - type: doctrine.Syntax.NameExpression, - name: 'String' - } - }] - }).should.equal('{name: String}'); - - doctrine.type.stringify({ - type: doctrine.Syntax.RecordType, - fields: [{ - type: doctrine.Syntax.FieldType, - key: 'string', - value: { - type: doctrine.Syntax.NameExpression, - name: 'String' - } - }, { - type: doctrine.Syntax.FieldType, - key: 'number', - value: { - type: doctrine.Syntax.NameExpression, - name: 'Number' - } - }] - }).should.equal('{string: String, number: Number}'); - - doctrine.type.stringify({ - type: doctrine.Syntax.RecordType, - fields: [] - }).should.equal('{}'); - }); - - it('UnionType', function () { - doctrine.type.stringify({ - type: doctrine.Syntax.UnionType, - elements: [{ - type: doctrine.Syntax.NameExpression, - name: 'String' - }] - }).should.equal('(String)'); - - doctrine.type.stringify({ - type: doctrine.Syntax.UnionType, - elements: [{ - type: doctrine.Syntax.NameExpression, - name: 'String' - }, { - type: doctrine.Syntax.NameExpression, - name: 'Number' - }] - }).should.equal('(String|Number)'); - - doctrine.type.stringify({ - type: doctrine.Syntax.UnionType, - elements: [{ - type: doctrine.Syntax.NameExpression, - name: 'String' - }, { - type: doctrine.Syntax.NameExpression, - name: 'Number' - }] - }, { topLevel: true }).should.equal('String|Number'); - }); - - it('RestType', function () { - doctrine.type.stringify({ - type: doctrine.Syntax.RestType, - expression: { - type: doctrine.Syntax.NameExpression, - name: 'String' - } - }).should.equal('...String'); - }); - - it('NonNullableType', function () { - doctrine.type.stringify({ - type: doctrine.Syntax.NonNullableType, - expression: { - type: doctrine.Syntax.NameExpression, - name: 'String' - }, - prefix: true - }).should.equal('!String'); - - doctrine.type.stringify({ - type: doctrine.Syntax.NonNullableType, - expression: { - type: doctrine.Syntax.NameExpression, - name: 'String' - }, - prefix: false - }).should.equal('String!'); - }); - - it('OptionalType', function () { - doctrine.type.stringify({ - type: doctrine.Syntax.OptionalType, - expression: { - type: doctrine.Syntax.NameExpression, - name: 'String' - } - }).should.equal('String='); - }); - - it('NullableType', function () { - doctrine.type.stringify({ - type: doctrine.Syntax.NullableType, - expression: { - type: doctrine.Syntax.NameExpression, - name: 'String' - }, - prefix: true - }).should.equal('?String'); - - doctrine.type.stringify({ - type: doctrine.Syntax.NullableType, - expression: { - type: doctrine.Syntax.NameExpression, - name: 'String' - }, - prefix: false - }).should.equal('String?'); - }); - - it('TypeApplication', function () { - doctrine.type.stringify({ - type: doctrine.Syntax.TypeApplication, - expression: { - type: doctrine.Syntax.NameExpression, - name: 'Array' - }, - applications: [ - { - type: doctrine.Syntax.NameExpression, - name: 'String' - } - ] - }).should.equal('Array.'); - - doctrine.type.stringify({ - type: doctrine.Syntax.TypeApplication, - expression: { - type: doctrine.Syntax.NameExpression, - name: 'Array' - }, - applications: [ - { - type: doctrine.Syntax.NameExpression, - name: 'String' - }, - { - type: doctrine.Syntax.AllLiteral - } - ] - }).should.equal('Array.'); - }); -}); - -describe('Complex identity', function () { - it('Functions', function () { - var data01 = 'function (): void'; - doctrine.type.stringify( - doctrine.type.parseType(data01) - ).should.equal(data01); - - var data02 = 'function (): String'; - doctrine.type.stringify( - doctrine.type.parseType(data02) - ).should.equal(data02); - - var data03 = 'function (test: string): String'; - doctrine.type.stringify( - doctrine.type.parseType(data03) - ).should.equal(data03); - - var data04 = 'function (this: Date, test: String): String'; - doctrine.type.stringify( - doctrine.type.parseType(data04) - ).should.equal(data04); - - var data05 = 'function (this: Date, a: String, b: Number): String'; - doctrine.type.stringify( - doctrine.type.parseType(data05) - ).should.equal(data05); - - var data06 = 'function (this: Date, a: Array., b: Number): String'; - doctrine.type.stringify( - doctrine.type.parseType(data06) - ).should.equal(data06); - - var data07 = 'function (new: Date, a: Array., b: Number): HashMap.'; - doctrine.type.stringify( - doctrine.type.parseType(data07) - ).should.equal(data07); - - var data08 = 'function (new: Date, a: Array., b: (Number|String|Date)): HashMap.'; - doctrine.type.stringify( - doctrine.type.parseType(data08) - ).should.equal(data08); - - var data09 = 'function (new: Date)'; - doctrine.type.stringify( - doctrine.type.parseType(data09) - ).should.equal(data09); - - var data10 = 'function (this: Date)'; - doctrine.type.stringify( - doctrine.type.parseType(data10) - ).should.equal(data10); - - var data11 = 'function (this: Date, ...list)'; - doctrine.type.stringify( - doctrine.type.parseType(data11) - ).should.equal(data11); - - var data11a = 'function (this: Date, test: String=)'; - doctrine.type.stringify( - doctrine.type.parseType(data11a) - ).should.equal(data11a); - - // raw ... are not supported -// var data12 = 'function (this: Date, ...)'; -// doctrine.type.stringify( -// doctrine.type.parseType(data12) -// ).should.equal(data12); - - var data12a = 'function (this: Date, ?=)'; - doctrine.type.stringify( - doctrine.type.parseType(data12a) - ).should.equal(data12a); - }); -}); - -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/eslint/node_modules/doctrine/test/test.html b/tools/eslint/node_modules/doctrine/test/test.html deleted file mode 100644 index 3784c2e5e4e1b6..00000000000000 --- a/tools/eslint/node_modules/doctrine/test/test.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - -Doctrine trying - - - - - -
      -
      - -
      -
      -

      Parse Tree

      -
      
      -	

      Stringified

      -
      
      -
      -
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/doctrine/test/unwrap.js b/tools/eslint/node_modules/doctrine/test/unwrap.js
      deleted file mode 100644
      index 03d6f6dfe5833f..00000000000000
      --- a/tools/eslint/node_modules/doctrine/test/unwrap.js
      +++ /dev/null
      @@ -1,60 +0,0 @@
      -/*
      -  Copyright (C) 2012 Yusuke Suzuki 
      -
      -  Redistribution and use in source and binary forms, with or without
      -  modification, are permitted provided that the following conditions are met:
      -
      -    * Redistributions of source code must retain the above copyright
      -      notice, this list of conditions and the following disclaimer.
      -    * Redistributions in binary form must reproduce the above copyright
      -      notice, this list of conditions and the following disclaimer in the
      -      documentation and/or other materials provided with the distribution.
      -
      -  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
      -  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      -  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      -  ARE DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
      -  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
      -  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
      -  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      -  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      -  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
      -  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      -*/
      -
      -/*jslint node:true */
      -'use strict';
      -
      -var fs = require('fs'),
      -    path = require('path'),
      -    root = path.join(path.dirname(fs.realpathSync(__filename)), '..'),
      -    doctrine = require(root);
      -require('should');
      -
      -describe('unwrapComment', function () {
      -  it('normal', function () {
      -    doctrine.unwrapComment('/**\n * @const\n * @const\n */').should.equal('\n@const\n@const\n');
      -  });
      -
      -  it('single', function () {
      -    doctrine.unwrapComment('/**x*/').should.equal('x');
      -  });
      -
      -  it('more stars', function () {
      -    doctrine.unwrapComment('/***x*/').should.equal('x');
      -    doctrine.unwrapComment('/****x*/').should.equal('*x');
      -  });
      -
      -  it('2 lines', function () {
      -    doctrine.unwrapComment('/**x\n * y\n*/').should.equal('x\ny\n');
      -  });
      -
      -  it('2 lines with space', function () {
      -    doctrine.unwrapComment('/**x\n *    y\n*/').should.equal('x\n   y\n');
      -  });
      -
      -  it('3 lines with blank line', function () {
      -    doctrine.unwrapComment('/**x\n *\n \* y\n*/').should.equal('x\n\ny\n');
      -  });
      -});
      -/* vim: set sw=4 ts=4 et tw=80 : */
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/.lint b/tools/eslint/node_modules/es5-ext/.lint
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/.lint
      rename to tools/eslint/node_modules/es5-ext/.lint
      diff --git a/tools/eslint/node_modules/es5-ext/.lintignore b/tools/eslint/node_modules/es5-ext/.lintignore
      new file mode 100644
      index 00000000000000..eece4ff3c76f4a
      --- /dev/null
      +++ b/tools/eslint/node_modules/es5-ext/.lintignore
      @@ -0,0 +1,9 @@
      +/string/#/normalize/_data.js
      +/test/boolean/is-boolean.js
      +/test/date/is-date.js
      +/test/number/is-number.js
      +/test/object/is-copy.js
      +/test/object/is-number-value.js
      +/test/object/is-object.js
      +/test/reg-exp/is-reg-exp.js
      +/test/string/is-string.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/LICENSE b/tools/eslint/node_modules/es5-ext/LICENSE
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/LICENSE
      rename to tools/eslint/node_modules/es5-ext/LICENSE
      diff --git a/tools/eslint/node_modules/es5-ext/README.md b/tools/eslint/node_modules/es5-ext/README.md
      new file mode 100644
      index 00000000000000..ad09fe2317bfa7
      --- /dev/null
      +++ b/tools/eslint/node_modules/es5-ext/README.md
      @@ -0,0 +1,993 @@
      +# es5-ext
      +## ECMAScript 5 extensions
      +### (with respect to ECMAScript 6 standard)
      +
      +Shims for upcoming ES6 standard and other goodies implemented strictly with ECMAScript conventions in mind.
      +
      +It's designed to be used in compliant ECMAScript 5 or ECMAScript 6 environments. Older environments are not supported, although most of the features should work with correct ECMAScript 5 shim on board.
      +
      +When used in ECMAScript 6 environment, native implementation (if valid) takes precedence over shims.
      +
      +### Installation
      +
      +	$ npm install es5-ext
      +
      +To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)
      +
      +### Usage
      +
      +#### ECMAScript 6 features
      +
      +You can force ES6 features to be implemented in your environment, e.g. following will assign `from` function to `Array` (only if it's not implemented already).
      +
      +```javascript
      +require('es5-ext/array/from/implement');
      +Array.from('foo'); // ['f', 'o', 'o']
      +```
      +
      +You can also access shims directly, without fixing native objects. Following will return native `Array.from` if it's available and fallback to shim if it's not.
      +
      +```javascript
      +var aFrom = require('es5-ext/array/from');
      +aFrom('foo'); // ['f', 'o', 'o']
      +```
      +
      +If you want to use shim unconditionally (even if native implementation exists) do:
      +
      +```javascript
      +var aFrom = require('es5-ext/array/from/shim');
      +aFrom('foo'); // ['f', 'o', 'o']
      +```
      +
      +##### List of ES6 shims
      +
      +It's about properties introduced with ES6 and those that have been updated in new spec.
      +
      +- `Array.from` -> `require('es5-ext/array/from')`
      +- `Array.of` -> `require('es5-ext/array/of')`
      +- `Array.prototype.concat` -> `require('es5-ext/array/#/concat')`
      +- `Array.prototype.copyWithin` -> `require('es5-ext/array/#/copy-within')`
      +- `Array.prototype.entries` -> `require('es5-ext/array/#/entries')`
      +- `Array.prototype.fill` -> `require('es5-ext/array/#/fill')`
      +- `Array.prototype.filter` -> `require('es5-ext/array/#/filter')`
      +- `Array.prototype.find` -> `require('es5-ext/array/#/find')`
      +- `Array.prototype.findIndex` -> `require('es5-ext/array/#/find-index')`
      +- `Array.prototype.keys` -> `require('es5-ext/array/#/keys')`
      +- `Array.prototype.map` -> `require('es5-ext/array/#/map')`
      +- `Array.prototype.slice` -> `require('es5-ext/array/#/slice')`
      +- `Array.prototype.splice` -> `require('es5-ext/array/#/splice')`
      +- `Array.prototype.values` -> `require('es5-ext/array/#/values')`
      +- `Array.prototype[@@iterator]` -> `require('es5-ext/array/#/@@iterator')`
      +- `Math.acosh` -> `require('es5-ext/math/acosh')`
      +- `Math.asinh` -> `require('es5-ext/math/asinh')`
      +- `Math.atanh` -> `require('es5-ext/math/atanh')`
      +- `Math.cbrt` -> `require('es5-ext/math/cbrt')`
      +- `Math.clz32` -> `require('es5-ext/math/clz32')`
      +- `Math.cosh` -> `require('es5-ext/math/cosh')`
      +- `Math.exmp1` -> `require('es5-ext/math/expm1')`
      +- `Math.fround` -> `require('es5-ext/math/fround')`
      +- `Math.hypot` -> `require('es5-ext/math/hypot')`
      +- `Math.imul` -> `require('es5-ext/math/imul')`
      +- `Math.log1p` -> `require('es5-ext/math/log1p')`
      +- `Math.log2` -> `require('es5-ext/math/log2')`
      +- `Math.log10` -> `require('es5-ext/math/log10')`
      +- `Math.sign` -> `require('es5-ext/math/sign')`
      +- `Math.signh` -> `require('es5-ext/math/signh')`
      +- `Math.tanh` -> `require('es5-ext/math/tanh')`
      +- `Math.trunc` -> `require('es5-ext/math/trunc')`
      +- `Number.EPSILON` -> `require('es5-ext/number/epsilon')`
      +- `Number.MAX_SAFE_INTEGER` -> `require('es5-ext/number/max-safe-integer')`
      +- `Number.MIN_SAFE_INTEGER` -> `require('es5-ext/number/min-safe-integer')`
      +- `Number.isFinite` -> `require('es5-ext/number/is-finite')`
      +- `Number.isInteger` -> `require('es5-ext/number/is-integer')`
      +- `Number.isNaN` -> `require('es5-ext/number/is-nan')`
      +- `Number.isSafeInteger` -> `require('es5-ext/number/is-safe-integer')`
      +- `Object.assign` -> `require('es5-ext/object/assign')`
      +- `Object.keys` -> `require('es5-ext/object/keys')`
      +- `Object.setPrototypeOf` -> `require('es5-ext/object/set-prototype-of')`
      +- `RegExp.prototype.match` -> `require('es5-ext/reg-exp/#/match')`
      +- `RegExp.prototype.replace` -> `require('es5-ext/reg-exp/#/replace')`
      +- `RegExp.prototype.search` -> `require('es5-ext/reg-exp/#/search')`
      +- `RegExp.prototype.split` -> `require('es5-ext/reg-exp/#/split')`
      +- `RegExp.prototype.sticky` -> Implement with `require('es5-ext/reg-exp/#/sticky/implement')`, use as function with `require('es5-ext/reg-exp/#/is-sticky')`
      +- `RegExp.prototype.unicode` -> Implement with `require('es5-ext/reg-exp/#/unicode/implement')`, use as function with `require('es5-ext/reg-exp/#/is-unicode')`
      +- `String.fromCodePoint` -> `require('es5-ext/string/from-code-point')`
      +- `String.raw` -> `require('es5-ext/string/raw')`
      +- `String.prototype.codePointAt` -> `require('es5-ext/string/#/code-point-at')`
      +- `String.prototype.contains` -> `require('es5-ext/string/#/contains')`
      +- `String.prototype.endsWith` -> `require('es5-ext/string/#/ends-with')`
      +- `String.prototype.normalize` -> `require('es5-ext/string/#/normalize')`
      +- `String.prototype.repeat` -> `require('es5-ext/string/#/repeat')`
      +- `String.prototype.startsWith` -> `require('es5-ext/string/#/starts-with')`
      +- `String.prototype[@@iterator]` -> `require('es5-ext/string/#/@@iterator')`
      +
      +#### Non ECMAScript standard features
      +
      +__es5-ext__ provides also other utils, and implements them as if they were proposed for a standard. It mostly offers methods (not functions) which can directly be assigned to native prototypes:
      +
      +```javascript
      +Object.defineProperty(Function.prototype, 'partial', { value: require('es5-ext/function/#/partial'),
      +  configurable: true, enumerable: false, writable: true });
      +Object.defineProperty(Array.prototype, 'flatten', { value: require('es5-ext/array/#/flatten'),
      +  configurable: true, enumerable: false, writable: true });
      +Object.defineProperty(String.prototype, 'capitalize', { value: require('es5-ext/string/#/capitalize'),
      +  configurable: true, enumerable: false, writable: true });
      +```
      +
      +See [es5-extend](https://github.com/wookieb/es5-extend#es5-extend), a great utility that automatically will extend natives for you.
      +
      +__Important:__ Remember to __not__ extend natives in scope of generic reusable packages (e.g. ones you intend to publish to npm). Extending natives is fine __only__ if you're the _owner_ of the global scope, so e.g. in final project you lead development of.
      +
      +When you're in situation when native extensions are not good idea, then you should use methods indirectly:
      +
      +
      +```javascript
      +var flatten = require('es5-ext/array/#/flatten');
      +
      +flatten.call([1, [2, [3, 4]]]); // [1, 2, 3, 4]
      +```
      +
      +for better convenience you can turn methods into functions:
      +
      +
      +```javascript
      +var call = Function.prototype.call
      +var flatten = call.bind(require('es5-ext/array/#/flatten'));
      +
      +flatten([1, [2, [3, 4]]]); // [1, 2, 3, 4]
      +```
      +
      +You can configure custom toolkit (like [underscorejs](http://underscorejs.org/)), and use it throughout your application
      +
      +```javascript
      +var util = {};
      +util.partial = call.bind(require('es5-ext/function/#/partial'));
      +util.flatten = call.bind(require('es5-ext/array/#/flatten'));
      +util.startsWith = call.bind(require('es5-ext/string/#/starts-with'));
      +
      +util.flatten([1, [2, [3, 4]]]); // [1, 2, 3, 4]
      +```
      +
      +As with native ones most methods are generic and can be run on any type of object.
      +
      +## API
      +
      +### Global extensions
      +
      +#### global _(es5-ext/global)_
      +
      +Object that represents global scope
      +
      +### Array Constructor extensions
      +
      +#### from(arrayLike[, mapFn[, thisArg]]) _(es5-ext/array/from)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.from).
      +Returns array representation of _iterable_ or _arrayLike_. If _arrayLike_ is an instance of array, its copy is returned.
      +
      +#### generate([length[, …fill]]) _(es5-ext/array/generate)_
      +
      +Generate an array of pre-given _length_ built of repeated arguments.
      +
      +#### isPlainArray(x) _(es5-ext/array/is-plain-array)_
      +
      +Returns true if object is plain array (not instance of one of the Array's extensions).
      +
      +#### of([…items]) _(es5-ext/array/of)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.of).
      +Create an array from given arguments.
      +
      +#### toArray(obj) _(es5-ext/array/to-array)_
      +
      +Returns array representation of `obj`. If `obj` is already an array, `obj` is returned back.
      +
      +#### validArray(obj) _(es5-ext/array/valid-array)_
      +
      +Returns `obj` if it's an array, otherwise throws `TypeError`
      +
      +### Array Prototype extensions
      +
      +#### arr.binarySearch(compareFn) _(es5-ext/array/#/binary-search)_
      +
      +In __sorted__ list search for index of item for which _compareFn_ returns value closest to _0_.
      +It's variant of binary search algorithm
      +
      +#### arr.clear() _(es5-ext/array/#/clear)_
      +
      +Clears the array
      +
      +#### arr.compact() _(es5-ext/array/#/compact)_
      +
      +Returns a copy of the context with all non-values (`null` or `undefined`) removed.
      +
      +#### arr.concat() _(es5-ext/array/#/concat)_
      +
      +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.concat).
      +ES6's version of `concat`. Supports `isConcatSpreadable` symbol, and returns array of same type as the context.
      +
      +#### arr.contains(searchElement[, position]) _(es5-ext/array/#/contains)_
      +
      +Whether list contains the given value.
      +
      +#### arr.copyWithin(target, start[, end]) _(es5-ext/array/#/copy-within)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.copywithin).
      +
      +#### arr.diff(other) _(es5-ext/array/#/diff)_
      +
      +Returns the array of elements that are present in context list but not present in other list.
      +
      +#### arr.eIndexOf(searchElement[, fromIndex]) _(es5-ext/array/#/e-index-of)_
      +
      +_egal_ version of `indexOf` method. [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) logic is used for comparision
      +
      +#### arr.eLastIndexOf(searchElement[, fromIndex]) _(es5-ext/array/#/e-last-index-of)_
      +
      +_egal_ version of `lastIndexOf` method. [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) logic is used for comparision
      +
      +#### arr.entries() _(es5-ext/array/#/entries)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.entries).
      +Returns iterator object, which traverses the array. Each value is represented with an array, where first value is an index and second is corresponding to index value.
      +
      +#### arr.exclusion([…lists]]) _(es5-ext/array/#/exclusion)_
      +
      +Returns the array of elements that are found only in one of the lists (either context list or list provided in arguments).
      +
      +#### arr.fill(value[, start, end]) _(es5-ext/array/#/fill)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.fill).
      +
      +#### arr.filter(callback[, thisArg]) _(es5-ext/array/#/filter)_
      +
      +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.filter).
      +ES6's version of `filter`, returns array of same type as the context.
      +
      +#### arr.find(predicate[, thisArg]) _(es5-ext/array/#/find)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.find).
      +Return first element for which given function returns true
      +
      +#### arr.findIndex(predicate[, thisArg]) _(es5-ext/array/#/find-index)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.findindex).
      +Return first index for which given function returns true
      +
      +#### arr.first() _(es5-ext/array/#/first)_
      +
      +Returns value for first defined index
      +
      +#### arr.firstIndex() _(es5-ext/array/#/first-index)_
      +
      +Returns first declared index of the array
      +
      +#### arr.flatten() _(es5-ext/array/#/flatten)_
      +
      +Returns flattened version of the array
      +
      +#### arr.forEachRight(cb[, thisArg]) _(es5-ext/array/#/for-each-right)_
      +
      +`forEach` starting from last element
      +
      +#### arr.group(cb[, thisArg]) _(es5-ext/array/#/group)_
      +
      +Group list elements by value returned by _cb_ function
      +
      +#### arr.indexesOf(searchElement[, fromIndex]) _(es5-ext/array/#/indexes-of)_
      +
      +Returns array of all indexes of given value
      +
      +#### arr.intersection([…lists]) _(es5-ext/array/#/intersection)_
      +
      +Computes the array of values that are the intersection of all lists (context list and lists given in arguments)
      +
      +#### arr.isCopy(other) _(es5-ext/array/#/is-copy)_
      +
      +Returns true if both context and _other_ lists have same content
      +
      +#### arr.isUniq() _(es5-ext/array/#/is-uniq)_
      +
      +Returns true if all values in array are unique
      +
      +#### arr.keys() _(es5-ext/array/#/keys)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.keys).
      +Returns iterator object, which traverses all array indexes.
      +
      +#### arr.last() _(es5-ext/array/#/last)_
      +
      +Returns value of last defined index
      +
      +#### arr.lastIndex() _(es5-ext/array/#/last)_
      +
      +Returns last defined index of the array
      +
      +#### arr.map(callback[, thisArg]) _(es5-ext/array/#/map)_
      +
      +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.map).
      +ES6's version of `map`, returns array of same type as the context.
      +
      +#### arr.remove(value[, …valuen]) _(es5-ext/array/#/remove)_
      +
      +Remove values from the array
      +
      +#### arr.separate(sep) _(es5-ext/array/#/separate)_
      +
      +Returns array with items separated with `sep` value
      +
      +#### arr.slice(callback[, thisArg]) _(es5-ext/array/#/slice)_
      +
      +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.slice).
      +ES6's version of `slice`, returns array of same type as the context.
      +
      +#### arr.someRight(cb[, thisArg]) _(es5-ext/array/#/someRight)_
      +
      +`some` starting from last element
      +
      +#### arr.splice(callback[, thisArg]) _(es5-ext/array/#/splice)_
      +
      +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.splice).
      +ES6's version of `splice`, returns array of same type as the context.
      +
      +#### arr.uniq() _(es5-ext/array/#/uniq)_
      +
      +Returns duplicate-free version of the array
      +
      +#### arr.values() _(es5-ext/array/#/values)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.values).
      +Returns iterator object which traverses all array values.
      +
      +#### arr[@@iterator] _(es5-ext/array/#/@@iterator)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype-@@iterator).
      +Returns iterator object which traverses all array values.
      +
      +### Boolean Constructor extensions
      +
      +#### isBoolean(x) _(es5-ext/boolean/is-boolean)_
      +
      +Whether value is boolean
      +
      +### Date Constructor extensions
      +
      +#### isDate(x) _(es5-ext/date/is-date)_
      +
      +Whether value is date instance
      +
      +#### validDate(x) _(es5-ext/date/valid-date)_
      +
      +If given object is not date throw TypeError in other case return it.
      +
      +### Date Prototype extensions
      +
      +#### date.copy(date) _(es5-ext/date/#/copy)_
      +
      +Returns a copy of the date object
      +
      +#### date.daysInMonth() _(es5-ext/date/#/days-in-month)_
      +
      +Returns number of days of date's month
      +
      +#### date.floorDay() _(es5-ext/date/#/floor-day)_
      +
      +Sets the date time to 00:00:00.000
      +
      +#### date.floorMonth() _(es5-ext/date/#/floor-month)_
      +
      +Sets date day to 1 and date time to 00:00:00.000
      +
      +#### date.floorYear() _(es5-ext/date/#/floor-year)_
      +
      +Sets date month to 0, day to 1 and date time to 00:00:00.000
      +
      +#### date.format(pattern) _(es5-ext/date/#/format)_
      +
      +Formats date up to given string. Supported patterns:
      +
      +* `%Y` - Year with century, 1999, 2003
      +* `%y` - Year without century, 99, 03
      +* `%m` - Month, 01..12
      +* `%d` - Day of the month 01..31
      +* `%H` - Hour (24-hour clock), 00..23
      +* `%M` - Minute, 00..59
      +* `%S` - Second, 00..59
      +* `%L` - Milliseconds, 000..999
      +
      +### Error Constructor extensions
      +
      +#### custom(message/*, code, ext*/) _(es5-ext/error/custom)_
      +
      +Creates custom error object, optinally extended with `code` and other extension properties (provided with `ext` object)
      +
      +#### isError(x) _(es5-ext/error/is-error)_
      +
      +Whether value is an error (instance of `Error`).
      +
      +#### validError(x) _(es5-ext/error/valid-error)_
      +
      +If given object is not error throw TypeError in other case return it.
      +
      +### Error Prototype extensions
      +
      +#### err.throw() _(es5-ext/error/#/throw)_
      +
      +Throws error
      +
      +### Function Constructor extensions
      +
      +Some of the functions were inspired by [Functional JavaScript](http://osteele.com/sources/javascript/functional/) project by Olivier Steele
      +
      +#### constant(x) _(es5-ext/function/constant)_
      +
      +Returns a constant function that returns pregiven argument
      +
      +_k(x)(y)  =def  x_
      +
      +#### identity(x) _(es5-ext/function/identity)_
      +
      +Identity function. Returns first argument
      +
      +_i(x)  =def  x_
      +
      +#### invoke(name[, …args]) _(es5-ext/function/invoke)_
      +
      +Returns a function that takes an object as an argument, and applies object's
      +_name_ method to arguments.
      +_name_ can be name of the method or method itself.
      +
      +_invoke(name, …args)(object, …args2)  =def  object\[name\]\(…args, …args2\)_
      +
      +#### isArguments(x) _(es5-ext/function/is-arguments)_
      +
      +Whether value is arguments object
      +
      +#### isFunction(arg) _(es5-ext/function/is-function)_
      +
      +Wether value is instance of function
      +
      +#### noop() _(es5-ext/function/noop)_
      +
      +No operation function
      +
      +#### pluck(name) _(es5-ext/function/pluck)_
      +
      +Returns a function that takes an object, and returns the value of its _name_
      +property
      +
      +_pluck(name)(obj)  =def  obj[name]_
      +
      +#### validFunction(arg) _(es5-ext/function/valid-function)_
      +
      +If given object is not function throw TypeError in other case return it.
      +
      +### Function Prototype extensions
      +
      +Some of the methods were inspired by [Functional JavaScript](http://osteele.com/sources/javascript/functional/) project by Olivier Steele
      +
      +#### fn.compose([…fns]) _(es5-ext/function/#/compose)_
      +
      +Applies the functions in reverse argument-list order.
      +
      +_f1.compose(f2, f3, f4)(…args)  =def  f1(f2(f3(f4(…arg))))_
      +
      +#### fn.copy() _(es5-ext/function/#/copy)_
      +
      +Produces copy of given function
      +
      +#### fn.curry([n]) _(es5-ext/function/#/curry)_
      +
      +Invoking the function returned by this function only _n_ arguments are passed to the underlying function. If the underlying function is not saturated, the result is a function that passes all its arguments to the underlying function.
      +If _n_ is not provided then it defaults to context function length
      +
      +_f.curry(4)(arg1, arg2)(arg3)(arg4)  =def  f(arg1, args2, arg3, arg4)_
      +
      +#### fn.lock([…args]) _(es5-ext/function/#/lock)_
      +
      +Returns a function that applies the underlying function to _args_, and ignores its own arguments.
      +
      +_f.lock(…args)(…args2)  =def  f(…args)_
      +
      +_Named after it's counterpart in Google Closure_
      +
      +#### fn.not() _(es5-ext/function/#/not)_
      +
      +Returns a function that returns boolean negation of value returned by underlying function.
      +
      +_f.not()(…args)  =def !f(…args)_
      +
      +#### fn.partial([…args]) _(es5-ext/function/#/partial)_
      +
      +Returns a function that when called will behave like context function called with initially passed arguments. If more arguments are suplilied, they are appended to initial args.
      +
      +_f.partial(…args1)(…args2)  =def  f(…args1, …args2)_
      +
      +#### fn.spread() _(es5-ext/function/#/spread)_
      +
      +Returns a function that applies underlying function with first list argument
      +
      +_f.match()(args)  =def  f.apply(null, args)_
      +
      +#### fn.toStringTokens() _(es5-ext/function/#/to-string-tokens)_
      +
      +Serializes function into two (arguments and body) string tokens. Result is plain object with `args` and `body` properties.
      +
      +### Math extensions
      +
      +#### acosh(x) _(es5-ext/math/acosh)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.acosh).
      +
      +#### asinh(x) _(es5-ext/math/asinh)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.asinh).
      +
      +#### atanh(x) _(es5-ext/math/atanh)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.atanh).
      +
      +#### cbrt(x) _(es5-ext/math/cbrt)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cbrt).
      +
      +#### clz32(x) _(es5-ext/math/clz32)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.clz32).
      +
      +#### cosh(x) _(es5-ext/math/cosh)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cosh).
      +
      +#### expm1(x) _(es5-ext/math/expm1)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.expm1).
      +
      +#### fround(x) _(es5-ext/math/fround)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.fround).
      +
      +#### hypot([…values]) _(es5-ext/math/hypot)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.hypot).
      +
      +#### imul(x, y) _(es5-ext/math/imul)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.imul).
      +
      +#### log1p(x) _(es5-ext/math/log1p)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log1p).
      +
      +#### log2(x) _(es5-ext/math/log2)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log2).
      +
      +#### log10(x) _(es5-ext/math/log10)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log10).
      +
      +#### sign(x) _(es5-ext/math/sign)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sign).
      +
      +#### sinh(x) _(es5-ext/math/sinh)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sinh).
      +
      +#### tanh(x) _(es5-ext/math/tanh)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.tanh).
      +
      +#### trunc(x) _(es5-ext/math/trunc)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.trunc).
      +
      +### Number Constructor extensions
      +
      +#### EPSILON _(es5-ext/number/epsilon)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.epsilon).
      +
      +The difference between 1 and the smallest value greater than 1 that is representable as a Number value, which is approximately 2.2204460492503130808472633361816 x 10-16.
      +
      +#### isFinite(x) _(es5-ext/number/is-finite)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite).
      +Whether value is finite. Differs from global isNaN that it doesn't do type coercion.
      +
      +#### isInteger(x) _(es5-ext/number/is-integer)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isinteger).
      +Whether value is integer.
      +
      +#### isNaN(x) _(es5-ext/number/is-nan)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isnan).
      +Whether value is NaN. Differs from global isNaN that it doesn't do type coercion.
      +
      +#### isNumber(x) _(es5-ext/number/is-number)_
      +
      +Whether given value is number
      +
      +#### isSafeInteger(x) _(es5-ext/number/is-safe-integer)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.issafeinteger).
      +
      +#### MAX_SAFE_INTEGER _(es5-ext/number/max-safe-integer)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.maxsafeinteger).
      +The value of Number.MAX_SAFE_INTEGER is 9007199254740991.
      +
      +#### MIN_SAFE_INTEGER _(es5-ext/number/min-safe-integer)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.minsafeinteger).
      +The value of Number.MIN_SAFE_INTEGER is -9007199254740991 (253-1).
      +
      +#### toInteger(x) _(es5-ext/number/to-integer)_
      +
      +Converts value to integer
      +
      +#### toPosInteger(x) _(es5-ext/number/to-pos-integer)_
      +
      +Converts value to positive integer. If provided value is less than 0, then 0 is returned
      +
      +#### toUint32(x) _(es5-ext/number/to-uint32)_
      +
      +Converts value to unsigned 32 bit integer. This type is used for array lengths.
      +See: http://www.2ality.com/2012/02/js-integers.html
      +
      +### Number Prototype extensions
      +
      +#### num.pad(length[, precision]) _(es5-ext/number/#/pad)_
      +
      +Pad given number with zeros. Returns string
      +
      +### Object Constructor extensions
      +
      +#### assign(target, source[, …sourcen]) _(es5-ext/object/assign)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign).
      +Extend _target_ by enumerable own properties of other objects. If properties are already set on target object, they will be overwritten.
      +
      +#### clear(obj) _(es5-ext/object/clear)_
      +
      +Remove all enumerable own properties of the object
      +
      +#### compact(obj) _(es5-ext/object/compact)_
      +
      +Returns copy of the object with all enumerable properties that have no falsy values
      +
      +#### compare(obj1, obj2) _(es5-ext/object/compare)_
      +
      +Universal cross-type compare function. To be used for e.g. array sort.
      +
      +#### copy(obj) _(es5-ext/object/copy)_
      +
      +Returns copy of the object with all enumerable properties.
      +
      +#### copyDeep(obj) _(es5-ext/object/copy-deep)_
      +
      +Returns deep copy of the object with all enumerable properties.
      +
      +#### count(obj) _(es5-ext/object/count)_
      +
      +Counts number of enumerable own properties on object
      +
      +#### create(obj[, properties]) _(es5-ext/object/create)_
      +
      +`Object.create` alternative that provides workaround for [V8 issue](http://code.google.com/p/v8/issues/detail?id=2804).
      +
      +When `null` is provided as a prototype, it's substituted with specially prepared object that derives from Object.prototype but has all Object.prototype properties shadowed with undefined.
      +
      +It's quirky solution that allows us to have plain objects with no truthy properties but with turnable prototype.
      +
      +Use only for objects that you plan to switch prototypes of and be aware of limitations of this workaround.
      +
      +#### eq(x, y) _(es5-ext/object/eq)_
      +
      +Whether two values are equal, using [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) algorithm.
      +
      +#### every(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/every)_
      +
      +Analogous to Array.prototype.every. Returns true if every key-value pair in this object satisfies the provided testing function.
      +Optionally _compareFn_ can be provided which assures that keys are tested in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key).
      +
      +#### filter(obj, cb[, thisArg]) _(es5-ext/object/filter)_
      +
      +Analogous to Array.prototype.filter. Returns new object with properites for which _cb_ function returned truthy value.
      +
      +#### firstKey(obj) _(es5-ext/object/first-key)_
      +
      +Returns first enumerable key of the object, as keys are unordered by specification, it can be any key of an object.
      +
      +#### flatten(obj) _(es5-ext/object/flatten)_
      +
      +Returns new object, with flatten properties of input object
      +
      +_flatten({ a: { b: 1 }, c: { d: 1 } })  =def  { b: 1, d: 1 }_
      +
      +#### forEach(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/for-each)_
      +
      +Analogous to Array.prototype.forEach. Calls a function for each key-value pair found in object
      +Optionally _compareFn_ can be provided which assures that properties are iterated in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key).
      +
      +#### getPropertyNames() _(es5-ext/object/get-property-names)_
      +
      +Get all (not just own) property names of the object
      +
      +#### is(x, y) _(es5-ext/object/is)_
      +
      +Whether two values are equal, using [_SameValue_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) algorithm.
      +
      +#### isArrayLike(x) _(es5-ext/object/is-array-like)_
      +
      +Whether object is array-like object
      +
      +#### isCopy(x, y) _(es5-ext/object/is-copy)_
      +
      +Two values are considered a copy of same value when all of their own enumerable properties have same values.
      +
      +#### isCopyDeep(x, y) _(es5-ext/object/is-copy-deep)_
      +
      +Deep comparision of objects
      +
      +#### isEmpty(obj) _(es5-ext/object/is-empty)_
      +
      +True if object doesn't have any own enumerable property
      +
      +#### isObject(arg) _(es5-ext/object/is-object)_
      +
      +Whether value is not primitive
      +
      +#### isPlainObject(arg) _(es5-ext/object/is-plain-object)_
      +
      +Whether object is plain object, its protototype should be Object.prototype and it cannot be host object.
      +
      +#### keyOf(obj, searchValue) _(es5-ext/object/key-of)_
      +
      +Search object for value
      +
      +#### keys(obj) _(es5-ext/object/keys)_
      +
      +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys).
      +ES6's version of `keys`, doesn't throw on primitive input
      +
      +#### map(obj, cb[, thisArg]) _(es5-ext/object/map)_
      +
      +Analogous to Array.prototype.map. Creates a new object with properties which values are results of calling a provided function on every key-value pair in this object.
      +
      +#### mapKeys(obj, cb[, thisArg]) _(es5-ext/object/map-keys)_
      +
      +Create new object with same values, but remapped keys
      +
      +#### mixin(target, source) _(es5-ext/object/mixin)_
      +
      +Extend _target_ by all own properties of other objects. Properties found in both objects will be overwritten (unless they're not configurable and cannot be overwritten).
      +_It was for a moment part of ECMAScript 6 draft._
      +
      +#### mixinPrototypes(target, …source]) _(es5-ext/object/mixin-prototypes)_
      +
      +Extends _target_, with all source and source's prototype properties.
      +Useful as an alternative for `setPrototypeOf` in environments in which it cannot be shimmed (no `__proto__` support).
      +
      +#### normalizeOptions(options) _(es5-ext/object/normalize-options)_
      +
      +Normalizes options object into flat plain object.
      +
      +Useful for functions in which we either need to keep options object for future reference or need to modify it for internal use.
      +
      +- It never returns input `options` object back (always a copy is created)
      +- `options` can be undefined in such case empty plain object is returned.
      +- Copies all enumerable properties found down prototype chain.
      +
      +#### primitiveSet([…names]) _(es5-ext/object/primitive-set)_
      +
      +Creates `null` prototype based plain object, and sets on it all property names provided in arguments to true.
      +
      +#### safeTraverse(obj[, …names]) _(es5-ext/object/safe-traverse)_
      +
      +Safe navigation of object properties. See http://wiki.ecmascript.org/doku.php?id=strawman:existential_operator
      +
      +#### serialize(value) _(es5-ext/object/serialize)_
      +
      +Serialize value into string. Differs from [JSON.stringify](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that it serializes also dates, functions and regular expresssions.
      +
      +#### setPrototypeOf(object, proto) _(es5-ext/object/set-prototype-of)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.setprototypeof).
      +If native version is not provided, it depends on existence of `__proto__` functionality, if it's missing, `null` instead of function is exposed.
      +
      +#### some(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/some)_
      +
      +Analogous to Array.prototype.some Returns true if any key-value pair satisfies the provided
      +testing function.
      +Optionally _compareFn_ can be provided which assures that keys are tested in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key).
      +
      +#### toArray(obj[, cb[, thisArg[, compareFn]]]) _(es5-ext/object/to-array)_
      +
      +Creates an array of results of calling a provided function on every key-value pair in this object.
      +Optionally _compareFn_ can be provided which assures that results are added in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key).
      +
      +#### unserialize(str) _(es5-ext/object/unserialize)_
      +
      +Userializes value previously serialized with [serialize](#serializevalue-es5-extobjectserialize)
      +
      +#### validCallable(x) _(es5-ext/object/valid-callable)_
      +
      +If given object is not callable throw TypeError in other case return it.
      +
      +#### validObject(x) _(es5-ext/object/valid-object)_
      +
      +Throws error if given value is not an object, otherwise it is returned.
      +
      +#### validValue(x) _(es5-ext/object/valid-value)_
      +
      +Throws error if given value is `null` or `undefined`, otherwise returns value.
      +
      +### RegExp Constructor extensions
      +
      +#### escape(str) _(es5-ext/reg-exp/escape)_
      +
      +Escapes string to be used in regular expression
      +
      +#### isRegExp(x) _(es5-ext/reg-exp/is-reg-exp)_
      +
      +Whether object is regular expression
      +
      +#### validRegExp(x) _(es5-ext/reg-exp/valid-reg-exp)_
      +
      +If object is regular expression it is returned, otherwise TypeError is thrown.
      +
      +### RegExp Prototype extensions
      +
      +#### re.isSticky(x) _(es5-ext/reg-exp/#/is-sticky)_
      +
      +Whether regular expression has `sticky` flag.
      +
      +It's to be used as counterpart to [regExp.sticky](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-get-regexp.prototype.sticky) if it's not implemented.
      +
      +#### re.isUnicode(x) _(es5-ext/reg-exp/#/is-unicode)_
      +
      +Whether regular expression has `unicode` flag.
      +
      +It's to be used as counterpart to [regExp.unicode](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-get-regexp.prototype.unicode) if it's not implemented.
      +
      +#### re.match(string) _(es5-ext/reg-exp/#/match)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.match).
      +
      +#### re.replace(string, replaceValue) _(es5-ext/reg-exp/#/replace)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.replace).
      +
      +#### re.search(string) _(es5-ext/reg-exp/#/search)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.search).
      +
      +#### re.split(string) _(es5-ext/reg-exp/#/search)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.split).
      +
      +#### re.sticky _(es5-ext/reg-exp/#/sticky/implement)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.sticky).
      +It's a getter, so only `implement` and `is-implemented` modules are provided.
      +
      +#### re.unicode _(es5-ext/reg-exp/#/unicode/implement)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.unicode).
      +It's a getter, so only `implement` and `is-implemented` modules are provided.
      +
      +### String Constructor extensions
      +
      +#### formatMethod(fMap) _(es5-ext/string/format-method)_
      +
      +Creates format method. It's used e.g. to create `Date.prototype.format` method
      +
      +#### fromCodePoint([…codePoints]) _(es5-ext/string/from-code-point)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.fromcodepoint)
      +
      +#### isString(x) _(es5-ext/string/is-string)_
      +
      +Whether object is string
      +
      +#### randomUniq() _(es5-ext/string/random-uniq)_
      +
      +Returns randomly generated id, with guarantee of local uniqueness (no same id will be returned twice)
      +
      +#### raw(callSite[, …substitutions]) _(es5-ext/string/raw)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.raw)
      +
      +### String Prototype extensions
      +
      +#### str.at(pos) _(es5-ext/string/#/at)_
      +
      +_Proposed for ECMAScript 6/7 standard, but not (yet) in a draft_
      +
      +Returns a string at given position in Unicode-safe manner.
      +Based on [implementation by Mathias Bynens](https://github.com/mathiasbynens/String.prototype.at).
      +
      +#### str.camelToHyphen() _(es5-ext/string/#/camel-to-hyphen)_
      +
      +Convert camelCase string to hyphen separated, e.g. one-two-three -> oneTwoThree.
      +Useful when converting names from js property convention into filename convention.
      +
      +#### str.capitalize() _(es5-ext/string/#/capitalize)_
      +
      +Capitalize first character of a string
      +
      +#### str.caseInsensitiveCompare(str) _(es5-ext/string/#/case-insensitive-compare)_
      +
      +Case insensitive compare
      +
      +#### str.codePointAt(pos) _(es5-ext/string/#/code-point-at)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.codepointat)
      +
      +Based on [implementation by Mathias Bynens](https://github.com/mathiasbynens/String.prototype.codePointAt).
      +
      +#### str.contains(searchString[, position]) _(es5-ext/string/#/contains)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.contains)
      +
      +Whether string contains given string.
      +
      +#### str.endsWith(searchString[, endPosition]) _(es5-ext/string/#/ends-with)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.endswith).
      +Whether strings ends with given string
      +
      +#### str.hyphenToCamel() _(es5-ext/string/#/hyphen-to-camel)_
      +
      +Convert hyphen separated string to camelCase, e.g. one-two-three -> oneTwoThree.
      +Useful when converting names from filename convention to js property name convention.
      +
      +#### str.indent(str[, count]) _(es5-ext/string/#/indent)_
      +
      +Indents each line with provided _str_ (if _count_ given then _str_ is repeated _count_ times).
      +
      +#### str.last() _(es5-ext/string/#/last)_
      +
      +Return last character
      +
      +#### str.normalize([form]) _(es5-ext/string/#/normalize)_
      +
      +[_Introduced with ECMAScript 6_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize).
      +Returns the Unicode Normalization Form of a given string.
      +Based on Matsuza's version. Code used for integrated shim can be found at [github.com/walling/unorm](https://github.com/walling/unorm/blob/master/lib/unorm.js)
      +
      +#### str.pad(fill[, length]) _(es5-ext/string/#/pad)_
      +
      +Pad string with _fill_.
      +If _length_ si given than _fill_ is reapated _length_ times.
      +If _length_ is negative then pad is applied from right.
      +
      +#### str.repeat(n) _(es5-ext/string/#/repeat)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.repeat).
      +Repeat given string _n_ times
      +
      +#### str.plainReplace(search, replace) _(es5-ext/string/#/plain-replace)_
      +
      +Simple `replace` version. Doesn't support regular expressions. Replaces just first occurrence of search string. Doesn't support insert patterns, therefore it is safe to replace text with text obtained programmatically (there's no need for additional _$_ characters escape in such case).
      +
      +#### str.plainReplaceAll(search, replace) _(es5-ext/string/#/plain-replace-all)_
      +
      +Simple `replace` version. Doesn't support regular expressions. Replaces all occurrences of search string. Doesn't support insert patterns, therefore it is safe to replace text with text obtained programmatically (there's no need for additional _$_ characters escape in such case).
      +
      +#### str.startsWith(searchString[, position]) _(es5-ext/string/#/starts-with)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.startswith).
      +Whether strings starts with given string
      +
      +#### str[@@iterator] _(es5-ext/string/#/@@iterator)_
      +
      +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype-@@iterator).
      +Returns iterator object which traverses all string characters (with respect to unicode symbols)
      +
      +### Tests [![Build Status](https://travis-ci.org/medikoo/es5-ext.png)](https://travis-ci.org/medikoo/es5-ext)
      +
      +	$ npm test
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/@@iterator/implement.js b/tools/eslint/node_modules/es5-ext/array/#/@@iterator/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/@@iterator/implement.js
      rename to tools/eslint/node_modules/es5-ext/array/#/@@iterator/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/@@iterator/index.js b/tools/eslint/node_modules/es5-ext/array/#/@@iterator/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/@@iterator/index.js
      rename to tools/eslint/node_modules/es5-ext/array/#/@@iterator/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/@@iterator/is-implemented.js b/tools/eslint/node_modules/es5-ext/array/#/@@iterator/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/@@iterator/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/array/#/@@iterator/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/@@iterator/shim.js b/tools/eslint/node_modules/es5-ext/array/#/@@iterator/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/@@iterator/shim.js
      rename to tools/eslint/node_modules/es5-ext/array/#/@@iterator/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/_compare-by-length.js b/tools/eslint/node_modules/es5-ext/array/#/_compare-by-length.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/_compare-by-length.js
      rename to tools/eslint/node_modules/es5-ext/array/#/_compare-by-length.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/binary-search.js b/tools/eslint/node_modules/es5-ext/array/#/binary-search.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/binary-search.js
      rename to tools/eslint/node_modules/es5-ext/array/#/binary-search.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/clear.js b/tools/eslint/node_modules/es5-ext/array/#/clear.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/clear.js
      rename to tools/eslint/node_modules/es5-ext/array/#/clear.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/compact.js b/tools/eslint/node_modules/es5-ext/array/#/compact.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/compact.js
      rename to tools/eslint/node_modules/es5-ext/array/#/compact.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/concat/implement.js b/tools/eslint/node_modules/es5-ext/array/#/concat/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/concat/implement.js
      rename to tools/eslint/node_modules/es5-ext/array/#/concat/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/concat/index.js b/tools/eslint/node_modules/es5-ext/array/#/concat/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/concat/index.js
      rename to tools/eslint/node_modules/es5-ext/array/#/concat/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/concat/is-implemented.js b/tools/eslint/node_modules/es5-ext/array/#/concat/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/concat/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/array/#/concat/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/concat/shim.js b/tools/eslint/node_modules/es5-ext/array/#/concat/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/concat/shim.js
      rename to tools/eslint/node_modules/es5-ext/array/#/concat/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/contains.js b/tools/eslint/node_modules/es5-ext/array/#/contains.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/contains.js
      rename to tools/eslint/node_modules/es5-ext/array/#/contains.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/copy-within/implement.js b/tools/eslint/node_modules/es5-ext/array/#/copy-within/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/copy-within/implement.js
      rename to tools/eslint/node_modules/es5-ext/array/#/copy-within/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/copy-within/index.js b/tools/eslint/node_modules/es5-ext/array/#/copy-within/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/copy-within/index.js
      rename to tools/eslint/node_modules/es5-ext/array/#/copy-within/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/copy-within/is-implemented.js b/tools/eslint/node_modules/es5-ext/array/#/copy-within/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/copy-within/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/array/#/copy-within/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/copy-within/shim.js b/tools/eslint/node_modules/es5-ext/array/#/copy-within/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/copy-within/shim.js
      rename to tools/eslint/node_modules/es5-ext/array/#/copy-within/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/diff.js b/tools/eslint/node_modules/es5-ext/array/#/diff.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/diff.js
      rename to tools/eslint/node_modules/es5-ext/array/#/diff.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/e-index-of.js b/tools/eslint/node_modules/es5-ext/array/#/e-index-of.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/e-index-of.js
      rename to tools/eslint/node_modules/es5-ext/array/#/e-index-of.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/e-last-index-of.js b/tools/eslint/node_modules/es5-ext/array/#/e-last-index-of.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/e-last-index-of.js
      rename to tools/eslint/node_modules/es5-ext/array/#/e-last-index-of.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/entries/implement.js b/tools/eslint/node_modules/es5-ext/array/#/entries/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/entries/implement.js
      rename to tools/eslint/node_modules/es5-ext/array/#/entries/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/entries/index.js b/tools/eslint/node_modules/es5-ext/array/#/entries/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/entries/index.js
      rename to tools/eslint/node_modules/es5-ext/array/#/entries/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/entries/is-implemented.js b/tools/eslint/node_modules/es5-ext/array/#/entries/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/entries/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/array/#/entries/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/entries/shim.js b/tools/eslint/node_modules/es5-ext/array/#/entries/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/entries/shim.js
      rename to tools/eslint/node_modules/es5-ext/array/#/entries/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/exclusion.js b/tools/eslint/node_modules/es5-ext/array/#/exclusion.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/exclusion.js
      rename to tools/eslint/node_modules/es5-ext/array/#/exclusion.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/fill/implement.js b/tools/eslint/node_modules/es5-ext/array/#/fill/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/fill/implement.js
      rename to tools/eslint/node_modules/es5-ext/array/#/fill/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/fill/index.js b/tools/eslint/node_modules/es5-ext/array/#/fill/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/fill/index.js
      rename to tools/eslint/node_modules/es5-ext/array/#/fill/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/fill/is-implemented.js b/tools/eslint/node_modules/es5-ext/array/#/fill/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/fill/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/array/#/fill/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/fill/shim.js b/tools/eslint/node_modules/es5-ext/array/#/fill/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/fill/shim.js
      rename to tools/eslint/node_modules/es5-ext/array/#/fill/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/filter/implement.js b/tools/eslint/node_modules/es5-ext/array/#/filter/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/filter/implement.js
      rename to tools/eslint/node_modules/es5-ext/array/#/filter/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/filter/index.js b/tools/eslint/node_modules/es5-ext/array/#/filter/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/filter/index.js
      rename to tools/eslint/node_modules/es5-ext/array/#/filter/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/filter/is-implemented.js b/tools/eslint/node_modules/es5-ext/array/#/filter/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/filter/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/array/#/filter/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/filter/shim.js b/tools/eslint/node_modules/es5-ext/array/#/filter/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/filter/shim.js
      rename to tools/eslint/node_modules/es5-ext/array/#/filter/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/find-index/implement.js b/tools/eslint/node_modules/es5-ext/array/#/find-index/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/find-index/implement.js
      rename to tools/eslint/node_modules/es5-ext/array/#/find-index/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/find-index/index.js b/tools/eslint/node_modules/es5-ext/array/#/find-index/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/find-index/index.js
      rename to tools/eslint/node_modules/es5-ext/array/#/find-index/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/find-index/is-implemented.js b/tools/eslint/node_modules/es5-ext/array/#/find-index/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/find-index/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/array/#/find-index/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/find-index/shim.js b/tools/eslint/node_modules/es5-ext/array/#/find-index/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/find-index/shim.js
      rename to tools/eslint/node_modules/es5-ext/array/#/find-index/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/find/implement.js b/tools/eslint/node_modules/es5-ext/array/#/find/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/find/implement.js
      rename to tools/eslint/node_modules/es5-ext/array/#/find/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/find/index.js b/tools/eslint/node_modules/es5-ext/array/#/find/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/find/index.js
      rename to tools/eslint/node_modules/es5-ext/array/#/find/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/find/is-implemented.js b/tools/eslint/node_modules/es5-ext/array/#/find/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/find/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/array/#/find/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/find/shim.js b/tools/eslint/node_modules/es5-ext/array/#/find/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/find/shim.js
      rename to tools/eslint/node_modules/es5-ext/array/#/find/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/first-index.js b/tools/eslint/node_modules/es5-ext/array/#/first-index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/first-index.js
      rename to tools/eslint/node_modules/es5-ext/array/#/first-index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/first.js b/tools/eslint/node_modules/es5-ext/array/#/first.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/first.js
      rename to tools/eslint/node_modules/es5-ext/array/#/first.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/flatten.js b/tools/eslint/node_modules/es5-ext/array/#/flatten.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/flatten.js
      rename to tools/eslint/node_modules/es5-ext/array/#/flatten.js
      diff --git a/tools/eslint/node_modules/es5-ext/array/#/for-each-right.js b/tools/eslint/node_modules/es5-ext/array/#/for-each-right.js
      new file mode 100644
      index 00000000000000..1702bb164466fb
      --- /dev/null
      +++ b/tools/eslint/node_modules/es5-ext/array/#/for-each-right.js
      @@ -0,0 +1,20 @@
      +'use strict';
      +
      +var toPosInt = require('../../number/to-pos-integer')
      +  , callable = require('../../object/valid-callable')
      +  , value    = require('../../object/valid-value')
      +
      +  , hasOwnProperty = Object.prototype.hasOwnProperty
      +  , call = Function.prototype.call;
      +
      +module.exports = function (cb/*, thisArg*/) {
      +	var i, self, thisArg;
      +
      +	self = Object(value(this));
      +	callable(cb);
      +	thisArg = arguments[1];
      +
      +	for (i = (toPosInt(self.length) - 1); i >= 0; --i) {
      +		if (hasOwnProperty.call(self, i)) call.call(cb, thisArg, self[i], i, self);
      +	}
      +};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/group.js b/tools/eslint/node_modules/es5-ext/array/#/group.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/group.js
      rename to tools/eslint/node_modules/es5-ext/array/#/group.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/index.js b/tools/eslint/node_modules/es5-ext/array/#/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/index.js
      rename to tools/eslint/node_modules/es5-ext/array/#/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/indexes-of.js b/tools/eslint/node_modules/es5-ext/array/#/indexes-of.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/indexes-of.js
      rename to tools/eslint/node_modules/es5-ext/array/#/indexes-of.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/intersection.js b/tools/eslint/node_modules/es5-ext/array/#/intersection.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/intersection.js
      rename to tools/eslint/node_modules/es5-ext/array/#/intersection.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/is-copy.js b/tools/eslint/node_modules/es5-ext/array/#/is-copy.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/is-copy.js
      rename to tools/eslint/node_modules/es5-ext/array/#/is-copy.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/is-uniq.js b/tools/eslint/node_modules/es5-ext/array/#/is-uniq.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/is-uniq.js
      rename to tools/eslint/node_modules/es5-ext/array/#/is-uniq.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/keys/implement.js b/tools/eslint/node_modules/es5-ext/array/#/keys/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/keys/implement.js
      rename to tools/eslint/node_modules/es5-ext/array/#/keys/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/keys/index.js b/tools/eslint/node_modules/es5-ext/array/#/keys/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/keys/index.js
      rename to tools/eslint/node_modules/es5-ext/array/#/keys/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/keys/is-implemented.js b/tools/eslint/node_modules/es5-ext/array/#/keys/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/keys/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/array/#/keys/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/keys/shim.js b/tools/eslint/node_modules/es5-ext/array/#/keys/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/keys/shim.js
      rename to tools/eslint/node_modules/es5-ext/array/#/keys/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/last-index.js b/tools/eslint/node_modules/es5-ext/array/#/last-index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/last-index.js
      rename to tools/eslint/node_modules/es5-ext/array/#/last-index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/last.js b/tools/eslint/node_modules/es5-ext/array/#/last.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/last.js
      rename to tools/eslint/node_modules/es5-ext/array/#/last.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/map/implement.js b/tools/eslint/node_modules/es5-ext/array/#/map/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/map/implement.js
      rename to tools/eslint/node_modules/es5-ext/array/#/map/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/map/index.js b/tools/eslint/node_modules/es5-ext/array/#/map/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/map/index.js
      rename to tools/eslint/node_modules/es5-ext/array/#/map/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/map/is-implemented.js b/tools/eslint/node_modules/es5-ext/array/#/map/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/map/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/array/#/map/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/map/shim.js b/tools/eslint/node_modules/es5-ext/array/#/map/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/map/shim.js
      rename to tools/eslint/node_modules/es5-ext/array/#/map/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/remove.js b/tools/eslint/node_modules/es5-ext/array/#/remove.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/remove.js
      rename to tools/eslint/node_modules/es5-ext/array/#/remove.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/separate.js b/tools/eslint/node_modules/es5-ext/array/#/separate.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/separate.js
      rename to tools/eslint/node_modules/es5-ext/array/#/separate.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/slice/implement.js b/tools/eslint/node_modules/es5-ext/array/#/slice/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/slice/implement.js
      rename to tools/eslint/node_modules/es5-ext/array/#/slice/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/slice/index.js b/tools/eslint/node_modules/es5-ext/array/#/slice/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/slice/index.js
      rename to tools/eslint/node_modules/es5-ext/array/#/slice/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/slice/is-implemented.js b/tools/eslint/node_modules/es5-ext/array/#/slice/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/slice/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/array/#/slice/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/slice/shim.js b/tools/eslint/node_modules/es5-ext/array/#/slice/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/slice/shim.js
      rename to tools/eslint/node_modules/es5-ext/array/#/slice/shim.js
      diff --git a/tools/eslint/node_modules/es5-ext/array/#/some-right.js b/tools/eslint/node_modules/es5-ext/array/#/some-right.js
      new file mode 100644
      index 00000000000000..f54cf945c38447
      --- /dev/null
      +++ b/tools/eslint/node_modules/es5-ext/array/#/some-right.js
      @@ -0,0 +1,23 @@
      +'use strict';
      +
      +var toPosInt = require('../../number/to-pos-integer')
      +  , callable = require('../../object/valid-callable')
      +  , value    = require('../../object/valid-value')
      +
      +  , hasOwnProperty = Object.prototype.hasOwnProperty
      +  , call = Function.prototype.call;
      +
      +module.exports = function (cb/*, thisArg*/) {
      +	var i, self, thisArg;
      +	self = Object(value(this));
      +	callable(cb);
      +	thisArg = arguments[1];
      +
      +	for (i = (toPosInt(self.length) - 1); i >= 0; --i) {
      +		if (hasOwnProperty.call(self, i) &&
      +				call.call(cb, thisArg, self[i], i, self)) {
      +			return true;
      +		}
      +	}
      +	return false;
      +};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/splice/implement.js b/tools/eslint/node_modules/es5-ext/array/#/splice/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/splice/implement.js
      rename to tools/eslint/node_modules/es5-ext/array/#/splice/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/splice/index.js b/tools/eslint/node_modules/es5-ext/array/#/splice/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/splice/index.js
      rename to tools/eslint/node_modules/es5-ext/array/#/splice/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/splice/is-implemented.js b/tools/eslint/node_modules/es5-ext/array/#/splice/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/splice/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/array/#/splice/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/splice/shim.js b/tools/eslint/node_modules/es5-ext/array/#/splice/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/splice/shim.js
      rename to tools/eslint/node_modules/es5-ext/array/#/splice/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/uniq.js b/tools/eslint/node_modules/es5-ext/array/#/uniq.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/uniq.js
      rename to tools/eslint/node_modules/es5-ext/array/#/uniq.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/values/implement.js b/tools/eslint/node_modules/es5-ext/array/#/values/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/values/implement.js
      rename to tools/eslint/node_modules/es5-ext/array/#/values/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/values/index.js b/tools/eslint/node_modules/es5-ext/array/#/values/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/values/index.js
      rename to tools/eslint/node_modules/es5-ext/array/#/values/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/values/is-implemented.js b/tools/eslint/node_modules/es5-ext/array/#/values/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/values/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/array/#/values/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/values/shim.js b/tools/eslint/node_modules/es5-ext/array/#/values/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/values/shim.js
      rename to tools/eslint/node_modules/es5-ext/array/#/values/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/_is-extensible.js b/tools/eslint/node_modules/es5-ext/array/_is-extensible.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/_is-extensible.js
      rename to tools/eslint/node_modules/es5-ext/array/_is-extensible.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/_sub-array-dummy-safe.js b/tools/eslint/node_modules/es5-ext/array/_sub-array-dummy-safe.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/_sub-array-dummy-safe.js
      rename to tools/eslint/node_modules/es5-ext/array/_sub-array-dummy-safe.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/_sub-array-dummy.js b/tools/eslint/node_modules/es5-ext/array/_sub-array-dummy.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/_sub-array-dummy.js
      rename to tools/eslint/node_modules/es5-ext/array/_sub-array-dummy.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/from/implement.js b/tools/eslint/node_modules/es5-ext/array/from/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/from/implement.js
      rename to tools/eslint/node_modules/es5-ext/array/from/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/from/index.js b/tools/eslint/node_modules/es5-ext/array/from/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/from/index.js
      rename to tools/eslint/node_modules/es5-ext/array/from/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/from/is-implemented.js b/tools/eslint/node_modules/es5-ext/array/from/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/from/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/array/from/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/from/shim.js b/tools/eslint/node_modules/es5-ext/array/from/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/from/shim.js
      rename to tools/eslint/node_modules/es5-ext/array/from/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/generate.js b/tools/eslint/node_modules/es5-ext/array/generate.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/generate.js
      rename to tools/eslint/node_modules/es5-ext/array/generate.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/index.js b/tools/eslint/node_modules/es5-ext/array/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/index.js
      rename to tools/eslint/node_modules/es5-ext/array/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/is-plain-array.js b/tools/eslint/node_modules/es5-ext/array/is-plain-array.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/is-plain-array.js
      rename to tools/eslint/node_modules/es5-ext/array/is-plain-array.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/of/implement.js b/tools/eslint/node_modules/es5-ext/array/of/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/of/implement.js
      rename to tools/eslint/node_modules/es5-ext/array/of/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/of/index.js b/tools/eslint/node_modules/es5-ext/array/of/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/of/index.js
      rename to tools/eslint/node_modules/es5-ext/array/of/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/of/is-implemented.js b/tools/eslint/node_modules/es5-ext/array/of/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/of/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/array/of/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/of/shim.js b/tools/eslint/node_modules/es5-ext/array/of/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/of/shim.js
      rename to tools/eslint/node_modules/es5-ext/array/of/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/to-array.js b/tools/eslint/node_modules/es5-ext/array/to-array.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/to-array.js
      rename to tools/eslint/node_modules/es5-ext/array/to-array.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/valid-array.js b/tools/eslint/node_modules/es5-ext/array/valid-array.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/valid-array.js
      rename to tools/eslint/node_modules/es5-ext/array/valid-array.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/boolean/index.js b/tools/eslint/node_modules/es5-ext/boolean/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/boolean/index.js
      rename to tools/eslint/node_modules/es5-ext/boolean/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/boolean/is-boolean.js b/tools/eslint/node_modules/es5-ext/boolean/is-boolean.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/boolean/is-boolean.js
      rename to tools/eslint/node_modules/es5-ext/boolean/is-boolean.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/date/#/copy.js b/tools/eslint/node_modules/es5-ext/date/#/copy.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/date/#/copy.js
      rename to tools/eslint/node_modules/es5-ext/date/#/copy.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/date/#/days-in-month.js b/tools/eslint/node_modules/es5-ext/date/#/days-in-month.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/date/#/days-in-month.js
      rename to tools/eslint/node_modules/es5-ext/date/#/days-in-month.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/date/#/floor-day.js b/tools/eslint/node_modules/es5-ext/date/#/floor-day.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/date/#/floor-day.js
      rename to tools/eslint/node_modules/es5-ext/date/#/floor-day.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/date/#/floor-month.js b/tools/eslint/node_modules/es5-ext/date/#/floor-month.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/date/#/floor-month.js
      rename to tools/eslint/node_modules/es5-ext/date/#/floor-month.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/date/#/floor-year.js b/tools/eslint/node_modules/es5-ext/date/#/floor-year.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/date/#/floor-year.js
      rename to tools/eslint/node_modules/es5-ext/date/#/floor-year.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/date/#/format.js b/tools/eslint/node_modules/es5-ext/date/#/format.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/date/#/format.js
      rename to tools/eslint/node_modules/es5-ext/date/#/format.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/date/#/index.js b/tools/eslint/node_modules/es5-ext/date/#/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/date/#/index.js
      rename to tools/eslint/node_modules/es5-ext/date/#/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/date/index.js b/tools/eslint/node_modules/es5-ext/date/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/date/index.js
      rename to tools/eslint/node_modules/es5-ext/date/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/date/is-date.js b/tools/eslint/node_modules/es5-ext/date/is-date.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/date/is-date.js
      rename to tools/eslint/node_modules/es5-ext/date/is-date.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/date/valid-date.js b/tools/eslint/node_modules/es5-ext/date/valid-date.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/date/valid-date.js
      rename to tools/eslint/node_modules/es5-ext/date/valid-date.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/error/#/index.js b/tools/eslint/node_modules/es5-ext/error/#/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/error/#/index.js
      rename to tools/eslint/node_modules/es5-ext/error/#/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/error/#/throw.js b/tools/eslint/node_modules/es5-ext/error/#/throw.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/error/#/throw.js
      rename to tools/eslint/node_modules/es5-ext/error/#/throw.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/error/custom.js b/tools/eslint/node_modules/es5-ext/error/custom.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/error/custom.js
      rename to tools/eslint/node_modules/es5-ext/error/custom.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/error/index.js b/tools/eslint/node_modules/es5-ext/error/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/error/index.js
      rename to tools/eslint/node_modules/es5-ext/error/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/error/is-error.js b/tools/eslint/node_modules/es5-ext/error/is-error.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/error/is-error.js
      rename to tools/eslint/node_modules/es5-ext/error/is-error.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/error/valid-error.js b/tools/eslint/node_modules/es5-ext/error/valid-error.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/error/valid-error.js
      rename to tools/eslint/node_modules/es5-ext/error/valid-error.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/#/compose.js b/tools/eslint/node_modules/es5-ext/function/#/compose.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/#/compose.js
      rename to tools/eslint/node_modules/es5-ext/function/#/compose.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/#/copy.js b/tools/eslint/node_modules/es5-ext/function/#/copy.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/#/copy.js
      rename to tools/eslint/node_modules/es5-ext/function/#/copy.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/#/curry.js b/tools/eslint/node_modules/es5-ext/function/#/curry.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/#/curry.js
      rename to tools/eslint/node_modules/es5-ext/function/#/curry.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/#/index.js b/tools/eslint/node_modules/es5-ext/function/#/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/#/index.js
      rename to tools/eslint/node_modules/es5-ext/function/#/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/#/lock.js b/tools/eslint/node_modules/es5-ext/function/#/lock.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/#/lock.js
      rename to tools/eslint/node_modules/es5-ext/function/#/lock.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/#/not.js b/tools/eslint/node_modules/es5-ext/function/#/not.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/#/not.js
      rename to tools/eslint/node_modules/es5-ext/function/#/not.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/#/partial.js b/tools/eslint/node_modules/es5-ext/function/#/partial.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/#/partial.js
      rename to tools/eslint/node_modules/es5-ext/function/#/partial.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/#/spread.js b/tools/eslint/node_modules/es5-ext/function/#/spread.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/#/spread.js
      rename to tools/eslint/node_modules/es5-ext/function/#/spread.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/#/to-string-tokens.js b/tools/eslint/node_modules/es5-ext/function/#/to-string-tokens.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/#/to-string-tokens.js
      rename to tools/eslint/node_modules/es5-ext/function/#/to-string-tokens.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/_define-length.js b/tools/eslint/node_modules/es5-ext/function/_define-length.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/_define-length.js
      rename to tools/eslint/node_modules/es5-ext/function/_define-length.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/constant.js b/tools/eslint/node_modules/es5-ext/function/constant.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/constant.js
      rename to tools/eslint/node_modules/es5-ext/function/constant.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/identity.js b/tools/eslint/node_modules/es5-ext/function/identity.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/identity.js
      rename to tools/eslint/node_modules/es5-ext/function/identity.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/index.js b/tools/eslint/node_modules/es5-ext/function/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/index.js
      rename to tools/eslint/node_modules/es5-ext/function/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/invoke.js b/tools/eslint/node_modules/es5-ext/function/invoke.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/invoke.js
      rename to tools/eslint/node_modules/es5-ext/function/invoke.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/is-arguments.js b/tools/eslint/node_modules/es5-ext/function/is-arguments.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/is-arguments.js
      rename to tools/eslint/node_modules/es5-ext/function/is-arguments.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/is-function.js b/tools/eslint/node_modules/es5-ext/function/is-function.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/is-function.js
      rename to tools/eslint/node_modules/es5-ext/function/is-function.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/noop.js b/tools/eslint/node_modules/es5-ext/function/noop.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/noop.js
      rename to tools/eslint/node_modules/es5-ext/function/noop.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/pluck.js b/tools/eslint/node_modules/es5-ext/function/pluck.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/pluck.js
      rename to tools/eslint/node_modules/es5-ext/function/pluck.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/valid-function.js b/tools/eslint/node_modules/es5-ext/function/valid-function.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/function/valid-function.js
      rename to tools/eslint/node_modules/es5-ext/function/valid-function.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/global.js b/tools/eslint/node_modules/es5-ext/global.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/global.js
      rename to tools/eslint/node_modules/es5-ext/global.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/index.js b/tools/eslint/node_modules/es5-ext/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/index.js
      rename to tools/eslint/node_modules/es5-ext/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/iterable/for-each.js b/tools/eslint/node_modules/es5-ext/iterable/for-each.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/iterable/for-each.js
      rename to tools/eslint/node_modules/es5-ext/iterable/for-each.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/iterable/index.js b/tools/eslint/node_modules/es5-ext/iterable/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/iterable/index.js
      rename to tools/eslint/node_modules/es5-ext/iterable/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/iterable/is.js b/tools/eslint/node_modules/es5-ext/iterable/is.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/iterable/is.js
      rename to tools/eslint/node_modules/es5-ext/iterable/is.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/iterable/validate-object.js b/tools/eslint/node_modules/es5-ext/iterable/validate-object.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/iterable/validate-object.js
      rename to tools/eslint/node_modules/es5-ext/iterable/validate-object.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/iterable/validate.js b/tools/eslint/node_modules/es5-ext/iterable/validate.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/iterable/validate.js
      rename to tools/eslint/node_modules/es5-ext/iterable/validate.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/_pack-ieee754.js b/tools/eslint/node_modules/es5-ext/math/_pack-ieee754.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/_pack-ieee754.js
      rename to tools/eslint/node_modules/es5-ext/math/_pack-ieee754.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/_unpack-ieee754.js b/tools/eslint/node_modules/es5-ext/math/_unpack-ieee754.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/_unpack-ieee754.js
      rename to tools/eslint/node_modules/es5-ext/math/_unpack-ieee754.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/acosh/implement.js b/tools/eslint/node_modules/es5-ext/math/acosh/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/acosh/implement.js
      rename to tools/eslint/node_modules/es5-ext/math/acosh/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/acosh/index.js b/tools/eslint/node_modules/es5-ext/math/acosh/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/acosh/index.js
      rename to tools/eslint/node_modules/es5-ext/math/acosh/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/acosh/is-implemented.js b/tools/eslint/node_modules/es5-ext/math/acosh/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/acosh/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/math/acosh/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/acosh/shim.js b/tools/eslint/node_modules/es5-ext/math/acosh/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/acosh/shim.js
      rename to tools/eslint/node_modules/es5-ext/math/acosh/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/asinh/implement.js b/tools/eslint/node_modules/es5-ext/math/asinh/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/asinh/implement.js
      rename to tools/eslint/node_modules/es5-ext/math/asinh/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/asinh/index.js b/tools/eslint/node_modules/es5-ext/math/asinh/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/asinh/index.js
      rename to tools/eslint/node_modules/es5-ext/math/asinh/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/asinh/is-implemented.js b/tools/eslint/node_modules/es5-ext/math/asinh/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/asinh/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/math/asinh/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/asinh/shim.js b/tools/eslint/node_modules/es5-ext/math/asinh/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/asinh/shim.js
      rename to tools/eslint/node_modules/es5-ext/math/asinh/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/atanh/implement.js b/tools/eslint/node_modules/es5-ext/math/atanh/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/atanh/implement.js
      rename to tools/eslint/node_modules/es5-ext/math/atanh/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/atanh/index.js b/tools/eslint/node_modules/es5-ext/math/atanh/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/atanh/index.js
      rename to tools/eslint/node_modules/es5-ext/math/atanh/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/atanh/is-implemented.js b/tools/eslint/node_modules/es5-ext/math/atanh/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/atanh/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/math/atanh/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/atanh/shim.js b/tools/eslint/node_modules/es5-ext/math/atanh/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/atanh/shim.js
      rename to tools/eslint/node_modules/es5-ext/math/atanh/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/cbrt/implement.js b/tools/eslint/node_modules/es5-ext/math/cbrt/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/cbrt/implement.js
      rename to tools/eslint/node_modules/es5-ext/math/cbrt/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/cbrt/index.js b/tools/eslint/node_modules/es5-ext/math/cbrt/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/cbrt/index.js
      rename to tools/eslint/node_modules/es5-ext/math/cbrt/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/cbrt/is-implemented.js b/tools/eslint/node_modules/es5-ext/math/cbrt/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/cbrt/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/math/cbrt/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/cbrt/shim.js b/tools/eslint/node_modules/es5-ext/math/cbrt/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/cbrt/shim.js
      rename to tools/eslint/node_modules/es5-ext/math/cbrt/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/clz32/implement.js b/tools/eslint/node_modules/es5-ext/math/clz32/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/clz32/implement.js
      rename to tools/eslint/node_modules/es5-ext/math/clz32/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/clz32/index.js b/tools/eslint/node_modules/es5-ext/math/clz32/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/clz32/index.js
      rename to tools/eslint/node_modules/es5-ext/math/clz32/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/clz32/is-implemented.js b/tools/eslint/node_modules/es5-ext/math/clz32/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/clz32/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/math/clz32/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/clz32/shim.js b/tools/eslint/node_modules/es5-ext/math/clz32/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/clz32/shim.js
      rename to tools/eslint/node_modules/es5-ext/math/clz32/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/cosh/implement.js b/tools/eslint/node_modules/es5-ext/math/cosh/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/cosh/implement.js
      rename to tools/eslint/node_modules/es5-ext/math/cosh/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/cosh/index.js b/tools/eslint/node_modules/es5-ext/math/cosh/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/cosh/index.js
      rename to tools/eslint/node_modules/es5-ext/math/cosh/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/cosh/is-implemented.js b/tools/eslint/node_modules/es5-ext/math/cosh/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/cosh/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/math/cosh/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/cosh/shim.js b/tools/eslint/node_modules/es5-ext/math/cosh/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/cosh/shim.js
      rename to tools/eslint/node_modules/es5-ext/math/cosh/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/expm1/implement.js b/tools/eslint/node_modules/es5-ext/math/expm1/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/expm1/implement.js
      rename to tools/eslint/node_modules/es5-ext/math/expm1/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/expm1/index.js b/tools/eslint/node_modules/es5-ext/math/expm1/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/expm1/index.js
      rename to tools/eslint/node_modules/es5-ext/math/expm1/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/expm1/is-implemented.js b/tools/eslint/node_modules/es5-ext/math/expm1/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/expm1/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/math/expm1/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/expm1/shim.js b/tools/eslint/node_modules/es5-ext/math/expm1/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/expm1/shim.js
      rename to tools/eslint/node_modules/es5-ext/math/expm1/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/fround/implement.js b/tools/eslint/node_modules/es5-ext/math/fround/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/fround/implement.js
      rename to tools/eslint/node_modules/es5-ext/math/fround/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/fround/index.js b/tools/eslint/node_modules/es5-ext/math/fround/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/fround/index.js
      rename to tools/eslint/node_modules/es5-ext/math/fround/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/fround/is-implemented.js b/tools/eslint/node_modules/es5-ext/math/fround/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/fround/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/math/fround/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/fround/shim.js b/tools/eslint/node_modules/es5-ext/math/fround/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/fround/shim.js
      rename to tools/eslint/node_modules/es5-ext/math/fround/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/hypot/implement.js b/tools/eslint/node_modules/es5-ext/math/hypot/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/hypot/implement.js
      rename to tools/eslint/node_modules/es5-ext/math/hypot/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/hypot/index.js b/tools/eslint/node_modules/es5-ext/math/hypot/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/hypot/index.js
      rename to tools/eslint/node_modules/es5-ext/math/hypot/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/hypot/is-implemented.js b/tools/eslint/node_modules/es5-ext/math/hypot/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/hypot/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/math/hypot/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/hypot/shim.js b/tools/eslint/node_modules/es5-ext/math/hypot/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/hypot/shim.js
      rename to tools/eslint/node_modules/es5-ext/math/hypot/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/imul/implement.js b/tools/eslint/node_modules/es5-ext/math/imul/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/imul/implement.js
      rename to tools/eslint/node_modules/es5-ext/math/imul/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/imul/index.js b/tools/eslint/node_modules/es5-ext/math/imul/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/imul/index.js
      rename to tools/eslint/node_modules/es5-ext/math/imul/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/imul/is-implemented.js b/tools/eslint/node_modules/es5-ext/math/imul/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/imul/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/math/imul/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/imul/shim.js b/tools/eslint/node_modules/es5-ext/math/imul/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/imul/shim.js
      rename to tools/eslint/node_modules/es5-ext/math/imul/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/index.js b/tools/eslint/node_modules/es5-ext/math/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/index.js
      rename to tools/eslint/node_modules/es5-ext/math/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/log10/implement.js b/tools/eslint/node_modules/es5-ext/math/log10/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/log10/implement.js
      rename to tools/eslint/node_modules/es5-ext/math/log10/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/log10/index.js b/tools/eslint/node_modules/es5-ext/math/log10/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/log10/index.js
      rename to tools/eslint/node_modules/es5-ext/math/log10/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/log10/is-implemented.js b/tools/eslint/node_modules/es5-ext/math/log10/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/log10/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/math/log10/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/log10/shim.js b/tools/eslint/node_modules/es5-ext/math/log10/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/log10/shim.js
      rename to tools/eslint/node_modules/es5-ext/math/log10/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/log1p/implement.js b/tools/eslint/node_modules/es5-ext/math/log1p/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/log1p/implement.js
      rename to tools/eslint/node_modules/es5-ext/math/log1p/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/log1p/index.js b/tools/eslint/node_modules/es5-ext/math/log1p/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/log1p/index.js
      rename to tools/eslint/node_modules/es5-ext/math/log1p/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/log1p/is-implemented.js b/tools/eslint/node_modules/es5-ext/math/log1p/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/log1p/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/math/log1p/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/log1p/shim.js b/tools/eslint/node_modules/es5-ext/math/log1p/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/log1p/shim.js
      rename to tools/eslint/node_modules/es5-ext/math/log1p/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/log2/implement.js b/tools/eslint/node_modules/es5-ext/math/log2/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/log2/implement.js
      rename to tools/eslint/node_modules/es5-ext/math/log2/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/log2/index.js b/tools/eslint/node_modules/es5-ext/math/log2/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/log2/index.js
      rename to tools/eslint/node_modules/es5-ext/math/log2/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/log2/is-implemented.js b/tools/eslint/node_modules/es5-ext/math/log2/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/log2/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/math/log2/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/log2/shim.js b/tools/eslint/node_modules/es5-ext/math/log2/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/log2/shim.js
      rename to tools/eslint/node_modules/es5-ext/math/log2/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/sign/implement.js b/tools/eslint/node_modules/es5-ext/math/sign/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/sign/implement.js
      rename to tools/eslint/node_modules/es5-ext/math/sign/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/sign/index.js b/tools/eslint/node_modules/es5-ext/math/sign/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/sign/index.js
      rename to tools/eslint/node_modules/es5-ext/math/sign/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/sign/is-implemented.js b/tools/eslint/node_modules/es5-ext/math/sign/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/sign/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/math/sign/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/sign/shim.js b/tools/eslint/node_modules/es5-ext/math/sign/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/sign/shim.js
      rename to tools/eslint/node_modules/es5-ext/math/sign/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/sinh/implement.js b/tools/eslint/node_modules/es5-ext/math/sinh/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/sinh/implement.js
      rename to tools/eslint/node_modules/es5-ext/math/sinh/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/sinh/index.js b/tools/eslint/node_modules/es5-ext/math/sinh/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/sinh/index.js
      rename to tools/eslint/node_modules/es5-ext/math/sinh/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/sinh/is-implemented.js b/tools/eslint/node_modules/es5-ext/math/sinh/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/sinh/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/math/sinh/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/sinh/shim.js b/tools/eslint/node_modules/es5-ext/math/sinh/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/sinh/shim.js
      rename to tools/eslint/node_modules/es5-ext/math/sinh/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/tanh/implement.js b/tools/eslint/node_modules/es5-ext/math/tanh/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/tanh/implement.js
      rename to tools/eslint/node_modules/es5-ext/math/tanh/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/tanh/index.js b/tools/eslint/node_modules/es5-ext/math/tanh/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/tanh/index.js
      rename to tools/eslint/node_modules/es5-ext/math/tanh/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/tanh/is-implemented.js b/tools/eslint/node_modules/es5-ext/math/tanh/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/tanh/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/math/tanh/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/tanh/shim.js b/tools/eslint/node_modules/es5-ext/math/tanh/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/tanh/shim.js
      rename to tools/eslint/node_modules/es5-ext/math/tanh/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/trunc/implement.js b/tools/eslint/node_modules/es5-ext/math/trunc/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/trunc/implement.js
      rename to tools/eslint/node_modules/es5-ext/math/trunc/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/trunc/index.js b/tools/eslint/node_modules/es5-ext/math/trunc/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/trunc/index.js
      rename to tools/eslint/node_modules/es5-ext/math/trunc/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/trunc/is-implemented.js b/tools/eslint/node_modules/es5-ext/math/trunc/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/trunc/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/math/trunc/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/trunc/shim.js b/tools/eslint/node_modules/es5-ext/math/trunc/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/math/trunc/shim.js
      rename to tools/eslint/node_modules/es5-ext/math/trunc/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/#/index.js b/tools/eslint/node_modules/es5-ext/number/#/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/#/index.js
      rename to tools/eslint/node_modules/es5-ext/number/#/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/#/pad.js b/tools/eslint/node_modules/es5-ext/number/#/pad.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/#/pad.js
      rename to tools/eslint/node_modules/es5-ext/number/#/pad.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/epsilon/implement.js b/tools/eslint/node_modules/es5-ext/number/epsilon/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/epsilon/implement.js
      rename to tools/eslint/node_modules/es5-ext/number/epsilon/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/epsilon/index.js b/tools/eslint/node_modules/es5-ext/number/epsilon/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/epsilon/index.js
      rename to tools/eslint/node_modules/es5-ext/number/epsilon/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/epsilon/is-implemented.js b/tools/eslint/node_modules/es5-ext/number/epsilon/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/epsilon/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/number/epsilon/is-implemented.js
      diff --git a/tools/eslint/node_modules/es5-ext/number/index.js b/tools/eslint/node_modules/es5-ext/number/index.js
      new file mode 100644
      index 00000000000000..841b3612c0a7ca
      --- /dev/null
      +++ b/tools/eslint/node_modules/es5-ext/number/index.js
      @@ -0,0 +1,17 @@
      +'use strict';
      +
      +module.exports = {
      +	'#':              require('./#'),
      +	EPSILON:          require('./epsilon'),
      +	isFinite:         require('./is-finite'),
      +	isInteger:        require('./is-integer'),
      +	isNaN:            require('./is-nan'),
      +	isNatural:        require('./is-natural'),
      +	isNumber:         require('./is-number'),
      +	isSafeInteger:    require('./is-safe-integer'),
      +	MAX_SAFE_INTEGER: require('./max-safe-integer'),
      +	MIN_SAFE_INTEGER: require('./min-safe-integer'),
      +	toInteger:        require('./to-integer'),
      +	toPosInteger:     require('./to-pos-integer'),
      +	toUint32:         require('./to-uint32')
      +};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-finite/implement.js b/tools/eslint/node_modules/es5-ext/number/is-finite/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-finite/implement.js
      rename to tools/eslint/node_modules/es5-ext/number/is-finite/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-finite/index.js b/tools/eslint/node_modules/es5-ext/number/is-finite/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-finite/index.js
      rename to tools/eslint/node_modules/es5-ext/number/is-finite/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-finite/is-implemented.js b/tools/eslint/node_modules/es5-ext/number/is-finite/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-finite/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/number/is-finite/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-finite/shim.js b/tools/eslint/node_modules/es5-ext/number/is-finite/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-finite/shim.js
      rename to tools/eslint/node_modules/es5-ext/number/is-finite/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-integer/implement.js b/tools/eslint/node_modules/es5-ext/number/is-integer/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-integer/implement.js
      rename to tools/eslint/node_modules/es5-ext/number/is-integer/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-integer/index.js b/tools/eslint/node_modules/es5-ext/number/is-integer/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-integer/index.js
      rename to tools/eslint/node_modules/es5-ext/number/is-integer/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-integer/is-implemented.js b/tools/eslint/node_modules/es5-ext/number/is-integer/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-integer/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/number/is-integer/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-integer/shim.js b/tools/eslint/node_modules/es5-ext/number/is-integer/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-integer/shim.js
      rename to tools/eslint/node_modules/es5-ext/number/is-integer/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-nan/implement.js b/tools/eslint/node_modules/es5-ext/number/is-nan/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-nan/implement.js
      rename to tools/eslint/node_modules/es5-ext/number/is-nan/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-nan/index.js b/tools/eslint/node_modules/es5-ext/number/is-nan/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-nan/index.js
      rename to tools/eslint/node_modules/es5-ext/number/is-nan/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-nan/is-implemented.js b/tools/eslint/node_modules/es5-ext/number/is-nan/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-nan/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/number/is-nan/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-nan/shim.js b/tools/eslint/node_modules/es5-ext/number/is-nan/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-nan/shim.js
      rename to tools/eslint/node_modules/es5-ext/number/is-nan/shim.js
      diff --git a/tools/eslint/node_modules/es5-ext/number/is-natural.js b/tools/eslint/node_modules/es5-ext/number/is-natural.js
      new file mode 100644
      index 00000000000000..831090d23c3745
      --- /dev/null
      +++ b/tools/eslint/node_modules/es5-ext/number/is-natural.js
      @@ -0,0 +1,5 @@
      +'use strict';
      +
      +var isInteger = require('./is-integer');
      +
      +module.exports = function (num) { return isInteger(num) && (num >= 0); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-number.js b/tools/eslint/node_modules/es5-ext/number/is-number.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-number.js
      rename to tools/eslint/node_modules/es5-ext/number/is-number.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-safe-integer/implement.js b/tools/eslint/node_modules/es5-ext/number/is-safe-integer/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-safe-integer/implement.js
      rename to tools/eslint/node_modules/es5-ext/number/is-safe-integer/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-safe-integer/index.js b/tools/eslint/node_modules/es5-ext/number/is-safe-integer/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-safe-integer/index.js
      rename to tools/eslint/node_modules/es5-ext/number/is-safe-integer/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-safe-integer/is-implemented.js b/tools/eslint/node_modules/es5-ext/number/is-safe-integer/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-safe-integer/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/number/is-safe-integer/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-safe-integer/shim.js b/tools/eslint/node_modules/es5-ext/number/is-safe-integer/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/is-safe-integer/shim.js
      rename to tools/eslint/node_modules/es5-ext/number/is-safe-integer/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/max-safe-integer/implement.js b/tools/eslint/node_modules/es5-ext/number/max-safe-integer/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/max-safe-integer/implement.js
      rename to tools/eslint/node_modules/es5-ext/number/max-safe-integer/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/max-safe-integer/index.js b/tools/eslint/node_modules/es5-ext/number/max-safe-integer/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/max-safe-integer/index.js
      rename to tools/eslint/node_modules/es5-ext/number/max-safe-integer/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/max-safe-integer/is-implemented.js b/tools/eslint/node_modules/es5-ext/number/max-safe-integer/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/max-safe-integer/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/number/max-safe-integer/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/min-safe-integer/implement.js b/tools/eslint/node_modules/es5-ext/number/min-safe-integer/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/min-safe-integer/implement.js
      rename to tools/eslint/node_modules/es5-ext/number/min-safe-integer/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/min-safe-integer/index.js b/tools/eslint/node_modules/es5-ext/number/min-safe-integer/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/min-safe-integer/index.js
      rename to tools/eslint/node_modules/es5-ext/number/min-safe-integer/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/min-safe-integer/is-implemented.js b/tools/eslint/node_modules/es5-ext/number/min-safe-integer/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/min-safe-integer/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/number/min-safe-integer/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/to-integer.js b/tools/eslint/node_modules/es5-ext/number/to-integer.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/to-integer.js
      rename to tools/eslint/node_modules/es5-ext/number/to-integer.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/to-pos-integer.js b/tools/eslint/node_modules/es5-ext/number/to-pos-integer.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/to-pos-integer.js
      rename to tools/eslint/node_modules/es5-ext/number/to-pos-integer.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/to-uint32.js b/tools/eslint/node_modules/es5-ext/number/to-uint32.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/to-uint32.js
      rename to tools/eslint/node_modules/es5-ext/number/to-uint32.js
      diff --git a/tools/eslint/node_modules/es5-ext/object/_iterate.js b/tools/eslint/node_modules/es5-ext/object/_iterate.js
      new file mode 100644
      index 00000000000000..1ccbaf2742eb16
      --- /dev/null
      +++ b/tools/eslint/node_modules/es5-ext/object/_iterate.js
      @@ -0,0 +1,29 @@
      +// Internal method, used by iteration functions.
      +// Calls a function for each key-value pair found in object
      +// Optionally takes compareFn to iterate object in specific order
      +
      +'use strict';
      +
      +var callable = require('./valid-callable')
      +  , value    = require('./valid-value')
      +
      +  , bind = Function.prototype.bind, call = Function.prototype.call, keys = Object.keys
      +  , propertyIsEnumerable = Object.prototype.propertyIsEnumerable;
      +
      +module.exports = function (method, defVal) {
      +	return function (obj, cb/*, thisArg, compareFn*/) {
      +		var list, thisArg = arguments[2], compareFn = arguments[3];
      +		obj = Object(value(obj));
      +		callable(cb);
      +
      +		list = keys(obj);
      +		if (compareFn) {
      +			list.sort((typeof compareFn === 'function') ? bind.call(compareFn, obj) : undefined);
      +		}
      +		if (typeof method !== 'function') method = list[method];
      +		return call.call(method, list, function (key, index) {
      +			if (!propertyIsEnumerable.call(obj, key)) return defVal;
      +			return call.call(cb, thisArg, obj[key], key, obj, index);
      +		});
      +	};
      +};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/assign/implement.js b/tools/eslint/node_modules/es5-ext/object/assign/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/assign/implement.js
      rename to tools/eslint/node_modules/es5-ext/object/assign/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/assign/index.js b/tools/eslint/node_modules/es5-ext/object/assign/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/assign/index.js
      rename to tools/eslint/node_modules/es5-ext/object/assign/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/assign/is-implemented.js b/tools/eslint/node_modules/es5-ext/object/assign/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/assign/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/object/assign/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/assign/shim.js b/tools/eslint/node_modules/es5-ext/object/assign/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/assign/shim.js
      rename to tools/eslint/node_modules/es5-ext/object/assign/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/clear.js b/tools/eslint/node_modules/es5-ext/object/clear.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/clear.js
      rename to tools/eslint/node_modules/es5-ext/object/clear.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/compact.js b/tools/eslint/node_modules/es5-ext/object/compact.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/compact.js
      rename to tools/eslint/node_modules/es5-ext/object/compact.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/compare.js b/tools/eslint/node_modules/es5-ext/object/compare.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/compare.js
      rename to tools/eslint/node_modules/es5-ext/object/compare.js
      diff --git a/tools/eslint/node_modules/es5-ext/object/copy-deep.js b/tools/eslint/node_modules/es5-ext/object/copy-deep.js
      new file mode 100644
      index 00000000000000..b203a7c6934c57
      --- /dev/null
      +++ b/tools/eslint/node_modules/es5-ext/object/copy-deep.js
      @@ -0,0 +1,38 @@
      +'use strict';
      +
      +var forEach       = require('./for-each')
      +  , isPlainObject = require('./is-plain-object')
      +  , value         = require('./valid-value')
      +
      +  , isArray = Array.isArray
      +  , copy, copyItem;
      +
      +copyItem = function (value, key) {
      +	var index;
      +	if (!isPlainObject(value) && !isArray(value)) return value;
      +	index = this[0].indexOf(value);
      +	if (index === -1) return copy.call(this, value);
      +	return this[1][index];
      +};
      +
      +copy = function (source) {
      +	var target = isArray(source) ? [] : {};
      +	this[0].push(source);
      +	this[1].push(target);
      +	if (isArray(source)) {
      +		source.forEach(function (value, key) {
      +			target[key] = copyItem.call(this, value, key);
      +		}, this);
      +	} else {
      +		forEach(source, function (value, key) {
      +			target[key] = copyItem.call(this, value, key);
      +		}, this);
      +	}
      +	return target;
      +};
      +
      +module.exports = function (source) {
      +	var obj = Object(value(source));
      +	if (obj !== source) return obj;
      +	return copy.call([[], []], obj);
      +};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/copy.js b/tools/eslint/node_modules/es5-ext/object/copy.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/copy.js
      rename to tools/eslint/node_modules/es5-ext/object/copy.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/count.js b/tools/eslint/node_modules/es5-ext/object/count.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/count.js
      rename to tools/eslint/node_modules/es5-ext/object/count.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/create.js b/tools/eslint/node_modules/es5-ext/object/create.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/create.js
      rename to tools/eslint/node_modules/es5-ext/object/create.js
      diff --git a/tools/eslint/node_modules/es5-ext/object/ensure-natural-number-value.js b/tools/eslint/node_modules/es5-ext/object/ensure-natural-number-value.js
      new file mode 100644
      index 00000000000000..f58fb4e4a709f5
      --- /dev/null
      +++ b/tools/eslint/node_modules/es5-ext/object/ensure-natural-number-value.js
      @@ -0,0 +1,8 @@
      +'use strict';
      +
      +var ensure = require('./ensure-natural-number');
      +
      +module.exports = function (arg) {
      +	if (arg == null) throw new TypeError(arg + " is not a natural number");
      +	return ensure(arg);
      +};
      diff --git a/tools/eslint/node_modules/es5-ext/object/ensure-natural-number.js b/tools/eslint/node_modules/es5-ext/object/ensure-natural-number.js
      new file mode 100644
      index 00000000000000..af9b4d77c29efe
      --- /dev/null
      +++ b/tools/eslint/node_modules/es5-ext/object/ensure-natural-number.js
      @@ -0,0 +1,9 @@
      +'use strict';
      +
      +var isNatural = require('../number/is-natural');
      +
      +module.exports = function (arg) {
      +	var num = Number(arg);
      +	if (!isNatural(num)) throw new TypeError(arg + " is not a natural number");
      +	return num;
      +};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/eq.js b/tools/eslint/node_modules/es5-ext/object/eq.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/eq.js
      rename to tools/eslint/node_modules/es5-ext/object/eq.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/every.js b/tools/eslint/node_modules/es5-ext/object/every.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/every.js
      rename to tools/eslint/node_modules/es5-ext/object/every.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/filter.js b/tools/eslint/node_modules/es5-ext/object/filter.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/filter.js
      rename to tools/eslint/node_modules/es5-ext/object/filter.js
      diff --git a/tools/eslint/node_modules/es5-ext/object/find-key.js b/tools/eslint/node_modules/es5-ext/object/find-key.js
      new file mode 100644
      index 00000000000000..5841fd709a4f86
      --- /dev/null
      +++ b/tools/eslint/node_modules/es5-ext/object/find-key.js
      @@ -0,0 +1,3 @@
      +'use strict';
      +
      +module.exports = require('./_iterate')(require('../array/#/find'), false);
      diff --git a/tools/eslint/node_modules/es5-ext/object/find.js b/tools/eslint/node_modules/es5-ext/object/find.js
      new file mode 100644
      index 00000000000000..c94f643f3f50c6
      --- /dev/null
      +++ b/tools/eslint/node_modules/es5-ext/object/find.js
      @@ -0,0 +1,8 @@
      +'use strict';
      +
      +var findKey = require('./find-key');
      +
      +module.exports = function (obj, cb/*, thisArg, compareFn*/) {
      +	var key = findKey.apply(this, arguments);
      +	return (key == null) ? key : obj[key];
      +};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/first-key.js b/tools/eslint/node_modules/es5-ext/object/first-key.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/first-key.js
      rename to tools/eslint/node_modules/es5-ext/object/first-key.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/flatten.js b/tools/eslint/node_modules/es5-ext/object/flatten.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/flatten.js
      rename to tools/eslint/node_modules/es5-ext/object/flatten.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/for-each.js b/tools/eslint/node_modules/es5-ext/object/for-each.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/for-each.js
      rename to tools/eslint/node_modules/es5-ext/object/for-each.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/get-property-names.js b/tools/eslint/node_modules/es5-ext/object/get-property-names.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/get-property-names.js
      rename to tools/eslint/node_modules/es5-ext/object/get-property-names.js
      diff --git a/tools/eslint/node_modules/es5-ext/object/index.js b/tools/eslint/node_modules/es5-ext/object/index.js
      new file mode 100644
      index 00000000000000..77f5b6aebab1e1
      --- /dev/null
      +++ b/tools/eslint/node_modules/es5-ext/object/index.js
      @@ -0,0 +1,53 @@
      +'use strict';
      +
      +module.exports = {
      +	assign:                     require('./assign'),
      +	clear:                      require('./clear'),
      +	compact:                    require('./compact'),
      +	compare:                    require('./compare'),
      +	copy:                       require('./copy'),
      +	copyDeep:                   require('./copy-deep'),
      +	count:                      require('./count'),
      +	create:                     require('./create'),
      +	ensureNaturalNumber:        require('./ensure-natural-number'),
      +	ensureNaturalNumberValue:   require('./ensure-natural-number-value'),
      +	eq:                         require('./eq'),
      +	every:                      require('./every'),
      +	filter:                     require('./filter'),
      +	find:                       require('./find'),
      +	findKey:                    require('./find-key'),
      +	firstKey:                   require('./first-key'),
      +	flatten:                    require('./flatten'),
      +	forEach:                    require('./for-each'),
      +	getPropertyNames:           require('./get-property-names'),
      +	is:                         require('./is'),
      +	isArrayLike:                require('./is-array-like'),
      +	isCallable:                 require('./is-callable'),
      +	isCopy:                     require('./is-copy'),
      +	isCopyDeep:                 require('./is-copy-deep'),
      +	isEmpty:                    require('./is-empty'),
      +	isNumberValue:              require('./is-number-value'),
      +	isObject:                   require('./is-object'),
      +	isPlainObject:              require('./is-plain-object'),
      +	keyOf:                      require('./key-of'),
      +	keys:                       require('./keys'),
      +	map:                        require('./map'),
      +	mapKeys:                    require('./map-keys'),
      +	normalizeOptions:           require('./normalize-options'),
      +	mixin:                      require('./mixin'),
      +	mixinPrototypes:            require('./mixin-prototypes'),
      +	primitiveSet:               require('./primitive-set'),
      +	safeTraverse:               require('./safe-traverse'),
      +	serialize:                  require('./serialize'),
      +	setPrototypeOf:             require('./set-prototype-of'),
      +	some:                       require('./some'),
      +	toArray:                    require('./to-array'),
      +	unserialize:                require('./unserialize'),
      +	validateArrayLike:          require('./validate-array-like'),
      +	validateArrayLikeObject:    require('./validate-array-like-object'),
      +	validCallable:              require('./valid-callable'),
      +	validObject:                require('./valid-object'),
      +	validateStringifiable:      require('./validate-stringifiable'),
      +	validateStringifiableValue: require('./validate-stringifiable-value'),
      +	validValue:                 require('./valid-value')
      +};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/is-array-like.js b/tools/eslint/node_modules/es5-ext/object/is-array-like.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/is-array-like.js
      rename to tools/eslint/node_modules/es5-ext/object/is-array-like.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/is-callable.js b/tools/eslint/node_modules/es5-ext/object/is-callable.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/is-callable.js
      rename to tools/eslint/node_modules/es5-ext/object/is-callable.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/is-copy-deep.js b/tools/eslint/node_modules/es5-ext/object/is-copy-deep.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/is-copy-deep.js
      rename to tools/eslint/node_modules/es5-ext/object/is-copy-deep.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/is-copy.js b/tools/eslint/node_modules/es5-ext/object/is-copy.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/is-copy.js
      rename to tools/eslint/node_modules/es5-ext/object/is-copy.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/is-empty.js b/tools/eslint/node_modules/es5-ext/object/is-empty.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/is-empty.js
      rename to tools/eslint/node_modules/es5-ext/object/is-empty.js
      diff --git a/tools/eslint/node_modules/es5-ext/object/is-number-value.js b/tools/eslint/node_modules/es5-ext/object/is-number-value.js
      new file mode 100644
      index 00000000000000..f6396f580f8911
      --- /dev/null
      +++ b/tools/eslint/node_modules/es5-ext/object/is-number-value.js
      @@ -0,0 +1,3 @@
      +'use strict';
      +
      +module.exports = function (value) { return (value != null) && !isNaN(value); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/is-object.js b/tools/eslint/node_modules/es5-ext/object/is-object.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/is-object.js
      rename to tools/eslint/node_modules/es5-ext/object/is-object.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/is-plain-object.js b/tools/eslint/node_modules/es5-ext/object/is-plain-object.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/is-plain-object.js
      rename to tools/eslint/node_modules/es5-ext/object/is-plain-object.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/is.js b/tools/eslint/node_modules/es5-ext/object/is.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/is.js
      rename to tools/eslint/node_modules/es5-ext/object/is.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/key-of.js b/tools/eslint/node_modules/es5-ext/object/key-of.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/key-of.js
      rename to tools/eslint/node_modules/es5-ext/object/key-of.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/keys/implement.js b/tools/eslint/node_modules/es5-ext/object/keys/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/keys/implement.js
      rename to tools/eslint/node_modules/es5-ext/object/keys/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/keys/index.js b/tools/eslint/node_modules/es5-ext/object/keys/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/keys/index.js
      rename to tools/eslint/node_modules/es5-ext/object/keys/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/keys/is-implemented.js b/tools/eslint/node_modules/es5-ext/object/keys/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/keys/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/object/keys/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/keys/shim.js b/tools/eslint/node_modules/es5-ext/object/keys/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/keys/shim.js
      rename to tools/eslint/node_modules/es5-ext/object/keys/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/map-keys.js b/tools/eslint/node_modules/es5-ext/object/map-keys.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/map-keys.js
      rename to tools/eslint/node_modules/es5-ext/object/map-keys.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/map.js b/tools/eslint/node_modules/es5-ext/object/map.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/map.js
      rename to tools/eslint/node_modules/es5-ext/object/map.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/mixin-prototypes.js b/tools/eslint/node_modules/es5-ext/object/mixin-prototypes.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/mixin-prototypes.js
      rename to tools/eslint/node_modules/es5-ext/object/mixin-prototypes.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/mixin.js b/tools/eslint/node_modules/es5-ext/object/mixin.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/mixin.js
      rename to tools/eslint/node_modules/es5-ext/object/mixin.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/normalize-options.js b/tools/eslint/node_modules/es5-ext/object/normalize-options.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/normalize-options.js
      rename to tools/eslint/node_modules/es5-ext/object/normalize-options.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/primitive-set.js b/tools/eslint/node_modules/es5-ext/object/primitive-set.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/primitive-set.js
      rename to tools/eslint/node_modules/es5-ext/object/primitive-set.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/safe-traverse.js b/tools/eslint/node_modules/es5-ext/object/safe-traverse.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/safe-traverse.js
      rename to tools/eslint/node_modules/es5-ext/object/safe-traverse.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/serialize.js b/tools/eslint/node_modules/es5-ext/object/serialize.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/serialize.js
      rename to tools/eslint/node_modules/es5-ext/object/serialize.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/set-prototype-of/implement.js b/tools/eslint/node_modules/es5-ext/object/set-prototype-of/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/set-prototype-of/implement.js
      rename to tools/eslint/node_modules/es5-ext/object/set-prototype-of/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/set-prototype-of/index.js b/tools/eslint/node_modules/es5-ext/object/set-prototype-of/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/set-prototype-of/index.js
      rename to tools/eslint/node_modules/es5-ext/object/set-prototype-of/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/set-prototype-of/is-implemented.js b/tools/eslint/node_modules/es5-ext/object/set-prototype-of/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/set-prototype-of/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/object/set-prototype-of/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/set-prototype-of/shim.js b/tools/eslint/node_modules/es5-ext/object/set-prototype-of/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/set-prototype-of/shim.js
      rename to tools/eslint/node_modules/es5-ext/object/set-prototype-of/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/some.js b/tools/eslint/node_modules/es5-ext/object/some.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/some.js
      rename to tools/eslint/node_modules/es5-ext/object/some.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/to-array.js b/tools/eslint/node_modules/es5-ext/object/to-array.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/to-array.js
      rename to tools/eslint/node_modules/es5-ext/object/to-array.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/unserialize.js b/tools/eslint/node_modules/es5-ext/object/unserialize.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/unserialize.js
      rename to tools/eslint/node_modules/es5-ext/object/unserialize.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/valid-callable.js b/tools/eslint/node_modules/es5-ext/object/valid-callable.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/valid-callable.js
      rename to tools/eslint/node_modules/es5-ext/object/valid-callable.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/valid-object.js b/tools/eslint/node_modules/es5-ext/object/valid-object.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/valid-object.js
      rename to tools/eslint/node_modules/es5-ext/object/valid-object.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/valid-value.js b/tools/eslint/node_modules/es5-ext/object/valid-value.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/valid-value.js
      rename to tools/eslint/node_modules/es5-ext/object/valid-value.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/validate-array-like-object.js b/tools/eslint/node_modules/es5-ext/object/validate-array-like-object.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/validate-array-like-object.js
      rename to tools/eslint/node_modules/es5-ext/object/validate-array-like-object.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/validate-array-like.js b/tools/eslint/node_modules/es5-ext/object/validate-array-like.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/validate-array-like.js
      rename to tools/eslint/node_modules/es5-ext/object/validate-array-like.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/validate-stringifiable-value.js b/tools/eslint/node_modules/es5-ext/object/validate-stringifiable-value.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/validate-stringifiable-value.js
      rename to tools/eslint/node_modules/es5-ext/object/validate-stringifiable-value.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/validate-stringifiable.js b/tools/eslint/node_modules/es5-ext/object/validate-stringifiable.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/validate-stringifiable.js
      rename to tools/eslint/node_modules/es5-ext/object/validate-stringifiable.js
      diff --git a/tools/eslint/node_modules/es5-ext/package.json b/tools/eslint/node_modules/es5-ext/package.json
      new file mode 100644
      index 00000000000000..6a36f4f0dfd7b9
      --- /dev/null
      +++ b/tools/eslint/node_modules/es5-ext/package.json
      @@ -0,0 +1,105 @@
      +{
      +  "_args": [
      +    [
      +      "es5-ext@~0.10.8",
      +      "/Users/silverwind/git/node/tools/package/package/node_modules/es6-map"
      +    ]
      +  ],
      +  "_from": "es5-ext@>=0.10.8 <0.11.0",
      +  "_id": "es5-ext@0.10.11",
      +  "_inCache": true,
      +  "_installable": true,
      +  "_location": "/es5-ext",
      +  "_nodeVersion": "4.2.3",
      +  "_npmUser": {
      +    "email": "medikoo+npm@medikoo.com",
      +    "name": "medikoo"
      +  },
      +  "_npmVersion": "2.14.7",
      +  "_phantomChildren": {},
      +  "_requested": {
      +    "name": "es5-ext",
      +    "raw": "es5-ext@~0.10.8",
      +    "rawSpec": "~0.10.8",
      +    "scope": null,
      +    "spec": ">=0.10.8 <0.11.0",
      +    "type": "range"
      +  },
      +  "_requiredBy": [
      +    "/d",
      +    "/es6-iterator",
      +    "/es6-map",
      +    "/es6-set",
      +    "/es6-symbol",
      +    "/es6-weak-map",
      +    "/event-emitter"
      +  ],
      +  "_resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.11.tgz",
      +  "_shasum": "8184c3e705a820948c2dbe043849379b1dbd0c45",
      +  "_shrinkwrap": null,
      +  "_spec": "es5-ext@~0.10.8",
      +  "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/es6-map",
      +  "author": {
      +    "email": "medyk@medikoo.com",
      +    "name": "Mariusz Nowak",
      +    "url": "http://www.medikoo.com/"
      +  },
      +  "bugs": {
      +    "url": "https://github.com/medikoo/es5-ext/issues"
      +  },
      +  "dependencies": {
      +    "es6-iterator": "2",
      +    "es6-symbol": "~3.0.2"
      +  },
      +  "description": "ECMAScript extensions and shims",
      +  "devDependencies": {
      +    "tad": "~0.2.4",
      +    "xlint": "~0.2.2",
      +    "xlint-jslint-medikoo": "~0.1.4"
      +  },
      +  "directories": {},
      +  "dist": {
      +    "shasum": "8184c3e705a820948c2dbe043849379b1dbd0c45",
      +    "tarball": "http://registry.npmjs.org/es5-ext/-/es5-ext-0.10.11.tgz"
      +  },
      +  "gitHead": "aba94140a6bf79ce1a448a2db8834e8c1842b527",
      +  "homepage": "https://github.com/medikoo/es5-ext#readme",
      +  "keywords": [
      +    "addons",
      +    "ecmascript",
      +    "ecmascript5",
      +    "ecmascript6",
      +    "es5",
      +    "es6",
      +    "ext",
      +    "extensions",
      +    "extras",
      +    "harmony",
      +    "javascript",
      +    "polyfill",
      +    "shim",
      +    "util",
      +    "utilities",
      +    "utils"
      +  ],
      +  "license": "MIT",
      +  "maintainers": [
      +    {
      +      "name": "medikoo",
      +      "email": "medikoo+npm@medikoo.com"
      +    }
      +  ],
      +  "name": "es5-ext",
      +  "optionalDependencies": {},
      +  "readme": "ERROR: No README data found!",
      +  "repository": {
      +    "type": "git",
      +    "url": "git://github.com/medikoo/es5-ext.git"
      +  },
      +  "scripts": {
      +    "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream",
      +    "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch",
      +    "test": "node ./node_modules/tad/bin/tad"
      +  },
      +  "version": "0.10.11"
      +}
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/index.js b/tools/eslint/node_modules/es5-ext/reg-exp/#/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/index.js
      rename to tools/eslint/node_modules/es5-ext/reg-exp/#/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/is-sticky.js b/tools/eslint/node_modules/es5-ext/reg-exp/#/is-sticky.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/is-sticky.js
      rename to tools/eslint/node_modules/es5-ext/reg-exp/#/is-sticky.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/is-unicode.js b/tools/eslint/node_modules/es5-ext/reg-exp/#/is-unicode.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/is-unicode.js
      rename to tools/eslint/node_modules/es5-ext/reg-exp/#/is-unicode.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/match/implement.js b/tools/eslint/node_modules/es5-ext/reg-exp/#/match/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/match/implement.js
      rename to tools/eslint/node_modules/es5-ext/reg-exp/#/match/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/match/index.js b/tools/eslint/node_modules/es5-ext/reg-exp/#/match/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/match/index.js
      rename to tools/eslint/node_modules/es5-ext/reg-exp/#/match/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/match/is-implemented.js b/tools/eslint/node_modules/es5-ext/reg-exp/#/match/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/match/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/reg-exp/#/match/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/match/shim.js b/tools/eslint/node_modules/es5-ext/reg-exp/#/match/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/match/shim.js
      rename to tools/eslint/node_modules/es5-ext/reg-exp/#/match/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/replace/implement.js b/tools/eslint/node_modules/es5-ext/reg-exp/#/replace/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/replace/implement.js
      rename to tools/eslint/node_modules/es5-ext/reg-exp/#/replace/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/replace/index.js b/tools/eslint/node_modules/es5-ext/reg-exp/#/replace/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/replace/index.js
      rename to tools/eslint/node_modules/es5-ext/reg-exp/#/replace/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/replace/is-implemented.js b/tools/eslint/node_modules/es5-ext/reg-exp/#/replace/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/replace/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/reg-exp/#/replace/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/replace/shim.js b/tools/eslint/node_modules/es5-ext/reg-exp/#/replace/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/replace/shim.js
      rename to tools/eslint/node_modules/es5-ext/reg-exp/#/replace/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/search/implement.js b/tools/eslint/node_modules/es5-ext/reg-exp/#/search/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/search/implement.js
      rename to tools/eslint/node_modules/es5-ext/reg-exp/#/search/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/search/index.js b/tools/eslint/node_modules/es5-ext/reg-exp/#/search/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/search/index.js
      rename to tools/eslint/node_modules/es5-ext/reg-exp/#/search/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/search/is-implemented.js b/tools/eslint/node_modules/es5-ext/reg-exp/#/search/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/search/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/reg-exp/#/search/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/search/shim.js b/tools/eslint/node_modules/es5-ext/reg-exp/#/search/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/search/shim.js
      rename to tools/eslint/node_modules/es5-ext/reg-exp/#/search/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/split/implement.js b/tools/eslint/node_modules/es5-ext/reg-exp/#/split/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/split/implement.js
      rename to tools/eslint/node_modules/es5-ext/reg-exp/#/split/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/split/index.js b/tools/eslint/node_modules/es5-ext/reg-exp/#/split/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/split/index.js
      rename to tools/eslint/node_modules/es5-ext/reg-exp/#/split/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/split/is-implemented.js b/tools/eslint/node_modules/es5-ext/reg-exp/#/split/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/split/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/reg-exp/#/split/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/split/shim.js b/tools/eslint/node_modules/es5-ext/reg-exp/#/split/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/split/shim.js
      rename to tools/eslint/node_modules/es5-ext/reg-exp/#/split/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/sticky/implement.js b/tools/eslint/node_modules/es5-ext/reg-exp/#/sticky/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/sticky/implement.js
      rename to tools/eslint/node_modules/es5-ext/reg-exp/#/sticky/implement.js
      diff --git a/tools/eslint/node_modules/es5-ext/reg-exp/#/sticky/is-implemented.js b/tools/eslint/node_modules/es5-ext/reg-exp/#/sticky/is-implemented.js
      new file mode 100644
      index 00000000000000..e4184ee4ecef30
      --- /dev/null
      +++ b/tools/eslint/node_modules/es5-ext/reg-exp/#/sticky/is-implemented.js
      @@ -0,0 +1,10 @@
      +'use strict';
      +
      +module.exports = function () {
      +	var dummyRegExp = /a/;
      +	// We need to do check on instance and not on prototype due to how ES2015 spec evolved:
      +	// https://github.com/tc39/ecma262/issues/262
      +	// https://github.com/tc39/ecma262/pull/263
      +	// https://bugs.chromium.org/p/v8/issues/detail?id=4617
      +	return 'sticky' in dummyRegExp;
      +};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/unicode/implement.js b/tools/eslint/node_modules/es5-ext/reg-exp/#/unicode/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/unicode/implement.js
      rename to tools/eslint/node_modules/es5-ext/reg-exp/#/unicode/implement.js
      diff --git a/tools/eslint/node_modules/es5-ext/reg-exp/#/unicode/is-implemented.js b/tools/eslint/node_modules/es5-ext/reg-exp/#/unicode/is-implemented.js
      new file mode 100644
      index 00000000000000..3e3a54b6691e55
      --- /dev/null
      +++ b/tools/eslint/node_modules/es5-ext/reg-exp/#/unicode/is-implemented.js
      @@ -0,0 +1,10 @@
      +'use strict';
      +
      +module.exports = function () {
      +	var dummyRegExp = /a/;
      +	// We need to do check on instance and not on prototype due to how ES2015 spec evolved:
      +	// https://github.com/tc39/ecma262/issues/262
      +	// https://github.com/tc39/ecma262/pull/263
      +	// https://bugs.chromium.org/p/v8/issues/detail?id=4617
      +	return 'unicode' in dummyRegExp;
      +};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/escape.js b/tools/eslint/node_modules/es5-ext/reg-exp/escape.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/escape.js
      rename to tools/eslint/node_modules/es5-ext/reg-exp/escape.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/index.js b/tools/eslint/node_modules/es5-ext/reg-exp/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/index.js
      rename to tools/eslint/node_modules/es5-ext/reg-exp/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/is-reg-exp.js b/tools/eslint/node_modules/es5-ext/reg-exp/is-reg-exp.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/is-reg-exp.js
      rename to tools/eslint/node_modules/es5-ext/reg-exp/is-reg-exp.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/valid-reg-exp.js b/tools/eslint/node_modules/es5-ext/reg-exp/valid-reg-exp.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/valid-reg-exp.js
      rename to tools/eslint/node_modules/es5-ext/reg-exp/valid-reg-exp.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/@@iterator/implement.js b/tools/eslint/node_modules/es5-ext/string/#/@@iterator/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/@@iterator/implement.js
      rename to tools/eslint/node_modules/es5-ext/string/#/@@iterator/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/@@iterator/index.js b/tools/eslint/node_modules/es5-ext/string/#/@@iterator/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/@@iterator/index.js
      rename to tools/eslint/node_modules/es5-ext/string/#/@@iterator/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/@@iterator/is-implemented.js b/tools/eslint/node_modules/es5-ext/string/#/@@iterator/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/@@iterator/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/string/#/@@iterator/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/@@iterator/shim.js b/tools/eslint/node_modules/es5-ext/string/#/@@iterator/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/@@iterator/shim.js
      rename to tools/eslint/node_modules/es5-ext/string/#/@@iterator/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/at.js b/tools/eslint/node_modules/es5-ext/string/#/at.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/at.js
      rename to tools/eslint/node_modules/es5-ext/string/#/at.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/camel-to-hyphen.js b/tools/eslint/node_modules/es5-ext/string/#/camel-to-hyphen.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/camel-to-hyphen.js
      rename to tools/eslint/node_modules/es5-ext/string/#/camel-to-hyphen.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/capitalize.js b/tools/eslint/node_modules/es5-ext/string/#/capitalize.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/capitalize.js
      rename to tools/eslint/node_modules/es5-ext/string/#/capitalize.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/case-insensitive-compare.js b/tools/eslint/node_modules/es5-ext/string/#/case-insensitive-compare.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/case-insensitive-compare.js
      rename to tools/eslint/node_modules/es5-ext/string/#/case-insensitive-compare.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/code-point-at/implement.js b/tools/eslint/node_modules/es5-ext/string/#/code-point-at/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/code-point-at/implement.js
      rename to tools/eslint/node_modules/es5-ext/string/#/code-point-at/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/code-point-at/index.js b/tools/eslint/node_modules/es5-ext/string/#/code-point-at/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/code-point-at/index.js
      rename to tools/eslint/node_modules/es5-ext/string/#/code-point-at/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/code-point-at/is-implemented.js b/tools/eslint/node_modules/es5-ext/string/#/code-point-at/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/code-point-at/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/string/#/code-point-at/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/code-point-at/shim.js b/tools/eslint/node_modules/es5-ext/string/#/code-point-at/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/code-point-at/shim.js
      rename to tools/eslint/node_modules/es5-ext/string/#/code-point-at/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/contains/implement.js b/tools/eslint/node_modules/es5-ext/string/#/contains/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/contains/implement.js
      rename to tools/eslint/node_modules/es5-ext/string/#/contains/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/contains/index.js b/tools/eslint/node_modules/es5-ext/string/#/contains/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/contains/index.js
      rename to tools/eslint/node_modules/es5-ext/string/#/contains/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/contains/is-implemented.js b/tools/eslint/node_modules/es5-ext/string/#/contains/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/contains/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/string/#/contains/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/contains/shim.js b/tools/eslint/node_modules/es5-ext/string/#/contains/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/contains/shim.js
      rename to tools/eslint/node_modules/es5-ext/string/#/contains/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/ends-with/implement.js b/tools/eslint/node_modules/es5-ext/string/#/ends-with/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/ends-with/implement.js
      rename to tools/eslint/node_modules/es5-ext/string/#/ends-with/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/ends-with/index.js b/tools/eslint/node_modules/es5-ext/string/#/ends-with/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/ends-with/index.js
      rename to tools/eslint/node_modules/es5-ext/string/#/ends-with/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/ends-with/is-implemented.js b/tools/eslint/node_modules/es5-ext/string/#/ends-with/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/ends-with/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/string/#/ends-with/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/ends-with/shim.js b/tools/eslint/node_modules/es5-ext/string/#/ends-with/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/ends-with/shim.js
      rename to tools/eslint/node_modules/es5-ext/string/#/ends-with/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/hyphen-to-camel.js b/tools/eslint/node_modules/es5-ext/string/#/hyphen-to-camel.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/hyphen-to-camel.js
      rename to tools/eslint/node_modules/es5-ext/string/#/hyphen-to-camel.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/indent.js b/tools/eslint/node_modules/es5-ext/string/#/indent.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/indent.js
      rename to tools/eslint/node_modules/es5-ext/string/#/indent.js
      diff --git a/tools/eslint/node_modules/es5-ext/string/#/index.js b/tools/eslint/node_modules/es5-ext/string/#/index.js
      new file mode 100644
      index 00000000000000..3efa01c040b19c
      --- /dev/null
      +++ b/tools/eslint/node_modules/es5-ext/string/#/index.js
      @@ -0,0 +1,22 @@
      +'use strict';
      +
      +module.exports = {
      +	'@@iterator':           require('./@@iterator'),
      +	at:                     require('./at'),
      +	camelToHyphen:          require('./camel-to-hyphen'),
      +	capitalize:             require('./capitalize'),
      +	caseInsensitiveCompare: require('./case-insensitive-compare'),
      +	codePointAt:            require('./code-point-at'),
      +	contains:               require('./contains'),
      +	hyphenToCamel:          require('./hyphen-to-camel'),
      +	endsWith:               require('./ends-with'),
      +	indent:                 require('./indent'),
      +	last:                   require('./last'),
      +	normalize:              require('./normalize'),
      +	pad:                    require('./pad'),
      +	plainReplace:           require('./plain-replace'),
      +	plainReplaceAll:        require('./plain-replace-all'),
      +	repeat:                 require('./repeat'),
      +	startsWith:             require('./starts-with'),
      +	uncapitalize:           require('./uncapitalize')
      +};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/last.js b/tools/eslint/node_modules/es5-ext/string/#/last.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/last.js
      rename to tools/eslint/node_modules/es5-ext/string/#/last.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/normalize/_data.js b/tools/eslint/node_modules/es5-ext/string/#/normalize/_data.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/normalize/_data.js
      rename to tools/eslint/node_modules/es5-ext/string/#/normalize/_data.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/normalize/implement.js b/tools/eslint/node_modules/es5-ext/string/#/normalize/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/normalize/implement.js
      rename to tools/eslint/node_modules/es5-ext/string/#/normalize/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/normalize/index.js b/tools/eslint/node_modules/es5-ext/string/#/normalize/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/normalize/index.js
      rename to tools/eslint/node_modules/es5-ext/string/#/normalize/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/normalize/is-implemented.js b/tools/eslint/node_modules/es5-ext/string/#/normalize/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/normalize/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/string/#/normalize/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/normalize/shim.js b/tools/eslint/node_modules/es5-ext/string/#/normalize/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/normalize/shim.js
      rename to tools/eslint/node_modules/es5-ext/string/#/normalize/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/pad.js b/tools/eslint/node_modules/es5-ext/string/#/pad.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/pad.js
      rename to tools/eslint/node_modules/es5-ext/string/#/pad.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/plain-replace-all.js b/tools/eslint/node_modules/es5-ext/string/#/plain-replace-all.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/plain-replace-all.js
      rename to tools/eslint/node_modules/es5-ext/string/#/plain-replace-all.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/plain-replace.js b/tools/eslint/node_modules/es5-ext/string/#/plain-replace.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/plain-replace.js
      rename to tools/eslint/node_modules/es5-ext/string/#/plain-replace.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/repeat/implement.js b/tools/eslint/node_modules/es5-ext/string/#/repeat/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/repeat/implement.js
      rename to tools/eslint/node_modules/es5-ext/string/#/repeat/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/repeat/index.js b/tools/eslint/node_modules/es5-ext/string/#/repeat/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/repeat/index.js
      rename to tools/eslint/node_modules/es5-ext/string/#/repeat/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/repeat/is-implemented.js b/tools/eslint/node_modules/es5-ext/string/#/repeat/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/repeat/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/string/#/repeat/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/repeat/shim.js b/tools/eslint/node_modules/es5-ext/string/#/repeat/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/repeat/shim.js
      rename to tools/eslint/node_modules/es5-ext/string/#/repeat/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/starts-with/implement.js b/tools/eslint/node_modules/es5-ext/string/#/starts-with/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/starts-with/implement.js
      rename to tools/eslint/node_modules/es5-ext/string/#/starts-with/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/starts-with/index.js b/tools/eslint/node_modules/es5-ext/string/#/starts-with/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/starts-with/index.js
      rename to tools/eslint/node_modules/es5-ext/string/#/starts-with/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/starts-with/is-implemented.js b/tools/eslint/node_modules/es5-ext/string/#/starts-with/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/starts-with/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/string/#/starts-with/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/starts-with/shim.js b/tools/eslint/node_modules/es5-ext/string/#/starts-with/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/starts-with/shim.js
      rename to tools/eslint/node_modules/es5-ext/string/#/starts-with/shim.js
      diff --git a/tools/eslint/node_modules/es5-ext/string/#/uncapitalize.js b/tools/eslint/node_modules/es5-ext/string/#/uncapitalize.js
      new file mode 100644
      index 00000000000000..bedd7e7b007c5d
      --- /dev/null
      +++ b/tools/eslint/node_modules/es5-ext/string/#/uncapitalize.js
      @@ -0,0 +1,8 @@
      +'use strict';
      +
      +var ensureStringifiable = require('../../object/validate-stringifiable-value');
      +
      +module.exports = function () {
      +	var str = ensureStringifiable(this);
      +	return str.charAt(0).toLowerCase() + str.slice(1);
      +};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/format-method.js b/tools/eslint/node_modules/es5-ext/string/format-method.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/format-method.js
      rename to tools/eslint/node_modules/es5-ext/string/format-method.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/from-code-point/implement.js b/tools/eslint/node_modules/es5-ext/string/from-code-point/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/from-code-point/implement.js
      rename to tools/eslint/node_modules/es5-ext/string/from-code-point/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/from-code-point/index.js b/tools/eslint/node_modules/es5-ext/string/from-code-point/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/from-code-point/index.js
      rename to tools/eslint/node_modules/es5-ext/string/from-code-point/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/from-code-point/is-implemented.js b/tools/eslint/node_modules/es5-ext/string/from-code-point/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/from-code-point/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/string/from-code-point/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/from-code-point/shim.js b/tools/eslint/node_modules/es5-ext/string/from-code-point/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/from-code-point/shim.js
      rename to tools/eslint/node_modules/es5-ext/string/from-code-point/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/index.js b/tools/eslint/node_modules/es5-ext/string/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/index.js
      rename to tools/eslint/node_modules/es5-ext/string/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/is-string.js b/tools/eslint/node_modules/es5-ext/string/is-string.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/is-string.js
      rename to tools/eslint/node_modules/es5-ext/string/is-string.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/random-uniq.js b/tools/eslint/node_modules/es5-ext/string/random-uniq.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/random-uniq.js
      rename to tools/eslint/node_modules/es5-ext/string/random-uniq.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/raw/implement.js b/tools/eslint/node_modules/es5-ext/string/raw/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/raw/implement.js
      rename to tools/eslint/node_modules/es5-ext/string/raw/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/raw/index.js b/tools/eslint/node_modules/es5-ext/string/raw/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/raw/index.js
      rename to tools/eslint/node_modules/es5-ext/string/raw/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/raw/is-implemented.js b/tools/eslint/node_modules/es5-ext/string/raw/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/raw/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/string/raw/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/raw/shim.js b/tools/eslint/node_modules/es5-ext/string/raw/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/raw/shim.js
      rename to tools/eslint/node_modules/es5-ext/string/raw/shim.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/#/chain.js b/tools/eslint/node_modules/es6-iterator/#/chain.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/#/chain.js
      rename to tools/eslint/node_modules/es6-iterator/#/chain.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/.lint b/tools/eslint/node_modules/es6-iterator/.lint
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/.lint
      rename to tools/eslint/node_modules/es6-iterator/.lint
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/LICENSE b/tools/eslint/node_modules/es6-iterator/LICENSE
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/LICENSE
      rename to tools/eslint/node_modules/es6-iterator/LICENSE
      diff --git a/tools/eslint/node_modules/es6-iterator/README.md b/tools/eslint/node_modules/es6-iterator/README.md
      new file mode 100644
      index 00000000000000..30faa82bbaefaa
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-iterator/README.md
      @@ -0,0 +1,148 @@
      +# es6-iterator
      +## ECMAScript 6 Iterator interface
      +
      +### Installation
      +
      +	$ npm install es6-iterator
      +
      +To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)
      +
      +## API
      +
      +### Constructors
      +
      +#### Iterator(list) _(es6-iterator)_
      +
      +Abstract Iterator interface. Meant for extensions and not to be used on its own.
      +
      +Accepts any _list_ object (technically object with numeric _length_ property).
      +
      +_Mind it doesn't iterate strings properly, for that use dedicated [StringIterator](#string-iterator)_
      +
      +```javascript
      +var Iterator = require('es6-iterator')
      +var iterator = new Iterator([1, 2, 3]);
      +
      +iterator.next(); // { value: 1, done: false }
      +iterator.next(); // { value: 2, done: false }
      +iterator.next(); // { value: 3, done: false }
      +iterator.next(); // { value: undefined, done: true }
      +```
      +
      +
      +#### ArrayIterator(arrayLike[, kind]) _(es6-iterator/array)_
      +
      +Dedicated for arrays and array-likes. Supports three iteration kinds:
      +* __value__ _(default)_ - Iterates values
      +* __key__ - Iterates indexes
      +* __key+value__ - Iterates keys and indexes, each iteration value is in _[key, value]_ form.
      +
      +
      +```javascript
      +var ArrayIterator = require('es6-iterator/array')
      +var iterator = new ArrayIterator([1, 2, 3], 'key+value');
      +
      +iterator.next(); // { value: [0, 1], done: false }
      +iterator.next(); // { value: [1, 2], done: false }
      +iterator.next(); // { value: [2, 3], done: false }
      +iterator.next(); // { value: undefined, done: true }
      +```
      +
      +May also be used for _arguments_ objects:
      +
      +```javascript
      +(function () {
      +  var iterator = new ArrayIterator(arguments);
      +
      +  iterator.next(); // { value: 1, done: false }
      +  iterator.next(); // { value: 2, done: false }
      +  iterator.next(); // { value: 3, done: false }
      +  iterator.next(); // { value: undefined, done: true }
      +}(1, 2, 3));
      +```
      +
      +#### StringIterator(str) _(es6-iterator/string)_
      +
      +Assures proper iteration over unicode symbols.
      +See: http://mathiasbynens.be/notes/javascript-unicode
      +
      +```javascript
      +var StringIterator = require('es6-iterator/string');
      +var iterator = new StringIterator('f🙈o🙉o🙊');
      +
      +iterator.next(); // { value: 'f', done: false }
      +iterator.next(); // { value: '🙈', done: false }
      +iterator.next(); // { value: 'o', done: false }
      +iterator.next(); // { value: '🙉', done: false }
      +iterator.next(); // { value: 'o', done: false }
      +iterator.next(); // { value: '🙊', done: false }
      +iterator.next(); // { value: undefined, done: true }
      +```
      +
      +### Function utilities
      +
      +#### forOf(iterable, callback[, thisArg]) _(es6-iterator/for-of)_
      +
      +Polyfill for ECMAScript 6 [`for...of`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) statement.
      +
      +```
      +var forOf = require('es6-iterator/for-of');
      +var result = [];
      +
      +forOf('🙈🙉🙊', function (monkey) { result.push(monkey); });
      +console.log(result); // ['🙈', '🙉', '🙊'];
      +```
      +
      +Optionally you can break iteration at any point:
      +
      +```javascript
      +var result = [];
      +
      +forOf([1,2,3,4]', function (val, doBreak) {
      +  result.push(monkey);
      +  if (val >= 3) doBreak();
      +});
      +console.log(result); // [1, 2, 3];
      +```
      +
      +#### get(obj) _(es6-iterator/get)_
      +
      +Return iterator for any iterable object.
      +
      +```javascript
      +var getIterator = require('es6-iterator/get');
      +var iterator = get([1,2,3]);
      +
      +iterator.next(); // { value: 1, done: false }
      +iterator.next(); // { value: 2, done: false }
      +iterator.next(); // { value: 3, done: false }
      +iterator.next(); // { value: undefined, done: true }
      +```
      +
      +#### isIterable(obj) _(es6-iterator/is-iterable)_
      +
      +Whether _obj_ is iterable
      +
      +```javascript
      +var isIterable = require('es6-iterator/is-iterable');
      +
      +isIterable(null); // false
      +isIterable(true); // false
      +isIterable('str'); // true
      +isIterable(['a', 'r', 'r']); // true
      +isIterable(new ArrayIterator([])); // true
      +```
      +
      +#### validIterable(obj) _(es6-iterator/valid-iterable)_
      +
      +If _obj_ is an iterable it is returned. Otherwise _TypeError_ is thrown.
      +
      +### Method extensions
      +
      +#### iterator.chain(iterator1[, …iteratorn]) _(es6-iterator/#/chain)_
      +
      +Chain multiple iterators into one.
      +
      +### Tests [![Build Status](https://travis-ci.org/medikoo/es6-iterator.png)](https://travis-ci.org/medikoo/es6-iterator)
      +
      +	$ npm test
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/array.js b/tools/eslint/node_modules/es6-iterator/array.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/array.js
      rename to tools/eslint/node_modules/es6-iterator/array.js
      diff --git a/tools/eslint/node_modules/es6-iterator/for-of.js b/tools/eslint/node_modules/es6-iterator/for-of.js
      new file mode 100644
      index 00000000000000..c7a28411d59db9
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-iterator/for-of.js
      @@ -0,0 +1,46 @@
      +'use strict';
      +
      +var isArguments = require('es5-ext/function/is-arguments')
      +  , callable    = require('es5-ext/object/valid-callable')
      +  , isString    = require('es5-ext/string/is-string')
      +  , get         = require('./get')
      +
      +  , isArray = Array.isArray, call = Function.prototype.call
      +  , some = Array.prototype.some;
      +
      +module.exports = function (iterable, cb/*, thisArg*/) {
      +	var mode, thisArg = arguments[2], result, doBreak, broken, i, l, char, code;
      +	if (isArray(iterable) || isArguments(iterable)) mode = 'array';
      +	else if (isString(iterable)) mode = 'string';
      +	else iterable = get(iterable);
      +
      +	callable(cb);
      +	doBreak = function () { broken = true; };
      +	if (mode === 'array') {
      +		some.call(iterable, function (value) {
      +			call.call(cb, thisArg, value, doBreak);
      +			if (broken) return true;
      +		});
      +		return;
      +	}
      +	if (mode === 'string') {
      +		l = iterable.length;
      +		for (i = 0; i < l; ++i) {
      +			char = iterable[i];
      +			if ((i + 1) < l) {
      +				code = char.charCodeAt(0);
      +				if ((code >= 0xD800) && (code <= 0xDBFF)) char += iterable[++i];
      +			}
      +			call.call(cb, thisArg, char, doBreak);
      +			if (broken) break;
      +		}
      +		return;
      +	}
      +	result = iterable.next();
      +
      +	while (!result.done) {
      +		call.call(cb, thisArg, result.value, doBreak);
      +		if (broken) return;
      +		result = iterable.next();
      +	}
      +};
      diff --git a/tools/eslint/node_modules/es6-iterator/get.js b/tools/eslint/node_modules/es6-iterator/get.js
      new file mode 100644
      index 00000000000000..7c7e052b191d63
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-iterator/get.js
      @@ -0,0 +1,15 @@
      +'use strict';
      +
      +var isArguments    = require('es5-ext/function/is-arguments')
      +  , isString       = require('es5-ext/string/is-string')
      +  , ArrayIterator  = require('./array')
      +  , StringIterator = require('./string')
      +  , iterable       = require('./valid-iterable')
      +  , iteratorSymbol = require('es6-symbol').iterator;
      +
      +module.exports = function (obj) {
      +	if (typeof iterable(obj)[iteratorSymbol] === 'function') return obj[iteratorSymbol]();
      +	if (isArguments(obj)) return new ArrayIterator(obj);
      +	if (isString(obj)) return new StringIterator(obj);
      +	return new ArrayIterator(obj);
      +};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/index.js b/tools/eslint/node_modules/es6-iterator/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/index.js
      rename to tools/eslint/node_modules/es6-iterator/index.js
      diff --git a/tools/eslint/node_modules/es6-iterator/is-iterable.js b/tools/eslint/node_modules/es6-iterator/is-iterable.js
      new file mode 100644
      index 00000000000000..2c6f496c38c4c2
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-iterator/is-iterable.js
      @@ -0,0 +1,15 @@
      +'use strict';
      +
      +var isArguments    = require('es5-ext/function/is-arguments')
      +  , isString       = require('es5-ext/string/is-string')
      +  , iteratorSymbol = require('es6-symbol').iterator
      +
      +  , isArray = Array.isArray;
      +
      +module.exports = function (value) {
      +	if (value == null) return false;
      +	if (isArray(value)) return true;
      +	if (isString(value)) return true;
      +	if (isArguments(value)) return true;
      +	return (typeof value[iteratorSymbol] === 'function');
      +};
      diff --git a/tools/eslint/node_modules/es6-iterator/package.json b/tools/eslint/node_modules/es6-iterator/package.json
      new file mode 100644
      index 00000000000000..71fee1b0ffd4e3
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-iterator/package.json
      @@ -0,0 +1,94 @@
      +{
      +  "_args": [
      +    [
      +      "es6-iterator@2",
      +      "/Users/silverwind/git/node/tools/package/package/node_modules/es6-map"
      +    ]
      +  ],
      +  "_from": "es6-iterator@>=2.0.0 <3.0.0",
      +  "_id": "es6-iterator@2.0.0",
      +  "_inCache": true,
      +  "_installable": true,
      +  "_location": "/es6-iterator",
      +  "_nodeVersion": "0.12.7",
      +  "_npmUser": {
      +    "email": "medikoo+npm@medikoo.com",
      +    "name": "medikoo"
      +  },
      +  "_npmVersion": "2.11.3",
      +  "_phantomChildren": {},
      +  "_requested": {
      +    "name": "es6-iterator",
      +    "raw": "es6-iterator@2",
      +    "rawSpec": "2",
      +    "scope": null,
      +    "spec": ">=2.0.0 <3.0.0",
      +    "type": "range"
      +  },
      +  "_requiredBy": [
      +    "/es5-ext",
      +    "/es6-map",
      +    "/es6-set",
      +    "/es6-weak-map"
      +  ],
      +  "_resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.0.tgz",
      +  "_shasum": "bd968567d61635e33c0b80727613c9cb4b096bac",
      +  "_shrinkwrap": null,
      +  "_spec": "es6-iterator@2",
      +  "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/es6-map",
      +  "author": {
      +    "email": "medyk@medikoo.com",
      +    "name": "Mariusz Nowak",
      +    "url": "http://www.medikoo.com/"
      +  },
      +  "bugs": {
      +    "url": "https://github.com/medikoo/es6-iterator/issues"
      +  },
      +  "dependencies": {
      +    "d": "^0.1.1",
      +    "es5-ext": "^0.10.7",
      +    "es6-symbol": "3"
      +  },
      +  "description": "Iterator abstraction based on ES6 specification",
      +  "devDependencies": {
      +    "event-emitter": "^0.3.4",
      +    "tad": "^0.2.3",
      +    "xlint": "^0.2.2",
      +    "xlint-jslint-medikoo": "^0.1.3"
      +  },
      +  "directories": {},
      +  "dist": {
      +    "shasum": "bd968567d61635e33c0b80727613c9cb4b096bac",
      +    "tarball": "http://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.0.tgz"
      +  },
      +  "gitHead": "4d9445834e87780ab373b14d6791e860899e2d31",
      +  "homepage": "https://github.com/medikoo/es6-iterator#readme",
      +  "keywords": [
      +    "array",
      +    "generator",
      +    "iterator",
      +    "list",
      +    "map",
      +    "set"
      +  ],
      +  "license": "MIT",
      +  "maintainers": [
      +    {
      +      "name": "medikoo",
      +      "email": "medikoo+npm@medikoo.com"
      +    }
      +  ],
      +  "name": "es6-iterator",
      +  "optionalDependencies": {},
      +  "readme": "ERROR: No README data found!",
      +  "repository": {
      +    "type": "git",
      +    "url": "git://github.com/medikoo/es6-iterator.git"
      +  },
      +  "scripts": {
      +    "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream",
      +    "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch",
      +    "test": "node ./node_modules/tad/bin/tad"
      +  },
      +  "version": "2.0.0"
      +}
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/string.js b/tools/eslint/node_modules/es6-iterator/string.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/string.js
      rename to tools/eslint/node_modules/es6-iterator/string.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/valid-iterable.js b/tools/eslint/node_modules/es6-iterator/valid-iterable.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/valid-iterable.js
      rename to tools/eslint/node_modules/es6-iterator/valid-iterable.js
      diff --git a/tools/eslint/node_modules/es6-map/.lint b/tools/eslint/node_modules/es6-map/.lint
      new file mode 100644
      index 00000000000000..fa861e073d1176
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-map/.lint
      @@ -0,0 +1,13 @@
      +@root
      +
      +module
      +
      +indent 2
      +maxlen 100
      +tabs
      +
      +ass
      +nomen
      +plusplus
      +
      +predef+ Map
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/LICENCE b/tools/eslint/node_modules/es6-map/LICENSE
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/LICENCE
      rename to tools/eslint/node_modules/es6-map/LICENSE
      diff --git a/tools/eslint/node_modules/es6-map/README.md b/tools/eslint/node_modules/es6-map/README.md
      new file mode 100644
      index 00000000000000..f1a2d95d4f9bf5
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-map/README.md
      @@ -0,0 +1,75 @@
      +# es6-map
      +## Map collection as specified in ECMAScript6
      +
      +### Usage
      +
      +It’s safest to use *es6-map* as a [ponyfill](http://kikobeats.com/polyfill-ponyfill-and-prollyfill/) – a polyfill which doesn’t touch global objects:
      +
      +```javascript
      +var Map = require('es6-map');
      +```
      +
      +If you want to make sure your environment implements `Map` globally, do:
      +
      +```javascript
      +require('es6-map/implement');
      +```
      +
      +If you strictly want to use the polyfill even if the native `Map` exists, do:
      +
      +```javascript
      +var Map = require('es6-map/polyfill');
      +```
      +
      +### Installation
      +
      +	$ npm install es6-map
      +
      +To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)
      +
      +#### API
      +
      +Best is to refer to [specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-map-objects). Still if you want quick look, follow examples:
      +
      +```javascript
      +var Map = require('es6-map');
      +
      +var x = {}, y = {}, map = new Map([['raz', 'one'], ['dwa', 'two'], [x, y]]);
      +
      +map.size;                 // 3
      +map.get('raz');           // 'one'
      +map.get(x);               // y
      +map.has('raz');           // true
      +map.has(x);               // true
      +map.has('foo');           // false
      +map.set('trzy', 'three'); // map
      +map.size                  // 4
      +map.get('trzy');          // 'three'
      +map.has('trzy');          // true
      +map.has('dwa');           // true
      +map.delete('dwa');        // true
      +map.size;                 // 3
      +
      +map.forEach(function (value, key) {
      +  // { 'raz', 'one' }, { x, y }, { 'trzy', 'three' } iterated
      +});
      +
      +// FF nightly only:
      +for (value of map) {
      + // ['raz', 'one'], [x, y], ['trzy', 'three'] iterated
      +}
      +
      +var iterator = map.values();
      +
      +iterator.next(); // { done: false, value: 'one' }
      +iterator.next(); // { done: false, value: y }
      +iterator.next(); // { done: false, value: 'three' }
      +iterator.next(); // { done: true, value: undefined }
      +
      +map.clear(); // undefined
      +map.size; // 0
      +```
      +
      +## Tests [![Build Status](https://travis-ci.org/medikoo/es6-map.png)](https://travis-ci.org/medikoo/es6-map)
      +
      +	$ npm test
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/implement.js b/tools/eslint/node_modules/es6-map/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/implement.js
      rename to tools/eslint/node_modules/es6-map/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/index.js b/tools/eslint/node_modules/es6-map/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/index.js
      rename to tools/eslint/node_modules/es6-map/index.js
      diff --git a/tools/eslint/node_modules/es6-map/is-implemented.js b/tools/eslint/node_modules/es6-map/is-implemented.js
      new file mode 100644
      index 00000000000000..cd3b8f23de5114
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-map/is-implemented.js
      @@ -0,0 +1,32 @@
      +'use strict';
      +
      +module.exports = function () {
      +	var map, iterator, result;
      +	if (typeof Map !== 'function') return false;
      +	try {
      +		// WebKit doesn't support arguments and crashes
      +		map = new Map([['raz', 'one'], ['dwa', 'two'], ['trzy', 'three']]);
      +	} catch (e) {
      +		return false;
      +	}
      +	if (String(map) !== '[object Map]') return false;
      +	if (map.size !== 3) return false;
      +	if (typeof map.clear !== 'function') return false;
      +	if (typeof map.delete !== 'function') return false;
      +	if (typeof map.entries !== 'function') return false;
      +	if (typeof map.forEach !== 'function') return false;
      +	if (typeof map.get !== 'function') return false;
      +	if (typeof map.has !== 'function') return false;
      +	if (typeof map.keys !== 'function') return false;
      +	if (typeof map.set !== 'function') return false;
      +	if (typeof map.values !== 'function') return false;
      +
      +	iterator = map.entries();
      +	result = iterator.next();
      +	if (result.done !== false) return false;
      +	if (!result.value) return false;
      +	if (result.value[0] !== 'raz') return false;
      +	if (result.value[1] !== 'one') return false;
      +
      +	return true;
      +};
      diff --git a/tools/eslint/node_modules/es6-map/is-map.js b/tools/eslint/node_modules/es6-map/is-map.js
      new file mode 100644
      index 00000000000000..1e1fa823327a60
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-map/is-map.js
      @@ -0,0 +1,12 @@
      +'use strict';
      +
      +var toStringTagSymbol = require('es6-symbol').toStringTag
      +
      +  , toString = Object.prototype.toString
      +  , id = '[object Map]'
      +  , Global = (typeof Map === 'undefined') ? null : Map;
      +
      +module.exports = function (x) {
      +	return (x && ((Global && ((x instanceof Global) || (x === Global.prototype))) ||
      +			(toString.call(x) === id) || (x[toStringTagSymbol] === 'Map'))) || false;
      +};
      diff --git a/tools/eslint/node_modules/es6-map/is-native-implemented.js b/tools/eslint/node_modules/es6-map/is-native-implemented.js
      new file mode 100644
      index 00000000000000..b0b7a191695b89
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-map/is-native-implemented.js
      @@ -0,0 +1,9 @@
      +// Exports true if environment provides native `Map` implementation,
      +// whatever that is.
      +
      +'use strict';
      +
      +module.exports = (function () {
      +	if (typeof Map === 'undefined') return false;
      +	return (Object.prototype.toString.call(new Map()) === '[object Map]');
      +}());
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/lib/iterator-kinds.js b/tools/eslint/node_modules/es6-map/lib/iterator-kinds.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/lib/iterator-kinds.js
      rename to tools/eslint/node_modules/es6-map/lib/iterator-kinds.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/lib/iterator.js b/tools/eslint/node_modules/es6-map/lib/iterator.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/lib/iterator.js
      rename to tools/eslint/node_modules/es6-map/lib/iterator.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/lib/primitive-iterator.js b/tools/eslint/node_modules/es6-map/lib/primitive-iterator.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/lib/primitive-iterator.js
      rename to tools/eslint/node_modules/es6-map/lib/primitive-iterator.js
      diff --git a/tools/eslint/node_modules/es6-map/package.json b/tools/eslint/node_modules/es6-map/package.json
      new file mode 100644
      index 00000000000000..c9a149d28d085b
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-map/package.json
      @@ -0,0 +1,98 @@
      +{
      +  "_args": [
      +    [
      +      "es6-map@^0.1.3",
      +      "/Users/silverwind/git/node/tools/package/package"
      +    ]
      +  ],
      +  "_from": "es6-map@>=0.1.3 <0.2.0",
      +  "_id": "es6-map@0.1.3",
      +  "_inCache": true,
      +  "_installable": true,
      +  "_location": "/es6-map",
      +  "_nodeVersion": "4.2.2",
      +  "_npmUser": {
      +    "email": "medikoo+npm@medikoo.com",
      +    "name": "medikoo"
      +  },
      +  "_npmVersion": "2.14.7",
      +  "_phantomChildren": {},
      +  "_requested": {
      +    "name": "es6-map",
      +    "raw": "es6-map@^0.1.3",
      +    "rawSpec": "^0.1.3",
      +    "scope": null,
      +    "spec": ">=0.1.3 <0.2.0",
      +    "type": "range"
      +  },
      +  "_requiredBy": [
      +    "/",
      +    "/escope"
      +  ],
      +  "_resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.3.tgz",
      +  "_shasum": "fe58c6654c6acd54e4397cdb72379d59b6ad5894",
      +  "_shrinkwrap": null,
      +  "_spec": "es6-map@^0.1.3",
      +  "_where": "/Users/silverwind/git/node/tools/package/package",
      +  "author": {
      +    "email": "medyk@medikoo.com",
      +    "name": "Mariusz Nowak",
      +    "url": "http://www.medikoo.com/"
      +  },
      +  "bugs": {
      +    "url": "https://github.com/medikoo/es6-map/issues"
      +  },
      +  "dependencies": {
      +    "d": "~0.1.1",
      +    "es5-ext": "~0.10.8",
      +    "es6-iterator": "2",
      +    "es6-set": "~0.1.3",
      +    "es6-symbol": "~3.0.1",
      +    "event-emitter": "~0.3.4"
      +  },
      +  "description": "ECMAScript6 Map polyfill",
      +  "devDependencies": {
      +    "tad": "~0.2.4",
      +    "xlint": "~0.2.2",
      +    "xlint-jslint-medikoo": "~0.1.4"
      +  },
      +  "directories": {},
      +  "dist": {
      +    "shasum": "fe58c6654c6acd54e4397cdb72379d59b6ad5894",
      +    "tarball": "http://registry.npmjs.org/es6-map/-/es6-map-0.1.3.tgz"
      +  },
      +  "gitHead": "90ef2306db607837426cb806bcd5d439ed90827c",
      +  "homepage": "https://github.com/medikoo/es6-map#readme",
      +  "keywords": [
      +    "collection",
      +    "ecmascript",
      +    "es6",
      +    "harmony",
      +    "hash",
      +    "list",
      +    "map",
      +    "polyfill",
      +    "ponyfill",
      +    "shim"
      +  ],
      +  "license": "MIT",
      +  "maintainers": [
      +    {
      +      "name": "medikoo",
      +      "email": "medikoo+npm@medikoo.com"
      +    }
      +  ],
      +  "name": "es6-map",
      +  "optionalDependencies": {},
      +  "readme": "ERROR: No README data found!",
      +  "repository": {
      +    "type": "git",
      +    "url": "git://github.com/medikoo/es6-map.git"
      +  },
      +  "scripts": {
      +    "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream",
      +    "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch",
      +    "test": "node ./node_modules/tad/bin/tad"
      +  },
      +  "version": "0.1.3"
      +}
      diff --git a/tools/eslint/node_modules/es6-map/polyfill.js b/tools/eslint/node_modules/es6-map/polyfill.js
      new file mode 100644
      index 00000000000000..c638e760c4a9e3
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-map/polyfill.js
      @@ -0,0 +1,104 @@
      +'use strict';
      +
      +var clear          = require('es5-ext/array/#/clear')
      +  , eIndexOf       = require('es5-ext/array/#/e-index-of')
      +  , setPrototypeOf = require('es5-ext/object/set-prototype-of')
      +  , callable       = require('es5-ext/object/valid-callable')
      +  , validValue     = require('es5-ext/object/valid-value')
      +  , d              = require('d')
      +  , ee             = require('event-emitter')
      +  , Symbol         = require('es6-symbol')
      +  , iterator       = require('es6-iterator/valid-iterable')
      +  , forOf          = require('es6-iterator/for-of')
      +  , Iterator       = require('./lib/iterator')
      +  , isNative       = require('./is-native-implemented')
      +
      +  , call = Function.prototype.call
      +  , defineProperties = Object.defineProperties, getPrototypeOf = Object.getPrototypeOf
      +  , MapPoly;
      +
      +module.exports = MapPoly = function (/*iterable*/) {
      +	var iterable = arguments[0], keys, values, self;
      +	if (!(this instanceof MapPoly)) throw new TypeError('Constructor requires \'new\'');
      +	if (isNative && setPrototypeOf && (Map !== MapPoly)) {
      +		self = setPrototypeOf(new Map(), getPrototypeOf(this));
      +	} else {
      +		self = this;
      +	}
      +	if (iterable != null) iterator(iterable);
      +	defineProperties(self, {
      +		__mapKeysData__: d('c', keys = []),
      +		__mapValuesData__: d('c', values = [])
      +	});
      +	if (!iterable) return self;
      +	forOf(iterable, function (value) {
      +		var key = validValue(value)[0];
      +		value = value[1];
      +		if (eIndexOf.call(keys, key) !== -1) return;
      +		keys.push(key);
      +		values.push(value);
      +	}, self);
      +	return self;
      +};
      +
      +if (isNative) {
      +	if (setPrototypeOf) setPrototypeOf(MapPoly, Map);
      +	MapPoly.prototype = Object.create(Map.prototype, {
      +		constructor: d(MapPoly)
      +	});
      +}
      +
      +ee(defineProperties(MapPoly.prototype, {
      +	clear: d(function () {
      +		if (!this.__mapKeysData__.length) return;
      +		clear.call(this.__mapKeysData__);
      +		clear.call(this.__mapValuesData__);
      +		this.emit('_clear');
      +	}),
      +	delete: d(function (key) {
      +		var index = eIndexOf.call(this.__mapKeysData__, key);
      +		if (index === -1) return false;
      +		this.__mapKeysData__.splice(index, 1);
      +		this.__mapValuesData__.splice(index, 1);
      +		this.emit('_delete', index, key);
      +		return true;
      +	}),
      +	entries: d(function () { return new Iterator(this, 'key+value'); }),
      +	forEach: d(function (cb/*, thisArg*/) {
      +		var thisArg = arguments[1], iterator, result;
      +		callable(cb);
      +		iterator = this.entries();
      +		result = iterator._next();
      +		while (result !== undefined) {
      +			call.call(cb, thisArg, this.__mapValuesData__[result],
      +				this.__mapKeysData__[result], this);
      +			result = iterator._next();
      +		}
      +	}),
      +	get: d(function (key) {
      +		var index = eIndexOf.call(this.__mapKeysData__, key);
      +		if (index === -1) return;
      +		return this.__mapValuesData__[index];
      +	}),
      +	has: d(function (key) {
      +		return (eIndexOf.call(this.__mapKeysData__, key) !== -1);
      +	}),
      +	keys: d(function () { return new Iterator(this, 'key'); }),
      +	set: d(function (key, value) {
      +		var index = eIndexOf.call(this.__mapKeysData__, key), emit;
      +		if (index === -1) {
      +			index = this.__mapKeysData__.push(key) - 1;
      +			emit = true;
      +		}
      +		this.__mapValuesData__[index] = value;
      +		if (emit) this.emit('_add', index, key);
      +		return this;
      +	}),
      +	size: d.gs(function () { return this.__mapKeysData__.length; }),
      +	values: d(function () { return new Iterator(this, 'value'); }),
      +	toString: d(function () { return '[object Map]'; })
      +}));
      +Object.defineProperty(MapPoly.prototype, Symbol.iterator, d(function () {
      +	return this.entries();
      +}));
      +Object.defineProperty(MapPoly.prototype, Symbol.toStringTag, d('c', 'Map'));
      diff --git a/tools/eslint/node_modules/es6-map/primitive/index.js b/tools/eslint/node_modules/es6-map/primitive/index.js
      new file mode 100644
      index 00000000000000..8ac21432ec8a28
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-map/primitive/index.js
      @@ -0,0 +1,117 @@
      +'use strict';
      +
      +var clear          = require('es5-ext/object/clear')
      +  , setPrototypeOf = require('es5-ext/object/set-prototype-of')
      +  , validValue     = require('es5-ext/object/valid-value')
      +  , callable       = require('es5-ext/object/valid-callable')
      +  , d              = require('d')
      +  , iterator       = require('es6-iterator/valid-iterable')
      +  , forOf          = require('es6-iterator/for-of')
      +  , isNative       = require('../is-native-implemented')
      +  , MapPolyfill    = require('../polyfill')
      +  , Iterator       = require('../lib/primitive-iterator')
      +
      +  , call = Function.prototype.call
      +  , create = Object.create, defineProperty = Object.defineProperty
      +  , defineProperties = Object.defineProperties, getPrototypeOf = Object.getPrototypeOf
      +  , hasOwnProperty = Object.prototype.hasOwnProperty
      +  , PrimitiveMap;
      +
      +module.exports = PrimitiveMap = function (/*iterable, serialize*/) {
      +	var iterable = arguments[0], serialize = arguments[1], self;
      +	if (!(this instanceof PrimitiveMap)) throw new TypeError('Constructor requires \'new\'');
      +	if (isNative && setPrototypeOf && (Map !== MapPolyfill)) {
      +		self = setPrototypeOf(new Map(), getPrototypeOf(this));
      +	} else {
      +		self = this;
      +	}
      +	if (iterable != null) iterator(iterable);
      +	if (serialize !== undefined) {
      +		callable(serialize);
      +		defineProperty(self, '_serialize', d('', serialize));
      +	}
      +	defineProperties(self, {
      +		__mapKeysData__: d('c', create(null)),
      +		__mapValuesData__: d('c', create(null)),
      +		__size__: d('w', 0)
      +	});
      +	if (!iterable) return self;
      +	forOf(iterable, function (value) {
      +		var key = validValue(value)[0], sKey = self._serialize(key);
      +		if (sKey == null) throw new TypeError(key + " cannot be serialized");
      +		value = value[1];
      +		if (hasOwnProperty.call(self.__mapKeysData__, sKey)) {
      +			if (self.__mapValuesData__[sKey] === value) return;
      +		} else {
      +			++self.__size__;
      +		}
      +		self.__mapKeysData__[sKey] = key;
      +		self.__mapValuesData__[sKey] = value;
      +	});
      +	return self;
      +};
      +if (setPrototypeOf) setPrototypeOf(PrimitiveMap, MapPolyfill);
      +
      +PrimitiveMap.prototype = create(MapPolyfill.prototype, {
      +	constructor: d(PrimitiveMap),
      +	_serialize: d(function (value) {
      +		if (value && (typeof value.toString !== 'function')) return null;
      +		return String(value);
      +	}),
      +	clear: d(function () {
      +		if (!this.__size__) return;
      +		clear(this.__mapKeysData__);
      +		clear(this.__mapValuesData__);
      +		this.__size__ = 0;
      +		this.emit('_clear');
      +	}),
      +	delete: d(function (key) {
      +		var sKey = this._serialize(key);
      +		if (sKey == null) return false;
      +		if (!hasOwnProperty.call(this.__mapKeysData__, sKey)) return false;
      +		delete this.__mapKeysData__[sKey];
      +		delete this.__mapValuesData__[sKey];
      +		--this.__size__;
      +		this.emit('_delete', sKey);
      +		return true;
      +	}),
      +	entries: d(function () { return new Iterator(this, 'key+value'); }),
      +	forEach: d(function (cb/*, thisArg*/) {
      +		var thisArg = arguments[1], iterator, result, sKey;
      +		callable(cb);
      +		iterator = this.entries();
      +		result = iterator._next();
      +		while (result !== undefined) {
      +			sKey = iterator.__list__[result];
      +			call.call(cb, thisArg, this.__mapValuesData__[sKey],
      +				this.__mapKeysData__[sKey], this);
      +			result = iterator._next();
      +		}
      +	}),
      +	get: d(function (key) {
      +		var sKey = this._serialize(key);
      +		if (sKey == null) return;
      +		return this.__mapValuesData__[sKey];
      +	}),
      +	has: d(function (key) {
      +		var sKey = this._serialize(key);
      +		if (sKey == null) return false;
      +		return hasOwnProperty.call(this.__mapKeysData__, sKey);
      +	}),
      +	keys: d(function () { return new Iterator(this, 'key'); }),
      +	size: d.gs(function () { return this.__size__; }),
      +	set: d(function (key, value) {
      +		var sKey = this._serialize(key);
      +		if (sKey == null) throw new TypeError(key + " cannot be serialized");
      +		if (hasOwnProperty.call(this.__mapKeysData__, sKey)) {
      +			if (this.__mapValuesData__[sKey] === value) return this;
      +		} else {
      +			++this.__size__;
      +		}
      +		this.__mapKeysData__[sKey] = key;
      +		this.__mapValuesData__[sKey] = value;
      +		this.emit('_add', sKey);
      +		return this;
      +	}),
      +	values: d(function () { return new Iterator(this, 'value'); })
      +});
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/valid-map.js b/tools/eslint/node_modules/es6-map/valid-map.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/valid-map.js
      rename to tools/eslint/node_modules/es6-map/valid-map.js
      diff --git a/tools/eslint/node_modules/es6-set/.lint b/tools/eslint/node_modules/es6-set/.lint
      new file mode 100644
      index 00000000000000..89386b35ca0724
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-set/.lint
      @@ -0,0 +1,13 @@
      +@root
      +
      +module
      +
      +tabs
      +indent 2
      +maxlen 100
      +
      +ass
      +nomen
      +plusplus
      +
      +predef+ Set
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/LICENCE b/tools/eslint/node_modules/es6-set/LICENSE
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/LICENCE
      rename to tools/eslint/node_modules/es6-set/LICENSE
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/README.md b/tools/eslint/node_modules/es6-set/README.md
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/README.md
      rename to tools/eslint/node_modules/es6-set/README.md
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/ext/copy.js b/tools/eslint/node_modules/es6-set/ext/copy.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/ext/copy.js
      rename to tools/eslint/node_modules/es6-set/ext/copy.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/ext/every.js b/tools/eslint/node_modules/es6-set/ext/every.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/ext/every.js
      rename to tools/eslint/node_modules/es6-set/ext/every.js
      diff --git a/tools/eslint/node_modules/es6-set/ext/filter.js b/tools/eslint/node_modules/es6-set/ext/filter.js
      new file mode 100644
      index 00000000000000..1178fc591c10ec
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-set/ext/filter.js
      @@ -0,0 +1,18 @@
      +'use strict';
      +
      +var callable = require('es5-ext/object/valid-callable')
      +  , forOf    = require('es6-iterator/for-of')
      +  , isSet    = require('../is-set')
      +  , Set      = require('../')
      +
      +  , call = Function.prototype.call;
      +
      +module.exports = function (cb/*, thisArg*/) {
      +	var thisArg = arguments[1], result;
      +	callable(cb);
      +	result = isSet(this) ? new this.constructor() : new Set();
      +	forOf(this, function (value) {
      +		if (call.call(cb, thisArg, value)) result.add(value);
      +	});
      +	return result;
      +};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/ext/get-first.js b/tools/eslint/node_modules/es6-set/ext/get-first.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/ext/get-first.js
      rename to tools/eslint/node_modules/es6-set/ext/get-first.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/ext/get-last.js b/tools/eslint/node_modules/es6-set/ext/get-last.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/ext/get-last.js
      rename to tools/eslint/node_modules/es6-set/ext/get-last.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/ext/some.js b/tools/eslint/node_modules/es6-set/ext/some.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/ext/some.js
      rename to tools/eslint/node_modules/es6-set/ext/some.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/implement.js b/tools/eslint/node_modules/es6-set/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/implement.js
      rename to tools/eslint/node_modules/es6-set/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/index.js b/tools/eslint/node_modules/es6-set/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/index.js
      rename to tools/eslint/node_modules/es6-set/index.js
      diff --git a/tools/eslint/node_modules/es6-set/is-implemented.js b/tools/eslint/node_modules/es6-set/is-implemented.js
      new file mode 100644
      index 00000000000000..7f1bfbb7cc7f4e
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-set/is-implemented.js
      @@ -0,0 +1,24 @@
      +'use strict';
      +
      +module.exports = function () {
      +	var set, iterator, result;
      +	if (typeof Set !== 'function') return false;
      +	set = new Set(['raz', 'dwa', 'trzy']);
      +	if (String(set) !== '[object Set]') return false;
      +	if (set.size !== 3) return false;
      +	if (typeof set.add !== 'function') return false;
      +	if (typeof set.clear !== 'function') return false;
      +	if (typeof set.delete !== 'function') return false;
      +	if (typeof set.entries !== 'function') return false;
      +	if (typeof set.forEach !== 'function') return false;
      +	if (typeof set.has !== 'function') return false;
      +	if (typeof set.keys !== 'function') return false;
      +	if (typeof set.values !== 'function') return false;
      +
      +	iterator = set.values();
      +	result = iterator.next();
      +	if (result.done !== false) return false;
      +	if (result.value !== 'raz') return false;
      +
      +	return true;
      +};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/is-native-implemented.js b/tools/eslint/node_modules/es6-set/is-native-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/is-native-implemented.js
      rename to tools/eslint/node_modules/es6-set/is-native-implemented.js
      diff --git a/tools/eslint/node_modules/es6-set/is-set.js b/tools/eslint/node_modules/es6-set/is-set.js
      new file mode 100644
      index 00000000000000..6b491ddee3b5ae
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-set/is-set.js
      @@ -0,0 +1,12 @@
      +'use strict';
      +
      +var toString          = Object.prototype.toString
      +  , toStringTagSymbol = require('es6-symbol').toStringTag
      +
      +  , id = '[object Set]'
      +  , Global = (typeof Set === 'undefined') ? null : Set;
      +
      +module.exports = function (x) {
      +	return (x && ((Global && ((x instanceof Global) || (x === Global.prototype))) ||
      +			(toString.call(x) === id) || (x[toStringTagSymbol] === 'Set'))) || false;
      +};
      diff --git a/tools/eslint/node_modules/es6-set/lib/iterator.js b/tools/eslint/node_modules/es6-set/lib/iterator.js
      new file mode 100644
      index 00000000000000..6069a8a130a4ca
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-set/lib/iterator.js
      @@ -0,0 +1,30 @@
      +'use strict';
      +
      +var setPrototypeOf    = require('es5-ext/object/set-prototype-of')
      +  , contains          = require('es5-ext/string/#/contains')
      +  , d                 = require('d')
      +  , Iterator          = require('es6-iterator')
      +  , toStringTagSymbol = require('es6-symbol').toStringTag
      +
      +  , defineProperty = Object.defineProperty
      +  , SetIterator;
      +
      +SetIterator = module.exports = function (set, kind) {
      +	if (!(this instanceof SetIterator)) return new SetIterator(set, kind);
      +	Iterator.call(this, set.__setData__, set);
      +	if (!kind) kind = 'value';
      +	else if (contains.call(kind, 'key+value')) kind = 'key+value';
      +	else kind = 'value';
      +	defineProperty(this, '__kind__', d('', kind));
      +};
      +if (setPrototypeOf) setPrototypeOf(SetIterator, Iterator);
      +
      +SetIterator.prototype = Object.create(Iterator.prototype, {
      +	constructor: d(SetIterator),
      +	_resolve: d(function (i) {
      +		if (this.__kind__ === 'value') return this.__list__[i];
      +		return [this.__list__[i], this.__list__[i]];
      +	}),
      +	toString: d(function () { return '[object Set Iterator]'; })
      +});
      +defineProperty(SetIterator.prototype, toStringTagSymbol, d('c', 'Set Iterator'));
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/lib/primitive-iterator.js b/tools/eslint/node_modules/es6-set/lib/primitive-iterator.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/lib/primitive-iterator.js
      rename to tools/eslint/node_modules/es6-set/lib/primitive-iterator.js
      diff --git a/tools/eslint/node_modules/es6-set/package.json b/tools/eslint/node_modules/es6-set/package.json
      new file mode 100644
      index 00000000000000..4dd0a16b31ab5c
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-set/package.json
      @@ -0,0 +1,92 @@
      +{
      +  "_args": [
      +    [
      +      "es6-set@~0.1.3",
      +      "/Users/silverwind/git/node/tools/package/package/node_modules/es6-map"
      +    ]
      +  ],
      +  "_from": "es6-set@>=0.1.3 <0.2.0",
      +  "_id": "es6-set@0.1.4",
      +  "_inCache": true,
      +  "_installable": true,
      +  "_location": "/es6-set",
      +  "_nodeVersion": "4.2.4",
      +  "_npmUser": {
      +    "email": "medikoo+npm@medikoo.com",
      +    "name": "medikoo"
      +  },
      +  "_npmVersion": "2.14.12",
      +  "_phantomChildren": {},
      +  "_requested": {
      +    "name": "es6-set",
      +    "raw": "es6-set@~0.1.3",
      +    "rawSpec": "~0.1.3",
      +    "scope": null,
      +    "spec": ">=0.1.3 <0.2.0",
      +    "type": "range"
      +  },
      +  "_requiredBy": [
      +    "/es6-map"
      +  ],
      +  "_resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.4.tgz",
      +  "_shasum": "9516b6761c2964b92ff479456233a247dc707ce8",
      +  "_shrinkwrap": null,
      +  "_spec": "es6-set@~0.1.3",
      +  "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/es6-map",
      +  "author": {
      +    "email": "medyk@medikoo.com",
      +    "name": "Mariusz Nowak",
      +    "url": "http://www.medikoo.com/"
      +  },
      +  "bugs": {
      +    "url": "https://github.com/medikoo/es6-set/issues"
      +  },
      +  "dependencies": {
      +    "d": "~0.1.1",
      +    "es5-ext": "~0.10.11",
      +    "es6-iterator": "2",
      +    "es6-symbol": "3",
      +    "event-emitter": "~0.3.4"
      +  },
      +  "description": "ECMAScript6 Set polyfill",
      +  "devDependencies": {
      +    "tad": "~0.2.4",
      +    "xlint": "~0.2.2",
      +    "xlint-jslint-medikoo": "~0.1.4"
      +  },
      +  "directories": {},
      +  "dist": {
      +    "shasum": "9516b6761c2964b92ff479456233a247dc707ce8",
      +    "tarball": "http://registry.npmjs.org/es6-set/-/es6-set-0.1.4.tgz"
      +  },
      +  "gitHead": "89717f1b294382ca28e9070e644f768ff240dc71",
      +  "homepage": "https://github.com/medikoo/es6-set#readme",
      +  "keywords": [
      +    "collection",
      +    "es6",
      +    "harmony",
      +    "hash",
      +    "list",
      +    "set"
      +  ],
      +  "license": "MIT",
      +  "maintainers": [
      +    {
      +      "name": "medikoo",
      +      "email": "medikoo+npm@medikoo.com"
      +    }
      +  ],
      +  "name": "es6-set",
      +  "optionalDependencies": {},
      +  "readme": "ERROR: No README data found!",
      +  "repository": {
      +    "type": "git",
      +    "url": "git://github.com/medikoo/es6-set.git"
      +  },
      +  "scripts": {
      +    "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream",
      +    "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch",
      +    "test": "node ./node_modules/tad/bin/tad"
      +  },
      +  "version": "0.1.4"
      +}
      diff --git a/tools/eslint/node_modules/es6-set/polyfill.js b/tools/eslint/node_modules/es6-set/polyfill.js
      new file mode 100644
      index 00000000000000..51b1e630791481
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-set/polyfill.js
      @@ -0,0 +1,80 @@
      +'use strict';
      +
      +var clear          = require('es5-ext/array/#/clear')
      +  , eIndexOf       = require('es5-ext/array/#/e-index-of')
      +  , setPrototypeOf = require('es5-ext/object/set-prototype-of')
      +  , callable       = require('es5-ext/object/valid-callable')
      +  , d              = require('d')
      +  , ee             = require('event-emitter')
      +  , Symbol         = require('es6-symbol')
      +  , iterator       = require('es6-iterator/valid-iterable')
      +  , forOf          = require('es6-iterator/for-of')
      +  , Iterator       = require('./lib/iterator')
      +  , isNative       = require('./is-native-implemented')
      +
      +  , call = Function.prototype.call
      +  , defineProperty = Object.defineProperty, getPrototypeOf = Object.getPrototypeOf
      +  , SetPoly, getValues, NativeSet;
      +
      +if (isNative) NativeSet = Set;
      +
      +module.exports = SetPoly = function Set(/*iterable*/) {
      +	var iterable = arguments[0], self;
      +	if (!(this instanceof SetPoly)) throw new TypeError('Constructor requires \'new\'');
      +	if (isNative && setPrototypeOf) self = setPrototypeOf(new NativeSet(), getPrototypeOf(this));
      +	else self = this;
      +	if (iterable != null) iterator(iterable);
      +	defineProperty(self, '__setData__', d('c', []));
      +	if (!iterable) return self;
      +	forOf(iterable, function (value) {
      +		if (eIndexOf.call(this, value) !== -1) return;
      +		this.push(value);
      +	}, self.__setData__);
      +	return self;
      +};
      +
      +if (isNative) {
      +	if (setPrototypeOf) setPrototypeOf(SetPoly, NativeSet);
      +	SetPoly.prototype = Object.create(NativeSet.prototype, { constructor: d(SetPoly) });
      +}
      +
      +ee(Object.defineProperties(SetPoly.prototype, {
      +	add: d(function (value) {
      +		if (this.has(value)) return this;
      +		this.emit('_add', this.__setData__.push(value) - 1, value);
      +		return this;
      +	}),
      +	clear: d(function () {
      +		if (!this.__setData__.length) return;
      +		clear.call(this.__setData__);
      +		this.emit('_clear');
      +	}),
      +	delete: d(function (value) {
      +		var index = eIndexOf.call(this.__setData__, value);
      +		if (index === -1) return false;
      +		this.__setData__.splice(index, 1);
      +		this.emit('_delete', index, value);
      +		return true;
      +	}),
      +	entries: d(function () { return new Iterator(this, 'key+value'); }),
      +	forEach: d(function (cb/*, thisArg*/) {
      +		var thisArg = arguments[1], iterator, result, value;
      +		callable(cb);
      +		iterator = this.values();
      +		result = iterator._next();
      +		while (result !== undefined) {
      +			value = iterator._resolve(result);
      +			call.call(cb, thisArg, value, value, this);
      +			result = iterator._next();
      +		}
      +	}),
      +	has: d(function (value) {
      +		return (eIndexOf.call(this.__setData__, value) !== -1);
      +	}),
      +	keys: d(getValues = function () { return this.values(); }),
      +	size: d.gs(function () { return this.__setData__.length; }),
      +	values: d(function () { return new Iterator(this); }),
      +	toString: d(function () { return '[object Set]'; })
      +}));
      +defineProperty(SetPoly.prototype, Symbol.iterator, d(getValues));
      +defineProperty(SetPoly.prototype, Symbol.toStringTag, d('c', 'Set'));
      diff --git a/tools/eslint/node_modules/es6-set/primitive/index.js b/tools/eslint/node_modules/es6-set/primitive/index.js
      new file mode 100644
      index 00000000000000..6bcad18d3f19a2
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-set/primitive/index.js
      @@ -0,0 +1,87 @@
      +'use strict';
      +
      +var callable       = require('es5-ext/object/valid-callable')
      +  , clear          = require('es5-ext/object/clear')
      +  , setPrototypeOf = require('es5-ext/object/set-prototype-of')
      +  , d              = require('d')
      +  , iterator       = require('es6-iterator/valid-iterable')
      +  , forOf          = require('es6-iterator/for-of')
      +  , Set            = require('../polyfill')
      +  , Iterator       = require('../lib/primitive-iterator')
      +  , isNative       = require('../is-native-implemented')
      +
      +  , create = Object.create, defineProperties = Object.defineProperties
      +  , defineProperty = Object.defineProperty, getPrototypeOf = Object.getPrototypeOf
      +  , hasOwnProperty = Object.prototype.hasOwnProperty
      +  , PrimitiveSet;
      +
      +module.exports = PrimitiveSet = function (/*iterable, serialize*/) {
      +	var iterable = arguments[0], serialize = arguments[1], self;
      +	if (!(this instanceof PrimitiveSet)) throw new TypeError('Constructor requires \'new\'');
      +	if (isNative && setPrototypeOf) self = setPrototypeOf(new Set(), getPrototypeOf(this));
      +	else self = this;
      +	if (iterable != null) iterator(iterable);
      +	if (serialize !== undefined) {
      +		callable(serialize);
      +		defineProperty(self, '_serialize', d('', serialize));
      +	}
      +	defineProperties(self, {
      +		__setData__: d('c', create(null)),
      +		__size__: d('w', 0)
      +	});
      +	if (!iterable) return self;
      +	forOf(iterable, function (value) {
      +		var key = self._serialize(value);
      +		if (key == null) throw new TypeError(value + " cannot be serialized");
      +		if (hasOwnProperty.call(self.__setData__, key)) return;
      +		self.__setData__[key] = value;
      +		++self.__size__;
      +	});
      +	return self;
      +};
      +if (setPrototypeOf) setPrototypeOf(PrimitiveSet, Set);
      +
      +PrimitiveSet.prototype = create(Set.prototype, {
      +	constructor: d(PrimitiveSet),
      +	_serialize: d(function (value) {
      +		if (value && (typeof value.toString !== 'function')) return null;
      +		return String(value);
      +	}),
      +	add: d(function (value) {
      +		var key = this._serialize(value);
      +		if (key == null) throw new TypeError(value + " cannot be serialized");
      +		if (hasOwnProperty.call(this.__setData__, key)) return this;
      +		this.__setData__[key] = value;
      +		++this.__size__;
      +		this.emit('_add', key);
      +		return this;
      +	}),
      +	clear: d(function () {
      +		if (!this.__size__) return;
      +		clear(this.__setData__);
      +		this.__size__ = 0;
      +		this.emit('_clear');
      +	}),
      +	delete: d(function (value) {
      +		var key = this._serialize(value);
      +		if (key == null) return false;
      +		if (!hasOwnProperty.call(this.__setData__, key)) return false;
      +		delete this.__setData__[key];
      +		--this.__size__;
      +		this.emit('_delete', key);
      +		return true;
      +	}),
      +	entries: d(function () { return new Iterator(this, 'key+value'); }),
      +	get: d(function (key) {
      +		key = this._serialize(key);
      +		if (key == null) return;
      +		return this.__setData__[key];
      +	}),
      +	has: d(function (value) {
      +		var key = this._serialize(value);
      +		if (key == null) return false;
      +		return hasOwnProperty.call(this.__setData__, key);
      +	}),
      +	size: d.gs(function () { return this.__size__; }),
      +	values: d(function () { return new Iterator(this); })
      +});
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/valid-set.js b/tools/eslint/node_modules/es6-set/valid-set.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/valid-set.js
      rename to tools/eslint/node_modules/es6-set/valid-set.js
      diff --git a/tools/eslint/node_modules/es6-symbol/.lint b/tools/eslint/node_modules/es6-symbol/.lint
      new file mode 100644
      index 00000000000000..df1e53cd5f547e
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-symbol/.lint
      @@ -0,0 +1,15 @@
      +@root
      +
      +module
      +
      +tabs
      +indent 2
      +maxlen 100
      +
      +ass
      +nomen
      +plusplus
      +newcap
      +vars
      +
      +predef+ Symbol
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/LICENSE b/tools/eslint/node_modules/es6-symbol/LICENSE
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/LICENSE
      rename to tools/eslint/node_modules/es6-symbol/LICENSE
      diff --git a/tools/eslint/node_modules/es6-symbol/README.md b/tools/eslint/node_modules/es6-symbol/README.md
      new file mode 100644
      index 00000000000000..0fa8978450cb4f
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-symbol/README.md
      @@ -0,0 +1,71 @@
      +# es6-symbol
      +## ECMAScript 6 Symbol polyfill
      +
      +For more information about symbols see following links
      +- [Symbols in ECMAScript 6 by Axel Rauschmayer](http://www.2ality.com/2014/12/es6-symbols.html)
      +- [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol)
      +- [Specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-symbol-constructor)
      +
      +### Limitations
      +
      +Underneath it uses real string property names which can easily be retrieved, however accidental collision with other property names is unlikely.
      +
      +### Usage
      +
      +It’s safest to use *es6-symbol* as a [ponyfill](http://kikobeats.com/polyfill-ponyfill-and-prollyfill/) – a polyfill which doesn’t touch global objects:
      +
      +```javascript
      +var Symbol = require('es6-symbol');
      +```
      +
      +If you want to make sure your environment implements `Symbol` globally, do:
      +
      +```javascript
      +require('es6-symbol/implement');
      +```
      +
      +If you strictly want to use polyfill even if native `Symbol` exists (hard to find a good reason for that), do:
      +
      +```javascript
      +var Symbol = require('es6-symbol/polyfill');
      +```
      +
      +#### API
      +
      +Best is to refer to [specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-symbol-objects). Still if you want quick look, follow examples:
      +
      +```javascript
      +var Symbol = require('es6-symbol');
      +
      +var symbol = Symbol('My custom symbol');
      +var x = {};
      +
      +x[symbol] = 'foo';
      +console.log(x[symbol]); 'foo'
      +
      +// Detect iterable:
      +var iterator, result;
      +if (possiblyIterable[Symbol.iterator]) {
      +  iterator = possiblyIterable[Symbol.iterator]();
      +  result = iterator.next();
      +  while(!result.done) {
      +    console.log(result.value);
      +    result = iterator.next();
      +  }
      +}
      +```
      +
      +### Installation
      +#### NPM
      +
      +In your project path:
      +
      +	$ npm install es6-symbol
      +
      +##### Browser
      +
      +To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)
      +
      +## Tests [![Build Status](https://travis-ci.org/medikoo/es6-symbol.png)](https://travis-ci.org/medikoo/es6-symbol)
      +
      +	$ npm test
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/implement.js b/tools/eslint/node_modules/es6-symbol/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/implement.js
      rename to tools/eslint/node_modules/es6-symbol/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/index.js b/tools/eslint/node_modules/es6-symbol/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/index.js
      rename to tools/eslint/node_modules/es6-symbol/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/is-implemented.js b/tools/eslint/node_modules/es6-symbol/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/is-implemented.js
      rename to tools/eslint/node_modules/es6-symbol/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/is-native-implemented.js b/tools/eslint/node_modules/es6-symbol/is-native-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/is-native-implemented.js
      rename to tools/eslint/node_modules/es6-symbol/is-native-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/is-symbol.js b/tools/eslint/node_modules/es6-symbol/is-symbol.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/is-symbol.js
      rename to tools/eslint/node_modules/es6-symbol/is-symbol.js
      diff --git a/tools/eslint/node_modules/es6-symbol/package.json b/tools/eslint/node_modules/es6-symbol/package.json
      new file mode 100644
      index 00000000000000..b3723ba6d7a515
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-symbol/package.json
      @@ -0,0 +1,95 @@
      +{
      +  "_args": [
      +    [
      +      "es6-symbol@~3.0.1",
      +      "/Users/silverwind/git/node/tools/package/package/node_modules/es6-map"
      +    ]
      +  ],
      +  "_from": "es6-symbol@>=3.0.1 <3.1.0",
      +  "_id": "es6-symbol@3.0.2",
      +  "_inCache": true,
      +  "_installable": true,
      +  "_location": "/es6-symbol",
      +  "_nodeVersion": "5.2.0",
      +  "_npmUser": {
      +    "email": "medikoo+npm@medikoo.com",
      +    "name": "medikoo"
      +  },
      +  "_npmVersion": "3.3.12",
      +  "_phantomChildren": {},
      +  "_requested": {
      +    "name": "es6-symbol",
      +    "raw": "es6-symbol@~3.0.1",
      +    "rawSpec": "~3.0.1",
      +    "scope": null,
      +    "spec": ">=3.0.1 <3.1.0",
      +    "type": "range"
      +  },
      +  "_requiredBy": [
      +    "/es5-ext",
      +    "/es6-iterator",
      +    "/es6-map",
      +    "/es6-set",
      +    "/es6-weak-map"
      +  ],
      +  "_resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.0.2.tgz",
      +  "_shasum": "1e928878c6f5e63541625b4bb4df4af07d154219",
      +  "_shrinkwrap": null,
      +  "_spec": "es6-symbol@~3.0.1",
      +  "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/es6-map",
      +  "author": {
      +    "email": "medyk@medikoo.com",
      +    "name": "Mariusz Nowak",
      +    "url": "http://www.medikoo.com/"
      +  },
      +  "bugs": {
      +    "url": "https://github.com/medikoo/es6-symbol/issues"
      +  },
      +  "dependencies": {
      +    "d": "~0.1.1",
      +    "es5-ext": "~0.10.10"
      +  },
      +  "description": "ECMAScript 6 Symbol polyfill",
      +  "devDependencies": {
      +    "tad": "~0.2.4",
      +    "xlint": "~0.2.2",
      +    "xlint-jslint-medikoo": "~0.1.4"
      +  },
      +  "directories": {},
      +  "dist": {
      +    "shasum": "1e928878c6f5e63541625b4bb4df4af07d154219",
      +    "tarball": "http://registry.npmjs.org/es6-symbol/-/es6-symbol-3.0.2.tgz"
      +  },
      +  "gitHead": "b7da6b926c44e3745de69b17c98c00a5c84b4ebe",
      +  "homepage": "https://github.com/medikoo/es6-symbol#readme",
      +  "keywords": [
      +    "ecmascript",
      +    "es6",
      +    "harmony",
      +    "polyfill",
      +    "ponyfill",
      +    "private",
      +    "property",
      +    "symbol"
      +  ],
      +  "license": "MIT",
      +  "maintainers": [
      +    {
      +      "name": "medikoo",
      +      "email": "medikoo+npm@medikoo.com"
      +    }
      +  ],
      +  "name": "es6-symbol",
      +  "optionalDependencies": {},
      +  "readme": "ERROR: No README data found!",
      +  "repository": {
      +    "type": "git",
      +    "url": "git://github.com/medikoo/es6-symbol.git"
      +  },
      +  "scripts": {
      +    "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream",
      +    "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch",
      +    "test": "node ./node_modules/tad/bin/tad"
      +  },
      +  "version": "3.0.2"
      +}
      diff --git a/tools/eslint/node_modules/es6-symbol/polyfill.js b/tools/eslint/node_modules/es6-symbol/polyfill.js
      new file mode 100644
      index 00000000000000..7c3c8fe90025ca
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-symbol/polyfill.js
      @@ -0,0 +1,107 @@
      +// ES2015 Symbol polyfill for environments that do not support it (or partially support it_
      +
      +'use strict';
      +
      +var d              = require('d')
      +  , validateSymbol = require('./validate-symbol')
      +
      +  , create = Object.create, defineProperties = Object.defineProperties
      +  , defineProperty = Object.defineProperty, objPrototype = Object.prototype
      +  , NativeSymbol, SymbolPolyfill, HiddenSymbol, globalSymbols = create(null);
      +
      +if (typeof Symbol === 'function') NativeSymbol = Symbol;
      +
      +var generateName = (function () {
      +	var created = create(null);
      +	return function (desc) {
      +		var postfix = 0, name, ie11BugWorkaround;
      +		while (created[desc + (postfix || '')]) ++postfix;
      +		desc += (postfix || '');
      +		created[desc] = true;
      +		name = '@@' + desc;
      +		defineProperty(objPrototype, name, d.gs(null, function (value) {
      +			// For IE11 issue see:
      +			// https://connect.microsoft.com/IE/feedbackdetail/view/1928508/
      +			//    ie11-broken-getters-on-dom-objects
      +			// https://github.com/medikoo/es6-symbol/issues/12
      +			if (ie11BugWorkaround) return;
      +			ie11BugWorkaround = true;
      +			defineProperty(this, name, d(value));
      +			ie11BugWorkaround = false;
      +		}));
      +		return name;
      +	};
      +}());
      +
      +// Internal constructor (not one exposed) for creating Symbol instances.
      +// This one is used to ensure that `someSymbol instanceof Symbol` always return false
      +HiddenSymbol = function Symbol(description) {
      +	if (this instanceof HiddenSymbol) throw new TypeError('TypeError: Symbol is not a constructor');
      +	return SymbolPolyfill(description);
      +};
      +
      +// Exposed `Symbol` constructor
      +// (returns instances of HiddenSymbol)
      +module.exports = SymbolPolyfill = function Symbol(description) {
      +	var symbol;
      +	if (this instanceof Symbol) throw new TypeError('TypeError: Symbol is not a constructor');
      +	symbol = create(HiddenSymbol.prototype);
      +	description = (description === undefined ? '' : String(description));
      +	return defineProperties(symbol, {
      +		__description__: d('', description),
      +		__name__: d('', generateName(description))
      +	});
      +};
      +defineProperties(SymbolPolyfill, {
      +	for: d(function (key) {
      +		if (globalSymbols[key]) return globalSymbols[key];
      +		return (globalSymbols[key] = SymbolPolyfill(String(key)));
      +	}),
      +	keyFor: d(function (s) {
      +		var key;
      +		validateSymbol(s);
      +		for (key in globalSymbols) if (globalSymbols[key] === s) return key;
      +	}),
      +
      +	// If there's native implementation of given symbol, let's fallback to it
      +	// to ensure proper interoperability with other native functions e.g. Array.from
      +	hasInstance: d('', (NativeSymbol && NativeSymbol.hasInstance) || SymbolPolyfill('hasInstance')),
      +	isConcatSpreadable: d('', (NativeSymbol && NativeSymbol.isConcatSpreadable) ||
      +		SymbolPolyfill('isConcatSpreadable')),
      +	iterator: d('', (NativeSymbol && NativeSymbol.iterator) || SymbolPolyfill('iterator')),
      +	match: d('', (NativeSymbol && NativeSymbol.match) || SymbolPolyfill('match')),
      +	replace: d('', (NativeSymbol && NativeSymbol.replace) || SymbolPolyfill('replace')),
      +	search: d('', (NativeSymbol && NativeSymbol.search) || SymbolPolyfill('search')),
      +	species: d('', (NativeSymbol && NativeSymbol.species) || SymbolPolyfill('species')),
      +	split: d('', (NativeSymbol && NativeSymbol.split) || SymbolPolyfill('split')),
      +	toPrimitive: d('', (NativeSymbol && NativeSymbol.toPrimitive) || SymbolPolyfill('toPrimitive')),
      +	toStringTag: d('', (NativeSymbol && NativeSymbol.toStringTag) || SymbolPolyfill('toStringTag')),
      +	unscopables: d('', (NativeSymbol && NativeSymbol.unscopables) || SymbolPolyfill('unscopables'))
      +});
      +
      +// Internal tweaks for real symbol producer
      +defineProperties(HiddenSymbol.prototype, {
      +	constructor: d(SymbolPolyfill),
      +	toString: d('', function () { return this.__name__; })
      +});
      +
      +// Proper implementation of methods exposed on Symbol.prototype
      +// They won't be accessible on produced symbol instances as they derive from HiddenSymbol.prototype
      +defineProperties(SymbolPolyfill.prototype, {
      +	toString: d(function () { return 'Symbol (' + validateSymbol(this).__description__ + ')'; }),
      +	valueOf: d(function () { return validateSymbol(this); })
      +});
      +defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toPrimitive, d('',
      +	function () { return validateSymbol(this); }));
      +defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d('c', 'Symbol'));
      +
      +// Proper implementaton of toPrimitive and toStringTag for returned symbol instances
      +defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toStringTag,
      +	d('c', SymbolPolyfill.prototype[SymbolPolyfill.toStringTag]));
      +
      +// Note: It's important to define `toPrimitive` as last one, as some implementations
      +// implement `toPrimitive` natively without implementing `toStringTag` (or other specified symbols)
      +// And that may invoke error in definition flow:
      +// See: https://github.com/medikoo/es6-symbol/issues/13#issuecomment-164146149
      +defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toPrimitive,
      +	d('c', SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive]));
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/validate-symbol.js b/tools/eslint/node_modules/es6-symbol/validate-symbol.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/validate-symbol.js
      rename to tools/eslint/node_modules/es6-symbol/validate-symbol.js
      diff --git a/tools/eslint/node_modules/es6-weak-map/.lint b/tools/eslint/node_modules/es6-weak-map/.lint
      new file mode 100644
      index 00000000000000..3c9ef8da016736
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-weak-map/.lint
      @@ -0,0 +1,13 @@
      +@root
      +
      +module
      +
      +tabs
      +indent 2
      +maxlen 100
      +
      +ass
      +nomen
      +plusplus
      +
      +predef+ WeakMap
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/LICENCE b/tools/eslint/node_modules/es6-weak-map/LICENSE
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/LICENCE
      rename to tools/eslint/node_modules/es6-weak-map/LICENSE
      diff --git a/tools/eslint/node_modules/es6-weak-map/README.md b/tools/eslint/node_modules/es6-weak-map/README.md
      new file mode 100644
      index 00000000000000..ccbade23a2dae2
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-weak-map/README.md
      @@ -0,0 +1,63 @@
      +# es6-weak-map
      +## WeakMap collection as specified in ECMAScript6
      +
      +_Roughly inspired by Mark Miller's and Kris Kowal's [WeakMap implementation](https://github.com/drses/weak-map)_.
      +
      +Differences are:
      +- Assumes compliant ES5 environment (no weird ES3 workarounds or hacks)
      +- Well modularized CJS style
      +- Based on one solution.
      +
      +### Limitations
      +
      +- Will fail on non extensible objects provided as keys
      +
      +### Installation
      +
      +	$ npm install es6-weak-map
      +
      +To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)
      +
      +### Usage
      +
      +If you want to make sure your environment implements `WeakMap`, do:
      +
      +```javascript
      +require('es6-weak-map/implement');
      +```
      +
      +If you'd like to use native version when it exists and fallback to polyfill if it doesn't, but without implementing `WeakMap` on global scope, do:
      +
      +```javascript
      +var WeakMap = require('es6-weak-map');
      +```
      +
      +If you strictly want to use polyfill even if native `WeakMap` exists, do:
      +
      +```javascript
      +var WeakMap = require('es6-weak-map/polyfill');
      +```
      +
      +#### API
      +
      +Best is to refer to [specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-weakmap-objects). Still if you want quick look, follow example:
      +
      +```javascript
      +var WeakMap = require('es6-weak-map');
      +
      +var map = new WeakMap();
      +var obj = {};
      +
      +map.set(obj, 'foo'); // map
      +map.get(obj);        // 'foo'
      +map.has(obj);        // true
      +map.delete(obj);     // true
      +map.get(obj);        // undefined
      +map.has(obj);        // false
      +map.set(obj, 'bar'); // map
      +map.has(obj);        // false
      +```
      +
      +## Tests [![Build Status](https://travis-ci.org/medikoo/es6-weak-map.svg)](https://travis-ci.org/medikoo/es6-weak-map)
      +
      +	$ npm test
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/implement.js b/tools/eslint/node_modules/es6-weak-map/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/implement.js
      rename to tools/eslint/node_modules/es6-weak-map/implement.js
      diff --git a/tools/eslint/node_modules/es6-weak-map/index.js b/tools/eslint/node_modules/es6-weak-map/index.js
      new file mode 100644
      index 00000000000000..c2ff71b928dc56
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-weak-map/index.js
      @@ -0,0 +1,3 @@
      +'use strict';
      +
      +module.exports = require('./is-implemented')() ? WeakMap : require('./polyfill');
      diff --git a/tools/eslint/node_modules/es6-weak-map/is-implemented.js b/tools/eslint/node_modules/es6-weak-map/is-implemented.js
      new file mode 100644
      index 00000000000000..6ef5082ef40762
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-weak-map/is-implemented.js
      @@ -0,0 +1,20 @@
      +'use strict';
      +
      +module.exports = function () {
      +	var weakMap, x;
      +	if (typeof WeakMap !== 'function') return false;
      +	try {
      +		// WebKit doesn't support arguments and crashes
      +		weakMap = new WeakMap([[x = {}, 'one'], [{}, 'two'], [{}, 'three']]);
      +	} catch (e) {
      +		return false;
      +	}
      +	if (String(weakMap) !== '[object WeakMap]') return false;
      +	if (typeof weakMap.set !== 'function') return false;
      +	if (weakMap.set({}, 1) !== weakMap) return false;
      +	if (typeof weakMap.delete !== 'function') return false;
      +	if (typeof weakMap.has !== 'function') return false;
      +	if (weakMap.get(x) !== 'one') return false;
      +
      +	return true;
      +};
      diff --git a/tools/eslint/node_modules/es6-weak-map/is-native-implemented.js b/tools/eslint/node_modules/es6-weak-map/is-native-implemented.js
      new file mode 100644
      index 00000000000000..ddc4dbd29c17eb
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-weak-map/is-native-implemented.js
      @@ -0,0 +1,8 @@
      +// Exports true if environment provides native `WeakMap` implementation, whatever that is.
      +
      +'use strict';
      +
      +module.exports = (function () {
      +	if (typeof WeakMap !== 'function') return false;
      +	return (Object.prototype.toString.call(new WeakMap()) === '[object WeakMap]');
      +}());
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/is-weak-map.js b/tools/eslint/node_modules/es6-weak-map/is-weak-map.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/is-weak-map.js
      rename to tools/eslint/node_modules/es6-weak-map/is-weak-map.js
      diff --git a/tools/eslint/node_modules/es6-weak-map/package.json b/tools/eslint/node_modules/es6-weak-map/package.json
      new file mode 100644
      index 00000000000000..a686d4bda697c1
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-weak-map/package.json
      @@ -0,0 +1,94 @@
      +{
      +  "_args": [
      +    [
      +      "es6-weak-map@^2.0.1",
      +      "/Users/silverwind/git/node/tools/package/package/node_modules/escope"
      +    ]
      +  ],
      +  "_from": "es6-weak-map@>=2.0.1 <3.0.0",
      +  "_id": "es6-weak-map@2.0.1",
      +  "_inCache": true,
      +  "_installable": true,
      +  "_location": "/es6-weak-map",
      +  "_nodeVersion": "0.12.7",
      +  "_npmUser": {
      +    "email": "medikoo+npm@medikoo.com",
      +    "name": "medikoo"
      +  },
      +  "_npmVersion": "2.11.3",
      +  "_phantomChildren": {},
      +  "_requested": {
      +    "name": "es6-weak-map",
      +    "raw": "es6-weak-map@^2.0.1",
      +    "rawSpec": "^2.0.1",
      +    "scope": null,
      +    "spec": ">=2.0.1 <3.0.0",
      +    "type": "range"
      +  },
      +  "_requiredBy": [
      +    "/escope"
      +  ],
      +  "_resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.1.tgz",
      +  "_shasum": "0d2bbd8827eb5fb4ba8f97fbfea50d43db21ea81",
      +  "_shrinkwrap": null,
      +  "_spec": "es6-weak-map@^2.0.1",
      +  "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/escope",
      +  "author": {
      +    "email": "medyk@medikoo.com",
      +    "name": "Mariusz Nowak",
      +    "url": "http://www.medikoo.com/"
      +  },
      +  "bugs": {
      +    "url": "https://github.com/medikoo/es6-weak-map/issues"
      +  },
      +  "dependencies": {
      +    "d": "^0.1.1",
      +    "es5-ext": "^0.10.8",
      +    "es6-iterator": "2",
      +    "es6-symbol": "3"
      +  },
      +  "description": "ECMAScript6 WeakMap polyfill",
      +  "devDependencies": {
      +    "tad": "^0.2.3",
      +    "xlint": "^0.2.2",
      +    "xlint-jslint-medikoo": "^0.1.4"
      +  },
      +  "directories": {},
      +  "dist": {
      +    "shasum": "0d2bbd8827eb5fb4ba8f97fbfea50d43db21ea81",
      +    "tarball": "http://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.1.tgz"
      +  },
      +  "gitHead": "b8b62d44e3b9f8134095c8fb6a5697e371b36867",
      +  "homepage": "https://github.com/medikoo/es6-weak-map#readme",
      +  "keywords": [
      +    "collection",
      +    "es6",
      +    "gc",
      +    "harmony",
      +    "hash",
      +    "list",
      +    "map",
      +    "ponyfill",
      +    "weakmap"
      +  ],
      +  "license": "MIT",
      +  "maintainers": [
      +    {
      +      "name": "medikoo",
      +      "email": "medikoo+npm@medikoo.com"
      +    }
      +  ],
      +  "name": "es6-weak-map",
      +  "optionalDependencies": {},
      +  "readme": "ERROR: No README data found!",
      +  "repository": {
      +    "type": "git",
      +    "url": "git://github.com/medikoo/es6-weak-map.git"
      +  },
      +  "scripts": {
      +    "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream",
      +    "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch",
      +    "test": "node ./node_modules/tad/bin/tad"
      +  },
      +  "version": "2.0.1"
      +}
      diff --git a/tools/eslint/node_modules/es6-weak-map/polyfill.js b/tools/eslint/node_modules/es6-weak-map/polyfill.js
      new file mode 100644
      index 00000000000000..6bef09f5b07622
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-weak-map/polyfill.js
      @@ -0,0 +1,66 @@
      +'use strict';
      +
      +var setPrototypeOf    = require('es5-ext/object/set-prototype-of')
      +  , object            = require('es5-ext/object/valid-object')
      +  , value             = require('es5-ext/object/valid-value')
      +  , randomUniq        = require('es5-ext/string/random-uniq')
      +  , d                 = require('d')
      +  , getIterator       = require('es6-iterator/get')
      +  , forOf             = require('es6-iterator/for-of')
      +  , toStringTagSymbol = require('es6-symbol').toStringTag
      +  , isNative          = require('./is-native-implemented')
      +
      +  , isArray = Array.isArray, defineProperty = Object.defineProperty
      +  , hasOwnProperty = Object.prototype.hasOwnProperty, getPrototypeOf = Object.getPrototypeOf
      +  , WeakMapPoly;
      +
      +module.exports = WeakMapPoly = function (/*iterable*/) {
      +	var iterable = arguments[0], self;
      +	if (!(this instanceof WeakMapPoly)) throw new TypeError('Constructor requires \'new\'');
      +	if (isNative && setPrototypeOf && (WeakMap !== WeakMapPoly)) {
      +		self = setPrototypeOf(new WeakMap(), getPrototypeOf(this));
      +	} else {
      +		self = this;
      +	}
      +	if (iterable != null) {
      +		if (!isArray(iterable)) iterable = getIterator(iterable);
      +	}
      +	defineProperty(self, '__weakMapData__', d('c', '$weakMap$' + randomUniq()));
      +	if (!iterable) return self;
      +	forOf(iterable, function (val) {
      +		value(val);
      +		self.set(val[0], val[1]);
      +	});
      +	return self;
      +};
      +
      +if (isNative) {
      +	if (setPrototypeOf) setPrototypeOf(WeakMapPoly, WeakMap);
      +	WeakMapPoly.prototype = Object.create(WeakMap.prototype, {
      +		constructor: d(WeakMapPoly)
      +	});
      +}
      +
      +Object.defineProperties(WeakMapPoly.prototype, {
      +	delete: d(function (key) {
      +		if (hasOwnProperty.call(object(key), this.__weakMapData__)) {
      +			delete key[this.__weakMapData__];
      +			return true;
      +		}
      +		return false;
      +	}),
      +	get: d(function (key) {
      +		if (hasOwnProperty.call(object(key), this.__weakMapData__)) {
      +			return key[this.__weakMapData__];
      +		}
      +	}),
      +	has: d(function (key) {
      +		return hasOwnProperty.call(object(key), this.__weakMapData__);
      +	}),
      +	set: d(function (key, value) {
      +		defineProperty(object(key), this.__weakMapData__, d('c', value));
      +		return this;
      +	}),
      +	toString: d(function () { return '[object WeakMap]'; })
      +});
      +defineProperty(WeakMapPoly.prototype, toStringTagSymbol, d('c', 'WeakMap'));
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/valid-weak-map.js b/tools/eslint/node_modules/es6-weak-map/valid-weak-map.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/valid-weak-map.js
      rename to tools/eslint/node_modules/es6-weak-map/valid-weak-map.js
      diff --git a/tools/eslint/node_modules/escape-string-regexp/index.js b/tools/eslint/node_modules/escape-string-regexp/index.js
      index ac6572cabec57d..7834bf9b24c481 100644
      --- a/tools/eslint/node_modules/escape-string-regexp/index.js
      +++ b/tools/eslint/node_modules/escape-string-regexp/index.js
      @@ -7,5 +7,5 @@ module.exports = function (str) {
       		throw new TypeError('Expected a string');
       	}
       
      -	return str.replace(matchOperatorsRe,  '\\$&');
      +	return str.replace(matchOperatorsRe, '\\$&');
       };
      diff --git a/tools/eslint/node_modules/escape-string-regexp/package.json b/tools/eslint/node_modules/escape-string-regexp/package.json
      index 813c9089d27760..64096da9934715 100644
      --- a/tools/eslint/node_modules/escape-string-regexp/package.json
      +++ b/tools/eslint/node_modules/escape-string-regexp/package.json
      @@ -1,70 +1,101 @@
       {
      -  "name": "escape-string-regexp",
      -  "version": "1.0.3",
      -  "description": "Escape RegExp special characters",
      -  "license": "MIT",
      -  "repository": {
      -    "type": "git",
      -    "url": "git+https://github.com/sindresorhus/escape-string-regexp.git"
      +  "_args": [
      +    [
      +      "escape-string-regexp@^1.0.2",
      +      "/Users/silverwind/git/node/tools/package/package/node_modules/chalk"
      +    ]
      +  ],
      +  "_from": "escape-string-regexp@>=1.0.2 <2.0.0",
      +  "_id": "escape-string-regexp@1.0.5",
      +  "_inCache": true,
      +  "_installable": true,
      +  "_location": "/escape-string-regexp",
      +  "_nodeVersion": "4.2.6",
      +  "_npmOperationalInternal": {
      +    "host": "packages-9-west.internal.npmjs.com",
      +    "tmp": "tmp/escape-string-regexp-1.0.5.tgz_1456059312074_0.7245344955008477"
      +  },
      +  "_npmUser": {
      +    "email": "jappelman@xebia.com",
      +    "name": "jbnicolai"
      +  },
      +  "_npmVersion": "2.14.12",
      +  "_phantomChildren": {},
      +  "_requested": {
      +    "name": "escape-string-regexp",
      +    "raw": "escape-string-regexp@^1.0.2",
      +    "rawSpec": "^1.0.2",
      +    "scope": null,
      +    "spec": ">=1.0.2 <2.0.0",
      +    "type": "range"
         },
      +  "_requiredBy": [
      +    "/chalk"
      +  ],
      +  "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
      +  "_shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4",
      +  "_shrinkwrap": null,
      +  "_spec": "escape-string-regexp@^1.0.2",
      +  "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/chalk",
         "author": {
      -    "name": "Sindre Sorhus",
           "email": "sindresorhus@gmail.com",
      -    "url": "http://sindresorhus.com"
      +    "name": "Sindre Sorhus",
      +    "url": "sindresorhus.com"
      +  },
      +  "bugs": {
      +    "url": "https://github.com/sindresorhus/escape-string-regexp/issues"
      +  },
      +  "dependencies": {},
      +  "description": "Escape RegExp special characters",
      +  "devDependencies": {
      +    "ava": "*",
      +    "xo": "*"
      +  },
      +  "directories": {},
      +  "dist": {
      +    "shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4",
      +    "tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz"
         },
      -  "maintainers": [
      -    {
      -      "name": "sindresorhus",
      -      "email": "sindresorhus@gmail.com"
      -    },
      -    {
      -      "name": "jbnicolai",
      -      "email": "jappelman@xebia.com"
      -    }
      -  ],
         "engines": {
           "node": ">=0.8.0"
         },
      -  "scripts": {
      -    "test": "mocha"
      -  },
         "files": [
           "index.js"
         ],
      +  "gitHead": "db124a3e1aae9d692c4899e42a5c6c3e329eaa20",
      +  "homepage": "https://github.com/sindresorhus/escape-string-regexp",
         "keywords": [
      +    "characters",
      +    "escape",
      +    "expression",
      +    "re",
           "regex",
           "regexp",
      -    "re",
           "regular",
      -    "expression",
      -    "escape",
      -    "string",
      -    "str",
           "special",
      -    "characters"
      +    "str",
      +    "string"
         ],
      -  "devDependencies": {
      -    "mocha": "*"
      -  },
      -  "gitHead": "1e446e6b4449b5f1f8868cd31bf8fd25ee37fb4b",
      -  "bugs": {
      -    "url": "https://github.com/sindresorhus/escape-string-regexp/issues"
      -  },
      -  "homepage": "https://github.com/sindresorhus/escape-string-regexp",
      -  "_id": "escape-string-regexp@1.0.3",
      -  "_shasum": "9e2d8b25bc2555c3336723750e03f099c2735bb5",
      -  "_from": "escape-string-regexp@>=1.0.2 <2.0.0",
      -  "_npmVersion": "2.1.16",
      -  "_nodeVersion": "0.10.35",
      -  "_npmUser": {
      -    "name": "jbnicolai",
      -    "email": "jappelman@xebia.com"
      +  "license": "MIT",
      +  "maintainers": [
      +    {
      +      "name": "sindresorhus",
      +      "email": "sindresorhus@gmail.com"
      +    },
      +    {
      +      "name": "jbnicolai",
      +      "email": "jappelman@xebia.com"
      +    }
      +  ],
      +  "name": "escape-string-regexp",
      +  "optionalDependencies": {},
      +  "readme": "ERROR: No README data found!",
      +  "repository": {
      +    "type": "git",
      +    "url": "git+https://github.com/sindresorhus/escape-string-regexp.git"
         },
      -  "dist": {
      -    "shasum": "9e2d8b25bc2555c3336723750e03f099c2735bb5",
      -    "tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz"
      +  "scripts": {
      +    "test": "xo && ava"
         },
      -  "directories": {},
      -  "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz",
      -  "readme": "ERROR: No README data found!"
      +  "version": "1.0.5"
       }
      diff --git a/tools/eslint/node_modules/escape-string-regexp/readme.md b/tools/eslint/node_modules/escape-string-regexp/readme.md
      index 808a963a86235e..87ac82d5ef8bc9 100644
      --- a/tools/eslint/node_modules/escape-string-regexp/readme.md
      +++ b/tools/eslint/node_modules/escape-string-regexp/readme.md
      @@ -5,7 +5,7 @@
       
       ## Install
       
      -```sh
      +```
       $ npm install --save escape-string-regexp
       ```
       
      @@ -13,10 +13,10 @@ $ npm install --save escape-string-regexp
       ## Usage
       
       ```js
      -var escapeStringRegexp = require('escape-string-regexp');
      +const escapeStringRegexp = require('escape-string-regexp');
       
      -var escapedString = escapeStringRegexp('how much $ for a unicorn?');
      -//=> how much \$ for a unicorn\?
      +const escapedString = escapeStringRegexp('how much $ for a unicorn?');
      +//=> 'how much \$ for a unicorn\?'
       
       new RegExp(escapedString);
       ```
      diff --git a/tools/eslint/node_modules/escope/.babelrc b/tools/eslint/node_modules/escope/.babelrc
      new file mode 100644
      index 00000000000000..c13c5f627fd143
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/.babelrc
      @@ -0,0 +1,3 @@
      +{
      +  "presets": ["es2015"]
      +}
      diff --git a/tools/eslint/node_modules/escope/.jshintrc b/tools/eslint/node_modules/escope/.jshintrc
      deleted file mode 100644
      index defbf02636c7aa..00000000000000
      --- a/tools/eslint/node_modules/escope/.jshintrc
      +++ /dev/null
      @@ -1,20 +0,0 @@
      -{
      -    "curly": true,
      -    "eqeqeq": true,
      -    "immed": true,
      -    "indent": 4,
      -    "eqnull": true,
      -    "latedef": true,
      -    "noarg": true,
      -    "noempty": true,
      -    "quotmark": "single",
      -    "undef": true,
      -    "unused": true,
      -    "strict": true,
      -    "trailing": true,
      -    "validthis": true,
      -
      -    "onevar": true,
      -
      -    "node": true
      -}
      diff --git a/tools/eslint/node_modules/escope/CONTRIBUTING.md b/tools/eslint/node_modules/escope/CONTRIBUTING.md
      deleted file mode 100644
      index f1ddca9cbdcc30..00000000000000
      --- a/tools/eslint/node_modules/escope/CONTRIBUTING.md
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -## Project license:  \
      -
      -- You will only Submit Contributions where You have authored 100% of the content.
      -- You will only Submit Contributions to which You have the necessary rights. This means that if You are employed You have received the necessary permissions from Your employer to make the Contributions.
      -- Whatever content You Contribute will be provided under the Project License.
      diff --git a/tools/eslint/node_modules/escope/README.md b/tools/eslint/node_modules/escope/README.md
      index 7650b24700268c..a2bfeb72f85416 100644
      --- a/tools/eslint/node_modules/escope/README.md
      +++ b/tools/eslint/node_modules/escope/README.md
      @@ -6,31 +6,33 @@ scope analyzer extracted from [esmangle project](http://github.com/estools/esman
       
       ### Example
       
      -    var escope = require('escope');
      -    var esprima = require('esprima');
      -    var estraverse = require('estraverse');
      -    
      -    var ast = esprima.parse(code);
      -    var scopeManager = escope.analyze(ast);
      -    
      -    var currentScope = scopeManager.acquire(ast);   // global scope
      -
      -    estraverse.traverse(ast, {
      -        enter: function(node, parent) {
      -            // do stuff
      -            
      -            if (/Function/.test(node.type)) {
      -                currentScope = scopeManager.acquire(node);  // get current function scope
      -            }
      -        },
      -        leave: function(node, parent) {
      -            if (/Function/.test(node.type)) {
      -                currentScope = currentScope.upper;  // set to parent scope
      -            }
      -            
      -            // do stuff
      +```js
      +var escope = require('escope');
      +var esprima = require('esprima');
      +var estraverse = require('estraverse');
      +
      +var ast = esprima.parse(code);
      +var scopeManager = escope.analyze(ast);
      +
      +var currentScope = scopeManager.acquire(ast);   // global scope
      +
      +estraverse.traverse(ast, {
      +    enter: function(node, parent) {
      +        // do stuff
      +
      +        if (/Function/.test(node.type)) {
      +            currentScope = scopeManager.acquire(node);  // get current function scope
      +        }
      +    },
      +    leave: function(node, parent) {
      +        if (/Function/.test(node.type)) {
      +            currentScope = currentScope.upper;  // set to parent scope
               }
      -    });
      +
      +        // do stuff
      +    }
      +});
      +```
       
       ### Document
       
      diff --git a/tools/eslint/node_modules/escope/bower.json b/tools/eslint/node_modules/escope/bower.json
      deleted file mode 100644
      index 70ad5e5ff3948c..00000000000000
      --- a/tools/eslint/node_modules/escope/bower.json
      +++ /dev/null
      @@ -1,13 +0,0 @@
      -{
      -  "name": "escope",
      -  "version": "2.0.2-dev",
      -  "main": "escope.js",
      -  "dependencies": {
      -    "estraverse": ">= 0.0.2"
      -  },
      -  "ignore": [
      -    "**/.*",
      -    "node_modules",
      -    "components"
      -  ]
      -}
      diff --git a/tools/eslint/node_modules/escope/gulpfile.js b/tools/eslint/node_modules/escope/gulpfile.js
      deleted file mode 100644
      index afc68330dd69eb..00000000000000
      --- a/tools/eslint/node_modules/escope/gulpfile.js
      +++ /dev/null
      @@ -1,147 +0,0 @@
      -/*
      -  Copyright (C) 2014 Yusuke Suzuki 
      -
      -  Redistribution and use in source and binary forms, with or without
      -  modification, are permitted provided that the following conditions are met:
      -
      -    * Redistributions of source code must retain the above copyright
      -      notice, this list of conditions and the following disclaimer.
      -    * Redistributions in binary form must reproduce the above copyright
      -      notice, this list of conditions and the following disclaimer in the
      -      documentation and/or other materials provided with the distribution.
      -
      -  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
      -  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      -  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      -  ARE DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
      -  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
      -  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
      -  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      -  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      -  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
      -  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      -*/
      -
      -'use strict';
      -
      -var gulp = require('gulp'),
      -    mocha = require('gulp-mocha'),
      -    babel = require('gulp-babel'),
      -    git = require('gulp-git'),
      -    bump = require('gulp-bump'),
      -    filter = require('gulp-filter'),
      -    tagVersion = require('gulp-tag-version'),
      -    sourcemaps = require('gulp-sourcemaps'),
      -    coffee = require('gulp-coffee'),
      -    plumber = require('gulp-plumber'),
      -    source = require('vinyl-source-stream'),
      -    browserify = require('browserify'),
      -    lazypipe = require('lazypipe'),
      -    eslint = require('gulp-eslint'),
      -    coffee = require('coffee-script/register');
      -
      -var TEST = [ 'test/*.coffee' ];
      -var SOURCE = [ 'src/**/*.js' ];
      -
      -var ESLINT_OPTION = {
      -    rules: {
      -        'quotes': 0,
      -        'eqeqeq': 0,
      -        'no-use-before-define': 0,
      -        'no-shadow': 0,
      -        'no-new': 0,
      -        'no-underscore-dangle': 0,
      -        'no-multi-spaces': false,
      -        'no-native-reassign': 0,
      -        'no-loop-func': 0,
      -        'no-lone-blocks': 0
      -    },
      -    settings: {
      -        "ecmascript": 6,
      -        "jsx": false
      -    },
      -    env: {
      -        'node': true
      -    }
      -};
      -
      -var build = lazypipe()
      -    .pipe(sourcemaps.init)
      -    .pipe(babel)
      -    .pipe(sourcemaps.write)
      -    .pipe(gulp.dest, 'lib');
      -
      -gulp.task('build-for-watch', function () {
      -    return gulp.src(SOURCE).pipe(plumber()).pipe(build());
      -});
      -
      -gulp.task('build', function () {
      -    return gulp.src(SOURCE).pipe(build());
      -});
      -
      -gulp.task('browserify', [ 'build' ], function () {
      -    return browserify({
      -        entries: [ './lib/index.js' ]
      -    })
      -    .bundle()
      -    .pipe(source('bundle.js'))
      -    .pipe(gulp.dest('build'))
      -});
      -
      -gulp.task('test', [ 'build' ], function () {
      -    return gulp.src(TEST)
      -        .pipe(mocha({
      -            reporter: 'spec',
      -            timeout: 100000 // 100s
      -        }));
      -});
      -
      -gulp.task('watch', [ 'build-for-watch' ], function () {
      -    gulp.watch(SOURCE, [ 'build-for-watch' ]);
      -});
      -
      -// Currently, not works for ES6.
      -gulp.task('lint', function () {
      -    return gulp.src(SOURCE)
      -        .pipe(eslint(ESLINT_OPTION))
      -        .pipe(eslint.formatEach('stylish', process.stderr))
      -        .pipe(eslint.failOnError());
      -});
      -
      -/**
      - * Bumping version number and tagging the repository with it.
      - * Please read http://semver.org/
      - *
      - * You can use the commands
      - *
      - *     gulp patch     # makes v0.1.0 -> v0.1.1
      - *     gulp feature   # makes v0.1.1 -> v0.2.0
      - *     gulp release   # makes v0.2.1 -> v1.0.0
      - *
      - * To bump the version numbers accordingly after you did a patch,
      - * introduced a feature or made a backwards-incompatible release.
      - */
      -
      -function inc(importance) {
      -    // get all the files to bump version in
      -    return gulp.src(['./package.json'])
      -        // bump the version number in those files
      -        .pipe(bump({type: importance}))
      -        // save it back to filesystem
      -        .pipe(gulp.dest('./'))
      -        // commit the changed version number
      -        .pipe(git.commit('Bumps package version'))
      -        // read only one file to get the version number
      -        .pipe(filter('package.json'))
      -        // **tag it in the repository**
      -        .pipe(tagVersion({
      -            prefix: ''
      -        }));
      -}
      -
      -gulp.task('patch', [ 'build' ], function () { return inc('patch'); })
      -gulp.task('minor', [ 'build' ], function () { return inc('minor'); })
      -gulp.task('major', [ 'build' ], function () { return inc('major'); })
      -
      -gulp.task('travis', [ 'test' ]);
      -gulp.task('default', [ 'travis' ]);
      diff --git a/tools/eslint/node_modules/escope/lib/definition.js b/tools/eslint/node_modules/escope/lib/definition.js
      index 5ff4f9751547bc..7becdde829e899 100644
      --- a/tools/eslint/node_modules/escope/lib/definition.js
      +++ b/tools/eslint/node_modules/escope/lib/definition.js
      @@ -1,41 +1,43 @@
      -"use strict";
      +'use strict';
       
      -var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
      +Object.defineProperty(exports, "__esModule", {
      +  value: true
      +});
      +exports.Definition = exports.ParameterDefinition = undefined;
       
      -var _get = function get(object, property, receiver) { var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc && desc.writable) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
      +var _variable = require('./variable');
       
      -var _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; };
      +var _variable2 = _interopRequireDefault(_variable);
       
      -var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
      +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
       
      -Object.defineProperty(exports, "__esModule", {
      -  value: true
      -});
      -/*
      -  Copyright (C) 2015 Yusuke Suzuki 
      -
      -  Redistribution and use in source and binary forms, with or without
      -  modification, are permitted provided that the following conditions are met:
      -
      -    * Redistributions of source code must retain the above copyright
      -      notice, this list of conditions and the following disclaimer.
      -    * Redistributions in binary form must reproduce the above copyright
      -      notice, this list of conditions and the following disclaimer in the
      -      documentation and/or other materials provided with the distribution.
      -
      -  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
      -  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      -  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      -  ARE DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
      -  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
      -  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
      -  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      -  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      -  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
      -  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      -*/
      -
      -var Variable = _interopRequire(require("./variable"));
      +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
      +
      +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
      +
      +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /*
      +                                                                                                                                                            Copyright (C) 2015 Yusuke Suzuki 
      +
      +                                                                                                                                                            Redistribution and use in source and binary forms, with or without
      +                                                                                                                                                            modification, are permitted provided that the following conditions are met:
      +
      +                                                                                                                                                              * Redistributions of source code must retain the above copyright
      +                                                                                                                                                                notice, this list of conditions and the following disclaimer.
      +                                                                                                                                                              * Redistributions in binary form must reproduce the above copyright
      +                                                                                                                                                                notice, this list of conditions and the following disclaimer in the
      +                                                                                                                                                                documentation and/or other materials provided with the distribution.
      +
      +                                                                                                                                                            THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
      +                                                                                                                                                            AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      +                                                                                                                                                            IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      +                                                                                                                                                            ARE DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
      +                                                                                                                                                            DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
      +                                                                                                                                                            (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
      +                                                                                                                                                            LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      +                                                                                                                                                            ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      +                                                                                                                                                            (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
      +                                                                                                                                                            THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      +                                                                                                                                                          */
       
       /**
        * @class Definition
      @@ -70,31 +72,35 @@ var Definition = function Definition(type, name, node, parent, index, kind) {
         this.kind = kind;
       };
       
      -exports["default"] = Definition;
      -
       /**
        * @class ParameterDefinition
        */
       
      -var ParameterDefinition = (function (_Definition) {
      +
      +exports.default = Definition;
      +
      +var ParameterDefinition = function (_Definition) {
      +  _inherits(ParameterDefinition, _Definition);
      +
         function ParameterDefinition(name, node, index, rest) {
           _classCallCheck(this, ParameterDefinition);
       
      -    _get(Object.getPrototypeOf(ParameterDefinition.prototype), "constructor", this).call(this, Variable.Parameter, name, node, null, index, null);
           /**
            * Whether the parameter definition is a part of a rest parameter.
            * @member {boolean} ParameterDefinition#rest
            */
      -    this.rest = rest;
      -  }
       
      -  _inherits(ParameterDefinition, _Definition);
      +    var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(ParameterDefinition).call(this, _variable2.default.Parameter, name, node, null, index, null));
      +
      +    _this.rest = rest;
      +    return _this;
      +  }
       
         return ParameterDefinition;
      -})(Definition);
      +}(Definition);
       
       exports.ParameterDefinition = ParameterDefinition;
      +exports.Definition = Definition;
       
       /* vim: set sw=4 ts=4 et tw=80 : */
      -exports.Definition = Definition;
      -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRlZmluaXRpb24uanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztJQXdCTyxRQUFRLDJCQUFNLFlBQVk7Ozs7OztJQUtaLFVBQVUsR0FDaEIsU0FETSxVQUFVLENBQ2YsSUFBSSxFQUFFLElBQUksRUFBRSxJQUFJLEVBQUUsTUFBTSxFQUFFLEtBQUssRUFBRSxJQUFJLEVBQUU7d0JBRGxDLFVBQVU7Ozs7O0FBS3ZCLE1BQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxDQUFDOzs7O0FBSWpCLE1BQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxDQUFDOzs7O0FBSWpCLE1BQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxDQUFDOzs7O0FBSWpCLE1BQUksQ0FBQyxNQUFNLEdBQUcsTUFBTSxDQUFDOzs7O0FBSXJCLE1BQUksQ0FBQyxLQUFLLEdBQUcsS0FBSyxDQUFDOzs7O0FBSW5CLE1BQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxDQUFDO0NBQ3BCOztxQkExQmdCLFVBQVU7Ozs7OztJQWdDekIsbUJBQW1CO0FBQ1YsV0FEVCxtQkFBbUIsQ0FDVCxJQUFJLEVBQUUsSUFBSSxFQUFFLEtBQUssRUFBRSxJQUFJLEVBQUU7MEJBRG5DLG1CQUFtQjs7QUFFakIsK0JBRkYsbUJBQW1CLDZDQUVYLFFBQVEsQ0FBQyxTQUFTLEVBQUUsSUFBSSxFQUFFLElBQUksRUFBRSxJQUFJLEVBQUUsS0FBSyxFQUFFLElBQUksRUFBRTs7Ozs7QUFLekQsUUFBSSxDQUFDLElBQUksR0FBRyxJQUFJLENBQUM7R0FDcEI7O1lBUkMsbUJBQW1COztTQUFuQixtQkFBbUI7R0FBUyxVQUFVOztRQVl4QyxtQkFBbUIsR0FBbkIsbUJBQW1COzs7UUFDbkIsVUFBVSxHQUFWLFVBQVUiLCJmaWxlIjoiZGVmaW5pdGlvbi5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gIENvcHlyaWdodCAoQykgMjAxNSBZdXN1a2UgU3V6dWtpIDx1dGF0YW5lLnRlYUBnbWFpbC5jb20+XG5cbiAgUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0XG4gIG1vZGlmaWNhdGlvbiwgYXJlIHBlcm1pdHRlZCBwcm92aWRlZCB0aGF0IHRoZSBmb2xsb3dpbmcgY29uZGl0aW9ucyBhcmUgbWV0OlxuXG4gICAgKiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodFxuICAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyLlxuICAgICogUmVkaXN0cmlidXRpb25zIGluIGJpbmFyeSBmb3JtIG11c3QgcmVwcm9kdWNlIHRoZSBhYm92ZSBjb3B5cmlnaHRcbiAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lciBpbiB0aGVcbiAgICAgIGRvY3VtZW50YXRpb24gYW5kL29yIG90aGVyIG1hdGVyaWFscyBwcm92aWRlZCB3aXRoIHRoZSBkaXN0cmlidXRpb24uXG5cbiAgVEhJUyBTT0ZUV0FSRSBJUyBQUk9WSURFRCBCWSBUSEUgQ09QWVJJR0hUIEhPTERFUlMgQU5EIENPTlRSSUJVVE9SUyBcIkFTIElTXCJcbiAgQU5EIEFOWSBFWFBSRVNTIE9SIElNUExJRUQgV0FSUkFOVElFUywgSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFRIRVxuICBJTVBMSUVEIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZIEFORCBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRVxuICBBUkUgRElTQ0xBSU1FRC4gSU4gTk8gRVZFTlQgU0hBTEwgPENPUFlSSUdIVCBIT0xERVI+IEJFIExJQUJMRSBGT1IgQU5ZXG4gIERJUkVDVCwgSU5ESVJFQ1QsIElOQ0lERU5UQUwsIFNQRUNJQUwsIEVYRU1QTEFSWSwgT1IgQ09OU0VRVUVOVElBTCBEQU1BR0VTXG4gIChJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgUFJPQ1VSRU1FTlQgT0YgU1VCU1RJVFVURSBHT09EUyBPUiBTRVJWSUNFUztcbiAgTE9TUyBPRiBVU0UsIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EXG4gIE9OIEFOWSBUSEVPUlkgT0YgTElBQklMSVRZLCBXSEVUSEVSIElOIENPTlRSQUNULCBTVFJJQ1QgTElBQklMSVRZLCBPUiBUT1JUXG4gIChJTkNMVURJTkcgTkVHTElHRU5DRSBPUiBPVEhFUldJU0UpIEFSSVNJTkcgSU4gQU5ZIFdBWSBPVVQgT0YgVEhFIFVTRSBPRlxuICBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLlxuKi9cblxuaW1wb3J0IFZhcmlhYmxlIGZyb20gJy4vdmFyaWFibGUnO1xuXG4vKipcbiAqIEBjbGFzcyBEZWZpbml0aW9uXG4gKi9cbmV4cG9ydCBkZWZhdWx0IGNsYXNzIERlZmluaXRpb24ge1xuICAgIGNvbnN0cnVjdG9yKHR5cGUsIG5hbWUsIG5vZGUsIHBhcmVudCwgaW5kZXgsIGtpbmQpIHtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZW1iZXIge1N0cmluZ30gRGVmaW5pdGlvbiN0eXBlIC0gdHlwZSBvZiB0aGUgb2NjdXJyZW5jZSAoZS5nLiBcIlBhcmFtZXRlclwiLCBcIlZhcmlhYmxlXCIsIC4uLikuXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLnR5cGUgPSB0eXBlO1xuICAgICAgICAvKipcbiAgICAgICAgICogQG1lbWJlciB7ZXNwcmltYS5JZGVudGlmaWVyfSBEZWZpbml0aW9uI25hbWUgLSB0aGUgaWRlbnRpZmllciBBU1Qgbm9kZSBvZiB0aGUgb2NjdXJyZW5jZS5cbiAgICAgICAgICovXG4gICAgICAgIHRoaXMubmFtZSA9IG5hbWU7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbWVtYmVyIHtlc3ByaW1hLk5vZGV9IERlZmluaXRpb24jbm9kZSAtIHRoZSBlbmNsb3Npbmcgbm9kZSBvZiB0aGUgaWRlbnRpZmllci5cbiAgICAgICAgICovXG4gICAgICAgIHRoaXMubm9kZSA9IG5vZGU7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbWVtYmVyIHtlc3ByaW1hLk5vZGU/fSBEZWZpbml0aW9uI3BhcmVudCAtIHRoZSBlbmNsb3Npbmcgc3RhdGVtZW50IG5vZGUgb2YgdGhlIGlkZW50aWZpZXIuXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLnBhcmVudCA9IHBhcmVudDtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZW1iZXIge051bWJlcj99IERlZmluaXRpb24jaW5kZXggLSB0aGUgaW5kZXggaW4gdGhlIGRlY2xhcmF0aW9uIHN0YXRlbWVudC5cbiAgICAgICAgICovXG4gICAgICAgIHRoaXMuaW5kZXggPSBpbmRleDtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZW1iZXIge1N0cmluZz99IERlZmluaXRpb24ja2luZCAtIHRoZSBraW5kIG9mIHRoZSBkZWNsYXJhdGlvbiBzdGF0ZW1lbnQuXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLmtpbmQgPSBraW5kO1xuICAgIH1cbn1cblxuLyoqXG4gKiBAY2xhc3MgUGFyYW1ldGVyRGVmaW5pdGlvblxuICovXG5jbGFzcyBQYXJhbWV0ZXJEZWZpbml0aW9uIGV4dGVuZHMgRGVmaW5pdGlvbiB7XG4gICAgY29uc3RydWN0b3IobmFtZSwgbm9kZSwgaW5kZXgsIHJlc3QpIHtcbiAgICAgICAgc3VwZXIoVmFyaWFibGUuUGFyYW1ldGVyLCBuYW1lLCBub2RlLCBudWxsLCBpbmRleCwgbnVsbCk7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBXaGV0aGVyIHRoZSBwYXJhbWV0ZXIgZGVmaW5pdGlvbiBpcyBhIHBhcnQgb2YgYSByZXN0IHBhcmFtZXRlci5cbiAgICAgICAgICogQG1lbWJlciB7Ym9vbGVhbn0gUGFyYW1ldGVyRGVmaW5pdGlvbiNyZXN0XG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLnJlc3QgPSByZXN0O1xuICAgIH1cbn1cblxuZXhwb3J0IHtcbiAgICBQYXJhbWV0ZXJEZWZpbml0aW9uLFxuICAgIERlZmluaXRpb25cbn1cblxuLyogdmltOiBzZXQgc3c9NCB0cz00IGV0IHR3PTgwIDogKi9cbiJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
      \ No newline at end of file
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRlZmluaXRpb24uanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7OztBQXdCQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7SUFLcUIsYUFDakIsU0FEaUIsVUFDakIsQ0FBWSxJQUFaLEVBQWtCLElBQWxCLEVBQXdCLElBQXhCLEVBQThCLE1BQTlCLEVBQXNDLEtBQXRDLEVBQTZDLElBQTdDLEVBQW1EO3dCQURsQyxZQUNrQzs7Ozs7QUFJL0MsT0FBSyxJQUFMLEdBQVksSUFBWjs7OztBQUorQyxNQVEvQyxDQUFLLElBQUwsR0FBWSxJQUFaOzs7O0FBUitDLE1BWS9DLENBQUssSUFBTCxHQUFZLElBQVo7Ozs7QUFaK0MsTUFnQi9DLENBQUssTUFBTCxHQUFjLE1BQWQ7Ozs7QUFoQitDLE1Bb0IvQyxDQUFLLEtBQUwsR0FBYSxLQUFiOzs7O0FBcEIrQyxNQXdCL0MsQ0FBSyxJQUFMLEdBQVksSUFBWixDQXhCK0M7Q0FBbkQ7Ozs7Ozs7a0JBRGlCOztJQWdDZjs7O0FBQ0YsV0FERSxtQkFDRixDQUFZLElBQVosRUFBa0IsSUFBbEIsRUFBd0IsS0FBeEIsRUFBK0IsSUFBL0IsRUFBcUM7MEJBRG5DLHFCQUNtQzs7Ozs7Ozt1RUFEbkMsZ0NBRVEsbUJBQVMsU0FBVCxFQUFvQixNQUFNLE1BQU0sTUFBTSxPQUFPLE9BRGxCOztBQU1qQyxVQUFLLElBQUwsR0FBWSxJQUFaLENBTmlDOztHQUFyQzs7U0FERTtFQUE0Qjs7UUFZOUI7UUFDQSIsImZpbGUiOiJkZWZpbml0aW9uLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLypcbiAgQ29weXJpZ2h0IChDKSAyMDE1IFl1c3VrZSBTdXp1a2kgPHV0YXRhbmUudGVhQGdtYWlsLmNvbT5cblxuICBSZWRpc3RyaWJ1dGlvbiBhbmQgdXNlIGluIHNvdXJjZSBhbmQgYmluYXJ5IGZvcm1zLCB3aXRoIG9yIHdpdGhvdXRcbiAgbW9kaWZpY2F0aW9uLCBhcmUgcGVybWl0dGVkIHByb3ZpZGVkIHRoYXQgdGhlIGZvbGxvd2luZyBjb25kaXRpb25zIGFyZSBtZXQ6XG5cbiAgICAqIFJlZGlzdHJpYnV0aW9ucyBvZiBzb3VyY2UgY29kZSBtdXN0IHJldGFpbiB0aGUgYWJvdmUgY29weXJpZ2h0XG4gICAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIuXG4gICAgKiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodFxuICAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyIGluIHRoZVxuICAgICAgZG9jdW1lbnRhdGlvbiBhbmQvb3Igb3RoZXIgbWF0ZXJpYWxzIHByb3ZpZGVkIHdpdGggdGhlIGRpc3RyaWJ1dGlvbi5cblxuICBUSElTIFNPRlRXQVJFIElTIFBST1ZJREVEIEJZIFRIRSBDT1BZUklHSFQgSE9MREVSUyBBTkQgQ09OVFJJQlVUT1JTIFwiQVMgSVNcIlxuICBBTkQgQU5ZIEVYUFJFU1MgT1IgSU1QTElFRCBXQVJSQU5USUVTLCBJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgVEhFXG4gIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFXG4gIEFSRSBESVNDTEFJTUVELiBJTiBOTyBFVkVOVCBTSEFMTCA8Q09QWVJJR0hUIEhPTERFUj4gQkUgTElBQkxFIEZPUiBBTllcbiAgRElSRUNULCBJTkRJUkVDVCwgSU5DSURFTlRBTCwgU1BFQ0lBTCwgRVhFTVBMQVJZLCBPUiBDT05TRVFVRU5USUFMIERBTUFHRVNcbiAgKElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTO1xuICBMT1NTIE9GIFVTRSwgREFUQSwgT1IgUFJPRklUUzsgT1IgQlVTSU5FU1MgSU5URVJSVVBUSU9OKSBIT1dFVkVSIENBVVNFRCBBTkRcbiAgT04gQU5ZIFRIRU9SWSBPRiBMSUFCSUxJVFksIFdIRVRIRVIgSU4gQ09OVFJBQ1QsIFNUUklDVCBMSUFCSUxJVFksIE9SIFRPUlRcbiAgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFIE9GXG4gIFRISVMgU09GVFdBUkUsIEVWRU4gSUYgQURWSVNFRCBPRiBUSEUgUE9TU0lCSUxJVFkgT0YgU1VDSCBEQU1BR0UuXG4qL1xuXG5pbXBvcnQgVmFyaWFibGUgZnJvbSAnLi92YXJpYWJsZSc7XG5cbi8qKlxuICogQGNsYXNzIERlZmluaXRpb25cbiAqL1xuZXhwb3J0IGRlZmF1bHQgY2xhc3MgRGVmaW5pdGlvbiB7XG4gICAgY29uc3RydWN0b3IodHlwZSwgbmFtZSwgbm9kZSwgcGFyZW50LCBpbmRleCwga2luZCkge1xuICAgICAgICAvKipcbiAgICAgICAgICogQG1lbWJlciB7U3RyaW5nfSBEZWZpbml0aW9uI3R5cGUgLSB0eXBlIG9mIHRoZSBvY2N1cnJlbmNlIChlLmcuIFwiUGFyYW1ldGVyXCIsIFwiVmFyaWFibGVcIiwgLi4uKS5cbiAgICAgICAgICovXG4gICAgICAgIHRoaXMudHlwZSA9IHR5cGU7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbWVtYmVyIHtlc3ByaW1hLklkZW50aWZpZXJ9IERlZmluaXRpb24jbmFtZSAtIHRoZSBpZGVudGlmaWVyIEFTVCBub2RlIG9mIHRoZSBvY2N1cnJlbmNlLlxuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5uYW1lID0gbmFtZTtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZW1iZXIge2VzcHJpbWEuTm9kZX0gRGVmaW5pdGlvbiNub2RlIC0gdGhlIGVuY2xvc2luZyBub2RlIG9mIHRoZSBpZGVudGlmaWVyLlxuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5ub2RlID0gbm9kZTtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZW1iZXIge2VzcHJpbWEuTm9kZT99IERlZmluaXRpb24jcGFyZW50IC0gdGhlIGVuY2xvc2luZyBzdGF0ZW1lbnQgbm9kZSBvZiB0aGUgaWRlbnRpZmllci5cbiAgICAgICAgICovXG4gICAgICAgIHRoaXMucGFyZW50ID0gcGFyZW50O1xuICAgICAgICAvKipcbiAgICAgICAgICogQG1lbWJlciB7TnVtYmVyP30gRGVmaW5pdGlvbiNpbmRleCAtIHRoZSBpbmRleCBpbiB0aGUgZGVjbGFyYXRpb24gc3RhdGVtZW50LlxuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5pbmRleCA9IGluZGV4O1xuICAgICAgICAvKipcbiAgICAgICAgICogQG1lbWJlciB7U3RyaW5nP30gRGVmaW5pdGlvbiNraW5kIC0gdGhlIGtpbmQgb2YgdGhlIGRlY2xhcmF0aW9uIHN0YXRlbWVudC5cbiAgICAgICAgICovXG4gICAgICAgIHRoaXMua2luZCA9IGtpbmQ7XG4gICAgfVxufVxuXG4vKipcbiAqIEBjbGFzcyBQYXJhbWV0ZXJEZWZpbml0aW9uXG4gKi9cbmNsYXNzIFBhcmFtZXRlckRlZmluaXRpb24gZXh0ZW5kcyBEZWZpbml0aW9uIHtcbiAgICBjb25zdHJ1Y3RvcihuYW1lLCBub2RlLCBpbmRleCwgcmVzdCkge1xuICAgICAgICBzdXBlcihWYXJpYWJsZS5QYXJhbWV0ZXIsIG5hbWUsIG5vZGUsIG51bGwsIGluZGV4LCBudWxsKTtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIFdoZXRoZXIgdGhlIHBhcmFtZXRlciBkZWZpbml0aW9uIGlzIGEgcGFydCBvZiBhIHJlc3QgcGFyYW1ldGVyLlxuICAgICAgICAgKiBAbWVtYmVyIHtib29sZWFufSBQYXJhbWV0ZXJEZWZpbml0aW9uI3Jlc3RcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMucmVzdCA9IHJlc3Q7XG4gICAgfVxufVxuXG5leHBvcnQge1xuICAgIFBhcmFtZXRlckRlZmluaXRpb24sXG4gICAgRGVmaW5pdGlvblxufVxuXG4vKiB2aW06IHNldCBzdz00IHRzPTQgZXQgdHc9ODAgOiAqL1xuIl0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9
      diff --git a/tools/eslint/node_modules/escope/lib/index.js b/tools/eslint/node_modules/escope/lib/index.js
      index 58964e061b8c19..59cfcb172375cd 100644
      --- a/tools/eslint/node_modules/escope/lib/index.js
      +++ b/tools/eslint/node_modules/escope/lib/index.js
      @@ -1,52 +1,35 @@
      -"use strict";
      +'use strict';
       
      -var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
      -
      -/**
      - * Main interface function. Takes an Esprima syntax tree and returns the
      - * analyzed scopes.
      - * @function analyze
      - * @param {esprima.Tree} tree
      - * @param {Object} providedOptions - Options that tailor the scope analysis
      - * @param {boolean} [providedOptions.optimistic=false] - the optimistic flag
      - * @param {boolean} [providedOptions.directive=false]- the directive flag
      - * @param {boolean} [providedOptions.ignoreEval=false]- whether to check 'eval()' calls
      - * @param {boolean} [providedOptions.nodejsScope=false]- whether the whole
      - * script is executed under node.js environment. When enabled, escope adds
      - * a function scope immediately following the global scope.
      - * @param {string} [providedOptions.sourceType='script']- the source type of the script. one of 'script' and 'module'
      - * @param {number} [providedOptions.ecmaVersion=5]- which ECMAScript version is considered
      - * @return {ScopeManager}
      - */
      -exports.analyze = analyze;
       Object.defineProperty(exports, "__esModule", {
           value: true
       });
      -/*
      -  Copyright (C) 2012-2014 Yusuke Suzuki 
      -  Copyright (C) 2013 Alex Seville 
      -  Copyright (C) 2014 Thiago de Arruda 
      -
      -  Redistribution and use in source and binary forms, with or without
      -  modification, are permitted provided that the following conditions are met:
      -
      -    * Redistributions of source code must retain the above copyright
      -      notice, this list of conditions and the following disclaimer.
      -    * Redistributions in binary form must reproduce the above copyright
      -      notice, this list of conditions and the following disclaimer in the
      -      documentation and/or other materials provided with the distribution.
      -
      -  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
      -  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      -  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      -  ARE DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
      -  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
      -  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
      -  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      -  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      -  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
      -  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      -*/
      +exports.ScopeManager = exports.Scope = exports.Variable = exports.Reference = exports.version = undefined;
      +
      +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; /*
      +                                                                                                                                                                                                                                                    Copyright (C) 2012-2014 Yusuke Suzuki 
      +                                                                                                                                                                                                                                                    Copyright (C) 2013 Alex Seville 
      +                                                                                                                                                                                                                                                    Copyright (C) 2014 Thiago de Arruda 
      +
      +                                                                                                                                                                                                                                                    Redistribution and use in source and binary forms, with or without
      +                                                                                                                                                                                                                                                    modification, are permitted provided that the following conditions are met:
      +
      +                                                                                                                                                                                                                                                      * Redistributions of source code must retain the above copyright
      +                                                                                                                                                                                                                                                        notice, this list of conditions and the following disclaimer.
      +                                                                                                                                                                                                                                                      * Redistributions in binary form must reproduce the above copyright
      +                                                                                                                                                                                                                                                        notice, this list of conditions and the following disclaimer in the
      +                                                                                                                                                                                                                                                        documentation and/or other materials provided with the distribution.
      +
      +                                                                                                                                                                                                                                                    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
      +                                                                                                                                                                                                                                                    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      +                                                                                                                                                                                                                                                    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      +                                                                                                                                                                                                                                                    ARE DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
      +                                                                                                                                                                                                                                                    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
      +                                                                                                                                                                                                                                                    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
      +                                                                                                                                                                                                                                                    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      +                                                                                                                                                                                                                                                    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      +                                                                                                                                                                                                                                                    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
      +                                                                                                                                                                                                                                                    THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      +                                                                                                                                                                                                                                                  */
       
       /**
        * Escope (escope) is an = 5).
      + * @param {string} [providedOptions.sourceType='script']- the source type of the script. one of 'script' and 'module'
      + * @param {number} [providedOptions.ecmaVersion=5]- which ECMAScript version is considered
      + * @param {Object} [providedOptions.childVisitorKeys=null] - Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option.
      + * @param {string} [providedOptions.fallback='iteration'] - A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option.
      + * @return {ScopeManager}
      + */
       function analyze(tree, providedOptions) {
           var scopeManager, referencer, options;
       
           options = updateDeeply(defaultOptions(), providedOptions);
       
      -    scopeManager = new ScopeManager(options);
      +    scopeManager = new _scopeManager2.default(options);
       
      -    referencer = new Referencer(scopeManager);
      +    referencer = new _referencer2.default(options, scopeManager);
           referencer.visit(tree);
       
      -    assert(scopeManager.__currentScope === null, "currentScope should be null.");
      +    (0, _assert2.default)(scopeManager.__currentScope === null, 'currentScope should be null.');
       
           return scopeManager;
       }
       
      -exports.version = version;
      -
      -/* vim: set sw=4 ts=4 et tw=80 : */
      -exports.Reference = Reference;
      -exports.Variable = Variable;
      -exports.Scope = Scope;
      -exports.ScopeManager = ScopeManager;
      -
      +exports.
       /** @name module:escope.version */
      -
      +version = _package.version;
      +exports.
       /** @name module:escope.Reference */
      -
      +Reference = _reference2.default;
      +exports.
       /** @name module:escope.Variable */
      -
      +Variable = _variable2.default;
      +exports.
       /** @name module:escope.Scope */
      -
      +Scope = _scope2.default;
      +exports.
       /** @name module:escope.ScopeManager */
      -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O1FBNkdnQixPQUFPLEdBQVAsT0FBTzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0lBM0RoQixNQUFNLDJCQUFNLFFBQVE7O0lBRXBCLFlBQVksMkJBQU0saUJBQWlCOztJQUNuQyxVQUFVLDJCQUFNLGNBQWM7O0lBQzlCLFNBQVMsMkJBQU0sYUFBYTs7SUFDNUIsUUFBUSwyQkFBTSxZQUFZOztJQUMxQixLQUFLLDJCQUFNLFNBQVM7O0lBQ2xCLE9BQU8sV0FBUSxpQkFBaUIsRUFBaEMsT0FBTzs7QUFFaEIsU0FBUyxjQUFjLEdBQUc7QUFDdEIsV0FBTztBQUNILGtCQUFVLEVBQUUsS0FBSztBQUNqQixpQkFBUyxFQUFFLEtBQUs7QUFDaEIsbUJBQVcsRUFBRSxLQUFLO0FBQ2xCLGtCQUFVLEVBQUUsUUFBUTtBQUNwQixtQkFBVyxFQUFFLENBQUM7S0FDakIsQ0FBQztDQUNMOztBQUVELFNBQVMsWUFBWSxDQUFDLE1BQU0sRUFBRSxRQUFRLEVBQUU7QUFDcEMsUUFBSSxHQUFHLEVBQUUsR0FBRyxDQUFDOztBQUViLGFBQVMsWUFBWSxDQUFDLE1BQU0sRUFBRTtBQUMxQixlQUFPLE9BQU8sTUFBTSxLQUFLLFFBQVEsSUFBSSxNQUFNLFlBQVksTUFBTSxJQUFJLEVBQUUsTUFBTSxZQUFZLE1BQU0sQ0FBQSxBQUFDLENBQUM7S0FDaEc7O0FBRUQsU0FBSyxHQUFHLElBQUksUUFBUSxFQUFFO0FBQ2xCLFlBQUksUUFBUSxDQUFDLGNBQWMsQ0FBQyxHQUFHLENBQUMsRUFBRTtBQUM5QixlQUFHLEdBQUcsUUFBUSxDQUFDLEdBQUcsQ0FBQyxDQUFDO0FBQ3BCLGdCQUFJLFlBQVksQ0FBQyxHQUFHLENBQUMsRUFBRTtBQUNuQixvQkFBSSxZQUFZLENBQUMsTUFBTSxDQUFDLEdBQUcsQ0FBQyxDQUFDLEVBQUU7QUFDM0IsZ0NBQVksQ0FBQyxNQUFNLENBQUMsR0FBRyxDQUFDLEVBQUUsR0FBRyxDQUFDLENBQUM7aUJBQ2xDLE1BQU07QUFDSCwwQkFBTSxDQUFDLEdBQUcsQ0FBQyxHQUFHLFlBQVksQ0FBQyxFQUFFLEVBQUUsR0FBRyxDQUFDLENBQUM7aUJBQ3ZDO2FBQ0osTUFBTTtBQUNILHNCQUFNLENBQUMsR0FBRyxDQUFDLEdBQUcsR0FBRyxDQUFDO2FBQ3JCO1NBQ0o7S0FDSjtBQUNELFdBQU8sTUFBTSxDQUFDO0NBQ2pCO0FBa0JNLFNBQVMsT0FBTyxDQUFDLElBQUksRUFBRSxlQUFlLEVBQUU7QUFDM0MsUUFBSSxZQUFZLEVBQUUsVUFBVSxFQUFFLE9BQU8sQ0FBQzs7QUFFdEMsV0FBTyxHQUFHLFlBQVksQ0FBQyxjQUFjLEVBQUUsRUFBRSxlQUFlLENBQUMsQ0FBQzs7QUFFMUQsZ0JBQVksR0FBRyxJQUFJLFlBQVksQ0FBQyxPQUFPLENBQUMsQ0FBQzs7QUFFekMsY0FBVSxHQUFHLElBQUksVUFBVSxDQUFDLFlBQVksQ0FBQyxDQUFDO0FBQzFDLGNBQVUsQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLENBQUM7O0FBRXZCLFVBQU0sQ0FBQyxZQUFZLENBQUMsY0FBYyxLQUFLLElBQUksRUFBRSw4QkFBOEIsQ0FBQyxDQUFDOztBQUU3RSxXQUFPLFlBQVksQ0FBQztDQUN2Qjs7UUFJRyxPQUFPLEdBQVAsT0FBTzs7O1FBRVAsU0FBUyxHQUFULFNBQVM7UUFFVCxRQUFRLEdBQVIsUUFBUTtRQUVSLEtBQUssR0FBTCxLQUFLO1FBRUwsWUFBWSxHQUFaLFlBQVkiLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKlxuICBDb3B5cmlnaHQgKEMpIDIwMTItMjAxNCBZdXN1a2UgU3V6dWtpIDx1dGF0YW5lLnRlYUBnbWFpbC5jb20+XG4gIENvcHlyaWdodCAoQykgMjAxMyBBbGV4IFNldmlsbGUgPGhpQGFsZXhhbmRlcnNldmlsbGUuY29tPlxuICBDb3B5cmlnaHQgKEMpIDIwMTQgVGhpYWdvIGRlIEFycnVkYSA8dHBhZGlsaGE4NEBnbWFpbC5jb20+XG5cbiAgUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0XG4gIG1vZGlmaWNhdGlvbiwgYXJlIHBlcm1pdHRlZCBwcm92aWRlZCB0aGF0IHRoZSBmb2xsb3dpbmcgY29uZGl0aW9ucyBhcmUgbWV0OlxuXG4gICAgKiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodFxuICAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyLlxuICAgICogUmVkaXN0cmlidXRpb25zIGluIGJpbmFyeSBmb3JtIG11c3QgcmVwcm9kdWNlIHRoZSBhYm92ZSBjb3B5cmlnaHRcbiAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lciBpbiB0aGVcbiAgICAgIGRvY3VtZW50YXRpb24gYW5kL29yIG90aGVyIG1hdGVyaWFscyBwcm92aWRlZCB3aXRoIHRoZSBkaXN0cmlidXRpb24uXG5cbiAgVEhJUyBTT0ZUV0FSRSBJUyBQUk9WSURFRCBCWSBUSEUgQ09QWVJJR0hUIEhPTERFUlMgQU5EIENPTlRSSUJVVE9SUyBcIkFTIElTXCJcbiAgQU5EIEFOWSBFWFBSRVNTIE9SIElNUExJRUQgV0FSUkFOVElFUywgSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFRIRVxuICBJTVBMSUVEIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZIEFORCBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRVxuICBBUkUgRElTQ0xBSU1FRC4gSU4gTk8gRVZFTlQgU0hBTEwgPENPUFlSSUdIVCBIT0xERVI+IEJFIExJQUJMRSBGT1IgQU5ZXG4gIERJUkVDVCwgSU5ESVJFQ1QsIElOQ0lERU5UQUwsIFNQRUNJQUwsIEVYRU1QTEFSWSwgT1IgQ09OU0VRVUVOVElBTCBEQU1BR0VTXG4gIChJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgUFJPQ1VSRU1FTlQgT0YgU1VCU1RJVFVURSBHT09EUyBPUiBTRVJWSUNFUztcbiAgTE9TUyBPRiBVU0UsIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EXG4gIE9OIEFOWSBUSEVPUlkgT0YgTElBQklMSVRZLCBXSEVUSEVSIElOIENPTlRSQUNULCBTVFJJQ1QgTElBQklMSVRZLCBPUiBUT1JUXG4gIChJTkNMVURJTkcgTkVHTElHRU5DRSBPUiBPVEhFUldJU0UpIEFSSVNJTkcgSU4gQU5ZIFdBWSBPVVQgT0YgVEhFIFVTRSBPRlxuICBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLlxuKi9cblxuLyoqXG4gKiBFc2NvcGUgKDxhIGhyZWY9XCJodHRwOi8vZ2l0aHViLmNvbS9lc3Rvb2xzL2VzY29wZVwiPmVzY29wZTwvYT4pIGlzIGFuIDxhXG4gKiBocmVmPVwiaHR0cDovL3d3dy5lY21hLWludGVybmF0aW9uYWwub3JnL3B1YmxpY2F0aW9ucy9zdGFuZGFyZHMvRWNtYS0yNjIuaHRtXCI+RUNNQVNjcmlwdDwvYT5cbiAqIHNjb3BlIGFuYWx5emVyIGV4dHJhY3RlZCBmcm9tIHRoZSA8YVxuICogaHJlZj1cImh0dHA6Ly9naXRodWIuY29tL2VzdG9vbHMvZXNtYW5nbGVcIj5lc21hbmdsZSBwcm9qZWN0PC9hLz4uXG4gKiA8cD5cbiAqIDxlbT5lc2NvcGU8L2VtPiBmaW5kcyBsZXhpY2FsIHNjb3BlcyBpbiBhIHNvdXJjZSBwcm9ncmFtLCBpLmUuIGFyZWFzIG9mIHRoYXRcbiAqIHByb2dyYW0gd2hlcmUgZGlmZmVyZW50IG9jY3VycmVuY2VzIG9mIHRoZSBzYW1lIGlkZW50aWZpZXIgcmVmZXIgdG8gdGhlIHNhbWVcbiAqIHZhcmlhYmxlLiBXaXRoIGVhY2ggc2NvcGUgdGhlIGNvbnRhaW5lZCB2YXJpYWJsZXMgYXJlIGNvbGxlY3RlZCwgYW5kIGVhY2hcbiAqIGlkZW50aWZpZXIgcmVmZXJlbmNlIGluIGNvZGUgaXMgbGlua2VkIHRvIGl0cyBjb3JyZXNwb25kaW5nIHZhcmlhYmxlIChpZlxuICogcG9zc2libGUpLlxuICogPHA+XG4gKiA8ZW0+ZXNjb3BlPC9lbT4gd29ya3Mgb24gYSBzeW50YXggdHJlZSBvZiB0aGUgcGFyc2VkIHNvdXJjZSBjb2RlIHdoaWNoIGhhc1xuICogdG8gYWRoZXJlIHRvIHRoZSA8YVxuICogaHJlZj1cImh0dHBzOi8vZGV2ZWxvcGVyLm1vemlsbGEub3JnL2VuLVVTL2RvY3MvU3BpZGVyTW9ua2V5L1BhcnNlcl9BUElcIj5cbiAqIE1vemlsbGEgUGFyc2VyIEFQSTwvYT4uIEUuZy4gPGEgaHJlZj1cImh0dHA6Ly9lc3ByaW1hLm9yZ1wiPmVzcHJpbWE8L2E+IGlzIGEgcGFyc2VyXG4gKiB0aGF0IHByb2R1Y2VzIHN1Y2ggc3ludGF4IHRyZWVzLlxuICogPHA+XG4gKiBUaGUgbWFpbiBpbnRlcmZhY2UgaXMgdGhlIHtAbGluayBhbmFseXplfSBmdW5jdGlvbi5cbiAqIEBtb2R1bGUgZXNjb3BlXG4gKi9cblxuLypqc2xpbnQgYml0d2lzZTp0cnVlICovXG5cbmltcG9ydCBhc3NlcnQgZnJvbSAnYXNzZXJ0JztcblxuaW1wb3J0IFNjb3BlTWFuYWdlciBmcm9tICcuL3Njb3BlLW1hbmFnZXInO1xuaW1wb3J0IFJlZmVyZW5jZXIgZnJvbSAnLi9yZWZlcmVuY2VyJztcbmltcG9ydCBSZWZlcmVuY2UgZnJvbSAnLi9yZWZlcmVuY2UnO1xuaW1wb3J0IFZhcmlhYmxlIGZyb20gJy4vdmFyaWFibGUnO1xuaW1wb3J0IFNjb3BlIGZyb20gJy4vc2NvcGUnO1xuaW1wb3J0IHsgdmVyc2lvbiB9IGZyb20gJy4uL3BhY2thZ2UuanNvbic7XG5cbmZ1bmN0aW9uIGRlZmF1bHRPcHRpb25zKCkge1xuICAgIHJldHVybiB7XG4gICAgICAgIG9wdGltaXN0aWM6IGZhbHNlLFxuICAgICAgICBkaXJlY3RpdmU6IGZhbHNlLFxuICAgICAgICBub2RlanNTY29wZTogZmFsc2UsXG4gICAgICAgIHNvdXJjZVR5cGU6ICdzY3JpcHQnLCAgLy8gb25lIG9mIFsnc2NyaXB0JywgJ21vZHVsZSddXG4gICAgICAgIGVjbWFWZXJzaW9uOiA1XG4gICAgfTtcbn1cblxuZnVuY3Rpb24gdXBkYXRlRGVlcGx5KHRhcmdldCwgb3ZlcnJpZGUpIHtcbiAgICB2YXIga2V5LCB2YWw7XG5cbiAgICBmdW5jdGlvbiBpc0hhc2hPYmplY3QodGFyZ2V0KSB7XG4gICAgICAgIHJldHVybiB0eXBlb2YgdGFyZ2V0ID09PSAnb2JqZWN0JyAmJiB0YXJnZXQgaW5zdGFuY2VvZiBPYmplY3QgJiYgISh0YXJnZXQgaW5zdGFuY2VvZiBSZWdFeHApO1xuICAgIH1cblxuICAgIGZvciAoa2V5IGluIG92ZXJyaWRlKSB7XG4gICAgICAgIGlmIChvdmVycmlkZS5oYXNPd25Qcm9wZXJ0eShrZXkpKSB7XG4gICAgICAgICAgICB2YWwgPSBvdmVycmlkZVtrZXldO1xuICAgICAgICAgICAgaWYgKGlzSGFzaE9iamVjdCh2YWwpKSB7XG4gICAgICAgICAgICAgICAgaWYgKGlzSGFzaE9iamVjdCh0YXJnZXRba2V5XSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlRGVlcGx5KHRhcmdldFtrZXldLCB2YWwpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRhcmdldFtrZXldID0gdXBkYXRlRGVlcGx5KHt9LCB2YWwpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGFyZ2V0W2tleV0gPSB2YWw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG4gICAgcmV0dXJuIHRhcmdldDtcbn1cblxuLyoqXG4gKiBNYWluIGludGVyZmFjZSBmdW5jdGlvbi4gVGFrZXMgYW4gRXNwcmltYSBzeW50YXggdHJlZSBhbmQgcmV0dXJucyB0aGVcbiAqIGFuYWx5emVkIHNjb3Blcy5cbiAqIEBmdW5jdGlvbiBhbmFseXplXG4gKiBAcGFyYW0ge2VzcHJpbWEuVHJlZX0gdHJlZVxuICogQHBhcmFtIHtPYmplY3R9IHByb3ZpZGVkT3B0aW9ucyAtIE9wdGlvbnMgdGhhdCB0YWlsb3IgdGhlIHNjb3BlIGFuYWx5c2lzXG4gKiBAcGFyYW0ge2Jvb2xlYW59IFtwcm92aWRlZE9wdGlvbnMub3B0aW1pc3RpYz1mYWxzZV0gLSB0aGUgb3B0aW1pc3RpYyBmbGFnXG4gKiBAcGFyYW0ge2Jvb2xlYW59IFtwcm92aWRlZE9wdGlvbnMuZGlyZWN0aXZlPWZhbHNlXS0gdGhlIGRpcmVjdGl2ZSBmbGFnXG4gKiBAcGFyYW0ge2Jvb2xlYW59IFtwcm92aWRlZE9wdGlvbnMuaWdub3JlRXZhbD1mYWxzZV0tIHdoZXRoZXIgdG8gY2hlY2sgJ2V2YWwoKScgY2FsbHNcbiAqIEBwYXJhbSB7Ym9vbGVhbn0gW3Byb3ZpZGVkT3B0aW9ucy5ub2RlanNTY29wZT1mYWxzZV0tIHdoZXRoZXIgdGhlIHdob2xlXG4gKiBzY3JpcHQgaXMgZXhlY3V0ZWQgdW5kZXIgbm9kZS5qcyBlbnZpcm9ubWVudC4gV2hlbiBlbmFibGVkLCBlc2NvcGUgYWRkc1xuICogYSBmdW5jdGlvbiBzY29wZSBpbW1lZGlhdGVseSBmb2xsb3dpbmcgdGhlIGdsb2JhbCBzY29wZS5cbiAqIEBwYXJhbSB7c3RyaW5nfSBbcHJvdmlkZWRPcHRpb25zLnNvdXJjZVR5cGU9J3NjcmlwdCddLSB0aGUgc291cmNlIHR5cGUgb2YgdGhlIHNjcmlwdC4gb25lIG9mICdzY3JpcHQnIGFuZCAnbW9kdWxlJ1xuICogQHBhcmFtIHtudW1iZXJ9IFtwcm92aWRlZE9wdGlvbnMuZWNtYVZlcnNpb249NV0tIHdoaWNoIEVDTUFTY3JpcHQgdmVyc2lvbiBpcyBjb25zaWRlcmVkXG4gKiBAcmV0dXJuIHtTY29wZU1hbmFnZXJ9XG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBhbmFseXplKHRyZWUsIHByb3ZpZGVkT3B0aW9ucykge1xuICAgIHZhciBzY29wZU1hbmFnZXIsIHJlZmVyZW5jZXIsIG9wdGlvbnM7XG5cbiAgICBvcHRpb25zID0gdXBkYXRlRGVlcGx5KGRlZmF1bHRPcHRpb25zKCksIHByb3ZpZGVkT3B0aW9ucyk7XG5cbiAgICBzY29wZU1hbmFnZXIgPSBuZXcgU2NvcGVNYW5hZ2VyKG9wdGlvbnMpO1xuXG4gICAgcmVmZXJlbmNlciA9IG5ldyBSZWZlcmVuY2VyKHNjb3BlTWFuYWdlcik7XG4gICAgcmVmZXJlbmNlci52aXNpdCh0cmVlKTtcblxuICAgIGFzc2VydChzY29wZU1hbmFnZXIuX19jdXJyZW50U2NvcGUgPT09IG51bGwsICdjdXJyZW50U2NvcGUgc2hvdWxkIGJlIG51bGwuJyk7XG5cbiAgICByZXR1cm4gc2NvcGVNYW5hZ2VyO1xufVxuXG5leHBvcnQge1xuICAgIC8qKiBAbmFtZSBtb2R1bGU6ZXNjb3BlLnZlcnNpb24gKi9cbiAgICB2ZXJzaW9uLFxuICAgIC8qKiBAbmFtZSBtb2R1bGU6ZXNjb3BlLlJlZmVyZW5jZSAqL1xuICAgIFJlZmVyZW5jZSxcbiAgICAvKiogQG5hbWUgbW9kdWxlOmVzY29wZS5WYXJpYWJsZSAqL1xuICAgIFZhcmlhYmxlLFxuICAgIC8qKiBAbmFtZSBtb2R1bGU6ZXNjb3BlLlNjb3BlICovXG4gICAgU2NvcGUsXG4gICAgLyoqIEBuYW1lIG1vZHVsZTplc2NvcGUuU2NvcGVNYW5hZ2VyICovXG4gICAgU2NvcGVNYW5hZ2VyXG59O1xuXG5cbi8qIHZpbTogc2V0IHN3PTQgdHM9NCBldCB0dz04MCA6ICovXG4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
      \ No newline at end of file
      +ScopeManager = _scopeManager2.default;
      +
      +/* vim: set sw=4 ts=4 et tw=80 : */
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztRQW9IZ0I7O0FBbEVoQjs7OztBQUVBOzs7O0FBQ0E7Ozs7QUFDQTs7OztBQUNBOzs7O0FBQ0E7Ozs7QUFDQTs7OztBQUVBLFNBQVMsY0FBVCxHQUEwQjtBQUN0QixXQUFPO0FBQ0gsb0JBQVksS0FBWjtBQUNBLG1CQUFXLEtBQVg7QUFDQSxxQkFBYSxLQUFiO0FBQ0EsdUJBQWUsS0FBZjtBQUNBLG9CQUFZLFFBQVo7QUFDQSxxQkFBYSxDQUFiO0FBQ0EsMEJBQWtCLElBQWxCO0FBQ0Esa0JBQVUsV0FBVjtLQVJKLENBRHNCO0NBQTFCOztBQWFBLFNBQVMsWUFBVCxDQUFzQixNQUF0QixFQUE4QixRQUE5QixFQUF3QztBQUNwQyxRQUFJLEdBQUosRUFBUyxHQUFULENBRG9DOztBQUdwQyxhQUFTLFlBQVQsQ0FBc0IsTUFBdEIsRUFBOEI7QUFDMUIsZUFBTyxRQUFPLHVEQUFQLEtBQWtCLFFBQWxCLElBQThCLGtCQUFrQixNQUFsQixJQUE0QixFQUFFLGtCQUFrQixLQUFsQixDQUFGLElBQThCLEVBQUUsa0JBQWtCLE1BQWxCLENBQUYsQ0FEckU7S0FBOUI7O0FBSUEsU0FBSyxHQUFMLElBQVksUUFBWixFQUFzQjtBQUNsQixZQUFJLFNBQVMsY0FBVCxDQUF3QixHQUF4QixDQUFKLEVBQWtDO0FBQzlCLGtCQUFNLFNBQVMsR0FBVCxDQUFOLENBRDhCO0FBRTlCLGdCQUFJLGFBQWEsR0FBYixDQUFKLEVBQXVCO0FBQ25CLG9CQUFJLGFBQWEsT0FBTyxHQUFQLENBQWIsQ0FBSixFQUErQjtBQUMzQixpQ0FBYSxPQUFPLEdBQVAsQ0FBYixFQUEwQixHQUExQixFQUQyQjtpQkFBL0IsTUFFTztBQUNILDJCQUFPLEdBQVAsSUFBYyxhQUFhLEVBQWIsRUFBaUIsR0FBakIsQ0FBZCxDQURHO2lCQUZQO2FBREosTUFNTztBQUNILHVCQUFPLEdBQVAsSUFBYyxHQUFkLENBREc7YUFOUDtTQUZKO0tBREo7QUFjQSxXQUFPLE1BQVAsQ0FyQm9DO0NBQXhDOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBNENPLFNBQVMsT0FBVCxDQUFpQixJQUFqQixFQUF1QixlQUF2QixFQUF3QztBQUMzQyxRQUFJLFlBQUosRUFBa0IsVUFBbEIsRUFBOEIsT0FBOUIsQ0FEMkM7O0FBRzNDLGNBQVUsYUFBYSxnQkFBYixFQUErQixlQUEvQixDQUFWLENBSDJDOztBQUszQyxtQkFBZSwyQkFBaUIsT0FBakIsQ0FBZixDQUwyQzs7QUFPM0MsaUJBQWEseUJBQWUsT0FBZixFQUF3QixZQUF4QixDQUFiLENBUDJDO0FBUTNDLGVBQVcsS0FBWCxDQUFpQixJQUFqQixFQVIyQzs7QUFVM0MsMEJBQU8sYUFBYSxjQUFiLEtBQWdDLElBQWhDLEVBQXNDLDhCQUE3QyxFQVYyQzs7QUFZM0MsV0FBTyxZQUFQLENBWjJDO0NBQXhDOzs7O0FBaUJIOzs7QUFFQTs7O0FBRUE7OztBQUVBOzs7QUFFQSIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gIENvcHlyaWdodCAoQykgMjAxMi0yMDE0IFl1c3VrZSBTdXp1a2kgPHV0YXRhbmUudGVhQGdtYWlsLmNvbT5cbiAgQ29weXJpZ2h0IChDKSAyMDEzIEFsZXggU2V2aWxsZSA8aGlAYWxleGFuZGVyc2V2aWxsZS5jb20+XG4gIENvcHlyaWdodCAoQykgMjAxNCBUaGlhZ28gZGUgQXJydWRhIDx0cGFkaWxoYTg0QGdtYWlsLmNvbT5cblxuICBSZWRpc3RyaWJ1dGlvbiBhbmQgdXNlIGluIHNvdXJjZSBhbmQgYmluYXJ5IGZvcm1zLCB3aXRoIG9yIHdpdGhvdXRcbiAgbW9kaWZpY2F0aW9uLCBhcmUgcGVybWl0dGVkIHByb3ZpZGVkIHRoYXQgdGhlIGZvbGxvd2luZyBjb25kaXRpb25zIGFyZSBtZXQ6XG5cbiAgICAqIFJlZGlzdHJpYnV0aW9ucyBvZiBzb3VyY2UgY29kZSBtdXN0IHJldGFpbiB0aGUgYWJvdmUgY29weXJpZ2h0XG4gICAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIuXG4gICAgKiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodFxuICAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyIGluIHRoZVxuICAgICAgZG9jdW1lbnRhdGlvbiBhbmQvb3Igb3RoZXIgbWF0ZXJpYWxzIHByb3ZpZGVkIHdpdGggdGhlIGRpc3RyaWJ1dGlvbi5cblxuICBUSElTIFNPRlRXQVJFIElTIFBST1ZJREVEIEJZIFRIRSBDT1BZUklHSFQgSE9MREVSUyBBTkQgQ09OVFJJQlVUT1JTIFwiQVMgSVNcIlxuICBBTkQgQU5ZIEVYUFJFU1MgT1IgSU1QTElFRCBXQVJSQU5USUVTLCBJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgVEhFXG4gIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFXG4gIEFSRSBESVNDTEFJTUVELiBJTiBOTyBFVkVOVCBTSEFMTCA8Q09QWVJJR0hUIEhPTERFUj4gQkUgTElBQkxFIEZPUiBBTllcbiAgRElSRUNULCBJTkRJUkVDVCwgSU5DSURFTlRBTCwgU1BFQ0lBTCwgRVhFTVBMQVJZLCBPUiBDT05TRVFVRU5USUFMIERBTUFHRVNcbiAgKElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTO1xuICBMT1NTIE9GIFVTRSwgREFUQSwgT1IgUFJPRklUUzsgT1IgQlVTSU5FU1MgSU5URVJSVVBUSU9OKSBIT1dFVkVSIENBVVNFRCBBTkRcbiAgT04gQU5ZIFRIRU9SWSBPRiBMSUFCSUxJVFksIFdIRVRIRVIgSU4gQ09OVFJBQ1QsIFNUUklDVCBMSUFCSUxJVFksIE9SIFRPUlRcbiAgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFIE9GXG4gIFRISVMgU09GVFdBUkUsIEVWRU4gSUYgQURWSVNFRCBPRiBUSEUgUE9TU0lCSUxJVFkgT0YgU1VDSCBEQU1BR0UuXG4qL1xuXG4vKipcbiAqIEVzY29wZSAoPGEgaHJlZj1cImh0dHA6Ly9naXRodWIuY29tL2VzdG9vbHMvZXNjb3BlXCI+ZXNjb3BlPC9hPikgaXMgYW4gPGFcbiAqIGhyZWY9XCJodHRwOi8vd3d3LmVjbWEtaW50ZXJuYXRpb25hbC5vcmcvcHVibGljYXRpb25zL3N0YW5kYXJkcy9FY21hLTI2Mi5odG1cIj5FQ01BU2NyaXB0PC9hPlxuICogc2NvcGUgYW5hbHl6ZXIgZXh0cmFjdGVkIGZyb20gdGhlIDxhXG4gKiBocmVmPVwiaHR0cDovL2dpdGh1Yi5jb20vZXN0b29scy9lc21hbmdsZVwiPmVzbWFuZ2xlIHByb2plY3Q8L2EvPi5cbiAqIDxwPlxuICogPGVtPmVzY29wZTwvZW0+IGZpbmRzIGxleGljYWwgc2NvcGVzIGluIGEgc291cmNlIHByb2dyYW0sIGkuZS4gYXJlYXMgb2YgdGhhdFxuICogcHJvZ3JhbSB3aGVyZSBkaWZmZXJlbnQgb2NjdXJyZW5jZXMgb2YgdGhlIHNhbWUgaWRlbnRpZmllciByZWZlciB0byB0aGUgc2FtZVxuICogdmFyaWFibGUuIFdpdGggZWFjaCBzY29wZSB0aGUgY29udGFpbmVkIHZhcmlhYmxlcyBhcmUgY29sbGVjdGVkLCBhbmQgZWFjaFxuICogaWRlbnRpZmllciByZWZlcmVuY2UgaW4gY29kZSBpcyBsaW5rZWQgdG8gaXRzIGNvcnJlc3BvbmRpbmcgdmFyaWFibGUgKGlmXG4gKiBwb3NzaWJsZSkuXG4gKiA8cD5cbiAqIDxlbT5lc2NvcGU8L2VtPiB3b3JrcyBvbiBhIHN5bnRheCB0cmVlIG9mIHRoZSBwYXJzZWQgc291cmNlIGNvZGUgd2hpY2ggaGFzXG4gKiB0byBhZGhlcmUgdG8gdGhlIDxhXG4gKiBocmVmPVwiaHR0cHM6Ly9kZXZlbG9wZXIubW96aWxsYS5vcmcvZW4tVVMvZG9jcy9TcGlkZXJNb25rZXkvUGFyc2VyX0FQSVwiPlxuICogTW96aWxsYSBQYXJzZXIgQVBJPC9hPi4gRS5nLiA8YSBocmVmPVwiaHR0cDovL2VzcHJpbWEub3JnXCI+ZXNwcmltYTwvYT4gaXMgYSBwYXJzZXJcbiAqIHRoYXQgcHJvZHVjZXMgc3VjaCBzeW50YXggdHJlZXMuXG4gKiA8cD5cbiAqIFRoZSBtYWluIGludGVyZmFjZSBpcyB0aGUge0BsaW5rIGFuYWx5emV9IGZ1bmN0aW9uLlxuICogQG1vZHVsZSBlc2NvcGVcbiAqL1xuXG4vKmpzbGludCBiaXR3aXNlOnRydWUgKi9cblxuaW1wb3J0IGFzc2VydCBmcm9tICdhc3NlcnQnO1xuXG5pbXBvcnQgU2NvcGVNYW5hZ2VyIGZyb20gJy4vc2NvcGUtbWFuYWdlcic7XG5pbXBvcnQgUmVmZXJlbmNlciBmcm9tICcuL3JlZmVyZW5jZXInO1xuaW1wb3J0IFJlZmVyZW5jZSBmcm9tICcuL3JlZmVyZW5jZSc7XG5pbXBvcnQgVmFyaWFibGUgZnJvbSAnLi92YXJpYWJsZSc7XG5pbXBvcnQgU2NvcGUgZnJvbSAnLi9zY29wZSc7XG5pbXBvcnQgeyB2ZXJzaW9uIH0gZnJvbSAnLi4vcGFja2FnZS5qc29uJztcblxuZnVuY3Rpb24gZGVmYXVsdE9wdGlvbnMoKSB7XG4gICAgcmV0dXJuIHtcbiAgICAgICAgb3B0aW1pc3RpYzogZmFsc2UsXG4gICAgICAgIGRpcmVjdGl2ZTogZmFsc2UsXG4gICAgICAgIG5vZGVqc1Njb3BlOiBmYWxzZSxcbiAgICAgICAgaW1wbGllZFN0cmljdDogZmFsc2UsXG4gICAgICAgIHNvdXJjZVR5cGU6ICdzY3JpcHQnLCAgLy8gb25lIG9mIFsnc2NyaXB0JywgJ21vZHVsZSddXG4gICAgICAgIGVjbWFWZXJzaW9uOiA1LFxuICAgICAgICBjaGlsZFZpc2l0b3JLZXlzOiBudWxsLFxuICAgICAgICBmYWxsYmFjazogJ2l0ZXJhdGlvbidcbiAgICB9O1xufVxuXG5mdW5jdGlvbiB1cGRhdGVEZWVwbHkodGFyZ2V0LCBvdmVycmlkZSkge1xuICAgIHZhciBrZXksIHZhbDtcblxuICAgIGZ1bmN0aW9uIGlzSGFzaE9iamVjdCh0YXJnZXQpIHtcbiAgICAgICAgcmV0dXJuIHR5cGVvZiB0YXJnZXQgPT09ICdvYmplY3QnICYmIHRhcmdldCBpbnN0YW5jZW9mIE9iamVjdCAmJiAhKHRhcmdldCBpbnN0YW5jZW9mIEFycmF5KSAmJiAhKHRhcmdldCBpbnN0YW5jZW9mIFJlZ0V4cCk7XG4gICAgfVxuXG4gICAgZm9yIChrZXkgaW4gb3ZlcnJpZGUpIHtcbiAgICAgICAgaWYgKG92ZXJyaWRlLmhhc093blByb3BlcnR5KGtleSkpIHtcbiAgICAgICAgICAgIHZhbCA9IG92ZXJyaWRlW2tleV07XG4gICAgICAgICAgICBpZiAoaXNIYXNoT2JqZWN0KHZhbCkpIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNIYXNoT2JqZWN0KHRhcmdldFtrZXldKSkge1xuICAgICAgICAgICAgICAgICAgICB1cGRhdGVEZWVwbHkodGFyZ2V0W2tleV0sIHZhbCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGFyZ2V0W2tleV0gPSB1cGRhdGVEZWVwbHkoe30sIHZhbCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0YXJnZXRba2V5XSA9IHZhbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gdGFyZ2V0O1xufVxuXG4vKipcbiAqIE1haW4gaW50ZXJmYWNlIGZ1bmN0aW9uLiBUYWtlcyBhbiBFc3ByaW1hIHN5bnRheCB0cmVlIGFuZCByZXR1cm5zIHRoZVxuICogYW5hbHl6ZWQgc2NvcGVzLlxuICogQGZ1bmN0aW9uIGFuYWx5emVcbiAqIEBwYXJhbSB7ZXNwcmltYS5UcmVlfSB0cmVlXG4gKiBAcGFyYW0ge09iamVjdH0gcHJvdmlkZWRPcHRpb25zIC0gT3B0aW9ucyB0aGF0IHRhaWxvciB0aGUgc2NvcGUgYW5hbHlzaXNcbiAqIEBwYXJhbSB7Ym9vbGVhbn0gW3Byb3ZpZGVkT3B0aW9ucy5vcHRpbWlzdGljPWZhbHNlXSAtIHRoZSBvcHRpbWlzdGljIGZsYWdcbiAqIEBwYXJhbSB7Ym9vbGVhbn0gW3Byb3ZpZGVkT3B0aW9ucy5kaXJlY3RpdmU9ZmFsc2VdLSB0aGUgZGlyZWN0aXZlIGZsYWdcbiAqIEBwYXJhbSB7Ym9vbGVhbn0gW3Byb3ZpZGVkT3B0aW9ucy5pZ25vcmVFdmFsPWZhbHNlXS0gd2hldGhlciB0byBjaGVjayAnZXZhbCgpJyBjYWxsc1xuICogQHBhcmFtIHtib29sZWFufSBbcHJvdmlkZWRPcHRpb25zLm5vZGVqc1Njb3BlPWZhbHNlXS0gd2hldGhlciB0aGUgd2hvbGVcbiAqIHNjcmlwdCBpcyBleGVjdXRlZCB1bmRlciBub2RlLmpzIGVudmlyb25tZW50LiBXaGVuIGVuYWJsZWQsIGVzY29wZSBhZGRzXG4gKiBhIGZ1bmN0aW9uIHNjb3BlIGltbWVkaWF0ZWx5IGZvbGxvd2luZyB0aGUgZ2xvYmFsIHNjb3BlLlxuICogQHBhcmFtIHtib29sZWFufSBbcHJvdmlkZWRPcHRpb25zLmltcGxpZWRTdHJpY3Q9ZmFsc2VdLSBpbXBsaWVkIHN0cmljdCBtb2RlXG4gKiAoaWYgZWNtYVZlcnNpb24gPj0gNSkuXG4gKiBAcGFyYW0ge3N0cmluZ30gW3Byb3ZpZGVkT3B0aW9ucy5zb3VyY2VUeXBlPSdzY3JpcHQnXS0gdGhlIHNvdXJjZSB0eXBlIG9mIHRoZSBzY3JpcHQuIG9uZSBvZiAnc2NyaXB0JyBhbmQgJ21vZHVsZSdcbiAqIEBwYXJhbSB7bnVtYmVyfSBbcHJvdmlkZWRPcHRpb25zLmVjbWFWZXJzaW9uPTVdLSB3aGljaCBFQ01BU2NyaXB0IHZlcnNpb24gaXMgY29uc2lkZXJlZFxuICogQHBhcmFtIHtPYmplY3R9IFtwcm92aWRlZE9wdGlvbnMuY2hpbGRWaXNpdG9yS2V5cz1udWxsXSAtIEFkZGl0aW9uYWwga25vd24gdmlzaXRvciBrZXlzLiBTZWUgW2VzcmVjdXJzZV0oaHR0cHM6Ly9naXRodWIuY29tL2VzdG9vbHMvZXNyZWN1cnNlKSdzIHRoZSBgY2hpbGRWaXNpdG9yS2V5c2Agb3B0aW9uLlxuICogQHBhcmFtIHtzdHJpbmd9IFtwcm92aWRlZE9wdGlvbnMuZmFsbGJhY2s9J2l0ZXJhdGlvbiddIC0gQSBraW5kIG9mIHRoZSBmYWxsYmFjayBpbiBvcmRlciB0byBlbmNvdW50ZXIgd2l0aCB1bmtub3duIG5vZGUuIFNlZSBbZXNyZWN1cnNlXShodHRwczovL2dpdGh1Yi5jb20vZXN0b29scy9lc3JlY3Vyc2UpJ3MgdGhlIGBmYWxsYmFja2Agb3B0aW9uLlxuICogQHJldHVybiB7U2NvcGVNYW5hZ2VyfVxuICovXG5leHBvcnQgZnVuY3Rpb24gYW5hbHl6ZSh0cmVlLCBwcm92aWRlZE9wdGlvbnMpIHtcbiAgICB2YXIgc2NvcGVNYW5hZ2VyLCByZWZlcmVuY2VyLCBvcHRpb25zO1xuXG4gICAgb3B0aW9ucyA9IHVwZGF0ZURlZXBseShkZWZhdWx0T3B0aW9ucygpLCBwcm92aWRlZE9wdGlvbnMpO1xuXG4gICAgc2NvcGVNYW5hZ2VyID0gbmV3IFNjb3BlTWFuYWdlcihvcHRpb25zKTtcblxuICAgIHJlZmVyZW5jZXIgPSBuZXcgUmVmZXJlbmNlcihvcHRpb25zLCBzY29wZU1hbmFnZXIpO1xuICAgIHJlZmVyZW5jZXIudmlzaXQodHJlZSk7XG5cbiAgICBhc3NlcnQoc2NvcGVNYW5hZ2VyLl9fY3VycmVudFNjb3BlID09PSBudWxsLCAnY3VycmVudFNjb3BlIHNob3VsZCBiZSBudWxsLicpO1xuXG4gICAgcmV0dXJuIHNjb3BlTWFuYWdlcjtcbn1cblxuZXhwb3J0IHtcbiAgICAvKiogQG5hbWUgbW9kdWxlOmVzY29wZS52ZXJzaW9uICovXG4gICAgdmVyc2lvbixcbiAgICAvKiogQG5hbWUgbW9kdWxlOmVzY29wZS5SZWZlcmVuY2UgKi9cbiAgICBSZWZlcmVuY2UsXG4gICAgLyoqIEBuYW1lIG1vZHVsZTplc2NvcGUuVmFyaWFibGUgKi9cbiAgICBWYXJpYWJsZSxcbiAgICAvKiogQG5hbWUgbW9kdWxlOmVzY29wZS5TY29wZSAqL1xuICAgIFNjb3BlLFxuICAgIC8qKiBAbmFtZSBtb2R1bGU6ZXNjb3BlLlNjb3BlTWFuYWdlciAqL1xuICAgIFNjb3BlTWFuYWdlclxufTtcblxuXG4vKiB2aW06IHNldCBzdz00IHRzPTQgZXQgdHc9ODAgOiAqL1xuIl0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9
      diff --git a/tools/eslint/node_modules/escope/lib/pattern-visitor.js b/tools/eslint/node_modules/escope/lib/pattern-visitor.js
      new file mode 100644
      index 00000000000000..909344aeb069ec
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/lib/pattern-visitor.js
      @@ -0,0 +1,176 @@
      +'use strict';
      +
      +Object.defineProperty(exports, "__esModule", {
      +    value: true
      +});
      +
      +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
      +
      +var _estraverse = require('estraverse');
      +
      +var _esrecurse = require('esrecurse');
      +
      +var _esrecurse2 = _interopRequireDefault(_esrecurse);
      +
      +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
      +
      +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
      +
      +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
      +
      +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 Copyright (C) 2015 Yusuke Suzuki 
      +
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 Redistribution and use in source and binary forms, with or without
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 modification, are permitted provided that the following conditions are met:
      +
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   * Redistributions of source code must retain the above copyright
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     notice, this list of conditions and the following disclaimer.
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   * Redistributions in binary form must reproduce the above copyright
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     notice, this list of conditions and the following disclaimer in the
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     documentation and/or other materials provided with the distribution.
      +
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ARE DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               */
      +
      +function getLast(xs) {
      +    return xs[xs.length - 1] || null;
      +}
      +
      +var PatternVisitor = function (_esrecurse$Visitor) {
      +    _inherits(PatternVisitor, _esrecurse$Visitor);
      +
      +    _createClass(PatternVisitor, null, [{
      +        key: 'isPattern',
      +        value: function isPattern(node) {
      +            var nodeType = node.type;
      +            return nodeType === _estraverse.Syntax.Identifier || nodeType === _estraverse.Syntax.ObjectPattern || nodeType === _estraverse.Syntax.ArrayPattern || nodeType === _estraverse.Syntax.SpreadElement || nodeType === _estraverse.Syntax.RestElement || nodeType === _estraverse.Syntax.AssignmentPattern;
      +        }
      +    }]);
      +
      +    function PatternVisitor(options, rootPattern, callback) {
      +        _classCallCheck(this, PatternVisitor);
      +
      +        var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(PatternVisitor).call(this, null, options));
      +
      +        _this.rootPattern = rootPattern;
      +        _this.callback = callback;
      +        _this.assignments = [];
      +        _this.rightHandNodes = [];
      +        _this.restElements = [];
      +        return _this;
      +    }
      +
      +    _createClass(PatternVisitor, [{
      +        key: 'Identifier',
      +        value: function Identifier(pattern) {
      +            var lastRestElement = getLast(this.restElements);
      +            this.callback(pattern, {
      +                topLevel: pattern === this.rootPattern,
      +                rest: lastRestElement != null && lastRestElement.argument === pattern,
      +                assignments: this.assignments
      +            });
      +        }
      +    }, {
      +        key: 'Property',
      +        value: function Property(property) {
      +            // Computed property's key is a right hand node.
      +            if (property.computed) {
      +                this.rightHandNodes.push(property.key);
      +            }
      +
      +            // If it's shorthand, its key is same as its value.
      +            // If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern).
      +            // If it's not shorthand, the name of new variable is its value's.
      +            this.visit(property.value);
      +        }
      +    }, {
      +        key: 'ArrayPattern',
      +        value: function ArrayPattern(pattern) {
      +            var i, iz, element;
      +            for (i = 0, iz = pattern.elements.length; i < iz; ++i) {
      +                element = pattern.elements[i];
      +                this.visit(element);
      +            }
      +        }
      +    }, {
      +        key: 'AssignmentPattern',
      +        value: function AssignmentPattern(pattern) {
      +            this.assignments.push(pattern);
      +            this.visit(pattern.left);
      +            this.rightHandNodes.push(pattern.right);
      +            this.assignments.pop();
      +        }
      +    }, {
      +        key: 'RestElement',
      +        value: function RestElement(pattern) {
      +            this.restElements.push(pattern);
      +            this.visit(pattern.argument);
      +            this.restElements.pop();
      +        }
      +    }, {
      +        key: 'MemberExpression',
      +        value: function MemberExpression(node) {
      +            // Computed property's key is a right hand node.
      +            if (node.computed) {
      +                this.rightHandNodes.push(node.property);
      +            }
      +            // the object is only read, write to its property.
      +            this.rightHandNodes.push(node.object);
      +        }
      +
      +        //
      +        // ForInStatement.left and AssignmentExpression.left are LeftHandSideExpression.
      +        // By spec, LeftHandSideExpression is Pattern or MemberExpression.
      +        //   (see also: https://github.com/estree/estree/pull/20#issuecomment-74584758)
      +        // But espree 2.0 and esprima 2.0 parse to ArrayExpression, ObjectExpression, etc...
      +        //
      +
      +    }, {
      +        key: 'SpreadElement',
      +        value: function SpreadElement(node) {
      +            this.visit(node.argument);
      +        }
      +    }, {
      +        key: 'ArrayExpression',
      +        value: function ArrayExpression(node) {
      +            node.elements.forEach(this.visit, this);
      +        }
      +    }, {
      +        key: 'AssignmentExpression',
      +        value: function AssignmentExpression(node) {
      +            this.assignments.push(node);
      +            this.visit(node.left);
      +            this.rightHandNodes.push(node.right);
      +            this.assignments.pop();
      +        }
      +    }, {
      +        key: 'CallExpression',
      +        value: function CallExpression(node) {
      +            var _this2 = this;
      +
      +            // arguments are right hand nodes.
      +            node.arguments.forEach(function (a) {
      +                _this2.rightHandNodes.push(a);
      +            });
      +            this.visit(node.callee);
      +        }
      +    }]);
      +
      +    return PatternVisitor;
      +}(_esrecurse2.default.Visitor);
      +
      +/* vim: set sw=4 ts=4 et tw=80 : */
      +
      +
      +exports.default = PatternVisitor;
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInBhdHRlcm4tdmlzaXRvci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7OztBQXdCQTs7QUFDQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUVBLFNBQVMsT0FBVCxDQUFpQixFQUFqQixFQUFxQjtBQUNqQixXQUFPLEdBQUcsR0FBRyxNQUFILEdBQVksQ0FBWixDQUFILElBQXFCLElBQXJCLENBRFU7Q0FBckI7O0lBSXFCOzs7OztrQ0FDQSxNQUFNO0FBQ25CLGdCQUFJLFdBQVcsS0FBSyxJQUFMLENBREk7QUFFbkIsbUJBQ0ksYUFBYSxtQkFBTyxVQUFQLElBQ2IsYUFBYSxtQkFBTyxhQUFQLElBQ2IsYUFBYSxtQkFBTyxZQUFQLElBQ2IsYUFBYSxtQkFBTyxhQUFQLElBQ2IsYUFBYSxtQkFBTyxXQUFQLElBQ2IsYUFBYSxtQkFBTyxpQkFBUCxDQVJFOzs7O0FBWXZCLGFBYmlCLGNBYWpCLENBQVksT0FBWixFQUFxQixXQUFyQixFQUFrQyxRQUFsQyxFQUE0Qzs4QkFiM0IsZ0JBYTJCOzsyRUFiM0IsMkJBY1AsTUFBTSxVQUQ0Qjs7QUFFeEMsY0FBSyxXQUFMLEdBQW1CLFdBQW5CLENBRndDO0FBR3hDLGNBQUssUUFBTCxHQUFnQixRQUFoQixDQUh3QztBQUl4QyxjQUFLLFdBQUwsR0FBbUIsRUFBbkIsQ0FKd0M7QUFLeEMsY0FBSyxjQUFMLEdBQXNCLEVBQXRCLENBTHdDO0FBTXhDLGNBQUssWUFBTCxHQUFvQixFQUFwQixDQU53Qzs7S0FBNUM7O2lCQWJpQjs7bUNBc0JOLFNBQVM7QUFDaEIsZ0JBQU0sa0JBQWtCLFFBQVEsS0FBSyxZQUFMLENBQTFCLENBRFU7QUFFaEIsaUJBQUssUUFBTCxDQUFjLE9BQWQsRUFBdUI7QUFDbkIsMEJBQVUsWUFBWSxLQUFLLFdBQUw7QUFDdEIsc0JBQU0sbUJBQW1CLElBQW5CLElBQTJCLGdCQUFnQixRQUFoQixLQUE2QixPQUE3QjtBQUNqQyw2QkFBYSxLQUFLLFdBQUw7YUFIakIsRUFGZ0I7Ozs7aUNBU1gsVUFBVTs7QUFFZixnQkFBSSxTQUFTLFFBQVQsRUFBbUI7QUFDbkIscUJBQUssY0FBTCxDQUFvQixJQUFwQixDQUF5QixTQUFTLEdBQVQsQ0FBekIsQ0FEbUI7YUFBdkI7Ozs7O0FBRmUsZ0JBU2YsQ0FBSyxLQUFMLENBQVcsU0FBUyxLQUFULENBQVgsQ0FUZTs7OztxQ0FZTixTQUFTO0FBQ2xCLGdCQUFJLENBQUosRUFBTyxFQUFQLEVBQVcsT0FBWCxDQURrQjtBQUVsQixpQkFBSyxJQUFJLENBQUosRUFBTyxLQUFLLFFBQVEsUUFBUixDQUFpQixNQUFqQixFQUF5QixJQUFJLEVBQUosRUFBUSxFQUFFLENBQUYsRUFBSztBQUNuRCwwQkFBVSxRQUFRLFFBQVIsQ0FBaUIsQ0FBakIsQ0FBVixDQURtRDtBQUVuRCxxQkFBSyxLQUFMLENBQVcsT0FBWCxFQUZtRDthQUF2RDs7OzswQ0FNYyxTQUFTO0FBQ3ZCLGlCQUFLLFdBQUwsQ0FBaUIsSUFBakIsQ0FBc0IsT0FBdEIsRUFEdUI7QUFFdkIsaUJBQUssS0FBTCxDQUFXLFFBQVEsSUFBUixDQUFYLENBRnVCO0FBR3ZCLGlCQUFLLGNBQUwsQ0FBb0IsSUFBcEIsQ0FBeUIsUUFBUSxLQUFSLENBQXpCLENBSHVCO0FBSXZCLGlCQUFLLFdBQUwsQ0FBaUIsR0FBakIsR0FKdUI7Ozs7b0NBT2YsU0FBUztBQUNqQixpQkFBSyxZQUFMLENBQWtCLElBQWxCLENBQXVCLE9BQXZCLEVBRGlCO0FBRWpCLGlCQUFLLEtBQUwsQ0FBVyxRQUFRLFFBQVIsQ0FBWCxDQUZpQjtBQUdqQixpQkFBSyxZQUFMLENBQWtCLEdBQWxCLEdBSGlCOzs7O3lDQU1KLE1BQU07O0FBRW5CLGdCQUFJLEtBQUssUUFBTCxFQUFlO0FBQ2YscUJBQUssY0FBTCxDQUFvQixJQUFwQixDQUF5QixLQUFLLFFBQUwsQ0FBekIsQ0FEZTthQUFuQjs7QUFGbUIsZ0JBTW5CLENBQUssY0FBTCxDQUFvQixJQUFwQixDQUF5QixLQUFLLE1BQUwsQ0FBekIsQ0FObUI7Ozs7Ozs7Ozs7OztzQ0FnQlQsTUFBTTtBQUNoQixpQkFBSyxLQUFMLENBQVcsS0FBSyxRQUFMLENBQVgsQ0FEZ0I7Ozs7d0NBSUosTUFBTTtBQUNsQixpQkFBSyxRQUFMLENBQWMsT0FBZCxDQUFzQixLQUFLLEtBQUwsRUFBWSxJQUFsQyxFQURrQjs7Ozs2Q0FJRCxNQUFNO0FBQ3ZCLGlCQUFLLFdBQUwsQ0FBaUIsSUFBakIsQ0FBc0IsSUFBdEIsRUFEdUI7QUFFdkIsaUJBQUssS0FBTCxDQUFXLEtBQUssSUFBTCxDQUFYLENBRnVCO0FBR3ZCLGlCQUFLLGNBQUwsQ0FBb0IsSUFBcEIsQ0FBeUIsS0FBSyxLQUFMLENBQXpCLENBSHVCO0FBSXZCLGlCQUFLLFdBQUwsQ0FBaUIsR0FBakIsR0FKdUI7Ozs7dUNBT1osTUFBTTs7OztBQUVqQixpQkFBSyxTQUFMLENBQWUsT0FBZixDQUF1QixhQUFLO0FBQUUsdUJBQUssY0FBTCxDQUFvQixJQUFwQixDQUF5QixDQUF6QixFQUFGO2FBQUwsQ0FBdkIsQ0FGaUI7QUFHakIsaUJBQUssS0FBTCxDQUFXLEtBQUssTUFBTCxDQUFYLENBSGlCOzs7O1dBL0ZKO0VBQXVCLG9CQUFVLE9BQVY7Ozs7O2tCQUF2QiIsImZpbGUiOiJwYXR0ZXJuLXZpc2l0b3IuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKlxuICBDb3B5cmlnaHQgKEMpIDIwMTUgWXVzdWtlIFN1enVraSA8dXRhdGFuZS50ZWFAZ21haWwuY29tPlxuXG4gIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dFxuICBtb2RpZmljYXRpb24sIGFyZSBwZXJtaXR0ZWQgcHJvdmlkZWQgdGhhdCB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnMgYXJlIG1ldDpcblxuICAgICogUmVkaXN0cmlidXRpb25zIG9mIHNvdXJjZSBjb2RlIG11c3QgcmV0YWluIHRoZSBhYm92ZSBjb3B5cmlnaHRcbiAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lci5cbiAgICAqIFJlZGlzdHJpYnV0aW9ucyBpbiBiaW5hcnkgZm9ybSBtdXN0IHJlcHJvZHVjZSB0aGUgYWJvdmUgY29weXJpZ2h0XG4gICAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIgaW4gdGhlXG4gICAgICBkb2N1bWVudGF0aW9uIGFuZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQgd2l0aCB0aGUgZGlzdHJpYnV0aW9uLlxuXG4gIFRISVMgU09GVFdBUkUgSVMgUFJPVklERUQgQlkgVEhFIENPUFlSSUdIVCBIT0xERVJTIEFORCBDT05UUklCVVRPUlMgXCJBUyBJU1wiXG4gIEFORCBBTlkgRVhQUkVTUyBPUiBJTVBMSUVEIFdBUlJBTlRJRVMsIElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBUSEVcbiAgSU1QTElFRCBXQVJSQU5USUVTIE9GIE1FUkNIQU5UQUJJTElUWSBBTkQgRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0VcbiAgQVJFIERJU0NMQUlNRUQuIElOIE5PIEVWRU5UIFNIQUxMIDxDT1BZUklHSFQgSE9MREVSPiBCRSBMSUFCTEUgRk9SIEFOWVxuICBESVJFQ1QsIElORElSRUNULCBJTkNJREVOVEFMLCBTUEVDSUFMLCBFWEVNUExBUlksIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFU1xuICAoSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFBST0NVUkVNRU5UIE9GIFNVQlNUSVRVVEUgR09PRFMgT1IgU0VSVklDRVM7XG4gIExPU1MgT0YgVVNFLCBEQVRBLCBPUiBQUk9GSVRTOyBPUiBCVVNJTkVTUyBJTlRFUlJVUFRJT04pIEhPV0VWRVIgQ0FVU0VEIEFORFxuICBPTiBBTlkgVEhFT1JZIE9GIExJQUJJTElUWSwgV0hFVEhFUiBJTiBDT05UUkFDVCwgU1RSSUNUIExJQUJJTElUWSwgT1IgVE9SVFxuICAoSU5DTFVESU5HIE5FR0xJR0VOQ0UgT1IgT1RIRVJXSVNFKSBBUklTSU5HIElOIEFOWSBXQVkgT1VUIE9GIFRIRSBVU0UgT0ZcbiAgVEhJUyBTT0ZUV0FSRSwgRVZFTiBJRiBBRFZJU0VEIE9GIFRIRSBQT1NTSUJJTElUWSBPRiBTVUNIIERBTUFHRS5cbiovXG5cbmltcG9ydCB7IFN5bnRheCB9IGZyb20gJ2VzdHJhdmVyc2UnO1xuaW1wb3J0IGVzcmVjdXJzZSBmcm9tICdlc3JlY3Vyc2UnO1xuXG5mdW5jdGlvbiBnZXRMYXN0KHhzKSB7XG4gICAgcmV0dXJuIHhzW3hzLmxlbmd0aCAtIDFdIHx8IG51bGw7XG59XG5cbmV4cG9ydCBkZWZhdWx0IGNsYXNzIFBhdHRlcm5WaXNpdG9yIGV4dGVuZHMgZXNyZWN1cnNlLlZpc2l0b3Ige1xuICAgIHN0YXRpYyBpc1BhdHRlcm4obm9kZSkge1xuICAgICAgICB2YXIgbm9kZVR5cGUgPSBub2RlLnR5cGU7XG4gICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICBub2RlVHlwZSA9PT0gU3ludGF4LklkZW50aWZpZXIgfHxcbiAgICAgICAgICAgIG5vZGVUeXBlID09PSBTeW50YXguT2JqZWN0UGF0dGVybiB8fFxuICAgICAgICAgICAgbm9kZVR5cGUgPT09IFN5bnRheC5BcnJheVBhdHRlcm4gfHxcbiAgICAgICAgICAgIG5vZGVUeXBlID09PSBTeW50YXguU3ByZWFkRWxlbWVudCB8fFxuICAgICAgICAgICAgbm9kZVR5cGUgPT09IFN5bnRheC5SZXN0RWxlbWVudCB8fFxuICAgICAgICAgICAgbm9kZVR5cGUgPT09IFN5bnRheC5Bc3NpZ25tZW50UGF0dGVyblxuICAgICAgICApO1xuICAgIH1cblxuICAgIGNvbnN0cnVjdG9yKG9wdGlvbnMsIHJvb3RQYXR0ZXJuLCBjYWxsYmFjaykge1xuICAgICAgICBzdXBlcihudWxsLCBvcHRpb25zKTtcbiAgICAgICAgdGhpcy5yb290UGF0dGVybiA9IHJvb3RQYXR0ZXJuO1xuICAgICAgICB0aGlzLmNhbGxiYWNrID0gY2FsbGJhY2s7XG4gICAgICAgIHRoaXMuYXNzaWdubWVudHMgPSBbXTtcbiAgICAgICAgdGhpcy5yaWdodEhhbmROb2RlcyA9IFtdO1xuICAgICAgICB0aGlzLnJlc3RFbGVtZW50cyA9IFtdO1xuICAgIH1cblxuICAgIElkZW50aWZpZXIocGF0dGVybikge1xuICAgICAgICBjb25zdCBsYXN0UmVzdEVsZW1lbnQgPSBnZXRMYXN0KHRoaXMucmVzdEVsZW1lbnRzKTtcbiAgICAgICAgdGhpcy5jYWxsYmFjayhwYXR0ZXJuLCB7XG4gICAgICAgICAgICB0b3BMZXZlbDogcGF0dGVybiA9PT0gdGhpcy5yb290UGF0dGVybixcbiAgICAgICAgICAgIHJlc3Q6IGxhc3RSZXN0RWxlbWVudCAhPSBudWxsICYmIGxhc3RSZXN0RWxlbWVudC5hcmd1bWVudCA9PT0gcGF0dGVybixcbiAgICAgICAgICAgIGFzc2lnbm1lbnRzOiB0aGlzLmFzc2lnbm1lbnRzXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIFByb3BlcnR5KHByb3BlcnR5KSB7XG4gICAgICAgIC8vIENvbXB1dGVkIHByb3BlcnR5J3Mga2V5IGlzIGEgcmlnaHQgaGFuZCBub2RlLlxuICAgICAgICBpZiAocHJvcGVydHkuY29tcHV0ZWQpIHtcbiAgICAgICAgICAgIHRoaXMucmlnaHRIYW5kTm9kZXMucHVzaChwcm9wZXJ0eS5rZXkpO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gSWYgaXQncyBzaG9ydGhhbmQsIGl0cyBrZXkgaXMgc2FtZSBhcyBpdHMgdmFsdWUuXG4gICAgICAgIC8vIElmIGl0J3Mgc2hvcnRoYW5kIGFuZCBoYXMgaXRzIGRlZmF1bHQgdmFsdWUsIGl0cyBrZXkgaXMgc2FtZSBhcyBpdHMgdmFsdWUubGVmdCAodGhlIHZhbHVlIGlzIEFzc2lnbm1lbnRQYXR0ZXJuKS5cbiAgICAgICAgLy8gSWYgaXQncyBub3Qgc2hvcnRoYW5kLCB0aGUgbmFtZSBvZiBuZXcgdmFyaWFibGUgaXMgaXRzIHZhbHVlJ3MuXG4gICAgICAgIHRoaXMudmlzaXQocHJvcGVydHkudmFsdWUpO1xuICAgIH1cblxuICAgIEFycmF5UGF0dGVybihwYXR0ZXJuKSB7XG4gICAgICAgIHZhciBpLCBpeiwgZWxlbWVudDtcbiAgICAgICAgZm9yIChpID0gMCwgaXogPSBwYXR0ZXJuLmVsZW1lbnRzLmxlbmd0aDsgaSA8IGl6OyArK2kpIHtcbiAgICAgICAgICAgIGVsZW1lbnQgPSBwYXR0ZXJuLmVsZW1lbnRzW2ldO1xuICAgICAgICAgICAgdGhpcy52aXNpdChlbGVtZW50KTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIEFzc2lnbm1lbnRQYXR0ZXJuKHBhdHRlcm4pIHtcbiAgICAgICAgdGhpcy5hc3NpZ25tZW50cy5wdXNoKHBhdHRlcm4pO1xuICAgICAgICB0aGlzLnZpc2l0KHBhdHRlcm4ubGVmdCk7XG4gICAgICAgIHRoaXMucmlnaHRIYW5kTm9kZXMucHVzaChwYXR0ZXJuLnJpZ2h0KTtcbiAgICAgICAgdGhpcy5hc3NpZ25tZW50cy5wb3AoKTtcbiAgICB9XG5cbiAgICBSZXN0RWxlbWVudChwYXR0ZXJuKSB7XG4gICAgICAgIHRoaXMucmVzdEVsZW1lbnRzLnB1c2gocGF0dGVybik7XG4gICAgICAgIHRoaXMudmlzaXQocGF0dGVybi5hcmd1bWVudCk7XG4gICAgICAgIHRoaXMucmVzdEVsZW1lbnRzLnBvcCgpO1xuICAgIH1cblxuICAgIE1lbWJlckV4cHJlc3Npb24obm9kZSkge1xuICAgICAgICAvLyBDb21wdXRlZCBwcm9wZXJ0eSdzIGtleSBpcyBhIHJpZ2h0IGhhbmQgbm9kZS5cbiAgICAgICAgaWYgKG5vZGUuY29tcHV0ZWQpIHtcbiAgICAgICAgICAgIHRoaXMucmlnaHRIYW5kTm9kZXMucHVzaChub2RlLnByb3BlcnR5KTtcbiAgICAgICAgfVxuICAgICAgICAvLyB0aGUgb2JqZWN0IGlzIG9ubHkgcmVhZCwgd3JpdGUgdG8gaXRzIHByb3BlcnR5LlxuICAgICAgICB0aGlzLnJpZ2h0SGFuZE5vZGVzLnB1c2gobm9kZS5vYmplY3QpO1xuICAgIH1cblxuICAgIC8vXG4gICAgLy8gRm9ySW5TdGF0ZW1lbnQubGVmdCBhbmQgQXNzaWdubWVudEV4cHJlc3Npb24ubGVmdCBhcmUgTGVmdEhhbmRTaWRlRXhwcmVzc2lvbi5cbiAgICAvLyBCeSBzcGVjLCBMZWZ0SGFuZFNpZGVFeHByZXNzaW9uIGlzIFBhdHRlcm4gb3IgTWVtYmVyRXhwcmVzc2lvbi5cbiAgICAvLyAgIChzZWUgYWxzbzogaHR0cHM6Ly9naXRodWIuY29tL2VzdHJlZS9lc3RyZWUvcHVsbC8yMCNpc3N1ZWNvbW1lbnQtNzQ1ODQ3NTgpXG4gICAgLy8gQnV0IGVzcHJlZSAyLjAgYW5kIGVzcHJpbWEgMi4wIHBhcnNlIHRvIEFycmF5RXhwcmVzc2lvbiwgT2JqZWN0RXhwcmVzc2lvbiwgZXRjLi4uXG4gICAgLy9cblxuICAgIFNwcmVhZEVsZW1lbnQobm9kZSkge1xuICAgICAgICB0aGlzLnZpc2l0KG5vZGUuYXJndW1lbnQpO1xuICAgIH1cblxuICAgIEFycmF5RXhwcmVzc2lvbihub2RlKSB7XG4gICAgICAgIG5vZGUuZWxlbWVudHMuZm9yRWFjaCh0aGlzLnZpc2l0LCB0aGlzKTtcbiAgICB9XG5cbiAgICBBc3NpZ25tZW50RXhwcmVzc2lvbihub2RlKSB7XG4gICAgICAgIHRoaXMuYXNzaWdubWVudHMucHVzaChub2RlKTtcbiAgICAgICAgdGhpcy52aXNpdChub2RlLmxlZnQpO1xuICAgICAgICB0aGlzLnJpZ2h0SGFuZE5vZGVzLnB1c2gobm9kZS5yaWdodCk7XG4gICAgICAgIHRoaXMuYXNzaWdubWVudHMucG9wKCk7XG4gICAgfVxuXG4gICAgQ2FsbEV4cHJlc3Npb24obm9kZSkge1xuICAgICAgICAvLyBhcmd1bWVudHMgYXJlIHJpZ2h0IGhhbmQgbm9kZXMuXG4gICAgICAgIG5vZGUuYXJndW1lbnRzLmZvckVhY2goYSA9PiB7IHRoaXMucmlnaHRIYW5kTm9kZXMucHVzaChhKTsgfSk7XG4gICAgICAgIHRoaXMudmlzaXQobm9kZS5jYWxsZWUpO1xuICAgIH1cbn1cblxuLyogdmltOiBzZXQgc3c9NCB0cz00IGV0IHR3PTgwIDogKi9cbiJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
      diff --git a/tools/eslint/node_modules/escope/lib/reference.js b/tools/eslint/node_modules/escope/lib/reference.js
      index 68b6898a8b9b70..590d356ce644f2 100644
      --- a/tools/eslint/node_modules/escope/lib/reference.js
      +++ b/tools/eslint/node_modules/escope/lib/reference.js
      @@ -1,8 +1,12 @@
       "use strict";
       
      -var _createClass = (function () { function defineProperties(target, props) { for (var key in props) { var prop = props[key]; prop.configurable = true; if (prop.value) prop.writable = true; } Object.defineProperties(target, props); } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
      +Object.defineProperty(exports, "__esModule", {
      +  value: true
      +});
       
      -var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
      +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
      +
      +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
       
       /*
         Copyright (C) 2015 Yusuke Suzuki 
      @@ -28,8 +32,8 @@ var _classCallCheck = function (instance, Constructor) { if (!(instance instance
         THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
       */
       
      -var READ = 1;
      -var WRITE = 2;
      +var READ = 0x1;
      +var WRITE = 0x2;
       var RW = READ | WRITE;
       
       /**
      @@ -37,7 +41,7 @@ var RW = READ | WRITE;
        * @class Reference
        */
       
      -var Reference = (function () {
      +var Reference = function () {
         function Reference(ident, scope, flag, writeExpr, maybeImplicitGlobal, partial, init) {
           _classCallCheck(this, Reference);
       
      @@ -89,90 +93,90 @@ var Reference = (function () {
           this.__maybeImplicitGlobal = maybeImplicitGlobal;
         }
       
      -  _createClass(Reference, {
      -    isStatic: {
      +  /**
      +   * Whether the reference is static.
      +   * @method Reference#isStatic
      +   * @return {boolean}
      +   */
       
      -      /**
      -       * Whether the reference is static.
      -       * @method Reference#isStatic
      -       * @return {boolean}
      -       */
       
      -      value: function isStatic() {
      -        return !this.tainted && this.resolved && this.resolved.scope.isStatic();
      -      }
      -    },
      -    isWrite: {
      +  _createClass(Reference, [{
      +    key: "isStatic",
      +    value: function isStatic() {
      +      return !this.tainted && this.resolved && this.resolved.scope.isStatic();
      +    }
       
      -      /**
      -       * Whether the reference is writeable.
      -       * @method Reference#isWrite
      -       * @return {boolean}
      -       */
      +    /**
      +     * Whether the reference is writeable.
      +     * @method Reference#isWrite
      +     * @return {boolean}
      +     */
       
      -      value: function isWrite() {
      -        return !!(this.flag & Reference.WRITE);
      -      }
      -    },
      -    isRead: {
      +  }, {
      +    key: "isWrite",
      +    value: function isWrite() {
      +      return !!(this.flag & Reference.WRITE);
      +    }
       
      -      /**
      -       * Whether the reference is readable.
      -       * @method Reference#isRead
      -       * @return {boolean}
      -       */
      +    /**
      +     * Whether the reference is readable.
      +     * @method Reference#isRead
      +     * @return {boolean}
      +     */
       
      -      value: function isRead() {
      -        return !!(this.flag & Reference.READ);
      -      }
      -    },
      -    isReadOnly: {
      +  }, {
      +    key: "isRead",
      +    value: function isRead() {
      +      return !!(this.flag & Reference.READ);
      +    }
       
      -      /**
      -       * Whether the reference is read-only.
      -       * @method Reference#isReadOnly
      -       * @return {boolean}
      -       */
      +    /**
      +     * Whether the reference is read-only.
      +     * @method Reference#isReadOnly
      +     * @return {boolean}
      +     */
       
      -      value: function isReadOnly() {
      -        return this.flag === Reference.READ;
      -      }
      -    },
      -    isWriteOnly: {
      +  }, {
      +    key: "isReadOnly",
      +    value: function isReadOnly() {
      +      return this.flag === Reference.READ;
      +    }
       
      -      /**
      -       * Whether the reference is write-only.
      -       * @method Reference#isWriteOnly
      -       * @return {boolean}
      -       */
      +    /**
      +     * Whether the reference is write-only.
      +     * @method Reference#isWriteOnly
      +     * @return {boolean}
      +     */
       
      -      value: function isWriteOnly() {
      -        return this.flag === Reference.WRITE;
      -      }
      -    },
      -    isReadWrite: {
      +  }, {
      +    key: "isWriteOnly",
      +    value: function isWriteOnly() {
      +      return this.flag === Reference.WRITE;
      +    }
       
      -      /**
      -       * Whether the reference is read-write.
      -       * @method Reference#isReadWrite
      -       * @return {boolean}
      -       */
      +    /**
      +     * Whether the reference is read-write.
      +     * @method Reference#isReadWrite
      +     * @return {boolean}
      +     */
       
      -      value: function isReadWrite() {
      -        return this.flag === Reference.RW;
      -      }
      +  }, {
      +    key: "isReadWrite",
      +    value: function isReadWrite() {
      +      return this.flag === Reference.RW;
           }
      -  });
      +  }]);
       
         return Reference;
      -})();
      -
      -module.exports = Reference;
      +}();
       
       /**
        * @constant Reference.READ
        * @private
        */
      +
      +
      +exports.default = Reference;
       Reference.READ = READ;
       /**
        * @constant Reference.WRITE
      @@ -186,4 +190,4 @@ Reference.WRITE = WRITE;
       Reference.RW = RW;
       
       /* vim: set sw=4 ts=4 et tw=80 : */
      -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJlZmVyZW5jZS5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUF3QkEsSUFBTSxJQUFJLEdBQUcsQ0FBRyxDQUFDO0FBQ2pCLElBQU0sS0FBSyxHQUFHLENBQUcsQ0FBQztBQUNsQixJQUFNLEVBQUUsR0FBRyxJQUFJLEdBQUcsS0FBSyxDQUFDOzs7Ozs7O0lBTUgsU0FBUztBQUNmLFdBRE0sU0FBUyxDQUNkLEtBQUssRUFBRSxLQUFLLEVBQUUsSUFBSSxFQUFHLFNBQVMsRUFBRSxtQkFBbUIsRUFBRSxPQUFPLEVBQUUsSUFBSSxFQUFFOzBCQUQvRCxTQUFTOzs7Ozs7QUFNdEIsUUFBSSxDQUFDLFVBQVUsR0FBRyxLQUFLLENBQUM7Ozs7O0FBS3hCLFFBQUksQ0FBQyxJQUFJLEdBQUcsS0FBSyxDQUFDOzs7Ozs7QUFNbEIsUUFBSSxDQUFDLE9BQU8sR0FBRyxLQUFLLENBQUM7Ozs7O0FBS3JCLFFBQUksQ0FBQyxRQUFRLEdBQUcsSUFBSSxDQUFDOzs7Ozs7O0FBT3JCLFFBQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxDQUFDO0FBQ2pCLFFBQUksSUFBSSxDQUFDLE9BQU8sRUFBRSxFQUFFOzs7OztBQUtoQixVQUFJLENBQUMsU0FBUyxHQUFHLFNBQVMsQ0FBQzs7Ozs7QUFLM0IsVUFBSSxDQUFDLE9BQU8sR0FBRyxPQUFPLENBQUM7Ozs7O0FBS3ZCLFVBQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxDQUFDO0tBQ3BCO0FBQ0QsUUFBSSxDQUFDLHFCQUFxQixHQUFHLG1CQUFtQixDQUFDO0dBQ3BEOztlQWhEZ0IsU0FBUztBQXVEMUIsWUFBUTs7Ozs7Ozs7YUFBQSxvQkFBRztBQUNQLGVBQU8sQ0FBQyxJQUFJLENBQUMsT0FBTyxJQUFJLElBQUksQ0FBQyxRQUFRLElBQUksSUFBSSxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsUUFBUSxFQUFFLENBQUM7T0FDM0U7O0FBT0QsV0FBTzs7Ozs7Ozs7YUFBQSxtQkFBRztBQUNOLGVBQU8sQ0FBQyxFQUFFLElBQUksQ0FBQyxJQUFJLEdBQUcsU0FBUyxDQUFDLEtBQUssQ0FBQSxBQUFDLENBQUM7T0FDMUM7O0FBT0QsVUFBTTs7Ozs7Ozs7YUFBQSxrQkFBRztBQUNMLGVBQU8sQ0FBQyxFQUFFLElBQUksQ0FBQyxJQUFJLEdBQUcsU0FBUyxDQUFDLElBQUksQ0FBQSxBQUFDLENBQUM7T0FDekM7O0FBT0QsY0FBVTs7Ozs7Ozs7YUFBQSxzQkFBRztBQUNULGVBQU8sSUFBSSxDQUFDLElBQUksS0FBSyxTQUFTLENBQUMsSUFBSSxDQUFDO09BQ3ZDOztBQU9ELGVBQVc7Ozs7Ozs7O2FBQUEsdUJBQUc7QUFDVixlQUFPLElBQUksQ0FBQyxJQUFJLEtBQUssU0FBUyxDQUFDLEtBQUssQ0FBQztPQUN4Qzs7QUFPRCxlQUFXOzs7Ozs7OzthQUFBLHVCQUFHO0FBQ1YsZUFBTyxJQUFJLENBQUMsSUFBSSxLQUFLLFNBQVMsQ0FBQyxFQUFFLENBQUM7T0FDckM7Ozs7U0F0R2dCLFNBQVM7OztpQkFBVCxTQUFTOzs7Ozs7QUE2RzlCLFNBQVMsQ0FBQyxJQUFJLEdBQUcsSUFBSSxDQUFDOzs7OztBQUt0QixTQUFTLENBQUMsS0FBSyxHQUFHLEtBQUssQ0FBQzs7Ozs7QUFLeEIsU0FBUyxDQUFDLEVBQUUsR0FBRyxFQUFFLENBQUMiLCJmaWxlIjoicmVmZXJlbmNlLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLypcbiAgQ29weXJpZ2h0IChDKSAyMDE1IFl1c3VrZSBTdXp1a2kgPHV0YXRhbmUudGVhQGdtYWlsLmNvbT5cblxuICBSZWRpc3RyaWJ1dGlvbiBhbmQgdXNlIGluIHNvdXJjZSBhbmQgYmluYXJ5IGZvcm1zLCB3aXRoIG9yIHdpdGhvdXRcbiAgbW9kaWZpY2F0aW9uLCBhcmUgcGVybWl0dGVkIHByb3ZpZGVkIHRoYXQgdGhlIGZvbGxvd2luZyBjb25kaXRpb25zIGFyZSBtZXQ6XG5cbiAgICAqIFJlZGlzdHJpYnV0aW9ucyBvZiBzb3VyY2UgY29kZSBtdXN0IHJldGFpbiB0aGUgYWJvdmUgY29weXJpZ2h0XG4gICAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIuXG4gICAgKiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodFxuICAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyIGluIHRoZVxuICAgICAgZG9jdW1lbnRhdGlvbiBhbmQvb3Igb3RoZXIgbWF0ZXJpYWxzIHByb3ZpZGVkIHdpdGggdGhlIGRpc3RyaWJ1dGlvbi5cblxuICBUSElTIFNPRlRXQVJFIElTIFBST1ZJREVEIEJZIFRIRSBDT1BZUklHSFQgSE9MREVSUyBBTkQgQ09OVFJJQlVUT1JTIFwiQVMgSVNcIlxuICBBTkQgQU5ZIEVYUFJFU1MgT1IgSU1QTElFRCBXQVJSQU5USUVTLCBJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgVEhFXG4gIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFXG4gIEFSRSBESVNDTEFJTUVELiBJTiBOTyBFVkVOVCBTSEFMTCA8Q09QWVJJR0hUIEhPTERFUj4gQkUgTElBQkxFIEZPUiBBTllcbiAgRElSRUNULCBJTkRJUkVDVCwgSU5DSURFTlRBTCwgU1BFQ0lBTCwgRVhFTVBMQVJZLCBPUiBDT05TRVFVRU5USUFMIERBTUFHRVNcbiAgKElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTO1xuICBMT1NTIE9GIFVTRSwgREFUQSwgT1IgUFJPRklUUzsgT1IgQlVTSU5FU1MgSU5URVJSVVBUSU9OKSBIT1dFVkVSIENBVVNFRCBBTkRcbiAgT04gQU5ZIFRIRU9SWSBPRiBMSUFCSUxJVFksIFdIRVRIRVIgSU4gQ09OVFJBQ1QsIFNUUklDVCBMSUFCSUxJVFksIE9SIFRPUlRcbiAgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFIE9GXG4gIFRISVMgU09GVFdBUkUsIEVWRU4gSUYgQURWSVNFRCBPRiBUSEUgUE9TU0lCSUxJVFkgT0YgU1VDSCBEQU1BR0UuXG4qL1xuXG5jb25zdCBSRUFEID0gMHgxO1xuY29uc3QgV1JJVEUgPSAweDI7XG5jb25zdCBSVyA9IFJFQUQgfCBXUklURTtcblxuLyoqXG4gKiBBIFJlZmVyZW5jZSByZXByZXNlbnRzIGEgc2luZ2xlIG9jY3VycmVuY2Ugb2YgYW4gaWRlbnRpZmllciBpbiBjb2RlLlxuICogQGNsYXNzIFJlZmVyZW5jZVxuICovXG5leHBvcnQgZGVmYXVsdCBjbGFzcyBSZWZlcmVuY2Uge1xuICAgIGNvbnN0cnVjdG9yKGlkZW50LCBzY29wZSwgZmxhZywgIHdyaXRlRXhwciwgbWF5YmVJbXBsaWNpdEdsb2JhbCwgcGFydGlhbCwgaW5pdCkge1xuICAgICAgICAvKipcbiAgICAgICAgICogSWRlbnRpZmllciBzeW50YXggbm9kZS5cbiAgICAgICAgICogQG1lbWJlciB7ZXNwcmltYSNJZGVudGlmaWVyfSBSZWZlcmVuY2UjaWRlbnRpZmllclxuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5pZGVudGlmaWVyID0gaWRlbnQ7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBSZWZlcmVuY2UgdG8gdGhlIGVuY2xvc2luZyBTY29wZS5cbiAgICAgICAgICogQG1lbWJlciB7U2NvcGV9IFJlZmVyZW5jZSNmcm9tXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLmZyb20gPSBzY29wZTtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIFdoZXRoZXIgdGhlIHJlZmVyZW5jZSBjb21lcyBmcm9tIGEgZHluYW1pYyBzY29wZSAoc3VjaCBhcyAnZXZhbCcsXG4gICAgICAgICAqICd3aXRoJywgZXRjLiksIGFuZCBtYXkgYmUgdHJhcHBlZCBieSBkeW5hbWljIHNjb3Blcy5cbiAgICAgICAgICogQG1lbWJlciB7Ym9vbGVhbn0gUmVmZXJlbmNlI3RhaW50ZWRcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMudGFpbnRlZCA9IGZhbHNlO1xuICAgICAgICAvKipcbiAgICAgICAgICogVGhlIHZhcmlhYmxlIHRoaXMgcmVmZXJlbmNlIGlzIHJlc29sdmVkIHdpdGguXG4gICAgICAgICAqIEBtZW1iZXIge1ZhcmlhYmxlfSBSZWZlcmVuY2UjcmVzb2x2ZWRcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMucmVzb2x2ZWQgPSBudWxsO1xuICAgICAgICAvKipcbiAgICAgICAgICogVGhlIHJlYWQtd3JpdGUgbW9kZSBvZiB0aGUgcmVmZXJlbmNlLiAoVmFsdWUgaXMgb25lIG9mIHtAbGlua1xuICAgICAgICAgKiBSZWZlcmVuY2UuUkVBRH0sIHtAbGluayBSZWZlcmVuY2UuUld9LCB7QGxpbmsgUmVmZXJlbmNlLldSSVRFfSkuXG4gICAgICAgICAqIEBtZW1iZXIge251bWJlcn0gUmVmZXJlbmNlI2ZsYWdcbiAgICAgICAgICogQHByaXZhdGVcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMuZmxhZyA9IGZsYWc7XG4gICAgICAgIGlmICh0aGlzLmlzV3JpdGUoKSkge1xuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBJZiByZWZlcmVuY2UgaXMgd3JpdGVhYmxlLCB0aGlzIGlzIHRoZSB0cmVlIGJlaW5nIHdyaXR0ZW4gdG8gaXQuXG4gICAgICAgICAgICAgKiBAbWVtYmVyIHtlc3ByaW1hI05vZGV9IFJlZmVyZW5jZSN3cml0ZUV4cHJcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgdGhpcy53cml0ZUV4cHIgPSB3cml0ZUV4cHI7XG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIFdoZXRoZXIgdGhlIFJlZmVyZW5jZSBtaWdodCByZWZlciB0byBhIHBhcnRpYWwgdmFsdWUgb2Ygd3JpdGVFeHByLlxuICAgICAgICAgICAgICogQG1lbWJlciB7Ym9vbGVhbn0gUmVmZXJlbmNlI3BhcnRpYWxcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgdGhpcy5wYXJ0aWFsID0gcGFydGlhbDtcbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogV2hldGhlciB0aGUgUmVmZXJlbmNlIGlzIHRvIHdyaXRlIG9mIGluaXRpYWxpemF0aW9uLlxuICAgICAgICAgICAgICogQG1lbWJlciB7Ym9vbGVhbn0gUmVmZXJlbmNlI2luaXRcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgdGhpcy5pbml0ID0gaW5pdDtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLl9fbWF5YmVJbXBsaWNpdEdsb2JhbCA9IG1heWJlSW1wbGljaXRHbG9iYWw7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogV2hldGhlciB0aGUgcmVmZXJlbmNlIGlzIHN0YXRpYy5cbiAgICAgKiBAbWV0aG9kIFJlZmVyZW5jZSNpc1N0YXRpY1xuICAgICAqIEByZXR1cm4ge2Jvb2xlYW59XG4gICAgICovXG4gICAgaXNTdGF0aWMoKSB7XG4gICAgICAgIHJldHVybiAhdGhpcy50YWludGVkICYmIHRoaXMucmVzb2x2ZWQgJiYgdGhpcy5yZXNvbHZlZC5zY29wZS5pc1N0YXRpYygpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFdoZXRoZXIgdGhlIHJlZmVyZW5jZSBpcyB3cml0ZWFibGUuXG4gICAgICogQG1ldGhvZCBSZWZlcmVuY2UjaXNXcml0ZVxuICAgICAqIEByZXR1cm4ge2Jvb2xlYW59XG4gICAgICovXG4gICAgaXNXcml0ZSgpIHtcbiAgICAgICAgcmV0dXJuICEhKHRoaXMuZmxhZyAmIFJlZmVyZW5jZS5XUklURSk7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogV2hldGhlciB0aGUgcmVmZXJlbmNlIGlzIHJlYWRhYmxlLlxuICAgICAqIEBtZXRob2QgUmVmZXJlbmNlI2lzUmVhZFxuICAgICAqIEByZXR1cm4ge2Jvb2xlYW59XG4gICAgICovXG4gICAgaXNSZWFkKCkge1xuICAgICAgICByZXR1cm4gISEodGhpcy5mbGFnICYgUmVmZXJlbmNlLlJFQUQpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFdoZXRoZXIgdGhlIHJlZmVyZW5jZSBpcyByZWFkLW9ubHkuXG4gICAgICogQG1ldGhvZCBSZWZlcmVuY2UjaXNSZWFkT25seVxuICAgICAqIEByZXR1cm4ge2Jvb2xlYW59XG4gICAgICovXG4gICAgaXNSZWFkT25seSgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZmxhZyA9PT0gUmVmZXJlbmNlLlJFQUQ7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogV2hldGhlciB0aGUgcmVmZXJlbmNlIGlzIHdyaXRlLW9ubHkuXG4gICAgICogQG1ldGhvZCBSZWZlcmVuY2UjaXNXcml0ZU9ubHlcbiAgICAgKiBAcmV0dXJuIHtib29sZWFufVxuICAgICAqL1xuICAgIGlzV3JpdGVPbmx5KCkge1xuICAgICAgICByZXR1cm4gdGhpcy5mbGFnID09PSBSZWZlcmVuY2UuV1JJVEU7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogV2hldGhlciB0aGUgcmVmZXJlbmNlIGlzIHJlYWQtd3JpdGUuXG4gICAgICogQG1ldGhvZCBSZWZlcmVuY2UjaXNSZWFkV3JpdGVcbiAgICAgKiBAcmV0dXJuIHtib29sZWFufVxuICAgICAqL1xuICAgIGlzUmVhZFdyaXRlKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5mbGFnID09PSBSZWZlcmVuY2UuUlc7XG4gICAgfVxufVxuXG4vKipcbiAqIEBjb25zdGFudCBSZWZlcmVuY2UuUkVBRFxuICogQHByaXZhdGVcbiAqL1xuUmVmZXJlbmNlLlJFQUQgPSBSRUFEO1xuLyoqXG4gKiBAY29uc3RhbnQgUmVmZXJlbmNlLldSSVRFXG4gKiBAcHJpdmF0ZVxuICovXG5SZWZlcmVuY2UuV1JJVEUgPSBXUklURTtcbi8qKlxuICogQGNvbnN0YW50IFJlZmVyZW5jZS5SV1xuICogQHByaXZhdGVcbiAqL1xuUmVmZXJlbmNlLlJXID0gUlc7XG5cbi8qIHZpbTogc2V0IHN3PTQgdHM9NCBldCB0dz04MCA6ICovXG4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
      \ No newline at end of file
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJlZmVyZW5jZS5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBd0JBLElBQU0sT0FBTyxHQUFQO0FBQ04sSUFBTSxRQUFRLEdBQVI7QUFDTixJQUFNLEtBQUssT0FBTyxLQUFQOzs7Ozs7O0lBTVU7QUFDakIsV0FEaUIsU0FDakIsQ0FBWSxLQUFaLEVBQW1CLEtBQW5CLEVBQTBCLElBQTFCLEVBQWlDLFNBQWpDLEVBQTRDLG1CQUE1QyxFQUFpRSxPQUFqRSxFQUEwRSxJQUExRSxFQUFnRjswQkFEL0QsV0FDK0Q7Ozs7OztBQUs1RSxTQUFLLFVBQUwsR0FBa0IsS0FBbEI7Ozs7O0FBTDRFLFFBVTVFLENBQUssSUFBTCxHQUFZLEtBQVo7Ozs7OztBQVY0RSxRQWdCNUUsQ0FBSyxPQUFMLEdBQWUsS0FBZjs7Ozs7QUFoQjRFLFFBcUI1RSxDQUFLLFFBQUwsR0FBZ0IsSUFBaEI7Ozs7Ozs7QUFyQjRFLFFBNEI1RSxDQUFLLElBQUwsR0FBWSxJQUFaLENBNUI0RTtBQTZCNUUsUUFBSSxLQUFLLE9BQUwsRUFBSixFQUFvQjs7Ozs7QUFLaEIsV0FBSyxTQUFMLEdBQWlCLFNBQWpCOzs7OztBQUxnQixVQVVoQixDQUFLLE9BQUwsR0FBZSxPQUFmOzs7OztBQVZnQixVQWVoQixDQUFLLElBQUwsR0FBWSxJQUFaLENBZmdCO0tBQXBCO0FBaUJBLFNBQUsscUJBQUwsR0FBNkIsbUJBQTdCLENBOUM0RTtHQUFoRjs7Ozs7Ozs7O2VBRGlCOzsrQkF1RE47QUFDUCxhQUFPLENBQUMsS0FBSyxPQUFMLElBQWdCLEtBQUssUUFBTCxJQUFpQixLQUFLLFFBQUwsQ0FBYyxLQUFkLENBQW9CLFFBQXBCLEVBQWxDLENBREE7Ozs7Ozs7Ozs7OzhCQVNEO0FBQ04sYUFBTyxDQUFDLEVBQUUsS0FBSyxJQUFMLEdBQVksVUFBVSxLQUFWLENBQWQsQ0FERjs7Ozs7Ozs7Ozs7NkJBU0Q7QUFDTCxhQUFPLENBQUMsRUFBRSxLQUFLLElBQUwsR0FBWSxVQUFVLElBQVYsQ0FBZCxDQURIOzs7Ozs7Ozs7OztpQ0FTSTtBQUNULGFBQU8sS0FBSyxJQUFMLEtBQWMsVUFBVSxJQUFWLENBRFo7Ozs7Ozs7Ozs7O2tDQVNDO0FBQ1YsYUFBTyxLQUFLLElBQUwsS0FBYyxVQUFVLEtBQVYsQ0FEWDs7Ozs7Ozs7Ozs7a0NBU0E7QUFDVixhQUFPLEtBQUssSUFBTCxLQUFjLFVBQVUsRUFBVixDQURYOzs7O1NBcEdHOzs7Ozs7Ozs7O0FBNkdyQixVQUFVLElBQVYsR0FBaUIsSUFBakI7Ozs7O0FBS0EsVUFBVSxLQUFWLEdBQWtCLEtBQWxCOzs7OztBQUtBLFVBQVUsRUFBVixHQUFlLEVBQWYiLCJmaWxlIjoicmVmZXJlbmNlLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLypcbiAgQ29weXJpZ2h0IChDKSAyMDE1IFl1c3VrZSBTdXp1a2kgPHV0YXRhbmUudGVhQGdtYWlsLmNvbT5cblxuICBSZWRpc3RyaWJ1dGlvbiBhbmQgdXNlIGluIHNvdXJjZSBhbmQgYmluYXJ5IGZvcm1zLCB3aXRoIG9yIHdpdGhvdXRcbiAgbW9kaWZpY2F0aW9uLCBhcmUgcGVybWl0dGVkIHByb3ZpZGVkIHRoYXQgdGhlIGZvbGxvd2luZyBjb25kaXRpb25zIGFyZSBtZXQ6XG5cbiAgICAqIFJlZGlzdHJpYnV0aW9ucyBvZiBzb3VyY2UgY29kZSBtdXN0IHJldGFpbiB0aGUgYWJvdmUgY29weXJpZ2h0XG4gICAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIuXG4gICAgKiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodFxuICAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyIGluIHRoZVxuICAgICAgZG9jdW1lbnRhdGlvbiBhbmQvb3Igb3RoZXIgbWF0ZXJpYWxzIHByb3ZpZGVkIHdpdGggdGhlIGRpc3RyaWJ1dGlvbi5cblxuICBUSElTIFNPRlRXQVJFIElTIFBST1ZJREVEIEJZIFRIRSBDT1BZUklHSFQgSE9MREVSUyBBTkQgQ09OVFJJQlVUT1JTIFwiQVMgSVNcIlxuICBBTkQgQU5ZIEVYUFJFU1MgT1IgSU1QTElFRCBXQVJSQU5USUVTLCBJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgVEhFXG4gIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFXG4gIEFSRSBESVNDTEFJTUVELiBJTiBOTyBFVkVOVCBTSEFMTCA8Q09QWVJJR0hUIEhPTERFUj4gQkUgTElBQkxFIEZPUiBBTllcbiAgRElSRUNULCBJTkRJUkVDVCwgSU5DSURFTlRBTCwgU1BFQ0lBTCwgRVhFTVBMQVJZLCBPUiBDT05TRVFVRU5USUFMIERBTUFHRVNcbiAgKElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTO1xuICBMT1NTIE9GIFVTRSwgREFUQSwgT1IgUFJPRklUUzsgT1IgQlVTSU5FU1MgSU5URVJSVVBUSU9OKSBIT1dFVkVSIENBVVNFRCBBTkRcbiAgT04gQU5ZIFRIRU9SWSBPRiBMSUFCSUxJVFksIFdIRVRIRVIgSU4gQ09OVFJBQ1QsIFNUUklDVCBMSUFCSUxJVFksIE9SIFRPUlRcbiAgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFIE9GXG4gIFRISVMgU09GVFdBUkUsIEVWRU4gSUYgQURWSVNFRCBPRiBUSEUgUE9TU0lCSUxJVFkgT0YgU1VDSCBEQU1BR0UuXG4qL1xuXG5jb25zdCBSRUFEID0gMHgxO1xuY29uc3QgV1JJVEUgPSAweDI7XG5jb25zdCBSVyA9IFJFQUQgfCBXUklURTtcblxuLyoqXG4gKiBBIFJlZmVyZW5jZSByZXByZXNlbnRzIGEgc2luZ2xlIG9jY3VycmVuY2Ugb2YgYW4gaWRlbnRpZmllciBpbiBjb2RlLlxuICogQGNsYXNzIFJlZmVyZW5jZVxuICovXG5leHBvcnQgZGVmYXVsdCBjbGFzcyBSZWZlcmVuY2Uge1xuICAgIGNvbnN0cnVjdG9yKGlkZW50LCBzY29wZSwgZmxhZywgIHdyaXRlRXhwciwgbWF5YmVJbXBsaWNpdEdsb2JhbCwgcGFydGlhbCwgaW5pdCkge1xuICAgICAgICAvKipcbiAgICAgICAgICogSWRlbnRpZmllciBzeW50YXggbm9kZS5cbiAgICAgICAgICogQG1lbWJlciB7ZXNwcmltYSNJZGVudGlmaWVyfSBSZWZlcmVuY2UjaWRlbnRpZmllclxuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5pZGVudGlmaWVyID0gaWRlbnQ7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBSZWZlcmVuY2UgdG8gdGhlIGVuY2xvc2luZyBTY29wZS5cbiAgICAgICAgICogQG1lbWJlciB7U2NvcGV9IFJlZmVyZW5jZSNmcm9tXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLmZyb20gPSBzY29wZTtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIFdoZXRoZXIgdGhlIHJlZmVyZW5jZSBjb21lcyBmcm9tIGEgZHluYW1pYyBzY29wZSAoc3VjaCBhcyAnZXZhbCcsXG4gICAgICAgICAqICd3aXRoJywgZXRjLiksIGFuZCBtYXkgYmUgdHJhcHBlZCBieSBkeW5hbWljIHNjb3Blcy5cbiAgICAgICAgICogQG1lbWJlciB7Ym9vbGVhbn0gUmVmZXJlbmNlI3RhaW50ZWRcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMudGFpbnRlZCA9IGZhbHNlO1xuICAgICAgICAvKipcbiAgICAgICAgICogVGhlIHZhcmlhYmxlIHRoaXMgcmVmZXJlbmNlIGlzIHJlc29sdmVkIHdpdGguXG4gICAgICAgICAqIEBtZW1iZXIge1ZhcmlhYmxlfSBSZWZlcmVuY2UjcmVzb2x2ZWRcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMucmVzb2x2ZWQgPSBudWxsO1xuICAgICAgICAvKipcbiAgICAgICAgICogVGhlIHJlYWQtd3JpdGUgbW9kZSBvZiB0aGUgcmVmZXJlbmNlLiAoVmFsdWUgaXMgb25lIG9mIHtAbGlua1xuICAgICAgICAgKiBSZWZlcmVuY2UuUkVBRH0sIHtAbGluayBSZWZlcmVuY2UuUld9LCB7QGxpbmsgUmVmZXJlbmNlLldSSVRFfSkuXG4gICAgICAgICAqIEBtZW1iZXIge251bWJlcn0gUmVmZXJlbmNlI2ZsYWdcbiAgICAgICAgICogQHByaXZhdGVcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMuZmxhZyA9IGZsYWc7XG4gICAgICAgIGlmICh0aGlzLmlzV3JpdGUoKSkge1xuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBJZiByZWZlcmVuY2UgaXMgd3JpdGVhYmxlLCB0aGlzIGlzIHRoZSB0cmVlIGJlaW5nIHdyaXR0ZW4gdG8gaXQuXG4gICAgICAgICAgICAgKiBAbWVtYmVyIHtlc3ByaW1hI05vZGV9IFJlZmVyZW5jZSN3cml0ZUV4cHJcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgdGhpcy53cml0ZUV4cHIgPSB3cml0ZUV4cHI7XG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIFdoZXRoZXIgdGhlIFJlZmVyZW5jZSBtaWdodCByZWZlciB0byBhIHBhcnRpYWwgdmFsdWUgb2Ygd3JpdGVFeHByLlxuICAgICAgICAgICAgICogQG1lbWJlciB7Ym9vbGVhbn0gUmVmZXJlbmNlI3BhcnRpYWxcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgdGhpcy5wYXJ0aWFsID0gcGFydGlhbDtcbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogV2hldGhlciB0aGUgUmVmZXJlbmNlIGlzIHRvIHdyaXRlIG9mIGluaXRpYWxpemF0aW9uLlxuICAgICAgICAgICAgICogQG1lbWJlciB7Ym9vbGVhbn0gUmVmZXJlbmNlI2luaXRcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgdGhpcy5pbml0ID0gaW5pdDtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLl9fbWF5YmVJbXBsaWNpdEdsb2JhbCA9IG1heWJlSW1wbGljaXRHbG9iYWw7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogV2hldGhlciB0aGUgcmVmZXJlbmNlIGlzIHN0YXRpYy5cbiAgICAgKiBAbWV0aG9kIFJlZmVyZW5jZSNpc1N0YXRpY1xuICAgICAqIEByZXR1cm4ge2Jvb2xlYW59XG4gICAgICovXG4gICAgaXNTdGF0aWMoKSB7XG4gICAgICAgIHJldHVybiAhdGhpcy50YWludGVkICYmIHRoaXMucmVzb2x2ZWQgJiYgdGhpcy5yZXNvbHZlZC5zY29wZS5pc1N0YXRpYygpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFdoZXRoZXIgdGhlIHJlZmVyZW5jZSBpcyB3cml0ZWFibGUuXG4gICAgICogQG1ldGhvZCBSZWZlcmVuY2UjaXNXcml0ZVxuICAgICAqIEByZXR1cm4ge2Jvb2xlYW59XG4gICAgICovXG4gICAgaXNXcml0ZSgpIHtcbiAgICAgICAgcmV0dXJuICEhKHRoaXMuZmxhZyAmIFJlZmVyZW5jZS5XUklURSk7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogV2hldGhlciB0aGUgcmVmZXJlbmNlIGlzIHJlYWRhYmxlLlxuICAgICAqIEBtZXRob2QgUmVmZXJlbmNlI2lzUmVhZFxuICAgICAqIEByZXR1cm4ge2Jvb2xlYW59XG4gICAgICovXG4gICAgaXNSZWFkKCkge1xuICAgICAgICByZXR1cm4gISEodGhpcy5mbGFnICYgUmVmZXJlbmNlLlJFQUQpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFdoZXRoZXIgdGhlIHJlZmVyZW5jZSBpcyByZWFkLW9ubHkuXG4gICAgICogQG1ldGhvZCBSZWZlcmVuY2UjaXNSZWFkT25seVxuICAgICAqIEByZXR1cm4ge2Jvb2xlYW59XG4gICAgICovXG4gICAgaXNSZWFkT25seSgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZmxhZyA9PT0gUmVmZXJlbmNlLlJFQUQ7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogV2hldGhlciB0aGUgcmVmZXJlbmNlIGlzIHdyaXRlLW9ubHkuXG4gICAgICogQG1ldGhvZCBSZWZlcmVuY2UjaXNXcml0ZU9ubHlcbiAgICAgKiBAcmV0dXJuIHtib29sZWFufVxuICAgICAqL1xuICAgIGlzV3JpdGVPbmx5KCkge1xuICAgICAgICByZXR1cm4gdGhpcy5mbGFnID09PSBSZWZlcmVuY2UuV1JJVEU7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogV2hldGhlciB0aGUgcmVmZXJlbmNlIGlzIHJlYWQtd3JpdGUuXG4gICAgICogQG1ldGhvZCBSZWZlcmVuY2UjaXNSZWFkV3JpdGVcbiAgICAgKiBAcmV0dXJuIHtib29sZWFufVxuICAgICAqL1xuICAgIGlzUmVhZFdyaXRlKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5mbGFnID09PSBSZWZlcmVuY2UuUlc7XG4gICAgfVxufVxuXG4vKipcbiAqIEBjb25zdGFudCBSZWZlcmVuY2UuUkVBRFxuICogQHByaXZhdGVcbiAqL1xuUmVmZXJlbmNlLlJFQUQgPSBSRUFEO1xuLyoqXG4gKiBAY29uc3RhbnQgUmVmZXJlbmNlLldSSVRFXG4gKiBAcHJpdmF0ZVxuICovXG5SZWZlcmVuY2UuV1JJVEUgPSBXUklURTtcbi8qKlxuICogQGNvbnN0YW50IFJlZmVyZW5jZS5SV1xuICogQHByaXZhdGVcbiAqL1xuUmVmZXJlbmNlLlJXID0gUlc7XG5cbi8qIHZpbTogc2V0IHN3PTQgdHM9NCBldCB0dz04MCA6ICovXG4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
      diff --git a/tools/eslint/node_modules/escope/lib/referencer.js b/tools/eslint/node_modules/escope/lib/referencer.js
      index 09f59918045ec7..ca04eaa451c9a4 100644
      --- a/tools/eslint/node_modules/escope/lib/referencer.js
      +++ b/tools/eslint/node_modules/escope/lib/referencer.js
      @@ -1,193 +1,69 @@
      -"use strict";
      +'use strict';
       
      -var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
      +Object.defineProperty(exports, "__esModule", {
      +    value: true
      +});
       
      -var _createClass = (function () { function defineProperties(target, props) { for (var key in props) { var prop = props[key]; prop.configurable = true; if (prop.value) prop.writable = true; } Object.defineProperties(target, props); } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
      +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
       
      -var _get = function get(object, property, receiver) { var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc && desc.writable) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
      +var _estraverse = require('estraverse');
       
      -var _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; };
      +var _esrecurse = require('esrecurse');
       
      -var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
      +var _esrecurse2 = _interopRequireDefault(_esrecurse);
       
      -/*
      -  Copyright (C) 2015 Yusuke Suzuki 
      +var _reference = require('./reference');
       
      -  Redistribution and use in source and binary forms, with or without
      -  modification, are permitted provided that the following conditions are met:
      +var _reference2 = _interopRequireDefault(_reference);
       
      -    * Redistributions of source code must retain the above copyright
      -      notice, this list of conditions and the following disclaimer.
      -    * Redistributions in binary form must reproduce the above copyright
      -      notice, this list of conditions and the following disclaimer in the
      -      documentation and/or other materials provided with the distribution.
      +var _variable = require('./variable');
       
      -  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
      -  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      -  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      -  ARE DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
      -  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
      -  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
      -  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      -  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      -  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
      -  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      -*/
      +var _variable2 = _interopRequireDefault(_variable);
       
      -var Syntax = require("estraverse").Syntax;
      +var _patternVisitor = require('./pattern-visitor');
       
      -var esrecurse = _interopRequire(require("esrecurse"));
      +var _patternVisitor2 = _interopRequireDefault(_patternVisitor);
       
      -var Reference = _interopRequire(require("./reference"));
      +var _definition = require('./definition');
       
      -var Variable = _interopRequire(require("./variable"));
      +var _assert = require('assert');
       
      -var _definition = require("./definition");
      +var _assert2 = _interopRequireDefault(_assert);
       
      -var ParameterDefinition = _definition.ParameterDefinition;
      -var Definition = _definition.Definition;
      +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
       
      -var assert = _interopRequire(require("assert"));
      +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
       
      -var PatternVisitor = (function (_esrecurse$Visitor) {
      -    function PatternVisitor(rootPattern, callback) {
      -        _classCallCheck(this, PatternVisitor);
      +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
       
      -        _get(Object.getPrototypeOf(PatternVisitor.prototype), "constructor", this).call(this);
      -        this.rootPattern = rootPattern;
      -        this.callback = callback;
      -        this.assignments = [];
      -        this.rightHandNodes = [];
      -        this.restElements = [];
      -    }
      +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /*
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 Copyright (C) 2015 Yusuke Suzuki 
       
      -    _inherits(PatternVisitor, _esrecurse$Visitor);
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 Redistribution and use in source and binary forms, with or without
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 modification, are permitted provided that the following conditions are met:
       
      -    _createClass(PatternVisitor, {
      -        Identifier: {
      -            value: function Identifier(pattern) {
      -                var lastRestElement = getLast(this.restElements);
      -                this.callback(pattern, {
      -                    topLevel: pattern === this.rootPattern,
      -                    rest: lastRestElement != null && lastRestElement.argument === pattern,
      -                    assignments: this.assignments
      -                });
      -            }
      -        },
      -        ObjectPattern: {
      -            value: function ObjectPattern(pattern) {
      -                var i, iz, property;
      -                for (i = 0, iz = pattern.properties.length; i < iz; ++i) {
      -                    property = pattern.properties[i];
      -
      -                    // Computed property's key is a right hand node.
      -                    if (property.computed) {
      -                        this.rightHandNodes.push(property.key);
      -                    }
      -
      -                    // If it's shorthand, its key is same as its value.
      -                    // If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern).
      -                    // If it's not shorthand, the name of new variable is its value's.
      -                    this.visit(property.value);
      -                }
      -            }
      -        },
      -        ArrayPattern: {
      -            value: function ArrayPattern(pattern) {
      -                var i, iz, element;
      -                for (i = 0, iz = pattern.elements.length; i < iz; ++i) {
      -                    element = pattern.elements[i];
      -                    this.visit(element);
      -                }
      -            }
      -        },
      -        AssignmentPattern: {
      -            value: function AssignmentPattern(pattern) {
      -                this.assignments.push(pattern);
      -                this.visit(pattern.left);
      -                this.rightHandNodes.push(pattern.right);
      -                this.assignments.pop();
      -            }
      -        },
      -        RestElement: {
      -            value: function RestElement(pattern) {
      -                this.restElements.push(pattern);
      -                this.visit(pattern.argument);
      -                this.restElements.pop();
      -            }
      -        },
      -        MemberExpression: {
      -            value: function MemberExpression(node) {
      -                // Computed property's key is a right hand node.
      -                if (node.computed) {
      -                    this.rightHandNodes.push(node.property);
      -                }
      -                // the object is only read, write to its property.
      -                this.rightHandNodes.push(node.object);
      -            }
      -        },
      -        SpreadElement: {
      -
      -            //
      -            // ForInStatement.left and AssignmentExpression.left are LeftHandSideExpression.
      -            // By spec, LeftHandSideExpression is Pattern or MemberExpression.
      -            //   (see also: https://github.com/estree/estree/pull/20#issuecomment-74584758)
      -            // But espree 2.0 and esprima 2.0 parse to ArrayExpression, ObjectExpression, etc...
      -            //
      -
      -            value: function SpreadElement(node) {
      -                this.visit(node.argument);
      -            }
      -        },
      -        ArrayExpression: {
      -            value: function ArrayExpression(node) {
      -                node.elements.forEach(this.visit, this);
      -            }
      -        },
      -        ObjectExpression: {
      -            value: function ObjectExpression(node) {
      -                var _this = this;
      -
      -                node.properties.forEach(function (property) {
      -                    // Computed property's key is a right hand node.
      -                    if (property.computed) {
      -                        _this.rightHandNodes.push(property.key);
      -                    }
      -                    _this.visit(property.value);
      -                });
      -            }
      -        },
      -        AssignmentExpression: {
      -            value: function AssignmentExpression(node) {
      -                this.assignments.push(node);
      -                this.visit(node.left);
      -                this.rightHandNodes.push(node.right);
      -                this.assignments.pop();
      -            }
      -        },
      -        CallExpression: {
      -            value: function CallExpression(node) {
      -                var _this = this;
      -
      -                // arguments are right hand nodes.
      -                node.arguments.forEach(function (a) {
      -                    _this.rightHandNodes.push(a);
      -                });
      -                this.visit(node.callee);
      -            }
      -        }
      -    });
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   * Redistributions of source code must retain the above copyright
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     notice, this list of conditions and the following disclaimer.
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   * Redistributions in binary form must reproduce the above copyright
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     notice, this list of conditions and the following disclaimer in the
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     documentation and/or other materials provided with the distribution.
       
      -    return PatternVisitor;
      -})(esrecurse.Visitor);
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ARE DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               */
       
      -function getLast(xs) {
      -    return xs[xs.length - 1] || null;
      -}
       
      -function traverseIdentifierInPattern(rootPattern, referencer, callback) {
      +function traverseIdentifierInPattern(options, rootPattern, referencer, callback) {
           // Call the callback at left hand identifier nodes, and Collect right hand nodes.
      -    var visitor = new PatternVisitor(rootPattern, callback);
      +    var visitor = new _patternVisitor2.default(options, rootPattern, callback);
           visitor.visit(rootPattern);
       
           // Process the right hand nodes recursively.
      @@ -196,559 +72,568 @@ function traverseIdentifierInPattern(rootPattern, referencer, callback) {
           }
       }
       
      -function isPattern(node) {
      -    var nodeType = node.type;
      -    return nodeType === Syntax.Identifier || nodeType === Syntax.ObjectPattern || nodeType === Syntax.ArrayPattern || nodeType === Syntax.SpreadElement || nodeType === Syntax.RestElement || nodeType === Syntax.AssignmentPattern;
      -}
      -
       // Importing ImportDeclaration.
       // http://people.mozilla.org/~jorendorff/es6-draft.html#sec-moduledeclarationinstantiation
       // https://github.com/estree/estree/blob/master/es6.md#importdeclaration
       // FIXME: Now, we don't create module environment, because the context is
       // implementation dependent.
       
      -var Importer = (function (_esrecurse$Visitor2) {
      +var Importer = function (_esrecurse$Visitor) {
      +    _inherits(Importer, _esrecurse$Visitor);
      +
           function Importer(declaration, referencer) {
               _classCallCheck(this, Importer);
       
      -        _get(Object.getPrototypeOf(Importer.prototype), "constructor", this).call(this);
      -        this.declaration = declaration;
      -        this.referencer = referencer;
      -    }
      +        var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Importer).call(this, null, referencer.options));
       
      -    _inherits(Importer, _esrecurse$Visitor2);
      +        _this.declaration = declaration;
      +        _this.referencer = referencer;
      +        return _this;
      +    }
       
      -    _createClass(Importer, {
      -        visitImport: {
      -            value: function visitImport(id, specifier) {
      -                var _this = this;
      +    _createClass(Importer, [{
      +        key: 'visitImport',
      +        value: function visitImport(id, specifier) {
      +            var _this2 = this;
       
      -                this.referencer.visitPattern(id, function (pattern) {
      -                    _this.referencer.currentScope().__define(pattern, new Definition(Variable.ImportBinding, pattern, specifier, _this.declaration, null, null));
      -                });
      -            }
      -        },
      -        ImportNamespaceSpecifier: {
      -            value: function ImportNamespaceSpecifier(node) {
      -                var local = node.local || node.id;
      -                if (local) {
      -                    this.visitImport(local, node);
      -                }
      -            }
      -        },
      -        ImportDefaultSpecifier: {
      -            value: function ImportDefaultSpecifier(node) {
      -                var local = node.local || node.id;
      +            this.referencer.visitPattern(id, function (pattern) {
      +                _this2.referencer.currentScope().__define(pattern, new _definition.Definition(_variable2.default.ImportBinding, pattern, specifier, _this2.declaration, null, null));
      +            });
      +        }
      +    }, {
      +        key: 'ImportNamespaceSpecifier',
      +        value: function ImportNamespaceSpecifier(node) {
      +            var local = node.local || node.id;
      +            if (local) {
                       this.visitImport(local, node);
                   }
      -        },
      -        ImportSpecifier: {
      -            value: function ImportSpecifier(node) {
      -                var local = node.local || node.id;
      -                if (node.name) {
      -                    this.visitImport(node.name, node);
      -                } else {
      -                    this.visitImport(local, node);
      -                }
      +        }
      +    }, {
      +        key: 'ImportDefaultSpecifier',
      +        value: function ImportDefaultSpecifier(node) {
      +            var local = node.local || node.id;
      +            this.visitImport(local, node);
      +        }
      +    }, {
      +        key: 'ImportSpecifier',
      +        value: function ImportSpecifier(node) {
      +            var local = node.local || node.id;
      +            if (node.name) {
      +                this.visitImport(node.name, node);
      +            } else {
      +                this.visitImport(local, node);
                   }
               }
      -    });
      +    }]);
       
           return Importer;
      -})(esrecurse.Visitor);
      +}(_esrecurse2.default.Visitor);
       
       // Referencing variables and creating bindings.
       
      -var Referencer = (function (_esrecurse$Visitor3) {
      -    function Referencer(scopeManager) {
      +
      +var Referencer = function (_esrecurse$Visitor2) {
      +    _inherits(Referencer, _esrecurse$Visitor2);
      +
      +    function Referencer(options, scopeManager) {
               _classCallCheck(this, Referencer);
       
      -        _get(Object.getPrototypeOf(Referencer.prototype), "constructor", this).call(this);
      -        this.scopeManager = scopeManager;
      -        this.parent = null;
      -        this.isInnerMethodDefinition = false;
      -    }
      +        var _this3 = _possibleConstructorReturn(this, Object.getPrototypeOf(Referencer).call(this, null, options));
       
      -    _inherits(Referencer, _esrecurse$Visitor3);
      +        _this3.options = options;
      +        _this3.scopeManager = scopeManager;
      +        _this3.parent = null;
      +        _this3.isInnerMethodDefinition = false;
      +        return _this3;
      +    }
       
      -    _createClass(Referencer, {
      -        currentScope: {
      -            value: function currentScope() {
      -                return this.scopeManager.__currentScope;
      -            }
      -        },
      -        close: {
      -            value: function close(node) {
      -                while (this.currentScope() && node === this.currentScope().block) {
      -                    this.scopeManager.__currentScope = this.currentScope().__close(this.scopeManager);
      -                }
      -            }
      -        },
      -        pushInnerMethodDefinition: {
      -            value: function pushInnerMethodDefinition(isInnerMethodDefinition) {
      -                var previous = this.isInnerMethodDefinition;
      -                this.isInnerMethodDefinition = isInnerMethodDefinition;
      -                return previous;
      +    _createClass(Referencer, [{
      +        key: 'currentScope',
      +        value: function currentScope() {
      +            return this.scopeManager.__currentScope;
      +        }
      +    }, {
      +        key: 'close',
      +        value: function close(node) {
      +            while (this.currentScope() && node === this.currentScope().block) {
      +                this.scopeManager.__currentScope = this.currentScope().__close(this.scopeManager);
                   }
      -        },
      -        popInnerMethodDefinition: {
      -            value: function popInnerMethodDefinition(isInnerMethodDefinition) {
      -                this.isInnerMethodDefinition = isInnerMethodDefinition;
      +        }
      +    }, {
      +        key: 'pushInnerMethodDefinition',
      +        value: function pushInnerMethodDefinition(isInnerMethodDefinition) {
      +            var previous = this.isInnerMethodDefinition;
      +            this.isInnerMethodDefinition = isInnerMethodDefinition;
      +            return previous;
      +        }
      +    }, {
      +        key: 'popInnerMethodDefinition',
      +        value: function popInnerMethodDefinition(isInnerMethodDefinition) {
      +            this.isInnerMethodDefinition = isInnerMethodDefinition;
      +        }
      +    }, {
      +        key: 'materializeTDZScope',
      +        value: function materializeTDZScope(node, iterationNode) {
      +            // http://people.mozilla.org/~jorendorff/es6-draft.html#sec-runtime-semantics-forin-div-ofexpressionevaluation-abstract-operation
      +            // TDZ scope hides the declaration's names.
      +            this.scopeManager.__nestTDZScope(node, iterationNode);
      +            this.visitVariableDeclaration(this.currentScope(), _variable2.default.TDZ, iterationNode.left, 0, true);
      +        }
      +    }, {
      +        key: 'materializeIterationScope',
      +        value: function materializeIterationScope(node) {
      +            var _this4 = this;
      +
      +            // Generate iteration scope for upper ForIn/ForOf Statements.
      +            var letOrConstDecl;
      +            this.scopeManager.__nestForScope(node);
      +            letOrConstDecl = node.left;
      +            this.visitVariableDeclaration(this.currentScope(), _variable2.default.Variable, letOrConstDecl, 0);
      +            this.visitPattern(letOrConstDecl.declarations[0].id, function (pattern) {
      +                _this4.currentScope().__referencing(pattern, _reference2.default.WRITE, node.right, null, true, true);
      +            });
      +        }
      +    }, {
      +        key: 'referencingDefaultValue',
      +        value: function referencingDefaultValue(pattern, assignments, maybeImplicitGlobal, init) {
      +            var scope = this.currentScope();
      +            assignments.forEach(function (assignment) {
      +                scope.__referencing(pattern, _reference2.default.WRITE, assignment.right, maybeImplicitGlobal, pattern !== assignment.left, init);
      +            });
      +        }
      +    }, {
      +        key: 'visitPattern',
      +        value: function visitPattern(node, options, callback) {
      +            if (typeof options === 'function') {
      +                callback = options;
      +                options = { processRightHandNodes: false };
      +            }
      +            traverseIdentifierInPattern(this.options, node, options.processRightHandNodes ? this : null, callback);
      +        }
      +    }, {
      +        key: 'visitFunction',
      +        value: function visitFunction(node) {
      +            var _this5 = this;
      +
      +            var i, iz;
      +            // FunctionDeclaration name is defined in upper scope
      +            // NOTE: Not referring variableScope. It is intended.
      +            // Since
      +            //  in ES5, FunctionDeclaration should be in FunctionBody.
      +            //  in ES6, FunctionDeclaration should be block scoped.
      +            if (node.type === _estraverse.Syntax.FunctionDeclaration) {
      +                // id is defined in upper scope
      +                this.currentScope().__define(node.id, new _definition.Definition(_variable2.default.FunctionName, node.id, node, null, null, null));
                   }
      -        },
      -        materializeTDZScope: {
      -            value: function materializeTDZScope(node, iterationNode) {
      -                // http://people.mozilla.org/~jorendorff/es6-draft.html#sec-runtime-semantics-forin-div-ofexpressionevaluation-abstract-operation
      -                // TDZ scope hides the declaration's names.
      -                this.scopeManager.__nestTDZScope(node, iterationNode);
      -                this.visitVariableDeclaration(this.currentScope(), Variable.TDZ, iterationNode.left, 0, true);
      +
      +            // FunctionExpression with name creates its special scope;
      +            // FunctionExpressionNameScope.
      +            if (node.type === _estraverse.Syntax.FunctionExpression && node.id) {
      +                this.scopeManager.__nestFunctionExpressionNameScope(node);
                   }
      -        },
      -        materializeIterationScope: {
      -            value: function materializeIterationScope(node) {
      -                var _this = this;
       
      -                // Generate iteration scope for upper ForIn/ForOf Statements.
      -                var letOrConstDecl;
      -                this.scopeManager.__nestForScope(node);
      -                letOrConstDecl = node.left;
      -                this.visitVariableDeclaration(this.currentScope(), Variable.Variable, letOrConstDecl, 0);
      -                this.visitPattern(letOrConstDecl.declarations[0].id, function (pattern) {
      -                    _this.currentScope().__referencing(pattern, Reference.WRITE, node.right, null, true, true);
      +            // Consider this function is in the MethodDefinition.
      +            this.scopeManager.__nestFunctionScope(node, this.isInnerMethodDefinition);
      +
      +            // Process parameter declarations.
      +            for (i = 0, iz = node.params.length; i < iz; ++i) {
      +                this.visitPattern(node.params[i], { processRightHandNodes: true }, function (pattern, info) {
      +                    _this5.currentScope().__define(pattern, new _definition.ParameterDefinition(pattern, node, i, info.rest));
      +
      +                    _this5.referencingDefaultValue(pattern, info.assignments, null, true);
                       });
                   }
      -        },
      -        referencingDefaultValue: {
      -            value: function referencingDefaultValue(pattern, assignments, maybeImplicitGlobal, init) {
      -                var scope = this.currentScope();
      -                assignments.forEach(function (assignment) {
      -                    scope.__referencing(pattern, Reference.WRITE, assignment.right, maybeImplicitGlobal, pattern !== assignment.left, init);
      +
      +            // if there's a rest argument, add that
      +            if (node.rest) {
      +                this.visitPattern({
      +                    type: 'RestElement',
      +                    argument: node.rest
      +                }, function (pattern) {
      +                    _this5.currentScope().__define(pattern, new _definition.ParameterDefinition(pattern, node, node.params.length, true));
                       });
                   }
      -        },
      -        visitPattern: {
      -            value: function visitPattern(node, options, callback) {
      -                if (typeof options === "function") {
      -                    callback = options;
      -                    options = { processRightHandNodes: false };
      -                }
      -                traverseIdentifierInPattern(node, options.processRightHandNodes ? this : null, callback);
      -            }
      -        },
      -        visitFunction: {
      -            value: function visitFunction(node) {
      -                var _this = this;
      -
      -                var i, iz;
      -                // FunctionDeclaration name is defined in upper scope
      -                // NOTE: Not referring variableScope. It is intended.
      -                // Since
      -                //  in ES5, FunctionDeclaration should be in FunctionBody.
      -                //  in ES6, FunctionDeclaration should be block scoped.
      -                if (node.type === Syntax.FunctionDeclaration) {
      -                    // id is defined in upper scope
      -                    this.currentScope().__define(node.id, new Definition(Variable.FunctionName, node.id, node, null, null, null));
      -                }
      -
      -                // FunctionExpression with name creates its special scope;
      -                // FunctionExpressionNameScope.
      -                if (node.type === Syntax.FunctionExpression && node.id) {
      -                    this.scopeManager.__nestFunctionExpressionNameScope(node);
      -                }
       
      -                // Consider this function is in the MethodDefinition.
      -                this.scopeManager.__nestFunctionScope(node, this.isInnerMethodDefinition);
      +            // Skip BlockStatement to prevent creating BlockStatement scope.
      +            if (node.body.type === _estraverse.Syntax.BlockStatement) {
      +                this.visitChildren(node.body);
      +            } else {
      +                this.visit(node.body);
      +            }
       
      -                // Process parameter declarations.
      -                for (i = 0, iz = node.params.length; i < iz; ++i) {
      -                    this.visitPattern(node.params[i], { processRightHandNodes: true }, function (pattern, info) {
      -                        _this.currentScope().__define(pattern, new ParameterDefinition(pattern, node, i, info.rest));
      +            this.close(node);
      +        }
      +    }, {
      +        key: 'visitClass',
      +        value: function visitClass(node) {
      +            if (node.type === _estraverse.Syntax.ClassDeclaration) {
      +                this.currentScope().__define(node.id, new _definition.Definition(_variable2.default.ClassName, node.id, node, null, null, null));
      +            }
       
      -                        _this.referencingDefaultValue(pattern, info.assignments, null, true);
      -                    });
      -                }
      +            // FIXME: Maybe consider TDZ.
      +            this.visit(node.superClass);
       
      -                // if there's a rest argument, add that
      -                if (node.rest) {
      -                    this.visitPattern({
      -                        type: "RestElement",
      -                        argument: node.rest
      -                    }, function (pattern) {
      -                        _this.currentScope().__define(pattern, new ParameterDefinition(pattern, node, node.params.length, true));
      -                    });
      -                }
      +            this.scopeManager.__nestClassScope(node);
       
      -                // Skip BlockStatement to prevent creating BlockStatement scope.
      -                if (node.body.type === Syntax.BlockStatement) {
      -                    this.visitChildren(node.body);
      -                } else {
      -                    this.visit(node.body);
      -                }
      +            if (node.id) {
      +                this.currentScope().__define(node.id, new _definition.Definition(_variable2.default.ClassName, node.id, node));
      +            }
      +            this.visit(node.body);
       
      -                this.close(node);
      +            this.close(node);
      +        }
      +    }, {
      +        key: 'visitProperty',
      +        value: function visitProperty(node) {
      +            var previous, isMethodDefinition;
      +            if (node.computed) {
      +                this.visit(node.key);
                   }
      -        },
      -        visitClass: {
      -            value: function visitClass(node) {
      -                if (node.type === Syntax.ClassDeclaration) {
      -                    this.currentScope().__define(node.id, new Definition(Variable.ClassName, node.id, node, null, null, null));
      -                }
       
      -                // FIXME: Maybe consider TDZ.
      -                this.visit(node.superClass);
      +            isMethodDefinition = node.type === _estraverse.Syntax.MethodDefinition;
      +            if (isMethodDefinition) {
      +                previous = this.pushInnerMethodDefinition(true);
      +            }
      +            this.visit(node.value);
      +            if (isMethodDefinition) {
      +                this.popInnerMethodDefinition(previous);
      +            }
      +        }
      +    }, {
      +        key: 'visitForIn',
      +        value: function visitForIn(node) {
      +            var _this6 = this;
       
      -                this.scopeManager.__nestClassScope(node);
      +            if (node.left.type === _estraverse.Syntax.VariableDeclaration && node.left.kind !== 'var') {
      +                this.materializeTDZScope(node.right, node);
      +                this.visit(node.right);
      +                this.close(node.right);
       
      -                if (node.id) {
      -                    this.currentScope().__define(node.id, new Definition(Variable.ClassName, node.id, node));
      -                }
      +                this.materializeIterationScope(node);
                       this.visit(node.body);
      -
                       this.close(node);
      -            }
      -        },
      -        visitProperty: {
      -            value: function visitProperty(node) {
      -                var previous, isMethodDefinition;
      -                if (node.computed) {
      -                    this.visit(node.key);
      -                }
      -
      -                isMethodDefinition = node.type === Syntax.MethodDefinition || node.method;
      -                if (isMethodDefinition) {
      -                    previous = this.pushInnerMethodDefinition(true);
      -                }
      -                this.visit(node.value);
      -                if (isMethodDefinition) {
      -                    this.popInnerMethodDefinition(previous);
      -                }
      -            }
      -        },
      -        visitForIn: {
      -            value: function visitForIn(node) {
      -                var _this = this;
      -
      -                if (node.left.type === Syntax.VariableDeclaration && node.left.kind !== "var") {
      -                    this.materializeTDZScope(node.right, node);
      -                    this.visit(node.right);
      -                    this.close(node.right);
      -
      -                    this.materializeIterationScope(node);
      -                    this.visit(node.body);
      -                    this.close(node);
      -                } else {
      -                    if (node.left.type === Syntax.VariableDeclaration) {
      -                        this.visit(node.left);
      -                        this.visitPattern(node.left.declarations[0].id, function (pattern) {
      -                            _this.currentScope().__referencing(pattern, Reference.WRITE, node.right, null, true, true);
      -                        });
      -                    } else {
      -                        this.visitPattern(node.left, { processRightHandNodes: true }, function (pattern, info) {
      -                            var maybeImplicitGlobal = null;
      -                            if (!_this.currentScope().isStrict) {
      -                                maybeImplicitGlobal = {
      -                                    pattern: pattern,
      -                                    node: node
      -                                };
      -                            }
      -                            _this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false);
      -                            _this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, true, false);
      -                        });
      -                    }
      -                    this.visit(node.right);
      -                    this.visit(node.body);
      -                }
      -            }
      -        },
      -        visitVariableDeclaration: {
      -            value: function visitVariableDeclaration(variableTargetScope, type, node, index, fromTDZ) {
      -                var _this = this;
      -
      -                // If this was called to initialize a TDZ scope, this needs to make definitions, but doesn't make references.
      -                var decl, init;
      -
      -                decl = node.declarations[index];
      -                init = decl.init;
      -                this.visitPattern(decl.id, { processRightHandNodes: !fromTDZ }, function (pattern, info) {
      -                    variableTargetScope.__define(pattern, new Definition(type, pattern, decl, node, index, node.kind));
      -
      -                    if (!fromTDZ) {
      -                        _this.referencingDefaultValue(pattern, info.assignments, null, true);
      -                    }
      -                    if (init) {
      -                        _this.currentScope().__referencing(pattern, Reference.WRITE, init, null, !info.topLevel, true);
      -                    }
      -                });
      -            }
      -        },
      -        AssignmentExpression: {
      -            value: function AssignmentExpression(node) {
      -                var _this = this;
      -
      -                if (isPattern(node.left)) {
      -                    if (node.operator === "=") {
      -                        this.visitPattern(node.left, { processRightHandNodes: true }, function (pattern, info) {
      -                            var maybeImplicitGlobal = null;
      -                            if (!_this.currentScope().isStrict) {
      -                                maybeImplicitGlobal = {
      -                                    pattern: pattern,
      -                                    node: node
      -                                };
      -                            }
      -                            _this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false);
      -                            _this.currentScope().__referencing(pattern, Reference.WRITE, node.right, maybeImplicitGlobal, !info.topLevel, false);
      -                        });
      -                    } else {
      -                        this.currentScope().__referencing(node.left, Reference.RW, node.right);
      -                    }
      -                } else {
      +            } else {
      +                if (node.left.type === _estraverse.Syntax.VariableDeclaration) {
                           this.visit(node.left);
      +                    this.visitPattern(node.left.declarations[0].id, function (pattern) {
      +                        _this6.currentScope().__referencing(pattern, _reference2.default.WRITE, node.right, null, true, true);
      +                    });
      +                } else {
      +                    this.visitPattern(node.left, { processRightHandNodes: true }, function (pattern, info) {
      +                        var maybeImplicitGlobal = null;
      +                        if (!_this6.currentScope().isStrict) {
      +                            maybeImplicitGlobal = {
      +                                pattern: pattern,
      +                                node: node
      +                            };
      +                        }
      +                        _this6.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false);
      +                        _this6.currentScope().__referencing(pattern, _reference2.default.WRITE, node.right, maybeImplicitGlobal, true, false);
      +                    });
                       }
                       this.visit(node.right);
      +                this.visit(node.body);
                   }
      -        },
      -        CatchClause: {
      -            value: function CatchClause(node) {
      -                var _this = this;
      +        }
      +    }, {
      +        key: 'visitVariableDeclaration',
      +        value: function visitVariableDeclaration(variableTargetScope, type, node, index, fromTDZ) {
      +            var _this7 = this;
       
      -                this.scopeManager.__nestCatchScope(node);
      +            // If this was called to initialize a TDZ scope, this needs to make definitions, but doesn't make references.
      +            var decl, init;
       
      -                this.visitPattern(node.param, { processRightHandNodes: true }, function (pattern, info) {
      -                    _this.currentScope().__define(pattern, new Definition(Variable.CatchClause, node.param, node, null, null, null));
      -                    _this.referencingDefaultValue(pattern, info.assignments, null, true);
      -                });
      -                this.visit(node.body);
      +            decl = node.declarations[index];
      +            init = decl.init;
      +            this.visitPattern(decl.id, { processRightHandNodes: !fromTDZ }, function (pattern, info) {
      +                variableTargetScope.__define(pattern, new _definition.Definition(type, pattern, decl, node, index, node.kind));
       
      -                this.close(node);
      -            }
      -        },
      -        Program: {
      -            value: function Program(node) {
      -                this.scopeManager.__nestGlobalScope(node);
      -
      -                if (this.scopeManager.__isNodejsScope()) {
      -                    // Force strictness of GlobalScope to false when using node.js scope.
      -                    this.currentScope().isStrict = false;
      -                    this.scopeManager.__nestFunctionScope(node, false);
      +                if (!fromTDZ) {
      +                    _this7.referencingDefaultValue(pattern, info.assignments, null, true);
                       }
      -
      -                if (this.scopeManager.__isES6() && this.scopeManager.isModule()) {
      -                    this.scopeManager.__nestModuleScope(node);
      +                if (init) {
      +                    _this7.currentScope().__referencing(pattern, _reference2.default.WRITE, init, null, !info.topLevel, true);
                       }
      -
      -                this.visitChildren(node);
      -                this.close(node);
      -            }
      -        },
      -        Identifier: {
      -            value: function Identifier(node) {
      -                this.currentScope().__referencing(node);
      -            }
      -        },
      -        UpdateExpression: {
      -            value: function UpdateExpression(node) {
      -                if (isPattern(node.argument)) {
      -                    this.currentScope().__referencing(node.argument, Reference.RW, null);
      +            });
      +        }
      +    }, {
      +        key: 'AssignmentExpression',
      +        value: function AssignmentExpression(node) {
      +            var _this8 = this;
      +
      +            if (_patternVisitor2.default.isPattern(node.left)) {
      +                if (node.operator === '=') {
      +                    this.visitPattern(node.left, { processRightHandNodes: true }, function (pattern, info) {
      +                        var maybeImplicitGlobal = null;
      +                        if (!_this8.currentScope().isStrict) {
      +                            maybeImplicitGlobal = {
      +                                pattern: pattern,
      +                                node: node
      +                            };
      +                        }
      +                        _this8.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false);
      +                        _this8.currentScope().__referencing(pattern, _reference2.default.WRITE, node.right, maybeImplicitGlobal, !info.topLevel, false);
      +                    });
                       } else {
      -                    this.visitChildren(node);
      +                    this.currentScope().__referencing(node.left, _reference2.default.RW, node.right);
                       }
      +            } else {
      +                this.visit(node.left);
                   }
      -        },
      -        MemberExpression: {
      -            value: function MemberExpression(node) {
      -                this.visit(node.object);
      -                if (node.computed) {
      -                    this.visit(node.property);
      -                }
      -            }
      -        },
      -        Property: {
      -            value: function Property(node) {
      -                this.visitProperty(node);
      -            }
      -        },
      -        MethodDefinition: {
      -            value: function MethodDefinition(node) {
      -                this.visitProperty(node);
      -            }
      -        },
      -        BreakStatement: {
      -            value: function BreakStatement() {}
      -        },
      -        ContinueStatement: {
      -            value: function ContinueStatement() {}
      -        },
      -        LabeledStatement: {
      -            value: function LabeledStatement(node) {
      -                this.visit(node.body);
      -            }
      -        },
      -        ForStatement: {
      -            value: function ForStatement(node) {
      -                // Create ForStatement declaration.
      -                // NOTE: In ES6, ForStatement dynamically generates
      -                // per iteration environment. However, escope is
      -                // a static analyzer, we only generate one scope for ForStatement.
      -                if (node.init && node.init.type === Syntax.VariableDeclaration && node.init.kind !== "var") {
      -                    this.scopeManager.__nestForScope(node);
      -                }
      +            this.visit(node.right);
      +        }
      +    }, {
      +        key: 'CatchClause',
      +        value: function CatchClause(node) {
      +            var _this9 = this;
       
      -                this.visitChildren(node);
      +            this.scopeManager.__nestCatchScope(node);
       
      -                this.close(node);
      -            }
      -        },
      -        ClassExpression: {
      -            value: function ClassExpression(node) {
      -                this.visitClass(node);
      +            this.visitPattern(node.param, { processRightHandNodes: true }, function (pattern, info) {
      +                _this9.currentScope().__define(pattern, new _definition.Definition(_variable2.default.CatchClause, node.param, node, null, null, null));
      +                _this9.referencingDefaultValue(pattern, info.assignments, null, true);
      +            });
      +            this.visit(node.body);
      +
      +            this.close(node);
      +        }
      +    }, {
      +        key: 'Program',
      +        value: function Program(node) {
      +            this.scopeManager.__nestGlobalScope(node);
      +
      +            if (this.scopeManager.__isNodejsScope()) {
      +                // Force strictness of GlobalScope to false when using node.js scope.
      +                this.currentScope().isStrict = false;
      +                this.scopeManager.__nestFunctionScope(node, false);
                   }
      -        },
      -        ClassDeclaration: {
      -            value: function ClassDeclaration(node) {
      -                this.visitClass(node);
      +
      +            if (this.scopeManager.__isES6() && this.scopeManager.isModule()) {
      +                this.scopeManager.__nestModuleScope(node);
                   }
      -        },
      -        CallExpression: {
      -            value: function CallExpression(node) {
      -                // Check this is direct call to eval
      -                if (!this.scopeManager.__ignoreEval() && node.callee.type === Syntax.Identifier && node.callee.name === "eval") {
      -                    // NOTE: This should be `variableScope`. Since direct eval call always creates Lexical environment and
      -                    // let / const should be enclosed into it. Only VariableDeclaration affects on the caller's environment.
      -                    this.currentScope().variableScope.__detectEval();
      -                }
      -                this.visitChildren(node);
      +
      +            if (this.scopeManager.isStrictModeSupported() && this.scopeManager.isImpliedStrict()) {
      +                this.currentScope().isStrict = true;
                   }
      -        },
      -        BlockStatement: {
      -            value: function BlockStatement(node) {
      -                if (this.scopeManager.__isES6()) {
      -                    this.scopeManager.__nestBlockScope(node);
      -                }
       
      +            this.visitChildren(node);
      +            this.close(node);
      +        }
      +    }, {
      +        key: 'Identifier',
      +        value: function Identifier(node) {
      +            this.currentScope().__referencing(node);
      +        }
      +    }, {
      +        key: 'UpdateExpression',
      +        value: function UpdateExpression(node) {
      +            if (_patternVisitor2.default.isPattern(node.argument)) {
      +                this.currentScope().__referencing(node.argument, _reference2.default.RW, null);
      +            } else {
                       this.visitChildren(node);
      -
      -                this.close(node);
                   }
      -        },
      -        ThisExpression: {
      -            value: function ThisExpression() {
      -                this.currentScope().variableScope.__detectThis();
      +        }
      +    }, {
      +        key: 'MemberExpression',
      +        value: function MemberExpression(node) {
      +            this.visit(node.object);
      +            if (node.computed) {
      +                this.visit(node.property);
      +            }
      +        }
      +    }, {
      +        key: 'Property',
      +        value: function Property(node) {
      +            this.visitProperty(node);
      +        }
      +    }, {
      +        key: 'MethodDefinition',
      +        value: function MethodDefinition(node) {
      +            this.visitProperty(node);
      +        }
      +    }, {
      +        key: 'BreakStatement',
      +        value: function BreakStatement() {}
      +    }, {
      +        key: 'ContinueStatement',
      +        value: function ContinueStatement() {}
      +    }, {
      +        key: 'LabeledStatement',
      +        value: function LabeledStatement(node) {
      +            this.visit(node.body);
      +        }
      +    }, {
      +        key: 'ForStatement',
      +        value: function ForStatement(node) {
      +            // Create ForStatement declaration.
      +            // NOTE: In ES6, ForStatement dynamically generates
      +            // per iteration environment. However, escope is
      +            // a static analyzer, we only generate one scope for ForStatement.
      +            if (node.init && node.init.type === _estraverse.Syntax.VariableDeclaration && node.init.kind !== 'var') {
      +                this.scopeManager.__nestForScope(node);
                   }
      -        },
      -        WithStatement: {
      -            value: function WithStatement(node) {
      -                this.visit(node.object);
      -                // Then nest scope for WithStatement.
      -                this.scopeManager.__nestWithScope(node);
       
      -                this.visit(node.body);
      +            this.visitChildren(node);
       
      -                this.close(node);
      -            }
      -        },
      -        VariableDeclaration: {
      -            value: function VariableDeclaration(node) {
      -                var variableTargetScope, i, iz, decl;
      -                variableTargetScope = node.kind === "var" ? this.currentScope().variableScope : this.currentScope();
      -                for (i = 0, iz = node.declarations.length; i < iz; ++i) {
      -                    decl = node.declarations[i];
      -                    this.visitVariableDeclaration(variableTargetScope, Variable.Variable, node, i);
      -                    if (decl.init) {
      -                        this.visit(decl.init);
      -                    }
      -                }
      +            this.close(node);
      +        }
      +    }, {
      +        key: 'ClassExpression',
      +        value: function ClassExpression(node) {
      +            this.visitClass(node);
      +        }
      +    }, {
      +        key: 'ClassDeclaration',
      +        value: function ClassDeclaration(node) {
      +            this.visitClass(node);
      +        }
      +    }, {
      +        key: 'CallExpression',
      +        value: function CallExpression(node) {
      +            // Check this is direct call to eval
      +            if (!this.scopeManager.__ignoreEval() && node.callee.type === _estraverse.Syntax.Identifier && node.callee.name === 'eval') {
      +                // NOTE: This should be `variableScope`. Since direct eval call always creates Lexical environment and
      +                // let / const should be enclosed into it. Only VariableDeclaration affects on the caller's environment.
      +                this.currentScope().variableScope.__detectEval();
      +            }
      +            this.visitChildren(node);
      +        }
      +    }, {
      +        key: 'BlockStatement',
      +        value: function BlockStatement(node) {
      +            if (this.scopeManager.__isES6()) {
      +                this.scopeManager.__nestBlockScope(node);
                   }
      -        },
      -        SwitchStatement: {
       
      -            // sec 13.11.8
      +            this.visitChildren(node);
       
      -            value: function SwitchStatement(node) {
      -                var i, iz;
      +            this.close(node);
      +        }
      +    }, {
      +        key: 'ThisExpression',
      +        value: function ThisExpression() {
      +            this.currentScope().variableScope.__detectThis();
      +        }
      +    }, {
      +        key: 'WithStatement',
      +        value: function WithStatement(node) {
      +            this.visit(node.object);
      +            // Then nest scope for WithStatement.
      +            this.scopeManager.__nestWithScope(node);
       
      -                this.visit(node.discriminant);
      +            this.visit(node.body);
       
      -                if (this.scopeManager.__isES6()) {
      -                    this.scopeManager.__nestSwitchScope(node);
      +            this.close(node);
      +        }
      +    }, {
      +        key: 'VariableDeclaration',
      +        value: function VariableDeclaration(node) {
      +            var variableTargetScope, i, iz, decl;
      +            variableTargetScope = node.kind === 'var' ? this.currentScope().variableScope : this.currentScope();
      +            for (i = 0, iz = node.declarations.length; i < iz; ++i) {
      +                decl = node.declarations[i];
      +                this.visitVariableDeclaration(variableTargetScope, _variable2.default.Variable, node, i);
      +                if (decl.init) {
      +                    this.visit(decl.init);
                       }
      +            }
      +        }
       
      -                for (i = 0, iz = node.cases.length; i < iz; ++i) {
      -                    this.visit(node.cases[i]);
      -                }
      +        // sec 13.11.8
       
      -                this.close(node);
      -            }
      -        },
      -        FunctionDeclaration: {
      -            value: function FunctionDeclaration(node) {
      -                this.visitFunction(node);
      -            }
      -        },
      -        FunctionExpression: {
      -            value: function FunctionExpression(node) {
      -                this.visitFunction(node);
      -            }
      -        },
      -        ForOfStatement: {
      -            value: function ForOfStatement(node) {
      -                this.visitForIn(node);
      -            }
      -        },
      -        ForInStatement: {
      -            value: function ForInStatement(node) {
      -                this.visitForIn(node);
      -            }
      -        },
      -        ArrowFunctionExpression: {
      -            value: function ArrowFunctionExpression(node) {
      -                this.visitFunction(node);
      -            }
      -        },
      -        ImportDeclaration: {
      -            value: function ImportDeclaration(node) {
      -                var importer;
      +    }, {
      +        key: 'SwitchStatement',
      +        value: function SwitchStatement(node) {
      +            var i, iz;
       
      -                assert(this.scopeManager.__isES6() && this.scopeManager.isModule(), "ImportDeclaration should appear when the mode is ES6 and in the module context.");
      +            this.visit(node.discriminant);
       
      -                importer = new Importer(node, this);
      -                importer.visit(node);
      +            if (this.scopeManager.__isES6()) {
      +                this.scopeManager.__nestSwitchScope(node);
                   }
      -        },
      -        visitExportDeclaration: {
      -            value: function visitExportDeclaration(node) {
      -                if (node.source) {
      -                    return;
      -                }
      -                if (node.declaration) {
      -                    this.visit(node.declaration);
      -                    return;
      -                }
       
      -                this.visitChildren(node);
      -            }
      -        },
      -        ExportDeclaration: {
      -            value: function ExportDeclaration(node) {
      -                this.visitExportDeclaration(node);
      +            for (i = 0, iz = node.cases.length; i < iz; ++i) {
      +                this.visit(node.cases[i]);
                   }
      -        },
      -        ExportNamedDeclaration: {
      -            value: function ExportNamedDeclaration(node) {
      -                this.visitExportDeclaration(node);
      +
      +            this.close(node);
      +        }
      +    }, {
      +        key: 'FunctionDeclaration',
      +        value: function FunctionDeclaration(node) {
      +            this.visitFunction(node);
      +        }
      +    }, {
      +        key: 'FunctionExpression',
      +        value: function FunctionExpression(node) {
      +            this.visitFunction(node);
      +        }
      +    }, {
      +        key: 'ForOfStatement',
      +        value: function ForOfStatement(node) {
      +            this.visitForIn(node);
      +        }
      +    }, {
      +        key: 'ForInStatement',
      +        value: function ForInStatement(node) {
      +            this.visitForIn(node);
      +        }
      +    }, {
      +        key: 'ArrowFunctionExpression',
      +        value: function ArrowFunctionExpression(node) {
      +            this.visitFunction(node);
      +        }
      +    }, {
      +        key: 'ImportDeclaration',
      +        value: function ImportDeclaration(node) {
      +            var importer;
      +
      +            (0, _assert2.default)(this.scopeManager.__isES6() && this.scopeManager.isModule(), 'ImportDeclaration should appear when the mode is ES6 and in the module context.');
      +
      +            importer = new Importer(node, this);
      +            importer.visit(node);
      +        }
      +    }, {
      +        key: 'visitExportDeclaration',
      +        value: function visitExportDeclaration(node) {
      +            if (node.source) {
      +                return;
                   }
      -        },
      -        ExportSpecifier: {
      -            value: function ExportSpecifier(node) {
      -                var local = node.id || node.local;
      -                this.visit(local);
      +            if (node.declaration) {
      +                this.visit(node.declaration);
      +                return;
                   }
      +
      +            this.visitChildren(node);
      +        }
      +    }, {
      +        key: 'ExportDeclaration',
      +        value: function ExportDeclaration(node) {
      +            this.visitExportDeclaration(node);
      +        }
      +    }, {
      +        key: 'ExportNamedDeclaration',
      +        value: function ExportNamedDeclaration(node) {
      +            this.visitExportDeclaration(node);
               }
      -    });
      +    }, {
      +        key: 'ExportSpecifier',
      +        value: function ExportSpecifier(node) {
      +            var local = node.id || node.local;
      +            this.visit(local);
      +        }
      +    }, {
      +        key: 'MetaProperty',
      +        value: function MetaProperty() {
      +            // do nothing.
      +        }
      +    }]);
       
           return Referencer;
      -})(esrecurse.Visitor);
      -
      -module.exports = Referencer;
      +}(_esrecurse2.default.Visitor);
       
       /* vim: set sw=4 ts=4 et tw=80 : */
      -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJlZmVyZW5jZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0lBdUJTLE1BQU0sV0FBUSxZQUFZLEVBQTFCLE1BQU07O0lBQ1IsU0FBUywyQkFBTSxXQUFXOztJQUMxQixTQUFTLDJCQUFNLGFBQWE7O0lBQzVCLFFBQVEsMkJBQU0sWUFBWTs7MEJBQ2UsY0FBYzs7SUFBckQsbUJBQW1CLGVBQW5CLG1CQUFtQjtJQUFFLFVBQVUsZUFBVixVQUFVOztJQUNqQyxNQUFNLDJCQUFNLFFBQVE7O0lBRXJCLGNBQWM7QUFDTCxhQURULGNBQWMsQ0FDSixXQUFXLEVBQUUsUUFBUSxFQUFFOzhCQURqQyxjQUFjOztBQUVaLG1DQUZGLGNBQWMsNkNBRUo7QUFDUixZQUFJLENBQUMsV0FBVyxHQUFHLFdBQVcsQ0FBQztBQUMvQixZQUFJLENBQUMsUUFBUSxHQUFHLFFBQVEsQ0FBQztBQUN6QixZQUFJLENBQUMsV0FBVyxHQUFHLEVBQUUsQ0FBQztBQUN0QixZQUFJLENBQUMsY0FBYyxHQUFHLEVBQUUsQ0FBQztBQUN6QixZQUFJLENBQUMsWUFBWSxHQUFHLEVBQUUsQ0FBQztLQUMxQjs7Y0FSQyxjQUFjOztpQkFBZCxjQUFjO0FBVWhCLGtCQUFVO21CQUFBLG9CQUFDLE9BQU8sRUFBRTtBQUNoQixvQkFBTSxlQUFlLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxZQUFZLENBQUMsQ0FBQztBQUNuRCxvQkFBSSxDQUFDLFFBQVEsQ0FBQyxPQUFPLEVBQUU7QUFDbkIsNEJBQVEsRUFBRSxPQUFPLEtBQUssSUFBSSxDQUFDLFdBQVc7QUFDdEMsd0JBQUksRUFBRSxlQUFlLElBQUksSUFBSSxJQUFJLGVBQWUsQ0FBQyxRQUFRLEtBQUssT0FBTztBQUNyRSwrQkFBVyxFQUFFLElBQUksQ0FBQyxXQUFXO2lCQUNoQyxDQUFDLENBQUM7YUFDTjs7QUFFRCxxQkFBYTttQkFBQSx1QkFBQyxPQUFPLEVBQUU7QUFDbkIsb0JBQUksQ0FBQyxFQUFFLEVBQUUsRUFBRSxRQUFRLENBQUM7QUFDcEIscUJBQUssQ0FBQyxHQUFHLENBQUMsRUFBRSxFQUFFLEdBQUcsT0FBTyxDQUFDLFVBQVUsQ0FBQyxNQUFNLEVBQUUsQ0FBQyxHQUFHLEVBQUUsRUFBRSxFQUFFLENBQUMsRUFBRTtBQUNyRCw0QkFBUSxHQUFHLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDLENBQUM7OztBQUdqQyx3QkFBSSxRQUFRLENBQUMsUUFBUSxFQUFFO0FBQ25CLDRCQUFJLENBQUMsY0FBYyxDQUFDLElBQUksQ0FBQyxRQUFRLENBQUMsR0FBRyxDQUFDLENBQUM7cUJBQzFDOzs7OztBQUtELHdCQUFJLENBQUMsS0FBSyxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsQ0FBQztpQkFDOUI7YUFDSjs7QUFFRCxvQkFBWTttQkFBQSxzQkFBQyxPQUFPLEVBQUU7QUFDbEIsb0JBQUksQ0FBQyxFQUFFLEVBQUUsRUFBRSxPQUFPLENBQUM7QUFDbkIscUJBQUssQ0FBQyxHQUFHLENBQUMsRUFBRSxFQUFFLEdBQUcsT0FBTyxDQUFDLFFBQVEsQ0FBQyxNQUFNLEVBQUUsQ0FBQyxHQUFHLEVBQUUsRUFBRSxFQUFFLENBQUMsRUFBRTtBQUNuRCwyQkFBTyxHQUFHLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDOUIsd0JBQUksQ0FBQyxLQUFLLENBQUMsT0FBTyxDQUFDLENBQUM7aUJBQ3ZCO2FBQ0o7O0FBRUQseUJBQWlCO21CQUFBLDJCQUFDLE9BQU8sRUFBRTtBQUN2QixvQkFBSSxDQUFDLFdBQVcsQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLENBQUM7QUFDL0Isb0JBQUksQ0FBQyxLQUFLLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDO0FBQ3pCLG9CQUFJLENBQUMsY0FBYyxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFDLENBQUM7QUFDeEMsb0JBQUksQ0FBQyxXQUFXLENBQUMsR0FBRyxFQUFFLENBQUM7YUFDMUI7O0FBRUQsbUJBQVc7bUJBQUEscUJBQUMsT0FBTyxFQUFFO0FBQ2pCLG9CQUFJLENBQUMsWUFBWSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsQ0FBQztBQUNoQyxvQkFBSSxDQUFDLEtBQUssQ0FBQyxPQUFPLENBQUMsUUFBUSxDQUFDLENBQUM7QUFDN0Isb0JBQUksQ0FBQyxZQUFZLENBQUMsR0FBRyxFQUFFLENBQUM7YUFDM0I7O0FBRUQsd0JBQWdCO21CQUFBLDBCQUFDLElBQUksRUFBRTs7QUFFbkIsb0JBQUksSUFBSSxDQUFDLFFBQVEsRUFBRTtBQUNmLHdCQUFJLENBQUMsY0FBYyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDLENBQUM7aUJBQzNDOztBQUVELG9CQUFJLENBQUMsY0FBYyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUM7YUFDekM7O0FBU0QscUJBQWE7Ozs7Ozs7OzttQkFBQSx1QkFBQyxJQUFJLEVBQUU7QUFDaEIsb0JBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLFFBQVEsQ0FBQyxDQUFDO2FBQzdCOztBQUVELHVCQUFlO21CQUFBLHlCQUFDLElBQUksRUFBRTtBQUNsQixvQkFBSSxDQUFDLFFBQVEsQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLEtBQUssRUFBRSxJQUFJLENBQUMsQ0FBQzthQUMzQzs7QUFFRCx3QkFBZ0I7bUJBQUEsMEJBQUMsSUFBSSxFQUFFOzs7QUFDbkIsb0JBQUksQ0FBQyxVQUFVLENBQUMsT0FBTyxDQUFDLFVBQUEsUUFBUSxFQUFJOztBQUVoQyx3QkFBSSxRQUFRLENBQUMsUUFBUSxFQUFFO0FBQ25CLDhCQUFLLGNBQWMsQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDLEdBQUcsQ0FBQyxDQUFDO3FCQUMxQztBQUNELDBCQUFLLEtBQUssQ0FBQyxRQUFRLENBQUMsS0FBSyxDQUFDLENBQUM7aUJBQzlCLENBQUMsQ0FBQzthQUNOOztBQUVELDRCQUFvQjttQkFBQSw4QkFBQyxJQUFJLEVBQUU7QUFDdkIsb0JBQUksQ0FBQyxXQUFXLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDO0FBQzVCLG9CQUFJLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQztBQUN0QixvQkFBSSxDQUFDLGNBQWMsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDO0FBQ3JDLG9CQUFJLENBQUMsV0FBVyxDQUFDLEdBQUcsRUFBRSxDQUFDO2FBQzFCOztBQUVELHNCQUFjO21CQUFBLHdCQUFDLElBQUksRUFBRTs7OztBQUVqQixvQkFBSSxDQUFDLFNBQVMsQ0FBQyxPQUFPLENBQUMsVUFBQSxDQUFDLEVBQUk7QUFBRSwwQkFBSyxjQUFjLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDO2lCQUFFLENBQUMsQ0FBQztBQUM5RCxvQkFBSSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUM7YUFDM0I7Ozs7V0F0R0MsY0FBYztHQUFTLFNBQVMsQ0FBQyxPQUFPOztBQXlHOUMsU0FBUyxPQUFPLENBQUMsRUFBRSxFQUFFO0FBQ2pCLFdBQU8sRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFNLEdBQUcsQ0FBQyxDQUFDLElBQUksSUFBSSxDQUFDO0NBQ3BDOztBQUVELFNBQVMsMkJBQTJCLENBQUMsV0FBVyxFQUFFLFVBQVUsRUFBRSxRQUFRLEVBQUU7O0FBRXBFLFFBQUksT0FBTyxHQUFHLElBQUksY0FBYyxDQUFDLFdBQVcsRUFBRSxRQUFRLENBQUMsQ0FBQztBQUN4RCxXQUFPLENBQUMsS0FBSyxDQUFDLFdBQVcsQ0FBQyxDQUFDOzs7QUFHM0IsUUFBSSxVQUFVLElBQUksSUFBSSxFQUFFO0FBQ3BCLGVBQU8sQ0FBQyxjQUFjLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxLQUFLLEVBQUUsVUFBVSxDQUFDLENBQUM7S0FDaEU7Q0FDSjs7QUFFRCxTQUFTLFNBQVMsQ0FBQyxJQUFJLEVBQUU7QUFDckIsUUFBSSxRQUFRLEdBQUcsSUFBSSxDQUFDLElBQUksQ0FBQztBQUN6QixXQUNJLFFBQVEsS0FBSyxNQUFNLENBQUMsVUFBVSxJQUM5QixRQUFRLEtBQUssTUFBTSxDQUFDLGFBQWEsSUFDakMsUUFBUSxLQUFLLE1BQU0sQ0FBQyxZQUFZLElBQ2hDLFFBQVEsS0FBSyxNQUFNLENBQUMsYUFBYSxJQUNqQyxRQUFRLEtBQUssTUFBTSxDQUFDLFdBQVcsSUFDL0IsUUFBUSxLQUFLLE1BQU0sQ0FBQyxpQkFBaUIsQ0FDdkM7Q0FDTDs7Ozs7Ozs7SUFRSyxRQUFRO0FBQ0MsYUFEVCxRQUFRLENBQ0UsV0FBVyxFQUFFLFVBQVUsRUFBRTs4QkFEbkMsUUFBUTs7QUFFTixtQ0FGRixRQUFRLDZDQUVFO0FBQ1IsWUFBSSxDQUFDLFdBQVcsR0FBRyxXQUFXLENBQUM7QUFDL0IsWUFBSSxDQUFDLFVBQVUsR0FBRyxVQUFVLENBQUM7S0FDaEM7O2NBTEMsUUFBUTs7aUJBQVIsUUFBUTtBQU9WLG1CQUFXO21CQUFBLHFCQUFDLEVBQUUsRUFBRSxTQUFTLEVBQUU7OztBQUN2QixvQkFBSSxDQUFDLFVBQVUsQ0FBQyxZQUFZLENBQUMsRUFBRSxFQUFFLFVBQUMsT0FBTyxFQUFLO0FBQzFDLDBCQUFLLFVBQVUsQ0FBQyxZQUFZLEVBQUUsQ0FBQyxRQUFRLENBQUMsT0FBTyxFQUMzQyxJQUFJLFVBQVUsQ0FDVixRQUFRLENBQUMsYUFBYSxFQUN0QixPQUFPLEVBQ1AsU0FBUyxFQUNULE1BQUssV0FBVyxFQUNoQixJQUFJLEVBQ0osSUFBSSxDQUNILENBQUMsQ0FBQztpQkFDZCxDQUFDLENBQUM7YUFDTjs7QUFFRCxnQ0FBd0I7bUJBQUEsa0NBQUMsSUFBSSxFQUFFO0FBQzNCLG9CQUFJLEtBQUssR0FBSSxJQUFJLENBQUMsS0FBSyxJQUFJLElBQUksQ0FBQyxFQUFFLEFBQUMsQ0FBQztBQUNwQyxvQkFBSSxLQUFLLEVBQUU7QUFDUCx3QkFBSSxDQUFDLFdBQVcsQ0FBQyxLQUFLLEVBQUUsSUFBSSxDQUFDLENBQUM7aUJBQ2pDO2FBQ0o7O0FBRUQsOEJBQXNCO21CQUFBLGdDQUFDLElBQUksRUFBRTtBQUN6QixvQkFBSSxLQUFLLEdBQUksSUFBSSxDQUFDLEtBQUssSUFBSSxJQUFJLENBQUMsRUFBRSxBQUFDLENBQUM7QUFDcEMsb0JBQUksQ0FBQyxXQUFXLENBQUMsS0FBSyxFQUFFLElBQUksQ0FBQyxDQUFDO2FBQ2pDOztBQUVELHVCQUFlO21CQUFBLHlCQUFDLElBQUksRUFBRTtBQUNsQixvQkFBSSxLQUFLLEdBQUksSUFBSSxDQUFDLEtBQUssSUFBSSxJQUFJLENBQUMsRUFBRSxBQUFDLENBQUM7QUFDcEMsb0JBQUksSUFBSSxDQUFDLElBQUksRUFBRTtBQUNYLHdCQUFJLENBQUMsV0FBVyxDQUFDLElBQUksQ0FBQyxJQUFJLEVBQUUsSUFBSSxDQUFDLENBQUM7aUJBQ3JDLE1BQU07QUFDSCx3QkFBSSxDQUFDLFdBQVcsQ0FBQyxLQUFLLEVBQUUsSUFBSSxDQUFDLENBQUM7aUJBQ2pDO2FBQ0o7Ozs7V0F4Q0MsUUFBUTtHQUFTLFNBQVMsQ0FBQyxPQUFPOzs7O0lBNENuQixVQUFVO0FBQ2hCLGFBRE0sVUFBVSxDQUNmLFlBQVksRUFBRTs4QkFEVCxVQUFVOztBQUV2QixtQ0FGYSxVQUFVLDZDQUVmO0FBQ1IsWUFBSSxDQUFDLFlBQVksR0FBRyxZQUFZLENBQUM7QUFDakMsWUFBSSxDQUFDLE1BQU0sR0FBRyxJQUFJLENBQUM7QUFDbkIsWUFBSSxDQUFDLHVCQUF1QixHQUFHLEtBQUssQ0FBQztLQUN4Qzs7Y0FOZ0IsVUFBVTs7aUJBQVYsVUFBVTtBQVEzQixvQkFBWTttQkFBQSx3QkFBRztBQUNYLHVCQUFPLElBQUksQ0FBQyxZQUFZLENBQUMsY0FBYyxDQUFDO2FBQzNDOztBQUVELGFBQUs7bUJBQUEsZUFBQyxJQUFJLEVBQUU7QUFDUix1QkFBTyxJQUFJLENBQUMsWUFBWSxFQUFFLElBQUksSUFBSSxLQUFLLElBQUksQ0FBQyxZQUFZLEVBQUUsQ0FBQyxLQUFLLEVBQUU7QUFDOUQsd0JBQUksQ0FBQyxZQUFZLENBQUMsY0FBYyxHQUFHLElBQUksQ0FBQyxZQUFZLEVBQUUsQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLFlBQVksQ0FBQyxDQUFDO2lCQUNyRjthQUNKOztBQUVELGlDQUF5QjttQkFBQSxtQ0FBQyx1QkFBdUIsRUFBRTtBQUMvQyxvQkFBSSxRQUFRLEdBQUcsSUFBSSxDQUFDLHVCQUF1QixDQUFDO0FBQzVDLG9CQUFJLENBQUMsdUJBQXVCLEdBQUcsdUJBQXVCLENBQUM7QUFDdkQsdUJBQU8sUUFBUSxDQUFDO2FBQ25COztBQUVELGdDQUF3QjttQkFBQSxrQ0FBQyx1QkFBdUIsRUFBRTtBQUM5QyxvQkFBSSxDQUFDLHVCQUF1QixHQUFHLHVCQUF1QixDQUFDO2FBQzFEOztBQUVELDJCQUFtQjttQkFBQSw2QkFBQyxJQUFJLEVBQUUsYUFBYSxFQUFFOzs7QUFHckMsb0JBQUksQ0FBQyxZQUFZLENBQUMsY0FBYyxDQUFDLElBQUksRUFBRSxhQUFhLENBQUMsQ0FBQztBQUN0RCxvQkFBSSxDQUFDLHdCQUF3QixDQUFDLElBQUksQ0FBQyxZQUFZLEVBQUUsRUFBRSxRQUFRLENBQUMsR0FBRyxFQUFFLGFBQWEsQ0FBQyxJQUFJLEVBQUUsQ0FBQyxFQUFFLElBQUksQ0FBQyxDQUFDO2FBQ2pHOztBQUVELGlDQUF5QjttQkFBQSxtQ0FBQyxJQUFJLEVBQUU7Ozs7QUFFNUIsb0JBQUksY0FBYyxDQUFDO0FBQ25CLG9CQUFJLENBQUMsWUFBWSxDQUFDLGNBQWMsQ0FBQyxJQUFJLENBQUMsQ0FBQztBQUN2Qyw4QkFBYyxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUM7QUFDM0Isb0JBQUksQ0FBQyx3QkFBd0IsQ0FBQyxJQUFJLENBQUMsWUFBWSxFQUFFLEVBQUUsUUFBUSxDQUFDLFFBQVEsRUFBRSxjQUFjLEVBQUUsQ0FBQyxDQUFDLENBQUM7QUFDekYsb0JBQUksQ0FBQyxZQUFZLENBQUMsY0FBYyxDQUFDLFlBQVksQ0FBQyxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsVUFBQyxPQUFPLEVBQUs7QUFDOUQsMEJBQUssWUFBWSxFQUFFLENBQUMsYUFBYSxDQUFDLE9BQU8sRUFBRSxTQUFTLENBQUMsS0FBSyxFQUFFLElBQUksQ0FBQyxLQUFLLEVBQUUsSUFBSSxFQUFFLElBQUksRUFBRSxJQUFJLENBQUMsQ0FBQztpQkFDN0YsQ0FBQyxDQUFDO2FBQ047O0FBRUQsK0JBQXVCO21CQUFBLGlDQUFDLE9BQU8sRUFBRSxXQUFXLEVBQUUsbUJBQW1CLEVBQUUsSUFBSSxFQUFFO0FBQ3JFLG9CQUFNLEtBQUssR0FBRyxJQUFJLENBQUMsWUFBWSxFQUFFLENBQUM7QUFDbEMsMkJBQVcsQ0FBQyxPQUFPLENBQUMsVUFBQSxVQUFVLEVBQUk7QUFDOUIseUJBQUssQ0FBQyxhQUFhLENBQ2YsT0FBTyxFQUNQLFNBQVMsQ0FBQyxLQUFLLEVBQ2YsVUFBVSxDQUFDLEtBQUssRUFDaEIsbUJBQW1CLEVBQ25CLE9BQU8sS0FBSyxVQUFVLENBQUMsSUFBSSxFQUMzQixJQUFJLENBQUMsQ0FBQztpQkFDYixDQUFDLENBQUM7YUFDTjs7QUFFRCxvQkFBWTttQkFBQSxzQkFBQyxJQUFJLEVBQUUsT0FBTyxFQUFFLFFBQVEsRUFBRTtBQUNsQyxvQkFBSSxPQUFPLE9BQU8sS0FBSyxVQUFVLEVBQUU7QUFDL0IsNEJBQVEsR0FBRyxPQUFPLENBQUM7QUFDbkIsMkJBQU8sR0FBRyxFQUFDLHFCQUFxQixFQUFFLEtBQUssRUFBQyxDQUFBO2lCQUMzQztBQUNELDJDQUEyQixDQUN2QixJQUFJLEVBQ0osT0FBTyxDQUFDLHFCQUFxQixHQUFHLElBQUksR0FBRyxJQUFJLEVBQzNDLFFBQVEsQ0FBQyxDQUFDO2FBQ2pCOztBQUVELHFCQUFhO21CQUFBLHVCQUFDLElBQUksRUFBRTs7O0FBQ2hCLG9CQUFJLENBQUMsRUFBRSxFQUFFLENBQUM7Ozs7OztBQU1WLG9CQUFJLElBQUksQ0FBQyxJQUFJLEtBQUssTUFBTSxDQUFDLG1CQUFtQixFQUFFOztBQUUxQyx3QkFBSSxDQUFDLFlBQVksRUFBRSxDQUFDLFFBQVEsQ0FBQyxJQUFJLENBQUMsRUFBRSxFQUM1QixJQUFJLFVBQVUsQ0FDVixRQUFRLENBQUMsWUFBWSxFQUNyQixJQUFJLENBQUMsRUFBRSxFQUNQLElBQUksRUFDSixJQUFJLEVBQ0osSUFBSSxFQUNKLElBQUksQ0FDUCxDQUFDLENBQUM7aUJBQ2Q7Ozs7QUFJRCxvQkFBSSxJQUFJLENBQUMsSUFBSSxLQUFLLE1BQU0sQ0FBQyxrQkFBa0IsSUFBSSxJQUFJLENBQUMsRUFBRSxFQUFFO0FBQ3BELHdCQUFJLENBQUMsWUFBWSxDQUFDLGlDQUFpQyxDQUFDLElBQUksQ0FBQyxDQUFDO2lCQUM3RDs7O0FBR0Qsb0JBQUksQ0FBQyxZQUFZLENBQUMsbUJBQW1CLENBQUMsSUFBSSxFQUFFLElBQUksQ0FBQyx1QkFBdUIsQ0FBQyxDQUFDOzs7QUFHMUUscUJBQUssQ0FBQyxHQUFHLENBQUMsRUFBRSxFQUFFLEdBQUcsSUFBSSxDQUFDLE1BQU0sQ0FBQyxNQUFNLEVBQUUsQ0FBQyxHQUFHLEVBQUUsRUFBRSxFQUFFLENBQUMsRUFBRTtBQUM5Qyx3QkFBSSxDQUFDLFlBQVksQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUMscUJBQXFCLEVBQUUsSUFBSSxFQUFDLEVBQUUsVUFBQyxPQUFPLEVBQUUsSUFBSSxFQUFLO0FBQ2hGLDhCQUFLLFlBQVksRUFBRSxDQUFDLFFBQVEsQ0FBQyxPQUFPLEVBQ2hDLElBQUksbUJBQW1CLENBQ25CLE9BQU8sRUFDUCxJQUFJLEVBQ0osQ0FBQyxFQUNELElBQUksQ0FBQyxJQUFJLENBQ1osQ0FBQyxDQUFDOztBQUVQLDhCQUFLLHVCQUF1QixDQUFDLE9BQU8sRUFBRSxJQUFJLENBQUMsV0FBVyxFQUFFLElBQUksRUFBRSxJQUFJLENBQUMsQ0FBQztxQkFDdkUsQ0FBQyxDQUFDO2lCQUNOOzs7QUFHRCxvQkFBSSxJQUFJLENBQUMsSUFBSSxFQUFFO0FBQ1gsd0JBQUksQ0FBQyxZQUFZLENBQUM7QUFDZCw0QkFBSSxFQUFFLGFBQWE7QUFDbkIsZ0NBQVEsRUFBRSxJQUFJLENBQUMsSUFBSTtxQkFDdEIsRUFBRSxVQUFDLE9BQU8sRUFBSztBQUNaLDhCQUFLLFlBQVksRUFBRSxDQUFDLFFBQVEsQ0FBQyxPQUFPLEVBQ2hDLElBQUksbUJBQW1CLENBQ25CLE9BQU8sRUFDUCxJQUFJLEVBQ0osSUFBSSxDQUFDLE1BQU0sQ0FBQyxNQUFNLEVBQ2xCLElBQUksQ0FDUCxDQUFDLENBQUM7cUJBQ1YsQ0FBQyxDQUFDO2lCQUNOOzs7QUFHRCxvQkFBSSxJQUFJLENBQUMsSUFBSSxDQUFDLElBQUksS0FBSyxNQUFNLENBQUMsY0FBYyxFQUFFO0FBQzFDLHdCQUFJLENBQUMsYUFBYSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQztpQkFDakMsTUFBTTtBQUNILHdCQUFJLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQztpQkFDekI7O0FBRUQsb0JBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLENBQUM7YUFDcEI7O0FBRUQsa0JBQVU7bUJBQUEsb0JBQUMsSUFBSSxFQUFFO0FBQ2Isb0JBQUksSUFBSSxDQUFDLElBQUksS0FBSyxNQUFNLENBQUMsZ0JBQWdCLEVBQUU7QUFDdkMsd0JBQUksQ0FBQyxZQUFZLEVBQUUsQ0FBQyxRQUFRLENBQUMsSUFBSSxDQUFDLEVBQUUsRUFDNUIsSUFBSSxVQUFVLENBQ1YsUUFBUSxDQUFDLFNBQVMsRUFDbEIsSUFBSSxDQUFDLEVBQUUsRUFDUCxJQUFJLEVBQ0osSUFBSSxFQUNKLElBQUksRUFDSixJQUFJLENBQ1AsQ0FBQyxDQUFDO2lCQUNkOzs7QUFHRCxvQkFBSSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsVUFBVSxDQUFDLENBQUM7O0FBRTVCLG9CQUFJLENBQUMsWUFBWSxDQUFDLGdCQUFnQixDQUFDLElBQUksQ0FBQyxDQUFDOztBQUV6QyxvQkFBSSxJQUFJLENBQUMsRUFBRSxFQUFFO0FBQ1Qsd0JBQUksQ0FBQyxZQUFZLEVBQUUsQ0FBQyxRQUFRLENBQUMsSUFBSSxDQUFDLEVBQUUsRUFDNUIsSUFBSSxVQUFVLENBQ1YsUUFBUSxDQUFDLFNBQVMsRUFDbEIsSUFBSSxDQUFDLEVBQUUsRUFDUCxJQUFJLENBQ1AsQ0FBQyxDQUFDO2lCQUNkO0FBQ0Qsb0JBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDOztBQUV0QixvQkFBSSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsQ0FBQzthQUNwQjs7QUFFRCxxQkFBYTttQkFBQSx1QkFBQyxJQUFJLEVBQUU7QUFDaEIsb0JBQUksUUFBUSxFQUFFLGtCQUFrQixDQUFDO0FBQ2pDLG9CQUFJLElBQUksQ0FBQyxRQUFRLEVBQUU7QUFDZix3QkFBSSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUM7aUJBQ3hCOztBQUVELGtDQUFrQixHQUFHLElBQUksQ0FBQyxJQUFJLEtBQUssTUFBTSxDQUFDLGdCQUFnQixJQUFJLElBQUksQ0FBQyxNQUFNLENBQUM7QUFDMUUsb0JBQUksa0JBQWtCLEVBQUU7QUFDcEIsNEJBQVEsR0FBRyxJQUFJLENBQUMseUJBQXlCLENBQUMsSUFBSSxDQUFDLENBQUM7aUJBQ25EO0FBQ0Qsb0JBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDO0FBQ3ZCLG9CQUFJLGtCQUFrQixFQUFFO0FBQ3BCLHdCQUFJLENBQUMsd0JBQXdCLENBQUMsUUFBUSxDQUFDLENBQUM7aUJBQzNDO2FBQ0o7O0FBRUQsa0JBQVU7bUJBQUEsb0JBQUMsSUFBSSxFQUFFOzs7QUFDYixvQkFBSSxJQUFJLENBQUMsSUFBSSxDQUFDLElBQUksS0FBSyxNQUFNLENBQUMsbUJBQW1CLElBQUksSUFBSSxDQUFDLElBQUksQ0FBQyxJQUFJLEtBQUssS0FBSyxFQUFFO0FBQzNFLHdCQUFJLENBQUMsbUJBQW1CLENBQUMsSUFBSSxDQUFDLEtBQUssRUFBRSxJQUFJLENBQUMsQ0FBQztBQUMzQyx3QkFBSSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLENBQUM7QUFDdkIsd0JBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDOztBQUV2Qix3QkFBSSxDQUFDLHlCQUF5QixDQUFDLElBQUksQ0FBQyxDQUFDO0FBQ3JDLHdCQUFJLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQztBQUN0Qix3QkFBSSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsQ0FBQztpQkFDcEIsTUFBTTtBQUNILHdCQUFJLElBQUksQ0FBQyxJQUFJLENBQUMsSUFBSSxLQUFLLE1BQU0sQ0FBQyxtQkFBbUIsRUFBRTtBQUMvQyw0QkFBSSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7QUFDdEIsNEJBQUksQ0FBQyxZQUFZLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxZQUFZLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRSxFQUFFLFVBQUMsT0FBTyxFQUFLO0FBQ3pELGtDQUFLLFlBQVksRUFBRSxDQUFDLGFBQWEsQ0FBQyxPQUFPLEVBQUUsU0FBUyxDQUFDLEtBQUssRUFBRSxJQUFJLENBQUMsS0FBSyxFQUFFLElBQUksRUFBRSxJQUFJLEVBQUUsSUFBSSxDQUFDLENBQUM7eUJBQzdGLENBQUMsQ0FBQztxQkFDTixNQUFNO0FBQ0gsNEJBQUksQ0FBQyxZQUFZLENBQUMsSUFBSSxDQUFDLElBQUksRUFBRSxFQUFDLHFCQUFxQixFQUFFLElBQUksRUFBQyxFQUFFLFVBQUMsT0FBTyxFQUFFLElBQUksRUFBSztBQUMzRSxnQ0FBSSxtQkFBbUIsR0FBRyxJQUFJLENBQUM7QUFDL0IsZ0NBQUksQ0FBQyxNQUFLLFlBQVksRUFBRSxDQUFDLFFBQVEsRUFBRTtBQUMvQixtREFBbUIsR0FBRztBQUNsQiwyQ0FBTyxFQUFFLE9BQU87QUFDaEIsd0NBQUksRUFBRSxJQUFJO2lDQUNiLENBQUM7NkJBQ0w7QUFDRCxrQ0FBSyx1QkFBdUIsQ0FBQyxPQUFPLEVBQUUsSUFBSSxDQUFDLFdBQVcsRUFBRSxtQkFBbUIsRUFBRSxLQUFLLENBQUMsQ0FBQztBQUNwRixrQ0FBSyxZQUFZLEVBQUUsQ0FBQyxhQUFhLENBQUMsT0FBTyxFQUFFLFNBQVMsQ0FBQyxLQUFLLEVBQUUsSUFBSSxDQUFDLEtBQUssRUFBRSxtQkFBbUIsRUFBRSxJQUFJLEVBQUUsS0FBSyxDQUFDLENBQUM7eUJBQzdHLENBQUMsQ0FBQztxQkFDTjtBQUNELHdCQUFJLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQztBQUN2Qix3QkFBSSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7aUJBQ3pCO2FBQ0o7O0FBRUQsZ0NBQXdCO21CQUFBLGtDQUFDLG1CQUFtQixFQUFFLElBQUksRUFBRSxJQUFJLEVBQUUsS0FBSyxFQUFFLE9BQU8sRUFBRTs7OztBQUV0RSxvQkFBSSxJQUFJLEVBQUUsSUFBSSxDQUFDOztBQUVmLG9CQUFJLEdBQUcsSUFBSSxDQUFDLFlBQVksQ0FBQyxLQUFLLENBQUMsQ0FBQztBQUNoQyxvQkFBSSxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUM7QUFDakIsb0JBQUksQ0FBQyxZQUFZLENBQUMsSUFBSSxDQUFDLEVBQUUsRUFBRSxFQUFDLHFCQUFxQixFQUFFLENBQUMsT0FBTyxFQUFDLEVBQUUsVUFBQyxPQUFPLEVBQUUsSUFBSSxFQUFLO0FBQzdFLHVDQUFtQixDQUFDLFFBQVEsQ0FBQyxPQUFPLEVBQ2hDLElBQUksVUFBVSxDQUNWLElBQUksRUFDSixPQUFPLEVBQ1AsSUFBSSxFQUNKLElBQUksRUFDSixLQUFLLEVBQ0wsSUFBSSxDQUFDLElBQUksQ0FDWixDQUFDLENBQUM7O0FBRVAsd0JBQUksQ0FBQyxPQUFPLEVBQUU7QUFDViw4QkFBSyx1QkFBdUIsQ0FBQyxPQUFPLEVBQUUsSUFBSSxDQUFDLFdBQVcsRUFBRSxJQUFJLEVBQUUsSUFBSSxDQUFDLENBQUM7cUJBQ3ZFO0FBQ0Qsd0JBQUksSUFBSSxFQUFFO0FBQ04sOEJBQUssWUFBWSxFQUFFLENBQUMsYUFBYSxDQUFDLE9BQU8sRUFBRSxTQUFTLENBQUMsS0FBSyxFQUFFLElBQUksRUFBRSxJQUFJLEVBQUUsQ0FBQyxJQUFJLENBQUMsUUFBUSxFQUFFLElBQUksQ0FBQyxDQUFDO3FCQUNqRztpQkFDSixDQUFDLENBQUM7YUFDTjs7QUFFRCw0QkFBb0I7bUJBQUEsOEJBQUMsSUFBSSxFQUFFOzs7QUFDdkIsb0JBQUksU0FBUyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsRUFBRTtBQUN0Qix3QkFBSSxJQUFJLENBQUMsUUFBUSxLQUFLLEdBQUcsRUFBRTtBQUN2Qiw0QkFBSSxDQUFDLFlBQVksQ0FBQyxJQUFJLENBQUMsSUFBSSxFQUFFLEVBQUMscUJBQXFCLEVBQUUsSUFBSSxFQUFDLEVBQUUsVUFBQyxPQUFPLEVBQUUsSUFBSSxFQUFLO0FBQzNFLGdDQUFJLG1CQUFtQixHQUFHLElBQUksQ0FBQztBQUMvQixnQ0FBSSxDQUFDLE1BQUssWUFBWSxFQUFFLENBQUMsUUFBUSxFQUFFO0FBQy9CLG1EQUFtQixHQUFHO0FBQ2xCLDJDQUFPLEVBQUUsT0FBTztBQUNoQix3Q0FBSSxFQUFFLElBQUk7aUNBQ2IsQ0FBQzs2QkFDTDtBQUNELGtDQUFLLHVCQUF1QixDQUFDLE9BQU8sRUFBRSxJQUFJLENBQUMsV0FBVyxFQUFFLG1CQUFtQixFQUFFLEtBQUssQ0FBQyxDQUFDO0FBQ3BGLGtDQUFLLFlBQVksRUFBRSxDQUFDLGFBQWEsQ0FBQyxPQUFPLEVBQUUsU0FBUyxDQUFDLEtBQUssRUFBRSxJQUFJLENBQUMsS0FBSyxFQUFFLG1CQUFtQixFQUFFLENBQUMsSUFBSSxDQUFDLFFBQVEsRUFBRSxLQUFLLENBQUMsQ0FBQzt5QkFDdkgsQ0FBQyxDQUFDO3FCQUNOLE1BQU07QUFDSCw0QkFBSSxDQUFDLFlBQVksRUFBRSxDQUFDLGFBQWEsQ0FBQyxJQUFJLENBQUMsSUFBSSxFQUFFLFNBQVMsQ0FBQyxFQUFFLEVBQUUsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDO3FCQUMxRTtpQkFDSixNQUFNO0FBQ0gsd0JBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDO2lCQUN6QjtBQUNELG9CQUFJLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQzthQUMxQjs7QUFFRCxtQkFBVzttQkFBQSxxQkFBQyxJQUFJLEVBQUU7OztBQUNkLG9CQUFJLENBQUMsWUFBWSxDQUFDLGdCQUFnQixDQUFDLElBQUksQ0FBQyxDQUFDOztBQUV6QyxvQkFBSSxDQUFDLFlBQVksQ0FBQyxJQUFJLENBQUMsS0FBSyxFQUFFLEVBQUMscUJBQXFCLEVBQUUsSUFBSSxFQUFDLEVBQUUsVUFBQyxPQUFPLEVBQUUsSUFBSSxFQUFLO0FBQzVFLDBCQUFLLFlBQVksRUFBRSxDQUFDLFFBQVEsQ0FBQyxPQUFPLEVBQ2hDLElBQUksVUFBVSxDQUNWLFFBQVEsQ0FBQyxXQUFXLEVBQ3BCLElBQUksQ0FBQyxLQUFLLEVBQ1YsSUFBSSxFQUNKLElBQUksRUFDSixJQUFJLEVBQ0osSUFBSSxDQUNQLENBQUMsQ0FBQztBQUNQLDBCQUFLLHVCQUF1QixDQUFDLE9BQU8sRUFBRSxJQUFJLENBQUMsV0FBVyxFQUFFLElBQUksRUFBRSxJQUFJLENBQUMsQ0FBQztpQkFDdkUsQ0FBQyxDQUFDO0FBQ0gsb0JBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDOztBQUV0QixvQkFBSSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsQ0FBQzthQUNwQjs7QUFFRCxlQUFPO21CQUFBLGlCQUFDLElBQUksRUFBRTtBQUNWLG9CQUFJLENBQUMsWUFBWSxDQUFDLGlCQUFpQixDQUFDLElBQUksQ0FBQyxDQUFDOztBQUUxQyxvQkFBSSxJQUFJLENBQUMsWUFBWSxDQUFDLGVBQWUsRUFBRSxFQUFFOztBQUVyQyx3QkFBSSxDQUFDLFlBQVksRUFBRSxDQUFDLFFBQVEsR0FBRyxLQUFLLENBQUM7QUFDckMsd0JBQUksQ0FBQyxZQUFZLENBQUMsbUJBQW1CLENBQUMsSUFBSSxFQUFFLEtBQUssQ0FBQyxDQUFDO2lCQUN0RDs7QUFFRCxvQkFBSSxJQUFJLENBQUMsWUFBWSxDQUFDLE9BQU8sRUFBRSxJQUFJLElBQUksQ0FBQyxZQUFZLENBQUMsUUFBUSxFQUFFLEVBQUU7QUFDN0Qsd0JBQUksQ0FBQyxZQUFZLENBQUMsaUJBQWlCLENBQUMsSUFBSSxDQUFDLENBQUM7aUJBQzdDOztBQUVELG9CQUFJLENBQUMsYUFBYSxDQUFDLElBQUksQ0FBQyxDQUFDO0FBQ3pCLG9CQUFJLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxDQUFDO2FBQ3BCOztBQUVELGtCQUFVO21CQUFBLG9CQUFDLElBQUksRUFBRTtBQUNiLG9CQUFJLENBQUMsWUFBWSxFQUFFLENBQUMsYUFBYSxDQUFDLElBQUksQ0FBQyxDQUFDO2FBQzNDOztBQUVELHdCQUFnQjttQkFBQSwwQkFBQyxJQUFJLEVBQUU7QUFDbkIsb0JBQUksU0FBUyxDQUFDLElBQUksQ0FBQyxRQUFRLENBQUMsRUFBRTtBQUMxQix3QkFBSSxDQUFDLFlBQVksRUFBRSxDQUFDLGFBQWEsQ0FBQyxJQUFJLENBQUMsUUFBUSxFQUFFLFNBQVMsQ0FBQyxFQUFFLEVBQUUsSUFBSSxDQUFDLENBQUM7aUJBQ3hFLE1BQU07QUFDSCx3QkFBSSxDQUFDLGFBQWEsQ0FBQyxJQUFJLENBQUMsQ0FBQztpQkFDNUI7YUFDSjs7QUFFRCx3QkFBZ0I7bUJBQUEsMEJBQUMsSUFBSSxFQUFFO0FBQ25CLG9CQUFJLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsQ0FBQztBQUN4QixvQkFBSSxJQUFJLENBQUMsUUFBUSxFQUFFO0FBQ2Ysd0JBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLFFBQVEsQ0FBQyxDQUFDO2lCQUM3QjthQUNKOztBQUVELGdCQUFRO21CQUFBLGtCQUFDLElBQUksRUFBRTtBQUNYLG9CQUFJLENBQUMsYUFBYSxDQUFDLElBQUksQ0FBQyxDQUFDO2FBQzVCOztBQUVELHdCQUFnQjttQkFBQSwwQkFBQyxJQUFJLEVBQUU7QUFDbkIsb0JBQUksQ0FBQyxhQUFhLENBQUMsSUFBSSxDQUFDLENBQUM7YUFDNUI7O0FBRUQsc0JBQWM7bUJBQUEsMEJBQUcsRUFBRTs7QUFFbkIseUJBQWlCO21CQUFBLDZCQUFHLEVBQUU7O0FBRXRCLHdCQUFnQjttQkFBQSwwQkFBQyxJQUFJLEVBQUU7QUFDbkIsb0JBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDO2FBQ3pCOztBQUVELG9CQUFZO21CQUFBLHNCQUFDLElBQUksRUFBRTs7Ozs7QUFLZixvQkFBSSxJQUFJLENBQUMsSUFBSSxJQUFJLElBQUksQ0FBQyxJQUFJLENBQUMsSUFBSSxLQUFLLE1BQU0sQ0FBQyxtQkFBbUIsSUFBSSxJQUFJLENBQUMsSUFBSSxDQUFDLElBQUksS0FBSyxLQUFLLEVBQUU7QUFDeEYsd0JBQUksQ0FBQyxZQUFZLENBQUMsY0FBYyxDQUFDLElBQUksQ0FBQyxDQUFDO2lCQUMxQzs7QUFFRCxvQkFBSSxDQUFDLGFBQWEsQ0FBQyxJQUFJLENBQUMsQ0FBQzs7QUFFekIsb0JBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLENBQUM7YUFDcEI7O0FBRUQsdUJBQWU7bUJBQUEseUJBQUMsSUFBSSxFQUFFO0FBQ2xCLG9CQUFJLENBQUMsVUFBVSxDQUFDLElBQUksQ0FBQyxDQUFDO2FBQ3pCOztBQUVELHdCQUFnQjttQkFBQSwwQkFBQyxJQUFJLEVBQUU7QUFDbkIsb0JBQUksQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDLENBQUM7YUFDekI7O0FBRUQsc0JBQWM7bUJBQUEsd0JBQUMsSUFBSSxFQUFFOztBQUVqQixvQkFBSSxDQUFDLElBQUksQ0FBQyxZQUFZLENBQUMsWUFBWSxFQUFFLElBQUksSUFBSSxDQUFDLE1BQU0sQ0FBQyxJQUFJLEtBQUssTUFBTSxDQUFDLFVBQVUsSUFBSSxJQUFJLENBQUMsTUFBTSxDQUFDLElBQUksS0FBSyxNQUFNLEVBQUU7OztBQUc1Ryx3QkFBSSxDQUFDLFlBQVksRUFBRSxDQUFDLGFBQWEsQ0FBQyxZQUFZLEVBQUUsQ0FBQztpQkFDcEQ7QUFDRCxvQkFBSSxDQUFDLGFBQWEsQ0FBQyxJQUFJLENBQUMsQ0FBQzthQUM1Qjs7QUFFRCxzQkFBYzttQkFBQSx3QkFBQyxJQUFJLEVBQUU7QUFDakIsb0JBQUksSUFBSSxDQUFDLFlBQVksQ0FBQyxPQUFPLEVBQUUsRUFBRTtBQUM3Qix3QkFBSSxDQUFDLFlBQVksQ0FBQyxnQkFBZ0IsQ0FBQyxJQUFJLENBQUMsQ0FBQztpQkFDNUM7O0FBRUQsb0JBQUksQ0FBQyxhQUFhLENBQUMsSUFBSSxDQUFDLENBQUM7O0FBRXpCLG9CQUFJLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxDQUFDO2FBQ3BCOztBQUVELHNCQUFjO21CQUFBLDBCQUFHO0FBQ2Isb0JBQUksQ0FBQyxZQUFZLEVBQUUsQ0FBQyxhQUFhLENBQUMsWUFBWSxFQUFFLENBQUM7YUFDcEQ7O0FBRUQscUJBQWE7bUJBQUEsdUJBQUMsSUFBSSxFQUFFO0FBQ2hCLG9CQUFJLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsQ0FBQzs7QUFFeEIsb0JBQUksQ0FBQyxZQUFZLENBQUMsZUFBZSxDQUFDLElBQUksQ0FBQyxDQUFDOztBQUV4QyxvQkFBSSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7O0FBRXRCLG9CQUFJLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxDQUFDO2FBQ3BCOztBQUVELDJCQUFtQjttQkFBQSw2QkFBQyxJQUFJLEVBQUU7QUFDdEIsb0JBQUksbUJBQW1CLEVBQUUsQ0FBQyxFQUFFLEVBQUUsRUFBRSxJQUFJLENBQUM7QUFDckMsbUNBQW1CLEdBQUcsQUFBQyxJQUFJLENBQUMsSUFBSSxLQUFLLEtBQUssR0FBSSxJQUFJLENBQUMsWUFBWSxFQUFFLENBQUMsYUFBYSxHQUFHLElBQUksQ0FBQyxZQUFZLEVBQUUsQ0FBQztBQUN0RyxxQkFBSyxDQUFDLEdBQUcsQ0FBQyxFQUFFLEVBQUUsR0FBRyxJQUFJLENBQUMsWUFBWSxDQUFDLE1BQU0sRUFBRSxDQUFDLEdBQUcsRUFBRSxFQUFFLEVBQUUsQ0FBQyxFQUFFO0FBQ3BELHdCQUFJLEdBQUcsSUFBSSxDQUFDLFlBQVksQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUM1Qix3QkFBSSxDQUFDLHdCQUF3QixDQUFDLG1CQUFtQixFQUFFLFFBQVEsQ0FBQyxRQUFRLEVBQUUsSUFBSSxFQUFFLENBQUMsQ0FBQyxDQUFDO0FBQy9FLHdCQUFJLElBQUksQ0FBQyxJQUFJLEVBQUU7QUFDWCw0QkFBSSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7cUJBQ3pCO2lCQUNKO2FBQ0o7O0FBR0QsdUJBQWU7Ozs7bUJBQUEseUJBQUMsSUFBSSxFQUFFO0FBQ2xCLG9CQUFJLENBQUMsRUFBRSxFQUFFLENBQUM7O0FBRVYsb0JBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLFlBQVksQ0FBQyxDQUFDOztBQUU5QixvQkFBSSxJQUFJLENBQUMsWUFBWSxDQUFDLE9BQU8sRUFBRSxFQUFFO0FBQzdCLHdCQUFJLENBQUMsWUFBWSxDQUFDLGlCQUFpQixDQUFDLElBQUksQ0FBQyxDQUFDO2lCQUM3Qzs7QUFFRCxxQkFBSyxDQUFDLEdBQUcsQ0FBQyxFQUFFLEVBQUUsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLE1BQU0sRUFBRSxDQUFDLEdBQUcsRUFBRSxFQUFFLEVBQUUsQ0FBQyxFQUFFO0FBQzdDLHdCQUFJLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQztpQkFDN0I7O0FBRUQsb0JBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLENBQUM7YUFDcEI7O0FBRUQsMkJBQW1CO21CQUFBLDZCQUFDLElBQUksRUFBRTtBQUN0QixvQkFBSSxDQUFDLGFBQWEsQ0FBQyxJQUFJLENBQUMsQ0FBQzthQUM1Qjs7QUFFRCwwQkFBa0I7bUJBQUEsNEJBQUMsSUFBSSxFQUFFO0FBQ3JCLG9CQUFJLENBQUMsYUFBYSxDQUFDLElBQUksQ0FBQyxDQUFDO2FBQzVCOztBQUVELHNCQUFjO21CQUFBLHdCQUFDLElBQUksRUFBRTtBQUNqQixvQkFBSSxDQUFDLFVBQVUsQ0FBQyxJQUFJLENBQUMsQ0FBQzthQUN6Qjs7QUFFRCxzQkFBYzttQkFBQSx3QkFBQyxJQUFJLEVBQUU7QUFDakIsb0JBQUksQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDLENBQUM7YUFDekI7O0FBRUQsK0JBQXVCO21CQUFBLGlDQUFDLElBQUksRUFBRTtBQUMxQixvQkFBSSxDQUFDLGFBQWEsQ0FBQyxJQUFJLENBQUMsQ0FBQzthQUM1Qjs7QUFFRCx5QkFBaUI7bUJBQUEsMkJBQUMsSUFBSSxFQUFFO0FBQ3BCLG9CQUFJLFFBQVEsQ0FBQzs7QUFFYixzQkFBTSxDQUFDLElBQUksQ0FBQyxZQUFZLENBQUMsT0FBTyxFQUFFLElBQUksSUFBSSxDQUFDLFlBQVksQ0FBQyxRQUFRLEVBQUUsRUFBRSxpRkFBaUYsQ0FBQyxDQUFDOztBQUV2Six3QkFBUSxHQUFHLElBQUksUUFBUSxDQUFDLElBQUksRUFBRSxJQUFJLENBQUMsQ0FBQztBQUNwQyx3QkFBUSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsQ0FBQzthQUN4Qjs7QUFFRCw4QkFBc0I7bUJBQUEsZ0NBQUMsSUFBSSxFQUFFO0FBQ3pCLG9CQUFJLElBQUksQ0FBQyxNQUFNLEVBQUU7QUFDYiwyQkFBTztpQkFDVjtBQUNELG9CQUFJLElBQUksQ0FBQyxXQUFXLEVBQUU7QUFDbEIsd0JBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLFdBQVcsQ0FBQyxDQUFDO0FBQzdCLDJCQUFPO2lCQUNWOztBQUVELG9CQUFJLENBQUMsYUFBYSxDQUFDLElBQUksQ0FBQyxDQUFDO2FBQzVCOztBQUVELHlCQUFpQjttQkFBQSwyQkFBQyxJQUFJLEVBQUU7QUFDcEIsb0JBQUksQ0FBQyxzQkFBc0IsQ0FBQyxJQUFJLENBQUMsQ0FBQzthQUNyQzs7QUFFRCw4QkFBc0I7bUJBQUEsZ0NBQUMsSUFBSSxFQUFFO0FBQ3pCLG9CQUFJLENBQUMsc0JBQXNCLENBQUMsSUFBSSxDQUFDLENBQUM7YUFDckM7O0FBRUQsdUJBQWU7bUJBQUEseUJBQUMsSUFBSSxFQUFFO0FBQ2xCLG9CQUFJLEtBQUssR0FBSSxJQUFJLENBQUMsRUFBRSxJQUFJLElBQUksQ0FBQyxLQUFLLEFBQUMsQ0FBQztBQUNwQyxvQkFBSSxDQUFDLEtBQUssQ0FBQyxLQUFLLENBQUMsQ0FBQzthQUNyQjs7OztXQTlkZ0IsVUFBVTtHQUFTLFNBQVMsQ0FBQyxPQUFPOztpQkFBcEMsVUFBVSIsImZpbGUiOiJyZWZlcmVuY2VyLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLypcbiAgQ29weXJpZ2h0IChDKSAyMDE1IFl1c3VrZSBTdXp1a2kgPHV0YXRhbmUudGVhQGdtYWlsLmNvbT5cblxuICBSZWRpc3RyaWJ1dGlvbiBhbmQgdXNlIGluIHNvdXJjZSBhbmQgYmluYXJ5IGZvcm1zLCB3aXRoIG9yIHdpdGhvdXRcbiAgbW9kaWZpY2F0aW9uLCBhcmUgcGVybWl0dGVkIHByb3ZpZGVkIHRoYXQgdGhlIGZvbGxvd2luZyBjb25kaXRpb25zIGFyZSBtZXQ6XG5cbiAgICAqIFJlZGlzdHJpYnV0aW9ucyBvZiBzb3VyY2UgY29kZSBtdXN0IHJldGFpbiB0aGUgYWJvdmUgY29weXJpZ2h0XG4gICAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIuXG4gICAgKiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodFxuICAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyIGluIHRoZVxuICAgICAgZG9jdW1lbnRhdGlvbiBhbmQvb3Igb3RoZXIgbWF0ZXJpYWxzIHByb3ZpZGVkIHdpdGggdGhlIGRpc3RyaWJ1dGlvbi5cblxuICBUSElTIFNPRlRXQVJFIElTIFBST1ZJREVEIEJZIFRIRSBDT1BZUklHSFQgSE9MREVSUyBBTkQgQ09OVFJJQlVUT1JTIFwiQVMgSVNcIlxuICBBTkQgQU5ZIEVYUFJFU1MgT1IgSU1QTElFRCBXQVJSQU5USUVTLCBJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgVEhFXG4gIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFXG4gIEFSRSBESVNDTEFJTUVELiBJTiBOTyBFVkVOVCBTSEFMTCA8Q09QWVJJR0hUIEhPTERFUj4gQkUgTElBQkxFIEZPUiBBTllcbiAgRElSRUNULCBJTkRJUkVDVCwgSU5DSURFTlRBTCwgU1BFQ0lBTCwgRVhFTVBMQVJZLCBPUiBDT05TRVFVRU5USUFMIERBTUFHRVNcbiAgKElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTO1xuICBMT1NTIE9GIFVTRSwgREFUQSwgT1IgUFJPRklUUzsgT1IgQlVTSU5FU1MgSU5URVJSVVBUSU9OKSBIT1dFVkVSIENBVVNFRCBBTkRcbiAgT04gQU5ZIFRIRU9SWSBPRiBMSUFCSUxJVFksIFdIRVRIRVIgSU4gQ09OVFJBQ1QsIFNUUklDVCBMSUFCSUxJVFksIE9SIFRPUlRcbiAgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFIE9GXG4gIFRISVMgU09GVFdBUkUsIEVWRU4gSUYgQURWSVNFRCBPRiBUSEUgUE9TU0lCSUxJVFkgT0YgU1VDSCBEQU1BR0UuXG4qL1xuaW1wb3J0IHsgU3ludGF4IH0gZnJvbSAnZXN0cmF2ZXJzZSc7XG5pbXBvcnQgZXNyZWN1cnNlIGZyb20gJ2VzcmVjdXJzZSc7XG5pbXBvcnQgUmVmZXJlbmNlIGZyb20gJy4vcmVmZXJlbmNlJztcbmltcG9ydCBWYXJpYWJsZSBmcm9tICcuL3ZhcmlhYmxlJztcbmltcG9ydCB7IFBhcmFtZXRlckRlZmluaXRpb24sIERlZmluaXRpb24gfSBmcm9tICcuL2RlZmluaXRpb24nO1xuaW1wb3J0IGFzc2VydCBmcm9tICdhc3NlcnQnO1xuXG5jbGFzcyBQYXR0ZXJuVmlzaXRvciBleHRlbmRzIGVzcmVjdXJzZS5WaXNpdG9yIHtcbiAgICBjb25zdHJ1Y3Rvcihyb290UGF0dGVybiwgY2FsbGJhY2spIHtcbiAgICAgICAgc3VwZXIoKTtcbiAgICAgICAgdGhpcy5yb290UGF0dGVybiA9IHJvb3RQYXR0ZXJuO1xuICAgICAgICB0aGlzLmNhbGxiYWNrID0gY2FsbGJhY2s7XG4gICAgICAgIHRoaXMuYXNzaWdubWVudHMgPSBbXTtcbiAgICAgICAgdGhpcy5yaWdodEhhbmROb2RlcyA9IFtdO1xuICAgICAgICB0aGlzLnJlc3RFbGVtZW50cyA9IFtdO1xuICAgIH1cblxuICAgIElkZW50aWZpZXIocGF0dGVybikge1xuICAgICAgICBjb25zdCBsYXN0UmVzdEVsZW1lbnQgPSBnZXRMYXN0KHRoaXMucmVzdEVsZW1lbnRzKTtcbiAgICAgICAgdGhpcy5jYWxsYmFjayhwYXR0ZXJuLCB7XG4gICAgICAgICAgICB0b3BMZXZlbDogcGF0dGVybiA9PT0gdGhpcy5yb290UGF0dGVybixcbiAgICAgICAgICAgIHJlc3Q6IGxhc3RSZXN0RWxlbWVudCAhPSBudWxsICYmIGxhc3RSZXN0RWxlbWVudC5hcmd1bWVudCA9PT0gcGF0dGVybixcbiAgICAgICAgICAgIGFzc2lnbm1lbnRzOiB0aGlzLmFzc2lnbm1lbnRzXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIE9iamVjdFBhdHRlcm4ocGF0dGVybikge1xuICAgICAgICB2YXIgaSwgaXosIHByb3BlcnR5O1xuICAgICAgICBmb3IgKGkgPSAwLCBpeiA9IHBhdHRlcm4ucHJvcGVydGllcy5sZW5ndGg7IGkgPCBpejsgKytpKSB7XG4gICAgICAgICAgICBwcm9wZXJ0eSA9IHBhdHRlcm4ucHJvcGVydGllc1tpXTtcblxuICAgICAgICAgICAgLy8gQ29tcHV0ZWQgcHJvcGVydHkncyBrZXkgaXMgYSByaWdodCBoYW5kIG5vZGUuXG4gICAgICAgICAgICBpZiAocHJvcGVydHkuY29tcHV0ZWQpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnJpZ2h0SGFuZE5vZGVzLnB1c2gocHJvcGVydHkua2V5KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gSWYgaXQncyBzaG9ydGhhbmQsIGl0cyBrZXkgaXMgc2FtZSBhcyBpdHMgdmFsdWUuXG4gICAgICAgICAgICAvLyBJZiBpdCdzIHNob3J0aGFuZCBhbmQgaGFzIGl0cyBkZWZhdWx0IHZhbHVlLCBpdHMga2V5IGlzIHNhbWUgYXMgaXRzIHZhbHVlLmxlZnQgKHRoZSB2YWx1ZSBpcyBBc3NpZ25tZW50UGF0dGVybikuXG4gICAgICAgICAgICAvLyBJZiBpdCdzIG5vdCBzaG9ydGhhbmQsIHRoZSBuYW1lIG9mIG5ldyB2YXJpYWJsZSBpcyBpdHMgdmFsdWUncy5cbiAgICAgICAgICAgIHRoaXMudmlzaXQocHJvcGVydHkudmFsdWUpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgQXJyYXlQYXR0ZXJuKHBhdHRlcm4pIHtcbiAgICAgICAgdmFyIGksIGl6LCBlbGVtZW50O1xuICAgICAgICBmb3IgKGkgPSAwLCBpeiA9IHBhdHRlcm4uZWxlbWVudHMubGVuZ3RoOyBpIDwgaXo7ICsraSkge1xuICAgICAgICAgICAgZWxlbWVudCA9IHBhdHRlcm4uZWxlbWVudHNbaV07XG4gICAgICAgICAgICB0aGlzLnZpc2l0KGVsZW1lbnQpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgQXNzaWdubWVudFBhdHRlcm4ocGF0dGVybikge1xuICAgICAgICB0aGlzLmFzc2lnbm1lbnRzLnB1c2gocGF0dGVybik7XG4gICAgICAgIHRoaXMudmlzaXQocGF0dGVybi5sZWZ0KTtcbiAgICAgICAgdGhpcy5yaWdodEhhbmROb2Rlcy5wdXNoKHBhdHRlcm4ucmlnaHQpO1xuICAgICAgICB0aGlzLmFzc2lnbm1lbnRzLnBvcCgpO1xuICAgIH1cblxuICAgIFJlc3RFbGVtZW50KHBhdHRlcm4pIHtcbiAgICAgICAgdGhpcy5yZXN0RWxlbWVudHMucHVzaChwYXR0ZXJuKTtcbiAgICAgICAgdGhpcy52aXNpdChwYXR0ZXJuLmFyZ3VtZW50KTtcbiAgICAgICAgdGhpcy5yZXN0RWxlbWVudHMucG9wKCk7XG4gICAgfVxuXG4gICAgTWVtYmVyRXhwcmVzc2lvbihub2RlKSB7XG4gICAgICAgIC8vIENvbXB1dGVkIHByb3BlcnR5J3Mga2V5IGlzIGEgcmlnaHQgaGFuZCBub2RlLlxuICAgICAgICBpZiAobm9kZS5jb21wdXRlZCkge1xuICAgICAgICAgICAgdGhpcy5yaWdodEhhbmROb2Rlcy5wdXNoKG5vZGUucHJvcGVydHkpO1xuICAgICAgICB9XG4gICAgICAgIC8vIHRoZSBvYmplY3QgaXMgb25seSByZWFkLCB3cml0ZSB0byBpdHMgcHJvcGVydHkuXG4gICAgICAgIHRoaXMucmlnaHRIYW5kTm9kZXMucHVzaChub2RlLm9iamVjdCk7XG4gICAgfVxuXG4gICAgLy9cbiAgICAvLyBGb3JJblN0YXRlbWVudC5sZWZ0IGFuZCBBc3NpZ25tZW50RXhwcmVzc2lvbi5sZWZ0IGFyZSBMZWZ0SGFuZFNpZGVFeHByZXNzaW9uLlxuICAgIC8vIEJ5IHNwZWMsIExlZnRIYW5kU2lkZUV4cHJlc3Npb24gaXMgUGF0dGVybiBvciBNZW1iZXJFeHByZXNzaW9uLlxuICAgIC8vICAgKHNlZSBhbHNvOiBodHRwczovL2dpdGh1Yi5jb20vZXN0cmVlL2VzdHJlZS9wdWxsLzIwI2lzc3VlY29tbWVudC03NDU4NDc1OClcbiAgICAvLyBCdXQgZXNwcmVlIDIuMCBhbmQgZXNwcmltYSAyLjAgcGFyc2UgdG8gQXJyYXlFeHByZXNzaW9uLCBPYmplY3RFeHByZXNzaW9uLCBldGMuLi5cbiAgICAvL1xuXG4gICAgU3ByZWFkRWxlbWVudChub2RlKSB7XG4gICAgICAgIHRoaXMudmlzaXQobm9kZS5hcmd1bWVudCk7XG4gICAgfVxuXG4gICAgQXJyYXlFeHByZXNzaW9uKG5vZGUpIHtcbiAgICAgICAgbm9kZS5lbGVtZW50cy5mb3JFYWNoKHRoaXMudmlzaXQsIHRoaXMpO1xuICAgIH1cblxuICAgIE9iamVjdEV4cHJlc3Npb24obm9kZSkge1xuICAgICAgICBub2RlLnByb3BlcnRpZXMuZm9yRWFjaChwcm9wZXJ0eSA9PiB7XG4gICAgICAgICAgICAvLyBDb21wdXRlZCBwcm9wZXJ0eSdzIGtleSBpcyBhIHJpZ2h0IGhhbmQgbm9kZS5cbiAgICAgICAgICAgIGlmIChwcm9wZXJ0eS5jb21wdXRlZCkge1xuICAgICAgICAgICAgICAgIHRoaXMucmlnaHRIYW5kTm9kZXMucHVzaChwcm9wZXJ0eS5rZXkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy52aXNpdChwcm9wZXJ0eS52YWx1ZSk7XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIEFzc2lnbm1lbnRFeHByZXNzaW9uKG5vZGUpIHtcbiAgICAgICAgdGhpcy5hc3NpZ25tZW50cy5wdXNoKG5vZGUpO1xuICAgICAgICB0aGlzLnZpc2l0KG5vZGUubGVmdCk7XG4gICAgICAgIHRoaXMucmlnaHRIYW5kTm9kZXMucHVzaChub2RlLnJpZ2h0KTtcbiAgICAgICAgdGhpcy5hc3NpZ25tZW50cy5wb3AoKTtcbiAgICB9XG5cbiAgICBDYWxsRXhwcmVzc2lvbihub2RlKSB7XG4gICAgICAgIC8vIGFyZ3VtZW50cyBhcmUgcmlnaHQgaGFuZCBub2Rlcy5cbiAgICAgICAgbm9kZS5hcmd1bWVudHMuZm9yRWFjaChhID0+IHsgdGhpcy5yaWdodEhhbmROb2Rlcy5wdXNoKGEpOyB9KTtcbiAgICAgICAgdGhpcy52aXNpdChub2RlLmNhbGxlZSk7XG4gICAgfVxufVxuXG5mdW5jdGlvbiBnZXRMYXN0KHhzKSB7XG4gICAgcmV0dXJuIHhzW3hzLmxlbmd0aCAtIDFdIHx8IG51bGw7XG59XG5cbmZ1bmN0aW9uIHRyYXZlcnNlSWRlbnRpZmllckluUGF0dGVybihyb290UGF0dGVybiwgcmVmZXJlbmNlciwgY2FsbGJhY2spIHtcbiAgICAvLyBDYWxsIHRoZSBjYWxsYmFjayBhdCBsZWZ0IGhhbmQgaWRlbnRpZmllciBub2RlcywgYW5kIENvbGxlY3QgcmlnaHQgaGFuZCBub2Rlcy5cbiAgICB2YXIgdmlzaXRvciA9IG5ldyBQYXR0ZXJuVmlzaXRvcihyb290UGF0dGVybiwgY2FsbGJhY2spO1xuICAgIHZpc2l0b3IudmlzaXQocm9vdFBhdHRlcm4pO1xuXG4gICAgLy8gUHJvY2VzcyB0aGUgcmlnaHQgaGFuZCBub2RlcyByZWN1cnNpdmVseS5cbiAgICBpZiAocmVmZXJlbmNlciAhPSBudWxsKSB7XG4gICAgICAgIHZpc2l0b3IucmlnaHRIYW5kTm9kZXMuZm9yRWFjaChyZWZlcmVuY2VyLnZpc2l0LCByZWZlcmVuY2VyKTtcbiAgICB9XG59XG5cbmZ1bmN0aW9uIGlzUGF0dGVybihub2RlKSB7XG4gICAgdmFyIG5vZGVUeXBlID0gbm9kZS50eXBlO1xuICAgIHJldHVybiAoXG4gICAgICAgIG5vZGVUeXBlID09PSBTeW50YXguSWRlbnRpZmllciB8fFxuICAgICAgICBub2RlVHlwZSA9PT0gU3ludGF4Lk9iamVjdFBhdHRlcm4gfHxcbiAgICAgICAgbm9kZVR5cGUgPT09IFN5bnRheC5BcnJheVBhdHRlcm4gfHxcbiAgICAgICAgbm9kZVR5cGUgPT09IFN5bnRheC5TcHJlYWRFbGVtZW50IHx8XG4gICAgICAgIG5vZGVUeXBlID09PSBTeW50YXguUmVzdEVsZW1lbnQgfHxcbiAgICAgICAgbm9kZVR5cGUgPT09IFN5bnRheC5Bc3NpZ25tZW50UGF0dGVyblxuICAgICk7XG59XG5cbi8vIEltcG9ydGluZyBJbXBvcnREZWNsYXJhdGlvbi5cbi8vIGh0dHA6Ly9wZW9wbGUubW96aWxsYS5vcmcvfmpvcmVuZG9yZmYvZXM2LWRyYWZ0Lmh0bWwjc2VjLW1vZHVsZWRlY2xhcmF0aW9uaW5zdGFudGlhdGlvblxuLy8gaHR0cHM6Ly9naXRodWIuY29tL2VzdHJlZS9lc3RyZWUvYmxvYi9tYXN0ZXIvZXM2Lm1kI2ltcG9ydGRlY2xhcmF0aW9uXG4vLyBGSVhNRTogTm93LCB3ZSBkb24ndCBjcmVhdGUgbW9kdWxlIGVudmlyb25tZW50LCBiZWNhdXNlIHRoZSBjb250ZXh0IGlzXG4vLyBpbXBsZW1lbnRhdGlvbiBkZXBlbmRlbnQuXG5cbmNsYXNzIEltcG9ydGVyIGV4dGVuZHMgZXNyZWN1cnNlLlZpc2l0b3Ige1xuICAgIGNvbnN0cnVjdG9yKGRlY2xhcmF0aW9uLCByZWZlcmVuY2VyKSB7XG4gICAgICAgIHN1cGVyKCk7XG4gICAgICAgIHRoaXMuZGVjbGFyYXRpb24gPSBkZWNsYXJhdGlvbjtcbiAgICAgICAgdGhpcy5yZWZlcmVuY2VyID0gcmVmZXJlbmNlcjtcbiAgICB9XG5cbiAgICB2aXNpdEltcG9ydChpZCwgc3BlY2lmaWVyKSB7XG4gICAgICAgIHRoaXMucmVmZXJlbmNlci52aXNpdFBhdHRlcm4oaWQsIChwYXR0ZXJuKSA9PiB7XG4gICAgICAgICAgICB0aGlzLnJlZmVyZW5jZXIuY3VycmVudFNjb3BlKCkuX19kZWZpbmUocGF0dGVybixcbiAgICAgICAgICAgICAgICBuZXcgRGVmaW5pdGlvbihcbiAgICAgICAgICAgICAgICAgICAgVmFyaWFibGUuSW1wb3J0QmluZGluZyxcbiAgICAgICAgICAgICAgICAgICAgcGF0dGVybixcbiAgICAgICAgICAgICAgICAgICAgc3BlY2lmaWVyLFxuICAgICAgICAgICAgICAgICAgICB0aGlzLmRlY2xhcmF0aW9uLFxuICAgICAgICAgICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgICAgICAgICBudWxsXG4gICAgICAgICAgICAgICAgICAgICkpO1xuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBJbXBvcnROYW1lc3BhY2VTcGVjaWZpZXIobm9kZSkge1xuICAgICAgICBsZXQgbG9jYWwgPSAobm9kZS5sb2NhbCB8fCBub2RlLmlkKTtcbiAgICAgICAgaWYgKGxvY2FsKSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0SW1wb3J0KGxvY2FsLCBub2RlKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIEltcG9ydERlZmF1bHRTcGVjaWZpZXIobm9kZSkge1xuICAgICAgICBsZXQgbG9jYWwgPSAobm9kZS5sb2NhbCB8fCBub2RlLmlkKTtcbiAgICAgICAgdGhpcy52aXNpdEltcG9ydChsb2NhbCwgbm9kZSk7XG4gICAgfVxuXG4gICAgSW1wb3J0U3BlY2lmaWVyKG5vZGUpIHtcbiAgICAgICAgbGV0IGxvY2FsID0gKG5vZGUubG9jYWwgfHwgbm9kZS5pZCk7XG4gICAgICAgIGlmIChub2RlLm5hbWUpIHtcbiAgICAgICAgICAgIHRoaXMudmlzaXRJbXBvcnQobm9kZS5uYW1lLCBub2RlKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMudmlzaXRJbXBvcnQobG9jYWwsIG5vZGUpO1xuICAgICAgICB9XG4gICAgfVxufVxuXG4vLyBSZWZlcmVuY2luZyB2YXJpYWJsZXMgYW5kIGNyZWF0aW5nIGJpbmRpbmdzLlxuZXhwb3J0IGRlZmF1bHQgY2xhc3MgUmVmZXJlbmNlciBleHRlbmRzIGVzcmVjdXJzZS5WaXNpdG9yIHtcbiAgICBjb25zdHJ1Y3RvcihzY29wZU1hbmFnZXIpIHtcbiAgICAgICAgc3VwZXIoKTtcbiAgICAgICAgdGhpcy5zY29wZU1hbmFnZXIgPSBzY29wZU1hbmFnZXI7XG4gICAgICAgIHRoaXMucGFyZW50ID0gbnVsbDtcbiAgICAgICAgdGhpcy5pc0lubmVyTWV0aG9kRGVmaW5pdGlvbiA9IGZhbHNlO1xuICAgIH1cblxuICAgIGN1cnJlbnRTY29wZSgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuc2NvcGVNYW5hZ2VyLl9fY3VycmVudFNjb3BlO1xuICAgIH1cblxuICAgIGNsb3NlKG5vZGUpIHtcbiAgICAgICAgd2hpbGUgKHRoaXMuY3VycmVudFNjb3BlKCkgJiYgbm9kZSA9PT0gdGhpcy5jdXJyZW50U2NvcGUoKS5ibG9jaykge1xuICAgICAgICAgICAgdGhpcy5zY29wZU1hbmFnZXIuX19jdXJyZW50U2NvcGUgPSB0aGlzLmN1cnJlbnRTY29wZSgpLl9fY2xvc2UodGhpcy5zY29wZU1hbmFnZXIpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcHVzaElubmVyTWV0aG9kRGVmaW5pdGlvbihpc0lubmVyTWV0aG9kRGVmaW5pdGlvbikge1xuICAgICAgICB2YXIgcHJldmlvdXMgPSB0aGlzLmlzSW5uZXJNZXRob2REZWZpbml0aW9uO1xuICAgICAgICB0aGlzLmlzSW5uZXJNZXRob2REZWZpbml0aW9uID0gaXNJbm5lck1ldGhvZERlZmluaXRpb247XG4gICAgICAgIHJldHVybiBwcmV2aW91cztcbiAgICB9XG5cbiAgICBwb3BJbm5lck1ldGhvZERlZmluaXRpb24oaXNJbm5lck1ldGhvZERlZmluaXRpb24pIHtcbiAgICAgICAgdGhpcy5pc0lubmVyTWV0aG9kRGVmaW5pdGlvbiA9IGlzSW5uZXJNZXRob2REZWZpbml0aW9uO1xuICAgIH1cblxuICAgIG1hdGVyaWFsaXplVERaU2NvcGUobm9kZSwgaXRlcmF0aW9uTm9kZSkge1xuICAgICAgICAvLyBodHRwOi8vcGVvcGxlLm1vemlsbGEub3JnL35qb3JlbmRvcmZmL2VzNi1kcmFmdC5odG1sI3NlYy1ydW50aW1lLXNlbWFudGljcy1mb3Jpbi1kaXYtb2ZleHByZXNzaW9uZXZhbHVhdGlvbi1hYnN0cmFjdC1vcGVyYXRpb25cbiAgICAgICAgLy8gVERaIHNjb3BlIGhpZGVzIHRoZSBkZWNsYXJhdGlvbidzIG5hbWVzLlxuICAgICAgICB0aGlzLnNjb3BlTWFuYWdlci5fX25lc3RURFpTY29wZShub2RlLCBpdGVyYXRpb25Ob2RlKTtcbiAgICAgICAgdGhpcy52aXNpdFZhcmlhYmxlRGVjbGFyYXRpb24odGhpcy5jdXJyZW50U2NvcGUoKSwgVmFyaWFibGUuVERaLCBpdGVyYXRpb25Ob2RlLmxlZnQsIDAsIHRydWUpO1xuICAgIH1cblxuICAgIG1hdGVyaWFsaXplSXRlcmF0aW9uU2NvcGUobm9kZSkge1xuICAgICAgICAvLyBHZW5lcmF0ZSBpdGVyYXRpb24gc2NvcGUgZm9yIHVwcGVyIEZvckluL0Zvck9mIFN0YXRlbWVudHMuXG4gICAgICAgIHZhciBsZXRPckNvbnN0RGVjbDtcbiAgICAgICAgdGhpcy5zY29wZU1hbmFnZXIuX19uZXN0Rm9yU2NvcGUobm9kZSk7XG4gICAgICAgIGxldE9yQ29uc3REZWNsID0gbm9kZS5sZWZ0O1xuICAgICAgICB0aGlzLnZpc2l0VmFyaWFibGVEZWNsYXJhdGlvbih0aGlzLmN1cnJlbnRTY29wZSgpLCBWYXJpYWJsZS5WYXJpYWJsZSwgbGV0T3JDb25zdERlY2wsIDApO1xuICAgICAgICB0aGlzLnZpc2l0UGF0dGVybihsZXRPckNvbnN0RGVjbC5kZWNsYXJhdGlvbnNbMF0uaWQsIChwYXR0ZXJuKSA9PiB7XG4gICAgICAgICAgICB0aGlzLmN1cnJlbnRTY29wZSgpLl9fcmVmZXJlbmNpbmcocGF0dGVybiwgUmVmZXJlbmNlLldSSVRFLCBub2RlLnJpZ2h0LCBudWxsLCB0cnVlLCB0cnVlKTtcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgcmVmZXJlbmNpbmdEZWZhdWx0VmFsdWUocGF0dGVybiwgYXNzaWdubWVudHMsIG1heWJlSW1wbGljaXRHbG9iYWwsIGluaXQpIHtcbiAgICAgICAgY29uc3Qgc2NvcGUgPSB0aGlzLmN1cnJlbnRTY29wZSgpO1xuICAgICAgICBhc3NpZ25tZW50cy5mb3JFYWNoKGFzc2lnbm1lbnQgPT4ge1xuICAgICAgICAgICAgc2NvcGUuX19yZWZlcmVuY2luZyhcbiAgICAgICAgICAgICAgICBwYXR0ZXJuLFxuICAgICAgICAgICAgICAgIFJlZmVyZW5jZS5XUklURSxcbiAgICAgICAgICAgICAgICBhc3NpZ25tZW50LnJpZ2h0LFxuICAgICAgICAgICAgICAgIG1heWJlSW1wbGljaXRHbG9iYWwsXG4gICAgICAgICAgICAgICAgcGF0dGVybiAhPT0gYXNzaWdubWVudC5sZWZ0LFxuICAgICAgICAgICAgICAgIGluaXQpO1xuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICB2aXNpdFBhdHRlcm4obm9kZSwgb3B0aW9ucywgY2FsbGJhY2spIHtcbiAgICAgICAgaWYgKHR5cGVvZiBvcHRpb25zID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICBjYWxsYmFjayA9IG9wdGlvbnM7XG4gICAgICAgICAgICBvcHRpb25zID0ge3Byb2Nlc3NSaWdodEhhbmROb2RlczogZmFsc2V9XG4gICAgICAgIH1cbiAgICAgICAgdHJhdmVyc2VJZGVudGlmaWVySW5QYXR0ZXJuKFxuICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgIG9wdGlvbnMucHJvY2Vzc1JpZ2h0SGFuZE5vZGVzID8gdGhpcyA6IG51bGwsXG4gICAgICAgICAgICBjYWxsYmFjayk7XG4gICAgfVxuXG4gICAgdmlzaXRGdW5jdGlvbihub2RlKSB7XG4gICAgICAgIHZhciBpLCBpejtcbiAgICAgICAgLy8gRnVuY3Rpb25EZWNsYXJhdGlvbiBuYW1lIGlzIGRlZmluZWQgaW4gdXBwZXIgc2NvcGVcbiAgICAgICAgLy8gTk9URTogTm90IHJlZmVycmluZyB2YXJpYWJsZVNjb3BlLiBJdCBpcyBpbnRlbmRlZC5cbiAgICAgICAgLy8gU2luY2VcbiAgICAgICAgLy8gIGluIEVTNSwgRnVuY3Rpb25EZWNsYXJhdGlvbiBzaG91bGQgYmUgaW4gRnVuY3Rpb25Cb2R5LlxuICAgICAgICAvLyAgaW4gRVM2LCBGdW5jdGlvbkRlY2xhcmF0aW9uIHNob3VsZCBiZSBibG9jayBzY29wZWQuXG4gICAgICAgIGlmIChub2RlLnR5cGUgPT09IFN5bnRheC5GdW5jdGlvbkRlY2xhcmF0aW9uKSB7XG4gICAgICAgICAgICAvLyBpZCBpcyBkZWZpbmVkIGluIHVwcGVyIHNjb3BlXG4gICAgICAgICAgICB0aGlzLmN1cnJlbnRTY29wZSgpLl9fZGVmaW5lKG5vZGUuaWQsXG4gICAgICAgICAgICAgICAgICAgIG5ldyBEZWZpbml0aW9uKFxuICAgICAgICAgICAgICAgICAgICAgICAgVmFyaWFibGUuRnVuY3Rpb25OYW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5pZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bGxcbiAgICAgICAgICAgICAgICAgICAgKSk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBGdW5jdGlvbkV4cHJlc3Npb24gd2l0aCBuYW1lIGNyZWF0ZXMgaXRzIHNwZWNpYWwgc2NvcGU7XG4gICAgICAgIC8vIEZ1bmN0aW9uRXhwcmVzc2lvbk5hbWVTY29wZS5cbiAgICAgICAgaWYgKG5vZGUudHlwZSA9PT0gU3ludGF4LkZ1bmN0aW9uRXhwcmVzc2lvbiAmJiBub2RlLmlkKSB7XG4gICAgICAgICAgICB0aGlzLnNjb3BlTWFuYWdlci5fX25lc3RGdW5jdGlvbkV4cHJlc3Npb25OYW1lU2NvcGUobm9kZSk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBDb25zaWRlciB0aGlzIGZ1bmN0aW9uIGlzIGluIHRoZSBNZXRob2REZWZpbml0aW9uLlxuICAgICAgICB0aGlzLnNjb3BlTWFuYWdlci5fX25lc3RGdW5jdGlvblNjb3BlKG5vZGUsIHRoaXMuaXNJbm5lck1ldGhvZERlZmluaXRpb24pO1xuXG4gICAgICAgIC8vIFByb2Nlc3MgcGFyYW1ldGVyIGRlY2xhcmF0aW9ucy5cbiAgICAgICAgZm9yIChpID0gMCwgaXogPSBub2RlLnBhcmFtcy5sZW5ndGg7IGkgPCBpejsgKytpKSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0UGF0dGVybihub2RlLnBhcmFtc1tpXSwge3Byb2Nlc3NSaWdodEhhbmROb2RlczogdHJ1ZX0sIChwYXR0ZXJuLCBpbmZvKSA9PiB7XG4gICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX2RlZmluZShwYXR0ZXJuLFxuICAgICAgICAgICAgICAgICAgICBuZXcgUGFyYW1ldGVyRGVmaW5pdGlvbihcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgaSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGluZm8ucmVzdFxuICAgICAgICAgICAgICAgICAgICApKTtcblxuICAgICAgICAgICAgICAgIHRoaXMucmVmZXJlbmNpbmdEZWZhdWx0VmFsdWUocGF0dGVybiwgaW5mby5hc3NpZ25tZW50cywgbnVsbCwgdHJ1ZSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIGlmIHRoZXJlJ3MgYSByZXN0IGFyZ3VtZW50LCBhZGQgdGhhdFxuICAgICAgICBpZiAobm9kZS5yZXN0KSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0UGF0dGVybih7XG4gICAgICAgICAgICAgICAgdHlwZTogJ1Jlc3RFbGVtZW50JyxcbiAgICAgICAgICAgICAgICBhcmd1bWVudDogbm9kZS5yZXN0XG4gICAgICAgICAgICB9LCAocGF0dGVybikgPT4ge1xuICAgICAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19kZWZpbmUocGF0dGVybixcbiAgICAgICAgICAgICAgICAgICAgbmV3IFBhcmFtZXRlckRlZmluaXRpb24oXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXR0ZXJuLFxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUucGFyYW1zLmxlbmd0aCxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRydWVcbiAgICAgICAgICAgICAgICAgICAgKSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIFNraXAgQmxvY2tTdGF0ZW1lbnQgdG8gcHJldmVudCBjcmVhdGluZyBCbG9ja1N0YXRlbWVudCBzY29wZS5cbiAgICAgICAgaWYgKG5vZGUuYm9keS50eXBlID09PSBTeW50YXguQmxvY2tTdGF0ZW1lbnQpIHtcbiAgICAgICAgICAgIHRoaXMudmlzaXRDaGlsZHJlbihub2RlLmJvZHkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy52aXNpdChub2RlLmJvZHkpO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5jbG9zZShub2RlKTtcbiAgICB9XG5cbiAgICB2aXNpdENsYXNzKG5vZGUpIHtcbiAgICAgICAgaWYgKG5vZGUudHlwZSA9PT0gU3ludGF4LkNsYXNzRGVjbGFyYXRpb24pIHtcbiAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19kZWZpbmUobm9kZS5pZCxcbiAgICAgICAgICAgICAgICAgICAgbmV3IERlZmluaXRpb24oXG4gICAgICAgICAgICAgICAgICAgICAgICBWYXJpYWJsZS5DbGFzc05hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLmlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVsbFxuICAgICAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEZJWE1FOiBNYXliZSBjb25zaWRlciBURFouXG4gICAgICAgIHRoaXMudmlzaXQobm9kZS5zdXBlckNsYXNzKTtcblxuICAgICAgICB0aGlzLnNjb3BlTWFuYWdlci5fX25lc3RDbGFzc1Njb3BlKG5vZGUpO1xuXG4gICAgICAgIGlmIChub2RlLmlkKSB7XG4gICAgICAgICAgICB0aGlzLmN1cnJlbnRTY29wZSgpLl9fZGVmaW5lKG5vZGUuaWQsXG4gICAgICAgICAgICAgICAgICAgIG5ldyBEZWZpbml0aW9uKFxuICAgICAgICAgICAgICAgICAgICAgICAgVmFyaWFibGUuQ2xhc3NOYW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5pZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGVcbiAgICAgICAgICAgICAgICAgICAgKSk7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy52aXNpdChub2RlLmJvZHkpO1xuXG4gICAgICAgIHRoaXMuY2xvc2Uobm9kZSk7XG4gICAgfVxuXG4gICAgdmlzaXRQcm9wZXJ0eShub2RlKSB7XG4gICAgICAgIHZhciBwcmV2aW91cywgaXNNZXRob2REZWZpbml0aW9uO1xuICAgICAgICBpZiAobm9kZS5jb21wdXRlZCkge1xuICAgICAgICAgICAgdGhpcy52aXNpdChub2RlLmtleSk7XG4gICAgICAgIH1cblxuICAgICAgICBpc01ldGhvZERlZmluaXRpb24gPSBub2RlLnR5cGUgPT09IFN5bnRheC5NZXRob2REZWZpbml0aW9uIHx8IG5vZGUubWV0aG9kO1xuICAgICAgICBpZiAoaXNNZXRob2REZWZpbml0aW9uKSB7XG4gICAgICAgICAgICBwcmV2aW91cyA9IHRoaXMucHVzaElubmVyTWV0aG9kRGVmaW5pdGlvbih0cnVlKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnZpc2l0KG5vZGUudmFsdWUpO1xuICAgICAgICBpZiAoaXNNZXRob2REZWZpbml0aW9uKSB7XG4gICAgICAgICAgICB0aGlzLnBvcElubmVyTWV0aG9kRGVmaW5pdGlvbihwcmV2aW91cyk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICB2aXNpdEZvckluKG5vZGUpIHtcbiAgICAgICAgaWYgKG5vZGUubGVmdC50eXBlID09PSBTeW50YXguVmFyaWFibGVEZWNsYXJhdGlvbiAmJiBub2RlLmxlZnQua2luZCAhPT0gJ3ZhcicpIHtcbiAgICAgICAgICAgIHRoaXMubWF0ZXJpYWxpemVURFpTY29wZShub2RlLnJpZ2h0LCBub2RlKTtcbiAgICAgICAgICAgIHRoaXMudmlzaXQobm9kZS5yaWdodCk7XG4gICAgICAgICAgICB0aGlzLmNsb3NlKG5vZGUucmlnaHQpO1xuXG4gICAgICAgICAgICB0aGlzLm1hdGVyaWFsaXplSXRlcmF0aW9uU2NvcGUobm9kZSk7XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUuYm9keSk7XG4gICAgICAgICAgICB0aGlzLmNsb3NlKG5vZGUpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKG5vZGUubGVmdC50eXBlID09PSBTeW50YXguVmFyaWFibGVEZWNsYXJhdGlvbikge1xuICAgICAgICAgICAgICAgIHRoaXMudmlzaXQobm9kZS5sZWZ0KTtcbiAgICAgICAgICAgICAgICB0aGlzLnZpc2l0UGF0dGVybihub2RlLmxlZnQuZGVjbGFyYXRpb25zWzBdLmlkLCAocGF0dGVybikgPT4ge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmN1cnJlbnRTY29wZSgpLl9fcmVmZXJlbmNpbmcocGF0dGVybiwgUmVmZXJlbmNlLldSSVRFLCBub2RlLnJpZ2h0LCBudWxsLCB0cnVlLCB0cnVlKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy52aXNpdFBhdHRlcm4obm9kZS5sZWZ0LCB7cHJvY2Vzc1JpZ2h0SGFuZE5vZGVzOiB0cnVlfSwgKHBhdHRlcm4sIGluZm8pID0+IHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIG1heWJlSW1wbGljaXRHbG9iYWwgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXRoaXMuY3VycmVudFNjb3BlKCkuaXNTdHJpY3QpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1heWJlSW1wbGljaXRHbG9iYWwgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0dGVybjogcGF0dGVybixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlOiBub2RlXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucmVmZXJlbmNpbmdEZWZhdWx0VmFsdWUocGF0dGVybiwgaW5mby5hc3NpZ25tZW50cywgbWF5YmVJbXBsaWNpdEdsb2JhbCwgZmFsc2UpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmN1cnJlbnRTY29wZSgpLl9fcmVmZXJlbmNpbmcocGF0dGVybiwgUmVmZXJlbmNlLldSSVRFLCBub2RlLnJpZ2h0LCBtYXliZUltcGxpY2l0R2xvYmFsLCB0cnVlLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUucmlnaHQpO1xuICAgICAgICAgICAgdGhpcy52aXNpdChub2RlLmJvZHkpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgdmlzaXRWYXJpYWJsZURlY2xhcmF0aW9uKHZhcmlhYmxlVGFyZ2V0U2NvcGUsIHR5cGUsIG5vZGUsIGluZGV4LCBmcm9tVERaKSB7XG4gICAgICAgIC8vIElmIHRoaXMgd2FzIGNhbGxlZCB0byBpbml0aWFsaXplIGEgVERaIHNjb3BlLCB0aGlzIG5lZWRzIHRvIG1ha2UgZGVmaW5pdGlvbnMsIGJ1dCBkb2Vzbid0IG1ha2UgcmVmZXJlbmNlcy5cbiAgICAgICAgdmFyIGRlY2wsIGluaXQ7XG5cbiAgICAgICAgZGVjbCA9IG5vZGUuZGVjbGFyYXRpb25zW2luZGV4XTtcbiAgICAgICAgaW5pdCA9IGRlY2wuaW5pdDtcbiAgICAgICAgdGhpcy52aXNpdFBhdHRlcm4oZGVjbC5pZCwge3Byb2Nlc3NSaWdodEhhbmROb2RlczogIWZyb21URFp9LCAocGF0dGVybiwgaW5mbykgPT4ge1xuICAgICAgICAgICAgdmFyaWFibGVUYXJnZXRTY29wZS5fX2RlZmluZShwYXR0ZXJuLFxuICAgICAgICAgICAgICAgIG5ldyBEZWZpbml0aW9uKFxuICAgICAgICAgICAgICAgICAgICB0eXBlLFxuICAgICAgICAgICAgICAgICAgICBwYXR0ZXJuLFxuICAgICAgICAgICAgICAgICAgICBkZWNsLFxuICAgICAgICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICAgICAgICBpbmRleCxcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5raW5kXG4gICAgICAgICAgICAgICAgKSk7XG5cbiAgICAgICAgICAgIGlmICghZnJvbVREWikge1xuICAgICAgICAgICAgICAgIHRoaXMucmVmZXJlbmNpbmdEZWZhdWx0VmFsdWUocGF0dGVybiwgaW5mby5hc3NpZ25tZW50cywgbnVsbCwgdHJ1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaW5pdCkge1xuICAgICAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19yZWZlcmVuY2luZyhwYXR0ZXJuLCBSZWZlcmVuY2UuV1JJVEUsIGluaXQsIG51bGwsICFpbmZvLnRvcExldmVsLCB0cnVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgQXNzaWdubWVudEV4cHJlc3Npb24obm9kZSkge1xuICAgICAgICBpZiAoaXNQYXR0ZXJuKG5vZGUubGVmdCkpIHtcbiAgICAgICAgICAgIGlmIChub2RlLm9wZXJhdG9yID09PSAnPScpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnZpc2l0UGF0dGVybihub2RlLmxlZnQsIHtwcm9jZXNzUmlnaHRIYW5kTm9kZXM6IHRydWV9LCAocGF0dGVybiwgaW5mbykgPT4ge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbWF5YmVJbXBsaWNpdEdsb2JhbCA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5jdXJyZW50U2NvcGUoKS5pc1N0cmljdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbWF5YmVJbXBsaWNpdEdsb2JhbCA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXR0ZXJuOiBwYXR0ZXJuLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGU6IG5vZGVcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZWZlcmVuY2luZ0RlZmF1bHRWYWx1ZShwYXR0ZXJuLCBpbmZvLmFzc2lnbm1lbnRzLCBtYXliZUltcGxpY2l0R2xvYmFsLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19yZWZlcmVuY2luZyhwYXR0ZXJuLCBSZWZlcmVuY2UuV1JJVEUsIG5vZGUucmlnaHQsIG1heWJlSW1wbGljaXRHbG9iYWwsICFpbmZvLnRvcExldmVsLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19yZWZlcmVuY2luZyhub2RlLmxlZnQsIFJlZmVyZW5jZS5SVywgbm9kZS5yaWdodCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUubGVmdCk7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy52aXNpdChub2RlLnJpZ2h0KTtcbiAgICB9XG5cbiAgICBDYXRjaENsYXVzZShub2RlKSB7XG4gICAgICAgIHRoaXMuc2NvcGVNYW5hZ2VyLl9fbmVzdENhdGNoU2NvcGUobm9kZSk7XG5cbiAgICAgICAgdGhpcy52aXNpdFBhdHRlcm4obm9kZS5wYXJhbSwge3Byb2Nlc3NSaWdodEhhbmROb2RlczogdHJ1ZX0sIChwYXR0ZXJuLCBpbmZvKSA9PiB7XG4gICAgICAgICAgICB0aGlzLmN1cnJlbnRTY29wZSgpLl9fZGVmaW5lKHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgbmV3IERlZmluaXRpb24oXG4gICAgICAgICAgICAgICAgICAgIFZhcmlhYmxlLkNhdGNoQ2xhdXNlLFxuICAgICAgICAgICAgICAgICAgICBub2RlLnBhcmFtLFxuICAgICAgICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgICAgICAgICBudWxsXG4gICAgICAgICAgICAgICAgKSk7XG4gICAgICAgICAgICB0aGlzLnJlZmVyZW5jaW5nRGVmYXVsdFZhbHVlKHBhdHRlcm4sIGluZm8uYXNzaWdubWVudHMsIG51bGwsIHRydWUpO1xuICAgICAgICB9KTtcbiAgICAgICAgdGhpcy52aXNpdChub2RlLmJvZHkpO1xuXG4gICAgICAgIHRoaXMuY2xvc2Uobm9kZSk7XG4gICAgfVxuXG4gICAgUHJvZ3JhbShub2RlKSB7XG4gICAgICAgIHRoaXMuc2NvcGVNYW5hZ2VyLl9fbmVzdEdsb2JhbFNjb3BlKG5vZGUpO1xuXG4gICAgICAgIGlmICh0aGlzLnNjb3BlTWFuYWdlci5fX2lzTm9kZWpzU2NvcGUoKSkge1xuICAgICAgICAgICAgLy8gRm9yY2Ugc3RyaWN0bmVzcyBvZiBHbG9iYWxTY29wZSB0byBmYWxzZSB3aGVuIHVzaW5nIG5vZGUuanMgc2NvcGUuXG4gICAgICAgICAgICB0aGlzLmN1cnJlbnRTY29wZSgpLmlzU3RyaWN0ID0gZmFsc2U7XG4gICAgICAgICAgICB0aGlzLnNjb3BlTWFuYWdlci5fX25lc3RGdW5jdGlvblNjb3BlKG5vZGUsIGZhbHNlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLnNjb3BlTWFuYWdlci5fX2lzRVM2KCkgJiYgdGhpcy5zY29wZU1hbmFnZXIuaXNNb2R1bGUoKSkge1xuICAgICAgICAgICAgdGhpcy5zY29wZU1hbmFnZXIuX19uZXN0TW9kdWxlU2NvcGUobm9kZSk7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnZpc2l0Q2hpbGRyZW4obm9kZSk7XG4gICAgICAgIHRoaXMuY2xvc2Uobm9kZSk7XG4gICAgfVxuXG4gICAgSWRlbnRpZmllcihub2RlKSB7XG4gICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19yZWZlcmVuY2luZyhub2RlKTtcbiAgICB9XG5cbiAgICBVcGRhdGVFeHByZXNzaW9uKG5vZGUpIHtcbiAgICAgICAgaWYgKGlzUGF0dGVybihub2RlLmFyZ3VtZW50KSkge1xuICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX3JlZmVyZW5jaW5nKG5vZGUuYXJndW1lbnQsIFJlZmVyZW5jZS5SVywgbnVsbCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0Q2hpbGRyZW4obm9kZSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBNZW1iZXJFeHByZXNzaW9uKG5vZGUpIHtcbiAgICAgICAgdGhpcy52aXNpdChub2RlLm9iamVjdCk7XG4gICAgICAgIGlmIChub2RlLmNvbXB1dGVkKSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUucHJvcGVydHkpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgUHJvcGVydHkobm9kZSkge1xuICAgICAgICB0aGlzLnZpc2l0UHJvcGVydHkobm9kZSk7XG4gICAgfVxuXG4gICAgTWV0aG9kRGVmaW5pdGlvbihub2RlKSB7XG4gICAgICAgIHRoaXMudmlzaXRQcm9wZXJ0eShub2RlKTtcbiAgICB9XG5cbiAgICBCcmVha1N0YXRlbWVudCgpIHt9XG5cbiAgICBDb250aW51ZVN0YXRlbWVudCgpIHt9XG5cbiAgICBMYWJlbGVkU3RhdGVtZW50KG5vZGUpIHtcbiAgICAgICAgdGhpcy52aXNpdChub2RlLmJvZHkpO1xuICAgIH1cblxuICAgIEZvclN0YXRlbWVudChub2RlKSB7XG4gICAgICAgIC8vIENyZWF0ZSBGb3JTdGF0ZW1lbnQgZGVjbGFyYXRpb24uXG4gICAgICAgIC8vIE5PVEU6IEluIEVTNiwgRm9yU3RhdGVtZW50IGR5bmFtaWNhbGx5IGdlbmVyYXRlc1xuICAgICAgICAvLyBwZXIgaXRlcmF0aW9uIGVudmlyb25tZW50LiBIb3dldmVyLCBlc2NvcGUgaXNcbiAgICAgICAgLy8gYSBzdGF0aWMgYW5hbHl6ZXIsIHdlIG9ubHkgZ2VuZXJhdGUgb25lIHNjb3BlIGZvciBGb3JTdGF0ZW1lbnQuXG4gICAgICAgIGlmIChub2RlLmluaXQgJiYgbm9kZS5pbml0LnR5cGUgPT09IFN5bnRheC5WYXJpYWJsZURlY2xhcmF0aW9uICYmIG5vZGUuaW5pdC5raW5kICE9PSAndmFyJykge1xuICAgICAgICAgICAgdGhpcy5zY29wZU1hbmFnZXIuX19uZXN0Rm9yU2NvcGUobm9kZSk7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnZpc2l0Q2hpbGRyZW4obm9kZSk7XG5cbiAgICAgICAgdGhpcy5jbG9zZShub2RlKTtcbiAgICB9XG5cbiAgICBDbGFzc0V4cHJlc3Npb24obm9kZSkge1xuICAgICAgICB0aGlzLnZpc2l0Q2xhc3Mobm9kZSk7XG4gICAgfVxuXG4gICAgQ2xhc3NEZWNsYXJhdGlvbihub2RlKSB7XG4gICAgICAgIHRoaXMudmlzaXRDbGFzcyhub2RlKTtcbiAgICB9XG5cbiAgICBDYWxsRXhwcmVzc2lvbihub2RlKSB7XG4gICAgICAgIC8vIENoZWNrIHRoaXMgaXMgZGlyZWN0IGNhbGwgdG8gZXZhbFxuICAgICAgICBpZiAoIXRoaXMuc2NvcGVNYW5hZ2VyLl9faWdub3JlRXZhbCgpICYmIG5vZGUuY2FsbGVlLnR5cGUgPT09IFN5bnRheC5JZGVudGlmaWVyICYmIG5vZGUuY2FsbGVlLm5hbWUgPT09ICdldmFsJykge1xuICAgICAgICAgICAgLy8gTk9URTogVGhpcyBzaG91bGQgYmUgYHZhcmlhYmxlU2NvcGVgLiBTaW5jZSBkaXJlY3QgZXZhbCBjYWxsIGFsd2F5cyBjcmVhdGVzIExleGljYWwgZW52aXJvbm1lbnQgYW5kXG4gICAgICAgICAgICAvLyBsZXQgLyBjb25zdCBzaG91bGQgYmUgZW5jbG9zZWQgaW50byBpdC4gT25seSBWYXJpYWJsZURlY2xhcmF0aW9uIGFmZmVjdHMgb24gdGhlIGNhbGxlcidzIGVudmlyb25tZW50LlxuICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS52YXJpYWJsZVNjb3BlLl9fZGV0ZWN0RXZhbCgpO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMudmlzaXRDaGlsZHJlbihub2RlKTtcbiAgICB9XG5cbiAgICBCbG9ja1N0YXRlbWVudChub2RlKSB7XG4gICAgICAgIGlmICh0aGlzLnNjb3BlTWFuYWdlci5fX2lzRVM2KCkpIHtcbiAgICAgICAgICAgIHRoaXMuc2NvcGVNYW5hZ2VyLl9fbmVzdEJsb2NrU2NvcGUobm9kZSk7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnZpc2l0Q2hpbGRyZW4obm9kZSk7XG5cbiAgICAgICAgdGhpcy5jbG9zZShub2RlKTtcbiAgICB9XG5cbiAgICBUaGlzRXhwcmVzc2lvbigpIHtcbiAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS52YXJpYWJsZVNjb3BlLl9fZGV0ZWN0VGhpcygpO1xuICAgIH1cblxuICAgIFdpdGhTdGF0ZW1lbnQobm9kZSkge1xuICAgICAgICB0aGlzLnZpc2l0KG5vZGUub2JqZWN0KTtcbiAgICAgICAgLy8gVGhlbiBuZXN0IHNjb3BlIGZvciBXaXRoU3RhdGVtZW50LlxuICAgICAgICB0aGlzLnNjb3BlTWFuYWdlci5fX25lc3RXaXRoU2NvcGUobm9kZSk7XG5cbiAgICAgICAgdGhpcy52aXNpdChub2RlLmJvZHkpO1xuXG4gICAgICAgIHRoaXMuY2xvc2Uobm9kZSk7XG4gICAgfVxuXG4gICAgVmFyaWFibGVEZWNsYXJhdGlvbihub2RlKSB7XG4gICAgICAgIHZhciB2YXJpYWJsZVRhcmdldFNjb3BlLCBpLCBpeiwgZGVjbDtcbiAgICAgICAgdmFyaWFibGVUYXJnZXRTY29wZSA9IChub2RlLmtpbmQgPT09ICd2YXInKSA/IHRoaXMuY3VycmVudFNjb3BlKCkudmFyaWFibGVTY29wZSA6IHRoaXMuY3VycmVudFNjb3BlKCk7XG4gICAgICAgIGZvciAoaSA9IDAsIGl6ID0gbm9kZS5kZWNsYXJhdGlvbnMubGVuZ3RoOyBpIDwgaXo7ICsraSkge1xuICAgICAgICAgICAgZGVjbCA9IG5vZGUuZGVjbGFyYXRpb25zW2ldO1xuICAgICAgICAgICAgdGhpcy52aXNpdFZhcmlhYmxlRGVjbGFyYXRpb24odmFyaWFibGVUYXJnZXRTY29wZSwgVmFyaWFibGUuVmFyaWFibGUsIG5vZGUsIGkpO1xuICAgICAgICAgICAgaWYgKGRlY2wuaW5pdCkge1xuICAgICAgICAgICAgICAgIHRoaXMudmlzaXQoZGVjbC5pbml0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8vIHNlYyAxMy4xMS44XG4gICAgU3dpdGNoU3RhdGVtZW50KG5vZGUpIHtcbiAgICAgICAgdmFyIGksIGl6O1xuXG4gICAgICAgIHRoaXMudmlzaXQobm9kZS5kaXNjcmltaW5hbnQpO1xuXG4gICAgICAgIGlmICh0aGlzLnNjb3BlTWFuYWdlci5fX2lzRVM2KCkpIHtcbiAgICAgICAgICAgIHRoaXMuc2NvcGVNYW5hZ2VyLl9fbmVzdFN3aXRjaFNjb3BlKG5vZGUpO1xuICAgICAgICB9XG5cbiAgICAgICAgZm9yIChpID0gMCwgaXogPSBub2RlLmNhc2VzLmxlbmd0aDsgaSA8IGl6OyArK2kpIHtcbiAgICAgICAgICAgIHRoaXMudmlzaXQobm9kZS5jYXNlc1tpXSk7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLmNsb3NlKG5vZGUpO1xuICAgIH1cblxuICAgIEZ1bmN0aW9uRGVjbGFyYXRpb24obm9kZSkge1xuICAgICAgICB0aGlzLnZpc2l0RnVuY3Rpb24obm9kZSk7XG4gICAgfVxuXG4gICAgRnVuY3Rpb25FeHByZXNzaW9uKG5vZGUpIHtcbiAgICAgICAgdGhpcy52aXNpdEZ1bmN0aW9uKG5vZGUpO1xuICAgIH1cblxuICAgIEZvck9mU3RhdGVtZW50KG5vZGUpIHtcbiAgICAgICAgdGhpcy52aXNpdEZvckluKG5vZGUpO1xuICAgIH1cblxuICAgIEZvckluU3RhdGVtZW50KG5vZGUpIHtcbiAgICAgICAgdGhpcy52aXNpdEZvckluKG5vZGUpO1xuICAgIH1cblxuICAgIEFycm93RnVuY3Rpb25FeHByZXNzaW9uKG5vZGUpIHtcbiAgICAgICAgdGhpcy52aXNpdEZ1bmN0aW9uKG5vZGUpO1xuICAgIH1cblxuICAgIEltcG9ydERlY2xhcmF0aW9uKG5vZGUpIHtcbiAgICAgICAgdmFyIGltcG9ydGVyO1xuXG4gICAgICAgIGFzc2VydCh0aGlzLnNjb3BlTWFuYWdlci5fX2lzRVM2KCkgJiYgdGhpcy5zY29wZU1hbmFnZXIuaXNNb2R1bGUoKSwgJ0ltcG9ydERlY2xhcmF0aW9uIHNob3VsZCBhcHBlYXIgd2hlbiB0aGUgbW9kZSBpcyBFUzYgYW5kIGluIHRoZSBtb2R1bGUgY29udGV4dC4nKTtcblxuICAgICAgICBpbXBvcnRlciA9IG5ldyBJbXBvcnRlcihub2RlLCB0aGlzKTtcbiAgICAgICAgaW1wb3J0ZXIudmlzaXQobm9kZSk7XG4gICAgfVxuXG4gICAgdmlzaXRFeHBvcnREZWNsYXJhdGlvbihub2RlKSB7XG4gICAgICAgIGlmIChub2RlLnNvdXJjZSkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGlmIChub2RlLmRlY2xhcmF0aW9uKSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUuZGVjbGFyYXRpb24pO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy52aXNpdENoaWxkcmVuKG5vZGUpO1xuICAgIH1cblxuICAgIEV4cG9ydERlY2xhcmF0aW9uKG5vZGUpIHtcbiAgICAgICAgdGhpcy52aXNpdEV4cG9ydERlY2xhcmF0aW9uKG5vZGUpO1xuICAgIH1cblxuICAgIEV4cG9ydE5hbWVkRGVjbGFyYXRpb24obm9kZSkge1xuICAgICAgICB0aGlzLnZpc2l0RXhwb3J0RGVjbGFyYXRpb24obm9kZSk7XG4gICAgfVxuXG4gICAgRXhwb3J0U3BlY2lmaWVyKG5vZGUpIHtcbiAgICAgICAgbGV0IGxvY2FsID0gKG5vZGUuaWQgfHwgbm9kZS5sb2NhbCk7XG4gICAgICAgIHRoaXMudmlzaXQobG9jYWwpO1xuICAgIH1cbn1cblxuLyogdmltOiBzZXQgc3c9NCB0cz00IGV0IHR3PTgwIDogKi9cbiJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
      \ No newline at end of file
      +
      +
      +exports.default = Referencer;
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJlZmVyZW5jZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7QUF1QkE7O0FBQ0E7Ozs7QUFDQTs7OztBQUNBOzs7O0FBQ0E7Ozs7QUFDQTs7QUFDQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFFQSxTQUFTLDJCQUFULENBQXFDLE9BQXJDLEVBQThDLFdBQTlDLEVBQTJELFVBQTNELEVBQXVFLFFBQXZFLEVBQWlGOztBQUU3RSxRQUFJLFVBQVUsNkJBQW1CLE9BQW5CLEVBQTRCLFdBQTVCLEVBQXlDLFFBQXpDLENBQVYsQ0FGeUU7QUFHN0UsWUFBUSxLQUFSLENBQWMsV0FBZDs7O0FBSDZFLFFBTXpFLGNBQWMsSUFBZCxFQUFvQjtBQUNwQixnQkFBUSxjQUFSLENBQXVCLE9BQXZCLENBQStCLFdBQVcsS0FBWCxFQUFrQixVQUFqRCxFQURvQjtLQUF4QjtDQU5KOzs7Ozs7OztJQWlCTTs7O0FBQ0YsYUFERSxRQUNGLENBQVksV0FBWixFQUF5QixVQUF6QixFQUFxQzs4QkFEbkMsVUFDbUM7OzJFQURuQyxxQkFFUSxNQUFNLFdBQVcsT0FBWCxHQURxQjs7QUFFakMsY0FBSyxXQUFMLEdBQW1CLFdBQW5CLENBRmlDO0FBR2pDLGNBQUssVUFBTCxHQUFrQixVQUFsQixDQUhpQzs7S0FBckM7O2lCQURFOztvQ0FPVSxJQUFJLFdBQVc7OztBQUN2QixpQkFBSyxVQUFMLENBQWdCLFlBQWhCLENBQTZCLEVBQTdCLEVBQWlDLFVBQUMsT0FBRCxFQUFhO0FBQzFDLHVCQUFLLFVBQUwsQ0FBZ0IsWUFBaEIsR0FBK0IsUUFBL0IsQ0FBd0MsT0FBeEMsRUFDSSwyQkFDSSxtQkFBUyxhQUFULEVBQ0EsT0FGSixFQUdJLFNBSEosRUFJSSxPQUFLLFdBQUwsRUFDQSxJQUxKLEVBTUksSUFOSixDQURKLEVBRDBDO2FBQWIsQ0FBakMsQ0FEdUI7Ozs7aURBY0YsTUFBTTtBQUMzQixnQkFBSSxRQUFTLEtBQUssS0FBTCxJQUFjLEtBQUssRUFBTCxDQURBO0FBRTNCLGdCQUFJLEtBQUosRUFBVztBQUNQLHFCQUFLLFdBQUwsQ0FBaUIsS0FBakIsRUFBd0IsSUFBeEIsRUFETzthQUFYOzs7OytDQUttQixNQUFNO0FBQ3pCLGdCQUFJLFFBQVMsS0FBSyxLQUFMLElBQWMsS0FBSyxFQUFMLENBREY7QUFFekIsaUJBQUssV0FBTCxDQUFpQixLQUFqQixFQUF3QixJQUF4QixFQUZ5Qjs7Ozt3Q0FLYixNQUFNO0FBQ2xCLGdCQUFJLFFBQVMsS0FBSyxLQUFMLElBQWMsS0FBSyxFQUFMLENBRFQ7QUFFbEIsZ0JBQUksS0FBSyxJQUFMLEVBQVc7QUFDWCxxQkFBSyxXQUFMLENBQWlCLEtBQUssSUFBTCxFQUFXLElBQTVCLEVBRFc7YUFBZixNQUVPO0FBQ0gscUJBQUssV0FBTCxDQUFpQixLQUFqQixFQUF3QixJQUF4QixFQURHO2FBRlA7Ozs7V0FuQ0Y7RUFBaUIsb0JBQVUsT0FBVjs7Ozs7SUE0Q0Y7OztBQUNqQixhQURpQixVQUNqQixDQUFZLE9BQVosRUFBcUIsWUFBckIsRUFBbUM7OEJBRGxCLFlBQ2tCOzs0RUFEbEIsdUJBRVAsTUFBTSxVQURtQjs7QUFFL0IsZUFBSyxPQUFMLEdBQWUsT0FBZixDQUYrQjtBQUcvQixlQUFLLFlBQUwsR0FBb0IsWUFBcEIsQ0FIK0I7QUFJL0IsZUFBSyxNQUFMLEdBQWMsSUFBZCxDQUorQjtBQUsvQixlQUFLLHVCQUFMLEdBQStCLEtBQS9CLENBTCtCOztLQUFuQzs7aUJBRGlCOzt1Q0FTRjtBQUNYLG1CQUFPLEtBQUssWUFBTCxDQUFrQixjQUFsQixDQURJOzs7OzhCQUlULE1BQU07QUFDUixtQkFBTyxLQUFLLFlBQUwsTUFBdUIsU0FBUyxLQUFLLFlBQUwsR0FBb0IsS0FBcEIsRUFBMkI7QUFDOUQscUJBQUssWUFBTCxDQUFrQixjQUFsQixHQUFtQyxLQUFLLFlBQUwsR0FBb0IsT0FBcEIsQ0FBNEIsS0FBSyxZQUFMLENBQS9ELENBRDhEO2FBQWxFOzs7O2tEQUtzQix5QkFBeUI7QUFDL0MsZ0JBQUksV0FBVyxLQUFLLHVCQUFMLENBRGdDO0FBRS9DLGlCQUFLLHVCQUFMLEdBQStCLHVCQUEvQixDQUYrQztBQUcvQyxtQkFBTyxRQUFQLENBSCtDOzs7O2lEQU0xQix5QkFBeUI7QUFDOUMsaUJBQUssdUJBQUwsR0FBK0IsdUJBQS9CLENBRDhDOzs7OzRDQUk5QixNQUFNLGVBQWU7OztBQUdyQyxpQkFBSyxZQUFMLENBQWtCLGNBQWxCLENBQWlDLElBQWpDLEVBQXVDLGFBQXZDLEVBSHFDO0FBSXJDLGlCQUFLLHdCQUFMLENBQThCLEtBQUssWUFBTCxFQUE5QixFQUFtRCxtQkFBUyxHQUFULEVBQWMsY0FBYyxJQUFkLEVBQW9CLENBQXJGLEVBQXdGLElBQXhGLEVBSnFDOzs7O2tEQU9mLE1BQU07Ozs7QUFFNUIsZ0JBQUksY0FBSixDQUY0QjtBQUc1QixpQkFBSyxZQUFMLENBQWtCLGNBQWxCLENBQWlDLElBQWpDLEVBSDRCO0FBSTVCLDZCQUFpQixLQUFLLElBQUwsQ0FKVztBQUs1QixpQkFBSyx3QkFBTCxDQUE4QixLQUFLLFlBQUwsRUFBOUIsRUFBbUQsbUJBQVMsUUFBVCxFQUFtQixjQUF0RSxFQUFzRixDQUF0RixFQUw0QjtBQU01QixpQkFBSyxZQUFMLENBQWtCLGVBQWUsWUFBZixDQUE0QixDQUE1QixFQUErQixFQUEvQixFQUFtQyxVQUFDLE9BQUQsRUFBYTtBQUM5RCx1QkFBSyxZQUFMLEdBQW9CLGFBQXBCLENBQWtDLE9BQWxDLEVBQTJDLG9CQUFVLEtBQVYsRUFBaUIsS0FBSyxLQUFMLEVBQVksSUFBeEUsRUFBOEUsSUFBOUUsRUFBb0YsSUFBcEYsRUFEOEQ7YUFBYixDQUFyRCxDQU40Qjs7OztnREFXUixTQUFTLGFBQWEscUJBQXFCLE1BQU07QUFDckUsZ0JBQU0sUUFBUSxLQUFLLFlBQUwsRUFBUixDQUQrRDtBQUVyRSx3QkFBWSxPQUFaLENBQW9CLHNCQUFjO0FBQzlCLHNCQUFNLGFBQU4sQ0FDSSxPQURKLEVBRUksb0JBQVUsS0FBVixFQUNBLFdBQVcsS0FBWCxFQUNBLG1CQUpKLEVBS0ksWUFBWSxXQUFXLElBQVgsRUFDWixJQU5KLEVBRDhCO2FBQWQsQ0FBcEIsQ0FGcUU7Ozs7cUNBYTVELE1BQU0sU0FBUyxVQUFVO0FBQ2xDLGdCQUFJLE9BQU8sT0FBUCxLQUFtQixVQUFuQixFQUErQjtBQUMvQiwyQkFBVyxPQUFYLENBRCtCO0FBRS9CLDBCQUFVLEVBQUMsdUJBQXVCLEtBQXZCLEVBQVgsQ0FGK0I7YUFBbkM7QUFJQSx3Q0FDSSxLQUFLLE9BQUwsRUFDQSxJQUZKLEVBR0ksUUFBUSxxQkFBUixHQUFnQyxJQUFoQyxHQUF1QyxJQUF2QyxFQUNBLFFBSkosRUFMa0M7Ozs7c0NBWXhCLE1BQU07OztBQUNoQixnQkFBSSxDQUFKLEVBQU8sRUFBUDs7Ozs7O0FBRGdCLGdCQU9aLEtBQUssSUFBTCxLQUFjLG1CQUFPLG1CQUFQLEVBQTRCOztBQUUxQyxxQkFBSyxZQUFMLEdBQW9CLFFBQXBCLENBQTZCLEtBQUssRUFBTCxFQUNyQiwyQkFDSSxtQkFBUyxZQUFULEVBQ0EsS0FBSyxFQUFMLEVBQ0EsSUFISixFQUlJLElBSkosRUFLSSxJQUxKLEVBTUksSUFOSixDQURSLEVBRjBDO2FBQTlDOzs7O0FBUGdCLGdCQXNCWixLQUFLLElBQUwsS0FBYyxtQkFBTyxrQkFBUCxJQUE2QixLQUFLLEVBQUwsRUFBUztBQUNwRCxxQkFBSyxZQUFMLENBQWtCLGlDQUFsQixDQUFvRCxJQUFwRCxFQURvRDthQUF4RDs7O0FBdEJnQixnQkEyQmhCLENBQUssWUFBTCxDQUFrQixtQkFBbEIsQ0FBc0MsSUFBdEMsRUFBNEMsS0FBSyx1QkFBTCxDQUE1Qzs7O0FBM0JnQixpQkE4QlgsSUFBSSxDQUFKLEVBQU8sS0FBSyxLQUFLLE1BQUwsQ0FBWSxNQUFaLEVBQW9CLElBQUksRUFBSixFQUFRLEVBQUUsQ0FBRixFQUFLO0FBQzlDLHFCQUFLLFlBQUwsQ0FBa0IsS0FBSyxNQUFMLENBQVksQ0FBWixDQUFsQixFQUFrQyxFQUFDLHVCQUF1QixJQUF2QixFQUFuQyxFQUFpRSxVQUFDLE9BQUQsRUFBVSxJQUFWLEVBQW1CO0FBQ2hGLDJCQUFLLFlBQUwsR0FBb0IsUUFBcEIsQ0FBNkIsT0FBN0IsRUFDSSxvQ0FDSSxPQURKLEVBRUksSUFGSixFQUdJLENBSEosRUFJSSxLQUFLLElBQUwsQ0FMUixFQURnRjs7QUFTaEYsMkJBQUssdUJBQUwsQ0FBNkIsT0FBN0IsRUFBc0MsS0FBSyxXQUFMLEVBQWtCLElBQXhELEVBQThELElBQTlELEVBVGdGO2lCQUFuQixDQUFqRSxDQUQ4QzthQUFsRDs7O0FBOUJnQixnQkE2Q1osS0FBSyxJQUFMLEVBQVc7QUFDWCxxQkFBSyxZQUFMLENBQWtCO0FBQ2QsMEJBQU0sYUFBTjtBQUNBLDhCQUFVLEtBQUssSUFBTDtpQkFGZCxFQUdHLFVBQUMsT0FBRCxFQUFhO0FBQ1osMkJBQUssWUFBTCxHQUFvQixRQUFwQixDQUE2QixPQUE3QixFQUNJLG9DQUNJLE9BREosRUFFSSxJQUZKLEVBR0ksS0FBSyxNQUFMLENBQVksTUFBWixFQUNBLElBSkosQ0FESixFQURZO2lCQUFiLENBSEgsQ0FEVzthQUFmOzs7QUE3Q2dCLGdCQTZEWixLQUFLLElBQUwsQ0FBVSxJQUFWLEtBQW1CLG1CQUFPLGNBQVAsRUFBdUI7QUFDMUMscUJBQUssYUFBTCxDQUFtQixLQUFLLElBQUwsQ0FBbkIsQ0FEMEM7YUFBOUMsTUFFTztBQUNILHFCQUFLLEtBQUwsQ0FBVyxLQUFLLElBQUwsQ0FBWCxDQURHO2FBRlA7O0FBTUEsaUJBQUssS0FBTCxDQUFXLElBQVgsRUFuRWdCOzs7O21DQXNFVCxNQUFNO0FBQ2IsZ0JBQUksS0FBSyxJQUFMLEtBQWMsbUJBQU8sZ0JBQVAsRUFBeUI7QUFDdkMscUJBQUssWUFBTCxHQUFvQixRQUFwQixDQUE2QixLQUFLLEVBQUwsRUFDckIsMkJBQ0ksbUJBQVMsU0FBVCxFQUNBLEtBQUssRUFBTCxFQUNBLElBSEosRUFJSSxJQUpKLEVBS0ksSUFMSixFQU1JLElBTkosQ0FEUixFQUR1QzthQUEzQzs7O0FBRGEsZ0JBY2IsQ0FBSyxLQUFMLENBQVcsS0FBSyxVQUFMLENBQVgsQ0FkYTs7QUFnQmIsaUJBQUssWUFBTCxDQUFrQixnQkFBbEIsQ0FBbUMsSUFBbkMsRUFoQmE7O0FBa0JiLGdCQUFJLEtBQUssRUFBTCxFQUFTO0FBQ1QscUJBQUssWUFBTCxHQUFvQixRQUFwQixDQUE2QixLQUFLLEVBQUwsRUFDckIsMkJBQ0ksbUJBQVMsU0FBVCxFQUNBLEtBQUssRUFBTCxFQUNBLElBSEosQ0FEUixFQURTO2FBQWI7QUFRQSxpQkFBSyxLQUFMLENBQVcsS0FBSyxJQUFMLENBQVgsQ0ExQmE7O0FBNEJiLGlCQUFLLEtBQUwsQ0FBVyxJQUFYLEVBNUJhOzs7O3NDQStCSCxNQUFNO0FBQ2hCLGdCQUFJLFFBQUosRUFBYyxrQkFBZCxDQURnQjtBQUVoQixnQkFBSSxLQUFLLFFBQUwsRUFBZTtBQUNmLHFCQUFLLEtBQUwsQ0FBVyxLQUFLLEdBQUwsQ0FBWCxDQURlO2FBQW5COztBQUlBLGlDQUFxQixLQUFLLElBQUwsS0FBYyxtQkFBTyxnQkFBUCxDQU5uQjtBQU9oQixnQkFBSSxrQkFBSixFQUF3QjtBQUNwQiwyQkFBVyxLQUFLLHlCQUFMLENBQStCLElBQS9CLENBQVgsQ0FEb0I7YUFBeEI7QUFHQSxpQkFBSyxLQUFMLENBQVcsS0FBSyxLQUFMLENBQVgsQ0FWZ0I7QUFXaEIsZ0JBQUksa0JBQUosRUFBd0I7QUFDcEIscUJBQUssd0JBQUwsQ0FBOEIsUUFBOUIsRUFEb0I7YUFBeEI7Ozs7bUNBS08sTUFBTTs7O0FBQ2IsZ0JBQUksS0FBSyxJQUFMLENBQVUsSUFBVixLQUFtQixtQkFBTyxtQkFBUCxJQUE4QixLQUFLLElBQUwsQ0FBVSxJQUFWLEtBQW1CLEtBQW5CLEVBQTBCO0FBQzNFLHFCQUFLLG1CQUFMLENBQXlCLEtBQUssS0FBTCxFQUFZLElBQXJDLEVBRDJFO0FBRTNFLHFCQUFLLEtBQUwsQ0FBVyxLQUFLLEtBQUwsQ0FBWCxDQUYyRTtBQUczRSxxQkFBSyxLQUFMLENBQVcsS0FBSyxLQUFMLENBQVgsQ0FIMkU7O0FBSzNFLHFCQUFLLHlCQUFMLENBQStCLElBQS9CLEVBTDJFO0FBTTNFLHFCQUFLLEtBQUwsQ0FBVyxLQUFLLElBQUwsQ0FBWCxDQU4yRTtBQU8zRSxxQkFBSyxLQUFMLENBQVcsSUFBWCxFQVAyRTthQUEvRSxNQVFPO0FBQ0gsb0JBQUksS0FBSyxJQUFMLENBQVUsSUFBVixLQUFtQixtQkFBTyxtQkFBUCxFQUE0QjtBQUMvQyx5QkFBSyxLQUFMLENBQVcsS0FBSyxJQUFMLENBQVgsQ0FEK0M7QUFFL0MseUJBQUssWUFBTCxDQUFrQixLQUFLLElBQUwsQ0FBVSxZQUFWLENBQXVCLENBQXZCLEVBQTBCLEVBQTFCLEVBQThCLFVBQUMsT0FBRCxFQUFhO0FBQ3pELCtCQUFLLFlBQUwsR0FBb0IsYUFBcEIsQ0FBa0MsT0FBbEMsRUFBMkMsb0JBQVUsS0FBVixFQUFpQixLQUFLLEtBQUwsRUFBWSxJQUF4RSxFQUE4RSxJQUE5RSxFQUFvRixJQUFwRixFQUR5RDtxQkFBYixDQUFoRCxDQUYrQztpQkFBbkQsTUFLTztBQUNILHlCQUFLLFlBQUwsQ0FBa0IsS0FBSyxJQUFMLEVBQVcsRUFBQyx1QkFBdUIsSUFBdkIsRUFBOUIsRUFBNEQsVUFBQyxPQUFELEVBQVUsSUFBVixFQUFtQjtBQUMzRSw0QkFBSSxzQkFBc0IsSUFBdEIsQ0FEdUU7QUFFM0UsNEJBQUksQ0FBQyxPQUFLLFlBQUwsR0FBb0IsUUFBcEIsRUFBOEI7QUFDL0Isa0RBQXNCO0FBQ2xCLHlDQUFTLE9BQVQ7QUFDQSxzQ0FBTSxJQUFOOzZCQUZKLENBRCtCO3lCQUFuQztBQU1BLCtCQUFLLHVCQUFMLENBQTZCLE9BQTdCLEVBQXNDLEtBQUssV0FBTCxFQUFrQixtQkFBeEQsRUFBNkUsS0FBN0UsRUFSMkU7QUFTM0UsK0JBQUssWUFBTCxHQUFvQixhQUFwQixDQUFrQyxPQUFsQyxFQUEyQyxvQkFBVSxLQUFWLEVBQWlCLEtBQUssS0FBTCxFQUFZLG1CQUF4RSxFQUE2RixJQUE3RixFQUFtRyxLQUFuRyxFQVQyRTtxQkFBbkIsQ0FBNUQsQ0FERztpQkFMUDtBQWtCQSxxQkFBSyxLQUFMLENBQVcsS0FBSyxLQUFMLENBQVgsQ0FuQkc7QUFvQkgscUJBQUssS0FBTCxDQUFXLEtBQUssSUFBTCxDQUFYLENBcEJHO2FBUlA7Ozs7aURBZ0NxQixxQkFBcUIsTUFBTSxNQUFNLE9BQU8sU0FBUzs7OztBQUV0RSxnQkFBSSxJQUFKLEVBQVUsSUFBVixDQUZzRTs7QUFJdEUsbUJBQU8sS0FBSyxZQUFMLENBQWtCLEtBQWxCLENBQVAsQ0FKc0U7QUFLdEUsbUJBQU8sS0FBSyxJQUFMLENBTCtEO0FBTXRFLGlCQUFLLFlBQUwsQ0FBa0IsS0FBSyxFQUFMLEVBQVMsRUFBQyx1QkFBdUIsQ0FBQyxPQUFELEVBQW5ELEVBQThELFVBQUMsT0FBRCxFQUFVLElBQVYsRUFBbUI7QUFDN0Usb0NBQW9CLFFBQXBCLENBQTZCLE9BQTdCLEVBQ0ksMkJBQ0ksSUFESixFQUVJLE9BRkosRUFHSSxJQUhKLEVBSUksSUFKSixFQUtJLEtBTEosRUFNSSxLQUFLLElBQUwsQ0FQUixFQUQ2RTs7QUFXN0Usb0JBQUksQ0FBQyxPQUFELEVBQVU7QUFDViwyQkFBSyx1QkFBTCxDQUE2QixPQUE3QixFQUFzQyxLQUFLLFdBQUwsRUFBa0IsSUFBeEQsRUFBOEQsSUFBOUQsRUFEVTtpQkFBZDtBQUdBLG9CQUFJLElBQUosRUFBVTtBQUNOLDJCQUFLLFlBQUwsR0FBb0IsYUFBcEIsQ0FBa0MsT0FBbEMsRUFBMkMsb0JBQVUsS0FBVixFQUFpQixJQUE1RCxFQUFrRSxJQUFsRSxFQUF3RSxDQUFDLEtBQUssUUFBTCxFQUFlLElBQXhGLEVBRE07aUJBQVY7YUFkMEQsQ0FBOUQsQ0FOc0U7Ozs7NkNBMEJyRCxNQUFNOzs7QUFDdkIsZ0JBQUkseUJBQWUsU0FBZixDQUF5QixLQUFLLElBQUwsQ0FBN0IsRUFBeUM7QUFDckMsb0JBQUksS0FBSyxRQUFMLEtBQWtCLEdBQWxCLEVBQXVCO0FBQ3ZCLHlCQUFLLFlBQUwsQ0FBa0IsS0FBSyxJQUFMLEVBQVcsRUFBQyx1QkFBdUIsSUFBdkIsRUFBOUIsRUFBNEQsVUFBQyxPQUFELEVBQVUsSUFBVixFQUFtQjtBQUMzRSw0QkFBSSxzQkFBc0IsSUFBdEIsQ0FEdUU7QUFFM0UsNEJBQUksQ0FBQyxPQUFLLFlBQUwsR0FBb0IsUUFBcEIsRUFBOEI7QUFDL0Isa0RBQXNCO0FBQ2xCLHlDQUFTLE9BQVQ7QUFDQSxzQ0FBTSxJQUFOOzZCQUZKLENBRCtCO3lCQUFuQztBQU1BLCtCQUFLLHVCQUFMLENBQTZCLE9BQTdCLEVBQXNDLEtBQUssV0FBTCxFQUFrQixtQkFBeEQsRUFBNkUsS0FBN0UsRUFSMkU7QUFTM0UsK0JBQUssWUFBTCxHQUFvQixhQUFwQixDQUFrQyxPQUFsQyxFQUEyQyxvQkFBVSxLQUFWLEVBQWlCLEtBQUssS0FBTCxFQUFZLG1CQUF4RSxFQUE2RixDQUFDLEtBQUssUUFBTCxFQUFlLEtBQTdHLEVBVDJFO3FCQUFuQixDQUE1RCxDQUR1QjtpQkFBM0IsTUFZTztBQUNILHlCQUFLLFlBQUwsR0FBb0IsYUFBcEIsQ0FBa0MsS0FBSyxJQUFMLEVBQVcsb0JBQVUsRUFBVixFQUFjLEtBQUssS0FBTCxDQUEzRCxDQURHO2lCQVpQO2FBREosTUFnQk87QUFDSCxxQkFBSyxLQUFMLENBQVcsS0FBSyxJQUFMLENBQVgsQ0FERzthQWhCUDtBQW1CQSxpQkFBSyxLQUFMLENBQVcsS0FBSyxLQUFMLENBQVgsQ0FwQnVCOzs7O29DQXVCZixNQUFNOzs7QUFDZCxpQkFBSyxZQUFMLENBQWtCLGdCQUFsQixDQUFtQyxJQUFuQyxFQURjOztBQUdkLGlCQUFLLFlBQUwsQ0FBa0IsS0FBSyxLQUFMLEVBQVksRUFBQyx1QkFBdUIsSUFBdkIsRUFBL0IsRUFBNkQsVUFBQyxPQUFELEVBQVUsSUFBVixFQUFtQjtBQUM1RSx1QkFBSyxZQUFMLEdBQW9CLFFBQXBCLENBQTZCLE9BQTdCLEVBQ0ksMkJBQ0ksbUJBQVMsV0FBVCxFQUNBLEtBQUssS0FBTCxFQUNBLElBSEosRUFJSSxJQUpKLEVBS0ksSUFMSixFQU1JLElBTkosQ0FESixFQUQ0RTtBQVU1RSx1QkFBSyx1QkFBTCxDQUE2QixPQUE3QixFQUFzQyxLQUFLLFdBQUwsRUFBa0IsSUFBeEQsRUFBOEQsSUFBOUQsRUFWNEU7YUFBbkIsQ0FBN0QsQ0FIYztBQWVkLGlCQUFLLEtBQUwsQ0FBVyxLQUFLLElBQUwsQ0FBWCxDQWZjOztBQWlCZCxpQkFBSyxLQUFMLENBQVcsSUFBWCxFQWpCYzs7OztnQ0FvQlYsTUFBTTtBQUNWLGlCQUFLLFlBQUwsQ0FBa0IsaUJBQWxCLENBQW9DLElBQXBDLEVBRFU7O0FBR1YsZ0JBQUksS0FBSyxZQUFMLENBQWtCLGVBQWxCLEVBQUosRUFBeUM7O0FBRXJDLHFCQUFLLFlBQUwsR0FBb0IsUUFBcEIsR0FBK0IsS0FBL0IsQ0FGcUM7QUFHckMscUJBQUssWUFBTCxDQUFrQixtQkFBbEIsQ0FBc0MsSUFBdEMsRUFBNEMsS0FBNUMsRUFIcUM7YUFBekM7O0FBTUEsZ0JBQUksS0FBSyxZQUFMLENBQWtCLE9BQWxCLE1BQStCLEtBQUssWUFBTCxDQUFrQixRQUFsQixFQUEvQixFQUE2RDtBQUM3RCxxQkFBSyxZQUFMLENBQWtCLGlCQUFsQixDQUFvQyxJQUFwQyxFQUQ2RDthQUFqRTs7QUFJQSxnQkFBSSxLQUFLLFlBQUwsQ0FBa0IscUJBQWxCLE1BQTZDLEtBQUssWUFBTCxDQUFrQixlQUFsQixFQUE3QyxFQUFrRjtBQUNsRixxQkFBSyxZQUFMLEdBQW9CLFFBQXBCLEdBQStCLElBQS9CLENBRGtGO2FBQXRGOztBQUlBLGlCQUFLLGFBQUwsQ0FBbUIsSUFBbkIsRUFqQlU7QUFrQlYsaUJBQUssS0FBTCxDQUFXLElBQVgsRUFsQlU7Ozs7bUNBcUJILE1BQU07QUFDYixpQkFBSyxZQUFMLEdBQW9CLGFBQXBCLENBQWtDLElBQWxDLEVBRGE7Ozs7eUNBSUEsTUFBTTtBQUNuQixnQkFBSSx5QkFBZSxTQUFmLENBQXlCLEtBQUssUUFBTCxDQUE3QixFQUE2QztBQUN6QyxxQkFBSyxZQUFMLEdBQW9CLGFBQXBCLENBQWtDLEtBQUssUUFBTCxFQUFlLG9CQUFVLEVBQVYsRUFBYyxJQUEvRCxFQUR5QzthQUE3QyxNQUVPO0FBQ0gscUJBQUssYUFBTCxDQUFtQixJQUFuQixFQURHO2FBRlA7Ozs7eUNBT2EsTUFBTTtBQUNuQixpQkFBSyxLQUFMLENBQVcsS0FBSyxNQUFMLENBQVgsQ0FEbUI7QUFFbkIsZ0JBQUksS0FBSyxRQUFMLEVBQWU7QUFDZixxQkFBSyxLQUFMLENBQVcsS0FBSyxRQUFMLENBQVgsQ0FEZTthQUFuQjs7OztpQ0FLSyxNQUFNO0FBQ1gsaUJBQUssYUFBTCxDQUFtQixJQUFuQixFQURXOzs7O3lDQUlFLE1BQU07QUFDbkIsaUJBQUssYUFBTCxDQUFtQixJQUFuQixFQURtQjs7Ozt5Q0FJTjs7OzRDQUVHOzs7eUNBRUgsTUFBTTtBQUNuQixpQkFBSyxLQUFMLENBQVcsS0FBSyxJQUFMLENBQVgsQ0FEbUI7Ozs7cUNBSVYsTUFBTTs7Ozs7QUFLZixnQkFBSSxLQUFLLElBQUwsSUFBYSxLQUFLLElBQUwsQ0FBVSxJQUFWLEtBQW1CLG1CQUFPLG1CQUFQLElBQThCLEtBQUssSUFBTCxDQUFVLElBQVYsS0FBbUIsS0FBbkIsRUFBMEI7QUFDeEYscUJBQUssWUFBTCxDQUFrQixjQUFsQixDQUFpQyxJQUFqQyxFQUR3RjthQUE1Rjs7QUFJQSxpQkFBSyxhQUFMLENBQW1CLElBQW5CLEVBVGU7O0FBV2YsaUJBQUssS0FBTCxDQUFXLElBQVgsRUFYZTs7Ozt3Q0FjSCxNQUFNO0FBQ2xCLGlCQUFLLFVBQUwsQ0FBZ0IsSUFBaEIsRUFEa0I7Ozs7eUNBSUwsTUFBTTtBQUNuQixpQkFBSyxVQUFMLENBQWdCLElBQWhCLEVBRG1COzs7O3VDQUlSLE1BQU07O0FBRWpCLGdCQUFJLENBQUMsS0FBSyxZQUFMLENBQWtCLFlBQWxCLEVBQUQsSUFBcUMsS0FBSyxNQUFMLENBQVksSUFBWixLQUFxQixtQkFBTyxVQUFQLElBQXFCLEtBQUssTUFBTCxDQUFZLElBQVosS0FBcUIsTUFBckIsRUFBNkI7OztBQUc1RyxxQkFBSyxZQUFMLEdBQW9CLGFBQXBCLENBQWtDLFlBQWxDLEdBSDRHO2FBQWhIO0FBS0EsaUJBQUssYUFBTCxDQUFtQixJQUFuQixFQVBpQjs7Ozt1Q0FVTixNQUFNO0FBQ2pCLGdCQUFJLEtBQUssWUFBTCxDQUFrQixPQUFsQixFQUFKLEVBQWlDO0FBQzdCLHFCQUFLLFlBQUwsQ0FBa0IsZ0JBQWxCLENBQW1DLElBQW5DLEVBRDZCO2FBQWpDOztBQUlBLGlCQUFLLGFBQUwsQ0FBbUIsSUFBbkIsRUFMaUI7O0FBT2pCLGlCQUFLLEtBQUwsQ0FBVyxJQUFYLEVBUGlCOzs7O3lDQVVKO0FBQ2IsaUJBQUssWUFBTCxHQUFvQixhQUFwQixDQUFrQyxZQUFsQyxHQURhOzs7O3NDQUlILE1BQU07QUFDaEIsaUJBQUssS0FBTCxDQUFXLEtBQUssTUFBTCxDQUFYOztBQURnQixnQkFHaEIsQ0FBSyxZQUFMLENBQWtCLGVBQWxCLENBQWtDLElBQWxDLEVBSGdCOztBQUtoQixpQkFBSyxLQUFMLENBQVcsS0FBSyxJQUFMLENBQVgsQ0FMZ0I7O0FBT2hCLGlCQUFLLEtBQUwsQ0FBVyxJQUFYLEVBUGdCOzs7OzRDQVVBLE1BQU07QUFDdEIsZ0JBQUksbUJBQUosRUFBeUIsQ0FBekIsRUFBNEIsRUFBNUIsRUFBZ0MsSUFBaEMsQ0FEc0I7QUFFdEIsa0NBQXNCLElBQUMsQ0FBSyxJQUFMLEtBQWMsS0FBZCxHQUF1QixLQUFLLFlBQUwsR0FBb0IsYUFBcEIsR0FBb0MsS0FBSyxZQUFMLEVBQTVELENBRkE7QUFHdEIsaUJBQUssSUFBSSxDQUFKLEVBQU8sS0FBSyxLQUFLLFlBQUwsQ0FBa0IsTUFBbEIsRUFBMEIsSUFBSSxFQUFKLEVBQVEsRUFBRSxDQUFGLEVBQUs7QUFDcEQsdUJBQU8sS0FBSyxZQUFMLENBQWtCLENBQWxCLENBQVAsQ0FEb0Q7QUFFcEQscUJBQUssd0JBQUwsQ0FBOEIsbUJBQTlCLEVBQW1ELG1CQUFTLFFBQVQsRUFBbUIsSUFBdEUsRUFBNEUsQ0FBNUUsRUFGb0Q7QUFHcEQsb0JBQUksS0FBSyxJQUFMLEVBQVc7QUFDWCx5QkFBSyxLQUFMLENBQVcsS0FBSyxJQUFMLENBQVgsQ0FEVztpQkFBZjthQUhKOzs7Ozs7O3dDQVVZLE1BQU07QUFDbEIsZ0JBQUksQ0FBSixFQUFPLEVBQVAsQ0FEa0I7O0FBR2xCLGlCQUFLLEtBQUwsQ0FBVyxLQUFLLFlBQUwsQ0FBWCxDQUhrQjs7QUFLbEIsZ0JBQUksS0FBSyxZQUFMLENBQWtCLE9BQWxCLEVBQUosRUFBaUM7QUFDN0IscUJBQUssWUFBTCxDQUFrQixpQkFBbEIsQ0FBb0MsSUFBcEMsRUFENkI7YUFBakM7O0FBSUEsaUJBQUssSUFBSSxDQUFKLEVBQU8sS0FBSyxLQUFLLEtBQUwsQ0FBVyxNQUFYLEVBQW1CLElBQUksRUFBSixFQUFRLEVBQUUsQ0FBRixFQUFLO0FBQzdDLHFCQUFLLEtBQUwsQ0FBVyxLQUFLLEtBQUwsQ0FBVyxDQUFYLENBQVgsRUFENkM7YUFBakQ7O0FBSUEsaUJBQUssS0FBTCxDQUFXLElBQVgsRUFia0I7Ozs7NENBZ0JGLE1BQU07QUFDdEIsaUJBQUssYUFBTCxDQUFtQixJQUFuQixFQURzQjs7OzsyQ0FJUCxNQUFNO0FBQ3JCLGlCQUFLLGFBQUwsQ0FBbUIsSUFBbkIsRUFEcUI7Ozs7dUNBSVYsTUFBTTtBQUNqQixpQkFBSyxVQUFMLENBQWdCLElBQWhCLEVBRGlCOzs7O3VDQUlOLE1BQU07QUFDakIsaUJBQUssVUFBTCxDQUFnQixJQUFoQixFQURpQjs7OztnREFJRyxNQUFNO0FBQzFCLGlCQUFLLGFBQUwsQ0FBbUIsSUFBbkIsRUFEMEI7Ozs7MENBSVosTUFBTTtBQUNwQixnQkFBSSxRQUFKLENBRG9COztBQUdwQixrQ0FBTyxLQUFLLFlBQUwsQ0FBa0IsT0FBbEIsTUFBK0IsS0FBSyxZQUFMLENBQWtCLFFBQWxCLEVBQS9CLEVBQTZELGlGQUFwRSxFQUhvQjs7QUFLcEIsdUJBQVcsSUFBSSxRQUFKLENBQWEsSUFBYixFQUFtQixJQUFuQixDQUFYLENBTG9CO0FBTXBCLHFCQUFTLEtBQVQsQ0FBZSxJQUFmLEVBTm9COzs7OytDQVNELE1BQU07QUFDekIsZ0JBQUksS0FBSyxNQUFMLEVBQWE7QUFDYix1QkFEYTthQUFqQjtBQUdBLGdCQUFJLEtBQUssV0FBTCxFQUFrQjtBQUNsQixxQkFBSyxLQUFMLENBQVcsS0FBSyxXQUFMLENBQVgsQ0FEa0I7QUFFbEIsdUJBRmtCO2FBQXRCOztBQUtBLGlCQUFLLGFBQUwsQ0FBbUIsSUFBbkIsRUFUeUI7Ozs7MENBWVgsTUFBTTtBQUNwQixpQkFBSyxzQkFBTCxDQUE0QixJQUE1QixFQURvQjs7OzsrQ0FJRCxNQUFNO0FBQ3pCLGlCQUFLLHNCQUFMLENBQTRCLElBQTVCLEVBRHlCOzs7O3dDQUliLE1BQU07QUFDbEIsZ0JBQUksUUFBUyxLQUFLLEVBQUwsSUFBVyxLQUFLLEtBQUwsQ0FETjtBQUVsQixpQkFBSyxLQUFMLENBQVcsS0FBWCxFQUZrQjs7Ozt1Q0FLUDs7Ozs7V0F0ZUU7RUFBbUIsb0JBQVUsT0FBVjs7Ozs7a0JBQW5CIiwiZmlsZSI6InJlZmVyZW5jZXIuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKlxuICBDb3B5cmlnaHQgKEMpIDIwMTUgWXVzdWtlIFN1enVraSA8dXRhdGFuZS50ZWFAZ21haWwuY29tPlxuXG4gIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dFxuICBtb2RpZmljYXRpb24sIGFyZSBwZXJtaXR0ZWQgcHJvdmlkZWQgdGhhdCB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnMgYXJlIG1ldDpcblxuICAgICogUmVkaXN0cmlidXRpb25zIG9mIHNvdXJjZSBjb2RlIG11c3QgcmV0YWluIHRoZSBhYm92ZSBjb3B5cmlnaHRcbiAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lci5cbiAgICAqIFJlZGlzdHJpYnV0aW9ucyBpbiBiaW5hcnkgZm9ybSBtdXN0IHJlcHJvZHVjZSB0aGUgYWJvdmUgY29weXJpZ2h0XG4gICAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIgaW4gdGhlXG4gICAgICBkb2N1bWVudGF0aW9uIGFuZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQgd2l0aCB0aGUgZGlzdHJpYnV0aW9uLlxuXG4gIFRISVMgU09GVFdBUkUgSVMgUFJPVklERUQgQlkgVEhFIENPUFlSSUdIVCBIT0xERVJTIEFORCBDT05UUklCVVRPUlMgXCJBUyBJU1wiXG4gIEFORCBBTlkgRVhQUkVTUyBPUiBJTVBMSUVEIFdBUlJBTlRJRVMsIElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBUSEVcbiAgSU1QTElFRCBXQVJSQU5USUVTIE9GIE1FUkNIQU5UQUJJTElUWSBBTkQgRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0VcbiAgQVJFIERJU0NMQUlNRUQuIElOIE5PIEVWRU5UIFNIQUxMIDxDT1BZUklHSFQgSE9MREVSPiBCRSBMSUFCTEUgRk9SIEFOWVxuICBESVJFQ1QsIElORElSRUNULCBJTkNJREVOVEFMLCBTUEVDSUFMLCBFWEVNUExBUlksIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFU1xuICAoSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFBST0NVUkVNRU5UIE9GIFNVQlNUSVRVVEUgR09PRFMgT1IgU0VSVklDRVM7XG4gIExPU1MgT0YgVVNFLCBEQVRBLCBPUiBQUk9GSVRTOyBPUiBCVVNJTkVTUyBJTlRFUlJVUFRJT04pIEhPV0VWRVIgQ0FVU0VEIEFORFxuICBPTiBBTlkgVEhFT1JZIE9GIExJQUJJTElUWSwgV0hFVEhFUiBJTiBDT05UUkFDVCwgU1RSSUNUIExJQUJJTElUWSwgT1IgVE9SVFxuICAoSU5DTFVESU5HIE5FR0xJR0VOQ0UgT1IgT1RIRVJXSVNFKSBBUklTSU5HIElOIEFOWSBXQVkgT1VUIE9GIFRIRSBVU0UgT0ZcbiAgVEhJUyBTT0ZUV0FSRSwgRVZFTiBJRiBBRFZJU0VEIE9GIFRIRSBQT1NTSUJJTElUWSBPRiBTVUNIIERBTUFHRS5cbiovXG5pbXBvcnQgeyBTeW50YXggfSBmcm9tICdlc3RyYXZlcnNlJztcbmltcG9ydCBlc3JlY3Vyc2UgZnJvbSAnZXNyZWN1cnNlJztcbmltcG9ydCBSZWZlcmVuY2UgZnJvbSAnLi9yZWZlcmVuY2UnO1xuaW1wb3J0IFZhcmlhYmxlIGZyb20gJy4vdmFyaWFibGUnO1xuaW1wb3J0IFBhdHRlcm5WaXNpdG9yIGZyb20gJy4vcGF0dGVybi12aXNpdG9yJztcbmltcG9ydCB7IFBhcmFtZXRlckRlZmluaXRpb24sIERlZmluaXRpb24gfSBmcm9tICcuL2RlZmluaXRpb24nO1xuaW1wb3J0IGFzc2VydCBmcm9tICdhc3NlcnQnO1xuXG5mdW5jdGlvbiB0cmF2ZXJzZUlkZW50aWZpZXJJblBhdHRlcm4ob3B0aW9ucywgcm9vdFBhdHRlcm4sIHJlZmVyZW5jZXIsIGNhbGxiYWNrKSB7XG4gICAgLy8gQ2FsbCB0aGUgY2FsbGJhY2sgYXQgbGVmdCBoYW5kIGlkZW50aWZpZXIgbm9kZXMsIGFuZCBDb2xsZWN0IHJpZ2h0IGhhbmQgbm9kZXMuXG4gICAgdmFyIHZpc2l0b3IgPSBuZXcgUGF0dGVyblZpc2l0b3Iob3B0aW9ucywgcm9vdFBhdHRlcm4sIGNhbGxiYWNrKTtcbiAgICB2aXNpdG9yLnZpc2l0KHJvb3RQYXR0ZXJuKTtcblxuICAgIC8vIFByb2Nlc3MgdGhlIHJpZ2h0IGhhbmQgbm9kZXMgcmVjdXJzaXZlbHkuXG4gICAgaWYgKHJlZmVyZW5jZXIgIT0gbnVsbCkge1xuICAgICAgICB2aXNpdG9yLnJpZ2h0SGFuZE5vZGVzLmZvckVhY2gocmVmZXJlbmNlci52aXNpdCwgcmVmZXJlbmNlcik7XG4gICAgfVxufVxuXG4vLyBJbXBvcnRpbmcgSW1wb3J0RGVjbGFyYXRpb24uXG4vLyBodHRwOi8vcGVvcGxlLm1vemlsbGEub3JnL35qb3JlbmRvcmZmL2VzNi1kcmFmdC5odG1sI3NlYy1tb2R1bGVkZWNsYXJhdGlvbmluc3RhbnRpYXRpb25cbi8vIGh0dHBzOi8vZ2l0aHViLmNvbS9lc3RyZWUvZXN0cmVlL2Jsb2IvbWFzdGVyL2VzNi5tZCNpbXBvcnRkZWNsYXJhdGlvblxuLy8gRklYTUU6IE5vdywgd2UgZG9uJ3QgY3JlYXRlIG1vZHVsZSBlbnZpcm9ubWVudCwgYmVjYXVzZSB0aGUgY29udGV4dCBpc1xuLy8gaW1wbGVtZW50YXRpb24gZGVwZW5kZW50LlxuXG5jbGFzcyBJbXBvcnRlciBleHRlbmRzIGVzcmVjdXJzZS5WaXNpdG9yIHtcbiAgICBjb25zdHJ1Y3RvcihkZWNsYXJhdGlvbiwgcmVmZXJlbmNlcikge1xuICAgICAgICBzdXBlcihudWxsLCByZWZlcmVuY2VyLm9wdGlvbnMpO1xuICAgICAgICB0aGlzLmRlY2xhcmF0aW9uID0gZGVjbGFyYXRpb247XG4gICAgICAgIHRoaXMucmVmZXJlbmNlciA9IHJlZmVyZW5jZXI7XG4gICAgfVxuXG4gICAgdmlzaXRJbXBvcnQoaWQsIHNwZWNpZmllcikge1xuICAgICAgICB0aGlzLnJlZmVyZW5jZXIudmlzaXRQYXR0ZXJuKGlkLCAocGF0dGVybikgPT4ge1xuICAgICAgICAgICAgdGhpcy5yZWZlcmVuY2VyLmN1cnJlbnRTY29wZSgpLl9fZGVmaW5lKHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgbmV3IERlZmluaXRpb24oXG4gICAgICAgICAgICAgICAgICAgIFZhcmlhYmxlLkltcG9ydEJpbmRpbmcsXG4gICAgICAgICAgICAgICAgICAgIHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgIHNwZWNpZmllcixcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5kZWNsYXJhdGlvbixcbiAgICAgICAgICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgbnVsbFxuICAgICAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgSW1wb3J0TmFtZXNwYWNlU3BlY2lmaWVyKG5vZGUpIHtcbiAgICAgICAgbGV0IGxvY2FsID0gKG5vZGUubG9jYWwgfHwgbm9kZS5pZCk7XG4gICAgICAgIGlmIChsb2NhbCkge1xuICAgICAgICAgICAgdGhpcy52aXNpdEltcG9ydChsb2NhbCwgbm9kZSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBJbXBvcnREZWZhdWx0U3BlY2lmaWVyKG5vZGUpIHtcbiAgICAgICAgbGV0IGxvY2FsID0gKG5vZGUubG9jYWwgfHwgbm9kZS5pZCk7XG4gICAgICAgIHRoaXMudmlzaXRJbXBvcnQobG9jYWwsIG5vZGUpO1xuICAgIH1cblxuICAgIEltcG9ydFNwZWNpZmllcihub2RlKSB7XG4gICAgICAgIGxldCBsb2NhbCA9IChub2RlLmxvY2FsIHx8IG5vZGUuaWQpO1xuICAgICAgICBpZiAobm9kZS5uYW1lKSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0SW1wb3J0KG5vZGUubmFtZSwgbm9kZSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0SW1wb3J0KGxvY2FsLCBub2RlKTtcbiAgICAgICAgfVxuICAgIH1cbn1cblxuLy8gUmVmZXJlbmNpbmcgdmFyaWFibGVzIGFuZCBjcmVhdGluZyBiaW5kaW5ncy5cbmV4cG9ydCBkZWZhdWx0IGNsYXNzIFJlZmVyZW5jZXIgZXh0ZW5kcyBlc3JlY3Vyc2UuVmlzaXRvciB7XG4gICAgY29uc3RydWN0b3Iob3B0aW9ucywgc2NvcGVNYW5hZ2VyKSB7XG4gICAgICAgIHN1cGVyKG51bGwsIG9wdGlvbnMpO1xuICAgICAgICB0aGlzLm9wdGlvbnMgPSBvcHRpb25zO1xuICAgICAgICB0aGlzLnNjb3BlTWFuYWdlciA9IHNjb3BlTWFuYWdlcjtcbiAgICAgICAgdGhpcy5wYXJlbnQgPSBudWxsO1xuICAgICAgICB0aGlzLmlzSW5uZXJNZXRob2REZWZpbml0aW9uID0gZmFsc2U7XG4gICAgfVxuXG4gICAgY3VycmVudFNjb3BlKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5zY29wZU1hbmFnZXIuX19jdXJyZW50U2NvcGU7XG4gICAgfVxuXG4gICAgY2xvc2Uobm9kZSkge1xuICAgICAgICB3aGlsZSAodGhpcy5jdXJyZW50U2NvcGUoKSAmJiBub2RlID09PSB0aGlzLmN1cnJlbnRTY29wZSgpLmJsb2NrKSB7XG4gICAgICAgICAgICB0aGlzLnNjb3BlTWFuYWdlci5fX2N1cnJlbnRTY29wZSA9IHRoaXMuY3VycmVudFNjb3BlKCkuX19jbG9zZSh0aGlzLnNjb3BlTWFuYWdlcik7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBwdXNoSW5uZXJNZXRob2REZWZpbml0aW9uKGlzSW5uZXJNZXRob2REZWZpbml0aW9uKSB7XG4gICAgICAgIHZhciBwcmV2aW91cyA9IHRoaXMuaXNJbm5lck1ldGhvZERlZmluaXRpb247XG4gICAgICAgIHRoaXMuaXNJbm5lck1ldGhvZERlZmluaXRpb24gPSBpc0lubmVyTWV0aG9kRGVmaW5pdGlvbjtcbiAgICAgICAgcmV0dXJuIHByZXZpb3VzO1xuICAgIH1cblxuICAgIHBvcElubmVyTWV0aG9kRGVmaW5pdGlvbihpc0lubmVyTWV0aG9kRGVmaW5pdGlvbikge1xuICAgICAgICB0aGlzLmlzSW5uZXJNZXRob2REZWZpbml0aW9uID0gaXNJbm5lck1ldGhvZERlZmluaXRpb247XG4gICAgfVxuXG4gICAgbWF0ZXJpYWxpemVURFpTY29wZShub2RlLCBpdGVyYXRpb25Ob2RlKSB7XG4gICAgICAgIC8vIGh0dHA6Ly9wZW9wbGUubW96aWxsYS5vcmcvfmpvcmVuZG9yZmYvZXM2LWRyYWZ0Lmh0bWwjc2VjLXJ1bnRpbWUtc2VtYW50aWNzLWZvcmluLWRpdi1vZmV4cHJlc3Npb25ldmFsdWF0aW9uLWFic3RyYWN0LW9wZXJhdGlvblxuICAgICAgICAvLyBURFogc2NvcGUgaGlkZXMgdGhlIGRlY2xhcmF0aW9uJ3MgbmFtZXMuXG4gICAgICAgIHRoaXMuc2NvcGVNYW5hZ2VyLl9fbmVzdFREWlNjb3BlKG5vZGUsIGl0ZXJhdGlvbk5vZGUpO1xuICAgICAgICB0aGlzLnZpc2l0VmFyaWFibGVEZWNsYXJhdGlvbih0aGlzLmN1cnJlbnRTY29wZSgpLCBWYXJpYWJsZS5URFosIGl0ZXJhdGlvbk5vZGUubGVmdCwgMCwgdHJ1ZSk7XG4gICAgfVxuXG4gICAgbWF0ZXJpYWxpemVJdGVyYXRpb25TY29wZShub2RlKSB7XG4gICAgICAgIC8vIEdlbmVyYXRlIGl0ZXJhdGlvbiBzY29wZSBmb3IgdXBwZXIgRm9ySW4vRm9yT2YgU3RhdGVtZW50cy5cbiAgICAgICAgdmFyIGxldE9yQ29uc3REZWNsO1xuICAgICAgICB0aGlzLnNjb3BlTWFuYWdlci5fX25lc3RGb3JTY29wZShub2RlKTtcbiAgICAgICAgbGV0T3JDb25zdERlY2wgPSBub2RlLmxlZnQ7XG4gICAgICAgIHRoaXMudmlzaXRWYXJpYWJsZURlY2xhcmF0aW9uKHRoaXMuY3VycmVudFNjb3BlKCksIFZhcmlhYmxlLlZhcmlhYmxlLCBsZXRPckNvbnN0RGVjbCwgMCk7XG4gICAgICAgIHRoaXMudmlzaXRQYXR0ZXJuKGxldE9yQ29uc3REZWNsLmRlY2xhcmF0aW9uc1swXS5pZCwgKHBhdHRlcm4pID0+IHtcbiAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19yZWZlcmVuY2luZyhwYXR0ZXJuLCBSZWZlcmVuY2UuV1JJVEUsIG5vZGUucmlnaHQsIG51bGwsIHRydWUsIHRydWUpO1xuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICByZWZlcmVuY2luZ0RlZmF1bHRWYWx1ZShwYXR0ZXJuLCBhc3NpZ25tZW50cywgbWF5YmVJbXBsaWNpdEdsb2JhbCwgaW5pdCkge1xuICAgICAgICBjb25zdCBzY29wZSA9IHRoaXMuY3VycmVudFNjb3BlKCk7XG4gICAgICAgIGFzc2lnbm1lbnRzLmZvckVhY2goYXNzaWdubWVudCA9PiB7XG4gICAgICAgICAgICBzY29wZS5fX3JlZmVyZW5jaW5nKFxuICAgICAgICAgICAgICAgIHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgUmVmZXJlbmNlLldSSVRFLFxuICAgICAgICAgICAgICAgIGFzc2lnbm1lbnQucmlnaHQsXG4gICAgICAgICAgICAgICAgbWF5YmVJbXBsaWNpdEdsb2JhbCxcbiAgICAgICAgICAgICAgICBwYXR0ZXJuICE9PSBhc3NpZ25tZW50LmxlZnQsXG4gICAgICAgICAgICAgICAgaW5pdCk7XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIHZpc2l0UGF0dGVybihub2RlLCBvcHRpb25zLCBjYWxsYmFjaykge1xuICAgICAgICBpZiAodHlwZW9mIG9wdGlvbnMgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgIGNhbGxiYWNrID0gb3B0aW9ucztcbiAgICAgICAgICAgIG9wdGlvbnMgPSB7cHJvY2Vzc1JpZ2h0SGFuZE5vZGVzOiBmYWxzZX1cbiAgICAgICAgfVxuICAgICAgICB0cmF2ZXJzZUlkZW50aWZpZXJJblBhdHRlcm4oXG4gICAgICAgICAgICB0aGlzLm9wdGlvbnMsXG4gICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgb3B0aW9ucy5wcm9jZXNzUmlnaHRIYW5kTm9kZXMgPyB0aGlzIDogbnVsbCxcbiAgICAgICAgICAgIGNhbGxiYWNrKTtcbiAgICB9XG5cbiAgICB2aXNpdEZ1bmN0aW9uKG5vZGUpIHtcbiAgICAgICAgdmFyIGksIGl6O1xuICAgICAgICAvLyBGdW5jdGlvbkRlY2xhcmF0aW9uIG5hbWUgaXMgZGVmaW5lZCBpbiB1cHBlciBzY29wZVxuICAgICAgICAvLyBOT1RFOiBOb3QgcmVmZXJyaW5nIHZhcmlhYmxlU2NvcGUuIEl0IGlzIGludGVuZGVkLlxuICAgICAgICAvLyBTaW5jZVxuICAgICAgICAvLyAgaW4gRVM1LCBGdW5jdGlvbkRlY2xhcmF0aW9uIHNob3VsZCBiZSBpbiBGdW5jdGlvbkJvZHkuXG4gICAgICAgIC8vICBpbiBFUzYsIEZ1bmN0aW9uRGVjbGFyYXRpb24gc2hvdWxkIGJlIGJsb2NrIHNjb3BlZC5cbiAgICAgICAgaWYgKG5vZGUudHlwZSA9PT0gU3ludGF4LkZ1bmN0aW9uRGVjbGFyYXRpb24pIHtcbiAgICAgICAgICAgIC8vIGlkIGlzIGRlZmluZWQgaW4gdXBwZXIgc2NvcGVcbiAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19kZWZpbmUobm9kZS5pZCxcbiAgICAgICAgICAgICAgICAgICAgbmV3IERlZmluaXRpb24oXG4gICAgICAgICAgICAgICAgICAgICAgICBWYXJpYWJsZS5GdW5jdGlvbk5hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLmlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVsbFxuICAgICAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEZ1bmN0aW9uRXhwcmVzc2lvbiB3aXRoIG5hbWUgY3JlYXRlcyBpdHMgc3BlY2lhbCBzY29wZTtcbiAgICAgICAgLy8gRnVuY3Rpb25FeHByZXNzaW9uTmFtZVNjb3BlLlxuICAgICAgICBpZiAobm9kZS50eXBlID09PSBTeW50YXguRnVuY3Rpb25FeHByZXNzaW9uICYmIG5vZGUuaWQpIHtcbiAgICAgICAgICAgIHRoaXMuc2NvcGVNYW5hZ2VyLl9fbmVzdEZ1bmN0aW9uRXhwcmVzc2lvbk5hbWVTY29wZShub2RlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIENvbnNpZGVyIHRoaXMgZnVuY3Rpb24gaXMgaW4gdGhlIE1ldGhvZERlZmluaXRpb24uXG4gICAgICAgIHRoaXMuc2NvcGVNYW5hZ2VyLl9fbmVzdEZ1bmN0aW9uU2NvcGUobm9kZSwgdGhpcy5pc0lubmVyTWV0aG9kRGVmaW5pdGlvbik7XG5cbiAgICAgICAgLy8gUHJvY2VzcyBwYXJhbWV0ZXIgZGVjbGFyYXRpb25zLlxuICAgICAgICBmb3IgKGkgPSAwLCBpeiA9IG5vZGUucGFyYW1zLmxlbmd0aDsgaSA8IGl6OyArK2kpIHtcbiAgICAgICAgICAgIHRoaXMudmlzaXRQYXR0ZXJuKG5vZGUucGFyYW1zW2ldLCB7cHJvY2Vzc1JpZ2h0SGFuZE5vZGVzOiB0cnVlfSwgKHBhdHRlcm4sIGluZm8pID0+IHtcbiAgICAgICAgICAgICAgICB0aGlzLmN1cnJlbnRTY29wZSgpLl9fZGVmaW5lKHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgIG5ldyBQYXJhbWV0ZXJEZWZpbml0aW9uKFxuICAgICAgICAgICAgICAgICAgICAgICAgcGF0dGVybixcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICAgICAgICBpLFxuICAgICAgICAgICAgICAgICAgICAgICAgaW5mby5yZXN0XG4gICAgICAgICAgICAgICAgICAgICkpO1xuXG4gICAgICAgICAgICAgICAgdGhpcy5yZWZlcmVuY2luZ0RlZmF1bHRWYWx1ZShwYXR0ZXJuLCBpbmZvLmFzc2lnbm1lbnRzLCBudWxsLCB0cnVlKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gaWYgdGhlcmUncyBhIHJlc3QgYXJndW1lbnQsIGFkZCB0aGF0XG4gICAgICAgIGlmIChub2RlLnJlc3QpIHtcbiAgICAgICAgICAgIHRoaXMudmlzaXRQYXR0ZXJuKHtcbiAgICAgICAgICAgICAgICB0eXBlOiAnUmVzdEVsZW1lbnQnLFxuICAgICAgICAgICAgICAgIGFyZ3VtZW50OiBub2RlLnJlc3RcbiAgICAgICAgICAgIH0sIChwYXR0ZXJuKSA9PiB7XG4gICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX2RlZmluZShwYXR0ZXJuLFxuICAgICAgICAgICAgICAgICAgICBuZXcgUGFyYW1ldGVyRGVmaW5pdGlvbihcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5wYXJhbXMubGVuZ3RoLFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ1ZVxuICAgICAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gU2tpcCBCbG9ja1N0YXRlbWVudCB0byBwcmV2ZW50IGNyZWF0aW5nIEJsb2NrU3RhdGVtZW50IHNjb3BlLlxuICAgICAgICBpZiAobm9kZS5ib2R5LnR5cGUgPT09IFN5bnRheC5CbG9ja1N0YXRlbWVudCkge1xuICAgICAgICAgICAgdGhpcy52aXNpdENoaWxkcmVuKG5vZGUuYm9keSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUuYm9keSk7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLmNsb3NlKG5vZGUpO1xuICAgIH1cblxuICAgIHZpc2l0Q2xhc3Mobm9kZSkge1xuICAgICAgICBpZiAobm9kZS50eXBlID09PSBTeW50YXguQ2xhc3NEZWNsYXJhdGlvbikge1xuICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX2RlZmluZShub2RlLmlkLFxuICAgICAgICAgICAgICAgICAgICBuZXcgRGVmaW5pdGlvbihcbiAgICAgICAgICAgICAgICAgICAgICAgIFZhcmlhYmxlLkNsYXNzTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUuaWQsXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgICAgICBudWxsXG4gICAgICAgICAgICAgICAgICAgICkpO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gRklYTUU6IE1heWJlIGNvbnNpZGVyIFREWi5cbiAgICAgICAgdGhpcy52aXNpdChub2RlLnN1cGVyQ2xhc3MpO1xuXG4gICAgICAgIHRoaXMuc2NvcGVNYW5hZ2VyLl9fbmVzdENsYXNzU2NvcGUobm9kZSk7XG5cbiAgICAgICAgaWYgKG5vZGUuaWQpIHtcbiAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19kZWZpbmUobm9kZS5pZCxcbiAgICAgICAgICAgICAgICAgICAgbmV3IERlZmluaXRpb24oXG4gICAgICAgICAgICAgICAgICAgICAgICBWYXJpYWJsZS5DbGFzc05hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLmlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZVxuICAgICAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnZpc2l0KG5vZGUuYm9keSk7XG5cbiAgICAgICAgdGhpcy5jbG9zZShub2RlKTtcbiAgICB9XG5cbiAgICB2aXNpdFByb3BlcnR5KG5vZGUpIHtcbiAgICAgICAgdmFyIHByZXZpb3VzLCBpc01ldGhvZERlZmluaXRpb247XG4gICAgICAgIGlmIChub2RlLmNvbXB1dGVkKSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUua2V5KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlzTWV0aG9kRGVmaW5pdGlvbiA9IG5vZGUudHlwZSA9PT0gU3ludGF4Lk1ldGhvZERlZmluaXRpb247XG4gICAgICAgIGlmIChpc01ldGhvZERlZmluaXRpb24pIHtcbiAgICAgICAgICAgIHByZXZpb3VzID0gdGhpcy5wdXNoSW5uZXJNZXRob2REZWZpbml0aW9uKHRydWUpO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMudmlzaXQobm9kZS52YWx1ZSk7XG4gICAgICAgIGlmIChpc01ldGhvZERlZmluaXRpb24pIHtcbiAgICAgICAgICAgIHRoaXMucG9wSW5uZXJNZXRob2REZWZpbml0aW9uKHByZXZpb3VzKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHZpc2l0Rm9ySW4obm9kZSkge1xuICAgICAgICBpZiAobm9kZS5sZWZ0LnR5cGUgPT09IFN5bnRheC5WYXJpYWJsZURlY2xhcmF0aW9uICYmIG5vZGUubGVmdC5raW5kICE9PSAndmFyJykge1xuICAgICAgICAgICAgdGhpcy5tYXRlcmlhbGl6ZVREWlNjb3BlKG5vZGUucmlnaHQsIG5vZGUpO1xuICAgICAgICAgICAgdGhpcy52aXNpdChub2RlLnJpZ2h0KTtcbiAgICAgICAgICAgIHRoaXMuY2xvc2Uobm9kZS5yaWdodCk7XG5cbiAgICAgICAgICAgIHRoaXMubWF0ZXJpYWxpemVJdGVyYXRpb25TY29wZShub2RlKTtcbiAgICAgICAgICAgIHRoaXMudmlzaXQobm9kZS5ib2R5KTtcbiAgICAgICAgICAgIHRoaXMuY2xvc2Uobm9kZSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAobm9kZS5sZWZ0LnR5cGUgPT09IFN5bnRheC5WYXJpYWJsZURlY2xhcmF0aW9uKSB7XG4gICAgICAgICAgICAgICAgdGhpcy52aXNpdChub2RlLmxlZnQpO1xuICAgICAgICAgICAgICAgIHRoaXMudmlzaXRQYXR0ZXJuKG5vZGUubGVmdC5kZWNsYXJhdGlvbnNbMF0uaWQsIChwYXR0ZXJuKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19yZWZlcmVuY2luZyhwYXR0ZXJuLCBSZWZlcmVuY2UuV1JJVEUsIG5vZGUucmlnaHQsIG51bGwsIHRydWUsIHRydWUpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLnZpc2l0UGF0dGVybihub2RlLmxlZnQsIHtwcm9jZXNzUmlnaHRIYW5kTm9kZXM6IHRydWV9LCAocGF0dGVybiwgaW5mbykgPT4ge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbWF5YmVJbXBsaWNpdEdsb2JhbCA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5jdXJyZW50U2NvcGUoKS5pc1N0cmljdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbWF5YmVJbXBsaWNpdEdsb2JhbCA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXR0ZXJuOiBwYXR0ZXJuLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGU6IG5vZGVcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZWZlcmVuY2luZ0RlZmF1bHRWYWx1ZShwYXR0ZXJuLCBpbmZvLmFzc2lnbm1lbnRzLCBtYXliZUltcGxpY2l0R2xvYmFsLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19yZWZlcmVuY2luZyhwYXR0ZXJuLCBSZWZlcmVuY2UuV1JJVEUsIG5vZGUucmlnaHQsIG1heWJlSW1wbGljaXRHbG9iYWwsIHRydWUsIGZhbHNlKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMudmlzaXQobm9kZS5yaWdodCk7XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUuYm9keSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICB2aXNpdFZhcmlhYmxlRGVjbGFyYXRpb24odmFyaWFibGVUYXJnZXRTY29wZSwgdHlwZSwgbm9kZSwgaW5kZXgsIGZyb21URFopIHtcbiAgICAgICAgLy8gSWYgdGhpcyB3YXMgY2FsbGVkIHRvIGluaXRpYWxpemUgYSBURFogc2NvcGUsIHRoaXMgbmVlZHMgdG8gbWFrZSBkZWZpbml0aW9ucywgYnV0IGRvZXNuJ3QgbWFrZSByZWZlcmVuY2VzLlxuICAgICAgICB2YXIgZGVjbCwgaW5pdDtcblxuICAgICAgICBkZWNsID0gbm9kZS5kZWNsYXJhdGlvbnNbaW5kZXhdO1xuICAgICAgICBpbml0ID0gZGVjbC5pbml0O1xuICAgICAgICB0aGlzLnZpc2l0UGF0dGVybihkZWNsLmlkLCB7cHJvY2Vzc1JpZ2h0SGFuZE5vZGVzOiAhZnJvbVREWn0sIChwYXR0ZXJuLCBpbmZvKSA9PiB7XG4gICAgICAgICAgICB2YXJpYWJsZVRhcmdldFNjb3BlLl9fZGVmaW5lKHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgbmV3IERlZmluaXRpb24oXG4gICAgICAgICAgICAgICAgICAgIHR5cGUsXG4gICAgICAgICAgICAgICAgICAgIHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgIGRlY2wsXG4gICAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICAgIGluZGV4LFxuICAgICAgICAgICAgICAgICAgICBub2RlLmtpbmRcbiAgICAgICAgICAgICAgICApKTtcblxuICAgICAgICAgICAgaWYgKCFmcm9tVERaKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5yZWZlcmVuY2luZ0RlZmF1bHRWYWx1ZShwYXR0ZXJuLCBpbmZvLmFzc2lnbm1lbnRzLCBudWxsLCB0cnVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChpbml0KSB7XG4gICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX3JlZmVyZW5jaW5nKHBhdHRlcm4sIFJlZmVyZW5jZS5XUklURSwgaW5pdCwgbnVsbCwgIWluZm8udG9wTGV2ZWwsIHRydWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBBc3NpZ25tZW50RXhwcmVzc2lvbihub2RlKSB7XG4gICAgICAgIGlmIChQYXR0ZXJuVmlzaXRvci5pc1BhdHRlcm4obm9kZS5sZWZ0KSkge1xuICAgICAgICAgICAgaWYgKG5vZGUub3BlcmF0b3IgPT09ICc9Jykge1xuICAgICAgICAgICAgICAgIHRoaXMudmlzaXRQYXR0ZXJuKG5vZGUubGVmdCwge3Byb2Nlc3NSaWdodEhhbmROb2RlczogdHJ1ZX0sIChwYXR0ZXJuLCBpbmZvKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBtYXliZUltcGxpY2l0R2xvYmFsID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzLmN1cnJlbnRTY29wZSgpLmlzU3RyaWN0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtYXliZUltcGxpY2l0R2xvYmFsID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdHRlcm46IHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9kZTogbm9kZVxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB0aGlzLnJlZmVyZW5jaW5nRGVmYXVsdFZhbHVlKHBhdHRlcm4sIGluZm8uYXNzaWdubWVudHMsIG1heWJlSW1wbGljaXRHbG9iYWwsIGZhbHNlKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX3JlZmVyZW5jaW5nKHBhdHRlcm4sIFJlZmVyZW5jZS5XUklURSwgbm9kZS5yaWdodCwgbWF5YmVJbXBsaWNpdEdsb2JhbCwgIWluZm8udG9wTGV2ZWwsIGZhbHNlKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX3JlZmVyZW5jaW5nKG5vZGUubGVmdCwgUmVmZXJlbmNlLlJXLCBub2RlLnJpZ2h0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMudmlzaXQobm9kZS5sZWZ0KTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnZpc2l0KG5vZGUucmlnaHQpO1xuICAgIH1cblxuICAgIENhdGNoQ2xhdXNlKG5vZGUpIHtcbiAgICAgICAgdGhpcy5zY29wZU1hbmFnZXIuX19uZXN0Q2F0Y2hTY29wZShub2RlKTtcblxuICAgICAgICB0aGlzLnZpc2l0UGF0dGVybihub2RlLnBhcmFtLCB7cHJvY2Vzc1JpZ2h0SGFuZE5vZGVzOiB0cnVlfSwgKHBhdHRlcm4sIGluZm8pID0+IHtcbiAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19kZWZpbmUocGF0dGVybixcbiAgICAgICAgICAgICAgICBuZXcgRGVmaW5pdGlvbihcbiAgICAgICAgICAgICAgICAgICAgVmFyaWFibGUuQ2F0Y2hDbGF1c2UsXG4gICAgICAgICAgICAgICAgICAgIG5vZGUucGFyYW0sXG4gICAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgIG51bGxcbiAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgICAgIHRoaXMucmVmZXJlbmNpbmdEZWZhdWx0VmFsdWUocGF0dGVybiwgaW5mby5hc3NpZ25tZW50cywgbnVsbCwgdHJ1ZSk7XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnZpc2l0KG5vZGUuYm9keSk7XG5cbiAgICAgICAgdGhpcy5jbG9zZShub2RlKTtcbiAgICB9XG5cbiAgICBQcm9ncmFtKG5vZGUpIHtcbiAgICAgICAgdGhpcy5zY29wZU1hbmFnZXIuX19uZXN0R2xvYmFsU2NvcGUobm9kZSk7XG5cbiAgICAgICAgaWYgKHRoaXMuc2NvcGVNYW5hZ2VyLl9faXNOb2RlanNTY29wZSgpKSB7XG4gICAgICAgICAgICAvLyBGb3JjZSBzdHJpY3RuZXNzIG9mIEdsb2JhbFNjb3BlIHRvIGZhbHNlIHdoZW4gdXNpbmcgbm9kZS5qcyBzY29wZS5cbiAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuaXNTdHJpY3QgPSBmYWxzZTtcbiAgICAgICAgICAgIHRoaXMuc2NvcGVNYW5hZ2VyLl9fbmVzdEZ1bmN0aW9uU2NvcGUobm9kZSwgZmFsc2UpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRoaXMuc2NvcGVNYW5hZ2VyLl9faXNFUzYoKSAmJiB0aGlzLnNjb3BlTWFuYWdlci5pc01vZHVsZSgpKSB7XG4gICAgICAgICAgICB0aGlzLnNjb3BlTWFuYWdlci5fX25lc3RNb2R1bGVTY29wZShub2RlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLnNjb3BlTWFuYWdlci5pc1N0cmljdE1vZGVTdXBwb3J0ZWQoKSAmJiB0aGlzLnNjb3BlTWFuYWdlci5pc0ltcGxpZWRTdHJpY3QoKSkge1xuICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5pc1N0cmljdCA9IHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnZpc2l0Q2hpbGRyZW4obm9kZSk7XG4gICAgICAgIHRoaXMuY2xvc2Uobm9kZSk7XG4gICAgfVxuXG4gICAgSWRlbnRpZmllcihub2RlKSB7XG4gICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19yZWZlcmVuY2luZyhub2RlKTtcbiAgICB9XG5cbiAgICBVcGRhdGVFeHByZXNzaW9uKG5vZGUpIHtcbiAgICAgICAgaWYgKFBhdHRlcm5WaXNpdG9yLmlzUGF0dGVybihub2RlLmFyZ3VtZW50KSkge1xuICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX3JlZmVyZW5jaW5nKG5vZGUuYXJndW1lbnQsIFJlZmVyZW5jZS5SVywgbnVsbCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0Q2hpbGRyZW4obm9kZSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBNZW1iZXJFeHByZXNzaW9uKG5vZGUpIHtcbiAgICAgICAgdGhpcy52aXNpdChub2RlLm9iamVjdCk7XG4gICAgICAgIGlmIChub2RlLmNvbXB1dGVkKSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUucHJvcGVydHkpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgUHJvcGVydHkobm9kZSkge1xuICAgICAgICB0aGlzLnZpc2l0UHJvcGVydHkobm9kZSk7XG4gICAgfVxuXG4gICAgTWV0aG9kRGVmaW5pdGlvbihub2RlKSB7XG4gICAgICAgIHRoaXMudmlzaXRQcm9wZXJ0eShub2RlKTtcbiAgICB9XG5cbiAgICBCcmVha1N0YXRlbWVudCgpIHt9XG5cbiAgICBDb250aW51ZVN0YXRlbWVudCgpIHt9XG5cbiAgICBMYWJlbGVkU3RhdGVtZW50KG5vZGUpIHtcbiAgICAgICAgdGhpcy52aXNpdChub2RlLmJvZHkpO1xuICAgIH1cblxuICAgIEZvclN0YXRlbWVudChub2RlKSB7XG4gICAgICAgIC8vIENyZWF0ZSBGb3JTdGF0ZW1lbnQgZGVjbGFyYXRpb24uXG4gICAgICAgIC8vIE5PVEU6IEluIEVTNiwgRm9yU3RhdGVtZW50IGR5bmFtaWNhbGx5IGdlbmVyYXRlc1xuICAgICAgICAvLyBwZXIgaXRlcmF0aW9uIGVudmlyb25tZW50LiBIb3dldmVyLCBlc2NvcGUgaXNcbiAgICAgICAgLy8gYSBzdGF0aWMgYW5hbHl6ZXIsIHdlIG9ubHkgZ2VuZXJhdGUgb25lIHNjb3BlIGZvciBGb3JTdGF0ZW1lbnQuXG4gICAgICAgIGlmIChub2RlLmluaXQgJiYgbm9kZS5pbml0LnR5cGUgPT09IFN5bnRheC5WYXJpYWJsZURlY2xhcmF0aW9uICYmIG5vZGUuaW5pdC5raW5kICE9PSAndmFyJykge1xuICAgICAgICAgICAgdGhpcy5zY29wZU1hbmFnZXIuX19uZXN0Rm9yU2NvcGUobm9kZSk7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnZpc2l0Q2hpbGRyZW4obm9kZSk7XG5cbiAgICAgICAgdGhpcy5jbG9zZShub2RlKTtcbiAgICB9XG5cbiAgICBDbGFzc0V4cHJlc3Npb24obm9kZSkge1xuICAgICAgICB0aGlzLnZpc2l0Q2xhc3Mobm9kZSk7XG4gICAgfVxuXG4gICAgQ2xhc3NEZWNsYXJhdGlvbihub2RlKSB7XG4gICAgICAgIHRoaXMudmlzaXRDbGFzcyhub2RlKTtcbiAgICB9XG5cbiAgICBDYWxsRXhwcmVzc2lvbihub2RlKSB7XG4gICAgICAgIC8vIENoZWNrIHRoaXMgaXMgZGlyZWN0IGNhbGwgdG8gZXZhbFxuICAgICAgICBpZiAoIXRoaXMuc2NvcGVNYW5hZ2VyLl9faWdub3JlRXZhbCgpICYmIG5vZGUuY2FsbGVlLnR5cGUgPT09IFN5bnRheC5JZGVudGlmaWVyICYmIG5vZGUuY2FsbGVlLm5hbWUgPT09ICdldmFsJykge1xuICAgICAgICAgICAgLy8gTk9URTogVGhpcyBzaG91bGQgYmUgYHZhcmlhYmxlU2NvcGVgLiBTaW5jZSBkaXJlY3QgZXZhbCBjYWxsIGFsd2F5cyBjcmVhdGVzIExleGljYWwgZW52aXJvbm1lbnQgYW5kXG4gICAgICAgICAgICAvLyBsZXQgLyBjb25zdCBzaG91bGQgYmUgZW5jbG9zZWQgaW50byBpdC4gT25seSBWYXJpYWJsZURlY2xhcmF0aW9uIGFmZmVjdHMgb24gdGhlIGNhbGxlcidzIGVudmlyb25tZW50LlxuICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS52YXJpYWJsZVNjb3BlLl9fZGV0ZWN0RXZhbCgpO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMudmlzaXRDaGlsZHJlbihub2RlKTtcbiAgICB9XG5cbiAgICBCbG9ja1N0YXRlbWVudChub2RlKSB7XG4gICAgICAgIGlmICh0aGlzLnNjb3BlTWFuYWdlci5fX2lzRVM2KCkpIHtcbiAgICAgICAgICAgIHRoaXMuc2NvcGVNYW5hZ2VyLl9fbmVzdEJsb2NrU2NvcGUobm9kZSk7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnZpc2l0Q2hpbGRyZW4obm9kZSk7XG5cbiAgICAgICAgdGhpcy5jbG9zZShub2RlKTtcbiAgICB9XG5cbiAgICBUaGlzRXhwcmVzc2lvbigpIHtcbiAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS52YXJpYWJsZVNjb3BlLl9fZGV0ZWN0VGhpcygpO1xuICAgIH1cblxuICAgIFdpdGhTdGF0ZW1lbnQobm9kZSkge1xuICAgICAgICB0aGlzLnZpc2l0KG5vZGUub2JqZWN0KTtcbiAgICAgICAgLy8gVGhlbiBuZXN0IHNjb3BlIGZvciBXaXRoU3RhdGVtZW50LlxuICAgICAgICB0aGlzLnNjb3BlTWFuYWdlci5fX25lc3RXaXRoU2NvcGUobm9kZSk7XG5cbiAgICAgICAgdGhpcy52aXNpdChub2RlLmJvZHkpO1xuXG4gICAgICAgIHRoaXMuY2xvc2Uobm9kZSk7XG4gICAgfVxuXG4gICAgVmFyaWFibGVEZWNsYXJhdGlvbihub2RlKSB7XG4gICAgICAgIHZhciB2YXJpYWJsZVRhcmdldFNjb3BlLCBpLCBpeiwgZGVjbDtcbiAgICAgICAgdmFyaWFibGVUYXJnZXRTY29wZSA9IChub2RlLmtpbmQgPT09ICd2YXInKSA/IHRoaXMuY3VycmVudFNjb3BlKCkudmFyaWFibGVTY29wZSA6IHRoaXMuY3VycmVudFNjb3BlKCk7XG4gICAgICAgIGZvciAoaSA9IDAsIGl6ID0gbm9kZS5kZWNsYXJhdGlvbnMubGVuZ3RoOyBpIDwgaXo7ICsraSkge1xuICAgICAgICAgICAgZGVjbCA9IG5vZGUuZGVjbGFyYXRpb25zW2ldO1xuICAgICAgICAgICAgdGhpcy52aXNpdFZhcmlhYmxlRGVjbGFyYXRpb24odmFyaWFibGVUYXJnZXRTY29wZSwgVmFyaWFibGUuVmFyaWFibGUsIG5vZGUsIGkpO1xuICAgICAgICAgICAgaWYgKGRlY2wuaW5pdCkge1xuICAgICAgICAgICAgICAgIHRoaXMudmlzaXQoZGVjbC5pbml0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8vIHNlYyAxMy4xMS44XG4gICAgU3dpdGNoU3RhdGVtZW50KG5vZGUpIHtcbiAgICAgICAgdmFyIGksIGl6O1xuXG4gICAgICAgIHRoaXMudmlzaXQobm9kZS5kaXNjcmltaW5hbnQpO1xuXG4gICAgICAgIGlmICh0aGlzLnNjb3BlTWFuYWdlci5fX2lzRVM2KCkpIHtcbiAgICAgICAgICAgIHRoaXMuc2NvcGVNYW5hZ2VyLl9fbmVzdFN3aXRjaFNjb3BlKG5vZGUpO1xuICAgICAgICB9XG5cbiAgICAgICAgZm9yIChpID0gMCwgaXogPSBub2RlLmNhc2VzLmxlbmd0aDsgaSA8IGl6OyArK2kpIHtcbiAgICAgICAgICAgIHRoaXMudmlzaXQobm9kZS5jYXNlc1tpXSk7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLmNsb3NlKG5vZGUpO1xuICAgIH1cblxuICAgIEZ1bmN0aW9uRGVjbGFyYXRpb24obm9kZSkge1xuICAgICAgICB0aGlzLnZpc2l0RnVuY3Rpb24obm9kZSk7XG4gICAgfVxuXG4gICAgRnVuY3Rpb25FeHByZXNzaW9uKG5vZGUpIHtcbiAgICAgICAgdGhpcy52aXNpdEZ1bmN0aW9uKG5vZGUpO1xuICAgIH1cblxuICAgIEZvck9mU3RhdGVtZW50KG5vZGUpIHtcbiAgICAgICAgdGhpcy52aXNpdEZvckluKG5vZGUpO1xuICAgIH1cblxuICAgIEZvckluU3RhdGVtZW50KG5vZGUpIHtcbiAgICAgICAgdGhpcy52aXNpdEZvckluKG5vZGUpO1xuICAgIH1cblxuICAgIEFycm93RnVuY3Rpb25FeHByZXNzaW9uKG5vZGUpIHtcbiAgICAgICAgdGhpcy52aXNpdEZ1bmN0aW9uKG5vZGUpO1xuICAgIH1cblxuICAgIEltcG9ydERlY2xhcmF0aW9uKG5vZGUpIHtcbiAgICAgICAgdmFyIGltcG9ydGVyO1xuXG4gICAgICAgIGFzc2VydCh0aGlzLnNjb3BlTWFuYWdlci5fX2lzRVM2KCkgJiYgdGhpcy5zY29wZU1hbmFnZXIuaXNNb2R1bGUoKSwgJ0ltcG9ydERlY2xhcmF0aW9uIHNob3VsZCBhcHBlYXIgd2hlbiB0aGUgbW9kZSBpcyBFUzYgYW5kIGluIHRoZSBtb2R1bGUgY29udGV4dC4nKTtcblxuICAgICAgICBpbXBvcnRlciA9IG5ldyBJbXBvcnRlcihub2RlLCB0aGlzKTtcbiAgICAgICAgaW1wb3J0ZXIudmlzaXQobm9kZSk7XG4gICAgfVxuXG4gICAgdmlzaXRFeHBvcnREZWNsYXJhdGlvbihub2RlKSB7XG4gICAgICAgIGlmIChub2RlLnNvdXJjZSkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGlmIChub2RlLmRlY2xhcmF0aW9uKSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUuZGVjbGFyYXRpb24pO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy52aXNpdENoaWxkcmVuKG5vZGUpO1xuICAgIH1cblxuICAgIEV4cG9ydERlY2xhcmF0aW9uKG5vZGUpIHtcbiAgICAgICAgdGhpcy52aXNpdEV4cG9ydERlY2xhcmF0aW9uKG5vZGUpO1xuICAgIH1cblxuICAgIEV4cG9ydE5hbWVkRGVjbGFyYXRpb24obm9kZSkge1xuICAgICAgICB0aGlzLnZpc2l0RXhwb3J0RGVjbGFyYXRpb24obm9kZSk7XG4gICAgfVxuXG4gICAgRXhwb3J0U3BlY2lmaWVyKG5vZGUpIHtcbiAgICAgICAgbGV0IGxvY2FsID0gKG5vZGUuaWQgfHwgbm9kZS5sb2NhbCk7XG4gICAgICAgIHRoaXMudmlzaXQobG9jYWwpO1xuICAgIH1cblxuICAgIE1ldGFQcm9wZXJ0eSgpIHtcbiAgICAgICAgLy8gZG8gbm90aGluZy5cbiAgICB9XG59XG5cbi8qIHZpbTogc2V0IHN3PTQgdHM9NCBldCB0dz04MCA6ICovXG4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
      diff --git a/tools/eslint/node_modules/escope/lib/scope-manager.js b/tools/eslint/node_modules/escope/lib/scope-manager.js
      index bb64896f007223..22a4c113ff19b2 100644
      --- a/tools/eslint/node_modules/escope/lib/scope-manager.js
      +++ b/tools/eslint/node_modules/escope/lib/scope-manager.js
      @@ -1,275 +1,297 @@
      -"use strict";
      +'use strict';
       
      -var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
      +Object.defineProperty(exports, "__esModule", {
      +    value: true
      +});
       
      -var _createClass = (function () { function defineProperties(target, props) { for (var key in props) { var prop = props[key]; prop.configurable = true; if (prop.value) prop.writable = true; } Object.defineProperties(target, props); } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
      +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       Copyright (C) 2015 Yusuke Suzuki 
       
      -var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       Redistribution and use in source and binary forms, with or without
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       modification, are permitted provided that the following conditions are met:
       
      -/*
      -  Copyright (C) 2015 Yusuke Suzuki 
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         * Redistributions of source code must retain the above copyright
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           notice, this list of conditions and the following disclaimer.
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         * Redistributions in binary form must reproduce the above copyright
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           notice, this list of conditions and the following disclaimer in the
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           documentation and/or other materials provided with the distribution.
       
      -  Redistribution and use in source and binary forms, with or without
      -  modification, are permitted provided that the following conditions are met:
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ARE DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     */
       
      -    * Redistributions of source code must retain the above copyright
      -      notice, this list of conditions and the following disclaimer.
      -    * Redistributions in binary form must reproduce the above copyright
      -      notice, this list of conditions and the following disclaimer in the
      -      documentation and/or other materials provided with the distribution.
      +var _es6WeakMap = require('es6-weak-map');
       
      -  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
      -  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      -  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      -  ARE DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
      -  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
      -  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
      -  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      -  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      -  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
      -  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      -*/
      +var _es6WeakMap2 = _interopRequireDefault(_es6WeakMap);
       
      -var WeakMap = _interopRequire(require("es6-weak-map"));
      +var _scope = require('./scope');
       
      -var _scope = require("./scope");
      +var _scope2 = _interopRequireDefault(_scope);
       
      -var Scope = _interopRequire(_scope);
      +var _assert = require('assert');
       
      -var assert = _interopRequire(require("assert"));
      +var _assert2 = _interopRequireDefault(_assert);
       
      -var GlobalScope = _scope.GlobalScope;
      -var CatchScope = _scope.CatchScope;
      -var WithScope = _scope.WithScope;
      -var ModuleScope = _scope.ModuleScope;
      -var ClassScope = _scope.ClassScope;
      -var SwitchScope = _scope.SwitchScope;
      -var FunctionScope = _scope.FunctionScope;
      -var ForScope = _scope.ForScope;
      -var TDZScope = _scope.TDZScope;
      -var FunctionExpressionNameScope = _scope.FunctionExpressionNameScope;
      -var BlockScope = _scope.BlockScope;
      +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
      +
      +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
       
       /**
        * @class ScopeManager
        */
       
      -var ScopeManager = (function () {
      +var ScopeManager = function () {
           function ScopeManager(options) {
               _classCallCheck(this, ScopeManager);
       
               this.scopes = [];
               this.globalScope = null;
      -        this.__nodeToScope = new WeakMap();
      +        this.__nodeToScope = new _es6WeakMap2.default();
               this.__currentScope = null;
               this.__options = options;
      +        this.__declaredVariables = new _es6WeakMap2.default();
           }
       
      -    _createClass(ScopeManager, {
      -        __useDirective: {
      -            value: function __useDirective() {
      -                return this.__options.directive;
      -            }
      -        },
      -        __isOptimistic: {
      -            value: function __isOptimistic() {
      -                return this.__options.optimistic;
      -            }
      -        },
      -        __ignoreEval: {
      -            value: function __ignoreEval() {
      -                return this.__options.ignoreEval;
      -            }
      -        },
      -        __isNodejsScope: {
      -            value: function __isNodejsScope() {
      -                return this.__options.nodejsScope;
      -            }
      -        },
      -        isModule: {
      -            value: function isModule() {
      -                return this.__options.sourceType === "module";
      -            }
      -        },
      -        __get: {
      +    _createClass(ScopeManager, [{
      +        key: '__useDirective',
      +        value: function __useDirective() {
      +            return this.__options.directive;
      +        }
      +    }, {
      +        key: '__isOptimistic',
      +        value: function __isOptimistic() {
      +            return this.__options.optimistic;
      +        }
      +    }, {
      +        key: '__ignoreEval',
      +        value: function __ignoreEval() {
      +            return this.__options.ignoreEval;
      +        }
      +    }, {
      +        key: '__isNodejsScope',
      +        value: function __isNodejsScope() {
      +            return this.__options.nodejsScope;
      +        }
      +    }, {
      +        key: 'isModule',
      +        value: function isModule() {
      +            return this.__options.sourceType === 'module';
      +        }
      +    }, {
      +        key: 'isImpliedStrict',
      +        value: function isImpliedStrict() {
      +            return this.__options.impliedStrict;
      +        }
      +    }, {
      +        key: 'isStrictModeSupported',
      +        value: function isStrictModeSupported() {
      +            return this.__options.ecmaVersion >= 5;
      +        }
       
      -            // Returns appropliate scope for this node.
      +        // Returns appropriate scope for this node.
       
      -            value: function __get(node) {
      -                return this.__nodeToScope.get(node);
      -            }
      -        },
      -        acquire: {
      -
      -            /**
      -             * acquire scope from node.
      -             * @method ScopeManager#acquire
      -             * @param {Esprima.Node} node - node for the acquired scope.
      -             * @param {boolean=} inner - look up the most inner scope, default value is false.
      -             * @return {Scope?}
      -             */
      -
      -            value: function acquire(node, inner) {
      -                var scopes, scope, i, iz;
      -
      -                function predicate(scope) {
      -                    if (scope.type === "function" && scope.functionExpressionScope) {
      -                        return false;
      -                    }
      -                    if (scope.type === "TDZ") {
      -                        return false;
      -                    }
      -                    return true;
      -                }
      +    }, {
      +        key: '__get',
      +        value: function __get(node) {
      +            return this.__nodeToScope.get(node);
      +        }
       
      -                scopes = this.__get(node);
      -                if (!scopes || scopes.length === 0) {
      -                    return null;
      -                }
      +        /**
      +         * Get variables that are declared by the node.
      +         *
      +         * "are declared by the node" means the node is same as `Variable.defs[].node` or `Variable.defs[].parent`.
      +         * If the node declares nothing, this method returns an empty array.
      +         * CAUTION: This API is experimental. See https://github.com/estools/escope/pull/69 for more details.
      +         *
      +         * @param {Esprima.Node} node - a node to get.
      +         * @returns {Variable[]} variables that declared by the node.
      +         */
      +
      +    }, {
      +        key: 'getDeclaredVariables',
      +        value: function getDeclaredVariables(node) {
      +            return this.__declaredVariables.get(node) || [];
      +        }
       
      -                // Heuristic selection from all scopes.
      -                // If you would like to get all scopes, please use ScopeManager#acquireAll.
      -                if (scopes.length === 1) {
      -                    return scopes[0];
      +        /**
      +         * acquire scope from node.
      +         * @method ScopeManager#acquire
      +         * @param {Esprima.Node} node - node for the acquired scope.
      +         * @param {boolean=} inner - look up the most inner scope, default value is false.
      +         * @return {Scope?}
      +         */
      +
      +    }, {
      +        key: 'acquire',
      +        value: function acquire(node, inner) {
      +            var scopes, scope, i, iz;
      +
      +            function predicate(scope) {
      +                if (scope.type === 'function' && scope.functionExpressionScope) {
      +                    return false;
                       }
      -
      -                if (inner) {
      -                    for (i = scopes.length - 1; i >= 0; --i) {
      -                        scope = scopes[i];
      -                        if (predicate(scope)) {
      -                            return scope;
      -                        }
      -                    }
      -                } else {
      -                    for (i = 0, iz = scopes.length; i < iz; ++i) {
      -                        scope = scopes[i];
      -                        if (predicate(scope)) {
      -                            return scope;
      -                        }
      -                    }
      +                if (scope.type === 'TDZ') {
      +                    return false;
                       }
      +                return true;
      +            }
       
      +            scopes = this.__get(node);
      +            if (!scopes || scopes.length === 0) {
                       return null;
                   }
      -        },
      -        acquireAll: {
      -
      -            /**
      -             * acquire all scopes from node.
      -             * @method ScopeManager#acquireAll
      -             * @param {Esprima.Node} node - node for the acquired scope.
      -             * @return {Scope[]?}
      -             */
      -
      -            value: function acquireAll(node) {
      -                return this.__get(node);
      +
      +            // Heuristic selection from all scopes.
      +            // If you would like to get all scopes, please use ScopeManager#acquireAll.
      +            if (scopes.length === 1) {
      +                return scopes[0];
                   }
      -        },
      -        release: {
      -
      -            /**
      -             * release the node.
      -             * @method ScopeManager#release
      -             * @param {Esprima.Node} node - releasing node.
      -             * @param {boolean=} inner - look up the most inner scope, default value is false.
      -             * @return {Scope?} upper scope for the node.
      -             */
      -
      -            value: function release(node, inner) {
      -                var scopes, scope;
      -                scopes = this.__get(node);
      -                if (scopes && scopes.length) {
      -                    scope = scopes[0].upper;
      -                    if (!scope) {
      -                        return null;
      +
      +            if (inner) {
      +                for (i = scopes.length - 1; i >= 0; --i) {
      +                    scope = scopes[i];
      +                    if (predicate(scope)) {
      +                        return scope;
                           }
      -                    return this.acquire(scope.block, inner);
                       }
      -                return null;
      -            }
      -        },
      -        attach: {
      -            value: function attach() {}
      -        },
      -        detach: {
      -            value: function detach() {}
      -        },
      -        __nestScope: {
      -            value: function __nestScope(scope) {
      -                if (scope instanceof GlobalScope) {
      -                    assert(this.__currentScope === null);
      -                    this.globalScope = scope;
      +            } else {
      +                for (i = 0, iz = scopes.length; i < iz; ++i) {
      +                    scope = scopes[i];
      +                    if (predicate(scope)) {
      +                        return scope;
      +                    }
                       }
      -                this.__currentScope = scope;
      -                return scope;
      -            }
      -        },
      -        __nestGlobalScope: {
      -            value: function __nestGlobalScope(node) {
      -                return this.__nestScope(new GlobalScope(this, node));
      -            }
      -        },
      -        __nestBlockScope: {
      -            value: function __nestBlockScope(node, isMethodDefinition) {
      -                return this.__nestScope(new BlockScope(this, this.__currentScope, node));
                   }
      -        },
      -        __nestFunctionScope: {
      -            value: function __nestFunctionScope(node, isMethodDefinition) {
      -                return this.__nestScope(new FunctionScope(this, this.__currentScope, node, isMethodDefinition));
      -            }
      -        },
      -        __nestForScope: {
      -            value: function __nestForScope(node) {
      -                return this.__nestScope(new ForScope(this, this.__currentScope, node));
      -            }
      -        },
      -        __nestCatchScope: {
      -            value: function __nestCatchScope(node) {
      -                return this.__nestScope(new CatchScope(this, this.__currentScope, node));
      -            }
      -        },
      -        __nestWithScope: {
      -            value: function __nestWithScope(node) {
      -                return this.__nestScope(new WithScope(this, this.__currentScope, node));
      -            }
      -        },
      -        __nestClassScope: {
      -            value: function __nestClassScope(node) {
      -                return this.__nestScope(new ClassScope(this, this.__currentScope, node));
      -            }
      -        },
      -        __nestSwitchScope: {
      -            value: function __nestSwitchScope(node) {
      -                return this.__nestScope(new SwitchScope(this, this.__currentScope, node));
      -            }
      -        },
      -        __nestModuleScope: {
      -            value: function __nestModuleScope(node) {
      -                return this.__nestScope(new ModuleScope(this, this.__currentScope, node));
      -            }
      -        },
      -        __nestTDZScope: {
      -            value: function __nestTDZScope(node) {
      -                return this.__nestScope(new TDZScope(this, this.__currentScope, node));
      -            }
      -        },
      -        __nestFunctionExpressionNameScope: {
      -            value: function __nestFunctionExpressionNameScope(node) {
      -                return this.__nestScope(new FunctionExpressionNameScope(this, this.__currentScope, node));
      +
      +            return null;
      +        }
      +
      +        /**
      +         * acquire all scopes from node.
      +         * @method ScopeManager#acquireAll
      +         * @param {Esprima.Node} node - node for the acquired scope.
      +         * @return {Scope[]?}
      +         */
      +
      +    }, {
      +        key: 'acquireAll',
      +        value: function acquireAll(node) {
      +            return this.__get(node);
      +        }
      +
      +        /**
      +         * release the node.
      +         * @method ScopeManager#release
      +         * @param {Esprima.Node} node - releasing node.
      +         * @param {boolean=} inner - look up the most inner scope, default value is false.
      +         * @return {Scope?} upper scope for the node.
      +         */
      +
      +    }, {
      +        key: 'release',
      +        value: function release(node, inner) {
      +            var scopes, scope;
      +            scopes = this.__get(node);
      +            if (scopes && scopes.length) {
      +                scope = scopes[0].upper;
      +                if (!scope) {
      +                    return null;
      +                }
      +                return this.acquire(scope.block, inner);
                   }
      -        },
      -        __isES6: {
      -            value: function __isES6() {
      -                return this.__options.ecmaVersion >= 6;
      +            return null;
      +        }
      +    }, {
      +        key: 'attach',
      +        value: function attach() {}
      +    }, {
      +        key: 'detach',
      +        value: function detach() {}
      +    }, {
      +        key: '__nestScope',
      +        value: function __nestScope(scope) {
      +            if (scope instanceof _scope.GlobalScope) {
      +                (0, _assert2.default)(this.__currentScope === null);
      +                this.globalScope = scope;
                   }
      +            this.__currentScope = scope;
      +            return scope;
               }
      -    });
      +    }, {
      +        key: '__nestGlobalScope',
      +        value: function __nestGlobalScope(node) {
      +            return this.__nestScope(new _scope.GlobalScope(this, node));
      +        }
      +    }, {
      +        key: '__nestBlockScope',
      +        value: function __nestBlockScope(node, isMethodDefinition) {
      +            return this.__nestScope(new _scope.BlockScope(this, this.__currentScope, node));
      +        }
      +    }, {
      +        key: '__nestFunctionScope',
      +        value: function __nestFunctionScope(node, isMethodDefinition) {
      +            return this.__nestScope(new _scope.FunctionScope(this, this.__currentScope, node, isMethodDefinition));
      +        }
      +    }, {
      +        key: '__nestForScope',
      +        value: function __nestForScope(node) {
      +            return this.__nestScope(new _scope.ForScope(this, this.__currentScope, node));
      +        }
      +    }, {
      +        key: '__nestCatchScope',
      +        value: function __nestCatchScope(node) {
      +            return this.__nestScope(new _scope.CatchScope(this, this.__currentScope, node));
      +        }
      +    }, {
      +        key: '__nestWithScope',
      +        value: function __nestWithScope(node) {
      +            return this.__nestScope(new _scope.WithScope(this, this.__currentScope, node));
      +        }
      +    }, {
      +        key: '__nestClassScope',
      +        value: function __nestClassScope(node) {
      +            return this.__nestScope(new _scope.ClassScope(this, this.__currentScope, node));
      +        }
      +    }, {
      +        key: '__nestSwitchScope',
      +        value: function __nestSwitchScope(node) {
      +            return this.__nestScope(new _scope.SwitchScope(this, this.__currentScope, node));
      +        }
      +    }, {
      +        key: '__nestModuleScope',
      +        value: function __nestModuleScope(node) {
      +            return this.__nestScope(new _scope.ModuleScope(this, this.__currentScope, node));
      +        }
      +    }, {
      +        key: '__nestTDZScope',
      +        value: function __nestTDZScope(node) {
      +            return this.__nestScope(new _scope.TDZScope(this, this.__currentScope, node));
      +        }
      +    }, {
      +        key: '__nestFunctionExpressionNameScope',
      +        value: function __nestFunctionExpressionNameScope(node) {
      +            return this.__nestScope(new _scope.FunctionExpressionNameScope(this, this.__currentScope, node));
      +        }
      +    }, {
      +        key: '__isES6',
      +        value: function __isES6() {
      +            return this.__options.ecmaVersion >= 6;
      +        }
      +    }]);
       
           return ScopeManager;
      -})();
      -
      -module.exports = ScopeManager;
      +}();
       
       /* vim: set sw=4 ts=4 et tw=80 : */
      -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjb3BlLW1hbmFnZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7SUF3Qk8sT0FBTywyQkFBTSxjQUFjOztxQkFDaEIsU0FBUzs7SUFBcEIsS0FBSzs7SUFDTCxNQUFNLDJCQUFNLFFBQVE7O0lBR3ZCLFdBQVcsVUFBWCxXQUFXO0lBQ1gsVUFBVSxVQUFWLFVBQVU7SUFDVixTQUFTLFVBQVQsU0FBUztJQUNULFdBQVcsVUFBWCxXQUFXO0lBQ1gsVUFBVSxVQUFWLFVBQVU7SUFDVixXQUFXLFVBQVgsV0FBVztJQUNYLGFBQWEsVUFBYixhQUFhO0lBQ2IsUUFBUSxVQUFSLFFBQVE7SUFDUixRQUFRLFVBQVIsUUFBUTtJQUNSLDJCQUEyQixVQUEzQiwyQkFBMkI7SUFDM0IsVUFBVSxVQUFWLFVBQVU7Ozs7OztJQU1PLFlBQVk7QUFDbEIsYUFETSxZQUFZLENBQ2pCLE9BQU8sRUFBRTs4QkFESixZQUFZOztBQUV6QixZQUFJLENBQUMsTUFBTSxHQUFHLEVBQUUsQ0FBQztBQUNqQixZQUFJLENBQUMsV0FBVyxHQUFHLElBQUksQ0FBQztBQUN4QixZQUFJLENBQUMsYUFBYSxHQUFHLElBQUksT0FBTyxFQUFFLENBQUM7QUFDbkMsWUFBSSxDQUFDLGNBQWMsR0FBRyxJQUFJLENBQUM7QUFDM0IsWUFBSSxDQUFDLFNBQVMsR0FBRyxPQUFPLENBQUM7S0FDNUI7O2lCQVBnQixZQUFZO0FBUzdCLHNCQUFjO21CQUFBLDBCQUFHO0FBQ2IsdUJBQU8sSUFBSSxDQUFDLFNBQVMsQ0FBQyxTQUFTLENBQUM7YUFDbkM7O0FBRUQsc0JBQWM7bUJBQUEsMEJBQUc7QUFDYix1QkFBTyxJQUFJLENBQUMsU0FBUyxDQUFDLFVBQVUsQ0FBQzthQUNwQzs7QUFFRCxvQkFBWTttQkFBQSx3QkFBRztBQUNYLHVCQUFPLElBQUksQ0FBQyxTQUFTLENBQUMsVUFBVSxDQUFDO2FBQ3BDOztBQUVELHVCQUFlO21CQUFBLDJCQUFHO0FBQ2QsdUJBQU8sSUFBSSxDQUFDLFNBQVMsQ0FBQyxXQUFXLENBQUM7YUFDckM7O0FBRUQsZ0JBQVE7bUJBQUEsb0JBQUc7QUFDUCx1QkFBTyxJQUFJLENBQUMsU0FBUyxDQUFDLFVBQVUsS0FBSyxRQUFRLENBQUM7YUFDakQ7O0FBR0QsYUFBSzs7OzttQkFBQSxlQUFDLElBQUksRUFBRTtBQUNSLHVCQUFPLElBQUksQ0FBQyxhQUFhLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxDQUFDO2FBQ3ZDOztBQVNELGVBQU87Ozs7Ozs7Ozs7bUJBQUEsaUJBQUMsSUFBSSxFQUFFLEtBQUssRUFBRTtBQUNqQixvQkFBSSxNQUFNLEVBQUUsS0FBSyxFQUFFLENBQUMsRUFBRSxFQUFFLENBQUM7O0FBRXpCLHlCQUFTLFNBQVMsQ0FBQyxLQUFLLEVBQUU7QUFDdEIsd0JBQUksS0FBSyxDQUFDLElBQUksS0FBSyxVQUFVLElBQUksS0FBSyxDQUFDLHVCQUF1QixFQUFFO0FBQzVELCtCQUFPLEtBQUssQ0FBQztxQkFDaEI7QUFDRCx3QkFBSSxLQUFLLENBQUMsSUFBSSxLQUFLLEtBQUssRUFBRTtBQUN0QiwrQkFBTyxLQUFLLENBQUM7cUJBQ2hCO0FBQ0QsMkJBQU8sSUFBSSxDQUFDO2lCQUNmOztBQUVELHNCQUFNLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsQ0FBQztBQUMxQixvQkFBSSxDQUFDLE1BQU0sSUFBSSxNQUFNLENBQUMsTUFBTSxLQUFLLENBQUMsRUFBRTtBQUNoQywyQkFBTyxJQUFJLENBQUM7aUJBQ2Y7Ozs7QUFJRCxvQkFBSSxNQUFNLENBQUMsTUFBTSxLQUFLLENBQUMsRUFBRTtBQUNyQiwyQkFBTyxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUM7aUJBQ3BCOztBQUVELG9CQUFJLEtBQUssRUFBRTtBQUNQLHlCQUFLLENBQUMsR0FBRyxNQUFNLENBQUMsTUFBTSxHQUFHLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxFQUFFLEVBQUUsQ0FBQyxFQUFFO0FBQ3JDLDZCQUFLLEdBQUcsTUFBTSxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ2xCLDRCQUFJLFNBQVMsQ0FBQyxLQUFLLENBQUMsRUFBRTtBQUNsQixtQ0FBTyxLQUFLLENBQUM7eUJBQ2hCO3FCQUNKO2lCQUNKLE1BQU07QUFDSCx5QkFBSyxDQUFDLEdBQUcsQ0FBQyxFQUFFLEVBQUUsR0FBRyxNQUFNLENBQUMsTUFBTSxFQUFFLENBQUMsR0FBRyxFQUFFLEVBQUUsRUFBRSxDQUFDLEVBQUU7QUFDekMsNkJBQUssR0FBRyxNQUFNLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDbEIsNEJBQUksU0FBUyxDQUFDLEtBQUssQ0FBQyxFQUFFO0FBQ2xCLG1DQUFPLEtBQUssQ0FBQzt5QkFDaEI7cUJBQ0o7aUJBQ0o7O0FBRUQsdUJBQU8sSUFBSSxDQUFDO2FBQ2Y7O0FBUUQsa0JBQVU7Ozs7Ozs7OzttQkFBQSxvQkFBQyxJQUFJLEVBQUU7QUFDYix1QkFBTyxJQUFJLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxDQUFDO2FBQzNCOztBQVNELGVBQU87Ozs7Ozs7Ozs7bUJBQUEsaUJBQUMsSUFBSSxFQUFFLEtBQUssRUFBRTtBQUNqQixvQkFBSSxNQUFNLEVBQUUsS0FBSyxDQUFDO0FBQ2xCLHNCQUFNLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxJQUFJLENBQUMsQ0FBQztBQUMxQixvQkFBSSxNQUFNLElBQUksTUFBTSxDQUFDLE1BQU0sRUFBRTtBQUN6Qix5QkFBSyxHQUFHLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUM7QUFDeEIsd0JBQUksQ0FBQyxLQUFLLEVBQUU7QUFDUiwrQkFBTyxJQUFJLENBQUM7cUJBQ2Y7QUFDRCwyQkFBTyxJQUFJLENBQUMsT0FBTyxDQUFDLEtBQUssQ0FBQyxLQUFLLEVBQUUsS0FBSyxDQUFDLENBQUM7aUJBQzNDO0FBQ0QsdUJBQU8sSUFBSSxDQUFDO2FBQ2Y7O0FBRUQsY0FBTTttQkFBQSxrQkFBRyxFQUFHOztBQUVaLGNBQU07bUJBQUEsa0JBQUcsRUFBRzs7QUFFWixtQkFBVzttQkFBQSxxQkFBQyxLQUFLLEVBQUU7QUFDZixvQkFBSSxLQUFLLFlBQVksV0FBVyxFQUFFO0FBQzlCLDBCQUFNLENBQUMsSUFBSSxDQUFDLGNBQWMsS0FBSyxJQUFJLENBQUMsQ0FBQztBQUNyQyx3QkFBSSxDQUFDLFdBQVcsR0FBRyxLQUFLLENBQUM7aUJBQzVCO0FBQ0Qsb0JBQUksQ0FBQyxjQUFjLEdBQUcsS0FBSyxDQUFDO0FBQzVCLHVCQUFPLEtBQUssQ0FBQzthQUNoQjs7QUFFRCx5QkFBaUI7bUJBQUEsMkJBQUMsSUFBSSxFQUFFO0FBQ3BCLHVCQUFPLElBQUksQ0FBQyxXQUFXLENBQUMsSUFBSSxXQUFXLENBQUMsSUFBSSxFQUFFLElBQUksQ0FBQyxDQUFDLENBQUM7YUFDeEQ7O0FBRUQsd0JBQWdCO21CQUFBLDBCQUFDLElBQUksRUFBRSxrQkFBa0IsRUFBRTtBQUN2Qyx1QkFBTyxJQUFJLENBQUMsV0FBVyxDQUFDLElBQUksVUFBVSxDQUFDLElBQUksRUFBRSxJQUFJLENBQUMsY0FBYyxFQUFFLElBQUksQ0FBQyxDQUFDLENBQUM7YUFDNUU7O0FBRUQsMkJBQW1CO21CQUFBLDZCQUFDLElBQUksRUFBRSxrQkFBa0IsRUFBRTtBQUMxQyx1QkFBTyxJQUFJLENBQUMsV0FBVyxDQUFDLElBQUksYUFBYSxDQUFDLElBQUksRUFBRSxJQUFJLENBQUMsY0FBYyxFQUFFLElBQUksRUFBRSxrQkFBa0IsQ0FBQyxDQUFDLENBQUM7YUFDbkc7O0FBRUQsc0JBQWM7bUJBQUEsd0JBQUMsSUFBSSxFQUFFO0FBQ2pCLHVCQUFPLElBQUksQ0FBQyxXQUFXLENBQUMsSUFBSSxRQUFRLENBQUMsSUFBSSxFQUFFLElBQUksQ0FBQyxjQUFjLEVBQUUsSUFBSSxDQUFDLENBQUMsQ0FBQzthQUMxRTs7QUFFRCx3QkFBZ0I7bUJBQUEsMEJBQUMsSUFBSSxFQUFFO0FBQ25CLHVCQUFPLElBQUksQ0FBQyxXQUFXLENBQUMsSUFBSSxVQUFVLENBQUMsSUFBSSxFQUFFLElBQUksQ0FBQyxjQUFjLEVBQUUsSUFBSSxDQUFDLENBQUMsQ0FBQzthQUM1RTs7QUFFRCx1QkFBZTttQkFBQSx5QkFBQyxJQUFJLEVBQUU7QUFDbEIsdUJBQU8sSUFBSSxDQUFDLFdBQVcsQ0FBQyxJQUFJLFNBQVMsQ0FBQyxJQUFJLEVBQUUsSUFBSSxDQUFDLGNBQWMsRUFBRSxJQUFJLENBQUMsQ0FBQyxDQUFDO2FBQzNFOztBQUVELHdCQUFnQjttQkFBQSwwQkFBQyxJQUFJLEVBQUU7QUFDbkIsdUJBQU8sSUFBSSxDQUFDLFdBQVcsQ0FBQyxJQUFJLFVBQVUsQ0FBQyxJQUFJLEVBQUUsSUFBSSxDQUFDLGNBQWMsRUFBRSxJQUFJLENBQUMsQ0FBQyxDQUFDO2FBQzVFOztBQUVELHlCQUFpQjttQkFBQSwyQkFBQyxJQUFJLEVBQUU7QUFDcEIsdUJBQU8sSUFBSSxDQUFDLFdBQVcsQ0FBQyxJQUFJLFdBQVcsQ0FBQyxJQUFJLEVBQUUsSUFBSSxDQUFDLGNBQWMsRUFBRSxJQUFJLENBQUMsQ0FBQyxDQUFDO2FBQzdFOztBQUVELHlCQUFpQjttQkFBQSwyQkFBQyxJQUFJLEVBQUU7QUFDcEIsdUJBQU8sSUFBSSxDQUFDLFdBQVcsQ0FBQyxJQUFJLFdBQVcsQ0FBQyxJQUFJLEVBQUUsSUFBSSxDQUFDLGNBQWMsRUFBRSxJQUFJLENBQUMsQ0FBQyxDQUFDO2FBQzdFOztBQUVELHNCQUFjO21CQUFBLHdCQUFDLElBQUksRUFBRTtBQUNqQix1QkFBTyxJQUFJLENBQUMsV0FBVyxDQUFDLElBQUksUUFBUSxDQUFDLElBQUksRUFBRSxJQUFJLENBQUMsY0FBYyxFQUFFLElBQUksQ0FBQyxDQUFDLENBQUM7YUFDMUU7O0FBRUQseUNBQWlDO21CQUFBLDJDQUFDLElBQUksRUFBRTtBQUNwQyx1QkFBTyxJQUFJLENBQUMsV0FBVyxDQUFDLElBQUksMkJBQTJCLENBQUMsSUFBSSxFQUFFLElBQUksQ0FBQyxjQUFjLEVBQUUsSUFBSSxDQUFDLENBQUMsQ0FBQzthQUM3Rjs7QUFFRCxlQUFPO21CQUFBLG1CQUFHO0FBQ04sdUJBQU8sSUFBSSxDQUFDLFNBQVMsQ0FBQyxXQUFXLElBQUksQ0FBQyxDQUFDO2FBQzFDOzs7O1dBN0tnQixZQUFZOzs7aUJBQVosWUFBWSIsImZpbGUiOiJzY29wZS1tYW5hZ2VyLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLypcbiAgQ29weXJpZ2h0IChDKSAyMDE1IFl1c3VrZSBTdXp1a2kgPHV0YXRhbmUudGVhQGdtYWlsLmNvbT5cblxuICBSZWRpc3RyaWJ1dGlvbiBhbmQgdXNlIGluIHNvdXJjZSBhbmQgYmluYXJ5IGZvcm1zLCB3aXRoIG9yIHdpdGhvdXRcbiAgbW9kaWZpY2F0aW9uLCBhcmUgcGVybWl0dGVkIHByb3ZpZGVkIHRoYXQgdGhlIGZvbGxvd2luZyBjb25kaXRpb25zIGFyZSBtZXQ6XG5cbiAgICAqIFJlZGlzdHJpYnV0aW9ucyBvZiBzb3VyY2UgY29kZSBtdXN0IHJldGFpbiB0aGUgYWJvdmUgY29weXJpZ2h0XG4gICAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIuXG4gICAgKiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodFxuICAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyIGluIHRoZVxuICAgICAgZG9jdW1lbnRhdGlvbiBhbmQvb3Igb3RoZXIgbWF0ZXJpYWxzIHByb3ZpZGVkIHdpdGggdGhlIGRpc3RyaWJ1dGlvbi5cblxuICBUSElTIFNPRlRXQVJFIElTIFBST1ZJREVEIEJZIFRIRSBDT1BZUklHSFQgSE9MREVSUyBBTkQgQ09OVFJJQlVUT1JTIFwiQVMgSVNcIlxuICBBTkQgQU5ZIEVYUFJFU1MgT1IgSU1QTElFRCBXQVJSQU5USUVTLCBJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgVEhFXG4gIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFXG4gIEFSRSBESVNDTEFJTUVELiBJTiBOTyBFVkVOVCBTSEFMTCA8Q09QWVJJR0hUIEhPTERFUj4gQkUgTElBQkxFIEZPUiBBTllcbiAgRElSRUNULCBJTkRJUkVDVCwgSU5DSURFTlRBTCwgU1BFQ0lBTCwgRVhFTVBMQVJZLCBPUiBDT05TRVFVRU5USUFMIERBTUFHRVNcbiAgKElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTO1xuICBMT1NTIE9GIFVTRSwgREFUQSwgT1IgUFJPRklUUzsgT1IgQlVTSU5FU1MgSU5URVJSVVBUSU9OKSBIT1dFVkVSIENBVVNFRCBBTkRcbiAgT04gQU5ZIFRIRU9SWSBPRiBMSUFCSUxJVFksIFdIRVRIRVIgSU4gQ09OVFJBQ1QsIFNUUklDVCBMSUFCSUxJVFksIE9SIFRPUlRcbiAgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFIE9GXG4gIFRISVMgU09GVFdBUkUsIEVWRU4gSUYgQURWSVNFRCBPRiBUSEUgUE9TU0lCSUxJVFkgT0YgU1VDSCBEQU1BR0UuXG4qL1xuXG5pbXBvcnQgV2Vha01hcCBmcm9tICdlczYtd2Vhay1tYXAnO1xuaW1wb3J0IFNjb3BlIGZyb20gJy4vc2NvcGUnO1xuaW1wb3J0IGFzc2VydCBmcm9tICdhc3NlcnQnO1xuXG5pbXBvcnQge1xuICAgIEdsb2JhbFNjb3BlLFxuICAgIENhdGNoU2NvcGUsXG4gICAgV2l0aFNjb3BlLFxuICAgIE1vZHVsZVNjb3BlLFxuICAgIENsYXNzU2NvcGUsXG4gICAgU3dpdGNoU2NvcGUsXG4gICAgRnVuY3Rpb25TY29wZSxcbiAgICBGb3JTY29wZSxcbiAgICBURFpTY29wZSxcbiAgICBGdW5jdGlvbkV4cHJlc3Npb25OYW1lU2NvcGUsXG4gICAgQmxvY2tTY29wZVxufSBmcm9tICcuL3Njb3BlJztcblxuLyoqXG4gKiBAY2xhc3MgU2NvcGVNYW5hZ2VyXG4gKi9cbmV4cG9ydCBkZWZhdWx0IGNsYXNzIFNjb3BlTWFuYWdlciB7XG4gICAgY29uc3RydWN0b3Iob3B0aW9ucykge1xuICAgICAgICB0aGlzLnNjb3BlcyA9IFtdO1xuICAgICAgICB0aGlzLmdsb2JhbFNjb3BlID0gbnVsbDtcbiAgICAgICAgdGhpcy5fX25vZGVUb1Njb3BlID0gbmV3IFdlYWtNYXAoKTtcbiAgICAgICAgdGhpcy5fX2N1cnJlbnRTY29wZSA9IG51bGw7XG4gICAgICAgIHRoaXMuX19vcHRpb25zID0gb3B0aW9ucztcbiAgICB9XG5cbiAgICBfX3VzZURpcmVjdGl2ZSgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX19vcHRpb25zLmRpcmVjdGl2ZTtcbiAgICB9XG5cbiAgICBfX2lzT3B0aW1pc3RpYygpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX19vcHRpb25zLm9wdGltaXN0aWM7XG4gICAgfVxuXG4gICAgX19pZ25vcmVFdmFsKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5fX29wdGlvbnMuaWdub3JlRXZhbDtcbiAgICB9XG5cbiAgICBfX2lzTm9kZWpzU2NvcGUoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fb3B0aW9ucy5ub2RlanNTY29wZTtcbiAgICB9XG5cbiAgICBpc01vZHVsZSgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX19vcHRpb25zLnNvdXJjZVR5cGUgPT09ICdtb2R1bGUnO1xuICAgIH1cblxuICAgIC8vIFJldHVybnMgYXBwcm9wbGlhdGUgc2NvcGUgZm9yIHRoaXMgbm9kZS5cbiAgICBfX2dldChub2RlKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fbm9kZVRvU2NvcGUuZ2V0KG5vZGUpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIGFjcXVpcmUgc2NvcGUgZnJvbSBub2RlLlxuICAgICAqIEBtZXRob2QgU2NvcGVNYW5hZ2VyI2FjcXVpcmVcbiAgICAgKiBAcGFyYW0ge0VzcHJpbWEuTm9kZX0gbm9kZSAtIG5vZGUgZm9yIHRoZSBhY3F1aXJlZCBzY29wZS5cbiAgICAgKiBAcGFyYW0ge2Jvb2xlYW49fSBpbm5lciAtIGxvb2sgdXAgdGhlIG1vc3QgaW5uZXIgc2NvcGUsIGRlZmF1bHQgdmFsdWUgaXMgZmFsc2UuXG4gICAgICogQHJldHVybiB7U2NvcGU/fVxuICAgICAqL1xuICAgIGFjcXVpcmUobm9kZSwgaW5uZXIpIHtcbiAgICAgICAgdmFyIHNjb3Blcywgc2NvcGUsIGksIGl6O1xuXG4gICAgICAgIGZ1bmN0aW9uIHByZWRpY2F0ZShzY29wZSkge1xuICAgICAgICAgICAgaWYgKHNjb3BlLnR5cGUgPT09ICdmdW5jdGlvbicgJiYgc2NvcGUuZnVuY3Rpb25FeHByZXNzaW9uU2NvcGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoc2NvcGUudHlwZSA9PT0gJ1REWicpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHNjb3BlcyA9IHRoaXMuX19nZXQobm9kZSk7XG4gICAgICAgIGlmICghc2NvcGVzIHx8IHNjb3Blcy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gSGV1cmlzdGljIHNlbGVjdGlvbiBmcm9tIGFsbCBzY29wZXMuXG4gICAgICAgIC8vIElmIHlvdSB3b3VsZCBsaWtlIHRvIGdldCBhbGwgc2NvcGVzLCBwbGVhc2UgdXNlIFNjb3BlTWFuYWdlciNhY3F1aXJlQWxsLlxuICAgICAgICBpZiAoc2NvcGVzLmxlbmd0aCA9PT0gMSkge1xuICAgICAgICAgICAgcmV0dXJuIHNjb3Blc1swXTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChpbm5lcikge1xuICAgICAgICAgICAgZm9yIChpID0gc2NvcGVzLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgICAgICAgICAgc2NvcGUgPSBzY29wZXNbaV07XG4gICAgICAgICAgICAgICAgaWYgKHByZWRpY2F0ZShzY29wZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNjb3BlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGZvciAoaSA9IDAsIGl6ID0gc2NvcGVzLmxlbmd0aDsgaSA8IGl6OyArK2kpIHtcbiAgICAgICAgICAgICAgICBzY29wZSA9IHNjb3Blc1tpXTtcbiAgICAgICAgICAgICAgICBpZiAocHJlZGljYXRlKHNjb3BlKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2NvcGU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogYWNxdWlyZSBhbGwgc2NvcGVzIGZyb20gbm9kZS5cbiAgICAgKiBAbWV0aG9kIFNjb3BlTWFuYWdlciNhY3F1aXJlQWxsXG4gICAgICogQHBhcmFtIHtFc3ByaW1hLk5vZGV9IG5vZGUgLSBub2RlIGZvciB0aGUgYWNxdWlyZWQgc2NvcGUuXG4gICAgICogQHJldHVybiB7U2NvcGVbXT99XG4gICAgICovXG4gICAgYWNxdWlyZUFsbChub2RlKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fZ2V0KG5vZGUpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIHJlbGVhc2UgdGhlIG5vZGUuXG4gICAgICogQG1ldGhvZCBTY29wZU1hbmFnZXIjcmVsZWFzZVxuICAgICAqIEBwYXJhbSB7RXNwcmltYS5Ob2RlfSBub2RlIC0gcmVsZWFzaW5nIG5vZGUuXG4gICAgICogQHBhcmFtIHtib29sZWFuPX0gaW5uZXIgLSBsb29rIHVwIHRoZSBtb3N0IGlubmVyIHNjb3BlLCBkZWZhdWx0IHZhbHVlIGlzIGZhbHNlLlxuICAgICAqIEByZXR1cm4ge1Njb3BlP30gdXBwZXIgc2NvcGUgZm9yIHRoZSBub2RlLlxuICAgICAqL1xuICAgIHJlbGVhc2Uobm9kZSwgaW5uZXIpIHtcbiAgICAgICAgdmFyIHNjb3Blcywgc2NvcGU7XG4gICAgICAgIHNjb3BlcyA9IHRoaXMuX19nZXQobm9kZSk7XG4gICAgICAgIGlmIChzY29wZXMgJiYgc2NvcGVzLmxlbmd0aCkge1xuICAgICAgICAgICAgc2NvcGUgPSBzY29wZXNbMF0udXBwZXI7XG4gICAgICAgICAgICBpZiAoIXNjb3BlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5hY3F1aXJlKHNjb3BlLmJsb2NrLCBpbm5lcik7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgfVxuXG4gICAgYXR0YWNoKCkgeyB9XG5cbiAgICBkZXRhY2goKSB7IH1cblxuICAgIF9fbmVzdFNjb3BlKHNjb3BlKSB7XG4gICAgICAgIGlmIChzY29wZSBpbnN0YW5jZW9mIEdsb2JhbFNjb3BlKSB7XG4gICAgICAgICAgICBhc3NlcnQodGhpcy5fX2N1cnJlbnRTY29wZSA9PT0gbnVsbCk7XG4gICAgICAgICAgICB0aGlzLmdsb2JhbFNjb3BlID0gc2NvcGU7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5fX2N1cnJlbnRTY29wZSA9IHNjb3BlO1xuICAgICAgICByZXR1cm4gc2NvcGU7XG4gICAgfVxuXG4gICAgX19uZXN0R2xvYmFsU2NvcGUobm9kZSkge1xuICAgICAgICByZXR1cm4gdGhpcy5fX25lc3RTY29wZShuZXcgR2xvYmFsU2NvcGUodGhpcywgbm9kZSkpO1xuICAgIH1cblxuICAgIF9fbmVzdEJsb2NrU2NvcGUobm9kZSwgaXNNZXRob2REZWZpbml0aW9uKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fbmVzdFNjb3BlKG5ldyBCbG9ja1Njb3BlKHRoaXMsIHRoaXMuX19jdXJyZW50U2NvcGUsIG5vZGUpKTtcbiAgICB9XG5cbiAgICBfX25lc3RGdW5jdGlvblNjb3BlKG5vZGUsIGlzTWV0aG9kRGVmaW5pdGlvbikge1xuICAgICAgICByZXR1cm4gdGhpcy5fX25lc3RTY29wZShuZXcgRnVuY3Rpb25TY29wZSh0aGlzLCB0aGlzLl9fY3VycmVudFNjb3BlLCBub2RlLCBpc01ldGhvZERlZmluaXRpb24pKTtcbiAgICB9XG5cbiAgICBfX25lc3RGb3JTY29wZShub2RlKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fbmVzdFNjb3BlKG5ldyBGb3JTY29wZSh0aGlzLCB0aGlzLl9fY3VycmVudFNjb3BlLCBub2RlKSk7XG4gICAgfVxuXG4gICAgX19uZXN0Q2F0Y2hTY29wZShub2RlKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fbmVzdFNjb3BlKG5ldyBDYXRjaFNjb3BlKHRoaXMsIHRoaXMuX19jdXJyZW50U2NvcGUsIG5vZGUpKTtcbiAgICB9XG5cbiAgICBfX25lc3RXaXRoU2NvcGUobm9kZSkge1xuICAgICAgICByZXR1cm4gdGhpcy5fX25lc3RTY29wZShuZXcgV2l0aFNjb3BlKHRoaXMsIHRoaXMuX19jdXJyZW50U2NvcGUsIG5vZGUpKTtcbiAgICB9XG5cbiAgICBfX25lc3RDbGFzc1Njb3BlKG5vZGUpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX19uZXN0U2NvcGUobmV3IENsYXNzU2NvcGUodGhpcywgdGhpcy5fX2N1cnJlbnRTY29wZSwgbm9kZSkpO1xuICAgIH1cblxuICAgIF9fbmVzdFN3aXRjaFNjb3BlKG5vZGUpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX19uZXN0U2NvcGUobmV3IFN3aXRjaFNjb3BlKHRoaXMsIHRoaXMuX19jdXJyZW50U2NvcGUsIG5vZGUpKTtcbiAgICB9XG5cbiAgICBfX25lc3RNb2R1bGVTY29wZShub2RlKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fbmVzdFNjb3BlKG5ldyBNb2R1bGVTY29wZSh0aGlzLCB0aGlzLl9fY3VycmVudFNjb3BlLCBub2RlKSk7XG4gICAgfVxuXG4gICAgX19uZXN0VERaU2NvcGUobm9kZSkge1xuICAgICAgICByZXR1cm4gdGhpcy5fX25lc3RTY29wZShuZXcgVERaU2NvcGUodGhpcywgdGhpcy5fX2N1cnJlbnRTY29wZSwgbm9kZSkpO1xuICAgIH1cblxuICAgIF9fbmVzdEZ1bmN0aW9uRXhwcmVzc2lvbk5hbWVTY29wZShub2RlKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fbmVzdFNjb3BlKG5ldyBGdW5jdGlvbkV4cHJlc3Npb25OYW1lU2NvcGUodGhpcywgdGhpcy5fX2N1cnJlbnRTY29wZSwgbm9kZSkpO1xuICAgIH1cblxuICAgIF9faXNFUzYoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fb3B0aW9ucy5lY21hVmVyc2lvbiA+PSA2O1xuICAgIH1cbn1cblxuLyogdmltOiBzZXQgc3c9NCB0cz00IGV0IHR3PTgwIDogKi9cbiJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
      \ No newline at end of file
      +
      +
      +exports.default = ScopeManager;
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjb3BlLW1hbmFnZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBd0JBOzs7O0FBQ0E7Ozs7QUFDQTs7Ozs7Ozs7Ozs7O0lBbUJxQjtBQUNqQixhQURpQixZQUNqQixDQUFZLE9BQVosRUFBcUI7OEJBREosY0FDSTs7QUFDakIsYUFBSyxNQUFMLEdBQWMsRUFBZCxDQURpQjtBQUVqQixhQUFLLFdBQUwsR0FBbUIsSUFBbkIsQ0FGaUI7QUFHakIsYUFBSyxhQUFMLEdBQXFCLDBCQUFyQixDQUhpQjtBQUlqQixhQUFLLGNBQUwsR0FBc0IsSUFBdEIsQ0FKaUI7QUFLakIsYUFBSyxTQUFMLEdBQWlCLE9BQWpCLENBTGlCO0FBTWpCLGFBQUssbUJBQUwsR0FBMkIsMEJBQTNCLENBTmlCO0tBQXJCOztpQkFEaUI7O3lDQVVBO0FBQ2IsbUJBQU8sS0FBSyxTQUFMLENBQWUsU0FBZixDQURNOzs7O3lDQUlBO0FBQ2IsbUJBQU8sS0FBSyxTQUFMLENBQWUsVUFBZixDQURNOzs7O3VDQUlGO0FBQ1gsbUJBQU8sS0FBSyxTQUFMLENBQWUsVUFBZixDQURJOzs7OzBDQUlHO0FBQ2QsbUJBQU8sS0FBSyxTQUFMLENBQWUsV0FBZixDQURPOzs7O21DQUlQO0FBQ1AsbUJBQU8sS0FBSyxTQUFMLENBQWUsVUFBZixLQUE4QixRQUE5QixDQURBOzs7OzBDQUlPO0FBQ2QsbUJBQU8sS0FBSyxTQUFMLENBQWUsYUFBZixDQURPOzs7O2dEQUlNO0FBQ3BCLG1CQUFPLEtBQUssU0FBTCxDQUFlLFdBQWYsSUFBOEIsQ0FBOUIsQ0FEYTs7Ozs7Ozs4QkFLbEIsTUFBTTtBQUNSLG1CQUFPLEtBQUssYUFBTCxDQUFtQixHQUFuQixDQUF1QixJQUF2QixDQUFQLENBRFE7Ozs7Ozs7Ozs7Ozs7Ozs7NkNBY1MsTUFBTTtBQUN2QixtQkFBTyxLQUFLLG1CQUFMLENBQXlCLEdBQXpCLENBQTZCLElBQTdCLEtBQXNDLEVBQXRDLENBRGdCOzs7Ozs7Ozs7Ozs7O2dDQVduQixNQUFNLE9BQU87QUFDakIsZ0JBQUksTUFBSixFQUFZLEtBQVosRUFBbUIsQ0FBbkIsRUFBc0IsRUFBdEIsQ0FEaUI7O0FBR2pCLHFCQUFTLFNBQVQsQ0FBbUIsS0FBbkIsRUFBMEI7QUFDdEIsb0JBQUksTUFBTSxJQUFOLEtBQWUsVUFBZixJQUE2QixNQUFNLHVCQUFOLEVBQStCO0FBQzVELDJCQUFPLEtBQVAsQ0FENEQ7aUJBQWhFO0FBR0Esb0JBQUksTUFBTSxJQUFOLEtBQWUsS0FBZixFQUFzQjtBQUN0QiwyQkFBTyxLQUFQLENBRHNCO2lCQUExQjtBQUdBLHVCQUFPLElBQVAsQ0FQc0I7YUFBMUI7O0FBVUEscUJBQVMsS0FBSyxLQUFMLENBQVcsSUFBWCxDQUFULENBYmlCO0FBY2pCLGdCQUFJLENBQUMsTUFBRCxJQUFXLE9BQU8sTUFBUCxLQUFrQixDQUFsQixFQUFxQjtBQUNoQyx1QkFBTyxJQUFQLENBRGdDO2FBQXBDOzs7O0FBZGlCLGdCQW9CYixPQUFPLE1BQVAsS0FBa0IsQ0FBbEIsRUFBcUI7QUFDckIsdUJBQU8sT0FBTyxDQUFQLENBQVAsQ0FEcUI7YUFBekI7O0FBSUEsZ0JBQUksS0FBSixFQUFXO0FBQ1AscUJBQUssSUFBSSxPQUFPLE1BQVAsR0FBZ0IsQ0FBaEIsRUFBbUIsS0FBSyxDQUFMLEVBQVEsRUFBRSxDQUFGLEVBQUs7QUFDckMsNEJBQVEsT0FBTyxDQUFQLENBQVIsQ0FEcUM7QUFFckMsd0JBQUksVUFBVSxLQUFWLENBQUosRUFBc0I7QUFDbEIsK0JBQU8sS0FBUCxDQURrQjtxQkFBdEI7aUJBRko7YUFESixNQU9PO0FBQ0gscUJBQUssSUFBSSxDQUFKLEVBQU8sS0FBSyxPQUFPLE1BQVAsRUFBZSxJQUFJLEVBQUosRUFBUSxFQUFFLENBQUYsRUFBSztBQUN6Qyw0QkFBUSxPQUFPLENBQVAsQ0FBUixDQUR5QztBQUV6Qyx3QkFBSSxVQUFVLEtBQVYsQ0FBSixFQUFzQjtBQUNsQiwrQkFBTyxLQUFQLENBRGtCO3FCQUF0QjtpQkFGSjthQVJKOztBQWdCQSxtQkFBTyxJQUFQLENBeENpQjs7Ozs7Ozs7Ozs7O21DQWlEVixNQUFNO0FBQ2IsbUJBQU8sS0FBSyxLQUFMLENBQVcsSUFBWCxDQUFQLENBRGE7Ozs7Ozs7Ozs7Ozs7Z0NBV1QsTUFBTSxPQUFPO0FBQ2pCLGdCQUFJLE1BQUosRUFBWSxLQUFaLENBRGlCO0FBRWpCLHFCQUFTLEtBQUssS0FBTCxDQUFXLElBQVgsQ0FBVCxDQUZpQjtBQUdqQixnQkFBSSxVQUFVLE9BQU8sTUFBUCxFQUFlO0FBQ3pCLHdCQUFRLE9BQU8sQ0FBUCxFQUFVLEtBQVYsQ0FEaUI7QUFFekIsb0JBQUksQ0FBQyxLQUFELEVBQVE7QUFDUiwyQkFBTyxJQUFQLENBRFE7aUJBQVo7QUFHQSx1QkFBTyxLQUFLLE9BQUwsQ0FBYSxNQUFNLEtBQU4sRUFBYSxLQUExQixDQUFQLENBTHlCO2FBQTdCO0FBT0EsbUJBQU8sSUFBUCxDQVZpQjs7OztpQ0FhWjs7O2lDQUVBOzs7b0NBRUcsT0FBTztBQUNmLGdCQUFJLG1DQUFKLEVBQWtDO0FBQzlCLHNDQUFPLEtBQUssY0FBTCxLQUF3QixJQUF4QixDQUFQLENBRDhCO0FBRTlCLHFCQUFLLFdBQUwsR0FBbUIsS0FBbkIsQ0FGOEI7YUFBbEM7QUFJQSxpQkFBSyxjQUFMLEdBQXNCLEtBQXRCLENBTGU7QUFNZixtQkFBTyxLQUFQLENBTmU7Ozs7MENBU0QsTUFBTTtBQUNwQixtQkFBTyxLQUFLLFdBQUwsQ0FBaUIsdUJBQWdCLElBQWhCLEVBQXNCLElBQXRCLENBQWpCLENBQVAsQ0FEb0I7Ozs7eUNBSVAsTUFBTSxvQkFBb0I7QUFDdkMsbUJBQU8sS0FBSyxXQUFMLENBQWlCLHNCQUFlLElBQWYsRUFBcUIsS0FBSyxjQUFMLEVBQXFCLElBQTFDLENBQWpCLENBQVAsQ0FEdUM7Ozs7NENBSXZCLE1BQU0sb0JBQW9CO0FBQzFDLG1CQUFPLEtBQUssV0FBTCxDQUFpQix5QkFBa0IsSUFBbEIsRUFBd0IsS0FBSyxjQUFMLEVBQXFCLElBQTdDLEVBQW1ELGtCQUFuRCxDQUFqQixDQUFQLENBRDBDOzs7O3VDQUkvQixNQUFNO0FBQ2pCLG1CQUFPLEtBQUssV0FBTCxDQUFpQixvQkFBYSxJQUFiLEVBQW1CLEtBQUssY0FBTCxFQUFxQixJQUF4QyxDQUFqQixDQUFQLENBRGlCOzs7O3lDQUlKLE1BQU07QUFDbkIsbUJBQU8sS0FBSyxXQUFMLENBQWlCLHNCQUFlLElBQWYsRUFBcUIsS0FBSyxjQUFMLEVBQXFCLElBQTFDLENBQWpCLENBQVAsQ0FEbUI7Ozs7d0NBSVAsTUFBTTtBQUNsQixtQkFBTyxLQUFLLFdBQUwsQ0FBaUIscUJBQWMsSUFBZCxFQUFvQixLQUFLLGNBQUwsRUFBcUIsSUFBekMsQ0FBakIsQ0FBUCxDQURrQjs7Ozt5Q0FJTCxNQUFNO0FBQ25CLG1CQUFPLEtBQUssV0FBTCxDQUFpQixzQkFBZSxJQUFmLEVBQXFCLEtBQUssY0FBTCxFQUFxQixJQUExQyxDQUFqQixDQUFQLENBRG1COzs7OzBDQUlMLE1BQU07QUFDcEIsbUJBQU8sS0FBSyxXQUFMLENBQWlCLHVCQUFnQixJQUFoQixFQUFzQixLQUFLLGNBQUwsRUFBcUIsSUFBM0MsQ0FBakIsQ0FBUCxDQURvQjs7OzswQ0FJTixNQUFNO0FBQ3BCLG1CQUFPLEtBQUssV0FBTCxDQUFpQix1QkFBZ0IsSUFBaEIsRUFBc0IsS0FBSyxjQUFMLEVBQXFCLElBQTNDLENBQWpCLENBQVAsQ0FEb0I7Ozs7dUNBSVQsTUFBTTtBQUNqQixtQkFBTyxLQUFLLFdBQUwsQ0FBaUIsb0JBQWEsSUFBYixFQUFtQixLQUFLLGNBQUwsRUFBcUIsSUFBeEMsQ0FBakIsQ0FBUCxDQURpQjs7OzswREFJYSxNQUFNO0FBQ3BDLG1CQUFPLEtBQUssV0FBTCxDQUFpQix1Q0FBZ0MsSUFBaEMsRUFBc0MsS0FBSyxjQUFMLEVBQXFCLElBQTNELENBQWpCLENBQVAsQ0FEb0M7Ozs7a0NBSTlCO0FBQ04sbUJBQU8sS0FBSyxTQUFMLENBQWUsV0FBZixJQUE4QixDQUE5QixDQUREOzs7O1dBbE1PIiwiZmlsZSI6InNjb3BlLW1hbmFnZXIuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKlxuICBDb3B5cmlnaHQgKEMpIDIwMTUgWXVzdWtlIFN1enVraSA8dXRhdGFuZS50ZWFAZ21haWwuY29tPlxuXG4gIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dFxuICBtb2RpZmljYXRpb24sIGFyZSBwZXJtaXR0ZWQgcHJvdmlkZWQgdGhhdCB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnMgYXJlIG1ldDpcblxuICAgICogUmVkaXN0cmlidXRpb25zIG9mIHNvdXJjZSBjb2RlIG11c3QgcmV0YWluIHRoZSBhYm92ZSBjb3B5cmlnaHRcbiAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lci5cbiAgICAqIFJlZGlzdHJpYnV0aW9ucyBpbiBiaW5hcnkgZm9ybSBtdXN0IHJlcHJvZHVjZSB0aGUgYWJvdmUgY29weXJpZ2h0XG4gICAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIgaW4gdGhlXG4gICAgICBkb2N1bWVudGF0aW9uIGFuZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQgd2l0aCB0aGUgZGlzdHJpYnV0aW9uLlxuXG4gIFRISVMgU09GVFdBUkUgSVMgUFJPVklERUQgQlkgVEhFIENPUFlSSUdIVCBIT0xERVJTIEFORCBDT05UUklCVVRPUlMgXCJBUyBJU1wiXG4gIEFORCBBTlkgRVhQUkVTUyBPUiBJTVBMSUVEIFdBUlJBTlRJRVMsIElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBUSEVcbiAgSU1QTElFRCBXQVJSQU5USUVTIE9GIE1FUkNIQU5UQUJJTElUWSBBTkQgRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0VcbiAgQVJFIERJU0NMQUlNRUQuIElOIE5PIEVWRU5UIFNIQUxMIDxDT1BZUklHSFQgSE9MREVSPiBCRSBMSUFCTEUgRk9SIEFOWVxuICBESVJFQ1QsIElORElSRUNULCBJTkNJREVOVEFMLCBTUEVDSUFMLCBFWEVNUExBUlksIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFU1xuICAoSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFBST0NVUkVNRU5UIE9GIFNVQlNUSVRVVEUgR09PRFMgT1IgU0VSVklDRVM7XG4gIExPU1MgT0YgVVNFLCBEQVRBLCBPUiBQUk9GSVRTOyBPUiBCVVNJTkVTUyBJTlRFUlJVUFRJT04pIEhPV0VWRVIgQ0FVU0VEIEFORFxuICBPTiBBTlkgVEhFT1JZIE9GIExJQUJJTElUWSwgV0hFVEhFUiBJTiBDT05UUkFDVCwgU1RSSUNUIExJQUJJTElUWSwgT1IgVE9SVFxuICAoSU5DTFVESU5HIE5FR0xJR0VOQ0UgT1IgT1RIRVJXSVNFKSBBUklTSU5HIElOIEFOWSBXQVkgT1VUIE9GIFRIRSBVU0UgT0ZcbiAgVEhJUyBTT0ZUV0FSRSwgRVZFTiBJRiBBRFZJU0VEIE9GIFRIRSBQT1NTSUJJTElUWSBPRiBTVUNIIERBTUFHRS5cbiovXG5cbmltcG9ydCBXZWFrTWFwIGZyb20gJ2VzNi13ZWFrLW1hcCc7XG5pbXBvcnQgU2NvcGUgZnJvbSAnLi9zY29wZSc7XG5pbXBvcnQgYXNzZXJ0IGZyb20gJ2Fzc2VydCc7XG5cbmltcG9ydCB7XG4gICAgR2xvYmFsU2NvcGUsXG4gICAgQ2F0Y2hTY29wZSxcbiAgICBXaXRoU2NvcGUsXG4gICAgTW9kdWxlU2NvcGUsXG4gICAgQ2xhc3NTY29wZSxcbiAgICBTd2l0Y2hTY29wZSxcbiAgICBGdW5jdGlvblNjb3BlLFxuICAgIEZvclNjb3BlLFxuICAgIFREWlNjb3BlLFxuICAgIEZ1bmN0aW9uRXhwcmVzc2lvbk5hbWVTY29wZSxcbiAgICBCbG9ja1Njb3BlXG59IGZyb20gJy4vc2NvcGUnO1xuXG4vKipcbiAqIEBjbGFzcyBTY29wZU1hbmFnZXJcbiAqL1xuZXhwb3J0IGRlZmF1bHQgY2xhc3MgU2NvcGVNYW5hZ2VyIHtcbiAgICBjb25zdHJ1Y3RvcihvcHRpb25zKSB7XG4gICAgICAgIHRoaXMuc2NvcGVzID0gW107XG4gICAgICAgIHRoaXMuZ2xvYmFsU2NvcGUgPSBudWxsO1xuICAgICAgICB0aGlzLl9fbm9kZVRvU2NvcGUgPSBuZXcgV2Vha01hcCgpO1xuICAgICAgICB0aGlzLl9fY3VycmVudFNjb3BlID0gbnVsbDtcbiAgICAgICAgdGhpcy5fX29wdGlvbnMgPSBvcHRpb25zO1xuICAgICAgICB0aGlzLl9fZGVjbGFyZWRWYXJpYWJsZXMgPSBuZXcgV2Vha01hcCgpO1xuICAgIH1cblxuICAgIF9fdXNlRGlyZWN0aXZlKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5fX29wdGlvbnMuZGlyZWN0aXZlO1xuICAgIH1cblxuICAgIF9faXNPcHRpbWlzdGljKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5fX29wdGlvbnMub3B0aW1pc3RpYztcbiAgICB9XG5cbiAgICBfX2lnbm9yZUV2YWwoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fb3B0aW9ucy5pZ25vcmVFdmFsO1xuICAgIH1cblxuICAgIF9faXNOb2RlanNTY29wZSgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX19vcHRpb25zLm5vZGVqc1Njb3BlO1xuICAgIH1cblxuICAgIGlzTW9kdWxlKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5fX29wdGlvbnMuc291cmNlVHlwZSA9PT0gJ21vZHVsZSc7XG4gICAgfVxuXG4gICAgaXNJbXBsaWVkU3RyaWN0KCkge1xuICAgICAgICByZXR1cm4gdGhpcy5fX29wdGlvbnMuaW1wbGllZFN0cmljdDtcbiAgICB9XG5cbiAgICBpc1N0cmljdE1vZGVTdXBwb3J0ZWQoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fb3B0aW9ucy5lY21hVmVyc2lvbiA+PSA1O1xuICAgIH1cblxuICAgIC8vIFJldHVybnMgYXBwcm9wcmlhdGUgc2NvcGUgZm9yIHRoaXMgbm9kZS5cbiAgICBfX2dldChub2RlKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fbm9kZVRvU2NvcGUuZ2V0KG5vZGUpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIEdldCB2YXJpYWJsZXMgdGhhdCBhcmUgZGVjbGFyZWQgYnkgdGhlIG5vZGUuXG4gICAgICpcbiAgICAgKiBcImFyZSBkZWNsYXJlZCBieSB0aGUgbm9kZVwiIG1lYW5zIHRoZSBub2RlIGlzIHNhbWUgYXMgYFZhcmlhYmxlLmRlZnNbXS5ub2RlYCBvciBgVmFyaWFibGUuZGVmc1tdLnBhcmVudGAuXG4gICAgICogSWYgdGhlIG5vZGUgZGVjbGFyZXMgbm90aGluZywgdGhpcyBtZXRob2QgcmV0dXJucyBhbiBlbXB0eSBhcnJheS5cbiAgICAgKiBDQVVUSU9OOiBUaGlzIEFQSSBpcyBleHBlcmltZW50YWwuIFNlZSBodHRwczovL2dpdGh1Yi5jb20vZXN0b29scy9lc2NvcGUvcHVsbC82OSBmb3IgbW9yZSBkZXRhaWxzLlxuICAgICAqXG4gICAgICogQHBhcmFtIHtFc3ByaW1hLk5vZGV9IG5vZGUgLSBhIG5vZGUgdG8gZ2V0LlxuICAgICAqIEByZXR1cm5zIHtWYXJpYWJsZVtdfSB2YXJpYWJsZXMgdGhhdCBkZWNsYXJlZCBieSB0aGUgbm9kZS5cbiAgICAgKi9cbiAgICBnZXREZWNsYXJlZFZhcmlhYmxlcyhub2RlKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fZGVjbGFyZWRWYXJpYWJsZXMuZ2V0KG5vZGUpIHx8IFtdO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIGFjcXVpcmUgc2NvcGUgZnJvbSBub2RlLlxuICAgICAqIEBtZXRob2QgU2NvcGVNYW5hZ2VyI2FjcXVpcmVcbiAgICAgKiBAcGFyYW0ge0VzcHJpbWEuTm9kZX0gbm9kZSAtIG5vZGUgZm9yIHRoZSBhY3F1aXJlZCBzY29wZS5cbiAgICAgKiBAcGFyYW0ge2Jvb2xlYW49fSBpbm5lciAtIGxvb2sgdXAgdGhlIG1vc3QgaW5uZXIgc2NvcGUsIGRlZmF1bHQgdmFsdWUgaXMgZmFsc2UuXG4gICAgICogQHJldHVybiB7U2NvcGU/fVxuICAgICAqL1xuICAgIGFjcXVpcmUobm9kZSwgaW5uZXIpIHtcbiAgICAgICAgdmFyIHNjb3Blcywgc2NvcGUsIGksIGl6O1xuXG4gICAgICAgIGZ1bmN0aW9uIHByZWRpY2F0ZShzY29wZSkge1xuICAgICAgICAgICAgaWYgKHNjb3BlLnR5cGUgPT09ICdmdW5jdGlvbicgJiYgc2NvcGUuZnVuY3Rpb25FeHByZXNzaW9uU2NvcGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoc2NvcGUudHlwZSA9PT0gJ1REWicpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHNjb3BlcyA9IHRoaXMuX19nZXQobm9kZSk7XG4gICAgICAgIGlmICghc2NvcGVzIHx8IHNjb3Blcy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gSGV1cmlzdGljIHNlbGVjdGlvbiBmcm9tIGFsbCBzY29wZXMuXG4gICAgICAgIC8vIElmIHlvdSB3b3VsZCBsaWtlIHRvIGdldCBhbGwgc2NvcGVzLCBwbGVhc2UgdXNlIFNjb3BlTWFuYWdlciNhY3F1aXJlQWxsLlxuICAgICAgICBpZiAoc2NvcGVzLmxlbmd0aCA9PT0gMSkge1xuICAgICAgICAgICAgcmV0dXJuIHNjb3Blc1swXTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChpbm5lcikge1xuICAgICAgICAgICAgZm9yIChpID0gc2NvcGVzLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgICAgICAgICAgc2NvcGUgPSBzY29wZXNbaV07XG4gICAgICAgICAgICAgICAgaWYgKHByZWRpY2F0ZShzY29wZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNjb3BlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGZvciAoaSA9IDAsIGl6ID0gc2NvcGVzLmxlbmd0aDsgaSA8IGl6OyArK2kpIHtcbiAgICAgICAgICAgICAgICBzY29wZSA9IHNjb3Blc1tpXTtcbiAgICAgICAgICAgICAgICBpZiAocHJlZGljYXRlKHNjb3BlKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2NvcGU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogYWNxdWlyZSBhbGwgc2NvcGVzIGZyb20gbm9kZS5cbiAgICAgKiBAbWV0aG9kIFNjb3BlTWFuYWdlciNhY3F1aXJlQWxsXG4gICAgICogQHBhcmFtIHtFc3ByaW1hLk5vZGV9IG5vZGUgLSBub2RlIGZvciB0aGUgYWNxdWlyZWQgc2NvcGUuXG4gICAgICogQHJldHVybiB7U2NvcGVbXT99XG4gICAgICovXG4gICAgYWNxdWlyZUFsbChub2RlKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fZ2V0KG5vZGUpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIHJlbGVhc2UgdGhlIG5vZGUuXG4gICAgICogQG1ldGhvZCBTY29wZU1hbmFnZXIjcmVsZWFzZVxuICAgICAqIEBwYXJhbSB7RXNwcmltYS5Ob2RlfSBub2RlIC0gcmVsZWFzaW5nIG5vZGUuXG4gICAgICogQHBhcmFtIHtib29sZWFuPX0gaW5uZXIgLSBsb29rIHVwIHRoZSBtb3N0IGlubmVyIHNjb3BlLCBkZWZhdWx0IHZhbHVlIGlzIGZhbHNlLlxuICAgICAqIEByZXR1cm4ge1Njb3BlP30gdXBwZXIgc2NvcGUgZm9yIHRoZSBub2RlLlxuICAgICAqL1xuICAgIHJlbGVhc2Uobm9kZSwgaW5uZXIpIHtcbiAgICAgICAgdmFyIHNjb3Blcywgc2NvcGU7XG4gICAgICAgIHNjb3BlcyA9IHRoaXMuX19nZXQobm9kZSk7XG4gICAgICAgIGlmIChzY29wZXMgJiYgc2NvcGVzLmxlbmd0aCkge1xuICAgICAgICAgICAgc2NvcGUgPSBzY29wZXNbMF0udXBwZXI7XG4gICAgICAgICAgICBpZiAoIXNjb3BlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5hY3F1aXJlKHNjb3BlLmJsb2NrLCBpbm5lcik7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgfVxuXG4gICAgYXR0YWNoKCkgeyB9XG5cbiAgICBkZXRhY2goKSB7IH1cblxuICAgIF9fbmVzdFNjb3BlKHNjb3BlKSB7XG4gICAgICAgIGlmIChzY29wZSBpbnN0YW5jZW9mIEdsb2JhbFNjb3BlKSB7XG4gICAgICAgICAgICBhc3NlcnQodGhpcy5fX2N1cnJlbnRTY29wZSA9PT0gbnVsbCk7XG4gICAgICAgICAgICB0aGlzLmdsb2JhbFNjb3BlID0gc2NvcGU7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5fX2N1cnJlbnRTY29wZSA9IHNjb3BlO1xuICAgICAgICByZXR1cm4gc2NvcGU7XG4gICAgfVxuXG4gICAgX19uZXN0R2xvYmFsU2NvcGUobm9kZSkge1xuICAgICAgICByZXR1cm4gdGhpcy5fX25lc3RTY29wZShuZXcgR2xvYmFsU2NvcGUodGhpcywgbm9kZSkpO1xuICAgIH1cblxuICAgIF9fbmVzdEJsb2NrU2NvcGUobm9kZSwgaXNNZXRob2REZWZpbml0aW9uKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fbmVzdFNjb3BlKG5ldyBCbG9ja1Njb3BlKHRoaXMsIHRoaXMuX19jdXJyZW50U2NvcGUsIG5vZGUpKTtcbiAgICB9XG5cbiAgICBfX25lc3RGdW5jdGlvblNjb3BlKG5vZGUsIGlzTWV0aG9kRGVmaW5pdGlvbikge1xuICAgICAgICByZXR1cm4gdGhpcy5fX25lc3RTY29wZShuZXcgRnVuY3Rpb25TY29wZSh0aGlzLCB0aGlzLl9fY3VycmVudFNjb3BlLCBub2RlLCBpc01ldGhvZERlZmluaXRpb24pKTtcbiAgICB9XG5cbiAgICBfX25lc3RGb3JTY29wZShub2RlKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fbmVzdFNjb3BlKG5ldyBGb3JTY29wZSh0aGlzLCB0aGlzLl9fY3VycmVudFNjb3BlLCBub2RlKSk7XG4gICAgfVxuXG4gICAgX19uZXN0Q2F0Y2hTY29wZShub2RlKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fbmVzdFNjb3BlKG5ldyBDYXRjaFNjb3BlKHRoaXMsIHRoaXMuX19jdXJyZW50U2NvcGUsIG5vZGUpKTtcbiAgICB9XG5cbiAgICBfX25lc3RXaXRoU2NvcGUobm9kZSkge1xuICAgICAgICByZXR1cm4gdGhpcy5fX25lc3RTY29wZShuZXcgV2l0aFNjb3BlKHRoaXMsIHRoaXMuX19jdXJyZW50U2NvcGUsIG5vZGUpKTtcbiAgICB9XG5cbiAgICBfX25lc3RDbGFzc1Njb3BlKG5vZGUpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX19uZXN0U2NvcGUobmV3IENsYXNzU2NvcGUodGhpcywgdGhpcy5fX2N1cnJlbnRTY29wZSwgbm9kZSkpO1xuICAgIH1cblxuICAgIF9fbmVzdFN3aXRjaFNjb3BlKG5vZGUpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX19uZXN0U2NvcGUobmV3IFN3aXRjaFNjb3BlKHRoaXMsIHRoaXMuX19jdXJyZW50U2NvcGUsIG5vZGUpKTtcbiAgICB9XG5cbiAgICBfX25lc3RNb2R1bGVTY29wZShub2RlKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fbmVzdFNjb3BlKG5ldyBNb2R1bGVTY29wZSh0aGlzLCB0aGlzLl9fY3VycmVudFNjb3BlLCBub2RlKSk7XG4gICAgfVxuXG4gICAgX19uZXN0VERaU2NvcGUobm9kZSkge1xuICAgICAgICByZXR1cm4gdGhpcy5fX25lc3RTY29wZShuZXcgVERaU2NvcGUodGhpcywgdGhpcy5fX2N1cnJlbnRTY29wZSwgbm9kZSkpO1xuICAgIH1cblxuICAgIF9fbmVzdEZ1bmN0aW9uRXhwcmVzc2lvbk5hbWVTY29wZShub2RlKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fbmVzdFNjb3BlKG5ldyBGdW5jdGlvbkV4cHJlc3Npb25OYW1lU2NvcGUodGhpcywgdGhpcy5fX2N1cnJlbnRTY29wZSwgbm9kZSkpO1xuICAgIH1cblxuICAgIF9faXNFUzYoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fb3B0aW9ucy5lY21hVmVyc2lvbiA+PSA2O1xuICAgIH1cbn1cblxuLyogdmltOiBzZXQgc3c9NCB0cz00IGV0IHR3PTgwIDogKi9cbiJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
      diff --git a/tools/eslint/node_modules/escope/lib/scope.js b/tools/eslint/node_modules/escope/lib/scope.js
      index ec1547b91fe8bb..eb150cb494b24c 100644
      --- a/tools/eslint/node_modules/escope/lib/scope.js
      +++ b/tools/eslint/node_modules/escope/lib/scope.js
      @@ -1,53 +1,65 @@
      -"use strict";
      +'use strict';
       
      -var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
      +Object.defineProperty(exports, "__esModule", {
      +    value: true
      +});
      +exports.ClassScope = exports.ForScope = exports.FunctionScope = exports.SwitchScope = exports.BlockScope = exports.TDZScope = exports.WithScope = exports.CatchScope = exports.FunctionExpressionNameScope = exports.ModuleScope = exports.GlobalScope = undefined;
       
      -var _get = function get(object, property, receiver) { var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc && desc.writable) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
      +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
       
      -var _inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) subClass.__proto__ = superClass; };
      +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /*
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       Copyright (C) 2015 Yusuke Suzuki 
       
      -var _createClass = (function () { function defineProperties(target, props) { for (var key in props) { var prop = props[key]; prop.configurable = true; if (prop.value) prop.writable = true; } Object.defineProperties(target, props); } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       Redistribution and use in source and binary forms, with or without
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       modification, are permitted provided that the following conditions are met:
       
      -var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         * Redistributions of source code must retain the above copyright
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           notice, this list of conditions and the following disclaimer.
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         * Redistributions in binary form must reproduce the above copyright
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           notice, this list of conditions and the following disclaimer in the
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           documentation and/or other materials provided with the distribution.
       
      -Object.defineProperty(exports, "__esModule", {
      -    value: true
      -});
      -/*
      -  Copyright (C) 2015 Yusuke Suzuki 
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ARE DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     */
      +
      +var _estraverse = require('estraverse');
      +
      +var _es6Map = require('es6-map');
      +
      +var _es6Map2 = _interopRequireDefault(_es6Map);
      +
      +var _reference = require('./reference');
       
      -  Redistribution and use in source and binary forms, with or without
      -  modification, are permitted provided that the following conditions are met:
      +var _reference2 = _interopRequireDefault(_reference);
       
      -    * Redistributions of source code must retain the above copyright
      -      notice, this list of conditions and the following disclaimer.
      -    * Redistributions in binary form must reproduce the above copyright
      -      notice, this list of conditions and the following disclaimer in the
      -      documentation and/or other materials provided with the distribution.
      +var _variable = require('./variable');
       
      -  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
      -  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      -  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      -  ARE DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
      -  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
      -  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
      -  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      -  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      -  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
      -  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      -*/
      +var _variable2 = _interopRequireDefault(_variable);
       
      -var Syntax = require("estraverse").Syntax;
      +var _definition = require('./definition');
       
      -var Map = _interopRequire(require("es6-map"));
      +var _definition2 = _interopRequireDefault(_definition);
       
      -var Reference = _interopRequire(require("./reference"));
      +var _assert = require('assert');
       
      -var Variable = _interopRequire(require("./variable"));
      +var _assert2 = _interopRequireDefault(_assert);
       
      -var Definition = _interopRequire(require("./definition"));
      +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
       
      -var assert = _interopRequire(require("assert"));
      +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
      +
      +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
      +
      +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
       
       function isStrictScope(scope, block, isMethodDefinition, useDirective) {
           var body, i, iz, stmt, expr;
      @@ -58,7 +70,7 @@ function isStrictScope(scope, block, isMethodDefinition, useDirective) {
           }
       
           // ArrowFunctionExpression's scope is always strict scope.
      -    if (block.type === Syntax.ArrowFunctionExpression) {
      +    if (block.type === _estraverse.Syntax.ArrowFunctionExpression) {
               return true;
           }
       
      @@ -66,21 +78,21 @@ function isStrictScope(scope, block, isMethodDefinition, useDirective) {
               return true;
           }
       
      -    if (scope.type === "class" || scope.type === "module") {
      +    if (scope.type === 'class' || scope.type === 'module') {
               return true;
           }
       
      -    if (scope.type === "block" || scope.type === "switch") {
      +    if (scope.type === 'block' || scope.type === 'switch') {
               return false;
           }
       
      -    if (scope.type === "function") {
      -        if (block.type === "Program") {
      +    if (scope.type === 'function') {
      +        if (block.type === _estraverse.Syntax.Program) {
                   body = block;
               } else {
                   body = block.body;
               }
      -    } else if (scope.type === "global") {
      +    } else if (scope.type === 'global') {
               body = block;
           } else {
               return false;
      @@ -90,29 +102,29 @@ function isStrictScope(scope, block, isMethodDefinition, useDirective) {
           if (useDirective) {
               for (i = 0, iz = body.body.length; i < iz; ++i) {
                   stmt = body.body[i];
      -            if (stmt.type !== "DirectiveStatement") {
      +            if (stmt.type !== _estraverse.Syntax.DirectiveStatement) {
                       break;
                   }
      -            if (stmt.raw === "\"use strict\"" || stmt.raw === "'use strict'") {
      +            if (stmt.raw === '"use strict"' || stmt.raw === '\'use strict\'') {
                       return true;
                   }
               }
           } else {
               for (i = 0, iz = body.body.length; i < iz; ++i) {
                   stmt = body.body[i];
      -            if (stmt.type !== Syntax.ExpressionStatement) {
      +            if (stmt.type !== _estraverse.Syntax.ExpressionStatement) {
                       break;
                   }
                   expr = stmt.expression;
      -            if (expr.type !== Syntax.Literal || typeof expr.value !== "string") {
      +            if (expr.type !== _estraverse.Syntax.Literal || typeof expr.value !== 'string') {
                       break;
                   }
                   if (expr.raw != null) {
      -                if (expr.raw === "\"use strict\"" || expr.raw === "'use strict'") {
      +                if (expr.raw === '"use strict"' || expr.raw === '\'use strict\'') {
                           return true;
                       }
                   } else {
      -                if (expr.value === "use strict") {
      +                if (expr.value === 'use strict') {
                           return true;
                       }
                   }
      @@ -135,14 +147,14 @@ function registerScope(scopeManager, scope) {
       }
       
       function shouldBeStatically(def) {
      -    return def.type === Variable.ClassName || def.type === Variable.Variable && def.parent.kind !== "var";
      +    return def.type === _variable2.default.ClassName || def.type === _variable2.default.Variable && def.parent.kind !== 'var';
       }
       
       /**
        * @class Scope
        */
       
      -var Scope = (function () {
      +var Scope = function () {
           function Scope(scopeManager, type, upperScope, block, isMethodDefinition) {
               _classCallCheck(this, Scope);
       
      @@ -156,23 +168,23 @@ var Scope = (function () {
               * : Variable }.
               * @member {Map} Scope#set
               */
      -        this.set = new Map();
      +        this.set = new _es6Map2.default();
               /**
                * The tainted variables of this scope, as { Variable.name :
                * boolean }.
                * @member {Map} Scope#taints */
      -        this.taints = new Map();
      +        this.taints = new _es6Map2.default();
               /**
                * Generally, through the lexical scoping of JS you can always know
                * which variable an identifier in the source code refers to. There are
                * a few exceptions to this rule. With 'global' and 'with' scopes you
                * can only decide at runtime which variable a reference refers to.
                * Moreover, if 'eval()' is used in a scope, it might introduce new
      -         * bindings in this or its prarent scopes.
      +         * bindings in this or its parent scopes.
                * All those scopes are considered 'dynamic'.
                * @member {boolean} Scope#dynamic
                */
      -        this.dynamic = this.type === "global" || this.type === "with";
      +        this.dynamic = this.type === 'global' || this.type === 'with';
               /**
                * A reference to the scope-defining syntax node.
                * @member {esprima.Node} Scope#block
      @@ -207,7 +219,7 @@ var Scope = (function () {
               * parent scope.
               * @member {Scope} Scope#variableScope
               */
      -        this.variableScope = this.type === "global" || this.type === "function" || this.type === "module" ? this : upperScope.variableScope;
      +        this.variableScope = this.type === 'global' || this.type === 'function' || this.type === 'module' ? this : upperScope.variableScope;
               /**
               * Whether this scope is created by a FunctionExpression.
               * @member {boolean} Scope#functionExpressionScope
      @@ -245,252 +257,276 @@ var Scope = (function () {
                   this.upper.childScopes.push(this);
               }
       
      +        this.__declaredVariables = scopeManager.__declaredVariables;
      +
               registerScope(scopeManager, this);
           }
       
      -    _createClass(Scope, {
      -        __shouldStaticallyClose: {
      -            value: function __shouldStaticallyClose(scopeManager) {
      -                return !this.dynamic || scopeManager.__isOptimistic();
      -            }
      -        },
      -        __shouldStaticallyCloseForGlobal: {
      -            value: function __shouldStaticallyCloseForGlobal(ref) {
      -                // On global scope, let/const/class declarations should be resolved statically.
      -                var name = ref.identifier.name;
      -                if (!this.set.has(name)) {
      -                    return false;
      -                }
      +    _createClass(Scope, [{
      +        key: '__shouldStaticallyClose',
      +        value: function __shouldStaticallyClose(scopeManager) {
      +            return !this.dynamic || scopeManager.__isOptimistic();
      +        }
      +    }, {
      +        key: '__shouldStaticallyCloseForGlobal',
      +        value: function __shouldStaticallyCloseForGlobal(ref) {
      +            // On global scope, let/const/class declarations should be resolved statically.
      +            var name = ref.identifier.name;
      +            if (!this.set.has(name)) {
      +                return false;
      +            }
       
      -                var variable = this.set.get(name);
      -                var defs = variable.defs;
      -                return defs.length > 0 && defs.every(shouldBeStatically);
      +            var variable = this.set.get(name);
      +            var defs = variable.defs;
      +            return defs.length > 0 && defs.every(shouldBeStatically);
      +        }
      +    }, {
      +        key: '__staticCloseRef',
      +        value: function __staticCloseRef(ref) {
      +            if (!this.__resolve(ref)) {
      +                this.__delegateToUpperScope(ref);
                   }
      -        },
      -        __staticCloseRef: {
      -            value: function __staticCloseRef(ref) {
      -                if (!this.__resolve(ref)) {
      -                    this.__delegateToUpperScope(ref);
      -                }
      +        }
      +    }, {
      +        key: '__dynamicCloseRef',
      +        value: function __dynamicCloseRef(ref) {
      +            // notify all names are through to global
      +            var current = this;
      +            do {
      +                current.through.push(ref);
      +                current = current.upper;
      +            } while (current);
      +        }
      +    }, {
      +        key: '__globalCloseRef',
      +        value: function __globalCloseRef(ref) {
      +            // let/const/class declarations should be resolved statically.
      +            // others should be resolved dynamically.
      +            if (this.__shouldStaticallyCloseForGlobal(ref)) {
      +                this.__staticCloseRef(ref);
      +            } else {
      +                this.__dynamicCloseRef(ref);
                   }
      -        },
      -        __dynamicCloseRef: {
      -            value: function __dynamicCloseRef(ref) {
      -                // notify all names are through to global
      -                var current = this;
      -                do {
      -                    current.through.push(ref);
      -                    current = current.upper;
      -                } while (current);
      -            }
      -        },
      -        __globalCloseRef: {
      -            value: function __globalCloseRef(ref) {
      -                // let/const/class declarations should be resolved statically.
      -                // others should be resolved dynamically.
      -                if (this.__shouldStaticallyCloseForGlobal(ref)) {
      -                    this.__staticCloseRef(ref);
      -                } else {
      -                    this.__dynamicCloseRef(ref);
      -                }
      +        }
      +    }, {
      +        key: '__close',
      +        value: function __close(scopeManager) {
      +            var closeRef;
      +            if (this.__shouldStaticallyClose(scopeManager)) {
      +                closeRef = this.__staticCloseRef;
      +            } else if (this.type !== 'global') {
      +                closeRef = this.__dynamicCloseRef;
      +            } else {
      +                closeRef = this.__globalCloseRef;
                   }
      -        },
      -        __close: {
      -            value: function __close(scopeManager) {
      -                var closeRef;
      -                if (this.__shouldStaticallyClose(scopeManager)) {
      -                    closeRef = this.__staticCloseRef;
      -                } else if (this.type !== "global") {
      -                    closeRef = this.__dynamicCloseRef;
      -                } else {
      -                    closeRef = this.__globalCloseRef;
      -                }
       
      -                // Try Resolving all references in this scope.
      -                for (var i = 0, iz = this.__left.length; i < iz; ++i) {
      -                    var ref = this.__left[i];
      -                    closeRef.call(this, ref);
      -                }
      -                this.__left = null;
      -
      -                return this.upper;
      -            }
      -        },
      -        __resolve: {
      -            value: function __resolve(ref) {
      -                var variable, name;
      -                name = ref.identifier.name;
      -                if (this.set.has(name)) {
      -                    variable = this.set.get(name);
      -                    variable.references.push(ref);
      -                    variable.stack = variable.stack && ref.from.variableScope === this.variableScope;
      -                    if (ref.tainted) {
      -                        variable.tainted = true;
      -                        this.taints.set(variable.name, true);
      -                    }
      -                    ref.resolved = variable;
      -                    return true;
      -                }
      -                return false;
      +            // Try Resolving all references in this scope.
      +            for (var i = 0, iz = this.__left.length; i < iz; ++i) {
      +                var ref = this.__left[i];
      +                closeRef.call(this, ref);
                   }
      -        },
      -        __delegateToUpperScope: {
      -            value: function __delegateToUpperScope(ref) {
      -                if (this.upper) {
      -                    this.upper.__left.push(ref);
      -                }
      -                this.through.push(ref);
      -            }
      -        },
      -        __defineGeneric: {
      -            value: function __defineGeneric(name, set, variables, node, def) {
      -                var variable;
      -
      -                variable = set.get(name);
      -                if (!variable) {
      -                    variable = new Variable(name, this);
      -                    set.set(name, variable);
      -                    variables.push(variable);
      -                }
      +            this.__left = null;
       
      -                if (def) {
      -                    variable.defs.push(def);
      -                }
      -                if (node) {
      -                    variable.identifiers.push(node);
      +            return this.upper;
      +        }
      +    }, {
      +        key: '__resolve',
      +        value: function __resolve(ref) {
      +            var variable, name;
      +            name = ref.identifier.name;
      +            if (this.set.has(name)) {
      +                variable = this.set.get(name);
      +                variable.references.push(ref);
      +                variable.stack = variable.stack && ref.from.variableScope === this.variableScope;
      +                if (ref.tainted) {
      +                    variable.tainted = true;
      +                    this.taints.set(variable.name, true);
                       }
      +                ref.resolved = variable;
      +                return true;
                   }
      -        },
      -        __define: {
      -            value: function __define(node, def) {
      -                if (node && node.type === Syntax.Identifier) {
      -                    this.__defineGeneric(node.name, this.set, this.variables, node, def);
      -                }
      +            return false;
      +        }
      +    }, {
      +        key: '__delegateToUpperScope',
      +        value: function __delegateToUpperScope(ref) {
      +            if (this.upper) {
      +                this.upper.__left.push(ref);
      +            }
      +            this.through.push(ref);
      +        }
      +    }, {
      +        key: '__addDeclaredVariablesOfNode',
      +        value: function __addDeclaredVariablesOfNode(variable, node) {
      +            if (node == null) {
      +                return;
      +            }
      +
      +            var variables = this.__declaredVariables.get(node);
      +            if (variables == null) {
      +                variables = [];
      +                this.__declaredVariables.set(node, variables);
      +            }
      +            if (variables.indexOf(variable) === -1) {
      +                variables.push(variable);
      +            }
      +        }
      +    }, {
      +        key: '__defineGeneric',
      +        value: function __defineGeneric(name, set, variables, node, def) {
      +            var variable;
      +
      +            variable = set.get(name);
      +            if (!variable) {
      +                variable = new _variable2.default(name, this);
      +                set.set(name, variable);
      +                variables.push(variable);
                   }
      -        },
      -        __referencing: {
      -            value: function __referencing(node, assign, writeExpr, maybeImplicitGlobal, partial, init) {
      -                // because Array element may be null
      -                if (!node || node.type !== Syntax.Identifier) {
      -                    return;
      -                }
       
      -                // Specially handle like `this`.
      -                if (node.name === "super") {
      -                    return;
      +            if (def) {
      +                variable.defs.push(def);
      +                if (def.type !== _variable2.default.TDZ) {
      +                    this.__addDeclaredVariablesOfNode(variable, def.node);
      +                    this.__addDeclaredVariablesOfNode(variable, def.parent);
                       }
      +            }
      +            if (node) {
      +                variable.identifiers.push(node);
      +            }
      +        }
      +    }, {
      +        key: '__define',
      +        value: function __define(node, def) {
      +            if (node && node.type === _estraverse.Syntax.Identifier) {
      +                this.__defineGeneric(node.name, this.set, this.variables, node, def);
      +            }
      +        }
      +    }, {
      +        key: '__referencing',
      +        value: function __referencing(node, assign, writeExpr, maybeImplicitGlobal, partial, init) {
      +            // because Array element may be null
      +            if (!node || node.type !== _estraverse.Syntax.Identifier) {
      +                return;
      +            }
       
      -                var ref = new Reference(node, this, assign || Reference.READ, writeExpr, maybeImplicitGlobal, !!partial, !!init);
      -                this.references.push(ref);
      -                this.__left.push(ref);
      -            }
      -        },
      -        __detectEval: {
      -            value: function __detectEval() {
      -                var current;
      -                current = this;
      -                this.directCallToEvalScope = true;
      -                do {
      -                    current.dynamic = true;
      -                    current = current.upper;
      -                } while (current);
      -            }
      -        },
      -        __detectThis: {
      -            value: function __detectThis() {
      -                this.thisFound = true;
      -            }
      -        },
      -        __isClosed: {
      -            value: function __isClosed() {
      -                return this.__left === null;
      -            }
      -        },
      -        resolve: {
      +            // Specially handle like `this`.
      +            if (node.name === 'super') {
      +                return;
      +            }
       
      -            /**
      -             * returns resolved {Reference}
      -             * @method Scope#resolve
      -             * @param {Esprima.Identifier} ident - identifier to be resolved.
      -             * @return {Reference}
      -             */
      -
      -            value: function resolve(ident) {
      -                var ref, i, iz;
      -                assert(this.__isClosed(), "Scope should be closed.");
      -                assert(ident.type === Syntax.Identifier, "Target should be identifier.");
      -                for (i = 0, iz = this.references.length; i < iz; ++i) {
      -                    ref = this.references[i];
      -                    if (ref.identifier === ident) {
      -                        return ref;
      -                    }
      +            var ref = new _reference2.default(node, this, assign || _reference2.default.READ, writeExpr, maybeImplicitGlobal, !!partial, !!init);
      +            this.references.push(ref);
      +            this.__left.push(ref);
      +        }
      +    }, {
      +        key: '__detectEval',
      +        value: function __detectEval() {
      +            var current;
      +            current = this;
      +            this.directCallToEvalScope = true;
      +            do {
      +                current.dynamic = true;
      +                current = current.upper;
      +            } while (current);
      +        }
      +    }, {
      +        key: '__detectThis',
      +        value: function __detectThis() {
      +            this.thisFound = true;
      +        }
      +    }, {
      +        key: '__isClosed',
      +        value: function __isClosed() {
      +            return this.__left === null;
      +        }
      +
      +        /**
      +         * returns resolved {Reference}
      +         * @method Scope#resolve
      +         * @param {Esprima.Identifier} ident - identifier to be resolved.
      +         * @return {Reference}
      +         */
      +
      +    }, {
      +        key: 'resolve',
      +        value: function resolve(ident) {
      +            var ref, i, iz;
      +            (0, _assert2.default)(this.__isClosed(), 'Scope should be closed.');
      +            (0, _assert2.default)(ident.type === _estraverse.Syntax.Identifier, 'Target should be identifier.');
      +            for (i = 0, iz = this.references.length; i < iz; ++i) {
      +                ref = this.references[i];
      +                if (ref.identifier === ident) {
      +                    return ref;
                       }
      -                return null;
                   }
      -        },
      -        isStatic: {
      +            return null;
      +        }
       
      -            /**
      -             * returns this scope is static
      -             * @method Scope#isStatic
      -             * @return {boolean}
      -             */
      +        /**
      +         * returns this scope is static
      +         * @method Scope#isStatic
      +         * @return {boolean}
      +         */
       
      -            value: function isStatic() {
      -                return !this.dynamic;
      -            }
      -        },
      -        isArgumentsMaterialized: {
      +    }, {
      +        key: 'isStatic',
      +        value: function isStatic() {
      +            return !this.dynamic;
      +        }
       
      -            /**
      -             * returns this scope has materialized arguments
      -             * @method Scope#isArgumentsMaterialized
      -             * @return {boolean}
      -             */
      +        /**
      +         * returns this scope has materialized arguments
      +         * @method Scope#isArgumentsMaterialized
      +         * @return {boolean}
      +         */
       
      -            value: function isArgumentsMaterialized() {
      -                return true;
      -            }
      -        },
      -        isThisMaterialized: {
      +    }, {
      +        key: 'isArgumentsMaterialized',
      +        value: function isArgumentsMaterialized() {
      +            return true;
      +        }
       
      -            /**
      -             * returns this scope has materialized `this` reference
      -             * @method Scope#isThisMaterialized
      -             * @return {boolean}
      -             */
      +        /**
      +         * returns this scope has materialized `this` reference
      +         * @method Scope#isThisMaterialized
      +         * @return {boolean}
      +         */
       
      -            value: function isThisMaterialized() {
      +    }, {
      +        key: 'isThisMaterialized',
      +        value: function isThisMaterialized() {
      +            return true;
      +        }
      +    }, {
      +        key: 'isUsedName',
      +        value: function isUsedName(name) {
      +            if (this.set.has(name)) {
                       return true;
                   }
      -        },
      -        isUsedName: {
      -            value: function isUsedName(name) {
      -                if (this.set.has(name)) {
      +            for (var i = 0, iz = this.through.length; i < iz; ++i) {
      +                if (this.through[i].identifier.name === name) {
                           return true;
                       }
      -                for (var i = 0, iz = this.through.length; i < iz; ++i) {
      -                    if (this.through[i].identifier.name === name) {
      -                        return true;
      -                    }
      -                }
      -                return false;
                   }
      +            return false;
               }
      -    });
      +    }]);
       
           return Scope;
      -})();
      +}();
       
      -exports["default"] = Scope;
      +exports.default = Scope;
      +
      +var GlobalScope = exports.GlobalScope = function (_Scope) {
      +    _inherits(GlobalScope, _Scope);
       
      -var GlobalScope = exports.GlobalScope = (function (_Scope) {
           function GlobalScope(scopeManager, block) {
               _classCallCheck(this, GlobalScope);
       
      -        _get(Object.getPrototypeOf(GlobalScope.prototype), "constructor", this).call(this, scopeManager, "global", null, block, false);
      -        this.implicit = {
      -            set: new Map(),
      +        var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(GlobalScope).call(this, scopeManager, 'global', null, block, false));
      +
      +        _this.implicit = {
      +            set: new _es6Map2.default(),
                   variables: [],
                   /**
                   * List of {@link Reference}s that are left to be resolved (i.e. which
      @@ -499,230 +535,230 @@ var GlobalScope = exports.GlobalScope = (function (_Scope) {
                   */
                   left: []
               };
      +        return _this;
           }
       
      -    _inherits(GlobalScope, _Scope);
      -
      -    _createClass(GlobalScope, {
      -        __close: {
      -            value: function __close(scopeManager) {
      -                var implicit = [];
      -                for (var i = 0, iz = this.__left.length; i < iz; ++i) {
      -                    var ref = this.__left[i];
      -                    if (ref.__maybeImplicitGlobal && !this.set.has(ref.identifier.name)) {
      -                        implicit.push(ref.__maybeImplicitGlobal);
      -                    }
      +    _createClass(GlobalScope, [{
      +        key: '__close',
      +        value: function __close(scopeManager) {
      +            var implicit = [];
      +            for (var i = 0, iz = this.__left.length; i < iz; ++i) {
      +                var ref = this.__left[i];
      +                if (ref.__maybeImplicitGlobal && !this.set.has(ref.identifier.name)) {
      +                    implicit.push(ref.__maybeImplicitGlobal);
                       }
      +            }
       
      -                // create an implicit global variable from assignment expression
      -                for (var i = 0, iz = implicit.length; i < iz; ++i) {
      -                    var info = implicit[i];
      -                    this.__defineImplicit(info.pattern, new Definition(Variable.ImplicitGlobalVariable, info.pattern, info.node, null, null, null));
      -                }
      +            // create an implicit global variable from assignment expression
      +            for (var _i = 0, _iz = implicit.length; _i < _iz; ++_i) {
      +                var info = implicit[_i];
      +                this.__defineImplicit(info.pattern, new _definition2.default(_variable2.default.ImplicitGlobalVariable, info.pattern, info.node, null, null, null));
      +            }
       
      -                this.implicit.left = this.__left;
      +            this.implicit.left = this.__left;
       
      -                return _get(Object.getPrototypeOf(GlobalScope.prototype), "__close", this).call(this, scopeManager);
      -            }
      -        },
      -        __defineImplicit: {
      -            value: function __defineImplicit(node, def) {
      -                if (node && node.type === Syntax.Identifier) {
      -                    this.__defineGeneric(node.name, this.implicit.set, this.implicit.variables, node, def);
      -                }
      +            return _get(Object.getPrototypeOf(GlobalScope.prototype), '__close', this).call(this, scopeManager);
      +        }
      +    }, {
      +        key: '__defineImplicit',
      +        value: function __defineImplicit(node, def) {
      +            if (node && node.type === _estraverse.Syntax.Identifier) {
      +                this.__defineGeneric(node.name, this.implicit.set, this.implicit.variables, node, def);
                   }
               }
      -    });
      +    }]);
       
           return GlobalScope;
      -})(Scope);
      +}(Scope);
      +
      +var ModuleScope = exports.ModuleScope = function (_Scope2) {
      +    _inherits(ModuleScope, _Scope2);
       
      -var ModuleScope = exports.ModuleScope = (function (_Scope2) {
           function ModuleScope(scopeManager, upperScope, block) {
               _classCallCheck(this, ModuleScope);
       
      -        _get(Object.getPrototypeOf(ModuleScope.prototype), "constructor", this).call(this, scopeManager, "module", upperScope, block, false);
      +        return _possibleConstructorReturn(this, Object.getPrototypeOf(ModuleScope).call(this, scopeManager, 'module', upperScope, block, false));
           }
       
      -    _inherits(ModuleScope, _Scope2);
      -
           return ModuleScope;
      -})(Scope);
      +}(Scope);
      +
      +var FunctionExpressionNameScope = exports.FunctionExpressionNameScope = function (_Scope3) {
      +    _inherits(FunctionExpressionNameScope, _Scope3);
       
      -var FunctionExpressionNameScope = exports.FunctionExpressionNameScope = (function (_Scope3) {
           function FunctionExpressionNameScope(scopeManager, upperScope, block) {
               _classCallCheck(this, FunctionExpressionNameScope);
       
      -        _get(Object.getPrototypeOf(FunctionExpressionNameScope.prototype), "constructor", this).call(this, scopeManager, "function-expression-name", upperScope, block, false);
      -        this.__define(block.id, new Definition(Variable.FunctionName, block.id, block, null, null, null));
      -        this.functionExpressionScope = true;
      -    }
      +        var _this3 = _possibleConstructorReturn(this, Object.getPrototypeOf(FunctionExpressionNameScope).call(this, scopeManager, 'function-expression-name', upperScope, block, false));
       
      -    _inherits(FunctionExpressionNameScope, _Scope3);
      +        _this3.__define(block.id, new _definition2.default(_variable2.default.FunctionName, block.id, block, null, null, null));
      +        _this3.functionExpressionScope = true;
      +        return _this3;
      +    }
       
           return FunctionExpressionNameScope;
      -})(Scope);
      +}(Scope);
      +
      +var CatchScope = exports.CatchScope = function (_Scope4) {
      +    _inherits(CatchScope, _Scope4);
       
      -var CatchScope = exports.CatchScope = (function (_Scope4) {
           function CatchScope(scopeManager, upperScope, block) {
               _classCallCheck(this, CatchScope);
       
      -        _get(Object.getPrototypeOf(CatchScope.prototype), "constructor", this).call(this, scopeManager, "catch", upperScope, block, false);
      +        return _possibleConstructorReturn(this, Object.getPrototypeOf(CatchScope).call(this, scopeManager, 'catch', upperScope, block, false));
           }
       
      -    _inherits(CatchScope, _Scope4);
      -
           return CatchScope;
      -})(Scope);
      +}(Scope);
      +
      +var WithScope = exports.WithScope = function (_Scope5) {
      +    _inherits(WithScope, _Scope5);
       
      -var WithScope = exports.WithScope = (function (_Scope5) {
           function WithScope(scopeManager, upperScope, block) {
               _classCallCheck(this, WithScope);
       
      -        _get(Object.getPrototypeOf(WithScope.prototype), "constructor", this).call(this, scopeManager, "with", upperScope, block, false);
      +        return _possibleConstructorReturn(this, Object.getPrototypeOf(WithScope).call(this, scopeManager, 'with', upperScope, block, false));
           }
       
      -    _inherits(WithScope, _Scope5);
      -
      -    _createClass(WithScope, {
      -        __close: {
      -            value: function __close(scopeManager) {
      -                if (this.__shouldStaticallyClose(scopeManager)) {
      -                    return _get(Object.getPrototypeOf(WithScope.prototype), "__close", this).call(this, scopeManager);
      -                }
      -
      -                for (var i = 0, iz = this.__left.length; i < iz; ++i) {
      -                    var ref = this.__left[i];
      -                    ref.tainted = true;
      -                    this.__delegateToUpperScope(ref);
      -                }
      -                this.__left = null;
      +    _createClass(WithScope, [{
      +        key: '__close',
      +        value: function __close(scopeManager) {
      +            if (this.__shouldStaticallyClose(scopeManager)) {
      +                return _get(Object.getPrototypeOf(WithScope.prototype), '__close', this).call(this, scopeManager);
      +            }
       
      -                return this.upper;
      +            for (var i = 0, iz = this.__left.length; i < iz; ++i) {
      +                var ref = this.__left[i];
      +                ref.tainted = true;
      +                this.__delegateToUpperScope(ref);
                   }
      +            this.__left = null;
      +
      +            return this.upper;
               }
      -    });
      +    }]);
       
           return WithScope;
      -})(Scope);
      +}(Scope);
      +
      +var TDZScope = exports.TDZScope = function (_Scope6) {
      +    _inherits(TDZScope, _Scope6);
       
      -var TDZScope = exports.TDZScope = (function (_Scope6) {
           function TDZScope(scopeManager, upperScope, block) {
               _classCallCheck(this, TDZScope);
       
      -        _get(Object.getPrototypeOf(TDZScope.prototype), "constructor", this).call(this, scopeManager, "TDZ", upperScope, block, false);
      +        return _possibleConstructorReturn(this, Object.getPrototypeOf(TDZScope).call(this, scopeManager, 'TDZ', upperScope, block, false));
           }
       
      -    _inherits(TDZScope, _Scope6);
      -
           return TDZScope;
      -})(Scope);
      +}(Scope);
      +
      +var BlockScope = exports.BlockScope = function (_Scope7) {
      +    _inherits(BlockScope, _Scope7);
       
      -var BlockScope = exports.BlockScope = (function (_Scope7) {
           function BlockScope(scopeManager, upperScope, block) {
               _classCallCheck(this, BlockScope);
       
      -        _get(Object.getPrototypeOf(BlockScope.prototype), "constructor", this).call(this, scopeManager, "block", upperScope, block, false);
      +        return _possibleConstructorReturn(this, Object.getPrototypeOf(BlockScope).call(this, scopeManager, 'block', upperScope, block, false));
           }
       
      -    _inherits(BlockScope, _Scope7);
      -
           return BlockScope;
      -})(Scope);
      +}(Scope);
      +
      +var SwitchScope = exports.SwitchScope = function (_Scope8) {
      +    _inherits(SwitchScope, _Scope8);
       
      -var SwitchScope = exports.SwitchScope = (function (_Scope8) {
           function SwitchScope(scopeManager, upperScope, block) {
               _classCallCheck(this, SwitchScope);
       
      -        _get(Object.getPrototypeOf(SwitchScope.prototype), "constructor", this).call(this, scopeManager, "switch", upperScope, block, false);
      +        return _possibleConstructorReturn(this, Object.getPrototypeOf(SwitchScope).call(this, scopeManager, 'switch', upperScope, block, false));
           }
       
      -    _inherits(SwitchScope, _Scope8);
      -
           return SwitchScope;
      -})(Scope);
      +}(Scope);
      +
      +var FunctionScope = exports.FunctionScope = function (_Scope9) {
      +    _inherits(FunctionScope, _Scope9);
       
      -var FunctionScope = exports.FunctionScope = (function (_Scope9) {
           function FunctionScope(scopeManager, upperScope, block, isMethodDefinition) {
               _classCallCheck(this, FunctionScope);
       
      -        _get(Object.getPrototypeOf(FunctionScope.prototype), "constructor", this).call(this, scopeManager, "function", upperScope, block, isMethodDefinition);
      -
               // section 9.2.13, FunctionDeclarationInstantiation.
               // NOTE Arrow functions never have an arguments objects.
      -        if (this.block.type !== Syntax.ArrowFunctionExpression) {
      -            this.__defineArguments();
      -        }
      -    }
       
      -    _inherits(FunctionScope, _Scope9);
      +        var _this9 = _possibleConstructorReturn(this, Object.getPrototypeOf(FunctionScope).call(this, scopeManager, 'function', upperScope, block, isMethodDefinition));
       
      -    _createClass(FunctionScope, {
      -        isArgumentsMaterialized: {
      -            value: function isArgumentsMaterialized() {
      -                // TODO(Constellation)
      -                // We can more aggressive on this condition like this.
      -                //
      -                // function t() {
      -                //     // arguments of t is always hidden.
      -                //     function arguments() {
      -                //     }
      -                // }
      -                if (this.block.type === Syntax.ArrowFunctionExpression) {
      -                    return false;
      -                }
      -
      -                if (!this.isStatic()) {
      -                    return true;
      -                }
      +        if (_this9.block.type !== _estraverse.Syntax.ArrowFunctionExpression) {
      +            _this9.__defineArguments();
      +        }
      +        return _this9;
      +    }
       
      -                var variable = this.set.get("arguments");
      -                assert(variable, "Always have arguments variable.");
      -                return variable.tainted || variable.references.length !== 0;
      +    _createClass(FunctionScope, [{
      +        key: 'isArgumentsMaterialized',
      +        value: function isArgumentsMaterialized() {
      +            // TODO(Constellation)
      +            // We can more aggressive on this condition like this.
      +            //
      +            // function t() {
      +            //     // arguments of t is always hidden.
      +            //     function arguments() {
      +            //     }
      +            // }
      +            if (this.block.type === _estraverse.Syntax.ArrowFunctionExpression) {
      +                return false;
                   }
      -        },
      -        isThisMaterialized: {
      -            value: function isThisMaterialized() {
      -                if (!this.isStatic()) {
      -                    return true;
      -                }
      -                return this.thisFound;
      +
      +            if (!this.isStatic()) {
      +                return true;
                   }
      -        },
      -        __defineArguments: {
      -            value: function __defineArguments() {
      -                this.__defineGeneric("arguments", this.set, this.variables, null, null);
      -                this.taints.set("arguments", true);
      +
      +            var variable = this.set.get('arguments');
      +            (0, _assert2.default)(variable, 'Always have arguments variable.');
      +            return variable.tainted || variable.references.length !== 0;
      +        }
      +    }, {
      +        key: 'isThisMaterialized',
      +        value: function isThisMaterialized() {
      +            if (!this.isStatic()) {
      +                return true;
                   }
      +            return this.thisFound;
               }
      -    });
      +    }, {
      +        key: '__defineArguments',
      +        value: function __defineArguments() {
      +            this.__defineGeneric('arguments', this.set, this.variables, null, null);
      +            this.taints.set('arguments', true);
      +        }
      +    }]);
       
           return FunctionScope;
      -})(Scope);
      +}(Scope);
      +
      +var ForScope = exports.ForScope = function (_Scope10) {
      +    _inherits(ForScope, _Scope10);
       
      -var ForScope = exports.ForScope = (function (_Scope10) {
           function ForScope(scopeManager, upperScope, block) {
               _classCallCheck(this, ForScope);
       
      -        _get(Object.getPrototypeOf(ForScope.prototype), "constructor", this).call(this, scopeManager, "for", upperScope, block, false);
      +        return _possibleConstructorReturn(this, Object.getPrototypeOf(ForScope).call(this, scopeManager, 'for', upperScope, block, false));
           }
       
      -    _inherits(ForScope, _Scope10);
      -
           return ForScope;
      -})(Scope);
      +}(Scope);
      +
      +var ClassScope = exports.ClassScope = function (_Scope11) {
      +    _inherits(ClassScope, _Scope11);
       
      -var ClassScope = exports.ClassScope = (function (_Scope11) {
           function ClassScope(scopeManager, upperScope, block) {
               _classCallCheck(this, ClassScope);
       
      -        _get(Object.getPrototypeOf(ClassScope.prototype), "constructor", this).call(this, scopeManager, "class", upperScope, block, false);
      +        return _possibleConstructorReturn(this, Object.getPrototypeOf(ClassScope).call(this, scopeManager, 'class', upperScope, block, false));
           }
       
      -    _inherits(ClassScope, _Scope11);
      -
           return ClassScope;
      -})(Scope);
      +}(Scope);
       
       /* vim: set sw=4 ts=4 et tw=80 : */
      -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjb3BlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztJQXdCUyxNQUFNLFdBQVEsWUFBWSxFQUExQixNQUFNOztJQUNSLEdBQUcsMkJBQU0sU0FBUzs7SUFFbEIsU0FBUywyQkFBTSxhQUFhOztJQUM1QixRQUFRLDJCQUFNLFlBQVk7O0lBQzFCLFVBQVUsMkJBQU0sY0FBYzs7SUFDOUIsTUFBTSwyQkFBTSxRQUFROztBQUUzQixTQUFTLGFBQWEsQ0FBQyxLQUFLLEVBQUUsS0FBSyxFQUFFLGtCQUFrQixFQUFFLFlBQVksRUFBRTtBQUNuRSxRQUFJLElBQUksRUFBRSxDQUFDLEVBQUUsRUFBRSxFQUFFLElBQUksRUFBRSxJQUFJLENBQUM7OztBQUc1QixRQUFJLEtBQUssQ0FBQyxLQUFLLElBQUksS0FBSyxDQUFDLEtBQUssQ0FBQyxRQUFRLEVBQUU7QUFDckMsZUFBTyxJQUFJLENBQUM7S0FDZjs7O0FBR0QsUUFBSSxLQUFLLENBQUMsSUFBSSxLQUFLLE1BQU0sQ0FBQyx1QkFBdUIsRUFBRTtBQUMvQyxlQUFPLElBQUksQ0FBQztLQUNmOztBQUVELFFBQUksa0JBQWtCLEVBQUU7QUFDcEIsZUFBTyxJQUFJLENBQUM7S0FDZjs7QUFFRCxRQUFJLEtBQUssQ0FBQyxJQUFJLEtBQUssT0FBTyxJQUFJLEtBQUssQ0FBQyxJQUFJLEtBQUssUUFBUSxFQUFFO0FBQ25ELGVBQU8sSUFBSSxDQUFDO0tBQ2Y7O0FBRUQsUUFBSSxLQUFLLENBQUMsSUFBSSxLQUFLLE9BQU8sSUFBSSxLQUFLLENBQUMsSUFBSSxLQUFLLFFBQVEsRUFBRTtBQUNuRCxlQUFPLEtBQUssQ0FBQztLQUNoQjs7QUFFRCxRQUFJLEtBQUssQ0FBQyxJQUFJLEtBQUssVUFBVSxFQUFFO0FBQzNCLFlBQUksS0FBSyxDQUFDLElBQUksS0FBSyxTQUFTLEVBQUU7QUFDMUIsZ0JBQUksR0FBRyxLQUFLLENBQUM7U0FDaEIsTUFBTTtBQUNILGdCQUFJLEdBQUcsS0FBSyxDQUFDLElBQUksQ0FBQztTQUNyQjtLQUNKLE1BQU0sSUFBSSxLQUFLLENBQUMsSUFBSSxLQUFLLFFBQVEsRUFBRTtBQUNoQyxZQUFJLEdBQUcsS0FBSyxDQUFDO0tBQ2hCLE1BQU07QUFDSCxlQUFPLEtBQUssQ0FBQztLQUNoQjs7O0FBR0QsUUFBSSxZQUFZLEVBQUU7QUFDZCxhQUFLLENBQUMsR0FBRyxDQUFDLEVBQUUsRUFBRSxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUMsTUFBTSxFQUFFLENBQUMsR0FBRyxFQUFFLEVBQUUsRUFBRSxDQUFDLEVBQUU7QUFDNUMsZ0JBQUksR0FBRyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ3BCLGdCQUFJLElBQUksQ0FBQyxJQUFJLEtBQUssb0JBQW9CLEVBQUU7QUFDcEMsc0JBQU07YUFDVDtBQUNELGdCQUFJLElBQUksQ0FBQyxHQUFHLEtBQUssZ0JBQWMsSUFBSSxJQUFJLENBQUMsR0FBRyxLQUFLLGNBQWdCLEVBQUU7QUFDOUQsdUJBQU8sSUFBSSxDQUFDO2FBQ2Y7U0FDSjtLQUNKLE1BQU07QUFDSCxhQUFLLENBQUMsR0FBRyxDQUFDLEVBQUUsRUFBRSxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUMsTUFBTSxFQUFFLENBQUMsR0FBRyxFQUFFLEVBQUUsRUFBRSxDQUFDLEVBQUU7QUFDNUMsZ0JBQUksR0FBRyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ3BCLGdCQUFJLElBQUksQ0FBQyxJQUFJLEtBQUssTUFBTSxDQUFDLG1CQUFtQixFQUFFO0FBQzFDLHNCQUFNO2FBQ1Q7QUFDRCxnQkFBSSxHQUFHLElBQUksQ0FBQyxVQUFVLENBQUM7QUFDdkIsZ0JBQUksSUFBSSxDQUFDLElBQUksS0FBSyxNQUFNLENBQUMsT0FBTyxJQUFJLE9BQU8sSUFBSSxDQUFDLEtBQUssS0FBSyxRQUFRLEVBQUU7QUFDaEUsc0JBQU07YUFDVDtBQUNELGdCQUFJLElBQUksQ0FBQyxHQUFHLElBQUksSUFBSSxFQUFFO0FBQ2xCLG9CQUFJLElBQUksQ0FBQyxHQUFHLEtBQUssZ0JBQWMsSUFBSSxJQUFJLENBQUMsR0FBRyxLQUFLLGNBQWdCLEVBQUU7QUFDOUQsMkJBQU8sSUFBSSxDQUFDO2lCQUNmO2FBQ0osTUFBTTtBQUNILG9CQUFJLElBQUksQ0FBQyxLQUFLLEtBQUssWUFBWSxFQUFFO0FBQzdCLDJCQUFPLElBQUksQ0FBQztpQkFDZjthQUNKO1NBQ0o7S0FDSjtBQUNELFdBQU8sS0FBSyxDQUFDO0NBQ2hCOztBQUVELFNBQVMsYUFBYSxDQUFDLFlBQVksRUFBRSxLQUFLLEVBQUU7QUFDeEMsUUFBSSxNQUFNLENBQUM7O0FBRVgsZ0JBQVksQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDOztBQUVoQyxVQUFNLEdBQUcsWUFBWSxDQUFDLGFBQWEsQ0FBQyxHQUFHLENBQUMsS0FBSyxDQUFDLEtBQUssQ0FBQyxDQUFDO0FBQ3JELFFBQUksTUFBTSxFQUFFO0FBQ1IsY0FBTSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQztLQUN0QixNQUFNO0FBQ0gsb0JBQVksQ0FBQyxhQUFhLENBQUMsR0FBRyxDQUFDLEtBQUssQ0FBQyxLQUFLLEVBQUUsQ0FBRSxLQUFLLENBQUUsQ0FBQyxDQUFDO0tBQzFEO0NBQ0o7O0FBRUQsU0FBUyxrQkFBa0IsQ0FBQyxHQUFHLEVBQUU7QUFDN0IsV0FDSSxBQUFDLEdBQUcsQ0FBQyxJQUFJLEtBQUssUUFBUSxDQUFDLFNBQVMsSUFDL0IsR0FBRyxDQUFDLElBQUksS0FBSyxRQUFRLENBQUMsUUFBUSxJQUFJLEdBQUcsQ0FBQyxNQUFNLENBQUMsSUFBSSxLQUFLLEtBQUssQUFBQyxDQUMvRDtDQUNMOzs7Ozs7SUFLb0IsS0FBSztBQUNYLGFBRE0sS0FBSyxDQUNWLFlBQVksRUFBRSxJQUFJLEVBQUUsVUFBVSxFQUFFLEtBQUssRUFBRSxrQkFBa0IsRUFBRTs4QkFEdEQsS0FBSzs7Ozs7O0FBTWxCLFlBQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxDQUFDOzs7Ozs7QUFNakIsWUFBSSxDQUFDLEdBQUcsR0FBRyxJQUFJLEdBQUcsRUFBRSxDQUFDOzs7OztBQUtyQixZQUFJLENBQUMsTUFBTSxHQUFHLElBQUksR0FBRyxFQUFFLENBQUM7Ozs7Ozs7Ozs7O0FBV3hCLFlBQUksQ0FBQyxPQUFPLEdBQUcsSUFBSSxDQUFDLElBQUksS0FBSyxRQUFRLElBQUksSUFBSSxDQUFDLElBQUksS0FBSyxNQUFNLENBQUM7Ozs7O0FBSzlELFlBQUksQ0FBQyxLQUFLLEdBQUcsS0FBSyxDQUFDOzs7OztBQUtuQixZQUFJLENBQUMsT0FBTyxHQUFHLEVBQUUsQ0FBQzs7Ozs7OztBQU9sQixZQUFJLENBQUMsU0FBUyxHQUFHLEVBQUUsQ0FBQzs7Ozs7Ozs7OztBQVVwQixZQUFJLENBQUMsVUFBVSxHQUFHLEVBQUUsQ0FBQzs7Ozs7Ozs7QUFRckIsWUFBSSxDQUFDLGFBQWEsR0FDZCxBQUFDLElBQUksQ0FBQyxJQUFJLEtBQUssUUFBUSxJQUFJLElBQUksQ0FBQyxJQUFJLEtBQUssVUFBVSxJQUFJLElBQUksQ0FBQyxJQUFJLEtBQUssUUFBUSxHQUFJLElBQUksR0FBRyxVQUFVLENBQUMsYUFBYSxDQUFDOzs7OztBQUtySCxZQUFJLENBQUMsdUJBQXVCLEdBQUcsS0FBSyxDQUFDOzs7OztBQUtyQyxZQUFJLENBQUMscUJBQXFCLEdBQUcsS0FBSyxDQUFDOzs7O0FBSW5DLFlBQUksQ0FBQyxTQUFTLEdBQUcsS0FBSyxDQUFDOztBQUV2QixZQUFJLENBQUMsTUFBTSxHQUFHLEVBQUUsQ0FBQzs7Ozs7O0FBTWpCLFlBQUksQ0FBQyxLQUFLLEdBQUcsVUFBVSxDQUFDOzs7OztBQUt4QixZQUFJLENBQUMsUUFBUSxHQUFHLGFBQWEsQ0FBQyxJQUFJLEVBQUUsS0FBSyxFQUFFLGtCQUFrQixFQUFFLFlBQVksQ0FBQyxjQUFjLEVBQUUsQ0FBQyxDQUFDOzs7Ozs7QUFNOUYsWUFBSSxDQUFDLFdBQVcsR0FBRyxFQUFFLENBQUM7QUFDdEIsWUFBSSxJQUFJLENBQUMsS0FBSyxFQUFFO0FBQ1osZ0JBQUksQ0FBQyxLQUFLLENBQUMsV0FBVyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQztTQUNyQzs7QUFFRCxxQkFBYSxDQUFDLFlBQVksRUFBRSxJQUFJLENBQUMsQ0FBQztLQUNyQzs7aUJBdkdnQixLQUFLO0FBeUd0QiwrQkFBdUI7bUJBQUEsaUNBQUMsWUFBWSxFQUFFO0FBQ2xDLHVCQUFRLENBQUMsSUFBSSxDQUFDLE9BQU8sSUFBSSxZQUFZLENBQUMsY0FBYyxFQUFFLENBQUU7YUFDM0Q7O0FBRUQsd0NBQWdDO21CQUFBLDBDQUFDLEdBQUcsRUFBRTs7QUFFbEMsb0JBQUksSUFBSSxHQUFHLEdBQUcsQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDO0FBQy9CLG9CQUFJLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLEVBQUU7QUFDckIsMkJBQU8sS0FBSyxDQUFDO2lCQUNoQjs7QUFFRCxvQkFBSSxRQUFRLEdBQUcsSUFBSSxDQUFDLEdBQUcsQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLENBQUM7QUFDbEMsb0JBQUksSUFBSSxHQUFHLFFBQVEsQ0FBQyxJQUFJLENBQUM7QUFDekIsdUJBQU8sSUFBSSxDQUFDLE1BQU0sR0FBRyxDQUFDLElBQUksSUFBSSxDQUFDLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDO2FBQzVEOztBQUVELHdCQUFnQjttQkFBQSwwQkFBQyxHQUFHLEVBQUU7QUFDbEIsb0JBQUksQ0FBQyxJQUFJLENBQUMsU0FBUyxDQUFDLEdBQUcsQ0FBQyxFQUFFO0FBQ3RCLHdCQUFJLENBQUMsc0JBQXNCLENBQUMsR0FBRyxDQUFDLENBQUM7aUJBQ3BDO2FBQ0o7O0FBRUQseUJBQWlCO21CQUFBLDJCQUFDLEdBQUcsRUFBRTs7QUFFbkIsb0JBQUksT0FBTyxHQUFHLElBQUksQ0FBQztBQUNuQixtQkFBRztBQUNDLDJCQUFPLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUMxQiwyQkFBTyxHQUFHLE9BQU8sQ0FBQyxLQUFLLENBQUM7aUJBQzNCLFFBQVEsT0FBTyxFQUFFO2FBQ3JCOztBQUVELHdCQUFnQjttQkFBQSwwQkFBQyxHQUFHLEVBQUU7OztBQUdsQixvQkFBSSxJQUFJLENBQUMsZ0NBQWdDLENBQUMsR0FBRyxDQUFDLEVBQUU7QUFDNUMsd0JBQUksQ0FBQyxnQkFBZ0IsQ0FBQyxHQUFHLENBQUMsQ0FBQztpQkFDOUIsTUFBTTtBQUNILHdCQUFJLENBQUMsaUJBQWlCLENBQUMsR0FBRyxDQUFDLENBQUM7aUJBQy9CO2FBQ0o7O0FBRUQsZUFBTzttQkFBQSxpQkFBQyxZQUFZLEVBQUU7QUFDbEIsb0JBQUksUUFBUSxDQUFDO0FBQ2Isb0JBQUksSUFBSSxDQUFDLHVCQUF1QixDQUFDLFlBQVksQ0FBQyxFQUFFO0FBQzVDLDRCQUFRLEdBQUcsSUFBSSxDQUFDLGdCQUFnQixDQUFDO2lCQUNwQyxNQUFNLElBQUksSUFBSSxDQUFDLElBQUksS0FBSyxRQUFRLEVBQUU7QUFDL0IsNEJBQVEsR0FBRyxJQUFJLENBQUMsaUJBQWlCLENBQUM7aUJBQ3JDLE1BQU07QUFDSCw0QkFBUSxHQUFHLElBQUksQ0FBQyxnQkFBZ0IsQ0FBQztpQkFDcEM7OztBQUdELHFCQUFLLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxFQUFFLEdBQUcsSUFBSSxDQUFDLE1BQU0sQ0FBQyxNQUFNLEVBQUUsQ0FBQyxHQUFHLEVBQUUsRUFBRSxFQUFFLENBQUMsRUFBRTtBQUNsRCx3QkFBSSxHQUFHLEdBQUcsSUFBSSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUN6Qiw0QkFBUSxDQUFDLElBQUksQ0FBQyxJQUFJLEVBQUUsR0FBRyxDQUFDLENBQUM7aUJBQzVCO0FBQ0Qsb0JBQUksQ0FBQyxNQUFNLEdBQUcsSUFBSSxDQUFDOztBQUVuQix1QkFBTyxJQUFJLENBQUMsS0FBSyxDQUFDO2FBQ3JCOztBQUVELGlCQUFTO21CQUFBLG1CQUFDLEdBQUcsRUFBRTtBQUNYLG9CQUFJLFFBQVEsRUFBRSxJQUFJLENBQUM7QUFDbkIsb0JBQUksR0FBRyxHQUFHLENBQUMsVUFBVSxDQUFDLElBQUksQ0FBQztBQUMzQixvQkFBSSxJQUFJLENBQUMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsRUFBRTtBQUNwQiw0QkFBUSxHQUFHLElBQUksQ0FBQyxHQUFHLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxDQUFDO0FBQzlCLDRCQUFRLENBQUMsVUFBVSxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUM5Qiw0QkFBUSxDQUFDLEtBQUssR0FBRyxRQUFRLENBQUMsS0FBSyxJQUFJLEdBQUcsQ0FBQyxJQUFJLENBQUMsYUFBYSxLQUFLLElBQUksQ0FBQyxhQUFhLENBQUM7QUFDakYsd0JBQUksR0FBRyxDQUFDLE9BQU8sRUFBRTtBQUNiLGdDQUFRLENBQUMsT0FBTyxHQUFHLElBQUksQ0FBQztBQUN4Qiw0QkFBSSxDQUFDLE1BQU0sQ0FBQyxHQUFHLENBQUMsUUFBUSxDQUFDLElBQUksRUFBRSxJQUFJLENBQUMsQ0FBQztxQkFDeEM7QUFDRCx1QkFBRyxDQUFDLFFBQVEsR0FBRyxRQUFRLENBQUM7QUFDeEIsMkJBQU8sSUFBSSxDQUFDO2lCQUNmO0FBQ0QsdUJBQU8sS0FBSyxDQUFDO2FBQ2hCOztBQUVELDhCQUFzQjttQkFBQSxnQ0FBQyxHQUFHLEVBQUU7QUFDeEIsb0JBQUksSUFBSSxDQUFDLEtBQUssRUFBRTtBQUNaLHdCQUFJLENBQUMsS0FBSyxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUM7aUJBQy9CO0FBQ0Qsb0JBQUksQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDO2FBQzFCOztBQUVELHVCQUFlO21CQUFBLHlCQUFDLElBQUksRUFBRSxHQUFHLEVBQUUsU0FBUyxFQUFFLElBQUksRUFBRSxHQUFHLEVBQUU7QUFDN0Msb0JBQUksUUFBUSxDQUFDOztBQUViLHdCQUFRLEdBQUcsR0FBRyxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsQ0FBQztBQUN6QixvQkFBSSxDQUFDLFFBQVEsRUFBRTtBQUNYLDRCQUFRLEdBQUcsSUFBSSxRQUFRLENBQUMsSUFBSSxFQUFFLElBQUksQ0FBQyxDQUFDO0FBQ3BDLHVCQUFHLENBQUMsR0FBRyxDQUFDLElBQUksRUFBRSxRQUFRLENBQUMsQ0FBQztBQUN4Qiw2QkFBUyxDQUFDLElBQUksQ0FBQyxRQUFRLENBQUMsQ0FBQztpQkFDNUI7O0FBRUQsb0JBQUksR0FBRyxFQUFFO0FBQ0wsNEJBQVEsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDO2lCQUMzQjtBQUNELG9CQUFJLElBQUksRUFBRTtBQUNOLDRCQUFRLENBQUMsV0FBVyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQztpQkFDbkM7YUFDSjs7QUFFRCxnQkFBUTttQkFBQSxrQkFBQyxJQUFJLEVBQUUsR0FBRyxFQUFFO0FBQ2hCLG9CQUFJLElBQUksSUFBSSxJQUFJLENBQUMsSUFBSSxLQUFLLE1BQU0sQ0FBQyxVQUFVLEVBQUU7QUFDekMsd0JBQUksQ0FBQyxlQUFlLENBQ1osSUFBSSxDQUFDLElBQUksRUFDVCxJQUFJLENBQUMsR0FBRyxFQUNSLElBQUksQ0FBQyxTQUFTLEVBQ2QsSUFBSSxFQUNKLEdBQUcsQ0FBQyxDQUFDO2lCQUNoQjthQUNKOztBQUVELHFCQUFhO21CQUFBLHVCQUFDLElBQUksRUFBRSxNQUFNLEVBQUUsU0FBUyxFQUFFLG1CQUFtQixFQUFFLE9BQU8sRUFBRSxJQUFJLEVBQUU7O0FBRXZFLG9CQUFJLENBQUMsSUFBSSxJQUFJLElBQUksQ0FBQyxJQUFJLEtBQUssTUFBTSxDQUFDLFVBQVUsRUFBRTtBQUMxQywyQkFBTztpQkFDVjs7O0FBR0Qsb0JBQUksSUFBSSxDQUFDLElBQUksS0FBSyxPQUFPLEVBQUU7QUFDdkIsMkJBQU87aUJBQ1Y7O0FBRUQsb0JBQUksR0FBRyxHQUFHLElBQUksU0FBUyxDQUFDLElBQUksRUFBRSxJQUFJLEVBQUUsTUFBTSxJQUFJLFNBQVMsQ0FBQyxJQUFJLEVBQUUsU0FBUyxFQUFFLG1CQUFtQixFQUFFLENBQUMsQ0FBQyxPQUFPLEVBQUUsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDO0FBQ2pILG9CQUFJLENBQUMsVUFBVSxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUMxQixvQkFBSSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUM7YUFDekI7O0FBRUQsb0JBQVk7bUJBQUEsd0JBQUc7QUFDWCxvQkFBSSxPQUFPLENBQUM7QUFDWix1QkFBTyxHQUFHLElBQUksQ0FBQztBQUNmLG9CQUFJLENBQUMscUJBQXFCLEdBQUcsSUFBSSxDQUFDO0FBQ2xDLG1CQUFHO0FBQ0MsMkJBQU8sQ0FBQyxPQUFPLEdBQUcsSUFBSSxDQUFDO0FBQ3ZCLDJCQUFPLEdBQUcsT0FBTyxDQUFDLEtBQUssQ0FBQztpQkFDM0IsUUFBUSxPQUFPLEVBQUU7YUFDckI7O0FBRUQsb0JBQVk7bUJBQUEsd0JBQUc7QUFDWCxvQkFBSSxDQUFDLFNBQVMsR0FBRyxJQUFJLENBQUM7YUFDekI7O0FBRUQsa0JBQVU7bUJBQUEsc0JBQUc7QUFDVCx1QkFBTyxJQUFJLENBQUMsTUFBTSxLQUFLLElBQUksQ0FBQzthQUMvQjs7QUFRRCxlQUFPOzs7Ozs7Ozs7bUJBQUEsaUJBQUMsS0FBSyxFQUFFO0FBQ1gsb0JBQUksR0FBRyxFQUFFLENBQUMsRUFBRSxFQUFFLENBQUM7QUFDZixzQkFBTSxDQUFDLElBQUksQ0FBQyxVQUFVLEVBQUUsRUFBRSx5QkFBeUIsQ0FBQyxDQUFDO0FBQ3JELHNCQUFNLENBQUMsS0FBSyxDQUFDLElBQUksS0FBSyxNQUFNLENBQUMsVUFBVSxFQUFFLDhCQUE4QixDQUFDLENBQUM7QUFDekUscUJBQUssQ0FBQyxHQUFHLENBQUMsRUFBRSxFQUFFLEdBQUcsSUFBSSxDQUFDLFVBQVUsQ0FBQyxNQUFNLEVBQUUsQ0FBQyxHQUFHLEVBQUUsRUFBRSxFQUFFLENBQUMsRUFBRTtBQUNsRCx1QkFBRyxHQUFHLElBQUksQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDekIsd0JBQUksR0FBRyxDQUFDLFVBQVUsS0FBSyxLQUFLLEVBQUU7QUFDMUIsK0JBQU8sR0FBRyxDQUFDO3FCQUNkO2lCQUNKO0FBQ0QsdUJBQU8sSUFBSSxDQUFDO2FBQ2Y7O0FBT0QsZ0JBQVE7Ozs7Ozs7O21CQUFBLG9CQUFHO0FBQ1AsdUJBQU8sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDO2FBQ3hCOztBQU9ELCtCQUF1Qjs7Ozs7Ozs7bUJBQUEsbUNBQUc7QUFDdEIsdUJBQU8sSUFBSSxDQUFDO2FBQ2Y7O0FBT0QsMEJBQWtCOzs7Ozs7OzttQkFBQSw4QkFBRztBQUNqQix1QkFBTyxJQUFJLENBQUM7YUFDZjs7QUFFRCxrQkFBVTttQkFBQSxvQkFBQyxJQUFJLEVBQUU7QUFDYixvQkFBSSxJQUFJLENBQUMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsRUFBRTtBQUNwQiwyQkFBTyxJQUFJLENBQUM7aUJBQ2Y7QUFDRCxxQkFBSyxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsRUFBRSxHQUFHLElBQUksQ0FBQyxPQUFPLENBQUMsTUFBTSxFQUFFLENBQUMsR0FBRyxFQUFFLEVBQUUsRUFBRSxDQUFDLEVBQUU7QUFDbkQsd0JBQUksSUFBSSxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUMsQ0FBQyxVQUFVLENBQUMsSUFBSSxLQUFLLElBQUksRUFBRTtBQUMxQywrQkFBTyxJQUFJLENBQUM7cUJBQ2Y7aUJBQ0o7QUFDRCx1QkFBTyxLQUFLLENBQUM7YUFDaEI7Ozs7V0FyVGdCLEtBQUs7OztxQkFBTCxLQUFLOztJQXdUYixXQUFXLFdBQVgsV0FBVztBQUNULGFBREYsV0FBVyxDQUNSLFlBQVksRUFBRSxLQUFLLEVBQUU7OEJBRHhCLFdBQVc7O0FBRWhCLG1DQUZLLFdBQVcsNkNBRVYsWUFBWSxFQUFFLFFBQVEsRUFBRSxJQUFJLEVBQUUsS0FBSyxFQUFFLEtBQUssRUFBRTtBQUNsRCxZQUFJLENBQUMsUUFBUSxHQUFHO0FBQ1osZUFBRyxFQUFFLElBQUksR0FBRyxFQUFFO0FBQ2QscUJBQVMsRUFBRSxFQUFFOzs7Ozs7QUFNYixnQkFBSSxFQUFFLEVBQUU7U0FDWCxDQUFDO0tBQ0w7O2NBYlEsV0FBVzs7aUJBQVgsV0FBVztBQWVwQixlQUFPO21CQUFBLGlCQUFDLFlBQVksRUFBRTtBQUNsQixvQkFBSSxRQUFRLEdBQUcsRUFBRSxDQUFDO0FBQ2xCLHFCQUFLLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxFQUFFLEdBQUcsSUFBSSxDQUFDLE1BQU0sQ0FBQyxNQUFNLEVBQUUsQ0FBQyxHQUFHLEVBQUUsRUFBRSxFQUFFLENBQUMsRUFBRTtBQUNsRCx3QkFBSSxHQUFHLEdBQUcsSUFBSSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUN6Qix3QkFBSSxHQUFHLENBQUMscUJBQXFCLElBQUksQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxHQUFHLENBQUMsVUFBVSxDQUFDLElBQUksQ0FBQyxFQUFFO0FBQ2pFLGdDQUFRLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxxQkFBcUIsQ0FBQyxDQUFDO3FCQUM1QztpQkFDSjs7O0FBR0QscUJBQUssSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLEVBQUUsR0FBRyxRQUFRLENBQUMsTUFBTSxFQUFFLENBQUMsR0FBRyxFQUFFLEVBQUUsRUFBRSxDQUFDLEVBQUU7QUFDL0Msd0JBQUksSUFBSSxHQUFHLFFBQVEsQ0FBQyxDQUFDLENBQUMsQ0FBQztBQUN2Qix3QkFBSSxDQUFDLGdCQUFnQixDQUFDLElBQUksQ0FBQyxPQUFPLEVBQzFCLElBQUksVUFBVSxDQUNWLFFBQVEsQ0FBQyxzQkFBc0IsRUFDL0IsSUFBSSxDQUFDLE9BQU8sRUFDWixJQUFJLENBQUMsSUFBSSxFQUNULElBQUksRUFDSixJQUFJLEVBQ0osSUFBSSxDQUNQLENBQUMsQ0FBQztpQkFFZDs7QUFFRCxvQkFBSSxDQUFDLFFBQVEsQ0FBQyxJQUFJLEdBQUcsSUFBSSxDQUFDLE1BQU0sQ0FBQzs7QUFFakMsa0RBekNLLFdBQVcseUNBeUNLLFlBQVksRUFBRTthQUN0Qzs7QUFFRCx3QkFBZ0I7bUJBQUEsMEJBQUMsSUFBSSxFQUFFLEdBQUcsRUFBRTtBQUN4QixvQkFBSSxJQUFJLElBQUksSUFBSSxDQUFDLElBQUksS0FBSyxNQUFNLENBQUMsVUFBVSxFQUFFO0FBQ3pDLHdCQUFJLENBQUMsZUFBZSxDQUNaLElBQUksQ0FBQyxJQUFJLEVBQ1QsSUFBSSxDQUFDLFFBQVEsQ0FBQyxHQUFHLEVBQ2pCLElBQUksQ0FBQyxRQUFRLENBQUMsU0FBUyxFQUN2QixJQUFJLEVBQ0osR0FBRyxDQUFDLENBQUM7aUJBQ2hCO2FBQ0o7Ozs7V0FyRFEsV0FBVztHQUFTLEtBQUs7O0lBd0R6QixXQUFXLFdBQVgsV0FBVztBQUNULGFBREYsV0FBVyxDQUNSLFlBQVksRUFBRSxVQUFVLEVBQUUsS0FBSyxFQUFFOzhCQURwQyxXQUFXOztBQUVoQixtQ0FGSyxXQUFXLDZDQUVWLFlBQVksRUFBRSxRQUFRLEVBQUUsVUFBVSxFQUFFLEtBQUssRUFBRSxLQUFLLEVBQUU7S0FDM0Q7O2NBSFEsV0FBVzs7V0FBWCxXQUFXO0dBQVMsS0FBSzs7SUFNekIsMkJBQTJCLFdBQTNCLDJCQUEyQjtBQUN6QixhQURGLDJCQUEyQixDQUN4QixZQUFZLEVBQUUsVUFBVSxFQUFFLEtBQUssRUFBRTs4QkFEcEMsMkJBQTJCOztBQUVoQyxtQ0FGSywyQkFBMkIsNkNBRTFCLFlBQVksRUFBRSwwQkFBMEIsRUFBRSxVQUFVLEVBQUUsS0FBSyxFQUFFLEtBQUssRUFBRTtBQUMxRSxZQUFJLENBQUMsUUFBUSxDQUFDLEtBQUssQ0FBQyxFQUFFLEVBQ2QsSUFBSSxVQUFVLENBQ1YsUUFBUSxDQUFDLFlBQVksRUFDckIsS0FBSyxDQUFDLEVBQUUsRUFDUixLQUFLLEVBQ0wsSUFBSSxFQUNKLElBQUksRUFDSixJQUFJLENBQ1AsQ0FBQyxDQUFDO0FBQ1gsWUFBSSxDQUFDLHVCQUF1QixHQUFHLElBQUksQ0FBQztLQUN2Qzs7Y0FiUSwyQkFBMkI7O1dBQTNCLDJCQUEyQjtHQUFTLEtBQUs7O0lBZ0J6QyxVQUFVLFdBQVYsVUFBVTtBQUNSLGFBREYsVUFBVSxDQUNQLFlBQVksRUFBRSxVQUFVLEVBQUUsS0FBSyxFQUFFOzhCQURwQyxVQUFVOztBQUVmLG1DQUZLLFVBQVUsNkNBRVQsWUFBWSxFQUFFLE9BQU8sRUFBRSxVQUFVLEVBQUUsS0FBSyxFQUFFLEtBQUssRUFBRTtLQUMxRDs7Y0FIUSxVQUFVOztXQUFWLFVBQVU7R0FBUyxLQUFLOztJQU14QixTQUFTLFdBQVQsU0FBUztBQUNQLGFBREYsU0FBUyxDQUNOLFlBQVksRUFBRSxVQUFVLEVBQUUsS0FBSyxFQUFFOzhCQURwQyxTQUFTOztBQUVkLG1DQUZLLFNBQVMsNkNBRVIsWUFBWSxFQUFFLE1BQU0sRUFBRSxVQUFVLEVBQUUsS0FBSyxFQUFFLEtBQUssRUFBRTtLQUN6RDs7Y0FIUSxTQUFTOztpQkFBVCxTQUFTO0FBS2xCLGVBQU87bUJBQUEsaUJBQUMsWUFBWSxFQUFFO0FBQ2xCLG9CQUFJLElBQUksQ0FBQyx1QkFBdUIsQ0FBQyxZQUFZLENBQUMsRUFBRTtBQUM1QyxzREFQQyxTQUFTLHlDQU9XLFlBQVksRUFBRTtpQkFDdEM7O0FBRUQscUJBQUssSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLEVBQUUsR0FBRyxJQUFJLENBQUMsTUFBTSxDQUFDLE1BQU0sRUFBRSxDQUFDLEdBQUcsRUFBRSxFQUFFLEVBQUUsQ0FBQyxFQUFFO0FBQ2xELHdCQUFJLEdBQUcsR0FBRyxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ3pCLHVCQUFHLENBQUMsT0FBTyxHQUFHLElBQUksQ0FBQztBQUNuQix3QkFBSSxDQUFDLHNCQUFzQixDQUFDLEdBQUcsQ0FBQyxDQUFDO2lCQUNwQztBQUNELG9CQUFJLENBQUMsTUFBTSxHQUFHLElBQUksQ0FBQzs7QUFFbkIsdUJBQU8sSUFBSSxDQUFDLEtBQUssQ0FBQzthQUNyQjs7OztXQWxCUSxTQUFTO0dBQVMsS0FBSzs7SUFxQnZCLFFBQVEsV0FBUixRQUFRO0FBQ04sYUFERixRQUFRLENBQ0wsWUFBWSxFQUFFLFVBQVUsRUFBRSxLQUFLLEVBQUU7OEJBRHBDLFFBQVE7O0FBRWIsbUNBRkssUUFBUSw2Q0FFUCxZQUFZLEVBQUUsS0FBSyxFQUFFLFVBQVUsRUFBRSxLQUFLLEVBQUUsS0FBSyxFQUFFO0tBQ3hEOztjQUhRLFFBQVE7O1dBQVIsUUFBUTtHQUFTLEtBQUs7O0lBTXRCLFVBQVUsV0FBVixVQUFVO0FBQ1IsYUFERixVQUFVLENBQ1AsWUFBWSxFQUFFLFVBQVUsRUFBRSxLQUFLLEVBQUU7OEJBRHBDLFVBQVU7O0FBRWYsbUNBRkssVUFBVSw2Q0FFVCxZQUFZLEVBQUUsT0FBTyxFQUFFLFVBQVUsRUFBRSxLQUFLLEVBQUUsS0FBSyxFQUFFO0tBQzFEOztjQUhRLFVBQVU7O1dBQVYsVUFBVTtHQUFTLEtBQUs7O0lBTXhCLFdBQVcsV0FBWCxXQUFXO0FBQ1QsYUFERixXQUFXLENBQ1IsWUFBWSxFQUFFLFVBQVUsRUFBRSxLQUFLLEVBQUU7OEJBRHBDLFdBQVc7O0FBRWhCLG1DQUZLLFdBQVcsNkNBRVYsWUFBWSxFQUFFLFFBQVEsRUFBRSxVQUFVLEVBQUUsS0FBSyxFQUFFLEtBQUssRUFBRTtLQUMzRDs7Y0FIUSxXQUFXOztXQUFYLFdBQVc7R0FBUyxLQUFLOztJQU16QixhQUFhLFdBQWIsYUFBYTtBQUNYLGFBREYsYUFBYSxDQUNWLFlBQVksRUFBRSxVQUFVLEVBQUUsS0FBSyxFQUFFLGtCQUFrQixFQUFFOzhCQUR4RCxhQUFhOztBQUVsQixtQ0FGSyxhQUFhLDZDQUVaLFlBQVksRUFBRSxVQUFVLEVBQUUsVUFBVSxFQUFFLEtBQUssRUFBRSxrQkFBa0IsRUFBRTs7OztBQUl2RSxZQUFJLElBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSxLQUFLLE1BQU0sQ0FBQyx1QkFBdUIsRUFBRTtBQUNwRCxnQkFBSSxDQUFDLGlCQUFpQixFQUFFLENBQUM7U0FDNUI7S0FDSjs7Y0FUUSxhQUFhOztpQkFBYixhQUFhO0FBV3RCLCtCQUF1QjttQkFBQSxtQ0FBRzs7Ozs7Ozs7O0FBU3RCLG9CQUFJLElBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSxLQUFLLE1BQU0sQ0FBQyx1QkFBdUIsRUFBRTtBQUNwRCwyQkFBTyxLQUFLLENBQUM7aUJBQ2hCOztBQUVELG9CQUFJLENBQUMsSUFBSSxDQUFDLFFBQVEsRUFBRSxFQUFFO0FBQ2xCLDJCQUFPLElBQUksQ0FBQztpQkFDZjs7QUFFRCxvQkFBSSxRQUFRLEdBQUcsSUFBSSxDQUFDLEdBQUcsQ0FBQyxHQUFHLENBQUMsV0FBVyxDQUFDLENBQUM7QUFDekMsc0JBQU0sQ0FBQyxRQUFRLEVBQUUsaUNBQWlDLENBQUMsQ0FBQztBQUNwRCx1QkFBTyxRQUFRLENBQUMsT0FBTyxJQUFJLFFBQVEsQ0FBQyxVQUFVLENBQUMsTUFBTSxLQUFNLENBQUMsQ0FBQzthQUNoRTs7QUFFRCwwQkFBa0I7bUJBQUEsOEJBQUc7QUFDakIsb0JBQUksQ0FBQyxJQUFJLENBQUMsUUFBUSxFQUFFLEVBQUU7QUFDbEIsMkJBQU8sSUFBSSxDQUFDO2lCQUNmO0FBQ0QsdUJBQU8sSUFBSSxDQUFDLFNBQVMsQ0FBQzthQUN6Qjs7QUFFRCx5QkFBaUI7bUJBQUEsNkJBQUc7QUFDaEIsb0JBQUksQ0FBQyxlQUFlLENBQ1osV0FBVyxFQUNYLElBQUksQ0FBQyxHQUFHLEVBQ1IsSUFBSSxDQUFDLFNBQVMsRUFDZCxJQUFJLEVBQ0osSUFBSSxDQUFDLENBQUM7QUFDZCxvQkFBSSxDQUFDLE1BQU0sQ0FBQyxHQUFHLENBQUMsV0FBVyxFQUFFLElBQUksQ0FBQyxDQUFDO2FBQ3RDOzs7O1dBaERRLGFBQWE7R0FBUyxLQUFLOztJQW1EM0IsUUFBUSxXQUFSLFFBQVE7QUFDTixhQURGLFFBQVEsQ0FDTCxZQUFZLEVBQUUsVUFBVSxFQUFFLEtBQUssRUFBRTs4QkFEcEMsUUFBUTs7QUFFYixtQ0FGSyxRQUFRLDZDQUVQLFlBQVksRUFBRSxLQUFLLEVBQUUsVUFBVSxFQUFFLEtBQUssRUFBRSxLQUFLLEVBQUU7S0FDeEQ7O2NBSFEsUUFBUTs7V0FBUixRQUFRO0dBQVMsS0FBSzs7SUFNdEIsVUFBVSxXQUFWLFVBQVU7QUFDUixhQURGLFVBQVUsQ0FDUCxZQUFZLEVBQUUsVUFBVSxFQUFFLEtBQUssRUFBRTs4QkFEcEMsVUFBVTs7QUFFZixtQ0FGSyxVQUFVLDZDQUVULFlBQVksRUFBRSxPQUFPLEVBQUUsVUFBVSxFQUFFLEtBQUssRUFBRSxLQUFLLEVBQUU7S0FDMUQ7O2NBSFEsVUFBVTs7V0FBVixVQUFVO0dBQVMsS0FBSyIsImZpbGUiOiJzY29wZS5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gIENvcHlyaWdodCAoQykgMjAxNSBZdXN1a2UgU3V6dWtpIDx1dGF0YW5lLnRlYUBnbWFpbC5jb20+XG5cbiAgUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0XG4gIG1vZGlmaWNhdGlvbiwgYXJlIHBlcm1pdHRlZCBwcm92aWRlZCB0aGF0IHRoZSBmb2xsb3dpbmcgY29uZGl0aW9ucyBhcmUgbWV0OlxuXG4gICAgKiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodFxuICAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyLlxuICAgICogUmVkaXN0cmlidXRpb25zIGluIGJpbmFyeSBmb3JtIG11c3QgcmVwcm9kdWNlIHRoZSBhYm92ZSBjb3B5cmlnaHRcbiAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lciBpbiB0aGVcbiAgICAgIGRvY3VtZW50YXRpb24gYW5kL29yIG90aGVyIG1hdGVyaWFscyBwcm92aWRlZCB3aXRoIHRoZSBkaXN0cmlidXRpb24uXG5cbiAgVEhJUyBTT0ZUV0FSRSBJUyBQUk9WSURFRCBCWSBUSEUgQ09QWVJJR0hUIEhPTERFUlMgQU5EIENPTlRSSUJVVE9SUyBcIkFTIElTXCJcbiAgQU5EIEFOWSBFWFBSRVNTIE9SIElNUExJRUQgV0FSUkFOVElFUywgSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFRIRVxuICBJTVBMSUVEIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZIEFORCBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRVxuICBBUkUgRElTQ0xBSU1FRC4gSU4gTk8gRVZFTlQgU0hBTEwgPENPUFlSSUdIVCBIT0xERVI+IEJFIExJQUJMRSBGT1IgQU5ZXG4gIERJUkVDVCwgSU5ESVJFQ1QsIElOQ0lERU5UQUwsIFNQRUNJQUwsIEVYRU1QTEFSWSwgT1IgQ09OU0VRVUVOVElBTCBEQU1BR0VTXG4gIChJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgUFJPQ1VSRU1FTlQgT0YgU1VCU1RJVFVURSBHT09EUyBPUiBTRVJWSUNFUztcbiAgTE9TUyBPRiBVU0UsIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EXG4gIE9OIEFOWSBUSEVPUlkgT0YgTElBQklMSVRZLCBXSEVUSEVSIElOIENPTlRSQUNULCBTVFJJQ1QgTElBQklMSVRZLCBPUiBUT1JUXG4gIChJTkNMVURJTkcgTkVHTElHRU5DRSBPUiBPVEhFUldJU0UpIEFSSVNJTkcgSU4gQU5ZIFdBWSBPVVQgT0YgVEhFIFVTRSBPRlxuICBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLlxuKi9cblxuaW1wb3J0IHsgU3ludGF4IH0gZnJvbSAnZXN0cmF2ZXJzZSc7XG5pbXBvcnQgTWFwIGZyb20gJ2VzNi1tYXAnO1xuXG5pbXBvcnQgUmVmZXJlbmNlIGZyb20gJy4vcmVmZXJlbmNlJztcbmltcG9ydCBWYXJpYWJsZSBmcm9tICcuL3ZhcmlhYmxlJztcbmltcG9ydCBEZWZpbml0aW9uIGZyb20gJy4vZGVmaW5pdGlvbic7XG5pbXBvcnQgYXNzZXJ0IGZyb20gJ2Fzc2VydCc7XG5cbmZ1bmN0aW9uIGlzU3RyaWN0U2NvcGUoc2NvcGUsIGJsb2NrLCBpc01ldGhvZERlZmluaXRpb24sIHVzZURpcmVjdGl2ZSkge1xuICAgIHZhciBib2R5LCBpLCBpeiwgc3RtdCwgZXhwcjtcblxuICAgIC8vIFdoZW4gdXBwZXIgc2NvcGUgaXMgZXhpc3RzIGFuZCBzdHJpY3QsIGlubmVyIHNjb3BlIGlzIGFsc28gc3RyaWN0LlxuICAgIGlmIChzY29wZS51cHBlciAmJiBzY29wZS51cHBlci5pc1N0cmljdCkge1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9XG5cbiAgICAvLyBBcnJvd0Z1bmN0aW9uRXhwcmVzc2lvbidzIHNjb3BlIGlzIGFsd2F5cyBzdHJpY3Qgc2NvcGUuXG4gICAgaWYgKGJsb2NrLnR5cGUgPT09IFN5bnRheC5BcnJvd0Z1bmN0aW9uRXhwcmVzc2lvbikge1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9XG5cbiAgICBpZiAoaXNNZXRob2REZWZpbml0aW9uKSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cblxuICAgIGlmIChzY29wZS50eXBlID09PSAnY2xhc3MnIHx8IHNjb3BlLnR5cGUgPT09ICdtb2R1bGUnKSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cblxuICAgIGlmIChzY29wZS50eXBlID09PSAnYmxvY2snIHx8IHNjb3BlLnR5cGUgPT09ICdzd2l0Y2gnKSB7XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG5cbiAgICBpZiAoc2NvcGUudHlwZSA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICBpZiAoYmxvY2sudHlwZSA9PT0gJ1Byb2dyYW0nKSB7XG4gICAgICAgICAgICBib2R5ID0gYmxvY2s7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBib2R5ID0gYmxvY2suYm9keTtcbiAgICAgICAgfVxuICAgIH0gZWxzZSBpZiAoc2NvcGUudHlwZSA9PT0gJ2dsb2JhbCcpIHtcbiAgICAgICAgYm9keSA9IGJsb2NrO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG5cbiAgICAvLyBTZWFyY2ggJ3VzZSBzdHJpY3QnIGRpcmVjdGl2ZS5cbiAgICBpZiAodXNlRGlyZWN0aXZlKSB7XG4gICAgICAgIGZvciAoaSA9IDAsIGl6ID0gYm9keS5ib2R5Lmxlbmd0aDsgaSA8IGl6OyArK2kpIHtcbiAgICAgICAgICAgIHN0bXQgPSBib2R5LmJvZHlbaV07XG4gICAgICAgICAgICBpZiAoc3RtdC50eXBlICE9PSAnRGlyZWN0aXZlU3RhdGVtZW50Jykge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHN0bXQucmF3ID09PSAnXCJ1c2Ugc3RyaWN0XCInIHx8IHN0bXQucmF3ID09PSAnXFwndXNlIHN0cmljdFxcJycpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICAgIGZvciAoaSA9IDAsIGl6ID0gYm9keS5ib2R5Lmxlbmd0aDsgaSA8IGl6OyArK2kpIHtcbiAgICAgICAgICAgIHN0bXQgPSBib2R5LmJvZHlbaV07XG4gICAgICAgICAgICBpZiAoc3RtdC50eXBlICE9PSBTeW50YXguRXhwcmVzc2lvblN0YXRlbWVudCkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZXhwciA9IHN0bXQuZXhwcmVzc2lvbjtcbiAgICAgICAgICAgIGlmIChleHByLnR5cGUgIT09IFN5bnRheC5MaXRlcmFsIHx8IHR5cGVvZiBleHByLnZhbHVlICE9PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGV4cHIucmF3ICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICBpZiAoZXhwci5yYXcgPT09ICdcInVzZSBzdHJpY3RcIicgfHwgZXhwci5yYXcgPT09ICdcXCd1c2Ugc3RyaWN0XFwnJykge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChleHByLnZhbHVlID09PSAndXNlIHN0cmljdCcpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuICAgIHJldHVybiBmYWxzZTtcbn1cblxuZnVuY3Rpb24gcmVnaXN0ZXJTY29wZShzY29wZU1hbmFnZXIsIHNjb3BlKSB7XG4gICAgdmFyIHNjb3BlcztcblxuICAgIHNjb3BlTWFuYWdlci5zY29wZXMucHVzaChzY29wZSk7XG5cbiAgICBzY29wZXMgPSBzY29wZU1hbmFnZXIuX19ub2RlVG9TY29wZS5nZXQoc2NvcGUuYmxvY2spO1xuICAgIGlmIChzY29wZXMpIHtcbiAgICAgICAgc2NvcGVzLnB1c2goc2NvcGUpO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIHNjb3BlTWFuYWdlci5fX25vZGVUb1Njb3BlLnNldChzY29wZS5ibG9jaywgWyBzY29wZSBdKTtcbiAgICB9XG59XG5cbmZ1bmN0aW9uIHNob3VsZEJlU3RhdGljYWxseShkZWYpIHtcbiAgICByZXR1cm4gKFxuICAgICAgICAoZGVmLnR5cGUgPT09IFZhcmlhYmxlLkNsYXNzTmFtZSkgfHxcbiAgICAgICAgKGRlZi50eXBlID09PSBWYXJpYWJsZS5WYXJpYWJsZSAmJiBkZWYucGFyZW50LmtpbmQgIT09IFwidmFyXCIpXG4gICAgKTtcbn1cblxuLyoqXG4gKiBAY2xhc3MgU2NvcGVcbiAqL1xuZXhwb3J0IGRlZmF1bHQgY2xhc3MgU2NvcGUge1xuICAgIGNvbnN0cnVjdG9yKHNjb3BlTWFuYWdlciwgdHlwZSwgdXBwZXJTY29wZSwgYmxvY2ssIGlzTWV0aG9kRGVmaW5pdGlvbikge1xuICAgICAgICAvKipcbiAgICAgICAgICogT25lIG9mICdURFonLCAnbW9kdWxlJywgJ2Jsb2NrJywgJ3N3aXRjaCcsICdmdW5jdGlvbicsICdjYXRjaCcsICd3aXRoJywgJ2Z1bmN0aW9uJywgJ2NsYXNzJywgJ2dsb2JhbCcuXG4gICAgICAgICAqIEBtZW1iZXIge1N0cmluZ30gU2NvcGUjdHlwZVxuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy50eXBlID0gdHlwZTtcbiAgICAgICAgIC8qKlxuICAgICAgICAgKiBUaGUgc2NvcGVkIHtAbGluayBWYXJpYWJsZX1zIG9mIHRoaXMgc2NvcGUsIGFzIDxjb2RlPnsgVmFyaWFibGUubmFtZVxuICAgICAgICAgKiA6IFZhcmlhYmxlIH08L2NvZGU+LlxuICAgICAgICAgKiBAbWVtYmVyIHtNYXB9IFNjb3BlI3NldFxuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5zZXQgPSBuZXcgTWFwKCk7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBUaGUgdGFpbnRlZCB2YXJpYWJsZXMgb2YgdGhpcyBzY29wZSwgYXMgPGNvZGU+eyBWYXJpYWJsZS5uYW1lIDpcbiAgICAgICAgICogYm9vbGVhbiB9PC9jb2RlPi5cbiAgICAgICAgICogQG1lbWJlciB7TWFwfSBTY29wZSN0YWludHMgKi9cbiAgICAgICAgdGhpcy50YWludHMgPSBuZXcgTWFwKCk7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBHZW5lcmFsbHksIHRocm91Z2ggdGhlIGxleGljYWwgc2NvcGluZyBvZiBKUyB5b3UgY2FuIGFsd2F5cyBrbm93XG4gICAgICAgICAqIHdoaWNoIHZhcmlhYmxlIGFuIGlkZW50aWZpZXIgaW4gdGhlIHNvdXJjZSBjb2RlIHJlZmVycyB0by4gVGhlcmUgYXJlXG4gICAgICAgICAqIGEgZmV3IGV4Y2VwdGlvbnMgdG8gdGhpcyBydWxlLiBXaXRoICdnbG9iYWwnIGFuZCAnd2l0aCcgc2NvcGVzIHlvdVxuICAgICAgICAgKiBjYW4gb25seSBkZWNpZGUgYXQgcnVudGltZSB3aGljaCB2YXJpYWJsZSBhIHJlZmVyZW5jZSByZWZlcnMgdG8uXG4gICAgICAgICAqIE1vcmVvdmVyLCBpZiAnZXZhbCgpJyBpcyB1c2VkIGluIGEgc2NvcGUsIGl0IG1pZ2h0IGludHJvZHVjZSBuZXdcbiAgICAgICAgICogYmluZGluZ3MgaW4gdGhpcyBvciBpdHMgcHJhcmVudCBzY29wZXMuXG4gICAgICAgICAqIEFsbCB0aG9zZSBzY29wZXMgYXJlIGNvbnNpZGVyZWQgJ2R5bmFtaWMnLlxuICAgICAgICAgKiBAbWVtYmVyIHtib29sZWFufSBTY29wZSNkeW5hbWljXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLmR5bmFtaWMgPSB0aGlzLnR5cGUgPT09ICdnbG9iYWwnIHx8IHRoaXMudHlwZSA9PT0gJ3dpdGgnO1xuICAgICAgICAvKipcbiAgICAgICAgICogQSByZWZlcmVuY2UgdG8gdGhlIHNjb3BlLWRlZmluaW5nIHN5bnRheCBub2RlLlxuICAgICAgICAgKiBAbWVtYmVyIHtlc3ByaW1hLk5vZGV9IFNjb3BlI2Jsb2NrXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLmJsb2NrID0gYmxvY2s7XG4gICAgICAgICAvKipcbiAgICAgICAgICogVGhlIHtAbGluayBSZWZlcmVuY2V8cmVmZXJlbmNlc30gdGhhdCBhcmUgbm90IHJlc29sdmVkIHdpdGggdGhpcyBzY29wZS5cbiAgICAgICAgICogQG1lbWJlciB7UmVmZXJlbmNlW119IFNjb3BlI3Rocm91Z2hcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMudGhyb3VnaCA9IFtdO1xuICAgICAgICAgLyoqXG4gICAgICAgICAqIFRoZSBzY29wZWQge0BsaW5rIFZhcmlhYmxlfXMgb2YgdGhpcyBzY29wZS4gSW4gdGhlIGNhc2Ugb2YgYVxuICAgICAgICAgKiAnZnVuY3Rpb24nIHNjb3BlIHRoaXMgaW5jbHVkZXMgdGhlIGF1dG9tYXRpYyBhcmd1bWVudCA8ZW0+YXJndW1lbnRzPC9lbT4gYXNcbiAgICAgICAgICogaXRzIGZpcnN0IGVsZW1lbnQsIGFzIHdlbGwgYXMgYWxsIGZ1cnRoZXIgZm9ybWFsIGFyZ3VtZW50cy5cbiAgICAgICAgICogQG1lbWJlciB7VmFyaWFibGVbXX0gU2NvcGUjdmFyaWFibGVzXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLnZhcmlhYmxlcyA9IFtdO1xuICAgICAgICAgLyoqXG4gICAgICAgICAqIEFueSB2YXJpYWJsZSB7QGxpbmsgUmVmZXJlbmNlfHJlZmVyZW5jZX0gZm91bmQgaW4gdGhpcyBzY29wZS4gVGhpc1xuICAgICAgICAgKiBpbmNsdWRlcyBvY2N1cnJlbmNlcyBvZiBsb2NhbCB2YXJpYWJsZXMgYXMgd2VsbCBhcyB2YXJpYWJsZXMgZnJvbVxuICAgICAgICAgKiBwYXJlbnQgc2NvcGVzIChpbmNsdWRpbmcgdGhlIGdsb2JhbCBzY29wZSkuIEZvciBsb2NhbCB2YXJpYWJsZXNcbiAgICAgICAgICogdGhpcyBhbHNvIGluY2x1ZGVzIGRlZmluaW5nIG9jY3VycmVuY2VzIChsaWtlIGluIGEgJ3Zhcicgc3RhdGVtZW50KS5cbiAgICAgICAgICogSW4gYSAnZnVuY3Rpb24nIHNjb3BlIHRoaXMgZG9lcyBub3QgaW5jbHVkZSB0aGUgb2NjdXJyZW5jZXMgb2YgdGhlXG4gICAgICAgICAqIGZvcm1hbCBwYXJhbWV0ZXIgaW4gdGhlIHBhcmFtZXRlciBsaXN0LlxuICAgICAgICAgKiBAbWVtYmVyIHtSZWZlcmVuY2VbXX0gU2NvcGUjcmVmZXJlbmNlc1xuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5yZWZlcmVuY2VzID0gW107XG5cbiAgICAgICAgIC8qKlxuICAgICAgICAgKiBGb3IgJ2dsb2JhbCcgYW5kICdmdW5jdGlvbicgc2NvcGVzLCB0aGlzIGlzIGEgc2VsZi1yZWZlcmVuY2UuIEZvclxuICAgICAgICAgKiBvdGhlciBzY29wZSB0eXBlcyB0aGlzIGlzIHRoZSA8ZW0+dmFyaWFibGVTY29wZTwvZW0+IHZhbHVlIG9mIHRoZVxuICAgICAgICAgKiBwYXJlbnQgc2NvcGUuXG4gICAgICAgICAqIEBtZW1iZXIge1Njb3BlfSBTY29wZSN2YXJpYWJsZVNjb3BlXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLnZhcmlhYmxlU2NvcGUgPVxuICAgICAgICAgICAgKHRoaXMudHlwZSA9PT0gJ2dsb2JhbCcgfHwgdGhpcy50eXBlID09PSAnZnVuY3Rpb24nIHx8IHRoaXMudHlwZSA9PT0gJ21vZHVsZScpID8gdGhpcyA6IHVwcGVyU2NvcGUudmFyaWFibGVTY29wZTtcbiAgICAgICAgIC8qKlxuICAgICAgICAgKiBXaGV0aGVyIHRoaXMgc2NvcGUgaXMgY3JlYXRlZCBieSBhIEZ1bmN0aW9uRXhwcmVzc2lvbi5cbiAgICAgICAgICogQG1lbWJlciB7Ym9vbGVhbn0gU2NvcGUjZnVuY3Rpb25FeHByZXNzaW9uU2NvcGVcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMuZnVuY3Rpb25FeHByZXNzaW9uU2NvcGUgPSBmYWxzZTtcbiAgICAgICAgIC8qKlxuICAgICAgICAgKiBXaGV0aGVyIHRoaXMgaXMgYSBzY29wZSB0aGF0IGNvbnRhaW5zIGFuICdldmFsKCknIGludm9jYXRpb24uXG4gICAgICAgICAqIEBtZW1iZXIge2Jvb2xlYW59IFNjb3BlI2RpcmVjdENhbGxUb0V2YWxTY29wZVxuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5kaXJlY3RDYWxsVG9FdmFsU2NvcGUgPSBmYWxzZTtcbiAgICAgICAgIC8qKlxuICAgICAgICAgKiBAbWVtYmVyIHtib29sZWFufSBTY29wZSN0aGlzRm91bmRcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMudGhpc0ZvdW5kID0gZmFsc2U7XG5cbiAgICAgICAgdGhpcy5fX2xlZnQgPSBbXTtcblxuICAgICAgICAgLyoqXG4gICAgICAgICAqIFJlZmVyZW5jZSB0byB0aGUgcGFyZW50IHtAbGluayBTY29wZXxzY29wZX0uXG4gICAgICAgICAqIEBtZW1iZXIge1Njb3BlfSBTY29wZSN1cHBlclxuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy51cHBlciA9IHVwcGVyU2NvcGU7XG4gICAgICAgICAvKipcbiAgICAgICAgICogV2hldGhlciAndXNlIHN0cmljdCcgaXMgaW4gZWZmZWN0IGluIHRoaXMgc2NvcGUuXG4gICAgICAgICAqIEBtZW1iZXIge2Jvb2xlYW59IFNjb3BlI2lzU3RyaWN0XG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLmlzU3RyaWN0ID0gaXNTdHJpY3RTY29wZSh0aGlzLCBibG9jaywgaXNNZXRob2REZWZpbml0aW9uLCBzY29wZU1hbmFnZXIuX191c2VEaXJlY3RpdmUoKSk7XG5cbiAgICAgICAgIC8qKlxuICAgICAgICAgKiBMaXN0IG9mIG5lc3RlZCB7QGxpbmsgU2NvcGV9cy5cbiAgICAgICAgICogQG1lbWJlciB7U2NvcGVbXX0gU2NvcGUjY2hpbGRTY29wZXNcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMuY2hpbGRTY29wZXMgPSBbXTtcbiAgICAgICAgaWYgKHRoaXMudXBwZXIpIHtcbiAgICAgICAgICAgIHRoaXMudXBwZXIuY2hpbGRTY29wZXMucHVzaCh0aGlzKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJlZ2lzdGVyU2NvcGUoc2NvcGVNYW5hZ2VyLCB0aGlzKTtcbiAgICB9XG5cbiAgICBfX3Nob3VsZFN0YXRpY2FsbHlDbG9zZShzY29wZU1hbmFnZXIpIHtcbiAgICAgICAgcmV0dXJuICghdGhpcy5keW5hbWljIHx8IHNjb3BlTWFuYWdlci5fX2lzT3B0aW1pc3RpYygpKTtcbiAgICB9XG5cbiAgICBfX3Nob3VsZFN0YXRpY2FsbHlDbG9zZUZvckdsb2JhbChyZWYpIHtcbiAgICAgICAgLy8gT24gZ2xvYmFsIHNjb3BlLCBsZXQvY29uc3QvY2xhc3MgZGVjbGFyYXRpb25zIHNob3VsZCBiZSByZXNvbHZlZCBzdGF0aWNhbGx5LlxuICAgICAgICB2YXIgbmFtZSA9IHJlZi5pZGVudGlmaWVyLm5hbWU7XG4gICAgICAgIGlmICghdGhpcy5zZXQuaGFzKG5hbWUpKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgdmFyaWFibGUgPSB0aGlzLnNldC5nZXQobmFtZSk7XG4gICAgICAgIHZhciBkZWZzID0gdmFyaWFibGUuZGVmcztcbiAgICAgICAgcmV0dXJuIGRlZnMubGVuZ3RoID4gMCAmJiBkZWZzLmV2ZXJ5KHNob3VsZEJlU3RhdGljYWxseSk7XG4gICAgfVxuXG4gICAgX19zdGF0aWNDbG9zZVJlZihyZWYpIHtcbiAgICAgICAgaWYgKCF0aGlzLl9fcmVzb2x2ZShyZWYpKSB7XG4gICAgICAgICAgICB0aGlzLl9fZGVsZWdhdGVUb1VwcGVyU2NvcGUocmVmKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIF9fZHluYW1pY0Nsb3NlUmVmKHJlZikge1xuICAgICAgICAvLyBub3RpZnkgYWxsIG5hbWVzIGFyZSB0aHJvdWdoIHRvIGdsb2JhbFxuICAgICAgICBsZXQgY3VycmVudCA9IHRoaXM7XG4gICAgICAgIGRvIHtcbiAgICAgICAgICAgIGN1cnJlbnQudGhyb3VnaC5wdXNoKHJlZik7XG4gICAgICAgICAgICBjdXJyZW50ID0gY3VycmVudC51cHBlcjtcbiAgICAgICAgfSB3aGlsZSAoY3VycmVudCk7XG4gICAgfVxuXG4gICAgX19nbG9iYWxDbG9zZVJlZihyZWYpIHtcbiAgICAgICAgLy8gbGV0L2NvbnN0L2NsYXNzIGRlY2xhcmF0aW9ucyBzaG91bGQgYmUgcmVzb2x2ZWQgc3RhdGljYWxseS5cbiAgICAgICAgLy8gb3RoZXJzIHNob3VsZCBiZSByZXNvbHZlZCBkeW5hbWljYWxseS5cbiAgICAgICAgaWYgKHRoaXMuX19zaG91bGRTdGF0aWNhbGx5Q2xvc2VGb3JHbG9iYWwocmVmKSkge1xuICAgICAgICAgICAgdGhpcy5fX3N0YXRpY0Nsb3NlUmVmKHJlZik7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLl9fZHluYW1pY0Nsb3NlUmVmKHJlZik7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBfX2Nsb3NlKHNjb3BlTWFuYWdlcikge1xuICAgICAgICB2YXIgY2xvc2VSZWY7XG4gICAgICAgIGlmICh0aGlzLl9fc2hvdWxkU3RhdGljYWxseUNsb3NlKHNjb3BlTWFuYWdlcikpIHtcbiAgICAgICAgICAgIGNsb3NlUmVmID0gdGhpcy5fX3N0YXRpY0Nsb3NlUmVmO1xuICAgICAgICB9IGVsc2UgaWYgKHRoaXMudHlwZSAhPT0gJ2dsb2JhbCcpIHtcbiAgICAgICAgICAgIGNsb3NlUmVmID0gdGhpcy5fX2R5bmFtaWNDbG9zZVJlZjtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNsb3NlUmVmID0gdGhpcy5fX2dsb2JhbENsb3NlUmVmO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gVHJ5IFJlc29sdmluZyBhbGwgcmVmZXJlbmNlcyBpbiB0aGlzIHNjb3BlLlxuICAgICAgICBmb3IgKGxldCBpID0gMCwgaXogPSB0aGlzLl9fbGVmdC5sZW5ndGg7IGkgPCBpejsgKytpKSB7XG4gICAgICAgICAgICBsZXQgcmVmID0gdGhpcy5fX2xlZnRbaV07XG4gICAgICAgICAgICBjbG9zZVJlZi5jYWxsKHRoaXMsIHJlZik7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5fX2xlZnQgPSBudWxsO1xuXG4gICAgICAgIHJldHVybiB0aGlzLnVwcGVyO1xuICAgIH1cblxuICAgIF9fcmVzb2x2ZShyZWYpIHtcbiAgICAgICAgdmFyIHZhcmlhYmxlLCBuYW1lO1xuICAgICAgICBuYW1lID0gcmVmLmlkZW50aWZpZXIubmFtZTtcbiAgICAgICAgaWYgKHRoaXMuc2V0LmhhcyhuYW1lKSkge1xuICAgICAgICAgICAgdmFyaWFibGUgPSB0aGlzLnNldC5nZXQobmFtZSk7XG4gICAgICAgICAgICB2YXJpYWJsZS5yZWZlcmVuY2VzLnB1c2gocmVmKTtcbiAgICAgICAgICAgIHZhcmlhYmxlLnN0YWNrID0gdmFyaWFibGUuc3RhY2sgJiYgcmVmLmZyb20udmFyaWFibGVTY29wZSA9PT0gdGhpcy52YXJpYWJsZVNjb3BlO1xuICAgICAgICAgICAgaWYgKHJlZi50YWludGVkKSB7XG4gICAgICAgICAgICAgICAgdmFyaWFibGUudGFpbnRlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgdGhpcy50YWludHMuc2V0KHZhcmlhYmxlLm5hbWUsIHRydWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVmLnJlc29sdmVkID0gdmFyaWFibGU7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuXG4gICAgX19kZWxlZ2F0ZVRvVXBwZXJTY29wZShyZWYpIHtcbiAgICAgICAgaWYgKHRoaXMudXBwZXIpIHtcbiAgICAgICAgICAgIHRoaXMudXBwZXIuX19sZWZ0LnB1c2gocmVmKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnRocm91Z2gucHVzaChyZWYpO1xuICAgIH1cblxuICAgIF9fZGVmaW5lR2VuZXJpYyhuYW1lLCBzZXQsIHZhcmlhYmxlcywgbm9kZSwgZGVmKSB7XG4gICAgICAgIHZhciB2YXJpYWJsZTtcblxuICAgICAgICB2YXJpYWJsZSA9IHNldC5nZXQobmFtZSk7XG4gICAgICAgIGlmICghdmFyaWFibGUpIHtcbiAgICAgICAgICAgIHZhcmlhYmxlID0gbmV3IFZhcmlhYmxlKG5hbWUsIHRoaXMpO1xuICAgICAgICAgICAgc2V0LnNldChuYW1lLCB2YXJpYWJsZSk7XG4gICAgICAgICAgICB2YXJpYWJsZXMucHVzaCh2YXJpYWJsZSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoZGVmKSB7XG4gICAgICAgICAgICB2YXJpYWJsZS5kZWZzLnB1c2goZGVmKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAobm9kZSkge1xuICAgICAgICAgICAgdmFyaWFibGUuaWRlbnRpZmllcnMucHVzaChub2RlKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIF9fZGVmaW5lKG5vZGUsIGRlZikge1xuICAgICAgICBpZiAobm9kZSAmJiBub2RlLnR5cGUgPT09IFN5bnRheC5JZGVudGlmaWVyKSB7XG4gICAgICAgICAgICB0aGlzLl9fZGVmaW5lR2VuZXJpYyhcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5uYW1lLFxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNldCxcbiAgICAgICAgICAgICAgICAgICAgdGhpcy52YXJpYWJsZXMsXG4gICAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICAgIGRlZik7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBfX3JlZmVyZW5jaW5nKG5vZGUsIGFzc2lnbiwgd3JpdGVFeHByLCBtYXliZUltcGxpY2l0R2xvYmFsLCBwYXJ0aWFsLCBpbml0KSB7XG4gICAgICAgIC8vIGJlY2F1c2UgQXJyYXkgZWxlbWVudCBtYXkgYmUgbnVsbFxuICAgICAgICBpZiAoIW5vZGUgfHwgbm9kZS50eXBlICE9PSBTeW50YXguSWRlbnRpZmllcikge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gU3BlY2lhbGx5IGhhbmRsZSBsaWtlIGB0aGlzYC5cbiAgICAgICAgaWYgKG5vZGUubmFtZSA9PT0gJ3N1cGVyJykge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgbGV0IHJlZiA9IG5ldyBSZWZlcmVuY2Uobm9kZSwgdGhpcywgYXNzaWduIHx8IFJlZmVyZW5jZS5SRUFELCB3cml0ZUV4cHIsIG1heWJlSW1wbGljaXRHbG9iYWwsICEhcGFydGlhbCwgISFpbml0KTtcbiAgICAgICAgdGhpcy5yZWZlcmVuY2VzLnB1c2gocmVmKTtcbiAgICAgICAgdGhpcy5fX2xlZnQucHVzaChyZWYpO1xuICAgIH1cblxuICAgIF9fZGV0ZWN0RXZhbCgpIHtcbiAgICAgICAgdmFyIGN1cnJlbnQ7XG4gICAgICAgIGN1cnJlbnQgPSB0aGlzO1xuICAgICAgICB0aGlzLmRpcmVjdENhbGxUb0V2YWxTY29wZSA9IHRydWU7XG4gICAgICAgIGRvIHtcbiAgICAgICAgICAgIGN1cnJlbnQuZHluYW1pYyA9IHRydWU7XG4gICAgICAgICAgICBjdXJyZW50ID0gY3VycmVudC51cHBlcjtcbiAgICAgICAgfSB3aGlsZSAoY3VycmVudCk7XG4gICAgfVxuXG4gICAgX19kZXRlY3RUaGlzKCkge1xuICAgICAgICB0aGlzLnRoaXNGb3VuZCA9IHRydWU7XG4gICAgfVxuXG4gICAgX19pc0Nsb3NlZCgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX19sZWZ0ID09PSBudWxsO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIHJldHVybnMgcmVzb2x2ZWQge1JlZmVyZW5jZX1cbiAgICAgKiBAbWV0aG9kIFNjb3BlI3Jlc29sdmVcbiAgICAgKiBAcGFyYW0ge0VzcHJpbWEuSWRlbnRpZmllcn0gaWRlbnQgLSBpZGVudGlmaWVyIHRvIGJlIHJlc29sdmVkLlxuICAgICAqIEByZXR1cm4ge1JlZmVyZW5jZX1cbiAgICAgKi9cbiAgICByZXNvbHZlKGlkZW50KSB7XG4gICAgICAgIHZhciByZWYsIGksIGl6O1xuICAgICAgICBhc3NlcnQodGhpcy5fX2lzQ2xvc2VkKCksICdTY29wZSBzaG91bGQgYmUgY2xvc2VkLicpO1xuICAgICAgICBhc3NlcnQoaWRlbnQudHlwZSA9PT0gU3ludGF4LklkZW50aWZpZXIsICdUYXJnZXQgc2hvdWxkIGJlIGlkZW50aWZpZXIuJyk7XG4gICAgICAgIGZvciAoaSA9IDAsIGl6ID0gdGhpcy5yZWZlcmVuY2VzLmxlbmd0aDsgaSA8IGl6OyArK2kpIHtcbiAgICAgICAgICAgIHJlZiA9IHRoaXMucmVmZXJlbmNlc1tpXTtcbiAgICAgICAgICAgIGlmIChyZWYuaWRlbnRpZmllciA9PT0gaWRlbnQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVmO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBudWxsO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIHJldHVybnMgdGhpcyBzY29wZSBpcyBzdGF0aWNcbiAgICAgKiBAbWV0aG9kIFNjb3BlI2lzU3RhdGljXG4gICAgICogQHJldHVybiB7Ym9vbGVhbn1cbiAgICAgKi9cbiAgICBpc1N0YXRpYygpIHtcbiAgICAgICAgcmV0dXJuICF0aGlzLmR5bmFtaWM7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogcmV0dXJucyB0aGlzIHNjb3BlIGhhcyBtYXRlcmlhbGl6ZWQgYXJndW1lbnRzXG4gICAgICogQG1ldGhvZCBTY29wZSNpc0FyZ3VtZW50c01hdGVyaWFsaXplZFxuICAgICAqIEByZXR1cm4ge2Jvb2xlYW59XG4gICAgICovXG4gICAgaXNBcmd1bWVudHNNYXRlcmlhbGl6ZWQoKSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIHJldHVybnMgdGhpcyBzY29wZSBoYXMgbWF0ZXJpYWxpemVkIGB0aGlzYCByZWZlcmVuY2VcbiAgICAgKiBAbWV0aG9kIFNjb3BlI2lzVGhpc01hdGVyaWFsaXplZFxuICAgICAqIEByZXR1cm4ge2Jvb2xlYW59XG4gICAgICovXG4gICAgaXNUaGlzTWF0ZXJpYWxpemVkKCkge1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9XG5cbiAgICBpc1VzZWROYW1lKG5hbWUpIHtcbiAgICAgICAgaWYgKHRoaXMuc2V0LmhhcyhuYW1lKSkge1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cbiAgICAgICAgZm9yICh2YXIgaSA9IDAsIGl6ID0gdGhpcy50aHJvdWdoLmxlbmd0aDsgaSA8IGl6OyArK2kpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLnRocm91Z2hbaV0uaWRlbnRpZmllci5uYW1lID09PSBuYW1lKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbn1cblxuZXhwb3J0IGNsYXNzIEdsb2JhbFNjb3BlIGV4dGVuZHMgU2NvcGUge1xuICAgIGNvbnN0cnVjdG9yKHNjb3BlTWFuYWdlciwgYmxvY2spIHtcbiAgICAgICAgc3VwZXIoc2NvcGVNYW5hZ2VyLCAnZ2xvYmFsJywgbnVsbCwgYmxvY2ssIGZhbHNlKTtcbiAgICAgICAgdGhpcy5pbXBsaWNpdCA9IHtcbiAgICAgICAgICAgIHNldDogbmV3IE1hcCgpLFxuICAgICAgICAgICAgdmFyaWFibGVzOiBbXSxcbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgKiBMaXN0IG9mIHtAbGluayBSZWZlcmVuY2V9cyB0aGF0IGFyZSBsZWZ0IHRvIGJlIHJlc29sdmVkIChpLmUuIHdoaWNoXG4gICAgICAgICAgICAqIG5lZWQgdG8gYmUgbGlua2VkIHRvIHRoZSB2YXJpYWJsZSB0aGV5IHJlZmVyIHRvKS5cbiAgICAgICAgICAgICogQG1lbWJlciB7UmVmZXJlbmNlW119IFNjb3BlI2ltcGxpY2l0I2xlZnRcbiAgICAgICAgICAgICovXG4gICAgICAgICAgICBsZWZ0OiBbXVxuICAgICAgICB9O1xuICAgIH1cblxuICAgIF9fY2xvc2Uoc2NvcGVNYW5hZ2VyKSB7XG4gICAgICAgIGxldCBpbXBsaWNpdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMCwgaXogPSB0aGlzLl9fbGVmdC5sZW5ndGg7IGkgPCBpejsgKytpKSB7XG4gICAgICAgICAgICBsZXQgcmVmID0gdGhpcy5fX2xlZnRbaV07XG4gICAgICAgICAgICBpZiAocmVmLl9fbWF5YmVJbXBsaWNpdEdsb2JhbCAmJiAhdGhpcy5zZXQuaGFzKHJlZi5pZGVudGlmaWVyLm5hbWUpKSB7XG4gICAgICAgICAgICAgICAgaW1wbGljaXQucHVzaChyZWYuX19tYXliZUltcGxpY2l0R2xvYmFsKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIGNyZWF0ZSBhbiBpbXBsaWNpdCBnbG9iYWwgdmFyaWFibGUgZnJvbSBhc3NpZ25tZW50IGV4cHJlc3Npb25cbiAgICAgICAgZm9yIChsZXQgaSA9IDAsIGl6ID0gaW1wbGljaXQubGVuZ3RoOyBpIDwgaXo7ICsraSkge1xuICAgICAgICAgICAgbGV0IGluZm8gPSBpbXBsaWNpdFtpXTtcbiAgICAgICAgICAgIHRoaXMuX19kZWZpbmVJbXBsaWNpdChpbmZvLnBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgIG5ldyBEZWZpbml0aW9uKFxuICAgICAgICAgICAgICAgICAgICAgICAgVmFyaWFibGUuSW1wbGljaXRHbG9iYWxWYXJpYWJsZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGluZm8ucGF0dGVybixcbiAgICAgICAgICAgICAgICAgICAgICAgIGluZm8ubm9kZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVsbFxuICAgICAgICAgICAgICAgICAgICApKTtcblxuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5pbXBsaWNpdC5sZWZ0ID0gdGhpcy5fX2xlZnQ7XG5cbiAgICAgICAgcmV0dXJuIHN1cGVyLl9fY2xvc2Uoc2NvcGVNYW5hZ2VyKTtcbiAgICB9XG5cbiAgICBfX2RlZmluZUltcGxpY2l0KG5vZGUsIGRlZikge1xuICAgICAgICBpZiAobm9kZSAmJiBub2RlLnR5cGUgPT09IFN5bnRheC5JZGVudGlmaWVyKSB7XG4gICAgICAgICAgICB0aGlzLl9fZGVmaW5lR2VuZXJpYyhcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5uYW1lLFxuICAgICAgICAgICAgICAgICAgICB0aGlzLmltcGxpY2l0LnNldCxcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5pbXBsaWNpdC52YXJpYWJsZXMsXG4gICAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICAgIGRlZik7XG4gICAgICAgIH1cbiAgICB9XG59XG5cbmV4cG9ydCBjbGFzcyBNb2R1bGVTY29wZSBleHRlbmRzIFNjb3BlIHtcbiAgICBjb25zdHJ1Y3RvcihzY29wZU1hbmFnZXIsIHVwcGVyU2NvcGUsIGJsb2NrKSB7XG4gICAgICAgIHN1cGVyKHNjb3BlTWFuYWdlciwgJ21vZHVsZScsIHVwcGVyU2NvcGUsIGJsb2NrLCBmYWxzZSk7XG4gICAgfVxufVxuXG5leHBvcnQgY2xhc3MgRnVuY3Rpb25FeHByZXNzaW9uTmFtZVNjb3BlIGV4dGVuZHMgU2NvcGUge1xuICAgIGNvbnN0cnVjdG9yKHNjb3BlTWFuYWdlciwgdXBwZXJTY29wZSwgYmxvY2spIHtcbiAgICAgICAgc3VwZXIoc2NvcGVNYW5hZ2VyLCAnZnVuY3Rpb24tZXhwcmVzc2lvbi1uYW1lJywgdXBwZXJTY29wZSwgYmxvY2ssIGZhbHNlKTtcbiAgICAgICAgdGhpcy5fX2RlZmluZShibG9jay5pZCxcbiAgICAgICAgICAgICAgICBuZXcgRGVmaW5pdGlvbihcbiAgICAgICAgICAgICAgICAgICAgVmFyaWFibGUuRnVuY3Rpb25OYW1lLFxuICAgICAgICAgICAgICAgICAgICBibG9jay5pZCxcbiAgICAgICAgICAgICAgICAgICAgYmxvY2ssXG4gICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgIG51bGxcbiAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgdGhpcy5mdW5jdGlvbkV4cHJlc3Npb25TY29wZSA9IHRydWU7XG4gICAgfVxufVxuXG5leHBvcnQgY2xhc3MgQ2F0Y2hTY29wZSBleHRlbmRzIFNjb3BlIHtcbiAgICBjb25zdHJ1Y3RvcihzY29wZU1hbmFnZXIsIHVwcGVyU2NvcGUsIGJsb2NrKSB7XG4gICAgICAgIHN1cGVyKHNjb3BlTWFuYWdlciwgJ2NhdGNoJywgdXBwZXJTY29wZSwgYmxvY2ssIGZhbHNlKTtcbiAgICB9XG59XG5cbmV4cG9ydCBjbGFzcyBXaXRoU2NvcGUgZXh0ZW5kcyBTY29wZSB7XG4gICAgY29uc3RydWN0b3Ioc2NvcGVNYW5hZ2VyLCB1cHBlclNjb3BlLCBibG9jaykge1xuICAgICAgICBzdXBlcihzY29wZU1hbmFnZXIsICd3aXRoJywgdXBwZXJTY29wZSwgYmxvY2ssIGZhbHNlKTtcbiAgICB9XG5cbiAgICBfX2Nsb3NlKHNjb3BlTWFuYWdlcikge1xuICAgICAgICBpZiAodGhpcy5fX3Nob3VsZFN0YXRpY2FsbHlDbG9zZShzY29wZU1hbmFnZXIpKSB7XG4gICAgICAgICAgICByZXR1cm4gc3VwZXIuX19jbG9zZShzY29wZU1hbmFnZXIpO1xuICAgICAgICB9XG5cbiAgICAgICAgZm9yIChsZXQgaSA9IDAsIGl6ID0gdGhpcy5fX2xlZnQubGVuZ3RoOyBpIDwgaXo7ICsraSkge1xuICAgICAgICAgICAgbGV0IHJlZiA9IHRoaXMuX19sZWZ0W2ldO1xuICAgICAgICAgICAgcmVmLnRhaW50ZWQgPSB0cnVlO1xuICAgICAgICAgICAgdGhpcy5fX2RlbGVnYXRlVG9VcHBlclNjb3BlKHJlZik7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5fX2xlZnQgPSBudWxsO1xuXG4gICAgICAgIHJldHVybiB0aGlzLnVwcGVyO1xuICAgIH1cbn1cblxuZXhwb3J0IGNsYXNzIFREWlNjb3BlIGV4dGVuZHMgU2NvcGUge1xuICAgIGNvbnN0cnVjdG9yKHNjb3BlTWFuYWdlciwgdXBwZXJTY29wZSwgYmxvY2spIHtcbiAgICAgICAgc3VwZXIoc2NvcGVNYW5hZ2VyLCAnVERaJywgdXBwZXJTY29wZSwgYmxvY2ssIGZhbHNlKTtcbiAgICB9XG59XG5cbmV4cG9ydCBjbGFzcyBCbG9ja1Njb3BlIGV4dGVuZHMgU2NvcGUge1xuICAgIGNvbnN0cnVjdG9yKHNjb3BlTWFuYWdlciwgdXBwZXJTY29wZSwgYmxvY2spIHtcbiAgICAgICAgc3VwZXIoc2NvcGVNYW5hZ2VyLCAnYmxvY2snLCB1cHBlclNjb3BlLCBibG9jaywgZmFsc2UpO1xuICAgIH1cbn1cblxuZXhwb3J0IGNsYXNzIFN3aXRjaFNjb3BlIGV4dGVuZHMgU2NvcGUge1xuICAgIGNvbnN0cnVjdG9yKHNjb3BlTWFuYWdlciwgdXBwZXJTY29wZSwgYmxvY2spIHtcbiAgICAgICAgc3VwZXIoc2NvcGVNYW5hZ2VyLCAnc3dpdGNoJywgdXBwZXJTY29wZSwgYmxvY2ssIGZhbHNlKTtcbiAgICB9XG59XG5cbmV4cG9ydCBjbGFzcyBGdW5jdGlvblNjb3BlIGV4dGVuZHMgU2NvcGUge1xuICAgIGNvbnN0cnVjdG9yKHNjb3BlTWFuYWdlciwgdXBwZXJTY29wZSwgYmxvY2ssIGlzTWV0aG9kRGVmaW5pdGlvbikge1xuICAgICAgICBzdXBlcihzY29wZU1hbmFnZXIsICdmdW5jdGlvbicsIHVwcGVyU2NvcGUsIGJsb2NrLCBpc01ldGhvZERlZmluaXRpb24pO1xuXG4gICAgICAgIC8vIHNlY3Rpb24gOS4yLjEzLCBGdW5jdGlvbkRlY2xhcmF0aW9uSW5zdGFudGlhdGlvbi5cbiAgICAgICAgLy8gTk9URSBBcnJvdyBmdW5jdGlvbnMgbmV2ZXIgaGF2ZSBhbiBhcmd1bWVudHMgb2JqZWN0cy5cbiAgICAgICAgaWYgKHRoaXMuYmxvY2sudHlwZSAhPT0gU3ludGF4LkFycm93RnVuY3Rpb25FeHByZXNzaW9uKSB7XG4gICAgICAgICAgICB0aGlzLl9fZGVmaW5lQXJndW1lbnRzKCk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBpc0FyZ3VtZW50c01hdGVyaWFsaXplZCgpIHtcbiAgICAgICAgLy8gVE9ETyhDb25zdGVsbGF0aW9uKVxuICAgICAgICAvLyBXZSBjYW4gbW9yZSBhZ2dyZXNzaXZlIG9uIHRoaXMgY29uZGl0aW9uIGxpa2UgdGhpcy5cbiAgICAgICAgLy9cbiAgICAgICAgLy8gZnVuY3Rpb24gdCgpIHtcbiAgICAgICAgLy8gICAgIC8vIGFyZ3VtZW50cyBvZiB0IGlzIGFsd2F5cyBoaWRkZW4uXG4gICAgICAgIC8vICAgICBmdW5jdGlvbiBhcmd1bWVudHMoKSB7XG4gICAgICAgIC8vICAgICB9XG4gICAgICAgIC8vIH1cbiAgICAgICAgaWYgKHRoaXMuYmxvY2sudHlwZSA9PT0gU3ludGF4LkFycm93RnVuY3Rpb25FeHByZXNzaW9uKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIXRoaXMuaXNTdGF0aWMoKSkge1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICBsZXQgdmFyaWFibGUgPSB0aGlzLnNldC5nZXQoJ2FyZ3VtZW50cycpO1xuICAgICAgICBhc3NlcnQodmFyaWFibGUsICdBbHdheXMgaGF2ZSBhcmd1bWVudHMgdmFyaWFibGUuJyk7XG4gICAgICAgIHJldHVybiB2YXJpYWJsZS50YWludGVkIHx8IHZhcmlhYmxlLnJlZmVyZW5jZXMubGVuZ3RoICAhPT0gMDtcbiAgICB9XG5cbiAgICBpc1RoaXNNYXRlcmlhbGl6ZWQoKSB7XG4gICAgICAgIGlmICghdGhpcy5pc1N0YXRpYygpKSB7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy50aGlzRm91bmQ7XG4gICAgfVxuXG4gICAgX19kZWZpbmVBcmd1bWVudHMoKSB7XG4gICAgICAgIHRoaXMuX19kZWZpbmVHZW5lcmljKFxuICAgICAgICAgICAgICAgICdhcmd1bWVudHMnLFxuICAgICAgICAgICAgICAgIHRoaXMuc2V0LFxuICAgICAgICAgICAgICAgIHRoaXMudmFyaWFibGVzLFxuICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgbnVsbCk7XG4gICAgICAgIHRoaXMudGFpbnRzLnNldCgnYXJndW1lbnRzJywgdHJ1ZSk7XG4gICAgfVxufVxuXG5leHBvcnQgY2xhc3MgRm9yU2NvcGUgZXh0ZW5kcyBTY29wZSB7XG4gICAgY29uc3RydWN0b3Ioc2NvcGVNYW5hZ2VyLCB1cHBlclNjb3BlLCBibG9jaykge1xuICAgICAgICBzdXBlcihzY29wZU1hbmFnZXIsICdmb3InLCB1cHBlclNjb3BlLCBibG9jaywgZmFsc2UpO1xuICAgIH1cbn1cblxuZXhwb3J0IGNsYXNzIENsYXNzU2NvcGUgZXh0ZW5kcyBTY29wZSB7XG4gICAgY29uc3RydWN0b3Ioc2NvcGVNYW5hZ2VyLCB1cHBlclNjb3BlLCBibG9jaykge1xuICAgICAgICBzdXBlcihzY29wZU1hbmFnZXIsICdjbGFzcycsIHVwcGVyU2NvcGUsIGJsb2NrLCBmYWxzZSk7XG4gICAgfVxufVxuXG4vKiB2aW06IHNldCBzdz00IHRzPTQgZXQgdHc9ODAgOiAqL1xuIl0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9
      \ No newline at end of file
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjb3BlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQXdCQTs7QUFDQTs7OztBQUVBOzs7O0FBQ0E7Ozs7QUFDQTs7OztBQUNBOzs7Ozs7Ozs7Ozs7QUFFQSxTQUFTLGFBQVQsQ0FBdUIsS0FBdkIsRUFBOEIsS0FBOUIsRUFBcUMsa0JBQXJDLEVBQXlELFlBQXpELEVBQXVFO0FBQ25FLFFBQUksSUFBSixFQUFVLENBQVYsRUFBYSxFQUFiLEVBQWlCLElBQWpCLEVBQXVCLElBQXZCOzs7QUFEbUUsUUFJL0QsTUFBTSxLQUFOLElBQWUsTUFBTSxLQUFOLENBQVksUUFBWixFQUFzQjtBQUNyQyxlQUFPLElBQVAsQ0FEcUM7S0FBekM7OztBQUptRSxRQVMvRCxNQUFNLElBQU4sS0FBZSxtQkFBTyx1QkFBUCxFQUFnQztBQUMvQyxlQUFPLElBQVAsQ0FEK0M7S0FBbkQ7O0FBSUEsUUFBSSxrQkFBSixFQUF3QjtBQUNwQixlQUFPLElBQVAsQ0FEb0I7S0FBeEI7O0FBSUEsUUFBSSxNQUFNLElBQU4sS0FBZSxPQUFmLElBQTBCLE1BQU0sSUFBTixLQUFlLFFBQWYsRUFBeUI7QUFDbkQsZUFBTyxJQUFQLENBRG1EO0tBQXZEOztBQUlBLFFBQUksTUFBTSxJQUFOLEtBQWUsT0FBZixJQUEwQixNQUFNLElBQU4sS0FBZSxRQUFmLEVBQXlCO0FBQ25ELGVBQU8sS0FBUCxDQURtRDtLQUF2RDs7QUFJQSxRQUFJLE1BQU0sSUFBTixLQUFlLFVBQWYsRUFBMkI7QUFDM0IsWUFBSSxNQUFNLElBQU4sS0FBZSxtQkFBTyxPQUFQLEVBQWdCO0FBQy9CLG1CQUFPLEtBQVAsQ0FEK0I7U0FBbkMsTUFFTztBQUNILG1CQUFPLE1BQU0sSUFBTixDQURKO1NBRlA7S0FESixNQU1PLElBQUksTUFBTSxJQUFOLEtBQWUsUUFBZixFQUF5QjtBQUNoQyxlQUFPLEtBQVAsQ0FEZ0M7S0FBN0IsTUFFQTtBQUNILGVBQU8sS0FBUCxDQURHO0tBRkE7OztBQS9CNEQsUUFzQy9ELFlBQUosRUFBa0I7QUFDZCxhQUFLLElBQUksQ0FBSixFQUFPLEtBQUssS0FBSyxJQUFMLENBQVUsTUFBVixFQUFrQixJQUFJLEVBQUosRUFBUSxFQUFFLENBQUYsRUFBSztBQUM1QyxtQkFBTyxLQUFLLElBQUwsQ0FBVSxDQUFWLENBQVAsQ0FENEM7QUFFNUMsZ0JBQUksS0FBSyxJQUFMLEtBQWMsbUJBQU8sa0JBQVAsRUFBMkI7QUFDekMsc0JBRHlDO2FBQTdDO0FBR0EsZ0JBQUksS0FBSyxHQUFMLEtBQWEsY0FBYixJQUErQixLQUFLLEdBQUwsS0FBYSxnQkFBYixFQUErQjtBQUM5RCx1QkFBTyxJQUFQLENBRDhEO2FBQWxFO1NBTEo7S0FESixNQVVPO0FBQ0gsYUFBSyxJQUFJLENBQUosRUFBTyxLQUFLLEtBQUssSUFBTCxDQUFVLE1BQVYsRUFBa0IsSUFBSSxFQUFKLEVBQVEsRUFBRSxDQUFGLEVBQUs7QUFDNUMsbUJBQU8sS0FBSyxJQUFMLENBQVUsQ0FBVixDQUFQLENBRDRDO0FBRTVDLGdCQUFJLEtBQUssSUFBTCxLQUFjLG1CQUFPLG1CQUFQLEVBQTRCO0FBQzFDLHNCQUQwQzthQUE5QztBQUdBLG1CQUFPLEtBQUssVUFBTCxDQUxxQztBQU01QyxnQkFBSSxLQUFLLElBQUwsS0FBYyxtQkFBTyxPQUFQLElBQWtCLE9BQU8sS0FBSyxLQUFMLEtBQWUsUUFBdEIsRUFBZ0M7QUFDaEUsc0JBRGdFO2FBQXBFO0FBR0EsZ0JBQUksS0FBSyxHQUFMLElBQVksSUFBWixFQUFrQjtBQUNsQixvQkFBSSxLQUFLLEdBQUwsS0FBYSxjQUFiLElBQStCLEtBQUssR0FBTCxLQUFhLGdCQUFiLEVBQStCO0FBQzlELDJCQUFPLElBQVAsQ0FEOEQ7aUJBQWxFO2FBREosTUFJTztBQUNILG9CQUFJLEtBQUssS0FBTCxLQUFlLFlBQWYsRUFBNkI7QUFDN0IsMkJBQU8sSUFBUCxDQUQ2QjtpQkFBakM7YUFMSjtTQVRKO0tBWEo7QUErQkEsV0FBTyxLQUFQLENBckVtRTtDQUF2RTs7QUF3RUEsU0FBUyxhQUFULENBQXVCLFlBQXZCLEVBQXFDLEtBQXJDLEVBQTRDO0FBQ3hDLFFBQUksTUFBSixDQUR3Qzs7QUFHeEMsaUJBQWEsTUFBYixDQUFvQixJQUFwQixDQUF5QixLQUF6QixFQUh3Qzs7QUFLeEMsYUFBUyxhQUFhLGFBQWIsQ0FBMkIsR0FBM0IsQ0FBK0IsTUFBTSxLQUFOLENBQXhDLENBTHdDO0FBTXhDLFFBQUksTUFBSixFQUFZO0FBQ1IsZUFBTyxJQUFQLENBQVksS0FBWixFQURRO0tBQVosTUFFTztBQUNILHFCQUFhLGFBQWIsQ0FBMkIsR0FBM0IsQ0FBK0IsTUFBTSxLQUFOLEVBQWEsQ0FBRSxLQUFGLENBQTVDLEVBREc7S0FGUDtDQU5KOztBQWFBLFNBQVMsa0JBQVQsQ0FBNEIsR0FBNUIsRUFBaUM7QUFDN0IsV0FDSSxHQUFDLENBQUksSUFBSixLQUFhLG1CQUFTLFNBQVQsSUFDYixJQUFJLElBQUosS0FBYSxtQkFBUyxRQUFULElBQXFCLElBQUksTUFBSixDQUFXLElBQVgsS0FBb0IsS0FBcEIsQ0FIVjtDQUFqQzs7Ozs7O0lBVXFCO0FBQ2pCLGFBRGlCLEtBQ2pCLENBQVksWUFBWixFQUEwQixJQUExQixFQUFnQyxVQUFoQyxFQUE0QyxLQUE1QyxFQUFtRCxrQkFBbkQsRUFBdUU7OEJBRHRELE9BQ3NEOzs7Ozs7QUFLbkUsYUFBSyxJQUFMLEdBQVksSUFBWjs7Ozs7O0FBTG1FLFlBV25FLENBQUssR0FBTCxHQUFXLHNCQUFYOzs7OztBQVhtRSxZQWdCbkUsQ0FBSyxNQUFMLEdBQWMsc0JBQWQ7Ozs7Ozs7Ozs7O0FBaEJtRSxZQTJCbkUsQ0FBSyxPQUFMLEdBQWUsS0FBSyxJQUFMLEtBQWMsUUFBZCxJQUEwQixLQUFLLElBQUwsS0FBYyxNQUFkOzs7OztBQTNCMEIsWUFnQ25FLENBQUssS0FBTCxHQUFhLEtBQWI7Ozs7O0FBaENtRSxZQXFDbkUsQ0FBSyxPQUFMLEdBQWUsRUFBZjs7Ozs7OztBQXJDbUUsWUE0Q25FLENBQUssU0FBTCxHQUFpQixFQUFqQjs7Ozs7Ozs7OztBQTVDbUUsWUFzRG5FLENBQUssVUFBTCxHQUFrQixFQUFsQjs7Ozs7Ozs7QUF0RG1FLFlBOERuRSxDQUFLLGFBQUwsR0FDSSxJQUFDLENBQUssSUFBTCxLQUFjLFFBQWQsSUFBMEIsS0FBSyxJQUFMLEtBQWMsVUFBZCxJQUE0QixLQUFLLElBQUwsS0FBYyxRQUFkLEdBQTBCLElBQWpGLEdBQXdGLFdBQVcsYUFBWDs7Ozs7QUEvRHpCLFlBb0VuRSxDQUFLLHVCQUFMLEdBQStCLEtBQS9COzs7OztBQXBFbUUsWUF5RW5FLENBQUsscUJBQUwsR0FBNkIsS0FBN0I7Ozs7QUF6RW1FLFlBNkVuRSxDQUFLLFNBQUwsR0FBaUIsS0FBakIsQ0E3RW1FOztBQStFbkUsYUFBSyxNQUFMLEdBQWMsRUFBZDs7Ozs7O0FBL0VtRSxZQXFGbkUsQ0FBSyxLQUFMLEdBQWEsVUFBYjs7Ozs7QUFyRm1FLFlBMEZuRSxDQUFLLFFBQUwsR0FBZ0IsY0FBYyxJQUFkLEVBQW9CLEtBQXBCLEVBQTJCLGtCQUEzQixFQUErQyxhQUFhLGNBQWIsRUFBL0MsQ0FBaEI7Ozs7OztBQTFGbUUsWUFnR25FLENBQUssV0FBTCxHQUFtQixFQUFuQixDQWhHbUU7QUFpR25FLFlBQUksS0FBSyxLQUFMLEVBQVk7QUFDWixpQkFBSyxLQUFMLENBQVcsV0FBWCxDQUF1QixJQUF2QixDQUE0QixJQUE1QixFQURZO1NBQWhCOztBQUlBLGFBQUssbUJBQUwsR0FBMkIsYUFBYSxtQkFBYixDQXJHd0M7O0FBdUduRSxzQkFBYyxZQUFkLEVBQTRCLElBQTVCLEVBdkdtRTtLQUF2RTs7aUJBRGlCOztnREEyR08sY0FBYztBQUNsQyxtQkFBUSxDQUFDLEtBQUssT0FBTCxJQUFnQixhQUFhLGNBQWIsRUFBakIsQ0FEMEI7Ozs7eURBSUwsS0FBSzs7QUFFbEMsZ0JBQUksT0FBTyxJQUFJLFVBQUosQ0FBZSxJQUFmLENBRnVCO0FBR2xDLGdCQUFJLENBQUMsS0FBSyxHQUFMLENBQVMsR0FBVCxDQUFhLElBQWIsQ0FBRCxFQUFxQjtBQUNyQix1QkFBTyxLQUFQLENBRHFCO2FBQXpCOztBQUlBLGdCQUFJLFdBQVcsS0FBSyxHQUFMLENBQVMsR0FBVCxDQUFhLElBQWIsQ0FBWCxDQVA4QjtBQVFsQyxnQkFBSSxPQUFPLFNBQVMsSUFBVCxDQVJ1QjtBQVNsQyxtQkFBTyxLQUFLLE1BQUwsR0FBYyxDQUFkLElBQW1CLEtBQUssS0FBTCxDQUFXLGtCQUFYLENBQW5CLENBVDJCOzs7O3lDQVlyQixLQUFLO0FBQ2xCLGdCQUFJLENBQUMsS0FBSyxTQUFMLENBQWUsR0FBZixDQUFELEVBQXNCO0FBQ3RCLHFCQUFLLHNCQUFMLENBQTRCLEdBQTVCLEVBRHNCO2FBQTFCOzs7OzBDQUtjLEtBQUs7O0FBRW5CLGdCQUFJLFVBQVUsSUFBVixDQUZlO0FBR25CLGVBQUc7QUFDQyx3QkFBUSxPQUFSLENBQWdCLElBQWhCLENBQXFCLEdBQXJCLEVBREQ7QUFFQywwQkFBVSxRQUFRLEtBQVIsQ0FGWDthQUFILFFBR1MsT0FIVCxFQUhtQjs7Ozt5Q0FTTixLQUFLOzs7QUFHbEIsZ0JBQUksS0FBSyxnQ0FBTCxDQUFzQyxHQUF0QyxDQUFKLEVBQWdEO0FBQzVDLHFCQUFLLGdCQUFMLENBQXNCLEdBQXRCLEVBRDRDO2FBQWhELE1BRU87QUFDSCxxQkFBSyxpQkFBTCxDQUF1QixHQUF2QixFQURHO2FBRlA7Ozs7Z0NBT0ksY0FBYztBQUNsQixnQkFBSSxRQUFKLENBRGtCO0FBRWxCLGdCQUFJLEtBQUssdUJBQUwsQ0FBNkIsWUFBN0IsQ0FBSixFQUFnRDtBQUM1QywyQkFBVyxLQUFLLGdCQUFMLENBRGlDO2FBQWhELE1BRU8sSUFBSSxLQUFLLElBQUwsS0FBYyxRQUFkLEVBQXdCO0FBQy9CLDJCQUFXLEtBQUssaUJBQUwsQ0FEb0I7YUFBNUIsTUFFQTtBQUNILDJCQUFXLEtBQUssZ0JBQUwsQ0FEUjthQUZBOzs7QUFKVyxpQkFXYixJQUFJLElBQUksQ0FBSixFQUFPLEtBQUssS0FBSyxNQUFMLENBQVksTUFBWixFQUFvQixJQUFJLEVBQUosRUFBUSxFQUFFLENBQUYsRUFBSztBQUNsRCxvQkFBSSxNQUFNLEtBQUssTUFBTCxDQUFZLENBQVosQ0FBTixDQUQ4QztBQUVsRCx5QkFBUyxJQUFULENBQWMsSUFBZCxFQUFvQixHQUFwQixFQUZrRDthQUF0RDtBQUlBLGlCQUFLLE1BQUwsR0FBYyxJQUFkLENBZmtCOztBQWlCbEIsbUJBQU8sS0FBSyxLQUFMLENBakJXOzs7O2tDQW9CWixLQUFLO0FBQ1gsZ0JBQUksUUFBSixFQUFjLElBQWQsQ0FEVztBQUVYLG1CQUFPLElBQUksVUFBSixDQUFlLElBQWYsQ0FGSTtBQUdYLGdCQUFJLEtBQUssR0FBTCxDQUFTLEdBQVQsQ0FBYSxJQUFiLENBQUosRUFBd0I7QUFDcEIsMkJBQVcsS0FBSyxHQUFMLENBQVMsR0FBVCxDQUFhLElBQWIsQ0FBWCxDQURvQjtBQUVwQix5QkFBUyxVQUFULENBQW9CLElBQXBCLENBQXlCLEdBQXpCLEVBRm9CO0FBR3BCLHlCQUFTLEtBQVQsR0FBaUIsU0FBUyxLQUFULElBQWtCLElBQUksSUFBSixDQUFTLGFBQVQsS0FBMkIsS0FBSyxhQUFMLENBSDFDO0FBSXBCLG9CQUFJLElBQUksT0FBSixFQUFhO0FBQ2IsNkJBQVMsT0FBVCxHQUFtQixJQUFuQixDQURhO0FBRWIseUJBQUssTUFBTCxDQUFZLEdBQVosQ0FBZ0IsU0FBUyxJQUFULEVBQWUsSUFBL0IsRUFGYTtpQkFBakI7QUFJQSxvQkFBSSxRQUFKLEdBQWUsUUFBZixDQVJvQjtBQVNwQix1QkFBTyxJQUFQLENBVG9CO2FBQXhCO0FBV0EsbUJBQU8sS0FBUCxDQWRXOzs7OytDQWlCUSxLQUFLO0FBQ3hCLGdCQUFJLEtBQUssS0FBTCxFQUFZO0FBQ1oscUJBQUssS0FBTCxDQUFXLE1BQVgsQ0FBa0IsSUFBbEIsQ0FBdUIsR0FBdkIsRUFEWTthQUFoQjtBQUdBLGlCQUFLLE9BQUwsQ0FBYSxJQUFiLENBQWtCLEdBQWxCLEVBSndCOzs7O3FEQU9DLFVBQVUsTUFBTTtBQUN6QyxnQkFBSSxRQUFRLElBQVIsRUFBYztBQUNkLHVCQURjO2FBQWxCOztBQUlBLGdCQUFJLFlBQVksS0FBSyxtQkFBTCxDQUF5QixHQUF6QixDQUE2QixJQUE3QixDQUFaLENBTHFDO0FBTXpDLGdCQUFJLGFBQWEsSUFBYixFQUFtQjtBQUNuQiw0QkFBWSxFQUFaLENBRG1CO0FBRW5CLHFCQUFLLG1CQUFMLENBQXlCLEdBQXpCLENBQTZCLElBQTdCLEVBQW1DLFNBQW5DLEVBRm1CO2FBQXZCO0FBSUEsZ0JBQUksVUFBVSxPQUFWLENBQWtCLFFBQWxCLE1BQWdDLENBQUMsQ0FBRCxFQUFJO0FBQ3BDLDBCQUFVLElBQVYsQ0FBZSxRQUFmLEVBRG9DO2FBQXhDOzs7O3dDQUtZLE1BQU0sS0FBSyxXQUFXLE1BQU0sS0FBSztBQUM3QyxnQkFBSSxRQUFKLENBRDZDOztBQUc3Qyx1QkFBVyxJQUFJLEdBQUosQ0FBUSxJQUFSLENBQVgsQ0FINkM7QUFJN0MsZ0JBQUksQ0FBQyxRQUFELEVBQVc7QUFDWCwyQkFBVyx1QkFBYSxJQUFiLEVBQW1CLElBQW5CLENBQVgsQ0FEVztBQUVYLG9CQUFJLEdBQUosQ0FBUSxJQUFSLEVBQWMsUUFBZCxFQUZXO0FBR1gsMEJBQVUsSUFBVixDQUFlLFFBQWYsRUFIVzthQUFmOztBQU1BLGdCQUFJLEdBQUosRUFBUztBQUNMLHlCQUFTLElBQVQsQ0FBYyxJQUFkLENBQW1CLEdBQW5CLEVBREs7QUFFTCxvQkFBSSxJQUFJLElBQUosS0FBYSxtQkFBUyxHQUFULEVBQWM7QUFDM0IseUJBQUssNEJBQUwsQ0FBa0MsUUFBbEMsRUFBNEMsSUFBSSxJQUFKLENBQTVDLENBRDJCO0FBRTNCLHlCQUFLLDRCQUFMLENBQWtDLFFBQWxDLEVBQTRDLElBQUksTUFBSixDQUE1QyxDQUYyQjtpQkFBL0I7YUFGSjtBQU9BLGdCQUFJLElBQUosRUFBVTtBQUNOLHlCQUFTLFdBQVQsQ0FBcUIsSUFBckIsQ0FBMEIsSUFBMUIsRUFETTthQUFWOzs7O2lDQUtLLE1BQU0sS0FBSztBQUNoQixnQkFBSSxRQUFRLEtBQUssSUFBTCxLQUFjLG1CQUFPLFVBQVAsRUFBbUI7QUFDekMscUJBQUssZUFBTCxDQUNRLEtBQUssSUFBTCxFQUNBLEtBQUssR0FBTCxFQUNBLEtBQUssU0FBTCxFQUNBLElBSlIsRUFLUSxHQUxSLEVBRHlDO2FBQTdDOzs7O3NDQVVVLE1BQU0sUUFBUSxXQUFXLHFCQUFxQixTQUFTLE1BQU07O0FBRXZFLGdCQUFJLENBQUMsSUFBRCxJQUFTLEtBQUssSUFBTCxLQUFjLG1CQUFPLFVBQVAsRUFBbUI7QUFDMUMsdUJBRDBDO2FBQTlDOzs7QUFGdUUsZ0JBT25FLEtBQUssSUFBTCxLQUFjLE9BQWQsRUFBdUI7QUFDdkIsdUJBRHVCO2FBQTNCOztBQUlBLGdCQUFJLE1BQU0sd0JBQWMsSUFBZCxFQUFvQixJQUFwQixFQUEwQixVQUFVLG9CQUFVLElBQVYsRUFBZ0IsU0FBcEQsRUFBK0QsbUJBQS9ELEVBQW9GLENBQUMsQ0FBQyxPQUFELEVBQVUsQ0FBQyxDQUFDLElBQUQsQ0FBdEcsQ0FYbUU7QUFZdkUsaUJBQUssVUFBTCxDQUFnQixJQUFoQixDQUFxQixHQUFyQixFQVp1RTtBQWF2RSxpQkFBSyxNQUFMLENBQVksSUFBWixDQUFpQixHQUFqQixFQWJ1RTs7Ozt1Q0FnQjVEO0FBQ1gsZ0JBQUksT0FBSixDQURXO0FBRVgsc0JBQVUsSUFBVixDQUZXO0FBR1gsaUJBQUsscUJBQUwsR0FBNkIsSUFBN0IsQ0FIVztBQUlYLGVBQUc7QUFDQyx3QkFBUSxPQUFSLEdBQWtCLElBQWxCLENBREQ7QUFFQywwQkFBVSxRQUFRLEtBQVIsQ0FGWDthQUFILFFBR1MsT0FIVCxFQUpXOzs7O3VDQVVBO0FBQ1gsaUJBQUssU0FBTCxHQUFpQixJQUFqQixDQURXOzs7O3FDQUlGO0FBQ1QsbUJBQU8sS0FBSyxNQUFMLEtBQWdCLElBQWhCLENBREU7Ozs7Ozs7Ozs7OztnQ0FVTCxPQUFPO0FBQ1gsZ0JBQUksR0FBSixFQUFTLENBQVQsRUFBWSxFQUFaLENBRFc7QUFFWCxrQ0FBTyxLQUFLLFVBQUwsRUFBUCxFQUEwQix5QkFBMUIsRUFGVztBQUdYLGtDQUFPLE1BQU0sSUFBTixLQUFlLG1CQUFPLFVBQVAsRUFBbUIsOEJBQXpDLEVBSFc7QUFJWCxpQkFBSyxJQUFJLENBQUosRUFBTyxLQUFLLEtBQUssVUFBTCxDQUFnQixNQUFoQixFQUF3QixJQUFJLEVBQUosRUFBUSxFQUFFLENBQUYsRUFBSztBQUNsRCxzQkFBTSxLQUFLLFVBQUwsQ0FBZ0IsQ0FBaEIsQ0FBTixDQURrRDtBQUVsRCxvQkFBSSxJQUFJLFVBQUosS0FBbUIsS0FBbkIsRUFBMEI7QUFDMUIsMkJBQU8sR0FBUCxDQUQwQjtpQkFBOUI7YUFGSjtBQU1BLG1CQUFPLElBQVAsQ0FWVzs7Ozs7Ozs7Ozs7bUNBa0JKO0FBQ1AsbUJBQU8sQ0FBQyxLQUFLLE9BQUwsQ0FERDs7Ozs7Ozs7Ozs7a0RBU2U7QUFDdEIsbUJBQU8sSUFBUCxDQURzQjs7Ozs7Ozs7Ozs7NkNBU0w7QUFDakIsbUJBQU8sSUFBUCxDQURpQjs7OzttQ0FJVixNQUFNO0FBQ2IsZ0JBQUksS0FBSyxHQUFMLENBQVMsR0FBVCxDQUFhLElBQWIsQ0FBSixFQUF3QjtBQUNwQix1QkFBTyxJQUFQLENBRG9CO2FBQXhCO0FBR0EsaUJBQUssSUFBSSxJQUFJLENBQUosRUFBTyxLQUFLLEtBQUssT0FBTCxDQUFhLE1BQWIsRUFBcUIsSUFBSSxFQUFKLEVBQVEsRUFBRSxDQUFGLEVBQUs7QUFDbkQsb0JBQUksS0FBSyxPQUFMLENBQWEsQ0FBYixFQUFnQixVQUFoQixDQUEyQixJQUEzQixLQUFvQyxJQUFwQyxFQUEwQztBQUMxQywyQkFBTyxJQUFQLENBRDBDO2lCQUE5QzthQURKO0FBS0EsbUJBQU8sS0FBUCxDQVRhOzs7O1dBaFVBOzs7OztJQTZVUjs7O0FBQ1QsYUFEUyxXQUNULENBQVksWUFBWixFQUEwQixLQUExQixFQUFpQzs4QkFEeEIsYUFDd0I7OzJFQUR4Qix3QkFFQyxjQUFjLFVBQVUsTUFBTSxPQUFPLFFBRGQ7O0FBRTdCLGNBQUssUUFBTCxHQUFnQjtBQUNaLGlCQUFLLHNCQUFMO0FBQ0EsdUJBQVcsRUFBWDs7Ozs7O0FBTUEsa0JBQU0sRUFBTjtTQVJKLENBRjZCOztLQUFqQzs7aUJBRFM7O2dDQWVELGNBQWM7QUFDbEIsZ0JBQUksV0FBVyxFQUFYLENBRGM7QUFFbEIsaUJBQUssSUFBSSxJQUFJLENBQUosRUFBTyxLQUFLLEtBQUssTUFBTCxDQUFZLE1BQVosRUFBb0IsSUFBSSxFQUFKLEVBQVEsRUFBRSxDQUFGLEVBQUs7QUFDbEQsb0JBQUksTUFBTSxLQUFLLE1BQUwsQ0FBWSxDQUFaLENBQU4sQ0FEOEM7QUFFbEQsb0JBQUksSUFBSSxxQkFBSixJQUE2QixDQUFDLEtBQUssR0FBTCxDQUFTLEdBQVQsQ0FBYSxJQUFJLFVBQUosQ0FBZSxJQUFmLENBQWQsRUFBb0M7QUFDakUsNkJBQVMsSUFBVCxDQUFjLElBQUkscUJBQUosQ0FBZCxDQURpRTtpQkFBckU7YUFGSjs7O0FBRmtCLGlCQVViLElBQUksS0FBSSxDQUFKLEVBQU8sTUFBSyxTQUFTLE1BQVQsRUFBaUIsS0FBSSxHQUFKLEVBQVEsRUFBRSxFQUFGLEVBQUs7QUFDL0Msb0JBQUksT0FBTyxTQUFTLEVBQVQsQ0FBUCxDQUQyQztBQUUvQyxxQkFBSyxnQkFBTCxDQUFzQixLQUFLLE9BQUwsRUFDZCx5QkFDSSxtQkFBUyxzQkFBVCxFQUNBLEtBQUssT0FBTCxFQUNBLEtBQUssSUFBTCxFQUNBLElBSkosRUFLSSxJQUxKLEVBTUksSUFOSixDQURSLEVBRitDO2FBQW5EOztBQWNBLGlCQUFLLFFBQUwsQ0FBYyxJQUFkLEdBQXFCLEtBQUssTUFBTCxDQXhCSDs7QUEwQmxCLDhDQXpDSyxvREF5Q2dCLGFBQXJCLENBMUJrQjs7Ozt5Q0E2QkwsTUFBTSxLQUFLO0FBQ3hCLGdCQUFJLFFBQVEsS0FBSyxJQUFMLEtBQWMsbUJBQU8sVUFBUCxFQUFtQjtBQUN6QyxxQkFBSyxlQUFMLENBQ1EsS0FBSyxJQUFMLEVBQ0EsS0FBSyxRQUFMLENBQWMsR0FBZCxFQUNBLEtBQUssUUFBTCxDQUFjLFNBQWQsRUFDQSxJQUpSLEVBS1EsR0FMUixFQUR5QzthQUE3Qzs7OztXQTdDSztFQUFvQjs7SUF3RHBCOzs7QUFDVCxhQURTLFdBQ1QsQ0FBWSxZQUFaLEVBQTBCLFVBQTFCLEVBQXNDLEtBQXRDLEVBQTZDOzhCQURwQyxhQUNvQzs7c0VBRHBDLHdCQUVDLGNBQWMsVUFBVSxZQUFZLE9BQU8sUUFEUjtLQUE3Qzs7V0FEUztFQUFvQjs7SUFNcEI7OztBQUNULGFBRFMsMkJBQ1QsQ0FBWSxZQUFaLEVBQTBCLFVBQTFCLEVBQXNDLEtBQXRDLEVBQTZDOzhCQURwQyw2QkFDb0M7OzRFQURwQyx3Q0FFQyxjQUFjLDRCQUE0QixZQUFZLE9BQU8sUUFEMUI7O0FBRXpDLGVBQUssUUFBTCxDQUFjLE1BQU0sRUFBTixFQUNOLHlCQUNJLG1CQUFTLFlBQVQsRUFDQSxNQUFNLEVBQU4sRUFDQSxLQUhKLEVBSUksSUFKSixFQUtJLElBTEosRUFNSSxJQU5KLENBRFIsRUFGeUM7QUFXekMsZUFBSyx1QkFBTCxHQUErQixJQUEvQixDQVh5Qzs7S0FBN0M7O1dBRFM7RUFBb0M7O0lBZ0JwQzs7O0FBQ1QsYUFEUyxVQUNULENBQVksWUFBWixFQUEwQixVQUExQixFQUFzQyxLQUF0QyxFQUE2Qzs4QkFEcEMsWUFDb0M7O3NFQURwQyx1QkFFQyxjQUFjLFNBQVMsWUFBWSxPQUFPLFFBRFA7S0FBN0M7O1dBRFM7RUFBbUI7O0lBTW5COzs7QUFDVCxhQURTLFNBQ1QsQ0FBWSxZQUFaLEVBQTBCLFVBQTFCLEVBQXNDLEtBQXRDLEVBQTZDOzhCQURwQyxXQUNvQzs7c0VBRHBDLHNCQUVDLGNBQWMsUUFBUSxZQUFZLE9BQU8sUUFETjtLQUE3Qzs7aUJBRFM7O2dDQUtELGNBQWM7QUFDbEIsZ0JBQUksS0FBSyx1QkFBTCxDQUE2QixZQUE3QixDQUFKLEVBQWdEO0FBQzVDLGtEQVBDLGtEQU9vQixhQUFyQixDQUQ0QzthQUFoRDs7QUFJQSxpQkFBSyxJQUFJLElBQUksQ0FBSixFQUFPLEtBQUssS0FBSyxNQUFMLENBQVksTUFBWixFQUFvQixJQUFJLEVBQUosRUFBUSxFQUFFLENBQUYsRUFBSztBQUNsRCxvQkFBSSxNQUFNLEtBQUssTUFBTCxDQUFZLENBQVosQ0FBTixDQUQ4QztBQUVsRCxvQkFBSSxPQUFKLEdBQWMsSUFBZCxDQUZrRDtBQUdsRCxxQkFBSyxzQkFBTCxDQUE0QixHQUE1QixFQUhrRDthQUF0RDtBQUtBLGlCQUFLLE1BQUwsR0FBYyxJQUFkLENBVmtCOztBQVlsQixtQkFBTyxLQUFLLEtBQUwsQ0FaVzs7OztXQUxiO0VBQWtCOztJQXFCbEI7OztBQUNULGFBRFMsUUFDVCxDQUFZLFlBQVosRUFBMEIsVUFBMUIsRUFBc0MsS0FBdEMsRUFBNkM7OEJBRHBDLFVBQ29DOztzRUFEcEMscUJBRUMsY0FBYyxPQUFPLFlBQVksT0FBTyxRQURMO0tBQTdDOztXQURTO0VBQWlCOztJQU1qQjs7O0FBQ1QsYUFEUyxVQUNULENBQVksWUFBWixFQUEwQixVQUExQixFQUFzQyxLQUF0QyxFQUE2Qzs4QkFEcEMsWUFDb0M7O3NFQURwQyx1QkFFQyxjQUFjLFNBQVMsWUFBWSxPQUFPLFFBRFA7S0FBN0M7O1dBRFM7RUFBbUI7O0lBTW5COzs7QUFDVCxhQURTLFdBQ1QsQ0FBWSxZQUFaLEVBQTBCLFVBQTFCLEVBQXNDLEtBQXRDLEVBQTZDOzhCQURwQyxhQUNvQzs7c0VBRHBDLHdCQUVDLGNBQWMsVUFBVSxZQUFZLE9BQU8sUUFEUjtLQUE3Qzs7V0FEUztFQUFvQjs7SUFNcEI7OztBQUNULGFBRFMsYUFDVCxDQUFZLFlBQVosRUFBMEIsVUFBMUIsRUFBc0MsS0FBdEMsRUFBNkMsa0JBQTdDLEVBQWlFOzhCQUR4RCxlQUN3RDs7Ozs7NEVBRHhELDBCQUVDLGNBQWMsWUFBWSxZQUFZLE9BQU8scUJBRFU7O0FBSzdELFlBQUksT0FBSyxLQUFMLENBQVcsSUFBWCxLQUFvQixtQkFBTyx1QkFBUCxFQUFnQztBQUNwRCxtQkFBSyxpQkFBTCxHQURvRDtTQUF4RDtzQkFMNkQ7S0FBakU7O2lCQURTOztrREFXaUI7Ozs7Ozs7OztBQVN0QixnQkFBSSxLQUFLLEtBQUwsQ0FBVyxJQUFYLEtBQW9CLG1CQUFPLHVCQUFQLEVBQWdDO0FBQ3BELHVCQUFPLEtBQVAsQ0FEb0Q7YUFBeEQ7O0FBSUEsZ0JBQUksQ0FBQyxLQUFLLFFBQUwsRUFBRCxFQUFrQjtBQUNsQix1QkFBTyxJQUFQLENBRGtCO2FBQXRCOztBQUlBLGdCQUFJLFdBQVcsS0FBSyxHQUFMLENBQVMsR0FBVCxDQUFhLFdBQWIsQ0FBWCxDQWpCa0I7QUFrQnRCLGtDQUFPLFFBQVAsRUFBaUIsaUNBQWpCLEVBbEJzQjtBQW1CdEIsbUJBQU8sU0FBUyxPQUFULElBQW9CLFNBQVMsVUFBVCxDQUFvQixNQUFwQixLQUFnQyxDQUFoQyxDQW5CTDs7Ozs2Q0FzQkw7QUFDakIsZ0JBQUksQ0FBQyxLQUFLLFFBQUwsRUFBRCxFQUFrQjtBQUNsQix1QkFBTyxJQUFQLENBRGtCO2FBQXRCO0FBR0EsbUJBQU8sS0FBSyxTQUFMLENBSlU7Ozs7NENBT0Q7QUFDaEIsaUJBQUssZUFBTCxDQUNRLFdBRFIsRUFFUSxLQUFLLEdBQUwsRUFDQSxLQUFLLFNBQUwsRUFDQSxJQUpSLEVBS1EsSUFMUixFQURnQjtBQU9oQixpQkFBSyxNQUFMLENBQVksR0FBWixDQUFnQixXQUFoQixFQUE2QixJQUE3QixFQVBnQjs7OztXQXhDWDtFQUFzQjs7SUFtRHRCOzs7QUFDVCxhQURTLFFBQ1QsQ0FBWSxZQUFaLEVBQTBCLFVBQTFCLEVBQXNDLEtBQXRDLEVBQTZDOzhCQURwQyxVQUNvQzs7c0VBRHBDLHFCQUVDLGNBQWMsT0FBTyxZQUFZLE9BQU8sUUFETDtLQUE3Qzs7V0FEUztFQUFpQjs7SUFNakI7OztBQUNULGFBRFMsVUFDVCxDQUFZLFlBQVosRUFBMEIsVUFBMUIsRUFBc0MsS0FBdEMsRUFBNkM7OEJBRHBDLFlBQ29DOztzRUFEcEMsdUJBRUMsY0FBYyxTQUFTLFlBQVksT0FBTyxRQURQO0tBQTdDOztXQURTO0VBQW1CIiwiZmlsZSI6InNjb3BlLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLypcbiAgQ29weXJpZ2h0IChDKSAyMDE1IFl1c3VrZSBTdXp1a2kgPHV0YXRhbmUudGVhQGdtYWlsLmNvbT5cblxuICBSZWRpc3RyaWJ1dGlvbiBhbmQgdXNlIGluIHNvdXJjZSBhbmQgYmluYXJ5IGZvcm1zLCB3aXRoIG9yIHdpdGhvdXRcbiAgbW9kaWZpY2F0aW9uLCBhcmUgcGVybWl0dGVkIHByb3ZpZGVkIHRoYXQgdGhlIGZvbGxvd2luZyBjb25kaXRpb25zIGFyZSBtZXQ6XG5cbiAgICAqIFJlZGlzdHJpYnV0aW9ucyBvZiBzb3VyY2UgY29kZSBtdXN0IHJldGFpbiB0aGUgYWJvdmUgY29weXJpZ2h0XG4gICAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIuXG4gICAgKiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodFxuICAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyIGluIHRoZVxuICAgICAgZG9jdW1lbnRhdGlvbiBhbmQvb3Igb3RoZXIgbWF0ZXJpYWxzIHByb3ZpZGVkIHdpdGggdGhlIGRpc3RyaWJ1dGlvbi5cblxuICBUSElTIFNPRlRXQVJFIElTIFBST1ZJREVEIEJZIFRIRSBDT1BZUklHSFQgSE9MREVSUyBBTkQgQ09OVFJJQlVUT1JTIFwiQVMgSVNcIlxuICBBTkQgQU5ZIEVYUFJFU1MgT1IgSU1QTElFRCBXQVJSQU5USUVTLCBJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgVEhFXG4gIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFXG4gIEFSRSBESVNDTEFJTUVELiBJTiBOTyBFVkVOVCBTSEFMTCA8Q09QWVJJR0hUIEhPTERFUj4gQkUgTElBQkxFIEZPUiBBTllcbiAgRElSRUNULCBJTkRJUkVDVCwgSU5DSURFTlRBTCwgU1BFQ0lBTCwgRVhFTVBMQVJZLCBPUiBDT05TRVFVRU5USUFMIERBTUFHRVNcbiAgKElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTO1xuICBMT1NTIE9GIFVTRSwgREFUQSwgT1IgUFJPRklUUzsgT1IgQlVTSU5FU1MgSU5URVJSVVBUSU9OKSBIT1dFVkVSIENBVVNFRCBBTkRcbiAgT04gQU5ZIFRIRU9SWSBPRiBMSUFCSUxJVFksIFdIRVRIRVIgSU4gQ09OVFJBQ1QsIFNUUklDVCBMSUFCSUxJVFksIE9SIFRPUlRcbiAgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFIE9GXG4gIFRISVMgU09GVFdBUkUsIEVWRU4gSUYgQURWSVNFRCBPRiBUSEUgUE9TU0lCSUxJVFkgT0YgU1VDSCBEQU1BR0UuXG4qL1xuXG5pbXBvcnQgeyBTeW50YXggfSBmcm9tICdlc3RyYXZlcnNlJztcbmltcG9ydCBNYXAgZnJvbSAnZXM2LW1hcCc7XG5cbmltcG9ydCBSZWZlcmVuY2UgZnJvbSAnLi9yZWZlcmVuY2UnO1xuaW1wb3J0IFZhcmlhYmxlIGZyb20gJy4vdmFyaWFibGUnO1xuaW1wb3J0IERlZmluaXRpb24gZnJvbSAnLi9kZWZpbml0aW9uJztcbmltcG9ydCBhc3NlcnQgZnJvbSAnYXNzZXJ0JztcblxuZnVuY3Rpb24gaXNTdHJpY3RTY29wZShzY29wZSwgYmxvY2ssIGlzTWV0aG9kRGVmaW5pdGlvbiwgdXNlRGlyZWN0aXZlKSB7XG4gICAgdmFyIGJvZHksIGksIGl6LCBzdG10LCBleHByO1xuXG4gICAgLy8gV2hlbiB1cHBlciBzY29wZSBpcyBleGlzdHMgYW5kIHN0cmljdCwgaW5uZXIgc2NvcGUgaXMgYWxzbyBzdHJpY3QuXG4gICAgaWYgKHNjb3BlLnVwcGVyICYmIHNjb3BlLnVwcGVyLmlzU3RyaWN0KSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cblxuICAgIC8vIEFycm93RnVuY3Rpb25FeHByZXNzaW9uJ3Mgc2NvcGUgaXMgYWx3YXlzIHN0cmljdCBzY29wZS5cbiAgICBpZiAoYmxvY2sudHlwZSA9PT0gU3ludGF4LkFycm93RnVuY3Rpb25FeHByZXNzaW9uKSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cblxuICAgIGlmIChpc01ldGhvZERlZmluaXRpb24pIHtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuXG4gICAgaWYgKHNjb3BlLnR5cGUgPT09ICdjbGFzcycgfHwgc2NvcGUudHlwZSA9PT0gJ21vZHVsZScpIHtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuXG4gICAgaWYgKHNjb3BlLnR5cGUgPT09ICdibG9jaycgfHwgc2NvcGUudHlwZSA9PT0gJ3N3aXRjaCcpIHtcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cblxuICAgIGlmIChzY29wZS50eXBlID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgIGlmIChibG9jay50eXBlID09PSBTeW50YXguUHJvZ3JhbSkge1xuICAgICAgICAgICAgYm9keSA9IGJsb2NrO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgYm9keSA9IGJsb2NrLmJvZHk7XG4gICAgICAgIH1cbiAgICB9IGVsc2UgaWYgKHNjb3BlLnR5cGUgPT09ICdnbG9iYWwnKSB7XG4gICAgICAgIGJvZHkgPSBibG9jaztcbiAgICB9IGVsc2Uge1xuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuXG4gICAgLy8gU2VhcmNoICd1c2Ugc3RyaWN0JyBkaXJlY3RpdmUuXG4gICAgaWYgKHVzZURpcmVjdGl2ZSkge1xuICAgICAgICBmb3IgKGkgPSAwLCBpeiA9IGJvZHkuYm9keS5sZW5ndGg7IGkgPCBpejsgKytpKSB7XG4gICAgICAgICAgICBzdG10ID0gYm9keS5ib2R5W2ldO1xuICAgICAgICAgICAgaWYgKHN0bXQudHlwZSAhPT0gU3ludGF4LkRpcmVjdGl2ZVN0YXRlbWVudCkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHN0bXQucmF3ID09PSAnXCJ1c2Ugc3RyaWN0XCInIHx8IHN0bXQucmF3ID09PSAnXFwndXNlIHN0cmljdFxcJycpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICAgIGZvciAoaSA9IDAsIGl6ID0gYm9keS5ib2R5Lmxlbmd0aDsgaSA8IGl6OyArK2kpIHtcbiAgICAgICAgICAgIHN0bXQgPSBib2R5LmJvZHlbaV07XG4gICAgICAgICAgICBpZiAoc3RtdC50eXBlICE9PSBTeW50YXguRXhwcmVzc2lvblN0YXRlbWVudCkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZXhwciA9IHN0bXQuZXhwcmVzc2lvbjtcbiAgICAgICAgICAgIGlmIChleHByLnR5cGUgIT09IFN5bnRheC5MaXRlcmFsIHx8IHR5cGVvZiBleHByLnZhbHVlICE9PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGV4cHIucmF3ICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICBpZiAoZXhwci5yYXcgPT09ICdcInVzZSBzdHJpY3RcIicgfHwgZXhwci5yYXcgPT09ICdcXCd1c2Ugc3RyaWN0XFwnJykge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChleHByLnZhbHVlID09PSAndXNlIHN0cmljdCcpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuICAgIHJldHVybiBmYWxzZTtcbn1cblxuZnVuY3Rpb24gcmVnaXN0ZXJTY29wZShzY29wZU1hbmFnZXIsIHNjb3BlKSB7XG4gICAgdmFyIHNjb3BlcztcblxuICAgIHNjb3BlTWFuYWdlci5zY29wZXMucHVzaChzY29wZSk7XG5cbiAgICBzY29wZXMgPSBzY29wZU1hbmFnZXIuX19ub2RlVG9TY29wZS5nZXQoc2NvcGUuYmxvY2spO1xuICAgIGlmIChzY29wZXMpIHtcbiAgICAgICAgc2NvcGVzLnB1c2goc2NvcGUpO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIHNjb3BlTWFuYWdlci5fX25vZGVUb1Njb3BlLnNldChzY29wZS5ibG9jaywgWyBzY29wZSBdKTtcbiAgICB9XG59XG5cbmZ1bmN0aW9uIHNob3VsZEJlU3RhdGljYWxseShkZWYpIHtcbiAgICByZXR1cm4gKFxuICAgICAgICAoZGVmLnR5cGUgPT09IFZhcmlhYmxlLkNsYXNzTmFtZSkgfHxcbiAgICAgICAgKGRlZi50eXBlID09PSBWYXJpYWJsZS5WYXJpYWJsZSAmJiBkZWYucGFyZW50LmtpbmQgIT09ICd2YXInKVxuICAgICk7XG59XG5cbi8qKlxuICogQGNsYXNzIFNjb3BlXG4gKi9cbmV4cG9ydCBkZWZhdWx0IGNsYXNzIFNjb3BlIHtcbiAgICBjb25zdHJ1Y3RvcihzY29wZU1hbmFnZXIsIHR5cGUsIHVwcGVyU2NvcGUsIGJsb2NrLCBpc01ldGhvZERlZmluaXRpb24pIHtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIE9uZSBvZiAnVERaJywgJ21vZHVsZScsICdibG9jaycsICdzd2l0Y2gnLCAnZnVuY3Rpb24nLCAnY2F0Y2gnLCAnd2l0aCcsICdmdW5jdGlvbicsICdjbGFzcycsICdnbG9iYWwnLlxuICAgICAgICAgKiBAbWVtYmVyIHtTdHJpbmd9IFNjb3BlI3R5cGVcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMudHlwZSA9IHR5cGU7XG4gICAgICAgICAvKipcbiAgICAgICAgICogVGhlIHNjb3BlZCB7QGxpbmsgVmFyaWFibGV9cyBvZiB0aGlzIHNjb3BlLCBhcyA8Y29kZT57IFZhcmlhYmxlLm5hbWVcbiAgICAgICAgICogOiBWYXJpYWJsZSB9PC9jb2RlPi5cbiAgICAgICAgICogQG1lbWJlciB7TWFwfSBTY29wZSNzZXRcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMuc2V0ID0gbmV3IE1hcCgpO1xuICAgICAgICAvKipcbiAgICAgICAgICogVGhlIHRhaW50ZWQgdmFyaWFibGVzIG9mIHRoaXMgc2NvcGUsIGFzIDxjb2RlPnsgVmFyaWFibGUubmFtZSA6XG4gICAgICAgICAqIGJvb2xlYW4gfTwvY29kZT4uXG4gICAgICAgICAqIEBtZW1iZXIge01hcH0gU2NvcGUjdGFpbnRzICovXG4gICAgICAgIHRoaXMudGFpbnRzID0gbmV3IE1hcCgpO1xuICAgICAgICAvKipcbiAgICAgICAgICogR2VuZXJhbGx5LCB0aHJvdWdoIHRoZSBsZXhpY2FsIHNjb3Bpbmcgb2YgSlMgeW91IGNhbiBhbHdheXMga25vd1xuICAgICAgICAgKiB3aGljaCB2YXJpYWJsZSBhbiBpZGVudGlmaWVyIGluIHRoZSBzb3VyY2UgY29kZSByZWZlcnMgdG8uIFRoZXJlIGFyZVxuICAgICAgICAgKiBhIGZldyBleGNlcHRpb25zIHRvIHRoaXMgcnVsZS4gV2l0aCAnZ2xvYmFsJyBhbmQgJ3dpdGgnIHNjb3BlcyB5b3VcbiAgICAgICAgICogY2FuIG9ubHkgZGVjaWRlIGF0IHJ1bnRpbWUgd2hpY2ggdmFyaWFibGUgYSByZWZlcmVuY2UgcmVmZXJzIHRvLlxuICAgICAgICAgKiBNb3Jlb3ZlciwgaWYgJ2V2YWwoKScgaXMgdXNlZCBpbiBhIHNjb3BlLCBpdCBtaWdodCBpbnRyb2R1Y2UgbmV3XG4gICAgICAgICAqIGJpbmRpbmdzIGluIHRoaXMgb3IgaXRzIHBhcmVudCBzY29wZXMuXG4gICAgICAgICAqIEFsbCB0aG9zZSBzY29wZXMgYXJlIGNvbnNpZGVyZWQgJ2R5bmFtaWMnLlxuICAgICAgICAgKiBAbWVtYmVyIHtib29sZWFufSBTY29wZSNkeW5hbWljXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLmR5bmFtaWMgPSB0aGlzLnR5cGUgPT09ICdnbG9iYWwnIHx8IHRoaXMudHlwZSA9PT0gJ3dpdGgnO1xuICAgICAgICAvKipcbiAgICAgICAgICogQSByZWZlcmVuY2UgdG8gdGhlIHNjb3BlLWRlZmluaW5nIHN5bnRheCBub2RlLlxuICAgICAgICAgKiBAbWVtYmVyIHtlc3ByaW1hLk5vZGV9IFNjb3BlI2Jsb2NrXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLmJsb2NrID0gYmxvY2s7XG4gICAgICAgICAvKipcbiAgICAgICAgICogVGhlIHtAbGluayBSZWZlcmVuY2V8cmVmZXJlbmNlc30gdGhhdCBhcmUgbm90IHJlc29sdmVkIHdpdGggdGhpcyBzY29wZS5cbiAgICAgICAgICogQG1lbWJlciB7UmVmZXJlbmNlW119IFNjb3BlI3Rocm91Z2hcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMudGhyb3VnaCA9IFtdO1xuICAgICAgICAgLyoqXG4gICAgICAgICAqIFRoZSBzY29wZWQge0BsaW5rIFZhcmlhYmxlfXMgb2YgdGhpcyBzY29wZS4gSW4gdGhlIGNhc2Ugb2YgYVxuICAgICAgICAgKiAnZnVuY3Rpb24nIHNjb3BlIHRoaXMgaW5jbHVkZXMgdGhlIGF1dG9tYXRpYyBhcmd1bWVudCA8ZW0+YXJndW1lbnRzPC9lbT4gYXNcbiAgICAgICAgICogaXRzIGZpcnN0IGVsZW1lbnQsIGFzIHdlbGwgYXMgYWxsIGZ1cnRoZXIgZm9ybWFsIGFyZ3VtZW50cy5cbiAgICAgICAgICogQG1lbWJlciB7VmFyaWFibGVbXX0gU2NvcGUjdmFyaWFibGVzXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLnZhcmlhYmxlcyA9IFtdO1xuICAgICAgICAgLyoqXG4gICAgICAgICAqIEFueSB2YXJpYWJsZSB7QGxpbmsgUmVmZXJlbmNlfHJlZmVyZW5jZX0gZm91bmQgaW4gdGhpcyBzY29wZS4gVGhpc1xuICAgICAgICAgKiBpbmNsdWRlcyBvY2N1cnJlbmNlcyBvZiBsb2NhbCB2YXJpYWJsZXMgYXMgd2VsbCBhcyB2YXJpYWJsZXMgZnJvbVxuICAgICAgICAgKiBwYXJlbnQgc2NvcGVzIChpbmNsdWRpbmcgdGhlIGdsb2JhbCBzY29wZSkuIEZvciBsb2NhbCB2YXJpYWJsZXNcbiAgICAgICAgICogdGhpcyBhbHNvIGluY2x1ZGVzIGRlZmluaW5nIG9jY3VycmVuY2VzIChsaWtlIGluIGEgJ3Zhcicgc3RhdGVtZW50KS5cbiAgICAgICAgICogSW4gYSAnZnVuY3Rpb24nIHNjb3BlIHRoaXMgZG9lcyBub3QgaW5jbHVkZSB0aGUgb2NjdXJyZW5jZXMgb2YgdGhlXG4gICAgICAgICAqIGZvcm1hbCBwYXJhbWV0ZXIgaW4gdGhlIHBhcmFtZXRlciBsaXN0LlxuICAgICAgICAgKiBAbWVtYmVyIHtSZWZlcmVuY2VbXX0gU2NvcGUjcmVmZXJlbmNlc1xuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5yZWZlcmVuY2VzID0gW107XG5cbiAgICAgICAgIC8qKlxuICAgICAgICAgKiBGb3IgJ2dsb2JhbCcgYW5kICdmdW5jdGlvbicgc2NvcGVzLCB0aGlzIGlzIGEgc2VsZi1yZWZlcmVuY2UuIEZvclxuICAgICAgICAgKiBvdGhlciBzY29wZSB0eXBlcyB0aGlzIGlzIHRoZSA8ZW0+dmFyaWFibGVTY29wZTwvZW0+IHZhbHVlIG9mIHRoZVxuICAgICAgICAgKiBwYXJlbnQgc2NvcGUuXG4gICAgICAgICAqIEBtZW1iZXIge1Njb3BlfSBTY29wZSN2YXJpYWJsZVNjb3BlXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLnZhcmlhYmxlU2NvcGUgPVxuICAgICAgICAgICAgKHRoaXMudHlwZSA9PT0gJ2dsb2JhbCcgfHwgdGhpcy50eXBlID09PSAnZnVuY3Rpb24nIHx8IHRoaXMudHlwZSA9PT0gJ21vZHVsZScpID8gdGhpcyA6IHVwcGVyU2NvcGUudmFyaWFibGVTY29wZTtcbiAgICAgICAgIC8qKlxuICAgICAgICAgKiBXaGV0aGVyIHRoaXMgc2NvcGUgaXMgY3JlYXRlZCBieSBhIEZ1bmN0aW9uRXhwcmVzc2lvbi5cbiAgICAgICAgICogQG1lbWJlciB7Ym9vbGVhbn0gU2NvcGUjZnVuY3Rpb25FeHByZXNzaW9uU2NvcGVcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMuZnVuY3Rpb25FeHByZXNzaW9uU2NvcGUgPSBmYWxzZTtcbiAgICAgICAgIC8qKlxuICAgICAgICAgKiBXaGV0aGVyIHRoaXMgaXMgYSBzY29wZSB0aGF0IGNvbnRhaW5zIGFuICdldmFsKCknIGludm9jYXRpb24uXG4gICAgICAgICAqIEBtZW1iZXIge2Jvb2xlYW59IFNjb3BlI2RpcmVjdENhbGxUb0V2YWxTY29wZVxuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5kaXJlY3RDYWxsVG9FdmFsU2NvcGUgPSBmYWxzZTtcbiAgICAgICAgIC8qKlxuICAgICAgICAgKiBAbWVtYmVyIHtib29sZWFufSBTY29wZSN0aGlzRm91bmRcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMudGhpc0ZvdW5kID0gZmFsc2U7XG5cbiAgICAgICAgdGhpcy5fX2xlZnQgPSBbXTtcblxuICAgICAgICAgLyoqXG4gICAgICAgICAqIFJlZmVyZW5jZSB0byB0aGUgcGFyZW50IHtAbGluayBTY29wZXxzY29wZX0uXG4gICAgICAgICAqIEBtZW1iZXIge1Njb3BlfSBTY29wZSN1cHBlclxuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy51cHBlciA9IHVwcGVyU2NvcGU7XG4gICAgICAgICAvKipcbiAgICAgICAgICogV2hldGhlciAndXNlIHN0cmljdCcgaXMgaW4gZWZmZWN0IGluIHRoaXMgc2NvcGUuXG4gICAgICAgICAqIEBtZW1iZXIge2Jvb2xlYW59IFNjb3BlI2lzU3RyaWN0XG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLmlzU3RyaWN0ID0gaXNTdHJpY3RTY29wZSh0aGlzLCBibG9jaywgaXNNZXRob2REZWZpbml0aW9uLCBzY29wZU1hbmFnZXIuX191c2VEaXJlY3RpdmUoKSk7XG5cbiAgICAgICAgIC8qKlxuICAgICAgICAgKiBMaXN0IG9mIG5lc3RlZCB7QGxpbmsgU2NvcGV9cy5cbiAgICAgICAgICogQG1lbWJlciB7U2NvcGVbXX0gU2NvcGUjY2hpbGRTY29wZXNcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMuY2hpbGRTY29wZXMgPSBbXTtcbiAgICAgICAgaWYgKHRoaXMudXBwZXIpIHtcbiAgICAgICAgICAgIHRoaXMudXBwZXIuY2hpbGRTY29wZXMucHVzaCh0aGlzKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuX19kZWNsYXJlZFZhcmlhYmxlcyA9IHNjb3BlTWFuYWdlci5fX2RlY2xhcmVkVmFyaWFibGVzO1xuXG4gICAgICAgIHJlZ2lzdGVyU2NvcGUoc2NvcGVNYW5hZ2VyLCB0aGlzKTtcbiAgICB9XG5cbiAgICBfX3Nob3VsZFN0YXRpY2FsbHlDbG9zZShzY29wZU1hbmFnZXIpIHtcbiAgICAgICAgcmV0dXJuICghdGhpcy5keW5hbWljIHx8IHNjb3BlTWFuYWdlci5fX2lzT3B0aW1pc3RpYygpKTtcbiAgICB9XG5cbiAgICBfX3Nob3VsZFN0YXRpY2FsbHlDbG9zZUZvckdsb2JhbChyZWYpIHtcbiAgICAgICAgLy8gT24gZ2xvYmFsIHNjb3BlLCBsZXQvY29uc3QvY2xhc3MgZGVjbGFyYXRpb25zIHNob3VsZCBiZSByZXNvbHZlZCBzdGF0aWNhbGx5LlxuICAgICAgICB2YXIgbmFtZSA9IHJlZi5pZGVudGlmaWVyLm5hbWU7XG4gICAgICAgIGlmICghdGhpcy5zZXQuaGFzKG5hbWUpKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgdmFyaWFibGUgPSB0aGlzLnNldC5nZXQobmFtZSk7XG4gICAgICAgIHZhciBkZWZzID0gdmFyaWFibGUuZGVmcztcbiAgICAgICAgcmV0dXJuIGRlZnMubGVuZ3RoID4gMCAmJiBkZWZzLmV2ZXJ5KHNob3VsZEJlU3RhdGljYWxseSk7XG4gICAgfVxuXG4gICAgX19zdGF0aWNDbG9zZVJlZihyZWYpIHtcbiAgICAgICAgaWYgKCF0aGlzLl9fcmVzb2x2ZShyZWYpKSB7XG4gICAgICAgICAgICB0aGlzLl9fZGVsZWdhdGVUb1VwcGVyU2NvcGUocmVmKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIF9fZHluYW1pY0Nsb3NlUmVmKHJlZikge1xuICAgICAgICAvLyBub3RpZnkgYWxsIG5hbWVzIGFyZSB0aHJvdWdoIHRvIGdsb2JhbFxuICAgICAgICBsZXQgY3VycmVudCA9IHRoaXM7XG4gICAgICAgIGRvIHtcbiAgICAgICAgICAgIGN1cnJlbnQudGhyb3VnaC5wdXNoKHJlZik7XG4gICAgICAgICAgICBjdXJyZW50ID0gY3VycmVudC51cHBlcjtcbiAgICAgICAgfSB3aGlsZSAoY3VycmVudCk7XG4gICAgfVxuXG4gICAgX19nbG9iYWxDbG9zZVJlZihyZWYpIHtcbiAgICAgICAgLy8gbGV0L2NvbnN0L2NsYXNzIGRlY2xhcmF0aW9ucyBzaG91bGQgYmUgcmVzb2x2ZWQgc3RhdGljYWxseS5cbiAgICAgICAgLy8gb3RoZXJzIHNob3VsZCBiZSByZXNvbHZlZCBkeW5hbWljYWxseS5cbiAgICAgICAgaWYgKHRoaXMuX19zaG91bGRTdGF0aWNhbGx5Q2xvc2VGb3JHbG9iYWwocmVmKSkge1xuICAgICAgICAgICAgdGhpcy5fX3N0YXRpY0Nsb3NlUmVmKHJlZik7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLl9fZHluYW1pY0Nsb3NlUmVmKHJlZik7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBfX2Nsb3NlKHNjb3BlTWFuYWdlcikge1xuICAgICAgICB2YXIgY2xvc2VSZWY7XG4gICAgICAgIGlmICh0aGlzLl9fc2hvdWxkU3RhdGljYWxseUNsb3NlKHNjb3BlTWFuYWdlcikpIHtcbiAgICAgICAgICAgIGNsb3NlUmVmID0gdGhpcy5fX3N0YXRpY0Nsb3NlUmVmO1xuICAgICAgICB9IGVsc2UgaWYgKHRoaXMudHlwZSAhPT0gJ2dsb2JhbCcpIHtcbiAgICAgICAgICAgIGNsb3NlUmVmID0gdGhpcy5fX2R5bmFtaWNDbG9zZVJlZjtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNsb3NlUmVmID0gdGhpcy5fX2dsb2JhbENsb3NlUmVmO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gVHJ5IFJlc29sdmluZyBhbGwgcmVmZXJlbmNlcyBpbiB0aGlzIHNjb3BlLlxuICAgICAgICBmb3IgKGxldCBpID0gMCwgaXogPSB0aGlzLl9fbGVmdC5sZW5ndGg7IGkgPCBpejsgKytpKSB7XG4gICAgICAgICAgICBsZXQgcmVmID0gdGhpcy5fX2xlZnRbaV07XG4gICAgICAgICAgICBjbG9zZVJlZi5jYWxsKHRoaXMsIHJlZik7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5fX2xlZnQgPSBudWxsO1xuXG4gICAgICAgIHJldHVybiB0aGlzLnVwcGVyO1xuICAgIH1cblxuICAgIF9fcmVzb2x2ZShyZWYpIHtcbiAgICAgICAgdmFyIHZhcmlhYmxlLCBuYW1lO1xuICAgICAgICBuYW1lID0gcmVmLmlkZW50aWZpZXIubmFtZTtcbiAgICAgICAgaWYgKHRoaXMuc2V0LmhhcyhuYW1lKSkge1xuICAgICAgICAgICAgdmFyaWFibGUgPSB0aGlzLnNldC5nZXQobmFtZSk7XG4gICAgICAgICAgICB2YXJpYWJsZS5yZWZlcmVuY2VzLnB1c2gocmVmKTtcbiAgICAgICAgICAgIHZhcmlhYmxlLnN0YWNrID0gdmFyaWFibGUuc3RhY2sgJiYgcmVmLmZyb20udmFyaWFibGVTY29wZSA9PT0gdGhpcy52YXJpYWJsZVNjb3BlO1xuICAgICAgICAgICAgaWYgKHJlZi50YWludGVkKSB7XG4gICAgICAgICAgICAgICAgdmFyaWFibGUudGFpbnRlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgdGhpcy50YWludHMuc2V0KHZhcmlhYmxlLm5hbWUsIHRydWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVmLnJlc29sdmVkID0gdmFyaWFibGU7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuXG4gICAgX19kZWxlZ2F0ZVRvVXBwZXJTY29wZShyZWYpIHtcbiAgICAgICAgaWYgKHRoaXMudXBwZXIpIHtcbiAgICAgICAgICAgIHRoaXMudXBwZXIuX19sZWZ0LnB1c2gocmVmKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnRocm91Z2gucHVzaChyZWYpO1xuICAgIH1cblxuICAgIF9fYWRkRGVjbGFyZWRWYXJpYWJsZXNPZk5vZGUodmFyaWFibGUsIG5vZGUpIHtcbiAgICAgICAgaWYgKG5vZGUgPT0gbnVsbCkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIHZhcmlhYmxlcyA9IHRoaXMuX19kZWNsYXJlZFZhcmlhYmxlcy5nZXQobm9kZSk7XG4gICAgICAgIGlmICh2YXJpYWJsZXMgPT0gbnVsbCkge1xuICAgICAgICAgICAgdmFyaWFibGVzID0gW107XG4gICAgICAgICAgICB0aGlzLl9fZGVjbGFyZWRWYXJpYWJsZXMuc2V0KG5vZGUsIHZhcmlhYmxlcyk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHZhcmlhYmxlcy5pbmRleE9mKHZhcmlhYmxlKSA9PT0gLTEpIHtcbiAgICAgICAgICAgIHZhcmlhYmxlcy5wdXNoKHZhcmlhYmxlKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIF9fZGVmaW5lR2VuZXJpYyhuYW1lLCBzZXQsIHZhcmlhYmxlcywgbm9kZSwgZGVmKSB7XG4gICAgICAgIHZhciB2YXJpYWJsZTtcblxuICAgICAgICB2YXJpYWJsZSA9IHNldC5nZXQobmFtZSk7XG4gICAgICAgIGlmICghdmFyaWFibGUpIHtcbiAgICAgICAgICAgIHZhcmlhYmxlID0gbmV3IFZhcmlhYmxlKG5hbWUsIHRoaXMpO1xuICAgICAgICAgICAgc2V0LnNldChuYW1lLCB2YXJpYWJsZSk7XG4gICAgICAgICAgICB2YXJpYWJsZXMucHVzaCh2YXJpYWJsZSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoZGVmKSB7XG4gICAgICAgICAgICB2YXJpYWJsZS5kZWZzLnB1c2goZGVmKTtcbiAgICAgICAgICAgIGlmIChkZWYudHlwZSAhPT0gVmFyaWFibGUuVERaKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5fX2FkZERlY2xhcmVkVmFyaWFibGVzT2ZOb2RlKHZhcmlhYmxlLCBkZWYubm9kZSk7XG4gICAgICAgICAgICAgICAgdGhpcy5fX2FkZERlY2xhcmVkVmFyaWFibGVzT2ZOb2RlKHZhcmlhYmxlLCBkZWYucGFyZW50KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAobm9kZSkge1xuICAgICAgICAgICAgdmFyaWFibGUuaWRlbnRpZmllcnMucHVzaChub2RlKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIF9fZGVmaW5lKG5vZGUsIGRlZikge1xuICAgICAgICBpZiAobm9kZSAmJiBub2RlLnR5cGUgPT09IFN5bnRheC5JZGVudGlmaWVyKSB7XG4gICAgICAgICAgICB0aGlzLl9fZGVmaW5lR2VuZXJpYyhcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5uYW1lLFxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNldCxcbiAgICAgICAgICAgICAgICAgICAgdGhpcy52YXJpYWJsZXMsXG4gICAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICAgIGRlZik7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBfX3JlZmVyZW5jaW5nKG5vZGUsIGFzc2lnbiwgd3JpdGVFeHByLCBtYXliZUltcGxpY2l0R2xvYmFsLCBwYXJ0aWFsLCBpbml0KSB7XG4gICAgICAgIC8vIGJlY2F1c2UgQXJyYXkgZWxlbWVudCBtYXkgYmUgbnVsbFxuICAgICAgICBpZiAoIW5vZGUgfHwgbm9kZS50eXBlICE9PSBTeW50YXguSWRlbnRpZmllcikge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gU3BlY2lhbGx5IGhhbmRsZSBsaWtlIGB0aGlzYC5cbiAgICAgICAgaWYgKG5vZGUubmFtZSA9PT0gJ3N1cGVyJykge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgbGV0IHJlZiA9IG5ldyBSZWZlcmVuY2Uobm9kZSwgdGhpcywgYXNzaWduIHx8IFJlZmVyZW5jZS5SRUFELCB3cml0ZUV4cHIsIG1heWJlSW1wbGljaXRHbG9iYWwsICEhcGFydGlhbCwgISFpbml0KTtcbiAgICAgICAgdGhpcy5yZWZlcmVuY2VzLnB1c2gocmVmKTtcbiAgICAgICAgdGhpcy5fX2xlZnQucHVzaChyZWYpO1xuICAgIH1cblxuICAgIF9fZGV0ZWN0RXZhbCgpIHtcbiAgICAgICAgdmFyIGN1cnJlbnQ7XG4gICAgICAgIGN1cnJlbnQgPSB0aGlzO1xuICAgICAgICB0aGlzLmRpcmVjdENhbGxUb0V2YWxTY29wZSA9IHRydWU7XG4gICAgICAgIGRvIHtcbiAgICAgICAgICAgIGN1cnJlbnQuZHluYW1pYyA9IHRydWU7XG4gICAgICAgICAgICBjdXJyZW50ID0gY3VycmVudC51cHBlcjtcbiAgICAgICAgfSB3aGlsZSAoY3VycmVudCk7XG4gICAgfVxuXG4gICAgX19kZXRlY3RUaGlzKCkge1xuICAgICAgICB0aGlzLnRoaXNGb3VuZCA9IHRydWU7XG4gICAgfVxuXG4gICAgX19pc0Nsb3NlZCgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX19sZWZ0ID09PSBudWxsO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIHJldHVybnMgcmVzb2x2ZWQge1JlZmVyZW5jZX1cbiAgICAgKiBAbWV0aG9kIFNjb3BlI3Jlc29sdmVcbiAgICAgKiBAcGFyYW0ge0VzcHJpbWEuSWRlbnRpZmllcn0gaWRlbnQgLSBpZGVudGlmaWVyIHRvIGJlIHJlc29sdmVkLlxuICAgICAqIEByZXR1cm4ge1JlZmVyZW5jZX1cbiAgICAgKi9cbiAgICByZXNvbHZlKGlkZW50KSB7XG4gICAgICAgIHZhciByZWYsIGksIGl6O1xuICAgICAgICBhc3NlcnQodGhpcy5fX2lzQ2xvc2VkKCksICdTY29wZSBzaG91bGQgYmUgY2xvc2VkLicpO1xuICAgICAgICBhc3NlcnQoaWRlbnQudHlwZSA9PT0gU3ludGF4LklkZW50aWZpZXIsICdUYXJnZXQgc2hvdWxkIGJlIGlkZW50aWZpZXIuJyk7XG4gICAgICAgIGZvciAoaSA9IDAsIGl6ID0gdGhpcy5yZWZlcmVuY2VzLmxlbmd0aDsgaSA8IGl6OyArK2kpIHtcbiAgICAgICAgICAgIHJlZiA9IHRoaXMucmVmZXJlbmNlc1tpXTtcbiAgICAgICAgICAgIGlmIChyZWYuaWRlbnRpZmllciA9PT0gaWRlbnQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVmO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBudWxsO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIHJldHVybnMgdGhpcyBzY29wZSBpcyBzdGF0aWNcbiAgICAgKiBAbWV0aG9kIFNjb3BlI2lzU3RhdGljXG4gICAgICogQHJldHVybiB7Ym9vbGVhbn1cbiAgICAgKi9cbiAgICBpc1N0YXRpYygpIHtcbiAgICAgICAgcmV0dXJuICF0aGlzLmR5bmFtaWM7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogcmV0dXJucyB0aGlzIHNjb3BlIGhhcyBtYXRlcmlhbGl6ZWQgYXJndW1lbnRzXG4gICAgICogQG1ldGhvZCBTY29wZSNpc0FyZ3VtZW50c01hdGVyaWFsaXplZFxuICAgICAqIEByZXR1cm4ge2Jvb2xlYW59XG4gICAgICovXG4gICAgaXNBcmd1bWVudHNNYXRlcmlhbGl6ZWQoKSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIHJldHVybnMgdGhpcyBzY29wZSBoYXMgbWF0ZXJpYWxpemVkIGB0aGlzYCByZWZlcmVuY2VcbiAgICAgKiBAbWV0aG9kIFNjb3BlI2lzVGhpc01hdGVyaWFsaXplZFxuICAgICAqIEByZXR1cm4ge2Jvb2xlYW59XG4gICAgICovXG4gICAgaXNUaGlzTWF0ZXJpYWxpemVkKCkge1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9XG5cbiAgICBpc1VzZWROYW1lKG5hbWUpIHtcbiAgICAgICAgaWYgKHRoaXMuc2V0LmhhcyhuYW1lKSkge1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cbiAgICAgICAgZm9yICh2YXIgaSA9IDAsIGl6ID0gdGhpcy50aHJvdWdoLmxlbmd0aDsgaSA8IGl6OyArK2kpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLnRocm91Z2hbaV0uaWRlbnRpZmllci5uYW1lID09PSBuYW1lKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbn1cblxuZXhwb3J0IGNsYXNzIEdsb2JhbFNjb3BlIGV4dGVuZHMgU2NvcGUge1xuICAgIGNvbnN0cnVjdG9yKHNjb3BlTWFuYWdlciwgYmxvY2spIHtcbiAgICAgICAgc3VwZXIoc2NvcGVNYW5hZ2VyLCAnZ2xvYmFsJywgbnVsbCwgYmxvY2ssIGZhbHNlKTtcbiAgICAgICAgdGhpcy5pbXBsaWNpdCA9IHtcbiAgICAgICAgICAgIHNldDogbmV3IE1hcCgpLFxuICAgICAgICAgICAgdmFyaWFibGVzOiBbXSxcbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgKiBMaXN0IG9mIHtAbGluayBSZWZlcmVuY2V9cyB0aGF0IGFyZSBsZWZ0IHRvIGJlIHJlc29sdmVkIChpLmUuIHdoaWNoXG4gICAgICAgICAgICAqIG5lZWQgdG8gYmUgbGlua2VkIHRvIHRoZSB2YXJpYWJsZSB0aGV5IHJlZmVyIHRvKS5cbiAgICAgICAgICAgICogQG1lbWJlciB7UmVmZXJlbmNlW119IFNjb3BlI2ltcGxpY2l0I2xlZnRcbiAgICAgICAgICAgICovXG4gICAgICAgICAgICBsZWZ0OiBbXVxuICAgICAgICB9O1xuICAgIH1cblxuICAgIF9fY2xvc2Uoc2NvcGVNYW5hZ2VyKSB7XG4gICAgICAgIGxldCBpbXBsaWNpdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMCwgaXogPSB0aGlzLl9fbGVmdC5sZW5ndGg7IGkgPCBpejsgKytpKSB7XG4gICAgICAgICAgICBsZXQgcmVmID0gdGhpcy5fX2xlZnRbaV07XG4gICAgICAgICAgICBpZiAocmVmLl9fbWF5YmVJbXBsaWNpdEdsb2JhbCAmJiAhdGhpcy5zZXQuaGFzKHJlZi5pZGVudGlmaWVyLm5hbWUpKSB7XG4gICAgICAgICAgICAgICAgaW1wbGljaXQucHVzaChyZWYuX19tYXliZUltcGxpY2l0R2xvYmFsKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIGNyZWF0ZSBhbiBpbXBsaWNpdCBnbG9iYWwgdmFyaWFibGUgZnJvbSBhc3NpZ25tZW50IGV4cHJlc3Npb25cbiAgICAgICAgZm9yIChsZXQgaSA9IDAsIGl6ID0gaW1wbGljaXQubGVuZ3RoOyBpIDwgaXo7ICsraSkge1xuICAgICAgICAgICAgbGV0IGluZm8gPSBpbXBsaWNpdFtpXTtcbiAgICAgICAgICAgIHRoaXMuX19kZWZpbmVJbXBsaWNpdChpbmZvLnBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgIG5ldyBEZWZpbml0aW9uKFxuICAgICAgICAgICAgICAgICAgICAgICAgVmFyaWFibGUuSW1wbGljaXRHbG9iYWxWYXJpYWJsZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGluZm8ucGF0dGVybixcbiAgICAgICAgICAgICAgICAgICAgICAgIGluZm8ubm9kZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVsbFxuICAgICAgICAgICAgICAgICAgICApKTtcblxuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5pbXBsaWNpdC5sZWZ0ID0gdGhpcy5fX2xlZnQ7XG5cbiAgICAgICAgcmV0dXJuIHN1cGVyLl9fY2xvc2Uoc2NvcGVNYW5hZ2VyKTtcbiAgICB9XG5cbiAgICBfX2RlZmluZUltcGxpY2l0KG5vZGUsIGRlZikge1xuICAgICAgICBpZiAobm9kZSAmJiBub2RlLnR5cGUgPT09IFN5bnRheC5JZGVudGlmaWVyKSB7XG4gICAgICAgICAgICB0aGlzLl9fZGVmaW5lR2VuZXJpYyhcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5uYW1lLFxuICAgICAgICAgICAgICAgICAgICB0aGlzLmltcGxpY2l0LnNldCxcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5pbXBsaWNpdC52YXJpYWJsZXMsXG4gICAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICAgIGRlZik7XG4gICAgICAgIH1cbiAgICB9XG59XG5cbmV4cG9ydCBjbGFzcyBNb2R1bGVTY29wZSBleHRlbmRzIFNjb3BlIHtcbiAgICBjb25zdHJ1Y3RvcihzY29wZU1hbmFnZXIsIHVwcGVyU2NvcGUsIGJsb2NrKSB7XG4gICAgICAgIHN1cGVyKHNjb3BlTWFuYWdlciwgJ21vZHVsZScsIHVwcGVyU2NvcGUsIGJsb2NrLCBmYWxzZSk7XG4gICAgfVxufVxuXG5leHBvcnQgY2xhc3MgRnVuY3Rpb25FeHByZXNzaW9uTmFtZVNjb3BlIGV4dGVuZHMgU2NvcGUge1xuICAgIGNvbnN0cnVjdG9yKHNjb3BlTWFuYWdlciwgdXBwZXJTY29wZSwgYmxvY2spIHtcbiAgICAgICAgc3VwZXIoc2NvcGVNYW5hZ2VyLCAnZnVuY3Rpb24tZXhwcmVzc2lvbi1uYW1lJywgdXBwZXJTY29wZSwgYmxvY2ssIGZhbHNlKTtcbiAgICAgICAgdGhpcy5fX2RlZmluZShibG9jay5pZCxcbiAgICAgICAgICAgICAgICBuZXcgRGVmaW5pdGlvbihcbiAgICAgICAgICAgICAgICAgICAgVmFyaWFibGUuRnVuY3Rpb25OYW1lLFxuICAgICAgICAgICAgICAgICAgICBibG9jay5pZCxcbiAgICAgICAgICAgICAgICAgICAgYmxvY2ssXG4gICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgIG51bGxcbiAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgdGhpcy5mdW5jdGlvbkV4cHJlc3Npb25TY29wZSA9IHRydWU7XG4gICAgfVxufVxuXG5leHBvcnQgY2xhc3MgQ2F0Y2hTY29wZSBleHRlbmRzIFNjb3BlIHtcbiAgICBjb25zdHJ1Y3RvcihzY29wZU1hbmFnZXIsIHVwcGVyU2NvcGUsIGJsb2NrKSB7XG4gICAgICAgIHN1cGVyKHNjb3BlTWFuYWdlciwgJ2NhdGNoJywgdXBwZXJTY29wZSwgYmxvY2ssIGZhbHNlKTtcbiAgICB9XG59XG5cbmV4cG9ydCBjbGFzcyBXaXRoU2NvcGUgZXh0ZW5kcyBTY29wZSB7XG4gICAgY29uc3RydWN0b3Ioc2NvcGVNYW5hZ2VyLCB1cHBlclNjb3BlLCBibG9jaykge1xuICAgICAgICBzdXBlcihzY29wZU1hbmFnZXIsICd3aXRoJywgdXBwZXJTY29wZSwgYmxvY2ssIGZhbHNlKTtcbiAgICB9XG5cbiAgICBfX2Nsb3NlKHNjb3BlTWFuYWdlcikge1xuICAgICAgICBpZiAodGhpcy5fX3Nob3VsZFN0YXRpY2FsbHlDbG9zZShzY29wZU1hbmFnZXIpKSB7XG4gICAgICAgICAgICByZXR1cm4gc3VwZXIuX19jbG9zZShzY29wZU1hbmFnZXIpO1xuICAgICAgICB9XG5cbiAgICAgICAgZm9yIChsZXQgaSA9IDAsIGl6ID0gdGhpcy5fX2xlZnQubGVuZ3RoOyBpIDwgaXo7ICsraSkge1xuICAgICAgICAgICAgbGV0IHJlZiA9IHRoaXMuX19sZWZ0W2ldO1xuICAgICAgICAgICAgcmVmLnRhaW50ZWQgPSB0cnVlO1xuICAgICAgICAgICAgdGhpcy5fX2RlbGVnYXRlVG9VcHBlclNjb3BlKHJlZik7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5fX2xlZnQgPSBudWxsO1xuXG4gICAgICAgIHJldHVybiB0aGlzLnVwcGVyO1xuICAgIH1cbn1cblxuZXhwb3J0IGNsYXNzIFREWlNjb3BlIGV4dGVuZHMgU2NvcGUge1xuICAgIGNvbnN0cnVjdG9yKHNjb3BlTWFuYWdlciwgdXBwZXJTY29wZSwgYmxvY2spIHtcbiAgICAgICAgc3VwZXIoc2NvcGVNYW5hZ2VyLCAnVERaJywgdXBwZXJTY29wZSwgYmxvY2ssIGZhbHNlKTtcbiAgICB9XG59XG5cbmV4cG9ydCBjbGFzcyBCbG9ja1Njb3BlIGV4dGVuZHMgU2NvcGUge1xuICAgIGNvbnN0cnVjdG9yKHNjb3BlTWFuYWdlciwgdXBwZXJTY29wZSwgYmxvY2spIHtcbiAgICAgICAgc3VwZXIoc2NvcGVNYW5hZ2VyLCAnYmxvY2snLCB1cHBlclNjb3BlLCBibG9jaywgZmFsc2UpO1xuICAgIH1cbn1cblxuZXhwb3J0IGNsYXNzIFN3aXRjaFNjb3BlIGV4dGVuZHMgU2NvcGUge1xuICAgIGNvbnN0cnVjdG9yKHNjb3BlTWFuYWdlciwgdXBwZXJTY29wZSwgYmxvY2spIHtcbiAgICAgICAgc3VwZXIoc2NvcGVNYW5hZ2VyLCAnc3dpdGNoJywgdXBwZXJTY29wZSwgYmxvY2ssIGZhbHNlKTtcbiAgICB9XG59XG5cbmV4cG9ydCBjbGFzcyBGdW5jdGlvblNjb3BlIGV4dGVuZHMgU2NvcGUge1xuICAgIGNvbnN0cnVjdG9yKHNjb3BlTWFuYWdlciwgdXBwZXJTY29wZSwgYmxvY2ssIGlzTWV0aG9kRGVmaW5pdGlvbikge1xuICAgICAgICBzdXBlcihzY29wZU1hbmFnZXIsICdmdW5jdGlvbicsIHVwcGVyU2NvcGUsIGJsb2NrLCBpc01ldGhvZERlZmluaXRpb24pO1xuXG4gICAgICAgIC8vIHNlY3Rpb24gOS4yLjEzLCBGdW5jdGlvbkRlY2xhcmF0aW9uSW5zdGFudGlhdGlvbi5cbiAgICAgICAgLy8gTk9URSBBcnJvdyBmdW5jdGlvbnMgbmV2ZXIgaGF2ZSBhbiBhcmd1bWVudHMgb2JqZWN0cy5cbiAgICAgICAgaWYgKHRoaXMuYmxvY2sudHlwZSAhPT0gU3ludGF4LkFycm93RnVuY3Rpb25FeHByZXNzaW9uKSB7XG4gICAgICAgICAgICB0aGlzLl9fZGVmaW5lQXJndW1lbnRzKCk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBpc0FyZ3VtZW50c01hdGVyaWFsaXplZCgpIHtcbiAgICAgICAgLy8gVE9ETyhDb25zdGVsbGF0aW9uKVxuICAgICAgICAvLyBXZSBjYW4gbW9yZSBhZ2dyZXNzaXZlIG9uIHRoaXMgY29uZGl0aW9uIGxpa2UgdGhpcy5cbiAgICAgICAgLy9cbiAgICAgICAgLy8gZnVuY3Rpb24gdCgpIHtcbiAgICAgICAgLy8gICAgIC8vIGFyZ3VtZW50cyBvZiB0IGlzIGFsd2F5cyBoaWRkZW4uXG4gICAgICAgIC8vICAgICBmdW5jdGlvbiBhcmd1bWVudHMoKSB7XG4gICAgICAgIC8vICAgICB9XG4gICAgICAgIC8vIH1cbiAgICAgICAgaWYgKHRoaXMuYmxvY2sudHlwZSA9PT0gU3ludGF4LkFycm93RnVuY3Rpb25FeHByZXNzaW9uKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIXRoaXMuaXNTdGF0aWMoKSkge1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICBsZXQgdmFyaWFibGUgPSB0aGlzLnNldC5nZXQoJ2FyZ3VtZW50cycpO1xuICAgICAgICBhc3NlcnQodmFyaWFibGUsICdBbHdheXMgaGF2ZSBhcmd1bWVudHMgdmFyaWFibGUuJyk7XG4gICAgICAgIHJldHVybiB2YXJpYWJsZS50YWludGVkIHx8IHZhcmlhYmxlLnJlZmVyZW5jZXMubGVuZ3RoICAhPT0gMDtcbiAgICB9XG5cbiAgICBpc1RoaXNNYXRlcmlhbGl6ZWQoKSB7XG4gICAgICAgIGlmICghdGhpcy5pc1N0YXRpYygpKSB7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy50aGlzRm91bmQ7XG4gICAgfVxuXG4gICAgX19kZWZpbmVBcmd1bWVudHMoKSB7XG4gICAgICAgIHRoaXMuX19kZWZpbmVHZW5lcmljKFxuICAgICAgICAgICAgICAgICdhcmd1bWVudHMnLFxuICAgICAgICAgICAgICAgIHRoaXMuc2V0LFxuICAgICAgICAgICAgICAgIHRoaXMudmFyaWFibGVzLFxuICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgbnVsbCk7XG4gICAgICAgIHRoaXMudGFpbnRzLnNldCgnYXJndW1lbnRzJywgdHJ1ZSk7XG4gICAgfVxufVxuXG5leHBvcnQgY2xhc3MgRm9yU2NvcGUgZXh0ZW5kcyBTY29wZSB7XG4gICAgY29uc3RydWN0b3Ioc2NvcGVNYW5hZ2VyLCB1cHBlclNjb3BlLCBibG9jaykge1xuICAgICAgICBzdXBlcihzY29wZU1hbmFnZXIsICdmb3InLCB1cHBlclNjb3BlLCBibG9jaywgZmFsc2UpO1xuICAgIH1cbn1cblxuZXhwb3J0IGNsYXNzIENsYXNzU2NvcGUgZXh0ZW5kcyBTY29wZSB7XG4gICAgY29uc3RydWN0b3Ioc2NvcGVNYW5hZ2VyLCB1cHBlclNjb3BlLCBibG9jaykge1xuICAgICAgICBzdXBlcihzY29wZU1hbmFnZXIsICdjbGFzcycsIHVwcGVyU2NvcGUsIGJsb2NrLCBmYWxzZSk7XG4gICAgfVxufVxuXG4vKiB2aW06IHNldCBzdz00IHRzPTQgZXQgdHc9ODAgOiAqL1xuIl0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9
      diff --git a/tools/eslint/node_modules/escope/lib/variable.js b/tools/eslint/node_modules/escope/lib/variable.js
      index 6630f0a646b56c..2f972c2318000b 100644
      --- a/tools/eslint/node_modules/escope/lib/variable.js
      +++ b/tools/eslint/node_modules/escope/lib/variable.js
      @@ -1,6 +1,10 @@
      -"use strict";
      +'use strict';
       
      -var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
      +Object.defineProperty(exports, "__esModule", {
      +  value: true
      +});
      +
      +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
       
       /*
         Copyright (C) 2015 Yusuke Suzuki 
      @@ -74,16 +78,17 @@ var Variable = function Variable(name, scope) {
         this.scope = scope;
       };
       
      -module.exports = Variable;
      +exports.default = Variable;
      +
       
      -Variable.CatchClause = "CatchClause";
      -Variable.Parameter = "Parameter";
      -Variable.FunctionName = "FunctionName";
      -Variable.ClassName = "ClassName";
      -Variable.Variable = "Variable";
      -Variable.ImportBinding = "ImportBinding";
      -Variable.TDZ = "TDZ";
      -Variable.ImplicitGlobalVariable = "ImplicitGlobalVariable";
      +Variable.CatchClause = 'CatchClause';
      +Variable.Parameter = 'Parameter';
      +Variable.FunctionName = 'FunctionName';
      +Variable.ClassName = 'ClassName';
      +Variable.Variable = 'Variable';
      +Variable.ImportBinding = 'ImportBinding';
      +Variable.TDZ = 'TDZ';
      +Variable.ImplicitGlobalVariable = 'ImplicitGlobalVariable';
       
       /* vim: set sw=4 ts=4 et tw=80 : */
      -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInZhcmlhYmxlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7SUE2QnFCLFFBQVEsR0FDZCxTQURNLFFBQVEsQ0FDYixJQUFJLEVBQUUsS0FBSyxFQUFFO3dCQURSLFFBQVE7Ozs7OztBQU1yQixNQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQzs7Ozs7O0FBTWpCLE1BQUksQ0FBQyxXQUFXLEdBQUcsRUFBRSxDQUFDOzs7Ozs7O0FBT3RCLE1BQUksQ0FBQyxVQUFVLEdBQUcsRUFBRSxDQUFDOzs7Ozs7O0FBT3JCLE1BQUksQ0FBQyxJQUFJLEdBQUcsRUFBRSxDQUFDOztBQUVmLE1BQUksQ0FBQyxPQUFPLEdBQUcsS0FBSyxDQUFDOzs7OztBQUtyQixNQUFJLENBQUMsS0FBSyxHQUFHLElBQUksQ0FBQzs7Ozs7QUFLbEIsTUFBSSxDQUFDLEtBQUssR0FBRyxLQUFLLENBQUM7Q0FDdEI7O2lCQXZDZ0IsUUFBUTs7QUEwQzdCLFFBQVEsQ0FBQyxXQUFXLEdBQUcsYUFBYSxDQUFDO0FBQ3JDLFFBQVEsQ0FBQyxTQUFTLEdBQUcsV0FBVyxDQUFDO0FBQ2pDLFFBQVEsQ0FBQyxZQUFZLEdBQUcsY0FBYyxDQUFDO0FBQ3ZDLFFBQVEsQ0FBQyxTQUFTLEdBQUcsV0FBVyxDQUFDO0FBQ2pDLFFBQVEsQ0FBQyxRQUFRLEdBQUcsVUFBVSxDQUFDO0FBQy9CLFFBQVEsQ0FBQyxhQUFhLEdBQUcsZUFBZSxDQUFDO0FBQ3pDLFFBQVEsQ0FBQyxHQUFHLEdBQUcsS0FBSyxDQUFDO0FBQ3JCLFFBQVEsQ0FBQyxzQkFBc0IsR0FBRyx3QkFBd0IsQ0FBQyIsImZpbGUiOiJ2YXJpYWJsZS5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gIENvcHlyaWdodCAoQykgMjAxNSBZdXN1a2UgU3V6dWtpIDx1dGF0YW5lLnRlYUBnbWFpbC5jb20+XG5cbiAgUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0XG4gIG1vZGlmaWNhdGlvbiwgYXJlIHBlcm1pdHRlZCBwcm92aWRlZCB0aGF0IHRoZSBmb2xsb3dpbmcgY29uZGl0aW9ucyBhcmUgbWV0OlxuXG4gICAgKiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodFxuICAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyLlxuICAgICogUmVkaXN0cmlidXRpb25zIGluIGJpbmFyeSBmb3JtIG11c3QgcmVwcm9kdWNlIHRoZSBhYm92ZSBjb3B5cmlnaHRcbiAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lciBpbiB0aGVcbiAgICAgIGRvY3VtZW50YXRpb24gYW5kL29yIG90aGVyIG1hdGVyaWFscyBwcm92aWRlZCB3aXRoIHRoZSBkaXN0cmlidXRpb24uXG5cbiAgVEhJUyBTT0ZUV0FSRSBJUyBQUk9WSURFRCBCWSBUSEUgQ09QWVJJR0hUIEhPTERFUlMgQU5EIENPTlRSSUJVVE9SUyBcIkFTIElTXCJcbiAgQU5EIEFOWSBFWFBSRVNTIE9SIElNUExJRUQgV0FSUkFOVElFUywgSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFRIRVxuICBJTVBMSUVEIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZIEFORCBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRVxuICBBUkUgRElTQ0xBSU1FRC4gSU4gTk8gRVZFTlQgU0hBTEwgPENPUFlSSUdIVCBIT0xERVI+IEJFIExJQUJMRSBGT1IgQU5ZXG4gIERJUkVDVCwgSU5ESVJFQ1QsIElOQ0lERU5UQUwsIFNQRUNJQUwsIEVYRU1QTEFSWSwgT1IgQ09OU0VRVUVOVElBTCBEQU1BR0VTXG4gIChJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgUFJPQ1VSRU1FTlQgT0YgU1VCU1RJVFVURSBHT09EUyBPUiBTRVJWSUNFUztcbiAgTE9TUyBPRiBVU0UsIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EXG4gIE9OIEFOWSBUSEVPUlkgT0YgTElBQklMSVRZLCBXSEVUSEVSIElOIENPTlRSQUNULCBTVFJJQ1QgTElBQklMSVRZLCBPUiBUT1JUXG4gIChJTkNMVURJTkcgTkVHTElHRU5DRSBPUiBPVEhFUldJU0UpIEFSSVNJTkcgSU4gQU5ZIFdBWSBPVVQgT0YgVEhFIFVTRSBPRlxuICBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLlxuKi9cblxuLyoqXG4gKiBBIFZhcmlhYmxlIHJlcHJlc2VudHMgYSBsb2NhbGx5IHNjb3BlZCBpZGVudGlmaWVyLiBUaGVzZSBpbmNsdWRlIGFyZ3VtZW50cyB0b1xuICogZnVuY3Rpb25zLlxuICogQGNsYXNzIFZhcmlhYmxlXG4gKi9cbmV4cG9ydCBkZWZhdWx0IGNsYXNzIFZhcmlhYmxlIHtcbiAgICBjb25zdHJ1Y3RvcihuYW1lLCBzY29wZSkge1xuICAgICAgICAvKipcbiAgICAgICAgICogVGhlIHZhcmlhYmxlIG5hbWUsIGFzIGdpdmVuIGluIHRoZSBzb3VyY2UgY29kZS5cbiAgICAgICAgICogQG1lbWJlciB7U3RyaW5nfSBWYXJpYWJsZSNuYW1lXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLm5hbWUgPSBuYW1lO1xuICAgICAgICAvKipcbiAgICAgICAgICogTGlzdCBvZiBkZWZpbmluZyBvY2N1cnJlbmNlcyBvZiB0aGlzIHZhcmlhYmxlIChsaWtlIGluICd2YXIgLi4uJ1xuICAgICAgICAgKiBzdGF0ZW1lbnRzIG9yIGFzIHBhcmFtZXRlciksIGFzIEFTVCBub2Rlcy5cbiAgICAgICAgICogQG1lbWJlciB7ZXNwcmltYS5JZGVudGlmaWVyW119IFZhcmlhYmxlI2lkZW50aWZpZXJzXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLmlkZW50aWZpZXJzID0gW107XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBMaXN0IG9mIHtAbGluayBSZWZlcmVuY2V8cmVmZXJlbmNlc30gb2YgdGhpcyB2YXJpYWJsZSAoZXhjbHVkaW5nIHBhcmFtZXRlciBlbnRyaWVzKVxuICAgICAgICAgKiBpbiBpdHMgZGVmaW5pbmcgc2NvcGUgYW5kIGFsbCBuZXN0ZWQgc2NvcGVzLiBGb3IgZGVmaW5pbmdcbiAgICAgICAgICogb2NjdXJyZW5jZXMgb25seSBzZWUge0BsaW5rIFZhcmlhYmxlI2RlZnN9LlxuICAgICAgICAgKiBAbWVtYmVyIHtSZWZlcmVuY2VbXX0gVmFyaWFibGUjcmVmZXJlbmNlc1xuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5yZWZlcmVuY2VzID0gW107XG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIExpc3Qgb2YgZGVmaW5pbmcgb2NjdXJyZW5jZXMgb2YgdGhpcyB2YXJpYWJsZSAobGlrZSBpbiAndmFyIC4uLidcbiAgICAgICAgICogc3RhdGVtZW50cyBvciBhcyBwYXJhbWV0ZXIpLCBhcyBjdXN0b20gb2JqZWN0cy5cbiAgICAgICAgICogQG1lbWJlciB7RGVmaW5pdGlvbltdfSBWYXJpYWJsZSNkZWZzXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLmRlZnMgPSBbXTtcblxuICAgICAgICB0aGlzLnRhaW50ZWQgPSBmYWxzZTtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIFdoZXRoZXIgdGhpcyBpcyBhIHN0YWNrIHZhcmlhYmxlLlxuICAgICAgICAgKiBAbWVtYmVyIHtib29sZWFufSBWYXJpYWJsZSNzdGFja1xuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5zdGFjayA9IHRydWU7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBSZWZlcmVuY2UgdG8gdGhlIGVuY2xvc2luZyBTY29wZS5cbiAgICAgICAgICogQG1lbWJlciB7U2NvcGV9IFZhcmlhYmxlI3Njb3BlXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLnNjb3BlID0gc2NvcGU7XG4gICAgfVxufVxuXG5WYXJpYWJsZS5DYXRjaENsYXVzZSA9ICdDYXRjaENsYXVzZSc7XG5WYXJpYWJsZS5QYXJhbWV0ZXIgPSAnUGFyYW1ldGVyJztcblZhcmlhYmxlLkZ1bmN0aW9uTmFtZSA9ICdGdW5jdGlvbk5hbWUnO1xuVmFyaWFibGUuQ2xhc3NOYW1lID0gJ0NsYXNzTmFtZSc7XG5WYXJpYWJsZS5WYXJpYWJsZSA9ICdWYXJpYWJsZSc7XG5WYXJpYWJsZS5JbXBvcnRCaW5kaW5nID0gJ0ltcG9ydEJpbmRpbmcnO1xuVmFyaWFibGUuVERaID0gJ1REWic7XG5WYXJpYWJsZS5JbXBsaWNpdEdsb2JhbFZhcmlhYmxlID0gJ0ltcGxpY2l0R2xvYmFsVmFyaWFibGUnO1xuXG4vKiB2aW06IHNldCBzdz00IHRzPTQgZXQgdHc9ODAgOiAqL1xuIl0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9
      \ No newline at end of file
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInZhcmlhYmxlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0lBNkJxQixXQUNqQixTQURpQixRQUNqQixDQUFZLElBQVosRUFBa0IsS0FBbEIsRUFBeUI7d0JBRFIsVUFDUTs7Ozs7O0FBS3JCLE9BQUssSUFBTCxHQUFZLElBQVo7Ozs7OztBQUxxQixNQVdyQixDQUFLLFdBQUwsR0FBbUIsRUFBbkI7Ozs7Ozs7QUFYcUIsTUFrQnJCLENBQUssVUFBTCxHQUFrQixFQUFsQjs7Ozs7OztBQWxCcUIsTUF5QnJCLENBQUssSUFBTCxHQUFZLEVBQVosQ0F6QnFCOztBQTJCckIsT0FBSyxPQUFMLEdBQWUsS0FBZjs7Ozs7QUEzQnFCLE1BZ0NyQixDQUFLLEtBQUwsR0FBYSxJQUFiOzs7OztBQWhDcUIsTUFxQ3JCLENBQUssS0FBTCxHQUFhLEtBQWIsQ0FyQ3FCO0NBQXpCOztrQkFEaUI7OztBQTBDckIsU0FBUyxXQUFULEdBQXVCLGFBQXZCO0FBQ0EsU0FBUyxTQUFULEdBQXFCLFdBQXJCO0FBQ0EsU0FBUyxZQUFULEdBQXdCLGNBQXhCO0FBQ0EsU0FBUyxTQUFULEdBQXFCLFdBQXJCO0FBQ0EsU0FBUyxRQUFULEdBQW9CLFVBQXBCO0FBQ0EsU0FBUyxhQUFULEdBQXlCLGVBQXpCO0FBQ0EsU0FBUyxHQUFULEdBQWUsS0FBZjtBQUNBLFNBQVMsc0JBQVQsR0FBa0Msd0JBQWxDIiwiZmlsZSI6InZhcmlhYmxlLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLypcbiAgQ29weXJpZ2h0IChDKSAyMDE1IFl1c3VrZSBTdXp1a2kgPHV0YXRhbmUudGVhQGdtYWlsLmNvbT5cblxuICBSZWRpc3RyaWJ1dGlvbiBhbmQgdXNlIGluIHNvdXJjZSBhbmQgYmluYXJ5IGZvcm1zLCB3aXRoIG9yIHdpdGhvdXRcbiAgbW9kaWZpY2F0aW9uLCBhcmUgcGVybWl0dGVkIHByb3ZpZGVkIHRoYXQgdGhlIGZvbGxvd2luZyBjb25kaXRpb25zIGFyZSBtZXQ6XG5cbiAgICAqIFJlZGlzdHJpYnV0aW9ucyBvZiBzb3VyY2UgY29kZSBtdXN0IHJldGFpbiB0aGUgYWJvdmUgY29weXJpZ2h0XG4gICAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIuXG4gICAgKiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodFxuICAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyIGluIHRoZVxuICAgICAgZG9jdW1lbnRhdGlvbiBhbmQvb3Igb3RoZXIgbWF0ZXJpYWxzIHByb3ZpZGVkIHdpdGggdGhlIGRpc3RyaWJ1dGlvbi5cblxuICBUSElTIFNPRlRXQVJFIElTIFBST1ZJREVEIEJZIFRIRSBDT1BZUklHSFQgSE9MREVSUyBBTkQgQ09OVFJJQlVUT1JTIFwiQVMgSVNcIlxuICBBTkQgQU5ZIEVYUFJFU1MgT1IgSU1QTElFRCBXQVJSQU5USUVTLCBJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgVEhFXG4gIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFXG4gIEFSRSBESVNDTEFJTUVELiBJTiBOTyBFVkVOVCBTSEFMTCA8Q09QWVJJR0hUIEhPTERFUj4gQkUgTElBQkxFIEZPUiBBTllcbiAgRElSRUNULCBJTkRJUkVDVCwgSU5DSURFTlRBTCwgU1BFQ0lBTCwgRVhFTVBMQVJZLCBPUiBDT05TRVFVRU5USUFMIERBTUFHRVNcbiAgKElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTO1xuICBMT1NTIE9GIFVTRSwgREFUQSwgT1IgUFJPRklUUzsgT1IgQlVTSU5FU1MgSU5URVJSVVBUSU9OKSBIT1dFVkVSIENBVVNFRCBBTkRcbiAgT04gQU5ZIFRIRU9SWSBPRiBMSUFCSUxJVFksIFdIRVRIRVIgSU4gQ09OVFJBQ1QsIFNUUklDVCBMSUFCSUxJVFksIE9SIFRPUlRcbiAgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFIE9GXG4gIFRISVMgU09GVFdBUkUsIEVWRU4gSUYgQURWSVNFRCBPRiBUSEUgUE9TU0lCSUxJVFkgT0YgU1VDSCBEQU1BR0UuXG4qL1xuXG4vKipcbiAqIEEgVmFyaWFibGUgcmVwcmVzZW50cyBhIGxvY2FsbHkgc2NvcGVkIGlkZW50aWZpZXIuIFRoZXNlIGluY2x1ZGUgYXJndW1lbnRzIHRvXG4gKiBmdW5jdGlvbnMuXG4gKiBAY2xhc3MgVmFyaWFibGVcbiAqL1xuZXhwb3J0IGRlZmF1bHQgY2xhc3MgVmFyaWFibGUge1xuICAgIGNvbnN0cnVjdG9yKG5hbWUsIHNjb3BlKSB7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBUaGUgdmFyaWFibGUgbmFtZSwgYXMgZ2l2ZW4gaW4gdGhlIHNvdXJjZSBjb2RlLlxuICAgICAgICAgKiBAbWVtYmVyIHtTdHJpbmd9IFZhcmlhYmxlI25hbWVcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMubmFtZSA9IG5hbWU7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBMaXN0IG9mIGRlZmluaW5nIG9jY3VycmVuY2VzIG9mIHRoaXMgdmFyaWFibGUgKGxpa2UgaW4gJ3ZhciAuLi4nXG4gICAgICAgICAqIHN0YXRlbWVudHMgb3IgYXMgcGFyYW1ldGVyKSwgYXMgQVNUIG5vZGVzLlxuICAgICAgICAgKiBAbWVtYmVyIHtlc3ByaW1hLklkZW50aWZpZXJbXX0gVmFyaWFibGUjaWRlbnRpZmllcnNcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMuaWRlbnRpZmllcnMgPSBbXTtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIExpc3Qgb2Yge0BsaW5rIFJlZmVyZW5jZXxyZWZlcmVuY2VzfSBvZiB0aGlzIHZhcmlhYmxlIChleGNsdWRpbmcgcGFyYW1ldGVyIGVudHJpZXMpXG4gICAgICAgICAqIGluIGl0cyBkZWZpbmluZyBzY29wZSBhbmQgYWxsIG5lc3RlZCBzY29wZXMuIEZvciBkZWZpbmluZ1xuICAgICAgICAgKiBvY2N1cnJlbmNlcyBvbmx5IHNlZSB7QGxpbmsgVmFyaWFibGUjZGVmc30uXG4gICAgICAgICAqIEBtZW1iZXIge1JlZmVyZW5jZVtdfSBWYXJpYWJsZSNyZWZlcmVuY2VzXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLnJlZmVyZW5jZXMgPSBbXTtcblxuICAgICAgICAvKipcbiAgICAgICAgICogTGlzdCBvZiBkZWZpbmluZyBvY2N1cnJlbmNlcyBvZiB0aGlzIHZhcmlhYmxlIChsaWtlIGluICd2YXIgLi4uJ1xuICAgICAgICAgKiBzdGF0ZW1lbnRzIG9yIGFzIHBhcmFtZXRlciksIGFzIGN1c3RvbSBvYmplY3RzLlxuICAgICAgICAgKiBAbWVtYmVyIHtEZWZpbml0aW9uW119IFZhcmlhYmxlI2RlZnNcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMuZGVmcyA9IFtdO1xuXG4gICAgICAgIHRoaXMudGFpbnRlZCA9IGZhbHNlO1xuICAgICAgICAvKipcbiAgICAgICAgICogV2hldGhlciB0aGlzIGlzIGEgc3RhY2sgdmFyaWFibGUuXG4gICAgICAgICAqIEBtZW1iZXIge2Jvb2xlYW59IFZhcmlhYmxlI3N0YWNrXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLnN0YWNrID0gdHJ1ZTtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIFJlZmVyZW5jZSB0byB0aGUgZW5jbG9zaW5nIFNjb3BlLlxuICAgICAgICAgKiBAbWVtYmVyIHtTY29wZX0gVmFyaWFibGUjc2NvcGVcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMuc2NvcGUgPSBzY29wZTtcbiAgICB9XG59XG5cblZhcmlhYmxlLkNhdGNoQ2xhdXNlID0gJ0NhdGNoQ2xhdXNlJztcblZhcmlhYmxlLlBhcmFtZXRlciA9ICdQYXJhbWV0ZXInO1xuVmFyaWFibGUuRnVuY3Rpb25OYW1lID0gJ0Z1bmN0aW9uTmFtZSc7XG5WYXJpYWJsZS5DbGFzc05hbWUgPSAnQ2xhc3NOYW1lJztcblZhcmlhYmxlLlZhcmlhYmxlID0gJ1ZhcmlhYmxlJztcblZhcmlhYmxlLkltcG9ydEJpbmRpbmcgPSAnSW1wb3J0QmluZGluZyc7XG5WYXJpYWJsZS5URFogPSAnVERaJztcblZhcmlhYmxlLkltcGxpY2l0R2xvYmFsVmFyaWFibGUgPSAnSW1wbGljaXRHbG9iYWxWYXJpYWJsZSc7XG5cbi8qIHZpbTogc2V0IHN3PTQgdHM9NCBldCB0dz04MCA6ICovXG4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/.lint b/tools/eslint/node_modules/escope/node_modules/es6-map/.lint
      deleted file mode 100644
      index e8cb4c7581685f..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/.lint
      +++ /dev/null
      @@ -1,11 +0,0 @@
      -@root
      -
      -module
      -
      -indent 2
      -maxlen 80
      -tabs
      -
      -ass
      -nomen
      -plusplus
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/.travis.yml b/tools/eslint/node_modules/escope/node_modules/es6-map/.travis.yml
      deleted file mode 100644
      index 9181d7823d86b8..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/.travis.yml
      +++ /dev/null
      @@ -1,11 +0,0 @@
      -language: node_js
      -node_js:
      -  - 0.8
      -  - 0.10
      -  - 0.11
      -
      -notifications:
      -  email:
      -    - medikoo+es6-map@medikoo.com
      -
      -script: "npm test && npm run lint"
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/CHANGES b/tools/eslint/node_modules/escope/node_modules/es6-map/CHANGES
      deleted file mode 100644
      index a17e221ab39e40..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/CHANGES
      +++ /dev/null
      @@ -1,16 +0,0 @@
      -v0.1.1  --  2014.10.07
      -* Fix isImplemented so native Maps are detected properly
      -* Configure lint scripts
      -
      -v0.1.0  --  2014.04.29
      -* Assure strictly npm hosted dependencies
      -* Update to use latest versions of dependencies
      -
      -v0.0.1  --  2014.04.25
      -* Provide @@toStringTag symbol, and use other ES 6 symbols
      -* Fix iterators handling
      -* Fix isImplemented so it doesn't crash
      -* Update up to changes in dependencies
      -
      -v0.0.0  --  2013.11.10
      -- Initial (dev) version
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/README.md b/tools/eslint/node_modules/escope/node_modules/es6-map/README.md
      deleted file mode 100644
      index 1ea3a953c5093a..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/README.md
      +++ /dev/null
      @@ -1,75 +0,0 @@
      -# es6-map
      -## Map collection as specified in ECMAScript6
      -
      -### Usage
      -
      -If you want to make sure your environment implements `Map`, do:
      -
      -```javascript
      -require('es6-map/implement');
      -```
      -
      -If you'd like to use native version when it exists and fallback to polyfill if it doesn't, but without implementing `Map` on global scope, do:
      -
      -```javascript
      -var Map = require('es6-map');
      -```
      -
      -If you strictly want to use polyfill even if native `Map` exists, do:
      -
      -```javascript
      -var Map = require('es6-map/polyfill');
      -```
      -
      -### Installation
      -
      -	$ npm install es6-map
      -	
      -To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)
      -
      -#### API
      -
      -Best is to refer to [specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-map-objects). Still if you want quick look, follow examples:
      -
      -```javascript
      -var Map = require('es6-map');
      -
      -var x = {}, y = {}, map = new Map([['raz', 'one'], ['dwa', 'two'], [x, y]]);
      -
      -map.size;                 // 3
      -map.get('raz');           // 'one'
      -map.get(x);               // y
      -map.has('raz');           // true
      -map.has(x);               // true
      -map.has('foo');           // false
      -map.set('trzy', 'three'); // map
      -map.size                  // 4
      -map.get('trzy');          // 'three'
      -map.has('trzy');          // true
      -map.has('dwa');           // true
      -map.delete('dwa');        // true
      -map.size;                 // 3
      -
      -map.forEach(function (value, key) {
      -  // { 'raz', 'one' }, { x, y }, { 'trzy', 'three' } iterated
      -});
      -
      -// FF nightly only:
      -for (value of map) {
      - // ['raz', 'one'], [x, y], ['trzy', 'three'] iterated
      -}
      -
      -var iterator = map.values();
      -
      -iterator.next(); // { done: false, value: 'one' }
      -iterator.next(); // { done: false, value: y }
      -iterator.next(); // { done: false, value: 'three' }
      -iterator.next(); // { done: true, value: undefined }
      -
      -map.clear(); // undefined
      -map.size; // 0
      -```
      -
      -## Tests [![Build Status](https://travis-ci.org/medikoo/es6-map.png)](https://travis-ci.org/medikoo/es6-map)
      -
      -	$ npm test
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-map/is-implemented.js
      deleted file mode 100644
      index cb872fa45938a9..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/is-implemented.js
      +++ /dev/null
      @@ -1,30 +0,0 @@
      -'use strict';
      -
      -module.exports = function () {
      -	var map, iterator, result;
      -	if (typeof Map !== 'function') return false;
      -	try {
      -		// WebKit doesn't support arguments and crashes
      -		map = new Map([['raz', 'one'], ['dwa', 'two'], ['trzy', 'three']]);
      -	} catch (e) {
      -		return false;
      -	}
      -	if (map.size !== 3) return false;
      -	if (typeof map.clear !== 'function') return false;
      -	if (typeof map.delete !== 'function') return false;
      -	if (typeof map.entries !== 'function') return false;
      -	if (typeof map.forEach !== 'function') return false;
      -	if (typeof map.get !== 'function') return false;
      -	if (typeof map.has !== 'function') return false;
      -	if (typeof map.keys !== 'function') return false;
      -	if (typeof map.set !== 'function') return false;
      -	if (typeof map.values !== 'function') return false;
      -
      -	iterator = map.entries();
      -	result = iterator.next();
      -	if (result.done !== false) return false;
      -	if (!result.value) return false;
      -	if (result.value[0] !== 'raz') return false;
      -	if (result.value[1] !== 'one') return false;
      -	return true;
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/is-map.js b/tools/eslint/node_modules/escope/node_modules/es6-map/is-map.js
      deleted file mode 100644
      index f45526a43ba1db..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/is-map.js
      +++ /dev/null
      @@ -1,12 +0,0 @@
      -'use strict';
      -
      -var toStringTagSymbol = require('es6-symbol').toStringTag
      -
      -  , toString = Object.prototype.toString
      -  , id = '[object Map]'
      -  , Global = (typeof Map === 'undefined') ? null : Map;
      -
      -module.exports = function (x) {
      -	return (x && ((Global && (x instanceof Global)) ||
      -			(toString.call(x) === id) || (x[toStringTagSymbol] === 'Map'))) || false;
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/is-native-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-map/is-native-implemented.js
      deleted file mode 100644
      index 208c6613cff844..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/is-native-implemented.js
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -// Exports true if environment provides native `Map` implementation,
      -// whatever that is.
      -
      -'use strict';
      -
      -module.exports = (function () {
      -	if (typeof Map === 'undefined') return false;
      -	return (Object.prototype.toString.call(Map.prototype) === '[object Map]');
      -}());
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/package.json b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/package.json
      deleted file mode 100644
      index 03d81db13be8d9..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/package.json
      +++ /dev/null
      @@ -1,59 +0,0 @@
      -{
      -  "name": "d",
      -  "version": "0.1.1",
      -  "description": "Property descriptor factory",
      -  "author": {
      -    "name": "Mariusz Nowak",
      -    "email": "medyk@medikoo.com",
      -    "url": "http://www.medikoo.com/"
      -  },
      -  "scripts": {
      -    "test": "node node_modules/tad/bin/tad"
      -  },
      -  "repository": {
      -    "type": "git",
      -    "url": "git://github.com/medikoo/d.git"
      -  },
      -  "keywords": [
      -    "descriptor",
      -    "es",
      -    "ecmascript",
      -    "ecma",
      -    "property",
      -    "descriptors",
      -    "meta",
      -    "properties"
      -  ],
      -  "dependencies": {
      -    "es5-ext": "~0.10.2"
      -  },
      -  "devDependencies": {
      -    "tad": "~0.1.21"
      -  },
      -  "license": "MIT",
      -  "bugs": {
      -    "url": "https://github.com/medikoo/d/issues"
      -  },
      -  "homepage": "https://github.com/medikoo/d",
      -  "_id": "d@0.1.1",
      -  "dist": {
      -    "shasum": "da184c535d18d8ee7ba2aa229b914009fae11309",
      -    "tarball": "http://registry.npmjs.org/d/-/d-0.1.1.tgz"
      -  },
      -  "_from": "d@>=0.1.1 <0.2.0",
      -  "_npmVersion": "1.4.3",
      -  "_npmUser": {
      -    "name": "medikoo",
      -    "email": "medikoo+npm@medikoo.com"
      -  },
      -  "maintainers": [
      -    {
      -      "name": "medikoo",
      -      "email": "medikoo+npm@medikoo.com"
      -    }
      -  ],
      -  "directories": {},
      -  "_shasum": "da184c535d18d8ee7ba2aa229b914009fae11309",
      -  "_resolved": "https://registry.npmjs.org/d/-/d-0.1.1.tgz",
      -  "readme": "ERROR: No README data found!"
      -}
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/.lintignore b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/.lintignore
      deleted file mode 100644
      index ed703ed7662c89..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/.lintignore
      +++ /dev/null
      @@ -1,8 +0,0 @@
      -/string/#/normalize/_data.js
      -/test/boolean/is-boolean.js
      -/test/date/is-date.js
      -/test/number/is-number.js
      -/test/object/is-copy.js
      -/test/object/is-object.js
      -/test/reg-exp/is-reg-exp.js
      -/test/string/is-string.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/.travis.yml b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/.travis.yml
      deleted file mode 100644
      index a183dbcec61795..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/.travis.yml
      +++ /dev/null
      @@ -1,15 +0,0 @@
      -sudo: false # http://docs.travis-ci.com/user/workers/container-based-infrastructure/
      -language: node_js
      -node_js:
      -  - 0.10
      -  - 0.12
      -  - iojs
      -
      -before_install:
      -  - mkdir node_modules; ln -s ../ node_modules/es5-ext
      -
      -notifications:
      -  email:
      -    - medikoo+es5-ext@medikoo.com
      -
      -script: "npm test && npm run lint"
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/CHANGES b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/CHANGES
      deleted file mode 100644
      index 5d0ace5bfe2f8d..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/CHANGES
      +++ /dev/null
      @@ -1,611 +0,0 @@
      -v0.10.7  --  2015.04.22
      -* New utlitities. They're convention differs from v0.10, as they were supposed to land in v1.
      -  Still they're non breaking and start the conventions to be used in v1
      -  * Object.validateArrayLike
      -  * Object.validateArrayLikeObject
      -  * Object.validateStringifiable
      -  * Object.validateStringifiableValue
      -  * Universal utilities for array-like/iterable objects
      -    * Iterable.is
      -    * Iterable.validate
      -    * Iterable.validateObject
      -    * Iterable.forEach
      -* Fix camelToHyphen resolution, it must be absolutely reversable by hyphenToCamel
      -* Fix calculations of large numbers in Math.tanh
      -* Fix algorithm of Math.sinh
      -* Fix indexes to not use real symbols
      -* Fix length of String.fromCodePoint
      -* Fix tests of Array#copyWithin
      -* Update Travis CI configuration
      -
      -v0.10.6  --  2015.02.02
      -* Fix handling of infinite values in Math.trunc
      -* Fix handling of getters in Object.normalizeOptions
      -
      -v0.10.5  --  2015.01.20
      -* Add Function#toStringTokens
      -* Add Object.serialize and Object.unserialize
      -* Add String.randomUniq
      -* Fix Strin#camelToHyphen issue with tokens that end with digit
      -* Optimise Number.isInteger logic
      -* Improve documentation
      -* Configure lint scripts
      -* Fix spelling of LICENSE
      -
      -v0.10.4  --  2014.04.30
      -* Assure maximum spec compliance of Array.of and Array.from (thanks @mathiasbynens)
      -* Improve documentations
      -
      -v0.10.3  --  2014.04.29
      -Provide accurate iterators handling:
      -* Array.from improvements:
      -  * Assure right unicode symbols resolution when processing strings in Array.from
      -  * Rely on ES6 symbol shim and use native @@iterator Symbol if provided by environment
      -* Add methods:
      -  * Array.prototype.entries
      -  * Array.prototype.keys
      -  * Array.prototype.values
      -  * Array.prototype[@@iterator]
      -  * String.prototype[@@iterator]
      -
      -Improve documentation
      -
      -v0.10.2  --  2014.04.24
      -- Simplify and deprecate `isCallable`. It seems in ES5 based engines there are
      -  no callable objects which are `typeof obj !== 'function'`
      -- Update Array.from map callback signature (up to latest resolution of TC39)
      -- Improve documentation
      -
      -v0.10.1  --  2014.04.14
      -Bump version for npm
      -(Workaround for accidental premature publish & unpublish of v0.10.0 a while ago)
      -
      -v0.10.0  --  2014.04.13
      -Major update:
      -- All methods and function specified for ECMAScript 6 are now introduced as
      -  shims accompanied with functions through which (optionally) they can be
      -  implementend on native objects
      -- Filename convention was changed to shorter and strictly lower case names. e.g.
      -  `lib/String/prototype/starts-with` became `string/#/starts-with`
      -- Generated functions are guaranteed to have expected length
      -- Objects with null prototype (created via `Object.create(null)`) are widely
      -  supported (older version have crashed due to implied `obj.hasOwnProperty` and
      -  related invocations)
      -- Support array subclasses
      -- When handling lists do not limit its length to Uint32 range
      -- Use newly introduced `Object.eq` for strict equality in place of `Object.is`
      -- Iteration of Object have been improved so properties that were hidden or
      -  removed after iteration started are not iterated.
      -
      -Additions:
      -- `Array.isPlainArray`
      -- `Array.validArray`
      -- `Array.prototype.concat` (as updated with ES6)
      -- `Array.prototype.copyWithin` (as introduced with ES6)
      -- `Array.prototype.fill` (as introduced with ES6)
      -- `Array.prototype.filter` (as updated with ES6)
      -- `Array.prototype.findIndex` (as introduced with ES6)
      -- `Array.prototype.map` (as updated with ES6)
      -- `Array.prototype.separate`
      -- `Array.prototype.slice` (as updated with ES6)
      -- `Array.prototype.splice` (as updated with ES6)
      -- `Function.prototype.copy`
      -- `Math.acosh` (as introduced with ES6)
      -- `Math.atanh` (as introduced with ES6)
      -- `Math.cbrt` (as introduced with ES6)
      -- `Math.clz32` (as introduced with ES6)
      -- `Math.cosh` (as introduced with ES6)
      -- `Math.expm1` (as introduced with ES6)
      -- `Math.fround` (as introduced with ES6)
      -- `Math.hypot` (as introduced with ES6)
      -- `Math.imul` (as introduced with ES6)
      -- `Math.log2` (as introduced with ES6)
      -- `Math.log10` (as introduced with ES6)
      -- `Math.log1p` (as introduced with ES6)
      -- `Math.sinh` (as introduced with ES6)
      -- `Math.tanh` (as introduced with ES6)
      -- `Math.trunc` (as introduced with ES6)
      -- `Number.EPSILON` (as introduced with ES6)
      -- `Number.MIN_SAFE_INTEGER` (as introduced with ES6)
      -- `Number.MAX_SAFE_INTEGER` (as introduced with ES6)
      -- `Number.isFinite` (as introduced with ES6)
      -- `Number.isInteger` (as introduced with ES6)
      -- `Number.isSafeInteger` (as introduced with ES6)
      -- `Object.create` (with fix for V8 issue which disallows prototype turn of
      -  objects derived from null
      -- `Object.eq` - Less restrictive version of `Object.is` based on SameValueZero
      -  algorithm
      -- `Object.firstKey`
      -- `Object.keys` (as updated with ES6)
      -- `Object.mixinPrototypes`
      -- `Object.primitiveSet`
      -- `Object.setPrototypeOf` (as introduced with ES6)
      -- `Object.validObject`
      -- `RegExp.escape`
      -- `RegExp.prototype.match` (as introduced with ES6)
      -- `RegExp.prototype.replace` (as introduced with ES6)
      -- `RegExp.prototype.search` (as introduced with ES6)
      -- `RegExp.prototype.split` (as introduced with ES6)
      -- `RegExp.prototype.sticky` (as introduced with ES6)
      -- `RegExp.prototype.unicode` (as introduced with ES6)
      -- `String.fromCodePoint` (as introduced with ES6)
      -- `String.raw` (as introduced with ES6)
      -- `String.prototype.at`
      -- `String.prototype.codePointAt` (as introduced with ES6)
      -- `String.prototype.normalize` (as introduced with ES6)
      -- `String.prototype.plainReplaceAll`
      -
      -Removals:
      -- `reserved` set
      -- `Array.prototype.commonLeft`
      -- `Function.insert`
      -- `Function.remove`
      -- `Function.prototype.silent`
      -- `Function.prototype.wrap`
      -- `Object.descriptor` Move to external `d` project.
      -  See: https://github.com/medikoo/d
      -- `Object.diff`
      -- `Object.extendDeep`
      -- `Object.reduce`
      -- `Object.values`
      -- `String.prototype.trimCommonLeft`
      -
      -Renames:
      -- `Function.i` into `Function.identity`
      -- `Function.k` into `Function.constant`
      -- `Number.toInt` into `Number.toInteger`
      -- `Number.toUint` into `Number.toPosInteger`
      -- `Object.extend` into `Object.assign` (as introduced in ES 6)
      -- `Object.extendProperties` into `Object.mixin`, with improved internal
      -  handling, so it matches temporarily specified `Object.mixin` for ECMAScript 6
      -- `Object.isList` into `Object.isArrayLike`
      -- `Object.mapToArray` into `Object.toArray` (with fixed function length)
      -- `Object.toPlainObject` into `Object.normalizeOptions` (as this is the real
      -  use case where we use this function)
      -- `Function.prototype.chain` into `Function.prototype.compose`
      -- `Function.prototype.match` into `Function.prototype.spread`
      -- `String.prototype.format` into `String.formatMethod`
      -
      -Improvements & Fixes:
      -- Remove workaround for primitive values handling in object iterators
      -- `Array.from`: Update so it follows ES 6 spec
      -- `Array.prototype.compact`: filters just null and undefined values
      -  (not all falsies)
      -- `Array.prototype.eIndexOf` and `Array.prototype.eLastIndexOf`: fix position
      -  handling, improve internals
      -- `Array.prototype.find`: return undefined not null, in case of not found
      -  (follow ES 6)
      -- `Array.prototype.remove` fix function length
      -- `Error.custom`: simplify, Custom class case is addressed by outer
      -  `error-create` project -> https://github.com/medikoo/error-create
      -- `Error.isError` true only for Error instances (remove detection of host
      -  Exception objects)
      -- `Number.prototype.pad`: Normalize negative pad
      -- `Object.clear`: Handle errors same way as in `Object.assign`
      -- `Object.compact`: filters just null and undefined values (not all falsies)
      -- `Object.compare`: Take into account NaN values
      -- `Object.copy`: Split into `Object.copy` and `Object.copyDeep`
      -- `Object.isCopy`: Separate into `Object.isCopy` and `Object.isCopyDeep`, where
      -  `isCopyDeep` handles nested plain objects and plain arrays only
      -- `String.prototype.endsWith`: Adjust up to ES6 specification
      -- `String.prototype.repeat`: Adjust up to ES6 specification and improve algorithm
      -- `String.prototype.simpleReplace`: Rename into `String.prototype.plainReplace`
      -- `String.prototype.startsWith`: Adjust up to ES6 specification
      -- Update lint rules, and adjust code to that
      -- Update Travis CI configuration
      -- Remove Makefile (it's cross-env utility)
      -
      -v0.9.2  --  2013.03.11
      -Added:
      -* Array.prototype.isCopy
      -* Array.prototype.isUniq
      -* Error.CustomError
      -* Function.validFunction
      -* Object.extendDeep
      -* Object.descriptor.binder
      -* Object.safeTraverse
      -* RegExp.validRegExp
      -* String.prototype.capitalize
      -* String.prototype.simpleReplace
      -
      -Fixed:
      -* Fix Array.prototype.diff for sparse arrays
      -* Accept primitive objects as input values in Object iteration methods and
      -  Object.clear, Object.count, Object.diff, Object.extend,
      -  Object.getPropertyNames, Object.values
      -* Pass expected arguments to callbacks of Object.filter, Object.mapKeys,
      -  Object.mapToArray, Object.map
      -* Improve callable callback support in Object.mapToArray
      -
      -v0.9.1  --  2012.09.17
      -* Object.reduce - reduce for hash-like collections
      -* Accapt any callable object as callback in Object.filter, mapKeys and map
      -* Convention cleanup
      -
      -v0.9.0  --  2012.09.13
      -We're getting to real solid API
      -
      -Removed:
      -* Function#memoize - it's grown up to be external package, to be soon published
      -  as 'memoizee'
      -* String.guid - it doesn't fit es5-ext (extensions) concept, will be provided as
      -  external package
      -# Function.arguments - obsolete
      -# Function.context - obsolete
      -# Function#flip - not readable when used, so it was never used
      -# Object.clone - obsolete and confusing
      -
      -Added:
      -* String#camelToHyphen - String format convertion
      -
      -Renamed:
      -* String#dashToCamelCase -> String#hyphenToCamel
      -
      -Fixes:
      -* Object.isObject - Quote names in literals that match reserved keywords
      -  (older implementations crashed on that)
      -* String#repeat - Do not accept negative values (coerce them to 1)
      -
      -Improvements:
      -* Array#remove - Accepts many arguments, we can now remove many values at once
      -* Object iterators (forEach, map, some) - Compare function invoked with scope
      -  object bound to this
      -* Function#curry - Algorithm cleanup
      -* Object.isCopy - Support for all types, not just plain objects
      -* Object.isPlainObject - Support for cross-frame objects
      -* Do not memoize any of the functions, it shouldn't be decided internally
      -* Remove Object.freeze calls in reserved, it's not up to convention
      -* Improved documentation
      -* Better linting (hard-core approach using both JSLint mod and JSHint)
      -* Optional arguments are now documented in funtions signature
      -
      -v0.8.2  --  2012.06.22
      -Fix errors in Array's intersection and exclusion methods, related to improper
      -usage of contains method
      -
      -v0.8.1  --  2012.06.13
      -Reorganized internal logic of Function.prototype.memoize. So it's more safe now
      -and clears cache properly. Additionally preventCache option was provided.
      -
      -v0.8.0  --  2012.05.28
      -Again, major overhaul. Probably last experimental stuff was trashed, all API
      -looks more like standard extensions now.
      -
      -Changes:
      -* Turn all Object.prototype extensions into functions and move them to Object
      -namespace. We learned that extending Object.prototype is bad idea in any case.
      -* Rename Function.prototype.curry into Function.prototype.partial. This function
      -  is really doing partial application while currying is slightly different
      -  concept.
      -* Convert Function.prototype.ncurry to new implementation of
      -  Function.prototype.curry, it now serves real curry concept additionaly it
      -  covers use cases for aritize and hold, which were removed.
      -* Rename Array's peek to last, and provide support for sparse arrays in it
      -* Rename Date's monthDaysCount into daysInMonth
      -* Simplify object iterators, now order of iteration can be configured with just
      -  compareFn argument (no extra byKeys option)
      -* Rename Object.isDuplicate to Object.isCopy
      -* Rename Object.isEqual to Object.is which is compatible with future 'is'
      -  keyword
      -* Function.memoize is now Function.prototype.memoize. Additionally clear cache
      -  functionality is added, and access to original arguments object.
      -* Rename validation functions: assertNotNull to validValue, assertCallable to
      -  validCallable. validValue was moved to Object namespace. On success they now
      -  return validated value instead of true, it supports better composition.
      -  Additionally created Date.validDate and Error.validError
      -* All documentation is now held in README.md not in code files.
      -* Move guid to String namespace. All guids now start with numbers.
      -* Array.generate: fill argument is now optional
      -* Object.toArray is now Array.from (as new ES6 specification draft suggests)
      -* All methods that rely on indexOf or lastIndexOf, now rely on egal (Object.is)
      -  versions of them (eIndexOf, eLastIndexOf)
      -* Turn all get* functions that returned methods into actuall methods (get*
      -  functionality can still be achieved with help of Function.prototype.partial).
      -  So: Date.getFormat is now Date.prototype.format,
      -  Number.getPad is now Number.prototype.pad,
      -  String.getFormat is now String.prototype.format,
      -  String.getIndent is now String.prototype.indent,
      -  String.getPad is now String.prototype.pad
      -* Refactored Object.descriptor, it is now just two functions, main one and
      -  main.gs, main is for describing values, and gs for describing getters and
      -  setters. Configuration is passed with first argument as string e.g. 'ce' for
      -  configurable and enumerable. If no configuration string is provided then by
      -  default it returns configurable and writable but not enumerable for value or
      -  configurable but not enumerable for getter/setter
      -* Function.prototype.silent now returns prepared function (it was
      -  expected to be fixed for 0.7)
      -* Reserved keywords map (reserved) is now array not hash.
      -* Object.merge is now Object.extend (while former Object.extend was completely
      -  removed) - 'extend' implies that we change object, not creating new one (as
      -  'merge' may imply). Similarily Object.mergeProperties was renamed to
      -  Object.extendProperties
      -* Position argument support in Array.prototype.contains and
      -  String.prototype.contains (so it follows ES6 specification draft)
      -* endPosition argument support in String.prototype.endsWith and fromPosition
      -  argument support in String.prototype.startsWith (so it follows ES6
      -  specification draft)
      -* Better and cleaner String.prototype.indent implementation. No default value
      -  for indent string argument, optional nest value (defaults to 1), remove
      -  nostart argument
      -* Correct length values for most methods (so they reflect length of similar
      -  methods in standard)
      -* Length argument is now optional in number and string pad methods.
      -* Improve arguments validation in general, so it adheres to standard conventions
      -* Fixed format of package.json
      -
      -Removed methods and functions:
      -* Object.prototype.slice - Object is not ordered collection, so slice doesn't
      -  make sense.
      -* Function's rcurry, rncurry, s - too cumbersome for JS, not many use cases for
      -  that
      -* Function.prototype.aritize and Function.prototype.hold - same functionality
      -  can be achieved with new Function.prototype.curry
      -* Function.prototype.log - provided more generic Function.prototype.wrap for
      -  same use case
      -* getNextIdGenerator - no use case for that (String.guid should be used if
      -  needed)
      -* Object.toObject - Can be now acheived with Object(validValue(x))
      -* Array.prototype.someValue - no real use case (personally used once and
      -  case was already controversial)
      -* Date.prototype.duration - moved to external package
      -* Number.getAutoincrement - No real use case
      -* Object.prototype.extend, Object.prototype.override,
      -  Object.prototype.plainCreate, Object.prototype.plainExtend - It was probably
      -  too complex, same should be achieved just with Object.create,
      -  Object.descriptor and by saving references to super methods in local scope.
      -* Object.getCompareBy - Functions should be created individually for each use
      -  case
      -* Object.get, Object.getSet, Object.set, Object.unset - Not many use cases and
      -  same can be easily achieved with simple inline function
      -* String.getPrefixWith - Not real use case for something that can be easily
      -  achieved with '+' operator
      -* Object.isPrimitive - It's just negation of Object.isObject
      -* Number.prototype.isLess, Number.prototype.isLessOrEqual - they shouldn't be in
      -  Number namespace and should rather be addressed with simple inline functions.
      -* Number.prototype.subtract - Should rather be addressed with simple inline
      -  function
      -
      -New methods and functions:
      -* Array.prototype.lastIndex - Returns last declared index in array
      -* String.prototype.last - last for strings
      -* Function.prototype.wrap - Wrap function with other, it allows to specify
      -  before and after behavior transform return value or prevent original function
      -  from being called.
      -* Math.sign - Returns sign of a number (already in ES6 specification draft)
      -* Number.toInt - Converts value to integer (already in ES6 specification draft)
      -* Number.isNaN - Returns true if value is NaN (already in ES6 specification
      -  draft)
      -* Number.toUint - Converts value to unsigned integer
      -* Number.toUint32 - Converts value to 32bit unsigned integer
      -* Array.prototype.eIndexOf, eLastIndexOf - Egal version (that uses Object.is) of
      -  standard methods (all methods that were using native indexOf or lastIndexOf
      -  now uses eIndexOf and elastIndexOf respectively)
      -* Array.of - as it's specified for ES6
      -
      -Fixes:
      -* Fixed binarySearch so it always returns valid list index
      -* Object.isList - it failed on lists that are callable (e.g. NodeList in Nitro
      -  engine)
      -* Object.map now supports third argument for callback
      -
      -v0.7.1  --  2012.01.05
      -New methods:
      -* Array.prototype.firstIndex - returns first valid index of array (for
      -	sparse arrays it may not be '0'
      -
      -Improvements:
      -* Array.prototype.first - now returns value for index returned by firstIndex
      -* Object.prototype.mapToArray - can be called without callback, then array of
      -	key-value pairs is returned
      -
      -Fixes
      -* Array.prototype.forEachRight, object's length read through UInt32 conversion
      -
      -v0.7.0  --  2011.12.27
      -Major update.
      -Stepped back from experimental ideas and introduced more standard approach
      -taking example from how ES5 methods and functions are designed. One exceptions
      -is that, we don’t refrain from declaring methods for Object.prototype - it’s up
      -to developer whether how he decides to use it in his context (as function or as
      -method).
      -
      -In general:
      -* Removed any method 'functionalization' and functionalize method itself.
      -	es5-ext declares plain methods, which can be configured to work as functions
      -	with call.bind(method) - see documentation.
      -* Removed separation of Object methods for ES5 (with descriptors) and
      -	ES3 (plain) - we're following ES5 idea on that, some methods are intended just
      -	for enumerable properties and some are for all properties, all are declared
      -	for Object.prototype
      -* Removed separation of Array generic (collected in List folder) and not generic
      -	methods (collected in Array folder). Now all methods are generic and are in
      -	Array/prototype folder. This separation also meant, that methods in Array are
      -	usually destructive. We don’t do that separation now, there’s generally no use
      -	case for destructive iterators, we should be fine with one version of each
      -	method, (same as ES5 is fine with  e.g. one, non destructive 'filter' method)
      -* Folder structure resembles tree of native ES5 Objects
      -* All methods are written with ES5 conventions in mind, it means that most
      -	methods are generic and can be run on any object. In more detail:
      -	** Array.prototype and Object.prototype methods can be run on any object (any
      -		not null or undefined value),
      -	** Date.prototype methods should be called only on Date instances.
      -	** Function.prototype methods can be called on any callable objects (not
      -		necessarily functions)
      -	** Number.prototype & String.prototype methods can be called on any value, in
      -		case of Number it it’ll be degraded to number, in case of string it’ll be
      -		degraded to string.
      -* Travis CI support (only for Node v0.6 branch, as v0.4 has buggy V8 version)
      -
      -Improvements for existing functions and methods:
      -* Function.memoize (was Function.cache) is now fully generic, can operate on any
      -	type of arguments and it’s NaN safe (all NaN objects are considered equal)
      -* Method properties passed to Object.prototype.extend or
      -	Object.prototype.override can aside of _super optionally take prototype object
      -	via _proto argument
      -* Object iterators: forEach, mapToArray and every can now iterate in specified
      -	order
      -* pluck, invoke and other functions that return reusable functions or methods
      -	have now their results memoized.
      -
      -New methods:
      -* Global: assertNotNull, getNextIdGenerator, guid, isEqual, isPrimitive,
      -	toObject
      -* Array: generate
      -* Array.prototype: binarySearch, clear, contains, diff, exclusion, find, first,
      -	forEachRight, group, indexesOf, intersection, remove, someRight, someValue
      -* Boolean: isBoolean
      -* Date: isDate
      -* Function: arguments, context, insert, isArguments, remove
      -* Function.prototype: not, silent
      -* Number: getAutoincrement, isNumber
      -* Number.prototype: isLessOrEqual, isLess, subtract
      -* Object: assertCallable, descriptor (functions for clean descriptors),
      -	getCompareBy, isCallable, isObject
      -* Object.prototype: clone (real clone), compact, count, diff, empty,
      -	getPropertyNames, get, keyOf, mapKeys, override, plainCreate, plainExtend,
      -	slice, some, unset
      -* RegExp: isRegExp
      -* String: getPrefixWith, isString
      -* String.prototype: caseInsensitiveCompare, contains, isNumeric
      -
      -Renamed methods:
      -* Date.clone -> Date.prototype.copy
      -* Date.format -> Date.getFormat
      -* Date/day/floor -> Date.prototype.floorDay
      -* Date/month/floor -> Date.prototype.floorMonth
      -* Date/month/year -> Date.prototype.floorYear
      -* Function.cache -> Function.memoize
      -* Function.getApplyArg -> Function.prototype.match
      -* Function.sequence -> Function.prototype.chain
      -* List.findSameStartLength -> Array.prototype.commonLeft
      -* Number.pad -> Number.getPad
      -* Object/plain/clone -> Object.prototype.copy
      -* Object/plain/elevate -> Object.prototype.flatten
      -* Object/plain/same -> Object.prototype.isDuplicate
      -* Object/plain/setValue -> Object.getSet
      -* String.format -> String.getFormat
      -* String.indent -> String.getIndent
      -* String.pad -> String.getPad
      -* String.trimLeftStr -> String.prototype.trimCommonLeft
      -* Object.merge -> Object.prototype.mergeProperties
      -* Object/plain/pluck -> Object.prototype.get
      -* Array.clone is now Array.prototype.copy and can be used also on any array-like
      -	objects
      -* List.isList -> Object.isList
      -* List.toArray -> Object.prototype.toArray
      -* String/convert/dashToCamelCase -> String.prototype.dashToCamelCase
      -
      -Removed methods:
      -* Array.compact - removed destructive version (that operated on same array), we
      -	have now non destructive version as Array.prototype.compact.
      -* Function.applyBind -> use apply.bind directly
      -* Function.bindBind -> use bind.bind directly
      -* Function.callBind -> use call.bind directly
      -* Fuction.clone -> no valid use case
      -* Function.dscope -> controversial approach, shouldn’t be considered seriously
      -* Function.functionalize -> It was experimental but standards are standards
      -* List/sort/length -> It can be easy obtained by Object.getCompareBy(‘length’)
      -* List.concat -> Concat’s for array-like’s makes no sense, just convert to array
      -	first
      -* List.every -> Use Array.prototype.every directly
      -* List.filter -> Use Array.prototype.filter directly
      -* List.forEach -> User Array.prototype.forEach directly
      -* List.isListObject -> No valid use case, do: isList(list) && (typeof list ===
      -	'object’)
      -* List.map -> Use Array.prototype.map directly
      -* List.reduce -> Use Array.prototype.reduce directly
      -* List.shiftSame -> Use Array.prototype.commonLeft and do slice
      -* List.slice -> Use Array.prototype.slice directly
      -* List.some -> Use Array.prototype.some directly
      -* Object.bindMethods -> it was version that considered descriptors, we have now
      -	Object.prototype.bindMethods which operates only on enumerable properties
      -* Object.every -> version that considered all properties, we have now
      -	Object.prototype.every which iterates only enumerables
      -* Object.invoke -> no use case
      -* Object.mergeDeep -> no use case
      -* Object.pluck -> no use case
      -* Object.same -> it considered descriptors, now there’s only Object.isDuplicate
      -	which compares only enumerable properties
      -* Object.sameType -> no use case
      -* Object.toDescriptor and Object.toDescriptors -> replaced by much nicer
      -	Object.descriptor functions
      -* Object/plain/link -> no use case (it was used internally only by
      -	Object/plain/merge)
      -* Object/plain/setTrue -> now easily configurable by more universal
      -	Object.getSet(true)
      -* String.trimRightStr -> Eventually String.prototype.trimCommonRight will be
      -	added
      -
      -v0.6.3  --  2011.12.12
      -* Cleared npm warning for misnamed property in package.json
      -
      -v0.6.2  --  2011.08.12
      -* Calling String.indent without scope (global scope then) now treated as calling
      -  it with null scope, it allows more direct invocations when using default nest
      -  string: indent().call(str, nest)
      -
      -v0.6.1  --  2011.08.08
      -* Added TAD test suite to devDependencies, configured test commands.
      -  Tests can be run with 'make test' or 'npm test'
      -
      -v0.6.0  --  2011.08.07
      -New methods:
      -* Array: clone, compact (in place)
      -* Date: format, duration, clone, monthDaysCount, day.floor, month.floor,
      -  year.floor
      -* Function: getApplyArg, , ncurry, rncurry, hold, cache, log
      -* List: findSameStartLength, shiftSame, peek, isListObject
      -* Number: pad
      -* Object: sameType, toString, mapToArray, mergeDeep, toDescriptor,
      -  toDescriptors, invoke
      -* String: startsWith, endsWith, indent, trimLeftStr, trimRightStr, pad, format
      -
      -Fixed:
      -* Object.extend does now prototypal extend as exptected
      -* Object.merge now tries to overwrite only configurable properties
      -* Function.flip
      -
      -Improved:
      -* Faster List.toArray
      -* Better global retrieval
      -* Functionalized all Function methods
      -* Renamed bindApply and bindCall to applyBind and callBind
      -* Removed Function.inherit (as it's unintuitive curry clone)
      -* Straightforward logic in Function.k
      -* Fixed naming of some tests files (letter case issue)
      -* Renamed Function.saturate into Function.lock
      -* String.dashToCamelCase digits support
      -* Strings now considered as List objects
      -* Improved List.compact
      -* Concise logic for List.concat
      -* Test wit TAD in clean ES5 context
      -
      -v0.5.1  --  2011.07.11
      -* Function's bindBind, bindCall and bindApply now more versatile
      -
      -v0.5.0  --  2011.07.07
      -* Removed Object.is and List.apply
      -* Renamed Object.plain.is to Object.plain.isPlainObject (keep naming convention
      -  consistent)
      -* Improved documentation
      -
      -v0.4.0  --  2011.07.05
      -* Take most functions on Object to Object.plain to keep them away from object
      -  descriptors
      -* Object functions with ES5 standard in mind (object descriptors)
      -
      -v0.3.0  --  2011.06.24
      -* New functions
      -* Consistent file naming (dash instead of camelCase)
      -
      -v0.2.1  --  2011.05.28
      -* Renamed Functions.K and Function.S to to lowercase versions (use consistent
      -  naming)
      -
      -v0.2.0  --  2011.05.28
      -* Renamed Array folder to List (as its generic functions for array-like objects)
      -* Added Makefile
      -* Added various functions
      -
      -v0.1.0  --  2011.05.24
      -* Initial version
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/README.md b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/README.md
      deleted file mode 100644
      index 11d8a343d57f1f..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/README.md
      +++ /dev/null
      @@ -1,993 +0,0 @@
      -# es5-ext
      -## ECMAScript 5 extensions
      -### (with respect to ECMAScript 6 standard)
      -
      -Shims for upcoming ES6 standard and other goodies implemented strictly with ECMAScript conventions in mind.
      -
      -It's designed to be used in compliant ECMAScript 5 or ECMAScript 6 environments. Older environments are not supported, although most of the features should work with correct ECMAScript 5 shim on board.
      -
      -When used in ECMAScript 6 environment, native implementation (if valid) takes precedence over shims.
      -
      -### Installation
      -
      -	$ npm install es5-ext
      -	
      -To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)
      -
      -### Usage
      -
      -#### ECMAScript 6 features
      -
      -You can force ES6 features to be implemented in your environment, e.g. following will assign `from` function to `Array` (only if it's not implemented already).
      -
      -```javascript
      -require('es5-ext/array/from/implement');
      -Array.from('foo'); // ['f', 'o', 'o']
      -```
      -
      -You can also access shims directly, without fixing native objects. Following will return native `Array.from` if it's available and fallback to shim if it's not.
      -
      -```javascript
      -var aFrom = require('es5-ext/array/from');
      -aFrom('foo'); // ['f', 'o', 'o']
      -```
      -
      -If you want to use shim unconditionally (even if native implementation exists) do:
      -
      -```javascript
      -var aFrom = require('es5-ext/array/from/shim');
      -aFrom('foo'); // ['f', 'o', 'o']
      -```
      -
      -##### List of ES6 shims
      -
      -It's about properties introduced with ES6 and those that have been updated in new spec.
      -
      -- `Array.from` -> `require('es5-ext/array/from')`
      -- `Array.of` -> `require('es5-ext/array/of')`
      -- `Array.prototype.concat` -> `require('es5-ext/array/#/concat')`
      -- `Array.prototype.copyWithin` -> `require('es5-ext/array/#/copy-within')`
      -- `Array.prototype.entries` -> `require('es5-ext/array/#/entries')`
      -- `Array.prototype.fill` -> `require('es5-ext/array/#/fill')`
      -- `Array.prototype.filter` -> `require('es5-ext/array/#/filter')`
      -- `Array.prototype.find` -> `require('es5-ext/array/#/find')`
      -- `Array.prototype.findIndex` -> `require('es5-ext/array/#/find-index')`
      -- `Array.prototype.keys` -> `require('es5-ext/array/#/keys')`
      -- `Array.prototype.map` -> `require('es5-ext/array/#/map')`
      -- `Array.prototype.slice` -> `require('es5-ext/array/#/slice')`
      -- `Array.prototype.splice` -> `require('es5-ext/array/#/splice')`
      -- `Array.prototype.values` -> `require('es5-ext/array/#/values')`
      -- `Array.prototype[@@iterator]` -> `require('es5-ext/array/#/@@iterator')`
      -- `Math.acosh` -> `require('es5-ext/math/acosh')`
      -- `Math.asinh` -> `require('es5-ext/math/asinh')`
      -- `Math.atanh` -> `require('es5-ext/math/atanh')`
      -- `Math.cbrt` -> `require('es5-ext/math/cbrt')`
      -- `Math.clz32` -> `require('es5-ext/math/clz32')`
      -- `Math.cosh` -> `require('es5-ext/math/cosh')`
      -- `Math.exmp1` -> `require('es5-ext/math/expm1')`
      -- `Math.fround` -> `require('es5-ext/math/fround')`
      -- `Math.hypot` -> `require('es5-ext/math/hypot')`
      -- `Math.imul` -> `require('es5-ext/math/imul')`
      -- `Math.log1p` -> `require('es5-ext/math/log1p')`
      -- `Math.log2` -> `require('es5-ext/math/log2')`
      -- `Math.log10` -> `require('es5-ext/math/log10')`
      -- `Math.sign` -> `require('es5-ext/math/sign')`
      -- `Math.signh` -> `require('es5-ext/math/signh')`
      -- `Math.tanh` -> `require('es5-ext/math/tanh')`
      -- `Math.trunc` -> `require('es5-ext/math/trunc')`
      -- `Number.EPSILON` -> `require('es5-ext/number/epsilon')`
      -- `Number.MAX_SAFE_INTEGER` -> `require('es5-ext/number/max-safe-integer')`
      -- `Number.MIN_SAFE_INTEGER` -> `require('es5-ext/number/min-safe-integer')`
      -- `Number.isFinite` -> `require('es5-ext/number/is-finite')`
      -- `Number.isInteger` -> `require('es5-ext/number/is-integer')`
      -- `Number.isNaN` -> `require('es5-ext/number/is-nan')`
      -- `Number.isSafeInteger` -> `require('es5-ext/number/is-safe-integer')`
      -- `Object.assign` -> `require('es5-ext/object/assign')`
      -- `Object.keys` -> `require('es5-ext/object/keys')`
      -- `Object.setPrototypeOf` -> `require('es5-ext/object/set-prototype-of')`
      -- `RegExp.prototype.match` -> `require('es5-ext/reg-exp/#/match')`
      -- `RegExp.prototype.replace` -> `require('es5-ext/reg-exp/#/replace')`
      -- `RegExp.prototype.search` -> `require('es5-ext/reg-exp/#/search')`
      -- `RegExp.prototype.split` -> `require('es5-ext/reg-exp/#/split')`
      -- `RegExp.prototype.sticky` -> Implement with `require('es5-ext/reg-exp/#/sticky/implement')`, use as function with `require('es5-ext/reg-exp/#/is-sticky')`
      -- `RegExp.prototype.unicode` -> Implement with `require('es5-ext/reg-exp/#/unicode/implement')`, use as function with `require('es5-ext/reg-exp/#/is-unicode')`
      -- `String.fromCodePoint` -> `require('es5-ext/string/from-code-point')`
      -- `String.raw` -> `require('es5-ext/string/raw')`
      -- `String.prototype.codePointAt` -> `require('es5-ext/string/#/code-point-at')`
      -- `String.prototype.contains` -> `require('es5-ext/string/#/contains')`
      -- `String.prototype.endsWith` -> `require('es5-ext/string/#/ends-with')`
      -- `String.prototype.normalize` -> `require('es5-ext/string/#/normalize')`
      -- `String.prototype.repeat` -> `require('es5-ext/string/#/repeat')`
      -- `String.prototype.startsWith` -> `require('es5-ext/string/#/starts-with')`
      -- `String.prototype[@@iterator]` -> `require('es5-ext/string/#/@@iterator')`
      -
      -#### Non ECMAScript standard features
      -
      -__es5-ext__ provides also other utils, and implements them as if they were proposed for a standard. It mostly offers methods (not functions) which can directly be assigned to native prototypes:
      -
      -```javascript
      -Object.defineProperty(Function.prototype, 'partial', { value: require('es5-ext/function/#/partial'),
      -  configurable: true, enumerable: false, writable: true });
      -Object.defineProperty(Array.prototype, 'flatten', { value: require('es5-ext/array/#/flatten'),
      -  configurable: true, enumerable: false, writable: true });
      -Object.defineProperty(String.prototype, 'capitalize', { value: require('es5-ext/string/#/capitalize'),
      -  configurable: true, enumerable: false, writable: true });
      -```
      -
      -See [es5-extend](https://github.com/wookieb/es5-extend#es5-extend), a great utility that automatically will extend natives for you. 
      -
      -__Important:__ Remember to __not__ extend natives in scope of generic reusable packages (e.g. ones you intend to publish to npm). Extending natives is fine __only__ if you're the _owner_ of the global scope, so e.g. in final project you lead development of.
      -
      -When you're in situation when native extensions are not good idea, then you should use methods indirectly:
      -
      -
      -```javascript
      -var flatten = require('es5-ext/array/#/flatten');
      -
      -flatten.call([1, [2, [3, 4]]]); // [1, 2, 3, 4]
      -```
      -
      -for better convenience you can turn methods into functions:
      -
      -
      -```javascript
      -var call = Function.prototype.call
      -var flatten = call.bind(require('es5-ext/array/#/flatten'));
      -
      -flatten([1, [2, [3, 4]]]); // [1, 2, 3, 4]
      -```
      -
      -You can configure custom toolkit (like [underscorejs](http://underscorejs.org/)), and use it throughout your application
      -
      -```javascript
      -var util = {};
      -util.partial = call.bind(require('es5-ext/function/#/partial'));
      -util.flatten = call.bind(require('es5-ext/array/#/flatten'));
      -util.startsWith = call.bind(require('es5-ext/string/#/starts-with'));
      -
      -util.flatten([1, [2, [3, 4]]]); // [1, 2, 3, 4]
      -```
      -
      -As with native ones most methods are generic and can be run on any type of object.
      -
      -## API
      -
      -### Global extensions
      -
      -#### global _(es5-ext/global)_
      -
      -Object that represents global scope
      -
      -### Array Constructor extensions
      -
      -#### from(arrayLike[, mapFn[, thisArg]]) _(es5-ext/array/from)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.from).  
      -Returns array representation of _iterable_ or _arrayLike_. If _arrayLike_ is an instance of array, its copy is returned.
      -
      -#### generate([length[, …fill]]) _(es5-ext/array/generate)_
      -
      -Generate an array of pre-given _length_ built of repeated arguments.
      -
      -#### isPlainArray(x) _(es5-ext/array/is-plain-array)_
      -
      -Returns true if object is plain array (not instance of one of the Array's extensions).
      -
      -#### of([…items]) _(es5-ext/array/of)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.of).  
      -Create an array from given arguments.
      -
      -#### toArray(obj) _(es5-ext/array/to-array)_
      -
      -Returns array representation of `obj`. If `obj` is already an array, `obj` is returned back.
      -
      -#### validArray(obj) _(es5-ext/array/valid-array)_
      -
      -Returns `obj` if it's an array, otherwise throws `TypeError`
      -
      -### Array Prototype extensions
      -
      -#### arr.binarySearch(compareFn) _(es5-ext/array/#/binary-search)_
      -
      -In __sorted__ list search for index of item for which _compareFn_ returns value closest to _0_.  
      -It's variant of binary search algorithm
      -
      -#### arr.clear() _(es5-ext/array/#/clear)_
      -
      -Clears the array
      -
      -#### arr.compact() _(es5-ext/array/#/compact)_
      -
      -Returns a copy of the context with all non-values (`null` or `undefined`) removed.
      -
      -#### arr.concat() _(es5-ext/array/#/concat)_
      -
      -[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.concat).  
      -ES6's version of `concat`. Supports `isConcatSpreadable` symbol, and returns array of same type as the context.
      -
      -#### arr.contains(searchElement[, position]) _(es5-ext/array/#/contains)_
      -
      -Whether list contains the given value.
      -
      -#### arr.copyWithin(target, start[, end]) _(es5-ext/array/#/copy-within)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.copywithin).  
      -
      -#### arr.diff(other) _(es5-ext/array/#/diff)_
      -
      -Returns the array of elements that are present in context list but not present in other list.
      -
      -#### arr.eIndexOf(searchElement[, fromIndex]) _(es5-ext/array/#/e-index-of)_
      -
      -_egal_ version of `indexOf` method. [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) logic is used for comparision
      -
      -#### arr.eLastIndexOf(searchElement[, fromIndex]) _(es5-ext/array/#/e-last-index-of)_
      -
      -_egal_ version of `lastIndexOf` method. [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) logic is used for comparision
      -
      -#### arr.entries() _(es5-ext/array/#/entries)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.entries).  
      -Returns iterator object, which traverses the array. Each value is represented with an array, where first value is an index and second is corresponding to index value.
      -
      -#### arr.exclusion([…lists]]) _(es5-ext/array/#/exclusion)_
      -
      -Returns the array of elements that are found only in one of the lists (either context list or list provided in arguments).
      -
      -#### arr.fill(value[, start, end]) _(es5-ext/array/#/fill)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.fill).  
      -
      -#### arr.filter(callback[, thisArg]) _(es5-ext/array/#/filter)_
      -
      -[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.filter).  
      -ES6's version of `filter`, returns array of same type as the context.
      -
      -#### arr.find(predicate[, thisArg]) _(es5-ext/array/#/find)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.find).  
      -Return first element for which given function returns true
      -
      -#### arr.findIndex(predicate[, thisArg]) _(es5-ext/array/#/find-index)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.findindex).  
      -Return first index for which given function returns true
      -
      -#### arr.first() _(es5-ext/array/#/first)_
      -
      -Returns value for first defined index
      -
      -#### arr.firstIndex() _(es5-ext/array/#/first-index)_
      -
      -Returns first declared index of the array
      -
      -#### arr.flatten() _(es5-ext/array/#/flatten)_
      -
      -Returns flattened version of the array
      -
      -#### arr.forEachRight(cb[, thisArg]) _(es5-ext/array/#/for-each-right)_
      -
      -`forEach` starting from last element
      -
      -#### arr.group(cb[, thisArg]) _(es5-ext/array/#/group)_
      -
      -Group list elements by value returned by _cb_ function
      -
      -#### arr.indexesOf(searchElement[, fromIndex]) _(es5-ext/array/#/indexes-of)_
      -
      -Returns array of all indexes of given value
      -
      -#### arr.intersection([…lists]) _(es5-ext/array/#/intersection)_
      -
      -Computes the array of values that are the intersection of all lists (context list and lists given in arguments)
      -
      -#### arr.isCopy(other) _(es5-ext/array/#/is-copy)_
      -
      -Returns true if both context and _other_ lists have same content
      -
      -#### arr.isUniq() _(es5-ext/array/#/is-uniq)_
      -
      -Returns true if all values in array are unique
      -
      -#### arr.keys() _(es5-ext/array/#/keys)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.keys).  
      -Returns iterator object, which traverses all array indexes.
      -
      -#### arr.last() _(es5-ext/array/#/last)_
      -
      -Returns value of last defined index
      -
      -#### arr.lastIndex() _(es5-ext/array/#/last)_
      -
      -Returns last defined index of the array
      -
      -#### arr.map(callback[, thisArg]) _(es5-ext/array/#/map)_
      -
      -[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.map).  
      -ES6's version of `map`, returns array of same type as the context.
      -
      -#### arr.remove(value[, …valuen]) _(es5-ext/array/#/remove)_
      -
      -Remove values from the array
      -
      -#### arr.separate(sep) _(es5-ext/array/#/separate)_
      -
      -Returns array with items separated with `sep` value
      -
      -#### arr.slice(callback[, thisArg]) _(es5-ext/array/#/slice)_
      -
      -[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.slice).  
      -ES6's version of `slice`, returns array of same type as the context.
      -
      -#### arr.someRight(cb[, thisArg]) _(es5-ext/array/#/someRight)_
      -
      -`some` starting from last element
      -
      -#### arr.splice(callback[, thisArg]) _(es5-ext/array/#/splice)_
      -
      -[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.splice).  
      -ES6's version of `splice`, returns array of same type as the context.
      -
      -#### arr.uniq() _(es5-ext/array/#/uniq)_
      -
      -Returns duplicate-free version of the array
      -
      -#### arr.values() _(es5-ext/array/#/values)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.values).  
      -Returns iterator object which traverses all array values.
      -
      -#### arr[@@iterator] _(es5-ext/array/#/@@iterator)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype-@@iterator).  
      -Returns iterator object which traverses all array values.
      -
      -### Boolean Constructor extensions
      -
      -#### isBoolean(x) _(es5-ext/boolean/is-boolean)_
      -
      -Whether value is boolean
      -
      -### Date Constructor extensions
      -
      -#### isDate(x) _(es5-ext/date/is-date)_
      -
      -Whether value is date instance
      -
      -#### validDate(x) _(es5-ext/date/valid-date)_
      -
      -If given object is not date throw TypeError in other case return it.
      -
      -### Date Prototype extensions
      -
      -#### date.copy(date) _(es5-ext/date/#/copy)_
      -
      -Returns a copy of the date object
      -
      -#### date.daysInMonth() _(es5-ext/date/#/days-in-month)_
      -
      -Returns number of days of date's month
      -
      -#### date.floorDay() _(es5-ext/date/#/floor-day)_
      -
      -Sets the date time to 00:00:00.000
      -
      -#### date.floorMonth() _(es5-ext/date/#/floor-month)_
      -
      -Sets date day to 1 and date time to 00:00:00.000
      -
      -#### date.floorYear() _(es5-ext/date/#/floor-year)_
      -
      -Sets date month to 0, day to 1 and date time to 00:00:00.000
      -
      -#### date.format(pattern) _(es5-ext/date/#/format)_
      -
      -Formats date up to given string. Supported patterns:
      -
      -* `%Y` - Year with century, 1999, 2003
      -* `%y` - Year without century, 99, 03
      -* `%m` - Month, 01..12
      -* `%d` - Day of the month 01..31
      -* `%H` - Hour (24-hour clock), 00..23
      -* `%M` - Minute, 00..59
      -* `%S` - Second, 00..59
      -* `%L` - Milliseconds, 000..999
      -
      -### Error Constructor extensions
      -
      -#### custom(message/*, code, ext*/) _(es5-ext/error/custom)_
      -
      -Creates custom error object, optinally extended with `code` and other extension properties (provided with `ext` object)  
      -
      -#### isError(x) _(es5-ext/error/is-error)_
      -
      -Whether value is an error (instance of `Error`).  
      -
      -#### validError(x) _(es5-ext/error/valid-error)_
      -
      -If given object is not error throw TypeError in other case return it.
      -
      -### Error Prototype extensions
      -
      -#### err.throw() _(es5-ext/error/#/throw)_
      -
      -Throws error
      -
      -### Function Constructor extensions
      -
      -Some of the functions were inspired by [Functional JavaScript](http://osteele.com/sources/javascript/functional/) project by Olivier Steele
      -
      -#### constant(x) _(es5-ext/function/constant)_
      -
      -Returns a constant function that returns pregiven argument
      -
      -_k(x)(y)  =def  x_
      -
      -#### identity(x) _(es5-ext/function/identity)_
      -
      -Identity function. Returns first argument
      -
      -_i(x)  =def  x_
      -
      -#### invoke(name[, …args]) _(es5-ext/function/invoke)_
      -
      -Returns a function that takes an object as an argument, and applies object's
      -_name_ method to arguments.  
      -_name_ can be name of the method or method itself.
      -
      -_invoke(name, …args)(object, …args2)  =def  object\[name\]\(…args, …args2\)_
      -
      -#### isArguments(x) _(es5-ext/function/is-arguments)_
      -
      -Whether value is arguments object
      -
      -#### isFunction(arg) _(es5-ext/function/is-function)_
      -
      -Wether value is instance of function
      -
      -#### noop() _(es5-ext/function/noop)_
      -
      -No operation function
      -
      -#### pluck(name) _(es5-ext/function/pluck)_
      -
      -Returns a function that takes an object, and returns the value of its _name_
      -property
      -
      -_pluck(name)(obj)  =def  obj[name]_
      -
      -#### validFunction(arg) _(es5-ext/function/valid-function)_
      -
      -If given object is not function throw TypeError in other case return it.
      -
      -### Function Prototype extensions
      -
      -Some of the methods were inspired by [Functional JavaScript](http://osteele.com/sources/javascript/functional/) project by Olivier Steele
      -
      -#### fn.compose([…fns]) _(es5-ext/function/#/compose)_
      -
      -Applies the functions in reverse argument-list order.
      -
      -_f1.compose(f2, f3, f4)(…args)  =def  f1(f2(f3(f4(…arg))))_
      -
      -#### fn.copy() _(es5-ext/function/#/copy)_
      -
      -Produces copy of given function
      -
      -#### fn.curry([n]) _(es5-ext/function/#/curry)_
      -
      -Invoking the function returned by this function only _n_ arguments are passed to the underlying function. If the underlying function is not saturated, the result is a function that passes all its arguments to the underlying function.  
      -If _n_ is not provided then it defaults to context function length
      -
      -_f.curry(4)(arg1, arg2)(arg3)(arg4)  =def  f(arg1, args2, arg3, arg4)_
      -
      -#### fn.lock([…args]) _(es5-ext/function/#/lock)_
      -
      -Returns a function that applies the underlying function to _args_, and ignores its own arguments.
      -
      -_f.lock(…args)(…args2)  =def  f(…args)_
      -
      -_Named after it's counterpart in Google Closure_
      -
      -#### fn.not() _(es5-ext/function/#/not)_
      -
      -Returns a function that returns boolean negation of value returned by underlying function.
      -
      -_f.not()(…args)  =def !f(…args)_
      -
      -#### fn.partial([…args]) _(es5-ext/function/#/partial)_
      -
      -Returns a function that when called will behave like context function called with initially passed arguments. If more arguments are suplilied, they are appended to initial args.
      -
      -_f.partial(…args1)(…args2)  =def  f(…args1, …args2)_
      -
      -#### fn.spread() _(es5-ext/function/#/spread)_
      -
      -Returns a function that applies underlying function with first list argument
      -
      -_f.match()(args)  =def  f.apply(null, args)_
      -
      -#### fn.toStringTokens() _(es5-ext/function/#/to-string-tokens)_
      -
      -Serializes function into two (arguments and body) string tokens. Result is plain object with `args` and `body` properties.
      -
      -### Math extensions
      -
      -#### acosh(x) _(es5-ext/math/acosh)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.acosh).  
      -
      -#### asinh(x) _(es5-ext/math/asinh)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.asinh).  
      -
      -#### atanh(x) _(es5-ext/math/atanh)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.atanh).  
      -
      -#### cbrt(x) _(es5-ext/math/cbrt)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cbrt).  
      -
      -#### clz32(x) _(es5-ext/math/clz32)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.clz32).  
      -
      -#### cosh(x) _(es5-ext/math/cosh)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cosh).  
      -
      -#### expm1(x) _(es5-ext/math/expm1)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.expm1).  
      -
      -#### fround(x) _(es5-ext/math/fround)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.fround).  
      -
      -#### hypot([…values]) _(es5-ext/math/hypot)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.hypot).  
      -
      -#### imul(x, y) _(es5-ext/math/imul)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.imul).  
      -
      -#### log1p(x) _(es5-ext/math/log1p)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log1p).  
      -
      -#### log2(x) _(es5-ext/math/log2)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log2).  
      -
      -#### log10(x) _(es5-ext/math/log10)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log10).  
      -
      -#### sign(x) _(es5-ext/math/sign)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sign).  
      -
      -#### sinh(x) _(es5-ext/math/sinh)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sinh).  
      -
      -#### tanh(x) _(es5-ext/math/tanh)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.tanh).  
      -
      -#### trunc(x) _(es5-ext/math/trunc)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.trunc).  
      -
      -### Number Constructor extensions
      -
      -#### EPSILON _(es5-ext/number/epsilon)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.epsilon).  
      -
      -The difference between 1 and the smallest value greater than 1 that is representable as a Number value, which is approximately 2.2204460492503130808472633361816 x 10-16.
      -
      -#### isFinite(x) _(es5-ext/number/is-finite)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite).  
      -Whether value is finite. Differs from global isNaN that it doesn't do type coercion.
      -
      -#### isInteger(x) _(es5-ext/number/is-integer)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isinteger).  
      -Whether value is integer.
      -
      -#### isNaN(x) _(es5-ext/number/is-nan)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isnan).  
      -Whether value is NaN. Differs from global isNaN that it doesn't do type coercion.
      -
      -#### isNumber(x) _(es5-ext/number/is-number)_
      -
      -Whether given value is number
      -
      -#### isSafeInteger(x) _(es5-ext/number/is-safe-integer)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.issafeinteger).  
      -
      -#### MAX_SAFE_INTEGER _(es5-ext/number/max-safe-integer)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.maxsafeinteger).  
      -The value of Number.MAX_SAFE_INTEGER is 9007199254740991.
      -
      -#### MIN_SAFE_INTEGER _(es5-ext/number/min-safe-integer)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.minsafeinteger).  
      -The value of Number.MIN_SAFE_INTEGER is -9007199254740991 (253-1).
      -
      -#### toInteger(x) _(es5-ext/number/to-integer)_
      -
      -Converts value to integer
      -
      -#### toPosInteger(x) _(es5-ext/number/to-pos-integer)_
      -
      -Converts value to positive integer. If provided value is less than 0, then 0 is returned
      -
      -#### toUint32(x) _(es5-ext/number/to-uint32)_
      -
      -Converts value to unsigned 32 bit integer. This type is used for array lengths.
      -See: http://www.2ality.com/2012/02/js-integers.html
      -
      -### Number Prototype extensions
      -
      -#### num.pad(length[, precision]) _(es5-ext/number/#/pad)_
      -
      -Pad given number with zeros. Returns string
      -
      -### Object Constructor extensions
      -
      -#### assign(target, source[, …sourcen]) _(es5-ext/object/assign)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign).  
      -Extend _target_ by enumerable own properties of other objects. If properties are already set on target object, they will be overwritten.
      -
      -#### clear(obj) _(es5-ext/object/clear)_
      -
      -Remove all enumerable own properties of the object
      -
      -#### compact(obj) _(es5-ext/object/compact)_
      -
      -Returns copy of the object with all enumerable properties that have no falsy values
      -
      -#### compare(obj1, obj2) _(es5-ext/object/compare)_
      -
      -Universal cross-type compare function. To be used for e.g. array sort.
      -
      -#### copy(obj) _(es5-ext/object/copy)_
      -
      -Returns copy of the object with all enumerable properties.
      -
      -#### copyDeep(obj) _(es5-ext/object/copy-deep)_
      -
      -Returns deep copy of the object with all enumerable properties.
      -
      -#### count(obj) _(es5-ext/object/count)_
      -
      -Counts number of enumerable own properties on object
      -
      -#### create(obj[, properties]) _(es5-ext/object/create)_
      -
      -`Object.create` alternative that provides workaround for [V8 issue](http://code.google.com/p/v8/issues/detail?id=2804).
      -
      -When `null` is provided as a prototype, it's substituted with specially prepared object that derives from Object.prototype but has all Object.prototype properties shadowed with undefined.
      -
      -It's quirky solution that allows us to have plain objects with no truthy properties but with turnable prototype.
      -
      -Use only for objects that you plan to switch prototypes of and be aware of limitations of this workaround.
      -
      -#### eq(x, y) _(es5-ext/object/eq)_
      -
      -Whether two values are equal, using [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) algorithm.
      -
      -#### every(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/every)_
      -
      -Analogous to Array.prototype.every. Returns true if every key-value pair in this object satisfies the provided testing function.  
      -Optionally _compareFn_ can be provided which assures that keys are tested in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key).
      -
      -#### filter(obj, cb[, thisArg]) _(es5-ext/object/filter)_
      -
      -Analogous to Array.prototype.filter. Returns new object with properites for which _cb_ function returned truthy value.
      -
      -#### firstKey(obj) _(es5-ext/object/first-key)_
      -
      -Returns first enumerable key of the object, as keys are unordered by specification, it can be any key of an object.
      -
      -#### flatten(obj) _(es5-ext/object/flatten)_
      -
      -Returns new object, with flatten properties of input object
      -
      -_flatten({ a: { b: 1 }, c: { d: 1 } })  =def  { b: 1, d: 1 }_
      -
      -#### forEach(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/for-each)_
      -
      -Analogous to Array.prototype.forEach. Calls a function for each key-value pair found in object
      -Optionally _compareFn_ can be provided which assures that properties are iterated in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key).
      -
      -#### getPropertyNames() _(es5-ext/object/get-property-names)_
      -
      -Get all (not just own) property names of the object
      -
      -#### is(x, y) _(es5-ext/object/is)_
      -
      -Whether two values are equal, using [_SameValue_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) algorithm.
      -
      -#### isArrayLike(x) _(es5-ext/object/is-array-like)_
      -
      -Whether object is array-like object
      -
      -#### isCopy(x, y) _(es5-ext/object/is-copy)_
      -
      -Two values are considered a copy of same value when all of their own enumerable properties have same values.
      -
      -#### isCopyDeep(x, y) _(es5-ext/object/is-copy-deep)_
      -
      -Deep comparision of objects
      -
      -#### isEmpty(obj) _(es5-ext/object/is-empty)_
      -
      -True if object doesn't have any own enumerable property
      -
      -#### isObject(arg) _(es5-ext/object/is-object)_
      -
      -Whether value is not primitive
      -
      -#### isPlainObject(arg) _(es5-ext/object/is-plain-object)_
      -
      -Whether object is plain object, its protototype should be Object.prototype and it cannot be host object.
      -
      -#### keyOf(obj, searchValue) _(es5-ext/object/key-of)_
      -
      -Search object for value
      -
      -#### keys(obj) _(es5-ext/object/keys)_
      -
      -[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys).  
      -ES6's version of `keys`, doesn't throw on primitive input
      -
      -#### map(obj, cb[, thisArg]) _(es5-ext/object/map)_
      -
      -Analogous to Array.prototype.map. Creates a new object with properties which values are results of calling a provided function on every key-value pair in this object.
      -
      -#### mapKeys(obj, cb[, thisArg]) _(es5-ext/object/map-keys)_
      -
      -Create new object with same values, but remapped keys
      -
      -#### mixin(target, source) _(es5-ext/object/mixin)_
      -
      -Extend _target_ by all own properties of other objects. Properties found in both objects will be overwritten (unless they're not configurable and cannot be overwritten).
      -_It was for a moment part of ECMAScript 6 draft._
      -
      -#### mixinPrototypes(target, …source]) _(es5-ext/object/mixin-prototypes)_
      -
      -Extends _target_, with all source and source's prototype properties.
      -Useful as an alternative for `setPrototypeOf` in environments in which it cannot be shimmed (no `__proto__` support).
      -
      -#### normalizeOptions(options) _(es5-ext/object/normalize-options)_
      -
      -Normalizes options object into flat plain object.  
      -
      -Useful for functions in which we either need to keep options object for future reference or need to modify it for internal use.
      -
      -- It never returns input `options` object back (always a copy is created)
      -- `options` can be undefined in such case empty plain object is returned.
      -- Copies all enumerable properties found down prototype chain.
      -
      -#### primitiveSet([…names]) _(es5-ext/object/primitive-set)_
      -
      -Creates `null` prototype based plain object, and sets on it all property names provided in arguments to true.
      -
      -#### safeTraverse(obj[, …names]) _(es5-ext/object/safe-traverse)_
      -
      -Safe navigation of object properties. See http://wiki.ecmascript.org/doku.php?id=strawman:existential_operator
      -
      -#### serialize(value) _(es5-ext/object/serialize)_
      -
      -Serialize value into string. Differs from [JSON.stringify](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that it serializes also dates, functions and regular expresssions.
      -
      -#### setPrototypeOf(object, proto) _(es5-ext/object/set-prototype-of)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.setprototypeof).  
      -If native version is not provided, it depends on existence of `__proto__` functionality, if it's missing, `null` instead of function is exposed.
      -
      -#### some(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/some)_
      -
      -Analogous to Array.prototype.some Returns true if any key-value pair satisfies the provided
      -testing function.  
      -Optionally _compareFn_ can be provided which assures that keys are tested in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key).
      -
      -#### toArray(obj[, cb[, thisArg[, compareFn]]]) _(es5-ext/object/to-array)_
      -
      -Creates an array of results of calling a provided function on every key-value pair in this object.  
      -Optionally _compareFn_ can be provided which assures that results are added in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key).
      -
      -#### unserialize(str) _(es5-ext/object/unserialize)_
      -
      -Userializes value previously serialized with [serialize](#serializevalue-es5-extobjectserialize)
      -
      -#### validCallable(x) _(es5-ext/object/valid-callable)_
      -
      -If given object is not callable throw TypeError in other case return it.
      -
      -#### validObject(x) _(es5-ext/object/valid-object)_
      -
      -Throws error if given value is not an object, otherwise it is returned.
      -
      -#### validValue(x) _(es5-ext/object/valid-value)_
      -
      -Throws error if given value is `null` or `undefined`, otherwise returns value.
      -
      -### RegExp Constructor extensions
      -
      -#### escape(str) _(es5-ext/reg-exp/escape)_
      -
      -Escapes string to be used in regular expression
      -
      -#### isRegExp(x) _(es5-ext/reg-exp/is-reg-exp)_
      -
      -Whether object is regular expression
      -
      -#### validRegExp(x) _(es5-ext/reg-exp/valid-reg-exp)_
      -
      -If object is regular expression it is returned, otherwise TypeError is thrown.
      -
      -### RegExp Prototype extensions
      -
      -#### re.isSticky(x) _(es5-ext/reg-exp/#/is-sticky)_
      -
      -Whether regular expression has `sticky` flag.
      -
      -It's to be used as counterpart to [regExp.sticky](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-get-regexp.prototype.sticky) if it's not implemented.
      -
      -#### re.isUnicode(x) _(es5-ext/reg-exp/#/is-unicode)_
      -
      -Whether regular expression has `unicode` flag.
      -
      -It's to be used as counterpart to [regExp.unicode](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-get-regexp.prototype.unicode) if it's not implemented.
      -
      -#### re.match(string) _(es5-ext/reg-exp/#/match)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.match).  
      -
      -#### re.replace(string, replaceValue) _(es5-ext/reg-exp/#/replace)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.replace).  
      -
      -#### re.search(string) _(es5-ext/reg-exp/#/search)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.search).  
      -
      -#### re.split(string) _(es5-ext/reg-exp/#/search)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.split).  
      -
      -#### re.sticky _(es5-ext/reg-exp/#/sticky/implement)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.sticky).  
      -It's a getter, so only `implement` and `is-implemented` modules are provided.
      -
      -#### re.unicode _(es5-ext/reg-exp/#/unicode/implement)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.unicode).  
      -It's a getter, so only `implement` and `is-implemented` modules are provided.
      -
      -### String Constructor extensions
      -
      -#### formatMethod(fMap) _(es5-ext/string/format-method)_
      -
      -Creates format method. It's used e.g. to create `Date.prototype.format` method
      -
      -#### fromCodePoint([…codePoints]) _(es5-ext/string/from-code-point)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.fromcodepoint)
      -
      -#### isString(x) _(es5-ext/string/is-string)_
      -
      -Whether object is string
      -
      -#### randomUniq() _(es5-ext/string/random-uniq)_
      -
      -Returns randomly generated id, with guarantee of local uniqueness (no same id will be returned twice)
      -
      -#### raw(callSite[, …substitutions]) _(es5-ext/string/raw)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.raw)
      -
      -### String Prototype extensions
      -
      -#### str.at(pos) _(es5-ext/string/#/at)_
      -
      -_Proposed for ECMAScript 6/7 standard, but not (yet) in a draft_
      -
      -Returns a string at given position in Unicode-safe manner.
      -Based on [implementation by Mathias Bynens](https://github.com/mathiasbynens/String.prototype.at).
      -
      -#### str.camelToHyphen() _(es5-ext/string/#/camel-to-hyphen)_
      -
      -Convert camelCase string to hyphen separated, e.g. one-two-three -> oneTwoThree.
      -Useful when converting names from js property convention into filename convention.
      -
      -#### str.capitalize() _(es5-ext/string/#/capitalize)_
      -
      -Capitalize first character of a string
      -
      -#### str.caseInsensitiveCompare(str) _(es5-ext/string/#/case-insensitive-compare)_
      -
      -Case insensitive compare
      -
      -#### str.codePointAt(pos) _(es5-ext/string/#/code-point-at)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.codepointat)
      -
      -Based on [implementation by Mathias Bynens](https://github.com/mathiasbynens/String.prototype.codePointAt).
      -
      -#### str.contains(searchString[, position]) _(es5-ext/string/#/contains)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.contains)
      -
      -Whether string contains given string.
      -
      -#### str.endsWith(searchString[, endPosition]) _(es5-ext/string/#/ends-with)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.endswith).  
      -Whether strings ends with given string
      -
      -#### str.hyphenToCamel() _(es5-ext/string/#/hyphen-to-camel)_
      -
      -Convert hyphen separated string to camelCase, e.g. one-two-three -> oneTwoThree.
      -Useful when converting names from filename convention to js property name convention.
      -
      -#### str.indent(str[, count]) _(es5-ext/string/#/indent)_
      -
      -Indents each line with provided _str_ (if _count_ given then _str_ is repeated _count_ times).
      -
      -#### str.last() _(es5-ext/string/#/last)_
      -
      -Return last character
      -
      -#### str.normalize([form]) _(es5-ext/string/#/normalize)_
      -
      -[_Introduced with ECMAScript 6_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize).  
      -Returns the Unicode Normalization Form of a given string.  
      -Based on Matsuza's version. Code used for integrated shim can be found at [github.com/walling/unorm](https://github.com/walling/unorm/blob/master/lib/unorm.js)
      -
      -#### str.pad(fill[, length]) _(es5-ext/string/#/pad)_
      -
      -Pad string with _fill_.
      -If _length_ si given than _fill_ is reapated _length_ times.
      -If _length_ is negative then pad is applied from right.
      -
      -#### str.repeat(n) _(es5-ext/string/#/repeat)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.repeat).  
      -Repeat given string _n_ times
      -
      -#### str.plainReplace(search, replace) _(es5-ext/string/#/plain-replace)_
      -
      -Simple `replace` version. Doesn't support regular expressions. Replaces just first occurrence of search string. Doesn't support insert patterns, therefore it is safe to replace text with text obtained programmatically (there's no need for additional _$_ characters escape in such case).
      -
      -#### str.plainReplaceAll(search, replace) _(es5-ext/string/#/plain-replace-all)_
      -
      -Simple `replace` version. Doesn't support regular expressions. Replaces all occurrences of search string. Doesn't support insert patterns, therefore it is safe to replace text with text obtained programmatically (there's no need for additional _$_ characters escape in such case).
      -
      -#### str.startsWith(searchString[, position]) _(es5-ext/string/#/starts-with)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.startswith).  
      -Whether strings starts with given string
      -
      -#### str[@@iterator] _(es5-ext/string/#/@@iterator)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype-@@iterator).  
      -Returns iterator object which traverses all string characters (with respect to unicode symbols)
      -
      -### Tests [![Build Status](https://travis-ci.org/medikoo/es5-ext.png)](https://travis-ci.org/medikoo/es5-ext)
      -
      -	$ npm test
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/for-each-right.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/for-each-right.js
      deleted file mode 100644
      index 2f0ffaea84cb38..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/for-each-right.js
      +++ /dev/null
      @@ -1,20 +0,0 @@
      -'use strict';
      -
      -var toPosInt = require('../../number/to-pos-integer')
      -  , callable = require('../../object/valid-callable')
      -  , value    = require('../../object/valid-value')
      -
      -  , hasOwnProperty = Object.prototype.hasOwnProperty
      -  , call = Function.prototype.call;
      -
      -module.exports = function (cb/*, thisArg*/) {
      -	var i, self, thisArg;
      -
      -	self = Object(value(this));
      -	callable(cb);
      -	thisArg = arguments[1];
      -
      -	for (i = toPosInt(self.length); i >= 0; --i) {
      -		if (hasOwnProperty.call(self, i)) call.call(cb, thisArg, self[i], i, self);
      -	}
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/some-right.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/some-right.js
      deleted file mode 100644
      index de7460d62234cf..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/array/#/some-right.js
      +++ /dev/null
      @@ -1,22 +0,0 @@
      -'use strict';
      -
      -var callable = require('../../object/valid-callable')
      -  , value    = require('../../object/valid-value')
      -
      -  , hasOwnProperty = Object.prototype.hasOwnProperty
      -  , call = Function.prototype.call;
      -
      -module.exports = function (cb/*, thisArg*/) {
      -	var i, self, thisArg;
      -	self = Object(value(this));
      -	callable(cb);
      -	thisArg = arguments[1];
      -
      -	for (i = self.length; i >= 0; --i) {
      -		if (hasOwnProperty.call(self, i) &&
      -				call.call(cb, thisArg, self[i], i, self)) {
      -			return true;
      -		}
      -	}
      -	return false;
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/.lint b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/.lint
      deleted file mode 100644
      index 1851752f99bfda..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/.lint
      +++ /dev/null
      @@ -1,13 +0,0 @@
      -@root
      -
      -module
      -
      -tabs
      -indent 2
      -maxlen 100
      -
      -ass
      -nomen
      -plusplus
      -newcap
      -vars
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/.travis.yml b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/.travis.yml
      deleted file mode 100644
      index afd3509a26b27d..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/.travis.yml
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -language: node_js
      -node_js:
      -  - 0.8
      -  - 0.10
      -  - 0.11
      -
      -notifications:
      -  email:
      -    - medikoo+es6-symbol@medikoo.com
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/CHANGES b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/CHANGES
      deleted file mode 100644
      index df8c27efc38de2..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/CHANGES
      +++ /dev/null
      @@ -1,34 +0,0 @@
      -v2.0.1  --  2015.01.28
      -* Fix Symbol.prototype[Symbol.isPrimitive] implementation
      -* Improve validation within Symbol.prototype.toString and
      -  Symbol.prototype.valueOf
      -
      -v2.0.0  --  2015.01.28
      -* Update up to changes in specification:
      -  * Implement `for` and `keyFor`
      -  * Remove `Symbol.create` and `Symbol.isRegExp`
      -  * Add `Symbol.match`, `Symbol.replace`, `Symbol.search`, `Symbol.species` and
      -    `Symbol.split`
      -* Rename `validSymbol` to `validateSymbol`
      -* Improve documentation
      -* Remove dead test modules
      -
      -v1.0.0  --  2015.01.26
      -* Fix enumerability for symbol properties set normally (e.g. obj[symbol] = value)
      -* Introduce initialization via hidden constructor
      -* Fix isSymbol handling of polyfill values when native Symbol is present
      -* Fix spelling of LICENSE
      -* Configure lint scripts
      -
      -v0.1.1  --  2014.10.07
      -* Fix isImplemented, so it returns true in case of polyfill
      -* Improve documentations
      -
      -v0.1.0  --  2014.04.28
      -* Assure strictly npm dependencies
      -* Update to use latest versions of dependencies
      -* Fix implementation detection so it doesn't crash on `String(symbol)`
      -* throw on `new Symbol()` (as decided by TC39)
      -
      -v0.0.0  --  2013.11.15
      -* Initial (dev) version
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/README.md b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/README.md
      deleted file mode 100644
      index 95d6780ba78cb4..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/README.md
      +++ /dev/null
      @@ -1,71 +0,0 @@
      -# es6-symbol
      -## ECMAScript 6 Symbol polyfill
      -
      -For more information about symbols see following links
      -- [Symbols in ECMAScript 6 by Axel Rauschmayer](http://www.2ality.com/2014/12/es6-symbols.html)
      -- [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol)
      -- [Specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-symbol-constructor)
      -
      -### Limitations
      -
      -Underneath it uses real string property names which can easily be retrieved, however accidental collision with other property names is unlikely.
      -
      -### Usage
      -
      -If you'd like to use native version when it exists and fallback to polyfill if it doesn't (but without implementing `Symbol` on global scope), do:
      -
      -```javascript
      -var Symbol = require('es6-symbol');
      -```
      -
      -If you want to make sure your environment implements `Symbol`, do:
      -
      -```javascript
      -require('es6-symbol/implement');
      -```
      -
      -If you strictly want to use polyfill even if native `Symbol` exists (hard to find a good reason for that), do:
      -
      -```javascript
      -var Symbol = require('es6-symbol/polyfill');
      -```
      -
      -#### API
      -
      -Best is to refer to [specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-symbol-objects). Still if you want quick look, follow examples:
      -
      -```javascript
      -var Symbol = require('es6-symbol');
      -
      -var symbol = Symbol('My custom symbol');
      -var x = {};
      -
      -x[symbol] = 'foo';
      -console.log(x[symbol]); 'foo'
      -
      -// Detect iterable:
      -var iterator, result;
      -if (possiblyIterable[Symbol.iterator]) {
      -  iterator = possiblyIterable[Symbol.iterator]();
      -  result = iterator.next();
      -  while(!result.done) {
      -    console.log(result.value);
      -    result = iterator.next();
      -  }
      -}
      -```
      -
      -### Installation
      -#### NPM
      -
      -In your project path:
      -
      -	$ npm install es6-symbol
      -
      -##### Browser
      -
      -To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)
      -
      -## Tests [![Build Status](https://travis-ci.org/medikoo/es6-symbol.png)](https://travis-ci.org/medikoo/es6-symbol)
      -
      -	$ npm test
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/package.json b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/package.json
      deleted file mode 100644
      index 0efffeaec90658..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/package.json
      +++ /dev/null
      @@ -1,63 +0,0 @@
      -{
      -  "name": "es6-symbol",
      -  "version": "2.0.1",
      -  "description": "ECMAScript6 Symbol polyfill",
      -  "author": {
      -    "name": "Mariusz Nowak",
      -    "email": "medyk@medikoo.com",
      -    "url": "http://www.medikoo.com/"
      -  },
      -  "keywords": [
      -    "symbol",
      -    "private",
      -    "property",
      -    "es6",
      -    "ecmascript",
      -    "harmony"
      -  ],
      -  "repository": {
      -    "type": "git",
      -    "url": "git://github.com/medikoo/es6-symbol.git"
      -  },
      -  "dependencies": {
      -    "d": "~0.1.1",
      -    "es5-ext": "~0.10.5"
      -  },
      -  "devDependencies": {
      -    "tad": "~0.2.1",
      -    "xlint": "~0.2.2",
      -    "xlint-jslint-medikoo": "~0.1.2"
      -  },
      -  "scripts": {
      -    "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream",
      -    "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch",
      -    "test": "node ./node_modules/tad/bin/tad"
      -  },
      -  "license": "MIT",
      -  "gitHead": "51f6938d7830269fefa38f02eb912f5472b3ccd7",
      -  "bugs": {
      -    "url": "https://github.com/medikoo/es6-symbol/issues"
      -  },
      -  "homepage": "https://github.com/medikoo/es6-symbol",
      -  "_id": "es6-symbol@2.0.1",
      -  "_shasum": "761b5c67cfd4f1d18afb234f691d678682cb3bf3",
      -  "_from": "es6-symbol@>=2.0.1 <2.1.0",
      -  "_npmVersion": "1.4.28",
      -  "_npmUser": {
      -    "name": "medikoo",
      -    "email": "medikoo+npm@medikoo.com"
      -  },
      -  "maintainers": [
      -    {
      -      "name": "medikoo",
      -      "email": "medikoo+npm@medikoo.com"
      -    }
      -  ],
      -  "dist": {
      -    "shasum": "761b5c67cfd4f1d18afb234f691d678682cb3bf3",
      -    "tarball": "http://registry.npmjs.org/es6-symbol/-/es6-symbol-2.0.1.tgz"
      -  },
      -  "directories": {},
      -  "_resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-2.0.1.tgz",
      -  "readme": "ERROR: No README data found!"
      -}
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/polyfill.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/polyfill.js
      deleted file mode 100644
      index 735eb676b23c9b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/node_modules/es6-symbol/polyfill.js
      +++ /dev/null
      @@ -1,77 +0,0 @@
      -'use strict';
      -
      -var d              = require('d')
      -  , validateSymbol = require('./validate-symbol')
      -
      -  , create = Object.create, defineProperties = Object.defineProperties
      -  , defineProperty = Object.defineProperty, objPrototype = Object.prototype
      -  , Symbol, HiddenSymbol, globalSymbols = create(null);
      -
      -var generateName = (function () {
      -	var created = create(null);
      -	return function (desc) {
      -		var postfix = 0, name;
      -		while (created[desc + (postfix || '')]) ++postfix;
      -		desc += (postfix || '');
      -		created[desc] = true;
      -		name = '@@' + desc;
      -		defineProperty(objPrototype, name, d.gs(null, function (value) {
      -			defineProperty(this, name, d(value));
      -		}));
      -		return name;
      -	};
      -}());
      -
      -HiddenSymbol = function Symbol(description) {
      -	if (this instanceof HiddenSymbol) throw new TypeError('TypeError: Symbol is not a constructor');
      -	return Symbol(description);
      -};
      -module.exports = Symbol = function Symbol(description) {
      -	var symbol;
      -	if (this instanceof Symbol) throw new TypeError('TypeError: Symbol is not a constructor');
      -	symbol = create(HiddenSymbol.prototype);
      -	description = (description === undefined ? '' : String(description));
      -	return defineProperties(symbol, {
      -		__description__: d('', description),
      -		__name__: d('', generateName(description))
      -	});
      -};
      -defineProperties(Symbol, {
      -	for: d(function (key) {
      -		if (globalSymbols[key]) return globalSymbols[key];
      -		return (globalSymbols[key] = Symbol(String(key)));
      -	}),
      -	keyFor: d(function (s) {
      -		var key;
      -		validateSymbol(s);
      -		for (key in globalSymbols) if (globalSymbols[key] === s) return key;
      -	}),
      -	hasInstance: d('', Symbol('hasInstance')),
      -	isConcatSpreadable: d('', Symbol('isConcatSpreadable')),
      -	iterator: d('', Symbol('iterator')),
      -	match: d('', Symbol('match')),
      -	replace: d('', Symbol('replace')),
      -	search: d('', Symbol('search')),
      -	species: d('', Symbol('species')),
      -	split: d('', Symbol('split')),
      -	toPrimitive: d('', Symbol('toPrimitive')),
      -	toStringTag: d('', Symbol('toStringTag')),
      -	unscopables: d('', Symbol('unscopables'))
      -});
      -defineProperties(HiddenSymbol.prototype, {
      -	constructor: d(Symbol),
      -	toString: d('', function () { return this.__name__; })
      -});
      -
      -defineProperties(Symbol.prototype, {
      -	toString: d(function () { return 'Symbol (' + validateSymbol(this).__description__ + ')'; }),
      -	valueOf: d(function () { return validateSymbol(this); })
      -});
      -defineProperty(Symbol.prototype, Symbol.toPrimitive, d('',
      -	function () { return validateSymbol(this); }));
      -defineProperty(Symbol.prototype, Symbol.toStringTag, d('c', 'Symbol'));
      -
      -defineProperty(HiddenSymbol.prototype, Symbol.toPrimitive,
      -	d('c', Symbol.prototype[Symbol.toPrimitive]));
      -defineProperty(HiddenSymbol.prototype, Symbol.toStringTag,
      -	d('c', Symbol.prototype[Symbol.toStringTag]));
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/index.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/index.js
      deleted file mode 100644
      index 35daf78eea88c2..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/number/index.js
      +++ /dev/null
      @@ -1,16 +0,0 @@
      -'use strict';
      -
      -module.exports = {
      -	'#':              require('./#'),
      -	EPSILON:          require('./epsilon'),
      -	isFinite:         require('./is-finite'),
      -	isInteger:        require('./is-integer'),
      -	isNaN:            require('./is-nan'),
      -	isNumber:         require('./is-number'),
      -	isSafeInteger:    require('./is-safe-integer'),
      -	MAX_SAFE_INTEGER: require('./max-safe-integer'),
      -	MIN_SAFE_INTEGER: require('./min-safe-integer'),
      -	toInteger:        require('./to-integer'),
      -	toPosInteger:     require('./to-pos-integer'),
      -	toUint32:         require('./to-uint32')
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/_iterate.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/_iterate.js
      deleted file mode 100644
      index bf2c55d08601d3..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/_iterate.js
      +++ /dev/null
      @@ -1,29 +0,0 @@
      -// Internal method, used by iteration functions.
      -// Calls a function for each key-value pair found in object
      -// Optionally takes compareFn to iterate object in specific order
      -
      -'use strict';
      -
      -var isCallable = require('./is-callable')
      -  , callable   = require('./valid-callable')
      -  , value      = require('./valid-value')
      -
      -  , call = Function.prototype.call, keys = Object.keys
      -  , propertyIsEnumerable = Object.prototype.propertyIsEnumerable;
      -
      -module.exports = function (method, defVal) {
      -	return function (obj, cb/*, thisArg, compareFn*/) {
      -		var list, thisArg = arguments[2], compareFn = arguments[3];
      -		obj = Object(value(obj));
      -		callable(cb);
      -
      -		list = keys(obj);
      -		if (compareFn) {
      -			list.sort(isCallable(compareFn) ? compareFn.bind(obj) : undefined);
      -		}
      -		return list[method](function (key, index) {
      -			if (!propertyIsEnumerable.call(obj, key)) return defVal;
      -			return call.call(cb, thisArg, obj[key], key, obj, index);
      -		});
      -	};
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/copy-deep.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/copy-deep.js
      deleted file mode 100644
      index 548e3ee4b66bac..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/copy-deep.js
      +++ /dev/null
      @@ -1,30 +0,0 @@
      -'use strict';
      -
      -var isPlainObject = require('./is-plain-object')
      -  , value         = require('./valid-value')
      -
      -  , keys = Object.keys
      -  , copy;
      -
      -copy = function (source) {
      -	var target = {};
      -	this[0].push(source);
      -	this[1].push(target);
      -	keys(source).forEach(function (key) {
      -		var index;
      -		if (!isPlainObject(source[key])) {
      -			target[key] = source[key];
      -			return;
      -		}
      -		index = this[0].indexOf(source[key]);
      -		if (index === -1) target[key] = copy.call(this, source[key]);
      -		else target[key] = this[1][index];
      -	}, this);
      -	return target;
      -};
      -
      -module.exports = function (source) {
      -	var obj = Object(value(source));
      -	if (obj !== source) return obj;
      -	return copy.call([[], []], obj);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/index.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/index.js
      deleted file mode 100644
      index 4bdf403583ace9..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/object/index.js
      +++ /dev/null
      @@ -1,48 +0,0 @@
      -'use strict';
      -
      -module.exports = {
      -	assign:                     require('./assign'),
      -	clear:                      require('./clear'),
      -	compact:                    require('./compact'),
      -	compare:                    require('./compare'),
      -	copy:                       require('./copy'),
      -	copyDeep:                   require('./copy-deep'),
      -	count:                      require('./count'),
      -	create:                     require('./create'),
      -	eq:                         require('./eq'),
      -	every:                      require('./every'),
      -	filter:                     require('./filter'),
      -	firstKey:                   require('./first-key'),
      -	flatten:                    require('./flatten'),
      -	forEach:                    require('./for-each'),
      -	getPropertyNames:           require('./get-property-names'),
      -	is:                         require('./is'),
      -	isArrayLike:                require('./is-array-like'),
      -	isCallable:                 require('./is-callable'),
      -	isCopy:                     require('./is-copy'),
      -	isCopyDeep:                 require('./is-copy-deep'),
      -	isEmpty:                    require('./is-empty'),
      -	isObject:                   require('./is-object'),
      -	isPlainObject:              require('./is-plain-object'),
      -	keyOf:                      require('./key-of'),
      -	keys:                       require('./keys'),
      -	map:                        require('./map'),
      -	mapKeys:                    require('./map-keys'),
      -	normalizeOptions:           require('./normalize-options'),
      -	mixin:                      require('./mixin'),
      -	mixinPrototypes:            require('./mixin-prototypes'),
      -	primitiveSet:               require('./primitive-set'),
      -	safeTraverse:               require('./safe-traverse'),
      -	serialize:                  require('./serialize'),
      -	setPrototypeOf:             require('./set-prototype-of'),
      -	some:                       require('./some'),
      -	toArray:                    require('./to-array'),
      -	unserialize:                require('./unserialize'),
      -	validateArrayLike:          require('./validate-array-like'),
      -	validateArrayLikeObject:    require('./validate-array-like-object'),
      -	validCallable:              require('./valid-callable'),
      -	validObject:                require('./valid-object'),
      -	validateStringifiable:      require('./validate-stringifiable'),
      -	validateStringifiableValue: require('./validate-stringifiable-value'),
      -	validValue:                 require('./valid-value')
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/package.json b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/package.json
      deleted file mode 100644
      index 01d6532749e89c..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/package.json
      +++ /dev/null
      @@ -1,74 +0,0 @@
      -{
      -  "name": "es5-ext",
      -  "version": "0.10.7",
      -  "description": "ECMAScript 5 extensions and ES6 shims",
      -  "author": {
      -    "name": "Mariusz Nowak",
      -    "email": "medyk@medikoo.com",
      -    "url": "http://www.medikoo.com/"
      -  },
      -  "keywords": [
      -    "ecmascript",
      -    "ecmascript5",
      -    "ecmascript6",
      -    "es5",
      -    "es6",
      -    "extensions",
      -    "ext",
      -    "addons",
      -    "extras",
      -    "harmony",
      -    "javascript",
      -    "polyfill",
      -    "shim",
      -    "util",
      -    "utils",
      -    "utilities"
      -  ],
      -  "repository": {
      -    "type": "git",
      -    "url": "git://github.com/medikoo/es5-ext.git"
      -  },
      -  "dependencies": {
      -    "es6-iterator": "~0.1.3",
      -    "es6-symbol": "~2.0.1"
      -  },
      -  "devDependencies": {
      -    "tad": "~0.2.2",
      -    "xlint": "~0.2.2",
      -    "xlint-jslint-medikoo": "~0.1.2"
      -  },
      -  "scripts": {
      -    "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream",
      -    "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch",
      -    "test": "node ./node_modules/tad/bin/tad"
      -  },
      -  "license": "MIT",
      -  "gitHead": "5b63ee02f50dfbc70dc1f62bc66b8718af443f83",
      -  "bugs": {
      -    "url": "https://github.com/medikoo/es5-ext/issues"
      -  },
      -  "homepage": "https://github.com/medikoo/es5-ext",
      -  "_id": "es5-ext@0.10.7",
      -  "_shasum": "dfaea50721301042e2d89c1719d43493fa821656",
      -  "_from": "es5-ext@>=0.10.6 <0.11.0",
      -  "_npmVersion": "2.7.4",
      -  "_nodeVersion": "0.12.2",
      -  "_npmUser": {
      -    "name": "medikoo",
      -    "email": "medikoo+npm@medikoo.com"
      -  },
      -  "maintainers": [
      -    {
      -      "name": "medikoo",
      -      "email": "medikoo+npm@medikoo.com"
      -    }
      -  ],
      -  "dist": {
      -    "shasum": "dfaea50721301042e2d89c1719d43493fa821656",
      -    "tarball": "http://registry.npmjs.org/es5-ext/-/es5-ext-0.10.7.tgz"
      -  },
      -  "directories": {},
      -  "_resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.7.tgz",
      -  "readme": "ERROR: No README data found!"
      -}
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/sticky/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/sticky/is-implemented.js
      deleted file mode 100644
      index 379c4a5a8fb1b8..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/sticky/is-implemented.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -module.exports = function () {
      -	return RegExp.prototype.sticky === false;
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/unicode/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/unicode/is-implemented.js
      deleted file mode 100644
      index a8b15b3b38defb..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/reg-exp/#/unicode/is-implemented.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -module.exports = function () {
      -	return RegExp.prototype.unicode === false;
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/index.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/index.js
      deleted file mode 100644
      index d45d747cbe0954..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/string/#/index.js
      +++ /dev/null
      @@ -1,21 +0,0 @@
      -'use strict';
      -
      -module.exports = {
      -	'@@iterator':           require('./@@iterator'),
      -	at:                     require('./at'),
      -	camelToHyphen:          require('./camel-to-hyphen'),
      -	capitalize:             require('./capitalize'),
      -	caseInsensitiveCompare: require('./case-insensitive-compare'),
      -	codePointAt:            require('./code-point-at'),
      -	contains:               require('./contains'),
      -	hyphenToCamel:          require('./hyphen-to-camel'),
      -	endsWith:               require('./ends-with'),
      -	indent:                 require('./indent'),
      -	last:                   require('./last'),
      -	normalize:              require('./normalize'),
      -	pad:                    require('./pad'),
      -	plainReplace:           require('./plain-replace'),
      -	plainReplaceAll:        require('./plain-replace-all'),
      -	repeat:                 require('./repeat'),
      -	startsWith:             require('./starts-with')
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/__scopes.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/__scopes.js
      deleted file mode 100644
      index fc240d304869bb..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/array/__scopes.js
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -'use strict';
      -
      -exports.Array = ['1', '2', '3'];
      -
      -exports.Arguments = (function () {
      -	return arguments;
      -}('1', '2', '3'));
      -
      -exports.String = "123";
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/copy-deep.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/copy-deep.js
      deleted file mode 100644
      index a4023bc8ac4bf6..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es5-ext/test/object/copy-deep.js
      +++ /dev/null
      @@ -1,24 +0,0 @@
      -'use strict';
      -
      -var stringify = JSON.stringify;
      -
      -module.exports = function (t, a) {
      -	var o = { 1: 'raz', 2: 'dwa', 3: 'trzy' }
      -	  , no = t(o);
      -
      -	a.not(no, o, "Return different object");
      -	a(stringify(no), stringify(o), "Match properties and values");
      -
      -	o = { foo: 'bar', raz: { dwa: 'dwa',
      -		trzy: { cztery: 'pięć', 'sześć': 'siedem' }, osiem: {},
      -		'dziewięć': function () { } }, 'dziesięć': 10 };
      -	o.raz.rec = o;
      -
      -	no = t(o);
      -	a.not(o.raz, no.raz, "Deep");
      -	a.not(o.raz.trzy, no.raz.trzy, "Deep #2");
      -	a(stringify(o.raz.trzy), stringify(no.raz.trzy), "Deep content");
      -	a(no.raz.rec, no, "Recursive");
      -	a.not(o.raz.osiem, no.raz.osiem, "Empty object");
      -	a(o.raz['dziewięć'], no.raz['dziewięć'], "Function");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/.npmignore b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/.npmignore
      deleted file mode 100644
      index 155e41f69142ef..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/.npmignore
      +++ /dev/null
      @@ -1,4 +0,0 @@
      -.DS_Store
      -/node_modules
      -/npm-debug.log
      -/.lintcache
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/.travis.yml b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/.travis.yml
      deleted file mode 100644
      index 02c277cf565442..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/.travis.yml
      +++ /dev/null
      @@ -1,11 +0,0 @@
      -language: node_js
      -node_js:
      -  - 0.8
      -  - 0.10
      -  - 0.11
      -
      -notifications:
      -  email:
      -    - medikoo+es6-iterator@medikoo.com
      -
      -script: "npm test && npm run lint"
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/CHANGES b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/CHANGES
      deleted file mode 100644
      index a2d1ec7c2af31c..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/CHANGES
      +++ /dev/null
      @@ -1,28 +0,0 @@
      -v0.1.3  --  2015.02.02
      -* Update dependencies
      -* Fix spelling of LICENSE
      -
      -v0.1.2  --  2014.11.19
      -* Optimise internal `_next` to not verify internal's list length at all times
      -  (#2 thanks @RReverser)
      -* Fix documentation examples
      -* Configure lint scripts
      -
      -v0.1.1  --  2014.04.29
      -* Fix es6-symbol dependency version
      -
      -v0.1.0  --  2014.04.29
      -* Assure strictly npm hosted dependencies
      -* Remove sparse arrays dedicated handling (as per spec)
      -* Add: isIterable, validIterable and chain (method)
      -* Remove toArray, it's addressed by Array.from (polyfil can be found in es5-ext/array/from)
      -* Add break possiblity to 'forOf' via 'doBreak' function argument
      -* Provide dedicated iterator for array-likes (ArrayIterator) and for strings (StringIterator)
      -* Provide @@toStringTag symbol
      -* When available rely on @@iterator symbol
      -* Remove 32bit integer maximum list length restriction
      -* Improve Iterator internals
      -* Update to use latest version of dependencies
      -
      -v0.0.0  --  2013.10.12
      -Initial (dev version)
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/README.md b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/README.md
      deleted file mode 100644
      index 288373da7ab506..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/README.md
      +++ /dev/null
      @@ -1,148 +0,0 @@
      -# es6-iterator
      -## ECMAScript 6 Iterator interface
      -
      -### Installation
      -
      -	$ npm install es6-iterator
      -	
      -To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)
      -
      -## API
      -
      -### Constructors
      -
      -#### Iterator(list) _(es6-iterator)_
      -
      -Abstract Iterator interface. Meant for extensions and not to be used on its own.
      -
      -Accepts any _list_ object (technically object with numeric _length_ property).
      -
      -_Mind it doesn't iterate strings properly, for that use dedicated [StringIterator](#string-iterator)_
      -
      -```javascript
      -var Iterator = require('es6-iterator')
      -var iterator = new Iterator([1, 2, 3]);
      -
      -iterator.next(); // { value: 1, done: false }
      -iterator.next(); // { value: 2, done: false }
      -iterator.next(); // { value: 3, done: false }
      -iterator.next(); // { value: undefined, done: true }
      -```
      -
      -
      -#### ArrayIterator(arrayLike[, kind]) _(es6-iterator/array)_
      -
      -Dedicated for arrays and array-likes. Supports three iteration kinds:
      -* __value__ _(default)_ - Iterates values
      -* __key__ - Iterates indexes
      -* __key+value__ - Iterates keys and indexes, each iteration value is in _[key, value]_ form.
      -
      -
      -```javascript
      -var ArrayIterator = require('es6-iterator/array')
      -var iterator = new ArrayIterator([1, 2, 3], 'key+value');
      -
      -iterator.next(); // { value: [0, 1], done: false }
      -iterator.next(); // { value: [1, 2], done: false }
      -iterator.next(); // { value: [2, 3], done: false }
      -iterator.next(); // { value: undefined, done: true }
      -```
      -
      -May also be used for _arguments_ objects:
      -
      -```javascript
      -(function () {
      -  var iterator = new ArrayIterator(arguments);
      -
      -  iterator.next(); // { value: 1, done: false }
      -  iterator.next(); // { value: 2, done: false }
      -  iterator.next(); // { value: 3, done: false }
      -  iterator.next(); // { value: undefined, done: true }
      -}(1, 2, 3));
      -```
      -
      -#### StringIterator(str) _(es6-iterator/string)_
      -
      -Assures proper iteration over unicode symbols.  
      -See: http://mathiasbynens.be/notes/javascript-unicode
      -
      -```javascript
      -var StringIterator = require('es6-iterator/string');
      -var iterator = new StringIterator('f🙈o🙉o🙊');
      -
      -iterator.next(); // { value: 'f', done: false }
      -iterator.next(); // { value: '🙈', done: false }
      -iterator.next(); // { value: 'o', done: false }
      -iterator.next(); // { value: '🙉', done: false }
      -iterator.next(); // { value: 'o', done: false }
      -iterator.next(); // { value: '🙊', done: false }
      -iterator.next(); // { value: undefined, done: true }
      -```
      -
      -### Function utilities
      -
      -#### forOf(iterable, callback[, thisArg]) _(es6-iterator/for-of)_
      -
      -Polyfill for ECMAScript 6 [`for...of`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) statement.
      -
      -```
      -var forOf = require('es6-iterator/for-of');
      -var result = [];
      -
      -forOf('🙈🙉🙊', function (monkey) { result.push(monkey); });
      -console.log(result); // ['🙈', '🙉', '🙊'];
      -```
      -
      -Optionally you can break iteration at any point:
      -
      -```javascript
      -var result = [];
      -
      -forOf([1,2,3,4]', function (val, doBreak) {
      -  result.push(monkey);
      -  if (val >= 3) doBreak();
      -});
      -console.log(result); // [1, 2, 3];
      -```
      -
      -#### get(obj) _(es6-iterator/get)_
      -
      -Return iterator for any iterable object.
      -
      -```javascript
      -var getIterator = require('es6-iterator/get');
      -var iterator = get([1,2,3]);
      -
      -iterator.next(); // { value: 1, done: false }
      -iterator.next(); // { value: 2, done: false }
      -iterator.next(); // { value: 3, done: false }
      -iterator.next(); // { value: undefined, done: true }
      -```
      -
      -#### isIterable(obj) _(es6-iterator/is-iterable)_
      -
      -Whether _obj_ is iterable
      -
      -```javascript
      -var isIterable = require('es6-iterator/is-iterable');
      -
      -isIterable(null); // false
      -isIterable(true); // false
      -isIterable('str'); // true
      -isIterable(['a', 'r', 'r']); // true
      -isIterable(new ArrayIterator([])); // true
      -```
      -
      -#### validIterable(obj) _(es6-iterator/valid-iterable)_
      -
      -If _obj_ is an iterable it is returned. Otherwise _TypeError_ is thrown.
      -
      -### Method extensions
      -
      -#### iterator.chain(iterator1[, …iteratorn]) _(es6-iterator/#/chain)_
      -
      -Chain multiple iterators into one.
      -
      -### Tests [![Build Status](https://travis-ci.org/medikoo/es6-iterator.png)](https://travis-ci.org/medikoo/es6-iterator)
      -
      -	$ npm test
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/for-of.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/for-of.js
      deleted file mode 100644
      index 111f5522735204..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/for-of.js
      +++ /dev/null
      @@ -1,44 +0,0 @@
      -'use strict';
      -
      -var callable = require('es5-ext/object/valid-callable')
      -  , isString = require('es5-ext/string/is-string')
      -  , get      = require('./get')
      -
      -  , isArray = Array.isArray, call = Function.prototype.call;
      -
      -module.exports = function (iterable, cb/*, thisArg*/) {
      -	var mode, thisArg = arguments[2], result, doBreak, broken, i, l, char, code;
      -	if (isArray(iterable)) mode = 'array';
      -	else if (isString(iterable)) mode = 'string';
      -	else iterable = get(iterable);
      -
      -	callable(cb);
      -	doBreak = function () { broken = true; };
      -	if (mode === 'array') {
      -		iterable.some(function (value) {
      -			call.call(cb, thisArg, value, doBreak);
      -			if (broken) return true;
      -		});
      -		return;
      -	}
      -	if (mode === 'string') {
      -		l = iterable.length;
      -		for (i = 0; i < l; ++i) {
      -			char = iterable[i];
      -			if ((i + 1) < l) {
      -				code = char.charCodeAt(0);
      -				if ((code >= 0xD800) && (code <= 0xDBFF)) char += iterable[++i];
      -			}
      -			call.call(cb, thisArg, char, doBreak);
      -			if (broken) break;
      -		}
      -		return;
      -	}
      -	result = iterable.next();
      -
      -	while (!result.done) {
      -		call.call(cb, thisArg, result.value, doBreak);
      -		if (broken) return;
      -		result = iterable.next();
      -	}
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/get.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/get.js
      deleted file mode 100644
      index 38230fd85a2101..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/get.js
      +++ /dev/null
      @@ -1,13 +0,0 @@
      -'use strict';
      -
      -var isString = require('es5-ext/string/is-string')
      -  , ArrayIterator  = require('./array')
      -  , StringIterator = require('./string')
      -  , iterable       = require('./valid-iterable')
      -  , iteratorSymbol = require('es6-symbol').iterator;
      -
      -module.exports = function (obj) {
      -	if (typeof iterable(obj)[iteratorSymbol] === 'function') return obj[iteratorSymbol]();
      -	if (isString(obj)) return new StringIterator(obj);
      -	return new ArrayIterator(obj);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/is-iterable.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/is-iterable.js
      deleted file mode 100644
      index bbcf10492e1dc0..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/is-iterable.js
      +++ /dev/null
      @@ -1,13 +0,0 @@
      -'use strict';
      -
      -var isString       = require('es5-ext/string/is-string')
      -  , iteratorSymbol = require('es6-symbol').iterator
      -
      -  , isArray = Array.isArray;
      -
      -module.exports = function (value) {
      -	if (value == null) return false;
      -	if (isArray(value)) return true;
      -	if (isString(value)) return true;
      -	return (typeof value[iteratorSymbol] === 'function');
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/.lint b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/.lint
      deleted file mode 100644
      index 1851752f99bfda..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/.lint
      +++ /dev/null
      @@ -1,13 +0,0 @@
      -@root
      -
      -module
      -
      -tabs
      -indent 2
      -maxlen 100
      -
      -ass
      -nomen
      -plusplus
      -newcap
      -vars
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/.npmignore b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/.npmignore
      deleted file mode 100644
      index 155e41f69142ef..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/.npmignore
      +++ /dev/null
      @@ -1,4 +0,0 @@
      -.DS_Store
      -/node_modules
      -/npm-debug.log
      -/.lintcache
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/.travis.yml b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/.travis.yml
      deleted file mode 100644
      index afd3509a26b27d..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/.travis.yml
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -language: node_js
      -node_js:
      -  - 0.8
      -  - 0.10
      -  - 0.11
      -
      -notifications:
      -  email:
      -    - medikoo+es6-symbol@medikoo.com
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/CHANGES b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/CHANGES
      deleted file mode 100644
      index df8c27efc38de2..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/CHANGES
      +++ /dev/null
      @@ -1,34 +0,0 @@
      -v2.0.1  --  2015.01.28
      -* Fix Symbol.prototype[Symbol.isPrimitive] implementation
      -* Improve validation within Symbol.prototype.toString and
      -  Symbol.prototype.valueOf
      -
      -v2.0.0  --  2015.01.28
      -* Update up to changes in specification:
      -  * Implement `for` and `keyFor`
      -  * Remove `Symbol.create` and `Symbol.isRegExp`
      -  * Add `Symbol.match`, `Symbol.replace`, `Symbol.search`, `Symbol.species` and
      -    `Symbol.split`
      -* Rename `validSymbol` to `validateSymbol`
      -* Improve documentation
      -* Remove dead test modules
      -
      -v1.0.0  --  2015.01.26
      -* Fix enumerability for symbol properties set normally (e.g. obj[symbol] = value)
      -* Introduce initialization via hidden constructor
      -* Fix isSymbol handling of polyfill values when native Symbol is present
      -* Fix spelling of LICENSE
      -* Configure lint scripts
      -
      -v0.1.1  --  2014.10.07
      -* Fix isImplemented, so it returns true in case of polyfill
      -* Improve documentations
      -
      -v0.1.0  --  2014.04.28
      -* Assure strictly npm dependencies
      -* Update to use latest versions of dependencies
      -* Fix implementation detection so it doesn't crash on `String(symbol)`
      -* throw on `new Symbol()` (as decided by TC39)
      -
      -v0.0.0  --  2013.11.15
      -* Initial (dev) version
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/README.md b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/README.md
      deleted file mode 100644
      index 95d6780ba78cb4..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/README.md
      +++ /dev/null
      @@ -1,71 +0,0 @@
      -# es6-symbol
      -## ECMAScript 6 Symbol polyfill
      -
      -For more information about symbols see following links
      -- [Symbols in ECMAScript 6 by Axel Rauschmayer](http://www.2ality.com/2014/12/es6-symbols.html)
      -- [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol)
      -- [Specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-symbol-constructor)
      -
      -### Limitations
      -
      -Underneath it uses real string property names which can easily be retrieved, however accidental collision with other property names is unlikely.
      -
      -### Usage
      -
      -If you'd like to use native version when it exists and fallback to polyfill if it doesn't (but without implementing `Symbol` on global scope), do:
      -
      -```javascript
      -var Symbol = require('es6-symbol');
      -```
      -
      -If you want to make sure your environment implements `Symbol`, do:
      -
      -```javascript
      -require('es6-symbol/implement');
      -```
      -
      -If you strictly want to use polyfill even if native `Symbol` exists (hard to find a good reason for that), do:
      -
      -```javascript
      -var Symbol = require('es6-symbol/polyfill');
      -```
      -
      -#### API
      -
      -Best is to refer to [specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-symbol-objects). Still if you want quick look, follow examples:
      -
      -```javascript
      -var Symbol = require('es6-symbol');
      -
      -var symbol = Symbol('My custom symbol');
      -var x = {};
      -
      -x[symbol] = 'foo';
      -console.log(x[symbol]); 'foo'
      -
      -// Detect iterable:
      -var iterator, result;
      -if (possiblyIterable[Symbol.iterator]) {
      -  iterator = possiblyIterable[Symbol.iterator]();
      -  result = iterator.next();
      -  while(!result.done) {
      -    console.log(result.value);
      -    result = iterator.next();
      -  }
      -}
      -```
      -
      -### Installation
      -#### NPM
      -
      -In your project path:
      -
      -	$ npm install es6-symbol
      -
      -##### Browser
      -
      -To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)
      -
      -## Tests [![Build Status](https://travis-ci.org/medikoo/es6-symbol.png)](https://travis-ci.org/medikoo/es6-symbol)
      -
      -	$ npm test
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/package.json b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/package.json
      deleted file mode 100644
      index 0efffeaec90658..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/package.json
      +++ /dev/null
      @@ -1,63 +0,0 @@
      -{
      -  "name": "es6-symbol",
      -  "version": "2.0.1",
      -  "description": "ECMAScript6 Symbol polyfill",
      -  "author": {
      -    "name": "Mariusz Nowak",
      -    "email": "medyk@medikoo.com",
      -    "url": "http://www.medikoo.com/"
      -  },
      -  "keywords": [
      -    "symbol",
      -    "private",
      -    "property",
      -    "es6",
      -    "ecmascript",
      -    "harmony"
      -  ],
      -  "repository": {
      -    "type": "git",
      -    "url": "git://github.com/medikoo/es6-symbol.git"
      -  },
      -  "dependencies": {
      -    "d": "~0.1.1",
      -    "es5-ext": "~0.10.5"
      -  },
      -  "devDependencies": {
      -    "tad": "~0.2.1",
      -    "xlint": "~0.2.2",
      -    "xlint-jslint-medikoo": "~0.1.2"
      -  },
      -  "scripts": {
      -    "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream",
      -    "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch",
      -    "test": "node ./node_modules/tad/bin/tad"
      -  },
      -  "license": "MIT",
      -  "gitHead": "51f6938d7830269fefa38f02eb912f5472b3ccd7",
      -  "bugs": {
      -    "url": "https://github.com/medikoo/es6-symbol/issues"
      -  },
      -  "homepage": "https://github.com/medikoo/es6-symbol",
      -  "_id": "es6-symbol@2.0.1",
      -  "_shasum": "761b5c67cfd4f1d18afb234f691d678682cb3bf3",
      -  "_from": "es6-symbol@>=2.0.1 <2.1.0",
      -  "_npmVersion": "1.4.28",
      -  "_npmUser": {
      -    "name": "medikoo",
      -    "email": "medikoo+npm@medikoo.com"
      -  },
      -  "maintainers": [
      -    {
      -      "name": "medikoo",
      -      "email": "medikoo+npm@medikoo.com"
      -    }
      -  ],
      -  "dist": {
      -    "shasum": "761b5c67cfd4f1d18afb234f691d678682cb3bf3",
      -    "tarball": "http://registry.npmjs.org/es6-symbol/-/es6-symbol-2.0.1.tgz"
      -  },
      -  "directories": {},
      -  "_resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-2.0.1.tgz",
      -  "readme": "ERROR: No README data found!"
      -}
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/polyfill.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/polyfill.js
      deleted file mode 100644
      index 735eb676b23c9b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/polyfill.js
      +++ /dev/null
      @@ -1,77 +0,0 @@
      -'use strict';
      -
      -var d              = require('d')
      -  , validateSymbol = require('./validate-symbol')
      -
      -  , create = Object.create, defineProperties = Object.defineProperties
      -  , defineProperty = Object.defineProperty, objPrototype = Object.prototype
      -  , Symbol, HiddenSymbol, globalSymbols = create(null);
      -
      -var generateName = (function () {
      -	var created = create(null);
      -	return function (desc) {
      -		var postfix = 0, name;
      -		while (created[desc + (postfix || '')]) ++postfix;
      -		desc += (postfix || '');
      -		created[desc] = true;
      -		name = '@@' + desc;
      -		defineProperty(objPrototype, name, d.gs(null, function (value) {
      -			defineProperty(this, name, d(value));
      -		}));
      -		return name;
      -	};
      -}());
      -
      -HiddenSymbol = function Symbol(description) {
      -	if (this instanceof HiddenSymbol) throw new TypeError('TypeError: Symbol is not a constructor');
      -	return Symbol(description);
      -};
      -module.exports = Symbol = function Symbol(description) {
      -	var symbol;
      -	if (this instanceof Symbol) throw new TypeError('TypeError: Symbol is not a constructor');
      -	symbol = create(HiddenSymbol.prototype);
      -	description = (description === undefined ? '' : String(description));
      -	return defineProperties(symbol, {
      -		__description__: d('', description),
      -		__name__: d('', generateName(description))
      -	});
      -};
      -defineProperties(Symbol, {
      -	for: d(function (key) {
      -		if (globalSymbols[key]) return globalSymbols[key];
      -		return (globalSymbols[key] = Symbol(String(key)));
      -	}),
      -	keyFor: d(function (s) {
      -		var key;
      -		validateSymbol(s);
      -		for (key in globalSymbols) if (globalSymbols[key] === s) return key;
      -	}),
      -	hasInstance: d('', Symbol('hasInstance')),
      -	isConcatSpreadable: d('', Symbol('isConcatSpreadable')),
      -	iterator: d('', Symbol('iterator')),
      -	match: d('', Symbol('match')),
      -	replace: d('', Symbol('replace')),
      -	search: d('', Symbol('search')),
      -	species: d('', Symbol('species')),
      -	split: d('', Symbol('split')),
      -	toPrimitive: d('', Symbol('toPrimitive')),
      -	toStringTag: d('', Symbol('toStringTag')),
      -	unscopables: d('', Symbol('unscopables'))
      -});
      -defineProperties(HiddenSymbol.prototype, {
      -	constructor: d(Symbol),
      -	toString: d('', function () { return this.__name__; })
      -});
      -
      -defineProperties(Symbol.prototype, {
      -	toString: d(function () { return 'Symbol (' + validateSymbol(this).__description__ + ')'; }),
      -	valueOf: d(function () { return validateSymbol(this); })
      -});
      -defineProperty(Symbol.prototype, Symbol.toPrimitive, d('',
      -	function () { return validateSymbol(this); }));
      -defineProperty(Symbol.prototype, Symbol.toStringTag, d('c', 'Symbol'));
      -
      -defineProperty(HiddenSymbol.prototype, Symbol.toPrimitive,
      -	d('c', Symbol.prototype[Symbol.toPrimitive]));
      -defineProperty(HiddenSymbol.prototype, Symbol.toStringTag,
      -	d('c', Symbol.prototype[Symbol.toStringTag]));
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/test/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/test/implement.js
      deleted file mode 100644
      index eb35c3018835c7..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/test/implement.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof Symbol, 'function'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/test/index.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/test/index.js
      deleted file mode 100644
      index 62b3296df6fc5e..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/test/index.js
      +++ /dev/null
      @@ -1,12 +0,0 @@
      -'use strict';
      -
      -var d = require('d')
      -
      -  , defineProperty = Object.defineProperty;
      -
      -module.exports = function (T, a) {
      -	var symbol = T('test'), x = {};
      -	defineProperty(x, symbol, d('foo'));
      -	a(x.test, undefined, "Name");
      -	a(x[symbol], 'foo', "Get");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-implemented.js
      deleted file mode 100644
      index bb0d64536ebbae..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-implemented.js
      +++ /dev/null
      @@ -1,14 +0,0 @@
      -'use strict';
      -
      -var global   = require('es5-ext/global')
      -  , polyfill = require('../polyfill');
      -
      -module.exports = function (t, a) {
      -	var cache;
      -	a(typeof t(), 'boolean');
      -	cache = global.Symbol;
      -	global.Symbol = polyfill;
      -	a(t(), true);
      -	if (cache === undefined) delete global.Symbol;
      -	else global.Symbol = cache;
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-native-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-native-implemented.js
      deleted file mode 100644
      index df8ba0323f0cad..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-native-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t, 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-symbol.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-symbol.js
      deleted file mode 100644
      index ac24b9abbff4e6..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/test/is-symbol.js
      +++ /dev/null
      @@ -1,16 +0,0 @@
      -'use strict';
      -
      -var SymbolPoly = require('../polyfill');
      -
      -module.exports = function (t, a) {
      -	a(t(undefined), false, "Undefined");
      -	a(t(null), false, "Null");
      -	a(t(true), false, "Primitive");
      -	a(t('raz'), false, "String");
      -	a(t({}), false, "Object");
      -	a(t([]), false, "Array");
      -	if (typeof Symbol !== 'undefined') {
      -		a(t(Symbol()), true, "Native");
      -	}
      -	a(t(SymbolPoly()), true, "Polyfill");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/test/polyfill.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/test/polyfill.js
      deleted file mode 100644
      index 83fb5e9253677b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/test/polyfill.js
      +++ /dev/null
      @@ -1,27 +0,0 @@
      -'use strict';
      -
      -var d        = require('d')
      -  , isSymbol = require('../is-symbol')
      -
      -  , defineProperty = Object.defineProperty;
      -
      -module.exports = function (T, a) {
      -	var symbol = T('test'), x = {};
      -	defineProperty(x, symbol, d('foo'));
      -	a(x.test, undefined, "Name");
      -	a(x[symbol], 'foo', "Get");
      -	a(x instanceof T, false);
      -
      -	a(isSymbol(symbol), true, "Symbol");
      -	a(isSymbol(T.iterator), true, "iterator");
      -	a(isSymbol(T.toStringTag), true, "toStringTag");
      -
      -	x = {};
      -	x[symbol] = 'foo';
      -	a.deep(Object.getOwnPropertyDescriptor(x, symbol), { configurable: true, enumerable: false,
      -		value: 'foo', writable: true });
      -	symbol = T.for('marko');
      -	a(isSymbol(symbol), true);
      -	a(T.for('marko'), symbol);
      -	a(T.keyFor(symbol), 'marko');
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/test/validate-symbol.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/test/validate-symbol.js
      deleted file mode 100644
      index 2c8f84c8239b6e..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/test/validate-symbol.js
      +++ /dev/null
      @@ -1,19 +0,0 @@
      -'use strict';
      -
      -var SymbolPoly = require('../polyfill');
      -
      -module.exports = function (t, a) {
      -	var symbol;
      -	a.throws(function () { t(undefined); }, TypeError, "Undefined");
      -	a.throws(function () { t(null); }, TypeError, "Null");
      -	a.throws(function () { t(true); }, TypeError, "Primitive");
      -	a.throws(function () { t('raz'); }, TypeError, "String");
      -	a.throws(function () { t({}); }, TypeError, "Object");
      -	a.throws(function () { t([]); }, TypeError, "Array");
      -	if (typeof Symbol !== 'undefined') {
      -		symbol = Symbol();
      -		a(t(symbol), symbol, "Native");
      -	}
      -	symbol = SymbolPoly();
      -	a(t(symbol), symbol, "Polyfill");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/package.json b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/package.json
      deleted file mode 100644
      index b861638ad5d27b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/package.json
      +++ /dev/null
      @@ -1,66 +0,0 @@
      -{
      -  "name": "es6-iterator",
      -  "version": "0.1.3",
      -  "description": "Iterator abstraction based on ES6 specification",
      -  "author": {
      -    "name": "Mariusz Nowak",
      -    "email": "medyk@medikoo.com",
      -    "url": "http://www.medikoo.com/"
      -  },
      -  "keywords": [
      -    "iterator",
      -    "array",
      -    "list",
      -    "set",
      -    "map",
      -    "generator"
      -  ],
      -  "repository": {
      -    "type": "git",
      -    "url": "git://github.com/medikoo/es6-iterator.git"
      -  },
      -  "dependencies": {
      -    "d": "~0.1.1",
      -    "es5-ext": "~0.10.5",
      -    "es6-symbol": "~2.0.1"
      -  },
      -  "devDependencies": {
      -    "event-emitter": "~0.3.3",
      -    "tad": "~0.2.1",
      -    "xlint": "~0.2.2",
      -    "xlint-jslint-medikoo": "~0.1.2"
      -  },
      -  "scripts": {
      -    "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream",
      -    "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch",
      -    "test": "node ./node_modules/tad/bin/tad"
      -  },
      -  "license": "MIT",
      -  "gitHead": "2addc362c6f139e4941cf4726eeb59e5960c5cef",
      -  "bugs": {
      -    "url": "https://github.com/medikoo/es6-iterator/issues"
      -  },
      -  "homepage": "https://github.com/medikoo/es6-iterator",
      -  "_id": "es6-iterator@0.1.3",
      -  "_shasum": "d6f58b8c4fc413c249b4baa19768f8e4d7c8944e",
      -  "_from": "es6-iterator@>=0.1.3 <0.2.0",
      -  "_npmVersion": "2.3.0",
      -  "_nodeVersion": "0.11.16",
      -  "_npmUser": {
      -    "name": "medikoo",
      -    "email": "medikoo+npm@medikoo.com"
      -  },
      -  "maintainers": [
      -    {
      -      "name": "medikoo",
      -      "email": "medikoo+npm@medikoo.com"
      -    }
      -  ],
      -  "dist": {
      -    "shasum": "d6f58b8c4fc413c249b4baa19768f8e4d7c8944e",
      -    "tarball": "http://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.3.tgz"
      -  },
      -  "directories": {},
      -  "_resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.3.tgz",
      -  "readme": "ERROR: No README data found!"
      -}
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/test/for-of.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/test/for-of.js
      deleted file mode 100644
      index 502e7b767f61b2..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/test/for-of.js
      +++ /dev/null
      @@ -1,35 +0,0 @@
      -'use strict';
      -
      -var ArrayIterator = require('../array')
      -
      -  , slice = Array.prototype.slice;
      -
      -module.exports = function (t, a) {
      -	var i = 0, x = ['raz', 'dwa', 'trzy'], y = {}, called = 0;
      -	t(x, function () {
      -		a.deep(slice.call(arguments, 0, 1), [x[i]], "Array " + i + "#");
      -		a(this, y, "Array: context:  " + (i++) + "#");
      -	}, y);
      -	i = 0;
      -	t(x = 'foo', function () {
      -		a.deep(slice.call(arguments, 0, 1), [x[i]], "String " + i + "#");
      -		a(this, y, "Regular String: context:  " + (i++) + "#");
      -	}, y);
      -	i = 0;
      -	x = ['r', '💩', 'z'];
      -	t('r💩z', function () {
      -		a.deep(slice.call(arguments, 0, 1), [x[i]], "String " + i + "#");
      -		a(this, y, "Unicode String: context:  " + (i++) + "#");
      -	}, y);
      -	i = 0;
      -	t(new ArrayIterator(x), function () {
      -		a.deep(slice.call(arguments, 0, 1), [x[i]], "Iterator " + i + "#");
      -		a(this, y, "Iterator: context:  " + (i++) + "#");
      -	}, y);
      -
      -	t(x = ['raz', 'dwa', 'trzy'], function (value, doBreak) {
      -		++called;
      -		return doBreak();
      -	});
      -	a(called, 1, "Break");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/test/get.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/test/get.js
      deleted file mode 100644
      index 7309590cba5689..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/test/get.js
      +++ /dev/null
      @@ -1,16 +0,0 @@
      -'use strict';
      -
      -var iteratorSymbol = require('es6-symbol').iterator
      -  , Iterator       = require('../');
      -
      -module.exports = function (t, a) {
      -	var iterator;
      -	a.throws(function () { t(); }, TypeError, "Null");
      -	a.throws(function () { t({}); }, TypeError, "Plain object");
      -	a.throws(function () { t({ length: 0 }); }, TypeError, "Array-like");
      -	iterator = {};
      -	iterator[iteratorSymbol] = function () { return new Iterator([]); };
      -	a(t(iterator) instanceof Iterator, true, "Iterator");
      -	a(String(t([])), '[object Array Iterator]', " Array");
      -	a(String(t('foo')), '[object String Iterator]', "String");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/test/is-iterable.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/test/is-iterable.js
      deleted file mode 100644
      index 7c5c59b6d75a62..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/test/is-iterable.js
      +++ /dev/null
      @@ -1,18 +0,0 @@
      -'use strict';
      -
      -var iteratorSymbol = require('es6-symbol').iterator
      -  , Iterator       = require('../');
      -
      -module.exports = function (t, a) {
      -	var iterator;
      -	a(t(), false, "Undefined");
      -	a(t(123), false, "Number");
      -	a(t({}), false, "Plain object");
      -	a(t({ length: 0 }), false, "Array-like");
      -	iterator = {};
      -	iterator[iteratorSymbol] = function () { return new Iterator([]); };
      -	a(t(iterator), true, "Iterator");
      -	a(t([]), true, "Array");
      -	a(t('foo'), true, "String");
      -	a(t(''), true, "Empty string");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/test/valid-iterable.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/test/valid-iterable.js
      deleted file mode 100644
      index 7760b017826085..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/test/valid-iterable.js
      +++ /dev/null
      @@ -1,16 +0,0 @@
      -'use strict';
      -
      -var iteratorSymbol = require('es6-symbol').iterator
      -  , Iterator       = require('../');
      -
      -module.exports = function (t, a) {
      -	var obj;
      -	a.throws(function () { t(); }, TypeError, "Undefined");
      -	a.throws(function () { t({}); }, TypeError, "Plain object");
      -	a.throws(function () { t({ length: 0 }); }, TypeError, "Array-like");
      -	obj = {};
      -	obj[iteratorSymbol] = function () { return new Iterator([]); };
      -	a(t(obj), obj, "Iterator");
      -	obj = [];
      -	a(t(obj), obj, 'Array');
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/.npmignore b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/.npmignore
      deleted file mode 100644
      index 155e41f69142ef..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/.npmignore
      +++ /dev/null
      @@ -1,4 +0,0 @@
      -.DS_Store
      -/node_modules
      -/npm-debug.log
      -/.lintcache
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/.travis.yml b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/.travis.yml
      deleted file mode 100644
      index 4c4accb6b1ffb0..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/.travis.yml
      +++ /dev/null
      @@ -1,11 +0,0 @@
      -language: node_js
      -node_js:
      -  - 0.8
      -  - 0.10
      -  - 0.11
      -
      -notifications:
      -  email:
      -    - medikoo+es6-set@medikoo.com
      -
      -script: "npm test && npm run lint"
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/CHANGES b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/CHANGES
      deleted file mode 100644
      index 79603bf8cf2cfb..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/CHANGES
      +++ /dev/null
      @@ -1,18 +0,0 @@
      -v0.1.1  --  2014.10.07
      -* Fix isImplemented so it validates native Set properly
      -* Add getFirst and getLast extensions
      -* Configure linter scripts
      -
      -v0.1.0  --  2014.04.29
      -* Assure strictly npm hosted dependencies
      -* Introduce faster 'primitive' alternative (doesn't guarantee order of iteration)
      -* Add isNativeImplemented, and some, every and copy method extensions
      -* If native Set is provided polyfill extends it
      -* Optimize forEach iteration
      -* Remove comparator support (as it was removed from spec)
      -* Provide @@toStringTag symbol, ad @@iterator symbols on iterators
      -* Update to use latest dependencies versions
      -* Improve interals
      -
      -v0.0.0  --  2013.10.12
      -Initial (dev) version
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/is-implemented.js
      deleted file mode 100644
      index d8b0cd7d2d78e5..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/is-implemented.js
      +++ /dev/null
      @@ -1,22 +0,0 @@
      -'use strict';
      -
      -module.exports = function () {
      -	var set, iterator, result;
      -	if (typeof Set !== 'function') return false;
      -	set = new Set(['raz', 'dwa', 'trzy']);
      -	if (set.size !== 3) return false;
      -	if (typeof set.add !== 'function') return false;
      -	if (typeof set.clear !== 'function') return false;
      -	if (typeof set.delete !== 'function') return false;
      -	if (typeof set.entries !== 'function') return false;
      -	if (typeof set.forEach !== 'function') return false;
      -	if (typeof set.has !== 'function') return false;
      -	if (typeof set.keys !== 'function') return false;
      -	if (typeof set.values !== 'function') return false;
      -
      -	iterator = set.values();
      -	result = iterator.next();
      -	if (result.done !== false) return false;
      -	if (result.value !== 'raz') return false;
      -	return true;
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/is-set.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/is-set.js
      deleted file mode 100644
      index 19e47929356ab6..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/is-set.js
      +++ /dev/null
      @@ -1,12 +0,0 @@
      -'use strict';
      -
      -var toString          = Object.prototype.toString
      -  , toStringTagSymbol = require('es6-symbol').toStringTag
      -
      -  , id = '[object Set]'
      -  , Global = (typeof Set === 'undefined') ? null : Set;
      -
      -module.exports = function (x) {
      -	return (x && ((Global && (x instanceof Global)) ||
      -			(toString.call(x) === id) || (x[toStringTagSymbol] === 'Set'))) || false;
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/lib/iterator.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/lib/iterator.js
      deleted file mode 100644
      index 4a7dac7ebdc648..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/lib/iterator.js
      +++ /dev/null
      @@ -1,31 +0,0 @@
      -'use strict';
      -
      -var setPrototypeOf    = require('es5-ext/object/set-prototype-of')
      -  , contains          = require('es5-ext/string/#/contains')
      -  , d                 = require('d')
      -  , Iterator          = require('es6-iterator')
      -  , toStringTagSymbol = require('es6-symbol').toStringTag
      -
      -  , defineProperty = Object.defineProperty
      -  , SetIterator;
      -
      -SetIterator = module.exports = function (set, kind) {
      -	if (!(this instanceof SetIterator)) return new SetIterator(set, kind);
      -	Iterator.call(this, set.__setData__, set);
      -	if (!kind) kind = 'value';
      -	else if (contains.call(kind, 'key+value')) kind = 'key+value';
      -	else kind = 'value';
      -	defineProperty(this, '__kind__', d('', kind));
      -};
      -if (setPrototypeOf) setPrototypeOf(SetIterator, Iterator);
      -
      -SetIterator.prototype = Object.create(Iterator.prototype, {
      -	constructor: d(SetIterator),
      -	_resolve: d(function (i) {
      -		if (this.__kind__ === 'value') return this.__list__[i];
      -		return [this.__list__[i], this.__list__[i]];
      -	}),
      -	toString: d(function () { return '[object Set Iterator]'; })
      -});
      -defineProperty(SetIterator.prototype, toStringTagSymbol,
      -	d('c', 'Set Iterator'));
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/package.json b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/package.json
      deleted file mode 100644
      index dd1720921250e4..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/package.json
      +++ /dev/null
      @@ -1,66 +0,0 @@
      -{
      -  "name": "es6-set",
      -  "version": "0.1.1",
      -  "description": "ECMAScript6 Set polyfill",
      -  "author": {
      -    "name": "Mariusz Nowak",
      -    "email": "medyk@medikoo.com",
      -    "url": "http://www.medikoo.com/"
      -  },
      -  "keywords": [
      -    "set",
      -    "collection",
      -    "es6",
      -    "harmony",
      -    "list",
      -    "hash"
      -  ],
      -  "repository": {
      -    "type": "git",
      -    "url": "git://github.com/medikoo/es6-set.git"
      -  },
      -  "dependencies": {
      -    "d": "~0.1.1",
      -    "es5-ext": "~0.10.4",
      -    "es6-iterator": "~0.1.1",
      -    "es6-symbol": "~0.1.1",
      -    "event-emitter": "~0.3.1"
      -  },
      -  "devDependencies": {
      -    "tad": "0.2.x",
      -    "xlint": "~0.2.1",
      -    "xlint-jslint-medikoo": "~0.1.2"
      -  },
      -  "scripts": {
      -    "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream",
      -    "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch",
      -    "test": "node ./node_modules/tad/bin/tad"
      -  },
      -  "license": "MIT",
      -  "gitHead": "769f7391b194b25900a79d132d21f4abefb14201",
      -  "bugs": {
      -    "url": "https://github.com/medikoo/es6-set/issues"
      -  },
      -  "homepage": "https://github.com/medikoo/es6-set",
      -  "_id": "es6-set@0.1.1",
      -  "_shasum": "497cd235c9a2691f4caa0e33dd73ef86bde738ac",
      -  "_from": "es6-set@>=0.1.1 <0.2.0",
      -  "_npmVersion": "2.0.0",
      -  "_npmUser": {
      -    "name": "medikoo",
      -    "email": "medikoo+npm@medikoo.com"
      -  },
      -  "maintainers": [
      -    {
      -      "name": "medikoo",
      -      "email": "medikoo+npm@medikoo.com"
      -    }
      -  ],
      -  "dist": {
      -    "shasum": "497cd235c9a2691f4caa0e33dd73ef86bde738ac",
      -    "tarball": "http://registry.npmjs.org/es6-set/-/es6-set-0.1.1.tgz"
      -  },
      -  "directories": {},
      -  "_resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.1.tgz",
      -  "readme": "ERROR: No README data found!"
      -}
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/polyfill.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/polyfill.js
      deleted file mode 100644
      index d272429ffcea1f..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/polyfill.js
      +++ /dev/null
      @@ -1,79 +0,0 @@
      -'use strict';
      -
      -var clear          = require('es5-ext/array/#/clear')
      -  , eIndexOf       = require('es5-ext/array/#/e-index-of')
      -  , setPrototypeOf = require('es5-ext/object/set-prototype-of')
      -  , callable       = require('es5-ext/object/valid-callable')
      -  , d              = require('d')
      -  , ee             = require('event-emitter')
      -  , Symbol         = require('es6-symbol')
      -  , iterator       = require('es6-iterator/valid-iterable')
      -  , forOf          = require('es6-iterator/for-of')
      -  , Iterator       = require('./lib/iterator')
      -  , isNative       = require('./is-native-implemented')
      -
      -  , call = Function.prototype.call, defineProperty = Object.defineProperty
      -  , SetPoly, getValues;
      -
      -module.exports = SetPoly = function (/*iterable*/) {
      -	var iterable = arguments[0];
      -	if (!(this instanceof SetPoly)) return new SetPoly(iterable);
      -	if (this.__setData__ !== undefined) {
      -		throw new TypeError(this + " cannot be reinitialized");
      -	}
      -	if (iterable != null) iterator(iterable);
      -	defineProperty(this, '__setData__', d('c', []));
      -	if (!iterable) return;
      -	forOf(iterable, function (value) {
      -		if (eIndexOf.call(this, value) !== -1) return;
      -		this.push(value);
      -	}, this.__setData__);
      -};
      -
      -if (isNative) {
      -	if (setPrototypeOf) setPrototypeOf(SetPoly, Set);
      -	SetPoly.prototype = Object.create(Set.prototype, {
      -		constructor: d(SetPoly)
      -	});
      -}
      -
      -ee(Object.defineProperties(SetPoly.prototype, {
      -	add: d(function (value) {
      -		if (this.has(value)) return this;
      -		this.emit('_add', this.__setData__.push(value) - 1, value);
      -		return this;
      -	}),
      -	clear: d(function () {
      -		if (!this.__setData__.length) return;
      -		clear.call(this.__setData__);
      -		this.emit('_clear');
      -	}),
      -	delete: d(function (value) {
      -		var index = eIndexOf.call(this.__setData__, value);
      -		if (index === -1) return false;
      -		this.__setData__.splice(index, 1);
      -		this.emit('_delete', index, value);
      -		return true;
      -	}),
      -	entries: d(function () { return new Iterator(this, 'key+value'); }),
      -	forEach: d(function (cb/*, thisArg*/) {
      -		var thisArg = arguments[1], iterator, result, value;
      -		callable(cb);
      -		iterator = this.values();
      -		result = iterator._next();
      -		while (result !== undefined) {
      -			value = iterator._resolve(result);
      -			call.call(cb, thisArg, value, value, this);
      -			result = iterator._next();
      -		}
      -	}),
      -	has: d(function (value) {
      -		return (eIndexOf.call(this.__setData__, value) !== -1);
      -	}),
      -	keys: d(getValues = function () { return this.values(); }),
      -	size: d.gs(function () { return this.__setData__.length; }),
      -	values: d(function () { return new Iterator(this); }),
      -	toString: d(function () { return '[object Set]'; })
      -}));
      -defineProperty(SetPoly.prototype, Symbol.iterator, d(getValues));
      -defineProperty(SetPoly.prototype, Symbol.toStringTag, d('c', 'Set'));
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/primitive/index.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/primitive/index.js
      deleted file mode 100644
      index 4565887d415a9a..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/primitive/index.js
      +++ /dev/null
      @@ -1,88 +0,0 @@
      -'use strict';
      -
      -var callable       = require('es5-ext/object/valid-callable')
      -  , clear          = require('es5-ext/object/clear')
      -  , setPrototypeOf = require('es5-ext/object/set-prototype-of')
      -  , d              = require('d')
      -  , iterator       = require('es6-iterator/valid-iterable')
      -  , forOf          = require('es6-iterator/for-of')
      -  , Set            = require('../polyfill')
      -  , Iterator       = require('../lib/primitive-iterator')
      -
      -  , create = Object.create, defineProperties = Object.defineProperties
      -  , defineProperty = Object.defineProperty
      -  , hasOwnProperty = Object.prototype.hasOwnProperty
      -  , PrimitiveSet;
      -
      -module.exports = PrimitiveSet = function (/*iterable, serialize*/) {
      -	var iterable = arguments[0], serialize = arguments[1];
      -	if (!(this instanceof PrimitiveSet)) {
      -		return new PrimitiveSet(iterable, serialize);
      -	}
      -	if (this.__setData__ !== undefined) {
      -		throw new TypeError(this + " cannot be reinitialized");
      -	}
      -	if (iterable != null) iterator(iterable);
      -	if (serialize !== undefined) {
      -		callable(serialize);
      -		defineProperty(this, '_serialize', d('', serialize));
      -	}
      -	defineProperties(this, {
      -		__setData__: d('c', create(null)),
      -		__size__: d('w', 0)
      -	});
      -	if (!iterable) return;
      -	forOf(iterable, function (value) {
      -		var key = this._serialize(value);
      -		if (key == null) throw new TypeError(value + " cannot be serialized");
      -		if (hasOwnProperty.call(this.__setData__, key)) return;
      -		this.__setData__[key] = value;
      -		++this.__size__;
      -	}, this);
      -};
      -if (setPrototypeOf) setPrototypeOf(PrimitiveSet, Set);
      -
      -PrimitiveSet.prototype = create(Set.prototype, {
      -	constructor: d(PrimitiveSet),
      -	_serialize: d(function (value) {
      -		if (value && (typeof value.toString !== 'function')) return null;
      -		return String(value);
      -	}),
      -	add: d(function (value) {
      -		var key = this._serialize(value);
      -		if (key == null) throw new TypeError(value + " cannot be serialized");
      -		if (hasOwnProperty.call(this.__setData__, key)) return this;
      -		this.__setData__[key] = value;
      -		++this.__size__;
      -		this.emit('_add', key);
      -		return this;
      -	}),
      -	clear: d(function () {
      -		if (!this.__size__) return;
      -		clear(this.__setData__);
      -		this.__size__ = 0;
      -		this.emit('_clear');
      -	}),
      -	delete: d(function (value) {
      -		var key = this._serialize(value);
      -		if (key == null) return false;
      -		if (!hasOwnProperty.call(this.__setData__, key)) return false;
      -		delete this.__setData__[key];
      -		--this.__size__;
      -		this.emit('_delete', key);
      -		return true;
      -	}),
      -	entries: d(function () { return new Iterator(this, 'key+value'); }),
      -	get: d(function (key) {
      -		key = this._serialize(key);
      -		if (key == null) return;
      -		return this.__setData__[key];
      -	}),
      -	has: d(function (value) {
      -		var key = this._serialize(value);
      -		if (key == null) return false;
      -		return hasOwnProperty.call(this.__setData__, key);
      -	}),
      -	size: d.gs(function () { return this.__size__; }),
      -	values: d(function () { return new Iterator(this); })
      -});
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/ext/copy.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/ext/copy.js
      deleted file mode 100644
      index 84fe912a36f735..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/ext/copy.js
      +++ /dev/null
      @@ -1,12 +0,0 @@
      -'use strict';
      -
      -var toArray = require('es5-ext/array/to-array')
      -  , Set     = require('../../');
      -
      -module.exports = function (t, a) {
      -	var content = ['raz', 2, true], set = new Set(content), copy;
      -
      -	copy = t.call(set);
      -	a.not(copy, set, "Copy");
      -	a.deep(toArray(copy), content, "Content");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/ext/every.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/ext/every.js
      deleted file mode 100644
      index f56ca385fa5a73..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/ext/every.js
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -'use strict';
      -
      -var Set = require('../../');
      -
      -module.exports = function (t, a) {
      -	a(t.call(new Set(), Boolean), true, "Empty set");
      -	a(t.call(new Set([2, 3, 4]), Boolean), true, "Truthy");
      -	a(t.call(new Set([2, 0, 4]), Boolean), false, "Falsy");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/ext/get-first.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/ext/get-first.js
      deleted file mode 100644
      index f99829e5afe0bc..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/ext/get-first.js
      +++ /dev/null
      @@ -1,12 +0,0 @@
      -'use strict';
      -
      -var Set     = require('../../');
      -
      -module.exports = function (t, a) {
      -	var content = ['raz', 2, true], set = new Set(content);
      -
      -	a(t.call(set), 'raz');
      -
      -	set = new Set();
      -	a(t.call(set), undefined);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/ext/get-last.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/ext/get-last.js
      deleted file mode 100644
      index 1dcc993ed0ec73..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/ext/get-last.js
      +++ /dev/null
      @@ -1,12 +0,0 @@
      -'use strict';
      -
      -var Set     = require('../../');
      -
      -module.exports = function (t, a) {
      -	var content = ['raz', 2, true], set = new Set(content);
      -
      -	a(t.call(set), true);
      -
      -	set = new Set();
      -	a(t.call(set), undefined);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/ext/some.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/ext/some.js
      deleted file mode 100644
      index 84ce11916a8bb9..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/ext/some.js
      +++ /dev/null
      @@ -1,10 +0,0 @@
      -'use strict';
      -
      -var Set = require('../../');
      -
      -module.exports = function (t, a) {
      -	a(t.call(new Set(), Boolean), false, "Empty set");
      -	a(t.call(new Set([2, 3, 4]), Boolean), true, "All true");
      -	a(t.call(new Set([0, false, 4]), Boolean), true, "Some false");
      -	a(t.call(new Set([0, false, null]), Boolean), false, "All false");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/implement.js
      deleted file mode 100644
      index 4882d3786a62d9..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/implement.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof Set, 'function'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/index.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/index.js
      deleted file mode 100644
      index 19c64865097d31..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (T, a) { a((new T(['raz', 'dwa'])).size, 2); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/is-implemented.js
      deleted file mode 100644
      index 124793e7373f1c..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/is-implemented.js
      +++ /dev/null
      @@ -1,14 +0,0 @@
      -'use strict';
      -
      -var global   = require('es5-ext/global')
      -  , polyfill = require('../polyfill');
      -
      -module.exports = function (t, a) {
      -	var cache;
      -	a(typeof t(), 'boolean');
      -	cache = global.Set;
      -	global.Set = polyfill;
      -	a(t(), true);
      -	if (cache === undefined) delete global.Set;
      -	else global.Set = cache;
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/is-native-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/is-native-implemented.js
      deleted file mode 100644
      index df8ba0323f0cad..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/is-native-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t, 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/is-set.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/is-set.js
      deleted file mode 100644
      index c969cce232f0d6..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/is-set.js
      +++ /dev/null
      @@ -1,16 +0,0 @@
      -'use strict';
      -
      -var SetPoly = require('../polyfill');
      -
      -module.exports = function (t, a) {
      -	a(t(undefined), false, "Undefined");
      -	a(t(null), false, "Null");
      -	a(t(true), false, "Primitive");
      -	a(t('raz'), false, "String");
      -	a(t({}), false, "Object");
      -	a(t([]), false, "Array");
      -	if (typeof Set !== 'undefined') {
      -		a(t(new Set()), true, "Native");
      -	}
      -	a(t(new SetPoly()), true, "Polyfill");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/lib/iterator.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/lib/iterator.js
      deleted file mode 100644
      index 9e5cfb91b9217f..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/lib/iterator.js
      +++ /dev/null
      @@ -1,13 +0,0 @@
      -'use strict';
      -
      -var Set     = require('../../polyfill')
      -  , toArray = require('es5-ext/array/to-array');
      -
      -module.exports = function (T, a) {
      -	var set = new Set(['raz', 'dwa']);
      -
      -	a.deep(toArray(new T(set)), ['raz', 'dwa'], "Default");
      -	a.deep(toArray(new T(set, 'key+value')), [['raz', 'raz'], ['dwa', 'dwa']],
      -		"Key & Value");
      -	a.deep(toArray(new T(set, 'value')), ['raz', 'dwa'], "Other");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/lib/primitive-iterator.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/lib/primitive-iterator.js
      deleted file mode 100644
      index 2a4956b80b3877..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/lib/primitive-iterator.js
      +++ /dev/null
      @@ -1,113 +0,0 @@
      -'use strict';
      -
      -var Set            = require('../../primitive')
      -  , toArray        = require('es5-ext/array/to-array')
      -  , iteratorSymbol = require('es6-symbol').iterator
      -
      -  , compare, map;
      -
      -compare = function (a, b) {
      -	if (!a.value) return -1;
      -	if (!b.value) return 1;
      -	return a.value.localeCompare(b.value);
      -};
      -
      -map = function (arr) {
      -	return arr.sort().map(function (value) {
      -		return { done: false, value: value };
      -	});
      -};
      -
      -module.exports = function (T) {
      -	return {
      -		"": function (a) {
      -			var arr = ['raz', 'dwa', 'trzy', 'cztery', 'pięć'], it, y, z
      -			  , set = new Set(arr), result = [];
      -
      -			it = new T(set);
      -			a(it[iteratorSymbol](), it, "@@iterator");
      -			y = it.next();
      -			result.push(y);
      -			z = it.next();
      -			a.not(y, z, "Recreate result");
      -			result.push(z);
      -			result.push(it.next());
      -			result.push(it.next());
      -			result.push(it.next());
      -			a.deep(result.sort(compare), map(arr));
      -			a.deep(y = it.next(), { done: true, value: undefined }, "End");
      -			a.not(y, it.next(), "Recreate result on dead");
      -		},
      -		Emited: function (a) {
      -			var arr = ['raz', 'dwa', 'trzy', 'cztery', 'pięć'], it
      -			  , set = new Set(arr), result = [];
      -
      -			it = new T(set);
      -			result.push(it.next());
      -			result.push(it.next());
      -			set.add('sześć');
      -			arr.push('sześć');
      -			result.push(it.next());
      -			set.delete('pięć');
      -			arr.splice(4, 1);
      -			result.push(it.next());
      -			result.push(it.next());
      -			a.deep(result.sort(compare), map(arr));
      -			a.deep(it.next(), { done: true, value: undefined }, "End");
      -		},
      -		"Emited #2": function (a) {
      -			var arr = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it
      -			  , set = new Set(arr), result = [];
      -
      -			it = new T(set);
      -			result.push(it.next());
      -			result.push(it.next());
      -			set.add('siedem');
      -			set.delete('siedem');
      -			result.push(it.next());
      -			result.push(it.next());
      -			set.delete('pięć');
      -			arr.splice(4, 1);
      -			result.push(it.next());
      -			a.deep(result.sort(compare), map(arr));
      -			a.deep(it.next(), { done: true, value: undefined }, "End");
      -		},
      -		"Emited: Clear #1": function (a) {
      -			var arr = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it
      -			  , set = new Set(arr), result = [];
      -
      -			it = new T(set);
      -			result.push(it.next());
      -			result.push(it.next());
      -			arr = ['raz', 'dwa'];
      -			set.clear();
      -			a.deep(result.sort(compare), map(arr));
      -			a.deep(it.next(), { done: true, value: undefined }, "End");
      -		},
      -		"Emited: Clear #2": function (a) {
      -			var arr = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it
      -			  , set = new Set(arr), result = [];
      -
      -			it = new T(set);
      -			result.push(it.next());
      -			result.push(it.next());
      -			set.clear();
      -			set.add('foo');
      -			set.add('bar');
      -			arr = ['raz', 'dwa', 'foo', 'bar'];
      -			result.push(it.next());
      -			result.push(it.next());
      -			a.deep(result.sort(compare), map(arr));
      -			a.deep(it.next(), { done: true, value: undefined }, "End");
      -		},
      -		Kinds: function (a) {
      -			var set = new Set(['raz', 'dwa']);
      -
      -			a.deep(toArray(new T(set)).sort(), ['raz', 'dwa'].sort(), "Default");
      -			a.deep(toArray(new T(set, 'key+value')).sort(),
      -				[['raz', 'raz'], ['dwa', 'dwa']].sort(), "Key & Value");
      -			a.deep(toArray(new T(set, 'value')).sort(), ['raz', 'dwa'].sort(),
      -				"Other");
      -		}
      -	};
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/polyfill.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/polyfill.js
      deleted file mode 100644
      index 10ce6d39eb2b7a..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/polyfill.js
      +++ /dev/null
      @@ -1,44 +0,0 @@
      -'use strict';
      -
      -var aFrom   = require('es5-ext/array/from')
      -  , toArray = require('es5-ext/array/to-array');
      -
      -module.exports = function (T, a) {
      -	var arr = ['raz', 'dwa', 'trzy'], set = new T(arr), x = {}, y = {}, i = 0;
      -
      -	a(set instanceof T, true, "Set");
      -	a(set.size, 3, "Size");
      -	a(set.has('raz'), true, "Has: true");
      -	a(set.has(x), false, "Has: false");
      -	a(set.add(x), set, "Add: return");
      -	a(set.has(x), true, "Add");
      -	a(set.size, 4, "Add: Size");
      -	a(set.delete({}), false, "Delete: false");
      -
      -	arr.push(x);
      -	set.forEach(function () {
      -		a.deep(aFrom(arguments), [arr[i], arr[i], set],
      -			"ForEach: Arguments:  #" + i);
      -		a(this, y, "ForEach: Context: #" + i);
      -		if (i === 0) {
      -			a(set.delete('raz'), true, "Delete: true");
      -			a(set.has('raz'), false, "Delete");
      -			a(set.size, 3, "Delete: size");
      -			set.add('cztery');
      -			arr.push('cztery');
      -		}
      -		i++;
      -	}, y);
      -	arr.splice(0, 1);
      -
      -	a.deep(toArray(set.entries()), [['dwa', 'dwa'], ['trzy', 'trzy'], [x, x],
      -		['cztery', 'cztery']], "Entries");
      -	a.deep(toArray(set.keys()), ['dwa', 'trzy', x, 'cztery'], "Keys");
      -	a.deep(toArray(set.values()), ['dwa', 'trzy', x, 'cztery'], "Values");
      -	a.deep(toArray(set), ['dwa', 'trzy', x, 'cztery'], "Iterator");
      -
      -	set.clear();
      -	a(set.size, 0, "Clear: size");
      -	a(set.has('trzy'), false, "Clear: has");
      -	a.deep(toArray(set), [], "Clear: Values");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/primitive/index.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/primitive/index.js
      deleted file mode 100644
      index 54765d2ae2b925..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/primitive/index.js
      +++ /dev/null
      @@ -1,44 +0,0 @@
      -'use strict';
      -
      -var aFrom       = require('es5-ext/array/from')
      -  , getIterator = require('es6-iterator/get')
      -  , toArray     = require('es5-ext/array/to-array');
      -
      -module.exports = function (T, a) {
      -	var arr = ['raz', 'dwa', 'trzy'], set = new T(arr), x = 'other', y = 'other2'
      -	  , i = 0, result = [];
      -
      -	a(set instanceof T, true, "Set");
      -	a(set.size, 3, "Size");
      -	a(set.has('raz'), true, "Has: true");
      -	a(set.has(x), false, "Has: false");
      -	a(set.add(x), set, "Add: return");
      -	a(set.has(x), true, "Add");
      -	a(set.size, 4, "Add: Size");
      -	a(set.delete('else'), false, "Delete: false");
      -	a(set.get('raz'), 'raz', "Get");
      -
      -	arr.push(x);
      -	set.forEach(function () {
      -		result.push(aFrom(arguments));
      -		a(this, y, "ForEach: Context: #" + i);
      -	}, y);
      -
      -	a.deep(result.sort(function (a, b) {
      -		return a[0].localeCompare(b[0]);
      -	}), arr.sort().map(function (val) { return [val, val, set]; }));
      -
      -	a.deep(toArray(set.entries()).sort(), [['dwa', 'dwa'], ['trzy', 'trzy'],
      -		[x, x], ['raz', 'raz']].sort(), "Entries");
      -	a.deep(toArray(set.keys()).sort(), ['dwa', 'trzy', x, 'raz'].sort(),
      -		"Keys");
      -	a.deep(toArray(set.values()).sort(), ['dwa', 'trzy', x, 'raz'].sort(),
      -		"Values");
      -	a.deep(toArray(getIterator(set)).sort(), ['dwa', 'trzy', x, 'raz'].sort(),
      -		"Iterator");
      -
      -	set.clear();
      -	a(set.size, 0, "Clear: size");
      -	a(set.has('trzy'), false, "Clear: has");
      -	a.deep(toArray(set.values()), [], "Clear: Values");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/valid-set.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/valid-set.js
      deleted file mode 100644
      index 8c71f5f8c709e4..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/valid-set.js
      +++ /dev/null
      @@ -1,19 +0,0 @@
      -'use strict';
      -
      -var SetPoly = require('../polyfill');
      -
      -module.exports = function (t, a) {
      -	var set;
      -	a.throws(function () { t(undefined); }, TypeError, "Undefined");
      -	a.throws(function () { t(null); }, TypeError, "Null");
      -	a.throws(function () { t(true); }, TypeError, "Primitive");
      -	a.throws(function () { t('raz'); }, TypeError, "String");
      -	a.throws(function () { t({}); }, TypeError, "Object");
      -	a.throws(function () { t([]); }, TypeError, "Array");
      -	if (typeof Set !== 'undefined') {
      -		set = new Set();
      -		a(t(set), set, "Native");
      -	}
      -	set = new SetPoly();
      -	a(t(set), set, "Polyfill");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/.lint b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/.lint
      deleted file mode 100644
      index 701a50ce430c63..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/.lint
      +++ /dev/null
      @@ -1,13 +0,0 @@
      -@root
      -
      -module
      -
      -tabs
      -indent 2
      -maxlen 80
      -
      -ass
      -nomen
      -plusplus
      -
      -newcap
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/.npmignore b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/.npmignore
      deleted file mode 100644
      index 155e41f69142ef..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/.npmignore
      +++ /dev/null
      @@ -1,4 +0,0 @@
      -.DS_Store
      -/node_modules
      -/npm-debug.log
      -/.lintcache
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/.travis.yml b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/.travis.yml
      deleted file mode 100644
      index afd3509a26b27d..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/.travis.yml
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -language: node_js
      -node_js:
      -  - 0.8
      -  - 0.10
      -  - 0.11
      -
      -notifications:
      -  email:
      -    - medikoo+es6-symbol@medikoo.com
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/CHANGES b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/CHANGES
      deleted file mode 100644
      index ff5e1b480cb2bb..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/CHANGES
      +++ /dev/null
      @@ -1,12 +0,0 @@
      -v0.1.1  --  2014.10.07
      -* Fix isImplemented, so it returns true in case of polyfill
      -* Improve documentations
      -
      -v0.1.0  --  2014.04.28
      -* Assure strictly npm dependencies
      -* Update to use latest versions of dependencies
      -* Fix implementation detection so it doesn't crash on `String(symbol)`
      -* throw on `new Symbol()` (as decided by TC39)
      -
      -v0.0.0  --  2013.11.15
      -* Initial (dev) version
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/README.md b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/README.md
      deleted file mode 100644
      index 978eb59d8d55be..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/README.md
      +++ /dev/null
      @@ -1,67 +0,0 @@
      -# es6-symbol
      -## ECMAScript6 Symbol polyfill
      -
      -### Limitations
      -
      -- Underneath it uses real string property names which can easily be retrieved (however accidental collision with other property names is unlikely)
      -- As it needs custom `toString` behavior to work properly. Original `Symbol.prototype.toString` couldn't be implemented as specified, still it's accessible as `Symbol.prototoype.properToString`
      -
      -### Usage
      -
      -If you want to make sure your environment implements `Symbol`, do:
      -
      -```javascript
      -require('es6-symbol/implement');
      -```
      -
      -If you'd like to use native version when it exists and fallback to polyfill if it doesn't, but without implementing `Symbol` on global scope, do:
      -
      -```javascript
      -var Symbol = require('es6-symbol');
      -```
      -
      -If you strictly want to use polyfill even if native `Symbol` exists (hard to find a good reason for that), do:
      -
      -```javascript
      -var Symbol = require('es6-symbol/polyfill');
      -```
      -
      -#### API
      -
      -Best is to refer to [specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-symbol-objects). Still if you want quick look, follow examples:
      -
      -```javascript
      -var Symbol = require('es6-symbol');
      -
      -var symbol = Symbol('My custom symbol');
      -var x = {};
      -
      -x[symbol] = 'foo';
      -console.log(x[symbol]); 'foo'
      -
      -// Detect iterable:
      -var iterator, result;
      -if (possiblyIterable[Symbol.iterator]) {
      -  iterator = possiblyIterable[Symbol.iterator]();
      -  result = iterator.next();
      -  while(!result.done) {
      -    console.log(result.value);
      -    result = iterator.next();
      -  }
      -}
      -```
      -
      -### Installation
      -#### NPM
      -
      -In your project path:
      -
      -	$ npm install es6-symbol
      -
      -##### Browser
      -
      -You can easily bundle _es6-symbol_ for browser with [modules-webmake](https://github.com/medikoo/modules-webmake)
      -
      -## Tests [![Build Status](https://travis-ci.org/medikoo/es6-symbol.png)](https://travis-ci.org/medikoo/es6-symbol)
      -
      -	$ npm test
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/implement.js
      deleted file mode 100644
      index 153edacdbedf9b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/implement.js
      +++ /dev/null
      @@ -1,7 +0,0 @@
      -'use strict';
      -
      -if (!require('./is-implemented')()) {
      -	Object.defineProperty(require('es5-ext/global'), 'Symbol',
      -		{ value: require('./polyfill'), configurable: true, enumerable: false,
      -			writable: true });
      -}
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/index.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/index.js
      deleted file mode 100644
      index 609f1faf551164..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./is-implemented')() ? Symbol : require('./polyfill');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/is-implemented.js
      deleted file mode 100644
      index 02a06b5a80c16b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/is-implemented.js
      +++ /dev/null
      @@ -1,19 +0,0 @@
      -'use strict';
      -
      -module.exports = function () {
      -	var symbol;
      -	if (typeof Symbol !== 'function') return false;
      -	symbol = Symbol('test symbol');
      -	try { String(symbol); } catch (e) { return false; }
      -	if (typeof Symbol.iterator === 'symbol') return true;
      -
      -	// Return 'true' for polyfills
      -	if (typeof Symbol.isConcatSpreadable !== 'object') return false;
      -	if (typeof Symbol.isRegExp !== 'object') return false;
      -	if (typeof Symbol.iterator !== 'object') return false;
      -	if (typeof Symbol.toPrimitive !== 'object') return false;
      -	if (typeof Symbol.toStringTag !== 'object') return false;
      -	if (typeof Symbol.unscopables !== 'object') return false;
      -
      -	return true;
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/is-native-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/is-native-implemented.js
      deleted file mode 100644
      index a8cb8b8681ee69..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/is-native-implemented.js
      +++ /dev/null
      @@ -1,8 +0,0 @@
      -// Exports true if environment provides native `Symbol` implementation
      -
      -'use strict';
      -
      -module.exports = (function () {
      -	if (typeof Symbol !== 'function') return false;
      -	return (typeof Symbol.iterator === 'symbol');
      -}());
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/is-symbol.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/is-symbol.js
      deleted file mode 100644
      index dcf72c9aaa353e..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/is-symbol.js
      +++ /dev/null
      @@ -1,12 +0,0 @@
      -'use strict';
      -
      -var toString    = Object.prototype.toString
      -  , toStringTag = require('./').toStringTag
      -
      -  , id = '[object Symbol]'
      -  , Global = (typeof Symbol === 'undefined') ? null : Symbol;
      -
      -module.exports = function (x) {
      -	return (x && ((Global && (x instanceof Global)) ||
      -			(toString.call(x) === id) || (x[toStringTag] === 'Symbol'))) || false;
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/package.json b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/package.json
      deleted file mode 100644
      index a6ddc1a46c29b3..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/package.json
      +++ /dev/null
      @@ -1,59 +0,0 @@
      -{
      -  "name": "es6-symbol",
      -  "version": "0.1.1",
      -  "description": "ECMAScript6 Symbol polyfill",
      -  "author": {
      -    "name": "Mariusz Nowak",
      -    "email": "medyk@medikoo.com",
      -    "url": "http://www.medikoo.com/"
      -  },
      -  "keywords": [
      -    "symbol",
      -    "private",
      -    "property",
      -    "es6",
      -    "ecmascript",
      -    "harmony"
      -  ],
      -  "repository": {
      -    "type": "git",
      -    "url": "git://github.com/medikoo/es6-symbol.git"
      -  },
      -  "dependencies": {
      -    "d": "~0.1.1",
      -    "es5-ext": "~0.10.4"
      -  },
      -  "devDependencies": {
      -    "tad": "0.2.x"
      -  },
      -  "scripts": {
      -    "test": "node ./node_modules/tad/bin/tad"
      -  },
      -  "license": "MIT",
      -  "gitHead": "2ca76a05feafaa14c838337722562625fb5072b4",
      -  "bugs": {
      -    "url": "https://github.com/medikoo/es6-symbol/issues"
      -  },
      -  "homepage": "https://github.com/medikoo/es6-symbol",
      -  "_id": "es6-symbol@0.1.1",
      -  "_shasum": "9cf7fab2edaff1b1da8fe8e68bfe3f5aca6ca218",
      -  "_from": "es6-symbol@>=0.1.1 <0.2.0",
      -  "_npmVersion": "2.0.0",
      -  "_npmUser": {
      -    "name": "medikoo",
      -    "email": "medikoo+npm@medikoo.com"
      -  },
      -  "maintainers": [
      -    {
      -      "name": "medikoo",
      -      "email": "medikoo+npm@medikoo.com"
      -    }
      -  ],
      -  "dist": {
      -    "shasum": "9cf7fab2edaff1b1da8fe8e68bfe3f5aca6ca218",
      -    "tarball": "http://registry.npmjs.org/es6-symbol/-/es6-symbol-0.1.1.tgz"
      -  },
      -  "directories": {},
      -  "_resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-0.1.1.tgz",
      -  "readme": "ERROR: No README data found!"
      -}
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/polyfill.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/polyfill.js
      deleted file mode 100644
      index f7dfa258720d9f..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/polyfill.js
      +++ /dev/null
      @@ -1,53 +0,0 @@
      -'use strict';
      -
      -var d = require('d')
      -
      -  , create = Object.create, defineProperties = Object.defineProperties
      -  , generateName, Symbol;
      -
      -generateName = (function () {
      -	var created = create(null);
      -	return function (desc) {
      -		var postfix = 0;
      -		while (created[desc + (postfix || '')]) ++postfix;
      -		desc += (postfix || '');
      -		created[desc] = true;
      -		return '@@' + desc;
      -	};
      -}());
      -
      -module.exports = Symbol = function (description) {
      -	var symbol;
      -	if (this instanceof Symbol) {
      -		throw new TypeError('TypeError: Symbol is not a constructor');
      -	}
      -	symbol = create(Symbol.prototype);
      -	description = (description === undefined ? '' : String(description));
      -	return defineProperties(symbol, {
      -		__description__: d('', description),
      -		__name__: d('', generateName(description))
      -	});
      -};
      -
      -Object.defineProperties(Symbol, {
      -	create: d('', Symbol('create')),
      -	hasInstance: d('', Symbol('hasInstance')),
      -	isConcatSpreadable: d('', Symbol('isConcatSpreadable')),
      -	isRegExp: d('', Symbol('isRegExp')),
      -	iterator: d('', Symbol('iterator')),
      -	toPrimitive: d('', Symbol('toPrimitive')),
      -	toStringTag: d('', Symbol('toStringTag')),
      -	unscopables: d('', Symbol('unscopables'))
      -});
      -
      -defineProperties(Symbol.prototype, {
      -	properToString: d(function () {
      -		return 'Symbol (' + this.__description__ + ')';
      -	}),
      -	toString: d('', function () { return this.__name__; })
      -});
      -Object.defineProperty(Symbol.prototype, Symbol.toPrimitive, d('',
      -	function (hint) {
      -		throw new TypeError("Conversion of symbol objects is not allowed");
      -	}));
      -Object.defineProperty(Symbol.prototype, Symbol.toStringTag, d('c', 'Symbol'));
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/implement.js
      deleted file mode 100644
      index eb35c3018835c7..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/implement.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof Symbol, 'function'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/index.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/index.js
      deleted file mode 100644
      index 62b3296df6fc5e..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/index.js
      +++ /dev/null
      @@ -1,12 +0,0 @@
      -'use strict';
      -
      -var d = require('d')
      -
      -  , defineProperty = Object.defineProperty;
      -
      -module.exports = function (T, a) {
      -	var symbol = T('test'), x = {};
      -	defineProperty(x, symbol, d('foo'));
      -	a(x.test, undefined, "Name");
      -	a(x[symbol], 'foo', "Get");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/is-implemented.js
      deleted file mode 100644
      index bb0d64536ebbae..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/is-implemented.js
      +++ /dev/null
      @@ -1,14 +0,0 @@
      -'use strict';
      -
      -var global   = require('es5-ext/global')
      -  , polyfill = require('../polyfill');
      -
      -module.exports = function (t, a) {
      -	var cache;
      -	a(typeof t(), 'boolean');
      -	cache = global.Symbol;
      -	global.Symbol = polyfill;
      -	a(t(), true);
      -	if (cache === undefined) delete global.Symbol;
      -	else global.Symbol = cache;
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/is-native-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/is-native-implemented.js
      deleted file mode 100644
      index df8ba0323f0cad..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/is-native-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t, 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/is-symbol.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/is-symbol.js
      deleted file mode 100644
      index ac24b9abbff4e6..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/is-symbol.js
      +++ /dev/null
      @@ -1,16 +0,0 @@
      -'use strict';
      -
      -var SymbolPoly = require('../polyfill');
      -
      -module.exports = function (t, a) {
      -	a(t(undefined), false, "Undefined");
      -	a(t(null), false, "Null");
      -	a(t(true), false, "Primitive");
      -	a(t('raz'), false, "String");
      -	a(t({}), false, "Object");
      -	a(t([]), false, "Array");
      -	if (typeof Symbol !== 'undefined') {
      -		a(t(Symbol()), true, "Native");
      -	}
      -	a(t(SymbolPoly()), true, "Polyfill");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/polyfill.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/polyfill.js
      deleted file mode 100644
      index cac9cd51935301..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/polyfill.js
      +++ /dev/null
      @@ -1,17 +0,0 @@
      -'use strict';
      -
      -var d        = require('d')
      -  , isSymbol = require('../is-symbol')
      -
      -  , defineProperty = Object.defineProperty;
      -
      -module.exports = function (T, a) {
      -	var symbol = T('test'), x = {};
      -	defineProperty(x, symbol, d('foo'));
      -	a(x.test, undefined, "Name");
      -	a(x[symbol], 'foo', "Get");
      -
      -	a(isSymbol(symbol), true, "Symbol");
      -	a(isSymbol(T.iterator), true, "iterator");
      -	a(isSymbol(T.toStringTag), true, "toStringTag");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/valid-iterable.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/valid-iterable.js
      deleted file mode 100644
      index d277bc97f41125..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/valid-iterable.js
      +++ /dev/null
      @@ -1,14 +0,0 @@
      -'use strict';
      -
      -var Iterator = require('../');
      -
      -module.exports = function (t, a) {
      -	var obj;
      -	a.throws(function () { t(); }, TypeError, "Undefined");
      -	a.throws(function () { t({}); }, TypeError, "Plain object");
      -	a.throws(function () { t({ length: 0 }); }, TypeError, "Array-like");
      -	obj = { '@@iterator': function () { return new Iterator([]); } };
      -	a(t(obj), obj, "Iterator");
      -	obj = [];
      -	a(t(obj), obj, 'Array');
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/valid-symbol.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/valid-symbol.js
      deleted file mode 100644
      index 2c8f84c8239b6e..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/valid-symbol.js
      +++ /dev/null
      @@ -1,19 +0,0 @@
      -'use strict';
      -
      -var SymbolPoly = require('../polyfill');
      -
      -module.exports = function (t, a) {
      -	var symbol;
      -	a.throws(function () { t(undefined); }, TypeError, "Undefined");
      -	a.throws(function () { t(null); }, TypeError, "Null");
      -	a.throws(function () { t(true); }, TypeError, "Primitive");
      -	a.throws(function () { t('raz'); }, TypeError, "String");
      -	a.throws(function () { t({}); }, TypeError, "Object");
      -	a.throws(function () { t([]); }, TypeError, "Array");
      -	if (typeof Symbol !== 'undefined') {
      -		symbol = Symbol();
      -		a(t(symbol), symbol, "Native");
      -	}
      -	symbol = SymbolPoly();
      -	a(t(symbol), symbol, "Polyfill");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/valid-symbol.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/valid-symbol.js
      deleted file mode 100644
      index 42750043d4271c..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/valid-symbol.js
      +++ /dev/null
      @@ -1,8 +0,0 @@
      -'use strict';
      -
      -var isSymbol = require('./is-symbol');
      -
      -module.exports = function (value) {
      -	if (!isSymbol(value)) throw new TypeError(value + " is not a symbol");
      -	return value;
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/.npmignore b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/.npmignore
      deleted file mode 100644
      index 68ebfddd24fb33..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/.npmignore
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -.DS_Store
      -/.lintcache
      -/node_modules
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/.travis.yml b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/.travis.yml
      deleted file mode 100644
      index a6ec240dfdf156..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/.travis.yml
      +++ /dev/null
      @@ -1,14 +0,0 @@
      -language: node_js
      -node_js:
      -  - 0.8
      -  - 0.10
      -  - 0.11
      -
      -before_install:
      -  - mkdir node_modules; ln -s ../ node_modules/event-emitter
      -
      -notifications:
      -  email:
      -    - medikoo+event-emitter@medikoo.com
      -
      -script: "npm test && npm run lint"
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/CHANGES b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/CHANGES
      deleted file mode 100644
      index dbc1b1777e9194..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/CHANGES
      +++ /dev/null
      @@ -1,66 +0,0 @@
      -v0.3.3  --  2015.01.30
      -* Fix reference to module in benchmarks
      -
      -v0.3.2  --  2015.01.20
      -* Improve documentation
      -* Configure lint scripts
      -* Fix spelling of LICENSE
      -
      -v0.3.1  --  2014.04.25
      -* Fix redefinition of emit method in `pipe`
      -* Allow custom emit method name in `pipe`
      -
      -v0.3.0  --  2014.04.24
      -* Move out from lib folder
      -* Do not expose all utilities on main module
      -* Support objects which do not inherit from Object.prototype
      -* Improve arguments validation
      -* Improve internals
      -* Remove Makefile
      -* Improve documentation
      -
      -v0.2.2  --  2013.06.05
      -* `unify` functionality
      -
      -v0.2.1  --  2012.09.21
      -* hasListeners module
      -* Simplified internal id (improves performance a little), now it starts with
      -  underscore (hint it's private). Abstracted it to external module to have it
      -  one place
      -* Documentation cleanup
      -
      -v0.2.0  --  2012.09.19
      -* Trashed poor implementation of v0.1 and came up with something solid
      -
      -Changes:
      -* Improved performance
      -* Fixed bugs event-emitter is now cross-prototype safe and not affected by
      -  unexpected methods attached to Object.prototype
      -* Removed support for optional "emitter" argument in `emit` method, it was
      -  cumbersome to use, and should be solved just with event objects
      -
      -v0.1.5  --  2012.08.06
      -* (maintanance) Do not use descriptors for internal objects, it exposes V8 bugs
      -  (only Node v0.6 branch)
      -
      -v0.1.4  --  2012.06.13
      -* Fix detachment of listeners added with 'once'
      -
      -v0.1.3  --  2012.05.28
      -* Updated es5-ext to latest version (v0.8)
      -* Cleared package.json so it's in npm friendly format
      -
      -v0.1.2  --  2012.01.22
      -* Support for emitter argument in emit function, this allows some listeners not
      -  to be notified about event
      -* allOff - removes all listeners from object
      -* All methods returns self object
      -* Internal fixes
      -* Travis CI integration
      -
      -v0.1.1  --  2011.08.08
      -* Added TAD test suite to devDependencies, configured test commands.
      -  Tests can be run with 'make test' or 'npm test'
      -
      -v0.1.0  --  2011.08.08
      -Initial version
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/README.md b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/README.md
      deleted file mode 100644
      index 17f4524fd75403..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/README.md
      +++ /dev/null
      @@ -1,95 +0,0 @@
      -# event-emitter
      -## Environment agnostic event emitter
      -
      -### Installation
      -
      -	$ npm install event-emitter
      -	
      -To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)
      -
      -### Usage
      -
      -```javascript
      -var ee = require('event-emitter');
      -
      -var emitter = ee({}), listener;
      -
      -emitter.on('test', listener = function (args) {
      -  // …emitter logic
      -});
      -
      -emitter.once('test', function (args) {
      -  // …invoked only once(!)
      -});
      -
      -emitter.emit('test', arg1, arg2/*…args*/); // Two above listeners invoked
      -emitter.emit('test', arg1, arg2/*…args*/); // Only first listener invoked
      -
      -emitter.off('test', listener);              // Removed first listener
      -emitter.emit('test', arg1, arg2/*…args*/); // No listeners invoked
      -```
      -### Additional utilities
      -
      -#### allOff(obj) _(event-emitter/all-off)_
      -
      -Removes all listeners from given event emitter object
      -
      -#### hasListeners(obj[, name]) _(event-emitter/has-listeners)_
      -
      -Whether object has some listeners attached to the object.
      -When `name` is provided, it checks listeners for specific event name
      -
      -```javascript
      -var emitter = ee();
      -var hasListeners = require('event-emitter/has-listeners');
      -var listener = function () {};
      -
      -hasListeners(emitter); // false
      -
      -emitter.on('foo', listener);
      -hasListeners(emitter); // true
      -hasListeners(emitter, 'foo'); // true
      -hasListeners(emitter, 'bar'); // false
      -
      -emitter.off('foo', listener);
      -hasListeners(emitter, 'foo'); // false
      -```
      -
      -#### pipe(source, target[, emitMethodName]) _(event-emitter/pipe)_
      -
      -Pipes all events from _source_ emitter onto _target_ emitter (all events from _source_ emitter will be emitted also on _target_ emitter, but not other way).  
      -Returns _pipe_ object which exposes `pipe.close` function. Invoke it to close configured _pipe_.  
      -It works internally by redefinition of `emit` method, if in your interface this method is referenced differently, provide its name (or symbol) with third argument.
      -
      -#### unify(emitter1, emitter2) _(event-emitter/unify)_
      -
      -Unifies event handling for two objects. Events emitted on _emitter1_ would be also emitter on _emitter2_, and other way back.  
      -Non reversible.
      -
      -```javascript
      -var eeUnify = require('event-emitter/unify');
      -
      -var emitter1 = ee(), listener1, listener3;
      -var emitter2 = ee(), listener2, listener4;
      -
      -emitter1.on('test', listener1 = function () { });
      -emitter2.on('test', listener2 = function () { });
      -
      -emitter1.emit('test'); // Invoked listener1
      -emitter2.emit('test'); // Invoked listener2
      -
      -var unify = eeUnify(emitter1, emitter2);
      -
      -emitter1.emit('test'); // Invoked listener1 and listener2
      -emitter2.emit('test'); // Invoked listener1 and listener2
      -
      -emitter1.on('test', listener3 = function () { });
      -emitter2.on('test', listener4 = function () { });
      -
      -emitter1.emit('test'); // Invoked listener1, listener2, listener3 and listener4
      -emitter2.emit('test'); // Invoked listener1, listener2, listener3 and listener4
      -```
      -
      -### Tests [![Build Status](https://travis-ci.org/medikoo/event-emitter.png)](https://travis-ci.org/medikoo/event-emitter)
      -
      -	$ npm test
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/benchmark/many-on.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/benchmark/many-on.js
      deleted file mode 100644
      index e09bfde8489386..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/benchmark/many-on.js
      +++ /dev/null
      @@ -1,83 +0,0 @@
      -'use strict';
      -
      -// Benchmark comparing performance of event emit for many listeners
      -// To run it, do following in memoizee package path:
      -//
      -// $ npm install eventemitter2 signals
      -// $ node benchmark/many-on.js
      -
      -var forEach    = require('es5-ext/object/for-each')
      -  , pad        = require('es5-ext/string/#/pad')
      -
      -  , now = Date.now
      -
      -  , time, count = 1000000, i, data = {}
      -  , ee, native, ee2, signals, a = {}, b = {};
      -
      -ee = (function () {
      -	var ee = require('../')();
      -	ee.on('test', function () { return arguments; });
      -	ee.on('test', function () { return arguments; });
      -	return ee.on('test', function () { return arguments; });
      -}());
      -
      -native = (function () {
      -	var ee = require('events');
      -	ee = new ee.EventEmitter();
      -	ee.on('test', function () { return arguments; });
      -	ee.on('test', function () { return arguments; });
      -	return ee.on('test', function () { return arguments; });
      -}());
      -
      -ee2 = (function () {
      -	var ee = require('eventemitter2');
      -	ee = new ee.EventEmitter2();
      -	ee.on('test', function () { return arguments; });
      -	ee.on('test', function () { return arguments; });
      -	return ee.on('test', function () { return arguments; });
      -}());
      -
      -signals = (function () {
      -	var Signal = require('signals')
      -	  , ee = { test: new Signal() };
      -	ee.test.add(function () { return arguments; });
      -	ee.test.add(function () { return arguments; });
      -	ee.test.add(function () { return arguments; });
      -	return ee;
      -}());
      -
      -console.log("Emit for 3 listeners", "x" + count + ":\n");
      -
      -i = count;
      -time = now();
      -while (i--) {
      -	ee.emit('test', a, b);
      -}
      -data["event-emitter (this implementation)"] = now() - time;
      -
      -i = count;
      -time = now();
      -while (i--) {
      -	native.emit('test', a, b);
      -}
      -data["EventEmitter (Node.js native)"] = now() - time;
      -
      -i = count;
      -time = now();
      -while (i--) {
      -	ee2.emit('test', a, b);
      -}
      -data.EventEmitter2 = now() - time;
      -
      -i = count;
      -time = now();
      -while (i--) {
      -	signals.test.dispatch(a, b);
      -}
      -data.Signals = now() - time;
      -
      -forEach(data, function (value, name, obj, index) {
      -	console.log(index + 1 + ":",  pad.call(value, " ", 5), name);
      -}, null, function (a, b) {
      -	return this[a] - this[b];
      -});
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/benchmark/single-on.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/benchmark/single-on.js
      deleted file mode 100644
      index 99decbdae72566..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/benchmark/single-on.js
      +++ /dev/null
      @@ -1,73 +0,0 @@
      -'use strict';
      -
      -// Benchmark comparing performance of event emit for single listener
      -// To run it, do following in memoizee package path:
      -//
      -// $ npm install eventemitter2 signals
      -// $ node benchmark/single-on.js
      -
      -var forEach    = require('es5-ext/object/for-each')
      -  , pad        = require('es5-ext/string/#/pad')
      -
      -  , now = Date.now
      -
      -  , time, count = 1000000, i, data = {}
      -  , ee, native, ee2, signals, a = {}, b = {};
      -
      -ee = (function () {
      -	var ee = require('../');
      -	return ee().on('test', function () { return arguments; });
      -}());
      -
      -native = (function () {
      -	var ee = require('events');
      -	return (new ee.EventEmitter()).on('test', function () { return arguments; });
      -}());
      -
      -ee2 = (function () {
      -	var ee = require('eventemitter2');
      -	return (new ee.EventEmitter2()).on('test', function () { return arguments; });
      -}());
      -
      -signals = (function () {
      -	var Signal = require('signals')
      -	  , ee = { test: new Signal() };
      -	ee.test.add(function () { return arguments; });
      -	return ee;
      -}());
      -
      -console.log("Emit for single listener", "x" + count + ":\n");
      -
      -i = count;
      -time = now();
      -while (i--) {
      -	ee.emit('test', a, b);
      -}
      -data["event-emitter (this implementation)"] = now() - time;
      -
      -i = count;
      -time = now();
      -while (i--) {
      -	native.emit('test', a, b);
      -}
      -data["EventEmitter (Node.js native)"] = now() - time;
      -
      -i = count;
      -time = now();
      -while (i--) {
      -	ee2.emit('test', a, b);
      -}
      -data.EventEmitter2 = now() - time;
      -
      -i = count;
      -time = now();
      -while (i--) {
      -	signals.test.dispatch(a, b);
      -}
      -data.Signals = now() - time;
      -
      -forEach(data, function (value, name, obj, index) {
      -	console.log(index + 1 + ":",  pad.call(value, " ", 5), name);
      -}, null, function (a, b) {
      -	return this[a] - this[b];
      -});
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/package.json b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/package.json
      deleted file mode 100644
      index 17a904eabba836..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/package.json
      +++ /dev/null
      @@ -1,64 +0,0 @@
      -{
      -  "name": "event-emitter",
      -  "version": "0.3.3",
      -  "description": "Environment agnostic event emitter",
      -  "author": {
      -    "name": "Mariusz Nowak",
      -    "email": "medyk@medikoo.com",
      -    "url": "http://www.medikoo.com/"
      -  },
      -  "keywords": [
      -    "event",
      -    "events",
      -    "trigger",
      -    "observer",
      -    "listener",
      -    "emitter",
      -    "pubsub"
      -  ],
      -  "repository": {
      -    "type": "git",
      -    "url": "git://github.com/medikoo/event-emitter.git"
      -  },
      -  "dependencies": {
      -    "es5-ext": "~0.10.5",
      -    "d": "~0.1.1"
      -  },
      -  "devDependencies": {
      -    "tad": "~0.2.1",
      -    "xlint": "~0.2.2",
      -    "xlint-jslint-medikoo": "~0.1.2"
      -  },
      -  "scripts": {
      -    "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream",
      -    "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch",
      -    "test": "node ./node_modules/tad/bin/tad"
      -  },
      -  "license": "MIT",
      -  "gitHead": "13f184ab039e3559164691d3a6a3d6b8c84aed3e",
      -  "bugs": {
      -    "url": "https://github.com/medikoo/event-emitter/issues"
      -  },
      -  "homepage": "https://github.com/medikoo/event-emitter",
      -  "_id": "event-emitter@0.3.3",
      -  "_shasum": "df8e806541c68ab8ff20a79a1841b91abaa1bee4",
      -  "_from": "event-emitter@>=0.3.1 <0.4.0",
      -  "_npmVersion": "1.4.28",
      -  "_npmUser": {
      -    "name": "medikoo",
      -    "email": "medikoo+npm@medikoo.com"
      -  },
      -  "maintainers": [
      -    {
      -      "name": "medikoo",
      -      "email": "medikoo+npm@medikoo.com"
      -    }
      -  ],
      -  "dist": {
      -    "shasum": "df8e806541c68ab8ff20a79a1841b91abaa1bee4",
      -    "tarball": "http://registry.npmjs.org/event-emitter/-/event-emitter-0.3.3.tgz"
      -  },
      -  "directories": {},
      -  "_resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.3.tgz",
      -  "readme": "ERROR: No README data found!"
      -}
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/test/all-off.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/test/all-off.js
      deleted file mode 100644
      index 8aa872e9c9478d..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/test/all-off.js
      +++ /dev/null
      @@ -1,48 +0,0 @@
      -'use strict';
      -
      -var ee = require('../');
      -
      -module.exports = function (t, a) {
      -	var x, count, count2;
      -
      -	x = ee();
      -	count = 0;
      -	count2 = 0;
      -	x.on('foo', function () {
      -		++count;
      -	});
      -	x.on('foo', function () {
      -		++count;
      -	});
      -	x.on('bar', function () {
      -		++count2;
      -	});
      -	x.on('bar', function () {
      -		++count2;
      -	});
      -	t(x, 'foo');
      -	x.emit('foo');
      -	x.emit('bar');
      -	a(count, 0, "All off: type");
      -	a(count2, 2, "All off: ohter type");
      -
      -	count = 0;
      -	count2 = 0;
      -	x.on('foo', function () {
      -		++count;
      -	});
      -	x.on('foo', function () {
      -		++count;
      -	});
      -	x.on('bar', function () {
      -		++count2;
      -	});
      -	x.on('bar', function () {
      -		++count2;
      -	});
      -	t(x);
      -	x.emit('foo');
      -	x.emit('bar');
      -	a(count, 0, "All off: type");
      -	a(count2, 0, "All off: other type");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/test/has-listeners.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/test/has-listeners.js
      deleted file mode 100644
      index 875b048a4193cb..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/test/has-listeners.js
      +++ /dev/null
      @@ -1,42 +0,0 @@
      -'use strict';
      -
      -var ee = require('../');
      -
      -module.exports = function (t) {
      -	var x, y;
      -	return {
      -		Any: function (a) {
      -			a(t(true), false, "Primitive");
      -			a(t({ events: [] }), false, "Other object");
      -			a(t(x = ee()), false, "Emitter: empty");
      -
      -			x.on('test', y = function () {});
      -			a(t(x), true, "Emitter: full");
      -			x.off('test', y);
      -			a(t(x), false, "Emitter: empty but touched");
      -			x.once('test', y = function () {});
      -			a(t(x), true, "Emitter: full: Once");
      -			x.off('test', y);
      -			a(t(x), false, "Emitter: empty but touched by once");
      -		},
      -		Specific: function (a) {
      -			a(t(true, 'test'), false, "Primitive");
      -			a(t({ events: [] }, 'test'), false, "Other object");
      -			a(t(x = ee(), 'test'), false, "Emitter: empty");
      -
      -			x.on('test', y = function () {});
      -			a(t(x, 'test'), true, "Emitter: full");
      -			a(t(x, 'foo'), false, "Emitter: full, other event");
      -			x.off('test', y);
      -			a(t(x, 'test'), false, "Emitter: empty but touched");
      -			a(t(x, 'foo'), false, "Emitter: empty but touched, other event");
      -
      -			x.once('test', y = function () {});
      -			a(t(x, 'test'), true, "Emitter: full: Once");
      -			a(t(x, 'foo'), false, "Emitter: full: Once,  other event");
      -			x.off('test', y);
      -			a(t(x, 'test'), false, "Emitter: empty but touched by once");
      -			a(t(x, 'foo'), false, "Emitter: empty but touched by once, other event");
      -		}
      -	};
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/test/index.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/test/index.js
      deleted file mode 100644
      index c7c3f24c476862..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/test/index.js
      +++ /dev/null
      @@ -1,107 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var x = t(), y, count, count2, count3, count4, test, listener1, listener2;
      -
      -	x.emit('none');
      -
      -	test = "Once: ";
      -	count = 0;
      -	x.once('foo', function (a1, a2, a3) {
      -		a(this, x, test + "Context");
      -		a.deep([a1, a2, a3], ['foo', x, 15], test + "Arguments");
      -		++count;
      -	});
      -
      -	x.emit('foobar');
      -	a(count, 0, test + "Not invoked on other event");
      -	x.emit('foo', 'foo', x, 15);
      -	a(count, 1, test + "Emitted");
      -	x.emit('foo');
      -	a(count, 1, test + "Emitted once");
      -
      -	test = "On & Once: ";
      -	count = 0;
      -	x.on('foo', listener1 = function (a1, a2, a3) {
      -		a(this, x, test + "Context");
      -		a.deep([a1, a2, a3], ['foo', x, 15], test + "Arguments");
      -		++count;
      -	});
      -	count2 = 0;
      -	x.once('foo', listener2 = function (a1, a2, a3) {
      -		a(this, x, test + "Context");
      -		a.deep([a1, a2, a3], ['foo', x, 15], test + "Arguments");
      -		++count2;
      -	});
      -
      -	x.emit('foobar');
      -	a(count, 0, test + "Not invoked on other event");
      -	x.emit('foo', 'foo', x, 15);
      -	a(count, 1, test + "Emitted");
      -	x.emit('foo', 'foo', x, 15);
      -	a(count, 2, test + "Emitted twice");
      -	a(count2, 1, test + "Emitted once");
      -	x.off('foo', listener1);
      -	x.emit('foo');
      -	a(count, 2, test + "Not emitter after off");
      -
      -	count = 0;
      -	x.once('foo', listener1 = function () { ++count; });
      -
      -	x.off('foo', listener1);
      -	x.emit('foo');
      -	a(count, 0, "Once Off: Not emitted");
      -
      -	count = 0;
      -	x.on('foo', listener2 = function () {});
      -	x.once('foo', listener1 = function () { ++count; });
      -
      -	x.off('foo', listener1);
      -	x.emit('foo');
      -	a(count, 0, "Once Off (multi): Not emitted");
      -	x.off('foo', listener2);
      -
      -	test = "Prototype Share: ";
      -
      -	y = Object.create(x);
      -
      -	count = 0;
      -	count2 = 0;
      -	count3 = 0;
      -	count4 = 0;
      -	x.on('foo', function () {
      -		++count;
      -	});
      -	y.on('foo', function () {
      -		++count2;
      -	});
      -	x.once('foo', function () {
      -		++count3;
      -	});
      -	y.once('foo', function () {
      -		++count4;
      -	});
      -	x.emit('foo');
      -	a(count, 1, test + "x on count");
      -	a(count2, 0, test + "y on count");
      -	a(count3, 1, test + "x once count");
      -	a(count4, 0, test + "y once count");
      -
      -	y.emit('foo');
      -	a(count, 1, test + "x on count");
      -	a(count2, 1, test + "y on count");
      -	a(count3, 1, test + "x once count");
      -	a(count4, 1, test + "y once count");
      -
      -	x.emit('foo');
      -	a(count, 2, test + "x on count");
      -	a(count2, 1, test + "y on count");
      -	a(count3, 1, test + "x once count");
      -	a(count4, 1, test + "y once count");
      -
      -	y.emit('foo');
      -	a(count, 2, test + "x on count");
      -	a(count2, 2, test + "y on count");
      -	a(count3, 1, test + "x once count");
      -	a(count4, 1, test + "y once count");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/test/pipe.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/test/pipe.js
      deleted file mode 100644
      index 9d15d6dae308dc..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/test/pipe.js
      +++ /dev/null
      @@ -1,53 +0,0 @@
      -'use strict';
      -
      -var ee = require('../');
      -
      -module.exports = function (t, a) {
      -	var x = {}, y = {}, z = {}, count, count2, count3, pipe;
      -
      -	ee(x);
      -	x = Object.create(x);
      -	ee(y);
      -	ee(z);
      -
      -	count = 0;
      -	count2 = 0;
      -	count3 = 0;
      -	x.on('foo', function () {
      -		++count;
      -	});
      -	y.on('foo', function () {
      -		++count2;
      -	});
      -	z.on('foo', function () {
      -		++count3;
      -	});
      -
      -	x.emit('foo');
      -	a(count, 1, "Pre pipe, x");
      -	a(count2, 0, "Pre pipe, y");
      -	a(count3, 0, "Pre pipe, z");
      -
      -	pipe = t(x, y);
      -	x.emit('foo');
      -	a(count, 2, "Post pipe, x");
      -	a(count2, 1, "Post pipe, y");
      -	a(count3, 0, "Post pipe, z");
      -
      -	y.emit('foo');
      -	a(count, 2, "Post pipe, on y, x");
      -	a(count2, 2, "Post pipe, on y, y");
      -	a(count3, 0, "Post pipe, on y, z");
      -
      -	t(x, z);
      -	x.emit('foo');
      -	a(count, 3, "Post pipe z, x");
      -	a(count2, 3, "Post pipe z, y");
      -	a(count3, 1, "Post pipe z, z");
      -
      -	pipe.close();
      -	x.emit('foo');
      -	a(count, 4, "Close pipe y, x");
      -	a(count2, 3, "Close pipe y, y");
      -	a(count3, 2, "Close pipe y, z");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/test/unify.js b/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/test/unify.js
      deleted file mode 100644
      index 69295e0657ad50..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/test/unify.js
      +++ /dev/null
      @@ -1,123 +0,0 @@
      -'use strict';
      -
      -var ee = require('../');
      -
      -module.exports = function (t) {
      -
      -	return {
      -		"": function (a) {
      -			var x = {}, y = {}, z = {}, count, count2, count3;
      -
      -			ee(x);
      -			ee(y);
      -			ee(z);
      -
      -			count = 0;
      -			count2 = 0;
      -			count3 = 0;
      -			x.on('foo', function () { ++count; });
      -			y.on('foo', function () { ++count2; });
      -			z.on('foo', function () { ++count3; });
      -
      -			x.emit('foo');
      -			a(count, 1, "Pre unify, x");
      -			a(count2, 0, "Pre unify, y");
      -			a(count3, 0, "Pre unify, z");
      -
      -			t(x, y);
      -			a(x.__ee__, y.__ee__, "Post unify y");
      -			x.emit('foo');
      -			a(count, 2, "Post unify, x");
      -			a(count2, 1, "Post unify, y");
      -			a(count3, 0, "Post unify, z");
      -
      -			y.emit('foo');
      -			a(count, 3, "Post unify, on y, x");
      -			a(count2, 2, "Post unify, on y, y");
      -			a(count3, 0, "Post unify, on y, z");
      -
      -			t(x, z);
      -			a(x.__ee__, x.__ee__, "Post unify z");
      -			x.emit('foo');
      -			a(count, 4, "Post unify z, x");
      -			a(count2, 3, "Post unify z, y");
      -			a(count3, 1, "Post unify z, z");
      -		},
      -		"On empty": function (a) {
      -			var x = {}, y = {}, z = {}, count, count2, count3;
      -
      -			ee(x);
      -			ee(y);
      -			ee(z);
      -
      -			count = 0;
      -			count2 = 0;
      -			count3 = 0;
      -			y.on('foo', function () { ++count2; });
      -			x.emit('foo');
      -			a(count, 0, "Pre unify, x");
      -			a(count2, 0, "Pre unify, y");
      -			a(count3, 0, "Pre unify, z");
      -
      -			t(x, y);
      -			a(x.__ee__, y.__ee__, "Post unify y");
      -			x.on('foo', function () { ++count; });
      -			x.emit('foo');
      -			a(count, 1, "Post unify, x");
      -			a(count2, 1, "Post unify, y");
      -			a(count3, 0, "Post unify, z");
      -
      -			y.emit('foo');
      -			a(count, 2, "Post unify, on y, x");
      -			a(count2, 2, "Post unify, on y, y");
      -			a(count3, 0, "Post unify, on y, z");
      -
      -			t(x, z);
      -			a(x.__ee__, z.__ee__, "Post unify z");
      -			z.on('foo', function () { ++count3; });
      -			x.emit('foo');
      -			a(count, 3, "Post unify z, x");
      -			a(count2, 3, "Post unify z, y");
      -			a(count3, 1, "Post unify z, z");
      -		},
      -		Many: function (a) {
      -			var x = {}, y = {}, z = {}, count, count2, count3;
      -
      -			ee(x);
      -			ee(y);
      -			ee(z);
      -
      -			count = 0;
      -			count2 = 0;
      -			count3 = 0;
      -			x.on('foo', function () { ++count; });
      -			y.on('foo', function () { ++count2; });
      -			y.on('foo', function () { ++count2; });
      -			z.on('foo', function () { ++count3; });
      -
      -			x.emit('foo');
      -			a(count, 1, "Pre unify, x");
      -			a(count2, 0, "Pre unify, y");
      -			a(count3, 0, "Pre unify, z");
      -
      -			t(x, y);
      -			a(x.__ee__, y.__ee__, "Post unify y");
      -			x.emit('foo');
      -			a(count, 2, "Post unify, x");
      -			a(count2, 2, "Post unify, y");
      -			a(count3, 0, "Post unify, z");
      -
      -			y.emit('foo');
      -			a(count, 3, "Post unify, on y, x");
      -			a(count2, 4, "Post unify, on y, y");
      -			a(count3, 0, "Post unify, on y, z");
      -
      -			t(x, z);
      -			a(x.__ee__, x.__ee__, "Post unify z");
      -			x.emit('foo');
      -			a(count, 4, "Post unify z, x");
      -			a(count2, 6, "Post unify z, y");
      -			a(count3, 1, "Post unify z, z");
      -		}
      -	};
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/package.json b/tools/eslint/node_modules/escope/node_modules/es6-map/package.json
      deleted file mode 100644
      index 51b50e23531fdb..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/package.json
      +++ /dev/null
      @@ -1,70 +0,0 @@
      -{
      -  "name": "es6-map",
      -  "version": "0.1.1",
      -  "description": "ECMAScript6 Map polyfill",
      -  "author": {
      -    "name": "Mariusz Nowak",
      -    "email": "medyk@medikoo.com",
      -    "url": "http://www.medikoo.com/"
      -  },
      -  "keywords": [
      -    "collection",
      -    "es6",
      -    "shim",
      -    "harmony",
      -    "list",
      -    "hash",
      -    "map",
      -    "polyfill",
      -    "ecmascript"
      -  ],
      -  "repository": {
      -    "type": "git",
      -    "url": "git://github.com/medikoo/es6-map.git"
      -  },
      -  "dependencies": {
      -    "d": "~0.1.1",
      -    "es5-ext": "~0.10.4",
      -    "es6-iterator": "~0.1.1",
      -    "es6-set": "~0.1.1",
      -    "es6-symbol": "~0.1.1",
      -    "event-emitter": "~0.3.1"
      -  },
      -  "devDependencies": {
      -    "tad": "0.2.x",
      -    "xlint": "~0.2.1",
      -    "xlint-jslint-medikoo": "~0.1.2"
      -  },
      -  "scripts": {
      -    "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream",
      -    "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch",
      -    "test": "node ./node_modules/tad/bin/tad"
      -  },
      -  "license": "MIT",
      -  "gitHead": "16b0bce8defe9742a40b9cac1eed194ee4e2d820",
      -  "bugs": {
      -    "url": "https://github.com/medikoo/es6-map/issues"
      -  },
      -  "homepage": "https://github.com/medikoo/es6-map",
      -  "_id": "es6-map@0.1.1",
      -  "_shasum": "b879239ed7819e0b08c40ba6e19fa047ca7c8d1d",
      -  "_from": "es6-map@>=0.1.1 <0.2.0",
      -  "_npmVersion": "2.0.0",
      -  "_npmUser": {
      -    "name": "medikoo",
      -    "email": "medikoo+npm@medikoo.com"
      -  },
      -  "maintainers": [
      -    {
      -      "name": "medikoo",
      -      "email": "medikoo+npm@medikoo.com"
      -    }
      -  ],
      -  "dist": {
      -    "shasum": "b879239ed7819e0b08c40ba6e19fa047ca7c8d1d",
      -    "tarball": "http://registry.npmjs.org/es6-map/-/es6-map-0.1.1.tgz"
      -  },
      -  "directories": {},
      -  "_resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.1.tgz",
      -  "readme": "ERROR: No README data found!"
      -}
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/polyfill.js b/tools/eslint/node_modules/escope/node_modules/es6-map/polyfill.js
      deleted file mode 100644
      index fc44527f54d869..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/polyfill.js
      +++ /dev/null
      @@ -1,100 +0,0 @@
      -'use strict';
      -
      -var clear          = require('es5-ext/array/#/clear')
      -  , eIndexOf       = require('es5-ext/array/#/e-index-of')
      -  , setPrototypeOf = require('es5-ext/object/set-prototype-of')
      -  , callable       = require('es5-ext/object/valid-callable')
      -  , validValue     = require('es5-ext/object/valid-value')
      -  , d              = require('d')
      -  , ee             = require('event-emitter')
      -  , Symbol         = require('es6-symbol')
      -  , iterator       = require('es6-iterator/valid-iterable')
      -  , forOf          = require('es6-iterator/for-of')
      -  , Iterator       = require('./lib/iterator')
      -  , isNative       = require('./is-native-implemented')
      -
      -  , call = Function.prototype.call, defineProperties = Object.defineProperties
      -  , MapPoly;
      -
      -module.exports = MapPoly = function (/*iterable*/) {
      -	var iterable = arguments[0], keys, values;
      -	if (!(this instanceof MapPoly)) return new MapPoly(iterable);
      -	if (this.__mapKeysData__ !== undefined) {
      -		throw new TypeError(this + " cannot be reinitialized");
      -	}
      -	if (iterable != null) iterator(iterable);
      -	defineProperties(this, {
      -		__mapKeysData__: d('c', keys = []),
      -		__mapValuesData__: d('c', values = [])
      -	});
      -	if (!iterable) return;
      -	forOf(iterable, function (value) {
      -		var key = validValue(value)[0];
      -		value = value[1];
      -		if (eIndexOf.call(keys, key) !== -1) return;
      -		keys.push(key);
      -		values.push(value);
      -	}, this);
      -};
      -
      -if (isNative) {
      -	if (setPrototypeOf) setPrototypeOf(MapPoly, Map);
      -	MapPoly.prototype = Object.create(Map.prototype, {
      -		constructor: d(MapPoly)
      -	});
      -}
      -
      -ee(defineProperties(MapPoly.prototype, {
      -	clear: d(function () {
      -		if (!this.__mapKeysData__.length) return;
      -		clear.call(this.__mapKeysData__);
      -		clear.call(this.__mapValuesData__);
      -		this.emit('_clear');
      -	}),
      -	delete: d(function (key) {
      -		var index = eIndexOf.call(this.__mapKeysData__, key);
      -		if (index === -1) return false;
      -		this.__mapKeysData__.splice(index, 1);
      -		this.__mapValuesData__.splice(index, 1);
      -		this.emit('_delete', index, key);
      -		return true;
      -	}),
      -	entries: d(function () { return new Iterator(this, 'key+value'); }),
      -	forEach: d(function (cb/*, thisArg*/) {
      -		var thisArg = arguments[1], iterator, result;
      -		callable(cb);
      -		iterator = this.entries();
      -		result = iterator._next();
      -		while (result !== undefined) {
      -			call.call(cb, thisArg, this.__mapValuesData__[result],
      -				this.__mapKeysData__[result], this);
      -			result = iterator._next();
      -		}
      -	}),
      -	get: d(function (key) {
      -		var index = eIndexOf.call(this.__mapKeysData__, key);
      -		if (index === -1) return;
      -		return this.__mapValuesData__[index];
      -	}),
      -	has: d(function (key) {
      -		return (eIndexOf.call(this.__mapKeysData__, key) !== -1);
      -	}),
      -	keys: d(function () { return new Iterator(this, 'key'); }),
      -	set: d(function (key, value) {
      -		var index = eIndexOf.call(this.__mapKeysData__, key), emit;
      -		if (index === -1) {
      -			index = this.__mapKeysData__.push(key) - 1;
      -			emit = true;
      -		}
      -		this.__mapValuesData__[index] = value;
      -		if (emit) this.emit('_add', index, key);
      -		return this;
      -	}),
      -	size: d.gs(function () { return this.__mapKeysData__.length; }),
      -	values: d(function () { return new Iterator(this, 'value'); }),
      -	toString: d(function () { return '[object Map]'; })
      -}));
      -Object.defineProperty(MapPoly.prototype, Symbol.iterator, d(function () {
      -	return this.entries();
      -}));
      -Object.defineProperty(MapPoly.prototype, Symbol.toStringTag, d('c', 'Map'));
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/primitive/index.js b/tools/eslint/node_modules/escope/node_modules/es6-map/primitive/index.js
      deleted file mode 100644
      index 425d48265aa0f8..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/primitive/index.js
      +++ /dev/null
      @@ -1,115 +0,0 @@
      -'use strict';
      -
      -var clear          = require('es5-ext/object/clear')
      -  , setPrototypeOf = require('es5-ext/object/set-prototype-of')
      -  , validValue     = require('es5-ext/object/valid-value')
      -  , callable       = require('es5-ext/object/valid-callable')
      -  , d              = require('d')
      -  , iterator       = require('es6-iterator/valid-iterable')
      -  , forOf          = require('es6-iterator/for-of')
      -  , Map            = require('../polyfill')
      -  , Iterator       = require('../lib/primitive-iterator')
      -
      -  , call = Function.prototype.call
      -  , defineProperty = Object.defineProperty
      -  , create = Object.create, defineProperties = Object.defineProperties
      -  , hasOwnProperty = Object.prototype.hasOwnProperty
      -  , PrimitiveMap;
      -
      -module.exports = PrimitiveMap = function (/*iterable, serialize*/) {
      -	var iterable = arguments[0], serialize = arguments[1];
      -	if (!(this instanceof PrimitiveMap)) {
      -		return new PrimitiveMap(iterable, serialize);
      -	}
      -	if (this.__mapData__ !== undefined) {
      -		throw new TypeError(this + " cannot be reinitialized");
      -	}
      -	if (iterable != null) iterator(iterable);
      -	if (serialize !== undefined) {
      -		callable(serialize);
      -		defineProperty(this, '_serialize', d('', serialize));
      -	}
      -	defineProperties(this, {
      -		__mapKeysData__: d('c', create(null)),
      -		__mapValuesData__: d('c', create(null)),
      -		__size__: d('w', 0)
      -	});
      -	if (!iterable) return;
      -	forOf(iterable, function (value) {
      -		var key = validValue(value)[0], sKey = this._serialize(key);
      -		if (sKey == null) throw new TypeError(key + " cannot be serialized");
      -		value = value[1];
      -		if (hasOwnProperty.call(this.__mapKeysData__, sKey)) {
      -			if (this.__mapValuesData__[sKey] === value) return;
      -		} else {
      -			++this.__size__;
      -		}
      -		this.__mapKeysData__[sKey] = key;
      -		this.__mapValuesData__[sKey] = value;
      -	}, this);
      -};
      -if (setPrototypeOf) setPrototypeOf(PrimitiveMap, Map);
      -
      -PrimitiveMap.prototype = create(Map.prototype, {
      -	constructor: d(PrimitiveMap),
      -	_serialize: d(function (value) {
      -		if (value && (typeof value.toString !== 'function')) return null;
      -		return String(value);
      -	}),
      -	clear: d(function () {
      -		if (!this.__size__) return;
      -		clear(this.__mapKeysData__);
      -		clear(this.__mapValuesData__);
      -		this.__size__ = 0;
      -		this.emit('_clear');
      -	}),
      -	delete: d(function (key) {
      -		var sKey = this._serialize(key);
      -		if (sKey == null) return false;
      -		if (!hasOwnProperty.call(this.__mapKeysData__, sKey)) return false;
      -		delete this.__mapKeysData__[sKey];
      -		delete this.__mapValuesData__[sKey];
      -		--this.__size__;
      -		this.emit('_delete', sKey);
      -		return true;
      -	}),
      -	entries: d(function () { return new Iterator(this, 'key+value'); }),
      -	forEach: d(function (cb/*, thisArg*/) {
      -		var thisArg = arguments[1], iterator, result, sKey;
      -		callable(cb);
      -		iterator = this.entries();
      -		result = iterator._next();
      -		while (result !== undefined) {
      -			sKey = iterator.__list__[result];
      -			call.call(cb, thisArg, this.__mapValuesData__[sKey],
      -				this.__mapKeysData__[sKey], this);
      -			result = iterator._next();
      -		}
      -	}),
      -	get: d(function (key) {
      -		var sKey = this._serialize(key);
      -		if (sKey == null) return;
      -		return this.__mapValuesData__[sKey];
      -	}),
      -	has: d(function (key) {
      -		var sKey = this._serialize(key);
      -		if (sKey == null) return false;
      -		return hasOwnProperty.call(this.__mapKeysData__, sKey);
      -	}),
      -	keys: d(function () { return new Iterator(this, 'key'); }),
      -	size: d.gs(function () { return this.__size__; }),
      -	set: d(function (key, value) {
      -		var sKey = this._serialize(key);
      -		if (sKey == null) throw new TypeError(key + " cannot be serialized");
      -		if (hasOwnProperty.call(this.__mapKeysData__, sKey)) {
      -			if (this.__mapValuesData__[sKey] === value) return this;
      -		} else {
      -			++this.__size__;
      -		}
      -		this.__mapKeysData__[sKey] = key;
      -		this.__mapValuesData__[sKey] = value;
      -		this.emit('_add', sKey);
      -		return this;
      -	}),
      -	values: d(function () { return new Iterator(this, 'value'); })
      -});
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/test/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-map/test/implement.js
      deleted file mode 100644
      index 3569df61d221ff..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/test/implement.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof Map, 'function'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/test/index.js b/tools/eslint/node_modules/escope/node_modules/es6-map/test/index.js
      deleted file mode 100644
      index 907b8c5a7bb2e7..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/test/index.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -module.exports = function (T, a) {
      -	a((new T([['raz', 1], ['dwa', 2]])).size, 2);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/test/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-map/test/is-implemented.js
      deleted file mode 100644
      index 06df91cc529c02..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/test/is-implemented.js
      +++ /dev/null
      @@ -1,14 +0,0 @@
      -'use strict';
      -
      -var global   = require('es5-ext/global')
      -  , polyfill = require('../polyfill');
      -
      -module.exports = function (t, a) {
      -	var cache;
      -	a(typeof t(), 'boolean');
      -	cache = global.Map;
      -	global.Map = polyfill;
      -	a(t(), true);
      -	if (cache === undefined) delete global.Map;
      -	else global.Map = cache;
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/test/is-map.js b/tools/eslint/node_modules/escope/node_modules/es6-map/test/is-map.js
      deleted file mode 100644
      index f600b2298b8e7a..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/test/is-map.js
      +++ /dev/null
      @@ -1,16 +0,0 @@
      -'use strict';
      -
      -var MapPoly = require('../polyfill');
      -
      -module.exports = function (t, a) {
      -	a(t(undefined), false, "Undefined");
      -	a(t(null), false, "Null");
      -	a(t(true), false, "Primitive");
      -	a(t('raz'), false, "String");
      -	a(t({}), false, "Object");
      -	a(t([]), false, "Array");
      -	if (typeof Map !== 'undefined') {
      -		a(t(new Map()), true, "Native");
      -	}
      -	a(t(new MapPoly()), true, "Polyfill");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/test/is-native-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-map/test/is-native-implemented.js
      deleted file mode 100644
      index df8ba0323f0cad..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/test/is-native-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t, 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/test/lib/iterator-kinds.js b/tools/eslint/node_modules/escope/node_modules/es6-map/test/lib/iterator-kinds.js
      deleted file mode 100644
      index 41ea10c57deffc..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/test/lib/iterator-kinds.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a.deep(t, { key: true, value: true, 'key+value': true });
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/test/lib/iterator.js b/tools/eslint/node_modules/escope/node_modules/es6-map/test/lib/iterator.js
      deleted file mode 100644
      index 2688ed26cb7a73..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/test/lib/iterator.js
      +++ /dev/null
      @@ -1,13 +0,0 @@
      -'use strict';
      -
      -var Map     = require('../../polyfill')
      -  , toArray = require('es5-ext/array/to-array');
      -
      -module.exports = function (T, a) {
      -	var arr = [['raz', 'one'], ['dwa', 'two']], map = new Map(arr);
      -
      -	a.deep(toArray(new T(map)), arr, "Default");
      -	a.deep(toArray(new T(map, 'key+value')), arr, "Key & Value");
      -	a.deep(toArray(new T(map, 'value')), ['one', 'two'], "Value");
      -	a.deep(toArray(new T(map, 'key')), ['raz', 'dwa'], "Value");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/test/lib/primitive-iterator.js b/tools/eslint/node_modules/escope/node_modules/es6-map/test/lib/primitive-iterator.js
      deleted file mode 100644
      index ed2790de9b5cc6..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/test/lib/primitive-iterator.js
      +++ /dev/null
      @@ -1,130 +0,0 @@
      -'use strict';
      -
      -var iteratorSymbol = require('es6-symbol').iterator
      -  , toArray        = require('es5-ext/array/to-array')
      -  , Map            = require('../../primitive')
      -
      -  , compare, mapToResults;
      -
      -compare = function (a, b) {
      -	if (!a.value) return -1;
      -	if (!b.value) return 1;
      -	return a.value[0].localeCompare(b.value[0]);
      -};
      -
      -mapToResults = function (arr) {
      -	return arr.sort().map(function (value) {
      -		return { done: false, value: value };
      -	});
      -};
      -
      -module.exports = function (T) {
      -	return {
      -		"": function (a) {
      -			var arr, it, y, z, map, result = [];
      -
      -			arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three'],
      -				['cztery', 'four'], ['pięć', 'five']];
      -			map = new Map(arr);
      -
      -			it = new T(map);
      -			a(it[iteratorSymbol](), it, "@@iterator");
      -			y = it.next();
      -			result.push(y);
      -			z = it.next();
      -			a.not(y, z, "Recreate result");
      -			result.push(z);
      -			result.push(it.next());
      -			result.push(it.next());
      -			result.push(it.next());
      -			a.deep(result.sort(compare), mapToResults(arr));
      -			a.deep(y = it.next(), { done: true, value: undefined }, "End");
      -			a.not(y, it.next(), "Recreate result on dead");
      -		},
      -		Emited: function (a) {
      -			var arr, it, map, result = [];
      -
      -			arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three'],
      -				['cztery', 'four'], ['pięć', 'five']];
      -			map = new Map(arr);
      -
      -			it = new T(map);
      -			result.push(it.next());
      -			result.push(it.next());
      -			map.set('sześć', 'six');
      -			arr.push(['sześć', 'six']);
      -			result.push(it.next());
      -			map.delete('pięć');
      -			arr.splice(4, 1);
      -			result.push(it.next());
      -			result.push(it.next());
      -			a.deep(result.sort(compare), mapToResults(arr));
      -			a.deep(it.next(), { done: true, value: undefined }, "End");
      -		},
      -		"Emited #2": function (a) {
      -			var arr, it, map, result = [];
      -
      -			arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three'],
      -				['cztery', 'four'], ['pięć', 'five'], ['sześć', 'six']];
      -			map = new Map(arr);
      -
      -			it = new T(map);
      -			result.push(it.next());
      -			result.push(it.next());
      -			map.set('siedem', 'seven');
      -			map.delete('siedem');
      -			result.push(it.next());
      -			result.push(it.next());
      -			map.delete('pięć');
      -			arr.splice(4, 1);
      -			result.push(it.next());
      -			a.deep(result.sort(compare), mapToResults(arr));
      -			a.deep(it.next(), { done: true, value: undefined }, "End");
      -		},
      -		"Emited: Clear #1": function (a) {
      -			var arr, it, map, result = [];
      -
      -			arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three'],
      -				['cztery', 'four'], ['pięć', 'five'], ['sześć', 'six']];
      -			map = new Map(arr);
      -
      -			it = new T(map);
      -			result.push(it.next());
      -			result.push(it.next());
      -			arr = [['raz', 'one'], ['dwa', 'two']];
      -			map.clear();
      -			a.deep(result.sort(compare), mapToResults(arr));
      -			a.deep(it.next(), { done: true, value: undefined }, "End");
      -		},
      -		"Emited: Clear #2": function (a) {
      -			var arr, it, map, result = [];
      -
      -			arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three'],
      -				['cztery', 'four'], ['pięć', 'five'], ['sześć', 'six']];
      -			map = new Map(arr);
      -
      -			it = new T(map);
      -			result.push(it.next());
      -			result.push(it.next());
      -			map.clear();
      -			map.set('foo', 'bru');
      -			map.set('bar', 'far');
      -			arr = [['raz', 'one'], ['dwa', 'two'], ['foo', 'bru'], ['bar', 'far']];
      -			result.push(it.next());
      -			result.push(it.next());
      -			a.deep(result.sort(compare), mapToResults(arr));
      -			a.deep(it.next(), { done: true, value: undefined }, "End");
      -		},
      -		Kinds: function (a) {
      -			var arr = [['raz', 'one'], ['dwa', 'two']], map = new Map(arr);
      -
      -			a.deep(toArray(new T(map)).sort(), arr.sort(), "Default");
      -			a.deep(toArray(new T(map, 'key+value')).sort(), arr.sort(),
      -				"Key + Value");
      -			a.deep(toArray(new T(map, 'value')).sort(), ['one', 'two'].sort(),
      -				"Value");
      -			a.deep(toArray(new T(map, 'key')).sort(), ['raz', 'dwa'].sort(),
      -				"Key");
      -		}
      -	};
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/test/polyfill.js b/tools/eslint/node_modules/escope/node_modules/es6-map/test/polyfill.js
      deleted file mode 100644
      index 6640e359dec76a..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/test/polyfill.js
      +++ /dev/null
      @@ -1,54 +0,0 @@
      -'use strict';
      -
      -var aFrom   = require('es5-ext/array/from')
      -  , toArray = require('es5-ext/array/to-array');
      -
      -module.exports = function (T, a) {
      -	var arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three']]
      -	  , map = new T(arr), x = {}, y = {}, i = 0;
      -
      -	a(map instanceof T, true, "Map");
      -	a(map.size, 3, "Size");
      -	a(map.get('raz'), 'one', "Get: contained");
      -	a(map.get(x), undefined, "Get: not contained");
      -	a(map.has('raz'), true, "Has: contained");
      -	a(map.has(x), false, "Has: not contained");
      -	a(map.set(x, y), map, "Set: return");
      -	a(map.has(x), true, "Set: has");
      -	a(map.get(x), y, "Set: get");
      -	a(map.size, 4, "Set: Size");
      -	map.set('dwa', x);
      -	a(map.get('dwa'), x, "Overwrite: get");
      -	a(map.size, 4, "Overwrite: size");
      -
      -	a(map.delete({}), false, "Delete: false");
      -
      -	arr.push([x, y]);
      -	arr[1][1] = x;
      -	map.forEach(function () {
      -		a.deep(aFrom(arguments), [arr[i][1], arr[i][0], map],
      -			"ForEach: Arguments:  #" + i);
      -		a(this, y, "ForEach: Context: #" + i);
      -		if (i === 0) {
      -			a(map.delete('raz'), true, "Delete: true");
      -			a(map.has('raz'), false, "Delete");
      -			a(map.size, 3, "Delete: size");
      -			map.set('cztery', 'four');
      -			arr.push(['cztery', 'four']);
      -		}
      -		i++;
      -	}, y);
      -	arr.splice(0, 1);
      -
      -	a.deep(toArray(map.entries()), [['dwa', x], ['trzy', 'three'], [x, y],
      -		['cztery', 'four']], "Entries");
      -	a.deep(toArray(map.keys()), ['dwa', 'trzy', x, 'cztery'], "Keys");
      -	a.deep(toArray(map.values()), [x, 'three', y, 'four'], "Values");
      -	a.deep(toArray(map), [['dwa', x], ['trzy', 'three'], [x, y],
      -		['cztery', 'four']], "Iterator");
      -
      -	map.clear();
      -	a(map.size, 0, "Clear: size");
      -	a(map.has('trzy'), false, "Clear: has");
      -	a.deep(toArray(map), [], "Clear: Values");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/test/primitive/index.js b/tools/eslint/node_modules/escope/node_modules/es6-map/test/primitive/index.js
      deleted file mode 100644
      index 1167d2ebdfb8d4..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/test/primitive/index.js
      +++ /dev/null
      @@ -1,53 +0,0 @@
      -'use strict';
      -
      -var aFrom       = require('es5-ext/array/from')
      -  , getIterator = require('es6-iterator/get')
      -  , toArray     = require('es5-ext/array/to-array');
      -
      -module.exports = function (T, a) {
      -	var arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three']]
      -	  , map = new T(arr), x = 'other', y = 'other2'
      -	  , i = 0, result = [];
      -
      -	a(map instanceof T, true, "Map");
      -	a(map.size, 3, "Size");
      -	a(map.get('raz'), 'one', "Get: contained");
      -	a(map.get(x), undefined, "Get: not contained");
      -	a(map.has('raz'), true, "Has: true");
      -	a(map.has(x), false, "Has: false");
      -	a(map.set(x, y), map, "Add: return");
      -	a(map.has(x), true, "Add");
      -	a(map.size, 4, "Add: Size");
      -	map.set('dwa', x);
      -	a(map.get('dwa'), x, "Overwrite: get");
      -	a(map.size, 4, "Overwrite: size");
      -
      -	a(map.delete('else'), false, "Delete: false");
      -
      -	arr.push([x, y]);
      -	arr[1][1] = x;
      -	map.forEach(function () {
      -		result.push(aFrom(arguments));
      -		a(this, y, "ForEach: Context: #" + i);
      -	}, y);
      -
      -	a.deep(result.sort(function (a, b) {
      -		return String([a[1], a[0]]).localeCompare([b[1], b[0]]);
      -	}), arr.sort().map(function (val) { return [val[1], val[0], map]; }),
      -		"ForEach: Arguments");
      -
      -	a.deep(toArray(map.entries()).sort(), [['dwa', x], ['trzy', 'three'],
      -		[x, y], ['raz', 'one']].sort(), "Entries");
      -	a.deep(toArray(map.keys()).sort(), ['dwa', 'trzy', x, 'raz'].sort(),
      -		"Keys");
      -	a.deep(toArray(map.values()).sort(), [x, 'three', y, 'one'].sort(),
      -		"Values");
      -	a.deep(toArray(getIterator(map)).sort(), [['dwa', x], ['trzy', 'three'],
      -		[x, y], ['raz', 'one']].sort(),
      -		"Iterator");
      -
      -	map.clear();
      -	a(map.size, 0, "Clear: size");
      -	a(map.has('trzy'), false, "Clear: has");
      -	a.deep(toArray(map.values()), [], "Clear: Values");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/test/valid-map.js b/tools/eslint/node_modules/escope/node_modules/es6-map/test/valid-map.js
      deleted file mode 100644
      index ac0314949a3009..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/test/valid-map.js
      +++ /dev/null
      @@ -1,19 +0,0 @@
      -'use strict';
      -
      -var MapPoly = require('../polyfill');
      -
      -module.exports = function (t, a) {
      -	var map;
      -	a.throws(function () { t(undefined); }, TypeError, "Undefined");
      -	a.throws(function () { t(null); }, TypeError, "Null");
      -	a.throws(function () { t(true); }, TypeError, "Primitive");
      -	a.throws(function () { t('raz'); }, TypeError, "String");
      -	a.throws(function () { t({}); }, TypeError, "Object");
      -	a.throws(function () { t([]); }, TypeError, "Array");
      -	if (typeof Map !== 'undefined') {
      -		map = new Map();
      -		a(t(map), map, "Native");
      -	}
      -	map = new MapPoly();
      -	a(t(map), map, "Polyfill");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/.lint b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/.lint
      deleted file mode 100644
      index cf54d815684b2f..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/.lint
      +++ /dev/null
      @@ -1,11 +0,0 @@
      -@root
      -
      -module
      -
      -tabs
      -indent 2
      -maxlen 100
      -
      -ass
      -nomen
      -plusplus
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/.npmignore b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/.npmignore
      deleted file mode 100644
      index 155e41f69142ef..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/.npmignore
      +++ /dev/null
      @@ -1,4 +0,0 @@
      -.DS_Store
      -/node_modules
      -/npm-debug.log
      -/.lintcache
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/.travis.yml b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/.travis.yml
      deleted file mode 100644
      index 08f04a1b297e57..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/.travis.yml
      +++ /dev/null
      @@ -1,10 +0,0 @@
      -sudo: false # use faster docker infrastructure
      -language: node_js
      -node_js:
      -  - 0.10
      -  - 0.12
      -  - iojs
      -
      -notifications:
      -  email:
      -    - medikoo+es6-weak-map@medikoo.com
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/CHANGES b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/CHANGES
      deleted file mode 100644
      index 33944088485291..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/CHANGES
      +++ /dev/null
      @@ -1,24 +0,0 @@
      -v0.1.4  --  2015.04.13
      -* Republish v0.1.2 as v0.1.4 due to breaking changes
      -  (v0.1.3 should have been published as next major)
      -
      -v0.1.3  --  2015.04.12
      -* Update up to changes in specification (require new, remove clear method)
      -* Improve native implementation validation
      -* Configure lint scripts
      -* Rename LICENCE to LICENSE
      -
      -v0.1.2  --  2014.09.01
      -* Use internal random and unique id generator instead of external (time-uuid based).
      -  Global uniqueness is not needed in scope of this module. Fixes #1
      -
      -v0.1.1  --  2014.05.15
      -* Improve valid WeakMap detection
      -
      -v0.1.0  --  2014.04.29
      -* Assure to depend only npm hosted dependencies
      -* Update to use latest versions of dependencies
      -* Use ES6 symbols internally
      -
      -v0.0.0  --  2013.10.24
      -Initial (dev version)
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/README.md b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/README.md
      deleted file mode 100644
      index dd91b469a4249e..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/README.md
      +++ /dev/null
      @@ -1,65 +0,0 @@
      -# es6-weak-map
      -## WeakMap collection as specified in ECMAScript6
      -
      -_Roughly inspired by Mark Miller's and Kris Kowal's [WeakMap implementation](https://github.com/drses/weak-map)_.
      -
      -Differences are:
      -- Assumes compliant ES5 environment (no weird ES3 workarounds or hacks)
      -- Well modularized CJS style
      -- Based on one solution.
      -
      -### Limitations
      -
      -- Will fail on non extensible objects provided as keys
      -- While `clear` method is provided, it's not perfectly spec compliant. If some objects were saved as _values_, they need to be removed via `delete`. Otherwise they'll remain infinitely attached to _key_ object (that means, they'll be free for GC only if _key_ object was collected as well).
      -
      -### Installation
      -
      -	$ npm install es6-weak-map
      -
      -To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)
      -
      -### Usage
      -
      -If you want to make sure your environment implements `WeakMap`, do:
      -
      -```javascript
      -require('es6-weak-map/implement');
      -```
      -
      -If you'd like to use native version when it exists and fallback to polyfill if it doesn't, but without implementing `WeakMap` on global scope, do:
      -
      -```javascript
      -var WeakMap = require('es6-weak-map');
      -```
      -
      -If you strictly want to use polyfill even if native `WeakMap` exists, do:
      -
      -```javascript
      -var WeakMap = require('es6-weak-map/polyfill');
      -```
      -
      -#### API
      -
      -Best is to refer to [specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-weakmap-objects). Still if you want quick look, follow example:
      -
      -```javascript
      -var WeakMap = require('es6-weak-map');
      -
      -var map = new WeakMap();
      -var obj = {};
      -
      -map.set(obj, 'foo'); // map
      -map.get(obj);        // 'foo'
      -map.has(obj);        // true
      -map.delete(obj);     // true
      -map.get(obj);        // undefined
      -map.has(obj);        // false
      -map.set(obj, 'bar'); // map
      -map.clear();         // undefined
      -map.has(obj);        // false
      -```
      -
      -## Tests [![Build Status](https://travis-ci.org/medikoo/es6-weak-map.png)](https://travis-ci.org/medikoo/es6-weak-map)
      -
      -	$ npm test
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/index.js
      deleted file mode 100644
      index 5edc4cc8fb5730..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/index.js
      +++ /dev/null
      @@ -1,4 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./is-implemented')() ?
      -		WeakMap : require('./polyfill');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/is-implemented.js
      deleted file mode 100644
      index 455ff812522e34..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/is-implemented.js
      +++ /dev/null
      @@ -1,14 +0,0 @@
      -'use strict';
      -
      -module.exports = function () {
      -	var map;
      -	if (typeof WeakMap !== 'function') return false;
      -	map = new WeakMap();
      -	if (typeof map.set !== 'function') return false;
      -	if (map.set({}, 1) !== map) return false;
      -	if (typeof map.clear !== 'function') return false;
      -	if (typeof map.delete !== 'function') return false;
      -	if (typeof map.has !== 'function') return false;
      -
      -	return true;
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/is-native-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/is-native-implemented.js
      deleted file mode 100644
      index b3fe5a594d253e..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/is-native-implemented.js
      +++ /dev/null
      @@ -1,10 +0,0 @@
      -// Exports true if environment provides native `WeakMap` implementation,
      -// whatever that is.
      -
      -'use strict';
      -
      -module.exports = (function () {
      -	if (typeof WeakMap === 'undefined') return false;
      -	return (Object.prototype.toString.call(WeakMap.prototype) ===
      -			'[object WeakMap]');
      -}());
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/.npmignore b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/.npmignore
      deleted file mode 100644
      index 155e41f69142ef..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/.npmignore
      +++ /dev/null
      @@ -1,4 +0,0 @@
      -.DS_Store
      -/node_modules
      -/npm-debug.log
      -/.lintcache
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/.travis.yml b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/.travis.yml
      deleted file mode 100644
      index 50008b23e6bcb9..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/.travis.yml
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -language: node_js
      -node_js:
      -  - 0.8
      -  - 0.10
      -  - 0.11
      -
      -notifications:
      -  email:
      -    - medikoo+d@medikoo.com
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/CHANGES b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/CHANGES
      deleted file mode 100644
      index 45233f747eca72..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/CHANGES
      +++ /dev/null
      @@ -1,7 +0,0 @@
      -v0.1.1  --  2014.04.24
      -- Add `autoBind` and `lazy` utilities
      -- Allow to pass other options to be merged onto created descriptor.
      -  Useful when used with other custom utilties
      -
      -v0.1.0  --  2013.06.20
      -Initial (derived from es5-ext project)
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/LICENCE b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/LICENCE
      deleted file mode 100644
      index aaf35282f41f57..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/LICENCE
      +++ /dev/null
      @@ -1,19 +0,0 @@
      -Copyright (C) 2013 Mariusz Nowak (www.medikoo.com)
      -
      -Permission is hereby granted, free of charge, to any person obtaining a copy
      -of this software and associated documentation files (the "Software"), to deal
      -in the Software without restriction, including without limitation the rights
      -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
      -copies of the Software, and to permit persons to whom the Software is
      -furnished to do so, subject to the following conditions:
      -
      -The above copyright notice and this permission notice shall be included in
      -all copies or substantial portions of the Software.
      -
      -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
      -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
      -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
      -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
      -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
      -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
      -THE SOFTWARE.
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/package.json b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/package.json
      deleted file mode 100644
      index 03d81db13be8d9..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/package.json
      +++ /dev/null
      @@ -1,59 +0,0 @@
      -{
      -  "name": "d",
      -  "version": "0.1.1",
      -  "description": "Property descriptor factory",
      -  "author": {
      -    "name": "Mariusz Nowak",
      -    "email": "medyk@medikoo.com",
      -    "url": "http://www.medikoo.com/"
      -  },
      -  "scripts": {
      -    "test": "node node_modules/tad/bin/tad"
      -  },
      -  "repository": {
      -    "type": "git",
      -    "url": "git://github.com/medikoo/d.git"
      -  },
      -  "keywords": [
      -    "descriptor",
      -    "es",
      -    "ecmascript",
      -    "ecma",
      -    "property",
      -    "descriptors",
      -    "meta",
      -    "properties"
      -  ],
      -  "dependencies": {
      -    "es5-ext": "~0.10.2"
      -  },
      -  "devDependencies": {
      -    "tad": "~0.1.21"
      -  },
      -  "license": "MIT",
      -  "bugs": {
      -    "url": "https://github.com/medikoo/d/issues"
      -  },
      -  "homepage": "https://github.com/medikoo/d",
      -  "_id": "d@0.1.1",
      -  "dist": {
      -    "shasum": "da184c535d18d8ee7ba2aa229b914009fae11309",
      -    "tarball": "http://registry.npmjs.org/d/-/d-0.1.1.tgz"
      -  },
      -  "_from": "d@>=0.1.1 <0.2.0",
      -  "_npmVersion": "1.4.3",
      -  "_npmUser": {
      -    "name": "medikoo",
      -    "email": "medikoo+npm@medikoo.com"
      -  },
      -  "maintainers": [
      -    {
      -      "name": "medikoo",
      -      "email": "medikoo+npm@medikoo.com"
      -    }
      -  ],
      -  "directories": {},
      -  "_shasum": "da184c535d18d8ee7ba2aa229b914009fae11309",
      -  "_resolved": "https://registry.npmjs.org/d/-/d-0.1.1.tgz",
      -  "readme": "ERROR: No README data found!"
      -}
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/test/auto-bind.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/test/auto-bind.js
      deleted file mode 100644
      index 89edfb88bbec53..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/test/auto-bind.js
      +++ /dev/null
      @@ -1,12 +0,0 @@
      -'use strict';
      -
      -var d = require('../');
      -
      -module.exports = function (t, a) {
      -	var o = Object.defineProperties({}, t({
      -		bar: d(function () { return this === o; }),
      -		bar2: d(function () { return this; })
      -	}));
      -
      -	a.deep([(o.bar)(), (o.bar2)()], [true, o]);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/test/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/test/index.js
      deleted file mode 100644
      index 3db0af10acd3ca..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/test/index.js
      +++ /dev/null
      @@ -1,182 +0,0 @@
      -'use strict';
      -
      -var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
      -
      -module.exports = function (t, a) {
      -	var o, c, cg, cs, ce, ceg, ces, cew, cw, e, eg, es, ew, v, vg, vs, w, df, dfg
      -	  , dfs;
      -
      -	o = Object.create(Object.prototype, {
      -		c: t('c', c = {}),
      -		cgs: t.gs('c', cg = function () {}, cs = function () {}),
      -		ce: t('ce', ce = {}),
      -		cegs: t.gs('ce', ceg = function () {}, ces = function () {}),
      -		cew: t('cew', cew = {}),
      -		cw: t('cw', cw = {}),
      -		e: t('e', e = {}),
      -		egs: t.gs('e', eg = function () {}, es = function () {}),
      -		ew: t('ew', ew = {}),
      -		v: t('', v = {}),
      -		vgs: t.gs('', vg = function () {}, vs = function () {}),
      -		w: t('w', w = {}),
      -
      -		df: t(df = {}),
      -		dfgs: t.gs(dfg = function () {}, dfs = function () {})
      -	});
      -
      -	return {
      -		c: function (a) {
      -			var d = getOwnPropertyDescriptor(o, 'c');
      -			a(d.value, c, "Value");
      -			a(d.get, undefined, "Get");
      -			a(d.set, undefined, "Set");
      -			a(d.configurable, true, "Configurable");
      -			a(d.enumerable, false, "Enumerable");
      -			a(d.writable, false, "Writable");
      -
      -			d = getOwnPropertyDescriptor(o, 'cgs');
      -			a(d.value, undefined, "GS Value");
      -			a(d.get, cg, "GS Get");
      -			a(d.set, cs, "GS Set");
      -			a(d.configurable, true, "GS Configurable");
      -			a(d.enumerable, false, "GS Enumerable");
      -			a(d.writable, undefined, "GS Writable");
      -		},
      -		ce: function (a) {
      -			var d = getOwnPropertyDescriptor(o, 'ce');
      -			a(d.value, ce, "Value");
      -			a(d.get, undefined, "Get");
      -			a(d.set, undefined, "Set");
      -			a(d.configurable, true, "Configurable");
      -			a(d.enumerable, true, "Enumerable");
      -			a(d.writable, false, "Writable");
      -
      -			d = getOwnPropertyDescriptor(o, 'cegs');
      -			a(d.value, undefined, "GS Value");
      -			a(d.get, ceg, "GS Get");
      -			a(d.set, ces, "GS Set");
      -			a(d.configurable, true, "GS Configurable");
      -			a(d.enumerable, true, "GS Enumerable");
      -			a(d.writable, undefined, "GS Writable");
      -		},
      -		cew: function (a) {
      -			var d = getOwnPropertyDescriptor(o, 'cew');
      -			a(d.value, cew, "Value");
      -			a(d.get, undefined, "Get");
      -			a(d.set, undefined, "Set");
      -			a(d.configurable, true, "Configurable");
      -			a(d.enumerable, true, "Enumerable");
      -			a(d.writable, true, "Writable");
      -		},
      -		cw: function (a) {
      -			var d = getOwnPropertyDescriptor(o, 'cw');
      -			a(d.value, cw, "Value");
      -			a(d.get, undefined, "Get");
      -			a(d.set, undefined, "Set");
      -			a(d.configurable, true, "Configurable");
      -			a(d.enumerable, false, "Enumerable");
      -			a(d.writable, true, "Writable");
      -		},
      -		e: function (a) {
      -			var d = getOwnPropertyDescriptor(o, 'e');
      -			a(d.value, e, "Value");
      -			a(d.get, undefined, "Get");
      -			a(d.set, undefined, "Set");
      -			a(d.configurable, false, "Configurable");
      -			a(d.enumerable, true, "Enumerable");
      -			a(d.writable, false, "Writable");
      -
      -			d = getOwnPropertyDescriptor(o, 'egs');
      -			a(d.value, undefined, "GS Value");
      -			a(d.get, eg, "GS Get");
      -			a(d.set, es, "GS Set");
      -			a(d.configurable, false, "GS Configurable");
      -			a(d.enumerable, true, "GS Enumerable");
      -			a(d.writable, undefined, "GS Writable");
      -		},
      -		ew: function (a) {
      -			var d = getOwnPropertyDescriptor(o, 'ew');
      -			a(d.value, ew, "Value");
      -			a(d.get, undefined, "Get");
      -			a(d.set, undefined, "Set");
      -			a(d.configurable, false, "Configurable");
      -			a(d.enumerable, true, "Enumerable");
      -			a(d.writable, true, "Writable");
      -		},
      -		v: function (a) {
      -			var d = getOwnPropertyDescriptor(o, 'v');
      -			a(d.value, v, "Value");
      -			a(d.get, undefined, "Get");
      -			a(d.set, undefined, "Set");
      -			a(d.configurable, false, "Configurable");
      -			a(d.enumerable, false, "Enumerable");
      -			a(d.writable, false, "Writable");
      -
      -			d = getOwnPropertyDescriptor(o, 'vgs');
      -			a(d.value, undefined, "GS Value");
      -			a(d.get, vg, "GS Get");
      -			a(d.set, vs, "GS Set");
      -			a(d.configurable, false, "GS Configurable");
      -			a(d.enumerable, false, "GS Enumerable");
      -			a(d.writable, undefined, "GS Writable");
      -		},
      -		w: function (a) {
      -			var d = getOwnPropertyDescriptor(o, 'w');
      -			a(d.value, w, "Value");
      -			a(d.get, undefined, "Get");
      -			a(d.set, undefined, "Set");
      -			a(d.configurable, false, "Configurable");
      -			a(d.enumerable, false, "Enumerable");
      -			a(d.writable, true, "Writable");
      -		},
      -		d: function (a) {
      -			var d = getOwnPropertyDescriptor(o, 'df');
      -			a(d.value, df, "Value");
      -			a(d.get, undefined, "Get");
      -			a(d.set, undefined, "Set");
      -			a(d.configurable, true, "Configurable");
      -			a(d.enumerable, false, "Enumerable");
      -			a(d.writable, true, "Writable");
      -
      -			d = getOwnPropertyDescriptor(o, 'dfgs');
      -			a(d.value, undefined, "GS Value");
      -			a(d.get, dfg, "GS Get");
      -			a(d.set, dfs, "GS Set");
      -			a(d.configurable, true, "GS Configurable");
      -			a(d.enumerable, false, "GS Enumerable");
      -			a(d.writable, undefined, "GS Writable");
      -		},
      -		Options: {
      -			v: function (a) {
      -				var x = {}, d = t(x, { foo: true });
      -				a.deep(d, { configurable: true, enumerable: false, writable: true,
      -					value: x, foo: true }, "No descriptor");
      -				d = t('c', 'foo', { marko: 'elo' });
      -				a.deep(d, { configurable: true, enumerable: false, writable: false,
      -					value: 'foo', marko: 'elo' }, "Descriptor");
      -			},
      -			gs: function (a) {
      -				var gFn = function () {}, sFn = function () {}, d;
      -				d = t.gs(gFn, sFn, { foo: true });
      -				a.deep(d, { configurable: true, enumerable: false, get: gFn, set: sFn,
      -					foo: true }, "No descriptor");
      -				d = t.gs(null, sFn, { foo: true });
      -				a.deep(d, { configurable: true, enumerable: false, get: undefined,
      -					set: sFn, foo: true }, "No descriptor: Just set");
      -				d = t.gs(gFn, { foo: true });
      -				a.deep(d, { configurable: true, enumerable: false, get: gFn,
      -					set: undefined, foo: true }, "No descriptor: Just get");
      -
      -				d = t.gs('e', gFn, sFn, { bar: true });
      -				a.deep(d, { configurable: false, enumerable: true, get: gFn, set: sFn,
      -					bar: true }, "Descriptor");
      -				d = t.gs('e', null, sFn, { bar: true });
      -				a.deep(d, { configurable: false, enumerable: true, get: undefined,
      -					set: sFn, bar: true }, "Descriptor: Just set");
      -				d = t.gs('e', gFn, { bar: true });
      -				a.deep(d, { configurable: false, enumerable: true, get: gFn,
      -					set: undefined, bar: true }, "Descriptor: Just get");
      -			}
      -		}
      -	};
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/test/lazy.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/test/lazy.js
      deleted file mode 100644
      index 8266deb240fda3..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/test/lazy.js
      +++ /dev/null
      @@ -1,77 +0,0 @@
      -'use strict';
      -
      -var d = require('../')
      -
      -  , getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
      -
      -module.exports = function (t, a) {
      -	var Foo = function () {}, i = 1, o, o2, desc;
      -	Object.defineProperties(Foo.prototype, t({
      -		bar: d(function () { return ++i; }),
      -		bar2: d(function () { return this.bar + 23; }),
      -		bar3: d(function () { return this.bar2 + 34; }, { desc: 'ew' }),
      -		bar4: d(function () { return this.bar3 + 12; }, { cacheName: '_bar4_' }),
      -		bar5: d(function () { return this.bar4 + 3; },
      -			{ cacheName: '_bar5_', desc: 'e' })
      -	}));
      -
      -	desc = getOwnPropertyDescriptor(Foo.prototype, 'bar');
      -	a(desc.configurable, true, "Configurable: default");
      -	a(desc.enumerable, false, "Enumerable: default");
      -
      -	o = new Foo();
      -	a.deep([o.bar, o.bar2, o.bar3, o.bar4, o.bar5], [2, 25, 59, 71, 74],
      -		"Values");
      -
      -	a.deep(getOwnPropertyDescriptor(o, 'bar3'), { configurable: false,
      -		enumerable: true, writable: true, value: 59 }, "Desc");
      -	a(o.hasOwnProperty('bar4'), false, "Cache not exposed");
      -	desc = getOwnPropertyDescriptor(o, 'bar5');
      -	a.deep(desc, { configurable: false,
      -		enumerable: true, get: desc.get, set: desc.set }, "Cache & Desc: desc");
      -
      -	o2 = Object.create(o);
      -	o2.bar = 30;
      -	o2.bar3 = 100;
      -
      -	a.deep([o2.bar, o2.bar2, o2.bar3, o2.bar4, o2.bar5], [30, 25, 100, 112, 115],
      -		"Extension Values");
      -
      -	Foo = function () {};
      -	Object.defineProperties(Foo.prototype, t({
      -		test: d('w', function () { return 'raz'; }),
      -		test2: d('', function () { return 'raz'; }, { desc: 'w' }),
      -		test3: d('', function () { return 'raz'; },
      -			{ cacheName: '__test3__', desc: 'w' }),
      -		test4: d('w', 'bar')
      -	}));
      -
      -	o = new Foo();
      -	o.test = 'marko';
      -	a.deep(getOwnPropertyDescriptor(o, 'test'),
      -		{ configurable: false, enumerable: false, writable: true, value: 'marko' },
      -		"Set before get");
      -	o.test2 = 'marko2';
      -	a.deep(getOwnPropertyDescriptor(o, 'test2'),
      -		{ configurable: false, enumerable: false, writable: true, value: 'marko2' },
      -		"Set before get: Custom desc");
      -	o.test3 = 'marko3';
      -	a.deep(getOwnPropertyDescriptor(o, '__test3__'),
      -		{ configurable: false, enumerable: false, writable: true, value: 'marko3' },
      -		"Set before get: Custom cache name");
      -	a(o.test4, 'bar', "Resolve by value");
      -
      -	a.h1("Flat");
      -	Object.defineProperties(Foo.prototype, t({
      -		flat: d(function () { return 'foo'; }, { flat: true }),
      -		flat2: d(function () { return 'bar'; }, { flat: true })
      -	}));
      -
      -	a.h2("Instance");
      -	a(o.flat, 'foo', "Value");
      -	a(o.hasOwnProperty('flat'), false, "Instance");
      -	a(Foo.prototype.flat, 'foo', "Prototype");
      -
      -	a.h2("Direct");
      -	a(Foo.prototype.flat2, 'bar');
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/.lintignore b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/.lintignore
      deleted file mode 100644
      index ed703ed7662c89..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/.lintignore
      +++ /dev/null
      @@ -1,8 +0,0 @@
      -/string/#/normalize/_data.js
      -/test/boolean/is-boolean.js
      -/test/date/is-date.js
      -/test/number/is-number.js
      -/test/object/is-copy.js
      -/test/object/is-object.js
      -/test/reg-exp/is-reg-exp.js
      -/test/string/is-string.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/.npmignore b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/.npmignore
      deleted file mode 100644
      index eb09b500d63ec8..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/.npmignore
      +++ /dev/null
      @@ -1,4 +0,0 @@
      -.DS_Store
      -/node_modules
      -/.lintcache
      -/npm-debug.log
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/.travis.yml b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/.travis.yml
      deleted file mode 100644
      index a183dbcec61795..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/.travis.yml
      +++ /dev/null
      @@ -1,15 +0,0 @@
      -sudo: false # http://docs.travis-ci.com/user/workers/container-based-infrastructure/
      -language: node_js
      -node_js:
      -  - 0.10
      -  - 0.12
      -  - iojs
      -
      -before_install:
      -  - mkdir node_modules; ln -s ../ node_modules/es5-ext
      -
      -notifications:
      -  email:
      -    - medikoo+es5-ext@medikoo.com
      -
      -script: "npm test && npm run lint"
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/CHANGES b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/CHANGES
      deleted file mode 100644
      index 5d0ace5bfe2f8d..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/CHANGES
      +++ /dev/null
      @@ -1,611 +0,0 @@
      -v0.10.7  --  2015.04.22
      -* New utlitities. They're convention differs from v0.10, as they were supposed to land in v1.
      -  Still they're non breaking and start the conventions to be used in v1
      -  * Object.validateArrayLike
      -  * Object.validateArrayLikeObject
      -  * Object.validateStringifiable
      -  * Object.validateStringifiableValue
      -  * Universal utilities for array-like/iterable objects
      -    * Iterable.is
      -    * Iterable.validate
      -    * Iterable.validateObject
      -    * Iterable.forEach
      -* Fix camelToHyphen resolution, it must be absolutely reversable by hyphenToCamel
      -* Fix calculations of large numbers in Math.tanh
      -* Fix algorithm of Math.sinh
      -* Fix indexes to not use real symbols
      -* Fix length of String.fromCodePoint
      -* Fix tests of Array#copyWithin
      -* Update Travis CI configuration
      -
      -v0.10.6  --  2015.02.02
      -* Fix handling of infinite values in Math.trunc
      -* Fix handling of getters in Object.normalizeOptions
      -
      -v0.10.5  --  2015.01.20
      -* Add Function#toStringTokens
      -* Add Object.serialize and Object.unserialize
      -* Add String.randomUniq
      -* Fix Strin#camelToHyphen issue with tokens that end with digit
      -* Optimise Number.isInteger logic
      -* Improve documentation
      -* Configure lint scripts
      -* Fix spelling of LICENSE
      -
      -v0.10.4  --  2014.04.30
      -* Assure maximum spec compliance of Array.of and Array.from (thanks @mathiasbynens)
      -* Improve documentations
      -
      -v0.10.3  --  2014.04.29
      -Provide accurate iterators handling:
      -* Array.from improvements:
      -  * Assure right unicode symbols resolution when processing strings in Array.from
      -  * Rely on ES6 symbol shim and use native @@iterator Symbol if provided by environment
      -* Add methods:
      -  * Array.prototype.entries
      -  * Array.prototype.keys
      -  * Array.prototype.values
      -  * Array.prototype[@@iterator]
      -  * String.prototype[@@iterator]
      -
      -Improve documentation
      -
      -v0.10.2  --  2014.04.24
      -- Simplify and deprecate `isCallable`. It seems in ES5 based engines there are
      -  no callable objects which are `typeof obj !== 'function'`
      -- Update Array.from map callback signature (up to latest resolution of TC39)
      -- Improve documentation
      -
      -v0.10.1  --  2014.04.14
      -Bump version for npm
      -(Workaround for accidental premature publish & unpublish of v0.10.0 a while ago)
      -
      -v0.10.0  --  2014.04.13
      -Major update:
      -- All methods and function specified for ECMAScript 6 are now introduced as
      -  shims accompanied with functions through which (optionally) they can be
      -  implementend on native objects
      -- Filename convention was changed to shorter and strictly lower case names. e.g.
      -  `lib/String/prototype/starts-with` became `string/#/starts-with`
      -- Generated functions are guaranteed to have expected length
      -- Objects with null prototype (created via `Object.create(null)`) are widely
      -  supported (older version have crashed due to implied `obj.hasOwnProperty` and
      -  related invocations)
      -- Support array subclasses
      -- When handling lists do not limit its length to Uint32 range
      -- Use newly introduced `Object.eq` for strict equality in place of `Object.is`
      -- Iteration of Object have been improved so properties that were hidden or
      -  removed after iteration started are not iterated.
      -
      -Additions:
      -- `Array.isPlainArray`
      -- `Array.validArray`
      -- `Array.prototype.concat` (as updated with ES6)
      -- `Array.prototype.copyWithin` (as introduced with ES6)
      -- `Array.prototype.fill` (as introduced with ES6)
      -- `Array.prototype.filter` (as updated with ES6)
      -- `Array.prototype.findIndex` (as introduced with ES6)
      -- `Array.prototype.map` (as updated with ES6)
      -- `Array.prototype.separate`
      -- `Array.prototype.slice` (as updated with ES6)
      -- `Array.prototype.splice` (as updated with ES6)
      -- `Function.prototype.copy`
      -- `Math.acosh` (as introduced with ES6)
      -- `Math.atanh` (as introduced with ES6)
      -- `Math.cbrt` (as introduced with ES6)
      -- `Math.clz32` (as introduced with ES6)
      -- `Math.cosh` (as introduced with ES6)
      -- `Math.expm1` (as introduced with ES6)
      -- `Math.fround` (as introduced with ES6)
      -- `Math.hypot` (as introduced with ES6)
      -- `Math.imul` (as introduced with ES6)
      -- `Math.log2` (as introduced with ES6)
      -- `Math.log10` (as introduced with ES6)
      -- `Math.log1p` (as introduced with ES6)
      -- `Math.sinh` (as introduced with ES6)
      -- `Math.tanh` (as introduced with ES6)
      -- `Math.trunc` (as introduced with ES6)
      -- `Number.EPSILON` (as introduced with ES6)
      -- `Number.MIN_SAFE_INTEGER` (as introduced with ES6)
      -- `Number.MAX_SAFE_INTEGER` (as introduced with ES6)
      -- `Number.isFinite` (as introduced with ES6)
      -- `Number.isInteger` (as introduced with ES6)
      -- `Number.isSafeInteger` (as introduced with ES6)
      -- `Object.create` (with fix for V8 issue which disallows prototype turn of
      -  objects derived from null
      -- `Object.eq` - Less restrictive version of `Object.is` based on SameValueZero
      -  algorithm
      -- `Object.firstKey`
      -- `Object.keys` (as updated with ES6)
      -- `Object.mixinPrototypes`
      -- `Object.primitiveSet`
      -- `Object.setPrototypeOf` (as introduced with ES6)
      -- `Object.validObject`
      -- `RegExp.escape`
      -- `RegExp.prototype.match` (as introduced with ES6)
      -- `RegExp.prototype.replace` (as introduced with ES6)
      -- `RegExp.prototype.search` (as introduced with ES6)
      -- `RegExp.prototype.split` (as introduced with ES6)
      -- `RegExp.prototype.sticky` (as introduced with ES6)
      -- `RegExp.prototype.unicode` (as introduced with ES6)
      -- `String.fromCodePoint` (as introduced with ES6)
      -- `String.raw` (as introduced with ES6)
      -- `String.prototype.at`
      -- `String.prototype.codePointAt` (as introduced with ES6)
      -- `String.prototype.normalize` (as introduced with ES6)
      -- `String.prototype.plainReplaceAll`
      -
      -Removals:
      -- `reserved` set
      -- `Array.prototype.commonLeft`
      -- `Function.insert`
      -- `Function.remove`
      -- `Function.prototype.silent`
      -- `Function.prototype.wrap`
      -- `Object.descriptor` Move to external `d` project.
      -  See: https://github.com/medikoo/d
      -- `Object.diff`
      -- `Object.extendDeep`
      -- `Object.reduce`
      -- `Object.values`
      -- `String.prototype.trimCommonLeft`
      -
      -Renames:
      -- `Function.i` into `Function.identity`
      -- `Function.k` into `Function.constant`
      -- `Number.toInt` into `Number.toInteger`
      -- `Number.toUint` into `Number.toPosInteger`
      -- `Object.extend` into `Object.assign` (as introduced in ES 6)
      -- `Object.extendProperties` into `Object.mixin`, with improved internal
      -  handling, so it matches temporarily specified `Object.mixin` for ECMAScript 6
      -- `Object.isList` into `Object.isArrayLike`
      -- `Object.mapToArray` into `Object.toArray` (with fixed function length)
      -- `Object.toPlainObject` into `Object.normalizeOptions` (as this is the real
      -  use case where we use this function)
      -- `Function.prototype.chain` into `Function.prototype.compose`
      -- `Function.prototype.match` into `Function.prototype.spread`
      -- `String.prototype.format` into `String.formatMethod`
      -
      -Improvements & Fixes:
      -- Remove workaround for primitive values handling in object iterators
      -- `Array.from`: Update so it follows ES 6 spec
      -- `Array.prototype.compact`: filters just null and undefined values
      -  (not all falsies)
      -- `Array.prototype.eIndexOf` and `Array.prototype.eLastIndexOf`: fix position
      -  handling, improve internals
      -- `Array.prototype.find`: return undefined not null, in case of not found
      -  (follow ES 6)
      -- `Array.prototype.remove` fix function length
      -- `Error.custom`: simplify, Custom class case is addressed by outer
      -  `error-create` project -> https://github.com/medikoo/error-create
      -- `Error.isError` true only for Error instances (remove detection of host
      -  Exception objects)
      -- `Number.prototype.pad`: Normalize negative pad
      -- `Object.clear`: Handle errors same way as in `Object.assign`
      -- `Object.compact`: filters just null and undefined values (not all falsies)
      -- `Object.compare`: Take into account NaN values
      -- `Object.copy`: Split into `Object.copy` and `Object.copyDeep`
      -- `Object.isCopy`: Separate into `Object.isCopy` and `Object.isCopyDeep`, where
      -  `isCopyDeep` handles nested plain objects and plain arrays only
      -- `String.prototype.endsWith`: Adjust up to ES6 specification
      -- `String.prototype.repeat`: Adjust up to ES6 specification and improve algorithm
      -- `String.prototype.simpleReplace`: Rename into `String.prototype.plainReplace`
      -- `String.prototype.startsWith`: Adjust up to ES6 specification
      -- Update lint rules, and adjust code to that
      -- Update Travis CI configuration
      -- Remove Makefile (it's cross-env utility)
      -
      -v0.9.2  --  2013.03.11
      -Added:
      -* Array.prototype.isCopy
      -* Array.prototype.isUniq
      -* Error.CustomError
      -* Function.validFunction
      -* Object.extendDeep
      -* Object.descriptor.binder
      -* Object.safeTraverse
      -* RegExp.validRegExp
      -* String.prototype.capitalize
      -* String.prototype.simpleReplace
      -
      -Fixed:
      -* Fix Array.prototype.diff for sparse arrays
      -* Accept primitive objects as input values in Object iteration methods and
      -  Object.clear, Object.count, Object.diff, Object.extend,
      -  Object.getPropertyNames, Object.values
      -* Pass expected arguments to callbacks of Object.filter, Object.mapKeys,
      -  Object.mapToArray, Object.map
      -* Improve callable callback support in Object.mapToArray
      -
      -v0.9.1  --  2012.09.17
      -* Object.reduce - reduce for hash-like collections
      -* Accapt any callable object as callback in Object.filter, mapKeys and map
      -* Convention cleanup
      -
      -v0.9.0  --  2012.09.13
      -We're getting to real solid API
      -
      -Removed:
      -* Function#memoize - it's grown up to be external package, to be soon published
      -  as 'memoizee'
      -* String.guid - it doesn't fit es5-ext (extensions) concept, will be provided as
      -  external package
      -# Function.arguments - obsolete
      -# Function.context - obsolete
      -# Function#flip - not readable when used, so it was never used
      -# Object.clone - obsolete and confusing
      -
      -Added:
      -* String#camelToHyphen - String format convertion
      -
      -Renamed:
      -* String#dashToCamelCase -> String#hyphenToCamel
      -
      -Fixes:
      -* Object.isObject - Quote names in literals that match reserved keywords
      -  (older implementations crashed on that)
      -* String#repeat - Do not accept negative values (coerce them to 1)
      -
      -Improvements:
      -* Array#remove - Accepts many arguments, we can now remove many values at once
      -* Object iterators (forEach, map, some) - Compare function invoked with scope
      -  object bound to this
      -* Function#curry - Algorithm cleanup
      -* Object.isCopy - Support for all types, not just plain objects
      -* Object.isPlainObject - Support for cross-frame objects
      -* Do not memoize any of the functions, it shouldn't be decided internally
      -* Remove Object.freeze calls in reserved, it's not up to convention
      -* Improved documentation
      -* Better linting (hard-core approach using both JSLint mod and JSHint)
      -* Optional arguments are now documented in funtions signature
      -
      -v0.8.2  --  2012.06.22
      -Fix errors in Array's intersection and exclusion methods, related to improper
      -usage of contains method
      -
      -v0.8.1  --  2012.06.13
      -Reorganized internal logic of Function.prototype.memoize. So it's more safe now
      -and clears cache properly. Additionally preventCache option was provided.
      -
      -v0.8.0  --  2012.05.28
      -Again, major overhaul. Probably last experimental stuff was trashed, all API
      -looks more like standard extensions now.
      -
      -Changes:
      -* Turn all Object.prototype extensions into functions and move them to Object
      -namespace. We learned that extending Object.prototype is bad idea in any case.
      -* Rename Function.prototype.curry into Function.prototype.partial. This function
      -  is really doing partial application while currying is slightly different
      -  concept.
      -* Convert Function.prototype.ncurry to new implementation of
      -  Function.prototype.curry, it now serves real curry concept additionaly it
      -  covers use cases for aritize and hold, which were removed.
      -* Rename Array's peek to last, and provide support for sparse arrays in it
      -* Rename Date's monthDaysCount into daysInMonth
      -* Simplify object iterators, now order of iteration can be configured with just
      -  compareFn argument (no extra byKeys option)
      -* Rename Object.isDuplicate to Object.isCopy
      -* Rename Object.isEqual to Object.is which is compatible with future 'is'
      -  keyword
      -* Function.memoize is now Function.prototype.memoize. Additionally clear cache
      -  functionality is added, and access to original arguments object.
      -* Rename validation functions: assertNotNull to validValue, assertCallable to
      -  validCallable. validValue was moved to Object namespace. On success they now
      -  return validated value instead of true, it supports better composition.
      -  Additionally created Date.validDate and Error.validError
      -* All documentation is now held in README.md not in code files.
      -* Move guid to String namespace. All guids now start with numbers.
      -* Array.generate: fill argument is now optional
      -* Object.toArray is now Array.from (as new ES6 specification draft suggests)
      -* All methods that rely on indexOf or lastIndexOf, now rely on egal (Object.is)
      -  versions of them (eIndexOf, eLastIndexOf)
      -* Turn all get* functions that returned methods into actuall methods (get*
      -  functionality can still be achieved with help of Function.prototype.partial).
      -  So: Date.getFormat is now Date.prototype.format,
      -  Number.getPad is now Number.prototype.pad,
      -  String.getFormat is now String.prototype.format,
      -  String.getIndent is now String.prototype.indent,
      -  String.getPad is now String.prototype.pad
      -* Refactored Object.descriptor, it is now just two functions, main one and
      -  main.gs, main is for describing values, and gs for describing getters and
      -  setters. Configuration is passed with first argument as string e.g. 'ce' for
      -  configurable and enumerable. If no configuration string is provided then by
      -  default it returns configurable and writable but not enumerable for value or
      -  configurable but not enumerable for getter/setter
      -* Function.prototype.silent now returns prepared function (it was
      -  expected to be fixed for 0.7)
      -* Reserved keywords map (reserved) is now array not hash.
      -* Object.merge is now Object.extend (while former Object.extend was completely
      -  removed) - 'extend' implies that we change object, not creating new one (as
      -  'merge' may imply). Similarily Object.mergeProperties was renamed to
      -  Object.extendProperties
      -* Position argument support in Array.prototype.contains and
      -  String.prototype.contains (so it follows ES6 specification draft)
      -* endPosition argument support in String.prototype.endsWith and fromPosition
      -  argument support in String.prototype.startsWith (so it follows ES6
      -  specification draft)
      -* Better and cleaner String.prototype.indent implementation. No default value
      -  for indent string argument, optional nest value (defaults to 1), remove
      -  nostart argument
      -* Correct length values for most methods (so they reflect length of similar
      -  methods in standard)
      -* Length argument is now optional in number and string pad methods.
      -* Improve arguments validation in general, so it adheres to standard conventions
      -* Fixed format of package.json
      -
      -Removed methods and functions:
      -* Object.prototype.slice - Object is not ordered collection, so slice doesn't
      -  make sense.
      -* Function's rcurry, rncurry, s - too cumbersome for JS, not many use cases for
      -  that
      -* Function.prototype.aritize and Function.prototype.hold - same functionality
      -  can be achieved with new Function.prototype.curry
      -* Function.prototype.log - provided more generic Function.prototype.wrap for
      -  same use case
      -* getNextIdGenerator - no use case for that (String.guid should be used if
      -  needed)
      -* Object.toObject - Can be now acheived with Object(validValue(x))
      -* Array.prototype.someValue - no real use case (personally used once and
      -  case was already controversial)
      -* Date.prototype.duration - moved to external package
      -* Number.getAutoincrement - No real use case
      -* Object.prototype.extend, Object.prototype.override,
      -  Object.prototype.plainCreate, Object.prototype.plainExtend - It was probably
      -  too complex, same should be achieved just with Object.create,
      -  Object.descriptor and by saving references to super methods in local scope.
      -* Object.getCompareBy - Functions should be created individually for each use
      -  case
      -* Object.get, Object.getSet, Object.set, Object.unset - Not many use cases and
      -  same can be easily achieved with simple inline function
      -* String.getPrefixWith - Not real use case for something that can be easily
      -  achieved with '+' operator
      -* Object.isPrimitive - It's just negation of Object.isObject
      -* Number.prototype.isLess, Number.prototype.isLessOrEqual - they shouldn't be in
      -  Number namespace and should rather be addressed with simple inline functions.
      -* Number.prototype.subtract - Should rather be addressed with simple inline
      -  function
      -
      -New methods and functions:
      -* Array.prototype.lastIndex - Returns last declared index in array
      -* String.prototype.last - last for strings
      -* Function.prototype.wrap - Wrap function with other, it allows to specify
      -  before and after behavior transform return value or prevent original function
      -  from being called.
      -* Math.sign - Returns sign of a number (already in ES6 specification draft)
      -* Number.toInt - Converts value to integer (already in ES6 specification draft)
      -* Number.isNaN - Returns true if value is NaN (already in ES6 specification
      -  draft)
      -* Number.toUint - Converts value to unsigned integer
      -* Number.toUint32 - Converts value to 32bit unsigned integer
      -* Array.prototype.eIndexOf, eLastIndexOf - Egal version (that uses Object.is) of
      -  standard methods (all methods that were using native indexOf or lastIndexOf
      -  now uses eIndexOf and elastIndexOf respectively)
      -* Array.of - as it's specified for ES6
      -
      -Fixes:
      -* Fixed binarySearch so it always returns valid list index
      -* Object.isList - it failed on lists that are callable (e.g. NodeList in Nitro
      -  engine)
      -* Object.map now supports third argument for callback
      -
      -v0.7.1  --  2012.01.05
      -New methods:
      -* Array.prototype.firstIndex - returns first valid index of array (for
      -	sparse arrays it may not be '0'
      -
      -Improvements:
      -* Array.prototype.first - now returns value for index returned by firstIndex
      -* Object.prototype.mapToArray - can be called without callback, then array of
      -	key-value pairs is returned
      -
      -Fixes
      -* Array.prototype.forEachRight, object's length read through UInt32 conversion
      -
      -v0.7.0  --  2011.12.27
      -Major update.
      -Stepped back from experimental ideas and introduced more standard approach
      -taking example from how ES5 methods and functions are designed. One exceptions
      -is that, we don’t refrain from declaring methods for Object.prototype - it’s up
      -to developer whether how he decides to use it in his context (as function or as
      -method).
      -
      -In general:
      -* Removed any method 'functionalization' and functionalize method itself.
      -	es5-ext declares plain methods, which can be configured to work as functions
      -	with call.bind(method) - see documentation.
      -* Removed separation of Object methods for ES5 (with descriptors) and
      -	ES3 (plain) - we're following ES5 idea on that, some methods are intended just
      -	for enumerable properties and some are for all properties, all are declared
      -	for Object.prototype
      -* Removed separation of Array generic (collected in List folder) and not generic
      -	methods (collected in Array folder). Now all methods are generic and are in
      -	Array/prototype folder. This separation also meant, that methods in Array are
      -	usually destructive. We don’t do that separation now, there’s generally no use
      -	case for destructive iterators, we should be fine with one version of each
      -	method, (same as ES5 is fine with  e.g. one, non destructive 'filter' method)
      -* Folder structure resembles tree of native ES5 Objects
      -* All methods are written with ES5 conventions in mind, it means that most
      -	methods are generic and can be run on any object. In more detail:
      -	** Array.prototype and Object.prototype methods can be run on any object (any
      -		not null or undefined value),
      -	** Date.prototype methods should be called only on Date instances.
      -	** Function.prototype methods can be called on any callable objects (not
      -		necessarily functions)
      -	** Number.prototype & String.prototype methods can be called on any value, in
      -		case of Number it it’ll be degraded to number, in case of string it’ll be
      -		degraded to string.
      -* Travis CI support (only for Node v0.6 branch, as v0.4 has buggy V8 version)
      -
      -Improvements for existing functions and methods:
      -* Function.memoize (was Function.cache) is now fully generic, can operate on any
      -	type of arguments and it’s NaN safe (all NaN objects are considered equal)
      -* Method properties passed to Object.prototype.extend or
      -	Object.prototype.override can aside of _super optionally take prototype object
      -	via _proto argument
      -* Object iterators: forEach, mapToArray and every can now iterate in specified
      -	order
      -* pluck, invoke and other functions that return reusable functions or methods
      -	have now their results memoized.
      -
      -New methods:
      -* Global: assertNotNull, getNextIdGenerator, guid, isEqual, isPrimitive,
      -	toObject
      -* Array: generate
      -* Array.prototype: binarySearch, clear, contains, diff, exclusion, find, first,
      -	forEachRight, group, indexesOf, intersection, remove, someRight, someValue
      -* Boolean: isBoolean
      -* Date: isDate
      -* Function: arguments, context, insert, isArguments, remove
      -* Function.prototype: not, silent
      -* Number: getAutoincrement, isNumber
      -* Number.prototype: isLessOrEqual, isLess, subtract
      -* Object: assertCallable, descriptor (functions for clean descriptors),
      -	getCompareBy, isCallable, isObject
      -* Object.prototype: clone (real clone), compact, count, diff, empty,
      -	getPropertyNames, get, keyOf, mapKeys, override, plainCreate, plainExtend,
      -	slice, some, unset
      -* RegExp: isRegExp
      -* String: getPrefixWith, isString
      -* String.prototype: caseInsensitiveCompare, contains, isNumeric
      -
      -Renamed methods:
      -* Date.clone -> Date.prototype.copy
      -* Date.format -> Date.getFormat
      -* Date/day/floor -> Date.prototype.floorDay
      -* Date/month/floor -> Date.prototype.floorMonth
      -* Date/month/year -> Date.prototype.floorYear
      -* Function.cache -> Function.memoize
      -* Function.getApplyArg -> Function.prototype.match
      -* Function.sequence -> Function.prototype.chain
      -* List.findSameStartLength -> Array.prototype.commonLeft
      -* Number.pad -> Number.getPad
      -* Object/plain/clone -> Object.prototype.copy
      -* Object/plain/elevate -> Object.prototype.flatten
      -* Object/plain/same -> Object.prototype.isDuplicate
      -* Object/plain/setValue -> Object.getSet
      -* String.format -> String.getFormat
      -* String.indent -> String.getIndent
      -* String.pad -> String.getPad
      -* String.trimLeftStr -> String.prototype.trimCommonLeft
      -* Object.merge -> Object.prototype.mergeProperties
      -* Object/plain/pluck -> Object.prototype.get
      -* Array.clone is now Array.prototype.copy and can be used also on any array-like
      -	objects
      -* List.isList -> Object.isList
      -* List.toArray -> Object.prototype.toArray
      -* String/convert/dashToCamelCase -> String.prototype.dashToCamelCase
      -
      -Removed methods:
      -* Array.compact - removed destructive version (that operated on same array), we
      -	have now non destructive version as Array.prototype.compact.
      -* Function.applyBind -> use apply.bind directly
      -* Function.bindBind -> use bind.bind directly
      -* Function.callBind -> use call.bind directly
      -* Fuction.clone -> no valid use case
      -* Function.dscope -> controversial approach, shouldn’t be considered seriously
      -* Function.functionalize -> It was experimental but standards are standards
      -* List/sort/length -> It can be easy obtained by Object.getCompareBy(‘length’)
      -* List.concat -> Concat’s for array-like’s makes no sense, just convert to array
      -	first
      -* List.every -> Use Array.prototype.every directly
      -* List.filter -> Use Array.prototype.filter directly
      -* List.forEach -> User Array.prototype.forEach directly
      -* List.isListObject -> No valid use case, do: isList(list) && (typeof list ===
      -	'object’)
      -* List.map -> Use Array.prototype.map directly
      -* List.reduce -> Use Array.prototype.reduce directly
      -* List.shiftSame -> Use Array.prototype.commonLeft and do slice
      -* List.slice -> Use Array.prototype.slice directly
      -* List.some -> Use Array.prototype.some directly
      -* Object.bindMethods -> it was version that considered descriptors, we have now
      -	Object.prototype.bindMethods which operates only on enumerable properties
      -* Object.every -> version that considered all properties, we have now
      -	Object.prototype.every which iterates only enumerables
      -* Object.invoke -> no use case
      -* Object.mergeDeep -> no use case
      -* Object.pluck -> no use case
      -* Object.same -> it considered descriptors, now there’s only Object.isDuplicate
      -	which compares only enumerable properties
      -* Object.sameType -> no use case
      -* Object.toDescriptor and Object.toDescriptors -> replaced by much nicer
      -	Object.descriptor functions
      -* Object/plain/link -> no use case (it was used internally only by
      -	Object/plain/merge)
      -* Object/plain/setTrue -> now easily configurable by more universal
      -	Object.getSet(true)
      -* String.trimRightStr -> Eventually String.prototype.trimCommonRight will be
      -	added
      -
      -v0.6.3  --  2011.12.12
      -* Cleared npm warning for misnamed property in package.json
      -
      -v0.6.2  --  2011.08.12
      -* Calling String.indent without scope (global scope then) now treated as calling
      -  it with null scope, it allows more direct invocations when using default nest
      -  string: indent().call(str, nest)
      -
      -v0.6.1  --  2011.08.08
      -* Added TAD test suite to devDependencies, configured test commands.
      -  Tests can be run with 'make test' or 'npm test'
      -
      -v0.6.0  --  2011.08.07
      -New methods:
      -* Array: clone, compact (in place)
      -* Date: format, duration, clone, monthDaysCount, day.floor, month.floor,
      -  year.floor
      -* Function: getApplyArg, , ncurry, rncurry, hold, cache, log
      -* List: findSameStartLength, shiftSame, peek, isListObject
      -* Number: pad
      -* Object: sameType, toString, mapToArray, mergeDeep, toDescriptor,
      -  toDescriptors, invoke
      -* String: startsWith, endsWith, indent, trimLeftStr, trimRightStr, pad, format
      -
      -Fixed:
      -* Object.extend does now prototypal extend as exptected
      -* Object.merge now tries to overwrite only configurable properties
      -* Function.flip
      -
      -Improved:
      -* Faster List.toArray
      -* Better global retrieval
      -* Functionalized all Function methods
      -* Renamed bindApply and bindCall to applyBind and callBind
      -* Removed Function.inherit (as it's unintuitive curry clone)
      -* Straightforward logic in Function.k
      -* Fixed naming of some tests files (letter case issue)
      -* Renamed Function.saturate into Function.lock
      -* String.dashToCamelCase digits support
      -* Strings now considered as List objects
      -* Improved List.compact
      -* Concise logic for List.concat
      -* Test wit TAD in clean ES5 context
      -
      -v0.5.1  --  2011.07.11
      -* Function's bindBind, bindCall and bindApply now more versatile
      -
      -v0.5.0  --  2011.07.07
      -* Removed Object.is and List.apply
      -* Renamed Object.plain.is to Object.plain.isPlainObject (keep naming convention
      -  consistent)
      -* Improved documentation
      -
      -v0.4.0  --  2011.07.05
      -* Take most functions on Object to Object.plain to keep them away from object
      -  descriptors
      -* Object functions with ES5 standard in mind (object descriptors)
      -
      -v0.3.0  --  2011.06.24
      -* New functions
      -* Consistent file naming (dash instead of camelCase)
      -
      -v0.2.1  --  2011.05.28
      -* Renamed Functions.K and Function.S to to lowercase versions (use consistent
      -  naming)
      -
      -v0.2.0  --  2011.05.28
      -* Renamed Array folder to List (as its generic functions for array-like objects)
      -* Added Makefile
      -* Added various functions
      -
      -v0.1.0  --  2011.05.24
      -* Initial version
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/README.md b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/README.md
      deleted file mode 100644
      index 11d8a343d57f1f..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/README.md
      +++ /dev/null
      @@ -1,993 +0,0 @@
      -# es5-ext
      -## ECMAScript 5 extensions
      -### (with respect to ECMAScript 6 standard)
      -
      -Shims for upcoming ES6 standard and other goodies implemented strictly with ECMAScript conventions in mind.
      -
      -It's designed to be used in compliant ECMAScript 5 or ECMAScript 6 environments. Older environments are not supported, although most of the features should work with correct ECMAScript 5 shim on board.
      -
      -When used in ECMAScript 6 environment, native implementation (if valid) takes precedence over shims.
      -
      -### Installation
      -
      -	$ npm install es5-ext
      -	
      -To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)
      -
      -### Usage
      -
      -#### ECMAScript 6 features
      -
      -You can force ES6 features to be implemented in your environment, e.g. following will assign `from` function to `Array` (only if it's not implemented already).
      -
      -```javascript
      -require('es5-ext/array/from/implement');
      -Array.from('foo'); // ['f', 'o', 'o']
      -```
      -
      -You can also access shims directly, without fixing native objects. Following will return native `Array.from` if it's available and fallback to shim if it's not.
      -
      -```javascript
      -var aFrom = require('es5-ext/array/from');
      -aFrom('foo'); // ['f', 'o', 'o']
      -```
      -
      -If you want to use shim unconditionally (even if native implementation exists) do:
      -
      -```javascript
      -var aFrom = require('es5-ext/array/from/shim');
      -aFrom('foo'); // ['f', 'o', 'o']
      -```
      -
      -##### List of ES6 shims
      -
      -It's about properties introduced with ES6 and those that have been updated in new spec.
      -
      -- `Array.from` -> `require('es5-ext/array/from')`
      -- `Array.of` -> `require('es5-ext/array/of')`
      -- `Array.prototype.concat` -> `require('es5-ext/array/#/concat')`
      -- `Array.prototype.copyWithin` -> `require('es5-ext/array/#/copy-within')`
      -- `Array.prototype.entries` -> `require('es5-ext/array/#/entries')`
      -- `Array.prototype.fill` -> `require('es5-ext/array/#/fill')`
      -- `Array.prototype.filter` -> `require('es5-ext/array/#/filter')`
      -- `Array.prototype.find` -> `require('es5-ext/array/#/find')`
      -- `Array.prototype.findIndex` -> `require('es5-ext/array/#/find-index')`
      -- `Array.prototype.keys` -> `require('es5-ext/array/#/keys')`
      -- `Array.prototype.map` -> `require('es5-ext/array/#/map')`
      -- `Array.prototype.slice` -> `require('es5-ext/array/#/slice')`
      -- `Array.prototype.splice` -> `require('es5-ext/array/#/splice')`
      -- `Array.prototype.values` -> `require('es5-ext/array/#/values')`
      -- `Array.prototype[@@iterator]` -> `require('es5-ext/array/#/@@iterator')`
      -- `Math.acosh` -> `require('es5-ext/math/acosh')`
      -- `Math.asinh` -> `require('es5-ext/math/asinh')`
      -- `Math.atanh` -> `require('es5-ext/math/atanh')`
      -- `Math.cbrt` -> `require('es5-ext/math/cbrt')`
      -- `Math.clz32` -> `require('es5-ext/math/clz32')`
      -- `Math.cosh` -> `require('es5-ext/math/cosh')`
      -- `Math.exmp1` -> `require('es5-ext/math/expm1')`
      -- `Math.fround` -> `require('es5-ext/math/fround')`
      -- `Math.hypot` -> `require('es5-ext/math/hypot')`
      -- `Math.imul` -> `require('es5-ext/math/imul')`
      -- `Math.log1p` -> `require('es5-ext/math/log1p')`
      -- `Math.log2` -> `require('es5-ext/math/log2')`
      -- `Math.log10` -> `require('es5-ext/math/log10')`
      -- `Math.sign` -> `require('es5-ext/math/sign')`
      -- `Math.signh` -> `require('es5-ext/math/signh')`
      -- `Math.tanh` -> `require('es5-ext/math/tanh')`
      -- `Math.trunc` -> `require('es5-ext/math/trunc')`
      -- `Number.EPSILON` -> `require('es5-ext/number/epsilon')`
      -- `Number.MAX_SAFE_INTEGER` -> `require('es5-ext/number/max-safe-integer')`
      -- `Number.MIN_SAFE_INTEGER` -> `require('es5-ext/number/min-safe-integer')`
      -- `Number.isFinite` -> `require('es5-ext/number/is-finite')`
      -- `Number.isInteger` -> `require('es5-ext/number/is-integer')`
      -- `Number.isNaN` -> `require('es5-ext/number/is-nan')`
      -- `Number.isSafeInteger` -> `require('es5-ext/number/is-safe-integer')`
      -- `Object.assign` -> `require('es5-ext/object/assign')`
      -- `Object.keys` -> `require('es5-ext/object/keys')`
      -- `Object.setPrototypeOf` -> `require('es5-ext/object/set-prototype-of')`
      -- `RegExp.prototype.match` -> `require('es5-ext/reg-exp/#/match')`
      -- `RegExp.prototype.replace` -> `require('es5-ext/reg-exp/#/replace')`
      -- `RegExp.prototype.search` -> `require('es5-ext/reg-exp/#/search')`
      -- `RegExp.prototype.split` -> `require('es5-ext/reg-exp/#/split')`
      -- `RegExp.prototype.sticky` -> Implement with `require('es5-ext/reg-exp/#/sticky/implement')`, use as function with `require('es5-ext/reg-exp/#/is-sticky')`
      -- `RegExp.prototype.unicode` -> Implement with `require('es5-ext/reg-exp/#/unicode/implement')`, use as function with `require('es5-ext/reg-exp/#/is-unicode')`
      -- `String.fromCodePoint` -> `require('es5-ext/string/from-code-point')`
      -- `String.raw` -> `require('es5-ext/string/raw')`
      -- `String.prototype.codePointAt` -> `require('es5-ext/string/#/code-point-at')`
      -- `String.prototype.contains` -> `require('es5-ext/string/#/contains')`
      -- `String.prototype.endsWith` -> `require('es5-ext/string/#/ends-with')`
      -- `String.prototype.normalize` -> `require('es5-ext/string/#/normalize')`
      -- `String.prototype.repeat` -> `require('es5-ext/string/#/repeat')`
      -- `String.prototype.startsWith` -> `require('es5-ext/string/#/starts-with')`
      -- `String.prototype[@@iterator]` -> `require('es5-ext/string/#/@@iterator')`
      -
      -#### Non ECMAScript standard features
      -
      -__es5-ext__ provides also other utils, and implements them as if they were proposed for a standard. It mostly offers methods (not functions) which can directly be assigned to native prototypes:
      -
      -```javascript
      -Object.defineProperty(Function.prototype, 'partial', { value: require('es5-ext/function/#/partial'),
      -  configurable: true, enumerable: false, writable: true });
      -Object.defineProperty(Array.prototype, 'flatten', { value: require('es5-ext/array/#/flatten'),
      -  configurable: true, enumerable: false, writable: true });
      -Object.defineProperty(String.prototype, 'capitalize', { value: require('es5-ext/string/#/capitalize'),
      -  configurable: true, enumerable: false, writable: true });
      -```
      -
      -See [es5-extend](https://github.com/wookieb/es5-extend#es5-extend), a great utility that automatically will extend natives for you. 
      -
      -__Important:__ Remember to __not__ extend natives in scope of generic reusable packages (e.g. ones you intend to publish to npm). Extending natives is fine __only__ if you're the _owner_ of the global scope, so e.g. in final project you lead development of.
      -
      -When you're in situation when native extensions are not good idea, then you should use methods indirectly:
      -
      -
      -```javascript
      -var flatten = require('es5-ext/array/#/flatten');
      -
      -flatten.call([1, [2, [3, 4]]]); // [1, 2, 3, 4]
      -```
      -
      -for better convenience you can turn methods into functions:
      -
      -
      -```javascript
      -var call = Function.prototype.call
      -var flatten = call.bind(require('es5-ext/array/#/flatten'));
      -
      -flatten([1, [2, [3, 4]]]); // [1, 2, 3, 4]
      -```
      -
      -You can configure custom toolkit (like [underscorejs](http://underscorejs.org/)), and use it throughout your application
      -
      -```javascript
      -var util = {};
      -util.partial = call.bind(require('es5-ext/function/#/partial'));
      -util.flatten = call.bind(require('es5-ext/array/#/flatten'));
      -util.startsWith = call.bind(require('es5-ext/string/#/starts-with'));
      -
      -util.flatten([1, [2, [3, 4]]]); // [1, 2, 3, 4]
      -```
      -
      -As with native ones most methods are generic and can be run on any type of object.
      -
      -## API
      -
      -### Global extensions
      -
      -#### global _(es5-ext/global)_
      -
      -Object that represents global scope
      -
      -### Array Constructor extensions
      -
      -#### from(arrayLike[, mapFn[, thisArg]]) _(es5-ext/array/from)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.from).  
      -Returns array representation of _iterable_ or _arrayLike_. If _arrayLike_ is an instance of array, its copy is returned.
      -
      -#### generate([length[, …fill]]) _(es5-ext/array/generate)_
      -
      -Generate an array of pre-given _length_ built of repeated arguments.
      -
      -#### isPlainArray(x) _(es5-ext/array/is-plain-array)_
      -
      -Returns true if object is plain array (not instance of one of the Array's extensions).
      -
      -#### of([…items]) _(es5-ext/array/of)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.of).  
      -Create an array from given arguments.
      -
      -#### toArray(obj) _(es5-ext/array/to-array)_
      -
      -Returns array representation of `obj`. If `obj` is already an array, `obj` is returned back.
      -
      -#### validArray(obj) _(es5-ext/array/valid-array)_
      -
      -Returns `obj` if it's an array, otherwise throws `TypeError`
      -
      -### Array Prototype extensions
      -
      -#### arr.binarySearch(compareFn) _(es5-ext/array/#/binary-search)_
      -
      -In __sorted__ list search for index of item for which _compareFn_ returns value closest to _0_.  
      -It's variant of binary search algorithm
      -
      -#### arr.clear() _(es5-ext/array/#/clear)_
      -
      -Clears the array
      -
      -#### arr.compact() _(es5-ext/array/#/compact)_
      -
      -Returns a copy of the context with all non-values (`null` or `undefined`) removed.
      -
      -#### arr.concat() _(es5-ext/array/#/concat)_
      -
      -[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.concat).  
      -ES6's version of `concat`. Supports `isConcatSpreadable` symbol, and returns array of same type as the context.
      -
      -#### arr.contains(searchElement[, position]) _(es5-ext/array/#/contains)_
      -
      -Whether list contains the given value.
      -
      -#### arr.copyWithin(target, start[, end]) _(es5-ext/array/#/copy-within)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.copywithin).  
      -
      -#### arr.diff(other) _(es5-ext/array/#/diff)_
      -
      -Returns the array of elements that are present in context list but not present in other list.
      -
      -#### arr.eIndexOf(searchElement[, fromIndex]) _(es5-ext/array/#/e-index-of)_
      -
      -_egal_ version of `indexOf` method. [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) logic is used for comparision
      -
      -#### arr.eLastIndexOf(searchElement[, fromIndex]) _(es5-ext/array/#/e-last-index-of)_
      -
      -_egal_ version of `lastIndexOf` method. [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) logic is used for comparision
      -
      -#### arr.entries() _(es5-ext/array/#/entries)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.entries).  
      -Returns iterator object, which traverses the array. Each value is represented with an array, where first value is an index and second is corresponding to index value.
      -
      -#### arr.exclusion([…lists]]) _(es5-ext/array/#/exclusion)_
      -
      -Returns the array of elements that are found only in one of the lists (either context list or list provided in arguments).
      -
      -#### arr.fill(value[, start, end]) _(es5-ext/array/#/fill)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.fill).  
      -
      -#### arr.filter(callback[, thisArg]) _(es5-ext/array/#/filter)_
      -
      -[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.filter).  
      -ES6's version of `filter`, returns array of same type as the context.
      -
      -#### arr.find(predicate[, thisArg]) _(es5-ext/array/#/find)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.find).  
      -Return first element for which given function returns true
      -
      -#### arr.findIndex(predicate[, thisArg]) _(es5-ext/array/#/find-index)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.findindex).  
      -Return first index for which given function returns true
      -
      -#### arr.first() _(es5-ext/array/#/first)_
      -
      -Returns value for first defined index
      -
      -#### arr.firstIndex() _(es5-ext/array/#/first-index)_
      -
      -Returns first declared index of the array
      -
      -#### arr.flatten() _(es5-ext/array/#/flatten)_
      -
      -Returns flattened version of the array
      -
      -#### arr.forEachRight(cb[, thisArg]) _(es5-ext/array/#/for-each-right)_
      -
      -`forEach` starting from last element
      -
      -#### arr.group(cb[, thisArg]) _(es5-ext/array/#/group)_
      -
      -Group list elements by value returned by _cb_ function
      -
      -#### arr.indexesOf(searchElement[, fromIndex]) _(es5-ext/array/#/indexes-of)_
      -
      -Returns array of all indexes of given value
      -
      -#### arr.intersection([…lists]) _(es5-ext/array/#/intersection)_
      -
      -Computes the array of values that are the intersection of all lists (context list and lists given in arguments)
      -
      -#### arr.isCopy(other) _(es5-ext/array/#/is-copy)_
      -
      -Returns true if both context and _other_ lists have same content
      -
      -#### arr.isUniq() _(es5-ext/array/#/is-uniq)_
      -
      -Returns true if all values in array are unique
      -
      -#### arr.keys() _(es5-ext/array/#/keys)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.keys).  
      -Returns iterator object, which traverses all array indexes.
      -
      -#### arr.last() _(es5-ext/array/#/last)_
      -
      -Returns value of last defined index
      -
      -#### arr.lastIndex() _(es5-ext/array/#/last)_
      -
      -Returns last defined index of the array
      -
      -#### arr.map(callback[, thisArg]) _(es5-ext/array/#/map)_
      -
      -[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.map).  
      -ES6's version of `map`, returns array of same type as the context.
      -
      -#### arr.remove(value[, …valuen]) _(es5-ext/array/#/remove)_
      -
      -Remove values from the array
      -
      -#### arr.separate(sep) _(es5-ext/array/#/separate)_
      -
      -Returns array with items separated with `sep` value
      -
      -#### arr.slice(callback[, thisArg]) _(es5-ext/array/#/slice)_
      -
      -[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.slice).  
      -ES6's version of `slice`, returns array of same type as the context.
      -
      -#### arr.someRight(cb[, thisArg]) _(es5-ext/array/#/someRight)_
      -
      -`some` starting from last element
      -
      -#### arr.splice(callback[, thisArg]) _(es5-ext/array/#/splice)_
      -
      -[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.splice).  
      -ES6's version of `splice`, returns array of same type as the context.
      -
      -#### arr.uniq() _(es5-ext/array/#/uniq)_
      -
      -Returns duplicate-free version of the array
      -
      -#### arr.values() _(es5-ext/array/#/values)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.values).  
      -Returns iterator object which traverses all array values.
      -
      -#### arr[@@iterator] _(es5-ext/array/#/@@iterator)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype-@@iterator).  
      -Returns iterator object which traverses all array values.
      -
      -### Boolean Constructor extensions
      -
      -#### isBoolean(x) _(es5-ext/boolean/is-boolean)_
      -
      -Whether value is boolean
      -
      -### Date Constructor extensions
      -
      -#### isDate(x) _(es5-ext/date/is-date)_
      -
      -Whether value is date instance
      -
      -#### validDate(x) _(es5-ext/date/valid-date)_
      -
      -If given object is not date throw TypeError in other case return it.
      -
      -### Date Prototype extensions
      -
      -#### date.copy(date) _(es5-ext/date/#/copy)_
      -
      -Returns a copy of the date object
      -
      -#### date.daysInMonth() _(es5-ext/date/#/days-in-month)_
      -
      -Returns number of days of date's month
      -
      -#### date.floorDay() _(es5-ext/date/#/floor-day)_
      -
      -Sets the date time to 00:00:00.000
      -
      -#### date.floorMonth() _(es5-ext/date/#/floor-month)_
      -
      -Sets date day to 1 and date time to 00:00:00.000
      -
      -#### date.floorYear() _(es5-ext/date/#/floor-year)_
      -
      -Sets date month to 0, day to 1 and date time to 00:00:00.000
      -
      -#### date.format(pattern) _(es5-ext/date/#/format)_
      -
      -Formats date up to given string. Supported patterns:
      -
      -* `%Y` - Year with century, 1999, 2003
      -* `%y` - Year without century, 99, 03
      -* `%m` - Month, 01..12
      -* `%d` - Day of the month 01..31
      -* `%H` - Hour (24-hour clock), 00..23
      -* `%M` - Minute, 00..59
      -* `%S` - Second, 00..59
      -* `%L` - Milliseconds, 000..999
      -
      -### Error Constructor extensions
      -
      -#### custom(message/*, code, ext*/) _(es5-ext/error/custom)_
      -
      -Creates custom error object, optinally extended with `code` and other extension properties (provided with `ext` object)  
      -
      -#### isError(x) _(es5-ext/error/is-error)_
      -
      -Whether value is an error (instance of `Error`).  
      -
      -#### validError(x) _(es5-ext/error/valid-error)_
      -
      -If given object is not error throw TypeError in other case return it.
      -
      -### Error Prototype extensions
      -
      -#### err.throw() _(es5-ext/error/#/throw)_
      -
      -Throws error
      -
      -### Function Constructor extensions
      -
      -Some of the functions were inspired by [Functional JavaScript](http://osteele.com/sources/javascript/functional/) project by Olivier Steele
      -
      -#### constant(x) _(es5-ext/function/constant)_
      -
      -Returns a constant function that returns pregiven argument
      -
      -_k(x)(y)  =def  x_
      -
      -#### identity(x) _(es5-ext/function/identity)_
      -
      -Identity function. Returns first argument
      -
      -_i(x)  =def  x_
      -
      -#### invoke(name[, …args]) _(es5-ext/function/invoke)_
      -
      -Returns a function that takes an object as an argument, and applies object's
      -_name_ method to arguments.  
      -_name_ can be name of the method or method itself.
      -
      -_invoke(name, …args)(object, …args2)  =def  object\[name\]\(…args, …args2\)_
      -
      -#### isArguments(x) _(es5-ext/function/is-arguments)_
      -
      -Whether value is arguments object
      -
      -#### isFunction(arg) _(es5-ext/function/is-function)_
      -
      -Wether value is instance of function
      -
      -#### noop() _(es5-ext/function/noop)_
      -
      -No operation function
      -
      -#### pluck(name) _(es5-ext/function/pluck)_
      -
      -Returns a function that takes an object, and returns the value of its _name_
      -property
      -
      -_pluck(name)(obj)  =def  obj[name]_
      -
      -#### validFunction(arg) _(es5-ext/function/valid-function)_
      -
      -If given object is not function throw TypeError in other case return it.
      -
      -### Function Prototype extensions
      -
      -Some of the methods were inspired by [Functional JavaScript](http://osteele.com/sources/javascript/functional/) project by Olivier Steele
      -
      -#### fn.compose([…fns]) _(es5-ext/function/#/compose)_
      -
      -Applies the functions in reverse argument-list order.
      -
      -_f1.compose(f2, f3, f4)(…args)  =def  f1(f2(f3(f4(…arg))))_
      -
      -#### fn.copy() _(es5-ext/function/#/copy)_
      -
      -Produces copy of given function
      -
      -#### fn.curry([n]) _(es5-ext/function/#/curry)_
      -
      -Invoking the function returned by this function only _n_ arguments are passed to the underlying function. If the underlying function is not saturated, the result is a function that passes all its arguments to the underlying function.  
      -If _n_ is not provided then it defaults to context function length
      -
      -_f.curry(4)(arg1, arg2)(arg3)(arg4)  =def  f(arg1, args2, arg3, arg4)_
      -
      -#### fn.lock([…args]) _(es5-ext/function/#/lock)_
      -
      -Returns a function that applies the underlying function to _args_, and ignores its own arguments.
      -
      -_f.lock(…args)(…args2)  =def  f(…args)_
      -
      -_Named after it's counterpart in Google Closure_
      -
      -#### fn.not() _(es5-ext/function/#/not)_
      -
      -Returns a function that returns boolean negation of value returned by underlying function.
      -
      -_f.not()(…args)  =def !f(…args)_
      -
      -#### fn.partial([…args]) _(es5-ext/function/#/partial)_
      -
      -Returns a function that when called will behave like context function called with initially passed arguments. If more arguments are suplilied, they are appended to initial args.
      -
      -_f.partial(…args1)(…args2)  =def  f(…args1, …args2)_
      -
      -#### fn.spread() _(es5-ext/function/#/spread)_
      -
      -Returns a function that applies underlying function with first list argument
      -
      -_f.match()(args)  =def  f.apply(null, args)_
      -
      -#### fn.toStringTokens() _(es5-ext/function/#/to-string-tokens)_
      -
      -Serializes function into two (arguments and body) string tokens. Result is plain object with `args` and `body` properties.
      -
      -### Math extensions
      -
      -#### acosh(x) _(es5-ext/math/acosh)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.acosh).  
      -
      -#### asinh(x) _(es5-ext/math/asinh)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.asinh).  
      -
      -#### atanh(x) _(es5-ext/math/atanh)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.atanh).  
      -
      -#### cbrt(x) _(es5-ext/math/cbrt)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cbrt).  
      -
      -#### clz32(x) _(es5-ext/math/clz32)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.clz32).  
      -
      -#### cosh(x) _(es5-ext/math/cosh)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cosh).  
      -
      -#### expm1(x) _(es5-ext/math/expm1)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.expm1).  
      -
      -#### fround(x) _(es5-ext/math/fround)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.fround).  
      -
      -#### hypot([…values]) _(es5-ext/math/hypot)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.hypot).  
      -
      -#### imul(x, y) _(es5-ext/math/imul)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.imul).  
      -
      -#### log1p(x) _(es5-ext/math/log1p)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log1p).  
      -
      -#### log2(x) _(es5-ext/math/log2)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log2).  
      -
      -#### log10(x) _(es5-ext/math/log10)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log10).  
      -
      -#### sign(x) _(es5-ext/math/sign)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sign).  
      -
      -#### sinh(x) _(es5-ext/math/sinh)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sinh).  
      -
      -#### tanh(x) _(es5-ext/math/tanh)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.tanh).  
      -
      -#### trunc(x) _(es5-ext/math/trunc)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.trunc).  
      -
      -### Number Constructor extensions
      -
      -#### EPSILON _(es5-ext/number/epsilon)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.epsilon).  
      -
      -The difference between 1 and the smallest value greater than 1 that is representable as a Number value, which is approximately 2.2204460492503130808472633361816 x 10-16.
      -
      -#### isFinite(x) _(es5-ext/number/is-finite)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite).  
      -Whether value is finite. Differs from global isNaN that it doesn't do type coercion.
      -
      -#### isInteger(x) _(es5-ext/number/is-integer)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isinteger).  
      -Whether value is integer.
      -
      -#### isNaN(x) _(es5-ext/number/is-nan)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isnan).  
      -Whether value is NaN. Differs from global isNaN that it doesn't do type coercion.
      -
      -#### isNumber(x) _(es5-ext/number/is-number)_
      -
      -Whether given value is number
      -
      -#### isSafeInteger(x) _(es5-ext/number/is-safe-integer)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.issafeinteger).  
      -
      -#### MAX_SAFE_INTEGER _(es5-ext/number/max-safe-integer)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.maxsafeinteger).  
      -The value of Number.MAX_SAFE_INTEGER is 9007199254740991.
      -
      -#### MIN_SAFE_INTEGER _(es5-ext/number/min-safe-integer)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.minsafeinteger).  
      -The value of Number.MIN_SAFE_INTEGER is -9007199254740991 (253-1).
      -
      -#### toInteger(x) _(es5-ext/number/to-integer)_
      -
      -Converts value to integer
      -
      -#### toPosInteger(x) _(es5-ext/number/to-pos-integer)_
      -
      -Converts value to positive integer. If provided value is less than 0, then 0 is returned
      -
      -#### toUint32(x) _(es5-ext/number/to-uint32)_
      -
      -Converts value to unsigned 32 bit integer. This type is used for array lengths.
      -See: http://www.2ality.com/2012/02/js-integers.html
      -
      -### Number Prototype extensions
      -
      -#### num.pad(length[, precision]) _(es5-ext/number/#/pad)_
      -
      -Pad given number with zeros. Returns string
      -
      -### Object Constructor extensions
      -
      -#### assign(target, source[, …sourcen]) _(es5-ext/object/assign)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign).  
      -Extend _target_ by enumerable own properties of other objects. If properties are already set on target object, they will be overwritten.
      -
      -#### clear(obj) _(es5-ext/object/clear)_
      -
      -Remove all enumerable own properties of the object
      -
      -#### compact(obj) _(es5-ext/object/compact)_
      -
      -Returns copy of the object with all enumerable properties that have no falsy values
      -
      -#### compare(obj1, obj2) _(es5-ext/object/compare)_
      -
      -Universal cross-type compare function. To be used for e.g. array sort.
      -
      -#### copy(obj) _(es5-ext/object/copy)_
      -
      -Returns copy of the object with all enumerable properties.
      -
      -#### copyDeep(obj) _(es5-ext/object/copy-deep)_
      -
      -Returns deep copy of the object with all enumerable properties.
      -
      -#### count(obj) _(es5-ext/object/count)_
      -
      -Counts number of enumerable own properties on object
      -
      -#### create(obj[, properties]) _(es5-ext/object/create)_
      -
      -`Object.create` alternative that provides workaround for [V8 issue](http://code.google.com/p/v8/issues/detail?id=2804).
      -
      -When `null` is provided as a prototype, it's substituted with specially prepared object that derives from Object.prototype but has all Object.prototype properties shadowed with undefined.
      -
      -It's quirky solution that allows us to have plain objects with no truthy properties but with turnable prototype.
      -
      -Use only for objects that you plan to switch prototypes of and be aware of limitations of this workaround.
      -
      -#### eq(x, y) _(es5-ext/object/eq)_
      -
      -Whether two values are equal, using [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) algorithm.
      -
      -#### every(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/every)_
      -
      -Analogous to Array.prototype.every. Returns true if every key-value pair in this object satisfies the provided testing function.  
      -Optionally _compareFn_ can be provided which assures that keys are tested in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key).
      -
      -#### filter(obj, cb[, thisArg]) _(es5-ext/object/filter)_
      -
      -Analogous to Array.prototype.filter. Returns new object with properites for which _cb_ function returned truthy value.
      -
      -#### firstKey(obj) _(es5-ext/object/first-key)_
      -
      -Returns first enumerable key of the object, as keys are unordered by specification, it can be any key of an object.
      -
      -#### flatten(obj) _(es5-ext/object/flatten)_
      -
      -Returns new object, with flatten properties of input object
      -
      -_flatten({ a: { b: 1 }, c: { d: 1 } })  =def  { b: 1, d: 1 }_
      -
      -#### forEach(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/for-each)_
      -
      -Analogous to Array.prototype.forEach. Calls a function for each key-value pair found in object
      -Optionally _compareFn_ can be provided which assures that properties are iterated in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key).
      -
      -#### getPropertyNames() _(es5-ext/object/get-property-names)_
      -
      -Get all (not just own) property names of the object
      -
      -#### is(x, y) _(es5-ext/object/is)_
      -
      -Whether two values are equal, using [_SameValue_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) algorithm.
      -
      -#### isArrayLike(x) _(es5-ext/object/is-array-like)_
      -
      -Whether object is array-like object
      -
      -#### isCopy(x, y) _(es5-ext/object/is-copy)_
      -
      -Two values are considered a copy of same value when all of their own enumerable properties have same values.
      -
      -#### isCopyDeep(x, y) _(es5-ext/object/is-copy-deep)_
      -
      -Deep comparision of objects
      -
      -#### isEmpty(obj) _(es5-ext/object/is-empty)_
      -
      -True if object doesn't have any own enumerable property
      -
      -#### isObject(arg) _(es5-ext/object/is-object)_
      -
      -Whether value is not primitive
      -
      -#### isPlainObject(arg) _(es5-ext/object/is-plain-object)_
      -
      -Whether object is plain object, its protototype should be Object.prototype and it cannot be host object.
      -
      -#### keyOf(obj, searchValue) _(es5-ext/object/key-of)_
      -
      -Search object for value
      -
      -#### keys(obj) _(es5-ext/object/keys)_
      -
      -[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys).  
      -ES6's version of `keys`, doesn't throw on primitive input
      -
      -#### map(obj, cb[, thisArg]) _(es5-ext/object/map)_
      -
      -Analogous to Array.prototype.map. Creates a new object with properties which values are results of calling a provided function on every key-value pair in this object.
      -
      -#### mapKeys(obj, cb[, thisArg]) _(es5-ext/object/map-keys)_
      -
      -Create new object with same values, but remapped keys
      -
      -#### mixin(target, source) _(es5-ext/object/mixin)_
      -
      -Extend _target_ by all own properties of other objects. Properties found in both objects will be overwritten (unless they're not configurable and cannot be overwritten).
      -_It was for a moment part of ECMAScript 6 draft._
      -
      -#### mixinPrototypes(target, …source]) _(es5-ext/object/mixin-prototypes)_
      -
      -Extends _target_, with all source and source's prototype properties.
      -Useful as an alternative for `setPrototypeOf` in environments in which it cannot be shimmed (no `__proto__` support).
      -
      -#### normalizeOptions(options) _(es5-ext/object/normalize-options)_
      -
      -Normalizes options object into flat plain object.  
      -
      -Useful for functions in which we either need to keep options object for future reference or need to modify it for internal use.
      -
      -- It never returns input `options` object back (always a copy is created)
      -- `options` can be undefined in such case empty plain object is returned.
      -- Copies all enumerable properties found down prototype chain.
      -
      -#### primitiveSet([…names]) _(es5-ext/object/primitive-set)_
      -
      -Creates `null` prototype based plain object, and sets on it all property names provided in arguments to true.
      -
      -#### safeTraverse(obj[, …names]) _(es5-ext/object/safe-traverse)_
      -
      -Safe navigation of object properties. See http://wiki.ecmascript.org/doku.php?id=strawman:existential_operator
      -
      -#### serialize(value) _(es5-ext/object/serialize)_
      -
      -Serialize value into string. Differs from [JSON.stringify](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that it serializes also dates, functions and regular expresssions.
      -
      -#### setPrototypeOf(object, proto) _(es5-ext/object/set-prototype-of)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.setprototypeof).  
      -If native version is not provided, it depends on existence of `__proto__` functionality, if it's missing, `null` instead of function is exposed.
      -
      -#### some(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/some)_
      -
      -Analogous to Array.prototype.some Returns true if any key-value pair satisfies the provided
      -testing function.  
      -Optionally _compareFn_ can be provided which assures that keys are tested in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key).
      -
      -#### toArray(obj[, cb[, thisArg[, compareFn]]]) _(es5-ext/object/to-array)_
      -
      -Creates an array of results of calling a provided function on every key-value pair in this object.  
      -Optionally _compareFn_ can be provided which assures that results are added in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key).
      -
      -#### unserialize(str) _(es5-ext/object/unserialize)_
      -
      -Userializes value previously serialized with [serialize](#serializevalue-es5-extobjectserialize)
      -
      -#### validCallable(x) _(es5-ext/object/valid-callable)_
      -
      -If given object is not callable throw TypeError in other case return it.
      -
      -#### validObject(x) _(es5-ext/object/valid-object)_
      -
      -Throws error if given value is not an object, otherwise it is returned.
      -
      -#### validValue(x) _(es5-ext/object/valid-value)_
      -
      -Throws error if given value is `null` or `undefined`, otherwise returns value.
      -
      -### RegExp Constructor extensions
      -
      -#### escape(str) _(es5-ext/reg-exp/escape)_
      -
      -Escapes string to be used in regular expression
      -
      -#### isRegExp(x) _(es5-ext/reg-exp/is-reg-exp)_
      -
      -Whether object is regular expression
      -
      -#### validRegExp(x) _(es5-ext/reg-exp/valid-reg-exp)_
      -
      -If object is regular expression it is returned, otherwise TypeError is thrown.
      -
      -### RegExp Prototype extensions
      -
      -#### re.isSticky(x) _(es5-ext/reg-exp/#/is-sticky)_
      -
      -Whether regular expression has `sticky` flag.
      -
      -It's to be used as counterpart to [regExp.sticky](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-get-regexp.prototype.sticky) if it's not implemented.
      -
      -#### re.isUnicode(x) _(es5-ext/reg-exp/#/is-unicode)_
      -
      -Whether regular expression has `unicode` flag.
      -
      -It's to be used as counterpart to [regExp.unicode](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-get-regexp.prototype.unicode) if it's not implemented.
      -
      -#### re.match(string) _(es5-ext/reg-exp/#/match)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.match).  
      -
      -#### re.replace(string, replaceValue) _(es5-ext/reg-exp/#/replace)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.replace).  
      -
      -#### re.search(string) _(es5-ext/reg-exp/#/search)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.search).  
      -
      -#### re.split(string) _(es5-ext/reg-exp/#/search)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.split).  
      -
      -#### re.sticky _(es5-ext/reg-exp/#/sticky/implement)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.sticky).  
      -It's a getter, so only `implement` and `is-implemented` modules are provided.
      -
      -#### re.unicode _(es5-ext/reg-exp/#/unicode/implement)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.unicode).  
      -It's a getter, so only `implement` and `is-implemented` modules are provided.
      -
      -### String Constructor extensions
      -
      -#### formatMethod(fMap) _(es5-ext/string/format-method)_
      -
      -Creates format method. It's used e.g. to create `Date.prototype.format` method
      -
      -#### fromCodePoint([…codePoints]) _(es5-ext/string/from-code-point)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.fromcodepoint)
      -
      -#### isString(x) _(es5-ext/string/is-string)_
      -
      -Whether object is string
      -
      -#### randomUniq() _(es5-ext/string/random-uniq)_
      -
      -Returns randomly generated id, with guarantee of local uniqueness (no same id will be returned twice)
      -
      -#### raw(callSite[, …substitutions]) _(es5-ext/string/raw)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.raw)
      -
      -### String Prototype extensions
      -
      -#### str.at(pos) _(es5-ext/string/#/at)_
      -
      -_Proposed for ECMAScript 6/7 standard, but not (yet) in a draft_
      -
      -Returns a string at given position in Unicode-safe manner.
      -Based on [implementation by Mathias Bynens](https://github.com/mathiasbynens/String.prototype.at).
      -
      -#### str.camelToHyphen() _(es5-ext/string/#/camel-to-hyphen)_
      -
      -Convert camelCase string to hyphen separated, e.g. one-two-three -> oneTwoThree.
      -Useful when converting names from js property convention into filename convention.
      -
      -#### str.capitalize() _(es5-ext/string/#/capitalize)_
      -
      -Capitalize first character of a string
      -
      -#### str.caseInsensitiveCompare(str) _(es5-ext/string/#/case-insensitive-compare)_
      -
      -Case insensitive compare
      -
      -#### str.codePointAt(pos) _(es5-ext/string/#/code-point-at)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.codepointat)
      -
      -Based on [implementation by Mathias Bynens](https://github.com/mathiasbynens/String.prototype.codePointAt).
      -
      -#### str.contains(searchString[, position]) _(es5-ext/string/#/contains)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.contains)
      -
      -Whether string contains given string.
      -
      -#### str.endsWith(searchString[, endPosition]) _(es5-ext/string/#/ends-with)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.endswith).  
      -Whether strings ends with given string
      -
      -#### str.hyphenToCamel() _(es5-ext/string/#/hyphen-to-camel)_
      -
      -Convert hyphen separated string to camelCase, e.g. one-two-three -> oneTwoThree.
      -Useful when converting names from filename convention to js property name convention.
      -
      -#### str.indent(str[, count]) _(es5-ext/string/#/indent)_
      -
      -Indents each line with provided _str_ (if _count_ given then _str_ is repeated _count_ times).
      -
      -#### str.last() _(es5-ext/string/#/last)_
      -
      -Return last character
      -
      -#### str.normalize([form]) _(es5-ext/string/#/normalize)_
      -
      -[_Introduced with ECMAScript 6_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize).  
      -Returns the Unicode Normalization Form of a given string.  
      -Based on Matsuza's version. Code used for integrated shim can be found at [github.com/walling/unorm](https://github.com/walling/unorm/blob/master/lib/unorm.js)
      -
      -#### str.pad(fill[, length]) _(es5-ext/string/#/pad)_
      -
      -Pad string with _fill_.
      -If _length_ si given than _fill_ is reapated _length_ times.
      -If _length_ is negative then pad is applied from right.
      -
      -#### str.repeat(n) _(es5-ext/string/#/repeat)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.repeat).  
      -Repeat given string _n_ times
      -
      -#### str.plainReplace(search, replace) _(es5-ext/string/#/plain-replace)_
      -
      -Simple `replace` version. Doesn't support regular expressions. Replaces just first occurrence of search string. Doesn't support insert patterns, therefore it is safe to replace text with text obtained programmatically (there's no need for additional _$_ characters escape in such case).
      -
      -#### str.plainReplaceAll(search, replace) _(es5-ext/string/#/plain-replace-all)_
      -
      -Simple `replace` version. Doesn't support regular expressions. Replaces all occurrences of search string. Doesn't support insert patterns, therefore it is safe to replace text with text obtained programmatically (there's no need for additional _$_ characters escape in such case).
      -
      -#### str.startsWith(searchString[, position]) _(es5-ext/string/#/starts-with)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.startswith).  
      -Whether strings starts with given string
      -
      -#### str[@@iterator] _(es5-ext/string/#/@@iterator)_
      -
      -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype-@@iterator).  
      -Returns iterator object which traverses all string characters (with respect to unicode symbols)
      -
      -### Tests [![Build Status](https://travis-ci.org/medikoo/es5-ext.png)](https://travis-ci.org/medikoo/es5-ext)
      -
      -	$ npm test
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/for-each-right.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/for-each-right.js
      deleted file mode 100644
      index 2f0ffaea84cb38..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/for-each-right.js
      +++ /dev/null
      @@ -1,20 +0,0 @@
      -'use strict';
      -
      -var toPosInt = require('../../number/to-pos-integer')
      -  , callable = require('../../object/valid-callable')
      -  , value    = require('../../object/valid-value')
      -
      -  , hasOwnProperty = Object.prototype.hasOwnProperty
      -  , call = Function.prototype.call;
      -
      -module.exports = function (cb/*, thisArg*/) {
      -	var i, self, thisArg;
      -
      -	self = Object(value(this));
      -	callable(cb);
      -	thisArg = arguments[1];
      -
      -	for (i = toPosInt(self.length); i >= 0; --i) {
      -		if (hasOwnProperty.call(self, i)) call.call(cb, thisArg, self[i], i, self);
      -	}
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/some-right.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/some-right.js
      deleted file mode 100644
      index de7460d62234cf..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/array/#/some-right.js
      +++ /dev/null
      @@ -1,22 +0,0 @@
      -'use strict';
      -
      -var callable = require('../../object/valid-callable')
      -  , value    = require('../../object/valid-value')
      -
      -  , hasOwnProperty = Object.prototype.hasOwnProperty
      -  , call = Function.prototype.call;
      -
      -module.exports = function (cb/*, thisArg*/) {
      -	var i, self, thisArg;
      -	self = Object(value(this));
      -	callable(cb);
      -	thisArg = arguments[1];
      -
      -	for (i = self.length; i >= 0; --i) {
      -		if (hasOwnProperty.call(self, i) &&
      -				call.call(cb, thisArg, self[i], i, self)) {
      -			return true;
      -		}
      -	}
      -	return false;
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/index.js
      deleted file mode 100644
      index 35daf78eea88c2..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/number/index.js
      +++ /dev/null
      @@ -1,16 +0,0 @@
      -'use strict';
      -
      -module.exports = {
      -	'#':              require('./#'),
      -	EPSILON:          require('./epsilon'),
      -	isFinite:         require('./is-finite'),
      -	isInteger:        require('./is-integer'),
      -	isNaN:            require('./is-nan'),
      -	isNumber:         require('./is-number'),
      -	isSafeInteger:    require('./is-safe-integer'),
      -	MAX_SAFE_INTEGER: require('./max-safe-integer'),
      -	MIN_SAFE_INTEGER: require('./min-safe-integer'),
      -	toInteger:        require('./to-integer'),
      -	toPosInteger:     require('./to-pos-integer'),
      -	toUint32:         require('./to-uint32')
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/_iterate.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/_iterate.js
      deleted file mode 100644
      index bf2c55d08601d3..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/_iterate.js
      +++ /dev/null
      @@ -1,29 +0,0 @@
      -// Internal method, used by iteration functions.
      -// Calls a function for each key-value pair found in object
      -// Optionally takes compareFn to iterate object in specific order
      -
      -'use strict';
      -
      -var isCallable = require('./is-callable')
      -  , callable   = require('./valid-callable')
      -  , value      = require('./valid-value')
      -
      -  , call = Function.prototype.call, keys = Object.keys
      -  , propertyIsEnumerable = Object.prototype.propertyIsEnumerable;
      -
      -module.exports = function (method, defVal) {
      -	return function (obj, cb/*, thisArg, compareFn*/) {
      -		var list, thisArg = arguments[2], compareFn = arguments[3];
      -		obj = Object(value(obj));
      -		callable(cb);
      -
      -		list = keys(obj);
      -		if (compareFn) {
      -			list.sort(isCallable(compareFn) ? compareFn.bind(obj) : undefined);
      -		}
      -		return list[method](function (key, index) {
      -			if (!propertyIsEnumerable.call(obj, key)) return defVal;
      -			return call.call(cb, thisArg, obj[key], key, obj, index);
      -		});
      -	};
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/copy-deep.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/copy-deep.js
      deleted file mode 100644
      index 548e3ee4b66bac..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/copy-deep.js
      +++ /dev/null
      @@ -1,30 +0,0 @@
      -'use strict';
      -
      -var isPlainObject = require('./is-plain-object')
      -  , value         = require('./valid-value')
      -
      -  , keys = Object.keys
      -  , copy;
      -
      -copy = function (source) {
      -	var target = {};
      -	this[0].push(source);
      -	this[1].push(target);
      -	keys(source).forEach(function (key) {
      -		var index;
      -		if (!isPlainObject(source[key])) {
      -			target[key] = source[key];
      -			return;
      -		}
      -		index = this[0].indexOf(source[key]);
      -		if (index === -1) target[key] = copy.call(this, source[key]);
      -		else target[key] = this[1][index];
      -	}, this);
      -	return target;
      -};
      -
      -module.exports = function (source) {
      -	var obj = Object(value(source));
      -	if (obj !== source) return obj;
      -	return copy.call([[], []], obj);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/index.js
      deleted file mode 100644
      index 4bdf403583ace9..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/object/index.js
      +++ /dev/null
      @@ -1,48 +0,0 @@
      -'use strict';
      -
      -module.exports = {
      -	assign:                     require('./assign'),
      -	clear:                      require('./clear'),
      -	compact:                    require('./compact'),
      -	compare:                    require('./compare'),
      -	copy:                       require('./copy'),
      -	copyDeep:                   require('./copy-deep'),
      -	count:                      require('./count'),
      -	create:                     require('./create'),
      -	eq:                         require('./eq'),
      -	every:                      require('./every'),
      -	filter:                     require('./filter'),
      -	firstKey:                   require('./first-key'),
      -	flatten:                    require('./flatten'),
      -	forEach:                    require('./for-each'),
      -	getPropertyNames:           require('./get-property-names'),
      -	is:                         require('./is'),
      -	isArrayLike:                require('./is-array-like'),
      -	isCallable:                 require('./is-callable'),
      -	isCopy:                     require('./is-copy'),
      -	isCopyDeep:                 require('./is-copy-deep'),
      -	isEmpty:                    require('./is-empty'),
      -	isObject:                   require('./is-object'),
      -	isPlainObject:              require('./is-plain-object'),
      -	keyOf:                      require('./key-of'),
      -	keys:                       require('./keys'),
      -	map:                        require('./map'),
      -	mapKeys:                    require('./map-keys'),
      -	normalizeOptions:           require('./normalize-options'),
      -	mixin:                      require('./mixin'),
      -	mixinPrototypes:            require('./mixin-prototypes'),
      -	primitiveSet:               require('./primitive-set'),
      -	safeTraverse:               require('./safe-traverse'),
      -	serialize:                  require('./serialize'),
      -	setPrototypeOf:             require('./set-prototype-of'),
      -	some:                       require('./some'),
      -	toArray:                    require('./to-array'),
      -	unserialize:                require('./unserialize'),
      -	validateArrayLike:          require('./validate-array-like'),
      -	validateArrayLikeObject:    require('./validate-array-like-object'),
      -	validCallable:              require('./valid-callable'),
      -	validObject:                require('./valid-object'),
      -	validateStringifiable:      require('./validate-stringifiable'),
      -	validateStringifiableValue: require('./validate-stringifiable-value'),
      -	validValue:                 require('./valid-value')
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/package.json b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/package.json
      deleted file mode 100644
      index 01d6532749e89c..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/package.json
      +++ /dev/null
      @@ -1,74 +0,0 @@
      -{
      -  "name": "es5-ext",
      -  "version": "0.10.7",
      -  "description": "ECMAScript 5 extensions and ES6 shims",
      -  "author": {
      -    "name": "Mariusz Nowak",
      -    "email": "medyk@medikoo.com",
      -    "url": "http://www.medikoo.com/"
      -  },
      -  "keywords": [
      -    "ecmascript",
      -    "ecmascript5",
      -    "ecmascript6",
      -    "es5",
      -    "es6",
      -    "extensions",
      -    "ext",
      -    "addons",
      -    "extras",
      -    "harmony",
      -    "javascript",
      -    "polyfill",
      -    "shim",
      -    "util",
      -    "utils",
      -    "utilities"
      -  ],
      -  "repository": {
      -    "type": "git",
      -    "url": "git://github.com/medikoo/es5-ext.git"
      -  },
      -  "dependencies": {
      -    "es6-iterator": "~0.1.3",
      -    "es6-symbol": "~2.0.1"
      -  },
      -  "devDependencies": {
      -    "tad": "~0.2.2",
      -    "xlint": "~0.2.2",
      -    "xlint-jslint-medikoo": "~0.1.2"
      -  },
      -  "scripts": {
      -    "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream",
      -    "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch",
      -    "test": "node ./node_modules/tad/bin/tad"
      -  },
      -  "license": "MIT",
      -  "gitHead": "5b63ee02f50dfbc70dc1f62bc66b8718af443f83",
      -  "bugs": {
      -    "url": "https://github.com/medikoo/es5-ext/issues"
      -  },
      -  "homepage": "https://github.com/medikoo/es5-ext",
      -  "_id": "es5-ext@0.10.7",
      -  "_shasum": "dfaea50721301042e2d89c1719d43493fa821656",
      -  "_from": "es5-ext@>=0.10.6 <0.11.0",
      -  "_npmVersion": "2.7.4",
      -  "_nodeVersion": "0.12.2",
      -  "_npmUser": {
      -    "name": "medikoo",
      -    "email": "medikoo+npm@medikoo.com"
      -  },
      -  "maintainers": [
      -    {
      -      "name": "medikoo",
      -      "email": "medikoo+npm@medikoo.com"
      -    }
      -  ],
      -  "dist": {
      -    "shasum": "dfaea50721301042e2d89c1719d43493fa821656",
      -    "tarball": "http://registry.npmjs.org/es5-ext/-/es5-ext-0.10.7.tgz"
      -  },
      -  "directories": {},
      -  "_resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.7.tgz",
      -  "readme": "ERROR: No README data found!"
      -}
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/sticky/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/sticky/is-implemented.js
      deleted file mode 100644
      index 379c4a5a8fb1b8..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/sticky/is-implemented.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -module.exports = function () {
      -	return RegExp.prototype.sticky === false;
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/unicode/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/unicode/is-implemented.js
      deleted file mode 100644
      index a8b15b3b38defb..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/reg-exp/#/unicode/is-implemented.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -module.exports = function () {
      -	return RegExp.prototype.unicode === false;
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/index.js
      deleted file mode 100644
      index d45d747cbe0954..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/string/#/index.js
      +++ /dev/null
      @@ -1,21 +0,0 @@
      -'use strict';
      -
      -module.exports = {
      -	'@@iterator':           require('./@@iterator'),
      -	at:                     require('./at'),
      -	camelToHyphen:          require('./camel-to-hyphen'),
      -	capitalize:             require('./capitalize'),
      -	caseInsensitiveCompare: require('./case-insensitive-compare'),
      -	codePointAt:            require('./code-point-at'),
      -	contains:               require('./contains'),
      -	hyphenToCamel:          require('./hyphen-to-camel'),
      -	endsWith:               require('./ends-with'),
      -	indent:                 require('./indent'),
      -	last:                   require('./last'),
      -	normalize:              require('./normalize'),
      -	pad:                    require('./pad'),
      -	plainReplace:           require('./plain-replace'),
      -	plainReplaceAll:        require('./plain-replace-all'),
      -	repeat:                 require('./repeat'),
      -	startsWith:             require('./starts-with')
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/__tad.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/__tad.js
      deleted file mode 100644
      index 884577887f5704..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/__tad.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -exports.context = null;
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/@@iterator/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/@@iterator/implement.js
      deleted file mode 100644
      index f0605399e0274e..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/@@iterator/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../../array/#/@@iterator/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/@@iterator/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/@@iterator/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/@@iterator/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/@@iterator/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/@@iterator/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/@@iterator/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/@@iterator/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/@@iterator/shim.js
      deleted file mode 100644
      index e590d8f28e7c0e..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/@@iterator/shim.js
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -'use strict';
      -
      -exports.__generic = function (t, a) {
      -	var iterator = t.call(this);
      -	a.deep(iterator.next(), { value: '1', done: false });
      -	a.deep(iterator.next(), { value: '2', done: false });
      -	a.deep(iterator.next(), { value: '3', done: false });
      -	a.deep(iterator.next(), { value: undefined, done: true });
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/_compare-by-length.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/_compare-by-length.js
      deleted file mode 100644
      index e40c305b98fe68..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/_compare-by-length.js
      +++ /dev/null
      @@ -1,7 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var x = [4, 5, 6], y = { length: 8 }, w = {}, z = { length: 1 };
      -
      -	a.deep([x, y, w, z].sort(t), [w, z, x, y]);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/binary-search.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/binary-search.js
      deleted file mode 100644
      index cf3317371b3491..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/binary-search.js
      +++ /dev/null
      @@ -1,15 +0,0 @@
      -'use strict';
      -
      -var compare  = function (value) { return this - value; };
      -
      -module.exports = function (t, a) {
      -	var arr;
      -	arr = [2, 5, 5, 8, 34, 67, 98, 345, 678];
      -
      -	// highest, equal match
      -	a(t.call(arr, compare.bind(1)), 0, "All higher");
      -	a(t.call(arr, compare.bind(679)), arr.length - 1, "All lower");
      -	a(t.call(arr, compare.bind(4)), 0, "Mid");
      -	a(t.call(arr, compare.bind(5)), 2, "Match");
      -	a(t.call(arr, compare.bind(6)), 2, "Above");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/clear.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/clear.js
      deleted file mode 100644
      index a5b1c977ad98cf..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/clear.js
      +++ /dev/null
      @@ -1,7 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var x = [1, 2, {}, 4];
      -	a(t.call(x), x, "Returns same array");
      -	a.deep(x, [], "Empties array");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/compact.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/compact.js
      deleted file mode 100644
      index 6390eb26dddf6b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/compact.js
      +++ /dev/null
      @@ -1,17 +0,0 @@
      -'use strict';
      -
      -module.exports = {
      -	__generic: function (t, a) {
      -		a(t.call(this).length, 3);
      -	},
      -	"": function (t, a) {
      -		var o, x, y, z;
      -		o = {};
      -		x = [0, 1, "", null, o, false, undefined, true];
      -		y = x.slice(0);
      -
      -		a.not(z = t.call(x), x, "Returns different object");
      -		a.deep(x, y, "Origin not changed");
      -		a.deep(z, [0, 1, "", o, false, true], "Result");
      -	}
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/concat/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/concat/implement.js
      deleted file mode 100644
      index 3bdbe86812aaaa..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/concat/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../../array/#/concat/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/concat/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/concat/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/concat/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/concat/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/concat/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/concat/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/concat/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/concat/shim.js
      deleted file mode 100644
      index c30eb7eab08178..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/concat/shim.js
      +++ /dev/null
      @@ -1,26 +0,0 @@
      -'use strict';
      -
      -var SubArray = require('../../../../array/_sub-array-dummy-safe');
      -
      -module.exports = function (t, a) {
      -	var arr = [1, 3, 45], x = {}, subArr, subArr2, result;
      -
      -	a.deep(t.call(arr, '2d', x, ['ere', 'fe', x], false, null),
      -		[1, 3, 45, '2d', x, 'ere', 'fe', x, false, null], "Plain array");
      -
      -	subArr = new SubArray('lol', 'miszko');
      -	subArr2 = new SubArray('elo', 'fol');
      -
      -	result = t.call(subArr, 'df', arr, 'fef', subArr2, null);
      -	a(result instanceof SubArray, true, "Instance of subclass");
      -	a.deep(result, ['lol', 'miszko', 'df', 1, 3, 45, 'fef', 'elo', 'fol', null],
      -		"Spreable by default");
      -
      -	SubArray.prototype['@@isConcatSpreadable'] = false;
      -
      -	result = t.call(subArr, 'df', arr, 'fef', subArr2, null);
      -	a.deep(result, ['lol', 'miszko', 'df', 1, 3, 45, 'fef', subArr2, null],
      -		"Non spreadable");
      -
      -	delete SubArray.prototype['@@isConcatSpreadable'];
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/contains.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/contains.js
      deleted file mode 100644
      index 21404a17a61358..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/contains.js
      +++ /dev/null
      @@ -1,21 +0,0 @@
      -'use strict';
      -
      -module.exports = {
      -	__generic: function (t, a) {
      -		a(t.call(this, this[1]), true, "Contains");
      -		a(t.call(this, {}), false, "Does Not contain");
      -	},
      -	"": function (t, a) {
      -		var o, x = {}, y = {};
      -
      -		o = [1, 'raz', x];
      -
      -		a(t.call(o, 1), true, "First");
      -		a(t.call(o, '1'), false, "Type coercion");
      -		a(t.call(o, 'raz'), true, "Primitive");
      -		a(t.call(o, 'foo'), false, "Primitive not found");
      -		a(t.call(o, x), true, "Object found");
      -		a(t.call(o, y), false, "Object not found");
      -		a(t.call(o, 1, 1), false, "Position");
      -	}
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/copy-within/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/copy-within/implement.js
      deleted file mode 100644
      index 36070477d66802..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/copy-within/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../../array/#/copy-within/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/copy-within/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/copy-within/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/copy-within/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/copy-within/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/copy-within/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/copy-within/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/copy-within/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/copy-within/shim.js
      deleted file mode 100644
      index 93c85ea3114c24..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/copy-within/shim.js
      +++ /dev/null
      @@ -1,29 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var args, x;
      -
      -	a.h1("2 args");
      -	x = [1, 2, 3, 4, 5];
      -	t.call(x, 0, 3);
      -	a.deep(x, [4, 5, 3, 4, 5]);
      -	a.deep(t.call([1, 2, 3, 4, 5], 1, 3), [1, 4, 5, 4, 5]);
      -	a.deep(t.call([1, 2, 3, 4, 5], 1, 2), [1, 3, 4, 5, 5]);
      -	a.deep(t.call([1, 2, 3, 4, 5], 2, 2), [1, 2, 3, 4, 5]);
      -
      -	a.h1("3 args");
      -	a.deep(t.call([1, 2, 3, 4, 5], 0, 3, 4), [4, 2, 3, 4, 5]);
      -	a.deep(t.call([1, 2, 3, 4, 5], 1, 3, 4), [1, 4, 3, 4, 5]);
      -	a.deep(t.call([1, 2, 3, 4, 5], 1, 2, 4), [1, 3, 4, 4, 5]);
      -
      -	a.h1("Negative args");
      -	a.deep(t.call([1, 2, 3, 4, 5], 0, -2), [4, 5, 3, 4, 5]);
      -	a.deep(t.call([1, 2, 3, 4, 5], 0, -2, -1), [4, 2, 3, 4, 5]);
      -	a.deep(t.call([1, 2, 3, 4, 5], -4, -3, -2), [1, 3, 3, 4, 5]);
      -	a.deep(t.call([1, 2, 3, 4, 5], -4, -3, -1), [1, 3, 4, 4, 5]);
      -	a.deep(t.call([1, 2, 3, 4, 5], -4, -3), [1, 3, 4, 5, 5]);
      -
      -	a.h1("Array-likes");
      -	args = { 0: 1, 1: 2, 2: 3, length: 3 };
      -	a.deep(t.call(args, -2, 0), { '0': 1, '1': 1, '2': 2, length: 3 });
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/diff.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/diff.js
      deleted file mode 100644
      index bcfa3a0bd12f84..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/diff.js
      +++ /dev/null
      @@ -1,17 +0,0 @@
      -'use strict';
      -
      -module.exports = {
      -	__generic: function (t, a) {
      -		a.deep(t.call(this, this), []);
      -	},
      -	"": function (t, a) {
      -		var x = {}, y = {};
      -
      -		a.deep(t.call([1, 'raz', x, 2, 'trzy', y], [x, 2, 'trzy']), [1, 'raz', y],
      -			"Scope longer");
      -		a.deep(t.call([1, 'raz', x], [x, 2, 'trzy', 1, y]), ['raz'],
      -			"Arg longer");
      -		a.deep(t.call([1, 'raz', x], []), [1, 'raz', x], "Empty arg");
      -		a.deep(t.call([], [1, y, 'sdfs']), [], "Empty scope");
      -	}
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/e-index-of.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/e-index-of.js
      deleted file mode 100644
      index 4cf6c6359d44ee..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/e-index-of.js
      +++ /dev/null
      @@ -1,13 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var x = {};
      -	a(t.call([3, 'raz', {}, x, {}], x), 3, "Regular");
      -	a(t.call([3, 'raz', NaN, {}, NaN], NaN), 2, "NaN");
      -	a(t.call([3, 'raz', 0, {}, -0], -0), 2, "-0");
      -	a(t.call([3, 'raz', -0, {}, 0], +0), 2, "+0");
      -	a(t.call([3, 'raz', NaN, {}, NaN], NaN, 3), 4, "fromIndex");
      -	a(t.call([3, 'raz', NaN, {}, NaN], NaN, -1), 4, "fromIndex negative #1");
      -	a(t.call([3, 'raz', NaN, {}, NaN], NaN, -2), 4, "fromIndex negative #2");
      -	a(t.call([3, 'raz', NaN, {}, NaN], NaN, -3), 2, "fromIndex negative #3");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/e-last-index-of.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/e-last-index-of.js
      deleted file mode 100644
      index ed4f700421a8f1..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/e-last-index-of.js
      +++ /dev/null
      @@ -1,12 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var x = {};
      -	a(t.call([3, 'raz', {}, x, {}, x], x), 5, "Regular");
      -	a(t.call([3, 'raz', NaN, {}, x], NaN), 2, "NaN");
      -	a(t.call([3, 'raz', 0, {}, -0], -0), 4, "-0");
      -	a(t.call([3, 'raz', -0, {}, 0], +0), 4, "+0");
      -	a(t.call([3, 'raz', NaN, {}, NaN], NaN, 3), 2, "fromIndex");
      -	a(t.call([3, 'raz', NaN, 2, NaN], NaN, -1), 4, "Negative fromIndex #1");
      -	a(t.call([3, 'raz', NaN, 2, NaN], NaN, -2), 2, "Negative fromIndex #2");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/entries/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/entries/implement.js
      deleted file mode 100644
      index 733209a1c80653..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/entries/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../../array/#/entries/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/entries/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/entries/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/entries/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/entries/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/entries/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/entries/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/entries/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/entries/shim.js
      deleted file mode 100644
      index bf40d31005df45..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/entries/shim.js
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -'use strict';
      -
      -exports.__generic = function (t, a) {
      -	var iterator = t.call(this);
      -	a.deep(iterator.next(), { value: [0, '1'], done: false });
      -	a.deep(iterator.next(), { value: [1, '2'], done: false });
      -	a.deep(iterator.next(), { value: [2, '3'], done: false });
      -	a.deep(iterator.next(), { value: undefined, done: true });
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/exclusion.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/exclusion.js
      deleted file mode 100644
      index 07b32d8e8cbf9b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/exclusion.js
      +++ /dev/null
      @@ -1,15 +0,0 @@
      -'use strict';
      -
      -module.exports = {
      -	__generic: function (t, a) {
      -		var x = {};
      -		a.deep(t.call(this, this, [this[0], this[2], x]), [x]);
      -	},
      -	"": function (t, a) {
      -		var x = {}, y = {};
      -
      -		a.deep(t.call([x, y]), [x, y], "No arguments");
      -		a.deep(t.call([x, 1], [], []), [x, 1], "Empty arguments");
      -		a.deep(t.call([1, 'raz', x], [2, 'raz', y], [2, 'raz', x]), [1, y]);
      -	}
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/fill/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/fill/implement.js
      deleted file mode 100644
      index 2a01d2850a18a9..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/fill/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../../array/#/fill/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/fill/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/fill/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/fill/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/fill/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/fill/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/fill/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/fill/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/fill/shim.js
      deleted file mode 100644
      index d67300fcc23be8..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/fill/shim.js
      +++ /dev/null
      @@ -1,18 +0,0 @@
      -// Taken from https://github.com/paulmillr/es6-shim/blob/master/test/array.js
      -
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var x;
      -
      -	x = [1, 2, 3, 4, 5, 6];
      -	a(t.call(x, -1), x, "Returns self object");
      -	a.deep(x, [-1, -1, -1, -1, -1, -1], "Value");
      -
      -	a.deep(t.call([1, 2, 3, 4, 5, 6], -1, 3), [1, 2, 3, -1, -1, -1],
      -		"Positive start");
      -	a.deep(t.call([1, 2, 3, 4, 5, 6], -1, -3), [1, 2, 3, -1, -1, -1],
      -		"Negative start");
      -	a.deep(t.call([1, 2, 3, 4, 5, 6], -1, 9), [1, 2, 3, 4, 5, 6],
      -		"Large start");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/filter/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/filter/implement.js
      deleted file mode 100644
      index 6d6b87cc30a651..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/filter/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../../array/#/filter/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/filter/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/filter/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/filter/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/filter/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/filter/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/filter/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/filter/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/filter/shim.js
      deleted file mode 100644
      index e8b5c39849097f..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/filter/shim.js
      +++ /dev/null
      @@ -1,17 +0,0 @@
      -'use strict';
      -
      -var SubArray = require('../../../../array/_sub-array-dummy-safe');
      -
      -module.exports = function (t, a) {
      -	var arr, x = {}, subArr, result;
      -
      -	arr = ['foo', undefined, 0, '2d', false, x, null];
      -
      -	a.deep(t.call(arr, Boolean), ['foo', '2d', x], "Plain array");
      -
      -	subArr = new SubArray('foo', undefined, 0, '2d', false, x, null);
      -
      -	result = t.call(subArr, Boolean);
      -	a(result instanceof SubArray, true, "Instance of subclass");
      -	a.deep(result, ['foo', '2d', x], "Result of subclass");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find-index/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find-index/implement.js
      deleted file mode 100644
      index 8d85e618ccd6bc..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find-index/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../../array/#/find-index/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find-index/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find-index/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find-index/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find-index/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find-index/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find-index/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find-index/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find-index/shim.js
      deleted file mode 100644
      index b5fee463811d49..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find-index/shim.js
      +++ /dev/null
      @@ -1,17 +0,0 @@
      -'use strict';
      -
      -exports.__generic = function (t, a) {
      -	var count = 0, o = {}, self = Object(this);
      -	a(t.call(self, function (value, i, scope) {
      -		a(value, this[i], "Value");
      -		a(i, count++, "Index");
      -		a(scope, this, "Scope");
      -	}, self), -1, "Falsy result");
      -	a(count, 3);
      -
      -	count = -1;
      -	a(t.call(this, function () {
      -		return ++count ? o : null;
      -	}, this), 1, "Truthy result");
      -	a(count, 1);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find/implement.js
      deleted file mode 100644
      index 29fac41e013353..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../../array/#/find/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find/shim.js
      deleted file mode 100644
      index ad2e645067db5d..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find/shim.js
      +++ /dev/null
      @@ -1,17 +0,0 @@
      -'use strict';
      -
      -exports.__generic = function (t, a) {
      -	var count = 0, o = {}, self = Object(this);
      -	a(t.call(self, function (value, i, scope) {
      -		a(value, this[i], "Value");
      -		a(i, count++, "Index");
      -		a(scope, this, "Scope");
      -	}, self), undefined, "Falsy result");
      -	a(count, 3);
      -
      -	count = -1;
      -	a(t.call(this, function () {
      -		return ++count ? o : null;
      -	}, this), this[1], "Truthy result");
      -	a(count, 1);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/first-index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/first-index.js
      deleted file mode 100644
      index 4aebad64b44e51..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/first-index.js
      +++ /dev/null
      @@ -1,17 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var x;
      -	a(t.call([]), null, "Empty");
      -	a(t.call([null]), 0, "One value");
      -	a(t.call([1, 2, 3]), 0, "Many values");
      -	a(t.call(new Array(1000)), null, "Sparse empty");
      -	x = [];
      -	x[883] = undefined;
      -	x[890] = null;
      -	a(t.call(x), 883, "Manual sparse, distant value");
      -	x = new Array(1000);
      -	x[657] = undefined;
      -	x[700] = null;
      -	a(t.call(x), 657, "Sparse, distant value");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/first.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/first.js
      deleted file mode 100644
      index 87fde0357ef1b0..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/first.js
      +++ /dev/null
      @@ -1,13 +0,0 @@
      -'use strict';
      -
      -exports.__generic = function (t, a) {
      -	a(t.call(this), this[0]);
      -};
      -exports[''] = function (t, a) {
      -	var x;
      -	a(t.call([]), undefined, "Empty");
      -	a(t.call(new Array(234), undefined, "Sparse empty"));
      -	x = new Array(2342);
      -	x[434] = {};
      -	a(t.call(x), x[434], "Sparse");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/flatten.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/flatten.js
      deleted file mode 100644
      index 65f1214b04da93..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/flatten.js
      +++ /dev/null
      @@ -1,12 +0,0 @@
      -'use strict';
      -
      -var o = [1, 2, [3, 4, [5, 6], 7, 8], 9, 10];
      -
      -module.exports = {
      -	__generic: function (t, a) {
      -		a(t.call(this).length, 3);
      -	},
      -	"Nested Arrays": function (t, a) {
      -		a(t.call(o).length, 10);
      -	}
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/for-each-right.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/for-each-right.js
      deleted file mode 100644
      index 2d24569d94d86d..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/for-each-right.js
      +++ /dev/null
      @@ -1,36 +0,0 @@
      -'use strict';
      -
      -module.exports = {
      -	__generic: function (t, a) {
      -		var count = 0, first, last, x, icount = this.length;
      -		t.call(this, function (item, index, col) {
      -			++count;
      -			if (!first) {
      -				first = item;
      -			}
      -			last = item;
      -			x = col;
      -			a(index, --icount, "Index");
      -		});
      -		a(count, this.length, "Iterated");
      -		a(first, this[this.length - 1], "First is last");
      -		a(last, this[0], "Last is first");
      -		a.deep(x, Object(this), "Collection as third argument"); //jslint: skip
      -	},
      -	"": function (t, a) {
      -		var x = {}, y, count;
      -		t.call([1], function () { y = this; }, x);
      -		a(y, x, "Scope");
      -		y = 0;
      -		t.call([3, 4, 4], function (a, i) { y += i; });
      -		a(y, 3, "Indexes");
      -
      -		x = [1, 3];
      -		x[5] = 'x';
      -		y = 0;
      -		count = 0;
      -		t.call(x, function (a, i) { ++count; y += i; });
      -		a(y, 6, "Misssing Indexes");
      -		a(count, 3, "Misssing Indexes, count");
      -	}
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/group.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/group.js
      deleted file mode 100644
      index 32dc8c2dbb68bf..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/group.js
      +++ /dev/null
      @@ -1,24 +0,0 @@
      -'use strict';
      -
      -module.exports = {
      -	__generic: function (t, a) {
      -		var count = 0, self;
      -
      -		self = Object(this);
      -		a.deep(t.call(self, function (v, i, scope) {
      -			a(v, this[i], "Value");
      -			a(i, count++, "Index");
      -			a(scope, this, "Scope");
      -			return i;
      -		}, self), { 0: [this[0]], 1: [this[1]], 2: [this[2]] });
      -	},
      -	"": function (t, a) {
      -		var r;
      -		r = t.call([2, 3, 3, 4, 5, 6, 7, 7, 23, 45, 34, 56],
      -			function (v) {
      -				return v % 2 ? 'odd' : 'even';
      -			});
      -		a.deep(r.odd, [3, 3, 5, 7, 7, 23, 45]);
      -		a.deep(r.even, [2, 4, 6, 34, 56]);
      -	}
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/indexes-of.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/indexes-of.js
      deleted file mode 100644
      index 3364170f1ec4a9..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/indexes-of.js
      +++ /dev/null
      @@ -1,14 +0,0 @@
      -'use strict';
      -
      -module.exports = {
      -	__generic: function (t, a) {
      -		a.deep(t.call(this, this[1]), [1]);
      -	},
      -	"": function (t, a) {
      -		var x = {};
      -		a.deep(t.call([1, 3, 5, 3, 5], 6), [], "No result");
      -		a.deep(t.call([1, 3, 5, 1, 3, 5, 1], 1), [0, 3, 6], "Some results");
      -		a.deep(t.call([], x), [], "Empty array");
      -		a.deep(t.call([x, 3, {}, x, 3, 5, x], x), [0, 3, 6], "Search for object");
      -	}
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/intersection.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/intersection.js
      deleted file mode 100644
      index b72b2fb074fc46..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/intersection.js
      +++ /dev/null
      @@ -1,24 +0,0 @@
      -'use strict';
      -
      -var toArray = require('../../../array/to-array');
      -
      -module.exports = {
      -	__generic: function (t, a) {
      -		a.deep(t.call(this, this, this), toArray(this));
      -	},
      -	"": function (t, a) {
      -		var x = {}, y = {}, p, r;
      -		a.deep(t.call([], [2, 3, 4]), [], "Empty #1");
      -		a.deep(t.call([2, 3, 4], []), [], "Empty #2");
      -		a.deep(t.call([2, 3, x], [y, 5, 7]), [], "Different");
      -		p = t.call([3, 5, 'raz', {}, 'dwa', x], [1, 3, 'raz', 'dwa', 'trzy', x, {}],
      -			[3, 'raz', x, 65]);
      -		r = [3, 'raz', x];
      -		p.sort();
      -		r.sort();
      -		a.deep(p, r, "Same parts");
      -		a.deep(t.call(r, r), r, "Same");
      -		a.deep(t.call([1, 2, x, 4, 5, y, 7], [7, y, 5, 4, x, 2, 1]),
      -			[1, 2, x, 4, 5, y, 7], "Long reverse same");
      -	}
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/is-copy.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/is-copy.js
      deleted file mode 100644
      index e7f80e7a8d4ebc..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/is-copy.js
      +++ /dev/null
      @@ -1,13 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var x = {};
      -	a(t.call([], []), true, "Empty");
      -	a(t.call([], {}), true, "Empty lists");
      -	a(t.call([1, x, 'raz'], [1, x, 'raz']), true, "Same");
      -	a(t.call([1, x, 'raz'], { 0: 1, 1: x, 2: 'raz', length: 3 }), true,
      -			"Same lists");
      -	a(t.call([1, x, 'raz'], [x, 1, 'raz']), false, "Diff order");
      -	a(t.call([1, x], [1, x, 'raz']), false, "Diff length #1");
      -	a(t.call([1, x, 'raz'], [1, x]), false, "Diff length #2");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/is-uniq.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/is-uniq.js
      deleted file mode 100644
      index 7349ba337135a7..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/is-uniq.js
      +++ /dev/null
      @@ -1,11 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var x = {};
      -	a(t.call([]), true, "Empty");
      -	a(t.call({}), true, "Empty lists");
      -	a(t.call([1, x, 'raz']), true, "Uniq");
      -	a(t.call([1, x, 1, 'raz']), false, "Not Uniq: primitive");
      -	a(t.call([1, x, '1', 'raz']), true, "Uniq: primitive");
      -	a(t.call([1, x, 1, {}, 'raz']), false, "Not Uniq: Obj");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/keys/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/keys/implement.js
      deleted file mode 100644
      index b0c1aa078f190e..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/keys/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../../array/#/keys/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/keys/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/keys/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/keys/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/keys/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/keys/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/keys/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/keys/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/keys/shim.js
      deleted file mode 100644
      index a43c04cac103a6..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/keys/shim.js
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -'use strict';
      -
      -exports.__generic = function (t, a) {
      -	var iterator = t.call(this);
      -	a.deep(iterator.next(), { value: 0, done: false });
      -	a.deep(iterator.next(), { value: 1, done: false });
      -	a.deep(iterator.next(), { value: 2, done: false });
      -	a.deep(iterator.next(), { value: undefined, done: true });
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/last-index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/last-index.js
      deleted file mode 100644
      index a1cac1073f8862..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/last-index.js
      +++ /dev/null
      @@ -1,17 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var x;
      -	a(t.call([]), null, "Empty");
      -	a(t.call([null]), 0, "One value");
      -	a(t.call([1, 2, 3]), 2, "Many values");
      -	a(t.call(new Array(1000)), null, "Sparse empty");
      -	x = [];
      -	x[883] = null;
      -	x[890] = undefined;
      -	a(t.call(x), 890, "Manual sparse, distant value");
      -	x = new Array(1000);
      -	x[657] = null;
      -	x[700] = undefined;
      -	a(t.call(x), 700, "Sparse, distant value");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/last.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/last.js
      deleted file mode 100644
      index 8d051bc8d2f5df..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/last.js
      +++ /dev/null
      @@ -1,15 +0,0 @@
      -'use strict';
      -
      -exports.__generic = function (t, a) {
      -	a(t.call(this), this[this.length - 1]);
      -};
      -
      -exports[''] = function (t, a) {
      -	var x;
      -	a(t.call([]), undefined, "Empty");
      -	a(t.call(new Array(234), undefined, "Sparse empty"));
      -	x = new Array(2342);
      -	x[434] = {};
      -	x[450] = {};
      -	a(t.call(x), x[450], "Sparse");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/map/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/map/implement.js
      deleted file mode 100644
      index cdcbc8df6206a5..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/map/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../../array/#/map/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/map/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/map/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/map/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/map/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/map/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/map/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/map/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/map/shim.js
      deleted file mode 100644
      index bbfefe8e333dc8..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/map/shim.js
      +++ /dev/null
      @@ -1,19 +0,0 @@
      -'use strict';
      -
      -var SubArray = require('../../../../array/_sub-array-dummy-safe');
      -
      -module.exports = function (t, a) {
      -	var arr, x = {}, subArr, result;
      -
      -	arr = ['foo', undefined, 0, '2d', false, x, null];
      -
      -	a.deep(t.call(arr, Boolean), [true, false, false, true, false, true, false],
      -		"Plain array");
      -
      -	subArr = new SubArray('foo', undefined, 0, '2d', false, x, null);
      -
      -	result = t.call(subArr, Boolean);
      -	a(result instanceof SubArray, true, "Instance of subclass");
      -	a.deep(result, [true, false, false, true, false, true, false],
      -		"Result of subclass");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/remove.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/remove.js
      deleted file mode 100644
      index 3ebdca2d0183df..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/remove.js
      +++ /dev/null
      @@ -1,14 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var y = {}, z = {}, x = [9, z, 5, y, 'foo'];
      -	t.call(x, y);
      -	a.deep(x, [9, z, 5, 'foo']);
      -	t.call(x, {});
      -	a.deep(x, [9, z, 5, 'foo'], "Not existing");
      -	t.call(x, 5);
      -	a.deep(x, [9, z, 'foo'], "Primitive");
      -	x = [9, z, 5, y, 'foo'];
      -	t.call(x, z, 5, 'foo');
      -	a.deep(x, [9, y], "More than one argument");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/separate.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/separate.js
      deleted file mode 100644
      index 42918b59711e32..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/separate.js
      +++ /dev/null
      @@ -1,15 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var x = [], y = {}, z = {};
      -	a.deep(t.call(x, y), [], "Empty");
      -	a.not(t.call(x), x, "Returns copy");
      -	a.deep(t.call([1], y), [1], "One");
      -	a.deep(t.call([1, 'raz'], y), [1, y, 'raz'], "One");
      -	a.deep(t.call([1, 'raz', x], y), [1, y, 'raz', y, x], "More");
      -	x = new Array(1000);
      -	x[23] = 2;
      -	x[3453] = 'raz';
      -	x[500] = z;
      -	a.deep(t.call(x, y), [2, y, z, y, 'raz'], "Sparse");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/slice/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/slice/implement.js
      deleted file mode 100644
      index 855ae2fa4df88e..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/slice/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../../array/#/slice/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/slice/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/slice/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/slice/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/slice/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/slice/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/slice/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/slice/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/slice/shim.js
      deleted file mode 100644
      index f674f3470037f7..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/slice/shim.js
      +++ /dev/null
      @@ -1,17 +0,0 @@
      -'use strict';
      -
      -var SubArray = require('../../../../array/_sub-array-dummy-safe');
      -
      -module.exports = function (t, a) {
      -	var arr, x = {}, subArr, result;
      -
      -	arr = ['foo', undefined, 0, '2d', false, x, null];
      -
      -	a.deep(t.call(arr, 2, 4), [0, '2d'], "Plain array: result");
      -
      -	subArr = new SubArray('foo', undefined, 0, '2d', false, x, null);
      -
      -	result = t.call(subArr, 2, 4);
      -	a(result instanceof SubArray, true, "Instance of subclass");
      -	a.deep(result, [0, '2d'], "Subclass: result");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/some-right.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/some-right.js
      deleted file mode 100644
      index 900771a6f818a4..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/some-right.js
      +++ /dev/null
      @@ -1,43 +0,0 @@
      -'use strict';
      -
      -module.exports = {
      -	__generic: function (t, a) {
      -		var count = 0, first, last, x, icount = this.length;
      -		t.call(this, function (item, index, col) {
      -			++count;
      -			if (!first) {
      -				first = item;
      -			}
      -			last = item;
      -			x = col;
      -			a(index, --icount, "Index");
      -		});
      -		a(count, this.length, "Iterated");
      -		a(first, this[this.length - 1], "First is last");
      -		a(last, this[0], "Last is first");
      -		a.deep(x, Object(this), "Collection as third argument"); //jslint: skip
      -	},
      -	"": function (t, a) {
      -		var x = {}, y, count;
      -		t.call([1], function () { y = this; }, x);
      -		a(y, x, "Scope");
      -		y = 0;
      -		t.call([3, 4, 4], function (a, i) { y += i; });
      -		a(y, 3, "Indexes");
      -
      -		x = [1, 3];
      -		x[5] = 'x';
      -		y = 0;
      -		count = 0;
      -		a(t.call(x, function (a, i) { ++count; y += i; }), false, "Return");
      -		a(y, 6, "Misssing Indexes");
      -		a(count, 3, "Misssing Indexes, count");
      -
      -		count = 0;
      -		a(t.call([-2, -3, -4, 2, -5], function (item) {
      -			++count;
      -			return item > 0;
      -		}), true, "Return");
      -		a(count, 2, "Break after true is returned");
      -	}
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/splice/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/splice/implement.js
      deleted file mode 100644
      index 0d9f46188b528b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/splice/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../../array/#/splice/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/splice/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/splice/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/splice/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/splice/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/splice/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/splice/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/splice/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/splice/shim.js
      deleted file mode 100644
      index 2c751e672400e6..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/splice/shim.js
      +++ /dev/null
      @@ -1,19 +0,0 @@
      -'use strict';
      -
      -var SubArray = require('../../../../array/_sub-array-dummy-safe');
      -
      -module.exports = function (t, a) {
      -	var arr, x = {}, subArr, result;
      -
      -	arr = ['foo', undefined, 0, '2d', false, x, null];
      -
      -	a.deep(t.call(arr, 2, 2, 'bar'), [0, '2d'], "Plain array: result");
      -	a.deep(arr, ["foo", undefined, "bar", false, x, null], "Plain array: change");
      -
      -	subArr = new SubArray('foo', undefined, 0, '2d', false, x, null);
      -
      -	result = t.call(subArr, 2, 2, 'bar');
      -	a(result instanceof SubArray, true, "Instance of subclass");
      -	a.deep(result, [0, '2d'], "Subclass: result");
      -	a.deep(subArr, ["foo", undefined, "bar", false, x, null], "Subclass: change");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/uniq.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/uniq.js
      deleted file mode 100644
      index 2f7e6c4ed1feb5..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/uniq.js
      +++ /dev/null
      @@ -1,14 +0,0 @@
      -'use strict';
      -
      -module.exports = {
      -	__generic: function (t, a) {
      -		a(t.call(this).length, 3);
      -	},
      -	"": function (t, a) {
      -		var o, x = {}, y = {}, z = {}, w;
      -		o = [1, 2, x, 3, 1, 'raz', '1', y, x, 'trzy', z, 'raz'];
      -
      -		a.not(w = t.call(o), o, "Returns different object");
      -		a.deep(w, [1, 2, x, 3, 'raz', '1', y, 'trzy', z], "Result");
      -	}
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/values/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/values/implement.js
      deleted file mode 100644
      index 9f40138c254b30..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/values/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../../array/#/values/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/values/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/values/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/values/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/values/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/values/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/values/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/values/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/values/shim.js
      deleted file mode 100644
      index e590d8f28e7c0e..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/values/shim.js
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -'use strict';
      -
      -exports.__generic = function (t, a) {
      -	var iterator = t.call(this);
      -	a.deep(iterator.next(), { value: '1', done: false });
      -	a.deep(iterator.next(), { value: '2', done: false });
      -	a.deep(iterator.next(), { value: '3', done: false });
      -	a.deep(iterator.next(), { value: undefined, done: true });
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/__scopes.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/__scopes.js
      deleted file mode 100644
      index fc240d304869bb..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/__scopes.js
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -'use strict';
      -
      -exports.Array = ['1', '2', '3'];
      -
      -exports.Arguments = (function () {
      -	return arguments;
      -}('1', '2', '3'));
      -
      -exports.String = "123";
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/_is-extensible.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/_is-extensible.js
      deleted file mode 100644
      index d387126fe111ed..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/_is-extensible.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(typeof t, 'boolean');
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/_sub-array-dummy-safe.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/_sub-array-dummy-safe.js
      deleted file mode 100644
      index 29d8699d461a85..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/_sub-array-dummy-safe.js
      +++ /dev/null
      @@ -1,7 +0,0 @@
      -'use strict';
      -
      -var isArray = Array.isArray;
      -
      -module.exports = function (t, a) {
      -	t((t === null) || isArray(t.prototype), true);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/_sub-array-dummy.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/_sub-array-dummy.js
      deleted file mode 100644
      index 29d8699d461a85..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/_sub-array-dummy.js
      +++ /dev/null
      @@ -1,7 +0,0 @@
      -'use strict';
      -
      -var isArray = Array.isArray;
      -
      -module.exports = function (t, a) {
      -	t((t === null) || isArray(t.prototype), true);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/from/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/from/implement.js
      deleted file mode 100644
      index e0db846f99a0d9..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/from/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../array/from/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/from/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/from/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/from/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/from/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/from/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/from/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/from/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/from/shim.js
      deleted file mode 100644
      index 310302ac486645..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/from/shim.js
      +++ /dev/null
      @@ -1,60 +0,0 @@
      -// Some tests taken from: https://github.com/mathiasbynens/Array.from/blob/master/tests/tests.js
      -
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var o = [1, 2, 3], MyType;
      -	a.not(t(o), o, "Array");
      -	a.deep(t(o), o, "Array: same content");
      -	a.deep(t('12r3v'), ['1', '2', 'r', '3', 'v'], "String");
      -	a.deep(t((function () { return arguments; }(3, o, 'raz'))),
      -		[3, o, 'raz'], "Arguments");
      -	a.deep(t((function () { return arguments; }(3))), [3],
      -		"Arguments with one numeric value");
      -
      -	a.deep(t({ 0: 'raz', 1: 'dwa', length: 2 }), ['raz', 'dwa'], "Other");
      -
      -	a.deep(t(o, function (val) { return (val + 2) * 10; }, 10), [30, 40, 50],
      -		"Mapping");
      -
      -	a.throws(function () { t(); }, TypeError, "Undefined");
      -	a.deep(t(3), [], "Primitive");
      -
      -	a(t.length, 1, "Length");
      -	a.deep(t({ length: 0 }), [], "No values Array-like");
      -	a.deep(t({ length: -1 }), [], "Invalid length Array-like");
      -	a.deep(t({ length: -Infinity }), [], "Invalid length Array-like #2");
      -	a.throws(function () { t(undefined); }, TypeError, "Undefined");
      -	a.throws(function () { t(null); }, TypeError, "Null");
      -	a.deep(t(false), [], "Boolean");
      -	a.deep(t(-Infinity), [], "Inifity");
      -	a.deep(t(-0), [], "-0");
      -	a.deep(t(+0), [], "+0");
      -	a.deep(t(1), [], "1");
      -	a.deep(t(+Infinity), [], "+Infinity");
      -	a.deep(t({}), [], "Plain object");
      -	a.deep(t({ length: 1 }), [undefined], "Sparse array-like");
      -	a.deep(t({ '0': 'a', '1': 'b', length: 2 }, function (x) { return x + x; }), ['aa', 'bb'],
      -		"Map");
      -	a.deep(t({ '0': 'a', '1': 'b', length: 2 }, function (x) { return String(this); }, undefined),
      -		['undefined', 'undefined'], "Map context");
      -	a.deep(t({ '0': 'a', '1': 'b', length: 2 }, function (x) { return String(this); }, 'x'),
      -		['x', 'x'], "Map primitive context");
      -	a.throws(function () { t({}, 'foo', 'x'); }, TypeError, "Non callable for map");
      -
      -	a.deep(t.call(null, { length: 1, '0': 'a' }), ['a'], "Null context");
      -
      -	a(t({ __proto__: { '0': 'abc', length: 1 } })[0], 'abc', "Values on prototype");
      -
      -	a.throws(function () { t.call(function () { return Object.freeze({}); }, {}); },
      -		TypeError, "Contructor producing freezed objects");
      -
      -	// Ensure no setters are called for the indexes
      -	// Ensure no setters are called for the indexes
      -	MyType = function () {};
      -	Object.defineProperty(MyType.prototype, '0', {
      -		set: function (x) { throw new Error('Setter called: ' + x); }
      -	});
      -	a.deep(t.call(MyType, { '0': 'abc', length: 1 }), { '0': 'abc', length: 1 },
      -		"Defined not set");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/generate.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/generate.js
      deleted file mode 100644
      index d72e056887838b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/generate.js
      +++ /dev/null
      @@ -1,10 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var x = {}, y = {};
      -	a.deep(t(3), [undefined, undefined, undefined], "Just length");
      -	a.deep(t(0, 'x'), [], "No repeat");
      -	a.deep(t(1, x, y), [x], "Arguments length larger than repeat number");
      -	a.deep(t(3, x), [x, x, x], "Single argument");
      -	a.deep(t(5, x, y), [x, y, x, y, x], "Many arguments");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/is-plain-array.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/is-plain-array.js
      deleted file mode 100644
      index 871a08aec21ff9..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/is-plain-array.js
      +++ /dev/null
      @@ -1,18 +0,0 @@
      -'use strict';
      -
      -var SubArray = require('../../array/_sub-array-dummy-safe');
      -
      -module.exports = function (t, a) {
      -	var arr = [1, 2, 3];
      -	a(t(arr), true, "Array");
      -	a(t(null), false, "Null");
      -	a(t(), false, "Undefined");
      -	a(t('234'), false, "String");
      -	a(t(23), false, "Number");
      -	a(t({}), false, "Plain object");
      -	a(t({ length: 1, 0: 'raz' }), false, "Array-like");
      -	a(t(Object.create(arr)), false, "Array extension");
      -	if (!SubArray) return;
      -	a(t(new SubArray(23)), false, "Subclass instance");
      -	a(t(Array.prototype), false, "Array.prototype");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/of/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/of/implement.js
      deleted file mode 100644
      index 30d53be2d7abbe..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/of/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../array/of/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/of/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/of/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/of/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/of/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/of/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/of/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/of/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/of/shim.js
      deleted file mode 100644
      index e6974420c1c274..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/of/shim.js
      +++ /dev/null
      @@ -1,68 +0,0 @@
      -// Most tests taken from https://github.com/mathiasbynens/Array.of/blob/master/tests/tests.js
      -// Thanks @mathiasbynens
      -
      -'use strict';
      -
      -var defineProperty = Object.defineProperty;
      -
      -module.exports = function (t, a) {
      -	var x = {}, testObject, MyType;
      -
      -	a.deep(t(), [], "No arguments");
      -	a.deep(t(3), [3], "One numeric argument");
      -	a.deep(t(3, 'raz', null, x, undefined), [3, 'raz', null, x, undefined],
      -		"Many arguments");
      -
      -	a(t.length, 0, "Length");
      -
      -	a.deep(t('abc'), ['abc'], "String");
      -	a.deep(t(undefined), [undefined], "Undefined");
      -	a.deep(t(null), [null], "Null");
      -	a.deep(t(false), [false], "Boolean");
      -	a.deep(t(-Infinity), [-Infinity], "Infinity");
      -	a.deep(t(-0), [-0], "-0");
      -	a.deep(t(+0), [+0], "+0");
      -	a.deep(t(1), [1], "1");
      -	a.deep(t(1, 2, 3), [1, 2, 3], "Numeric args");
      -	a.deep(t(+Infinity), [+Infinity], "+Infinity");
      -	a.deep(t({ '0': 'a', '1': 'b', '2': 'c', length: 3 }),
      -		[{ '0': 'a', '1': 'b', '2': 'c', length: 3 }], "Array like");
      -	a.deep(t(undefined, null, false, -Infinity, -0, +0, 1, 2, +Infinity),
      -		[undefined, null, false, -Infinity, -0, +0, 1, 2, +Infinity], "Falsy arguments");
      -
      -	a.h1("Null context");
      -	a.deep(t.call(null, 'abc'), ['abc'], "String");
      -	a.deep(t.call(null, undefined), [undefined], "Undefined");
      -	a.deep(t.call(null, null), [null], "Null");
      -	a.deep(t.call(null, false), [false], "Boolean");
      -	a.deep(t.call(null, -Infinity), [-Infinity], "-Infinity");
      -	a.deep(t.call(null, -0), [-0], "-0");
      -	a.deep(t.call(null, +0), [+0], "+0");
      -	a.deep(t.call(null, 1), [1], "1");
      -	a.deep(t.call(null, 1, 2, 3), [1, 2, 3], "Numeric");
      -	a.deep(t.call(null, +Infinity), [+Infinity], "+Infinity");
      -	a.deep(t.call(null, { '0': 'a', '1': 'b', '2': 'c', length: 3 }),
      -		[{ '0': 'a', '1': 'b', '2': 'c', length: 3 }], "Array-like");
      -	a.deep(t.call(null, undefined, null, false, -Infinity, -0, +0, 1, 2, +Infinity),
      -		[undefined, null, false, -Infinity, -0, +0, 1, 2, +Infinity], "Falsy");
      -
      -	a.h1("Other constructor context");
      -	a.deep(t.call(Object, 1, 2, 3), { '0': 1, '1': 2, '2': 3, length: 3 }, "Many arguments");
      -
      -	testObject = Object(3);
      -	testObject[0] = 1;
      -	testObject[1] = 2;
      -	testObject[2] = 3;
      -	testObject.length = 3;
      -	a.deep(t.call(Object, 1, 2, 3), testObject, "Test object");
      -	a(t.call(Object).length, 0, "No arguments");
      -	a.throws(function () { t.call(function () { return Object.freeze({}); }); }, TypeError,
      -		"Frozen instance");
      -
      -	// Ensure no setters are called for the indexes
      -	MyType = function () {};
      -	defineProperty(MyType.prototype, '0', {
      -		set: function (x) { throw new Error('Setter called: ' + x); }
      -	});
      -	a.deep(t.call(MyType, 'abc'), { '0': 'abc', length: 1 }, "Define, not set");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/to-array.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/to-array.js
      deleted file mode 100644
      index 4985b5eaee9769..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/to-array.js
      +++ /dev/null
      @@ -1,13 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var o = [1, 2, 3];
      -	a(t(o), o, "Array");
      -	a.deep(t('12r3v'), ['1', '2', 'r', '3', 'v'], "String");
      -	a.deep(t((function () { return arguments; }(3, o, 'raz'))),
      -		[3, o, 'raz'], "Arguments");
      -	a.deep(t((function () { return arguments; }(3))), [3],
      -		"Arguments with one numeric value");
      -
      -	a.deep(t({ 0: 'raz', 1: 'dwa', length: 2 }), ['raz', 'dwa'], "Other");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/valid-array.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/valid-array.js
      deleted file mode 100644
      index 3732192d1bbd1f..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/valid-array.js
      +++ /dev/null
      @@ -1,14 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var x;
      -	a.throws(function () { t(); }, TypeError, "Undefined");
      -	a.throws(function () { t(null); }, TypeError, "Null");
      -	a.throws(function () { t(0); }, TypeError, "Number");
      -	a.throws(function () { t(true); }, TypeError, "Boolean");
      -	a.throws(function () { t('raz'); }, TypeError, "String");
      -	a.throws(function () { t(function () {}); }, TypeError, "Function");
      -	a.throws(function () { t({}); }, TypeError, "Object");
      -	a.throws(function () { t({ length: 0 }); }, TypeError, "Array-like");
      -	a(t(x = []), x, "Array");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/boolean/is-boolean.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/boolean/is-boolean.js
      deleted file mode 100644
      index 4e6b3cb73e4f3b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/boolean/is-boolean.js
      +++ /dev/null
      @@ -1,12 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t('arar'), false, "String");
      -	a(t(12), false, "Number");
      -	a(t(false), true, "Boolean");
      -	a(t(new Boolean(false)), true, "Boolean object");
      -	a(t(new Date()), false, "Date");
      -	a(t(new String('raz')), false, "String object");
      -	a(t({}), false, "Plain object");
      -	a(t(/a/), false, "Regular expression");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/#/copy.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/#/copy.js
      deleted file mode 100644
      index 767c5e16a4d053..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/#/copy.js
      +++ /dev/null
      @@ -1,10 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var o = new Date(), o2;
      -
      -	o2 = t.call(o);
      -	a.not(o, o2, "Different objects");
      -	a.ok(o2 instanceof Date, "Instance of Date");
      -	a(o.getTime(), o2.getTime(), "Same time");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/#/days-in-month.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/#/days-in-month.js
      deleted file mode 100644
      index 9ddba55f74ac40..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/#/days-in-month.js
      +++ /dev/null
      @@ -1,17 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t.call(new Date(2001, 0, 1)), 31, "January");
      -	a(t.call(new Date(2001, 1, 1)), 28, "February");
      -	a(t.call(new Date(2000, 1, 1)), 29, "February (leap)");
      -	a(t.call(new Date(2001, 2, 1)), 31, "March");
      -	a(t.call(new Date(2001, 3, 1)), 30, "April");
      -	a(t.call(new Date(2001, 4, 1)), 31, "May");
      -	a(t.call(new Date(2001, 5, 1)), 30, "June");
      -	a(t.call(new Date(2001, 6, 1)), 31, "July");
      -	a(t.call(new Date(2001, 7, 1)), 31, "August");
      -	a(t.call(new Date(2001, 8, 1)), 30, "September");
      -	a(t.call(new Date(2001, 9, 1)), 31, "October");
      -	a(t.call(new Date(2001, 10, 1)), 30, "November");
      -	a(t.call(new Date(2001, 11, 1)), 31, "December");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/#/floor-day.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/#/floor-day.js
      deleted file mode 100644
      index d4f4a9087c059e..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/#/floor-day.js
      +++ /dev/null
      @@ -1,6 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t.call(new Date(2000, 0, 1, 13, 32, 34, 234)).valueOf(),
      -		new Date(2000, 0, 1).valueOf());
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/#/floor-month.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/#/floor-month.js
      deleted file mode 100644
      index b4a81bef6d0850..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/#/floor-month.js
      +++ /dev/null
      @@ -1,6 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t.call(new Date(2000, 0, 15, 13, 32, 34, 234)).valueOf(),
      -		new Date(2000, 0, 1).valueOf());
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/#/floor-year.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/#/floor-year.js
      deleted file mode 100644
      index aae117e769b52c..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/#/floor-year.js
      +++ /dev/null
      @@ -1,6 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t.call(new Date(2000, 5, 13, 13, 32, 34, 234)).valueOf(),
      -		new Date(2000, 0, 1).valueOf());
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/#/format.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/#/format.js
      deleted file mode 100644
      index e68e4bf782ef30..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/#/format.js
      +++ /dev/null
      @@ -1,6 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var dt = new Date(2011, 2, 3, 3, 5, 5, 32);
      -	a(t.call(dt, ' %Y.%y.%m.%d.%H.%M.%S.%L '), ' 2011.11.03.03.03.05.05.032 ');
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/is-date.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/is-date.js
      deleted file mode 100644
      index 109093dfbe32f8..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/is-date.js
      +++ /dev/null
      @@ -1,10 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t('arar'), false, "String");
      -	a(t(12), false, "Number");
      -	a(t(true), false, "Boolean");
      -	a(t(new Date()), true, "Date");
      -	a(t(new String('raz')), false, "String object");
      -	a(t({}), false, "Plain object");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/valid-date.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/valid-date.js
      deleted file mode 100644
      index 98787e40781687..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/valid-date.js
      +++ /dev/null
      @@ -1,12 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var d = new Date();
      -	a(t(d), d, "Date");
      -	a.throws(function () {
      -		t({});
      -	}, "Object");
      -	a.throws(function () {
      -		t({ valueOf: function () { return 20; } });
      -	}, "Number object");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/error/#/throw.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/error/#/throw.js
      deleted file mode 100644
      index 1213cfc3b12791..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/error/#/throw.js
      +++ /dev/null
      @@ -1,10 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var e = new Error();
      -	try {
      -		t.call(e);
      -	} catch (e2) {
      -		a(e2, e);
      -	}
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/error/custom.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/error/custom.js
      deleted file mode 100644
      index d4ff500c9b30f2..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/error/custom.js
      +++ /dev/null
      @@ -1,12 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var T = t, err = new T('My Error', 'MY_ERROR', { errno: 123 });
      -	a(err instanceof Error, true, "Instance of error");
      -	a(err.constructor, Error, "Constructor");
      -	a(err.name, 'Error', "Name");
      -	a(String(err), 'Error: My Error', "String representation");
      -	a(err.code, 'MY_ERROR', "Code");
      -	a(err.errno, 123, "Errno");
      -	a(typeof err.stack, 'string', "Stack trace");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/error/is-error.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/error/is-error.js
      deleted file mode 100644
      index f8b5e2000eb769..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/error/is-error.js
      +++ /dev/null
      @@ -1,16 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t(), false, "Undefined");
      -	a(t(1), false, "Primitive");
      -	a(t({}), false, "Objectt");
      -	a(t({ toString: function () { return '[object Error]'; } }), false,
      -		"Fake error");
      -	a(t(new Error()), true, "Error");
      -	a(t(new EvalError()), true, "EvalError");
      -	a(t(new RangeError()), true, "RangeError");
      -	a(t(new ReferenceError()), true, "ReferenceError");
      -	a(t(new SyntaxError()), true, "SyntaxError");
      -	a(t(new TypeError()), true, "TypeError");
      -	a(t(new URIError()), true, "URIError");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/error/valid-error.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/error/valid-error.js
      deleted file mode 100644
      index e04cdb33b7cdf4..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/error/valid-error.js
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var e = new Error();
      -	a(t(e), e, "Error");
      -	a.throws(function () {
      -		t({});
      -	}, "Other");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/compose.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/compose.js
      deleted file mode 100644
      index 83de5e844ac87d..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/compose.js
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -'use strict';
      -
      -var f = function (a, b) { return ['a', arguments.length, a, b]; }
      -  , g = function (a) { return ['b', arguments.length].concat(a); }
      -  , h = function (a) { return ['c', arguments.length].concat(a); };
      -
      -module.exports = function (t, a) {
      -	a.deep(t.call(h, g, f)(1, 2), ['c', 1, 'b', 1, 'a', 2, 1, 2]);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/copy.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/copy.js
      deleted file mode 100644
      index 7a22e2f249276e..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/copy.js
      +++ /dev/null
      @@ -1,19 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var foo = 'raz', bar = 'dwa'
      -	  , fn = function marko(a, b) { return this + a + b + foo + bar; }
      -	  , result, o = {};
      -
      -	fn.prototype = o;
      -
      -	fn.foo = 'raz';
      -
      -	result = t.call(fn);
      -
      -	a(result.length, fn.length, "Length");
      -	a(result.name, fn.name, "Length");
      -	a(result.call('marko', 'el', 'fe'), 'markoelferazdwa', "Body");
      -	a(result.prototype, fn.prototype, "Prototype");
      -	a(result.foo, fn.foo, "Custom property");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/curry.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/curry.js
      deleted file mode 100644
      index 18fb0389e79b26..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/curry.js
      +++ /dev/null
      @@ -1,18 +0,0 @@
      -'use strict';
      -
      -var toArray = require('../../../array/to-array')
      -
      -  , f = function () { return toArray(arguments); };
      -
      -module.exports = function (t, a) {
      -	var x, y = {}, z;
      -	a.deep(t.call(f, 0, 1, 2)(3), [], "0 arguments");
      -	x = t.call(f, 5, {});
      -	a(x.length, 5, "Length #1");
      -	z = x(1, 2);
      -	a(z.length, 3, "Length #2");
      -	z = z(3, 4);
      -	a(z.length, 1, "Length #1");
      -	a.deep(z(5, 6), [1, 2, 3, 4, 5], "Many arguments");
      -	a.deep(x(8, 3)(y, 45)('raz', 6), [8, 3, y, 45, 'raz'], "Many arguments #2");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/lock.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/lock.js
      deleted file mode 100644
      index 44a12d7b56c748..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/lock.js
      +++ /dev/null
      @@ -1,7 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t.call(function () {
      -		return arguments.length;
      -	})(1, 2, 3), 0);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/not.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/not.js
      deleted file mode 100644
      index c0f5e9d4b989a5..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/not.js
      +++ /dev/null
      @@ -1,11 +0,0 @@
      -'use strict';
      -
      -var identity = require('../../../function/identity')
      -  , noop     = require('../../../function/noop');
      -
      -module.exports = function (t, a) {
      -	a(t.call(identity)(''), true, "Falsy");
      -	a(t.call(noop)(), true, "Undefined");
      -	a(t.call(identity)({}), false, "Any object");
      -	a(t.call(identity)(true), false, "True");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/partial.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/partial.js
      deleted file mode 100644
      index bd00ce752f5202..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/partial.js
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -'use strict';
      -
      -var toArray = require('../../../array/to-array')
      -
      -  , f = function () { return toArray(arguments); };
      -
      -module.exports = function (t, a) {
      -	a.deep(t.call(f, 1)(2, 3), [1, 2, 3]);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/spread.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/spread.js
      deleted file mode 100644
      index b82dfecfe95045..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/spread.js
      +++ /dev/null
      @@ -1,8 +0,0 @@
      -'use strict';
      -
      -var f = function (a, b) { return this[a] + this[b]; }
      -  , o = { a: 3, b: 4 };
      -
      -module.exports = function (t, a) {
      -	a(t.call(f).call(o, ['a', 'b']), 7);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/to-string-tokens.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/to-string-tokens.js
      deleted file mode 100644
      index 4c54d30354b405..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/to-string-tokens.js
      +++ /dev/null
      @@ -1,12 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a.deep(t.call(function (a, b) { return this[a] + this[b]; }),
      -		{ args: 'a, b', body: ' return this[a] + this[b]; ' });
      -	a.deep(t.call(function () {}),
      -		{ args: '', body: '' });
      -	a.deep(t.call(function (raz) {}),
      -		{ args: 'raz', body: '' });
      -	a.deep(t.call(function () { Object(); }),
      -		{ args: '', body: ' Object(); ' });
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/_define-length.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/_define-length.js
      deleted file mode 100644
      index 8f037e857eaa09..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/_define-length.js
      +++ /dev/null
      @@ -1,12 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var foo = 'raz', bar = 'dwa'
      -	  , fn = function (a, b) { return this + a + b + foo + bar; }
      -	  , result;
      -
      -	result = t(fn, 3);
      -	a(result.call('marko', 'el', 'fe'), 'markoelferazdwa', "Content");
      -	a(result.length, 3, "Length");
      -	a(result.prototype, fn.prototype, "Prototype");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/constant.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/constant.js
      deleted file mode 100644
      index fda52aa43710c1..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/constant.js
      +++ /dev/null
      @@ -1,7 +0,0 @@
      -'use strict';
      -
      -var o = {};
      -
      -module.exports = function (t, a) {
      -	a(t(o)(), o);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/identity.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/identity.js
      deleted file mode 100644
      index 8013e2e5af1288..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/identity.js
      +++ /dev/null
      @@ -1,7 +0,0 @@
      -'use strict';
      -
      -var o = {};
      -
      -module.exports = function (t, a) {
      -	a(t(o), o);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/invoke.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/invoke.js
      deleted file mode 100644
      index fcce4aaaaafb87..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/invoke.js
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -'use strict';
      -
      -var constant = require('../../function/constant')
      -
      -  , o = { b: constant('c') };
      -
      -module.exports = function (t, a) {
      -	a(t('b')(o), 'c');
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/is-arguments.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/is-arguments.js
      deleted file mode 100644
      index f8de8812a5035d..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/is-arguments.js
      +++ /dev/null
      @@ -1,11 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var args, dummy;
      -	args = (function () { return arguments; }());
      -	dummy = { '0': 1, '1': 2 };
      -	Object.defineProperty(dummy, 'length', { value: 2 });
      -	a(t(args), true, "Arguments");
      -	a(t(dummy), false, "Dummy");
      -	a(t([]), false, "Array");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/is-function.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/is-function.js
      deleted file mode 100644
      index 83acc42f9a6637..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/is-function.js
      +++ /dev/null
      @@ -1,8 +0,0 @@
      -'use strict';
      -
      -var o = { call: Function.prototype.call, apply: Function.prototype.apply };
      -
      -module.exports = function (t, a) {
      -	a(t(function () {}), true, "Function is function");
      -	a(t(o), false, "Plain object is not function");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/noop.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/noop.js
      deleted file mode 100644
      index 4305c6fcfd51cd..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/noop.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(typeof t(1, 2, 3), 'undefined');
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/pluck.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/pluck.js
      deleted file mode 100644
      index 5bf9583ad52b3e..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/pluck.js
      +++ /dev/null
      @@ -1,7 +0,0 @@
      -'use strict';
      -
      -var o = { foo: 'bar' };
      -
      -module.exports = function (t, a) {
      -	a(t('foo')(o), o.foo);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/valid-function.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/valid-function.js
      deleted file mode 100644
      index 59b16233b37978..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/valid-function.js
      +++ /dev/null
      @@ -1,17 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var f = function () {};
      -	a(t(f), f, "Function");
      -	f = new Function();
      -	a(t(f), f, "Function");
      -	a.throws(function () {
      -		t({});
      -	}, "Object");
      -	a.throws(function () {
      -		t(/re/);
      -	}, "RegExp");
      -	a.throws(function () {
      -		t({ call: function () { return 20; } });
      -	}, "Plain object");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/global.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/global.js
      deleted file mode 100644
      index 1f452aefb09827..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/global.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a.ok(t && typeof t === 'object');
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/iterable/for-each.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/iterable/for-each.js
      deleted file mode 100644
      index 0fed8ad898990e..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/iterable/for-each.js
      +++ /dev/null
      @@ -1,40 +0,0 @@
      -'use strict';
      -
      -var ArrayIterator = require('es6-iterator/array')
      -
      -  , slice = Array.prototype.slice;
      -
      -module.exports = function (t, a) {
      -	var i = 0, x = ['raz', 'dwa', 'trzy'], y = {};
      -	t(x, function () {
      -		a.deep(slice.call(arguments, 0, 1), [x[i]], "Array " + i + "#");
      -		a(this, y, "Array: context:  " + (i++) + "#");
      -	}, y);
      -	i = 0;
      -	t((function () { return arguments; }('raz', 'dwa', 'trzy')), function () {
      -		a.deep(slice.call(arguments, 0, 1), [x[i]], "Arguments" + i + "#");
      -		a(this, y, "Arguments: context:  " + (i++) + "#");
      -	}, y);
      -	i = 0;
      -	t({ 0: 'raz', 1: 'dwa', 2: 'trzy', length: 3 }, function () {
      -		a.deep(slice.call(arguments, 0, 1), [x[i]], "Array-like" + i + "#");
      -		a(this, y, "Array-like: context:  " + (i++) + "#");
      -	}, y);
      -	i = 0;
      -	t(x = 'foo', function () {
      -		a.deep(slice.call(arguments, 0, 1), [x[i]], "String " + i + "#");
      -		a(this, y, "Regular String: context:  " + (i++) + "#");
      -	}, y);
      -	i = 0;
      -	x = ['r', '💩', 'z'];
      -	t('r💩z', function () {
      -		a.deep(slice.call(arguments, 0, 1), [x[i]], "String " + i + "#");
      -		a(this, y, "Unicode String: context:  " + (i++) + "#");
      -	}, y);
      -	i = 0;
      -	t(new ArrayIterator(x), function () {
      -		a.deep(slice.call(arguments, 0, 1), [x[i]], "Iterator " + i + "#");
      -		a(this, y, "Iterator: context:  " + (i++) + "#");
      -	}, y);
      -
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/iterable/is.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/iterable/is.js
      deleted file mode 100644
      index c0d2a43ebfe17c..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/iterable/is.js
      +++ /dev/null
      @@ -1,20 +0,0 @@
      -'use strict';
      -
      -var iteratorSymbol = require('es6-symbol').iterator;
      -
      -module.exports = function (t, a) {
      -	var x;
      -	a(t([]), true, "Array");
      -	a(t(""), true, "String");
      -	a(t((function () { return arguments; }())), true, "Arguments");
      -	a(t({ length: 0 }), true, "List object");
      -	a(t(function () {}), false, "Function");
      -	a(t({}), false, "Plain object");
      -	a(t(/raz/), false, "Regexp");
      -	a(t(), false, "No argument");
      -	a(t(null), false, "Null");
      -	a(t(undefined), false, "Undefined");
      -	x = {};
      -	x[iteratorSymbol] = function () {};
      -	a(t(x), true, "Iterable");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/iterable/validate-object.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/iterable/validate-object.js
      deleted file mode 100644
      index da12529bc0368c..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/iterable/validate-object.js
      +++ /dev/null
      @@ -1,20 +0,0 @@
      -'use strict';
      -
      -var iteratorSymbol = require('es6-symbol').iterator;
      -
      -module.exports = function (t, a) {
      -	var x;
      -	a.throws(function () { t(0); }, TypeError, "0");
      -	a.throws(function () { t(false); }, TypeError, "false");
      -	a.throws(function () { t(''); }, TypeError, "String");
      -	a.throws(function () { t({}); }, TypeError, "Plain Object");
      -	a.throws(function () { t(function () {}); }, TypeError, "Function");
      -	a(t(x = new String('raz')), x, "String object"); //jslint: ignore
      -
      -	a(t(x = { length: 1 }), x, "Array like");
      -	a.throws(function () { t(); }, TypeError, "Undefined");
      -	a.throws(function () { t(null); }, TypeError, "null");
      -	x = {};
      -	x[iteratorSymbol] = function () {};
      -	a(t(x), x, "Iterable");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/iterable/validate.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/iterable/validate.js
      deleted file mode 100644
      index bcc2ad3d0aa1c9..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/iterable/validate.js
      +++ /dev/null
      @@ -1,20 +0,0 @@
      -'use strict';
      -
      -var iteratorSymbol = require('es6-symbol').iterator;
      -
      -module.exports = function (t, a) {
      -	var x;
      -	a.throws(function () { t(0); }, TypeError, "0");
      -	a.throws(function () { t(false); }, TypeError, "false");
      -	a(t(''), '', "''");
      -	a.throws(function () { t({}); }, TypeError, "Plain Object");
      -	a.throws(function () { t(function () {}); }, TypeError, "Function");
      -	a(t(x = new String('raz')), x, "String object"); //jslint: ignore
      -
      -	a(t(x = { length: 1 }), x, "Array like");
      -	a.throws(function () { t(); }, TypeError, "Undefined");
      -	a.throws(function () { t(null); }, TypeError, "null");
      -	x = {};
      -	x[iteratorSymbol] = function () {};
      -	a(t(x), x, "Iterable");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/_pack-ieee754.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/_pack-ieee754.js
      deleted file mode 100644
      index 9041431d7769c9..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/_pack-ieee754.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a.deep(t(1.337, 8, 23), [63, 171, 34, 209]);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/_unpack-ieee754.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/_unpack-ieee754.js
      deleted file mode 100644
      index ca30b8208dbb95..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/_unpack-ieee754.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a.deep(t([63, 171, 34, 209], 8, 23), 1.3370000123977661);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/acosh/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/acosh/implement.js
      deleted file mode 100644
      index 01fb6d08224e2a..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/acosh/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../math/acosh/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/acosh/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/acosh/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/acosh/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/acosh/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/acosh/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/acosh/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/acosh/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/acosh/shim.js
      deleted file mode 100644
      index 3d710c7930d454..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/acosh/shim.js
      +++ /dev/null
      @@ -1,11 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t({}), NaN, "NaN");
      -	a(t(-1), NaN, "Negative");
      -	a(t(0), NaN, "Zero");
      -	a(t(0.5), NaN, "Below 1");
      -	a(t(1), 0, "1");
      -	a(t(2), 1.3169578969248166, "Other");
      -	a(t(Infinity), Infinity, "Infinity");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/asinh/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/asinh/implement.js
      deleted file mode 100644
      index d1fceceee13449..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/asinh/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../math/asinh/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/asinh/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/asinh/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/asinh/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/asinh/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/asinh/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/asinh/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/asinh/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/asinh/shim.js
      deleted file mode 100644
      index d9fbe49edc2d99..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/asinh/shim.js
      +++ /dev/null
      @@ -1,10 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t({}), NaN, "NaN");
      -	a(t(0), 0, "Zero");
      -	a(t(Infinity), Infinity, "Infinity");
      -	a(t(-Infinity), -Infinity, "-Infinity");
      -	a(t(-2), -1.4436354751788103, "Negative");
      -	a(t(2), 1.4436354751788103, "Positive");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/atanh/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/atanh/implement.js
      deleted file mode 100644
      index cba8fad83e4082..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/atanh/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../math/atanh/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/atanh/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/atanh/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/atanh/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/atanh/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/atanh/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/atanh/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/atanh/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/atanh/shim.js
      deleted file mode 100644
      index a857b496686048..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/atanh/shim.js
      +++ /dev/null
      @@ -1,11 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t({}), NaN, "NaN");
      -	a(t(-2), NaN, "Less than -1");
      -	a(t(2), NaN, "Greater than 1");
      -	a(t(-1), -Infinity, "-1");
      -	a(t(1), Infinity, "1");
      -	a(t(0), 0, "Zero");
      -	a(t(0.5), 0.5493061443340549, "Ohter");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cbrt/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cbrt/implement.js
      deleted file mode 100644
      index 374d4b383f5c5f..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cbrt/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../math/cbrt/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cbrt/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cbrt/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cbrt/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cbrt/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cbrt/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cbrt/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cbrt/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cbrt/shim.js
      deleted file mode 100644
      index 43ab68b848f61a..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cbrt/shim.js
      +++ /dev/null
      @@ -1,11 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t({}), NaN, "NaN");
      -	a(t(0), 0, "Zero");
      -	a(t(Infinity), Infinity, "Infinity");
      -	a(t(-Infinity), -Infinity, "-Infinity");
      -	a(t(-1), -1, "-1");
      -	a(t(1), 1, "1");
      -	a(t(2), 1.2599210498948732, "Ohter");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/clz32/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/clz32/implement.js
      deleted file mode 100644
      index 44f8815526b7ec..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/clz32/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../math/clz32/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/clz32/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/clz32/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/clz32/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/clz32/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/clz32/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/clz32/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/clz32/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/clz32/shim.js
      deleted file mode 100644
      index a769b39b85b644..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/clz32/shim.js
      +++ /dev/null
      @@ -1,12 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t(1), 31, "1");
      -	a(t(1000), 22, "1000");
      -	a(t(), 32, "No arguments");
      -	a(t(Infinity), 32, "Infinity");
      -	a(t(-Infinity), 32, "-Infinity");
      -	a(t("foo"), 32, "String");
      -	a(t(true), 31, "Boolean");
      -	a(t(3.5), 30, "Float");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cosh/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cosh/implement.js
      deleted file mode 100644
      index f3c712b1dfc977..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cosh/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../math/cosh/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cosh/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cosh/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cosh/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cosh/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cosh/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cosh/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cosh/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cosh/shim.js
      deleted file mode 100644
      index 419c12367dbcd2..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cosh/shim.js
      +++ /dev/null
      @@ -1,13 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t({}), NaN, "NaN");
      -	a(t(0), 1, "Zero");
      -	a(t(Infinity), Infinity, "Infinity");
      -	a(t(-Infinity), Infinity, "-Infinity");
      -	a(t(1), 1.5430806348152437, "1");
      -	a(t(Number.MAX_VALUE), Infinity);
      -	a(t(-Number.MAX_VALUE), Infinity);
      -	a(t(Number.MIN_VALUE), 1);
      -	a(t(-Number.MIN_VALUE), 1);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/expm1/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/expm1/implement.js
      deleted file mode 100644
      index c21296725dc07b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/expm1/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../math/expm1/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/expm1/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/expm1/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/expm1/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/expm1/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/expm1/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/expm1/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/expm1/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/expm1/shim.js
      deleted file mode 100644
      index 15f0e796ce565b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/expm1/shim.js
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t({}), NaN, "NaN");
      -	a(t(0), 0, "Zero");
      -	a(t(Infinity), Infinity, "Infinity");
      -	a(t(-Infinity), -1, "-Infinity");
      -	a(t(1).toFixed(15), '1.718281828459045', "1");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/fround/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/fround/implement.js
      deleted file mode 100644
      index c909af7c300b22..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/fround/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../math/fround/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/fround/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/fround/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/fround/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/fround/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/fround/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/fround/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/fround/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/fround/shim.js
      deleted file mode 100644
      index 4ef6d4ea9b199b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/fround/shim.js
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t({}), NaN, "NaN");
      -	a(t(0), 0, "Zero");
      -	a(t(Infinity), Infinity, "Infinity");
      -	a(t(-Infinity), -Infinity, "-Infinity");
      -	a(t(1.337), 1.3370000123977661, "1");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/hypot/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/hypot/implement.js
      deleted file mode 100644
      index 99466464c122bc..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/hypot/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../math/hypot/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/hypot/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/hypot/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/hypot/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/hypot/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/hypot/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/hypot/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/hypot/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/hypot/shim.js
      deleted file mode 100644
      index 91d950a5d32899..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/hypot/shim.js
      +++ /dev/null
      @@ -1,11 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t(), 0, "No arguments");
      -	a(t(0, -0, 0), 0, "Zeros");
      -	a(t(4, NaN, Infinity), Infinity, "Infinity");
      -	a(t(4, NaN, -Infinity), Infinity, "Infinity");
      -	a(t(4, NaN, 34), NaN, "NaN");
      -	a(t(3, 4), 5, "#1");
      -	a(t(3, 4, 5), 7.0710678118654755, "#2");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/imul/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/imul/implement.js
      deleted file mode 100644
      index 7b2a2a61653299..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/imul/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../math/imul/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/imul/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/imul/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/imul/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/imul/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/imul/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/imul/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/imul/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/imul/shim.js
      deleted file mode 100644
      index a2ca7fe78321ce..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/imul/shim.js
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t(), 0, "No arguments");
      -	a(t(0, 0), 0, "Zeros");
      -	a(t(2, 4), 8, "#1");
      -	a(t(-1, 8), -8, "#2");
      -	a(t(0xfffffffe, 5), -10, "#3");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log10/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log10/implement.js
      deleted file mode 100644
      index 4b3b4a4569fb81..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log10/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../math/log10/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log10/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log10/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log10/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log10/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log10/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log10/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log10/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log10/shim.js
      deleted file mode 100644
      index 5fa0d5be3af861..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log10/shim.js
      +++ /dev/null
      @@ -1,10 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t({}), NaN, "NaN");
      -	a(t(-0.5), NaN, "Less than 0");
      -	a(t(0), -Infinity, "0");
      -	a(t(1), 0, "1");
      -	a(t(Infinity), Infinity, "Infinity");
      -	a(t(2), 0.3010299956639812, "Other");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log1p/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log1p/implement.js
      deleted file mode 100644
      index 5d269bd3eaf09b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log1p/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../math/log1p/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log1p/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log1p/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log1p/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log1p/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log1p/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log1p/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log1p/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log1p/shim.js
      deleted file mode 100644
      index d495ce0496b76d..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log1p/shim.js
      +++ /dev/null
      @@ -1,10 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t({}), NaN, "NaN");
      -	a(t(-1.5), NaN, "Less than -1");
      -	a(t(-1), -Infinity, "-1");
      -	a(t(0), 0, "0");
      -	a(t(Infinity), Infinity, "Infinity");
      -	a(t(1), 0.6931471805599453, "Other");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log2/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log2/implement.js
      deleted file mode 100644
      index 92b501ac72abed..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log2/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../math/log2/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log2/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log2/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log2/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log2/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log2/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log2/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log2/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log2/shim.js
      deleted file mode 100644
      index faa9c32a8537ab..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log2/shim.js
      +++ /dev/null
      @@ -1,10 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t({}), NaN, "NaN");
      -	a(t(-0.5), NaN, "Less than 0");
      -	a(t(0), -Infinity, "0");
      -	a(t(1), 0, "1");
      -	a(t(Infinity), Infinity, "Infinity");
      -	a(t(3).toFixed(15), '1.584962500721156', "Other");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sign/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sign/implement.js
      deleted file mode 100644
      index 5875c42d608eb4..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sign/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../math/sign/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sign/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sign/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sign/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sign/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sign/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sign/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sign/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sign/shim.js
      deleted file mode 100644
      index b6b89c15889dc4..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sign/shim.js
      +++ /dev/null
      @@ -1,11 +0,0 @@
      -'use strict';
      -
      -var is = require('../../../object/is');
      -
      -module.exports = function (t, a) {
      -	a(is(t(0), +0), true, "+0");
      -	a(is(t(-0), -0), true, "-0");
      -	a(t({}), NaN, true, "NaN");
      -	a(t(-234234234), -1, "Negative");
      -	a(t(234234234), 1, "Positive");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sinh/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sinh/implement.js
      deleted file mode 100644
      index e52089e4507156..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sinh/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../math/sinh/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sinh/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sinh/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sinh/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sinh/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sinh/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sinh/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sinh/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sinh/shim.js
      deleted file mode 100644
      index 4f63b59e735bf0..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sinh/shim.js
      +++ /dev/null
      @@ -1,13 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t({}), NaN, "NaN");
      -	a(t(0), 0, "Zero");
      -	a(t(Infinity), Infinity, "Infinity");
      -	a(t(-Infinity), -Infinity, "-Infinity");
      -	a(t(1), 1.1752011936438014, "1");
      -	a(t(Number.MAX_VALUE), Infinity);
      -	a(t(-Number.MAX_VALUE), -Infinity);
      -	a(t(Number.MIN_VALUE), 5e-324);
      -	a(t(-Number.MIN_VALUE), -5e-324);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/tanh/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/tanh/implement.js
      deleted file mode 100644
      index a96bf193366b30..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/tanh/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../math/tanh/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/tanh/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/tanh/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/tanh/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/tanh/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/tanh/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/tanh/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/tanh/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/tanh/shim.js
      deleted file mode 100644
      index 2c67aaf47049fd..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/tanh/shim.js
      +++ /dev/null
      @@ -1,11 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t({}), NaN, "NaN");
      -	a(t(0), 0, "Zero");
      -	a(t(Infinity), 1, "Infinity");
      -	a(t(-Infinity), -1, "-Infinity");
      -	a(t(1), 0.7615941559557649, "1");
      -	a(t(Number.MAX_VALUE), 1);
      -	a(t(-Number.MAX_VALUE), -1);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/trunc/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/trunc/implement.js
      deleted file mode 100644
      index 1830e61f69794d..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/trunc/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../math/trunc/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/trunc/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/trunc/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/trunc/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/trunc/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/trunc/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/trunc/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/trunc/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/trunc/shim.js
      deleted file mode 100644
      index 9e5eed7910e13c..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/trunc/shim.js
      +++ /dev/null
      @@ -1,16 +0,0 @@
      -'use strict';
      -
      -var is = require('../../../object/is');
      -
      -module.exports = function (t, a) {
      -	a(t({}), NaN, "NaN");
      -	a(t(0), 0, "Zero");
      -	a(t(Infinity), Infinity, "Infinity");
      -	a(t(-Infinity), -Infinity, "-Infinity");
      -	a(is(t(0.234), 0), true, "0");
      -	a(is(t(-0.234), -0), true, "-0");
      -	a(t(13.7), 13, "Positive #1");
      -	a(t(12.3), 12, "Positive #2");
      -	a(t(-12.3), -12, "Negative #1");
      -	a(t(-14.7), -14, "Negative #2");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/#/pad.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/#/pad.js
      deleted file mode 100644
      index e02082353348dc..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/#/pad.js
      +++ /dev/null
      @@ -1,7 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t.call(78, 4), '0078');
      -	a(t.call(65.12323, 4, 3), '0065.123', "Precision");
      -	a(t.call(65, 4, 3), '0065.000', "Precision integer");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/epsilon/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/epsilon/implement.js
      deleted file mode 100644
      index 574da75dcebb7f..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/epsilon/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../number/epsilon/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/epsilon/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/epsilon/index.js
      deleted file mode 100644
      index c892fd47d41c16..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/epsilon/index.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(typeof t, 'number');
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/epsilon/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/epsilon/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/epsilon/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-finite/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-finite/implement.js
      deleted file mode 100644
      index b35345fa6ee762..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-finite/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../number/is-finite/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-finite/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-finite/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-finite/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-finite/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-finite/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-finite/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-finite/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-finite/shim.js
      deleted file mode 100644
      index 5205d1c2602520..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-finite/shim.js
      +++ /dev/null
      @@ -1,8 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t(2), true, "Number");
      -	a(t('23'), false, "Not numeric");
      -	a(t(NaN), false, "NaN");
      -	a(t(Infinity), false, "Infinity");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-integer/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-integer/implement.js
      deleted file mode 100644
      index 127149ceeda9b5..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-integer/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../number/is-integer/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-integer/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-integer/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-integer/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-integer/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-integer/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-integer/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-integer/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-integer/shim.js
      deleted file mode 100644
      index 3f3985c3a05522..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-integer/shim.js
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t(2), true, "Number");
      -	a(t(2.34), false, "Float");
      -	a(t('23'), false, "Not numeric");
      -	a(t(NaN), false, "NaN");
      -	a(t(Infinity), false, "Infinity");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-nan/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-nan/implement.js
      deleted file mode 100644
      index 2f01d6d30ad9f6..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-nan/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../number/is-nan/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-nan/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-nan/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-nan/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-nan/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-nan/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-nan/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-nan/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-nan/shim.js
      deleted file mode 100644
      index 425723e74b07b9..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-nan/shim.js
      +++ /dev/null
      @@ -1,7 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t(2), false, "Number");
      -	a(t({}), false, "Not numeric");
      -	a(t(NaN), true, "NaN");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-number.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-number.js
      deleted file mode 100644
      index 275133476a61ff..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-number.js
      +++ /dev/null
      @@ -1,13 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t(0), true, "Zero");
      -	a(t(NaN), true, "NaN");
      -	a(t(Infinity), true, "Infinity");
      -	a(t(12), true, "Number");
      -	a(t(false), false, "Boolean");
      -	a(t(new Date()), false, "Date");
      -	a(t(new Number(2)), true, "Number object");
      -	a(t('asdfaf'), false, "String");
      -	a(t(''), false, "Empty String");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-safe-integer/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-safe-integer/implement.js
      deleted file mode 100644
      index 33667e2e9afb60..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-safe-integer/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../number/is-safe-integer/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-safe-integer/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-safe-integer/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-safe-integer/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-safe-integer/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-safe-integer/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-safe-integer/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-safe-integer/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-safe-integer/shim.js
      deleted file mode 100644
      index 77e06674711795..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-safe-integer/shim.js
      +++ /dev/null
      @@ -1,11 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t(2), true, "Number");
      -	a(t(2.34), false, "Float");
      -	a(t(Math.pow(2, 53)), false, "Too large");
      -	a(t(Math.pow(2, 53) - 1), true, "Maximum");
      -	a(t('23'), false, "Not numeric");
      -	a(t(NaN), false, "NaN");
      -	a(t(Infinity), false, "Infinity");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/max-safe-integer/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/max-safe-integer/implement.js
      deleted file mode 100644
      index bef00ca413d3cb..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/max-safe-integer/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../number/max-safe-integer/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/max-safe-integer/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/max-safe-integer/index.js
      deleted file mode 100644
      index c892fd47d41c16..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/max-safe-integer/index.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(typeof t, 'number');
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/max-safe-integer/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/max-safe-integer/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/max-safe-integer/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/min-safe-integer/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/min-safe-integer/implement.js
      deleted file mode 100644
      index fa440248bf47a6..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/min-safe-integer/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../number/min-safe-integer/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/min-safe-integer/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/min-safe-integer/index.js
      deleted file mode 100644
      index c892fd47d41c16..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/min-safe-integer/index.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(typeof t, 'number');
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/min-safe-integer/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/min-safe-integer/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/min-safe-integer/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/to-integer.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/to-integer.js
      deleted file mode 100644
      index ff326ba7a95bbb..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/to-integer.js
      +++ /dev/null
      @@ -1,10 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t({}), 0, "NaN");
      -	a(t(20), 20, "Positive integer");
      -	a(t('-20'), -20, "String negative integer");
      -	a(t(Infinity), Infinity, "Infinity");
      -	a(t(15.343), 15, "Float");
      -	a(t(-15.343), -15, "Negative float");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/to-pos-integer.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/to-pos-integer.js
      deleted file mode 100644
      index 2f3b4e674ecc4b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/to-pos-integer.js
      +++ /dev/null
      @@ -1,10 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t({}), 0, "NaN");
      -	a(t(20), 20, "Positive integer");
      -	a(t(-20), 0, "Negative integer");
      -	a(t(Infinity), Infinity, "Infinity");
      -	a(t(15.343), 15, "Float");
      -	a(t(-15.343), 0, "Negative float");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/to-uint32.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/to-uint32.js
      deleted file mode 100644
      index 00d05bdfe346d7..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/to-uint32.js
      +++ /dev/null
      @@ -1,8 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t({}), 0, "Not numeric");
      -	a(t(-4), 4294967292, "Negative");
      -	a(t(133432), 133432, "Positive");
      -	a(t(8589934592), 0, "Greater than maximum");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/_iterate.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/_iterate.js
      deleted file mode 100644
      index 179afed88ee845..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/_iterate.js
      +++ /dev/null
      @@ -1,30 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var o = { raz: 1, dwa: 2, trzy: 3 }
      -	  , o2 = {}, o3 = {}, arr, i = -1;
      -
      -	t = t('forEach');
      -	t(o, function (value, name, self, index) {
      -		o2[name] = value;
      -		a(index, ++i, "Index");
      -		a(self, o, "Self");
      -		a(this, o3, "Scope");
      -	}, o3);
      -	a.deep(o2, o);
      -
      -	arr = [];
      -	o2 = {};
      -	i = -1;
      -	t(o, function (value, name, self, index) {
      -		arr.push(value);
      -		o2[name] = value;
      -		a(index, ++i, "Index");
      -		a(self, o, "Self");
      -		a(this, o3, "Scope");
      -	}, o3, function (a, b) {
      -		return o[b] - o[a];
      -	});
      -	a.deep(o2, o, "Sort by Values: Content");
      -	a.deep(arr, [3, 2, 1], "Sort by Values: Order");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/assign/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/assign/implement.js
      deleted file mode 100644
      index 40065594187cb9..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/assign/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../object/assign/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/assign/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/assign/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/assign/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/assign/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/assign/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/assign/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/assign/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/assign/shim.js
      deleted file mode 100644
      index 9afe5f658c45b7..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/assign/shim.js
      +++ /dev/null
      @@ -1,11 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var o1 = { a: 1, b: 2 }
      -	  , o2 = { b: 3, c: 4 };
      -
      -	a(t(o1, o2), o1, "Returns self");
      -	a.deep(o1, { a: 1, b: 3, c: 4 }, "Single: content");
      -
      -	a.deep(t({}, o1, o2), { a: 1, b: 3, c: 4 }, "Multi argument");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/clear.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/clear.js
      deleted file mode 100644
      index bfc08cc208420b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/clear.js
      +++ /dev/null
      @@ -1,13 +0,0 @@
      -'use strict';
      -
      -var isEmpty = require('../../object/is-empty');
      -
      -module.exports = function (t, a) {
      -	var x = {};
      -	a(t(x), x, "Empty: Returns same object");
      -	a(isEmpty(x), true, "Empty: Not changed");
      -	x.foo = 'raz';
      -	x.bar = 'dwa';
      -	a(t(x), x, "Same object");
      -	a(isEmpty(x), true, "Emptied");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/compact.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/compact.js
      deleted file mode 100644
      index 9c9064c7886445..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/compact.js
      +++ /dev/null
      @@ -1,14 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var x = {}, y = {}, z;
      -	z = t(x);
      -	a.not(z, x, "Returns different object");
      -	a.deep(z, {}, "Empty on empty");
      -
      -	x = { foo: 'bar', a: 0, b: false, c: '', d: '0', e: null, bar: y,
      -		elo: undefined };
      -	z = t(x);
      -	a.deep(z, { foo: 'bar', a: 0, b: false, c: '', d: '0', bar: y },
      -		"Cleared null values");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/compare.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/compare.js
      deleted file mode 100644
      index cb9424109c334b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/compare.js
      +++ /dev/null
      @@ -1,13 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var d = new Date();
      -
      -	a.ok(t(12, 3) > 0, "Numbers");
      -	a.ok(t(2, 13) < 0, "Numbers #2");
      -	a.ok(t("aaa", "aa") > 0, "Strings");
      -	a.ok(t("aa", "ab") < 0, "Strings #2");
      -	a(t("aa", "aa"), 0, "Strings same");
      -	a(t(d, new Date(d.getTime())), 0, "Same date");
      -	a.ok(t(d, new Date(d.getTime() + 1)) < 0, "Different date");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/copy-deep.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/copy-deep.js
      deleted file mode 100644
      index a4023bc8ac4bf6..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/copy-deep.js
      +++ /dev/null
      @@ -1,24 +0,0 @@
      -'use strict';
      -
      -var stringify = JSON.stringify;
      -
      -module.exports = function (t, a) {
      -	var o = { 1: 'raz', 2: 'dwa', 3: 'trzy' }
      -	  , no = t(o);
      -
      -	a.not(no, o, "Return different object");
      -	a(stringify(no), stringify(o), "Match properties and values");
      -
      -	o = { foo: 'bar', raz: { dwa: 'dwa',
      -		trzy: { cztery: 'pięć', 'sześć': 'siedem' }, osiem: {},
      -		'dziewięć': function () { } }, 'dziesięć': 10 };
      -	o.raz.rec = o;
      -
      -	no = t(o);
      -	a.not(o.raz, no.raz, "Deep");
      -	a.not(o.raz.trzy, no.raz.trzy, "Deep #2");
      -	a(stringify(o.raz.trzy), stringify(no.raz.trzy), "Deep content");
      -	a(no.raz.rec, no, "Recursive");
      -	a.not(o.raz.osiem, no.raz.osiem, "Empty object");
      -	a(o.raz['dziewięć'], no.raz['dziewięć'], "Function");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/copy.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/copy.js
      deleted file mode 100644
      index 2f222ef809c6d7..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/copy.js
      +++ /dev/null
      @@ -1,19 +0,0 @@
      -'use strict';
      -
      -var stringify = JSON.stringify;
      -
      -module.exports = function (t, a) {
      -	var o = { 1: 'raz', 2: 'dwa', 3: 'trzy' }
      -	  , no = t(o);
      -
      -	a.not(no, o, "Return different object");
      -	a(stringify(no), stringify(o), "Match properties and values");
      -
      -	o = { foo: 'bar', raz: { dwa: 'dwa',
      -		trzy: { cztery: 'pięć', 'sześć': 'siedem' }, osiem: {},
      -		'dziewięć': function () { } }, 'dziesięć': 10 };
      -	o.raz.rec = o;
      -
      -	no = t(o);
      -	a(o.raz, no.raz, "Shallow");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/count.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/count.js
      deleted file mode 100644
      index 494f4f163515eb..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/count.js
      +++ /dev/null
      @@ -1,11 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t({}), 0, "Empty");
      -	a(t({ raz: 1, dwa: null, trzy: undefined, cztery: 0 }), 4,
      -		"Some properties");
      -	a(t(Object.defineProperties({}, {
      -		raz: { value: 'raz' },
      -		dwa: { value: 'dwa', enumerable: true }
      -	})), 1, "Some properties hidden");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/create.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/create.js
      deleted file mode 100644
      index 8b7be214136d2f..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/create.js
      +++ /dev/null
      @@ -1,22 +0,0 @@
      -'use strict';
      -
      -var setPrototypeOf = require('../../object/set-prototype-of')
      -
      -  , getPrototypeOf = Object.getPrototypeOf;
      -
      -module.exports = function (t, a) {
      -	var x = {}, obj;
      -
      -	a(getPrototypeOf(t(x)), x, "Normal object");
      -	a(getPrototypeOf(t(null)),
      -		(setPrototypeOf && setPrototypeOf.nullPolyfill) || null, "Null");
      -
      -	a.h1("Properties");
      -	a.h2("Normal object");
      -	a(getPrototypeOf(obj = t(x, { foo: { value: 'bar' } })), x, "Prototype");
      -	a(obj.foo, 'bar', "Property");
      -	a.h2("Null");
      -	a(getPrototypeOf(obj = t(null, { foo: { value: 'bar2' } })),
      -		(setPrototypeOf && setPrototypeOf.nullPolyfill) || null, "Prototype");
      -	a(obj.foo, 'bar2', "Property");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/eq.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/eq.js
      deleted file mode 100644
      index 02b3f0027cbf82..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/eq.js
      +++ /dev/null
      @@ -1,12 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var o = {};
      -	a(t(o, {}), false, "Different objects");
      -	a(t(o, o), true, "Same objects");
      -	a(t('1', '1'), true, "Same primitive");
      -	a(t('1', 1), false, "Different primitive types");
      -	a(t(NaN, NaN), true, "NaN");
      -	a(t(0, 0), true, "0,0");
      -	a(t(0, -0), true, "0,-0");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/every.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/every.js
      deleted file mode 100644
      index 07d5bbbd61f7af..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/every.js
      +++ /dev/null
      @@ -1,21 +0,0 @@
      -'use strict';
      -
      -var o = { 1: 1, 2: 2, 3: 3 };
      -
      -module.exports = function (t, a) {
      -	var o2 = {};
      -	t(o, function (value, name) {
      -		o2[name] = value;
      -		return true;
      -	});
      -	a(JSON.stringify(o2), JSON.stringify(o), "Iterates");
      -
      -	a(t(o, function () {
      -		return true;
      -	}), true, "Succeeds");
      -
      -	a(t(o, function () {
      -		return false;
      -	}), false, "Fails");
      -
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/filter.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/filter.js
      deleted file mode 100644
      index 7307da8640fcd1..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/filter.js
      +++ /dev/null
      @@ -1,6 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a.deep(t({ 1: 1, 2: 2, 3: 3, 4: 4 },
      -		function (value) { return Boolean(value % 2); }), { 1: 1, 3: 3 });
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/first-key.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/first-key.js
      deleted file mode 100644
      index 8169cd235344d9..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/first-key.js
      +++ /dev/null
      @@ -1,13 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var x = {}, y = Object.create(null);
      -	a(t(x), null, "Normal: Empty");
      -	a(t(y), null, "Null extension: Empty");
      -	x.foo = 'raz';
      -	x.bar = 343;
      -	a(['foo', 'bar'].indexOf(t(x)) !== -1, true, "Normal");
      -	y.elo = 'foo';
      -	y.mar = 'wew';
      -	a(['elo', 'mar'].indexOf(t(y)) !== -1, true, "Null extension");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/flatten.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/flatten.js
      deleted file mode 100644
      index ca342eab9c8ae4..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/flatten.js
      +++ /dev/null
      @@ -1,6 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a.deep(t({ a: { aa: 1, ab: 2 }, b: { ba: 3, bb: 4 } }),
      -		{ aa: 1, ab: 2, ba: 3, bb: 4 });
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/for-each.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/for-each.js
      deleted file mode 100644
      index 8690d1e82179aa..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/for-each.js
      +++ /dev/null
      @@ -1,10 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var o = { raz: 1, dwa: 2, trzy: 3 }
      -	  , o2 = {};
      -	a(t(o, function (value, name) {
      -		o2[name] = value;
      -	}), undefined, "Return");
      -	a.deep(o2, o);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/get-property-names.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/get-property-names.js
      deleted file mode 100644
      index b91c3dd50e7bbf..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/get-property-names.js
      +++ /dev/null
      @@ -1,18 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var o = { first: 1, second: 4 }, r1, r2;
      -	o = Object.create(o, {
      -		third: { value: null }
      -	});
      -	o.first = 2;
      -	o = Object.create(o);
      -	o.fourth = 3;
      -
      -	r1 = t(o);
      -	r1.sort();
      -	r2 = ['first', 'second', 'third', 'fourth']
      -		.concat(Object.getOwnPropertyNames(Object.prototype));
      -	r2.sort();
      -	a.deep(r1, r2);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-array-like.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-array-like.js
      deleted file mode 100644
      index 6295973ca81acd..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-array-like.js
      +++ /dev/null
      @@ -1,14 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t([]), true, "Array");
      -	a(t(""), true, "String");
      -	a(t((function () { return arguments; }())), true, "Arguments");
      -	a(t({ length: 0 }), true, "List object");
      -	a(t(function () {}), false, "Function");
      -	a(t({}), false, "Plain object");
      -	a(t(/raz/), false, "Regexp");
      -	a(t(), false, "No argument");
      -	a(t(null), false, "Null");
      -	a(t(undefined), false, "Undefined");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-callable.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-callable.js
      deleted file mode 100644
      index 625e221d2c3811..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-callable.js
      +++ /dev/null
      @@ -1,8 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t(function () {}), true, "Function");
      -	a(t({}), false, "Object");
      -	a(t(), false, "Undefined");
      -	a(t(null), false, "Null");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-copy-deep.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-copy-deep.js
      deleted file mode 100644
      index 4f14cbbe8108b2..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-copy-deep.js
      +++ /dev/null
      @@ -1,46 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var x, y;
      -
      -	a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 3 }), true, "Same");
      -	a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 4 }), false,
      -		"Different property value");
      -	a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2 }), false,
      -		"Property only in source");
      -	a(t({ 1: 1, 2: 2 }, { 1: 1, 2: 2, 3: 4 }), false,
      -		"Property only in target");
      -
      -	a(t("raz", "dwa"), false, "String: diff");
      -	a(t("raz", "raz"), true, "String: same");
      -	a(t("32", 32), false, "String & Number");
      -
      -	a(t([1, 'raz', true], [1, 'raz', true]), true, "Array: same");
      -	a(t([1, 'raz', undefined], [1, 'raz']), false, "Array: diff");
      -	a(t(['foo'], ['one']), false, "Array: One value comparision");
      -
      -	x = { foo: { bar: { mar: {} } } };
      -	y = { foo: { bar: { mar: {} } } };
      -	a(t(x, y), true, "Deep");
      -
      -	a(t({ foo: { bar: { mar: 'foo' } } }, { foo: { bar: { mar: {} } } }),
      -		false, "Deep: false");
      -
      -	x = { foo: { bar: { mar: {} } } };
      -	x.rec = { foo: x };
      -
      -	y = { foo: { bar: { mar: {} } } };
      -	y.rec = { foo: x };
      -
      -	a(t(x, y), true, "Object: Infinite Recursion: Same #1");
      -
      -	x.rec.foo = y;
      -	a(t(x, y), true, "Object: Infinite Recursion: Same #2");
      -
      -	x.rec.foo = x;
      -	y.rec.foo = y;
      -	a(t(x, y), true, "Object: Infinite Recursion: Same #3");
      -
      -	y.foo.bar.mar = 'raz';
      -	a(t(x, y), false, "Object: Infinite Recursion: Diff");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-copy.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-copy.js
      deleted file mode 100644
      index 394e2ed94c09f0..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-copy.js
      +++ /dev/null
      @@ -1,18 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 3 }), true, "Same");
      -	a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 4 }), false,
      -		"Different property value");
      -	a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2 }), false,
      -		"Property only in source");
      -	a(t({ 1: 1, 2: 2 }, { 1: 1, 2: 2, 3: 4 }), false,
      -		"Property only in target");
      -
      -	a(t("raz", "dwa"), false, "String: diff");
      -	a(t("raz", "raz"), true, "String: same");
      -	a(t("32", 32), false, "String & Number");
      -
      -	a(t([1, 'raz', true], [1, 'raz', true]), true, "Array: same");
      -	a(t([1, 'raz', undefined], [1, 'raz']), false, "Array: diff");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-empty.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-empty.js
      deleted file mode 100644
      index b560c2c36b0d4b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-empty.js
      +++ /dev/null
      @@ -1,6 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t({}), true, "Empty");
      -	a(t({ 1: 1 }), false, "Not empty");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-object.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-object.js
      deleted file mode 100644
      index 72c8aa6daf4a3a..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-object.js
      +++ /dev/null
      @@ -1,13 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t('arar'), false, "String");
      -	a(t(12), false, "Number");
      -	a(t(true), false, "Boolean");
      -	a(t(null), false, "Null");
      -	a(t(new Date()), true, "Date");
      -	a(t(new String('raz')), true, "String object");
      -	a(t({}), true, "Plain object");
      -	a(t(/a/), true, "Regular expression");
      -	a(t(function () {}), true, "Function");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-plain-object.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-plain-object.js
      deleted file mode 100644
      index e988829d558ad0..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-plain-object.js
      +++ /dev/null
      @@ -1,18 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t({}), true, "Empty {} is plain object");
      -	a(t({ a: true }), true, "{} with property is plain object");
      -	a(t({ prototype: 1, constructor: 2, __proto__:  3 }), true,
      -		"{} with any property keys is plain object");
      -	a(t(null), false, "Null is not plain object");
      -	a(t('string'), false, "Primitive is not plain object");
      -	a(t(function () {}), false, "Function is not plain object");
      -	a(t(Object.create({})), false,
      -		"Object whose prototype is not Object.prototype is not plain object");
      -	a(t(Object.create(Object.prototype)), true,
      -		"Object whose prototype is Object.prototype is plain object");
      -	a(t(Object.create(null)), true,
      -		"Object whose prototype is null is plain object");
      -	a(t(Object.prototype), false, "Object.prototype");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is.js
      deleted file mode 100644
      index 4f8948cbf344e1..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is.js
      +++ /dev/null
      @@ -1,12 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var o = {};
      -	a(t(o, {}), false, "Different objects");
      -	a(t(o, o), true, "Same objects");
      -	a(t('1', '1'), true, "Same primitive");
      -	a(t('1', 1), false, "Different primitive types");
      -	a(t(NaN, NaN), true, "NaN");
      -	a(t(0, 0), true, "0,0");
      -	a(t(0, -0), false, "0,-0");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/key-of.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/key-of.js
      deleted file mode 100644
      index a9225a048c5c91..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/key-of.js
      +++ /dev/null
      @@ -1,12 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var x = {}, y = {}
      -	  , o = { foo: 'bar', raz: x, trzy: 'cztery', five: '6' };
      -
      -	a(t(o, 'bar'), 'foo', "First property");
      -	a(t(o, 6), null, "Primitive that's not there");
      -	a(t(o, x), 'raz', "Object");
      -	a(t(o, y), null, "Object that's not there");
      -	a(t(o, '6'), 'five', "Last property");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/keys/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/keys/implement.js
      deleted file mode 100644
      index 179e1e5612ea8f..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/keys/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../object/keys/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/keys/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/keys/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/keys/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/keys/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/keys/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/keys/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/keys/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/keys/shim.js
      deleted file mode 100644
      index ed29eebcd751f7..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/keys/shim.js
      +++ /dev/null
      @@ -1,8 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a.deep(t({ foo: 'bar' }), ['foo'], "Object");
      -	a.deep(t('raz'), ['0', '1', '2'], "Primitive");
      -	a.throws(function () { t(); }, TypeError, "Undefined");
      -	a.throws(function () { t(null); }, TypeError, "Undefined");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/map-keys.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/map-keys.js
      deleted file mode 100644
      index be84825b1be711..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/map-keys.js
      +++ /dev/null
      @@ -1,7 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a.deep(t({ 1: 1, 2: 2, 3: 3 }, function (key, value) {
      -		return 'x' + (key + value);
      -	}), { x11: 1, x22: 2, x33: 3 });
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/map.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/map.js
      deleted file mode 100644
      index f9cc09c01b3933..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/map.js
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var obj = { 1: 1, 2: 2, 3: 3 };
      -	a.deep(t(obj, function (value, key, context) {
      -		a(context, obj, "Context argument");
      -		return (value + 1) + key;
      -	}), { 1: '21', 2: '32', 3: '43' });
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/mixin-prototypes.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/mixin-prototypes.js
      deleted file mode 100644
      index d1c727a95a7371..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/mixin-prototypes.js
      +++ /dev/null
      @@ -1,67 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var o, o1, o2, x, y = {}, z = {};
      -	o = { inherited: true, visible: 23 };
      -	o1 = Object.create(o);
      -	o1.visible = z;
      -	o1.nonremovable = 'raz';
      -	Object.defineProperty(o1, 'hidden', { value: 'hidden' });
      -
      -	o2 = Object.defineProperties({}, { nonremovable: { value: y } });
      -	o2.other = 'other';
      -
      -	try { t(o2, o1); } catch (ignore) {}
      -
      -	a(o2.visible, z, "Enumerable");
      -	a(o1.hidden, 'hidden', "Not Enumerable");
      -	a(o2.propertyIsEnumerable('visible'), true, "Enumerable is enumerable");
      -	a(o2.propertyIsEnumerable('hidden'), false,
      -		"Not enumerable is not enumerable");
      -
      -	a(o2.inherited, true, "Extend deep");
      -
      -	a(o2.nonremovable, y, "Do not overwrite non configurable");
      -	a(o2.other, 'other', "Own kept");
      -
      -	x = {};
      -	t(x, o2);
      -	try { t(x, o1); } catch (ignore) {}
      -
      -	a(x.visible, z, "Enumerable");
      -	a(x.hidden, 'hidden', "Not Enumerable");
      -	a(x.propertyIsEnumerable('visible'), true, "Enumerable is enumerable");
      -	a(x.propertyIsEnumerable('hidden'), false,
      -		"Not enumerable is not enumerable");
      -
      -	a(x.inherited, true, "Extend deep");
      -
      -	a(x.nonremovable, y, "Ignored non configurable");
      -	a(x.other, 'other', "Other");
      -
      -	x.visible = 3;
      -	a(x.visible, 3, "Writable is writable");
      -
      -	x = {};
      -	t(x, o1);
      -	a.throws(function () {
      -		x.hidden = 3;
      -	}, "Not writable is not writable");
      -
      -	x = {};
      -	t(x, o1);
      -	delete x.visible;
      -	a.ok(!x.hasOwnProperty('visible'), "Configurable is configurable");
      -
      -	x = {};
      -	t(x, o1);
      -	a.throws(function () {
      -		delete x.hidden;
      -	}, "Not configurable is not configurable");
      -
      -	x = Object.defineProperty({}, 'foo',
      -		{ configurable: false, writable: true, enumerable: false, value: 'bar' });
      -
      -	try { t(x, { foo: 'lorem' }); } catch (ignore) {}
      -	a(x.foo, 'bar', "Writable, not enumerable");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/mixin.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/mixin.js
      deleted file mode 100644
      index 866005b03df29b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/mixin.js
      +++ /dev/null
      @@ -1,69 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var o, o1, o2, x, y = {}, z = {};
      -	o = { inherited: true };
      -	o1 = Object.create(o);
      -	o1.visible = z;
      -	o1.nonremovable = 'raz';
      -	Object.defineProperty(o1, 'hidden', { value: 'hidden' });
      -
      -	o2 = Object.defineProperties({}, { nonremovable: { value: y } });
      -	o2.other = 'other';
      -
      -	try { t(o2, o1); } catch (ignore) {}
      -
      -	a(o2.visible, z, "Enumerable");
      -	a(o1.hidden, 'hidden', "Not Enumerable");
      -	a(o2.propertyIsEnumerable('visible'), true, "Enumerable is enumerable");
      -	a(o2.propertyIsEnumerable('hidden'), false,
      -		"Not enumerable is not enumerable");
      -
      -	a(o2.hasOwnProperty('inherited'), false, "Extend only own");
      -	a(o2.inherited, undefined, "Extend ony own: value");
      -
      -	a(o2.nonremovable, y, "Do not overwrite non configurable");
      -	a(o2.other, 'other', "Own kept");
      -
      -	x = {};
      -	t(x, o2);
      -	try { t(x, o1); } catch (ignore) {}
      -
      -	a(x.visible, z, "Enumerable");
      -	a(x.hidden, 'hidden', "Not Enumerable");
      -	a(x.propertyIsEnumerable('visible'), true, "Enumerable is enumerable");
      -	a(x.propertyIsEnumerable('hidden'), false,
      -		"Not enumerable is not enumerable");
      -
      -	a(x.hasOwnProperty('inherited'), false, "Extend only own");
      -	a(x.inherited, undefined, "Extend ony own: value");
      -
      -	a(x.nonremovable, y, "Ignored non configurable");
      -	a(x.other, 'other', "Other");
      -
      -	x.visible = 3;
      -	a(x.visible, 3, "Writable is writable");
      -
      -	x = {};
      -	t(x, o1);
      -	a.throws(function () {
      -		x.hidden = 3;
      -	}, "Not writable is not writable");
      -
      -	x = {};
      -	t(x, o1);
      -	delete x.visible;
      -	a.ok(!x.hasOwnProperty('visible'), "Configurable is configurable");
      -
      -	x = {};
      -	t(x, o1);
      -	a.throws(function () {
      -		delete x.hidden;
      -	}, "Not configurable is not configurable");
      -
      -	x = Object.defineProperty({}, 'foo',
      -		{ configurable: false, writable: true, enumerable: false, value: 'bar' });
      -
      -	try { t(x, { foo: 'lorem' }); } catch (ignore) {}
      -	a(x.foo, 'bar', "Writable, not enumerable");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/normalize-options.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/normalize-options.js
      deleted file mode 100644
      index 0d2d4da04a53b1..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/normalize-options.js
      +++ /dev/null
      @@ -1,32 +0,0 @@
      -'use strict';
      -
      -var create = Object.create, defineProperty = Object.defineProperty;
      -
      -module.exports = function (t, a) {
      -	var x = { foo: 'raz', bar: 'dwa' }, y;
      -	y = t(x);
      -	a.not(y, x, "Returns copy");
      -	a.deep(y, x, "Plain");
      -
      -	x = { raz: 'one', dwa: 'two' };
      -	defineProperty(x, 'get', {
      -		configurable: true,
      -		enumerable: true,
      -		get: function () { return this.dwa; }
      -	});
      -	x = create(x);
      -	x.trzy = 'three';
      -	x.cztery = 'four';
      -	x = create(x);
      -	x.dwa = 'two!';
      -	x.trzy = 'three!';
      -	x.piec = 'five';
      -	x.szesc = 'six';
      -
      -	a.deep(t(x), { raz: 'one', dwa: 'two!', trzy: 'three!', cztery: 'four',
      -		piec: 'five', szesc: 'six', get: 'two!' }, "Deep object");
      -
      -	a.deep(t({ marko: 'raz', raz: 'foo' }, x, { szesc: 'elo', siedem: 'bibg' }),
      -		{ marko: 'raz', raz: 'one', dwa: 'two!', trzy: 'three!', cztery: 'four',
      -			piec: 'five', szesc: 'elo', siedem: 'bibg', get: 'two!' }, "Multiple options");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/primitive-set.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/primitive-set.js
      deleted file mode 100644
      index 839857eab3dd85..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/primitive-set.js
      +++ /dev/null
      @@ -1,15 +0,0 @@
      -'use strict';
      -
      -var getPropertyNames = require('../../object/get-property-names')
      -  , isPlainObject    = require('../../object/is-plain-object');
      -
      -module.exports = function (t, a) {
      -	var x = t();
      -	a(isPlainObject(x), true, "Plain object");
      -	a.deep(getPropertyNames(x), [], "No properties");
      -	x.foo = 'bar';
      -	a.deep(getPropertyNames(x), ['foo'], "Extensible");
      -
      -	a.deep(t('raz', 'dwa', 3), { raz: true, dwa: true, 3: true },
      -		"Arguments handling");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/safe-traverse.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/safe-traverse.js
      deleted file mode 100644
      index d30cdefe68b8b6..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/safe-traverse.js
      +++ /dev/null
      @@ -1,15 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var obj = { foo: { bar: { lorem: 12  } } };
      -	a(t(obj), obj, "No props");
      -	a(t(obj, 'foo'), obj.foo, "One");
      -	a(t(obj, 'raz'), undefined, "One: Fail");
      -	a(t(obj, 'foo', 'bar'), obj.foo.bar, "Two");
      -	a(t(obj, 'dsd', 'raz'), undefined, "Two: Fail #1");
      -	a(t(obj, 'foo', 'raz'), undefined, "Two: Fail #2");
      -	a(t(obj, 'foo', 'bar', 'lorem'), obj.foo.bar.lorem, "Three");
      -	a(t(obj, 'dsd', 'raz', 'fef'), undefined, "Three: Fail #1");
      -	a(t(obj, 'foo', 'raz', 'asdf'), undefined, "Three: Fail #2");
      -	a(t(obj, 'foo', 'bar', 'asd'), undefined, "Three: Fail #3");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/serialize.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/serialize.js
      deleted file mode 100644
      index 43eed6a8616f9a..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/serialize.js
      +++ /dev/null
      @@ -1,25 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var fn = function (raz, dwa) { return raz + dwa; };
      -	a(t(), 'undefined', "Undefined");
      -	a(t(null), 'null', "Null");
      -	a(t(null), 'null', "Null");
      -	a(t('raz'), '"raz"', "String");
      -	a(t('raz"ddwa\ntrzy'), '"raz\\"ddwa\\ntrzy"', "String with escape");
      -	a(t(false), 'false', "Booelean");
      -	a(t(fn), String(fn), "Function");
      -
      -	a(t(/raz-dwa/g), '/raz-dwa/g', "RegExp");
      -	a(t(new Date(1234567)), 'new Date(1234567)', "Date");
      -	a(t([]), '[]', "Empty array");
      -	a(t([undefined, false, null, 'raz"ddwa\ntrzy', fn, /raz/g, new Date(1234567), ['foo']]),
      -		'[undefined,false,null,"raz\\"ddwa\\ntrzy",' + String(fn) +
      -		',/raz/g,new Date(1234567),["foo"]]', "Rich Array");
      -	a(t({}), '{}', "Empty object");
      -	a(t({ raz: undefined, dwa: false, trzy: null, cztery: 'raz"ddwa\ntrzy', piec: fn, szesc: /raz/g,
      -		siedem: new Date(1234567), osiem: ['foo', 32], dziewiec: { foo: 'bar', dwa: 343 } }),
      -		'{"raz":undefined,"dwa":false,"trzy":null,"cztery":"raz\\"ddwa\\ntrzy","piec":' + String(fn) +
      -		',"szesc":/raz/g,"siedem":new Date(1234567),"osiem":["foo",32],' +
      -		'"dziewiec":{"foo":"bar","dwa":343}}', "Rich object");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/set-prototype-of/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/set-prototype-of/implement.js
      deleted file mode 100644
      index 30b2ac4b96ba2e..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/set-prototype-of/implement.js
      +++ /dev/null
      @@ -1,6 +0,0 @@
      -'use strict';
      -
      -var create        = require('../../../object/create')
      -  , isImplemented = require('../../../object/set-prototype-of/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(create), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/set-prototype-of/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/set-prototype-of/index.js
      deleted file mode 100644
      index aec2605cc2661a..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/set-prototype-of/index.js
      +++ /dev/null
      @@ -1,23 +0,0 @@
      -'use strict';
      -
      -var create = require('../../../object/create')
      -
      -  , getPrototypeOf = Object.getPrototypeOf;
      -
      -module.exports = function (t, a) {
      -	var x = {}, y = {};
      -
      -	if (t === null) return;
      -	a(t(x, y), x, "Return self object");
      -	a(getPrototypeOf(x), y, "Object");
      -	a.throws(function () { t(x); }, TypeError, "Undefined");
      -	a.throws(function () { t('foo'); }, TypeError, "Primitive");
      -	a(getPrototypeOf(t(x, null)), t.nullPolyfill || null, "Null");
      -	x = create(null);
      -	a.h1("Change null prototype");
      -	a(t(x, y), x, "Result");
      -	a(getPrototypeOf(x), y, "Prototype");
      -	a.h1("Set null prototype");
      -	a(t(y, null), y, "Result");
      -	a(getPrototypeOf(y), t.nullPolyfill || null, "Prototype");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/set-prototype-of/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/set-prototype-of/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/set-prototype-of/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/set-prototype-of/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/set-prototype-of/shim.js
      deleted file mode 100644
      index aec2605cc2661a..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/set-prototype-of/shim.js
      +++ /dev/null
      @@ -1,23 +0,0 @@
      -'use strict';
      -
      -var create = require('../../../object/create')
      -
      -  , getPrototypeOf = Object.getPrototypeOf;
      -
      -module.exports = function (t, a) {
      -	var x = {}, y = {};
      -
      -	if (t === null) return;
      -	a(t(x, y), x, "Return self object");
      -	a(getPrototypeOf(x), y, "Object");
      -	a.throws(function () { t(x); }, TypeError, "Undefined");
      -	a.throws(function () { t('foo'); }, TypeError, "Primitive");
      -	a(getPrototypeOf(t(x, null)), t.nullPolyfill || null, "Null");
      -	x = create(null);
      -	a.h1("Change null prototype");
      -	a(t(x, y), x, "Result");
      -	a(getPrototypeOf(x), y, "Prototype");
      -	a.h1("Set null prototype");
      -	a(t(y, null), y, "Result");
      -	a(getPrototypeOf(y), t.nullPolyfill || null, "Prototype");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/some.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/some.js
      deleted file mode 100644
      index 490431e7acd543..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/some.js
      +++ /dev/null
      @@ -1,23 +0,0 @@
      -'use strict';
      -
      -var o = { 1: 1, 2: 2, 3: 3 };
      -
      -module.exports = function (t, a) {
      -	var o2 = {}, i = 0;
      -	t(o, function (value, name) {
      -		o2[name] = value;
      -		return false;
      -	});
      -	a(JSON.stringify(o2), JSON.stringify(o), "Iterates");
      -
      -	a(t(o, function () {
      -		++i;
      -		return true;
      -	}), true, "Succeeds");
      -	a(i, 1, "Stops iteration after condition is met");
      -
      -	a(t(o, function () {
      -		return false;
      -	}), false, "Fails");
      -
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/to-array.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/to-array.js
      deleted file mode 100644
      index 1f4beef7eae835..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/to-array.js
      +++ /dev/null
      @@ -1,15 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var o = { 1: 1, 2: 2, 3: 3 }, o1 = {}
      -	  , o2 = t(o, function (value, name, self) {
      -		a(self, o, "Self");
      -		a(this, o1, "Scope");
      -		return value + Number(name);
      -	}, o1);
      -	a.deep(o2, [2, 4, 6]);
      -
      -	t(o).sort().forEach(function (item) {
      -		a.deep(item, [item[0], o[item[0]]], "Default");
      -	});
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/unserialize.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/unserialize.js
      deleted file mode 100644
      index 405eef112ff76e..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/unserialize.js
      +++ /dev/null
      @@ -1,24 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var fn = function (raz, dwa) { return raz + dwa; };
      -	a(t('undefined'), undefined, "Undefined");
      -	a(t('null'), null, "Null");
      -	a(t('"raz"'), 'raz', "String");
      -	a(t('"raz\\"ddwa\\ntrzy"'), 'raz"ddwa\ntrzy', "String with escape");
      -	a(t('false'), false, "Booelean");
      -	a(String(t(String(fn))), String(fn), "Function");
      -
      -	a.deep(t('/raz-dwa/g'), /raz-dwa/g, "RegExp");
      -	a.deep(t('new Date(1234567)'), new Date(1234567), "Date");
      -	a.deep(t('[]'), [], "Empty array");
      -	a.deep(t('[undefined,false,null,"raz\\"ddwa\\ntrzy",/raz/g,new Date(1234567),["foo"]]'),
      -		[undefined, false, null, 'raz"ddwa\ntrzy', /raz/g, new Date(1234567), ['foo']], "Rich Array");
      -	a.deep(t('{}'), {}, "Empty object");
      -	a.deep(t('{"raz":undefined,"dwa":false,"trzy":null,"cztery":"raz\\"ddwa\\ntrzy",' +
      -		'"szesc":/raz/g,"siedem":new Date(1234567),"osiem":["foo",32],' +
      -		'"dziewiec":{"foo":"bar","dwa":343}}'),
      -		{ raz: undefined, dwa: false, trzy: null, cztery: 'raz"ddwa\ntrzy', szesc: /raz/g,
      -			siedem: new Date(1234567), osiem: ['foo', 32], dziewiec: { foo: 'bar', dwa: 343 } },
      -		"Rich object");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/valid-callable.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/valid-callable.js
      deleted file mode 100644
      index b40540b6ba61b0..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/valid-callable.js
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var f = function () {};
      -	a(t(f), f, "Function");
      -	a.throws(function () {
      -		t({});
      -	}, "Not Function");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/valid-object.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/valid-object.js
      deleted file mode 100644
      index eaa8e7bcb364b5..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/valid-object.js
      +++ /dev/null
      @@ -1,15 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var x;
      -	a.throws(function () { t(0); }, TypeError, "0");
      -	a.throws(function () { t(false); }, TypeError, "false");
      -	a.throws(function () { t(''); }, TypeError, "''");
      -	a(t(x = {}), x, "Object");
      -	a(t(x = function () {}), x, "Function");
      -	a(t(x = new String('raz')), x, "String object"); //jslint: ignore
      -	a(t(x = new Date()), x, "Date");
      -
      -	a.throws(function () { t(); }, TypeError, "Undefined");
      -	a.throws(function () { t(null); }, TypeError, "null");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/valid-value.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/valid-value.js
      deleted file mode 100644
      index f1eeafa9778863..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/valid-value.js
      +++ /dev/null
      @@ -1,19 +0,0 @@
      -'use strict';
      -
      -var numIsNaN = require('../../number/is-nan');
      -
      -module.exports = function (t, a) {
      -	var x;
      -	a(t(0), 0, "0");
      -	a(t(false), false, "false");
      -	a(t(''), '', "''");
      -	a(numIsNaN(t(NaN)), true, "NaN");
      -	a(t(x = {}), x, "{}");
      -
      -	a.throws(function () {
      -		t();
      -	}, "Undefined");
      -	a.throws(function () {
      -		t(null);
      -	}, "null");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/validate-array-like-object.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/validate-array-like-object.js
      deleted file mode 100644
      index 2f3e31b442ebcb..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/validate-array-like-object.js
      +++ /dev/null
      @@ -1,15 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var x;
      -	a.throws(function () { t(0); }, TypeError, "0");
      -	a.throws(function () { t(false); }, TypeError, "false");
      -	a.throws(function () { t(''); }, TypeError, "String");
      -	a.throws(function () { t({}); }, TypeError, "Plain Object");
      -	a.throws(function () { t(function () {}); }, TypeError, "Function");
      -	a(t(x = new String('raz')), x, "String object"); //jslint: ignore
      -
      -	a(t(x = { length: 1 }), x, "Array like");
      -	a.throws(function () { t(); }, TypeError, "Undefined");
      -	a.throws(function () { t(null); }, TypeError, "null");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/validate-array-like.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/validate-array-like.js
      deleted file mode 100644
      index 53bd11249e3d04..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/validate-array-like.js
      +++ /dev/null
      @@ -1,15 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var x;
      -	a.throws(function () { t(0); }, TypeError, "0");
      -	a.throws(function () { t(false); }, TypeError, "false");
      -	a(t(''), '', "''");
      -	a.throws(function () { t({}); }, TypeError, "Plain Object");
      -	a.throws(function () { t(function () {}); }, TypeError, "Function");
      -	a(t(x = new String('raz')), x, "String object"); //jslint: ignore
      -
      -	a(t(x = { length: 1 }), x, "Array like");
      -	a.throws(function () { t(); }, TypeError, "Undefined");
      -	a.throws(function () { t(null); }, TypeError, "null");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/validate-stringifiable-value.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/validate-stringifiable-value.js
      deleted file mode 100644
      index ae9bd17a59a028..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/validate-stringifiable-value.js
      +++ /dev/null
      @@ -1,16 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var x;
      -	a.throws(function () { t(); }, TypeError, "Undefined");
      -	a.throws(function () { t(null); }, TypeError, "Null");
      -	a(t(0), "0");
      -	a(t(false), "false");
      -	a(t(''), "");
      -	a(t({}), String({}), "Object");
      -	a(t(x = function () {}), String(x), "Function");
      -	a(t(x = new String('raz')), String(x), "String object"); //jslint: ignore
      -	a(t(x = new Date()), String(x), "Date");
      -
      -	a.throws(function () { t(Object.create(null)); }, TypeError, "Null prototype object");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/validate-stringifiable.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/validate-stringifiable.js
      deleted file mode 100644
      index 4a46bb521900db..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/validate-stringifiable.js
      +++ /dev/null
      @@ -1,16 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var x;
      -	a(t(), 'undefined', "Undefined");
      -	a(t(null), 'null', "Null");
      -	a(t(0), "0");
      -	a(t(false), "false");
      -	a(t(''), "");
      -	a(t({}), String({}), "Object");
      -	a(t(x = function () {}), String(x), "Function");
      -	a(t(x = new String('raz')), String(x), "String object"); //jslint: ignore
      -	a(t(x = new Date()), String(x), "Date");
      -
      -	a.throws(function () { t(Object.create(null)); }, TypeError, "Null prototype object");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/index.js
      deleted file mode 100644
      index ca2bd650615889..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/index.js
      +++ /dev/null
      @@ -1,12 +0,0 @@
      -'use strict';
      -
      -var indexTest = require('tad/lib/utils/index-test')
      -
      -  , path = require('path').resolve(__dirname, '../../../reg-exp/#');
      -
      -module.exports = function (t, a, d) {
      -	indexTest(indexTest.readDir(path).aside(function (data) {
      -		delete data.sticky;
      -		delete data.unicode;
      -	}))(t, a, d);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/is-sticky.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/is-sticky.js
      deleted file mode 100644
      index e154ac2916557f..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/is-sticky.js
      +++ /dev/null
      @@ -1,10 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var re;
      -	a(t.call(/raz/), false, "Normal");
      -	a(t.call(/raz/g), false, "Global");
      -	try { re = new RegExp('raz', 'y'); } catch (ignore) {}
      -	if (!re) return;
      -	a(t.call(re), true, "Sticky");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/is-unicode.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/is-unicode.js
      deleted file mode 100644
      index 2ffb9e869bd6a3..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/is-unicode.js
      +++ /dev/null
      @@ -1,10 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var re;
      -	a(t.call(/raz/), false, "Normal");
      -	a(t.call(/raz/g), false, "Global");
      -	try { re = new RegExp('raz', 'u'); } catch (ignore) {}
      -	if (!re) return;
      -	a(t.call(re), true, "Unicode");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/match/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/match/implement.js
      deleted file mode 100644
      index 89825a45f6148d..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/match/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../../reg-exp/#/match/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/match/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/match/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/match/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/match/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/match/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/match/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/match/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/match/shim.js
      deleted file mode 100644
      index 5249139fff2277..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/match/shim.js
      +++ /dev/null
      @@ -1,8 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var result = ['foo'];
      -	result.index = 0;
      -	result.input = 'foobar';
      -	a.deep(t.call(/foo/, 'foobar'), result);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/replace/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/replace/implement.js
      deleted file mode 100644
      index c32b23a6d03e79..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/replace/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../../reg-exp/#/replace/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/replace/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/replace/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/replace/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/replace/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/replace/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/replace/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/replace/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/replace/shim.js
      deleted file mode 100644
      index 2b378fd594e2ef..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/replace/shim.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t.call(/foo/, 'foobar', 'mar'), 'marbar');
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/search/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/search/implement.js
      deleted file mode 100644
      index ff1b8087f2c697..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/search/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../../reg-exp/#/search/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/search/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/search/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/search/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/search/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/search/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/search/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/search/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/search/shim.js
      deleted file mode 100644
      index 596bcdb92ed203..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/search/shim.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t.call(/foo/, 'barfoo'), 3);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/split/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/split/implement.js
      deleted file mode 100644
      index 1cee441806c065..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/split/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../../reg-exp/#/split/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/split/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/split/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/split/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/split/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/split/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/split/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/split/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/split/shim.js
      deleted file mode 100644
      index 6a95cd03d6ce68..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/split/shim.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a.deep(t.call(/\|/, 'bar|foo'), ['bar', 'foo']);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/sticky/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/sticky/implement.js
      deleted file mode 100644
      index d94e7b98d8fe46..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/sticky/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../../reg-exp/#/sticky/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/sticky/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/sticky/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/sticky/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/unicode/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/unicode/implement.js
      deleted file mode 100644
      index 9b1aa0f2ab992d..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/unicode/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../../reg-exp/#/unicode/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/unicode/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/unicode/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/unicode/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/escape.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/escape.js
      deleted file mode 100644
      index 5b00f67f28ce45..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/escape.js
      +++ /dev/null
      @@ -1,6 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var str = "(?:^te|er)s{2}t\\[raz]+$";
      -	a(RegExp('^' + t(str) + '$').test(str), true);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/is-reg-exp.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/is-reg-exp.js
      deleted file mode 100644
      index 785ca28c2ecb2c..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/is-reg-exp.js
      +++ /dev/null
      @@ -1,12 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t('arar'), false, "String");
      -	a(t(12), false, "Number");
      -	a(t(true), false, "Boolean");
      -	a(t(new Date()), false, "Date");
      -	a(t(new String('raz')), false, "String object");
      -	a(t({}), false, "Plain object");
      -	a(t(/a/), true, "Regular expression");
      -	a(t(new RegExp('a')), true, "Regular expression via constructor");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/valid-reg-exp.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/valid-reg-exp.js
      deleted file mode 100644
      index cd12cf126a609a..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/valid-reg-exp.js
      +++ /dev/null
      @@ -1,17 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var r = /raz/;
      -	a(t(r), r, "Direct");
      -	r = new RegExp('foo');
      -	a(t(r), r, "Constructor");
      -	a.throws(function () {
      -		t({});
      -	}, "Object");
      -	a.throws(function () {
      -		t(function () {});
      -	}, "Function");
      -	a.throws(function () {
      -		t({ exec: function () { return 20; } });
      -	}, "Plain object");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/@@iterator/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/@@iterator/implement.js
      deleted file mode 100644
      index 09bf3361acd6a2..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/@@iterator/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../../string/#/@@iterator/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/@@iterator/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/@@iterator/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/@@iterator/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/@@iterator/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/@@iterator/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/@@iterator/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/@@iterator/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/@@iterator/shim.js
      deleted file mode 100644
      index 3b0e0b7547ece9..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/@@iterator/shim.js
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var it = t.call('r💩z');
      -	a.deep(it.next(), { done: false, value: 'r' }, "#1");
      -	a.deep(it.next(), { done: false, value: '💩' }, "#2");
      -	a.deep(it.next(), { done: false, value: 'z' }, "#3");
      -	a.deep(it.next(), { done: true, value: undefined }, "End");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/at.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/at.js
      deleted file mode 100644
      index 2447a9f64d5d83..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/at.js
      +++ /dev/null
      @@ -1,97 +0,0 @@
      -// See tests at https://github.com/mathiasbynens/String.prototype.at
      -
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t.length, 1, "Length");
      -
      -	a.h1("BMP");
      -	a(t.call('abc\uD834\uDF06def', -Infinity), '', "-Infinity");
      -	a(t.call('abc\uD834\uDF06def', -1), '', "-1");
      -	a(t.call('abc\uD834\uDF06def', -0), 'a', "-0");
      -	a(t.call('abc\uD834\uDF06def', +0), 'a', "+0");
      -	a(t.call('abc\uD834\uDF06def', 1), 'b', "1");
      -	a(t.call('abc\uD834\uDF06def', 3), '\uD834\uDF06', "3");
      -	a(t.call('abc\uD834\uDF06def', 4), '\uDF06', "4");
      -	a(t.call('abc\uD834\uDF06def', 5), 'd', "5");
      -	a(t.call('abc\uD834\uDF06def', 42), '', "42");
      -	a(t.call('abc\uD834\uDF06def', +Infinity), '', "+Infinity");
      -	a(t.call('abc\uD834\uDF06def', null), 'a', "null");
      -	a(t.call('abc\uD834\uDF06def', undefined), 'a', "undefined");
      -	a(t.call('abc\uD834\uDF06def'), 'a', "No argument");
      -	a(t.call('abc\uD834\uDF06def', false), 'a', "false");
      -	a(t.call('abc\uD834\uDF06def', NaN), 'a', "NaN");
      -	a(t.call('abc\uD834\uDF06def', ''), 'a', "Empty string");
      -	a(t.call('abc\uD834\uDF06def', '_'), 'a', "_");
      -	a(t.call('abc\uD834\uDF06def', '1'), 'b', "'1'");
      -	a(t.call('abc\uD834\uDF06def', []), 'a', "[]");
      -	a(t.call('abc\uD834\uDF06def', {}), 'a', "{}");
      -	a(t.call('abc\uD834\uDF06def', -0.9), 'a', "-0.9");
      -	a(t.call('abc\uD834\uDF06def', 1.9), 'b', "1.9");
      -	a(t.call('abc\uD834\uDF06def', 7.9), 'f', "7.9");
      -	a(t.call('abc\uD834\uDF06def', Math.pow(2, 32)), '', "Big number");
      -
      -	a.h1("Astral symbol");
      -	a(t.call('\uD834\uDF06def', -Infinity), '', "-Infinity");
      -	a(t.call('\uD834\uDF06def', -1), '', "-1");
      -	a(t.call('\uD834\uDF06def', -0), '\uD834\uDF06', "-0");
      -	a(t.call('\uD834\uDF06def', +0), '\uD834\uDF06', "+0");
      -	a(t.call('\uD834\uDF06def', 1), '\uDF06', "1");
      -	a(t.call('\uD834\uDF06def', 2), 'd', "2");
      -	a(t.call('\uD834\uDF06def', 3), 'e', "3");
      -	a(t.call('\uD834\uDF06def', 4), 'f', "4");
      -	a(t.call('\uD834\uDF06def', 42), '', "42");
      -	a(t.call('\uD834\uDF06def', +Infinity), '', "+Infinity");
      -	a(t.call('\uD834\uDF06def', null), '\uD834\uDF06', "null");
      -	a(t.call('\uD834\uDF06def', undefined), '\uD834\uDF06', "undefined");
      -	a(t.call('\uD834\uDF06def'), '\uD834\uDF06', "No arguments");
      -	a(t.call('\uD834\uDF06def', false), '\uD834\uDF06', "false");
      -	a(t.call('\uD834\uDF06def', NaN), '\uD834\uDF06', "NaN");
      -	a(t.call('\uD834\uDF06def', ''), '\uD834\uDF06', "Empty string");
      -	a(t.call('\uD834\uDF06def', '_'), '\uD834\uDF06', "_");
      -	a(t.call('\uD834\uDF06def', '1'), '\uDF06', "'1'");
      -
      -	a.h1("Lone high surrogates");
      -	a(t.call('\uD834abc', -Infinity), '', "-Infinity");
      -	a(t.call('\uD834abc', -1), '',  "-1");
      -	a(t.call('\uD834abc', -0), '\uD834', "-0");
      -	a(t.call('\uD834abc', +0), '\uD834', "+0");
      -	a(t.call('\uD834abc', 1), 'a', "1");
      -	a(t.call('\uD834abc', 42), '', "42");
      -	a(t.call('\uD834abc', +Infinity), '', "Infinity");
      -	a(t.call('\uD834abc', null), '\uD834', "null");
      -	a(t.call('\uD834abc', undefined), '\uD834', "undefined");
      -	a(t.call('\uD834abc'), '\uD834', "No arguments");
      -	a(t.call('\uD834abc', false), '\uD834', "false");
      -	a(t.call('\uD834abc', NaN), '\uD834', "NaN");
      -	a(t.call('\uD834abc', ''), '\uD834', "Empty string");
      -	a(t.call('\uD834abc', '_'), '\uD834', "_");
      -	a(t.call('\uD834abc', '1'), 'a', "'a'");
      -
      -	a.h1("Lone low surrogates");
      -	a(t.call('\uDF06abc', -Infinity), '', "-Infinity");
      -	a(t.call('\uDF06abc', -1), '', "-1");
      -	a(t.call('\uDF06abc', -0), '\uDF06', "-0");
      -	a(t.call('\uDF06abc', +0), '\uDF06', "+0");
      -	a(t.call('\uDF06abc', 1), 'a', "1");
      -	a(t.call('\uDF06abc', 42), '', "42");
      -	a(t.call('\uDF06abc', +Infinity), '', "+Infinity");
      -	a(t.call('\uDF06abc', null), '\uDF06', "null");
      -	a(t.call('\uDF06abc', undefined), '\uDF06', "undefined");
      -	a(t.call('\uDF06abc'), '\uDF06', "No arguments");
      -	a(t.call('\uDF06abc', false), '\uDF06', "false");
      -	a(t.call('\uDF06abc', NaN), '\uDF06', "NaN");
      -	a(t.call('\uDF06abc', ''), '\uDF06', "Empty string");
      -	a(t.call('\uDF06abc', '_'), '\uDF06', "_");
      -	a(t.call('\uDF06abc', '1'), 'a', "'1'");
      -
      -	a.h1("Context");
      -	a.throws(function () { t.call(undefined); }, TypeError, "Undefined");
      -	a.throws(function () { t.call(undefined, 4); }, TypeError,
      -		"Undefined + argument");
      -	a.throws(function () { t.call(null); }, TypeError, "Null");
      -	a.throws(function () { t.call(null, 4); }, TypeError, "Null + argument");
      -	a(t.call(42, 0), '4', "Number #1");
      -	a(t.call(42, 1), '2', "Number #2");
      -	a(t.call({ toString: function () { return 'abc'; } }, 2), 'c', "Object");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/camel-to-hyphen.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/camel-to-hyphen.js
      deleted file mode 100644
      index 8b47a8158a29d3..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/camel-to-hyphen.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t.call('razDwaTRzy4yFoo45My'), 'raz-dwa-t-rzy4y-foo45-my');
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/capitalize.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/capitalize.js
      deleted file mode 100644
      index fa11ff8eeff856..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/capitalize.js
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t.call('raz'), 'Raz', "Word");
      -	a(t.call('BLA'), 'BLA', "Uppercase");
      -	a(t.call(''), '', "Empty");
      -	a(t.call('a'), 'A', "One letter");
      -	a(t.call('this is a test'), 'This is a test', "Sentence");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/case-insensitive-compare.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/case-insensitive-compare.js
      deleted file mode 100644
      index 01a90c39ce8307..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/case-insensitive-compare.js
      +++ /dev/null
      @@ -1,7 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t.call("AA", "aa"), 0, "Same");
      -	a.ok(t.call("Amber", "zebra") < 0, "Less");
      -	a.ok(t.call("Zebra", "amber") > 0, "Greater");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/code-point-at/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/code-point-at/implement.js
      deleted file mode 100644
      index 5e33cd715ff47b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/code-point-at/implement.js
      +++ /dev/null
      @@ -1,6 +0,0 @@
      -'use strict';
      -
      -var isImplemented =
      -	require('../../../../string/#/code-point-at/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/code-point-at/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/code-point-at/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/code-point-at/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/code-point-at/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/code-point-at/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/code-point-at/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/code-point-at/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/code-point-at/shim.js
      deleted file mode 100644
      index 0df4751c564421..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/code-point-at/shim.js
      +++ /dev/null
      @@ -1,81 +0,0 @@
      -// Taken from: https://github.com/mathiasbynens/String.prototype.codePointAt
      -//             /blob/master/tests/tests.js
      -
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t.length, 1, "Length");
      -
      -	// String that starts with a BMP symbol
      -	a(t.call('abc\uD834\uDF06def', ''), 0x61);
      -	a(t.call('abc\uD834\uDF06def', '_'), 0x61);
      -	a(t.call('abc\uD834\uDF06def'), 0x61);
      -	a(t.call('abc\uD834\uDF06def', -Infinity), undefined);
      -	a(t.call('abc\uD834\uDF06def', -1), undefined);
      -	a(t.call('abc\uD834\uDF06def', -0), 0x61);
      -	a(t.call('abc\uD834\uDF06def', 0), 0x61);
      -	a(t.call('abc\uD834\uDF06def', 3), 0x1D306);
      -	a(t.call('abc\uD834\uDF06def', 4), 0xDF06);
      -	a(t.call('abc\uD834\uDF06def', 5), 0x64);
      -	a(t.call('abc\uD834\uDF06def', 42), undefined);
      -	a(t.call('abc\uD834\uDF06def', Infinity), undefined);
      -	a(t.call('abc\uD834\uDF06def', Infinity), undefined);
      -	a(t.call('abc\uD834\uDF06def', NaN), 0x61);
      -	a(t.call('abc\uD834\uDF06def', false), 0x61);
      -	a(t.call('abc\uD834\uDF06def', null), 0x61);
      -	a(t.call('abc\uD834\uDF06def', undefined), 0x61);
      -
      -	// String that starts with an astral symbol
      -	a(t.call('\uD834\uDF06def', ''), 0x1D306);
      -	a(t.call('\uD834\uDF06def', '1'), 0xDF06);
      -	a(t.call('\uD834\uDF06def', '_'), 0x1D306);
      -	a(t.call('\uD834\uDF06def'), 0x1D306);
      -	a(t.call('\uD834\uDF06def', -1), undefined);
      -	a(t.call('\uD834\uDF06def', -0), 0x1D306);
      -	a(t.call('\uD834\uDF06def', 0), 0x1D306);
      -	a(t.call('\uD834\uDF06def', 1), 0xDF06);
      -	a(t.call('\uD834\uDF06def', 42), undefined);
      -	a(t.call('\uD834\uDF06def', false), 0x1D306);
      -	a(t.call('\uD834\uDF06def', null), 0x1D306);
      -	a(t.call('\uD834\uDF06def', undefined), 0x1D306);
      -
      -	// Lone high surrogates
      -	a(t.call('\uD834abc', ''), 0xD834);
      -	a(t.call('\uD834abc', '_'), 0xD834);
      -	a(t.call('\uD834abc'), 0xD834);
      -	a(t.call('\uD834abc', -1), undefined);
      -	a(t.call('\uD834abc', -0), 0xD834);
      -	a(t.call('\uD834abc', 0), 0xD834);
      -	a(t.call('\uD834abc', false), 0xD834);
      -	a(t.call('\uD834abc', NaN), 0xD834);
      -	a(t.call('\uD834abc', null), 0xD834);
      -	a(t.call('\uD834abc', undefined), 0xD834);
      -
      -	// Lone low surrogates
      -	a(t.call('\uDF06abc', ''), 0xDF06);
      -	a(t.call('\uDF06abc', '_'), 0xDF06);
      -	a(t.call('\uDF06abc'), 0xDF06);
      -	a(t.call('\uDF06abc', -1), undefined);
      -	a(t.call('\uDF06abc', -0), 0xDF06);
      -	a(t.call('\uDF06abc', 0), 0xDF06);
      -	a(t.call('\uDF06abc', false), 0xDF06);
      -	a(t.call('\uDF06abc', NaN), 0xDF06);
      -	a(t.call('\uDF06abc', null), 0xDF06);
      -	a(t.call('\uDF06abc', undefined), 0xDF06);
      -
      -	a.throws(function () { t.call(undefined); }, TypeError);
      -	a.throws(function () { t.call(undefined, 4); }, TypeError);
      -	a.throws(function () { t.call(null); }, TypeError);
      -	a.throws(function () { t.call(null, 4); }, TypeError);
      -	a(t.call(42, 0), 0x34);
      -	a(t.call(42, 1), 0x32);
      -	a(t.call({ toString: function () { return 'abc'; } }, 2), 0x63);
      -
      -	a.throws(function () { t.apply(undefined); }, TypeError);
      -	a.throws(function () { t.apply(undefined, [4]); }, TypeError);
      -	a.throws(function () { t.apply(null); }, TypeError);
      -	a.throws(function () { t.apply(null, [4]); }, TypeError);
      -	a(t.apply(42, [0]), 0x34);
      -	a(t.apply(42, [1]), 0x32);
      -	a(t.apply({ toString: function () { return 'abc'; } }, [2]), 0x63);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/contains/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/contains/implement.js
      deleted file mode 100644
      index 220f50d4672f13..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/contains/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../../string/#/contains/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/contains/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/contains/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/contains/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/contains/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/contains/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/contains/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/contains/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/contains/shim.js
      deleted file mode 100644
      index a0ea4db20812e5..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/contains/shim.js
      +++ /dev/null
      @@ -1,14 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t.call('raz', ''), true, "Empty");
      -	a(t.call('', ''), true, "Both Empty");
      -	a(t.call('raz', 'raz'), true, "Same");
      -	a(t.call('razdwa', 'raz'), true, "Starts with");
      -	a(t.call('razdwa', 'dwa'), true, "Ends with");
      -	a(t.call('razdwa', 'zdw'), true, "In middle");
      -	a(t.call('', 'raz'), false, "Something in empty");
      -	a(t.call('az', 'raz'), false, "Longer");
      -	a(t.call('azasdfasdf', 'azff'), false, "Not found");
      -	a(t.call('razdwa', 'raz', 1), false, "Position");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/ends-with/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/ends-with/implement.js
      deleted file mode 100644
      index 93bd2ddcd6dc20..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/ends-with/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../../string/#/ends-with/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/ends-with/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/ends-with/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/ends-with/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/ends-with/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/ends-with/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/ends-with/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/ends-with/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/ends-with/shim.js
      deleted file mode 100644
      index e4b93c407bc2b5..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/ends-with/shim.js
      +++ /dev/null
      @@ -1,16 +0,0 @@
      -// In some parts copied from:
      -// http://closure-library.googlecode.com/svn/trunk/closure/goog/
      -// string/string_test.html
      -
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t.call('abc', ''), true, "Empty needle");
      -	a(t.call('abcd', 'cd'), true, "Ends with needle");
      -	a(t.call('abcd', 'abcd'), true, "Needle equals haystack");
      -	a(t.call('abcd', 'ab'), false, "Doesn't end with needle");
      -	a(t.call('abc', 'defg'), false, "Length trick");
      -	a(t.call('razdwa', 'zd', 3), false, "Position: false");
      -	a(t.call('razdwa', 'zd', 4), true, "Position: true");
      -	a(t.call('razdwa', 'zd', 5), false, "Position: false #2");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/hyphen-to-camel.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/hyphen-to-camel.js
      deleted file mode 100644
      index bd7ded4befbc7d..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/hyphen-to-camel.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t.call('raz-dwa-t-rzy-4y-rtr4-tiu-45-pa'), 'razDwaTRzy4yRtr4Tiu45Pa');
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/indent.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/indent.js
      deleted file mode 100644
      index eb92b36f5438d6..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/indent.js
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t.call('ra\nzz', ''), 'ra\nzz', "Empty");
      -	a(t.call('ra\nzz', '\t', 3), '\t\t\tra\n\t\t\tzz', "String repeat");
      -	a(t.call('ra\nzz\nsss\nfff\n', '\t'), '\tra\n\tzz\n\tsss\n\tfff\n',
      -		"Multi-line");
      -	a(t.call('ra\n\nzz\n', '\t'), '\tra\n\n\tzz\n', "Don't touch empty lines");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/last.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/last.js
      deleted file mode 100644
      index ad36a213c6053e..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/last.js
      +++ /dev/null
      @@ -1,6 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t.call(''), null, "Null");
      -	a(t.call('abcdef'), 'f', "String");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/normalize/_data.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/normalize/_data.js
      deleted file mode 100644
      index c741addb0055a9..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/normalize/_data.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t[0], 'object'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/normalize/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/normalize/implement.js
      deleted file mode 100644
      index 4886c9b834285b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/normalize/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../../string/#/normalize/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/normalize/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/normalize/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/normalize/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/normalize/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/normalize/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/normalize/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/normalize/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/normalize/shim.js
      deleted file mode 100644
      index 28e27f595247be..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/normalize/shim.js
      +++ /dev/null
      @@ -1,13 +0,0 @@
      -// Taken from: https://github.com/walling/unorm/blob/master/test/es6-shim.js
      -
      -'use strict';
      -
      -var str = 'äiti';
      -
      -module.exports = function (t, a) {
      -	a(t.call(str), "\u00e4iti");
      -	a(t.call(str, "NFC"), "\u00e4iti");
      -	a(t.call(str, "NFD"), "a\u0308iti");
      -	a(t.call(str, "NFKC"), "\u00e4iti");
      -	a(t.call(str, "NFKD"), "a\u0308iti");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/pad.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/pad.js
      deleted file mode 100644
      index 28c3fcaa10c4da..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/pad.js
      +++ /dev/null
      @@ -1,24 +0,0 @@
      -'use strict';
      -
      -var partial = require('../../../function/#/partial');
      -
      -module.exports = {
      -	Left: function (t, a) {
      -		t = partial.call(t, 'x', 5);
      -
      -		a(t.call('yy'), 'xxxyy');
      -		a(t.call(''), 'xxxxx', "Empty string");
      -
      -		a(t.call('yyyyy'), 'yyyyy', 'Equal length');
      -		a(t.call('yyyyyyy'), 'yyyyyyy', 'Longer');
      -	},
      -	Right: function (t, a) {
      -		t = partial.call(t, 'x', -5);
      -
      -		a(t.call('yy'), 'yyxxx');
      -		a(t.call(''), 'xxxxx', "Empty string");
      -
      -		a(t.call('yyyyy'), 'yyyyy', 'Equal length');
      -		a(t.call('yyyyyyy'), 'yyyyyyy', 'Longer');
      -	}
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/plain-replace-all.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/plain-replace-all.js
      deleted file mode 100644
      index a425c87a40553b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/plain-replace-all.js
      +++ /dev/null
      @@ -1,11 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t.call('razdwatrzy', 'dwa', 'olera'), 'razoleratrzy', "Basic");
      -	a(t.call('razdwatrzy', 'dwa', 'ole$&a'), 'razole$&atrzy', "Inserts");
      -	a(t.call('razdwa', 'ola', 'sdfs'), 'razdwa', "No replace");
      -
      -	a(t.call('$raz$$dwa$trzy$', '$', '&&'), '&&raz&&&&dwa&&trzy&&', "Multi");
      -	a(t.call('$raz$$dwa$$$$trzy$', '$$', '&'), '$raz&dwa&&trzy$',
      -		"Multi many chars");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/plain-replace.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/plain-replace.js
      deleted file mode 100644
      index 54522ed749fe37..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/plain-replace.js
      +++ /dev/null
      @@ -1,7 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t.call('razdwatrzy', 'dwa', 'olera'), 'razoleratrzy', "Basic");
      -	a(t.call('razdwatrzy', 'dwa', 'ole$&a'), 'razole$&atrzy', "Inserts");
      -	a(t.call('razdwa', 'ola', 'sdfs'), 'razdwa', "No replace");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/repeat/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/repeat/implement.js
      deleted file mode 100644
      index 7ff65a811068b4..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/repeat/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../../string/#/repeat/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/repeat/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/repeat/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/repeat/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/repeat/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/repeat/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/repeat/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/repeat/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/repeat/shim.js
      deleted file mode 100644
      index 7e0d077ec4bdb6..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/repeat/shim.js
      +++ /dev/null
      @@ -1,8 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t.call('a', 0), '', "Empty");
      -	a(t.call('a', 1), 'a', "1");
      -	a(t.call('\t', 5), '\t\t\t\t\t', "Whitespace");
      -	a(t.call('raz', 3), 'razrazraz', "Many chars");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/starts-with/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/starts-with/implement.js
      deleted file mode 100644
      index fc8490fc916ac3..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/starts-with/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../../string/#/starts-with/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/starts-with/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/starts-with/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/starts-with/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/starts-with/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/starts-with/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/starts-with/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/starts-with/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/starts-with/shim.js
      deleted file mode 100644
      index e0e123b324e115..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/starts-with/shim.js
      +++ /dev/null
      @@ -1,14 +0,0 @@
      -// Inspired and in some parts copied from:
      -// http://closure-library.googlecode.com/svn/trunk/closure/goog
      -// /string/string_test.html
      -
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t.call('abc', ''), true, "Empty needle");
      -	a(t.call('abcd', 'ab'), true, "Starts with needle");
      -	a(t.call('abcd', 'abcd'), true, "Needle equals haystack");
      -	a(t.call('abcd', 'bcde', 1), false, "Needle larger than haystack");
      -	a(!t.call('abcd', 'cd'), true, "Doesn't start with needle");
      -	a(t.call('abcd', 'bc', 1), true, "Position");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/format-method.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/format-method.js
      deleted file mode 100644
      index bb5561ee45bb59..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/format-method.js
      +++ /dev/null
      @@ -1,7 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	t = t({ a: 'A', aa: 'B', ab: 'C', b: 'D',
      -		c: function () { return ++this.a; } });
      -	a(t.call({ a: 0 }, ' %a%aab%abb%b\\%aa%ab%c%c '), ' ABbCbD%aaC12 ');
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/from-code-point/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/from-code-point/implement.js
      deleted file mode 100644
      index 0aceb97efdcf36..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/from-code-point/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../string/from-code-point/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/from-code-point/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/from-code-point/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/from-code-point/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/from-code-point/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/from-code-point/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/from-code-point/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/from-code-point/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/from-code-point/shim.js
      deleted file mode 100644
      index 88cda3d6364719..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/from-code-point/shim.js
      +++ /dev/null
      @@ -1,47 +0,0 @@
      -// Taken from: https://github.com/mathiasbynens/String.fromCodePoint/blob/master
      -//             /tests/tests.js
      -
      -'use strict';
      -
      -var pow = Math.pow;
      -
      -module.exports = function (t, a) {
      -	var counter, result;
      -
      -	a(t.length, 1, "Length");
      -	a(String.propertyIsEnumerable('fromCodePoint'), false, "Not enumerable");
      -
      -	a(t(''), '\0', "Empty string");
      -	a(t(), '', "No arguments");
      -	a(t(-0), '\0', "-0");
      -	a(t(0), '\0', "0");
      -	a(t(0x1D306), '\uD834\uDF06', "Unicode");
      -	a(t(0x1D306, 0x61, 0x1D307), '\uD834\uDF06a\uD834\uDF07', "Complex unicode");
      -	a(t(0x61, 0x62, 0x1D307), 'ab\uD834\uDF07', "Complex");
      -	a(t(false), '\0', "false");
      -	a(t(null), '\0', "null");
      -
      -	a.throws(function () { t('_'); }, RangeError, "_");
      -	a.throws(function () { t(Infinity); }, RangeError, "Infinity");
      -	a.throws(function () { t(-Infinity); }, RangeError, "-Infinity");
      -	a.throws(function () { t(-1); }, RangeError, "-1");
      -	a.throws(function () { t(0x10FFFF + 1); }, RangeError, "Range error #1");
      -	a.throws(function () { t(3.14); }, RangeError, "Range error #2");
      -	a.throws(function () { t(3e-2); }, RangeError, "Range error #3");
      -	a.throws(function () { t(-Infinity); }, RangeError, "Range error #4");
      -	a.throws(function () { t(+Infinity); }, RangeError, "Range error #5");
      -	a.throws(function () { t(NaN); }, RangeError, "Range error #6");
      -	a.throws(function () { t(undefined); }, RangeError, "Range error #7");
      -	a.throws(function () { t({}); }, RangeError, "Range error #8");
      -	a.throws(function () { t(/re/); }, RangeError, "Range error #9");
      -
      -	counter = pow(2, 15) * 3 / 2;
      -	result = [];
      -	while (--counter >= 0) result.push(0); // one code unit per symbol
      -	t.apply(null, result); // must not throw
      -
      -	counter = pow(2, 15) * 3 / 2;
      -	result = [];
      -	while (--counter >= 0) result.push(0xFFFF + 1); // two code units per symbol
      -	t.apply(null, result); // must not throw
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/is-string.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/is-string.js
      deleted file mode 100644
      index 32f595829168ee..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/is-string.js
      +++ /dev/null
      @@ -1,11 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	a(t(null), false, "Null");
      -	a(t(''), true, "Empty string");
      -	a(t(12), false, "Number");
      -	a(t(false), false, "Boolean");
      -	a(t(new Date()), false, "Date");
      -	a(t(new String('raz')), true, "String object");
      -	a(t('asdfaf'), true, "String");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/random-uniq.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/random-uniq.js
      deleted file mode 100644
      index 6791ac266e7530..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/random-uniq.js
      +++ /dev/null
      @@ -1,14 +0,0 @@
      -'use strict';
      -
      -var isValidFormat = RegExp.prototype.test.bind(/^[a-z0-9]+$/);
      -
      -module.exports = function (t, a) {
      -	a(typeof t(), 'string');
      -	a.ok(t().length > 7);
      -	a.not(t(), t());
      -	a.ok(isValidFormat(t()));
      -	a.ok(isValidFormat(t()));
      -	a.ok(isValidFormat(t()));
      -	a.ok(isValidFormat(t()));
      -	a.ok(isValidFormat(t()));
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/raw/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/raw/implement.js
      deleted file mode 100644
      index 59416de3af53ad..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/raw/implement.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -var isImplemented = require('../../../string/raw/is-implemented');
      -
      -module.exports = function (a) { a(isImplemented(), true); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/raw/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/raw/index.js
      deleted file mode 100644
      index 2e0bfa3249d806..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/raw/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./shim');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/raw/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/raw/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/raw/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/raw/shim.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/raw/shim.js
      deleted file mode 100644
      index 025ed780455667..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/raw/shim.js
      +++ /dev/null
      @@ -1,15 +0,0 @@
      -// Partially taken from:
      -// https://github.com/paulmillr/es6-shim/blob/master/test/string.js
      -
      -'use strict';
      -
      -module.exports = function (t, a) {
      -	var callSite = [];
      -
      -	callSite.raw = ["The total is ", " ($", " with tax)"];
      -	a(t(callSite, '{total}', '{total * 1.01}'),
      -		'The total is {total} (${total * 1.01} with tax)');
      -
      -	callSite.raw = [];
      -	a(t(callSite, '{total}', '{total * 1.01}'), '');
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/.lint b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/.lint
      deleted file mode 100644
      index cf54d815684b2f..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/.lint
      +++ /dev/null
      @@ -1,11 +0,0 @@
      -@root
      -
      -module
      -
      -tabs
      -indent 2
      -maxlen 100
      -
      -ass
      -nomen
      -plusplus
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/.npmignore b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/.npmignore
      deleted file mode 100644
      index 155e41f69142ef..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/.npmignore
      +++ /dev/null
      @@ -1,4 +0,0 @@
      -.DS_Store
      -/node_modules
      -/npm-debug.log
      -/.lintcache
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/.travis.yml b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/.travis.yml
      deleted file mode 100644
      index 02c277cf565442..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/.travis.yml
      +++ /dev/null
      @@ -1,11 +0,0 @@
      -language: node_js
      -node_js:
      -  - 0.8
      -  - 0.10
      -  - 0.11
      -
      -notifications:
      -  email:
      -    - medikoo+es6-iterator@medikoo.com
      -
      -script: "npm test && npm run lint"
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/CHANGES b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/CHANGES
      deleted file mode 100644
      index a2d1ec7c2af31c..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/CHANGES
      +++ /dev/null
      @@ -1,28 +0,0 @@
      -v0.1.3  --  2015.02.02
      -* Update dependencies
      -* Fix spelling of LICENSE
      -
      -v0.1.2  --  2014.11.19
      -* Optimise internal `_next` to not verify internal's list length at all times
      -  (#2 thanks @RReverser)
      -* Fix documentation examples
      -* Configure lint scripts
      -
      -v0.1.1  --  2014.04.29
      -* Fix es6-symbol dependency version
      -
      -v0.1.0  --  2014.04.29
      -* Assure strictly npm hosted dependencies
      -* Remove sparse arrays dedicated handling (as per spec)
      -* Add: isIterable, validIterable and chain (method)
      -* Remove toArray, it's addressed by Array.from (polyfil can be found in es5-ext/array/from)
      -* Add break possiblity to 'forOf' via 'doBreak' function argument
      -* Provide dedicated iterator for array-likes (ArrayIterator) and for strings (StringIterator)
      -* Provide @@toStringTag symbol
      -* When available rely on @@iterator symbol
      -* Remove 32bit integer maximum list length restriction
      -* Improve Iterator internals
      -* Update to use latest version of dependencies
      -
      -v0.0.0  --  2013.10.12
      -Initial (dev version)
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/README.md b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/README.md
      deleted file mode 100644
      index 288373da7ab506..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/README.md
      +++ /dev/null
      @@ -1,148 +0,0 @@
      -# es6-iterator
      -## ECMAScript 6 Iterator interface
      -
      -### Installation
      -
      -	$ npm install es6-iterator
      -	
      -To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)
      -
      -## API
      -
      -### Constructors
      -
      -#### Iterator(list) _(es6-iterator)_
      -
      -Abstract Iterator interface. Meant for extensions and not to be used on its own.
      -
      -Accepts any _list_ object (technically object with numeric _length_ property).
      -
      -_Mind it doesn't iterate strings properly, for that use dedicated [StringIterator](#string-iterator)_
      -
      -```javascript
      -var Iterator = require('es6-iterator')
      -var iterator = new Iterator([1, 2, 3]);
      -
      -iterator.next(); // { value: 1, done: false }
      -iterator.next(); // { value: 2, done: false }
      -iterator.next(); // { value: 3, done: false }
      -iterator.next(); // { value: undefined, done: true }
      -```
      -
      -
      -#### ArrayIterator(arrayLike[, kind]) _(es6-iterator/array)_
      -
      -Dedicated for arrays and array-likes. Supports three iteration kinds:
      -* __value__ _(default)_ - Iterates values
      -* __key__ - Iterates indexes
      -* __key+value__ - Iterates keys and indexes, each iteration value is in _[key, value]_ form.
      -
      -
      -```javascript
      -var ArrayIterator = require('es6-iterator/array')
      -var iterator = new ArrayIterator([1, 2, 3], 'key+value');
      -
      -iterator.next(); // { value: [0, 1], done: false }
      -iterator.next(); // { value: [1, 2], done: false }
      -iterator.next(); // { value: [2, 3], done: false }
      -iterator.next(); // { value: undefined, done: true }
      -```
      -
      -May also be used for _arguments_ objects:
      -
      -```javascript
      -(function () {
      -  var iterator = new ArrayIterator(arguments);
      -
      -  iterator.next(); // { value: 1, done: false }
      -  iterator.next(); // { value: 2, done: false }
      -  iterator.next(); // { value: 3, done: false }
      -  iterator.next(); // { value: undefined, done: true }
      -}(1, 2, 3));
      -```
      -
      -#### StringIterator(str) _(es6-iterator/string)_
      -
      -Assures proper iteration over unicode symbols.  
      -See: http://mathiasbynens.be/notes/javascript-unicode
      -
      -```javascript
      -var StringIterator = require('es6-iterator/string');
      -var iterator = new StringIterator('f🙈o🙉o🙊');
      -
      -iterator.next(); // { value: 'f', done: false }
      -iterator.next(); // { value: '🙈', done: false }
      -iterator.next(); // { value: 'o', done: false }
      -iterator.next(); // { value: '🙉', done: false }
      -iterator.next(); // { value: 'o', done: false }
      -iterator.next(); // { value: '🙊', done: false }
      -iterator.next(); // { value: undefined, done: true }
      -```
      -
      -### Function utilities
      -
      -#### forOf(iterable, callback[, thisArg]) _(es6-iterator/for-of)_
      -
      -Polyfill for ECMAScript 6 [`for...of`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) statement.
      -
      -```
      -var forOf = require('es6-iterator/for-of');
      -var result = [];
      -
      -forOf('🙈🙉🙊', function (monkey) { result.push(monkey); });
      -console.log(result); // ['🙈', '🙉', '🙊'];
      -```
      -
      -Optionally you can break iteration at any point:
      -
      -```javascript
      -var result = [];
      -
      -forOf([1,2,3,4]', function (val, doBreak) {
      -  result.push(monkey);
      -  if (val >= 3) doBreak();
      -});
      -console.log(result); // [1, 2, 3];
      -```
      -
      -#### get(obj) _(es6-iterator/get)_
      -
      -Return iterator for any iterable object.
      -
      -```javascript
      -var getIterator = require('es6-iterator/get');
      -var iterator = get([1,2,3]);
      -
      -iterator.next(); // { value: 1, done: false }
      -iterator.next(); // { value: 2, done: false }
      -iterator.next(); // { value: 3, done: false }
      -iterator.next(); // { value: undefined, done: true }
      -```
      -
      -#### isIterable(obj) _(es6-iterator/is-iterable)_
      -
      -Whether _obj_ is iterable
      -
      -```javascript
      -var isIterable = require('es6-iterator/is-iterable');
      -
      -isIterable(null); // false
      -isIterable(true); // false
      -isIterable('str'); // true
      -isIterable(['a', 'r', 'r']); // true
      -isIterable(new ArrayIterator([])); // true
      -```
      -
      -#### validIterable(obj) _(es6-iterator/valid-iterable)_
      -
      -If _obj_ is an iterable it is returned. Otherwise _TypeError_ is thrown.
      -
      -### Method extensions
      -
      -#### iterator.chain(iterator1[, …iteratorn]) _(es6-iterator/#/chain)_
      -
      -Chain multiple iterators into one.
      -
      -### Tests [![Build Status](https://travis-ci.org/medikoo/es6-iterator.png)](https://travis-ci.org/medikoo/es6-iterator)
      -
      -	$ npm test
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/for-of.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/for-of.js
      deleted file mode 100644
      index 111f5522735204..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/for-of.js
      +++ /dev/null
      @@ -1,44 +0,0 @@
      -'use strict';
      -
      -var callable = require('es5-ext/object/valid-callable')
      -  , isString = require('es5-ext/string/is-string')
      -  , get      = require('./get')
      -
      -  , isArray = Array.isArray, call = Function.prototype.call;
      -
      -module.exports = function (iterable, cb/*, thisArg*/) {
      -	var mode, thisArg = arguments[2], result, doBreak, broken, i, l, char, code;
      -	if (isArray(iterable)) mode = 'array';
      -	else if (isString(iterable)) mode = 'string';
      -	else iterable = get(iterable);
      -
      -	callable(cb);
      -	doBreak = function () { broken = true; };
      -	if (mode === 'array') {
      -		iterable.some(function (value) {
      -			call.call(cb, thisArg, value, doBreak);
      -			if (broken) return true;
      -		});
      -		return;
      -	}
      -	if (mode === 'string') {
      -		l = iterable.length;
      -		for (i = 0; i < l; ++i) {
      -			char = iterable[i];
      -			if ((i + 1) < l) {
      -				code = char.charCodeAt(0);
      -				if ((code >= 0xD800) && (code <= 0xDBFF)) char += iterable[++i];
      -			}
      -			call.call(cb, thisArg, char, doBreak);
      -			if (broken) break;
      -		}
      -		return;
      -	}
      -	result = iterable.next();
      -
      -	while (!result.done) {
      -		call.call(cb, thisArg, result.value, doBreak);
      -		if (broken) return;
      -		result = iterable.next();
      -	}
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/get.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/get.js
      deleted file mode 100644
      index 38230fd85a2101..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/get.js
      +++ /dev/null
      @@ -1,13 +0,0 @@
      -'use strict';
      -
      -var isString = require('es5-ext/string/is-string')
      -  , ArrayIterator  = require('./array')
      -  , StringIterator = require('./string')
      -  , iterable       = require('./valid-iterable')
      -  , iteratorSymbol = require('es6-symbol').iterator;
      -
      -module.exports = function (obj) {
      -	if (typeof iterable(obj)[iteratorSymbol] === 'function') return obj[iteratorSymbol]();
      -	if (isString(obj)) return new StringIterator(obj);
      -	return new ArrayIterator(obj);
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/is-iterable.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/is-iterable.js
      deleted file mode 100644
      index bbcf10492e1dc0..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/is-iterable.js
      +++ /dev/null
      @@ -1,13 +0,0 @@
      -'use strict';
      -
      -var isString       = require('es5-ext/string/is-string')
      -  , iteratorSymbol = require('es6-symbol').iterator
      -
      -  , isArray = Array.isArray;
      -
      -module.exports = function (value) {
      -	if (value == null) return false;
      -	if (isArray(value)) return true;
      -	if (isString(value)) return true;
      -	return (typeof value[iteratorSymbol] === 'function');
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/package.json b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/package.json
      deleted file mode 100644
      index b861638ad5d27b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/package.json
      +++ /dev/null
      @@ -1,66 +0,0 @@
      -{
      -  "name": "es6-iterator",
      -  "version": "0.1.3",
      -  "description": "Iterator abstraction based on ES6 specification",
      -  "author": {
      -    "name": "Mariusz Nowak",
      -    "email": "medyk@medikoo.com",
      -    "url": "http://www.medikoo.com/"
      -  },
      -  "keywords": [
      -    "iterator",
      -    "array",
      -    "list",
      -    "set",
      -    "map",
      -    "generator"
      -  ],
      -  "repository": {
      -    "type": "git",
      -    "url": "git://github.com/medikoo/es6-iterator.git"
      -  },
      -  "dependencies": {
      -    "d": "~0.1.1",
      -    "es5-ext": "~0.10.5",
      -    "es6-symbol": "~2.0.1"
      -  },
      -  "devDependencies": {
      -    "event-emitter": "~0.3.3",
      -    "tad": "~0.2.1",
      -    "xlint": "~0.2.2",
      -    "xlint-jslint-medikoo": "~0.1.2"
      -  },
      -  "scripts": {
      -    "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream",
      -    "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch",
      -    "test": "node ./node_modules/tad/bin/tad"
      -  },
      -  "license": "MIT",
      -  "gitHead": "2addc362c6f139e4941cf4726eeb59e5960c5cef",
      -  "bugs": {
      -    "url": "https://github.com/medikoo/es6-iterator/issues"
      -  },
      -  "homepage": "https://github.com/medikoo/es6-iterator",
      -  "_id": "es6-iterator@0.1.3",
      -  "_shasum": "d6f58b8c4fc413c249b4baa19768f8e4d7c8944e",
      -  "_from": "es6-iterator@>=0.1.3 <0.2.0",
      -  "_npmVersion": "2.3.0",
      -  "_nodeVersion": "0.11.16",
      -  "_npmUser": {
      -    "name": "medikoo",
      -    "email": "medikoo+npm@medikoo.com"
      -  },
      -  "maintainers": [
      -    {
      -      "name": "medikoo",
      -      "email": "medikoo+npm@medikoo.com"
      -    }
      -  ],
      -  "dist": {
      -    "shasum": "d6f58b8c4fc413c249b4baa19768f8e4d7c8944e",
      -    "tarball": "http://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.3.tgz"
      -  },
      -  "directories": {},
      -  "_resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-0.1.3.tgz",
      -  "readme": "ERROR: No README data found!"
      -}
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/#/chain.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/#/chain.js
      deleted file mode 100644
      index a414c66d78f44f..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/#/chain.js
      +++ /dev/null
      @@ -1,23 +0,0 @@
      -'use strict';
      -
      -var Iterator = require('../../');
      -
      -module.exports = function (t, a) {
      -	var i1 = new Iterator(['raz', 'dwa', 'trzy'])
      -	  , i2 = new Iterator(['cztery', 'pięć', 'sześć'])
      -	  , i3 = new Iterator(['siedem', 'osiem', 'dziewięć'])
      -
      -	  , iterator = t.call(i1, i2, i3);
      -
      -	a.deep(iterator.next(), { done: false, value: 'raz' }, "#1");
      -	a.deep(iterator.next(), { done: false, value: 'dwa' }, "#2");
      -	a.deep(iterator.next(), { done: false, value: 'trzy' }, "#3");
      -	a.deep(iterator.next(), { done: false, value: 'cztery' }, "#4");
      -	a.deep(iterator.next(), { done: false, value: 'pięć' }, "#5");
      -	a.deep(iterator.next(), { done: false, value: 'sześć' }, "#6");
      -	a.deep(iterator.next(), { done: false, value: 'siedem' }, "#7");
      -	a.deep(iterator.next(), { done: false, value: 'osiem' }, "#8");
      -	a.deep(iterator.next(), { done: false, value: 'dziewięć' }, "#9");
      -	a.deep(iterator.next(), { done: true, value: undefined }, "Done #1");
      -	a.deep(iterator.next(), { done: true, value: undefined }, "Done #2");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/array.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/array.js
      deleted file mode 100644
      index ae7c2199e84a72..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/array.js
      +++ /dev/null
      @@ -1,67 +0,0 @@
      -'use strict';
      -
      -var iteratorSymbol = require('es6-symbol').iterator;
      -
      -module.exports = function (T) {
      -	return {
      -		Values: function (a) {
      -			var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it;
      -
      -			it = new T(x);
      -			a(it[iteratorSymbol](), it, "@@iterator");
      -			a.deep(it.next(), { done: false, value: 'raz' }, "#1");
      -			a.deep(it.next(), { done: false, value: 'dwa' }, "#2");
      -			x.splice(1, 0, 'elo');
      -			a.deep(it.next(), { done: false, value: 'dwa' }, "Insert");
      -			a.deep(it.next(), { done: false, value: 'trzy' }, "#3");
      -			a.deep(it.next(), { done: false, value: 'cztery' }, "#4");
      -			x.pop();
      -			a.deep(it.next(), { done: false, value: 'pięć' }, "#5");
      -			a.deep(it.next(), { done: true, value: undefined }, "End");
      -		},
      -		"Keys & Values": function (a) {
      -			var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it;
      -
      -			it = new T(x, 'key+value');
      -			a(it[iteratorSymbol](), it, "@@iterator");
      -			a.deep(it.next(), { done: false, value: [0, 'raz'] }, "#1");
      -			a.deep(it.next(), { done: false, value: [1, 'dwa'] }, "#2");
      -			x.splice(1, 0, 'elo');
      -			a.deep(it.next(), { done: false, value: [2, 'dwa'] }, "Insert");
      -			a.deep(it.next(), { done: false, value: [3, 'trzy'] }, "#3");
      -			a.deep(it.next(), { done: false, value: [4, 'cztery'] }, "#4");
      -			x.pop();
      -			a.deep(it.next(), { done: false, value: [5, 'pięć'] }, "#5");
      -			a.deep(it.next(), { done: true, value: undefined }, "End");
      -		},
      -		Keys: function (a) {
      -			var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it;
      -
      -			it = new T(x, 'key');
      -			a(it[iteratorSymbol](), it, "@@iterator");
      -			a.deep(it.next(), { done: false, value: 0 }, "#1");
      -			a.deep(it.next(), { done: false, value: 1 }, "#2");
      -			x.splice(1, 0, 'elo');
      -			a.deep(it.next(), { done: false, value: 2 }, "Insert");
      -			a.deep(it.next(), { done: false, value: 3 }, "#3");
      -			a.deep(it.next(), { done: false, value: 4 }, "#4");
      -			x.pop();
      -			a.deep(it.next(), { done: false, value: 5 }, "#5");
      -			a.deep(it.next(), { done: true, value: undefined }, "End");
      -		},
      -		Sparse: function (a) {
      -			var x = new Array(6), it;
      -
      -			x[2] = 'raz';
      -			x[4] = 'dwa';
      -			it = new T(x);
      -			a.deep(it.next(), { done: false, value: undefined }, "#1");
      -			a.deep(it.next(), { done: false, value: undefined }, "#2");
      -			a.deep(it.next(), { done: false, value: 'raz' }, "#3");
      -			a.deep(it.next(), { done: false, value: undefined }, "#4");
      -			a.deep(it.next(), { done: false, value: 'dwa' }, "#5");
      -			a.deep(it.next(), { done: false, value: undefined }, "#6");
      -			a.deep(it.next(), { done: true, value: undefined }, "End");
      -		}
      -	};
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/for-of.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/for-of.js
      deleted file mode 100644
      index 502e7b767f61b2..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/for-of.js
      +++ /dev/null
      @@ -1,35 +0,0 @@
      -'use strict';
      -
      -var ArrayIterator = require('../array')
      -
      -  , slice = Array.prototype.slice;
      -
      -module.exports = function (t, a) {
      -	var i = 0, x = ['raz', 'dwa', 'trzy'], y = {}, called = 0;
      -	t(x, function () {
      -		a.deep(slice.call(arguments, 0, 1), [x[i]], "Array " + i + "#");
      -		a(this, y, "Array: context:  " + (i++) + "#");
      -	}, y);
      -	i = 0;
      -	t(x = 'foo', function () {
      -		a.deep(slice.call(arguments, 0, 1), [x[i]], "String " + i + "#");
      -		a(this, y, "Regular String: context:  " + (i++) + "#");
      -	}, y);
      -	i = 0;
      -	x = ['r', '💩', 'z'];
      -	t('r💩z', function () {
      -		a.deep(slice.call(arguments, 0, 1), [x[i]], "String " + i + "#");
      -		a(this, y, "Unicode String: context:  " + (i++) + "#");
      -	}, y);
      -	i = 0;
      -	t(new ArrayIterator(x), function () {
      -		a.deep(slice.call(arguments, 0, 1), [x[i]], "Iterator " + i + "#");
      -		a(this, y, "Iterator: context:  " + (i++) + "#");
      -	}, y);
      -
      -	t(x = ['raz', 'dwa', 'trzy'], function (value, doBreak) {
      -		++called;
      -		return doBreak();
      -	});
      -	a(called, 1, "Break");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/get.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/get.js
      deleted file mode 100644
      index 7309590cba5689..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/get.js
      +++ /dev/null
      @@ -1,16 +0,0 @@
      -'use strict';
      -
      -var iteratorSymbol = require('es6-symbol').iterator
      -  , Iterator       = require('../');
      -
      -module.exports = function (t, a) {
      -	var iterator;
      -	a.throws(function () { t(); }, TypeError, "Null");
      -	a.throws(function () { t({}); }, TypeError, "Plain object");
      -	a.throws(function () { t({ length: 0 }); }, TypeError, "Array-like");
      -	iterator = {};
      -	iterator[iteratorSymbol] = function () { return new Iterator([]); };
      -	a(t(iterator) instanceof Iterator, true, "Iterator");
      -	a(String(t([])), '[object Array Iterator]', " Array");
      -	a(String(t('foo')), '[object String Iterator]', "String");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/index.js
      deleted file mode 100644
      index ea3621adfebeb5..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/index.js
      +++ /dev/null
      @@ -1,99 +0,0 @@
      -'use strict';
      -
      -var ee             = require('event-emitter')
      -  , iteratorSymbol = require('es6-symbol').iterator;
      -
      -module.exports = function (T) {
      -	return {
      -		"": function (a) {
      -			var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć'], it, y, z;
      -
      -			it = new T(x);
      -			a(it[iteratorSymbol](), it, "@@iterator");
      -			y = it.next();
      -			a.deep(y, { done: false, value: 'raz' }, "#1");
      -			z = it.next();
      -			a.not(y, z, "Recreate result");
      -			a.deep(z, { done: false, value: 'dwa' }, "#2");
      -			a.deep(it.next(), { done: false, value: 'trzy' }, "#3");
      -			a.deep(it.next(), { done: false, value: 'cztery' }, "#4");
      -			a.deep(it.next(), { done: false, value: 'pięć' }, "#5");
      -			a.deep(y = it.next(), { done: true, value: undefined }, "End");
      -			a.not(y, it.next(), "Recreate result on dead");
      -		},
      -		Emited: function (a) {
      -			var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć'], y, it;
      -
      -			y = ee();
      -			it = new T(x, y);
      -			a.deep(it.next(), { done: false, value: 'raz' }, "#1");
      -			a.deep(it.next(), { done: false, value: 'dwa' }, "#2");
      -			y.emit('_add', x.push('sześć') - 1);
      -			a.deep(it.next(), { done: false, value: 'trzy' }, "#3");
      -			x.splice(1, 0, 'półtora');
      -			y.emit('_add', 1);
      -			a.deep(it.next(), { done: false, value: 'półtora' }, "Insert");
      -			x.splice(5, 1);
      -			y.emit('_delete', 5);
      -			a.deep(it.next(), { done: false, value: 'cztery' }, "#4");
      -			a.deep(it.next(), { done: false, value: 'sześć' }, "#5");
      -			a.deep(it.next(), { done: true, value: undefined }, "End");
      -		},
      -		"Emited #2": function (a) {
      -			var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], y, it;
      -
      -			y = ee();
      -			it = new T(x, y);
      -			a.deep(it.next(), { done: false, value: 'raz' }, "#1");
      -			a.deep(it.next(), { done: false, value: 'dwa' }, "#2");
      -			x.splice(1, 0, 'półtora');
      -			y.emit('_add', 1);
      -			x.splice(1, 0, '1.25');
      -			y.emit('_add', 1);
      -			x.splice(0, 1);
      -			y.emit('_delete', 0);
      -			a.deep(it.next(), { done: false, value: 'półtora' }, "Insert");
      -			a.deep(it.next(), { done: false, value: '1.25' }, "Insert #2");
      -			a.deep(it.next(), { done: false, value: 'trzy' }, "#3");
      -			a.deep(it.next(), { done: false, value: 'cztery' }, "#4");
      -			x.splice(5, 1);
      -			y.emit('_delete', 5);
      -			a.deep(it.next(), { done: false, value: 'sześć' }, "#5");
      -			a.deep(it.next(), { done: true, value: undefined }, "End");
      -		},
      -		"Emited: Clear #1": function (a) {
      -			var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], y, it;
      -
      -			y = ee();
      -			it = new T(x, y);
      -			a.deep(it.next(), { done: false, value: 'raz' }, "#1");
      -			a.deep(it.next(), { done: false, value: 'dwa' }, "#2");
      -			x.length = 0;
      -			y.emit('_clear');
      -			a.deep(it.next(), { done: true, value: undefined }, "End");
      -		},
      -		"Emited: Clear #2": function (a) {
      -			var x = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], y, it;
      -
      -			y = ee();
      -			it = new T(x, y);
      -			a.deep(it.next(), { done: false, value: 'raz' }, "#1");
      -			a.deep(it.next(), { done: false, value: 'dwa' }, "#2");
      -			x.length = 0;
      -			y.emit('_clear');
      -			x.push('foo');
      -			x.push('bar');
      -			a.deep(it.next(), { done: false, value: 'foo' }, "#3");
      -			a.deep(it.next(), { done: false, value: 'bar' }, "#4");
      -			x.splice(1, 0, 'półtora');
      -			y.emit('_add', 1);
      -			x.splice(1, 0, '1.25');
      -			y.emit('_add', 1);
      -			x.splice(0, 1);
      -			y.emit('_delete', 0);
      -			a.deep(it.next(), { done: false, value: 'półtora' }, "Insert");
      -			a.deep(it.next(), { done: false, value: '1.25' }, "Insert #2");
      -			a.deep(it.next(), { done: true, value: undefined }, "End");
      -		}
      -	};
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/is-iterable.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/is-iterable.js
      deleted file mode 100644
      index 7c5c59b6d75a62..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/is-iterable.js
      +++ /dev/null
      @@ -1,18 +0,0 @@
      -'use strict';
      -
      -var iteratorSymbol = require('es6-symbol').iterator
      -  , Iterator       = require('../');
      -
      -module.exports = function (t, a) {
      -	var iterator;
      -	a(t(), false, "Undefined");
      -	a(t(123), false, "Number");
      -	a(t({}), false, "Plain object");
      -	a(t({ length: 0 }), false, "Array-like");
      -	iterator = {};
      -	iterator[iteratorSymbol] = function () { return new Iterator([]); };
      -	a(t(iterator), true, "Iterator");
      -	a(t([]), true, "Array");
      -	a(t('foo'), true, "String");
      -	a(t(''), true, "Empty string");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/string.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/string.js
      deleted file mode 100644
      index d11855f2511609..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/string.js
      +++ /dev/null
      @@ -1,23 +0,0 @@
      -'use strict';
      -
      -var iteratorSymbol = require('es6-symbol').iterator;
      -
      -module.exports = function (T, a) {
      -	var it = new T('foobar');
      -
      -	a(it[iteratorSymbol](), it, "@@iterator");
      -	a.deep(it.next(), { done: false, value: 'f' }, "#1");
      -	a.deep(it.next(), { done: false, value: 'o' }, "#2");
      -	a.deep(it.next(), { done: false, value: 'o' }, "#3");
      -	a.deep(it.next(), { done: false, value: 'b' }, "#4");
      -	a.deep(it.next(), { done: false, value: 'a' }, "#5");
      -	a.deep(it.next(), { done: false, value: 'r' }, "#6");
      -	a.deep(it.next(), { done: true, value: undefined }, "End");
      -
      -	a.h1("Outside of BMP");
      -	it = new T('r💩z');
      -	a.deep(it.next(), { done: false, value: 'r' }, "#1");
      -	a.deep(it.next(), { done: false, value: '💩' }, "#2");
      -	a.deep(it.next(), { done: false, value: 'z' }, "#3");
      -	a.deep(it.next(), { done: true, value: undefined }, "End");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/valid-iterable.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/valid-iterable.js
      deleted file mode 100644
      index 7760b017826085..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/valid-iterable.js
      +++ /dev/null
      @@ -1,16 +0,0 @@
      -'use strict';
      -
      -var iteratorSymbol = require('es6-symbol').iterator
      -  , Iterator       = require('../');
      -
      -module.exports = function (t, a) {
      -	var obj;
      -	a.throws(function () { t(); }, TypeError, "Undefined");
      -	a.throws(function () { t({}); }, TypeError, "Plain object");
      -	a.throws(function () { t({ length: 0 }); }, TypeError, "Array-like");
      -	obj = {};
      -	obj[iteratorSymbol] = function () { return new Iterator([]); };
      -	a(t(obj), obj, "Iterator");
      -	obj = [];
      -	a(t(obj), obj, 'Array');
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/.lint b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/.lint
      deleted file mode 100644
      index 1851752f99bfda..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/.lint
      +++ /dev/null
      @@ -1,13 +0,0 @@
      -@root
      -
      -module
      -
      -tabs
      -indent 2
      -maxlen 100
      -
      -ass
      -nomen
      -plusplus
      -newcap
      -vars
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/.npmignore b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/.npmignore
      deleted file mode 100644
      index 155e41f69142ef..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/.npmignore
      +++ /dev/null
      @@ -1,4 +0,0 @@
      -.DS_Store
      -/node_modules
      -/npm-debug.log
      -/.lintcache
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/.travis.yml b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/.travis.yml
      deleted file mode 100644
      index afd3509a26b27d..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/.travis.yml
      +++ /dev/null
      @@ -1,9 +0,0 @@
      -language: node_js
      -node_js:
      -  - 0.8
      -  - 0.10
      -  - 0.11
      -
      -notifications:
      -  email:
      -    - medikoo+es6-symbol@medikoo.com
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/CHANGES b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/CHANGES
      deleted file mode 100644
      index df8c27efc38de2..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/CHANGES
      +++ /dev/null
      @@ -1,34 +0,0 @@
      -v2.0.1  --  2015.01.28
      -* Fix Symbol.prototype[Symbol.isPrimitive] implementation
      -* Improve validation within Symbol.prototype.toString and
      -  Symbol.prototype.valueOf
      -
      -v2.0.0  --  2015.01.28
      -* Update up to changes in specification:
      -  * Implement `for` and `keyFor`
      -  * Remove `Symbol.create` and `Symbol.isRegExp`
      -  * Add `Symbol.match`, `Symbol.replace`, `Symbol.search`, `Symbol.species` and
      -    `Symbol.split`
      -* Rename `validSymbol` to `validateSymbol`
      -* Improve documentation
      -* Remove dead test modules
      -
      -v1.0.0  --  2015.01.26
      -* Fix enumerability for symbol properties set normally (e.g. obj[symbol] = value)
      -* Introduce initialization via hidden constructor
      -* Fix isSymbol handling of polyfill values when native Symbol is present
      -* Fix spelling of LICENSE
      -* Configure lint scripts
      -
      -v0.1.1  --  2014.10.07
      -* Fix isImplemented, so it returns true in case of polyfill
      -* Improve documentations
      -
      -v0.1.0  --  2014.04.28
      -* Assure strictly npm dependencies
      -* Update to use latest versions of dependencies
      -* Fix implementation detection so it doesn't crash on `String(symbol)`
      -* throw on `new Symbol()` (as decided by TC39)
      -
      -v0.0.0  --  2013.11.15
      -* Initial (dev) version
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/LICENSE b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/LICENSE
      deleted file mode 100644
      index 04724a3ab1b70b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/LICENSE
      +++ /dev/null
      @@ -1,19 +0,0 @@
      -Copyright (C) 2013-2015 Mariusz Nowak (www.medikoo.com)
      -
      -Permission is hereby granted, free of charge, to any person obtaining a copy
      -of this software and associated documentation files (the "Software"), to deal
      -in the Software without restriction, including without limitation the rights
      -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
      -copies of the Software, and to permit persons to whom the Software is
      -furnished to do so, subject to the following conditions:
      -
      -The above copyright notice and this permission notice shall be included in
      -all copies or substantial portions of the Software.
      -
      -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
      -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
      -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
      -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
      -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
      -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
      -THE SOFTWARE.
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/README.md b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/README.md
      deleted file mode 100644
      index 95d6780ba78cb4..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/README.md
      +++ /dev/null
      @@ -1,71 +0,0 @@
      -# es6-symbol
      -## ECMAScript 6 Symbol polyfill
      -
      -For more information about symbols see following links
      -- [Symbols in ECMAScript 6 by Axel Rauschmayer](http://www.2ality.com/2014/12/es6-symbols.html)
      -- [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol)
      -- [Specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-symbol-constructor)
      -
      -### Limitations
      -
      -Underneath it uses real string property names which can easily be retrieved, however accidental collision with other property names is unlikely.
      -
      -### Usage
      -
      -If you'd like to use native version when it exists and fallback to polyfill if it doesn't (but without implementing `Symbol` on global scope), do:
      -
      -```javascript
      -var Symbol = require('es6-symbol');
      -```
      -
      -If you want to make sure your environment implements `Symbol`, do:
      -
      -```javascript
      -require('es6-symbol/implement');
      -```
      -
      -If you strictly want to use polyfill even if native `Symbol` exists (hard to find a good reason for that), do:
      -
      -```javascript
      -var Symbol = require('es6-symbol/polyfill');
      -```
      -
      -#### API
      -
      -Best is to refer to [specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-symbol-objects). Still if you want quick look, follow examples:
      -
      -```javascript
      -var Symbol = require('es6-symbol');
      -
      -var symbol = Symbol('My custom symbol');
      -var x = {};
      -
      -x[symbol] = 'foo';
      -console.log(x[symbol]); 'foo'
      -
      -// Detect iterable:
      -var iterator, result;
      -if (possiblyIterable[Symbol.iterator]) {
      -  iterator = possiblyIterable[Symbol.iterator]();
      -  result = iterator.next();
      -  while(!result.done) {
      -    console.log(result.value);
      -    result = iterator.next();
      -  }
      -}
      -```
      -
      -### Installation
      -#### NPM
      -
      -In your project path:
      -
      -	$ npm install es6-symbol
      -
      -##### Browser
      -
      -To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)
      -
      -## Tests [![Build Status](https://travis-ci.org/medikoo/es6-symbol.png)](https://travis-ci.org/medikoo/es6-symbol)
      -
      -	$ npm test
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/implement.js
      deleted file mode 100644
      index 153edacdbedf9b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/implement.js
      +++ /dev/null
      @@ -1,7 +0,0 @@
      -'use strict';
      -
      -if (!require('./is-implemented')()) {
      -	Object.defineProperty(require('es5-ext/global'), 'Symbol',
      -		{ value: require('./polyfill'), configurable: true, enumerable: false,
      -			writable: true });
      -}
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/index.js
      deleted file mode 100644
      index 609f1faf551164..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/index.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = require('./is-implemented')() ? Symbol : require('./polyfill');
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/is-implemented.js
      deleted file mode 100644
      index 53759f32124b1c..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/is-implemented.js
      +++ /dev/null
      @@ -1,18 +0,0 @@
      -'use strict';
      -
      -module.exports = function () {
      -	var symbol;
      -	if (typeof Symbol !== 'function') return false;
      -	symbol = Symbol('test symbol');
      -	try { String(symbol); } catch (e) { return false; }
      -	if (typeof Symbol.iterator === 'symbol') return true;
      -
      -	// Return 'true' for polyfills
      -	if (typeof Symbol.isConcatSpreadable !== 'object') return false;
      -	if (typeof Symbol.iterator !== 'object') return false;
      -	if (typeof Symbol.toPrimitive !== 'object') return false;
      -	if (typeof Symbol.toStringTag !== 'object') return false;
      -	if (typeof Symbol.unscopables !== 'object') return false;
      -
      -	return true;
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/is-native-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/is-native-implemented.js
      deleted file mode 100644
      index a8cb8b8681ee69..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/is-native-implemented.js
      +++ /dev/null
      @@ -1,8 +0,0 @@
      -// Exports true if environment provides native `Symbol` implementation
      -
      -'use strict';
      -
      -module.exports = (function () {
      -	if (typeof Symbol !== 'function') return false;
      -	return (typeof Symbol.iterator === 'symbol');
      -}());
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/is-symbol.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/is-symbol.js
      deleted file mode 100644
      index beeba2cb4fa23f..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/is-symbol.js
      +++ /dev/null
      @@ -1,5 +0,0 @@
      -'use strict';
      -
      -module.exports = function (x) {
      -	return (x && ((typeof x === 'symbol') || (x['@@toStringTag'] === 'Symbol'))) || false;
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/package.json b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/package.json
      deleted file mode 100644
      index 0efffeaec90658..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/package.json
      +++ /dev/null
      @@ -1,63 +0,0 @@
      -{
      -  "name": "es6-symbol",
      -  "version": "2.0.1",
      -  "description": "ECMAScript6 Symbol polyfill",
      -  "author": {
      -    "name": "Mariusz Nowak",
      -    "email": "medyk@medikoo.com",
      -    "url": "http://www.medikoo.com/"
      -  },
      -  "keywords": [
      -    "symbol",
      -    "private",
      -    "property",
      -    "es6",
      -    "ecmascript",
      -    "harmony"
      -  ],
      -  "repository": {
      -    "type": "git",
      -    "url": "git://github.com/medikoo/es6-symbol.git"
      -  },
      -  "dependencies": {
      -    "d": "~0.1.1",
      -    "es5-ext": "~0.10.5"
      -  },
      -  "devDependencies": {
      -    "tad": "~0.2.1",
      -    "xlint": "~0.2.2",
      -    "xlint-jslint-medikoo": "~0.1.2"
      -  },
      -  "scripts": {
      -    "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream",
      -    "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch",
      -    "test": "node ./node_modules/tad/bin/tad"
      -  },
      -  "license": "MIT",
      -  "gitHead": "51f6938d7830269fefa38f02eb912f5472b3ccd7",
      -  "bugs": {
      -    "url": "https://github.com/medikoo/es6-symbol/issues"
      -  },
      -  "homepage": "https://github.com/medikoo/es6-symbol",
      -  "_id": "es6-symbol@2.0.1",
      -  "_shasum": "761b5c67cfd4f1d18afb234f691d678682cb3bf3",
      -  "_from": "es6-symbol@>=2.0.1 <2.1.0",
      -  "_npmVersion": "1.4.28",
      -  "_npmUser": {
      -    "name": "medikoo",
      -    "email": "medikoo+npm@medikoo.com"
      -  },
      -  "maintainers": [
      -    {
      -      "name": "medikoo",
      -      "email": "medikoo+npm@medikoo.com"
      -    }
      -  ],
      -  "dist": {
      -    "shasum": "761b5c67cfd4f1d18afb234f691d678682cb3bf3",
      -    "tarball": "http://registry.npmjs.org/es6-symbol/-/es6-symbol-2.0.1.tgz"
      -  },
      -  "directories": {},
      -  "_resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-2.0.1.tgz",
      -  "readme": "ERROR: No README data found!"
      -}
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/polyfill.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/polyfill.js
      deleted file mode 100644
      index 735eb676b23c9b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/polyfill.js
      +++ /dev/null
      @@ -1,77 +0,0 @@
      -'use strict';
      -
      -var d              = require('d')
      -  , validateSymbol = require('./validate-symbol')
      -
      -  , create = Object.create, defineProperties = Object.defineProperties
      -  , defineProperty = Object.defineProperty, objPrototype = Object.prototype
      -  , Symbol, HiddenSymbol, globalSymbols = create(null);
      -
      -var generateName = (function () {
      -	var created = create(null);
      -	return function (desc) {
      -		var postfix = 0, name;
      -		while (created[desc + (postfix || '')]) ++postfix;
      -		desc += (postfix || '');
      -		created[desc] = true;
      -		name = '@@' + desc;
      -		defineProperty(objPrototype, name, d.gs(null, function (value) {
      -			defineProperty(this, name, d(value));
      -		}));
      -		return name;
      -	};
      -}());
      -
      -HiddenSymbol = function Symbol(description) {
      -	if (this instanceof HiddenSymbol) throw new TypeError('TypeError: Symbol is not a constructor');
      -	return Symbol(description);
      -};
      -module.exports = Symbol = function Symbol(description) {
      -	var symbol;
      -	if (this instanceof Symbol) throw new TypeError('TypeError: Symbol is not a constructor');
      -	symbol = create(HiddenSymbol.prototype);
      -	description = (description === undefined ? '' : String(description));
      -	return defineProperties(symbol, {
      -		__description__: d('', description),
      -		__name__: d('', generateName(description))
      -	});
      -};
      -defineProperties(Symbol, {
      -	for: d(function (key) {
      -		if (globalSymbols[key]) return globalSymbols[key];
      -		return (globalSymbols[key] = Symbol(String(key)));
      -	}),
      -	keyFor: d(function (s) {
      -		var key;
      -		validateSymbol(s);
      -		for (key in globalSymbols) if (globalSymbols[key] === s) return key;
      -	}),
      -	hasInstance: d('', Symbol('hasInstance')),
      -	isConcatSpreadable: d('', Symbol('isConcatSpreadable')),
      -	iterator: d('', Symbol('iterator')),
      -	match: d('', Symbol('match')),
      -	replace: d('', Symbol('replace')),
      -	search: d('', Symbol('search')),
      -	species: d('', Symbol('species')),
      -	split: d('', Symbol('split')),
      -	toPrimitive: d('', Symbol('toPrimitive')),
      -	toStringTag: d('', Symbol('toStringTag')),
      -	unscopables: d('', Symbol('unscopables'))
      -});
      -defineProperties(HiddenSymbol.prototype, {
      -	constructor: d(Symbol),
      -	toString: d('', function () { return this.__name__; })
      -});
      -
      -defineProperties(Symbol.prototype, {
      -	toString: d(function () { return 'Symbol (' + validateSymbol(this).__description__ + ')'; }),
      -	valueOf: d(function () { return validateSymbol(this); })
      -});
      -defineProperty(Symbol.prototype, Symbol.toPrimitive, d('',
      -	function () { return validateSymbol(this); }));
      -defineProperty(Symbol.prototype, Symbol.toStringTag, d('c', 'Symbol'));
      -
      -defineProperty(HiddenSymbol.prototype, Symbol.toPrimitive,
      -	d('c', Symbol.prototype[Symbol.toPrimitive]));
      -defineProperty(HiddenSymbol.prototype, Symbol.toStringTag,
      -	d('c', Symbol.prototype[Symbol.toStringTag]));
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/test/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/test/implement.js
      deleted file mode 100644
      index eb35c3018835c7..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/test/implement.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof Symbol, 'function'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/test/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/test/index.js
      deleted file mode 100644
      index 62b3296df6fc5e..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/test/index.js
      +++ /dev/null
      @@ -1,12 +0,0 @@
      -'use strict';
      -
      -var d = require('d')
      -
      -  , defineProperty = Object.defineProperty;
      -
      -module.exports = function (T, a) {
      -	var symbol = T('test'), x = {};
      -	defineProperty(x, symbol, d('foo'));
      -	a(x.test, undefined, "Name");
      -	a(x[symbol], 'foo', "Get");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/test/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/test/is-implemented.js
      deleted file mode 100644
      index bb0d64536ebbae..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/test/is-implemented.js
      +++ /dev/null
      @@ -1,14 +0,0 @@
      -'use strict';
      -
      -var global   = require('es5-ext/global')
      -  , polyfill = require('../polyfill');
      -
      -module.exports = function (t, a) {
      -	var cache;
      -	a(typeof t(), 'boolean');
      -	cache = global.Symbol;
      -	global.Symbol = polyfill;
      -	a(t(), true);
      -	if (cache === undefined) delete global.Symbol;
      -	else global.Symbol = cache;
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/test/is-native-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/test/is-native-implemented.js
      deleted file mode 100644
      index df8ba0323f0cad..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/test/is-native-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t, 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/test/is-symbol.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/test/is-symbol.js
      deleted file mode 100644
      index ac24b9abbff4e6..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/test/is-symbol.js
      +++ /dev/null
      @@ -1,16 +0,0 @@
      -'use strict';
      -
      -var SymbolPoly = require('../polyfill');
      -
      -module.exports = function (t, a) {
      -	a(t(undefined), false, "Undefined");
      -	a(t(null), false, "Null");
      -	a(t(true), false, "Primitive");
      -	a(t('raz'), false, "String");
      -	a(t({}), false, "Object");
      -	a(t([]), false, "Array");
      -	if (typeof Symbol !== 'undefined') {
      -		a(t(Symbol()), true, "Native");
      -	}
      -	a(t(SymbolPoly()), true, "Polyfill");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/test/polyfill.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/test/polyfill.js
      deleted file mode 100644
      index 83fb5e9253677b..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/test/polyfill.js
      +++ /dev/null
      @@ -1,27 +0,0 @@
      -'use strict';
      -
      -var d        = require('d')
      -  , isSymbol = require('../is-symbol')
      -
      -  , defineProperty = Object.defineProperty;
      -
      -module.exports = function (T, a) {
      -	var symbol = T('test'), x = {};
      -	defineProperty(x, symbol, d('foo'));
      -	a(x.test, undefined, "Name");
      -	a(x[symbol], 'foo', "Get");
      -	a(x instanceof T, false);
      -
      -	a(isSymbol(symbol), true, "Symbol");
      -	a(isSymbol(T.iterator), true, "iterator");
      -	a(isSymbol(T.toStringTag), true, "toStringTag");
      -
      -	x = {};
      -	x[symbol] = 'foo';
      -	a.deep(Object.getOwnPropertyDescriptor(x, symbol), { configurable: true, enumerable: false,
      -		value: 'foo', writable: true });
      -	symbol = T.for('marko');
      -	a(isSymbol(symbol), true);
      -	a(T.for('marko'), symbol);
      -	a(T.keyFor(symbol), 'marko');
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/test/validate-symbol.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/test/validate-symbol.js
      deleted file mode 100644
      index 2c8f84c8239b6e..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/test/validate-symbol.js
      +++ /dev/null
      @@ -1,19 +0,0 @@
      -'use strict';
      -
      -var SymbolPoly = require('../polyfill');
      -
      -module.exports = function (t, a) {
      -	var symbol;
      -	a.throws(function () { t(undefined); }, TypeError, "Undefined");
      -	a.throws(function () { t(null); }, TypeError, "Null");
      -	a.throws(function () { t(true); }, TypeError, "Primitive");
      -	a.throws(function () { t('raz'); }, TypeError, "String");
      -	a.throws(function () { t({}); }, TypeError, "Object");
      -	a.throws(function () { t([]); }, TypeError, "Array");
      -	if (typeof Symbol !== 'undefined') {
      -		symbol = Symbol();
      -		a(t(symbol), symbol, "Native");
      -	}
      -	symbol = SymbolPoly();
      -	a(t(symbol), symbol, "Polyfill");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/validate-symbol.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/validate-symbol.js
      deleted file mode 100644
      index 42750043d4271c..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-symbol/validate-symbol.js
      +++ /dev/null
      @@ -1,8 +0,0 @@
      -'use strict';
      -
      -var isSymbol = require('./is-symbol');
      -
      -module.exports = function (value) {
      -	if (!isSymbol(value)) throw new TypeError(value + " is not a symbol");
      -	return value;
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/package.json b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/package.json
      deleted file mode 100644
      index 07973dfab3e479..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/package.json
      +++ /dev/null
      @@ -1,64 +0,0 @@
      -{
      -  "name": "es6-weak-map",
      -  "version": "0.1.4",
      -  "description": "ECMAScript6 WeakMap polyfill",
      -  "author": {
      -    "name": "Mariusz Nowak",
      -    "email": "medyk@medikoo.com",
      -    "url": "http://www.medikoo.com/"
      -  },
      -  "keywords": [
      -    "map",
      -    "weakmap",
      -    "collection",
      -    "es6",
      -    "harmony",
      -    "list",
      -    "hash",
      -    "gc"
      -  ],
      -  "repository": {
      -    "type": "git",
      -    "url": "git://github.com/medikoo/es6-weak-map.git"
      -  },
      -  "dependencies": {
      -    "d": "~0.1.1",
      -    "es5-ext": "~0.10.6",
      -    "es6-iterator": "~0.1.3",
      -    "es6-symbol": "~2.0.1"
      -  },
      -  "devDependencies": {
      -    "tad": "~0.2.2"
      -  },
      -  "scripts": {
      -    "test": "node ./node_modules/tad/bin/tad"
      -  },
      -  "license": "MIT",
      -  "gitHead": "e68802395b82a700257374c379cfaafe84ee8552",
      -  "bugs": {
      -    "url": "https://github.com/medikoo/es6-weak-map/issues"
      -  },
      -  "homepage": "https://github.com/medikoo/es6-weak-map",
      -  "_id": "es6-weak-map@0.1.4",
      -  "_shasum": "706cef9e99aa236ba7766c239c8b9e286ea7d228",
      -  "_from": "es6-weak-map@>=0.1.2 <0.2.0",
      -  "_npmVersion": "2.7.4",
      -  "_nodeVersion": "0.12.2",
      -  "_npmUser": {
      -    "name": "medikoo",
      -    "email": "medikoo+npm@medikoo.com"
      -  },
      -  "maintainers": [
      -    {
      -      "name": "medikoo",
      -      "email": "medikoo+npm@medikoo.com"
      -    }
      -  ],
      -  "dist": {
      -    "shasum": "706cef9e99aa236ba7766c239c8b9e286ea7d228",
      -    "tarball": "http://registry.npmjs.org/es6-weak-map/-/es6-weak-map-0.1.4.tgz"
      -  },
      -  "directories": {},
      -  "_resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-0.1.4.tgz",
      -  "readme": "ERROR: No README data found!"
      -}
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/polyfill.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/polyfill.js
      deleted file mode 100644
      index 1d15660ac7de91..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/polyfill.js
      +++ /dev/null
      @@ -1,75 +0,0 @@
      -'use strict';
      -
      -var setPrototypeOf    = require('es5-ext/object/set-prototype-of')
      -  , object            = require('es5-ext/object/valid-object')
      -  , value             = require('es5-ext/object/valid-value')
      -  , d                 = require('d')
      -  , getIterator       = require('es6-iterator/get')
      -  , forOf             = require('es6-iterator/for-of')
      -  , toStringTagSymbol = require('es6-symbol').toStringTag
      -  , isNative          = require('./is-native-implemented')
      -
      -  , isArray = Array.isArray, defineProperty = Object.defineProperty, random = Math.random
      -  , hasOwnProperty = Object.prototype.hasOwnProperty
      -  , genId, WeakMapPoly;
      -
      -genId = (function () {
      -	var generated = Object.create(null);
      -	return function () {
      -		var id;
      -		do { id = random().toString(36).slice(2); } while (generated[id]);
      -		generated[id] = true;
      -		return id;
      -	};
      -}());
      -
      -module.exports = WeakMapPoly = function (/*iterable*/) {
      -	var iterable = arguments[0];
      -	if (!(this instanceof WeakMapPoly)) return new WeakMapPoly(iterable);
      -	if (this.__weakMapData__ !== undefined) {
      -		throw new TypeError(this + " cannot be reinitialized");
      -	}
      -	if (iterable != null) {
      -		if (!isArray(iterable)) iterable = getIterator(iterable);
      -	}
      -	defineProperty(this, '__weakMapData__', d('c', '$weakMap$' + genId()));
      -	if (!iterable) return;
      -	forOf(iterable, function (val) {
      -		value(val);
      -		this.set(val[0], val[1]);
      -	}, this);
      -};
      -
      -if (isNative) {
      -	if (setPrototypeOf) setPrototypeOf(WeakMapPoly, WeakMap);
      -	WeakMapPoly.prototype = Object.create(WeakMap.prototype, {
      -		constructor: d(WeakMapPoly)
      -	});
      -}
      -
      -Object.defineProperties(WeakMapPoly.prototype, {
      -	clear: d(function () {
      -		defineProperty(this, '__weakMapData__', d('c', '$weakMap$' + genId()));
      -	}),
      -	delete: d(function (key) {
      -		if (hasOwnProperty.call(object(key), this.__weakMapData__)) {
      -			delete key[this.__weakMapData__];
      -			return true;
      -		}
      -		return false;
      -	}),
      -	get: d(function (key) {
      -		if (hasOwnProperty.call(object(key), this.__weakMapData__)) {
      -			return key[this.__weakMapData__];
      -		}
      -	}),
      -	has: d(function (key) {
      -		return hasOwnProperty.call(object(key), this.__weakMapData__);
      -	}),
      -	set: d(function (key, value) {
      -		defineProperty(object(key), this.__weakMapData__, d('c', value));
      -		return this;
      -	}),
      -	toString: d(function () { return '[object WeakMap]'; })
      -});
      -defineProperty(WeakMapPoly.prototype, toStringTagSymbol, d('c', 'WeakMap'));
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/implement.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/implement.js
      deleted file mode 100644
      index 860027ed290974..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/implement.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof WeakMap, 'function'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/index.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/index.js
      deleted file mode 100644
      index 9b26e4fa7e4a01..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/index.js
      +++ /dev/null
      @@ -1,6 +0,0 @@
      -'use strict';
      -
      -module.exports = function (T, a) {
      -	var x = {};
      -	a((new T([[x, 'foo']])).get(x), 'foo');
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/is-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/is-implemented.js
      deleted file mode 100644
      index 1a8832889bf493..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/is-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t(), 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/is-native-implemented.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/is-native-implemented.js
      deleted file mode 100644
      index df8ba0323f0cad..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/is-native-implemented.js
      +++ /dev/null
      @@ -1,3 +0,0 @@
      -'use strict';
      -
      -module.exports = function (t, a) { a(typeof t, 'boolean'); };
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/is-weak-map.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/is-weak-map.js
      deleted file mode 100644
      index ba8c04519ca204..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/is-weak-map.js
      +++ /dev/null
      @@ -1,16 +0,0 @@
      -'use strict';
      -
      -var WeakMapPoly = require('../polyfill');
      -
      -module.exports = function (t, a) {
      -	a(t(undefined), false, "Undefined");
      -	a(t(null), false, "Null");
      -	a(t(true), false, "Primitive");
      -	a(t('raz'), false, "String");
      -	a(t({}), false, "Object");
      -	a(t([]), false, "Array");
      -	if (typeof WeakMap !== 'undefined') {
      -		a(t(new WeakMap()), true, "Native");
      -	}
      -	a(t(new WeakMapPoly()), true, "Polyfill");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/polyfill.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/polyfill.js
      deleted file mode 100644
      index 1a4885be8354e0..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/polyfill.js
      +++ /dev/null
      @@ -1,22 +0,0 @@
      -'use strict';
      -
      -module.exports = function (T, a) {
      -	var x = {}, y = {}, z = {}, arr = [[x, 'raz'], [y, 'dwa']], map = new T(arr);
      -
      -	a(map instanceof T, true, "WeakMap");
      -	a(map.has(x), true, "Has: true");
      -	a(map.get(x), 'raz', "Get: contains");
      -	a(map.has(z), false, "Has: false");
      -	a(map.get(z), undefined, "Get: doesn't contain");
      -	a(map.set(z, 'trzy'), map, "Set: return");
      -	a(map.has(z), true, "Add");
      -	a(map.delete({}), false, "Delete: false");
      -
      -	a(map.delete(x), true, "Delete: true");
      -	a(map.get(x), undefined, "Get: after delete");
      -	a(map.has(x), false, "Has: after delete");
      -
      -	a(map.has(y), true, "Has: pre clear");
      -	map.clear();
      -	a(map.has(y), false, "Has: after clear");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/valid-weak-map.js b/tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/valid-weak-map.js
      deleted file mode 100644
      index a7823421a7c503..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/valid-weak-map.js
      +++ /dev/null
      @@ -1,19 +0,0 @@
      -'use strict';
      -
      -var WeakMapPoly = require('../polyfill');
      -
      -module.exports = function (t, a) {
      -	var map;
      -	a.throws(function () { t(undefined); }, TypeError, "Undefined");
      -	a.throws(function () { t(null); }, TypeError, "Null");
      -	a.throws(function () { t(true); }, TypeError, "Primitive");
      -	a.throws(function () { t('raz'); }, TypeError, "String");
      -	a.throws(function () { t({}); }, TypeError, "Object");
      -	a.throws(function () { t([]); }, TypeError, "Array");
      -	if (typeof WeakMap !== 'undefined') {
      -		map = new WeakMap();
      -		a(t(map), map, "Native");
      -	}
      -	map = new WeakMapPoly();
      -	a(t(map), map, "Polyfill");
      -};
      diff --git a/tools/eslint/node_modules/escope/node_modules/esrecurse/README.md b/tools/eslint/node_modules/escope/node_modules/esrecurse/README.md
      deleted file mode 100644
      index e767592faab07e..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/esrecurse/README.md
      +++ /dev/null
      @@ -1,86 +0,0 @@
      -### Esrecurse [![Build Status](https://secure.travis-ci.org/estools/esrecurse.png)](http://travis-ci.org/estools/esrecurse)
      -
      -Esrecurse ([esrecurse](http://github.com/estools/esrecurse)) is
      -[ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm)
      -recursive traversing functionality.
      -
      -### Example Usage
      -
      -The following code will output all variables declared at the root of a file.
      -
      -```javascript
      -esrecurse.visit(ast, {
      -    XXXStatement: function (node) {
      -        this.visit(node.left);
      -        // do something...
      -        this.visit(node.right);
      -    }
      -});
      -```
      -
      -We can use `Visitor` instance.
      -
      -```javascript
      -var visitor = new esrecurse.Visitor({
      -    XXXStatement: function (node) {
      -        this.visit(node.left);
      -        // do something...
      -        this.visit(node.right);
      -    }
      -});
      -
      -visitor.visit(ast);
      -```
      -
      -We can inherit `Visitor` instance easily.
      -
      -```javascript
      -function DerivedVisitor() {
      -    esrecurse.Visitor.call(/* this for constructor */  this  /* visitor object automatically becomes this. */);
      -}
      -util.inherits(DerivedVisitor, esrecurse.Visitor);
      -DerivedVisitor.prototype.XXXStatement = function (node) {
      -    this.visit(node.left);
      -    // do something...
      -    this.visit(node.right);
      -};
      -```
      -
      -And you can invoke default visiting operation inside custom visit operation.
      -
      -```javascript
      -function DerivedVisitor() {
      -    esrecurse.Visitor.call(/* this for constructor */  this  /* visitor object automatically becomes this. */);
      -}
      -util.inherits(DerivedVisitor, esrecurse.Visitor);
      -DerivedVisitor.prototype.XXXStatement = function (node) {
      -    // do something...
      -    this.visitChildren(node);
      -};
      -```
      -
      -### License
      -
      -Copyright (C) 2014 [Yusuke Suzuki](http://github.com/Constellation)
      - (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors.
      -
      -Redistribution and use in source and binary forms, with or without
      -modification, are permitted provided that the following conditions are met:
      -
      -  * Redistributions of source code must retain the above copyright
      -    notice, this list of conditions and the following disclaimer.
      -
      -  * Redistributions in binary form must reproduce the above copyright
      -    notice, this list of conditions and the following disclaimer in the
      -    documentation and/or other materials provided with the distribution.
      -
      -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
      -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      -ARE DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
      -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
      -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
      -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
      -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      diff --git a/tools/eslint/node_modules/escope/node_modules/esrecurse/gulpfile.coffee b/tools/eslint/node_modules/escope/node_modules/esrecurse/gulpfile.coffee
      deleted file mode 100644
      index e7781896774265..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/esrecurse/gulpfile.coffee
      +++ /dev/null
      @@ -1,79 +0,0 @@
      -# Copyright (C) 2014 Yusuke Suzuki 
      -#
      -# Redistribution and use in source and binary forms, with or without
      -# modification, are permitted provided that the following conditions are met:
      -#
      -#   * Redistributions of source code must retain the above copyright
      -#     notice, this list of conditions and the following disclaimer.
      -#   * Redistributions in binary form must reproduce the above copyright
      -#     notice, this list of conditions and the following disclaimer in the
      -#     documentation and/or other materials provided with the distribution.
      -#
      -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
      -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      -# ARE DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
      -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
      -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
      -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      -# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
      -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      -
      -gulp = require 'gulp'
      -mocha = require 'gulp-mocha'
      -eslint = require 'gulp-eslint'
      -minimist = require 'minimist'
      -git = require 'gulp-git'
      -bump = require 'gulp-bump'
      -filter = require 'gulp-filter'
      -tagVersion = require 'gulp-tag-version'
      -require 'coffee-script/register'
      -
      -SOURCE = [
      -    '*.js'
      -]
      -
      -ESLINT_OPTION =
      -    rules:
      -        'quotes': 0
      -        'eqeqeq': 0
      -        'no-use-before-define': 0
      -        'no-shadow': 0
      -        'no-new': 0
      -        'no-underscore-dangle': 0
      -        'no-multi-spaces': false
      -        'no-native-reassign': 0
      -        'no-loop-func': 0
      -    env:
      -        'node': true
      -
      -gulp.task 'test', ->
      -    options = minimist process.argv.slice(2),
      -        string: 'test',
      -        default:
      -            test: 'test/*.coffee'
      -    return gulp.src(options.test).pipe(mocha reporter: 'spec')
      -
      -gulp.task 'lint', ->
      -    return gulp.src(SOURCE)
      -    .pipe(eslint(ESLINT_OPTION))
      -    .pipe(eslint.formatEach('stylish', process.stderr))
      -    .pipe(eslint.failOnError())
      -
      -inc = (importance) ->
      -    gulp.src(['./package.json'])
      -        .pipe(bump({type: importance}))
      -        .pipe(gulp.dest('./'))
      -        .pipe(git.commit('Bumps package version'))
      -        .pipe(filter('package.json'))
      -        .pipe(tagVersion({
      -            prefix: ''
      -        }))
      -
      -gulp.task 'travis', [ 'lint', 'test' ]
      -gulp.task 'default', [ 'travis' ]
      -
      -gulp.task 'patch', [ ], -> inc('patch')
      -gulp.task 'minor', [ ], -> inc('minor')
      -gulp.task 'major', [ ], -> inc('major')
      diff --git a/tools/eslint/node_modules/escope/node_modules/esrecurse/package.json b/tools/eslint/node_modules/escope/node_modules/esrecurse/package.json
      deleted file mode 100644
      index 70f7d8569aaf79..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/esrecurse/package.json
      +++ /dev/null
      @@ -1,71 +0,0 @@
      -{
      -  "name": "esrecurse",
      -  "description": "ECMAScript scope analyzer",
      -  "homepage": "http://github.com/estools/esrecurse",
      -  "main": "esrecurse.js",
      -  "version": "3.1.1",
      -  "engines": {
      -    "node": ">=0.10.0"
      -  },
      -  "maintainers": [
      -    {
      -      "name": "constellation",
      -      "email": "utatane.tea@gmail.com"
      -    },
      -    {
      -      "name": "michaelficarra",
      -      "email": "npm@michael.ficarra.me"
      -    }
      -  ],
      -  "repository": {
      -    "type": "git",
      -    "url": "git+ssh://git@github.com/estools/esrecurse.git"
      -  },
      -  "dependencies": {
      -    "estraverse": "~3.1.0"
      -  },
      -  "devDependencies": {
      -    "chai": "^2.1.1",
      -    "coffee-script": "^1.9.1",
      -    "esprima": "^2.1.0",
      -    "gulp": "~3.8.10",
      -    "gulp-bump": "^0.2.2",
      -    "gulp-eslint": "^0.6.0",
      -    "gulp-filter": "^2.0.2",
      -    "gulp-git": "^1.1.0",
      -    "gulp-mocha": "~2.0.0",
      -    "gulp-tag-version": "^1.2.1",
      -    "jsdoc": "~3.3.0-alpha10",
      -    "minimist": "^1.1.0"
      -  },
      -  "licenses": [
      -    {
      -      "type": "BSD",
      -      "url": "http://github.com/estools/esrecurse/raw/master/LICENSE.BSD"
      -    }
      -  ],
      -  "scripts": {
      -    "test": "gulp travis",
      -    "unit-test": "gulp test",
      -    "lint": "gulp lint"
      -  },
      -  "gitHead": "600a8aac5e7b313875a873134fd110b47a76fc77",
      -  "bugs": {
      -    "url": "https://github.com/estools/esrecurse/issues"
      -  },
      -  "_id": "esrecurse@3.1.1",
      -  "_shasum": "8feb963699d4d1b2d65a576cd4b1296672a0f0e9",
      -  "_from": "esrecurse@>=3.1.1 <4.0.0",
      -  "_npmVersion": "2.0.0-alpha-5",
      -  "_npmUser": {
      -    "name": "constellation",
      -    "email": "utatane.tea@gmail.com"
      -  },
      -  "dist": {
      -    "shasum": "8feb963699d4d1b2d65a576cd4b1296672a0f0e9",
      -    "tarball": "http://registry.npmjs.org/esrecurse/-/esrecurse-3.1.1.tgz"
      -  },
      -  "directories": {},
      -  "_resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-3.1.1.tgz",
      -  "readme": "ERROR: No README data found!"
      -}
      diff --git a/tools/eslint/node_modules/escope/node_modules/estraverse/.jshintrc b/tools/eslint/node_modules/escope/node_modules/estraverse/.jshintrc
      deleted file mode 100644
      index f642dae7683b81..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/estraverse/.jshintrc
      +++ /dev/null
      @@ -1,16 +0,0 @@
      -{
      -  "curly": true,
      -  "eqeqeq": true,
      -  "immed": true,
      -  "eqnull": true,
      -  "latedef": true,
      -  "noarg": true,
      -  "noempty": true,
      -  "quotmark": "single",
      -  "undef": true,
      -  "unused": true,
      -  "strict": true,
      -  "trailing": true,
      -
      -  "node": true
      -}
      diff --git a/tools/eslint/node_modules/escope/node_modules/estraverse/README.md b/tools/eslint/node_modules/escope/node_modules/estraverse/README.md
      deleted file mode 100644
      index 4242c513309e9a..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/estraverse/README.md
      +++ /dev/null
      @@ -1,124 +0,0 @@
      -### Estraverse [![Build Status](https://secure.travis-ci.org/estools/estraverse.png)](http://travis-ci.org/estools/estraverse)
      -
      -Estraverse ([estraverse](http://github.com/estools/estraverse)) is
      -[ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm)
      -traversal functions from [esmangle project](http://github.com/estools/esmangle).
      -
      -### Documentation
      -
      -You can find usage docs at [wiki page](https://github.com/estools/estraverse/wiki/Usage).
      -
      -### Example Usage
      -
      -The following code will output all variables declared at the root of a file.
      -
      -```javascript
      -estraverse.traverse(ast, {
      -    enter: function (node, parent) {
      -        if (node.type == 'FunctionExpression' || node.type == 'FunctionDeclaration')
      -            return estraverse.VisitorOption.Skip;
      -    },
      -    leave: function (node, parent) {
      -        if (node.type == 'VariableDeclarator')
      -          console.log(node.id.name);
      -    }
      -});
      -```
      -
      -We can use `this.skip`, `this.remove` and `this.break` functions instead of using Skip, Remove and Break.
      -
      -```javascript
      -estraverse.traverse(ast, {
      -    enter: function (node) {
      -        this.break();
      -    }
      -});
      -```
      -
      -And estraverse provides `estraverse.replace` function. When returning node from `enter`/`leave`, current node is replaced with it.
      -
      -```javascript
      -result = estraverse.replace(tree, {
      -    enter: function (node) {
      -        // Replace it with replaced.
      -        if (node.type === 'Literal')
      -            return replaced;
      -    }
      -});
      -```
      -
      -By passing `visitor.keys` mapping, we can extend estraverse traversing functionality.
      -
      -```javascript
      -// This tree contains a user-defined `TestExpression` node.
      -var tree = {
      -    type: 'TestExpression',
      -
      -    // This 'argument' is the property containing the other **node**.
      -    argument: {
      -        type: 'Literal',
      -        value: 20
      -    },
      -
      -    // This 'extended' is the property not containing the other **node**.
      -    extended: true
      -};
      -estraverse.traverse(tree, {
      -    enter: function (node) { },
      -
      -    // Extending the exising traversing rules.
      -    keys: {
      -        // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ]
      -        TestExpression: ['argument']
      -    }
      -});
      -```
      -
      -By passing `visitor.fallback` option, we can control the behavior when encountering unknown nodes.
      -```javascript
      -// This tree contains a user-defined `TestExpression` node.
      -var tree = {
      -    type: 'TestExpression',
      -
      -    // This 'argument' is the property containing the other **node**.
      -    argument: {
      -        type: 'Literal',
      -        value: 20
      -    },
      -
      -    // This 'extended' is the property not containing the other **node**.
      -    extended: true
      -};
      -estraverse.traverse(tree, {
      -    enter: function (node) { },
      -
      -    // Iterating the child **nodes** of unknown nodes.
      -    fallback: 'iteration'
      -});
      -```
      -
      -### License
      -
      -Copyright (C) 2012-2013 [Yusuke Suzuki](http://github.com/Constellation)
      - (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors.
      -
      -Redistribution and use in source and binary forms, with or without
      -modification, are permitted provided that the following conditions are met:
      -
      -  * Redistributions of source code must retain the above copyright
      -    notice, this list of conditions and the following disclaimer.
      -
      -  * Redistributions in binary form must reproduce the above copyright
      -    notice, this list of conditions and the following disclaimer in the
      -    documentation and/or other materials provided with the distribution.
      -
      -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
      -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      -ARE DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
      -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
      -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
      -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
      -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      diff --git a/tools/eslint/node_modules/escope/node_modules/estraverse/gulpfile.js b/tools/eslint/node_modules/escope/node_modules/estraverse/gulpfile.js
      deleted file mode 100644
      index 8772bbcca542a8..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/estraverse/gulpfile.js
      +++ /dev/null
      @@ -1,70 +0,0 @@
      -/*
      -  Copyright (C) 2014 Yusuke Suzuki 
      -
      -  Redistribution and use in source and binary forms, with or without
      -  modification, are permitted provided that the following conditions are met:
      -
      -    * Redistributions of source code must retain the above copyright
      -      notice, this list of conditions and the following disclaimer.
      -    * Redistributions in binary form must reproduce the above copyright
      -      notice, this list of conditions and the following disclaimer in the
      -      documentation and/or other materials provided with the distribution.
      -
      -  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
      -  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      -  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      -  ARE DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
      -  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
      -  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
      -  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      -  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      -  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
      -  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      -*/
      -
      -'use strict';
      -
      -var gulp = require('gulp'),
      -    git = require('gulp-git'),
      -    bump = require('gulp-bump'),
      -    filter = require('gulp-filter'),
      -    tagVersion = require('gulp-tag-version');
      -
      -var TEST = [ 'test/*.js' ];
      -var POWERED = [ 'powered-test/*.js' ];
      -var SOURCE = [ 'src/**/*.js' ];
      -
      -/**
      - * Bumping version number and tagging the repository with it.
      - * Please read http://semver.org/
      - *
      - * You can use the commands
      - *
      - *     gulp patch     # makes v0.1.0 -> v0.1.1
      - *     gulp feature   # makes v0.1.1 -> v0.2.0
      - *     gulp release   # makes v0.2.1 -> v1.0.0
      - *
      - * To bump the version numbers accordingly after you did a patch,
      - * introduced a feature or made a backwards-incompatible release.
      - */
      -
      -function inc(importance) {
      -    // get all the files to bump version in
      -    return gulp.src(['./package.json'])
      -        // bump the version number in those files
      -        .pipe(bump({type: importance}))
      -        // save it back to filesystem
      -        .pipe(gulp.dest('./'))
      -        // commit the changed version number
      -        .pipe(git.commit('Bumps package version'))
      -        // read only one file to get the version number
      -        .pipe(filter('package.json'))
      -        // **tag it in the repository**
      -        .pipe(tagVersion({
      -            prefix: ''
      -        }));
      -}
      -
      -gulp.task('patch', [ ], function () { return inc('patch'); })
      -gulp.task('minor', [ ], function () { return inc('minor'); })
      -gulp.task('major', [ ], function () { return inc('major'); })
      diff --git a/tools/eslint/node_modules/escope/node_modules/estraverse/package.json b/tools/eslint/node_modules/escope/node_modules/estraverse/package.json
      deleted file mode 100644
      index 94ac9832e95781..00000000000000
      --- a/tools/eslint/node_modules/escope/node_modules/estraverse/package.json
      +++ /dev/null
      @@ -1,66 +0,0 @@
      -{
      -  "name": "estraverse",
      -  "description": "ECMAScript JS AST traversal functions",
      -  "homepage": "https://github.com/estools/estraverse",
      -  "main": "estraverse.js",
      -  "version": "3.1.0",
      -  "engines": {
      -    "node": ">=0.10.0"
      -  },
      -  "maintainers": [
      -    {
      -      "name": "constellation",
      -      "email": "utatane.tea@gmail.com"
      -    },
      -    {
      -      "name": "michaelficarra",
      -      "email": "npm@michael.ficarra.me"
      -    }
      -  ],
      -  "repository": {
      -    "type": "git",
      -    "url": "git+ssh://git@github.com/estools/estraverse.git"
      -  },
      -  "devDependencies": {
      -    "chai": "^2.1.1",
      -    "coffee-script": "^1.8.0",
      -    "espree": "^1.11.0",
      -    "gulp": "^3.8.10",
      -    "gulp-bump": "^0.2.2",
      -    "gulp-filter": "^2.0.0",
      -    "gulp-git": "^1.0.1",
      -    "gulp-tag-version": "^1.2.1",
      -    "jshint": "^2.5.6",
      -    "mocha": "^2.1.0"
      -  },
      -  "licenses": [
      -    {
      -      "type": "BSD",
      -      "url": "http://github.com/estools/estraverse/raw/master/LICENSE.BSD"
      -    }
      -  ],
      -  "scripts": {
      -    "test": "npm run-script lint && npm run-script unit-test",
      -    "lint": "jshint estraverse.js",
      -    "unit-test": "mocha --compilers coffee:coffee-script/register"
      -  },
      -  "gitHead": "166ebbe0a8d45ceb2391b6f5ef5d1bab6bfb267a",
      -  "bugs": {
      -    "url": "https://github.com/estools/estraverse/issues"
      -  },
      -  "_id": "estraverse@3.1.0",
      -  "_shasum": "15e28a446b8b82bc700ccc8b96c78af4da0d6cba",
      -  "_from": "estraverse@>=3.1.0 <4.0.0",
      -  "_npmVersion": "2.0.0-alpha-5",
      -  "_npmUser": {
      -    "name": "constellation",
      -    "email": "utatane.tea@gmail.com"
      -  },
      -  "dist": {
      -    "shasum": "15e28a446b8b82bc700ccc8b96c78af4da0d6cba",
      -    "tarball": "http://registry.npmjs.org/estraverse/-/estraverse-3.1.0.tgz"
      -  },
      -  "directories": {},
      -  "_resolved": "https://registry.npmjs.org/estraverse/-/estraverse-3.1.0.tgz",
      -  "readme": "ERROR: No README data found!"
      -}
      diff --git a/tools/eslint/node_modules/escope/package.json b/tools/eslint/node_modules/escope/package.json
      index b5f1787ade5b68..4270054c000c5a 100644
      --- a/tools/eslint/node_modules/escope/package.json
      +++ b/tools/eslint/node_modules/escope/package.json
      @@ -1,12 +1,87 @@
       {
      -  "name": "escope",
      +  "_args": [
      +    [
      +      "escope@^3.6.0",
      +      "/Users/silverwind/git/node/tools/package/package"
      +    ]
      +  ],
      +  "_from": "escope@>=3.6.0 <4.0.0",
      +  "_id": "escope@3.6.0",
      +  "_inCache": true,
      +  "_installable": true,
      +  "_location": "/escope",
      +  "_nodeVersion": "0.12.9",
      +  "_npmOperationalInternal": {
      +    "host": "packages-12-west.internal.npmjs.com",
      +    "tmp": "tmp/escope-3.6.0.tgz_1457720018969_0.025237560039386153"
      +  },
      +  "_npmUser": {
      +    "email": "nicholas@nczconsulting.com",
      +    "name": "nzakas"
      +  },
      +  "_npmVersion": "2.14.9",
      +  "_phantomChildren": {},
      +  "_requested": {
      +    "name": "escope",
      +    "raw": "escope@^3.6.0",
      +    "rawSpec": "^3.6.0",
      +    "scope": null,
      +    "spec": ">=3.6.0 <4.0.0",
      +    "type": "range"
      +  },
      +  "_requiredBy": [
      +    "/"
      +  ],
      +  "_resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz",
      +  "_shasum": "e01975e812781a163a6dadfdd80398dc64c889c3",
      +  "_shrinkwrap": null,
      +  "_spec": "escope@^3.6.0",
      +  "_where": "/Users/silverwind/git/node/tools/package/package",
      +  "bugs": {
      +    "url": "https://github.com/estools/escope/issues"
      +  },
      +  "dependencies": {
      +    "es6-map": "^0.1.3",
      +    "es6-weak-map": "^2.0.1",
      +    "esrecurse": "^4.1.0",
      +    "estraverse": "^4.1.1"
      +  },
         "description": "ECMAScript scope analyzer",
      -  "homepage": "http://github.com/estools/escope",
      -  "main": "lib/index.js",
      -  "version": "3.1.0",
      +  "devDependencies": {
      +    "babel": "^6.3.26",
      +    "babel-preset-es2015": "^6.3.13",
      +    "babel-register": "^6.3.13",
      +    "browserify": "^13.0.0",
      +    "chai": "^3.4.1",
      +    "espree": "^3.1.1",
      +    "esprima": "^2.7.1",
      +    "gulp": "^3.9.0",
      +    "gulp-babel": "^6.1.1",
      +    "gulp-bump": "^1.0.0",
      +    "gulp-eslint": "^1.1.1",
      +    "gulp-espower": "^1.0.2",
      +    "gulp-filter": "^3.0.1",
      +    "gulp-git": "^1.6.1",
      +    "gulp-mocha": "^2.2.0",
      +    "gulp-plumber": "^1.0.1",
      +    "gulp-sourcemaps": "^1.6.0",
      +    "gulp-tag-version": "^1.3.0",
      +    "jsdoc": "^3.4.0",
      +    "lazypipe": "^1.0.1",
      +    "vinyl-source-stream": "^1.1.0"
      +  },
      +  "directories": {},
      +  "dist": {
      +    "shasum": "e01975e812781a163a6dadfdd80398dc64c889c3",
      +    "tarball": "http://registry.npmjs.org/escope/-/escope-3.6.0.tgz"
      +  },
         "engines": {
           "node": ">=0.4.0"
         },
      +  "gitHead": "aa35861faa76a09f01203dee3497a939d70b463c",
      +  "homepage": "http://github.com/estools/escope",
      +  "license": "BSD-2-Clause",
      +  "main": "lib/index.js",
         "maintainers": [
           {
             "name": "constellation",
      @@ -15,68 +90,24 @@
           {
             "name": "michaelficarra",
             "email": "npm@michael.ficarra.me"
      +    },
      +    {
      +      "name": "nzakas",
      +      "email": "nicholas@nczconsulting.com"
           }
         ],
      +  "name": "escope",
      +  "optionalDependencies": {},
      +  "readme": "ERROR: No README data found!",
         "repository": {
           "type": "git",
           "url": "git+https://github.com/estools/escope.git"
         },
      -  "dependencies": {
      -    "es6-map": "^0.1.1",
      -    "es6-weak-map": "^0.1.2",
      -    "esrecurse": "^3.1.1",
      -    "estraverse": "^3.1.0"
      -  },
      -  "devDependencies": {
      -    "acorn": "^0.12.0",
      -    "babel": "^4.7.12",
      -    "browserify": "^9.0.3",
      -    "chai": "^2.1.1",
      -    "coffee-script": "^1.9.1",
      -    "espree": "^2.0.2",
      -    "esprima": "^2.1.0",
      -    "gulp": "~3.8.10",
      -    "gulp-babel": "^4.0.0",
      -    "gulp-bump": "^0.3.0",
      -    "gulp-coffee": "^2.2.0",
      -    "gulp-eslint": "^0.6.0",
      -    "gulp-espower": "^0.10.0",
      -    "gulp-filter": "^2.0.0",
      -    "gulp-git": "^1.0.1",
      -    "gulp-mocha": "~2.0.0",
      -    "gulp-plumber": "^1.0.0",
      -    "gulp-sourcemaps": "^1.3.0",
      -    "gulp-tag-version": "^1.2.1",
      -    "jsdoc": "=3.3.0-alpha13",
      -    "lazypipe": "^0.2.2",
      -    "minimist": "^1.1.0",
      -    "vinyl-source-stream": "^1.0.0"
      -  },
      -  "license": "BSD-2-Clause",
         "scripts": {
      -    "test": "gulp travis",
      -    "unit-test": "gulp test",
      +    "jsdoc": "jsdoc src/*.js README.md",
           "lint": "gulp lint",
      -    "jsdoc": "jsdoc src/*.js README.md"
      -  },
      -  "gitHead": "f237eefd4bfadfcf397e451219c3079e9bc3bb81",
      -  "bugs": {
      -    "url": "https://github.com/estools/escope/issues"
      -  },
      -  "_id": "escope@3.1.0",
      -  "_shasum": "92ca48f6286b380e4388e09188a904b0fa1d9b7e",
      -  "_from": "escope@>=3.1.0 <4.0.0",
      -  "_npmVersion": "2.10.1",
      -  "_nodeVersion": "2.1.0",
      -  "_npmUser": {
      -    "name": "constellation",
      -    "email": "utatane.tea@gmail.com"
      -  },
      -  "dist": {
      -    "shasum": "92ca48f6286b380e4388e09188a904b0fa1d9b7e",
      -    "tarball": "http://registry.npmjs.org/escope/-/escope-3.1.0.tgz"
      +    "test": "gulp travis",
      +    "unit-test": "gulp test"
         },
      -  "directories": {},
      -  "_resolved": "https://registry.npmjs.org/escope/-/escope-3.1.0.tgz",
      -  "readme": "ERROR: No README data found!"
      +  "version": "3.6.0"
       }
      diff --git a/tools/eslint/node_modules/escope/powered-test/arguments.js b/tools/eslint/node_modules/escope/powered-test/arguments.js
      new file mode 100644
      index 00000000000000..5b841062a74e70
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/powered-test/arguments.js
      @@ -0,0 +1,34 @@
      +(function() {
      +  var escope, esprima, expect, harmony;
      +
      +  expect = require('chai').expect;
      +
      +  esprima = require('esprima');
      +
      +  harmony = require('../third_party/esprima');
      +
      +  escope = require('..');
      +
      +  describe('arguments', function() {
      +    return it('arguments are correctly materialized', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = esprima.parse("(function () {\n    arguments;\n}());");
      +      scopeManager = escope.analyze(ast);
      +      expect(scopeManager.scopes).to.have.length(2);
      +      globalScope = scopeManager.scopes[0];
      +      expect(globalScope.type).to.be.equal('global');
      +      expect(globalScope.variables).to.have.length(0);
      +      expect(globalScope.references).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      expect(scope.isArgumentsMaterialized()).to.be["true"];
      +      expect(scope.references).to.have.length(1);
      +      return expect(scope.references[0].resolved).to.be.equal(scope.variables[0]);
      +    });
      +  });
      +
      +}).call(this);
      +
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFyZ3VtZW50cy5jb2ZmZWUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBdUJBO0FBQUEsTUFBQSxnQ0FBQTs7QUFBQSxFQUFBLE1BQUEsR0FBUyxPQUFBLENBQVMsTUFBVCxDQUFlLENBQUMsTUFBekIsQ0FBQTs7QUFBQSxFQUNBLE9BQUEsR0FBVSxPQUFBLENBQVMsU0FBVCxDQURWLENBQUE7O0FBQUEsRUFFQSxPQUFBLEdBQVUsT0FBQSxDQUFTLHdCQUFULENBRlYsQ0FBQTs7QUFBQSxFQUdBLE1BQUEsR0FBUyxPQUFBLENBQVMsSUFBVCxDQUhULENBQUE7O0FBQUEsRUFLQSxRQUFBLENBQVUsV0FBVixFQUFzQixTQUFBLEdBQUE7V0FDbEIsRUFBQSxDQUFJLHNDQUFKLEVBQTJDLFNBQUEsR0FBQTtBQUN2QyxVQUFBLHFDQUFBO0FBQUEsTUFBQSxHQUFBLEdBQU0sT0FBTyxDQUFDLEtBQVIsQ0FBaUIsdUNBQWpCLENBQU4sQ0FBQTtBQUFBLE1BTUEsWUFBQSxHQUFlLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixDQU5mLENBQUE7QUFBQSxNQU9BLE1BQUEsQ0FBTyxZQUFZLENBQUMsTUFBcEIsQ0FBMkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXBDLENBQTJDLENBQTNDLENBUEEsQ0FBQTtBQUFBLE1BUUEsV0FBQSxHQUFjLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQVJsQyxDQUFBO0FBQUEsTUFTQSxNQUFBLENBQU8sV0FBVyxDQUFDLElBQW5CLENBQXdCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEvQixDQUFzQyxRQUF0QyxDQVRBLENBQUE7QUFBQSxNQVVBLE1BQUEsQ0FBTyxXQUFXLENBQUMsU0FBbkIsQ0FBNkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXRDLENBQTZDLENBQTdDLENBVkEsQ0FBQTtBQUFBLE1BV0EsTUFBQSxDQUFPLFdBQVcsQ0FBQyxVQUFuQixDQUE4QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBdkMsQ0FBOEMsQ0FBOUMsQ0FYQSxDQUFBO0FBQUEsTUFhQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBYjVCLENBQUE7QUFBQSxNQWNBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsVUFBaEMsQ0FkQSxDQUFBO0FBQUEsTUFlQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBZkEsQ0FBQTtBQUFBLE1BZ0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxXQUE3QyxDQWhCQSxDQUFBO0FBQUEsTUFpQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyx1QkFBTixDQUFBLENBQVAsQ0FBdUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0FqQjdDLENBQUE7QUFBQSxNQWtCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBbEJBLENBQUE7YUFtQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsUUFBM0IsQ0FBb0MsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQTNDLENBQWlELEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFqRSxFQXBCdUM7SUFBQSxDQUEzQyxFQURrQjtFQUFBLENBQXRCLENBTEEsQ0FBQTtBQUFBIiwiZmlsZSI6ImFyZ3VtZW50cy5qcyIsInNvdXJjZVJvb3QiOiIvc291cmNlLyIsInNvdXJjZXNDb250ZW50IjpbIiMgLSotIGNvZGluZzogdXRmLTggLSotXG4jICBDb3B5cmlnaHQgKEMpIDIwMTQgWXVzdWtlIFN1enVraSA8dXRhdGFuZS50ZWFAZ21haWwuY29tPlxuI1xuIyAgUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0XG4jICBtb2RpZmljYXRpb24sIGFyZSBwZXJtaXR0ZWQgcHJvdmlkZWQgdGhhdCB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnMgYXJlIG1ldDpcbiNcbiMgICAgKiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodFxuIyAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lci5cbiMgICAgKiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodFxuIyAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lciBpbiB0aGVcbiMgICAgICBkb2N1bWVudGF0aW9uIGFuZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQgd2l0aCB0aGUgZGlzdHJpYnV0aW9uLlxuI1xuIyAgVEhJUyBTT0ZUV0FSRSBJUyBQUk9WSURFRCBCWSBUSEUgQ09QWVJJR0hUIEhPTERFUlMgQU5EIENPTlRSSUJVVE9SUyBcIkFTIElTXCJcbiMgIEFORCBBTlkgRVhQUkVTUyBPUiBJTVBMSUVEIFdBUlJBTlRJRVMsIElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBUSEVcbiMgIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFXG4jICBBUkUgRElTQ0xBSU1FRC4gSU4gTk8gRVZFTlQgU0hBTEwgPENPUFlSSUdIVCBIT0xERVI+IEJFIExJQUJMRSBGT1IgQU5ZXG4jICBESVJFQ1QsIElORElSRUNULCBJTkNJREVOVEFMLCBTUEVDSUFMLCBFWEVNUExBUlksIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFU1xuIyAgKElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTO1xuIyAgTE9TUyBPRiBVU0UsIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EXG4jICBPTiBBTlkgVEhFT1JZIE9GIExJQUJJTElUWSwgV0hFVEhFUiBJTiBDT05UUkFDVCwgU1RSSUNUIExJQUJJTElUWSwgT1IgVE9SVFxuIyAgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFIE9GXG4jICBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLlxuXG5leHBlY3QgPSByZXF1aXJlKCdjaGFpJykuZXhwZWN0XG5lc3ByaW1hID0gcmVxdWlyZSAnZXNwcmltYSdcbmhhcm1vbnkgPSByZXF1aXJlICcuLi90aGlyZF9wYXJ0eS9lc3ByaW1hJ1xuZXNjb3BlID0gcmVxdWlyZSAnLi4nXG5cbmRlc2NyaWJlICdhcmd1bWVudHMnLCAtPlxuICAgIGl0ICdhcmd1bWVudHMgYXJlIGNvcnJlY3RseSBtYXRlcmlhbGl6ZWQnLCAtPlxuICAgICAgICBhc3QgPSBlc3ByaW1hLnBhcnNlIFwiXCJcIlxuICAgICAgICAoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgYXJndW1lbnRzO1xuICAgICAgICB9KCkpO1xuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3RcbiAgICAgICAgZXhwZWN0KHNjb3BlTWFuYWdlci5zY29wZXMpLnRvLmhhdmUubGVuZ3RoIDJcbiAgICAgICAgZ2xvYmFsU2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzBdXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS50eXBlKS50by5iZS5lcXVhbCAnZ2xvYmFsJ1xuICAgICAgICBleHBlY3QoZ2xvYmFsU2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAwXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzFdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZnVuY3Rpb24nXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5uYW1lKS50by5iZS5lcXVhbCAnYXJndW1lbnRzJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuaXNBcmd1bWVudHNNYXRlcmlhbGl6ZWQoKSkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggMVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1swXS5yZXNvbHZlZCkudG8uYmUuZXF1YWwgc2NvcGUudmFyaWFibGVzWzBdXG5cbiMgdmltOiBzZXQgc3c9NCB0cz00IGV0IHR3PTgwIDpcbiJdfQ==
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/powered-test/catch-scope.js b/tools/eslint/node_modules/escope/powered-test/catch-scope.js
      new file mode 100644
      index 00000000000000..34fa16526d4212
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/powered-test/catch-scope.js
      @@ -0,0 +1,39 @@
      +(function() {
      +  var escope, esprima, expect, harmony;
      +
      +  expect = require('chai').expect;
      +
      +  esprima = require('esprima');
      +
      +  harmony = require('../third_party/esprima');
      +
      +  escope = require('..');
      +
      +  describe('catch', function() {
      +    return it('creates scope', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = esprima.parse("(function () {\n    try {\n    } catch (e) {\n    }\n}());");
      +      scopeManager = escope.analyze(ast);
      +      expect(scopeManager.scopes).to.have.length(3);
      +      globalScope = scopeManager.scopes[0];
      +      expect(globalScope.type).to.be.equal('global');
      +      expect(globalScope.variables).to.have.length(0);
      +      expect(globalScope.references).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      expect(scope.isArgumentsMaterialized()).to.be["false"];
      +      expect(scope.references).to.have.length(0);
      +      scope = scopeManager.scopes[2];
      +      expect(scope.type).to.be.equal('catch');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('e');
      +      expect(scope.isArgumentsMaterialized()).to.be["true"];
      +      return expect(scope.references).to.have.length(0);
      +    });
      +  });
      +
      +}).call(this);
      +
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNhdGNoLXNjb3BlLmNvZmZlZSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF1QkE7QUFBQSxNQUFBLGdDQUFBOztBQUFBLEVBQUEsTUFBQSxHQUFTLE9BQUEsQ0FBUyxNQUFULENBQWUsQ0FBQyxNQUF6QixDQUFBOztBQUFBLEVBQ0EsT0FBQSxHQUFVLE9BQUEsQ0FBUyxTQUFULENBRFYsQ0FBQTs7QUFBQSxFQUVBLE9BQUEsR0FBVSxPQUFBLENBQVMsd0JBQVQsQ0FGVixDQUFBOztBQUFBLEVBR0EsTUFBQSxHQUFTLE9BQUEsQ0FBUyxJQUFULENBSFQsQ0FBQTs7QUFBQSxFQUtBLFFBQUEsQ0FBVSxPQUFWLEVBQWtCLFNBQUEsR0FBQTtXQUNkLEVBQUEsQ0FBSSxlQUFKLEVBQW9CLFNBQUEsR0FBQTtBQUNoQixVQUFBLHFDQUFBO0FBQUEsTUFBQSxHQUFBLEdBQU0sT0FBTyxDQUFDLEtBQVIsQ0FBaUIsNERBQWpCLENBQU4sQ0FBQTtBQUFBLE1BUUEsWUFBQSxHQUFlLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixDQVJmLENBQUE7QUFBQSxNQVNBLE1BQUEsQ0FBTyxZQUFZLENBQUMsTUFBcEIsQ0FBMkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXBDLENBQTJDLENBQTNDLENBVEEsQ0FBQTtBQUFBLE1BVUEsV0FBQSxHQUFjLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQVZsQyxDQUFBO0FBQUEsTUFXQSxNQUFBLENBQU8sV0FBVyxDQUFDLElBQW5CLENBQXdCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEvQixDQUFzQyxRQUF0QyxDQVhBLENBQUE7QUFBQSxNQVlBLE1BQUEsQ0FBTyxXQUFXLENBQUMsU0FBbkIsQ0FBNkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXRDLENBQTZDLENBQTdDLENBWkEsQ0FBQTtBQUFBLE1BYUEsTUFBQSxDQUFPLFdBQVcsQ0FBQyxVQUFuQixDQUE4QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBdkMsQ0FBOEMsQ0FBOUMsQ0FiQSxDQUFBO0FBQUEsTUFlQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBZjVCLENBQUE7QUFBQSxNQWdCQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFVBQWhDLENBaEJBLENBQUE7QUFBQSxNQWlCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBakJBLENBQUE7QUFBQSxNQWtCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsV0FBN0MsQ0FsQkEsQ0FBQTtBQUFBLE1BbUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsdUJBQU4sQ0FBQSxDQUFQLENBQXVDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxPQUFELENBbkI3QyxDQUFBO0FBQUEsTUFvQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFiLENBQXdCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFqQyxDQUF3QyxDQUF4QyxDQXBCQSxDQUFBO0FBQUEsTUFzQkEsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQXRCNUIsQ0FBQTtBQUFBLE1BdUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsT0FBaEMsQ0F2QkEsQ0FBQTtBQUFBLE1Bd0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0F4QkEsQ0FBQTtBQUFBLE1BeUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxHQUE3QyxDQXpCQSxDQUFBO0FBQUEsTUEwQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyx1QkFBTixDQUFBLENBQVAsQ0FBdUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0ExQjdDLENBQUE7YUEyQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFiLENBQXdCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFqQyxDQUF3QyxDQUF4QyxFQTVCZ0I7SUFBQSxDQUFwQixFQURjO0VBQUEsQ0FBbEIsQ0FMQSxDQUFBO0FBQUEiLCJmaWxlIjoiY2F0Y2gtc2NvcGUuanMiLCJzb3VyY2VSb290IjoiL3NvdXJjZS8iLCJzb3VyY2VzQ29udGVudCI6WyIjIC0qLSBjb2Rpbmc6IHV0Zi04IC0qLVxuIyAgQ29weXJpZ2h0IChDKSAyMDE1IFl1c3VrZSBTdXp1a2kgPHV0YXRhbmUudGVhQGdtYWlsLmNvbT5cbiNcbiMgIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dFxuIyAgbW9kaWZpY2F0aW9uLCBhcmUgcGVybWl0dGVkIHByb3ZpZGVkIHRoYXQgdGhlIGZvbGxvd2luZyBjb25kaXRpb25zIGFyZSBtZXQ6XG4jXG4jICAgICogUmVkaXN0cmlidXRpb25zIG9mIHNvdXJjZSBjb2RlIG11c3QgcmV0YWluIHRoZSBhYm92ZSBjb3B5cmlnaHRcbiMgICAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIuXG4jICAgICogUmVkaXN0cmlidXRpb25zIGluIGJpbmFyeSBmb3JtIG11c3QgcmVwcm9kdWNlIHRoZSBhYm92ZSBjb3B5cmlnaHRcbiMgICAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIgaW4gdGhlXG4jICAgICAgZG9jdW1lbnRhdGlvbiBhbmQvb3Igb3RoZXIgbWF0ZXJpYWxzIHByb3ZpZGVkIHdpdGggdGhlIGRpc3RyaWJ1dGlvbi5cbiNcbiMgIFRISVMgU09GVFdBUkUgSVMgUFJPVklERUQgQlkgVEhFIENPUFlSSUdIVCBIT0xERVJTIEFORCBDT05UUklCVVRPUlMgXCJBUyBJU1wiXG4jICBBTkQgQU5ZIEVYUFJFU1MgT1IgSU1QTElFRCBXQVJSQU5USUVTLCBJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgVEhFXG4jICBJTVBMSUVEIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZIEFORCBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRVxuIyAgQVJFIERJU0NMQUlNRUQuIElOIE5PIEVWRU5UIFNIQUxMIDxDT1BZUklHSFQgSE9MREVSPiBCRSBMSUFCTEUgRk9SIEFOWVxuIyAgRElSRUNULCBJTkRJUkVDVCwgSU5DSURFTlRBTCwgU1BFQ0lBTCwgRVhFTVBMQVJZLCBPUiBDT05TRVFVRU5USUFMIERBTUFHRVNcbiMgIChJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgUFJPQ1VSRU1FTlQgT0YgU1VCU1RJVFVURSBHT09EUyBPUiBTRVJWSUNFUztcbiMgIExPU1MgT0YgVVNFLCBEQVRBLCBPUiBQUk9GSVRTOyBPUiBCVVNJTkVTUyBJTlRFUlJVUFRJT04pIEhPV0VWRVIgQ0FVU0VEIEFORFxuIyAgT04gQU5ZIFRIRU9SWSBPRiBMSUFCSUxJVFksIFdIRVRIRVIgSU4gQ09OVFJBQ1QsIFNUUklDVCBMSUFCSUxJVFksIE9SIFRPUlRcbiMgIChJTkNMVURJTkcgTkVHTElHRU5DRSBPUiBPVEhFUldJU0UpIEFSSVNJTkcgSU4gQU5ZIFdBWSBPVVQgT0YgVEhFIFVTRSBPRlxuIyAgVEhJUyBTT0ZUV0FSRSwgRVZFTiBJRiBBRFZJU0VEIE9GIFRIRSBQT1NTSUJJTElUWSBPRiBTVUNIIERBTUFHRS5cblxuZXhwZWN0ID0gcmVxdWlyZSgnY2hhaScpLmV4cGVjdFxuZXNwcmltYSA9IHJlcXVpcmUgJ2VzcHJpbWEnXG5oYXJtb255ID0gcmVxdWlyZSAnLi4vdGhpcmRfcGFydHkvZXNwcmltYSdcbmVzY29wZSA9IHJlcXVpcmUgJy4uJ1xuXG5kZXNjcmliZSAnY2F0Y2gnLCAtPlxuICAgIGl0ICdjcmVhdGVzIHNjb3BlJywgLT5cbiAgICAgICAgYXN0ID0gZXNwcmltYS5wYXJzZSBcIlwiXCJcbiAgICAgICAgKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0oKSk7XG4gICAgICAgIFwiXCJcIlxuXG4gICAgICAgIHNjb3BlTWFuYWdlciA9IGVzY29wZS5hbmFseXplIGFzdFxuICAgICAgICBleHBlY3Qoc2NvcGVNYW5hZ2VyLnNjb3BlcykudG8uaGF2ZS5sZW5ndGggM1xuICAgICAgICBnbG9iYWxTY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMF1cbiAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdmdW5jdGlvbidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICdhcmd1bWVudHMnXG4gICAgICAgIGV4cGVjdChzY29wZS5pc0FyZ3VtZW50c01hdGVyaWFsaXplZCgpKS50by5iZS5mYWxzZVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggMFxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1syXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2NhdGNoJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAxXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwgJ2UnXG4gICAgICAgIGV4cGVjdChzY29wZS5pc0FyZ3VtZW50c01hdGVyaWFsaXplZCgpKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAwXG5cbiMgdmltOiBzZXQgc3c9NCB0cz00IGV0IHR3PTgwIDpcbiJdfQ==
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/powered-test/es6-arrow-function-expression.js b/tools/eslint/node_modules/escope/powered-test/es6-arrow-function-expression.js
      new file mode 100644
      index 00000000000000..cf616c19f3b082
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/powered-test/es6-arrow-function-expression.js
      @@ -0,0 +1,57 @@
      +(function() {
      +  var escope, expect, harmony;
      +
      +  expect = require('chai').expect;
      +
      +  harmony = require('../third_party/esprima');
      +
      +  escope = require('..');
      +
      +  describe('ES6 arrow function expression', function() {
      +    it('materialize scope for arrow function expression', function() {
      +      var ast, scope, scopeManager;
      +      ast = harmony.parse("var arrow = () => {\n    let i = 0;\n    var j = 20;\n    console.log(i);\n}");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      scope = scopeManager.scopes[0];
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.block.type).to.be.equal('Program');
      +      expect(scope.isStrict).to.be["false"];
      +      expect(scope.variables).to.have.length(1);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.block.type).to.be.equal('ArrowFunctionExpression');
      +      expect(scope.isStrict).to.be["true"];
      +      expect(scope.variables).to.have.length(2);
      +      expect(scope.variables[0].name).to.be.equal('i');
      +      return expect(scope.variables[1].name).to.be.equal('j');
      +    });
      +    return it('generate bindings for parameters', function() {
      +      var ast, scope, scopeManager;
      +      ast = harmony.parse("var arrow = (a, b, c, d) => {\n}");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      scope = scopeManager.scopes[0];
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.block.type).to.be.equal('Program');
      +      expect(scope.isStrict).to.be["false"];
      +      expect(scope.variables).to.have.length(1);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.block.type).to.be.equal('ArrowFunctionExpression');
      +      expect(scope.isStrict).to.be["true"];
      +      expect(scope.variables).to.have.length(4);
      +      expect(scope.variables[0].name).to.be.equal('a');
      +      expect(scope.variables[1].name).to.be.equal('b');
      +      expect(scope.variables[2].name).to.be.equal('c');
      +      return expect(scope.variables[3].name).to.be.equal('d');
      +    });
      +  });
      +
      +}).call(this);
      +
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVzNi1hcnJvdy1mdW5jdGlvbi1leHByZXNzaW9uLmNvZmZlZSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF1QkE7QUFBQSxNQUFBLHVCQUFBOztBQUFBLEVBQUEsTUFBQSxHQUFTLE9BQUEsQ0FBUyxNQUFULENBQWUsQ0FBQyxNQUF6QixDQUFBOztBQUFBLEVBQ0EsT0FBQSxHQUFVLE9BQUEsQ0FBUyx3QkFBVCxDQURWLENBQUE7O0FBQUEsRUFFQSxNQUFBLEdBQVMsT0FBQSxDQUFTLElBQVQsQ0FGVCxDQUFBOztBQUFBLEVBSUEsUUFBQSxDQUFVLCtCQUFWLEVBQTBDLFNBQUEsR0FBQTtBQUN0QyxJQUFBLEVBQUEsQ0FBSSxpREFBSixFQUFzRCxTQUFBLEdBQUE7QUFDbEQsVUFBQSx3QkFBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLDhFQUFqQixDQUFOLENBQUE7QUFBQSxNQVFBLFlBQUEsR0FBZSxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsRUFBb0I7QUFBQSxRQUFBLFdBQUEsRUFBYSxDQUFiO09BQXBCLENBUmYsQ0FBQTtBQUFBLE1BU0EsTUFBQSxDQUFPLFlBQVksQ0FBQyxNQUFwQixDQUEyQixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBcEMsQ0FBMkMsQ0FBM0MsQ0FUQSxDQUFBO0FBQUEsTUFXQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBWDVCLENBQUE7QUFBQSxNQVlBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsUUFBaEMsQ0FaQSxDQUFBO0FBQUEsTUFhQSxNQUFBLENBQU8sS0FBSyxDQUFDLEtBQUssQ0FBQyxJQUFuQixDQUF3QixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBL0IsQ0FBc0MsU0FBdEMsQ0FiQSxDQUFBO0FBQUEsTUFjQSxNQUFBLENBQU8sS0FBSyxDQUFDLFFBQWIsQ0FBc0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE9BQUQsQ0FkNUIsQ0FBQTtBQUFBLE1BZUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQWZBLENBQUE7QUFBQSxNQWlCQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBakI1QixDQUFBO0FBQUEsTUFrQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxVQUFoQyxDQWxCQSxDQUFBO0FBQUEsTUFtQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxLQUFLLENBQUMsSUFBbkIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQS9CLENBQXNDLHlCQUF0QyxDQW5CQSxDQUFBO0FBQUEsTUFvQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxRQUFiLENBQXNCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBcEI1QixDQUFBO0FBQUEsTUFxQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQXJCQSxDQUFBO0FBQUEsTUF1QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLEdBQTdDLENBdkJBLENBQUE7YUF3QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLEdBQTdDLEVBekJrRDtJQUFBLENBQXRELENBQUEsQ0FBQTtXQTJCQSxFQUFBLENBQUksa0NBQUosRUFBdUMsU0FBQSxHQUFBO0FBQ25DLFVBQUEsd0JBQUE7QUFBQSxNQUFBLEdBQUEsR0FBTSxPQUFPLENBQUMsS0FBUixDQUFpQixrQ0FBakIsQ0FBTixDQUFBO0FBQUEsTUFLQSxZQUFBLEdBQWUsTUFBTSxDQUFDLE9BQVAsQ0FBZSxHQUFmLEVBQW9CO0FBQUEsUUFBQSxXQUFBLEVBQWEsQ0FBYjtPQUFwQixDQUxmLENBQUE7QUFBQSxNQU1BLE1BQUEsQ0FBTyxZQUFZLENBQUMsTUFBcEIsQ0FBMkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXBDLENBQTJDLENBQTNDLENBTkEsQ0FBQTtBQUFBLE1BUUEsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQVI1QixDQUFBO0FBQUEsTUFTQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFFBQWhDLENBVEEsQ0FBQTtBQUFBLE1BVUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxLQUFLLENBQUMsSUFBbkIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQS9CLENBQXNDLFNBQXRDLENBVkEsQ0FBQTtBQUFBLE1BV0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxRQUFiLENBQXNCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxPQUFELENBWDVCLENBQUE7QUFBQSxNQVlBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0FaQSxDQUFBO0FBQUEsTUFjQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBZDVCLENBQUE7QUFBQSxNQWVBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsVUFBaEMsQ0FmQSxDQUFBO0FBQUEsTUFnQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxLQUFLLENBQUMsSUFBbkIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQS9CLENBQXNDLHlCQUF0QyxDQWhCQSxDQUFBO0FBQUEsTUFpQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxRQUFiLENBQXNCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBakI1QixDQUFBO0FBQUEsTUFrQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQWxCQSxDQUFBO0FBQUEsTUFvQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLEdBQTdDLENBcEJBLENBQUE7QUFBQSxNQXFCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsR0FBN0MsQ0FyQkEsQ0FBQTtBQUFBLE1Bc0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxHQUE3QyxDQXRCQSxDQUFBO2FBdUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxHQUE3QyxFQXhCbUM7SUFBQSxDQUF2QyxFQTVCc0M7RUFBQSxDQUExQyxDQUpBLENBQUE7QUFBQSIsImZpbGUiOiJlczYtYXJyb3ctZnVuY3Rpb24tZXhwcmVzc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIvc291cmNlLyIsInNvdXJjZXNDb250ZW50IjpbIiMgLSotIGNvZGluZzogdXRmLTggLSotXG4jICBDb3B5cmlnaHQgKEMpIDIwMTQgWXVzdWtlIFN1enVraSA8dXRhdGFuZS50ZWFAZ21haWwuY29tPlxuI1xuIyAgUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0XG4jICBtb2RpZmljYXRpb24sIGFyZSBwZXJtaXR0ZWQgcHJvdmlkZWQgdGhhdCB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnMgYXJlIG1ldDpcbiNcbiMgICAgKiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodFxuIyAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lci5cbiMgICAgKiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodFxuIyAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lciBpbiB0aGVcbiMgICAgICBkb2N1bWVudGF0aW9uIGFuZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQgd2l0aCB0aGUgZGlzdHJpYnV0aW9uLlxuI1xuIyAgVEhJUyBTT0ZUV0FSRSBJUyBQUk9WSURFRCBCWSBUSEUgQ09QWVJJR0hUIEhPTERFUlMgQU5EIENPTlRSSUJVVE9SUyBcIkFTIElTXCJcbiMgIEFORCBBTlkgRVhQUkVTUyBPUiBJTVBMSUVEIFdBUlJBTlRJRVMsIElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBUSEVcbiMgIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFXG4jICBBUkUgRElTQ0xBSU1FRC4gSU4gTk8gRVZFTlQgU0hBTEwgPENPUFlSSUdIVCBIT0xERVI+IEJFIExJQUJMRSBGT1IgQU5ZXG4jICBESVJFQ1QsIElORElSRUNULCBJTkNJREVOVEFMLCBTUEVDSUFMLCBFWEVNUExBUlksIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFU1xuIyAgKElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTO1xuIyAgTE9TUyBPRiBVU0UsIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EXG4jICBPTiBBTlkgVEhFT1JZIE9GIExJQUJJTElUWSwgV0hFVEhFUiBJTiBDT05UUkFDVCwgU1RSSUNUIExJQUJJTElUWSwgT1IgVE9SVFxuIyAgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFIE9GXG4jICBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLlxuXG5leHBlY3QgPSByZXF1aXJlKCdjaGFpJykuZXhwZWN0XG5oYXJtb255ID0gcmVxdWlyZSAnLi4vdGhpcmRfcGFydHkvZXNwcmltYSdcbmVzY29wZSA9IHJlcXVpcmUgJy4uJ1xuXG5kZXNjcmliZSAnRVM2IGFycm93IGZ1bmN0aW9uIGV4cHJlc3Npb24nLCAtPlxuICAgIGl0ICdtYXRlcmlhbGl6ZSBzY29wZSBmb3IgYXJyb3cgZnVuY3Rpb24gZXhwcmVzc2lvbicsIC0+XG4gICAgICAgIGFzdCA9IGhhcm1vbnkucGFyc2UgXCJcIlwiXG4gICAgICAgIHZhciBhcnJvdyA9ICgpID0+IHtcbiAgICAgICAgICAgIGxldCBpID0gMDtcbiAgICAgICAgICAgIHZhciBqID0gMjA7XG4gICAgICAgICAgICBjb25zb2xlLmxvZyhpKTtcbiAgICAgICAgfVxuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3QsIGVjbWFWZXJzaW9uOiA2XG4gICAgICAgIGV4cGVjdChzY29wZU1hbmFnZXIuc2NvcGVzKS50by5oYXZlLmxlbmd0aCAyXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzBdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZ2xvYmFsJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuYmxvY2sudHlwZSkudG8uYmUuZXF1YWwgJ1Byb2dyYW0nXG4gICAgICAgIGV4cGVjdChzY29wZS5pc1N0cmljdCkudG8uYmUuZmFsc2VcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMVxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1sxXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2Z1bmN0aW9uJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuYmxvY2sudHlwZSkudG8uYmUuZXF1YWwgJ0Fycm93RnVuY3Rpb25FeHByZXNzaW9uJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuaXNTdHJpY3QpLnRvLmJlLnRydWVcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMlxuICAgICAgICAjIFRoZXJlJ3Mgbm8gXCJhcmd1bWVudHNcIlxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICdpJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzFdLm5hbWUpLnRvLmJlLmVxdWFsICdqJ1xuXG4gICAgaXQgJ2dlbmVyYXRlIGJpbmRpbmdzIGZvciBwYXJhbWV0ZXJzJywgLT5cbiAgICAgICAgYXN0ID0gaGFybW9ueS5wYXJzZSBcIlwiXCJcbiAgICAgICAgdmFyIGFycm93ID0gKGEsIGIsIGMsIGQpID0+IHtcbiAgICAgICAgfVxuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3QsIGVjbWFWZXJzaW9uOiA2XG4gICAgICAgIGV4cGVjdChzY29wZU1hbmFnZXIuc2NvcGVzKS50by5oYXZlLmxlbmd0aCAyXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzBdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZ2xvYmFsJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuYmxvY2sudHlwZSkudG8uYmUuZXF1YWwgJ1Byb2dyYW0nXG4gICAgICAgIGV4cGVjdChzY29wZS5pc1N0cmljdCkudG8uYmUuZmFsc2VcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMVxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1sxXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2Z1bmN0aW9uJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuYmxvY2sudHlwZSkudG8uYmUuZXF1YWwgJ0Fycm93RnVuY3Rpb25FeHByZXNzaW9uJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuaXNTdHJpY3QpLnRvLmJlLnRydWVcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggNFxuICAgICAgICAjIFRoZXJlJ3Mgbm8gXCJhcmd1bWVudHNcIlxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICdhJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzFdLm5hbWUpLnRvLmJlLmVxdWFsICdiJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzJdLm5hbWUpLnRvLmJlLmVxdWFsICdjJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzNdLm5hbWUpLnRvLmJlLmVxdWFsICdkJ1xuXG4jIHZpbTogc2V0IHN3PTQgdHM9NCBldCB0dz04MCA6XG4iXX0=
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/powered-test/es6-block-scope.js b/tools/eslint/node_modules/escope/powered-test/es6-block-scope.js
      new file mode 100644
      index 00000000000000..89c68775846f61
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/powered-test/es6-block-scope.js
      @@ -0,0 +1,136 @@
      +(function() {
      +  var escope, expect, harmony;
      +
      +  expect = require('chai').expect;
      +
      +  harmony = require('../third_party/esprima');
      +
      +  escope = require('..');
      +
      +  describe('ES6 block scope', function() {
      +    it('let is materialized in ES6 block scope#1', function() {
      +      var ast, scope, scopeManager;
      +      ast = harmony.parse("{\n    let i = 20;\n    i;\n}");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      scope = scopeManager.scopes[0];
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.variables).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('block');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('i');
      +      expect(scope.references).to.have.length(2);
      +      expect(scope.references[0].identifier.name).to.be.equal('i');
      +      return expect(scope.references[1].identifier.name).to.be.equal('i');
      +    });
      +    it('let is materialized in ES6 block scope#2', function() {
      +      var ast, scope, scopeManager;
      +      ast = harmony.parse("{\n    let i = 20;\n    var i = 20;\n    i;\n}");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      scope = scopeManager.scopes[0];
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('i');
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('block');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('i');
      +      expect(scope.references).to.have.length(3);
      +      expect(scope.references[0].identifier.name).to.be.equal('i');
      +      expect(scope.references[1].identifier.name).to.be.equal('i');
      +      return expect(scope.references[2].identifier.name).to.be.equal('i');
      +    });
      +    it('function delaration is materialized in ES6 block scope', function() {
      +      var ast, scope, scopeManager;
      +      ast = harmony.parse("{\n    function test() {\n    }\n    test();\n}");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(3);
      +      scope = scopeManager.scopes[0];
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.variables).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('block');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('test');
      +      expect(scope.references).to.have.length(1);
      +      expect(scope.references[0].identifier.name).to.be.equal('test');
      +      scope = scopeManager.scopes[2];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      return expect(scope.references).to.have.length(0);
      +    });
      +    it('let is not hoistable#1', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = harmony.parse("var i = 42; (1)\n{\n    i;  // (2) ReferenceError at runtime.\n    let i = 20;  // (2)\n    i;  // (2)\n}");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      globalScope = scopeManager.scopes[0];
      +      expect(globalScope.type).to.be.equal('global');
      +      expect(globalScope.variables).to.have.length(1);
      +      expect(globalScope.variables[0].name).to.be.equal('i');
      +      expect(globalScope.references).to.have.length(1);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('block');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('i');
      +      expect(scope.references).to.have.length(3);
      +      expect(scope.references[0].resolved).to.be.equal(scope.variables[0]);
      +      expect(scope.references[1].resolved).to.be.equal(scope.variables[0]);
      +      return expect(scope.references[2].resolved).to.be.equal(scope.variables[0]);
      +    });
      +    return it('let is not hoistable#2', function() {
      +      var ast, globalScope, scope, scopeManager, v1, v2, v3;
      +      ast = harmony.parse("(function () {\n    var i = 42; // (1)\n    i;  // (1)\n    {\n        i;  // (3)\n        {\n            i;  // (2)\n            let i = 20;  // (2)\n            i;  // (2)\n        }\n        let i = 30;  // (3)\n        i;  // (3)\n    }\n    i;  // (1)\n}());");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(4);
      +      globalScope = scopeManager.scopes[0];
      +      expect(globalScope.type).to.be.equal('global');
      +      expect(globalScope.variables).to.have.length(0);
      +      expect(globalScope.references).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(2);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      expect(scope.variables[1].name).to.be.equal('i');
      +      v1 = scope.variables[1];
      +      expect(scope.references).to.have.length(3);
      +      expect(scope.references[0].resolved).to.be.equal(v1);
      +      expect(scope.references[1].resolved).to.be.equal(v1);
      +      expect(scope.references[2].resolved).to.be.equal(v1);
      +      scope = scopeManager.scopes[2];
      +      expect(scope.type).to.be.equal('block');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('i');
      +      v3 = scope.variables[0];
      +      expect(scope.references).to.have.length(3);
      +      expect(scope.references[0].resolved).to.be.equal(v3);
      +      expect(scope.references[1].resolved).to.be.equal(v3);
      +      expect(scope.references[2].resolved).to.be.equal(v3);
      +      scope = scopeManager.scopes[3];
      +      expect(scope.type).to.be.equal('block');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('i');
      +      v2 = scope.variables[0];
      +      expect(scope.references).to.have.length(3);
      +      expect(scope.references[0].resolved).to.be.equal(v2);
      +      expect(scope.references[1].resolved).to.be.equal(v2);
      +      return expect(scope.references[2].resolved).to.be.equal(v2);
      +    });
      +  });
      +
      +}).call(this);
      +
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVzNi1ibG9jay1zY29wZS5jb2ZmZWUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBdUJBO0FBQUEsTUFBQSx1QkFBQTs7QUFBQSxFQUFBLE1BQUEsR0FBUyxPQUFBLENBQVMsTUFBVCxDQUFlLENBQUMsTUFBekIsQ0FBQTs7QUFBQSxFQUNBLE9BQUEsR0FBVSxPQUFBLENBQVMsd0JBQVQsQ0FEVixDQUFBOztBQUFBLEVBRUEsTUFBQSxHQUFTLE9BQUEsQ0FBUyxJQUFULENBRlQsQ0FBQTs7QUFBQSxFQUlBLFFBQUEsQ0FBVSxpQkFBVixFQUE0QixTQUFBLEdBQUE7QUFDeEIsSUFBQSxFQUFBLENBQUksMENBQUosRUFBK0MsU0FBQSxHQUFBO0FBQzNDLFVBQUEsd0JBQUE7QUFBQSxNQUFBLEdBQUEsR0FBTSxPQUFPLENBQUMsS0FBUixDQUFpQiwrQkFBakIsQ0FBTixDQUFBO0FBQUEsTUFPQSxZQUFBLEdBQWUsTUFBTSxDQUFDLE9BQVAsQ0FBZSxHQUFmLEVBQW9CO0FBQUEsUUFBQSxXQUFBLEVBQWEsQ0FBYjtPQUFwQixDQVBmLENBQUE7QUFBQSxNQVFBLE1BQUEsQ0FBTyxZQUFZLENBQUMsTUFBcEIsQ0FBMkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXBDLENBQTJDLENBQTNDLENBUkEsQ0FBQTtBQUFBLE1BVUEsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQVY1QixDQUFBO0FBQUEsTUFXQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFFBQWhDLENBWEEsQ0FBQTtBQUFBLE1BWUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQVpBLENBQUE7QUFBQSxNQWNBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FkNUIsQ0FBQTtBQUFBLE1BZUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxPQUFoQyxDQWZBLENBQUE7QUFBQSxNQWdCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBaEJBLENBQUE7QUFBQSxNQWlCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsR0FBN0MsQ0FqQkEsQ0FBQTtBQUFBLE1Ba0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsQ0FsQkEsQ0FBQTtBQUFBLE1BbUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsR0FBekQsQ0FuQkEsQ0FBQTthQW9CQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELEdBQXpELEVBckIyQztJQUFBLENBQS9DLENBQUEsQ0FBQTtBQUFBLElBdUJBLEVBQUEsQ0FBSSwwQ0FBSixFQUErQyxTQUFBLEdBQUE7QUFDM0MsVUFBQSx3QkFBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLGdEQUFqQixDQUFOLENBQUE7QUFBQSxNQVFBLFlBQUEsR0FBZSxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsRUFBb0I7QUFBQSxRQUFBLFdBQUEsRUFBYSxDQUFiO09BQXBCLENBUmYsQ0FBQTtBQUFBLE1BU0EsTUFBQSxDQUFPLFlBQVksQ0FBQyxNQUFwQixDQUEyQixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBcEMsQ0FBMkMsQ0FBM0MsQ0FUQSxDQUFBO0FBQUEsTUFXQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBWDVCLENBQUE7QUFBQSxNQVlBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsUUFBaEMsQ0FaQSxDQUFBO0FBQUEsTUFhQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBYkEsQ0FBQTtBQUFBLE1BY0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLEdBQTdDLENBZEEsQ0FBQTtBQUFBLE1BZ0JBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FoQjVCLENBQUE7QUFBQSxNQWlCQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLE9BQWhDLENBakJBLENBQUE7QUFBQSxNQWtCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBbEJBLENBQUE7QUFBQSxNQW1CQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsR0FBN0MsQ0FuQkEsQ0FBQTtBQUFBLE1Bb0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsQ0FwQkEsQ0FBQTtBQUFBLE1BcUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsR0FBekQsQ0FyQkEsQ0FBQTtBQUFBLE1Bc0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsR0FBekQsQ0F0QkEsQ0FBQTthQXVCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELEdBQXpELEVBeEIyQztJQUFBLENBQS9DLENBdkJBLENBQUE7QUFBQSxJQWlEQSxFQUFBLENBQUksd0RBQUosRUFBNkQsU0FBQSxHQUFBO0FBQ3pELFVBQUEsd0JBQUE7QUFBQSxNQUFBLEdBQUEsR0FBTSxPQUFPLENBQUMsS0FBUixDQUFpQixpREFBakIsQ0FBTixDQUFBO0FBQUEsTUFRQSxZQUFBLEdBQWUsTUFBTSxDQUFDLE9BQVAsQ0FBZSxHQUFmLEVBQW9CO0FBQUEsUUFBQSxXQUFBLEVBQWEsQ0FBYjtPQUFwQixDQVJmLENBQUE7QUFBQSxNQVNBLE1BQUEsQ0FBTyxZQUFZLENBQUMsTUFBcEIsQ0FBMkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXBDLENBQTJDLENBQTNDLENBVEEsQ0FBQTtBQUFBLE1BV0EsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQVg1QixDQUFBO0FBQUEsTUFZQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFFBQWhDLENBWkEsQ0FBQTtBQUFBLE1BYUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQWJBLENBQUE7QUFBQSxNQWVBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FmNUIsQ0FBQTtBQUFBLE1BZ0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsT0FBaEMsQ0FoQkEsQ0FBQTtBQUFBLE1BaUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0FqQkEsQ0FBQTtBQUFBLE1Ba0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxNQUE3QyxDQWxCQSxDQUFBO0FBQUEsTUFtQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFiLENBQXdCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFqQyxDQUF3QyxDQUF4QyxDQW5CQSxDQUFBO0FBQUEsTUFvQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxNQUF6RCxDQXBCQSxDQUFBO0FBQUEsTUFzQkEsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQXRCNUIsQ0FBQTtBQUFBLE1BdUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsVUFBaEMsQ0F2QkEsQ0FBQTtBQUFBLE1Bd0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0F4QkEsQ0FBQTtBQUFBLE1BeUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxXQUE3QyxDQXpCQSxDQUFBO2FBMEJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsRUEzQnlEO0lBQUEsQ0FBN0QsQ0FqREEsQ0FBQTtBQUFBLElBOEVBLEVBQUEsQ0FBSSx3QkFBSixFQUE2QixTQUFBLEdBQUE7QUFDekIsVUFBQSxxQ0FBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLDJHQUFqQixDQUFOLENBQUE7QUFBQSxNQVNBLFlBQUEsR0FBZSxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsRUFBb0I7QUFBQSxRQUFBLFdBQUEsRUFBYSxDQUFiO09BQXBCLENBVGYsQ0FBQTtBQUFBLE1BVUEsTUFBQSxDQUFPLFlBQVksQ0FBQyxNQUFwQixDQUEyQixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBcEMsQ0FBMkMsQ0FBM0MsQ0FWQSxDQUFBO0FBQUEsTUFZQSxXQUFBLEdBQWMsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBWmxDLENBQUE7QUFBQSxNQWFBLE1BQUEsQ0FBTyxXQUFXLENBQUMsSUFBbkIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQS9CLENBQXNDLFFBQXRDLENBYkEsQ0FBQTtBQUFBLE1BY0EsTUFBQSxDQUFPLFdBQVcsQ0FBQyxTQUFuQixDQUE2QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBdEMsQ0FBNkMsQ0FBN0MsQ0FkQSxDQUFBO0FBQUEsTUFlQSxNQUFBLENBQU8sV0FBVyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUFoQyxDQUFxQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBNUMsQ0FBbUQsR0FBbkQsQ0FmQSxDQUFBO0FBQUEsTUFnQkEsTUFBQSxDQUFPLFdBQVcsQ0FBQyxVQUFuQixDQUE4QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBdkMsQ0FBOEMsQ0FBOUMsQ0FoQkEsQ0FBQTtBQUFBLE1Ba0JBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FsQjVCLENBQUE7QUFBQSxNQW1CQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLE9BQWhDLENBbkJBLENBQUE7QUFBQSxNQW9CQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBcEJBLENBQUE7QUFBQSxNQXFCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsR0FBN0MsQ0FyQkEsQ0FBQTtBQUFBLE1Bc0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsQ0F0QkEsQ0FBQTtBQUFBLE1BdUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFFBQTNCLENBQW9DLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEzQyxDQUFpRCxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBakUsQ0F2QkEsQ0FBQTtBQUFBLE1Bd0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFFBQTNCLENBQW9DLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEzQyxDQUFpRCxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBakUsQ0F4QkEsQ0FBQTthQXlCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBM0MsQ0FBaUQsS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQWpFLEVBMUJ5QjtJQUFBLENBQTdCLENBOUVBLENBQUE7V0EwR0EsRUFBQSxDQUFJLHdCQUFKLEVBQTZCLFNBQUEsR0FBQTtBQUN6QixVQUFBLGlEQUFBO0FBQUEsTUFBQSxHQUFBLEdBQU0sT0FBTyxDQUFDLEtBQVIsQ0FBaUIseVFBQWpCLENBQU4sQ0FBQTtBQUFBLE1Ba0JBLFlBQUEsR0FBZSxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsRUFBb0I7QUFBQSxRQUFBLFdBQUEsRUFBYSxDQUFiO09BQXBCLENBbEJmLENBQUE7QUFBQSxNQW1CQSxNQUFBLENBQU8sWUFBWSxDQUFDLE1BQXBCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQW5CQSxDQUFBO0FBQUEsTUFxQkEsV0FBQSxHQUFjLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQXJCbEMsQ0FBQTtBQUFBLE1Bc0JBLE1BQUEsQ0FBTyxXQUFXLENBQUMsSUFBbkIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQS9CLENBQXNDLFFBQXRDLENBdEJBLENBQUE7QUFBQSxNQXVCQSxNQUFBLENBQU8sV0FBVyxDQUFDLFNBQW5CLENBQTZCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUF0QyxDQUE2QyxDQUE3QyxDQXZCQSxDQUFBO0FBQUEsTUF3QkEsTUFBQSxDQUFPLFdBQVcsQ0FBQyxVQUFuQixDQUE4QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBdkMsQ0FBOEMsQ0FBOUMsQ0F4QkEsQ0FBQTtBQUFBLE1BMEJBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0ExQjVCLENBQUE7QUFBQSxNQTJCQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFVBQWhDLENBM0JBLENBQUE7QUFBQSxNQTRCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBNUJBLENBQUE7QUFBQSxNQTZCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsV0FBN0MsQ0E3QkEsQ0FBQTtBQUFBLE1BOEJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxHQUE3QyxDQTlCQSxDQUFBO0FBQUEsTUErQkEsRUFBQSxHQUFLLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQS9CckIsQ0FBQTtBQUFBLE1BZ0NBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsQ0FoQ0EsQ0FBQTtBQUFBLE1BaUNBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFFBQTNCLENBQW9DLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEzQyxDQUFpRCxFQUFqRCxDQWpDQSxDQUFBO0FBQUEsTUFrQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsUUFBM0IsQ0FBb0MsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQTNDLENBQWlELEVBQWpELENBbENBLENBQUE7QUFBQSxNQW1DQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBM0MsQ0FBaUQsRUFBakQsQ0FuQ0EsQ0FBQTtBQUFBLE1BcUNBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FyQzVCLENBQUE7QUFBQSxNQXNDQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLE9BQWhDLENBdENBLENBQUE7QUFBQSxNQXVDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBdkNBLENBQUE7QUFBQSxNQXdDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsR0FBN0MsQ0F4Q0EsQ0FBQTtBQUFBLE1BeUNBLEVBQUEsR0FBSyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0F6Q3JCLENBQUE7QUFBQSxNQTBDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBMUNBLENBQUE7QUFBQSxNQTJDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBM0MsQ0FBaUQsRUFBakQsQ0EzQ0EsQ0FBQTtBQUFBLE1BNENBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFFBQTNCLENBQW9DLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEzQyxDQUFpRCxFQUFqRCxDQTVDQSxDQUFBO0FBQUEsTUE2Q0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsUUFBM0IsQ0FBb0MsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQTNDLENBQWlELEVBQWpELENBN0NBLENBQUE7QUFBQSxNQStDQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBL0M1QixDQUFBO0FBQUEsTUFnREEsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxPQUFoQyxDQWhEQSxDQUFBO0FBQUEsTUFpREEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQWpEQSxDQUFBO0FBQUEsTUFrREEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLEdBQTdDLENBbERBLENBQUE7QUFBQSxNQW1EQSxFQUFBLEdBQUssS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBbkRyQixDQUFBO0FBQUEsTUFvREEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFiLENBQXdCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFqQyxDQUF3QyxDQUF4QyxDQXBEQSxDQUFBO0FBQUEsTUFxREEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsUUFBM0IsQ0FBb0MsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQTNDLENBQWlELEVBQWpELENBckRBLENBQUE7QUFBQSxNQXNEQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBM0MsQ0FBaUQsRUFBakQsQ0F0REEsQ0FBQTthQXVEQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBM0MsQ0FBaUQsRUFBakQsRUF4RHlCO0lBQUEsQ0FBN0IsRUEzR3dCO0VBQUEsQ0FBNUIsQ0FKQSxDQUFBO0FBQUEiLCJmaWxlIjoiZXM2LWJsb2NrLXNjb3BlLmpzIiwic291cmNlUm9vdCI6Ii9zb3VyY2UvIiwic291cmNlc0NvbnRlbnQiOlsiIyAtKi0gY29kaW5nOiB1dGYtOCAtKi1cbiMgIENvcHlyaWdodCAoQykgMjAxNCBZdXN1a2UgU3V6dWtpIDx1dGF0YW5lLnRlYUBnbWFpbC5jb20+XG4jXG4jICBSZWRpc3RyaWJ1dGlvbiBhbmQgdXNlIGluIHNvdXJjZSBhbmQgYmluYXJ5IGZvcm1zLCB3aXRoIG9yIHdpdGhvdXRcbiMgIG1vZGlmaWNhdGlvbiwgYXJlIHBlcm1pdHRlZCBwcm92aWRlZCB0aGF0IHRoZSBmb2xsb3dpbmcgY29uZGl0aW9ucyBhcmUgbWV0OlxuI1xuIyAgICAqIFJlZGlzdHJpYnV0aW9ucyBvZiBzb3VyY2UgY29kZSBtdXN0IHJldGFpbiB0aGUgYWJvdmUgY29weXJpZ2h0XG4jICAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyLlxuIyAgICAqIFJlZGlzdHJpYnV0aW9ucyBpbiBiaW5hcnkgZm9ybSBtdXN0IHJlcHJvZHVjZSB0aGUgYWJvdmUgY29weXJpZ2h0XG4jICAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyIGluIHRoZVxuIyAgICAgIGRvY3VtZW50YXRpb24gYW5kL29yIG90aGVyIG1hdGVyaWFscyBwcm92aWRlZCB3aXRoIHRoZSBkaXN0cmlidXRpb24uXG4jXG4jICBUSElTIFNPRlRXQVJFIElTIFBST1ZJREVEIEJZIFRIRSBDT1BZUklHSFQgSE9MREVSUyBBTkQgQ09OVFJJQlVUT1JTIFwiQVMgSVNcIlxuIyAgQU5EIEFOWSBFWFBSRVNTIE9SIElNUExJRUQgV0FSUkFOVElFUywgSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFRIRVxuIyAgSU1QTElFRCBXQVJSQU5USUVTIE9GIE1FUkNIQU5UQUJJTElUWSBBTkQgRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0VcbiMgIEFSRSBESVNDTEFJTUVELiBJTiBOTyBFVkVOVCBTSEFMTCA8Q09QWVJJR0hUIEhPTERFUj4gQkUgTElBQkxFIEZPUiBBTllcbiMgIERJUkVDVCwgSU5ESVJFQ1QsIElOQ0lERU5UQUwsIFNQRUNJQUwsIEVYRU1QTEFSWSwgT1IgQ09OU0VRVUVOVElBTCBEQU1BR0VTXG4jICAoSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFBST0NVUkVNRU5UIE9GIFNVQlNUSVRVVEUgR09PRFMgT1IgU0VSVklDRVM7XG4jICBMT1NTIE9GIFVTRSwgREFUQSwgT1IgUFJPRklUUzsgT1IgQlVTSU5FU1MgSU5URVJSVVBUSU9OKSBIT1dFVkVSIENBVVNFRCBBTkRcbiMgIE9OIEFOWSBUSEVPUlkgT0YgTElBQklMSVRZLCBXSEVUSEVSIElOIENPTlRSQUNULCBTVFJJQ1QgTElBQklMSVRZLCBPUiBUT1JUXG4jICAoSU5DTFVESU5HIE5FR0xJR0VOQ0UgT1IgT1RIRVJXSVNFKSBBUklTSU5HIElOIEFOWSBXQVkgT1VUIE9GIFRIRSBVU0UgT0ZcbiMgIFRISVMgU09GVFdBUkUsIEVWRU4gSUYgQURWSVNFRCBPRiBUSEUgUE9TU0lCSUxJVFkgT0YgU1VDSCBEQU1BR0UuXG5cbmV4cGVjdCA9IHJlcXVpcmUoJ2NoYWknKS5leHBlY3Rcbmhhcm1vbnkgPSByZXF1aXJlICcuLi90aGlyZF9wYXJ0eS9lc3ByaW1hJ1xuZXNjb3BlID0gcmVxdWlyZSAnLi4nXG5cbmRlc2NyaWJlICdFUzYgYmxvY2sgc2NvcGUnLCAtPlxuICAgIGl0ICdsZXQgaXMgbWF0ZXJpYWxpemVkIGluIEVTNiBibG9jayBzY29wZSMxJywgLT5cbiAgICAgICAgYXN0ID0gaGFybW9ueS5wYXJzZSBcIlwiXCJcbiAgICAgICAge1xuICAgICAgICAgICAgbGV0IGkgPSAyMDtcbiAgICAgICAgICAgIGk7XG4gICAgICAgIH1cbiAgICAgICAgXCJcIlwiXG5cbiAgICAgICAgc2NvcGVNYW5hZ2VyID0gZXNjb3BlLmFuYWx5emUgYXN0LCBlY21hVmVyc2lvbjogNlxuICAgICAgICBleHBlY3Qoc2NvcGVNYW5hZ2VyLnNjb3BlcykudG8uaGF2ZS5sZW5ndGggMiAgIyBQcm9ncmFtIGFuZCBCbGNva1N0YXRlbWVudCBzY29wZS5cblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMF1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDAgICMgTm8gdmFyaWFibGUgaW4gUHJvZ3JhbSBzY29wZS5cblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdibG9jaydcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMSAgIyBgaWAgaW4gYmxvY2sgc2NvcGUuXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwgJ2knXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAyXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwoJ2knKVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1sxXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsKCdpJylcblxuICAgIGl0ICdsZXQgaXMgbWF0ZXJpYWxpemVkIGluIEVTNiBibG9jayBzY29wZSMyJywgLT5cbiAgICAgICAgYXN0ID0gaGFybW9ueS5wYXJzZSBcIlwiXCJcbiAgICAgICAge1xuICAgICAgICAgICAgbGV0IGkgPSAyMDtcbiAgICAgICAgICAgIHZhciBpID0gMjA7XG4gICAgICAgICAgICBpO1xuICAgICAgICB9XG4gICAgICAgIFwiXCJcIlxuXG4gICAgICAgIHNjb3BlTWFuYWdlciA9IGVzY29wZS5hbmFseXplIGFzdCwgZWNtYVZlcnNpb246IDZcbiAgICAgICAgZXhwZWN0KHNjb3BlTWFuYWdlci5zY29wZXMpLnRvLmhhdmUubGVuZ3RoIDIgICMgUHJvZ3JhbSBhbmQgQmxjb2tTdGF0ZW1lbnQgc2NvcGUuXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzBdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZ2xvYmFsJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAxICAjIE5vIHZhcmlhYmxlIGluIFByb2dyYW0gc2NvcGUuXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwgJ2knXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzFdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnYmxvY2snXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDEgICMgYGlgIGluIGJsb2NrIHNjb3BlLlxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICdpJ1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggM1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1swXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsKCdpJylcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMV0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCgnaScpXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzJdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwoJ2knKVxuXG4gICAgaXQgJ2Z1bmN0aW9uIGRlbGFyYXRpb24gaXMgbWF0ZXJpYWxpemVkIGluIEVTNiBibG9jayBzY29wZScsIC0+XG4gICAgICAgIGFzdCA9IGhhcm1vbnkucGFyc2UgXCJcIlwiXG4gICAgICAgIHtcbiAgICAgICAgICAgIGZ1bmN0aW9uIHRlc3QoKSB7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0ZXN0KCk7XG4gICAgICAgIH1cbiAgICAgICAgXCJcIlwiXG5cbiAgICAgICAgc2NvcGVNYW5hZ2VyID0gZXNjb3BlLmFuYWx5emUgYXN0LCBlY21hVmVyc2lvbjogNlxuICAgICAgICBleHBlY3Qoc2NvcGVNYW5hZ2VyLnNjb3BlcykudG8uaGF2ZS5sZW5ndGggM1xuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1swXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2dsb2JhbCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMFxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1sxXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2Jsb2NrJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAxXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwgJ3Rlc3QnXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAxXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwoJ3Rlc3QnKVxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1syXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2Z1bmN0aW9uJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAxXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwgJ2FyZ3VtZW50cydcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgIGl0ICdsZXQgaXMgbm90IGhvaXN0YWJsZSMxJywgLT5cbiAgICAgICAgYXN0ID0gaGFybW9ueS5wYXJzZSBcIlwiXCJcbiAgICAgICAgdmFyIGkgPSA0MjsgKDEpXG4gICAgICAgIHtcbiAgICAgICAgICAgIGk7ICAvLyAoMikgUmVmZXJlbmNlRXJyb3IgYXQgcnVudGltZS5cbiAgICAgICAgICAgIGxldCBpID0gMjA7ICAvLyAoMilcbiAgICAgICAgICAgIGk7ICAvLyAoMilcbiAgICAgICAgfVxuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3QsIGVjbWFWZXJzaW9uOiA2XG4gICAgICAgIGV4cGVjdChzY29wZU1hbmFnZXIuc2NvcGVzKS50by5oYXZlLmxlbmd0aCAyXG5cbiAgICAgICAgZ2xvYmFsU2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzBdXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS50eXBlKS50by5iZS5lcXVhbCAnZ2xvYmFsJ1xuICAgICAgICBleHBlY3QoZ2xvYmFsU2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAxXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwgJ2knXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAxXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzFdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnYmxvY2snXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5uYW1lKS50by5iZS5lcXVhbCAnaSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDNcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMF0ucmVzb2x2ZWQpLnRvLmJlLmVxdWFsIHNjb3BlLnZhcmlhYmxlc1swXVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1sxXS5yZXNvbHZlZCkudG8uYmUuZXF1YWwgc2NvcGUudmFyaWFibGVzWzBdXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzJdLnJlc29sdmVkKS50by5iZS5lcXVhbCBzY29wZS52YXJpYWJsZXNbMF1cblxuICAgIGl0ICdsZXQgaXMgbm90IGhvaXN0YWJsZSMyJywgLT5cbiAgICAgICAgYXN0ID0gaGFybW9ueS5wYXJzZSBcIlwiXCJcbiAgICAgICAgKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciBpID0gNDI7IC8vICgxKVxuICAgICAgICAgICAgaTsgIC8vICgxKVxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIGk7ICAvLyAoMylcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgIGk7ICAvLyAoMilcbiAgICAgICAgICAgICAgICAgICAgbGV0IGkgPSAyMDsgIC8vICgyKVxuICAgICAgICAgICAgICAgICAgICBpOyAgLy8gKDIpXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGxldCBpID0gMzA7ICAvLyAoMylcbiAgICAgICAgICAgICAgICBpOyAgLy8gKDMpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpOyAgLy8gKDEpXG4gICAgICAgIH0oKSk7XG4gICAgICAgIFwiXCJcIlxuXG4gICAgICAgIHNjb3BlTWFuYWdlciA9IGVzY29wZS5hbmFseXplIGFzdCwgZWNtYVZlcnNpb246IDZcbiAgICAgICAgZXhwZWN0KHNjb3BlTWFuYWdlci5zY29wZXMpLnRvLmhhdmUubGVuZ3RoIDRcblxuICAgICAgICBnbG9iYWxTY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMF1cbiAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdmdW5jdGlvbidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMlxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICdhcmd1bWVudHMnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMV0ubmFtZSkudG8uYmUuZXF1YWwgJ2knXG4gICAgICAgIHYxID0gc2NvcGUudmFyaWFibGVzWzFdXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAzXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLnJlc29sdmVkKS50by5iZS5lcXVhbCB2MVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1sxXS5yZXNvbHZlZCkudG8uYmUuZXF1YWwgdjFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMl0ucmVzb2x2ZWQpLnRvLmJlLmVxdWFsIHYxXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzJdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnYmxvY2snXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5uYW1lKS50by5iZS5lcXVhbCAnaSdcbiAgICAgICAgdjMgPSBzY29wZS52YXJpYWJsZXNbMF1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDNcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMF0ucmVzb2x2ZWQpLnRvLmJlLmVxdWFsIHYzXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLnJlc29sdmVkKS50by5iZS5lcXVhbCB2M1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1syXS5yZXNvbHZlZCkudG8uYmUuZXF1YWwgdjNcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbM11cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdibG9jaydcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICdpJ1xuICAgICAgICB2MiA9IHNjb3BlLnZhcmlhYmxlc1swXVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggM1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1swXS5yZXNvbHZlZCkudG8uYmUuZXF1YWwgdjJcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMV0ucmVzb2x2ZWQpLnRvLmJlLmVxdWFsIHYyXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzJdLnJlc29sdmVkKS50by5iZS5lcXVhbCB2MlxuXG4jIHZpbTogc2V0IHN3PTQgdHM9NCBldCB0dz04MCA6XG4iXX0=
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/powered-test/es6-catch.js b/tools/eslint/node_modules/escope/powered-test/es6-catch.js
      new file mode 100644
      index 00000000000000..986c5eb51e7faa
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/powered-test/es6-catch.js
      @@ -0,0 +1,39 @@
      +(function() {
      +  var escope, expect, harmony;
      +
      +  expect = require('chai').expect;
      +
      +  harmony = require('../third_party/esprima');
      +
      +  escope = require('..');
      +
      +  describe('ES6 catch', function() {
      +    return it('takes binding pattern', function() {
      +      var ast, scope, scopeManager;
      +      ast = harmony.parse("try {\n} catch ({ a, b, c, d }) {\n    let e = 20;\n    a;\n    b;\n    let c = 30;\n    c;\n    d;\n}");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(4);
      +      scope = scopeManager.scopes[0];
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.block.type).to.be.equal('Program');
      +      expect(scope.isStrict).to.be["false"];
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('block');
      +      expect(scope.block.type).to.be.equal('BlockStatement');
      +      expect(scope.isStrict).to.be["false"];
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(0);
      +      scope = scopeManager.scopes[2];
      +      expect(scope.type).to.be.equal('catch');
      +      expect(scope.block.type).to.be.equal('CatchClause');
      +      return expect(scope.isStrict).to.be["false"];
      +    });
      +  });
      +
      +}).call(this);
      +
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVzNi1jYXRjaC5jb2ZmZWUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBc0JBO0FBQUEsTUFBQSx1QkFBQTs7QUFBQSxFQUFBLE1BQUEsR0FBUyxPQUFBLENBQVMsTUFBVCxDQUFlLENBQUMsTUFBekIsQ0FBQTs7QUFBQSxFQUNBLE9BQUEsR0FBVSxPQUFBLENBQVMsd0JBQVQsQ0FEVixDQUFBOztBQUFBLEVBRUEsTUFBQSxHQUFTLE9BQUEsQ0FBUyxJQUFULENBRlQsQ0FBQTs7QUFBQSxFQUlBLFFBQUEsQ0FBVSxXQUFWLEVBQXNCLFNBQUEsR0FBQTtXQUNsQixFQUFBLENBQUksdUJBQUosRUFBNEIsU0FBQSxHQUFBO0FBQ3hCLFVBQUEsd0JBQUE7QUFBQSxNQUFBLEdBQUEsR0FBTSxPQUFPLENBQUMsS0FBUixDQUFpQix3R0FBakIsQ0FBTixDQUFBO0FBQUEsTUFXQSxZQUFBLEdBQWUsTUFBTSxDQUFDLE9BQVAsQ0FBZSxHQUFmLEVBQW9CO0FBQUEsUUFBQSxXQUFBLEVBQWEsQ0FBYjtPQUFwQixDQVhmLENBQUE7QUFBQSxNQVlBLE1BQUEsQ0FBTyxZQUFZLENBQUMsTUFBcEIsQ0FBMkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXBDLENBQTJDLENBQTNDLENBWkEsQ0FBQTtBQUFBLE1BY0EsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQWQ1QixDQUFBO0FBQUEsTUFlQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFFBQWhDLENBZkEsQ0FBQTtBQUFBLE1BZ0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsS0FBSyxDQUFDLElBQW5CLENBQXdCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEvQixDQUFzQyxTQUF0QyxDQWhCQSxDQUFBO0FBQUEsTUFpQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxRQUFiLENBQXNCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxPQUFELENBakI1QixDQUFBO0FBQUEsTUFrQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQWxCQSxDQUFBO0FBQUEsTUFtQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFiLENBQXdCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFqQyxDQUF3QyxDQUF4QyxDQW5CQSxDQUFBO0FBQUEsTUFxQkEsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQXJCNUIsQ0FBQTtBQUFBLE1Bc0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsT0FBaEMsQ0F0QkEsQ0FBQTtBQUFBLE1BdUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsS0FBSyxDQUFDLElBQW5CLENBQXdCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEvQixDQUFzQyxnQkFBdEMsQ0F2QkEsQ0FBQTtBQUFBLE1Bd0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsUUFBYixDQUFzQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsT0FBRCxDQXhCNUIsQ0FBQTtBQUFBLE1BeUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0F6QkEsQ0FBQTtBQUFBLE1BMEJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsQ0ExQkEsQ0FBQTtBQUFBLE1BNEJBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0E1QjVCLENBQUE7QUFBQSxNQTZCQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLE9BQWhDLENBN0JBLENBQUE7QUFBQSxNQThCQSxNQUFBLENBQU8sS0FBSyxDQUFDLEtBQUssQ0FBQyxJQUFuQixDQUF3QixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBL0IsQ0FBc0MsYUFBdEMsQ0E5QkEsQ0FBQTthQStCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFFBQWIsQ0FBc0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE9BQUQsRUFoQ0o7SUFBQSxDQUE1QixFQURrQjtFQUFBLENBQXRCLENBSkEsQ0FBQTtBQUFBIiwiZmlsZSI6ImVzNi1jYXRjaC5qcyIsInNvdXJjZVJvb3QiOiIvc291cmNlLyIsInNvdXJjZXNDb250ZW50IjpbIiMgLSotIGNvZGluZzogdXRmLTggLSotXG4jICBDb3B5cmlnaHQgKEMpIDIwMTQgWXVzdWtlIFN1enVraSA8dXRhdGFuZS50ZWFAZ21haWwuY29tPlxuI1xuIyAgUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0XG4jICBtb2RpZmljYXRpb24sIGFyZSBwZXJtaXR0ZWQgcHJvdmlkZWQgdGhhdCB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnMgYXJlIG1ldDpcbiNcbiMgICAgKiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodFxuIyAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lci5cbiMgICAgKiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodFxuIyAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lciBpbiB0aGVcbiMgICAgICBkb2N1bWVudGF0aW9uIGFuZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQgd2l0aCB0aGUgZGlzdHJpYnV0aW9uLlxuI1xuIyAgVEhJUyBTT0ZUV0FSRSBJUyBQUk9WSURFRCBCWSBUSEUgQ09QWVJJR0hUIEhPTERFUlMgQU5EIENPTlRSSUJVVE9SUyBcIkFTIElTXCJcbiMgIEFORCBBTlkgRVhQUkVTUyBPUiBJTVBMSUVEIFdBUlJBTlRJRVMsIElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBUSEVcbiMgIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFXG4jICBBUkUgRElTQ0xBSU1FRC4gSU4gTk8gRVZFTlQgU0hBTEwgPENPUFlSSUdIVCBIT0xERVI+IEJFIExJQUJMRSBGT1IgQU5ZXG4jICBESVJFQ1QsIElORElSRUNULCBJTkNJREVOVEFMLCBTUEVDSUFMLCBFWEVNUExBUlksIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFU1xuIyAgKElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTO1xuIyAgTE9TUyBPRiBVU0UsIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EXG4jICBPTiBBTlkgVEhFT1JZIE9GIExJQUJJTElUWSwgV0hFVEhFUiBJTiBDT05UUkFDVCwgU1RSSUNUIExJQUJJTElUWSwgT1IgVE9SVFxuIyAgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFIE9GXG4jICBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLlxuZXhwZWN0ID0gcmVxdWlyZSgnY2hhaScpLmV4cGVjdFxuaGFybW9ueSA9IHJlcXVpcmUgJy4uL3RoaXJkX3BhcnR5L2VzcHJpbWEnXG5lc2NvcGUgPSByZXF1aXJlICcuLidcblxuZGVzY3JpYmUgJ0VTNiBjYXRjaCcsIC0+XG4gICAgaXQgJ3Rha2VzIGJpbmRpbmcgcGF0dGVybicsIC0+XG4gICAgICAgIGFzdCA9IGhhcm1vbnkucGFyc2UgXCJcIlwiXG4gICAgICAgIHRyeSB7XG4gICAgICAgIH0gY2F0Y2ggKHsgYSwgYiwgYywgZCB9KSB7XG4gICAgICAgICAgICBsZXQgZSA9IDIwO1xuICAgICAgICAgICAgYTtcbiAgICAgICAgICAgIGI7XG4gICAgICAgICAgICBsZXQgYyA9IDMwO1xuICAgICAgICAgICAgYztcbiAgICAgICAgICAgIGQ7XG4gICAgICAgIH1cbiAgICAgICAgXCJcIlwiXG4gICAgICAgIHNjb3BlTWFuYWdlciA9IGVzY29wZS5hbmFseXplIGFzdCwgZWNtYVZlcnNpb246IDZcbiAgICAgICAgZXhwZWN0KHNjb3BlTWFuYWdlci5zY29wZXMpLnRvLmhhdmUubGVuZ3RoIDRcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMF1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgIGV4cGVjdChzY29wZS5ibG9jay50eXBlKS50by5iZS5lcXVhbCAnUHJvZ3JhbSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLmlzU3RyaWN0KS50by5iZS5mYWxzZVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAwXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzFdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnYmxvY2snXG4gICAgICAgIGV4cGVjdChzY29wZS5ibG9jay50eXBlKS50by5iZS5lcXVhbCAnQmxvY2tTdGF0ZW1lbnQnXG4gICAgICAgIGV4cGVjdChzY29wZS5pc1N0cmljdCkudG8uYmUuZmFsc2VcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMFxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggMFxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1syXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2NhdGNoJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuYmxvY2sudHlwZSkudG8uYmUuZXF1YWwgJ0NhdGNoQ2xhdXNlJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuaXNTdHJpY3QpLnRvLmJlLmZhbHNlXG5cbiAgICAgICAgIyBGSVhNRSBBZnRlciBFc3ByaW1hJ3MgYnVnIGlzIGZpeGVkLCBJJ2xsIGFkZCB0ZXN0cyAjMzNcbiAgICAgICAgIyBodHRwczovL2dpdGh1Yi5jb20vZXN0b29scy9lc2NvcGUvaXNzdWVzLzMzI2lzc3VlY29tbWVudC02NDEzNTgzMlxuICAgICAgICAjXG4gICAgICAgICMgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggNFxuICAgICAgICAjIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwgJ2EnXG4gICAgICAgICMgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1sxXS5uYW1lKS50by5iZS5lcXVhbCAnYidcbiAgICAgICAgIyBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzJdLm5hbWUpLnRvLmJlLmVxdWFsICdjJ1xuICAgICAgICAjIGV4cGVjdChzY29wZS52YXJpYWJsZXNbM10ubmFtZSkudG8uYmUuZXF1YWwgJ2QnXG4gICAgICAgICMgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuIyB2aW06IHNldCBzdz00IHRzPTQgZXQgdHc9ODAgOlxuIl19
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/powered-test/es6-class.js b/tools/eslint/node_modules/escope/powered-test/es6-class.js
      new file mode 100644
      index 00000000000000..9fcbe8ebdda953
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/powered-test/es6-class.js
      @@ -0,0 +1,155 @@
      +(function() {
      +  var escope, expect, harmony;
      +
      +  expect = require('chai').expect;
      +
      +  harmony = require('../third_party/esprima');
      +
      +  escope = require('..');
      +
      +  describe('ES6 class', function() {
      +    it('declaration name creates class scope', function() {
      +      var ast, scope, scopeManager;
      +      ast = harmony.parse("class Derived extends Base {\n    constructor() {\n    }\n}\nnew Derived();");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(3);
      +      scope = scopeManager.scopes[0];
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.block.type).to.be.equal('Program');
      +      expect(scope.isStrict).to.be["false"];
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('Derived');
      +      expect(scope.references).to.have.length(2);
      +      expect(scope.references[0].identifier.name).to.be.equal('Base');
      +      expect(scope.references[1].identifier.name).to.be.equal('Derived');
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('class');
      +      expect(scope.block.type).to.be.equal('ClassDeclaration');
      +      expect(scope.isStrict).to.be["true"];
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('Derived');
      +      expect(scope.references).to.have.length(0);
      +      scope = scopeManager.scopes[2];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.block.type).to.be.equal('FunctionExpression');
      +      expect(scope.isStrict).to.be["true"];
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      return expect(scope.references).to.have.length(0);
      +    });
      +    it('declaration name creates class scope', function() {
      +      var ast, scope, scopeManager;
      +      ast = harmony.parse("class Base {\n    constructor() {\n    }\n}\nlet foo = new Base();");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(3);
      +      scope = scopeManager.scopes[0];
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.block.type).to.be.equal('Program');
      +      expect(scope.isStrict).to.be["false"];
      +      expect(scope.variables).to.have.length(2);
      +      expect(scope.variables[0].name).to.be.equal('Base');
      +      expect(scope.variables[1].name).to.be.equal('foo');
      +      expect(scope.through).to.have.length(0);
      +      expect(scope.references).to.have.length(2);
      +      expect(scope.references[0].identifier.name).to.be.equal('foo');
      +      expect(scope.references[1].identifier.name).to.be.equal('Base');
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('class');
      +      expect(scope.block.type).to.be.equal('ClassDeclaration');
      +      expect(scope.isStrict).to.be["true"];
      +      expect(scope.variables).to.have.length(1);
      +      console.dir(scope.variables);
      +      expect(scope.variables[0].name).to.be.equal('Base');
      +      expect(scope.references).to.have.length(0);
      +      scope = scopeManager.scopes[2];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.block.type).to.be.equal('FunctionExpression');
      +      expect(scope.isStrict).to.be["true"];
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      return expect(scope.references).to.have.length(0);
      +    });
      +    it('expression name creates class scope#1', function() {
      +      var ast, scope, scopeManager;
      +      ast = harmony.parse("(class Derived extends Base {\n    constructor() {\n    }\n});");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(3);
      +      scope = scopeManager.scopes[0];
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.block.type).to.be.equal('Program');
      +      expect(scope.isStrict).to.be["false"];
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(1);
      +      expect(scope.references[0].identifier.name).to.be.equal('Base');
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('class');
      +      expect(scope.block.type).to.be.equal('ClassExpression');
      +      expect(scope.isStrict).to.be["true"];
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('Derived');
      +      expect(scope.references).to.have.length(0);
      +      scope = scopeManager.scopes[2];
      +      expect(scope.type).to.be.equal('function');
      +      return expect(scope.block.type).to.be.equal('FunctionExpression');
      +    });
      +    it('expression name creates class scope#2', function() {
      +      var ast, scope, scopeManager;
      +      ast = harmony.parse("(class extends Base {\n    constructor() {\n    }\n});");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(3);
      +      scope = scopeManager.scopes[0];
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.block.type).to.be.equal('Program');
      +      expect(scope.isStrict).to.be["false"];
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(1);
      +      expect(scope.references[0].identifier.name).to.be.equal('Base');
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('class');
      +      expect(scope.block.type).to.be.equal('ClassExpression');
      +      scope = scopeManager.scopes[2];
      +      expect(scope.type).to.be.equal('function');
      +      return expect(scope.block.type).to.be.equal('FunctionExpression');
      +    });
      +    return it('computed property key may refer variables', function() {
      +      var ast, scope, scopeManager;
      +      ast = harmony.parse("(function () {\n    var yuyushiki = 42;\n    (class {\n        [yuyushiki]() {\n        }\n\n        [yuyushiki + 40]() {\n        }\n    });\n}());");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(5);
      +      scope = scopeManager.scopes[0];
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.block.type).to.be.equal('Program');
      +      expect(scope.isStrict).to.be["false"];
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.block.type).to.be.equal('FunctionExpression');
      +      expect(scope.isStrict).to.be["false"];
      +      expect(scope.variables).to.have.length(2);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      expect(scope.variables[1].name).to.be.equal('yuyushiki');
      +      expect(scope.references).to.have.length(1);
      +      expect(scope.references[0].identifier.name).to.be.equal('yuyushiki');
      +      scope = scopeManager.scopes[2];
      +      expect(scope.type).to.be.equal('class');
      +      expect(scope.block.type).to.be.equal('ClassExpression');
      +      expect(scope.isStrict).to.be["true"];
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(2);
      +      expect(scope.references[0].identifier.name).to.be.equal('yuyushiki');
      +      return expect(scope.references[1].identifier.name).to.be.equal('yuyushiki');
      +    });
      +  });
      +
      +}).call(this);
      +
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVzNi1jbGFzcy5jb2ZmZWUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBdUJBO0FBQUEsTUFBQSx1QkFBQTs7QUFBQSxFQUFBLE1BQUEsR0FBUyxPQUFBLENBQVMsTUFBVCxDQUFlLENBQUMsTUFBekIsQ0FBQTs7QUFBQSxFQUNBLE9BQUEsR0FBVSxPQUFBLENBQVMsd0JBQVQsQ0FEVixDQUFBOztBQUFBLEVBRUEsTUFBQSxHQUFTLE9BQUEsQ0FBUyxJQUFULENBRlQsQ0FBQTs7QUFBQSxFQUlBLFFBQUEsQ0FBVSxXQUFWLEVBQXNCLFNBQUEsR0FBQTtBQUNsQixJQUFBLEVBQUEsQ0FBSSxzQ0FBSixFQUEyQyxTQUFBLEdBQUE7QUFDdkMsVUFBQSx3QkFBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLDZFQUFqQixDQUFOLENBQUE7QUFBQSxNQVFBLFlBQUEsR0FBZSxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsRUFBb0I7QUFBQSxRQUFBLFdBQUEsRUFBYSxDQUFiO09BQXBCLENBUmYsQ0FBQTtBQUFBLE1BU0EsTUFBQSxDQUFPLFlBQVksQ0FBQyxNQUFwQixDQUEyQixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBcEMsQ0FBMkMsQ0FBM0MsQ0FUQSxDQUFBO0FBQUEsTUFXQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBWDVCLENBQUE7QUFBQSxNQVlBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsUUFBaEMsQ0FaQSxDQUFBO0FBQUEsTUFhQSxNQUFBLENBQU8sS0FBSyxDQUFDLEtBQUssQ0FBQyxJQUFuQixDQUF3QixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBL0IsQ0FBc0MsU0FBdEMsQ0FiQSxDQUFBO0FBQUEsTUFjQSxNQUFBLENBQU8sS0FBSyxDQUFDLFFBQWIsQ0FBc0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE9BQUQsQ0FkNUIsQ0FBQTtBQUFBLE1BZUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQWZBLENBQUE7QUFBQSxNQWdCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsU0FBN0MsQ0FoQkEsQ0FBQTtBQUFBLE1BaUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsQ0FqQkEsQ0FBQTtBQUFBLE1Ba0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsTUFBekQsQ0FsQkEsQ0FBQTtBQUFBLE1BbUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsU0FBekQsQ0FuQkEsQ0FBQTtBQUFBLE1BcUJBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FyQjVCLENBQUE7QUFBQSxNQXNCQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLE9BQWhDLENBdEJBLENBQUE7QUFBQSxNQXVCQSxNQUFBLENBQU8sS0FBSyxDQUFDLEtBQUssQ0FBQyxJQUFuQixDQUF3QixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBL0IsQ0FBc0Msa0JBQXRDLENBdkJBLENBQUE7QUFBQSxNQXdCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFFBQWIsQ0FBc0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0F4QjVCLENBQUE7QUFBQSxNQXlCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBekJBLENBQUE7QUFBQSxNQTBCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsU0FBN0MsQ0ExQkEsQ0FBQTtBQUFBLE1BMkJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsQ0EzQkEsQ0FBQTtBQUFBLE1BNkJBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0E3QjVCLENBQUE7QUFBQSxNQThCQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFVBQWhDLENBOUJBLENBQUE7QUFBQSxNQStCQSxNQUFBLENBQU8sS0FBSyxDQUFDLEtBQUssQ0FBQyxJQUFuQixDQUF3QixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBL0IsQ0FBc0Msb0JBQXRDLENBL0JBLENBQUE7QUFBQSxNQWdDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFFBQWIsQ0FBc0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0FoQzVCLENBQUE7QUFBQSxNQWlDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBakNBLENBQUE7QUFBQSxNQWtDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsV0FBN0MsQ0FsQ0EsQ0FBQTthQW1DQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLEVBcEN1QztJQUFBLENBQTNDLENBQUEsQ0FBQTtBQUFBLElBc0NBLEVBQUEsQ0FBSSxzQ0FBSixFQUEyQyxTQUFBLEdBQUE7QUFDdkMsVUFBQSx3QkFBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLG9FQUFqQixDQUFOLENBQUE7QUFBQSxNQVFBLFlBQUEsR0FBZSxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsRUFBb0I7QUFBQSxRQUFBLFdBQUEsRUFBYSxDQUFiO09BQXBCLENBUmYsQ0FBQTtBQUFBLE1BU0EsTUFBQSxDQUFPLFlBQVksQ0FBQyxNQUFwQixDQUEyQixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBcEMsQ0FBMkMsQ0FBM0MsQ0FUQSxDQUFBO0FBQUEsTUFXQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBWDVCLENBQUE7QUFBQSxNQVlBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsUUFBaEMsQ0FaQSxDQUFBO0FBQUEsTUFhQSxNQUFBLENBQU8sS0FBSyxDQUFDLEtBQUssQ0FBQyxJQUFuQixDQUF3QixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBL0IsQ0FBc0MsU0FBdEMsQ0FiQSxDQUFBO0FBQUEsTUFjQSxNQUFBLENBQU8sS0FBSyxDQUFDLFFBQWIsQ0FBc0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE9BQUQsQ0FkNUIsQ0FBQTtBQUFBLE1BZUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQWZBLENBQUE7QUFBQSxNQWdCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsTUFBN0MsQ0FoQkEsQ0FBQTtBQUFBLE1BaUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxLQUE3QyxDQWpCQSxDQUFBO0FBQUEsTUFrQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxPQUFiLENBQXFCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUE5QixDQUFxQyxDQUFyQyxDQWxCQSxDQUFBO0FBQUEsTUFtQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFiLENBQXdCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFqQyxDQUF3QyxDQUF4QyxDQW5CQSxDQUFBO0FBQUEsTUFvQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxLQUF6RCxDQXBCQSxDQUFBO0FBQUEsTUFxQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxNQUF6RCxDQXJCQSxDQUFBO0FBQUEsTUF1QkEsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQXZCNUIsQ0FBQTtBQUFBLE1Bd0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsT0FBaEMsQ0F4QkEsQ0FBQTtBQUFBLE1BeUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsS0FBSyxDQUFDLElBQW5CLENBQXdCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEvQixDQUFzQyxrQkFBdEMsQ0F6QkEsQ0FBQTtBQUFBLE1BMEJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsUUFBYixDQUFzQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxDQTFCNUIsQ0FBQTtBQUFBLE1BMkJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0EzQkEsQ0FBQTtBQUFBLE1BNEJBLE9BQU8sQ0FBQyxHQUFSLENBQVksS0FBSyxDQUFDLFNBQWxCLENBNUJBLENBQUE7QUFBQSxNQTZCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsTUFBN0MsQ0E3QkEsQ0FBQTtBQUFBLE1BOEJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsQ0E5QkEsQ0FBQTtBQUFBLE1BZ0NBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FoQzVCLENBQUE7QUFBQSxNQWlDQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFVBQWhDLENBakNBLENBQUE7QUFBQSxNQWtDQSxNQUFBLENBQU8sS0FBSyxDQUFDLEtBQUssQ0FBQyxJQUFuQixDQUF3QixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBL0IsQ0FBc0Msb0JBQXRDLENBbENBLENBQUE7QUFBQSxNQW1DQSxNQUFBLENBQU8sS0FBSyxDQUFDLFFBQWIsQ0FBc0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0FuQzVCLENBQUE7QUFBQSxNQW9DQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBcENBLENBQUE7QUFBQSxNQXFDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsV0FBN0MsQ0FyQ0EsQ0FBQTthQXNDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLEVBdkN1QztJQUFBLENBQTNDLENBdENBLENBQUE7QUFBQSxJQStFQSxFQUFBLENBQUksdUNBQUosRUFBNEMsU0FBQSxHQUFBO0FBQ3hDLFVBQUEsd0JBQUE7QUFBQSxNQUFBLEdBQUEsR0FBTSxPQUFPLENBQUMsS0FBUixDQUFpQixnRUFBakIsQ0FBTixDQUFBO0FBQUEsTUFPQSxZQUFBLEdBQWUsTUFBTSxDQUFDLE9BQVAsQ0FBZSxHQUFmLEVBQW9CO0FBQUEsUUFBQSxXQUFBLEVBQWEsQ0FBYjtPQUFwQixDQVBmLENBQUE7QUFBQSxNQVFBLE1BQUEsQ0FBTyxZQUFZLENBQUMsTUFBcEIsQ0FBMkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXBDLENBQTJDLENBQTNDLENBUkEsQ0FBQTtBQUFBLE1BVUEsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQVY1QixDQUFBO0FBQUEsTUFXQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFFBQWhDLENBWEEsQ0FBQTtBQUFBLE1BWUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxLQUFLLENBQUMsSUFBbkIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQS9CLENBQXNDLFNBQXRDLENBWkEsQ0FBQTtBQUFBLE1BYUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxRQUFiLENBQXNCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxPQUFELENBYjVCLENBQUE7QUFBQSxNQWNBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0FkQSxDQUFBO0FBQUEsTUFlQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBZkEsQ0FBQTtBQUFBLE1BZ0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsTUFBekQsQ0FoQkEsQ0FBQTtBQUFBLE1Ba0JBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FsQjVCLENBQUE7QUFBQSxNQW1CQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLE9BQWhDLENBbkJBLENBQUE7QUFBQSxNQW9CQSxNQUFBLENBQU8sS0FBSyxDQUFDLEtBQUssQ0FBQyxJQUFuQixDQUF3QixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBL0IsQ0FBc0MsaUJBQXRDLENBcEJBLENBQUE7QUFBQSxNQXFCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFFBQWIsQ0FBc0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0FyQjVCLENBQUE7QUFBQSxNQXNCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBdEJBLENBQUE7QUFBQSxNQXVCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsU0FBN0MsQ0F2QkEsQ0FBQTtBQUFBLE1Bd0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsQ0F4QkEsQ0FBQTtBQUFBLE1BMEJBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0ExQjVCLENBQUE7QUFBQSxNQTJCQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFVBQWhDLENBM0JBLENBQUE7YUE0QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxLQUFLLENBQUMsSUFBbkIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQS9CLENBQXNDLG9CQUF0QyxFQTdCd0M7SUFBQSxDQUE1QyxDQS9FQSxDQUFBO0FBQUEsSUE4R0EsRUFBQSxDQUFJLHVDQUFKLEVBQTRDLFNBQUEsR0FBQTtBQUN4QyxVQUFBLHdCQUFBO0FBQUEsTUFBQSxHQUFBLEdBQU0sT0FBTyxDQUFDLEtBQVIsQ0FBaUIsd0RBQWpCLENBQU4sQ0FBQTtBQUFBLE1BT0EsWUFBQSxHQUFlLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixFQUFvQjtBQUFBLFFBQUEsV0FBQSxFQUFhLENBQWI7T0FBcEIsQ0FQZixDQUFBO0FBQUEsTUFRQSxNQUFBLENBQU8sWUFBWSxDQUFDLE1BQXBCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQVJBLENBQUE7QUFBQSxNQVVBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FWNUIsQ0FBQTtBQUFBLE1BV0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxRQUFoQyxDQVhBLENBQUE7QUFBQSxNQVlBLE1BQUEsQ0FBTyxLQUFLLENBQUMsS0FBSyxDQUFDLElBQW5CLENBQXdCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEvQixDQUFzQyxTQUF0QyxDQVpBLENBQUE7QUFBQSxNQWFBLE1BQUEsQ0FBTyxLQUFLLENBQUMsUUFBYixDQUFzQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsT0FBRCxDQWI1QixDQUFBO0FBQUEsTUFjQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBZEEsQ0FBQTtBQUFBLE1BZUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFiLENBQXdCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFqQyxDQUF3QyxDQUF4QyxDQWZBLENBQUE7QUFBQSxNQWdCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELE1BQXpELENBaEJBLENBQUE7QUFBQSxNQWtCQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBbEI1QixDQUFBO0FBQUEsTUFtQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxPQUFoQyxDQW5CQSxDQUFBO0FBQUEsTUFvQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxLQUFLLENBQUMsSUFBbkIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQS9CLENBQXNDLGlCQUF0QyxDQXBCQSxDQUFBO0FBQUEsTUFzQkEsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQXRCNUIsQ0FBQTtBQUFBLE1BdUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsVUFBaEMsQ0F2QkEsQ0FBQTthQXdCQSxNQUFBLENBQU8sS0FBSyxDQUFDLEtBQUssQ0FBQyxJQUFuQixDQUF3QixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBL0IsQ0FBc0Msb0JBQXRDLEVBekJ3QztJQUFBLENBQTVDLENBOUdBLENBQUE7V0F5SUEsRUFBQSxDQUFJLDJDQUFKLEVBQWdELFNBQUEsR0FBQTtBQUM1QyxVQUFBLHdCQUFBO0FBQUEsTUFBQSxHQUFBLEdBQU0sT0FBTyxDQUFDLEtBQVIsQ0FBaUIsc0pBQWpCLENBQU4sQ0FBQTtBQUFBLE1BYUEsWUFBQSxHQUFlLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixFQUFvQjtBQUFBLFFBQUEsV0FBQSxFQUFhLENBQWI7T0FBcEIsQ0FiZixDQUFBO0FBQUEsTUFjQSxNQUFBLENBQU8sWUFBWSxDQUFDLE1BQXBCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQWRBLENBQUE7QUFBQSxNQWdCQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBaEI1QixDQUFBO0FBQUEsTUFpQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxRQUFoQyxDQWpCQSxDQUFBO0FBQUEsTUFrQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxLQUFLLENBQUMsSUFBbkIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQS9CLENBQXNDLFNBQXRDLENBbEJBLENBQUE7QUFBQSxNQW1CQSxNQUFBLENBQU8sS0FBSyxDQUFDLFFBQWIsQ0FBc0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE9BQUQsQ0FuQjVCLENBQUE7QUFBQSxNQXFCQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBckI1QixDQUFBO0FBQUEsTUFzQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxVQUFoQyxDQXRCQSxDQUFBO0FBQUEsTUF1QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxLQUFLLENBQUMsSUFBbkIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQS9CLENBQXNDLG9CQUF0QyxDQXZCQSxDQUFBO0FBQUEsTUF3QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxRQUFiLENBQXNCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxPQUFELENBeEI1QixDQUFBO0FBQUEsTUF5QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQXpCQSxDQUFBO0FBQUEsTUEwQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLFdBQTdDLENBMUJBLENBQUE7QUFBQSxNQTJCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsV0FBN0MsQ0EzQkEsQ0FBQTtBQUFBLE1BNEJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsQ0E1QkEsQ0FBQTtBQUFBLE1BNkJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsV0FBekQsQ0E3QkEsQ0FBQTtBQUFBLE1BK0JBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0EvQjVCLENBQUE7QUFBQSxNQWdDQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLE9BQWhDLENBaENBLENBQUE7QUFBQSxNQWlDQSxNQUFBLENBQU8sS0FBSyxDQUFDLEtBQUssQ0FBQyxJQUFuQixDQUF3QixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBL0IsQ0FBc0MsaUJBQXRDLENBakNBLENBQUE7QUFBQSxNQWtDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFFBQWIsQ0FBc0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0FsQzVCLENBQUE7QUFBQSxNQW1DQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBbkNBLENBQUE7QUFBQSxNQW9DQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBcENBLENBQUE7QUFBQSxNQXFDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELFdBQXpELENBckNBLENBQUE7YUFzQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxXQUF6RCxFQXZDNEM7SUFBQSxDQUFoRCxFQTFJa0I7RUFBQSxDQUF0QixDQUpBLENBQUE7QUFBQSIsImZpbGUiOiJlczYtY2xhc3MuanMiLCJzb3VyY2VSb290IjoiL3NvdXJjZS8iLCJzb3VyY2VzQ29udGVudCI6WyIjIC0qLSBjb2Rpbmc6IHV0Zi04IC0qLVxuIyAgQ29weXJpZ2h0IChDKSAyMDE0IFl1c3VrZSBTdXp1a2kgPHV0YXRhbmUudGVhQGdtYWlsLmNvbT5cbiNcbiMgIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dFxuIyAgbW9kaWZpY2F0aW9uLCBhcmUgcGVybWl0dGVkIHByb3ZpZGVkIHRoYXQgdGhlIGZvbGxvd2luZyBjb25kaXRpb25zIGFyZSBtZXQ6XG4jXG4jICAgICogUmVkaXN0cmlidXRpb25zIG9mIHNvdXJjZSBjb2RlIG11c3QgcmV0YWluIHRoZSBhYm92ZSBjb3B5cmlnaHRcbiMgICAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIuXG4jICAgICogUmVkaXN0cmlidXRpb25zIGluIGJpbmFyeSBmb3JtIG11c3QgcmVwcm9kdWNlIHRoZSBhYm92ZSBjb3B5cmlnaHRcbiMgICAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIgaW4gdGhlXG4jICAgICAgZG9jdW1lbnRhdGlvbiBhbmQvb3Igb3RoZXIgbWF0ZXJpYWxzIHByb3ZpZGVkIHdpdGggdGhlIGRpc3RyaWJ1dGlvbi5cbiNcbiMgIFRISVMgU09GVFdBUkUgSVMgUFJPVklERUQgQlkgVEhFIENPUFlSSUdIVCBIT0xERVJTIEFORCBDT05UUklCVVRPUlMgXCJBUyBJU1wiXG4jICBBTkQgQU5ZIEVYUFJFU1MgT1IgSU1QTElFRCBXQVJSQU5USUVTLCBJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgVEhFXG4jICBJTVBMSUVEIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZIEFORCBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRVxuIyAgQVJFIERJU0NMQUlNRUQuIElOIE5PIEVWRU5UIFNIQUxMIDxDT1BZUklHSFQgSE9MREVSPiBCRSBMSUFCTEUgRk9SIEFOWVxuIyAgRElSRUNULCBJTkRJUkVDVCwgSU5DSURFTlRBTCwgU1BFQ0lBTCwgRVhFTVBMQVJZLCBPUiBDT05TRVFVRU5USUFMIERBTUFHRVNcbiMgIChJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgUFJPQ1VSRU1FTlQgT0YgU1VCU1RJVFVURSBHT09EUyBPUiBTRVJWSUNFUztcbiMgIExPU1MgT0YgVVNFLCBEQVRBLCBPUiBQUk9GSVRTOyBPUiBCVVNJTkVTUyBJTlRFUlJVUFRJT04pIEhPV0VWRVIgQ0FVU0VEIEFORFxuIyAgT04gQU5ZIFRIRU9SWSBPRiBMSUFCSUxJVFksIFdIRVRIRVIgSU4gQ09OVFJBQ1QsIFNUUklDVCBMSUFCSUxJVFksIE9SIFRPUlRcbiMgIChJTkNMVURJTkcgTkVHTElHRU5DRSBPUiBPVEhFUldJU0UpIEFSSVNJTkcgSU4gQU5ZIFdBWSBPVVQgT0YgVEhFIFVTRSBPRlxuIyAgVEhJUyBTT0ZUV0FSRSwgRVZFTiBJRiBBRFZJU0VEIE9GIFRIRSBQT1NTSUJJTElUWSBPRiBTVUNIIERBTUFHRS5cblxuZXhwZWN0ID0gcmVxdWlyZSgnY2hhaScpLmV4cGVjdFxuaGFybW9ueSA9IHJlcXVpcmUgJy4uL3RoaXJkX3BhcnR5L2VzcHJpbWEnXG5lc2NvcGUgPSByZXF1aXJlICcuLidcblxuZGVzY3JpYmUgJ0VTNiBjbGFzcycsIC0+XG4gICAgaXQgJ2RlY2xhcmF0aW9uIG5hbWUgY3JlYXRlcyBjbGFzcyBzY29wZScsIC0+XG4gICAgICAgIGFzdCA9IGhhcm1vbnkucGFyc2UgXCJcIlwiXG4gICAgICAgIGNsYXNzIERlcml2ZWQgZXh0ZW5kcyBCYXNlIHtcbiAgICAgICAgICAgIGNvbnN0cnVjdG9yKCkge1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIG5ldyBEZXJpdmVkKCk7XG4gICAgICAgIFwiXCJcIlxuXG4gICAgICAgIHNjb3BlTWFuYWdlciA9IGVzY29wZS5hbmFseXplIGFzdCwgZWNtYVZlcnNpb246IDZcbiAgICAgICAgZXhwZWN0KHNjb3BlTWFuYWdlci5zY29wZXMpLnRvLmhhdmUubGVuZ3RoIDNcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMF1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgIGV4cGVjdChzY29wZS5ibG9jay50eXBlKS50by5iZS5lcXVhbCAnUHJvZ3JhbSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLmlzU3RyaWN0KS50by5iZS5mYWxzZVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAxXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwgJ0Rlcml2ZWQnXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAyXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ0Jhc2UnXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ0Rlcml2ZWQnXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzFdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnY2xhc3MnXG4gICAgICAgIGV4cGVjdChzY29wZS5ibG9jay50eXBlKS50by5iZS5lcXVhbCAnQ2xhc3NEZWNsYXJhdGlvbidcbiAgICAgICAgZXhwZWN0KHNjb3BlLmlzU3RyaWN0KS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5uYW1lKS50by5iZS5lcXVhbCAnRGVyaXZlZCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMl1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdmdW5jdGlvbidcbiAgICAgICAgZXhwZWN0KHNjb3BlLmJsb2NrLnR5cGUpLnRvLmJlLmVxdWFsICdGdW5jdGlvbkV4cHJlc3Npb24nXG4gICAgICAgIGV4cGVjdChzY29wZS5pc1N0cmljdCkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAxXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwgJ2FyZ3VtZW50cydcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgIGl0ICdkZWNsYXJhdGlvbiBuYW1lIGNyZWF0ZXMgY2xhc3Mgc2NvcGUnLCAtPlxuICAgICAgICBhc3QgPSBoYXJtb255LnBhcnNlIFwiXCJcIlxuICAgICAgICBjbGFzcyBCYXNlIHtcbiAgICAgICAgICAgIGNvbnN0cnVjdG9yKCkge1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBmb28gPSBuZXcgQmFzZSgpO1xuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3QsIGVjbWFWZXJzaW9uOiA2XG4gICAgICAgIGV4cGVjdChzY29wZU1hbmFnZXIuc2NvcGVzKS50by5oYXZlLmxlbmd0aCAzXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzBdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZ2xvYmFsJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuYmxvY2sudHlwZSkudG8uYmUuZXF1YWwgJ1Byb2dyYW0nXG4gICAgICAgIGV4cGVjdChzY29wZS5pc1N0cmljdCkudG8uYmUuZmFsc2VcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMlxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICdCYXNlJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzFdLm5hbWUpLnRvLmJlLmVxdWFsICdmb28nXG4gICAgICAgIGV4cGVjdChzY29wZS50aHJvdWdoKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAyXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2ZvbydcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMV0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnQmFzZSdcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdjbGFzcydcbiAgICAgICAgZXhwZWN0KHNjb3BlLmJsb2NrLnR5cGUpLnRvLmJlLmVxdWFsICdDbGFzc0RlY2xhcmF0aW9uJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuaXNTdHJpY3QpLnRvLmJlLnRydWVcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMVxuICAgICAgICBjb25zb2xlLmRpciBzY29wZS52YXJpYWJsZXNcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5uYW1lKS50by5iZS5lcXVhbCAnQmFzZSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMl1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdmdW5jdGlvbidcbiAgICAgICAgZXhwZWN0KHNjb3BlLmJsb2NrLnR5cGUpLnRvLmJlLmVxdWFsICdGdW5jdGlvbkV4cHJlc3Npb24nXG4gICAgICAgIGV4cGVjdChzY29wZS5pc1N0cmljdCkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAxXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwgJ2FyZ3VtZW50cydcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgIGl0ICdleHByZXNzaW9uIG5hbWUgY3JlYXRlcyBjbGFzcyBzY29wZSMxJywgLT5cbiAgICAgICAgYXN0ID0gaGFybW9ueS5wYXJzZSBcIlwiXCJcbiAgICAgICAgKGNsYXNzIERlcml2ZWQgZXh0ZW5kcyBCYXNlIHtcbiAgICAgICAgICAgIGNvbnN0cnVjdG9yKCkge1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgXCJcIlwiXG5cbiAgICAgICAgc2NvcGVNYW5hZ2VyID0gZXNjb3BlLmFuYWx5emUgYXN0LCBlY21hVmVyc2lvbjogNlxuICAgICAgICBleHBlY3Qoc2NvcGVNYW5hZ2VyLnNjb3BlcykudG8uaGF2ZS5sZW5ndGggM1xuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1swXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2dsb2JhbCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLmJsb2NrLnR5cGUpLnRvLmJlLmVxdWFsICdQcm9ncmFtJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuaXNTdHJpY3QpLnRvLmJlLmZhbHNlXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMF0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnQmFzZSdcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdjbGFzcydcbiAgICAgICAgZXhwZWN0KHNjb3BlLmJsb2NrLnR5cGUpLnRvLmJlLmVxdWFsICdDbGFzc0V4cHJlc3Npb24nXG4gICAgICAgIGV4cGVjdChzY29wZS5pc1N0cmljdCkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAxXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwgJ0Rlcml2ZWQnXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAwXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzJdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZnVuY3Rpb24nXG4gICAgICAgIGV4cGVjdChzY29wZS5ibG9jay50eXBlKS50by5iZS5lcXVhbCAnRnVuY3Rpb25FeHByZXNzaW9uJ1xuXG4gICAgaXQgJ2V4cHJlc3Npb24gbmFtZSBjcmVhdGVzIGNsYXNzIHNjb3BlIzInLCAtPlxuICAgICAgICBhc3QgPSBoYXJtb255LnBhcnNlIFwiXCJcIlxuICAgICAgICAoY2xhc3MgZXh0ZW5kcyBCYXNlIHtcbiAgICAgICAgICAgIGNvbnN0cnVjdG9yKCkge1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgXCJcIlwiXG5cbiAgICAgICAgc2NvcGVNYW5hZ2VyID0gZXNjb3BlLmFuYWx5emUgYXN0LCBlY21hVmVyc2lvbjogNlxuICAgICAgICBleHBlY3Qoc2NvcGVNYW5hZ2VyLnNjb3BlcykudG8uaGF2ZS5sZW5ndGggM1xuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1swXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2dsb2JhbCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLmJsb2NrLnR5cGUpLnRvLmJlLmVxdWFsICdQcm9ncmFtJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuaXNTdHJpY3QpLnRvLmJlLmZhbHNlXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMF0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnQmFzZSdcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdjbGFzcydcbiAgICAgICAgZXhwZWN0KHNjb3BlLmJsb2NrLnR5cGUpLnRvLmJlLmVxdWFsICdDbGFzc0V4cHJlc3Npb24nXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzJdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZnVuY3Rpb24nXG4gICAgICAgIGV4cGVjdChzY29wZS5ibG9jay50eXBlKS50by5iZS5lcXVhbCAnRnVuY3Rpb25FeHByZXNzaW9uJ1xuXG4gICAgaXQgJ2NvbXB1dGVkIHByb3BlcnR5IGtleSBtYXkgcmVmZXIgdmFyaWFibGVzJywgLT5cbiAgICAgICAgYXN0ID0gaGFybW9ueS5wYXJzZSBcIlwiXCJcbiAgICAgICAgKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciB5dXl1c2hpa2kgPSA0MjtcbiAgICAgICAgICAgIChjbGFzcyB7XG4gICAgICAgICAgICAgICAgW3l1eXVzaGlraV0oKSB7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgW3l1eXVzaGlraSArIDQwXSgpIHtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSgpKTtcbiAgICAgICAgXCJcIlwiXG5cbiAgICAgICAgc2NvcGVNYW5hZ2VyID0gZXNjb3BlLmFuYWx5emUgYXN0LCBlY21hVmVyc2lvbjogNlxuICAgICAgICBleHBlY3Qoc2NvcGVNYW5hZ2VyLnNjb3BlcykudG8uaGF2ZS5sZW5ndGggNVxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1swXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2dsb2JhbCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLmJsb2NrLnR5cGUpLnRvLmJlLmVxdWFsICdQcm9ncmFtJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuaXNTdHJpY3QpLnRvLmJlLmZhbHNlXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzFdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZnVuY3Rpb24nXG4gICAgICAgIGV4cGVjdChzY29wZS5ibG9jay50eXBlKS50by5iZS5lcXVhbCAnRnVuY3Rpb25FeHByZXNzaW9uJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuaXNTdHJpY3QpLnRvLmJlLmZhbHNlXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDJcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5uYW1lKS50by5iZS5lcXVhbCAnYXJndW1lbnRzJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzFdLm5hbWUpLnRvLmJlLmVxdWFsICd5dXl1c2hpa2knXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAxXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ3l1eXVzaGlraSdcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMl1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdjbGFzcydcbiAgICAgICAgZXhwZWN0KHNjb3BlLmJsb2NrLnR5cGUpLnRvLmJlLmVxdWFsICdDbGFzc0V4cHJlc3Npb24nXG4gICAgICAgIGV4cGVjdChzY29wZS5pc1N0cmljdCkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAyXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ3l1eXVzaGlraSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMV0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAneXV5dXNoaWtpJ1xuXG4jIHZpbTogc2V0IHN3PTQgdHM9NCBldCB0dz04MCA6XG4iXX0=
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/powered-test/es6-destructuring-assignments.js b/tools/eslint/node_modules/escope/powered-test/es6-destructuring-assignments.js
      new file mode 100644
      index 00000000000000..5f23b274f7edb3
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/powered-test/es6-destructuring-assignments.js
      @@ -0,0 +1,504 @@
      +(function() {
      +  var escope, expect, harmony;
      +
      +  expect = require('chai').expect;
      +
      +  harmony = require('../third_party/esprima');
      +
      +  escope = require('..');
      +
      +  describe('ES6 destructuring assignments', function() {
      +    it('Pattern in var in ForInStatement', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = harmony.parse("(function () {\n    for (var [a, b, c] in array);\n}());");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      scope = scopeManager.scopes[0];
      +      globalScope = scope;
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(0);
      +      expect(scope.implicit.left).to.have.length(1);
      +      expect(scope.implicit.left[0].identifier.name).to.be.equal('array');
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(4);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      expect(scope.variables[1].name).to.be.equal('a');
      +      expect(scope.variables[2].name).to.be.equal('b');
      +      expect(scope.variables[3].name).to.be.equal('c');
      +      expect(scope.references).to.have.length(4);
      +      expect(scope.references[0].identifier.name).to.be.equal('a');
      +      expect(scope.references[0].isWrite()).to.be["true"];
      +      expect(scope.references[0].partial).to.be["true"];
      +      expect(scope.references[0].resolved).to.be.equal(scope.variables[1]);
      +      expect(scope.references[1].identifier.name).to.be.equal('b');
      +      expect(scope.references[1].isWrite()).to.be["true"];
      +      expect(scope.references[1].partial).to.be["true"];
      +      expect(scope.references[1].resolved).to.be.equal(scope.variables[2]);
      +      expect(scope.references[2].identifier.name).to.be.equal('c');
      +      expect(scope.references[2].isWrite()).to.be["true"];
      +      expect(scope.references[2].partial).to.be["true"];
      +      expect(scope.references[2].resolved).to.be.equal(scope.variables[3]);
      +      expect(scope.references[3].identifier.name).to.be.equal('array');
      +      return expect(scope.references[3].isWrite()).to.be["false"];
      +    });
      +    it('ArrayPattern in var', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = harmony.parse("(function () {\n    var [a, b, c] = array;\n}());");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      scope = scopeManager.scopes[0];
      +      globalScope = scope;
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(0);
      +      expect(scope.implicit.left).to.have.length(1);
      +      expect(scope.implicit.left[0].identifier.name).to.be.equal('array');
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(4);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      expect(scope.variables[1].name).to.be.equal('a');
      +      expect(scope.variables[2].name).to.be.equal('b');
      +      expect(scope.variables[3].name).to.be.equal('c');
      +      expect(scope.references).to.have.length(4);
      +      expect(scope.references[0].identifier.name).to.be.equal('a');
      +      expect(scope.references[0].isWrite()).to.be["true"];
      +      expect(scope.references[0].partial).to.be["true"];
      +      expect(scope.references[0].resolved).to.be.equal(scope.variables[1]);
      +      expect(scope.references[1].identifier.name).to.be.equal('b');
      +      expect(scope.references[1].isWrite()).to.be["true"];
      +      expect(scope.references[1].partial).to.be["true"];
      +      expect(scope.references[1].resolved).to.be.equal(scope.variables[2]);
      +      expect(scope.references[2].identifier.name).to.be.equal('c');
      +      expect(scope.references[2].isWrite()).to.be["true"];
      +      expect(scope.references[2].partial).to.be["true"];
      +      expect(scope.references[2].resolved).to.be.equal(scope.variables[3]);
      +      expect(scope.references[3].identifier.name).to.be.equal('array');
      +      return expect(scope.references[3].isWrite()).to.be["false"];
      +    });
      +    it('SpreadElement in var', function() {
      +      var ast, globalScope, index, name, scope, scopeManager, _i, _j, _len, _len1, _ref, _ref1;
      +      ast = harmony.parse("(function () {\n    var [a, b, ...rest] = array;\n}());");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      scope = scopeManager.scopes[0];
      +      globalScope = scope;
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(0);
      +      expect(scope.implicit.left).to.have.length(1);
      +      expect(scope.implicit.left[0].identifier.name).to.be.equal('array');
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(4);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      expect(scope.variables[1].name).to.be.equal('a');
      +      expect(scope.variables[2].name).to.be.equal('b');
      +      expect(scope.variables[3].name).to.be.equal('rest');
      +      expect(scope.references).to.have.length(4);
      +      expect(scope.references[0].identifier.name).to.be.equal('a');
      +      expect(scope.references[0].isWrite()).to.be["true"];
      +      expect(scope.references[0].partial).to.be["true"];
      +      expect(scope.references[0].resolved).to.be.equal(scope.variables[1]);
      +      expect(scope.references[1].identifier.name).to.be.equal('b');
      +      expect(scope.references[1].isWrite()).to.be["true"];
      +      expect(scope.references[1].partial).to.be["true"];
      +      expect(scope.references[1].resolved).to.be.equal(scope.variables[2]);
      +      expect(scope.references[2].identifier.name).to.be.equal('rest');
      +      expect(scope.references[2].isWrite()).to.be["true"];
      +      expect(scope.references[2].partial).to.be["true"];
      +      expect(scope.references[2].resolved).to.be.equal(scope.variables[3]);
      +      expect(scope.references[3].identifier.name).to.be.equal('array');
      +      expect(scope.references[3].isWrite()).to.be["false"];
      +      ast = harmony.parse("(function () {\n    var [a, b, ...[c, d, ...rest]] = array;\n}());");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      scope = scopeManager.scopes[0];
      +      globalScope = scope;
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(0);
      +      expect(scope.implicit.left).to.have.length(1);
      +      expect(scope.implicit.left[0].identifier.name).to.be.equal('array');
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(6);
      +      _ref = ['arguments', 'a', 'b', 'c', 'd', 'rest'];
      +      for (index = _i = 0, _len = _ref.length; _i < _len; index = ++_i) {
      +        name = _ref[index];
      +        expect(scope.variables[index].name).to.be.equal(name);
      +      }
      +      expect(scope.references).to.have.length(6);
      +      _ref1 = ['a', 'b', 'c', 'd', 'rest'];
      +      for (index = _j = 0, _len1 = _ref1.length; _j < _len1; index = ++_j) {
      +        name = _ref1[index];
      +        expect(scope.references[index].identifier.name).to.be.equal(name);
      +        expect(scope.references[index].isWrite()).to.be["true"];
      +        expect(scope.references[index].partial).to.be["true"];
      +      }
      +      expect(scope.references[5].identifier.name).to.be.equal('array');
      +      return expect(scope.references[5].isWrite()).to.be["false"];
      +    });
      +    it('ObjectPattern in var', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = harmony.parse("(function () {\n    var {\n        shorthand,\n        key: value,\n        hello: {\n            world\n        }\n    } = object;\n}());");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      scope = scopeManager.scopes[0];
      +      globalScope = scope;
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(0);
      +      expect(scope.implicit.left).to.have.length(1);
      +      expect(scope.implicit.left[0].identifier.name).to.be.equal('object');
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(4);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      expect(scope.variables[1].name).to.be.equal('shorthand');
      +      expect(scope.variables[2].name).to.be.equal('value');
      +      expect(scope.variables[3].name).to.be.equal('world');
      +      expect(scope.references).to.have.length(4);
      +      expect(scope.references[0].identifier.name).to.be.equal('shorthand');
      +      expect(scope.references[0].isWrite()).to.be["true"];
      +      expect(scope.references[0].partial).to.be["true"];
      +      expect(scope.references[0].resolved).to.be.equal(scope.variables[1]);
      +      expect(scope.references[1].identifier.name).to.be.equal('value');
      +      expect(scope.references[1].isWrite()).to.be["true"];
      +      expect(scope.references[1].partial).to.be["true"];
      +      expect(scope.references[1].resolved).to.be.equal(scope.variables[2]);
      +      expect(scope.references[2].identifier.name).to.be.equal('world');
      +      expect(scope.references[2].isWrite()).to.be["true"];
      +      expect(scope.references[2].partial).to.be["true"];
      +      expect(scope.references[2].resolved).to.be.equal(scope.variables[3]);
      +      expect(scope.references[3].identifier.name).to.be.equal('object');
      +      return expect(scope.references[3].isWrite()).to.be["false"];
      +    });
      +    it('complex pattern in var', function() {
      +      var ast, globalScope, index, name, scope, scopeManager, _i, _j, _len, _len1, _ref, _ref1;
      +      ast = harmony.parse("(function () {\n    var {\n        shorthand,\n        key: [ a, b, c, d, e ],\n        hello: {\n            world\n        }\n    } = object;\n}());");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      scope = scopeManager.scopes[0];
      +      globalScope = scope;
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(0);
      +      expect(scope.implicit.left).to.have.length(1);
      +      expect(scope.implicit.left[0].identifier.name).to.be.equal('object');
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(8);
      +      _ref = ['arguments', 'shorthand', 'a', 'b', 'c', 'd', 'e', 'world'];
      +      for (index = _i = 0, _len = _ref.length; _i < _len; index = ++_i) {
      +        name = _ref[index];
      +        expect(scope.variables[index].name).to.be.equal(name);
      +      }
      +      expect(scope.references).to.have.length(8);
      +      _ref1 = ['shorthand', 'a', 'b', 'c', 'd', 'e', 'world'];
      +      for (index = _j = 0, _len1 = _ref1.length; _j < _len1; index = ++_j) {
      +        name = _ref1[index];
      +        expect(scope.references[index].identifier.name).to.be.equal(name);
      +        expect(scope.references[index].isWrite()).to.be["true"];
      +        expect(scope.references[index].partial).to.be["true"];
      +      }
      +      expect(scope.references[7].identifier.name).to.be.equal('object');
      +      return expect(scope.references[7].isWrite()).to.be["false"];
      +    });
      +    it('ArrayPattern in AssignmentExpression', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = harmony.parse("(function () {\n    [a, b, c] = array;\n}());");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      scope = scopeManager.scopes[0];
      +      globalScope = scope;
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(0);
      +      expect(scope.implicit.left).to.have.length(4);
      +      expect(scope.implicit.left.map((function(_this) {
      +        return function(ref) {
      +          return ref.identifier.name;
      +        };
      +      })(this))).to.deep.equal(['a', 'b', 'c', 'array']);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      expect(scope.references).to.have.length(4);
      +      expect(scope.references[0].identifier.name).to.be.equal('a');
      +      expect(scope.references[0].isWrite()).to.be["true"];
      +      expect(scope.references[0].partial).to.be["true"];
      +      expect(scope.references[0].resolved).to.be["null"];
      +      expect(scope.references[1].identifier.name).to.be.equal('b');
      +      expect(scope.references[1].isWrite()).to.be["true"];
      +      expect(scope.references[1].partial).to.be["true"];
      +      expect(scope.references[1].resolved).to.be["null"];
      +      expect(scope.references[2].identifier.name).to.be.equal('c');
      +      expect(scope.references[2].isWrite()).to.be["true"];
      +      expect(scope.references[2].partial).to.be["true"];
      +      expect(scope.references[2].resolved).to.be["null"];
      +      expect(scope.references[3].identifier.name).to.be.equal('array');
      +      return expect(scope.references[3].isWrite()).to.be["false"];
      +    });
      +    it('SpreadElement in AssignmentExpression', function() {
      +      var ast, globalScope, index, name, scope, scopeManager, _i, _len, _ref;
      +      ast = harmony.parse("(function () {\n    [a, b, ...rest] = array;\n}());");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      scope = scopeManager.scopes[0];
      +      globalScope = scope;
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(0);
      +      expect(scope.implicit.left).to.have.length(4);
      +      expect(scope.implicit.left.map((function(_this) {
      +        return function(ref) {
      +          return ref.identifier.name;
      +        };
      +      })(this))).to.deep.equal(['a', 'b', 'rest', 'array']);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      expect(scope.references).to.have.length(4);
      +      expect(scope.references[0].identifier.name).to.be.equal('a');
      +      expect(scope.references[0].isWrite()).to.be["true"];
      +      expect(scope.references[0].partial).to.be["true"];
      +      expect(scope.references[0].resolved).to.be["null"];
      +      expect(scope.references[1].identifier.name).to.be.equal('b');
      +      expect(scope.references[1].isWrite()).to.be["true"];
      +      expect(scope.references[1].partial).to.be["true"];
      +      expect(scope.references[1].resolved).to.be["null"];
      +      expect(scope.references[2].identifier.name).to.be.equal('rest');
      +      expect(scope.references[2].isWrite()).to.be["true"];
      +      expect(scope.references[2].partial).to.be["true"];
      +      expect(scope.references[2].resolved).to.be["null"];
      +      expect(scope.references[3].identifier.name).to.be.equal('array');
      +      expect(scope.references[3].isWrite()).to.be["false"];
      +      ast = harmony.parse("(function () {\n    [a, b, ...[c, d, ...rest]] = array;\n}());");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      scope = scopeManager.scopes[0];
      +      globalScope = scope;
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(0);
      +      expect(scope.implicit.left).to.have.length(6);
      +      expect(scope.implicit.left.map((function(_this) {
      +        return function(ref) {
      +          return ref.identifier.name;
      +        };
      +      })(this))).to.deep.equal(['a', 'b', 'c', 'd', 'rest', 'array']);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      expect(scope.references).to.have.length(6);
      +      _ref = ['a', 'b', 'c', 'd', 'rest'];
      +      for (index = _i = 0, _len = _ref.length; _i < _len; index = ++_i) {
      +        name = _ref[index];
      +        expect(scope.references[index].identifier.name).to.be.equal(name);
      +        expect(scope.references[index].isWrite()).to.be["true"];
      +        expect(scope.references[index].partial).to.be["true"];
      +        expect(scope.references[index].resolved).to.be["null"];
      +      }
      +      expect(scope.references[5].identifier.name).to.be.equal('array');
      +      return expect(scope.references[5].isWrite()).to.be["false"];
      +    });
      +    it('ObjectPattern in AssignmentExpression', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = harmony.parse("(function () {\n    ({\n        shorthand,\n        key: value,\n        hello: {\n            world\n        }\n    }) = object;\n}());");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      scope = scopeManager.scopes[0];
      +      globalScope = scope;
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(0);
      +      expect(scope.implicit.left).to.have.length(4);
      +      expect(scope.implicit.left.map((function(_this) {
      +        return function(ref) {
      +          return ref.identifier.name;
      +        };
      +      })(this))).to.deep.equal(['shorthand', 'value', 'world', 'object']);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      expect(scope.references).to.have.length(4);
      +      expect(scope.references[0].identifier.name).to.be.equal('shorthand');
      +      expect(scope.references[0].isWrite()).to.be["true"];
      +      expect(scope.references[0].partial).to.be["true"];
      +      expect(scope.references[0].resolved).to["null"];
      +      expect(scope.references[1].identifier.name).to.be.equal('value');
      +      expect(scope.references[1].isWrite()).to.be["true"];
      +      expect(scope.references[1].partial).to.be["true"];
      +      expect(scope.references[1].resolved).to["null"];
      +      expect(scope.references[2].identifier.name).to.be.equal('world');
      +      expect(scope.references[2].isWrite()).to.be["true"];
      +      expect(scope.references[2].partial).to.be["true"];
      +      expect(scope.references[2].resolved).to["null"];
      +      expect(scope.references[3].identifier.name).to.be.equal('object');
      +      return expect(scope.references[3].isWrite()).to.be["false"];
      +    });
      +    it('complex pattern in AssignmentExpression', function() {
      +      var ast, globalScope, index, name, scope, scopeManager, _i, _len, _ref;
      +      ast = harmony.parse("(function () {\n    ({\n        shorthand,\n        key: [ a, b, c, d, e ],\n        hello: {\n            world\n        }\n    }) = object;\n}());");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      scope = scopeManager.scopes[0];
      +      globalScope = scope;
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(0);
      +      expect(scope.implicit.left).to.have.length(8);
      +      expect(scope.implicit.left.map((function(_this) {
      +        return function(ref) {
      +          return ref.identifier.name;
      +        };
      +      })(this))).to.deep.equal(['shorthand', 'a', 'b', 'c', 'd', 'e', 'world', 'object']);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      expect(scope.references).to.have.length(8);
      +      _ref = ['shorthand', 'a', 'b', 'c', 'd', 'e', 'world'];
      +      for (index = _i = 0, _len = _ref.length; _i < _len; index = ++_i) {
      +        name = _ref[index];
      +        expect(scope.references[index].identifier.name).to.be.equal(name);
      +        expect(scope.references[index].isWrite()).to.be["true"];
      +        expect(scope.references[index].partial).to.be["true"];
      +      }
      +      expect(scope.references[7].identifier.name).to.be.equal('object');
      +      return expect(scope.references[7].isWrite()).to.be["false"];
      +    });
      +    it('ArrayPattern in parameters', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = harmony.parse("(function ([a, b, c]) {\n}(array));");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      scope = scopeManager.scopes[0];
      +      globalScope = scope;
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(1);
      +      expect(scope.references[0].identifier.name).to.be.equal('array');
      +      expect(scope.implicit.left).to.have.length(1);
      +      expect(scope.implicit.left[0].identifier.name).to.be.equal('array');
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(4);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      expect(scope.variables[1].name).to.be.equal('a');
      +      expect(scope.variables[2].name).to.be.equal('b');
      +      expect(scope.variables[3].name).to.be.equal('c');
      +      return expect(scope.references).to.have.length(0);
      +    });
      +    it('SpreadElement in parameters', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = harmony.parse("(function ([a, b, ...rest], ...rest2) {\n}(array));");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      scope = scopeManager.scopes[0];
      +      globalScope = scope;
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(1);
      +      expect(scope.references[0].identifier.name).to.be.equal('array');
      +      expect(scope.implicit.left).to.have.length(1);
      +      expect(scope.implicit.left[0].identifier.name).to.be.equal('array');
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(5);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      expect(scope.variables[1].name).to.be.equal('a');
      +      expect(scope.variables[2].name).to.be.equal('b');
      +      expect(scope.variables[3].name).to.be.equal('rest');
      +      expect(scope.variables[3].defs[0].rest).to.be["false"];
      +      expect(scope.variables[4].name).to.be.equal('rest2');
      +      expect(scope.variables[4].defs[0].rest).to.be["true"];
      +      return expect(scope.references).to.have.length(0);
      +    });
      +    it('ObjectPattern in parameters', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = harmony.parse("(function ({\n        shorthand,\n        key: value,\n        hello: {\n            world\n        }\n    }) {\n}(object));");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      scope = scopeManager.scopes[0];
      +      globalScope = scope;
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(1);
      +      expect(scope.references[0].identifier.name).to.be.equal('object');
      +      expect(scope.implicit.left).to.have.length(1);
      +      expect(scope.implicit.left[0].identifier.name).to.be.equal('object');
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(4);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      expect(scope.variables[1].name).to.be.equal('shorthand');
      +      expect(scope.variables[2].name).to.be.equal('value');
      +      expect(scope.variables[3].name).to.be.equal('world');
      +      return expect(scope.references).to.have.length(0);
      +    });
      +    return it('complex pattern in parameters', function() {
      +      var ast, globalScope, index, name, scope, scopeManager, _i, _len, _ref;
      +      ast = harmony.parse("(function ({\n        shorthand,\n        key: [ a, b, c, d, e ],\n        hello: {\n            world\n        }\n    }) {\n}(object));");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      scope = scopeManager.scopes[0];
      +      globalScope = scope;
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(1);
      +      expect(scope.references[0].identifier.name).to.be.equal('object');
      +      expect(scope.implicit.left).to.have.length(1);
      +      expect(scope.implicit.left[0].identifier.name).to.be.equal('object');
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(8);
      +      _ref = ['arguments', 'shorthand', 'a', 'b', 'c', 'd', 'e', 'world'];
      +      for (index = _i = 0, _len = _ref.length; _i < _len; index = ++_i) {
      +        name = _ref[index];
      +        expect(scope.variables[index].name).to.be.equal(name);
      +      }
      +      return expect(scope.references).to.have.length(0);
      +    });
      +  });
      +
      +}).call(this);
      +
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVzNi1kZXN0cnVjdHVyaW5nLWFzc2lnbm1lbnRzLmNvZmZlZSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF1QkE7QUFBQSxNQUFBLHVCQUFBOztBQUFBLEVBQUEsTUFBQSxHQUFTLE9BQUEsQ0FBUyxNQUFULENBQWUsQ0FBQyxNQUF6QixDQUFBOztBQUFBLEVBQ0EsT0FBQSxHQUFVLE9BQUEsQ0FBUyx3QkFBVCxDQURWLENBQUE7O0FBQUEsRUFFQSxNQUFBLEdBQVMsT0FBQSxDQUFTLElBQVQsQ0FGVCxDQUFBOztBQUFBLEVBSUEsUUFBQSxDQUFVLCtCQUFWLEVBQTBDLFNBQUEsR0FBQTtBQUN0QyxJQUFBLEVBQUEsQ0FBSSxrQ0FBSixFQUF1QyxTQUFBLEdBQUE7QUFDbkMsVUFBQSxxQ0FBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLDBEQUFqQixDQUFOLENBQUE7QUFBQSxNQU1BLFlBQUEsR0FBZSxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsRUFBb0I7QUFBQSxRQUFBLFdBQUEsRUFBYSxDQUFiO09BQXBCLENBTmYsQ0FBQTtBQUFBLE1BT0EsTUFBQSxDQUFPLFlBQVksQ0FBQyxNQUFwQixDQUEyQixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBcEMsQ0FBMkMsQ0FBM0MsQ0FQQSxDQUFBO0FBQUEsTUFTQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBVDVCLENBQUE7QUFBQSxNQVVBLFdBQUEsR0FBYyxLQVZkLENBQUE7QUFBQSxNQVdBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsUUFBaEMsQ0FYQSxDQUFBO0FBQUEsTUFZQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBWkEsQ0FBQTtBQUFBLE1BYUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFiLENBQXdCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFqQyxDQUF3QyxDQUF4QyxDQWJBLENBQUE7QUFBQSxNQWNBLE1BQUEsQ0FBTyxLQUFLLENBQUMsUUFBUSxDQUFDLElBQXRCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQWRBLENBQUE7QUFBQSxNQWVBLE1BQUEsQ0FBTyxLQUFLLENBQUMsUUFBUSxDQUFDLElBQUssQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBekMsQ0FBOEMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXJELENBQTRELE9BQTVELENBZkEsQ0FBQTtBQUFBLE1BaUJBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FqQjVCLENBQUE7QUFBQSxNQWtCQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFVBQWhDLENBbEJBLENBQUE7QUFBQSxNQW1CQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBbkJBLENBQUE7QUFBQSxNQW9CQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsV0FBN0MsQ0FwQkEsQ0FBQTtBQUFBLE1BcUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxHQUE3QyxDQXJCQSxDQUFBO0FBQUEsTUFzQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLEdBQTdDLENBdEJBLENBQUE7QUFBQSxNQXVCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsR0FBN0MsQ0F2QkEsQ0FBQTtBQUFBLE1Bd0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsQ0F4QkEsQ0FBQTtBQUFBLE1BeUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsR0FBekQsQ0F6QkEsQ0FBQTtBQUFBLE1BMEJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLE9BQXBCLENBQUEsQ0FBUCxDQUFxQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxDQTFCM0MsQ0FBQTtBQUFBLE1BMkJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLE9BQTNCLENBQW1DLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBM0J6QyxDQUFBO0FBQUEsTUE0QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsUUFBM0IsQ0FBb0MsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQTNDLENBQWlELEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFqRSxDQTVCQSxDQUFBO0FBQUEsTUE2QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxHQUF6RCxDQTdCQSxDQUFBO0FBQUEsTUE4QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsT0FBcEIsQ0FBQSxDQUFQLENBQXFDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBOUIzQyxDQUFBO0FBQUEsTUErQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsT0FBM0IsQ0FBbUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0EvQnpDLENBQUE7QUFBQSxNQWdDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBM0MsQ0FBaUQsS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQWpFLENBaENBLENBQUE7QUFBQSxNQWlDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELEdBQXpELENBakNBLENBQUE7QUFBQSxNQWtDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxPQUFwQixDQUFBLENBQVAsQ0FBcUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0FsQzNDLENBQUE7QUFBQSxNQW1DQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxPQUEzQixDQUFtQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxDQW5DekMsQ0FBQTtBQUFBLE1Bb0NBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFFBQTNCLENBQW9DLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEzQyxDQUFpRCxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBakUsQ0FwQ0EsQ0FBQTtBQUFBLE1BcUNBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsT0FBekQsQ0FyQ0EsQ0FBQTthQXNDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxPQUFwQixDQUFBLENBQVAsQ0FBcUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE9BQUQsRUF2Q1I7SUFBQSxDQUF2QyxDQUFBLENBQUE7QUFBQSxJQTBDQSxFQUFBLENBQUkscUJBQUosRUFBMEIsU0FBQSxHQUFBO0FBQ3RCLFVBQUEscUNBQUE7QUFBQSxNQUFBLEdBQUEsR0FBTSxPQUFPLENBQUMsS0FBUixDQUFpQixtREFBakIsQ0FBTixDQUFBO0FBQUEsTUFNQSxZQUFBLEdBQWUsTUFBTSxDQUFDLE9BQVAsQ0FBZSxHQUFmLEVBQW9CO0FBQUEsUUFBQSxXQUFBLEVBQWEsQ0FBYjtPQUFwQixDQU5mLENBQUE7QUFBQSxNQU9BLE1BQUEsQ0FBTyxZQUFZLENBQUMsTUFBcEIsQ0FBMkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXBDLENBQTJDLENBQTNDLENBUEEsQ0FBQTtBQUFBLE1BU0EsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQVQ1QixDQUFBO0FBQUEsTUFVQSxXQUFBLEdBQWMsS0FWZCxDQUFBO0FBQUEsTUFXQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFFBQWhDLENBWEEsQ0FBQTtBQUFBLE1BWUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQVpBLENBQUE7QUFBQSxNQWFBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsQ0FiQSxDQUFBO0FBQUEsTUFjQSxNQUFBLENBQU8sS0FBSyxDQUFDLFFBQVEsQ0FBQyxJQUF0QixDQUEyQixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBcEMsQ0FBMkMsQ0FBM0MsQ0FkQSxDQUFBO0FBQUEsTUFlQSxNQUFBLENBQU8sS0FBSyxDQUFDLFFBQVEsQ0FBQyxJQUFLLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXpDLENBQThDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFyRCxDQUE0RCxPQUE1RCxDQWZBLENBQUE7QUFBQSxNQWlCQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBakI1QixDQUFBO0FBQUEsTUFrQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxVQUFoQyxDQWxCQSxDQUFBO0FBQUEsTUFtQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQW5CQSxDQUFBO0FBQUEsTUFvQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLFdBQTdDLENBcEJBLENBQUE7QUFBQSxNQXFCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsR0FBN0MsQ0FyQkEsQ0FBQTtBQUFBLE1Bc0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxHQUE3QyxDQXRCQSxDQUFBO0FBQUEsTUF1QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLEdBQTdDLENBdkJBLENBQUE7QUFBQSxNQXdCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBeEJBLENBQUE7QUFBQSxNQXlCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELEdBQXpELENBekJBLENBQUE7QUFBQSxNQTBCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxPQUFwQixDQUFBLENBQVAsQ0FBcUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0ExQjNDLENBQUE7QUFBQSxNQTJCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxPQUEzQixDQUFtQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxDQTNCekMsQ0FBQTtBQUFBLE1BNEJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFFBQTNCLENBQW9DLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEzQyxDQUFpRCxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBakUsQ0E1QkEsQ0FBQTtBQUFBLE1BNkJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsR0FBekQsQ0E3QkEsQ0FBQTtBQUFBLE1BOEJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLE9BQXBCLENBQUEsQ0FBUCxDQUFxQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxDQTlCM0MsQ0FBQTtBQUFBLE1BK0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLE9BQTNCLENBQW1DLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBL0J6QyxDQUFBO0FBQUEsTUFnQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsUUFBM0IsQ0FBb0MsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQTNDLENBQWlELEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFqRSxDQWhDQSxDQUFBO0FBQUEsTUFpQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxHQUF6RCxDQWpDQSxDQUFBO0FBQUEsTUFrQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsT0FBcEIsQ0FBQSxDQUFQLENBQXFDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBbEMzQyxDQUFBO0FBQUEsTUFtQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsT0FBM0IsQ0FBbUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0FuQ3pDLENBQUE7QUFBQSxNQW9DQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBM0MsQ0FBaUQsS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQWpFLENBcENBLENBQUE7QUFBQSxNQXFDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELE9BQXpELENBckNBLENBQUE7YUFzQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsT0FBcEIsQ0FBQSxDQUFQLENBQXFDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxPQUFELEVBdkNyQjtJQUFBLENBQTFCLENBMUNBLENBQUE7QUFBQSxJQW1GQSxFQUFBLENBQUksc0JBQUosRUFBMkIsU0FBQSxHQUFBO0FBQ3ZCLFVBQUEsb0ZBQUE7QUFBQSxNQUFBLEdBQUEsR0FBTSxPQUFPLENBQUMsS0FBUixDQUFpQix5REFBakIsQ0FBTixDQUFBO0FBQUEsTUFNQSxZQUFBLEdBQWUsTUFBTSxDQUFDLE9BQVAsQ0FBZSxHQUFmLEVBQW9CO0FBQUEsUUFBQSxXQUFBLEVBQWEsQ0FBYjtPQUFwQixDQU5mLENBQUE7QUFBQSxNQU9BLE1BQUEsQ0FBTyxZQUFZLENBQUMsTUFBcEIsQ0FBMkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXBDLENBQTJDLENBQTNDLENBUEEsQ0FBQTtBQUFBLE1BU0EsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQVQ1QixDQUFBO0FBQUEsTUFVQSxXQUFBLEdBQWMsS0FWZCxDQUFBO0FBQUEsTUFXQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFFBQWhDLENBWEEsQ0FBQTtBQUFBLE1BWUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQVpBLENBQUE7QUFBQSxNQWFBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsQ0FiQSxDQUFBO0FBQUEsTUFjQSxNQUFBLENBQU8sS0FBSyxDQUFDLFFBQVEsQ0FBQyxJQUF0QixDQUEyQixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBcEMsQ0FBMkMsQ0FBM0MsQ0FkQSxDQUFBO0FBQUEsTUFlQSxNQUFBLENBQU8sS0FBSyxDQUFDLFFBQVEsQ0FBQyxJQUFLLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXpDLENBQThDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFyRCxDQUE0RCxPQUE1RCxDQWZBLENBQUE7QUFBQSxNQWlCQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBakI1QixDQUFBO0FBQUEsTUFrQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxVQUFoQyxDQWxCQSxDQUFBO0FBQUEsTUFtQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQW5CQSxDQUFBO0FBQUEsTUFvQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLFdBQTdDLENBcEJBLENBQUE7QUFBQSxNQXFCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsR0FBN0MsQ0FyQkEsQ0FBQTtBQUFBLE1Bc0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxHQUE3QyxDQXRCQSxDQUFBO0FBQUEsTUF1QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLE1BQTdDLENBdkJBLENBQUE7QUFBQSxNQXdCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBeEJBLENBQUE7QUFBQSxNQXlCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELEdBQXpELENBekJBLENBQUE7QUFBQSxNQTBCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxPQUFwQixDQUFBLENBQVAsQ0FBcUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0ExQjNDLENBQUE7QUFBQSxNQTJCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxPQUEzQixDQUFtQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxDQTNCekMsQ0FBQTtBQUFBLE1BNEJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFFBQTNCLENBQW9DLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEzQyxDQUFpRCxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBakUsQ0E1QkEsQ0FBQTtBQUFBLE1BNkJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsR0FBekQsQ0E3QkEsQ0FBQTtBQUFBLE1BOEJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLE9BQXBCLENBQUEsQ0FBUCxDQUFxQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxDQTlCM0MsQ0FBQTtBQUFBLE1BK0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLE9BQTNCLENBQW1DLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBL0J6QyxDQUFBO0FBQUEsTUFnQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsUUFBM0IsQ0FBb0MsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQTNDLENBQWlELEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFqRSxDQWhDQSxDQUFBO0FBQUEsTUFpQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxNQUF6RCxDQWpDQSxDQUFBO0FBQUEsTUFrQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsT0FBcEIsQ0FBQSxDQUFQLENBQXFDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBbEMzQyxDQUFBO0FBQUEsTUFtQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsT0FBM0IsQ0FBbUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0FuQ3pDLENBQUE7QUFBQSxNQW9DQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBM0MsQ0FBaUQsS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQWpFLENBcENBLENBQUE7QUFBQSxNQXFDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELE9BQXpELENBckNBLENBQUE7QUFBQSxNQXNDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxPQUFwQixDQUFBLENBQVAsQ0FBcUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE9BQUQsQ0F0QzNDLENBQUE7QUFBQSxNQXdDQSxHQUFBLEdBQU0sT0FBTyxDQUFDLEtBQVIsQ0FBaUIsb0VBQWpCLENBeENOLENBQUE7QUFBQSxNQThDQSxZQUFBLEdBQWUsTUFBTSxDQUFDLE9BQVAsQ0FBZSxHQUFmLEVBQW9CO0FBQUEsUUFBQSxXQUFBLEVBQWEsQ0FBYjtPQUFwQixDQTlDZixDQUFBO0FBQUEsTUErQ0EsTUFBQSxDQUFPLFlBQVksQ0FBQyxNQUFwQixDQUEyQixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBcEMsQ0FBMkMsQ0FBM0MsQ0EvQ0EsQ0FBQTtBQUFBLE1BaURBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FqRDVCLENBQUE7QUFBQSxNQWtEQSxXQUFBLEdBQWMsS0FsRGQsQ0FBQTtBQUFBLE1BbURBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsUUFBaEMsQ0FuREEsQ0FBQTtBQUFBLE1Bb0RBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0FwREEsQ0FBQTtBQUFBLE1BcURBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsQ0FyREEsQ0FBQTtBQUFBLE1Bc0RBLE1BQUEsQ0FBTyxLQUFLLENBQUMsUUFBUSxDQUFDLElBQXRCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQXREQSxDQUFBO0FBQUEsTUF1REEsTUFBQSxDQUFPLEtBQUssQ0FBQyxRQUFRLENBQUMsSUFBSyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF6QyxDQUE4QyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBckQsQ0FBNEQsT0FBNUQsQ0F2REEsQ0FBQTtBQUFBLE1BeURBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0F6RDVCLENBQUE7QUFBQSxNQTBEQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFVBQWhDLENBMURBLENBQUE7QUFBQSxNQTREQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBNURBLENBQUE7QUE2REE7QUFBQSxXQUFBLDJEQUFBOzJCQUFBO0FBUUksUUFBQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxLQUFBLENBQU0sQ0FBQyxJQUE5QixDQUFtQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBMUMsQ0FBZ0QsSUFBaEQsQ0FBQSxDQVJKO0FBQUEsT0E3REE7QUFBQSxNQXVFQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBdkVBLENBQUE7QUF3RUE7QUFBQSxXQUFBLDhEQUFBOzRCQUFBO0FBT0ksUUFBQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxLQUFBLENBQU0sQ0FBQyxVQUFVLENBQUMsSUFBMUMsQ0FBK0MsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRELENBQTRELElBQTVELENBQUEsQ0FBQTtBQUFBLFFBQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsS0FBQSxDQUFNLENBQUMsT0FBeEIsQ0FBQSxDQUFQLENBQXlDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBRC9DLENBQUE7QUFBQSxRQUVBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLEtBQUEsQ0FBTSxDQUFDLE9BQS9CLENBQXVDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBRjdDLENBUEo7QUFBQSxPQXhFQTtBQUFBLE1Ba0ZBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsT0FBekQsQ0FsRkEsQ0FBQTthQW1GQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxPQUFwQixDQUFBLENBQVAsQ0FBcUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE9BQUQsRUFwRnBCO0lBQUEsQ0FBM0IsQ0FuRkEsQ0FBQTtBQUFBLElBeUtBLEVBQUEsQ0FBSSxzQkFBSixFQUEyQixTQUFBLEdBQUE7QUFDdkIsVUFBQSxxQ0FBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLDRJQUFqQixDQUFOLENBQUE7QUFBQSxNQVlBLFlBQUEsR0FBZSxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsRUFBb0I7QUFBQSxRQUFBLFdBQUEsRUFBYSxDQUFiO09BQXBCLENBWmYsQ0FBQTtBQUFBLE1BYUEsTUFBQSxDQUFPLFlBQVksQ0FBQyxNQUFwQixDQUEyQixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBcEMsQ0FBMkMsQ0FBM0MsQ0FiQSxDQUFBO0FBQUEsTUFlQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBZjVCLENBQUE7QUFBQSxNQWdCQSxXQUFBLEdBQWMsS0FoQmQsQ0FBQTtBQUFBLE1BaUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsUUFBaEMsQ0FqQkEsQ0FBQTtBQUFBLE1Ba0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0FsQkEsQ0FBQTtBQUFBLE1BbUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsQ0FuQkEsQ0FBQTtBQUFBLE1Bb0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsUUFBUSxDQUFDLElBQXRCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQXBCQSxDQUFBO0FBQUEsTUFxQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxRQUFRLENBQUMsSUFBSyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF6QyxDQUE4QyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBckQsQ0FBNEQsUUFBNUQsQ0FyQkEsQ0FBQTtBQUFBLE1BdUJBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0F2QjVCLENBQUE7QUFBQSxNQXdCQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFVBQWhDLENBeEJBLENBQUE7QUFBQSxNQXlCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBekJBLENBQUE7QUFBQSxNQTBCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsV0FBN0MsQ0ExQkEsQ0FBQTtBQUFBLE1BMkJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxXQUE3QyxDQTNCQSxDQUFBO0FBQUEsTUE0QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLE9BQTdDLENBNUJBLENBQUE7QUFBQSxNQTZCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsT0FBN0MsQ0E3QkEsQ0FBQTtBQUFBLE1BOEJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsQ0E5QkEsQ0FBQTtBQUFBLE1BK0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsV0FBekQsQ0EvQkEsQ0FBQTtBQUFBLE1BZ0NBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLE9BQXBCLENBQUEsQ0FBUCxDQUFxQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxDQWhDM0MsQ0FBQTtBQUFBLE1BaUNBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLE9BQTNCLENBQW1DLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBakN6QyxDQUFBO0FBQUEsTUFrQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsUUFBM0IsQ0FBb0MsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQTNDLENBQWlELEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFqRSxDQWxDQSxDQUFBO0FBQUEsTUFtQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxPQUF6RCxDQW5DQSxDQUFBO0FBQUEsTUFvQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsT0FBcEIsQ0FBQSxDQUFQLENBQXFDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBcEMzQyxDQUFBO0FBQUEsTUFxQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsT0FBM0IsQ0FBbUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0FyQ3pDLENBQUE7QUFBQSxNQXNDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBM0MsQ0FBaUQsS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQWpFLENBdENBLENBQUE7QUFBQSxNQXVDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELE9BQXpELENBdkNBLENBQUE7QUFBQSxNQXdDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxPQUFwQixDQUFBLENBQVAsQ0FBcUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0F4QzNDLENBQUE7QUFBQSxNQXlDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxPQUEzQixDQUFtQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxDQXpDekMsQ0FBQTtBQUFBLE1BMENBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFFBQTNCLENBQW9DLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEzQyxDQUFpRCxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBakUsQ0ExQ0EsQ0FBQTtBQUFBLE1BMkNBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsUUFBekQsQ0EzQ0EsQ0FBQTthQTRDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxPQUFwQixDQUFBLENBQVAsQ0FBcUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE9BQUQsRUE3Q3BCO0lBQUEsQ0FBM0IsQ0F6S0EsQ0FBQTtBQUFBLElBd05BLEVBQUEsQ0FBSSx3QkFBSixFQUE2QixTQUFBLEdBQUE7QUFDekIsVUFBQSxvRkFBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLHdKQUFqQixDQUFOLENBQUE7QUFBQSxNQVlBLFlBQUEsR0FBZSxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsRUFBb0I7QUFBQSxRQUFBLFdBQUEsRUFBYSxDQUFiO09BQXBCLENBWmYsQ0FBQTtBQUFBLE1BYUEsTUFBQSxDQUFPLFlBQVksQ0FBQyxNQUFwQixDQUEyQixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBcEMsQ0FBMkMsQ0FBM0MsQ0FiQSxDQUFBO0FBQUEsTUFlQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBZjVCLENBQUE7QUFBQSxNQWdCQSxXQUFBLEdBQWMsS0FoQmQsQ0FBQTtBQUFBLE1BaUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsUUFBaEMsQ0FqQkEsQ0FBQTtBQUFBLE1Ba0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0FsQkEsQ0FBQTtBQUFBLE1BbUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsQ0FuQkEsQ0FBQTtBQUFBLE1Bb0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsUUFBUSxDQUFDLElBQXRCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQXBCQSxDQUFBO0FBQUEsTUFxQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxRQUFRLENBQUMsSUFBSyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF6QyxDQUE4QyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBckQsQ0FBNEQsUUFBNUQsQ0FyQkEsQ0FBQTtBQUFBLE1BdUJBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0F2QjVCLENBQUE7QUFBQSxNQXdCQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFVBQWhDLENBeEJBLENBQUE7QUFBQSxNQXlCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBekJBLENBQUE7QUEwQkE7QUFBQSxXQUFBLDJEQUFBOzJCQUFBO0FBVUksUUFBQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxLQUFBLENBQU0sQ0FBQyxJQUE5QixDQUFtQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBMUMsQ0FBZ0QsSUFBaEQsQ0FBQSxDQVZKO0FBQUEsT0ExQkE7QUFBQSxNQXFDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBckNBLENBQUE7QUFzQ0E7QUFBQSxXQUFBLDhEQUFBOzRCQUFBO0FBU0ksUUFBQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxLQUFBLENBQU0sQ0FBQyxVQUFVLENBQUMsSUFBMUMsQ0FBK0MsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRELENBQTRELElBQTVELENBQUEsQ0FBQTtBQUFBLFFBQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsS0FBQSxDQUFNLENBQUMsT0FBeEIsQ0FBQSxDQUFQLENBQXlDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBRC9DLENBQUE7QUFBQSxRQUVBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLEtBQUEsQ0FBTSxDQUFDLE9BQS9CLENBQXVDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBRjdDLENBVEo7QUFBQSxPQXRDQTtBQUFBLE1Ba0RBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsUUFBekQsQ0FsREEsQ0FBQTthQW1EQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxPQUFwQixDQUFBLENBQVAsQ0FBcUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE9BQUQsRUFwRGxCO0lBQUEsQ0FBN0IsQ0F4TkEsQ0FBQTtBQUFBLElBOFFBLEVBQUEsQ0FBSSxzQ0FBSixFQUEyQyxTQUFBLEdBQUE7QUFDdkMsVUFBQSxxQ0FBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLCtDQUFqQixDQUFOLENBQUE7QUFBQSxNQU1BLFlBQUEsR0FBZSxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsRUFBb0I7QUFBQSxRQUFBLFdBQUEsRUFBYSxDQUFiO09BQXBCLENBTmYsQ0FBQTtBQUFBLE1BT0EsTUFBQSxDQUFPLFlBQVksQ0FBQyxNQUFwQixDQUEyQixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBcEMsQ0FBMkMsQ0FBM0MsQ0FQQSxDQUFBO0FBQUEsTUFTQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBVDVCLENBQUE7QUFBQSxNQVVBLFdBQUEsR0FBYyxLQVZkLENBQUE7QUFBQSxNQVdBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsUUFBaEMsQ0FYQSxDQUFBO0FBQUEsTUFZQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBWkEsQ0FBQTtBQUFBLE1BYUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFiLENBQXdCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFqQyxDQUF3QyxDQUF4QyxDQWJBLENBQUE7QUFBQSxNQWNBLE1BQUEsQ0FBTyxLQUFLLENBQUMsUUFBUSxDQUFDLElBQXRCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQWRBLENBQUE7QUFBQSxNQWVBLE1BQUEsQ0FBTyxLQUFLLENBQUMsUUFBUSxDQUFDLElBQUksQ0FBQyxHQUFwQixDQUF3QixDQUFBLFNBQUEsS0FBQSxHQUFBO2VBQUEsU0FBQyxHQUFELEdBQUE7aUJBQVMsR0FBRyxDQUFDLFVBQVUsQ0FBQyxLQUF4QjtRQUFBLEVBQUE7TUFBQSxDQUFBLENBQUEsQ0FBQSxJQUFBLENBQXhCLENBQVAsQ0FBNkQsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLEtBQXRFLENBQTRFLENBQ3ZFLEdBRHVFLEVBRXZFLEdBRnVFLEVBR3ZFLEdBSHVFLEVBSXZFLE9BSnVFLENBQTVFLENBZkEsQ0FBQTtBQUFBLE1Bc0JBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0F0QjVCLENBQUE7QUFBQSxNQXVCQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFVBQWhDLENBdkJBLENBQUE7QUFBQSxNQXdCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBeEJBLENBQUE7QUFBQSxNQXlCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsV0FBN0MsQ0F6QkEsQ0FBQTtBQUFBLE1BMEJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsQ0ExQkEsQ0FBQTtBQUFBLE1BMkJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsR0FBekQsQ0EzQkEsQ0FBQTtBQUFBLE1BNEJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLE9BQXBCLENBQUEsQ0FBUCxDQUFxQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxDQTVCM0MsQ0FBQTtBQUFBLE1BNkJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLE9BQTNCLENBQW1DLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBN0J6QyxDQUFBO0FBQUEsTUE4QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsUUFBM0IsQ0FBb0MsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0E5QjFDLENBQUE7QUFBQSxNQStCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELEdBQXpELENBL0JBLENBQUE7QUFBQSxNQWdDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxPQUFwQixDQUFBLENBQVAsQ0FBcUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0FoQzNDLENBQUE7QUFBQSxNQWlDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxPQUEzQixDQUFtQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxDQWpDekMsQ0FBQTtBQUFBLE1Ba0NBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFFBQTNCLENBQW9DLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBbEMxQyxDQUFBO0FBQUEsTUFtQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxHQUF6RCxDQW5DQSxDQUFBO0FBQUEsTUFvQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsT0FBcEIsQ0FBQSxDQUFQLENBQXFDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBcEMzQyxDQUFBO0FBQUEsTUFxQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsT0FBM0IsQ0FBbUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0FyQ3pDLENBQUE7QUFBQSxNQXNDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxDQXRDMUMsQ0FBQTtBQUFBLE1BdUNBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsT0FBekQsQ0F2Q0EsQ0FBQTthQXdDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxPQUFwQixDQUFBLENBQVAsQ0FBcUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE9BQUQsRUF6Q0o7SUFBQSxDQUEzQyxDQTlRQSxDQUFBO0FBQUEsSUF5VEEsRUFBQSxDQUFJLHVDQUFKLEVBQTRDLFNBQUEsR0FBQTtBQUN4QyxVQUFBLGtFQUFBO0FBQUEsTUFBQSxHQUFBLEdBQU0sT0FBTyxDQUFDLEtBQVIsQ0FBaUIscURBQWpCLENBQU4sQ0FBQTtBQUFBLE1BTUEsWUFBQSxHQUFlLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixFQUFvQjtBQUFBLFFBQUEsV0FBQSxFQUFhLENBQWI7T0FBcEIsQ0FOZixDQUFBO0FBQUEsTUFPQSxNQUFBLENBQU8sWUFBWSxDQUFDLE1BQXBCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQVBBLENBQUE7QUFBQSxNQVNBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FUNUIsQ0FBQTtBQUFBLE1BVUEsV0FBQSxHQUFjLEtBVmQsQ0FBQTtBQUFBLE1BV0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxRQUFoQyxDQVhBLENBQUE7QUFBQSxNQVlBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0FaQSxDQUFBO0FBQUEsTUFhQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBYkEsQ0FBQTtBQUFBLE1BY0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxRQUFRLENBQUMsSUFBdEIsQ0FBMkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXBDLENBQTJDLENBQTNDLENBZEEsQ0FBQTtBQUFBLE1BZUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxRQUFRLENBQUMsSUFBSSxDQUFDLEdBQXBCLENBQXdCLENBQUEsU0FBQSxLQUFBLEdBQUE7ZUFBQSxTQUFDLEdBQUQsR0FBQTtpQkFBUyxHQUFHLENBQUMsVUFBVSxDQUFDLEtBQXhCO1FBQUEsRUFBQTtNQUFBLENBQUEsQ0FBQSxDQUFBLElBQUEsQ0FBeEIsQ0FBUCxDQUE2RCxDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsS0FBdEUsQ0FBNEUsQ0FDdkUsR0FEdUUsRUFFdkUsR0FGdUUsRUFHdkUsTUFIdUUsRUFJdkUsT0FKdUUsQ0FBNUUsQ0FmQSxDQUFBO0FBQUEsTUFzQkEsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQXRCNUIsQ0FBQTtBQUFBLE1BdUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsVUFBaEMsQ0F2QkEsQ0FBQTtBQUFBLE1Bd0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0F4QkEsQ0FBQTtBQUFBLE1BeUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxXQUE3QyxDQXpCQSxDQUFBO0FBQUEsTUEwQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFiLENBQXdCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFqQyxDQUF3QyxDQUF4QyxDQTFCQSxDQUFBO0FBQUEsTUEyQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxHQUF6RCxDQTNCQSxDQUFBO0FBQUEsTUE0QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsT0FBcEIsQ0FBQSxDQUFQLENBQXFDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBNUIzQyxDQUFBO0FBQUEsTUE2QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsT0FBM0IsQ0FBbUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0E3QnpDLENBQUE7QUFBQSxNQThCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxDQTlCMUMsQ0FBQTtBQUFBLE1BK0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsR0FBekQsQ0EvQkEsQ0FBQTtBQUFBLE1BZ0NBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLE9BQXBCLENBQUEsQ0FBUCxDQUFxQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxDQWhDM0MsQ0FBQTtBQUFBLE1BaUNBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLE9BQTNCLENBQW1DLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBakN6QyxDQUFBO0FBQUEsTUFrQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsUUFBM0IsQ0FBb0MsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0FsQzFDLENBQUE7QUFBQSxNQW1DQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELE1BQXpELENBbkNBLENBQUE7QUFBQSxNQW9DQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxPQUFwQixDQUFBLENBQVAsQ0FBcUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0FwQzNDLENBQUE7QUFBQSxNQXFDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxPQUEzQixDQUFtQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxDQXJDekMsQ0FBQTtBQUFBLE1Bc0NBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFFBQTNCLENBQW9DLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBdEMxQyxDQUFBO0FBQUEsTUF1Q0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxPQUF6RCxDQXZDQSxDQUFBO0FBQUEsTUF3Q0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsT0FBcEIsQ0FBQSxDQUFQLENBQXFDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxPQUFELENBeEMzQyxDQUFBO0FBQUEsTUEwQ0EsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLGdFQUFqQixDQTFDTixDQUFBO0FBQUEsTUFnREEsWUFBQSxHQUFlLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixFQUFvQjtBQUFBLFFBQUEsV0FBQSxFQUFhLENBQWI7T0FBcEIsQ0FoRGYsQ0FBQTtBQUFBLE1BaURBLE1BQUEsQ0FBTyxZQUFZLENBQUMsTUFBcEIsQ0FBMkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXBDLENBQTJDLENBQTNDLENBakRBLENBQUE7QUFBQSxNQW1EQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBbkQ1QixDQUFBO0FBQUEsTUFvREEsV0FBQSxHQUFjLEtBcERkLENBQUE7QUFBQSxNQXFEQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFFBQWhDLENBckRBLENBQUE7QUFBQSxNQXNEQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBdERBLENBQUE7QUFBQSxNQXVEQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBdkRBLENBQUE7QUFBQSxNQXdEQSxNQUFBLENBQU8sS0FBSyxDQUFDLFFBQVEsQ0FBQyxJQUF0QixDQUEyQixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBcEMsQ0FBMkMsQ0FBM0MsQ0F4REEsQ0FBQTtBQUFBLE1BeURBLE1BQUEsQ0FBTyxLQUFLLENBQUMsUUFBUSxDQUFDLElBQUksQ0FBQyxHQUFwQixDQUF3QixDQUFBLFNBQUEsS0FBQSxHQUFBO2VBQUEsU0FBQyxHQUFELEdBQUE7aUJBQVMsR0FBRyxDQUFDLFVBQVUsQ0FBQyxLQUF4QjtRQUFBLEVBQUE7TUFBQSxDQUFBLENBQUEsQ0FBQSxJQUFBLENBQXhCLENBQVAsQ0FBNkQsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLEtBQXRFLENBQTRFLENBQ3ZFLEdBRHVFLEVBRXZFLEdBRnVFLEVBR3ZFLEdBSHVFLEVBSXZFLEdBSnVFLEVBS3ZFLE1BTHVFLEVBTXZFLE9BTnVFLENBQTVFLENBekRBLENBQUE7QUFBQSxNQWtFQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBbEU1QixDQUFBO0FBQUEsTUFtRUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxVQUFoQyxDQW5FQSxDQUFBO0FBQUEsTUFxRUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQXJFQSxDQUFBO0FBQUEsTUFzRUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLFdBQTdDLENBdEVBLENBQUE7QUFBQSxNQXdFQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBeEVBLENBQUE7QUF5RUE7QUFBQSxXQUFBLDJEQUFBOzJCQUFBO0FBT0ksUUFBQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxLQUFBLENBQU0sQ0FBQyxVQUFVLENBQUMsSUFBMUMsQ0FBK0MsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRELENBQTRELElBQTVELENBQUEsQ0FBQTtBQUFBLFFBQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsS0FBQSxDQUFNLENBQUMsT0FBeEIsQ0FBQSxDQUFQLENBQXlDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBRC9DLENBQUE7QUFBQSxRQUVBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLEtBQUEsQ0FBTSxDQUFDLE9BQS9CLENBQXVDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBRjdDLENBQUE7QUFBQSxRQUdBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLEtBQUEsQ0FBTSxDQUFDLFFBQS9CLENBQXdDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBSDlDLENBUEo7QUFBQSxPQXpFQTtBQUFBLE1Bb0ZBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsT0FBekQsQ0FwRkEsQ0FBQTthQXFGQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxPQUFwQixDQUFBLENBQVAsQ0FBcUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE9BQUQsRUF0Rkg7SUFBQSxDQUE1QyxDQXpUQSxDQUFBO0FBQUEsSUFpWkEsRUFBQSxDQUFJLHVDQUFKLEVBQTRDLFNBQUEsR0FBQTtBQUN4QyxVQUFBLHFDQUFBO0FBQUEsTUFBQSxHQUFBLEdBQU0sT0FBTyxDQUFDLEtBQVIsQ0FBaUIsMElBQWpCLENBQU4sQ0FBQTtBQUFBLE1BWUEsWUFBQSxHQUFlLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixFQUFvQjtBQUFBLFFBQUEsV0FBQSxFQUFhLENBQWI7T0FBcEIsQ0FaZixDQUFBO0FBQUEsTUFhQSxNQUFBLENBQU8sWUFBWSxDQUFDLE1BQXBCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQWJBLENBQUE7QUFBQSxNQWVBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FmNUIsQ0FBQTtBQUFBLE1BZ0JBLFdBQUEsR0FBYyxLQWhCZCxDQUFBO0FBQUEsTUFpQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxRQUFoQyxDQWpCQSxDQUFBO0FBQUEsTUFrQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQWxCQSxDQUFBO0FBQUEsTUFtQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFiLENBQXdCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFqQyxDQUF3QyxDQUF4QyxDQW5CQSxDQUFBO0FBQUEsTUFvQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxRQUFRLENBQUMsSUFBdEIsQ0FBMkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXBDLENBQTJDLENBQTNDLENBcEJBLENBQUE7QUFBQSxNQXFCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFFBQVEsQ0FBQyxJQUFJLENBQUMsR0FBcEIsQ0FBd0IsQ0FBQSxTQUFBLEtBQUEsR0FBQTtlQUFBLFNBQUMsR0FBRCxHQUFBO2lCQUFTLEdBQUcsQ0FBQyxVQUFVLENBQUMsS0FBeEI7UUFBQSxFQUFBO01BQUEsQ0FBQSxDQUFBLENBQUEsSUFBQSxDQUF4QixDQUFQLENBQTZELENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxLQUF0RSxDQUE0RSxDQUN2RSxXQUR1RSxFQUV2RSxPQUZ1RSxFQUd2RSxPQUh1RSxFQUl2RSxRQUp1RSxDQUE1RSxDQXJCQSxDQUFBO0FBQUEsTUE0QkEsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQTVCNUIsQ0FBQTtBQUFBLE1BNkJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsVUFBaEMsQ0E3QkEsQ0FBQTtBQUFBLE1BOEJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0E5QkEsQ0FBQTtBQUFBLE1BK0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxXQUE3QyxDQS9CQSxDQUFBO0FBQUEsTUFnQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFiLENBQXdCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFqQyxDQUF3QyxDQUF4QyxDQWhDQSxDQUFBO0FBQUEsTUFpQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxXQUF6RCxDQWpDQSxDQUFBO0FBQUEsTUFrQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsT0FBcEIsQ0FBQSxDQUFQLENBQXFDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBbEMzQyxDQUFBO0FBQUEsTUFtQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsT0FBM0IsQ0FBbUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0FuQ3pDLENBQUE7QUFBQSxNQW9DQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxNQUFELENBcEN2QyxDQUFBO0FBQUEsTUFxQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxPQUF6RCxDQXJDQSxDQUFBO0FBQUEsTUFzQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsT0FBcEIsQ0FBQSxDQUFQLENBQXFDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBdEMzQyxDQUFBO0FBQUEsTUF1Q0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsT0FBM0IsQ0FBbUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0F2Q3pDLENBQUE7QUFBQSxNQXdDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxNQUFELENBeEN2QyxDQUFBO0FBQUEsTUF5Q0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxPQUF6RCxDQXpDQSxDQUFBO0FBQUEsTUEwQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsT0FBcEIsQ0FBQSxDQUFQLENBQXFDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBMUMzQyxDQUFBO0FBQUEsTUEyQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsT0FBM0IsQ0FBbUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0EzQ3pDLENBQUE7QUFBQSxNQTRDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxNQUFELENBNUN2QyxDQUFBO0FBQUEsTUE2Q0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxRQUF6RCxDQTdDQSxDQUFBO2FBOENBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLE9BQXBCLENBQUEsQ0FBUCxDQUFxQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsT0FBRCxFQS9DSDtJQUFBLENBQTVDLENBalpBLENBQUE7QUFBQSxJQWtjQSxFQUFBLENBQUkseUNBQUosRUFBOEMsU0FBQSxHQUFBO0FBQzFDLFVBQUEsa0VBQUE7QUFBQSxNQUFBLEdBQUEsR0FBTSxPQUFPLENBQUMsS0FBUixDQUFpQixzSkFBakIsQ0FBTixDQUFBO0FBQUEsTUFZQSxZQUFBLEdBQWUsTUFBTSxDQUFDLE9BQVAsQ0FBZSxHQUFmLEVBQW9CO0FBQUEsUUFBQSxXQUFBLEVBQWEsQ0FBYjtPQUFwQixDQVpmLENBQUE7QUFBQSxNQWFBLE1BQUEsQ0FBTyxZQUFZLENBQUMsTUFBcEIsQ0FBMkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXBDLENBQTJDLENBQTNDLENBYkEsQ0FBQTtBQUFBLE1BZUEsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQWY1QixDQUFBO0FBQUEsTUFnQkEsV0FBQSxHQUFjLEtBaEJkLENBQUE7QUFBQSxNQWlCQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFFBQWhDLENBakJBLENBQUE7QUFBQSxNQWtCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBbEJBLENBQUE7QUFBQSxNQW1CQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBbkJBLENBQUE7QUFBQSxNQW9CQSxNQUFBLENBQU8sS0FBSyxDQUFDLFFBQVEsQ0FBQyxJQUF0QixDQUEyQixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBcEMsQ0FBMkMsQ0FBM0MsQ0FwQkEsQ0FBQTtBQUFBLE1BcUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsUUFBUSxDQUFDLElBQUksQ0FBQyxHQUFwQixDQUF3QixDQUFBLFNBQUEsS0FBQSxHQUFBO2VBQUEsU0FBQyxHQUFELEdBQUE7aUJBQVMsR0FBRyxDQUFDLFVBQVUsQ0FBQyxLQUF4QjtRQUFBLEVBQUE7TUFBQSxDQUFBLENBQUEsQ0FBQSxJQUFBLENBQXhCLENBQVAsQ0FBNkQsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLEtBQXRFLENBQTRFLENBQ3ZFLFdBRHVFLEVBRXZFLEdBRnVFLEVBR3ZFLEdBSHVFLEVBSXZFLEdBSnVFLEVBS3ZFLEdBTHVFLEVBTXZFLEdBTnVFLEVBT3ZFLE9BUHVFLEVBUXZFLFFBUnVFLENBQTVFLENBckJBLENBQUE7QUFBQSxNQWdDQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBaEM1QixDQUFBO0FBQUEsTUFpQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxVQUFoQyxDQWpDQSxDQUFBO0FBQUEsTUFrQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQWxDQSxDQUFBO0FBQUEsTUFtQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLFdBQTdDLENBbkNBLENBQUE7QUFBQSxNQW9DQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBcENBLENBQUE7QUFxQ0E7QUFBQSxXQUFBLDJEQUFBOzJCQUFBO0FBU0ksUUFBQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxLQUFBLENBQU0sQ0FBQyxVQUFVLENBQUMsSUFBMUMsQ0FBK0MsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRELENBQTRELElBQTVELENBQUEsQ0FBQTtBQUFBLFFBQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsS0FBQSxDQUFNLENBQUMsT0FBeEIsQ0FBQSxDQUFQLENBQXlDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBRC9DLENBQUE7QUFBQSxRQUVBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLEtBQUEsQ0FBTSxDQUFDLE9BQS9CLENBQXVDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBRjdDLENBVEo7QUFBQSxPQXJDQTtBQUFBLE1BaURBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsUUFBekQsQ0FqREEsQ0FBQTthQWtEQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxPQUFwQixDQUFBLENBQVAsQ0FBcUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE9BQUQsRUFuREQ7SUFBQSxDQUE5QyxDQWxjQSxDQUFBO0FBQUEsSUF1ZkEsRUFBQSxDQUFJLDRCQUFKLEVBQWlDLFNBQUEsR0FBQTtBQUM3QixVQUFBLHFDQUFBO0FBQUEsTUFBQSxHQUFBLEdBQU0sT0FBTyxDQUFDLEtBQVIsQ0FBaUIscUNBQWpCLENBQU4sQ0FBQTtBQUFBLE1BS0EsWUFBQSxHQUFlLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixFQUFvQjtBQUFBLFFBQUEsV0FBQSxFQUFhLENBQWI7T0FBcEIsQ0FMZixDQUFBO0FBQUEsTUFNQSxNQUFBLENBQU8sWUFBWSxDQUFDLE1BQXBCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQU5BLENBQUE7QUFBQSxNQVFBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FSNUIsQ0FBQTtBQUFBLE1BU0EsV0FBQSxHQUFjLEtBVGQsQ0FBQTtBQUFBLE1BVUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxRQUFoQyxDQVZBLENBQUE7QUFBQSxNQVdBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0FYQSxDQUFBO0FBQUEsTUFZQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBWkEsQ0FBQTtBQUFBLE1BYUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxPQUF6RCxDQWJBLENBQUE7QUFBQSxNQWNBLE1BQUEsQ0FBTyxLQUFLLENBQUMsUUFBUSxDQUFDLElBQXRCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQWRBLENBQUE7QUFBQSxNQWVBLE1BQUEsQ0FBTyxLQUFLLENBQUMsUUFBUSxDQUFDLElBQUssQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBekMsQ0FBOEMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXJELENBQTRELE9BQTVELENBZkEsQ0FBQTtBQUFBLE1BaUJBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FqQjVCLENBQUE7QUFBQSxNQWtCQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFVBQWhDLENBbEJBLENBQUE7QUFBQSxNQW1CQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBbkJBLENBQUE7QUFBQSxNQW9CQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsV0FBN0MsQ0FwQkEsQ0FBQTtBQUFBLE1BcUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxHQUE3QyxDQXJCQSxDQUFBO0FBQUEsTUFzQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLEdBQTdDLENBdEJBLENBQUE7QUFBQSxNQXVCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsR0FBN0MsQ0F2QkEsQ0FBQTthQXdCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLEVBekI2QjtJQUFBLENBQWpDLENBdmZBLENBQUE7QUFBQSxJQWtoQkEsRUFBQSxDQUFJLDZCQUFKLEVBQWtDLFNBQUEsR0FBQTtBQUM5QixVQUFBLHFDQUFBO0FBQUEsTUFBQSxHQUFBLEdBQU0sT0FBTyxDQUFDLEtBQVIsQ0FBaUIscURBQWpCLENBQU4sQ0FBQTtBQUFBLE1BS0EsWUFBQSxHQUFlLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixFQUFvQjtBQUFBLFFBQUEsV0FBQSxFQUFhLENBQWI7T0FBcEIsQ0FMZixDQUFBO0FBQUEsTUFNQSxNQUFBLENBQU8sWUFBWSxDQUFDLE1BQXBCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQU5BLENBQUE7QUFBQSxNQVFBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FSNUIsQ0FBQTtBQUFBLE1BU0EsV0FBQSxHQUFjLEtBVGQsQ0FBQTtBQUFBLE1BVUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxRQUFoQyxDQVZBLENBQUE7QUFBQSxNQVdBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0FYQSxDQUFBO0FBQUEsTUFZQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBWkEsQ0FBQTtBQUFBLE1BYUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxPQUF6RCxDQWJBLENBQUE7QUFBQSxNQWNBLE1BQUEsQ0FBTyxLQUFLLENBQUMsUUFBUSxDQUFDLElBQXRCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQWRBLENBQUE7QUFBQSxNQWVBLE1BQUEsQ0FBTyxLQUFLLENBQUMsUUFBUSxDQUFDLElBQUssQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBekMsQ0FBOEMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXJELENBQTRELE9BQTVELENBZkEsQ0FBQTtBQUFBLE1BaUJBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FqQjVCLENBQUE7QUFBQSxNQWtCQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFVBQWhDLENBbEJBLENBQUE7QUFBQSxNQW1CQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBbkJBLENBQUE7QUFBQSxNQW9CQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsV0FBN0MsQ0FwQkEsQ0FBQTtBQUFBLE1BcUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxHQUE3QyxDQXJCQSxDQUFBO0FBQUEsTUFzQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLEdBQTdDLENBdEJBLENBQUE7QUFBQSxNQXVCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsTUFBN0MsQ0F2QkEsQ0FBQTtBQUFBLE1Bd0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQUssQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUFsQyxDQUF1QyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsT0FBRCxDQXhCN0MsQ0FBQTtBQUFBLE1BeUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxPQUE3QyxDQXpCQSxDQUFBO0FBQUEsTUEwQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBSyxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQWxDLENBQXVDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELENBMUI3QyxDQUFBO2FBMkJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsRUE1QjhCO0lBQUEsQ0FBbEMsQ0FsaEJBLENBQUE7QUFBQSxJQTRsQkEsRUFBQSxDQUFJLDZCQUFKLEVBQWtDLFNBQUEsR0FBQTtBQUM5QixVQUFBLHFDQUFBO0FBQUEsTUFBQSxHQUFBLEdBQU0sT0FBTyxDQUFDLEtBQVIsQ0FBaUIsOEhBQWpCLENBQU4sQ0FBQTtBQUFBLE1BV0EsWUFBQSxHQUFlLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixFQUFvQjtBQUFBLFFBQUEsV0FBQSxFQUFhLENBQWI7T0FBcEIsQ0FYZixDQUFBO0FBQUEsTUFZQSxNQUFBLENBQU8sWUFBWSxDQUFDLE1BQXBCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQVpBLENBQUE7QUFBQSxNQWNBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FkNUIsQ0FBQTtBQUFBLE1BZUEsV0FBQSxHQUFjLEtBZmQsQ0FBQTtBQUFBLE1BZ0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsUUFBaEMsQ0FoQkEsQ0FBQTtBQUFBLE1BaUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0FqQkEsQ0FBQTtBQUFBLE1Ba0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsQ0FsQkEsQ0FBQTtBQUFBLE1BbUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsUUFBekQsQ0FuQkEsQ0FBQTtBQUFBLE1Bb0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsUUFBUSxDQUFDLElBQXRCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQXBCQSxDQUFBO0FBQUEsTUFxQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxRQUFRLENBQUMsSUFBSyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF6QyxDQUE4QyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBckQsQ0FBNEQsUUFBNUQsQ0FyQkEsQ0FBQTtBQUFBLE1BdUJBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0F2QjVCLENBQUE7QUFBQSxNQXdCQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFVBQWhDLENBeEJBLENBQUE7QUFBQSxNQXlCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBekJBLENBQUE7QUFBQSxNQTBCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsV0FBN0MsQ0ExQkEsQ0FBQTtBQUFBLE1BMkJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxXQUE3QyxDQTNCQSxDQUFBO0FBQUEsTUE0QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLE9BQTdDLENBNUJBLENBQUE7QUFBQSxNQTZCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsT0FBN0MsQ0E3QkEsQ0FBQTthQThCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLEVBL0I4QjtJQUFBLENBQWxDLENBNWxCQSxDQUFBO1dBNm5CQSxFQUFBLENBQUksK0JBQUosRUFBb0MsU0FBQSxHQUFBO0FBQ2hDLFVBQUEsa0VBQUE7QUFBQSxNQUFBLEdBQUEsR0FBTSxPQUFPLENBQUMsS0FBUixDQUFpQiwwSUFBakIsQ0FBTixDQUFBO0FBQUEsTUFXQSxZQUFBLEdBQWUsTUFBTSxDQUFDLE9BQVAsQ0FBZSxHQUFmLEVBQW9CO0FBQUEsUUFBQSxXQUFBLEVBQWEsQ0FBYjtPQUFwQixDQVhmLENBQUE7QUFBQSxNQVlBLE1BQUEsQ0FBTyxZQUFZLENBQUMsTUFBcEIsQ0FBMkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXBDLENBQTJDLENBQTNDLENBWkEsQ0FBQTtBQUFBLE1BY0EsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQWQ1QixDQUFBO0FBQUEsTUFlQSxXQUFBLEdBQWMsS0FmZCxDQUFBO0FBQUEsTUFnQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxRQUFoQyxDQWhCQSxDQUFBO0FBQUEsTUFpQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQWpCQSxDQUFBO0FBQUEsTUFrQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFiLENBQXdCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFqQyxDQUF3QyxDQUF4QyxDQWxCQSxDQUFBO0FBQUEsTUFtQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxRQUF6RCxDQW5CQSxDQUFBO0FBQUEsTUFvQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxRQUFRLENBQUMsSUFBdEIsQ0FBMkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXBDLENBQTJDLENBQTNDLENBcEJBLENBQUE7QUFBQSxNQXFCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFFBQVEsQ0FBQyxJQUFLLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXpDLENBQThDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFyRCxDQUE0RCxRQUE1RCxDQXJCQSxDQUFBO0FBQUEsTUF1QkEsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQXZCNUIsQ0FBQTtBQUFBLE1Bd0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsVUFBaEMsQ0F4QkEsQ0FBQTtBQUFBLE1BeUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0F6QkEsQ0FBQTtBQTBCQTtBQUFBLFdBQUEsMkRBQUE7MkJBQUE7QUFVSSxRQUFBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLEtBQUEsQ0FBTSxDQUFDLElBQTlCLENBQW1DLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUExQyxDQUFnRCxJQUFoRCxDQUFBLENBVko7QUFBQSxPQTFCQTthQXFDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLEVBdENnQztJQUFBLENBQXBDLEVBOW5Cc0M7RUFBQSxDQUExQyxDQUpBLENBQUE7QUFBQSIsImZpbGUiOiJlczYtZGVzdHJ1Y3R1cmluZy1hc3NpZ25tZW50cy5qcyIsInNvdXJjZVJvb3QiOiIvc291cmNlLyIsInNvdXJjZXNDb250ZW50IjpbIiMgLSotIGNvZGluZzogdXRmLTggLSotXG4jICBDb3B5cmlnaHQgKEMpIDIwMTQgWXVzdWtlIFN1enVraSA8dXRhdGFuZS50ZWFAZ21haWwuY29tPlxuI1xuIyAgUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0XG4jICBtb2RpZmljYXRpb24sIGFyZSBwZXJtaXR0ZWQgcHJvdmlkZWQgdGhhdCB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnMgYXJlIG1ldDpcbiNcbiMgICAgKiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodFxuIyAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lci5cbiMgICAgKiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodFxuIyAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lciBpbiB0aGVcbiMgICAgICBkb2N1bWVudGF0aW9uIGFuZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQgd2l0aCB0aGUgZGlzdHJpYnV0aW9uLlxuI1xuIyAgVEhJUyBTT0ZUV0FSRSBJUyBQUk9WSURFRCBCWSBUSEUgQ09QWVJJR0hUIEhPTERFUlMgQU5EIENPTlRSSUJVVE9SUyBcIkFTIElTXCJcbiMgIEFORCBBTlkgRVhQUkVTUyBPUiBJTVBMSUVEIFdBUlJBTlRJRVMsIElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBUSEVcbiMgIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFXG4jICBBUkUgRElTQ0xBSU1FRC4gSU4gTk8gRVZFTlQgU0hBTEwgPENPUFlSSUdIVCBIT0xERVI+IEJFIExJQUJMRSBGT1IgQU5ZXG4jICBESVJFQ1QsIElORElSRUNULCBJTkNJREVOVEFMLCBTUEVDSUFMLCBFWEVNUExBUlksIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFU1xuIyAgKElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTO1xuIyAgTE9TUyBPRiBVU0UsIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EXG4jICBPTiBBTlkgVEhFT1JZIE9GIExJQUJJTElUWSwgV0hFVEhFUiBJTiBDT05UUkFDVCwgU1RSSUNUIExJQUJJTElUWSwgT1IgVE9SVFxuIyAgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFIE9GXG4jICBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLlxuXG5leHBlY3QgPSByZXF1aXJlKCdjaGFpJykuZXhwZWN0XG5oYXJtb255ID0gcmVxdWlyZSAnLi4vdGhpcmRfcGFydHkvZXNwcmltYSdcbmVzY29wZSA9IHJlcXVpcmUgJy4uJ1xuXG5kZXNjcmliZSAnRVM2IGRlc3RydWN0dXJpbmcgYXNzaWdubWVudHMnLCAtPlxuICAgIGl0ICdQYXR0ZXJuIGluIHZhciBpbiBGb3JJblN0YXRlbWVudCcsIC0+XG4gICAgICAgIGFzdCA9IGhhcm1vbnkucGFyc2UgXCJcIlwiXG4gICAgICAgIChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBmb3IgKHZhciBbYSwgYiwgY10gaW4gYXJyYXkpO1xuICAgICAgICB9KCkpO1xuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3QsIGVjbWFWZXJzaW9uOiA2XG4gICAgICAgIGV4cGVjdChzY29wZU1hbmFnZXIuc2NvcGVzKS50by5oYXZlLmxlbmd0aCAyXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzBdXG4gICAgICAgIGdsb2JhbFNjb3BlID0gc2NvcGVcbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KHNjb3BlLmltcGxpY2l0LmxlZnQpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLmltcGxpY2l0LmxlZnRbMF0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnYXJyYXknXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzFdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZnVuY3Rpb24nXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDRcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5uYW1lKS50by5iZS5lcXVhbCAnYXJndW1lbnRzJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzFdLm5hbWUpLnRvLmJlLmVxdWFsICdhJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzJdLm5hbWUpLnRvLmJlLmVxdWFsICdiJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzNdLm5hbWUpLnRvLmJlLmVxdWFsICdjJ1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggNFxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1swXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsICdhJ1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1swXS5pc1dyaXRlKCkpLnRvLmJlLnRydWVcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMF0ucGFydGlhbCkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1swXS5yZXNvbHZlZCkudG8uYmUuZXF1YWwgc2NvcGUudmFyaWFibGVzWzFdXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2InXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLmlzV3JpdGUoKSkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1sxXS5wYXJ0aWFsKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLnJlc29sdmVkKS50by5iZS5lcXVhbCBzY29wZS52YXJpYWJsZXNbMl1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMl0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnYydcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMl0uaXNXcml0ZSgpKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzJdLnBhcnRpYWwpLnRvLmJlLnRydWVcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMl0ucmVzb2x2ZWQpLnRvLmJlLmVxdWFsIHNjb3BlLnZhcmlhYmxlc1szXVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1szXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsICdhcnJheSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbM10uaXNXcml0ZSgpKS50by5iZS5mYWxzZVxuXG5cbiAgICBpdCAnQXJyYXlQYXR0ZXJuIGluIHZhcicsIC0+XG4gICAgICAgIGFzdCA9IGhhcm1vbnkucGFyc2UgXCJcIlwiXG4gICAgICAgIChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgW2EsIGIsIGNdID0gYXJyYXk7XG4gICAgICAgIH0oKSk7XG4gICAgICAgIFwiXCJcIlxuXG4gICAgICAgIHNjb3BlTWFuYWdlciA9IGVzY29wZS5hbmFseXplIGFzdCwgZWNtYVZlcnNpb246IDZcbiAgICAgICAgZXhwZWN0KHNjb3BlTWFuYWdlci5zY29wZXMpLnRvLmhhdmUubGVuZ3RoIDJcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMF1cbiAgICAgICAgZ2xvYmFsU2NvcGUgPSBzY29wZVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2dsb2JhbCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMFxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggMFxuICAgICAgICBleHBlY3Qoc2NvcGUuaW1wbGljaXQubGVmdCkudG8uaGF2ZS5sZW5ndGggMVxuICAgICAgICBleHBlY3Qoc2NvcGUuaW1wbGljaXQubGVmdFswXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsICdhcnJheSdcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdmdW5jdGlvbidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggNFxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICdhcmd1bWVudHMnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMV0ubmFtZSkudG8uYmUuZXF1YWwgJ2EnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMl0ubmFtZSkudG8uYmUuZXF1YWwgJ2InXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbM10ubmFtZSkudG8uYmUuZXF1YWwgJ2MnXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCA0XG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2EnXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLmlzV3JpdGUoKSkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1swXS5wYXJ0aWFsKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLnJlc29sdmVkKS50by5iZS5lcXVhbCBzY29wZS52YXJpYWJsZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMV0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnYidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMV0uaXNXcml0ZSgpKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLnBhcnRpYWwpLnRvLmJlLnRydWVcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMV0ucmVzb2x2ZWQpLnRvLmJlLmVxdWFsIHNjb3BlLnZhcmlhYmxlc1syXVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1syXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsICdjJ1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1syXS5pc1dyaXRlKCkpLnRvLmJlLnRydWVcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMl0ucGFydGlhbCkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1syXS5yZXNvbHZlZCkudG8uYmUuZXF1YWwgc2NvcGUudmFyaWFibGVzWzNdXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzNdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2FycmF5J1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1szXS5pc1dyaXRlKCkpLnRvLmJlLmZhbHNlXG5cbiAgICBpdCAnU3ByZWFkRWxlbWVudCBpbiB2YXInLCAtPlxuICAgICAgICBhc3QgPSBoYXJtb255LnBhcnNlIFwiXCJcIlxuICAgICAgICAoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIFthLCBiLCAuLi5yZXN0XSA9IGFycmF5O1xuICAgICAgICB9KCkpO1xuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3QsIGVjbWFWZXJzaW9uOiA2XG4gICAgICAgIGV4cGVjdChzY29wZU1hbmFnZXIuc2NvcGVzKS50by5oYXZlLmxlbmd0aCAyXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzBdXG4gICAgICAgIGdsb2JhbFNjb3BlID0gc2NvcGVcbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KHNjb3BlLmltcGxpY2l0LmxlZnQpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLmltcGxpY2l0LmxlZnRbMF0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnYXJyYXknXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzFdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZnVuY3Rpb24nXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDRcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5uYW1lKS50by5iZS5lcXVhbCAnYXJndW1lbnRzJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzFdLm5hbWUpLnRvLmJlLmVxdWFsICdhJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzJdLm5hbWUpLnRvLmJlLmVxdWFsICdiJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzNdLm5hbWUpLnRvLmJlLmVxdWFsICdyZXN0J1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggNFxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1swXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsICdhJ1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1swXS5pc1dyaXRlKCkpLnRvLmJlLnRydWVcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMF0ucGFydGlhbCkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1swXS5yZXNvbHZlZCkudG8uYmUuZXF1YWwgc2NvcGUudmFyaWFibGVzWzFdXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2InXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLmlzV3JpdGUoKSkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1sxXS5wYXJ0aWFsKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLnJlc29sdmVkKS50by5iZS5lcXVhbCBzY29wZS52YXJpYWJsZXNbMl1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMl0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAncmVzdCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMl0uaXNXcml0ZSgpKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzJdLnBhcnRpYWwpLnRvLmJlLnRydWVcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMl0ucmVzb2x2ZWQpLnRvLmJlLmVxdWFsIHNjb3BlLnZhcmlhYmxlc1szXVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1szXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsICdhcnJheSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbM10uaXNXcml0ZSgpKS50by5iZS5mYWxzZVxuXG4gICAgICAgIGFzdCA9IGhhcm1vbnkucGFyc2UgXCJcIlwiXG4gICAgICAgIChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgW2EsIGIsIC4uLltjLCBkLCAuLi5yZXN0XV0gPSBhcnJheTtcbiAgICAgICAgfSgpKTtcbiAgICAgICAgXCJcIlwiXG5cbiAgICAgICAgc2NvcGVNYW5hZ2VyID0gZXNjb3BlLmFuYWx5emUgYXN0LCBlY21hVmVyc2lvbjogNlxuICAgICAgICBleHBlY3Qoc2NvcGVNYW5hZ2VyLnNjb3BlcykudG8uaGF2ZS5sZW5ndGggMlxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1swXVxuICAgICAgICBnbG9iYWxTY29wZSA9IHNjb3BlXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZ2xvYmFsJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgIGV4cGVjdChzY29wZS5pbXBsaWNpdC5sZWZ0KS50by5oYXZlLmxlbmd0aCAxXG4gICAgICAgIGV4cGVjdChzY29wZS5pbXBsaWNpdC5sZWZ0WzBdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2FycmF5J1xuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1sxXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2Z1bmN0aW9uJ1xuXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDZcbiAgICAgICAgZm9yIG5hbWUsIGluZGV4IGluIFtcbiAgICAgICAgICAgICAgICAnYXJndW1lbnRzJ1xuICAgICAgICAgICAgICAgICdhJ1xuICAgICAgICAgICAgICAgICdiJ1xuICAgICAgICAgICAgICAgICdjJ1xuICAgICAgICAgICAgICAgICdkJ1xuICAgICAgICAgICAgICAgICdyZXN0J1xuICAgICAgICAgICAgXVxuICAgICAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1tpbmRleF0ubmFtZSkudG8uYmUuZXF1YWwgbmFtZVxuXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCA2XG4gICAgICAgIGZvciBuYW1lLCBpbmRleCBpbiBbXG4gICAgICAgICAgICAgICAgJ2EnXG4gICAgICAgICAgICAgICAgJ2InXG4gICAgICAgICAgICAgICAgJ2MnXG4gICAgICAgICAgICAgICAgJ2QnXG4gICAgICAgICAgICAgICAgJ3Jlc3QnXG4gICAgICAgICAgICBdXG4gICAgICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1tpbmRleF0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCBuYW1lXG4gICAgICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1tpbmRleF0uaXNXcml0ZSgpKS50by5iZS50cnVlXG4gICAgICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1tpbmRleF0ucGFydGlhbCkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1s1XS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsICdhcnJheSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbNV0uaXNXcml0ZSgpKS50by5iZS5mYWxzZVxuXG4gICAgaXQgJ09iamVjdFBhdHRlcm4gaW4gdmFyJywgLT5cbiAgICAgICAgYXN0ID0gaGFybW9ueS5wYXJzZSBcIlwiXCJcbiAgICAgICAgKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciB7XG4gICAgICAgICAgICAgICAgc2hvcnRoYW5kLFxuICAgICAgICAgICAgICAgIGtleTogdmFsdWUsXG4gICAgICAgICAgICAgICAgaGVsbG86IHtcbiAgICAgICAgICAgICAgICAgICAgd29ybGRcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9ID0gb2JqZWN0O1xuICAgICAgICB9KCkpO1xuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3QsIGVjbWFWZXJzaW9uOiA2XG4gICAgICAgIGV4cGVjdChzY29wZU1hbmFnZXIuc2NvcGVzKS50by5oYXZlLmxlbmd0aCAyXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzBdXG4gICAgICAgIGdsb2JhbFNjb3BlID0gc2NvcGVcbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KHNjb3BlLmltcGxpY2l0LmxlZnQpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLmltcGxpY2l0LmxlZnRbMF0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnb2JqZWN0J1xuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1sxXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2Z1bmN0aW9uJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCA0XG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwgJ2FyZ3VtZW50cydcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1sxXS5uYW1lKS50by5iZS5lcXVhbCAnc2hvcnRoYW5kJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzJdLm5hbWUpLnRvLmJlLmVxdWFsICd2YWx1ZSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1szXS5uYW1lKS50by5iZS5lcXVhbCAnd29ybGQnXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCA0XG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ3Nob3J0aGFuZCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMF0uaXNXcml0ZSgpKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLnBhcnRpYWwpLnRvLmJlLnRydWVcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMF0ucmVzb2x2ZWQpLnRvLmJlLmVxdWFsIHNjb3BlLnZhcmlhYmxlc1sxXVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1sxXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsICd2YWx1ZSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMV0uaXNXcml0ZSgpKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLnBhcnRpYWwpLnRvLmJlLnRydWVcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMV0ucmVzb2x2ZWQpLnRvLmJlLmVxdWFsIHNjb3BlLnZhcmlhYmxlc1syXVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1syXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsICd3b3JsZCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMl0uaXNXcml0ZSgpKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzJdLnBhcnRpYWwpLnRvLmJlLnRydWVcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMl0ucmVzb2x2ZWQpLnRvLmJlLmVxdWFsIHNjb3BlLnZhcmlhYmxlc1szXVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1szXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsICdvYmplY3QnXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzNdLmlzV3JpdGUoKSkudG8uYmUuZmFsc2VcblxuICAgIGl0ICdjb21wbGV4IHBhdHRlcm4gaW4gdmFyJywgLT5cbiAgICAgICAgYXN0ID0gaGFybW9ueS5wYXJzZSBcIlwiXCJcbiAgICAgICAgKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciB7XG4gICAgICAgICAgICAgICAgc2hvcnRoYW5kLFxuICAgICAgICAgICAgICAgIGtleTogWyBhLCBiLCBjLCBkLCBlIF0sXG4gICAgICAgICAgICAgICAgaGVsbG86IHtcbiAgICAgICAgICAgICAgICAgICAgd29ybGRcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9ID0gb2JqZWN0O1xuICAgICAgICB9KCkpO1xuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3QsIGVjbWFWZXJzaW9uOiA2XG4gICAgICAgIGV4cGVjdChzY29wZU1hbmFnZXIuc2NvcGVzKS50by5oYXZlLmxlbmd0aCAyXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzBdXG4gICAgICAgIGdsb2JhbFNjb3BlID0gc2NvcGVcbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KHNjb3BlLmltcGxpY2l0LmxlZnQpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLmltcGxpY2l0LmxlZnRbMF0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnb2JqZWN0J1xuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1sxXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2Z1bmN0aW9uJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCA4XG4gICAgICAgIGZvciBuYW1lLCBpbmRleCBpbiBbXG4gICAgICAgICAgICAgICAgJ2FyZ3VtZW50cydcbiAgICAgICAgICAgICAgICAnc2hvcnRoYW5kJ1xuICAgICAgICAgICAgICAgICdhJ1xuICAgICAgICAgICAgICAgICdiJ1xuICAgICAgICAgICAgICAgICdjJ1xuICAgICAgICAgICAgICAgICdkJ1xuICAgICAgICAgICAgICAgICdlJ1xuICAgICAgICAgICAgICAgICd3b3JsZCdcbiAgICAgICAgICAgIF1cbiAgICAgICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbaW5kZXhdLm5hbWUpLnRvLmJlLmVxdWFsIG5hbWVcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDhcbiAgICAgICAgZm9yIG5hbWUsIGluZGV4IGluIFtcbiAgICAgICAgICAgICAgICAnc2hvcnRoYW5kJ1xuICAgICAgICAgICAgICAgICdhJ1xuICAgICAgICAgICAgICAgICdiJ1xuICAgICAgICAgICAgICAgICdjJ1xuICAgICAgICAgICAgICAgICdkJ1xuICAgICAgICAgICAgICAgICdlJ1xuICAgICAgICAgICAgICAgICd3b3JsZCdcbiAgICAgICAgICAgIF1cbiAgICAgICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzW2luZGV4XS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsIG5hbWVcbiAgICAgICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzW2luZGV4XS5pc1dyaXRlKCkpLnRvLmJlLnRydWVcbiAgICAgICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzW2luZGV4XS5wYXJ0aWFsKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzddLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ29iamVjdCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbN10uaXNXcml0ZSgpKS50by5iZS5mYWxzZVxuXG4gICAgaXQgJ0FycmF5UGF0dGVybiBpbiBBc3NpZ25tZW50RXhwcmVzc2lvbicsIC0+XG4gICAgICAgIGFzdCA9IGhhcm1vbnkucGFyc2UgXCJcIlwiXG4gICAgICAgIChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBbYSwgYiwgY10gPSBhcnJheTtcbiAgICAgICAgfSgpKTtcbiAgICAgICAgXCJcIlwiXG5cbiAgICAgICAgc2NvcGVNYW5hZ2VyID0gZXNjb3BlLmFuYWx5emUgYXN0LCBlY21hVmVyc2lvbjogNlxuICAgICAgICBleHBlY3Qoc2NvcGVNYW5hZ2VyLnNjb3BlcykudG8uaGF2ZS5sZW5ndGggMlxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1swXVxuICAgICAgICBnbG9iYWxTY29wZSA9IHNjb3BlXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZ2xvYmFsJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgIGV4cGVjdChzY29wZS5pbXBsaWNpdC5sZWZ0KS50by5oYXZlLmxlbmd0aCA0XG4gICAgICAgIGV4cGVjdChzY29wZS5pbXBsaWNpdC5sZWZ0Lm1hcCgocmVmKSA9PiByZWYuaWRlbnRpZmllci5uYW1lKSkudG8uZGVlcC5lcXVhbCBbXG4gICAgICAgICAgICAnYSdcbiAgICAgICAgICAgICdiJ1xuICAgICAgICAgICAgJ2MnXG4gICAgICAgICAgICAnYXJyYXknXG4gICAgICAgIF1cblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdmdW5jdGlvbidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICdhcmd1bWVudHMnXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCA0XG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2EnXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLmlzV3JpdGUoKSkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1swXS5wYXJ0aWFsKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLnJlc29sdmVkKS50by5iZS5udWxsXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2InXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLmlzV3JpdGUoKSkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1sxXS5wYXJ0aWFsKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLnJlc29sdmVkKS50by5iZS5udWxsXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzJdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2MnXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzJdLmlzV3JpdGUoKSkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1syXS5wYXJ0aWFsKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzJdLnJlc29sdmVkKS50by5iZS5udWxsXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzNdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2FycmF5J1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1szXS5pc1dyaXRlKCkpLnRvLmJlLmZhbHNlXG5cbiAgICBpdCAnU3ByZWFkRWxlbWVudCBpbiBBc3NpZ25tZW50RXhwcmVzc2lvbicsIC0+XG4gICAgICAgIGFzdCA9IGhhcm1vbnkucGFyc2UgXCJcIlwiXG4gICAgICAgIChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBbYSwgYiwgLi4ucmVzdF0gPSBhcnJheTtcbiAgICAgICAgfSgpKTtcbiAgICAgICAgXCJcIlwiXG5cbiAgICAgICAgc2NvcGVNYW5hZ2VyID0gZXNjb3BlLmFuYWx5emUgYXN0LCBlY21hVmVyc2lvbjogNlxuICAgICAgICBleHBlY3Qoc2NvcGVNYW5hZ2VyLnNjb3BlcykudG8uaGF2ZS5sZW5ndGggMlxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1swXVxuICAgICAgICBnbG9iYWxTY29wZSA9IHNjb3BlXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZ2xvYmFsJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgIGV4cGVjdChzY29wZS5pbXBsaWNpdC5sZWZ0KS50by5oYXZlLmxlbmd0aCA0XG4gICAgICAgIGV4cGVjdChzY29wZS5pbXBsaWNpdC5sZWZ0Lm1hcCgocmVmKSA9PiByZWYuaWRlbnRpZmllci5uYW1lKSkudG8uZGVlcC5lcXVhbCBbXG4gICAgICAgICAgICAnYSdcbiAgICAgICAgICAgICdiJ1xuICAgICAgICAgICAgJ3Jlc3QnXG4gICAgICAgICAgICAnYXJyYXknXG4gICAgICAgIF1cblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdmdW5jdGlvbidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICdhcmd1bWVudHMnXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCA0XG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2EnXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLmlzV3JpdGUoKSkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1swXS5wYXJ0aWFsKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLnJlc29sdmVkKS50by5iZS5udWxsXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2InXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLmlzV3JpdGUoKSkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1sxXS5wYXJ0aWFsKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLnJlc29sdmVkKS50by5iZS5udWxsXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzJdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ3Jlc3QnXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzJdLmlzV3JpdGUoKSkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1syXS5wYXJ0aWFsKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzJdLnJlc29sdmVkKS50by5iZS5udWxsXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzNdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2FycmF5J1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1szXS5pc1dyaXRlKCkpLnRvLmJlLmZhbHNlXG5cbiAgICAgICAgYXN0ID0gaGFybW9ueS5wYXJzZSBcIlwiXCJcbiAgICAgICAgKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIFthLCBiLCAuLi5bYywgZCwgLi4ucmVzdF1dID0gYXJyYXk7XG4gICAgICAgIH0oKSk7XG4gICAgICAgIFwiXCJcIlxuXG4gICAgICAgIHNjb3BlTWFuYWdlciA9IGVzY29wZS5hbmFseXplIGFzdCwgZWNtYVZlcnNpb246IDZcbiAgICAgICAgZXhwZWN0KHNjb3BlTWFuYWdlci5zY29wZXMpLnRvLmhhdmUubGVuZ3RoIDJcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMF1cbiAgICAgICAgZ2xvYmFsU2NvcGUgPSBzY29wZVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2dsb2JhbCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMFxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggMFxuICAgICAgICBleHBlY3Qoc2NvcGUuaW1wbGljaXQubGVmdCkudG8uaGF2ZS5sZW5ndGggNlxuICAgICAgICBleHBlY3Qoc2NvcGUuaW1wbGljaXQubGVmdC5tYXAoKHJlZikgPT4gcmVmLmlkZW50aWZpZXIubmFtZSkpLnRvLmRlZXAuZXF1YWwgW1xuICAgICAgICAgICAgJ2EnXG4gICAgICAgICAgICAnYidcbiAgICAgICAgICAgICdjJ1xuICAgICAgICAgICAgJ2QnXG4gICAgICAgICAgICAncmVzdCdcbiAgICAgICAgICAgICdhcnJheSdcbiAgICAgICAgXVxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1sxXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2Z1bmN0aW9uJ1xuXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5uYW1lKS50by5iZS5lcXVhbCAnYXJndW1lbnRzJ1xuXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCA2XG4gICAgICAgIGZvciBuYW1lLCBpbmRleCBpbiBbXG4gICAgICAgICAgICAgICAgJ2EnXG4gICAgICAgICAgICAgICAgJ2InXG4gICAgICAgICAgICAgICAgJ2MnXG4gICAgICAgICAgICAgICAgJ2QnXG4gICAgICAgICAgICAgICAgJ3Jlc3QnXG4gICAgICAgICAgICBdXG4gICAgICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1tpbmRleF0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCBuYW1lXG4gICAgICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1tpbmRleF0uaXNXcml0ZSgpKS50by5iZS50cnVlXG4gICAgICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1tpbmRleF0ucGFydGlhbCkudG8uYmUudHJ1ZVxuICAgICAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbaW5kZXhdLnJlc29sdmVkKS50by5iZS5udWxsXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzVdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2FycmF5J1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1s1XS5pc1dyaXRlKCkpLnRvLmJlLmZhbHNlXG5cbiAgICBpdCAnT2JqZWN0UGF0dGVybiBpbiBBc3NpZ25tZW50RXhwcmVzc2lvbicsIC0+XG4gICAgICAgIGFzdCA9IGhhcm1vbnkucGFyc2UgXCJcIlwiXG4gICAgICAgIChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAoe1xuICAgICAgICAgICAgICAgIHNob3J0aGFuZCxcbiAgICAgICAgICAgICAgICBrZXk6IHZhbHVlLFxuICAgICAgICAgICAgICAgIGhlbGxvOiB7XG4gICAgICAgICAgICAgICAgICAgIHdvcmxkXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSkgPSBvYmplY3Q7XG4gICAgICAgIH0oKSk7XG4gICAgICAgIFwiXCJcIlxuXG4gICAgICAgIHNjb3BlTWFuYWdlciA9IGVzY29wZS5hbmFseXplIGFzdCwgZWNtYVZlcnNpb246IDZcbiAgICAgICAgZXhwZWN0KHNjb3BlTWFuYWdlci5zY29wZXMpLnRvLmhhdmUubGVuZ3RoIDJcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMF1cbiAgICAgICAgZ2xvYmFsU2NvcGUgPSBzY29wZVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2dsb2JhbCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMFxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggMFxuICAgICAgICBleHBlY3Qoc2NvcGUuaW1wbGljaXQubGVmdCkudG8uaGF2ZS5sZW5ndGggNFxuICAgICAgICBleHBlY3Qoc2NvcGUuaW1wbGljaXQubGVmdC5tYXAoKHJlZikgPT4gcmVmLmlkZW50aWZpZXIubmFtZSkpLnRvLmRlZXAuZXF1YWwgW1xuICAgICAgICAgICAgJ3Nob3J0aGFuZCdcbiAgICAgICAgICAgICd2YWx1ZSdcbiAgICAgICAgICAgICd3b3JsZCdcbiAgICAgICAgICAgICdvYmplY3QnXG4gICAgICAgIF1cblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdmdW5jdGlvbidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICdhcmd1bWVudHMnXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCA0XG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ3Nob3J0aGFuZCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMF0uaXNXcml0ZSgpKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLnBhcnRpYWwpLnRvLmJlLnRydWVcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMF0ucmVzb2x2ZWQpLnRvLm51bGxcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMV0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAndmFsdWUnXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLmlzV3JpdGUoKSkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1sxXS5wYXJ0aWFsKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLnJlc29sdmVkKS50by5udWxsXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzJdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ3dvcmxkJ1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1syXS5pc1dyaXRlKCkpLnRvLmJlLnRydWVcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMl0ucGFydGlhbCkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1syXS5yZXNvbHZlZCkudG8ubnVsbFxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1szXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsICdvYmplY3QnXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzNdLmlzV3JpdGUoKSkudG8uYmUuZmFsc2VcblxuICAgIGl0ICdjb21wbGV4IHBhdHRlcm4gaW4gQXNzaWdubWVudEV4cHJlc3Npb24nLCAtPlxuICAgICAgICBhc3QgPSBoYXJtb255LnBhcnNlIFwiXCJcIlxuICAgICAgICAoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgKHtcbiAgICAgICAgICAgICAgICBzaG9ydGhhbmQsXG4gICAgICAgICAgICAgICAga2V5OiBbIGEsIGIsIGMsIGQsIGUgXSxcbiAgICAgICAgICAgICAgICBoZWxsbzoge1xuICAgICAgICAgICAgICAgICAgICB3b3JsZFxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pID0gb2JqZWN0O1xuICAgICAgICB9KCkpO1xuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3QsIGVjbWFWZXJzaW9uOiA2XG4gICAgICAgIGV4cGVjdChzY29wZU1hbmFnZXIuc2NvcGVzKS50by5oYXZlLmxlbmd0aCAyXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzBdXG4gICAgICAgIGdsb2JhbFNjb3BlID0gc2NvcGVcbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KHNjb3BlLmltcGxpY2l0LmxlZnQpLnRvLmhhdmUubGVuZ3RoIDhcbiAgICAgICAgZXhwZWN0KHNjb3BlLmltcGxpY2l0LmxlZnQubWFwKChyZWYpID0+IHJlZi5pZGVudGlmaWVyLm5hbWUpKS50by5kZWVwLmVxdWFsIFtcbiAgICAgICAgICAgICdzaG9ydGhhbmQnXG4gICAgICAgICAgICAnYSdcbiAgICAgICAgICAgICdiJ1xuICAgICAgICAgICAgJ2MnXG4gICAgICAgICAgICAnZCdcbiAgICAgICAgICAgICdlJ1xuICAgICAgICAgICAgJ3dvcmxkJ1xuICAgICAgICAgICAgJ29iamVjdCdcbiAgICAgICAgXVxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1sxXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2Z1bmN0aW9uJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAxXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwgJ2FyZ3VtZW50cydcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDhcbiAgICAgICAgZm9yIG5hbWUsIGluZGV4IGluIFtcbiAgICAgICAgICAgICAgICAnc2hvcnRoYW5kJ1xuICAgICAgICAgICAgICAgICdhJ1xuICAgICAgICAgICAgICAgICdiJ1xuICAgICAgICAgICAgICAgICdjJ1xuICAgICAgICAgICAgICAgICdkJ1xuICAgICAgICAgICAgICAgICdlJ1xuICAgICAgICAgICAgICAgICd3b3JsZCdcbiAgICAgICAgICAgIF1cbiAgICAgICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzW2luZGV4XS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsIG5hbWVcbiAgICAgICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzW2luZGV4XS5pc1dyaXRlKCkpLnRvLmJlLnRydWVcbiAgICAgICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzW2luZGV4XS5wYXJ0aWFsKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzddLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ29iamVjdCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbN10uaXNXcml0ZSgpKS50by5iZS5mYWxzZVxuXG4gICAgaXQgJ0FycmF5UGF0dGVybiBpbiBwYXJhbWV0ZXJzJywgLT5cbiAgICAgICAgYXN0ID0gaGFybW9ueS5wYXJzZSBcIlwiXCJcbiAgICAgICAgKGZ1bmN0aW9uIChbYSwgYiwgY10pIHtcbiAgICAgICAgfShhcnJheSkpO1xuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3QsIGVjbWFWZXJzaW9uOiA2XG4gICAgICAgIGV4cGVjdChzY29wZU1hbmFnZXIuc2NvcGVzKS50by5oYXZlLmxlbmd0aCAyXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzBdXG4gICAgICAgIGdsb2JhbFNjb3BlID0gc2NvcGVcbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMF0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnYXJyYXknXG4gICAgICAgIGV4cGVjdChzY29wZS5pbXBsaWNpdC5sZWZ0KS50by5oYXZlLmxlbmd0aCAxXG4gICAgICAgIGV4cGVjdChzY29wZS5pbXBsaWNpdC5sZWZ0WzBdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2FycmF5J1xuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1sxXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2Z1bmN0aW9uJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCA0XG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwgJ2FyZ3VtZW50cydcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1sxXS5uYW1lKS50by5iZS5lcXVhbCAnYSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1syXS5uYW1lKS50by5iZS5lcXVhbCAnYidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1szXS5uYW1lKS50by5iZS5lcXVhbCAnYydcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgIGl0ICdTcHJlYWRFbGVtZW50IGluIHBhcmFtZXRlcnMnLCAtPlxuICAgICAgICBhc3QgPSBoYXJtb255LnBhcnNlIFwiXCJcIlxuICAgICAgICAoZnVuY3Rpb24gKFthLCBiLCAuLi5yZXN0XSwgLi4ucmVzdDIpIHtcbiAgICAgICAgfShhcnJheSkpO1xuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3QsIGVjbWFWZXJzaW9uOiA2XG4gICAgICAgIGV4cGVjdChzY29wZU1hbmFnZXIuc2NvcGVzKS50by5oYXZlLmxlbmd0aCAyXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzBdXG4gICAgICAgIGdsb2JhbFNjb3BlID0gc2NvcGVcbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMF0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnYXJyYXknXG4gICAgICAgIGV4cGVjdChzY29wZS5pbXBsaWNpdC5sZWZ0KS50by5oYXZlLmxlbmd0aCAxXG4gICAgICAgIGV4cGVjdChzY29wZS5pbXBsaWNpdC5sZWZ0WzBdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2FycmF5J1xuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1sxXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2Z1bmN0aW9uJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCA1XG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwgJ2FyZ3VtZW50cydcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1sxXS5uYW1lKS50by5iZS5lcXVhbCAnYSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1syXS5uYW1lKS50by5iZS5lcXVhbCAnYidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1szXS5uYW1lKS50by5iZS5lcXVhbCAncmVzdCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1szXS5kZWZzWzBdLnJlc3QpLnRvLmJlLmZhbHNlXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbNF0ubmFtZSkudG8uYmUuZXF1YWwgJ3Jlc3QyJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzRdLmRlZnNbMF0ucmVzdCkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggMFxuXG4gICAgICAgICMgYXN0ID0gaGFybW9ueS5wYXJzZSBcIlwiXCJcbiAgICAgICAgIyAoZnVuY3Rpb24gKFthLCBiLCAuLi5bYywgZCwgLi4ucmVzdF1dKSB7XG4gICAgICAgICMgfShhcnJheSkpO1xuICAgICAgICAjIFwiXCJcIlxuXG4gICAgICAgICMgc2NvcGVNYW5hZ2VyID0gZXNjb3BlLmFuYWx5emUgYXN0LCBlY21hVmVyc2lvbjogNlxuICAgICAgICAjIGV4cGVjdChzY29wZU1hbmFnZXIuc2NvcGVzKS50by5oYXZlLmxlbmd0aCAyXG5cbiAgICAgICAgIyBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMF1cbiAgICAgICAgIyBnbG9iYWxTY29wZSA9IHNjb3BlXG4gICAgICAgICMgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgICMgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMFxuICAgICAgICAjIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgICMgZXhwZWN0KHNjb3BlLmltcGxpY2l0LmxlZnQpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgIyBleHBlY3Qoc2NvcGUuaW1wbGljaXQubGVmdFswXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsICdhcnJheSdcblxuICAgICAgICAjIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1sxXVxuICAgICAgICAjIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZnVuY3Rpb24nXG5cbiAgICAgICAgIyBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCA2XG4gICAgICAgICMgZm9yIG5hbWUsIGluZGV4IGluIFtcbiAgICAgICAgIyAgICAgICAgICdhcmd1bWVudHMnXG4gICAgICAgICMgICAgICAgICAnYSdcbiAgICAgICAgIyAgICAgICAgICdiJ1xuICAgICAgICAjICAgICAgICAgJ2MnXG4gICAgICAgICMgICAgICAgICAnZCdcbiAgICAgICAgIyAgICAgICAgICdyZXN0J1xuICAgICAgICAjICAgICBdXG4gICAgICAgICMgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbaW5kZXhdLm5hbWUpLnRvLmJlLmVxdWFsIG5hbWVcblxuICAgICAgICAjIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCA2XG4gICAgICAgICMgZm9yIG5hbWUsIGluZGV4IGluIFtcbiAgICAgICAgIyAgICAgICAgICdhJ1xuICAgICAgICAjICAgICAgICAgJ2InXG4gICAgICAgICMgICAgICAgICAnYydcbiAgICAgICAgIyAgICAgICAgICdkJ1xuICAgICAgICAjICAgICAgICAgJ3Jlc3QnXG4gICAgICAgICMgICAgIF1cbiAgICAgICAgIyAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbaW5kZXhdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgbmFtZVxuICAgICAgICAjICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1tpbmRleF0uaXNXcml0ZSgpKS50by5iZS50cnVlXG4gICAgICAgICMgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzW2luZGV4XS5wYXJ0aWFsKS50by5iZS50cnVlXG4gICAgICAgICMgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbNV0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnYXJyYXknXG4gICAgICAgICMgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbNV0uaXNXcml0ZSgpKS50by5iZS5mYWxzZVxuXG4gICAgaXQgJ09iamVjdFBhdHRlcm4gaW4gcGFyYW1ldGVycycsIC0+XG4gICAgICAgIGFzdCA9IGhhcm1vbnkucGFyc2UgXCJcIlwiXG4gICAgICAgIChmdW5jdGlvbiAoe1xuICAgICAgICAgICAgICAgIHNob3J0aGFuZCxcbiAgICAgICAgICAgICAgICBrZXk6IHZhbHVlLFxuICAgICAgICAgICAgICAgIGhlbGxvOiB7XG4gICAgICAgICAgICAgICAgICAgIHdvcmxkXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSkge1xuICAgICAgICB9KG9iamVjdCkpO1xuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3QsIGVjbWFWZXJzaW9uOiA2XG4gICAgICAgIGV4cGVjdChzY29wZU1hbmFnZXIuc2NvcGVzKS50by5oYXZlLmxlbmd0aCAyXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzBdXG4gICAgICAgIGdsb2JhbFNjb3BlID0gc2NvcGVcbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMF0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnb2JqZWN0J1xuICAgICAgICBleHBlY3Qoc2NvcGUuaW1wbGljaXQubGVmdCkudG8uaGF2ZS5sZW5ndGggMVxuICAgICAgICBleHBlY3Qoc2NvcGUuaW1wbGljaXQubGVmdFswXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsICdvYmplY3QnXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzFdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZnVuY3Rpb24nXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDRcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5uYW1lKS50by5iZS5lcXVhbCAnYXJndW1lbnRzJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzFdLm5hbWUpLnRvLmJlLmVxdWFsICdzaG9ydGhhbmQnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMl0ubmFtZSkudG8uYmUuZXF1YWwgJ3ZhbHVlJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzNdLm5hbWUpLnRvLmJlLmVxdWFsICd3b3JsZCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgIGl0ICdjb21wbGV4IHBhdHRlcm4gaW4gcGFyYW1ldGVycycsIC0+XG4gICAgICAgIGFzdCA9IGhhcm1vbnkucGFyc2UgXCJcIlwiXG4gICAgICAgIChmdW5jdGlvbiAoe1xuICAgICAgICAgICAgICAgIHNob3J0aGFuZCxcbiAgICAgICAgICAgICAgICBrZXk6IFsgYSwgYiwgYywgZCwgZSBdLFxuICAgICAgICAgICAgICAgIGhlbGxvOiB7XG4gICAgICAgICAgICAgICAgICAgIHdvcmxkXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSkge1xuICAgICAgICB9KG9iamVjdCkpO1xuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3QsIGVjbWFWZXJzaW9uOiA2XG4gICAgICAgIGV4cGVjdChzY29wZU1hbmFnZXIuc2NvcGVzKS50by5oYXZlLmxlbmd0aCAyXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzBdXG4gICAgICAgIGdsb2JhbFNjb3BlID0gc2NvcGVcbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMF0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnb2JqZWN0J1xuICAgICAgICBleHBlY3Qoc2NvcGUuaW1wbGljaXQubGVmdCkudG8uaGF2ZS5sZW5ndGggMVxuICAgICAgICBleHBlY3Qoc2NvcGUuaW1wbGljaXQubGVmdFswXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsICdvYmplY3QnXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzFdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZnVuY3Rpb24nXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDhcbiAgICAgICAgZm9yIG5hbWUsIGluZGV4IGluIFtcbiAgICAgICAgICAgICAgICAnYXJndW1lbnRzJ1xuICAgICAgICAgICAgICAgICdzaG9ydGhhbmQnXG4gICAgICAgICAgICAgICAgJ2EnXG4gICAgICAgICAgICAgICAgJ2InXG4gICAgICAgICAgICAgICAgJ2MnXG4gICAgICAgICAgICAgICAgJ2QnXG4gICAgICAgICAgICAgICAgJ2UnXG4gICAgICAgICAgICAgICAgJ3dvcmxkJ1xuICAgICAgICAgICAgXVxuICAgICAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1tpbmRleF0ubmFtZSkudG8uYmUuZXF1YWwgbmFtZVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggMFxuXG4jIHZpbTogc2V0IHN3PTQgdHM9NCBldCB0dz04MCA6XG4iXX0=
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/powered-test/es6-export.js b/tools/eslint/node_modules/escope/powered-test/es6-export.js
      new file mode 100644
      index 00000000000000..194fb0693565ae
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/powered-test/es6-export.js
      @@ -0,0 +1,202 @@
      +(function() {
      +  var escope, expect, harmony;
      +
      +  expect = require('chai').expect;
      +
      +  harmony = require('../third_party/esprima');
      +
      +  escope = require('..');
      +
      +  describe('export declaration', function() {
      +    it('should create vairable bindings', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = harmony.parse("export var v;", {
      +        sourceType: 'module'
      +      });
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6,
      +        sourceType: 'module'
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      globalScope = scopeManager.scopes[0];
      +      expect(globalScope.type).to.be.equal('global');
      +      expect(globalScope.variables).to.have.length(0);
      +      expect(globalScope.references).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('module');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('v');
      +      expect(scope.variables[0].defs[0].type).to.be.equal('Variable');
      +      return expect(scope.references).to.have.length(0);
      +    });
      +    it('should create function declaration bindings', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = harmony.parse("export default function f(){};", {
      +        sourceType: 'module'
      +      });
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6,
      +        sourceType: 'module'
      +      });
      +      expect(scopeManager.scopes).to.have.length(3);
      +      globalScope = scopeManager.scopes[0];
      +      expect(globalScope.type).to.be.equal('global');
      +      expect(globalScope.variables).to.have.length(0);
      +      expect(globalScope.references).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('module');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('f');
      +      expect(scope.variables[0].defs[0].type).to.be.equal('FunctionName');
      +      expect(scope.references).to.have.length(0);
      +      scope = scopeManager.scopes[2];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      return expect(scope.references).to.have.length(0);
      +    });
      +    it('should export function expression', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = harmony.parse("export default function(){};", {
      +        sourceType: 'module'
      +      });
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6,
      +        sourceType: 'module'
      +      });
      +      expect(scopeManager.scopes).to.have.length(3);
      +      globalScope = scopeManager.scopes[0];
      +      expect(globalScope.type).to.be.equal('global');
      +      expect(globalScope.variables).to.have.length(0);
      +      expect(globalScope.references).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('module');
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(0);
      +      scope = scopeManager.scopes[2];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      return expect(scope.references).to.have.length(0);
      +    });
      +    it('should export literal', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = harmony.parse("export default 42;", {
      +        sourceType: 'module'
      +      });
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6,
      +        sourceType: 'module'
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      globalScope = scopeManager.scopes[0];
      +      expect(globalScope.type).to.be.equal('global');
      +      expect(globalScope.variables).to.have.length(0);
      +      expect(globalScope.references).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('module');
      +      expect(scope.variables).to.have.length(0);
      +      return expect(scope.references).to.have.length(0);
      +    });
      +    it('should refer exported references#1', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = harmony.parse("export {x};", {
      +        sourceType: 'module'
      +      });
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6,
      +        sourceType: 'module'
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      globalScope = scopeManager.scopes[0];
      +      expect(globalScope.type).to.be.equal('global');
      +      expect(globalScope.variables).to.have.length(0);
      +      expect(globalScope.references).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('module');
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(1);
      +      return expect(scope.references[0].identifier.name).to.be.equal('x');
      +    });
      +    it('should refer exported references#2', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = harmony.parse("export {v as x};", {
      +        sourceType: 'module'
      +      });
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6,
      +        sourceType: 'module'
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      globalScope = scopeManager.scopes[0];
      +      expect(globalScope.type).to.be.equal('global');
      +      expect(globalScope.variables).to.have.length(0);
      +      expect(globalScope.references).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('module');
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(1);
      +      return expect(scope.references[0].identifier.name).to.be.equal('v');
      +    });
      +    it('should not refer exported references from other source#1', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = harmony.parse("export {x} from \"mod\";", {
      +        sourceType: 'module'
      +      });
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6,
      +        sourceType: 'module'
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      globalScope = scopeManager.scopes[0];
      +      expect(globalScope.type).to.be.equal('global');
      +      expect(globalScope.variables).to.have.length(0);
      +      expect(globalScope.references).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('module');
      +      expect(scope.variables).to.have.length(0);
      +      return expect(scope.references).to.have.length(0);
      +    });
      +    it('should not refer exported references from other source#2', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = harmony.parse("export {v as x} from \"mod\";", {
      +        sourceType: 'module'
      +      });
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6,
      +        sourceType: 'module'
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      globalScope = scopeManager.scopes[0];
      +      expect(globalScope.type).to.be.equal('global');
      +      expect(globalScope.variables).to.have.length(0);
      +      expect(globalScope.references).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('module');
      +      expect(scope.variables).to.have.length(0);
      +      return expect(scope.references).to.have.length(0);
      +    });
      +    return it('should not refer exported references from other source#3', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = harmony.parse("export * from \"mod\";", {
      +        sourceType: 'module'
      +      });
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6,
      +        sourceType: 'module'
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      globalScope = scopeManager.scopes[0];
      +      expect(globalScope.type).to.be.equal('global');
      +      expect(globalScope.variables).to.have.length(0);
      +      expect(globalScope.references).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('module');
      +      expect(scope.variables).to.have.length(0);
      +      return expect(scope.references).to.have.length(0);
      +    });
      +  });
      +
      +}).call(this);
      +
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVzNi1leHBvcnQuY29mZmVlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVCQTtBQUFBLE1BQUEsdUJBQUE7O0FBQUEsRUFBQSxNQUFBLEdBQVMsT0FBQSxDQUFTLE1BQVQsQ0FBZSxDQUFDLE1BQXpCLENBQUE7O0FBQUEsRUFDQSxPQUFBLEdBQVUsT0FBQSxDQUFTLHdCQUFULENBRFYsQ0FBQTs7QUFBQSxFQUVBLE1BQUEsR0FBUyxPQUFBLENBQVMsSUFBVCxDQUZULENBQUE7O0FBQUEsRUFJQSxRQUFBLENBQVUsb0JBQVYsRUFBK0IsU0FBQSxHQUFBO0FBRTNCLElBQUEsRUFBQSxDQUFJLGlDQUFKLEVBQXNDLFNBQUEsR0FBQTtBQUNsQyxVQUFBLHFDQUFBO0FBQUEsTUFBQSxHQUFBLEdBQU0sT0FBTyxDQUFDLEtBQVIsQ0FBaUIsZUFBakIsRUFFRDtBQUFBLFFBQUEsVUFBQSxFQUFhLFFBQWI7T0FGQyxDQUFOLENBQUE7QUFBQSxNQUlBLFlBQUEsR0FBZSxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsRUFBb0I7QUFBQSxRQUFBLFdBQUEsRUFBYSxDQUFiO0FBQUEsUUFBZ0IsVUFBQSxFQUFhLFFBQTdCO09BQXBCLENBSmYsQ0FBQTtBQUFBLE1BS0EsTUFBQSxDQUFPLFlBQVksQ0FBQyxNQUFwQixDQUEyQixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBcEMsQ0FBMkMsQ0FBM0MsQ0FMQSxDQUFBO0FBQUEsTUFNQSxXQUFBLEdBQWMsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBTmxDLENBQUE7QUFBQSxNQU9BLE1BQUEsQ0FBTyxXQUFXLENBQUMsSUFBbkIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQS9CLENBQXNDLFFBQXRDLENBUEEsQ0FBQTtBQUFBLE1BUUEsTUFBQSxDQUFPLFdBQVcsQ0FBQyxTQUFuQixDQUE2QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBdEMsQ0FBNkMsQ0FBN0MsQ0FSQSxDQUFBO0FBQUEsTUFTQSxNQUFBLENBQU8sV0FBVyxDQUFDLFVBQW5CLENBQThCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUF2QyxDQUE4QyxDQUE5QyxDQVRBLENBQUE7QUFBQSxNQVdBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FYNUIsQ0FBQTtBQUFBLE1BWUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxRQUFoQyxDQVpBLENBQUE7QUFBQSxNQWFBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0FiQSxDQUFBO0FBQUEsTUFjQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsR0FBN0MsQ0FkQSxDQUFBO0FBQUEsTUFlQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUFLLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBbEMsQ0FBdUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQTlDLENBQXFELFVBQXJELENBZkEsQ0FBQTthQWdCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLEVBakJrQztJQUFBLENBQXRDLENBQUEsQ0FBQTtBQUFBLElBbUJBLEVBQUEsQ0FBSSw2Q0FBSixFQUFrRCxTQUFBLEdBQUE7QUFDOUMsVUFBQSxxQ0FBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLGdDQUFqQixFQUVEO0FBQUEsUUFBQSxVQUFBLEVBQWEsUUFBYjtPQUZDLENBQU4sQ0FBQTtBQUFBLE1BSUEsWUFBQSxHQUFlLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixFQUFvQjtBQUFBLFFBQUEsV0FBQSxFQUFhLENBQWI7QUFBQSxRQUFnQixVQUFBLEVBQWEsUUFBN0I7T0FBcEIsQ0FKZixDQUFBO0FBQUEsTUFLQSxNQUFBLENBQU8sWUFBWSxDQUFDLE1BQXBCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQUxBLENBQUE7QUFBQSxNQU1BLFdBQUEsR0FBYyxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FObEMsQ0FBQTtBQUFBLE1BT0EsTUFBQSxDQUFPLFdBQVcsQ0FBQyxJQUFuQixDQUF3QixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBL0IsQ0FBc0MsUUFBdEMsQ0FQQSxDQUFBO0FBQUEsTUFRQSxNQUFBLENBQU8sV0FBVyxDQUFDLFNBQW5CLENBQTZCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUF0QyxDQUE2QyxDQUE3QyxDQVJBLENBQUE7QUFBQSxNQVNBLE1BQUEsQ0FBTyxXQUFXLENBQUMsVUFBbkIsQ0FBOEIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXZDLENBQThDLENBQTlDLENBVEEsQ0FBQTtBQUFBLE1BV0EsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQVg1QixDQUFBO0FBQUEsTUFZQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFFBQWhDLENBWkEsQ0FBQTtBQUFBLE1BYUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQWJBLENBQUE7QUFBQSxNQWNBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxHQUE3QyxDQWRBLENBQUE7QUFBQSxNQWVBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQUssQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUFsQyxDQUF1QyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBOUMsQ0FBcUQsY0FBckQsQ0FmQSxDQUFBO0FBQUEsTUFnQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFiLENBQXdCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFqQyxDQUF3QyxDQUF4QyxDQWhCQSxDQUFBO0FBQUEsTUFrQkEsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQWxCNUIsQ0FBQTtBQUFBLE1BbUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsVUFBaEMsQ0FuQkEsQ0FBQTtBQUFBLE1Bb0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0FwQkEsQ0FBQTtBQUFBLE1BcUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxXQUE3QyxDQXJCQSxDQUFBO2FBc0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsRUF2QjhDO0lBQUEsQ0FBbEQsQ0FuQkEsQ0FBQTtBQUFBLElBNkNBLEVBQUEsQ0FBSSxtQ0FBSixFQUF3QyxTQUFBLEdBQUE7QUFDcEMsVUFBQSxxQ0FBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLDhCQUFqQixFQUVEO0FBQUEsUUFBQSxVQUFBLEVBQWEsUUFBYjtPQUZDLENBQU4sQ0FBQTtBQUFBLE1BSUEsWUFBQSxHQUFlLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixFQUFvQjtBQUFBLFFBQUEsV0FBQSxFQUFhLENBQWI7QUFBQSxRQUFnQixVQUFBLEVBQWEsUUFBN0I7T0FBcEIsQ0FKZixDQUFBO0FBQUEsTUFLQSxNQUFBLENBQU8sWUFBWSxDQUFDLE1BQXBCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQUxBLENBQUE7QUFBQSxNQU1BLFdBQUEsR0FBYyxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FObEMsQ0FBQTtBQUFBLE1BT0EsTUFBQSxDQUFPLFdBQVcsQ0FBQyxJQUFuQixDQUF3QixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBL0IsQ0FBc0MsUUFBdEMsQ0FQQSxDQUFBO0FBQUEsTUFRQSxNQUFBLENBQU8sV0FBVyxDQUFDLFNBQW5CLENBQTZCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUF0QyxDQUE2QyxDQUE3QyxDQVJBLENBQUE7QUFBQSxNQVNBLE1BQUEsQ0FBTyxXQUFXLENBQUMsVUFBbkIsQ0FBOEIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXZDLENBQThDLENBQTlDLENBVEEsQ0FBQTtBQUFBLE1BV0EsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQVg1QixDQUFBO0FBQUEsTUFZQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFFBQWhDLENBWkEsQ0FBQTtBQUFBLE1BYUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQWJBLENBQUE7QUFBQSxNQWNBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsQ0FkQSxDQUFBO0FBQUEsTUFnQkEsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQWhCNUIsQ0FBQTtBQUFBLE1BaUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsVUFBaEMsQ0FqQkEsQ0FBQTtBQUFBLE1Ba0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0FsQkEsQ0FBQTtBQUFBLE1BbUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxXQUE3QyxDQW5CQSxDQUFBO2FBb0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsRUFyQm9DO0lBQUEsQ0FBeEMsQ0E3Q0EsQ0FBQTtBQUFBLElBb0VBLEVBQUEsQ0FBSSx1QkFBSixFQUE0QixTQUFBLEdBQUE7QUFDeEIsVUFBQSxxQ0FBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLG9CQUFqQixFQUVEO0FBQUEsUUFBQSxVQUFBLEVBQWEsUUFBYjtPQUZDLENBQU4sQ0FBQTtBQUFBLE1BSUEsWUFBQSxHQUFlLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixFQUFvQjtBQUFBLFFBQUEsV0FBQSxFQUFhLENBQWI7QUFBQSxRQUFnQixVQUFBLEVBQWEsUUFBN0I7T0FBcEIsQ0FKZixDQUFBO0FBQUEsTUFLQSxNQUFBLENBQU8sWUFBWSxDQUFDLE1BQXBCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQUxBLENBQUE7QUFBQSxNQU1BLFdBQUEsR0FBYyxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FObEMsQ0FBQTtBQUFBLE1BT0EsTUFBQSxDQUFPLFdBQVcsQ0FBQyxJQUFuQixDQUF3QixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBL0IsQ0FBc0MsUUFBdEMsQ0FQQSxDQUFBO0FBQUEsTUFRQSxNQUFBLENBQU8sV0FBVyxDQUFDLFNBQW5CLENBQTZCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUF0QyxDQUE2QyxDQUE3QyxDQVJBLENBQUE7QUFBQSxNQVNBLE1BQUEsQ0FBTyxXQUFXLENBQUMsVUFBbkIsQ0FBOEIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXZDLENBQThDLENBQTlDLENBVEEsQ0FBQTtBQUFBLE1BV0EsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQVg1QixDQUFBO0FBQUEsTUFZQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFFBQWhDLENBWkEsQ0FBQTtBQUFBLE1BYUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQWJBLENBQUE7YUFjQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLEVBZndCO0lBQUEsQ0FBNUIsQ0FwRUEsQ0FBQTtBQUFBLElBcUZBLEVBQUEsQ0FBSSxvQ0FBSixFQUF5QyxTQUFBLEdBQUE7QUFDckMsVUFBQSxxQ0FBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLGFBQWpCLEVBRUQ7QUFBQSxRQUFBLFVBQUEsRUFBYSxRQUFiO09BRkMsQ0FBTixDQUFBO0FBQUEsTUFJQSxZQUFBLEdBQWUsTUFBTSxDQUFDLE9BQVAsQ0FBZSxHQUFmLEVBQW9CO0FBQUEsUUFBQSxXQUFBLEVBQWEsQ0FBYjtBQUFBLFFBQWdCLFVBQUEsRUFBYSxRQUE3QjtPQUFwQixDQUpmLENBQUE7QUFBQSxNQUtBLE1BQUEsQ0FBTyxZQUFZLENBQUMsTUFBcEIsQ0FBMkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXBDLENBQTJDLENBQTNDLENBTEEsQ0FBQTtBQUFBLE1BTUEsV0FBQSxHQUFjLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQU5sQyxDQUFBO0FBQUEsTUFPQSxNQUFBLENBQU8sV0FBVyxDQUFDLElBQW5CLENBQXdCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEvQixDQUFzQyxRQUF0QyxDQVBBLENBQUE7QUFBQSxNQVFBLE1BQUEsQ0FBTyxXQUFXLENBQUMsU0FBbkIsQ0FBNkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXRDLENBQTZDLENBQTdDLENBUkEsQ0FBQTtBQUFBLE1BU0EsTUFBQSxDQUFPLFdBQVcsQ0FBQyxVQUFuQixDQUE4QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBdkMsQ0FBOEMsQ0FBOUMsQ0FUQSxDQUFBO0FBQUEsTUFXQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBWDVCLENBQUE7QUFBQSxNQVlBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsUUFBaEMsQ0FaQSxDQUFBO0FBQUEsTUFhQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBYkEsQ0FBQTtBQUFBLE1BY0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFiLENBQXdCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFqQyxDQUF3QyxDQUF4QyxDQWRBLENBQUE7YUFlQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELEdBQXpELEVBaEJxQztJQUFBLENBQXpDLENBckZBLENBQUE7QUFBQSxJQXVHQSxFQUFBLENBQUksb0NBQUosRUFBeUMsU0FBQSxHQUFBO0FBQ3JDLFVBQUEscUNBQUE7QUFBQSxNQUFBLEdBQUEsR0FBTSxPQUFPLENBQUMsS0FBUixDQUFpQixrQkFBakIsRUFFRDtBQUFBLFFBQUEsVUFBQSxFQUFhLFFBQWI7T0FGQyxDQUFOLENBQUE7QUFBQSxNQUlBLFlBQUEsR0FBZSxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsRUFBb0I7QUFBQSxRQUFBLFdBQUEsRUFBYSxDQUFiO0FBQUEsUUFBZ0IsVUFBQSxFQUFhLFFBQTdCO09BQXBCLENBSmYsQ0FBQTtBQUFBLE1BS0EsTUFBQSxDQUFPLFlBQVksQ0FBQyxNQUFwQixDQUEyQixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBcEMsQ0FBMkMsQ0FBM0MsQ0FMQSxDQUFBO0FBQUEsTUFNQSxXQUFBLEdBQWMsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBTmxDLENBQUE7QUFBQSxNQU9BLE1BQUEsQ0FBTyxXQUFXLENBQUMsSUFBbkIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQS9CLENBQXNDLFFBQXRDLENBUEEsQ0FBQTtBQUFBLE1BUUEsTUFBQSxDQUFPLFdBQVcsQ0FBQyxTQUFuQixDQUE2QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBdEMsQ0FBNkMsQ0FBN0MsQ0FSQSxDQUFBO0FBQUEsTUFTQSxNQUFBLENBQU8sV0FBVyxDQUFDLFVBQW5CLENBQThCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUF2QyxDQUE4QyxDQUE5QyxDQVRBLENBQUE7QUFBQSxNQVdBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FYNUIsQ0FBQTtBQUFBLE1BWUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxRQUFoQyxDQVpBLENBQUE7QUFBQSxNQWFBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0FiQSxDQUFBO0FBQUEsTUFjQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBZEEsQ0FBQTthQWVBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsR0FBekQsRUFoQnFDO0lBQUEsQ0FBekMsQ0F2R0EsQ0FBQTtBQUFBLElBeUhBLEVBQUEsQ0FBSSwwREFBSixFQUErRCxTQUFBLEdBQUE7QUFDM0QsVUFBQSxxQ0FBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLDBCQUFqQixFQUVEO0FBQUEsUUFBQSxVQUFBLEVBQWEsUUFBYjtPQUZDLENBQU4sQ0FBQTtBQUFBLE1BSUEsWUFBQSxHQUFlLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixFQUFvQjtBQUFBLFFBQUEsV0FBQSxFQUFhLENBQWI7QUFBQSxRQUFnQixVQUFBLEVBQWEsUUFBN0I7T0FBcEIsQ0FKZixDQUFBO0FBQUEsTUFLQSxNQUFBLENBQU8sWUFBWSxDQUFDLE1BQXBCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQUxBLENBQUE7QUFBQSxNQU1BLFdBQUEsR0FBYyxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FObEMsQ0FBQTtBQUFBLE1BT0EsTUFBQSxDQUFPLFdBQVcsQ0FBQyxJQUFuQixDQUF3QixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBL0IsQ0FBc0MsUUFBdEMsQ0FQQSxDQUFBO0FBQUEsTUFRQSxNQUFBLENBQU8sV0FBVyxDQUFDLFNBQW5CLENBQTZCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUF0QyxDQUE2QyxDQUE3QyxDQVJBLENBQUE7QUFBQSxNQVNBLE1BQUEsQ0FBTyxXQUFXLENBQUMsVUFBbkIsQ0FBOEIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXZDLENBQThDLENBQTlDLENBVEEsQ0FBQTtBQUFBLE1BV0EsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQVg1QixDQUFBO0FBQUEsTUFZQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFFBQWhDLENBWkEsQ0FBQTtBQUFBLE1BYUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQWJBLENBQUE7YUFjQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLEVBZjJEO0lBQUEsQ0FBL0QsQ0F6SEEsQ0FBQTtBQUFBLElBMElBLEVBQUEsQ0FBSSwwREFBSixFQUErRCxTQUFBLEdBQUE7QUFDM0QsVUFBQSxxQ0FBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLCtCQUFqQixFQUVEO0FBQUEsUUFBQSxVQUFBLEVBQWEsUUFBYjtPQUZDLENBQU4sQ0FBQTtBQUFBLE1BSUEsWUFBQSxHQUFlLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixFQUFvQjtBQUFBLFFBQUEsV0FBQSxFQUFhLENBQWI7QUFBQSxRQUFnQixVQUFBLEVBQWEsUUFBN0I7T0FBcEIsQ0FKZixDQUFBO0FBQUEsTUFLQSxNQUFBLENBQU8sWUFBWSxDQUFDLE1BQXBCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQUxBLENBQUE7QUFBQSxNQU1BLFdBQUEsR0FBYyxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FObEMsQ0FBQTtBQUFBLE1BT0EsTUFBQSxDQUFPLFdBQVcsQ0FBQyxJQUFuQixDQUF3QixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBL0IsQ0FBc0MsUUFBdEMsQ0FQQSxDQUFBO0FBQUEsTUFRQSxNQUFBLENBQU8sV0FBVyxDQUFDLFNBQW5CLENBQTZCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUF0QyxDQUE2QyxDQUE3QyxDQVJBLENBQUE7QUFBQSxNQVNBLE1BQUEsQ0FBTyxXQUFXLENBQUMsVUFBbkIsQ0FBOEIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXZDLENBQThDLENBQTlDLENBVEEsQ0FBQTtBQUFBLE1BV0EsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQVg1QixDQUFBO0FBQUEsTUFZQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFFBQWhDLENBWkEsQ0FBQTtBQUFBLE1BYUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQWJBLENBQUE7YUFjQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLEVBZjJEO0lBQUEsQ0FBL0QsQ0ExSUEsQ0FBQTtXQTJKQSxFQUFBLENBQUksMERBQUosRUFBK0QsU0FBQSxHQUFBO0FBQzNELFVBQUEscUNBQUE7QUFBQSxNQUFBLEdBQUEsR0FBTSxPQUFPLENBQUMsS0FBUixDQUFpQix3QkFBakIsRUFFRDtBQUFBLFFBQUEsVUFBQSxFQUFhLFFBQWI7T0FGQyxDQUFOLENBQUE7QUFBQSxNQUlBLFlBQUEsR0FBZSxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsRUFBb0I7QUFBQSxRQUFBLFdBQUEsRUFBYSxDQUFiO0FBQUEsUUFBZ0IsVUFBQSxFQUFhLFFBQTdCO09BQXBCLENBSmYsQ0FBQTtBQUFBLE1BS0EsTUFBQSxDQUFPLFlBQVksQ0FBQyxNQUFwQixDQUEyQixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBcEMsQ0FBMkMsQ0FBM0MsQ0FMQSxDQUFBO0FBQUEsTUFNQSxXQUFBLEdBQWMsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBTmxDLENBQUE7QUFBQSxNQU9BLE1BQUEsQ0FBTyxXQUFXLENBQUMsSUFBbkIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQS9CLENBQXNDLFFBQXRDLENBUEEsQ0FBQTtBQUFBLE1BUUEsTUFBQSxDQUFPLFdBQVcsQ0FBQyxTQUFuQixDQUE2QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBdEMsQ0FBNkMsQ0FBN0MsQ0FSQSxDQUFBO0FBQUEsTUFTQSxNQUFBLENBQU8sV0FBVyxDQUFDLFVBQW5CLENBQThCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUF2QyxDQUE4QyxDQUE5QyxDQVRBLENBQUE7QUFBQSxNQVdBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FYNUIsQ0FBQTtBQUFBLE1BWUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxRQUFoQyxDQVpBLENBQUE7QUFBQSxNQWFBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0FiQSxDQUFBO2FBY0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFiLENBQXdCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFqQyxDQUF3QyxDQUF4QyxFQWYyRDtJQUFBLENBQS9ELEVBN0oyQjtFQUFBLENBQS9CLENBSkEsQ0FBQTtBQUFBIiwiZmlsZSI6ImVzNi1leHBvcnQuanMiLCJzb3VyY2VSb290IjoiL3NvdXJjZS8iLCJzb3VyY2VzQ29udGVudCI6WyIjIC0qLSBjb2Rpbmc6IHV0Zi04IC0qLVxuIyAgQ29weXJpZ2h0IChDKSAyMDE0IFl1c3VrZSBTdXp1a2kgPHV0YXRhbmUudGVhQGdtYWlsLmNvbT5cbiNcbiMgIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dFxuIyAgbW9kaWZpY2F0aW9uLCBhcmUgcGVybWl0dGVkIHByb3ZpZGVkIHRoYXQgdGhlIGZvbGxvd2luZyBjb25kaXRpb25zIGFyZSBtZXQ6XG4jXG4jICAgICogUmVkaXN0cmlidXRpb25zIG9mIHNvdXJjZSBjb2RlIG11c3QgcmV0YWluIHRoZSBhYm92ZSBjb3B5cmlnaHRcbiMgICAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIuXG4jICAgICogUmVkaXN0cmlidXRpb25zIGluIGJpbmFyeSBmb3JtIG11c3QgcmVwcm9kdWNlIHRoZSBhYm92ZSBjb3B5cmlnaHRcbiMgICAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIgaW4gdGhlXG4jICAgICAgZG9jdW1lbnRhdGlvbiBhbmQvb3Igb3RoZXIgbWF0ZXJpYWxzIHByb3ZpZGVkIHdpdGggdGhlIGRpc3RyaWJ1dGlvbi5cbiNcbiMgIFRISVMgU09GVFdBUkUgSVMgUFJPVklERUQgQlkgVEhFIENPUFlSSUdIVCBIT0xERVJTIEFORCBDT05UUklCVVRPUlMgXCJBUyBJU1wiXG4jICBBTkQgQU5ZIEVYUFJFU1MgT1IgSU1QTElFRCBXQVJSQU5USUVTLCBJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgVEhFXG4jICBJTVBMSUVEIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZIEFORCBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRVxuIyAgQVJFIERJU0NMQUlNRUQuIElOIE5PIEVWRU5UIFNIQUxMIDxDT1BZUklHSFQgSE9MREVSPiBCRSBMSUFCTEUgRk9SIEFOWVxuIyAgRElSRUNULCBJTkRJUkVDVCwgSU5DSURFTlRBTCwgU1BFQ0lBTCwgRVhFTVBMQVJZLCBPUiBDT05TRVFVRU5USUFMIERBTUFHRVNcbiMgIChJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgUFJPQ1VSRU1FTlQgT0YgU1VCU1RJVFVURSBHT09EUyBPUiBTRVJWSUNFUztcbiMgIExPU1MgT0YgVVNFLCBEQVRBLCBPUiBQUk9GSVRTOyBPUiBCVVNJTkVTUyBJTlRFUlJVUFRJT04pIEhPV0VWRVIgQ0FVU0VEIEFORFxuIyAgT04gQU5ZIFRIRU9SWSBPRiBMSUFCSUxJVFksIFdIRVRIRVIgSU4gQ09OVFJBQ1QsIFNUUklDVCBMSUFCSUxJVFksIE9SIFRPUlRcbiMgIChJTkNMVURJTkcgTkVHTElHRU5DRSBPUiBPVEhFUldJU0UpIEFSSVNJTkcgSU4gQU5ZIFdBWSBPVVQgT0YgVEhFIFVTRSBPRlxuIyAgVEhJUyBTT0ZUV0FSRSwgRVZFTiBJRiBBRFZJU0VEIE9GIFRIRSBQT1NTSUJJTElUWSBPRiBTVUNIIERBTUFHRS5cblxuZXhwZWN0ID0gcmVxdWlyZSgnY2hhaScpLmV4cGVjdFxuaGFybW9ueSA9IHJlcXVpcmUgJy4uL3RoaXJkX3BhcnR5L2VzcHJpbWEnXG5lc2NvcGUgPSByZXF1aXJlICcuLidcblxuZGVzY3JpYmUgJ2V4cG9ydCBkZWNsYXJhdGlvbicsIC0+XG4gICAgIyBodHRwOi8vcGVvcGxlLm1vemlsbGEub3JnL35qb3JlbmRvcmZmL2VzNi1kcmFmdC5odG1sI3NlYy1zdGF0aWMtYW5kLXJ1bnRtZS1zZW1hbnRpY3MtbW9kdWxlLXJlY29yZHNcbiAgICBpdCAnc2hvdWxkIGNyZWF0ZSB2YWlyYWJsZSBiaW5kaW5ncycsIC0+XG4gICAgICAgIGFzdCA9IGhhcm1vbnkucGFyc2UgXCJcIlwiXG4gICAgICAgIGV4cG9ydCB2YXIgdjtcbiAgICAgICAgXCJcIlwiLCBzb3VyY2VUeXBlOiAnbW9kdWxlJ1xuXG4gICAgICAgIHNjb3BlTWFuYWdlciA9IGVzY29wZS5hbmFseXplIGFzdCwgZWNtYVZlcnNpb246IDYsIHNvdXJjZVR5cGU6ICdtb2R1bGUnXG4gICAgICAgIGV4cGVjdChzY29wZU1hbmFnZXIuc2NvcGVzKS50by5oYXZlLmxlbmd0aCAyXG4gICAgICAgIGdsb2JhbFNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1swXVxuICAgICAgICBleHBlY3QoZ2xvYmFsU2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2dsb2JhbCdcbiAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMFxuICAgICAgICBleHBlY3QoZ2xvYmFsU2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggMFxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1sxXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ21vZHVsZSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICd2J1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLmRlZnNbMF0udHlwZSkudG8uYmUuZXF1YWwgJ1ZhcmlhYmxlJ1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggMFxuXG4gICAgaXQgJ3Nob3VsZCBjcmVhdGUgZnVuY3Rpb24gZGVjbGFyYXRpb24gYmluZGluZ3MnLCAtPlxuICAgICAgICBhc3QgPSBoYXJtb255LnBhcnNlIFwiXCJcIlxuICAgICAgICBleHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBmKCl7fTtcbiAgICAgICAgXCJcIlwiLCBzb3VyY2VUeXBlOiAnbW9kdWxlJ1xuXG4gICAgICAgIHNjb3BlTWFuYWdlciA9IGVzY29wZS5hbmFseXplIGFzdCwgZWNtYVZlcnNpb246IDYsIHNvdXJjZVR5cGU6ICdtb2R1bGUnXG4gICAgICAgIGV4cGVjdChzY29wZU1hbmFnZXIuc2NvcGVzKS50by5oYXZlLmxlbmd0aCAzXG4gICAgICAgIGdsb2JhbFNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1swXVxuICAgICAgICBleHBlY3QoZ2xvYmFsU2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2dsb2JhbCdcbiAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMFxuICAgICAgICBleHBlY3QoZ2xvYmFsU2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggMFxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1sxXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ21vZHVsZSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICdmJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLmRlZnNbMF0udHlwZSkudG8uYmUuZXF1YWwgJ0Z1bmN0aW9uTmFtZSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMl1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdmdW5jdGlvbidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICdhcmd1bWVudHMnXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAwXG5cblxuICAgIGl0ICdzaG91bGQgZXhwb3J0IGZ1bmN0aW9uIGV4cHJlc3Npb24nLCAtPlxuICAgICAgICBhc3QgPSBoYXJtb255LnBhcnNlIFwiXCJcIlxuICAgICAgICBleHBvcnQgZGVmYXVsdCBmdW5jdGlvbigpe307XG4gICAgICAgIFwiXCJcIiwgc291cmNlVHlwZTogJ21vZHVsZSdcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3QsIGVjbWFWZXJzaW9uOiA2LCBzb3VyY2VUeXBlOiAnbW9kdWxlJ1xuICAgICAgICBleHBlY3Qoc2NvcGVNYW5hZ2VyLnNjb3BlcykudG8uaGF2ZS5sZW5ndGggM1xuICAgICAgICBnbG9iYWxTY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMF1cbiAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdtb2R1bGUnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMl1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdmdW5jdGlvbidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICdhcmd1bWVudHMnXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAwXG5cbiAgICBpdCAnc2hvdWxkIGV4cG9ydCBsaXRlcmFsJywgLT5cbiAgICAgICAgYXN0ID0gaGFybW9ueS5wYXJzZSBcIlwiXCJcbiAgICAgICAgZXhwb3J0IGRlZmF1bHQgNDI7XG4gICAgICAgIFwiXCJcIiwgc291cmNlVHlwZTogJ21vZHVsZSdcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3QsIGVjbWFWZXJzaW9uOiA2LCBzb3VyY2VUeXBlOiAnbW9kdWxlJ1xuICAgICAgICBleHBlY3Qoc2NvcGVNYW5hZ2VyLnNjb3BlcykudG8uaGF2ZS5sZW5ndGggMlxuICAgICAgICBnbG9iYWxTY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMF1cbiAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdtb2R1bGUnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgIGl0ICdzaG91bGQgcmVmZXIgZXhwb3J0ZWQgcmVmZXJlbmNlcyMxJywgLT5cbiAgICAgICAgYXN0ID0gaGFybW9ueS5wYXJzZSBcIlwiXCJcbiAgICAgICAgZXhwb3J0IHt4fTtcbiAgICAgICAgXCJcIlwiLCBzb3VyY2VUeXBlOiAnbW9kdWxlJ1xuXG4gICAgICAgIHNjb3BlTWFuYWdlciA9IGVzY29wZS5hbmFseXplIGFzdCwgZWNtYVZlcnNpb246IDYsIHNvdXJjZVR5cGU6ICdtb2R1bGUnXG4gICAgICAgIGV4cGVjdChzY29wZU1hbmFnZXIuc2NvcGVzKS50by5oYXZlLmxlbmd0aCAyXG4gICAgICAgIGdsb2JhbFNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1swXVxuICAgICAgICBleHBlY3QoZ2xvYmFsU2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2dsb2JhbCdcbiAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMFxuICAgICAgICBleHBlY3QoZ2xvYmFsU2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggMFxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1sxXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ21vZHVsZSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMFxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggMVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1swXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsICd4J1xuXG4gICAgaXQgJ3Nob3VsZCByZWZlciBleHBvcnRlZCByZWZlcmVuY2VzIzInLCAtPlxuICAgICAgICBhc3QgPSBoYXJtb255LnBhcnNlIFwiXCJcIlxuICAgICAgICBleHBvcnQge3YgYXMgeH07XG4gICAgICAgIFwiXCJcIiwgc291cmNlVHlwZTogJ21vZHVsZSdcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3QsIGVjbWFWZXJzaW9uOiA2LCBzb3VyY2VUeXBlOiAnbW9kdWxlJ1xuICAgICAgICBleHBlY3Qoc2NvcGVNYW5hZ2VyLnNjb3BlcykudG8uaGF2ZS5sZW5ndGggMlxuICAgICAgICBnbG9iYWxTY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMF1cbiAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdtb2R1bGUnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMF0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAndidcblxuICAgIGl0ICdzaG91bGQgbm90IHJlZmVyIGV4cG9ydGVkIHJlZmVyZW5jZXMgZnJvbSBvdGhlciBzb3VyY2UjMScsIC0+XG4gICAgICAgIGFzdCA9IGhhcm1vbnkucGFyc2UgXCJcIlwiXG4gICAgICAgIGV4cG9ydCB7eH0gZnJvbSBcIm1vZFwiO1xuICAgICAgICBcIlwiXCIsIHNvdXJjZVR5cGU6ICdtb2R1bGUnXG5cbiAgICAgICAgc2NvcGVNYW5hZ2VyID0gZXNjb3BlLmFuYWx5emUgYXN0LCBlY21hVmVyc2lvbjogNiwgc291cmNlVHlwZTogJ21vZHVsZSdcbiAgICAgICAgZXhwZWN0KHNjb3BlTWFuYWdlci5zY29wZXMpLnRvLmhhdmUubGVuZ3RoIDJcbiAgICAgICAgZ2xvYmFsU2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzBdXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS50eXBlKS50by5iZS5lcXVhbCAnZ2xvYmFsJ1xuICAgICAgICBleHBlY3QoZ2xvYmFsU2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAwXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzFdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnbW9kdWxlJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAwXG5cbiAgICBpdCAnc2hvdWxkIG5vdCByZWZlciBleHBvcnRlZCByZWZlcmVuY2VzIGZyb20gb3RoZXIgc291cmNlIzInLCAtPlxuICAgICAgICBhc3QgPSBoYXJtb255LnBhcnNlIFwiXCJcIlxuICAgICAgICBleHBvcnQge3YgYXMgeH0gZnJvbSBcIm1vZFwiO1xuICAgICAgICBcIlwiXCIsIHNvdXJjZVR5cGU6ICdtb2R1bGUnXG5cbiAgICAgICAgc2NvcGVNYW5hZ2VyID0gZXNjb3BlLmFuYWx5emUgYXN0LCBlY21hVmVyc2lvbjogNiwgc291cmNlVHlwZTogJ21vZHVsZSdcbiAgICAgICAgZXhwZWN0KHNjb3BlTWFuYWdlci5zY29wZXMpLnRvLmhhdmUubGVuZ3RoIDJcbiAgICAgICAgZ2xvYmFsU2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzBdXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS50eXBlKS50by5iZS5lcXVhbCAnZ2xvYmFsJ1xuICAgICAgICBleHBlY3QoZ2xvYmFsU2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAwXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzFdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnbW9kdWxlJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAwXG5cbiAgICBpdCAnc2hvdWxkIG5vdCByZWZlciBleHBvcnRlZCByZWZlcmVuY2VzIGZyb20gb3RoZXIgc291cmNlIzMnLCAtPlxuICAgICAgICBhc3QgPSBoYXJtb255LnBhcnNlIFwiXCJcIlxuICAgICAgICBleHBvcnQgKiBmcm9tIFwibW9kXCI7XG4gICAgICAgIFwiXCJcIiwgc291cmNlVHlwZTogJ21vZHVsZSdcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3QsIGVjbWFWZXJzaW9uOiA2LCBzb3VyY2VUeXBlOiAnbW9kdWxlJ1xuICAgICAgICBleHBlY3Qoc2NvcGVNYW5hZ2VyLnNjb3BlcykudG8uaGF2ZS5sZW5ndGggMlxuICAgICAgICBnbG9iYWxTY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMF1cbiAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdtb2R1bGUnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuIyB2aW06IHNldCBzdz00IHRzPTQgZXQgdHc9ODAgOlxuIl19
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/powered-test/es6-import.js b/tools/eslint/node_modules/escope/powered-test/es6-import.js
      new file mode 100644
      index 00000000000000..4d6e7f575e15d6
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/powered-test/es6-import.js
      @@ -0,0 +1,103 @@
      +(function() {
      +  var escope, expect, harmony;
      +
      +  expect = require('chai').expect;
      +
      +  harmony = require('../third_party/esprima');
      +
      +  escope = require('..');
      +
      +  describe('import declaration', function() {
      +    it('should import names from source', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = harmony.parse("import v from \"mod\";", {
      +        sourceType: 'module'
      +      });
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6,
      +        sourceType: 'module'
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      globalScope = scopeManager.scopes[0];
      +      expect(globalScope.type).to.be.equal('global');
      +      expect(globalScope.variables).to.have.length(0);
      +      expect(globalScope.references).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('module');
      +      expect(scope.isStrict).to.be["true"];
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('v');
      +      expect(scope.variables[0].defs[0].type).to.be.equal('ImportBinding');
      +      return expect(scope.references).to.have.length(0);
      +    });
      +    it('should import namespaces', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = harmony.parse("import * as ns from \"mod\";", {
      +        sourceType: 'module'
      +      });
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6,
      +        sourceType: 'module'
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      globalScope = scopeManager.scopes[0];
      +      expect(globalScope.type).to.be.equal('global');
      +      expect(globalScope.variables).to.have.length(0);
      +      expect(globalScope.references).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('module');
      +      expect(scope.isStrict).to.be["true"];
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('ns');
      +      expect(scope.variables[0].defs[0].type).to.be.equal('ImportBinding');
      +      return expect(scope.references).to.have.length(0);
      +    });
      +    it('should import insided names#1', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = harmony.parse("import {x} from \"mod\";", {
      +        sourceType: 'module'
      +      });
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6,
      +        sourceType: 'module'
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      globalScope = scopeManager.scopes[0];
      +      expect(globalScope.type).to.be.equal('global');
      +      expect(globalScope.variables).to.have.length(0);
      +      expect(globalScope.references).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('module');
      +      expect(scope.isStrict).to.be["true"];
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('x');
      +      expect(scope.variables[0].defs[0].type).to.be.equal('ImportBinding');
      +      return expect(scope.references).to.have.length(0);
      +    });
      +    return it('should import insided names#2', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = harmony.parse("import {x as v} from \"mod\";", {
      +        sourceType: 'module'
      +      });
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6,
      +        sourceType: 'module'
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      globalScope = scopeManager.scopes[0];
      +      expect(globalScope.type).to.be.equal('global');
      +      expect(globalScope.variables).to.have.length(0);
      +      expect(globalScope.references).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('module');
      +      expect(scope.isStrict).to.be["true"];
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('v');
      +      expect(scope.variables[0].defs[0].type).to.be.equal('ImportBinding');
      +      return expect(scope.references).to.have.length(0);
      +    });
      +  });
      +
      +}).call(this);
      +
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVzNi1pbXBvcnQuY29mZmVlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVCQTtBQUFBLE1BQUEsdUJBQUE7O0FBQUEsRUFBQSxNQUFBLEdBQVMsT0FBQSxDQUFTLE1BQVQsQ0FBZSxDQUFDLE1BQXpCLENBQUE7O0FBQUEsRUFDQSxPQUFBLEdBQVUsT0FBQSxDQUFTLHdCQUFULENBRFYsQ0FBQTs7QUFBQSxFQUVBLE1BQUEsR0FBUyxPQUFBLENBQVMsSUFBVCxDQUZULENBQUE7O0FBQUEsRUFJQSxRQUFBLENBQVUsb0JBQVYsRUFBK0IsU0FBQSxHQUFBO0FBRTNCLElBQUEsRUFBQSxDQUFJLGlDQUFKLEVBQXNDLFNBQUEsR0FBQTtBQUNsQyxVQUFBLHFDQUFBO0FBQUEsTUFBQSxHQUFBLEdBQU0sT0FBTyxDQUFDLEtBQVIsQ0FBaUIsd0JBQWpCLEVBRUQ7QUFBQSxRQUFBLFVBQUEsRUFBYSxRQUFiO09BRkMsQ0FBTixDQUFBO0FBQUEsTUFJQSxZQUFBLEdBQWUsTUFBTSxDQUFDLE9BQVAsQ0FBZSxHQUFmLEVBQW9CO0FBQUEsUUFBQSxXQUFBLEVBQWEsQ0FBYjtBQUFBLFFBQWdCLFVBQUEsRUFBYSxRQUE3QjtPQUFwQixDQUpmLENBQUE7QUFBQSxNQUtBLE1BQUEsQ0FBTyxZQUFZLENBQUMsTUFBcEIsQ0FBMkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXBDLENBQTJDLENBQTNDLENBTEEsQ0FBQTtBQUFBLE1BTUEsV0FBQSxHQUFjLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQU5sQyxDQUFBO0FBQUEsTUFPQSxNQUFBLENBQU8sV0FBVyxDQUFDLElBQW5CLENBQXdCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEvQixDQUFzQyxRQUF0QyxDQVBBLENBQUE7QUFBQSxNQVFBLE1BQUEsQ0FBTyxXQUFXLENBQUMsU0FBbkIsQ0FBNkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXRDLENBQTZDLENBQTdDLENBUkEsQ0FBQTtBQUFBLE1BU0EsTUFBQSxDQUFPLFdBQVcsQ0FBQyxVQUFuQixDQUE4QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBdkMsQ0FBOEMsQ0FBOUMsQ0FUQSxDQUFBO0FBQUEsTUFXQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBWDVCLENBQUE7QUFBQSxNQVlBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsUUFBaEMsQ0FaQSxDQUFBO0FBQUEsTUFhQSxNQUFBLENBQU8sS0FBSyxDQUFDLFFBQWIsQ0FBc0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0FiNUIsQ0FBQTtBQUFBLE1BY0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQWRBLENBQUE7QUFBQSxNQWVBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxHQUE3QyxDQWZBLENBQUE7QUFBQSxNQWdCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUFLLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBbEMsQ0FBdUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQTlDLENBQXFELGVBQXJELENBaEJBLENBQUE7YUFpQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFiLENBQXdCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFqQyxDQUF3QyxDQUF4QyxFQWxCa0M7SUFBQSxDQUF0QyxDQUFBLENBQUE7QUFBQSxJQW9CQSxFQUFBLENBQUksMEJBQUosRUFBK0IsU0FBQSxHQUFBO0FBQzNCLFVBQUEscUNBQUE7QUFBQSxNQUFBLEdBQUEsR0FBTSxPQUFPLENBQUMsS0FBUixDQUFpQiw4QkFBakIsRUFFRDtBQUFBLFFBQUEsVUFBQSxFQUFhLFFBQWI7T0FGQyxDQUFOLENBQUE7QUFBQSxNQUlBLFlBQUEsR0FBZSxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsRUFBb0I7QUFBQSxRQUFBLFdBQUEsRUFBYSxDQUFiO0FBQUEsUUFBZ0IsVUFBQSxFQUFhLFFBQTdCO09BQXBCLENBSmYsQ0FBQTtBQUFBLE1BS0EsTUFBQSxDQUFPLFlBQVksQ0FBQyxNQUFwQixDQUEyQixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBcEMsQ0FBMkMsQ0FBM0MsQ0FMQSxDQUFBO0FBQUEsTUFNQSxXQUFBLEdBQWMsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBTmxDLENBQUE7QUFBQSxNQU9BLE1BQUEsQ0FBTyxXQUFXLENBQUMsSUFBbkIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQS9CLENBQXNDLFFBQXRDLENBUEEsQ0FBQTtBQUFBLE1BUUEsTUFBQSxDQUFPLFdBQVcsQ0FBQyxTQUFuQixDQUE2QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBdEMsQ0FBNkMsQ0FBN0MsQ0FSQSxDQUFBO0FBQUEsTUFTQSxNQUFBLENBQU8sV0FBVyxDQUFDLFVBQW5CLENBQThCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUF2QyxDQUE4QyxDQUE5QyxDQVRBLENBQUE7QUFBQSxNQVdBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FYNUIsQ0FBQTtBQUFBLE1BWUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxRQUFoQyxDQVpBLENBQUE7QUFBQSxNQWFBLE1BQUEsQ0FBTyxLQUFLLENBQUMsUUFBYixDQUFzQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxDQWI1QixDQUFBO0FBQUEsTUFjQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBZEEsQ0FBQTtBQUFBLE1BZUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLElBQTdDLENBZkEsQ0FBQTtBQUFBLE1BZ0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQUssQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUFsQyxDQUF1QyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBOUMsQ0FBcUQsZUFBckQsQ0FoQkEsQ0FBQTthQWlCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLEVBbEIyQjtJQUFBLENBQS9CLENBcEJBLENBQUE7QUFBQSxJQXdDQSxFQUFBLENBQUksK0JBQUosRUFBb0MsU0FBQSxHQUFBO0FBQ2hDLFVBQUEscUNBQUE7QUFBQSxNQUFBLEdBQUEsR0FBTSxPQUFPLENBQUMsS0FBUixDQUFpQiwwQkFBakIsRUFFRDtBQUFBLFFBQUEsVUFBQSxFQUFhLFFBQWI7T0FGQyxDQUFOLENBQUE7QUFBQSxNQUlBLFlBQUEsR0FBZSxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsRUFBb0I7QUFBQSxRQUFBLFdBQUEsRUFBYSxDQUFiO0FBQUEsUUFBZ0IsVUFBQSxFQUFhLFFBQTdCO09BQXBCLENBSmYsQ0FBQTtBQUFBLE1BS0EsTUFBQSxDQUFPLFlBQVksQ0FBQyxNQUFwQixDQUEyQixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBcEMsQ0FBMkMsQ0FBM0MsQ0FMQSxDQUFBO0FBQUEsTUFNQSxXQUFBLEdBQWMsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBTmxDLENBQUE7QUFBQSxNQU9BLE1BQUEsQ0FBTyxXQUFXLENBQUMsSUFBbkIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQS9CLENBQXNDLFFBQXRDLENBUEEsQ0FBQTtBQUFBLE1BUUEsTUFBQSxDQUFPLFdBQVcsQ0FBQyxTQUFuQixDQUE2QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBdEMsQ0FBNkMsQ0FBN0MsQ0FSQSxDQUFBO0FBQUEsTUFTQSxNQUFBLENBQU8sV0FBVyxDQUFDLFVBQW5CLENBQThCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUF2QyxDQUE4QyxDQUE5QyxDQVRBLENBQUE7QUFBQSxNQVdBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FYNUIsQ0FBQTtBQUFBLE1BWUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxRQUFoQyxDQVpBLENBQUE7QUFBQSxNQWFBLE1BQUEsQ0FBTyxLQUFLLENBQUMsUUFBYixDQUFzQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxDQWI1QixDQUFBO0FBQUEsTUFjQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBZEEsQ0FBQTtBQUFBLE1BZUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLEdBQTdDLENBZkEsQ0FBQTtBQUFBLE1BZ0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQUssQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUFsQyxDQUF1QyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBOUMsQ0FBcUQsZUFBckQsQ0FoQkEsQ0FBQTthQWlCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLEVBbEJnQztJQUFBLENBQXBDLENBeENBLENBQUE7V0E0REEsRUFBQSxDQUFJLCtCQUFKLEVBQW9DLFNBQUEsR0FBQTtBQUNoQyxVQUFBLHFDQUFBO0FBQUEsTUFBQSxHQUFBLEdBQU0sT0FBTyxDQUFDLEtBQVIsQ0FBaUIsK0JBQWpCLEVBRUQ7QUFBQSxRQUFBLFVBQUEsRUFBYSxRQUFiO09BRkMsQ0FBTixDQUFBO0FBQUEsTUFJQSxZQUFBLEdBQWUsTUFBTSxDQUFDLE9BQVAsQ0FBZSxHQUFmLEVBQW9CO0FBQUEsUUFBQSxXQUFBLEVBQWEsQ0FBYjtBQUFBLFFBQWdCLFVBQUEsRUFBYSxRQUE3QjtPQUFwQixDQUpmLENBQUE7QUFBQSxNQUtBLE1BQUEsQ0FBTyxZQUFZLENBQUMsTUFBcEIsQ0FBMkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXBDLENBQTJDLENBQTNDLENBTEEsQ0FBQTtBQUFBLE1BTUEsV0FBQSxHQUFjLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQU5sQyxDQUFBO0FBQUEsTUFPQSxNQUFBLENBQU8sV0FBVyxDQUFDLElBQW5CLENBQXdCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEvQixDQUFzQyxRQUF0QyxDQVBBLENBQUE7QUFBQSxNQVFBLE1BQUEsQ0FBTyxXQUFXLENBQUMsU0FBbkIsQ0FBNkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXRDLENBQTZDLENBQTdDLENBUkEsQ0FBQTtBQUFBLE1BU0EsTUFBQSxDQUFPLFdBQVcsQ0FBQyxVQUFuQixDQUE4QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBdkMsQ0FBOEMsQ0FBOUMsQ0FUQSxDQUFBO0FBQUEsTUFXQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBWDVCLENBQUE7QUFBQSxNQVlBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsUUFBaEMsQ0FaQSxDQUFBO0FBQUEsTUFhQSxNQUFBLENBQU8sS0FBSyxDQUFDLFFBQWIsQ0FBc0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0FiNUIsQ0FBQTtBQUFBLE1BY0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQWRBLENBQUE7QUFBQSxNQWVBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxHQUE3QyxDQWZBLENBQUE7QUFBQSxNQWdCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUFLLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBbEMsQ0FBdUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQTlDLENBQXFELGVBQXJELENBaEJBLENBQUE7YUFpQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFiLENBQXdCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFqQyxDQUF3QyxDQUF4QyxFQWxCZ0M7SUFBQSxDQUFwQyxFQTlEMkI7RUFBQSxDQUEvQixDQUpBLENBQUE7QUFBQSIsImZpbGUiOiJlczYtaW1wb3J0LmpzIiwic291cmNlUm9vdCI6Ii9zb3VyY2UvIiwic291cmNlc0NvbnRlbnQiOlsiIyAtKi0gY29kaW5nOiB1dGYtOCAtKi1cbiMgIENvcHlyaWdodCAoQykgMjAxNCBZdXN1a2UgU3V6dWtpIDx1dGF0YW5lLnRlYUBnbWFpbC5jb20+XG4jXG4jICBSZWRpc3RyaWJ1dGlvbiBhbmQgdXNlIGluIHNvdXJjZSBhbmQgYmluYXJ5IGZvcm1zLCB3aXRoIG9yIHdpdGhvdXRcbiMgIG1vZGlmaWNhdGlvbiwgYXJlIHBlcm1pdHRlZCBwcm92aWRlZCB0aGF0IHRoZSBmb2xsb3dpbmcgY29uZGl0aW9ucyBhcmUgbWV0OlxuI1xuIyAgICAqIFJlZGlzdHJpYnV0aW9ucyBvZiBzb3VyY2UgY29kZSBtdXN0IHJldGFpbiB0aGUgYWJvdmUgY29weXJpZ2h0XG4jICAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyLlxuIyAgICAqIFJlZGlzdHJpYnV0aW9ucyBpbiBiaW5hcnkgZm9ybSBtdXN0IHJlcHJvZHVjZSB0aGUgYWJvdmUgY29weXJpZ2h0XG4jICAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyIGluIHRoZVxuIyAgICAgIGRvY3VtZW50YXRpb24gYW5kL29yIG90aGVyIG1hdGVyaWFscyBwcm92aWRlZCB3aXRoIHRoZSBkaXN0cmlidXRpb24uXG4jXG4jICBUSElTIFNPRlRXQVJFIElTIFBST1ZJREVEIEJZIFRIRSBDT1BZUklHSFQgSE9MREVSUyBBTkQgQ09OVFJJQlVUT1JTIFwiQVMgSVNcIlxuIyAgQU5EIEFOWSBFWFBSRVNTIE9SIElNUExJRUQgV0FSUkFOVElFUywgSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFRIRVxuIyAgSU1QTElFRCBXQVJSQU5USUVTIE9GIE1FUkNIQU5UQUJJTElUWSBBTkQgRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0VcbiMgIEFSRSBESVNDTEFJTUVELiBJTiBOTyBFVkVOVCBTSEFMTCA8Q09QWVJJR0hUIEhPTERFUj4gQkUgTElBQkxFIEZPUiBBTllcbiMgIERJUkVDVCwgSU5ESVJFQ1QsIElOQ0lERU5UQUwsIFNQRUNJQUwsIEVYRU1QTEFSWSwgT1IgQ09OU0VRVUVOVElBTCBEQU1BR0VTXG4jICAoSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFBST0NVUkVNRU5UIE9GIFNVQlNUSVRVVEUgR09PRFMgT1IgU0VSVklDRVM7XG4jICBMT1NTIE9GIFVTRSwgREFUQSwgT1IgUFJPRklUUzsgT1IgQlVTSU5FU1MgSU5URVJSVVBUSU9OKSBIT1dFVkVSIENBVVNFRCBBTkRcbiMgIE9OIEFOWSBUSEVPUlkgT0YgTElBQklMSVRZLCBXSEVUSEVSIElOIENPTlRSQUNULCBTVFJJQ1QgTElBQklMSVRZLCBPUiBUT1JUXG4jICAoSU5DTFVESU5HIE5FR0xJR0VOQ0UgT1IgT1RIRVJXSVNFKSBBUklTSU5HIElOIEFOWSBXQVkgT1VUIE9GIFRIRSBVU0UgT0ZcbiMgIFRISVMgU09GVFdBUkUsIEVWRU4gSUYgQURWSVNFRCBPRiBUSEUgUE9TU0lCSUxJVFkgT0YgU1VDSCBEQU1BR0UuXG5cbmV4cGVjdCA9IHJlcXVpcmUoJ2NoYWknKS5leHBlY3Rcbmhhcm1vbnkgPSByZXF1aXJlICcuLi90aGlyZF9wYXJ0eS9lc3ByaW1hJ1xuZXNjb3BlID0gcmVxdWlyZSAnLi4nXG5cbmRlc2NyaWJlICdpbXBvcnQgZGVjbGFyYXRpb24nLCAtPlxuICAgICMgaHR0cDovL3Blb3BsZS5tb3ppbGxhLm9yZy9+am9yZW5kb3JmZi9lczYtZHJhZnQuaHRtbCNzZWMtc3RhdGljLWFuZC1ydW50bWUtc2VtYW50aWNzLW1vZHVsZS1yZWNvcmRzXG4gICAgaXQgJ3Nob3VsZCBpbXBvcnQgbmFtZXMgZnJvbSBzb3VyY2UnLCAtPlxuICAgICAgICBhc3QgPSBoYXJtb255LnBhcnNlIFwiXCJcIlxuICAgICAgICBpbXBvcnQgdiBmcm9tIFwibW9kXCI7XG4gICAgICAgIFwiXCJcIiwgc291cmNlVHlwZTogJ21vZHVsZSdcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3QsIGVjbWFWZXJzaW9uOiA2LCBzb3VyY2VUeXBlOiAnbW9kdWxlJ1xuICAgICAgICBleHBlY3Qoc2NvcGVNYW5hZ2VyLnNjb3BlcykudG8uaGF2ZS5sZW5ndGggMlxuICAgICAgICBnbG9iYWxTY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMF1cbiAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdtb2R1bGUnXG4gICAgICAgIGV4cGVjdChzY29wZS5pc1N0cmljdCkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAxXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwgJ3YnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMF0uZGVmc1swXS50eXBlKS50by5iZS5lcXVhbCAnSW1wb3J0QmluZGluZydcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgIGl0ICdzaG91bGQgaW1wb3J0IG5hbWVzcGFjZXMnLCAtPlxuICAgICAgICBhc3QgPSBoYXJtb255LnBhcnNlIFwiXCJcIlxuICAgICAgICBpbXBvcnQgKiBhcyBucyBmcm9tIFwibW9kXCI7XG4gICAgICAgIFwiXCJcIiwgc291cmNlVHlwZTogJ21vZHVsZSdcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3QsIGVjbWFWZXJzaW9uOiA2LCBzb3VyY2VUeXBlOiAnbW9kdWxlJ1xuICAgICAgICBleHBlY3Qoc2NvcGVNYW5hZ2VyLnNjb3BlcykudG8uaGF2ZS5sZW5ndGggMlxuICAgICAgICBnbG9iYWxTY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMF1cbiAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdtb2R1bGUnXG4gICAgICAgIGV4cGVjdChzY29wZS5pc1N0cmljdCkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAxXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwgJ25zJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLmRlZnNbMF0udHlwZSkudG8uYmUuZXF1YWwgJ0ltcG9ydEJpbmRpbmcnXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAwXG5cbiAgICBpdCAnc2hvdWxkIGltcG9ydCBpbnNpZGVkIG5hbWVzIzEnLCAtPlxuICAgICAgICBhc3QgPSBoYXJtb255LnBhcnNlIFwiXCJcIlxuICAgICAgICBpbXBvcnQge3h9IGZyb20gXCJtb2RcIjtcbiAgICAgICAgXCJcIlwiLCBzb3VyY2VUeXBlOiAnbW9kdWxlJ1xuXG4gICAgICAgIHNjb3BlTWFuYWdlciA9IGVzY29wZS5hbmFseXplIGFzdCwgZWNtYVZlcnNpb246IDYsIHNvdXJjZVR5cGU6ICdtb2R1bGUnXG4gICAgICAgIGV4cGVjdChzY29wZU1hbmFnZXIuc2NvcGVzKS50by5oYXZlLmxlbmd0aCAyXG4gICAgICAgIGdsb2JhbFNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1swXVxuICAgICAgICBleHBlY3QoZ2xvYmFsU2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2dsb2JhbCdcbiAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMFxuICAgICAgICBleHBlY3QoZ2xvYmFsU2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggMFxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1sxXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ21vZHVsZSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLmlzU3RyaWN0KS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5uYW1lKS50by5iZS5lcXVhbCAneCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5kZWZzWzBdLnR5cGUpLnRvLmJlLmVxdWFsICdJbXBvcnRCaW5kaW5nJ1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggMFxuXG4gICAgaXQgJ3Nob3VsZCBpbXBvcnQgaW5zaWRlZCBuYW1lcyMyJywgLT5cbiAgICAgICAgYXN0ID0gaGFybW9ueS5wYXJzZSBcIlwiXCJcbiAgICAgICAgaW1wb3J0IHt4IGFzIHZ9IGZyb20gXCJtb2RcIjtcbiAgICAgICAgXCJcIlwiLCBzb3VyY2VUeXBlOiAnbW9kdWxlJ1xuXG4gICAgICAgIHNjb3BlTWFuYWdlciA9IGVzY29wZS5hbmFseXplIGFzdCwgZWNtYVZlcnNpb246IDYsIHNvdXJjZVR5cGU6ICdtb2R1bGUnXG4gICAgICAgIGV4cGVjdChzY29wZU1hbmFnZXIuc2NvcGVzKS50by5oYXZlLmxlbmd0aCAyXG4gICAgICAgIGdsb2JhbFNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1swXVxuICAgICAgICBleHBlY3QoZ2xvYmFsU2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2dsb2JhbCdcbiAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMFxuICAgICAgICBleHBlY3QoZ2xvYmFsU2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggMFxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1sxXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ21vZHVsZSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLmlzU3RyaWN0KS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5uYW1lKS50by5iZS5lcXVhbCAndidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5kZWZzWzBdLnR5cGUpLnRvLmJlLmVxdWFsICdJbXBvcnRCaW5kaW5nJ1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggMFxuXG4gICAgIyBUT0RPOiBTaG91bGQgcGFyc2UgaXQuXG4gICAgIyBpbXBvcnQgZnJvbSBcIm1vZFwiO1xuXG4jIHZpbTogc2V0IHN3PTQgdHM9NCBldCB0dz04MCA6XG4iXX0=
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/powered-test/es6-iteration-scope.js b/tools/eslint/node_modules/escope/powered-test/es6-iteration-scope.js
      new file mode 100644
      index 00000000000000..79dbf8de292463
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/powered-test/es6-iteration-scope.js
      @@ -0,0 +1,167 @@
      +(function() {
      +  var escope, expect, harmony;
      +
      +  expect = require('chai').expect;
      +
      +  harmony = require('../third_party/esprima');
      +
      +  escope = require('..');
      +
      +  describe('ES6 iteration scope', function() {
      +    it('let materialize iteration scope for ForInStatement#1', function() {
      +      var ast, iterScope, scope, scopeManager;
      +      ast = harmony.parse("(function () {\n    let i = 20;\n    for (let i in i) {\n        console.log(i);\n    }\n}());");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(5);
      +      scope = scopeManager.scopes[0];
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.variables).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(2);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      expect(scope.variables[1].name).to.be.equal('i');
      +      expect(scope.references).to.have.length(1);
      +      expect(scope.references[0].identifier.name).to.be.equal('i');
      +      expect(scope.references[0].resolved).to.be.equal(scope.variables[1]);
      +      iterScope = scope = scopeManager.scopes[2];
      +      expect(scope.type).to.be.equal('TDZ');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('i');
      +      expect(scope.variables[0].defs[0].type).to.be.equal('TDZ');
      +      expect(scope.references).to.have.length(1);
      +      expect(scope.references[0].identifier.name).to.be.equal('i');
      +      expect(scope.references[0].resolved).to.be.equal(scope.variables[0]);
      +      iterScope = scope = scopeManager.scopes[3];
      +      expect(scope.type).to.be.equal('for');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('i');
      +      expect(scope.references).to.have.length(1);
      +      expect(scope.references[0].identifier.name).to.be.equal('i');
      +      expect(scope.references[0].resolved).to.be.equal(scope.variables[0]);
      +      scope = scopeManager.scopes[4];
      +      expect(scope.type).to.be.equal('block');
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(2);
      +      expect(scope.references[0].identifier.name).to.be.equal('console');
      +      expect(scope.references[0].resolved).to.be.equal(null);
      +      expect(scope.references[1].identifier.name).to.be.equal('i');
      +      return expect(scope.references[1].resolved).to.be.equal(iterScope.variables[0]);
      +    });
      +    it('let materialize iteration scope for ForInStatement#2', function() {
      +      var ast, iterScope, scope, scopeManager;
      +      ast = harmony.parse("(function () {\n    let i = 20;\n    for (let { i, j, k } in i) {\n        console.log(i);\n    }\n}());");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(5);
      +      scope = scopeManager.scopes[0];
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.variables).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(2);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      expect(scope.variables[1].name).to.be.equal('i');
      +      expect(scope.references).to.have.length(1);
      +      expect(scope.references[0].identifier.name).to.be.equal('i');
      +      expect(scope.references[0].resolved).to.be.equal(scope.variables[1]);
      +      iterScope = scope = scopeManager.scopes[2];
      +      expect(scope.type).to.be.equal('TDZ');
      +      expect(scope.variables).to.have.length(3);
      +      expect(scope.variables[0].name).to.be.equal('i');
      +      expect(scope.variables[0].defs[0].type).to.be.equal('TDZ');
      +      expect(scope.variables[1].name).to.be.equal('j');
      +      expect(scope.variables[1].defs[0].type).to.be.equal('TDZ');
      +      expect(scope.variables[2].name).to.be.equal('k');
      +      expect(scope.variables[2].defs[0].type).to.be.equal('TDZ');
      +      expect(scope.references).to.have.length(1);
      +      expect(scope.references[0].identifier.name).to.be.equal('i');
      +      expect(scope.references[0].resolved).to.be.equal(scope.variables[0]);
      +      iterScope = scope = scopeManager.scopes[3];
      +      expect(scope.type).to.be.equal('for');
      +      expect(scope.variables).to.have.length(3);
      +      expect(scope.variables[0].name).to.be.equal('i');
      +      expect(scope.variables[1].name).to.be.equal('j');
      +      expect(scope.variables[2].name).to.be.equal('k');
      +      expect(scope.references).to.have.length(3);
      +      expect(scope.references[0].identifier.name).to.be.equal('i');
      +      expect(scope.references[0].resolved).to.be.equal(scope.variables[0]);
      +      expect(scope.references[1].identifier.name).to.be.equal('j');
      +      expect(scope.references[1].resolved).to.be.equal(scope.variables[1]);
      +      expect(scope.references[2].identifier.name).to.be.equal('k');
      +      expect(scope.references[2].resolved).to.be.equal(scope.variables[2]);
      +      scope = scopeManager.scopes[4];
      +      expect(scope.type).to.be.equal('block');
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(2);
      +      expect(scope.references[0].identifier.name).to.be.equal('console');
      +      expect(scope.references[0].resolved).to.be.equal(null);
      +      expect(scope.references[1].identifier.name).to.be.equal('i');
      +      return expect(scope.references[1].resolved).to.be.equal(iterScope.variables[0]);
      +    });
      +    return it('let materialize iteration scope for ForStatement#2', function() {
      +      var ast, functionScope, iterScope, scope, scopeManager;
      +      ast = harmony.parse("(function () {\n    let i = 20;\n    let obj = {};\n    for (let { i, j, k } = obj; i < okok; ++i) {\n        console.log(i, j, k);\n    }\n}());");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(4);
      +      scope = scopeManager.scopes[0];
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.variables).to.have.length(0);
      +      functionScope = scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(3);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      expect(scope.variables[1].name).to.be.equal('i');
      +      expect(scope.variables[2].name).to.be.equal('obj');
      +      expect(scope.references).to.have.length(2);
      +      expect(scope.references[0].identifier.name).to.be.equal('i');
      +      expect(scope.references[0].resolved).to.be.equal(scope.variables[1]);
      +      expect(scope.references[1].identifier.name).to.be.equal('obj');
      +      expect(scope.references[1].resolved).to.be.equal(scope.variables[2]);
      +      iterScope = scope = scopeManager.scopes[2];
      +      expect(scope.type).to.be.equal('for');
      +      expect(scope.variables).to.have.length(3);
      +      expect(scope.variables[0].name).to.be.equal('i');
      +      expect(scope.variables[0].defs[0].type).to.be.equal('Variable');
      +      expect(scope.variables[1].name).to.be.equal('j');
      +      expect(scope.variables[1].defs[0].type).to.be.equal('Variable');
      +      expect(scope.variables[2].name).to.be.equal('k');
      +      expect(scope.variables[2].defs[0].type).to.be.equal('Variable');
      +      expect(scope.references).to.have.length(7);
      +      expect(scope.references[0].identifier.name).to.be.equal('i');
      +      expect(scope.references[0].resolved).to.be.equal(scope.variables[0]);
      +      expect(scope.references[1].identifier.name).to.be.equal('j');
      +      expect(scope.references[1].resolved).to.be.equal(scope.variables[1]);
      +      expect(scope.references[2].identifier.name).to.be.equal('k');
      +      expect(scope.references[2].resolved).to.be.equal(scope.variables[2]);
      +      expect(scope.references[3].identifier.name).to.be.equal('obj');
      +      expect(scope.references[3].resolved).to.be.equal(functionScope.variables[2]);
      +      expect(scope.references[4].identifier.name).to.be.equal('i');
      +      expect(scope.references[4].resolved).to.be.equal(scope.variables[0]);
      +      expect(scope.references[5].identifier.name).to.be.equal('okok');
      +      expect(scope.references[5].resolved).to.be["null"];
      +      expect(scope.references[6].identifier.name).to.be.equal('i');
      +      expect(scope.references[6].resolved).to.be.equal(scope.variables[0]);
      +      scope = scopeManager.scopes[3];
      +      expect(scope.type).to.be.equal('block');
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(4);
      +      expect(scope.references[0].identifier.name).to.be.equal('console');
      +      expect(scope.references[0].resolved).to.be["null"];
      +      expect(scope.references[1].identifier.name).to.be.equal('i');
      +      expect(scope.references[1].resolved).to.be.equal(iterScope.variables[0]);
      +      expect(scope.references[2].identifier.name).to.be.equal('j');
      +      expect(scope.references[2].resolved).to.be.equal(iterScope.variables[1]);
      +      expect(scope.references[3].identifier.name).to.be.equal('k');
      +      return expect(scope.references[3].resolved).to.be.equal(iterScope.variables[2]);
      +    });
      +  });
      +
      +}).call(this);
      +
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVzNi1pdGVyYXRpb24tc2NvcGUuY29mZmVlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVCQTtBQUFBLE1BQUEsdUJBQUE7O0FBQUEsRUFBQSxNQUFBLEdBQVMsT0FBQSxDQUFTLE1BQVQsQ0FBZSxDQUFDLE1BQXpCLENBQUE7O0FBQUEsRUFDQSxPQUFBLEdBQVUsT0FBQSxDQUFTLHdCQUFULENBRFYsQ0FBQTs7QUFBQSxFQUVBLE1BQUEsR0FBUyxPQUFBLENBQVMsSUFBVCxDQUZULENBQUE7O0FBQUEsRUFJQSxRQUFBLENBQVUscUJBQVYsRUFBZ0MsU0FBQSxHQUFBO0FBQzVCLElBQUEsRUFBQSxDQUFJLHNEQUFKLEVBQTJELFNBQUEsR0FBQTtBQUN2RCxVQUFBLG1DQUFBO0FBQUEsTUFBQSxHQUFBLEdBQU0sT0FBTyxDQUFDLEtBQVIsQ0FBaUIsZ0dBQWpCLENBQU4sQ0FBQTtBQUFBLE1BU0EsWUFBQSxHQUFlLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixFQUFvQjtBQUFBLFFBQUEsV0FBQSxFQUFhLENBQWI7T0FBcEIsQ0FUZixDQUFBO0FBQUEsTUFVQSxNQUFBLENBQU8sWUFBWSxDQUFDLE1BQXBCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQVZBLENBQUE7QUFBQSxNQVlBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FaNUIsQ0FBQTtBQUFBLE1BYUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxRQUFoQyxDQWJBLENBQUE7QUFBQSxNQWNBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0FkQSxDQUFBO0FBQUEsTUFnQkEsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQWhCNUIsQ0FBQTtBQUFBLE1BaUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsVUFBaEMsQ0FqQkEsQ0FBQTtBQUFBLE1Ba0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0FsQkEsQ0FBQTtBQUFBLE1BbUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxXQUE3QyxDQW5CQSxDQUFBO0FBQUEsTUFvQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLEdBQTdDLENBcEJBLENBQUE7QUFBQSxNQXFCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBckJBLENBQUE7QUFBQSxNQXNCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELEdBQXpELENBdEJBLENBQUE7QUFBQSxNQXVCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBM0MsQ0FBaUQsS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQWpFLENBdkJBLENBQUE7QUFBQSxNQXlCQSxTQUFBLEdBQVksS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQXpCeEMsQ0FBQTtBQUFBLE1BMEJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsS0FBaEMsQ0ExQkEsQ0FBQTtBQUFBLE1BMkJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0EzQkEsQ0FBQTtBQUFBLE1BNEJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxHQUE3QyxDQTVCQSxDQUFBO0FBQUEsTUE2QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBSyxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQWxDLENBQXVDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUE5QyxDQUFxRCxLQUFyRCxDQTdCQSxDQUFBO0FBQUEsTUE4QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFiLENBQXdCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFqQyxDQUF3QyxDQUF4QyxDQTlCQSxDQUFBO0FBQUEsTUErQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxHQUF6RCxDQS9CQSxDQUFBO0FBQUEsTUFnQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsUUFBM0IsQ0FBb0MsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQTNDLENBQWlELEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFqRSxDQWhDQSxDQUFBO0FBQUEsTUFrQ0EsU0FBQSxHQUFZLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FsQ3hDLENBQUE7QUFBQSxNQW1DQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLEtBQWhDLENBbkNBLENBQUE7QUFBQSxNQW9DQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBcENBLENBQUE7QUFBQSxNQXFDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsR0FBN0MsQ0FyQ0EsQ0FBQTtBQUFBLE1Bc0NBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsQ0F0Q0EsQ0FBQTtBQUFBLE1BdUNBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsR0FBekQsQ0F2Q0EsQ0FBQTtBQUFBLE1Bd0NBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFFBQTNCLENBQW9DLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEzQyxDQUFpRCxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBakUsQ0F4Q0EsQ0FBQTtBQUFBLE1BMENBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0ExQzVCLENBQUE7QUFBQSxNQTJDQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLE9BQWhDLENBM0NBLENBQUE7QUFBQSxNQTRDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBNUNBLENBQUE7QUFBQSxNQTZDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBN0NBLENBQUE7QUFBQSxNQThDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELFNBQXpELENBOUNBLENBQUE7QUFBQSxNQStDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBM0MsQ0FBaUQsSUFBakQsQ0EvQ0EsQ0FBQTtBQUFBLE1BZ0RBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsR0FBekQsQ0FoREEsQ0FBQTthQWlEQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBM0MsQ0FBaUQsU0FBUyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQXJFLEVBbER1RDtJQUFBLENBQTNELENBQUEsQ0FBQTtBQUFBLElBb0RBLEVBQUEsQ0FBSSxzREFBSixFQUEyRCxTQUFBLEdBQUE7QUFDdkQsVUFBQSxtQ0FBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLDBHQUFqQixDQUFOLENBQUE7QUFBQSxNQVNBLFlBQUEsR0FBZSxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsRUFBb0I7QUFBQSxRQUFBLFdBQUEsRUFBYSxDQUFiO09BQXBCLENBVGYsQ0FBQTtBQUFBLE1BVUEsTUFBQSxDQUFPLFlBQVksQ0FBQyxNQUFwQixDQUEyQixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBcEMsQ0FBMkMsQ0FBM0MsQ0FWQSxDQUFBO0FBQUEsTUFZQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBWjVCLENBQUE7QUFBQSxNQWFBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsUUFBaEMsQ0FiQSxDQUFBO0FBQUEsTUFjQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBZEEsQ0FBQTtBQUFBLE1BZ0JBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FoQjVCLENBQUE7QUFBQSxNQWlCQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFVBQWhDLENBakJBLENBQUE7QUFBQSxNQWtCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBbEJBLENBQUE7QUFBQSxNQW1CQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsV0FBN0MsQ0FuQkEsQ0FBQTtBQUFBLE1Bb0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxHQUE3QyxDQXBCQSxDQUFBO0FBQUEsTUFxQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFiLENBQXdCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFqQyxDQUF3QyxDQUF4QyxDQXJCQSxDQUFBO0FBQUEsTUFzQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxHQUF6RCxDQXRCQSxDQUFBO0FBQUEsTUF1QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsUUFBM0IsQ0FBb0MsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQTNDLENBQWlELEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFqRSxDQXZCQSxDQUFBO0FBQUEsTUF5QkEsU0FBQSxHQUFZLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0F6QnhDLENBQUE7QUFBQSxNQTBCQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLEtBQWhDLENBMUJBLENBQUE7QUFBQSxNQTJCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBM0JBLENBQUE7QUFBQSxNQTRCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsR0FBN0MsQ0E1QkEsQ0FBQTtBQUFBLE1BNkJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQUssQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUFsQyxDQUF1QyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBOUMsQ0FBcUQsS0FBckQsQ0E3QkEsQ0FBQTtBQUFBLE1BOEJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxHQUE3QyxDQTlCQSxDQUFBO0FBQUEsTUErQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBSyxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQWxDLENBQXVDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUE5QyxDQUFxRCxLQUFyRCxDQS9CQSxDQUFBO0FBQUEsTUFnQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLEdBQTdDLENBaENBLENBQUE7QUFBQSxNQWlDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUFLLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBbEMsQ0FBdUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQTlDLENBQXFELEtBQXJELENBakNBLENBQUE7QUFBQSxNQWtDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBbENBLENBQUE7QUFBQSxNQW1DQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELEdBQXpELENBbkNBLENBQUE7QUFBQSxNQW9DQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBM0MsQ0FBaUQsS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQWpFLENBcENBLENBQUE7QUFBQSxNQXNDQSxTQUFBLEdBQVksS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQXRDeEMsQ0FBQTtBQUFBLE1BdUNBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsS0FBaEMsQ0F2Q0EsQ0FBQTtBQUFBLE1Bd0NBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0F4Q0EsQ0FBQTtBQUFBLE1BeUNBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxHQUE3QyxDQXpDQSxDQUFBO0FBQUEsTUEwQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLEdBQTdDLENBMUNBLENBQUE7QUFBQSxNQTJDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsR0FBN0MsQ0EzQ0EsQ0FBQTtBQUFBLE1BNENBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsQ0E1Q0EsQ0FBQTtBQUFBLE1BNkNBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsR0FBekQsQ0E3Q0EsQ0FBQTtBQUFBLE1BOENBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFFBQTNCLENBQW9DLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEzQyxDQUFpRCxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBakUsQ0E5Q0EsQ0FBQTtBQUFBLE1BK0NBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsR0FBekQsQ0EvQ0EsQ0FBQTtBQUFBLE1BZ0RBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFFBQTNCLENBQW9DLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEzQyxDQUFpRCxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBakUsQ0FoREEsQ0FBQTtBQUFBLE1BaURBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsR0FBekQsQ0FqREEsQ0FBQTtBQUFBLE1Ba0RBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFFBQTNCLENBQW9DLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEzQyxDQUFpRCxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBakUsQ0FsREEsQ0FBQTtBQUFBLE1Bb0RBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FwRDVCLENBQUE7QUFBQSxNQXFEQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLE9BQWhDLENBckRBLENBQUE7QUFBQSxNQXNEQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBdERBLENBQUE7QUFBQSxNQXVEQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBdkRBLENBQUE7QUFBQSxNQXdEQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELFNBQXpELENBeERBLENBQUE7QUFBQSxNQXlEQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBM0MsQ0FBaUQsSUFBakQsQ0F6REEsQ0FBQTtBQUFBLE1BMERBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsR0FBekQsQ0ExREEsQ0FBQTthQTJEQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBM0MsQ0FBaUQsU0FBUyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQXJFLEVBNUR1RDtJQUFBLENBQTNELENBcERBLENBQUE7V0FrSEEsRUFBQSxDQUFJLG9EQUFKLEVBQXlELFNBQUEsR0FBQTtBQUNyRCxVQUFBLGtEQUFBO0FBQUEsTUFBQSxHQUFBLEdBQU0sT0FBTyxDQUFDLEtBQVIsQ0FBaUIsbUpBQWpCLENBQU4sQ0FBQTtBQUFBLE1BVUEsWUFBQSxHQUFlLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixFQUFvQjtBQUFBLFFBQUEsV0FBQSxFQUFhLENBQWI7T0FBcEIsQ0FWZixDQUFBO0FBQUEsTUFXQSxNQUFBLENBQU8sWUFBWSxDQUFDLE1BQXBCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQVhBLENBQUE7QUFBQSxNQWFBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FiNUIsQ0FBQTtBQUFBLE1BY0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxRQUFoQyxDQWRBLENBQUE7QUFBQSxNQWVBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0FmQSxDQUFBO0FBQUEsTUFpQkEsYUFBQSxHQUFnQixLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBakI1QyxDQUFBO0FBQUEsTUFrQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxVQUFoQyxDQWxCQSxDQUFBO0FBQUEsTUFtQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQW5CQSxDQUFBO0FBQUEsTUFvQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLFdBQTdDLENBcEJBLENBQUE7QUFBQSxNQXFCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsR0FBN0MsQ0FyQkEsQ0FBQTtBQUFBLE1Bc0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxLQUE3QyxDQXRCQSxDQUFBO0FBQUEsTUF1QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFiLENBQXdCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFqQyxDQUF3QyxDQUF4QyxDQXZCQSxDQUFBO0FBQUEsTUF3QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxHQUF6RCxDQXhCQSxDQUFBO0FBQUEsTUF5QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsUUFBM0IsQ0FBb0MsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQTNDLENBQWlELEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFqRSxDQXpCQSxDQUFBO0FBQUEsTUEwQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxLQUF6RCxDQTFCQSxDQUFBO0FBQUEsTUEyQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsUUFBM0IsQ0FBb0MsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQTNDLENBQWlELEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFqRSxDQTNCQSxDQUFBO0FBQUEsTUE2QkEsU0FBQSxHQUFZLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0E3QnhDLENBQUE7QUFBQSxNQThCQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLEtBQWhDLENBOUJBLENBQUE7QUFBQSxNQStCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBL0JBLENBQUE7QUFBQSxNQWdDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsR0FBN0MsQ0FoQ0EsQ0FBQTtBQUFBLE1BaUNBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQUssQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUFsQyxDQUF1QyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBOUMsQ0FBcUQsVUFBckQsQ0FqQ0EsQ0FBQTtBQUFBLE1Ba0NBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxHQUE3QyxDQWxDQSxDQUFBO0FBQUEsTUFtQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBSyxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQWxDLENBQXVDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUE5QyxDQUFxRCxVQUFyRCxDQW5DQSxDQUFBO0FBQUEsTUFvQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLEdBQTdDLENBcENBLENBQUE7QUFBQSxNQXFDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUFLLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBbEMsQ0FBdUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQTlDLENBQXFELFVBQXJELENBckNBLENBQUE7QUFBQSxNQXNDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBdENBLENBQUE7QUFBQSxNQXVDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELEdBQXpELENBdkNBLENBQUE7QUFBQSxNQXdDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBM0MsQ0FBaUQsS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQWpFLENBeENBLENBQUE7QUFBQSxNQXlDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELEdBQXpELENBekNBLENBQUE7QUFBQSxNQTBDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBM0MsQ0FBaUQsS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQWpFLENBMUNBLENBQUE7QUFBQSxNQTJDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELEdBQXpELENBM0NBLENBQUE7QUFBQSxNQTRDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBM0MsQ0FBaUQsS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQWpFLENBNUNBLENBQUE7QUFBQSxNQTZDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELEtBQXpELENBN0NBLENBQUE7QUFBQSxNQThDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBM0MsQ0FBaUQsYUFBYSxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQXpFLENBOUNBLENBQUE7QUFBQSxNQStDQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELEdBQXpELENBL0NBLENBQUE7QUFBQSxNQWdEQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBM0MsQ0FBaUQsS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQWpFLENBaERBLENBQUE7QUFBQSxNQWlEQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELE1BQXpELENBakRBLENBQUE7QUFBQSxNQWtEQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxDQWxEMUMsQ0FBQTtBQUFBLE1BbURBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsR0FBekQsQ0FuREEsQ0FBQTtBQUFBLE1Bb0RBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFFBQTNCLENBQW9DLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEzQyxDQUFpRCxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBakUsQ0FwREEsQ0FBQTtBQUFBLE1Bc0RBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0F0RDVCLENBQUE7QUFBQSxNQXVEQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLE9BQWhDLENBdkRBLENBQUE7QUFBQSxNQXdEQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBeERBLENBQUE7QUFBQSxNQXlEQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBekRBLENBQUE7QUFBQSxNQTBEQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELFNBQXpELENBMURBLENBQUE7QUFBQSxNQTJEQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxDQTNEMUMsQ0FBQTtBQUFBLE1BNERBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsR0FBekQsQ0E1REEsQ0FBQTtBQUFBLE1BNkRBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFFBQTNCLENBQW9DLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEzQyxDQUFpRCxTQUFTLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBckUsQ0E3REEsQ0FBQTtBQUFBLE1BOERBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsR0FBekQsQ0E5REEsQ0FBQTtBQUFBLE1BK0RBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFFBQTNCLENBQW9DLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEzQyxDQUFpRCxTQUFTLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBckUsQ0EvREEsQ0FBQTtBQUFBLE1BZ0VBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsR0FBekQsQ0FoRUEsQ0FBQTthQWlFQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBM0MsQ0FBaUQsU0FBUyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQXJFLEVBbEVxRDtJQUFBLENBQXpELEVBbkg0QjtFQUFBLENBQWhDLENBSkEsQ0FBQTtBQUFBIiwiZmlsZSI6ImVzNi1pdGVyYXRpb24tc2NvcGUuanMiLCJzb3VyY2VSb290IjoiL3NvdXJjZS8iLCJzb3VyY2VzQ29udGVudCI6WyIjIC0qLSBjb2Rpbmc6IHV0Zi04IC0qLVxuIyAgQ29weXJpZ2h0IChDKSAyMDE0IFl1c3VrZSBTdXp1a2kgPHV0YXRhbmUudGVhQGdtYWlsLmNvbT5cbiNcbiMgIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dFxuIyAgbW9kaWZpY2F0aW9uLCBhcmUgcGVybWl0dGVkIHByb3ZpZGVkIHRoYXQgdGhlIGZvbGxvd2luZyBjb25kaXRpb25zIGFyZSBtZXQ6XG4jXG4jICAgICogUmVkaXN0cmlidXRpb25zIG9mIHNvdXJjZSBjb2RlIG11c3QgcmV0YWluIHRoZSBhYm92ZSBjb3B5cmlnaHRcbiMgICAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIuXG4jICAgICogUmVkaXN0cmlidXRpb25zIGluIGJpbmFyeSBmb3JtIG11c3QgcmVwcm9kdWNlIHRoZSBhYm92ZSBjb3B5cmlnaHRcbiMgICAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIgaW4gdGhlXG4jICAgICAgZG9jdW1lbnRhdGlvbiBhbmQvb3Igb3RoZXIgbWF0ZXJpYWxzIHByb3ZpZGVkIHdpdGggdGhlIGRpc3RyaWJ1dGlvbi5cbiNcbiMgIFRISVMgU09GVFdBUkUgSVMgUFJPVklERUQgQlkgVEhFIENPUFlSSUdIVCBIT0xERVJTIEFORCBDT05UUklCVVRPUlMgXCJBUyBJU1wiXG4jICBBTkQgQU5ZIEVYUFJFU1MgT1IgSU1QTElFRCBXQVJSQU5USUVTLCBJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgVEhFXG4jICBJTVBMSUVEIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZIEFORCBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRVxuIyAgQVJFIERJU0NMQUlNRUQuIElOIE5PIEVWRU5UIFNIQUxMIDxDT1BZUklHSFQgSE9MREVSPiBCRSBMSUFCTEUgRk9SIEFOWVxuIyAgRElSRUNULCBJTkRJUkVDVCwgSU5DSURFTlRBTCwgU1BFQ0lBTCwgRVhFTVBMQVJZLCBPUiBDT05TRVFVRU5USUFMIERBTUFHRVNcbiMgIChJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgUFJPQ1VSRU1FTlQgT0YgU1VCU1RJVFVURSBHT09EUyBPUiBTRVJWSUNFUztcbiMgIExPU1MgT0YgVVNFLCBEQVRBLCBPUiBQUk9GSVRTOyBPUiBCVVNJTkVTUyBJTlRFUlJVUFRJT04pIEhPV0VWRVIgQ0FVU0VEIEFORFxuIyAgT04gQU5ZIFRIRU9SWSBPRiBMSUFCSUxJVFksIFdIRVRIRVIgSU4gQ09OVFJBQ1QsIFNUUklDVCBMSUFCSUxJVFksIE9SIFRPUlRcbiMgIChJTkNMVURJTkcgTkVHTElHRU5DRSBPUiBPVEhFUldJU0UpIEFSSVNJTkcgSU4gQU5ZIFdBWSBPVVQgT0YgVEhFIFVTRSBPRlxuIyAgVEhJUyBTT0ZUV0FSRSwgRVZFTiBJRiBBRFZJU0VEIE9GIFRIRSBQT1NTSUJJTElUWSBPRiBTVUNIIERBTUFHRS5cblxuZXhwZWN0ID0gcmVxdWlyZSgnY2hhaScpLmV4cGVjdFxuaGFybW9ueSA9IHJlcXVpcmUgJy4uL3RoaXJkX3BhcnR5L2VzcHJpbWEnXG5lc2NvcGUgPSByZXF1aXJlICcuLidcblxuZGVzY3JpYmUgJ0VTNiBpdGVyYXRpb24gc2NvcGUnLCAtPlxuICAgIGl0ICdsZXQgbWF0ZXJpYWxpemUgaXRlcmF0aW9uIHNjb3BlIGZvciBGb3JJblN0YXRlbWVudCMxJywgLT5cbiAgICAgICAgYXN0ID0gaGFybW9ueS5wYXJzZSBcIlwiXCJcbiAgICAgICAgKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGxldCBpID0gMjA7XG4gICAgICAgICAgICBmb3IgKGxldCBpIGluIGkpIHtcbiAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSgpKTtcbiAgICAgICAgXCJcIlwiXG5cbiAgICAgICAgc2NvcGVNYW5hZ2VyID0gZXNjb3BlLmFuYWx5emUgYXN0LCBlY21hVmVyc2lvbjogNlxuICAgICAgICBleHBlY3Qoc2NvcGVNYW5hZ2VyLnNjb3BlcykudG8uaGF2ZS5sZW5ndGggNVxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1swXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2dsb2JhbCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMFxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1sxXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2Z1bmN0aW9uJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAyXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwgJ2FyZ3VtZW50cydcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1sxXS5uYW1lKS50by5iZS5lcXVhbCAnaSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMF0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnaSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMF0ucmVzb2x2ZWQpLnRvLmJlLmVxdWFsIHNjb3BlLnZhcmlhYmxlc1sxXVxuXG4gICAgICAgIGl0ZXJTY29wZSA9IHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1syXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ1REWidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICdpJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLmRlZnNbMF0udHlwZSkudG8uYmUuZXF1YWwgJ1REWidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMF0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnaSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMF0ucmVzb2x2ZWQpLnRvLmJlLmVxdWFsIHNjb3BlLnZhcmlhYmxlc1swXVxuXG4gICAgICAgIGl0ZXJTY29wZSA9IHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1szXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2ZvcidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICdpJ1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggMVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1swXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsICdpJ1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1swXS5yZXNvbHZlZCkudG8uYmUuZXF1YWwgc2NvcGUudmFyaWFibGVzWzBdXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzRdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnYmxvY2snXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDJcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMF0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnY29uc29sZSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMF0ucmVzb2x2ZWQpLnRvLmJlLmVxdWFsIG51bGxcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMV0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnaSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMV0ucmVzb2x2ZWQpLnRvLmJlLmVxdWFsIGl0ZXJTY29wZS52YXJpYWJsZXNbMF1cblxuICAgIGl0ICdsZXQgbWF0ZXJpYWxpemUgaXRlcmF0aW9uIHNjb3BlIGZvciBGb3JJblN0YXRlbWVudCMyJywgLT5cbiAgICAgICAgYXN0ID0gaGFybW9ueS5wYXJzZSBcIlwiXCJcbiAgICAgICAgKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGxldCBpID0gMjA7XG4gICAgICAgICAgICBmb3IgKGxldCB7IGksIGosIGsgfSBpbiBpKSB7XG4gICAgICAgICAgICAgICAgY29uc29sZS5sb2coaSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0oKSk7XG4gICAgICAgIFwiXCJcIlxuXG4gICAgICAgIHNjb3BlTWFuYWdlciA9IGVzY29wZS5hbmFseXplIGFzdCwgZWNtYVZlcnNpb246IDZcbiAgICAgICAgZXhwZWN0KHNjb3BlTWFuYWdlci5zY29wZXMpLnRvLmhhdmUubGVuZ3RoIDVcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMF1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdmdW5jdGlvbidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMlxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICdhcmd1bWVudHMnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMV0ubmFtZSkudG8uYmUuZXF1YWwgJ2knXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAxXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2knXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLnJlc29sdmVkKS50by5iZS5lcXVhbCBzY29wZS52YXJpYWJsZXNbMV1cblxuICAgICAgICBpdGVyU2NvcGUgPSBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMl1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdURFonXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDNcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5uYW1lKS50by5iZS5lcXVhbCAnaSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5kZWZzWzBdLnR5cGUpLnRvLmJlLmVxdWFsICdURFonXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMV0ubmFtZSkudG8uYmUuZXF1YWwgJ2onXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMV0uZGVmc1swXS50eXBlKS50by5iZS5lcXVhbCAnVERaJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzJdLm5hbWUpLnRvLmJlLmVxdWFsICdrJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzJdLmRlZnNbMF0udHlwZSkudG8uYmUuZXF1YWwgJ1REWidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMF0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnaSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMF0ucmVzb2x2ZWQpLnRvLmJlLmVxdWFsIHNjb3BlLnZhcmlhYmxlc1swXVxuXG4gICAgICAgIGl0ZXJTY29wZSA9IHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1szXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2ZvcidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggM1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICdpJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzFdLm5hbWUpLnRvLmJlLmVxdWFsICdqJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzJdLm5hbWUpLnRvLmJlLmVxdWFsICdrJ1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggM1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1swXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsICdpJ1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1swXS5yZXNvbHZlZCkudG8uYmUuZXF1YWwgc2NvcGUudmFyaWFibGVzWzBdXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2onXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLnJlc29sdmVkKS50by5iZS5lcXVhbCBzY29wZS52YXJpYWJsZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMl0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnaydcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMl0ucmVzb2x2ZWQpLnRvLmJlLmVxdWFsIHNjb3BlLnZhcmlhYmxlc1syXVxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1s0XVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2Jsb2NrJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAyXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2NvbnNvbGUnXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLnJlc29sdmVkKS50by5iZS5lcXVhbCBudWxsXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2knXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLnJlc29sdmVkKS50by5iZS5lcXVhbCBpdGVyU2NvcGUudmFyaWFibGVzWzBdXG5cbiAgICBpdCAnbGV0IG1hdGVyaWFsaXplIGl0ZXJhdGlvbiBzY29wZSBmb3IgRm9yU3RhdGVtZW50IzInLCAtPlxuICAgICAgICBhc3QgPSBoYXJtb255LnBhcnNlIFwiXCJcIlxuICAgICAgICAoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgbGV0IGkgPSAyMDtcbiAgICAgICAgICAgIGxldCBvYmogPSB7fTtcbiAgICAgICAgICAgIGZvciAobGV0IHsgaSwgaiwgayB9ID0gb2JqOyBpIDwgb2tvazsgKytpKSB7XG4gICAgICAgICAgICAgICAgY29uc29sZS5sb2coaSwgaiwgayk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0oKSk7XG4gICAgICAgIFwiXCJcIlxuXG4gICAgICAgIHNjb3BlTWFuYWdlciA9IGVzY29wZS5hbmFseXplIGFzdCwgZWNtYVZlcnNpb246IDZcbiAgICAgICAgZXhwZWN0KHNjb3BlTWFuYWdlci5zY29wZXMpLnRvLmhhdmUubGVuZ3RoIDRcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMF1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgICAgICBmdW5jdGlvblNjb3BlID0gc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzFdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZnVuY3Rpb24nXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDNcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5uYW1lKS50by5iZS5lcXVhbCAnYXJndW1lbnRzJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzFdLm5hbWUpLnRvLmJlLmVxdWFsICdpJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzJdLm5hbWUpLnRvLmJlLmVxdWFsICdvYmonXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAyXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2knXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLnJlc29sdmVkKS50by5iZS5lcXVhbCBzY29wZS52YXJpYWJsZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMV0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnb2JqJ1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1sxXS5yZXNvbHZlZCkudG8uYmUuZXF1YWwgc2NvcGUudmFyaWFibGVzWzJdXG5cbiAgICAgICAgaXRlclNjb3BlID0gc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzJdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZm9yJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAzXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwgJ2knXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMF0uZGVmc1swXS50eXBlKS50by5iZS5lcXVhbCAnVmFyaWFibGUnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMV0ubmFtZSkudG8uYmUuZXF1YWwgJ2onXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMV0uZGVmc1swXS50eXBlKS50by5iZS5lcXVhbCAnVmFyaWFibGUnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMl0ubmFtZSkudG8uYmUuZXF1YWwgJ2snXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMl0uZGVmc1swXS50eXBlKS50by5iZS5lcXVhbCAnVmFyaWFibGUnXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCA3XG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2knXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLnJlc29sdmVkKS50by5iZS5lcXVhbCBzY29wZS52YXJpYWJsZXNbMF1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMV0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnaidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMV0ucmVzb2x2ZWQpLnRvLmJlLmVxdWFsIHNjb3BlLnZhcmlhYmxlc1sxXVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1syXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsICdrJ1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1syXS5yZXNvbHZlZCkudG8uYmUuZXF1YWwgc2NvcGUudmFyaWFibGVzWzJdXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzNdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ29iaidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbM10ucmVzb2x2ZWQpLnRvLmJlLmVxdWFsIGZ1bmN0aW9uU2NvcGUudmFyaWFibGVzWzJdXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzRdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2knXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzRdLnJlc29sdmVkKS50by5iZS5lcXVhbCBzY29wZS52YXJpYWJsZXNbMF1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbNV0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnb2tvaydcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbNV0ucmVzb2x2ZWQpLnRvLmJlLm51bGxcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbNl0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnaSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbNl0ucmVzb2x2ZWQpLnRvLmJlLmVxdWFsIHNjb3BlLnZhcmlhYmxlc1swXVxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1szXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2Jsb2NrJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCA0XG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2NvbnNvbGUnXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLnJlc29sdmVkKS50by5iZS5udWxsXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2knXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzFdLnJlc29sdmVkKS50by5iZS5lcXVhbCBpdGVyU2NvcGUudmFyaWFibGVzWzBdXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzJdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2onXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzJdLnJlc29sdmVkKS50by5iZS5lcXVhbCBpdGVyU2NvcGUudmFyaWFibGVzWzFdXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzNdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ2snXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzNdLnJlc29sdmVkKS50by5iZS5lcXVhbCBpdGVyU2NvcGUudmFyaWFibGVzWzJdXG5cbiMgdmltOiBzZXQgc3c9NCB0cz00IGV0IHR3PTgwIDpcbiJdfQ==
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/powered-test/es6-object.js b/tools/eslint/node_modules/escope/powered-test/es6-object.js
      new file mode 100644
      index 00000000000000..2241d2558e3c2d
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/powered-test/es6-object.js
      @@ -0,0 +1,57 @@
      +(function() {
      +  var escope, expect, harmony;
      +
      +  expect = require('chai').expect;
      +
      +  harmony = require('../third_party/esprima');
      +
      +  escope = require('..');
      +
      +  describe('ES6 object', function() {
      +    it('method definition', function() {
      +      var ast, scope, scopeManager;
      +      ast = harmony.parse("({\n    constructor() {\n    }\n})");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      scope = scopeManager.scopes[0];
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.block.type).to.be.equal('Program');
      +      expect(scope.isStrict).to.be["false"];
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.block.type).to.be.equal('FunctionExpression');
      +      expect(scope.isStrict).to.be["true"];
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      return expect(scope.references).to.have.length(0);
      +    });
      +    return it('computed property key may refer variables', function() {
      +      var ast, scope, scopeManager;
      +      ast = harmony.parse("(function () {\n    var yuyushiki = 42;\n    ({\n        [yuyushiki]() {\n        },\n\n        [yuyushiki + 40]() {\n        }\n    })\n}());");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(4);
      +      scope = scopeManager.scopes[0];
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.block.type).to.be.equal('Program');
      +      expect(scope.isStrict).to.be["false"];
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.block.type).to.be.equal('FunctionExpression');
      +      expect(scope.isStrict).to.be["false"];
      +      expect(scope.variables).to.have.length(2);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      expect(scope.variables[1].name).to.be.equal('yuyushiki');
      +      expect(scope.references).to.have.length(3);
      +      expect(scope.references[0].identifier.name).to.be.equal('yuyushiki');
      +      expect(scope.references[1].identifier.name).to.be.equal('yuyushiki');
      +      return expect(scope.references[2].identifier.name).to.be.equal('yuyushiki');
      +    });
      +  });
      +
      +}).call(this);
      +
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVzNi1vYmplY3QuY29mZmVlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVCQTtBQUFBLE1BQUEsdUJBQUE7O0FBQUEsRUFBQSxNQUFBLEdBQVMsT0FBQSxDQUFTLE1BQVQsQ0FBZSxDQUFDLE1BQXpCLENBQUE7O0FBQUEsRUFDQSxPQUFBLEdBQVUsT0FBQSxDQUFTLHdCQUFULENBRFYsQ0FBQTs7QUFBQSxFQUVBLE1BQUEsR0FBUyxPQUFBLENBQVMsSUFBVCxDQUZULENBQUE7O0FBQUEsRUFJQSxRQUFBLENBQVUsWUFBVixFQUF1QixTQUFBLEdBQUE7QUFDbkIsSUFBQSxFQUFBLENBQUksbUJBQUosRUFBd0IsU0FBQSxHQUFBO0FBQ3BCLFVBQUEsd0JBQUE7QUFBQSxNQUFBLEdBQUEsR0FBTSxPQUFPLENBQUMsS0FBUixDQUFpQixvQ0FBakIsQ0FBTixDQUFBO0FBQUEsTUFPQSxZQUFBLEdBQWUsTUFBTSxDQUFDLE9BQVAsQ0FBZSxHQUFmLEVBQW9CO0FBQUEsUUFBQSxXQUFBLEVBQWEsQ0FBYjtPQUFwQixDQVBmLENBQUE7QUFBQSxNQVFBLE1BQUEsQ0FBTyxZQUFZLENBQUMsTUFBcEIsQ0FBMkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXBDLENBQTJDLENBQTNDLENBUkEsQ0FBQTtBQUFBLE1BVUEsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQVY1QixDQUFBO0FBQUEsTUFXQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFFBQWhDLENBWEEsQ0FBQTtBQUFBLE1BWUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxLQUFLLENBQUMsSUFBbkIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQS9CLENBQXNDLFNBQXRDLENBWkEsQ0FBQTtBQUFBLE1BYUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxRQUFiLENBQXNCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxPQUFELENBYjVCLENBQUE7QUFBQSxNQWVBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FmNUIsQ0FBQTtBQUFBLE1BZ0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsVUFBaEMsQ0FoQkEsQ0FBQTtBQUFBLE1BaUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsS0FBSyxDQUFDLElBQW5CLENBQXdCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEvQixDQUFzQyxvQkFBdEMsQ0FqQkEsQ0FBQTtBQUFBLE1Ba0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsUUFBYixDQUFzQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxDQWxCNUIsQ0FBQTtBQUFBLE1BbUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0FuQkEsQ0FBQTtBQUFBLE1Bb0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxXQUE3QyxDQXBCQSxDQUFBO2FBcUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsRUF0Qm9CO0lBQUEsQ0FBeEIsQ0FBQSxDQUFBO1dBd0JBLEVBQUEsQ0FBSSwyQ0FBSixFQUFnRCxTQUFBLEdBQUE7QUFDNUMsVUFBQSx3QkFBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLGdKQUFqQixDQUFOLENBQUE7QUFBQSxNQWFBLFlBQUEsR0FBZSxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsRUFBb0I7QUFBQSxRQUFBLFdBQUEsRUFBYSxDQUFiO09BQXBCLENBYmYsQ0FBQTtBQUFBLE1BY0EsTUFBQSxDQUFPLFlBQVksQ0FBQyxNQUFwQixDQUEyQixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBcEMsQ0FBMkMsQ0FBM0MsQ0FkQSxDQUFBO0FBQUEsTUFnQkEsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQWhCNUIsQ0FBQTtBQUFBLE1BaUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsUUFBaEMsQ0FqQkEsQ0FBQTtBQUFBLE1Ba0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsS0FBSyxDQUFDLElBQW5CLENBQXdCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEvQixDQUFzQyxTQUF0QyxDQWxCQSxDQUFBO0FBQUEsTUFtQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxRQUFiLENBQXNCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxPQUFELENBbkI1QixDQUFBO0FBQUEsTUFxQkEsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQXJCNUIsQ0FBQTtBQUFBLE1Bc0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsVUFBaEMsQ0F0QkEsQ0FBQTtBQUFBLE1BdUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsS0FBSyxDQUFDLElBQW5CLENBQXdCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEvQixDQUFzQyxvQkFBdEMsQ0F2QkEsQ0FBQTtBQUFBLE1Bd0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsUUFBYixDQUFzQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsT0FBRCxDQXhCNUIsQ0FBQTtBQUFBLE1BeUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0F6QkEsQ0FBQTtBQUFBLE1BMEJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxXQUE3QyxDQTFCQSxDQUFBO0FBQUEsTUEyQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLFdBQTdDLENBM0JBLENBQUE7QUFBQSxNQTRCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBNUJBLENBQUE7QUFBQSxNQTZCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELFdBQXpELENBN0JBLENBQUE7QUFBQSxNQThCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELFdBQXpELENBOUJBLENBQUE7YUErQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxXQUF6RCxFQWhDNEM7SUFBQSxDQUFoRCxFQXpCbUI7RUFBQSxDQUF2QixDQUpBLENBQUE7QUFBQSIsImZpbGUiOiJlczYtb2JqZWN0LmpzIiwic291cmNlUm9vdCI6Ii9zb3VyY2UvIiwic291cmNlc0NvbnRlbnQiOlsiIyAtKi0gY29kaW5nOiB1dGYtOCAtKi1cbiMgIENvcHlyaWdodCAoQykgMjAxNCBZdXN1a2UgU3V6dWtpIDx1dGF0YW5lLnRlYUBnbWFpbC5jb20+XG4jXG4jICBSZWRpc3RyaWJ1dGlvbiBhbmQgdXNlIGluIHNvdXJjZSBhbmQgYmluYXJ5IGZvcm1zLCB3aXRoIG9yIHdpdGhvdXRcbiMgIG1vZGlmaWNhdGlvbiwgYXJlIHBlcm1pdHRlZCBwcm92aWRlZCB0aGF0IHRoZSBmb2xsb3dpbmcgY29uZGl0aW9ucyBhcmUgbWV0OlxuI1xuIyAgICAqIFJlZGlzdHJpYnV0aW9ucyBvZiBzb3VyY2UgY29kZSBtdXN0IHJldGFpbiB0aGUgYWJvdmUgY29weXJpZ2h0XG4jICAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyLlxuIyAgICAqIFJlZGlzdHJpYnV0aW9ucyBpbiBiaW5hcnkgZm9ybSBtdXN0IHJlcHJvZHVjZSB0aGUgYWJvdmUgY29weXJpZ2h0XG4jICAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyIGluIHRoZVxuIyAgICAgIGRvY3VtZW50YXRpb24gYW5kL29yIG90aGVyIG1hdGVyaWFscyBwcm92aWRlZCB3aXRoIHRoZSBkaXN0cmlidXRpb24uXG4jXG4jICBUSElTIFNPRlRXQVJFIElTIFBST1ZJREVEIEJZIFRIRSBDT1BZUklHSFQgSE9MREVSUyBBTkQgQ09OVFJJQlVUT1JTIFwiQVMgSVNcIlxuIyAgQU5EIEFOWSBFWFBSRVNTIE9SIElNUExJRUQgV0FSUkFOVElFUywgSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFRIRVxuIyAgSU1QTElFRCBXQVJSQU5USUVTIE9GIE1FUkNIQU5UQUJJTElUWSBBTkQgRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0VcbiMgIEFSRSBESVNDTEFJTUVELiBJTiBOTyBFVkVOVCBTSEFMTCA8Q09QWVJJR0hUIEhPTERFUj4gQkUgTElBQkxFIEZPUiBBTllcbiMgIERJUkVDVCwgSU5ESVJFQ1QsIElOQ0lERU5UQUwsIFNQRUNJQUwsIEVYRU1QTEFSWSwgT1IgQ09OU0VRVUVOVElBTCBEQU1BR0VTXG4jICAoSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFBST0NVUkVNRU5UIE9GIFNVQlNUSVRVVEUgR09PRFMgT1IgU0VSVklDRVM7XG4jICBMT1NTIE9GIFVTRSwgREFUQSwgT1IgUFJPRklUUzsgT1IgQlVTSU5FU1MgSU5URVJSVVBUSU9OKSBIT1dFVkVSIENBVVNFRCBBTkRcbiMgIE9OIEFOWSBUSEVPUlkgT0YgTElBQklMSVRZLCBXSEVUSEVSIElOIENPTlRSQUNULCBTVFJJQ1QgTElBQklMSVRZLCBPUiBUT1JUXG4jICAoSU5DTFVESU5HIE5FR0xJR0VOQ0UgT1IgT1RIRVJXSVNFKSBBUklTSU5HIElOIEFOWSBXQVkgT1VUIE9GIFRIRSBVU0UgT0ZcbiMgIFRISVMgU09GVFdBUkUsIEVWRU4gSUYgQURWSVNFRCBPRiBUSEUgUE9TU0lCSUxJVFkgT0YgU1VDSCBEQU1BR0UuXG5cbmV4cGVjdCA9IHJlcXVpcmUoJ2NoYWknKS5leHBlY3Rcbmhhcm1vbnkgPSByZXF1aXJlICcuLi90aGlyZF9wYXJ0eS9lc3ByaW1hJ1xuZXNjb3BlID0gcmVxdWlyZSAnLi4nXG5cbmRlc2NyaWJlICdFUzYgb2JqZWN0JywgLT5cbiAgICBpdCAnbWV0aG9kIGRlZmluaXRpb24nLCAtPlxuICAgICAgICBhc3QgPSBoYXJtb255LnBhcnNlIFwiXCJcIlxuICAgICAgICAoe1xuICAgICAgICAgICAgY29uc3RydWN0b3IoKSB7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pXG4gICAgICAgIFwiXCJcIlxuXG4gICAgICAgIHNjb3BlTWFuYWdlciA9IGVzY29wZS5hbmFseXplIGFzdCwgZWNtYVZlcnNpb246IDZcbiAgICAgICAgZXhwZWN0KHNjb3BlTWFuYWdlci5zY29wZXMpLnRvLmhhdmUubGVuZ3RoIDJcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMF1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgIGV4cGVjdChzY29wZS5ibG9jay50eXBlKS50by5iZS5lcXVhbCAnUHJvZ3JhbSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLmlzU3RyaWN0KS50by5iZS5mYWxzZVxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1sxXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2Z1bmN0aW9uJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuYmxvY2sudHlwZSkudG8uYmUuZXF1YWwgJ0Z1bmN0aW9uRXhwcmVzc2lvbidcbiAgICAgICAgZXhwZWN0KHNjb3BlLmlzU3RyaWN0KS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5uYW1lKS50by5iZS5lcXVhbCAnYXJndW1lbnRzJ1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggMFxuXG4gICAgaXQgJ2NvbXB1dGVkIHByb3BlcnR5IGtleSBtYXkgcmVmZXIgdmFyaWFibGVzJywgLT5cbiAgICAgICAgYXN0ID0gaGFybW9ueS5wYXJzZSBcIlwiXCJcbiAgICAgICAgKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciB5dXl1c2hpa2kgPSA0MjtcbiAgICAgICAgICAgICh7XG4gICAgICAgICAgICAgICAgW3l1eXVzaGlraV0oKSB7XG4gICAgICAgICAgICAgICAgfSxcblxuICAgICAgICAgICAgICAgIFt5dXl1c2hpa2kgKyA0MF0oKSB7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSlcbiAgICAgICAgfSgpKTtcbiAgICAgICAgXCJcIlwiXG5cbiAgICAgICAgc2NvcGVNYW5hZ2VyID0gZXNjb3BlLmFuYWx5emUgYXN0LCBlY21hVmVyc2lvbjogNlxuICAgICAgICBleHBlY3Qoc2NvcGVNYW5hZ2VyLnNjb3BlcykudG8uaGF2ZS5sZW5ndGggNFxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1swXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2dsb2JhbCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLmJsb2NrLnR5cGUpLnRvLmJlLmVxdWFsICdQcm9ncmFtJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuaXNTdHJpY3QpLnRvLmJlLmZhbHNlXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzFdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZnVuY3Rpb24nXG4gICAgICAgIGV4cGVjdChzY29wZS5ibG9jay50eXBlKS50by5iZS5lcXVhbCAnRnVuY3Rpb25FeHByZXNzaW9uJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuaXNTdHJpY3QpLnRvLmJlLmZhbHNlXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDJcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5uYW1lKS50by5iZS5lcXVhbCAnYXJndW1lbnRzJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzFdLm5hbWUpLnRvLmJlLmVxdWFsICd5dXl1c2hpa2knXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAzXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ3l1eXVzaGlraSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMV0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAneXV5dXNoaWtpJ1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1syXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsICd5dXl1c2hpa2knXG5cbiMgdmltOiBzZXQgc3c9NCB0cz00IGV0IHR3PTgwIDpcbiJdfQ==
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/powered-test/es6-rest-args.js b/tools/eslint/node_modules/escope/powered-test/es6-rest-args.js
      new file mode 100644
      index 00000000000000..3342b7ed849aa3
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/powered-test/es6-rest-args.js
      @@ -0,0 +1,35 @@
      +(function() {
      +  var escope, expect, harmony;
      +
      +  expect = require('chai').expect;
      +
      +  harmony = require('../third_party/esprima');
      +
      +  escope = require('..');
      +
      +  describe('ES6 rest arguments', function() {
      +    return it('materialize rest argument in scope', function() {
      +      var ast, scope, scopeManager;
      +      ast = harmony.parse("function foo(...bar) {\n    return bar;\n}");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      scope = scopeManager.scopes[0];
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.block.type).to.be.equal('Program');
      +      expect(scope.isStrict).to.be["false"];
      +      expect(scope.variables).to.have.length(1);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(2);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      expect(scope.variables[1].name).to.be.equal('bar');
      +      expect(scope.variables[1].defs[0].name.name).to.be.equal('bar');
      +      return expect(scope.variables[1].defs[0].rest).to.be["true"];
      +    });
      +  });
      +
      +}).call(this);
      +
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVzNi1yZXN0LWFyZ3MuY29mZmVlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVCQTtBQUFBLE1BQUEsdUJBQUE7O0FBQUEsRUFBQSxNQUFBLEdBQVMsT0FBQSxDQUFTLE1BQVQsQ0FBZSxDQUFDLE1BQXpCLENBQUE7O0FBQUEsRUFDQSxPQUFBLEdBQVUsT0FBQSxDQUFTLHdCQUFULENBRFYsQ0FBQTs7QUFBQSxFQUVBLE1BQUEsR0FBUyxPQUFBLENBQVMsSUFBVCxDQUZULENBQUE7O0FBQUEsRUFJQSxRQUFBLENBQVUsb0JBQVYsRUFBK0IsU0FBQSxHQUFBO1dBQzNCLEVBQUEsQ0FBSSxvQ0FBSixFQUF5QyxTQUFBLEdBQUE7QUFDckMsVUFBQSx3QkFBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLDRDQUFqQixDQUFOLENBQUE7QUFBQSxNQU1BLFlBQUEsR0FBZSxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsRUFBb0I7QUFBQSxRQUFBLFdBQUEsRUFBYSxDQUFiO09BQXBCLENBTmYsQ0FBQTtBQUFBLE1BT0EsTUFBQSxDQUFPLFlBQVksQ0FBQyxNQUFwQixDQUEyQixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBcEMsQ0FBMkMsQ0FBM0MsQ0FQQSxDQUFBO0FBQUEsTUFTQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBVDVCLENBQUE7QUFBQSxNQVVBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsUUFBaEMsQ0FWQSxDQUFBO0FBQUEsTUFXQSxNQUFBLENBQU8sS0FBSyxDQUFDLEtBQUssQ0FBQyxJQUFuQixDQUF3QixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBL0IsQ0FBc0MsU0FBdEMsQ0FYQSxDQUFBO0FBQUEsTUFZQSxNQUFBLENBQU8sS0FBSyxDQUFDLFFBQWIsQ0FBc0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE9BQUQsQ0FaNUIsQ0FBQTtBQUFBLE1BYUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQWJBLENBQUE7QUFBQSxNQWVBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FmNUIsQ0FBQTtBQUFBLE1BZ0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsVUFBaEMsQ0FoQkEsQ0FBQTtBQUFBLE1BaUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0FqQkEsQ0FBQTtBQUFBLE1Ba0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxXQUE3QyxDQWxCQSxDQUFBO0FBQUEsTUFtQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLEtBQTdDLENBbkJBLENBQUE7QUFBQSxNQW9CQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUFLLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBSSxDQUFDLElBQXZDLENBQTRDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFuRCxDQUEwRCxLQUExRCxDQXBCQSxDQUFBO2FBcUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQUssQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUFsQyxDQUF1QyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxFQXRCUjtJQUFBLENBQXpDLEVBRDJCO0VBQUEsQ0FBL0IsQ0FKQSxDQUFBO0FBQUEiLCJmaWxlIjoiZXM2LXJlc3QtYXJncy5qcyIsInNvdXJjZVJvb3QiOiIvc291cmNlLyIsInNvdXJjZXNDb250ZW50IjpbIiMgLSotIGNvZGluZzogdXRmLTggLSotXG4jICBDb3B5cmlnaHQgKEMpIDIwMTQgWXVzdWtlIFN1enVraSA8dXRhdGFuZS50ZWFAZ21haWwuY29tPlxuI1xuIyAgUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0XG4jICBtb2RpZmljYXRpb24sIGFyZSBwZXJtaXR0ZWQgcHJvdmlkZWQgdGhhdCB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnMgYXJlIG1ldDpcbiNcbiMgICAgKiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodFxuIyAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lci5cbiMgICAgKiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodFxuIyAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lciBpbiB0aGVcbiMgICAgICBkb2N1bWVudGF0aW9uIGFuZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQgd2l0aCB0aGUgZGlzdHJpYnV0aW9uLlxuI1xuIyAgVEhJUyBTT0ZUV0FSRSBJUyBQUk9WSURFRCBCWSBUSEUgQ09QWVJJR0hUIEhPTERFUlMgQU5EIENPTlRSSUJVVE9SUyBcIkFTIElTXCJcbiMgIEFORCBBTlkgRVhQUkVTUyBPUiBJTVBMSUVEIFdBUlJBTlRJRVMsIElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBUSEVcbiMgIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFXG4jICBBUkUgRElTQ0xBSU1FRC4gSU4gTk8gRVZFTlQgU0hBTEwgPENPUFlSSUdIVCBIT0xERVI+IEJFIExJQUJMRSBGT1IgQU5ZXG4jICBESVJFQ1QsIElORElSRUNULCBJTkNJREVOVEFMLCBTUEVDSUFMLCBFWEVNUExBUlksIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFU1xuIyAgKElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTO1xuIyAgTE9TUyBPRiBVU0UsIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EXG4jICBPTiBBTlkgVEhFT1JZIE9GIExJQUJJTElUWSwgV0hFVEhFUiBJTiBDT05UUkFDVCwgU1RSSUNUIExJQUJJTElUWSwgT1IgVE9SVFxuIyAgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFIE9GXG4jICBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLlxuXG5leHBlY3QgPSByZXF1aXJlKCdjaGFpJykuZXhwZWN0XG5oYXJtb255ID0gcmVxdWlyZSAnLi4vdGhpcmRfcGFydHkvZXNwcmltYSdcbmVzY29wZSA9IHJlcXVpcmUgJy4uJ1xuXG5kZXNjcmliZSAnRVM2IHJlc3QgYXJndW1lbnRzJywgLT5cbiAgICBpdCAnbWF0ZXJpYWxpemUgcmVzdCBhcmd1bWVudCBpbiBzY29wZScsIC0+XG4gICAgICAgIGFzdCA9IGhhcm1vbnkucGFyc2UgXCJcIlwiXG4gICAgICAgIGZ1bmN0aW9uIGZvbyguLi5iYXIpIHtcbiAgICAgICAgICAgIHJldHVybiBiYXI7XG4gICAgICAgIH1cbiAgICAgICAgXCJcIlwiXG5cbiAgICAgICAgc2NvcGVNYW5hZ2VyID0gZXNjb3BlLmFuYWx5emUgYXN0LCBlY21hVmVyc2lvbjogNlxuICAgICAgICBleHBlY3Qoc2NvcGVNYW5hZ2VyLnNjb3BlcykudG8uaGF2ZS5sZW5ndGggMlxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1swXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2dsb2JhbCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLmJsb2NrLnR5cGUpLnRvLmJlLmVxdWFsICdQcm9ncmFtJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuaXNTdHJpY3QpLnRvLmJlLmZhbHNlXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDFcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdmdW5jdGlvbidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMlxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICdhcmd1bWVudHMnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMV0ubmFtZSkudG8uYmUuZXF1YWwgJ2JhcidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1sxXS5kZWZzWzBdLm5hbWUubmFtZSkudG8uYmUuZXF1YWwgJ2JhcidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1sxXS5kZWZzWzBdLnJlc3QpLnRvLmJlLnRydWVcblxuIyB2aW06IHNldCBzdz00IHRzPTQgZXQgdHc9ODAgOlxuIl19
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/powered-test/es6-switch.js b/tools/eslint/node_modules/escope/powered-test/es6-switch.js
      new file mode 100644
      index 00000000000000..44336f0f9d270a
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/powered-test/es6-switch.js
      @@ -0,0 +1,43 @@
      +(function() {
      +  var escope, expect, harmony;
      +
      +  expect = require('chai').expect;
      +
      +  harmony = require('../third_party/esprima');
      +
      +  escope = require('..');
      +
      +  describe('ES6 switch', function() {
      +    return it('materialize scope', function() {
      +      var ast, scope, scopeManager;
      +      ast = harmony.parse("switch (ok) {\n    case hello:\n        let i = 20;\n        i;\n        break;\n\n    default:\n        let test = 30;\n        test;\n}");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      scope = scopeManager.scopes[0];
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.block.type).to.be.equal('Program');
      +      expect(scope.isStrict).to.be["false"];
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.references).to.have.length(1);
      +      expect(scope.references[0].identifier.name).to.be.equal('ok');
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('switch');
      +      expect(scope.block.type).to.be.equal('SwitchStatement');
      +      expect(scope.isStrict).to.be["false"];
      +      expect(scope.variables).to.have.length(2);
      +      expect(scope.variables[0].name).to.be.equal('i');
      +      expect(scope.variables[1].name).to.be.equal('test');
      +      expect(scope.references).to.have.length(5);
      +      expect(scope.references[0].identifier.name).to.be.equal('hello');
      +      expect(scope.references[1].identifier.name).to.be.equal('i');
      +      expect(scope.references[2].identifier.name).to.be.equal('i');
      +      expect(scope.references[3].identifier.name).to.be.equal('test');
      +      return expect(scope.references[4].identifier.name).to.be.equal('test');
      +    });
      +  });
      +
      +}).call(this);
      +
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVzNi1zd2l0Y2guY29mZmVlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVCQTtBQUFBLE1BQUEsdUJBQUE7O0FBQUEsRUFBQSxNQUFBLEdBQVMsT0FBQSxDQUFTLE1BQVQsQ0FBZSxDQUFDLE1BQXpCLENBQUE7O0FBQUEsRUFDQSxPQUFBLEdBQVUsT0FBQSxDQUFTLHdCQUFULENBRFYsQ0FBQTs7QUFBQSxFQUVBLE1BQUEsR0FBUyxPQUFBLENBQVMsSUFBVCxDQUZULENBQUE7O0FBQUEsRUFJQSxRQUFBLENBQVUsWUFBVixFQUF1QixTQUFBLEdBQUE7V0FDbkIsRUFBQSxDQUFJLG1CQUFKLEVBQXdCLFNBQUEsR0FBQTtBQUNwQixVQUFBLHdCQUFBO0FBQUEsTUFBQSxHQUFBLEdBQU0sT0FBTyxDQUFDLEtBQVIsQ0FBaUIsMklBQWpCLENBQU4sQ0FBQTtBQUFBLE1BYUEsWUFBQSxHQUFlLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixFQUFvQjtBQUFBLFFBQUEsV0FBQSxFQUFhLENBQWI7T0FBcEIsQ0FiZixDQUFBO0FBQUEsTUFjQSxNQUFBLENBQU8sWUFBWSxDQUFDLE1BQXBCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQWRBLENBQUE7QUFBQSxNQWdCQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBaEI1QixDQUFBO0FBQUEsTUFpQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxRQUFoQyxDQWpCQSxDQUFBO0FBQUEsTUFrQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxLQUFLLENBQUMsSUFBbkIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQS9CLENBQXNDLFNBQXRDLENBbEJBLENBQUE7QUFBQSxNQW1CQSxNQUFBLENBQU8sS0FBSyxDQUFDLFFBQWIsQ0FBc0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE9BQUQsQ0FuQjVCLENBQUE7QUFBQSxNQW9CQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBcEJBLENBQUE7QUFBQSxNQXFCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBckJBLENBQUE7QUFBQSxNQXNCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELElBQXpELENBdEJBLENBQUE7QUFBQSxNQXdCQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBeEI1QixDQUFBO0FBQUEsTUF5QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxRQUFoQyxDQXpCQSxDQUFBO0FBQUEsTUEwQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxLQUFLLENBQUMsSUFBbkIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQS9CLENBQXNDLGlCQUF0QyxDQTFCQSxDQUFBO0FBQUEsTUEyQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxRQUFiLENBQXNCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxPQUFELENBM0I1QixDQUFBO0FBQUEsTUE0QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQTVCQSxDQUFBO0FBQUEsTUE2QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLEdBQTdDLENBN0JBLENBQUE7QUFBQSxNQThCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsTUFBN0MsQ0E5QkEsQ0FBQTtBQUFBLE1BK0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsQ0EvQkEsQ0FBQTtBQUFBLE1BZ0NBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsT0FBekQsQ0FoQ0EsQ0FBQTtBQUFBLE1BaUNBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsR0FBekQsQ0FqQ0EsQ0FBQTtBQUFBLE1Ba0NBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsR0FBekQsQ0FsQ0EsQ0FBQTtBQUFBLE1BbUNBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsTUFBekQsQ0FuQ0EsQ0FBQTthQW9DQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELE1BQXpELEVBckNvQjtJQUFBLENBQXhCLEVBRG1CO0VBQUEsQ0FBdkIsQ0FKQSxDQUFBO0FBQUEiLCJmaWxlIjoiZXM2LXN3aXRjaC5qcyIsInNvdXJjZVJvb3QiOiIvc291cmNlLyIsInNvdXJjZXNDb250ZW50IjpbIiMgLSotIGNvZGluZzogdXRmLTggLSotXG4jICBDb3B5cmlnaHQgKEMpIDIwMTQgWXVzdWtlIFN1enVraSA8dXRhdGFuZS50ZWFAZ21haWwuY29tPlxuI1xuIyAgUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0XG4jICBtb2RpZmljYXRpb24sIGFyZSBwZXJtaXR0ZWQgcHJvdmlkZWQgdGhhdCB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnMgYXJlIG1ldDpcbiNcbiMgICAgKiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodFxuIyAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lci5cbiMgICAgKiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodFxuIyAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lciBpbiB0aGVcbiMgICAgICBkb2N1bWVudGF0aW9uIGFuZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQgd2l0aCB0aGUgZGlzdHJpYnV0aW9uLlxuI1xuIyAgVEhJUyBTT0ZUV0FSRSBJUyBQUk9WSURFRCBCWSBUSEUgQ09QWVJJR0hUIEhPTERFUlMgQU5EIENPTlRSSUJVVE9SUyBcIkFTIElTXCJcbiMgIEFORCBBTlkgRVhQUkVTUyBPUiBJTVBMSUVEIFdBUlJBTlRJRVMsIElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBUSEVcbiMgIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFXG4jICBBUkUgRElTQ0xBSU1FRC4gSU4gTk8gRVZFTlQgU0hBTEwgPENPUFlSSUdIVCBIT0xERVI+IEJFIExJQUJMRSBGT1IgQU5ZXG4jICBESVJFQ1QsIElORElSRUNULCBJTkNJREVOVEFMLCBTUEVDSUFMLCBFWEVNUExBUlksIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFU1xuIyAgKElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTO1xuIyAgTE9TUyBPRiBVU0UsIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EXG4jICBPTiBBTlkgVEhFT1JZIE9GIExJQUJJTElUWSwgV0hFVEhFUiBJTiBDT05UUkFDVCwgU1RSSUNUIExJQUJJTElUWSwgT1IgVE9SVFxuIyAgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFIE9GXG4jICBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLlxuXG5leHBlY3QgPSByZXF1aXJlKCdjaGFpJykuZXhwZWN0XG5oYXJtb255ID0gcmVxdWlyZSAnLi4vdGhpcmRfcGFydHkvZXNwcmltYSdcbmVzY29wZSA9IHJlcXVpcmUgJy4uJ1xuXG5kZXNjcmliZSAnRVM2IHN3aXRjaCcsIC0+XG4gICAgaXQgJ21hdGVyaWFsaXplIHNjb3BlJywgLT5cbiAgICAgICAgYXN0ID0gaGFybW9ueS5wYXJzZSBcIlwiXCJcbiAgICAgICAgc3dpdGNoIChvaykge1xuICAgICAgICAgICAgY2FzZSBoZWxsbzpcbiAgICAgICAgICAgICAgICBsZXQgaSA9IDIwO1xuICAgICAgICAgICAgICAgIGk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgbGV0IHRlc3QgPSAzMDtcbiAgICAgICAgICAgICAgICB0ZXN0O1xuICAgICAgICB9XG4gICAgICAgIFwiXCJcIlxuXG4gICAgICAgIHNjb3BlTWFuYWdlciA9IGVzY29wZS5hbmFseXplIGFzdCwgZWNtYVZlcnNpb246IDZcbiAgICAgICAgZXhwZWN0KHNjb3BlTWFuYWdlci5zY29wZXMpLnRvLmhhdmUubGVuZ3RoIDJcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMF1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdnbG9iYWwnXG4gICAgICAgIGV4cGVjdChzY29wZS5ibG9jay50eXBlKS50by5iZS5lcXVhbCAnUHJvZ3JhbSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLmlzU3RyaWN0KS50by5iZS5mYWxzZVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAxXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLmlkZW50aWZpZXIubmFtZSkudG8uYmUuZXF1YWwgJ29rJ1xuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1sxXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ3N3aXRjaCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLmJsb2NrLnR5cGUpLnRvLmJlLmVxdWFsICdTd2l0Y2hTdGF0ZW1lbnQnXG4gICAgICAgIGV4cGVjdChzY29wZS5pc1N0cmljdCkudG8uYmUuZmFsc2VcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMlxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICdpJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzFdLm5hbWUpLnRvLmJlLmVxdWFsICd0ZXN0J1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggNVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1swXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsICdoZWxsbydcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMV0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnaSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMl0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnaSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbM10uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAndGVzdCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbNF0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAndGVzdCdcblxuIyB2aW06IHNldCBzdz00IHRzPTQgZXQgdHc9ODAgOlxuIl19
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/powered-test/es6-template-literal.js b/tools/eslint/node_modules/escope/powered-test/es6-template-literal.js
      new file mode 100644
      index 00000000000000..5e71ad21775269
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/powered-test/es6-template-literal.js
      @@ -0,0 +1,45 @@
      +(function() {
      +  var escope, expect, harmony;
      +
      +  expect = require('chai').expect;
      +
      +  harmony = require('../third_party/esprima');
      +
      +  escope = require('..');
      +
      +  describe('ES6 template literal', function() {
      +    return it('refer variables', function() {
      +      var ast, scope, scopeManager;
      +      ast = harmony.parse("(function () {\n    let i, j, k;\n    function testing() { }\n    let template = testing`testing ${i} and ${j}`\n    return template;\n}());");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6
      +      });
      +      expect(scopeManager.scopes).to.have.length(3);
      +      scope = scopeManager.scopes[0];
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.block.type).to.be.equal('Program');
      +      expect(scope.isStrict).to.be["false"];
      +      expect(scope.variables).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.block.type).to.be.equal('FunctionExpression');
      +      expect(scope.isStrict).to.be["false"];
      +      expect(scope.variables).to.have.length(6);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      expect(scope.variables[1].name).to.be.equal('i');
      +      expect(scope.variables[2].name).to.be.equal('j');
      +      expect(scope.variables[3].name).to.be.equal('k');
      +      expect(scope.variables[4].name).to.be.equal('testing');
      +      expect(scope.variables[5].name).to.be.equal('template');
      +      expect(scope.references).to.have.length(5);
      +      expect(scope.references[0].identifier.name).to.be.equal('template');
      +      expect(scope.references[1].identifier.name).to.be.equal('testing');
      +      expect(scope.references[2].identifier.name).to.be.equal('i');
      +      expect(scope.references[3].identifier.name).to.be.equal('j');
      +      return expect(scope.references[4].identifier.name).to.be.equal('template');
      +    });
      +  });
      +
      +}).call(this);
      +
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImVzNi10ZW1wbGF0ZS1saXRlcmFsLmNvZmZlZSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF1QkE7QUFBQSxNQUFBLHVCQUFBOztBQUFBLEVBQUEsTUFBQSxHQUFTLE9BQUEsQ0FBUyxNQUFULENBQWUsQ0FBQyxNQUF6QixDQUFBOztBQUFBLEVBQ0EsT0FBQSxHQUFVLE9BQUEsQ0FBUyx3QkFBVCxDQURWLENBQUE7O0FBQUEsRUFFQSxNQUFBLEdBQVMsT0FBQSxDQUFTLElBQVQsQ0FGVCxDQUFBOztBQUFBLEVBSUEsUUFBQSxDQUFVLHNCQUFWLEVBQWlDLFNBQUEsR0FBQTtXQUM3QixFQUFBLENBQUksaUJBQUosRUFBc0IsU0FBQSxHQUFBO0FBQ2xCLFVBQUEsd0JBQUE7QUFBQSxNQUFBLEdBQUEsR0FBTSxPQUFPLENBQUMsS0FBUixDQUFpQiw4SUFBakIsQ0FBTixDQUFBO0FBQUEsTUFTQSxZQUFBLEdBQWUsTUFBTSxDQUFDLE9BQVAsQ0FBZSxHQUFmLEVBQW9CO0FBQUEsUUFBQSxXQUFBLEVBQWEsQ0FBYjtPQUFwQixDQVRmLENBQUE7QUFBQSxNQVVBLE1BQUEsQ0FBTyxZQUFZLENBQUMsTUFBcEIsQ0FBMkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXBDLENBQTJDLENBQTNDLENBVkEsQ0FBQTtBQUFBLE1BWUEsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQVo1QixDQUFBO0FBQUEsTUFhQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFFBQWhDLENBYkEsQ0FBQTtBQUFBLE1BY0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxLQUFLLENBQUMsSUFBbkIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQS9CLENBQXNDLFNBQXRDLENBZEEsQ0FBQTtBQUFBLE1BZUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxRQUFiLENBQXNCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxPQUFELENBZjVCLENBQUE7QUFBQSxNQWdCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBaEJBLENBQUE7QUFBQSxNQWtCQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBbEI1QixDQUFBO0FBQUEsTUFtQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxVQUFoQyxDQW5CQSxDQUFBO0FBQUEsTUFvQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxLQUFLLENBQUMsSUFBbkIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQS9CLENBQXNDLG9CQUF0QyxDQXBCQSxDQUFBO0FBQUEsTUFxQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxRQUFiLENBQXNCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxPQUFELENBckI1QixDQUFBO0FBQUEsTUFzQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQXRCQSxDQUFBO0FBQUEsTUF1QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLFdBQTdDLENBdkJBLENBQUE7QUFBQSxNQXdCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsR0FBN0MsQ0F4QkEsQ0FBQTtBQUFBLE1BeUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxHQUE3QyxDQXpCQSxDQUFBO0FBQUEsTUEwQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLEdBQTdDLENBMUJBLENBQUE7QUFBQSxNQTJCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsU0FBN0MsQ0EzQkEsQ0FBQTtBQUFBLE1BNEJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxVQUE3QyxDQTVCQSxDQUFBO0FBQUEsTUE2QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFiLENBQXdCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFqQyxDQUF3QyxDQUF4QyxDQTdCQSxDQUFBO0FBQUEsTUE4QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxVQUF6RCxDQTlCQSxDQUFBO0FBQUEsTUErQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxTQUF6RCxDQS9CQSxDQUFBO0FBQUEsTUFnQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxHQUF6RCxDQWhDQSxDQUFBO0FBQUEsTUFpQ0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFXLENBQUEsQ0FBQSxDQUFFLENBQUMsVUFBVSxDQUFDLElBQXRDLENBQTJDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUFsRCxDQUF5RCxHQUF6RCxDQWpDQSxDQUFBO2FBa0NBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsVUFBekQsRUFuQ2tCO0lBQUEsQ0FBdEIsRUFENkI7RUFBQSxDQUFqQyxDQUpBLENBQUE7QUFBQSIsImZpbGUiOiJlczYtdGVtcGxhdGUtbGl0ZXJhbC5qcyIsInNvdXJjZVJvb3QiOiIvc291cmNlLyIsInNvdXJjZXNDb250ZW50IjpbIiMgLSotIGNvZGluZzogdXRmLTggLSotXG4jICBDb3B5cmlnaHQgKEMpIDIwMTQgWXVzdWtlIFN1enVraSA8dXRhdGFuZS50ZWFAZ21haWwuY29tPlxuI1xuIyAgUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0XG4jICBtb2RpZmljYXRpb24sIGFyZSBwZXJtaXR0ZWQgcHJvdmlkZWQgdGhhdCB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnMgYXJlIG1ldDpcbiNcbiMgICAgKiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodFxuIyAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lci5cbiMgICAgKiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodFxuIyAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lciBpbiB0aGVcbiMgICAgICBkb2N1bWVudGF0aW9uIGFuZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQgd2l0aCB0aGUgZGlzdHJpYnV0aW9uLlxuI1xuIyAgVEhJUyBTT0ZUV0FSRSBJUyBQUk9WSURFRCBCWSBUSEUgQ09QWVJJR0hUIEhPTERFUlMgQU5EIENPTlRSSUJVVE9SUyBcIkFTIElTXCJcbiMgIEFORCBBTlkgRVhQUkVTUyBPUiBJTVBMSUVEIFdBUlJBTlRJRVMsIElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBUSEVcbiMgIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFXG4jICBBUkUgRElTQ0xBSU1FRC4gSU4gTk8gRVZFTlQgU0hBTEwgPENPUFlSSUdIVCBIT0xERVI+IEJFIExJQUJMRSBGT1IgQU5ZXG4jICBESVJFQ1QsIElORElSRUNULCBJTkNJREVOVEFMLCBTUEVDSUFMLCBFWEVNUExBUlksIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFU1xuIyAgKElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTO1xuIyAgTE9TUyBPRiBVU0UsIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EXG4jICBPTiBBTlkgVEhFT1JZIE9GIExJQUJJTElUWSwgV0hFVEhFUiBJTiBDT05UUkFDVCwgU1RSSUNUIExJQUJJTElUWSwgT1IgVE9SVFxuIyAgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFIE9GXG4jICBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLlxuXG5leHBlY3QgPSByZXF1aXJlKCdjaGFpJykuZXhwZWN0XG5oYXJtb255ID0gcmVxdWlyZSAnLi4vdGhpcmRfcGFydHkvZXNwcmltYSdcbmVzY29wZSA9IHJlcXVpcmUgJy4uJ1xuXG5kZXNjcmliZSAnRVM2IHRlbXBsYXRlIGxpdGVyYWwnLCAtPlxuICAgIGl0ICdyZWZlciB2YXJpYWJsZXMnLCAtPlxuICAgICAgICBhc3QgPSBoYXJtb255LnBhcnNlIFwiXCJcIlxuICAgICAgICAoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgbGV0IGksIGosIGs7XG4gICAgICAgICAgICBmdW5jdGlvbiB0ZXN0aW5nKCkgeyB9XG4gICAgICAgICAgICBsZXQgdGVtcGxhdGUgPSB0ZXN0aW5nYHRlc3RpbmcgJHtpfSBhbmQgJHtqfWBcbiAgICAgICAgICAgIHJldHVybiB0ZW1wbGF0ZTtcbiAgICAgICAgfSgpKTtcbiAgICAgICAgXCJcIlwiXG5cbiAgICAgICAgc2NvcGVNYW5hZ2VyID0gZXNjb3BlLmFuYWx5emUgYXN0LCBlY21hVmVyc2lvbjogNlxuICAgICAgICBleHBlY3Qoc2NvcGVNYW5hZ2VyLnNjb3BlcykudG8uaGF2ZS5sZW5ndGggM1xuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1swXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2dsb2JhbCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLmJsb2NrLnR5cGUpLnRvLmJlLmVxdWFsICdQcm9ncmFtJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuaXNTdHJpY3QpLnRvLmJlLmZhbHNlXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdmdW5jdGlvbidcbiAgICAgICAgZXhwZWN0KHNjb3BlLmJsb2NrLnR5cGUpLnRvLmJlLmVxdWFsICdGdW5jdGlvbkV4cHJlc3Npb24nXG4gICAgICAgIGV4cGVjdChzY29wZS5pc1N0cmljdCkudG8uYmUuZmFsc2VcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggNlxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICdhcmd1bWVudHMnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMV0ubmFtZSkudG8uYmUuZXF1YWwgJ2knXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMl0ubmFtZSkudG8uYmUuZXF1YWwgJ2onXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbM10ubmFtZSkudG8uYmUuZXF1YWwgJ2snXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbNF0ubmFtZSkudG8uYmUuZXF1YWwgJ3Rlc3RpbmcnXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbNV0ubmFtZSkudG8uYmUuZXF1YWwgJ3RlbXBsYXRlJ1xuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggNVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1swXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsICd0ZW1wbGF0ZSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMV0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAndGVzdGluZydcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMl0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnaSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbM10uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnaidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbNF0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAndGVtcGxhdGUnXG5cbiMgdmltOiBzZXQgc3c9NCB0cz00IGV0IHR3PTgwIDpcbiJdfQ==
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/powered-test/function-expression-name.js b/tools/eslint/node_modules/escope/powered-test/function-expression-name.js
      new file mode 100644
      index 00000000000000..7df0841856e3e8
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/powered-test/function-expression-name.js
      @@ -0,0 +1,42 @@
      +(function() {
      +  var escope, esprima, expect, harmony;
      +
      +  expect = require('chai').expect;
      +
      +  esprima = require('esprima');
      +
      +  harmony = require('../third_party/esprima');
      +
      +  escope = require('..');
      +
      +  describe('function name', function() {
      +    return it('should create its special scope', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = esprima.parse("(function name() {\n}());");
      +      scopeManager = escope.analyze(ast);
      +      expect(scopeManager.scopes).to.have.length(3);
      +      globalScope = scopeManager.scopes[0];
      +      expect(globalScope.type).to.be.equal('global');
      +      expect(globalScope.variables).to.have.length(0);
      +      expect(globalScope.references).to.have.length(0);
      +      expect(globalScope.isArgumentsMaterialized()).to.be["true"];
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function-expression-name');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('name');
      +      expect(scope.isArgumentsMaterialized()).to.be["true"];
      +      expect(scope.references).to.have.length(0);
      +      expect(scope.upper === globalScope).to.be["true"];
      +      scope = scopeManager.scopes[2];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      expect(scope.isArgumentsMaterialized()).to.be["false"];
      +      expect(scope.references).to.have.length(0);
      +      return expect(scope.upper === scopeManager.scopes[1]).to.be["true"];
      +    });
      +  });
      +
      +}).call(this);
      +
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZ1bmN0aW9uLWV4cHJlc3Npb24tbmFtZS5jb2ZmZWUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBdUJBO0FBQUEsTUFBQSxnQ0FBQTs7QUFBQSxFQUFBLE1BQUEsR0FBUyxPQUFBLENBQVMsTUFBVCxDQUFlLENBQUMsTUFBekIsQ0FBQTs7QUFBQSxFQUNBLE9BQUEsR0FBVSxPQUFBLENBQVMsU0FBVCxDQURWLENBQUE7O0FBQUEsRUFFQSxPQUFBLEdBQVUsT0FBQSxDQUFTLHdCQUFULENBRlYsQ0FBQTs7QUFBQSxFQUdBLE1BQUEsR0FBUyxPQUFBLENBQVMsSUFBVCxDQUhULENBQUE7O0FBQUEsRUFLQSxRQUFBLENBQVUsZUFBVixFQUEwQixTQUFBLEdBQUE7V0FDdEIsRUFBQSxDQUFJLGlDQUFKLEVBQXNDLFNBQUEsR0FBQTtBQUNsQyxVQUFBLHFDQUFBO0FBQUEsTUFBQSxHQUFBLEdBQU0sT0FBTyxDQUFDLEtBQVIsQ0FBaUIsMkJBQWpCLENBQU4sQ0FBQTtBQUFBLE1BS0EsWUFBQSxHQUFlLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixDQUxmLENBQUE7QUFBQSxNQU1BLE1BQUEsQ0FBTyxZQUFZLENBQUMsTUFBcEIsQ0FBMkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXBDLENBQTJDLENBQTNDLENBTkEsQ0FBQTtBQUFBLE1BT0EsV0FBQSxHQUFjLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQVBsQyxDQUFBO0FBQUEsTUFRQSxNQUFBLENBQU8sV0FBVyxDQUFDLElBQW5CLENBQXdCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEvQixDQUFzQyxRQUF0QyxDQVJBLENBQUE7QUFBQSxNQVNBLE1BQUEsQ0FBTyxXQUFXLENBQUMsU0FBbkIsQ0FBNkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXRDLENBQTZDLENBQTdDLENBVEEsQ0FBQTtBQUFBLE1BVUEsTUFBQSxDQUFPLFdBQVcsQ0FBQyxVQUFuQixDQUE4QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBdkMsQ0FBOEMsQ0FBOUMsQ0FWQSxDQUFBO0FBQUEsTUFXQSxNQUFBLENBQU8sV0FBVyxDQUFDLHVCQUFaLENBQUEsQ0FBUCxDQUE2QyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxDQVhuRCxDQUFBO0FBQUEsTUFjQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBZDVCLENBQUE7QUFBQSxNQWVBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsMEJBQWhDLENBZkEsQ0FBQTtBQUFBLE1BZ0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0FoQkEsQ0FBQTtBQUFBLE1BaUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxNQUE3QyxDQWpCQSxDQUFBO0FBQUEsTUFrQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyx1QkFBTixDQUFBLENBQVAsQ0FBdUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0FsQjdDLENBQUE7QUFBQSxNQW1CQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBbkJBLENBQUE7QUFBQSxNQW9CQSxNQUFBLENBQU8sS0FBSyxDQUFDLEtBQU4sS0FBZSxXQUF0QixDQUFrQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxDQXBCeEMsQ0FBQTtBQUFBLE1BdUJBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0F2QjVCLENBQUE7QUFBQSxNQXdCQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFVBQWhDLENBeEJBLENBQUE7QUFBQSxNQXlCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBekJBLENBQUE7QUFBQSxNQTBCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsV0FBN0MsQ0ExQkEsQ0FBQTtBQUFBLE1BMkJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsdUJBQU4sQ0FBQSxDQUFQLENBQXVDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxPQUFELENBM0I3QyxDQUFBO0FBQUEsTUE0QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxVQUFiLENBQXdCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFqQyxDQUF3QyxDQUF4QyxDQTVCQSxDQUFBO2FBNkJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsS0FBTixLQUFlLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQUExQyxDQUE2QyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxFQTlCakI7SUFBQSxDQUF0QyxFQURzQjtFQUFBLENBQTFCLENBTEEsQ0FBQTtBQUFBIiwiZmlsZSI6ImZ1bmN0aW9uLWV4cHJlc3Npb24tbmFtZS5qcyIsInNvdXJjZVJvb3QiOiIvc291cmNlLyIsInNvdXJjZXNDb250ZW50IjpbIiMgLSotIGNvZGluZzogdXRmLTggLSotXG4jICBDb3B5cmlnaHQgKEMpIDIwMTUgWXVzdWtlIFN1enVraSA8dXRhdGFuZS50ZWFAZ21haWwuY29tPlxuI1xuIyAgUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0XG4jICBtb2RpZmljYXRpb24sIGFyZSBwZXJtaXR0ZWQgcHJvdmlkZWQgdGhhdCB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnMgYXJlIG1ldDpcbiNcbiMgICAgKiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodFxuIyAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lci5cbiMgICAgKiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodFxuIyAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lciBpbiB0aGVcbiMgICAgICBkb2N1bWVudGF0aW9uIGFuZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQgd2l0aCB0aGUgZGlzdHJpYnV0aW9uLlxuI1xuIyAgVEhJUyBTT0ZUV0FSRSBJUyBQUk9WSURFRCBCWSBUSEUgQ09QWVJJR0hUIEhPTERFUlMgQU5EIENPTlRSSUJVVE9SUyBcIkFTIElTXCJcbiMgIEFORCBBTlkgRVhQUkVTUyBPUiBJTVBMSUVEIFdBUlJBTlRJRVMsIElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBUSEVcbiMgIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFXG4jICBBUkUgRElTQ0xBSU1FRC4gSU4gTk8gRVZFTlQgU0hBTEwgPENPUFlSSUdIVCBIT0xERVI+IEJFIExJQUJMRSBGT1IgQU5ZXG4jICBESVJFQ1QsIElORElSRUNULCBJTkNJREVOVEFMLCBTUEVDSUFMLCBFWEVNUExBUlksIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFU1xuIyAgKElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTO1xuIyAgTE9TUyBPRiBVU0UsIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EXG4jICBPTiBBTlkgVEhFT1JZIE9GIExJQUJJTElUWSwgV0hFVEhFUiBJTiBDT05UUkFDVCwgU1RSSUNUIExJQUJJTElUWSwgT1IgVE9SVFxuIyAgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFIE9GXG4jICBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLlxuXG5leHBlY3QgPSByZXF1aXJlKCdjaGFpJykuZXhwZWN0XG5lc3ByaW1hID0gcmVxdWlyZSAnZXNwcmltYSdcbmhhcm1vbnkgPSByZXF1aXJlICcuLi90aGlyZF9wYXJ0eS9lc3ByaW1hJ1xuZXNjb3BlID0gcmVxdWlyZSAnLi4nXG5cbmRlc2NyaWJlICdmdW5jdGlvbiBuYW1lJywgLT5cbiAgICBpdCAnc2hvdWxkIGNyZWF0ZSBpdHMgc3BlY2lhbCBzY29wZScsIC0+XG4gICAgICAgIGFzdCA9IGVzcHJpbWEucGFyc2UgXCJcIlwiXG4gICAgICAgIChmdW5jdGlvbiBuYW1lKCkge1xuICAgICAgICB9KCkpO1xuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3RcbiAgICAgICAgZXhwZWN0KHNjb3BlTWFuYWdlci5zY29wZXMpLnRvLmhhdmUubGVuZ3RoIDNcbiAgICAgICAgZ2xvYmFsU2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzBdXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS50eXBlKS50by5iZS5lcXVhbCAnZ2xvYmFsJ1xuICAgICAgICBleHBlY3QoZ2xvYmFsU2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS5pc0FyZ3VtZW50c01hdGVyaWFsaXplZCgpKS50by5iZS50cnVlXG5cbiAgICAgICAgIyBGdW5jdGlvbiBleHByZXNzaW9uIG5hbWUgc2NvcGVcbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzFdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZnVuY3Rpb24tZXhwcmVzc2lvbi1uYW1lJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAxXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwgJ25hbWUnXG4gICAgICAgIGV4cGVjdChzY29wZS5pc0FyZ3VtZW50c01hdGVyaWFsaXplZCgpKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgIGV4cGVjdChzY29wZS51cHBlciBpcyBnbG9iYWxTY29wZSkudG8uYmUudHJ1ZVxuXG4gICAgICAgICMgRnVuY3Rpb24gc2NvcGVcbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzJdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZnVuY3Rpb24nXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5uYW1lKS50by5iZS5lcXVhbCAnYXJndW1lbnRzJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuaXNBcmd1bWVudHNNYXRlcmlhbGl6ZWQoKSkudG8uYmUuZmFsc2VcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcbiAgICAgICAgZXhwZWN0KHNjb3BlLnVwcGVyIGlzIHNjb3BlTWFuYWdlci5zY29wZXNbMV0pLnRvLmJlLnRydWVcblxuXG4jIHZpbTogc2V0IHN3PTQgdHM9NCBldCB0dz04MCA6XG4iXX0=
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/powered-test/global-increment.js b/tools/eslint/node_modules/escope/powered-test/global-increment.js
      new file mode 100644
      index 00000000000000..39024ff15899c8
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/powered-test/global-increment.js
      @@ -0,0 +1,28 @@
      +(function() {
      +  var escope, esprima, expect, harmony;
      +
      +  expect = require('chai').expect;
      +
      +  esprima = require('esprima');
      +
      +  harmony = require('../third_party/esprima');
      +
      +  escope = require('..');
      +
      +  describe('global increment', function() {
      +    return it('becomes read/write', function() {
      +      var ast, globalScope, scopeManager;
      +      ast = esprima.parse("b++;");
      +      scopeManager = escope.analyze(ast);
      +      expect(scopeManager.scopes).to.have.length(1);
      +      globalScope = scopeManager.scopes[0];
      +      expect(globalScope.type).to.be.equal('global');
      +      expect(globalScope.variables).to.have.length(0);
      +      expect(globalScope.references).to.have.length(1);
      +      return expect(globalScope.references[0].isReadWrite()).to.be["true"];
      +    });
      +  });
      +
      +}).call(this);
      +
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImdsb2JhbC1pbmNyZW1lbnQuY29mZmVlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVCQTtBQUFBLE1BQUEsZ0NBQUE7O0FBQUEsRUFBQSxNQUFBLEdBQVMsT0FBQSxDQUFTLE1BQVQsQ0FBZSxDQUFDLE1BQXpCLENBQUE7O0FBQUEsRUFDQSxPQUFBLEdBQVUsT0FBQSxDQUFTLFNBQVQsQ0FEVixDQUFBOztBQUFBLEVBRUEsT0FBQSxHQUFVLE9BQUEsQ0FBUyx3QkFBVCxDQUZWLENBQUE7O0FBQUEsRUFHQSxNQUFBLEdBQVMsT0FBQSxDQUFTLElBQVQsQ0FIVCxDQUFBOztBQUFBLEVBS0EsUUFBQSxDQUFVLGtCQUFWLEVBQTZCLFNBQUEsR0FBQTtXQUN6QixFQUFBLENBQUksb0JBQUosRUFBeUIsU0FBQSxHQUFBO0FBQ3JCLFVBQUEsOEJBQUE7QUFBQSxNQUFBLEdBQUEsR0FBTSxPQUFPLENBQUMsS0FBUixDQUFpQixNQUFqQixDQUFOLENBQUE7QUFBQSxNQUlBLFlBQUEsR0FBZSxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsQ0FKZixDQUFBO0FBQUEsTUFLQSxNQUFBLENBQU8sWUFBWSxDQUFDLE1BQXBCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQUxBLENBQUE7QUFBQSxNQU1BLFdBQUEsR0FBYyxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FObEMsQ0FBQTtBQUFBLE1BT0EsTUFBQSxDQUFPLFdBQVcsQ0FBQyxJQUFuQixDQUF3QixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBL0IsQ0FBc0MsUUFBdEMsQ0FQQSxDQUFBO0FBQUEsTUFRQSxNQUFBLENBQU8sV0FBVyxDQUFDLFNBQW5CLENBQTZCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUF0QyxDQUE2QyxDQUE3QyxDQVJBLENBQUE7QUFBQSxNQVNBLE1BQUEsQ0FBTyxXQUFXLENBQUMsVUFBbkIsQ0FBOEIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXZDLENBQThDLENBQTlDLENBVEEsQ0FBQTthQVVBLE1BQUEsQ0FBTyxXQUFXLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFdBQTFCLENBQUEsQ0FBUCxDQUErQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxFQVhoQztJQUFBLENBQXpCLEVBRHlCO0VBQUEsQ0FBN0IsQ0FMQSxDQUFBO0FBQUEiLCJmaWxlIjoiZ2xvYmFsLWluY3JlbWVudC5qcyIsInNvdXJjZVJvb3QiOiIvc291cmNlLyIsInNvdXJjZXNDb250ZW50IjpbIiMgLSotIGNvZGluZzogdXRmLTggLSotXG4jICBDb3B5cmlnaHQgKEMpIDIwMTUgWXVzdWtlIFN1enVraSA8dXRhdGFuZS50ZWFAZ21haWwuY29tPlxuI1xuIyAgUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0XG4jICBtb2RpZmljYXRpb24sIGFyZSBwZXJtaXR0ZWQgcHJvdmlkZWQgdGhhdCB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnMgYXJlIG1ldDpcbiNcbiMgICAgKiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodFxuIyAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lci5cbiMgICAgKiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodFxuIyAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lciBpbiB0aGVcbiMgICAgICBkb2N1bWVudGF0aW9uIGFuZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQgd2l0aCB0aGUgZGlzdHJpYnV0aW9uLlxuI1xuIyAgVEhJUyBTT0ZUV0FSRSBJUyBQUk9WSURFRCBCWSBUSEUgQ09QWVJJR0hUIEhPTERFUlMgQU5EIENPTlRSSUJVVE9SUyBcIkFTIElTXCJcbiMgIEFORCBBTlkgRVhQUkVTUyBPUiBJTVBMSUVEIFdBUlJBTlRJRVMsIElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBUSEVcbiMgIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFXG4jICBBUkUgRElTQ0xBSU1FRC4gSU4gTk8gRVZFTlQgU0hBTEwgPENPUFlSSUdIVCBIT0xERVI+IEJFIExJQUJMRSBGT1IgQU5ZXG4jICBESVJFQ1QsIElORElSRUNULCBJTkNJREVOVEFMLCBTUEVDSUFMLCBFWEVNUExBUlksIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFU1xuIyAgKElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTO1xuIyAgTE9TUyBPRiBVU0UsIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EXG4jICBPTiBBTlkgVEhFT1JZIE9GIExJQUJJTElUWSwgV0hFVEhFUiBJTiBDT05UUkFDVCwgU1RSSUNUIExJQUJJTElUWSwgT1IgVE9SVFxuIyAgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFIE9GXG4jICBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLlxuXG5leHBlY3QgPSByZXF1aXJlKCdjaGFpJykuZXhwZWN0XG5lc3ByaW1hID0gcmVxdWlyZSAnZXNwcmltYSdcbmhhcm1vbnkgPSByZXF1aXJlICcuLi90aGlyZF9wYXJ0eS9lc3ByaW1hJ1xuZXNjb3BlID0gcmVxdWlyZSAnLi4nXG5cbmRlc2NyaWJlICdnbG9iYWwgaW5jcmVtZW50JywgLT5cbiAgICBpdCAnYmVjb21lcyByZWFkL3dyaXRlJywgLT5cbiAgICAgICAgYXN0ID0gZXNwcmltYS5wYXJzZSBcIlwiXCJcbiAgICAgICAgYisrO1xuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3RcbiAgICAgICAgZXhwZWN0KHNjb3BlTWFuYWdlci5zY29wZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZ2xvYmFsU2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzBdXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS50eXBlKS50by5iZS5lcXVhbCAnZ2xvYmFsJ1xuICAgICAgICBleHBlY3QoZ2xvYmFsU2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAxXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS5yZWZlcmVuY2VzWzBdLmlzUmVhZFdyaXRlKCkpLnRvLmJlLnRydWVcblxuIyB2aW06IHNldCBzdz00IHRzPTQgZXQgdHc9ODAgOlxuIl19
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/powered-test/implicit-global-reference.js b/tools/eslint/node_modules/escope/powered-test/implicit-global-reference.js
      new file mode 100644
      index 00000000000000..b6cf989d99adb9
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/powered-test/implicit-global-reference.js
      @@ -0,0 +1,113 @@
      +(function() {
      +  'use strict';
      +  var escope, esprima, expect;
      +
      +  expect = require('chai').expect;
      +
      +  escope = require('..');
      +
      +  esprima = require('esprima');
      +
      +  describe('implicit global reference', function() {
      +    it('assignments global scope', function() {
      +      var ast, scopes;
      +      ast = esprima.parse("var x = 20;\nx = 300;");
      +      scopes = escope.analyze(ast).scopes;
      +      expect(scopes.map(function(scope) {
      +        return scope.variables.map(function(variable) {
      +          return variable.defs.map(function(def) {
      +            return def.type;
      +          });
      +        });
      +      })).to.be.eql([[['Variable']]]);
      +      return expect(scopes[0].implicit.variables.map(function(variable) {
      +        return variable.name;
      +      })).to.be.eql([]);
      +    });
      +    it('assignments global scope without definition', function() {
      +      var ast, scopes;
      +      ast = esprima.parse("x = 300;\nx = 300;");
      +      scopes = escope.analyze(ast).scopes;
      +      expect(scopes.map(function(scope) {
      +        return scope.variables.map(function(variable) {
      +          return variable.defs.map(function(def) {
      +            return def.type;
      +          });
      +        });
      +      })).to.be.eql([[]]);
      +      return expect(scopes[0].implicit.variables.map(function(variable) {
      +        return variable.name;
      +      })).to.be.eql(['x']);
      +    });
      +    it('assignments global scope without definition eval', function() {
      +      var ast, scopes;
      +      ast = esprima.parse("function inner() {\n    eval(str);\n    x = 300;\n}");
      +      scopes = escope.analyze(ast).scopes;
      +      expect(scopes.map(function(scope) {
      +        return scope.variables.map(function(variable) {
      +          return variable.defs.map(function(def) {
      +            return def.type;
      +          });
      +        });
      +      })).to.be.eql([[['FunctionName']], [[]]]);
      +      return expect(scopes[0].implicit.variables.map(function(variable) {
      +        return variable.name;
      +      })).to.be.eql([]);
      +    });
      +    it('assignment leaks', function() {
      +      var ast, scopes;
      +      ast = esprima.parse("function outer() {\n    x = 20;\n}");
      +      scopes = escope.analyze(ast).scopes;
      +      expect(scopes.map(function(scope) {
      +        return scope.variables.map(function(variable) {
      +          return variable.name;
      +        });
      +      })).to.be.eql([['outer'], ['arguments']]);
      +      return expect(scopes[0].implicit.variables.map(function(variable) {
      +        return variable.name;
      +      })).to.be.eql(['x']);
      +    });
      +    it('assignment doesn\'t leak', function() {
      +      var ast, scopes;
      +      ast = esprima.parse("function outer() {\n    function inner() {\n        x = 20;\n    }\n    var x;\n}");
      +      scopes = escope.analyze(ast).scopes;
      +      expect(scopes.map(function(scope) {
      +        return scope.variables.map(function(variable) {
      +          return variable.name;
      +        });
      +      })).to.be.eql([['outer'], ['arguments', 'inner', 'x'], ['arguments']]);
      +      return expect(scopes[0].implicit.variables.map(function(variable) {
      +        return variable.name;
      +      })).to.be.eql([]);
      +    });
      +    it('for-in-statement leaks', function() {
      +      var ast, scopes;
      +      ast = esprima.parse("function outer() {\n    for (x in y) { }\n}");
      +      scopes = escope.analyze(ast).scopes;
      +      expect(scopes.map(function(scope) {
      +        return scope.variables.map(function(variable) {
      +          return variable.name;
      +        });
      +      })).to.be.eql([['outer'], ['arguments']]);
      +      return expect(scopes[0].implicit.variables.map(function(variable) {
      +        return variable.name;
      +      })).to.be.eql(['x']);
      +    });
      +    return it('for-in-statement doesn\'t leaks', function() {
      +      var ast, scopes;
      +      ast = esprima.parse("function outer() {\n    function inner() {\n        for (x in y) { }\n    }\n    var x;\n}");
      +      scopes = escope.analyze(ast).scopes;
      +      expect(scopes.map(function(scope) {
      +        return scope.variables.map(function(variable) {
      +          return variable.name;
      +        });
      +      })).to.be.eql([['outer'], ['arguments', 'inner', 'x'], ['arguments']]);
      +      return expect(scopes[0].implicit.variables.map(function(variable) {
      +        return variable.name;
      +      })).to.be.eql([]);
      +    });
      +  });
      +
      +}).call(this);
      +
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImltcGxpY2l0LWdsb2JhbC1yZWZlcmVuY2UuY29mZmVlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXNCQztBQUFBLEVBQUEsWUFBQSxDQUFBO0FBQUEsTUFBQSx1QkFBQTs7QUFBQSxFQUVELE1BQUEsR0FBUyxPQUFBLENBQVMsTUFBVCxDQUFlLENBQUMsTUFGeEIsQ0FBQTs7QUFBQSxFQUdELE1BQUEsR0FBUyxPQUFBLENBQVMsSUFBVCxDQUhSLENBQUE7O0FBQUEsRUFJRCxPQUFBLEdBQVUsT0FBQSxDQUFTLFNBQVQsQ0FKVCxDQUFBOztBQUFBLEVBTUQsUUFBQSxDQUFVLDJCQUFWLEVBQXNDLFNBQUEsR0FBQTtBQUNsQyxJQUFBLEVBQUEsQ0FBSSwwQkFBSixFQUErQixTQUFBLEdBQUE7QUFDM0IsVUFBQSxXQUFBO0FBQUEsTUFBQSxHQUFBLEdBQU0sT0FBTyxDQUFDLEtBQVIsQ0FBaUIsdUJBQWpCLENBQU4sQ0FBQTtBQUFBLE1BS0EsTUFBQSxHQUFTLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixDQUFtQixDQUFDLE1BTDdCLENBQUE7QUFBQSxNQU9BLE1BQUEsQ0FBTyxNQUFNLENBQUMsR0FBUCxDQUFXLFNBQUMsS0FBRCxHQUFBO2VBQ2QsS0FBSyxDQUFDLFNBQVMsQ0FBQyxHQUFoQixDQUFvQixTQUFDLFFBQUQsR0FBQTtpQkFDaEIsUUFBUSxDQUFDLElBQUksQ0FBQyxHQUFkLENBQWtCLFNBQUMsR0FBRCxHQUFBO21CQUFTLEdBQUcsQ0FBQyxLQUFiO1VBQUEsQ0FBbEIsRUFEZ0I7UUFBQSxDQUFwQixFQURjO01BQUEsQ0FBWCxDQUFQLENBRStDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxHQUZ0RCxDQUdJLENBQ0ksQ0FDSSxDQUNLLFVBREwsQ0FESixDQURKLENBSEosQ0FQQSxDQUFBO2FBbUJBLE1BQUEsQ0FBTyxNQUFPLENBQUEsQ0FBQSxDQUFFLENBQUMsUUFBUSxDQUFDLFNBQVMsQ0FBQyxHQUE3QixDQUFpQyxTQUFDLFFBQUQsR0FBQTtlQUFjLFFBQVEsQ0FBQyxLQUF2QjtNQUFBLENBQWpDLENBQVAsQ0FBcUUsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEdBQTVFLENBQWdGLEVBQWhGLEVBcEIyQjtJQUFBLENBQS9CLENBQUEsQ0FBQTtBQUFBLElBc0JBLEVBQUEsQ0FBSSw2Q0FBSixFQUFrRCxTQUFBLEdBQUE7QUFDOUMsVUFBQSxXQUFBO0FBQUEsTUFBQSxHQUFBLEdBQU0sT0FBTyxDQUFDLEtBQVIsQ0FBaUIsb0JBQWpCLENBQU4sQ0FBQTtBQUFBLE1BS0EsTUFBQSxHQUFTLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixDQUFtQixDQUFDLE1BTDdCLENBQUE7QUFBQSxNQU9BLE1BQUEsQ0FBTyxNQUFNLENBQUMsR0FBUCxDQUFXLFNBQUMsS0FBRCxHQUFBO2VBQ2QsS0FBSyxDQUFDLFNBQVMsQ0FBQyxHQUFoQixDQUFvQixTQUFDLFFBQUQsR0FBQTtpQkFDaEIsUUFBUSxDQUFDLElBQUksQ0FBQyxHQUFkLENBQWtCLFNBQUMsR0FBRCxHQUFBO21CQUFTLEdBQUcsQ0FBQyxLQUFiO1VBQUEsQ0FBbEIsRUFEZ0I7UUFBQSxDQUFwQixFQURjO01BQUEsQ0FBWCxDQUFQLENBRStDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxHQUZ0RCxDQUdJLENBQ0ksRUFESixDQUhKLENBUEEsQ0FBQTthQWdCQSxNQUFBLENBQU8sTUFBTyxDQUFBLENBQUEsQ0FBRSxDQUFDLFFBQVEsQ0FBQyxTQUFTLENBQUMsR0FBN0IsQ0FBaUMsU0FBQyxRQUFELEdBQUE7ZUFBYyxRQUFRLENBQUMsS0FBdkI7TUFBQSxDQUFqQyxDQUFQLENBQXFFLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxHQUE1RSxDQUNJLENBQ0ssR0FETCxDQURKLEVBakI4QztJQUFBLENBQWxELENBdEJBLENBQUE7QUFBQSxJQTZDQSxFQUFBLENBQUksa0RBQUosRUFBdUQsU0FBQSxHQUFBO0FBQ25ELFVBQUEsV0FBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLHFEQUFqQixDQUFOLENBQUE7QUFBQSxNQU9BLE1BQUEsR0FBUyxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsQ0FBbUIsQ0FBQyxNQVA3QixDQUFBO0FBQUEsTUFTQSxNQUFBLENBQU8sTUFBTSxDQUFDLEdBQVAsQ0FBVyxTQUFDLEtBQUQsR0FBQTtlQUNkLEtBQUssQ0FBQyxTQUFTLENBQUMsR0FBaEIsQ0FBb0IsU0FBQyxRQUFELEdBQUE7aUJBQ2hCLFFBQVEsQ0FBQyxJQUFJLENBQUMsR0FBZCxDQUFrQixTQUFDLEdBQUQsR0FBQTttQkFBUyxHQUFHLENBQUMsS0FBYjtVQUFBLENBQWxCLEVBRGdCO1FBQUEsQ0FBcEIsRUFEYztNQUFBLENBQVgsQ0FBUCxDQUUrQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsR0FGdEQsQ0FHSSxDQUNJLENBQ0ksQ0FDSyxjQURMLENBREosQ0FESixFQU1JLENBQ0ksRUFESixDQU5KLENBSEosQ0FUQSxDQUFBO2FBeUJBLE1BQUEsQ0FBTyxNQUFPLENBQUEsQ0FBQSxDQUFFLENBQUMsUUFBUSxDQUFDLFNBQVMsQ0FBQyxHQUE3QixDQUFpQyxTQUFDLFFBQUQsR0FBQTtlQUFjLFFBQVEsQ0FBQyxLQUF2QjtNQUFBLENBQWpDLENBQVAsQ0FBcUUsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEdBQTVFLENBQWdGLEVBQWhGLEVBMUJtRDtJQUFBLENBQXZELENBN0NBLENBQUE7QUFBQSxJQXlFQSxFQUFBLENBQUksa0JBQUosRUFBdUIsU0FBQSxHQUFBO0FBQ25CLFVBQUEsV0FBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLG9DQUFqQixDQUFOLENBQUE7QUFBQSxNQU1BLE1BQUEsR0FBUyxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsQ0FBbUIsQ0FBQyxNQU43QixDQUFBO0FBQUEsTUFRQSxNQUFBLENBQU8sTUFBTSxDQUFDLEdBQVAsQ0FBVyxTQUFDLEtBQUQsR0FBQTtlQUNkLEtBQUssQ0FBQyxTQUFTLENBQUMsR0FBaEIsQ0FBb0IsU0FBQyxRQUFELEdBQUE7aUJBQWMsUUFBUSxDQUFDLEtBQXZCO1FBQUEsQ0FBcEIsRUFEYztNQUFBLENBQVgsQ0FBUCxDQUNzRCxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsR0FEN0QsQ0FFSSxDQUNJLENBQ0ssT0FETCxDQURKLEVBSUksQ0FDSyxXQURMLENBSkosQ0FGSixDQVJBLENBQUE7YUFvQkEsTUFBQSxDQUFPLE1BQU8sQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUFRLENBQUMsU0FBUyxDQUFDLEdBQTdCLENBQWlDLFNBQUMsUUFBRCxHQUFBO2VBQWMsUUFBUSxDQUFDLEtBQXZCO01BQUEsQ0FBakMsQ0FBUCxDQUFxRSxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsR0FBNUUsQ0FDSSxDQUNLLEdBREwsQ0FESixFQXJCbUI7SUFBQSxDQUF2QixDQXpFQSxDQUFBO0FBQUEsSUFvR0EsRUFBQSxDQUFJLDBCQUFKLEVBQStCLFNBQUEsR0FBQTtBQUMzQixVQUFBLFdBQUE7QUFBQSxNQUFBLEdBQUEsR0FBTSxPQUFPLENBQUMsS0FBUixDQUFpQixtRkFBakIsQ0FBTixDQUFBO0FBQUEsTUFTQSxNQUFBLEdBQVMsTUFBTSxDQUFDLE9BQVAsQ0FBZSxHQUFmLENBQW1CLENBQUMsTUFUN0IsQ0FBQTtBQUFBLE1BV0EsTUFBQSxDQUFPLE1BQU0sQ0FBQyxHQUFQLENBQVcsU0FBQyxLQUFELEdBQUE7ZUFDZCxLQUFLLENBQUMsU0FBUyxDQUFDLEdBQWhCLENBQW9CLFNBQUMsUUFBRCxHQUFBO2lCQUFjLFFBQVEsQ0FBQyxLQUF2QjtRQUFBLENBQXBCLEVBRGM7TUFBQSxDQUFYLENBQVAsQ0FDc0QsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEdBRDdELENBRUksQ0FDSSxDQUNLLE9BREwsQ0FESixFQUlJLENBQ0ssV0FETCxFQUVLLE9BRkwsRUFHSyxHQUhMLENBSkosRUFTSSxDQUNLLFdBREwsQ0FUSixDQUZKLENBWEEsQ0FBQTthQTRCQSxNQUFBLENBQU8sTUFBTyxDQUFBLENBQUEsQ0FBRSxDQUFDLFFBQVEsQ0FBQyxTQUFTLENBQUMsR0FBN0IsQ0FBaUMsU0FBQyxRQUFELEdBQUE7ZUFBYyxRQUFRLENBQUMsS0FBdkI7TUFBQSxDQUFqQyxDQUFQLENBQXFFLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxHQUE1RSxDQUFnRixFQUFoRixFQTdCMkI7SUFBQSxDQUEvQixDQXBHQSxDQUFBO0FBQUEsSUFvSUEsRUFBQSxDQUFJLHdCQUFKLEVBQTZCLFNBQUEsR0FBQTtBQUN6QixVQUFBLFdBQUE7QUFBQSxNQUFBLEdBQUEsR0FBTSxPQUFPLENBQUMsS0FBUixDQUFpQiw2Q0FBakIsQ0FBTixDQUFBO0FBQUEsTUFNQSxNQUFBLEdBQVMsTUFBTSxDQUFDLE9BQVAsQ0FBZSxHQUFmLENBQW1CLENBQUMsTUFON0IsQ0FBQTtBQUFBLE1BUUEsTUFBQSxDQUFPLE1BQU0sQ0FBQyxHQUFQLENBQVcsU0FBQyxLQUFELEdBQUE7ZUFDZCxLQUFLLENBQUMsU0FBUyxDQUFDLEdBQWhCLENBQW9CLFNBQUMsUUFBRCxHQUFBO2lCQUFjLFFBQVEsQ0FBQyxLQUF2QjtRQUFBLENBQXBCLEVBRGM7TUFBQSxDQUFYLENBQVAsQ0FDc0QsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEdBRDdELENBRUksQ0FDSSxDQUNLLE9BREwsQ0FESixFQUlJLENBQ0ssV0FETCxDQUpKLENBRkosQ0FSQSxDQUFBO2FBb0JBLE1BQUEsQ0FBTyxNQUFPLENBQUEsQ0FBQSxDQUFFLENBQUMsUUFBUSxDQUFDLFNBQVMsQ0FBQyxHQUE3QixDQUFpQyxTQUFDLFFBQUQsR0FBQTtlQUFjLFFBQVEsQ0FBQyxLQUF2QjtNQUFBLENBQWpDLENBQVAsQ0FBcUUsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEdBQTVFLENBQ0ksQ0FDSyxHQURMLENBREosRUFyQnlCO0lBQUEsQ0FBN0IsQ0FwSUEsQ0FBQTtXQStKQSxFQUFBLENBQUksaUNBQUosRUFBc0MsU0FBQSxHQUFBO0FBQ2xDLFVBQUEsV0FBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLDRGQUFqQixDQUFOLENBQUE7QUFBQSxNQVNBLE1BQUEsR0FBUyxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsQ0FBbUIsQ0FBQyxNQVQ3QixDQUFBO0FBQUEsTUFXQSxNQUFBLENBQU8sTUFBTSxDQUFDLEdBQVAsQ0FBVyxTQUFDLEtBQUQsR0FBQTtlQUNkLEtBQUssQ0FBQyxTQUFTLENBQUMsR0FBaEIsQ0FBb0IsU0FBQyxRQUFELEdBQUE7aUJBQWMsUUFBUSxDQUFDLEtBQXZCO1FBQUEsQ0FBcEIsRUFEYztNQUFBLENBQVgsQ0FBUCxDQUNzRCxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsR0FEN0QsQ0FFSSxDQUNJLENBQ0ssT0FETCxDQURKLEVBSUksQ0FDSyxXQURMLEVBRUssT0FGTCxFQUdLLEdBSEwsQ0FKSixFQVNJLENBQ0ssV0FETCxDQVRKLENBRkosQ0FYQSxDQUFBO2FBNEJBLE1BQUEsQ0FBTyxNQUFPLENBQUEsQ0FBQSxDQUFFLENBQUMsUUFBUSxDQUFDLFNBQVMsQ0FBQyxHQUE3QixDQUFpQyxTQUFDLFFBQUQsR0FBQTtlQUFjLFFBQVEsQ0FBQyxLQUF2QjtNQUFBLENBQWpDLENBQVAsQ0FBcUUsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEdBQTVFLENBQWdGLEVBQWhGLEVBN0JrQztJQUFBLENBQXRDLEVBaEtrQztFQUFBLENBQXRDLENBTkMsQ0FBQTtBQUFBIiwiZmlsZSI6ImltcGxpY2l0LWdsb2JhbC1yZWZlcmVuY2UuanMiLCJzb3VyY2VSb290IjoiL3NvdXJjZS8iLCJzb3VyY2VzQ29udGVudCI6WyIjIENvcHlyaWdodCAoQykgMjAxMyBZdXN1a2UgU3V6dWtpIDx1dGF0YW5lLnRlYUBnbWFpbC5jb20+XG4jXG4jIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dFxuIyBtb2RpZmljYXRpb24sIGFyZSBwZXJtaXR0ZWQgcHJvdmlkZWQgdGhhdCB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnMgYXJlIG1ldDpcbiNcbiMgICAqIFJlZGlzdHJpYnV0aW9ucyBvZiBzb3VyY2UgY29kZSBtdXN0IHJldGFpbiB0aGUgYWJvdmUgY29weXJpZ2h0XG4jICAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIuXG4jICAgKiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodFxuIyAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyIGluIHRoZVxuIyAgICAgZG9jdW1lbnRhdGlvbiBhbmQvb3Igb3RoZXIgbWF0ZXJpYWxzIHByb3ZpZGVkIHdpdGggdGhlIGRpc3RyaWJ1dGlvbi5cbiNcbiMgVEhJUyBTT0ZUV0FSRSBJUyBQUk9WSURFRCBCWSBUSEUgQ09QWVJJR0hUIEhPTERFUlMgQU5EIENPTlRSSUJVVE9SUyBcIkFTIElTXCJcbiMgQU5EIEFOWSBFWFBSRVNTIE9SIElNUExJRUQgV0FSUkFOVElFUywgSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFRIRVxuIyBJTVBMSUVEIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZIEFORCBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRVxuIyBBUkUgRElTQ0xBSU1FRC4gSU4gTk8gRVZFTlQgU0hBTEwgPENPUFlSSUdIVCBIT0xERVI+IEJFIExJQUJMRSBGT1IgQU5ZXG4jIERJUkVDVCwgSU5ESVJFQ1QsIElOQ0lERU5UQUwsIFNQRUNJQUwsIEVYRU1QTEFSWSwgT1IgQ09OU0VRVUVOVElBTCBEQU1BR0VTXG4jIChJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgUFJPQ1VSRU1FTlQgT0YgU1VCU1RJVFVURSBHT09EUyBPUiBTRVJWSUNFUztcbiMgTE9TUyBPRiBVU0UsIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EXG4jIE9OIEFOWSBUSEVPUlkgT0YgTElBQklMSVRZLCBXSEVUSEVSIElOIENPTlRSQUNULCBTVFJJQ1QgTElBQklMSVRZLCBPUiBUT1JUXG4jIChJTkNMVURJTkcgTkVHTElHRU5DRSBPUiBPVEhFUldJU0UpIEFSSVNJTkcgSU4gQU5ZIFdBWSBPVVQgT0YgVEhFIFVTRSBPRlxuIyBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLlxuXG4ndXNlIHN0cmljdCdcblxuZXhwZWN0ID0gcmVxdWlyZSgnY2hhaScpLmV4cGVjdFxuZXNjb3BlID0gcmVxdWlyZSAnLi4nXG5lc3ByaW1hID0gcmVxdWlyZSAnZXNwcmltYSdcblxuZGVzY3JpYmUgJ2ltcGxpY2l0IGdsb2JhbCByZWZlcmVuY2UnLCAtPlxuICAgIGl0ICdhc3NpZ25tZW50cyBnbG9iYWwgc2NvcGUnLCAtPlxuICAgICAgICBhc3QgPSBlc3ByaW1hLnBhcnNlIFwiXCJcIlxuICAgICAgICB2YXIgeCA9IDIwO1xuICAgICAgICB4ID0gMzAwO1xuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZXMgPSBlc2NvcGUuYW5hbHl6ZShhc3QpLnNjb3Blc1xuXG4gICAgICAgIGV4cGVjdChzY29wZXMubWFwKChzY29wZSkgLT5cbiAgICAgICAgICAgIHNjb3BlLnZhcmlhYmxlcy5tYXAoKHZhcmlhYmxlKSAtPlxuICAgICAgICAgICAgICAgIHZhcmlhYmxlLmRlZnMubWFwKChkZWYpIC0+IGRlZi50eXBlKSkpKS50by5iZS5lcWwoXG4gICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnVmFyaWFibGUnXG4gICAgICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgICAgICBdXG4gICAgICAgICAgICBdXG4gICAgICAgIClcblxuICAgICAgICBleHBlY3Qoc2NvcGVzWzBdLmltcGxpY2l0LnZhcmlhYmxlcy5tYXAoKHZhcmlhYmxlKSAtPiB2YXJpYWJsZS5uYW1lKSkudG8uYmUuZXFsKFtdKVxuXG4gICAgaXQgJ2Fzc2lnbm1lbnRzIGdsb2JhbCBzY29wZSB3aXRob3V0IGRlZmluaXRpb24nLCAtPlxuICAgICAgICBhc3QgPSBlc3ByaW1hLnBhcnNlIFwiXCJcIlxuICAgICAgICB4ID0gMzAwO1xuICAgICAgICB4ID0gMzAwO1xuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZXMgPSBlc2NvcGUuYW5hbHl6ZShhc3QpLnNjb3Blc1xuXG4gICAgICAgIGV4cGVjdChzY29wZXMubWFwKChzY29wZSkgLT5cbiAgICAgICAgICAgIHNjb3BlLnZhcmlhYmxlcy5tYXAoKHZhcmlhYmxlKSAtPlxuICAgICAgICAgICAgICAgIHZhcmlhYmxlLmRlZnMubWFwKChkZWYpIC0+IGRlZi50eXBlKSkpKS50by5iZS5lcWwoXG4gICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgIF1cbiAgICAgICAgKVxuXG4gICAgICAgIGV4cGVjdChzY29wZXNbMF0uaW1wbGljaXQudmFyaWFibGVzLm1hcCgodmFyaWFibGUpIC0+IHZhcmlhYmxlLm5hbWUpKS50by5iZS5lcWwoXG4gICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgJ3gnXG4gICAgICAgICAgICBdXG4gICAgICAgIClcblxuICAgIGl0ICdhc3NpZ25tZW50cyBnbG9iYWwgc2NvcGUgd2l0aG91dCBkZWZpbml0aW9uIGV2YWwnLCAtPlxuICAgICAgICBhc3QgPSBlc3ByaW1hLnBhcnNlIFwiXCJcIlxuICAgICAgICBmdW5jdGlvbiBpbm5lcigpIHtcbiAgICAgICAgICAgIGV2YWwoc3RyKTtcbiAgICAgICAgICAgIHggPSAzMDA7XG4gICAgICAgIH1cbiAgICAgICAgXCJcIlwiXG5cbiAgICAgICAgc2NvcGVzID0gZXNjb3BlLmFuYWx5emUoYXN0KS5zY29wZXNcblxuICAgICAgICBleHBlY3Qoc2NvcGVzLm1hcCgoc2NvcGUpIC0+XG4gICAgICAgICAgICBzY29wZS52YXJpYWJsZXMubWFwKCh2YXJpYWJsZSkgLT5cbiAgICAgICAgICAgICAgICB2YXJpYWJsZS5kZWZzLm1hcCgoZGVmKSAtPiBkZWYudHlwZSkpKSkudG8uYmUuZXFsKFxuICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0Z1bmN0aW9uTmFtZSdcbiAgICAgICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgIF1cbiAgICAgICAgKVxuXG4gICAgICAgIGV4cGVjdChzY29wZXNbMF0uaW1wbGljaXQudmFyaWFibGVzLm1hcCgodmFyaWFibGUpIC0+IHZhcmlhYmxlLm5hbWUpKS50by5iZS5lcWwoW10pXG5cbiAgICBpdCAnYXNzaWdubWVudCBsZWFrcycsIC0+XG4gICAgICAgIGFzdCA9IGVzcHJpbWEucGFyc2UgXCJcIlwiXG4gICAgICAgIGZ1bmN0aW9uIG91dGVyKCkge1xuICAgICAgICAgICAgeCA9IDIwO1xuICAgICAgICB9XG4gICAgICAgIFwiXCJcIlxuXG4gICAgICAgIHNjb3BlcyA9IGVzY29wZS5hbmFseXplKGFzdCkuc2NvcGVzXG5cbiAgICAgICAgZXhwZWN0KHNjb3Blcy5tYXAoKHNjb3BlKSAtPlxuICAgICAgICAgICAgc2NvcGUudmFyaWFibGVzLm1hcCgodmFyaWFibGUpIC0+IHZhcmlhYmxlLm5hbWUpKSkudG8uYmUuZXFsKFxuICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAgICAgJ291dGVyJ1xuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgICAgICdhcmd1bWVudHMnXG4gICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgXVxuICAgICAgICApXG5cbiAgICAgICAgZXhwZWN0KHNjb3Blc1swXS5pbXBsaWNpdC52YXJpYWJsZXMubWFwKCh2YXJpYWJsZSkgLT4gdmFyaWFibGUubmFtZSkpLnRvLmJlLmVxbChcbiAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAneCdcbiAgICAgICAgICAgIF1cbiAgICAgICAgKVxuXG4gICAgaXQgJ2Fzc2lnbm1lbnQgZG9lc25cXCd0IGxlYWsnLCAtPlxuICAgICAgICBhc3QgPSBlc3ByaW1hLnBhcnNlIFwiXCJcIlxuICAgICAgICBmdW5jdGlvbiBvdXRlcigpIHtcbiAgICAgICAgICAgIGZ1bmN0aW9uIGlubmVyKCkge1xuICAgICAgICAgICAgICAgIHggPSAyMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciB4O1xuICAgICAgICB9XG4gICAgICAgIFwiXCJcIlxuXG4gICAgICAgIHNjb3BlcyA9IGVzY29wZS5hbmFseXplKGFzdCkuc2NvcGVzXG5cbiAgICAgICAgZXhwZWN0KHNjb3Blcy5tYXAoKHNjb3BlKSAtPlxuICAgICAgICAgICAgc2NvcGUudmFyaWFibGVzLm1hcCgodmFyaWFibGUpIC0+IHZhcmlhYmxlLm5hbWUpKSkudG8uYmUuZXFsKFxuICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAgICAgJ291dGVyJ1xuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgICAgICdhcmd1bWVudHMnXG4gICAgICAgICAgICAgICAgICAgICdpbm5lcidcbiAgICAgICAgICAgICAgICAgICAgJ3gnXG4gICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAgICAgJ2FyZ3VtZW50cydcbiAgICAgICAgICAgICAgICBdXG4gICAgICAgICAgICBdXG4gICAgICAgIClcblxuICAgICAgICBleHBlY3Qoc2NvcGVzWzBdLmltcGxpY2l0LnZhcmlhYmxlcy5tYXAoKHZhcmlhYmxlKSAtPiB2YXJpYWJsZS5uYW1lKSkudG8uYmUuZXFsKFtdKVxuXG5cbiAgICBpdCAnZm9yLWluLXN0YXRlbWVudCBsZWFrcycsIC0+XG4gICAgICAgIGFzdCA9IGVzcHJpbWEucGFyc2UgXCJcIlwiXG4gICAgICAgIGZ1bmN0aW9uIG91dGVyKCkge1xuICAgICAgICAgICAgZm9yICh4IGluIHkpIHsgfVxuICAgICAgICB9XG4gICAgICAgIFwiXCJcIlxuXG4gICAgICAgIHNjb3BlcyA9IGVzY29wZS5hbmFseXplKGFzdCkuc2NvcGVzXG5cbiAgICAgICAgZXhwZWN0KHNjb3Blcy5tYXAoKHNjb3BlKSAtPlxuICAgICAgICAgICAgc2NvcGUudmFyaWFibGVzLm1hcCgodmFyaWFibGUpIC0+IHZhcmlhYmxlLm5hbWUpKSkudG8uYmUuZXFsKFxuICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAgICAgJ291dGVyJ1xuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgICAgICdhcmd1bWVudHMnXG4gICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgXVxuICAgICAgICApXG5cbiAgICAgICAgZXhwZWN0KHNjb3Blc1swXS5pbXBsaWNpdC52YXJpYWJsZXMubWFwKCh2YXJpYWJsZSkgLT4gdmFyaWFibGUubmFtZSkpLnRvLmJlLmVxbChcbiAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAneCdcbiAgICAgICAgICAgIF1cbiAgICAgICAgKVxuXG4gICAgaXQgJ2Zvci1pbi1zdGF0ZW1lbnQgZG9lc25cXCd0IGxlYWtzJywgLT5cbiAgICAgICAgYXN0ID0gZXNwcmltYS5wYXJzZSBcIlwiXCJcbiAgICAgICAgZnVuY3Rpb24gb3V0ZXIoKSB7XG4gICAgICAgICAgICBmdW5jdGlvbiBpbm5lcigpIHtcbiAgICAgICAgICAgICAgICBmb3IgKHggaW4geSkgeyB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgeDtcbiAgICAgICAgfVxuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZXMgPSBlc2NvcGUuYW5hbHl6ZShhc3QpLnNjb3Blc1xuXG4gICAgICAgIGV4cGVjdChzY29wZXMubWFwKChzY29wZSkgLT5cbiAgICAgICAgICAgIHNjb3BlLnZhcmlhYmxlcy5tYXAoKHZhcmlhYmxlKSAtPiB2YXJpYWJsZS5uYW1lKSkpLnRvLmJlLmVxbChcbiAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgICAgICdvdXRlcidcbiAgICAgICAgICAgICAgICBdXG4gICAgICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgICAgICAnYXJndW1lbnRzJ1xuICAgICAgICAgICAgICAgICAgICAnaW5uZXInXG4gICAgICAgICAgICAgICAgICAgICd4J1xuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgICAgICdhcmd1bWVudHMnXG4gICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgXVxuICAgICAgICApXG5cbiAgICAgICAgZXhwZWN0KHNjb3Blc1swXS5pbXBsaWNpdC52YXJpYWJsZXMubWFwKCh2YXJpYWJsZSkgLT4gdmFyaWFibGUubmFtZSkpLnRvLmJlLmVxbChbXSlcbiJdfQ==
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/powered-test/label-children.js b/tools/eslint/node_modules/escope/powered-test/label-children.js
      new file mode 100644
      index 00000000000000..710732f8071a8c
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/powered-test/label-children.js
      @@ -0,0 +1,34 @@
      +(function() {
      +  var escope, esprima, expect, harmony;
      +
      +  expect = require('chai').expect;
      +
      +  esprima = require('esprima');
      +
      +  harmony = require('../third_party/esprima');
      +
      +  escope = require('..');
      +
      +  describe('label', function() {
      +    return it('should not create variables', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = esprima.parse("function bar() { q: for(;;) { break q; } }");
      +      scopeManager = escope.analyze(ast);
      +      expect(scopeManager.scopes).to.have.length(2);
      +      globalScope = scopeManager.scopes[0];
      +      expect(globalScope.type).to.be.equal('global');
      +      expect(globalScope.variables).to.have.length(1);
      +      expect(globalScope.variables[0].name).to.be.equal('bar');
      +      expect(globalScope.references).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      expect(scope.isArgumentsMaterialized()).to.be["false"];
      +      return expect(scope.references).to.have.length(0);
      +    });
      +  });
      +
      +}).call(this);
      +
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxhYmVsLWNoaWxkcmVuLmNvZmZlZSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF1QkE7QUFBQSxNQUFBLGdDQUFBOztBQUFBLEVBQUEsTUFBQSxHQUFTLE9BQUEsQ0FBUyxNQUFULENBQWUsQ0FBQyxNQUF6QixDQUFBOztBQUFBLEVBQ0EsT0FBQSxHQUFVLE9BQUEsQ0FBUyxTQUFULENBRFYsQ0FBQTs7QUFBQSxFQUVBLE9BQUEsR0FBVSxPQUFBLENBQVMsd0JBQVQsQ0FGVixDQUFBOztBQUFBLEVBR0EsTUFBQSxHQUFTLE9BQUEsQ0FBUyxJQUFULENBSFQsQ0FBQTs7QUFBQSxFQUtBLFFBQUEsQ0FBVSxPQUFWLEVBQWtCLFNBQUEsR0FBQTtXQUNkLEVBQUEsQ0FBSSw2QkFBSixFQUFrQyxTQUFBLEdBQUE7QUFDOUIsVUFBQSxxQ0FBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLDRDQUFqQixDQUFOLENBQUE7QUFBQSxNQUlBLFlBQUEsR0FBZSxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsQ0FKZixDQUFBO0FBQUEsTUFLQSxNQUFBLENBQU8sWUFBWSxDQUFDLE1BQXBCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQUxBLENBQUE7QUFBQSxNQU1BLFdBQUEsR0FBYyxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FObEMsQ0FBQTtBQUFBLE1BT0EsTUFBQSxDQUFPLFdBQVcsQ0FBQyxJQUFuQixDQUF3QixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBL0IsQ0FBc0MsUUFBdEMsQ0FQQSxDQUFBO0FBQUEsTUFRQSxNQUFBLENBQU8sV0FBVyxDQUFDLFNBQW5CLENBQTZCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUF0QyxDQUE2QyxDQUE3QyxDQVJBLENBQUE7QUFBQSxNQVNBLE1BQUEsQ0FBTyxXQUFXLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQWhDLENBQXFDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUE1QyxDQUFtRCxLQUFuRCxDQVRBLENBQUE7QUFBQSxNQVVBLE1BQUEsQ0FBTyxXQUFXLENBQUMsVUFBbkIsQ0FBOEIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXZDLENBQThDLENBQTlDLENBVkEsQ0FBQTtBQUFBLE1BWUEsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQVo1QixDQUFBO0FBQUEsTUFhQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFVBQWhDLENBYkEsQ0FBQTtBQUFBLE1BY0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFiLENBQXVCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFoQyxDQUF1QyxDQUF2QyxDQWRBLENBQUE7QUFBQSxNQWVBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxXQUE3QyxDQWZBLENBQUE7QUFBQSxNQWdCQSxNQUFBLENBQU8sS0FBSyxDQUFDLHVCQUFOLENBQUEsQ0FBUCxDQUF1QyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsT0FBRCxDQWhCN0MsQ0FBQTthQWlCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLEVBbEI4QjtJQUFBLENBQWxDLEVBRGM7RUFBQSxDQUFsQixDQUxBLENBQUE7QUFBQSIsImZpbGUiOiJsYWJlbC1jaGlsZHJlbi5qcyIsInNvdXJjZVJvb3QiOiIvc291cmNlLyIsInNvdXJjZXNDb250ZW50IjpbIiMgLSotIGNvZGluZzogdXRmLTggLSotXG4jICBDb3B5cmlnaHQgKEMpIDIwMTUgWXVzdWtlIFN1enVraSA8dXRhdGFuZS50ZWFAZ21haWwuY29tPlxuI1xuIyAgUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0XG4jICBtb2RpZmljYXRpb24sIGFyZSBwZXJtaXR0ZWQgcHJvdmlkZWQgdGhhdCB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnMgYXJlIG1ldDpcbiNcbiMgICAgKiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodFxuIyAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lci5cbiMgICAgKiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodFxuIyAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lciBpbiB0aGVcbiMgICAgICBkb2N1bWVudGF0aW9uIGFuZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQgd2l0aCB0aGUgZGlzdHJpYnV0aW9uLlxuI1xuIyAgVEhJUyBTT0ZUV0FSRSBJUyBQUk9WSURFRCBCWSBUSEUgQ09QWVJJR0hUIEhPTERFUlMgQU5EIENPTlRSSUJVVE9SUyBcIkFTIElTXCJcbiMgIEFORCBBTlkgRVhQUkVTUyBPUiBJTVBMSUVEIFdBUlJBTlRJRVMsIElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBUSEVcbiMgIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFXG4jICBBUkUgRElTQ0xBSU1FRC4gSU4gTk8gRVZFTlQgU0hBTEwgPENPUFlSSUdIVCBIT0xERVI+IEJFIExJQUJMRSBGT1IgQU5ZXG4jICBESVJFQ1QsIElORElSRUNULCBJTkNJREVOVEFMLCBTUEVDSUFMLCBFWEVNUExBUlksIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFU1xuIyAgKElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTO1xuIyAgTE9TUyBPRiBVU0UsIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EXG4jICBPTiBBTlkgVEhFT1JZIE9GIExJQUJJTElUWSwgV0hFVEhFUiBJTiBDT05UUkFDVCwgU1RSSUNUIExJQUJJTElUWSwgT1IgVE9SVFxuIyAgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFIE9GXG4jICBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLlxuXG5leHBlY3QgPSByZXF1aXJlKCdjaGFpJykuZXhwZWN0XG5lc3ByaW1hID0gcmVxdWlyZSAnZXNwcmltYSdcbmhhcm1vbnkgPSByZXF1aXJlICcuLi90aGlyZF9wYXJ0eS9lc3ByaW1hJ1xuZXNjb3BlID0gcmVxdWlyZSAnLi4nXG5cbmRlc2NyaWJlICdsYWJlbCcsIC0+XG4gICAgaXQgJ3Nob3VsZCBub3QgY3JlYXRlIHZhcmlhYmxlcycsIC0+XG4gICAgICAgIGFzdCA9IGVzcHJpbWEucGFyc2UgXCJcIlwiXG4gICAgICAgIGZ1bmN0aW9uIGJhcigpIHsgcTogZm9yKDs7KSB7IGJyZWFrIHE7IH0gfVxuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3RcbiAgICAgICAgZXhwZWN0KHNjb3BlTWFuYWdlci5zY29wZXMpLnRvLmhhdmUubGVuZ3RoIDJcbiAgICAgICAgZ2xvYmFsU2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzBdXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS50eXBlKS50by5iZS5lcXVhbCAnZ2xvYmFsJ1xuICAgICAgICBleHBlY3QoZ2xvYmFsU2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAxXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwgJ2JhcidcbiAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdmdW5jdGlvbidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICdhcmd1bWVudHMnXG4gICAgICAgIGV4cGVjdChzY29wZS5pc0FyZ3VtZW50c01hdGVyaWFsaXplZCgpKS50by5iZS5mYWxzZVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggMFxuXG4jIHZpbTogc2V0IHN3PTQgdHM9NCBldCB0dz04MCA6XG4iXX0=
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/powered-test/label.js b/tools/eslint/node_modules/escope/powered-test/label.js
      new file mode 100644
      index 00000000000000..a54dcd9d340a8f
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/powered-test/label.js
      @@ -0,0 +1,47 @@
      +(function() {
      +  var escope, esprima, expect, harmony;
      +
      +  expect = require('chai').expect;
      +
      +  esprima = require('esprima');
      +
      +  harmony = require('../third_party/esprima');
      +
      +  escope = require('..');
      +
      +  describe('label', function() {
      +    it('should not create variables', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = esprima.parse("function bar() { q: for(;;) { break q; } }");
      +      scopeManager = escope.analyze(ast);
      +      expect(scopeManager.scopes).to.have.length(2);
      +      globalScope = scopeManager.scopes[0];
      +      expect(globalScope.type).to.be.equal('global');
      +      expect(globalScope.variables).to.have.length(1);
      +      expect(globalScope.variables[0].name).to.be.equal('bar');
      +      expect(globalScope.references).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      expect(scope.isArgumentsMaterialized()).to.be["false"];
      +      return expect(scope.references).to.have.length(0);
      +    });
      +    return it('should count child node references', function() {
      +      var ast, globalScope, scopeManager;
      +      ast = esprima.parse("var foo = 5;\n\nlabel: while (true) {\n  console.log(foo);\n  break;\n}");
      +      scopeManager = escope.analyze(ast);
      +      expect(scopeManager.scopes).to.have.length(1);
      +      globalScope = scopeManager.scopes[0];
      +      expect(globalScope.type).to.be.equal('global');
      +      expect(globalScope.variables).to.have.length(1);
      +      expect(globalScope.variables[0].name).to.be.equal('foo');
      +      expect(globalScope.through.length).to.be.equal(3);
      +      expect(globalScope.through[2].identifier.name).to.be.equal('foo');
      +      return expect(globalScope.through[2].isRead()).to.be["true"];
      +    });
      +  });
      +
      +}).call(this);
      +
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxhYmVsLmNvZmZlZSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF1QkE7QUFBQSxNQUFBLGdDQUFBOztBQUFBLEVBQUEsTUFBQSxHQUFTLE9BQUEsQ0FBUyxNQUFULENBQWUsQ0FBQyxNQUF6QixDQUFBOztBQUFBLEVBQ0EsT0FBQSxHQUFVLE9BQUEsQ0FBUyxTQUFULENBRFYsQ0FBQTs7QUFBQSxFQUVBLE9BQUEsR0FBVSxPQUFBLENBQVMsd0JBQVQsQ0FGVixDQUFBOztBQUFBLEVBR0EsTUFBQSxHQUFTLE9BQUEsQ0FBUyxJQUFULENBSFQsQ0FBQTs7QUFBQSxFQUtBLFFBQUEsQ0FBVSxPQUFWLEVBQWtCLFNBQUEsR0FBQTtBQUNkLElBQUEsRUFBQSxDQUFJLDZCQUFKLEVBQWtDLFNBQUEsR0FBQTtBQUM5QixVQUFBLHFDQUFBO0FBQUEsTUFBQSxHQUFBLEdBQU0sT0FBTyxDQUFDLEtBQVIsQ0FBaUIsNENBQWpCLENBQU4sQ0FBQTtBQUFBLE1BSUEsWUFBQSxHQUFlLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixDQUpmLENBQUE7QUFBQSxNQUtBLE1BQUEsQ0FBTyxZQUFZLENBQUMsTUFBcEIsQ0FBMkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXBDLENBQTJDLENBQTNDLENBTEEsQ0FBQTtBQUFBLE1BTUEsV0FBQSxHQUFjLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQU5sQyxDQUFBO0FBQUEsTUFPQSxNQUFBLENBQU8sV0FBVyxDQUFDLElBQW5CLENBQXdCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEvQixDQUFzQyxRQUF0QyxDQVBBLENBQUE7QUFBQSxNQVFBLE1BQUEsQ0FBTyxXQUFXLENBQUMsU0FBbkIsQ0FBNkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXRDLENBQTZDLENBQTdDLENBUkEsQ0FBQTtBQUFBLE1BU0EsTUFBQSxDQUFPLFdBQVcsQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBaEMsQ0FBcUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQTVDLENBQW1ELEtBQW5ELENBVEEsQ0FBQTtBQUFBLE1BVUEsTUFBQSxDQUFPLFdBQVcsQ0FBQyxVQUFuQixDQUE4QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBdkMsQ0FBOEMsQ0FBOUMsQ0FWQSxDQUFBO0FBQUEsTUFZQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBWjVCLENBQUE7QUFBQSxNQWFBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsVUFBaEMsQ0FiQSxDQUFBO0FBQUEsTUFjQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBZEEsQ0FBQTtBQUFBLE1BZUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBMUIsQ0FBK0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXRDLENBQTZDLFdBQTdDLENBZkEsQ0FBQTtBQUFBLE1BZ0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsdUJBQU4sQ0FBQSxDQUFQLENBQXVDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxPQUFELENBaEI3QyxDQUFBO2FBaUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsRUFsQjhCO0lBQUEsQ0FBbEMsQ0FBQSxDQUFBO1dBb0JBLEVBQUEsQ0FBSSxvQ0FBSixFQUF5QyxTQUFBLEdBQUE7QUFDakMsVUFBQSw4QkFBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLHlFQUFqQixDQUFOLENBQUE7QUFBQSxNQVNBLFlBQUEsR0FBZSxNQUFNLENBQUMsT0FBUCxDQUFlLEdBQWYsQ0FUZixDQUFBO0FBQUEsTUFVQSxNQUFBLENBQU8sWUFBWSxDQUFDLE1BQXBCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQVZBLENBQUE7QUFBQSxNQVdBLFdBQUEsR0FBYyxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FYbEMsQ0FBQTtBQUFBLE1BWUEsTUFBQSxDQUFPLFdBQVcsQ0FBQyxJQUFuQixDQUF3QixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBL0IsQ0FBc0MsUUFBdEMsQ0FaQSxDQUFBO0FBQUEsTUFhQSxNQUFBLENBQU8sV0FBVyxDQUFDLFNBQW5CLENBQTZCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUF0QyxDQUE2QyxDQUE3QyxDQWJBLENBQUE7QUFBQSxNQWNBLE1BQUEsQ0FBTyxXQUFXLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQWhDLENBQXFDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUE1QyxDQUFtRCxLQUFuRCxDQWRBLENBQUE7QUFBQSxNQWVBLE1BQUEsQ0FBTyxXQUFXLENBQUMsT0FBTyxDQUFDLE1BQTNCLENBQWtDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QyxDQUErQyxDQUEvQyxDQWZBLENBQUE7QUFBQSxNQWdCQSxNQUFBLENBQU8sV0FBVyxDQUFDLE9BQVEsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBekMsQ0FBOEMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXJELENBQTRELEtBQTVELENBaEJBLENBQUE7YUFpQkEsTUFBQSxDQUFPLFdBQVcsQ0FBQyxPQUFRLENBQUEsQ0FBQSxDQUFFLENBQUMsTUFBdkIsQ0FBQSxDQUFQLENBQXVDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxNQUFELEVBbEJaO0lBQUEsQ0FBekMsRUFyQmM7RUFBQSxDQUFsQixDQUxBLENBQUE7QUFBQSIsImZpbGUiOiJsYWJlbC5qcyIsInNvdXJjZVJvb3QiOiIvc291cmNlLyIsInNvdXJjZXNDb250ZW50IjpbIiMgLSotIGNvZGluZzogdXRmLTggLSotXG4jICBDb3B5cmlnaHQgKEMpIDIwMTUgWXVzdWtlIFN1enVraSA8dXRhdGFuZS50ZWFAZ21haWwuY29tPlxuI1xuIyAgUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0XG4jICBtb2RpZmljYXRpb24sIGFyZSBwZXJtaXR0ZWQgcHJvdmlkZWQgdGhhdCB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnMgYXJlIG1ldDpcbiNcbiMgICAgKiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodFxuIyAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lci5cbiMgICAgKiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodFxuIyAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lciBpbiB0aGVcbiMgICAgICBkb2N1bWVudGF0aW9uIGFuZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQgd2l0aCB0aGUgZGlzdHJpYnV0aW9uLlxuI1xuIyAgVEhJUyBTT0ZUV0FSRSBJUyBQUk9WSURFRCBCWSBUSEUgQ09QWVJJR0hUIEhPTERFUlMgQU5EIENPTlRSSUJVVE9SUyBcIkFTIElTXCJcbiMgIEFORCBBTlkgRVhQUkVTUyBPUiBJTVBMSUVEIFdBUlJBTlRJRVMsIElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBUSEVcbiMgIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFXG4jICBBUkUgRElTQ0xBSU1FRC4gSU4gTk8gRVZFTlQgU0hBTEwgPENPUFlSSUdIVCBIT0xERVI+IEJFIExJQUJMRSBGT1IgQU5ZXG4jICBESVJFQ1QsIElORElSRUNULCBJTkNJREVOVEFMLCBTUEVDSUFMLCBFWEVNUExBUlksIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFU1xuIyAgKElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTO1xuIyAgTE9TUyBPRiBVU0UsIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EXG4jICBPTiBBTlkgVEhFT1JZIE9GIExJQUJJTElUWSwgV0hFVEhFUiBJTiBDT05UUkFDVCwgU1RSSUNUIExJQUJJTElUWSwgT1IgVE9SVFxuIyAgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFIE9GXG4jICBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLlxuXG5leHBlY3QgPSByZXF1aXJlKCdjaGFpJykuZXhwZWN0XG5lc3ByaW1hID0gcmVxdWlyZSAnZXNwcmltYSdcbmhhcm1vbnkgPSByZXF1aXJlICcuLi90aGlyZF9wYXJ0eS9lc3ByaW1hJ1xuZXNjb3BlID0gcmVxdWlyZSAnLi4nXG5cbmRlc2NyaWJlICdsYWJlbCcsIC0+XG4gICAgaXQgJ3Nob3VsZCBub3QgY3JlYXRlIHZhcmlhYmxlcycsIC0+XG4gICAgICAgIGFzdCA9IGVzcHJpbWEucGFyc2UgXCJcIlwiXG4gICAgICAgIGZ1bmN0aW9uIGJhcigpIHsgcTogZm9yKDs7KSB7IGJyZWFrIHE7IH0gfVxuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3RcbiAgICAgICAgZXhwZWN0KHNjb3BlTWFuYWdlci5zY29wZXMpLnRvLmhhdmUubGVuZ3RoIDJcbiAgICAgICAgZ2xvYmFsU2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzBdXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS50eXBlKS50by5iZS5lcXVhbCAnZ2xvYmFsJ1xuICAgICAgICBleHBlY3QoZ2xvYmFsU2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAxXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwgJ2JhcidcbiAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdmdW5jdGlvbidcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICdhcmd1bWVudHMnXG4gICAgICAgIGV4cGVjdChzY29wZS5pc0FyZ3VtZW50c01hdGVyaWFsaXplZCgpKS50by5iZS5mYWxzZVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlcykudG8uaGF2ZS5sZW5ndGggMFxuXG4gICAgaXQgJ3Nob3VsZCBjb3VudCBjaGlsZCBub2RlIHJlZmVyZW5jZXMnLCAtPlxuICAgICAgICAgICAgYXN0ID0gZXNwcmltYS5wYXJzZSBcIlwiXCJcbiAgICAgICAgICAgIHZhciBmb28gPSA1O1xuXG4gICAgICAgICAgICBsYWJlbDogd2hpbGUgKHRydWUpIHtcbiAgICAgICAgICAgICAgY29uc29sZS5sb2coZm9vKTtcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBcIlwiXCJcblxuICAgICAgICAgICAgc2NvcGVNYW5hZ2VyID0gZXNjb3BlLmFuYWx5emUgYXN0XG4gICAgICAgICAgICBleHBlY3Qoc2NvcGVNYW5hZ2VyLnNjb3BlcykudG8uaGF2ZS5sZW5ndGggMVxuICAgICAgICAgICAgZ2xvYmFsU2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzBdXG4gICAgICAgICAgICBleHBlY3QoZ2xvYmFsU2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2dsb2JhbCdcbiAgICAgICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwgJ2ZvbydcbiAgICAgICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS50aHJvdWdoLmxlbmd0aCkudG8uYmUuZXF1YWwgM1xuICAgICAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnRocm91Z2hbMl0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCAnZm9vJ1xuICAgICAgICAgICAgZXhwZWN0KGdsb2JhbFNjb3BlLnRocm91Z2hbMl0uaXNSZWFkKCkpLnRvLmJlLnRydWVcblxuIyB2aW06IHNldCBzdz00IHRzPTQgZXQgdHc9ODAgOlxuIl19
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/powered-test/nodejs-scope.js b/tools/eslint/node_modules/escope/powered-test/nodejs-scope.js
      new file mode 100644
      index 00000000000000..24fd61c2c6ba7d
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/powered-test/nodejs-scope.js
      @@ -0,0 +1,65 @@
      +(function() {
      +  var escope, expect, harmony;
      +
      +  expect = require('chai').expect;
      +
      +  harmony = require('../third_party/esprima');
      +
      +  escope = require('..');
      +
      +  describe('nodejsScope option', function() {
      +    it('creates a function scope following the global scope immediately', function() {
      +      var ast, scope, scopeManager;
      +      ast = harmony.parse("'use strict';\nvar hello = 20;");
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6,
      +        nodejsScope: true
      +      });
      +      expect(scopeManager.scopes).to.have.length(2);
      +      scope = scopeManager.scopes[0];
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.block.type).to.be.equal('Program');
      +      expect(scope.isStrict).to.be["false"];
      +      expect(scope.variables).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.block.type).to.be.equal('Program');
      +      expect(scope.isStrict).to.be["true"];
      +      expect(scope.variables).to.have.length(2);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      return expect(scope.variables[1].name).to.be.equal('hello');
      +    });
      +    return it('creates a function scope following the global scope immediately and creates module scope', function() {
      +      var ast, scope, scopeManager;
      +      ast = harmony.parse("import {x as v} from \"mod\";", {
      +        sourceType: 'module'
      +      });
      +      scopeManager = escope.analyze(ast, {
      +        ecmaVersion: 6,
      +        nodejsScope: true,
      +        sourceType: 'module'
      +      });
      +      expect(scopeManager.scopes).to.have.length(3);
      +      scope = scopeManager.scopes[0];
      +      expect(scope.type).to.be.equal('global');
      +      expect(scope.block.type).to.be.equal('Program');
      +      expect(scope.isStrict).to.be["false"];
      +      expect(scope.variables).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.block.type).to.be.equal('Program');
      +      expect(scope.isStrict).to.be["false"];
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      scope = scopeManager.scopes[2];
      +      expect(scope.type).to.be.equal('module');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('v');
      +      expect(scope.variables[0].defs[0].type).to.be.equal('ImportBinding');
      +      return expect(scope.references).to.have.length(0);
      +    });
      +  });
      +
      +}).call(this);
      +
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVqcy1zY29wZS5jb2ZmZWUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBdUJBO0FBQUEsTUFBQSx1QkFBQTs7QUFBQSxFQUFBLE1BQUEsR0FBUyxPQUFBLENBQVMsTUFBVCxDQUFlLENBQUMsTUFBekIsQ0FBQTs7QUFBQSxFQUNBLE9BQUEsR0FBVSxPQUFBLENBQVMsd0JBQVQsQ0FEVixDQUFBOztBQUFBLEVBRUEsTUFBQSxHQUFTLE9BQUEsQ0FBUyxJQUFULENBRlQsQ0FBQTs7QUFBQSxFQUlBLFFBQUEsQ0FBVSxvQkFBVixFQUErQixTQUFBLEdBQUE7QUFDM0IsSUFBQSxFQUFBLENBQUksaUVBQUosRUFBc0UsU0FBQSxHQUFBO0FBQ2xFLFVBQUEsd0JBQUE7QUFBQSxNQUFBLEdBQUEsR0FBTSxPQUFPLENBQUMsS0FBUixDQUFpQixnQ0FBakIsQ0FBTixDQUFBO0FBQUEsTUFLQSxZQUFBLEdBQWUsTUFBTSxDQUFDLE9BQVAsQ0FBZSxHQUFmLEVBQW9CO0FBQUEsUUFBQSxXQUFBLEVBQWEsQ0FBYjtBQUFBLFFBQWdCLFdBQUEsRUFBYSxJQUE3QjtPQUFwQixDQUxmLENBQUE7QUFBQSxNQU1BLE1BQUEsQ0FBTyxZQUFZLENBQUMsTUFBcEIsQ0FBMkIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQXBDLENBQTJDLENBQTNDLENBTkEsQ0FBQTtBQUFBLE1BUUEsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQVI1QixDQUFBO0FBQUEsTUFTQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFFBQWhDLENBVEEsQ0FBQTtBQUFBLE1BVUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxLQUFLLENBQUMsSUFBbkIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQS9CLENBQXNDLFNBQXRDLENBVkEsQ0FBQTtBQUFBLE1BV0EsTUFBQSxDQUFPLEtBQUssQ0FBQyxRQUFiLENBQXNCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxPQUFELENBWDVCLENBQUE7QUFBQSxNQVlBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0FaQSxDQUFBO0FBQUEsTUFjQSxLQUFBLEdBQVEsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBZDVCLENBQUE7QUFBQSxNQWVBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsVUFBaEMsQ0FmQSxDQUFBO0FBQUEsTUFnQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxLQUFLLENBQUMsSUFBbkIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQS9CLENBQXNDLFNBQXRDLENBaEJBLENBQUE7QUFBQSxNQWlCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFFBQWIsQ0FBc0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE1BQUQsQ0FqQjVCLENBQUE7QUFBQSxNQWtCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBbEJBLENBQUE7QUFBQSxNQW1CQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsV0FBN0MsQ0FuQkEsQ0FBQTthQW9CQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsT0FBN0MsRUFyQmtFO0lBQUEsQ0FBdEUsQ0FBQSxDQUFBO1dBdUJBLEVBQUEsQ0FBSSwwRkFBSixFQUErRixTQUFBLEdBQUE7QUFDM0YsVUFBQSx3QkFBQTtBQUFBLE1BQUEsR0FBQSxHQUFNLE9BQU8sQ0FBQyxLQUFSLENBQWlCLCtCQUFqQixFQUVEO0FBQUEsUUFBQSxVQUFBLEVBQWEsUUFBYjtPQUZDLENBQU4sQ0FBQTtBQUFBLE1BSUEsWUFBQSxHQUFlLE1BQU0sQ0FBQyxPQUFQLENBQWUsR0FBZixFQUFvQjtBQUFBLFFBQUEsV0FBQSxFQUFhLENBQWI7QUFBQSxRQUFnQixXQUFBLEVBQWEsSUFBN0I7QUFBQSxRQUFrQyxVQUFBLEVBQWEsUUFBL0M7T0FBcEIsQ0FKZixDQUFBO0FBQUEsTUFLQSxNQUFBLENBQU8sWUFBWSxDQUFDLE1BQXBCLENBQTJCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUFwQyxDQUEyQyxDQUEzQyxDQUxBLENBQUE7QUFBQSxNQU9BLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FQNUIsQ0FBQTtBQUFBLE1BUUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxJQUFiLENBQWtCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF6QixDQUFnQyxRQUFoQyxDQVJBLENBQUE7QUFBQSxNQVNBLE1BQUEsQ0FBTyxLQUFLLENBQUMsS0FBSyxDQUFDLElBQW5CLENBQXdCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUEvQixDQUFzQyxTQUF0QyxDQVRBLENBQUE7QUFBQSxNQVVBLE1BQUEsQ0FBTyxLQUFLLENBQUMsUUFBYixDQUFzQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsT0FBRCxDQVY1QixDQUFBO0FBQUEsTUFXQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBWEEsQ0FBQTtBQUFBLE1BYUEsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQWI1QixDQUFBO0FBQUEsTUFjQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLFVBQWhDLENBZEEsQ0FBQTtBQUFBLE1BZUEsTUFBQSxDQUFPLEtBQUssQ0FBQyxLQUFLLENBQUMsSUFBbkIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQS9CLENBQXNDLFNBQXRDLENBZkEsQ0FBQTtBQUFBLE1BZ0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsUUFBYixDQUFzQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsT0FBRCxDQWhCNUIsQ0FBQTtBQUFBLE1BaUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0FqQkEsQ0FBQTtBQUFBLE1Ba0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxXQUE3QyxDQWxCQSxDQUFBO0FBQUEsTUFvQkEsS0FBQSxHQUFRLFlBQVksQ0FBQyxNQUFPLENBQUEsQ0FBQSxDQXBCNUIsQ0FBQTtBQUFBLE1BcUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsUUFBaEMsQ0FyQkEsQ0FBQTtBQUFBLE1Bc0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0F0QkEsQ0FBQTtBQUFBLE1BdUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxHQUE3QyxDQXZCQSxDQUFBO0FBQUEsTUF3QkEsTUFBQSxDQUFPLEtBQUssQ0FBQyxTQUFVLENBQUEsQ0FBQSxDQUFFLENBQUMsSUFBSyxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQWxDLENBQXVDLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUE5QyxDQUFxRCxlQUFyRCxDQXhCQSxDQUFBO2FBeUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsRUExQjJGO0lBQUEsQ0FBL0YsRUF4QjJCO0VBQUEsQ0FBL0IsQ0FKQSxDQUFBO0FBQUEiLCJmaWxlIjoibm9kZWpzLXNjb3BlLmpzIiwic291cmNlUm9vdCI6Ii9zb3VyY2UvIiwic291cmNlc0NvbnRlbnQiOlsiIyAtKi0gY29kaW5nOiB1dGYtOCAtKi1cbiMgIENvcHlyaWdodCAoQykgMjAxNSBZdXN1a2UgU3V6dWtpIDx1dGF0YW5lLnRlYUBnbWFpbC5jb20+XG4jXG4jICBSZWRpc3RyaWJ1dGlvbiBhbmQgdXNlIGluIHNvdXJjZSBhbmQgYmluYXJ5IGZvcm1zLCB3aXRoIG9yIHdpdGhvdXRcbiMgIG1vZGlmaWNhdGlvbiwgYXJlIHBlcm1pdHRlZCBwcm92aWRlZCB0aGF0IHRoZSBmb2xsb3dpbmcgY29uZGl0aW9ucyBhcmUgbWV0OlxuI1xuIyAgICAqIFJlZGlzdHJpYnV0aW9ucyBvZiBzb3VyY2UgY29kZSBtdXN0IHJldGFpbiB0aGUgYWJvdmUgY29weXJpZ2h0XG4jICAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyLlxuIyAgICAqIFJlZGlzdHJpYnV0aW9ucyBpbiBiaW5hcnkgZm9ybSBtdXN0IHJlcHJvZHVjZSB0aGUgYWJvdmUgY29weXJpZ2h0XG4jICAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyIGluIHRoZVxuIyAgICAgIGRvY3VtZW50YXRpb24gYW5kL29yIG90aGVyIG1hdGVyaWFscyBwcm92aWRlZCB3aXRoIHRoZSBkaXN0cmlidXRpb24uXG4jXG4jICBUSElTIFNPRlRXQVJFIElTIFBST1ZJREVEIEJZIFRIRSBDT1BZUklHSFQgSE9MREVSUyBBTkQgQ09OVFJJQlVUT1JTIFwiQVMgSVNcIlxuIyAgQU5EIEFOWSBFWFBSRVNTIE9SIElNUExJRUQgV0FSUkFOVElFUywgSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFRIRVxuIyAgSU1QTElFRCBXQVJSQU5USUVTIE9GIE1FUkNIQU5UQUJJTElUWSBBTkQgRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0VcbiMgIEFSRSBESVNDTEFJTUVELiBJTiBOTyBFVkVOVCBTSEFMTCA8Q09QWVJJR0hUIEhPTERFUj4gQkUgTElBQkxFIEZPUiBBTllcbiMgIERJUkVDVCwgSU5ESVJFQ1QsIElOQ0lERU5UQUwsIFNQRUNJQUwsIEVYRU1QTEFSWSwgT1IgQ09OU0VRVUVOVElBTCBEQU1BR0VTXG4jICAoSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFBST0NVUkVNRU5UIE9GIFNVQlNUSVRVVEUgR09PRFMgT1IgU0VSVklDRVM7XG4jICBMT1NTIE9GIFVTRSwgREFUQSwgT1IgUFJPRklUUzsgT1IgQlVTSU5FU1MgSU5URVJSVVBUSU9OKSBIT1dFVkVSIENBVVNFRCBBTkRcbiMgIE9OIEFOWSBUSEVPUlkgT0YgTElBQklMSVRZLCBXSEVUSEVSIElOIENPTlRSQUNULCBTVFJJQ1QgTElBQklMSVRZLCBPUiBUT1JUXG4jICAoSU5DTFVESU5HIE5FR0xJR0VOQ0UgT1IgT1RIRVJXSVNFKSBBUklTSU5HIElOIEFOWSBXQVkgT1VUIE9GIFRIRSBVU0UgT0ZcbiMgIFRISVMgU09GVFdBUkUsIEVWRU4gSUYgQURWSVNFRCBPRiBUSEUgUE9TU0lCSUxJVFkgT0YgU1VDSCBEQU1BR0UuXG5cbmV4cGVjdCA9IHJlcXVpcmUoJ2NoYWknKS5leHBlY3Rcbmhhcm1vbnkgPSByZXF1aXJlICcuLi90aGlyZF9wYXJ0eS9lc3ByaW1hJ1xuZXNjb3BlID0gcmVxdWlyZSAnLi4nXG5cbmRlc2NyaWJlICdub2RlanNTY29wZSBvcHRpb24nLCAtPlxuICAgIGl0ICdjcmVhdGVzIGEgZnVuY3Rpb24gc2NvcGUgZm9sbG93aW5nIHRoZSBnbG9iYWwgc2NvcGUgaW1tZWRpYXRlbHknLCAtPlxuICAgICAgICBhc3QgPSBoYXJtb255LnBhcnNlIFwiXCJcIlxuICAgICAgICAndXNlIHN0cmljdCc7XG4gICAgICAgIHZhciBoZWxsbyA9IDIwO1xuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3QsIGVjbWFWZXJzaW9uOiA2LCBub2RlanNTY29wZTogeWVzXG4gICAgICAgIGV4cGVjdChzY29wZU1hbmFnZXIuc2NvcGVzKS50by5oYXZlLmxlbmd0aCAyXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzBdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZ2xvYmFsJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuYmxvY2sudHlwZSkudG8uYmUuZXF1YWwgJ1Byb2dyYW0nXG4gICAgICAgIGV4cGVjdChzY29wZS5pc1N0cmljdCkudG8uYmUuZmFsc2VcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMFxuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1sxXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2Z1bmN0aW9uJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuYmxvY2sudHlwZSkudG8uYmUuZXF1YWwgJ1Byb2dyYW0nXG4gICAgICAgIGV4cGVjdChzY29wZS5pc1N0cmljdCkudG8uYmUudHJ1ZVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAyXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwgJ2FyZ3VtZW50cydcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1sxXS5uYW1lKS50by5iZS5lcXVhbCAnaGVsbG8nXG5cbiAgICBpdCAnY3JlYXRlcyBhIGZ1bmN0aW9uIHNjb3BlIGZvbGxvd2luZyB0aGUgZ2xvYmFsIHNjb3BlIGltbWVkaWF0ZWx5IGFuZCBjcmVhdGVzIG1vZHVsZSBzY29wZScsIC0+XG4gICAgICAgIGFzdCA9IGhhcm1vbnkucGFyc2UgXCJcIlwiXG4gICAgICAgIGltcG9ydCB7eCBhcyB2fSBmcm9tIFwibW9kXCI7XG4gICAgICAgIFwiXCJcIiwgc291cmNlVHlwZTogJ21vZHVsZSdcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3QsIGVjbWFWZXJzaW9uOiA2LCBub2RlanNTY29wZTogeWVzLCBzb3VyY2VUeXBlOiAnbW9kdWxlJ1xuICAgICAgICBleHBlY3Qoc2NvcGVNYW5hZ2VyLnNjb3BlcykudG8uaGF2ZS5sZW5ndGggM1xuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1swXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ2dsb2JhbCdcbiAgICAgICAgZXhwZWN0KHNjb3BlLmJsb2NrLnR5cGUpLnRvLmJlLmVxdWFsICdQcm9ncmFtJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuaXNTdHJpY3QpLnRvLmJlLmZhbHNlXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDBcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMV1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICdmdW5jdGlvbidcbiAgICAgICAgZXhwZWN0KHNjb3BlLmJsb2NrLnR5cGUpLnRvLmJlLmVxdWFsICdQcm9ncmFtJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuaXNTdHJpY3QpLnRvLmJlLmZhbHNlXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5uYW1lKS50by5iZS5lcXVhbCAnYXJndW1lbnRzJ1xuXG4gICAgICAgIHNjb3BlID0gc2NvcGVNYW5hZ2VyLnNjb3Blc1syXVxuICAgICAgICBleHBlY3Qoc2NvcGUudHlwZSkudG8uYmUuZXF1YWwgJ21vZHVsZSdcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGggMVxuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLm5hbWUpLnRvLmJlLmVxdWFsICd2J1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzWzBdLmRlZnNbMF0udHlwZSkudG8uYmUuZXF1YWwgJ0ltcG9ydEJpbmRpbmcnXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAwXG5cblxuXG4jIHZpbTogc2V0IHN3PTQgdHM9NCBldCB0dz04MCA6XG4iXX0=
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/powered-test/object-expression.js b/tools/eslint/node_modules/escope/powered-test/object-expression.js
      new file mode 100644
      index 00000000000000..3e845c7d798971
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/powered-test/object-expression.js
      @@ -0,0 +1,56 @@
      +(function() {
      +  'use strict';
      +  var escope, expect;
      +
      +  expect = require('chai').expect;
      +
      +  escope = require('..');
      +
      +  describe('object expression', function() {
      +    return it('doesn\'t require property type', function() {
      +      var ast, scope;
      +      ast = {
      +        type: 'Program',
      +        body: [
      +          {
      +            type: 'VariableDeclaration',
      +            declarations: [
      +              {
      +                type: 'VariableDeclarator',
      +                id: {
      +                  type: 'Identifier',
      +                  name: 'a'
      +                },
      +                init: {
      +                  type: 'ObjectExpression',
      +                  properties: [
      +                    {
      +                      kind: 'init',
      +                      key: {
      +                        type: 'Identifier',
      +                        name: 'foo'
      +                      },
      +                      value: {
      +                        type: 'Identifier',
      +                        name: 'a'
      +                      }
      +                    }
      +                  ]
      +                }
      +              }
      +            ]
      +          }
      +        ]
      +      };
      +      scope = escope.analyze(ast).scopes[0];
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.references).to.have.length(2);
      +      expect(scope.variables[0].name).to.be.equal('a');
      +      expect(scope.references[0].identifier.name).to.be.equal('a');
      +      return expect(scope.references[1].identifier.name).to.be.equal('a');
      +    });
      +  });
      +
      +}).call(this);
      +
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9iamVjdC1leHByZXNzaW9uLmNvZmZlZSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQztBQUFBLEVBQUEsWUFBQSxDQUFBO0FBQUEsTUFBQSxjQUFBOztBQUFBLEVBRUQsTUFBQSxHQUFTLE9BQUEsQ0FBUyxNQUFULENBQWUsQ0FBQyxNQUZ4QixDQUFBOztBQUFBLEVBR0QsTUFBQSxHQUFTLE9BQUEsQ0FBUyxJQUFULENBSFIsQ0FBQTs7QUFBQSxFQUtELFFBQUEsQ0FBVSxtQkFBVixFQUE4QixTQUFBLEdBQUE7V0FDMUIsRUFBQSxDQUFJLGdDQUFKLEVBQXFDLFNBQUEsR0FBQTtBQUlqQyxVQUFBLFVBQUE7QUFBQSxNQUFBLEdBQUEsR0FDSTtBQUFBLFFBQUEsSUFBQSxFQUFPLFNBQVA7QUFBQSxRQUNBLElBQUEsRUFBTTtVQUFDO0FBQUEsWUFDSCxJQUFBLEVBQU8scUJBREo7QUFBQSxZQUVILFlBQUEsRUFBYztjQUFDO0FBQUEsZ0JBQ1gsSUFBQSxFQUFPLG9CQURJO0FBQUEsZ0JBRVgsRUFBQSxFQUNJO0FBQUEsa0JBQUEsSUFBQSxFQUFPLFlBQVA7QUFBQSxrQkFDQSxJQUFBLEVBQU8sR0FEUDtpQkFITztBQUFBLGdCQUtYLElBQUEsRUFDSTtBQUFBLGtCQUFBLElBQUEsRUFBTyxrQkFBUDtBQUFBLGtCQUNBLFVBQUEsRUFBWTtvQkFBQztBQUFBLHNCQUNULElBQUEsRUFBTyxNQURFO0FBQUEsc0JBRVQsR0FBQSxFQUNJO0FBQUEsd0JBQUEsSUFBQSxFQUFPLFlBQVA7QUFBQSx3QkFDQSxJQUFBLEVBQU8sS0FEUDt1QkFISztBQUFBLHNCQUtULEtBQUEsRUFDSTtBQUFBLHdCQUFBLElBQUEsRUFBTyxZQUFQO0FBQUEsd0JBQ0EsSUFBQSxFQUFPLEdBRFA7dUJBTks7cUJBQUQ7bUJBRFo7aUJBTk87ZUFBRDthQUZYO1dBQUQ7U0FETjtPQURKLENBQUE7QUFBQSxNQXVCQSxLQUFBLEdBQVEsTUFBTSxDQUFDLE9BQVAsQ0FBZSxHQUFmLENBQW1CLENBQUMsTUFBTyxDQUFBLENBQUEsQ0F2Qm5DLENBQUE7QUFBQSxNQXdCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBeEJBLENBQUE7QUFBQSxNQXlCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBekJBLENBQUE7QUFBQSxNQTBCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQVUsQ0FBQSxDQUFBLENBQUUsQ0FBQyxJQUExQixDQUErQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBdEMsQ0FBNkMsR0FBN0MsQ0ExQkEsQ0FBQTtBQUFBLE1BMkJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBVyxDQUFBLENBQUEsQ0FBRSxDQUFDLFVBQVUsQ0FBQyxJQUF0QyxDQUEyQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBbEQsQ0FBeUQsR0FBekQsQ0EzQkEsQ0FBQTthQTRCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxVQUFVLENBQUMsSUFBdEMsQ0FBMkMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQWxELENBQXlELEdBQXpELEVBaENpQztJQUFBLENBQXJDLEVBRDBCO0VBQUEsQ0FBOUIsQ0FMQyxDQUFBO0FBQUEiLCJmaWxlIjoib2JqZWN0LWV4cHJlc3Npb24uanMiLCJzb3VyY2VSb290IjoiL3NvdXJjZS8iLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCdcblxuZXhwZWN0ID0gcmVxdWlyZSgnY2hhaScpLmV4cGVjdFxuZXNjb3BlID0gcmVxdWlyZSAnLi4nXG5cbmRlc2NyaWJlICdvYmplY3QgZXhwcmVzc2lvbicsIC0+XG4gICAgaXQgJ2RvZXNuXFwndCByZXF1aXJlIHByb3BlcnR5IHR5cGUnLCAtPlxuICAgICAgICAjIEhhcmRjb2RlZCBBU1QuICBFc3ByaW1hIGFkZHMgYW4gZXh0cmEgJ1Byb3BlcnR5J1xuICAgICAgICAjIGtleS92YWx1ZSB0byBPYmplY3RFeHByZXNzaW9ucywgc28gd2UncmUgbm90IHVzaW5nXG4gICAgICAgICMgaXQgcGFyc2UgYSBwcm9ncmFtIHN0cmluZy5cbiAgICAgICAgYXN0ID1cbiAgICAgICAgICAgIHR5cGU6ICdQcm9ncmFtJ1xuICAgICAgICAgICAgYm9keTogW3tcbiAgICAgICAgICAgICAgICB0eXBlOiAnVmFyaWFibGVEZWNsYXJhdGlvbidcbiAgICAgICAgICAgICAgICBkZWNsYXJhdGlvbnM6IFt7XG4gICAgICAgICAgICAgICAgICAgIHR5cGU6ICdWYXJpYWJsZURlY2xhcmF0b3InXG4gICAgICAgICAgICAgICAgICAgIGlkOlxuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ0lkZW50aWZpZXInXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiAnYSdcbiAgICAgICAgICAgICAgICAgICAgaW5pdDpcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6ICdPYmplY3RFeHByZXNzaW9uJ1xuICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllczogW3tcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBraW5kOiAnaW5pdCdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6ICdJZGVudGlmaWVyJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiAnZm9vJ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAnSWRlbnRpZmllcidcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogJ2EnXG4gICAgICAgICAgICAgICAgICAgICAgICB9XVxuICAgICAgICAgICAgICAgIH1dXG4gICAgICAgICAgICB9XVxuXG4gICAgICAgIHNjb3BlID0gZXNjb3BlLmFuYWx5emUoYXN0KS5zY29wZXNbMF1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlcykudG8uaGF2ZS5sZW5ndGgoMSlcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoKDIpXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXNbMF0ubmFtZSkudG8uYmUuZXF1YWwoJ2EnKVxuICAgICAgICBleHBlY3Qoc2NvcGUucmVmZXJlbmNlc1swXS5pZGVudGlmaWVyLm5hbWUpLnRvLmJlLmVxdWFsKCdhJylcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMV0uaWRlbnRpZmllci5uYW1lKS50by5iZS5lcXVhbCgnYScpXG4iXX0=
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/powered-test/optimistic.js b/tools/eslint/node_modules/escope/powered-test/optimistic.js
      new file mode 100644
      index 00000000000000..5e93a0a834d291
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/powered-test/optimistic.js
      @@ -0,0 +1,40 @@
      +(function() {
      +  'use strict';
      +  var escope, esprima, expect;
      +
      +  expect = require('chai').expect;
      +
      +  escope = require('..');
      +
      +  esprima = require('esprima');
      +
      +  describe('optimistic', function() {
      +    it('direct call to eval', function() {
      +      var ast, scopes;
      +      ast = esprima.parse("function outer() {\n    eval(str);\n    var i = 20;\n    function inner() {\n        i;\n    }\n}");
      +      scopes = escope.analyze(ast, {
      +        optimistic: true
      +      }).scopes;
      +      return expect(scopes.map(function(scope) {
      +        return scope.variables.map(function(variable) {
      +          return variable.name;
      +        });
      +      })).to.be.eql([['outer'], ['arguments', 'i', 'inner'], ['arguments']]);
      +    });
      +    return it('with statement', function() {
      +      var ast, scopes;
      +      ast = esprima.parse("function outer() {\n    eval(str);\n    var i = 20;\n    with (obj) {\n        i;\n    }\n}");
      +      scopes = escope.analyze(ast, {
      +        optimistic: true
      +      }).scopes;
      +      return expect(scopes.map(function(scope) {
      +        return scope.variables.map(function(variable) {
      +          return variable.name;
      +        });
      +      })).to.be.eql([['outer'], ['arguments', 'i'], []]);
      +    });
      +  });
      +
      +}).call(this);
      +
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9wdGltaXN0aWMuY29mZmVlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXNCQztBQUFBLEVBQUEsWUFBQSxDQUFBO0FBQUEsTUFBQSx1QkFBQTs7QUFBQSxFQUVELE1BQUEsR0FBUyxPQUFBLENBQVMsTUFBVCxDQUFlLENBQUMsTUFGeEIsQ0FBQTs7QUFBQSxFQUdELE1BQUEsR0FBUyxPQUFBLENBQVMsSUFBVCxDQUhSLENBQUE7O0FBQUEsRUFJRCxPQUFBLEdBQVUsT0FBQSxDQUFTLFNBQVQsQ0FKVCxDQUFBOztBQUFBLEVBTUQsUUFBQSxDQUFVLFlBQVYsRUFBdUIsU0FBQSxHQUFBO0FBQ25CLElBQUEsRUFBQSxDQUFJLHFCQUFKLEVBQTBCLFNBQUEsR0FBQTtBQUN0QixVQUFBLFdBQUE7QUFBQSxNQUFBLEdBQUEsR0FBTSxPQUFPLENBQUMsS0FBUixDQUFpQixtR0FBakIsQ0FBTixDQUFBO0FBQUEsTUFVQSxNQUFBLEdBQVMsTUFBTSxDQUFDLE9BQVAsQ0FBZSxHQUFmLEVBQW9CO0FBQUEsUUFBQSxVQUFBLEVBQVksSUFBWjtPQUFwQixDQUFvQyxDQUFDLE1BVjlDLENBQUE7YUFZQSxNQUFBLENBQU8sTUFBTSxDQUFDLEdBQVAsQ0FBVyxTQUFDLEtBQUQsR0FBQTtlQUNkLEtBQUssQ0FBQyxTQUFTLENBQUMsR0FBaEIsQ0FBb0IsU0FBQyxRQUFELEdBQUE7aUJBQWMsUUFBUSxDQUFDLEtBQXZCO1FBQUEsQ0FBcEIsRUFEYztNQUFBLENBQVgsQ0FBUCxDQUNzRCxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsR0FEN0QsQ0FFSSxDQUNJLENBQ0ssT0FETCxDQURKLEVBSUksQ0FDSyxXQURMLEVBRUssR0FGTCxFQUdLLE9BSEwsQ0FKSixFQVNJLENBQ0ssV0FETCxDQVRKLENBRkosRUFic0I7SUFBQSxDQUExQixDQUFBLENBQUE7V0E4QkEsRUFBQSxDQUFJLGdCQUFKLEVBQXFCLFNBQUEsR0FBQTtBQUNqQixVQUFBLFdBQUE7QUFBQSxNQUFBLEdBQUEsR0FBTSxPQUFPLENBQUMsS0FBUixDQUFpQiw2RkFBakIsQ0FBTixDQUFBO0FBQUEsTUFVQSxNQUFBLEdBQVMsTUFBTSxDQUFDLE9BQVAsQ0FBZSxHQUFmLEVBQW9CO0FBQUEsUUFBQSxVQUFBLEVBQVksSUFBWjtPQUFwQixDQUFvQyxDQUFDLE1BVjlDLENBQUE7YUFZQSxNQUFBLENBQU8sTUFBTSxDQUFDLEdBQVAsQ0FBVyxTQUFDLEtBQUQsR0FBQTtlQUNkLEtBQUssQ0FBQyxTQUFTLENBQUMsR0FBaEIsQ0FBb0IsU0FBQyxRQUFELEdBQUE7aUJBQWMsUUFBUSxDQUFDLEtBQXZCO1FBQUEsQ0FBcEIsRUFEYztNQUFBLENBQVgsQ0FBUCxDQUNzRCxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsR0FEN0QsQ0FFSSxDQUNJLENBQ0ssT0FETCxDQURKLEVBSUksQ0FDSyxXQURMLEVBRUssR0FGTCxDQUpKLEVBUUksRUFSSixDQUZKLEVBYmlCO0lBQUEsQ0FBckIsRUEvQm1CO0VBQUEsQ0FBdkIsQ0FOQyxDQUFBO0FBQUEiLCJmaWxlIjoib3B0aW1pc3RpYy5qcyIsInNvdXJjZVJvb3QiOiIvc291cmNlLyIsInNvdXJjZXNDb250ZW50IjpbIiMgQ29weXJpZ2h0IChDKSAyMDEzIFl1c3VrZSBTdXp1a2kgPHV0YXRhbmUudGVhQGdtYWlsLmNvbT5cbiNcbiMgUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0XG4jIG1vZGlmaWNhdGlvbiwgYXJlIHBlcm1pdHRlZCBwcm92aWRlZCB0aGF0IHRoZSBmb2xsb3dpbmcgY29uZGl0aW9ucyBhcmUgbWV0OlxuI1xuIyAgICogUmVkaXN0cmlidXRpb25zIG9mIHNvdXJjZSBjb2RlIG11c3QgcmV0YWluIHRoZSBhYm92ZSBjb3B5cmlnaHRcbiMgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lci5cbiMgICAqIFJlZGlzdHJpYnV0aW9ucyBpbiBiaW5hcnkgZm9ybSBtdXN0IHJlcHJvZHVjZSB0aGUgYWJvdmUgY29weXJpZ2h0XG4jICAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIgaW4gdGhlXG4jICAgICBkb2N1bWVudGF0aW9uIGFuZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQgd2l0aCB0aGUgZGlzdHJpYnV0aW9uLlxuI1xuIyBUSElTIFNPRlRXQVJFIElTIFBST1ZJREVEIEJZIFRIRSBDT1BZUklHSFQgSE9MREVSUyBBTkQgQ09OVFJJQlVUT1JTIFwiQVMgSVNcIlxuIyBBTkQgQU5ZIEVYUFJFU1MgT1IgSU1QTElFRCBXQVJSQU5USUVTLCBJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgVEhFXG4jIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFXG4jIEFSRSBESVNDTEFJTUVELiBJTiBOTyBFVkVOVCBTSEFMTCA8Q09QWVJJR0hUIEhPTERFUj4gQkUgTElBQkxFIEZPUiBBTllcbiMgRElSRUNULCBJTkRJUkVDVCwgSU5DSURFTlRBTCwgU1BFQ0lBTCwgRVhFTVBMQVJZLCBPUiBDT05TRVFVRU5USUFMIERBTUFHRVNcbiMgKElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTO1xuIyBMT1NTIE9GIFVTRSwgREFUQSwgT1IgUFJPRklUUzsgT1IgQlVTSU5FU1MgSU5URVJSVVBUSU9OKSBIT1dFVkVSIENBVVNFRCBBTkRcbiMgT04gQU5ZIFRIRU9SWSBPRiBMSUFCSUxJVFksIFdIRVRIRVIgSU4gQ09OVFJBQ1QsIFNUUklDVCBMSUFCSUxJVFksIE9SIFRPUlRcbiMgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFIE9GXG4jIFRISVMgU09GVFdBUkUsIEVWRU4gSUYgQURWSVNFRCBPRiBUSEUgUE9TU0lCSUxJVFkgT0YgU1VDSCBEQU1BR0UuXG5cbid1c2Ugc3RyaWN0J1xuXG5leHBlY3QgPSByZXF1aXJlKCdjaGFpJykuZXhwZWN0XG5lc2NvcGUgPSByZXF1aXJlICcuLidcbmVzcHJpbWEgPSByZXF1aXJlICdlc3ByaW1hJ1xuXG5kZXNjcmliZSAnb3B0aW1pc3RpYycsIC0+XG4gICAgaXQgJ2RpcmVjdCBjYWxsIHRvIGV2YWwnLCAtPlxuICAgICAgICBhc3QgPSBlc3ByaW1hLnBhcnNlIFwiXCJcIlxuICAgICAgICBmdW5jdGlvbiBvdXRlcigpIHtcbiAgICAgICAgICAgIGV2YWwoc3RyKTtcbiAgICAgICAgICAgIHZhciBpID0gMjA7XG4gICAgICAgICAgICBmdW5jdGlvbiBpbm5lcigpIHtcbiAgICAgICAgICAgICAgICBpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIFwiXCJcIlxuXG4gICAgICAgIHNjb3BlcyA9IGVzY29wZS5hbmFseXplKGFzdCwgb3B0aW1pc3RpYzogeWVzKS5zY29wZXNcblxuICAgICAgICBleHBlY3Qoc2NvcGVzLm1hcCgoc2NvcGUpIC0+XG4gICAgICAgICAgICBzY29wZS52YXJpYWJsZXMubWFwKCh2YXJpYWJsZSkgLT4gdmFyaWFibGUubmFtZSkpKS50by5iZS5lcWwoXG4gICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgICAgICAnb3V0ZXInXG4gICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAgICAgJ2FyZ3VtZW50cydcbiAgICAgICAgICAgICAgICAgICAgJ2knXG4gICAgICAgICAgICAgICAgICAgICdpbm5lcidcbiAgICAgICAgICAgICAgICBdXG4gICAgICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgICAgICAnYXJndW1lbnRzJ1xuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgIF1cbiAgICAgICAgKVxuXG4gICAgaXQgJ3dpdGggc3RhdGVtZW50JywgLT5cbiAgICAgICAgYXN0ID0gZXNwcmltYS5wYXJzZSBcIlwiXCJcbiAgICAgICAgZnVuY3Rpb24gb3V0ZXIoKSB7XG4gICAgICAgICAgICBldmFsKHN0cik7XG4gICAgICAgICAgICB2YXIgaSA9IDIwO1xuICAgICAgICAgICAgd2l0aCAob2JqKSB7XG4gICAgICAgICAgICAgICAgaTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZXMgPSBlc2NvcGUuYW5hbHl6ZShhc3QsIG9wdGltaXN0aWM6IHllcykuc2NvcGVzXG5cbiAgICAgICAgZXhwZWN0KHNjb3Blcy5tYXAoKHNjb3BlKSAtPlxuICAgICAgICAgICAgc2NvcGUudmFyaWFibGVzLm1hcCgodmFyaWFibGUpIC0+IHZhcmlhYmxlLm5hbWUpKSkudG8uYmUuZXFsKFxuICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICAgICAgJ291dGVyJ1xuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgICAgICdhcmd1bWVudHMnXG4gICAgICAgICAgICAgICAgICAgICdpJ1xuICAgICAgICAgICAgICAgIF1cbiAgICAgICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgXVxuICAgICAgICAgICAgXVxuICAgICAgICApXG5cblxuIl19
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/powered-test/with-scope.js b/tools/eslint/node_modules/escope/powered-test/with-scope.js
      new file mode 100644
      index 00000000000000..bb2c74569091ea
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/powered-test/with-scope.js
      @@ -0,0 +1,40 @@
      +(function() {
      +  var escope, esprima, expect, harmony;
      +
      +  expect = require('chai').expect;
      +
      +  esprima = require('esprima');
      +
      +  harmony = require('../third_party/esprima');
      +
      +  escope = require('..');
      +
      +  describe('with', function() {
      +    return it('creates scope', function() {
      +      var ast, globalScope, scope, scopeManager;
      +      ast = esprima.parse("(function () {\n    with (obj) {\n        testing;\n    }\n}());");
      +      scopeManager = escope.analyze(ast);
      +      expect(scopeManager.scopes).to.have.length(3);
      +      globalScope = scopeManager.scopes[0];
      +      expect(globalScope.type).to.be.equal('global');
      +      expect(globalScope.variables).to.have.length(0);
      +      expect(globalScope.references).to.have.length(0);
      +      scope = scopeManager.scopes[1];
      +      expect(scope.type).to.be.equal('function');
      +      expect(scope.variables).to.have.length(1);
      +      expect(scope.variables[0].name).to.be.equal('arguments');
      +      expect(scope.isArgumentsMaterialized()).to.be["false"];
      +      expect(scope.references).to.have.length(1);
      +      expect(scope.references[0].resolved).to.be["null"];
      +      scope = scopeManager.scopes[2];
      +      expect(scope.type).to.be.equal('with');
      +      expect(scope.variables).to.have.length(0);
      +      expect(scope.isArgumentsMaterialized()).to.be["true"];
      +      expect(scope.references).to.have.length(1);
      +      return expect(scope.references[0].resolved).to.be["null"];
      +    });
      +  });
      +
      +}).call(this);
      +
      +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndpdGgtc2NvcGUuY29mZmVlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVCQTtBQUFBLE1BQUEsZ0NBQUE7O0FBQUEsRUFBQSxNQUFBLEdBQVMsT0FBQSxDQUFTLE1BQVQsQ0FBZSxDQUFDLE1BQXpCLENBQUE7O0FBQUEsRUFDQSxPQUFBLEdBQVUsT0FBQSxDQUFTLFNBQVQsQ0FEVixDQUFBOztBQUFBLEVBRUEsT0FBQSxHQUFVLE9BQUEsQ0FBUyx3QkFBVCxDQUZWLENBQUE7O0FBQUEsRUFHQSxNQUFBLEdBQVMsT0FBQSxDQUFTLElBQVQsQ0FIVCxDQUFBOztBQUFBLEVBS0EsUUFBQSxDQUFVLE1BQVYsRUFBaUIsU0FBQSxHQUFBO1dBQ2IsRUFBQSxDQUFJLGVBQUosRUFBb0IsU0FBQSxHQUFBO0FBQ2hCLFVBQUEscUNBQUE7QUFBQSxNQUFBLEdBQUEsR0FBTSxPQUFPLENBQUMsS0FBUixDQUFpQixrRUFBakIsQ0FBTixDQUFBO0FBQUEsTUFRQSxZQUFBLEdBQWUsTUFBTSxDQUFDLE9BQVAsQ0FBZSxHQUFmLENBUmYsQ0FBQTtBQUFBLE1BU0EsTUFBQSxDQUFPLFlBQVksQ0FBQyxNQUFwQixDQUEyQixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBcEMsQ0FBMkMsQ0FBM0MsQ0FUQSxDQUFBO0FBQUEsTUFVQSxXQUFBLEdBQWMsWUFBWSxDQUFDLE1BQU8sQ0FBQSxDQUFBLENBVmxDLENBQUE7QUFBQSxNQVdBLE1BQUEsQ0FBTyxXQUFXLENBQUMsSUFBbkIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQS9CLENBQXNDLFFBQXRDLENBWEEsQ0FBQTtBQUFBLE1BWUEsTUFBQSxDQUFPLFdBQVcsQ0FBQyxTQUFuQixDQUE2QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBdEMsQ0FBNkMsQ0FBN0MsQ0FaQSxDQUFBO0FBQUEsTUFhQSxNQUFBLENBQU8sV0FBVyxDQUFDLFVBQW5CLENBQThCLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxNQUF2QyxDQUE4QyxDQUE5QyxDQWJBLENBQUE7QUFBQSxNQWVBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0FmNUIsQ0FBQTtBQUFBLE1BZ0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsSUFBYixDQUFrQixDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsS0FBekIsQ0FBZ0MsVUFBaEMsQ0FoQkEsQ0FBQTtBQUFBLE1BaUJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBYixDQUF1QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBaEMsQ0FBdUMsQ0FBdkMsQ0FqQkEsQ0FBQTtBQUFBLE1Ba0JBLE1BQUEsQ0FBTyxLQUFLLENBQUMsU0FBVSxDQUFBLENBQUEsQ0FBRSxDQUFDLElBQTFCLENBQStCLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxLQUF0QyxDQUE2QyxXQUE3QyxDQWxCQSxDQUFBO0FBQUEsTUFtQkEsTUFBQSxDQUFPLEtBQUssQ0FBQyx1QkFBTixDQUFBLENBQVAsQ0FBdUMsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLE9BQUQsQ0FuQjdDLENBQUE7QUFBQSxNQW9CQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQWIsQ0FBd0IsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWpDLENBQXdDLENBQXhDLENBcEJBLENBQUE7QUFBQSxNQXFCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxDQXJCMUMsQ0FBQTtBQUFBLE1BdUJBLEtBQUEsR0FBUSxZQUFZLENBQUMsTUFBTyxDQUFBLENBQUEsQ0F2QjVCLENBQUE7QUFBQSxNQXdCQSxNQUFBLENBQU8sS0FBSyxDQUFDLElBQWIsQ0FBa0IsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEtBQXpCLENBQWdDLE1BQWhDLENBeEJBLENBQUE7QUFBQSxNQXlCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFNBQWIsQ0FBdUIsQ0FBQyxFQUFFLENBQUMsSUFBSSxDQUFDLE1BQWhDLENBQXVDLENBQXZDLENBekJBLENBQUE7QUFBQSxNQTBCQSxNQUFBLENBQU8sS0FBSyxDQUFDLHVCQUFOLENBQUEsQ0FBUCxDQUF1QyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxDQTFCN0MsQ0FBQTtBQUFBLE1BMkJBLE1BQUEsQ0FBTyxLQUFLLENBQUMsVUFBYixDQUF3QixDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsTUFBakMsQ0FBd0MsQ0FBeEMsQ0EzQkEsQ0FBQTthQTRCQSxNQUFBLENBQU8sS0FBSyxDQUFDLFVBQVcsQ0FBQSxDQUFBLENBQUUsQ0FBQyxRQUEzQixDQUFvQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBRCxFQTdCMUI7SUFBQSxDQUFwQixFQURhO0VBQUEsQ0FBakIsQ0FMQSxDQUFBO0FBQUEiLCJmaWxlIjoid2l0aC1zY29wZS5qcyIsInNvdXJjZVJvb3QiOiIvc291cmNlLyIsInNvdXJjZXNDb250ZW50IjpbIiMgLSotIGNvZGluZzogdXRmLTggLSotXG4jICBDb3B5cmlnaHQgKEMpIDIwMTUgWXVzdWtlIFN1enVraSA8dXRhdGFuZS50ZWFAZ21haWwuY29tPlxuI1xuIyAgUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0XG4jICBtb2RpZmljYXRpb24sIGFyZSBwZXJtaXR0ZWQgcHJvdmlkZWQgdGhhdCB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnMgYXJlIG1ldDpcbiNcbiMgICAgKiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodFxuIyAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lci5cbiMgICAgKiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodFxuIyAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lciBpbiB0aGVcbiMgICAgICBkb2N1bWVudGF0aW9uIGFuZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQgd2l0aCB0aGUgZGlzdHJpYnV0aW9uLlxuI1xuIyAgVEhJUyBTT0ZUV0FSRSBJUyBQUk9WSURFRCBCWSBUSEUgQ09QWVJJR0hUIEhPTERFUlMgQU5EIENPTlRSSUJVVE9SUyBcIkFTIElTXCJcbiMgIEFORCBBTlkgRVhQUkVTUyBPUiBJTVBMSUVEIFdBUlJBTlRJRVMsIElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBUSEVcbiMgIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFXG4jICBBUkUgRElTQ0xBSU1FRC4gSU4gTk8gRVZFTlQgU0hBTEwgPENPUFlSSUdIVCBIT0xERVI+IEJFIExJQUJMRSBGT1IgQU5ZXG4jICBESVJFQ1QsIElORElSRUNULCBJTkNJREVOVEFMLCBTUEVDSUFMLCBFWEVNUExBUlksIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFU1xuIyAgKElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTO1xuIyAgTE9TUyBPRiBVU0UsIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EXG4jICBPTiBBTlkgVEhFT1JZIE9GIExJQUJJTElUWSwgV0hFVEhFUiBJTiBDT05UUkFDVCwgU1RSSUNUIExJQUJJTElUWSwgT1IgVE9SVFxuIyAgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFIE9GXG4jICBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLlxuXG5leHBlY3QgPSByZXF1aXJlKCdjaGFpJykuZXhwZWN0XG5lc3ByaW1hID0gcmVxdWlyZSAnZXNwcmltYSdcbmhhcm1vbnkgPSByZXF1aXJlICcuLi90aGlyZF9wYXJ0eS9lc3ByaW1hJ1xuZXNjb3BlID0gcmVxdWlyZSAnLi4nXG5cbmRlc2NyaWJlICd3aXRoJywgLT5cbiAgICBpdCAnY3JlYXRlcyBzY29wZScsIC0+XG4gICAgICAgIGFzdCA9IGVzcHJpbWEucGFyc2UgXCJcIlwiXG4gICAgICAgIChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB3aXRoIChvYmopIHtcbiAgICAgICAgICAgICAgICB0ZXN0aW5nO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KCkpO1xuICAgICAgICBcIlwiXCJcblxuICAgICAgICBzY29wZU1hbmFnZXIgPSBlc2NvcGUuYW5hbHl6ZSBhc3RcbiAgICAgICAgZXhwZWN0KHNjb3BlTWFuYWdlci5zY29wZXMpLnRvLmhhdmUubGVuZ3RoIDNcbiAgICAgICAgZ2xvYmFsU2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzBdXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS50eXBlKS50by5iZS5lcXVhbCAnZ2xvYmFsJ1xuICAgICAgICBleHBlY3QoZ2xvYmFsU2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgIGV4cGVjdChnbG9iYWxTY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAwXG5cbiAgICAgICAgc2NvcGUgPSBzY29wZU1hbmFnZXIuc2NvcGVzWzFdXG4gICAgICAgIGV4cGVjdChzY29wZS50eXBlKS50by5iZS5lcXVhbCAnZnVuY3Rpb24nXG4gICAgICAgIGV4cGVjdChzY29wZS52YXJpYWJsZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnZhcmlhYmxlc1swXS5uYW1lKS50by5iZS5lcXVhbCAnYXJndW1lbnRzJ1xuICAgICAgICBleHBlY3Qoc2NvcGUuaXNBcmd1bWVudHNNYXRlcmlhbGl6ZWQoKSkudG8uYmUuZmFsc2VcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXMpLnRvLmhhdmUubGVuZ3RoIDFcbiAgICAgICAgZXhwZWN0KHNjb3BlLnJlZmVyZW5jZXNbMF0ucmVzb2x2ZWQpLnRvLmJlLm51bGxcblxuICAgICAgICBzY29wZSA9IHNjb3BlTWFuYWdlci5zY29wZXNbMl1cbiAgICAgICAgZXhwZWN0KHNjb3BlLnR5cGUpLnRvLmJlLmVxdWFsICd3aXRoJ1xuICAgICAgICBleHBlY3Qoc2NvcGUudmFyaWFibGVzKS50by5oYXZlLmxlbmd0aCAwXG4gICAgICAgIGV4cGVjdChzY29wZS5pc0FyZ3VtZW50c01hdGVyaWFsaXplZCgpKS50by5iZS50cnVlXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzKS50by5oYXZlLmxlbmd0aCAxXG4gICAgICAgIGV4cGVjdChzY29wZS5yZWZlcmVuY2VzWzBdLnJlc29sdmVkKS50by5iZS5udWxsXG5cbiMgdmltOiBzZXQgc3c9NCB0cz00IGV0IHR3PTgwIDpcbiJdfQ==
      \ No newline at end of file
      diff --git a/tools/eslint/node_modules/escope/src/index.js b/tools/eslint/node_modules/escope/src/index.js
      index 66a6ea9b6d2f9c..a345e1c71359eb 100644
      --- a/tools/eslint/node_modules/escope/src/index.js
      +++ b/tools/eslint/node_modules/escope/src/index.js
      @@ -62,8 +62,11 @@ function defaultOptions() {
               optimistic: false,
               directive: false,
               nodejsScope: false,
      +        impliedStrict: false,
               sourceType: 'script',  // one of ['script', 'module']
      -        ecmaVersion: 5
      +        ecmaVersion: 5,
      +        childVisitorKeys: null,
      +        fallback: 'iteration'
           };
       }
       
      @@ -71,7 +74,7 @@ function updateDeeply(target, override) {
           var key, val;
       
           function isHashObject(target) {
      -        return typeof target === 'object' && target instanceof Object && !(target instanceof RegExp);
      +        return typeof target === 'object' && target instanceof Object && !(target instanceof Array) && !(target instanceof RegExp);
           }
       
           for (key in override) {
      @@ -103,8 +106,12 @@ function updateDeeply(target, override) {
        * @param {boolean} [providedOptions.nodejsScope=false]- whether the whole
        * script is executed under node.js environment. When enabled, escope adds
        * a function scope immediately following the global scope.
      + * @param {boolean} [providedOptions.impliedStrict=false]- implied strict mode
      + * (if ecmaVersion >= 5).
        * @param {string} [providedOptions.sourceType='script']- the source type of the script. one of 'script' and 'module'
        * @param {number} [providedOptions.ecmaVersion=5]- which ECMAScript version is considered
      + * @param {Object} [providedOptions.childVisitorKeys=null] - Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option.
      + * @param {string} [providedOptions.fallback='iteration'] - A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option.
        * @return {ScopeManager}
        */
       export function analyze(tree, providedOptions) {
      @@ -114,7 +121,7 @@ export function analyze(tree, providedOptions) {
       
           scopeManager = new ScopeManager(options);
       
      -    referencer = new Referencer(scopeManager);
      +    referencer = new Referencer(options, scopeManager);
           referencer.visit(tree);
       
           assert(scopeManager.__currentScope === null, 'currentScope should be null.');
      diff --git a/tools/eslint/node_modules/escope/src/pattern-visitor.js b/tools/eslint/node_modules/escope/src/pattern-visitor.js
      new file mode 100644
      index 00000000000000..b98e98ad22dd9a
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/src/pattern-visitor.js
      @@ -0,0 +1,134 @@
      +/*
      +  Copyright (C) 2015 Yusuke Suzuki 
      +
      +  Redistribution and use in source and binary forms, with or without
      +  modification, are permitted provided that the following conditions are met:
      +
      +    * Redistributions of source code must retain the above copyright
      +      notice, this list of conditions and the following disclaimer.
      +    * Redistributions in binary form must reproduce the above copyright
      +      notice, this list of conditions and the following disclaimer in the
      +      documentation and/or other materials provided with the distribution.
      +
      +  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
      +  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      +  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      +  ARE DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
      +  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
      +  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
      +  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      +  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      +  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
      +  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      +*/
      +
      +import { Syntax } from 'estraverse';
      +import esrecurse from 'esrecurse';
      +
      +function getLast(xs) {
      +    return xs[xs.length - 1] || null;
      +}
      +
      +export default class PatternVisitor extends esrecurse.Visitor {
      +    static isPattern(node) {
      +        var nodeType = node.type;
      +        return (
      +            nodeType === Syntax.Identifier ||
      +            nodeType === Syntax.ObjectPattern ||
      +            nodeType === Syntax.ArrayPattern ||
      +            nodeType === Syntax.SpreadElement ||
      +            nodeType === Syntax.RestElement ||
      +            nodeType === Syntax.AssignmentPattern
      +        );
      +    }
      +
      +    constructor(options, rootPattern, callback) {
      +        super(null, options);
      +        this.rootPattern = rootPattern;
      +        this.callback = callback;
      +        this.assignments = [];
      +        this.rightHandNodes = [];
      +        this.restElements = [];
      +    }
      +
      +    Identifier(pattern) {
      +        const lastRestElement = getLast(this.restElements);
      +        this.callback(pattern, {
      +            topLevel: pattern === this.rootPattern,
      +            rest: lastRestElement != null && lastRestElement.argument === pattern,
      +            assignments: this.assignments
      +        });
      +    }
      +
      +    Property(property) {
      +        // Computed property's key is a right hand node.
      +        if (property.computed) {
      +            this.rightHandNodes.push(property.key);
      +        }
      +
      +        // If it's shorthand, its key is same as its value.
      +        // If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern).
      +        // If it's not shorthand, the name of new variable is its value's.
      +        this.visit(property.value);
      +    }
      +
      +    ArrayPattern(pattern) {
      +        var i, iz, element;
      +        for (i = 0, iz = pattern.elements.length; i < iz; ++i) {
      +            element = pattern.elements[i];
      +            this.visit(element);
      +        }
      +    }
      +
      +    AssignmentPattern(pattern) {
      +        this.assignments.push(pattern);
      +        this.visit(pattern.left);
      +        this.rightHandNodes.push(pattern.right);
      +        this.assignments.pop();
      +    }
      +
      +    RestElement(pattern) {
      +        this.restElements.push(pattern);
      +        this.visit(pattern.argument);
      +        this.restElements.pop();
      +    }
      +
      +    MemberExpression(node) {
      +        // Computed property's key is a right hand node.
      +        if (node.computed) {
      +            this.rightHandNodes.push(node.property);
      +        }
      +        // the object is only read, write to its property.
      +        this.rightHandNodes.push(node.object);
      +    }
      +
      +    //
      +    // ForInStatement.left and AssignmentExpression.left are LeftHandSideExpression.
      +    // By spec, LeftHandSideExpression is Pattern or MemberExpression.
      +    //   (see also: https://github.com/estree/estree/pull/20#issuecomment-74584758)
      +    // But espree 2.0 and esprima 2.0 parse to ArrayExpression, ObjectExpression, etc...
      +    //
      +
      +    SpreadElement(node) {
      +        this.visit(node.argument);
      +    }
      +
      +    ArrayExpression(node) {
      +        node.elements.forEach(this.visit, this);
      +    }
      +
      +    AssignmentExpression(node) {
      +        this.assignments.push(node);
      +        this.visit(node.left);
      +        this.rightHandNodes.push(node.right);
      +        this.assignments.pop();
      +    }
      +
      +    CallExpression(node) {
      +        // arguments are right hand nodes.
      +        node.arguments.forEach(a => { this.rightHandNodes.push(a); });
      +        this.visit(node.callee);
      +    }
      +}
      +
      +/* vim: set sw=4 ts=4 et tw=80 : */
      diff --git a/tools/eslint/node_modules/escope/src/referencer.js b/tools/eslint/node_modules/escope/src/referencer.js
      index 7f69a1a8560ad1..bd810808ce10cc 100644
      --- a/tools/eslint/node_modules/escope/src/referencer.js
      +++ b/tools/eslint/node_modules/escope/src/referencer.js
      @@ -25,121 +25,13 @@ import { Syntax } from 'estraverse';
       import esrecurse from 'esrecurse';
       import Reference from './reference';
       import Variable from './variable';
      +import PatternVisitor from './pattern-visitor';
       import { ParameterDefinition, Definition } from './definition';
       import assert from 'assert';
       
      -class PatternVisitor extends esrecurse.Visitor {
      -    constructor(rootPattern, callback) {
      -        super();
      -        this.rootPattern = rootPattern;
      -        this.callback = callback;
      -        this.assignments = [];
      -        this.rightHandNodes = [];
      -        this.restElements = [];
      -    }
      -
      -    Identifier(pattern) {
      -        const lastRestElement = getLast(this.restElements);
      -        this.callback(pattern, {
      -            topLevel: pattern === this.rootPattern,
      -            rest: lastRestElement != null && lastRestElement.argument === pattern,
      -            assignments: this.assignments
      -        });
      -    }
      -
      -    ObjectPattern(pattern) {
      -        var i, iz, property;
      -        for (i = 0, iz = pattern.properties.length; i < iz; ++i) {
      -            property = pattern.properties[i];
      -
      -            // Computed property's key is a right hand node.
      -            if (property.computed) {
      -                this.rightHandNodes.push(property.key);
      -            }
      -
      -            // If it's shorthand, its key is same as its value.
      -            // If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern).
      -            // If it's not shorthand, the name of new variable is its value's.
      -            this.visit(property.value);
      -        }
      -    }
      -
      -    ArrayPattern(pattern) {
      -        var i, iz, element;
      -        for (i = 0, iz = pattern.elements.length; i < iz; ++i) {
      -            element = pattern.elements[i];
      -            this.visit(element);
      -        }
      -    }
      -
      -    AssignmentPattern(pattern) {
      -        this.assignments.push(pattern);
      -        this.visit(pattern.left);
      -        this.rightHandNodes.push(pattern.right);
      -        this.assignments.pop();
      -    }
      -
      -    RestElement(pattern) {
      -        this.restElements.push(pattern);
      -        this.visit(pattern.argument);
      -        this.restElements.pop();
      -    }
      -
      -    MemberExpression(node) {
      -        // Computed property's key is a right hand node.
      -        if (node.computed) {
      -            this.rightHandNodes.push(node.property);
      -        }
      -        // the object is only read, write to its property.
      -        this.rightHandNodes.push(node.object);
      -    }
      -
      -    //
      -    // ForInStatement.left and AssignmentExpression.left are LeftHandSideExpression.
      -    // By spec, LeftHandSideExpression is Pattern or MemberExpression.
      -    //   (see also: https://github.com/estree/estree/pull/20#issuecomment-74584758)
      -    // But espree 2.0 and esprima 2.0 parse to ArrayExpression, ObjectExpression, etc...
      -    //
      -
      -    SpreadElement(node) {
      -        this.visit(node.argument);
      -    }
      -
      -    ArrayExpression(node) {
      -        node.elements.forEach(this.visit, this);
      -    }
      -
      -    ObjectExpression(node) {
      -        node.properties.forEach(property => {
      -            // Computed property's key is a right hand node.
      -            if (property.computed) {
      -                this.rightHandNodes.push(property.key);
      -            }
      -            this.visit(property.value);
      -        });
      -    }
      -
      -    AssignmentExpression(node) {
      -        this.assignments.push(node);
      -        this.visit(node.left);
      -        this.rightHandNodes.push(node.right);
      -        this.assignments.pop();
      -    }
      -
      -    CallExpression(node) {
      -        // arguments are right hand nodes.
      -        node.arguments.forEach(a => { this.rightHandNodes.push(a); });
      -        this.visit(node.callee);
      -    }
      -}
      -
      -function getLast(xs) {
      -    return xs[xs.length - 1] || null;
      -}
      -
      -function traverseIdentifierInPattern(rootPattern, referencer, callback) {
      +function traverseIdentifierInPattern(options, rootPattern, referencer, callback) {
           // Call the callback at left hand identifier nodes, and Collect right hand nodes.
      -    var visitor = new PatternVisitor(rootPattern, callback);
      +    var visitor = new PatternVisitor(options, rootPattern, callback);
           visitor.visit(rootPattern);
       
           // Process the right hand nodes recursively.
      @@ -148,18 +40,6 @@ function traverseIdentifierInPattern(rootPattern, referencer, callback) {
           }
       }
       
      -function isPattern(node) {
      -    var nodeType = node.type;
      -    return (
      -        nodeType === Syntax.Identifier ||
      -        nodeType === Syntax.ObjectPattern ||
      -        nodeType === Syntax.ArrayPattern ||
      -        nodeType === Syntax.SpreadElement ||
      -        nodeType === Syntax.RestElement ||
      -        nodeType === Syntax.AssignmentPattern
      -    );
      -}
      -
       // Importing ImportDeclaration.
       // http://people.mozilla.org/~jorendorff/es6-draft.html#sec-moduledeclarationinstantiation
       // https://github.com/estree/estree/blob/master/es6.md#importdeclaration
      @@ -168,7 +48,7 @@ function isPattern(node) {
       
       class Importer extends esrecurse.Visitor {
           constructor(declaration, referencer) {
      -        super();
      +        super(null, referencer.options);
               this.declaration = declaration;
               this.referencer = referencer;
           }
      @@ -211,8 +91,9 @@ class Importer extends esrecurse.Visitor {
       
       // Referencing variables and creating bindings.
       export default class Referencer extends esrecurse.Visitor {
      -    constructor(scopeManager) {
      -        super();
      +    constructor(options, scopeManager) {
      +        super(null, options);
      +        this.options = options;
               this.scopeManager = scopeManager;
               this.parent = null;
               this.isInnerMethodDefinition = false;
      @@ -275,6 +156,7 @@ export default class Referencer extends esrecurse.Visitor {
                   options = {processRightHandNodes: false}
               }
               traverseIdentifierInPattern(
      +            this.options,
                   node,
                   options.processRightHandNodes ? this : null,
                   callback);
      @@ -387,7 +269,7 @@ export default class Referencer extends esrecurse.Visitor {
                   this.visit(node.key);
               }
       
      -        isMethodDefinition = node.type === Syntax.MethodDefinition || node.method;
      +        isMethodDefinition = node.type === Syntax.MethodDefinition;
               if (isMethodDefinition) {
                   previous = this.pushInnerMethodDefinition(true);
               }
      @@ -457,7 +339,7 @@ export default class Referencer extends esrecurse.Visitor {
           }
       
           AssignmentExpression(node) {
      -        if (isPattern(node.left)) {
      +        if (PatternVisitor.isPattern(node.left)) {
                   if (node.operator === '=') {
                       this.visitPattern(node.left, {processRightHandNodes: true}, (pattern, info) => {
                           var maybeImplicitGlobal = null;
      @@ -512,6 +394,10 @@ export default class Referencer extends esrecurse.Visitor {
                   this.scopeManager.__nestModuleScope(node);
               }
       
      +        if (this.scopeManager.isStrictModeSupported() && this.scopeManager.isImpliedStrict()) {
      +            this.currentScope().isStrict = true;
      +        }
      +
               this.visitChildren(node);
               this.close(node);
           }
      @@ -521,7 +407,7 @@ export default class Referencer extends esrecurse.Visitor {
           }
       
           UpdateExpression(node) {
      -        if (isPattern(node.argument)) {
      +        if (PatternVisitor.isPattern(node.argument)) {
                   this.currentScope().__referencing(node.argument, Reference.RW, null);
               } else {
                   this.visitChildren(node);
      @@ -689,6 +575,10 @@ export default class Referencer extends esrecurse.Visitor {
               let local = (node.id || node.local);
               this.visit(local);
           }
      +
      +    MetaProperty() {
      +        // do nothing.
      +    }
       }
       
       /* vim: set sw=4 ts=4 et tw=80 : */
      diff --git a/tools/eslint/node_modules/escope/src/scope-manager.js b/tools/eslint/node_modules/escope/src/scope-manager.js
      index 63e66e0d8e234a..024535d7c2a94a 100644
      --- a/tools/eslint/node_modules/escope/src/scope-manager.js
      +++ b/tools/eslint/node_modules/escope/src/scope-manager.js
      @@ -50,6 +50,7 @@ export default class ScopeManager {
               this.__nodeToScope = new WeakMap();
               this.__currentScope = null;
               this.__options = options;
      +        this.__declaredVariables = new WeakMap();
           }
       
           __useDirective() {
      @@ -72,11 +73,33 @@ export default class ScopeManager {
               return this.__options.sourceType === 'module';
           }
       
      -    // Returns appropliate scope for this node.
      +    isImpliedStrict() {
      +        return this.__options.impliedStrict;
      +    }
      +
      +    isStrictModeSupported() {
      +        return this.__options.ecmaVersion >= 5;
      +    }
      +
      +    // Returns appropriate scope for this node.
           __get(node) {
               return this.__nodeToScope.get(node);
           }
       
      +    /**
      +     * Get variables that are declared by the node.
      +     *
      +     * "are declared by the node" means the node is same as `Variable.defs[].node` or `Variable.defs[].parent`.
      +     * If the node declares nothing, this method returns an empty array.
      +     * CAUTION: This API is experimental. See https://github.com/estools/escope/pull/69 for more details.
      +     *
      +     * @param {Esprima.Node} node - a node to get.
      +     * @returns {Variable[]} variables that declared by the node.
      +     */
      +    getDeclaredVariables(node) {
      +        return this.__declaredVariables.get(node) || [];
      +    }
      +
           /**
            * acquire scope from node.
            * @method ScopeManager#acquire
      diff --git a/tools/eslint/node_modules/escope/src/scope.js b/tools/eslint/node_modules/escope/src/scope.js
      index 57242d7c06399a..0e4d8c2d74f6c5 100644
      --- a/tools/eslint/node_modules/escope/src/scope.js
      +++ b/tools/eslint/node_modules/escope/src/scope.js
      @@ -56,7 +56,7 @@ function isStrictScope(scope, block, isMethodDefinition, useDirective) {
           }
       
           if (scope.type === 'function') {
      -        if (block.type === 'Program') {
      +        if (block.type === Syntax.Program) {
                   body = block;
               } else {
                   body = block.body;
      @@ -71,7 +71,7 @@ function isStrictScope(scope, block, isMethodDefinition, useDirective) {
           if (useDirective) {
               for (i = 0, iz = body.body.length; i < iz; ++i) {
                   stmt = body.body[i];
      -            if (stmt.type !== 'DirectiveStatement') {
      +            if (stmt.type !== Syntax.DirectiveStatement) {
                       break;
                   }
                   if (stmt.raw === '"use strict"' || stmt.raw === '\'use strict\'') {
      @@ -118,7 +118,7 @@ function registerScope(scopeManager, scope) {
       function shouldBeStatically(def) {
           return (
               (def.type === Variable.ClassName) ||
      -        (def.type === Variable.Variable && def.parent.kind !== "var")
      +        (def.type === Variable.Variable && def.parent.kind !== 'var')
           );
       }
       
      @@ -149,7 +149,7 @@ export default class Scope {
                * a few exceptions to this rule. With 'global' and 'with' scopes you
                * can only decide at runtime which variable a reference refers to.
                * Moreover, if 'eval()' is used in a scope, it might introduce new
      -         * bindings in this or its prarent scopes.
      +         * bindings in this or its parent scopes.
                * All those scopes are considered 'dynamic'.
                * @member {boolean} Scope#dynamic
                */
      @@ -227,6 +227,8 @@ export default class Scope {
                   this.upper.childScopes.push(this);
               }
       
      +        this.__declaredVariables = scopeManager.__declaredVariables;
      +
               registerScope(scopeManager, this);
           }
       
      @@ -315,6 +317,21 @@ export default class Scope {
               this.through.push(ref);
           }
       
      +    __addDeclaredVariablesOfNode(variable, node) {
      +        if (node == null) {
      +            return;
      +        }
      +
      +        var variables = this.__declaredVariables.get(node);
      +        if (variables == null) {
      +            variables = [];
      +            this.__declaredVariables.set(node, variables);
      +        }
      +        if (variables.indexOf(variable) === -1) {
      +            variables.push(variable);
      +        }
      +    }
      +
           __defineGeneric(name, set, variables, node, def) {
               var variable;
       
      @@ -327,6 +344,10 @@ export default class Scope {
       
               if (def) {
                   variable.defs.push(def);
      +            if (def.type !== Variable.TDZ) {
      +                this.__addDeclaredVariablesOfNode(variable, def.node);
      +                this.__addDeclaredVariablesOfNode(variable, def.parent);
      +            }
               }
               if (node) {
                   variable.identifiers.push(node);
      diff --git a/tools/eslint/node_modules/escope/third_party/espree.js b/tools/eslint/node_modules/escope/third_party/espree.js
      index 26df9ee6ae621e..2f68051de6419c 100644
      --- a/tools/eslint/node_modules/escope/third_party/espree.js
      +++ b/tools/eslint/node_modules/escope/third_party/espree.js
      @@ -47,75 +47,9 @@ module.exports = function (code) {
               // top-level errors array
               tolerant: true,
       
      -        // specify parsing features (default only has blockBindings: true)
      -        ecmaFeatures: {
      -
      -            // enable parsing of arrow functions
      -            arrowFunctions: true,
      -
      -            // enable parsing of let/const
      -            blockBindings: true,
      -
      -            // enable parsing of destructured arrays and objects
      -            destructuring: true,
      -
      -            // enable parsing of regular expression y flag
      -            regexYFlag: true,
      -
      -            // enable parsing of regular expression u flag
      -            regexUFlag: true,
      -
      -            // enable parsing of template strings
      -            templateStrings: true,
      -
      -            // enable parsing of binary literals
      -            binaryLiterals: true,
      -
      -            // enable parsing of ES6 octal literals
      -            octalLiterals: true,
      -
      -            // enable parsing unicode code point escape sequences
      -            unicodeCodePointEscapes: true,
      -
      -            // enable parsing of default parameters
      -            defaultParams: true,
      -
      -            // enable parsing of rest parameters
      -            restParams: true,
      -
      -            // enable parsing of for-of statement
      -            forOf: true,
      -
      -            // enable parsing computed object literal properties
      -            objectLiteralComputedProperties: true,
      -
      -            // enable parsing of shorthand object literal methods
      -            objectLiteralShorthandMethods: true,
      -
      -            // enable parsing of shorthand object literal properties
      -            objectLiteralShorthandProperties: true,
      -
      -            // Allow duplicate object literal properties (except '__proto__')
      -            objectLiteralDuplicateProperties: true,
      -
      -            // enable parsing of generators/yield
      -            generators: true,
      -
      -            // enable parsing spread operator
      -            spread: true,
      -
      -            // enable parsing classes
      -            classes: true,
      -
      -            // enable parsing of modules
      -            modules: true,
      -
      -            // enable React JSX parsing
      -            jsx: true,
      -
      -            // enable return in global scope
      -            globalReturn: true
      -        }
      +        // enable es6 features.
      +        ecmaVersion: 6,
      +        sourceType: "module"
           });
       };
       
      diff --git a/tools/eslint/node_modules/espree/README.md b/tools/eslint/node_modules/espree/README.md
      index b6c2001f1168ed..80ca0482bf62f3 100644
      --- a/tools/eslint/node_modules/espree/README.md
      +++ b/tools/eslint/node_modules/espree/README.md
      @@ -1,16 +1,6 @@
       # Espree
       
      -Espree is an actively-maintained fork Esprima, a high performance,
      -standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm)
      -parser written in ECMAScript (also popularly known as
      -[JavaScript](http://en.wikipedia.org/wiki/JavaScript)).
      -
      -## Features
      -
      -- Full support for ECMAScript 5.1 ([ECMA-262](http://www.ecma-international.org/publications/standards/Ecma-262.htm))
      -- Implements [ESTree](https://github.com/estree/estree) (both ES5 and ES6 specs) as the AST format.
      -- Optional tracking of syntax node location (index-based and line-column)
      -- Heavily tested and battle-hardened by inclusion in [ESLint](http://eslint.org)
      +Espree started out as a fork of [Esprima](http://esprima.org) v1.2.2, the last stable published released of Esprima before work on ECMAScript 6 began. Espree is now built on top of [Acorn](https://github.com/ternjs/acorn), which has a modular architecture that allows extension of core functionality. The goal of Espree is to produce output that is similar to Esprima with a similar API so that it can be used in place of Esprima.
       
       ## Usage
       
      @@ -42,7 +32,7 @@ var ast = espree.parse(code, {
           loc: true,
       
           // create a top-level comments array containing all comments
      -    comments: true,
      +    comment: true,
       
           // attach comments to the closest relevant node as leadingComments and
           // trailingComments
      @@ -51,113 +41,39 @@ var ast = espree.parse(code, {
           // create a top-level tokens array containing all tokens
           tokens: true,
       
      -    // try to continue parsing if an error is encountered, store errors in a
      -    // top-level errors array
      -    tolerant: true,
      -
      -    // specify parsing features (default only has blockBindings: true)
      -    // setting this option replaces the default values
      -    ecmaFeatures: {
      -
      -        // enable parsing of arrow functions
      -        arrowFunctions: true,
      -
      -        // enable parsing of let/const
      -        blockBindings: true,
      -
      -        // enable parsing of destructured arrays and objects
      -        destructuring: true,
      -
      -        // enable parsing of regular expression y flag
      -        regexYFlag: true,
      -
      -        // enable parsing of regular expression u flag
      -        regexUFlag: true,
      -
      -        // enable parsing of template strings
      -        templateStrings: true,
      -
      -        // enable parsing of binary literals
      -        binaryLiterals: true,
      -
      -        // enable parsing of ES6 octal literals
      -        octalLiterals: true,
      -
      -        // enable parsing unicode code point escape sequences
      -        unicodeCodePointEscapes: true,
      -
      -        // enable parsing of default parameters
      -        defaultParams: true,
      -
      -        // enable parsing of rest parameters
      -        restParams: true,
      -
      -        // enable parsing of for-of statement
      -        forOf: true,
      -
      -        // enable parsing computed object literal properties
      -        objectLiteralComputedProperties: true,
      -
      -        // enable parsing of shorthand object literal methods
      -        objectLiteralShorthandMethods: true,
      -
      -        // enable parsing of shorthand object literal properties
      -        objectLiteralShorthandProperties: true,
      -
      -        // Allow duplicate object literal properties (except '__proto__')
      -        objectLiteralDuplicateProperties: true,
      +    // specify the language version (3, 5, 6, or 7, default is 5)
      +    ecmaVersion: 5,
       
      -        // enable parsing of generators/yield
      -        generators: true,
      +    // specify which type of script you're parsing (script or module, default is script)
      +    sourceType: "script",
       
      -        // enable parsing spread operator
      -        spread: true,
      -
      -        // enable super in functions
      -        superInFunctions: true,
      -
      -        // enable parsing classes
      -        classes: true,
      -
      -        // enable parsing of modules
      -        modules: true,
      +    // specify additional language features
      +    ecmaFeatures: {
       
      -        // enable React JSX parsing
      +        // enable JSX parsing
               jsx: true,
       
               // enable return in global scope
      -        globalReturn: true
      +        globalReturn: true,
      +
      +        // enable implied strict mode (if ecmaVersion >= 5)
      +        impliedStrict: true,
      +
      +        // allow experimental object rest/spread
      +        experimentalObjectRestSpread: true
           }
       });
       ```
       
      -## Plans
      -
      -Espree starts as a fork of Esprima v1.2.2, the last stable published released of Esprima before work on ECMAScript 6 began. Espree's first version is therefore v1.2.2 and is 100% compatible with Esprima v1.2.2 as a drop-in replacement. The version number will be incremented based on [semantic versioning](http://semver.org/) as features and bug fixes are added.
      -
      -The immediate plans are:
      -
      -1. Move away from giant files and move towards small, modular files that are easier to manage.
      -1. Move towards CommonJS for all files and use browserify to create browser bundles.
      -1. Support ECMAScript version filtering, allowing users to specify which version the parser should work in (similar to Acorn's `ecmaVersion` property).
      -1. Add tests to track comment attachment.
      -1. Add well-thought-out features that are useful for tools developers.
      -1. Add full support for ECMAScript 6.
      -1. Add optional parsing of JSX.
      -
       ## Esprima Compatibility Going Forward
       
      -The primary goal is to produce the exact same AST structure as Esprima and Acorn, and that takes precedence over anything else. (The AST structure being the ESTree API with JSX extensions.) Separate from that, Espree may deviate from what Esprima outputs in terms of where and how comments are attached, as well as what additional information is available on AST nodes. That is to say, Espree may add more things to the AST nodes than Esprima does but the overall AST structure produced will be the same.
      +The primary goal is to produce the exact same AST structure and tokens as Esprima, and that takes precedence over anything else. (The AST structure being the [ESTree](https://github.com/estree/estree) API with JSX extensions.) Separate from that, Espree may deviate from what Esprima outputs in terms of where and how comments are attached, as well as what additional information is available on AST nodes. That is to say, Espree may add more things to the AST nodes than Esprima does but the overall AST structure produced will be the same.
       
       Espree may also deviate from Esprima in the interface it exposes.
       
      -## Frequent and Incremental Releases
      -
      -Espree will not do giant releases. Releases will happen periodically as changes are made and incremental releases will be made towards larger goals. For instance, we will not have one big release for ECMAScript 6 support. Instead, we will implement ECMAScript 6, piece-by-piece, hiding those pieces behind an `ecmaFeatures` property that allows you to opt-in to use those features.
      -
       ## Contributing
       
      -Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing.html), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/espree/issues).
      +Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/espree/issues).
       
       Espree is licensed under a permissive BSD 2-clause license.
       
      @@ -167,60 +83,57 @@ Espree is licensed under a permissive BSD 2-clause license.
       * `npm run lint` - run all linting
       * `npm run browserify` - creates a version of Espree that is usable in a browser
       
      +## Differences from Espree 2.x
      +
      +* The `tokenize()` method does not use `ecmaFeatures`. Any string will be tokenized completely based on ECMAScript 6 semantics.
      +* Trailing whitespace no longer is counted as part of a node.
      +* `let` and `const` declarations are no longer parsed by default. You must opt-in using `ecmaFeatures.blockBindings`.
      +* The `esparse` and `esvalidate` binary scripts have been removed.
      +* There is no `tolerant` option. We will investigate adding this back in the future.
      +
       ## Known Incompatibilities
       
       In an effort to help those wanting to transition from other parsers to Espree, the following is a list of noteworthy incompatibilities with other parsers. These are known differences that we do not intend to change.
       
       ### Esprima 1.2.2
       
      -* None.
      -
      -### Esprima/Harmony Branch
      +* Esprima counts trailing whitespace as part of each AST node while Espree does not. In Espree, the end of a node is where the last token occurs.
      +* Espree does not parse `let` and `const` declarations by default.
      +* Error messages returned for parsing errors are different.
      +* There are two addition properties on every node and token: `start` and `end`. These represent the same data as `range` and are used internally by Acorn.
       
      -* Esprima/Harmony uses a different comment attachment algorithm that results in some comments being added in different places than Espree. The algorithm Espree uses is the same one used in Esprima 1.2.2.
      -* Espree uses ESTree format for the AST nodes whereas Esprima/Harmony uses a nonstandard format.
      +### Esprima 2.x
       
      -### Esprima-FB
      -
      -* All Esprima/Harmony incompatibilities.
      +* Esprima 2.x uses a different comment attachment algorithm that results in some comments being added in different places than Espree. The algorithm Espree uses is the same one used in Esprima 1.2.2.
       
       ## Frequently Asked Questions
       
      -### Why are you forking Esprima?
      +### Why another parser
       
      -[ESLint](http://eslint.org) has been relying on Esprima as its parser from the beginning. While that was fine when the JavaScript language was evolving slowly, the pace of development has increased dramatically and Esprima has fallen behind. ESLint, like many other tools reliant on Esprima, has been stuck in using new JavaScript language features until Esprima updates, and that has caused our users frustration.
      +[ESLint](http://eslint.org) had been relying on Esprima as its parser from the beginning. While that was fine when the JavaScript language was evolving slowly, the pace of development increased dramatically and Esprima had fallen behind. ESLint, like many other tools reliant on Esprima, has been stuck in using new JavaScript language features until Esprima updates, and that caused our users frustration.
       
       We decided the only way for us to move forward was to create our own parser, bringing us inline with JSHint and JSLint, and allowing us to keep implementing new features as we need them. We chose to fork Esprima instead of starting from scratch in order to move as quickly as possible with a compatible API.
       
      -### Have you tried working with Esprima?
      -
      -Yes. Since the start of ESLint, we've regularly filed bugs and feature requests with Esprima. Unfortunately, we've been unable to make much progress towards getting our needs addressed.
      +With Espree 2.0.0, we are no longer a fork of Esprima but rather a translation layer between Acorn and Esprima syntax. This allows us to put work back into a community-supported parser (Acorn) that is continuing to grow and evolve while maintaining an Esprima-compatible parser for those utilities still built on Esprima.
       
      -We are actively working with Esprima as part of its adoption by the jQuery Foundation. We are hoping to reconcile Espree with Esprima at some point in the future, but there are some different philosophies around how the projects work that need to be worked through. We're committed to a goal of merging Espree back into Esprima, or at the very least, to have Espree track Esprima as an upstream target so there's no duplication of effort. In the meantime, we will continue to update and maintain Espree.
      -
      -### Why don't you just use Facebook's Esprima fork?
      +### Have you tried working with Esprima?
       
      -`esprima-fb` is Facebook's Esprima fork that features JSX and Flow type annotations. We tried working with `esprima-fb` in our evaluation of how to support ECMAScript 6 and JSX in ESLint. Unfortunately, we were hampered by bugs that were part of Esprima (not necessarily Facebook's code). Since `esprima-fb` tracks the Esprima Harmony branch, that means we still were unable to get fixes or features we needed in a timely manner.
      +Yes. Since the start of ESLint, we've regularly filed bugs and feature requests with Esprima and will continue to do so. However, there are some different philosophies around how the projects work that need to be worked through. The initial goal was to have Espree track Esprima and eventually merge the two back together, but we ultimately decided that building on top of Acorn was a better choice due to Acorn's plugin support.
       
       ### Why don't you just use Acorn?
       
       Acorn is a great JavaScript parser that produces an AST that is compatible with Esprima. Unfortunately, ESLint relies on more than just the AST to do its job. It relies on Esprima's tokens and comment attachment features to get a complete picture of the source code. We investigated switching to Acorn, but the inconsistencies between Esprima and Acorn created too much work for a project like ESLint.
       
      -We expect there are other tools like ESLint that rely on more than just the AST produced by Esprima, and so a drop-in replacement will help those projects as well as ESLint.
      +We are building on top of Acorn, however, so that we can contribute back and help make Acorn even better.
       
       ### What ECMAScript 6 features do you support?
       
       All of them.
       
      -### Why use Espree instead of Esprima?
      +### What ECMAScript 7 features do you support?
       
      -* Faster turnaround time on bug fixes
      -* More frequent releases
      -* Better communication and responsiveness to issues
      -* Ongoing development
      +There is only one ECMAScript 7 syntax change: the exponentiation operator. Espree supports this.
       
      -### Why use Espree instead of Esprima-FB?
      +### How do you determine which experimental features to support?
       
      -* Opt-in to just the ECMAScript 6 features you want
      -* JSX support is off by default, so you're not forced to use it to use ECMAScript 6
      -* Stricter ECMAScript 6 support
      +In general, we do not support experimental JavaScript features. We may make exceptions from time to time depending on the maturity of the features.
      diff --git a/tools/eslint/node_modules/espree/bin/esparse.js b/tools/eslint/node_modules/espree/bin/esparse.js
      deleted file mode 100755
      index 4a9984aab05c9d..00000000000000
      --- a/tools/eslint/node_modules/espree/bin/esparse.js
      +++ /dev/null
      @@ -1,127 +0,0 @@
      -#!/usr/bin/env node
      -/*
      -  Copyright (C) 2012 Ariya Hidayat 
      -  Copyright (C) 2011 Ariya Hidayat 
      -
      -  Redistribution and use in source and binary forms, with or without
      -  modification, are permitted provided that the following conditions are met:
      -
      -    * Redistributions of source code must retain the above copyright
      -      notice, this list of conditions and the following disclaimer.
      -    * Redistributions in binary form must reproduce the above copyright
      -      notice, this list of conditions and the following disclaimer in the
      -      documentation and/or other materials provided with the distribution.
      -
      -  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
      -  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      -  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      -  ARE DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
      -  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
      -  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
      -  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      -  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      -  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
      -  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      -*/
      -
      -/*jslint sloppy:true node:true rhino:true */
      -
      -var fs, espree, fname, content, options, syntax;
      -
      -if (typeof require === 'function') {
      -    fs = require('fs');
      -    espree = require('espree');
      -} else if (typeof load === 'function') {
      -    try {
      -        load('espree.js');
      -    } catch (e) {
      -        load('../espree.js');
      -    }
      -}
      -
      -// Shims to Node.js objects when running under Rhino.
      -if (typeof console === 'undefined' && typeof process === 'undefined') {
      -    console = { log: print };
      -    fs = { readFileSync: readFile };
      -    process = { argv: arguments, exit: quit };
      -    process.argv.unshift('esparse.js');
      -    process.argv.unshift('rhino');
      -}
      -
      -function showUsage() {
      -    console.log('Usage:');
      -    console.log('   esparse [options] file.js');
      -    console.log();
      -    console.log('Available options:');
      -    console.log();
      -    console.log('  --comment      Gather all line and block comments in an array');
      -    console.log('  --loc          Include line-column location info for each syntax node');
      -    console.log('  --range        Include index-based range for each syntax node');
      -    console.log('  --raw          Display the raw value of literals');
      -    console.log('  --tokens       List all tokens in an array');
      -    console.log('  --tolerant     Tolerate errors on a best-effort basis (experimental)');
      -    console.log('  -v, --version  Shows program version');
      -    console.log();
      -    process.exit(1);
      -}
      -
      -if (process.argv.length <= 2) {
      -    showUsage();
      -}
      -
      -options = {};
      -
      -process.argv.splice(2).forEach(function (entry) {
      -
      -    if (entry === '-h' || entry === '--help') {
      -        showUsage();
      -    } else if (entry === '-v' || entry === '--version') {
      -        console.log('ECMAScript Parser (using espree version', espree.version, ')');
      -        console.log();
      -        process.exit(0);
      -    } else if (entry === '--comment') {
      -        options.comment = true;
      -    } else if (entry === '--loc') {
      -        options.loc = true;
      -    } else if (entry === '--range') {
      -        options.range = true;
      -    } else if (entry === '--raw') {
      -        options.raw = true;
      -    } else if (entry === '--tokens') {
      -        options.tokens = true;
      -    } else if (entry === '--tolerant') {
      -        options.tolerant = true;
      -    } else if (entry.slice(0, 2) === '--') {
      -        console.log('Error: unknown option ' + entry + '.');
      -        process.exit(1);
      -    } else if (typeof fname === 'string') {
      -        console.log('Error: more than one input file.');
      -        process.exit(1);
      -    } else {
      -        fname = entry;
      -    }
      -});
      -
      -if (typeof fname !== 'string') {
      -    console.log('Error: no input file.');
      -    process.exit(1);
      -}
      -
      -// Special handling for regular expression literal since we need to
      -// convert it to a string literal, otherwise it will be decoded
      -// as object "{}" and the regular expression would be lost.
      -function adjustRegexLiteral(key, value) {
      -    if (key === 'value' && value instanceof RegExp) {
      -        value = value.toString();
      -    }
      -    return value;
      -}
      -
      -try {
      -    content = fs.readFileSync(fname, 'utf-8');
      -    syntax = espree.parse(content, options);
      -    console.log(JSON.stringify(syntax, adjustRegexLiteral, 4));
      -} catch (e) {
      -    console.log('Error: ' + e.message);
      -    process.exit(1);
      -}
      diff --git a/tools/eslint/node_modules/espree/bin/esvalidate.js b/tools/eslint/node_modules/espree/bin/esvalidate.js
      deleted file mode 100755
      index 7631d0a29d6a0e..00000000000000
      --- a/tools/eslint/node_modules/espree/bin/esvalidate.js
      +++ /dev/null
      @@ -1,199 +0,0 @@
      -#!/usr/bin/env node
      -/*
      -  Copyright (C) 2012 Ariya Hidayat 
      -
      -  Redistribution and use in source and binary forms, with or without
      -  modification, are permitted provided that the following conditions are met:
      -
      -    * Redistributions of source code must retain the above copyright
      -      notice, this list of conditions and the following disclaimer.
      -    * Redistributions in binary form must reproduce the above copyright
      -      notice, this list of conditions and the following disclaimer in the
      -      documentation and/or other materials provided with the distribution.
      -
      -  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
      -  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      -  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      -  ARE DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
      -  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
      -  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
      -  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      -  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      -  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
      -  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      -*/
      -
      -/*jslint sloppy:true plusplus:true node:true rhino:true */
      -/*global phantom:true */
      -
      -var fs, system, espree, options, fnames, count;
      -
      -if (typeof espree === 'undefined') {
      -    // PhantomJS can only require() relative files
      -    if (typeof phantom === 'object') {
      -        fs = require('fs');
      -        system = require('system');
      -        espree = require('./espree');
      -    } else if (typeof require === 'function') {
      -        fs = require('fs');
      -        espree = require('espree');
      -    } else if (typeof load === 'function') {
      -        try {
      -            load('espree.js');
      -        } catch (e) {
      -            load('../espree.js');
      -        }
      -    }
      -}
      -
      -// Shims to Node.js objects when running under PhantomJS 1.7+.
      -if (typeof phantom === 'object') {
      -    fs.readFileSync = fs.read;
      -    process = {
      -        argv: [].slice.call(system.args),
      -        exit: phantom.exit
      -    };
      -    process.argv.unshift('phantomjs');
      -}
      -
      -// Shims to Node.js objects when running under Rhino.
      -if (typeof console === 'undefined' && typeof process === 'undefined') {
      -    console = { log: print };
      -    fs = { readFileSync: readFile };
      -    process = { argv: arguments, exit: quit };
      -    process.argv.unshift('esvalidate.js');
      -    process.argv.unshift('rhino');
      -}
      -
      -function showUsage() {
      -    console.log('Usage:');
      -    console.log('   esvalidate [options] file.js');
      -    console.log();
      -    console.log('Available options:');
      -    console.log();
      -    console.log('  --format=type  Set the report format, plain (default) or junit');
      -    console.log('  -v, --version  Print program version');
      -    console.log();
      -    process.exit(1);
      -}
      -
      -if (process.argv.length <= 2) {
      -    showUsage();
      -}
      -
      -options = {
      -    format: 'plain'
      -};
      -
      -fnames = [];
      -
      -process.argv.splice(2).forEach(function (entry) {
      -
      -    if (entry === '-h' || entry === '--help') {
      -        showUsage();
      -    } else if (entry === '-v' || entry === '--version') {
      -        console.log('ECMAScript Validator (using espree version', espree.version, ')');
      -        console.log();
      -        process.exit(0);
      -    } else if (entry.slice(0, 9) === '--format=') {
      -        options.format = entry.slice(9);
      -        if (options.format !== 'plain' && options.format !== 'junit') {
      -            console.log('Error: unknown report format ' + options.format + '.');
      -            process.exit(1);
      -        }
      -    } else if (entry.slice(0, 2) === '--') {
      -        console.log('Error: unknown option ' + entry + '.');
      -        process.exit(1);
      -    } else {
      -        fnames.push(entry);
      -    }
      -});
      -
      -if (fnames.length === 0) {
      -    console.log('Error: no input file.');
      -    process.exit(1);
      -}
      -
      -if (options.format === 'junit') {
      -    console.log('');
      -    console.log('');
      -}
      -
      -count = 0;
      -fnames.forEach(function (fname) {
      -    var content, timestamp, syntax, name;
      -    try {
      -        content = fs.readFileSync(fname, 'utf-8');
      -
      -        if (content[0] === '#' && content[1] === '!') {
      -            content = '//' + content.substr(2, content.length);
      -        }
      -
      -        timestamp = Date.now();
      -        syntax = espree.parse(content, { tolerant: true });
      -
      -        if (options.format === 'junit') {
      -
      -            name = fname;
      -            if (name.lastIndexOf('/') >= 0) {
      -                name = name.slice(name.lastIndexOf('/') + 1);
      -            }
      -
      -            console.log('');
      -
      -            syntax.errors.forEach(function (error) {
      -                var msg = error.message;
      -                msg = msg.replace(/^Line\ [0-9]*\:\ /, '');
      -                console.log('  ');
      -                console.log('    ' +
      -                    error.message + '(' + name + ':' + error.lineNumber + ')' +
      -                    '');
      -                console.log('  ');
      -            });
      -
      -            console.log('');
      -
      -        } else if (options.format === 'plain') {
      -
      -            syntax.errors.forEach(function (error) {
      -                var msg = error.message;
      -                msg = msg.replace(/^Line\ [0-9]*\:\ /, '');
      -                msg = fname + ':' + error.lineNumber + ': ' + msg;
      -                console.log(msg);
      -                ++count;
      -            });
      -
      -        }
      -    } catch (e) {
      -        ++count;
      -        if (options.format === 'junit') {
      -            console.log('');
      -            console.log(' ');
      -            console.log(' ' +
      -                e.message + '(' + fname + ((e.lineNumber) ? ':' + e.lineNumber : '') +
      -                ')');
      -            console.log(' ');
      -            console.log('');
      -        } else {
      -            console.log('Error: ' + e.message);
      -        }
      -    }
      -});
      -
      -if (options.format === 'junit') {
      -    console.log('');
      -}
      -
      -if (count > 0) {
      -    process.exit(1);
      -}
      -
      -if (count === 0 && typeof phantom === 'object') {
      -    process.exit(0);
      -}
      diff --git a/tools/eslint/node_modules/espree/espree.js b/tools/eslint/node_modules/espree/espree.js
      index 7ccf2dd2982ef1..581475ede0f5a5 100644
      --- a/tools/eslint/node_modules/espree/espree.js
      +++ b/tools/eslint/node_modules/espree/espree.js
      @@ -1,5318 +1,545 @@
      -/*
      -Copyright (C) 2015 Fred K. Schott 
      -Copyright (C) 2013 Ariya Hidayat 
      -Copyright (C) 2013 Thaddee Tyl 
      -Copyright (C) 2013 Mathias Bynens 
      -Copyright (C) 2012 Ariya Hidayat 
      -Copyright (C) 2012 Mathias Bynens 
      -Copyright (C) 2012 Joost-Wim Boekesteijn 
      -Copyright (C) 2012 Kris Kowal 
      -Copyright (C) 2012 Yusuke Suzuki 
      -Copyright (C) 2012 Arpad Borsos 
      -Copyright (C) 2011 Ariya Hidayat 
      -
      -Redistribution and use in source and binary forms, with or without
      -modification, are permitted provided that the following conditions are met:
      -
      -* Redistributions of source code must retain the above copyright
      -  notice, this list of conditions and the following disclaimer.
      -* Redistributions in binary form must reproduce the above copyright
      -  notice, this list of conditions and the following disclaimer in the
      -  documentation and/or other materials provided with the distribution.
      -
      -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
      -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      -ARE DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
      -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
      -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
      -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
      -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      -*/
      -/*eslint no-undefined:0, no-use-before-define: 0*/
      -
      -"use strict";
      -
      -var syntax = require("./lib/syntax"),
      -    tokenInfo = require("./lib/token-info"),
      -    astNodeTypes = require("./lib/ast-node-types"),
      -    astNodeFactory = require("./lib/ast-node-factory"),
      -    defaultFeatures = require("./lib/features"),
      -    Messages = require("./lib/messages"),
      -    XHTMLEntities = require("./lib/xhtml-entities"),
      -    StringMap = require("./lib/string-map"),
      -    commentAttachment = require("./lib/comment-attachment");
      -
      -var Token = tokenInfo.Token,
      -    TokenName = tokenInfo.TokenName,
      -    FnExprTokens = tokenInfo.FnExprTokens,
      -    Regex = syntax.Regex,
      -    PropertyKind,
      -    source,
      -    strict,
      -    index,
      -    lineNumber,
      -    lineStart,
      -    length,
      -    lookahead,
      -    state,
      -    extra;
      -
      -PropertyKind = {
      -    Data: 1,
      -    Get: 2,
      -    Set: 4
      -};
      -
      -
      -// Ensure the condition is true, otherwise throw an error.
      -// This is only to have a better contract semantic, i.e. another safety net
      -// to catch a logic error. The condition shall be fulfilled in normal case.
      -// Do NOT use this to enforce a certain condition on any user input.
      -
      -function assert(condition, message) {
      -    /* istanbul ignore if */
      -    if (!condition) {
      -        throw new Error("ASSERT: " + message);
      -    }
      -}
      -
      -// 7.4 Comments
      -
      -function addComment(type, value, start, end, loc) {
      -    var comment;
      -
      -    assert(typeof start === "number", "Comment must have valid position");
      -
      -    // Because the way the actual token is scanned, often the comments
      -    // (if any) are skipped twice during the lexical analysis.
      -    // Thus, we need to skip adding a comment if the comment array already
      -    // handled it.
      -    if (state.lastCommentStart >= start) {
      -        return;
      -    }
      -    state.lastCommentStart = start;
      -
      -    comment = {
      -        type: type,
      -        value: value
      -    };
      -    if (extra.range) {
      -        comment.range = [start, end];
      -    }
      -    if (extra.loc) {
      -        comment.loc = loc;
      -    }
      -    extra.comments.push(comment);
      -
      -    if (extra.attachComment) {
      -        commentAttachment.addComment(comment);
      -    }
      -}
      -
      -function skipSingleLineComment(offset) {
      -    var start, loc, ch, comment;
      -
      -    start = index - offset;
      -    loc = {
      -        start: {
      -            line: lineNumber,
      -            column: index - lineStart - offset
      -        }
      -    };
      -
      -    while (index < length) {
      -        ch = source.charCodeAt(index);
      -        ++index;
      -        if (syntax.isLineTerminator(ch)) {
      -            if (extra.comments) {
      -                comment = source.slice(start + offset, index - 1);
      -                loc.end = {
      -                    line: lineNumber,
      -                    column: index - lineStart - 1
      -                };
      -                addComment("Line", comment, start, index - 1, loc);
      -            }
      -            if (ch === 13 && source.charCodeAt(index) === 10) {
      -                ++index;
      -            }
      -            ++lineNumber;
      -            lineStart = index;
      -            return;
      -        }
      -    }
      -
      -    if (extra.comments) {
      -        comment = source.slice(start + offset, index);
      -        loc.end = {
      -            line: lineNumber,
      -            column: index - lineStart
      -        };
      -        addComment("Line", comment, start, index, loc);
      -    }
      -}
      -
      -function skipMultiLineComment() {
      -    var start, loc, ch, comment;
      -
      -    if (extra.comments) {
      -        start = index - 2;
      -        loc = {
      -            start: {
      -                line: lineNumber,
      -                column: index - lineStart - 2
      -            }
      -        };
      -    }
      -
      -    while (index < length) {
      -        ch = source.charCodeAt(index);
      -        if (syntax.isLineTerminator(ch)) {
      -            if (ch === 0x0D && source.charCodeAt(index + 1) === 0x0A) {
      -                ++index;
      -            }
      -            ++lineNumber;
      -            ++index;
      -            lineStart = index;
      -            if (index >= length) {
      -                throwError({}, Messages.UnexpectedToken, "ILLEGAL");
      -            }
      -        } else if (ch === 0x2A) {
      -            // Block comment ends with "*/".
      -            if (source.charCodeAt(index + 1) === 0x2F) {
      -                ++index;
      -                ++index;
      -                if (extra.comments) {
      -                    comment = source.slice(start + 2, index - 2);
      -                    loc.end = {
      -                        line: lineNumber,
      -                        column: index - lineStart
      -                    };
      -                    addComment("Block", comment, start, index, loc);
      -                }
      -                return;
      -            }
      -            ++index;
      -        } else {
      -            ++index;
      -        }
      -    }
      -
      -    throwError({}, Messages.UnexpectedToken, "ILLEGAL");
      -}
      -
      -function skipComment() {
      -    var ch, start;
      -
      -    start = (index === 0);
      -    while (index < length) {
      -        ch = source.charCodeAt(index);
      -
      -        if (syntax.isWhiteSpace(ch)) {
      -            ++index;
      -        } else if (syntax.isLineTerminator(ch)) {
      -            ++index;
      -            if (ch === 0x0D && source.charCodeAt(index) === 0x0A) {
      -                ++index;
      -            }
      -            ++lineNumber;
      -            lineStart = index;
      -            start = true;
      -        } else if (ch === 0x2F) { // U+002F is "/"
      -            ch = source.charCodeAt(index + 1);
      -            if (ch === 0x2F) {
      -                ++index;
      -                ++index;
      -                skipSingleLineComment(2);
      -                start = true;
      -            } else if (ch === 0x2A) {  // U+002A is "*"
      -                ++index;
      -                ++index;
      -                skipMultiLineComment();
      -            } else {
      -                break;
      -            }
      -        } else if (start && ch === 0x2D) { // U+002D is "-"
      -            // U+003E is ">"
      -            if ((source.charCodeAt(index + 1) === 0x2D) && (source.charCodeAt(index + 2) === 0x3E)) {
      -                // "-->" is a single-line comment
      -                index += 3;
      -                skipSingleLineComment(3);
      -            } else {
      -                break;
      -            }
      -        } else if (ch === 0x3C) { // U+003C is "<"
      -            if (source.slice(index + 1, index + 4) === "!--") {
      -                ++index; // `<`
      -                ++index; // `!`
      -                ++index; // `-`
      -                ++index; // `-`
      -                skipSingleLineComment(4);
      -            } else {
      -                break;
      -            }
      -        } else {
      -            break;
      -        }
      -    }
      -}
      -
      -function scanHexEscape(prefix) {
      -    var i, len, ch, code = 0;
      -
      -    len = (prefix === "u") ? 4 : 2;
      -    for (i = 0; i < len; ++i) {
      -        if (index < length && syntax.isHexDigit(source[index])) {
      -            ch = source[index++];
      -            code = code * 16 + "0123456789abcdef".indexOf(ch.toLowerCase());
      -        } else {
      -            return "";
      -        }
      -    }
      -    return String.fromCharCode(code);
      -}
      -
      -/**
      - * Scans an extended unicode code point escape sequence from source. Throws an
      - * error if the sequence is empty or if the code point value is too large.
      - * @returns {string} The string created by the Unicode escape sequence.
      - * @private
      - */
      -function scanUnicodeCodePointEscape() {
      -    var ch, code, cu1, cu2;
      -
      -    ch = source[index];
      -    code = 0;
      -
      -    // At least one hex digit is required.
      -    if (ch === "}") {
      -        throwError({}, Messages.UnexpectedToken, "ILLEGAL");
      -    }
      -
      -    while (index < length) {
      -        ch = source[index++];
      -        if (!syntax.isHexDigit(ch)) {
      -            break;
      -        }
      -        code = code * 16 + "0123456789abcdef".indexOf(ch.toLowerCase());
      -    }
      -
      -    if (code > 0x10FFFF || ch !== "}") {
      -        throwError({}, Messages.UnexpectedToken, "ILLEGAL");
      -    }
      -
      -    // UTF-16 Encoding
      -    if (code <= 0xFFFF) {
      -        return String.fromCharCode(code);
      -    }
      -    cu1 = ((code - 0x10000) >> 10) + 0xD800;
      -    cu2 = ((code - 0x10000) & 1023) + 0xDC00;
      -    return String.fromCharCode(cu1, cu2);
      -}
      -
      -function getEscapedIdentifier() {
      -    var ch, id;
      -
      -    ch = source.charCodeAt(index++);
      -    id = String.fromCharCode(ch);
      -
      -    // "\u" (U+005C, U+0075) denotes an escaped character.
      -    if (ch === 0x5C) {
      -        if (source.charCodeAt(index) !== 0x75) {
      -            throwError({}, Messages.UnexpectedToken, "ILLEGAL");
      -        }
      -        ++index;
      -        ch = scanHexEscape("u");
      -        if (!ch || ch === "\\" || !syntax.isIdentifierStart(ch.charCodeAt(0))) {
      -            throwError({}, Messages.UnexpectedToken, "ILLEGAL");
      -        }
      -        id = ch;
      -    }
      -
      -    while (index < length) {
      -        ch = source.charCodeAt(index);
      -        if (!syntax.isIdentifierPart(ch)) {
      -            break;
      -        }
      -        ++index;
      -        id += String.fromCharCode(ch);
      -
      -        // "\u" (U+005C, U+0075) denotes an escaped character.
      -        if (ch === 0x5C) {
      -            id = id.substr(0, id.length - 1);
      -            if (source.charCodeAt(index) !== 0x75) {
      -                throwError({}, Messages.UnexpectedToken, "ILLEGAL");
      -            }
      -            ++index;
      -            ch = scanHexEscape("u");
      -            if (!ch || ch === "\\" || !syntax.isIdentifierPart(ch.charCodeAt(0))) {
      -                throwError({}, Messages.UnexpectedToken, "ILLEGAL");
      -            }
      -            id += ch;
      -        }
      -    }
      -
      -    return id;
      -}
      -
      -function getIdentifier() {
      -    var start, ch;
      -
      -    start = index++;
      -    while (index < length) {
      -        ch = source.charCodeAt(index);
      -        if (ch === 0x5C) {
      -            // Blackslash (U+005C) marks Unicode escape sequence.
      -            index = start;
      -            return getEscapedIdentifier();
      -        }
      -        if (syntax.isIdentifierPart(ch)) {
      -            ++index;
      -        } else {
      -            break;
      -        }
      -    }
      -
      -    return source.slice(start, index);
      -}
      -
      -function scanIdentifier() {
      -    var start, id, type;
      -
      -    start = index;
      -
      -    // Backslash (U+005C) starts an escaped character.
      -    id = (source.charCodeAt(index) === 0x5C) ? getEscapedIdentifier() : getIdentifier();
      -
      -    // There is no keyword or literal with only one character.
      -    // Thus, it must be an identifier.
      -    if (id.length === 1) {
      -        type = Token.Identifier;
      -    } else if (syntax.isKeyword(id, strict, extra.ecmaFeatures)) {
      -        type = Token.Keyword;
      -    } else if (id === "null") {
      -        type = Token.NullLiteral;
      -    } else if (id === "true" || id === "false") {
      -        type = Token.BooleanLiteral;
      -    } else {
      -        type = Token.Identifier;
      -    }
      -
      -    return {
      -        type: type,
      -        value: id,
      -        lineNumber: lineNumber,
      -        lineStart: lineStart,
      -        range: [start, index]
      -    };
      -}
      -
      -
      -// 7.7 Punctuators
      -
      -function scanPunctuator() {
      -    var start = index,
      -        code = source.charCodeAt(index),
      -        code2,
      -        ch1 = source[index],
      -        ch2,
      -        ch3,
      -        ch4;
      -
      -    switch (code) {
      -        // Check for most common single-character punctuators.
      -        case 40:   // ( open bracket
      -        case 41:   // ) close bracket
      -        case 59:   // ; semicolon
      -        case 44:   // , comma
      -        case 91:   // [
      -        case 93:   // ]
      -        case 58:   // :
      -        case 63:   // ?
      -        case 126:  // ~
      -            ++index;
      -
      -            if (extra.tokenize && code === 40) {
      -                extra.openParenToken = extra.tokens.length;
      -            }
      -
      -            return {
      -                type: Token.Punctuator,
      -                value: String.fromCharCode(code),
      -                lineNumber: lineNumber,
      -                lineStart: lineStart,
      -                range: [start, index]
      -            };
      -
      -        case 123:  // { open curly brace
      -        case 125:  // } close curly brace
      -            ++index;
      -
      -            if (extra.tokenize && code === 123) {
      -                extra.openCurlyToken = extra.tokens.length;
      -            }
      -
      -            // lookahead2 function can cause tokens to be scanned twice and in doing so
      -            // would wreck the curly stack by pushing the same token onto the stack twice.
      -            // curlyLastIndex ensures each token is pushed or popped exactly once
      -            if (index > state.curlyLastIndex) {
      -                state.curlyLastIndex = index;
      -                if (code === 123) {
      -                    state.curlyStack.push("{");
      -                } else {
      -                    state.curlyStack.pop();
      -                }
      -            }
      -
      -            return {
      -                type: Token.Punctuator,
      -                value: String.fromCharCode(code),
      -                lineNumber: lineNumber,
      -                lineStart: lineStart,
      -                range: [start, index]
      -            };
      -
      -        default:
      -            code2 = source.charCodeAt(index + 1);
      -
      -            // "=" (char #61) marks an assignment or comparison operator.
      -            if (code2 === 61) {
      -                switch (code) {
      -                    case 37:  // %
      -                    case 38:  // &
      -                    case 42:  // *:
      -                    case 43:  // +
      -                    case 45:  // -
      -                    case 47:  // /
      -                    case 60:  // <
      -                    case 62:  // >
      -                    case 94:  // ^
      -                    case 124: // |
      -                        index += 2;
      -                        return {
      -                            type: Token.Punctuator,
      -                            value: String.fromCharCode(code) + String.fromCharCode(code2),
      -                            lineNumber: lineNumber,
      -                            lineStart: lineStart,
      -                            range: [start, index]
      -                        };
      -
      -                    case 33: // !
      -                    case 61: // =
      -                        index += 2;
      -
      -                        // !== and ===
      -                        if (source.charCodeAt(index) === 61) {
      -                            ++index;
      -                        }
      -                        return {
      -                            type: Token.Punctuator,
      -                            value: source.slice(start, index),
      -                            lineNumber: lineNumber,
      -                            lineStart: lineStart,
      -                            range: [start, index]
      -                        };
      -                    default:
      -                        break;
      -                }
      -            }
      -            break;
      -    }
      -
      -    // Peek more characters.
      -
      -    ch2 = source[index + 1];
      -    ch3 = source[index + 2];
      -    ch4 = source[index + 3];
      -
      -    // 4-character punctuator: >>>=
      -
      -    if (ch1 === ">" && ch2 === ">" && ch3 === ">") {
      -        if (ch4 === "=") {
      -            index += 4;
      -            return {
      -                type: Token.Punctuator,
      -                value: ">>>=",
      -                lineNumber: lineNumber,
      -                lineStart: lineStart,
      -                range: [start, index]
      -            };
      -        }
      -    }
      -
      -    // 3-character punctuators: === !== >>> <<= >>=
      -
      -    if (ch1 === ">" && ch2 === ">" && ch3 === ">") {
      -        index += 3;
      -        return {
      -            type: Token.Punctuator,
      -            value: ">>>",
      -            lineNumber: lineNumber,
      -            lineStart: lineStart,
      -            range: [start, index]
      -        };
      -    }
      -
      -    if (ch1 === "<" && ch2 === "<" && ch3 === "=") {
      -        index += 3;
      -        return {
      -            type: Token.Punctuator,
      -            value: "<<=",
      -            lineNumber: lineNumber,
      -            lineStart: lineStart,
      -            range: [start, index]
      -        };
      -    }
      -
      -    if (ch1 === ">" && ch2 === ">" && ch3 === "=") {
      -        index += 3;
      -        return {
      -            type: Token.Punctuator,
      -            value: ">>=",
      -            lineNumber: lineNumber,
      -            lineStart: lineStart,
      -            range: [start, index]
      -        };
      -    }
      -
      -    // The ... operator (spread, restParams, JSX, etc.)
      -    if (extra.ecmaFeatures.spread ||
      -        extra.ecmaFeatures.restParams ||
      -        (extra.ecmaFeatures.jsx && state.inJSXSpreadAttribute)
      -    ) {
      -        if (ch1 === "." && ch2 === "." && ch3 === ".") {
      -            index += 3;
      -            return {
      -                type: Token.Punctuator,
      -                value: "...",
      -                lineNumber: lineNumber,
      -                lineStart: lineStart,
      -                range: [start, index]
      -            };
      -        }
      -    }
      -
      -    // Other 2-character punctuators: ++ -- << >> && ||
      -    if (ch1 === ch2 && ("+-<>&|".indexOf(ch1) >= 0)) {
      -        index += 2;
      -        return {
      -            type: Token.Punctuator,
      -            value: ch1 + ch2,
      -            lineNumber: lineNumber,
      -            lineStart: lineStart,
      -            range: [start, index]
      -        };
      -    }
      -
      -    // the => for arrow functions
      -    if (extra.ecmaFeatures.arrowFunctions) {
      -        if (ch1 === "=" && ch2 === ">") {
      -            index += 2;
      -            return {
      -                type: Token.Punctuator,
      -                value: "=>",
      -                lineNumber: lineNumber,
      -                lineStart: lineStart,
      -                range: [start, index]
      -            };
      -        }
      -    }
      -
      -    if ("<>=!+-*%&|^/".indexOf(ch1) >= 0) {
      -        ++index;
      -        return {
      -            type: Token.Punctuator,
      -            value: ch1,
      -            lineNumber: lineNumber,
      -            lineStart: lineStart,
      -            range: [start, index]
      -        };
      -    }
      -
      -    if (ch1 === ".") {
      -        ++index;
      -        return {
      -            type: Token.Punctuator,
      -            value: ch1,
      -            lineNumber: lineNumber,
      -            lineStart: lineStart,
      -            range: [start, index]
      -        };
      -    }
      -
      -    throwError({}, Messages.UnexpectedToken, "ILLEGAL");
      -}
      -
      -// 7.8.3 Numeric Literals
      -
      -function scanHexLiteral(start) {
      -    var number = "";
      -
      -    while (index < length) {
      -        if (!syntax.isHexDigit(source[index])) {
      -            break;
      -        }
      -        number += source[index++];
      -    }
      -
      -    if (number.length === 0) {
      -        throwError({}, Messages.UnexpectedToken, "ILLEGAL");
      -    }
      -
      -    if (syntax.isIdentifierStart(source.charCodeAt(index))) {
      -        throwError({}, Messages.UnexpectedToken, "ILLEGAL");
      -    }
      -
      -    return {
      -        type: Token.NumericLiteral,
      -        value: parseInt("0x" + number, 16),
      -        lineNumber: lineNumber,
      -        lineStart: lineStart,
      -        range: [start, index]
      -    };
      -}
      -
      -function scanBinaryLiteral(start) {
      -    var ch, number = "";
      -
      -    while (index < length) {
      -        ch = source[index];
      -        if (ch !== "0" && ch !== "1") {
      -            break;
      -        }
      -        number += source[index++];
      -    }
      -
      -    if (number.length === 0) {
      -        // only 0b or 0B
      -        throwError({}, Messages.UnexpectedToken, "ILLEGAL");
      -    }
      -
      -
      -    if (index < length) {
      -        ch = source.charCodeAt(index);
      -        /* istanbul ignore else */
      -        if (syntax.isIdentifierStart(ch) || syntax.isDecimalDigit(ch)) {
      -            throwError({}, Messages.UnexpectedToken, "ILLEGAL");
      -        }
      -    }
      -
      -    return {
      -        type: Token.NumericLiteral,
      -        value: parseInt(number, 2),
      -        lineNumber: lineNumber,
      -        lineStart: lineStart,
      -        range: [start, index]
      -    };
      -}
      -
      -function scanOctalLiteral(prefix, start) {
      -    var number, octal;
      -
      -    if (syntax.isOctalDigit(prefix)) {
      -        octal = true;
      -        number = "0" + source[index++];
      -    } else {
      -        octal = false;
      -        ++index;
      -        number = "";
      -    }
      -
      -    while (index < length) {
      -        if (!syntax.isOctalDigit(source[index])) {
      -            break;
      -        }
      -        number += source[index++];
      -    }
      -
      -    if (!octal && number.length === 0) {
      -        // only 0o or 0O
      -        throwError({}, Messages.UnexpectedToken, "ILLEGAL");
      -    }
      -
      -    if (syntax.isIdentifierStart(source.charCodeAt(index)) || syntax.isDecimalDigit(source.charCodeAt(index))) {
      -        throwError({}, Messages.UnexpectedToken, "ILLEGAL");
      -    }
      -
      -    return {
      -        type: Token.NumericLiteral,
      -        value: parseInt(number, 8),
      -        octal: octal,
      -        lineNumber: lineNumber,
      -        lineStart: lineStart,
      -        range: [start, index]
      -    };
      -}
      -
      -function scanNumericLiteral() {
      -    var number, start, ch;
      -
      -    ch = source[index];
      -    assert(syntax.isDecimalDigit(ch.charCodeAt(0)) || (ch === "."),
      -        "Numeric literal must start with a decimal digit or a decimal point");
      -
      -    start = index;
      -    number = "";
      -    if (ch !== ".") {
      -        number = source[index++];
      -        ch = source[index];
      -
      -        // Hex number starts with "0x".
      -        // Octal number starts with "0".
      -        if (number === "0") {
      -            if (ch === "x" || ch === "X") {
      -                ++index;
      -                return scanHexLiteral(start);
      -            }
      -
      -            // Binary number in ES6 starts with '0b'
      -            if (extra.ecmaFeatures.binaryLiterals) {
      -                if (ch === "b" || ch === "B") {
      -                    ++index;
      -                    return scanBinaryLiteral(start);
      -                }
      -            }
      -
      -            if ((extra.ecmaFeatures.octalLiterals && (ch === "o" || ch === "O")) || syntax.isOctalDigit(ch)) {
      -                return scanOctalLiteral(ch, start);
      -            }
      -
      -            // decimal number starts with "0" such as "09" is illegal.
      -            if (ch && syntax.isDecimalDigit(ch.charCodeAt(0))) {
      -                throwError({}, Messages.UnexpectedToken, "ILLEGAL");
      -            }
      -        }
      -
      -        while (syntax.isDecimalDigit(source.charCodeAt(index))) {
      -            number += source[index++];
      -        }
      -        ch = source[index];
      -    }
      -
      -    if (ch === ".") {
      -        number += source[index++];
      -        while (syntax.isDecimalDigit(source.charCodeAt(index))) {
      -            number += source[index++];
      -        }
      -        ch = source[index];
      -    }
      -
      -    if (ch === "e" || ch === "E") {
      -        number += source[index++];
      -
      -        ch = source[index];
      -        if (ch === "+" || ch === "-") {
      -            number += source[index++];
      -        }
      -        if (syntax.isDecimalDigit(source.charCodeAt(index))) {
      -            while (syntax.isDecimalDigit(source.charCodeAt(index))) {
      -                number += source[index++];
      -            }
      -        } else {
      -            throwError({}, Messages.UnexpectedToken, "ILLEGAL");
      -        }
      -    }
      -
      -    if (syntax.isIdentifierStart(source.charCodeAt(index))) {
      -        throwError({}, Messages.UnexpectedToken, "ILLEGAL");
      -    }
      -
      -    return {
      -        type: Token.NumericLiteral,
      -        value: parseFloat(number),
      -        lineNumber: lineNumber,
      -        lineStart: lineStart,
      -        range: [start, index]
      -    };
      -}
      -
       /**
      - * Scan a string escape sequence and return its special character.
      - * @param {string} ch The starting character of the given sequence.
      - * @returns {Object} An object containing the character and a flag
      - * if the escape sequence was an octal.
      - * @private
      + * @fileoverview Main Espree file that converts Acorn into Esprima output.
      + * Copyright 2015 Nicholas C. Zakas. All rights reserved.
      + *
      + * This file contains code from the following MIT-licensed projects:
      + * 1. Acorn
      + * 2. Babylon
      + * 3. Babel-ESLint
      + *
      + * This file also contains code from Esprima, which is BSD licensed.
      + *
      + * Acorn is Copyright 2012-2015 Acorn Contributors (https://github.com/marijnh/acorn/blob/master/AUTHORS)
      + * Babylon is Copyright 2014-2015 various contributors (https://github.com/babel/babel/blob/master/packages/babylon/AUTHORS)
      + * Babel-ESLint is Copyright 2014-2015 Sebastian McKenzie 
      + *
      + * Redistribution and use in source and binary forms, with or without
      + * modification, are permitted provided that the following conditions are met:
      + *
      + * * Redistributions of source code must retain the above copyright
      + *   notice, this list of conditions and the following disclaimer.
      + * * Redistributions in binary form must reproduce the above copyright
      + *   notice, this list of conditions and the following disclaimer in the
      + *   documentation and/or other materials provided with the distribution.
      + *
      + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
      + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      + * ARE DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
      + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
      + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
      + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
      + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      + *
      + * Esprima is Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved.
      + *
      + * Redistribution and use in source and binary forms, with or without
      + * modification, are permitted provided that the following conditions are met:
      + *
      + *   * Redistributions of source code must retain the above copyright
      + *     notice, this list of conditions and the following disclaimer.
      + *   * Redistributions in binary form must reproduce the above copyright
      + *     notice, this list of conditions and the following disclaimer in the
      + *     documentation and/or other materials provided with the distribution.
      + *
      + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
      + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      + * ARE DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
      + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
      + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
      + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
      + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
        */
      -function scanEscapeSequence(ch) {
      -    var code,
      -        unescaped,
      -        restore,
      -        escapedCh,
      -        octal = false;
      -
      -    // An escape sequence cannot be empty
      -    if (!ch) {
      -        throwError({}, Messages.UnexpectedToken, "ILLEGAL");
      -    }
      -
      -    if (syntax.isLineTerminator(ch.charCodeAt(0))) {
      -        ++lineNumber;
      -        if (ch === "\r" && source[index] === "\n") {
      -            ++index;
      -        }
      -        lineStart = index;
      -        escapedCh = "";
      -    } else if (ch === "u" && source[index] === "{") {
      -        // Handle ES6 extended unicode code point escape sequences.
      -        if (extra.ecmaFeatures.unicodeCodePointEscapes) {
      -            ++index;
      -            escapedCh = scanUnicodeCodePointEscape();
      -        } else {
      -            throwError({}, Messages.UnexpectedToken, "ILLEGAL");
      -        }
      -    } else if (ch === "u" || ch === "x") {
      -        // Handle other unicode and hex codes normally
      -        restore = index;
      -        unescaped = scanHexEscape(ch);
      -        if (unescaped) {
      -            escapedCh = unescaped;
      -        } else {
      -            index = restore;
      -            escapedCh = ch;
      -        }
      -    } else if (ch === "n") {
      -        escapedCh = "\n";
      -    } else if (ch === "r") {
      -        escapedCh = "\r";
      -    } else if (ch === "t") {
      -        escapedCh = "\t";
      -    } else if (ch === "b") {
      -        escapedCh = "\b";
      -    } else if (ch === "f") {
      -        escapedCh = "\f";
      -    } else if (ch === "v") {
      -        escapedCh = "\v";
      -    } else if (syntax.isOctalDigit(ch)) {
      -        code = "01234567".indexOf(ch);
      -
      -        // \0 is not octal escape sequence
      -        if (code !== 0) {
      -            octal = true;
      -        }
      -
      -        if (index < length && syntax.isOctalDigit(source[index])) {
      -            octal = true;
      -            code = code * 8 + "01234567".indexOf(source[index++]);
      -
      -            // 3 digits are only allowed when string starts with 0, 1, 2, 3
      -            if ("0123".indexOf(ch) >= 0 &&
      -                    index < length &&
      -                    syntax.isOctalDigit(source[index])) {
      -                code = code * 8 + "01234567".indexOf(source[index++]);
      -            }
      -        }
      -        escapedCh = String.fromCharCode(code);
      -    } else {
      -        escapedCh = ch;
      -    }
      -
      -    return {
      -        ch: escapedCh,
      -        octal: octal
      -    };
      -}
      -
      -function scanStringLiteral() {
      -    var str = "",
      -        ch,
      -        escapedSequence,
      -        octal = false,
      -        start = index,
      -        startLineNumber = lineNumber,
      -        startLineStart = lineStart,
      -        quote = source[index];
      -
      -    assert((quote === "'" || quote === "\""),
      -        "String literal must starts with a quote");
      -
      -    ++index;
      -
      -    while (index < length) {
      -        ch = source[index++];
      -
      -        if (syntax.isLineTerminator(ch.charCodeAt(0))) {
      -            break;
      -        } else if (ch === quote) {
      -            quote = "";
      -            break;
      -        } else if (ch === "\\") {
      -            ch = source[index++];
      -            escapedSequence = scanEscapeSequence(ch);
      -            str += escapedSequence.ch;
      -            octal = escapedSequence.octal || octal;
      -        } else {
      -            str += ch;
      -        }
      -    }
      -
      -    if (quote !== "") {
      -        throwError({}, Messages.UnexpectedToken, "ILLEGAL");
      -    }
      -
      -    return {
      -        type: Token.StringLiteral,
      -        value: str,
      -        octal: octal,
      -        startLineNumber: startLineNumber,
      -        startLineStart: startLineStart,
      -        lineNumber: lineNumber,
      -        lineStart: lineStart,
      -        range: [start, index]
      -    };
      -}
      +/* eslint no-undefined:0, no-use-before-define: 0 */
       
      -/**
      - * Scan a template string and return a token. This scans both the first and
      - * subsequent pieces of a template string and assumes that the first backtick
      - * or the closing } have already been scanned.
      - * @returns {Token} The template string token.
      - * @private
      - */
      -function scanTemplate() {
      -    var cooked = "",
      -        ch,
      -        escapedSequence,
      -        start = index,
      -        terminated = false,
      -        tail = false,
      -        head = (source[index] === "`");
      -
      -    ++index;
      -
      -    while (index < length) {
      -        ch = source[index++];
      -
      -        if (ch === "`") {
      -            tail = true;
      -            terminated = true;
      -            break;
      -        } else if (ch === "$") {
      -            if (source[index] === "{") {
      -                ++index;
      -                terminated = true;
      -                break;
      -            }
      -            cooked += ch;
      -        } else if (ch === "\\") {
      -            ch = source[index++];
      -            escapedSequence = scanEscapeSequence(ch);
      -
      -            if (escapedSequence.octal) {
      -                throwError({}, Messages.TemplateOctalLiteral);
      -            }
      -
      -            cooked += escapedSequence.ch;
      -
      -        } else if (syntax.isLineTerminator(ch.charCodeAt(0))) {
      -            ++lineNumber;
      -            if (ch === "\r" && source[index] === "\n") {
      -                ++index;
      -            }
      -            lineStart = index;
      -            cooked += "\n";
      -        } else {
      -            cooked += ch;
      -        }
      -    }
      -
      -    if (!terminated) {
      -        throwError({}, Messages.UnexpectedToken, "ILLEGAL");
      -    }
      -
      -    if (index > state.curlyLastIndex) {
      -        state.curlyLastIndex = index;
      -
      -        if (!tail) {
      -            state.curlyStack.push("template");
      -        }
      -
      -        if (!head) {
      -            state.curlyStack.pop();
      -        }
      -    }
      -
      -    return {
      -        type: Token.Template,
      -        value: {
      -            cooked: cooked,
      -            raw: source.slice(start + 1, index - ((tail) ? 1 : 2))
      -        },
      -        head: head,
      -        tail: tail,
      -        lineNumber: lineNumber,
      -        lineStart: lineStart,
      -        range: [start, index]
      -    };
      -}
      -
      -function testRegExp(pattern, flags) {
      -    var tmp = pattern,
      -        validFlags = "gmsi";
      -
      -    if (extra.ecmaFeatures.regexYFlag) {
      -        validFlags += "y";
      -    }
      -
      -    if (extra.ecmaFeatures.regexUFlag) {
      -        validFlags += "u";
      -    }
      -
      -    if (!RegExp("^[" + validFlags + "]*$").test(flags)) {
      -        throwError({}, Messages.InvalidRegExpFlag);
      -    }
      -
      -
      -    if (flags.indexOf("u") >= 0) {
      -        // Replace each astral symbol and every Unicode code point
      -        // escape sequence with a single ASCII symbol to avoid throwing on
      -        // regular expressions that are only valid in combination with the
      -        // `/u` flag.
      -        // Note: replacing with the ASCII symbol `x` might cause false
      -        // negatives in unlikely scenarios. For example, `[\u{61}-b]` is a
      -        // perfectly valid pattern that is equivalent to `[a-b]`, but it
      -        // would be replaced by `[x-b]` which throws an error.
      -        tmp = tmp
      -            .replace(/\\u\{([0-9a-fA-F]+)\}/g, function ($0, $1) {
      -                if (parseInt($1, 16) <= 0x10FFFF) {
      -                    return "x";
      -                }
      -                throwError({}, Messages.InvalidRegExp);
      -            })
      -            .replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, "x");
      -    }
      -
      -    // First, detect invalid regular expressions.
      -    try {
      -        RegExp(tmp);
      -    } catch (e) {
      -        throwError({}, Messages.InvalidRegExp);
      -    }
      -
      -    // Return a regular expression object for this pattern-flag pair, or
      -    // `null` in case the current environment doesn't support the flags it
      -    // uses.
      -    try {
      -        return new RegExp(pattern, flags);
      -    } catch (exception) {
      -        return null;
      -    }
      -}
      -
      -function scanRegExpBody() {
      -    var ch, str, classMarker, terminated, body;
      -
      -    ch = source[index];
      -    assert(ch === "/", "Regular expression literal must start with a slash");
      -    str = source[index++];
      -
      -    classMarker = false;
      -    terminated = false;
      -    while (index < length) {
      -        ch = source[index++];
      -        str += ch;
      -        if (ch === "\\") {
      -            ch = source[index++];
      -            // ECMA-262 7.8.5
      -            if (syntax.isLineTerminator(ch.charCodeAt(0))) {
      -                throwError({}, Messages.UnterminatedRegExp);
      -            }
      -            str += ch;
      -        } else if (syntax.isLineTerminator(ch.charCodeAt(0))) {
      -            throwError({}, Messages.UnterminatedRegExp);
      -        } else if (classMarker) {
      -            if (ch === "]") {
      -                classMarker = false;
      -            }
      -        } else {
      -            if (ch === "/") {
      -                terminated = true;
      -                break;
      -            } else if (ch === "[") {
      -                classMarker = true;
      -            }
      -        }
      -    }
      -
      -    if (!terminated) {
      -        throwError({}, Messages.UnterminatedRegExp);
      -    }
      -
      -    // Exclude leading and trailing slash.
      -    body = str.substr(1, str.length - 2);
      -    return {
      -        value: body,
      -        literal: str
      -    };
      -}
      -
      -function scanRegExpFlags() {
      -    var ch, str, flags, restore;
      -
      -    str = "";
      -    flags = "";
      -    while (index < length) {
      -        ch = source[index];
      -        if (!syntax.isIdentifierPart(ch.charCodeAt(0))) {
      -            break;
      -        }
      -
      -        ++index;
      -        if (ch === "\\" && index < length) {
      -            ch = source[index];
      -            if (ch === "u") {
      -                ++index;
      -                restore = index;
      -                ch = scanHexEscape("u");
      -                if (ch) {
      -                    flags += ch;
      -                    for (str += "\\u"; restore < index; ++restore) {
      -                        str += source[restore];
      -                    }
      -                } else {
      -                    index = restore;
      -                    flags += "u";
      -                    str += "\\u";
      -                }
      -                throwErrorTolerant({}, Messages.UnexpectedToken, "ILLEGAL");
      -            } else {
      -                str += "\\";
      -                throwErrorTolerant({}, Messages.UnexpectedToken, "ILLEGAL");
      -            }
      -        } else {
      -            flags += ch;
      -            str += ch;
      -        }
      -    }
      -
      -    return {
      -        value: flags,
      -        literal: str
      -    };
      -}
      -
      -function scanRegExp() {
      -    var start, body, flags, value;
      -
      -    lookahead = null;
      -    skipComment();
      -    start = index;
      -
      -    body = scanRegExpBody();
      -    flags = scanRegExpFlags();
      -    value = testRegExp(body.value, flags.value);
      -
      -    if (extra.tokenize) {
      -        return {
      -            type: Token.RegularExpression,
      -            value: value,
      -            regex: {
      -                pattern: body.value,
      -                flags: flags.value
      -            },
      -            lineNumber: lineNumber,
      -            lineStart: lineStart,
      -            range: [start, index]
      -        };
      -    }
      -
      -    return {
      -        literal: body.literal + flags.literal,
      -        value: value,
      -        regex: {
      -            pattern: body.value,
      -            flags: flags.value
      -        },
      -        range: [start, index]
      -    };
      -}
      -
      -function collectRegex() {
      -    var pos, loc, regex, token;
      -
      -    skipComment();
      -
      -    pos = index;
      -    loc = {
      -        start: {
      -            line: lineNumber,
      -            column: index - lineStart
      -        }
      -    };
      -
      -    regex = scanRegExp();
      -    loc.end = {
      -        line: lineNumber,
      -        column: index - lineStart
      -    };
      -
      -    /* istanbul ignore next */
      -    if (!extra.tokenize) {
      -        // Pop the previous token, which is likely "/" or "/="
      -        if (extra.tokens.length > 0) {
      -            token = extra.tokens[extra.tokens.length - 1];
      -            if (token.range[0] === pos && token.type === "Punctuator") {
      -                if (token.value === "/" || token.value === "/=") {
      -                    extra.tokens.pop();
      -                }
      -            }
      -        }
      -
      -        extra.tokens.push({
      -            type: "RegularExpression",
      -            value: regex.literal,
      -            regex: regex.regex,
      -            range: [pos, index],
      -            loc: loc
      -        });
      -    }
      -
      -    return regex;
      -}
      -
      -function isIdentifierName(token) {
      -    return token.type === Token.Identifier ||
      -        token.type === Token.Keyword ||
      -        token.type === Token.BooleanLiteral ||
      -        token.type === Token.NullLiteral;
      -}
      -
      -function advanceSlash() {
      -    var prevToken,
      -        checkToken;
      -    // Using the following algorithm:
      -    // https://github.com/mozilla/sweet.js/wiki/design
      -    prevToken = extra.tokens[extra.tokens.length - 1];
      -    if (!prevToken) {
      -        // Nothing before that: it cannot be a division.
      -        return collectRegex();
      -    }
      -    if (prevToken.type === "Punctuator") {
      -        if (prevToken.value === "]") {
      -            return scanPunctuator();
      -        }
      -        if (prevToken.value === ")") {
      -            checkToken = extra.tokens[extra.openParenToken - 1];
      -            if (checkToken &&
      -                    checkToken.type === "Keyword" &&
      -                    (checkToken.value === "if" ||
      -                     checkToken.value === "while" ||
      -                     checkToken.value === "for" ||
      -                     checkToken.value === "with")) {
      -                return collectRegex();
      -            }
      -            return scanPunctuator();
      -        }
      -        if (prevToken.value === "}") {
      -            // Dividing a function by anything makes little sense,
      -            // but we have to check for that.
      -            if (extra.tokens[extra.openCurlyToken - 3] &&
      -                    extra.tokens[extra.openCurlyToken - 3].type === "Keyword") {
      -                // Anonymous function.
      -                checkToken = extra.tokens[extra.openCurlyToken - 4];
      -                if (!checkToken) {
      -                    return scanPunctuator();
      -                }
      -            } else if (extra.tokens[extra.openCurlyToken - 4] &&
      -                    extra.tokens[extra.openCurlyToken - 4].type === "Keyword") {
      -                // Named function.
      -                checkToken = extra.tokens[extra.openCurlyToken - 5];
      -                if (!checkToken) {
      -                    return collectRegex();
      -                }
      -            } else {
      -                return scanPunctuator();
      -            }
      -            // checkToken determines whether the function is
      -            // a declaration or an expression.
      -            if (FnExprTokens.indexOf(checkToken.value) >= 0) {
      -                // It is an expression.
      -                return scanPunctuator();
      -            }
      -            // It is a declaration.
      -            return collectRegex();
      -        }
      -        return collectRegex();
      -    }
      -    if (prevToken.type === "Keyword") {
      -        return collectRegex();
      -    }
      -    return scanPunctuator();
      -}
      -
      -function advance() {
      -    var ch,
      -        allowJSX = extra.ecmaFeatures.jsx,
      -        allowTemplateStrings = extra.ecmaFeatures.templateStrings;
      -
      -    /*
      -     * If JSX isn't allowed or JSX is allowed and we're not inside an JSX child,
      -     * then skip any comments.
      -     */
      -    if (!allowJSX || !state.inJSXChild) {
      -        skipComment();
      -    }
      -
      -    if (index >= length) {
      -        return {
      -            type: Token.EOF,
      -            lineNumber: lineNumber,
      -            lineStart: lineStart,
      -            range: [index, index]
      -        };
      -    }
      -
      -    // if inside an JSX child, then abort regular tokenization
      -    if (allowJSX && state.inJSXChild) {
      -        return advanceJSXChild();
      -    }
      -
      -    ch = source.charCodeAt(index);
      -
      -    // Very common: ( and ) and ;
      -    if (ch === 0x28 || ch === 0x29 || ch === 0x3B) {
      -        return scanPunctuator();
      -    }
      -
      -    // String literal starts with single quote (U+0027) or double quote (U+0022).
      -    if (ch === 0x27 || ch === 0x22) {
      -        if (allowJSX && state.inJSXTag) {
      -            return scanJSXStringLiteral();
      -        }
      -
      -        return scanStringLiteral();
      -    }
      -
      -    if (allowJSX && state.inJSXTag && syntax.isJSXIdentifierStart(ch)) {
      -        return scanJSXIdentifier();
      -    }
      -
      -    // Template strings start with backtick (U+0096) or closing curly brace (125) and backtick.
      -    if (allowTemplateStrings) {
      -
      -        // template strings start with backtick (96) or open curly (125) but only if the open
      -        // curly closes a previously opened curly from a template.
      -        if (ch === 96 || (ch === 125 && state.curlyStack[state.curlyStack.length - 1] === "template")) {
      -            return scanTemplate();
      -        }
      -    }
      -
      -    if (syntax.isIdentifierStart(ch)) {
      -        return scanIdentifier();
      -    }
      -
      -    // Dot (.) U+002E can also start a floating-point number, hence the need
      -    // to check the next character.
      -    if (ch === 0x2E) {
      -        if (syntax.isDecimalDigit(source.charCodeAt(index + 1))) {
      -            return scanNumericLiteral();
      -        }
      -        return scanPunctuator();
      -    }
      -
      -    if (syntax.isDecimalDigit(ch)) {
      -        return scanNumericLiteral();
      -    }
      -
      -    // Slash (/) U+002F can also start a regex.
      -    if (extra.tokenize && ch === 0x2F) {
      -        return advanceSlash();
      -    }
      -
      -    return scanPunctuator();
      -}
      -
      -function collectToken() {
      -    var loc, token, range, value, entry,
      -        allowJSX = extra.ecmaFeatures.jsx;
      -
      -    /* istanbul ignore else */
      -    if (!allowJSX || !state.inJSXChild) {
      -        skipComment();
      -    }
      -
      -    loc = {
      -        start: {
      -            line: lineNumber,
      -            column: index - lineStart
      -        }
      -    };
      -
      -    token = advance();
      -    loc.end = {
      -        line: lineNumber,
      -        column: index - lineStart
      -    };
      -
      -    if (token.type !== Token.EOF) {
      -        range = [token.range[0], token.range[1]];
      -        value = source.slice(token.range[0], token.range[1]);
      -        entry = {
      -            type: TokenName[token.type],
      -            value: value,
      -            range: range,
      -            loc: loc
      -        };
      -        if (token.regex) {
      -            entry.regex = {
      -                pattern: token.regex.pattern,
      -                flags: token.regex.flags
      -            };
      -        }
      -        extra.tokens.push(entry);
      -    }
      -
      -    return token;
      -}
      -
      -function lex() {
      -    var token;
      -
      -    token = lookahead;
      -    index = token.range[1];
      -    lineNumber = token.lineNumber;
      -    lineStart = token.lineStart;
      -
      -    lookahead = (typeof extra.tokens !== "undefined") ? collectToken() : advance();
      -
      -    index = token.range[1];
      -    lineNumber = token.lineNumber;
      -    lineStart = token.lineStart;
      -
      -    return token;
      -}
      -
      -function peek() {
      -    var pos,
      -        line,
      -        start;
      -
      -    pos = index;
      -    line = lineNumber;
      -    start = lineStart;
      -
      -    lookahead = (typeof extra.tokens !== "undefined") ? collectToken() : advance();
      -
      -    index = pos;
      -    lineNumber = line;
      -    lineStart = start;
      -}
      -
      -function lookahead2() {
      -    var adv, pos, line, start, result;
      -
      -    // If we are collecting the tokens, don't grab the next one yet.
      -    /* istanbul ignore next */
      -    adv = (typeof extra.advance === "function") ? extra.advance : advance;
      -
      -    pos = index;
      -    line = lineNumber;
      -    start = lineStart;
      -
      -    // Scan for the next immediate token.
      -    /* istanbul ignore if */
      -    if (lookahead === null) {
      -        lookahead = adv();
      -    }
      -    index = lookahead.range[1];
      -    lineNumber = lookahead.lineNumber;
      -    lineStart = lookahead.lineStart;
      -
      -    // Grab the token right after.
      -    result = adv();
      -    index = pos;
      -    lineNumber = line;
      -    lineStart = start;
      -
      -    return result;
      -}
      -
      -
      -//------------------------------------------------------------------------------
      -// JSX
      -//------------------------------------------------------------------------------
      -
      -function getQualifiedJSXName(object) {
      -    if (object.type === astNodeTypes.JSXIdentifier) {
      -        return object.name;
      -    }
      -    if (object.type === astNodeTypes.JSXNamespacedName) {
      -        return object.namespace.name + ":" + object.name.name;
      -    }
      -    /* istanbul ignore else */
      -    if (object.type === astNodeTypes.JSXMemberExpression) {
      -        return (
      -            getQualifiedJSXName(object.object) + "." +
      -            getQualifiedJSXName(object.property)
      -        );
      -    }
      -    /* istanbul ignore next */
      -    throwUnexpected(object);
      -}
      -
      -function scanJSXIdentifier() {
      -    var ch, start, value = "";
      -
      -    start = index;
      -    while (index < length) {
      -        ch = source.charCodeAt(index);
      -        if (!syntax.isJSXIdentifierPart(ch)) {
      -            break;
      -        }
      -        value += source[index++];
      -    }
      -
      -    return {
      -        type: Token.JSXIdentifier,
      -        value: value,
      -        lineNumber: lineNumber,
      -        lineStart: lineStart,
      -        range: [start, index]
      -    };
      -}
      -
      -function scanJSXEntity() {
      -    var ch, str = "", start = index, count = 0, code;
      -    ch = source[index];
      -    assert(ch === "&", "Entity must start with an ampersand");
      -    index++;
      -    while (index < length && count++ < 10) {
      -        ch = source[index++];
      -        if (ch === ";") {
      -            break;
      -        }
      -        str += ch;
      -    }
      -
      -    // Well-formed entity (ending was found).
      -    if (ch === ";") {
      -        // Numeric entity.
      -        if (str[0] === "#") {
      -            if (str[1] === "x") {
      -                code = +("0" + str.substr(1));
      -            } else {
      -                // Removing leading zeros in order to avoid treating as octal in old browsers.
      -                code = +str.substr(1).replace(Regex.LeadingZeros, "");
      -            }
      -
      -            if (!isNaN(code)) {
      -                return String.fromCharCode(code);
      -            }
      -        /* istanbul ignore else */
      -        } else if (XHTMLEntities[str]) {
      -            return XHTMLEntities[str];
      -        }
      -    }
      -
      -    // Treat non-entity sequences as regular text.
      -    index = start + 1;
      -    return "&";
      -}
      -
      -function scanJSXText(stopChars) {
      -    var ch, str = "", start;
      -    start = index;
      -    while (index < length) {
      -        ch = source[index];
      -        if (stopChars.indexOf(ch) !== -1) {
      -            break;
      -        }
      -        if (ch === "&") {
      -            str += scanJSXEntity();
      -        } else {
      -            index++;
      -            if (ch === "\r" && source[index] === "\n") {
      -                str += ch;
      -                ch = source[index];
      -                index++;
      -            }
      -            if (syntax.isLineTerminator(ch.charCodeAt(0))) {
      -                ++lineNumber;
      -                lineStart = index;
      -            }
      -            str += ch;
      -        }
      -    }
      -    return {
      -        type: Token.JSXText,
      -        value: str,
      -        lineNumber: lineNumber,
      -        lineStart: lineStart,
      -        range: [start, index]
      -    };
      -}
      -
      -function scanJSXStringLiteral() {
      -    var innerToken, quote, start;
      -
      -    quote = source[index];
      -    assert((quote === "\"" || quote === "'"),
      -        "String literal must starts with a quote");
      -
      -    start = index;
      -    ++index;
      -
      -    innerToken = scanJSXText([quote]);
      -
      -    if (quote !== source[index]) {
      -        throwError({}, Messages.UnexpectedToken, "ILLEGAL");
      -    }
      -
      -    ++index;
      -
      -    innerToken.range = [start, index];
      -
      -    return innerToken;
      -}
      -
      -/*
      - * Between JSX opening and closing tags (e.g. HERE), anything that
      - * is not another JSX tag and is not an expression wrapped by {} is text.
      - */
      -function advanceJSXChild() {
      -    var ch = source.charCodeAt(index);
      -
      -    // { (123) and < (60)
      -    if (ch !== 123 && ch !== 60) {
      -        return scanJSXText(["<", "{"]);
      -    }
      -
      -    return scanPunctuator();
      -}
      -
      -function parseJSXIdentifier() {
      -    var token, marker = markerCreate();
      -
      -    if (lookahead.type !== Token.JSXIdentifier) {
      -        throwUnexpected(lookahead);
      -    }
      -
      -    token = lex();
      -    return markerApply(marker, astNodeFactory.createJSXIdentifier(token.value));
      -}
      -
      -function parseJSXNamespacedName() {
      -    var namespace, name, marker = markerCreate();
      -
      -    namespace = parseJSXIdentifier();
      -    expect(":");
      -    name = parseJSXIdentifier();
      -
      -    return markerApply(marker, astNodeFactory.createJSXNamespacedName(namespace, name));
      -}
      -
      -function parseJSXMemberExpression() {
      -    var marker = markerCreate(),
      -        expr = parseJSXIdentifier();
      -
      -    while (match(".")) {
      -        lex();
      -        expr = markerApply(marker, astNodeFactory.createJSXMemberExpression(expr, parseJSXIdentifier()));
      -    }
      -
      -    return expr;
      -}
      -
      -function parseJSXElementName() {
      -    if (lookahead2().value === ":") {
      -        return parseJSXNamespacedName();
      -    }
      -    if (lookahead2().value === ".") {
      -        return parseJSXMemberExpression();
      -    }
      -
      -    return parseJSXIdentifier();
      -}
      -
      -function parseJSXAttributeName() {
      -    if (lookahead2().value === ":") {
      -        return parseJSXNamespacedName();
      -    }
      -
      -    return parseJSXIdentifier();
      -}
      -
      -function parseJSXAttributeValue() {
      -    var value, marker;
      -    if (match("{")) {
      -        value = parseJSXExpressionContainer();
      -        if (value.expression.type === astNodeTypes.JSXEmptyExpression) {
      -            throwError(
      -                value,
      -                "JSX attributes must only be assigned a non-empty " +
      -                    "expression"
      -            );
      -        }
      -    } else if (match("<")) {
      -        value = parseJSXElement();
      -    } else if (lookahead.type === Token.JSXText) {
      -        marker = markerCreate();
      -        value = markerApply(marker, astNodeFactory.createLiteralFromSource(lex(), source));
      -    } else {
      -        throwError({}, Messages.InvalidJSXAttributeValue);
      -    }
      -    return value;
      -}
      -
      -function parseJSXEmptyExpression() {
      -    var marker = markerCreatePreserveWhitespace();
      -    while (source.charAt(index) !== "}") {
      -        index++;
      -    }
      -    return markerApply(marker, astNodeFactory.createJSXEmptyExpression());
      -}
      -
      -function parseJSXExpressionContainer() {
      -    var expression, origInJSXChild, origInJSXTag, marker = markerCreate();
      -
      -    origInJSXChild = state.inJSXChild;
      -    origInJSXTag = state.inJSXTag;
      -    state.inJSXChild = false;
      -    state.inJSXTag = false;
      -
      -    expect("{");
      -
      -    if (match("}")) {
      -        expression = parseJSXEmptyExpression();
      -    } else {
      -        expression = parseExpression();
      -    }
      -
      -    state.inJSXChild = origInJSXChild;
      -    state.inJSXTag = origInJSXTag;
      -
      -    expect("}");
      -
      -    return markerApply(marker, astNodeFactory.createJSXExpressionContainer(expression));
      -}
      -
      -function parseJSXSpreadAttribute() {
      -    var expression, origInJSXChild, origInJSXTag, marker = markerCreate();
      -
      -    origInJSXChild = state.inJSXChild;
      -    origInJSXTag = state.inJSXTag;
      -    state.inJSXChild = false;
      -    state.inJSXTag = false;
      -    state.inJSXSpreadAttribute = true;
      -
      -    expect("{");
      -    expect("...");
      -
      -    state.inJSXSpreadAttribute = false;
      -
      -    expression = parseAssignmentExpression();
      -
      -    state.inJSXChild = origInJSXChild;
      -    state.inJSXTag = origInJSXTag;
      -
      -    expect("}");
      -
      -    return markerApply(marker, astNodeFactory.createJSXSpreadAttribute(expression));
      -}
      -
      -function parseJSXAttribute() {
      -    var name, marker;
      -
      -    if (match("{")) {
      -        return parseJSXSpreadAttribute();
      -    }
      -
      -    marker = markerCreate();
      -
      -    name = parseJSXAttributeName();
      -
      -    // HTML empty attribute
      -    if (match("=")) {
      -        lex();
      -        return markerApply(marker, astNodeFactory.createJSXAttribute(name, parseJSXAttributeValue()));
      -    }
      -
      -    return markerApply(marker, astNodeFactory.createJSXAttribute(name));
      -}
      -
      -function parseJSXChild() {
      -    var token, marker;
      -    if (match("{")) {
      -        token = parseJSXExpressionContainer();
      -    } else if (lookahead.type === Token.JSXText) {
      -        marker = markerCreatePreserveWhitespace();
      -        token = markerApply(marker, astNodeFactory.createLiteralFromSource(lex(), source));
      -    } else {
      -        token = parseJSXElement();
      -    }
      -    return token;
      -}
      -
      -function parseJSXClosingElement() {
      -    var name, origInJSXChild, origInJSXTag, marker = markerCreate();
      -    origInJSXChild = state.inJSXChild;
      -    origInJSXTag = state.inJSXTag;
      -    state.inJSXChild = false;
      -    state.inJSXTag = true;
      -    expect("<");
      -    expect("/");
      -    name = parseJSXElementName();
      -    // Because advance() (called by lex() called by expect()) expects there
      -    // to be a valid token after >, it needs to know whether to look for a
      -    // standard JS token or an JSX text node
      -    state.inJSXChild = origInJSXChild;
      -    state.inJSXTag = origInJSXTag;
      -    expect(">");
      -    return markerApply(marker, astNodeFactory.createJSXClosingElement(name));
      -}
      -
      -function parseJSXOpeningElement() {
      -    var name, attributes = [], selfClosing = false, origInJSXChild,
      -        origInJSXTag, marker = markerCreate();
      -
      -    origInJSXChild = state.inJSXChild;
      -    origInJSXTag = state.inJSXTag;
      -    state.inJSXChild = false;
      -    state.inJSXTag = true;
      -
      -    expect("<");
      -
      -    name = parseJSXElementName();
      -
      -    while (index < length &&
      -            lookahead.value !== "/" &&
      -            lookahead.value !== ">") {
      -        attributes.push(parseJSXAttribute());
      -    }
      -
      -    state.inJSXTag = origInJSXTag;
      -
      -    if (lookahead.value === "/") {
      -        expect("/");
      -        // Because advance() (called by lex() called by expect()) expects
      -        // there to be a valid token after >, it needs to know whether to
      -        // look for a standard JS token or an JSX text node
      -        state.inJSXChild = origInJSXChild;
      -        expect(">");
      -        selfClosing = true;
      -    } else {
      -        state.inJSXChild = true;
      -        expect(">");
      -    }
      -    return markerApply(marker, astNodeFactory.createJSXOpeningElement(name, attributes, selfClosing));
      -}
      -
      -function parseJSXElement() {
      -    var openingElement, closingElement = null, children = [], origInJSXChild, origInJSXTag, marker = markerCreate();
      -
      -    origInJSXChild = state.inJSXChild;
      -    origInJSXTag = state.inJSXTag;
      -    openingElement = parseJSXOpeningElement();
      -
      -    if (!openingElement.selfClosing) {
      -        while (index < length) {
      -            state.inJSXChild = false; // Call lookahead2() with inJSXChild = false because one
      two
      ; - * - * the default error message is a bit incomprehensible. Since it"s - * rarely (never?) useful to write a less-than sign after an JSX - * element, we disallow it here in the parser in order to provide a - * better error message. (In the rare case that the less-than operator - * was intended, the left tag can be wrapped in parentheses.) - */ - if (!origInJSXChild && match("<")) { - throwError(lookahead, Messages.AdjacentJSXElements); - } - - return markerApply(marker, astNodeFactory.createJSXElement(openingElement, closingElement, children)); -} - -//------------------------------------------------------------------------------ -// Location markers -//------------------------------------------------------------------------------ - -/** - * Applies location information to the given node by using the given marker. - * The marker indicates the point at which the node is said to have to begun - * in the source code. - * @param {Object} marker The marker to use for the node. - * @param {ASTNode} node The AST node to apply location information to. - * @returns {ASTNode} The node that was passed in. - * @private - */ -function markerApply(marker, node) { - - // add range information to the node if present - if (extra.range) { - node.range = [marker.offset, index]; - } - - // add location information the node if present - if (extra.loc) { - node.loc = { - start: { - line: marker.line, - column: marker.col - }, - end: { - line: lineNumber, - column: index - lineStart - } - }; - // Attach extra.source information to the location, if present - if (extra.source) { - node.loc.source = extra.source; - } - } - - // attach leading and trailing comments if requested - if (extra.attachComment) { - commentAttachment.processComment(node); - } - - return node; -} - -/** - * Creates a location marker in the source code. Location markers are used for - * tracking where tokens and nodes appear in the source code. - * @returns {Object} A marker object or undefined if the parser doesn't have - * any location information. - * @private - */ -function markerCreate() { - - if (!extra.loc && !extra.range) { - return undefined; - } - - skipComment(); - - return { - offset: index, - line: lineNumber, - col: index - lineStart - }; -} - -/** - * Creates a location marker in the source code. Location markers are used for - * tracking where tokens and nodes appear in the source code. This method - * doesn't skip comments or extra whitespace which is important for JSX. - * @returns {Object} A marker object or undefined if the parser doesn't have - * any location information. - * @private - */ -function markerCreatePreserveWhitespace() { - - if (!extra.loc && !extra.range) { - return undefined; - } - - return { - offset: index, - line: lineNumber, - col: index - lineStart - }; -} - - -//------------------------------------------------------------------------------ -// Syntax Tree Delegate -//------------------------------------------------------------------------------ - -// Return true if there is a line terminator before the next token. - -function peekLineTerminator() { - var pos, line, start, found; - - pos = index; - line = lineNumber; - start = lineStart; - skipComment(); - found = lineNumber !== line; - index = pos; - lineNumber = line; - lineStart = start; - - return found; -} - -// Throw an exception - -function throwError(token, messageFormat) { - - var error, - args = Array.prototype.slice.call(arguments, 2), - msg = messageFormat.replace( - /%(\d)/g, - function (whole, index) { - assert(index < args.length, "Message reference must be in range"); - return args[index]; - } - ); - - if (typeof token.lineNumber === "number") { - error = new Error("Line " + token.lineNumber + ": " + msg); - error.index = token.range[0]; - error.lineNumber = token.lineNumber; - error.column = token.range[0] - lineStart + 1; - } else { - error = new Error("Line " + lineNumber + ": " + msg); - error.index = index; - error.lineNumber = lineNumber; - error.column = index - lineStart + 1; - } - - error.description = msg; - throw error; -} - -function throwErrorTolerant() { - try { - throwError.apply(null, arguments); - } catch (e) { - if (extra.errors) { - extra.errors.push(e); - } else { - throw e; - } - } -} - - -// Throw an exception because of the token. - -function throwUnexpected(token) { - - if (token.type === Token.EOF) { - throwError(token, Messages.UnexpectedEOS); - } - - if (token.type === Token.NumericLiteral) { - throwError(token, Messages.UnexpectedNumber); - } - - if (token.type === Token.StringLiteral || token.type === Token.JSXText) { - throwError(token, Messages.UnexpectedString); - } - - if (token.type === Token.Identifier) { - throwError(token, Messages.UnexpectedIdentifier); - } - - if (token.type === Token.Keyword) { - if (syntax.isFutureReservedWord(token.value)) { - throwError(token, Messages.UnexpectedReserved); - } else if (strict && syntax.isStrictModeReservedWord(token.value, extra.ecmaFeatures)) { - throwErrorTolerant(token, Messages.StrictReservedWord); - return; - } - throwError(token, Messages.UnexpectedToken, token.value); - } - - if (token.type === Token.Template) { - throwError(token, Messages.UnexpectedTemplate, token.value.raw); - } - - // BooleanLiteral, NullLiteral, or Punctuator. - throwError(token, Messages.UnexpectedToken, token.value); -} - -// Expect the next token to match the specified punctuator. -// If not, an exception will be thrown. - -function expect(value) { - var token = lex(); - if (token.type !== Token.Punctuator || token.value !== value) { - throwUnexpected(token); - } -} - -// Expect the next token to match the specified keyword. -// If not, an exception will be thrown. - -function expectKeyword(keyword) { - var token = lex(); - if (token.type !== Token.Keyword || token.value !== keyword) { - throwUnexpected(token); - } -} - -// Return true if the next token matches the specified punctuator. - -function match(value) { - return lookahead.type === Token.Punctuator && lookahead.value === value; -} - -// Return true if the next token matches the specified keyword - -function matchKeyword(keyword) { - return lookahead.type === Token.Keyword && lookahead.value === keyword; -} - -// Return true if the next token matches the specified contextual keyword -// (where an identifier is sometimes a keyword depending on the context) - -function matchContextualKeyword(keyword) { - return lookahead.type === Token.Identifier && lookahead.value === keyword; -} - -// Return true if the next token is an assignment operator - -function matchAssign() { - var op; - - if (lookahead.type !== Token.Punctuator) { - return false; - } - op = lookahead.value; - return op === "=" || - op === "*=" || - op === "/=" || - op === "%=" || - op === "+=" || - op === "-=" || - op === "<<=" || - op === ">>=" || - op === ">>>=" || - op === "&=" || - op === "^=" || - op === "|="; -} - -function consumeSemicolon() { - var line; - - // Catch the very common case first: immediately a semicolon (U+003B). - if (source.charCodeAt(index) === 0x3B || match(";")) { - lex(); - return; - } - - line = lineNumber; - skipComment(); - if (lineNumber !== line) { - return; - } - - if (lookahead.type !== Token.EOF && !match("}")) { - throwUnexpected(lookahead); - } -} - -// Return true if provided expression is LeftHandSideExpression - -function isLeftHandSide(expr) { - return expr.type === astNodeTypes.Identifier || expr.type === astNodeTypes.MemberExpression; -} - -// 11.1.4 Array Initialiser - -function parseArrayInitialiser() { - var elements = [], - marker = markerCreate(), - tmp; - - expect("["); - - while (!match("]")) { - if (match(",")) { - lex(); // only get here when you have [a,,] or similar - elements.push(null); - } else { - tmp = parseSpreadOrAssignmentExpression(); - elements.push(tmp); - if (!(match("]"))) { - expect(","); // handles the common case of comma-separated values - } - } - } - - expect("]"); - - return markerApply(marker, astNodeFactory.createArrayExpression(elements)); -} - -// 11.1.5 Object Initialiser - -function parsePropertyFunction(paramInfo, options) { - var previousStrict = strict, - previousYieldAllowed = state.yieldAllowed, - generator = options ? options.generator : false, - body; - - state.yieldAllowed = generator; - - /* - * Esprima uses parseConciseBody() here, which is incorrect. Object literal - * methods must have braces. - */ - body = parseFunctionSourceElements(); - - if (strict && paramInfo.firstRestricted) { - throwErrorTolerant(paramInfo.firstRestricted, Messages.StrictParamName); - } - - if (strict && paramInfo.stricted) { - throwErrorTolerant(paramInfo.stricted, paramInfo.message); - } - - strict = previousStrict; - state.yieldAllowed = previousYieldAllowed; - - return markerApply(options.marker, astNodeFactory.createFunctionExpression( - null, - paramInfo.params, - body, - generator, - body.type !== astNodeTypes.BlockStatement - )); -} - -function parsePropertyMethodFunction(options) { - var previousStrict = strict, - marker = markerCreate(), - params, - method; - - strict = true; - - params = parseParams(); - - if (params.stricted) { - throwErrorTolerant(params.stricted, params.message); - } - - method = parsePropertyFunction(params, { - generator: options ? options.generator : false, - marker: marker - }); - - strict = previousStrict; - - return method; -} - -function parseObjectPropertyKey() { - var marker = markerCreate(), - token = lex(), - allowObjectLiteralComputed = extra.ecmaFeatures.objectLiteralComputedProperties, - expr, - result; - - // Note: This function is called only from parseObjectProperty(), where - // EOF and Punctuator tokens are already filtered out. - - switch (token.type) { - case Token.StringLiteral: - case Token.NumericLiteral: - if (strict && token.octal) { - throwErrorTolerant(token, Messages.StrictOctalLiteral); - } - return markerApply(marker, astNodeFactory.createLiteralFromSource(token, source)); - - case Token.Identifier: - case Token.BooleanLiteral: - case Token.NullLiteral: - case Token.Keyword: - return markerApply(marker, astNodeFactory.createIdentifier(token.value)); - - case Token.Punctuator: - if ((!state.inObjectLiteral || allowObjectLiteralComputed) && - token.value === "[") { - // For computed properties we should skip the [ and ], and - // capture in marker only the assignment expression itself. - marker = markerCreate(); - expr = parseAssignmentExpression(); - result = markerApply(marker, expr); - expect("]"); - return result; - } - - // no default - } - - throwUnexpected(token); -} - -function lookaheadPropertyName() { - switch (lookahead.type) { - case Token.Identifier: - case Token.StringLiteral: - case Token.BooleanLiteral: - case Token.NullLiteral: - case Token.NumericLiteral: - case Token.Keyword: - return true; - case Token.Punctuator: - return lookahead.value === "["; - // no default - } - return false; -} - -// This function is to try to parse a MethodDefinition as defined in 14.3. But in the case of object literals, -// it might be called at a position where there is in fact a short hand identifier pattern or a data property. -// This can only be determined after we consumed up to the left parentheses. -// In order to avoid back tracking, it returns `null` if the position is not a MethodDefinition and the caller -// is responsible to visit other options. -function tryParseMethodDefinition(token, key, computed, marker) { - var value, options, methodMarker; - - if (token.type === Token.Identifier) { - // check for `get` and `set`; - - if (token.value === "get" && lookaheadPropertyName()) { - - computed = match("["); - key = parseObjectPropertyKey(); - methodMarker = markerCreate(); - expect("("); - expect(")"); - - value = parsePropertyFunction({ - params: [], - stricted: null, - firstRestricted: null, - message: null - }, { - marker: methodMarker - }); - - return markerApply(marker, astNodeFactory.createProperty("get", key, value, false, false, computed)); - - } else if (token.value === "set" && lookaheadPropertyName()) { - computed = match("["); - key = parseObjectPropertyKey(); - methodMarker = markerCreate(); - expect("("); - - options = { - params: [], - defaultCount: 0, - stricted: null, - firstRestricted: null, - paramSet: new StringMap() - }; - if (match(")")) { - throwErrorTolerant(lookahead, Messages.UnexpectedToken, lookahead.value); - } else { - parseParam(options); - } - expect(")"); - - value = parsePropertyFunction(options, { marker: methodMarker }); - return markerApply(marker, astNodeFactory.createProperty("set", key, value, false, false, computed)); - } - } - - if (match("(")) { - value = parsePropertyMethodFunction(); - return markerApply(marker, astNodeFactory.createProperty("init", key, value, true, false, computed)); - } - - // Not a MethodDefinition. - return null; -} - -/** - * Parses Generator Properties - * @param {ASTNode} key The property key (usually an identifier). - * @param {Object} marker The marker to use for the node. - * @returns {ASTNode} The generator property node. - */ -function parseGeneratorProperty(key, marker) { - - var computed = (lookahead.type === Token.Punctuator && lookahead.value === "["); - - if (!match("(")) { - throwUnexpected(lex()); - } - - return markerApply( - marker, - astNodeFactory.createProperty( - "init", - key, - parsePropertyMethodFunction({ generator: true }), - true, - false, - computed - ) - ); -} - -// TODO(nzakas): Update to match Esprima -function parseObjectProperty() { - var token, key, id, computed, methodMarker, options; - var allowComputed = extra.ecmaFeatures.objectLiteralComputedProperties, - allowMethod = extra.ecmaFeatures.objectLiteralShorthandMethods, - allowShorthand = extra.ecmaFeatures.objectLiteralShorthandProperties, - allowGenerators = extra.ecmaFeatures.generators, - allowDestructuring = extra.ecmaFeatures.destructuring, - marker = markerCreate(); - - token = lookahead; - computed = (token.value === "[" && token.type === Token.Punctuator); - - if (token.type === Token.Identifier || (allowComputed && computed)) { - - id = parseObjectPropertyKey(); - - /* - * Check for getters and setters. Be careful! "get" and "set" are legal - * method names. It's only a getter or setter if followed by a space. - */ - if (token.value === "get" && - !(match(":") || match("(") || match(",") || match("}"))) { - computed = (lookahead.value === "["); - key = parseObjectPropertyKey(); - methodMarker = markerCreate(); - expect("("); - expect(")"); - - return markerApply( - marker, - astNodeFactory.createProperty( - "get", - key, - parsePropertyFunction({ - generator: false - }, { - marker: methodMarker - }), - false, - false, - computed - ) - ); - } - - if (token.value === "set" && - !(match(":") || match("(") || match(",") || match("}"))) { - computed = (lookahead.value === "["); - key = parseObjectPropertyKey(); - methodMarker = markerCreate(); - expect("("); - - options = { - params: [], - defaultCount: 0, - stricted: null, - firstRestricted: null, - paramSet: new StringMap() - }; - - if (match(")")) { - throwErrorTolerant(lookahead, Messages.UnexpectedToken, lookahead.value); - } else { - parseParam(options); - } - - expect(")"); - - return markerApply( - marker, - astNodeFactory.createProperty( - "set", - key, - parsePropertyFunction(options, { - marker: methodMarker - }), - false, - false, - computed - ) - ); - } - - // normal property (key:value) - if (match(":")) { - lex(); - return markerApply( - marker, - astNodeFactory.createProperty( - "init", - id, - parseAssignmentExpression(), - false, - false, - computed - ) - ); - } - - // method shorthand (key(){...}) - if (allowMethod && match("(")) { - return markerApply( - marker, - astNodeFactory.createProperty( - "init", - id, - parsePropertyMethodFunction({ generator: false }), - true, - false, - computed - ) - ); - } - - // destructuring defaults (shorthand syntax) - if (allowDestructuring && match("=")) { - lex(); - var value = parseAssignmentExpression(); - var prop = markerApply(marker, astNodeFactory.createAssignmentExpression("=", id, value)); - prop.type = astNodeTypes.AssignmentPattern; - var fullProperty = astNodeFactory.createProperty( - "init", - id, - prop, - false, - true, // shorthand - computed - ); - return markerApply(marker, fullProperty); - } - - /* - * Only other possibility is that this is a shorthand property. Computed - * properties cannot use shorthand notation, so that's a syntax error. - * If shorthand properties aren't allow, then this is an automatic - * syntax error. Destructuring is another case with a similar shorthand syntax. - */ - if (computed || (!allowShorthand && !allowDestructuring)) { - throwUnexpected(lookahead); - } - - // shorthand property - return markerApply( - marker, - astNodeFactory.createProperty( - "init", - id, - id, - false, - true, - false - ) - ); - } - - // only possibility in this branch is a shorthand generator - if (token.type === Token.EOF || token.type === Token.Punctuator) { - if (!allowGenerators || !match("*") || !allowMethod) { - throwUnexpected(token); - } - - lex(); - - id = parseObjectPropertyKey(); - - return parseGeneratorProperty(id, marker); - - } - - /* - * If we've made it here, then that means the property name is represented - * by a string (i.e, { "foo": 2}). The only options here are normal - * property with a colon or a method. - */ - key = parseObjectPropertyKey(); - - // check for property value - if (match(":")) { - lex(); - return markerApply( - marker, - astNodeFactory.createProperty( - "init", - key, - parseAssignmentExpression(), - false, - false, - false - ) - ); - } - - // check for method - if (allowMethod && match("(")) { - return markerApply( - marker, - astNodeFactory.createProperty( - "init", - key, - parsePropertyMethodFunction(), - true, - false, - false - ) - ); - } - - // no other options, this is bad - throwUnexpected(lex()); -} - -function getFieldName(key) { - var toString = String; - if (key.type === astNodeTypes.Identifier) { - return key.name; - } - return toString(key.value); -} - -function parseObjectInitialiser() { - var marker = markerCreate(), - allowDuplicates = extra.ecmaFeatures.objectLiteralDuplicateProperties, - properties = [], - property, - name, - propertyFn, - kind, - storedKind, - previousInObjectLiteral = state.inObjectLiteral, - kindMap = new StringMap(); - - state.inObjectLiteral = true; - - expect("{"); - - while (!match("}")) { - - property = parseObjectProperty(); - - if (!property.computed) { - - name = getFieldName(property.key); - propertyFn = (property.kind === "get") ? PropertyKind.Get : PropertyKind.Set; - kind = (property.kind === "init") ? PropertyKind.Data : propertyFn; - - if (kindMap.has(name)) { - storedKind = kindMap.get(name); - if (storedKind === PropertyKind.Data) { - if (kind === PropertyKind.Data && name === "__proto__" && allowDuplicates) { - // Duplicate '__proto__' literal properties are forbidden in ES 6 - throwErrorTolerant({}, Messages.DuplicatePrototypeProperty); - } else if (strict && kind === PropertyKind.Data && !allowDuplicates) { - // Duplicate literal properties are only forbidden in ES 5 strict mode - throwErrorTolerant({}, Messages.StrictDuplicateProperty); - } else if (kind !== PropertyKind.Data) { - throwErrorTolerant({}, Messages.AccessorDataProperty); - } - } else { - if (kind === PropertyKind.Data) { - throwErrorTolerant({}, Messages.AccessorDataProperty); - } else if (storedKind & kind) { - throwErrorTolerant({}, Messages.AccessorGetSet); - } - } - kindMap.set(name, storedKind | kind); - } else { - kindMap.set(name, kind); - } - } - - properties.push(property); - - if (!match("}")) { - expect(","); - } - } - - expect("}"); - - state.inObjectLiteral = previousInObjectLiteral; - - return markerApply(marker, astNodeFactory.createObjectExpression(properties)); -} - -/** - * Parse a template string element and return its ASTNode representation - * @param {Object} option Parsing & scanning options - * @param {Object} option.head True if this element is the first in the - * template string, false otherwise. - * @returns {ASTNode} The template element node with marker info applied - * @private - */ -function parseTemplateElement(option) { - var marker, token; - - if (lookahead.type !== Token.Template || (option.head && !lookahead.head)) { - throwError({}, Messages.UnexpectedToken, "ILLEGAL"); - } - - marker = markerCreate(); - token = lex(); - - return markerApply( - marker, - astNodeFactory.createTemplateElement( - { - raw: token.value.raw, - cooked: token.value.cooked - }, - token.tail - ) - ); -} - -/** - * Parse a template string literal and return its ASTNode representation - * @returns {ASTNode} The template literal node with marker info applied - * @private - */ -function parseTemplateLiteral() { - var quasi, quasis, expressions, marker = markerCreate(); - - quasi = parseTemplateElement({ head: true }); - quasis = [ quasi ]; - expressions = []; - - while (!quasi.tail) { - expressions.push(parseExpression()); - quasi = parseTemplateElement({ head: false }); - quasis.push(quasi); - } - - return markerApply(marker, astNodeFactory.createTemplateLiteral(quasis, expressions)); -} - -// 11.1.6 The Grouping Operator - -function parseGroupExpression() { - var expr; - - expect("("); - - ++state.parenthesisCount; - - expr = parseExpression(); - - expect(")"); - - return expr; -} - - -// 11.1 Primary Expressions - -function parsePrimaryExpression() { - var type, token, expr, - marker, - allowJSX = extra.ecmaFeatures.jsx, - allowClasses = extra.ecmaFeatures.classes, - allowSuper = allowClasses || extra.ecmaFeatures.superInFunctions; - - if (match("(")) { - return parseGroupExpression(); - } - - if (match("[")) { - return parseArrayInitialiser(); - } - - if (match("{")) { - return parseObjectInitialiser(); - } - - if (allowJSX && match("<")) { - return parseJSXElement(); - } - - type = lookahead.type; - marker = markerCreate(); - - if (type === Token.Identifier) { - expr = astNodeFactory.createIdentifier(lex().value); - } else if (type === Token.StringLiteral || type === Token.NumericLiteral) { - if (strict && lookahead.octal) { - throwErrorTolerant(lookahead, Messages.StrictOctalLiteral); - } - expr = astNodeFactory.createLiteralFromSource(lex(), source); - } else if (type === Token.Keyword) { - if (matchKeyword("function")) { - return parseFunctionExpression(); - } - - if (allowSuper && matchKeyword("super") && state.inFunctionBody) { - marker = markerCreate(); - lex(); - return markerApply(marker, astNodeFactory.createSuper()); - } - - if (matchKeyword("this")) { - marker = markerCreate(); - lex(); - return markerApply(marker, astNodeFactory.createThisExpression()); - } - - if (allowClasses && matchKeyword("class")) { - return parseClassExpression(); - } - - throwUnexpected(lex()); - } else if (type === Token.BooleanLiteral) { - token = lex(); - token.value = (token.value === "true"); - expr = astNodeFactory.createLiteralFromSource(token, source); - } else if (type === Token.NullLiteral) { - token = lex(); - token.value = null; - expr = astNodeFactory.createLiteralFromSource(token, source); - } else if (match("/") || match("/=")) { - if (typeof extra.tokens !== "undefined") { - expr = astNodeFactory.createLiteralFromSource(collectRegex(), source); - } else { - expr = astNodeFactory.createLiteralFromSource(scanRegExp(), source); - } - peek(); - } else if (type === Token.Template) { - return parseTemplateLiteral(); - } else { - throwUnexpected(lex()); - } - - return markerApply(marker, expr); -} - -// 11.2 Left-Hand-Side Expressions - -function parseArguments() { - var args = [], arg; - - expect("("); - if (!match(")")) { - while (index < length) { - arg = parseSpreadOrAssignmentExpression(); - args.push(arg); - - if (match(")")) { - break; - } - - expect(","); - } - } - - expect(")"); - - return args; -} - -function parseSpreadOrAssignmentExpression() { - if (match("...")) { - var marker = markerCreate(); - lex(); - return markerApply(marker, astNodeFactory.createSpreadElement(parseAssignmentExpression())); - } - return parseAssignmentExpression(); -} - -function parseNonComputedProperty() { - var token, - marker = markerCreate(); - - token = lex(); - - if (!isIdentifierName(token)) { - throwUnexpected(token); - } - - return markerApply(marker, astNodeFactory.createIdentifier(token.value)); -} - -function parseNonComputedMember() { - expect("."); - - return parseNonComputedProperty(); -} - -function parseComputedMember() { - var expr; - - expect("["); - - expr = parseExpression(); - - expect("]"); - - return expr; -} - -function parseNewExpression() { - var callee, args, - marker = markerCreate(); - - expectKeyword("new"); - callee = parseLeftHandSideExpression(); - args = match("(") ? parseArguments() : []; - - return markerApply(marker, astNodeFactory.createNewExpression(callee, args)); -} - -function parseLeftHandSideExpressionAllowCall() { - var expr, args, - previousAllowIn = state.allowIn, - marker = markerCreate(); - - state.allowIn = true; - expr = matchKeyword("new") ? parseNewExpression() : parsePrimaryExpression(); - state.allowIn = previousAllowIn; - - // only start parsing template literal if the lookahead is a head (beginning with `) - while (match(".") || match("[") || match("(") || (lookahead.type === Token.Template && lookahead.head)) { - if (match("(")) { - args = parseArguments(); - expr = markerApply(marker, astNodeFactory.createCallExpression(expr, args)); - } else if (match("[")) { - expr = markerApply(marker, astNodeFactory.createMemberExpression("[", expr, parseComputedMember())); - } else if (match(".")) { - expr = markerApply(marker, astNodeFactory.createMemberExpression(".", expr, parseNonComputedMember())); - } else { - expr = markerApply(marker, astNodeFactory.createTaggedTemplateExpression(expr, parseTemplateLiteral())); - } - } - - return expr; -} - -function parseLeftHandSideExpression() { - var expr, - previousAllowIn = state.allowIn, - marker = markerCreate(); - - expr = matchKeyword("new") ? parseNewExpression() : parsePrimaryExpression(); - state.allowIn = previousAllowIn; - - // only start parsing template literal if the lookahead is a head (beginning with `) - while (match(".") || match("[") || (lookahead.type === Token.Template && lookahead.head)) { - if (match("[")) { - expr = markerApply(marker, astNodeFactory.createMemberExpression("[", expr, parseComputedMember())); - } else if (match(".")) { - expr = markerApply(marker, astNodeFactory.createMemberExpression(".", expr, parseNonComputedMember())); - } else { - expr = markerApply(marker, astNodeFactory.createTaggedTemplateExpression(expr, parseTemplateLiteral())); - } - } - - return expr; -} - - -// 11.3 Postfix Expressions - -function parsePostfixExpression() { - var expr, token, - marker = markerCreate(); - - expr = parseLeftHandSideExpressionAllowCall(); - - if (lookahead.type === Token.Punctuator) { - if ((match("++") || match("--")) && !peekLineTerminator()) { - // 11.3.1, 11.3.2 - if (strict && expr.type === astNodeTypes.Identifier && syntax.isRestrictedWord(expr.name)) { - throwErrorTolerant({}, Messages.StrictLHSPostfix); - } - - if (!isLeftHandSide(expr)) { - throwErrorTolerant({}, Messages.InvalidLHSInAssignment); - } - - token = lex(); - expr = markerApply(marker, astNodeFactory.createPostfixExpression(token.value, expr)); - } - } - - return expr; -} - -// 11.4 Unary Operators - -function parseUnaryExpression() { - var token, expr, - marker; - - if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) { - expr = parsePostfixExpression(); - } else if (match("++") || match("--")) { - marker = markerCreate(); - token = lex(); - expr = parseUnaryExpression(); - // 11.4.4, 11.4.5 - if (strict && expr.type === astNodeTypes.Identifier && syntax.isRestrictedWord(expr.name)) { - throwErrorTolerant({}, Messages.StrictLHSPrefix); - } - - if (!isLeftHandSide(expr)) { - throwErrorTolerant({}, Messages.InvalidLHSInAssignment); - } - - expr = astNodeFactory.createUnaryExpression(token.value, expr); - expr = markerApply(marker, expr); - } else if (match("+") || match("-") || match("~") || match("!")) { - marker = markerCreate(); - token = lex(); - expr = parseUnaryExpression(); - expr = astNodeFactory.createUnaryExpression(token.value, expr); - expr = markerApply(marker, expr); - } else if (matchKeyword("delete") || matchKeyword("void") || matchKeyword("typeof")) { - marker = markerCreate(); - token = lex(); - expr = parseUnaryExpression(); - expr = astNodeFactory.createUnaryExpression(token.value, expr); - expr = markerApply(marker, expr); - if (strict && expr.operator === "delete" && expr.argument.type === astNodeTypes.Identifier) { - throwErrorTolerant({}, Messages.StrictDelete); - } - } else { - expr = parsePostfixExpression(); - } - - return expr; -} - -function binaryPrecedence(token, allowIn) { - var prec = 0; - - if (token.type !== Token.Punctuator && token.type !== Token.Keyword) { - return 0; - } - - switch (token.value) { - case "||": - prec = 1; - break; - - case "&&": - prec = 2; - break; - - case "|": - prec = 3; - break; - - case "^": - prec = 4; - break; - - case "&": - prec = 5; - break; - - case "==": - case "!=": - case "===": - case "!==": - prec = 6; - break; - - case "<": - case ">": - case "<=": - case ">=": - case "instanceof": - prec = 7; - break; - - case "in": - prec = allowIn ? 7 : 0; - break; - - case "<<": - case ">>": - case ">>>": - prec = 8; - break; - - case "+": - case "-": - prec = 9; - break; - - case "*": - case "/": - case "%": - prec = 11; - break; - - default: - break; - } - - return prec; -} - -// 11.5 Multiplicative Operators -// 11.6 Additive Operators -// 11.7 Bitwise Shift Operators -// 11.8 Relational Operators -// 11.9 Equality Operators -// 11.10 Binary Bitwise Operators -// 11.11 Binary Logical Operators -function parseBinaryExpression() { - var expr, token, prec, previousAllowIn, stack, right, operator, left, i, - marker, markers; - - previousAllowIn = state.allowIn; - state.allowIn = true; - - marker = markerCreate(); - left = parseUnaryExpression(); - - token = lookahead; - prec = binaryPrecedence(token, previousAllowIn); - if (prec === 0) { - return left; - } - token.prec = prec; - lex(); - - markers = [marker, markerCreate()]; - right = parseUnaryExpression(); - - stack = [left, token, right]; - - while ((prec = binaryPrecedence(lookahead, previousAllowIn)) > 0) { - - // Reduce: make a binary expression from the three topmost entries. - while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) { - right = stack.pop(); - operator = stack.pop().value; - left = stack.pop(); - expr = astNodeFactory.createBinaryExpression(operator, left, right); - markers.pop(); - marker = markers.pop(); - markerApply(marker, expr); - stack.push(expr); - markers.push(marker); - } - - // Shift. - token = lex(); - token.prec = prec; - stack.push(token); - markers.push(markerCreate()); - expr = parseUnaryExpression(); - stack.push(expr); - } - - state.allowIn = previousAllowIn; - - // Final reduce to clean-up the stack. - i = stack.length - 1; - expr = stack[i]; - markers.pop(); - while (i > 1) { - expr = astNodeFactory.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr); - i -= 2; - marker = markers.pop(); - markerApply(marker, expr); - } - - return expr; -} - -// 11.12 Conditional Operator - -function parseConditionalExpression() { - var expr, previousAllowIn, consequent, alternate, - marker = markerCreate(); - - expr = parseBinaryExpression(); - - if (match("?")) { - lex(); - previousAllowIn = state.allowIn; - state.allowIn = true; - consequent = parseAssignmentExpression(); - state.allowIn = previousAllowIn; - expect(":"); - alternate = parseAssignmentExpression(); - - expr = astNodeFactory.createConditionalExpression(expr, consequent, alternate); - markerApply(marker, expr); - } - - return expr; -} - -// [ES6] 14.2 Arrow Function - -function parseConciseBody() { - if (match("{")) { - return parseFunctionSourceElements(); - } - return parseAssignmentExpression(); -} - -function reinterpretAsCoverFormalsList(expressions) { - var i, len, param, params, options, - allowRestParams = extra.ecmaFeatures.restParams; - - params = []; - options = { - paramSet: new StringMap() - }; - - for (i = 0, len = expressions.length; i < len; i += 1) { - param = expressions[i]; - if (param.type === astNodeTypes.Identifier) { - params.push(param); - validateParam(options, param, param.name); - } else if (param.type === astNodeTypes.ObjectExpression || param.type === astNodeTypes.ArrayExpression) { - reinterpretAsDestructuredParameter(options, param); - params.push(param); - } else if (param.type === astNodeTypes.SpreadElement) { - assert(i === len - 1, "It is guaranteed that SpreadElement is last element by parseExpression"); - if (param.argument.type !== astNodeTypes.Identifier) { - throwError({}, Messages.UnexpectedToken, "["); - } - - if (!allowRestParams) { - // can't get correct line/column here :( - throwError({}, Messages.UnexpectedToken, "."); - } - - reinterpretAsDestructuredParameter(options, param.argument); - param.type = astNodeTypes.RestElement; - params.push(param); - } else if (param.type === astNodeTypes.RestElement) { - params.push(param); - validateParam(options, param.argument, param.argument.name); - } else if (param.type === astNodeTypes.AssignmentExpression) { - - // TODO: Find a less hacky way of doing this - param.type = astNodeTypes.AssignmentPattern; - delete param.operator; - - params.push(param); - validateParam(options, param.left, param.left.name); - } else { - return null; - } - } - - if (options.message === Messages.StrictParamDupe) { - throwError( - strict ? options.stricted : options.firstRestricted, - options.message - ); - } - - return { - params: params, - stricted: options.stricted, - firstRestricted: options.firstRestricted, - message: options.message - }; -} - -function parseArrowFunctionExpression(options, marker) { - var previousStrict, body; - - expect("=>"); - previousStrict = strict; - - body = parseConciseBody(); - - if (strict && options.firstRestricted) { - throwError(options.firstRestricted, options.message); - } - if (strict && options.stricted) { - throwErrorTolerant(options.stricted, options.message); - } - - strict = previousStrict; - return markerApply(marker, astNodeFactory.createArrowFunctionExpression( - options.params, - body, - body.type !== astNodeTypes.BlockStatement - )); -} - -// 11.13 Assignment Operators - -// 12.14.5 AssignmentPattern - -function reinterpretAsAssignmentBindingPattern(expr) { - var i, len, property, element, - allowDestructuring = extra.ecmaFeatures.destructuring; - - if (!allowDestructuring) { - throwUnexpected(lex()); - } - - if (expr.type === astNodeTypes.ObjectExpression) { - expr.type = astNodeTypes.ObjectPattern; - for (i = 0, len = expr.properties.length; i < len; i += 1) { - property = expr.properties[i]; - if (property.kind !== "init") { - throwErrorTolerant({}, Messages.InvalidLHSInAssignment); - } - reinterpretAsAssignmentBindingPattern(property.value); - } - } else if (expr.type === astNodeTypes.ArrayExpression) { - expr.type = astNodeTypes.ArrayPattern; - for (i = 0, len = expr.elements.length; i < len; i += 1) { - element = expr.elements[i]; - /* istanbul ignore else */ - if (element) { - reinterpretAsAssignmentBindingPattern(element); - } - } - } else if (expr.type === astNodeTypes.Identifier) { - if (syntax.isRestrictedWord(expr.name)) { - throwErrorTolerant({}, Messages.InvalidLHSInAssignment); - } - } else if (expr.type === astNodeTypes.SpreadElement) { - reinterpretAsAssignmentBindingPattern(expr.argument); - if (expr.argument.type === astNodeTypes.ObjectPattern) { - throwErrorTolerant({}, Messages.ObjectPatternAsSpread); - } - } else if (expr.type === "AssignmentExpression" && expr.operator === "=") { - expr.type = astNodeTypes.AssignmentPattern; - } else { - /* istanbul ignore else */ - if (expr.type !== astNodeTypes.MemberExpression && - expr.type !== astNodeTypes.CallExpression && - expr.type !== astNodeTypes.NewExpression && - expr.type !== astNodeTypes.AssignmentPattern - ) { - throwErrorTolerant({}, Messages.InvalidLHSInAssignment); - } - } -} - -// 13.2.3 BindingPattern - -function reinterpretAsDestructuredParameter(options, expr) { - var i, len, property, element, - allowDestructuring = extra.ecmaFeatures.destructuring; - - if (!allowDestructuring) { - throwUnexpected(lex()); - } - - if (expr.type === astNodeTypes.ObjectExpression) { - expr.type = astNodeTypes.ObjectPattern; - for (i = 0, len = expr.properties.length; i < len; i += 1) { - property = expr.properties[i]; - if (property.kind !== "init") { - throwErrorTolerant({}, Messages.InvalidLHSInFormalsList); - } - reinterpretAsDestructuredParameter(options, property.value); - } - } else if (expr.type === astNodeTypes.ArrayExpression) { - expr.type = astNodeTypes.ArrayPattern; - for (i = 0, len = expr.elements.length; i < len; i += 1) { - element = expr.elements[i]; - if (element) { - reinterpretAsDestructuredParameter(options, element); - } - } - } else if (expr.type === astNodeTypes.Identifier) { - validateParam(options, expr, expr.name); - } else if (expr.type === astNodeTypes.SpreadElement) { - // BindingRestElement only allows BindingIdentifier - if (expr.argument.type !== astNodeTypes.Identifier) { - throwErrorTolerant({}, Messages.InvalidLHSInFormalsList); - } - validateParam(options, expr.argument, expr.argument.name); - } else if (expr.type === astNodeTypes.AssignmentExpression && expr.operator === "=") { - expr.type = astNodeTypes.AssignmentPattern; - } else if (expr.type !== astNodeTypes.AssignmentPattern) { - throwError({}, Messages.InvalidLHSInFormalsList); - } -} - -function parseAssignmentExpression() { - var token, left, right, node, params, - marker, - startsWithParen = false, - oldParenthesisCount = state.parenthesisCount, - allowGenerators = extra.ecmaFeatures.generators; - - // Note that 'yield' is treated as a keyword in strict mode, but a - // contextual keyword (identifier) in non-strict mode, so we need - // to use matchKeyword and matchContextualKeyword appropriately. - if (allowGenerators && ((state.yieldAllowed && matchContextualKeyword("yield")) || (strict && matchKeyword("yield")))) { - return parseYieldExpression(); - } - - marker = markerCreate(); - - if (match("(")) { - token = lookahead2(); - if ((token.value === ")" && token.type === Token.Punctuator) || token.value === "...") { - params = parseParams(); - if (!match("=>")) { - throwUnexpected(lex()); - } - return parseArrowFunctionExpression(params, marker); - } - startsWithParen = true; - } - - // revert to the previous lookahead style object - token = lookahead; - node = left = parseConditionalExpression(); - - if (match("=>") && - (state.parenthesisCount === oldParenthesisCount || - state.parenthesisCount === (oldParenthesisCount + 1))) { - - if (node.type === astNodeTypes.Identifier) { - params = reinterpretAsCoverFormalsList([ node ]); - } else if (node.type === astNodeTypes.AssignmentExpression || - node.type === astNodeTypes.ArrayExpression || - node.type === astNodeTypes.ObjectExpression) { - if (!startsWithParen) { - throwUnexpected(lex()); - } - params = reinterpretAsCoverFormalsList([ node ]); - } else if (node.type === astNodeTypes.SequenceExpression) { - params = reinterpretAsCoverFormalsList(node.expressions); - } - - if (params) { - return parseArrowFunctionExpression(params, marker); - } - } - - if (matchAssign()) { - - // 11.13.1 - if (strict && left.type === astNodeTypes.Identifier && syntax.isRestrictedWord(left.name)) { - throwErrorTolerant(token, Messages.StrictLHSAssignment); - } - - // ES.next draf 11.13 Runtime Semantics step 1 - if (match("=") && (node.type === astNodeTypes.ObjectExpression || node.type === astNodeTypes.ArrayExpression)) { - reinterpretAsAssignmentBindingPattern(node); - } else if (!isLeftHandSide(node)) { - throwErrorTolerant({}, Messages.InvalidLHSInAssignment); - } - - token = lex(); - right = parseAssignmentExpression(); - node = markerApply(marker, astNodeFactory.createAssignmentExpression(token.value, left, right)); - } - - return node; -} - -// 11.14 Comma Operator - -function parseExpression() { - var marker = markerCreate(), - expr = parseAssignmentExpression(), - expressions = [ expr ], - sequence, spreadFound; - - if (match(",")) { - while (index < length) { - if (!match(",")) { - break; - } - lex(); - expr = parseSpreadOrAssignmentExpression(); - expressions.push(expr); - - if (expr.type === astNodeTypes.SpreadElement) { - spreadFound = true; - if (!match(")")) { - throwError({}, Messages.ElementAfterSpreadElement); - } - break; - } - } - - sequence = markerApply(marker, astNodeFactory.createSequenceExpression(expressions)); - } - - if (spreadFound && lookahead2().value !== "=>") { - throwError({}, Messages.IllegalSpread); - } - - return sequence || expr; -} - -// 12.1 Block - -function parseStatementList() { - var list = [], - statement; - - while (index < length) { - if (match("}")) { - break; - } - statement = parseSourceElement(); - if (typeof statement === "undefined") { - break; - } - list.push(statement); - } - - return list; -} - -function parseBlock() { - var block, - marker = markerCreate(); - - expect("{"); - - block = parseStatementList(); - - expect("}"); - - return markerApply(marker, astNodeFactory.createBlockStatement(block)); -} - -// 12.2 Variable Statement - -function parseVariableIdentifier() { - var token, - marker = markerCreate(); - - token = lex(); - - if (token.type !== Token.Identifier) { - if (strict && token.type === Token.Keyword && syntax.isStrictModeReservedWord(token.value, extra.ecmaFeatures)) { - throwErrorTolerant(token, Messages.StrictReservedWord); - } else { - throwUnexpected(token); - } - } - - return markerApply(marker, astNodeFactory.createIdentifier(token.value)); -} - -function parseVariableDeclaration(kind) { - var id, - marker = markerCreate(), - init = null; - if (match("{")) { - id = parseObjectInitialiser(); - reinterpretAsAssignmentBindingPattern(id); - } else if (match("[")) { - id = parseArrayInitialiser(); - reinterpretAsAssignmentBindingPattern(id); - } else { - /* istanbul ignore next */ - id = state.allowKeyword ? parseNonComputedProperty() : parseVariableIdentifier(); - // 12.2.1 - if (strict && syntax.isRestrictedWord(id.name)) { - throwErrorTolerant({}, Messages.StrictVarName); - } - } - - // TODO: Verify against feature flags - if (kind === "const") { - if (!match("=")) { - throwError({}, Messages.NoUnintializedConst); - } - expect("="); - init = parseAssignmentExpression(); - } else if (match("=")) { - lex(); - init = parseAssignmentExpression(); - } - - return markerApply(marker, astNodeFactory.createVariableDeclarator(id, init)); -} - -function parseVariableDeclarationList(kind) { - var list = []; - - do { - list.push(parseVariableDeclaration(kind)); - if (!match(",")) { - break; - } - lex(); - } while (index < length); - - return list; -} - -function parseVariableStatement() { - var declarations; - - expectKeyword("var"); - - declarations = parseVariableDeclarationList(); - - consumeSemicolon(); - - return astNodeFactory.createVariableDeclaration(declarations, "var"); -} - -// kind may be `const` or `let` -// Both are experimental and not in the specification yet. -// see http://wiki.ecmascript.org/doku.php?id=harmony:const -// and http://wiki.ecmascript.org/doku.php?id=harmony:let -function parseConstLetDeclaration(kind) { - var declarations, - marker = markerCreate(); - - expectKeyword(kind); - - declarations = parseVariableDeclarationList(kind); - - consumeSemicolon(); - - return markerApply(marker, astNodeFactory.createVariableDeclaration(declarations, kind)); -} - - -function parseRestElement() { - var param, - marker = markerCreate(); - - lex(); - - if (match("{")) { - throwError(lookahead, Messages.ObjectPatternAsRestParameter); - } - - param = parseVariableIdentifier(); - - if (match("=")) { - throwError(lookahead, Messages.DefaultRestParameter); - } - - if (!match(")")) { - throwError(lookahead, Messages.ParameterAfterRestParameter); - } - - return markerApply(marker, astNodeFactory.createRestElement(param)); -} - -// 12.3 Empty Statement - -function parseEmptyStatement() { - expect(";"); - return astNodeFactory.createEmptyStatement(); -} - -// 12.4 Expression Statement - -function parseExpressionStatement() { - var expr = parseExpression(); - consumeSemicolon(); - return astNodeFactory.createExpressionStatement(expr); -} - -// 12.5 If statement - -function parseIfStatement() { - var test, consequent, alternate; - - expectKeyword("if"); - - expect("("); - - test = parseExpression(); - - expect(")"); - - consequent = parseStatement(); - - if (matchKeyword("else")) { - lex(); - alternate = parseStatement(); - } else { - alternate = null; - } - - return astNodeFactory.createIfStatement(test, consequent, alternate); -} - -// 12.6 Iteration Statements - -function parseDoWhileStatement() { - var body, test, oldInIteration; - - expectKeyword("do"); - - oldInIteration = state.inIteration; - state.inIteration = true; - - body = parseStatement(); - - state.inIteration = oldInIteration; - - expectKeyword("while"); - - expect("("); - - test = parseExpression(); - - expect(")"); - - if (match(";")) { - lex(); - } - - return astNodeFactory.createDoWhileStatement(test, body); -} - -function parseWhileStatement() { - var test, body, oldInIteration; - - expectKeyword("while"); - - expect("("); - - test = parseExpression(); - - expect(")"); - - oldInIteration = state.inIteration; - state.inIteration = true; - - body = parseStatement(); - - state.inIteration = oldInIteration; - - return astNodeFactory.createWhileStatement(test, body); -} - -function parseForVariableDeclaration() { - var token, declarations, - marker = markerCreate(); - - token = lex(); - declarations = parseVariableDeclarationList(); - - return markerApply(marker, astNodeFactory.createVariableDeclaration(declarations, token.value)); -} - -function parseForStatement(opts) { - var init, test, update, left, right, body, operator, oldInIteration; - var allowForOf = extra.ecmaFeatures.forOf, - allowBlockBindings = extra.ecmaFeatures.blockBindings; - - init = test = update = null; - - expectKeyword("for"); - - expect("("); - - if (match(";")) { - lex(); - } else { - - if (matchKeyword("var") || - (allowBlockBindings && (matchKeyword("let") || matchKeyword("const"))) - ) { - state.allowIn = false; - init = parseForVariableDeclaration(); - state.allowIn = true; - - if (init.declarations.length === 1) { - if (matchKeyword("in") || (allowForOf && matchContextualKeyword("of"))) { - operator = lookahead; - - // TODO: is "var" check here really needed? wasn"t in 1.2.2 - if (!((operator.value === "in" || init.kind !== "var") && init.declarations[0].init)) { - lex(); - left = init; - right = parseExpression(); - init = null; - } - } - } - - } else { - state.allowIn = false; - init = parseExpression(); - state.allowIn = true; - - if (allowForOf && matchContextualKeyword("of")) { - operator = lex(); - left = init; - right = parseExpression(); - init = null; - } else if (matchKeyword("in")) { - // LeftHandSideExpression - if (!isLeftHandSide(init)) { - throwErrorTolerant({}, Messages.InvalidLHSInForIn); - } - - operator = lex(); - left = init; - right = parseExpression(); - init = null; - } - } - - if (typeof left === "undefined") { - expect(";"); - } - } - - if (typeof left === "undefined") { - - if (!match(";")) { - test = parseExpression(); - } - expect(";"); - - if (!match(")")) { - update = parseExpression(); - } - } - - expect(")"); - - oldInIteration = state.inIteration; - state.inIteration = true; - - if (!(opts !== undefined && opts.ignoreBody)) { - body = parseStatement(); - } - - state.inIteration = oldInIteration; - - if (typeof left === "undefined") { - return astNodeFactory.createForStatement(init, test, update, body); - } - - if (extra.ecmaFeatures.forOf && operator.value === "of") { - return astNodeFactory.createForOfStatement(left, right, body); - } - - return astNodeFactory.createForInStatement(left, right, body); -} - -// 12.7 The continue statement - -function parseContinueStatement() { - var label = null; - - expectKeyword("continue"); - - // Optimize the most common form: "continue;". - if (source.charCodeAt(index) === 0x3B) { - lex(); - - if (!state.inIteration) { - throwError({}, Messages.IllegalContinue); - } - - return astNodeFactory.createContinueStatement(null); - } - - if (peekLineTerminator()) { - if (!state.inIteration) { - throwError({}, Messages.IllegalContinue); - } - - return astNodeFactory.createContinueStatement(null); - } - - if (lookahead.type === Token.Identifier) { - label = parseVariableIdentifier(); - - if (!state.labelSet.has(label.name)) { - throwError({}, Messages.UnknownLabel, label.name); - } - } - - consumeSemicolon(); - - if (label === null && !state.inIteration) { - throwError({}, Messages.IllegalContinue); - } - - return astNodeFactory.createContinueStatement(label); -} - -// 12.8 The break statement - -function parseBreakStatement() { - var label = null; - - expectKeyword("break"); - - // Catch the very common case first: immediately a semicolon (U+003B). - if (source.charCodeAt(index) === 0x3B) { - lex(); - - if (!(state.inIteration || state.inSwitch)) { - throwError({}, Messages.IllegalBreak); - } - - return astNodeFactory.createBreakStatement(null); - } - - if (peekLineTerminator()) { - if (!(state.inIteration || state.inSwitch)) { - throwError({}, Messages.IllegalBreak); - } - - return astNodeFactory.createBreakStatement(null); - } - - if (lookahead.type === Token.Identifier) { - label = parseVariableIdentifier(); - - if (!state.labelSet.has(label.name)) { - throwError({}, Messages.UnknownLabel, label.name); - } - } - - consumeSemicolon(); - - if (label === null && !(state.inIteration || state.inSwitch)) { - throwError({}, Messages.IllegalBreak); - } - - return astNodeFactory.createBreakStatement(label); -} - -// 12.9 The return statement - -function parseReturnStatement() { - var argument = null; - - expectKeyword("return"); - - if (!state.inFunctionBody && !extra.ecmaFeatures.globalReturn) { - throwErrorTolerant({}, Messages.IllegalReturn); - } - - // "return" followed by a space and an identifier is very common. - if (source.charCodeAt(index) === 0x20) { - if (syntax.isIdentifierStart(source.charCodeAt(index + 1))) { - argument = parseExpression(); - consumeSemicolon(); - return astNodeFactory.createReturnStatement(argument); - } - } - - if (peekLineTerminator()) { - return astNodeFactory.createReturnStatement(null); - } - - if (!match(";")) { - if (!match("}") && lookahead.type !== Token.EOF) { - argument = parseExpression(); - } - } - - consumeSemicolon(); - - return astNodeFactory.createReturnStatement(argument); -} - -// 12.10 The with statement - -function parseWithStatement() { - var object, body; - - if (strict) { - // TODO(ikarienator): Should we update the test cases instead? - skipComment(); - throwErrorTolerant({}, Messages.StrictModeWith); - } - - expectKeyword("with"); - - expect("("); - - object = parseExpression(); - - expect(")"); - - body = parseStatement(); - - return astNodeFactory.createWithStatement(object, body); -} - -// 12.10 The swith statement - -function parseSwitchCase() { - var test, consequent = [], statement, - marker = markerCreate(); - - if (matchKeyword("default")) { - lex(); - test = null; - } else { - expectKeyword("case"); - test = parseExpression(); - } - expect(":"); - - while (index < length) { - if (match("}") || matchKeyword("default") || matchKeyword("case")) { - break; - } - statement = parseSourceElement(); - if (typeof statement === "undefined") { - break; - } - consequent.push(statement); - } - - return markerApply(marker, astNodeFactory.createSwitchCase(test, consequent)); -} - -function parseSwitchStatement() { - var discriminant, cases, clause, oldInSwitch, defaultFound; - - expectKeyword("switch"); - - expect("("); - - discriminant = parseExpression(); - - expect(")"); - - expect("{"); - - cases = []; - - if (match("}")) { - lex(); - return astNodeFactory.createSwitchStatement(discriminant, cases); - } - - oldInSwitch = state.inSwitch; - state.inSwitch = true; - defaultFound = false; - - while (index < length) { - if (match("}")) { - break; - } - clause = parseSwitchCase(); - if (clause.test === null) { - if (defaultFound) { - throwError({}, Messages.MultipleDefaultsInSwitch); - } - defaultFound = true; - } - cases.push(clause); - } - - state.inSwitch = oldInSwitch; - - expect("}"); - - return astNodeFactory.createSwitchStatement(discriminant, cases); -} - -// 12.13 The throw statement - -function parseThrowStatement() { - var argument; - - expectKeyword("throw"); - - if (peekLineTerminator()) { - throwError({}, Messages.NewlineAfterThrow); - } - - argument = parseExpression(); - - consumeSemicolon(); - - return astNodeFactory.createThrowStatement(argument); -} - -// 12.14 The try statement - -function parseCatchClause() { - var param, body, - marker = markerCreate(), - allowDestructuring = extra.ecmaFeatures.destructuring, - options = { - paramSet: new StringMap() - }; - - expectKeyword("catch"); - - expect("("); - if (match(")")) { - throwUnexpected(lookahead); - } - - if (match("[")) { - if (!allowDestructuring) { - throwUnexpected(lookahead); - } - param = parseArrayInitialiser(); - reinterpretAsDestructuredParameter(options, param); - } else if (match("{")) { - - if (!allowDestructuring) { - throwUnexpected(lookahead); - } - param = parseObjectInitialiser(); - reinterpretAsDestructuredParameter(options, param); - } else { - param = parseVariableIdentifier(); - } - - // 12.14.1 - if (strict && param.name && syntax.isRestrictedWord(param.name)) { - throwErrorTolerant({}, Messages.StrictCatchVariable); - } - - expect(")"); - body = parseBlock(); - return markerApply(marker, astNodeFactory.createCatchClause(param, body)); -} - -function parseTryStatement() { - var block, handler = null, finalizer = null; - - expectKeyword("try"); - - block = parseBlock(); - - if (matchKeyword("catch")) { - handler = parseCatchClause(); - } - - if (matchKeyword("finally")) { - lex(); - finalizer = parseBlock(); - } - - if (!handler && !finalizer) { - throwError({}, Messages.NoCatchOrFinally); - } - - return astNodeFactory.createTryStatement(block, handler, finalizer); -} - -// 12.15 The debugger statement - -function parseDebuggerStatement() { - expectKeyword("debugger"); - - consumeSemicolon(); - - return astNodeFactory.createDebuggerStatement(); -} - -// 12 Statements - -function parseStatement() { - var type = lookahead.type, - expr, - labeledBody, - marker; - - if (type === Token.EOF) { - throwUnexpected(lookahead); - } - - if (type === Token.Punctuator && lookahead.value === "{") { - return parseBlock(); - } - - marker = markerCreate(); - - if (type === Token.Punctuator) { - switch (lookahead.value) { - case ";": - return markerApply(marker, parseEmptyStatement()); - case "{": - return parseBlock(); - case "(": - return markerApply(marker, parseExpressionStatement()); - default: - break; - } - } - - marker = markerCreate(); - - if (type === Token.Keyword) { - switch (lookahead.value) { - case "break": - return markerApply(marker, parseBreakStatement()); - case "continue": - return markerApply(marker, parseContinueStatement()); - case "debugger": - return markerApply(marker, parseDebuggerStatement()); - case "do": - return markerApply(marker, parseDoWhileStatement()); - case "for": - return markerApply(marker, parseForStatement()); - case "function": - return markerApply(marker, parseFunctionDeclaration()); - case "if": - return markerApply(marker, parseIfStatement()); - case "return": - return markerApply(marker, parseReturnStatement()); - case "switch": - return markerApply(marker, parseSwitchStatement()); - case "throw": - return markerApply(marker, parseThrowStatement()); - case "try": - return markerApply(marker, parseTryStatement()); - case "var": - return markerApply(marker, parseVariableStatement()); - case "while": - return markerApply(marker, parseWhileStatement()); - case "with": - return markerApply(marker, parseWithStatement()); - default: - break; - } - } - - marker = markerCreate(); - expr = parseExpression(); - - // 12.12 Labelled Statements - if ((expr.type === astNodeTypes.Identifier) && match(":")) { - lex(); - - if (state.labelSet.has(expr.name)) { - throwError({}, Messages.Redeclaration, "Label", expr.name); - } - - state.labelSet.set(expr.name, true); - labeledBody = parseStatement(); - state.labelSet.delete(expr.name); - return markerApply(marker, astNodeFactory.createLabeledStatement(expr, labeledBody)); - } - - consumeSemicolon(); - - return markerApply(marker, astNodeFactory.createExpressionStatement(expr)); -} - -// 13 Function Definition - -// function parseConciseBody() { -// if (match("{")) { -// return parseFunctionSourceElements(); -// } -// return parseAssignmentExpression(); -// } - -function parseFunctionSourceElements() { - var sourceElement, sourceElements = [], token, directive, firstRestricted, - oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, oldParenthesisCount, - marker = markerCreate(); - - expect("{"); - - while (index < length) { - if (lookahead.type !== Token.StringLiteral) { - break; - } - token = lookahead; - - sourceElement = parseSourceElement(); - sourceElements.push(sourceElement); - if (sourceElement.expression.type !== astNodeTypes.Literal) { - // this is not directive - break; - } - directive = source.slice(token.range[0] + 1, token.range[1] - 1); - if (directive === "use strict") { - strict = true; - - if (firstRestricted) { - throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral); - } - } else { - if (!firstRestricted && token.octal) { - firstRestricted = token; - } - } - } - - oldLabelSet = state.labelSet; - oldInIteration = state.inIteration; - oldInSwitch = state.inSwitch; - oldInFunctionBody = state.inFunctionBody; - oldParenthesisCount = state.parenthesizedCount; - - state.labelSet = new StringMap(); - state.inIteration = false; - state.inSwitch = false; - state.inFunctionBody = true; - - while (index < length) { - - if (match("}")) { - break; - } - - sourceElement = parseSourceElement(); - - if (typeof sourceElement === "undefined") { - break; - } - - sourceElements.push(sourceElement); - } - - expect("}"); - - state.labelSet = oldLabelSet; - state.inIteration = oldInIteration; - state.inSwitch = oldInSwitch; - state.inFunctionBody = oldInFunctionBody; - state.parenthesizedCount = oldParenthesisCount; - - return markerApply(marker, astNodeFactory.createBlockStatement(sourceElements)); -} - -function validateParam(options, param, name) { - - if (strict) { - if (syntax.isRestrictedWord(name)) { - options.stricted = param; - options.message = Messages.StrictParamName; - } - - if (options.paramSet.has(name)) { - options.stricted = param; - options.message = Messages.StrictParamDupe; - } - } else if (!options.firstRestricted) { - if (syntax.isRestrictedWord(name)) { - options.firstRestricted = param; - options.message = Messages.StrictParamName; - } else if (syntax.isStrictModeReservedWord(name, extra.ecmaFeatures)) { - options.firstRestricted = param; - options.message = Messages.StrictReservedWord; - } else if (options.paramSet.has(name)) { - options.firstRestricted = param; - options.message = Messages.StrictParamDupe; - } - } - options.paramSet.set(name, true); -} - -function parseParam(options) { - var token, param, def, - allowRestParams = extra.ecmaFeatures.restParams, - allowDestructuring = extra.ecmaFeatures.destructuring, - allowDefaultParams = extra.ecmaFeatures.defaultParams, - marker = markerCreate(); - - token = lookahead; - if (token.value === "...") { - if (!allowRestParams) { - throwUnexpected(lookahead); - } - param = parseRestElement(); - validateParam(options, param.argument, param.argument.name); - options.params.push(param); - return false; - } - - if (match("[")) { - if (!allowDestructuring) { - throwUnexpected(lookahead); - } - param = parseArrayInitialiser(); - reinterpretAsDestructuredParameter(options, param); - } else if (match("{")) { - if (!allowDestructuring) { - throwUnexpected(lookahead); - } - param = parseObjectInitialiser(); - reinterpretAsDestructuredParameter(options, param); - } else { - param = parseVariableIdentifier(); - validateParam(options, token, token.value); - } - - if (match("=")) { - if (allowDefaultParams || allowDestructuring) { - lex(); - def = parseAssignmentExpression(); - ++options.defaultCount; - } else { - throwUnexpected(lookahead); - } - } - - if (def) { - options.params.push(markerApply( - marker, - astNodeFactory.createAssignmentPattern( - param, - def - ) - )); - } else { - options.params.push(param); - } - - return !match(")"); -} - - -function parseParams(firstRestricted) { - var options; - - options = { - params: [], - defaultCount: 0, - firstRestricted: firstRestricted - }; - - expect("("); - - if (!match(")")) { - options.paramSet = new StringMap(); - while (index < length) { - if (!parseParam(options)) { - break; - } - expect(","); - } - } - - expect(")"); - - return { - params: options.params, - stricted: options.stricted, - firstRestricted: options.firstRestricted, - message: options.message - }; -} - -function parseFunctionDeclaration(identifierIsOptional) { - var id = null, body, token, tmp, firstRestricted, message, previousStrict, previousYieldAllowed, generator, - marker = markerCreate(), - allowGenerators = extra.ecmaFeatures.generators; - - expectKeyword("function"); - - generator = false; - if (allowGenerators && match("*")) { - lex(); - generator = true; - } - - if (!identifierIsOptional || !match("(")) { - - token = lookahead; - - id = parseVariableIdentifier(); - - if (strict) { - if (syntax.isRestrictedWord(token.value)) { - throwErrorTolerant(token, Messages.StrictFunctionName); - } - } else { - if (syntax.isRestrictedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictFunctionName; - } else if (syntax.isStrictModeReservedWord(token.value, extra.ecmaFeatures)) { - firstRestricted = token; - message = Messages.StrictReservedWord; - } - } - } - - tmp = parseParams(firstRestricted); - firstRestricted = tmp.firstRestricted; - if (tmp.message) { - message = tmp.message; - } - - previousStrict = strict; - previousYieldAllowed = state.yieldAllowed; - state.yieldAllowed = generator; - - body = parseFunctionSourceElements(); - - if (strict && firstRestricted) { - throwError(firstRestricted, message); - } - if (strict && tmp.stricted) { - throwErrorTolerant(tmp.stricted, message); - } - strict = previousStrict; - state.yieldAllowed = previousYieldAllowed; - - return markerApply( - marker, - astNodeFactory.createFunctionDeclaration( - id, - tmp.params, - body, - generator, - false - ) - ); - } - -function parseFunctionExpression() { - var token, id = null, firstRestricted, message, tmp, body, previousStrict, previousYieldAllowed, generator, - marker = markerCreate(), - allowGenerators = extra.ecmaFeatures.generators; - - expectKeyword("function"); - - generator = false; - - if (allowGenerators && match("*")) { - lex(); - generator = true; - } - - if (!match("(")) { - token = lookahead; - id = parseVariableIdentifier(); - if (strict) { - if (syntax.isRestrictedWord(token.value)) { - throwErrorTolerant(token, Messages.StrictFunctionName); - } - } else { - if (syntax.isRestrictedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictFunctionName; - } else if (syntax.isStrictModeReservedWord(token.value, extra.ecmaFeatures)) { - firstRestricted = token; - message = Messages.StrictReservedWord; - } - } - } - - tmp = parseParams(firstRestricted); - firstRestricted = tmp.firstRestricted; - if (tmp.message) { - message = tmp.message; - } - - previousStrict = strict; - previousYieldAllowed = state.yieldAllowed; - state.yieldAllowed = generator; - - body = parseFunctionSourceElements(); - - if (strict && firstRestricted) { - throwError(firstRestricted, message); - } - if (strict && tmp.stricted) { - throwErrorTolerant(tmp.stricted, message); - } - strict = previousStrict; - state.yieldAllowed = previousYieldAllowed; - - return markerApply( - marker, - astNodeFactory.createFunctionExpression( - id, - tmp.params, - body, - generator, - false - ) - ); -} - -function parseYieldExpression() { - var yieldToken, delegateFlag, expr, marker = markerCreate(); - - yieldToken = lex(); - assert(yieldToken.value === "yield", "Called parseYieldExpression with non-yield lookahead."); - - if (!state.yieldAllowed) { - throwErrorTolerant({}, Messages.IllegalYield); - } - - delegateFlag = false; - if (match("*")) { - lex(); - delegateFlag = true; - } - - if (peekLineTerminator()) { - return markerApply(marker, astNodeFactory.createYieldExpression(null, delegateFlag)); - } - - if (!match(";") && !match(")")) { - if (!match("}") && lookahead.type !== Token.EOF) { - expr = parseAssignmentExpression(); - } - } - - return markerApply(marker, astNodeFactory.createYieldExpression(expr, delegateFlag)); -} - -// Modules grammar from: -// people.mozilla.org/~jorendorff/es6-draft.html - -function parseModuleSpecifier() { - var marker = markerCreate(), - specifier; - - if (lookahead.type !== Token.StringLiteral) { - throwError({}, Messages.InvalidModuleSpecifier); - } - specifier = astNodeFactory.createLiteralFromSource(lex(), source); - return markerApply(marker, specifier); -} - -function parseExportSpecifier() { - var exported, local, marker = markerCreate(); - if (matchKeyword("default")) { - lex(); - local = markerApply(marker, astNodeFactory.createIdentifier("default")); - // export {default} from "something"; - } else { - local = parseVariableIdentifier(); - } - if (matchContextualKeyword("as")) { - lex(); - exported = parseNonComputedProperty(); - } - return markerApply(marker, astNodeFactory.createExportSpecifier(local, exported)); -} +"use strict"; -function parseExportNamedDeclaration() { - var declaration = null, - isExportFromIdentifier, - src = null, specifiers = [], - marker = markerCreate(); - - expectKeyword("export"); - - // non-default export - if (lookahead.type === Token.Keyword) { - // covers: - // export var f = 1; - switch (lookahead.value) { - case "let": - case "const": - case "var": - case "class": - case "function": - declaration = parseSourceElement(); - return markerApply(marker, astNodeFactory.createExportNamedDeclaration(declaration, specifiers, null)); - default: - break; - } - } +var astNodeTypes = require("./lib/ast-node-types"), + commentAttachment = require("./lib/comment-attachment"), + TokenTranslator = require("./lib/token-translator"), + acornJSX = require("acorn-jsx/inject"), + rawAcorn = require("acorn"); - expect("{"); - if (!match("}")) { - do { - isExportFromIdentifier = isExportFromIdentifier || matchKeyword("default"); - specifiers.push(parseExportSpecifier()); - } while (match(",") && lex()); - } - expect("}"); - - if (matchContextualKeyword("from")) { - // covering: - // export {default} from "foo"; - // export {foo} from "foo"; - lex(); - src = parseModuleSpecifier(); - consumeSemicolon(); - } else if (isExportFromIdentifier) { - // covering: - // export {default}; // missing fromClause - throwError({}, lookahead.value ? - Messages.UnexpectedToken : Messages.MissingFromClause, lookahead.value); - } else { - // cover - // export {foo}; - consumeSemicolon(); - } - return markerApply(marker, astNodeFactory.createExportNamedDeclaration(declaration, specifiers, src)); -} -function parseExportDefaultDeclaration() { - var declaration = null, - expression = null, - possibleIdentifierToken, - allowClasses = extra.ecmaFeatures.classes, - marker = markerCreate(); - - // covers: - // export default ... - expectKeyword("export"); - expectKeyword("default"); - - if (matchKeyword("function") || matchKeyword("class")) { - possibleIdentifierToken = lookahead2(); - if (possibleIdentifierToken.type === Token.Identifier) { - // covers: - // export default function foo () {} - // export default class foo {} - declaration = parseSourceElement(); - return markerApply(marker, astNodeFactory.createExportDefaultDeclaration(declaration)); - } - // covers: - // export default function () {} - // export default class {} - if (lookahead.value === "function") { - declaration = parseFunctionDeclaration(true); - return markerApply(marker, astNodeFactory.createExportDefaultDeclaration(declaration)); - } else if (allowClasses && lookahead.value === "class") { - declaration = parseClassDeclaration(true); - return markerApply(marker, astNodeFactory.createExportDefaultDeclaration(declaration)); - } - } +var acorn = acornJSX(rawAcorn); - if (matchContextualKeyword("from")) { - throwError({}, Messages.UnexpectedToken, lookahead.value); - } +var lookahead, + extra, + lastToken; - // covers: - // export default {}; - // export default []; - // export default (1 + 2); - if (match("{")) { - expression = parseObjectInitialiser(); - } else if (match("[")) { - expression = parseArrayInitialiser(); - } else { - expression = parseAssignmentExpression(); - } - consumeSemicolon(); - return markerApply(marker, astNodeFactory.createExportDefaultDeclaration(expression)); +/** + * Resets the extra object to its default. + * @returns {void} + * @private + */ +function resetExtra() { + extra = { + tokens: null, + range: false, + loc: false, + comment: false, + comments: [], + tolerant: false, + errors: [], + strict: false, + ecmaFeatures: {}, + ecmaVersion: 5, + isModule: false + }; } -function parseExportAllDeclaration() { - var src, - marker = markerCreate(); - // covers: - // export * from "foo"; - expectKeyword("export"); - expect("*"); - if (!matchContextualKeyword("from")) { - throwError({}, lookahead.value ? - Messages.UnexpectedToken : Messages.MissingFromClause, lookahead.value); - } - lex(); - src = parseModuleSpecifier(); - consumeSemicolon(); +var tt = acorn.tokTypes, + getLineInfo = acorn.getLineInfo; - return markerApply(marker, astNodeFactory.createExportAllDeclaration(src)); -} +// custom type for JSX attribute values +tt.jsxAttrValueToken = {}; -function parseExportDeclaration() { - if (state.inFunctionBody) { - throwError({}, Messages.IllegalExportDeclaration); - } - var declarationType = lookahead2().value; - if (declarationType === "default") { - return parseExportDefaultDeclaration(); - } else if (declarationType === "*") { - return parseExportAllDeclaration(); - } else { - return parseExportNamedDeclaration(); - } -} +/** + * Determines if a node is valid given the set of ecmaFeatures. + * @param {ASTNode} node The node to check. + * @returns {boolean} True if the node is allowed, false if not. + * @private + */ +function isValidNode(node) { + var ecma = extra.ecmaFeatures; -function parseImportSpecifier() { - // import {} ...; - var local, imported, marker = markerCreate(); + switch (node.type) { + case "ExperimentalSpreadProperty": + case "ExperimentalRestProperty": + return ecma.experimentalObjectRestSpread; - imported = parseNonComputedProperty(); - if (matchContextualKeyword("as")) { - lex(); - local = parseVariableIdentifier(); - } + case "ImportDeclaration": + case "ExportNamedDeclaration": + case "ExportDefaultDeclaration": + case "ExportAllDeclaration": + return extra.isModule; - return markerApply(marker, astNodeFactory.createImportSpecifier(local, imported)); + default: + return true; + } } -function parseNamedImports() { - var specifiers = []; - // {foo, bar as bas} - expect("{"); - if (!match("}")) { - do { - specifiers.push(parseImportSpecifier()); - } while (match(",") && lex()); +/** + * Performs last-minute Esprima-specific compatibility checks and fixes. + * @param {ASTNode} result The node to check. + * @returns {ASTNode} The finished node. + * @private + * @this acorn.Parser + */ +function esprimaFinishNode(result) { + // ensure that parsed node was allowed through ecmaFeatures + if (!isValidNode(result)) { + this.unexpected(result.start); } - expect("}"); - return specifiers; -} -function parseImportDefaultSpecifier() { - // import ...; - var local, marker = markerCreate(); + // https://github.com/marijnh/acorn/issues/323 + if (result.type === "TryStatement") { + delete result.guardedHandlers; + } else if (result.type === "CatchClause") { + delete result.guard; + } - local = parseNonComputedProperty(); + // Acorn doesn't count the opening and closing backticks as part of templates + // so we have to adjust ranges/locations appropriately. + if (result.type === "TemplateElement") { - return markerApply(marker, astNodeFactory.createImportDefaultSpecifier(local)); -} + // additional adjustment needed if ${ is the last token + var terminalDollarBraceL = this.input.slice(result.end, result.end + 2) === "${"; -function parseImportNamespaceSpecifier() { - // import <* as foo> ...; - var local, marker = markerCreate(); + if (result.range) { + result.range[0]--; + result.range[1] += (terminalDollarBraceL ? 2 : 1); + } - expect("*"); - if (!matchContextualKeyword("as")) { - throwError({}, Messages.NoAsAfterImportNamespace); + if (result.loc) { + result.loc.start.column--; + result.loc.end.column += (terminalDollarBraceL ? 2 : 1); + } } - lex(); - local = parseNonComputedProperty(); - - return markerApply(marker, astNodeFactory.createImportNamespaceSpecifier(local)); -} - -function parseImportDeclaration() { - var specifiers, src, marker = markerCreate(); - if (state.inFunctionBody) { - throwError({}, Messages.IllegalImportDeclaration); + // Acorn currently uses expressions instead of declarations in default exports + if (result.type === "ExportDefaultDeclaration") { + if (/^(Class|Function)Expression$/.test(result.declaration.type)) { + result.declaration.type = result.declaration.type.replace("Expression", "Declaration"); + } } - expectKeyword("import"); - specifiers = []; - - if (lookahead.type === Token.StringLiteral) { - // covers: - // import "foo"; - src = parseModuleSpecifier(); - consumeSemicolon(); - return markerApply(marker, astNodeFactory.createImportDeclaration(specifiers, src)); + // Acorn uses undefined instead of null, which affects serialization + if (result.type === "Literal" && result.value === undefined) { + result.value = null; } - if (!matchKeyword("default") && isIdentifierName(lookahead)) { - // covers: - // import foo - // import foo, ... - specifiers.push(parseImportDefaultSpecifier()); - if (match(",")) { - lex(); - } - } - if (match("*")) { - // covers: - // import foo, * as foo - // import * as foo - specifiers.push(parseImportNamespaceSpecifier()); - } else if (match("{")) { - // covers: - // import foo, {bar} - // import {bar} - specifiers = specifiers.concat(parseNamedImports()); + if (extra.attachComment) { + commentAttachment.processComment(result); } - if (!matchContextualKeyword("from")) { - throwError({}, lookahead.value ? - Messages.UnexpectedToken : Messages.MissingFromClause, lookahead.value); + if (result.type.indexOf("Function") > -1 && !result.generator) { + result.generator = false; } - lex(); - src = parseModuleSpecifier(); - consumeSemicolon(); - return markerApply(marker, astNodeFactory.createImportDeclaration(specifiers, src)); + return result; } -// 14 Functions and classes +/** + * Determines if a token is valid given the set of ecmaFeatures. + * @param {acorn.Parser} parser The parser to check. + * @returns {boolean} True if the token is allowed, false if not. + * @private + */ +function isValidToken(parser) { + var ecma = extra.ecmaFeatures; + var type = parser.type; -// 14.1 Functions is defined above (13 in ES5) -// 14.2 Arrow Functions Definitions is defined in (7.3 assignments) + switch (type) { + case tt.jsxName: + case tt.jsxText: + case tt.jsxTagStart: + case tt.jsxTagEnd: + return ecma.jsx; -// 14.3 Method Definitions -// 14.3.7 + // https://github.com/ternjs/acorn/issues/363 + case tt.regexp: + if (extra.ecmaVersion < 6 && parser.value.flags && parser.value.flags.indexOf("y") > -1) { + return false; + } -// 14.5 Class Definitions + return true; -function parseClassBody() { - var hasConstructor = false, generator = false, - allowGenerators = extra.ecmaFeatures.generators, - token, isStatic, body = [], method, computed, key; + default: + return true; + } +} - var existingProps = {}, - topMarker = markerCreate(), - marker; +/** + * Injects esprimaFinishNode into the finishNode process. + * @param {Function} finishNode Original finishNode function. + * @returns {ASTNode} The finished node. + * @private + */ +function wrapFinishNode(finishNode) { + return /** @this acorn.Parser */ function(node, type, pos, loc) { + var result = finishNode.call(this, node, type, pos, loc); + return esprimaFinishNode.call(this, result); + }; +} - existingProps.static = new StringMap(); - existingProps.prototype = new StringMap(); +acorn.plugins.espree = function(instance) { - expect("{"); + instance.extend("finishNode", wrapFinishNode); - while (!match("}")) { + instance.extend("finishNodeAt", wrapFinishNode); - // extra semicolons are fine - if (match(";")) { - lex(); - continue; - } + instance.extend("next", function(next) { + return /** @this acorn.Parser */ function() { + if (!isValidToken(this)) { + this.unexpected(); + } + return next.call(this); + }; + }); - token = lookahead; - isStatic = false; - generator = match("*"); - computed = match("["); - marker = markerCreate(); + // needed for experimental object rest/spread + instance.extend("checkLVal", function(checkLVal) { - if (generator) { - if (!allowGenerators) { - throwUnexpected(lookahead); + return /** @this acorn.Parser */ function(expr, isBinding, checkClashes) { + + if (extra.ecmaFeatures.experimentalObjectRestSpread && expr.type === "ObjectPattern") { + for (var i = 0; i < expr.properties.length; i++) { + if (expr.properties[i].type.indexOf("Experimental") === -1) { + this.checkLVal(expr.properties[i].value, isBinding, checkClashes); + } + } + return undefined; } - lex(); - } - key = parseObjectPropertyKey(); + return checkLVal.call(this, expr, isBinding, checkClashes); + }; + }); - // static generator methods - if (key.name === "static" && match("*")) { - if (!allowGenerators) { - throwUnexpected(lookahead); + instance.extend("parseTopLevel", function(parseTopLevel) { + return /** @this acorn.Parser */ function(node) { + if (extra.ecmaFeatures.impliedStrict && this.options.ecmaVersion >= 5) { + this.strict = true; } - generator = true; - lex(); - } + return parseTopLevel.call(this, node); + }; + }); - if (key.name === "static" && lookaheadPropertyName()) { - token = lookahead; - isStatic = true; - computed = match("["); - key = parseObjectPropertyKey(); - } + instance.extend("toAssignable", function(toAssignable) { - if (generator) { - method = parseGeneratorProperty(key, marker); - } else { - method = tryParseMethodDefinition(token, key, computed, marker, generator); - } + return /** @this acorn.Parser */ function(node, isBinding) { - if (method) { - method.static = isStatic; - if (method.kind === "init") { - method.kind = "method"; - } + if (extra.ecmaFeatures.experimentalObjectRestSpread && + node.type === "ObjectExpression" + ) { + node.type = "ObjectPattern"; - if (!isStatic) { + for (var i = 0; i < node.properties.length; i++) { + var prop = node.properties[i]; - if (!method.computed && (method.key.name || (method.key.value && method.key.value.toString())) === "constructor") { - if (method.kind !== "method" || !method.method || method.value.generator) { - throwUnexpected(token, Messages.ConstructorSpecialMethod); - } - if (hasConstructor) { - throwUnexpected(token, Messages.DuplicateConstructor); + if (prop.type === "ExperimentalSpreadProperty") { + prop.type = "ExperimentalRestProperty"; + } else if (prop.kind !== "init") { + this.raise(prop.key.start, "Object pattern can't contain getter or setter"); } else { - hasConstructor = true; + this.toAssignable(prop.value, isBinding); } - method.kind = "constructor"; } + + return node; } else { - if (!method.computed && (method.key.name || method.key.value.toString()) === "prototype") { - throwUnexpected(token, Messages.StaticPrototype); - } + return toAssignable.call(this, node, isBinding); } - method.type = astNodeTypes.MethodDefinition; - delete method.method; - delete method.shorthand; - body.push(method); - } else { - throwUnexpected(lookahead); - } - } - - lex(); - return markerApply(topMarker, astNodeFactory.createClassBody(body)); -} - -function parseClassExpression() { - var id = null, superClass = null, marker = markerCreate(), - previousStrict = strict, classBody; - - // classes run in strict mode - strict = true; + }; - expectKeyword("class"); + }); - if (lookahead.type === Token.Identifier) { - id = parseVariableIdentifier(); - } + /** + * Method to parse an object rest or object spread. + * @returns {ASTNode} The node representing object rest or object spread. + * @this acorn.Parser + */ + instance.parseObjectRest = function() { + var node = this.startNode(); + this.next(); + node.argument = this.parseIdent(); + return this.finishNode(node, "ExperimentalRestProperty"); + }; - if (matchKeyword("extends")) { - lex(); - superClass = parseLeftHandSideExpressionAllowCall(); - } + /** + * Method to parse an object with object rest or object spread. + * @param {boolean} isPattern True if the object is a destructuring pattern. + * @param {Object} refShorthandDefaultPos ? + * @returns {ASTNode} The node representing object rest or object spread. + * @this acorn.Parser + */ + instance.parseObj = function(isPattern, refShorthandDefaultPos) { + var node = this.startNode(), + first = true, + propHash = {}; + node.properties = []; + this.next(); + while (!this.eat(tt.braceR)) { + + if (!first) { + this.expect(tt.comma); + + if (this.afterTrailingComma(tt.braceR)) { + break; + } - classBody = parseClassBody(); - strict = previousStrict; + } else { + first = false; + } - return markerApply(marker, astNodeFactory.createClassExpression(id, superClass, classBody)); -} + var prop = this.startNode(), + isGenerator, + startPos, + startLoc; -function parseClassDeclaration(identifierIsOptional) { - var id = null, superClass = null, marker = markerCreate(), - previousStrict = strict, classBody; + if (extra.ecmaFeatures.experimentalObjectRestSpread && this.type === tt.ellipsis) { + if (isPattern) { + prop = this.parseObjectRest(); + } else { + prop = this.parseSpread(); + prop.type = "ExperimentalSpreadProperty"; + } - // classes run in strict mode - strict = true; + node.properties.push(prop); + continue; + } - expectKeyword("class"); + if (this.options.ecmaVersion >= 6) { + prop.method = false; + prop.shorthand = false; - if (!identifierIsOptional || lookahead.type === Token.Identifier) { - id = parseVariableIdentifier(); - } + if (isPattern || refShorthandDefaultPos) { + startPos = this.start; + startLoc = this.startLoc; + } - if (matchKeyword("extends")) { - lex(); - superClass = parseLeftHandSideExpressionAllowCall(); - } + if (!isPattern) { + isGenerator = this.eat(tt.star); + } + } - classBody = parseClassBody(); - strict = previousStrict; + this.parsePropertyName(prop); + this.parsePropertyValue(prop, isPattern, isGenerator, startPos, startLoc, refShorthandDefaultPos); + this.checkPropClash(prop, propHash); + node.properties.push(this.finishNode(prop, "Property")); + } - return markerApply(marker, astNodeFactory.createClassDeclaration(id, superClass, classBody)); -} + return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression"); + }; -// 15 Program + /** + * Overwrites the default raise method to throw Esprima-style errors. + * @param {int} pos The position of the error. + * @param {string} message The error message. + * @throws {SyntaxError} A syntax error. + * @returns {void} + */ + instance.raise = instance.raiseRecoverable = function(pos, message) { + var loc = getLineInfo(this.input, pos); + var err = new SyntaxError(message); + err.index = pos; + err.lineNumber = loc.line; + err.column = loc.column + 1; // acorn uses 0-based columns + throw err; + }; -function parseSourceElement() { + /** + * Overwrites the default unexpected method to throw Esprima-style errors. + * @param {int} pos The position of the error. + * @throws {SyntaxError} A syntax error. + * @returns {void} + */ + instance.unexpected = function(pos) { + var message = "Unexpected token"; - var allowClasses = extra.ecmaFeatures.classes, - allowModules = extra.ecmaFeatures.modules, - allowBlockBindings = extra.ecmaFeatures.blockBindings; + if (pos !== null && pos !== undefined) { + this.pos = pos; - if (lookahead.type === Token.Keyword) { - switch (lookahead.value) { - case "export": - if (!allowModules) { - throwErrorTolerant({}, Messages.IllegalExportDeclaration); - } - return parseExportDeclaration(); - case "import": - if (!allowModules) { - throwErrorTolerant({}, Messages.IllegalImportDeclaration); + if (this.options.locations) { + while (this.pos < this.lineStart) { + this.lineStart = this.input.lastIndexOf("\n", this.lineStart - 2) + 1; + --this.curLine; } - return parseImportDeclaration(); - case "function": - return parseFunctionDeclaration(); - case "class": - if (allowClasses) { - return parseClassDeclaration(); - } - break; - case "const": - case "let": - if (allowBlockBindings) { - return parseConstLetDeclaration(lookahead.value); - } - /* falls through */ - default: - return parseStatement(); - } - } - - if (lookahead.type !== Token.EOF) { - return parseStatement(); - } -} - -function parseSourceElements() { - var sourceElement, sourceElements = [], token, directive, firstRestricted; - - while (index < length) { - token = lookahead; - if (token.type !== Token.StringLiteral) { - break; - } - - sourceElement = parseSourceElement(); - sourceElements.push(sourceElement); - if (sourceElement.expression.type !== astNodeTypes.Literal) { - // this is not directive - break; - } - directive = source.slice(token.range[0] + 1, token.range[1] - 1); - if (directive === "use strict") { - strict = true; - if (firstRestricted) { - throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral); } - } else { - if (!firstRestricted && token.octal) { - firstRestricted = token; - } - } - } - while (index < length) { - sourceElement = parseSourceElement(); - /* istanbul ignore if */ - if (typeof sourceElement === "undefined") { - break; + this.nextToken(); } - sourceElements.push(sourceElement); - } - return sourceElements; -} - -function parseProgram() { - var body, - marker, - isModule = !!extra.ecmaFeatures.modules; - skipComment(); - peek(); - marker = markerCreate(); - strict = isModule; - - body = parseSourceElements(); - return markerApply(marker, astNodeFactory.createProgram(body, isModule ? "module" : "script")); -} + if (this.end > this.start) { + message += " " + this.input.slice(this.start, this.end); + } -function filterTokenLocation() { - var i, entry, token, tokens = []; + this.raise(this.start, message); + }; - for (i = 0; i < extra.tokens.length; ++i) { - entry = extra.tokens[i]; - token = { - type: entry.type, - value: entry.value + /* + * Esprima-FB represents JSX strings as tokens called "JSXText", but Acorn-JSX + * uses regular tt.string without any distinction between this and regular JS + * strings. As such, we intercept an attempt to read a JSX string and set a flag + * on extra so that when tokens are converted, the next token will be switched + * to JSXText via onToken. + */ + instance.extend("jsx_readString", function(jsxReadString) { + return /** @this acorn.Parser */ function(quote) { + var result = jsxReadString.call(this, quote); + if (this.type === tt.string) { + extra.jsxAttrValueToken = true; + } + + return result; }; - if (entry.regex) { - token.regex = { - pattern: entry.regex.pattern, - flags: entry.regex.flags - }; - } - if (extra.range) { - token.range = entry.range; - } - if (extra.loc) { - token.loc = entry.loc; - } - tokens.push(token); - } - - extra.tokens = tokens; -} + }); +}; //------------------------------------------------------------------------------ // Tokenizer //------------------------------------------------------------------------------ +/** + * Tokenizes the given code. + * @param {string} code The code to tokenize. + * @param {Object} options Options defining how to tokenize. + * @returns {Token[]} An array of tokens. + * @throws {SyntaxError} If the input code is invalid. + * @private + */ function tokenize(code, options) { var toString, - tokens; + tokens, + impliedStrict, + translator = new TokenTranslator(tt, code); toString = String; if (typeof code !== "string" && !(code instanceof String)) { code = toString(code); } - source = code; - index = 0; - lineNumber = (source.length > 0) ? 1 : 0; - lineStart = 0; - length = source.length; lookahead = null; - state = { - allowIn: true, - labelSet: {}, - parenthesisCount: 0, - inFunctionBody: false, - inIteration: false, - inSwitch: false, - lastCommentStart: -1, - yieldAllowed: false, - curlyStack: [], - curlyLastIndex: 0, - inJSXSpreadAttribute: false, - inJSXChild: false, - inJSXTag: false - }; - - extra = { - ecmaFeatures: defaultFeatures - }; // Options matching. options = options || {}; + var acornOptions = { + ecmaVersion: 5, + plugins: { + espree: true + } + }; + + resetExtra(); + // Of course we collect tokens here. options.tokens = true; extra.tokens = []; - extra.tokenize = true; - - // The following two fields are necessary to compute the Regex tokens. - extra.openParenToken = -1; - extra.openCurlyToken = -1; extra.range = (typeof options.range === "boolean") && options.range; + acornOptions.ranges = extra.range; + extra.loc = (typeof options.loc === "boolean") && options.loc; + acornOptions.locations = extra.loc; + + extra.comment = typeof options.comment === "boolean" && options.comment; - if (typeof options.comment === "boolean" && options.comment) { - extra.comments = []; + if (extra.comment) { + acornOptions.onComment = function() { + var comment = convertAcornCommentToEsprimaComment.apply(this, arguments); + extra.comments.push(comment); + }; } - if (typeof options.tolerant === "boolean" && options.tolerant) { - extra.errors = []; + + extra.tolerant = typeof options.tolerant === "boolean" && options.tolerant; + + if (typeof options.ecmaVersion === "number") { + switch (options.ecmaVersion) { + case 3: + case 5: + case 6: + case 7: + acornOptions.ecmaVersion = options.ecmaVersion; + extra.ecmaVersion = options.ecmaVersion; + break; + + default: + throw new Error("ecmaVersion must be 3, 5, 6, or 7."); + } } // apply parsing flags if (options.ecmaFeatures && typeof options.ecmaFeatures === "object") { extra.ecmaFeatures = options.ecmaFeatures; + impliedStrict = extra.ecmaFeatures.impliedStrict; + extra.ecmaFeatures.impliedStrict = typeof impliedStrict === "boolean" && impliedStrict; } try { - peek(); - if (lookahead.type === Token.EOF) { - return extra.tokens; - } - - lex(); - while (lookahead.type !== Token.EOF) { - try { - lex(); - } catch (lexError) { - if (extra.errors) { - extra.errors.push(lexError); - // We have to break on the first error - // to avoid infinite loops. - break; - } else { - throw lexError; - } - } + var tokenizer = acorn.tokenizer(code, acornOptions); + while ((lookahead = tokenizer.getToken()).type !== tt.eof) { + translator.onToken(lookahead, extra); } - filterTokenLocation(); + // filterTokenLocation(); tokens = extra.tokens; - if (typeof extra.comments !== "undefined") { + if (extra.comment) { tokens.comments = extra.comments; } - if (typeof extra.errors !== "undefined") { + if (extra.tolerant) { tokens.errors = extra.errors; } } catch (e) { throw e; - } finally { - extra = {}; } return tokens; } @@ -5321,42 +548,69 @@ function tokenize(code, options) { // Parser //------------------------------------------------------------------------------ + + +/** + * Converts an Acorn comment to a Esprima comment. + * @param {boolean} block True if it's a block comment, false if not. + * @param {string} text The text of the comment. + * @param {int} start The index at which the comment starts. + * @param {int} end The index at which the comment ends. + * @param {Location} startLoc The location at which the comment starts. + * @param {Location} endLoc The location at which the comment ends. + * @returns {Object} The comment object. + * @private + */ +function convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc) { + var comment = { + type: block ? "Block" : "Line", + value: text + }; + + if (typeof start === "number") { + comment.start = start; + comment.end = end; + comment.range = [start, end]; + } + + if (typeof startLoc === "object") { + comment.loc = { + start: startLoc, + end: endLoc + }; + } + + return comment; +} + +/** + * Parses the given code. + * @param {string} code The code to tokenize. + * @param {Object} options Options defining how to tokenize. + * @returns {ASTNode} The "Program" AST node. + * @throws {SyntaxError} If the input code is invalid. + * @private + */ function parse(code, options) { - var program, toString; + var program, + toString = String, + translator, + impliedStrict, + acornOptions = { + ecmaVersion: 5, + plugins: { + espree: true + } + }; + + lastToken = null; - toString = String; if (typeof code !== "string" && !(code instanceof String)) { code = toString(code); } - source = code; - index = 0; - lineNumber = (source.length > 0) ? 1 : 0; - lineStart = 0; - length = source.length; - lookahead = null; - state = { - allowIn: true, - labelSet: new StringMap(), - parenthesisCount: 0, - inFunctionBody: false, - inIteration: false, - inSwitch: false, - lastCommentStart: -1, - yieldAllowed: false, - curlyStack: [], - curlyLastIndex: 0, - inJSXSpreadAttribute: false, - inJSXChild: false, - inJSXTag: false - }; - - extra = { - ecmaFeatures: Object.create(defaultFeatures) - }; - - // for template strings - state.curlyStack = []; + resetExtra(); + commentAttachment.reset(); if (typeof options !== "undefined") { extra.range = (typeof options.range === "boolean") && options.range; @@ -5369,8 +623,10 @@ function parse(code, options) { if (typeof options.tokens === "boolean" && options.tokens) { extra.tokens = []; + translator = new TokenTranslator(tt, code); } if (typeof options.comment === "boolean" && options.comment) { + extra.comment = true; extra.comments = []; } if (typeof options.tolerant === "boolean" && options.tolerant) { @@ -5382,62 +638,107 @@ function parse(code, options) { commentAttachment.reset(); } + if (typeof options.ecmaVersion === "number") { + switch (options.ecmaVersion) { + case 3: + case 5: + case 6: + case 7: + acornOptions.ecmaVersion = options.ecmaVersion; + extra.ecmaVersion = options.ecmaVersion; + break; + + default: + throw new Error("ecmaVersion must be 3, 5, 6, or 7."); + } + } + if (options.sourceType === "module") { - extra.ecmaFeatures = { - arrowFunctions: true, - blockBindings: true, - regexUFlag: true, - regexYFlag: true, - templateStrings: true, - binaryLiterals: true, - octalLiterals: true, - unicodeCodePointEscapes: true, - superInFunctions: true, - defaultParams: true, - restParams: true, - forOf: true, - objectLiteralComputedProperties: true, - objectLiteralShorthandMethods: true, - objectLiteralShorthandProperties: true, - objectLiteralDuplicateProperties: true, - generators: true, - destructuring: true, - classes: true, - modules: true - }; + extra.isModule = true; + + // modules must be in 6 at least + if (acornOptions.ecmaVersion < 6) { + acornOptions.ecmaVersion = 6; + extra.ecmaVersion = 6; + } + + acornOptions.sourceType = "module"; } // apply parsing flags after sourceType to allow overriding if (options.ecmaFeatures && typeof options.ecmaFeatures === "object") { - - // if it's a module, augment the ecmaFeatures - if (options.sourceType === "module") { - Object.keys(options.ecmaFeatures).forEach(function(key) { - extra.ecmaFeatures[key] = options.ecmaFeatures[key]; - }); - } else { - extra.ecmaFeatures = options.ecmaFeatures; + extra.ecmaFeatures = options.ecmaFeatures; + impliedStrict = extra.ecmaFeatures.impliedStrict; + extra.ecmaFeatures.impliedStrict = typeof impliedStrict === "boolean" && impliedStrict; + if (options.ecmaFeatures.globalReturn) { + acornOptions.allowReturnOutsideFunction = true; } } - } - try { - program = parseProgram(); - if (typeof extra.comments !== "undefined") { - program.comments = extra.comments; + acornOptions.onToken = function(token) { + if (extra.tokens) { + translator.onToken(token, extra); + } + if (token.type !== tt.eof) { + lastToken = token; + } + }; + + if (extra.attachComment || extra.comment) { + acornOptions.onComment = function() { + var comment = convertAcornCommentToEsprimaComment.apply(this, arguments); + extra.comments.push(comment); + + if (extra.attachComment) { + commentAttachment.addComment(comment); + } + }; + } + + if (extra.range) { + acornOptions.ranges = true; } - if (typeof extra.tokens !== "undefined") { - filterTokenLocation(); - program.tokens = extra.tokens; + + if (extra.loc) { + acornOptions.locations = true; } - if (typeof extra.errors !== "undefined") { - program.errors = extra.errors; + + if (extra.ecmaFeatures.jsx) { + // Should process jsx plugin before espree plugin. + acornOptions.plugins = { + jsx: true, + espree: true + }; } - } catch (e) { - throw e; - } finally { - extra = {}; + } + + program = acorn.parse(code, acornOptions); + program.sourceType = extra.isModule ? "module" : "script"; + + if (extra.comment || extra.attachComment) { + program.comments = extra.comments; + } + + if (extra.tokens) { + program.tokens = extra.tokens; + } + + /* + * Adjust opening and closing position of program to match Esprima. + * Acorn always starts programs at range 0 whereas Esprima starts at the + * first AST node's start (the only real difference is when there's leading + * whitespace or leading comments). Acorn also counts trailing whitespace + * as part of the program whereas Esprima only counts up to the last token. + */ + if (program.range) { + program.range[0] = program.body.length ? program.body[0].range[0] : program.range[0]; + program.range[1] = lastToken ? lastToken.range[1] : program.range[1]; + } + + if (program.loc) { + program.loc.start = program.body.length ? program.body[0].loc.start : program.loc.start; + program.loc.end = lastToken ? lastToken.loc.end : program.loc.end; } return program; @@ -5455,7 +756,7 @@ exports.parse = parse; // Deep copy. /* istanbul ignore next */ -exports.Syntax = (function () { +exports.Syntax = (function() { var name, types = {}; if (typeof Object.create === "function") { @@ -5474,3 +775,26 @@ exports.Syntax = (function () { return types; }()); + +/* istanbul ignore next */ +exports.VisitorKeys = (function() { + var visitorKeys = require("./lib/visitor-keys"); + var name, + keys = {}; + + if (typeof Object.create === "function") { + keys = Object.create(null); + } + + for (name in visitorKeys) { + if (visitorKeys.hasOwnProperty(name)) { + keys[name] = visitorKeys[name]; + } + } + + if (typeof Object.freeze === "function") { + Object.freeze(keys); + } + + return keys; +}()); diff --git a/tools/eslint/node_modules/espree/lib/ast-node-factory.js b/tools/eslint/node_modules/espree/lib/ast-node-factory.js deleted file mode 100644 index 56bdbcadbf9c40..00000000000000 --- a/tools/eslint/node_modules/espree/lib/ast-node-factory.js +++ /dev/null @@ -1,932 +0,0 @@ -/** - * @fileoverview A factory for creating AST nodes - * @author Fred K. Schott - * @copyright 2014 Fred K. Schott. All rights reserved. - * @copyright 2011-2013 Ariya Hidayat - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var astNodeTypes = require("./ast-node-types"); - -//------------------------------------------------------------------------------ -// Public -//------------------------------------------------------------------------------ - -module.exports = { - - /** - * Create an Array Expression ASTNode out of an array of elements - * @param {ASTNode[]} elements An array of ASTNode elements - * @returns {ASTNode} An ASTNode representing the entire array expression - */ - createArrayExpression: function(elements) { - return { - type: astNodeTypes.ArrayExpression, - elements: elements - }; - }, - - /** - * Create an Arrow Function Expression ASTNode - * @param {ASTNode} params The function arguments - * @param {ASTNode} body The function body - * @param {boolean} expression True if the arrow function is created via an expression. - * Always false for declarations, but kept here to be in sync with - * FunctionExpression objects. - * @returns {ASTNode} An ASTNode representing the entire arrow function expression - */ - createArrowFunctionExpression: function (params, body, expression) { - return { - type: astNodeTypes.ArrowFunctionExpression, - id: null, - params: params, - body: body, - generator: false, - expression: expression - }; - }, - - /** - * Create an ASTNode representation of an assignment expression - * @param {ASTNode} operator The assignment operator - * @param {ASTNode} left The left operand - * @param {ASTNode} right The right operand - * @returns {ASTNode} An ASTNode representing the entire assignment expression - */ - createAssignmentExpression: function(operator, left, right) { - return { - type: astNodeTypes.AssignmentExpression, - operator: operator, - left: left, - right: right - }; - }, - - /** - * Create an ASTNode representation of an assignment pattern (default parameters) - * @param {ASTNode} left The left operand - * @param {ASTNode} right The right operand - * @returns {ASTNode} An ASTNode representing the entire assignment pattern - */ - createAssignmentPattern: function(left, right) { - return { - type: astNodeTypes.AssignmentPattern, - left: left, - right: right - }; - }, - - /** - * Create an ASTNode representation of a binary expression - * @param {ASTNode} operator The assignment operator - * @param {ASTNode} left The left operand - * @param {ASTNode} right The right operand - * @returns {ASTNode} An ASTNode representing the entire binary expression - */ - createBinaryExpression: function(operator, left, right) { - var type = (operator === "||" || operator === "&&") ? astNodeTypes.LogicalExpression : - astNodeTypes.BinaryExpression; - return { - type: type, - operator: operator, - left: left, - right: right - }; - }, - - /** - * Create an ASTNode representation of a block statement - * @param {ASTNode} body The block statement body - * @returns {ASTNode} An ASTNode representing the entire block statement - */ - createBlockStatement: function(body) { - return { - type: astNodeTypes.BlockStatement, - body: body - }; - }, - - /** - * Create an ASTNode representation of a break statement - * @param {ASTNode} label The break statement label - * @returns {ASTNode} An ASTNode representing the break statement - */ - createBreakStatement: function(label) { - return { - type: astNodeTypes.BreakStatement, - label: label - }; - }, - - /** - * Create an ASTNode representation of a call expression - * @param {ASTNode} callee The function being called - * @param {ASTNode[]} args An array of ASTNodes representing the function call arguments - * @returns {ASTNode} An ASTNode representing the entire call expression - */ - createCallExpression: function(callee, args) { - return { - type: astNodeTypes.CallExpression, - callee: callee, - "arguments": args - }; - }, - - /** - * Create an ASTNode representation of a catch clause/block - * @param {ASTNode} param Any catch clause exeption/conditional parameter information - * @param {ASTNode} body The catch block body - * @returns {ASTNode} An ASTNode representing the entire catch clause - */ - createCatchClause: function(param, body) { - return { - type: astNodeTypes.CatchClause, - param: param, - body: body - }; - }, - - /** - * Creates an ASTNode representation of a class body. - * @param {ASTNode} body The node representing the body of the class. - * @returns {ASTNode} An ASTNode representing the class body. - */ - createClassBody: function(body) { - return { - type: astNodeTypes.ClassBody, - body: body - }; - }, - - createClassExpression: function(id, superClass, body) { - return { - type: astNodeTypes.ClassExpression, - id: id, - superClass: superClass, - body: body - }; - }, - - createClassDeclaration: function(id, superClass, body) { - return { - type: astNodeTypes.ClassDeclaration, - id: id, - superClass: superClass, - body: body - }; - }, - - createMethodDefinition: function(propertyType, kind, key, value, computed) { - return { - type: astNodeTypes.MethodDefinition, - key: key, - value: value, - kind: kind, - "static": propertyType === "static", - computed: computed - }; - }, - - /** - * Create an ASTNode representation of a conditional expression - * @param {ASTNode} test The conditional to evaluate - * @param {ASTNode} consequent The code to be run if the test returns true - * @param {ASTNode} alternate The code to be run if the test returns false - * @returns {ASTNode} An ASTNode representing the entire conditional expression - */ - createConditionalExpression: function(test, consequent, alternate) { - return { - type: astNodeTypes.ConditionalExpression, - test: test, - consequent: consequent, - alternate: alternate - }; - }, - - /** - * Create an ASTNode representation of a continue statement - * @param {?ASTNode} label The optional continue label (null if not set) - * @returns {ASTNode} An ASTNode representing the continue statement - */ - createContinueStatement: function(label) { - return { - type: astNodeTypes.ContinueStatement, - label: label - }; - }, - - /** - * Create an ASTNode representation of a debugger statement - * @returns {ASTNode} An ASTNode representing the debugger statement - */ - createDebuggerStatement: function() { - return { - type: astNodeTypes.DebuggerStatement - }; - }, - - /** - * Create an ASTNode representation of an empty statement - * @returns {ASTNode} An ASTNode representing an empty statement - */ - createEmptyStatement: function() { - return { - type: astNodeTypes.EmptyStatement - }; - }, - - /** - * Create an ASTNode representation of an expression statement - * @param {ASTNode} expression The expression - * @returns {ASTNode} An ASTNode representing an expression statement - */ - createExpressionStatement: function(expression) { - return { - type: astNodeTypes.ExpressionStatement, - expression: expression - }; - }, - - /** - * Create an ASTNode representation of a while statement - * @param {ASTNode} test The while conditional - * @param {ASTNode} body The while loop body - * @returns {ASTNode} An ASTNode representing a while statement - */ - createWhileStatement: function(test, body) { - return { - type: astNodeTypes.WhileStatement, - test: test, - body: body - }; - }, - - /** - * Create an ASTNode representation of a do..while statement - * @param {ASTNode} test The do..while conditional - * @param {ASTNode} body The do..while loop body - * @returns {ASTNode} An ASTNode representing a do..while statement - */ - createDoWhileStatement: function(test, body) { - return { - type: astNodeTypes.DoWhileStatement, - body: body, - test: test - }; - }, - - /** - * Create an ASTNode representation of a for statement - * @param {ASTNode} init The initialization expression - * @param {ASTNode} test The conditional test expression - * @param {ASTNode} update The update expression - * @param {ASTNode} body The statement body - * @returns {ASTNode} An ASTNode representing a for statement - */ - createForStatement: function(init, test, update, body) { - return { - type: astNodeTypes.ForStatement, - init: init, - test: test, - update: update, - body: body - }; - }, - - /** - * Create an ASTNode representation of a for..in statement - * @param {ASTNode} left The left-side variable for the property name - * @param {ASTNode} right The right-side object - * @param {ASTNode} body The statement body - * @returns {ASTNode} An ASTNode representing a for..in statement - */ - createForInStatement: function(left, right, body) { - return { - type: astNodeTypes.ForInStatement, - left: left, - right: right, - body: body, - each: false - }; - }, - - /** - * Create an ASTNode representation of a for..of statement - * @param {ASTNode} left The left-side variable for the property value - * @param {ASTNode} right The right-side object - * @param {ASTNode} body The statement body - * @returns {ASTNode} An ASTNode representing a for..of statement - */ - createForOfStatement: function(left, right, body) { - return { - type: astNodeTypes.ForOfStatement, - left: left, - right: right, - body: body - }; - }, - - /** - * Create an ASTNode representation of a function declaration - * @param {ASTNode} id The function name - * @param {ASTNode} params The function arguments - * @param {ASTNode} body The function body - * @param {boolean} generator True if the function is a generator, false if not. - * @param {boolean} expression True if the function is created via an expression. - * Always false for declarations, but kept here to be in sync with - * FunctionExpression objects. - * @returns {ASTNode} An ASTNode representing a function declaration - */ - createFunctionDeclaration: function (id, params, body, generator, expression) { - return { - type: astNodeTypes.FunctionDeclaration, - id: id, - params: params || [], - body: body, - generator: !!generator, - expression: !!expression - }; - }, - - /** - * Create an ASTNode representation of a function expression - * @param {ASTNode} id The function name - * @param {ASTNode} params The function arguments - * @param {ASTNode} body The function body - * @param {boolean} generator True if the function is a generator, false if not. - * @param {boolean} expression True if the function is created via an expression. - * @returns {ASTNode} An ASTNode representing a function declaration - */ - createFunctionExpression: function (id, params, body, generator, expression) { - return { - type: astNodeTypes.FunctionExpression, - id: id, - params: params || [], - body: body, - generator: !!generator, - expression: !!expression - }; - }, - - /** - * Create an ASTNode representation of an identifier - * @param {ASTNode} name The identifier name - * @returns {ASTNode} An ASTNode representing an identifier - */ - createIdentifier: function(name) { - return { - type: astNodeTypes.Identifier, - name: name - }; - }, - - /** - * Create an ASTNode representation of an if statement - * @param {ASTNode} test The if conditional expression - * @param {ASTNode} consequent The consequent if statement to run - * @param {ASTNode} alternate the "else" alternate statement - * @returns {ASTNode} An ASTNode representing an if statement - */ - createIfStatement: function(test, consequent, alternate) { - return { - type: astNodeTypes.IfStatement, - test: test, - consequent: consequent, - alternate: alternate - }; - }, - - /** - * Create an ASTNode representation of a labeled statement - * @param {ASTNode} label The statement label - * @param {ASTNode} body The labeled statement body - * @returns {ASTNode} An ASTNode representing a labeled statement - */ - createLabeledStatement: function(label, body) { - return { - type: astNodeTypes.LabeledStatement, - label: label, - body: body - }; - }, - - /** - * Create an ASTNode literal from the source code - * @param {ASTNode} token The ASTNode token - * @param {string} source The source code to get the literal from - * @returns {ASTNode} An ASTNode representing the new literal - */ - createLiteralFromSource: function(token, source) { - var node = { - type: astNodeTypes.Literal, - value: token.value, - raw: source.slice(token.range[0], token.range[1]) - }; - - // regular expressions have regex properties - if (token.regex) { - node.regex = token.regex; - } - - return node; - }, - - /** - * Create an ASTNode template element - * @param {Object} value Data on the element value - * @param {string} value.raw The raw template string - * @param {string} value.cooked The processed template string - * @param {boolean} tail True if this is the final element in a template string - * @returns {ASTNode} An ASTNode representing the template string element - */ - createTemplateElement: function(value, tail) { - return { - type: astNodeTypes.TemplateElement, - value: value, - tail: tail - }; - }, - - /** - * Create an ASTNode template literal - * @param {ASTNode[]} quasis An array of the template string elements - * @param {ASTNode[]} expressions An array of the template string expressions - * @returns {ASTNode} An ASTNode representing the template string - */ - createTemplateLiteral: function(quasis, expressions) { - return { - type: astNodeTypes.TemplateLiteral, - quasis: quasis, - expressions: expressions - }; - }, - - /** - * Create an ASTNode representation of a spread element - * @param {ASTNode} argument The array being spread - * @returns {ASTNode} An ASTNode representing a spread element - */ - createSpreadElement: function(argument) { - return { - type: astNodeTypes.SpreadElement, - argument: argument - }; - }, - - /** - * Create an ASTNode tagged template expression - * @param {ASTNode} tag The tag expression - * @param {ASTNode} quasi A TemplateLiteral ASTNode representing - * the template string itself. - * @returns {ASTNode} An ASTNode representing the tagged template - */ - createTaggedTemplateExpression: function(tag, quasi) { - return { - type: astNodeTypes.TaggedTemplateExpression, - tag: tag, - quasi: quasi - }; - }, - - /** - * Create an ASTNode representation of a member expression - * @param {string} accessor The member access method (bracket or period) - * @param {ASTNode} object The object being referenced - * @param {ASTNode} property The object-property being referenced - * @returns {ASTNode} An ASTNode representing a member expression - */ - createMemberExpression: function(accessor, object, property) { - return { - type: astNodeTypes.MemberExpression, - computed: accessor === "[", - object: object, - property: property - }; - }, - - /** - * Create an ASTNode representation of a new expression - * @param {ASTNode} callee The constructor for the new object type - * @param {ASTNode} args The arguments passed to the constructor - * @returns {ASTNode} An ASTNode representing a new expression - */ - createNewExpression: function(callee, args) { - return { - type: astNodeTypes.NewExpression, - callee: callee, - "arguments": args - }; - }, - - /** - * Create an ASTNode representation of a new object expression - * @param {ASTNode[]} properties An array of ASTNodes that represent all object - * properties and associated values - * @returns {ASTNode} An ASTNode representing a new object expression - */ - createObjectExpression: function(properties) { - return { - type: astNodeTypes.ObjectExpression, - properties: properties - }; - }, - - /** - * Create an ASTNode representation of a postfix expression - * @param {string} operator The postfix operator ("++", "--", etc.) - * @param {ASTNode} argument The operator argument - * @returns {ASTNode} An ASTNode representing a postfix expression - */ - createPostfixExpression: function(operator, argument) { - return { - type: astNodeTypes.UpdateExpression, - operator: operator, - argument: argument, - prefix: false - }; - }, - - /** - * Create an ASTNode representation of an entire program - * @param {ASTNode} body The program body - * @param {string} sourceType Either "module" or "script". - * @returns {ASTNode} An ASTNode representing an entire program - */ - createProgram: function(body, sourceType) { - return { - type: astNodeTypes.Program, - body: body, - sourceType: sourceType - }; - }, - - /** - * Create an ASTNode representation of an object property - * @param {string} kind The type of property represented ("get", "set", etc.) - * @param {ASTNode} key The property key - * @param {ASTNode} value The new property value - * @param {boolean} method True if the property is also a method (value is a function) - * @param {boolean} shorthand True if the property is shorthand - * @param {boolean} computed True if the property value has been computed - * @returns {ASTNode} An ASTNode representing an object property - */ - createProperty: function(kind, key, value, method, shorthand, computed) { - return { - type: astNodeTypes.Property, - key: key, - value: value, - kind: kind, - method: method, - shorthand: shorthand, - computed: computed - }; - }, - - /** - * Create an ASTNode representation of a rest element - * @param {ASTNode} argument The rest argument - * @returns {ASTNode} An ASTNode representing a rest element - */ - createRestElement: function (argument) { - return { - type: astNodeTypes.RestElement, - argument: argument - }; - }, - - /** - * Create an ASTNode representation of a return statement - * @param {?ASTNode} argument The return argument, null if no argument is provided - * @returns {ASTNode} An ASTNode representing a return statement - */ - createReturnStatement: function(argument) { - return { - type: astNodeTypes.ReturnStatement, - argument: argument - }; - }, - - /** - * Create an ASTNode representation of a sequence of expressions - * @param {ASTNode[]} expressions An array containing each expression, in order - * @returns {ASTNode} An ASTNode representing a sequence of expressions - */ - createSequenceExpression: function(expressions) { - return { - type: astNodeTypes.SequenceExpression, - expressions: expressions - }; - }, - - /** - * Create an ASTNode representation of super - * @returns {ASTNode} An ASTNode representing super - */ - createSuper: function() { - return { - type: astNodeTypes.Super - }; - }, - - /** - * Create an ASTNode representation of a switch case statement - * @param {ASTNode} test The case value to test against the switch value - * @param {ASTNode} consequent The consequent case statement - * @returns {ASTNode} An ASTNode representing a switch case - */ - createSwitchCase: function(test, consequent) { - return { - type: astNodeTypes.SwitchCase, - test: test, - consequent: consequent - }; - }, - - /** - * Create an ASTNode representation of a switch statement - * @param {ASTNode} discriminant An expression to test against each case value - * @param {ASTNode[]} cases An array of switch case statements - * @returns {ASTNode} An ASTNode representing a switch statement - */ - createSwitchStatement: function(discriminant, cases) { - return { - type: astNodeTypes.SwitchStatement, - discriminant: discriminant, - cases: cases - }; - }, - - /** - * Create an ASTNode representation of a this statement - * @returns {ASTNode} An ASTNode representing a this statement - */ - createThisExpression: function() { - return { - type: astNodeTypes.ThisExpression - }; - }, - - /** - * Create an ASTNode representation of a throw statement - * @param {ASTNode} argument The argument to throw - * @returns {ASTNode} An ASTNode representing a throw statement - */ - createThrowStatement: function(argument) { - return { - type: astNodeTypes.ThrowStatement, - argument: argument - }; - }, - - /** - * Create an ASTNode representation of a try statement - * @param {ASTNode} block The try block - * @param {ASTNode} handler A catch handler - * @param {?ASTNode} finalizer The final code block to run after the try/catch has run - * @returns {ASTNode} An ASTNode representing a try statement - */ - createTryStatement: function(block, handler, finalizer) { - return { - type: astNodeTypes.TryStatement, - block: block, - handler: handler, - finalizer: finalizer - }; - }, - - /** - * Create an ASTNode representation of a unary expression - * @param {string} operator The unary operator - * @param {ASTNode} argument The unary operand - * @returns {ASTNode} An ASTNode representing a unary expression - */ - createUnaryExpression: function(operator, argument) { - if (operator === "++" || operator === "--") { - return { - type: astNodeTypes.UpdateExpression, - operator: operator, - argument: argument, - prefix: true - }; - } - return { - type: astNodeTypes.UnaryExpression, - operator: operator, - argument: argument, - prefix: true - }; - }, - - /** - * Create an ASTNode representation of a variable declaration - * @param {ASTNode[]} declarations An array of variable declarations - * @param {string} kind The kind of variable created ("var", "let", etc.) - * @returns {ASTNode} An ASTNode representing a variable declaration - */ - createVariableDeclaration: function(declarations, kind) { - return { - type: astNodeTypes.VariableDeclaration, - declarations: declarations, - kind: kind - }; - }, - - /** - * Create an ASTNode representation of a variable declarator - * @param {ASTNode} id The variable ID - * @param {ASTNode} init The variable's initial value - * @returns {ASTNode} An ASTNode representing a variable declarator - */ - createVariableDeclarator: function(id, init) { - return { - type: astNodeTypes.VariableDeclarator, - id: id, - init: init - }; - }, - - /** - * Create an ASTNode representation of a with statement - * @param {ASTNode} object The with statement object expression - * @param {ASTNode} body The with statement body - * @returns {ASTNode} An ASTNode representing a with statement - */ - createWithStatement: function(object, body) { - return { - type: astNodeTypes.WithStatement, - object: object, - body: body - }; - }, - - createYieldExpression: function(argument, delegate) { - return { - type: astNodeTypes.YieldExpression, - argument: argument || null, - delegate: delegate - }; - }, - - createJSXAttribute: function(name, value) { - return { - type: astNodeTypes.JSXAttribute, - name: name, - value: value || null - }; - }, - - createJSXSpreadAttribute: function(argument) { - return { - type: astNodeTypes.JSXSpreadAttribute, - argument: argument - }; - }, - - createJSXIdentifier: function(name) { - return { - type: astNodeTypes.JSXIdentifier, - name: name - }; - }, - - createJSXNamespacedName: function(namespace, name) { - return { - type: astNodeTypes.JSXNamespacedName, - namespace: namespace, - name: name - }; - }, - - createJSXMemberExpression: function(object, property) { - return { - type: astNodeTypes.JSXMemberExpression, - object: object, - property: property - }; - }, - - createJSXElement: function(openingElement, closingElement, children) { - return { - type: astNodeTypes.JSXElement, - openingElement: openingElement, - closingElement: closingElement, - children: children - }; - }, - - createJSXEmptyExpression: function() { - return { - type: astNodeTypes.JSXEmptyExpression - }; - }, - - createJSXExpressionContainer: function(expression) { - return { - type: astNodeTypes.JSXExpressionContainer, - expression: expression - }; - }, - - createJSXOpeningElement: function(name, attributes, selfClosing) { - return { - type: astNodeTypes.JSXOpeningElement, - name: name, - selfClosing: selfClosing, - attributes: attributes - }; - }, - - createJSXClosingElement: function(name) { - return { - type: astNodeTypes.JSXClosingElement, - name: name - }; - }, - - createExportSpecifier: function(local, exported) { - return { - type: astNodeTypes.ExportSpecifier, - exported: exported || local, - local: local - }; - }, - - createImportDefaultSpecifier: function(local) { - return { - type: astNodeTypes.ImportDefaultSpecifier, - local: local - }; - }, - - createImportNamespaceSpecifier: function(local) { - return { - type: astNodeTypes.ImportNamespaceSpecifier, - local: local - }; - }, - - createExportNamedDeclaration: function(declaration, specifiers, source) { - return { - type: astNodeTypes.ExportNamedDeclaration, - declaration: declaration, - specifiers: specifiers, - source: source - }; - }, - - createExportDefaultDeclaration: function(declaration) { - return { - type: astNodeTypes.ExportDefaultDeclaration, - declaration: declaration - }; - }, - - createExportAllDeclaration: function(source) { - return { - type: astNodeTypes.ExportAllDeclaration, - source: source - }; - }, - - createImportSpecifier: function(local, imported) { - return { - type: astNodeTypes.ImportSpecifier, - local: local || imported, - imported: imported - }; - }, - - createImportDeclaration: function(specifiers, source) { - return { - type: astNodeTypes.ImportDeclaration, - specifiers: specifiers, - source: source - }; - } - -}; diff --git a/tools/eslint/node_modules/espree/lib/ast-node-types.js b/tools/eslint/node_modules/espree/lib/ast-node-types.js index 5d14b7f4437283..ec9eaa1fbe377c 100644 --- a/tools/eslint/node_modules/espree/lib/ast-node-types.js +++ b/tools/eslint/node_modules/espree/lib/ast-node-types.js @@ -56,6 +56,8 @@ module.exports = { DoWhileStatement: "DoWhileStatement", DebuggerStatement: "DebuggerStatement", EmptyStatement: "EmptyStatement", + ExperimentalRestProperty: "ExperimentalRestProperty", + ExperimentalSpreadProperty: "ExperimentalSpreadProperty", ExpressionStatement: "ExpressionStatement", ForStatement: "ForStatement", ForInStatement: "ForInStatement", @@ -68,6 +70,7 @@ module.exports = { LabeledStatement: "LabeledStatement", LogicalExpression: "LogicalExpression", MemberExpression: "MemberExpression", + MetaProperty: "MetaProperty", MethodDefinition: "MethodDefinition", NewExpression: "NewExpression", ObjectExpression: "ObjectExpression", diff --git a/tools/eslint/node_modules/espree/lib/comment-attachment.js b/tools/eslint/node_modules/espree/lib/comment-attachment.js index 3618bb3bf08823..7d12270f8e60fe 100644 --- a/tools/eslint/node_modules/espree/lib/comment-attachment.js +++ b/tools/eslint/node_modules/espree/lib/comment-attachment.js @@ -38,10 +38,44 @@ var astNodeTypes = require("./ast-node-types"); //------------------------------------------------------------------------------ var extra = { - trailingComments: [], - leadingComments: [], - bottomRightStack: [] - }; + trailingComments: [], + leadingComments: [], + bottomRightStack: [] +}; + +/** Recursively remove leading comments that are incorrectly added when no + * expression exists between comment and the current node + * @param {node} node to recursively check + * @returns {void} + */ +function removeExtraLeadingComments(node) { + var i, j; + + if (!node.body) { + return; + } + + if (Array.isArray(node.body)) { + // i must start at 0 so that we can check all indices recursively + for (i = 0; i < node.body.length; i++) { + // i must be greater than 0 to perform the check on the previous node + if (i > 0 && node.body[i].leadingComments) { + for (j = 0; j < node.body[i].leadingComments.length; j++) { + if (node.body[i].leadingComments[j].range[1] < node.body[i - 1].range[1]) { + node.body[i].leadingComments.splice(j, 1); + } + } + + if (node.body[i].leadingComments.length === 0) { + delete node.body[i].leadingComments; + } + } + removeExtraLeadingComments(node.body[i]); + } + } else { + removeExtraLeadingComments(node.body); + } +} //------------------------------------------------------------------------------ // Public @@ -66,6 +100,8 @@ module.exports = { i; if (node.type === astNodeTypes.Program) { + removeExtraLeadingComments(node); + if (node.body.length > 0) { return; } @@ -109,9 +145,21 @@ module.exports = { } if (lastChild) { - if (lastChild.leadingComments && lastChild.leadingComments[lastChild.leadingComments.length - 1].range[1] <= node.range[0]) { - node.leadingComments = lastChild.leadingComments; - delete lastChild.leadingComments; + if (lastChild.leadingComments) { + if (lastChild.leadingComments[lastChild.leadingComments.length - 1].range[1] <= node.range[0]) { + node.leadingComments = lastChild.leadingComments; + delete lastChild.leadingComments; + } else { + // A leading comment for an anonymous class had been stolen by its first MethodDefinition, + // so this takes back the leading comment. + // See Also: https://github.com/eslint/espree/issues/158 + for (i = lastChild.leadingComments.length - 2; i >= 0; --i) { + if (lastChild.leadingComments[i].range[1] <= node.range[0]) { + node.leadingComments = lastChild.leadingComments.splice(0, i + 1); + break; + } + } + } } } else if (extra.leadingComments.length > 0) { diff --git a/tools/eslint/node_modules/espree/lib/features.js b/tools/eslint/node_modules/espree/lib/features.js index c33274a441b7d3..aa2a6e48b62585 100644 --- a/tools/eslint/node_modules/espree/lib/features.js +++ b/tools/eslint/node_modules/espree/lib/features.js @@ -40,72 +40,15 @@ module.exports = { - // enable parsing of arrow functions - arrowFunctions: false, - - // enable parsing of let and const - blockBindings: true, - - // enable parsing of destructured arrays and objects - destructuring: false, - - // enable parsing of regex u flag - regexUFlag: false, - - // enable parsing of regex y flag - regexYFlag: false, - - // enable parsing of template strings - templateStrings: false, - - // enable parsing binary literals - binaryLiterals: false, - - // enable parsing ES6 octal literals - octalLiterals: false, - - // enable parsing unicode code point escape sequences - unicodeCodePointEscapes: true, - - // enable parsing of default parameters - defaultParams: false, - - // enable parsing of rest parameters - restParams: false, - - // enable parsing of for-of statements - forOf: false, - - // enable parsing computed object literal properties - objectLiteralComputedProperties: false, - - // enable parsing of shorthand object literal methods - objectLiteralShorthandMethods: false, - - // enable parsing of shorthand object literal properties - objectLiteralShorthandProperties: false, - - // Allow duplicate object literal properties (except '__proto__') - objectLiteralDuplicateProperties: false, - - // enable parsing of generators/yield - generators: false, - - // support the spread operator - spread: false, - - // enable super in functions - superInFunctions: false, - - // enable parsing of classes - classes: false, - - // enable parsing of modules - modules: false, - // React JSX parsing jsx: false, // allow return statement in global scope - globalReturn: false + globalReturn: false, + + // allow implied strict mode + impliedStrict: false, + + // allow experimental object rest/spread + experimentalObjectRestSpread: false }; diff --git a/tools/eslint/node_modules/espree/lib/messages.js b/tools/eslint/node_modules/espree/lib/messages.js deleted file mode 100644 index b0f324f87d58bc..00000000000000 --- a/tools/eslint/node_modules/espree/lib/messages.js +++ /dev/null @@ -1,99 +0,0 @@ -/** - * @fileoverview Error messages returned by the parser. - * @author Nicholas C. Zakas - * @copyright 2014 Nicholas C. Zakas. All rights reserved. - * @copyright 2011-2013 Ariya Hidayat - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -// None! - -//------------------------------------------------------------------------------ -// Public -//------------------------------------------------------------------------------ - -// error messages should be identical to V8 where possible -module.exports = { - UnexpectedToken: "Unexpected token %0", - UnexpectedNumber: "Unexpected number", - UnexpectedString: "Unexpected string", - UnexpectedIdentifier: "Unexpected identifier", - UnexpectedReserved: "Unexpected reserved word", - UnexpectedTemplate: "Unexpected quasi %0", - UnexpectedEOS: "Unexpected end of input", - NewlineAfterThrow: "Illegal newline after throw", - InvalidRegExp: "Invalid regular expression", - InvalidRegExpFlag: "Invalid regular expression flag", - UnterminatedRegExp: "Invalid regular expression: missing /", - InvalidLHSInAssignment: "Invalid left-hand side in assignment", - InvalidLHSInFormalsList: "Invalid left-hand side in formals list", - InvalidLHSInForIn: "Invalid left-hand side in for-in", - MultipleDefaultsInSwitch: "More than one default clause in switch statement", - NoCatchOrFinally: "Missing catch or finally after try", - NoUnintializedConst: "Const must be initialized", - UnknownLabel: "Undefined label '%0'", - Redeclaration: "%0 '%1' has already been declared", - IllegalContinue: "Illegal continue statement", - IllegalBreak: "Illegal break statement", - IllegalReturn: "Illegal return statement", - IllegalYield: "Illegal yield expression", - IllegalSpread: "Illegal spread element", - StrictModeWith: "Strict mode code may not include a with statement", - StrictCatchVariable: "Catch variable may not be eval or arguments in strict mode", - StrictVarName: "Variable name may not be eval or arguments in strict mode", - StrictParamName: "Parameter name eval or arguments is not allowed in strict mode", - StrictParamDupe: "Strict mode function may not have duplicate parameter names", - TemplateOctalLiteral: "Octal literals are not allowed in template strings.", - ParameterAfterRestParameter: "Rest parameter must be last formal parameter", - DefaultRestParameter: "Rest parameter can not have a default value", - ElementAfterSpreadElement: "Spread must be the final element of an element list", - ObjectPatternAsRestParameter: "Invalid rest parameter", - ObjectPatternAsSpread: "Invalid spread argument", - StrictFunctionName: "Function name may not be eval or arguments in strict mode", - StrictOctalLiteral: "Octal literals are not allowed in strict mode.", - StrictDelete: "Delete of an unqualified identifier in strict mode.", - StrictDuplicateProperty: "Duplicate data property in object literal not allowed in strict mode", - DuplicatePrototypeProperty: "Duplicate '__proto__' property in object literal are not allowed", - ConstructorSpecialMethod: "Class constructor may not be an accessor", - DuplicateConstructor: "A class may only have one constructor", - StaticPrototype: "Classes may not have static property named prototype", - AccessorDataProperty: "Object literal may not have data and accessor property with the same name", - AccessorGetSet: "Object literal may not have multiple get/set accessors with the same name", - StrictLHSAssignment: "Assignment to eval or arguments is not allowed in strict mode", - StrictLHSPostfix: "Postfix increment/decrement may not have eval or arguments operand in strict mode", - StrictLHSPrefix: "Prefix increment/decrement may not have eval or arguments operand in strict mode", - StrictReservedWord: "Use of future reserved word in strict mode", - InvalidJSXAttributeValue: "JSX value should be either an expression or a quoted JSX text", - ExpectedJSXClosingTag: "Expected corresponding JSX closing tag for %0", - AdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag", - MissingFromClause: "Missing from clause", - NoAsAfterImportNamespace: "Missing as after import *", - InvalidModuleSpecifier: "Invalid module specifier", - IllegalImportDeclaration: "Illegal import declaration", - IllegalExportDeclaration: "Illegal export declaration" -}; diff --git a/tools/eslint/node_modules/espree/lib/string-map.js b/tools/eslint/node_modules/espree/lib/string-map.js deleted file mode 100644 index 97c87032f25c45..00000000000000 --- a/tools/eslint/node_modules/espree/lib/string-map.js +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @fileoverview A simple map that helps avoid collisions on the Object prototype. - * @author Jamund Ferguson - * @copyright 2015 Jamund Ferguson. All rights reserved. - * @copyright 2011-2013 Ariya Hidayat - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -"use strict"; - -function StringMap() { - this.$data = {}; -} - -StringMap.prototype.get = function (key) { - key = "$" + key; - return this.$data[key]; -}; - -StringMap.prototype.set = function (key, value) { - key = "$" + key; - this.$data[key] = value; - return this; -}; - -StringMap.prototype.has = function (key) { - key = "$" + key; - return Object.prototype.hasOwnProperty.call(this.$data, key); -}; - -StringMap.prototype.delete = function (key) { - key = "$" + key; - return delete this.$data[key]; -}; - -module.exports = StringMap; diff --git a/tools/eslint/node_modules/espree/lib/syntax.js b/tools/eslint/node_modules/espree/lib/syntax.js deleted file mode 100644 index b69754a881d82b..00000000000000 --- a/tools/eslint/node_modules/espree/lib/syntax.js +++ /dev/null @@ -1,189 +0,0 @@ -/** - * @fileoverview Various syntax/pattern checks for parsing. - * @author Nicholas C. Zakas - * @copyright 2014 Nicholas C. Zakas. All rights reserved. - * @copyright 2011-2013 Ariya Hidayat - * @copyright 2012-2013 Mathias Bynens - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -// None! - -//------------------------------------------------------------------------------ -// Private -//------------------------------------------------------------------------------ - -// See also tools/generate-identifier-regex.js. -var Regex = { - NonAsciiIdentifierStart: new RegExp("[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]"), - NonAsciiIdentifierPart: new RegExp("[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0\u08A2-\u08AC\u08E4-\u08FE\u0900-\u0963\u0966-\u096F\u0971-\u0977\u0979-\u097F\u0981-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C82\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D02\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F0\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191C\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1D00-\u1DE6\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA697\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7B\uAA80-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE26\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]"), - LeadingZeros: new RegExp("^0+(?!$)") -}; - -//------------------------------------------------------------------------------ -// Public -//------------------------------------------------------------------------------ - -module.exports = { - - Regex: Regex, - - isDecimalDigit: function(ch) { - return (ch >= 48 && ch <= 57); // 0..9 - }, - - isHexDigit: function(ch) { - return "0123456789abcdefABCDEF".indexOf(ch) >= 0; - }, - - isOctalDigit: function(ch) { - return "01234567".indexOf(ch) >= 0; - }, - - // 7.2 White Space - - isWhiteSpace: function(ch) { - return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) || - (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0); - }, - - // 7.3 Line Terminators - - isLineTerminator: function(ch) { - return (ch === 0x0A) || (ch === 0x0D) || (ch === 0x2028) || (ch === 0x2029); - }, - - // 7.6 Identifier Names and Identifiers - - isIdentifierStart: function(ch) { - return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore) - (ch >= 0x41 && ch <= 0x5A) || // A..Z - (ch >= 0x61 && ch <= 0x7A) || // a..z - (ch === 0x5C) || // \ (backslash) - ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch))); - }, - - isIdentifierPart: function(ch) { - return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore) - (ch >= 0x41 && ch <= 0x5A) || // A..Z - (ch >= 0x61 && ch <= 0x7A) || // a..z - (ch >= 0x30 && ch <= 0x39) || // 0..9 - (ch === 0x5C) || // \ (backslash) - ((ch >= 0x80) && Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch))); - }, - - // 7.6.1.2 Future Reserved Words - - isFutureReservedWord: function(id) { - switch (id) { - case "class": - case "enum": - case "export": - case "extends": - case "import": - case "super": - return true; - default: - return false; - } - }, - - isStrictModeReservedWord: function(id, ecmaFeatures) { - switch (id) { - case "implements": - case "interface": - case "package": - case "private": - case "protected": - case "public": - case "static": - case "yield": - case "let": - return true; - case "await": - return ecmaFeatures.modules; - default: - return false; - } - }, - - isRestrictedWord: function(id) { - return id === "eval" || id === "arguments"; - }, - - // 7.6.1.1 Keywords - - isKeyword: function(id, strict, ecmaFeatures) { - - if (strict && this.isStrictModeReservedWord(id, ecmaFeatures)) { - return true; - } - - // "const" is specialized as Keyword in V8. - // "yield" and "let" are for compatiblity with SpiderMonkey and ES.next. - // Some others are from future reserved words. - - switch (id.length) { - case 2: - return (id === "if") || (id === "in") || (id === "do"); - case 3: - return (id === "var") || (id === "for") || (id === "new") || - (id === "try") || (id === "let"); - case 4: - return (id === "this") || (id === "else") || (id === "case") || - (id === "void") || (id === "with") || (id === "enum"); - case 5: - return (id === "while") || (id === "break") || (id === "catch") || - (id === "throw") || (id === "const") || (!ecmaFeatures.generators && id === "yield") || - (id === "class") || (id === "super"); - case 6: - return (id === "return") || (id === "typeof") || (id === "delete") || - (id === "switch") || (id === "export") || (id === "import"); - case 7: - return (id === "default") || (id === "finally") || (id === "extends"); - case 8: - return (id === "function") || (id === "continue") || (id === "debugger"); - case 10: - return (id === "instanceof"); - default: - return false; - } - }, - - isJSXIdentifierStart: function(ch) { - // exclude backslash (\) - return (ch !== 92) && this.isIdentifierStart(ch); - }, - - isJSXIdentifierPart: function(ch) { - // exclude backslash (\) and add hyphen (-) - return (ch !== 92) && (ch === 45 || this.isIdentifierPart(ch)); - } - - -}; diff --git a/tools/eslint/node_modules/espree/lib/token-info.js b/tools/eslint/node_modules/espree/lib/token-info.js deleted file mode 100644 index ea7676477ccc7f..00000000000000 --- a/tools/eslint/node_modules/espree/lib/token-info.js +++ /dev/null @@ -1,90 +0,0 @@ -/** - * @fileoverview Contains token information. - * @author Nicholas C. Zakas - * @copyright 2014 Nicholas C. Zakas. All rights reserved. - * @copyright 2013 Thaddee Tyl - * @copyright 2011-2013 Ariya Hidayat - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -// None! - -//------------------------------------------------------------------------------ -// Private -//------------------------------------------------------------------------------ - -var Token = { - BooleanLiteral: 1, - EOF: 2, - Identifier: 3, - Keyword: 4, - NullLiteral: 5, - NumericLiteral: 6, - Punctuator: 7, - StringLiteral: 8, - RegularExpression: 9, - Template: 10, - JSXIdentifier: 11, - JSXText: 12 -}; - -var TokenName = {}; -TokenName[Token.BooleanLiteral] = "Boolean"; -TokenName[Token.EOF] = ""; -TokenName[Token.Identifier] = "Identifier"; -TokenName[Token.Keyword] = "Keyword"; -TokenName[Token.NullLiteral] = "Null"; -TokenName[Token.NumericLiteral] = "Numeric"; -TokenName[Token.Punctuator] = "Punctuator"; -TokenName[Token.StringLiteral] = "String"; -TokenName[Token.RegularExpression] = "RegularExpression"; -TokenName[Token.Template] = "Template"; -TokenName[Token.JSXIdentifier] = "JSXIdentifier"; -TokenName[Token.JSXText] = "JSXText"; - -// A function following one of those tokens is an expression. -var FnExprTokens = ["(", "{", "[", "in", "typeof", "instanceof", "new", - "return", "case", "delete", "throw", "void", - // assignment operators - "=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", - "&=", "|=", "^=", ",", - // binary/unary operators - "+", "-", "*", "/", "%", "++", "--", "<<", ">>", ">>>", "&", - "|", "^", "!", "~", "&&", "||", "?", ":", "===", "==", ">=", - "<=", "<", ">", "!=", "!=="]; - - -//------------------------------------------------------------------------------ -// Public -//------------------------------------------------------------------------------ - -module.exports = { - Token: Token, - TokenName: TokenName, - FnExprTokens: FnExprTokens -}; diff --git a/tools/eslint/node_modules/espree/lib/token-translator.js b/tools/eslint/node_modules/espree/lib/token-translator.js new file mode 100644 index 00000000000000..3c094ab86610ed --- /dev/null +++ b/tools/eslint/node_modules/espree/lib/token-translator.js @@ -0,0 +1,270 @@ +/** + * @fileoverview Translates tokens between Acorn format and Esprima format. + * @author Nicholas C. Zakas + * @copyright 2015 Nicholas C. Zakas. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* eslint no-underscore-dangle: 0 */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +// none! + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + + +// Esprima Token Types +var Token = { + Boolean: "Boolean", + EOF: "", + Identifier: "Identifier", + Keyword: "Keyword", + Null: "Null", + Numeric: "Numeric", + Punctuator: "Punctuator", + String: "String", + RegularExpression: "RegularExpression", + Template: "Template", + JSXIdentifier: "JSXIdentifier", + JSXText: "JSXText" +}; + +/** + * Converts part of a template into an Esprima token. + * @param {AcornToken[]} tokens The Acorn tokens representing the template. + * @param {string} code The source code. + * @returns {EsprimaToken} The Esprima equivalent of the template token. + * @private + */ +function convertTemplatePart(tokens, code) { + var firstToken = tokens[0], + lastTemplateToken = tokens[tokens.length - 1]; + + var token = { + type: Token.Template, + value: code.slice(firstToken.start, lastTemplateToken.end) + }; + + if (firstToken.loc) { + token.loc = { + start: firstToken.loc.start, + end: lastTemplateToken.loc.end + }; + } + + if (firstToken.range) { + token.range = [firstToken.range[0], lastTemplateToken.range[1]]; + } + + return token; +} + +/** + * Contains logic to translate Acorn tokens into Esprima tokens. + * @param {Object} acornTokTypes The Acorn token types. + * @param {string} code The source code Acorn is parsing. This is necessary + * to correct the "value" property of some tokens. + * @constructor + */ +function TokenTranslator(acornTokTypes, code) { + + // token types + this._acornTokTypes = acornTokTypes; + + // token buffer for templates + this._tokens = []; + + // track the last curly brace + this._curlyBrace = null; + + // the source code + this._code = code; + +} + +TokenTranslator.prototype = { + constructor: TokenTranslator, + + /** + * Translates a single Esprima token to a single Acorn token. This may be + * inaccurate due to how templates are handled differently in Esprima and + * Acorn, but should be accurate for all other tokens. + * @param {AcornToken} token The Acorn token to translate. + * @param {Object} extra Espree extra object. + * @returns {EsprimaToken} The Esprima version of the token. + */ + translate: function(token, extra) { + + var type = token.type, + tt = this._acornTokTypes; + + if (type === tt.name) { + token.type = Token.Identifier; + + // TODO: See if this is an Acorn bug + if (token.value === "static") { + token.type = Token.Keyword; + } + + if (extra.ecmaVersion > 5 && (token.value === "yield" || token.value === "let")) { + token.type = Token.Keyword; + } + + } else if (type === tt.semi || type === tt.comma || + type === tt.parenL || type === tt.parenR || + type === tt.braceL || type === tt.braceR || + type === tt.dot || type === tt.bracketL || + type === tt.colon || type === tt.question || + type === tt.bracketR || type === tt.ellipsis || + type === tt.arrow || type === tt.jsxTagStart || + type === tt.incDec || type === tt.starstar || + type === tt.jsxTagEnd || (type.binop && !type.keyword) || + type.isAssign) { + + token.type = Token.Punctuator; + token.value = this._code.slice(token.start, token.end); + } else if (type === tt.jsxName) { + token.type = Token.JSXIdentifier; + } else if (type.label === "jsxText" || type === tt.jsxAttrValueToken) { + token.type = Token.JSXText; + } else if (type.keyword) { + if (type.keyword === "true" || type.keyword === "false") { + token.type = Token.Boolean; + } else if (type.keyword === "null") { + token.type = Token.Null; + } else { + token.type = Token.Keyword; + } + } else if (type === tt.num) { + token.type = Token.Numeric; + token.value = this._code.slice(token.start, token.end); + } else if (type === tt.string) { + + if (extra.jsxAttrValueToken) { + extra.jsxAttrValueToken = false; + token.type = Token.JSXText; + } else { + token.type = Token.String; + } + + token.value = this._code.slice(token.start, token.end); + } else if (type === tt.regexp) { + token.type = Token.RegularExpression; + var value = token.value; + token.regex = { + flags: value.flags, + pattern: value.pattern + }; + token.value = "/" + value.pattern + "/" + value.flags; + } + + return token; + }, + + /** + * Function to call during Acorn's onToken handler. + * @param {AcornToken} token The Acorn token. + * @param {Object} extra The Espree extra object. + * @returns {void} + */ + onToken: function(token, extra) { + + var that = this, + tt = this._acornTokTypes, + tokens = extra.tokens, + templateTokens = this._tokens; + + /** + * Flushes the buffered template tokens and resets the template + * tracking. + * @returns {void} + * @private + */ + function translateTemplateTokens() { + tokens.push(convertTemplatePart(that._tokens, that._code)); + that._tokens = []; + } + + if (token.type === tt.eof) { + + // might be one last curlyBrace + if (this._curlyBrace) { + tokens.push(this.translate(this._curlyBrace, extra)); + } + + return; + } + + if (token.type === tt.backQuote) { + templateTokens.push(token); + + // it's the end + if (templateTokens.length > 1) { + translateTemplateTokens(); + } + + return; + } else if (token.type === tt.dollarBraceL) { + templateTokens.push(token); + translateTemplateTokens(); + return; + } else if (token.type === tt.braceR) { + + // if there's already a curly, it's not part of the template + if (this._curlyBrace) { + + tokens.push(this.translate(this._curlyBrace, extra)); + } + + // store new curly for later + this._curlyBrace = token; + return; + } else if (token.type === tt.template) { + if (this._curlyBrace) { + templateTokens.push(this._curlyBrace); + this._curlyBrace = null; + } + + templateTokens.push(token); + return; + } + + if (this._curlyBrace) { + tokens.push(this.translate(this._curlyBrace, extra)); + this._curlyBrace = null; + } + + tokens.push(this.translate(token, extra)); + } +}; + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +module.exports = TokenTranslator; diff --git a/tools/eslint/node_modules/espree/lib/visitor-keys.js b/tools/eslint/node_modules/espree/lib/visitor-keys.js new file mode 100644 index 00000000000000..6934dfd26529f9 --- /dev/null +++ b/tools/eslint/node_modules/espree/lib/visitor-keys.js @@ -0,0 +1,149 @@ +/** + * @fileoverview The visitor keys for the node types Espree supports + * @author Nicholas C. Zakas + * @copyright 2015 Nicholas C. Zakas. All rights reserved. + * @copyright 2012-2013 Yusuke Suzuki (twitter: @Constellation) and other contributors. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Contains code from estraverse-fb. + * + * The MIT license. Copyright (c) 2014 Ingvar Stepanyan + * + * 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. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +// None! + +//------------------------------------------------------------------------------ +// Public +//------------------------------------------------------------------------------ + +module.exports = { + + // ECMAScript + AssignmentExpression: ["left", "right"], + AssignmentPattern: ["left", "right"], + ArrayExpression: ["elements"], + ArrayPattern: ["elements"], + ArrowFunctionExpression: ["params", "body"], + BlockStatement: ["body"], + BinaryExpression: ["left", "right"], + BreakStatement: ["label"], + CallExpression: ["callee", "arguments"], + CatchClause: ["param", "body"], + ClassBody: ["body"], + ClassDeclaration: ["id", "superClass", "body"], + ClassExpression: ["id", "superClass", "body"], + ConditionalExpression: ["test", "consequent", "alternate"], + ContinueStatement: ["label"], + DebuggerStatement: [], + DirectiveStatement: [], + DoWhileStatement: ["body", "test"], + EmptyStatement: [], + ExportAllDeclaration: ["source"], + ExportDefaultDeclaration: ["declaration"], + ExportNamedDeclaration: ["declaration", "specifiers", "source"], + ExportSpecifier: ["exported", "local"], + ExpressionStatement: ["expression"], + ForStatement: ["init", "test", "update", "body"], + ForInStatement: ["left", "right", "body"], + ForOfStatement: ["left", "right", "body"], + FunctionDeclaration: ["id", "params", "body"], + FunctionExpression: ["id", "params", "body"], + Identifier: [], + IfStatement: ["test", "consequent", "alternate"], + ImportDeclaration: ["specifiers", "source"], + ImportDefaultSpecifier: ["local"], + ImportNamespaceSpecifier: ["local"], + ImportSpecifier: ["imported", "local"], + Literal: [], + LabeledStatement: ["label", "body"], + LogicalExpression: ["left", "right"], + MemberExpression: ["object", "property"], + MetaProperty: ["meta", "property"], + MethodDefinition: ["key", "value"], + ModuleSpecifier: [], + NewExpression: ["callee", "arguments"], + ObjectExpression: ["properties"], + ObjectPattern: ["properties"], + Program: ["body"], + Property: ["key", "value"], + RestElement: [ "argument" ], + ReturnStatement: ["argument"], + SequenceExpression: ["expressions"], + SpreadElement: ["argument"], + Super: [], + SwitchStatement: ["discriminant", "cases"], + SwitchCase: ["test", "consequent"], + TaggedTemplateExpression: ["tag", "quasi"], + TemplateElement: [], + TemplateLiteral: ["quasis", "expressions"], + ThisExpression: [], + ThrowStatement: ["argument"], + TryStatement: ["block", "handler", "finalizer"], + UnaryExpression: ["argument"], + UpdateExpression: ["argument"], + VariableDeclaration: ["declarations"], + VariableDeclarator: ["id", "init"], + WhileStatement: ["test", "body"], + WithStatement: ["object", "body"], + YieldExpression: ["argument"], + + // JSX + JSXIdentifier: [], + JSXNamespacedName: ["namespace", "name"], + JSXMemberExpression: ["object", "property"], + JSXEmptyExpression: [], + JSXExpressionContainer: ["expression"], + JSXElement: ["openingElement", "closingElement", "children"], + JSXClosingElement: ["name"], + JSXOpeningElement: ["name", "attributes"], + JSXAttribute: ["name", "value"], + JSXText: null, + JSXSpreadAttribute: ["argument"], + + // Experimental features + ExperimentalRestProperty: ["argument"], + ExperimentalSpreadProperty: ["argument"] +}; diff --git a/tools/eslint/node_modules/espree/lib/xhtml-entities.js b/tools/eslint/node_modules/espree/lib/xhtml-entities.js deleted file mode 100644 index 1ceda1ecab937d..00000000000000 --- a/tools/eslint/node_modules/espree/lib/xhtml-entities.js +++ /dev/null @@ -1,293 +0,0 @@ -/** - * @fileoverview The list of XHTML entities that are valid in JSX. - * @author Nicholas C. Zakas - * @copyright 2014 Nicholas C. Zakas. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -// None! - -//------------------------------------------------------------------------------ -// Public -//------------------------------------------------------------------------------ - -module.exports = { - quot: "\u0022", - amp: "&", - apos: "\u0027", - lt: "<", - gt: ">", - nbsp: "\u00A0", - iexcl: "\u00A1", - cent: "\u00A2", - pound: "\u00A3", - curren: "\u00A4", - yen: "\u00A5", - brvbar: "\u00A6", - sect: "\u00A7", - uml: "\u00A8", - copy: "\u00A9", - ordf: "\u00AA", - laquo: "\u00AB", - not: "\u00AC", - shy: "\u00AD", - reg: "\u00AE", - macr: "\u00AF", - deg: "\u00B0", - plusmn: "\u00B1", - sup2: "\u00B2", - sup3: "\u00B3", - acute: "\u00B4", - micro: "\u00B5", - para: "\u00B6", - middot: "\u00B7", - cedil: "\u00B8", - sup1: "\u00B9", - ordm: "\u00BA", - raquo: "\u00BB", - frac14: "\u00BC", - frac12: "\u00BD", - frac34: "\u00BE", - iquest: "\u00BF", - Agrave: "\u00C0", - Aacute: "\u00C1", - Acirc: "\u00C2", - Atilde: "\u00C3", - Auml: "\u00C4", - Aring: "\u00C5", - AElig: "\u00C6", - Ccedil: "\u00C7", - Egrave: "\u00C8", - Eacute: "\u00C9", - Ecirc: "\u00CA", - Euml: "\u00CB", - Igrave: "\u00CC", - Iacute: "\u00CD", - Icirc: "\u00CE", - Iuml: "\u00CF", - ETH: "\u00D0", - Ntilde: "\u00D1", - Ograve: "\u00D2", - Oacute: "\u00D3", - Ocirc: "\u00D4", - Otilde: "\u00D5", - Ouml: "\u00D6", - times: "\u00D7", - Oslash: "\u00D8", - Ugrave: "\u00D9", - Uacute: "\u00DA", - Ucirc: "\u00DB", - Uuml: "\u00DC", - Yacute: "\u00DD", - THORN: "\u00DE", - szlig: "\u00DF", - agrave: "\u00E0", - aacute: "\u00E1", - acirc: "\u00E2", - atilde: "\u00E3", - auml: "\u00E4", - aring: "\u00E5", - aelig: "\u00E6", - ccedil: "\u00E7", - egrave: "\u00E8", - eacute: "\u00E9", - ecirc: "\u00EA", - euml: "\u00EB", - igrave: "\u00EC", - iacute: "\u00ED", - icirc: "\u00EE", - iuml: "\u00EF", - eth: "\u00F0", - ntilde: "\u00F1", - ograve: "\u00F2", - oacute: "\u00F3", - ocirc: "\u00F4", - otilde: "\u00F5", - ouml: "\u00F6", - divide: "\u00F7", - oslash: "\u00F8", - ugrave: "\u00F9", - uacute: "\u00FA", - ucirc: "\u00FB", - uuml: "\u00FC", - yacute: "\u00FD", - thorn: "\u00FE", - yuml: "\u00FF", - OElig: "\u0152", - oelig: "\u0153", - Scaron: "\u0160", - scaron: "\u0161", - Yuml: "\u0178", - fnof: "\u0192", - circ: "\u02C6", - tilde: "\u02DC", - Alpha: "\u0391", - Beta: "\u0392", - Gamma: "\u0393", - Delta: "\u0394", - Epsilon: "\u0395", - Zeta: "\u0396", - Eta: "\u0397", - Theta: "\u0398", - Iota: "\u0399", - Kappa: "\u039A", - Lambda: "\u039B", - Mu: "\u039C", - Nu: "\u039D", - Xi: "\u039E", - Omicron: "\u039F", - Pi: "\u03A0", - Rho: "\u03A1", - Sigma: "\u03A3", - Tau: "\u03A4", - Upsilon: "\u03A5", - Phi: "\u03A6", - Chi: "\u03A7", - Psi: "\u03A8", - Omega: "\u03A9", - alpha: "\u03B1", - beta: "\u03B2", - gamma: "\u03B3", - delta: "\u03B4", - epsilon: "\u03B5", - zeta: "\u03B6", - eta: "\u03B7", - theta: "\u03B8", - iota: "\u03B9", - kappa: "\u03BA", - lambda: "\u03BB", - mu: "\u03BC", - nu: "\u03BD", - xi: "\u03BE", - omicron: "\u03BF", - pi: "\u03C0", - rho: "\u03C1", - sigmaf: "\u03C2", - sigma: "\u03C3", - tau: "\u03C4", - upsilon: "\u03C5", - phi: "\u03C6", - chi: "\u03C7", - psi: "\u03C8", - omega: "\u03C9", - thetasym: "\u03D1", - upsih: "\u03D2", - piv: "\u03D6", - ensp: "\u2002", - emsp: "\u2003", - thinsp: "\u2009", - zwnj: "\u200C", - zwj: "\u200D", - lrm: "\u200E", - rlm: "\u200F", - ndash: "\u2013", - mdash: "\u2014", - lsquo: "\u2018", - rsquo: "\u2019", - sbquo: "\u201A", - ldquo: "\u201C", - rdquo: "\u201D", - bdquo: "\u201E", - dagger: "\u2020", - Dagger: "\u2021", - bull: "\u2022", - hellip: "\u2026", - permil: "\u2030", - prime: "\u2032", - Prime: "\u2033", - lsaquo: "\u2039", - rsaquo: "\u203A", - oline: "\u203E", - frasl: "\u2044", - euro: "\u20AC", - image: "\u2111", - weierp: "\u2118", - real: "\u211C", - trade: "\u2122", - alefsym: "\u2135", - larr: "\u2190", - uarr: "\u2191", - rarr: "\u2192", - darr: "\u2193", - harr: "\u2194", - crarr: "\u21B5", - lArr: "\u21D0", - uArr: "\u21D1", - rArr: "\u21D2", - dArr: "\u21D3", - hArr: "\u21D4", - forall: "\u2200", - part: "\u2202", - exist: "\u2203", - empty: "\u2205", - nabla: "\u2207", - isin: "\u2208", - notin: "\u2209", - ni: "\u220B", - prod: "\u220F", - sum: "\u2211", - minus: "\u2212", - lowast: "\u2217", - radic: "\u221A", - prop: "\u221D", - infin: "\u221E", - ang: "\u2220", - and: "\u2227", - or: "\u2228", - cap: "\u2229", - cup: "\u222A", - "int": "\u222B", - there4: "\u2234", - sim: "\u223C", - cong: "\u2245", - asymp: "\u2248", - ne: "\u2260", - equiv: "\u2261", - le: "\u2264", - ge: "\u2265", - sub: "\u2282", - sup: "\u2283", - nsub: "\u2284", - sube: "\u2286", - supe: "\u2287", - oplus: "\u2295", - otimes: "\u2297", - perp: "\u22A5", - sdot: "\u22C5", - lceil: "\u2308", - rceil: "\u2309", - lfloor: "\u230A", - rfloor: "\u230B", - lang: "\u2329", - rang: "\u232A", - loz: "\u25CA", - spades: "\u2660", - clubs: "\u2663", - hearts: "\u2665", - diams: "\u2666" -}; diff --git a/tools/eslint/node_modules/espree/package.json b/tools/eslint/node_modules/espree/package.json index 36fa14ff633654..ad58d12498a640 100644 --- a/tools/eslint/node_modules/espree/package.json +++ b/tools/eslint/node_modules/espree/package.json @@ -1,108 +1,115 @@ { - "name": "espree", - "description": "An actively-maintained fork of Esprima, the ECMAScript parsing infrastructure for multipurpose analysis", - "author": { - "name": "Nicholas C. Zakas", - "email": "nicholas+npm@nczconsulting.com" + "_args": [ + [ + "espree@3.1.3", + "/Users/silverwind/git/node/tools/package/package" + ] + ], + "_from": "espree@3.1.3", + "_id": "espree@3.1.3", + "_inCache": true, + "_installable": true, + "_location": "/espree", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/espree-3.1.3.tgz_1458322183008_0.931681108660996" }, - "homepage": "https://github.com/eslint/espree", - "main": "espree.js", - "bin": { - "esparse": "./bin/esparse.js", - "esvalidate": "./bin/esvalidate.js" + "_npmUser": { + "email": "nicholas@nczconsulting.com", + "name": "nzakas" }, - "version": "2.0.4", - "files": [ - "bin", - "lib", - "test/run.js", - "test/runner.js", - "test/test.js", - "test/compat.js", - "test/reflect.js", - "espree.js" - ], - "engines": { - "node": ">=0.10.0" + "_npmVersion": "1.4.10", + "_phantomChildren": {}, + "_requested": { + "name": "espree", + "raw": "espree@3.1.3", + "rawSpec": "3.1.3", + "scope": null, + "spec": "3.1.3", + "type": "version" }, - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/eslint/espree.git" + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/espree/-/espree-3.1.3.tgz", + "_shasum": "a77ca630986c19b74d95541b845298cd6faa228c", + "_shrinkwrap": null, + "_spec": "espree@3.1.3", + "_where": "/Users/silverwind/git/node/tools/package/package", + "author": { + "email": "nicholas+npm@nczconsulting.com", + "name": "Nicholas C. Zakas" }, "bugs": { "url": "http://github.com/eslint/espree.git" }, - "licenses": [ - { - "type": "BSD", - "url": "http://github.com/nzakas/espree/raw/master/LICENSE" - } - ], + "dependencies": { + "acorn": "^3.0.4", + "acorn-jsx": "^2.0.1" + }, + "description": "An Esprima-compatible JavaScript parser built on Acorn", "devDependencies": { "browserify": "^7.0.0", "chai": "^1.10.0", - "complexity-report": "~0.6.1", - "dateformat": "^1.0.11", - "eslint": "^0.9.2", - "esprima": "git://github.com/jquery/esprima.git", + "eslint": "^2.0.0-beta.1", + "eslint-config-eslint": "^3.0.0", + "eslint-release": "^0.3.0", + "esprima": "latest", "esprima-fb": "^8001.2001.0-dev-harmony-fb", "istanbul": "~0.2.6", "json-diff": "~0.3.1", "leche": "^1.0.1", "mocha": "^2.0.1", - "npm-license": "^0.2.3", "optimist": "~0.6.0", "regenerate": "~0.5.4", - "semver": "^4.1.1", "shelljs": "^0.3.0", "shelljs-nodecli": "^0.1.1", "unicode-6.3.0": "~0.1.0" }, + "directories": {}, + "dist": { + "shasum": "a77ca630986c19b74d95541b845298cd6faa228c", + "tarball": "https://registry.npmjs.org/espree/-/espree-3.1.3.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "espree.js", + "lib" + ], + "homepage": "https://github.com/eslint/espree", "keywords": [ + "acorn", "ast", "ecmascript", "javascript", "parser", "syntax" ], - "scripts": { - "generate-regex": "node tools/generate-identifier-regex.js", - "test": "npm run-script lint && node Makefile.js test && node test/run.js", - "lint": "node Makefile.js lint", - "patch": "node Makefile.js patch", - "minor": "node Makefile.js minor", - "major": "node Makefile.js major", - "browserify": "node Makefile.js browserify", - "coverage": "npm run-script analyze-coverage && npm run-script check-coverage", - "analyze-coverage": "node node_modules/istanbul/lib/cli.js cover test/runner.js", - "check-coverage": "node node_modules/istanbul/lib/cli.js check-coverage --statement 99 --branch 99 --function 99", - "complexity": "npm run-script analyze-complexity && npm run-script check-complexity", - "analyze-complexity": "node tools/list-complexity.js", - "check-complexity": "node node_modules/complexity-report/src/cli.js --maxcc 14 --silent -l -w espree.js", - "benchmark": "node test/benchmarks.js", - "benchmark-quick": "node test/benchmarks.js quick" - }, - "dependencies": {}, - "gitHead": "21f73f3178c9c9709c9ee1474641bb8fdad2115c", - "_id": "espree@2.0.4", - "_shasum": "679289cc5aa99923540437905288a642f21b90e9", - "_from": "espree@>=2.0.1 <3.0.0", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "nzakas", - "email": "nicholas@nczconsulting.com" - }, + "license": "BSD-2-Clause", + "main": "espree.js", "maintainers": [ { "name": "nzakas", "email": "nicholas@nczconsulting.com" } ], - "dist": { - "shasum": "679289cc5aa99923540437905288a642f21b90e9", - "tarball": "http://registry.npmjs.org/espree/-/espree-2.0.4.tgz" + "name": "espree", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/eslint/espree.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/espree/-/espree-2.0.4.tgz", - "readme": "ERROR: No README data found!" + "scripts": { + "alpharelease": "eslint-prelease alpha", + "betarelease": "eslint-prelease beta", + "browserify": "node Makefile.js browserify", + "generate-regex": "node tools/generate-identifier-regex.js", + "lint": "node Makefile.js lint", + "release": "eslint-release", + "test": "npm run-script lint && node Makefile.js test" + }, + "version": "3.1.3" } diff --git a/tools/eslint/node_modules/espree/test/compat.js b/tools/eslint/node_modules/espree/test/compat.js deleted file mode 100644 index abd623aa254cf4..00000000000000 --- a/tools/eslint/node_modules/espree/test/compat.js +++ /dev/null @@ -1,255 +0,0 @@ -/* - Copyright (C) 2012 Joost-Wim Boekesteijn - Copyright (C) 2011 Ariya Hidayat - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/*jslint node: true */ -/*global document: true, window:true, espree: true, testReflect: true */ - -var runTests; - -function getContext(espree, reportCase, reportFailure) { - 'use strict'; - - var Reflect, Pattern; - - // Maps Mozilla Reflect object to our espree parser. - Reflect = { - parse: function (code) { - var result; - - reportCase(code); - - try { - result = espree.parse(code); - } catch (error) { - result = error; - } - - return result; - } - }; - - // This is used by Reflect test suite to match a syntax tree. - Pattern = function (obj) { - var pattern; - - // Poor man's deep object cloning. - pattern = JSON.parse(JSON.stringify(obj)); - - // Special handling for regular expression literal since we need to - // convert it to a string literal, otherwise it will be decoded - // as object "{}" and the regular expression would be lost. - if (obj.type && obj.type === 'Literal') { - if (obj.value instanceof RegExp) { - pattern = { - type: obj.type, - value: obj.value.toString() - }; - } - } - - // Special handling for branch statement because SpiderMonkey - // prefers to put the 'alternate' property before 'consequent'. - if (obj.type && obj.type === 'IfStatement') { - pattern = { - type: pattern.type, - test: pattern.test, - consequent: pattern.consequent, - alternate: pattern.alternate - }; - } - - // Special handling for do while statement because SpiderMonkey - // prefers to put the 'test' property before 'body'. - if (obj.type && obj.type === 'DoWhileStatement') { - pattern = { - type: pattern.type, - body: pattern.body, - test: pattern.test - }; - } - - // Remove special properties on Property node - if (obj.type && obj.type === 'Property') { - pattern = { - type: pattern.type, - key: pattern.key, - value: pattern.value, - kind: pattern.kind - }; - } - - function adjustRegexLiteralAndRaw(key, value) { - if (key === 'value' && value instanceof RegExp) { - value = value.toString(); - } else if (key === 'raw' && typeof value === "string") { - // Ignore Espree-specific 'raw' property. - return undefined; - } else if (key === 'regex' && typeof value === "object") { - // Ignore Espree-specific 'regex' property. - return undefined; - } - return value; - } - - - if (obj.type && (obj.type === 'Program')) { - pattern.assert = function (tree) { - var actual, expected; - actual = JSON.stringify(tree, adjustRegexLiteralAndRaw, 4); - expected = JSON.stringify(obj, null, 4); - - if (expected !== actual) { - reportFailure(expected, actual); - } - }; - } - - return pattern; - }; - - return { - Reflect: Reflect, - Pattern: Pattern - }; -} - -if (typeof window !== 'undefined') { - // Run all tests in a browser environment. - runTests = function () { - 'use strict'; - - var total = 0, - failures = 0; - - function setText(el, str) { - if (typeof el.innerText === 'string') { - el.innerText = str; - } else { - el.textContent = str; - } - } - - function reportCase(code) { - var report, e; - report = document.getElementById('report'); - e = document.createElement('pre'); - e.setAttribute('class', 'code'); - setText(e, code); - report.appendChild(e); - total += 1; - } - - function reportFailure(expected, actual) { - var report, e; - - failures += 1; - - report = document.getElementById('report'); - - e = document.createElement('p'); - setText(e, 'Expected'); - report.appendChild(e); - - e = document.createElement('pre'); - e.setAttribute('class', 'expected'); - setText(e, expected); - report.appendChild(e); - - e = document.createElement('p'); - setText(e, 'Actual'); - report.appendChild(e); - - e = document.createElement('pre'); - e.setAttribute('class', 'actual'); - setText(e, actual); - report.appendChild(e); - } - - setText(document.getElementById('version'), espree.version); - - window.setTimeout(function () { - var tick, context = getContext(espree, reportCase, reportFailure); - - tick = new Date(); - testReflect(context.Reflect, context.Pattern); - tick = (new Date()) - tick; - - if (failures > 0) { - document.getElementById('status').className = 'alert-box alert'; - setText(document.getElementById('status'), total + ' tests. ' + - 'Failures: ' + failures + '. ' + tick + ' ms'); - } else { - document.getElementById('status').className = 'alert-box success'; - setText(document.getElementById('status'), total + ' tests. ' + - 'No failure. ' + tick + ' ms'); - } - }, 11); - }; -} else { - (function (global) { - 'use strict'; - var espree = require('../espree'), - tick, - total = 0, - failures = [], - header, - current, - context; - - function reportCase(code) { - total += 1; - current = code; - } - - function reportFailure(expected, actual) { - failures.push({ - source: current, - expected: expected.toString(), - actual: actual.toString() - }); - } - - context = getContext(espree, reportCase, reportFailure); - - tick = new Date(); - require('./reflect').testReflect(context.Reflect, context.Pattern); - tick = (new Date()) - tick; - - header = total + ' tests. ' + failures.length + ' failures. ' + - tick + ' ms'; - if (failures.length) { - console.error(header); - failures.forEach(function (failure) { - console.error(failure.source + ': Expected\n ' + - failure.expected.split('\n').join('\n ') + - '\nto match\n ' + failure.actual); - }); - } else { - console.log(header); - } - process.exit(failures.length === 0 ? 0 : 1); - }(this)); -} -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/eslint/node_modules/espree/test/reflect.js b/tools/eslint/node_modules/espree/test/reflect.js deleted file mode 100644 index a4740fbb751fbd..00000000000000 --- a/tools/eslint/node_modules/espree/test/reflect.js +++ /dev/null @@ -1,422 +0,0 @@ -// This is modified from Mozilla Reflect.parse test suite (the file is located -// at js/src/tests/js1_8_5/extensions/reflect-parse.js in the source tree). -// -// Some notable changes: -// * Removed unsupported features (destructuring, let, comprehensions...). -// * Removed tests for E4X (ECMAScript for XML). -// * Removed everything related to builder. -// * Enclosed every 'Pattern' construct with a scope. -// * Tweaked some expected tree to remove generator field. -// * Removed the test for bug 632030 and bug 632024. - -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/licenses/publicdomain/ - */ - -(function (exports) { - -function testReflect(Reflect, Pattern) { - -function program(elts) { return Pattern({ type: "Program", body: elts }) } -function exprStmt(expr) { return Pattern({ type: "ExpressionStatement", expression: expr }) } -function throwStmt(expr) { return Pattern({ type: "ThrowStatement", argument: expr }) } -function returnStmt(expr) { return Pattern({ type: "ReturnStatement", argument: expr }) } -function yieldExpr(expr) { return Pattern({ type: "YieldExpression", argument: expr }) } -function lit(val) { return Pattern({ type: "Literal", value: val }) } -var thisExpr = Pattern({ type: "ThisExpression" }); -function funDecl(id, params, body) { return Pattern({ type: "FunctionDeclaration", - id: id, - params: params, - defaults: [], - body: body, - rest: null, - generator: false, - expression: false - }) } -function genFunDecl(id, params, body) { return Pattern({ type: "FunctionDeclaration", - id: id, - params: params, - defaults: [], - body: body, - rest: null, - generator: false, - expression: false - }) } -function declarator(id, init) { return Pattern({ type: "VariableDeclarator", id: id, init: init }) } -function varDecl(decls) { return Pattern({ type: "VariableDeclaration", declarations: decls, kind: "var" }) } -function letDecl(decls) { return Pattern({ type: "VariableDeclaration", declarations: decls, kind: "let" }) } -function constDecl(decls) { return Pattern({ type: "VariableDeclaration", declarations: decls, kind: "const" }) } -function ident(name) { return Pattern({ type: "Identifier", name: name }) } -function dotExpr(obj, id) { return Pattern({ type: "MemberExpression", computed: false, object: obj, property: id }) } -function memExpr(obj, id) { return Pattern({ type: "MemberExpression", computed: true, object: obj, property: id }) } -function forStmt(init, test, update, body) { return Pattern({ type: "ForStatement", init: init, test: test, update: update, body: body }) } -function forInStmt(lhs, rhs, body) { return Pattern({ type: "ForInStatement", left: lhs, right: rhs, body: body, each: false }) } -function forEachInStmt(lhs, rhs, body) { return Pattern({ type: "ForInStatement", left: lhs, right: rhs, body: body, each: true }) } -function breakStmt(lab) { return Pattern({ type: "BreakStatement", label: lab }) } -function continueStmt(lab) { return Pattern({ type: "ContinueStatement", label: lab }) } -function blockStmt(body) { return Pattern({ type: "BlockStatement", body: body }) } -var emptyStmt = Pattern({ type: "EmptyStatement" }); -function ifStmt(test, cons, alt) { return Pattern({ type: "IfStatement", test: test, alternate: alt, consequent: cons }) } -function labStmt(lab, stmt) { return Pattern({ type: "LabeledStatement", label: lab, body: stmt }) } -function withStmt(obj, stmt) { return Pattern({ type: "WithStatement", object: obj, body: stmt }) } -function whileStmt(test, stmt) { return Pattern({ type: "WhileStatement", test: test, body: stmt }) } -function doStmt(stmt, test) { return Pattern({ type: "DoWhileStatement", test: test, body: stmt }) } -function switchStmt(disc, cases) { return Pattern({ type: "SwitchStatement", discriminant: disc, cases: cases }) } -function caseClause(test, stmts) { return Pattern({ type: "SwitchCase", test: test, consequent: stmts }) } -function defaultClause(stmts) { return Pattern({ type: "SwitchCase", test: null, consequent: stmts }) } -function catchClause(id, guard, body) { if (guard) { return Pattern({ type: "GuardedCatchClause", param: id, guard: guard, body: body }) } else { return Pattern({ type: "CatchClause", param: id, body: body }) } } -function tryStmt(body, guarded, catches, fin) { return Pattern({ type: "TryStatement", block: body, guardedHandlers: guarded, handlers: catches, handler: (catches.length > 0) ? catches[0] : null, finalizer: fin }) } -function letStmt(head, body) { return Pattern({ type: "LetStatement", head: head, body: body }) } -function funExpr(id, args, body, gen) { return Pattern({ type: "FunctionExpression", - id: id, - params: args, - defaults: [], - body: body, - rest: null, - generator: false, - expression: false - }) } -function genFunExpr(id, args, body) { return Pattern({ type: "FunctionExpression", - id: id, - params: args, - defaults: [], - body: body, - rest: null, - generator: false, - expression: false - }) } - -function unExpr(op, arg) { return Pattern({ type: "UnaryExpression", operator: op, argument: arg, prefix: true }) } -function binExpr(op, left, right) { return Pattern({ type: "BinaryExpression", operator: op, left: left, right: right }) } -function aExpr(op, left, right) { return Pattern({ type: "AssignmentExpression", operator: op, left: left, right: right }) } -function updExpr(op, arg, prefix) { return Pattern({ type: "UpdateExpression", operator: op, argument: arg, prefix: prefix }) } -function logExpr(op, left, right) { return Pattern({ type: "LogicalExpression", operator: op, left: left, right: right }) } - -function condExpr(test, cons, alt) { return Pattern({ type: "ConditionalExpression", test: test, consequent: cons, alternate: alt }) } -function seqExpr(exprs) { return Pattern({ type: "SequenceExpression", expressions: exprs }) } -function newExpr(callee, args) { return Pattern({ type: "NewExpression", callee: callee, arguments: args }) } -function callExpr(callee, args) { return Pattern({ type: "CallExpression", callee: callee, arguments: args }) } -function arrExpr(elts) { return Pattern({ type: "ArrayExpression", elements: elts }) } -function objExpr(elts) { return Pattern({ type: "ObjectExpression", properties: elts }) } -function objProp(key, value, kind) { return Pattern({ type: "Property", key: key, value: value, kind: kind }) } - -function arrPatt(elts) { return Pattern({ type: "ArrayPattern", elements: elts }) } -function objPatt(elts) { return Pattern({ type: "ObjectPattern", properties: elts }) } - -function localSrc(src) { return "(function(){ " + src + " })" } -function localPatt(patt) { return program([exprStmt(funExpr(null, [], blockStmt([patt])))]) } -function blockSrc(src) { return "(function(){ { " + src + " } })" } -function blockPatt(patt) { return program([exprStmt(funExpr(null, [], blockStmt([blockStmt([patt])])))]) } - -function assertBlockStmt(src, patt) { - blockPatt(patt).assert(Reflect.parse(blockSrc(src))); -} - -function assertBlockExpr(src, patt) { - assertBlockStmt(src, exprStmt(patt)); -} - -function assertBlockDecl(src, patt, builder) { - blockPatt(patt).assert(Reflect.parse(blockSrc(src), {builder: builder})); -} - -function assertLocalStmt(src, patt) { - localPatt(patt).assert(Reflect.parse(localSrc(src))); -} - -function assertLocalExpr(src, patt) { - assertLocalStmt(src, exprStmt(patt)); -} - -function assertLocalDecl(src, patt) { - localPatt(patt).assert(Reflect.parse(localSrc(src))); -} - -function assertGlobalStmt(src, patt, builder) { - program([patt]).assert(Reflect.parse(src, {builder: builder})); -} - -function assertGlobalExpr(src, patt, builder) { - program([exprStmt(patt)]).assert(Reflect.parse(src, {builder: builder})); - //assertStmt(src, exprStmt(patt)); -} - -function assertGlobalDecl(src, patt) { - program([patt]).assert(Reflect.parse(src)); -} - -function assertProg(src, patt) { - program(patt).assert(Reflect.parse(src)); -} - -function assertStmt(src, patt) { - assertLocalStmt(src, patt); - assertGlobalStmt(src, patt); - assertBlockStmt(src, patt); -} - -function assertExpr(src, patt) { - assertLocalExpr(src, patt); - assertGlobalExpr(src, patt); - assertBlockExpr(src, patt); -} - -function assertDecl(src, patt) { - assertLocalDecl(src, patt); - assertGlobalDecl(src, patt); - assertBlockDecl(src, patt); -} - -function assertError(src, errorType) { - try { - Reflect.parse(src); - } catch (e) { - return; - } - throw new Error("expected " + errorType.name + " for " + uneval(src)); -} - - -// general tests - -// NB: These are useful but for now jit-test doesn't do I/O reliably. - -//program(_).assert(Reflect.parse(snarf('data/flapjax.txt'))); -//program(_).assert(Reflect.parse(snarf('data/jquery-1.4.2.txt'))); -//program(_).assert(Reflect.parse(snarf('data/prototype.js'))); -//program(_).assert(Reflect.parse(snarf('data/dojo.js.uncompressed.js'))); -//program(_).assert(Reflect.parse(snarf('data/mootools-1.2.4-core-nc.js'))); - - -// declarations - -assertDecl("var x = 1, y = 2, z = 3", - varDecl([declarator(ident("x"), lit(1)), - declarator(ident("y"), lit(2)), - declarator(ident("z"), lit(3))])); -assertDecl("var x, y, z", - varDecl([declarator(ident("x"), null), - declarator(ident("y"), null), - declarator(ident("z"), null)])); -assertDecl("function foo() { }", - funDecl(ident("foo"), [], blockStmt([]))); -assertDecl("function foo() { return 42 }", - funDecl(ident("foo"), [], blockStmt([returnStmt(lit(42))]))); - - -// Bug 591437: rebound args have their defs turned into uses -assertDecl("function f(a) { function a() { } }", - funDecl(ident("f"), [ident("a")], blockStmt([funDecl(ident("a"), [], blockStmt([]))]))); -assertDecl("function f(a,b,c) { function b() { } }", - funDecl(ident("f"), [ident("a"),ident("b"),ident("c")], blockStmt([funDecl(ident("b"), [], blockStmt([]))]))); - -// expressions - -assertExpr("true", lit(true)); -assertExpr("false", lit(false)); -assertExpr("42", lit(42)); -assertExpr("(/asdf/)", lit(/asdf/)); -assertExpr("this", thisExpr); -assertExpr("foo", ident("foo")); -assertExpr("foo.bar", dotExpr(ident("foo"), ident("bar"))); -assertExpr("foo[bar]", memExpr(ident("foo"), ident("bar"))); -assertExpr("(function(){})", funExpr(null, [], blockStmt([]))); -assertExpr("(function f() {})", funExpr(ident("f"), [], blockStmt([]))); -assertExpr("(function f(x,y,z) {})", funExpr(ident("f"), [ident("x"),ident("y"),ident("z")], blockStmt([]))); -assertExpr("(++x)", updExpr("++", ident("x"), true)); -assertExpr("(x++)", updExpr("++", ident("x"), false)); -assertExpr("(+x)", unExpr("+", ident("x"))); -assertExpr("(-x)", unExpr("-", ident("x"))); -assertExpr("(!x)", unExpr("!", ident("x"))); -assertExpr("(~x)", unExpr("~", ident("x"))); -assertExpr("(delete x)", unExpr("delete", ident("x"))); -assertExpr("(typeof x)", unExpr("typeof", ident("x"))); -assertExpr("(void x)", unExpr("void", ident("x"))); -assertExpr("(x == y)", binExpr("==", ident("x"), ident("y"))); -assertExpr("(x != y)", binExpr("!=", ident("x"), ident("y"))); -assertExpr("(x === y)", binExpr("===", ident("x"), ident("y"))); -assertExpr("(x !== y)", binExpr("!==", ident("x"), ident("y"))); -assertExpr("(x < y)", binExpr("<", ident("x"), ident("y"))); -assertExpr("(x <= y)", binExpr("<=", ident("x"), ident("y"))); -assertExpr("(x > y)", binExpr(">", ident("x"), ident("y"))); -assertExpr("(x >= y)", binExpr(">=", ident("x"), ident("y"))); -assertExpr("(x << y)", binExpr("<<", ident("x"), ident("y"))); -assertExpr("(x >> y)", binExpr(">>", ident("x"), ident("y"))); -assertExpr("(x >>> y)", binExpr(">>>", ident("x"), ident("y"))); -assertExpr("(x + y)", binExpr("+", ident("x"), ident("y"))); -assertExpr("(w + x + y + z)", binExpr("+", binExpr("+", binExpr("+", ident("w"), ident("x")), ident("y")), ident("z"))); -assertExpr("(x - y)", binExpr("-", ident("x"), ident("y"))); -assertExpr("(w - x - y - z)", binExpr("-", binExpr("-", binExpr("-", ident("w"), ident("x")), ident("y")), ident("z"))); -assertExpr("(x * y)", binExpr("*", ident("x"), ident("y"))); -assertExpr("(x / y)", binExpr("/", ident("x"), ident("y"))); -assertExpr("(x % y)", binExpr("%", ident("x"), ident("y"))); -assertExpr("(x | y)", binExpr("|", ident("x"), ident("y"))); -assertExpr("(x ^ y)", binExpr("^", ident("x"), ident("y"))); -assertExpr("(x & y)", binExpr("&", ident("x"), ident("y"))); -assertExpr("(x in y)", binExpr("in", ident("x"), ident("y"))); -assertExpr("(x instanceof y)", binExpr("instanceof", ident("x"), ident("y"))); -assertExpr("(x = y)", aExpr("=", ident("x"), ident("y"))); -assertExpr("(x += y)", aExpr("+=", ident("x"), ident("y"))); -assertExpr("(x -= y)", aExpr("-=", ident("x"), ident("y"))); -assertExpr("(x *= y)", aExpr("*=", ident("x"), ident("y"))); -assertExpr("(x /= y)", aExpr("/=", ident("x"), ident("y"))); -assertExpr("(x %= y)", aExpr("%=", ident("x"), ident("y"))); -assertExpr("(x <<= y)", aExpr("<<=", ident("x"), ident("y"))); -assertExpr("(x >>= y)", aExpr(">>=", ident("x"), ident("y"))); -assertExpr("(x >>>= y)", aExpr(">>>=", ident("x"), ident("y"))); -assertExpr("(x |= y)", aExpr("|=", ident("x"), ident("y"))); -assertExpr("(x ^= y)", aExpr("^=", ident("x"), ident("y"))); -assertExpr("(x &= y)", aExpr("&=", ident("x"), ident("y"))); -assertExpr("(x || y)", logExpr("||", ident("x"), ident("y"))); -assertExpr("(x && y)", logExpr("&&", ident("x"), ident("y"))); -assertExpr("(w || x || y || z)", logExpr("||", logExpr("||", logExpr("||", ident("w"), ident("x")), ident("y")), ident("z"))) -assertExpr("(x ? y : z)", condExpr(ident("x"), ident("y"), ident("z"))); -assertExpr("(x,y)", seqExpr([ident("x"),ident("y")])) -assertExpr("(x,y,z)", seqExpr([ident("x"),ident("y"),ident("z")])) -assertExpr("(a,b,c,d,e,f,g)", seqExpr([ident("a"),ident("b"),ident("c"),ident("d"),ident("e"),ident("f"),ident("g")])); -assertExpr("(new Object)", newExpr(ident("Object"), [])); -assertExpr("(new Object())", newExpr(ident("Object"), [])); -assertExpr("(new Object(42))", newExpr(ident("Object"), [lit(42)])); -assertExpr("(new Object(1,2,3))", newExpr(ident("Object"), [lit(1),lit(2),lit(3)])); -assertExpr("(String())", callExpr(ident("String"), [])); -assertExpr("(String(42))", callExpr(ident("String"), [lit(42)])); -assertExpr("(String(1,2,3))", callExpr(ident("String"), [lit(1),lit(2),lit(3)])); -assertExpr("[]", arrExpr([])); -assertExpr("[1]", arrExpr([lit(1)])); -assertExpr("[1,2]", arrExpr([lit(1),lit(2)])); -assertExpr("[1,2,3]", arrExpr([lit(1),lit(2),lit(3)])); -assertExpr("[1,,2,3]", arrExpr([lit(1),,lit(2),lit(3)])); -assertExpr("[1,,,2,3]", arrExpr([lit(1),,,lit(2),lit(3)])); -assertExpr("[1,,,2,,3]", arrExpr([lit(1),,,lit(2),,lit(3)])); -assertExpr("[1,,,2,,,3]", arrExpr([lit(1),,,lit(2),,,lit(3)])); -assertExpr("[,1,2,3]", arrExpr([,lit(1),lit(2),lit(3)])); -assertExpr("[,,1,2,3]", arrExpr([,,lit(1),lit(2),lit(3)])); -assertExpr("[,,,1,2,3]", arrExpr([,,,lit(1),lit(2),lit(3)])); -assertExpr("[,,,1,2,3,]", arrExpr([,,,lit(1),lit(2),lit(3)])); -assertExpr("[,,,1,2,3,,]", arrExpr([,,,lit(1),lit(2),lit(3),undefined])); -assertExpr("[,,,1,2,3,,,]", arrExpr([,,,lit(1),lit(2),lit(3),undefined,undefined])); -assertExpr("[,,,,,]", arrExpr([undefined,undefined,undefined,undefined,undefined])); -assertExpr("({})", objExpr([])); -assertExpr("({x:1})", objExpr([objProp(ident("x"), lit(1), "init")])); -assertExpr("({x:1, y:2})", objExpr([objProp(ident("x"), lit(1), "init"), - objProp(ident("y"), lit(2), "init")])); -assertExpr("({x:1, y:2, z:3})", objExpr([objProp(ident("x"), lit(1), "init"), - objProp(ident("y"), lit(2), "init"), - objProp(ident("z"), lit(3), "init") ])); -assertExpr("({x:1, 'y':2, z:3})", objExpr([objProp(ident("x"), lit(1), "init"), - objProp(lit("y"), lit(2), "init"), - objProp(ident("z"), lit(3), "init") ])); -assertExpr("({'x':1, 'y':2, z:3})", objExpr([objProp(lit("x"), lit(1), "init"), - objProp(lit("y"), lit(2), "init"), - objProp(ident("z"), lit(3), "init") ])); -assertExpr("({'x':1, 'y':2, 3:3})", objExpr([objProp(lit("x"), lit(1), "init"), - objProp(lit("y"), lit(2), "init"), - objProp(lit(3), lit(3), "init") ])); - -// Bug 571617: eliminate constant-folding -assertExpr("2 + 3", binExpr("+", lit(2), lit(3))); - -// Bug 632026: constant-folding -assertExpr("typeof(0?0:a)", unExpr("typeof", condExpr(lit(0), lit(0), ident("a")))); - -// Bug 632056: constant-folding -program([exprStmt(ident("f")), - ifStmt(lit(1), - funDecl(ident("f"), [], blockStmt([])), - null)]).assert(Reflect.parse("f; if (1) function f(){}")); - -// statements - -assertStmt("throw 42", throwStmt(lit(42))); -assertStmt("for (;;) break", forStmt(null, null, null, breakStmt(null))); -assertStmt("for (x; y; z) break", forStmt(ident("x"), ident("y"), ident("z"), breakStmt(null))); -assertStmt("for (var x; y; z) break", forStmt(varDecl([declarator(ident("x"), null)]), ident("y"), ident("z"), breakStmt(null))); -assertStmt("for (var x = 42; y; z) break", forStmt(varDecl([declarator(ident("x"), lit(42))]), ident("y"), ident("z"), breakStmt(null))); -assertStmt("for (x; ; z) break", forStmt(ident("x"), null, ident("z"), breakStmt(null))); -assertStmt("for (var x; ; z) break", forStmt(varDecl([declarator(ident("x"), null)]), null, ident("z"), breakStmt(null))); -assertStmt("for (var x = 42; ; z) break", forStmt(varDecl([declarator(ident("x"), lit(42))]), null, ident("z"), breakStmt(null))); -assertStmt("for (x; y; ) break", forStmt(ident("x"), ident("y"), null, breakStmt(null))); -assertStmt("for (var x; y; ) break", forStmt(varDecl([declarator(ident("x"), null)]), ident("y"), null, breakStmt(null))); -assertStmt("for (var x = 42; y; ) break", forStmt(varDecl([declarator(ident("x"),lit(42))]), ident("y"), null, breakStmt(null))); -assertStmt("for (var x in y) break", forInStmt(varDecl([declarator(ident("x"),null)]), ident("y"), breakStmt(null))); -assertStmt("for (x in y) break", forInStmt(ident("x"), ident("y"), breakStmt(null))); -assertStmt("{ }", blockStmt([])); -assertStmt("{ throw 1; throw 2; throw 3; }", blockStmt([ throwStmt(lit(1)), throwStmt(lit(2)), throwStmt(lit(3))])); -assertStmt(";", emptyStmt); -assertStmt("if (foo) throw 42;", ifStmt(ident("foo"), throwStmt(lit(42)), null)); -assertStmt("if (foo) throw 42; else true;", ifStmt(ident("foo"), throwStmt(lit(42)), exprStmt(lit(true)))); -assertStmt("if (foo) { throw 1; throw 2; throw 3; }", - ifStmt(ident("foo"), - blockStmt([throwStmt(lit(1)), throwStmt(lit(2)), throwStmt(lit(3))]), - null)); -assertStmt("if (foo) { throw 1; throw 2; throw 3; } else true;", - ifStmt(ident("foo"), - blockStmt([throwStmt(lit(1)), throwStmt(lit(2)), throwStmt(lit(3))]), - exprStmt(lit(true)))); -assertStmt("foo: for(;;) break foo;", labStmt(ident("foo"), forStmt(null, null, null, breakStmt(ident("foo"))))); -assertStmt("foo: for(;;) continue foo;", labStmt(ident("foo"), forStmt(null, null, null, continueStmt(ident("foo"))))); -assertStmt("with (obj) { }", withStmt(ident("obj"), blockStmt([]))); -assertStmt("with (obj) { obj; }", withStmt(ident("obj"), blockStmt([exprStmt(ident("obj"))]))); -assertStmt("while (foo) { }", whileStmt(ident("foo"), blockStmt([]))); -assertStmt("while (foo) { foo; }", whileStmt(ident("foo"), blockStmt([exprStmt(ident("foo"))]))); -assertStmt("do { } while (foo);", doStmt(blockStmt([]), ident("foo"))); -assertStmt("do { foo; } while (foo)", doStmt(blockStmt([exprStmt(ident("foo"))]), ident("foo"))); -assertStmt("switch (foo) { case 1: 1; break; case 2: 2; break; default: 3; }", - switchStmt(ident("foo"), - [ caseClause(lit(1), [ exprStmt(lit(1)), breakStmt(null) ]), - caseClause(lit(2), [ exprStmt(lit(2)), breakStmt(null) ]), - defaultClause([ exprStmt(lit(3)) ]) ])); -assertStmt("switch (foo) { case 1: 1; break; case 2: 2; break; default: 3; case 42: 42; }", - switchStmt(ident("foo"), - [ caseClause(lit(1), [ exprStmt(lit(1)), breakStmt(null) ]), - caseClause(lit(2), [ exprStmt(lit(2)), breakStmt(null) ]), - defaultClause([ exprStmt(lit(3)) ]), - caseClause(lit(42), [ exprStmt(lit(42)) ]) ])); -assertStmt("try { } catch (e) { }", - tryStmt(blockStmt([]), - [], - [ catchClause(ident("e"), null, blockStmt([])) ], - null)); -assertStmt("try { } catch (e) { } finally { }", - tryStmt(blockStmt([]), - [], - [ catchClause(ident("e"), null, blockStmt([])) ], - blockStmt([]))); -assertStmt("try { } finally { }", - tryStmt(blockStmt([]), - [], - [], - blockStmt([]))); - -// redeclarations (TOK_NAME nodes with lexdef) - -assertStmt("function f() { function g() { } function g() { } }", - funDecl(ident("f"), [], blockStmt([funDecl(ident("g"), [], blockStmt([])), - funDecl(ident("g"), [], blockStmt([]))]))); - -assertStmt("function f() { function g() { } function g() { return 42 } }", - funDecl(ident("f"), [], blockStmt([funDecl(ident("g"), [], blockStmt([])), - funDecl(ident("g"), [], blockStmt([returnStmt(lit(42))]))]))); - -assertStmt("function f() { var x = 42; var x = 43; }", - funDecl(ident("f"), [], blockStmt([varDecl([declarator(ident("x"),lit(42))]), - varDecl([declarator(ident("x"),lit(43))])]))); - -// getters and setters - - assertExpr("({ get x() { return 42 } })", - objExpr([ objProp(ident("x"), - funExpr(null, [], blockStmt([returnStmt(lit(42))])), - "get" ) ])); - assertExpr("({ set x(v) { return 42 } })", - objExpr([ objProp(ident("x"), - funExpr(null, [ident("v")], blockStmt([returnStmt(lit(42))])), - "set" ) ])); - -} - -exports.testReflect = testReflect; - -}(typeof exports === 'undefined' ? this : exports)); diff --git a/tools/eslint/node_modules/espree/test/run.js b/tools/eslint/node_modules/espree/test/run.js deleted file mode 100644 index bd303e058e40fb..00000000000000 --- a/tools/eslint/node_modules/espree/test/run.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - Copyright (C) 2012 Yusuke Suzuki - Copyright (C) 2012 Ariya Hidayat - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/*jslint node:true */ - -(function () { - 'use strict'; - - var child = require('child_process'), - nodejs = '"' + process.execPath + '"', - ret = 0, - suites, - index; - - suites = [ - 'runner', - // TODO: Figure out what to do about this test...remove? - // 'compat', - 'parselibs' - ]; - - function nextTest() { - var suite = suites[index]; - - if (index < suites.length) { - child.exec(nodejs + ' ./test/' + suite + '.js', function (err, stdout, stderr) { - if (stdout) { - process.stdout.write(suite + ': ' + stdout); - } - if (stderr) { - process.stderr.write(suite + ': ' + stderr); - } - if (err) { - ret = err.code; - } - index += 1; - nextTest(); - }); - } else { - process.exit(ret); - } - } - - index = 0; - nextTest(); -}()); diff --git a/tools/eslint/node_modules/espree/test/runner.js b/tools/eslint/node_modules/espree/test/runner.js deleted file mode 100644 index a29f29e1b407b3..00000000000000 --- a/tools/eslint/node_modules/espree/test/runner.js +++ /dev/null @@ -1,492 +0,0 @@ -/* - Copyright (C) 2012 Ariya Hidayat - Copyright (C) 2012 Joost-Wim Boekesteijn - Copyright (C) 2012 Yusuke Suzuki - Copyright (C) 2012 Arpad Borsos - Copyright (C) 2011 Ariya Hidayat - Copyright (C) 2011 Yusuke Suzuki - Copyright (C) 2011 Arpad Borsos - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/*jslint browser:true node:true */ -/*global espree:true, testFixture:true */ - -var runTests; - -// Special handling for regular expression literal since we need to -// convert it to a string literal, otherwise it will be decoded -// as object "{}" and the regular expression would be lost. -function adjustRegexLiteral(key, value) { - 'use strict'; - if (key === 'value' && value instanceof RegExp) { - value = value.toString(); - } - return value; -} - -function NotMatchingError(expected, actual) { - 'use strict'; - Error.call(this, 'Expected '); - this.expected = expected; - this.actual = actual; -} -NotMatchingError.prototype = new Error(); - -function errorToObject(e) { - 'use strict'; - var msg = e.toString(); - - // Opera 9.64 produces an non-standard string in toString(). - if (msg.substr(0, 6) !== 'Error:') { - if (typeof e.message === 'string') { - msg = 'Error: ' + e.message; - } - } - - return { - index: e.index, - lineNumber: e.lineNumber, - column: e.column, - message: msg - }; -} - -function sortedObject(o) { - if (o === null) { - return o; - } - if (o instanceof Array) { - return o.map(sortedObject); - } - if (typeof o !== 'object') { - return o; - } - if (o instanceof RegExp) { - return o; - } - var keys = Object.keys(o); - var result = { - range: undefined, - loc: undefined - }; - keys.forEach(function (key) { - if (o.hasOwnProperty(key)){ - result[key] = sortedObject(o[key]); - } - }); - return result; -} - -function hasAttachedComment(syntax) { - var key; - for (key in syntax) { - if (key === 'leadingComments' || key === 'trailingComments') { - return true; - } - if (typeof syntax[key] === 'object' && syntax[key] !== null) { - if (hasAttachedComment(syntax[key])) { - return true; - } - } - } - return false; -} - -function testParse(espree, code, syntax) { - 'use strict'; - var expected, tree, actual, options, StringObject, i, len, err; - - // alias, so that JSLint does not complain. - StringObject = String; - - options = { - comment: (typeof syntax.comments !== 'undefined'), - range: true, - loc: true, - tokens: (typeof syntax.tokens !== 'undefined'), - raw: true, - tolerant: (typeof syntax.errors !== 'undefined'), - source: null - }; - - if (options.comment) { - options.attachComment = hasAttachedComment(syntax); - } - - if (typeof syntax.tokens !== 'undefined') { - if (syntax.tokens.length > 0) { - options.range = (typeof syntax.tokens[0].range !== 'undefined'); - options.loc = (typeof syntax.tokens[0].loc !== 'undefined'); - } - } - - if (typeof syntax.comments !== 'undefined') { - if (syntax.comments.length > 0) { - options.range = (typeof syntax.comments[0].range !== 'undefined'); - options.loc = (typeof syntax.comments[0].loc !== 'undefined'); - } - } - - if (options.loc) { - options.source = syntax.loc.source; - } - - syntax = sortedObject(syntax); - expected = JSON.stringify(syntax, null, 4); - try { - // Some variations of the options. - tree = espree.parse(code, { tolerant: options.tolerant }); - tree = espree.parse(code, { tolerant: options.tolerant, range: true }); - tree = espree.parse(code, { tolerant: options.tolerant, loc: true }); - - tree = espree.parse(code, options); - tree = (options.comment || options.tokens || options.tolerant) ? tree : tree.body[0]; - - if (options.tolerant) { - for (i = 0, len = tree.errors.length; i < len; i += 1) { - tree.errors[i] = errorToObject(tree.errors[i]); - } - } - tree = sortedObject(tree); - actual = JSON.stringify(tree, adjustRegexLiteral, 4); - - // Only to ensure that there is no error when using string object. - espree.parse(new StringObject(code), options); - - } catch (e) { - throw new NotMatchingError(expected, e.toString()); - } - if (expected !== actual) { - throw new NotMatchingError(expected, actual); - } - - function filter(key, value) { - if (key === 'value' && value instanceof RegExp) { - value = value.toString(); - } - return (key === 'loc' || key === 'range') ? undefined : value; - } - - if (options.tolerant) { - return; - } - - - // Check again without any location info. - options.range = false; - options.loc = false; - syntax = sortedObject(syntax); - expected = JSON.stringify(syntax, filter, 4); - try { - tree = espree.parse(code, options); - tree = (options.comment || options.tokens) ? tree : tree.body[0]; - - if (options.tolerant) { - for (i = 0, len = tree.errors.length; i < len; i += 1) { - tree.errors[i] = errorToObject(tree.errors[i]); - } - } - tree = sortedObject(tree); - actual = JSON.stringify(tree, filter, 4); - } catch (e) { - throw new NotMatchingError(expected, e.toString()); - } - if (expected !== actual) { - throw new NotMatchingError(expected, actual); - } -} - -function testTokenize(espree, code, tokens) { - 'use strict'; - var options, expected, actual, tree; - - options = { - comment: true, - tolerant: true, - loc: true, - range: true - }; - - expected = JSON.stringify(tokens, null, 4); - - try { - tree = espree.tokenize(code, options); - actual = JSON.stringify(tree, null, 4); - } catch (e) { - throw new NotMatchingError(expected, e.toString()); - } - if (expected !== actual) { - throw new NotMatchingError(expected, actual); - } -} - -function testError(espree, code, exception) { - 'use strict'; - var i, options, expected, actual, err, handleInvalidRegexFlag, tokenize; - - // Different parsing options should give the same error. - options = [ - {}, - { comment: true }, - { raw: true }, - { raw: true, comment: true } - ]; - - // If handleInvalidRegexFlag is true, an invalid flag in a regular expression - // will throw an exception. In some old version V8, this is not the case - // and hence handleInvalidRegexFlag is false. - handleInvalidRegexFlag = false; - try { - 'test'.match(new RegExp('[a-z]', 'x')); - } catch (e) { - handleInvalidRegexFlag = true; - } - - exception.description = exception.message.replace(/Error: Line [0-9]+: /, ''); - - if (exception.tokenize) { - tokenize = true; - exception.tokenize = undefined; - } - expected = JSON.stringify(exception); - - for (i = 0; i < options.length; i += 1) { - - try { - if (tokenize) { - espree.tokenize(code, options[i]) - } else { - espree.parse(code, options[i]); - } - } catch (e) { - err = errorToObject(e); - err.description = e.description; - actual = JSON.stringify(err); - } - - if (expected !== actual) { - - // Compensate for old V8 which does not handle invalid flag. - if (exception.message.indexOf('Invalid regular expression') > 0) { - if (typeof actual === 'undefined' && !handleInvalidRegexFlag) { - return; - } - } - - throw new NotMatchingError(expected, actual); - } - - } -} - -function testAPI(espree, code, result) { - 'use strict'; - var expected, res, actual; - - expected = JSON.stringify(result.result, null, 4); - try { - if (typeof result.property !== 'undefined') { - res = espree[result.property]; - } else { - res = espree[result.call].apply(espree, result.args); - } - actual = JSON.stringify(res, adjustRegexLiteral, 4); - } catch (e) { - throw new NotMatchingError(expected, e.toString()); - } - if (expected !== actual) { - throw new NotMatchingError(expected, actual); - } -} - -function runTest(espree, code, result) { - 'use strict'; - if (result.hasOwnProperty('lineNumber')) { - testError(espree, code, result); - } else if (result.hasOwnProperty('result')) { - testAPI(espree, code, result); - } else if (result instanceof Array) { - testTokenize(espree, code, result); - } else { - testParse(espree, code, result); - } -} - -if (typeof window !== 'undefined') { - // Run all tests in a browser environment. - runTests = function () { - 'use strict'; - var total = 0, - failures = 0, - category, - fixture, - source, - tick, - expected, - index, - len; - - function setText(el, str) { - if (typeof el.innerText === 'string') { - el.innerText = str; - } else { - el.textContent = str; - } - } - - function startCategory(category) { - var report, e; - report = document.getElementById('report'); - e = document.createElement('h4'); - setText(e, category); - report.appendChild(e); - } - - function reportSuccess(code) { - var report, e; - report = document.getElementById('report'); - e = document.createElement('pre'); - e.setAttribute('class', 'code'); - setText(e, code); - report.appendChild(e); - } - - function reportFailure(code, expected, actual) { - var report, e; - - report = document.getElementById('report'); - - e = document.createElement('p'); - setText(e, 'Code:'); - report.appendChild(e); - - e = document.createElement('pre'); - e.setAttribute('class', 'code'); - setText(e, code); - report.appendChild(e); - - e = document.createElement('p'); - setText(e, 'Expected'); - report.appendChild(e); - - e = document.createElement('pre'); - e.setAttribute('class', 'expected'); - setText(e, expected); - report.appendChild(e); - - e = document.createElement('p'); - setText(e, 'Actual'); - report.appendChild(e); - - e = document.createElement('pre'); - e.setAttribute('class', 'actual'); - setText(e, actual); - report.appendChild(e); - } - - setText(document.getElementById('version'), espree.version); - - tick = new Date(); - for (category in testFixture) { - if (testFixture.hasOwnProperty(category)) { - startCategory(category); - fixture = testFixture[category]; - for (source in fixture) { - if (fixture.hasOwnProperty(source)) { - expected = fixture[source]; - total += 1; - try { - runTest(espree, source, expected); - reportSuccess(source, JSON.stringify(expected, null, 4)); - } catch (e) { - failures += 1; - reportFailure(source, e.expected, e.actual); - } - } - } - } - } - tick = (new Date()) - tick; - - if (failures > 0) { - document.getElementById('status').className = 'alert-box alert'; - setText(document.getElementById('status'), total + ' tests. ' + - 'Failures: ' + failures + '. ' + tick + ' ms.'); - } else { - document.getElementById('status').className = 'alert-box success'; - setText(document.getElementById('status'), total + ' tests. ' + - 'No failure. ' + tick + ' ms.'); - } - }; -} else { - (function () { - 'use strict'; - - var espree = require('../espree'), - diff = require('json-diff').diffString, - total = 0, - failures = [], - tick = new Date(), - expected, - header, - testFixture = require("./test"); - - Object.keys(testFixture).forEach(function (category) { - Object.keys(testFixture[category]).forEach(function (source) { - total += 1; - expected = testFixture[category][source]; - try { - runTest(espree, source, expected); - } catch (e) { - e.source = source; - failures.push(e); - } - }); - }); - tick = (new Date()) - tick; - - header = total + ' tests. ' + failures.length + ' failures. ' + - tick + ' ms'; - if (failures.length) { - console.error(header); - failures.forEach(function (failure) { - try { - var expectedObject = JSON.parse(failure.expected); - var actualObject = JSON.parse(failure.actual); - - console.error(failure.source + ': Expected\n ' + - failure.expected.split('\n').join('\n ') + - '\nto match\n ' + failure.actual + '\nDiff:\n' + - diff(expectedObject, actualObject)); - } catch (ex) { - console.error(failure.source + ': Expected\n ' + - failure.expected.split('\n').join('\n ') + - '\nto match\n ' + failure.actual); - } - }); - } else { - console.log(header); - } - process.exit(failures.length === 0 ? 0 : 1); - }()); -} diff --git a/tools/eslint/node_modules/espree/test/test.js b/tools/eslint/node_modules/espree/test/test.js deleted file mode 100644 index 93193c7ea5d0e0..00000000000000 --- a/tools/eslint/node_modules/espree/test/test.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @fileoverview Tests for parsing/tokenization. - * @author Nicholas C. Zakas - * @copyright 2014 Nicholas C. Zakas. All rights reserved. - */ - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var shelljs = require("shelljs"), - fs = require("fs"), - path = require("path"); - -//------------------------------------------------------------------------------ -// Processing -//------------------------------------------------------------------------------ - -var files = shelljs.find("./tests/fixtures/ast"); - -files.filter(function(filename) { - return path.extname(filename) === ".json"; -}).forEach(function(filename) { - var basename = path.basename(filename, ".json"); - exports[basename] = JSON.parse(fs.readFileSync(filename, "utf8"), function(key, value) { - - // JSON can't represent undefined, so we use a special value - if (value === "espree@undefined") { - return undefined; - } else { - return value; - } - }); -}); diff --git a/tools/eslint/node_modules/esprima/LICENSE.BSD b/tools/eslint/node_modules/esprima/LICENSE.BSD new file mode 100644 index 00000000000000..17557eceb90690 --- /dev/null +++ b/tools/eslint/node_modules/esprima/LICENSE.BSD @@ -0,0 +1,21 @@ +Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/eslint/node_modules/esprima/README.md b/tools/eslint/node_modules/esprima/README.md new file mode 100644 index 00000000000000..749454f44995ed --- /dev/null +++ b/tools/eslint/node_modules/esprima/README.md @@ -0,0 +1,27 @@ +[![NPM version](https://img.shields.io/npm/v/esprima.svg)](https://www.npmjs.com/package/esprima) +[![npm download](https://img.shields.io/npm/dm/esprima.svg)](https://www.npmjs.com/package/esprima) +[![Build Status](https://img.shields.io/travis/jquery/esprima/master.svg)](https://travis-ci.org/jquery/esprima) +[![Coverage Status](https://img.shields.io/codecov/c/github/jquery/esprima/master.svg)](https://codecov.io/github/jquery/esprima) + +**Esprima** ([esprima.org](http://esprima.org), BSD license) is a high performance, +standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) +parser written in ECMAScript (also popularly known as +[JavaScript](https://en.wikipedia.org/wiki/JavaScript)). +Esprima is created and maintained by [Ariya Hidayat](https://twitter.com/ariyahidayat), +with the help of [many contributors](https://github.com/jquery/esprima/contributors). + +### Features + +- Full support for ECMAScript 6 ([ECMA-262](http://www.ecma-international.org/publications/standards/Ecma-262.htm)) +- Sensible [syntax tree format](https://github.com/estree/estree/blob/master/spec.md) as standardized by [ESTree project](https://github.com/estree/estree) +- Optional tracking of syntax node location (index-based and line-column) +- [Heavily tested](http://esprima.org/test/ci.html) (~1250 [unit tests](https://github.com/jquery/esprima/tree/master/test/fixtures) with [full code coverage](https://codecov.io/github/jquery/esprima)) + +Esprima serves as a **building block** for some JavaScript +language tools, from [code instrumentation](http://esprima.org/demo/functiontrace.html) +to [editor autocompletion](http://esprima.org/demo/autocomplete.html). + +Esprima runs on many popular web browsers, as well as other ECMAScript platforms such as +[Rhino](http://www.mozilla.org/rhino), [Nashorn](http://openjdk.java.net/projects/nashorn/), and [Node.js](https://npmjs.org/package/esprima). + +For more information, check the web site [esprima.org](http://esprima.org). diff --git a/tools/eslint/node_modules/esprima/bin/esparse.js b/tools/eslint/node_modules/esprima/bin/esparse.js new file mode 100755 index 00000000000000..98bdbf48f2629e --- /dev/null +++ b/tools/eslint/node_modules/esprima/bin/esparse.js @@ -0,0 +1,126 @@ +#!/usr/bin/env node +/* + Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/*jslint sloppy:true node:true rhino:true */ + +var fs, esprima, fname, content, options, syntax; + +if (typeof require === 'function') { + fs = require('fs'); + esprima = require('esprima'); +} else if (typeof load === 'function') { + try { + load('esprima.js'); + } catch (e) { + load('../esprima.js'); + } +} + +// Shims to Node.js objects when running under Rhino. +if (typeof console === 'undefined' && typeof process === 'undefined') { + console = { log: print }; + fs = { readFileSync: readFile }; + process = { argv: arguments, exit: quit }; + process.argv.unshift('esparse.js'); + process.argv.unshift('rhino'); +} + +function showUsage() { + console.log('Usage:'); + console.log(' esparse [options] file.js'); + console.log(); + console.log('Available options:'); + console.log(); + console.log(' --comment Gather all line and block comments in an array'); + console.log(' --loc Include line-column location info for each syntax node'); + console.log(' --range Include index-based range for each syntax node'); + console.log(' --raw Display the raw value of literals'); + console.log(' --tokens List all tokens in an array'); + console.log(' --tolerant Tolerate errors on a best-effort basis (experimental)'); + console.log(' -v, --version Shows program version'); + console.log(); + process.exit(1); +} + +if (process.argv.length <= 2) { + showUsage(); +} + +options = {}; + +process.argv.splice(2).forEach(function (entry) { + + if (entry === '-h' || entry === '--help') { + showUsage(); + } else if (entry === '-v' || entry === '--version') { + console.log('ECMAScript Parser (using Esprima version', esprima.version, ')'); + console.log(); + process.exit(0); + } else if (entry === '--comment') { + options.comment = true; + } else if (entry === '--loc') { + options.loc = true; + } else if (entry === '--range') { + options.range = true; + } else if (entry === '--raw') { + options.raw = true; + } else if (entry === '--tokens') { + options.tokens = true; + } else if (entry === '--tolerant') { + options.tolerant = true; + } else if (entry.slice(0, 2) === '--') { + console.log('Error: unknown option ' + entry + '.'); + process.exit(1); + } else if (typeof fname === 'string') { + console.log('Error: more than one input file.'); + process.exit(1); + } else { + fname = entry; + } +}); + +if (typeof fname !== 'string') { + console.log('Error: no input file.'); + process.exit(1); +} + +// Special handling for regular expression literal since we need to +// convert it to a string literal, otherwise it will be decoded +// as object "{}" and the regular expression would be lost. +function adjustRegexLiteral(key, value) { + if (key === 'value' && value instanceof RegExp) { + value = value.toString(); + } + return value; +} + +try { + content = fs.readFileSync(fname, 'utf-8'); + syntax = esprima.parse(content, options); + console.log(JSON.stringify(syntax, adjustRegexLiteral, 4)); +} catch (e) { + console.log('Error: ' + e.message); + process.exit(1); +} diff --git a/tools/eslint/node_modules/esprima/bin/esvalidate.js b/tools/eslint/node_modules/esprima/bin/esvalidate.js new file mode 100755 index 00000000000000..f522dec290b707 --- /dev/null +++ b/tools/eslint/node_modules/esprima/bin/esvalidate.js @@ -0,0 +1,199 @@ +#!/usr/bin/env node +/* + Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/*jslint sloppy:true plusplus:true node:true rhino:true */ +/*global phantom:true */ + +var fs, system, esprima, options, fnames, count; + +if (typeof esprima === 'undefined') { + // PhantomJS can only require() relative files + if (typeof phantom === 'object') { + fs = require('fs'); + system = require('system'); + esprima = require('./esprima'); + } else if (typeof require === 'function') { + fs = require('fs'); + esprima = require('esprima'); + } else if (typeof load === 'function') { + try { + load('esprima.js'); + } catch (e) { + load('../esprima.js'); + } + } +} + +// Shims to Node.js objects when running under PhantomJS 1.7+. +if (typeof phantom === 'object') { + fs.readFileSync = fs.read; + process = { + argv: [].slice.call(system.args), + exit: phantom.exit + }; + process.argv.unshift('phantomjs'); +} + +// Shims to Node.js objects when running under Rhino. +if (typeof console === 'undefined' && typeof process === 'undefined') { + console = { log: print }; + fs = { readFileSync: readFile }; + process = { argv: arguments, exit: quit }; + process.argv.unshift('esvalidate.js'); + process.argv.unshift('rhino'); +} + +function showUsage() { + console.log('Usage:'); + console.log(' esvalidate [options] file.js'); + console.log(); + console.log('Available options:'); + console.log(); + console.log(' --format=type Set the report format, plain (default) or junit'); + console.log(' -v, --version Print program version'); + console.log(); + process.exit(1); +} + +if (process.argv.length <= 2) { + showUsage(); +} + +options = { + format: 'plain' +}; + +fnames = []; + +process.argv.splice(2).forEach(function (entry) { + + if (entry === '-h' || entry === '--help') { + showUsage(); + } else if (entry === '-v' || entry === '--version') { + console.log('ECMAScript Validator (using Esprima version', esprima.version, ')'); + console.log(); + process.exit(0); + } else if (entry.slice(0, 9) === '--format=') { + options.format = entry.slice(9); + if (options.format !== 'plain' && options.format !== 'junit') { + console.log('Error: unknown report format ' + options.format + '.'); + process.exit(1); + } + } else if (entry.slice(0, 2) === '--') { + console.log('Error: unknown option ' + entry + '.'); + process.exit(1); + } else { + fnames.push(entry); + } +}); + +if (fnames.length === 0) { + console.log('Error: no input file.'); + process.exit(1); +} + +if (options.format === 'junit') { + console.log(''); + console.log(''); +} + +count = 0; +fnames.forEach(function (fname) { + var content, timestamp, syntax, name; + try { + content = fs.readFileSync(fname, 'utf-8'); + + if (content[0] === '#' && content[1] === '!') { + content = '//' + content.substr(2, content.length); + } + + timestamp = Date.now(); + syntax = esprima.parse(content, { tolerant: true }); + + if (options.format === 'junit') { + + name = fname; + if (name.lastIndexOf('/') >= 0) { + name = name.slice(name.lastIndexOf('/') + 1); + } + + console.log(''); + + syntax.errors.forEach(function (error) { + var msg = error.message; + msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); + console.log(' '); + console.log(' ' + + error.message + '(' + name + ':' + error.lineNumber + ')' + + ''); + console.log(' '); + }); + + console.log(''); + + } else if (options.format === 'plain') { + + syntax.errors.forEach(function (error) { + var msg = error.message; + msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); + msg = fname + ':' + error.lineNumber + ': ' + msg; + console.log(msg); + ++count; + }); + + } + } catch (e) { + ++count; + if (options.format === 'junit') { + console.log(''); + console.log(' '); + console.log(' ' + + e.message + '(' + fname + ((e.lineNumber) ? ':' + e.lineNumber : '') + + ')'); + console.log(' '); + console.log(''); + } else { + console.log('Error: ' + e.message); + } + } +}); + +if (options.format === 'junit') { + console.log(''); +} + +if (count > 0) { + process.exit(1); +} + +if (count === 0 && typeof phantom === 'object') { + process.exit(0); +} diff --git a/tools/eslint/node_modules/js-yaml/node_modules/esprima/esprima.js b/tools/eslint/node_modules/esprima/esprima.js similarity index 77% rename from tools/eslint/node_modules/js-yaml/node_modules/esprima/esprima.js rename to tools/eslint/node_modules/esprima/esprima.js index 2d7fc11cc3cfd2..654e5fd0ddb318 100644 --- a/tools/eslint/node_modules/js-yaml/node_modules/esprima/esprima.js +++ b/tools/eslint/node_modules/esprima/esprima.js @@ -1,14 +1,5 @@ /* - Copyright (C) 2013 Ariya Hidayat - Copyright (C) 2013 Thaddee Tyl - Copyright (C) 2013 Mathias Bynens - Copyright (C) 2012 Ariya Hidayat - Copyright (C) 2012 Mathias Bynens - Copyright (C) 2012 Joost-Wim Boekesteijn - Copyright (C) 2012 Kris Kowal - Copyright (C) 2012 Yusuke Suzuki - Copyright (C) 2012 Arpad Borsos - Copyright (C) 2011 Ariya Hidayat + Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -57,7 +48,6 @@ Regex, source, strict, - sourceType, index, lineNumber, lineStart, @@ -138,6 +128,7 @@ ExportSpecifier: 'ExportSpecifier', ExpressionStatement: 'ExpressionStatement', ForStatement: 'ForStatement', + ForOfStatement: 'ForOfStatement', ForInStatement: 'ForInStatement', FunctionDeclaration: 'FunctionDeclaration', FunctionExpression: 'FunctionExpression', @@ -151,6 +142,7 @@ LabeledStatement: 'LabeledStatement', LogicalExpression: 'LogicalExpression', MemberExpression: 'MemberExpression', + MetaProperty: 'MetaProperty', MethodDefinition: 'MethodDefinition', NewExpression: 'NewExpression', ObjectExpression: 'ObjectExpression', @@ -175,7 +167,8 @@ VariableDeclaration: 'VariableDeclaration', VariableDeclarator: 'VariableDeclarator', WhileStatement: 'WhileStatement', - WithStatement: 'WithStatement' + WithStatement: 'WithStatement', + YieldExpression: 'YieldExpression' }; PlaceHolders = { @@ -196,6 +189,7 @@ UnterminatedRegExp: 'Invalid regular expression: missing /', InvalidLHSInAssignment: 'Invalid left-hand side in assignment', InvalidLHSInForIn: 'Invalid left-hand side in for-in', + InvalidLHSInForLoop: 'Invalid left-hand side in for-loop', MultipleDefaultsInSwitch: 'More than one default clause in switch statement', NoCatchOrFinally: 'Missing catch or finally after try', UnknownLabel: 'Undefined label \'%0\'', @@ -227,13 +221,17 @@ NoAsAfterImportNamespace: 'Unexpected token', InvalidModuleSpecifier: 'Unexpected token', IllegalImportDeclaration: 'Unexpected token', - IllegalExportDeclaration: 'Unexpected token' + IllegalExportDeclaration: 'Unexpected token', + DuplicateBinding: 'Duplicate binding %0' }; - // See also tools/generate-unicode-regex.py. + // See also tools/generate-unicode-regex.js. Regex = { - NonAsciiIdentifierStart: new RegExp('[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]'), - NonAsciiIdentifierPart: new RegExp('[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]') + // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierStart: + NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]/, + + // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierPart: + NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDD0-\uDDDA\uDE00-\uDE11\uDE13-\uDE37\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF01-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ }; // Ensure the condition is true, otherwise throw an error. @@ -283,27 +281,33 @@ }; } - // 7.2 White Space + // ECMA-262 11.2 White Space function isWhiteSpace(ch) { return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) || (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0); } - // 7.3 Line Terminators + // ECMA-262 11.3 Line Terminators function isLineTerminator(ch) { return (ch === 0x0A) || (ch === 0x0D) || (ch === 0x2028) || (ch === 0x2029); } - // 7.6 Identifier Names and Identifiers + // ECMA-262 11.6 Identifier Names and Identifiers + + function fromCodePoint(cp) { + return (cp < 0x10000) ? String.fromCharCode(cp) : + String.fromCharCode(0xD800 + ((cp - 0x10000) >> 10)) + + String.fromCharCode(0xDC00 + ((cp - 0x10000) & 1023)); + } function isIdentifierStart(ch) { return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore) (ch >= 0x41 && ch <= 0x5A) || // A..Z (ch >= 0x61 && ch <= 0x7A) || // a..z (ch === 0x5C) || // \ (backslash) - ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch))); + ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch))); } function isIdentifierPart(ch) { @@ -312,10 +316,10 @@ (ch >= 0x61 && ch <= 0x7A) || // a..z (ch >= 0x30 && ch <= 0x39) || // 0..9 (ch === 0x5C) || // \ (backslash) - ((ch >= 0x80) && Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch))); + ((ch >= 0x80) && Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch))); } - // 7.6.1.2 Future Reserved Words + // ECMA-262 11.6.2.2 Future Reserved Words function isFutureReservedWord(id) { switch (id) { @@ -329,8 +333,6 @@ } } - // 11.6.2.2 Future Reserved Words - function isStrictModeReservedWord(id) { switch (id) { case 'implements': @@ -352,14 +354,9 @@ return id === 'eval' || id === 'arguments'; } - // 7.6.1.1 Keywords + // ECMA-262 11.6.2.1 Keywords function isKeyword(id) { - - // 'const' is specialized as Keyword in V8. - // 'yield' and 'let' are for compatibility with SpiderMonkey and ES.next. - // Some others are from future reserved words. - switch (id.length) { case 2: return (id === 'if') || (id === 'in') || (id === 'do'); @@ -387,7 +384,7 @@ } } - // 7.4 Comments + // ECMA-262 11.4 Comments function addComment(type, value, start, end, loc) { var comment; @@ -411,6 +408,13 @@ extra.leadingComments.push(comment); extra.trailingComments.push(comment); } + if (extra.tokenize) { + comment.type = comment.type + 'Comment'; + if (extra.delegate) { + comment = extra.delegate(comment); + } + extra.tokens.push(comment); + } } function skipSingleLineComment(offset) { @@ -586,7 +590,7 @@ } function scanUnicodeCodePointEscape() { - var ch, code, cu1, cu2; + var ch, code; ch = source[index]; code = 0; @@ -608,52 +612,75 @@ throwUnexpectedToken(); } - // UTF-16 Encoding - if (code <= 0xFFFF) { - return String.fromCharCode(code); + return fromCodePoint(code); + } + + function codePointAt(i) { + var cp, first, second; + + cp = source.charCodeAt(i); + if (cp >= 0xD800 && cp <= 0xDBFF) { + second = source.charCodeAt(i + 1); + if (second >= 0xDC00 && second <= 0xDFFF) { + first = cp; + cp = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; + } } - cu1 = ((code - 0x10000) >> 10) + 0xD800; - cu2 = ((code - 0x10000) & 1023) + 0xDC00; - return String.fromCharCode(cu1, cu2); + + return cp; } - function getEscapedIdentifier() { - var ch, id; + function getComplexIdentifier() { + var cp, ch, id; - ch = source.charCodeAt(index++); - id = String.fromCharCode(ch); + cp = codePointAt(index); + id = fromCodePoint(cp); + index += id.length; // '\u' (U+005C, U+0075) denotes an escaped character. - if (ch === 0x5C) { + if (cp === 0x5C) { if (source.charCodeAt(index) !== 0x75) { throwUnexpectedToken(); } ++index; - ch = scanHexEscape('u'); - if (!ch || ch === '\\' || !isIdentifierStart(ch.charCodeAt(0))) { - throwUnexpectedToken(); + if (source[index] === '{') { + ++index; + ch = scanUnicodeCodePointEscape(); + } else { + ch = scanHexEscape('u'); + cp = ch.charCodeAt(0); + if (!ch || ch === '\\' || !isIdentifierStart(cp)) { + throwUnexpectedToken(); + } } id = ch; } while (index < length) { - ch = source.charCodeAt(index); - if (!isIdentifierPart(ch)) { + cp = codePointAt(index); + if (!isIdentifierPart(cp)) { break; } - ++index; - id += String.fromCharCode(ch); + ch = fromCodePoint(cp); + id += ch; + index += ch.length; // '\u' (U+005C, U+0075) denotes an escaped character. - if (ch === 0x5C) { + if (cp === 0x5C) { id = id.substr(0, id.length - 1); if (source.charCodeAt(index) !== 0x75) { throwUnexpectedToken(); } ++index; - ch = scanHexEscape('u'); - if (!ch || ch === '\\' || !isIdentifierPart(ch.charCodeAt(0))) { - throwUnexpectedToken(); + if (source[index] === '{') { + ++index; + ch = scanUnicodeCodePointEscape(); + } else { + ch = scanHexEscape('u'); + cp = ch.charCodeAt(0); + if (!ch || ch === '\\' || !isIdentifierPart(cp)) { + throwUnexpectedToken(); + } } id += ch; } @@ -671,7 +698,11 @@ if (ch === 0x5C) { // Blackslash (U+005C) marks Unicode escape sequence. index = start; - return getEscapedIdentifier(); + return getComplexIdentifier(); + } else if (ch >= 0xD800 && ch < 0xDFFF) { + // Need to handle surrogate pairs. + index = start; + return getComplexIdentifier(); } if (isIdentifierPart(ch)) { ++index; @@ -689,7 +720,7 @@ start = index; // Backslash (U+005C) starts an escaped character. - id = (source.charCodeAt(index) === 0x5C) ? getEscapedIdentifier() : getIdentifier(); + id = (source.charCodeAt(index) === 0x5C) ? getComplexIdentifier() : getIdentifier(); // There is no keyword or literal with only one character. // Thus, it must be an identifier. @@ -716,7 +747,7 @@ } - // 7.7 Punctuators + // ECMA-262 11.7 Punctuators function scanPunctuator() { var token, str; @@ -736,14 +767,14 @@ case '(': if (extra.tokenize) { - extra.openParenToken = extra.tokens.length; + extra.openParenToken = extra.tokenValues.length; } ++index; break; case '{': if (extra.tokenize) { - extra.openCurlyToken = extra.tokens.length; + extra.openCurlyToken = extra.tokenValues.length; } state.curlyStack.push('{'); ++index; @@ -816,7 +847,7 @@ return token; } - // 7.8.3 Numeric Literals + // ECMA-262 11.8.3 Numeric Literals function scanHexLiteral(start) { var number = ''; @@ -1020,7 +1051,7 @@ }; } - // 7.8.4 String Literals + // ECMA-262 11.8.4 String Literals function scanStringLiteral() { var str = '', quote, start, ch, unescaped, octToDec, octal = false; @@ -1075,7 +1106,9 @@ break; case '8': case '9': - throw throwUnexpectedToken(); + str += ch; + tolerateUnexpectedToken(); + break; default: if (isOctalDigit(ch)) { @@ -1103,6 +1136,7 @@ } if (quote !== '') { + index = start; throwUnexpectedToken(); } @@ -1117,6 +1151,8 @@ }; } + // ECMA-262 11.8.6 Template Literal Lexical Components + function scanTemplate() { var cooked = '', ch, start, rawOffset, terminated, head, tail, restore, unescaped; @@ -1239,29 +1275,40 @@ }; } + // ECMA-262 11.8.5 Regular Expression Literals + function testRegExp(pattern, flags) { - var tmp = pattern; + // The BMP character to use as a replacement for astral symbols when + // translating an ES6 "u"-flagged pattern to an ES5-compatible + // approximation. + // Note: replacing with '\uFFFF' enables false positives in unlikely + // scenarios. For example, `[\u{1044f}-\u{10440}]` is an invalid + // pattern that would not be detected by this substitution. + var astralSubstitute = '\uFFFF', + tmp = pattern; if (flags.indexOf('u') >= 0) { - // Replace each astral symbol and every Unicode escape sequence - // that possibly represents an astral symbol or a paired surrogate - // with a single ASCII symbol to avoid throwing on regular - // expressions that are only valid in combination with the `/u` - // flag. - // Note: replacing with the ASCII symbol `x` might cause false - // negatives in unlikely scenarios. For example, `[\u{61}-b]` is a - // perfectly valid pattern that is equivalent to `[a-b]`, but it - // would be replaced by `[x-b]` which throws an error. tmp = tmp - .replace(/\\u\{([0-9a-fA-F]+)\}/g, function ($0, $1) { - if (parseInt($1, 16) <= 0x10FFFF) { - return 'x'; + // Replace every Unicode escape sequence with the equivalent + // BMP character or a constant ASCII code point in the case of + // astral symbols. (See the above note on `astralSubstitute` + // for more information.) + .replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g, function ($0, $1, $2) { + var codePoint = parseInt($1 || $2, 16); + if (codePoint > 0x10FFFF) { + throwUnexpectedToken(null, Messages.InvalidRegExp); + } + if (codePoint <= 0xFFFF) { + return String.fromCharCode(codePoint); } - throwUnexpectedToken(null, Messages.InvalidRegExp); + return astralSubstitute; }) + // Replace each paired surrogate with a single ASCII symbol to + // avoid throwing on regular expressions that are only valid in + // combination with the "u" flag. .replace( - /\\u([a-fA-F0-9]{4})|[\uD800-\uDBFF][\uDC00-\uDFFF]/g, - 'x' + /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, + astralSubstitute ); } @@ -1375,8 +1422,8 @@ } function scanRegExp() { - scanning = true; var start, body, flags, value; + scanning = true; lookahead = null; skipComment(); @@ -1464,71 +1511,50 @@ token.type === Token.NullLiteral; } + // Using the following algorithm: + // https://github.com/mozilla/sweet.js/wiki/design + function advanceSlash() { - var prevToken, - checkToken; - // Using the following algorithm: - // https://github.com/mozilla/sweet.js/wiki/design - prevToken = extra.tokens[extra.tokens.length - 1]; - if (!prevToken) { - // Nothing before that: it cannot be a division. - return collectRegex(); - } - if (prevToken.type === 'Punctuator') { - if (prevToken.value === ']') { - return scanPunctuator(); - } - if (prevToken.value === ')') { - checkToken = extra.tokens[extra.openParenToken - 1]; - if (checkToken && - checkToken.type === 'Keyword' && - (checkToken.value === 'if' || - checkToken.value === 'while' || - checkToken.value === 'for' || - checkToken.value === 'with')) { - return collectRegex(); - } - return scanPunctuator(); - } - if (prevToken.value === '}') { - // Dividing a function by anything makes little sense, - // but we have to check for that. - if (extra.tokens[extra.openCurlyToken - 3] && - extra.tokens[extra.openCurlyToken - 3].type === 'Keyword') { - // Anonymous function. - checkToken = extra.tokens[extra.openCurlyToken - 4]; - if (!checkToken) { - return scanPunctuator(); - } - } else if (extra.tokens[extra.openCurlyToken - 4] && - extra.tokens[extra.openCurlyToken - 4].type === 'Keyword') { - // Named function. - checkToken = extra.tokens[extra.openCurlyToken - 5]; - if (!checkToken) { - return collectRegex(); - } - } else { - return scanPunctuator(); - } - // checkToken determines whether the function is - // a declaration or an expression. - if (FnExprTokens.indexOf(checkToken.value) >= 0) { - // It is an expression. - return scanPunctuator(); - } - // It is a declaration. - return collectRegex(); - } - return collectRegex(); + var regex, previous, check; + + function testKeyword(value) { + return value && (value.length > 1) && (value[0] >= 'a') && (value[0] <= 'z'); } - if (prevToken.type === 'Keyword' && prevToken.value !== 'this') { - return collectRegex(); + + previous = extra.tokenValues[extra.tokens.length - 1]; + regex = (previous !== null); + + switch (previous) { + case 'this': + case ']': + regex = false; + break; + + case ')': + check = extra.tokenValues[extra.openParenToken - 1]; + regex = (check === 'if' || check === 'while' || check === 'for' || check === 'with'); + break; + + case '}': + // Dividing a function by anything makes little sense, + // but we have to check for that. + regex = false; + if (testKeyword(extra.tokenValues[extra.openCurlyToken - 3])) { + // Anonymous function, e.g. function(){} /42 + check = extra.tokenValues[extra.openCurlyToken - 4]; + regex = check ? (FnExprTokens.indexOf(check) < 0) : false; + } else if (testKeyword(extra.tokenValues[extra.openCurlyToken - 4])) { + // Named function, e.g. function f(){} /42/ + check = extra.tokenValues[extra.openCurlyToken - 5]; + regex = check ? (FnExprTokens.indexOf(check) < 0) : true; + } } - return scanPunctuator(); + + return regex ? collectRegex() : scanPunctuator(); } function advance() { - var ch, token; + var cp, token; if (index >= length) { return { @@ -1540,9 +1566,9 @@ }; } - ch = source.charCodeAt(index); + cp = source.charCodeAt(index); - if (isIdentifierStart(ch)) { + if (isIdentifierStart(cp)) { token = scanIdentifier(); if (strict && isStrictModeReservedWord(token.value)) { token.type = Token.Keyword; @@ -1551,39 +1577,47 @@ } // Very common: ( and ) and ; - if (ch === 0x28 || ch === 0x29 || ch === 0x3B) { + if (cp === 0x28 || cp === 0x29 || cp === 0x3B) { return scanPunctuator(); } // String literal starts with single quote (U+0027) or double quote (U+0022). - if (ch === 0x27 || ch === 0x22) { + if (cp === 0x27 || cp === 0x22) { return scanStringLiteral(); } // Dot (.) U+002E can also start a floating-point number, hence the need // to check the next character. - if (ch === 0x2E) { + if (cp === 0x2E) { if (isDecimalDigit(source.charCodeAt(index + 1))) { return scanNumericLiteral(); } return scanPunctuator(); } - if (isDecimalDigit(ch)) { + if (isDecimalDigit(cp)) { return scanNumericLiteral(); } // Slash (/) U+002F can also start a regex. - if (extra.tokenize && ch === 0x2F) { + if (extra.tokenize && cp === 0x2F) { return advanceSlash(); } // Template literals start with ` (U+0060) for template head // or } (U+007D) for template middle or template tail. - if (ch === 0x60 || (ch === 0x7D && state.curlyStack[state.curlyStack.length - 1] === '${')) { + if (cp === 0x60 || (cp === 0x7D && state.curlyStack[state.curlyStack.length - 1] === '${')) { return scanTemplate(); } + // Possible identifier start in a surrogate pair. + if (cp >= 0xD800 && cp < 0xDFFF) { + cp = codePointAt(index); + if (isIdentifierStart(cp)) { + return scanIdentifier(); + } + } + return scanPunctuator(); } @@ -1617,6 +1651,20 @@ flags: token.regex.flags }; } + if (extra.tokenValues) { + extra.tokenValues.push((entry.type === 'Punctuator' || entry.type === 'Keyword') ? entry.value : null); + } + if (extra.tokenize) { + if (!extra.range) { + delete entry.range; + } + if (!extra.loc) { + delete entry.loc; + } + if (extra.delegate) { + entry = extra.delegate(entry); + } + } extra.tokens.push(entry); } @@ -1701,6 +1749,7 @@ processComment: function () { var lastChild, + innerComments, leadingComments, trailingComments, bottomRight = extra.bottomRightStack, @@ -1713,6 +1762,27 @@ return; } } + /** + * patch innnerComments for properties empty block + * `function a() {/** comments **\/}` + */ + + if (this.type === Syntax.BlockStatement && this.body.length === 0) { + innerComments = []; + for (i = extra.leadingComments.length - 1; i >= 0; --i) { + comment = extra.leadingComments[i]; + if (this.range[1] >= comment.range[1]) { + innerComments.unshift(comment); + extra.leadingComments.splice(i, 1); + extra.trailingComments.splice(i, 1); + } + } + if (innerComments.length) { + this.innerComments = innerComments; + //bottomRight.push(this); + return; + } + } if (extra.trailingComments.length > 0) { trailingComments = []; @@ -1732,17 +1802,25 @@ } // Eating the stack. - if (last) { - while (last && last.range[0] >= this.range[0]) { - lastChild = last; - last = bottomRight.pop(); - } + while (last && last.range[0] >= this.range[0]) { + lastChild = bottomRight.pop(); + last = bottomRight[bottomRight.length - 1]; } if (lastChild) { - if (lastChild.leadingComments && lastChild.leadingComments[lastChild.leadingComments.length - 1].range[1] <= this.range[0]) { - this.leadingComments = lastChild.leadingComments; - lastChild.leadingComments = undefined; + if (lastChild.leadingComments) { + leadingComments = []; + for (i = lastChild.leadingComments.length - 1; i >= 0; --i) { + comment = lastChild.leadingComments[i]; + if (comment.range[1] <= this.range[0]) { + leadingComments.unshift(comment); + lastChild.leadingComments.splice(i, 1); + } + } + + if (!lastChild.leadingComments.length) { + lastChild.leadingComments = undefined; + } } } else if (extra.leadingComments.length > 0) { leadingComments = []; @@ -1945,6 +2023,15 @@ return this; }, + finishForOfStatement: function (left, right, body) { + this.type = Syntax.ForOfStatement; + this.left = left; + this.right = right; + this.body = body; + this.finish(); + return this; + }, + finishForInStatement: function (left, right, body) { this.type = Syntax.ForInStatement; this.left = left; @@ -1955,25 +2042,25 @@ return this; }, - finishFunctionDeclaration: function (id, params, defaults, body) { + finishFunctionDeclaration: function (id, params, defaults, body, generator) { this.type = Syntax.FunctionDeclaration; this.id = id; this.params = params; this.defaults = defaults; this.body = body; - this.generator = false; + this.generator = generator; this.expression = false; this.finish(); return this; }, - finishFunctionExpression: function (id, params, defaults, body) { + finishFunctionExpression: function (id, params, defaults, body, generator) { this.type = Syntax.FunctionExpression; this.id = id; this.params = params; this.defaults = defaults; this.body = body; - this.generator = false; + this.generator = generator; this.expression = false; this.finish(); return this; @@ -2023,6 +2110,14 @@ return this; }, + finishMetaProperty: function (meta, property) { + this.type = Syntax.MetaProperty; + this.meta = meta; + this.property = property; + this.finish(); + return this; + }, + finishNewExpression: function (callee, args) { this.type = Syntax.NewExpression; this.callee = callee; @@ -2054,13 +2149,10 @@ return this; }, - finishProgram: function (body) { + finishProgram: function (body, sourceType) { this.type = Syntax.Program; this.body = body; - if (sourceType === 'module') { - // very restrictive for now - this.sourceType = sourceType; - } + this.sourceType = sourceType; this.finish(); return this; }, @@ -2168,7 +2260,7 @@ this.type = Syntax.TryStatement; this.block = block; this.guardedHandlers = []; - this.handlers = handler ? [ handler ] : []; + this.handlers = handler ? [handler] : []; this.handler = handler; this.finalizer = finalizer; this.finish(); @@ -2283,6 +2375,14 @@ this.source = src; this.finish(); return this; + }, + + finishYieldExpression: function (argument, delegate) { + this.type = Syntax.YieldExpression; + this.argument = argument; + this.delegate = delegate; + this.finish(); + return this; } }; @@ -2302,12 +2402,30 @@ extra.errors.push(error); } + function constructError(msg, column) { + var error = new Error(msg); + try { + throw error; + } catch (base) { + /* istanbul ignore else */ + if (Object.create && Object.defineProperty) { + error = Object.create(base); + Object.defineProperty(error, 'column', { value: column }); + } + } finally { + return error; + } + } + function createError(line, pos, description) { - var error = new Error('Line ' + line + ': ' + description); - error.index = pos; + var msg, column, error; + + msg = 'Line ' + line + ': ' + description; + column = pos - (scanning ? lineStart : lastLineStart) + 1; + error = constructError(msg, column); error.lineNumber = line; - error.column = pos - (scanning ? lineStart : lastLineStart) + 1; error.description = description; + error.index = pos; return error; } @@ -2566,7 +2684,9 @@ return result; } - function parseArrayPattern() { + // ECMA-262 13.3.3 Destructuring Binding Patterns + + function parseArrayPattern(params, kind) { var node = new Node(), elements = [], rest, restNode; expect('['); @@ -2578,11 +2698,12 @@ if (match('...')) { restNode = new Node(); lex(); - rest = parseVariableIdentifier(); + params.push(lookahead); + rest = parseVariableIdentifier(kind); elements.push(restNode.finishRestElement(rest)); break; } else { - elements.push(parsePatternWithDefault()); + elements.push(parsePatternWithDefault(params, kind)); } if (!match(']')) { expect(','); @@ -2596,34 +2717,38 @@ return node.finishArrayPattern(elements); } - function parsePropertyPattern() { - var node = new Node(), key, computed = match('['), init; + function parsePropertyPattern(params, kind) { + var node = new Node(), key, keyToken, computed = match('['), init; if (lookahead.type === Token.Identifier) { + keyToken = lookahead; key = parseVariableIdentifier(); if (match('=')) { + params.push(keyToken); lex(); init = parseAssignmentExpression(); + return node.finishProperty( 'init', key, false, - new WrappingNode(key).finishAssignmentPattern(key, init), false, false); + new WrappingNode(keyToken).finishAssignmentPattern(key, init), false, true); } else if (!match(':')) { + params.push(keyToken); return node.finishProperty('init', key, false, key, false, true); } } else { key = parseObjectPropertyKey(); } expect(':'); - init = parsePatternWithDefault(); + init = parsePatternWithDefault(params, kind); return node.finishProperty('init', key, computed, init, false, false); } - function parseObjectPattern() { + function parseObjectPattern(params, kind) { var node = new Node(), properties = []; expect('{'); while (!match('}')) { - properties.push(parsePropertyPattern()); + properties.push(parsePropertyPattern(params, kind)); if (!match('}')) { expect(','); } @@ -2634,31 +2759,38 @@ return node.finishObjectPattern(properties); } - function parsePattern() { - if (lookahead.type === Token.Identifier) { - return parseVariableIdentifier(); - } else if (match('[')) { - return parseArrayPattern(); + function parsePattern(params, kind) { + if (match('[')) { + return parseArrayPattern(params, kind); } else if (match('{')) { - return parseObjectPattern(); + return parseObjectPattern(params, kind); + } else if (matchKeyword('let')) { + if (kind === 'const' || kind === 'let') { + tolerateUnexpectedToken(lookahead, Messages.UnexpectedToken); + } } - throwUnexpectedToken(lookahead); + + params.push(lookahead); + return parseVariableIdentifier(kind); } - function parsePatternWithDefault() { - var startToken = lookahead, pattern, right; - pattern = parsePattern(); + function parsePatternWithDefault(params, kind) { + var startToken = lookahead, pattern, previousAllowYield, right; + pattern = parsePattern(params, kind); if (match('=')) { lex(); + previousAllowYield = state.allowYield; + state.allowYield = true; right = isolateCoverGrammar(parseAssignmentExpression); + state.allowYield = previousAllowYield; pattern = new WrappingNode(startToken).finishAssignmentPattern(pattern, right); } return pattern; } - // 11.1.4 Array Initialiser + // ECMA-262 12.2.5 Array Initializer - function parseArrayInitialiser() { + function parseArrayInitializer() { var elements = [], node = new Node(), restSpread; expect('['); @@ -2691,9 +2823,9 @@ return node.finishArrayExpression(elements); } - // 11.1.5 Object Initialiser + // ECMA-262 12.2.6 Object Initializer - function parsePropertyFunction(node, paramInfo) { + function parsePropertyFunction(node, paramInfo, isGenerator) { var previousStrict, body; isAssignmentTarget = isBindingElement = false; @@ -2709,14 +2841,20 @@ } strict = previousStrict; - return node.finishFunctionExpression(null, paramInfo.params, paramInfo.defaults, body); + return node.finishFunctionExpression(null, paramInfo.params, paramInfo.defaults, body, isGenerator); } function parsePropertyMethodFunction() { - var params, method, node = new Node(); + var params, method, node = new Node(), + previousAllowYield = state.allowYield; + state.allowYield = false; params = parseParams(); - method = parsePropertyFunction(node, params); + state.allowYield = previousAllowYield; + + state.allowYield = false; + method = parsePropertyFunction(node, params, false); + state.allowYield = previousAllowYield; return method; } @@ -2774,7 +2912,8 @@ // In order to avoid back tracking, it returns `null` if the position is not a MethodDefinition and the caller // is responsible to visit other options. function tryParseMethodDefinition(token, key, computed, node) { - var value, options, methodNode; + var value, options, methodNode, params, + previousAllowYield = state.allowYield; if (token.type === Token.Identifier) { // check for `get` and `set`; @@ -2785,13 +2924,17 @@ methodNode = new Node(); expect('('); expect(')'); + + state.allowYield = false; value = parsePropertyFunction(methodNode, { params: [], defaults: [], stricted: null, firstRestricted: null, message: null - }); + }, false); + state.allowYield = previousAllowYield; + return node.finishProperty('get', key, computed, value, false, false); } else if (token.value === 'set' && lookaheadPropertyName()) { computed = match('['); @@ -2809,19 +2952,38 @@ if (match(')')) { tolerateUnexpectedToken(lookahead); } else { + state.allowYield = false; parseParam(options); + state.allowYield = previousAllowYield; if (options.defaultCount === 0) { options.defaults = []; } } expect(')'); - value = parsePropertyFunction(methodNode, options); + state.allowYield = false; + value = parsePropertyFunction(methodNode, options, false); + state.allowYield = previousAllowYield; + return node.finishProperty('set', key, computed, value, false, false); } + } else if (token.type === Token.Punctuator && token.value === '*' && lookaheadPropertyName()) { + computed = match('['); + key = parseObjectPropertyKey(); + methodNode = new Node(); + + state.allowYield = true; + params = parseParams(); + state.allowYield = previousAllowYield; + + state.allowYield = false; + value = parsePropertyFunction(methodNode, params, true); + state.allowYield = previousAllowYield; + + return node.finishProperty('init', key, computed, value, true, false); } - if (match('(')) { + if (key && match('(')) { value = parsePropertyMethodFunction(); return node.finishProperty('init', key, computed, value, true, false); } @@ -2830,32 +2992,33 @@ return null; } - function checkProto(key, computed, hasProto) { - if (computed === false && (key.type === Syntax.Identifier && key.name === '__proto__' || - key.type === Syntax.Literal && key.value === '__proto__')) { - if (hasProto.value) { - tolerateError(Messages.DuplicateProtoProperty); - } else { - hasProto.value = true; - } - } - } - function parseObjectProperty(hasProto) { - var token = lookahead, node = new Node(), computed, key, maybeMethod, value; + var token = lookahead, node = new Node(), computed, key, maybeMethod, proto, value; computed = match('['); - key = parseObjectPropertyKey(); + if (match('*')) { + lex(); + } else { + key = parseObjectPropertyKey(); + } maybeMethod = tryParseMethodDefinition(token, key, computed, node); - if (maybeMethod) { - checkProto(maybeMethod.key, maybeMethod.computed, hasProto); - // finished return maybeMethod; } - // init property or short hand property. - checkProto(key, computed, hasProto); + if (!key) { + throwUnexpectedToken(lookahead); + } + + // Check for duplicated __proto__ + if (!computed) { + proto = (key.type === Syntax.Identifier && key.name === '__proto__') || + (key.type === Syntax.Literal && key.value === '__proto__'); + if (hasProto.value && proto) { + tolerateError(Messages.DuplicateProtoProperty); + } + hasProto.value |= proto; + } if (match(':')) { lex(); @@ -2877,7 +3040,7 @@ throwUnexpectedToken(lookahead); } - function parseObjectInitialiser() { + function parseObjectInitializer() { var properties = [], hasProto = {value: false}, node = new Node(); expect('{'); @@ -2931,6 +3094,8 @@ } } + // ECMA-262 12.2.9 Template Literals + function parseTemplateElement(option) { var node, token; @@ -2948,7 +3113,7 @@ var quasi, quasis, expressions, node = new Node(); quasi = parseTemplateElement({ head: true }); - quasis = [ quasi ]; + quasis = [quasi]; expressions = []; while (!quasi.tail) { @@ -2960,10 +3125,10 @@ return node.finishTemplateLiteral(quasis, expressions); } - // 11.1.6 The Grouping Operator + // ECMA-262 12.2.10 The Grouping Operator function parseGroupExpression() { - var expr, expressions, startToken, i; + var expr, expressions, startToken, i, params = []; expect('('); @@ -2974,13 +3139,14 @@ } return { type: PlaceHolders.ArrowParameterPlaceHolder, - params: [] + params: [], + rawParams: [] }; } startToken = lookahead; if (match('...')) { - expr = parseRestElement(); + expr = parseRestElement(params); expect(')'); if (!match('=>')) { expect('=>'); @@ -3008,7 +3174,7 @@ if (!isBindingElement) { throwUnexpectedToken(lookahead); } - expressions.push(parseRestElement()); + expressions.push(parseRestElement(params)); expect(')'); if (!match('=>')) { expect('=>'); @@ -3033,6 +3199,13 @@ expect(')'); if (match('=>')) { + if (expr.type === Syntax.Identifier && expr.name === 'yield') { + return { + type: PlaceHolders.ArrowParameterPlaceHolder, + params: [expr] + }; + } + if (!isBindingElement) { throwUnexpectedToken(lookahead); } @@ -3055,7 +3228,7 @@ } - // 11.1 Primary Expressions + // ECMA-262 12.2 Primary Expressions function parsePrimaryExpression() { var type, token, expr, node; @@ -3066,17 +3239,20 @@ } if (match('[')) { - return inheritCoverGrammar(parseArrayInitialiser); + return inheritCoverGrammar(parseArrayInitializer); } if (match('{')) { - return inheritCoverGrammar(parseObjectInitialiser); + return inheritCoverGrammar(parseObjectInitializer); } type = lookahead.type; node = new Node(); if (type === Token.Identifier) { + if (state.sourceType === 'module' && lookahead.value === 'await') { + tolerateUnexpectedToken(lookahead); + } expr = node.finishIdentifier(lex().value); } else if (type === Token.StringLiteral || type === Token.NumericLiteral) { isAssignmentTarget = isBindingElement = false; @@ -3085,6 +3261,12 @@ } expr = node.finishLiteral(lex()); } else if (type === Token.Keyword) { + if (!strict && state.allowYield && matchKeyword('yield')) { + return parseNonComputedProperty(); + } + if (!strict && matchKeyword('let')) { + return node.finishIdentifier(lex().value); + } isAssignmentTarget = isBindingElement = false; if (matchKeyword('function')) { return parseFunctionExpression(); @@ -3127,16 +3309,23 @@ return expr; } - // 11.2 Left-Hand-Side Expressions + // ECMA-262 12.3 Left-Hand-Side Expressions function parseArguments() { - var args = []; + var args = [], expr; expect('('); if (!match(')')) { while (startIndex < length) { - args.push(isolateCoverGrammar(parseAssignmentExpression)); + if (match('...')) { + expr = new Node(); + lex(); + expr.finishSpreadElement(isolateCoverGrammar(parseAssignmentExpression)); + } else { + expr = isolateCoverGrammar(parseAssignmentExpression); + } + args.push(expr); if (match(')')) { break; } @@ -3179,10 +3368,24 @@ return expr; } + // ECMA-262 12.3.3 The new Operator + function parseNewExpression() { var callee, args, node = new Node(); expectKeyword('new'); + + if (match('.')) { + lex(); + if (lookahead.type === Token.Identifier && lookahead.value === 'target') { + if (state.inFunctionBody) { + lex(); + return node.finishMetaProperty('new', 'target'); + } + } + throwUnexpectedToken(lookahead); + } + callee = isolateCoverGrammar(parseLeftHandSideExpression); args = match('(') ? parseArguments() : []; @@ -3191,6 +3394,8 @@ return node.finishNewExpression(callee, args); } + // ECMA-262 12.3.4 Function Calls + function parseLeftHandSideExpressionAllowCall() { var quasi, expr, args, property, startToken, previousAllowIn = state.allowIn; @@ -3236,6 +3441,8 @@ return expr; } + // ECMA-262 12.3 Left-Hand-Side Expressions + function parseLeftHandSideExpression() { var quasi, expr, property, startToken; assert(state.allowIn, 'callee of new expression always allow in keyword.'); @@ -3274,7 +3481,7 @@ return expr; } - // 11.3 Postfix Expressions + // ECMA-262 12.4 Postfix Expressions function parsePostfixExpression() { var expr, token, startToken = lookahead; @@ -3283,7 +3490,7 @@ if (!hasLineTerminator && lookahead.type === Token.Punctuator) { if (match('++') || match('--')) { - // 11.3.1, 11.3.2 + // ECMA-262 11.3.1, 11.3.2 if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { tolerateError(Messages.StrictLHSPostfix); } @@ -3302,7 +3509,7 @@ return expr; } - // 11.4 Unary Operators + // ECMA-262 12.5 Unary Operators function parseUnaryExpression() { var token, expr, startToken; @@ -3313,7 +3520,7 @@ startToken = lookahead; token = lex(); expr = inheritCoverGrammar(parseUnaryExpression); - // 11.4.4, 11.4.5 + // ECMA-262 11.4.4, 11.4.5 if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { tolerateError(Messages.StrictLHSPrefix); } @@ -3416,13 +3623,13 @@ return prec; } - // 11.5 Multiplicative Operators - // 11.6 Additive Operators - // 11.7 Bitwise Shift Operators - // 11.8 Relational Operators - // 11.9 Equality Operators - // 11.10 Binary Bitwise Operators - // 11.11 Binary Logical Operators + // ECMA-262 12.6 Multiplicative Operators + // ECMA-262 12.7 Additive Operators + // ECMA-262 12.8 Bitwise Shift Operators + // ECMA-262 12.9 Relational Operators + // ECMA-262 12.10 Equality Operators + // ECMA-262 12.11 Binary Bitwise Operators + // ECMA-262 12.12 Binary Logical Operators function parseBinaryExpression() { var marker, markers, expr, token, prec, stack, right, operator, left, i; @@ -3478,7 +3685,7 @@ } - // 11.12 Conditional Operator + // ECMA-262 12.13 Conditional Operator function parseConditionalExpression() { var expr, previousAllowIn, consequent, alternate, startToken; @@ -3502,7 +3709,7 @@ return expr; } - // [ES6] 14.2 Arrow Function + // ECMA-262 14.2 Arrow Function Definitions function parseConciseBody() { if (match('{')) { @@ -3530,6 +3737,8 @@ } } break; + case Syntax.YieldExpression: + break; default: assert(param.type === Syntax.ObjectPattern, 'Invalid type'); for (i = 0; i < param.properties.length; i++) { @@ -3564,6 +3773,15 @@ switch (param.type) { case Syntax.AssignmentPattern: params[i] = param.left; + if (param.right.type === Syntax.YieldExpression) { + if (param.right.argument) { + throwUnexpectedToken(lookahead); + } + param.right.type = Syntax.Identifier; + param.right.name = 'yield'; + delete param.right.argument; + delete param.right.delegate; + } defaults.push(param.right); ++defaultCount; checkPatternParam(options, param.left); @@ -3576,6 +3794,15 @@ } } + if (strict || !state.allowYield) { + for (i = 0, len = params.length; i < len; i += 1) { + param = params[i]; + if (param.type === Syntax.YieldExpression) { + throwUnexpectedToken(lookahead); + } + } + } + if (options.message === Messages.StrictParamDupe) { token = strict ? options.stricted : options.firstRestricted; throwUnexpectedToken(token, options.message); @@ -3595,13 +3822,16 @@ } function parseArrowFunctionExpression(options, node) { - var previousStrict, body; + var previousStrict, previousAllowYield, body; if (hasLineTerminator) { tolerateUnexpectedToken(lookahead); } expect('=>'); + previousStrict = strict; + previousAllowYield = state.allowYield; + state.allowYield = true; body = parseConciseBody(); @@ -3613,11 +3843,41 @@ } strict = previousStrict; + state.allowYield = previousAllowYield; return node.finishArrowFunctionExpression(options.params, options.defaults, body, body.type !== Syntax.BlockStatement); } - // 11.13 Assignment Operators + // ECMA-262 14.4 Yield expression + + function parseYieldExpression() { + var argument, expr, delegate, previousAllowYield; + + argument = null; + expr = new Node(); + delegate = false; + + expectKeyword('yield'); + + if (!hasLineTerminator) { + previousAllowYield = state.allowYield; + state.allowYield = false; + delegate = match('*'); + if (delegate) { + lex(); + argument = parseAssignmentExpression(); + } else { + if (!match(';') && !match('}') && !match(')') && lookahead.type !== Token.EOF) { + argument = parseAssignmentExpression(); + } + } + state.allowYield = previousAllowYield; + } + + return expr.finishYieldExpression(argument, delegate); + } + + // ECMA-262 12.14 Assignment Operators function parseAssignmentExpression() { var token, expr, right, list, startToken; @@ -3625,6 +3885,10 @@ startToken = lookahead; token = lookahead; + if (!state.allowYield && matchKeyword('yield')) { + return parseYieldExpression(); + } + expr = parseConditionalExpression(); if (expr.type === PlaceHolders.ArrowParameterPlaceHolder || match('=>')) { @@ -3644,9 +3908,14 @@ tolerateError(Messages.InvalidLHSInAssignment); } - // 11.13.1 - if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { - tolerateUnexpectedToken(token, Messages.StrictLHSAssignment); + // ECMA-262 12.1.1 + if (strict && expr.type === Syntax.Identifier) { + if (isRestrictedWord(expr.name)) { + tolerateUnexpectedToken(token, Messages.StrictLHSAssignment); + } + if (isStrictModeReservedWord(expr.name)) { + tolerateUnexpectedToken(token, Messages.StrictReservedWord); + } } if (!match('=')) { @@ -3664,7 +3933,7 @@ return expr; } - // 11.14 Comma Operator + // ECMA-262 12.15 Comma Operator function parseExpression() { var expr, startToken = lookahead, expressions; @@ -3688,23 +3957,22 @@ return expr; } - // 12.1 Block + // ECMA-262 13.2 Block function parseStatementListItem() { if (lookahead.type === Token.Keyword) { switch (lookahead.value) { case 'export': - if (sourceType !== 'module') { + if (state.sourceType !== 'module') { tolerateUnexpectedToken(lookahead, Messages.IllegalExportDeclaration); } return parseExportDeclaration(); case 'import': - if (sourceType !== 'module') { + if (state.sourceType !== 'module') { tolerateUnexpectedToken(lookahead, Messages.IllegalImportDeclaration); } return parseImportDeclaration(); case 'const': - case 'let': return parseLexicalDeclaration({inFor: false}); case 'function': return parseFunctionDeclaration(new Node()); @@ -3713,6 +3981,10 @@ } } + if (matchKeyword('let') && isLexicalDeclaration()) { + return parseLexicalDeclaration({inFor: false}); + } + return parseStatement(); } @@ -3740,30 +4012,40 @@ return node.finishBlockStatement(block); } - // 12.2 Variable Statement + // ECMA-262 13.3.2 Variable Statement - function parseVariableIdentifier() { + function parseVariableIdentifier(kind) { var token, node = new Node(); token = lex(); - if (token.type !== Token.Identifier) { + if (token.type === Token.Keyword && token.value === 'yield') { + if (strict) { + tolerateUnexpectedToken(token, Messages.StrictReservedWord); + } if (!state.allowYield) { + throwUnexpectedToken(token); + } + } else if (token.type !== Token.Identifier) { if (strict && token.type === Token.Keyword && isStrictModeReservedWord(token.value)) { tolerateUnexpectedToken(token, Messages.StrictReservedWord); } else { - throwUnexpectedToken(token); + if (strict || token.value !== 'let' || kind !== 'var') { + throwUnexpectedToken(token); + } } + } else if (state.sourceType === 'module' && token.type === Token.Identifier && token.value === 'await') { + tolerateUnexpectedToken(token); } return node.finishIdentifier(token.value); } - function parseVariableDeclaration() { - var init = null, id, node = new Node(); + function parseVariableDeclaration(options) { + var init = null, id, node = new Node(), params = []; - id = parsePattern(); + id = parsePattern(params, 'var'); - // 12.2.1 + // ECMA-262 12.2.1 if (strict && isRestrictedWord(id.name)) { tolerateError(Messages.StrictVarName); } @@ -3771,23 +4053,23 @@ if (match('=')) { lex(); init = isolateCoverGrammar(parseAssignmentExpression); - } else if (id.type !== Syntax.Identifier) { + } else if (id.type !== Syntax.Identifier && !options.inFor) { expect('='); } return node.finishVariableDeclarator(id, init); } - function parseVariableDeclarationList() { - var list = []; + function parseVariableDeclarationList(options) { + var opt, list; - do { - list.push(parseVariableDeclaration()); - if (!match(',')) { - break; - } + opt = { inFor: options.inFor }; + list = [parseVariableDeclaration(opt)]; + + while (match(',')) { lex(); - } while (startIndex < length); + list.push(parseVariableDeclaration(opt)); + } return list; } @@ -3797,25 +4079,27 @@ expectKeyword('var'); - declarations = parseVariableDeclarationList(); + declarations = parseVariableDeclarationList({ inFor: false }); consumeSemicolon(); return node.finishVariableDeclaration(declarations); } + // ECMA-262 13.3.1 Let and Const Declarations + function parseLexicalBinding(kind, options) { - var init = null, id, node = new Node(); + var init = null, id, node = new Node(), params = []; - id = parsePattern(); + id = parsePattern(params, kind); - // 12.2.1 + // ECMA-262 12.2.1 if (strict && id.type === Syntax.Identifier && isRestrictedWord(id.name)) { tolerateError(Messages.StrictVarName); } if (kind === 'const') { - if (!matchKeyword('in')) { + if (!matchKeyword('in') && !matchContextualKeyword('of')) { expect('='); init = isolateCoverGrammar(parseAssignmentExpression); } @@ -3828,19 +4112,65 @@ } function parseBindingList(kind, options) { - var list = []; + var list = [parseLexicalBinding(kind, options)]; - do { - list.push(parseLexicalBinding(kind, options)); - if (!match(',')) { - break; - } + while (match(',')) { lex(); - } while (startIndex < length); + list.push(parseLexicalBinding(kind, options)); + } return list; } + + function tokenizerState() { + return { + index: index, + lineNumber: lineNumber, + lineStart: lineStart, + hasLineTerminator: hasLineTerminator, + lastIndex: lastIndex, + lastLineNumber: lastLineNumber, + lastLineStart: lastLineStart, + startIndex: startIndex, + startLineNumber: startLineNumber, + startLineStart: startLineStart, + lookahead: lookahead, + tokenCount: extra.tokens ? extra.tokens.length : 0 + }; + } + + function resetTokenizerState(ts) { + index = ts.index; + lineNumber = ts.lineNumber; + lineStart = ts.lineStart; + hasLineTerminator = ts.hasLineTerminator; + lastIndex = ts.lastIndex; + lastLineNumber = ts.lastLineNumber; + lastLineStart = ts.lastLineStart; + startIndex = ts.startIndex; + startLineNumber = ts.startLineNumber; + startLineStart = ts.startLineStart; + lookahead = ts.lookahead; + if (extra.tokens) { + extra.tokens.splice(ts.tokenCount, extra.tokens.length); + } + } + + function isLexicalDeclaration() { + var lexical, ts; + + ts = tokenizerState(); + + lex(); + lexical = (lookahead.type === Token.Identifier) || match('[') || match('{') || + matchKeyword('let') || matchKeyword('yield'); + + resetTokenizerState(ts); + + return lexical; + } + function parseLexicalDeclaration(options) { var kind, declarations, node = new Node(); @@ -3854,7 +4184,7 @@ return node.finishLexicalDeclaration(declarations, kind); } - function parseRestElement() { + function parseRestElement(params) { var param, node = new Node(); lex(); @@ -3863,6 +4193,8 @@ throwError(Messages.ObjectPatternAsRestParameter); } + params.push(lookahead); + param = parseVariableIdentifier(); if (match('=')) { @@ -3876,14 +4208,14 @@ return node.finishRestElement(param); } - // 12.3 Empty Statement + // ECMA-262 13.4 Empty Statement function parseEmptyStatement(node) { expect(';'); return node.finishEmptyStatement(); } - // 12.4 Expression Statement + // ECMA-262 12.4 Expression Statement function parseExpressionStatement(node) { var expr = parseExpression(); @@ -3891,7 +4223,7 @@ return node.finishExpressionStatement(expr); } - // 12.5 If statement + // ECMA-262 13.6 If statement function parseIfStatement(node) { var test, consequent, alternate; @@ -3916,7 +4248,7 @@ return node.finishIfStatement(test, consequent, alternate); } - // 12.6 Iteration Statements + // ECMA-262 13.7 Iteration Statements function parseDoWhileStatement(node) { var body, test, oldInIteration; @@ -3967,10 +4299,11 @@ } function parseForStatement(node) { - var init, initSeq, initStartToken, test, update, left, right, kind, declarations, + var init, forIn, initSeq, initStartToken, test, update, left, right, kind, declarations, body, oldInIteration, previousAllowIn = state.allowIn; init = test = update = null; + forIn = true; expectKeyword('for'); @@ -3984,34 +4317,58 @@ lex(); state.allowIn = false; - init = init.finishVariableDeclaration(parseVariableDeclarationList()); + declarations = parseVariableDeclarationList({ inFor: true }); state.allowIn = previousAllowIn; - if (init.declarations.length === 1 && matchKeyword('in')) { + if (declarations.length === 1 && matchKeyword('in')) { + init = init.finishVariableDeclaration(declarations); lex(); left = init; right = parseExpression(); init = null; + } else if (declarations.length === 1 && declarations[0].init === null && matchContextualKeyword('of')) { + init = init.finishVariableDeclaration(declarations); + lex(); + left = init; + right = parseAssignmentExpression(); + init = null; + forIn = false; } else { + init = init.finishVariableDeclaration(declarations); expect(';'); } } else if (matchKeyword('const') || matchKeyword('let')) { init = new Node(); kind = lex().value; - state.allowIn = false; - declarations = parseBindingList(kind, {inFor: true}); - state.allowIn = previousAllowIn; - - if (declarations.length === 1 && declarations[0].init === null && matchKeyword('in')) { - init = init.finishLexicalDeclaration(declarations, kind); + if (!strict && lookahead.value === 'in') { + init = init.finishIdentifier(kind); lex(); left = init; right = parseExpression(); init = null; } else { - consumeSemicolon(); - init = init.finishLexicalDeclaration(declarations, kind); + state.allowIn = false; + declarations = parseBindingList(kind, {inFor: true}); + state.allowIn = previousAllowIn; + + if (declarations.length === 1 && declarations[0].init === null && matchKeyword('in')) { + init = init.finishLexicalDeclaration(declarations, kind); + lex(); + left = init; + right = parseExpression(); + init = null; + } else if (declarations.length === 1 && declarations[0].init === null && matchContextualKeyword('of')) { + init = init.finishLexicalDeclaration(declarations, kind); + lex(); + left = init; + right = parseAssignmentExpression(); + init = null; + forIn = false; + } else { + consumeSemicolon(); + init = init.finishLexicalDeclaration(declarations, kind); + } } } else { initStartToken = lookahead; @@ -4029,6 +4386,17 @@ left = init; right = parseExpression(); init = null; + } else if (matchContextualKeyword('of')) { + if (!isAssignmentTarget) { + tolerateError(Messages.InvalidLHSInForLoop); + } + + lex(); + reinterpretExpressionAsPattern(init); + left = init; + right = parseAssignmentExpression(); + init = null; + forIn = false; } else { if (match(',')) { initSeq = [init]; @@ -4066,10 +4434,11 @@ return (typeof left === 'undefined') ? node.finishForStatement(init, test, update, body) : - node.finishForInStatement(left, right, body); + forIn ? node.finishForInStatement(left, right, body) : + node.finishForOfStatement(left, right, body); } - // 12.7 The continue statement + // ECMA-262 13.8 The continue statement function parseContinueStatement(node) { var label = null, key; @@ -4113,7 +4482,7 @@ return node.finishContinueStatement(label); } - // 12.8 The break statement + // ECMA-262 13.9 The break statement function parseBreakStatement(node) { var label = null, key; @@ -4135,11 +4504,7 @@ if (!(state.inIteration || state.inSwitch)) { throwError(Messages.IllegalBreak); } - - return node.finishBreakStatement(null); - } - - if (lookahead.type === Token.Identifier) { + } else if (lookahead.type === Token.Identifier) { label = parseVariableIdentifier(); key = '$' + label.name; @@ -4157,7 +4522,7 @@ return node.finishBreakStatement(label); } - // 12.9 The return statement + // ECMA-262 13.10 The return statement function parseReturnStatement(node) { var argument = null; @@ -4193,7 +4558,7 @@ return node.finishReturnStatement(argument); } - // 12.10 The with statement + // ECMA-262 13.11 The with statement function parseWithStatement(node) { var object, body; @@ -4215,7 +4580,7 @@ return node.finishWithStatement(object, body); } - // 12.10 The swith statement + // ECMA-262 13.12 The switch statement function parseSwitchCase() { var test, consequent = [], statement, node = new Node(); @@ -4285,7 +4650,7 @@ return node.finishSwitchStatement(discriminant, cases); } - // 12.13 The throw statement + // ECMA-262 13.14 The throw statement function parseThrowStatement(node) { var argument; @@ -4303,10 +4668,10 @@ return node.finishThrowStatement(argument); } - // 12.14 The try statement + // ECMA-262 13.15 The try statement function parseCatchClause() { - var param, body, node = new Node(); + var param, params = [], paramMap = {}, key, i, body, node = new Node(); expectKeyword('catch'); @@ -4315,9 +4680,16 @@ throwUnexpectedToken(lookahead); } - param = parsePattern(); + param = parsePattern(params); + for (i = 0; i < params.length; i++) { + key = '$' + params[i].value; + if (Object.prototype.hasOwnProperty.call(paramMap, key)) { + tolerateError(Messages.DuplicateBinding, params[i].value); + } + paramMap[key] = true; + } - // 12.14.1 + // ECMA-262 12.14.1 if (strict && isRestrictedWord(param.name)) { tolerateError(Messages.StrictCatchVariable); } @@ -4350,7 +4722,7 @@ return node.finishTryStatement(block, handler, finalizer); } - // 12.15 The debugger statement + // ECMA-262 13.16 The debugger statement function parseDebuggerStatement(node) { expectKeyword('debugger'); @@ -4360,7 +4732,7 @@ return node.finishDebuggerStatement(); } - // 12 Statements + // 13 Statements function parseStatement() { var type = lookahead.type, @@ -4425,7 +4797,7 @@ expr = parseExpression(); - // 12.12 Labelled Statements + // ECMA-262 12.12 Labelled Statements if ((expr.type === Syntax.Identifier) && match(':')) { lex(); @@ -4445,11 +4817,11 @@ return node.finishExpressionStatement(expr); } - // 13 Function Definition + // ECMA-262 14.1 Function Definition function parseFunctionSourceElements() { var statement, body = [], token, directive, firstRestricted, - oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, oldParenthesisCount, + oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, node = new Node(); expect('{'); @@ -4483,13 +4855,11 @@ oldInIteration = state.inIteration; oldInSwitch = state.inSwitch; oldInFunctionBody = state.inFunctionBody; - oldParenthesisCount = state.parenthesizedCount; state.labelSet = {}; state.inIteration = false; state.inSwitch = false; state.inFunctionBody = true; - state.parenthesizedCount = 0; while (startIndex < length) { if (match('}')) { @@ -4504,7 +4874,6 @@ state.inIteration = oldInIteration; state.inSwitch = oldInSwitch; state.inFunctionBody = oldInFunctionBody; - state.parenthesizedCount = oldParenthesisCount; return node.finishBlockStatement(body); } @@ -4528,7 +4897,7 @@ options.firstRestricted = param; options.message = Messages.StrictReservedWord; } else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { - options.firstRestricted = param; + options.stricted = param; options.message = Messages.StrictParamDupe; } } @@ -4536,19 +4905,21 @@ } function parseParam(options) { - var token, param, def; + var token, param, params = [], i, def; token = lookahead; if (token.value === '...') { - param = parseRestElement(); + param = parseRestElement(params); validateParam(options, param.argument, param.argument.name); options.params.push(param); options.defaults.push(null); return false; } - param = parsePatternWithDefault(); - validateParam(options, token, token.value); + param = parsePatternWithDefault(params); + for (i = 0; i < params.length; i++) { + validateParam(options, params[i], params[i].value); + } if (param.type === Syntax.AssignmentPattern) { def = param.right; @@ -4600,9 +4971,18 @@ } function parseFunctionDeclaration(node, identifierIsOptional) { - var id = null, params = [], defaults = [], body, token, stricted, tmp, firstRestricted, message, previousStrict; + var id = null, params = [], defaults = [], body, token, stricted, tmp, firstRestricted, message, previousStrict, + isGenerator, previousAllowYield; + + previousAllowYield = state.allowYield; expectKeyword('function'); + + isGenerator = match('*'); + if (isGenerator) { + lex(); + } + if (!identifierIsOptional || !match('(')) { token = lookahead; id = parseVariableIdentifier(); @@ -4621,6 +5001,7 @@ } } + state.allowYield = !isGenerator; tmp = parseParams(firstRestricted); params = tmp.params; defaults = tmp.defaults; @@ -4630,6 +5011,7 @@ message = tmp.message; } + previousStrict = strict; body = parseFunctionSourceElements(); if (strict && firstRestricted) { @@ -4638,20 +5020,31 @@ if (strict && stricted) { tolerateUnexpectedToken(stricted, message); } + strict = previousStrict; + state.allowYield = previousAllowYield; - return node.finishFunctionDeclaration(id, params, defaults, body); + return node.finishFunctionDeclaration(id, params, defaults, body, isGenerator); } function parseFunctionExpression() { var token, id = null, stricted, firstRestricted, message, tmp, - params = [], defaults = [], body, previousStrict, node = new Node(); + params = [], defaults = [], body, previousStrict, node = new Node(), + isGenerator, previousAllowYield; + + previousAllowYield = state.allowYield; expectKeyword('function'); + isGenerator = match('*'); + if (isGenerator) { + lex(); + } + + state.allowYield = !isGenerator; if (!match('(')) { token = lookahead; - id = parseVariableIdentifier(); + id = (!strict && !isGenerator && matchKeyword('yield')) ? parseNonComputedProperty() : parseVariableIdentifier(); if (strict) { if (isRestrictedWord(token.value)) { tolerateUnexpectedToken(token, Messages.StrictFunctionName); @@ -4685,10 +5078,12 @@ tolerateUnexpectedToken(stricted, message); } strict = previousStrict; + state.allowYield = previousAllowYield; - return node.finishFunctionExpression(id, params, defaults, body); + return node.finishFunctionExpression(id, params, defaults, body, isGenerator); } + // ECMA-262 14.5 Class Definitions function parseClassBody() { var classBody, token, isStatic, hasConstructor = false, body, method, computed, key; @@ -4705,16 +5100,24 @@ token = lookahead; isStatic = false; computed = match('['); - key = parseObjectPropertyKey(); - if (key.name === 'static' && lookaheadPropertyName()) { - token = lookahead; - isStatic = true; - computed = match('['); + if (match('*')) { + lex(); + } else { key = parseObjectPropertyKey(); + if (key.name === 'static' && (lookaheadPropertyName() || match('*'))) { + token = lookahead; + isStatic = true; + computed = match('['); + if (match('*')) { + lex(); + } else { + key = parseObjectPropertyKey(); + } + } } method = tryParseMethodDefinition(token, key, computed, method); if (method) { - method['static'] = isStatic; + method['static'] = isStatic; // jscs:ignore requireDotNotation if (method.kind === 'init') { method.kind = 'method'; } @@ -4788,8 +5191,7 @@ return classNode.finishClassExpression(id, superClass, classBody); } - // Modules grammar from: - // people.mozilla.org/~jorendorff/es6-draft.html + // ECMA-262 15.2 Modules function parseModuleSpecifier() { var node = new Node(); @@ -4800,6 +5202,8 @@ return node.finishLiteral(lex()); } + // ECMA-262 15.2.3 Exports + function parseExportSpecifier() { var exported, local, node = new Node(), def; if (matchKeyword('default')) { @@ -4829,6 +5233,8 @@ switch (lookahead.value) { case 'let': case 'const': + declaration = parseLexicalDeclaration({inFor: false}); + return node.finishExportNamedDeclaration(declaration, specifiers, null); case 'var': case 'class': case 'function': @@ -4838,11 +5244,15 @@ } expect('{'); - if (!match('}')) { - do { - isExportFromIdentifier = isExportFromIdentifier || matchKeyword('default'); - specifiers.push(parseExportSpecifier()); - } while (match(',') && lex()); + while (!match('}')) { + isExportFromIdentifier = isExportFromIdentifier || matchKeyword('default'); + specifiers.push(parseExportSpecifier()); + if (!match('}')) { + expect(','); + if (match('}')) { + break; + } + } } expect('}'); @@ -4895,9 +5305,9 @@ // export default []; // export default (1 + 2); if (match('{')) { - expression = parseObjectInitialiser(); + expression = parseObjectInitializer(); } else if (match('[')) { - expression = parseArrayInitialiser(); + expression = parseArrayInitializer(); } else { expression = parseAssignmentExpression(); } @@ -4939,6 +5349,8 @@ return parseExportNamedDeclaration(node); } + // ECMA-262 15.2.2 Imports + function parseImportSpecifier() { // import {} ...; var local, imported, node = new Node(); @@ -4956,10 +5368,14 @@ var specifiers = []; // {foo, bar as bas} expect('{'); - if (!match('}')) { - do { - specifiers.push(parseImportSpecifier()); - } while (match(',') && lex()); + while (!match('}')) { + specifiers.push(parseImportSpecifier()); + if (!match('}')) { + expect(','); + if (match('}')) { + break; + } + } } expect('}'); return specifiers; @@ -4989,56 +5405,57 @@ } function parseImportDeclaration() { - var specifiers, src, node = new Node(); + var specifiers = [], src, node = new Node(); if (state.inFunctionBody) { throwError(Messages.IllegalImportDeclaration); } expectKeyword('import'); - specifiers = []; if (lookahead.type === Token.StringLiteral) { - // covers: // import 'foo'; src = parseModuleSpecifier(); - consumeSemicolon(); - return node.finishImportDeclaration(specifiers, src); - } + } else { - if (!matchKeyword('default') && isIdentifierName(lookahead)) { - // covers: - // import foo - // import foo, ... - specifiers.push(parseImportDefaultSpecifier()); - if (match(',')) { - lex(); + if (match('{')) { + // import {bar} + specifiers = specifiers.concat(parseNamedImports()); + } else if (match('*')) { + // import * as foo + specifiers.push(parseImportNamespaceSpecifier()); + } else if (isIdentifierName(lookahead) && !matchKeyword('default')) { + // import foo + specifiers.push(parseImportDefaultSpecifier()); + if (match(',')) { + lex(); + if (match('*')) { + // import foo, * as foo + specifiers.push(parseImportNamespaceSpecifier()); + } else if (match('{')) { + // import foo, {bar} + specifiers = specifiers.concat(parseNamedImports()); + } else { + throwUnexpectedToken(lookahead); + } + } + } else { + throwUnexpectedToken(lex()); } - } - if (match('*')) { - // covers: - // import foo, * as foo - // import * as foo - specifiers.push(parseImportNamespaceSpecifier()); - } else if (match('{')) { - // covers: - // import foo, {bar} - // import {bar} - specifiers = specifiers.concat(parseNamedImports()); - } - if (!matchContextualKeyword('from')) { - throwError(lookahead.value ? - Messages.UnexpectedToken : Messages.MissingFromClause, lookahead.value); + if (!matchContextualKeyword('from')) { + throwError(lookahead.value ? + Messages.UnexpectedToken : Messages.MissingFromClause, lookahead.value); + } + lex(); + src = parseModuleSpecifier(); } - lex(); - src = parseModuleSpecifier(); - consumeSemicolon(); + consumeSemicolon(); return node.finishImportDeclaration(specifiers, src); } - // 14 Program + // ECMA-262 15.1 Scripts function parseScriptBody() { var statement, body = [], token, directive, firstRestricted; @@ -5086,7 +5503,7 @@ node = new Node(); body = parseScriptBody(); - return node.finishProgram(body); + return node.finishProgram(body, state.sourceType); } function filterTokenLocation() { @@ -5116,7 +5533,7 @@ extra.tokens = tokens; } - function tokenize(code, options) { + function tokenize(code, options, delegate) { var toString, tokens; @@ -5136,6 +5553,7 @@ lookahead = null; state = { allowIn: true, + allowYield: true, labelSet: {}, inFunctionBody: false, inIteration: false, @@ -5152,7 +5570,10 @@ // Of course we collect tokens here. options.tokens = true; extra.tokens = []; + extra.tokenValues = []; extra.tokenize = true; + extra.delegate = delegate; + // The following two fields are necessary to compute the Regex tokens. extra.openParenToken = -1; extra.openCurlyToken = -1; @@ -5189,11 +5610,7 @@ } } - filterTokenLocation(); tokens = extra.tokens; - if (typeof extra.comments !== 'undefined') { - tokens.comments = extra.comments; - } if (typeof extra.errors !== 'undefined') { tokens.errors = extra.errors; } @@ -5224,14 +5641,15 @@ lookahead = null; state = { allowIn: true, + allowYield: true, labelSet: {}, inFunctionBody: false, inIteration: false, inSwitch: false, lastCommentStart: -1, - curlyStack: [] + curlyStack: [], + sourceType: 'script' }; - sourceType = 'script'; strict = false; extra = {}; @@ -5262,7 +5680,7 @@ } if (options.sourceType === 'module') { // very restrictive condition for now - sourceType = options.sourceType; + state.sourceType = options.sourceType; strict = true; } } @@ -5289,7 +5707,7 @@ } // Sync with *.json manifests. - exports.version = '2.2.0'; + exports.version = '2.7.2'; exports.tokenize = tokenize; diff --git a/tools/eslint/node_modules/esprima/package.json b/tools/eslint/node_modules/esprima/package.json new file mode 100644 index 00000000000000..8746bd43a071b5 --- /dev/null +++ b/tools/eslint/node_modules/esprima/package.json @@ -0,0 +1,145 @@ +{ + "_args": [ + [ + "esprima@^2.6.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/js-yaml" + ] + ], + "_from": "esprima@>=2.6.0 <3.0.0", + "_id": "esprima@2.7.2", + "_inCache": true, + "_installable": true, + "_location": "/esprima", + "_nodeVersion": "4.2.2", + "_npmOperationalInternal": { + "host": "packages-9-west.internal.npmjs.com", + "tmp": "tmp/esprima-2.7.2.tgz_1454477276067_0.014412595424801111" + }, + "_npmUser": { + "email": "ariya.hidayat@gmail.com", + "name": "ariya" + }, + "_npmVersion": "2.14.7", + "_phantomChildren": {}, + "_requested": { + "name": "esprima", + "raw": "esprima@^2.6.0", + "rawSpec": "^2.6.0", + "scope": null, + "spec": ">=2.6.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/js-yaml" + ], + "_resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.2.tgz", + "_shasum": "f43be543609984eae44c933ac63352a6af35f339", + "_shrinkwrap": null, + "_spec": "esprima@^2.6.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/js-yaml", + "author": { + "email": "ariya.hidayat@gmail.com", + "name": "Ariya Hidayat" + }, + "bin": { + "esparse": "./bin/esparse.js", + "esvalidate": "./bin/esvalidate.js" + }, + "bugs": { + "url": "https://github.com/jquery/esprima/issues" + }, + "dependencies": {}, + "description": "ECMAScript parsing infrastructure for multipurpose analysis", + "devDependencies": { + "codecov.io": "~0.1.6", + "escomplex-js": "1.2.0", + "eslint": "~1.7.2", + "everything.js": "~1.0.3", + "glob": "^5.0.15", + "istanbul": "~0.4.0", + "jscs": "~2.3.5", + "json-diff": "~0.3.1", + "karma": "^0.13.11", + "karma-chrome-launcher": "^0.2.1", + "karma-detect-browsers": "^2.0.2", + "karma-firefox-launcher": "^0.1.6", + "karma-ie-launcher": "^0.2.0", + "karma-mocha": "^0.2.0", + "karma-safari-launcher": "^0.1.1", + "karma-sauce-launcher": "^0.2.14", + "lodash": "^3.10.0", + "mocha": "^2.3.3", + "node-tick-processor": "~0.0.2", + "regenerate": "~1.2.1", + "temp": "~0.8.3", + "unicode-7.0.0": "~0.1.5" + }, + "directories": {}, + "dist": { + "shasum": "f43be543609984eae44c933ac63352a6af35f339", + "tarball": "https://registry.npmjs.org/esprima/-/esprima-2.7.2.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "bin", + "esprima.js", + "unit-tests.js" + ], + "gitHead": "eb05a03b18b8433ab1ebeabea635a949219cd75e", + "homepage": "http://esprima.org", + "keywords": [ + "ast", + "ecmascript", + "javascript", + "parser", + "syntax" + ], + "license": "BSD-2-Clause", + "main": "esprima.js", + "maintainers": [ + { + "name": "ariya", + "email": "ariya.hidayat@gmail.com" + } + ], + "name": "esprima", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jquery/esprima.git" + }, + "scripts": { + "all-tests": "npm run generate-fixtures && npm run unit-tests && npm run grammar-tests && npm run regression-tests", + "analyze-coverage": "istanbul cover test/unit-tests.js", + "appveyor": "npm run all-tests && npm run browser-tests && npm run dynamic-analysis", + "benchmark": "node test/benchmarks.js", + "benchmark-quick": "node test/benchmarks.js quick", + "browser-tests": "npm run generate-fixtures && cd test && karma start --single-run", + "check-coverage": "istanbul check-coverage --statement 100 --branch 100 --function 100", + "check-version": "node test/check-version.js", + "circleci": "npm test && npm run codecov && npm run downstream", + "codecov": "istanbul report cobertura && codecov < ./coverage/cobertura-coverage.xml", + "complexity": "node test/check-complexity.js", + "downstream": "node test/downstream.js", + "droneio": "npm test && npm run saucelabs-evergreen && npm run saucelabs-ie && npm run saucelabs-safari", + "dynamic-analysis": "npm run analyze-coverage && npm run check-coverage", + "eslint": "node node_modules/eslint/bin/eslint.js -c .lintrc esprima.js", + "generate-fixtures": "node tools/generate-fixtures.js", + "generate-regex": "node tools/generate-identifier-regex.js", + "grammar-tests": "node test/grammar-tests.js", + "jscs": "jscs -p crockford esprima.js && jscs -p crockford test/*.js", + "profile": "node --prof test/profile.js && mv isolate*.log v8.log && node-tick-processor", + "regression-tests": "node test/regression-tests.js", + "saucelabs-evergreen": "cd test && karma start saucelabs-evergreen.conf.js", + "saucelabs-ie": "cd test && karma start saucelabs-ie.conf.js", + "saucelabs-safari": "cd test && karma start saucelabs-safari.conf.js", + "static-analysis": "npm run check-version && npm run jscs && npm run eslint && npm run complexity", + "test": "npm run all-tests && npm run static-analysis && npm run dynamic-analysis", + "travis": "npm test", + "unit-tests": "node test/unit-tests.js" + }, + "version": "2.7.2" +} diff --git a/tools/eslint/node_modules/escope/node_modules/esrecurse/esrecurse.js b/tools/eslint/node_modules/esrecurse/esrecurse.js similarity index 77% rename from tools/eslint/node_modules/escope/node_modules/esrecurse/esrecurse.js rename to tools/eslint/node_modules/esrecurse/esrecurse.js index 0774f86f6bc6de..0805e67f391041 100644 --- a/tools/eslint/node_modules/escope/node_modules/esrecurse/esrecurse.js +++ b/tools/eslint/node_modules/esrecurse/esrecurse.js @@ -24,18 +24,17 @@ (function () { 'use strict'; - var estraverse, + var assign, + estraverse, isArray, objectKeys; + assign = require('object-assign'); estraverse = require('estraverse'); - isArray = Array.isArray; - if (!isArray) { - isArray = function isArray(array) { - return Object.prototype.toString.call(array) === '[object Array]'; - }; - } + isArray = Array.isArray || function isArray(array) { + return Object.prototype.toString.call(array) === '[object Array]'; + }; objectKeys = Object.keys || function (o) { var keys = [], key; @@ -56,8 +55,18 @@ return (nodeType === estraverse.Syntax.ObjectExpression || nodeType === estraverse.Syntax.ObjectPattern) && key === 'properties'; } - function Visitor(visitor) { + function Visitor(visitor, options) { + options = options || {}; + this.__visitor = visitor || this; + this.__childVisitorKeys = options.childVisitorKeys + ? assign({}, estraverse.VisitorKeys, options.childVisitorKeys) + : estraverse.VisitorKeys; + if (options.fallback === 'iteration') { + this.__fallback = objectKeys; + } else if (typeof options.fallback === 'function') { + this.__fallback = options.fallback; + } } /* Default method for visiting children. @@ -73,15 +82,19 @@ type = node.type || estraverse.Syntax.Property; - children = estraverse.VisitorKeys[type]; + children = this.__childVisitorKeys[type]; if (!children) { - children = objectKeys(node); + if (this.__fallback) { + children = this.__fallback(node); + } else { + throw new Error('Unknown node type ' + type + '.'); + } } for (i = 0, iz = children.length; i < iz; ++i) { child = node[children[i]]; if (child) { - if (Array.isArray(child)) { + if (isArray(child)) { for (j = 0, jz = child.length; j < jz; ++j) { if (child[j]) { if (isNode(child[j]) || isProperty(type, children[i])) { @@ -114,8 +127,8 @@ exports.version = require('./package.json').version; exports.Visitor = Visitor; - exports.visit = function (node, visitor) { - var v = new Visitor(visitor); + exports.visit = function (node, visitor, options) { + var v = new Visitor(visitor, options); v.visit(node); }; }()); diff --git a/tools/eslint/node_modules/escope/node_modules/estraverse/LICENSE.BSD b/tools/eslint/node_modules/esrecurse/node_modules/estraverse/LICENSE.BSD similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/estraverse/LICENSE.BSD rename to tools/eslint/node_modules/esrecurse/node_modules/estraverse/LICENSE.BSD diff --git a/tools/eslint/node_modules/esrecurse/node_modules/estraverse/README.md b/tools/eslint/node_modules/esrecurse/node_modules/estraverse/README.md new file mode 100644 index 00000000000000..acefff6473c19c --- /dev/null +++ b/tools/eslint/node_modules/esrecurse/node_modules/estraverse/README.md @@ -0,0 +1,124 @@ +### Estraverse [![Build Status](https://secure.travis-ci.org/estools/estraverse.png)](http://travis-ci.org/estools/estraverse) + +Estraverse ([estraverse](http://github.com/estools/estraverse)) is +[ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) +traversal functions from [esmangle project](http://github.com/estools/esmangle). + +### Documentation + +You can find usage docs at [wiki page](https://github.com/estools/estraverse/wiki/Usage). + +### Example Usage + +The following code will output all variables declared at the root of a file. + +```javascript +estraverse.traverse(ast, { + enter: function (node, parent) { + if (node.type == 'FunctionExpression' || node.type == 'FunctionDeclaration') + return estraverse.VisitorOption.Skip; + }, + leave: function (node, parent) { + if (node.type == 'VariableDeclarator') + console.log(node.id.name); + } +}); +``` + +We can use `this.skip`, `this.remove` and `this.break` functions instead of using Skip, Remove and Break. + +```javascript +estraverse.traverse(ast, { + enter: function (node) { + this.break(); + } +}); +``` + +And estraverse provides `estraverse.replace` function. When returning node from `enter`/`leave`, current node is replaced with it. + +```javascript +result = estraverse.replace(tree, { + enter: function (node) { + // Replace it with replaced. + if (node.type === 'Literal') + return replaced; + } +}); +``` + +By passing `visitor.keys` mapping, we can extend estraverse traversing functionality. + +```javascript +// This tree contains a user-defined `TestExpression` node. +var tree = { + type: 'TestExpression', + + // This 'argument' is the property containing the other **node**. + argument: { + type: 'Literal', + value: 20 + }, + + // This 'extended' is the property not containing the other **node**. + extended: true +}; +estraverse.traverse(tree, { + enter: function (node) { }, + + // Extending the existing traversing rules. + keys: { + // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ] + TestExpression: ['argument'] + } +}); +``` + +By passing `visitor.fallback` option, we can control the behavior when encountering unknown nodes. +```javascript +// This tree contains a user-defined `TestExpression` node. +var tree = { + type: 'TestExpression', + + // This 'argument' is the property containing the other **node**. + argument: { + type: 'Literal', + value: 20 + }, + + // This 'extended' is the property not containing the other **node**. + extended: true +}; +estraverse.traverse(tree, { + enter: function (node) { }, + + // Iterating the child **nodes** of unknown nodes. + fallback: 'iteration' +}); +``` + +### License + +Copyright (C) 2012-2013 [Yusuke Suzuki](http://github.com/Constellation) + (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/eslint/node_modules/escope/node_modules/estraverse/estraverse.js b/tools/eslint/node_modules/esrecurse/node_modules/estraverse/estraverse.js similarity index 99% rename from tools/eslint/node_modules/escope/node_modules/estraverse/estraverse.js rename to tools/eslint/node_modules/esrecurse/node_modules/estraverse/estraverse.js index a668aa3e61123f..0de6cec24f3ec6 100644 --- a/tools/eslint/node_modules/escope/node_modules/estraverse/estraverse.js +++ b/tools/eslint/node_modules/esrecurse/node_modules/estraverse/estraverse.js @@ -185,6 +185,7 @@ LabeledStatement: 'LabeledStatement', LogicalExpression: 'LogicalExpression', MemberExpression: 'MemberExpression', + MetaProperty: 'MetaProperty', MethodDefinition: 'MethodDefinition', ModuleSpecifier: 'ModuleSpecifier', NewExpression: 'NewExpression', @@ -196,7 +197,7 @@ ReturnStatement: 'ReturnStatement', SequenceExpression: 'SequenceExpression', SpreadElement: 'SpreadElement', - SuperExpression: 'SuperExpression', + Super: 'Super', SwitchStatement: 'SwitchStatement', SwitchCase: 'SwitchCase', TaggedTemplateExpression: 'TaggedTemplateExpression', @@ -258,6 +259,7 @@ LabeledStatement: ['label', 'body'], LogicalExpression: ['left', 'right'], MemberExpression: ['object', 'property'], + MetaProperty: ['meta', 'property'], MethodDefinition: ['key', 'value'], ModuleSpecifier: [], NewExpression: ['callee', 'arguments'], @@ -269,7 +271,7 @@ ReturnStatement: ['argument'], SequenceExpression: ['expressions'], SpreadElement: ['argument'], - SuperExpression: ['super'], + Super: [], SwitchStatement: ['discriminant', 'cases'], SwitchCase: ['test', 'consequent'], TaggedTemplateExpression: ['tag', 'quasi'], @@ -504,7 +506,7 @@ } node = element.node; - nodeType = element.wrap || node.type; + nodeType = node.type || element.wrap; candidates = this.__keys[nodeType]; if (!candidates) { if (this.__fallback) { @@ -658,7 +660,7 @@ continue; } - nodeType = element.wrap || node.type; + nodeType = node.type || element.wrap; candidates = this.__keys[nodeType]; if (!candidates) { if (this.__fallback) { diff --git a/tools/eslint/node_modules/esrecurse/node_modules/estraverse/package.json b/tools/eslint/node_modules/esrecurse/node_modules/estraverse/package.json new file mode 100644 index 00000000000000..29cb591629b48c --- /dev/null +++ b/tools/eslint/node_modules/esrecurse/node_modules/estraverse/package.json @@ -0,0 +1,92 @@ +{ + "_args": [ + [ + "estraverse@~4.1.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/esrecurse" + ] + ], + "_from": "estraverse@>=4.1.0 <4.2.0", + "_id": "estraverse@4.1.1", + "_inCache": true, + "_installable": true, + "_location": "/esrecurse/estraverse", + "_nodeVersion": "4.1.1", + "_npmUser": { + "email": "utatane.tea@gmail.com", + "name": "constellation" + }, + "_npmVersion": "2.14.4", + "_phantomChildren": {}, + "_requested": { + "name": "estraverse", + "raw": "estraverse@~4.1.0", + "rawSpec": "~4.1.0", + "scope": null, + "spec": ">=4.1.0 <4.2.0", + "type": "range" + }, + "_requiredBy": [ + "/esrecurse" + ], + "_resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.1.1.tgz", + "_shasum": "f6caca728933a850ef90661d0e17982ba47111a2", + "_shrinkwrap": null, + "_spec": "estraverse@~4.1.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/esrecurse", + "bugs": { + "url": "https://github.com/estools/estraverse/issues" + }, + "dependencies": {}, + "description": "ECMAScript JS AST traversal functions", + "devDependencies": { + "chai": "^2.1.1", + "coffee-script": "^1.8.0", + "espree": "^1.11.0", + "gulp": "^3.8.10", + "gulp-bump": "^0.2.2", + "gulp-filter": "^2.0.0", + "gulp-git": "^1.0.1", + "gulp-tag-version": "^1.2.1", + "jshint": "^2.5.6", + "mocha": "^2.1.0" + }, + "directories": {}, + "dist": { + "shasum": "f6caca728933a850ef90661d0e17982ba47111a2", + "tarball": "http://registry.npmjs.org/estraverse/-/estraverse-4.1.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "gitHead": "bbcccbfe98296585e4311c8755e1d00dcd581e3c", + "homepage": "https://github.com/estools/estraverse", + "license": "BSD-2-Clause", + "main": "estraverse.js", + "maintainers": [ + { + "name": "constellation", + "email": "utatane.tea@gmail.com" + }, + { + "name": "michaelficarra", + "email": "npm@michael.ficarra.me" + }, + { + "name": "nzakas", + "email": "nicholas@nczconsulting.com" + } + ], + "name": "estraverse", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/estools/estraverse.git" + }, + "scripts": { + "lint": "jshint estraverse.js", + "test": "npm run-script lint && npm run-script unit-test", + "unit-test": "mocha --compilers coffee:coffee-script/register" + }, + "version": "4.1.1" +} diff --git a/tools/eslint/node_modules/esrecurse/package.json b/tools/eslint/node_modules/esrecurse/package.json new file mode 100644 index 00000000000000..ad0ce09c24e32b --- /dev/null +++ b/tools/eslint/node_modules/esrecurse/package.json @@ -0,0 +1,101 @@ +{ + "_args": [ + [ + "esrecurse@^4.1.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/escope" + ] + ], + "_from": "esrecurse@>=4.1.0 <5.0.0", + "_id": "esrecurse@4.1.0", + "_inCache": true, + "_installable": true, + "_location": "/esrecurse", + "_nodeVersion": "0.12.9", + "_npmOperationalInternal": { + "host": "packages-13-west.internal.npmjs.com", + "tmp": "tmp/esrecurse-4.1.0.tgz_1457712782215_0.15950557170435786" + }, + "_npmUser": { + "email": "nicholas@nczconsulting.com", + "name": "nzakas" + }, + "_npmVersion": "2.14.9", + "_phantomChildren": {}, + "_requested": { + "name": "esrecurse", + "raw": "esrecurse@^4.1.0", + "rawSpec": "^4.1.0", + "scope": null, + "spec": ">=4.1.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/escope" + ], + "_resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.1.0.tgz", + "_shasum": "4713b6536adf7f2ac4f327d559e7756bff648220", + "_shrinkwrap": null, + "_spec": "esrecurse@^4.1.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/escope", + "bugs": { + "url": "https://github.com/estools/esrecurse/issues" + }, + "dependencies": { + "estraverse": "~4.1.0", + "object-assign": "^4.0.1" + }, + "description": "ECMAScript AST recursive visitor", + "devDependencies": { + "chai": "^3.3.0", + "coffee-script": "^1.9.1", + "esprima": "^2.1.0", + "gulp": "^3.9.0", + "gulp-bump": "^1.0.0", + "gulp-eslint": "^1.0.0", + "gulp-filter": "^3.0.1", + "gulp-git": "^1.1.0", + "gulp-mocha": "^2.1.3", + "gulp-tag-version": "^1.2.1", + "jsdoc": "^3.3.0-alpha10", + "minimist": "^1.1.0" + }, + "directories": {}, + "dist": { + "shasum": "4713b6536adf7f2ac4f327d559e7756bff648220", + "tarball": "http://registry.npmjs.org/esrecurse/-/esrecurse-4.1.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "gitHead": "63a34714834bd7ad2063054bd4abb24fb82ca667", + "homepage": "https://github.com/estools/esrecurse", + "license": "BSD-2-Clause", + "main": "esrecurse.js", + "maintainers": [ + { + "name": "constellation", + "email": "utatane.tea@gmail.com" + }, + { + "name": "michaelficarra", + "email": "npm@michael.ficarra.me" + }, + { + "name": "nzakas", + "email": "nicholas@nczconsulting.com" + } + ], + "name": "esrecurse", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/estools/esrecurse.git" + }, + "scripts": { + "lint": "gulp lint", + "test": "gulp travis", + "unit-test": "gulp test" + }, + "version": "4.1.0" +} diff --git a/tools/eslint/node_modules/estraverse-fb/.npmignore b/tools/eslint/node_modules/estraverse-fb/.npmignore deleted file mode 100644 index da23d0d4bab050..00000000000000 --- a/tools/eslint/node_modules/estraverse-fb/.npmignore +++ /dev/null @@ -1,25 +0,0 @@ -# Logs -logs -*.log - -# Runtime data -pids -*.pid -*.seed - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directory -# Deployed apps should consider commenting this line out: -# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git -node_modules diff --git a/tools/eslint/node_modules/estraverse-fb/.travis.yml b/tools/eslint/node_modules/estraverse-fb/.travis.yml deleted file mode 100644 index ffb9f710ac283a..00000000000000 --- a/tools/eslint/node_modules/estraverse-fb/.travis.yml +++ /dev/null @@ -1,2 +0,0 @@ -language: node_js -node_js: '0.10' diff --git a/tools/eslint/node_modules/estraverse-fb/LICENSE b/tools/eslint/node_modules/estraverse-fb/LICENSE deleted file mode 100644 index 54530b38082641..00000000000000 --- a/tools/eslint/node_modules/estraverse-fb/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Ingvar Stepanyan - -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. \ No newline at end of file diff --git a/tools/eslint/node_modules/estraverse-fb/README.md b/tools/eslint/node_modules/estraverse-fb/README.md deleted file mode 100644 index 20b02966b871d0..00000000000000 --- a/tools/eslint/node_modules/estraverse-fb/README.md +++ /dev/null @@ -1,34 +0,0 @@ -estraverse-fb -============= -[![Build Status](https://travis-ci.org/RReverser/estraverse-fb.svg?branch=master)](https://travis-ci.org/RReverser/estraverse-fb) - -Drop-in for estraverse that enables traversal over React's JSX and Flow nodes using monkey-patching technique. - -You can use estraverse-fb in two possible ways: - -* by default, you just require it and it injects needed keys into your installed version of estraverse (it's installed automatically if you don't have it yet): - ```javascript - var estraverse = require('estraverse-fb'); - /* same as: - require('estraverse-fb'); - var estraverse = require('estraverse'); - */ - - estraverse.traverse(ast, { - enter: ..., - leave: ... - }); - ``` - -* alternatively, you can use it manually for selected traversals: - ```javascript - var jsxKeys = require('estraverse-fb/keys'); - - estraverse.traverse(ast, { - enter: ..., - leave: ..., - keys: jsxKeys - }) -``` - -Check out [estraverse page](https://github.com/Constellation/estraverse) for detailed usage. diff --git a/tools/eslint/node_modules/estraverse-fb/estraverse-fb.js b/tools/eslint/node_modules/estraverse-fb/estraverse-fb.js deleted file mode 100644 index 795ec40e62a2ae..00000000000000 --- a/tools/eslint/node_modules/estraverse-fb/estraverse-fb.js +++ /dev/null @@ -1,13 +0,0 @@ -var estraverse = module.exports = require('estraverse'); - -var VisitorKeys = require('./keys'); - -for (var nodeType in VisitorKeys) { - estraverse.Syntax[nodeType] = nodeType; - - var keys = VisitorKeys[nodeType]; - - if (keys) { - estraverse.VisitorKeys[nodeType] = keys; - } -} \ No newline at end of file diff --git a/tools/eslint/node_modules/estraverse-fb/keys.js b/tools/eslint/node_modules/estraverse-fb/keys.js deleted file mode 100644 index 47df04a58ba37d..00000000000000 --- a/tools/eslint/node_modules/estraverse-fb/keys.js +++ /dev/null @@ -1,57 +0,0 @@ -var unprefixedKeys = { - Identifier: [], - NamespacedName: ['namespace', 'name'], - MemberExpression: ['object', 'property'], - EmptyExpression: [], - ExpressionContainer: ['expression'], - Element: ['openingElement', 'closingElement', 'children'], - ClosingElement: ['name'], - OpeningElement: ['name', 'attributes'], - Attribute: ['name', 'value'], - Text: null, - SpreadAttribute: ['argument'] -}; - -var flowKeys = { - Type: [], - AnyTypeAnnotation: [], - VoidTypeAnnotation: [], - NumberTypeAnnotation: [], - StringTypeAnnotation: [], - StringLiteralTypeAnnotation: ["value", "raw"], - BooleanTypeAnnotation: [], - TypeAnnotation: ["typeAnnotation"], - NullableTypeAnnotation: ["typeAnnotation"], - FunctionTypeAnnotation: ["params", "returnType", "rest", "typeParameters"], - FunctionTypeParam: ["name", "typeAnnotation", "optional"], - ObjectTypeAnnotation: ["properties"], - ObjectTypeProperty: ["key", "value", "optional"], - ObjectTypeIndexer: ["id", "key", "value"], - ObjectTypeCallProperty: ["value"], - QualifiedTypeIdentifier: ["qualification", "id"], - GenericTypeAnnotation: ["id", "typeParameters"], - MemberTypeAnnotation: ["object", "property"], - UnionTypeAnnotation: ["types"], - IntersectionTypeAnnotation: ["types"], - TypeofTypeAnnotation: ["argument"], - TypeParameterDeclaration: ["params"], - TypeParameterInstantiation: ["params"], - ClassProperty: ["key", "typeAnnotation"], - ClassImplements: [], - InterfaceDeclaration: ["id", "body", "extends"], - InterfaceExtends: ["id"], - TypeAlias: ["id", "typeParameters", "right"], - TupleTypeAnnotation: ["types"], - DeclareVariable: ["id"], - DeclareFunction: ["id"], - DeclareClass: ["id"], - DeclareModule: ["id", "body"] -}; - -for (var key in unprefixedKeys) { - exports['XJS' + key] = exports['JSX' + key] = unprefixedKeys[key]; -} - -for (var key in flowKeys) { - exports[key] = flowKeys[key]; -} \ No newline at end of file diff --git a/tools/eslint/node_modules/estraverse-fb/package.json b/tools/eslint/node_modules/estraverse-fb/package.json deleted file mode 100644 index c96ec2f456d784..00000000000000 --- a/tools/eslint/node_modules/estraverse-fb/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "estraverse-fb", - "version": "1.3.1", - "description": "Drop-in for estraverse that enables traversal over React's JSX nodes.", - "main": "estraverse-fb.js", - "repository": { - "type": "git", - "url": "git+https://github.com/RReverser/estraverse-fb.git" - }, - "keywords": [ - "traverse", - "ast", - "react", - "jsx" - ], - "author": { - "name": "Ingvar Stepanyan", - "email": "me@rreverser.com", - "url": "https://github.com/RReverser" - }, - "license": "MIT", - "scripts": { - "test": "mocha" - }, - "peerDependencies": { - "estraverse": "*" - }, - "devDependencies": { - "chai": "^1.9.1", - "esprima-fb": "^8001.1001.0-dev-harmony-fb", - "estraverse": "^1.7.0", - "mocha": "^1.20.0" - }, - "gitHead": "776d565d897ad91e20efedd926972c7ab0c7221e", - "bugs": { - "url": "https://github.com/RReverser/estraverse-fb/issues" - }, - "homepage": "https://github.com/RReverser/estraverse-fb", - "_id": "estraverse-fb@1.3.1", - "_shasum": "160e75a80e605b08ce894bcce2fe3e429abf92bf", - "_from": "estraverse-fb@>=1.3.1 <2.0.0", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "rreverser", - "email": "me@rreverser.com" - }, - "maintainers": [ - { - "name": "rreverser", - "email": "me@rreverser.com" - } - ], - "dist": { - "shasum": "160e75a80e605b08ce894bcce2fe3e429abf92bf", - "tarball": "http://registry.npmjs.org/estraverse-fb/-/estraverse-fb-1.3.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/estraverse-fb/-/estraverse-fb-1.3.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/tools/eslint/node_modules/estraverse-fb/test.js b/tools/eslint/node_modules/estraverse-fb/test.js deleted file mode 100644 index e0fca88a01689a..00000000000000 --- a/tools/eslint/node_modules/estraverse-fb/test.js +++ /dev/null @@ -1,116 +0,0 @@ -var assert = require('chai').assert; -var parse = require('esprima-fb').parse; -var originalKeys = require('./keys'); - -describe('works', function () { - var code = ['class MyClass{', - 'x: number;', - 'y: number;', - 'constructor(x: number, y: number){', - 'this.x = x;', - 'this.y = y;', - '}', - 'render(){', - 'return !{}', - '}', - '}'].join('\n'); - - var ast = parse(code); - - var expectedKeys = [ - 'ClassProperty', - 'TypeAnnotation', - 'NumberTypeAnnotation', - 'ClassProperty', - 'TypeAnnotation', - 'NumberTypeAnnotation', - 'XJSElement', - 'XJSOpeningElement', - 'XJSNamespacedName', - 'XJSIdentifier', - 'XJSIdentifier', - 'XJSAttribute', - 'XJSIdentifier', - 'XJSAttribute', - 'XJSIdentifier', - 'XJSExpressionContainer', - 'XJSSpreadAttribute', - 'XJSClosingElement', - 'XJSNamespacedName', - 'XJSIdentifier', - 'XJSIdentifier', - 'XJSElement', - 'XJSOpeningElement', - 'XJSMemberExpression', - 'XJSIdentifier', - 'XJSIdentifier', - 'XJSClosingElement', - 'XJSMemberExpression', - 'XJSIdentifier', - 'XJSIdentifier', - 'XJSExpressionContainer', - 'XJSEmptyExpression' - ]; - - beforeEach(function () { - for (var key in require.cache) { - delete require.cache[key]; - } - }); - - it('directly from dependency', function () { - var traverse = require('./').traverse; - var actualKeys = []; - var actualTypeKeys = []; - - traverse(ast, { - enter: function (node) { - if (originalKeys[node.type] != null) { - actualKeys.push(node.type); - } - } - }); - - assert.deepEqual(actualKeys, expectedKeys); - }); - - it('in injected mode', function () { - require('./'); - var traverse = require('estraverse').traverse; - var actualKeys = []; - - traverse(ast, { - enter: function (node) { - if (originalKeys[node.type] != null) { - actualKeys.push(node.type); - } - } - }); - - assert.deepEqual(actualKeys, expectedKeys); - }); - - it('in single-pass mode', function () { - var traverse = require('estraverse').traverse; - var keys = require('./keys'); - - var actualKeys = []; - - traverse(ast, { - enter: function (node) { - if (originalKeys[node.type] != null) { - actualKeys.push(node.type); - } - }, - keys: keys - }); - - assert.throws(function () { - traverse(ast, { - enter: function () {} - }); - }); - - assert.deepEqual(actualKeys, expectedKeys); - }); -}); diff --git a/tools/eslint/node_modules/estraverse/.babelrc b/tools/eslint/node_modules/estraverse/.babelrc new file mode 100644 index 00000000000000..dc1bc4f9cdba17 --- /dev/null +++ b/tools/eslint/node_modules/estraverse/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["es2015"] +} \ No newline at end of file diff --git a/tools/eslint/node_modules/estraverse/.jshintrc b/tools/eslint/node_modules/estraverse/.jshintrc deleted file mode 100644 index f642dae7683b81..00000000000000 --- a/tools/eslint/node_modules/estraverse/.jshintrc +++ /dev/null @@ -1,16 +0,0 @@ -{ - "curly": true, - "eqeqeq": true, - "immed": true, - "eqnull": true, - "latedef": true, - "noarg": true, - "noempty": true, - "quotmark": "single", - "undef": true, - "unused": true, - "strict": true, - "trailing": true, - - "node": true -} diff --git a/tools/eslint/node_modules/estraverse/README.md b/tools/eslint/node_modules/estraverse/README.md deleted file mode 100644 index 4242c513309e9a..00000000000000 --- a/tools/eslint/node_modules/estraverse/README.md +++ /dev/null @@ -1,124 +0,0 @@ -### Estraverse [![Build Status](https://secure.travis-ci.org/estools/estraverse.png)](http://travis-ci.org/estools/estraverse) - -Estraverse ([estraverse](http://github.com/estools/estraverse)) is -[ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) -traversal functions from [esmangle project](http://github.com/estools/esmangle). - -### Documentation - -You can find usage docs at [wiki page](https://github.com/estools/estraverse/wiki/Usage). - -### Example Usage - -The following code will output all variables declared at the root of a file. - -```javascript -estraverse.traverse(ast, { - enter: function (node, parent) { - if (node.type == 'FunctionExpression' || node.type == 'FunctionDeclaration') - return estraverse.VisitorOption.Skip; - }, - leave: function (node, parent) { - if (node.type == 'VariableDeclarator') - console.log(node.id.name); - } -}); -``` - -We can use `this.skip`, `this.remove` and `this.break` functions instead of using Skip, Remove and Break. - -```javascript -estraverse.traverse(ast, { - enter: function (node) { - this.break(); - } -}); -``` - -And estraverse provides `estraverse.replace` function. When returning node from `enter`/`leave`, current node is replaced with it. - -```javascript -result = estraverse.replace(tree, { - enter: function (node) { - // Replace it with replaced. - if (node.type === 'Literal') - return replaced; - } -}); -``` - -By passing `visitor.keys` mapping, we can extend estraverse traversing functionality. - -```javascript -// This tree contains a user-defined `TestExpression` node. -var tree = { - type: 'TestExpression', - - // This 'argument' is the property containing the other **node**. - argument: { - type: 'Literal', - value: 20 - }, - - // This 'extended' is the property not containing the other **node**. - extended: true -}; -estraverse.traverse(tree, { - enter: function (node) { }, - - // Extending the exising traversing rules. - keys: { - // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ] - TestExpression: ['argument'] - } -}); -``` - -By passing `visitor.fallback` option, we can control the behavior when encountering unknown nodes. -```javascript -// This tree contains a user-defined `TestExpression` node. -var tree = { - type: 'TestExpression', - - // This 'argument' is the property containing the other **node**. - argument: { - type: 'Literal', - value: 20 - }, - - // This 'extended' is the property not containing the other **node**. - extended: true -}; -estraverse.traverse(tree, { - enter: function (node) { }, - - // Iterating the child **nodes** of unknown nodes. - fallback: 'iteration' -}); -``` - -### License - -Copyright (C) 2012-2013 [Yusuke Suzuki](http://github.com/Constellation) - (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/eslint/node_modules/estraverse/estraverse.js b/tools/eslint/node_modules/estraverse/estraverse.js index 1ea5caf21f01ba..09ae4783247f0c 100644 --- a/tools/eslint/node_modules/estraverse/estraverse.js +++ b/tools/eslint/node_modules/estraverse/estraverse.js @@ -432,7 +432,13 @@ this.__leavelist = []; this.__current = null; this.__state = null; - this.__fallback = visitor.fallback === 'iteration'; + this.__fallback = null; + if (visitor.fallback === 'iteration') { + this.__fallback = objectKeys; + } else if (typeof visitor.fallback === 'function') { + this.__fallback = visitor.fallback; + } + this.__keys = VisitorKeys; if (visitor.keys) { this.__keys = extend(objectCreate(this.__keys), visitor.keys); @@ -506,11 +512,11 @@ } node = element.node; - nodeType = element.wrap || node.type; + nodeType = node.type || element.wrap; candidates = this.__keys[nodeType]; if (!candidates) { if (this.__fallback) { - candidates = objectKeys(node); + candidates = this.__fallback(node); } else { throw new Error('Unknown node type ' + nodeType + '.'); } @@ -548,6 +554,20 @@ }; Controller.prototype.replace = function replace(root, visitor) { + var worklist, + leavelist, + node, + nodeType, + target, + element, + current, + current2, + candidates, + candidate, + sentinel, + outer, + key; + function removeElem(element) { var i, key, @@ -573,20 +593,6 @@ } } - var worklist, - leavelist, - node, - nodeType, - target, - element, - current, - current2, - candidates, - candidate, - sentinel, - outer, - key; - this.__initialize(root, visitor); sentinel = {}; @@ -660,11 +666,11 @@ continue; } - nodeType = element.wrap || node.type; + nodeType = node.type || element.wrap; candidates = this.__keys[nodeType]; if (!candidates) { if (this.__fallback) { - candidates = objectKeys(node); + candidates = this.__fallback(node); } else { throw new Error('Unknown node type ' + nodeType + '.'); } diff --git a/tools/eslint/node_modules/estraverse/gulpfile.js b/tools/eslint/node_modules/estraverse/gulpfile.js deleted file mode 100644 index 8772bbcca542a8..00000000000000 --- a/tools/eslint/node_modules/estraverse/gulpfile.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - Copyright (C) 2014 Yusuke Suzuki - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -'use strict'; - -var gulp = require('gulp'), - git = require('gulp-git'), - bump = require('gulp-bump'), - filter = require('gulp-filter'), - tagVersion = require('gulp-tag-version'); - -var TEST = [ 'test/*.js' ]; -var POWERED = [ 'powered-test/*.js' ]; -var SOURCE = [ 'src/**/*.js' ]; - -/** - * Bumping version number and tagging the repository with it. - * Please read http://semver.org/ - * - * You can use the commands - * - * gulp patch # makes v0.1.0 -> v0.1.1 - * gulp feature # makes v0.1.1 -> v0.2.0 - * gulp release # makes v0.2.1 -> v1.0.0 - * - * To bump the version numbers accordingly after you did a patch, - * introduced a feature or made a backwards-incompatible release. - */ - -function inc(importance) { - // get all the files to bump version in - return gulp.src(['./package.json']) - // bump the version number in those files - .pipe(bump({type: importance})) - // save it back to filesystem - .pipe(gulp.dest('./')) - // commit the changed version number - .pipe(git.commit('Bumps package version')) - // read only one file to get the version number - .pipe(filter('package.json')) - // **tag it in the repository** - .pipe(tagVersion({ - prefix: '' - })); -} - -gulp.task('patch', [ ], function () { return inc('patch'); }) -gulp.task('minor', [ ], function () { return inc('minor'); }) -gulp.task('major', [ ], function () { return inc('major'); }) diff --git a/tools/eslint/node_modules/estraverse/package.json b/tools/eslint/node_modules/estraverse/package.json index c0a8b690c74c31..91c7179f8dfb36 100644 --- a/tools/eslint/node_modules/estraverse/package.json +++ b/tools/eslint/node_modules/estraverse/package.json @@ -1,12 +1,73 @@ { - "name": "estraverse", + "_args": [ + [ + "estraverse@^4.2.0", + "/Users/silverwind/git/node/tools/package/package" + ] + ], + "_from": "estraverse@>=4.2.0 <5.0.0", + "_id": "estraverse@4.2.0", + "_inCache": true, + "_installable": true, + "_location": "/estraverse", + "_nodeVersion": "0.12.9", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/estraverse-4.2.0.tgz_1457646738925_0.7118953282479197" + }, + "_npmUser": { + "email": "nicholas@nczconsulting.com", + "name": "nzakas" + }, + "_npmVersion": "2.14.9", + "_phantomChildren": {}, + "_requested": { + "name": "estraverse", + "raw": "estraverse@^4.2.0", + "rawSpec": "^4.2.0", + "scope": null, + "spec": ">=4.2.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/", + "/escope" + ], + "_resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "_shasum": "0dee3fed31fcd469618ce7342099fc1afa0bdb13", + "_shrinkwrap": null, + "_spec": "estraverse@^4.2.0", + "_where": "/Users/silverwind/git/node/tools/package/package", + "bugs": { + "url": "https://github.com/estools/estraverse/issues" + }, + "dependencies": {}, "description": "ECMAScript JS AST traversal functions", - "homepage": "https://github.com/estools/estraverse", - "main": "estraverse.js", - "version": "4.1.0", + "devDependencies": { + "babel-preset-es2015": "^6.3.13", + "babel-register": "^6.3.13", + "chai": "^2.1.1", + "espree": "^1.11.0", + "gulp": "^3.8.10", + "gulp-bump": "^0.2.2", + "gulp-filter": "^2.0.0", + "gulp-git": "^1.0.1", + "gulp-tag-version": "^1.2.1", + "jshint": "^2.5.6", + "mocha": "^2.1.0" + }, + "directories": {}, + "dist": { + "shasum": "0dee3fed31fcd469618ce7342099fc1afa0bdb13", + "tarball": "http://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz" + }, "engines": { "node": ">=0.10.0" }, + "gitHead": "6f6a4e99653908e859c7c10d04d9518bf4844ede", + "homepage": "https://github.com/estools/estraverse", + "license": "BSD-2-Clause", + "main": "estraverse.js", "maintainers": [ { "name": "constellation", @@ -15,53 +76,23 @@ { "name": "michaelficarra", "email": "npm@michael.ficarra.me" + }, + { + "name": "nzakas", + "email": "nicholas@nczconsulting.com" } ], + "name": "estraverse", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git+ssh://git@github.com/estools/estraverse.git" }, - "devDependencies": { - "chai": "^2.1.1", - "coffee-script": "^1.8.0", - "espree": "^1.11.0", - "gulp": "^3.8.10", - "gulp-bump": "^0.2.2", - "gulp-filter": "^2.0.0", - "gulp-git": "^1.0.1", - "gulp-tag-version": "^1.2.1", - "jshint": "^2.5.6", - "mocha": "^2.1.0" - }, - "licenses": [ - { - "type": "BSD", - "url": "http://github.com/estools/estraverse/raw/master/LICENSE.BSD" - } - ], "scripts": { - "test": "npm run-script lint && npm run-script unit-test", "lint": "jshint estraverse.js", - "unit-test": "mocha --compilers coffee:coffee-script/register" - }, - "gitHead": "347d52996336719b5910c7ffb5ff3ea8ecb87cf3", - "bugs": { - "url": "https://github.com/estools/estraverse/issues" - }, - "_id": "estraverse@4.1.0", - "_shasum": "40f23a76092041be6467d7f235c933b670766e05", - "_from": "estraverse@>=4.1.0 <5.0.0", - "_npmVersion": "2.8.3", - "_nodeVersion": "1.8.1", - "_npmUser": { - "name": "constellation", - "email": "utatane.tea@gmail.com" - }, - "dist": { - "shasum": "40f23a76092041be6467d7f235c933b670766e05", - "tarball": "http://registry.npmjs.org/estraverse/-/estraverse-4.1.0.tgz" + "test": "npm run-script lint && npm run-script unit-test", + "unit-test": "mocha --compilers js:babel-register" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.1.0.tgz", - "readme": "ERROR: No README data found!" + "version": "4.2.0" } diff --git a/tools/eslint/node_modules/js-yaml/node_modules/esprima/LICENSE.BSD b/tools/eslint/node_modules/esutils/LICENSE.BSD similarity index 100% rename from tools/eslint/node_modules/js-yaml/node_modules/esprima/LICENSE.BSD rename to tools/eslint/node_modules/esutils/LICENSE.BSD diff --git a/tools/eslint/node_modules/esutils/README.md b/tools/eslint/node_modules/esutils/README.md new file mode 100644 index 00000000000000..610d8bde66ff81 --- /dev/null +++ b/tools/eslint/node_modules/esutils/README.md @@ -0,0 +1,169 @@ +### esutils [![Build Status](https://secure.travis-ci.org/estools/esutils.svg)](http://travis-ci.org/estools/esutils) +esutils ([esutils](http://github.com/estools/esutils)) is +utility box for ECMAScript language tools. + +### API + +### ast + +#### ast.isExpression(node) + +Returns true if `node` is an Expression as defined in ECMA262 edition 5.1 section +[11](https://es5.github.io/#x11). + +#### ast.isStatement(node) + +Returns true if `node` is a Statement as defined in ECMA262 edition 5.1 section +[12](https://es5.github.io/#x12). + +#### ast.isIterationStatement(node) + +Returns true if `node` is an IterationStatement as defined in ECMA262 edition +5.1 section [12.6](https://es5.github.io/#x12.6). + +#### ast.isSourceElement(node) + +Returns true if `node` is a SourceElement as defined in ECMA262 edition 5.1 +section [14](https://es5.github.io/#x14). + +#### ast.trailingStatement(node) + +Returns `Statement?` if `node` has trailing `Statement`. +```js +if (cond) + consequent; +``` +When taking this `IfStatement`, returns `consequent;` statement. + +#### ast.isProblematicIfStatement(node) + +Returns true if `node` is a problematic IfStatement. If `node` is a problematic `IfStatement`, `node` cannot be represented as an one on one JavaScript code. +```js +{ + type: 'IfStatement', + consequent: { + type: 'WithStatement', + body: { + type: 'IfStatement', + consequent: {type: 'EmptyStatement'} + } + }, + alternate: {type: 'EmptyStatement'} +} +``` +The above node cannot be represented as a JavaScript code, since the top level `else` alternate belongs to an inner `IfStatement`. + + +### code + +#### code.isDecimalDigit(code) + +Return true if provided code is decimal digit. + +#### code.isHexDigit(code) + +Return true if provided code is hexadecimal digit. + +#### code.isOctalDigit(code) + +Return true if provided code is octal digit. + +#### code.isWhiteSpace(code) + +Return true if provided code is white space. White space characters are formally defined in ECMA262. + +#### code.isLineTerminator(code) + +Return true if provided code is line terminator. Line terminator characters are formally defined in ECMA262. + +#### code.isIdentifierStart(code) + +Return true if provided code can be the first character of ECMA262 Identifier. They are formally defined in ECMA262. + +#### code.isIdentifierPart(code) + +Return true if provided code can be the trailing character of ECMA262 Identifier. They are formally defined in ECMA262. + +### keyword + +#### keyword.isKeywordES5(id, strict) + +Returns `true` if provided identifier string is a Keyword or Future Reserved Word +in ECMA262 edition 5.1. They are formally defined in ECMA262 sections +[7.6.1.1](http://es5.github.io/#x7.6.1.1) and [7.6.1.2](http://es5.github.io/#x7.6.1.2), +respectively. If the `strict` flag is truthy, this function additionally checks whether +`id` is a Keyword or Future Reserved Word under strict mode. + +#### keyword.isKeywordES6(id, strict) + +Returns `true` if provided identifier string is a Keyword or Future Reserved Word +in ECMA262 edition 6. They are formally defined in ECMA262 sections +[11.6.2.1](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-keywords) and +[11.6.2.2](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-future-reserved-words), +respectively. If the `strict` flag is truthy, this function additionally checks whether +`id` is a Keyword or Future Reserved Word under strict mode. + +#### keyword.isReservedWordES5(id, strict) + +Returns `true` if provided identifier string is a Reserved Word in ECMA262 edition 5.1. +They are formally defined in ECMA262 section [7.6.1](http://es5.github.io/#x7.6.1). +If the `strict` flag is truthy, this function additionally checks whether `id` +is a Reserved Word under strict mode. + +#### keyword.isReservedWordES6(id, strict) + +Returns `true` if provided identifier string is a Reserved Word in ECMA262 edition 6. +They are formally defined in ECMA262 section [11.6.2](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-reserved-words). +If the `strict` flag is truthy, this function additionally checks whether `id` +is a Reserved Word under strict mode. + +#### keyword.isRestrictedWord(id) + +Returns `true` if provided identifier string is one of `eval` or `arguments`. +They are restricted in strict mode code throughout ECMA262 edition 5.1 and +in ECMA262 edition 6 section [12.1.1](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-identifiers-static-semantics-early-errors). + +#### keyword.isIdentifierName(id) + +Return true if provided identifier string is an IdentifierName as specified in +ECMA262 edition 5.1 section [7.6](https://es5.github.io/#x7.6). + +#### keyword.isIdentifierES5(id, strict) + +Return true if provided identifier string is an Identifier as specified in +ECMA262 edition 5.1 section [7.6](https://es5.github.io/#x7.6). If the `strict` +flag is truthy, this function additionally checks whether `id` is an Identifier +under strict mode. + +#### keyword.isIdentifierES6(id, strict) + +Return true if provided identifier string is an Identifier as specified in +ECMA262 edition 6 section [12.1](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-identifiers). +If the `strict` flag is truthy, this function additionally checks whether `id` +is an Identifier under strict mode. + +### License + +Copyright (C) 2013 [Yusuke Suzuki](http://github.com/Constellation) + (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/eslint/node_modules/esutils/lib/ast.js b/tools/eslint/node_modules/esutils/lib/ast.js new file mode 100644 index 00000000000000..8faadae1ce736d --- /dev/null +++ b/tools/eslint/node_modules/esutils/lib/ast.js @@ -0,0 +1,144 @@ +/* + Copyright (C) 2013 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +(function () { + 'use strict'; + + function isExpression(node) { + if (node == null) { return false; } + switch (node.type) { + case 'ArrayExpression': + case 'AssignmentExpression': + case 'BinaryExpression': + case 'CallExpression': + case 'ConditionalExpression': + case 'FunctionExpression': + case 'Identifier': + case 'Literal': + case 'LogicalExpression': + case 'MemberExpression': + case 'NewExpression': + case 'ObjectExpression': + case 'SequenceExpression': + case 'ThisExpression': + case 'UnaryExpression': + case 'UpdateExpression': + return true; + } + return false; + } + + function isIterationStatement(node) { + if (node == null) { return false; } + switch (node.type) { + case 'DoWhileStatement': + case 'ForInStatement': + case 'ForStatement': + case 'WhileStatement': + return true; + } + return false; + } + + function isStatement(node) { + if (node == null) { return false; } + switch (node.type) { + case 'BlockStatement': + case 'BreakStatement': + case 'ContinueStatement': + case 'DebuggerStatement': + case 'DoWhileStatement': + case 'EmptyStatement': + case 'ExpressionStatement': + case 'ForInStatement': + case 'ForStatement': + case 'IfStatement': + case 'LabeledStatement': + case 'ReturnStatement': + case 'SwitchStatement': + case 'ThrowStatement': + case 'TryStatement': + case 'VariableDeclaration': + case 'WhileStatement': + case 'WithStatement': + return true; + } + return false; + } + + function isSourceElement(node) { + return isStatement(node) || node != null && node.type === 'FunctionDeclaration'; + } + + function trailingStatement(node) { + switch (node.type) { + case 'IfStatement': + if (node.alternate != null) { + return node.alternate; + } + return node.consequent; + + case 'LabeledStatement': + case 'ForStatement': + case 'ForInStatement': + case 'WhileStatement': + case 'WithStatement': + return node.body; + } + return null; + } + + function isProblematicIfStatement(node) { + var current; + + if (node.type !== 'IfStatement') { + return false; + } + if (node.alternate == null) { + return false; + } + current = node.consequent; + do { + if (current.type === 'IfStatement') { + if (current.alternate == null) { + return true; + } + } + current = trailingStatement(current); + } while (current); + + return false; + } + + module.exports = { + isExpression: isExpression, + isStatement: isStatement, + isIterationStatement: isIterationStatement, + isSourceElement: isSourceElement, + isProblematicIfStatement: isProblematicIfStatement, + + trailingStatement: trailingStatement + }; +}()); +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/eslint/node_modules/esutils/lib/code.js b/tools/eslint/node_modules/esutils/lib/code.js new file mode 100644 index 00000000000000..2a7c19d63c89b3 --- /dev/null +++ b/tools/eslint/node_modules/esutils/lib/code.js @@ -0,0 +1,135 @@ +/* + Copyright (C) 2013-2014 Yusuke Suzuki + Copyright (C) 2014 Ivan Nikulin + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +(function () { + 'use strict'; + + var ES6Regex, ES5Regex, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch; + + // See `tools/generate-identifier-regex.js`. + ES5Regex = { + // ECMAScript 5.1/Unicode v7.0.0 NonAsciiIdentifierStart: + NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/, + // ECMAScript 5.1/Unicode v7.0.0 NonAsciiIdentifierPart: + NonAsciiIdentifierPart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/ + }; + + ES6Regex = { + // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierStart: + NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]/, + // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierPart: + NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDD0-\uDDDA\uDE00-\uDE11\uDE13-\uDE37\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF01-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ + }; + + function isDecimalDigit(ch) { + return 0x30 <= ch && ch <= 0x39; // 0..9 + } + + function isHexDigit(ch) { + return 0x30 <= ch && ch <= 0x39 || // 0..9 + 0x61 <= ch && ch <= 0x66 || // a..f + 0x41 <= ch && ch <= 0x46; // A..F + } + + function isOctalDigit(ch) { + return ch >= 0x30 && ch <= 0x37; // 0..7 + } + + // 7.2 White Space + + NON_ASCII_WHITESPACES = [ + 0x1680, 0x180E, + 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, + 0x202F, 0x205F, + 0x3000, + 0xFEFF + ]; + + function isWhiteSpace(ch) { + return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 || + ch >= 0x1680 && NON_ASCII_WHITESPACES.indexOf(ch) >= 0; + } + + // 7.3 Line Terminators + + function isLineTerminator(ch) { + return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029; + } + + // 7.6 Identifier Names and Identifiers + + function fromCodePoint(cp) { + if (cp <= 0xFFFF) { return String.fromCharCode(cp); } + var cu1 = String.fromCharCode(Math.floor((cp - 0x10000) / 0x400) + 0xD800); + var cu2 = String.fromCharCode(((cp - 0x10000) % 0x400) + 0xDC00); + return cu1 + cu2; + } + + IDENTIFIER_START = new Array(0x80); + for(ch = 0; ch < 0x80; ++ch) { + IDENTIFIER_START[ch] = + ch >= 0x61 && ch <= 0x7A || // a..z + ch >= 0x41 && ch <= 0x5A || // A..Z + ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore) + } + + IDENTIFIER_PART = new Array(0x80); + for(ch = 0; ch < 0x80; ++ch) { + IDENTIFIER_PART[ch] = + ch >= 0x61 && ch <= 0x7A || // a..z + ch >= 0x41 && ch <= 0x5A || // A..Z + ch >= 0x30 && ch <= 0x39 || // 0..9 + ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore) + } + + function isIdentifierStartES5(ch) { + return ch < 0x80 ? IDENTIFIER_START[ch] : ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch)); + } + + function isIdentifierPartES5(ch) { + return ch < 0x80 ? IDENTIFIER_PART[ch] : ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch)); + } + + function isIdentifierStartES6(ch) { + return ch < 0x80 ? IDENTIFIER_START[ch] : ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch)); + } + + function isIdentifierPartES6(ch) { + return ch < 0x80 ? IDENTIFIER_PART[ch] : ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch)); + } + + module.exports = { + isDecimalDigit: isDecimalDigit, + isHexDigit: isHexDigit, + isOctalDigit: isOctalDigit, + isWhiteSpace: isWhiteSpace, + isLineTerminator: isLineTerminator, + isIdentifierStartES5: isIdentifierStartES5, + isIdentifierPartES5: isIdentifierPartES5, + isIdentifierStartES6: isIdentifierStartES6, + isIdentifierPartES6: isIdentifierPartES6 + }; +}()); +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/eslint/node_modules/esutils/lib/keyword.js b/tools/eslint/node_modules/esutils/lib/keyword.js new file mode 100644 index 00000000000000..13c8c6a967caf0 --- /dev/null +++ b/tools/eslint/node_modules/esutils/lib/keyword.js @@ -0,0 +1,165 @@ +/* + Copyright (C) 2013 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +(function () { + 'use strict'; + + var code = require('./code'); + + function isStrictModeReservedWordES6(id) { + switch (id) { + case 'implements': + case 'interface': + case 'package': + case 'private': + case 'protected': + case 'public': + case 'static': + case 'let': + return true; + default: + return false; + } + } + + function isKeywordES5(id, strict) { + // yield should not be treated as keyword under non-strict mode. + if (!strict && id === 'yield') { + return false; + } + return isKeywordES6(id, strict); + } + + function isKeywordES6(id, strict) { + if (strict && isStrictModeReservedWordES6(id)) { + return true; + } + + switch (id.length) { + case 2: + return (id === 'if') || (id === 'in') || (id === 'do'); + case 3: + return (id === 'var') || (id === 'for') || (id === 'new') || (id === 'try'); + case 4: + return (id === 'this') || (id === 'else') || (id === 'case') || + (id === 'void') || (id === 'with') || (id === 'enum'); + case 5: + return (id === 'while') || (id === 'break') || (id === 'catch') || + (id === 'throw') || (id === 'const') || (id === 'yield') || + (id === 'class') || (id === 'super'); + case 6: + return (id === 'return') || (id === 'typeof') || (id === 'delete') || + (id === 'switch') || (id === 'export') || (id === 'import'); + case 7: + return (id === 'default') || (id === 'finally') || (id === 'extends'); + case 8: + return (id === 'function') || (id === 'continue') || (id === 'debugger'); + case 10: + return (id === 'instanceof'); + default: + return false; + } + } + + function isReservedWordES5(id, strict) { + return id === 'null' || id === 'true' || id === 'false' || isKeywordES5(id, strict); + } + + function isReservedWordES6(id, strict) { + return id === 'null' || id === 'true' || id === 'false' || isKeywordES6(id, strict); + } + + function isRestrictedWord(id) { + return id === 'eval' || id === 'arguments'; + } + + function isIdentifierNameES5(id) { + var i, iz, ch; + + if (id.length === 0) { return false; } + + ch = id.charCodeAt(0); + if (!code.isIdentifierStartES5(ch)) { + return false; + } + + for (i = 1, iz = id.length; i < iz; ++i) { + ch = id.charCodeAt(i); + if (!code.isIdentifierPartES5(ch)) { + return false; + } + } + return true; + } + + function decodeUtf16(lead, trail) { + return (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; + } + + function isIdentifierNameES6(id) { + var i, iz, ch, lowCh, check; + + if (id.length === 0) { return false; } + + check = code.isIdentifierStartES6; + for (i = 0, iz = id.length; i < iz; ++i) { + ch = id.charCodeAt(i); + if (0xD800 <= ch && ch <= 0xDBFF) { + ++i; + if (i >= iz) { return false; } + lowCh = id.charCodeAt(i); + if (!(0xDC00 <= lowCh && lowCh <= 0xDFFF)) { + return false; + } + ch = decodeUtf16(ch, lowCh); + } + if (!check(ch)) { + return false; + } + check = code.isIdentifierPartES6; + } + return true; + } + + function isIdentifierES5(id, strict) { + return isIdentifierNameES5(id) && !isReservedWordES5(id, strict); + } + + function isIdentifierES6(id, strict) { + return isIdentifierNameES6(id) && !isReservedWordES6(id, strict); + } + + module.exports = { + isKeywordES5: isKeywordES5, + isKeywordES6: isKeywordES6, + isReservedWordES5: isReservedWordES5, + isReservedWordES6: isReservedWordES6, + isRestrictedWord: isRestrictedWord, + isIdentifierNameES5: isIdentifierNameES5, + isIdentifierNameES6: isIdentifierNameES6, + isIdentifierES5: isIdentifierES5, + isIdentifierES6: isIdentifierES6 + }; +}()); +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/eslint/node_modules/esutils/lib/utils.js b/tools/eslint/node_modules/esutils/lib/utils.js new file mode 100644 index 00000000000000..ce18faa6bc80fa --- /dev/null +++ b/tools/eslint/node_modules/esutils/lib/utils.js @@ -0,0 +1,33 @@ +/* + Copyright (C) 2013 Yusuke Suzuki + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +(function () { + 'use strict'; + + exports.ast = require('./ast'); + exports.code = require('./code'); + exports.keyword = require('./keyword'); +}()); +/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/tools/eslint/node_modules/esutils/package.json b/tools/eslint/node_modules/esutils/package.json new file mode 100644 index 00000000000000..74b5ae3f36a52a --- /dev/null +++ b/tools/eslint/node_modules/esutils/package.json @@ -0,0 +1,97 @@ +{ + "_args": [ + [ + "esutils@^2.0.2", + "/Users/silverwind/git/node/tools/package/package" + ] + ], + "_from": "esutils@>=2.0.2 <3.0.0", + "_id": "esutils@2.0.2", + "_inCache": true, + "_installable": true, + "_location": "/esutils", + "_nodeVersion": "0.12.0", + "_npmUser": { + "email": "npm@michael.ficarra.me", + "name": "michaelficarra" + }, + "_npmVersion": "2.5.1", + "_phantomChildren": {}, + "_requested": { + "name": "esutils", + "raw": "esutils@^2.0.2", + "rawSpec": "^2.0.2", + "scope": null, + "spec": ">=2.0.2 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "_shasum": "0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b", + "_shrinkwrap": null, + "_spec": "esutils@^2.0.2", + "_where": "/Users/silverwind/git/node/tools/package/package", + "bugs": { + "url": "https://github.com/estools/esutils/issues" + }, + "dependencies": {}, + "description": "utility box for ECMAScript language tools", + "devDependencies": { + "chai": "~1.7.2", + "coffee-script": "~1.6.3", + "jshint": "2.6.3", + "mocha": "~2.2.1", + "regenerate": "~1.2.1", + "unicode-7.0.0": "^0.1.5" + }, + "directories": { + "lib": "./lib" + }, + "dist": { + "shasum": "0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b", + "tarball": "http://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "LICENSE.BSD", + "README.md", + "lib" + ], + "gitHead": "3ffd1c403f3f29db9e8a9574b1895682e57b6a7f", + "homepage": "https://github.com/estools/esutils", + "licenses": [ + { + "type": "BSD", + "url": "http://github.com/estools/esutils/raw/master/LICENSE.BSD" + } + ], + "main": "lib/utils.js", + "maintainers": [ + { + "name": "constellation", + "email": "utatane.tea@gmail.com" + }, + { + "name": "michaelficarra", + "email": "npm@michael.ficarra.me" + } + ], + "name": "esutils", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/estools/esutils.git" + }, + "scripts": { + "generate-regex": "node tools/generate-identifier-regex.js", + "lint": "jshint lib/*.js", + "test": "npm run-script lint && npm run-script unit-test", + "unit-test": "mocha --compilers coffee:coffee-script -R spec" + }, + "version": "2.0.2" +} diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/.lint b/tools/eslint/node_modules/event-emitter/.lint similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/.lint rename to tools/eslint/node_modules/event-emitter/.lint diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/.testignore b/tools/eslint/node_modules/event-emitter/.testignore similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/.testignore rename to tools/eslint/node_modules/event-emitter/.testignore diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/LICENSE b/tools/eslint/node_modules/event-emitter/LICENSE similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/LICENSE rename to tools/eslint/node_modules/event-emitter/LICENSE diff --git a/tools/eslint/node_modules/event-emitter/README.md b/tools/eslint/node_modules/event-emitter/README.md new file mode 100644 index 00000000000000..5ad489c0f0c7e3 --- /dev/null +++ b/tools/eslint/node_modules/event-emitter/README.md @@ -0,0 +1,95 @@ +# event-emitter +## Environment agnostic event emitter + +### Installation + + $ npm install event-emitter + +To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/) + +### Usage + +```javascript +var ee = require('event-emitter'); + +var emitter = ee({}), listener; + +emitter.on('test', listener = function (args) { + // …emitter logic +}); + +emitter.once('test', function (args) { + // …invoked only once(!) +}); + +emitter.emit('test', arg1, arg2/*…args*/); // Two above listeners invoked +emitter.emit('test', arg1, arg2/*…args*/); // Only first listener invoked + +emitter.off('test', listener); // Removed first listener +emitter.emit('test', arg1, arg2/*…args*/); // No listeners invoked +``` +### Additional utilities + +#### allOff(obj) _(event-emitter/all-off)_ + +Removes all listeners from given event emitter object + +#### hasListeners(obj[, name]) _(event-emitter/has-listeners)_ + +Whether object has some listeners attached to the object. +When `name` is provided, it checks listeners for specific event name + +```javascript +var emitter = ee(); +var hasListeners = require('event-emitter/has-listeners'); +var listener = function () {}; + +hasListeners(emitter); // false + +emitter.on('foo', listener); +hasListeners(emitter); // true +hasListeners(emitter, 'foo'); // true +hasListeners(emitter, 'bar'); // false + +emitter.off('foo', listener); +hasListeners(emitter, 'foo'); // false +``` + +#### pipe(source, target[, emitMethodName]) _(event-emitter/pipe)_ + +Pipes all events from _source_ emitter onto _target_ emitter (all events from _source_ emitter will be emitted also on _target_ emitter, but not other way). +Returns _pipe_ object which exposes `pipe.close` function. Invoke it to close configured _pipe_. +It works internally by redefinition of `emit` method, if in your interface this method is referenced differently, provide its name (or symbol) with third argument. + +#### unify(emitter1, emitter2) _(event-emitter/unify)_ + +Unifies event handling for two objects. Events emitted on _emitter1_ would be also emitter on _emitter2_, and other way back. +Non reversible. + +```javascript +var eeUnify = require('event-emitter/unify'); + +var emitter1 = ee(), listener1, listener3; +var emitter2 = ee(), listener2, listener4; + +emitter1.on('test', listener1 = function () { }); +emitter2.on('test', listener2 = function () { }); + +emitter1.emit('test'); // Invoked listener1 +emitter2.emit('test'); // Invoked listener2 + +var unify = eeUnify(emitter1, emitter2); + +emitter1.emit('test'); // Invoked listener1 and listener2 +emitter2.emit('test'); // Invoked listener1 and listener2 + +emitter1.on('test', listener3 = function () { }); +emitter2.on('test', listener4 = function () { }); + +emitter1.emit('test'); // Invoked listener1, listener2, listener3 and listener4 +emitter2.emit('test'); // Invoked listener1, listener2, listener3 and listener4 +``` + +### Tests [![Build Status](https://travis-ci.org/medikoo/event-emitter.png)](https://travis-ci.org/medikoo/event-emitter) + + $ npm test diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/all-off.js b/tools/eslint/node_modules/event-emitter/all-off.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/all-off.js rename to tools/eslint/node_modules/event-emitter/all-off.js diff --git a/tools/eslint/node_modules/event-emitter/emit-error.js b/tools/eslint/node_modules/event-emitter/emit-error.js new file mode 100644 index 00000000000000..769b4c53e1dd65 --- /dev/null +++ b/tools/eslint/node_modules/event-emitter/emit-error.js @@ -0,0 +1,13 @@ +'use strict'; + +var ensureError = require('es5-ext/error/valid-error') + , ensureObject = require('es5-ext/object/valid-object') + + , hasOwnProperty = Object.prototype.hasOwnProperty; + +module.exports = function (err) { + (ensureObject(this) && ensureError(err)); + if (!hasOwnProperty.call(ensureObject(this), '__ee__')) throw err; + if (!this.__ee__.error) throw err; + this.emit('error', err); +}; diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/has-listeners.js b/tools/eslint/node_modules/event-emitter/has-listeners.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/has-listeners.js rename to tools/eslint/node_modules/event-emitter/has-listeners.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/index.js b/tools/eslint/node_modules/event-emitter/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/index.js rename to tools/eslint/node_modules/event-emitter/index.js diff --git a/tools/eslint/node_modules/event-emitter/package.json b/tools/eslint/node_modules/event-emitter/package.json new file mode 100644 index 00000000000000..bb1914b8c4568e --- /dev/null +++ b/tools/eslint/node_modules/event-emitter/package.json @@ -0,0 +1,91 @@ +{ + "_args": [ + [ + "event-emitter@~0.3.4", + "/Users/silverwind/git/node/tools/package/package/node_modules/es6-map" + ] + ], + "_from": "event-emitter@>=0.3.4 <0.4.0", + "_id": "event-emitter@0.3.4", + "_inCache": true, + "_installable": true, + "_location": "/event-emitter", + "_nodeVersion": "4.1.1", + "_npmUser": { + "email": "medikoo+npm@medikoo.com", + "name": "medikoo" + }, + "_npmVersion": "2.14.4", + "_phantomChildren": {}, + "_requested": { + "name": "event-emitter", + "raw": "event-emitter@~0.3.4", + "rawSpec": "~0.3.4", + "scope": null, + "spec": ">=0.3.4 <0.4.0", + "type": "range" + }, + "_requiredBy": [ + "/es6-map", + "/es6-set" + ], + "_resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.4.tgz", + "_shasum": "8d63ddfb4cfe1fae3b32ca265c4c720222080bb5", + "_shrinkwrap": null, + "_spec": "event-emitter@~0.3.4", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/es6-map", + "author": { + "email": "medyk@medikoo.com", + "name": "Mariusz Nowak", + "url": "http://www.medikoo.com/" + }, + "bugs": { + "url": "https://github.com/medikoo/event-emitter/issues" + }, + "dependencies": { + "d": "~0.1.1", + "es5-ext": "~0.10.7" + }, + "description": "Environment agnostic event emitter", + "devDependencies": { + "tad": "~0.2.3", + "xlint": "~0.2.2", + "xlint-jslint-medikoo": "~0.1.4" + }, + "directories": {}, + "dist": { + "shasum": "8d63ddfb4cfe1fae3b32ca265c4c720222080bb5", + "tarball": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.4.tgz" + }, + "gitHead": "adc27b543a53528b9af8a82f7c88db3292f0faa0", + "homepage": "https://github.com/medikoo/event-emitter#readme", + "keywords": [ + "emitter", + "event", + "events", + "listener", + "observer", + "pubsub", + "trigger" + ], + "license": "MIT", + "maintainers": [ + { + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" + } + ], + "name": "event-emitter", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/medikoo/event-emitter.git" + }, + "scripts": { + "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream", + "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", + "test": "node ./node_modules/tad/bin/tad" + }, + "version": "0.3.4" +} diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/pipe.js b/tools/eslint/node_modules/event-emitter/pipe.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/pipe.js rename to tools/eslint/node_modules/event-emitter/pipe.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/unify.js b/tools/eslint/node_modules/event-emitter/unify.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/unify.js rename to tools/eslint/node_modules/event-emitter/unify.js diff --git a/tools/eslint/node_modules/exit-hook/index.js b/tools/eslint/node_modules/exit-hook/index.js new file mode 100644 index 00000000000000..e18013fdb7c87a --- /dev/null +++ b/tools/eslint/node_modules/exit-hook/index.js @@ -0,0 +1,30 @@ +'use strict'; + +var cbs = []; +var called = false; + +function exit(exit, signal) { + if (called) { + return; + } + + called = true; + + cbs.forEach(function (el) { + el(); + }); + + if (exit === true) { + process.exit(128 + signal); + } +}; + +module.exports = function (cb) { + cbs.push(cb); + + if (cbs.length === 1) { + process.once('exit', exit); + process.once('SIGINT', exit.bind(null, true, 2)); + process.once('SIGTERM', exit.bind(null, true, 15)); + } +}; diff --git a/tools/eslint/node_modules/exit-hook/package.json b/tools/eslint/node_modules/exit-hook/package.json new file mode 100644 index 00000000000000..ebf49d5d5ef08e --- /dev/null +++ b/tools/eslint/node_modules/exit-hook/package.json @@ -0,0 +1,93 @@ +{ + "_args": [ + [ + "exit-hook@^1.0.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/restore-cursor" + ] + ], + "_from": "exit-hook@>=1.0.0 <2.0.0", + "_id": "exit-hook@1.1.1", + "_inCache": true, + "_installable": true, + "_location": "/exit-hook", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_npmVersion": "1.4.9", + "_phantomChildren": {}, + "_requested": { + "name": "exit-hook", + "raw": "exit-hook@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/restore-cursor" + ], + "_resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", + "_shasum": "f05ca233b48c05d54fff07765df8507e95c02ff8", + "_shrinkwrap": null, + "_spec": "exit-hook@^1.0.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/restore-cursor", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "http://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/exit-hook/issues" + }, + "dependencies": {}, + "description": "Run some code when the process exits", + "devDependencies": { + "ava": "0.0.4" + }, + "directories": {}, + "dist": { + "shasum": "f05ca233b48c05d54fff07765df8507e95c02ff8", + "tarball": "http://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/exit-hook", + "keywords": [ + "event", + "exit", + "graceful", + "handler", + "hook", + "kill", + "process", + "quit", + "shutdown", + "sigint", + "sigterm", + "stop", + "terminate" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "exit-hook", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/sindresorhus/exit-hook.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.1.1" +} diff --git a/tools/eslint/node_modules/exit-hook/readme.md b/tools/eslint/node_modules/exit-hook/readme.md new file mode 100644 index 00000000000000..4dc64b9c5f42b0 --- /dev/null +++ b/tools/eslint/node_modules/exit-hook/readme.md @@ -0,0 +1,40 @@ +# exit-hook [![Build Status](https://travis-ci.org/sindresorhus/exit-hook.svg?branch=master)](https://travis-ci.org/sindresorhus/exit-hook) + +> Run some code when the process exits + +The `process.on('exit')` event doesn't catch all the ways a process can exit. + +Useful for cleaning up. + + +## Install + +```sh +$ npm install --save exit-hook +``` + + +## Usage + +```js +var exitHook = require('exit-hook'); + +exitHook(function () { + console.log('exiting'); +}); + +// you can add multiple hooks, even across files +exitHook(function () { + console.log('exiting 2'); +}); + +throw new Error('unicorns'); + +//=> exiting +//=> exiting 2 +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/eslint/node_modules/fast-levenshtein/LICENSE.md b/tools/eslint/node_modules/fast-levenshtein/LICENSE.md new file mode 100644 index 00000000000000..79b86692645bc2 --- /dev/null +++ b/tools/eslint/node_modules/fast-levenshtein/LICENSE.md @@ -0,0 +1,24 @@ +(MIT License) + +Copyright (c) 2013 [Ramesh Nair](http://www.hiddentao.com/) + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/tools/eslint/node_modules/optionator/node_modules/fast-levenshtein/README.md b/tools/eslint/node_modules/fast-levenshtein/README.md similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/fast-levenshtein/README.md rename to tools/eslint/node_modules/fast-levenshtein/README.md diff --git a/tools/eslint/node_modules/optionator/node_modules/fast-levenshtein/levenshtein.js b/tools/eslint/node_modules/fast-levenshtein/levenshtein.js similarity index 95% rename from tools/eslint/node_modules/optionator/node_modules/fast-levenshtein/levenshtein.js rename to tools/eslint/node_modules/fast-levenshtein/levenshtein.js index 0028f405ac4bfe..9d8cdc87f7ebd9 100644 --- a/tools/eslint/node_modules/optionator/node_modules/fast-levenshtein/levenshtein.js +++ b/tools/eslint/node_modules/fast-levenshtein/levenshtein.js @@ -21,6 +21,19 @@ return dst; }; + + /** + * Defer execution of given function. + * @param {Function} func + */ + var _defer = function(func) { + if (typeof setImmediate === 'function') { + return setImmediate(func); + } else { + return setTimeout(func, 0); + } + }; + /** * Based on the algorithm at http://en.wikipedia.org/wiki/Levenshtein_distance. */ @@ -168,7 +181,7 @@ } // next iteration - setTimeout(__calculate(), 0); + _defer(__calculate); }; __calculate(); @@ -195,4 +208,3 @@ window.Levenshtein = Levenshtein; } }()); - diff --git a/tools/eslint/node_modules/fast-levenshtein/package.json b/tools/eslint/node_modules/fast-levenshtein/package.json new file mode 100644 index 00000000000000..7425a2655d5a61 --- /dev/null +++ b/tools/eslint/node_modules/fast-levenshtein/package.json @@ -0,0 +1,94 @@ +{ + "_args": [ + [ + "fast-levenshtein@^1.1.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/optionator" + ] + ], + "_from": "fast-levenshtein@>=1.1.0 <2.0.0", + "_id": "fast-levenshtein@1.1.3", + "_inCache": true, + "_installable": true, + "_location": "/fast-levenshtein", + "_nodeVersion": "0.12.9", + "_npmUser": { + "email": "ram@hiddentao.com", + "name": "hiddentao" + }, + "_npmVersion": "2.14.9", + "_phantomChildren": {}, + "_requested": { + "name": "fast-levenshtein", + "raw": "fast-levenshtein@^1.1.0", + "rawSpec": "^1.1.0", + "scope": null, + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/optionator" + ], + "_resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-1.1.3.tgz", + "_shasum": "2ae7b32abc1e612da48a4e13849b888a2f61e7e9", + "_shrinkwrap": null, + "_spec": "fast-levenshtein@^1.1.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/optionator", + "author": { + "email": "ram@hiddentao.com", + "name": "Ramesh Nair", + "url": "http://www.hiddentao.com/" + }, + "bugs": { + "url": "https://github.com/hiddentao/fast-levenshtein/issues" + }, + "dependencies": {}, + "description": "Efficient implementation of Levenshtein algorithm with asynchronous callback support", + "devDependencies": { + "chai": "~1.5.0", + "grunt": "~0.4.1", + "grunt-benchmark": "~0.2.0", + "grunt-contrib-jshint": "~0.4.3", + "grunt-contrib-uglify": "~0.2.0", + "grunt-mocha-test": "~0.2.2", + "grunt-npm-install": "~0.1.0", + "load-grunt-tasks": "~0.6.0", + "lodash": "^4.0.1", + "mocha": "~1.9.0" + }, + "directories": {}, + "dist": { + "shasum": "2ae7b32abc1e612da48a4e13849b888a2f61e7e9", + "tarball": "http://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-1.1.3.tgz" + }, + "files": [ + "levenshtein.js" + ], + "gitHead": "bce911eb885fb52e37b1be793c22cfaf88d580d2", + "homepage": "https://github.com/hiddentao/fast-levenshtein#readme", + "keywords": [ + "distance", + "levenshtein", + "string" + ], + "license": "MIT", + "main": "levenshtein.js", + "maintainers": [ + { + "name": "hiddentao", + "email": "ram@hiddentao.com" + } + ], + "name": "fast-levenshtein", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/hiddentao/fast-levenshtein.git" + }, + "scripts": { + "benchmark": "grunt benchmark", + "build": "grunt build", + "test": "mocha" + }, + "version": "1.1.3" +} diff --git a/tools/eslint/node_modules/figures/index.js b/tools/eslint/node_modules/figures/index.js new file mode 100644 index 00000000000000..edfeff273d8e26 --- /dev/null +++ b/tools/eslint/node_modules/figures/index.js @@ -0,0 +1,91 @@ +'use strict'; +var platform = process.platform; + +var main = { + tick: '✔', + cross: '✖', + star: '★', + square: '▇', + squareSmall: '◻', + squareSmallFilled: '◼', + play: '▶', + circle: '◯', + circleFilled: '◉', + circleDotted: '◌', + circleDouble: '◎', + circleCircle: 'ⓞ', + circleCross: 'ⓧ', + circlePipe: 'Ⓘ', + circleQuestionMark: '?⃝', + bullet: '●', + dot: '․', + line: '─', + ellipsis: '…', + pointer: '❯', + pointerSmall: '›', + info: 'ℹ', + warning: '⚠', + hamburger: '☰', + smiley: '㋡', + mustache: '෴', + heart: '♥', + arrowUp: '↑', + arrowDown: '↓', + arrowLeft: '←', + arrowRight: '→', + radioOn: '◉', + radioOff: '◯', + checkboxOn: '☒', + checkboxOff: '☐', + checkboxCircleOn: 'ⓧ', + checkboxCircleOff: 'Ⓘ', + questionMarkPrefix: '?⃝' +}; + +var win = { + tick: '√', + cross: '×', + star: '*', + square: '█', + squareSmall: '[ ]', + squareSmallFilled: '[█]', + play: '►', + circle: '( )', + circleFilled: '(*)', + circleDotted: '( )', + circleDouble: '( )', + circleCircle: '(○)', + circleCross: '(×)', + circlePipe: '(│)', + circleQuestionMark: '(?)', + bullet: '*', + dot: '.', + line: '─', + ellipsis: '...', + pointer: '>', + pointerSmall: '»', + info: 'i', + warning: '‼', + hamburger: '≡', + smiley: '☺', + mustache: '┌─┐', + heart: main.heart, + arrowUp: main.arrowUp, + arrowDown: main.arrowDown, + arrowLeft: main.arrowLeft, + arrowRight: main.arrowRight, + radioOn: '(*)', + radioOff: '( )', + checkboxOn: '[×]', + checkboxOff: '[ ]', + checkboxCircleOn: '(×)', + checkboxCircleOff: '( )', + questionMarkPrefix: '?' +}; + +if (platform === 'linux') { + // the main one doesn't look that good on Ubuntu + main.questionMarkPrefix = '?'; +} + +module.exports = platform === 'win32' ? win : main; diff --git a/tools/eslint/node_modules/figures/license b/tools/eslint/node_modules/figures/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/tools/eslint/node_modules/figures/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tools/eslint/node_modules/figures/package.json b/tools/eslint/node_modules/figures/package.json new file mode 100644 index 00000000000000..2ddb1377bbaa6d --- /dev/null +++ b/tools/eslint/node_modules/figures/package.json @@ -0,0 +1,98 @@ +{ + "_args": [ + [ + "figures@^1.3.5", + "/Users/silverwind/git/node/tools/package/package/node_modules/inquirer" + ] + ], + "_from": "figures@>=1.3.5 <2.0.0", + "_id": "figures@1.5.0", + "_inCache": true, + "_installable": true, + "_location": "/figures", + "_nodeVersion": "5.6.0", + "_npmOperationalInternal": { + "host": "packages-13-west.internal.npmjs.com", + "tmp": "tmp/figures-1.5.0.tgz_1458741326698_0.9015887144487351" + }, + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_npmVersion": "3.6.0", + "_phantomChildren": {}, + "_requested": { + "name": "figures", + "raw": "figures@^1.3.5", + "rawSpec": "^1.3.5", + "scope": null, + "spec": ">=1.3.5 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/inquirer" + ], + "_resolved": "https://registry.npmjs.org/figures/-/figures-1.5.0.tgz", + "_shasum": "56d8a0949c19643af764d573a648d384218da737", + "_shrinkwrap": null, + "_spec": "figures@^1.3.5", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/inquirer", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/figures/issues" + }, + "dependencies": {}, + "description": "Unicode symbols with Windows CMD fallbacks", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "56d8a0949c19643af764d573a648d384218da737", + "tarball": "http://registry.npmjs.org/figures/-/figures-1.5.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "0f0ec0620de08ed4e1b1ab7073cb2e1104c246e8", + "homepage": "https://github.com/sindresorhus/figures#readme", + "keywords": [ + "char", + "characters", + "cli", + "cmd", + "command-line", + "fallback", + "figure", + "figures", + "symbol", + "symbols", + "unicode" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "figures", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/figures.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.5.0" +} diff --git a/tools/eslint/node_modules/figures/readme.md b/tools/eslint/node_modules/figures/readme.md new file mode 100644 index 00000000000000..88e2531d7b41c6 --- /dev/null +++ b/tools/eslint/node_modules/figures/readme.md @@ -0,0 +1,34 @@ +# figures [![Build Status](https://travis-ci.org/sindresorhus/figures.svg?branch=master)](https://travis-ci.org/sindresorhus/figures) + +> Unicode symbols with Windows CMD fallbacks + +[![](screenshot.png)](index.js) + +[*and more...*](index.js) + +Windows CMD only supports a [limited character set](http://en.wikipedia.org/wiki/Code_page_437). + + +## Install + +``` +$ npm install --save figures +``` + + +## Usage + +See the [source](index.js) for supported symbols. + +```js +const figures = require('figures'); + +console.log(figures.tick); +// On real OSes: ✔︎ +// On Windows: √ +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/eslint/node_modules/file-entry-cache/LICENSE b/tools/eslint/node_modules/file-entry-cache/LICENSE new file mode 100644 index 00000000000000..7394b8ff84b090 --- /dev/null +++ b/tools/eslint/node_modules/file-entry-cache/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Roy Riojas + +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/eslint/node_modules/file-entry-cache/README.md b/tools/eslint/node_modules/file-entry-cache/README.md new file mode 100644 index 00000000000000..842ef1e158fb00 --- /dev/null +++ b/tools/eslint/node_modules/file-entry-cache/README.md @@ -0,0 +1,94 @@ +# file-entry-cache +> Super simple cache for file metadata, useful for process that work o a given series of files +> and that only need to repeat the job on the changed ones since the previous run of the process — Edit + +[![NPM Version](http://img.shields.io/npm/v/file-entry-cache.svg?style=flat)](https://npmjs.org/package/file-entry-cache) +[![Build Status](http://img.shields.io/travis/royriojas/file-entry-cache.svg?style=flat)](https://travis-ci.org/royriojas/file-entry-cache) + +## install + +```bash +npm i --save file-entry-cache +``` + +## Usage + +```js +// loads the cache, if one does not exists for the given +// Id a new one will be prepared to be created +var fileEntryCache = require('file-entry-cache'); + +var cache = fileEntryCache.create('testCache'); + +var files = expand('../fixtures/*.txt'); + +// the first time this method is called, will return all the files +var oFiles = cache.getUpdatedFiles(files); + +// this will persist this to disk checking each file stats and +// updating the meta attributes `size` and `mtime`. +// custom fields could also be added to the meta object and will be persisted +// in order to retrieve them later +cache.reconcile(); + +// on a second run +var cache2 = fileEntryCache.create('testCache'); + +// will return now only the files that were modified or none +// if no files were modified previous to the execution of this function +var oFiles = cache.getUpdatedFiles(files); + +// if you want to prevent a file from being considered non modified +// something useful if a file failed some sort of validation +// you can then remove the entry from the cache doing +cache.removeEntry('path/to/file'); // path to file should be the same path of the file received on `getUpdatedFiles` +// that will effectively make the file to appear again as modified until the validation is passed. In that +// case you should not remove it from the cache + +// if you need all the files, so you can determine what to do with the changed ones +// you can call +var oFiles = cache.normalizeEntries(files); + +// oFiles will be an array of objects like the following +entry = { + key: 'some/name/file', the path to the file + changed: true, // if the file was changed since previous run + meta: { + size: 3242, // the size of the file + mtime: 231231231, // the modification time of the file + data: {} // some extra field stored for this file (useful to save the result of a transformation on the file + } +} + +``` + +## Motivation for this module + +I needed a super simple and dumb **in-memory cache** with optional disk persistence (write-back cache) in order to make +a script that will beautify files with `esformatter` to execute only on the files that were changed since the last run. + +In doing so the process of beautifying files was reduced from several seconds to a small fraction of a second. + +This module uses [flat-cache](https://www.npmjs.com/package/flat-cache) a super simple `key/value` cache storage with +optional file persistance. + +The main idea is to read the files when the task begins, apply the transforms required, and if the process succeed, +then store the new state of the files. The next time this module request for `getChangedFiles` will return only +the files that were modified. Making the process to end faster. + +This module could also be used by processes that modify the files applying a transform, in that case the result of the +transform could be stored in the `meta` field, of the entries. Anything added to the meta field will be persisted. +Those processes won't need to call `getChangedFiles` they will instead call `normalizeEntries` that will return the +entries with a `changed` field that can be used to determine if the file was changed or not. If it was not changed +the transformed stored data could be used instead of actually applying the transformation, saving time in case of only +a few files changed. + +In the worst case scenario all the files will be processed. In the best case scenario only a few of them will be processed. + +## Important notes +- The values set on the meta attribute of the entries should be `stringify-able` ones, meaning no circular references +- All the changes to the cache state are done to memory first and only persisted after reconcile + +## License + +MIT diff --git a/tools/eslint/node_modules/file-entry-cache/cache.js b/tools/eslint/node_modules/file-entry-cache/cache.js new file mode 100644 index 00000000000000..e4590a1bb33604 --- /dev/null +++ b/tools/eslint/node_modules/file-entry-cache/cache.js @@ -0,0 +1,190 @@ +var path = require( 'path' ); + +module.exports = { + createFromFile: function ( filePath ) { + var fname = path.basename( filePath ); + var dir = path.dirname( filePath ); + return this.create( fname, dir ); + }, + + create: function ( cacheId, _path ) { + var fs = require( 'fs' ); + var flatCache = require( 'flat-cache' ); + var cache = flatCache.load( cacheId, _path ); + var assign = require( 'object-assign' ); + var normalizedEntries = { }; + + return { + /** + * the flat cache storage used to persist the metadata of the files + * @type {Object} + */ + cache: cache, + /** + * Return whether or not a file has changed since last time reconcile was called. + * @method hasFileChanged + * @param {String} file the filepath to check + * @return {Boolean} wheter or not the file has changed + */ + hasFileChanged: function ( file ) { + return this.getFileDescriptor( file ).changed; + }, + + /** + * given an array of file paths it return and object with three arrays: + * - changedFiles: Files that changed since previous run + * - notChangedFiles: Files that haven't change + * - notFoundFiles: Files that were not found, probably deleted + * + * @param {Array} files the files to analyze and compare to the previous seen files + * @return {[type]} [description] + */ + analyzeFiles: function ( files ) { + var me = this; + files = files || [ ]; + + var res = { + changedFiles: [], + notFoundFiles: [], + notChangedFiles: [] + }; + + me.normalizeEntries( files ).forEach( function ( entry ) { + if ( entry.changed ) { + res.changedFiles.push( entry.key ); + return; + } + if ( entry.notFound ) { + res.notFoundFiles.push( entry.key ); + return; + } + res.notChangedFiles.push( entry.key ); + } ); + return res; + }, + + getFileDescriptor: function ( file ) { + var meta = cache.getKey( file ); + var cacheExists = !!meta; + var fstat; + var me = this; + + try { + fstat = fs.statSync( file ); + } catch (ex) { + me.removeEntry( file ); + return { key: file, notFound: true, err: ex }; + } + + var cSize = fstat.size; + var cTime = fstat.mtime.getTime(); + + if ( !meta ) { + meta = { size: cSize, mtime: cTime }; + } else { + var isDifferentDate = cTime !== meta.mtime; + var isDifferentSize = cSize !== meta.size; + } + + var nEntry = normalizedEntries[ file ] = { + key: file, + changed: !cacheExists || isDifferentDate || isDifferentSize, + meta: meta + }; + + return nEntry; + }, + + /** + * Return the list o the files that changed compared + * against the ones stored in the cache + * + * @method getUpdated + * @param files {Array} the array of files to compare against the ones in the cache + * @returns {Array} + */ + getUpdatedFiles: function ( files ) { + var me = this; + files = files || [ ]; + + return me.normalizeEntries( files ).filter( function ( entry ) { + return entry.changed; + } ).map( function ( entry ) { + return entry.key; + } ); + }, + + /** + * return the list of files + * @method normalizeEntries + * @param files + * @returns {*} + */ + normalizeEntries: function ( files ) { + files = files || [ ]; + + var me = this; + var nEntries = files.map( function ( file ) { + return me.getFileDescriptor( file ); + } ); + + //normalizeEntries = nEntries; + return nEntries; + }, + + /** + * Remove an entry from the file-entry-cache. Useful to force the file to still be considered + * modified the next time the process is run + * + * @method removeEntry + * @param entryName + */ + removeEntry: function ( entryName ) { + delete normalizedEntries[ entryName ]; + cache.removeKey( entryName ); + }, + + /** + * Delete the cache file from the disk + * @method deleteCacheFile + */ + deleteCacheFile: function () { + cache.removeCacheFile(); + }, + + /** + * remove the cache from the file and clear the memory cache + */ + destroy: function () { + normalizedEntries = { }; + cache.destroy(); + }, + /** + * Sync the files and persist them to the cache + * + * @method reconcile + */ + reconcile: function () { + var entries = normalizedEntries; + + var keys = Object.keys( entries ); + if ( keys.length === 0 ) { + return; + } + keys.forEach( function ( entryName ) { + var cacheEntry = entries[ entryName ]; + var stat = fs.statSync( cacheEntry.key ); + + var meta = assign( cacheEntry.meta, { + size: stat.size, + mtime: stat.mtime.getTime() + } ); + + cache.setKey( entryName, meta ); + } ); + + cache.save(); + } + }; + } +}; diff --git a/tools/eslint/node_modules/file-entry-cache/changelog.md b/tools/eslint/node_modules/file-entry-cache/changelog.md new file mode 100644 index 00000000000000..46fcd57bc82b5a --- /dev/null +++ b/tools/eslint/node_modules/file-entry-cache/changelog.md @@ -0,0 +1,57 @@ + +# file-entry-cache - Changelog +## v1.2.4 +- **Enhancements** + - Expose the flat-cache instance - [f34c557]( https://github.com/royriojas/file-entry-cache/commit/f34c557 ), [royriojas](https://github.com/royriojas), 23/09/2015 20:26:33 + + +## v1.2.3 +- **Build Scripts Changes** + - update flat-cache dep - [cc7b9ce]( https://github.com/royriojas/file-entry-cache/commit/cc7b9ce ), [royriojas](https://github.com/royriojas), 11/09/2015 18:04:44 + + +## v1.2.2 +- **Build Scripts Changes** + - Add changelogx section to package.json - [a3916ff]( https://github.com/royriojas/file-entry-cache/commit/a3916ff ), [royriojas](https://github.com/royriojas), 11/09/2015 18:00:26 + + +## v1.2.1 +- **Build Scripts Changes** + - update flat-cache dep - [e49b0d4]( https://github.com/royriojas/file-entry-cache/commit/e49b0d4 ), [royriojas](https://github.com/royriojas), 11/09/2015 17:55:25 + + +- **Other changes** + - Update dependencies Replaced lodash.assign with smaller object-assign Fixed tests for windows - [0ad3000]( https://github.com/royriojas/file-entry-cache/commit/0ad3000 ), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 11/09/2015 17:44:18 + + +## v1.2.0 +- **Features** + - analyzeFiles now returns also the files that were removed - [6ac2431]( https://github.com/royriojas/file-entry-cache/commit/6ac2431 ), [royriojas](https://github.com/royriojas), 04/09/2015 14:40:53 + + +## v1.1.1 +- **Features** + - Add method to check if a file hasChanged - [3640e2b]( https://github.com/royriojas/file-entry-cache/commit/3640e2b ), [Roy Riojas](https://github.com/Roy Riojas), 30/08/2015 07:33:32 + + +## v1.1.0 +- **Features** + - Create the cache directly from a file path - [a23de61]( https://github.com/royriojas/file-entry-cache/commit/a23de61 ), [Roy Riojas](https://github.com/Roy Riojas), 30/08/2015 06:41:33 + + + - Add a method to remove an entry from the filecache - [7af29fc]( https://github.com/royriojas/file-entry-cache/commit/7af29fc ), [Roy Riojas](https://github.com/Roy Riojas), 03/03/2015 02:25:32 + + + - cache module finished - [1f95544]( https://github.com/royriojas/file-entry-cache/commit/1f95544 ), [Roy Riojas](https://github.com/Roy Riojas), 02/03/2015 04:08:08 + + +- **Build Scripts Changes** + - set the version for the first release - [7472eaa]( https://github.com/royriojas/file-entry-cache/commit/7472eaa ), [Roy Riojas](https://github.com/Roy Riojas), 02/03/2015 04:29:54 + + +- **Documentation** + - Updated documentation - [557358f]( https://github.com/royriojas/file-entry-cache/commit/557358f ), [Roy Riojas](https://github.com/Roy Riojas), 02/03/2015 04:29:29 + + +- **Other changes** + - Initial commit - [3d5f42b]( https://github.com/royriojas/file-entry-cache/commit/3d5f42b ), [Roy Riojas](https://github.com/Roy Riojas), 02/03/2015 00:58:29 diff --git a/tools/eslint/node_modules/file-entry-cache/package.json b/tools/eslint/node_modules/file-entry-cache/package.json new file mode 100644 index 00000000000000..fda420abc17fcd --- /dev/null +++ b/tools/eslint/node_modules/file-entry-cache/package.json @@ -0,0 +1,140 @@ +{ + "_args": [ + [ + "file-entry-cache@^1.1.1", + "/Users/silverwind/git/node/tools/package/package" + ] + ], + "_from": "file-entry-cache@>=1.1.1 <2.0.0", + "_id": "file-entry-cache@1.2.4", + "_inCache": true, + "_installable": true, + "_location": "/file-entry-cache", + "_nodeVersion": "0.12.0", + "_npmUser": { + "email": "royriojas@gmail.com", + "name": "royriojas" + }, + "_npmVersion": "2.14.5", + "_phantomChildren": {}, + "_requested": { + "name": "file-entry-cache", + "raw": "file-entry-cache@^1.1.1", + "rawSpec": "^1.1.1", + "scope": null, + "spec": ">=1.1.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-1.2.4.tgz", + "_shasum": "9a586072c69365a7ef7ec72a7c2b9046de091e9c", + "_shrinkwrap": null, + "_spec": "file-entry-cache@^1.1.1", + "_where": "/Users/silverwind/git/node/tools/package/package", + "author": { + "name": "Roy Riojas", + "url": "http://royriojas.com" + }, + "bugs": { + "url": "https://github.com/royriojas/file-entry-cache/issues" + }, + "changelogx": { + "authorURL": "https://github.com/{0}", + "commitURL": "https://github.com/royriojas/file-entry-cache/commit/{0}", + "ignoreRegExp": [ + "BLD: Release", + "DOC: Generate Changelog", + "Generated Changelog" + ], + "issueIDRegExp": "#(\\d+)", + "issueIDURL": "https://github.com/royriojas/file-entry-cache/issues/{0}", + "projectName": "file-entry-cache" + }, + "dependencies": { + "flat-cache": "^1.0.9", + "object-assign": "^4.0.1" + }, + "description": "Super simple cache for file metadata, useful for process that work o a given series of files and that only need to repeat the job on the changed ones since the previous run of the process", + "devDependencies": { + "chai": "^3.2.0", + "changelogx": "^1.0.18", + "commander": "^2.6.0", + "del": "^2.0.2", + "esbeautifier": "^4.2.11", + "eslinter": "^2.3.3", + "glob-expand": "^0.1.0", + "istanbul": "^0.3.6", + "mocha": "^2.1.0", + "precommit": "^1.1.5", + "prepush": "^3.1.4", + "proxyquire": "^1.3.1", + "read-file": "^0.2.0", + "sinon": "^1.12.2", + "sinon-chai": "^2.7.0", + "watch-run": "^1.2.1", + "write": "^0.2.1" + }, + "directories": {}, + "dist": { + "shasum": "9a586072c69365a7ef7ec72a7c2b9046de091e9c", + "tarball": "http://registry.npmjs.org/file-entry-cache/-/file-entry-cache-1.2.4.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "cache.js" + ], + "gitHead": "3ca70d84f97822df7f769409f49ecf22c8908412", + "homepage": "https://github.com/royriojas/file-entry-cache#readme", + "keywords": [ + "cache", + "file cache", + "file cache", + "key par", + "key value", + "task cache files" + ], + "license": "MIT", + "main": "cache.js", + "maintainers": [ + { + "name": "royriojas", + "email": "royriojas@gmail.com" + } + ], + "name": "file-entry-cache", + "optionalDependencies": {}, + "precommit": [ + "npm run verify" + ], + "prepush": [ + "npm run verify" + ], + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/royriojas/file-entry-cache.git" + }, + "scripts": { + "beautify": "esbeautifier 'cache.js' 'specs/**/*.js'", + "beautify-check": "esbeautifier -k 'cache.js' 'specs/**/*.js'", + "bump-major": "npm run pre-v && npm version major -m 'BLD: Release v%s' && npm run post-v", + "bump-minor": "npm run pre-v && npm version minor -m 'BLD: Release v%s' && npm run post-v", + "bump-patch": "npm run pre-v && npm version patch -m 'BLD: Release v%s' && npm run post-v", + "changelog": "changelogx -f markdown -o ./changelog.md", + "cover": "istanbul cover test/runner.js html text-summary", + "do-changelog": "npm run changelog && git add ./changelog.md && git commit -m 'DOC: Generate changelog' --no-verify", + "eslint": "eslinter 'cache.js' 'specs/**/*.js'", + "install-hooks": "prepush install && changelogx install-hook && precommit install", + "lint": "npm run beautify && npm run eslint", + "post-v": "npm run do-changelog && git push --no-verify && git push --tags --no-verify", + "pre-v": "npm run verify", + "test": "mocha -R spec test/specs", + "verify": "npm run beautify-check && npm run eslint", + "watch": "watch-run -i -p 'test/specs/**/*.js' istanbul cover test/runner.js html text-summary" + }, + "version": "1.2.4" +} diff --git a/tools/eslint/node_modules/flat-cache/LICENSE b/tools/eslint/node_modules/flat-cache/LICENSE new file mode 100644 index 00000000000000..7394b8ff84b090 --- /dev/null +++ b/tools/eslint/node_modules/flat-cache/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Roy Riojas + +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/eslint/node_modules/flat-cache/README.md b/tools/eslint/node_modules/flat-cache/README.md new file mode 100644 index 00000000000000..d0eddf2e9c8832 --- /dev/null +++ b/tools/eslint/node_modules/flat-cache/README.md @@ -0,0 +1,67 @@ +# flat-cache +> A stupidly simple key/value storage using files to persist the data + +[![NPM Version](http://img.shields.io/npm/v/flat-cache.svg?style=flat)](https://npmjs.org/package/flat-cache) +[![Build Status](http://img.shields.io/travis/royriojas/flat-cache.svg?style=flat)](https://travis-ci.org/royriojas/flat-cache) + +## install + +```bash +npm i --save flat-cache +``` + +## Usage + +```js +var flatCache = require('flat-cache') +// loads the cache, if one does not exists for the given +// Id a new one will be prepared to be created +var cache = flatCache.load('cacheId'); + +// sets a key on the cache +cache.setKey('key', { foo: 'var' }); + +// get a key from the cache +cache.getKey('key') // { foo: 'var' } + +// remove a key +cache.removeKey('key'); // removes a key from the cache + +// save it to disk +cache.save(); // very important, if you don't save no changes will be persisted. + +// loads the cache from a given directory, if one does +// not exists for the given Id a new one will be prepared to be created +var cache = flatCache.load('cacheId', path.resolve('./path/to/folder')); + +// The following methods are useful to clear the cache +// delete a given cache +flatCache.clearCacheById('cacheId') // removes the cacheId document if one exists. + +// delete all cache +flatCache.clearAll(); // remove the cache directory +``` + +## Motivation for this module + +I needed a super simple and dumb **in-memory cache** with optional disk persistance in order to make +a script that will beutify files with `esformatter` only execute on the files that were changed since the last run. +To make that possible we need to store the `fileSize` and `modificationTime` of the files. So a simple `key/value` +storage was needed and Bam! this module was born. + +## Important notes +- If no directory is especified when the `load` method is called, a folder named `.cache` will be created + inside the module directory when `cache.save` is called. If you're committing your `node_modules` to any vcs, you + might want to ignore the default `.cache` folder, or specify a custom directory. +- The values set on the keys of the cache should be `stringify-able` ones, meaning no circular references +- All the changes to the cache state are done to memory +- I could have used a timer or `Object.observe` to deliver the changes to disk, but I wanted to keep this module + intentionally dumb and simple + +## License + +MIT + +## Changelog + +[changelog](./changelog.md) diff --git a/tools/eslint/node_modules/flat-cache/cache.js b/tools/eslint/node_modules/flat-cache/cache.js new file mode 100644 index 00000000000000..90b8e77c30057f --- /dev/null +++ b/tools/eslint/node_modules/flat-cache/cache.js @@ -0,0 +1,187 @@ +var path = require( 'path' ); +var fs = require( 'graceful-fs' ); +var readJSON = require( 'read-json-sync' ); +var write = require( 'write' ); +var del = require( 'del' ).sync; + +var cache = { + /** + * Load a cache identified by the given Id. If the element does not exists, then initialize an empty + * cache storage. If specified `cacheDir` will be used as the directory to persist the data to. If omitted + * then the cache module directory `./cache` will be used instead + * + * @method load + * @param docId {String} the id of the cache, would also be used as the name of the file cache + * @param [cacheDir] {String} directory for the cache entry + */ + load: function ( docId, cacheDir ) { + var me = this; + + me._visited = { }; + me._persisted = { }; + me._pathToFile = cacheDir ? path.resolve( cacheDir, docId ) : path.resolve( __dirname, './.cache/', docId ); + + if ( fs.existsSync( me._pathToFile ) ) { + me._persisted = readJSON( me._pathToFile ); + } + }, + + /** + * Load the cache from the provided file + * @method loadFile + * @param {String} pathToFile the path to the file containing the info for the cache + */ + loadFile: function ( pathToFile ) { + var me = this; + var dir = path.dirname( pathToFile ); + var fName = path.basename( pathToFile ); + + me.load( fName, dir ); + }, + + keys: function () { + return Object.keys( this._persisted ); + }, + /** + * sets a key to a given value + * @method setKey + * @param key {string} the key to set + * @param value {object} the value of the key. Could be any object that can be serialized with JSON.stringify + */ + setKey: function ( key, value ) { + this._visited[ key ] = true; + this._persisted[ key ] = value; + }, + /** + * remove a given key from the cache + * @method removeKey + * @param key {String} the key to remove from the object + */ + removeKey: function ( key ) { + delete this._visited[ key ]; // esfmt-ignore-line + delete this._persisted[ key ]; // esfmt-ignore-line + }, + /** + * Return the value of the provided key + * @method getKey + * @param key {String} the name of the key to retrieve + * @returns {*} the value from the key + */ + getKey: function ( key ) { + this._visited[ key ] = true; + return this._persisted[ key ]; + }, + + /** + * Remove keys that were not accessed/set since the + * last time the `prune` method was called. + * @method _prune + * @private + */ + _prune: function () { + var me = this; + var obj = { }; + + var keys = Object.keys( me._visited ); + + // no keys visited for either get or set value + if ( keys.length === 0 ) { + return; + } + + keys.forEach( function ( key ) { + obj[ key ] = me._persisted[ key ]; + } ); + + me._visited = { }; + me._persisted = obj; + }, + + /** + * Save the state of the cache identified by the docId to disk + * as a JSON structure + * @method save + */ + save: function () { + var me = this; + + me._prune(); + write.sync( me._pathToFile, JSON.stringify( me._persisted ) ); + }, + + /** + * remove the file where the cache is persisted + * @method removeCacheFile + * @return {Boolean} true or false if the file was successfully deleted + */ + removeCacheFile: function () { + return del( this._pathToFile, { force: true } ); + }, + /** + * Destroy the file cache and cache content. + * @method destroy + */ + destroy: function () { + var me = this; + me._visited = { }; + me._persisted = { }; + + me.removeCacheFile(); + } +}; + +module.exports = { + /** + * Alias for create. Should be considered depreacted. Will be removed in next releases + * + * @method load + * @param docId {String} the id of the cache, would also be used as the name of the file cache + * @param [cacheDir] {String} directory for the cache entry + * @returns {cache} cache instance + */ + load: function ( docId, cacheDir ) { + return this.create( docId, cacheDir ); + }, + + /** + * Load a cache identified by the given Id. If the element does not exists, then initialize an empty + * cache storage. + * + * @method create + * @param docId {String} the id of the cache, would also be used as the name of the file cache + * @param [cacheDir] {String} directory for the cache entry + * @returns {cache} cache instance + */ + create: function ( docId, cacheDir ) { + var obj = Object.create( cache ); + obj.load( docId, cacheDir ); + return obj; + }, + + createFromFile: function ( filePath ) { + var obj = Object.create( cache ); + obj.loadFile( filePath ); + return obj; + }, + /** + * Clear the cache identified by the given id. Caches stored in a different cache directory can be deleted directly + * + * @method clearCache + * @param docId {String} the id of the cache, would also be used as the name of the file cache + * @param cacheDir {String} the directory where the cache file was written + * @returns {Boolean} true if the cache folder was deleted. False otherwise + */ + clearCacheById: function ( docId, cacheDir ) { + var filePath = cacheDir ? path.resolve( cacheDir, docId ) : path.resolve( __dirname, './.cache/', docId ); + return del( filePath, { force: true } ).length > 0; + }, + /** + * Remove all cache stored in the cache directory + * @method clearAll + * @returns {Boolean} true if the cache folder was deleted. False otherwise + */ + clearAll: function ( cacheDir ) { + var filePath = cacheDir ? path.resolve( cacheDir ) : path.resolve( __dirname, './.cache/' ); + return del( filePath, { force: true } ).length > 0; + } +}; diff --git a/tools/eslint/node_modules/flat-cache/changelog.md b/tools/eslint/node_modules/flat-cache/changelog.md new file mode 100644 index 00000000000000..571757c9d9ba6d --- /dev/null +++ b/tools/eslint/node_modules/flat-cache/changelog.md @@ -0,0 +1,72 @@ + +# flat-cache - Changelog +## v1.0.10 +- **Build Scripts Changes** + - add eslint-fix task - [fd29e52]( https://github.com/royriojas/flat-cache/commit/fd29e52 ), [royriojas](https://github.com/royriojas), 01/11/2015 18:04:08 + + + - make sure the test script also verify beautification and linting of files before running tests - [e94e176]( https://github.com/royriojas/flat-cache/commit/e94e176 ), [royriojas](https://github.com/royriojas), 01/11/2015 14:54:48 + + +- **Other changes** + - add clearAll for cacheDir - [97383d9]( https://github.com/royriojas/flat-cache/commit/97383d9 ), [xieyaowu](https://github.com/xieyaowu), 31/10/2015 23:02:18 + + +## v1.0.9 +- **Bug Fixes** + - wrong default values for changelogx user repo name - [7bb52d1]( https://github.com/royriojas/flat-cache/commit/7bb52d1 ), [royriojas](https://github.com/royriojas), 11/09/2015 17:59:30 + + +## v1.0.8 +- **Build Scripts Changes** + - test against node 4 - [c395b66]( https://github.com/royriojas/flat-cache/commit/c395b66 ), [royriojas](https://github.com/royriojas), 11/09/2015 17:51:39 + + +## v1.0.7 +- **Other changes** + - Move dependencies into devDep - [7e47099]( https://github.com/royriojas/flat-cache/commit/7e47099 ), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 11/09/2015 17:10:57 + + +- **Documentation** + - Add missing changelog link - [f51197a]( https://github.com/royriojas/flat-cache/commit/f51197a ), [royriojas](https://github.com/royriojas), 11/09/2015 16:48:05 + + +## v1.0.6 +- **Build Scripts Changes** + - Add helpers/code check scripts - [bdb82f3]( https://github.com/royriojas/flat-cache/commit/bdb82f3 ), [royriojas](https://github.com/royriojas), 11/09/2015 16:44:31 + + +## v1.0.5 +- **Documentation** + - better description for the module - [436817f]( https://github.com/royriojas/flat-cache/commit/436817f ), [royriojas](https://github.com/royriojas), 11/09/2015 16:35:33 + + +- **Other changes** + - Update dependencies - [be88aa3]( https://github.com/royriojas/flat-cache/commit/be88aa3 ), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 11/09/2015 15:47:41 + + +## v1.0.4 +- **Refactoring** + - load a cache file using the full filepath - [b8f68c2]( https://github.com/royriojas/flat-cache/commit/b8f68c2 ), [Roy Riojas](https://github.com/Roy Riojas), 30/08/2015 06:19:14 + + +- **Documentation** + - Add documentation about `clearAll` and `clearCacheById` - [13947c1]( https://github.com/royriojas/flat-cache/commit/13947c1 ), [Roy Riojas](https://github.com/Roy Riojas), 02/03/2015 02:44:05 + + +- **Features** + - Add methods to remove the cache documents created - [af40443]( https://github.com/royriojas/flat-cache/commit/af40443 ), [Roy Riojas](https://github.com/Roy Riojas), 02/03/2015 02:39:27 + + +## v1.0.1 +- **Other changes** + - Update README.md - [c2b6805]( https://github.com/royriojas/flat-cache/commit/c2b6805 ), [Roy Riojas](https://github.com/Roy Riojas), 26/02/2015 07:28:07 + + +## v1.0.0 +- **Refactoring** + - flat-cache v.1.0.0 - [c984274]( https://github.com/royriojas/flat-cache/commit/c984274 ), [Roy Riojas](https://github.com/Roy Riojas), 26/02/2015 07:11:50 + + +- **Other changes** + - Initial commit - [d43cccf]( https://github.com/royriojas/flat-cache/commit/d43cccf ), [Roy Riojas](https://github.com/Roy Riojas), 26/02/2015 04:12:16 diff --git a/tools/eslint/node_modules/flat-cache/package.json b/tools/eslint/node_modules/flat-cache/package.json new file mode 100644 index 00000000000000..1558d29aeb13e2 --- /dev/null +++ b/tools/eslint/node_modules/flat-cache/package.json @@ -0,0 +1,141 @@ +{ + "_args": [ + [ + "flat-cache@^1.0.9", + "/Users/silverwind/git/node/tools/package/package/node_modules/file-entry-cache" + ] + ], + "_from": "flat-cache@>=1.0.9 <2.0.0", + "_id": "flat-cache@1.0.10", + "_inCache": true, + "_installable": true, + "_location": "/flat-cache", + "_nodeVersion": "0.12.0", + "_npmUser": { + "email": "royriojas@gmail.com", + "name": "royriojas" + }, + "_npmVersion": "2.14.5", + "_phantomChildren": {}, + "_requested": { + "name": "flat-cache", + "raw": "flat-cache@^1.0.9", + "rawSpec": "^1.0.9", + "scope": null, + "spec": ">=1.0.9 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/file-entry-cache" + ], + "_resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.0.10.tgz", + "_shasum": "73d6df4a28502160a05e059544a6aeeae8b0047a", + "_shrinkwrap": null, + "_spec": "flat-cache@^1.0.9", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/file-entry-cache", + "author": { + "name": "Roy Riojas", + "url": "http://royriojas.com" + }, + "bugs": { + "url": "https://github.com/royriojas/flat-cache/issues" + }, + "changelogx": { + "authorURL": "https://github.com/{0}", + "commitURL": "https://github.com/royriojas/flat-cache/commit/{0}", + "ignoreRegExp": [ + "BLD: Release", + "DOC: Generate Changelog", + "Generated Changelog" + ], + "issueIDRegExp": "#(\\d+)", + "issueIDURL": "https://github.com/royriojas/flat-cache/issues/{0}", + "projectName": "flat-cache" + }, + "dependencies": { + "del": "^2.0.2", + "graceful-fs": "^4.1.2", + "read-json-sync": "^1.1.0", + "write": "^0.2.1" + }, + "description": "A stupidly simple key/value storage using files to persist some data", + "devDependencies": { + "chai": "^3.2.0", + "changelogx": "^1.0.18", + "esbeautifier": "^6.1.8", + "eslinter": "^3.2.1", + "glob-expand": "^0.1.0", + "istanbul": "^0.3.19", + "mocha": "^2.3.2", + "precommit": "^1.1.5", + "prepush": "^3.1.4", + "proxyquire": "^1.7.2", + "sinon": "^1.16.1", + "sinon-chai": "^2.8.0", + "watch-run": "^1.2.2" + }, + "directories": {}, + "dist": { + "shasum": "73d6df4a28502160a05e059544a6aeeae8b0047a", + "tarball": "http://registry.npmjs.org/flat-cache/-/flat-cache-1.0.10.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "cache.js" + ], + "gitHead": "58bb40ccc87d79eb16146629be79d7577e6632da", + "homepage": "https://github.com/royriojas/flat-cache#readme", + "keywords": [ + "cache", + "file cache", + "json cache", + "key par", + "key value", + "simple cache" + ], + "license": "MIT", + "main": "cache.js", + "maintainers": [ + { + "name": "royriojas", + "email": "royriojas@gmail.com" + } + ], + "name": "flat-cache", + "optionalDependencies": {}, + "precommit": [ + "npm run verify --silent" + ], + "prepush": [ + "npm run verify --silent" + ], + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/royriojas/flat-cache.git" + }, + "scripts": { + "autofix": "npm run beautify && npm run eslint-fix", + "beautify": "esbeautifier 'cache.js' 'specs/**/*.js'", + "beautify-check": "npm run beautify -- -k", + "bump-major": "npm run pre-v && npm version major -m 'BLD: Release v%s' && npm run post-v", + "bump-minor": "npm run pre-v && npm version minor -m 'BLD: Release v%s' && npm run post-v", + "bump-patch": "npm run pre-v && npm version patch -m 'BLD: Release v%s' && npm run post-v", + "changelog": "changelogx -f markdown -o ./changelog.md", + "check": "npm run beautify-check && npm run eslint", + "cover": "istanbul cover test/runner.js html text-summary", + "do-changelog": "npm run changelog && git add ./changelog.md && git commit -m 'DOC: Generate changelog' --no-verify", + "eslint": "eslinter 'cache.js' 'specs/**/*.js'", + "eslint-fix": "npm run eslint -- --fix", + "install-hooks": "prepush install && changelogx install-hook && precommit install", + "post-v": "npm run do-changelog && git push --no-verify && git push --tags --no-verify", + "pre-v": "npm run verify", + "test": "npm run verify --silent", + "test:cache": "mocha -R spec test/specs", + "verify": "npm run check && npm run test:cache", + "watch": "watch-run -i -p 'test/specs/**/*.js' istanbul cover test/runner.js html text-summary" + }, + "version": "1.0.10" +} diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/README.md b/tools/eslint/node_modules/generate-function/README.md similarity index 100% rename from tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/README.md rename to tools/eslint/node_modules/generate-function/README.md diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/example.js b/tools/eslint/node_modules/generate-function/example.js similarity index 100% rename from tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/example.js rename to tools/eslint/node_modules/generate-function/example.js diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/index.js b/tools/eslint/node_modules/generate-function/index.js similarity index 100% rename from tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/index.js rename to tools/eslint/node_modules/generate-function/index.js diff --git a/tools/eslint/node_modules/generate-function/package.json b/tools/eslint/node_modules/generate-function/package.json new file mode 100644 index 00000000000000..6bf82cdcada968 --- /dev/null +++ b/tools/eslint/node_modules/generate-function/package.json @@ -0,0 +1,79 @@ +{ + "_args": [ + [ + "generate-function@^2.0.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/is-my-json-valid" + ] + ], + "_from": "generate-function@>=2.0.0 <3.0.0", + "_id": "generate-function@2.0.0", + "_inCache": true, + "_installable": true, + "_location": "/generate-function", + "_npmUser": { + "email": "mathiasbuus@gmail.com", + "name": "mafintosh" + }, + "_npmVersion": "1.4.23", + "_phantomChildren": {}, + "_requested": { + "name": "generate-function", + "raw": "generate-function@^2.0.0", + "rawSpec": "^2.0.0", + "scope": null, + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/is-my-json-valid" + ], + "_resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", + "_shasum": "6858fe7c0969b7d4e9093337647ac79f60dfbe74", + "_shrinkwrap": null, + "_spec": "generate-function@^2.0.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/is-my-json-valid", + "author": { + "name": "Mathias Buus" + }, + "bugs": { + "url": "https://github.com/mafintosh/generate-function/issues" + }, + "dependencies": {}, + "description": "Module that helps you write generated functions in Node", + "devDependencies": { + "tape": "^2.13.4" + }, + "directories": {}, + "dist": { + "shasum": "6858fe7c0969b7d4e9093337647ac79f60dfbe74", + "tarball": "http://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz" + }, + "gitHead": "3d5fc8de5859be95f58e3af9bfb5f663edd95149", + "homepage": "https://github.com/mafintosh/generate-function", + "keywords": [ + "code", + "function", + "generate", + "generation", + "performance" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + } + ], + "name": "generate-function", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/mafintosh/generate-function.git" + }, + "scripts": { + "test": "tape test.js" + }, + "version": "2.0.0" +} diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/LICENSE b/tools/eslint/node_modules/generate-object-property/LICENSE similarity index 100% rename from tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/LICENSE rename to tools/eslint/node_modules/generate-object-property/LICENSE diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/README.md b/tools/eslint/node_modules/generate-object-property/README.md similarity index 100% rename from tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/README.md rename to tools/eslint/node_modules/generate-object-property/README.md diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/index.js b/tools/eslint/node_modules/generate-object-property/index.js similarity index 100% rename from tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/index.js rename to tools/eslint/node_modules/generate-object-property/index.js diff --git a/tools/eslint/node_modules/generate-object-property/package.json b/tools/eslint/node_modules/generate-object-property/package.json new file mode 100644 index 00000000000000..0f7a596e8484d2 --- /dev/null +++ b/tools/eslint/node_modules/generate-object-property/package.json @@ -0,0 +1,76 @@ +{ + "_args": [ + [ + "generate-object-property@^1.1.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/is-my-json-valid" + ] + ], + "_from": "generate-object-property@>=1.1.0 <2.0.0", + "_id": "generate-object-property@1.2.0", + "_inCache": true, + "_installable": true, + "_location": "/generate-object-property", + "_nodeVersion": "2.0.1", + "_npmUser": { + "email": "mathiasbuus@gmail.com", + "name": "mafintosh" + }, + "_npmVersion": "2.9.0", + "_phantomChildren": {}, + "_requested": { + "name": "generate-object-property", + "raw": "generate-object-property@^1.1.0", + "rawSpec": "^1.1.0", + "scope": null, + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/is-my-json-valid" + ], + "_resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", + "_shasum": "9c0e1c40308ce804f4783618b937fa88f99d50d0", + "_shrinkwrap": null, + "_spec": "generate-object-property@^1.1.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/is-my-json-valid", + "author": { + "name": "Mathias Buus", + "url": "@mafintosh" + }, + "bugs": { + "url": "https://github.com/mafintosh/generate-object-property/issues" + }, + "dependencies": { + "is-property": "^1.0.0" + }, + "description": "Generate safe JS code that can used to reference a object property", + "devDependencies": { + "tape": "^2.13.0" + }, + "directories": {}, + "dist": { + "shasum": "9c0e1c40308ce804f4783618b937fa88f99d50d0", + "tarball": "http://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz" + }, + "gitHead": "0dd7d411018de54b2eae63b424c15b3e50bd678c", + "homepage": "https://github.com/mafintosh/generate-object-property", + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + } + ], + "name": "generate-object-property", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/mafintosh/generate-object-property.git" + }, + "scripts": { + "test": "tape test.js" + }, + "version": "1.2.0" +} diff --git a/tools/eslint/node_modules/glob/LICENSE b/tools/eslint/node_modules/glob/LICENSE new file mode 100644 index 00000000000000..19129e315fe593 --- /dev/null +++ b/tools/eslint/node_modules/glob/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/tools/eslint/node_modules/glob/README.md b/tools/eslint/node_modules/glob/README.md new file mode 100644 index 00000000000000..9dd9384fa143c3 --- /dev/null +++ b/tools/eslint/node_modules/glob/README.md @@ -0,0 +1,365 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +![](oh-my-glob.gif) + +## Usage + +Install with npm + +``` +npm i glob +``` + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Glob Primer + +"Globs" are the patterns you type when you do stuff like `ls *.js` on +the command line, or put `build/*` in a `.gitignore` file. + +Before parsing the path part patterns, braced sections are expanded +into a set. Braced sections start with `{` and end with `}`, with any +number of comma-delimited sections within. Braced sections may contain +slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. + +The following characters have special magic meaning when used in a +path portion: + +* `*` Matches 0 or more characters in a single path portion +* `?` Matches 1 character +* `[...]` Matches a range of characters, similar to a RegExp range. + If the first character of the range is `!` or `^` then it matches + any character not in the range. +* `!(pattern|pattern|pattern)` Matches anything that does not match + any of the patterns provided. +* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the + patterns provided. +* `+(pattern|pattern|pattern)` Matches one or more occurrences of the + patterns provided. +* `*(a|b|c)` Matches zero or more occurrences of the patterns provided +* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns + provided +* `**` If a "globstar" is alone in a path portion, then it matches + zero or more directories and subdirectories searching for matches. + It does not crawl symlinked directories. + +### Dots + +If a file or directory path portion has a `.` as the first character, +then it will not match any glob pattern unless that pattern's +corresponding path part also has a `.` as its first character. + +For example, the pattern `a/.*/c` would match the file at `a/.b/c`. +However the pattern `a/*/c` would not, because `*` does not start with +a dot character. + +You can make glob treat dots as normal characters by setting +`dot:true` in the options. + +### Basename Matching + +If you set `matchBase:true` in the options, and the pattern has no +slashes in it, then it will seek for any file anywhere in the tree +with a matching basename. For example, `*.js` would match +`test/simple/basic.js`. + +### Empty Sets + +If no matching files are found, then an empty array is returned. This +differs from the shell, where the pattern itself is returned. For +example: + + $ echo a*s*d*f + a*s*d*f + +To get the bash-style behavior, set the `nonull:true` in the options. + +### See Also: + +* `man sh` +* `man bash` (Search for "Pattern Matching") +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob.hasMagic(pattern, [options]) + +Returns `true` if there are any special characters in the pattern, and +`false` otherwise. + +Note that the options affect the results. If `noext:true` is set in +the options object, then `+(a|b)` will not be considered a magic +pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` +then that is considered magical, unless `nobrace:true` is set in the +options. + +## glob(pattern, [options], cb) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* `cb` `{Function}` + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* return: `{Array}` filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instantiating the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` `{String}` pattern to search for +* `options` `{Object}` +* `cb` `{Function}` Called when an error occurs, or matches are found + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `'FILE'` - Path exists, and is not a directory + * `'DIR'` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` +* `statCache` Cache of `fs.stat` results, to prevent statting the same + path multiple times. +* `symlinks` A record of which paths are symbolic links, which is + relevant in resolving `**` patterns. +* `realpathCache` An optional object which is passed to `fs.realpath` + to minimize unnecessary syscalls. It is stored on the instantiated + Glob object, and may be re-used. + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the specific + thing that matched. It is not deduplicated or resolved to a realpath. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `pause` Temporarily stop the search +* `resume` Resume the search +* `abort` Stop the search forever + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the Glob object, as well. + +If you are running many `glob` operations, you can pass a Glob object +as the `options` argument to a subsequent operation to shortcut some +`stat` and `readdir` calls. At the very least, you may pass in shared +`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that +parallel glob operations will be sped up by sharing information about +the filesystem. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. +* `silent` When an unusual error is encountered when attempting to + read a directory, a warning will be printed to stderr. Set the + `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered when attempting to + read a directory, the process will just continue on in search of + other matches. Set the `strict` option to raise an error in these + cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary + to set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `symlinks` A cache of known symbolic links. You may pass in a + previously generated `symlinks` object to save `lstat` calls when + resolving `**` matches. +* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. Set this + flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `debug` Set to enable debug logging in minimatch and glob. +* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. +* `noglobstar` Do not match `**` against multiple filenames. (Ie, + treat it as a normal `*` instead.) +* `noext` Do not match `+(a|b)` "extglob" patterns. +* `nocase` Perform a case-insensitive match. Note: on + case-insensitive filesystems, non-magic patterns will match by + default, since `stat` and `readdir` will not raise errors. +* `matchBase` Perform a basename-only match if the pattern does not + contain any slash characters. That is, `*.js` would be treated as + equivalent to `**/*.js`, matching all js files in all directories. +* `nodir` Do not match directories, only files. (Note: to match + *only* directories, simply put a `/` at the end of the pattern.) +* `ignore` Add a pattern or an array of glob patterns to exclude matches. + Note: `ignore` patterns are *always* in `dot:true` mode, regardless + of any other settings. +* `follow` Follow symlinked directories when expanding `**` patterns. + Note that this can result in a lot of duplicate references in the + presence of cyclic links. +* `realpath` Set to true to call `fs.realpath` on all of the results. + In the case of a symlink that cannot be resolved, the full absolute + path to the matched entry is returned (though it will usually be a + broken symlink) + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.3, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +Note that symlinked directories are not crawled as part of a `**`, +though their contents may match against subsequent portions of the +pattern. This prevents infinite loops and duplicates and the like. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +### Comments and Negation + +Previously, this module let you mark a pattern as a "comment" if it +started with a `#` character, or a "negated" pattern if it started +with a `!` character. + +These options were deprecated in version 5, and removed in version 6. + +To specify things that should not match, use the `ignore` option. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. + +## Contributing + +Any change to behavior (including bugfixes) must come with a test. + +Patches that fail tests or reduce performance will be rejected. + +``` +# to run tests +npm test + +# to re-generate test fixtures +npm run test-regen + +# to benchmark against bash/zsh +npm run bench + +# to profile javascript +npm run prof +``` diff --git a/tools/eslint/node_modules/glob/changelog.md b/tools/eslint/node_modules/glob/changelog.md new file mode 100644 index 00000000000000..41636771e3a7cd --- /dev/null +++ b/tools/eslint/node_modules/glob/changelog.md @@ -0,0 +1,67 @@ +## 7.0 + +- Raise error if `options.cwd` is specified, and not a directory + +## 6.0 + +- Remove comment and negation pattern support +- Ignore patterns are always in `dot:true` mode + +## 5.0 + +- Deprecate comment and negation patterns +- Fix regression in `mark` and `nodir` options from making all cache + keys absolute path. +- Abort if `fs.readdir` returns an error that's unexpected +- Don't emit `match` events for ignored items +- Treat ENOTSUP like ENOTDIR in readdir + +## 4.5 + +- Add `options.follow` to always follow directory symlinks in globstar +- Add `options.realpath` to call `fs.realpath` on all results +- Always cache based on absolute path + +## 4.4 + +- Add `options.ignore` +- Fix handling of broken symlinks + +## 4.3 + +- Bump minimatch to 2.x +- Pass all tests on Windows + +## 4.2 + +- Add `glob.hasMagic` function +- Add `options.nodir` flag + +## 4.1 + +- Refactor sync and async implementations for performance +- Throw if callback provided to sync glob function +- Treat symbolic links in globstar results the same as Bash 4.3 + +## 4.0 + +- Use `^` for dependency versions (bumped major because this breaks + older npm versions) +- Ensure callbacks are only ever called once +- switch to ISC license + +## 3.x + +- Rewrite in JavaScript +- Add support for setting root, cwd, and windows support +- Cache many fs calls +- Add globstar support +- emit match events + +## 2.x + +- Use `glob.h` and `fnmatch.h` from NetBSD + +## 1.x + +- `glob.h` static binding. diff --git a/tools/eslint/node_modules/glob/common.js b/tools/eslint/node_modules/glob/common.js new file mode 100644 index 00000000000000..58dc41e6632160 --- /dev/null +++ b/tools/eslint/node_modules/glob/common.js @@ -0,0 +1,235 @@ +exports.alphasort = alphasort +exports.alphasorti = alphasorti +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var path = require("path") +var minimatch = require("minimatch") +var isAbsolute = require("path-is-absolute") +var Minimatch = minimatch.Minimatch + +function alphasorti (a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()) +} + +function alphasort (a, b) { + return a.localeCompare(b) +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || [] + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} + +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } + + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = path.resolve(options.cwd) + self.changedCwd = self.cwd !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + self.cwdAbs = makeAbs(self, self.cwd) + self.nomount = !!options.nomount + + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(self.nocase ? alphasorti : alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + var notDir = !(/\/$/.test(e)) + var c = self.cache[e] || self.cache[makeAbs(self, e)] + if (notDir && c) + notDir = c !== 'DIR' && !Array.isArray(c) + return notDir + }) + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + + self.found = all +} + +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } + + if (process.platform === 'win32') + abs = abs.replace(/\\/g, '/') + + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} diff --git a/tools/eslint/node_modules/glob/glob.js b/tools/eslint/node_modules/glob/glob.js new file mode 100644 index 00000000000000..4dba04adec43c4 --- /dev/null +++ b/tools/eslint/node_modules/glob/glob.js @@ -0,0 +1,782 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob + +var fs = require('fs') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var inherits = require('inherits') +var EE = require('events').EventEmitter +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var globSync = require('./sync.js') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = require('inflight') +var util = require('util') +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +var once = require('once') + +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) +} + +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } + + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} + +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + this._didRealPath = false + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } + + var self = this + var n = this.minimatch.set.length + this._processing = 0 + this.matches = new Array(n) + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + var sync = true + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + sync = false + + function done () { + --self._processing + if (self._processing <= 0) { + if (sync) { + process.nextTick(function () { + self._finish() + }) + } else { + self._finish() + } + } + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + fs.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} + +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (this.matches[index][e]) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = this._makeAbs(e) + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + if (this.mark) + e = this._mark(e) + + this.matches[index][e] = true + + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er) + return cb() + + var isSym = lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + this.emit('error', error) + this.abort() + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } + + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er) { + this.statCache[abs] = false + return cb() + } + + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && !stat.isDirectory()) + return cb(null, false, stat) + + var c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c !== 'DIR') + return cb() + + return cb(null, c, stat) +} diff --git a/tools/eslint/node_modules/glob/package.json b/tools/eslint/node_modules/glob/package.json new file mode 100644 index 00000000000000..537635f8eafc3c --- /dev/null +++ b/tools/eslint/node_modules/glob/package.json @@ -0,0 +1,103 @@ +{ + "_args": [ + [ + "glob@^7.0.3", + "/Users/silverwind/git/node/tools/package/package" + ] + ], + "_from": "glob@>=7.0.3 <8.0.0", + "_id": "glob@7.0.3", + "_inCache": true, + "_installable": true, + "_location": "/glob", + "_nodeVersion": "5.6.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/glob-7.0.3.tgz_1457166529288_0.7840580905321985" + }, + "_npmUser": { + "email": "i@izs.me", + "name": "isaacs" + }, + "_npmVersion": "3.7.3", + "_phantomChildren": {}, + "_requested": { + "name": "glob", + "raw": "glob@^7.0.3", + "rawSpec": "^7.0.3", + "scope": null, + "spec": ">=7.0.3 <8.0.0", + "type": "range" + }, + "_requiredBy": [ + "/", + "/rimraf" + ], + "_resolved": "https://registry.npmjs.org/glob/-/glob-7.0.3.tgz", + "_shasum": "0aa235931a4a96ac13d60ffac2fb877bd6ed4f58", + "_shrinkwrap": null, + "_spec": "glob@^7.0.3", + "_where": "/Users/silverwind/git/node/tools/package/package", + "author": { + "email": "i@izs.me", + "name": "Isaac Z. Schlueter", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/node-glob/issues" + }, + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "description": "a little globber", + "devDependencies": { + "mkdirp": "0", + "rimraf": "^2.2.8", + "tap": "^5.7.0", + "tick": "0.0.6" + }, + "directories": {}, + "dist": { + "shasum": "0aa235931a4a96ac13d60ffac2fb877bd6ed4f58", + "tarball": "https://registry.npmjs.org/glob/-/glob-7.0.3.tgz" + }, + "engines": { + "node": "*" + }, + "files": [ + "common.js", + "glob.js", + "sync.js" + ], + "gitHead": "2fc2278ab857c7df117213a2fb431de090be6353", + "homepage": "https://github.com/isaacs/node-glob#readme", + "license": "ISC", + "main": "glob.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "glob", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "scripts": { + "bench": "bash benchmark.sh", + "benchclean": "node benchclean.js", + "prepublish": "npm run benchclean", + "prof": "bash prof.sh && cat profile.txt", + "profclean": "rm -f v8.log profile.txt", + "test": "tap test/*.js --cov", + "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js" + }, + "version": "7.0.3" +} diff --git a/tools/eslint/node_modules/glob/sync.js b/tools/eslint/node_modules/glob/sync.js new file mode 100644 index 00000000000000..301577ab5f228f --- /dev/null +++ b/tools/eslint/node_modules/glob/sync.js @@ -0,0 +1,467 @@ +module.exports = globSync +globSync.GlobSync = GlobSync + +var fs = require('fs') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var Glob = require('./glob.js').Glob +var util = require('util') +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = fs.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this.matches[index][e] = true + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + var abs = this._makeAbs(e) + if (this.mark) + e = this._mark(e) + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[this._makeAbs(e)] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + // lstat failed, doesn't exist + return null + } + + var isSym = lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + throw error + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this.matches[index][prefix] = true +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + return false + } + + if (lstat.isSymbolicLink()) { + try { + stat = fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c !== 'DIR') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} diff --git a/tools/eslint/node_modules/globals/globals.json b/tools/eslint/node_modules/globals/globals.json index ad5c25f3e83d22..756009decc0bbf 100644 --- a/tools/eslint/node_modules/globals/globals.json +++ b/tools/eslint/node_modules/globals/globals.json @@ -59,23 +59,150 @@ "WeakMap": false, "WeakSet": false }, + "es5": { + "Array": false, + "Boolean": false, + "constructor": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Function": false, + "hasOwnProperty": false, + "Infinity": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "propertyIsEnumerable": false, + "RangeError": false, + "ReferenceError": false, + "RegExp": false, + "String": false, + "SyntaxError": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false + }, + "es6": { + "Array": false, + "ArrayBuffer": false, + "Boolean": false, + "constructor": false, + "DataView": false, + "Date": false, + "decodeURI": false, + "decodeURIComponent": false, + "encodeURI": false, + "encodeURIComponent": false, + "Error": false, + "escape": false, + "eval": false, + "EvalError": false, + "Float32Array": false, + "Float64Array": false, + "Function": false, + "hasOwnProperty": false, + "Infinity": false, + "Int16Array": false, + "Int32Array": false, + "Int8Array": false, + "isFinite": false, + "isNaN": false, + "isPrototypeOf": false, + "JSON": false, + "Map": false, + "Math": false, + "NaN": false, + "Number": false, + "Object": false, + "parseFloat": false, + "parseInt": false, + "Promise": false, + "propertyIsEnumerable": false, + "Proxy": false, + "RangeError": false, + "ReferenceError": false, + "Reflect": false, + "RegExp": false, + "Set": false, + "String": false, + "Symbol": false, + "SyntaxError": false, + "System": false, + "toLocaleString": false, + "toString": false, + "TypeError": false, + "Uint16Array": false, + "Uint32Array": false, + "Uint8Array": false, + "Uint8ClampedArray": false, + "undefined": false, + "unescape": false, + "URIError": false, + "valueOf": false, + "WeakMap": false, + "WeakSet": false + }, "browser": { "addEventListener": false, "alert": false, + "AnalyserNode": false, + "AnimationEvent": false, "applicationCache": false, + "ApplicationCache": false, + "ApplicationCacheErrorEvent": false, "atob": false, + "Attr": false, "Audio": false, + "AudioBuffer": false, + "AudioBufferSourceNode": false, + "AudioContext": false, + "AudioDestinationNode": false, + "AudioListener": false, + "AudioNode": false, + "AudioParam": false, "AudioProcessingEvent": false, + "AutocompleteErrorEvent": false, + "BarProp": false, + "BatteryManager": false, "BeforeUnloadEvent": false, + "BiquadFilterNode": false, "Blob": false, "blur": false, "btoa": false, + "Cache": false, + "caches": false, + "CacheStorage": false, "cancelAnimationFrame": false, "CanvasGradient": false, "CanvasPattern": false, "CanvasRenderingContext2D": false, + "CDATASection": false, + "ChannelMergerNode": false, + "ChannelSplitterNode": false, + "CharacterData": false, "clearInterval": false, "clearTimeout": false, + "clientInformation": false, + "ClientRect": false, + "ClientRectList": false, + "ClipboardEvent": false, "close": false, "closed": false, "CloseEvent": false, @@ -83,52 +210,106 @@ "CompositionEvent": false, "confirm": false, "console": false, + "ConvolverNode": false, "crypto": false, + "Crypto": false, + "CryptoKey": false, "CSS": false, + "CSSFontFaceRule": false, + "CSSImportRule": false, + "CSSKeyframeRule": false, + "CSSKeyframesRule": false, + "CSSMediaRule": false, + "CSSPageRule": false, + "CSSRule": false, + "CSSRuleList": false, + "CSSStyleDeclaration": false, + "CSSStyleRule": false, + "CSSStyleSheet": false, + "CSSSupportsRule": false, + "CSSUnknownRule": false, + "CSSViewportRule": false, "CustomEvent": false, + "DataTransfer": false, + "DataTransferItem": false, + "DataTransferItemList": false, "Debug": false, "defaultStatus": false, + "defaultstatus": false, + "DelayNode": false, + "DeviceMotionEvent": false, + "DeviceOrientationEvent": false, "devicePixelRatio": false, "dispatchEvent": false, "document": false, "Document": false, "DocumentFragment": false, + "DocumentType": false, + "DOMError": false, + "DOMException": false, + "DOMImplementation": false, "DOMParser": false, + "DOMSettableTokenList": false, + "DOMStringList": false, + "DOMStringMap": false, + "DOMTokenList": false, "DragEvent": false, + "DynamicsCompressorNode": false, "Element": false, "ElementTimeControl": false, "ErrorEvent": false, "event": false, "Event": false, "EventSource": false, + "EventTarget": false, + "external": false, + "fetch": false, + "File": false, + "FileError": false, "FileList": false, "FileReader": false, - "fetch": false, "find": false, "focus": false, "FocusEvent": false, + "FontFace": false, "FormData": false, "frameElement": false, "frames": false, + "GainNode": false, + "Gamepad": false, + "GamepadButton": false, "GamepadEvent": false, "getComputedStyle": false, "getSelection": false, "HashChangeEvent": false, "Headers": false, "history": false, + "History": false, + "HTMLAllCollection": false, "HTMLAnchorElement": false, + "HTMLAppletElement": false, + "HTMLAreaElement": false, + "HTMLAudioElement": false, "HTMLBaseElement": false, "HTMLBlockquoteElement": false, "HTMLBodyElement": false, "HTMLBRElement": false, "HTMLButtonElement": false, "HTMLCanvasElement": false, + "HTMLCollection": false, + "HTMLContentElement": false, + "HTMLDataListElement": false, + "HTMLDetailsElement": false, + "HTMLDialogElement": false, "HTMLDirectoryElement": false, "HTMLDivElement": false, "HTMLDListElement": false, + "HTMLDocument": false, "HTMLElement": false, + "HTMLEmbedElement": false, "HTMLFieldSetElement": false, "HTMLFontElement": false, + "HTMLFormControlsCollection": false, "HTMLFormElement": false, "HTMLFrameElement": false, "HTMLFrameSetElement": false, @@ -140,25 +321,36 @@ "HTMLImageElement": false, "HTMLInputElement": false, "HTMLIsIndexElement": false, + "HTMLKeygenElement": false, "HTMLLabelElement": false, "HTMLLayerElement": false, "HTMLLegendElement": false, "HTMLLIElement": false, "HTMLLinkElement": false, "HTMLMapElement": false, + "HTMLMarqueeElement": false, + "HTMLMediaElement": false, "HTMLMenuElement": false, "HTMLMetaElement": false, + "HTMLMeterElement": false, "HTMLModElement": false, "HTMLObjectElement": false, "HTMLOListElement": false, "HTMLOptGroupElement": false, "HTMLOptionElement": false, + "HTMLOptionsCollection": false, + "HTMLOutputElement": false, "HTMLParagraphElement": false, "HTMLParamElement": false, + "HTMLPictureElement": false, "HTMLPreElement": false, + "HTMLProgressElement": false, "HTMLQuoteElement": false, "HTMLScriptElement": false, "HTMLSelectElement": false, + "HTMLShadowElement": false, + "HTMLSourceElement": false, + "HTMLSpanElement": false, "HTMLStyleElement": false, "HTMLTableCaptionElement": false, "HTMLTableCellElement": false, @@ -166,9 +358,12 @@ "HTMLTableElement": false, "HTMLTableRowElement": false, "HTMLTableSectionElement": false, + "HTMLTemplateElement": false, "HTMLTextAreaElement": false, "HTMLTitleElement": false, + "HTMLTrackElement": false, "HTMLUListElement": false, + "HTMLUnknownElement": false, "HTMLVideoElement": false, "IDBCursor": false, "IDBCursorWithValue": false, @@ -183,30 +378,71 @@ "IDBTransaction": false, "IDBVersionChangeEvent": false, "Image": false, + "ImageBitmap": false, + "ImageData": false, "indexedDB": false, "innerHeight": false, "innerWidth": false, "InputEvent": false, + "InputMethodContext": false, "Intl": false, "KeyboardEvent": false, "length": false, "localStorage": false, "location": false, + "Location": false, + "locationbar": false, "matchMedia": false, + "MediaElementAudioSourceNode": false, + "MediaEncryptedEvent": false, + "MediaError": false, + "MediaKeyError": false, + "MediaKeyEvent": false, + "MediaKeyMessageEvent": false, + "MediaKeys": false, + "MediaKeySession": false, + "MediaKeyStatusMap": false, + "MediaKeySystemAccess": false, + "MediaList": false, + "MediaQueryList": false, + "MediaQueryListEvent": false, + "MediaSource": false, + "MediaStreamAudioDestinationNode": false, + "MediaStreamAudioSourceNode": false, + "MediaStreamEvent": false, + "MediaStreamTrack": false, + "menubar": false, "MessageChannel": false, "MessageEvent": false, "MessagePort": false, + "MIDIAccess": false, + "MIDIConnectionEvent": false, + "MIDIInput": false, + "MIDIInputMap": false, + "MIDIMessageEvent": false, + "MIDIOutput": false, + "MIDIOutputMap": false, + "MIDIPort": false, + "MimeType": false, + "MimeTypeArray": false, "MouseEvent": false, "moveBy": false, "moveTo": false, + "MutationEvent": false, "MutationObserver": false, + "MutationRecord": false, "name": false, + "NamedNodeMap": false, "navigator": false, + "Navigator": false, "Node": false, "NodeFilter": false, + "NodeIterator": false, "NodeList": false, "Notification": false, "OfflineAudioCompletionEvent": false, + "OfflineAudioContext": false, + "offscreenBuffering": false, "onbeforeunload": true, "onblur": true, "onerror": true, @@ -219,42 +455,86 @@ "opener": false, "opera": false, "Option": false, + "OscillatorNode": false, "outerHeight": false, "outerWidth": false, "PageTransitionEvent": false, "pageXOffset": false, "pageYOffset": false, "parent": false, + "Path2D": false, + "performance": false, + "Performance": false, + "PerformanceEntry": false, + "PerformanceMark": false, + "PerformanceMeasure": false, + "PerformanceNavigation": false, + "PerformanceResourceTiming": false, + "PerformanceTiming": false, + "PeriodicWave": false, + "Permissions": false, + "PermissionStatus": false, + "personalbar": false, + "Plugin": false, + "PluginArray": false, "PopStateEvent": false, "postMessage": false, "print": false, + "ProcessingInstruction": false, "ProgressEvent": false, "prompt": false, + "PushManager": false, + "PushSubscription": false, + "RadioNodeList": false, "Range": false, - "Request": false, - "Response": false, + "ReadableByteStream": false, + "ReadableStream": false, "removeEventListener": false, + "Request": false, "requestAnimationFrame": false, "resizeBy": false, "resizeTo": false, + "Response": false, + "RTCIceCandidate": false, + "RTCSessionDescription": false, "screen": false, + "Screen": false, + "screenLeft": false, + "ScreenOrientation": false, + "screenTop": false, "screenX": false, "screenY": false, + "ScriptProcessorNode": false, "scroll": false, "scrollbars": false, "scrollBy": false, "scrollTo": false, "scrollX": false, "scrollY": false, + "SecurityPolicyViolationEvent": false, + "Selection": false, "self": false, + "ServiceWorker": false, + "ServiceWorkerContainer": false, + "ServiceWorkerRegistration": false, "sessionStorage": false, "setInterval": false, "setTimeout": false, + "ShadowRoot": false, "SharedWorker": false, "showModalDialog": false, + "speechSynthesis": false, + "SpeechSynthesisEvent": false, + "SpeechSynthesisUtterance": false, "status": false, + "statusbar": false, "stop": false, + "Storage": false, "StorageEvent": false, + "styleMedia": false, + "StyleSheet": false, + "StyleSheetList": false, + "SubtleCrypto": false, "SVGAElement": false, "SVGAltGlyphDefElement": false, "SVGAltGlyphElement": false, @@ -289,6 +569,7 @@ "SVGCursorElement": false, "SVGDefsElement": false, "SVGDescElement": false, + "SVGDiscardElement": false, "SVGDocument": false, "SVGElement": false, "SVGElementInstance": false, @@ -304,6 +585,7 @@ "SVGFEDiffuseLightingElement": false, "SVGFEDisplacementMapElement": false, "SVGFEDistantLightElement": false, + "SVGFEDropShadowElement": false, "SVGFEFloodElement": false, "SVGFEFuncAElement": false, "SVGFEFuncBElement": false, @@ -331,9 +613,11 @@ "SVGFontFaceUriElement": false, "SVGForeignObjectElement": false, "SVGGElement": false, + "SVGGeometryElement": false, "SVGGlyphElement": false, "SVGGlyphRefElement": false, "SVGGradientElement": false, + "SVGGraphicsElement": false, "SVGHKernElement": false, "SVGICCColor": false, "SVGImageElement": false, @@ -411,14 +695,32 @@ "SVGViewSpec": false, "SVGVKernElement": false, "SVGZoomAndPan": false, + "SVGZoomEvent": false, "Text": false, "TextDecoder": false, "TextEncoder": false, + "TextEvent": false, + "TextMetrics": false, + "TextTrack": false, + "TextTrackCue": false, + "TextTrackCueList": false, + "TextTrackList": false, "TimeEvent": false, + "TimeRanges": false, + "toolbar": false, "top": false, + "Touch": false, "TouchEvent": false, + "TouchList": false, + "TrackEvent": false, + "TransitionEvent": false, + "TreeWalker": false, "UIEvent": false, "URL": false, + "URLSearchParams": false, + "ValidityState": false, + "VTTCue": false, + "WaveShaperNode": false, "WebGLActiveInfo": false, "WebGLBuffer": false, "WebGLContextEvent": false, @@ -436,19 +738,88 @@ "Window": false, "Worker": false, "XDomainRequest": false, + "XMLDocument": false, "XMLHttpRequest": false, + "XMLHttpRequestEventTarget": false, + "XMLHttpRequestProgressEvent": false, + "XMLHttpRequestUpload": false, "XMLSerializer": false, "XPathEvaluator": false, "XPathException": false, "XPathExpression": false, "XPathNamespace": false, "XPathNSResolver": false, - "XPathResult": false + "XPathResult": false, + "XSLTProcessor": false }, "worker": { + "applicationCache": false, + "atob": false, + "Blob": false, + "BroadcastChannel": false, + "btoa": false, + "Cache": false, + "caches": false, + "clearInterval": false, + "clearTimeout": false, + "close": true, + "console": false, + "fetch": false, + "FileReaderSync": false, + "FormData": false, + "Headers": false, + "IDBCursor": false, + "IDBCursorWithValue": false, + "IDBDatabase": false, + "IDBFactory": false, + "IDBIndex": false, + "IDBKeyRange": false, + "IDBObjectStore": false, + "IDBOpenDBRequest": false, + "IDBRequest": false, + "IDBTransaction": false, + "IDBVersionChangeEvent": false, + "ImageData": false, "importScripts": true, + "indexedDB": false, + "location": false, + "MessageChannel": false, + "MessagePort": false, + "name": false, + "navigator": false, + "Notification": false, + "onclose": true, + "onconnect": true, + "onerror": true, + "onlanguagechange": true, + "onmessage": true, + "onoffline": true, + "ononline": true, + "onrejectionhandled": true, + "onunhandledrejection": true, + "performance": false, + "Performance": false, + "PerformanceEntry": false, + "PerformanceMark": false, + "PerformanceMeasure": false, + "PerformanceNavigation": false, + "PerformanceResourceTiming": false, + "PerformanceTiming": false, "postMessage": true, - "self": true + "Promise": false, + "Request": false, + "Response": false, + "self": true, + "ServiceWorkerRegistration": false, + "setInterval": false, + "setTimeout": false, + "TextDecoder": false, + "TextEncoder": false, + "URL": false, + "URLSearchParams": false, + "WebSocket": false, + "Worker": false, + "XMLHttpRequest": false }, "node": { "__dirname": false, @@ -462,6 +833,7 @@ "exports": true, "GLOBAL": false, "global": false, + "Intl": false, "module": false, "process": false, "require": false, @@ -470,6 +842,12 @@ "setInterval": false, "setTimeout": false }, + "commonjs": { + "exports": true, + "module": false, + "require": false, + "global": false + }, "amd": { "define": false, "require": false @@ -515,6 +893,18 @@ "xdescribe": false, "xit": false }, + "jest": { + "afterEach": false, + "beforeEach": false, + "describe": false, + "expect": false, + "it": false, + "jest": false, + "pit": false, + "require": false, + "xdescribe": false, + "xit": false + }, "qunit": { "asyncTest": false, "deepEqual": false, @@ -523,6 +913,7 @@ "module": false, "notDeepEqual": false, "notEqual": false, + "notOk": false, "notPropEqual": false, "notStrictEqual": false, "ok": false, @@ -578,6 +969,26 @@ "toint32": false, "version": false }, + "nashorn": { + "__DIR__": false, + "__FILE__": false, + "__LINE__": false, + "com": false, + "edu": false, + "exit": false, + "Java": false, + "java": false, + "javafx": false, + "JavaImporter": false, + "javax": false, + "JSAdapter": false, + "load": false, + "loadWithNewGlobal": false, + "org": false, + "Packages": false, + "print": false, + "quit": false + }, "wsh": { "ActiveXObject": true, "Enumerator": true, @@ -615,6 +1026,7 @@ "find": false, "grep": false, "ls": false, + "ln": false, "mkdir": false, "mv": false, "popd": false, @@ -671,6 +1083,9 @@ "$": false, "_": false, "Accounts": false, + "AccountsClient": false, + "AccountsServer": false, + "AccountsCommon": false, "App": false, "Assets": false, "Blaze": false, @@ -678,6 +1093,7 @@ "Cordova": false, "DDP": false, "DDPServer": false, + "DDPRateLimiter": false, "Deps": false, "EJSON": false, "Email": false, @@ -695,6 +1111,7 @@ "ReactiveDict": false, "ReactiveVar": false, "Router": false, + "ServiceConfiguration": false, "Session": false, "share": false, "Spacebars": false, @@ -725,6 +1142,8 @@ "Mongo": false, "ObjectId": false, "PlanCache": false, + "print": false, + "printjson": false, "pwd": false, "quit": false, "removeFile": false, @@ -746,5 +1165,87 @@ "Path": false, "Progress": false, "Ref": false + }, + "serviceworker": { + "caches": false, + "Cache": false, + "CacheStorage": false, + "Client": false, + "clients": false, + "Clients": false, + "ExtendableEvent": false, + "ExtendableMessageEvent": false, + "FetchEvent": false, + "importScripts": false, + "registration": false, + "self": false, + "ServiceWorker": false, + "ServiceWorkerContainer": false, + "ServiceWorkerGlobalScope": false, + "ServiceWorkerMessageEvent": false, + "ServiceWorkerRegistration": false, + "skipWaiting": false, + "WindowClient": false + }, + "atomtest": { + "advanceClock": false, + "fakeClearInterval": false, + "fakeClearTimeout": false, + "fakeSetInterval": false, + "fakeSetTimeout": false, + "resetTimeouts": false, + "waitsForPromise": false + }, + "embertest": { + "andThen": false, + "click": false, + "currentPath": false, + "currentRouteName": false, + "currentURL": false, + "fillIn": false, + "find": false, + "findWithAssert": false, + "keyEvent": false, + "pauseTest": false, + "triggerEvent": false, + "visit": false + }, + "protractor": { + "$": false, + "$$": false, + "browser": false, + "By": false, + "by": false, + "DartObject": false, + "element": false, + "protractor": false + }, + "shared-node-browser": { + "clearInterval": false, + "clearTimeout": false, + "console": false, + "setInterval": false, + "setTimeout": false + }, + "webextensions": { + "browser": false, + "chrome": false, + "opr": false + }, + "greasemonkey": { + "GM_addStyle": false, + "GM_deleteValue": false, + "GM_getResourceText": false, + "GM_getResourceURL": false, + "GM_getValue": false, + "GM_info": false, + "GM_listValues": false, + "GM_log": false, + "GM_openInTab": false, + "GM_registerMenuCommand": false, + "GM_setClipboard": false, + "GM_setValue": false, + "GM_xmlhttpRequest": false, + "unsafeWindow": false } } diff --git a/tools/eslint/node_modules/globals/package.json b/tools/eslint/node_modules/globals/package.json index a2c763000d296e..351bed5d12d4a1 100644 --- a/tools/eslint/node_modules/globals/package.json +++ b/tools/eslint/node_modules/globals/package.json @@ -1,72 +1,107 @@ { - "name": "globals", - "version": "8.1.0", - "description": "Global identifiers from different JavaScript environments", - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/sindresorhus/globals" + "_args": [ + [ + "globals@^9.2.0", + "/Users/silverwind/git/node/tools/package/package" + ] + ], + "_from": "globals@>=9.2.0 <10.0.0", + "_id": "globals@9.4.0", + "_inCache": true, + "_installable": true, + "_location": "/globals", + "_nodeVersion": "4.3.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/globals-9.4.0.tgz_1459871365142_0.9750835259910673" + }, + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_npmVersion": "2.14.12", + "_phantomChildren": {}, + "_requested": { + "name": "globals", + "raw": "globals@^9.2.0", + "rawSpec": "^9.2.0", + "scope": null, + "spec": ">=9.2.0 <10.0.0", + "type": "range" }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/globals/-/globals-9.4.0.tgz", + "_shasum": "e89906bbd58b40305e5691ef934324e93325b35f", + "_shrinkwrap": null, + "_spec": "globals@^9.2.0", + "_where": "/Users/silverwind/git/node/tools/package/package", "author": { - "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", "url": "http://sindresorhus.com" }, + "bugs": { + "url": "https://github.com/sindresorhus/globals/issues" + }, + "dependencies": {}, + "description": "Global identifiers from different JavaScript environments", + "devDependencies": { + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "e89906bbd58b40305e5691ef934324e93325b35f", + "tarball": "https://registry.npmjs.org/globals/-/globals-9.4.0.tgz" + }, "engines": { "node": ">=0.10.0" }, - "scripts": { - "test": "mocha" - }, "files": [ - "index.js", - "globals.json" + "globals.json", + "index.js" ], + "gitHead": "77c6fd4f214140ef81c530c5b3da49ee346fd08a", + "homepage": "https://github.com/sindresorhus/globals", "keywords": [ - "globals", + "environments", + "eslint", "global", + "globals", "identifiers", - "variables", - "vars", "jshint", - "eslint", - "environments" + "variables", + "vars" ], - "devDependencies": { - "mocha": "*" - }, - "gitHead": "f86075648ac672a540e64c2a46de8ef49c15fc0b", - "bugs": { - "url": "https://github.com/sindresorhus/globals/issues" - }, - "homepage": "https://github.com/sindresorhus/globals", - "_id": "globals@8.1.0", - "_shasum": "f491df47705dfb94e06ff4ff2352babde95e10b8", - "_from": "globals@>=8.0.0 <9.0.0", - "_npmVersion": "2.10.1", - "_nodeVersion": "0.12.4", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "f491df47705dfb94e06ff4ff2352babde95e10b8", - "tarball": "http://registry.npmjs.org/globals/-/globals-8.1.0.tgz" - }, + "license": "MIT", "maintainers": [ { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" + "name": "byk", + "email": "ben@byk.im" + }, + { + "name": "lo1tuma", + "email": "schreck.mathias@gmail.com" }, { "name": "nzakas", "email": "nicholas@nczconsulting.com" }, { - "name": "lo1tuma", - "email": "schreck.mathias@gmail.com" + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/globals/-/globals-8.1.0.tgz" + "name": "globals", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/globals.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "9.4.0" } diff --git a/tools/eslint/node_modules/globals/readme.md b/tools/eslint/node_modules/globals/readme.md index dc23c97f35433c..5314bbb93a401d 100644 --- a/tools/eslint/node_modules/globals/readme.md +++ b/tools/eslint/node_modules/globals/readme.md @@ -2,10 +2,12 @@ > Global identifiers from different JavaScript environments -Extracted from [JSHint](https://github.com/jshint/jshint/blob/master/src/vars.js) and [ESLint](https://github.com/nzakas/eslint/blob/master/conf/environments.json) and merged. +Extracted from [JSHint](https://github.com/jshint/jshint/blob/3a8efa979dbb157bfb5c10b5826603a55a33b9ad/src/vars.js) and [ESLint](https://github.com/eslint/eslint/blob/b648406218f8a2d7302b98f5565e23199f44eb31/conf/environments.json) and merged. It's just a [JSON file](globals.json), so use it in whatever environment you like. +**This module [no longer accepts](https://github.com/sindresorhus/globals/issues/82) new environments. If you need it for ESLint, just [create a plugin](http://eslint.org/docs/developer-guide/working-with-plugins#environments-in-plugins).** + ## Install diff --git a/tools/eslint/node_modules/globby/index.js b/tools/eslint/node_modules/globby/index.js new file mode 100644 index 00000000000000..8f20018ff44a75 --- /dev/null +++ b/tools/eslint/node_modules/globby/index.js @@ -0,0 +1,68 @@ +'use strict'; +var Promise = require('pinkie-promise'); +var arrayUnion = require('array-union'); +var objectAssign = require('object-assign'); +var glob = require('glob'); +var arrify = require('arrify'); +var pify = require('pify'); + +function sortPatterns(patterns) { + patterns = arrify(patterns); + + var positives = []; + var negatives = []; + + patterns.forEach(function (pattern, index) { + var isNegative = pattern[0] === '!'; + (isNegative ? negatives : positives).push({ + index: index, + pattern: isNegative ? pattern.slice(1) : pattern + }); + }); + + return { + positives: positives, + negatives: negatives + }; +} + +function setIgnore(opts, negatives, positiveIndex) { + opts = objectAssign({}, opts); + + var negativePatterns = negatives.filter(function (negative) { + return negative.index > positiveIndex; + }).map(function (negative) { + return negative.pattern; + }); + + opts.ignore = (opts.ignore || []).concat(negativePatterns); + return opts; +} + +module.exports = function (patterns, opts) { + var sortedPatterns = sortPatterns(patterns); + opts = opts || {}; + + if (sortedPatterns.positives.length === 0) { + return Promise.resolve([]); + } + + return Promise.all(sortedPatterns.positives.map(function (positive) { + var globOpts = setIgnore(opts, sortedPatterns.negatives, positive.index); + return pify(glob, Promise)(positive.pattern, globOpts); + })).then(function (paths) { + return arrayUnion.apply(null, paths); + }); +}; + +module.exports.sync = function (patterns, opts) { + var sortedPatterns = sortPatterns(patterns); + + if (sortedPatterns.positives.length === 0) { + return []; + } + + return sortedPatterns.positives.reduce(function (ret, positive) { + return arrayUnion(ret, glob.sync(positive.pattern, setIgnore(opts, sortedPatterns.negatives, positive.index))); + }, []); +}; diff --git a/tools/eslint/node_modules/globby/license b/tools/eslint/node_modules/globby/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/tools/eslint/node_modules/globby/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tools/eslint/node_modules/globby/node_modules/glob/LICENSE b/tools/eslint/node_modules/globby/node_modules/glob/LICENSE new file mode 100644 index 00000000000000..19129e315fe593 --- /dev/null +++ b/tools/eslint/node_modules/globby/node_modules/glob/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/tools/eslint/node_modules/globby/node_modules/glob/README.md b/tools/eslint/node_modules/globby/node_modules/glob/README.md new file mode 100644 index 00000000000000..6960483bac63c6 --- /dev/null +++ b/tools/eslint/node_modules/globby/node_modules/glob/README.md @@ -0,0 +1,359 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +![](oh-my-glob.gif) + +## Usage + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Glob Primer + +"Globs" are the patterns you type when you do stuff like `ls *.js` on +the command line, or put `build/*` in a `.gitignore` file. + +Before parsing the path part patterns, braced sections are expanded +into a set. Braced sections start with `{` and end with `}`, with any +number of comma-delimited sections within. Braced sections may contain +slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. + +The following characters have special magic meaning when used in a +path portion: + +* `*` Matches 0 or more characters in a single path portion +* `?` Matches 1 character +* `[...]` Matches a range of characters, similar to a RegExp range. + If the first character of the range is `!` or `^` then it matches + any character not in the range. +* `!(pattern|pattern|pattern)` Matches anything that does not match + any of the patterns provided. +* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the + patterns provided. +* `+(pattern|pattern|pattern)` Matches one or more occurrences of the + patterns provided. +* `*(a|b|c)` Matches zero or more occurrences of the patterns provided +* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns + provided +* `**` If a "globstar" is alone in a path portion, then it matches + zero or more directories and subdirectories searching for matches. + It does not crawl symlinked directories. + +### Dots + +If a file or directory path portion has a `.` as the first character, +then it will not match any glob pattern unless that pattern's +corresponding path part also has a `.` as its first character. + +For example, the pattern `a/.*/c` would match the file at `a/.b/c`. +However the pattern `a/*/c` would not, because `*` does not start with +a dot character. + +You can make glob treat dots as normal characters by setting +`dot:true` in the options. + +### Basename Matching + +If you set `matchBase:true` in the options, and the pattern has no +slashes in it, then it will seek for any file anywhere in the tree +with a matching basename. For example, `*.js` would match +`test/simple/basic.js`. + +### Empty Sets + +If no matching files are found, then an empty array is returned. This +differs from the shell, where the pattern itself is returned. For +example: + + $ echo a*s*d*f + a*s*d*f + +To get the bash-style behavior, set the `nonull:true` in the options. + +### See Also: + +* `man sh` +* `man bash` (Search for "Pattern Matching") +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob.hasMagic(pattern, [options]) + +Returns `true` if there are any special characters in the pattern, and +`false` otherwise. + +Note that the options affect the results. If `noext:true` is set in +the options object, then `+(a|b)` will not be considered a magic +pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` +then that is considered magical, unless `nobrace:true` is set in the +options. + +## glob(pattern, [options], cb) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* `cb` `{Function}` + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* return: `{Array}` filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instantiating the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` `{String}` pattern to search for +* `options` `{Object}` +* `cb` `{Function}` Called when an error occurs, or matches are found + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `'FILE'` - Path exists, and is not a directory + * `'DIR'` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` +* `statCache` Cache of `fs.stat` results, to prevent statting the same + path multiple times. +* `symlinks` A record of which paths are symbolic links, which is + relevant in resolving `**` patterns. +* `realpathCache` An optional object which is passed to `fs.realpath` + to minimize unnecessary syscalls. It is stored on the instantiated + Glob object, and may be re-used. + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the specific + thing that matched. It is not deduplicated or resolved to a realpath. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `pause` Temporarily stop the search +* `resume` Resume the search +* `abort` Stop the search forever + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the Glob object, as well. + +If you are running many `glob` operations, you can pass a Glob object +as the `options` argument to a subsequent operation to shortcut some +`stat` and `readdir` calls. At the very least, you may pass in shared +`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that +parallel glob operations will be sped up by sharing information about +the filesystem. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. +* `silent` When an unusual error is encountered when attempting to + read a directory, a warning will be printed to stderr. Set the + `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered when attempting to + read a directory, the process will just continue on in search of + other matches. Set the `strict` option to raise an error in these + cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary + to set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `symlinks` A cache of known symbolic links. You may pass in a + previously generated `symlinks` object to save `lstat` calls when + resolving `**` matches. +* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. Set this + flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `debug` Set to enable debug logging in minimatch and glob. +* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. +* `noglobstar` Do not match `**` against multiple filenames. (Ie, + treat it as a normal `*` instead.) +* `noext` Do not match `+(a|b)` "extglob" patterns. +* `nocase` Perform a case-insensitive match. Note: on + case-insensitive filesystems, non-magic patterns will match by + default, since `stat` and `readdir` will not raise errors. +* `matchBase` Perform a basename-only match if the pattern does not + contain any slash characters. That is, `*.js` would be treated as + equivalent to `**/*.js`, matching all js files in all directories. +* `nodir` Do not match directories, only files. (Note: to match + *only* directories, simply put a `/` at the end of the pattern.) +* `ignore` Add a pattern or an array of glob patterns to exclude matches. + Note: `ignore` patterns are *always* in `dot:true` mode, regardless + of any other settings. +* `follow` Follow symlinked directories when expanding `**` patterns. + Note that this can result in a lot of duplicate references in the + presence of cyclic links. +* `realpath` Set to true to call `fs.realpath` on all of the results. + In the case of a symlink that cannot be resolved, the full absolute + path to the matched entry is returned (though it will usually be a + broken symlink) + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.3, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +Note that symlinked directories are not crawled as part of a `**`, +though their contents may match against subsequent portions of the +pattern. This prevents infinite loops and duplicates and the like. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +### Comments and Negation + +Previously, this module let you mark a pattern as a "comment" if it +started with a `#` character, or a "negated" pattern if it started +with a `!` character. + +These options were deprecated in version 5, and removed in version 6. + +To specify things that should not match, use the `ignore` option. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. + +## Contributing + +Any change to behavior (including bugfixes) must come with a test. + +Patches that fail tests or reduce performance will be rejected. + +``` +# to run tests +npm test + +# to re-generate test fixtures +npm run test-regen + +# to benchmark against bash/zsh +npm run bench + +# to profile javascript +npm run prof +``` diff --git a/tools/eslint/node_modules/globby/node_modules/glob/common.js b/tools/eslint/node_modules/globby/node_modules/glob/common.js new file mode 100644 index 00000000000000..c9127eb334f18b --- /dev/null +++ b/tools/eslint/node_modules/globby/node_modules/glob/common.js @@ -0,0 +1,226 @@ +exports.alphasort = alphasort +exports.alphasorti = alphasorti +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored + +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) +} + +var path = require("path") +var minimatch = require("minimatch") +var isAbsolute = require("path-is-absolute") +var Minimatch = minimatch.Minimatch + +function alphasorti (a, b) { + return a.toLowerCase().localeCompare(b.toLowerCase()) +} + +function alphasort (a, b) { + return a.localeCompare(b) +} + +function setupIgnores (self, options) { + self.ignore = options.ignore || [] + + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] + + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} + +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } + + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} + +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") + } + pattern = "**/" + pattern + } + + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) + + setupIgnores(self, options) + + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = options.cwd + self.changedCwd = path.resolve(options.cwd) !== cwd + } + + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") + + self.nomount = !!options.nomount + + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true + + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) + } + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(self.nocase ? alphasorti : alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) + } + if (self.nodir) { + all = all.filter(function (e) { + return !(/\/$/.test(e)) + }) + } + } + + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) + + self.found = all +} + +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' + + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] + } + } + + return m +} + +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } + return abs +} + + +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} + +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false + + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) +} diff --git a/tools/eslint/node_modules/globby/node_modules/glob/glob.js b/tools/eslint/node_modules/globby/node_modules/glob/glob.js new file mode 100644 index 00000000000000..a62da27ebd507a --- /dev/null +++ b/tools/eslint/node_modules/globby/node_modules/glob/glob.js @@ -0,0 +1,765 @@ +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. + +module.exports = glob + +var fs = require('fs') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var inherits = require('inherits') +var EE = require('events').EventEmitter +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var globSync = require('./sync.js') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = require('inflight') +var util = require('util') +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +var once = require('once') + +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} + + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } + + return new Glob(pattern, options, cb) +} + +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync + +// old api surface +glob.glob = glob + +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } + + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} + +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true + + var g = new Glob(pattern, options) + var set = g.minimatch.set + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false +} + +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } + + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) + + setopts(this, pattern, options) + this._didRealPath = false + + // process each pattern in the minimatch set + var n = this.minimatch.set.length + + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) + + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } + + var self = this + var n = this.minimatch.set.length + this._processing = 0 + this.matches = new Array(n) + + this._emitQueue = [] + this._processQueue = [] + this.paused = false + + if (this.noprocess) + return this + + if (n === 0) + return done() + + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + + function done () { + --self._processing + if (self._processing <= 0) + self._finish() + } +} + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + fs.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } + } + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } + } + } +} + +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') + + if (this.aborted) + return + + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } + + //console.error('PROCESS %d', this._processing, pattern) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} + +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (this.matches[index][e]) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = this._makeAbs(e) + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + if (this.mark) + e = this._mark(e) + + this.matches[index][e] = true + + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er) + return cb() + + var isSym = lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + this.cache[this._makeAbs(f)] = 'FILE' + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } + + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er) { + this.statCache[abs] = false + return cb() + } + + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && !stat.isDirectory()) + return cb(null, false, stat) + + var c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c !== 'DIR') + return cb() + + return cb(null, c, stat) +} diff --git a/tools/eslint/node_modules/globby/node_modules/glob/package.json b/tools/eslint/node_modules/globby/node_modules/glob/package.json new file mode 100644 index 00000000000000..8ed608ec65a303 --- /dev/null +++ b/tools/eslint/node_modules/globby/node_modules/glob/package.json @@ -0,0 +1,98 @@ +{ + "_args": [ + [ + "glob@^6.0.1", + "/Users/silverwind/git/node/tools/package/package/node_modules/globby" + ] + ], + "_from": "glob@>=6.0.1 <7.0.0", + "_id": "glob@6.0.4", + "_inCache": true, + "_installable": true, + "_location": "/globby/glob", + "_nodeVersion": "4.0.0", + "_npmUser": { + "email": "i@izs.me", + "name": "isaacs" + }, + "_npmVersion": "2.14.15", + "_phantomChildren": {}, + "_requested": { + "name": "glob", + "raw": "glob@^6.0.1", + "rawSpec": "^6.0.1", + "scope": null, + "spec": ">=6.0.1 <7.0.0", + "type": "range" + }, + "_requiredBy": [ + "/globby" + ], + "_resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", + "_shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22", + "_shrinkwrap": null, + "_spec": "glob@^6.0.1", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/globby", + "author": { + "email": "i@izs.me", + "name": "Isaac Z. Schlueter", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/node-glob/issues" + }, + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "description": "a little globber", + "devDependencies": { + "mkdirp": "0", + "rimraf": "^2.2.8", + "tap": "^5.0.0", + "tick": "0.0.6" + }, + "directories": {}, + "dist": { + "shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22", + "tarball": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz" + }, + "engines": { + "node": "*" + }, + "files": [ + "common.js", + "glob.js", + "sync.js" + ], + "gitHead": "3bd419c538737e56fda7e21c21ff52ca0c198df6", + "homepage": "https://github.com/isaacs/node-glob#readme", + "license": "ISC", + "main": "glob.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "glob", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "scripts": { + "bench": "bash benchmark.sh", + "benchclean": "node benchclean.js", + "prepublish": "npm run benchclean", + "prof": "bash prof.sh && cat profile.txt", + "profclean": "rm -f v8.log profile.txt", + "test": "tap test/*.js --cov", + "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js" + }, + "version": "6.0.4" +} diff --git a/tools/eslint/node_modules/globby/node_modules/glob/sync.js b/tools/eslint/node_modules/globby/node_modules/glob/sync.js new file mode 100644 index 00000000000000..09883d2ce0c9de --- /dev/null +++ b/tools/eslint/node_modules/globby/node_modules/glob/sync.js @@ -0,0 +1,460 @@ +module.exports = globSync +globSync.GlobSync = GlobSync + +var fs = require('fs') +var minimatch = require('minimatch') +var Minimatch = minimatch.Minimatch +var Glob = require('./glob.js').Glob +var util = require('util') +var path = require('path') +var assert = require('assert') +var isAbsolute = require('path-is-absolute') +var common = require('./common.js') +var alphasort = common.alphasort +var alphasorti = common.alphasorti +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = fs.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this.matches[index][e] = true + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + var abs = this._makeAbs(e) + if (this.mark) + e = this._mark(e) + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[this._makeAbs(e)] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + // lstat failed, doesn't exist + return null + } + + var isSym = lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + this.cache[this._makeAbs(f)] = 'FILE' + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this.matches[index][prefix] = true +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = fs.lstatSync(abs) + } catch (er) { + return false + } + + if (lstat.isSymbolicLink()) { + try { + stat = fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c !== 'DIR') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} diff --git a/tools/eslint/node_modules/globby/package.json b/tools/eslint/node_modules/globby/package.json new file mode 100644 index 00000000000000..b5a0101dc03a5c --- /dev/null +++ b/tools/eslint/node_modules/globby/package.json @@ -0,0 +1,137 @@ +{ + "_args": [ + [ + "globby@^4.0.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/del" + ] + ], + "_from": "globby@>=4.0.0 <5.0.0", + "_id": "globby@4.0.0", + "_inCache": true, + "_installable": true, + "_location": "/globby", + "_nodeVersion": "4.2.1", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_npmVersion": "2.14.7", + "_phantomChildren": { + "inflight": "1.0.4", + "inherits": "2.0.1", + "minimatch": "3.0.0", + "once": "1.3.3", + "path-is-absolute": "1.0.0" + }, + "_requested": { + "name": "globby", + "raw": "globby@^4.0.0", + "rawSpec": "^4.0.0", + "scope": null, + "spec": ">=4.0.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/del" + ], + "_resolved": "https://registry.npmjs.org/globby/-/globby-4.0.0.tgz", + "_shasum": "36ff06c5a9dc1dbc201f700074992882857e9817", + "_shrinkwrap": null, + "_spec": "globby@^4.0.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/del", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/globby/issues" + }, + "dependencies": { + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "glob": "^6.0.1", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "description": "Extends `glob` with support for multiple patterns and exposes a Promise API", + "devDependencies": { + "glob-stream": "git+https://github.com/wearefractal/glob-stream.git#master", + "globby": "git+https://github.com/sindresorhus/globby.git#master", + "matcha": "^0.6.0", + "mocha": "*", + "rimraf": "^2.2.8", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "36ff06c5a9dc1dbc201f700074992882857e9817", + "tarball": "https://registry.npmjs.org/globby/-/globby-4.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "70389b06d4633868ea016ce38956d0a86aa90a23", + "homepage": "https://github.com/sindresorhus/globby", + "keywords": [ + "all", + "array", + "directories", + "dirs", + "expand", + "files", + "filesystem", + "filter", + "find", + "fnmatch", + "folders", + "fs", + "glob", + "globbing", + "globs", + "gulpfriendly", + "match", + "matcher", + "minimatch", + "multi", + "multiple", + "paths", + "pattern", + "patterns", + "promise", + "traverse", + "util", + "utility", + "wildcard", + "wildcards" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "globby", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/globby.git" + }, + "scripts": { + "bench": "npm update globby glob-stream && matcha bench.js", + "test": "xo && mocha" + }, + "version": "4.0.0", + "xo": { + "envs": [ + "mocha", + "node" + ] + } +} diff --git a/tools/eslint/node_modules/globby/readme.md b/tools/eslint/node_modules/globby/readme.md new file mode 100644 index 00000000000000..e0881d54febc09 --- /dev/null +++ b/tools/eslint/node_modules/globby/readme.md @@ -0,0 +1,75 @@ +# globby [![Build Status](https://travis-ci.org/sindresorhus/globby.svg?branch=master)](https://travis-ci.org/sindresorhus/globby) + +> Extends [glob](https://github.com/isaacs/node-glob) with support for multiple patterns and exposes a Promise API + + +## Install + +``` +$ npm install --save globby +``` + + +## Usage + +``` +├── unicorn +├── cake +└── rainbow +``` + +```js +const globby = require('globby'); + +globby(['*', '!cake']).then(paths => { + console.log(paths); + //=> ['unicorn', 'rainbow'] +}); +``` + + +## API + +### globby(patterns, [options]) + +Returns a promise that resolves to an array of matching paths. + +### globby.sync(patterns, [options]) + +Returns an array of matching paths. + +#### patterns + +Type: `string`, `array` + +See supported `minimatch` [patterns](https://github.com/isaacs/minimatch#usage). + +#### options + +Type: `object` + +See the `node-glob` [options](https://github.com/isaacs/node-glob#options). + + +## Globbing patterns + +Just a quick overview. + +- `*` matches any number of characters, but not `/` +- `?` matches a single character, but not `/` +- `**` matches any number of characters, including `/`, as long as it's the only thing in a path part +- `{}` allows for a comma-separated list of "or" expressions +- `!` at the beginning of a pattern will negate the match + +[Various patterns and expected matches](https://github.com/sindresorhus/multimatch/blob/master/test.js). + + +## Related + +- [multimatch](https://github.com/sindresorhus/multimatch) - Match against a list instead of the filesystem. +- [glob-stream](https://github.com/wearefractal/glob-stream) - Streaming alternative. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/eslint/node_modules/graceful-fs/LICENSE b/tools/eslint/node_modules/graceful-fs/LICENSE new file mode 100644 index 00000000000000..9d2c8036969bed --- /dev/null +++ b/tools/eslint/node_modules/graceful-fs/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter, Ben Noordhuis, and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/tools/eslint/node_modules/graceful-fs/README.md b/tools/eslint/node_modules/graceful-fs/README.md new file mode 100644 index 00000000000000..d920aaac9e17af --- /dev/null +++ b/tools/eslint/node_modules/graceful-fs/README.md @@ -0,0 +1,53 @@ +# graceful-fs + +graceful-fs functions as a drop-in replacement for the fs module, +making various improvements. + +The improvements are meant to normalize behavior across different +platforms and environments, and to make filesystem access more +resilient to errors. + +## Improvements over [fs module](http://api.nodejs.org/fs.html) + +graceful-fs: + +* Queues up `open` and `readdir` calls, and retries them once + something closes if there is an EMFILE error from too many file + descriptors. +* fixes `lchmod` for Node versions prior to 0.6.2. +* implements `fs.lutimes` if possible. Otherwise it becomes a noop. +* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or + `lchown` if the user isn't root. +* makes `lchmod` and `lchown` become noops, if not available. +* retries reading a file if `read` results in EAGAIN error. + +On Windows, it retries renaming a file for up to one second if `EACCESS` +or `EPERM` error occurs, likely because antivirus software has locked +the directory. + +## USAGE + +```javascript +// use just like fs +var fs = require('graceful-fs') + +// now go and do stuff with it... +fs.readFileSync('some-file-or-whatever') +``` + +## Global Patching + +If you want to patch the global fs module (or any other fs-like +module) you can do this: + +```javascript +// Make sure to read the caveat below. +var realFs = require('fs') +var gracefulFs = require('graceful-fs') +gracefulFs.gracefulify(realFs) +``` + +This should only ever be done at the top-level application layer, in +order to delay on EMFILE errors from any fs-using dependencies. You +should **not** do this in a library, because it can cause unexpected +delays in other parts of the program. diff --git a/tools/eslint/node_modules/graceful-fs/fs.js b/tools/eslint/node_modules/graceful-fs/fs.js new file mode 100644 index 00000000000000..8ad4a383965b7b --- /dev/null +++ b/tools/eslint/node_modules/graceful-fs/fs.js @@ -0,0 +1,21 @@ +'use strict' + +var fs = require('fs') + +module.exports = clone(fs) + +function clone (obj) { + if (obj === null || typeof obj !== 'object') + return obj + + if (obj instanceof Object) + var copy = { __proto__: obj.__proto__ } + else + var copy = Object.create(null) + + Object.getOwnPropertyNames(obj).forEach(function (key) { + Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) + }) + + return copy +} diff --git a/tools/eslint/node_modules/graceful-fs/graceful-fs.js b/tools/eslint/node_modules/graceful-fs/graceful-fs.js new file mode 100644 index 00000000000000..9bf803e686c703 --- /dev/null +++ b/tools/eslint/node_modules/graceful-fs/graceful-fs.js @@ -0,0 +1,253 @@ +var fs = require('fs') +var polyfills = require('./polyfills.js') +var legacy = require('./legacy-streams.js') +var queue = [] + +var util = require('util') + +function noop () {} + +var debug = noop +if (util.debuglog) + debug = util.debuglog('gfs4') +else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) + debug = function() { + var m = util.format.apply(util, arguments) + m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') + console.error(m) + } + +if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { + process.on('exit', function() { + debug(queue) + require('assert').equal(queue.length, 0) + }) +} + +module.exports = patch(require('./fs.js')) +if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH) { + module.exports = patch(fs) +} + +// Always patch fs.close/closeSync, because we want to +// retry() whenever a close happens *anywhere* in the program. +// This is essential when multiple graceful-fs instances are +// in play at the same time. +module.exports.close = +fs.close = (function (fs$close) { return function (fd, cb) { + return fs$close.call(fs, fd, function (err) { + if (!err) + retry() + + if (typeof cb === 'function') + cb.apply(this, arguments) + }) +}})(fs.close) + +module.exports.closeSync = +fs.closeSync = (function (fs$closeSync) { return function (fd) { + // Note that graceful-fs also retries when fs.closeSync() fails. + // Looks like a bug to me, although it's probably a harmless one. + var rval = fs$closeSync.apply(fs, arguments) + retry() + return rval +}})(fs.closeSync) + +function patch (fs) { + // Everything that references the open() function needs to be in here + polyfills(fs) + fs.gracefulify = patch + fs.FileReadStream = ReadStream; // Legacy name. + fs.FileWriteStream = WriteStream; // Legacy name. + fs.createReadStream = createReadStream + fs.createWriteStream = createWriteStream + var fs$readFile = fs.readFile + fs.readFile = readFile + function readFile (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$readFile(path, options, cb) + + function go$readFile (path, options, cb) { + return fs$readFile(path, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readFile, [path, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$writeFile = fs.writeFile + fs.writeFile = writeFile + function writeFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$writeFile(path, data, options, cb) + + function go$writeFile (path, data, options, cb) { + return fs$writeFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$writeFile, [path, data, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$appendFile = fs.appendFile + if (fs$appendFile) + fs.appendFile = appendFile + function appendFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$appendFile(path, data, options, cb) + + function go$appendFile (path, data, options, cb) { + return fs$appendFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$appendFile, [path, data, options, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + var fs$readdir = fs.readdir + fs.readdir = readdir + function readdir (path, cb) { + return go$readdir(path, cb) + + function go$readdir () { + return fs$readdir(path, function (err, files) { + if (files && files.sort) + files.sort(); // Backwards compatibility with graceful-fs. + + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readdir, [path, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + + if (process.version.substr(0, 4) === 'v0.8') { + var legStreams = legacy(fs) + ReadStream = legStreams.ReadStream + WriteStream = legStreams.WriteStream + } + + var fs$ReadStream = fs.ReadStream + ReadStream.prototype = Object.create(fs$ReadStream.prototype) + ReadStream.prototype.open = ReadStream$open + + var fs$WriteStream = fs.WriteStream + WriteStream.prototype = Object.create(fs$WriteStream.prototype) + WriteStream.prototype.open = WriteStream$open + + fs.ReadStream = ReadStream + fs.WriteStream = WriteStream + + function ReadStream (path, options) { + if (this instanceof ReadStream) + return fs$ReadStream.apply(this, arguments), this + else + return ReadStream.apply(Object.create(ReadStream.prototype), arguments) + } + + function ReadStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + if (that.autoClose) + that.destroy() + + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + that.read() + } + }) + } + + function WriteStream (path, options) { + if (this instanceof WriteStream) + return fs$WriteStream.apply(this, arguments), this + else + return WriteStream.apply(Object.create(WriteStream.prototype), arguments) + } + + function WriteStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + that.destroy() + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + } + }) + } + + function createReadStream (path, options) { + return new ReadStream(path, options) + } + + function createWriteStream (path, options) { + return new WriteStream(path, options) + } + + var fs$open = fs.open + fs.open = open + function open (path, flags, mode, cb) { + if (typeof mode === 'function') + cb = mode, mode = null + + return go$open(path, flags, mode, cb) + + function go$open (path, flags, mode, cb) { + return fs$open(path, flags, mode, function (err, fd) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$open, [path, flags, mode, cb]]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + retry() + } + }) + } + } + + return fs +} + +function enqueue (elem) { + debug('ENQUEUE', elem[0].name, elem[1]) + queue.push(elem) +} + +function retry () { + var elem = queue.shift() + if (elem) { + debug('RETRY', elem[0].name, elem[1]) + elem[0].apply(null, elem[1]) + } +} diff --git a/tools/eslint/node_modules/graceful-fs/legacy-streams.js b/tools/eslint/node_modules/graceful-fs/legacy-streams.js new file mode 100644 index 00000000000000..d617b50fc0832d --- /dev/null +++ b/tools/eslint/node_modules/graceful-fs/legacy-streams.js @@ -0,0 +1,118 @@ +var Stream = require('stream').Stream + +module.exports = legacy + +function legacy (fs) { + return { + ReadStream: ReadStream, + WriteStream: WriteStream + } + + function ReadStream (path, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path, options); + + Stream.call(this); + + var self = this; + + this.path = path; + this.fd = null; + this.readable = true; + this.paused = false; + + this.flags = 'r'; + this.mode = 438; /*=0666*/ + this.bufferSize = 64 * 1024; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.encoding) this.setEncoding(this.encoding); + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.end === undefined) { + this.end = Infinity; + } else if ('number' !== typeof this.end) { + throw TypeError('end must be a Number'); + } + + if (this.start > this.end) { + throw new Error('start must be <= end'); + } + + this.pos = this.start; + } + + if (this.fd !== null) { + process.nextTick(function() { + self._read(); + }); + return; + } + + fs.open(this.path, this.flags, this.mode, function (err, fd) { + if (err) { + self.emit('error', err); + self.readable = false; + return; + } + + self.fd = fd; + self.emit('open', fd); + self._read(); + }) + } + + function WriteStream (path, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path, options); + + Stream.call(this); + + this.path = path; + this.fd = null; + this.writable = true; + + this.flags = 'w'; + this.encoding = 'binary'; + this.mode = 438; /*=0666*/ + this.bytesWritten = 0; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.start < 0) { + throw new Error('start must be >= zero'); + } + + this.pos = this.start; + } + + this.busy = false; + this._queue = []; + + if (this.fd === null) { + this._open = fs.open; + this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); + this.flush(); + } + } +} diff --git a/tools/eslint/node_modules/graceful-fs/package.json b/tools/eslint/node_modules/graceful-fs/package.json new file mode 100644 index 00000000000000..cbe6dfc359a40b --- /dev/null +++ b/tools/eslint/node_modules/graceful-fs/package.json @@ -0,0 +1,104 @@ +{ + "_args": [ + [ + "graceful-fs@^4.1.2", + "/Users/silverwind/git/node/tools/package/package/node_modules/flat-cache" + ] + ], + "_from": "graceful-fs@>=4.1.2 <5.0.0", + "_id": "graceful-fs@4.1.3", + "_inCache": true, + "_installable": true, + "_location": "/graceful-fs", + "_nodeVersion": "4.0.0", + "_npmOperationalInternal": { + "host": "packages-6-west.internal.npmjs.com", + "tmp": "tmp/graceful-fs-4.1.3.tgz_1454449326495_0.943017533281818" + }, + "_npmUser": { + "email": "i@izs.me", + "name": "isaacs" + }, + "_npmVersion": "3.7.0", + "_phantomChildren": {}, + "_requested": { + "name": "graceful-fs", + "raw": "graceful-fs@^4.1.2", + "rawSpec": "^4.1.2", + "scope": null, + "spec": ">=4.1.2 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/flat-cache", + "/read-json-sync" + ], + "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.3.tgz", + "_shasum": "92033ce11113c41e2628d61fdfa40bc10dc0155c", + "_shrinkwrap": null, + "_spec": "graceful-fs@^4.1.2", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/flat-cache", + "bugs": { + "url": "https://github.com/isaacs/node-graceful-fs/issues" + }, + "dependencies": {}, + "description": "A drop-in replacement for fs, making various improvements.", + "devDependencies": { + "mkdirp": "^0.5.0", + "rimraf": "^2.2.8", + "tap": "^5.4.2" + }, + "directories": { + "test": "test" + }, + "dist": { + "shasum": "92033ce11113c41e2628d61fdfa40bc10dc0155c", + "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.3.tgz" + }, + "engines": { + "node": ">=0.4.0" + }, + "files": [ + "fs.js", + "graceful-fs.js", + "legacy-streams.js", + "polyfills.js" + ], + "gitHead": "694c56f3aed4aee62d6df169be123d3984f61b85", + "homepage": "https://github.com/isaacs/node-graceful-fs#readme", + "keywords": [ + "EACCESS", + "EAGAIN", + "EINVAL", + "EMFILE", + "EPERM", + "error", + "errors", + "fs", + "handling", + "module", + "queue", + "reading", + "retries", + "retry" + ], + "license": "ISC", + "main": "graceful-fs.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "graceful-fs", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/node-graceful-fs.git" + }, + "scripts": { + "test": "node test.js | tap -" + }, + "version": "4.1.3" +} diff --git a/tools/eslint/node_modules/graceful-fs/polyfills.js b/tools/eslint/node_modules/graceful-fs/polyfills.js new file mode 100644 index 00000000000000..5e4f4804618d17 --- /dev/null +++ b/tools/eslint/node_modules/graceful-fs/polyfills.js @@ -0,0 +1,252 @@ +var fs = require('./fs.js') +var constants = require('constants') + +var origCwd = process.cwd +var cwd = null +process.cwd = function() { + if (!cwd) + cwd = origCwd.call(process) + return cwd +} +try { + process.cwd() +} catch (er) {} + +var chdir = process.chdir +process.chdir = function(d) { + cwd = null + chdir.call(process, d) +} + +module.exports = patch + +function patch (fs) { + // (re-)implement some things that are known busted or missing. + + // lchmod, broken prior to 0.6.2 + // back-port the fix here. + if (constants.hasOwnProperty('O_SYMLINK') && + process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + patchLchmod(fs) + } + + // lutimes implementation, or no-op + if (!fs.lutimes) { + patchLutimes(fs) + } + + // https://github.com/isaacs/node-graceful-fs/issues/4 + // Chown should not fail on einval or eperm if non-root. + // It should not fail on enosys ever, as this just indicates + // that a fs doesn't support the intended operation. + + fs.chown = chownFix(fs.chown) + fs.fchown = chownFix(fs.fchown) + fs.lchown = chownFix(fs.lchown) + + fs.chmod = chownFix(fs.chmod) + fs.fchmod = chownFix(fs.fchmod) + fs.lchmod = chownFix(fs.lchmod) + + fs.chownSync = chownFixSync(fs.chownSync) + fs.fchownSync = chownFixSync(fs.fchownSync) + fs.lchownSync = chownFixSync(fs.lchownSync) + + fs.chmodSync = chownFix(fs.chmodSync) + fs.fchmodSync = chownFix(fs.fchmodSync) + fs.lchmodSync = chownFix(fs.lchmodSync) + + // if lchmod/lchown do not exist, then make them no-ops + if (!fs.lchmod) { + fs.lchmod = function (path, mode, cb) { + process.nextTick(cb) + } + fs.lchmodSync = function () {} + } + if (!fs.lchown) { + fs.lchown = function (path, uid, gid, cb) { + process.nextTick(cb) + } + fs.lchownSync = function () {} + } + + // on Windows, A/V software can lock the directory, causing this + // to fail with an EACCES or EPERM if the directory contains newly + // created files. Try again on failure, for up to 1 second. + if (process.platform === "win32") { + fs.rename = (function (fs$rename) { return function (from, to, cb) { + var start = Date.now() + fs$rename(from, to, function CB (er) { + if (er + && (er.code === "EACCES" || er.code === "EPERM") + && Date.now() - start < 1000) { + return fs$rename(from, to, CB) + } + if (cb) cb(er) + }) + }})(fs.rename) + } + + // if read() returns EAGAIN, then just try it again. + fs.read = (function (fs$read) { return function (fd, buffer, offset, length, position, callback_) { + var callback + if (callback_ && typeof callback_ === 'function') { + var eagCounter = 0 + callback = function (er, _, __) { + if (er && er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + callback_.apply(this, arguments) + } + } + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + }})(fs.read) + + fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) { + var eagCounter = 0 + while (true) { + try { + return fs$readSync.call(fs, fd, buffer, offset, length, position) + } catch (er) { + if (er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + continue + } + throw er + } + } + }})(fs.readSync) +} + +function patchLchmod (fs) { + fs.lchmod = function (path, mode, callback) { + callback = callback || noop + fs.open( path + , constants.O_WRONLY | constants.O_SYMLINK + , mode + , function (err, fd) { + if (err) { + callback(err) + return + } + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + fs.fchmod(fd, mode, function (err) { + fs.close(fd, function(err2) { + callback(err || err2) + }) + }) + }) + } + + fs.lchmodSync = function (path, mode) { + var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) + + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + var threw = true + var ret + try { + ret = fs.fchmodSync(fd, mode) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } +} + +function patchLutimes (fs) { + if (constants.hasOwnProperty("O_SYMLINK")) { + fs.lutimes = function (path, at, mt, cb) { + fs.open(path, constants.O_SYMLINK, function (er, fd) { + cb = cb || noop + if (er) return cb(er) + fs.futimes(fd, at, mt, function (er) { + fs.close(fd, function (er2) { + return cb(er || er2) + }) + }) + }) + } + + fs.lutimesSync = function (path, at, mt) { + var fd = fs.openSync(path, constants.O_SYMLINK) + var ret + var threw = true + try { + ret = fs.futimesSync(fd, at, mt) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + + } else { + fs.lutimes = function (_a, _b, _c, cb) { process.nextTick(cb) } + fs.lutimesSync = function () {} + } +} + +function chownFix (orig) { + if (!orig) return orig + return function (target, uid, gid, cb) { + return orig.call(fs, target, uid, gid, function (er, res) { + if (chownErOk(er)) er = null + cb(er, res) + }) + } +} + +function chownFixSync (orig) { + if (!orig) return orig + return function (target, uid, gid) { + try { + return orig.call(fs, target, uid, gid) + } catch (er) { + if (!chownErOk(er)) throw er + } + } +} + +// ENOSYS means that the fs doesn't support the op. Just ignore +// that, because it doesn't matter. +// +// if there's no getuid, or if getuid() is something other +// than 0, and the error is EINVAL or EPERM, then just ignore +// it. +// +// This specific case is a silent failure in cp, install, tar, +// and most other unix tools that manage permissions. +// +// When running as root, or if other types of errors are +// encountered, then it's strict. +function chownErOk (er) { + if (!er) + return true + + if (er.code === "ENOSYS") + return true + + var nonroot = !process.getuid || process.getuid() !== 0 + if (nonroot) { + if (er.code === "EINVAL" || er.code === "EPERM") + return true + } + + return false +} diff --git a/tools/eslint/node_modules/chalk/node_modules/has-ansi/index.js b/tools/eslint/node_modules/has-ansi/index.js similarity index 100% rename from tools/eslint/node_modules/chalk/node_modules/has-ansi/index.js rename to tools/eslint/node_modules/has-ansi/index.js diff --git a/tools/eslint/node_modules/has-ansi/license b/tools/eslint/node_modules/has-ansi/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/tools/eslint/node_modules/has-ansi/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tools/eslint/node_modules/has-ansi/package.json b/tools/eslint/node_modules/has-ansi/package.json new file mode 100644 index 00000000000000..aa6114cc023f0a --- /dev/null +++ b/tools/eslint/node_modules/has-ansi/package.json @@ -0,0 +1,110 @@ +{ + "_args": [ + [ + "has-ansi@^2.0.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/chalk" + ] + ], + "_from": "has-ansi@>=2.0.0 <3.0.0", + "_id": "has-ansi@2.0.0", + "_inCache": true, + "_installable": true, + "_location": "/has-ansi", + "_nodeVersion": "0.12.5", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_npmVersion": "2.11.2", + "_phantomChildren": {}, + "_requested": { + "name": "has-ansi", + "raw": "has-ansi@^2.0.0", + "rawSpec": "^2.0.0", + "scope": null, + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/chalk" + ], + "_resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "_shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", + "_shrinkwrap": null, + "_spec": "has-ansi@^2.0.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/chalk", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/has-ansi/issues" + }, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "description": "Check if a string has ANSI escape codes", + "devDependencies": { + "ava": "0.0.4" + }, + "directories": {}, + "dist": { + "shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", + "tarball": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "0722275e1bef139fcd09137da6e5550c3cd368b9", + "homepage": "https://github.com/sindresorhus/has-ansi", + "keywords": [ + "ansi", + "color", + "colors", + "colour", + "command-line", + "console", + "escape", + "find", + "has", + "match", + "pattern", + "re", + "regex", + "regexp", + "shell", + "string", + "styles", + "terminal", + "test", + "text", + "tty", + "xterm" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "name": "has-ansi", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/has-ansi.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "2.0.0" +} diff --git a/tools/eslint/node_modules/has-ansi/readme.md b/tools/eslint/node_modules/has-ansi/readme.md new file mode 100644 index 00000000000000..02bc7c2300a679 --- /dev/null +++ b/tools/eslint/node_modules/has-ansi/readme.md @@ -0,0 +1,36 @@ +# has-ansi [![Build Status](https://travis-ci.org/sindresorhus/has-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/has-ansi) + +> Check if a string has [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install --save has-ansi +``` + + +## Usage + +```js +var hasAnsi = require('has-ansi'); + +hasAnsi('\u001b[4mcake\u001b[0m'); +//=> true + +hasAnsi('cake'); +//=> false +``` + + +## Related + +- [has-ansi-cli](https://github.com/sindresorhus/has-ansi-cli) - CLI for this module +- [strip-ansi](https://github.com/sindresorhus/strip-ansi) - Strip ANSI escape codes +- [ansi-regex](https://github.com/sindresorhus/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/sindresorhus/chalk) - Terminal string styling done right + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/eslint/node_modules/ignore/LICENSE-MIT b/tools/eslint/node_modules/ignore/LICENSE-MIT new file mode 100755 index 00000000000000..825533e337fa1d --- /dev/null +++ b/tools/eslint/node_modules/ignore/LICENSE-MIT @@ -0,0 +1,21 @@ +Copyright (c) 2013 Kael Zhang , contributors +http://kael.me/ + +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. \ No newline at end of file diff --git a/tools/eslint/node_modules/ignore/README.md b/tools/eslint/node_modules/ignore/README.md new file mode 100755 index 00000000000000..cd4518febfffd9 --- /dev/null +++ b/tools/eslint/node_modules/ignore/README.md @@ -0,0 +1,188 @@ +[![Build Status](https://travis-ci.org/kaelzhang/node-ignore.svg?branch=master)](https://travis-ci.org/kaelzhang/node-ignore) +[![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/kaelzhang/node-ignore?branch=master&svg=true)](https://ci.appveyor.com/project/kaelzhang/node-ignore) +[![npm module downloads per month](http://img.shields.io/npm/dm/ignore.svg)](https://www.npmjs.org/package/ignore) + +# ignore + +`ignore` is a manager and filter which implemented in pure JavaScript according to the .gitignore [spec](http://git-scm.com/docs/gitignore). + +Pay attention that [`minimatch`](https://www.npmjs.org/package/minimatch) does not work in the gitignore way. To filter filenames according to .gitignore file, I recommend this module. + +##### Tested on + +- Linux + Node: `0.8` - `5.x` +- Windows + Node: `0.10` - `5.x`, node < `0.10` is not tested due to the lack of support of appveyor. + +## Table Of Main Contents + +- [Usage](#usage) +- [Guide for 2.x -> 3.x](#upgrade-2x---3x) +- [Contributing](#contributing) + +## Usage + +```js +const ignore = require('ignore') +var ig = ignore().add(['.abc/*', '!.abc/d/']) +``` + +### Filter the given paths + +```js +var paths = [ + '.abc/a.js', // filtered out + '.abc/d/e.js' // included +] + +ig.filter(paths) // ['.abc/d/e.js'] +``` + +### As the filter function + +```js +paths.filter(ig.createFilter()); // ['.abc/d/e.js'] +``` + +### Win32 paths will be handled + +```js +ig.filter(['.abc\\a.js', '.abc\\d\\e.js']) +// if the code above runs on windows, the result will be +// ['.abc\\d\\e.js'] +``` + +## Why another ignore? + +1. `ignore` is a standalone module, and is much simpler so that it could easy work with other programs, unlike [isaacs](https://npmjs.org/~isaacs)'s [fstream-ignore](https://npmjs.org/package/fstream-ignore) which must work with the modules of the fstream family. + +2. `ignore` only contains utility methods to filter paths according to the specified ignore rules, so + - `ignore` never try to find out ignore rules by traversing directories or fetching from git configurations. + - `ignore` don't cares about sub-modules of git projects. + +3. Exactly according to [gitignore man page](http://git-scm.com/docs/gitignore), fixes some known matching issues of fstream-ignore, such as: + - '`/*.js`' should only match '`a.js`', but not '`abc/a.js`'. + - '`**/foo`' should match '`foo`' anywhere. + - prevent re-including a file if a parent directory of that file is excluded. + - handle trailing whitespaces: + - `'a '`(one space) should not match `'a '`(two spaces). + - `'a \ '` matches `'a '` + +## Methods + +### .add(pattern) +### .add(patterns) + +- pattern `String|Ignore` An ignore pattern string, or the `Ignore` instance +- patterns `Array.` Array of ignore patterns. + +Adds a rule or several rules to the current manager. + +Returns `this` + +Notice that a line starting with `'#'`(hash) is treated as a comment. Put a backslash (`'\'`) in front of the first hash for patterns that begin with a hash, if you want to ignore a file with a hash at the beginning of the filename. + +```js +ignore().add('#abc').filter(['#abc']) // ['#abc'] +ignore().add('\#abc').filter(['#abc']) // [] +``` + +`pattern` could either be a line of ignore pattern or a string of multiple ignore patterns, which means we could just `ignore().add()` the content of a ignore file: + +```js +ignore().add(fs.readFileSync(filenameOfGitignore).toString()).filter(filenames) +``` + +`pattern` could also be an `ignore` instance, so that we could easily inherit the rules of another `Ignore` instance. + +### .addIgnoreFile(path) + +REMOVED in `3.x` for now. + +To upgrade `ignore@2.x` up to `3.x`, use + +```js +const fs = require('fs') + +if (fs.existsSync(filename)) { + ignore().add(fs.readFileSync(filename).toString()) +} +``` + +instead. + + +### .filter(paths) + +Filters the given array of pathnames, and returns the filtered array. + +- paths `Array.` The array of paths to be filtered. + +*NOTICE* that each `path` here should be a relative path to the root of your repository. Suppose the dir structure is: + +``` +/path/to/your/repo + |-- a + | |-- a.js + | + |-- .b + | + |-- .c + |-- .DS_store +``` + +Then the `paths` might be like this: + +```js +[ + 'a/a.js' + '.b', + '.c/.DS_store' +] +``` + +Usually, you could use [`glob`](http://npmjs.org/package/glob) with `option.mark = true` to fetch the structure of the current directory: + +```js +const glob = require('glob') + +glob('**', { + // Adds a / character to directory matches. + mark: true +}, (err, files) => { + if (err) { + return console.error(err) + } + + var filtered = ignore().add(patterns).filter(files) + console.log(filtered) +}) +``` + +### .createFilter() + +Creates a filter function which could filter an array of paths with `Array.prototype.filter`. + +Returns `function(path)` the filter function. + +**** + +## Upgrade 2.x -> 3.x + +- All `options` of 2.x are unnecessary and removed, so just remove them. +- `ignore()` instance is no longer an [`EventEmitter`](nodejs.org/api/events.html), and all events are unnecessary and removed. +- `.addIgnoreFile()` is removed, see the [.addIgnoreFile](#addignorefilepath) section for details. + +**** + +## Contributing + +The code of `node-ignore` is based on es6 and babel, but babel and its preset is not included in the `dependencies` field of package.json, so that the installation process of test cases will not fail in older versions of node. + +So use `bash install.sh` to install dependencies and `bash test.sh` to run test cases in your local machine. + +#### Collaborators + +- [SamyPesse](https://github.com/SamyPesse) *Samy Pessé* +- [azproduction](https://github.com/azproduction) *Mikhail Davydov* +- [TrySound](https://github.com/TrySound) *Bogdan Chadkin* +- [JanMattner](https://github.com/JanMattner) *Jan Mattner* diff --git a/tools/eslint/node_modules/ignore/ignore.js b/tools/eslint/node_modules/ignore/ignore.js new file mode 100644 index 00000000000000..221b97e80e58e0 --- /dev/null +++ b/tools/eslint/node_modules/ignore/ignore.js @@ -0,0 +1,382 @@ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +module.exports = function () { + return new IgnoreBase(); +}; + +// A simple implementation of make-array +function make_array(subject) { + return Array.isArray(subject) ? subject : [subject]; +} + +var REGEX_BLANK_LINE = /^\s+$/; +var REGEX_LEADING_EXCAPED_EXCLAMATION = /^\\\!/; +var REGEX_LEADING_EXCAPED_HASH = /^\\#/; +var SLASH = '/'; + +var IgnoreBase = function () { + function IgnoreBase() { + _classCallCheck(this, IgnoreBase); + + this._rules = []; + this._initCache(); + } + + _createClass(IgnoreBase, [{ + key: '_initCache', + value: function _initCache() { + this._cache = {}; + } + + // @param {Array.|string|Ignore} pattern + + }, { + key: 'add', + value: function add(pattern) { + this._added = false; + + if (typeof pattern === 'string') { + pattern = pattern.split(/\r?\n/g); + } + + make_array(pattern).forEach(this._addPattern, this); + + // Some rules have just added to the ignore, + // making the behavior changed. + if (this._added) { + this._initCache(); + } + + return this; + } + + // legacy + + }, { + key: 'addPattern', + value: function addPattern(pattern) { + return this.add(pattern); + } + }, { + key: '_addPattern', + value: function _addPattern(pattern) { + if (pattern instanceof IgnoreBase) { + this._rules = this._rules.concat(pattern._rules); + this._added = true; + return; + } + + if (this._checkPattern(pattern)) { + var rule = this._createRule(pattern); + this._added = true; + this._rules.push(rule); + } + } + }, { + key: '_checkPattern', + value: function _checkPattern(pattern) { + // > A blank line matches no files, so it can serve as a separator for readability. + return pattern && typeof pattern === 'string' && !REGEX_BLANK_LINE.test(pattern) + + // > A line starting with # serves as a comment. + && pattern.indexOf('#') !== 0; + } + }, { + key: 'filter', + value: function filter(paths) { + var _this = this; + + return make_array(paths).filter(function (path) { + return _this._filter(path); + }); + } + }, { + key: 'createFilter', + value: function createFilter() { + var _this2 = this; + + return function (path) { + return _this2._filter(path); + }; + } + }, { + key: '_createRule', + value: function _createRule(pattern) { + var rule_object = { + origin: pattern + }; + + // > An optional prefix "!" which negates the pattern; + if (pattern.indexOf('!') === 0) { + rule_object.negative = true; + pattern = pattern.substr(1); + } + + pattern = pattern + // > Put a backslash ("\") in front of the first "!" for patterns that begin with a literal "!", for example, `"\!important!.txt"`. + .replace(REGEX_LEADING_EXCAPED_EXCLAMATION, '!') + // > Put a backslash ("\") in front of the first hash for patterns that begin with a hash. + .replace(REGEX_LEADING_EXCAPED_HASH, '#'); + + rule_object.pattern = pattern; + rule_object.regex = regex(pattern); + + return rule_object; + } + }, { + key: '_filter', + value: function _filter(path, slices) { + if (!path) { + return false; + } + + if (path in this._cache) { + return this._cache[path]; + } + + if (!slices) { + // path/to/a.js + // ['path', 'to', 'a.js'] + slices = path.split(SLASH); + + // '/b/a.js' -> ['', 'b', 'a.js'] -> [''] + if (slices.length && !slices[0]) { + slices = slices.slice(1); + slices[0] = SLASH + slices[0]; + } + } + + slices.pop(); + + return this._cache[path] = slices.length + // > It is not possible to re-include a file if a parent directory of that file is excluded. + // If the path contains a parent directory, check the parent first + ? this._filter(slices.join(SLASH) + SLASH, slices) && this._test(path) + + // Or only test the path + : this._test(path); + } + + // @returns {Boolean} true if a file is NOT ignored + + }, { + key: '_test', + value: function _test(path) { + // Explicitly define variable type by setting matched to `0` + var matched = 0; + + this._rules.forEach(function (rule) { + // if matched = true, then we only test negative rules + // if matched = false, then we test non-negative rules + if (!(matched ^ rule.negative)) { + matched = rule.negative ^ rule.regex.test(path); + } + }); + + return !matched; + } + }]); + + return IgnoreBase; +}(); + +// > If the pattern ends with a slash, +// > it is removed for the purpose of the following description, +// > but it would only find a match with a directory. +// > In other words, foo/ will match a directory foo and paths underneath it, +// > but will not match a regular file or a symbolic link foo +// > (this is consistent with the way how pathspec works in general in Git). +// '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`' +// -> ignore-rules will not deal with it, because it costs extra `fs.stat` call +// you could use option `mark: true` with `glob` + +// '`foo/`' should not continue with the '`..`' + + +var REPLACERS = [ + +// > Trailing spaces are ignored unless they are quoted with backslash ("\") +[ +// (a\ ) -> (a ) +// (a ) -> (a) +// (a \ ) -> (a ) +/\\?\s+$/, function (match) { + return match.indexOf('\\') === 0 ? ' ' : ''; +}], + +// replace (\ ) with ' ' +[/\\\s/g, function (match) { + return ' '; +}], + +// Escape metacharacters +// which is written down by users but means special for regular expressions. + +// > There are 12 characters with special meanings: +// > - the backslash \, +// > - the caret ^, +// > - the dollar sign $, +// > - the period or dot ., +// > - the vertical bar or pipe symbol |, +// > - the question mark ?, +// > - the asterisk or star *, +// > - the plus sign +, +// > - the opening parenthesis (, +// > - the closing parenthesis ), +// > - and the opening square bracket [, +// > - the opening curly brace {, +// > These special characters are often called "metacharacters". +[/[\\\^$.|?*+()\[{]/g, function (match) { + return '\\' + match; +}], + +// leading slash +[ + +// > A leading slash matches the beginning of the pathname. +// > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c". +// A leading slash matches the beginning of the pathname +/^\//, function () { + return '^'; +}], + +// replace special metacharacter slash after the leading slash +[/\//g, function () { + return '\\/'; +}], [ +// > A leading "**" followed by a slash means match in all directories. +// > For example, "**/foo" matches file or directory "foo" anywhere, +// > the same as pattern "foo". +// > "**/foo/bar" matches file or directory "bar" anywhere that is directly under directory "foo". +// Notice that the '*'s have been replaced as '\\*' +/^\^*\\\*\\\*\\\//, + +// '**/foo' <-> 'foo' +// just remove it +function () { + return '^(?:.*\\/)?'; +}], + +// 'f' +// matches +// - /f(end) +// - /f/ +// - (start)f(end) +// - (start)f/ +// doesn't match +// - oof +// - foo +// pseudo: +// -> (^|/)f(/|$) + +// ending +[ +// 'js' will not match 'js.' +// 'ab' will not match 'abc' +/(?:[^*\/])$/, function (match) { + // 'js*' will not match 'a.js' + // 'js/' will not match 'a.js' + // 'js' will match 'a.js' and 'a.js/' + return match + '(?=$|\\/)'; +}], + +// starting +[ +// there will be no leading '/' (which has been replaced by section "leading slash") +// If starts with '**', adding a '^' to the regular expression also works +/^(?=[^\^])/, function (match) { + return !/\/(?!$)/.test(this) + // > If the pattern does not contain a slash /, Git treats it as a shell glob pattern + // Actually, if there is only a trailing slash, git also treats it as a shell glob pattern + ? '(?:^|\\/)' + + // > Otherwise, Git treats the pattern as a shell glob suitable for consumption by fnmatch(3) + : '^'; +}], + +// two globstars +[/\\\/\\\*\\\*(\\\/|$)/g, + +// Zero, one or several directories +// should not use '*', or it will be replaced by the next replacer +function (m, p1) { + return p1 === '\\/' + + // case: /**/ + // > A slash followed by two consecutive asterisks then a slash matches zero or more directories. + // > For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on. + // '/**/' + ? '(?:\\/[^\\/]+)*\\/' + + // case: /** + // > A trailing `"/**"` matches everything inside. + : '\\/'; +}], + +// intermediate wildcards +[ +// Never replace escaped '*' +// ignore rule '\*' will match the path '*' + +// 'abc.*/' -> go +// 'abc.*' -> skip this rule +/(^|[^\\]+)\\\*(?=.+)/g, function (match, p1) { + // '*.js' matches '.js' + // '*.js' doesn't match 'abc' + return p1 + '[^\\/]*'; +}], + +// trailing wildcard +[/(\\\/)?\\\*$/, function (m, p1) { + return p1 === '\\/' + // 'a/*' does not match 'a/' + // 'a/*' matches 'a/a' + // 'a/' + ? '\\/[^/]+' + + // or it will match everything after + : ''; +}], [ +// unescape +/\\\\\\/g, function () { + return '\\'; +}]]; + +// A simple cache, because an ignore rule only has only one certain meaning +var cache = {}; + +// @param {pattern} +function regex(pattern) { + var r = cache[pattern]; + if (r) { + return r; + } + + var source = REPLACERS.reduce(function (prev, current) { + return prev.replace(current[0], current[1].bind(pattern)); + }, pattern); + + return cache[pattern] = new RegExp(source, 'i'); +} + +// Windows +// -------------------------------------------------------------- +if (process.env.IGNORE_TEST_WIN32 || process.platform === 'win32') { + (function () { + + var filter = IgnoreBase.prototype._filter; + var make_posix = function make_posix(str) { + return (/^\\\\\?\\/.test(str) || /[^\x00-\x80]+/.test(str) ? str : str.replace(/\\/g, '/') + ); + }; + + IgnoreBase.prototype._filter = function (path, slices) { + path = make_posix(path); + return filter.call(this, path, slices); + }; + })(); +} diff --git a/tools/eslint/node_modules/ignore/package.json b/tools/eslint/node_modules/ignore/package.json new file mode 100644 index 00000000000000..1a966f18036f3a --- /dev/null +++ b/tools/eslint/node_modules/ignore/package.json @@ -0,0 +1,97 @@ +{ + "_args": [ + [ + "ignore@^3.0.10", + "/Users/silverwind/git/node/tools/package/package" + ] + ], + "_from": "ignore@>=3.0.10 <4.0.0", + "_id": "ignore@3.1.1", + "_inCache": true, + "_installable": true, + "_location": "/ignore", + "_nodeVersion": "5.10.1", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/ignore-3.1.1.tgz_1460180585110_0.08555315271951258" + }, + "_npmUser": { + "email": "i@kael.me", + "name": "kael" + }, + "_npmVersion": "3.8.3", + "_phantomChildren": {}, + "_requested": { + "name": "ignore", + "raw": "ignore@^3.0.10", + "rawSpec": "^3.0.10", + "scope": null, + "spec": ">=3.0.10 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/ignore/-/ignore-3.1.1.tgz", + "_shasum": "09e941c520c61452a8ec127fe70b4b6e4f281cde", + "_shrinkwrap": null, + "_spec": "ignore@^3.0.10", + "_where": "/Users/silverwind/git/node/tools/package/package", + "author": { + "name": "kael" + }, + "bugs": { + "url": "https://github.com/kaelzhang/node-ignore/issues" + }, + "dependencies": {}, + "description": "Ignore is a manager and filter for .gitignore rules.", + "devDependencies": { + "chai": "~1.7.2", + "mocha": "~1.13.0" + }, + "directories": {}, + "dist": { + "shasum": "09e941c520c61452a8ec127fe70b4b6e4f281cde", + "tarball": "https://registry.npmjs.org/ignore/-/ignore-3.1.1.tgz" + }, + "files": [ + "LICENSE-MIT", + "ignore.js" + ], + "gitHead": "043fa425fc967c9b5745d83ccb45253967d7a14e", + "homepage": "https://github.com/kaelzhang/node-ignore#readme", + "keywords": [ + ".gitignore", + "asterisks", + "filter", + "fnmatch", + "gitignore", + "glob", + "ignore", + "manager", + "npmignore", + "regex", + "regexp", + "regular-expression", + "rules" + ], + "license": "MIT", + "main": "./ignore.js", + "maintainers": [ + { + "name": "kael", + "email": "i@kael.me" + } + ], + "name": "ignore", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/kaelzhang/node-ignore.git" + }, + "scripts": { + "test": "mocha --reporter spec ./test/ignore.js" + }, + "version": "3.1.1" +} diff --git a/tools/eslint/node_modules/imurmurhash/README.md b/tools/eslint/node_modules/imurmurhash/README.md new file mode 100644 index 00000000000000..f35b20a0ef5bfe --- /dev/null +++ b/tools/eslint/node_modules/imurmurhash/README.md @@ -0,0 +1,122 @@ +iMurmurHash.js +============== + +An incremental implementation of the MurmurHash3 (32-bit) hashing algorithm for JavaScript based on [Gary Court's implementation](https://github.com/garycourt/murmurhash-js) with [kazuyukitanimura's modifications](https://github.com/kazuyukitanimura/murmurhash-js). + +This version works significantly faster than the non-incremental version if you need to hash many small strings into a single hash, since string concatenation (to build the single string to pass the non-incremental version) is fairly costly. In one case tested, using the incremental version was about 50% faster than concatenating 5-10 strings and then hashing. + +Installation +------------ + +To use iMurmurHash in the browser, [download the latest version](https://raw.github.com/jensyt/imurmurhash-js/master/imurmurhash.min.js) and include it as a script on your site. + +```html + + +``` + +--- + +To use iMurmurHash in Node.js, install the module using NPM: + +```bash +npm install imurmurhash +``` + +Then simply include it in your scripts: + +```javascript +MurmurHash3 = require('imurmurhash'); +``` + +Quick Example +------------- + +```javascript +// Create the initial hash +var hashState = MurmurHash3('string'); + +// Incrementally add text +hashState.hash('more strings'); +hashState.hash('even more strings'); + +// All calls can be chained if desired +hashState.hash('and').hash('some').hash('more'); + +// Get a result +hashState.result(); +// returns 0xe4ccfe6b +``` + +Functions +--------- + +### MurmurHash3 ([string], [seed]) +Get a hash state object, optionally initialized with the given _string_ and _seed_. _Seed_ must be a positive integer if provided. Calling this function without the `new` keyword will return a cached state object that has been reset. This is safe to use as long as the object is only used from a single thread and no other hashes are created while operating on this one. If this constraint cannot be met, you can use `new` to create a new state object. For example: + +```javascript +// Use the cached object, calling the function again will return the same +// object (but reset, so the current state would be lost) +hashState = MurmurHash3(); +... + +// Create a new object that can be safely used however you wish. Calling the +// function again will simply return a new state object, and no state loss +// will occur, at the cost of creating more objects. +hashState = new MurmurHash3(); +``` + +Both methods can be mixed however you like if you have different use cases. + +--- + +### MurmurHash3.prototype.hash (string) +Incrementally add _string_ to the hash. This can be called as many times as you want for the hash state object, including after a call to `result()`. Returns `this` so calls can be chained. + +--- + +### MurmurHash3.prototype.result () +Get the result of the hash as a 32-bit positive integer. This performs the tail and finalizer portions of the algorithm, but does not store the result in the state object. This means that it is perfectly safe to get results and then continue adding strings via `hash`. + +```javascript +// Do the whole string at once +MurmurHash3('this is a test string').result(); +// 0x70529328 + +// Do part of the string, get a result, then the other part +var m = MurmurHash3('this is a'); +m.result(); +// 0xbfc4f834 +m.hash(' test string').result(); +// 0x70529328 (same as above) +``` + +--- + +### MurmurHash3.prototype.reset ([seed]) +Reset the state object for reuse, optionally using the given _seed_ (defaults to 0 like the constructor). Returns `this` so calls can be chained. + +--- + +License (MIT) +------------- +Copyright (c) 2013 Gary Court, Jens Taylor + +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/eslint/node_modules/imurmurhash/imurmurhash.js b/tools/eslint/node_modules/imurmurhash/imurmurhash.js new file mode 100644 index 00000000000000..05347a2536fce2 --- /dev/null +++ b/tools/eslint/node_modules/imurmurhash/imurmurhash.js @@ -0,0 +1,138 @@ +/** + * @preserve + * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) + * + * @author
      Jens Taylor + * @see http://github.com/homebrewing/brauhaus-diff + * @author Gary Court + * @see http://github.com/garycourt/murmurhash-js + * @author Austin Appleby + * @see http://sites.google.com/site/murmurhash/ + */ +(function(){ + var cache; + + // Call this function without `new` to use the cached object (good for + // single-threaded environments), or with `new` to create a new object. + // + // @param {string} key A UTF-16 or ASCII string + // @param {number} seed An optional positive integer + // @return {object} A MurmurHash3 object for incremental hashing + function MurmurHash3(key, seed) { + var m = this instanceof MurmurHash3 ? this : cache; + m.reset(seed) + if (typeof key === 'string' && key.length > 0) { + m.hash(key); + } + + if (m !== this) { + return m; + } + }; + + // Incrementally add a string to this hash + // + // @param {string} key A UTF-16 or ASCII string + // @return {object} this + MurmurHash3.prototype.hash = function(key) { + var h1, k1, i, top, len; + + len = key.length; + this.len += len; + + k1 = this.k1; + i = 0; + switch (this.rem) { + case 0: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) : 0; + case 1: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 8 : 0; + case 2: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 16 : 0; + case 3: + k1 ^= len > i ? (key.charCodeAt(i) & 0xff) << 24 : 0; + k1 ^= len > i ? (key.charCodeAt(i++) & 0xff00) >> 8 : 0; + } + + this.rem = (len + this.rem) & 3; // & 3 is same as % 4 + len -= this.rem; + if (len > 0) { + h1 = this.h1; + while (1) { + k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; + k1 = (k1 << 15) | (k1 >>> 17); + k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; + + h1 ^= k1; + h1 = (h1 << 13) | (h1 >>> 19); + h1 = (h1 * 5 + 0xe6546b64) & 0xffffffff; + + if (i >= len) { + break; + } + + k1 = ((key.charCodeAt(i++) & 0xffff)) ^ + ((key.charCodeAt(i++) & 0xffff) << 8) ^ + ((key.charCodeAt(i++) & 0xffff) << 16); + top = key.charCodeAt(i++); + k1 ^= ((top & 0xff) << 24) ^ + ((top & 0xff00) >> 8); + } + + k1 = 0; + switch (this.rem) { + case 3: k1 ^= (key.charCodeAt(i + 2) & 0xffff) << 16; + case 2: k1 ^= (key.charCodeAt(i + 1) & 0xffff) << 8; + case 1: k1 ^= (key.charCodeAt(i) & 0xffff); + } + + this.h1 = h1; + } + + this.k1 = k1; + return this; + }; + + // Get the result of this hash + // + // @return {number} The 32-bit hash + MurmurHash3.prototype.result = function() { + var k1, h1; + + k1 = this.k1; + h1 = this.h1; + + if (k1 > 0) { + k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff; + k1 = (k1 << 15) | (k1 >>> 17); + k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff; + h1 ^= k1; + } + + h1 ^= this.len; + + h1 ^= h1 >>> 16; + h1 = (h1 * 0xca6b + (h1 & 0xffff) * 0x85eb0000) & 0xffffffff; + h1 ^= h1 >>> 13; + h1 = (h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000) & 0xffffffff; + h1 ^= h1 >>> 16; + + return h1 >>> 0; + }; + + // Reset the hash object for reuse + // + // @param {number} seed An optional positive integer + MurmurHash3.prototype.reset = function(seed) { + this.h1 = typeof seed === 'number' ? seed : 0; + this.rem = this.k1 = this.len = 0; + return this; + }; + + // A cached object to use. This can be safely used if you're in a single- + // threaded environment, otherwise you need to create new hashes to use. + cache = new MurmurHash3(); + + if (typeof(module) != 'undefined') { + module.exports = MurmurHash3; + } else { + this.MurmurHash3 = MurmurHash3; + } +}()); diff --git a/tools/eslint/node_modules/imurmurhash/imurmurhash.min.js b/tools/eslint/node_modules/imurmurhash/imurmurhash.min.js new file mode 100644 index 00000000000000..dc0ee88d6b69c9 --- /dev/null +++ b/tools/eslint/node_modules/imurmurhash/imurmurhash.min.js @@ -0,0 +1,12 @@ +/** + * @preserve + * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013) + * + * @author Jens Taylor + * @see http://github.com/homebrewing/brauhaus-diff + * @author Gary Court + * @see http://github.com/garycourt/murmurhash-js + * @author Austin Appleby + * @see http://sites.google.com/site/murmurhash/ + */ +!function(){function t(h,r){var s=this instanceof t?this:e;return s.reset(r),"string"==typeof h&&h.length>0&&s.hash(h),s!==this?s:void 0}var e;t.prototype.hash=function(t){var e,h,r,s,i;switch(i=t.length,this.len+=i,h=this.k1,r=0,this.rem){case 0:h^=i>r?65535&t.charCodeAt(r++):0;case 1:h^=i>r?(65535&t.charCodeAt(r++))<<8:0;case 2:h^=i>r?(65535&t.charCodeAt(r++))<<16:0;case 3:h^=i>r?(255&t.charCodeAt(r))<<24:0,h^=i>r?(65280&t.charCodeAt(r++))>>8:0}if(this.rem=3&i+this.rem,i-=this.rem,i>0){for(e=this.h1;;){if(h=4294967295&11601*h+3432906752*(65535&h),h=h<<15|h>>>17,h=4294967295&13715*h+461832192*(65535&h),e^=h,e=e<<13|e>>>19,e=4294967295&5*e+3864292196,r>=i)break;h=65535&t.charCodeAt(r++)^(65535&t.charCodeAt(r++))<<8^(65535&t.charCodeAt(r++))<<16,s=t.charCodeAt(r++),h^=(255&s)<<24^(65280&s)>>8}switch(h=0,this.rem){case 3:h^=(65535&t.charCodeAt(r+2))<<16;case 2:h^=(65535&t.charCodeAt(r+1))<<8;case 1:h^=65535&t.charCodeAt(r)}this.h1=e}return this.k1=h,this},t.prototype.result=function(){var t,e;return t=this.k1,e=this.h1,t>0&&(t=4294967295&11601*t+3432906752*(65535&t),t=t<<15|t>>>17,t=4294967295&13715*t+461832192*(65535&t),e^=t),e^=this.len,e^=e>>>16,e=4294967295&51819*e+2246770688*(65535&e),e^=e>>>13,e=4294967295&44597*e+3266445312*(65535&e),e^=e>>>16,e>>>0},t.prototype.reset=function(t){return this.h1="number"==typeof t?t:0,this.rem=this.k1=this.len=0,this},e=new t,"undefined"!=typeof module?module.exports=t:this.MurmurHash3=t}(); \ No newline at end of file diff --git a/tools/eslint/node_modules/imurmurhash/package.json b/tools/eslint/node_modules/imurmurhash/package.json new file mode 100644 index 00000000000000..a260b301258a4d --- /dev/null +++ b/tools/eslint/node_modules/imurmurhash/package.json @@ -0,0 +1,85 @@ +{ + "_args": [ + [ + "imurmurhash@^0.1.4", + "/Users/silverwind/git/node/tools/package/package" + ] + ], + "_from": "imurmurhash@>=0.1.4 <0.2.0", + "_id": "imurmurhash@0.1.4", + "_inCache": true, + "_installable": true, + "_location": "/imurmurhash", + "_npmUser": { + "email": "jensyt@gmail.com", + "name": "jensyt" + }, + "_npmVersion": "1.3.2", + "_phantomChildren": {}, + "_requested": { + "name": "imurmurhash", + "raw": "imurmurhash@^0.1.4", + "rawSpec": "^0.1.4", + "scope": null, + "spec": ">=0.1.4 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "_shasum": "9218b9b2b928a238b13dc4fb6b6d576f231453ea", + "_shrinkwrap": null, + "_spec": "imurmurhash@^0.1.4", + "_where": "/Users/silverwind/git/node/tools/package/package", + "author": { + "email": "jensyt@gmail.com", + "name": "Jens Taylor", + "url": "https://github.com/homebrewing" + }, + "bugs": { + "url": "https://github.com/jensyt/imurmurhash-js/issues" + }, + "dependencies": {}, + "description": "An incremental implementation of MurmurHash3", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "9218b9b2b928a238b13dc4fb6b6d576f231453ea", + "tarball": "http://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz" + }, + "engines": { + "node": ">=0.8.19" + }, + "files": [ + "README.md", + "imurmurhash.js", + "imurmurhash.min.js", + "package.json" + ], + "homepage": "https://github.com/jensyt/imurmurhash-js", + "keywords": [ + "hash", + "incremental", + "murmur", + "murmurhash", + "murmurhash3" + ], + "license": "MIT", + "main": "imurmurhash.js", + "maintainers": [ + { + "name": "jensyt", + "email": "jensyt@gmail.com" + } + ], + "name": "imurmurhash", + "optionalDependencies": {}, + "readme": "iMurmurHash.js\n==============\n\nAn incremental implementation of the MurmurHash3 (32-bit) hashing algorithm for JavaScript based on [Gary Court's implementation](https://github.com/garycourt/murmurhash-js) with [kazuyukitanimura's modifications](https://github.com/kazuyukitanimura/murmurhash-js).\n\nThis version works significantly faster than the non-incremental version if you need to hash many small strings into a single hash, since string concatenation (to build the single string to pass the non-incremental version) is fairly costly. In one case tested, using the incremental version was about 50% faster than concatenating 5-10 strings and then hashing.\n\nInstallation\n------------\n\nTo use iMurmurHash in the browser, [download the latest version](https://raw.github.com/jensyt/imurmurhash-js/master/imurmurhash.min.js) and include it as a script on your site.\n\n```html\n\n\n```\n\n---\n\nTo use iMurmurHash in Node.js, install the module using NPM:\n\n```bash\nnpm install imurmurhash\n```\n\nThen simply include it in your scripts:\n\n```javascript\nMurmurHash3 = require('imurmurhash');\n```\n\nQuick Example\n-------------\n\n```javascript\n// Create the initial hash\nvar hashState = MurmurHash3('string');\n\n// Incrementally add text\nhashState.hash('more strings');\nhashState.hash('even more strings');\n\n// All calls can be chained if desired\nhashState.hash('and').hash('some').hash('more');\n\n// Get a result\nhashState.result();\n// returns 0xe4ccfe6b\n```\n\nFunctions\n---------\n\n### MurmurHash3 ([string], [seed])\nGet a hash state object, optionally initialized with the given _string_ and _seed_. _Seed_ must be a positive integer if provided. Calling this function without the `new` keyword will return a cached state object that has been reset. This is safe to use as long as the object is only used from a single thread and no other hashes are created while operating on this one. If this constraint cannot be met, you can use `new` to create a new state object. For example:\n\n```javascript\n// Use the cached object, calling the function again will return the same\n// object (but reset, so the current state would be lost)\nhashState = MurmurHash3();\n...\n\n// Create a new object that can be safely used however you wish. Calling the\n// function again will simply return a new state object, and no state loss\n// will occur, at the cost of creating more objects.\nhashState = new MurmurHash3();\n```\n\nBoth methods can be mixed however you like if you have different use cases.\n\n---\n\n### MurmurHash3.prototype.hash (string)\nIncrementally add _string_ to the hash. This can be called as many times as you want for the hash state object, including after a call to `result()`. Returns `this` so calls can be chained.\n\n---\n\n### MurmurHash3.prototype.result ()\nGet the result of the hash as a 32-bit positive integer. This performs the tail and finalizer portions of the algorithm, but does not store the result in the state object. This means that it is perfectly safe to get results and then continue adding strings via `hash`.\n\n```javascript\n// Do the whole string at once\nMurmurHash3('this is a test string').result();\n// 0x70529328\n\n// Do part of the string, get a result, then the other part\nvar m = MurmurHash3('this is a');\nm.result();\n// 0xbfc4f834\nm.hash(' test string').result();\n// 0x70529328 (same as above)\n```\n\n---\n\n### MurmurHash3.prototype.reset ([seed])\nReset the state object for reuse, optionally using the given _seed_ (defaults to 0 like the constructor). Returns `this` so calls can be chained.\n\n---\n\nLicense (MIT)\n-------------\nCopyright (c) 2013 Gary Court, Jens Taylor\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", + "readmeFilename": "README.md", + "repository": { + "type": "git", + "url": "git+https://github.com/jensyt/imurmurhash-js.git" + }, + "version": "0.1.4" +} diff --git a/deps/npm/node_modules/char-spinner/LICENSE b/tools/eslint/node_modules/inflight/LICENSE similarity index 100% rename from deps/npm/node_modules/char-spinner/LICENSE rename to tools/eslint/node_modules/inflight/LICENSE diff --git a/tools/eslint/node_modules/inflight/README.md b/tools/eslint/node_modules/inflight/README.md new file mode 100644 index 00000000000000..6dc8929171a8c5 --- /dev/null +++ b/tools/eslint/node_modules/inflight/README.md @@ -0,0 +1,37 @@ +# inflight + +Add callbacks to requests in flight to avoid async duplication + +## USAGE + +```javascript +var inflight = require('inflight') + +// some request that does some stuff +function req(key, callback) { + // key is any random string. like a url or filename or whatever. + // + // will return either a falsey value, indicating that the + // request for this key is already in flight, or a new callback + // which when called will call all callbacks passed to inflightk + // with the same key + callback = inflight(key, callback) + + // If we got a falsey value back, then there's already a req going + if (!callback) return + + // this is where you'd fetch the url or whatever + // callback is also once()-ified, so it can safely be assigned + // to multiple events etc. First call wins. + setTimeout(function() { + callback(null, key) + }, 100) +} + +// only assigns a single setTimeout +// when it dings, all cbs get called +req('foo', cb1) +req('foo', cb2) +req('foo', cb3) +req('foo', cb4) +``` diff --git a/tools/eslint/node_modules/inflight/inflight.js b/tools/eslint/node_modules/inflight/inflight.js new file mode 100644 index 00000000000000..8bc96cbd3730b5 --- /dev/null +++ b/tools/eslint/node_modules/inflight/inflight.js @@ -0,0 +1,44 @@ +var wrappy = require('wrappy') +var reqs = Object.create(null) +var once = require('once') + +module.exports = wrappy(inflight) + +function inflight (key, cb) { + if (reqs[key]) { + reqs[key].push(cb) + return null + } else { + reqs[key] = [cb] + return makeres(key) + } +} + +function makeres (key) { + return once(function RES () { + var cbs = reqs[key] + var len = cbs.length + var args = slice(arguments) + for (var i = 0; i < len; i++) { + cbs[i].apply(null, args) + } + if (cbs.length > len) { + // added more in the interim. + // de-zalgo, just in case, but don't call again. + cbs.splice(0, len) + process.nextTick(function () { + RES.apply(null, args) + }) + } else { + delete reqs[key] + } + }) +} + +function slice (args) { + var length = args.length + var array = [] + + for (var i = 0; i < length; i++) array[i] = args[i] + return array +} diff --git a/tools/eslint/node_modules/inflight/package.json b/tools/eslint/node_modules/inflight/package.json new file mode 100644 index 00000000000000..e9d4f97951b132 --- /dev/null +++ b/tools/eslint/node_modules/inflight/package.json @@ -0,0 +1,87 @@ +{ + "_args": [ + [ + "inflight@^1.0.4", + "/Users/silverwind/git/node/tools/package/package/node_modules/globby/node_modules/glob" + ] + ], + "_from": "inflight@>=1.0.4 <2.0.0", + "_id": "inflight@1.0.4", + "_inCache": true, + "_installable": true, + "_location": "/inflight", + "_nodeVersion": "0.10.32", + "_npmUser": { + "email": "ogd@aoaioxxysz.net", + "name": "othiym23" + }, + "_npmVersion": "2.1.3", + "_phantomChildren": {}, + "_requested": { + "name": "inflight", + "raw": "inflight@^1.0.4", + "rawSpec": "^1.0.4", + "scope": null, + "spec": ">=1.0.4 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/glob", + "/globby/glob" + ], + "_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz", + "_shasum": "6cbb4521ebd51ce0ec0a936bfd7657ef7e9b172a", + "_shrinkwrap": null, + "_spec": "inflight@^1.0.4", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/globby/node_modules/glob", + "author": { + "email": "i@izs.me", + "name": "Isaac Z. Schlueter", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/isaacs/inflight/issues" + }, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + }, + "description": "Add callbacks to requests in flight to avoid async duplication", + "devDependencies": { + "tap": "^0.4.10" + }, + "directories": {}, + "dist": { + "shasum": "6cbb4521ebd51ce0ec0a936bfd7657ef7e9b172a", + "tarball": "http://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz" + }, + "gitHead": "c7b5531d572a867064d4a1da9e013e8910b7d1ba", + "homepage": "https://github.com/isaacs/inflight", + "license": "ISC", + "main": "inflight.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "inflight", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/inflight.git" + }, + "scripts": { + "test": "tap test.js" + }, + "version": "1.0.4" +} diff --git a/tools/eslint/node_modules/inherits/LICENSE b/tools/eslint/node_modules/inherits/LICENSE new file mode 100644 index 00000000000000..052085c436514a --- /dev/null +++ b/tools/eslint/node_modules/inherits/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. diff --git a/tools/eslint/node_modules/concat-stream/node_modules/inherits/README.md b/tools/eslint/node_modules/inherits/README.md similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/inherits/README.md rename to tools/eslint/node_modules/inherits/README.md diff --git a/tools/eslint/node_modules/concat-stream/node_modules/inherits/inherits.js b/tools/eslint/node_modules/inherits/inherits.js similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/inherits/inherits.js rename to tools/eslint/node_modules/inherits/inherits.js diff --git a/tools/eslint/node_modules/concat-stream/node_modules/inherits/inherits_browser.js b/tools/eslint/node_modules/inherits/inherits_browser.js similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/inherits/inherits_browser.js rename to tools/eslint/node_modules/inherits/inherits_browser.js diff --git a/tools/eslint/node_modules/inherits/package.json b/tools/eslint/node_modules/inherits/package.json new file mode 100644 index 00000000000000..d121220ba659ba --- /dev/null +++ b/tools/eslint/node_modules/inherits/package.json @@ -0,0 +1,80 @@ +{ + "_args": [ + [ + "inherits@~2.0.1", + "/Users/silverwind/git/node/tools/package/package/node_modules/concat-stream" + ] + ], + "_from": "inherits@>=2.0.1 <2.1.0", + "_id": "inherits@2.0.1", + "_inCache": true, + "_installable": true, + "_location": "/inherits", + "_npmUser": { + "email": "i@izs.me", + "name": "isaacs" + }, + "_npmVersion": "1.3.8", + "_phantomChildren": {}, + "_requested": { + "name": "inherits", + "raw": "inherits@~2.0.1", + "rawSpec": "~2.0.1", + "scope": null, + "spec": ">=2.0.1 <2.1.0", + "type": "range" + }, + "_requiredBy": [ + "/concat-stream", + "/glob", + "/globby/glob", + "/readable-stream" + ], + "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "_shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", + "_shrinkwrap": null, + "_spec": "inherits@~2.0.1", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/concat-stream", + "browser": "./inherits_browser.js", + "bugs": { + "url": "https://github.com/isaacs/inherits/issues" + }, + "dependencies": {}, + "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", + "tarball": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" + }, + "homepage": "https://github.com/isaacs/inherits#readme", + "keywords": [ + "browser", + "browserify", + "class", + "inheritance", + "inherits", + "klass", + "object-oriented", + "oop" + ], + "license": "ISC", + "main": "./inherits.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "inherits", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/inherits.git" + }, + "scripts": { + "test": "node test" + }, + "version": "2.0.1" +} diff --git a/tools/eslint/node_modules/inquirer/README.md b/tools/eslint/node_modules/inquirer/README.md index 3043568ed6327f..a5aac0ad24a6db 100644 --- a/tools/eslint/node_modules/inquirer/README.md +++ b/tools/eslint/node_modules/inquirer/README.md @@ -6,15 +6,20 @@ Inquirer.js A collection of common interactive command line user interfaces. -## Goal and philosophy +## Goal and Philosophy Inquirer Logo -We strive at providing easily embeddable and beautiful command line interface for Node.js; some hope in becoming the CLI Xanadu. +**`Inquirer.js`** strives to be an easily embeddable and beautiful command line interface for [Node.js](https://nodejs.org/) (and perhaps the "CLI [Xanadu](https://en.wikipedia.org/wiki/Xanadu_(Citizen_Kane))"). -_**Inquirer**_ should ease the process of asking end user **questions**, **parsing**, **validating** answers, managing **hierarchical prompts** and providing **error feedback**. +**`Inquirer.js`** should ease the process of +- providing *error feedback* +- *asking questions* +- *parsing* input +- *validating* answers +- managing *hierarchical prompts* -_**Inquirer**_ provide the user interface, and the inquiry session flow. If you're searching for a full blown command line program utility, then check out [Commander.js](https://github.com/visionmedia/commander.js) (inspired by). +> **Note:** **`Inquirer.js`** provides the user interface, and the inquiry session flow. If you're searching for a full blown command line program utility, then check out [Commander.js](https://github.com/visionmedia/commander.js) or [Vorpal.js](https://github.com/dthree/vorpal). ## Documentation @@ -60,16 +65,16 @@ A question object is a `hash` containing question related values: - **type**: (String) Type of the prompt. Defaults: `input` - Possible values: `input`, `confirm`, `list`, `rawlist`, `password` -- **name**: (String) The name to use when storing the answer in the anwers hash. +- **name**: (String) The name to use when storing the answer in the answers hash. - **message**: (String|Function) The question to print. If defined as a function, the first parameter will be the current inquirer session answers. - **default**: (String|Number|Array|Function) Default value(s) to use if nothing is entered, or a function that returns the default value(s). If defined as a function, the first parameter will be the current inquirer session answers. -- **choices**: (Array|Function) Choices array or a function returning a choices array. If defined as a function, the first parameter will be the current inquirer session answers. -Array values can be simple `strings`, or `objects` containing a `name` (to display) and a `value` properties (to save in the answers hash). Values can also be [a `Separator`](#separator). +- **choices**: (Array|Function) Choices array or a function returning a choices array. If defined as a function, the first parameter will be the current inquirer session answers. +Array values can be simple `strings`, or `objects` containing a `name` (to display in list), a `value` (to save in the answers hash) and a `short` (to display after selection) properties. The choices array can also contain [a `Separator`](#separator). - **validate**: (Function) Receive the user input and should return `true` if the value is valid, and an error message (`String`) otherwise. If `false` is returned, a default error message is provided. - **filter**: (Function) Receive the user input and return the filtered value to be used inside the program. The value returned will be added to the _Answers_ hash. - **when**: (Function, Boolean) Receive the current user answers hash and should return `true` or `false` depending on whether or not this question should be asked. The value can also be a simple boolean. -`default`(if defined as a function), `validate`, `filter` and `when` functions can be called asynchronously using `this.async()`. You just have to pass the value you'd normally return to the callback option. +`default`, `choices`(if defined as functions), `validate`, `filter` and `when` functions can be called asynchronously using `this.async()`. You just have to pass the value you'd normally return to the callback option. ``` javascript { @@ -114,7 +119,7 @@ choices: [ "Choice A", new inquirer.Separator(), "choice B" ] Make a reservation -------- Ask opening hours - Talk to the receptionnist + Talk to the receptionist ``` The constructor takes a facultative `String` value that'll be use as the separator. If omitted, the separator will be `--------`. @@ -164,7 +169,7 @@ Take `type`, `name`, `message`, `choices`[, `filter`, `validate`, `default`] pro Choices marked as `{ checked: true }` will be checked by default. -Choices whose property `disabled` is truthy will be unselectable. If `disabled` is a string, then the string will be outputed next to the disabled choice, otherwise it'll default to `"Disabled"`. The `disabled` property can also be a synchronous function receiving the current answers as argument and returning a boolean or a string. +Choices whose property `disabled` is truthy will be unselectable. If `disabled` is a string, then the string will be outputted next to the disabled choice, otherwise it'll default to `"Disabled"`. The `disabled` property can also be a synchronous function receiving the current answers as argument and returning a boolean or a string. ![Checkbox prompt](https://dl.dropboxusercontent.com/u/59696254/inquirer/checkbox-prompt.png) @@ -260,8 +265,9 @@ look at issues found on other command line - feel free to report any! - cmd.exe - Powershell - Cygwin -- **Ubuntu**: - - Terminal +- **Linux (Ubuntu, openSUSE, Arch Linux, etc)**: + - gnome-terminal (Terminal GNOME) + - konsole ## News on the march (Release notes) @@ -271,17 +277,17 @@ Please refer to the [Github releases section for the changelog](https://github.c ## Contributing -**Style Guide** -Please brief yourself on [Idiomatic.js](https://github.com/rwldrn/idiomatic.js) style guide with two space indent +**Style Guide** +Please brief yourself on [Idiomatic.js](https://github.com/rwldrn/idiomatic.js) style guide with two space indent -**Unit test** -Unit test are written in [Mocha](http://visionmedia.github.io/mocha/). Please add a unit test for every new feature or bug fix. `npm test` to run the test suite. +**Unit test** +Unit test are written in [Mocha](https://mochajs.org/). Please add a unit test for every new feature or bug fix. `npm test` to run the test suite. -**Documentation** +**Documentation** Add documentation for every API change. Feel free to send corrections -or better docs! +or better docs! -**Pull Requests** +**Pull Requests** Send _fixes_ PR on the `master` branch. Any new features should be send on the `wip`branch. We're looking to offer good support for multiple prompts and environments. If you want to @@ -291,5 +297,5 @@ to @vaxilart) or just add your name to [the wiki](https://github.com/SBoudrias/I ## License -Copyright (c) 2012 Simon Boudrias (twitter: @vaxilart) -Licensed under the MIT license. \ No newline at end of file +Copyright (c) 2015 Simon Boudrias (twitter: @vaxilart) +Licensed under the MIT license. diff --git a/tools/eslint/node_modules/inquirer/lib/inquirer.js b/tools/eslint/node_modules/inquirer/lib/inquirer.js index 41e24561365252..1b14c1da2bf81e 100644 --- a/tools/eslint/node_modules/inquirer/lib/inquirer.js +++ b/tools/eslint/node_modules/inquirer/lib/inquirer.js @@ -12,20 +12,20 @@ var inquirer = module.exports; inquirer.prompts = {}; -inquirer.Separator = require("./objects/separator"); +inquirer.Separator = require('./objects/separator'); inquirer.ui = { - BottomBar: require("./ui/bottom-bar"), - Prompt: require("./ui/prompt") + BottomBar: require('./ui/bottom-bar'), + Prompt: require('./ui/prompt') }; /** * Create a new self-contained prompt module. */ -inquirer.createPromptModule = function () { - var promptModule = function( questions, allDone ) { - var ui = new inquirer.ui.Prompt( promptModule.prompts ); - ui.run( questions, allDone ); +inquirer.createPromptModule = function (opt) { + var promptModule = function (questions, allDone) { + var ui = new inquirer.ui.Prompt(promptModule.prompts, opt); + ui.run(questions, allDone); return ui; }; promptModule.prompts = {}; @@ -37,8 +37,8 @@ inquirer.createPromptModule = function () { * @return {inquirer} */ - promptModule.registerPrompt = function( name, prompt ) { - promptModule.prompts[ name ] = prompt; + promptModule.registerPrompt = function (name, prompt) { + promptModule.prompts[name] = prompt; return this; }; @@ -47,13 +47,13 @@ inquirer.createPromptModule = function () { */ promptModule.restoreDefaultPrompts = function () { - this.registerPrompt( "list", require("./prompts/list")); - this.registerPrompt( "input", require("./prompts/input")); - this.registerPrompt( "confirm", require("./prompts/confirm")); - this.registerPrompt( "rawlist", require("./prompts/rawlist")); - this.registerPrompt( "expand", require("./prompts/expand")); - this.registerPrompt( "checkbox", require("./prompts/checkbox")); - this.registerPrompt( "password", require("./prompts/password")); + this.registerPrompt('list', require('./prompts/list')); + this.registerPrompt('input', require('./prompts/input')); + this.registerPrompt('confirm', require('./prompts/confirm')); + this.registerPrompt('rawlist', require('./prompts/rawlist')); + this.registerPrompt('expand', require('./prompts/expand')); + this.registerPrompt('checkbox', require('./prompts/checkbox')); + this.registerPrompt('password', require('./prompts/password')); }; promptModule.restoreDefaultPrompts(); @@ -71,9 +71,9 @@ inquirer.createPromptModule = function () { inquirer.prompt = inquirer.createPromptModule(); // Expose helper functions on the top level for easiest usage by common users -inquirer.registerPrompt = function( name, prompt ) { - inquirer.prompt.registerPrompt( name, prompt ); +inquirer.registerPrompt = function (name, prompt) { + inquirer.prompt.registerPrompt(name, prompt); }; -inquirer.restoreDefaultPrompts = function() { +inquirer.restoreDefaultPrompts = function () { inquirer.prompt.restoreDefaultPrompts(); }; diff --git a/tools/eslint/node_modules/inquirer/lib/objects/choice.js b/tools/eslint/node_modules/inquirer/lib/objects/choice.js index 8461151f8754bb..b0b8889642cbe7 100644 --- a/tools/eslint/node_modules/inquirer/lib/objects/choice.js +++ b/tools/eslint/node_modules/inquirer/lib/objects/choice.js @@ -1,44 +1,36 @@ -/** - * Choice object - * Normalize input as choice object - */ - -var _ = require("lodash"); - -/** - * Module exports - */ - -module.exports = Choice; +'use strict'; +var _ = require('lodash'); /** * Choice object + * Normalize input as choice object * @constructor * @param {String|Object} val Choice value. If an object is passed, it should contains * at least one of `value` or `name` property */ -function Choice( val, answers ) { - +var Choice = module.exports = function (val, answers) { // Don't process Choice and Separator object - if ( val instanceof Choice || val.type === "separator" ) { + if (val instanceof Choice || val.type === 'separator') { return val; } - if ( _.isString(val) ) { + if (_.isString(val)) { this.name = val; this.value = val; + this.short = val; } else { - _.extend( this, val, { + _.extend(this, val, { name: val.name || val.value, - value: val.hasOwnProperty("value") ? val.value : val.name + value: val.hasOwnProperty('value') ? val.value : val.name, + short: val.short || val.name || val.value }); } - if ( _.isFunction(val.disabled) ) { - this.disabled = val.disabled( answers ); + if (_.isFunction(val.disabled)) { + this.disabled = val.disabled(answers); } else { this.disabled = val.disabled; } -} +}; diff --git a/tools/eslint/node_modules/inquirer/lib/objects/choices.js b/tools/eslint/node_modules/inquirer/lib/objects/choices.js index 20c651ab2a772b..46deeea70e86ec 100644 --- a/tools/eslint/node_modules/inquirer/lib/objects/choices.js +++ b/tools/eslint/node_modules/inquirer/lib/objects/choices.js @@ -1,66 +1,52 @@ -/** - * Choices object - * Collection of multiple `choice` object - */ - -var _ = require("lodash"); -var chalk = require("chalk"); -var Separator = require("./separator"); -var Choice = require("./choice"); - - -/** - * Module exports - */ - -module.exports = Choices; +'use strict'; +var assert = require('assert'); +var _ = require('lodash'); +var Separator = require('./separator'); +var Choice = require('./choice'); /** * Choices collection + * Collection of multiple `choice` object * @constructor * @param {Array} choices All `choice` to keep in the collection */ -function Choices( choices, answers ) { - this.choices = _.map( choices, function( val ) { - if ( val.type === "separator" ) { - if(!(val instanceof Separator)){ +var Choices = module.exports = function (choices, answers) { + this.choices = choices.map(function (val) { + if (val.type === 'separator') { + if (!(val instanceof Separator)) { val = new Separator(val.line); } return val; } - return new Choice( val, answers ); + return new Choice(val, answers); }); this.realChoices = this.choices .filter(Separator.exclude) - .filter(function( item ) { + .filter(function (item) { return !item.disabled; }); - Object.defineProperty( this, "length", { - get: function() { + Object.defineProperty(this, 'length', { + get: function () { return this.choices.length; }, - set: function( val ) { + set: function (val) { this.choices.length = val; } }); - Object.defineProperty( this, "realLength", { - get: function() { + Object.defineProperty(this, 'realLength', { + get: function () { return this.realChoices.length; }, - set: function() { - throw new Error("Cannot set `realLength` of a Choices collection"); + set: function () { + throw new Error('Cannot set `realLength` of a Choices collection'); } }); - - // Set pagination state - this.pointer = 0; - this.lastIndex = 0; -} +}; /** @@ -69,11 +55,9 @@ function Choices( choices, answers ) { * @return {Choice|Undefined} Return the matched choice or undefined */ -Choices.prototype.getChoice = function( selector ) { - if ( _.isNumber(selector) ) { - return this.realChoices[ selector ]; - } - return undefined; +Choices.prototype.getChoice = function (selector) { + assert(_.isNumber(selector)); + return this.realChoices[selector]; }; @@ -83,11 +67,9 @@ Choices.prototype.getChoice = function( selector ) { * @return {Choice|Undefined} Return the matched choice or undefined */ -Choices.prototype.get = function( selector ) { - if ( _.isNumber(selector) ) { - return this.choices[ selector ]; - } - return undefined; +Choices.prototype.get = function (selector) { + assert(_.isNumber(selector)); + return this.choices[selector]; }; @@ -97,8 +79,8 @@ Choices.prototype.get = function( selector ) { * @return {Array} Matching choices or empty array */ -Choices.prototype.where = function( whereClause ) { - return _.where( this.realChoices, whereClause ); +Choices.prototype.where = function (whereClause) { + return _.filter(this.realChoices, whereClause); }; @@ -108,73 +90,24 @@ Choices.prototype.where = function( whereClause ) { * @return {Array} Selected properties */ -Choices.prototype.pluck = function( propertyName ) { - return _.pluck( this.realChoices, propertyName ); +Choices.prototype.pluck = function (propertyName) { + return _.map(this.realChoices, propertyName); }; -// Propagate usual Array methods -Choices.prototype.forEach = function() { - return this.choices.forEach.apply( this.choices, arguments ); +// Expose usual Array methods +Choices.prototype.indexOf = function () { + return this.choices.indexOf.apply(this.choices, arguments); +}; +Choices.prototype.forEach = function () { + return this.choices.forEach.apply(this.choices, arguments); }; -Choices.prototype.filter = function() { - return this.choices.filter.apply( this.choices, arguments ); +Choices.prototype.filter = function () { + return this.choices.filter.apply(this.choices, arguments); }; -Choices.prototype.push = function() { - var objs = _.map( arguments, function( val ) { return new Choice( val ); }); - this.choices.push.apply( this.choices, objs ); +Choices.prototype.push = function () { + var objs = _.map(arguments, function (val) { return new Choice(val); }); + this.choices.push.apply(this.choices, objs); this.realChoices = this.choices.filter(Separator.exclude); return this.choices; }; - - -/** - * Render the choices as formatted string - * @return {String} formatted content - */ - -Choices.prototype.render = function() { - return this.renderingMethod.apply( this, arguments ); -}; - - -/** - * Set the rendering method - * @param {Function} render Function to be use when rendering - */ - -Choices.prototype.setRender = function( render ) { - this.renderingMethod = (this.choices.length > 9) ? this.paginateOutput(render) : render; -}; - - -/** - * Paginate the output of a render function - * @param {Function} render Render function whose content must be paginated - * @return {Function} Wrapped render function - */ - -Choices.prototype.paginateOutput = function( render ) { - var pageSize = 7; - - return function( active ) { - var output = render.apply( this, arguments ); - var lines = output.split("\n"); - - // Make sure there's enough line to paginate - if ( lines.length <= pageSize ) return output; - - // Move the pointer only when the user go down and limit it to 3 - if ( this.pointer < 3 && this.lastIndex < active && active - this.lastIndex < 9 ) { - this.pointer = Math.min( 3, this.pointer + active - this.lastIndex); - } - this.lastIndex = active; - - // Duplicate the lines so it give an infinite list look - var infinite = _.flatten([ lines, lines, lines ]); - var topIndex = Math.max( 0, active + lines.length - this.pointer ); - - var section = infinite.splice( topIndex, pageSize ).join("\n"); - return section + "\n" + chalk.dim("(Move up and down to reveal more choices)"); - }.bind(this); -}; diff --git a/tools/eslint/node_modules/inquirer/lib/objects/separator.js b/tools/eslint/node_modules/inquirer/lib/objects/separator.js index eb4009bf05bbb7..44c44a283b865f 100644 --- a/tools/eslint/node_modules/inquirer/lib/objects/separator.js +++ b/tools/eslint/node_modules/inquirer/lib/objects/separator.js @@ -1,30 +1,19 @@ -/** - * Separator object - * Used to space/separate choices group - */ - -var chalk = require("chalk"); -var figures = require("figures"); - - -/** - * Module exports - */ - -module.exports = Separator; +'use strict'; +var chalk = require('chalk'); +var figures = require('figures'); /** * Separator object + * Used to space/separate choices group * @constructor * @param {String} line Separation line content (facultative) */ -function Separator( line ) { - this.type = "separator"; +var Separator = module.exports = function (line) { + this.type = 'separator'; this.line = chalk.dim(line || new Array(15).join(figures.line)); -} - +}; /** * Helper function returning false if object is a separator @@ -32,16 +21,15 @@ function Separator( line ) { * @return {Boolean} `false` if object is a separator */ -Separator.exclude = function( obj ) { - return obj.type !== "separator"; +Separator.exclude = function (obj) { + return obj.type !== 'separator'; }; - /** * Stringify separator * @return {String} the separator display string */ -Separator.prototype.toString = function() { +Separator.prototype.toString = function () { return this.line; }; diff --git a/tools/eslint/node_modules/inquirer/lib/prompts/base.js b/tools/eslint/node_modules/inquirer/lib/prompts/base.js index 34ffed83082a2a..60afeb54c8bd59 100644 --- a/tools/eslint/node_modules/inquirer/lib/prompts/base.js +++ b/tools/eslint/node_modules/inquirer/lib/prompts/base.js @@ -3,61 +3,46 @@ * Should be extended by prompt types. */ -var rx = require("rx"); -var _ = require("lodash"); -var chalk = require("chalk"); -var ansiRegex = require("ansi-regex"); -var readline = require("readline"); -var cliWidth = require("cli-width"); -var utils = require("../utils/utils"); -var Choices = require("../objects/choices"); -var tty = require("../utils/tty"); +var rx = require('rx-lite'); +var _ = require('lodash'); +var chalk = require('chalk'); +var ansiRegex = require('ansi-regex'); +var runAsync = require('run-async'); +var Choices = require('../objects/choices'); +var ScreenManager = require('../utils/screen-manager'); -/** - * Module exports - */ - -module.exports = Prompt; - - -/** - * Prompt constructor - */ -function Prompt( question, rl, answers ) { +var Prompt = module.exports = function (question, rl, answers) { // Setup instance defaults property - _.assign( this, { - height : 0, - status : "pending" + _.assign(this, { + answers: answers, + status : 'pending' }); // Set defaults prompt options - this.opt = _.defaults( _.clone(question), { - validate: function() { return true; }, - filter: function( val ) { return val; }, - when: function() { return true; } + this.opt = _.defaults(_.clone(question), { + validate: function () { return true; }, + filter: function (val) { return val; }, + when: function () { return true; } }); // Check to make sure prompt requirements are there if (!this.opt.message) { - this.throwParamError("message"); + this.throwParamError('message'); } if (!this.opt.name) { - this.throwParamError("name"); + this.throwParamError('name'); } // Normalize choices - if ( _.isArray(this.opt.choices) ) { - this.opt.choices = new Choices( this.opt.choices, answers ); + if (Array.isArray(this.opt.choices)) { + this.opt.choices = new Choices(this.opt.choices, answers); } this.rl = rl; - - return this; -} - -_.extend( Prompt.prototype, tty ); + this.screen = new ScreenManager(this.rl); +}; /** @@ -67,15 +52,13 @@ _.extend( Prompt.prototype, tty ); */ Prompt.prototype.run = function( cb ) { - var self = this; - this._run(function( value ) { - self.filter( value, cb ); - }); - return this; + this._run(function (value) { + this.filter(value, cb); + }.bind(this)); }; // default noop (this one should be overwritten in prompts) -Prompt.prototype._run = function( cb ) { cb(); }; +Prompt.prototype._run = function (cb) { cb(); }; /** @@ -84,48 +67,10 @@ Prompt.prototype._run = function( cb ) { cb(); }; * @return {Throw Error} */ -Prompt.prototype.throwParamError = function( name ) { - throw new Error("You must provide a `" + name + "` parameter"); +Prompt.prototype.throwParamError = function (name) { + throw new Error('You must provide a `' + name + '` parameter'); }; - -/** - * Write error message - * @param {String} Error Error message - * @return {Prompt} Self - */ - -Prompt.prototype.error = function( error ) { - readline.moveCursor( this.rl.output, -cliWidth(), 0 ); - readline.clearLine( this.rl.output, 0 ); - - var errMsg = chalk.red(">> ") + - (error || "Please enter a valid value"); - this.write( errMsg ); - - return this.up(); -}; - - -/** - * Write hint message - * @param {String} Hint Hint message - * @return {Prompt} Self - */ - -Prompt.prototype.hint = function( hint ) { - readline.moveCursor( this.rl.output, -cliWidth(), 0 ); - readline.clearLine( this.rl.output, 0 ); - - if ( hint.length ) { - var hintMsg = chalk.cyan(">> ") + hint; - this.write( hintMsg ); - } - - return this.up(); -}; - - /** * Validate a given input * @param {String} value Input string @@ -134,8 +79,8 @@ Prompt.prototype.hint = function( hint ) { * @return {null} */ -Prompt.prototype.validate = function( input, cb ) { - utils.runAsync( this.opt.validate, cb, input ); +Prompt.prototype.validate = function (input, cb) { + runAsync(this.opt.validate, cb, input); }; /** @@ -143,24 +88,23 @@ Prompt.prototype.validate = function( input, cb ) { * @param {Rx.Observable} submit - submit event flow * @return {Object} Object containing two observables: `success` and `error` */ -Prompt.prototype.handleSubmitEvents = function( submit ) { +Prompt.prototype.handleSubmitEvents = function (submit) { var self = this; - var opt = this.opt; - var validation = submit.flatMap(function( value ) { - return rx.Observable.create(function( observer ) { - utils.runAsync( opt.validate, function( isValid ) { + var validation = submit.flatMap(function (value) { + return rx.Observable.create(function (observer) { + runAsync(self.opt.validate, function (isValid) { observer.onNext({ isValid: isValid, value: self.getCurrentValue(value) }); observer.onCompleted(); - }, self.getCurrentValue(value) ); + }, self.getCurrentValue(value), self.answers); }); }).share(); var success = validation - .filter(function( state ) { return state.isValid === true; }) + .filter(function (state) { return state.isValid === true; }) .take(1); var error = validation - .filter(function( state ) { return state.isValid !== true; }) + .filter(function (state) { return state.isValid !== true; }) .takeUntil(success); return { @@ -180,51 +124,51 @@ Prompt.prototype.getCurrentValue = function (value) { * @return {null} */ -Prompt.prototype.filter = function( input, cb ) { - utils.runAsync( this.opt.filter, cb, input ); +Prompt.prototype.filter = function (input, cb) { + runAsync(this.opt.filter, cb, input); }; - /** * Return the prompt line prefix * @param {String} [optionnal] String to concatenate to the prefix * @return {String} prompt prefix */ -Prompt.prototype.prefix = function( str ) { - str || (str = ""); - return chalk.green("?") + " " + str; +Prompt.prototype.prefix = function (str) { + str || (str = ''); + return chalk.green('?') + ' ' + str; }; - /** * Return the prompt line suffix * @param {String} [optionnal] String to concatenate to the suffix * @return {String} prompt suffix */ -var reStrEnd = new RegExp("(?:" + ansiRegex().source + ")$|$"); +var reStrEnd = new RegExp('(?:' + ansiRegex().source + ')$|$'); -Prompt.prototype.suffix = function( str ) { - str || (str = ""); - return (str.length < 1 || /[a-z1-9]$/i.test(chalk.stripColor(str)) ? - // make sure we get the `:` inside the styles - str.replace(reStrEnd, ":$&") : str).trim() + " "; -}; +Prompt.prototype.suffix = function (str) { + str || (str = ''); + // make sure we get the `:` inside the styles + if (str.length < 1 || /[a-z1-9]$/i.test(chalk.stripColor(str))) { + str = str.replace(reStrEnd, ':$&'); + } + + return str.trim() + ' '; +}; /** * Generate the prompt question string * @return {String} prompt question string */ -Prompt.prototype.getQuestion = function() { - - var message = _.compose(this.prefix, this.suffix)(chalk.bold(this.opt.message)); +Prompt.prototype.getQuestion = function () { + var message = chalk.green('?') + ' ' + chalk.bold(this.opt.message) + ' '; // Append the default if available, and if question isn't answered - if ( this.opt.default != null && this.status !== "answered" ) { - message += chalk.dim("("+ this.opt.default + ") "); + if ( this.opt.default != null && this.status !== 'answered' ) { + message += chalk.dim('('+ this.opt.default + ') '); } return message; diff --git a/tools/eslint/node_modules/inquirer/lib/prompts/checkbox.js b/tools/eslint/node_modules/inquirer/lib/prompts/checkbox.js index e2737ab6f025ee..81b56fac368807 100644 --- a/tools/eslint/node_modules/inquirer/lib/prompts/checkbox.js +++ b/tools/eslint/node_modules/inquirer/lib/prompts/checkbox.js @@ -5,9 +5,11 @@ var _ = require("lodash"); var util = require("util"); var chalk = require("chalk"); +var cliCursor = require("cli-cursor"); +var figures = require("figures"); var Base = require("./base"); -var utils = require("../utils/utils"); var observe = require("../utils/events"); +var Paginator = require("../utils/paginator"); /** @@ -39,12 +41,10 @@ function Prompt() { this.firstRender = true; this.pointer = 0; - this.opt.choices.setRender( renderChoices ); - // Make sure no default is set (so it won't be printed) this.opt.default = null; - return this; + this.paginator = new Paginator(); } util.inherits( Prompt, Base ); @@ -70,11 +70,8 @@ Prompt.prototype._run = function( cb ) { events.spaceKey.takeUntil( validation.success ).forEach( this.onSpaceKey.bind(this) ); // Init the prompt + cliCursor.hide(); this.render(); - this.hideCursor(); - - // Prevent user from writing - this.rl.output.mute(); return this; }; @@ -85,10 +82,10 @@ Prompt.prototype._run = function( cb ) { * @return {Prompt} self */ -Prompt.prototype.render = function() { +Prompt.prototype.render = function (error) { // Render question - var message = this.getQuestion(); - var choicesStr = "\n" + this.opt.choices.render( this.pointer ); + var message = this.getQuestion(); + var bottomContent = ''; if ( this.firstRender ) { message += "(Press to select)"; @@ -96,16 +93,20 @@ Prompt.prototype.render = function() { // Render choices or answer depending on the state if ( this.status === "answered" ) { - message += chalk.cyan( this.selection.join(", ") ) + "\n"; + message += chalk.cyan( this.selection.join(", ") ); } else { - message += choicesStr; + var choicesStr = renderChoices(this.opt.choices, this.pointer); + var indexPosition = this.opt.choices.indexOf(this.opt.choices.getChoice(this.pointer)); + message += "\n" + this.paginator.paginate(choicesStr, indexPosition, this.opt.pageSize); } - this.firstRender = false; + if (error) { + bottomContent = chalk.red('>> ') + error; + } - utils.writeMessage( this, message ); + this.firstRender = false; - return this; + this.screen.render(message, bottomContent); }; @@ -114,24 +115,19 @@ Prompt.prototype.render = function() { */ Prompt.prototype.onEnd = function( state ) { - this.rl.output.unmute(); - this.showCursor(); this.status = "answered"; // Rerender prompt (and clean subline error) - this.down().clean(1).render(); + this.render(); + this.screen.done(); + cliCursor.show(); this.done( state.value ); }; Prompt.prototype.onError = function ( state ) { - this.rl.output.unmute(); - this.showCursor(); - - this.down().error( state.isValid ).clean().render(); - this.hideCursor(); - this.rl.output.mute(); + this.render(state.isValid); }; Prompt.prototype.getCurrentValue = function () { @@ -139,83 +135,33 @@ Prompt.prototype.getCurrentValue = function () { return !!choice.checked && !choice.disabled; }); - this.selection = _.pluck(choices, "name"); - return _.pluck(choices, "value"); -}; - -/** - * When user press a key - */ - -Prompt.prototype.onKeypress = function( s, key ) { - // Only process up, down, space, j, k and 1-9 keys - var keyWhitelist = [ "up", "down", "space", "j", "k" ]; - if ( key && !_.contains(keyWhitelist, key.name) ) return; - if ( key && (key.name === "space" || key.name === "j" || key.name === "k") ) s = undefined; - if ( s && "123456789".indexOf(s) < 0 ) return; - - var len = this.opt.choices.realLength; - this.rl.output.unmute(); - - var shortcut = Number(s); - if ( shortcut <= len && shortcut > 0 ) { - this.pointer = shortcut - 1; - key = { name: "space" }; - } - - if ( key && key.name === "space" ) { - var checked = this.opt.choices.getChoice(this.pointer).checked; - this.opt.choices.getChoice(this.pointer).checked = !checked; - } else if ( key && (key.name === "up" || key.name === "k") ) { - (this.pointer > 0) ? this.pointer-- : (this.pointer = len - 1); - } else if ( key && (key.name === "down" || key.name === "j") ) { - (this.pointer < len - 1) ? this.pointer++ : (this.pointer = 0); - } - - // Rerender - this.clean().render(); - - this.rl.output.mute(); -}; - -Prompt.prototype.handleKeypress = function(action) { - this.rl.output.unmute(); - - action(); - - // Rerender - this.clean().render(); - - this.rl.output.mute(); + this.selection = _.map(choices, "short"); + return _.map(choices, "value"); }; Prompt.prototype.onUpKey = function() { - this.handleKeypress(function() { - var len = this.opt.choices.realLength; - this.pointer = (this.pointer > 0) ? this.pointer - 1 : len - 1; - }.bind(this)); + var len = this.opt.choices.realLength; + this.pointer = (this.pointer > 0) ? this.pointer - 1 : len - 1; + this.render(); }; Prompt.prototype.onDownKey = function() { - this.handleKeypress(function() { - var len = this.opt.choices.realLength; - this.pointer = (this.pointer < len - 1) ? this.pointer + 1 : 0; - }.bind(this)); + var len = this.opt.choices.realLength; + this.pointer = (this.pointer < len - 1) ? this.pointer + 1 : 0; + this.render(); }; Prompt.prototype.onNumberKey = function( input ) { - this.handleKeypress(function() { - if ( input <= this.opt.choices.realLength ) { - this.pointer = input - 1; - this.toggleChoice( this.pointer ); - } - }.bind(this)); + if ( input <= this.opt.choices.realLength ) { + this.pointer = input - 1; + this.toggleChoice( this.pointer ); + } + this.render(); }; Prompt.prototype.onSpaceKey = function( input ) { - this.handleKeypress(function() { - this.toggleChoice(this.pointer); - }.bind(this)); + this.toggleChoice(this.pointer); + this.render(); }; Prompt.prototype.toggleChoice = function( index ) { @@ -223,36 +169,45 @@ Prompt.prototype.toggleChoice = function( index ) { this.opt.choices.getChoice(index).checked = !checked; }; - /** * Function for rendering checkbox choices * @param {Number} pointer Position of the pointer * @return {String} Rendered content */ -function renderChoices( pointer ) { - var output = ""; +function renderChoices(choices, pointer) { + var output = ''; var separatorOffset = 0; - this.choices.forEach(function( choice, i ) { - if ( choice.type === "separator" ) { + choices.forEach(function (choice, i) { + if (choice.type === 'separator') { separatorOffset++; - output += " " + choice + "\n"; + output += ' ' + choice + '\n'; return; } - if ( choice.disabled ) { + if (choice.disabled) { separatorOffset++; - output += " - " + choice.name; - output += " (" + (_.isString(choice.disabled) ? choice.disabled : "Disabled") + ")"; + output += ' - ' + choice.name; + output += ' (' + (_.isString(choice.disabled) ? choice.disabled : 'Disabled') + ')'; } else { var isSelected = (i - separatorOffset === pointer); - output += isSelected ? chalk.cyan(utils.getPointer()) : " "; - output += utils.getCheckbox( choice.checked, choice.name ); + output += isSelected ? chalk.cyan(figures.pointer) : ' '; + output += getCheckbox(choice.checked) + ' ' + choice.name; } - output += "\n"; - }.bind(this)); + output += '\n'; + }); + + return output.replace(/\n$/, ''); +} + +/** + * Get the checkbox + * @param {Boolean} checked - add a X or not to the checkbox + * @return {String} Composited checkbox string + */ - return output.replace(/\n$/, ""); +function getCheckbox(checked) { + return checked ? chalk.green(figures.radioOn) : figures.radioOff; } diff --git a/tools/eslint/node_modules/inquirer/lib/prompts/confirm.js b/tools/eslint/node_modules/inquirer/lib/prompts/confirm.js index 65a6dbd8667a37..ca2d9e1b329e47 100644 --- a/tools/eslint/node_modules/inquirer/lib/prompts/confirm.js +++ b/tools/eslint/node_modules/inquirer/lib/prompts/confirm.js @@ -6,7 +6,6 @@ var _ = require("lodash"); var util = require("util"); var chalk = require("chalk"); var Base = require("./base"); -var utils = require("../utils/utils"); var observe = require("../utils/events"); @@ -74,9 +73,16 @@ Prompt.prototype._run = function( cb ) { * @return {Prompt} self */ -Prompt.prototype.render = function() { +Prompt.prototype.render = function (answer) { var message = this.getQuestion(); - utils.writeMessage( this, message ); + + if (typeof answer === "boolean") { + message += chalk.cyan(answer ? "Yes" : "No"); + } else { + message += this.rl.line; + } + + this.screen.render(message); return this; }; @@ -89,10 +95,9 @@ Prompt.prototype.onEnd = function( input ) { this.status = "answered"; var output = this.opt.filter( input ); + this.render( output ); - this.clean(1).render(); - this.write( chalk.cyan(output ? "Yes" : "No") + "\n" ); - + this.screen.done(); this.done( input ); // send "input" because the master class will refilter }; @@ -101,5 +106,5 @@ Prompt.prototype.onEnd = function( input ) { */ Prompt.prototype.onKeypress = function() { - this.clean().render().write( this.rl.line ); + this.render(); }; diff --git a/tools/eslint/node_modules/inquirer/lib/prompts/expand.js b/tools/eslint/node_modules/inquirer/lib/prompts/expand.js index 6f969154ff4863..c3329e5d5f72f1 100644 --- a/tools/eslint/node_modules/inquirer/lib/prompts/expand.js +++ b/tools/eslint/node_modules/inquirer/lib/prompts/expand.js @@ -6,9 +6,9 @@ var _ = require("lodash"); var util = require("util"); var chalk = require("chalk"); var Base = require("./base"); -var utils = require("../utils/utils"); var Separator = require("../objects/separator"); var observe = require("../utils/events"); +var Paginator = require("../utils/paginator"); /** @@ -38,12 +38,10 @@ function Prompt() { value : "help" }); - this.opt.choices.setRender( renderChoice ); - // Setup the default string (capitalize the default key) this.opt.default = this.generateChoicesString( this.opt.choices, this.opt.default ); - return this; + this.paginator = new Paginator(); } util.inherits( Prompt, Base ); @@ -74,21 +72,29 @@ Prompt.prototype._run = function( cb ) { * @return {Prompt} self */ -Prompt.prototype.render = function() { - - // Render question +Prompt.prototype.render = function (error, hint) { var message = this.getQuestion(); + var bottomContent = ''; if ( this.status === "answered" ) { - message += chalk.cyan( this.selected.name ) + "\n"; + message += chalk.cyan( this.selected.short || this.selected.name ); } else if ( this.status === "expanded" ) { - message += this.opt.choices.render( this.selectedKey ); + var choicesStr = renderChoices(this.opt.choices, this.selectedKey); + message += this.paginator.paginate(choicesStr, this.selectedKey, this.opt.pageSize); message += "\n Answer: "; } - utils.writeMessage( this, message ); + message += this.rl.line; - return this; + if (error) { + bottomContent = chalk.red('>> ') + error; + } + + if (hint) { + bottomContent = chalk.cyan('>> ') + hint; + } + + this.screen.render(message, bottomContent); }; @@ -128,12 +134,12 @@ Prompt.prototype.onSubmit = function( input ) { input = this.rawDefault; } - var selected = this.opt.choices.where({ key : input.toLowerCase() })[0]; + var selected = this.opt.choices.where({ key : input.toLowerCase().trim() })[0]; if ( selected != null && selected.key === "h" ) { this.selectedKey = ""; this.status = "expanded"; - this.down().clean(2).render(); + this.render(); return; } @@ -142,19 +148,17 @@ Prompt.prototype.onSubmit = function( input ) { this.selected = selected; // Re-render prompt - this.down().clean(2).render(); + this.render(); this.lineObs.dispose(); this.keypressObs.dispose(); + this.screen.done(); this.done( this.selected.value ); return; } // Input is invalid - this - .error("Please enter a valid command") - .clean() - .render(); + this.render("Please enter a valid command"); }; @@ -165,18 +169,11 @@ Prompt.prototype.onSubmit = function( input ) { Prompt.prototype.onKeypress = function( s, key ) { this.selectedKey = this.rl.line.toLowerCase(); var selected = this.opt.choices.where({ key : this.selectedKey })[0]; - this.cacheCursorPos(); if ( this.status === "expanded" ) { - this.clean().render(); + this.render(); } else { - this - .down() - .hint( selected ? selected.name : "" ) - .clean() - .render(); + this.render(null, selected ? selected.name : null); } - - this.write( this.rl.line ).restoreCursorPos(); }; @@ -236,23 +233,23 @@ Prompt.prototype.generateChoicesString = function( choices, defaultIndex ) { * @return {String} Rendered content */ -function renderChoice( pointer ) { - var output = ""; +function renderChoices (choices, pointer) { + var output = ''; - this.choices.forEach(function( choice, i ) { - output += "\n "; + choices.forEach(function (choice, i) { + output += '\n '; - if ( choice.type === "separator" ) { - output += " " + choice; + if (choice.type === 'separator') { + output += ' ' + choice; return; } - var choiceStr = choice.key + ") " + choice.name; - if ( pointer === choice.key ) { - choiceStr = chalk.cyan( choiceStr ); + var choiceStr = choice.key + ') ' + choice.name; + if (pointer === choice.key) { + choiceStr = chalk.cyan(choiceStr); } output += choiceStr; - }.bind(this)); + }); return output; } diff --git a/tools/eslint/node_modules/inquirer/lib/prompts/input.js b/tools/eslint/node_modules/inquirer/lib/prompts/input.js index 78e04ab60bc17e..4b3e21c35243f0 100644 --- a/tools/eslint/node_modules/inquirer/lib/prompts/input.js +++ b/tools/eslint/node_modules/inquirer/lib/prompts/input.js @@ -2,11 +2,9 @@ * `input` type prompt */ -var _ = require("lodash"); var util = require("util"); var chalk = require("chalk"); var Base = require("./base"); -var utils = require("../utils/utils"); var observe = require("../utils/events"); @@ -58,11 +56,21 @@ Prompt.prototype._run = function( cb ) { * @return {Prompt} self */ -Prompt.prototype.render = function() { +Prompt.prototype.render = function (error) { + var bottomContent = ''; var message = this.getQuestion(); - utils.writeMessage( this, message ); - return this; + if (this.status === 'answered') { + message += chalk.cyan(this.answer); + } else { + message += this.rl.line; + } + + if (error) { + bottomContent = chalk.red('>> ') + error; + } + + this.screen.render(message, bottomContent); }; @@ -79,20 +87,19 @@ Prompt.prototype.filterInput = function( input ) { Prompt.prototype.onEnd = function( state ) { this.filter( state.value, function( filteredValue ) { + this.answer = filteredValue; this.status = "answered"; // Re-render prompt - this.clean(1).render(); - - // Render answer - this.write( chalk.cyan(filteredValue) + "\n" ); + this.render(); + this.screen.done(); this.done( state.value ); }.bind(this)); }; Prompt.prototype.onError = function( state ) { - this.error( state.isValid ).clean().render(); + this.render(state.isValid); }; /** @@ -100,7 +107,5 @@ Prompt.prototype.onError = function( state ) { */ Prompt.prototype.onKeypress = function() { - this.cacheCursorPos(); - this.clean().render().write( this.rl.line ); - this.restoreCursorPos(); + this.render(); }; diff --git a/tools/eslint/node_modules/inquirer/lib/prompts/list.js b/tools/eslint/node_modules/inquirer/lib/prompts/list.js index e5e7c177e47084..1b13d86b3739d9 100644 --- a/tools/eslint/node_modules/inquirer/lib/prompts/list.js +++ b/tools/eslint/node_modules/inquirer/lib/prompts/list.js @@ -5,9 +5,11 @@ var _ = require("lodash"); var util = require("util"); var chalk = require("chalk"); +var figures = require("figures"); +var cliCursor = require("cli-cursor"); var Base = require("./base"); -var utils = require("../utils/utils"); var observe = require("../utils/events"); +var Paginator = require("../utils/paginator"); /** @@ -43,12 +45,10 @@ function Prompt() { this.selected = this.opt.choices.pluck("value").indexOf( def ); } - this.opt.choices.setRender( listRender ); - // Make sure no default is set (so it won't be printed) this.opt.default = null; - return this; + this.paginator = new Paginator(); } util.inherits( Prompt, Base ); @@ -69,11 +69,8 @@ Prompt.prototype._run = function( cb ) { events.line.take(1).forEach( this.onSubmit.bind(this) ); // Init the prompt + cliCursor.hide(); this.render(); - this.hideCursor(); - - // Prevent user from writing - this.rl.output.mute(); return this; }; @@ -85,10 +82,8 @@ Prompt.prototype._run = function( cb ) { */ Prompt.prototype.render = function() { - // Render question - var message = this.getQuestion(); - var choicesStr = "\n" + this.opt.choices.render( this.selected ); + var message = this.getQuestion(); if ( this.firstRender ) { message += chalk.dim( "(Use arrow keys)" ); @@ -96,16 +91,16 @@ Prompt.prototype.render = function() { // Render choices or answer depending on the state if ( this.status === "answered" ) { - message += chalk.cyan( this.opt.choices.getChoice(this.selected).name ) + "\n"; + message += chalk.cyan( this.opt.choices.getChoice(this.selected).short ); } else { - message += choicesStr; + var choicesStr = listRender(this.opt.choices, this.selected ); + var indexPosition = this.opt.choices.indexOf(this.opt.choices.getChoice(this.selected)); + message += "\n" + this.paginator.paginate(choicesStr, indexPosition, this.opt.pageSize); } this.firstRender = false; - utils.writeMessage( this, message ); - - return this; + this.screen.render(message); }; @@ -118,11 +113,10 @@ Prompt.prototype.onSubmit = function() { this.status = "answered"; // Rerender prompt - this.rl.output.unmute(); - this.clean().render(); - - this.showCursor(); + this.render(); + this.screen.done(); + cliCursor.show(); this.done( choice.value ); }; @@ -130,38 +124,23 @@ Prompt.prototype.onSubmit = function() { /** * When user press a key */ - -Prompt.prototype.handleKeypress = function(action) { - this.rl.output.unmute(); - - action(); - - // Rerender - this.clean().render(); - - this.rl.output.mute(); -}; - Prompt.prototype.onUpKey = function() { - this.handleKeypress(function() { - var len = this.opt.choices.realLength; - this.selected = (this.selected > 0) ? this.selected - 1 : len - 1; - }.bind(this)); + var len = this.opt.choices.realLength; + this.selected = (this.selected > 0) ? this.selected - 1 : len - 1; + this.render(); }; Prompt.prototype.onDownKey = function() { - this.handleKeypress(function() { - var len = this.opt.choices.realLength; - this.selected = (this.selected < len - 1) ? this.selected + 1 : 0; - }.bind(this)); + var len = this.opt.choices.realLength; + this.selected = (this.selected < len - 1) ? this.selected + 1 : 0; + this.render(); }; Prompt.prototype.onNumberKey = function( input ) { - this.handleKeypress(function() { - if ( input <= this.opt.choices.realLength ) { - this.selected = input - 1; - } - }.bind(this)); + if ( input <= this.opt.choices.realLength ) { + this.selected = input - 1; + } + this.render(); }; @@ -170,25 +149,24 @@ Prompt.prototype.onNumberKey = function( input ) { * @param {Number} pointer Position of the pointer * @return {String} Rendered content */ + function listRender(choices, pointer) { + var output = ''; + var separatorOffset = 0; + + choices.forEach(function (choice, i) { + if (choice.type === 'separator') { + separatorOffset++; + output += ' ' + choice + '\n'; + return; + } + + var isSelected = (i - separatorOffset === pointer); + var line = (isSelected ? figures.pointer + ' ' : ' ') + choice.name; + if (isSelected) { + line = chalk.cyan(line); + } + output += line + ' \n'; + }); -function listRender( pointer ) { - var output = ""; - var separatorOffset = 0; - - this.choices.forEach(function( choice, i ) { - if ( choice.type === "separator" ) { - separatorOffset++; - output += " " + choice + "\n"; - return; - } - - var isSelected = (i - separatorOffset === pointer); - var line = (isSelected ? utils.getPointer() + " " : " ") + choice.name; - if ( isSelected ) { - line = chalk.cyan( line ); - } - output += line + " \n"; - }.bind(this)); - - return output.replace(/\n$/, ""); + return output.replace(/\n$/, ''); } diff --git a/tools/eslint/node_modules/inquirer/lib/prompts/password.js b/tools/eslint/node_modules/inquirer/lib/prompts/password.js index 6994dcc22410fc..e1bc00ba9d8ed1 100644 --- a/tools/eslint/node_modules/inquirer/lib/prompts/password.js +++ b/tools/eslint/node_modules/inquirer/lib/prompts/password.js @@ -2,13 +2,20 @@ * `password` type prompt */ -var _ = require("lodash"); var util = require("util"); var chalk = require("chalk"); var Base = require("./base"); -var utils = require("../utils/utils"); var observe = require("../utils/events"); +function mask(input) { + input = String(input); + if (input.length === 0) { + return ''; + } + + return new Array(input.length + 1).join('*'); +} + /** * Module exports */ @@ -48,7 +55,6 @@ Prompt.prototype._run = function( cb ) { // Init this.render(); - this.rl.output.mute(); return this; }; @@ -59,48 +65,21 @@ Prompt.prototype._run = function( cb ) { * @return {Prompt} self */ -Prompt.prototype.render = function() { +Prompt.prototype.render = function (error) { var message = this.getQuestion(); - utils.writeMessage( this, message ); - - return this; -}; + var bottomContent = ''; - -/** - * When user press `enter` key - */ - -Prompt.prototype.onSubmit = function( input ) { - var value = input; - if ( !value ) { - var value = this.opt.default != null ? this.opt.default : ""; + if (this.status === 'answered') { + message += chalk.cyan(mask(this.answer)); + } else { + message += mask(this.rl.line || ''); } - this.rl.output.unmute(); - this.write("\n"); // manually output the line return as the readline was muted - - this.validate( value, function( isValid ) { - if ( isValid === true ) { - this.status = "answered"; - - // Re-render prompt - this.clean(1).render(); - - // Mask answer - var mask = new Array( value.toString().length + 1 ).join("*"); - - // Render answer - this.write( chalk.cyan(mask) + "\n" ); + if (error) { + bottomContent = '\n' + chalk.red('>> ') + error; + } - this.lineObs.dispose(); - this.keypressObs.dispose(); - this.done( value ); - } else { - this.error( isValid ).clean().render(); - this.rl.output.mute(); - } - }.bind(this)); + this.screen.render(message, bottomContent); }; /** @@ -115,29 +94,19 @@ Prompt.prototype.filterInput = function( input ) { }; Prompt.prototype.onEnd = function( state ) { - this.rl.output.unmute(); - this.write("\n"); // manually output the line return as the readline was muted - this.status = "answered"; + this.answer = state.value; // Re-render prompt - this.clean(1).render(); - - // Mask answer - var mask = new Array( state.value.toString().length + 1 ).join("*"); - - // Render answer - this.write( chalk.cyan(mask) + "\n" ); + this.render(); + this.screen.done(); this.done( state.value ); }; Prompt.prototype.onError = function( state ) { + this.render(state.isValid); this.rl.output.unmute(); - this.write("\n"); // manually output the line return as the readline was muted - - this.error( state.isValid ).clean().render(); - this.rl.output.mute(); }; /** @@ -145,9 +114,5 @@ Prompt.prototype.onError = function( state ) { */ Prompt.prototype.onKeypress = function() { - this.rl.output.unmute(); - this.cacheCursorPos().clean().render(); - var mask = new Array( this.rl.line.length + 1 ).join("*"); - this.write(mask).restoreCursorPos(); - this.rl.output.mute(); + this.render(); }; diff --git a/tools/eslint/node_modules/inquirer/lib/prompts/rawlist.js b/tools/eslint/node_modules/inquirer/lib/prompts/rawlist.js index 18247cfb9f595e..85c69de660e407 100644 --- a/tools/eslint/node_modules/inquirer/lib/prompts/rawlist.js +++ b/tools/eslint/node_modules/inquirer/lib/prompts/rawlist.js @@ -6,9 +6,9 @@ var _ = require("lodash"); var util = require("util"); var chalk = require("chalk"); var Base = require("./base"); -var utils = require("../utils/utils"); var Separator = require("../objects/separator"); var observe = require("../utils/events"); +var Paginator = require("../utils/paginator"); /** @@ -34,8 +34,6 @@ function Prompt() { this.selected = 0; this.rawDefault = 0; - this.opt.choices.setRender( renderChoices ); - _.extend(this.opt, { validate: function( index ) { return this.opt.choices.getChoice( index ) != null; @@ -50,7 +48,7 @@ function Prompt() { // Make sure no default is set (so it won't be printed) this.opt.default = null; - return this; + this.paginator = new Paginator(); } util.inherits( Prompt, Base ); @@ -86,21 +84,26 @@ Prompt.prototype._run = function( cb ) { * @return {Prompt} self */ -Prompt.prototype.render = function() { +Prompt.prototype.render = function (error) { // Render question - var message = this.getQuestion(); - var choicesStr = this.opt.choices.render( this.selected ); + var message = this.getQuestion(); + var bottomContent = ''; if ( this.status === "answered" ) { - message += chalk.cyan(this.opt.choices.getChoice(this.selected).name) + "\n"; + message += chalk.cyan(this.opt.choices.getChoice(this.selected).name); } else { - message += choicesStr; + var choicesStr = renderChoices(this.opt.choices, this.selected); + message += this.paginator.paginate(choicesStr, this.selected, this.opt.pageSize); message += "\n Answer: "; } - utils.writeMessage( this, message ); + message += this.rl.line; - return this; + if (error) { + bottomContent = '\n' + chalk.red('>> ') + error; + } + + this.screen.render(message, bottomContent); }; /** @@ -122,17 +125,14 @@ Prompt.prototype.onEnd = function( state ) { var selectedChoice = this.opt.choices.getChoice( this.selected ); // Re-render prompt - this.down().clean(2).render(); + this.render(); + this.screen.done(); this.done( selectedChoice.value ); }; Prompt.prototype.onError = function() { - this.hasError = true; - this - .error("Please enter a valid index") - .clean() - .render(); + this.render("Please enter a valid index"); }; /** @@ -148,15 +148,7 @@ Prompt.prototype.onKeypress = function() { this.selected = undefined; } - this.cacheCursorPos(); - - if ( this.hasError ) { - this.down().clean(1); - } else { - this.clean(); - } - - this.render().write( this.rl.line ).restoreCursorPos(); + this.render(); }; @@ -166,26 +158,26 @@ Prompt.prototype.onKeypress = function() { * @return {String} Rendered content */ -function renderChoices( pointer ) { - var output = ""; +function renderChoices(choices, pointer) { + var output = ''; var separatorOffset = 0; - this.choices.forEach(function( choice, i ) { - output += "\n "; + choices.forEach(function (choice, i) { + output += '\n '; - if ( choice.type === "separator" ) { + if (choice.type === 'separator') { separatorOffset++; - output += " " + choice; + output += ' ' + choice; return; } var index = i - separatorOffset; - var display = (index + 1) + ") " + choice.name; - if ( index === pointer ) { + var display = (index + 1) + ') ' + choice.name; + if (index === pointer) { display = chalk.cyan( display ); } output += display; - }.bind(this)); + }); return output; } diff --git a/tools/eslint/node_modules/inquirer/lib/ui/baseUI.js b/tools/eslint/node_modules/inquirer/lib/ui/baseUI.js index d1a2452c094dfb..ebf44da6fa745f 100644 --- a/tools/eslint/node_modules/inquirer/lib/ui/baseUI.js +++ b/tools/eslint/node_modules/inquirer/lib/ui/baseUI.js @@ -1,39 +1,28 @@ -/** - * Base interface class other can inherits from - */ - -var _ = require("lodash"); -var tty = require("../utils/tty"); -var readlineFacade = require("readline2"); - +'use strict'; +var _ = require('lodash'); +var readlineFacade = require('readline2'); -/** - * Module exports - */ - -module.exports = UI; /** - * Constructor + * Base interface class other can inherits from */ -function UI( opt ) { +var UI = module.exports = function (opt) { // Instantiate the Readline interface // @Note: Don't reassign if already present (allow test to override the Stream) - this.rl || (this.rl = readlineFacade.createInterface()); + if (!this.rl) { + this.rl = readlineFacade.createInterface(_.extend({ + terminal: true + }, opt)); + } this.rl.resume(); this.onForceClose = this.onForceClose.bind(this); - this.onKeypress = this.onKeypress.bind(this); // Make sure new prompt start on a newline when closing - this.rl.on( "SIGINT", this.onForceClose ); - process.on( "exit", this.onForceClose ); - - // Propagate keypress events directly on the readline - process.stdin.addListener( "keypress", this.onKeypress ); -} -_.extend( UI.prototype, tty ); + this.rl.on('SIGINT', this.onForceClose); + process.on('exit', this.onForceClose); +}; /** @@ -41,9 +30,9 @@ _.extend( UI.prototype, tty ); * @return {null} */ -UI.prototype.onForceClose = function() { +UI.prototype.onForceClose = function () { this.close(); - console.log("\n"); // Line return + console.log('\n'); // Line return }; @@ -51,15 +40,13 @@ UI.prototype.onForceClose = function() { * Close the interface and cleanup listeners */ -UI.prototype.close = function() { +UI.prototype.close = function () { // Remove events listeners - this.rl.removeListener( "SIGINT", this.onForceClose ); - process.stdin.removeListener( "keypress", this.onKeypress ); - process.removeListener( "exit", this.onForceClose ); + this.rl.removeListener('SIGINT', this.onForceClose); + process.removeListener('exit', this.onForceClose); // Restore prompt functionnalities this.rl.output.unmute(); - process.stdout.write("\x1B[?25h"); // show cursor // Close the readline this.rl.output.end(); @@ -67,17 +54,3 @@ UI.prototype.close = function() { this.rl.close(); this.rl = null; }; - - -/** - * Handle and propagate keypress events - */ - -UI.prototype.onKeypress = function( s, key ) { - // Ignore `enter` key (readline `line` event is the only one we care for) - if ( key && (key.name === "enter" || key.name === "return") ) return; - - if ( this.rl ) { - this.rl.emit( "keypress", s, key ); - } -}; diff --git a/tools/eslint/node_modules/inquirer/lib/ui/bottom-bar.js b/tools/eslint/node_modules/inquirer/lib/ui/bottom-bar.js index 838741dcaeda62..0cbd09a9a8a5e2 100644 --- a/tools/eslint/node_modules/inquirer/lib/ui/bottom-bar.js +++ b/tools/eslint/node_modules/inquirer/lib/ui/bottom-bar.js @@ -5,7 +5,8 @@ var util = require("util"); var through = require("through"); var Base = require("./baseUI"); -var utils = require("../utils/utils"); +var rlUtils = require("../utils/readline"); +var _ = require("lodash"); /** @@ -36,8 +37,7 @@ util.inherits( Prompt, Base ); */ Prompt.prototype.render = function() { - utils.writeMessage ( this, this.bottomBar ); - + this.write(this.bottomBar); return this; }; @@ -50,7 +50,8 @@ Prompt.prototype.render = function() { Prompt.prototype.updateBottomBar = function( bottomBar ) { this.bottomBar = bottomBar; - return this.clean().render(); + rlUtils.clearLine(this.rl, 1); + return this.render(); }; @@ -60,8 +61,8 @@ Prompt.prototype.updateBottomBar = function( bottomBar ) { */ Prompt.prototype.writeLog = function( data ) { - this.clean(); - this.write.call( this, this.enforceLF(data.toString()) ); + rlUtils.clearLine(this.rl, 1); + this.rl.output.write(this.enforceLF(data.toString())); return this.render(); }; @@ -75,3 +76,23 @@ Prompt.prototype.writeLog = function( data ) { Prompt.prototype.enforceLF = function( str ) { return str.match(/[\r\n]$/) ? str : str + "\n"; }; + +/** + * Helper for writing message in Prompt + * @param {Prompt} prompt - The Prompt object that extends tty + * @param {String} message - The message to be output + */ +Prompt.prototype.write = function (message) { + var msgLines = message.split(/\n/); + this.height = msgLines.length; + + // Write message to screen and setPrompt to control backspace + this.rl.setPrompt( _.last(msgLines) ); + + if ( this.rl.output.rows === 0 && this.rl.output.columns === 0 ) { + /* When it's a tty through serial port there's no terminal info and the render will malfunction, + so we need enforce the cursor to locate to the leftmost position for rendering. */ + rlUtils.left( this.rl, message.length + this.rl.line.length ); + } + this.rl.output.write( message ); +}; diff --git a/tools/eslint/node_modules/inquirer/lib/ui/prompt.js b/tools/eslint/node_modules/inquirer/lib/ui/prompt.js index 7139169ef3d703..896ca420e19067 100644 --- a/tools/eslint/node_modules/inquirer/lib/ui/prompt.js +++ b/tools/eslint/node_modules/inquirer/lib/ui/prompt.js @@ -1,60 +1,48 @@ -/** - * Base interface class other can inherits from - */ - -var _ = require("lodash"); -var rx = require("rx"); -var util = require("util"); -var utils = require("../utils/utils"); -var Base = require("./baseUI"); - -var inquirer = require("../inquirer"); +'use strict'; +var _ = require('lodash'); +var rx = require('rx-lite'); +var util = require('util'); +var runAsync = require('run-async'); +var utils = require('../utils/utils'); +var Base = require('./baseUI'); /** - * Module exports - */ - -module.exports = PromptUI; - - -/** - * Constructor + * Base interface class other can inherits from */ -function PromptUI( prompts ) { - Base.call(this); +var PromptUI = module.exports = function (prompts, opt) { + Base.call(this, opt); this.prompts = prompts; -} -util.inherits( PromptUI, Base ); +}; +util.inherits(PromptUI, Base); -PromptUI.prototype.run = function( questions, allDone ) { +PromptUI.prototype.run = function (questions, allDone) { // Keep global reference to the answers this.answers = {}; this.completed = allDone; // Make sure questions is an array. - if ( _.isPlainObject(questions) ) { + if (_.isPlainObject(questions)) { questions = [questions]; } // Create an observable, unless we received one as parameter. // Note: As this is a public interface, we cannot do an instanceof check as we won't // be using the exact same object in memory. - var obs = _.isArray( questions ) ? rx.Observable.fromArray( questions ) : questions; + var obs = _.isArray(questions) ? rx.Observable.from(questions) : questions; - // Start running the questions - this.process = obs.concatMap( this.processQuestion.bind(this) ); + this.process = obs + .concatMap(this.processQuestion.bind(this)) + .publish(); // `publish` creates a hot Observable. It prevents duplicating prompts. - this.process.forEach( - function() {}, - function( err ) { - throw err; - }, + this.process.subscribe( + _.noop, + function (err) { throw err; }, this.onCompletion.bind(this) ); - return this.process; + return this.process.connect(); }; @@ -62,75 +50,77 @@ PromptUI.prototype.run = function( questions, allDone ) { * Once all prompt are over */ -PromptUI.prototype.onCompletion = function() { +PromptUI.prototype.onCompletion = function () { this.close(); - if ( _.isFunction(this.completed) ) { - this.completed( this.answers ); + if (_.isFunction(this.completed)) { + this.completed(this.answers); } }; -PromptUI.prototype.processQuestion = function( question ) { - return rx.Observable.defer(function() { - var obs = rx.Observable.create(function(obs) { - obs.onNext( question ); +PromptUI.prototype.processQuestion = function (question) { + return rx.Observable.defer(function () { + var obs = rx.Observable.create(function (obs) { + obs.onNext(question); obs.onCompleted(); }); return obs - .concatMap( this.setDefaultType.bind(this) ) - .concatMap( this.filterIfRunnable.bind(this) ) - .concatMap( utils.fetchAsyncQuestionProperty.bind( null, question, "message", this.answers ) ) - .concatMap( utils.fetchAsyncQuestionProperty.bind( null, question, "default", this.answers ) ) - .concatMap( utils.fetchAsyncQuestionProperty.bind( null, question, "choices", this.answers ) ) - .concatMap( this.fetchAnswer.bind(this) ); + .concatMap(this.setDefaultType.bind(this)) + .concatMap(this.filterIfRunnable.bind(this)) + .concatMap(utils.fetchAsyncQuestionProperty.bind(null, question, 'message', this.answers)) + .concatMap(utils.fetchAsyncQuestionProperty.bind(null, question, 'default', this.answers)) + .concatMap(utils.fetchAsyncQuestionProperty.bind(null, question, 'choices', this.answers)) + .concatMap(this.fetchAnswer.bind(this)); }.bind(this)); }; -PromptUI.prototype.fetchAnswer = function( question ) { +PromptUI.prototype.fetchAnswer = function (question) { var Prompt = this.prompts[question.type]; - var prompt = new Prompt( question, this.rl, this.answers ); + var prompt = new Prompt(question, this.rl, this.answers); var answers = this.answers; - return utils.createObservableFromAsync(function() { + return utils.createObservableFromAsync(function () { var done = this.async(); - prompt.run(function( answer ) { + prompt.run(function (answer) { answers[question.name] = answer; done({ name: question.name, answer: answer }); }); }); }; -PromptUI.prototype.setDefaultType = function( question ) { +PromptUI.prototype.setDefaultType = function (question) { // Default type to input - if ( !this.prompts[question.type] ) { - question.type = "input"; + if (!this.prompts[question.type]) { + question.type = 'input'; } - return rx.Observable.defer(function() { - return rx.Observable.return( question ); + return rx.Observable.defer(function () { + return rx.Observable.return(question); }); }; -PromptUI.prototype.filterIfRunnable = function( question ) { - if ( question.when == null ) return rx.Observable.return(question); +PromptUI.prototype.filterIfRunnable = function (question) { + if (question.when == null) { + return rx.Observable.return(question); + } - var handleResult = function( obs, shouldRun ) { - if ( shouldRun ) { - obs.onNext( question ); + var handleResult = function (obs, shouldRun) { + if (shouldRun) { + obs.onNext(question); } obs.onCompleted(); }; var answers = this.answers; - return rx.Observable.defer(function() { - return rx.Observable.create(function( obs ) { - if ( _.isBoolean(question.when) ) { - handleResult( obs, question.when ); + return rx.Observable.defer(function () { + return rx.Observable.create(function (obs) { + if (_.isBoolean(question.when)) { + handleResult(obs, question.when); return; } - utils.runAsync( question.when, function( shouldRun ) { - handleResult( obs, shouldRun ); - }, answers ); + runAsync(question.when, function (shouldRun) { + handleResult(obs, shouldRun); + }, answers); }); }); }; diff --git a/tools/eslint/node_modules/inquirer/lib/utils/events.js b/tools/eslint/node_modules/inquirer/lib/utils/events.js index 0778d51c783f21..bc501d0fe9a78d 100644 --- a/tools/eslint/node_modules/inquirer/lib/utils/events.js +++ b/tools/eslint/node_modules/inquirer/lib/utils/events.js @@ -1,32 +1,37 @@ -var rx = require("rx"); +'use strict'; +var rx = require('rx-lite'); -function normalizeKeypressEvents(args) { - return { value: args[0], key: args[1] }; +function normalizeKeypressEvents(value, key) { + return { value: value, key: key || {} }; } -module.exports = function(rl) { - return { - line: rx.Observable.fromEvent(rl, "line"), +module.exports = function (rl) { + var keypress = rx.Observable.fromEvent(rl.input, 'keypress', normalizeKeypressEvents) + .filter(function (e) { + // Ignore `enter` key. On the readline, we only care about the `line` event. + return e.key.name !== 'enter' && e.key.name !== 'return'; + }); - keypress: rx.Observable.fromEvent(rl, "keypress", normalizeKeypressEvents), + return { + line: rx.Observable.fromEvent(rl, 'line'), + keypress: keypress, - normalizedUpKey: rx.Observable.fromEvent(rl, "keypress", normalizeKeypressEvents).filter(function (e) { - return e.key && (e.key.name === "up" || e.key.name === "k"); + normalizedUpKey: keypress.filter(function (e) { + return e.key.name === 'up' || e.key.name === 'k' || (e.key.name === 'p' && e.key.ctrl); }).share(), - normalizedDownKey: rx.Observable.fromEvent(rl, "keypress", normalizeKeypressEvents).filter(function (e) { - return e.key && (e.key.name === "down" || e.key.name === "j"); + normalizedDownKey: keypress.filter(function (e) { + return e.key.name === 'down' || e.key.name === 'j' || (e.key.name === 'n' && e.key.ctrl); }).share(), - numberKey: rx.Observable.fromEvent(rl, "keypress", normalizeKeypressEvents).filter(function (e) { - return e.value && "123456789".indexOf(e.value) >= 0; - }).map(function(e) { + numberKey: keypress.filter(function (e) { + return e.value && '123456789'.indexOf(e.value) >= 0; + }).map(function (e) { return Number(e.value); }).share(), - spaceKey: rx.Observable.fromEvent(rl, "keypress", normalizeKeypressEvents).filter(function (e) { - return e.key && e.key.name === "space"; - }).share(), - + spaceKey: keypress.filter(function (e) { + return e.key && e.key.name === 'space'; + }).share() }; }; diff --git a/tools/eslint/node_modules/inquirer/lib/utils/paginator.js b/tools/eslint/node_modules/inquirer/lib/utils/paginator.js new file mode 100644 index 00000000000000..f6875f597bd80d --- /dev/null +++ b/tools/eslint/node_modules/inquirer/lib/utils/paginator.js @@ -0,0 +1,38 @@ +'use strict'; + +var _ = require('lodash'); +var chalk = require('chalk'); + + +/** + * The paginator keep trakcs of a pointer index in a list and return + * a subset of the choices if the list is too long. + */ + +var Paginator = module.exports = function () { + this.pointer = 0; + this.lastIndex = 0; +}; + +Paginator.prototype.paginate = function (output, active, pageSize) { + var pageSize = pageSize || 7; + var lines = output.split('\n'); + + // Make sure there's enough lines to paginate + if (lines.length <= pageSize + 2) { + return output; + } + + // Move the pointer only when the user go down and limit it to 3 + if (this.pointer < 3 && this.lastIndex < active && active - this.lastIndex < 9) { + this.pointer = Math.min(3, this.pointer + active - this.lastIndex); + } + this.lastIndex = active; + + // Duplicate the lines so it give an infinite list look + var infinite = _.flatten([lines, lines, lines]); + var topIndex = Math.max(0, active + lines.length - this.pointer); + + var section = infinite.splice(topIndex, pageSize).join('\n'); + return section + '\n' + chalk.dim('(Move up and down to reveal more choices)'); +}; diff --git a/tools/eslint/node_modules/inquirer/lib/utils/readline.js b/tools/eslint/node_modules/inquirer/lib/utils/readline.js new file mode 100644 index 00000000000000..978b0b62f165ea --- /dev/null +++ b/tools/eslint/node_modules/inquirer/lib/utils/readline.js @@ -0,0 +1,51 @@ +'use strict'; +var ansiEscapes = require('ansi-escapes'); + +/** + * Move cursor left by `x` + * @param {Readline} rl - Readline instance + * @param {Number} x - How far to go left (default to 1) + */ + +exports.left = function(rl, x) { + rl.output.write(ansiEscapes.cursorBackward(x)); +}; + +/** + * Move cursor right by `x` + * @param {Readline} rl - Readline instance + * @param {Number} x - How far to go left (default to 1) + */ + +exports.right = function(rl, x) { + rl.output.write(ansiEscapes.cursorForward(x)); +}; + +/** + * Move cursor up by `x` + * @param {Readline} rl - Readline instance + * @param {Number} x - How far to go up (default to 1) + */ + +exports.up = function (rl, x) { + rl.output.write(ansiEscapes.cursorUp(x)); +}; + +/** + * Move cursor down by `x` + * @param {Readline} rl - Readline instance + * @param {Number} x - How far to go down (default to 1) + */ + +exports.down = function (rl, x) { + rl.output.write(ansiEscapes.cursorDown(x)); +}; + +/** + * Clear current line + * @param {Readline} rl - Readline instance + * @param {Number} len - number of line to delete + */ +exports.clearLine = function (rl, len) { + rl.output.write(ansiEscapes.eraseLines(len)); +}; diff --git a/tools/eslint/node_modules/inquirer/lib/utils/screen-manager.js b/tools/eslint/node_modules/inquirer/lib/utils/screen-manager.js new file mode 100644 index 00000000000000..517998c6df8a43 --- /dev/null +++ b/tools/eslint/node_modules/inquirer/lib/utils/screen-manager.js @@ -0,0 +1,129 @@ +'use strict'; +var _ = require('lodash'); +var util = require('./readline'); +var cliWidth = require('cli-width'); +var stripAnsi = require('strip-ansi'); +var stringWidth = require('string-width'); + +function height(content) { + return content.split('\n').length; +} + +function lastLine(content) { + return _.last(content.split('\n')); +} + +var ScreenManager = module.exports = function (rl) { + // These variables are keeping information to allow correct prompt re-rendering + this.height = 0; + this.extraLinesUnderPrompt = 0; + + this.rl = rl; +}; + +ScreenManager.prototype.render = function (content, bottomContent) { + this.rl.output.unmute(); + this.clean(this.extraLinesUnderPrompt); + + /** + * Write message to screen and setPrompt to control backspace + */ + + var promptLine = lastLine(content); + var rawPromptLine = stripAnsi(promptLine); + + // Remove the rl.line from our prompt. We can't rely on the content of + // rl.line (mainly because of the password prompt), so just rely on it's + // length. + var prompt = promptLine; + if (this.rl.line.length) { + prompt = prompt.slice(0, -this.rl.line.length); + } + this.rl.setPrompt(prompt); + + // setPrompt will change cursor position, now we can get correct value + var cursorPos = this.rl._getCursorPos(); + var width = this.normalizedCliWidth(); + + content = forceLineReturn(content, width); + if (bottomContent) { + bottomContent = forceLineReturn(bottomContent, width); + } + // Manually insert an extra line if we're at the end of the line. + // This prevent the cursor from appearing at the beginning of the + // current line. + if (rawPromptLine.length % width === 0) { + content = content + '\n'; + } + var fullContent = content + (bottomContent ? '\n' + bottomContent : ''); + this.rl.output.write(fullContent); + + /** + * Re-adjust the cursor at the correct position. + */ + + // We need to consider parts of the prompt under the cursor as part of the bottom + // content in order to correctly cleanup and re-render. + var promptLineUpDiff = Math.floor(rawPromptLine.length / width) - cursorPos.rows; + var bottomContentHeight = promptLineUpDiff + (bottomContent ? height(bottomContent) : 0); + if (bottomContentHeight > 0) { + util.up(this.rl, bottomContentHeight); + } + + // Reset cursor at the beginning of the line + util.left(this.rl, stringWidth(lastLine(fullContent))); + + // Adjust cursor on the right + util.right(this.rl, cursorPos.cols); + + /** + * Set up state for next re-rendering + */ + this.extraLinesUnderPrompt = bottomContentHeight; + this.height = height(fullContent); + + this.rl.output.mute(); +}; + +ScreenManager.prototype.clean = function (extraLines) { + if (extraLines > 0) { + util.down(this.rl, extraLines); + } + util.clearLine(this.rl, this.height); +}; + +ScreenManager.prototype.done = function () { + this.rl.setPrompt(''); + this.rl.output.unmute(); + this.rl.output.write('\n'); +}; + +ScreenManager.prototype.normalizedCliWidth = function () { + var width = cliWidth({ + defaultWidth: 80, + output: this.rl.output + }); + if (process.platform === 'win32') { + return width - 1; + } + return width; +}; + +function breakLines(lines, width) { + // Break lines who're longuer than the cli width so we can normalize the natural line + // returns behavior accross terminals. + var regex = new RegExp( + '(?:(?:\\033\[[0-9;]*m)*.?){1,' + width + '}', + 'g' + ); + return lines.map(function (line) { + var chunk = line.match(regex); + // last match is always empty + chunk.pop(); + return chunk || ''; + }); +} + +function forceLineReturn(content, width) { + return _.flatten(breakLines(content.split('\n'), width)).join('\n'); +} diff --git a/tools/eslint/node_modules/inquirer/lib/utils/tty.js b/tools/eslint/node_modules/inquirer/lib/utils/tty.js deleted file mode 100644 index a1c0c5c6385ca2..00000000000000 --- a/tools/eslint/node_modules/inquirer/lib/utils/tty.js +++ /dev/null @@ -1,130 +0,0 @@ -/** - * TTY mixin helpers - */ - -var _ = require("lodash"); -var readline = require("readline"); -var cliWidth = require("cli-width"); - -var tty = module.exports; - - -/** - * Remove the prompt from screen - * @param {Number} Extra lines to remove (probably to compensate the "enter" key line - * return) - * @return {Prompt} self - */ - -tty.clean = function( extra ) { - _.isNumber(extra) || (extra = 0); - var len = this.height + extra; - - while ( len-- ) { - readline.moveCursor(this.rl.output, -cliWidth(), 0); - readline.clearLine(this.rl.output, 0); - if ( len ) readline.moveCursor(this.rl.output, 0, -1); - } - return this; -}; - - -/** - * Move cursor down by `x` - * @param {Number} x How far to go down (default to 1) - * @return {Prompt} self - */ - -tty.down = function( x ) { - _.isNumber(x) || (x = 1); - - // @bug: Write new lines instead of moving cursor as unix system don't allocate a new - // line when the cursor is moved over there. - while ( x-- ) { - this.write("\n"); - } - - return this; -}; - - -/** - * Move cursor up by `x` - * @param {Number} x How far to go up (default to 1) - * @return {Prompt} self - */ - -tty.up = function( x ) { - _.isNumber(x) || (x = 1); - readline.moveCursor( this.rl.output, 0, -x ); - return this; -}; - -/** - * Move cursor left by `x` - * @param {Number} x How far to go left (default to 1) - * @return {Prompt} self - */ - -tty.left = function( x ) { - _.isNumber(x) || (x = 1); - readline.moveCursor (this.rl.output, -x, 0); - return this; -}; - - -/** - * Write a string to the stdout - * @return {Self} - */ - -tty.write = function( str ) { - this.rl.output.write( str ); - return this; -}; - - -/** - * Hide cursor - * @return {Prompt} self - */ - -tty.hideCursor = function() { - return this.write("\x1B[?25l"); -}; - - -/** - * Show cursor - * @return {Prompt} self - */ - -tty.showCursor = function() { - return this.write("\x1B[?25h"); -}; - - -/** - * Remember the cursor position - * @return {Prompt} Self - */ - -tty.cacheCursorPos = function() { - this.cursorPos = this.rl._getCursorPos(); - return this; -}; - - -/** - * Restore the cursor position to where it has been previously stored. - * @return {Prompt} Self - */ - -tty.restoreCursorPos = function() { - if ( !this.cursorPos ) return; - var line = this.rl._prompt + this.rl.line; - readline.moveCursor(this.rl.output, -line.length, 0); - readline.moveCursor(this.rl.output, this.cursorPos.cols, 0); - this.cursorPos = null; - return this; -}; diff --git a/tools/eslint/node_modules/inquirer/lib/utils/utils.js b/tools/eslint/node_modules/inquirer/lib/utils/utils.js index a91e108667a53a..f90bfdd47fa28f 100644 --- a/tools/eslint/node_modules/inquirer/lib/utils/utils.js +++ b/tools/eslint/node_modules/inquirer/lib/utils/utils.js @@ -1,42 +1,7 @@ -/** - * Utility functions - */ - -"use strict"; -var _ = require("lodash"); -var chalk = require("chalk"); -var rx = require("rx"); -var figures = require("figures"); - - -/** - * Module exports - */ - -var utils = module.exports; - - -/** - * Run a function asynchronously or synchronously - * @param {Function} func Function to run - * @param {Function} cb Callback function passed the `func` returned value - * @...rest {Mixed} rest Arguments to pass to `func` - * @return {Null} - */ - -utils.runAsync = function( func, cb ) { - var async = false; - var isValid = func.apply({ - async: function() { - async = true; - return _.once(cb); - } - }, Array.prototype.slice.call(arguments, 2) ); - - if ( !async ) { - cb(isValid); - } -}; +'use strict'; +var _ = require('lodash'); +var rx = require('rx-lite'); +var runAsync = require('run-async'); /** @@ -45,11 +10,11 @@ utils.runAsync = function( func, cb ) { * @return {rx.Observable} Observable emitting when value is known */ -utils.createObservableFromAsync = function( func ) { - return rx.Observable.defer(function() { - return rx.Observable.create(function( obs ) { - utils.runAsync( func, function( value ) { - obs.onNext( value ); +exports.createObservableFromAsync = function (func) { + return rx.Observable.defer(function () { + return rx.Observable.create(function (obs) { + runAsync(func, function (value) { + obs.onNext(value); obs.onCompleted(); }); }); @@ -67,57 +32,16 @@ utils.createObservableFromAsync = function( func ) { * @return {rx.Obsersable} - Observable emitting once value is known */ -utils.fetchAsyncQuestionProperty = function( question, prop, answers ) { - if ( !_.isFunction(question[prop]) ) return rx.Observable.return(question); +exports.fetchAsyncQuestionProperty = function (question, prop, answers) { + if (!_.isFunction(question[prop])) { + return rx.Observable.return(question); + } - return utils.createObservableFromAsync(function() { + return exports.createObservableFromAsync(function () { var done = this.async(); - utils.runAsync( question[prop], function( value ) { + runAsync(question[prop], function (value) { question[prop] = value; - done( question ); - }, answers ); + done(question); + }, answers); }); }; - - -/** - * Get the pointer char - * @return {String} the pointer char - */ - -utils.getPointer = function() { - return figures.pointer; -}; - - -/** - * Get the checkbox - * @param {Boolean} checked - add a X or not to the checkbox - * @param {String} after - Text to append after the check char - * @return {String} - Composited checkbox string - */ - -utils.getCheckbox = function( checked, after ) { - var checked = checked ? chalk.green( figures.radioOn ) : figures.radioOff; - return checked + " " + ( after || "" ); -}; - -/** - * Helper for writing message in Prompt - * @param {Prompt} prompt - The Prompt object that extends tty - * @param {String} message - The message to be output - */ -utils.writeMessage = function ( prompt, message ) { - var msgLines = message.split(/\n/); - prompt.height = msgLines.length; - - // Write message to screen and setPrompt to control backspace - prompt.rl.setPrompt( _.last(msgLines) ); - - if ( process.stdout.rows === 0 && process.stdout.columns === 0 ) { - /* When it's a tty through serial port there's no terminal info and the render will malfunction, - so we need enforce the cursor to locate to the leftmost position for rendering. */ - prompt.left( message.length + prompt.rl.line.length ); - } - prompt.write( message ); -}; diff --git a/tools/eslint/node_modules/inquirer/node_modules/ansi-regex/index.js b/tools/eslint/node_modules/inquirer/node_modules/ansi-regex/index.js deleted file mode 100644 index 2fcdd1e472f961..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/ansi-regex/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -module.exports = function () { - return /(?:(?:\u001b\[)|\u009b)(?:(?:[0-9]{1,3})?(?:(?:;[0-9]{0,3})*)?[A-M|f-m])|\u001b[A-M]/g; -}; diff --git a/tools/eslint/node_modules/inquirer/node_modules/ansi-regex/package.json b/tools/eslint/node_modules/inquirer/node_modules/ansi-regex/package.json deleted file mode 100644 index 3ce9ccdb878b9c..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/ansi-regex/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "name": "ansi-regex", - "version": "1.1.1", - "description": "Regular expression for matching ANSI escape codes", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/ansi-regex.git" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - } - ], - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha test/test.js", - "view-supported": "node test/viewCodes.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "text", - "regex", - "regexp", - "re", - "match", - "test", - "find", - "pattern" - ], - "devDependencies": { - "mocha": "*" - }, - "gitHead": "47fb974630af70998157b30fad6eb5e5bd7c7cd6", - "bugs": { - "url": "https://github.com/sindresorhus/ansi-regex/issues" - }, - "homepage": "https://github.com/sindresorhus/ansi-regex", - "_id": "ansi-regex@1.1.1", - "_shasum": "41c847194646375e6a1a5d10c3ca054ef9fc980d", - "_from": "ansi-regex@>=1.1.1 <2.0.0", - "_npmVersion": "2.1.16", - "_nodeVersion": "0.10.35", - "_npmUser": { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - }, - "dist": { - "shasum": "41c847194646375e6a1a5d10c3ca054ef9fc980d", - "tarball": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/tools/eslint/node_modules/inquirer/node_modules/ansi-regex/readme.md b/tools/eslint/node_modules/inquirer/node_modules/ansi-regex/readme.md deleted file mode 100644 index ae876e7292feb7..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/ansi-regex/readme.md +++ /dev/null @@ -1,33 +0,0 @@ -# ansi-regex [![Build Status](https://travis-ci.org/sindresorhus/ansi-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/ansi-regex) - -> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) - - -## Install - -```sh -$ npm install --save ansi-regex -``` - - -## Usage - -```js -var ansiRegex = require('ansi-regex'); - -ansiRegex().test('\u001b[4mcake\u001b[0m'); -//=> true - -ansiRegex().test('cake'); -//=> false - -'\u001b[4mcake\u001b[0m'.match(ansiRegex()); -//=> ['\u001b[4m', '\u001b[0m'] -``` - -*It's a function so you can create multiple instances. Regexes with the global flag will have the `.lastIndex` property changed for each call to methods on the instance. Therefore reusing the instance with multiple calls will not work as expected for `.test()`.* - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/eslint/node_modules/inquirer/node_modules/cli-width/.npmignore b/tools/eslint/node_modules/inquirer/node_modules/cli-width/.npmignore deleted file mode 100644 index 73ecdc8a12afda..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/cli-width/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -*.log -*.swp diff --git a/tools/eslint/node_modules/inquirer/node_modules/cli-width/README.md b/tools/eslint/node_modules/inquirer/node_modules/cli-width/README.md deleted file mode 100644 index 050280efd0181a..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/cli-width/README.md +++ /dev/null @@ -1,28 +0,0 @@ -cli-width -========= - -Get stdout window width, with two fallbacks, `tty` and then a default. - -## Usage - -``` -npm install --save cli-width -``` - -```js -'use stict'; - -var cliWidth = require('cli-width'); - -cliWidth(); // maybe 204 :) -``` - -If none of the methods are supported, the default is `0` and -can be changed via `cliWidth.defaultWidth = 200;`. - -## Tests - -```bash -npm install -npm test -``` diff --git a/tools/eslint/node_modules/inquirer/node_modules/cli-width/index.js b/tools/eslint/node_modules/inquirer/node_modules/cli-width/index.js deleted file mode 100644 index 1299c3190533e0..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/cli-width/index.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -exports = module.exports = cliWidth; -exports.defaultWidth = 0; - -function cliWidth() { - if (process.stdout.getWindowSize) { - return process.stdout.getWindowSize()[0]; - } - else { - var tty = require('tty'); - - if (tty.getWindowSize) { - return tty.getWindowSize()[1]; - } - else { - return exports.defaultWidth; - } - } -}; diff --git a/tools/eslint/node_modules/inquirer/node_modules/cli-width/package.json b/tools/eslint/node_modules/inquirer/node_modules/cli-width/package.json deleted file mode 100644 index 0006924e14732a..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/cli-width/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "cli-width", - "version": "1.0.1", - "description": "Get stdout window width, with two fallbacks, tty and then a default.", - "main": "index.js", - "scripts": { - "test": "node test | tap-spec" - }, - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/knownasilya/cli-width.git" - }, - "author": { - "name": "Ilya Radchenko", - "email": "ilya@burstcreations.com" - }, - "license": "ISC", - "bugs": { - "url": "https://github.com/knownasilya/cli-width/issues" - }, - "homepage": "https://github.com/knownasilya/cli-width", - "devDependencies": { - "tap-spec": "^2.2.0", - "tape": "^3.4.0" - }, - "gitHead": "4448d9599eee5a85da34e24baad39cfddfc1d807", - "_id": "cli-width@1.0.1", - "_shasum": "14d4f6870234d91e97f7dd81e76be8271410a1ef", - "_from": "cli-width@>=1.0.1 <2.0.0", - "_npmVersion": "2.1.2", - "_nodeVersion": "0.10.26", - "_npmUser": { - "name": "knownasilya", - "email": "ilya@burstcreations.com" - }, - "maintainers": [ - { - "name": "knownasilya", - "email": "ilya@burstcreations.com" - } - ], - "dist": { - "shasum": "14d4f6870234d91e97f7dd81e76be8271410a1ef", - "tarball": "http://registry.npmjs.org/cli-width/-/cli-width-1.0.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/cli-width/-/cli-width-1.0.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/tools/eslint/node_modules/inquirer/node_modules/cli-width/test/index.js b/tools/eslint/node_modules/inquirer/node_modules/cli-width/test/index.js deleted file mode 100644 index acccd3861773d3..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/cli-width/test/index.js +++ /dev/null @@ -1,40 +0,0 @@ -'use strict'; - -var tty = require('tty'); -var test = require('tape'); -var lib = require('../'); - - -test('uses process.stdout.getWindowSize', function (t) { - // mock stdout.getWindowSize - process.stdout.getWindowSize = function () { - return [100]; - }; - - t.equal(lib(), 100, 'equal to mocked, 100'); - t.end(); -}); - -test('uses tty.getWindowSize', function (t) { - process.stdout.getWindowSize = undefined; - tty.getWindowSize = function () { - return [3, 5]; - }; - - t.equal(lib(), 5, 'equal to mocked, 5'); - t.end(); -}); - -test('uses default', function (t) { - tty.getWindowSize = undefined; - - t.equal(lib(), 0, 'default unset value, 0'); - t.end(); -}); - -test('uses overridden default', function (t) { - lib.defaultWidth = 10; - - t.equal(lib(), 10, 'user-set default value, 10'); - t.end(); -}); diff --git a/tools/eslint/node_modules/inquirer/node_modules/figures/index.js b/tools/eslint/node_modules/inquirer/node_modules/figures/index.js deleted file mode 100644 index 3083de17c6eb7d..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/figures/index.js +++ /dev/null @@ -1,87 +0,0 @@ -'use strict'; -var platform = process.platform; - -var main = { - tick: '✔', - cross: '✖', - star: '★', - square: '▇', - squareSmall: '◻', - squareSmallFilled: '◼', - circle: '◯', - circleFilled: '◉', - circleDotted: '◌', - circleDouble: '◎', - circleCircle: 'ⓞ', - circleCross: 'ⓧ', - circlePipe: 'Ⓘ', - circleQuestionMark: '?⃝', - bullet: '●', - dot: '․', - line: '─', - ellipsis: '…', - pointer: '❯', - info: 'ℹ', - warning: '⚠', - hamburger: '☰', - smiley: '㋡', - mustache: '෴', - heart: '♥', - arrowUp: '↑', - arrowDown: '↓', - arrowLeft: '←', - arrowRight: '→', - radioOn: '◉', - radioOff: '◯', - checkboxOn: '☒', - checkboxOff: '☐', - checkboxCircleOn: 'ⓧ', - checkboxCircleOff: 'Ⓘ', - questionMarkPrefix: '?⃝', -}; - -var win = { - tick: '√', - cross: '×', - star: '*', - square: '█', - squareSmall: '[ ]', - squareSmallFilled: '[█]', - circle: '( )', - circleFilled: '(*)', - circleDotted: '( )', - circleDouble: '( )', - circleCircle: '(○)', - circleCross: '(×)', - circlePipe: '(│)', - circleQuestionMark: '(?)', - bullet: '*', - dot: '.', - line: '─', - ellipsis: '...', - pointer: '>', - info: 'i', - warning: '‼', - hamburger: '≡', - smiley: '☺', - mustache: '┌─┐', - heart: main.heart, - arrowUp: main.arrowUp, - arrowDown: main.arrowDown, - arrowLeft: main.arrowLeft, - arrowRight: main.arrowRight, - radioOn: '(*)', - radioOff: '( )', - checkboxOn: '[×]', - checkboxOff: '[ ]', - checkboxCircleOn: '(×)', - checkboxCircleOff: '( )', - questionMarkPrefix: '?' -}; - -if (platform === 'linux') { - // the main one doesn't look that good on Ubuntu - main.questionMarkPrefix = '?'; -} - -module.exports = platform === 'win32' ? win : main; diff --git a/tools/eslint/node_modules/inquirer/node_modules/figures/package.json b/tools/eslint/node_modules/inquirer/node_modules/figures/package.json deleted file mode 100644 index bf9d5d0c297e21..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/figures/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "figures", - "version": "1.3.5", - "description": "Unicode symbols with Windows CMD fallbacks", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/figures.git" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "node test.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "unicode", - "cli", - "cmd", - "command-line", - "characters", - "char", - "symbol", - "symbols", - "figure", - "figures", - "fallback" - ], - "devDependencies": { - "ava": "0.0.4" - }, - "gitHead": "5dd6a2d3320c904b69e5d59ee9c5099fa1cd6f1e", - "bugs": { - "url": "https://github.com/sindresorhus/figures/issues" - }, - "homepage": "https://github.com/sindresorhus/figures", - "_id": "figures@1.3.5", - "_shasum": "d1a31f4e1d2c2938ecde5c06aa16134cf29f4771", - "_from": "figures@>=1.3.5 <2.0.0", - "_npmVersion": "2.1.5", - "_nodeVersion": "0.10.32", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "dist": { - "shasum": "d1a31f4e1d2c2938ecde5c06aa16134cf29f4771", - "tarball": "http://registry.npmjs.org/figures/-/figures-1.3.5.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/figures/-/figures-1.3.5.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/tools/eslint/node_modules/inquirer/node_modules/figures/readme.md b/tools/eslint/node_modules/inquirer/node_modules/figures/readme.md deleted file mode 100644 index 839a309ee0cae6..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/figures/readme.md +++ /dev/null @@ -1,34 +0,0 @@ -# figures [![Build Status](https://travis-ci.org/sindresorhus/figures.svg?branch=master)](https://travis-ci.org/sindresorhus/figures) - -> Unicode symbols with Windows CMD fallbacks - -[![](screenshot.png)](index.js) - -[*and more...*](index.js) - -Windows CMD only supports a [limited character set](http://en.wikipedia.org/wiki/Code_page_437). - - -## Install - -```sh -$ npm install --save figures -``` - - -## Usage - -See the [source](index.js) for supported symbols. - -```js -var figures = require('figures'); - -console.log(figures.tick); -// On real OSes: ✔︎ -// On Windows: √ -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/README.md b/tools/eslint/node_modules/inquirer/node_modules/lodash/README.md deleted file mode 100644 index cd0fe0cebb7027..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/README.md +++ /dev/null @@ -1,120 +0,0 @@ -# lodash v3.9.3 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash](https://lodash.com/) exported as [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) modules. - -Generated using [lodash-cli](https://www.npmjs.com/package/lodash-cli): -```bash -$ lodash modularize modern exports=node -o ./ -$ lodash modern -d -o ./index.js -``` - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash -``` - -In Node.js/io.js: - -```js -// load the modern build -var _ = require('lodash'); -// or a method category -var array = require('lodash/array'); -// or a method (great for smaller builds with browserify/webpack) -var chunk = require('lodash/array/chunk'); -``` - -See the [package source](https://github.com/lodash/lodash/tree/3.9.3-npm) for more details. - -**Note:**
      -Don’t assign values to the [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL.
      -Install [n_](https://www.npmjs.com/package/n_) for a REPL that includes lodash by default. - -## Module formats - -lodash is also available in a variety of other builds & module formats. - - * npm packages for [modern](https://www.npmjs.com/package/lodash), [compatibility](https://www.npmjs.com/package/lodash-compat), & [per method](https://www.npmjs.com/browse/keyword/lodash-modularized) builds - * AMD modules for [modern](https://github.com/lodash/lodash/tree/3.9.3-amd) & [compatibility](https://github.com/lodash/lodash-compat/tree/3.9.3-amd) builds - * ES modules for the [modern](https://github.com/lodash/lodash/tree/3.9.3-es) build - -## Further Reading - - * [API Documentation](https://lodash.com/docs) - * [Build Differences](https://github.com/lodash/lodash/wiki/Build-Differences) - * [Changelog](https://github.com/lodash/lodash/wiki/Changelog) - * [Release Notes](https://github.com/lodash/lodash/releases) - * [Roadmap](https://github.com/lodash/lodash/wiki/Roadmap) - * [More Resources](https://github.com/lodash/lodash/wiki/Resources) - -## Features - - * ~100% [code coverage](https://coveralls.io/r/lodash) - * Follows [semantic versioning](http://semver.org/) for releases - * [Lazily evaluated](http://filimanjaro.com/blog/2014/introducing-lazy-evaluation/) chaining - * [_(…)](https://lodash.com/docs#_) supports intuitive chaining - * [_.add](https://lodash.com/docs#add) for mathematical composition - * [_.ary](https://lodash.com/docs#ary) & [_.rearg](https://lodash.com/docs#rearg) to change function argument limits & order - * [_.at](https://lodash.com/docs#at) for cherry-picking collection values - * [_.attempt](https://lodash.com/docs#attempt) to execute functions which may error without a try-catch - * [_.before](https://lodash.com/docs#before) to complement [_.after](https://lodash.com/docs#after) - * [_.bindKey](https://lodash.com/docs#bindKey) for binding [*“lazy”*](http://michaux.ca/articles/lazy-function-definition-pattern) defined methods - * [_.chunk](https://lodash.com/docs#chunk) for splitting an array into chunks of a given size - * [_.clone](https://lodash.com/docs#clone) supports shallow cloning of `Date` & `RegExp` objects - * [_.cloneDeep](https://lodash.com/docs#cloneDeep) for deep cloning arrays & objects - * [_.curry](https://lodash.com/docs#curry) & [_.curryRight](https://lodash.com/docs#curryRight) for creating [curried](http://hughfdjackson.com/javascript/why-curry-helps/) functions - * [_.debounce](https://lodash.com/docs#debounce) & [_.throttle](https://lodash.com/docs#throttle) are cancelable & accept options for more control - * [_.fill](https://lodash.com/docs#fill) to fill arrays with values - * [_.findKey](https://lodash.com/docs#findKey) for finding keys - * [_.flow](https://lodash.com/docs#flow) to complement [_.flowRight](https://lodash.com/docs#flowRight) (a.k.a `_.compose`) - * [_.forEach](https://lodash.com/docs#forEach) supports exiting early - * [_.forIn](https://lodash.com/docs#forIn) for iterating all enumerable properties - * [_.forOwn](https://lodash.com/docs#forOwn) for iterating own properties - * [_.get](https://lodash.com/docs#get) & [_.set](https://lodash.com/docs#set) for deep property getting & setting - * [_.gt](https://lodash.com/docs#gt), [_.gte](https://lodash.com/docs#gte), [_.lt](https://lodash.com/docs#lt), & [_.lte](https://lodash.com/docs#lte) relational methods - * [_.inRange](https://lodash.com/docs#inRange) for checking whether a number is within a given range - * [_.isNative](https://lodash.com/docs#isNative) to check for native functions - * [_.isPlainObject](https://lodash.com/docs#isPlainObject) & [_.toPlainObject](https://lodash.com/docs#toPlainObject) to check for & convert to `Object` objects - * [_.isTypedArray](https://lodash.com/docs#isTypedArray) to check for typed arrays - * [_.mapKeys](https://lodash.com/docs#mapKeys) for mapping keys to an object - * [_.matches](https://lodash.com/docs#matches) supports deep object comparisons - * [_.matchesProperty](https://lodash.com/docs#matchesProperty) to complement [_.matches](https://lodash.com/docs#matches) & [_.property](https://lodash.com/docs#property) - * [_.method](https://lodash.com/docs#method) & [_.methodOf](https://lodash.com/docs#methodOf) to create functions that invoke methods - * [_.merge](https://lodash.com/docs#merge) for a deep [_.extend](https://lodash.com/docs#extend) - * [_.parseInt](https://lodash.com/docs#parseInt) for consistent cross-environment behavior - * [_.pull](https://lodash.com/docs#pull), [_.pullAt](https://lodash.com/docs#pullAt), & [_.remove](https://lodash.com/docs#remove) for mutating arrays - * [_.random](https://lodash.com/docs#random) supports returning floating-point numbers - * [_.restParam](https://lodash.com/docs#restParam) & [_.spread](https://lodash.com/docs#spread) for applying rest parameters & spreading arguments to functions - * [_.runInContext](https://lodash.com/docs#runInContext) for collisionless mixins & easier mocking - * [_.slice](https://lodash.com/docs#slice) for creating subsets of array-like values - * [_.sortByAll](https://lodash.com/docs#sortByAll) & [_.sortByOrder](https://lodash.com/docs#sortByOrder) for sorting by multiple properties & orders - * [_.sum](https://lodash.com/docs#sum) to get the sum of values - * [_.support](https://lodash.com/docs#support) for flagging environment features - * [_.template](https://lodash.com/docs#template) supports [*“imports”*](https://lodash.com/docs#templateSettings-imports) options & [ES template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-template-literal-lexical-components) - * [_.transform](https://lodash.com/docs#transform) as a powerful alternative to [_.reduce](https://lodash.com/docs#reduce) for transforming objects - * [_.unzipWith](https://lodash.com/docs#unzipWith) & [_.zipWith](https://lodash.com/docs#zipWith) to specify how grouped values should be combined - * [_.xor](https://lodash.com/docs#xor) to complement [_.difference](https://lodash.com/docs#difference), [_.intersection](https://lodash.com/docs#intersection), & [_.union](https://lodash.com/docs#union) - * [_.valuesIn](https://lodash.com/docs#valuesIn) for getting values of all enumerable properties - * [_.bind](https://lodash.com/docs#bind), [_.curry](https://lodash.com/docs#curry), [_.partial](https://lodash.com/docs#partial), & - [more](https://lodash.com/docs "_.bindKey, _.curryRight, _.partialRight") support customizable argument placeholders - * [_.capitalize](https://lodash.com/docs#capitalize), [_.trim](https://lodash.com/docs#trim), & - [more](https://lodash.com/docs "_.camelCase, _.deburr, _.endsWith, _.escapeRegExp, _.kebabCase, _.pad, _.padLeft, _.padRight, _.repeat, _.snakeCase, _.startCase, _.startsWith, _.trimLeft, _.trimRight, _.trunc, _.words") string methods - * [_.clone](https://lodash.com/docs#clone), [_.isEqual](https://lodash.com/docs#isEqual), & - [more](https://lodash.com/docs "_.assign, _.cloneDeep, _.merge") accept customizer callbacks - * [_.dropWhile](https://lodash.com/docs#dropWhile), [_.takeWhile](https://lodash.com/docs#takeWhile), & - [more](https://lodash.com/docs "_.drop, _.dropRight, _.dropRightWhile, _.take, _.takeRight, _.takeRightWhile") to complement [_.first](https://lodash.com/docs#first), [_.initial](https://lodash.com/docs#initial), [_.last](https://lodash.com/docs#last), & [_.rest](https://lodash.com/docs#rest) - * [_.findLast](https://lodash.com/docs#findLast), [_.findLastKey](https://lodash.com/docs#findLastKey), & - [more](https://lodash.com/docs "_.curryRight, _.dropRight, _.dropRightWhile, _.flowRight, _.forEachRight, _.forInRight, _.forOwnRight, _.padRight, partialRight, _.takeRight, _.trimRight, _.takeRightWhile") right-associative methods - * [_.includes](https://lodash.com/docs#includes), [_.toArray](https://lodash.com/docs#toArray), & - [more](https://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.findLast, _.findWhere, _.forEach, _.forEachRight, _.groupBy, _.indexBy, _.invoke, _.map, _.max, _.min, _.partition, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.size, _.some, _.sortBy, _.sortByAll, _.sortByOrder, _.sum, _.where") accept strings - * [_#commit](https://lodash.com/docs#prototype-commit) & [_#plant](https://lodash.com/docs#prototype-plant) for working with chain sequences - * [_#thru](https://lodash.com/docs#thru) to pass values thru a chain sequence - -## Support - -Tested in Chrome 41-42, Firefox 37-38, IE 6-11, MS Edge, Opera 28-29, Safari 5-8, ChakraNode 0.12.2, io.js 2.1.0, Node.js 0.8.28, 0.10.38, & 0.12.4, PhantomJS 1.9.8, RingoJS 0.11, & Rhino 1.7.6 -Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available. Special thanks to [Sauce Labs](https://saucelabs.com/) for providing automated browser testing. diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array.js deleted file mode 100644 index e5121fa52ec264..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array.js +++ /dev/null @@ -1,44 +0,0 @@ -module.exports = { - 'chunk': require('./array/chunk'), - 'compact': require('./array/compact'), - 'difference': require('./array/difference'), - 'drop': require('./array/drop'), - 'dropRight': require('./array/dropRight'), - 'dropRightWhile': require('./array/dropRightWhile'), - 'dropWhile': require('./array/dropWhile'), - 'fill': require('./array/fill'), - 'findIndex': require('./array/findIndex'), - 'findLastIndex': require('./array/findLastIndex'), - 'first': require('./array/first'), - 'flatten': require('./array/flatten'), - 'flattenDeep': require('./array/flattenDeep'), - 'head': require('./array/head'), - 'indexOf': require('./array/indexOf'), - 'initial': require('./array/initial'), - 'intersection': require('./array/intersection'), - 'last': require('./array/last'), - 'lastIndexOf': require('./array/lastIndexOf'), - 'object': require('./array/object'), - 'pull': require('./array/pull'), - 'pullAt': require('./array/pullAt'), - 'remove': require('./array/remove'), - 'rest': require('./array/rest'), - 'slice': require('./array/slice'), - 'sortedIndex': require('./array/sortedIndex'), - 'sortedLastIndex': require('./array/sortedLastIndex'), - 'tail': require('./array/tail'), - 'take': require('./array/take'), - 'takeRight': require('./array/takeRight'), - 'takeRightWhile': require('./array/takeRightWhile'), - 'takeWhile': require('./array/takeWhile'), - 'union': require('./array/union'), - 'uniq': require('./array/uniq'), - 'unique': require('./array/unique'), - 'unzip': require('./array/unzip'), - 'unzipWith': require('./array/unzipWith'), - 'without': require('./array/without'), - 'xor': require('./array/xor'), - 'zip': require('./array/zip'), - 'zipObject': require('./array/zipObject'), - 'zipWith': require('./array/zipWith') -}; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/chunk.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/chunk.js deleted file mode 100644 index 4de9b3961843b0..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/chunk.js +++ /dev/null @@ -1,47 +0,0 @@ -var baseSlice = require('../internal/baseSlice'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** Native method references. */ -var ceil = Math.ceil; - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Creates an array of elements split into groups the length of `size`. - * If `collection` can't be split evenly, the final chunk will be the remaining - * elements. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to process. - * @param {number} [size=1] The length of each chunk. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the new array containing chunks. - * @example - * - * _.chunk(['a', 'b', 'c', 'd'], 2); - * // => [['a', 'b'], ['c', 'd']] - * - * _.chunk(['a', 'b', 'c', 'd'], 3); - * // => [['a', 'b', 'c'], ['d']] - */ -function chunk(array, size, guard) { - if (guard ? isIterateeCall(array, size, guard) : size == null) { - size = 1; - } else { - size = nativeMax(+size || 1, 1); - } - var index = 0, - length = array ? array.length : 0, - resIndex = -1, - result = Array(ceil(length / size)); - - while (index < length) { - result[++resIndex] = baseSlice(array, index, (index += size)); - } - return result; -} - -module.exports = chunk; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/compact.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/compact.js deleted file mode 100644 index 1dc1c55e8f1efb..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/compact.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Creates an array with all falsey values removed. The values `false`, `null`, - * `0`, `""`, `undefined`, and `NaN` are falsey. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to compact. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.compact([0, 1, false, 2, '', 3]); - * // => [1, 2, 3] - */ -function compact(array) { - var index = -1, - length = array ? array.length : 0, - resIndex = -1, - result = []; - - while (++index < length) { - var value = array[index]; - if (value) { - result[++resIndex] = value; - } - } - return result; -} - -module.exports = compact; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/difference.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/difference.js deleted file mode 100644 index 5049337e5f3a9d..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/difference.js +++ /dev/null @@ -1,28 +0,0 @@ -var baseDifference = require('../internal/baseDifference'), - baseFlatten = require('../internal/baseFlatten'), - isArrayLike = require('../internal/isArrayLike'), - restParam = require('../function/restParam'); - -/** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The arrays of values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.difference([1, 2, 3], [4, 2]); - * // => [1, 3] - */ -var difference = restParam(function(array, values) { - return isArrayLike(array) - ? baseDifference(array, baseFlatten(values, false, true)) - : []; -}); - -module.exports = difference; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/drop.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/drop.js deleted file mode 100644 index 039a0b5fdcdf2b..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/drop.js +++ /dev/null @@ -1,39 +0,0 @@ -var baseSlice = require('../internal/baseSlice'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Creates a slice of `array` with `n` elements dropped from the beginning. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.drop([1, 2, 3]); - * // => [2, 3] - * - * _.drop([1, 2, 3], 2); - * // => [3] - * - * _.drop([1, 2, 3], 5); - * // => [] - * - * _.drop([1, 2, 3], 0); - * // => [1, 2, 3] - */ -function drop(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - return baseSlice(array, n < 0 ? 0 : n); -} - -module.exports = drop; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/dropRight.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/dropRight.js deleted file mode 100644 index 14b5eb6f0a198e..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/dropRight.js +++ /dev/null @@ -1,40 +0,0 @@ -var baseSlice = require('../internal/baseSlice'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Creates a slice of `array` with `n` elements dropped from the end. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropRight([1, 2, 3]); - * // => [1, 2] - * - * _.dropRight([1, 2, 3], 2); - * // => [1] - * - * _.dropRight([1, 2, 3], 5); - * // => [] - * - * _.dropRight([1, 2, 3], 0); - * // => [1, 2, 3] - */ -function dropRight(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - n = length - (+n || 0); - return baseSlice(array, 0, n < 0 ? 0 : n); -} - -module.exports = dropRight; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/dropRightWhile.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/dropRightWhile.js deleted file mode 100644 index be158bd5fa94c0..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/dropRightWhile.js +++ /dev/null @@ -1,59 +0,0 @@ -var baseCallback = require('../internal/baseCallback'), - baseWhile = require('../internal/baseWhile'); - -/** - * Creates a slice of `array` excluding elements dropped from the end. - * Elements are dropped until `predicate` returns falsey. The predicate is - * bound to `thisArg` and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that match the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropRightWhile([1, 2, 3], function(n) { - * return n > 1; - * }); - * // => [1] - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.dropRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user'); - * // => ['barney', 'fred'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.dropRightWhile(users, 'active', false), 'user'); - * // => ['barney'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.dropRightWhile(users, 'active'), 'user'); - * // => ['barney', 'fred', 'pebbles'] - */ -function dropRightWhile(array, predicate, thisArg) { - return (array && array.length) - ? baseWhile(array, baseCallback(predicate, thisArg, 3), true, true) - : []; -} - -module.exports = dropRightWhile; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/dropWhile.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/dropWhile.js deleted file mode 100644 index d9eabae9fac8b2..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/dropWhile.js +++ /dev/null @@ -1,59 +0,0 @@ -var baseCallback = require('../internal/baseCallback'), - baseWhile = require('../internal/baseWhile'); - -/** - * Creates a slice of `array` excluding elements dropped from the beginning. - * Elements are dropped until `predicate` returns falsey. The predicate is - * bound to `thisArg` and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropWhile([1, 2, 3], function(n) { - * return n < 3; - * }); - * // => [3] - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.dropWhile(users, { 'user': 'barney', 'active': false }), 'user'); - * // => ['fred', 'pebbles'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.dropWhile(users, 'active', false), 'user'); - * // => ['pebbles'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.dropWhile(users, 'active'), 'user'); - * // => ['barney', 'fred', 'pebbles'] - */ -function dropWhile(array, predicate, thisArg) { - return (array && array.length) - ? baseWhile(array, baseCallback(predicate, thisArg, 3), true) - : []; -} - -module.exports = dropWhile; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/fill.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/fill.js deleted file mode 100644 index 2c8f6da71d0620..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/fill.js +++ /dev/null @@ -1,44 +0,0 @@ -var baseFill = require('../internal/baseFill'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Fills elements of `array` with `value` from `start` up to, but not - * including, `end`. - * - * **Note:** This method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.fill(array, 'a'); - * console.log(array); - * // => ['a', 'a', 'a'] - * - * _.fill(Array(3), 2); - * // => [2, 2, 2] - * - * _.fill([4, 6, 8], '*', 1, 2); - * // => [4, '*', 8] - */ -function fill(array, value, start, end) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { - start = 0; - end = length; - } - return baseFill(array, value, start, end); -} - -module.exports = fill; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/findIndex.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/findIndex.js deleted file mode 100644 index 2a6b8e14bace9e..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/findIndex.js +++ /dev/null @@ -1,53 +0,0 @@ -var createFindIndex = require('../internal/createFindIndex'); - -/** - * This method is like `_.find` except that it returns the index of the first - * element `predicate` returns truthy for instead of the element itself. - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.findIndex(users, function(chr) { - * return chr.user == 'barney'; - * }); - * // => 0 - * - * // using the `_.matches` callback shorthand - * _.findIndex(users, { 'user': 'fred', 'active': false }); - * // => 1 - * - * // using the `_.matchesProperty` callback shorthand - * _.findIndex(users, 'active', false); - * // => 0 - * - * // using the `_.property` callback shorthand - * _.findIndex(users, 'active'); - * // => 2 - */ -var findIndex = createFindIndex(); - -module.exports = findIndex; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/findLastIndex.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/findLastIndex.js deleted file mode 100644 index d6d8eca6df707b..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/findLastIndex.js +++ /dev/null @@ -1,53 +0,0 @@ -var createFindIndex = require('../internal/createFindIndex'); - -/** - * This method is like `_.findIndex` except that it iterates over elements - * of `collection` from right to left. - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.findLastIndex(users, function(chr) { - * return chr.user == 'pebbles'; - * }); - * // => 2 - * - * // using the `_.matches` callback shorthand - * _.findLastIndex(users, { 'user': 'barney', 'active': true }); - * // => 0 - * - * // using the `_.matchesProperty` callback shorthand - * _.findLastIndex(users, 'active', false); - * // => 2 - * - * // using the `_.property` callback shorthand - * _.findLastIndex(users, 'active'); - * // => 0 - */ -var findLastIndex = createFindIndex(true); - -module.exports = findLastIndex; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/first.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/first.js deleted file mode 100644 index b3b9c79c7bba5d..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/first.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Gets the first element of `array`. - * - * @static - * @memberOf _ - * @alias head - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the first element of `array`. - * @example - * - * _.first([1, 2, 3]); - * // => 1 - * - * _.first([]); - * // => undefined - */ -function first(array) { - return array ? array[0] : undefined; -} - -module.exports = first; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/flatten.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/flatten.js deleted file mode 100644 index 65bbeefb775ad8..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/flatten.js +++ /dev/null @@ -1,32 +0,0 @@ -var baseFlatten = require('../internal/baseFlatten'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Flattens a nested array. If `isDeep` is `true` the array is recursively - * flattened, otherwise it is only flattened a single level. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to flatten. - * @param {boolean} [isDeep] Specify a deep flatten. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flatten([1, [2, 3, [4]]]); - * // => [1, 2, 3, [4]] - * - * // using `isDeep` - * _.flatten([1, [2, 3, [4]]], true); - * // => [1, 2, 3, 4] - */ -function flatten(array, isDeep, guard) { - var length = array ? array.length : 0; - if (guard && isIterateeCall(array, isDeep, guard)) { - isDeep = false; - } - return length ? baseFlatten(array, isDeep) : []; -} - -module.exports = flatten; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/flattenDeep.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/flattenDeep.js deleted file mode 100644 index 9f775febe2aeb3..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/flattenDeep.js +++ /dev/null @@ -1,21 +0,0 @@ -var baseFlatten = require('../internal/baseFlatten'); - -/** - * Recursively flattens a nested array. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to recursively flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flattenDeep([1, [2, 3, [4]]]); - * // => [1, 2, 3, 4] - */ -function flattenDeep(array) { - var length = array ? array.length : 0; - return length ? baseFlatten(array, true) : []; -} - -module.exports = flattenDeep; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/head.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/head.js deleted file mode 100644 index 1961b08c7eb538..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/head.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./first'); diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/indexOf.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/indexOf.js deleted file mode 100644 index f8f6c9fc2cdb4f..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/indexOf.js +++ /dev/null @@ -1,54 +0,0 @@ -var baseIndexOf = require('../internal/baseIndexOf'), - binaryIndex = require('../internal/binaryIndex'); - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it is used as the offset - * from the end of `array`. If `array` is sorted providing `true` for `fromIndex` - * performs a faster binary search. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {boolean|number} [fromIndex=0] The index to search from or `true` - * to perform a binary search on a sorted array. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - * - * // performing a binary search - * _.indexOf([1, 1, 2, 2], 2, true); - * // => 2 - */ -function indexOf(array, value, fromIndex) { - var length = array ? array.length : 0; - if (!length) { - return -1; - } - if (typeof fromIndex == 'number') { - fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex; - } else if (fromIndex) { - var index = binaryIndex(array, value), - other = array[index]; - - if (value === value ? (value === other) : (other !== other)) { - return index; - } - return -1; - } - return baseIndexOf(array, value, fromIndex || 0); -} - -module.exports = indexOf; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/initial.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/initial.js deleted file mode 100644 index 59b7a7d96dfbda..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/initial.js +++ /dev/null @@ -1,20 +0,0 @@ -var dropRight = require('./dropRight'); - -/** - * Gets all but the last element of `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.initial([1, 2, 3]); - * // => [1, 2] - */ -function initial(array) { - return dropRight(array, 1); -} - -module.exports = initial; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/intersection.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/intersection.js deleted file mode 100644 index ec5b7f9b6ce4db..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/intersection.js +++ /dev/null @@ -1,58 +0,0 @@ -var baseIndexOf = require('../internal/baseIndexOf'), - cacheIndexOf = require('../internal/cacheIndexOf'), - createCache = require('../internal/createCache'), - isArrayLike = require('../internal/isArrayLike'), - restParam = require('../function/restParam'); - -/** - * Creates an array of unique values that are included in all of the provided - * arrays using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of shared values. - * @example - * _.intersection([1, 2], [4, 2], [2, 1]); - * // => [2] - */ -var intersection = restParam(function(arrays) { - var othLength = arrays.length, - othIndex = othLength, - caches = Array(length), - indexOf = baseIndexOf, - isCommon = true, - result = []; - - while (othIndex--) { - var value = arrays[othIndex] = isArrayLike(value = arrays[othIndex]) ? value : []; - caches[othIndex] = (isCommon && value.length >= 120) ? createCache(othIndex && value) : null; - } - var array = arrays[0], - index = -1, - length = array ? array.length : 0, - seen = caches[0]; - - outer: - while (++index < length) { - value = array[index]; - if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value, 0)) < 0) { - var othIndex = othLength; - while (--othIndex) { - var cache = caches[othIndex]; - if ((cache ? cacheIndexOf(cache, value) : indexOf(arrays[othIndex], value, 0)) < 0) { - continue outer; - } - } - if (seen) { - seen.push(value); - } - result.push(value); - } - } - return result; -}); - -module.exports = intersection; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/last.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/last.js deleted file mode 100644 index 299af3146ca232..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/last.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Gets the last element of `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the last element of `array`. - * @example - * - * _.last([1, 2, 3]); - * // => 3 - */ -function last(array) { - var length = array ? array.length : 0; - return length ? array[length - 1] : undefined; -} - -module.exports = last; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/lastIndexOf.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/lastIndexOf.js deleted file mode 100644 index 02b806269bd21c..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/lastIndexOf.js +++ /dev/null @@ -1,60 +0,0 @@ -var binaryIndex = require('../internal/binaryIndex'), - indexOfNaN = require('../internal/indexOfNaN'); - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max, - nativeMin = Math.min; - -/** - * This method is like `_.indexOf` except that it iterates over elements of - * `array` from right to left. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {boolean|number} [fromIndex=array.length-1] The index to search from - * or `true` to perform a binary search on a sorted array. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.lastIndexOf([1, 2, 1, 2], 2); - * // => 3 - * - * // using `fromIndex` - * _.lastIndexOf([1, 2, 1, 2], 2, 2); - * // => 1 - * - * // performing a binary search - * _.lastIndexOf([1, 1, 2, 2], 2, true); - * // => 3 - */ -function lastIndexOf(array, value, fromIndex) { - var length = array ? array.length : 0; - if (!length) { - return -1; - } - var index = length; - if (typeof fromIndex == 'number') { - index = (fromIndex < 0 ? nativeMax(length + fromIndex, 0) : nativeMin(fromIndex || 0, length - 1)) + 1; - } else if (fromIndex) { - index = binaryIndex(array, value, true) - 1; - var other = array[index]; - if (value === value ? (value === other) : (other !== other)) { - return index; - } - return -1; - } - if (value !== value) { - return indexOfNaN(array, index, true); - } - while (index--) { - if (array[index] === value) { - return index; - } - } - return -1; -} - -module.exports = lastIndexOf; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/pull.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/pull.js deleted file mode 100644 index 746f196f830fe0..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/pull.js +++ /dev/null @@ -1,52 +0,0 @@ -var baseIndexOf = require('../internal/baseIndexOf'); - -/** Used for native method references. */ -var arrayProto = Array.prototype; - -/** Native method references. */ -var splice = arrayProto.splice; - -/** - * Removes all provided values from `array` using - * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. - * - * **Note:** Unlike `_.without`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {...*} [values] The values to remove. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * - * _.pull(array, 2, 3); - * console.log(array); - * // => [1, 1] - */ -function pull() { - var args = arguments, - array = args[0]; - - if (!(array && array.length)) { - return array; - } - var index = 0, - indexOf = baseIndexOf, - length = args.length; - - while (++index < length) { - var fromIndex = 0, - value = args[index]; - - while ((fromIndex = indexOf(array, value, fromIndex)) > -1) { - splice.call(array, fromIndex, 1); - } - } - return array; -} - -module.exports = pull; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/pullAt.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/pullAt.js deleted file mode 100644 index 4ca2476f0e1c78..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/pullAt.js +++ /dev/null @@ -1,40 +0,0 @@ -var baseAt = require('../internal/baseAt'), - baseCompareAscending = require('../internal/baseCompareAscending'), - baseFlatten = require('../internal/baseFlatten'), - basePullAt = require('../internal/basePullAt'), - restParam = require('../function/restParam'); - -/** - * Removes elements from `array` corresponding to the given indexes and returns - * an array of the removed elements. Indexes may be specified as an array of - * indexes or as individual arguments. - * - * **Note:** Unlike `_.at`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {...(number|number[])} [indexes] The indexes of elements to remove, - * specified as individual indexes or arrays of indexes. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = [5, 10, 15, 20]; - * var evens = _.pullAt(array, 1, 3); - * - * console.log(array); - * // => [5, 15] - * - * console.log(evens); - * // => [10, 20] - */ -var pullAt = restParam(function(array, indexes) { - indexes = baseFlatten(indexes); - - var result = baseAt(array, indexes); - basePullAt(array, indexes.sort(baseCompareAscending)); - return result; -}); - -module.exports = pullAt; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/remove.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/remove.js deleted file mode 100644 index 0cf979bda0b241..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/remove.js +++ /dev/null @@ -1,64 +0,0 @@ -var baseCallback = require('../internal/baseCallback'), - basePullAt = require('../internal/basePullAt'); - -/** - * Removes all elements from `array` that `predicate` returns truthy for - * and returns an array of the removed elements. The predicate is bound to - * `thisArg` and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * **Note:** Unlike `_.filter`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = [1, 2, 3, 4]; - * var evens = _.remove(array, function(n) { - * return n % 2 == 0; - * }); - * - * console.log(array); - * // => [1, 3] - * - * console.log(evens); - * // => [2, 4] - */ -function remove(array, predicate, thisArg) { - var result = []; - if (!(array && array.length)) { - return result; - } - var index = -1, - indexes = [], - length = array.length; - - predicate = baseCallback(predicate, thisArg, 3); - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result.push(value); - indexes.push(index); - } - } - basePullAt(array, indexes); - return result; -} - -module.exports = remove; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/rest.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/rest.js deleted file mode 100644 index 9bfb734f1fbe64..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/rest.js +++ /dev/null @@ -1,21 +0,0 @@ -var drop = require('./drop'); - -/** - * Gets all but the first element of `array`. - * - * @static - * @memberOf _ - * @alias tail - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.rest([1, 2, 3]); - * // => [2, 3] - */ -function rest(array) { - return drop(array, 1); -} - -module.exports = rest; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/slice.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/slice.js deleted file mode 100644 index 48ef1a1a280f56..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/slice.js +++ /dev/null @@ -1,30 +0,0 @@ -var baseSlice = require('../internal/baseSlice'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Creates a slice of `array` from `start` up to, but not including, `end`. - * - * **Note:** This method is used instead of `Array#slice` to support node - * lists in IE < 9 and to ensure dense arrays are returned. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ -function slice(array, start, end) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { - start = 0; - end = length; - } - return baseSlice(array, start, end); -} - -module.exports = slice; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/sortedIndex.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/sortedIndex.js deleted file mode 100644 index 51d150e3b3ac9d..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/sortedIndex.js +++ /dev/null @@ -1,53 +0,0 @@ -var createSortedIndex = require('../internal/createSortedIndex'); - -/** - * Uses a binary search to determine the lowest index at which `value` should - * be inserted into `array` in order to maintain its sort order. If an iteratee - * function is provided it is invoked for `value` and each element of `array` - * to compute their sort ranking. The iteratee is bound to `thisArg` and - * invoked with one argument; (value). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - * - * _.sortedIndex([4, 4, 5, 5], 5); - * // => 2 - * - * var dict = { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } }; - * - * // using an iteratee function - * _.sortedIndex(['thirty', 'fifty'], 'forty', function(word) { - * return this.data[word]; - * }, dict); - * // => 1 - * - * // using the `_.property` callback shorthand - * _.sortedIndex([{ 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); - * // => 1 - */ -var sortedIndex = createSortedIndex(); - -module.exports = sortedIndex; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/sortedLastIndex.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/sortedLastIndex.js deleted file mode 100644 index 81a4a8689e8c00..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/sortedLastIndex.js +++ /dev/null @@ -1,25 +0,0 @@ -var createSortedIndex = require('../internal/createSortedIndex'); - -/** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * _.sortedLastIndex([4, 4, 5, 5], 5); - * // => 4 - */ -var sortedLastIndex = createSortedIndex(true); - -module.exports = sortedLastIndex; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/take.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/take.js deleted file mode 100644 index 875917a746650d..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/take.js +++ /dev/null @@ -1,39 +0,0 @@ -var baseSlice = require('../internal/baseSlice'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Creates a slice of `array` with `n` elements taken from the beginning. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.take([1, 2, 3]); - * // => [1] - * - * _.take([1, 2, 3], 2); - * // => [1, 2] - * - * _.take([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.take([1, 2, 3], 0); - * // => [] - */ -function take(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - return baseSlice(array, 0, n < 0 ? 0 : n); -} - -module.exports = take; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/takeRight.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/takeRight.js deleted file mode 100644 index 6e89c874801804..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/takeRight.js +++ /dev/null @@ -1,40 +0,0 @@ -var baseSlice = require('../internal/baseSlice'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Creates a slice of `array` with `n` elements taken from the end. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeRight([1, 2, 3]); - * // => [3] - * - * _.takeRight([1, 2, 3], 2); - * // => [2, 3] - * - * _.takeRight([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.takeRight([1, 2, 3], 0); - * // => [] - */ -function takeRight(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - n = length - (+n || 0); - return baseSlice(array, n < 0 ? 0 : n); -} - -module.exports = takeRight; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/takeRightWhile.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/takeRightWhile.js deleted file mode 100644 index 5464d13b7fa2fb..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/takeRightWhile.js +++ /dev/null @@ -1,59 +0,0 @@ -var baseCallback = require('../internal/baseCallback'), - baseWhile = require('../internal/baseWhile'); - -/** - * Creates a slice of `array` with elements taken from the end. Elements are - * taken until `predicate` returns falsey. The predicate is bound to `thisArg` - * and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeRightWhile([1, 2, 3], function(n) { - * return n > 1; - * }); - * // => [2, 3] - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.takeRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user'); - * // => ['pebbles'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.takeRightWhile(users, 'active', false), 'user'); - * // => ['fred', 'pebbles'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.takeRightWhile(users, 'active'), 'user'); - * // => [] - */ -function takeRightWhile(array, predicate, thisArg) { - return (array && array.length) - ? baseWhile(array, baseCallback(predicate, thisArg, 3), false, true) - : []; -} - -module.exports = takeRightWhile; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/takeWhile.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/takeWhile.js deleted file mode 100644 index f7e28a1d423a8e..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/takeWhile.js +++ /dev/null @@ -1,59 +0,0 @@ -var baseCallback = require('../internal/baseCallback'), - baseWhile = require('../internal/baseWhile'); - -/** - * Creates a slice of `array` with elements taken from the beginning. Elements - * are taken until `predicate` returns falsey. The predicate is bound to - * `thisArg` and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeWhile([1, 2, 3], function(n) { - * return n < 3; - * }); - * // => [1, 2] - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false}, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.takeWhile(users, { 'user': 'barney', 'active': false }), 'user'); - * // => ['barney'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.takeWhile(users, 'active', false), 'user'); - * // => ['barney', 'fred'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.takeWhile(users, 'active'), 'user'); - * // => [] - */ -function takeWhile(array, predicate, thisArg) { - return (array && array.length) - ? baseWhile(array, baseCallback(predicate, thisArg, 3)) - : []; -} - -module.exports = takeWhile; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/union.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/union.js deleted file mode 100644 index 05101ca1c2d046..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/union.js +++ /dev/null @@ -1,24 +0,0 @@ -var baseFlatten = require('../internal/baseFlatten'), - baseUniq = require('../internal/baseUniq'), - restParam = require('../function/restParam'); - -/** - * Creates an array of unique values, in order, from all of the provided arrays - * using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of combined values. - * @example - * - * _.union([1, 2], [4, 2], [2, 1]); - * // => [1, 2, 4] - */ -var union = restParam(function(arrays) { - return baseUniq(baseFlatten(arrays, false, true)); -}); - -module.exports = union; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/uniq.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/uniq.js deleted file mode 100644 index 91ae46e244d99f..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/uniq.js +++ /dev/null @@ -1,71 +0,0 @@ -var baseCallback = require('../internal/baseCallback'), - baseUniq = require('../internal/baseUniq'), - isIterateeCall = require('../internal/isIterateeCall'), - sortedUniq = require('../internal/sortedUniq'); - -/** - * Creates a duplicate-free version of an array, using - * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons, in which only the first occurence of each element - * is kept. Providing `true` for `isSorted` performs a faster search algorithm - * for sorted arrays. If an iteratee function is provided it is invoked for - * each element in the array to generate the criterion by which uniqueness - * is computed. The `iteratee` is bound to `thisArg` and invoked with three - * arguments: (value, index, array). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias unique - * @category Array - * @param {Array} array The array to inspect. - * @param {boolean} [isSorted] Specify the array is sorted. - * @param {Function|Object|string} [iteratee] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new duplicate-value-free array. - * @example - * - * _.uniq([2, 1, 2]); - * // => [2, 1] - * - * // using `isSorted` - * _.uniq([1, 1, 2], true); - * // => [1, 2] - * - * // using an iteratee function - * _.uniq([1, 2.5, 1.5, 2], function(n) { - * return this.floor(n); - * }, Math); - * // => [1, 2.5] - * - * // using the `_.property` callback shorthand - * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ -function uniq(array, isSorted, iteratee, thisArg) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (isSorted != null && typeof isSorted != 'boolean') { - thisArg = iteratee; - iteratee = isIterateeCall(array, isSorted, thisArg) ? null : isSorted; - isSorted = false; - } - iteratee = iteratee == null ? iteratee : baseCallback(iteratee, thisArg, 3); - return (isSorted) - ? sortedUniq(array, iteratee) - : baseUniq(array, iteratee); -} - -module.exports = uniq; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/unique.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/unique.js deleted file mode 100644 index 396de1b80464f8..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/unique.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./uniq'); diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/unzip.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/unzip.js deleted file mode 100644 index 0a539fa631522b..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/unzip.js +++ /dev/null @@ -1,47 +0,0 @@ -var arrayFilter = require('../internal/arrayFilter'), - arrayMap = require('../internal/arrayMap'), - baseProperty = require('../internal/baseProperty'), - isArrayLike = require('../internal/isArrayLike'); - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * This method is like `_.zip` except that it accepts an array of grouped - * elements and creates an array regrouping the elements to their pre-zip - * configuration. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array of grouped elements to process. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]); - * // => [['fred', 30, true], ['barney', 40, false]] - * - * _.unzip(zipped); - * // => [['fred', 'barney'], [30, 40], [true, false]] - */ -function unzip(array) { - if (!(array && array.length)) { - return []; - } - var index = -1, - length = 0; - - array = arrayFilter(array, function(group) { - if (isArrayLike(group)) { - length = nativeMax(group.length, length); - return true; - } - }); - var result = Array(length); - while (++index < length) { - result[index] = arrayMap(array, baseProperty(index)); - } - return result; -} - -module.exports = unzip; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/unzipWith.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/unzipWith.js deleted file mode 100644 index 324a2b1db28578..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/unzipWith.js +++ /dev/null @@ -1,41 +0,0 @@ -var arrayMap = require('../internal/arrayMap'), - arrayReduce = require('../internal/arrayReduce'), - bindCallback = require('../internal/bindCallback'), - unzip = require('./unzip'); - -/** - * This method is like `_.unzip` except that it accepts an iteratee to specify - * how regrouped values should be combined. The `iteratee` is bound to `thisArg` - * and invoked with four arguments: (accumulator, value, index, group). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array of grouped elements to process. - * @param {Function} [iteratee] The function to combine regrouped values. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip([1, 2], [10, 20], [100, 200]); - * // => [[1, 10, 100], [2, 20, 200]] - * - * _.unzipWith(zipped, _.add); - * // => [3, 30, 300] - */ -function unzipWith(array, iteratee, thisArg) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - var result = unzip(array); - if (iteratee == null) { - return result; - } - iteratee = bindCallback(iteratee, thisArg, 4); - return arrayMap(result, function(group) { - return arrayReduce(group, iteratee, undefined, true); - }); -} - -module.exports = unzipWith; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/without.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/without.js deleted file mode 100644 index 19b78491af674f..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/without.js +++ /dev/null @@ -1,27 +0,0 @@ -var baseDifference = require('../internal/baseDifference'), - isArrayLike = require('../internal/isArrayLike'), - restParam = require('../function/restParam'); - -/** - * Creates an array excluding all provided values using - * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to filter. - * @param {...*} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.without([1, 2, 1, 3], 1, 2); - * // => [3] - */ -var without = restParam(function(array, values) { - return isArrayLike(array) - ? baseDifference(array, values) - : []; -}); - -module.exports = without; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/xor.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/xor.js deleted file mode 100644 index 3bdf9df1218365..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/xor.js +++ /dev/null @@ -1,34 +0,0 @@ -var baseDifference = require('../internal/baseDifference'), - baseUniq = require('../internal/baseUniq'), - isArrayLike = require('../internal/isArrayLike'); - -/** - * Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) - * of the provided arrays. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of values. - * @example - * - * _.xor([1, 2], [4, 2]); - * // => [1, 4] - */ -function xor() { - var index = -1, - length = arguments.length; - - while (++index < length) { - var array = arguments[index]; - if (isArrayLike(array)) { - var result = result - ? baseDifference(result, array).concat(baseDifference(array, result)) - : array; - } - } - return result ? baseUniq(result) : []; -} - -module.exports = xor; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/zip.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/zip.js deleted file mode 100644 index 53a6f69912158c..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/zip.js +++ /dev/null @@ -1,21 +0,0 @@ -var restParam = require('../function/restParam'), - unzip = require('./unzip'); - -/** - * Creates an array of grouped elements, the first of which contains the first - * elements of the given arrays, the second of which contains the second elements - * of the given arrays, and so on. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @returns {Array} Returns the new array of grouped elements. - * @example - * - * _.zip(['fred', 'barney'], [30, 40], [true, false]); - * // => [['fred', 30, true], ['barney', 40, false]] - */ -var zip = restParam(unzip); - -module.exports = zip; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/zipObject.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/zipObject.js deleted file mode 100644 index dec7a211b7427f..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/zipObject.js +++ /dev/null @@ -1,43 +0,0 @@ -var isArray = require('../lang/isArray'); - -/** - * The inverse of `_.pairs`; this method returns an object composed from arrays - * of property names and values. Provide either a single two dimensional array, - * e.g. `[[key1, value1], [key2, value2]]` or two arrays, one of property names - * and one of corresponding values. - * - * @static - * @memberOf _ - * @alias object - * @category Array - * @param {Array} props The property names. - * @param {Array} [values=[]] The property values. - * @returns {Object} Returns the new object. - * @example - * - * _.zipObject([['fred', 30], ['barney', 40]]); - * // => { 'fred': 30, 'barney': 40 } - * - * _.zipObject(['fred', 'barney'], [30, 40]); - * // => { 'fred': 30, 'barney': 40 } - */ -function zipObject(props, values) { - var index = -1, - length = props ? props.length : 0, - result = {}; - - if (length && !values && !isArray(props[0])) { - values = []; - } - while (++index < length) { - var key = props[index]; - if (values) { - result[key] = values[index]; - } else if (key) { - result[key[0]] = key[1]; - } - } - return result; -} - -module.exports = zipObject; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/zipWith.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/array/zipWith.js deleted file mode 100644 index ad103742cd1104..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/zipWith.js +++ /dev/null @@ -1,36 +0,0 @@ -var restParam = require('../function/restParam'), - unzipWith = require('./unzipWith'); - -/** - * This method is like `_.zip` except that it accepts an iteratee to specify - * how grouped values should be combined. The `iteratee` is bound to `thisArg` - * and invoked with four arguments: (accumulator, value, index, group). - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @param {Function} [iteratee] The function to combine grouped values. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new array of grouped elements. - * @example - * - * _.zipWith([1, 2], [10, 20], [100, 200], _.add); - * // => [111, 222] - */ -var zipWith = restParam(function(arrays) { - var length = arrays.length, - iteratee = length > 2 ? arrays[length - 2] : undefined, - thisArg = length > 1 ? arrays[length - 1] : undefined; - - if (length > 2 && typeof iteratee == 'function') { - length -= 2; - } else { - iteratee = (length > 1 && typeof thisArg == 'function') ? (--length, thisArg) : undefined; - thisArg = undefined; - } - arrays.length = length; - return unzipWith(arrays, iteratee, thisArg); -}); - -module.exports = zipWith; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain.js deleted file mode 100644 index 7992b733e23602..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain.js +++ /dev/null @@ -1,15 +0,0 @@ -module.exports = { - 'chain': require('./chain/chain'), - 'commit': require('./chain/commit'), - 'lodash': require('./chain/lodash'), - 'plant': require('./chain/plant'), - 'reverse': require('./chain/reverse'), - 'run': require('./chain/run'), - 'tap': require('./chain/tap'), - 'thru': require('./chain/thru'), - 'toJSON': require('./chain/toJSON'), - 'toString': require('./chain/toString'), - 'value': require('./chain/value'), - 'valueOf': require('./chain/valueOf'), - 'wrapperChain': require('./chain/wrapperChain') -}; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/chain.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/chain.js deleted file mode 100644 index 453ba1eb5e88cc..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/chain.js +++ /dev/null @@ -1,35 +0,0 @@ -var lodash = require('./lodash'); - -/** - * Creates a `lodash` object that wraps `value` with explicit method - * chaining enabled. - * - * @static - * @memberOf _ - * @category Chain - * @param {*} value The value to wrap. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'pebbles', 'age': 1 } - * ]; - * - * var youngest = _.chain(users) - * .sortBy('age') - * .map(function(chr) { - * return chr.user + ' is ' + chr.age; - * }) - * .first() - * .value(); - * // => 'pebbles is 1' - */ -function chain(value) { - var result = lodash(value); - result.__chain__ = true; - return result; -} - -module.exports = chain; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/commit.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/commit.js deleted file mode 100644 index c732d1bf9139d0..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/commit.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./wrapperCommit'); diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/lodash.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/lodash.js deleted file mode 100644 index 3241ed89f22cf3..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/lodash.js +++ /dev/null @@ -1,123 +0,0 @@ -var LazyWrapper = require('../internal/LazyWrapper'), - LodashWrapper = require('../internal/LodashWrapper'), - baseLodash = require('../internal/baseLodash'), - isArray = require('../lang/isArray'), - isObjectLike = require('../internal/isObjectLike'), - wrapperClone = require('../internal/wrapperClone'); - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Creates a `lodash` object which wraps `value` to enable implicit chaining. - * Methods that operate on and return arrays, collections, and functions can - * be chained together. Methods that return a boolean or single value will - * automatically end the chain returning the unwrapped value. Explicit chaining - * may be enabled using `_.chain`. The execution of chained methods is lazy, - * that is, execution is deferred until `_#value` is implicitly or explicitly - * called. - * - * Lazy evaluation allows several methods to support shortcut fusion. Shortcut - * fusion is an optimization that merges iteratees to avoid creating intermediate - * arrays and reduce the number of iteratee executions. - * - * Chaining is supported in custom builds as long as the `_#value` method is - * directly or indirectly included in the build. - * - * In addition to lodash methods, wrappers have `Array` and `String` methods. - * - * The wrapper `Array` methods are: - * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, - * `splice`, and `unshift` - * - * The wrapper `String` methods are: - * `replace` and `split` - * - * The wrapper methods that support shortcut fusion are: - * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, - * `first`, `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`, - * `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`, - * and `where` - * - * The chainable wrapper methods are: - * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`, - * `callback`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`, - * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defer`, `delay`, - * `difference`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `fill`, - * `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`, `forEach`, - * `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `functions`, - * `groupBy`, `indexBy`, `initial`, `intersection`, `invert`, `invoke`, `keys`, - * `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, - * `memoize`, `merge`, `method`, `methodOf`, `mixin`, `negate`, `omit`, `once`, - * `pairs`, `partial`, `partialRight`, `partition`, `pick`, `plant`, `pluck`, - * `property`, `propertyOf`, `pull`, `pullAt`, `push`, `range`, `rearg`, - * `reject`, `remove`, `rest`, `restParam`, `reverse`, `set`, `shuffle`, - * `slice`, `sort`, `sortBy`, `sortByAll`, `sortByOrder`, `splice`, `spread`, - * `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`, - * `thru`, `times`, `toArray`, `toPlainObject`, `transform`, `union`, `uniq`, - * `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`, `where`, `without`, - * `wrap`, `xor`, `zip`, `zipObject`, `zipWith` - * - * The wrapper methods that are **not** chainable by default are: - * `add`, `attempt`, `camelCase`, `capitalize`, `clone`, `cloneDeep`, `deburr`, - * `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, - * `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, `get`, - * `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`, `inRange`, `isArguments`, - * `isArray`, `isBoolean`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isError`, - * `isFinite` `isFunction`, `isMatch`, `isNative`, `isNaN`, `isNull`, `isNumber`, - * `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, - * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lt`, `lte`, - * `max`, `min`, `noConflict`, `noop`, `now`, `pad`, `padLeft`, `padRight`, - * `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, - * `runInContext`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, - * `sortedLastIndex`, `startCase`, `startsWith`, `sum`, `template`, `trim`, - * `trimLeft`, `trimRight`, `trunc`, `unescape`, `uniqueId`, `value`, and `words` - * - * The wrapper method `sample` will return a wrapped value when `n` is provided, - * otherwise an unwrapped value is returned. - * - * @name _ - * @constructor - * @category Chain - * @param {*} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var wrapped = _([1, 2, 3]); - * - * // returns an unwrapped value - * wrapped.reduce(function(total, n) { - * return total + n; - * }); - * // => 6 - * - * // returns a wrapped value - * var squares = wrapped.map(function(n) { - * return n * n; - * }); - * - * _.isArray(squares); - * // => false - * - * _.isArray(squares.value()); - * // => true - */ -function lodash(value) { - if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { - if (value instanceof LodashWrapper) { - return value; - } - if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) { - return wrapperClone(value); - } - } - return new LodashWrapper(value); -} - -// Ensure wrappers are instances of `baseLodash`. -lodash.prototype = baseLodash.prototype; - -module.exports = lodash; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/plant.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/plant.js deleted file mode 100644 index 04099f238659d4..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/plant.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./wrapperPlant'); diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/reverse.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/reverse.js deleted file mode 100644 index f72a64a19b95db..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/reverse.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./wrapperReverse'); diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/run.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/run.js deleted file mode 100644 index 5e751a2c32e8af..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/run.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./wrapperValue'); diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/tap.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/tap.js deleted file mode 100644 index 3d0257ecfde69b..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/tap.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This method invokes `interceptor` and returns `value`. The interceptor is - * bound to `thisArg` and invoked with one argument; (value). The purpose of - * this method is to "tap into" a method chain in order to perform operations - * on intermediate results within the chain. - * - * @static - * @memberOf _ - * @category Chain - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @param {*} [thisArg] The `this` binding of `interceptor`. - * @returns {*} Returns `value`. - * @example - * - * _([1, 2, 3]) - * .tap(function(array) { - * array.pop(); - * }) - * .reverse() - * .value(); - * // => [2, 1] - */ -function tap(value, interceptor, thisArg) { - interceptor.call(thisArg, value); - return value; -} - -module.exports = tap; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/thru.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/thru.js deleted file mode 100644 index a7157803769d83..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/thru.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This method is like `_.tap` except that it returns the result of `interceptor`. - * - * @static - * @memberOf _ - * @category Chain - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @param {*} [thisArg] The `this` binding of `interceptor`. - * @returns {*} Returns the result of `interceptor`. - * @example - * - * _(' abc ') - * .chain() - * .trim() - * .thru(function(value) { - * return [value]; - * }) - * .value(); - * // => ['abc'] - */ -function thru(value, interceptor, thisArg) { - return interceptor.call(thisArg, value); -} - -module.exports = thru; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/toString.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/toString.js deleted file mode 100644 index c7bcbf9a543e98..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/toString.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./wrapperToString'); diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperChain.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperChain.js deleted file mode 100644 index 38234819ba04d5..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperChain.js +++ /dev/null @@ -1,32 +0,0 @@ -var chain = require('./chain'); - -/** - * Enables explicit method chaining on the wrapper object. - * - * @name chain - * @memberOf _ - * @category Chain - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // without explicit chaining - * _(users).first(); - * // => { 'user': 'barney', 'age': 36 } - * - * // with explicit chaining - * _(users).chain() - * .first() - * .pick('user') - * .value(); - * // => { 'user': 'barney' } - */ -function wrapperChain() { - return chain(this); -} - -module.exports = wrapperChain; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperCommit.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperCommit.js deleted file mode 100644 index c46a787e97d0e7..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperCommit.js +++ /dev/null @@ -1,32 +0,0 @@ -var LodashWrapper = require('../internal/LodashWrapper'); - -/** - * Executes the chained sequence and returns the wrapped result. - * - * @name commit - * @memberOf _ - * @category Chain - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2]; - * var wrapper = _(array).push(3); - * - * console.log(array); - * // => [1, 2] - * - * wrapper = wrapper.commit(); - * console.log(array); - * // => [1, 2, 3] - * - * wrapper.last(); - * // => 3 - * - * console.log(array); - * // => [1, 2, 3] - */ -function wrapperCommit() { - return new LodashWrapper(this.value(), this.__chain__); -} - -module.exports = wrapperCommit; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperPlant.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperPlant.js deleted file mode 100644 index a3de146b13d740..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperPlant.js +++ /dev/null @@ -1,45 +0,0 @@ -var baseLodash = require('../internal/baseLodash'), - wrapperClone = require('../internal/wrapperClone'); - -/** - * Creates a clone of the chained sequence planting `value` as the wrapped value. - * - * @name plant - * @memberOf _ - * @category Chain - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2]; - * var wrapper = _(array).map(function(value) { - * return Math.pow(value, 2); - * }); - * - * var other = [3, 4]; - * var otherWrapper = wrapper.plant(other); - * - * otherWrapper.value(); - * // => [9, 16] - * - * wrapper.value(); - * // => [1, 4] - */ -function wrapperPlant(value) { - var result, - parent = this; - - while (parent instanceof baseLodash) { - var clone = wrapperClone(parent); - if (result) { - previous.__wrapped__ = clone; - } else { - result = clone; - } - var previous = clone; - parent = parent.__wrapped__; - } - previous.__wrapped__ = value; - return result; -} - -module.exports = wrapperPlant; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperReverse.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperReverse.js deleted file mode 100644 index 4518b3ed286c56..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperReverse.js +++ /dev/null @@ -1,38 +0,0 @@ -var LazyWrapper = require('../internal/LazyWrapper'), - LodashWrapper = require('../internal/LodashWrapper'), - thru = require('./thru'); - -/** - * Reverses the wrapped array so the first element becomes the last, the - * second element becomes the second to last, and so on. - * - * **Note:** This method mutates the wrapped array. - * - * @name reverse - * @memberOf _ - * @category Chain - * @returns {Object} Returns the new reversed `lodash` wrapper instance. - * @example - * - * var array = [1, 2, 3]; - * - * _(array).reverse().value() - * // => [3, 2, 1] - * - * console.log(array); - * // => [3, 2, 1] - */ -function wrapperReverse() { - var value = this.__wrapped__; - if (value instanceof LazyWrapper) { - if (this.__actions__.length) { - value = new LazyWrapper(this); - } - return new LodashWrapper(value.reverse(), this.__chain__); - } - return this.thru(function(value) { - return value.reverse(); - }); -} - -module.exports = wrapperReverse; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperToString.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperToString.js deleted file mode 100644 index db975a5a35427f..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperToString.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Produces the result of coercing the unwrapped value to a string. - * - * @name toString - * @memberOf _ - * @category Chain - * @returns {string} Returns the coerced string value. - * @example - * - * _([1, 2, 3]).toString(); - * // => '1,2,3' - */ -function wrapperToString() { - return (this.value() + ''); -} - -module.exports = wrapperToString; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperValue.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperValue.js deleted file mode 100644 index 2734e41c4a9290..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/chain/wrapperValue.js +++ /dev/null @@ -1,20 +0,0 @@ -var baseWrapperValue = require('../internal/baseWrapperValue'); - -/** - * Executes the chained sequence to extract the unwrapped value. - * - * @name value - * @memberOf _ - * @alias run, toJSON, valueOf - * @category Chain - * @returns {*} Returns the resolved unwrapped value. - * @example - * - * _([1, 2, 3]).value(); - * // => [1, 2, 3] - */ -function wrapperValue() { - return baseWrapperValue(this.__wrapped__, this.__actions__); -} - -module.exports = wrapperValue; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection.js deleted file mode 100644 index 03388571c3145d..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection.js +++ /dev/null @@ -1,44 +0,0 @@ -module.exports = { - 'all': require('./collection/all'), - 'any': require('./collection/any'), - 'at': require('./collection/at'), - 'collect': require('./collection/collect'), - 'contains': require('./collection/contains'), - 'countBy': require('./collection/countBy'), - 'detect': require('./collection/detect'), - 'each': require('./collection/each'), - 'eachRight': require('./collection/eachRight'), - 'every': require('./collection/every'), - 'filter': require('./collection/filter'), - 'find': require('./collection/find'), - 'findLast': require('./collection/findLast'), - 'findWhere': require('./collection/findWhere'), - 'foldl': require('./collection/foldl'), - 'foldr': require('./collection/foldr'), - 'forEach': require('./collection/forEach'), - 'forEachRight': require('./collection/forEachRight'), - 'groupBy': require('./collection/groupBy'), - 'include': require('./collection/include'), - 'includes': require('./collection/includes'), - 'indexBy': require('./collection/indexBy'), - 'inject': require('./collection/inject'), - 'invoke': require('./collection/invoke'), - 'map': require('./collection/map'), - 'max': require('./math/max'), - 'min': require('./math/min'), - 'partition': require('./collection/partition'), - 'pluck': require('./collection/pluck'), - 'reduce': require('./collection/reduce'), - 'reduceRight': require('./collection/reduceRight'), - 'reject': require('./collection/reject'), - 'sample': require('./collection/sample'), - 'select': require('./collection/select'), - 'shuffle': require('./collection/shuffle'), - 'size': require('./collection/size'), - 'some': require('./collection/some'), - 'sortBy': require('./collection/sortBy'), - 'sortByAll': require('./collection/sortByAll'), - 'sortByOrder': require('./collection/sortByOrder'), - 'sum': require('./math/sum'), - 'where': require('./collection/where') -}; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/at.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/at.js deleted file mode 100644 index 29236e577dfb85..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/at.js +++ /dev/null @@ -1,29 +0,0 @@ -var baseAt = require('../internal/baseAt'), - baseFlatten = require('../internal/baseFlatten'), - restParam = require('../function/restParam'); - -/** - * Creates an array of elements corresponding to the given keys, or indexes, - * of `collection`. Keys may be specified as individual arguments or as arrays - * of keys. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {...(number|number[]|string|string[])} [props] The property names - * or indexes of elements to pick, specified individually or in arrays. - * @returns {Array} Returns the new array of picked elements. - * @example - * - * _.at(['a', 'b', 'c'], [0, 2]); - * // => ['a', 'c'] - * - * _.at(['barney', 'fred', 'pebbles'], 0, 2); - * // => ['barney', 'pebbles'] - */ -var at = restParam(function(collection, props) { - return baseAt(collection, baseFlatten(props)); -}); - -module.exports = at; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/collect.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/collect.js deleted file mode 100644 index 0d1e1abfaf9700..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/collect.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./map'); diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/countBy.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/countBy.js deleted file mode 100644 index e97dbb749d1c74..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/countBy.js +++ /dev/null @@ -1,54 +0,0 @@ -var createAggregator = require('../internal/createAggregator'); - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is the number of times the key was returned by `iteratee`. - * The `iteratee` is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.countBy([4.3, 6.1, 6.4], function(n) { - * return Math.floor(n); - * }); - * // => { '4': 1, '6': 2 } - * - * _.countBy([4.3, 6.1, 6.4], function(n) { - * return this.floor(n); - * }, Math); - * // => { '4': 1, '6': 2 } - * - * _.countBy(['one', 'two', 'three'], 'length'); - * // => { '3': 2, '5': 1 } - */ -var countBy = createAggregator(function(result, value, key) { - hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1); -}); - -module.exports = countBy; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/detect.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/detect.js deleted file mode 100644 index 2fb6303efb4984..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/detect.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./find'); diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/every.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/every.js deleted file mode 100644 index a04d3db637783d..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/every.js +++ /dev/null @@ -1,66 +0,0 @@ -var arrayEvery = require('../internal/arrayEvery'), - baseCallback = require('../internal/baseCallback'), - baseEvery = require('../internal/baseEvery'), - isArray = require('../lang/isArray'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Checks if `predicate` returns truthy for **all** elements of `collection`. - * The predicate is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias all - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - * @example - * - * _.every([true, 1, null, 'yes'], Boolean); - * // => false - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.every(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // using the `_.matchesProperty` callback shorthand - * _.every(users, 'active', false); - * // => true - * - * // using the `_.property` callback shorthand - * _.every(users, 'active'); - * // => false - */ -function every(collection, predicate, thisArg) { - var func = isArray(collection) ? arrayEvery : baseEvery; - if (thisArg && isIterateeCall(collection, predicate, thisArg)) { - predicate = null; - } - if (typeof predicate != 'function' || thisArg !== undefined) { - predicate = baseCallback(predicate, thisArg, 3); - } - return func(collection, predicate); -} - -module.exports = every; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/filter.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/filter.js deleted file mode 100644 index 7620aa76195125..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/filter.js +++ /dev/null @@ -1,61 +0,0 @@ -var arrayFilter = require('../internal/arrayFilter'), - baseCallback = require('../internal/baseCallback'), - baseFilter = require('../internal/baseFilter'), - isArray = require('../lang/isArray'); - -/** - * Iterates over elements of `collection`, returning an array of all elements - * `predicate` returns truthy for. The predicate is bound to `thisArg` and - * invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias select - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the new filtered array. - * @example - * - * _.filter([4, 5, 6], function(n) { - * return n % 2 == 0; - * }); - * // => [4, 6] - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user'); - * // => ['barney'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.filter(users, 'active', false), 'user'); - * // => ['fred'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.filter(users, 'active'), 'user'); - * // => ['barney'] - */ -function filter(collection, predicate, thisArg) { - var func = isArray(collection) ? arrayFilter : baseFilter; - predicate = baseCallback(predicate, thisArg, 3); - return func(collection, predicate); -} - -module.exports = filter; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/find.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/find.js deleted file mode 100644 index 7358cfe86cb435..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/find.js +++ /dev/null @@ -1,56 +0,0 @@ -var baseEach = require('../internal/baseEach'), - createFind = require('../internal/createFind'); - -/** - * Iterates over elements of `collection`, returning the first element - * `predicate` returns truthy for. The predicate is bound to `thisArg` and - * invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias detect - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false }, - * { 'user': 'pebbles', 'age': 1, 'active': true } - * ]; - * - * _.result(_.find(users, function(chr) { - * return chr.age < 40; - * }), 'user'); - * // => 'barney' - * - * // using the `_.matches` callback shorthand - * _.result(_.find(users, { 'age': 1, 'active': true }), 'user'); - * // => 'pebbles' - * - * // using the `_.matchesProperty` callback shorthand - * _.result(_.find(users, 'active', false), 'user'); - * // => 'fred' - * - * // using the `_.property` callback shorthand - * _.result(_.find(users, 'active'), 'user'); - * // => 'barney' - */ -var find = createFind(baseEach); - -module.exports = find; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/findLast.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/findLast.js deleted file mode 100644 index 75dbadca2407d0..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/findLast.js +++ /dev/null @@ -1,25 +0,0 @@ -var baseEachRight = require('../internal/baseEachRight'), - createFind = require('../internal/createFind'); - -/** - * This method is like `_.find` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * _.findLast([1, 2, 3, 4], function(n) { - * return n % 2 == 1; - * }); - * // => 3 - */ -var findLast = createFind(baseEachRight, true); - -module.exports = findLast; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/findWhere.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/findWhere.js deleted file mode 100644 index 2d620655ed4307..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/findWhere.js +++ /dev/null @@ -1,37 +0,0 @@ -var baseMatches = require('../internal/baseMatches'), - find = require('./find'); - -/** - * Performs a deep comparison between each element in `collection` and the - * source object, returning the first element that has equivalent property - * values. - * - * **Note:** This method supports comparing arrays, booleans, `Date` objects, - * numbers, `Object` objects, regexes, and strings. Objects are compared by - * their own, not inherited, enumerable properties. For comparing a single - * own or inherited property value see `_.matchesProperty`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Object} source The object of property values to match. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * _.result(_.findWhere(users, { 'age': 36, 'active': true }), 'user'); - * // => 'barney' - * - * _.result(_.findWhere(users, { 'age': 40, 'active': false }), 'user'); - * // => 'fred' - */ -function findWhere(collection, source) { - return find(collection, baseMatches(source)); -} - -module.exports = findWhere; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/foldl.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/foldl.js deleted file mode 100644 index 26f53cf7b26816..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/foldl.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./reduce'); diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/foldr.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/foldr.js deleted file mode 100644 index 8fb199eda60041..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/foldr.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./reduceRight'); diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/forEach.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/forEach.js deleted file mode 100644 index 05a8e2140ebe1f..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/forEach.js +++ /dev/null @@ -1,37 +0,0 @@ -var arrayEach = require('../internal/arrayEach'), - baseEach = require('../internal/baseEach'), - createForEach = require('../internal/createForEach'); - -/** - * Iterates over elements of `collection` invoking `iteratee` for each element. - * The `iteratee` is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early - * by explicitly returning `false`. - * - * **Note:** As with other "Collections" methods, objects with a "length" property - * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn` - * may be used for object iteration. - * - * @static - * @memberOf _ - * @alias each - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array|Object|string} Returns `collection`. - * @example - * - * _([1, 2]).forEach(function(n) { - * console.log(n); - * }).value(); - * // => logs each value from left to right and returns the array - * - * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) { - * console.log(n, key); - * }); - * // => logs each value-key pair and returns the object (iteration order is not guaranteed) - */ -var forEach = createForEach(arrayEach, baseEach); - -module.exports = forEach; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/forEachRight.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/forEachRight.js deleted file mode 100644 index 34997110024056..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/forEachRight.js +++ /dev/null @@ -1,26 +0,0 @@ -var arrayEachRight = require('../internal/arrayEachRight'), - baseEachRight = require('../internal/baseEachRight'), - createForEach = require('../internal/createForEach'); - -/** - * This method is like `_.forEach` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @alias eachRight - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array|Object|string} Returns `collection`. - * @example - * - * _([1, 2]).forEachRight(function(n) { - * console.log(n); - * }).value(); - * // => logs each value from right to left and returns the array - */ -var forEachRight = createForEach(arrayEachRight, baseEachRight); - -module.exports = forEachRight; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/groupBy.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/groupBy.js deleted file mode 100644 index a925c894a0d73b..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/groupBy.js +++ /dev/null @@ -1,59 +0,0 @@ -var createAggregator = require('../internal/createAggregator'); - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is an array of the elements responsible for generating the key. - * The `iteratee` is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.groupBy([4.2, 6.1, 6.4], function(n) { - * return Math.floor(n); - * }); - * // => { '4': [4.2], '6': [6.1, 6.4] } - * - * _.groupBy([4.2, 6.1, 6.4], function(n) { - * return this.floor(n); - * }, Math); - * // => { '4': [4.2], '6': [6.1, 6.4] } - * - * // using the `_.property` callback shorthand - * _.groupBy(['one', 'two', 'three'], 'length'); - * // => { '3': ['one', 'two'], '5': ['three'] } - */ -var groupBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - result[key].push(value); - } else { - result[key] = [value]; - } -}); - -module.exports = groupBy; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/include.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/include.js deleted file mode 100644 index 594722af59a707..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/include.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./includes'); diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/includes.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/includes.js deleted file mode 100644 index 80c90e1e3fd115..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/includes.js +++ /dev/null @@ -1,60 +0,0 @@ -var baseIndexOf = require('../internal/baseIndexOf'), - getLength = require('../internal/getLength'), - isArray = require('../lang/isArray'), - isIterateeCall = require('../internal/isIterateeCall'), - isLength = require('../internal/isLength'), - isString = require('../lang/isString'), - values = require('../object/values'); - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Checks if `value` is in `collection` using - * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it is used as the offset - * from the end of `collection`. - * - * @static - * @memberOf _ - * @alias contains, include - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {*} target The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`. - * @returns {boolean} Returns `true` if a matching element is found, else `false`. - * @example - * - * _.includes([1, 2, 3], 1); - * // => true - * - * _.includes([1, 2, 3], 1, 2); - * // => false - * - * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); - * // => true - * - * _.includes('pebbles', 'eb'); - * // => true - */ -function includes(collection, target, fromIndex, guard) { - var length = collection ? getLength(collection) : 0; - if (!isLength(length)) { - collection = values(collection); - length = collection.length; - } - if (!length) { - return false; - } - if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) { - fromIndex = 0; - } else { - fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0); - } - return (typeof collection == 'string' || !isArray(collection) && isString(collection)) - ? (fromIndex < length && collection.indexOf(target, fromIndex) > -1) - : (baseIndexOf(collection, target, fromIndex) > -1); -} - -module.exports = includes; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/indexBy.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/indexBy.js deleted file mode 100644 index 34a941e7290c72..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/indexBy.js +++ /dev/null @@ -1,53 +0,0 @@ -var createAggregator = require('../internal/createAggregator'); - -/** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is the last element responsible for generating the key. The - * iteratee function is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * var keyData = [ - * { 'dir': 'left', 'code': 97 }, - * { 'dir': 'right', 'code': 100 } - * ]; - * - * _.indexBy(keyData, 'dir'); - * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } - * - * _.indexBy(keyData, function(object) { - * return String.fromCharCode(object.code); - * }); - * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } - * - * _.indexBy(keyData, function(object) { - * return this.fromCharCode(object.code); - * }, String); - * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } - */ -var indexBy = createAggregator(function(result, value, key) { - result[key] = value; -}); - -module.exports = indexBy; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/inject.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/inject.js deleted file mode 100644 index 26f53cf7b26816..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/inject.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./reduce'); diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/invoke.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/invoke.js deleted file mode 100644 index 0a0a84cdbe275d..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/invoke.js +++ /dev/null @@ -1,42 +0,0 @@ -var baseEach = require('../internal/baseEach'), - invokePath = require('../internal/invokePath'), - isArrayLike = require('../internal/isArrayLike'), - isKey = require('../internal/isKey'), - restParam = require('../function/restParam'); - -/** - * Invokes the method at `path` of each element in `collection`, returning - * an array of the results of each invoked method. Any additional arguments - * are provided to each invoked method. If `methodName` is a function it is - * invoked for, and `this` bound to, each element in `collection`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Array|Function|string} path The path of the method to invoke or - * the function invoked per iteration. - * @param {...*} [args] The arguments to invoke the method with. - * @returns {Array} Returns the array of results. - * @example - * - * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); - * // => [[1, 5, 7], [1, 2, 3]] - * - * _.invoke([123, 456], String.prototype.split, ''); - * // => [['1', '2', '3'], ['4', '5', '6']] - */ -var invoke = restParam(function(collection, path, args) { - var index = -1, - isFunc = typeof path == 'function', - isProp = isKey(path), - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value) { - var func = isFunc ? path : ((isProp && value != null) ? value[path] : null); - result[++index] = func ? func.apply(value, args) : invokePath(value, path, args); - }); - return result; -}); - -module.exports = invoke; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/map.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/map.js deleted file mode 100644 index 5381110df1210c..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/map.js +++ /dev/null @@ -1,68 +0,0 @@ -var arrayMap = require('../internal/arrayMap'), - baseCallback = require('../internal/baseCallback'), - baseMap = require('../internal/baseMap'), - isArray = require('../lang/isArray'); - -/** - * Creates an array of values by running each element in `collection` through - * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three - * arguments: (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. - * - * The guarded methods are: - * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`, - * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`, - * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`, - * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`, - * `sum`, `uniq`, and `words` - * - * @static - * @memberOf _ - * @alias collect - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new mapped array. - * @example - * - * function timesThree(n) { - * return n * 3; - * } - * - * _.map([1, 2], timesThree); - * // => [3, 6] - * - * _.map({ 'a': 1, 'b': 2 }, timesThree); - * // => [3, 6] (iteration order is not guaranteed) - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * // using the `_.property` callback shorthand - * _.map(users, 'user'); - * // => ['barney', 'fred'] - */ -function map(collection, iteratee, thisArg) { - var func = isArray(collection) ? arrayMap : baseMap; - iteratee = baseCallback(iteratee, thisArg, 3); - return func(collection, iteratee); -} - -module.exports = map; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/max.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/max.js deleted file mode 100644 index bb1d213c33bd47..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/max.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../math/max'); diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/min.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/min.js deleted file mode 100644 index eef13d02b8a01e..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/min.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../math/min'); diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/partition.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/partition.js deleted file mode 100644 index ee35f27d9301b4..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/partition.js +++ /dev/null @@ -1,66 +0,0 @@ -var createAggregator = require('../internal/createAggregator'); - -/** - * Creates an array of elements split into two groups, the first of which - * contains elements `predicate` returns truthy for, while the second of which - * contains elements `predicate` returns falsey for. The predicate is bound - * to `thisArg` and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the array of grouped elements. - * @example - * - * _.partition([1, 2, 3], function(n) { - * return n % 2; - * }); - * // => [[1, 3], [2]] - * - * _.partition([1.2, 2.3, 3.4], function(n) { - * return this.floor(n) % 2; - * }, Math); - * // => [[1.2, 3.4], [2.3]] - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true }, - * { 'user': 'pebbles', 'age': 1, 'active': false } - * ]; - * - * var mapper = function(array) { - * return _.pluck(array, 'user'); - * }; - * - * // using the `_.matches` callback shorthand - * _.map(_.partition(users, { 'age': 1, 'active': false }), mapper); - * // => [['pebbles'], ['barney', 'fred']] - * - * // using the `_.matchesProperty` callback shorthand - * _.map(_.partition(users, 'active', false), mapper); - * // => [['barney', 'pebbles'], ['fred']] - * - * // using the `_.property` callback shorthand - * _.map(_.partition(users, 'active'), mapper); - * // => [['fred'], ['barney', 'pebbles']] - */ -var partition = createAggregator(function(result, value, key) { - result[key ? 0 : 1].push(value); -}, function() { return [[], []]; }); - -module.exports = partition; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/pluck.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/pluck.js deleted file mode 100644 index 5ee1ec84eec53f..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/pluck.js +++ /dev/null @@ -1,31 +0,0 @@ -var map = require('./map'), - property = require('../utility/property'); - -/** - * Gets the property value of `path` from all elements in `collection`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Array|string} path The path of the property to pluck. - * @returns {Array} Returns the property values. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * _.pluck(users, 'user'); - * // => ['barney', 'fred'] - * - * var userIndex = _.indexBy(users, 'user'); - * _.pluck(userIndex, 'age'); - * // => [36, 40] (iteration order is not guaranteed) - */ -function pluck(collection, path) { - return map(collection, property(path)); -} - -module.exports = pluck; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/reduce.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/reduce.js deleted file mode 100644 index da97655c198e47..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/reduce.js +++ /dev/null @@ -1,43 +0,0 @@ -var arrayReduce = require('../internal/arrayReduce'), - baseEach = require('../internal/baseEach'), - createReduce = require('../internal/createReduce'); - -/** - * Reduces `collection` to a value which is the accumulated result of running - * each element in `collection` through `iteratee`, where each successive - * invocation is supplied the return value of the previous. If `accumulator` - * is not provided the first element of `collection` is used as the initial - * value. The `iteratee` is bound to `thisArg` and invoked with four arguments: - * (accumulator, value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.reduce`, `_.reduceRight`, and `_.transform`. - * - * The guarded methods are: - * `assign`, `defaults`, `includes`, `merge`, `sortByAll`, and `sortByOrder` - * - * @static - * @memberOf _ - * @alias foldl, inject - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {*} Returns the accumulated value. - * @example - * - * _.reduce([1, 2], function(total, n) { - * return total + n; - * }); - * // => 3 - * - * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) { - * result[key] = n * 3; - * return result; - * }, {}); - * // => { 'a': 3, 'b': 6 } (iteration order is not guaranteed) - */ -var reduce = createReduce(arrayReduce, baseEach); - -module.exports = reduce; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/reduceRight.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/reduceRight.js deleted file mode 100644 index 5a5753b9c2185b..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/reduceRight.js +++ /dev/null @@ -1,29 +0,0 @@ -var arrayReduceRight = require('../internal/arrayReduceRight'), - baseEachRight = require('../internal/baseEachRight'), - createReduce = require('../internal/createReduce'); - -/** - * This method is like `_.reduce` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @alias foldr - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {*} Returns the accumulated value. - * @example - * - * var array = [[0, 1], [2, 3], [4, 5]]; - * - * _.reduceRight(array, function(flattened, other) { - * return flattened.concat(other); - * }, []); - * // => [4, 5, 2, 3, 0, 1] - */ -var reduceRight = createReduce(arrayReduceRight, baseEachRight); - -module.exports = reduceRight; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/reject.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/reject.js deleted file mode 100644 index 55924539b524be..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/reject.js +++ /dev/null @@ -1,50 +0,0 @@ -var arrayFilter = require('../internal/arrayFilter'), - baseCallback = require('../internal/baseCallback'), - baseFilter = require('../internal/baseFilter'), - isArray = require('../lang/isArray'); - -/** - * The opposite of `_.filter`; this method returns the elements of `collection` - * that `predicate` does **not** return truthy for. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the new filtered array. - * @example - * - * _.reject([1, 2, 3, 4], function(n) { - * return n % 2 == 0; - * }); - * // => [1, 3] - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.reject(users, { 'age': 40, 'active': true }), 'user'); - * // => ['barney'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.reject(users, 'active', false), 'user'); - * // => ['fred'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.reject(users, 'active'), 'user'); - * // => ['barney'] - */ -function reject(collection, predicate, thisArg) { - var func = isArray(collection) ? arrayFilter : baseFilter; - predicate = baseCallback(predicate, thisArg, 3); - return func(collection, function(value, index, collection) { - return !predicate(value, index, collection); - }); -} - -module.exports = reject; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sample.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sample.js deleted file mode 100644 index 8e0153301620e1..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sample.js +++ /dev/null @@ -1,50 +0,0 @@ -var baseRandom = require('../internal/baseRandom'), - isIterateeCall = require('../internal/isIterateeCall'), - toArray = require('../lang/toArray'), - toIterable = require('../internal/toIterable'); - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMin = Math.min; - -/** - * Gets a random element or `n` random elements from a collection. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to sample. - * @param {number} [n] The number of elements to sample. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {*} Returns the random sample(s). - * @example - * - * _.sample([1, 2, 3, 4]); - * // => 2 - * - * _.sample([1, 2, 3, 4], 2); - * // => [3, 1] - */ -function sample(collection, n, guard) { - if (guard ? isIterateeCall(collection, n, guard) : n == null) { - collection = toIterable(collection); - var length = collection.length; - return length > 0 ? collection[baseRandom(0, length - 1)] : undefined; - } - var index = -1, - result = toArray(collection), - length = result.length, - lastIndex = length - 1; - - n = nativeMin(n < 0 ? 0 : (+n || 0), length); - while (++index < n) { - var rand = baseRandom(index, lastIndex), - value = result[rand]; - - result[rand] = result[index]; - result[index] = value; - } - result.length = n; - return result; -} - -module.exports = sample; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/shuffle.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/shuffle.js deleted file mode 100644 index 949689c5fc714d..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/shuffle.js +++ /dev/null @@ -1,24 +0,0 @@ -var sample = require('./sample'); - -/** Used as references for `-Infinity` and `Infinity`. */ -var POSITIVE_INFINITY = Number.POSITIVE_INFINITY; - -/** - * Creates an array of shuffled values, using a version of the - * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to shuffle. - * @returns {Array} Returns the new shuffled array. - * @example - * - * _.shuffle([1, 2, 3, 4]); - * // => [4, 1, 3, 2] - */ -function shuffle(collection) { - return sample(collection, POSITIVE_INFINITY); -} - -module.exports = shuffle; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/size.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/size.js deleted file mode 100644 index 78dcf4ce9bea5e..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/size.js +++ /dev/null @@ -1,30 +0,0 @@ -var getLength = require('../internal/getLength'), - isLength = require('../internal/isLength'), - keys = require('../object/keys'); - -/** - * Gets the size of `collection` by returning its length for array-like - * values or the number of own enumerable properties for objects. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to inspect. - * @returns {number} Returns the size of `collection`. - * @example - * - * _.size([1, 2, 3]); - * // => 3 - * - * _.size({ 'a': 1, 'b': 2 }); - * // => 2 - * - * _.size('pebbles'); - * // => 7 - */ -function size(collection) { - var length = collection ? getLength(collection) : 0; - return isLength(length) ? length : keys(collection).length; -} - -module.exports = size; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/some.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/some.js deleted file mode 100644 index 2b866b464b6552..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/some.js +++ /dev/null @@ -1,67 +0,0 @@ -var arraySome = require('../internal/arraySome'), - baseCallback = require('../internal/baseCallback'), - baseSome = require('../internal/baseSome'), - isArray = require('../lang/isArray'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Checks if `predicate` returns truthy for **any** element of `collection`. - * The function returns as soon as it finds a passing value and does not iterate - * over the entire collection. The predicate is bound to `thisArg` and invoked - * with three arguments: (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias any - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - * @example - * - * _.some([null, 0, 'yes', false], Boolean); - * // => true - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.some(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // using the `_.matchesProperty` callback shorthand - * _.some(users, 'active', false); - * // => true - * - * // using the `_.property` callback shorthand - * _.some(users, 'active'); - * // => true - */ -function some(collection, predicate, thisArg) { - var func = isArray(collection) ? arraySome : baseSome; - if (thisArg && isIterateeCall(collection, predicate, thisArg)) { - predicate = null; - } - if (typeof predicate != 'function' || thisArg !== undefined) { - predicate = baseCallback(predicate, thisArg, 3); - } - return func(collection, predicate); -} - -module.exports = some; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sortBy.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sortBy.js deleted file mode 100644 index 28d75f56dacce9..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sortBy.js +++ /dev/null @@ -1,71 +0,0 @@ -var baseCallback = require('../internal/baseCallback'), - baseMap = require('../internal/baseMap'), - baseSortBy = require('../internal/baseSortBy'), - compareAscending = require('../internal/compareAscending'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through `iteratee`. This method performs - * a stable sort, that is, it preserves the original sort order of equal elements. - * The `iteratee` is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new sorted array. - * @example - * - * _.sortBy([1, 2, 3], function(n) { - * return Math.sin(n); - * }); - * // => [3, 1, 2] - * - * _.sortBy([1, 2, 3], function(n) { - * return this.sin(n); - * }, Math); - * // => [3, 1, 2] - * - * var users = [ - * { 'user': 'fred' }, - * { 'user': 'pebbles' }, - * { 'user': 'barney' } - * ]; - * - * // using the `_.property` callback shorthand - * _.pluck(_.sortBy(users, 'user'), 'user'); - * // => ['barney', 'fred', 'pebbles'] - */ -function sortBy(collection, iteratee, thisArg) { - if (collection == null) { - return []; - } - if (thisArg && isIterateeCall(collection, iteratee, thisArg)) { - iteratee = null; - } - var index = -1; - iteratee = baseCallback(iteratee, thisArg, 3); - - var result = baseMap(collection, function(value, key, collection) { - return { 'criteria': iteratee(value, key, collection), 'index': ++index, 'value': value }; - }); - return baseSortBy(result, compareAscending); -} - -module.exports = sortBy; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sortByAll.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sortByAll.js deleted file mode 100644 index 4766c209855c97..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sortByAll.js +++ /dev/null @@ -1,52 +0,0 @@ -var baseFlatten = require('../internal/baseFlatten'), - baseSortByOrder = require('../internal/baseSortByOrder'), - isIterateeCall = require('../internal/isIterateeCall'), - restParam = require('../function/restParam'); - -/** - * This method is like `_.sortBy` except that it can sort by multiple iteratees - * or property names. - * - * If a property name is provided for an iteratee the created `_.property` - * style callback returns the property value of the given element. - * - * If an object is provided for an iteratee the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {...(Function|Function[]|Object|Object[]|string|string[])} iteratees - * The iteratees to sort by, specified as individual values or arrays of values. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.map(_.sortByAll(users, ['user', 'age']), _.values); - * // => [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] - * - * _.map(_.sortByAll(users, 'user', function(chr) { - * return Math.floor(chr.age / 10); - * }), _.values); - * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ -var sortByAll = restParam(function(collection, iteratees) { - if (collection == null) { - return []; - } - var guard = iteratees[2]; - if (guard && isIterateeCall(iteratees[0], iteratees[1], guard)) { - iteratees.length = 1; - } - return baseSortByOrder(collection, baseFlatten(iteratees), []); -}); - -module.exports = sortByAll; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sortByOrder.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sortByOrder.js deleted file mode 100644 index c704eeb61f201b..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sortByOrder.js +++ /dev/null @@ -1,55 +0,0 @@ -var baseSortByOrder = require('../internal/baseSortByOrder'), - isArray = require('../lang/isArray'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * This method is like `_.sortByAll` except that it allows specifying the - * sort orders of the iteratees to sort by. A truthy value in `orders` will - * sort the corresponding property name in ascending order while a falsey - * value will sort it in descending order. - * - * If a property name is provided for an iteratee the created `_.property` - * style callback returns the property value of the given element. - * - * If an object is provided for an iteratee the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. - * @param {boolean[]} orders The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.map(_.sortByOrder(users, ['user', 'age'], [true, false]), _.values); - * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ -function sortByOrder(collection, iteratees, orders, guard) { - if (collection == null) { - return []; - } - if (guard && isIterateeCall(iteratees, orders, guard)) { - orders = null; - } - if (!isArray(iteratees)) { - iteratees = iteratees == null ? [] : [iteratees]; - } - if (!isArray(orders)) { - orders = orders == null ? [] : [orders]; - } - return baseSortByOrder(collection, iteratees, orders); -} - -module.exports = sortByOrder; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sum.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sum.js deleted file mode 100644 index a2e93808ae8fee..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/sum.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../math/sum'); diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/where.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/where.js deleted file mode 100644 index f603bf8ce497a6..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/where.js +++ /dev/null @@ -1,37 +0,0 @@ -var baseMatches = require('../internal/baseMatches'), - filter = require('./filter'); - -/** - * Performs a deep comparison between each element in `collection` and the - * source object, returning an array of all elements that have equivalent - * property values. - * - * **Note:** This method supports comparing arrays, booleans, `Date` objects, - * numbers, `Object` objects, regexes, and strings. Objects are compared by - * their own, not inherited, enumerable properties. For comparing a single - * own or inherited property value see `_.matchesProperty`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Object} source The object of property values to match. - * @returns {Array} Returns the new filtered array. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false, 'pets': ['hoppy'] }, - * { 'user': 'fred', 'age': 40, 'active': true, 'pets': ['baby puss', 'dino'] } - * ]; - * - * _.pluck(_.where(users, { 'age': 36, 'active': false }), 'user'); - * // => ['barney'] - * - * _.pluck(_.where(users, { 'pets': ['dino'] }), 'user'); - * // => ['fred'] - */ -function where(collection, source) { - return filter(collection, baseMatches(source)); -} - -module.exports = where; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/date.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/date.js deleted file mode 100644 index 195366e77762af..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/date.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - 'now': require('./date/now') -}; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/date/now.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/date/now.js deleted file mode 100644 index ffe3060e5b9aa3..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/date/now.js +++ /dev/null @@ -1,24 +0,0 @@ -var getNative = require('../internal/getNative'); - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeNow = getNative(Date, 'now'); - -/** - * Gets the number of milliseconds that have elapsed since the Unix epoch - * (1 January 1970 00:00:00 UTC). - * - * @static - * @memberOf _ - * @category Date - * @example - * - * _.defer(function(stamp) { - * console.log(_.now() - stamp); - * }, _.now()); - * // => logs the number of milliseconds it took for the deferred function to be invoked - */ -var now = nativeNow || function() { - return new Date().getTime(); -}; - -module.exports = now; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function.js deleted file mode 100644 index 2cacde1ee59e36..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/function.js +++ /dev/null @@ -1,27 +0,0 @@ -module.exports = { - 'after': require('./function/after'), - 'ary': require('./function/ary'), - 'backflow': require('./function/backflow'), - 'before': require('./function/before'), - 'bind': require('./function/bind'), - 'bindAll': require('./function/bindAll'), - 'bindKey': require('./function/bindKey'), - 'compose': require('./function/compose'), - 'curry': require('./function/curry'), - 'curryRight': require('./function/curryRight'), - 'debounce': require('./function/debounce'), - 'defer': require('./function/defer'), - 'delay': require('./function/delay'), - 'flow': require('./function/flow'), - 'flowRight': require('./function/flowRight'), - 'memoize': require('./function/memoize'), - 'negate': require('./function/negate'), - 'once': require('./function/once'), - 'partial': require('./function/partial'), - 'partialRight': require('./function/partialRight'), - 'rearg': require('./function/rearg'), - 'restParam': require('./function/restParam'), - 'spread': require('./function/spread'), - 'throttle': require('./function/throttle'), - 'wrap': require('./function/wrap') -}; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/after.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/after.js deleted file mode 100644 index e6a5de407a75df..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/after.js +++ /dev/null @@ -1,48 +0,0 @@ -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeIsFinite = global.isFinite; - -/** - * The opposite of `_.before`; this method creates a function that invokes - * `func` once it is called `n` or more times. - * - * @static - * @memberOf _ - * @category Function - * @param {number} n The number of calls before `func` is invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var saves = ['profile', 'settings']; - * - * var done = _.after(saves.length, function() { - * console.log('done saving!'); - * }); - * - * _.forEach(saves, function(type) { - * asyncSave({ 'type': type, 'complete': done }); - * }); - * // => logs 'done saving!' after the two async saves have completed - */ -function after(n, func) { - if (typeof func != 'function') { - if (typeof n == 'function') { - var temp = n; - n = func; - func = temp; - } else { - throw new TypeError(FUNC_ERROR_TEXT); - } - } - n = nativeIsFinite(n = +n) ? n : 0; - return function() { - if (--n < 1) { - return func.apply(this, arguments); - } - }; -} - -module.exports = after; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/ary.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/ary.js deleted file mode 100644 index 1bcb6a720d3904..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/ary.js +++ /dev/null @@ -1,34 +0,0 @@ -var createWrapper = require('../internal/createWrapper'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** Used to compose bitmasks for wrapper metadata. */ -var ARY_FLAG = 128; - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Creates a function that accepts up to `n` arguments ignoring any - * additional arguments. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to cap arguments for. - * @param {number} [n=func.length] The arity cap. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Function} Returns the new function. - * @example - * - * _.map(['6', '8', '10'], _.ary(parseInt, 1)); - * // => [6, 8, 10] - */ -function ary(func, n, guard) { - if (guard && isIterateeCall(func, n, guard)) { - n = null; - } - n = (func && n == null) ? func.length : nativeMax(+n || 0, 0); - return createWrapper(func, ARY_FLAG, null, null, null, null, n); -} - -module.exports = ary; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/backflow.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/backflow.js deleted file mode 100644 index 1954e942397b7f..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/backflow.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./flowRight'); diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/before.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/before.js deleted file mode 100644 index 4afd1e60af1298..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/before.js +++ /dev/null @@ -1,42 +0,0 @@ -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * Creates a function that invokes `func`, with the `this` binding and arguments - * of the created function, while it is called less than `n` times. Subsequent - * calls to the created function return the result of the last `func` invocation. - * - * @static - * @memberOf _ - * @category Function - * @param {number} n The number of calls at which `func` is no longer invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * jQuery('#add').on('click', _.before(5, addContactToList)); - * // => allows adding up to 4 contacts to the list - */ -function before(n, func) { - var result; - if (typeof func != 'function') { - if (typeof n == 'function') { - var temp = n; - n = func; - func = temp; - } else { - throw new TypeError(FUNC_ERROR_TEXT); - } - } - return function() { - if (--n > 0) { - result = func.apply(this, arguments); - } - if (n <= 1) { - func = null; - } - return result; - }; -} - -module.exports = before; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/bind.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/bind.js deleted file mode 100644 index 0de126ae359412..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/bind.js +++ /dev/null @@ -1,56 +0,0 @@ -var createWrapper = require('../internal/createWrapper'), - replaceHolders = require('../internal/replaceHolders'), - restParam = require('./restParam'); - -/** Used to compose bitmasks for wrapper metadata. */ -var BIND_FLAG = 1, - PARTIAL_FLAG = 32; - -/** - * Creates a function that invokes `func` with the `this` binding of `thisArg` - * and prepends any additional `_.bind` arguments to those provided to the - * bound function. - * - * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for partially applied arguments. - * - * **Note:** Unlike native `Function#bind` this method does not set the "length" - * property of bound functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to bind. - * @param {*} thisArg The `this` binding of `func`. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var greet = function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * }; - * - * var object = { 'user': 'fred' }; - * - * var bound = _.bind(greet, object, 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * // using placeholders - * var bound = _.bind(greet, object, _, '!'); - * bound('hi'); - * // => 'hi fred!' - */ -var bind = restParam(function(func, thisArg, partials) { - var bitmask = BIND_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, bind.placeholder); - bitmask |= PARTIAL_FLAG; - } - return createWrapper(func, bitmask, thisArg, partials, holders); -}); - -// Assign default placeholders. -bind.placeholder = {}; - -module.exports = bind; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/bindAll.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/bindAll.js deleted file mode 100644 index a09e948524875c..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/bindAll.js +++ /dev/null @@ -1,50 +0,0 @@ -var baseFlatten = require('../internal/baseFlatten'), - createWrapper = require('../internal/createWrapper'), - functions = require('../object/functions'), - restParam = require('./restParam'); - -/** Used to compose bitmasks for wrapper metadata. */ -var BIND_FLAG = 1; - -/** - * Binds methods of an object to the object itself, overwriting the existing - * method. Method names may be specified as individual arguments or as arrays - * of method names. If no method names are provided all enumerable function - * properties, own and inherited, of `object` are bound. - * - * **Note:** This method does not set the "length" property of bound functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Object} object The object to bind and assign the bound methods to. - * @param {...(string|string[])} [methodNames] The object method names to bind, - * specified as individual method names or arrays of method names. - * @returns {Object} Returns `object`. - * @example - * - * var view = { - * 'label': 'docs', - * 'onClick': function() { - * console.log('clicked ' + this.label); - * } - * }; - * - * _.bindAll(view); - * jQuery('#docs').on('click', view.onClick); - * // => logs 'clicked docs' when the element is clicked - */ -var bindAll = restParam(function(object, methodNames) { - methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object); - - var index = -1, - length = methodNames.length; - - while (++index < length) { - var key = methodNames[index]; - object[key] = createWrapper(object[key], BIND_FLAG, object); - } - return object; -}); - -module.exports = bindAll; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/bindKey.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/bindKey.js deleted file mode 100644 index b787fe702276c6..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/bindKey.js +++ /dev/null @@ -1,66 +0,0 @@ -var createWrapper = require('../internal/createWrapper'), - replaceHolders = require('../internal/replaceHolders'), - restParam = require('./restParam'); - -/** Used to compose bitmasks for wrapper metadata. */ -var BIND_FLAG = 1, - BIND_KEY_FLAG = 2, - PARTIAL_FLAG = 32; - -/** - * Creates a function that invokes the method at `object[key]` and prepends - * any additional `_.bindKey` arguments to those provided to the bound function. - * - * This method differs from `_.bind` by allowing bound functions to reference - * methods that may be redefined or don't yet exist. - * See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) - * for more details. - * - * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * @static - * @memberOf _ - * @category Function - * @param {Object} object The object the method belongs to. - * @param {string} key The key of the method. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var object = { - * 'user': 'fred', - * 'greet': function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * } - * }; - * - * var bound = _.bindKey(object, 'greet', 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * object.greet = function(greeting, punctuation) { - * return greeting + 'ya ' + this.user + punctuation; - * }; - * - * bound('!'); - * // => 'hiya fred!' - * - * // using placeholders - * var bound = _.bindKey(object, 'greet', _, '!'); - * bound('hi'); - * // => 'hiya fred!' - */ -var bindKey = restParam(function(object, key, partials) { - var bitmask = BIND_FLAG | BIND_KEY_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, bindKey.placeholder); - bitmask |= PARTIAL_FLAG; - } - return createWrapper(key, bitmask, object, partials, holders); -}); - -// Assign default placeholders. -bindKey.placeholder = {}; - -module.exports = bindKey; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/curry.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/curry.js deleted file mode 100644 index b7db3fdad8ab6e..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/curry.js +++ /dev/null @@ -1,51 +0,0 @@ -var createCurry = require('../internal/createCurry'); - -/** Used to compose bitmasks for wrapper metadata. */ -var CURRY_FLAG = 8; - -/** - * Creates a function that accepts one or more arguments of `func` that when - * called either invokes `func` returning its result, if all `func` arguments - * have been provided, or returns a function that accepts one or more of the - * remaining `func` arguments, and so on. The arity of `func` may be specified - * if `func.length` is not sufficient. - * - * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for provided arguments. - * - * **Note:** This method does not set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curry(abc); - * - * curried(1)(2)(3); - * // => [1, 2, 3] - * - * curried(1, 2)(3); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // using placeholders - * curried(1)(_, 3)(2); - * // => [1, 2, 3] - */ -var curry = createCurry(CURRY_FLAG); - -// Assign default placeholders. -curry.placeholder = {}; - -module.exports = curry; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/curryRight.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/curryRight.js deleted file mode 100644 index 11c540393b399f..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/curryRight.js +++ /dev/null @@ -1,48 +0,0 @@ -var createCurry = require('../internal/createCurry'); - -/** Used to compose bitmasks for wrapper metadata. */ -var CURRY_RIGHT_FLAG = 16; - -/** - * This method is like `_.curry` except that arguments are applied to `func` - * in the manner of `_.partialRight` instead of `_.partial`. - * - * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for provided arguments. - * - * **Note:** This method does not set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curryRight(abc); - * - * curried(3)(2)(1); - * // => [1, 2, 3] - * - * curried(2, 3)(1); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // using placeholders - * curried(3)(1, _)(2); - * // => [1, 2, 3] - */ -var curryRight = createCurry(CURRY_RIGHT_FLAG); - -// Assign default placeholders. -curryRight.placeholder = {}; - -module.exports = curryRight; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/debounce.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/debounce.js deleted file mode 100644 index 5df81e71a6059f..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/debounce.js +++ /dev/null @@ -1,187 +0,0 @@ -var isObject = require('../lang/isObject'), - now = require('../date/now'); - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Creates a debounced function that delays invoking `func` until after `wait` - * milliseconds have elapsed since the last time the debounced function was - * invoked. The debounced function comes with a `cancel` method to cancel - * delayed invocations. Provide an options object to indicate that `func` - * should be invoked on the leading and/or trailing edge of the `wait` timeout. - * Subsequent calls to the debounced function return the result of the last - * `func` invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked - * on the trailing edge of the timeout only if the the debounced function is - * invoked more than once during the `wait` timeout. - * - * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) - * for details over the differences between `_.debounce` and `_.throttle`. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to debounce. - * @param {number} [wait=0] The number of milliseconds to delay. - * @param {Object} [options] The options object. - * @param {boolean} [options.leading=false] Specify invoking on the leading - * edge of the timeout. - * @param {number} [options.maxWait] The maximum time `func` is allowed to be - * delayed before it is invoked. - * @param {boolean} [options.trailing=true] Specify invoking on the trailing - * edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * // avoid costly calculations while the window size is in flux - * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); - * - * // invoke `sendMail` when the click event is fired, debouncing subsequent calls - * jQuery('#postbox').on('click', _.debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })); - * - * // ensure `batchLog` is invoked once after 1 second of debounced calls - * var source = new EventSource('/stream'); - * jQuery(source).on('message', _.debounce(batchLog, 250, { - * 'maxWait': 1000 - * })); - * - * // cancel a debounced call - * var todoChanges = _.debounce(batchLog, 1000); - * Object.observe(models.todo, todoChanges); - * - * Object.observe(models, function(changes) { - * if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) { - * todoChanges.cancel(); - * } - * }, ['delete']); - * - * // ...at some point `models.todo` is changed - * models.todo.completed = true; - * - * // ...before 1 second has passed `models.todo` is deleted - * // which cancels the debounced `todoChanges` call - * delete models.todo; - */ -function debounce(func, wait, options) { - var args, - maxTimeoutId, - result, - stamp, - thisArg, - timeoutId, - trailingCall, - lastCalled = 0, - maxWait = false, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - wait = wait < 0 ? 0 : (+wait || 0); - if (options === true) { - var leading = true; - trailing = false; - } else if (isObject(options)) { - leading = options.leading; - maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait); - trailing = 'trailing' in options ? options.trailing : trailing; - } - - function cancel() { - if (timeoutId) { - clearTimeout(timeoutId); - } - if (maxTimeoutId) { - clearTimeout(maxTimeoutId); - } - maxTimeoutId = timeoutId = trailingCall = undefined; - } - - function delayed() { - var remaining = wait - (now() - stamp); - if (remaining <= 0 || remaining > wait) { - if (maxTimeoutId) { - clearTimeout(maxTimeoutId); - } - var isCalled = trailingCall; - maxTimeoutId = timeoutId = trailingCall = undefined; - if (isCalled) { - lastCalled = now(); - result = func.apply(thisArg, args); - if (!timeoutId && !maxTimeoutId) { - args = thisArg = null; - } - } - } else { - timeoutId = setTimeout(delayed, remaining); - } - } - - function maxDelayed() { - if (timeoutId) { - clearTimeout(timeoutId); - } - maxTimeoutId = timeoutId = trailingCall = undefined; - if (trailing || (maxWait !== wait)) { - lastCalled = now(); - result = func.apply(thisArg, args); - if (!timeoutId && !maxTimeoutId) { - args = thisArg = null; - } - } - } - - function debounced() { - args = arguments; - stamp = now(); - thisArg = this; - trailingCall = trailing && (timeoutId || !leading); - - if (maxWait === false) { - var leadingCall = leading && !timeoutId; - } else { - if (!maxTimeoutId && !leading) { - lastCalled = stamp; - } - var remaining = maxWait - (stamp - lastCalled), - isCalled = remaining <= 0 || remaining > maxWait; - - if (isCalled) { - if (maxTimeoutId) { - maxTimeoutId = clearTimeout(maxTimeoutId); - } - lastCalled = stamp; - result = func.apply(thisArg, args); - } - else if (!maxTimeoutId) { - maxTimeoutId = setTimeout(maxDelayed, remaining); - } - } - if (isCalled && timeoutId) { - timeoutId = clearTimeout(timeoutId); - } - else if (!timeoutId && wait !== maxWait) { - timeoutId = setTimeout(delayed, wait); - } - if (leadingCall) { - isCalled = true; - result = func.apply(thisArg, args); - } - if (isCalled && !timeoutId && !maxTimeoutId) { - args = thisArg = null; - } - return result; - } - debounced.cancel = cancel; - return debounced; -} - -module.exports = debounce; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/defer.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/defer.js deleted file mode 100644 index 369790ce64fcc6..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/defer.js +++ /dev/null @@ -1,25 +0,0 @@ -var baseDelay = require('../internal/baseDelay'), - restParam = require('./restParam'); - -/** - * Defers invoking the `func` until the current call stack has cleared. Any - * additional arguments are provided to `func` when it is invoked. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to defer. - * @param {...*} [args] The arguments to invoke the function with. - * @returns {number} Returns the timer id. - * @example - * - * _.defer(function(text) { - * console.log(text); - * }, 'deferred'); - * // logs 'deferred' after one or more milliseconds - */ -var defer = restParam(function(func, args) { - return baseDelay(func, 1, args); -}); - -module.exports = defer; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/delay.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/delay.js deleted file mode 100644 index 955b059e7fa2cf..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/delay.js +++ /dev/null @@ -1,26 +0,0 @@ -var baseDelay = require('../internal/baseDelay'), - restParam = require('./restParam'); - -/** - * Invokes `func` after `wait` milliseconds. Any additional arguments are - * provided to `func` when it is invoked. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {...*} [args] The arguments to invoke the function with. - * @returns {number} Returns the timer id. - * @example - * - * _.delay(function(text) { - * console.log(text); - * }, 1000, 'later'); - * // => logs 'later' after one second - */ -var delay = restParam(function(func, wait, args) { - return baseDelay(func, wait, args); -}); - -module.exports = delay; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/flow.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/flow.js deleted file mode 100644 index a435a3d878ff48..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/flow.js +++ /dev/null @@ -1,25 +0,0 @@ -var createFlow = require('../internal/createFlow'); - -/** - * Creates a function that returns the result of invoking the provided - * functions with the `this` binding of the created function, where each - * successive invocation is supplied the return value of the previous. - * - * @static - * @memberOf _ - * @category Function - * @param {...Function} [funcs] Functions to invoke. - * @returns {Function} Returns the new function. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var addSquare = _.flow(_.add, square); - * addSquare(1, 2); - * // => 9 - */ -var flow = createFlow(); - -module.exports = flow; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/flowRight.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/flowRight.js deleted file mode 100644 index 23b9d76b58e8f5..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/flowRight.js +++ /dev/null @@ -1,25 +0,0 @@ -var createFlow = require('../internal/createFlow'); - -/** - * This method is like `_.flow` except that it creates a function that - * invokes the provided functions from right to left. - * - * @static - * @memberOf _ - * @alias backflow, compose - * @category Function - * @param {...Function} [funcs] Functions to invoke. - * @returns {Function} Returns the new function. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var addSquare = _.flowRight(square, _.add); - * addSquare(1, 2); - * // => 9 - */ -var flowRight = createFlow(true); - -module.exports = flowRight; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/memoize.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/memoize.js deleted file mode 100644 index 1088e4be656113..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/memoize.js +++ /dev/null @@ -1,80 +0,0 @@ -var MapCache = require('../internal/MapCache'); - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is coerced to a string and used as the - * cache key. The `func` is invoked with the `this` binding of the memoized - * function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the [`Map`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-properties-of-the-map-prototype-object) - * method interface of `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoizing function. - * @example - * - * var upperCase = _.memoize(function(string) { - * return string.toUpperCase(); - * }); - * - * upperCase('fred'); - * // => 'FRED' - * - * // modifying the result cache - * upperCase.cache.set('fred', 'BARNEY'); - * upperCase('fred'); - * // => 'BARNEY' - * - * // replacing `_.memoize.Cache` - * var object = { 'user': 'fred' }; - * var other = { 'user': 'barney' }; - * var identity = _.memoize(_.identity); - * - * identity(object); - * // => { 'user': 'fred' } - * identity(other); - * // => { 'user': 'fred' } - * - * _.memoize.Cache = WeakMap; - * var identity = _.memoize(_.identity); - * - * identity(object); - * // => { 'user': 'fred' } - * identity(other); - * // => { 'user': 'barney' } - */ -function memoize(func, resolver) { - if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; - - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result); - return result; - }; - memoized.cache = new memoize.Cache; - return memoized; -} - -// Assign cache to `_.memoize`. -memoize.Cache = MapCache; - -module.exports = memoize; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/negate.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/negate.js deleted file mode 100644 index 82479390ad7802..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/negate.js +++ /dev/null @@ -1,32 +0,0 @@ -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * Creates a function that negates the result of the predicate `func`. The - * `func` predicate is invoked with the `this` binding and arguments of the - * created function. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} predicate The predicate to negate. - * @returns {Function} Returns the new function. - * @example - * - * function isEven(n) { - * return n % 2 == 0; - * } - * - * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); - * // => [1, 3, 5] - */ -function negate(predicate) { - if (typeof predicate != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function() { - return !predicate.apply(this, arguments); - }; -} - -module.exports = negate; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/once.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/once.js deleted file mode 100644 index 0b5bd853cb492b..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/once.js +++ /dev/null @@ -1,24 +0,0 @@ -var before = require('./before'); - -/** - * Creates a function that is restricted to invoking `func` once. Repeat calls - * to the function return the value of the first call. The `func` is invoked - * with the `this` binding and arguments of the created function. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var initialize = _.once(createApplication); - * initialize(); - * initialize(); - * // `initialize` invokes `createApplication` once - */ -function once(func) { - return before(2, func); -} - -module.exports = once; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/partial.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/partial.js deleted file mode 100644 index fb1d04fb6c5928..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/partial.js +++ /dev/null @@ -1,43 +0,0 @@ -var createPartial = require('../internal/createPartial'); - -/** Used to compose bitmasks for wrapper metadata. */ -var PARTIAL_FLAG = 32; - -/** - * Creates a function that invokes `func` with `partial` arguments prepended - * to those provided to the new function. This method is like `_.bind` except - * it does **not** alter the `this` binding. - * - * The `_.partial.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method does not set the "length" property of partially - * applied functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * var greet = function(greeting, name) { - * return greeting + ' ' + name; - * }; - * - * var sayHelloTo = _.partial(greet, 'hello'); - * sayHelloTo('fred'); - * // => 'hello fred' - * - * // using placeholders - * var greetFred = _.partial(greet, _, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - */ -var partial = createPartial(PARTIAL_FLAG); - -// Assign default placeholders. -partial.placeholder = {}; - -module.exports = partial; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/partialRight.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/partialRight.js deleted file mode 100644 index 634e6a4c40cffa..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/partialRight.js +++ /dev/null @@ -1,42 +0,0 @@ -var createPartial = require('../internal/createPartial'); - -/** Used to compose bitmasks for wrapper metadata. */ -var PARTIAL_RIGHT_FLAG = 64; - -/** - * This method is like `_.partial` except that partially applied arguments - * are appended to those provided to the new function. - * - * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method does not set the "length" property of partially - * applied functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * var greet = function(greeting, name) { - * return greeting + ' ' + name; - * }; - * - * var greetFred = _.partialRight(greet, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - * - * // using placeholders - * var sayHelloTo = _.partialRight(greet, 'hello', _); - * sayHelloTo('fred'); - * // => 'hello fred' - */ -var partialRight = createPartial(PARTIAL_RIGHT_FLAG); - -// Assign default placeholders. -partialRight.placeholder = {}; - -module.exports = partialRight; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/rearg.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/rearg.js deleted file mode 100644 index 0a4bf8fa6d65ed..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/rearg.js +++ /dev/null @@ -1,40 +0,0 @@ -var baseFlatten = require('../internal/baseFlatten'), - createWrapper = require('../internal/createWrapper'), - restParam = require('./restParam'); - -/** Used to compose bitmasks for wrapper metadata. */ -var REARG_FLAG = 256; - -/** - * Creates a function that invokes `func` with arguments arranged according - * to the specified indexes where the argument value at the first index is - * provided as the first argument, the argument value at the second index is - * provided as the second argument, and so on. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to rearrange arguments for. - * @param {...(number|number[])} indexes The arranged argument indexes, - * specified as individual indexes or arrays of indexes. - * @returns {Function} Returns the new function. - * @example - * - * var rearged = _.rearg(function(a, b, c) { - * return [a, b, c]; - * }, 2, 0, 1); - * - * rearged('b', 'c', 'a') - * // => ['a', 'b', 'c'] - * - * var map = _.rearg(_.map, [1, 0]); - * map(function(n) { - * return n * 3; - * }, [1, 2, 3]); - * // => [3, 6, 9] - */ -var rearg = restParam(function(func, indexes) { - return createWrapper(func, REARG_FLAG, null, null, null, baseFlatten(indexes)); -}); - -module.exports = rearg; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/restParam.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/restParam.js deleted file mode 100644 index 3a1c15707c748a..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/restParam.js +++ /dev/null @@ -1,58 +0,0 @@ -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as an array. - * - * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters). - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.restParam(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); - * }); - * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' - */ -function restParam(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - rest = Array(length); - - while (++index < length) { - rest[index] = args[start + index]; - } - switch (start) { - case 0: return func.call(this, rest); - case 1: return func.call(this, args[0], rest); - case 2: return func.call(this, args[0], args[1], rest); - } - var otherArgs = Array(start + 1); - index = -1; - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = rest; - return func.apply(this, otherArgs); - }; -} - -module.exports = restParam; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/spread.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/spread.js deleted file mode 100644 index aad4b7147f2350..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/spread.js +++ /dev/null @@ -1,44 +0,0 @@ -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * Creates a function that invokes `func` with the `this` binding of the created - * function and an array of arguments much like [`Function#apply`](https://es5.github.io/#x15.3.4.3). - * - * **Note:** This method is based on the [spread operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator). - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to spread arguments over. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.spread(function(who, what) { - * return who + ' says ' + what; - * }); - * - * say(['fred', 'hello']); - * // => 'fred says hello' - * - * // with a Promise - * var numbers = Promise.all([ - * Promise.resolve(40), - * Promise.resolve(36) - * ]); - * - * numbers.then(_.spread(function(x, y) { - * return x + y; - * })); - * // => a Promise of 76 - */ -function spread(func) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function(array) { - return func.apply(this, array); - }; -} - -module.exports = spread; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/throttle.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/throttle.js deleted file mode 100644 index 5e8f0ef5611145..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/throttle.js +++ /dev/null @@ -1,72 +0,0 @@ -var debounce = require('./debounce'), - isObject = require('../lang/isObject'); - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** Used as an internal `_.debounce` options object by `_.throttle`. */ -var debounceOptions = { - 'leading': false, - 'maxWait': 0, - 'trailing': false -}; - -/** - * Creates a throttled function that only invokes `func` at most once per - * every `wait` milliseconds. The throttled function comes with a `cancel` - * method to cancel delayed invocations. Provide an options object to indicate - * that `func` should be invoked on the leading and/or trailing edge of the - * `wait` timeout. Subsequent calls to the throttled function return the - * result of the last `func` call. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked - * on the trailing edge of the timeout only if the the throttled function is - * invoked more than once during the `wait` timeout. - * - * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) - * for details over the differences between `_.throttle` and `_.debounce`. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to throttle. - * @param {number} [wait=0] The number of milliseconds to throttle invocations to. - * @param {Object} [options] The options object. - * @param {boolean} [options.leading=true] Specify invoking on the leading - * edge of the timeout. - * @param {boolean} [options.trailing=true] Specify invoking on the trailing - * edge of the timeout. - * @returns {Function} Returns the new throttled function. - * @example - * - * // avoid excessively updating the position while scrolling - * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); - * - * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes - * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, { - * 'trailing': false - * })); - * - * // cancel a trailing throttled call - * jQuery(window).on('popstate', throttled.cancel); - */ -function throttle(func, wait, options) { - var leading = true, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (options === false) { - leading = false; - } else if (isObject(options)) { - leading = 'leading' in options ? !!options.leading : leading; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - debounceOptions.leading = leading; - debounceOptions.maxWait = +wait; - debounceOptions.trailing = trailing; - return debounce(func, wait, debounceOptions); -} - -module.exports = throttle; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/wrap.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/function/wrap.js deleted file mode 100644 index 68b09af23862a4..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/wrap.js +++ /dev/null @@ -1,33 +0,0 @@ -var createWrapper = require('../internal/createWrapper'), - identity = require('../utility/identity'); - -/** Used to compose bitmasks for wrapper metadata. */ -var PARTIAL_FLAG = 32; - -/** - * Creates a function that provides `value` to the wrapper function as its - * first argument. Any additional arguments provided to the function are - * appended to those provided to the wrapper function. The wrapper is invoked - * with the `this` binding of the created function. - * - * @static - * @memberOf _ - * @category Function - * @param {*} value The value to wrap. - * @param {Function} wrapper The wrapper function. - * @returns {Function} Returns the new function. - * @example - * - * var p = _.wrap(_.escape, function(func, text) { - * return '

      ' + func(text) + '

      '; - * }); - * - * p('fred, barney, & pebbles'); - * // => '

      fred, barney, & pebbles

      ' - */ -function wrap(value, wrapper) { - wrapper = wrapper == null ? identity : wrapper; - return createWrapper(wrapper, PARTIAL_FLAG, null, [value], []); -} - -module.exports = wrap; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/index.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/index.js deleted file mode 100644 index deb66539d440b9..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/index.js +++ /dev/null @@ -1,12235 +0,0 @@ -/** - * @license - * lodash 3.9.3 (Custom Build) - * Build: `lodash modern -d -o ./index.js` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -;(function() { - - /** Used as a safe reference for `undefined` in pre-ES5 environments. */ - var undefined; - - /** Used as the semantic version number. */ - var VERSION = '3.9.3'; - - /** Used to compose bitmasks for wrapper metadata. */ - var BIND_FLAG = 1, - BIND_KEY_FLAG = 2, - CURRY_BOUND_FLAG = 4, - CURRY_FLAG = 8, - CURRY_RIGHT_FLAG = 16, - PARTIAL_FLAG = 32, - PARTIAL_RIGHT_FLAG = 64, - ARY_FLAG = 128, - REARG_FLAG = 256; - - /** Used as default options for `_.trunc`. */ - var DEFAULT_TRUNC_LENGTH = 30, - DEFAULT_TRUNC_OMISSION = '...'; - - /** Used to detect when a function becomes hot. */ - var HOT_COUNT = 150, - HOT_SPAN = 16; - - /** Used to indicate the type of lazy iteratees. */ - var LAZY_DROP_WHILE_FLAG = 0, - LAZY_FILTER_FLAG = 1, - LAZY_MAP_FLAG = 2; - - /** Used as the `TypeError` message for "Functions" methods. */ - var FUNC_ERROR_TEXT = 'Expected a function'; - - /** Used as the internal argument placeholder. */ - var PLACEHOLDER = '__lodash_placeholder__'; - - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - weakMapTag = '[object WeakMap]'; - - var arrayBufferTag = '[object ArrayBuffer]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - - /** Used to match empty string literals in compiled template source. */ - var reEmptyStringLeading = /\b__p \+= '';/g, - reEmptyStringMiddle = /\b(__p \+=) '' \+/g, - reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; - - /** Used to match HTML entities and HTML characters. */ - var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g, - reUnescapedHtml = /[&<>"'`]/g, - reHasEscapedHtml = RegExp(reEscapedHtml.source), - reHasUnescapedHtml = RegExp(reUnescapedHtml.source); - - /** Used to match template delimiters. */ - var reEscape = /<%-([\s\S]+?)%>/g, - reEvaluate = /<%([\s\S]+?)%>/g, - reInterpolate = /<%=([\s\S]+?)%>/g; - - /** Used to match property names within property paths. */ - var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g; - - /** - * Used to match `RegExp` [special characters](http://www.regular-expressions.info/characters.html#special). - * In addition to special characters the forward slash is escaped to allow for - * easier `eval` use and `Function` compilation. - */ - var reRegExpChars = /[.*+?^${}()|[\]\/\\]/g, - reHasRegExpChars = RegExp(reRegExpChars.source); - - /** Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). */ - var reComboMark = /[\u0300-\u036f\ufe20-\ufe23]/g; - - /** Used to match backslashes in property paths. */ - var reEscapeChar = /\\(\\)?/g; - - /** Used to match [ES template delimiters](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-template-literal-lexical-components). */ - var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; - - /** Used to match `RegExp` flags from their coerced string values. */ - var reFlags = /\w*$/; - - /** Used to detect hexadecimal string values. */ - var reHasHexPrefix = /^0[xX]/; - - /** Used to detect host constructors (Safari > 5). */ - var reIsHostCtor = /^\[object .+?Constructor\]$/; - - /** Used to detect unsigned integer values. */ - var reIsUint = /^\d+$/; - - /** Used to match latin-1 supplementary letters (excluding mathematical operators). */ - var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g; - - /** Used to ensure capturing order of template delimiters. */ - var reNoMatch = /($^)/; - - /** Used to match unescaped characters in compiled string literals. */ - var reUnescapedString = /['\n\r\u2028\u2029\\]/g; - - /** Used to match words to create compound words. */ - var reWords = (function() { - var upper = '[A-Z\\xc0-\\xd6\\xd8-\\xde]', - lower = '[a-z\\xdf-\\xf6\\xf8-\\xff]+'; - - return RegExp(upper + '+(?=' + upper + lower + ')|' + upper + '?' + lower + '|' + upper + '+|[0-9]+', 'g'); - }()); - - /** Used to detect and test for whitespace. */ - var whitespace = ( - // Basic whitespace characters. - ' \t\x0b\f\xa0\ufeff' + - - // Line terminators. - '\n\r\u2028\u2029' + - - // Unicode category "Zs" space separators. - '\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000' - ); - - /** Used to assign default `context` object properties. */ - var contextProps = [ - 'Array', 'ArrayBuffer', 'Date', 'Error', 'Float32Array', 'Float64Array', - 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Math', 'Number', - 'Object', 'RegExp', 'Set', 'String', '_', 'clearTimeout', 'document', - 'isFinite', 'parseFloat', 'parseInt', 'setTimeout', 'TypeError', 'Uint8Array', - 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', 'window' - ]; - - /** Used to make template sourceURLs easier to identify. */ - var templateCounter = -1; - - /** Used to identify `toStringTag` values of typed arrays. */ - var typedArrayTags = {}; - typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = - typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = - typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = - typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = - typedArrayTags[uint32Tag] = true; - typedArrayTags[argsTag] = typedArrayTags[arrayTag] = - typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = - typedArrayTags[dateTag] = typedArrayTags[errorTag] = - typedArrayTags[funcTag] = typedArrayTags[mapTag] = - typedArrayTags[numberTag] = typedArrayTags[objectTag] = - typedArrayTags[regexpTag] = typedArrayTags[setTag] = - typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; - - /** Used to identify `toStringTag` values supported by `_.clone`. */ - var cloneableTags = {}; - cloneableTags[argsTag] = cloneableTags[arrayTag] = - cloneableTags[arrayBufferTag] = cloneableTags[boolTag] = - cloneableTags[dateTag] = cloneableTags[float32Tag] = - cloneableTags[float64Tag] = cloneableTags[int8Tag] = - cloneableTags[int16Tag] = cloneableTags[int32Tag] = - cloneableTags[numberTag] = cloneableTags[objectTag] = - cloneableTags[regexpTag] = cloneableTags[stringTag] = - cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = - cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; - cloneableTags[errorTag] = cloneableTags[funcTag] = - cloneableTags[mapTag] = cloneableTags[setTag] = - cloneableTags[weakMapTag] = false; - - /** Used as an internal `_.debounce` options object by `_.throttle`. */ - var debounceOptions = { - 'leading': false, - 'maxWait': 0, - 'trailing': false - }; - - /** Used to map latin-1 supplementary letters to basic latin letters. */ - var deburredLetters = { - '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', - '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', - '\xc7': 'C', '\xe7': 'c', - '\xd0': 'D', '\xf0': 'd', - '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', - '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', - '\xcC': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', - '\xeC': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', - '\xd1': 'N', '\xf1': 'n', - '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', - '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', - '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', - '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', - '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', - '\xc6': 'Ae', '\xe6': 'ae', - '\xde': 'Th', '\xfe': 'th', - '\xdf': 'ss' - }; - - /** Used to map characters to HTML entities. */ - var htmlEscapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' - }; - - /** Used to map HTML entities to characters. */ - var htmlUnescapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - ''': "'", - '`': '`' - }; - - /** Used to determine if values are of the language type `Object`. */ - var objectTypes = { - 'function': true, - 'object': true - }; - - /** Used to escape characters for inclusion in compiled string literals. */ - var stringEscapes = { - '\\': '\\', - "'": "'", - '\n': 'n', - '\r': 'r', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - /** Detect free variable `exports`. */ - var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports; - - /** Detect free variable `module`. */ - var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; - - /** Detect free variable `global` from Node.js. */ - var freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global; - - /** Detect free variable `self`. */ - var freeSelf = objectTypes[typeof self] && self && self.Object && self; - - /** Detect free variable `window`. */ - var freeWindow = objectTypes[typeof window] && window && window.Object && window; - - /** Detect the popular CommonJS extension `module.exports`. */ - var moduleExports = freeModule && freeModule.exports === freeExports && freeExports; - - /** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ - var root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this; - - /*--------------------------------------------------------------------------*/ - - /** - * The base implementation of `compareAscending` which compares values and - * sorts them in ascending order without guaranteeing a stable sort. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {number} Returns the sort order indicator for `value`. - */ - function baseCompareAscending(value, other) { - if (value !== other) { - var valIsNull = value === null, - valIsUndef = value === undefined, - valIsReflexive = value === value; - - var othIsNull = other === null, - othIsUndef = other === undefined, - othIsReflexive = other === other; - - if ((value > other && !othIsNull) || !valIsReflexive || - (valIsNull && !othIsUndef && othIsReflexive) || - (valIsUndef && othIsReflexive)) { - return 1; - } - if ((value < other && !valIsNull) || !othIsReflexive || - (othIsNull && !valIsUndef && valIsReflexive) || - (othIsUndef && valIsReflexive)) { - return -1; - } - } - return 0; - } - - /** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for callback shorthands and `this` binding. - * - * @private - * @param {Array} array The array to search. - * @param {Function} predicate The function invoked per iteration. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseFindIndex(array, predicate, fromRight) { - var length = array.length, - index = fromRight ? length : -1; - - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; - } - } - return -1; - } - - /** - * The base implementation of `_.indexOf` without support for binary searches. - * - * @private - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseIndexOf(array, value, fromIndex) { - if (value !== value) { - return indexOfNaN(array, fromIndex); - } - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; - } - - /** - * The base implementation of `_.isFunction` without support for environments - * with incorrect `typeof` results. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - */ - function baseIsFunction(value) { - // Avoid a Chakra JIT bug in compatibility modes of IE 11. - // See https://github.com/jashkenas/underscore/issues/1621 for more details. - return typeof value == 'function' || false; - } - - /** - * Converts `value` to a string if it's not one. An empty string is returned - * for `null` or `undefined` values. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ - function baseToString(value) { - if (typeof value == 'string') { - return value; - } - return value == null ? '' : (value + ''); - } - - /** - * Used by `_.trim` and `_.trimLeft` to get the index of the first character - * of `string` that is not found in `chars`. - * - * @private - * @param {string} string The string to inspect. - * @param {string} chars The characters to find. - * @returns {number} Returns the index of the first character not found in `chars`. - */ - function charsLeftIndex(string, chars) { - var index = -1, - length = string.length; - - while (++index < length && chars.indexOf(string.charAt(index)) > -1) {} - return index; - } - - /** - * Used by `_.trim` and `_.trimRight` to get the index of the last character - * of `string` that is not found in `chars`. - * - * @private - * @param {string} string The string to inspect. - * @param {string} chars The characters to find. - * @returns {number} Returns the index of the last character not found in `chars`. - */ - function charsRightIndex(string, chars) { - var index = string.length; - - while (index-- && chars.indexOf(string.charAt(index)) > -1) {} - return index; - } - - /** - * Used by `_.sortBy` to compare transformed elements of a collection and stable - * sort them in ascending order. - * - * @private - * @param {Object} object The object to compare to `other`. - * @param {Object} other The object to compare to `object`. - * @returns {number} Returns the sort order indicator for `object`. - */ - function compareAscending(object, other) { - return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index); - } - - /** - * Used by `_.sortByOrder` to compare multiple properties of each element - * in a collection and stable sort them in the following order: - * - * If `orders` is unspecified, sort in ascending order for all properties. - * Otherwise, for each property, sort in ascending order if its corresponding value in - * orders is true, and descending order if false. - * - * @private - * @param {Object} object The object to compare to `other`. - * @param {Object} other The object to compare to `object`. - * @param {boolean[]} orders The order to sort by for each property. - * @returns {number} Returns the sort order indicator for `object`. - */ - function compareMultiple(object, other, orders) { - var index = -1, - objCriteria = object.criteria, - othCriteria = other.criteria, - length = objCriteria.length, - ordersLength = orders.length; - - while (++index < length) { - var result = baseCompareAscending(objCriteria[index], othCriteria[index]); - if (result) { - if (index >= ordersLength) { - return result; - } - return result * (orders[index] ? 1 : -1); - } - } - // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications - // that causes it, under certain circumstances, to provide the same value for - // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 - // for more details. - // - // This also ensures a stable sort in V8 and other engines. - // See https://code.google.com/p/v8/issues/detail?id=90 for more details. - return object.index - other.index; - } - - /** - * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters. - * - * @private - * @param {string} letter The matched letter to deburr. - * @returns {string} Returns the deburred letter. - */ - function deburrLetter(letter) { - return deburredLetters[letter]; - } - - /** - * Used by `_.escape` to convert characters to HTML entities. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - function escapeHtmlChar(chr) { - return htmlEscapes[chr]; - } - - /** - * Used by `_.template` to escape characters for inclusion in compiled - * string literals. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - function escapeStringChar(chr) { - return '\\' + stringEscapes[chr]; - } - - /** - * Gets the index at which the first occurrence of `NaN` is found in `array`. - * - * @private - * @param {Array} array The array to search. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched `NaN`, else `-1`. - */ - function indexOfNaN(array, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 0 : -1); - - while ((fromRight ? index-- : ++index < length)) { - var other = array[index]; - if (other !== other) { - return index; - } - } - return -1; - } - - /** - * Checks if `value` is object-like. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - */ - function isObjectLike(value) { - return !!value && typeof value == 'object'; - } - - /** - * Used by `trimmedLeftIndex` and `trimmedRightIndex` to determine if a - * character code is whitespace. - * - * @private - * @param {number} charCode The character code to inspect. - * @returns {boolean} Returns `true` if `charCode` is whitespace, else `false`. - */ - function isSpace(charCode) { - return ((charCode <= 160 && (charCode >= 9 && charCode <= 13) || charCode == 32 || charCode == 160) || charCode == 5760 || charCode == 6158 || - (charCode >= 8192 && (charCode <= 8202 || charCode == 8232 || charCode == 8233 || charCode == 8239 || charCode == 8287 || charCode == 12288 || charCode == 65279))); - } - - /** - * Replaces all `placeholder` elements in `array` with an internal placeholder - * and returns an array of their indexes. - * - * @private - * @param {Array} array The array to modify. - * @param {*} placeholder The placeholder to replace. - * @returns {Array} Returns the new array of placeholder indexes. - */ - function replaceHolders(array, placeholder) { - var index = -1, - length = array.length, - resIndex = -1, - result = []; - - while (++index < length) { - if (array[index] === placeholder) { - array[index] = PLACEHOLDER; - result[++resIndex] = index; - } - } - return result; - } - - /** - * An implementation of `_.uniq` optimized for sorted arrays without support - * for callback shorthands and `this` binding. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The function invoked per iteration. - * @returns {Array} Returns the new duplicate-value-free array. - */ - function sortedUniq(array, iteratee) { - var seen, - index = -1, - length = array.length, - resIndex = -1, - result = []; - - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value, index, array) : value; - - if (!index || seen !== computed) { - seen = computed; - result[++resIndex] = value; - } - } - return result; - } - - /** - * Used by `_.trim` and `_.trimLeft` to get the index of the first non-whitespace - * character of `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the index of the first non-whitespace character. - */ - function trimmedLeftIndex(string) { - var index = -1, - length = string.length; - - while (++index < length && isSpace(string.charCodeAt(index))) {} - return index; - } - - /** - * Used by `_.trim` and `_.trimRight` to get the index of the last non-whitespace - * character of `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the index of the last non-whitespace character. - */ - function trimmedRightIndex(string) { - var index = string.length; - - while (index-- && isSpace(string.charCodeAt(index))) {} - return index; - } - - /** - * Used by `_.unescape` to convert HTML entities to characters. - * - * @private - * @param {string} chr The matched character to unescape. - * @returns {string} Returns the unescaped character. - */ - function unescapeHtmlChar(chr) { - return htmlUnescapes[chr]; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Create a new pristine `lodash` function using the given `context` object. - * - * @static - * @memberOf _ - * @category Utility - * @param {Object} [context=root] The context object. - * @returns {Function} Returns a new `lodash` function. - * @example - * - * _.mixin({ 'foo': _.constant('foo') }); - * - * var lodash = _.runInContext(); - * lodash.mixin({ 'bar': lodash.constant('bar') }); - * - * _.isFunction(_.foo); - * // => true - * _.isFunction(_.bar); - * // => false - * - * lodash.isFunction(lodash.foo); - * // => false - * lodash.isFunction(lodash.bar); - * // => true - * - * // using `context` to mock `Date#getTime` use in `_.now` - * var mock = _.runInContext({ - * 'Date': function() { - * return { 'getTime': getTimeMock }; - * } - * }); - * - * // or creating a suped-up `defer` in Node.js - * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; - */ - function runInContext(context) { - // Avoid issues with some ES3 environments that attempt to use values, named - // after built-in constructors like `Object`, for the creation of literals. - // ES5 clears this up by stating that literals must use built-in constructors. - // See https://es5.github.io/#x11.1.5 for more details. - context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root; - - /** Native constructor references. */ - var Array = context.Array, - Date = context.Date, - Error = context.Error, - Function = context.Function, - Math = context.Math, - Number = context.Number, - Object = context.Object, - RegExp = context.RegExp, - String = context.String, - TypeError = context.TypeError; - - /** Used for native method references. */ - var arrayProto = Array.prototype, - objectProto = Object.prototype, - stringProto = String.prototype; - - /** Used to detect DOM support. */ - var document = (document = context.window) ? document.document : null; - - /** Used to resolve the decompiled source of functions. */ - var fnToString = Function.prototype.toString; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** Used to generate unique IDs. */ - var idCounter = 0; - - /** - * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring) - * of values. - */ - var objToString = objectProto.toString; - - /** Used to restore the original `_` reference in `_.noConflict`. */ - var oldDash = context._; - - /** Used to detect if a method is native. */ - var reIsNative = RegExp('^' + - escapeRegExp(fnToString.call(hasOwnProperty)) - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' - ); - - /** Native method references. */ - var ArrayBuffer = getNative(context, 'ArrayBuffer'), - bufferSlice = getNative(ArrayBuffer && new ArrayBuffer(0), 'slice'), - ceil = Math.ceil, - clearTimeout = context.clearTimeout, - floor = Math.floor, - getPrototypeOf = getNative(Object, 'getPrototypeOf'), - parseFloat = context.parseFloat, - push = arrayProto.push, - Set = getNative(context, 'Set'), - setTimeout = context.setTimeout, - splice = arrayProto.splice, - Uint8Array = getNative(context, 'Uint8Array'), - WeakMap = getNative(context, 'WeakMap'); - - /** Used to clone array buffers. */ - var Float64Array = (function() { - // Safari 5 errors when using an array buffer to initialize a typed array - // where the array buffer's `byteLength` is not a multiple of the typed - // array's `BYTES_PER_ELEMENT`. - try { - var func = getNative(context, 'Float64Array'), - result = new func(new ArrayBuffer(10), 0, 1) && func; - } catch(e) {} - return result || null; - }()); - - /* Native method references for those with the same name as other `lodash` methods. */ - var nativeCreate = getNative(Object, 'create'), - nativeIsArray = getNative(Array, 'isArray'), - nativeIsFinite = context.isFinite, - nativeKeys = getNative(Object, 'keys'), - nativeMax = Math.max, - nativeMin = Math.min, - nativeNow = getNative(Date, 'now'), - nativeNumIsFinite = getNative(Number, 'isFinite'), - nativeParseInt = context.parseInt, - nativeRandom = Math.random; - - /** Used as references for `-Infinity` and `Infinity`. */ - var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY, - POSITIVE_INFINITY = Number.POSITIVE_INFINITY; - - /** Used as references for the maximum length and index of an array. */ - var MAX_ARRAY_LENGTH = 4294967295, - MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, - HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; - - /** Used as the size, in bytes, of each `Float64Array` element. */ - var FLOAT64_BYTES_PER_ELEMENT = Float64Array ? Float64Array.BYTES_PER_ELEMENT : 0; - - /** - * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) - * of an array-like value. - */ - var MAX_SAFE_INTEGER = 9007199254740991; - - /** Used to store function metadata. */ - var metaMap = WeakMap && new WeakMap; - - /** Used to lookup unminified function names. */ - var realNames = {}; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a `lodash` object which wraps `value` to enable implicit chaining. - * Methods that operate on and return arrays, collections, and functions can - * be chained together. Methods that return a boolean or single value will - * automatically end the chain returning the unwrapped value. Explicit chaining - * may be enabled using `_.chain`. The execution of chained methods is lazy, - * that is, execution is deferred until `_#value` is implicitly or explicitly - * called. - * - * Lazy evaluation allows several methods to support shortcut fusion. Shortcut - * fusion is an optimization that merges iteratees to avoid creating intermediate - * arrays and reduce the number of iteratee executions. - * - * Chaining is supported in custom builds as long as the `_#value` method is - * directly or indirectly included in the build. - * - * In addition to lodash methods, wrappers have `Array` and `String` methods. - * - * The wrapper `Array` methods are: - * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, - * `splice`, and `unshift` - * - * The wrapper `String` methods are: - * `replace` and `split` - * - * The wrapper methods that support shortcut fusion are: - * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, - * `first`, `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`, - * `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`, - * and `where` - * - * The chainable wrapper methods are: - * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`, - * `callback`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`, - * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defer`, `delay`, - * `difference`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `fill`, - * `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`, `forEach`, - * `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `functions`, - * `groupBy`, `indexBy`, `initial`, `intersection`, `invert`, `invoke`, `keys`, - * `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, - * `memoize`, `merge`, `method`, `methodOf`, `mixin`, `negate`, `omit`, `once`, - * `pairs`, `partial`, `partialRight`, `partition`, `pick`, `plant`, `pluck`, - * `property`, `propertyOf`, `pull`, `pullAt`, `push`, `range`, `rearg`, - * `reject`, `remove`, `rest`, `restParam`, `reverse`, `set`, `shuffle`, - * `slice`, `sort`, `sortBy`, `sortByAll`, `sortByOrder`, `splice`, `spread`, - * `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`, - * `thru`, `times`, `toArray`, `toPlainObject`, `transform`, `union`, `uniq`, - * `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`, `where`, `without`, - * `wrap`, `xor`, `zip`, `zipObject`, `zipWith` - * - * The wrapper methods that are **not** chainable by default are: - * `add`, `attempt`, `camelCase`, `capitalize`, `clone`, `cloneDeep`, `deburr`, - * `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, - * `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, `get`, - * `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`, `inRange`, `isArguments`, - * `isArray`, `isBoolean`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isError`, - * `isFinite` `isFunction`, `isMatch`, `isNative`, `isNaN`, `isNull`, `isNumber`, - * `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, - * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lt`, `lte`, - * `max`, `min`, `noConflict`, `noop`, `now`, `pad`, `padLeft`, `padRight`, - * `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, - * `runInContext`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, - * `sortedLastIndex`, `startCase`, `startsWith`, `sum`, `template`, `trim`, - * `trimLeft`, `trimRight`, `trunc`, `unescape`, `uniqueId`, `value`, and `words` - * - * The wrapper method `sample` will return a wrapped value when `n` is provided, - * otherwise an unwrapped value is returned. - * - * @name _ - * @constructor - * @category Chain - * @param {*} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var wrapped = _([1, 2, 3]); - * - * // returns an unwrapped value - * wrapped.reduce(function(total, n) { - * return total + n; - * }); - * // => 6 - * - * // returns a wrapped value - * var squares = wrapped.map(function(n) { - * return n * n; - * }); - * - * _.isArray(squares); - * // => false - * - * _.isArray(squares.value()); - * // => true - */ - function lodash(value) { - if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { - if (value instanceof LodashWrapper) { - return value; - } - if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) { - return wrapperClone(value); - } - } - return new LodashWrapper(value); - } - - /** - * The function whose prototype all chaining wrappers inherit from. - * - * @private - */ - function baseLodash() { - // No operation performed. - } - - /** - * The base constructor for creating `lodash` wrapper objects. - * - * @private - * @param {*} value The value to wrap. - * @param {boolean} [chainAll] Enable chaining for all wrapper methods. - * @param {Array} [actions=[]] Actions to peform to resolve the unwrapped value. - */ - function LodashWrapper(value, chainAll, actions) { - this.__wrapped__ = value; - this.__actions__ = actions || []; - this.__chain__ = !!chainAll; - } - - /** - * An object environment feature flags. - * - * @static - * @memberOf _ - * @type Object - */ - var support = lodash.support = {}; - - (function(x) { - var Ctor = function() { this.x = x; }, - object = { '0': x, 'length': x }, - props = []; - - Ctor.prototype = { 'valueOf': x, 'y': x }; - for (var key in new Ctor) { props.push(key); } - - /** - * Detect if the DOM is supported. - * - * @memberOf _.support - * @type boolean - */ - try { - support.dom = document.createDocumentFragment().nodeType === 11; - } catch(e) { - support.dom = false; - } - }(1, 0)); - - /** - * By default, the template delimiters used by lodash are like those in - * embedded Ruby (ERB). Change the following template settings to use - * alternative delimiters. - * - * @static - * @memberOf _ - * @type Object - */ - lodash.templateSettings = { - - /** - * Used to detect `data` property values to be HTML-escaped. - * - * @memberOf _.templateSettings - * @type RegExp - */ - 'escape': reEscape, - - /** - * Used to detect code to be evaluated. - * - * @memberOf _.templateSettings - * @type RegExp - */ - 'evaluate': reEvaluate, - - /** - * Used to detect `data` property values to inject. - * - * @memberOf _.templateSettings - * @type RegExp - */ - 'interpolate': reInterpolate, - - /** - * Used to reference the data object in the template text. - * - * @memberOf _.templateSettings - * @type string - */ - 'variable': '', - - /** - * Used to import variables into the compiled template. - * - * @memberOf _.templateSettings - * @type Object - */ - 'imports': { - - /** - * A reference to the `lodash` function. - * - * @memberOf _.templateSettings.imports - * @type Function - */ - '_': lodash - } - }; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. - * - * @private - * @param {*} value The value to wrap. - */ - function LazyWrapper(value) { - this.__wrapped__ = value; - this.__actions__ = null; - this.__dir__ = 1; - this.__dropCount__ = 0; - this.__filtered__ = false; - this.__iteratees__ = null; - this.__takeCount__ = POSITIVE_INFINITY; - this.__views__ = null; - } - - /** - * Creates a clone of the lazy wrapper object. - * - * @private - * @name clone - * @memberOf LazyWrapper - * @returns {Object} Returns the cloned `LazyWrapper` object. - */ - function lazyClone() { - var actions = this.__actions__, - iteratees = this.__iteratees__, - views = this.__views__, - result = new LazyWrapper(this.__wrapped__); - - result.__actions__ = actions ? arrayCopy(actions) : null; - result.__dir__ = this.__dir__; - result.__filtered__ = this.__filtered__; - result.__iteratees__ = iteratees ? arrayCopy(iteratees) : null; - result.__takeCount__ = this.__takeCount__; - result.__views__ = views ? arrayCopy(views) : null; - return result; - } - - /** - * Reverses the direction of lazy iteration. - * - * @private - * @name reverse - * @memberOf LazyWrapper - * @returns {Object} Returns the new reversed `LazyWrapper` object. - */ - function lazyReverse() { - if (this.__filtered__) { - var result = new LazyWrapper(this); - result.__dir__ = -1; - result.__filtered__ = true; - } else { - result = this.clone(); - result.__dir__ *= -1; - } - return result; - } - - /** - * Extracts the unwrapped value from its lazy wrapper. - * - * @private - * @name value - * @memberOf LazyWrapper - * @returns {*} Returns the unwrapped value. - */ - function lazyValue() { - var array = this.__wrapped__.value(); - if (!isArray(array)) { - return baseWrapperValue(array, this.__actions__); - } - var dir = this.__dir__, - isRight = dir < 0, - view = getView(0, array.length, this.__views__), - start = view.start, - end = view.end, - length = end - start, - index = isRight ? end : (start - 1), - takeCount = nativeMin(length, this.__takeCount__), - iteratees = this.__iteratees__, - iterLength = iteratees ? iteratees.length : 0, - resIndex = 0, - result = []; - - outer: - while (length-- && resIndex < takeCount) { - index += dir; - - var iterIndex = -1, - value = array[index]; - - while (++iterIndex < iterLength) { - var data = iteratees[iterIndex], - iteratee = data.iteratee, - type = data.type; - - if (type == LAZY_DROP_WHILE_FLAG) { - if (data.done && (isRight ? (index > data.index) : (index < data.index))) { - data.count = 0; - data.done = false; - } - data.index = index; - if (!data.done) { - var limit = data.limit; - if (!(data.done = limit > -1 ? (data.count++ >= limit) : !iteratee(value))) { - continue outer; - } - } - } else { - var computed = iteratee(value); - if (type == LAZY_MAP_FLAG) { - value = computed; - } else if (!computed) { - if (type == LAZY_FILTER_FLAG) { - continue outer; - } else { - break outer; - } - } - } - } - result[resIndex++] = value; - } - return result; - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates a cache object to store key/value pairs. - * - * @private - * @static - * @name Cache - * @memberOf _.memoize - */ - function MapCache() { - this.__data__ = {}; - } - - /** - * Removes `key` and its value from the cache. - * - * @private - * @name delete - * @memberOf _.memoize.Cache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed successfully, else `false`. - */ - function mapDelete(key) { - return this.has(key) && delete this.__data__[key]; - } - - /** - * Gets the cached value for `key`. - * - * @private - * @name get - * @memberOf _.memoize.Cache - * @param {string} key The key of the value to get. - * @returns {*} Returns the cached value. - */ - function mapGet(key) { - return key == '__proto__' ? undefined : this.__data__[key]; - } - - /** - * Checks if a cached value for `key` exists. - * - * @private - * @name has - * @memberOf _.memoize.Cache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function mapHas(key) { - return key != '__proto__' && hasOwnProperty.call(this.__data__, key); - } - - /** - * Sets `value` to `key` of the cache. - * - * @private - * @name set - * @memberOf _.memoize.Cache - * @param {string} key The key of the value to cache. - * @param {*} value The value to cache. - * @returns {Object} Returns the cache object. - */ - function mapSet(key, value) { - if (key != '__proto__') { - this.__data__[key] = value; - } - return this; - } - - /*------------------------------------------------------------------------*/ - - /** - * - * Creates a cache object to store unique values. - * - * @private - * @param {Array} [values] The values to cache. - */ - function SetCache(values) { - var length = values ? values.length : 0; - - this.data = { 'hash': nativeCreate(null), 'set': new Set }; - while (length--) { - this.push(values[length]); - } - } - - /** - * Checks if `value` is in `cache` mimicking the return signature of - * `_.indexOf` by returning `0` if the value is found, else `-1`. - * - * @private - * @param {Object} cache The cache to search. - * @param {*} value The value to search for. - * @returns {number} Returns `0` if `value` is found, else `-1`. - */ - function cacheIndexOf(cache, value) { - var data = cache.data, - result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value]; - - return result ? 0 : -1; - } - - /** - * Adds `value` to the cache. - * - * @private - * @name push - * @memberOf SetCache - * @param {*} value The value to cache. - */ - function cachePush(value) { - var data = this.data; - if (typeof value == 'string' || isObject(value)) { - data.set.add(value); - } else { - data.hash[value] = true; - } - } - - /*------------------------------------------------------------------------*/ - - /** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ - function arrayCopy(source, array) { - var index = -1, - length = source.length; - - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; - } - - /** - * A specialized version of `_.forEach` for arrays without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEach(array, iteratee) { - var index = -1, - length = array.length; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; - } - - /** - * A specialized version of `_.forEachRight` for arrays without support for - * callback shorthands and `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEachRight(array, iteratee) { - var length = array.length; - - while (length--) { - if (iteratee(array[length], length, array) === false) { - break; - } - } - return array; - } - - /** - * A specialized version of `_.every` for arrays without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - */ - function arrayEvery(array, predicate) { - var index = -1, - length = array.length; - - while (++index < length) { - if (!predicate(array[index], index, array)) { - return false; - } - } - return true; - } - - /** - * A specialized version of `baseExtremum` for arrays which invokes `iteratee` - * with one argument: (value). - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} comparator The function used to compare values. - * @param {*} exValue The initial extremum value. - * @returns {*} Returns the extremum value. - */ - function arrayExtremum(array, iteratee, comparator, exValue) { - var index = -1, - length = array.length, - computed = exValue, - result = computed; - - while (++index < length) { - var value = array[index], - current = +iteratee(value); - - if (comparator(current, computed)) { - computed = current; - result = value; - } - } - return result; - } - - /** - * A specialized version of `_.filter` for arrays without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function arrayFilter(array, predicate) { - var index = -1, - length = array.length, - resIndex = -1, - result = []; - - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[++resIndex] = value; - } - } - return result; - } - - /** - * A specialized version of `_.map` for arrays without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function arrayMap(array, iteratee) { - var index = -1, - length = array.length, - result = Array(length); - - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; - } - - /** - * A specialized version of `_.reduce` for arrays without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initFromArray] Specify using the first element of `array` - * as the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduce(array, iteratee, accumulator, initFromArray) { - var index = -1, - length = array.length; - - if (initFromArray && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; - } - - /** - * A specialized version of `_.reduceRight` for arrays without support for - * callback shorthands and `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initFromArray] Specify using the last element of `array` - * as the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduceRight(array, iteratee, accumulator, initFromArray) { - var length = array.length; - if (initFromArray && length) { - accumulator = array[--length]; - } - while (length--) { - accumulator = iteratee(accumulator, array[length], length, array); - } - return accumulator; - } - - /** - * A specialized version of `_.some` for arrays without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ - function arraySome(array, predicate) { - var index = -1, - length = array.length; - - while (++index < length) { - if (predicate(array[index], index, array)) { - return true; - } - } - return false; - } - - /** - * A specialized version of `_.sum` for arrays without support for iteratees. - * - * @private - * @param {Array} array The array to iterate over. - * @returns {number} Returns the sum. - */ - function arraySum(array) { - var length = array.length, - result = 0; - - while (length--) { - result += +array[length] || 0; - } - return result; - } - - /** - * Used by `_.defaults` to customize its `_.assign` use. - * - * @private - * @param {*} objectValue The destination object property value. - * @param {*} sourceValue The source object property value. - * @returns {*} Returns the value to assign to the destination object. - */ - function assignDefaults(objectValue, sourceValue) { - return objectValue === undefined ? sourceValue : objectValue; - } - - /** - * Used by `_.template` to customize its `_.assign` use. - * - * **Note:** This function is like `assignDefaults` except that it ignores - * inherited property values when checking if a property is `undefined`. - * - * @private - * @param {*} objectValue The destination object property value. - * @param {*} sourceValue The source object property value. - * @param {string} key The key associated with the object and source values. - * @param {Object} object The destination object. - * @returns {*} Returns the value to assign to the destination object. - */ - function assignOwnDefaults(objectValue, sourceValue, key, object) { - return (objectValue === undefined || !hasOwnProperty.call(object, key)) - ? sourceValue - : objectValue; - } - - /** - * A specialized version of `_.assign` for customizing assigned values without - * support for argument juggling, multiple sources, and `this` binding `customizer` - * functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {Function} customizer The function to customize assigned values. - * @returns {Object} Returns `object`. - */ - function assignWith(object, source, customizer) { - var index = -1, - props = keys(source), - length = props.length; - - while (++index < length) { - var key = props[index], - value = object[key], - result = customizer(value, source[key], key, object, source); - - if ((result === result ? (result !== value) : (value === value)) || - (value === undefined && !(key in object))) { - object[key] = result; - } - } - return object; - } - - /** - * The base implementation of `_.assign` without support for argument juggling, - * multiple sources, and `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ - function baseAssign(object, source) { - return source == null - ? object - : baseCopy(source, keys(source), object); - } - - /** - * The base implementation of `_.at` without support for string collections - * and individual key arguments. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {number[]|string[]} props The property names or indexes of elements to pick. - * @returns {Array} Returns the new array of picked elements. - */ - function baseAt(collection, props) { - var index = -1, - isNil = collection == null, - isArr = !isNil && isArrayLike(collection), - length = isArr ? collection.length : 0, - propsLength = props.length, - result = Array(propsLength); - - while(++index < propsLength) { - var key = props[index]; - if (isArr) { - result[index] = isIndex(key, length) ? collection[key] : undefined; - } else { - result[index] = isNil ? undefined : collection[key]; - } - } - return result; - } - - /** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property names to copy. - * @param {Object} [object={}] The object to copy properties to. - * @returns {Object} Returns `object`. - */ - function baseCopy(source, props, object) { - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; - object[key] = source[key]; - } - return object; - } - - /** - * The base implementation of `_.callback` which supports specifying the - * number of arguments to provide to `func`. - * - * @private - * @param {*} [func=_.identity] The value to convert to a callback. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {number} [argCount] The number of arguments to provide to `func`. - * @returns {Function} Returns the callback. - */ - function baseCallback(func, thisArg, argCount) { - var type = typeof func; - if (type == 'function') { - return thisArg === undefined - ? func - : bindCallback(func, thisArg, argCount); - } - if (func == null) { - return identity; - } - if (type == 'object') { - return baseMatches(func); - } - return thisArg === undefined - ? property(func) - : baseMatchesProperty(func, thisArg); - } - - /** - * The base implementation of `_.clone` without support for argument juggling - * and `this` binding `customizer` functions. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @param {Function} [customizer] The function to customize cloning values. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The object `value` belongs to. - * @param {Array} [stackA=[]] Tracks traversed source objects. - * @param {Array} [stackB=[]] Associates clones with source counterparts. - * @returns {*} Returns the cloned value. - */ - function baseClone(value, isDeep, customizer, key, object, stackA, stackB) { - var result; - if (customizer) { - result = object ? customizer(value, key, object) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return arrayCopy(value, result); - } - } else { - var tag = objToString.call(value), - isFunc = tag == funcTag; - - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - result = initCloneObject(isFunc ? {} : value); - if (!isDeep) { - return baseAssign(result, value); - } - } else { - return cloneableTags[tag] - ? initCloneByTag(value, tag, isDeep) - : (object ? value : {}); - } - } - // Check for circular references and return corresponding clone. - stackA || (stackA = []); - stackB || (stackB = []); - - var length = stackA.length; - while (length--) { - if (stackA[length] == value) { - return stackB[length]; - } - } - // Add the source value to the stack of traversed objects and associate it with its clone. - stackA.push(value); - stackB.push(result); - - // Recursively populate clone (susceptible to call stack limits). - (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) { - result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB); - }); - return result; - } - - /** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} prototype The object to inherit from. - * @returns {Object} Returns the new object. - */ - var baseCreate = (function() { - function object() {} - return function(prototype) { - if (isObject(prototype)) { - object.prototype = prototype; - var result = new object; - object.prototype = null; - } - return result || {}; - }; - }()); - - /** - * The base implementation of `_.delay` and `_.defer` which accepts an index - * of where to slice the arguments to provide to `func`. - * - * @private - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {Object} args The arguments provide to `func`. - * @returns {number} Returns the timer id. - */ - function baseDelay(func, wait, args) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return setTimeout(function() { func.apply(undefined, args); }, wait); - } - - /** - * The base implementation of `_.difference` which accepts a single array - * of values to exclude. - * - * @private - * @param {Array} array The array to inspect. - * @param {Array} values The values to exclude. - * @returns {Array} Returns the new array of filtered values. - */ - function baseDifference(array, values) { - var length = array ? array.length : 0, - result = []; - - if (!length) { - return result; - } - var index = -1, - indexOf = getIndexOf(), - isCommon = indexOf == baseIndexOf, - cache = (isCommon && values.length >= 200) ? createCache(values) : null, - valuesLength = values.length; - - if (cache) { - indexOf = cacheIndexOf; - isCommon = false; - values = cache; - } - outer: - while (++index < length) { - var value = array[index]; - - if (isCommon && value === value) { - var valuesIndex = valuesLength; - while (valuesIndex--) { - if (values[valuesIndex] === value) { - continue outer; - } - } - result.push(value); - } - else if (indexOf(values, value, 0) < 0) { - result.push(value); - } - } - return result; - } - - /** - * The base implementation of `_.forEach` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object|string} Returns `collection`. - */ - var baseEach = createBaseEach(baseForOwn); - - /** - * The base implementation of `_.forEachRight` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object|string} Returns `collection`. - */ - var baseEachRight = createBaseEach(baseForOwnRight, true); - - /** - * The base implementation of `_.every` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false` - */ - function baseEvery(collection, predicate) { - var result = true; - baseEach(collection, function(value, index, collection) { - result = !!predicate(value, index, collection); - return result; - }); - return result; - } - - /** - * Gets the extremum value of `collection` invoking `iteratee` for each value - * in `collection` to generate the criterion by which the value is ranked. - * The `iteratee` is invoked with three arguments: (value, index|key, collection). - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} comparator The function used to compare values. - * @param {*} exValue The initial extremum value. - * @returns {*} Returns the extremum value. - */ - function baseExtremum(collection, iteratee, comparator, exValue) { - var computed = exValue, - result = computed; - - baseEach(collection, function(value, index, collection) { - var current = +iteratee(value, index, collection); - if (comparator(current, computed) || (current === exValue && current === result)) { - computed = current; - result = value; - } - }); - return result; - } - - /** - * The base implementation of `_.fill` without an iteratee call guard. - * - * @private - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - */ - function baseFill(array, value, start, end) { - var length = array.length; - - start = start == null ? 0 : (+start || 0); - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = (end === undefined || end > length) ? length : (+end || 0); - if (end < 0) { - end += length; - } - length = start > end ? 0 : (end >>> 0); - start >>>= 0; - - while (start < length) { - array[start++] = value; - } - return array; - } - - /** - * The base implementation of `_.filter` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function baseFilter(collection, predicate) { - var result = []; - baseEach(collection, function(value, index, collection) { - if (predicate(value, index, collection)) { - result.push(value); - } - }); - return result; - } - - /** - * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`, - * without support for callback shorthands and `this` binding, which iterates - * over `collection` using the provided `eachFunc`. - * - * @private - * @param {Array|Object|string} collection The collection to search. - * @param {Function} predicate The function invoked per iteration. - * @param {Function} eachFunc The function to iterate over `collection`. - * @param {boolean} [retKey] Specify returning the key of the found element - * instead of the element itself. - * @returns {*} Returns the found element or its key, else `undefined`. - */ - function baseFind(collection, predicate, eachFunc, retKey) { - var result; - eachFunc(collection, function(value, key, collection) { - if (predicate(value, key, collection)) { - result = retKey ? key : value; - return false; - } - }); - return result; - } - - /** - * The base implementation of `_.flatten` with added support for restricting - * flattening and specifying the start index. - * - * @private - * @param {Array} array The array to flatten. - * @param {boolean} [isDeep] Specify a deep flatten. - * @param {boolean} [isStrict] Restrict flattening to arrays-like objects. - * @returns {Array} Returns the new flattened array. - */ - function baseFlatten(array, isDeep, isStrict) { - var index = -1, - length = array.length, - resIndex = -1, - result = []; - - while (++index < length) { - var value = array[index]; - if (isObjectLike(value) && isArrayLike(value) && - (isStrict || isArray(value) || isArguments(value))) { - if (isDeep) { - // Recursively flatten arrays (susceptible to call stack limits). - value = baseFlatten(value, isDeep, isStrict); - } - var valIndex = -1, - valLength = value.length; - - while (++valIndex < valLength) { - result[++resIndex] = value[valIndex]; - } - } else if (!isStrict) { - result[++resIndex] = value; - } - } - return result; - } - - /** - * The base implementation of `baseForIn` and `baseForOwn` which iterates - * over `object` properties returned by `keysFunc` invoking `iteratee` for - * each property. Iteratee functions may exit iteration early by explicitly - * returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ - var baseFor = createBaseFor(); - - /** - * This function is like `baseFor` except that it iterates over properties - * in the opposite order. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ - var baseForRight = createBaseFor(true); - - /** - * The base implementation of `_.forIn` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForIn(object, iteratee) { - return baseFor(object, iteratee, keysIn); - } - - /** - * The base implementation of `_.forOwn` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForOwn(object, iteratee) { - return baseFor(object, iteratee, keys); - } - - /** - * The base implementation of `_.forOwnRight` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForOwnRight(object, iteratee) { - return baseForRight(object, iteratee, keys); - } - - /** - * The base implementation of `_.functions` which creates an array of - * `object` function property names filtered from those provided. - * - * @private - * @param {Object} object The object to inspect. - * @param {Array} props The property names to filter. - * @returns {Array} Returns the new array of filtered property names. - */ - function baseFunctions(object, props) { - var index = -1, - length = props.length, - resIndex = -1, - result = []; - - while (++index < length) { - var key = props[index]; - if (isFunction(object[key])) { - result[++resIndex] = key; - } - } - return result; - } - - /** - * The base implementation of `get` without support for string paths - * and default values. - * - * @private - * @param {Object} object The object to query. - * @param {Array} path The path of the property to get. - * @param {string} [pathKey] The key representation of path. - * @returns {*} Returns the resolved value. - */ - function baseGet(object, path, pathKey) { - if (object == null) { - return; - } - if (pathKey !== undefined && pathKey in toObject(object)) { - path = [pathKey]; - } - var index = 0, - length = path.length; - - while (object != null && index < length) { - object = object[path[index++]]; - } - return (index && index == length) ? object : undefined; - } - - /** - * The base implementation of `_.isEqual` without support for `this` binding - * `customizer` functions. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize comparing values. - * @param {boolean} [isLoose] Specify performing partial comparisons. - * @param {Array} [stackA] Tracks traversed `value` objects. - * @param {Array} [stackB] Tracks traversed `other` objects. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - */ - function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) { - if (value === other) { - return true; - } - if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { - return value !== value && other !== other; - } - return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB); - } - - /** - * A specialized version of `baseIsEqual` for arrays and objects which performs - * deep comparisons and tracks traversed objects enabling objects with circular - * references to be compared. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparing objects. - * @param {boolean} [isLoose] Specify performing partial comparisons. - * @param {Array} [stackA=[]] Tracks traversed `value` objects. - * @param {Array} [stackB=[]] Tracks traversed `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) { - var objIsArr = isArray(object), - othIsArr = isArray(other), - objTag = arrayTag, - othTag = arrayTag; - - if (!objIsArr) { - objTag = objToString.call(object); - if (objTag == argsTag) { - objTag = objectTag; - } else if (objTag != objectTag) { - objIsArr = isTypedArray(object); - } - } - if (!othIsArr) { - othTag = objToString.call(other); - if (othTag == argsTag) { - othTag = objectTag; - } else if (othTag != objectTag) { - othIsArr = isTypedArray(other); - } - } - var objIsObj = objTag == objectTag, - othIsObj = othTag == objectTag, - isSameTag = objTag == othTag; - - if (isSameTag && !(objIsArr || objIsObj)) { - return equalByTag(object, other, objTag); - } - if (!isLoose) { - var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), - othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); - - if (objIsWrapped || othIsWrapped) { - return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB); - } - } - if (!isSameTag) { - return false; - } - // Assume cyclic values are equal. - // For more information on detecting circular references see https://es5.github.io/#JO. - stackA || (stackA = []); - stackB || (stackB = []); - - var length = stackA.length; - while (length--) { - if (stackA[length] == object) { - return stackB[length] == other; - } - } - // Add `object` and `other` to the stack of traversed objects. - stackA.push(object); - stackB.push(other); - - var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB); - - stackA.pop(); - stackB.pop(); - - return result; - } - - /** - * The base implementation of `_.isMatch` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Object} object The object to inspect. - * @param {Array} matchData The propery names, values, and compare flags to match. - * @param {Function} [customizer] The function to customize comparing objects. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - */ - function baseIsMatch(object, matchData, customizer) { - var index = matchData.length, - length = index, - noCustomizer = !customizer; - - if (object == null) { - return !length; - } - object = toObject(object); - while (index--) { - var data = matchData[index]; - if ((noCustomizer && data[2]) - ? data[1] !== object[data[0]] - : !(data[0] in object) - ) { - return false; - } - } - while (++index < length) { - data = matchData[index]; - var key = data[0], - objValue = object[key], - srcValue = data[1]; - - if (noCustomizer && data[2]) { - if (objValue === undefined && !(key in object)) { - return false; - } - } else { - var result = customizer ? customizer(objValue, srcValue, key) : undefined; - if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) { - return false; - } - } - } - return true; - } - - /** - * The base implementation of `_.map` without support for callback shorthands - * and `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function baseMap(collection, iteratee) { - var index = -1, - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value, key, collection) { - result[++index] = iteratee(value, key, collection); - }); - return result; - } - - /** - * The base implementation of `_.matches` which does not clone `source`. - * - * @private - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new function. - */ - function baseMatches(source) { - var matchData = getMatchData(source); - if (matchData.length == 1 && matchData[0][2]) { - var key = matchData[0][0], - value = matchData[0][1]; - - return function(object) { - if (object == null) { - return false; - } - return object[key] === value && (value !== undefined || (key in toObject(object))); - }; - } - return function(object) { - return baseIsMatch(object, matchData); - }; - } - - /** - * The base implementation of `_.matchesProperty` which does not clone `srcValue`. - * - * @private - * @param {string} path The path of the property to get. - * @param {*} srcValue The value to compare. - * @returns {Function} Returns the new function. - */ - function baseMatchesProperty(path, srcValue) { - var isArr = isArray(path), - isCommon = isKey(path) && isStrictComparable(srcValue), - pathKey = (path + ''); - - path = toPath(path); - return function(object) { - if (object == null) { - return false; - } - var key = pathKey; - object = toObject(object); - if ((isArr || !isCommon) && !(key in object)) { - object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); - if (object == null) { - return false; - } - key = last(path); - object = toObject(object); - } - return object[key] === srcValue - ? (srcValue !== undefined || (key in object)) - : baseIsEqual(srcValue, object[key], undefined, true); - }; - } - - /** - * The base implementation of `_.merge` without support for argument juggling, - * multiple sources, and `this` binding `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {Function} [customizer] The function to customize merging properties. - * @param {Array} [stackA=[]] Tracks traversed source objects. - * @param {Array} [stackB=[]] Associates values with source counterparts. - * @returns {Object} Returns `object`. - */ - function baseMerge(object, source, customizer, stackA, stackB) { - if (!isObject(object)) { - return object; - } - var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)), - props = isSrcArr ? null : keys(source); - - arrayEach(props || source, function(srcValue, key) { - if (props) { - key = srcValue; - srcValue = source[key]; - } - if (isObjectLike(srcValue)) { - stackA || (stackA = []); - stackB || (stackB = []); - baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB); - } - else { - var value = object[key], - result = customizer ? customizer(value, srcValue, key, object, source) : undefined, - isCommon = result === undefined; - - if (isCommon) { - result = srcValue; - } - if ((result !== undefined || (isSrcArr && !(key in object))) && - (isCommon || (result === result ? (result !== value) : (value === value)))) { - object[key] = result; - } - } - }); - return object; - } - - /** - * A specialized version of `baseMerge` for arrays and objects which performs - * deep merges and tracks traversed objects enabling objects with circular - * references to be merged. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {string} key The key of the value to merge. - * @param {Function} mergeFunc The function to merge values. - * @param {Function} [customizer] The function to customize merging properties. - * @param {Array} [stackA=[]] Tracks traversed source objects. - * @param {Array} [stackB=[]] Associates values with source counterparts. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) { - var length = stackA.length, - srcValue = source[key]; - - while (length--) { - if (stackA[length] == srcValue) { - object[key] = stackB[length]; - return; - } - } - var value = object[key], - result = customizer ? customizer(value, srcValue, key, object, source) : undefined, - isCommon = result === undefined; - - if (isCommon) { - result = srcValue; - if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) { - result = isArray(value) - ? value - : (isArrayLike(value) ? arrayCopy(value) : []); - } - else if (isPlainObject(srcValue) || isArguments(srcValue)) { - result = isArguments(value) - ? toPlainObject(value) - : (isPlainObject(value) ? value : {}); - } - else { - isCommon = false; - } - } - // Add the source value to the stack of traversed objects and associate - // it with its merged value. - stackA.push(srcValue); - stackB.push(result); - - if (isCommon) { - // Recursively merge objects and arrays (susceptible to call stack limits). - object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB); - } else if (result === result ? (result !== value) : (value === value)) { - object[key] = result; - } - } - - /** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. - */ - function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; - } - - /** - * A specialized version of `baseProperty` which supports deep paths. - * - * @private - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new function. - */ - function basePropertyDeep(path) { - var pathKey = (path + ''); - path = toPath(path); - return function(object) { - return baseGet(object, path, pathKey); - }; - } - - /** - * The base implementation of `_.pullAt` without support for individual - * index arguments and capturing the removed elements. - * - * @private - * @param {Array} array The array to modify. - * @param {number[]} indexes The indexes of elements to remove. - * @returns {Array} Returns `array`. - */ - function basePullAt(array, indexes) { - var length = array ? indexes.length : 0; - while (length--) { - var index = indexes[length]; - if (index != previous && isIndex(index)) { - var previous = index; - splice.call(array, index, 1); - } - } - return array; - } - - /** - * The base implementation of `_.random` without support for argument juggling - * and returning floating-point numbers. - * - * @private - * @param {number} min The minimum possible value. - * @param {number} max The maximum possible value. - * @returns {number} Returns the random number. - */ - function baseRandom(min, max) { - return min + floor(nativeRandom() * (max - min + 1)); - } - - /** - * The base implementation of `_.reduce` and `_.reduceRight` without support - * for callback shorthands and `this` binding, which iterates over `collection` - * using the provided `eachFunc`. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} accumulator The initial value. - * @param {boolean} initFromCollection Specify using the first or last element - * of `collection` as the initial value. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the accumulated value. - */ - function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) { - eachFunc(collection, function(value, index, collection) { - accumulator = initFromCollection - ? (initFromCollection = false, value) - : iteratee(accumulator, value, index, collection); - }); - return accumulator; - } - - /** - * The base implementation of `setData` without support for hot loop detection. - * - * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. - */ - var baseSetData = !metaMap ? identity : function(func, data) { - metaMap.set(func, data); - return func; - }; - - /** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - start = start == null ? 0 : (+start || 0); - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = (end === undefined || end > length) ? length : (+end || 0); - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; - } - - /** - * The base implementation of `_.some` without support for callback shorthands - * and `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ - function baseSome(collection, predicate) { - var result; - - baseEach(collection, function(value, index, collection) { - result = predicate(value, index, collection); - return !result; - }); - return !!result; - } - - /** - * The base implementation of `_.sortBy` which uses `comparer` to define - * the sort order of `array` and replaces criteria objects with their - * corresponding values. - * - * @private - * @param {Array} array The array to sort. - * @param {Function} comparer The function to define sort order. - * @returns {Array} Returns `array`. - */ - function baseSortBy(array, comparer) { - var length = array.length; - - array.sort(comparer); - while (length--) { - array[length] = array[length].value; - } - return array; - } - - /** - * The base implementation of `_.sortByOrder` without param guards. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. - * @param {boolean[]} orders The sort orders of `iteratees`. - * @returns {Array} Returns the new sorted array. - */ - function baseSortByOrder(collection, iteratees, orders) { - var callback = getCallback(), - index = -1; - - iteratees = arrayMap(iteratees, function(iteratee) { return callback(iteratee); }); - - var result = baseMap(collection, function(value) { - var criteria = arrayMap(iteratees, function(iteratee) { return iteratee(value); }); - return { 'criteria': criteria, 'index': ++index, 'value': value }; - }); - - return baseSortBy(result, function(object, other) { - return compareMultiple(object, other, orders); - }); - } - - /** - * The base implementation of `_.sum` without support for callback shorthands - * and `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {number} Returns the sum. - */ - function baseSum(collection, iteratee) { - var result = 0; - baseEach(collection, function(value, index, collection) { - result += +iteratee(value, index, collection) || 0; - }); - return result; - } - - /** - * The base implementation of `_.uniq` without support for callback shorthands - * and `this` binding. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The function invoked per iteration. - * @returns {Array} Returns the new duplicate-value-free array. - */ - function baseUniq(array, iteratee) { - var index = -1, - indexOf = getIndexOf(), - length = array.length, - isCommon = indexOf == baseIndexOf, - isLarge = isCommon && length >= 200, - seen = isLarge ? createCache() : null, - result = []; - - if (seen) { - indexOf = cacheIndexOf; - isCommon = false; - } else { - isLarge = false; - seen = iteratee ? [] : result; - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value, index, array) : value; - - if (isCommon && value === value) { - var seenIndex = seen.length; - while (seenIndex--) { - if (seen[seenIndex] === computed) { - continue outer; - } - } - if (iteratee) { - seen.push(computed); - } - result.push(value); - } - else if (indexOf(seen, computed, 0) < 0) { - if (iteratee || isLarge) { - seen.push(computed); - } - result.push(value); - } - } - return result; - } - - /** - * The base implementation of `_.values` and `_.valuesIn` which creates an - * array of `object` property values corresponding to the property names - * of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the array of property values. - */ - function baseValues(object, props) { - var index = -1, - length = props.length, - result = Array(length); - - while (++index < length) { - result[index] = object[props[index]]; - } - return result; - } - - /** - * The base implementation of `_.dropRightWhile`, `_.dropWhile`, `_.takeRightWhile`, - * and `_.takeWhile` without support for callback shorthands and `this` binding. - * - * @private - * @param {Array} array The array to query. - * @param {Function} predicate The function invoked per iteration. - * @param {boolean} [isDrop] Specify dropping elements instead of taking them. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the slice of `array`. - */ - function baseWhile(array, predicate, isDrop, fromRight) { - var length = array.length, - index = fromRight ? length : -1; - - while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {} - return isDrop - ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) - : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); - } - - /** - * The base implementation of `wrapperValue` which returns the result of - * performing a sequence of actions on the unwrapped `value`, where each - * successive action is supplied the return value of the previous. - * - * @private - * @param {*} value The unwrapped value. - * @param {Array} actions Actions to peform to resolve the unwrapped value. - * @returns {*} Returns the resolved value. - */ - function baseWrapperValue(value, actions) { - var result = value; - if (result instanceof LazyWrapper) { - result = result.value(); - } - var index = -1, - length = actions.length; - - while (++index < length) { - var args = [result], - action = actions[index]; - - push.apply(args, action.args); - result = action.func.apply(action.thisArg, args); - } - return result; - } - - /** - * Performs a binary search of `array` to determine the index at which `value` - * should be inserted into `array` in order to maintain its sort order. - * - * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - */ - function binaryIndex(array, value, retHighest) { - var low = 0, - high = array ? array.length : low; - - if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { - while (low < high) { - var mid = (low + high) >>> 1, - computed = array[mid]; - - if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) { - low = mid + 1; - } else { - high = mid; - } - } - return high; - } - return binaryIndexBy(array, value, identity, retHighest); - } - - /** - * This function is like `binaryIndex` except that it invokes `iteratee` for - * `value` and each element of `array` to compute their sort ranking. The - * iteratee is invoked with one argument; (value). - * - * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} iteratee The function invoked per iteration. - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - */ - function binaryIndexBy(array, value, iteratee, retHighest) { - value = iteratee(value); - - var low = 0, - high = array ? array.length : 0, - valIsNaN = value !== value, - valIsNull = value === null, - valIsUndef = value === undefined; - - while (low < high) { - var mid = floor((low + high) / 2), - computed = iteratee(array[mid]), - isDef = computed !== undefined, - isReflexive = computed === computed; - - if (valIsNaN) { - var setLow = isReflexive || retHighest; - } else if (valIsNull) { - setLow = isReflexive && isDef && (retHighest || computed != null); - } else if (valIsUndef) { - setLow = isReflexive && (retHighest || isDef); - } else if (computed == null) { - setLow = false; - } else { - setLow = retHighest ? (computed <= value) : (computed < value); - } - if (setLow) { - low = mid + 1; - } else { - high = mid; - } - } - return nativeMin(high, MAX_ARRAY_INDEX); - } - - /** - * A specialized version of `baseCallback` which only supports `this` binding - * and specifying the number of arguments to provide to `func`. - * - * @private - * @param {Function} func The function to bind. - * @param {*} thisArg The `this` binding of `func`. - * @param {number} [argCount] The number of arguments to provide to `func`. - * @returns {Function} Returns the callback. - */ - function bindCallback(func, thisArg, argCount) { - if (typeof func != 'function') { - return identity; - } - if (thisArg === undefined) { - return func; - } - switch (argCount) { - case 1: return function(value) { - return func.call(thisArg, value); - }; - case 3: return function(value, index, collection) { - return func.call(thisArg, value, index, collection); - }; - case 4: return function(accumulator, value, index, collection) { - return func.call(thisArg, accumulator, value, index, collection); - }; - case 5: return function(value, other, key, object, source) { - return func.call(thisArg, value, other, key, object, source); - }; - } - return function() { - return func.apply(thisArg, arguments); - }; - } - - /** - * Creates a clone of the given array buffer. - * - * @private - * @param {ArrayBuffer} buffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ - function bufferClone(buffer) { - return bufferSlice.call(buffer, 0); - } - if (!bufferSlice) { - // PhantomJS has `ArrayBuffer` and `Uint8Array` but not `Float64Array`. - bufferClone = !(ArrayBuffer && Uint8Array) ? constant(null) : function(buffer) { - var byteLength = buffer.byteLength, - floatLength = Float64Array ? floor(byteLength / FLOAT64_BYTES_PER_ELEMENT) : 0, - offset = floatLength * FLOAT64_BYTES_PER_ELEMENT, - result = new ArrayBuffer(byteLength); - - if (floatLength) { - var view = new Float64Array(result, 0, floatLength); - view.set(new Float64Array(buffer, 0, floatLength)); - } - if (byteLength != offset) { - view = new Uint8Array(result, offset); - view.set(new Uint8Array(buffer, offset)); - } - return result; - }; - } - - /** - * Creates an array that is the composition of partially applied arguments, - * placeholders, and provided arguments into a single array of arguments. - * - * @private - * @param {Array|Object} args The provided arguments. - * @param {Array} partials The arguments to prepend to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @returns {Array} Returns the new array of composed arguments. - */ - function composeArgs(args, partials, holders) { - var holdersLength = holders.length, - argsIndex = -1, - argsLength = nativeMax(args.length - holdersLength, 0), - leftIndex = -1, - leftLength = partials.length, - result = Array(argsLength + leftLength); - - while (++leftIndex < leftLength) { - result[leftIndex] = partials[leftIndex]; - } - while (++argsIndex < holdersLength) { - result[holders[argsIndex]] = args[argsIndex]; - } - while (argsLength--) { - result[leftIndex++] = args[argsIndex++]; - } - return result; - } - - /** - * This function is like `composeArgs` except that the arguments composition - * is tailored for `_.partialRight`. - * - * @private - * @param {Array|Object} args The provided arguments. - * @param {Array} partials The arguments to append to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @returns {Array} Returns the new array of composed arguments. - */ - function composeArgsRight(args, partials, holders) { - var holdersIndex = -1, - holdersLength = holders.length, - argsIndex = -1, - argsLength = nativeMax(args.length - holdersLength, 0), - rightIndex = -1, - rightLength = partials.length, - result = Array(argsLength + rightLength); - - while (++argsIndex < argsLength) { - result[argsIndex] = args[argsIndex]; - } - var offset = argsIndex; - while (++rightIndex < rightLength) { - result[offset + rightIndex] = partials[rightIndex]; - } - while (++holdersIndex < holdersLength) { - result[offset + holders[holdersIndex]] = args[argsIndex++]; - } - return result; - } - - /** - * Creates a function that aggregates a collection, creating an accumulator - * object composed from the results of running each element in the collection - * through an iteratee. - * - * **Note:** This function is used to create `_.countBy`, `_.groupBy`, `_.indexBy`, - * and `_.partition`. - * - * @private - * @param {Function} setter The function to set keys and values of the accumulator object. - * @param {Function} [initializer] The function to initialize the accumulator object. - * @returns {Function} Returns the new aggregator function. - */ - function createAggregator(setter, initializer) { - return function(collection, iteratee, thisArg) { - var result = initializer ? initializer() : {}; - iteratee = getCallback(iteratee, thisArg, 3); - - if (isArray(collection)) { - var index = -1, - length = collection.length; - - while (++index < length) { - var value = collection[index]; - setter(result, value, iteratee(value, index, collection), collection); - } - } else { - baseEach(collection, function(value, key, collection) { - setter(result, value, iteratee(value, key, collection), collection); - }); - } - return result; - }; - } - - /** - * Creates a function that assigns properties of source object(s) to a given - * destination object. - * - * **Note:** This function is used to create `_.assign`, `_.defaults`, and `_.merge`. - * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. - */ - function createAssigner(assigner) { - return restParam(function(object, sources) { - var index = -1, - length = object == null ? 0 : sources.length, - customizer = length > 2 ? sources[length - 2] : undefined, - guard = length > 2 ? sources[2] : undefined, - thisArg = length > 1 ? sources[length - 1] : undefined; - - if (typeof customizer == 'function') { - customizer = bindCallback(customizer, thisArg, 5); - length -= 2; - } else { - customizer = typeof thisArg == 'function' ? thisArg : undefined; - length -= (customizer ? 1 : 0); - } - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; - } - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, customizer); - } - } - return object; - }); - } - - /** - * Creates a `baseEach` or `baseEachRight` function. - * - * @private - * @param {Function} eachFunc The function to iterate over a collection. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ - function createBaseEach(eachFunc, fromRight) { - return function(collection, iteratee) { - var length = collection ? getLength(collection) : 0; - if (!isLength(length)) { - return eachFunc(collection, iteratee); - } - var index = fromRight ? length : -1, - iterable = toObject(collection); - - while ((fromRight ? index-- : ++index < length)) { - if (iteratee(iterable[index], index, iterable) === false) { - break; - } - } - return collection; - }; - } - - /** - * Creates a base function for `_.forIn` or `_.forInRight`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ - function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var iterable = toObject(object), - props = keysFunc(object), - length = props.length, - index = fromRight ? length : -1; - - while ((fromRight ? index-- : ++index < length)) { - var key = props[index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; - } - - /** - * Creates a function that wraps `func` and invokes it with the `this` - * binding of `thisArg`. - * - * @private - * @param {Function} func The function to bind. - * @param {*} [thisArg] The `this` binding of `func`. - * @returns {Function} Returns the new bound function. - */ - function createBindWrapper(func, thisArg) { - var Ctor = createCtorWrapper(func); - - function wrapper() { - var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - return fn.apply(thisArg, arguments); - } - return wrapper; - } - - /** - * Creates a `Set` cache object to optimize linear searches of large arrays. - * - * @private - * @param {Array} [values] The values to cache. - * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`. - */ - var createCache = !(nativeCreate && Set) ? constant(null) : function(values) { - return new SetCache(values); - }; - - /** - * Creates a function that produces compound words out of the words in a - * given string. - * - * @private - * @param {Function} callback The function to combine each word. - * @returns {Function} Returns the new compounder function. - */ - function createCompounder(callback) { - return function(string) { - var index = -1, - array = words(deburr(string)), - length = array.length, - result = ''; - - while (++index < length) { - result = callback(result, array[index], index); - } - return result; - }; - } - - /** - * Creates a function that produces an instance of `Ctor` regardless of - * whether it was invoked as part of a `new` expression or by `call` or `apply`. - * - * @private - * @param {Function} Ctor The constructor to wrap. - * @returns {Function} Returns the new wrapped function. - */ - function createCtorWrapper(Ctor) { - return function() { - // Use a `switch` statement to work with class constructors. - // See https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-function-objects-call-thisargument-argumentslist - // for more details. - var args = arguments; - switch (args.length) { - case 0: return new Ctor; - case 1: return new Ctor(args[0]); - case 2: return new Ctor(args[0], args[1]); - case 3: return new Ctor(args[0], args[1], args[2]); - case 4: return new Ctor(args[0], args[1], args[2], args[3]); - case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); - } - var thisBinding = baseCreate(Ctor.prototype), - result = Ctor.apply(thisBinding, args); - - // Mimic the constructor's `return` behavior. - // See https://es5.github.io/#x13.2.2 for more details. - return isObject(result) ? result : thisBinding; - }; - } - - /** - * Creates a `_.curry` or `_.curryRight` function. - * - * @private - * @param {boolean} flag The curry bit flag. - * @returns {Function} Returns the new curry function. - */ - function createCurry(flag) { - function curryFunc(func, arity, guard) { - if (guard && isIterateeCall(func, arity, guard)) { - arity = null; - } - var result = createWrapper(func, flag, null, null, null, null, null, arity); - result.placeholder = curryFunc.placeholder; - return result; - } - return curryFunc; - } - - /** - * Creates a `_.max` or `_.min` function. - * - * @private - * @param {Function} comparator The function used to compare values. - * @param {*} exValue The initial extremum value. - * @returns {Function} Returns the new extremum function. - */ - function createExtremum(comparator, exValue) { - return function(collection, iteratee, thisArg) { - if (thisArg && isIterateeCall(collection, iteratee, thisArg)) { - iteratee = null; - } - iteratee = getCallback(iteratee, thisArg, 3); - if (iteratee.length == 1) { - collection = toIterable(collection); - var result = arrayExtremum(collection, iteratee, comparator, exValue); - if (!(collection.length && result === exValue)) { - return result; - } - } - return baseExtremum(collection, iteratee, comparator, exValue); - }; - } - - /** - * Creates a `_.find` or `_.findLast` function. - * - * @private - * @param {Function} eachFunc The function to iterate over a collection. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new find function. - */ - function createFind(eachFunc, fromRight) { - return function(collection, predicate, thisArg) { - predicate = getCallback(predicate, thisArg, 3); - if (isArray(collection)) { - var index = baseFindIndex(collection, predicate, fromRight); - return index > -1 ? collection[index] : undefined; - } - return baseFind(collection, predicate, eachFunc); - }; - } - - /** - * Creates a `_.findIndex` or `_.findLastIndex` function. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new find function. - */ - function createFindIndex(fromRight) { - return function(array, predicate, thisArg) { - if (!(array && array.length)) { - return -1; - } - predicate = getCallback(predicate, thisArg, 3); - return baseFindIndex(array, predicate, fromRight); - }; - } - - /** - * Creates a `_.findKey` or `_.findLastKey` function. - * - * @private - * @param {Function} objectFunc The function to iterate over an object. - * @returns {Function} Returns the new find function. - */ - function createFindKey(objectFunc) { - return function(object, predicate, thisArg) { - predicate = getCallback(predicate, thisArg, 3); - return baseFind(object, predicate, objectFunc, true); - }; - } - - /** - * Creates a `_.flow` or `_.flowRight` function. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new flow function. - */ - function createFlow(fromRight) { - return function() { - var wrapper, - length = arguments.length, - index = fromRight ? length : -1, - leftIndex = 0, - funcs = Array(length); - - while ((fromRight ? index-- : ++index < length)) { - var func = funcs[leftIndex++] = arguments[index]; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (!wrapper && LodashWrapper.prototype.thru && getFuncName(func) == 'wrapper') { - wrapper = new LodashWrapper([]); - } - } - index = wrapper ? -1 : length; - while (++index < length) { - func = funcs[index]; - - var funcName = getFuncName(func), - data = funcName == 'wrapper' ? getData(func) : null; - - if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) { - wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); - } else { - wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func); - } - } - return function() { - var args = arguments; - if (wrapper && args.length == 1 && isArray(args[0])) { - return wrapper.plant(args[0]).value(); - } - var index = 0, - result = length ? funcs[index].apply(this, args) : args[0]; - - while (++index < length) { - result = funcs[index].call(this, result); - } - return result; - }; - }; - } - - /** - * Creates a function for `_.forEach` or `_.forEachRight`. - * - * @private - * @param {Function} arrayFunc The function to iterate over an array. - * @param {Function} eachFunc The function to iterate over a collection. - * @returns {Function} Returns the new each function. - */ - function createForEach(arrayFunc, eachFunc) { - return function(collection, iteratee, thisArg) { - return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) - ? arrayFunc(collection, iteratee) - : eachFunc(collection, bindCallback(iteratee, thisArg, 3)); - }; - } - - /** - * Creates a function for `_.forIn` or `_.forInRight`. - * - * @private - * @param {Function} objectFunc The function to iterate over an object. - * @returns {Function} Returns the new each function. - */ - function createForIn(objectFunc) { - return function(object, iteratee, thisArg) { - if (typeof iteratee != 'function' || thisArg !== undefined) { - iteratee = bindCallback(iteratee, thisArg, 3); - } - return objectFunc(object, iteratee, keysIn); - }; - } - - /** - * Creates a function for `_.forOwn` or `_.forOwnRight`. - * - * @private - * @param {Function} objectFunc The function to iterate over an object. - * @returns {Function} Returns the new each function. - */ - function createForOwn(objectFunc) { - return function(object, iteratee, thisArg) { - if (typeof iteratee != 'function' || thisArg !== undefined) { - iteratee = bindCallback(iteratee, thisArg, 3); - } - return objectFunc(object, iteratee); - }; - } - - /** - * Creates a function for `_.mapKeys` or `_.mapValues`. - * - * @private - * @param {boolean} [isMapKeys] Specify mapping keys instead of values. - * @returns {Function} Returns the new map function. - */ - function createObjectMapper(isMapKeys) { - return function(object, iteratee, thisArg) { - var result = {}; - iteratee = getCallback(iteratee, thisArg, 3); - - baseForOwn(object, function(value, key, object) { - var mapped = iteratee(value, key, object); - key = isMapKeys ? mapped : key; - value = isMapKeys ? value : mapped; - result[key] = value; - }); - return result; - }; - } - - /** - * Creates a function for `_.padLeft` or `_.padRight`. - * - * @private - * @param {boolean} [fromRight] Specify padding from the right. - * @returns {Function} Returns the new pad function. - */ - function createPadDir(fromRight) { - return function(string, length, chars) { - string = baseToString(string); - return (fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string); - }; - } - - /** - * Creates a `_.partial` or `_.partialRight` function. - * - * @private - * @param {boolean} flag The partial bit flag. - * @returns {Function} Returns the new partial function. - */ - function createPartial(flag) { - var partialFunc = restParam(function(func, partials) { - var holders = replaceHolders(partials, partialFunc.placeholder); - return createWrapper(func, flag, null, partials, holders); - }); - return partialFunc; - } - - /** - * Creates a function for `_.reduce` or `_.reduceRight`. - * - * @private - * @param {Function} arrayFunc The function to iterate over an array. - * @param {Function} eachFunc The function to iterate over a collection. - * @returns {Function} Returns the new each function. - */ - function createReduce(arrayFunc, eachFunc) { - return function(collection, iteratee, accumulator, thisArg) { - var initFromArray = arguments.length < 3; - return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) - ? arrayFunc(collection, iteratee, accumulator, initFromArray) - : baseReduce(collection, getCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc); - }; - } - - /** - * Creates a function that wraps `func` and invokes it with optional `this` - * binding of, partial application, and currying. - * - * @private - * @param {Function|string} func The function or method name to reference. - * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to the new function. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [partialsRight] The arguments to append to those provided to the new function. - * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { - var isAry = bitmask & ARY_FLAG, - isBind = bitmask & BIND_FLAG, - isBindKey = bitmask & BIND_KEY_FLAG, - isCurry = bitmask & CURRY_FLAG, - isCurryBound = bitmask & CURRY_BOUND_FLAG, - isCurryRight = bitmask & CURRY_RIGHT_FLAG, - Ctor = isBindKey ? null : createCtorWrapper(func); - - function wrapper() { - // Avoid `arguments` object use disqualifying optimizations by - // converting it to an array before providing it to other functions. - var length = arguments.length, - index = length, - args = Array(length); - - while (index--) { - args[index] = arguments[index]; - } - if (partials) { - args = composeArgs(args, partials, holders); - } - if (partialsRight) { - args = composeArgsRight(args, partialsRight, holdersRight); - } - if (isCurry || isCurryRight) { - var placeholder = wrapper.placeholder, - argsHolders = replaceHolders(args, placeholder); - - length -= argsHolders.length; - if (length < arity) { - var newArgPos = argPos ? arrayCopy(argPos) : null, - newArity = nativeMax(arity - length, 0), - newsHolders = isCurry ? argsHolders : null, - newHoldersRight = isCurry ? null : argsHolders, - newPartials = isCurry ? args : null, - newPartialsRight = isCurry ? null : args; - - bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG); - bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG); - - if (!isCurryBound) { - bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG); - } - var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity], - result = createHybridWrapper.apply(undefined, newData); - - if (isLaziable(func)) { - setData(result, newData); - } - result.placeholder = placeholder; - return result; - } - } - var thisBinding = isBind ? thisArg : this, - fn = isBindKey ? thisBinding[func] : func; - - if (argPos) { - args = reorder(args, argPos); - } - if (isAry && ary < args.length) { - args.length = ary; - } - if (this && this !== root && this instanceof wrapper) { - fn = Ctor || createCtorWrapper(func); - } - return fn.apply(thisBinding, args); - } - return wrapper; - } - - /** - * Creates the padding required for `string` based on the given `length`. - * The `chars` string is truncated if the number of characters exceeds `length`. - * - * @private - * @param {string} string The string to create padding for. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the pad for `string`. - */ - function createPadding(string, length, chars) { - var strLength = string.length; - length = +length; - - if (strLength >= length || !nativeIsFinite(length)) { - return ''; - } - var padLength = length - strLength; - chars = chars == null ? ' ' : (chars + ''); - return repeat(chars, ceil(padLength / chars.length)).slice(0, padLength); - } - - /** - * Creates a function that wraps `func` and invokes it with the optional `this` - * binding of `thisArg` and the `partials` prepended to those provided to - * the wrapper. - * - * @private - * @param {Function} func The function to partially apply arguments to. - * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} partials The arguments to prepend to those provided to the new function. - * @returns {Function} Returns the new bound function. - */ - function createPartialWrapper(func, bitmask, thisArg, partials) { - var isBind = bitmask & BIND_FLAG, - Ctor = createCtorWrapper(func); - - function wrapper() { - // Avoid `arguments` object use disqualifying optimizations by - // converting it to an array before providing it `func`. - var argsIndex = -1, - argsLength = arguments.length, - leftIndex = -1, - leftLength = partials.length, - args = Array(argsLength + leftLength); - - while (++leftIndex < leftLength) { - args[leftIndex] = partials[leftIndex]; - } - while (argsLength--) { - args[leftIndex++] = arguments[++argsIndex]; - } - var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - return fn.apply(isBind ? thisArg : this, args); - } - return wrapper; - } - - /** - * Creates a `_.sortedIndex` or `_.sortedLastIndex` function. - * - * @private - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {Function} Returns the new index function. - */ - function createSortedIndex(retHighest) { - return function(array, value, iteratee, thisArg) { - var callback = getCallback(iteratee); - return (iteratee == null && callback === baseCallback) - ? binaryIndex(array, value, retHighest) - : binaryIndexBy(array, value, callback(iteratee, thisArg, 1), retHighest); - }; - } - - /** - * Creates a function that either curries or invokes `func` with optional - * `this` binding and partially applied arguments. - * - * @private - * @param {Function|string} func The function or method name to reference. - * @param {number} bitmask The bitmask of flags. - * The bitmask may be composed of the following flags: - * 1 - `_.bind` - * 2 - `_.bindKey` - * 4 - `_.curry` or `_.curryRight` of a bound function - * 8 - `_.curry` - * 16 - `_.curryRight` - * 32 - `_.partial` - * 64 - `_.partialRight` - * 128 - `_.rearg` - * 256 - `_.ary` - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to be partially applied. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { - var isBindKey = bitmask & BIND_KEY_FLAG; - if (!isBindKey && typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - var length = partials ? partials.length : 0; - if (!length) { - bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG); - partials = holders = null; - } - length -= (holders ? holders.length : 0); - if (bitmask & PARTIAL_RIGHT_FLAG) { - var partialsRight = partials, - holdersRight = holders; - - partials = holders = null; - } - var data = isBindKey ? null : getData(func), - newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity]; - - if (data) { - mergeData(newData, data); - bitmask = newData[1]; - arity = newData[9]; - } - newData[9] = arity == null - ? (isBindKey ? 0 : func.length) - : (nativeMax(arity - length, 0) || 0); - - if (bitmask == BIND_FLAG) { - var result = createBindWrapper(newData[0], newData[2]); - } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) { - result = createPartialWrapper.apply(undefined, newData); - } else { - result = createHybridWrapper.apply(undefined, newData); - } - var setter = data ? baseSetData : setData; - return setter(result, newData); - } - - /** - * A specialized version of `baseIsEqualDeep` for arrays with support for - * partial deep comparisons. - * - * @private - * @param {Array} array The array to compare. - * @param {Array} other The other array to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparing arrays. - * @param {boolean} [isLoose] Specify performing partial comparisons. - * @param {Array} [stackA] Tracks traversed `value` objects. - * @param {Array} [stackB] Tracks traversed `other` objects. - * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. - */ - function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) { - var index = -1, - arrLength = array.length, - othLength = other.length; - - if (arrLength != othLength && !(isLoose && othLength > arrLength)) { - return false; - } - // Ignore non-index properties. - while (++index < arrLength) { - var arrValue = array[index], - othValue = other[index], - result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined; - - if (result !== undefined) { - if (result) { - continue; - } - return false; - } - // Recursively compare arrays (susceptible to call stack limits). - if (isLoose) { - if (!arraySome(other, function(othValue) { - return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB); - })) { - return false; - } - } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) { - return false; - } - } - return true; - } - - /** - * A specialized version of `baseIsEqualDeep` for comparing objects of - * the same `toStringTag`. - * - * **Note:** This function only supports comparing values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} value The object to compare. - * @param {Object} other The other object to compare. - * @param {string} tag The `toStringTag` of the objects to compare. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalByTag(object, other, tag) { - switch (tag) { - case boolTag: - case dateTag: - // Coerce dates and booleans to numbers, dates to milliseconds and booleans - // to `1` or `0` treating invalid dates coerced to `NaN` as not equal. - return +object == +other; - - case errorTag: - return object.name == other.name && object.message == other.message; - - case numberTag: - // Treat `NaN` vs. `NaN` as equal. - return (object != +object) - ? other != +other - : object == +other; - - case regexpTag: - case stringTag: - // Coerce regexes to strings and treat strings primitives and string - // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details. - return object == (other + ''); - } - return false; - } - - /** - * A specialized version of `baseIsEqualDeep` for objects with support for - * partial deep comparisons. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparing values. - * @param {boolean} [isLoose] Specify performing partial comparisons. - * @param {Array} [stackA] Tracks traversed `value` objects. - * @param {Array} [stackB] Tracks traversed `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) { - var objProps = keys(object), - objLength = objProps.length, - othProps = keys(other), - othLength = othProps.length; - - if (objLength != othLength && !isLoose) { - return false; - } - var index = objLength; - while (index--) { - var key = objProps[index]; - if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) { - return false; - } - } - var skipCtor = isLoose; - while (++index < objLength) { - key = objProps[index]; - var objValue = object[key], - othValue = other[key], - result = customizer ? customizer(isLoose ? othValue : objValue, isLoose? objValue : othValue, key) : undefined; - - // Recursively compare objects (susceptible to call stack limits). - if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) { - return false; - } - skipCtor || (skipCtor = key == 'constructor'); - } - if (!skipCtor) { - var objCtor = object.constructor, - othCtor = other.constructor; - - // Non `Object` object instances with different constructors are not equal. - if (objCtor != othCtor && - ('constructor' in object && 'constructor' in other) && - !(typeof objCtor == 'function' && objCtor instanceof objCtor && - typeof othCtor == 'function' && othCtor instanceof othCtor)) { - return false; - } - } - return true; - } - - /** - * Gets the appropriate "callback" function. If the `_.callback` method is - * customized this function returns the custom method, otherwise it returns - * the `baseCallback` function. If arguments are provided the chosen function - * is invoked with them and its result is returned. - * - * @private - * @returns {Function} Returns the chosen function or its result. - */ - function getCallback(func, thisArg, argCount) { - var result = lodash.callback || callback; - result = result === callback ? baseCallback : result; - return argCount ? result(func, thisArg, argCount) : result; - } - - /** - * Gets metadata for `func`. - * - * @private - * @param {Function} func The function to query. - * @returns {*} Returns the metadata for `func`. - */ - var getData = !metaMap ? noop : function(func) { - return metaMap.get(func); - }; - - /** - * Gets the name of `func`. - * - * @private - * @param {Function} func The function to query. - * @returns {string} Returns the function name. - */ - function getFuncName(func) { - var result = func.name, - array = realNames[result], - length = array ? array.length : 0; - - while (length--) { - var data = array[length], - otherFunc = data.func; - if (otherFunc == null || otherFunc == func) { - return data.name; - } - } - return result; - } - - /** - * Gets the appropriate "indexOf" function. If the `_.indexOf` method is - * customized this function returns the custom method, otherwise it returns - * the `baseIndexOf` function. If arguments are provided the chosen function - * is invoked with them and its result is returned. - * - * @private - * @returns {Function|number} Returns the chosen function or its result. - */ - function getIndexOf(collection, target, fromIndex) { - var result = lodash.indexOf || indexOf; - result = result === indexOf ? baseIndexOf : result; - return collection ? result(collection, target, fromIndex) : result; - } - - /** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ - var getLength = baseProperty('length'); - - /** - * Gets the propery names, values, and compare flags of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the match data of `object`. - */ - function getMatchData(object) { - var result = pairs(object), - length = result.length; - - while (length--) { - result[length][2] = isStrictComparable(result[length][1]); - } - return result; - } - - /** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ - function getNative(object, key) { - var value = object == null ? undefined : object[key]; - return isNative(value) ? value : undefined; - } - - /** - * Gets the view, applying any `transforms` to the `start` and `end` positions. - * - * @private - * @param {number} start The start of the view. - * @param {number} end The end of the view. - * @param {Array} [transforms] The transformations to apply to the view. - * @returns {Object} Returns an object containing the `start` and `end` - * positions of the view. - */ - function getView(start, end, transforms) { - var index = -1, - length = transforms ? transforms.length : 0; - - while (++index < length) { - var data = transforms[index], - size = data.size; - - switch (data.type) { - case 'drop': start += size; break; - case 'dropRight': end -= size; break; - case 'take': end = nativeMin(end, start + size); break; - case 'takeRight': start = nativeMax(start, end - size); break; - } - } - return { 'start': start, 'end': end }; - } - - /** - * Initializes an array clone. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. - */ - function initCloneArray(array) { - var length = array.length, - result = new array.constructor(length); - - // Add array properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; - } - return result; - } - - /** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneObject(object) { - var Ctor = object.constructor; - if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) { - Ctor = Object; - } - return new Ctor; - } - - /** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneByTag(object, tag, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return bufferClone(object); - - case boolTag: - case dateTag: - return new Ctor(+object); - - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - var buffer = object.buffer; - return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length); - - case numberTag: - case stringTag: - return new Ctor(object); - - case regexpTag: - var result = new Ctor(object.source, reFlags.exec(object)); - result.lastIndex = object.lastIndex; - } - return result; - } - - /** - * Invokes the method at `path` on `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the method to invoke. - * @param {Array} args The arguments to invoke the method with. - * @returns {*} Returns the result of the invoked method. - */ - function invokePath(object, path, args) { - if (object != null && !isKey(path, object)) { - path = toPath(path); - object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); - path = last(path); - } - var func = object == null ? object : object[path]; - return func == null ? undefined : func.apply(object, args); - } - - /** - * Checks if `value` is array-like. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - */ - function isArrayLike(value) { - return value != null && isLength(getLength(value)); - } - - /** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ - function isIndex(value, length) { - value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; - } - - /** - * Checks if the provided arguments are from an iteratee call. - * - * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. - */ - function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object)) { - var other = object[index]; - return value === value ? (value === other) : (other !== other); - } - return false; - } - - /** - * Checks if `value` is a property name and not a property path. - * - * @private - * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. - */ - function isKey(value, object) { - var type = typeof value; - if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') { - return true; - } - if (isArray(value)) { - return false; - } - var result = !reIsDeepProp.test(value); - return result || (object != null && value in toObject(object)); - } - - /** - * Checks if `func` has a lazy counterpart. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`. - */ - function isLaziable(func) { - var funcName = getFuncName(func); - if (!(funcName in LazyWrapper.prototype)) { - return false; - } - var other = lodash[funcName]; - if (func === other) { - return true; - } - var data = getData(other); - return !!data && func === data[0]; - } - - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - */ - function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - - /** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. - */ - function isStrictComparable(value) { - return value === value && !isObject(value); - } - - /** - * Merges the function metadata of `source` into `data`. - * - * Merging metadata reduces the number of wrappers required to invoke a function. - * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` - * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg` - * augment function arguments, making the order in which they are executed important, - * preventing the merging of metadata. However, we make an exception for a safe - * common case where curried functions have `_.ary` and or `_.rearg` applied. - * - * @private - * @param {Array} data The destination metadata. - * @param {Array} source The source metadata. - * @returns {Array} Returns `data`. - */ - function mergeData(data, source) { - var bitmask = data[1], - srcBitmask = source[1], - newBitmask = bitmask | srcBitmask, - isCommon = newBitmask < ARY_FLAG; - - var isCombo = - (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) || - (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) || - (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG); - - // Exit early if metadata can't be merged. - if (!(isCommon || isCombo)) { - return data; - } - // Use source `thisArg` if available. - if (srcBitmask & BIND_FLAG) { - data[2] = source[2]; - // Set when currying a bound function. - newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG; - } - // Compose partial arguments. - var value = source[3]; - if (value) { - var partials = data[3]; - data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value); - data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]); - } - // Compose partial right arguments. - value = source[5]; - if (value) { - partials = data[5]; - data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value); - data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]); - } - // Use source `argPos` if available. - value = source[7]; - if (value) { - data[7] = arrayCopy(value); - } - // Use source `ary` if it's smaller. - if (srcBitmask & ARY_FLAG) { - data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); - } - // Use source `arity` if one is not provided. - if (data[9] == null) { - data[9] = source[9]; - } - // Use source `func` and merge bitmasks. - data[0] = source[0]; - data[1] = newBitmask; - - return data; - } - - /** - * A specialized version of `_.pick` which picks `object` properties specified - * by `props`. - * - * @private - * @param {Object} object The source object. - * @param {string[]} props The property names to pick. - * @returns {Object} Returns the new object. - */ - function pickByArray(object, props) { - object = toObject(object); - - var index = -1, - length = props.length, - result = {}; - - while (++index < length) { - var key = props[index]; - if (key in object) { - result[key] = object[key]; - } - } - return result; - } - - /** - * A specialized version of `_.pick` which picks `object` properties `predicate` - * returns truthy for. - * - * @private - * @param {Object} object The source object. - * @param {Function} predicate The function invoked per iteration. - * @returns {Object} Returns the new object. - */ - function pickByCallback(object, predicate) { - var result = {}; - baseForIn(object, function(value, key, object) { - if (predicate(value, key, object)) { - result[key] = value; - } - }); - return result; - } - - /** - * Reorder `array` according to the specified indexes where the element at - * the first index is assigned as the first element, the element at - * the second index is assigned as the second element, and so on. - * - * @private - * @param {Array} array The array to reorder. - * @param {Array} indexes The arranged array indexes. - * @returns {Array} Returns `array`. - */ - function reorder(array, indexes) { - var arrLength = array.length, - length = nativeMin(indexes.length, arrLength), - oldArray = arrayCopy(array); - - while (length--) { - var index = indexes[length]; - array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; - } - return array; - } - - /** - * Sets metadata for `func`. - * - * **Note:** If this function becomes hot, i.e. is invoked a lot in a short - * period of time, it will trip its breaker and transition to an identity function - * to avoid garbage collection pauses in V8. See [V8 issue 2070](https://code.google.com/p/v8/issues/detail?id=2070) - * for more details. - * - * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. - */ - var setData = (function() { - var count = 0, - lastCalled = 0; - - return function(key, value) { - var stamp = now(), - remaining = HOT_SPAN - (stamp - lastCalled); - - lastCalled = stamp; - if (remaining > 0) { - if (++count >= HOT_COUNT) { - return key; - } - } else { - count = 0; - } - return baseSetData(key, value); - }; - }()); - - /** - * A fallback implementation of `_.isPlainObject` which checks if `value` - * is an object created by the `Object` constructor or has a `[[Prototype]]` - * of `null`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - */ - function shimIsPlainObject(value) { - var Ctor, - support = lodash.support; - - // Exit early for non `Object` objects. - if (!(isObjectLike(value) && objToString.call(value) == objectTag) || - (!hasOwnProperty.call(value, 'constructor') && - (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) { - return false; - } - // IE < 9 iterates inherited properties before own properties. If the first - // iterated property is an object's own property then there are no inherited - // enumerable properties. - var result; - // In most environments an object's own properties are iterated before - // its inherited properties. If the last iterated property is an object's - // own property then there are no inherited enumerable properties. - baseForIn(value, function(subValue, key) { - result = key; - }); - return result === undefined || hasOwnProperty.call(value, result); - } - - /** - * A fallback implementation of `Object.keys` which creates an array of the - * own enumerable property names of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function shimKeys(object) { - var props = keysIn(object), - propsLength = props.length, - length = propsLength && object.length; - - var allowIndexes = !!length && isLength(length) && - (isArray(object) || isArguments(object)); - - var index = -1, - result = []; - - while (++index < propsLength) { - var key = props[index]; - if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) { - result.push(key); - } - } - return result; - } - - /** - * Converts `value` to an array-like object if it's not one. - * - * @private - * @param {*} value The value to process. - * @returns {Array|Object} Returns the array-like object. - */ - function toIterable(value) { - if (value == null) { - return []; - } - if (!isArrayLike(value)) { - return values(value); - } - return isObject(value) ? value : Object(value); - } - - /** - * Converts `value` to an object if it's not one. - * - * @private - * @param {*} value The value to process. - * @returns {Object} Returns the object. - */ - function toObject(value) { - return isObject(value) ? value : Object(value); - } - - /** - * Converts `value` to property path array if it's not one. - * - * @private - * @param {*} value The value to process. - * @returns {Array} Returns the property path array. - */ - function toPath(value) { - if (isArray(value)) { - return value; - } - var result = []; - baseToString(value).replace(rePropName, function(match, number, quote, string) { - result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); - }); - return result; - } - - /** - * Creates a clone of `wrapper`. - * - * @private - * @param {Object} wrapper The wrapper to clone. - * @returns {Object} Returns the cloned wrapper. - */ - function wrapperClone(wrapper) { - return wrapper instanceof LazyWrapper - ? wrapper.clone() - : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__)); - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates an array of elements split into groups the length of `size`. - * If `collection` can't be split evenly, the final chunk will be the remaining - * elements. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to process. - * @param {number} [size=1] The length of each chunk. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the new array containing chunks. - * @example - * - * _.chunk(['a', 'b', 'c', 'd'], 2); - * // => [['a', 'b'], ['c', 'd']] - * - * _.chunk(['a', 'b', 'c', 'd'], 3); - * // => [['a', 'b', 'c'], ['d']] - */ - function chunk(array, size, guard) { - if (guard ? isIterateeCall(array, size, guard) : size == null) { - size = 1; - } else { - size = nativeMax(+size || 1, 1); - } - var index = 0, - length = array ? array.length : 0, - resIndex = -1, - result = Array(ceil(length / size)); - - while (index < length) { - result[++resIndex] = baseSlice(array, index, (index += size)); - } - return result; - } - - /** - * Creates an array with all falsey values removed. The values `false`, `null`, - * `0`, `""`, `undefined`, and `NaN` are falsey. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to compact. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.compact([0, 1, false, 2, '', 3]); - * // => [1, 2, 3] - */ - function compact(array) { - var index = -1, - length = array ? array.length : 0, - resIndex = -1, - result = []; - - while (++index < length) { - var value = array[index]; - if (value) { - result[++resIndex] = value; - } - } - return result; - } - - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The arrays of values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.difference([1, 2, 3], [4, 2]); - * // => [1, 3] - */ - var difference = restParam(function(array, values) { - return isArrayLike(array) - ? baseDifference(array, baseFlatten(values, false, true)) - : []; - }); - - /** - * Creates a slice of `array` with `n` elements dropped from the beginning. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.drop([1, 2, 3]); - * // => [2, 3] - * - * _.drop([1, 2, 3], 2); - * // => [3] - * - * _.drop([1, 2, 3], 5); - * // => [] - * - * _.drop([1, 2, 3], 0); - * // => [1, 2, 3] - */ - function drop(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - return baseSlice(array, n < 0 ? 0 : n); - } - - /** - * Creates a slice of `array` with `n` elements dropped from the end. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropRight([1, 2, 3]); - * // => [1, 2] - * - * _.dropRight([1, 2, 3], 2); - * // => [1] - * - * _.dropRight([1, 2, 3], 5); - * // => [] - * - * _.dropRight([1, 2, 3], 0); - * // => [1, 2, 3] - */ - function dropRight(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - n = length - (+n || 0); - return baseSlice(array, 0, n < 0 ? 0 : n); - } - - /** - * Creates a slice of `array` excluding elements dropped from the end. - * Elements are dropped until `predicate` returns falsey. The predicate is - * bound to `thisArg` and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that match the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropRightWhile([1, 2, 3], function(n) { - * return n > 1; - * }); - * // => [1] - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.dropRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user'); - * // => ['barney', 'fred'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.dropRightWhile(users, 'active', false), 'user'); - * // => ['barney'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.dropRightWhile(users, 'active'), 'user'); - * // => ['barney', 'fred', 'pebbles'] - */ - function dropRightWhile(array, predicate, thisArg) { - return (array && array.length) - ? baseWhile(array, getCallback(predicate, thisArg, 3), true, true) - : []; - } - - /** - * Creates a slice of `array` excluding elements dropped from the beginning. - * Elements are dropped until `predicate` returns falsey. The predicate is - * bound to `thisArg` and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropWhile([1, 2, 3], function(n) { - * return n < 3; - * }); - * // => [3] - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.dropWhile(users, { 'user': 'barney', 'active': false }), 'user'); - * // => ['fred', 'pebbles'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.dropWhile(users, 'active', false), 'user'); - * // => ['pebbles'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.dropWhile(users, 'active'), 'user'); - * // => ['barney', 'fred', 'pebbles'] - */ - function dropWhile(array, predicate, thisArg) { - return (array && array.length) - ? baseWhile(array, getCallback(predicate, thisArg, 3), true) - : []; - } - - /** - * Fills elements of `array` with `value` from `start` up to, but not - * including, `end`. - * - * **Note:** This method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.fill(array, 'a'); - * console.log(array); - * // => ['a', 'a', 'a'] - * - * _.fill(Array(3), 2); - * // => [2, 2, 2] - * - * _.fill([4, 6, 8], '*', 1, 2); - * // => [4, '*', 8] - */ - function fill(array, value, start, end) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { - start = 0; - end = length; - } - return baseFill(array, value, start, end); - } - - /** - * This method is like `_.find` except that it returns the index of the first - * element `predicate` returns truthy for instead of the element itself. - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.findIndex(users, function(chr) { - * return chr.user == 'barney'; - * }); - * // => 0 - * - * // using the `_.matches` callback shorthand - * _.findIndex(users, { 'user': 'fred', 'active': false }); - * // => 1 - * - * // using the `_.matchesProperty` callback shorthand - * _.findIndex(users, 'active', false); - * // => 0 - * - * // using the `_.property` callback shorthand - * _.findIndex(users, 'active'); - * // => 2 - */ - var findIndex = createFindIndex(); - - /** - * This method is like `_.findIndex` except that it iterates over elements - * of `collection` from right to left. - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.findLastIndex(users, function(chr) { - * return chr.user == 'pebbles'; - * }); - * // => 2 - * - * // using the `_.matches` callback shorthand - * _.findLastIndex(users, { 'user': 'barney', 'active': true }); - * // => 0 - * - * // using the `_.matchesProperty` callback shorthand - * _.findLastIndex(users, 'active', false); - * // => 2 - * - * // using the `_.property` callback shorthand - * _.findLastIndex(users, 'active'); - * // => 0 - */ - var findLastIndex = createFindIndex(true); - - /** - * Gets the first element of `array`. - * - * @static - * @memberOf _ - * @alias head - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the first element of `array`. - * @example - * - * _.first([1, 2, 3]); - * // => 1 - * - * _.first([]); - * // => undefined - */ - function first(array) { - return array ? array[0] : undefined; - } - - /** - * Flattens a nested array. If `isDeep` is `true` the array is recursively - * flattened, otherwise it is only flattened a single level. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to flatten. - * @param {boolean} [isDeep] Specify a deep flatten. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flatten([1, [2, 3, [4]]]); - * // => [1, 2, 3, [4]] - * - * // using `isDeep` - * _.flatten([1, [2, 3, [4]]], true); - * // => [1, 2, 3, 4] - */ - function flatten(array, isDeep, guard) { - var length = array ? array.length : 0; - if (guard && isIterateeCall(array, isDeep, guard)) { - isDeep = false; - } - return length ? baseFlatten(array, isDeep) : []; - } - - /** - * Recursively flattens a nested array. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to recursively flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flattenDeep([1, [2, 3, [4]]]); - * // => [1, 2, 3, 4] - */ - function flattenDeep(array) { - var length = array ? array.length : 0; - return length ? baseFlatten(array, true) : []; - } - - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it is used as the offset - * from the end of `array`. If `array` is sorted providing `true` for `fromIndex` - * performs a faster binary search. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {boolean|number} [fromIndex=0] The index to search from or `true` - * to perform a binary search on a sorted array. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - * - * // performing a binary search - * _.indexOf([1, 1, 2, 2], 2, true); - * // => 2 - */ - function indexOf(array, value, fromIndex) { - var length = array ? array.length : 0; - if (!length) { - return -1; - } - if (typeof fromIndex == 'number') { - fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex; - } else if (fromIndex) { - var index = binaryIndex(array, value), - other = array[index]; - - if (value === value ? (value === other) : (other !== other)) { - return index; - } - return -1; - } - return baseIndexOf(array, value, fromIndex || 0); - } - - /** - * Gets all but the last element of `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.initial([1, 2, 3]); - * // => [1, 2] - */ - function initial(array) { - return dropRight(array, 1); - } - - /** - * Creates an array of unique values that are included in all of the provided - * arrays using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of shared values. - * @example - * _.intersection([1, 2], [4, 2], [2, 1]); - * // => [2] - */ - var intersection = restParam(function(arrays) { - var othLength = arrays.length, - othIndex = othLength, - caches = Array(length), - indexOf = getIndexOf(), - isCommon = indexOf == baseIndexOf, - result = []; - - while (othIndex--) { - var value = arrays[othIndex] = isArrayLike(value = arrays[othIndex]) ? value : []; - caches[othIndex] = (isCommon && value.length >= 120) ? createCache(othIndex && value) : null; - } - var array = arrays[0], - index = -1, - length = array ? array.length : 0, - seen = caches[0]; - - outer: - while (++index < length) { - value = array[index]; - if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value, 0)) < 0) { - var othIndex = othLength; - while (--othIndex) { - var cache = caches[othIndex]; - if ((cache ? cacheIndexOf(cache, value) : indexOf(arrays[othIndex], value, 0)) < 0) { - continue outer; - } - } - if (seen) { - seen.push(value); - } - result.push(value); - } - } - return result; - }); - - /** - * Gets the last element of `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the last element of `array`. - * @example - * - * _.last([1, 2, 3]); - * // => 3 - */ - function last(array) { - var length = array ? array.length : 0; - return length ? array[length - 1] : undefined; - } - - /** - * This method is like `_.indexOf` except that it iterates over elements of - * `array` from right to left. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {boolean|number} [fromIndex=array.length-1] The index to search from - * or `true` to perform a binary search on a sorted array. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.lastIndexOf([1, 2, 1, 2], 2); - * // => 3 - * - * // using `fromIndex` - * _.lastIndexOf([1, 2, 1, 2], 2, 2); - * // => 1 - * - * // performing a binary search - * _.lastIndexOf([1, 1, 2, 2], 2, true); - * // => 3 - */ - function lastIndexOf(array, value, fromIndex) { - var length = array ? array.length : 0; - if (!length) { - return -1; - } - var index = length; - if (typeof fromIndex == 'number') { - index = (fromIndex < 0 ? nativeMax(length + fromIndex, 0) : nativeMin(fromIndex || 0, length - 1)) + 1; - } else if (fromIndex) { - index = binaryIndex(array, value, true) - 1; - var other = array[index]; - if (value === value ? (value === other) : (other !== other)) { - return index; - } - return -1; - } - if (value !== value) { - return indexOfNaN(array, index, true); - } - while (index--) { - if (array[index] === value) { - return index; - } - } - return -1; - } - - /** - * Removes all provided values from `array` using - * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. - * - * **Note:** Unlike `_.without`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {...*} [values] The values to remove. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * - * _.pull(array, 2, 3); - * console.log(array); - * // => [1, 1] - */ - function pull() { - var args = arguments, - array = args[0]; - - if (!(array && array.length)) { - return array; - } - var index = 0, - indexOf = getIndexOf(), - length = args.length; - - while (++index < length) { - var fromIndex = 0, - value = args[index]; - - while ((fromIndex = indexOf(array, value, fromIndex)) > -1) { - splice.call(array, fromIndex, 1); - } - } - return array; - } - - /** - * Removes elements from `array` corresponding to the given indexes and returns - * an array of the removed elements. Indexes may be specified as an array of - * indexes or as individual arguments. - * - * **Note:** Unlike `_.at`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {...(number|number[])} [indexes] The indexes of elements to remove, - * specified as individual indexes or arrays of indexes. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = [5, 10, 15, 20]; - * var evens = _.pullAt(array, 1, 3); - * - * console.log(array); - * // => [5, 15] - * - * console.log(evens); - * // => [10, 20] - */ - var pullAt = restParam(function(array, indexes) { - indexes = baseFlatten(indexes); - - var result = baseAt(array, indexes); - basePullAt(array, indexes.sort(baseCompareAscending)); - return result; - }); - - /** - * Removes all elements from `array` that `predicate` returns truthy for - * and returns an array of the removed elements. The predicate is bound to - * `thisArg` and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * **Note:** Unlike `_.filter`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = [1, 2, 3, 4]; - * var evens = _.remove(array, function(n) { - * return n % 2 == 0; - * }); - * - * console.log(array); - * // => [1, 3] - * - * console.log(evens); - * // => [2, 4] - */ - function remove(array, predicate, thisArg) { - var result = []; - if (!(array && array.length)) { - return result; - } - var index = -1, - indexes = [], - length = array.length; - - predicate = getCallback(predicate, thisArg, 3); - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result.push(value); - indexes.push(index); - } - } - basePullAt(array, indexes); - return result; - } - - /** - * Gets all but the first element of `array`. - * - * @static - * @memberOf _ - * @alias tail - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.rest([1, 2, 3]); - * // => [2, 3] - */ - function rest(array) { - return drop(array, 1); - } - - /** - * Creates a slice of `array` from `start` up to, but not including, `end`. - * - * **Note:** This method is used instead of `Array#slice` to support node - * lists in IE < 9 and to ensure dense arrays are returned. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function slice(array, start, end) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { - start = 0; - end = length; - } - return baseSlice(array, start, end); - } - - /** - * Uses a binary search to determine the lowest index at which `value` should - * be inserted into `array` in order to maintain its sort order. If an iteratee - * function is provided it is invoked for `value` and each element of `array` - * to compute their sort ranking. The iteratee is bound to `thisArg` and - * invoked with one argument; (value). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - * - * _.sortedIndex([4, 4, 5, 5], 5); - * // => 2 - * - * var dict = { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } }; - * - * // using an iteratee function - * _.sortedIndex(['thirty', 'fifty'], 'forty', function(word) { - * return this.data[word]; - * }, dict); - * // => 1 - * - * // using the `_.property` callback shorthand - * _.sortedIndex([{ 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); - * // => 1 - */ - var sortedIndex = createSortedIndex(); - - /** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * _.sortedLastIndex([4, 4, 5, 5], 5); - * // => 4 - */ - var sortedLastIndex = createSortedIndex(true); - - /** - * Creates a slice of `array` with `n` elements taken from the beginning. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.take([1, 2, 3]); - * // => [1] - * - * _.take([1, 2, 3], 2); - * // => [1, 2] - * - * _.take([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.take([1, 2, 3], 0); - * // => [] - */ - function take(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - return baseSlice(array, 0, n < 0 ? 0 : n); - } - - /** - * Creates a slice of `array` with `n` elements taken from the end. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeRight([1, 2, 3]); - * // => [3] - * - * _.takeRight([1, 2, 3], 2); - * // => [2, 3] - * - * _.takeRight([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.takeRight([1, 2, 3], 0); - * // => [] - */ - function takeRight(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - n = length - (+n || 0); - return baseSlice(array, n < 0 ? 0 : n); - } - - /** - * Creates a slice of `array` with elements taken from the end. Elements are - * taken until `predicate` returns falsey. The predicate is bound to `thisArg` - * and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeRightWhile([1, 2, 3], function(n) { - * return n > 1; - * }); - * // => [2, 3] - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.takeRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user'); - * // => ['pebbles'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.takeRightWhile(users, 'active', false), 'user'); - * // => ['fred', 'pebbles'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.takeRightWhile(users, 'active'), 'user'); - * // => [] - */ - function takeRightWhile(array, predicate, thisArg) { - return (array && array.length) - ? baseWhile(array, getCallback(predicate, thisArg, 3), false, true) - : []; - } - - /** - * Creates a slice of `array` with elements taken from the beginning. Elements - * are taken until `predicate` returns falsey. The predicate is bound to - * `thisArg` and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeWhile([1, 2, 3], function(n) { - * return n < 3; - * }); - * // => [1, 2] - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false}, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.takeWhile(users, { 'user': 'barney', 'active': false }), 'user'); - * // => ['barney'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.takeWhile(users, 'active', false), 'user'); - * // => ['barney', 'fred'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.takeWhile(users, 'active'), 'user'); - * // => [] - */ - function takeWhile(array, predicate, thisArg) { - return (array && array.length) - ? baseWhile(array, getCallback(predicate, thisArg, 3)) - : []; - } - - /** - * Creates an array of unique values, in order, from all of the provided arrays - * using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of combined values. - * @example - * - * _.union([1, 2], [4, 2], [2, 1]); - * // => [1, 2, 4] - */ - var union = restParam(function(arrays) { - return baseUniq(baseFlatten(arrays, false, true)); - }); - - /** - * Creates a duplicate-free version of an array, using - * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons, in which only the first occurence of each element - * is kept. Providing `true` for `isSorted` performs a faster search algorithm - * for sorted arrays. If an iteratee function is provided it is invoked for - * each element in the array to generate the criterion by which uniqueness - * is computed. The `iteratee` is bound to `thisArg` and invoked with three - * arguments: (value, index, array). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias unique - * @category Array - * @param {Array} array The array to inspect. - * @param {boolean} [isSorted] Specify the array is sorted. - * @param {Function|Object|string} [iteratee] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new duplicate-value-free array. - * @example - * - * _.uniq([2, 1, 2]); - * // => [2, 1] - * - * // using `isSorted` - * _.uniq([1, 1, 2], true); - * // => [1, 2] - * - * // using an iteratee function - * _.uniq([1, 2.5, 1.5, 2], function(n) { - * return this.floor(n); - * }, Math); - * // => [1, 2.5] - * - * // using the `_.property` callback shorthand - * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - function uniq(array, isSorted, iteratee, thisArg) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (isSorted != null && typeof isSorted != 'boolean') { - thisArg = iteratee; - iteratee = isIterateeCall(array, isSorted, thisArg) ? null : isSorted; - isSorted = false; - } - var callback = getCallback(); - if (!(iteratee == null && callback === baseCallback)) { - iteratee = callback(iteratee, thisArg, 3); - } - return (isSorted && getIndexOf() == baseIndexOf) - ? sortedUniq(array, iteratee) - : baseUniq(array, iteratee); - } - - /** - * This method is like `_.zip` except that it accepts an array of grouped - * elements and creates an array regrouping the elements to their pre-zip - * configuration. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array of grouped elements to process. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]); - * // => [['fred', 30, true], ['barney', 40, false]] - * - * _.unzip(zipped); - * // => [['fred', 'barney'], [30, 40], [true, false]] - */ - function unzip(array) { - if (!(array && array.length)) { - return []; - } - var index = -1, - length = 0; - - array = arrayFilter(array, function(group) { - if (isArrayLike(group)) { - length = nativeMax(group.length, length); - return true; - } - }); - var result = Array(length); - while (++index < length) { - result[index] = arrayMap(array, baseProperty(index)); - } - return result; - } - - /** - * This method is like `_.unzip` except that it accepts an iteratee to specify - * how regrouped values should be combined. The `iteratee` is bound to `thisArg` - * and invoked with four arguments: (accumulator, value, index, group). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array of grouped elements to process. - * @param {Function} [iteratee] The function to combine regrouped values. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip([1, 2], [10, 20], [100, 200]); - * // => [[1, 10, 100], [2, 20, 200]] - * - * _.unzipWith(zipped, _.add); - * // => [3, 30, 300] - */ - function unzipWith(array, iteratee, thisArg) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - var result = unzip(array); - if (iteratee == null) { - return result; - } - iteratee = bindCallback(iteratee, thisArg, 4); - return arrayMap(result, function(group) { - return arrayReduce(group, iteratee, undefined, true); - }); - } - - /** - * Creates an array excluding all provided values using - * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to filter. - * @param {...*} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.without([1, 2, 1, 3], 1, 2); - * // => [3] - */ - var without = restParam(function(array, values) { - return isArrayLike(array) - ? baseDifference(array, values) - : []; - }); - - /** - * Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) - * of the provided arrays. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of values. - * @example - * - * _.xor([1, 2], [4, 2]); - * // => [1, 4] - */ - function xor() { - var index = -1, - length = arguments.length; - - while (++index < length) { - var array = arguments[index]; - if (isArrayLike(array)) { - var result = result - ? baseDifference(result, array).concat(baseDifference(array, result)) - : array; - } - } - return result ? baseUniq(result) : []; - } - - /** - * Creates an array of grouped elements, the first of which contains the first - * elements of the given arrays, the second of which contains the second elements - * of the given arrays, and so on. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @returns {Array} Returns the new array of grouped elements. - * @example - * - * _.zip(['fred', 'barney'], [30, 40], [true, false]); - * // => [['fred', 30, true], ['barney', 40, false]] - */ - var zip = restParam(unzip); - - /** - * The inverse of `_.pairs`; this method returns an object composed from arrays - * of property names and values. Provide either a single two dimensional array, - * e.g. `[[key1, value1], [key2, value2]]` or two arrays, one of property names - * and one of corresponding values. - * - * @static - * @memberOf _ - * @alias object - * @category Array - * @param {Array} props The property names. - * @param {Array} [values=[]] The property values. - * @returns {Object} Returns the new object. - * @example - * - * _.zipObject([['fred', 30], ['barney', 40]]); - * // => { 'fred': 30, 'barney': 40 } - * - * _.zipObject(['fred', 'barney'], [30, 40]); - * // => { 'fred': 30, 'barney': 40 } - */ - function zipObject(props, values) { - var index = -1, - length = props ? props.length : 0, - result = {}; - - if (length && !values && !isArray(props[0])) { - values = []; - } - while (++index < length) { - var key = props[index]; - if (values) { - result[key] = values[index]; - } else if (key) { - result[key[0]] = key[1]; - } - } - return result; - } - - /** - * This method is like `_.zip` except that it accepts an iteratee to specify - * how grouped values should be combined. The `iteratee` is bound to `thisArg` - * and invoked with four arguments: (accumulator, value, index, group). - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @param {Function} [iteratee] The function to combine grouped values. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new array of grouped elements. - * @example - * - * _.zipWith([1, 2], [10, 20], [100, 200], _.add); - * // => [111, 222] - */ - var zipWith = restParam(function(arrays) { - var length = arrays.length, - iteratee = length > 2 ? arrays[length - 2] : undefined, - thisArg = length > 1 ? arrays[length - 1] : undefined; - - if (length > 2 && typeof iteratee == 'function') { - length -= 2; - } else { - iteratee = (length > 1 && typeof thisArg == 'function') ? (--length, thisArg) : undefined; - thisArg = undefined; - } - arrays.length = length; - return unzipWith(arrays, iteratee, thisArg); - }); - - /*------------------------------------------------------------------------*/ - - /** - * Creates a `lodash` object that wraps `value` with explicit method - * chaining enabled. - * - * @static - * @memberOf _ - * @category Chain - * @param {*} value The value to wrap. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'pebbles', 'age': 1 } - * ]; - * - * var youngest = _.chain(users) - * .sortBy('age') - * .map(function(chr) { - * return chr.user + ' is ' + chr.age; - * }) - * .first() - * .value(); - * // => 'pebbles is 1' - */ - function chain(value) { - var result = lodash(value); - result.__chain__ = true; - return result; - } - - /** - * This method invokes `interceptor` and returns `value`. The interceptor is - * bound to `thisArg` and invoked with one argument; (value). The purpose of - * this method is to "tap into" a method chain in order to perform operations - * on intermediate results within the chain. - * - * @static - * @memberOf _ - * @category Chain - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @param {*} [thisArg] The `this` binding of `interceptor`. - * @returns {*} Returns `value`. - * @example - * - * _([1, 2, 3]) - * .tap(function(array) { - * array.pop(); - * }) - * .reverse() - * .value(); - * // => [2, 1] - */ - function tap(value, interceptor, thisArg) { - interceptor.call(thisArg, value); - return value; - } - - /** - * This method is like `_.tap` except that it returns the result of `interceptor`. - * - * @static - * @memberOf _ - * @category Chain - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @param {*} [thisArg] The `this` binding of `interceptor`. - * @returns {*} Returns the result of `interceptor`. - * @example - * - * _(' abc ') - * .chain() - * .trim() - * .thru(function(value) { - * return [value]; - * }) - * .value(); - * // => ['abc'] - */ - function thru(value, interceptor, thisArg) { - return interceptor.call(thisArg, value); - } - - /** - * Enables explicit method chaining on the wrapper object. - * - * @name chain - * @memberOf _ - * @category Chain - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // without explicit chaining - * _(users).first(); - * // => { 'user': 'barney', 'age': 36 } - * - * // with explicit chaining - * _(users).chain() - * .first() - * .pick('user') - * .value(); - * // => { 'user': 'barney' } - */ - function wrapperChain() { - return chain(this); - } - - /** - * Executes the chained sequence and returns the wrapped result. - * - * @name commit - * @memberOf _ - * @category Chain - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2]; - * var wrapper = _(array).push(3); - * - * console.log(array); - * // => [1, 2] - * - * wrapper = wrapper.commit(); - * console.log(array); - * // => [1, 2, 3] - * - * wrapper.last(); - * // => 3 - * - * console.log(array); - * // => [1, 2, 3] - */ - function wrapperCommit() { - return new LodashWrapper(this.value(), this.__chain__); - } - - /** - * Creates a clone of the chained sequence planting `value` as the wrapped value. - * - * @name plant - * @memberOf _ - * @category Chain - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2]; - * var wrapper = _(array).map(function(value) { - * return Math.pow(value, 2); - * }); - * - * var other = [3, 4]; - * var otherWrapper = wrapper.plant(other); - * - * otherWrapper.value(); - * // => [9, 16] - * - * wrapper.value(); - * // => [1, 4] - */ - function wrapperPlant(value) { - var result, - parent = this; - - while (parent instanceof baseLodash) { - var clone = wrapperClone(parent); - if (result) { - previous.__wrapped__ = clone; - } else { - result = clone; - } - var previous = clone; - parent = parent.__wrapped__; - } - previous.__wrapped__ = value; - return result; - } - - /** - * Reverses the wrapped array so the first element becomes the last, the - * second element becomes the second to last, and so on. - * - * **Note:** This method mutates the wrapped array. - * - * @name reverse - * @memberOf _ - * @category Chain - * @returns {Object} Returns the new reversed `lodash` wrapper instance. - * @example - * - * var array = [1, 2, 3]; - * - * _(array).reverse().value() - * // => [3, 2, 1] - * - * console.log(array); - * // => [3, 2, 1] - */ - function wrapperReverse() { - var value = this.__wrapped__; - if (value instanceof LazyWrapper) { - if (this.__actions__.length) { - value = new LazyWrapper(this); - } - return new LodashWrapper(value.reverse(), this.__chain__); - } - return this.thru(function(value) { - return value.reverse(); - }); - } - - /** - * Produces the result of coercing the unwrapped value to a string. - * - * @name toString - * @memberOf _ - * @category Chain - * @returns {string} Returns the coerced string value. - * @example - * - * _([1, 2, 3]).toString(); - * // => '1,2,3' - */ - function wrapperToString() { - return (this.value() + ''); - } - - /** - * Executes the chained sequence to extract the unwrapped value. - * - * @name value - * @memberOf _ - * @alias run, toJSON, valueOf - * @category Chain - * @returns {*} Returns the resolved unwrapped value. - * @example - * - * _([1, 2, 3]).value(); - * // => [1, 2, 3] - */ - function wrapperValue() { - return baseWrapperValue(this.__wrapped__, this.__actions__); - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates an array of elements corresponding to the given keys, or indexes, - * of `collection`. Keys may be specified as individual arguments or as arrays - * of keys. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {...(number|number[]|string|string[])} [props] The property names - * or indexes of elements to pick, specified individually or in arrays. - * @returns {Array} Returns the new array of picked elements. - * @example - * - * _.at(['a', 'b', 'c'], [0, 2]); - * // => ['a', 'c'] - * - * _.at(['barney', 'fred', 'pebbles'], 0, 2); - * // => ['barney', 'pebbles'] - */ - var at = restParam(function(collection, props) { - return baseAt(collection, baseFlatten(props)); - }); - - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is the number of times the key was returned by `iteratee`. - * The `iteratee` is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.countBy([4.3, 6.1, 6.4], function(n) { - * return Math.floor(n); - * }); - * // => { '4': 1, '6': 2 } - * - * _.countBy([4.3, 6.1, 6.4], function(n) { - * return this.floor(n); - * }, Math); - * // => { '4': 1, '6': 2 } - * - * _.countBy(['one', 'two', 'three'], 'length'); - * // => { '3': 2, '5': 1 } - */ - var countBy = createAggregator(function(result, value, key) { - hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1); - }); - - /** - * Checks if `predicate` returns truthy for **all** elements of `collection`. - * The predicate is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias all - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - * @example - * - * _.every([true, 1, null, 'yes'], Boolean); - * // => false - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.every(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // using the `_.matchesProperty` callback shorthand - * _.every(users, 'active', false); - * // => true - * - * // using the `_.property` callback shorthand - * _.every(users, 'active'); - * // => false - */ - function every(collection, predicate, thisArg) { - var func = isArray(collection) ? arrayEvery : baseEvery; - if (thisArg && isIterateeCall(collection, predicate, thisArg)) { - predicate = null; - } - if (typeof predicate != 'function' || thisArg !== undefined) { - predicate = getCallback(predicate, thisArg, 3); - } - return func(collection, predicate); - } - - /** - * Iterates over elements of `collection`, returning an array of all elements - * `predicate` returns truthy for. The predicate is bound to `thisArg` and - * invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias select - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the new filtered array. - * @example - * - * _.filter([4, 5, 6], function(n) { - * return n % 2 == 0; - * }); - * // => [4, 6] - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user'); - * // => ['barney'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.filter(users, 'active', false), 'user'); - * // => ['fred'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.filter(users, 'active'), 'user'); - * // => ['barney'] - */ - function filter(collection, predicate, thisArg) { - var func = isArray(collection) ? arrayFilter : baseFilter; - predicate = getCallback(predicate, thisArg, 3); - return func(collection, predicate); - } - - /** - * Iterates over elements of `collection`, returning the first element - * `predicate` returns truthy for. The predicate is bound to `thisArg` and - * invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias detect - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false }, - * { 'user': 'pebbles', 'age': 1, 'active': true } - * ]; - * - * _.result(_.find(users, function(chr) { - * return chr.age < 40; - * }), 'user'); - * // => 'barney' - * - * // using the `_.matches` callback shorthand - * _.result(_.find(users, { 'age': 1, 'active': true }), 'user'); - * // => 'pebbles' - * - * // using the `_.matchesProperty` callback shorthand - * _.result(_.find(users, 'active', false), 'user'); - * // => 'fred' - * - * // using the `_.property` callback shorthand - * _.result(_.find(users, 'active'), 'user'); - * // => 'barney' - */ - var find = createFind(baseEach); - - /** - * This method is like `_.find` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * _.findLast([1, 2, 3, 4], function(n) { - * return n % 2 == 1; - * }); - * // => 3 - */ - var findLast = createFind(baseEachRight, true); - - /** - * Performs a deep comparison between each element in `collection` and the - * source object, returning the first element that has equivalent property - * values. - * - * **Note:** This method supports comparing arrays, booleans, `Date` objects, - * numbers, `Object` objects, regexes, and strings. Objects are compared by - * their own, not inherited, enumerable properties. For comparing a single - * own or inherited property value see `_.matchesProperty`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Object} source The object of property values to match. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * _.result(_.findWhere(users, { 'age': 36, 'active': true }), 'user'); - * // => 'barney' - * - * _.result(_.findWhere(users, { 'age': 40, 'active': false }), 'user'); - * // => 'fred' - */ - function findWhere(collection, source) { - return find(collection, baseMatches(source)); - } - - /** - * Iterates over elements of `collection` invoking `iteratee` for each element. - * The `iteratee` is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early - * by explicitly returning `false`. - * - * **Note:** As with other "Collections" methods, objects with a "length" property - * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn` - * may be used for object iteration. - * - * @static - * @memberOf _ - * @alias each - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array|Object|string} Returns `collection`. - * @example - * - * _([1, 2]).forEach(function(n) { - * console.log(n); - * }).value(); - * // => logs each value from left to right and returns the array - * - * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) { - * console.log(n, key); - * }); - * // => logs each value-key pair and returns the object (iteration order is not guaranteed) - */ - var forEach = createForEach(arrayEach, baseEach); - - /** - * This method is like `_.forEach` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @alias eachRight - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array|Object|string} Returns `collection`. - * @example - * - * _([1, 2]).forEachRight(function(n) { - * console.log(n); - * }).value(); - * // => logs each value from right to left and returns the array - */ - var forEachRight = createForEach(arrayEachRight, baseEachRight); - - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is an array of the elements responsible for generating the key. - * The `iteratee` is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.groupBy([4.2, 6.1, 6.4], function(n) { - * return Math.floor(n); - * }); - * // => { '4': [4.2], '6': [6.1, 6.4] } - * - * _.groupBy([4.2, 6.1, 6.4], function(n) { - * return this.floor(n); - * }, Math); - * // => { '4': [4.2], '6': [6.1, 6.4] } - * - * // using the `_.property` callback shorthand - * _.groupBy(['one', 'two', 'three'], 'length'); - * // => { '3': ['one', 'two'], '5': ['three'] } - */ - var groupBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - result[key].push(value); - } else { - result[key] = [value]; - } - }); - - /** - * Checks if `value` is in `collection` using - * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it is used as the offset - * from the end of `collection`. - * - * @static - * @memberOf _ - * @alias contains, include - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {*} target The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`. - * @returns {boolean} Returns `true` if a matching element is found, else `false`. - * @example - * - * _.includes([1, 2, 3], 1); - * // => true - * - * _.includes([1, 2, 3], 1, 2); - * // => false - * - * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); - * // => true - * - * _.includes('pebbles', 'eb'); - * // => true - */ - function includes(collection, target, fromIndex, guard) { - var length = collection ? getLength(collection) : 0; - if (!isLength(length)) { - collection = values(collection); - length = collection.length; - } - if (!length) { - return false; - } - if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) { - fromIndex = 0; - } else { - fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0); - } - return (typeof collection == 'string' || !isArray(collection) && isString(collection)) - ? (fromIndex < length && collection.indexOf(target, fromIndex) > -1) - : (getIndexOf(collection, target, fromIndex) > -1); - } - - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is the last element responsible for generating the key. The - * iteratee function is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * var keyData = [ - * { 'dir': 'left', 'code': 97 }, - * { 'dir': 'right', 'code': 100 } - * ]; - * - * _.indexBy(keyData, 'dir'); - * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } - * - * _.indexBy(keyData, function(object) { - * return String.fromCharCode(object.code); - * }); - * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } - * - * _.indexBy(keyData, function(object) { - * return this.fromCharCode(object.code); - * }, String); - * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } - */ - var indexBy = createAggregator(function(result, value, key) { - result[key] = value; - }); - - /** - * Invokes the method at `path` of each element in `collection`, returning - * an array of the results of each invoked method. Any additional arguments - * are provided to each invoked method. If `methodName` is a function it is - * invoked for, and `this` bound to, each element in `collection`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Array|Function|string} path The path of the method to invoke or - * the function invoked per iteration. - * @param {...*} [args] The arguments to invoke the method with. - * @returns {Array} Returns the array of results. - * @example - * - * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); - * // => [[1, 5, 7], [1, 2, 3]] - * - * _.invoke([123, 456], String.prototype.split, ''); - * // => [['1', '2', '3'], ['4', '5', '6']] - */ - var invoke = restParam(function(collection, path, args) { - var index = -1, - isFunc = typeof path == 'function', - isProp = isKey(path), - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value) { - var func = isFunc ? path : ((isProp && value != null) ? value[path] : null); - result[++index] = func ? func.apply(value, args) : invokePath(value, path, args); - }); - return result; - }); - - /** - * Creates an array of values by running each element in `collection` through - * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three - * arguments: (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. - * - * The guarded methods are: - * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`, - * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`, - * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`, - * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`, - * `sum`, `uniq`, and `words` - * - * @static - * @memberOf _ - * @alias collect - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new mapped array. - * @example - * - * function timesThree(n) { - * return n * 3; - * } - * - * _.map([1, 2], timesThree); - * // => [3, 6] - * - * _.map({ 'a': 1, 'b': 2 }, timesThree); - * // => [3, 6] (iteration order is not guaranteed) - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * // using the `_.property` callback shorthand - * _.map(users, 'user'); - * // => ['barney', 'fred'] - */ - function map(collection, iteratee, thisArg) { - var func = isArray(collection) ? arrayMap : baseMap; - iteratee = getCallback(iteratee, thisArg, 3); - return func(collection, iteratee); - } - - /** - * Creates an array of elements split into two groups, the first of which - * contains elements `predicate` returns truthy for, while the second of which - * contains elements `predicate` returns falsey for. The predicate is bound - * to `thisArg` and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the array of grouped elements. - * @example - * - * _.partition([1, 2, 3], function(n) { - * return n % 2; - * }); - * // => [[1, 3], [2]] - * - * _.partition([1.2, 2.3, 3.4], function(n) { - * return this.floor(n) % 2; - * }, Math); - * // => [[1.2, 3.4], [2.3]] - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true }, - * { 'user': 'pebbles', 'age': 1, 'active': false } - * ]; - * - * var mapper = function(array) { - * return _.pluck(array, 'user'); - * }; - * - * // using the `_.matches` callback shorthand - * _.map(_.partition(users, { 'age': 1, 'active': false }), mapper); - * // => [['pebbles'], ['barney', 'fred']] - * - * // using the `_.matchesProperty` callback shorthand - * _.map(_.partition(users, 'active', false), mapper); - * // => [['barney', 'pebbles'], ['fred']] - * - * // using the `_.property` callback shorthand - * _.map(_.partition(users, 'active'), mapper); - * // => [['fred'], ['barney', 'pebbles']] - */ - var partition = createAggregator(function(result, value, key) { - result[key ? 0 : 1].push(value); - }, function() { return [[], []]; }); - - /** - * Gets the property value of `path` from all elements in `collection`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Array|string} path The path of the property to pluck. - * @returns {Array} Returns the property values. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * _.pluck(users, 'user'); - * // => ['barney', 'fred'] - * - * var userIndex = _.indexBy(users, 'user'); - * _.pluck(userIndex, 'age'); - * // => [36, 40] (iteration order is not guaranteed) - */ - function pluck(collection, path) { - return map(collection, property(path)); - } - - /** - * Reduces `collection` to a value which is the accumulated result of running - * each element in `collection` through `iteratee`, where each successive - * invocation is supplied the return value of the previous. If `accumulator` - * is not provided the first element of `collection` is used as the initial - * value. The `iteratee` is bound to `thisArg` and invoked with four arguments: - * (accumulator, value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.reduce`, `_.reduceRight`, and `_.transform`. - * - * The guarded methods are: - * `assign`, `defaults`, `includes`, `merge`, `sortByAll`, and `sortByOrder` - * - * @static - * @memberOf _ - * @alias foldl, inject - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {*} Returns the accumulated value. - * @example - * - * _.reduce([1, 2], function(total, n) { - * return total + n; - * }); - * // => 3 - * - * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) { - * result[key] = n * 3; - * return result; - * }, {}); - * // => { 'a': 3, 'b': 6 } (iteration order is not guaranteed) - */ - var reduce = createReduce(arrayReduce, baseEach); - - /** - * This method is like `_.reduce` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @alias foldr - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {*} Returns the accumulated value. - * @example - * - * var array = [[0, 1], [2, 3], [4, 5]]; - * - * _.reduceRight(array, function(flattened, other) { - * return flattened.concat(other); - * }, []); - * // => [4, 5, 2, 3, 0, 1] - */ - var reduceRight = createReduce(arrayReduceRight, baseEachRight); - - /** - * The opposite of `_.filter`; this method returns the elements of `collection` - * that `predicate` does **not** return truthy for. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the new filtered array. - * @example - * - * _.reject([1, 2, 3, 4], function(n) { - * return n % 2 == 0; - * }); - * // => [1, 3] - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.reject(users, { 'age': 40, 'active': true }), 'user'); - * // => ['barney'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.reject(users, 'active', false), 'user'); - * // => ['fred'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.reject(users, 'active'), 'user'); - * // => ['barney'] - */ - function reject(collection, predicate, thisArg) { - var func = isArray(collection) ? arrayFilter : baseFilter; - predicate = getCallback(predicate, thisArg, 3); - return func(collection, function(value, index, collection) { - return !predicate(value, index, collection); - }); - } - - /** - * Gets a random element or `n` random elements from a collection. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to sample. - * @param {number} [n] The number of elements to sample. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {*} Returns the random sample(s). - * @example - * - * _.sample([1, 2, 3, 4]); - * // => 2 - * - * _.sample([1, 2, 3, 4], 2); - * // => [3, 1] - */ - function sample(collection, n, guard) { - if (guard ? isIterateeCall(collection, n, guard) : n == null) { - collection = toIterable(collection); - var length = collection.length; - return length > 0 ? collection[baseRandom(0, length - 1)] : undefined; - } - var index = -1, - result = toArray(collection), - length = result.length, - lastIndex = length - 1; - - n = nativeMin(n < 0 ? 0 : (+n || 0), length); - while (++index < n) { - var rand = baseRandom(index, lastIndex), - value = result[rand]; - - result[rand] = result[index]; - result[index] = value; - } - result.length = n; - return result; - } - - /** - * Creates an array of shuffled values, using a version of the - * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to shuffle. - * @returns {Array} Returns the new shuffled array. - * @example - * - * _.shuffle([1, 2, 3, 4]); - * // => [4, 1, 3, 2] - */ - function shuffle(collection) { - return sample(collection, POSITIVE_INFINITY); - } - - /** - * Gets the size of `collection` by returning its length for array-like - * values or the number of own enumerable properties for objects. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to inspect. - * @returns {number} Returns the size of `collection`. - * @example - * - * _.size([1, 2, 3]); - * // => 3 - * - * _.size({ 'a': 1, 'b': 2 }); - * // => 2 - * - * _.size('pebbles'); - * // => 7 - */ - function size(collection) { - var length = collection ? getLength(collection) : 0; - return isLength(length) ? length : keys(collection).length; - } - - /** - * Checks if `predicate` returns truthy for **any** element of `collection`. - * The function returns as soon as it finds a passing value and does not iterate - * over the entire collection. The predicate is bound to `thisArg` and invoked - * with three arguments: (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias any - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - * @example - * - * _.some([null, 0, 'yes', false], Boolean); - * // => true - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.some(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // using the `_.matchesProperty` callback shorthand - * _.some(users, 'active', false); - * // => true - * - * // using the `_.property` callback shorthand - * _.some(users, 'active'); - * // => true - */ - function some(collection, predicate, thisArg) { - var func = isArray(collection) ? arraySome : baseSome; - if (thisArg && isIterateeCall(collection, predicate, thisArg)) { - predicate = null; - } - if (typeof predicate != 'function' || thisArg !== undefined) { - predicate = getCallback(predicate, thisArg, 3); - } - return func(collection, predicate); - } - - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through `iteratee`. This method performs - * a stable sort, that is, it preserves the original sort order of equal elements. - * The `iteratee` is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new sorted array. - * @example - * - * _.sortBy([1, 2, 3], function(n) { - * return Math.sin(n); - * }); - * // => [3, 1, 2] - * - * _.sortBy([1, 2, 3], function(n) { - * return this.sin(n); - * }, Math); - * // => [3, 1, 2] - * - * var users = [ - * { 'user': 'fred' }, - * { 'user': 'pebbles' }, - * { 'user': 'barney' } - * ]; - * - * // using the `_.property` callback shorthand - * _.pluck(_.sortBy(users, 'user'), 'user'); - * // => ['barney', 'fred', 'pebbles'] - */ - function sortBy(collection, iteratee, thisArg) { - if (collection == null) { - return []; - } - if (thisArg && isIterateeCall(collection, iteratee, thisArg)) { - iteratee = null; - } - var index = -1; - iteratee = getCallback(iteratee, thisArg, 3); - - var result = baseMap(collection, function(value, key, collection) { - return { 'criteria': iteratee(value, key, collection), 'index': ++index, 'value': value }; - }); - return baseSortBy(result, compareAscending); - } - - /** - * This method is like `_.sortBy` except that it can sort by multiple iteratees - * or property names. - * - * If a property name is provided for an iteratee the created `_.property` - * style callback returns the property value of the given element. - * - * If an object is provided for an iteratee the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {...(Function|Function[]|Object|Object[]|string|string[])} iteratees - * The iteratees to sort by, specified as individual values or arrays of values. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.map(_.sortByAll(users, ['user', 'age']), _.values); - * // => [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] - * - * _.map(_.sortByAll(users, 'user', function(chr) { - * return Math.floor(chr.age / 10); - * }), _.values); - * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - var sortByAll = restParam(function(collection, iteratees) { - if (collection == null) { - return []; - } - var guard = iteratees[2]; - if (guard && isIterateeCall(iteratees[0], iteratees[1], guard)) { - iteratees.length = 1; - } - return baseSortByOrder(collection, baseFlatten(iteratees), []); - }); - - /** - * This method is like `_.sortByAll` except that it allows specifying the - * sort orders of the iteratees to sort by. A truthy value in `orders` will - * sort the corresponding property name in ascending order while a falsey - * value will sort it in descending order. - * - * If a property name is provided for an iteratee the created `_.property` - * style callback returns the property value of the given element. - * - * If an object is provided for an iteratee the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. - * @param {boolean[]} orders The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.map(_.sortByOrder(users, ['user', 'age'], [true, false]), _.values); - * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - function sortByOrder(collection, iteratees, orders, guard) { - if (collection == null) { - return []; - } - if (guard && isIterateeCall(iteratees, orders, guard)) { - orders = null; - } - if (!isArray(iteratees)) { - iteratees = iteratees == null ? [] : [iteratees]; - } - if (!isArray(orders)) { - orders = orders == null ? [] : [orders]; - } - return baseSortByOrder(collection, iteratees, orders); - } - - /** - * Performs a deep comparison between each element in `collection` and the - * source object, returning an array of all elements that have equivalent - * property values. - * - * **Note:** This method supports comparing arrays, booleans, `Date` objects, - * numbers, `Object` objects, regexes, and strings. Objects are compared by - * their own, not inherited, enumerable properties. For comparing a single - * own or inherited property value see `_.matchesProperty`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Object} source The object of property values to match. - * @returns {Array} Returns the new filtered array. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false, 'pets': ['hoppy'] }, - * { 'user': 'fred', 'age': 40, 'active': true, 'pets': ['baby puss', 'dino'] } - * ]; - * - * _.pluck(_.where(users, { 'age': 36, 'active': false }), 'user'); - * // => ['barney'] - * - * _.pluck(_.where(users, { 'pets': ['dino'] }), 'user'); - * // => ['fred'] - */ - function where(collection, source) { - return filter(collection, baseMatches(source)); - } - - /*------------------------------------------------------------------------*/ - - /** - * Gets the number of milliseconds that have elapsed since the Unix epoch - * (1 January 1970 00:00:00 UTC). - * - * @static - * @memberOf _ - * @category Date - * @example - * - * _.defer(function(stamp) { - * console.log(_.now() - stamp); - * }, _.now()); - * // => logs the number of milliseconds it took for the deferred function to be invoked - */ - var now = nativeNow || function() { - return new Date().getTime(); - }; - - /*------------------------------------------------------------------------*/ - - /** - * The opposite of `_.before`; this method creates a function that invokes - * `func` once it is called `n` or more times. - * - * @static - * @memberOf _ - * @category Function - * @param {number} n The number of calls before `func` is invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var saves = ['profile', 'settings']; - * - * var done = _.after(saves.length, function() { - * console.log('done saving!'); - * }); - * - * _.forEach(saves, function(type) { - * asyncSave({ 'type': type, 'complete': done }); - * }); - * // => logs 'done saving!' after the two async saves have completed - */ - function after(n, func) { - if (typeof func != 'function') { - if (typeof n == 'function') { - var temp = n; - n = func; - func = temp; - } else { - throw new TypeError(FUNC_ERROR_TEXT); - } - } - n = nativeIsFinite(n = +n) ? n : 0; - return function() { - if (--n < 1) { - return func.apply(this, arguments); - } - }; - } - - /** - * Creates a function that accepts up to `n` arguments ignoring any - * additional arguments. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to cap arguments for. - * @param {number} [n=func.length] The arity cap. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Function} Returns the new function. - * @example - * - * _.map(['6', '8', '10'], _.ary(parseInt, 1)); - * // => [6, 8, 10] - */ - function ary(func, n, guard) { - if (guard && isIterateeCall(func, n, guard)) { - n = null; - } - n = (func && n == null) ? func.length : nativeMax(+n || 0, 0); - return createWrapper(func, ARY_FLAG, null, null, null, null, n); - } - - /** - * Creates a function that invokes `func`, with the `this` binding and arguments - * of the created function, while it is called less than `n` times. Subsequent - * calls to the created function return the result of the last `func` invocation. - * - * @static - * @memberOf _ - * @category Function - * @param {number} n The number of calls at which `func` is no longer invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * jQuery('#add').on('click', _.before(5, addContactToList)); - * // => allows adding up to 4 contacts to the list - */ - function before(n, func) { - var result; - if (typeof func != 'function') { - if (typeof n == 'function') { - var temp = n; - n = func; - func = temp; - } else { - throw new TypeError(FUNC_ERROR_TEXT); - } - } - return function() { - if (--n > 0) { - result = func.apply(this, arguments); - } - if (n <= 1) { - func = null; - } - return result; - }; - } - - /** - * Creates a function that invokes `func` with the `this` binding of `thisArg` - * and prepends any additional `_.bind` arguments to those provided to the - * bound function. - * - * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for partially applied arguments. - * - * **Note:** Unlike native `Function#bind` this method does not set the "length" - * property of bound functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to bind. - * @param {*} thisArg The `this` binding of `func`. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var greet = function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * }; - * - * var object = { 'user': 'fred' }; - * - * var bound = _.bind(greet, object, 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * // using placeholders - * var bound = _.bind(greet, object, _, '!'); - * bound('hi'); - * // => 'hi fred!' - */ - var bind = restParam(function(func, thisArg, partials) { - var bitmask = BIND_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, bind.placeholder); - bitmask |= PARTIAL_FLAG; - } - return createWrapper(func, bitmask, thisArg, partials, holders); - }); - - /** - * Binds methods of an object to the object itself, overwriting the existing - * method. Method names may be specified as individual arguments or as arrays - * of method names. If no method names are provided all enumerable function - * properties, own and inherited, of `object` are bound. - * - * **Note:** This method does not set the "length" property of bound functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Object} object The object to bind and assign the bound methods to. - * @param {...(string|string[])} [methodNames] The object method names to bind, - * specified as individual method names or arrays of method names. - * @returns {Object} Returns `object`. - * @example - * - * var view = { - * 'label': 'docs', - * 'onClick': function() { - * console.log('clicked ' + this.label); - * } - * }; - * - * _.bindAll(view); - * jQuery('#docs').on('click', view.onClick); - * // => logs 'clicked docs' when the element is clicked - */ - var bindAll = restParam(function(object, methodNames) { - methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object); - - var index = -1, - length = methodNames.length; - - while (++index < length) { - var key = methodNames[index]; - object[key] = createWrapper(object[key], BIND_FLAG, object); - } - return object; - }); - - /** - * Creates a function that invokes the method at `object[key]` and prepends - * any additional `_.bindKey` arguments to those provided to the bound function. - * - * This method differs from `_.bind` by allowing bound functions to reference - * methods that may be redefined or don't yet exist. - * See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) - * for more details. - * - * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * @static - * @memberOf _ - * @category Function - * @param {Object} object The object the method belongs to. - * @param {string} key The key of the method. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var object = { - * 'user': 'fred', - * 'greet': function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * } - * }; - * - * var bound = _.bindKey(object, 'greet', 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * object.greet = function(greeting, punctuation) { - * return greeting + 'ya ' + this.user + punctuation; - * }; - * - * bound('!'); - * // => 'hiya fred!' - * - * // using placeholders - * var bound = _.bindKey(object, 'greet', _, '!'); - * bound('hi'); - * // => 'hiya fred!' - */ - var bindKey = restParam(function(object, key, partials) { - var bitmask = BIND_FLAG | BIND_KEY_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, bindKey.placeholder); - bitmask |= PARTIAL_FLAG; - } - return createWrapper(key, bitmask, object, partials, holders); - }); - - /** - * Creates a function that accepts one or more arguments of `func` that when - * called either invokes `func` returning its result, if all `func` arguments - * have been provided, or returns a function that accepts one or more of the - * remaining `func` arguments, and so on. The arity of `func` may be specified - * if `func.length` is not sufficient. - * - * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for provided arguments. - * - * **Note:** This method does not set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curry(abc); - * - * curried(1)(2)(3); - * // => [1, 2, 3] - * - * curried(1, 2)(3); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // using placeholders - * curried(1)(_, 3)(2); - * // => [1, 2, 3] - */ - var curry = createCurry(CURRY_FLAG); - - /** - * This method is like `_.curry` except that arguments are applied to `func` - * in the manner of `_.partialRight` instead of `_.partial`. - * - * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for provided arguments. - * - * **Note:** This method does not set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curryRight(abc); - * - * curried(3)(2)(1); - * // => [1, 2, 3] - * - * curried(2, 3)(1); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // using placeholders - * curried(3)(1, _)(2); - * // => [1, 2, 3] - */ - var curryRight = createCurry(CURRY_RIGHT_FLAG); - - /** - * Creates a debounced function that delays invoking `func` until after `wait` - * milliseconds have elapsed since the last time the debounced function was - * invoked. The debounced function comes with a `cancel` method to cancel - * delayed invocations. Provide an options object to indicate that `func` - * should be invoked on the leading and/or trailing edge of the `wait` timeout. - * Subsequent calls to the debounced function return the result of the last - * `func` invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked - * on the trailing edge of the timeout only if the the debounced function is - * invoked more than once during the `wait` timeout. - * - * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) - * for details over the differences between `_.debounce` and `_.throttle`. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to debounce. - * @param {number} [wait=0] The number of milliseconds to delay. - * @param {Object} [options] The options object. - * @param {boolean} [options.leading=false] Specify invoking on the leading - * edge of the timeout. - * @param {number} [options.maxWait] The maximum time `func` is allowed to be - * delayed before it is invoked. - * @param {boolean} [options.trailing=true] Specify invoking on the trailing - * edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * // avoid costly calculations while the window size is in flux - * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); - * - * // invoke `sendMail` when the click event is fired, debouncing subsequent calls - * jQuery('#postbox').on('click', _.debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })); - * - * // ensure `batchLog` is invoked once after 1 second of debounced calls - * var source = new EventSource('/stream'); - * jQuery(source).on('message', _.debounce(batchLog, 250, { - * 'maxWait': 1000 - * })); - * - * // cancel a debounced call - * var todoChanges = _.debounce(batchLog, 1000); - * Object.observe(models.todo, todoChanges); - * - * Object.observe(models, function(changes) { - * if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) { - * todoChanges.cancel(); - * } - * }, ['delete']); - * - * // ...at some point `models.todo` is changed - * models.todo.completed = true; - * - * // ...before 1 second has passed `models.todo` is deleted - * // which cancels the debounced `todoChanges` call - * delete models.todo; - */ - function debounce(func, wait, options) { - var args, - maxTimeoutId, - result, - stamp, - thisArg, - timeoutId, - trailingCall, - lastCalled = 0, - maxWait = false, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - wait = wait < 0 ? 0 : (+wait || 0); - if (options === true) { - var leading = true; - trailing = false; - } else if (isObject(options)) { - leading = options.leading; - maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait); - trailing = 'trailing' in options ? options.trailing : trailing; - } - - function cancel() { - if (timeoutId) { - clearTimeout(timeoutId); - } - if (maxTimeoutId) { - clearTimeout(maxTimeoutId); - } - maxTimeoutId = timeoutId = trailingCall = undefined; - } - - function delayed() { - var remaining = wait - (now() - stamp); - if (remaining <= 0 || remaining > wait) { - if (maxTimeoutId) { - clearTimeout(maxTimeoutId); - } - var isCalled = trailingCall; - maxTimeoutId = timeoutId = trailingCall = undefined; - if (isCalled) { - lastCalled = now(); - result = func.apply(thisArg, args); - if (!timeoutId && !maxTimeoutId) { - args = thisArg = null; - } - } - } else { - timeoutId = setTimeout(delayed, remaining); - } - } - - function maxDelayed() { - if (timeoutId) { - clearTimeout(timeoutId); - } - maxTimeoutId = timeoutId = trailingCall = undefined; - if (trailing || (maxWait !== wait)) { - lastCalled = now(); - result = func.apply(thisArg, args); - if (!timeoutId && !maxTimeoutId) { - args = thisArg = null; - } - } - } - - function debounced() { - args = arguments; - stamp = now(); - thisArg = this; - trailingCall = trailing && (timeoutId || !leading); - - if (maxWait === false) { - var leadingCall = leading && !timeoutId; - } else { - if (!maxTimeoutId && !leading) { - lastCalled = stamp; - } - var remaining = maxWait - (stamp - lastCalled), - isCalled = remaining <= 0 || remaining > maxWait; - - if (isCalled) { - if (maxTimeoutId) { - maxTimeoutId = clearTimeout(maxTimeoutId); - } - lastCalled = stamp; - result = func.apply(thisArg, args); - } - else if (!maxTimeoutId) { - maxTimeoutId = setTimeout(maxDelayed, remaining); - } - } - if (isCalled && timeoutId) { - timeoutId = clearTimeout(timeoutId); - } - else if (!timeoutId && wait !== maxWait) { - timeoutId = setTimeout(delayed, wait); - } - if (leadingCall) { - isCalled = true; - result = func.apply(thisArg, args); - } - if (isCalled && !timeoutId && !maxTimeoutId) { - args = thisArg = null; - } - return result; - } - debounced.cancel = cancel; - return debounced; - } - - /** - * Defers invoking the `func` until the current call stack has cleared. Any - * additional arguments are provided to `func` when it is invoked. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to defer. - * @param {...*} [args] The arguments to invoke the function with. - * @returns {number} Returns the timer id. - * @example - * - * _.defer(function(text) { - * console.log(text); - * }, 'deferred'); - * // logs 'deferred' after one or more milliseconds - */ - var defer = restParam(function(func, args) { - return baseDelay(func, 1, args); - }); - - /** - * Invokes `func` after `wait` milliseconds. Any additional arguments are - * provided to `func` when it is invoked. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {...*} [args] The arguments to invoke the function with. - * @returns {number} Returns the timer id. - * @example - * - * _.delay(function(text) { - * console.log(text); - * }, 1000, 'later'); - * // => logs 'later' after one second - */ - var delay = restParam(function(func, wait, args) { - return baseDelay(func, wait, args); - }); - - /** - * Creates a function that returns the result of invoking the provided - * functions with the `this` binding of the created function, where each - * successive invocation is supplied the return value of the previous. - * - * @static - * @memberOf _ - * @category Function - * @param {...Function} [funcs] Functions to invoke. - * @returns {Function} Returns the new function. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var addSquare = _.flow(_.add, square); - * addSquare(1, 2); - * // => 9 - */ - var flow = createFlow(); - - /** - * This method is like `_.flow` except that it creates a function that - * invokes the provided functions from right to left. - * - * @static - * @memberOf _ - * @alias backflow, compose - * @category Function - * @param {...Function} [funcs] Functions to invoke. - * @returns {Function} Returns the new function. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var addSquare = _.flowRight(square, _.add); - * addSquare(1, 2); - * // => 9 - */ - var flowRight = createFlow(true); - - /** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is coerced to a string and used as the - * cache key. The `func` is invoked with the `this` binding of the memoized - * function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the [`Map`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-properties-of-the-map-prototype-object) - * method interface of `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoizing function. - * @example - * - * var upperCase = _.memoize(function(string) { - * return string.toUpperCase(); - * }); - * - * upperCase('fred'); - * // => 'FRED' - * - * // modifying the result cache - * upperCase.cache.set('fred', 'BARNEY'); - * upperCase('fred'); - * // => 'BARNEY' - * - * // replacing `_.memoize.Cache` - * var object = { 'user': 'fred' }; - * var other = { 'user': 'barney' }; - * var identity = _.memoize(_.identity); - * - * identity(object); - * // => { 'user': 'fred' } - * identity(other); - * // => { 'user': 'fred' } - * - * _.memoize.Cache = WeakMap; - * var identity = _.memoize(_.identity); - * - * identity(object); - * // => { 'user': 'fred' } - * identity(other); - * // => { 'user': 'barney' } - */ - function memoize(func, resolver) { - if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; - - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result); - return result; - }; - memoized.cache = new memoize.Cache; - return memoized; - } - - /** - * Creates a function that negates the result of the predicate `func`. The - * `func` predicate is invoked with the `this` binding and arguments of the - * created function. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} predicate The predicate to negate. - * @returns {Function} Returns the new function. - * @example - * - * function isEven(n) { - * return n % 2 == 0; - * } - * - * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); - * // => [1, 3, 5] - */ - function negate(predicate) { - if (typeof predicate != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function() { - return !predicate.apply(this, arguments); - }; - } - - /** - * Creates a function that is restricted to invoking `func` once. Repeat calls - * to the function return the value of the first call. The `func` is invoked - * with the `this` binding and arguments of the created function. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var initialize = _.once(createApplication); - * initialize(); - * initialize(); - * // `initialize` invokes `createApplication` once - */ - function once(func) { - return before(2, func); - } - - /** - * Creates a function that invokes `func` with `partial` arguments prepended - * to those provided to the new function. This method is like `_.bind` except - * it does **not** alter the `this` binding. - * - * The `_.partial.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method does not set the "length" property of partially - * applied functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * var greet = function(greeting, name) { - * return greeting + ' ' + name; - * }; - * - * var sayHelloTo = _.partial(greet, 'hello'); - * sayHelloTo('fred'); - * // => 'hello fred' - * - * // using placeholders - * var greetFred = _.partial(greet, _, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - */ - var partial = createPartial(PARTIAL_FLAG); - - /** - * This method is like `_.partial` except that partially applied arguments - * are appended to those provided to the new function. - * - * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method does not set the "length" property of partially - * applied functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * var greet = function(greeting, name) { - * return greeting + ' ' + name; - * }; - * - * var greetFred = _.partialRight(greet, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - * - * // using placeholders - * var sayHelloTo = _.partialRight(greet, 'hello', _); - * sayHelloTo('fred'); - * // => 'hello fred' - */ - var partialRight = createPartial(PARTIAL_RIGHT_FLAG); - - /** - * Creates a function that invokes `func` with arguments arranged according - * to the specified indexes where the argument value at the first index is - * provided as the first argument, the argument value at the second index is - * provided as the second argument, and so on. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to rearrange arguments for. - * @param {...(number|number[])} indexes The arranged argument indexes, - * specified as individual indexes or arrays of indexes. - * @returns {Function} Returns the new function. - * @example - * - * var rearged = _.rearg(function(a, b, c) { - * return [a, b, c]; - * }, 2, 0, 1); - * - * rearged('b', 'c', 'a') - * // => ['a', 'b', 'c'] - * - * var map = _.rearg(_.map, [1, 0]); - * map(function(n) { - * return n * 3; - * }, [1, 2, 3]); - * // => [3, 6, 9] - */ - var rearg = restParam(function(func, indexes) { - return createWrapper(func, REARG_FLAG, null, null, null, baseFlatten(indexes)); - }); - - /** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as an array. - * - * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters). - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.restParam(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); - * }); - * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' - */ - function restParam(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - rest = Array(length); - - while (++index < length) { - rest[index] = args[start + index]; - } - switch (start) { - case 0: return func.call(this, rest); - case 1: return func.call(this, args[0], rest); - case 2: return func.call(this, args[0], args[1], rest); - } - var otherArgs = Array(start + 1); - index = -1; - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = rest; - return func.apply(this, otherArgs); - }; - } - - /** - * Creates a function that invokes `func` with the `this` binding of the created - * function and an array of arguments much like [`Function#apply`](https://es5.github.io/#x15.3.4.3). - * - * **Note:** This method is based on the [spread operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator). - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to spread arguments over. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.spread(function(who, what) { - * return who + ' says ' + what; - * }); - * - * say(['fred', 'hello']); - * // => 'fred says hello' - * - * // with a Promise - * var numbers = Promise.all([ - * Promise.resolve(40), - * Promise.resolve(36) - * ]); - * - * numbers.then(_.spread(function(x, y) { - * return x + y; - * })); - * // => a Promise of 76 - */ - function spread(func) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function(array) { - return func.apply(this, array); - }; - } - - /** - * Creates a throttled function that only invokes `func` at most once per - * every `wait` milliseconds. The throttled function comes with a `cancel` - * method to cancel delayed invocations. Provide an options object to indicate - * that `func` should be invoked on the leading and/or trailing edge of the - * `wait` timeout. Subsequent calls to the throttled function return the - * result of the last `func` call. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked - * on the trailing edge of the timeout only if the the throttled function is - * invoked more than once during the `wait` timeout. - * - * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) - * for details over the differences between `_.throttle` and `_.debounce`. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to throttle. - * @param {number} [wait=0] The number of milliseconds to throttle invocations to. - * @param {Object} [options] The options object. - * @param {boolean} [options.leading=true] Specify invoking on the leading - * edge of the timeout. - * @param {boolean} [options.trailing=true] Specify invoking on the trailing - * edge of the timeout. - * @returns {Function} Returns the new throttled function. - * @example - * - * // avoid excessively updating the position while scrolling - * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); - * - * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes - * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, { - * 'trailing': false - * })); - * - * // cancel a trailing throttled call - * jQuery(window).on('popstate', throttled.cancel); - */ - function throttle(func, wait, options) { - var leading = true, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (options === false) { - leading = false; - } else if (isObject(options)) { - leading = 'leading' in options ? !!options.leading : leading; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - debounceOptions.leading = leading; - debounceOptions.maxWait = +wait; - debounceOptions.trailing = trailing; - return debounce(func, wait, debounceOptions); - } - - /** - * Creates a function that provides `value` to the wrapper function as its - * first argument. Any additional arguments provided to the function are - * appended to those provided to the wrapper function. The wrapper is invoked - * with the `this` binding of the created function. - * - * @static - * @memberOf _ - * @category Function - * @param {*} value The value to wrap. - * @param {Function} wrapper The wrapper function. - * @returns {Function} Returns the new function. - * @example - * - * var p = _.wrap(_.escape, function(func, text) { - * return '

      ' + func(text) + '

      '; - * }); - * - * p('fred, barney, & pebbles'); - * // => '

      fred, barney, & pebbles

      ' - */ - function wrap(value, wrapper) { - wrapper = wrapper == null ? identity : wrapper; - return createWrapper(wrapper, PARTIAL_FLAG, null, [value], []); - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned, - * otherwise they are assigned by reference. If `customizer` is provided it is - * invoked to produce the cloned values. If `customizer` returns `undefined` - * cloning is handled by the method instead. The `customizer` is bound to - * `thisArg` and invoked with two argument; (value [, index|key, object]). - * - * **Note:** This method is loosely based on the - * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm). - * The enumerable properties of `arguments` objects and objects created by - * constructors other than `Object` are cloned to plain `Object` objects. An - * empty object is returned for uncloneable values such as functions, DOM nodes, - * Maps, Sets, and WeakMaps. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @param {Function} [customizer] The function to customize cloning values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {*} Returns the cloned value. - * @example - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * var shallow = _.clone(users); - * shallow[0] === users[0]; - * // => true - * - * var deep = _.clone(users, true); - * deep[0] === users[0]; - * // => false - * - * // using a customizer callback - * var el = _.clone(document.body, function(value) { - * if (_.isElement(value)) { - * return value.cloneNode(false); - * } - * }); - * - * el === document.body - * // => false - * el.nodeName - * // => BODY - * el.childNodes.length; - * // => 0 - */ - function clone(value, isDeep, customizer, thisArg) { - if (isDeep && typeof isDeep != 'boolean' && isIterateeCall(value, isDeep, customizer)) { - isDeep = false; - } - else if (typeof isDeep == 'function') { - thisArg = customizer; - customizer = isDeep; - isDeep = false; - } - return typeof customizer == 'function' - ? baseClone(value, isDeep, bindCallback(customizer, thisArg, 1)) - : baseClone(value, isDeep); - } - - /** - * Creates a deep clone of `value`. If `customizer` is provided it is invoked - * to produce the cloned values. If `customizer` returns `undefined` cloning - * is handled by the method instead. The `customizer` is bound to `thisArg` - * and invoked with two argument; (value [, index|key, object]). - * - * **Note:** This method is loosely based on the - * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm). - * The enumerable properties of `arguments` objects and objects created by - * constructors other than `Object` are cloned to plain `Object` objects. An - * empty object is returned for uncloneable values such as functions, DOM nodes, - * Maps, Sets, and WeakMaps. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to deep clone. - * @param {Function} [customizer] The function to customize cloning values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {*} Returns the deep cloned value. - * @example - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * var deep = _.cloneDeep(users); - * deep[0] === users[0]; - * // => false - * - * // using a customizer callback - * var el = _.cloneDeep(document.body, function(value) { - * if (_.isElement(value)) { - * return value.cloneNode(true); - * } - * }); - * - * el === document.body - * // => false - * el.nodeName - * // => BODY - * el.childNodes.length; - * // => 20 - */ - function cloneDeep(value, customizer, thisArg) { - return typeof customizer == 'function' - ? baseClone(value, true, bindCallback(customizer, thisArg, 1)) - : baseClone(value, true); - } - - /** - * Checks if `value` is greater than `other`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, else `false`. - * @example - * - * _.gt(3, 1); - * // => true - * - * _.gt(3, 3); - * // => false - * - * _.gt(1, 3); - * // => false - */ - function gt(value, other) { - return value > other; - } - - /** - * Checks if `value` is greater than or equal to `other`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than or equal to `other`, else `false`. - * @example - * - * _.gte(3, 1); - * // => true - * - * _.gte(3, 3); - * // => true - * - * _.gte(1, 3); - * // => false - */ - function gte(value, other) { - return value >= other; - } - - /** - * Checks if `value` is classified as an `arguments` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - function isArguments(value) { - return isObjectLike(value) && isArrayLike(value) && objToString.call(value) == argsTag; - } - - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(function() { return arguments; }()); - * // => false - */ - var isArray = nativeIsArray || function(value) { - return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag; - }; - - /** - * Checks if `value` is classified as a boolean primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isBoolean(false); - * // => true - * - * _.isBoolean(null); - * // => false - */ - function isBoolean(value) { - return value === true || value === false || (isObjectLike(value) && objToString.call(value) == boolTag); - } - - /** - * Checks if `value` is classified as a `Date` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isDate(new Date); - * // => true - * - * _.isDate('Mon April 23 2012'); - * // => false - */ - function isDate(value) { - return isObjectLike(value) && objToString.call(value) == dateTag; - } - - /** - * Checks if `value` is a DOM element. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. - * @example - * - * _.isElement(document.body); - * // => true - * - * _.isElement(''); - * // => false - */ - function isElement(value) { - return !!value && value.nodeType === 1 && isObjectLike(value) && - (objToString.call(value).indexOf('Element') > -1); - } - // Fallback for environments without DOM support. - if (!support.dom) { - isElement = function(value) { - return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value); - }; - } - - /** - * Checks if `value` is empty. A value is considered empty unless it is an - * `arguments` object, array, string, or jQuery-like collection with a length - * greater than `0` or an object with own enumerable properties. - * - * @static - * @memberOf _ - * @category Lang - * @param {Array|Object|string} value The value to inspect. - * @returns {boolean} Returns `true` if `value` is empty, else `false`. - * @example - * - * _.isEmpty(null); - * // => true - * - * _.isEmpty(true); - * // => true - * - * _.isEmpty(1); - * // => true - * - * _.isEmpty([1, 2, 3]); - * // => false - * - * _.isEmpty({ 'a': 1 }); - * // => false - */ - function isEmpty(value) { - if (value == null) { - return true; - } - if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) || - (isObjectLike(value) && isFunction(value.splice)))) { - return !value.length; - } - return !keys(value).length; - } - - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. If `customizer` is provided it is invoked to compare values. - * If `customizer` returns `undefined` comparisons are handled by the method - * instead. The `customizer` is bound to `thisArg` and invoked with three - * arguments: (value, other [, index|key]). - * - * **Note:** This method supports comparing arrays, booleans, `Date` objects, - * numbers, `Object` objects, regexes, and strings. Objects are compared by - * their own, not inherited, enumerable properties. Functions and DOM nodes - * are **not** supported. Provide a customizer function to extend support - * for comparing other values. - * - * @static - * @memberOf _ - * @alias eq - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize value comparisons. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * object == other; - * // => false - * - * _.isEqual(object, other); - * // => true - * - * // using a customizer callback - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqual(array, other, function(value, other) { - * if (_.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/)) { - * return true; - * } - * }); - * // => true - */ - function isEqual(value, other, customizer, thisArg) { - customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined; - var result = customizer ? customizer(value, other) : undefined; - return result === undefined ? baseIsEqual(value, other, customizer) : !!result; - } - - /** - * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, - * `SyntaxError`, `TypeError`, or `URIError` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an error object, else `false`. - * @example - * - * _.isError(new Error); - * // => true - * - * _.isError(Error); - * // => false - */ - function isError(value) { - return isObjectLike(value) && typeof value.message == 'string' && objToString.call(value) == errorTag; - } - - /** - * Checks if `value` is a finite primitive number. - * - * **Note:** This method is based on [`Number.isFinite`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. - * @example - * - * _.isFinite(10); - * // => true - * - * _.isFinite('10'); - * // => false - * - * _.isFinite(true); - * // => false - * - * _.isFinite(Object(10)); - * // => false - * - * _.isFinite(Infinity); - * // => false - */ - var isFinite = nativeNumIsFinite || function(value) { - return typeof value == 'number' && nativeIsFinite(value); - }; - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - var isFunction = !(baseIsFunction(/x/) || (Uint8Array && !baseIsFunction(Uint8Array))) ? baseIsFunction : function(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in older versions of Chrome and Safari which return 'function' for regexes - // and Safari 8 equivalents which return 'object' for typed array constructors. - return objToString.call(value) == funcTag; - }; - - /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ - function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); - } - - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. If `customizer` is provided - * it is invoked to compare values. If `customizer` returns `undefined` - * comparisons are handled by the method instead. The `customizer` is bound - * to `thisArg` and invoked with three arguments: (value, other, index|key). - * - * **Note:** This method supports comparing properties of arrays, booleans, - * `Date` objects, numbers, `Object` objects, regexes, and strings. Functions - * and DOM nodes are **not** supported. Provide a customizer function to extend - * support for comparing other values. - * - * @static - * @memberOf _ - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Function} [customizer] The function to customize value comparisons. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - * - * // using a customizer callback - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatch(object, source, function(value, other) { - * return _.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined; - * }); - * // => true - */ - function isMatch(object, source, customizer, thisArg) { - customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined; - return baseIsMatch(object, getMatchData(source), customizer); - } - - /** - * Checks if `value` is `NaN`. - * - * **Note:** This method is not the same as [`isNaN`](https://es5.github.io/#x15.1.2.4) - * which returns `true` for `undefined` and other non-numeric values. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - * @example - * - * _.isNaN(NaN); - * // => true - * - * _.isNaN(new Number(NaN)); - * // => true - * - * isNaN(undefined); - * // => true - * - * _.isNaN(undefined); - * // => false - */ - function isNaN(value) { - // An `NaN` primitive is the only value that is not equal to itself. - // Perform the `toStringTag` check first to avoid errors with some host objects in IE. - return isNumber(value) && value != +value; - } - - /** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ - function isNative(value) { - if (value == null) { - return false; - } - if (objToString.call(value) == funcTag) { - return reIsNative.test(fnToString.call(value)); - } - return isObjectLike(value) && reIsHostCtor.test(value); - } - - /** - * Checks if `value` is `null`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `null`, else `false`. - * @example - * - * _.isNull(null); - * // => true - * - * _.isNull(void 0); - * // => false - */ - function isNull(value) { - return value === null; - } - - /** - * Checks if `value` is classified as a `Number` primitive or object. - * - * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified - * as numbers, use the `_.isFinite` method. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isNumber(8.4); - * // => true - * - * _.isNumber(NaN); - * // => true - * - * _.isNumber('8.4'); - * // => false - */ - function isNumber(value) { - return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag); - } - - /** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * **Note:** This method assumes objects created by the `Object` constructor - * have no inherited enumerable properties. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ - var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) { - if (!(value && objToString.call(value) == objectTag)) { - return false; - } - var valueOf = getNative(value, 'valueOf'), - objProto = valueOf && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto); - - return objProto - ? (value == objProto || getPrototypeOf(value) == objProto) - : shimIsPlainObject(value); - }; - - /** - * Checks if `value` is classified as a `RegExp` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isRegExp(/abc/); - * // => true - * - * _.isRegExp('/abc/'); - * // => false - */ - function isRegExp(value) { - return isObjectLike(value) && objToString.call(value) == regexpTag; - } - - /** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ - function isString(value) { - return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag); - } - - /** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ - function isTypedArray(value) { - return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)]; - } - - /** - * Checks if `value` is `undefined`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. - * @example - * - * _.isUndefined(void 0); - * // => true - * - * _.isUndefined(null); - * // => false - */ - function isUndefined(value) { - return value === undefined; - } - - /** - * Checks if `value` is less than `other`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than `other`, else `false`. - * @example - * - * _.lt(1, 3); - * // => true - * - * _.lt(3, 3); - * // => false - * - * _.lt(3, 1); - * // => false - */ - function lt(value, other) { - return value < other; - } - - /** - * Checks if `value` is less than or equal to `other`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than or equal to `other`, else `false`. - * @example - * - * _.lte(1, 3); - * // => true - * - * _.lte(3, 3); - * // => true - * - * _.lte(3, 1); - * // => false - */ - function lte(value, other) { - return value <= other; - } - - /** - * Converts `value` to an array. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {Array} Returns the converted array. - * @example - * - * (function() { - * return _.toArray(arguments).slice(1); - * }(1, 2, 3)); - * // => [2, 3] - */ - function toArray(value) { - var length = value ? getLength(value) : 0; - if (!isLength(length)) { - return values(value); - } - if (!length) { - return []; - } - return arrayCopy(value); - } - - /** - * Converts `value` to a plain object flattening inherited enumerable - * properties of `value` to own properties of the plain object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {Object} Returns the converted plain object. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.assign({ 'a': 1 }, new Foo); - * // => { 'a': 1, 'b': 2 } - * - * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); - * // => { 'a': 1, 'b': 2, 'c': 3 } - */ - function toPlainObject(value) { - return baseCopy(value, keysIn(value)); - } - - /*------------------------------------------------------------------------*/ - - /** - * Assigns own enumerable properties of source object(s) to the destination - * object. Subsequent sources overwrite property assignments of previous sources. - * If `customizer` is provided it is invoked to produce the assigned values. - * The `customizer` is bound to `thisArg` and invoked with five arguments: - * (objectValue, sourceValue, key, object, source). - * - * **Note:** This method mutates `object` and is based on - * [`Object.assign`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign). - * - * @static - * @memberOf _ - * @alias extend - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {Object} Returns `object`. - * @example - * - * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' }); - * // => { 'user': 'fred', 'age': 40 } - * - * // using a customizer callback - * var defaults = _.partialRight(_.assign, function(value, other) { - * return _.isUndefined(value) ? other : value; - * }); - * - * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); - * // => { 'user': 'barney', 'age': 36 } - */ - var assign = createAssigner(function(object, source, customizer) { - return customizer - ? assignWith(object, source, customizer) - : baseAssign(object, source); - }); - - /** - * Creates an object that inherits from the given `prototype` object. If a - * `properties` object is provided its own enumerable properties are assigned - * to the created object. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} prototype The object to inherit from. - * @param {Object} [properties] The properties to assign to the object. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Object} Returns the new object. - * @example - * - * function Shape() { - * this.x = 0; - * this.y = 0; - * } - * - * function Circle() { - * Shape.call(this); - * } - * - * Circle.prototype = _.create(Shape.prototype, { - * 'constructor': Circle - * }); - * - * var circle = new Circle; - * circle instanceof Circle; - * // => true - * - * circle instanceof Shape; - * // => true - */ - function create(prototype, properties, guard) { - var result = baseCreate(prototype); - if (guard && isIterateeCall(prototype, properties, guard)) { - properties = null; - } - return properties ? baseAssign(result, properties) : result; - } - - /** - * Assigns own enumerable properties of source object(s) to the destination - * object for all destination properties that resolve to `undefined`. Once a - * property is set, additional values of the same property are ignored. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); - * // => { 'user': 'barney', 'age': 36 } - */ - var defaults = restParam(function(args) { - var object = args[0]; - if (object == null) { - return object; - } - args.push(assignDefaults); - return assign.apply(undefined, args); - }); - - /** - * This method is like `_.find` except that it returns the key of the first - * element `predicate` returns truthy for instead of the element itself. - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {string|undefined} Returns the key of the matched element, else `undefined`. - * @example - * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findKey(users, function(chr) { - * return chr.age < 40; - * }); - * // => 'barney' (iteration order is not guaranteed) - * - * // using the `_.matches` callback shorthand - * _.findKey(users, { 'age': 1, 'active': true }); - * // => 'pebbles' - * - * // using the `_.matchesProperty` callback shorthand - * _.findKey(users, 'active', false); - * // => 'fred' - * - * // using the `_.property` callback shorthand - * _.findKey(users, 'active'); - * // => 'barney' - */ - var findKey = createFindKey(baseForOwn); - - /** - * This method is like `_.findKey` except that it iterates over elements of - * a collection in the opposite order. - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {string|undefined} Returns the key of the matched element, else `undefined`. - * @example - * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findLastKey(users, function(chr) { - * return chr.age < 40; - * }); - * // => returns `pebbles` assuming `_.findKey` returns `barney` - * - * // using the `_.matches` callback shorthand - * _.findLastKey(users, { 'age': 36, 'active': true }); - * // => 'barney' - * - * // using the `_.matchesProperty` callback shorthand - * _.findLastKey(users, 'active', false); - * // => 'fred' - * - * // using the `_.property` callback shorthand - * _.findLastKey(users, 'active'); - * // => 'pebbles' - */ - var findLastKey = createFindKey(baseForOwnRight); - - /** - * Iterates over own and inherited enumerable properties of an object invoking - * `iteratee` for each property. The `iteratee` is bound to `thisArg` and invoked - * with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forIn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => logs 'a', 'b', and 'c' (iteration order is not guaranteed) - */ - var forIn = createForIn(baseFor); - - /** - * This method is like `_.forIn` except that it iterates over properties of - * `object` in the opposite order. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forInRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => logs 'c', 'b', and 'a' assuming `_.forIn ` logs 'a', 'b', and 'c' - */ - var forInRight = createForIn(baseForRight); - - /** - * Iterates over own enumerable properties of an object invoking `iteratee` - * for each property. The `iteratee` is bound to `thisArg` and invoked with - * three arguments: (value, key, object). Iteratee functions may exit iteration - * early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forOwn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => logs 'a' and 'b' (iteration order is not guaranteed) - */ - var forOwn = createForOwn(baseForOwn); - - /** - * This method is like `_.forOwn` except that it iterates over properties of - * `object` in the opposite order. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forOwnRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => logs 'b' and 'a' assuming `_.forOwn` logs 'a' and 'b' - */ - var forOwnRight = createForOwn(baseForOwnRight); - - /** - * Creates an array of function property names from all enumerable properties, - * own and inherited, of `object`. - * - * @static - * @memberOf _ - * @alias methods - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the new array of property names. - * @example - * - * _.functions(_); - * // => ['after', 'ary', 'assign', ...] - */ - function functions(object) { - return baseFunctions(object, keysIn(object)); - } - - /** - * Gets the property value at `path` of `object`. If the resolved value is - * `undefined` the `defaultValue` is used in its place. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.get(object, 'a[0].b.c'); - * // => 3 - * - * _.get(object, ['a', '0', 'b', 'c']); - * // => 3 - * - * _.get(object, 'a.b.c', 'default'); - * // => 'default' - */ - function get(object, path, defaultValue) { - var result = object == null ? undefined : baseGet(object, toPath(path), path + ''); - return result === undefined ? defaultValue : result; - } - - /** - * Checks if `path` is a direct property. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` is a direct property, else `false`. - * @example - * - * var object = { 'a': { 'b': { 'c': 3 } } }; - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b.c'); - * // => true - * - * _.has(object, ['a', 'b', 'c']); - * // => true - */ - function has(object, path) { - if (object == null) { - return false; - } - var result = hasOwnProperty.call(object, path); - if (!result && !isKey(path)) { - path = toPath(path); - object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); - if (object == null) { - return false; - } - path = last(path); - result = hasOwnProperty.call(object, path); - } - return result || (isLength(object.length) && isIndex(path, object.length) && - (isArray(object) || isArguments(object))); - } - - /** - * Creates an object composed of the inverted keys and values of `object`. - * If `object` contains duplicate values, subsequent values overwrite property - * assignments of previous values unless `multiValue` is `true`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to invert. - * @param {boolean} [multiValue] Allow multiple values per key. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Object} Returns the new inverted object. - * @example - * - * var object = { 'a': 1, 'b': 2, 'c': 1 }; - * - * _.invert(object); - * // => { '1': 'c', '2': 'b' } - * - * // with `multiValue` - * _.invert(object, true); - * // => { '1': ['a', 'c'], '2': ['b'] } - */ - function invert(object, multiValue, guard) { - if (guard && isIterateeCall(object, multiValue, guard)) { - multiValue = null; - } - var index = -1, - props = keys(object), - length = props.length, - result = {}; - - while (++index < length) { - var key = props[index], - value = object[key]; - - if (multiValue) { - if (hasOwnProperty.call(result, value)) { - result[value].push(key); - } else { - result[value] = [key]; - } - } - else { - result[value] = key; - } - } - return result; - } - - /** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys) - * for more details. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ - var keys = !nativeKeys ? shimKeys : function(object) { - var Ctor = object == null ? null : object.constructor; - if ((typeof Ctor == 'function' && Ctor.prototype === object) || - (typeof object != 'function' && isArrayLike(object))) { - return shimKeys(object); - } - return isObject(object) ? nativeKeys(object) : []; - }; - - /** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ - function keysIn(object) { - if (object == null) { - return []; - } - if (!isObject(object)) { - object = Object(object); - } - var length = object.length; - length = (length && isLength(length) && - (isArray(object) || isArguments(object)) && length) || 0; - - var Ctor = object.constructor, - index = -1, - isProto = typeof Ctor == 'function' && Ctor.prototype === object, - result = Array(length), - skipIndexes = length > 0; - - while (++index < length) { - result[index] = (index + ''); - } - for (var key in object) { - if (!(skipIndexes && isIndex(key, length)) && - !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; - } - - /** - * The opposite of `_.mapValues`; this method creates an object with the - * same values as `object` and keys generated by running each own enumerable - * property of `object` through `iteratee`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the new mapped object. - * @example - * - * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { - * return key + value; - * }); - * // => { 'a1': 1, 'b2': 2 } - */ - var mapKeys = createObjectMapper(true); - - /** - * Creates an object with the same keys as `object` and values generated by - * running each own enumerable property of `object` through `iteratee`. The - * iteratee function is bound to `thisArg` and invoked with three arguments: - * (value, key, object). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the new mapped object. - * @example - * - * _.mapValues({ 'a': 1, 'b': 2 }, function(n) { - * return n * 3; - * }); - * // => { 'a': 3, 'b': 6 } - * - * var users = { - * 'fred': { 'user': 'fred', 'age': 40 }, - * 'pebbles': { 'user': 'pebbles', 'age': 1 } - * }; - * - * // using the `_.property` callback shorthand - * _.mapValues(users, 'age'); - * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) - */ - var mapValues = createObjectMapper(); - - /** - * Recursively merges own enumerable properties of the source object(s), that - * don't resolve to `undefined` into the destination object. Subsequent sources - * overwrite property assignments of previous sources. If `customizer` is - * provided it is invoked to produce the merged values of the destination and - * source properties. If `customizer` returns `undefined` merging is handled - * by the method instead. The `customizer` is bound to `thisArg` and invoked - * with five arguments: (objectValue, sourceValue, key, object, source). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {Object} Returns `object`. - * @example - * - * var users = { - * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] - * }; - * - * var ages = { - * 'data': [{ 'age': 36 }, { 'age': 40 }] - * }; - * - * _.merge(users, ages); - * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } - * - * // using a customizer callback - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, function(a, b) { - * if (_.isArray(a)) { - * return a.concat(b); - * } - * }); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - var merge = createAssigner(baseMerge); - - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {Function|...(string|string[])} [predicate] The function invoked per - * iteration or property names to omit, specified as individual property - * names or arrays of property names. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.omit(object, 'age'); - * // => { 'user': 'fred' } - * - * _.omit(object, _.isNumber); - * // => { 'user': 'fred' } - */ - var omit = restParam(function(object, props) { - if (object == null) { - return {}; - } - if (typeof props[0] != 'function') { - var props = arrayMap(baseFlatten(props), String); - return pickByArray(object, baseDifference(keysIn(object), props)); - } - var predicate = bindCallback(props[0], props[1], 3); - return pickByCallback(object, function(value, key, object) { - return !predicate(value, key, object); - }); - }); - - /** - * Creates a two dimensional array of the key-value pairs for `object`, - * e.g. `[[key1, value1], [key2, value2]]`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the new array of key-value pairs. - * @example - * - * _.pairs({ 'barney': 36, 'fred': 40 }); - * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed) - */ - function pairs(object) { - object = toObject(object); - - var index = -1, - props = keys(object), - length = props.length, - result = Array(length); - - while (++index < length) { - var key = props[index]; - result[index] = [key, object[key]]; - } - return result; - } - - /** - * Creates an object composed of the picked `object` properties. Property - * names may be specified as individual arguments or as arrays of property - * names. If `predicate` is provided it is invoked for each property of `object` - * picking the properties `predicate` returns truthy for. The predicate is - * bound to `thisArg` and invoked with three arguments: (value, key, object). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {Function|...(string|string[])} [predicate] The function invoked per - * iteration or property names to pick, specified as individual property - * names or arrays of property names. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.pick(object, 'user'); - * // => { 'user': 'fred' } - * - * _.pick(object, _.isString); - * // => { 'user': 'fred' } - */ - var pick = restParam(function(object, props) { - if (object == null) { - return {}; - } - return typeof props[0] == 'function' - ? pickByCallback(object, bindCallback(props[0], props[1], 3)) - : pickByArray(object, baseFlatten(props)); - }); - - /** - * This method is like `_.get` except that if the resolved value is a function - * it is invoked with the `this` binding of its parent object and its result - * is returned. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to resolve. - * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; - * - * _.result(object, 'a[0].b.c1'); - * // => 3 - * - * _.result(object, 'a[0].b.c2'); - * // => 4 - * - * _.result(object, 'a.b.c', 'default'); - * // => 'default' - * - * _.result(object, 'a.b.c', _.constant('default')); - * // => 'default' - */ - function result(object, path, defaultValue) { - var result = object == null ? undefined : object[path]; - if (result === undefined) { - if (object != null && !isKey(path, object)) { - path = toPath(path); - object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); - result = object == null ? undefined : object[last(path)]; - } - result = result === undefined ? defaultValue : result; - } - return isFunction(result) ? result.call(object) : result; - } - - /** - * Sets the property value of `path` on `object`. If a portion of `path` - * does not exist it is created. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to augment. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @returns {Object} Returns `object`. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.set(object, 'a[0].b.c', 4); - * console.log(object.a[0].b.c); - * // => 4 - * - * _.set(object, 'x[0].y.z', 5); - * console.log(object.x[0].y.z); - * // => 5 - */ - function set(object, path, value) { - if (object == null) { - return object; - } - var pathKey = (path + ''); - path = (object[pathKey] != null || isKey(path, object)) ? [pathKey] : toPath(path); - - var index = -1, - length = path.length, - lastIndex = length - 1, - nested = object; - - while (nested != null && ++index < length) { - var key = path[index]; - if (isObject(nested)) { - if (index == lastIndex) { - nested[key] = value; - } else if (nested[key] == null) { - nested[key] = isIndex(path[index + 1]) ? [] : {}; - } - } - nested = nested[key]; - } - return object; - } - - /** - * An alternative to `_.reduce`; this method transforms `object` to a new - * `accumulator` object which is the result of running each of its own enumerable - * properties through `iteratee`, with each invocation potentially mutating - * the `accumulator` object. The `iteratee` is bound to `thisArg` and invoked - * with four arguments: (accumulator, value, key, object). Iteratee functions - * may exit iteration early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Array|Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The custom accumulator value. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {*} Returns the accumulated value. - * @example - * - * _.transform([2, 3, 4], function(result, n) { - * result.push(n *= n); - * return n % 2 == 0; - * }); - * // => [4, 9] - * - * _.transform({ 'a': 1, 'b': 2 }, function(result, n, key) { - * result[key] = n * 3; - * }); - * // => { 'a': 3, 'b': 6 } - */ - function transform(object, iteratee, accumulator, thisArg) { - var isArr = isArray(object) || isTypedArray(object); - iteratee = getCallback(iteratee, thisArg, 4); - - if (accumulator == null) { - if (isArr || isObject(object)) { - var Ctor = object.constructor; - if (isArr) { - accumulator = isArray(object) ? new Ctor : []; - } else { - accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : null); - } - } else { - accumulator = {}; - } - } - (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) { - return iteratee(accumulator, value, index, object); - }); - return accumulator; - } - - /** - * Creates an array of the own enumerable property values of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.values(new Foo); - * // => [1, 2] (iteration order is not guaranteed) - * - * _.values('hi'); - * // => ['h', 'i'] - */ - function values(object) { - return baseValues(object, keys(object)); - } - - /** - * Creates an array of the own and inherited enumerable property values - * of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.valuesIn(new Foo); - * // => [1, 2, 3] (iteration order is not guaranteed) - */ - function valuesIn(object) { - return baseValues(object, keysIn(object)); - } - - /*------------------------------------------------------------------------*/ - - /** - * Checks if `n` is between `start` and up to but not including, `end`. If - * `end` is not specified it is set to `start` with `start` then set to `0`. - * - * @static - * @memberOf _ - * @category Number - * @param {number} n The number to check. - * @param {number} [start=0] The start of the range. - * @param {number} end The end of the range. - * @returns {boolean} Returns `true` if `n` is in the range, else `false`. - * @example - * - * _.inRange(3, 2, 4); - * // => true - * - * _.inRange(4, 8); - * // => true - * - * _.inRange(4, 2); - * // => false - * - * _.inRange(2, 2); - * // => false - * - * _.inRange(1.2, 2); - * // => true - * - * _.inRange(5.2, 4); - * // => false - */ - function inRange(value, start, end) { - start = +start || 0; - if (typeof end === 'undefined') { - end = start; - start = 0; - } else { - end = +end || 0; - } - return value >= nativeMin(start, end) && value < nativeMax(start, end); - } - - /** - * Produces a random number between `min` and `max` (inclusive). If only one - * argument is provided a number between `0` and the given number is returned. - * If `floating` is `true`, or either `min` or `max` are floats, a floating-point - * number is returned instead of an integer. - * - * @static - * @memberOf _ - * @category Number - * @param {number} [min=0] The minimum possible value. - * @param {number} [max=1] The maximum possible value. - * @param {boolean} [floating] Specify returning a floating-point number. - * @returns {number} Returns the random number. - * @example - * - * _.random(0, 5); - * // => an integer between 0 and 5 - * - * _.random(5); - * // => also an integer between 0 and 5 - * - * _.random(5, true); - * // => a floating-point number between 0 and 5 - * - * _.random(1.2, 5.2); - * // => a floating-point number between 1.2 and 5.2 - */ - function random(min, max, floating) { - if (floating && isIterateeCall(min, max, floating)) { - max = floating = null; - } - var noMin = min == null, - noMax = max == null; - - if (floating == null) { - if (noMax && typeof min == 'boolean') { - floating = min; - min = 1; - } - else if (typeof max == 'boolean') { - floating = max; - noMax = true; - } - } - if (noMin && noMax) { - max = 1; - noMax = false; - } - min = +min || 0; - if (noMax) { - max = min; - min = 0; - } else { - max = +max || 0; - } - if (floating || min % 1 || max % 1) { - var rand = nativeRandom(); - return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand + '').length - 1)))), max); - } - return baseRandom(min, max); - } - - /*------------------------------------------------------------------------*/ - - /** - * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the camel cased string. - * @example - * - * _.camelCase('Foo Bar'); - * // => 'fooBar' - * - * _.camelCase('--foo-bar'); - * // => 'fooBar' - * - * _.camelCase('__foo_bar__'); - * // => 'fooBar' - */ - var camelCase = createCompounder(function(result, word, index) { - word = word.toLowerCase(); - return result + (index ? (word.charAt(0).toUpperCase() + word.slice(1)) : word); - }); - - /** - * Capitalizes the first character of `string`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to capitalize. - * @returns {string} Returns the capitalized string. - * @example - * - * _.capitalize('fred'); - * // => 'Fred' - */ - function capitalize(string) { - string = baseToString(string); - return string && (string.charAt(0).toUpperCase() + string.slice(1)); - } - - /** - * Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) - * to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to deburr. - * @returns {string} Returns the deburred string. - * @example - * - * _.deburr('déjà vu'); - * // => 'deja vu' - */ - function deburr(string) { - string = baseToString(string); - return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, ''); - } - - /** - * Checks if `string` ends with the given target string. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to search. - * @param {string} [target] The string to search for. - * @param {number} [position=string.length] The position to search from. - * @returns {boolean} Returns `true` if `string` ends with `target`, else `false`. - * @example - * - * _.endsWith('abc', 'c'); - * // => true - * - * _.endsWith('abc', 'b'); - * // => false - * - * _.endsWith('abc', 'b', 2); - * // => true - */ - function endsWith(string, target, position) { - string = baseToString(string); - target = (target + ''); - - var length = string.length; - position = position === undefined - ? length - : nativeMin(position < 0 ? 0 : (+position || 0), length); - - position -= target.length; - return position >= 0 && string.indexOf(target, position) == position; - } - - /** - * Converts the characters "&", "<", ">", '"', "'", and "\`", in `string` to - * their corresponding HTML entities. - * - * **Note:** No other characters are escaped. To escape additional characters - * use a third-party library like [_he_](https://mths.be/he). - * - * Though the ">" character is escaped for symmetry, characters like - * ">" and "/" don't need escaping in HTML and have no special meaning - * unless they're part of a tag or unquoted attribute value. - * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) - * (under "semi-related fun fact") for more details. - * - * Backticks are escaped because in Internet Explorer < 9, they can break out - * of attribute values or HTML comments. See [#59](https://html5sec.org/#59), - * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and - * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/) - * for more details. - * - * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping) - * to reduce XSS vectors. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escape('fred, barney, & pebbles'); - * // => 'fred, barney, & pebbles' - */ - function escape(string) { - // Reset `lastIndex` because in IE < 9 `String#replace` does not. - string = baseToString(string); - return (string && reHasUnescapedHtml.test(string)) - ? string.replace(reUnescapedHtml, escapeHtmlChar) - : string; - } - - /** - * Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|", "?", - * "*", "+", "(", ")", "[", "]", "{" and "}" in `string`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escapeRegExp('[lodash](https://lodash.com/)'); - * // => '\[lodash\]\(https:\/\/lodash\.com\/\)' - */ - function escapeRegExp(string) { - string = baseToString(string); - return (string && reHasRegExpChars.test(string)) - ? string.replace(reRegExpChars, '\\$&') - : string; - } - - /** - * Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the kebab cased string. - * @example - * - * _.kebabCase('Foo Bar'); - * // => 'foo-bar' - * - * _.kebabCase('fooBar'); - * // => 'foo-bar' - * - * _.kebabCase('__foo_bar__'); - * // => 'foo-bar' - */ - var kebabCase = createCompounder(function(result, word, index) { - return result + (index ? '-' : '') + word.toLowerCase(); - }); - - /** - * Pads `string` on the left and right sides if it's shorter than `length`. - * Padding characters are truncated if they can't be evenly divided by `length`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.pad('abc', 8); - * // => ' abc ' - * - * _.pad('abc', 8, '_-'); - * // => '_-abc_-_' - * - * _.pad('abc', 3); - * // => 'abc' - */ - function pad(string, length, chars) { - string = baseToString(string); - length = +length; - - var strLength = string.length; - if (strLength >= length || !nativeIsFinite(length)) { - return string; - } - var mid = (length - strLength) / 2, - leftLength = floor(mid), - rightLength = ceil(mid); - - chars = createPadding('', rightLength, chars); - return chars.slice(0, leftLength) + string + chars; - } - - /** - * Pads `string` on the left side if it's shorter than `length`. Padding - * characters are truncated if they exceed `length`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padLeft('abc', 6); - * // => ' abc' - * - * _.padLeft('abc', 6, '_-'); - * // => '_-_abc' - * - * _.padLeft('abc', 3); - * // => 'abc' - */ - var padLeft = createPadDir(); - - /** - * Pads `string` on the right side if it's shorter than `length`. Padding - * characters are truncated if they exceed `length`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padRight('abc', 6); - * // => 'abc ' - * - * _.padRight('abc', 6, '_-'); - * // => 'abc_-_' - * - * _.padRight('abc', 3); - * // => 'abc' - */ - var padRight = createPadDir(true); - - /** - * Converts `string` to an integer of the specified radix. If `radix` is - * `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal, - * in which case a `radix` of `16` is used. - * - * **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#E) - * of `parseInt`. - * - * @static - * @memberOf _ - * @category String - * @param {string} string The string to convert. - * @param {number} [radix] The radix to interpret `value` by. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {number} Returns the converted integer. - * @example - * - * _.parseInt('08'); - * // => 8 - * - * _.map(['6', '08', '10'], _.parseInt); - * // => [6, 8, 10] - */ - function parseInt(string, radix, guard) { - if (guard && isIterateeCall(string, radix, guard)) { - radix = 0; - } - return nativeParseInt(string, radix); - } - // Fallback for environments with pre-ES5 implementations. - if (nativeParseInt(whitespace + '08') != 8) { - parseInt = function(string, radix, guard) { - // Firefox < 21 and Opera < 15 follow ES3 for `parseInt`. - // Chrome fails to trim leading whitespace characters. - // See https://code.google.com/p/v8/issues/detail?id=3109 for more details. - if (guard ? isIterateeCall(string, radix, guard) : radix == null) { - radix = 0; - } else if (radix) { - radix = +radix; - } - string = trim(string); - return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10)); - }; - } - - /** - * Repeats the given string `n` times. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to repeat. - * @param {number} [n=0] The number of times to repeat the string. - * @returns {string} Returns the repeated string. - * @example - * - * _.repeat('*', 3); - * // => '***' - * - * _.repeat('abc', 2); - * // => 'abcabc' - * - * _.repeat('abc', 0); - * // => '' - */ - function repeat(string, n) { - var result = ''; - string = baseToString(string); - n = +n; - if (n < 1 || !string || !nativeIsFinite(n)) { - return result; - } - // Leverage the exponentiation by squaring algorithm for a faster repeat. - // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. - do { - if (n % 2) { - result += string; - } - n = floor(n / 2); - string += string; - } while (n); - - return result; - } - - /** - * Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the snake cased string. - * @example - * - * _.snakeCase('Foo Bar'); - * // => 'foo_bar' - * - * _.snakeCase('fooBar'); - * // => 'foo_bar' - * - * _.snakeCase('--foo-bar'); - * // => 'foo_bar' - */ - var snakeCase = createCompounder(function(result, word, index) { - return result + (index ? '_' : '') + word.toLowerCase(); - }); - - /** - * Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the start cased string. - * @example - * - * _.startCase('--foo-bar'); - * // => 'Foo Bar' - * - * _.startCase('fooBar'); - * // => 'Foo Bar' - * - * _.startCase('__foo_bar__'); - * // => 'Foo Bar' - */ - var startCase = createCompounder(function(result, word, index) { - return result + (index ? ' ' : '') + (word.charAt(0).toUpperCase() + word.slice(1)); - }); - - /** - * Checks if `string` starts with the given target string. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to search. - * @param {string} [target] The string to search for. - * @param {number} [position=0] The position to search from. - * @returns {boolean} Returns `true` if `string` starts with `target`, else `false`. - * @example - * - * _.startsWith('abc', 'a'); - * // => true - * - * _.startsWith('abc', 'b'); - * // => false - * - * _.startsWith('abc', 'b', 1); - * // => true - */ - function startsWith(string, target, position) { - string = baseToString(string); - position = position == null - ? 0 - : nativeMin(position < 0 ? 0 : (+position || 0), string.length); - - return string.lastIndexOf(target, position) == position; - } - - /** - * Creates a compiled template function that can interpolate data properties - * in "interpolate" delimiters, HTML-escape interpolated data properties in - * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data - * properties may be accessed as free variables in the template. If a setting - * object is provided it takes precedence over `_.templateSettings` values. - * - * **Note:** In the development build `_.template` utilizes - * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) - * for easier debugging. - * - * For more information on precompiling templates see - * [lodash's custom builds documentation](https://lodash.com/custom-builds). - * - * For more information on Chrome extension sandboxes see - * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The template string. - * @param {Object} [options] The options object. - * @param {RegExp} [options.escape] The HTML "escape" delimiter. - * @param {RegExp} [options.evaluate] The "evaluate" delimiter. - * @param {Object} [options.imports] An object to import into the template as free variables. - * @param {RegExp} [options.interpolate] The "interpolate" delimiter. - * @param {string} [options.sourceURL] The sourceURL of the template's compiled source. - * @param {string} [options.variable] The data object variable name. - * @param- {Object} [otherOptions] Enables the legacy `options` param signature. - * @returns {Function} Returns the compiled template function. - * @example - * - * // using the "interpolate" delimiter to create a compiled template - * var compiled = _.template('hello <%= user %>!'); - * compiled({ 'user': 'fred' }); - * // => 'hello fred!' - * - * // using the HTML "escape" delimiter to escape data property values - * var compiled = _.template('<%- value %>'); - * compiled({ 'value': ' - -``` -Next, we'll get the user input from an input, listening to the keyup event by using the `Rx.Observable.fromEvent` method. This will either use the event binding from [jQuery](http://jquery.com), [Zepto](http://zeptojs.com/), [AngularJS](https://angularjs.org/), [Backbone.js](http://backbonejs.org/) and [Ember.js](http://emberjs.com/) if available, and if not, falls back to the native event binding. This gives you consistent ways of thinking of events depending on your framework, so there are no surprises. - -```js -var $input = $('#input'), - $results = $('#results'); - -/* Only get the value from each key up */ -var keyups = Rx.Observable.fromEvent($input, 'keyup') - .map(function (e) { - return e.target.value; - }) - .filter(function (text) { - return text.length > 2; - }); - -/* Now debounce the input for 500ms */ -var debounced = keyups - .debounce(500 /* ms */); - -/* Now get only distinct values, so we eliminate the arrows and other control characters */ -var distinct = debounced - .distinctUntilChanged(); -``` - -Now, let's query Wikipedia! In RxJS, we can instantly bind to any [Promises A+](https://github.com/promises-aplus/promises-spec) implementation through the `Rx.Observable.fromPromise` method or by just directly returning it, and we wrap it for you. - -```js -function searchWikipedia (term) { - return $.ajax({ - url: 'http://en.wikipedia.org/w/api.php', - dataType: 'jsonp', - data: { - action: 'opensearch', - format: 'json', - search: term - } - }).promise(); -} -``` - -Once that is created, now we can tie together the distinct throttled input and then query the service. In this case, we'll call `flatMapLatest` to get the value and ensure that we're not introducing any out of order sequence calls. - -```js -var suggestions = distinct - .flatMapLatest(searchWikipedia); -``` - -Finally, we call the `forEach` method on our observable sequence to start pulling data. - -```js -suggestions.forEach( - function (data) { - $results - .empty() - .append ($.map(data[1], function (value) { - return $('
    • ').text(value); - })); - }, - function (error) { - $results - .empty() - .append($('
    • ')) - .text('Error:' + error); - }); -``` - -And there you have it! - -## Dive In! ## - -Please check out: - - - [The full documentation](https://github.com/Reactive-Extensions/RxJS/tree/master/doc) - - [Our many great examples](https://github.com/Reactive-Extensions/RxJS/tree/master/examples) - - [Our design guidelines](https://github.com/Reactive-Extensions/RxJS/tree/master/doc/designguidelines) - - [Our contribution guidelines](https://github.com/Reactive-Extensions/RxJS/tree/master/doc/contributing) - - [Our complete Unit Tests](https://github.com/Reactive-Extensions/RxJS/tree/master/tests) - - [Our recipes](https://github.com/Reactive-Extensions/RxJS/wiki/Recipes) - -## Resources - -- Contact us - - [Tech Blog](http://blogs.msdn.com/b/rxteam) - - [Twitter @ReactiveX](https://twitter.com/ReactiveX) - - [Twitter @OpenAtMicrosoft](http://twitter.com/OpenAtMicrosoft) - - [StackOverflow rxjs](http://stackoverflow.com/questions/tagged/rxjs) - - [Slack](http://reactivex.slack.com) - -- Tutorials - - [The introduction to Reactive Programming you've been missing](https://gist.github.com/staltz/868e7e9bc2a7b8c1f754) - - [2 minute introduction to Rx](https://medium.com/@andrestaltz/2-minute-introduction-to-rx-24c8ca793877) - - [Learn RxJS](https://github.com/jhusain/learnrx) - - [RxJS Koans](https://github.com/Reactive-Extensions/RxJSKoans) - - [RxJS Workshop](https://github.com/Reactive-Extensions/BuildStuffWorkshop) - - [Rx Workshop](http://rxworkshop.codeplex.com/) - - [Reactive Programming and MVC](http://aaronstacy.com/writings/reactive-programming-and-mvc/) - -- Reference Material - - [Rx Marbles](http://rxmarbles.com/) - - [RxJS GitBook](http://xgrommx.github.io/rx-book/) - - [Intro to Rx](http://introtorx.com/) - - [101 Rx Samples Wiki](http://rxwiki.wikidot.com/101samples) - - [Rx Design Guidelines](https://github.com/Reactive-Extensions/RxJS/tree/master/doc/designguidelines) - - [Beginners Guide to Rx](http://msdn.microsoft.com/en-us/data/gg577611) - - [Visualizing Reactive Streams](http://jaredly.github.io/2015/03/06/visualizing-reactive-streams-hot-and-cold/) - -- Community Examples - - [React](http://facebook.github.io/react/) - - [Rx-React](https://github.com/fdecampredon/rx-react) - - [RxReact](https://github.com/AlexMost/RxReact) - - [cycle-react](https://github.com/pH200/cycle-react) - - [React RxJS Autocomplete](https://github.com/eliseumds/react-autocomplete) - - [React RxJS TODO MVC](https://github.com/fdecampredon/react-rxjs-todomvc) - - [Rx TODO MVC](https://github.com/footballradar/rx-todomvc) - - [React RxJS Router](https://github.com/kmcclosk/reactjs-rxjs-example) - - [React + RxJS + Angular 2.0 di.js TODO MVC](https://github.com/joelhooks/react-rxjs-angular-di-todomvc) - - [React + RxJS Reactive Cube](https://github.com/hugobessaa/cubactive) - - [Real-Time with React + RxJS + Meteor](https://medium.com/@bobiblazeski/functional-reactive-interfaces-e8de034de6bd) - - [React + RxJS Flow](https://github.com/justinwoo/react-rxjs-flow) - - [Reactive Widgets](https://github.com/zxbodya/reactive-widgets) - - [React RxJS Infinite Scroll](https://github.com/justinwoo/react-rxjs-scroll) - - [Flux](http://facebook.github.io/flux/) - - [Rx-Flux](https://github.com/fdecampredon/rx-flux) - - [ReactiveFlux](https://github.com/codesuki/reactive-flux) - - [Thundercats.js](https://github.com/r3dm/thundercats) - - [Flurx](https://github.com/cell303/flurx) - - [RR](https://github.com/winsonwq/RR) - - [Ember](http://emberjs.com/) - - [RxEmber](https://github.com/blesh/RxEmber) - - [AngularJS](http://angularjs.org) - - [Ninya.io - Angular + RxJS + rx.angular.js](https://github.com/ninya-io/ninya.io) - [Site](http://stackwho.herokuapp.com/) - - [The Car Game](https://github.com/mikkark/TheCarGame) - [Site](https://thecargame.herokuapp.com/) - [Blog Post](https://allthingsarchitectural.wordpress.com/2014/11/24/game-programming-with-angular-rxjs-and-node-js/) - - [Cycle](https://github.com/staltz/cycle) - - [Cycle TODO MVC](https://github.com/staltz/todomvc-cycle) - - [WebRx](https://github.com/oliverw/webrx) - - Everything else - - [RxVision](http://jaredly.github.io/rxvision/) - - [Mario Elm Example](http://fudini.github.io/rx/mario.html) - - [Firebase + RxJS](http://blog.cryptoguru.com/2014/11/frp-using-rxjs-and-firebase.html) - - [Reactive Trader](https://github.com/AdaptiveConsulting/ReactiveTrader) - [Site](https://reactivetrader.azurewebsites.net/) - - [NPM Dependencies](https://www.npmjs.com/browse/depended/rx) - -- Presentations - - Don't Cross the Streams - Cascadia.js 2012 [slides/demos](http://www.slideshare.net/mattpodwysocki/cascadiajs-dont-cross-the-streams) | [video](http://www.youtube.com/watch?v=FqBq4uoiG0M) - - Curing Your Asynchronous Blues - Strange Loop 2013 [slides/demos](https://github.com/Reactive-Extensions/StrangeLoop2013) | [video](http://www.infoq.com/presentations/rx-event-processing) - - Streaming and event-based programming using FRP and RxJS - FutureJS 2014 [slides/demos](https://github.com/Reactive-Extensions/FutureJS) | [video](https://www.youtube.com/watch?v=zlERo_JMGCw) - - [Tyrannosaurus Rx](http://yobriefca.se/presentations/tyrannosaurus-rx.pdf) - [James Hughes](http://twitter.com/kouphax) - - Taming Asynchronous Workflows with Functional Reactive Programming - EuroClojure - [Leonardo Borges](https://twitter.com/leonardo_borges) [slides](http://www.slideshare.net/borgesleonardo/functional-reactive-programming-compositional-event-systems) | [video](http://www.slideshare.net/borgesleonardo/functional-reactive-programming-compositional-event-systems) -- Reactive All the Things - ng-conf 2015 - [Martin Gontovnikas](https://twitter.com/mgonto/) & [Ben Lesh](https://twitter.com/BenLesh) - - [Slides](http://mgonto.github.io/reactive-all-the-things-talk/#1) - - [Video](https://www.youtube.com/watch?v=zbBVG8bOoXk&feature=youtu.be&app=desktop) - -- Videos - - [Practical Rx with Matthew Podwysocki, Bart de Smet and Jafar Husain](http://channel9.msdn.com/posts/Bart-De-Smet-Jafar-Hussain-Matthew-Podwysocki-Pragmatic-Rx) - - [Netflix and RxJS](http://channel9.msdn.com/posts/Rx-and-Netflix) - - [Hello RxJS - Channel 9](http://channel9.msdn.com/Blogs/Charles/Introducing-RxJS-Reactive-Extensions-for-JavaScript) - - [MIX 2011](http://channel9.msdn.com/events/MIX/MIX11/HTM07) - - [RxJS Today and Tomorrow - Channel 9](http://channel9.msdn.com/Blogs/Charles/Matthew-Podwysocki-and-Bart-J-F-De-Smet-RxJS-Today-and-Tomorrow) - - [Reactive Extensions Videos on Channel 9](http://channel9.msdn.com/Tags/reactive+extensions) - - [Asynchronous JavaScript at Netflix - Netflix JavaScript Talks - Jafar Husain](https://www.youtube.com/watch?v=XRYN2xt11Ek) - - [Asynchronous JavaScript at Netflix - MountainWest JavaScript 2014 - Jafar Husain](https://www.youtube.com/watch?v=XE692Clb5LU) - - [Asynchronous JavaScript at Netflix - HTML5DevConf - Jafar Husain](https://www.youtube.com/watch?v=5uxSu-F5Kj0) - - [Adding Even More Fun to Functional Programming With RXJS - Ryan Anklam](https://www.youtube.com/watch?v=8EExNfm0gt4) - - [Reactive Angular - Devoxx France 2014 - Martin Gontovnikas](http://parleys.com/play/53677646e4b0593229b85841/chapter0/about) - - [Reactive Game Programming for the Discerning Hipster - JSConf 2014 - Bodil Stokke](https://www.youtube.com/watch?v=x8mmAu7ZR9Y) - -- Podcasts - - [.NET Rocks #907](http://dotnetrocks.com/default.aspx?showNum=907) - - [JavaScript Jabber #83](http://javascriptjabber.com/083-jsj-frp-and-rxjs-with-matthew-podwysocki/) - -- Articles - - [Your Mouse is a Database](http://queue.acm.org/detail.cfm?id=2169076) - -- Books - - [RxJS](http://xgrommx.github.io/rx-book) - - [Intro to Rx](http://www.amazon.com/Introduction-to-Rx-ebook/dp/B008GM3YPM/) - - [Programming Reactive Extensions and LINQ](http://www.amazon.com/Programming-Reactive-Extensions-Jesse-Liberty/dp/1430237473/) - -## Getting Started - -There are a number of ways to get started with RxJS. The files are available on [cdnjs](http://cdnjs.com/libraries/rxjs/) and [jsDelivr](http://www.jsdelivr.com/#!rxjs). - -### Custom Builds - -You can use the [`rx-cli`](https://www.npmjs.org/package/rx-cli) to perform custom builds to create the RxJS you want: - -```bash -$ rx --lite --compat --methods select,selectmany,takeuntil,fromevent -``` - -### Download the Source - -```bash -git clone https://github.com/Reactive-Extensions/rxjs.git -cd ./rxjs -``` - -### Installing with [NPM](https://npmjs.org/) - -```bash` -$ npm install rx -$ npm install -g rx -``` - -### Using with Node.js and Ringo.js - -```js -var Rx = require('rx'); -``` - -### Installing with [Bower](http://bower.io/) - -```bash -$ bower install rxjs -``` - -### Installing with [Jam](http://jamjs.org/) -```bash -$ jam install rx -``` -### Installing All of RxJS via [NuGet](http://nuget.org/) -```bash -$ Install-Package RxJS-All -``` -### Install individual packages via [NuGet](http://nuget.org/): - - Install-Package RxJS-All - Install-Package RxJS-Lite - Install-Package RxJS-Main - Install-Package RxJS-Aggregates - Install-Package RxJS-Async - Install-Package RxJS-BackPressure - Install-Package RxJS-Binding - Install-Package RxJS-Coincidence - Install-Package RxJS-Experimental - Install-Package RxJS-JoinPatterns - Install-Package RxJS-Testing - Install-Package RxJS-Time - -### In a Browser: - -```html - - - - - - - - -``` - -### Along with a number of our extras for RxJS: - -```html - - - - - - - - - - -``` - -### Using RxJS with an AMD loader such as Require.js - -```js -require({ - 'paths': { - 'rx': 'path/to/rx-lite.js' - } -}, -['rx'], function(Rx) { - var obs = Rx.Observable.of(42); - obs.forEach(function (x) { console.log(x); }); -}); -``` - -## What about my libraries? ## - -The Reactive Extensions for JavaScript have no external dependencies any library, so they'll work well with just about any library. We provide bridges and support for various libraries including: -- [Node.js](https://www.npmjs.com/package/rx-node) -- [React](http://facebook.github.io/react/) - - [Rx-React](https://github.com/fdecampredon/rx-react) - - [RxReact](https://github.com/AlexMost/RxReact) - - [cycle-react](https://github.com/pH200/cycle-react) -- [Flux](http://facebook.github.io/flux/) - - [Rx-Flux](https://github.com/fdecampredon/rx-flux) - - [ReactiveFlux](https://github.com/codesuki/reactive-flux) - - [Thundercats.js](https://github.com/r3dm/thundercats) - - [Flurx](https://github.com/cell303/flurx) - - [RR](https://github.com/winsonwq/RR) -- [Ember](http://emberjs.com/) - - [RxEmber](https://github.com/blesh/RxEmber) -- [AngularJS](https://github.com/Reactive-Extensions/rx.angular.js) -- [HTML DOM](https://github.com/Reactive-Extensions/RxJS-DOM) -- [jQuery (1.4+)](https://github.com/Reactive-Extensions/RxJS-jQuery) -- [MooTools](https://github.com/Reactive-Extensions/RxJS-MooTools) -- [Dojo 1.7+](https://github.com/Reactive-Extensions/RxJS-Dojo) -- [ExtJS](https://github.com/Reactive-Extensions/RxJS-ExtJS) - -## Compatibility ## - -RxJS has been thoroughly tested against all major browsers and supports IE6+, Chrome 4+, FireFox 1+, and Node.js v0.4+. - -## Contributing ## - -There are lots of ways to contribute to the project, and we appreciate our [contributors](https://github.com/Reactive-Extensions/RxJS/wiki/Contributors). If you wish to contribute, check out our [style guide]((https://github.com/Reactive-Extensions/RxJS/tree/master/doc/contributing)). - -You can contribute by reviewing and sending feedback on code checkins, suggesting and trying out new features as they are implemented, submit bugs and help us verify fixes as they are checked in, as well as submit code fixes or code contributions of your own. Note that all code submissions will be rigorously reviewed and tested by the Rx Team, and only those that meet an extremely high bar for both quality and design/roadmap appropriateness will be merged into the source. - -## License ## - -Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. -Microsoft Open Technologies would like to thank its contributors, a list -of whom are at https://github.com/Reactive-Extensions/RxJS/wiki/Contributors. - -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 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -implied. See the License for the specific language governing permissions -and limitations under the License. diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx-lite.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx-lite.d.ts deleted file mode 100644 index ce7c0895bd5390..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx-lite.d.ts +++ /dev/null @@ -1,695 +0,0 @@ -// DefinitelyTyped: partial - -// This file contains common part of defintions for rx.d.ts and rx.lite.d.ts -// Do not include the file separately. - -declare module Rx { - export module internals { - function isEqual(left: any, right: any): boolean; - function addRef(xs: Observable, r: { getDisposable(): IDisposable; }): Observable; - - // Priority Queue for Scheduling - export class PriorityQueue { - constructor(capacity: number); - - length: number; - - isHigherPriority(left: number, right: number): boolean; - percolate(index: number): void; - heapify(index: number): void; - peek(): ScheduledItem; - removeAt(index: number): void; - dequeue(): ScheduledItem; - enqueue(item: ScheduledItem): void; - remove(item: ScheduledItem): boolean; - - static count: number; - } - - export class ScheduledItem { - constructor(scheduler: IScheduler, state: any, action: (scheduler: IScheduler, state: any) => IDisposable, dueTime: TTime, comparer?: (x: TTime, y: TTime) => number); - - scheduler: IScheduler; - state: TTime; - action: (scheduler: IScheduler, state: any) => IDisposable; - dueTime: TTime; - comparer: (x: TTime, y: TTime) => number; - disposable: SingleAssignmentDisposable; - - invoke(): void; - compareTo(other: ScheduledItem): number; - isCancelled(): boolean; - invokeCore(): IDisposable; - } - } - - export module config { - export var Promise: { new (resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): IPromise; }; - } - - export module helpers { - function noop(): void; - function notDefined(value: any): boolean; - function identity(value: T): T; - function defaultNow(): number; - function defaultComparer(left: any, right: any): boolean; - function defaultSubComparer(left: any, right: any): number; - function defaultKeySerializer(key: any): string; - function defaultError(err: any): void; - function isPromise(p: any): boolean; - function asArray(...args: T[]): T[]; - function not(value: any): boolean; - function isFunction(value: any): boolean; - } - - export interface IDisposable { - dispose(): void; - } - - export class CompositeDisposable implements IDisposable { - constructor (...disposables: IDisposable[]); - constructor (disposables: IDisposable[]); - - isDisposed: boolean; - length: number; - - dispose(): void; - add(item: IDisposable): void; - remove(item: IDisposable): boolean; - toArray(): IDisposable[]; - } - - export class Disposable implements IDisposable { - constructor(action: () => void); - - static create(action: () => void): IDisposable; - static empty: IDisposable; - - dispose(): void; - } - - // Single assignment - export class SingleAssignmentDisposable implements IDisposable { - constructor(); - - isDisposed: boolean; - current: IDisposable; - - dispose(): void ; - getDisposable(): IDisposable; - setDisposable(value: IDisposable): void ; - } - - // SerialDisposable it's an alias of SingleAssignmentDisposable - export class SerialDisposable extends SingleAssignmentDisposable { - constructor(); - } - - export class RefCountDisposable implements IDisposable { - constructor(disposable: IDisposable); - - dispose(): void; - - isDisposed: boolean; - getDisposable(): IDisposable; - } - - export interface IScheduler { - now(): number; - isScheduler(value: any): boolean; - - schedule(action: () => void): IDisposable; - scheduleWithState(state: TState, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable; - scheduleWithAbsolute(dueTime: number, action: () => void): IDisposable; - scheduleWithAbsoluteAndState(state: TState, dueTime: number, action: (scheduler: IScheduler, state: TState) =>IDisposable): IDisposable; - scheduleWithRelative(dueTime: number, action: () => void): IDisposable; - scheduleWithRelativeAndState(state: TState, dueTime: number, action: (scheduler: IScheduler, state: TState) =>IDisposable): IDisposable; - - scheduleRecursive(action: (action: () =>void ) =>void ): IDisposable; - scheduleRecursiveWithState(state: TState, action: (state: TState, action: (state: TState) =>void ) =>void ): IDisposable; - scheduleRecursiveWithAbsolute(dueTime: number, action: (action: (dueTime: number) => void) => void): IDisposable; - scheduleRecursiveWithAbsoluteAndState(state: TState, dueTime: number, action: (state: TState, action: (state: TState, dueTime: number) => void) => void): IDisposable; - scheduleRecursiveWithRelative(dueTime: number, action: (action: (dueTime: number) =>void ) =>void ): IDisposable; - scheduleRecursiveWithRelativeAndState(state: TState, dueTime: number, action: (state: TState, action: (state: TState, dueTime: number) =>void ) =>void ): IDisposable; - - schedulePeriodic(period: number, action: () => void): IDisposable; - schedulePeriodicWithState(state: TState, period: number, action: (state: TState) => TState): IDisposable; - } - - export interface Scheduler extends IScheduler { - } - - export interface SchedulerStatic { - new ( - now: () => number, - schedule: (state: any, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable, - scheduleRelative: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable, - scheduleAbsolute: (state: any, dueTime: number, action: (scheduler: IScheduler, state: any) => IDisposable) => IDisposable): Scheduler; - - normalize(timeSpan: number): number; - - immediate: IScheduler; - currentThread: ICurrentThreadScheduler; - timeout: IScheduler; - } - - export var Scheduler: SchedulerStatic; - - // Current Thread IScheduler - interface ICurrentThreadScheduler extends IScheduler { - scheduleRequired(): boolean; - } - - // Notifications - export class Notification { - accept(observer: IObserver): void; - accept(onNext: (value: T) => TResult, onError?: (exception: any) => TResult, onCompleted?: () => TResult): TResult; - toObservable(scheduler?: IScheduler): Observable; - hasValue: boolean; - equals(other: Notification): boolean; - kind: string; - value: T; - exception: any; - - static createOnNext(value: T): Notification; - static createOnError(exception: any): Notification; - static createOnCompleted(): Notification; - } - - /** - * Promise A+ - */ - export interface IPromise { - then(onFulfilled: (value: T) => IPromise, onRejected: (reason: any) => IPromise): IPromise; - then(onFulfilled: (value: T) => IPromise, onRejected?: (reason: any) => R): IPromise; - then(onFulfilled: (value: T) => R, onRejected: (reason: any) => IPromise): IPromise; - then(onFulfilled?: (value: T) => R, onRejected?: (reason: any) => R): IPromise; - } - - // Observer - export interface IObserver { - onNext(value: T): void; - onError(exception: any): void; - onCompleted(): void; - } - - export interface Observer extends IObserver { - toNotifier(): (notification: Notification) => void; - asObserver(): Observer; - } - - interface ObserverStatic { - create(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): Observer; - fromNotifier(handler: (notification: Notification, thisArg?: any) => void): Observer; - } - - export var Observer: ObserverStatic; - - export interface IObservable { - subscribe(observer: Observer): IDisposable; - subscribe(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): IDisposable; - - subscribeOnNext(onNext: (value: T) => void, thisArg?: any): IDisposable; - subscribeOnError(onError: (exception: any) => void, thisArg?: any): IDisposable; - subscribeOnCompleted(onCompleted: () => void, thisArg?: any): IDisposable; - } - - export interface Observable extends IObservable { - forEach(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): IDisposable; // alias for subscribe - toArray(): Observable; - - catch(handler: (exception: any) => Observable): Observable; - catchException(handler: (exception: any) => Observable): Observable; // alias for catch - catch(handler: (exception: any) => IPromise): Observable; - catchException(handler: (exception: any) => IPromise): Observable; // alias for catch - catch(second: Observable): Observable; - catchException(second: Observable): Observable; // alias for catch - combineLatest(second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; - combineLatest(second: IPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; - combineLatest(second: Observable, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(second: Observable, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(second: IPromise, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(second: IPromise, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(second: Observable, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(second: Observable, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(second: Observable, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(second: Observable, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(second: IPromise, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(second: IPromise, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(second: IPromise, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(second: IPromise, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(second: Observable, third: Observable, fourth: Observable, fifth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable; - combineLatest(souces: Observable[], resultSelector: (firstValue: T, ...otherValues: TOther[]) => TResult): Observable; - combineLatest(souces: IPromise[], resultSelector: (firstValue: T, ...otherValues: TOther[]) => TResult): Observable; - withLatestFrom(second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; - withLatestFrom(second: IPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; - withLatestFrom(second: Observable, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - withLatestFrom(second: Observable, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - withLatestFrom(second: IPromise, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - withLatestFrom(second: IPromise, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - withLatestFrom(second: Observable, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(second: Observable, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(second: Observable, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(second: Observable, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(second: IPromise, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(second: IPromise, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(second: IPromise, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(second: IPromise, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(second: Observable, third: Observable, fourth: Observable, fifth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable; - withLatestFrom(souces: Observable[], resultSelector: (firstValue: T, ...otherValues: TOther[]) => TResult): Observable; - withLatestFrom(souces: IPromise[], resultSelector: (firstValue: T, ...otherValues: TOther[]) => TResult): Observable; - concat(...sources: Observable[]): Observable; - concat(...sources: IPromise[]): Observable; - concat(sources: Observable[]): Observable; - concat(sources: IPromise[]): Observable; - concatAll(): T; - concatObservable(): T; // alias for concatAll - concatMap(selector: (value: T, index: number) => Observable, resultSelector: (value1: T, value2: T2, index: number) => R): Observable; // alias for selectConcat - concatMap(selector: (value: T, index: number) => IPromise, resultSelector: (value1: T, value2: T2, index: number) => R): Observable; // alias for selectConcat - concatMap(selector: (value: T, index: number) => Observable): Observable; // alias for selectConcat - concatMap(selector: (value: T, index: number) => IPromise): Observable; // alias for selectConcat - concatMap(sequence: Observable): Observable; // alias for selectConcat - merge(maxConcurrent: number): T; - merge(other: Observable): Observable; - merge(other: IPromise): Observable; - mergeAll(): T; - mergeObservable(): T; // alias for mergeAll - skipUntil(other: Observable): Observable; - skipUntil(other: IPromise): Observable; - switch(): T; - switchLatest(): T; // alias for switch - takeUntil(other: Observable): Observable; - takeUntil(other: IPromise): Observable; - zip(second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; - zip(second: IPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; - zip(second: Observable, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - zip(second: Observable, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - zip(second: IPromise, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - zip(second: IPromise, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - zip(second: Observable, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - zip(second: Observable, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - zip(second: Observable, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - zip(second: Observable, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - zip(second: IPromise, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - zip(second: IPromise, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - zip(second: IPromise, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - zip(second: IPromise, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - zip(second: Observable, third: Observable, fourth: Observable, fifth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable; - zip(second: Observable[], resultSelector: (left: T, ...right: TOther[]) => TResult): Observable; - zip(second: IPromise[], resultSelector: (left: T, ...right: TOther[]) => TResult): Observable; - - asObservable(): Observable; - dematerialize(): Observable; - distinctUntilChanged(skipParameter: boolean, comparer: (x: T, y: T) => boolean): Observable; - distinctUntilChanged(keySelector?: (value: T) => TValue, comparer?: (x: TValue, y: TValue) => boolean): Observable; - do(observer: Observer): Observable; - doAction(observer: Observer): Observable; // alias for do - tap(observer: Observer): Observable; // alias for do - do(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): Observable; - doAction(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): Observable; // alias for do - tap(onNext?: (value: T) => void, onError?: (exception: any) => void, onCompleted?: () => void): Observable; // alias for do - - doOnNext(onNext: (value: T) => void, thisArg?: any): Observable; - doOnError(onError: (exception: any) => void, thisArg?: any): Observable; - doOnCompleted(onCompleted: () => void, thisArg?: any): Observable; - tapOnNext(onNext: (value: T) => void, thisArg?: any): Observable; - tapOnError(onError: (exception: any) => void, thisArg?: any): Observable; - tapOnCompleted(onCompleted: () => void, thisArg?: any): Observable; - - finally(action: () => void): Observable; - finallyAction(action: () => void): Observable; // alias for finally - ignoreElements(): Observable; - materialize(): Observable>; - repeat(repeatCount?: number): Observable; - retry(retryCount?: number): Observable; - scan(seed: TAcc, accumulator: (acc: TAcc, value: T) => TAcc): Observable; - scan(accumulator: (acc: T, value: T) => T): Observable; - skipLast(count: number): Observable; - startWith(...values: T[]): Observable; - startWith(scheduler: IScheduler, ...values: T[]): Observable; - takeLast(count: number): Observable; - takeLastBuffer(count: number): Observable; - - select(selector: (value: T, index: number, source: Observable) => TResult, thisArg?: any): Observable; - map(selector: (value: T, index: number, source: Observable) => TResult, thisArg?: any): Observable; // alias for select - pluck(prop: string): Observable; - selectMany(selector: (value: T) => Observable, resultSelector: (item: T, other: TOther) => TResult): Observable; - selectMany(selector: (value: T) => IPromise, resultSelector: (item: T, other: TOther) => TResult): Observable; - selectMany(selector: (value: T) => Observable): Observable; - selectMany(selector: (value: T) => IPromise): Observable; - selectMany(other: Observable): Observable; - selectMany(other: IPromise): Observable; - flatMap(selector: (value: T) => Observable, resultSelector: (item: T, other: TOther) => TResult): Observable; // alias for selectMany - flatMap(selector: (value: T) => IPromise, resultSelector: (item: T, other: TOther) => TResult): Observable; // alias for selectMany - flatMap(selector: (value: T) => Observable): Observable; // alias for selectMany - flatMap(selector: (value: T) => IPromise): Observable; // alias for selectMany - flatMap(other: Observable): Observable; // alias for selectMany - flatMap(other: IPromise): Observable; // alias for selectMany - - selectConcat(selector: (value: T, index: number) => Observable, resultSelector: (value1: T, value2: T2, index: number) => R): Observable; - selectConcat(selector: (value: T, index: number) => IPromise, resultSelector: (value1: T, value2: T2, index: number) => R): Observable; - selectConcat(selector: (value: T, index: number) => Observable): Observable; - selectConcat(selector: (value: T, index: number) => IPromise): Observable; - selectConcat(sequence: Observable): Observable; - - /** - * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then - * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. - * @param selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. - * @param [thisArg] Object to use as this when executing callback. - * @returns An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences - * and that at any point in time produces the elements of the most recent inner observable sequence that has been received. - */ - selectSwitch(selector: (value: T, index: number, source: Observable) => Observable, thisArg?: any): Observable; - /** - * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then - * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. - * @param selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. - * @param [thisArg] Object to use as this when executing callback. - * @returns An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences - * and that at any point in time produces the elements of the most recent inner observable sequence that has been received. - */ - flatMapLatest(selector: (value: T, index: number, source: Observable) => Observable, thisArg?: any): Observable; // alias for selectSwitch - /** - * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then - * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. - * @param selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. - * @param [thisArg] Object to use as this when executing callback. - * @since 2.2.28 - * @returns An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences - * and that at any point in time produces the elements of the most recent inner observable sequence that has been received. - */ - switchMap(selector: (value: T, index: number, source: Observable) => TResult, thisArg?: any): Observable; // alias for selectSwitch - - skip(count: number): Observable; - skipWhile(predicate: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; - take(count: number, scheduler?: IScheduler): Observable; - takeWhile(predicate: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; - where(predicate: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; - filter(predicate: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; // alias for where - - /** - * Converts an existing observable sequence to an ES6 Compatible Promise - * @example - * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise); - * @param promiseCtor The constructor of the promise. - * @returns An ES6 compatible promise with the last value from the observable sequence. - */ - toPromise>(promiseCtor: { new (resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): TPromise; }): TPromise; - /** - * Converts an existing observable sequence to an ES6 Compatible Promise - * @example - * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise); - * - * // With config - * Rx.config.Promise = RSVP.Promise; - * var promise = Rx.Observable.return(42).toPromise(); - * @param [promiseCtor] The constructor of the promise. If not provided, it looks for it in Rx.config.Promise. - * @returns An ES6 compatible promise with the last value from the observable sequence. - */ - toPromise(promiseCtor?: { new (resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): IPromise; }): IPromise; - - // Experimental Flattening - - /** - * Performs a exclusive waiting for the first to finish before subscribing to another observable. - * Observables that come in between subscriptions will be dropped on the floor. - * Can be applied on `Observable>` or `Observable>`. - * @since 2.2.28 - * @returns A exclusive observable with only the results that happen when subscribed. - */ - exclusive(): Observable; - - /** - * Performs a exclusive map waiting for the first to finish before subscribing to another observable. - * Observables that come in between subscriptions will be dropped on the floor. - * Can be applied on `Observable>` or `Observable>`. - * @since 2.2.28 - * @param selector Selector to invoke for every item in the current subscription. - * @param [thisArg] An optional context to invoke with the selector parameter. - * @returns {An exclusive observable with only the results that happen when subscribed. - */ - exclusiveMap(selector: (value: I, index: number, source: Observable) => R, thisArg?: any): Observable; - } - - interface ObservableStatic { - create(subscribe: (observer: Observer) => IDisposable): Observable; - create(subscribe: (observer: Observer) => () => void): Observable; - create(subscribe: (observer: Observer) => void): Observable; - createWithDisposable(subscribe: (observer: Observer) => IDisposable): Observable; - defer(observableFactory: () => Observable): Observable; - defer(observableFactory: () => IPromise): Observable; - empty(scheduler?: IScheduler): Observable; - - /** - * This method creates a new Observable sequence from an array object. - * @param array An array-like or iterable object to convert to an Observable sequence. - * @param mapFn Map function to call on every element of the array. - * @param [thisArg] The context to use calling the mapFn if provided. - * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. - */ - from(array: T[], mapFn: (value: T, index: number) => TResult, thisArg?: any, scheduler?: IScheduler): Observable; - /** - * This method creates a new Observable sequence from an array object. - * @param array An array-like or iterable object to convert to an Observable sequence. - * @param [mapFn] Map function to call on every element of the array. - * @param [thisArg] The context to use calling the mapFn if provided. - * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. - */ - from(array: T[], mapFn?: (value: T, index: number) => T, thisArg?: any, scheduler?: IScheduler): Observable; - - /** - * This method creates a new Observable sequence from an array-like object. - * @param array An array-like or iterable object to convert to an Observable sequence. - * @param mapFn Map function to call on every element of the array. - * @param [thisArg] The context to use calling the mapFn if provided. - * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. - */ - from(array: { length: number;[index: number]: T; }, mapFn: (value: T, index: number) => TResult, thisArg?: any, scheduler?: IScheduler): Observable; - /** - * This method creates a new Observable sequence from an array-like object. - * @param array An array-like or iterable object to convert to an Observable sequence. - * @param [mapFn] Map function to call on every element of the array. - * @param [thisArg] The context to use calling the mapFn if provided. - * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. - */ - from(array: { length: number;[index: number]: T; }, mapFn?: (value: T, index: number) => T, thisArg?: any, scheduler?: IScheduler): Observable; - - /** - * This method creates a new Observable sequence from an array-like or iterable object. - * @param array An array-like or iterable object to convert to an Observable sequence. - * @param [mapFn] Map function to call on every element of the array. - * @param [thisArg] The context to use calling the mapFn if provided. - * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. - */ - from(iterable: any, mapFn?: (value: any, index: number) => T, thisArg?: any, scheduler?: IScheduler): Observable; - - fromArray(array: T[], scheduler?: IScheduler): Observable; - fromArray(array: { length: number;[index: number]: T; }, scheduler?: IScheduler): Observable; - - /** - * Converts an iterable into an Observable sequence - * - * @example - * var res = Rx.Observable.fromIterable(new Map()); - * var res = Rx.Observable.fromIterable(function* () { yield 42; }); - * var res = Rx.Observable.fromIterable(new Set(), Rx.Scheduler.timeout); - * @param generator Generator to convert from. - * @param [scheduler] Scheduler to run the enumeration of the input sequence on. - * @returns The observable sequence whose elements are pulled from the given generator sequence. - */ - fromItreable(generator: () => { next(): { done: boolean; value?: T; }; }, scheduler?: IScheduler): Observable; - - /** - * Converts an iterable into an Observable sequence - * - * @example - * var res = Rx.Observable.fromIterable(new Map()); - * var res = Rx.Observable.fromIterable(new Set(), Rx.Scheduler.timeout); - * @param iterable Iterable to convert from. - * @param [scheduler] Scheduler to run the enumeration of the input sequence on. - * @returns The observable sequence whose elements are pulled from the given generator sequence. - */ - fromItreable(iterable: {}, scheduler?: IScheduler): Observable; // todo: can't describe ES6 Iterable via TypeScript type system - generate(initialState: TState, condition: (state: TState) => boolean, iterate: (state: TState) => TState, resultSelector: (state: TState) => TResult, scheduler?: IScheduler): Observable; - never(): Observable; - - /** - * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. - * - * @example - * var res = Rx.Observable.of(1, 2, 3); - * @since 2.2.28 - * @returns The observable sequence whose elements are pulled from the given arguments. - */ - of(...values: T[]): Observable; - - /** - * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. - * @example - * var res = Rx.Observable.ofWithScheduler(Rx.Scheduler.timeout, 1, 2, 3); - * @since 2.2.28 - * @param [scheduler] A scheduler to use for scheduling the arguments. - * @returns The observable sequence whose elements are pulled from the given arguments. - */ - ofWithScheduler(scheduler?: IScheduler, ...values: T[]): Observable; - range(start: number, count: number, scheduler?: IScheduler): Observable; - repeat(value: T, repeatCount?: number, scheduler?: IScheduler): Observable; - return(value: T, scheduler?: IScheduler): Observable; - /** - * @since 2.2.28 - */ - just(value: T, scheduler?: IScheduler): Observable; // alias for return - returnValue(value: T, scheduler?: IScheduler): Observable; // alias for return - throw(exception: Error, scheduler?: IScheduler): Observable; - throw(exception: any, scheduler?: IScheduler): Observable; - throwException(exception: Error, scheduler?: IScheduler): Observable; // alias for throw - throwException(exception: any, scheduler?: IScheduler): Observable; // alias for throw - throwError(error: Error, scheduler?: IScheduler): Observable; // alias for throw - throwError(error: any, scheduler?: IScheduler): Observable; // alias for throw - - catch(sources: Observable[]): Observable; - catch(sources: IPromise[]): Observable; - catchException(sources: Observable[]): Observable; // alias for catch - catchException(sources: IPromise[]): Observable; // alias for catch - catchError(sources: Observable[]): Observable; // alias for catch - catchError(sources: IPromise[]): Observable; // alias for catch - catch(...sources: Observable[]): Observable; - catch(...sources: IPromise[]): Observable; - catchException(...sources: Observable[]): Observable; // alias for catch - catchException(...sources: IPromise[]): Observable; // alias for catch - catchError(...sources: Observable[]): Observable; // alias for catch - catchError(...sources: IPromise[]): Observable; // alias for catch - - combineLatest(first: Observable, second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; - combineLatest(first: IPromise, second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; - combineLatest(first: Observable, second: IPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; - combineLatest(first: IPromise, second: IPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; - combineLatest(first: Observable, second: Observable, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(first: Observable, second: Observable, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(first: Observable, second: IPromise, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(first: Observable, second: IPromise, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(first: IPromise, second: Observable, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(first: IPromise, second: Observable, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(first: IPromise, second: IPromise, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(first: IPromise, second: IPromise, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - combineLatest(first: Observable, second: Observable, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: Observable, second: Observable, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: Observable, second: Observable, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: Observable, second: Observable, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: Observable, second: IPromise, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: Observable, second: IPromise, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: Observable, second: IPromise, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: Observable, second: IPromise, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: IPromise, second: Observable, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: IPromise, second: Observable, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: IPromise, second: Observable, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: IPromise, second: Observable, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: IPromise, second: IPromise, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: IPromise, second: IPromise, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: IPromise, second: IPromise, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: IPromise, second: IPromise, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - combineLatest(first: Observable, second: Observable, third: Observable, fourth: Observable, fifth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable; - combineLatest(souces: Observable[], resultSelector: (...otherValues: TOther[]) => TResult): Observable; - combineLatest(souces: IPromise[], resultSelector: (...otherValues: TOther[]) => TResult): Observable; - - withLatestFrom(first: Observable, second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; - withLatestFrom(first: IPromise, second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; - withLatestFrom(first: Observable, second: IPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; - withLatestFrom(first: IPromise, second: IPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; - withLatestFrom(first: Observable, second: Observable, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - withLatestFrom(first: Observable, second: Observable, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - withLatestFrom(first: Observable, second: IPromise, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - withLatestFrom(first: Observable, second: IPromise, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - withLatestFrom(first: IPromise, second: Observable, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - withLatestFrom(first: IPromise, second: Observable, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - withLatestFrom(first: IPromise, second: IPromise, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - withLatestFrom(first: IPromise, second: IPromise, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; - withLatestFrom(first: Observable, second: Observable, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: Observable, second: Observable, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: Observable, second: Observable, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: Observable, second: Observable, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: Observable, second: IPromise, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: Observable, second: IPromise, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: Observable, second: IPromise, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: Observable, second: IPromise, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: IPromise, second: Observable, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: IPromise, second: Observable, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: IPromise, second: Observable, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: IPromise, second: Observable, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: IPromise, second: IPromise, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: IPromise, second: IPromise, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: IPromise, second: IPromise, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: IPromise, second: IPromise, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; - withLatestFrom(first: Observable, second: Observable, third: Observable, fourth: Observable, fifth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable; - withLatestFrom(souces: Observable[], resultSelector: (...otherValues: TOther[]) => TResult): Observable; - withLatestFrom(souces: IPromise[], resultSelector: (...otherValues: TOther[]) => TResult): Observable; - - concat(...sources: Observable[]): Observable; - concat(...sources: IPromise[]): Observable; - concat(sources: Observable[]): Observable; - concat(sources: IPromise[]): Observable; - merge(...sources: Observable[]): Observable; - merge(...sources: IPromise[]): Observable; - merge(sources: Observable[]): Observable; - merge(sources: IPromise[]): Observable; - merge(scheduler: IScheduler, ...sources: Observable[]): Observable; - merge(scheduler: IScheduler, ...sources: IPromise[]): Observable; - merge(scheduler: IScheduler, sources: Observable[]): Observable; - merge(scheduler: IScheduler, sources: IPromise[]): Observable; - - zip(first: Observable, sources: Observable[], resultSelector: (item1: T1, ...right: T2[]) => TResult): Observable; - zip(first: Observable, sources: IPromise[], resultSelector: (item1: T1, ...right: T2[]) => TResult): Observable; - zip(source1: Observable, source2: Observable, resultSelector: (item1: T1, item2: T2) => TResult): Observable; - zip(source1: Observable, source2: IPromise, resultSelector: (item1: T1, item2: T2) => TResult): Observable; - zip(source1: Observable, source2: Observable, source3: Observable, resultSelector: (item1: T1, item2: T2, item3: T3) => TResult): Observable; - zip(source1: Observable, source2: Observable, source3: IPromise, resultSelector: (item1: T1, item2: T2, item3: T3) => TResult): Observable; - zip(source1: Observable, source2: IPromise, source3: Observable, resultSelector: (item1: T1, item2: T2, item3: T3) => TResult): Observable; - zip(source1: Observable, source2: IPromise, source3: IPromise, resultSelector: (item1: T1, item2: T2, item3: T3) => TResult): Observable; - zip(source1: Observable, source2: Observable, source3: Observable, source4: Observable, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; - zip(source1: Observable, source2: Observable, source3: Observable, source4: IPromise, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; - zip(source1: Observable, source2: Observable, source3: IPromise, source4: Observable, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; - zip(source1: Observable, source2: Observable, source3: IPromise, source4: IPromise, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; - zip(source1: Observable, source2: IPromise, source3: Observable, source4: Observable, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; - zip(source1: Observable, source2: IPromise, source3: Observable, source4: IPromise, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; - zip(source1: Observable, source2: IPromise, source3: IPromise, source4: Observable, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; - zip(source1: Observable, source2: IPromise, source3: IPromise, source4: IPromise, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4) => TResult): Observable; - zip(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, resultSelector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5) => TResult): Observable; - zipArray(...sources: Observable[]): Observable; - zipArray(sources: Observable[]): Observable; - - /** - * Converts a Promise to an Observable sequence - * @param promise An ES6 Compliant promise. - * @returns An Observable sequence which wraps the existing promise success and failure. - */ - fromPromise(promise: IPromise): Observable; - - prototype: any; - } - - export var Observable: ObservableStatic; - - interface ISubject extends Observable, Observer, IDisposable { - hasObservers(): boolean; - } - - export interface Subject extends ISubject { - } - - interface SubjectStatic { - new (): Subject; - create(observer?: Observer, observable?: Observable): ISubject; - } - - export var Subject: SubjectStatic; - - export interface AsyncSubject extends Subject { - } - - interface AsyncSubjectStatic { - new (): AsyncSubject; - } - - export var AsyncSubject: AsyncSubjectStatic; -} diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.aggregates.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.aggregates.d.ts deleted file mode 100644 index a3a8e15e19125e..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.aggregates.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -// Type definitions for RxJS-Aggregates v2.2.28 -// Project: http://rx.codeplex.com/ -// Definitions by: Carl de Billy , Igor Oleinikov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module Rx { - export interface Observable { - finalValue(): Observable; - aggregate(accumulator: (acc: T, value: T) => T): Observable; - aggregate(seed: TAcc, accumulator: (acc: TAcc, value: T) => TAcc): Observable; - - reduce(accumulator: (acc: T, value: T) => T): Observable; - reduce(accumulator: (acc: TAcc, value: T) => TAcc, seed: TAcc): Observable; // TS0.9.5: won't work https://typescript.codeplex.com/discussions/471751 - - any(predicate?: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; - some(predicate?: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; // alias for any - - isEmpty(): Observable; - all(predicate?: (value: T) => boolean, thisArg?: any): Observable; - every(predicate?: (value: T) => boolean, thisArg?: any): Observable; // alias for all - contains(value: T): Observable; - contains(value: TOther, comparer: (value1: T, value2: TOther) => boolean): Observable; - count(predicate?: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; - sum(keySelector?: (value: T, index: number, source: Observable) => number, thisArg?: any): Observable; - minBy(keySelector: (item: T) => TKey, comparer: (value1: TKey, value2: TKey) => number): Observable; - minBy(keySelector: (item: T) => number): Observable; - min(comparer?: (value1: T, value2: T) => number): Observable; - maxBy(keySelector: (item: T) => TKey, comparer: (value1: TKey, value2: TKey) => number): Observable; - maxBy(keySelector: (item: T) => number): Observable; - max(comparer?: (value1: T, value2: T) => number): Observable; - average(keySelector?: (value: T, index: number, source: Observable) => number, thisArg?: any): Observable; - - sequenceEqual(second: Observable, comparer: (value1: T, value2: TOther) => number): Observable; - sequenceEqual(second: IPromise, comparer: (value1: T, value2: TOther) => number): Observable; - sequenceEqual(second: Observable): Observable; - sequenceEqual(second: IPromise): Observable; - sequenceEqual(second: TOther[], comparer: (value1: T, value2: TOther) => number): Observable; - sequenceEqual(second: T[]): Observable; - - elementAt(index: number): Observable; - elementAtOrDefault(index: number, defaultValue?: T): Observable; - - single(predicate?: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; - singleOrDefault(predicate?: (value: T, index: number, source: Observable) => boolean, defaultValue?: T, thisArg?: any): Observable; - - first(predicate?: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; - firstOrDefault(predicate?: (value: T, index: number, source: Observable) => boolean, defaultValue?: T, thisArg?: any): Observable; - - last(predicate?: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; - lastOrDefault(predicate?: (value: T, index: number, source: Observable) => boolean, defaultValue?: T, thisArg?: any): Observable; - - find(predicate: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; - findIndex(predicate: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; - } -} - -declare module "rx.aggregates" { - export = Rx; -} diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.all.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.all.d.ts deleted file mode 100644 index c546477b80e2c6..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.all.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Type definitions for RxJS-All v2.2.28 -// Project: http://rx.codeplex.com/ -// Definitions by: Carl de Billy , Igor Oleinikov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// - -declare module "rx.all" { - export = Rx; -} \ No newline at end of file diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.async-lite.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.async-lite.d.ts deleted file mode 100644 index f86dc326f34472..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.async-lite.d.ts +++ /dev/null @@ -1,72 +0,0 @@ -// DefinitelyTyped: partial - -// This file contains common part of defintions for rx.async.d.ts and rx.lite.d.ts -// Do not include the file separately. - -/// - -declare module Rx { - export module config { - /** - * Configuration option to determine whether to use native events only - */ - export var useNativeEvents: boolean; - } - - interface ObservableStatic { - /** - * Invokes the asynchronous function, surfacing the result through an observable sequence. - * @param functionAsync Asynchronous function which returns a Promise to run. - * @returns An observable sequence exposing the function's result value, or an exception. - */ - startAsync(functionAsync: () => IPromise): Observable; - - fromCallback: { - // with single result callback without selector - (func: (callback: (result: TResult) => any) => any, context?: any): () => Observable; - (func: (arg1: T1, callback: (result: TResult) => any) => any, context?: any): (arg1: T1) => Observable; - (func: (arg1: T1, arg2: T2, callback: (result: TResult) => any) => any, context?: any): (arg1: T1, arg2: T2) => Observable; - (func: (arg1: T1, arg2: T2, arg3: T3, callback: (result: TResult) => any) => any, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; - // with any callback with selector - (func: (callback: Function) => any, context: any, selector: (args: TCallbackResult[]) => TResult): () => Observable; - (func: (arg1: T1, callback: Function) => any, context: any, selector: (args: TCallbackResult[]) => TResult): (arg1: T1) => Observable; - (func: (arg1: T1, arg2: T2, callback: Function) => any, context: any, selector: (args: TCallbackResult[]) => TResult): (arg1: T1, arg2: T2) => Observable; - (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, context: any, selector: (args: TCallbackResult[]) => TResult): (arg1: T1, arg2: T2, arg3: T3) => Observable; - // with any callback without selector - (func: (callback: Function) => any, context?: any): () => Observable; - (func: (arg1: T1, callback: Function) => any, context?: any): (arg1: T1) => Observable; - (func: (arg1: T1, arg2: T2, callback: Function) => any, context?: any): (arg1: T1, arg2: T2) => Observable; - (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; - // with any function with selector - (func: Function, context: any, selector: (args: TCallbackResult[]) => TResult): (...args: any[]) => Observable; - // with any function without selector - (func: Function, context?: any): (...args: any[]) => Observable; - }; - - fromNodeCallback: { - // with single result callback without selector - (func: (callback: (err: any, result: T) => any) => any, context?: any): () => Observable; - (func: (arg1: T1, callback: (err: any, result: T) => any) => any, context?: any): (arg1: T1) => Observable; - (func: (arg1: T1, arg2: T2, callback: (err: any, result: T) => any) => any, context?: any): (arg1: T1, arg2: T2) => Observable; - (func: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: T) => any) => any, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; - // with any callback with selector - (func: (callback: Function) => any, context: any, selector: (results: TC[]) => TR): () => Observable; - (func: (arg1: T1, callback: Function) => any, context: any, selector: (results: TC[]) => TR): (arg1: T1) => Observable; - (func: (arg1: T1, arg2: T2, callback: Function) => any, context: any, selector: (results: TC[]) => TR): (arg1: T1, arg2: T2) => Observable; - (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, context: any, selector: (results: TC[]) => TR): (arg1: T1, arg2: T2, arg3: T3) => Observable; - // with any callback without selector - (func: (callback: Function) => any, context?: any): () => Observable; - (func: (arg1: T1, callback: Function) => any, context?: any): (arg1: T1) => Observable; - (func: (arg1: T1, arg2: T2, callback: Function) => any, context?: any): (arg1: T1, arg2: T2) => Observable; - (func: (arg1: T1, arg2: T2, arg3: T3, callback: Function) => any, context?: any): (arg1: T1, arg2: T2, arg3: T3) => Observable; - // with any function with selector - (func: Function, context: any, selector: (results: TC[]) => T): (...args: any[]) => Observable; - // with any function without selector - (func: Function, context?: any): (...args: any[]) => Observable; - }; - - fromEvent(element: NodeList, eventName: string, selector?: (arguments: any[]) => T): Observable; - fromEvent(element: Node, eventName: string, selector?: (arguments: any[]) => T): Observable; - fromEventPattern(addHandler: (handler: Function) => void, removeHandler: (handler: Function) => void, selector?: (arguments: any[])=>T): Observable; - } -} diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.async-tests.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.async-tests.ts deleted file mode 100644 index 6fe10526c7603a..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.async-tests.ts +++ /dev/null @@ -1,84 +0,0 @@ -// Tests for RxJS-Async TypeScript definitions -// Tests by Igor Oleinikov - -/// - -module Rx.Tests.Async { - - var obsNum: Rx.Observable; - var obsStr: Rx.Observable; - var sch: Rx.IScheduler; - - function start() { - obsNum = Rx.Observable.start(()=> 10, obsStr, sch); - obsNum = Rx.Observable.start(() => 10, obsStr); - obsNum = Rx.Observable.start(()=> 10); - } - - function toAsync() { - obsNum = Rx.Observable.toAsync(()=> 1, sch)(); - obsNum = Rx.Observable.toAsync((a1: number)=> a1)(1); - obsStr = Rx.Observable.toAsync((a1: string, a2: number)=> a1 + a2.toFixed(0))("", 1); - obsStr = Rx.Observable.toAsync((a1: string, a2: number, a3: Date)=> a1 + a2.toFixed(0) + a3.toDateString())("", 1, new Date()); - obsStr = Rx.Observable.toAsync((a1: string, a2: number, a3: Date, a4: boolean)=> a1 + a2.toFixed(0) + a3.toDateString() + (a4 ? 1 : 0))("", 1, new Date(), false); - } - - function fromCallback() { - // 0 arguments - var func0: (cb: (result: number)=> void)=> void; - obsNum = Rx.Observable.fromCallback(func0)(); - obsNum = Rx.Observable.fromCallback(func0, obsStr)(); - obsNum = Rx.Observable.fromCallback(func0, obsStr, (results: number[]) => results[0])(); - - // 1 argument - var func1: (a: string, cb: (result: number)=> void)=> number; - obsNum = Rx.Observable.fromCallback(func1)(""); - obsNum = Rx.Observable.fromCallback(func1, {})(""); - obsNum = Rx.Observable.fromCallback(func1, {}, (results: number[]) => results[0])(""); - - // 2 arguments - var func2: (a: number, b: string, cb: (result: string) => number) => Date; - obsStr = Rx.Observable.fromCallback(func2)(1, ""); - obsStr = Rx.Observable.fromCallback(func2, {})(1, ""); - obsStr = Rx.Observable.fromCallback(func2, {}, (results: string[]) => results[0])(1, ""); - - // 3 arguments - var func3: (a: number, b: string, c: boolean, cb: (result: string) => number) => Date; - obsStr = Rx.Observable.fromCallback(func3)(1, "", true); - obsStr = Rx.Observable.fromCallback(func3, {})(1, "", true); - obsStr = Rx.Observable.fromCallback(func3, {}, (results: string[]) => results[0])(1, "", true); - - // multiple results - var func0m: (cb: (result1: number, result2: number, result3: number) => void) => void; - obsNum = Rx.Observable.fromCallback(func0m, obsStr, (results: number[]) => results[0])(); - var func1m: (a: string, cb: (result1: number, result2: number, result3: number) => void) => void; - obsNum = Rx.Observable.fromCallback(func1m, obsStr, (results: number[]) => results[0])(""); - var func2m: (a: string, b: number, cb: (result1: string, result2: string, result3: string) => void) => void; - obsStr = Rx.Observable.fromCallback(func2m, obsStr, (results: string[]) => results[0])("", 10); - } - - function toPromise() { - var promiseImpl: { - new(resolver: (resolvePromise: (value: T)=> void, rejectPromise: (reason: any)=> void)=> void): Rx.IPromise; - }; - - Rx.config.Promise = promiseImpl; - - var p: IPromise = obsNum.toPromise(promiseImpl); - - p = obsNum.toPromise(); - - p = p.then(x=> x); - p = p.then(x=> p); - p = p.then(undefined, reason=> 10); - p = p.then(undefined, reason=> p); - - var ps: IPromise = p.then(undefined, reason=> "error"); - ps = p.then(x=> ""); - ps = p.then(x=> ps); - } - - function startAsync() { - var o: Rx.Observable = Rx.Observable.startAsync(() => >null); - } -} diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.async.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.async.d.ts deleted file mode 100644 index f1af9a600023ff..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.async.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -// Type definitions for RxJS-Async v2.2.28 -// Project: http://rx.codeplex.com/ -// Definitions by: zoetrope , Igor Oleinikov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// -/// - -declare module Rx { - interface ObservableStatic { - start(func: () => T, context?: any, scheduler?: IScheduler): Observable; - - toAsync(func: () => TResult, context?: any, scheduler?: IScheduler): () => Observable; - toAsync(func: (arg1: T1) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1) => Observable; - toAsync(func: (arg1?: T1) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1) => Observable; - toAsync(func: (...args: T1[]) => TResult, context?: any, scheduler?: IScheduler): (...args: T1[]) => Observable; - toAsync(func: (arg1: T1, arg2: T2) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2) => Observable; - toAsync(func: (arg1: T1, arg2?: T2) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2?: T2) => Observable; - toAsync(func: (arg1?: T1, arg2?: T2) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1, arg2?: T2) => Observable; - toAsync(func: (arg1: T1, ...args: T2[]) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, ...args: T2[]) => Observable; - toAsync(func: (arg1?: T1, ...args: T2[]) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1, ...args: T2[]) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3: T3) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3: T3) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3?: T3) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3?: T3) => Observable; - toAsync(func: (arg1: T1, arg2?: T2, arg3?: T3) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2?: T2, arg3?: T3) => Observable; - toAsync(func: (arg1?: T1, arg2?: T2, arg3?: T3) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1, arg2?: T2, arg3?: T3) => Observable; - toAsync(func: (arg1: T1, arg2: T2, ...args: T3[]) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, ...args: T3[]) => Observable; - toAsync(func: (arg1: T1, arg2?: T2, ...args: T3[]) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2?: T2, ...args: T3[]) => Observable; - toAsync(func: (arg1?: T1, arg2?: T2, ...args: T3[]) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1, arg2?: T2, ...args: T3[]) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3: T3, arg4?: T4) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3: T3, arg4?: T4) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3?: T3, arg4?: T4) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3?: T3, arg4?: T4) => Observable; - toAsync(func: (arg1: T1, arg2?: T2, arg3?: T3, arg4?: T4) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2?: T2, arg3?: T3, arg4?: T4) => Observable; - toAsync(func: (arg1?: T1, arg2?: T2, arg3?: T3, arg4?: T4) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1, arg2?: T2, arg3?: T3, arg4?: T4) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3: T3, ...args: T4[]) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3: T3, ...args: T4[]) => Observable; - toAsync(func: (arg1: T1, arg2: T2, arg3?: T3, ...args: T4[]) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2: T2, arg3?: T3, ...args: T4[]) => Observable; - toAsync(func: (arg1: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => TResult, context?: any, scheduler?: IScheduler): (arg1: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => Observable; - toAsync(func: (arg1?: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => TResult, context?: any, scheduler?: IScheduler): (arg1?: T1, arg2?: T2, arg3?: T3, ...args: T4[]) => Observable; - } -} - -declare module "rx.async" { - export = Rx; -} diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.backpressure-lite.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.backpressure-lite.d.ts deleted file mode 100644 index 9d4027be69046c..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.backpressure-lite.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -// DefinitelyTyped: partial - -// This file contains common part of defintions for rx.backpressure.d.ts and rx.lite.d.ts -// Do not include the file separately. - -/// - -declare module Rx { - export interface Observable { - /** - * Pauses the underlying observable sequence based upon the observable sequence which yields true/false. - * @example - * var pauser = new Rx.Subject(); - * var source = Rx.Observable.interval(100).pausable(pauser); - * @param pauser The observable sequence used to pause the underlying sequence. - * @returns The observable sequence which is paused based upon the pauser. - */ - pausable(pauser?: Observable): PausableObservable; - - /** - * Pauses the underlying observable sequence based upon the observable sequence which yields true/false, - * and yields the values that were buffered while paused. - * @example - * var pauser = new Rx.Subject(); - * var source = Rx.Observable.interval(100).pausableBuffered(pauser); - * @param pauser The observable sequence used to pause the underlying sequence. - * @returns The observable sequence which is paused based upon the pauser. - */ - pausableBuffered(pauser?: Observable): PausableObservable; - - /** - * Attaches a controller to the observable sequence with the ability to queue. - * @example - * var source = Rx.Observable.interval(100).controlled(); - * source.request(3); // Reads 3 values - */ - controlled(enableQueue?: boolean): ControlledObservable; - } - - export interface ControlledObservable extends Observable { - request(numberOfItems?: number): IDisposable; - } - - export interface PausableObservable extends Observable { - pause(): void; - resume(): void; - } -} diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.backpressure-tests.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.backpressure-tests.ts deleted file mode 100644 index f036a1dc378d0c..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.backpressure-tests.ts +++ /dev/null @@ -1,22 +0,0 @@ -// Tests for RxJS-BackPressure TypeScript definitions -// Tests by Igor Oleinikov - -/// -/// - -function testPausable() { - var o: Rx.Observable; - - var pauser = new Rx.Subject(); - - var p = o.pausable(pauser); - p = o.pausableBuffered(pauser); -} - -function testControlled() { - var o: Rx.Observable; - var c = o.controlled(); - - var d: Rx.IDisposable = c.request(); - d = c.request(5); -} diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.backpressure.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.backpressure.d.ts deleted file mode 100644 index 549cd870a2bc60..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.backpressure.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Type definitions for RxJS-BackPressure v2.3.12 -// Project: http://rx.codeplex.com/ -// Definitions by: Igor Oleinikov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// -/// - -declare module "rx.backpressure" { - export = Rx; -} diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.binding-lite.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.binding-lite.d.ts deleted file mode 100644 index 86db8922cb7775..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.binding-lite.d.ts +++ /dev/null @@ -1,73 +0,0 @@ -// DefinitelyTyped: partial - -// This file contains common part of defintions for rx.binding.d.ts and rx.lite.d.ts -// Do not include the file separately. - -/// - -declare module Rx { - export interface BehaviorSubject extends Subject { - getValue(): T; - } - - interface BehaviorSubjectStatic { - new (initialValue: T): BehaviorSubject; - } - - export var BehaviorSubject: BehaviorSubjectStatic; - - export interface ReplaySubject extends Subject { - } - - interface ReplaySubjectStatic { - new (bufferSize?: number, window?: number, scheduler?: IScheduler): ReplaySubject; - } - - export var ReplaySubject: ReplaySubjectStatic; - - interface ConnectableObservable extends Observable { - connect(): IDisposable; - refCount(): Observable; - } - - interface ConnectableObservableStatic { - new (): ConnectableObservable; - } - - export var ConnectableObservable: ConnectableObservableStatic; - - export interface Observable { - multicast(subject: Observable): ConnectableObservable; - multicast(subjectSelector: () => ISubject, selector: (source: ConnectableObservable) => Observable): Observable; - publish(): ConnectableObservable; - publish(selector: (source: ConnectableObservable) => Observable): Observable; - /** - * Returns an observable sequence that shares a single subscription to the underlying sequence. - * This operator is a specialization of publish which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. - * - * @example - * var res = source.share(); - * - * @returns An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. - */ - share(): Observable; - publishLast(): ConnectableObservable; - publishLast(selector: (source: ConnectableObservable) => Observable): Observable; - publishValue(initialValue: T): ConnectableObservable; - publishValue(selector: (source: ConnectableObservable) => Observable, initialValue: T): Observable; - /** - * Returns an observable sequence that shares a single subscription to the underlying sequence and starts with an initialValue. - * This operator is a specialization of publishValue which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. - * - * @example - * var res = source.shareValue(42); - * - * @param initialValue Initial value received by observers upon subscription. - * @returns An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. - */ - shareValue(initialValue: T): Observable; - replay(selector?: boolean, bufferSize?: number, window?: number, scheduler?: IScheduler): ConnectableObservable; // hack to catch first omitted parameter - replay(selector: (source: ConnectableObservable) => Observable, bufferSize?: number, window?: number, scheduler?: IScheduler): Observable; - shareReplay(bufferSize?: number, window?: number, scheduler?: IScheduler): Observable; - } -} diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.binding.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.binding.d.ts deleted file mode 100644 index 2bd4c5b01f53b5..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.binding.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Type definitions for RxJS-Binding v2.2.28 -// Project: http://rx.codeplex.com/ -// Definitions by: Carl de Billy , Igor Oleinikov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// -/// - -declare module "rx.binding" { - export = Rx; -} diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.coincidence-lite.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.coincidence-lite.d.ts deleted file mode 100644 index ca1cc734738d86..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.coincidence-lite.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -// DefinitelyTyped: partial - -// This file contains common part of defintions for rx.time.d.ts and rx.lite.d.ts -// Do not include the file separately. - -/// - -declare module Rx { - - interface Observable { - /** - * Returns a new observable that triggers on the second and subsequent triggerings of the input observable. - * The Nth triggering of the input observable passes the arguments from the N-1th and Nth triggering as a pair. - * The argument passed to the N-1th triggering is held in hidden internal state until the Nth triggering occurs. - * @returns An observable that triggers on successive pairs of observations from the input observable as an array. - */ - pairwise(): Observable; - - /** - * Returns two observables which partition the observations of the source by the given function. - * The first will trigger observations for those values for which the predicate returns true. - * The second will trigger observations for those values where the predicate returns false. - * The predicate is executed once for each subscribed observer. - * Both also propagate all error observations arising from the source and each completes - * when the source completes. - * @param predicate - * The function to determine which output Observable will trigger a particular observation. - * @returns - * An array of observables. The first triggers when the predicate returns true, - * and the second triggers when the predicate returns false. - */ - partition(predicate: (value: T, index: number, source: Observable) => boolean, thisArg: any): Observable[]; - } -} diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.coincidence.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.coincidence.d.ts deleted file mode 100644 index d06166224afa9a..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.coincidence.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Type definitions for RxJS-Coincidence v2.2.28 -// Project: http://rx.codeplex.com/ -// Definitions by: Carl de Billy , Igor Oleinikov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// -/// - -declare module Rx { - - interface Observable { - join( - right: Observable, - leftDurationSelector: (leftItem: T) => Observable, - rightDurationSelector: (rightItem: TRight) => Observable, - resultSelector: (leftItem: T, rightItem: TRight) => TResult): Observable; - - groupJoin( - right: Observable, - leftDurationSelector: (leftItem: T) => Observable, - rightDurationSelector: (rightItem: TRight) => Observable, - resultSelector: (leftItem: T, rightItem: Observable) => TResult): Observable; - - window(windowOpenings: Observable): Observable>; - window(windowClosingSelector: () => Observable): Observable>; - window(windowOpenings: Observable, windowClosingSelector: () => Observable): Observable>; - - buffer(bufferOpenings: Observable): Observable; - buffer(bufferClosingSelector: () => Observable): Observable; - buffer(bufferOpenings: Observable, bufferClosingSelector: () => Observable): Observable; - } -} - -declare module "rx.coincidence" { - export = Rx; -} diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.d.ts deleted file mode 100644 index a6e46e36d4c99d..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -// Type definitions for RxJS v2.2.28 -// Project: http://rx.codeplex.com/ -// Definitions by: gsino , Igor Oleinikov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module Rx { - export interface IScheduler { - catch(handler: (exception: any) => boolean): IScheduler; - catchException(handler: (exception: any) => boolean): IScheduler; - } - - // Observer - export interface Observer { - checked(): Observer; - } - - interface ObserverStatic { - /** - * Schedules the invocation of observer methods on the given scheduler. - * @param scheduler Scheduler to schedule observer messages on. - * @returns Observer whose messages are scheduled on the given scheduler. - */ - notifyOn(scheduler: IScheduler): Observer; - } - - export interface Observable { - observeOn(scheduler: IScheduler): Observable; - subscribeOn(scheduler: IScheduler): Observable; - - amb(rightSource: Observable): Observable; - amb(rightSource: IPromise): Observable; - onErrorResumeNext(second: Observable): Observable; - onErrorResumeNext(second: IPromise): Observable; - bufferWithCount(count: number, skip?: number): Observable; - windowWithCount(count: number, skip?: number): Observable>; - defaultIfEmpty(defaultValue?: T): Observable; - distinct(skipParameter: boolean, valueSerializer: (value: T) => string): Observable; - distinct(keySelector?: (value: T) => TKey, keySerializer?: (key: TKey) => string): Observable; - groupBy(keySelector: (value: T) => TKey, skipElementSelector?: boolean, keySerializer?: (key: TKey) => string): Observable>; - groupBy(keySelector: (value: T) => TKey, elementSelector: (value: T) => TElement, keySerializer?: (key: TKey) => string): Observable>; - groupByUntil(keySelector: (value: T) => TKey, skipElementSelector: boolean, durationSelector: (group: GroupedObservable) => Observable, keySerializer?: (key: TKey) => string): Observable>; - groupByUntil(keySelector: (value: T) => TKey, elementSelector: (value: T) => TElement, durationSelector: (group: GroupedObservable) => Observable, keySerializer?: (key: TKey) => string): Observable>; - } - - interface ObservableStatic { - using(resourceFactory: () => TResource, observableFactory: (resource: TResource) => Observable): Observable; - amb(...sources: Observable[]): Observable; - amb(...sources: IPromise[]): Observable; - amb(sources: Observable[]): Observable; - amb(sources: IPromise[]): Observable; - onErrorResumeNext(...sources: Observable[]): Observable; - onErrorResumeNext(...sources: IPromise[]): Observable; - onErrorResumeNext(sources: Observable[]): Observable; - onErrorResumeNext(sources: IPromise[]): Observable; - } - - interface GroupedObservable extends Observable { - key: TKey; - underlyingObservable: Observable; - } -} - -declare module "rx" { - export = Rx -} diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.experimental.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.experimental.d.ts deleted file mode 100644 index e80ca03294c735..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.experimental.d.ts +++ /dev/null @@ -1,321 +0,0 @@ -// Type definitions for RxJS-Experimental v2.2.28 -// Project: https://github.com/Reactive-Extensions/RxJS/ -// Definitions by: Igor Oleinikov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module Rx { - - interface Observable { - /** - * Returns an observable sequence that is the result of invoking the selector on the source sequence, without sharing subscriptions. - * This operator allows for a fluent style of writing queries that use the same sequence multiple times. - * - * @param selector Selector function which can use the source sequence as many times as needed, without sharing subscriptions to the source sequence. - * @returns An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. - */ - let(selector: (source: Observable) => Observable): Observable; - - /** - * Returns an observable sequence that is the result of invoking the selector on the source sequence, without sharing subscriptions. - * This operator allows for a fluent style of writing queries that use the same sequence multiple times. - * - * @param selector Selector function which can use the source sequence as many times as needed, without sharing subscriptions to the source sequence. - * @returns An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. - */ - letBind(selector: (source: Observable) => Observable): Observable; - - /** - * Repeats source as long as condition holds emulating a do while loop. - * @param condition The condition which determines if the source will be repeated. - * @returns An observable sequence which is repeated as long as the condition holds. - */ - doWhile(condition: () => boolean): Observable; - - /** - * Expands an observable sequence by recursively invoking selector. - * - * @param selector Selector function to invoke for each produced element, resulting in another sequence to which the selector will be invoked recursively again. - * @param [scheduler] Scheduler on which to perform the expansion. If not provided, this defaults to the current thread scheduler. - * @returns An observable sequence containing all the elements produced by the recursive expansion. - */ - expand(selector: (item: T) => Observable, scheduler?: IScheduler): Observable; - - /** - * Runs two observable sequences in parallel and combines their last elemenets. - * - * @param second Second observable sequence or promise. - * @param resultSelector Result selector function to invoke with the last elements of both sequences. - * @returns An observable sequence with the result of calling the selector function with the last elements of both input sequences. - */ - forkJoin(second: Observable, resultSelector: (left: T, right: TSecond) => TResult): Observable; - forkJoin(second: IPromise, resultSelector: (left: T, right: TSecond) => TResult): Observable; - - /** - * Comonadic bind operator. - * @param selector A transform function to apply to each element. - * @param [scheduler] Scheduler used to execute the operation. If not specified, defaults to the ImmediateScheduler. - * @returns An observable sequence which results from the comonadic bind operation. - */ - manySelect(selector: (item: Observable, index: number, source: Observable) => TResult, scheduler?: IScheduler): Observable; - } - - interface ObservableStatic { - /** - * Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers (condition: () => boolean, thenSource: Observable, elseSource: Observable): Observable; - if(condition: () => boolean, thenSource: Observable, elseSource: IPromise): Observable; - if(condition: () => boolean, thenSource: IPromise, elseSource: Observable): Observable; - if(condition: () => boolean, thenSource: IPromise, elseSource: IPromise): Observable; - - /** - * Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers (condition: () => boolean, thenSource: Observable, scheduler?: IScheduler): Observable; - if(condition: () => boolean, thenSource: IPromise, scheduler?: IScheduler): Observable; - - /** - * Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers (condition: () => boolean, thenSource: Observable, elseSource: Observable): Observable; - ifThen(condition: () => boolean, thenSource: Observable, elseSource: IPromise): Observable; - ifThen(condition: () => boolean, thenSource: IPromise, elseSource: Observable): Observable; - ifThen(condition: () => boolean, thenSource: IPromise, elseSource: IPromise): Observable; - - /** - * Determines whether an observable collection contains values. There is an alias for this method called 'ifThen' for browsers (condition: () => boolean, thenSource: Observable, scheduler?: IScheduler): Observable; - ifThen(condition: () => boolean, thenSource: IPromise, scheduler?: IScheduler): Observable; - - /** - * Concatenates the observable sequences obtained by running the specified result selector for each element in source. - * There is an alias for this method called 'forIn' for browsers (sources: T[], resultSelector: (item: T) => Observable): Observable; - - /** - * Concatenates the observable sequences obtained by running the specified result selector for each element in source. - * There is an alias for this method called 'forIn' for browsers (sources: T[], resultSelector: (item: T) => Observable): Observable; - - /** - * Repeats source as long as condition holds emulating a while loop. - * There is an alias for this method called 'whileDo' for browsers (condition: () => boolean, source: Observable): Observable; - while(condition: () => boolean, source: IPromise): Observable; - - /** - * Repeats source as long as condition holds emulating a while loop. - * There is an alias for this method called 'whileDo' for browsers (condition: () => boolean, source: Observable): Observable; - whileDo(condition: () => boolean, source: IPromise): Observable; - - /** - * Uses selector to determine which source in sources to use. - * There is an alias 'switchCase' for browsers (selector: () => string, sources: { [key: string]: Observable; }, elseSource: Observable): Observable; - case(selector: () => string, sources: { [key: string]: IPromise; }, elseSource: Observable): Observable; - case(selector: () => string, sources: { [key: string]: Observable; }, elseSource: IPromise): Observable; - case(selector: () => string, sources: { [key: string]: IPromise; }, elseSource: IPromise): Observable; - - /** - * Uses selector to determine which source in sources to use. - * There is an alias 'switchCase' for browsers (selector: () => string, sources: { [key: string]: Observable; }, scheduler?: IScheduler): Observable; - case(selector: () => string, sources: { [key: string]: IPromise; }, scheduler?: IScheduler): Observable; - - /** - * Uses selector to determine which source in sources to use. - * There is an alias 'switchCase' for browsers (selector: () => number, sources: { [key: number]: Observable; }, elseSource: Observable): Observable; - case(selector: () => number, sources: { [key: number]: IPromise; }, elseSource: Observable): Observable; - case(selector: () => number, sources: { [key: number]: Observable; }, elseSource: IPromise): Observable; - case(selector: () => number, sources: { [key: number]: IPromise; }, elseSource: IPromise): Observable; - - /** - * Uses selector to determine which source in sources to use. - * There is an alias 'switchCase' for browsers (selector: () => number, sources: { [key: number]: Observable; }, scheduler?: IScheduler): Observable; - case(selector: () => number, sources: { [key: number]: IPromise; }, scheduler?: IScheduler): Observable; - - /** - * Uses selector to determine which source in sources to use. - * There is an alias 'switchCase' for browsers (selector: () => string, sources: { [key: string]: Observable; }, elseSource: Observable): Observable; - switchCase(selector: () => string, sources: { [key: string]: IPromise; }, elseSource: Observable): Observable; - switchCase(selector: () => string, sources: { [key: string]: Observable; }, elseSource: IPromise): Observable; - switchCase(selector: () => string, sources: { [key: string]: IPromise; }, elseSource: IPromise): Observable; - - /** - * Uses selector to determine which source in sources to use. - * There is an alias 'switchCase' for browsers (selector: () => string, sources: { [key: string]: Observable; }, scheduler?: IScheduler): Observable; - switchCase(selector: () => string, sources: { [key: string]: IPromise; }, scheduler?: IScheduler): Observable; - - /** - * Uses selector to determine which source in sources to use. - * There is an alias 'switchCase' for browsers (selector: () => number, sources: { [key: number]: Observable; }, elseSource: Observable): Observable; - switchCase(selector: () => number, sources: { [key: number]: IPromise; }, elseSource: Observable): Observable; - switchCase(selector: () => number, sources: { [key: number]: Observable; }, elseSource: IPromise): Observable; - switchCase(selector: () => number, sources: { [key: number]: IPromise; }, elseSource: IPromise): Observable; - - /** - * Uses selector to determine which source in sources to use. - * There is an alias 'switchCase' for browsers (selector: () => number, sources: { [key: number]: Observable; }, scheduler?: IScheduler): Observable; - switchCase(selector: () => number, sources: { [key: number]: IPromise; }, scheduler?: IScheduler): Observable; - - /** - * Runs all observable sequences in parallel and collect their last elements. - * - * @example - * res = Rx.Observable.forkJoin([obs1, obs2]); - * @param sources Array of source sequences or promises. - * @returns An observable sequence with an array collecting the last elements of all the input sequences. - */ - forkJoin(sources: Observable[]): Observable; - forkJoin(sources: IPromise[]): Observable; - - /** - * Runs all observable sequences in parallel and collect their last elements. - * - * @example - * res = Rx.Observable.forkJoin(obs1, obs2, ...); - * @param args Source sequences or promises. - * @returns An observable sequence with an array collecting the last elements of all the input sequences. - */ - forkJoin(...args: Observable[]): Observable; - forkJoin(...args: IPromise[]): Observable; - } -} - -declare module "rx.experimental" { - export = Rx; -} diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.joinpatterns.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.joinpatterns.d.ts deleted file mode 100644 index fc20f825479632..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.joinpatterns.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -// Type definitions for RxJS-Join v2.2.28 -// Project: http://rx.codeplex.com/ -// Definitions by: Igor Oleinikov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module Rx { - - interface Pattern1 { - and(other: Observable): Pattern2; - thenDo(selector: (item1: T1) => TR): Plan; - } - interface Pattern2 { - and(other: Observable): Pattern3; - thenDo(selector: (item1: T1, item2: T2) => TR): Plan; - } - interface Pattern3 { - and(other: Observable): Pattern4; - thenDo(selector: (item1: T1, item2: T2, item3: T3) => TR): Plan; - } - interface Pattern4 { - and(other: Observable): Pattern5; - thenDo(selector: (item1: T1, item2: T2, item3: T3, item4: T4) => TR): Plan; - } - interface Pattern5 { - and(other: Observable): Pattern6; - thenDo(selector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5) => TR): Plan; - } - interface Pattern6 { - and(other: Observable): Pattern7; - thenDo(selector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5, item6: T6) => TR): Plan; - } - interface Pattern7 { - and(other: Observable): Pattern8; - thenDo(selector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5, item6: T6, item7: T7) => TR): Plan; - } - interface Pattern8 { - and(other: Observable): Pattern9; - thenDo(selector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5, item6: T6, item7: T7, item8: T8) => TR): Plan; - } - interface Pattern9 { - thenDo(selector: (item1: T1, item2: T2, item3: T3, item4: T4, item5: T5, item6: T6, item7: T7, item8: T8, item9: T9) => TR): Plan; - } - - interface Plan { } - - interface Observable { - and(other: Observable): Pattern2; - thenDo(selector: (item1: T) => TR): Plan; - } - - interface ObservableStatic { - when(plan: Plan): Observable; - } -} - -declare module "rx.joinpatterns" { - export = Rx; -} diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.lite.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.lite.d.ts deleted file mode 100644 index 66ec678498c7eb..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.lite.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -// Type definitions for RxJS-Lite v2.2.28 -// Project: http://rx.codeplex.com/ -// Definitions by: gsino , Igor Oleinikov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// -/// -/// -/// -/// -/// - -declare module "rx.lite" { - export = Rx; -} diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.testing.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.testing.d.ts deleted file mode 100644 index 58b074f75622f7..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.testing.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -// Type definitions for RxJS-Testing v2.2.28 -// Project: https://github.com/Reactive-Extensions/RxJS/ -// Definitions by: Igor Oleinikov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// -/// - -declare module Rx { - export interface TestScheduler extends VirtualTimeScheduler { - createColdObservable(...records: Recorded[]): Observable; - createHotObservable(...records: Recorded[]): Observable; - createObserver(): MockObserver; - - startWithTiming(create: () => Observable, createdAt: number, subscribedAt: number, disposedAt: number): MockObserver; - startWithDispose(create: () => Observable, disposedAt: number): MockObserver; - startWithCreate(create: () => Observable): MockObserver; - } - - export var TestScheduler: { - new (): TestScheduler; - }; - - export class Recorded { - constructor(time: number, value: any, equalityComparer?: (x: any, y: any) => boolean); - equals(other: Recorded): boolean; - toString(): string; - time: number; - value: any; - } - - export var ReactiveTest: { - created: number; - subscribed: number; - disposed: number; - - onNext(ticks: number, value: any): Recorded; - onNext(ticks: number, predicate: (value: any) => boolean): Recorded; - onError(ticks: number, exception: any): Recorded; - onError(ticks: number, predicate: (exception: any) => boolean): Recorded; - onCompleted(ticks: number): Recorded; - - subscribe(subscribeAt: number, unsubscribeAt?: number): Subscription; - }; - - export class Subscription { - constructor(subscribeAt: number, unsubscribeAt?: number); - equals(other: Subscription): boolean; - } - - export interface MockObserver extends Observer { - messages: Recorded[]; - } - - interface MockObserverStatic extends ObserverStatic { - new (scheduler: IScheduler): MockObserver; - } - - export var MockObserver: MockObserverStatic; -} - -declare module "rx.testing" { - export = Rx; -} diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.time-lite.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.time-lite.d.ts deleted file mode 100644 index f7a902685ef9cb..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.time-lite.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -// DefinitelyTyped: partial - -// This file contains common part of defintions for rx.time.d.ts and rx.lite.d.ts -// Do not include the file separately. - -/// - -declare module Rx { - export interface TimeInterval { - value: T; - interval: number; - } - - export interface Timestamp { - value: T; - timestamp: number; - } - - export interface Observable { - delay(dueTime: Date, scheduler?: IScheduler): Observable; - delay(dueTime: number, scheduler?: IScheduler): Observable; - - debounce(dueTime: number, scheduler?: IScheduler): Observable; - throttleWithTimeout(dueTime: number, scheduler?: IScheduler): Observable; - /** - * @deprecated use #debounce or #throttleWithTimeout instead. - */ - throttle(dueTime: number, scheduler?: IScheduler): Observable; - - timeInterval(scheduler?: IScheduler): Observable>; - - timestamp(scheduler?: IScheduler): Observable>; - - sample(interval: number, scheduler?: IScheduler): Observable; - sample(sampler: Observable, scheduler?: IScheduler): Observable; - - timeout(dueTime: Date, other?: Observable, scheduler?: IScheduler): Observable; - timeout(dueTime: number, other?: Observable, scheduler?: IScheduler): Observable; - } - - interface ObservableStatic { - interval(period: number, scheduler?: IScheduler): Observable; - interval(dutTime: number, period: number, scheduler?: IScheduler): Observable; - timer(dueTime: number, period: number, scheduler?: IScheduler): Observable; - timer(dueTime: number, scheduler?: IScheduler): Observable; - } -} diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.time.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.time.d.ts deleted file mode 100644 index 2e3ea0a0907ac5..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.time.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -// Type definitions for RxJS-Time v2.2.28 -// Project: http://rx.codeplex.com/ -// Definitions by: Carl de Billy , Igor Oleinikov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// -/// - -declare module Rx { - export interface Observable { - delaySubscription(dueTime: number, scheduler?: IScheduler): Observable; - delayWithSelector(delayDurationSelector: (item: T) => number): Observable; - delayWithSelector(subscriptionDelay: number, delayDurationSelector: (item: T) => number): Observable; - - timeoutWithSelector(firstTimeout: Observable, timeoutdurationSelector?: (item: T) => Observable, other?: Observable): Observable; - - debounceWithSelector(debounceDurationSelector: (item: T) => Observable): Observable; - /** - * @deprecated use #debounceWithSelector instead. - */ - throttleWithSelector(debounceDurationSelector: (item: T) => Observable): Observable; - - skipLastWithTime(duration: number, scheduler?: IScheduler): Observable; - takeLastWithTime(duration: number, timerScheduler?: IScheduler, loopScheduler?: IScheduler): Observable; - - takeLastBufferWithTime(duration: number, scheduler?: IScheduler): Observable; - takeWithTime(duration: number, scheduler?: IScheduler): Observable; - skipWithTime(duration: number, scheduler?: IScheduler): Observable; - - skipUntilWithTime(startTime: Date, scheduler?: IScheduler): Observable; - skipUntilWithTime(duration: number, scheduler?: IScheduler): Observable; - takeUntilWithTime(endTime: Date, scheduler?: IScheduler): Observable; - takeUntilWithTime(duration: number, scheduler?: IScheduler): Observable; - - windowWithTime(timeSpan: number, timeShift: number, scheduler?: IScheduler): Observable>; - windowWithTime(timeSpan: number, scheduler?: IScheduler): Observable>; - windowWithTimeOrCount(timeSpan: number, count: number, scheduler?: IScheduler): Observable>; - bufferWithTime(timeSpan: number, timeShift: number, scheduler?: IScheduler): Observable; - bufferWithTime(timeSpan: number, scheduler?: IScheduler): Observable; - bufferWithTimeOrCount(timeSpan: number, count: number, scheduler?: IScheduler): Observable; - } - - interface ObservableStatic { - timer(dueTime: Date, period: number, scheduler?: IScheduler): Observable; - timer(dueTime: Date, scheduler?: IScheduler): Observable; - - generateWithRelativeTime( - initialState: TState, - condition: (state: TState) => boolean, - iterate: (state: TState) => TState, - resultSelector: (state: TState) => TResult, - timeSelector: (state: TState) => number, - scheduler?: IScheduler): Observable; - generateWithAbsoluteTime( - initialState: TState, - condition: (state: TState) => boolean, - iterate: (state: TState) => TState, - resultSelector: (state: TState) => TResult, - timeSelector: (state: TState) => Date, - scheduler?: IScheduler): Observable; - } -} - -declare module "rx.time" { - export = Rx; -} diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.virtualtime.d.ts b/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.virtualtime.d.ts deleted file mode 100644 index bac31a0d373d32..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/rx/ts/rx.virtualtime.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -// Type definitions for RxJS-VirtualTime v2.2.28 -// Project: http://rx.codeplex.com/ -// Definitions by: gsino , Igor Oleinikov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module Rx { - export interface VirtualTimeScheduler extends Scheduler { - //protected constructor(initialClock: TAbsolute, comparer: (first: TAbsolute, second: TAbsolute) => number); - - advanceBy(time: TRelative): void; - advanceTo(time: TAbsolute): void; - scheduleAbsolute(dueTime: TAbsolute, action: () => void): IDisposable; - scheduleAbsoluteWithState(state: TState, dueTime: TAbsolute, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable; - scheduleRelative(dueTime: TRelative, action: () => void): IDisposable; - scheduleRelativeWithState(state: TState, dueTime: TRelative, action: (scheduler: IScheduler, state: TState) => IDisposable): IDisposable; - sleep(time: TRelative): void; - start(): IDisposable; - stop(): void; - - isEnabled: boolean; - - /* protected abstract */ add(from: TAbsolute, by: TRelative): TAbsolute; - /* protected abstract */ toDateTimeOffset(duetime: TAbsolute): number; - /* protected abstract */ toRelative(duetime: number): TRelative; - - /* protected */ getNext(): internals.ScheduledItem; - } - - export interface HistoricalScheduler extends VirtualTimeScheduler { - } - - export var HistoricalScheduler: { - new (initialClock: number, comparer: (first: number, second: number) => number): HistoricalScheduler; - }; -} - -declare module "rx.virtualtime" { - export = Rx; -} diff --git a/tools/eslint/node_modules/inquirer/node_modules/through/.travis.yml b/tools/eslint/node_modules/inquirer/node_modules/through/.travis.yml deleted file mode 100644 index c693a939df9809..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/through/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - 0.6 - - 0.8 - - "0.10" diff --git a/tools/eslint/node_modules/inquirer/node_modules/through/LICENSE.MIT b/tools/eslint/node_modules/inquirer/node_modules/through/LICENSE.MIT deleted file mode 100644 index 6eafbd734a6e06..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/through/LICENSE.MIT +++ /dev/null @@ -1,24 +0,0 @@ -The MIT License - -Copyright (c) 2011 Dominic Tarr - -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/eslint/node_modules/inquirer/node_modules/through/index.js b/tools/eslint/node_modules/inquirer/node_modules/through/index.js deleted file mode 100644 index ca5fc5901fd875..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/through/index.js +++ /dev/null @@ -1,108 +0,0 @@ -var Stream = require('stream') - -// through -// -// a stream that does nothing but re-emit the input. -// useful for aggregating a series of changing but not ending streams into one stream) - -exports = module.exports = through -through.through = through - -//create a readable writable stream. - -function through (write, end, opts) { - write = write || function (data) { this.queue(data) } - end = end || function () { this.queue(null) } - - var ended = false, destroyed = false, buffer = [], _ended = false - var stream = new Stream() - stream.readable = stream.writable = true - stream.paused = false - -// stream.autoPause = !(opts && opts.autoPause === false) - stream.autoDestroy = !(opts && opts.autoDestroy === false) - - stream.write = function (data) { - write.call(this, data) - return !stream.paused - } - - function drain() { - while(buffer.length && !stream.paused) { - var data = buffer.shift() - if(null === data) - return stream.emit('end') - else - stream.emit('data', data) - } - } - - stream.queue = stream.push = function (data) { -// console.error(ended) - if(_ended) return stream - if(data === null) _ended = true - buffer.push(data) - drain() - return stream - } - - //this will be registered as the first 'end' listener - //must call destroy next tick, to make sure we're after any - //stream piped from here. - //this is only a problem if end is not emitted synchronously. - //a nicer way to do this is to make sure this is the last listener for 'end' - - stream.on('end', function () { - stream.readable = false - if(!stream.writable && stream.autoDestroy) - process.nextTick(function () { - stream.destroy() - }) - }) - - function _end () { - stream.writable = false - end.call(stream) - if(!stream.readable && stream.autoDestroy) - stream.destroy() - } - - stream.end = function (data) { - if(ended) return - ended = true - if(arguments.length) stream.write(data) - _end() // will emit or queue - return stream - } - - stream.destroy = function () { - if(destroyed) return - destroyed = true - ended = true - buffer.length = 0 - stream.writable = stream.readable = false - stream.emit('close') - return stream - } - - stream.pause = function () { - if(stream.paused) return - stream.paused = true - return stream - } - - stream.resume = function () { - if(stream.paused) { - stream.paused = false - stream.emit('resume') - } - drain() - //may have become paused again, - //as drain emits 'data'. - if(!stream.paused) - stream.emit('drain') - return stream - } - return stream -} - diff --git a/tools/eslint/node_modules/inquirer/node_modules/through/package.json b/tools/eslint/node_modules/inquirer/node_modules/through/package.json deleted file mode 100644 index ec7f7ac6fe4a58..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/through/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "name": "through", - "version": "2.3.7", - "description": "simplified stream construction", - "main": "index.js", - "scripts": { - "test": "set -e; for t in test/*.js; do node $t; done" - }, - "devDependencies": { - "stream-spec": "~0.3.5", - "tape": "~2.3.2", - "from": "~0.1.3" - }, - "keywords": [ - "stream", - "streams", - "user-streams", - "pipe" - ], - "author": { - "name": "Dominic Tarr", - "email": "dominic.tarr@gmail.com", - "url": "dominictarr.com" - }, - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/dominictarr/through.git" - }, - "homepage": "http://github.com/dominictarr/through", - "testling": { - "browsers": [ - "ie/8..latest", - "ff/15..latest", - "chrome/20..latest", - "safari/5.1..latest" - ], - "files": "test/*.js" - }, - "gitHead": "d532966ebcae90fd6a150cc489b55c6a4e0bc4a0", - "bugs": { - "url": "https://github.com/dominictarr/through/issues" - }, - "_id": "through@2.3.7", - "_shasum": "5fcc3690fed2fdf98c6fc88b4d207a4624ac3b87", - "_from": "through@>=2.3.6 <3.0.0", - "_npmVersion": "2.4.1", - "_nodeVersion": "0.10.35", - "_npmUser": { - "name": "dominictarr", - "email": "dominic.tarr@gmail.com" - }, - "maintainers": [ - { - "name": "dominictarr", - "email": "dominic.tarr@gmail.com" - } - ], - "dist": { - "shasum": "5fcc3690fed2fdf98c6fc88b4d207a4624ac3b87", - "tarball": "http://registry.npmjs.org/through/-/through-2.3.7.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/through/-/through-2.3.7.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/tools/eslint/node_modules/inquirer/node_modules/through/readme.markdown b/tools/eslint/node_modules/inquirer/node_modules/through/readme.markdown deleted file mode 100644 index cb34c8135f53eb..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/through/readme.markdown +++ /dev/null @@ -1,64 +0,0 @@ -#through - -[![build status](https://secure.travis-ci.org/dominictarr/through.png)](http://travis-ci.org/dominictarr/through) -[![testling badge](https://ci.testling.com/dominictarr/through.png)](https://ci.testling.com/dominictarr/through) - -Easy way to create a `Stream` that is both `readable` and `writable`. - -* Pass in optional `write` and `end` methods. -* `through` takes care of pause/resume logic if you use `this.queue(data)` instead of `this.emit('data', data)`. -* Use `this.pause()` and `this.resume()` to manage flow. -* Check `this.paused` to see current flow state. (`write` always returns `!this.paused`). - -This function is the basis for most of the synchronous streams in -[event-stream](http://github.com/dominictarr/event-stream). - -``` js -var through = require('through') - -through(function write(data) { - this.queue(data) //data *must* not be null - }, - function end () { //optional - this.queue(null) - }) -``` - -Or, can also be used _without_ buffering on pause, use `this.emit('data', data)`, -and this.emit('end') - -``` js -var through = require('through') - -through(function write(data) { - this.emit('data', data) - //this.pause() - }, - function end () { //optional - this.emit('end') - }) -``` - -## Extended Options - -You will probably not need these 99% of the time. - -### autoDestroy=false - -By default, `through` emits close when the writable -and readable side of the stream has ended. -If that is not desired, set `autoDestroy=false`. - -``` js -var through = require('through') - -//like this -var ts = through(write, end, {autoDestroy: false}) -//or like this -var ts = through(write, end) -ts.autoDestroy = false -``` - -## License - -MIT / Apache2 diff --git a/tools/eslint/node_modules/inquirer/node_modules/through/test/async.js b/tools/eslint/node_modules/inquirer/node_modules/through/test/async.js deleted file mode 100644 index 46bdbaebcbc09b..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/through/test/async.js +++ /dev/null @@ -1,28 +0,0 @@ -var from = require('from') -var through = require('../') - -var tape = require('tape') - -tape('simple async example', function (t) { - - var n = 0, expected = [1,2,3,4,5], actual = [] - from(expected) - .pipe(through(function(data) { - this.pause() - n ++ - setTimeout(function(){ - console.log('pushing data', data) - this.push(data) - this.resume() - }.bind(this), 300) - })).pipe(through(function(data) { - console.log('pushing data second time', data); - this.push(data) - })).on('data', function (d) { - actual.push(d) - }).on('end', function() { - t.deepEqual(actual, expected) - t.end() - }) - -}) diff --git a/tools/eslint/node_modules/inquirer/node_modules/through/test/auto-destroy.js b/tools/eslint/node_modules/inquirer/node_modules/through/test/auto-destroy.js deleted file mode 100644 index 9a8fd0006f5b80..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/through/test/auto-destroy.js +++ /dev/null @@ -1,30 +0,0 @@ -var test = require('tape') -var through = require('../') - -// must emit end before close. - -test('end before close', function (assert) { - var ts = through() - ts.autoDestroy = false - var ended = false, closed = false - - ts.on('end', function () { - assert.ok(!closed) - ended = true - }) - ts.on('close', function () { - assert.ok(ended) - closed = true - }) - - ts.write(1) - ts.write(2) - ts.write(3) - ts.end() - assert.ok(ended) - assert.notOk(closed) - ts.destroy() - assert.ok(closed) - assert.end() -}) - diff --git a/tools/eslint/node_modules/inquirer/node_modules/through/test/buffering.js b/tools/eslint/node_modules/inquirer/node_modules/through/test/buffering.js deleted file mode 100644 index b0084bfc6ed5ac..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/through/test/buffering.js +++ /dev/null @@ -1,71 +0,0 @@ -var test = require('tape') -var through = require('../') - -// must emit end before close. - -test('buffering', function(assert) { - var ts = through(function (data) { - this.queue(data) - }, function () { - this.queue(null) - }) - - var ended = false, actual = [] - - ts.on('data', actual.push.bind(actual)) - ts.on('end', function () { - ended = true - }) - - ts.write(1) - ts.write(2) - ts.write(3) - assert.deepEqual(actual, [1, 2, 3]) - ts.pause() - ts.write(4) - ts.write(5) - ts.write(6) - assert.deepEqual(actual, [1, 2, 3]) - ts.resume() - assert.deepEqual(actual, [1, 2, 3, 4, 5, 6]) - ts.pause() - ts.end() - assert.ok(!ended) - ts.resume() - assert.ok(ended) - assert.end() -}) - -test('buffering has data in queue, when ends', function (assert) { - - /* - * If stream ends while paused with data in the queue, - * stream should still emit end after all data is written - * on resume. - */ - - var ts = through(function (data) { - this.queue(data) - }, function () { - this.queue(null) - }) - - var ended = false, actual = [] - - ts.on('data', actual.push.bind(actual)) - ts.on('end', function () { - ended = true - }) - - ts.pause() - ts.write(1) - ts.write(2) - ts.write(3) - ts.end() - assert.deepEqual(actual, [], 'no data written yet, still paused') - assert.ok(!ended, 'end not emitted yet, still paused') - ts.resume() - assert.deepEqual(actual, [1, 2, 3], 'resumed, all data should be delivered') - assert.ok(ended, 'end should be emitted once all data was delivered') - assert.end(); -}) diff --git a/tools/eslint/node_modules/inquirer/node_modules/through/test/end.js b/tools/eslint/node_modules/inquirer/node_modules/through/test/end.js deleted file mode 100644 index fa113f58e0360a..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/through/test/end.js +++ /dev/null @@ -1,45 +0,0 @@ -var test = require('tape') -var through = require('../') - -// must emit end before close. - -test('end before close', function (assert) { - var ts = through() - var ended = false, closed = false - - ts.on('end', function () { - assert.ok(!closed) - ended = true - }) - ts.on('close', function () { - assert.ok(ended) - closed = true - }) - - ts.write(1) - ts.write(2) - ts.write(3) - ts.end() - assert.ok(ended) - assert.ok(closed) - assert.end() -}) - -test('end only once', function (t) { - - var ts = through() - var ended = false, closed = false - - ts.on('end', function () { - t.equal(ended, false) - ended = true - }) - - ts.queue(null) - ts.queue(null) - ts.queue(null) - - ts.resume() - - t.end() -}) diff --git a/tools/eslint/node_modules/inquirer/node_modules/through/test/index.js b/tools/eslint/node_modules/inquirer/node_modules/through/test/index.js deleted file mode 100644 index 96da82f97c74cf..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/through/test/index.js +++ /dev/null @@ -1,133 +0,0 @@ - -var test = require('tape') -var spec = require('stream-spec') -var through = require('../') - -/* - I'm using these two functions, and not streams and pipe - so there is less to break. if this test fails it must be - the implementation of _through_ -*/ - -function write(array, stream) { - array = array.slice() - function next() { - while(array.length) - if(stream.write(array.shift()) === false) - return stream.once('drain', next) - - stream.end() - } - - next() -} - -function read(stream, callback) { - var actual = [] - stream.on('data', function (data) { - actual.push(data) - }) - stream.once('end', function () { - callback(null, actual) - }) - stream.once('error', function (err) { - callback(err) - }) -} - -test('simple defaults', function(assert) { - - var l = 1000 - , expected = [] - - while(l--) expected.push(l * Math.random()) - - var t = through() - var s = spec(t).through().pausable() - - read(t, function (err, actual) { - assert.ifError(err) - assert.deepEqual(actual, expected) - assert.end() - }) - - t.on('close', s.validate) - - write(expected, t) -}); - -test('simple functions', function(assert) { - - var l = 1000 - , expected = [] - - while(l--) expected.push(l * Math.random()) - - var t = through(function (data) { - this.emit('data', data*2) - }) - var s = spec(t).through().pausable() - - - read(t, function (err, actual) { - assert.ifError(err) - assert.deepEqual(actual, expected.map(function (data) { - return data*2 - })) - assert.end() - }) - - t.on('close', s.validate) - - write(expected, t) -}) - -test('pauses', function(assert) { - - var l = 1000 - , expected = [] - - while(l--) expected.push(l) //Math.random()) - - var t = through() - - var s = spec(t) - .through() - .pausable() - - t.on('data', function () { - if(Math.random() > 0.1) return - t.pause() - process.nextTick(function () { - t.resume() - }) - }) - - read(t, function (err, actual) { - assert.ifError(err) - assert.deepEqual(actual, expected) - }) - - t.on('close', function () { - s.validate() - assert.end() - }) - - write(expected, t) -}) - -test('does not soft-end on `undefined`', function(assert) { - var stream = through() - , count = 0 - - stream.on('data', function (data) { - count++ - }) - - stream.write(undefined) - stream.write(undefined) - - assert.equal(count, 2) - - assert.end() -}) diff --git a/tools/eslint/node_modules/inquirer/package.json b/tools/eslint/node_modules/inquirer/package.json index f7544323339e48..529ff5cbd87574 100644 --- a/tools/eslint/node_modules/inquirer/package.json +++ b/tools/eslint/node_modules/inquirer/package.json @@ -1,75 +1,111 @@ { - "name": "inquirer", - "version": "0.8.5", - "description": "A collection of common interactive command line user interfaces.", - "main": "lib/inquirer.js", - "scripts": { - "test": "grunt --verbose" + "_args": [ + [ + "inquirer@^0.12.0", + "/Users/silverwind/git/node/tools/package/package" + ] + ], + "_from": "inquirer@>=0.12.0 <0.13.0", + "_id": "inquirer@0.12.0", + "_inCache": true, + "_installable": true, + "_location": "/inquirer", + "_nodeVersion": "5.2.0", + "_npmOperationalInternal": { + "host": "packages-9-west.internal.npmjs.com", + "tmp": "tmp/inquirer-0.12.0.tgz_1454990163157_0.11014768108725548" }, - "repository": { - "type": "git", - "url": "git+https://github.com/sboudrias/Inquirer.js.git" + "_npmUser": { + "email": "admin@simonboudrias.com", + "name": "sboudrias" }, - "keywords": [ - "command", - "prompt", - "stdin", - "cli", - "tty", - "menu" + "_npmVersion": "3.5.3", + "_phantomChildren": {}, + "_requested": { + "name": "inquirer", + "raw": "inquirer@^0.12.0", + "rawSpec": "^0.12.0", + "scope": null, + "spec": ">=0.12.0 <0.13.0", + "type": "range" + }, + "_requiredBy": [ + "/" ], + "_resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz", + "_shasum": "1ef2bfd63504df0bc75785fff8c2c41df12f077e", + "_shrinkwrap": null, + "_spec": "inquirer@^0.12.0", + "_where": "/Users/silverwind/git/node/tools/package/package", "author": { - "name": "Simon Boudrias", - "email": "admin@simonboudrias.com" + "email": "admin@simonboudrias.com", + "name": "Simon Boudrias" + }, + "bugs": { + "url": "https://github.com/sboudrias/Inquirer.js/issues" }, - "license": "MIT", - "files": [ - "lib" - ], "dependencies": { - "ansi-regex": "^1.1.1", + "ansi-escapes": "^1.1.0", + "ansi-regex": "^2.0.0", "chalk": "^1.0.0", - "cli-width": "^1.0.1", + "cli-cursor": "^1.0.1", + "cli-width": "^2.0.0", "figures": "^1.3.5", - "lodash": "^3.3.1", - "readline2": "^0.1.1", - "rx": "^2.4.3", + "lodash": "^4.3.0", + "readline2": "^1.0.1", + "run-async": "^0.1.0", + "rx-lite": "^3.1.2", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.0", "through": "^2.3.6" }, + "description": "A collection of common interactive command line user interfaces.", "devDependencies": { - "chai": "^2.1.2", + "chai": "^3.0.0", "cmdify": "^0.0.4", "grunt": "^0.4.1", "grunt-cli": "^0.1.8", "grunt-contrib-jshint": "^0.11.1", - "grunt-mocha-test": "^0.10.2", + "grunt-mocha-test": "^0.12.7", "mocha": "^2.2.1", "mockery": "^1.4.0", "sinon": "^1.12.1" }, - "_id": "inquirer@0.8.5", + "directories": {}, "dist": { - "shasum": "dbd740cf6ca3b731296a63ce6f6d961851f336df", - "tarball": "http://registry.npmjs.org/inquirer/-/inquirer-0.8.5.tgz" - }, - "_from": "inquirer@>=0.8.2 <0.9.0", - "_npmVersion": "1.4.6", - "_npmUser": { - "name": "sboudrias", - "email": "admin@simonboudrias.com" + "shasum": "1ef2bfd63504df0bc75785fff8c2c41df12f077e", + "tarball": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz" }, + "files": [ + "lib" + ], + "gitHead": "a0c2d4d2bcd2818f27c8a2e96477d65f0f386944", + "homepage": "https://github.com/sboudrias/Inquirer.js#readme", + "keywords": [ + "cli", + "command", + "menu", + "prompt", + "stdin", + "tty" + ], + "license": "MIT", + "main": "lib/inquirer.js", "maintainers": [ { "name": "sboudrias", "email": "admin@simonboudrias.com" } ], - "directories": {}, - "_shasum": "dbd740cf6ca3b731296a63ce6f6d961851f336df", - "_resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.8.5.tgz", - "bugs": { - "url": "https://github.com/sboudrias/Inquirer.js/issues" - }, + "name": "inquirer", + "optionalDependencies": {}, "readme": "ERROR: No README data found!", - "homepage": "https://github.com/sboudrias/Inquirer.js#readme" + "repository": { + "type": "git", + "url": "git+https://github.com/sboudrias/Inquirer.js.git" + }, + "scripts": { + "test": "grunt --verbose" + }, + "version": "0.12.0" } diff --git a/tools/eslint/node_modules/is-fullwidth-code-point/index.js b/tools/eslint/node_modules/is-fullwidth-code-point/index.js new file mode 100644 index 00000000000000..a7d3e3855f1c24 --- /dev/null +++ b/tools/eslint/node_modules/is-fullwidth-code-point/index.js @@ -0,0 +1,46 @@ +'use strict'; +var numberIsNan = require('number-is-nan'); + +module.exports = function (x) { + if (numberIsNan(x)) { + return false; + } + + // https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1369 + + // code points are derived from: + // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt + if (x >= 0x1100 && ( + x <= 0x115f || // Hangul Jamo + 0x2329 === x || // LEFT-POINTING ANGLE BRACKET + 0x232a === x || // RIGHT-POINTING ANGLE BRACKET + // CJK Radicals Supplement .. Enclosed CJK Letters and Months + (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || + // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A + 0x3250 <= x && x <= 0x4dbf || + // CJK Unified Ideographs .. Yi Radicals + 0x4e00 <= x && x <= 0xa4c6 || + // Hangul Jamo Extended-A + 0xa960 <= x && x <= 0xa97c || + // Hangul Syllables + 0xac00 <= x && x <= 0xd7a3 || + // CJK Compatibility Ideographs + 0xf900 <= x && x <= 0xfaff || + // Vertical Forms + 0xfe10 <= x && x <= 0xfe19 || + // CJK Compatibility Forms .. Small Form Variants + 0xfe30 <= x && x <= 0xfe6b || + // Halfwidth and Fullwidth Forms + 0xff01 <= x && x <= 0xff60 || + 0xffe0 <= x && x <= 0xffe6 || + // Kana Supplement + 0x1b000 <= x && x <= 0x1b001 || + // Enclosed Ideographic Supplement + 0x1f200 <= x && x <= 0x1f251 || + // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane + 0x20000 <= x && x <= 0x3fffd)) { + return true; + } + + return false; +} diff --git a/tools/eslint/node_modules/is-fullwidth-code-point/license b/tools/eslint/node_modules/is-fullwidth-code-point/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/tools/eslint/node_modules/is-fullwidth-code-point/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tools/eslint/node_modules/is-fullwidth-code-point/package.json b/tools/eslint/node_modules/is-fullwidth-code-point/package.json new file mode 100644 index 00000000000000..05ef35459e7e20 --- /dev/null +++ b/tools/eslint/node_modules/is-fullwidth-code-point/package.json @@ -0,0 +1,101 @@ +{ + "_args": [ + [ + "is-fullwidth-code-point@^1.0.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/readline2" + ] + ], + "_from": "is-fullwidth-code-point@>=1.0.0 <2.0.0", + "_id": "is-fullwidth-code-point@1.0.0", + "_inCache": true, + "_installable": true, + "_location": "/is-fullwidth-code-point", + "_nodeVersion": "0.12.5", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_npmVersion": "2.11.2", + "_phantomChildren": {}, + "_requested": { + "name": "is-fullwidth-code-point", + "raw": "is-fullwidth-code-point@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/readline2", + "/string-width" + ], + "_resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "_shasum": "ef9e31386f031a7f0d643af82fde50c457ef00cb", + "_shrinkwrap": null, + "_spec": "is-fullwidth-code-point@^1.0.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/readline2", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/is-fullwidth-code-point/issues" + }, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "description": "Check if the character represented by a given Unicode code point is fullwidth", + "devDependencies": { + "ava": "0.0.4", + "code-point-at": "^1.0.0" + }, + "directories": {}, + "dist": { + "shasum": "ef9e31386f031a7f0d643af82fde50c457ef00cb", + "tarball": "http://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "f2152d357f41f82785436d428e4f8ede143b7548", + "homepage": "https://github.com/sindresorhus/is-fullwidth-code-point", + "keywords": [ + "char", + "character", + "check", + "code", + "codepoint", + "detect", + "full", + "full-width", + "fullwidth", + "is", + "point", + "str", + "string", + "unicode", + "width" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "is-fullwidth-code-point", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-fullwidth-code-point.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/tools/eslint/node_modules/is-fullwidth-code-point/readme.md b/tools/eslint/node_modules/is-fullwidth-code-point/readme.md new file mode 100644 index 00000000000000..4936464b1b4155 --- /dev/null +++ b/tools/eslint/node_modules/is-fullwidth-code-point/readme.md @@ -0,0 +1,39 @@ +# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) + +> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) + + +## Install + +``` +$ npm install --save is-fullwidth-code-point +``` + + +## Usage + +```js +var isFullwidthCodePoint = require('is-fullwidth-code-point'); + +isFullwidthCodePoint('谢'.codePointAt()); +//=> true + +isFullwidthCodePoint('a'.codePointAt()); +//=> false +``` + + +## API + +### isFullwidthCodePoint(input) + +#### input + +Type: `number` + +[Code point](https://en.wikipedia.org/wiki/Code_point) of a character. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/eslint/node_modules/is-my-json-valid/.npmignore b/tools/eslint/node_modules/is-my-json-valid/.npmignore deleted file mode 100644 index dbb0721ce547c1..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -cosmicrealms.com diff --git a/tools/eslint/node_modules/is-my-json-valid/README.md b/tools/eslint/node_modules/is-my-json-valid/README.md index 47350d84fa795b..104a425ad204ed 100644 --- a/tools/eslint/node_modules/is-my-json-valid/README.md +++ b/tools/eslint/node_modules/is-my-json-valid/README.md @@ -40,7 +40,7 @@ console.log(validate.errors) You can also pass the schema as a string ``` js -var validate = validate('{"type": ... }') +var validate = validator('{"type": ... }') ``` Optionally you can use the require submodule to load a schema from `__dirname` @@ -85,7 +85,7 @@ var schema = { } // pass the external schemas as an option -var validate = validate(schema, {schemas: {ext: ext}}) +var validate = validator(schema, {schemas: {ext: ext}}) validate('hello') // returns true validate(42) // return false @@ -128,7 +128,7 @@ var validate = validator({ }) validate({hello: 100}); -console.log(validate.errors) // {field: 'data.hello', message: 'is the wrong type', value: 100} +console.log(validate.errors) // {field: 'data.hello', message: 'is the wrong type', value: 100, type: 'string'} ``` ## Greedy mode tries to validate as much as possible diff --git a/tools/eslint/node_modules/is-my-json-valid/formats.js b/tools/eslint/node_modules/is-my-json-valid/formats.js index 3038daea921a90..9cb8380bc87403 100644 --- a/tools/eslint/node_modules/is-my-json-valid/formats.js +++ b/tools/eslint/node_modules/is-my-json-valid/formats.js @@ -11,4 +11,4 @@ exports['alpha'] = /^[a-zA-Z]+$/ exports['alphanumeric'] = /^[a-zA-Z0-9]+$/ exports['style'] = /\s*(.+?):\s*([^;]+);?/g exports['phone'] = /^\+(?:[0-9] ?){6,14}[0-9]$/ -exports['utc-millisec'] = /^[0-9]+(\.?[0-9]+)?$/ +exports['utc-millisec'] = /^[0-9]{1,15}\.?[0-9]{0,15}$/ diff --git a/tools/eslint/node_modules/is-my-json-valid/index.js b/tools/eslint/node_modules/is-my-json-valid/index.js index 6fef4ed6f0f5c0..f929bb75394944 100644 --- a/tools/eslint/node_modules/is-my-json-valid/index.js +++ b/tools/eslint/node_modules/is-my-json-valid/index.js @@ -5,7 +5,6 @@ var xtend = require('xtend') var formats = require('./formats') var get = function(obj, additionalSchemas, ptr) { - if (/^https?:\/\//.test(ptr)) return null var visit = function(sub) { if (sub && sub.id === ptr) return sub @@ -98,13 +97,25 @@ var unique = function(array) { return true } +var isMultipleOf = function(name, multipleOf) { + var res; + var factor = ((multipleOf | 0) !== multipleOf) ? Math.pow(10, multipleOf.toString().split('.').pop().length) : 1 + if (factor > 1) { + var factorName = ((name | 0) !== name) ? Math.pow(10, name.toString().split('.').pop().length) : 1 + if (factorName > factor) res = true + else res = Math.round(factor * name) % (factor * multipleOf) + } + else res = name % multipleOf; + return !res; +} + var toType = function(node) { return node.type } var compile = function(schema, cache, root, reporter, opts) { var fmts = opts ? xtend(formats, opts.formats) : formats - var scope = {unique:unique, formats:fmts} + var scope = {unique:unique, formats:fmts, isMultipleOf:isMultipleOf} var verbose = opts ? !!opts.verbose : false; var greedy = opts && opts.greedy !== undefined ? opts.greedy : false; @@ -150,7 +161,7 @@ var compile = function(schema, cache, root, reporter, opts) { if (reporter === true) { validate('if (validate.errors === null) validate.errors = []') if (verbose) { - validate('validate.errors.push({field:%s,message:%s,value:%s})', formatName(prop || name), JSON.stringify(msg), value || name) + validate('validate.errors.push({field:%s,message:%s,value:%s,type:%s})', formatName(prop || name), JSON.stringify(msg), value || name, JSON.stringify(type)) } else { validate('validate.errors.push({field:%s,message:%s})', formatName(prop || name), JSON.stringify(msg)) } @@ -190,7 +201,7 @@ var compile = function(schema, cache, root, reporter, opts) { validate('for (var %s = %d; %s < %s.length; %s++) {', i, node.items.length, i, name, i) visit(name+'['+i+']', node.additionalItems, reporter, filter) validate('}') - } + } } if (node.format && fmts[node.format]) { @@ -395,7 +406,7 @@ var compile = function(schema, cache, root, reporter, opts) { node.anyOf.forEach(function(sch, i) { if (i === 0) { validate('var %s = errors', prev) - } else { + } else { validate('if (errors !== %s) {', prev) ('errors = %s', prev) } @@ -434,9 +445,7 @@ var compile = function(schema, cache, root, reporter, opts) { if (node.multipleOf !== undefined) { if (type !== 'number' && type !== 'integer') validate('if (%s) {', types.number(name)) - var factor = ((node.multipleOf | 0) !== node.multipleOf) ? Math.pow(10, node.multipleOf.toString().split('.').pop().length) : 1 - if (factor > 1) validate('if ((%d*%s) % %d) {', factor, name, factor*node.multipleOf) - else validate('if (%s % %d) {', name, node.multipleOf) + validate('if (!isMultipleOf(%s, %d)) {', name, node.multipleOf) error('has a remainder') validate('}') @@ -446,7 +455,7 @@ var compile = function(schema, cache, root, reporter, opts) { if (node.maxProperties !== undefined) { if (type !== 'object') validate('if (%s) {', types.object(name)) - + validate('if (Object.keys(%s).length > %d) {', name, node.maxProperties) error('has more properties than allowed') validate('}') @@ -456,7 +465,7 @@ var compile = function(schema, cache, root, reporter, opts) { if (node.minProperties !== undefined) { if (type !== 'object') validate('if (%s) {', types.object(name)) - + validate('if (Object.keys(%s).length < %d) {', name, node.minProperties) error('has less properties than allowed') validate('}') @@ -466,7 +475,7 @@ var compile = function(schema, cache, root, reporter, opts) { if (node.maxItems !== undefined) { if (type !== 'array') validate('if (%s) {', types.array(name)) - + validate('if (%s.length > %d) {', name, node.maxItems) error('has more items than allowed') validate('}') @@ -476,7 +485,7 @@ var compile = function(schema, cache, root, reporter, opts) { if (node.minItems !== undefined) { if (type !== 'array') validate('if (%s) {', types.array(name)) - + validate('if (%s.length < %d) {', name, node.minItems) error('has less items than allowed') validate('}') @@ -518,7 +527,11 @@ var compile = function(schema, cache, root, reporter, opts) { if (properties) { Object.keys(properties).forEach(function(p) { + if (Array.isArray(type) && type.indexOf('null') !== -1) validate('if (%s !== null) {', name) + visit(genobj(name, p), properties[p], reporter, filter) + + if (Array.isArray(type) && type.indexOf('null') !== -1) validate('}') }) } @@ -539,14 +552,16 @@ var compile = function(schema, cache, root, reporter, opts) { validate = validate.toFunction(scope) validate.errors = null - validate.__defineGetter__('error', function() { - if (!validate.errors) return '' - return validate.errors - .map(function(err) { - return err.field+' '+err.message - }) - .join('\n') - }) + if (Object.defineProperty) { + Object.defineProperty(validate, 'error', { + get: function() { + if (!validate.errors) return '' + return validate.errors.map(function(err) { + return err.field + ' ' + err.message; + }).join('\n') + } + }) + } validate.toJSON = function() { return schema diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/package.json b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/package.json deleted file mode 100644 index db1ac2aa364f5d..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "generate-function", - "version": "2.0.0", - "description": "Module that helps you write generated functions in Node", - "main": "index.js", - "scripts": { - "test": "tape test.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/mafintosh/generate-function.git" - }, - "keywords": [ - "generate", - "code", - "generation", - "function", - "performance" - ], - "author": { - "name": "Mathias Buus" - }, - "license": "MIT", - "bugs": { - "url": "https://github.com/mafintosh/generate-function/issues" - }, - "homepage": "https://github.com/mafintosh/generate-function", - "devDependencies": { - "tape": "^2.13.4" - }, - "gitHead": "3d5fc8de5859be95f58e3af9bfb5f663edd95149", - "_id": "generate-function@2.0.0", - "_shasum": "6858fe7c0969b7d4e9093337647ac79f60dfbe74", - "_from": "generate-function@>=2.0.0 <3.0.0", - "_npmVersion": "1.4.23", - "_npmUser": { - "name": "mafintosh", - "email": "mathiasbuus@gmail.com" - }, - "maintainers": [ - { - "name": "mafintosh", - "email": "mathiasbuus@gmail.com" - } - ], - "dist": { - "shasum": "6858fe7c0969b7d4e9093337647ac79f60dfbe74", - "tarball": "http://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/test.js b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/test.js deleted file mode 100644 index 2768893eb15066..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/test.js +++ /dev/null @@ -1,33 +0,0 @@ -var tape = require('tape') -var genfun = require('./') - -tape('generate add function', function(t) { - var fn = genfun() - ('function add(n) {') - ('return n + %d', 42) - ('}') - - t.same(fn.toString(), 'function add(n) {\n return n + 42\n}', 'code is indented') - t.same(fn.toFunction()(10), 52, 'function works') - t.end() -}) - -tape('generate function + closed variables', function(t) { - var fn = genfun() - ('function add(n) {') - ('return n + %d + number', 42) - ('}') - - var notGood = fn.toFunction() - var good = fn.toFunction({number:10}) - - try { - notGood(10) - t.ok(false, 'function should not work') - } catch (err) { - t.same(err.message, 'number is not defined', 'throws reference error') - } - - t.same(good(11), 63, 'function with closed var works') - t.end() -}) \ No newline at end of file diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/.npmignore b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/.npmignore deleted file mode 100644 index 3c3629e647f5dd..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/.travis.yml b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/.travis.yml deleted file mode 100644 index 6e5919de39a312..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - "0.10" diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/.npmignore b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/.npmignore deleted file mode 100644 index 8ecfa25a868d83..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/.npmignore +++ /dev/null @@ -1,17 +0,0 @@ -lib-cov -*.seed -*.log -*.csv -*.dat -*.out -*.pid -*.gz - -pids -logs -results - -npm-debug.log -node_modules/* -*.DS_Store -test/* \ No newline at end of file diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md deleted file mode 100644 index ef1d00b62f8022..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md +++ /dev/null @@ -1,28 +0,0 @@ -is-property -=========== -Tests if a property of a JavaScript object can be accessed using the dot (.) notation or if it must be enclosed in brackets, (ie use x[" ... "]) - -Example -------- - -```javascript -var isProperty = require("is-property") - -console.log(isProperty("foo")) //Prints true -console.log(isProperty("0")) //Prints false -``` - -Install -------- - - npm install is-property - -### `require("is-property")(str)` -Checks if str is a property - -* `str` is a string which we will test if it is a property or not - -**Returns** true or false depending if str is a property - -## Credits -(c) 2013 Mikola Lysenko. MIT License \ No newline at end of file diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json deleted file mode 100644 index 9f23619477398c..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "is-property", - "version": "1.0.2", - "description": "Tests if a JSON property can be accessed using . syntax", - "main": "is-property.js", - "directories": { - "test": "test" - }, - "dependencies": {}, - "devDependencies": { - "tape": "~1.0.4" - }, - "scripts": { - "test": "tap test/*.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/mikolalysenko/is-property.git" - }, - "keywords": [ - "is", - "property", - "json", - "dot", - "bracket", - ".", - "[]" - ], - "author": { - "name": "Mikola Lysenko" - }, - "license": "MIT", - "gitHead": "0a85ea5b6b1264ea1cdecc6e5cf186adbb3ffc50", - "bugs": { - "url": "https://github.com/mikolalysenko/is-property/issues" - }, - "homepage": "https://github.com/mikolalysenko/is-property", - "_id": "is-property@1.0.2", - "_shasum": "57fe1c4e48474edd65b09911f26b1cd4095dda84", - "_from": "is-property@>=1.0.0 <2.0.0", - "_npmVersion": "2.1.4", - "_nodeVersion": "0.10.26", - "_npmUser": { - "name": "mikolalysenko", - "email": "mikolalysenko@gmail.com" - }, - "maintainers": [ - { - "name": "mikolalysenko", - "email": "mikolalysenko@gmail.com" - } - ], - "dist": { - "shasum": "57fe1c4e48474edd65b09911f26b1cd4095dda84", - "tarball": "http://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz" - }, - "_resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json deleted file mode 100644 index 8bc73da759fde0..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "generate-object-property", - "version": "1.2.0", - "description": "Generate safe JS code that can used to reference a object property", - "repository": { - "type": "git", - "url": "git+https://github.com/mafintosh/generate-object-property.git" - }, - "devDependencies": { - "tape": "^2.13.0" - }, - "scripts": { - "test": "tape test.js" - }, - "dependencies": { - "is-property": "^1.0.0" - }, - "bugs": { - "url": "https://github.com/mafintosh/generate-object-property/issues" - }, - "homepage": "https://github.com/mafintosh/generate-object-property", - "main": "index.js", - "author": { - "name": "Mathias Buus", - "url": "@mafintosh" - }, - "license": "MIT", - "gitHead": "0dd7d411018de54b2eae63b424c15b3e50bd678c", - "_id": "generate-object-property@1.2.0", - "_shasum": "9c0e1c40308ce804f4783618b937fa88f99d50d0", - "_from": "generate-object-property@>=1.1.0 <2.0.0", - "_npmVersion": "2.9.0", - "_nodeVersion": "2.0.1", - "_npmUser": { - "name": "mafintosh", - "email": "mathiasbuus@gmail.com" - }, - "maintainers": [ - { - "name": "mafintosh", - "email": "mathiasbuus@gmail.com" - } - ], - "dist": { - "shasum": "9c0e1c40308ce804f4783618b937fa88f99d50d0", - "tarball": "http://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/test.js b/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/test.js deleted file mode 100644 index 6c299c67fd3165..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/test.js +++ /dev/null @@ -1,12 +0,0 @@ -var tape = require('tape') -var gen = require('./') - -tape('valid', function(t) { - t.same(gen('a', 'b'), 'a.b') - t.end() -}) - -tape('invalid', function(t) { - t.same(gen('a', '-b'), 'a["-b"]') - t.end() -}) \ No newline at end of file diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/.travis.yml b/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/.travis.yml deleted file mode 100644 index a057a7c6373342..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: "node_js" -node_js: - - 0.4 - - 0.5 - - 0.6 - - 0.8 diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/README.md b/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/README.md deleted file mode 100644 index bcfdb1a4ec806a..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# JSON Pointer for nodejs - -This is an implementation of [JSON Pointer](http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-08). - -## Usage - - var jsonpointer = require("jsonpointer"); - var obj = { foo: 1, bar: { baz: 2}, qux: [3, 4, 5]}; - var one = jsonpointer.get(obj, "/foo"); - var two = jsonpointer.get(obj, "/bar/baz"); - var three = jsonpointer.get(obj, "/qux/0"); - var four = jsonpointer.get(obj, "/qux/1"); - var five = jsonpointer.get(obj, "/qux/2"); - - jsonpointer.set(obj, "/foo", 6); // obj.foo = 6; - -## Testing - - $ node test.js - All tests pass. - $ - -[![Build Status](https://travis-ci.org/janl/node-jsonpointer.png?branch=master)](undefined) - -## Author - -(c) 2011 Jan Lehnardt - -## License - -MIT License. \ No newline at end of file diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json b/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json deleted file mode 100644 index bde9b77dd91669..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "jsonpointer", - "description": "Simple JSON Addressing.", - "tags": [ - "util", - "simple", - "util", - "utility" - ], - "version": "1.1.0", - "author": { - "name": "Jan Lehnardt", - "email": "jan@apache.org" - }, - "contributors": [ - { - "name": "Joe Hildebrand", - "email": "joe-github@cursive.net" - }, - { - "name": "Filip Noetzel" - } - ], - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/janl/node-jsonpointer.git" - }, - "bugs": { - "url": "http://github.com/janl/node-jsonpointer/issues" - }, - "engines": [ - "node >= 0.4.9" - ], - "main": "./jsonpointer", - "scripts": { - "test": "node test.js" - }, - "readme": "# JSON Pointer for nodejs\n\nThis is an implementation of [JSON Pointer](http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-08).\n\n## Usage\n\n var jsonpointer = require(\"jsonpointer\");\n var obj = { foo: 1, bar: { baz: 2}, qux: [3, 4, 5]};\n var one = jsonpointer.get(obj, \"/foo\");\n var two = jsonpointer.get(obj, \"/bar/baz\");\n var three = jsonpointer.get(obj, \"/qux/0\");\n var four = jsonpointer.get(obj, \"/qux/1\");\n var five = jsonpointer.get(obj, \"/qux/2\");\n\n jsonpointer.set(obj, \"/foo\", 6); // obj.foo = 6;\n\n## Testing\n\n $ node test.js\n All tests pass.\n $\n\n[![Build Status](https://travis-ci.org/janl/node-jsonpointer.png?branch=master)](undefined)\n\n## Author\n\n(c) 2011 Jan Lehnardt \n\n## License\n\nMIT License.", - "readmeFilename": "README.md", - "_id": "jsonpointer@1.1.0", - "dist": { - "shasum": "c3c72efaed3b97154163dc01dd349e1cfe0f80fc", - "tarball": "http://registry.npmjs.org/jsonpointer/-/jsonpointer-1.1.0.tgz" - }, - "_npmVersion": "1.1.69", - "_npmUser": { - "name": "jan", - "email": "jan@apache.org" - }, - "maintainers": [ - { - "name": "jan", - "email": "jan@apache.org" - } - ], - "directories": {}, - "_shasum": "c3c72efaed3b97154163dc01dd349e1cfe0f80fc", - "_resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-1.1.0.tgz", - "_from": "jsonpointer@>=1.1.0 <2.0.0", - "homepage": "https://github.com/janl/node-jsonpointer" -} diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/test.js b/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/test.js deleted file mode 100644 index cdb8ec506c339e..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/test.js +++ /dev/null @@ -1,100 +0,0 @@ -var assert = require("assert"); -var console = require("console"); -var jsonpointer = require("./jsonpointer"); - -var obj = { - a: 1, - b: { - c: 2 - }, - d: { - e: [{a:3}, {b:4}, {c:5}] - } -}; - -assert.equal(jsonpointer.get(obj, "/a"), 1); -assert.equal(jsonpointer.get(obj, "/b/c"), 2); -assert.equal(jsonpointer.get(obj, "/d/e/0/a"), 3); -assert.equal(jsonpointer.get(obj, "/d/e/1/b"), 4); -assert.equal(jsonpointer.get(obj, "/d/e/2/c"), 5); - -// set returns old value -assert.equal(jsonpointer.set(obj, "/a", 2), 1); -assert.equal(jsonpointer.set(obj, "/b/c", 3), 2); -assert.equal(jsonpointer.set(obj, "/d/e/0/a", 4), 3); -assert.equal(jsonpointer.set(obj, "/d/e/1/b", 5), 4); -assert.equal(jsonpointer.set(obj, "/d/e/2/c", 6), 5); - -assert.equal(jsonpointer.get(obj, "/a"), 2); -assert.equal(jsonpointer.get(obj, "/b/c"), 3); -assert.equal(jsonpointer.get(obj, "/d/e/0/a"), 4); -assert.equal(jsonpointer.get(obj, "/d/e/1/b"), 5); -assert.equal(jsonpointer.get(obj, "/d/e/2/c"), 6); - -assert.equal(jsonpointer.get(obj, ""), obj); -assert.throws(function() { - assert.equal(jsonpointer.get(obj, "a"), 3); -}); - -var complexKeys = { - "a/b": { - c: 1 - }, - d: { - "e/f": 2 - }, - "~1": 3, - "01": 4 -} - -assert.equal(jsonpointer.get(complexKeys, "/a~1b/c"), 1); -assert.equal(jsonpointer.get(complexKeys, "/d/e~1f"), 2); -assert.equal(jsonpointer.get(complexKeys, "/~01"), 3); -assert.equal(jsonpointer.get(complexKeys, "/01"), 4); -assert.throws(function() { - assert.equal(jsonpointer.get(complexKeys, "/a/b/c"), 1); -}); -assert.throws(function() { - assert.equal(jsonpointer.get(complexKeys, "/~1"), 3); -}); - -// draft-ietf-appsawg-json-pointer-08 has special array rules -var ary = [ "zero", "one", "two" ]; - -assert.throws(function() { - assert.equal(jsonpointer.get(ary, "/01"), "one"); -}); -//assert.equal(jsonpointer.set(ary, "/-", "three"), null); -//assert.equal(ary[3], "three"); - -// Examples from the draft: -var example = { - "foo": ["bar", "baz"], - "": 0, - "a/b": 1, - "c%d": 2, - "e^f": 3, - "g|h": 4, - "i\\j": 5, - "k\"l": 6, - " ": 7, - "m~n": 8 -}; - -assert.equal(jsonpointer.get(example, ""), example); -var ans = jsonpointer.get(example, "/foo"); -assert.equal(ans.length, 2); -assert.equal(ans[0], "bar"); -assert.equal(ans[1], "baz"); -assert.equal(jsonpointer.get(example, "/foo/0"), "bar"); -assert.equal(jsonpointer.get(example, "/"), 0); -assert.equal(jsonpointer.get(example, "/a~1b"), 1); -assert.equal(jsonpointer.get(example, "/c%d"), 2); -assert.equal(jsonpointer.get(example, "/e^f"), 3); -assert.equal(jsonpointer.get(example, "/g|h"), 4); -assert.equal(jsonpointer.get(example, "/i\\j"), 5); -assert.equal(jsonpointer.get(example, "/k\"l"), 6); -assert.equal(jsonpointer.get(example, "/ "), 7); -assert.equal(jsonpointer.get(example, "/m~0n"), 8); - -console.log("All tests pass."); diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/.jshintrc b/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/.jshintrc deleted file mode 100644 index 77887b5f0f2efc..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/.jshintrc +++ /dev/null @@ -1,30 +0,0 @@ -{ - "maxdepth": 4, - "maxstatements": 200, - "maxcomplexity": 12, - "maxlen": 80, - "maxparams": 5, - - "curly": true, - "eqeqeq": true, - "immed": true, - "latedef": false, - "noarg": true, - "noempty": true, - "nonew": true, - "undef": true, - "unused": "vars", - "trailing": true, - - "quotmark": true, - "expr": true, - "asi": true, - - "browser": false, - "esnext": true, - "devel": false, - "node": false, - "nonstandard": false, - - "predef": ["require", "module", "__dirname", "__filename"] -} diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/.npmignore b/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/.npmignore deleted file mode 100644 index 3c3629e647f5dd..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/immutable.js b/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/immutable.js deleted file mode 100644 index 5b760152b75041..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/immutable.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = extend - -function extend() { - var target = {} - - for (var i = 0; i < arguments.length; i++) { - var source = arguments[i] - - for (var key in source) { - if (source.hasOwnProperty(key)) { - target[key] = source[key] - } - } - } - - return target -} diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/mutable.js b/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/mutable.js deleted file mode 100644 index a34475ebddf63f..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/mutable.js +++ /dev/null @@ -1,15 +0,0 @@ -module.exports = extend - -function extend(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] - - for (var key in source) { - if (source.hasOwnProperty(key)) { - target[key] = source[key] - } - } - } - - return target -} diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/package.json b/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/package.json deleted file mode 100644 index 907a720da7e2f6..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "name": "xtend", - "version": "4.0.0", - "description": "extend like a boss", - "keywords": [ - "extend", - "merge", - "options", - "opts", - "object", - "array" - ], - "author": { - "name": "Raynos", - "email": "raynos2@gmail.com" - }, - "repository": { - "type": "git", - "url": "git://github.com/Raynos/xtend.git" - }, - "main": "immutable", - "scripts": { - "test": "node test" - }, - "dependencies": {}, - "devDependencies": { - "tape": "~1.1.0" - }, - "homepage": "https://github.com/Raynos/xtend", - "contributors": [ - { - "name": "Jake Verbaten" - }, - { - "name": "Matt Esch" - } - ], - "bugs": { - "url": "https://github.com/Raynos/xtend/issues", - "email": "raynos2@gmail.com" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/raynos/xtend/raw/master/LICENSE" - } - ], - "testling": { - "files": "test.js", - "browsers": [ - "ie/7..latest", - "firefox/16..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest" - ] - }, - "engines": { - "node": ">=0.4" - }, - "gitHead": "94a95d76154103290533b2c55ffa0fe4be16bfef", - "_id": "xtend@4.0.0", - "_shasum": "8bc36ff87aedbe7ce9eaf0bca36b2354a743840f", - "_from": "xtend@>=4.0.0 <5.0.0", - "_npmVersion": "1.4.15", - "_npmUser": { - "name": "raynos", - "email": "raynos2@gmail.com" - }, - "maintainers": [ - { - "name": "raynos", - "email": "raynos2@gmail.com" - } - ], - "dist": { - "shasum": "8bc36ff87aedbe7ce9eaf0bca36b2354a743840f", - "tarball": "http://registry.npmjs.org/xtend/-/xtend-4.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/test.js b/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/test.js deleted file mode 100644 index 3369d79660b184..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/test.js +++ /dev/null @@ -1,63 +0,0 @@ -var test = require("tape") -var extend = require("./") -var mutableExtend = require("./mutable") - -test("merge", function(assert) { - var a = { a: "foo" } - var b = { b: "bar" } - - assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) - assert.end() -}) - -test("replace", function(assert) { - var a = { a: "foo" } - var b = { a: "bar" } - - assert.deepEqual(extend(a, b), { a: "bar" }) - assert.end() -}) - -test("undefined", function(assert) { - var a = { a: undefined } - var b = { b: "foo" } - - assert.deepEqual(extend(a, b), { a: undefined, b: "foo" }) - assert.deepEqual(extend(b, a), { a: undefined, b: "foo" }) - assert.end() -}) - -test("handle 0", function(assert) { - var a = { a: "default" } - var b = { a: 0 } - - assert.deepEqual(extend(a, b), { a: 0 }) - assert.deepEqual(extend(b, a), { a: "default" }) - assert.end() -}) - -test("is immutable", function (assert) { - var record = {} - - extend(record, { foo: "bar" }) - assert.equal(record.foo, undefined) - assert.end() -}) - -test("null as argument", function (assert) { - var a = { foo: "bar" } - var b = null - var c = void 0 - - assert.deepEqual(extend(b, a, c), { foo: "bar" }) - assert.end() -}) - -test("mutable", function (assert) { - var a = { foo: "bar" } - - mutableExtend(a, { bar: "baz" }) - - assert.equal(a.bar, "baz") - assert.end() -}) diff --git a/tools/eslint/node_modules/is-my-json-valid/package.json b/tools/eslint/node_modules/is-my-json-valid/package.json index 79099026347b8c..62cd6f7c5f5af2 100644 --- a/tools/eslint/node_modules/is-my-json-valid/package.json +++ b/tools/eslint/node_modules/is-my-json-valid/package.json @@ -1,49 +1,78 @@ { - "name": "is-my-json-valid", - "version": "2.12.0", - "description": "A JSONSchema validator that uses code generation to be extremely fast", - "main": "index.js", + "_args": [ + [ + "is-my-json-valid@^2.10.0", + "/Users/silverwind/git/node/tools/package/package" + ] + ], + "_from": "is-my-json-valid@>=2.10.0 <3.0.0", + "_id": "is-my-json-valid@2.13.1", + "_inCache": true, + "_installable": true, + "_location": "/is-my-json-valid", + "_nodeVersion": "4.2.3", + "_npmOperationalInternal": { + "host": "packages-5-east.internal.npmjs.com", + "tmp": "tmp/is-my-json-valid-2.13.1.tgz_1456180270224_0.17748022079467773" + }, + "_npmUser": { + "email": "mathiasbuus@gmail.com", + "name": "mafintosh" + }, + "_npmVersion": "2.14.7", + "_phantomChildren": {}, + "_requested": { + "name": "is-my-json-valid", + "raw": "is-my-json-valid@^2.10.0", + "rawSpec": "^2.10.0", + "scope": null, + "spec": ">=2.10.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.13.1.tgz", + "_shasum": "d55778a82feb6b0963ff4be111d5d1684e890707", + "_shrinkwrap": null, + "_spec": "is-my-json-valid@^2.10.0", + "_where": "/Users/silverwind/git/node/tools/package/package", + "author": { + "name": "Mathias Buus" + }, + "bugs": { + "url": "https://github.com/mafintosh/is-my-json-valid/issues" + }, "dependencies": { "generate-function": "^2.0.0", "generate-object-property": "^1.1.0", - "jsonpointer": "^1.1.0", + "jsonpointer": "2.0.0", "xtend": "^4.0.0" }, + "description": "A JSONSchema validator that uses code generation to be extremely fast", "devDependencies": { "tape": "^2.13.4" }, - "scripts": { - "test": "tape test/*.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/mafintosh/is-my-json-valid.git" + "directories": {}, + "dist": { + "shasum": "d55778a82feb6b0963ff4be111d5d1684e890707", + "tarball": "http://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.13.1.tgz" }, + "gitHead": "5bacc71441750bc6e79829abcfc21d4f2f0c4396", + "homepage": "https://github.com/mafintosh/is-my-json-valid", "keywords": [ "json", - "schema", + "jsonschema", "orderly", - "jsonschema" + "schema" ], - "author": { - "name": "Mathias Buus" - }, "license": "MIT", - "bugs": { - "url": "https://github.com/mafintosh/is-my-json-valid/issues" - }, - "homepage": "https://github.com/mafintosh/is-my-json-valid", - "gitHead": "fc2d995ecb1bdb0f367ddf114dfd069265043c6c", - "_id": "is-my-json-valid@2.12.0", - "_shasum": "8fa6c408b26be95b45a23e8f8c4b464a53874d2b", - "_from": "is-my-json-valid@>=2.10.0 <3.0.0", - "_npmVersion": "2.9.0", - "_nodeVersion": "2.0.1", - "_npmUser": { - "name": "mafintosh", - "email": "mathiasbuus@gmail.com" - }, + "main": "index.js", "maintainers": [ + { + "name": "freeall", + "email": "freeall@gmail.com" + }, { "name": "mafintosh", "email": "mathiasbuus@gmail.com" @@ -53,15 +82,19 @@ "email": "w@tson.dk" }, { - "name": "freeall", - "email": "freeall@gmail.com" + "name": "yoshuawuyts", + "email": "i@yoshuawuyts.com" } ], - "dist": { - "shasum": "8fa6c408b26be95b45a23e8f8c4b464a53874d2b", - "tarball": "http://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.0.tgz" + "name": "is-my-json-valid", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/mafintosh/is-my-json-valid.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.0.tgz", - "readme": "ERROR: No README data found!" + "scripts": { + "test": "tape test/*.js" + }, + "version": "2.13.1" } diff --git a/tools/eslint/node_modules/is-my-json-valid/test/fixtures/cosmic.js b/tools/eslint/node_modules/is-my-json-valid/test/fixtures/cosmic.js deleted file mode 100644 index 4e0a34b210c52b..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/fixtures/cosmic.js +++ /dev/null @@ -1,84 +0,0 @@ -exports.valid = { - fullName : "John Doe", - age : 47, - state : "Massachusetts", - city : "Boston", - zip : 16417, - married : false, - dozen : 12, - dozenOrBakersDozen : 13, - favoriteEvenNumber : 14, - topThreeFavoriteColors : [ "red", "blue", "green" ], - favoriteSingleDigitWholeNumbers : [ 7 ], - favoriteFiveLetterWord : "coder", - emailAddresses : - [ - "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@letters-in-local.org", - "01234567890@numbers-in-local.net", - "&'*+-./=?^_{}~@other-valid-characters-in-local.net", - "mixed-1234-in-{+^}-local@sld.net", - "a@single-character-in-local.org", - "\"quoted\"@sld.com", - "\"\\e\\s\\c\\a\\p\\e\\d\"@sld.com", - "\"quoted-at-sign@sld.org\"@sld.com", - "\"escaped\\\"quote\"@sld.com", - "\"back\\slash\"@sld.com", - "one-character-third-level@a.example.com", - "single-character-in-sld@x.org", - "local@dash-in-sld.com", - "letters-in-sld@123.com", - "one-letter-sld@x.org", - "uncommon-tld@sld.museum", - "uncommon-tld@sld.travel", - "uncommon-tld@sld.mobi", - "country-code-tld@sld.uk", - "country-code-tld@sld.rw", - "local@sld.newTLD", - "the-total-length@of-an-entire-address.cannot-be-longer-than-two-hundred-and-fifty-four-characters.and-this-address-is-254-characters-exactly.so-it-should-be-valid.and-im-going-to-add-some-more-words-here.to-increase-the-lenght-blah-blah-blah-blah-bla.org", - "the-character-limit@for-each-part.of-the-domain.is-sixty-three-characters.this-is-exactly-sixty-three-characters-so-it-is-valid-blah-blah.com", - "local@sub.domains.com" - ], - ipAddresses : [ "127.0.0.1", "24.48.64.2", "192.168.1.1", "209.68.44.3", "2.2.2.2" ] -} - -exports.invalid = { - fullName : null, - age : -1, - state : 47, - city : false, - zip : [null], - married : "yes", - dozen : 50, - dozenOrBakersDozen : "over 9000", - favoriteEvenNumber : 15, - topThreeFavoriteColors : [ "red", 5 ], - favoriteSingleDigitWholeNumbers : [ 78, 2, 999 ], - favoriteFiveLetterWord : "codernaut", - emailAddresses : [], - ipAddresses : [ "999.0.099.1", "294.48.64.2346", false, "2221409.64214128.42414.235233", "124124.12412412" ] -} - -exports.schema = { // from cosmic thingy - name : "test", - type : "object", - additionalProperties : false, - required : ["fullName", "age", "zip", "married", "dozen", "dozenOrBakersDozen", "favoriteEvenNumber", "topThreeFavoriteColors", "favoriteSingleDigitWholeNumbers", "favoriteFiveLetterWord", "emailAddresses", "ipAddresses"], - properties : - { - fullName : { type : "string" }, - age : { type : "integer", minimum : 0 }, - optionalItem : { type : "string" }, - state : { type : "string" }, - city : { type : "string" }, - zip : { type : "integer", minimum : 0, maximum : 99999 }, - married : { type : "boolean" }, - dozen : { type : "integer", minimum : 12, maximum : 12 }, - dozenOrBakersDozen : { type : "integer", minimum : 12, maximum : 13 }, - favoriteEvenNumber : { type : "integer", multipleOf : 2 }, - topThreeFavoriteColors : { type : "array", minItems : 3, maxItems : 3, uniqueItems : true, items : { type : "string" }}, - favoriteSingleDigitWholeNumbers : { type : "array", minItems : 1, maxItems : 10, uniqueItems : true, items : { type : "integer", minimum : 0, maximum : 9 }}, - favoriteFiveLetterWord : { type : "string", minLength : 5, maxLength : 5 }, - emailAddresses : { type : "array", minItems : 1, uniqueItems : true, items : { type : "string", format : "email" }}, - ipAddresses : { type : "array", uniqueItems : true, items : { type : "string", format : "ipv4" }}, - } - } \ No newline at end of file diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/additionalItems.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/additionalItems.json deleted file mode 100644 index 521745c8d6ed50..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/additionalItems.json +++ /dev/null @@ -1,82 +0,0 @@ -[ - { - "description": "additionalItems as schema", - "schema": { - "items": [{}], - "additionalItems": {"type": "integer"} - }, - "tests": [ - { - "description": "additional items match schema", - "data": [ null, 2, 3, 4 ], - "valid": true - }, - { - "description": "additional items do not match schema", - "data": [ null, 2, 3, "foo" ], - "valid": false - } - ] - }, - { - "description": "items is schema, no additionalItems", - "schema": { - "items": {}, - "additionalItems": false - }, - "tests": [ - { - "description": "all items match schema", - "data": [ 1, 2, 3, 4, 5 ], - "valid": true - } - ] - }, - { - "description": "array of items with no additionalItems", - "schema": { - "items": [{}, {}, {}], - "additionalItems": false - }, - "tests": [ - { - "description": "no additional items present", - "data": [ 1, 2, 3 ], - "valid": true - }, - { - "description": "additional items are not permitted", - "data": [ 1, 2, 3, 4 ], - "valid": false - } - ] - }, - { - "description": "additionalItems as false without items", - "schema": {"additionalItems": false}, - "tests": [ - { - "description": - "items defaults to empty schema so everything is valid", - "data": [ 1, 2, 3, 4, 5 ], - "valid": true - }, - { - "description": "ignores non-arrays", - "data": {"foo" : "bar"}, - "valid": true - } - ] - }, - { - "description": "additionalItems are allowed by default", - "schema": {"items": [{"type": "integer"}]}, - "tests": [ - { - "description": "only the first item is validated", - "data": [1, "foo", false], - "valid": true - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/additionalProperties.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/additionalProperties.json deleted file mode 100644 index 40831f9e9aa135..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/additionalProperties.json +++ /dev/null @@ -1,88 +0,0 @@ -[ - { - "description": - "additionalProperties being false does not allow other properties", - "schema": { - "properties": {"foo": {}, "bar": {}}, - "patternProperties": { "^v": {} }, - "additionalProperties": false - }, - "tests": [ - { - "description": "no additional properties is valid", - "data": {"foo": 1}, - "valid": true - }, - { - "description": "an additional property is invalid", - "data": {"foo" : 1, "bar" : 2, "quux" : "boom"}, - "valid": false - }, - { - "description": "ignores non-objects", - "data": [1, 2, 3], - "valid": true - }, - { - "description": "patternProperties are not additional properties", - "data": {"foo":1, "vroom": 2}, - "valid": true - } - ] - }, - { - "description": - "additionalProperties allows a schema which should validate", - "schema": { - "properties": {"foo": {}, "bar": {}}, - "additionalProperties": {"type": "boolean"} - }, - "tests": [ - { - "description": "no additional properties is valid", - "data": {"foo": 1}, - "valid": true - }, - { - "description": "an additional valid property is valid", - "data": {"foo" : 1, "bar" : 2, "quux" : true}, - "valid": true - }, - { - "description": "an additional invalid property is invalid", - "data": {"foo" : 1, "bar" : 2, "quux" : 12}, - "valid": false - } - ] - }, - { - "description": - "additionalProperties can exist by itself", - "schema": { - "additionalProperties": {"type": "boolean"} - }, - "tests": [ - { - "description": "an additional valid property is valid", - "data": {"foo" : true}, - "valid": true - }, - { - "description": "an additional invalid property is invalid", - "data": {"foo" : 1}, - "valid": false - } - ] - }, - { - "description": "additionalProperties are allowed by default", - "schema": {"properties": {"foo": {}, "bar": {}}}, - "tests": [ - { - "description": "additional properties are allowed", - "data": {"foo": 1, "bar": 2, "quux": true}, - "valid": true - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/allOf.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/allOf.json deleted file mode 100644 index bbb5f89e4bc5e1..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/allOf.json +++ /dev/null @@ -1,112 +0,0 @@ -[ - { - "description": "allOf", - "schema": { - "allOf": [ - { - "properties": { - "bar": {"type": "integer"} - }, - "required": ["bar"] - }, - { - "properties": { - "foo": {"type": "string"} - }, - "required": ["foo"] - } - ] - }, - "tests": [ - { - "description": "allOf", - "data": {"foo": "baz", "bar": 2}, - "valid": true - }, - { - "description": "mismatch second", - "data": {"foo": "baz"}, - "valid": false - }, - { - "description": "mismatch first", - "data": {"bar": 2}, - "valid": false - }, - { - "description": "wrong type", - "data": {"foo": "baz", "bar": "quux"}, - "valid": false - } - ] - }, - { - "description": "allOf with base schema", - "schema": { - "properties": {"bar": {"type": "integer"}}, - "required": ["bar"], - "allOf" : [ - { - "properties": { - "foo": {"type": "string"} - }, - "required": ["foo"] - }, - { - "properties": { - "baz": {"type": "null"} - }, - "required": ["baz"] - } - ] - }, - "tests": [ - { - "description": "valid", - "data": {"foo": "quux", "bar": 2, "baz": null}, - "valid": true - }, - { - "description": "mismatch base schema", - "data": {"foo": "quux", "baz": null}, - "valid": false - }, - { - "description": "mismatch first allOf", - "data": {"bar": 2, "baz": null}, - "valid": false - }, - { - "description": "mismatch second allOf", - "data": {"foo": "quux", "bar": 2}, - "valid": false - }, - { - "description": "mismatch both", - "data": {"bar": 2}, - "valid": false - } - ] - }, - { - "description": "allOf simple types", - "schema": { - "allOf": [ - {"maximum": 30}, - {"minimum": 20} - ] - }, - "tests": [ - { - "description": "valid", - "data": 25, - "valid": true - }, - { - "description": "mismatch one", - "data": 35, - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/anyOf.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/anyOf.json deleted file mode 100644 index a58714afd89277..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/anyOf.json +++ /dev/null @@ -1,68 +0,0 @@ -[ - { - "description": "anyOf", - "schema": { - "anyOf": [ - { - "type": "integer" - }, - { - "minimum": 2 - } - ] - }, - "tests": [ - { - "description": "first anyOf valid", - "data": 1, - "valid": true - }, - { - "description": "second anyOf valid", - "data": 2.5, - "valid": true - }, - { - "description": "both anyOf valid", - "data": 3, - "valid": true - }, - { - "description": "neither anyOf valid", - "data": 1.5, - "valid": false - } - ] - }, - { - "description": "anyOf with base schema", - "schema": { - "type": "string", - "anyOf" : [ - { - "maxLength": 2 - }, - { - "minLength": 4 - } - ] - }, - "tests": [ - { - "description": "mismatch base schema", - "data": 3, - "valid": false - }, - { - "description": "one anyOf valid", - "data": "foobar", - "valid": true - }, - { - "description": "both anyOf invalid", - "data": "foo", - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/bignum.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/bignum.json deleted file mode 100644 index ccc7c17fe8d504..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/bignum.json +++ /dev/null @@ -1,107 +0,0 @@ -[ - { - "description": "integer", - "schema": {"type": "integer"}, - "tests": [ - { - "description": "a bignum is an integer", - "data": 12345678910111213141516171819202122232425262728293031, - "valid": true - } - ] - }, - { - "description": "number", - "schema": {"type": "number"}, - "tests": [ - { - "description": "a bignum is a number", - "data": 98249283749234923498293171823948729348710298301928331, - "valid": true - } - ] - }, - { - "description": "integer", - "schema": {"type": "integer"}, - "tests": [ - { - "description": "a negative bignum is an integer", - "data": -12345678910111213141516171819202122232425262728293031, - "valid": true - } - ] - }, - { - "description": "number", - "schema": {"type": "number"}, - "tests": [ - { - "description": "a negative bignum is a number", - "data": -98249283749234923498293171823948729348710298301928331, - "valid": true - } - ] - }, - { - "description": "string", - "schema": {"type": "string"}, - "tests": [ - { - "description": "a bignum is not a string", - "data": 98249283749234923498293171823948729348710298301928331, - "valid": false - } - ] - }, - { - "description": "integer comparison", - "schema": {"maximum": 18446744073709551615}, - "tests": [ - { - "description": "comparison works for high numbers", - "data": 18446744073709551600, - "valid": true - } - ] - }, - { - "description": "float comparison with high precision", - "schema": { - "maximum": 972783798187987123879878123.18878137, - "exclusiveMaximum": true - }, - "tests": [ - { - "description": "comparison works for high numbers", - "data": 972783798187987123879878123.188781371, - "valid": false - } - ] - }, - { - "description": "integer comparison", - "schema": {"minimum": -18446744073709551615}, - "tests": [ - { - "description": "comparison works for very negative numbers", - "data": -18446744073709551600, - "valid": true - } - ] - }, - { - "description": "float comparison with high precision on negative numbers", - "schema": { - "minimum": -972783798187987123879878123.18878137, - "exclusiveMinimum": true - }, - "tests": [ - { - "description": "comparison works for very negative numbers", - "data": -972783798187987123879878123.188781371, - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/default.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/default.json deleted file mode 100644 index 17629779fbeabe..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/default.json +++ /dev/null @@ -1,49 +0,0 @@ -[ - { - "description": "invalid type for default", - "schema": { - "properties": { - "foo": { - "type": "integer", - "default": [] - } - } - }, - "tests": [ - { - "description": "valid when property is specified", - "data": {"foo": 13}, - "valid": true - }, - { - "description": "still valid when the invalid default is used", - "data": {}, - "valid": true - } - ] - }, - { - "description": "invalid string value for default", - "schema": { - "properties": { - "bar": { - "type": "string", - "minLength": 4, - "default": "bad" - } - } - }, - "tests": [ - { - "description": "valid when property is specified", - "data": {"bar": "good"}, - "valid": true - }, - { - "description": "still valid when the invalid default is used", - "data": {}, - "valid": true - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/definitions.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/definitions.json deleted file mode 100644 index cf935a321532a6..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/definitions.json +++ /dev/null @@ -1,32 +0,0 @@ -[ - { - "description": "valid definition", - "schema": {"$ref": "http://json-schema.org/draft-04/schema#"}, - "tests": [ - { - "description": "valid definition schema", - "data": { - "definitions": { - "foo": {"type": "integer"} - } - }, - "valid": true - } - ] - }, - { - "description": "invalid definition", - "schema": {"$ref": "http://json-schema.org/draft-04/schema#"}, - "tests": [ - { - "description": "invalid definition schema", - "data": { - "definitions": { - "foo": {"type": 1} - } - }, - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/dependencies.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/dependencies.json deleted file mode 100644 index 7b9b16a7e125ff..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/dependencies.json +++ /dev/null @@ -1,113 +0,0 @@ -[ - { - "description": "dependencies", - "schema": { - "dependencies": {"bar": ["foo"]} - }, - "tests": [ - { - "description": "neither", - "data": {}, - "valid": true - }, - { - "description": "nondependant", - "data": {"foo": 1}, - "valid": true - }, - { - "description": "with dependency", - "data": {"foo": 1, "bar": 2}, - "valid": true - }, - { - "description": "missing dependency", - "data": {"bar": 2}, - "valid": false - }, - { - "description": "ignores non-objects", - "data": "foo", - "valid": true - } - ] - }, - { - "description": "multiple dependencies", - "schema": { - "dependencies": {"quux": ["foo", "bar"]} - }, - "tests": [ - { - "description": "neither", - "data": {}, - "valid": true - }, - { - "description": "nondependants", - "data": {"foo": 1, "bar": 2}, - "valid": true - }, - { - "description": "with dependencies", - "data": {"foo": 1, "bar": 2, "quux": 3}, - "valid": true - }, - { - "description": "missing dependency", - "data": {"foo": 1, "quux": 2}, - "valid": false - }, - { - "description": "missing other dependency", - "data": {"bar": 1, "quux": 2}, - "valid": false - }, - { - "description": "missing both dependencies", - "data": {"quux": 1}, - "valid": false - } - ] - }, - { - "description": "multiple dependencies subschema", - "schema": { - "dependencies": { - "bar": { - "properties": { - "foo": {"type": "integer"}, - "bar": {"type": "integer"} - } - } - } - }, - "tests": [ - { - "description": "valid", - "data": {"foo": 1, "bar": 2}, - "valid": true - }, - { - "description": "no dependency", - "data": {"foo": "quux"}, - "valid": true - }, - { - "description": "wrong type", - "data": {"foo": "quux", "bar": 2}, - "valid": false - }, - { - "description": "wrong type other", - "data": {"foo": 2, "bar": "quux"}, - "valid": false - }, - { - "description": "wrong type both", - "data": {"foo": "quux", "bar": "quux"}, - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/enum.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/enum.json deleted file mode 100644 index f124436a7d9040..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/enum.json +++ /dev/null @@ -1,72 +0,0 @@ -[ - { - "description": "simple enum validation", - "schema": {"enum": [1, 2, 3]}, - "tests": [ - { - "description": "one of the enum is valid", - "data": 1, - "valid": true - }, - { - "description": "something else is invalid", - "data": 4, - "valid": false - } - ] - }, - { - "description": "heterogeneous enum validation", - "schema": {"enum": [6, "foo", [], true, {"foo": 12}]}, - "tests": [ - { - "description": "one of the enum is valid", - "data": [], - "valid": true - }, - { - "description": "something else is invalid", - "data": null, - "valid": false - }, - { - "description": "objects are deep compared", - "data": {"foo": false}, - "valid": false - } - ] - }, - { - "description": "enums in properties", - "schema": { - "type":"object", - "properties": { - "foo": {"enum":["foo"]}, - "bar": {"enum":["bar"]} - }, - "required": ["bar"] - }, - "tests": [ - { - "description": "both properties are valid", - "data": {"foo":"foo", "bar":"bar"}, - "valid": true - }, - { - "description": "missing optional property is valid", - "data": {"bar":"bar"}, - "valid": true - }, - { - "description": "missing required property is invalid", - "data": {"foo":"foo"}, - "valid": false - }, - { - "description": "missing all properties is invalid", - "data": {}, - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/format.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/format.json deleted file mode 100644 index 53c5d2519056c6..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/format.json +++ /dev/null @@ -1,143 +0,0 @@ -[ - { - "description": "validation of date-time strings", - "schema": {"format": "date-time"}, - "tests": [ - { - "description": "a valid date-time string", - "data": "1963-06-19T08:30:06.283185Z", - "valid": true - }, - { - "description": "an invalid date-time string", - "data": "06/19/1963 08:30:06 PST", - "valid": false - }, - { - "description": "only RFC3339 not all of ISO 8601 are valid", - "data": "2013-350T01:01:01", - "valid": false - } - ] - }, - { - "description": "validation of URIs", - "schema": {"format": "uri"}, - "tests": [ - { - "description": "a valid URI", - "data": "http://foo.bar/?baz=qux#quux", - "valid": true - }, - { - "description": "an invalid URI", - "data": "\\\\WINDOWS\\fileshare", - "valid": false - }, - { - "description": "an invalid URI though valid URI reference", - "data": "abc", - "valid": false - } - ] - }, - { - "description": "validation of e-mail addresses", - "schema": {"format": "email"}, - "tests": [ - { - "description": "a valid e-mail address", - "data": "joe.bloggs@example.com", - "valid": true - }, - { - "description": "an invalid e-mail address", - "data": "2962", - "valid": false - } - ] - }, - { - "description": "validation of IP addresses", - "schema": {"format": "ipv4"}, - "tests": [ - { - "description": "a valid IP address", - "data": "192.168.0.1", - "valid": true - }, - { - "description": "an IP address with too many components", - "data": "127.0.0.0.1", - "valid": false - }, - { - "description": "an IP address with out-of-range values", - "data": "256.256.256.256", - "valid": false - }, - { - "description": "an IP address without 4 components", - "data": "127.0", - "valid": false - }, - { - "description": "an IP address as an integer", - "data": "0x7f000001", - "valid": false - } - ] - }, - { - "description": "validation of IPv6 addresses", - "schema": {"format": "ipv6"}, - "tests": [ - { - "description": "a valid IPv6 address", - "data": "::1", - "valid": true - }, - { - "description": "an IPv6 address with out-of-range values", - "data": "12345::", - "valid": false - }, - { - "description": "an IPv6 address with too many components", - "data": "1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1", - "valid": false - }, - { - "description": "an IPv6 address containing illegal characters", - "data": "::laptop", - "valid": false - } - ] - }, - { - "description": "validation of host names", - "schema": {"format": "hostname"}, - "tests": [ - { - "description": "a valid host name", - "data": "www.example.com", - "valid": true - }, - { - "description": "a host name starting with an illegal character", - "data": "-a-host-name-that-starts-with--", - "valid": false - }, - { - "description": "a host name containing illegal characters", - "data": "not_a_valid_host_name", - "valid": false - }, - { - "description": "a host name with a component too long", - "data": "a-vvvvvvvvvvvvvvvveeeeeeeeeeeeeeeerrrrrrrrrrrrrrrryyyyyyyyyyyyyyyy-long-host-name-component", - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/items.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/items.json deleted file mode 100644 index f5e18a13848f71..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/items.json +++ /dev/null @@ -1,46 +0,0 @@ -[ - { - "description": "a schema given for items", - "schema": { - "items": {"type": "integer"} - }, - "tests": [ - { - "description": "valid items", - "data": [ 1, 2, 3 ], - "valid": true - }, - { - "description": "wrong type of items", - "data": [1, "x"], - "valid": false - }, - { - "description": "ignores non-arrays", - "data": {"foo" : "bar"}, - "valid": true - } - ] - }, - { - "description": "an array of schemas for items", - "schema": { - "items": [ - {"type": "integer"}, - {"type": "string"} - ] - }, - "tests": [ - { - "description": "correct types", - "data": [ 1, "foo" ], - "valid": true - }, - { - "description": "wrong types", - "data": [ "foo", 1 ], - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxItems.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxItems.json deleted file mode 100644 index 3b53a6b371a7b6..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxItems.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "description": "maxItems validation", - "schema": {"maxItems": 2}, - "tests": [ - { - "description": "shorter is valid", - "data": [1], - "valid": true - }, - { - "description": "exact length is valid", - "data": [1, 2], - "valid": true - }, - { - "description": "too long is invalid", - "data": [1, 2, 3], - "valid": false - }, - { - "description": "ignores non-arrays", - "data": "foobar", - "valid": true - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxLength.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxLength.json deleted file mode 100644 index 48eb1296d2e420..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxLength.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "description": "maxLength validation", - "schema": {"maxLength": 2}, - "tests": [ - { - "description": "shorter is valid", - "data": "f", - "valid": true - }, - { - "description": "exact length is valid", - "data": "fo", - "valid": true - }, - { - "description": "too long is invalid", - "data": "foo", - "valid": false - }, - { - "description": "ignores non-strings", - "data": 100, - "valid": true - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxProperties.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxProperties.json deleted file mode 100644 index d282446ad6978d..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maxProperties.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "description": "maxProperties validation", - "schema": {"maxProperties": 2}, - "tests": [ - { - "description": "shorter is valid", - "data": {"foo": 1}, - "valid": true - }, - { - "description": "exact length is valid", - "data": {"foo": 1, "bar": 2}, - "valid": true - }, - { - "description": "too long is invalid", - "data": {"foo": 1, "bar": 2, "baz": 3}, - "valid": false - }, - { - "description": "ignores non-objects", - "data": "foobar", - "valid": true - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maximum.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maximum.json deleted file mode 100644 index 86c7b89c9a9047..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/maximum.json +++ /dev/null @@ -1,42 +0,0 @@ -[ - { - "description": "maximum validation", - "schema": {"maximum": 3.0}, - "tests": [ - { - "description": "below the maximum is valid", - "data": 2.6, - "valid": true - }, - { - "description": "above the maximum is invalid", - "data": 3.5, - "valid": false - }, - { - "description": "ignores non-numbers", - "data": "x", - "valid": true - } - ] - }, - { - "description": "exclusiveMaximum validation", - "schema": { - "maximum": 3.0, - "exclusiveMaximum": true - }, - "tests": [ - { - "description": "below the maximum is still valid", - "data": 2.2, - "valid": true - }, - { - "description": "boundary point is invalid", - "data": 3.0, - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minItems.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minItems.json deleted file mode 100644 index ed5118815ee933..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minItems.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "description": "minItems validation", - "schema": {"minItems": 1}, - "tests": [ - { - "description": "longer is valid", - "data": [1, 2], - "valid": true - }, - { - "description": "exact length is valid", - "data": [1], - "valid": true - }, - { - "description": "too short is invalid", - "data": [], - "valid": false - }, - { - "description": "ignores non-arrays", - "data": "", - "valid": true - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minLength.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minLength.json deleted file mode 100644 index e9c14b1723efd9..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minLength.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "description": "minLength validation", - "schema": {"minLength": 2}, - "tests": [ - { - "description": "longer is valid", - "data": "foo", - "valid": true - }, - { - "description": "exact length is valid", - "data": "fo", - "valid": true - }, - { - "description": "too short is invalid", - "data": "f", - "valid": false - }, - { - "description": "ignores non-strings", - "data": 1, - "valid": true - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minProperties.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minProperties.json deleted file mode 100644 index a72c7d293e6c3e..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minProperties.json +++ /dev/null @@ -1,28 +0,0 @@ -[ - { - "description": "minProperties validation", - "schema": {"minProperties": 1}, - "tests": [ - { - "description": "longer is valid", - "data": {"foo": 1, "bar": 2}, - "valid": true - }, - { - "description": "exact length is valid", - "data": {"foo": 1}, - "valid": true - }, - { - "description": "too short is invalid", - "data": {}, - "valid": false - }, - { - "description": "ignores non-objects", - "data": "", - "valid": true - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minimum.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minimum.json deleted file mode 100644 index d5bf000bcc66f8..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/minimum.json +++ /dev/null @@ -1,42 +0,0 @@ -[ - { - "description": "minimum validation", - "schema": {"minimum": 1.1}, - "tests": [ - { - "description": "above the minimum is valid", - "data": 2.6, - "valid": true - }, - { - "description": "below the minimum is invalid", - "data": 0.6, - "valid": false - }, - { - "description": "ignores non-numbers", - "data": "x", - "valid": true - } - ] - }, - { - "description": "exclusiveMinimum validation", - "schema": { - "minimum": 1.1, - "exclusiveMinimum": true - }, - "tests": [ - { - "description": "above the minimum is still valid", - "data": 1.2, - "valid": true - }, - { - "description": "boundary point is invalid", - "data": 1.1, - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json deleted file mode 100644 index ca3b7618053f49..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json +++ /dev/null @@ -1,60 +0,0 @@ -[ - { - "description": "by int", - "schema": {"multipleOf": 2}, - "tests": [ - { - "description": "int by int", - "data": 10, - "valid": true - }, - { - "description": "int by int fail", - "data": 7, - "valid": false - }, - { - "description": "ignores non-numbers", - "data": "foo", - "valid": true - } - ] - }, - { - "description": "by number", - "schema": {"multipleOf": 1.5}, - "tests": [ - { - "description": "zero is multiple of anything", - "data": 0, - "valid": true - }, - { - "description": "4.5 is multiple of 1.5", - "data": 4.5, - "valid": true - }, - { - "description": "35 is not multiple of 1.5", - "data": 35, - "valid": false - } - ] - }, - { - "description": "by small number", - "schema": {"multipleOf": 0.0001}, - "tests": [ - { - "description": "0.0075 is multiple of 0.0001", - "data": 0.0075, - "valid": true - }, - { - "description": "0.00751 is not multiple of 0.0001", - "data": 0.00751, - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/not.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/not.json deleted file mode 100644 index cbb7f46bf8bc5b..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/not.json +++ /dev/null @@ -1,96 +0,0 @@ -[ - { - "description": "not", - "schema": { - "not": {"type": "integer"} - }, - "tests": [ - { - "description": "allowed", - "data": "foo", - "valid": true - }, - { - "description": "disallowed", - "data": 1, - "valid": false - } - ] - }, - { - "description": "not multiple types", - "schema": { - "not": {"type": ["integer", "boolean"]} - }, - "tests": [ - { - "description": "valid", - "data": "foo", - "valid": true - }, - { - "description": "mismatch", - "data": 1, - "valid": false - }, - { - "description": "other mismatch", - "data": true, - "valid": false - } - ] - }, - { - "description": "not more complex schema", - "schema": { - "not": { - "type": "object", - "properties": { - "foo": { - "type": "string" - } - } - } - }, - "tests": [ - { - "description": "match", - "data": 1, - "valid": true - }, - { - "description": "other match", - "data": {"foo": 1}, - "valid": true - }, - { - "description": "mismatch", - "data": {"foo": "bar"}, - "valid": false - } - ] - }, - { - "description": "forbidden property", - "schema": { - "properties": { - "foo": { - "not": {} - } - } - }, - "tests": [ - { - "description": "property present", - "data": {"foo": 1, "bar": 2}, - "valid": false - }, - { - "description": "property absent", - "data": {"bar": 1, "baz": 2}, - "valid": true - } - ] - } - -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndFormat.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndFormat.json deleted file mode 100644 index d7fce9f50907a0..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndFormat.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "description": "validation of null and format", - "schema": {"type": ["null", "string"], "format": "date-time"}, - "tests": [ - { - "description": "a valid date-time string", - "data": "1963-06-19T08:30:06.283185Z", - "valid": true - }, - { - "description": "allow null", - "data": null, - "valid": true - } - ] - } -] \ No newline at end of file diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/oneOf.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/oneOf.json deleted file mode 100644 index 1eaa4e47949dc3..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/oneOf.json +++ /dev/null @@ -1,68 +0,0 @@ -[ - { - "description": "oneOf", - "schema": { - "oneOf": [ - { - "type": "integer" - }, - { - "minimum": 2 - } - ] - }, - "tests": [ - { - "description": "first oneOf valid", - "data": 1, - "valid": true - }, - { - "description": "second oneOf valid", - "data": 2.5, - "valid": true - }, - { - "description": "both oneOf valid", - "data": 3, - "valid": false - }, - { - "description": "neither oneOf valid", - "data": 1.5, - "valid": false - } - ] - }, - { - "description": "oneOf with base schema", - "schema": { - "type": "string", - "oneOf" : [ - { - "minLength": 2 - }, - { - "maxLength": 4 - } - ] - }, - "tests": [ - { - "description": "mismatch base schema", - "data": 3, - "valid": false - }, - { - "description": "one oneOf valid", - "data": "foobar", - "valid": true - }, - { - "description": "both oneOf valid", - "data": "foo", - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/pattern.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/pattern.json deleted file mode 100644 index befc4b560f7c33..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/pattern.json +++ /dev/null @@ -1,23 +0,0 @@ -[ - { - "description": "pattern validation", - "schema": {"pattern": "^a*$"}, - "tests": [ - { - "description": "a matching pattern is valid", - "data": "aaa", - "valid": true - }, - { - "description": "a non-matching pattern is invalid", - "data": "abc", - "valid": false - }, - { - "description": "ignores non-strings", - "data": true, - "valid": true - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/patternProperties.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/patternProperties.json deleted file mode 100644 index 18586e5daba602..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/patternProperties.json +++ /dev/null @@ -1,110 +0,0 @@ -[ - { - "description": - "patternProperties validates properties matching a regex", - "schema": { - "patternProperties": { - "f.*o": {"type": "integer"} - } - }, - "tests": [ - { - "description": "a single valid match is valid", - "data": {"foo": 1}, - "valid": true - }, - { - "description": "multiple valid matches is valid", - "data": {"foo": 1, "foooooo" : 2}, - "valid": true - }, - { - "description": "a single invalid match is invalid", - "data": {"foo": "bar", "fooooo": 2}, - "valid": false - }, - { - "description": "multiple invalid matches is invalid", - "data": {"foo": "bar", "foooooo" : "baz"}, - "valid": false - }, - { - "description": "ignores non-objects", - "data": 12, - "valid": true - } - ] - }, - { - "description": "multiple simultaneous patternProperties are validated", - "schema": { - "patternProperties": { - "a*": {"type": "integer"}, - "aaa*": {"maximum": 20} - } - }, - "tests": [ - { - "description": "a single valid match is valid", - "data": {"a": 21}, - "valid": true - }, - { - "description": "a simultaneous match is valid", - "data": {"aaaa": 18}, - "valid": true - }, - { - "description": "multiple matches is valid", - "data": {"a": 21, "aaaa": 18}, - "valid": true - }, - { - "description": "an invalid due to one is invalid", - "data": {"a": "bar"}, - "valid": false - }, - { - "description": "an invalid due to the other is invalid", - "data": {"aaaa": 31}, - "valid": false - }, - { - "description": "an invalid due to both is invalid", - "data": {"aaa": "foo", "aaaa": 31}, - "valid": false - } - ] - }, - { - "description": "regexes are not anchored by default and are case sensitive", - "schema": { - "patternProperties": { - "[0-9]{2,}": { "type": "boolean" }, - "X_": { "type": "string" } - } - }, - "tests": [ - { - "description": "non recognized members are ignored", - "data": { "answer 1": "42" }, - "valid": true - }, - { - "description": "recognized members are accounted for", - "data": { "a31b": null }, - "valid": false - }, - { - "description": "regexes are case sensitive", - "data": { "a_x_3": 3 }, - "valid": true - }, - { - "description": "regexes are case sensitive, 2", - "data": { "a_X_3": 3 }, - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/properties.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/properties.json deleted file mode 100644 index cd1644dcd91fe0..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/properties.json +++ /dev/null @@ -1,92 +0,0 @@ -[ - { - "description": "object properties validation", - "schema": { - "properties": { - "foo": {"type": "integer"}, - "bar": {"type": "string"} - } - }, - "tests": [ - { - "description": "both properties present and valid is valid", - "data": {"foo": 1, "bar": "baz"}, - "valid": true - }, - { - "description": "one property invalid is invalid", - "data": {"foo": 1, "bar": {}}, - "valid": false - }, - { - "description": "both properties invalid is invalid", - "data": {"foo": [], "bar": {}}, - "valid": false - }, - { - "description": "doesn't invalidate other properties", - "data": {"quux": []}, - "valid": true - }, - { - "description": "ignores non-objects", - "data": [], - "valid": true - } - ] - }, - { - "description": - "properties, patternProperties, additionalProperties interaction", - "schema": { - "properties": { - "foo": {"type": "array", "maxItems": 3}, - "bar": {"type": "array"} - }, - "patternProperties": {"f.o": {"minItems": 2}}, - "additionalProperties": {"type": "integer"} - }, - "tests": [ - { - "description": "property validates property", - "data": {"foo": [1, 2]}, - "valid": true - }, - { - "description": "property invalidates property", - "data": {"foo": [1, 2, 3, 4]}, - "valid": false - }, - { - "description": "patternProperty invalidates property", - "data": {"foo": []}, - "valid": false - }, - { - "description": "patternProperty validates nonproperty", - "data": {"fxo": [1, 2]}, - "valid": true - }, - { - "description": "patternProperty invalidates nonproperty", - "data": {"fxo": []}, - "valid": false - }, - { - "description": "additionalProperty ignores property", - "data": {"bar": []}, - "valid": true - }, - { - "description": "additionalProperty validates others", - "data": {"quux": 3}, - "valid": true - }, - { - "description": "additionalProperty invalidates others", - "data": {"quux": "foo"}, - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/ref.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/ref.json deleted file mode 100644 index d8214bc2b30c1f..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/ref.json +++ /dev/null @@ -1,128 +0,0 @@ -[ - { - "description": "root pointer ref", - "schema": { - "properties": { - "foo": {"$ref": "#"} - }, - "additionalProperties": false - }, - "tests": [ - { - "description": "match", - "data": {"foo": false}, - "valid": true - }, - { - "description": "recursive match", - "data": {"foo": {"foo": false}}, - "valid": true - }, - { - "description": "mismatch", - "data": {"bar": false}, - "valid": false - }, - { - "description": "recursive mismatch", - "data": {"foo": {"bar": false}}, - "valid": false - } - ] - }, - { - "description": "relative pointer ref to object", - "schema": { - "properties": { - "foo": {"type": "integer"}, - "bar": {"$ref": "#/properties/foo"} - } - }, - "tests": [ - { - "description": "match", - "data": {"bar": 3}, - "valid": true - }, - { - "description": "mismatch", - "data": {"bar": true}, - "valid": false - } - ] - }, - { - "description": "relative pointer ref to array", - "schema": { - "items": [ - {"type": "integer"}, - {"$ref": "#/items/0"} - ] - }, - "tests": [ - { - "description": "match array", - "data": [1, 2], - "valid": true - }, - { - "description": "mismatch array", - "data": [1, "foo"], - "valid": false - } - ] - }, - { - "description": "escaped pointer ref", - "schema": { - "tilda~field": {"type": "integer"}, - "slash/field": {"type": "integer"}, - "percent%field": {"type": "integer"}, - "properties": { - "tilda": {"$ref": "#/tilda~0field"}, - "slash": {"$ref": "#/slash~1field"}, - "percent": {"$ref": "#/percent%25field"} - } - }, - "tests": [ - { - "description": "slash", - "data": {"slash": "aoeu"}, - "valid": false - }, - { - "description": "tilda", - "data": {"tilda": "aoeu"}, - "valid": false - }, - { - "description": "percent", - "data": {"percent": "aoeu"}, - "valid": false - } - ] - }, - { - "description": "nested refs", - "schema": { - "definitions": { - "a": {"type": "integer"}, - "b": {"$ref": "#/definitions/a"}, - "c": {"$ref": "#/definitions/b"} - }, - "$ref": "#/definitions/c" - }, - "tests": [ - { - "description": "nested ref valid", - "data": 5, - "valid": true - }, - { - "description": "nested ref invalid", - "data": "a", - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/refRemote.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/refRemote.json deleted file mode 100644 index 4ca804732c9754..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/refRemote.json +++ /dev/null @@ -1,74 +0,0 @@ -[ - { - "description": "remote ref", - "schema": {"$ref": "http://localhost:1234/integer.json"}, - "tests": [ - { - "description": "remote ref valid", - "data": 1, - "valid": true - }, - { - "description": "remote ref invalid", - "data": "a", - "valid": false - } - ] - }, - { - "description": "fragment within remote ref", - "schema": {"$ref": "http://localhost:1234/subSchemas.json#/integer"}, - "tests": [ - { - "description": "remote fragment valid", - "data": 1, - "valid": true - }, - { - "description": "remote fragment invalid", - "data": "a", - "valid": false - } - ] - }, - { - "description": "ref within remote ref", - "schema": { - "$ref": "http://localhost:1234/subSchemas.json#/refToInteger" - }, - "tests": [ - { - "description": "ref within ref valid", - "data": 1, - "valid": true - }, - { - "description": "ref within ref invalid", - "data": "a", - "valid": false - } - ] - }, - { - "description": "change resolution scope", - "schema": { - "id": "http://localhost:1234/", - "items": { - "id": "folder/", - "items": {"$ref": "folderInteger.json"} - } - }, - "tests": [ - { - "description": "changed scope ref valid", - "data": [[1]], - "valid": true - }, - { - "description": "changed scope ref invalid", - "data": [["a"]], - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/required.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/required.json deleted file mode 100644 index 612f73f3472bc0..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/required.json +++ /dev/null @@ -1,39 +0,0 @@ -[ - { - "description": "required validation", - "schema": { - "properties": { - "foo": {}, - "bar": {} - }, - "required": ["foo"] - }, - "tests": [ - { - "description": "present required property is valid", - "data": {"foo": 1}, - "valid": true - }, - { - "description": "non-present required property is invalid", - "data": {"bar": 1}, - "valid": false - } - ] - }, - { - "description": "required default validation", - "schema": { - "properties": { - "foo": {} - } - }, - "tests": [ - { - "description": "not required by default", - "data": {}, - "valid": true - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/type.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/type.json deleted file mode 100644 index 257f05129279fa..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/type.json +++ /dev/null @@ -1,330 +0,0 @@ -[ - { - "description": "integer type matches integers", - "schema": {"type": "integer"}, - "tests": [ - { - "description": "an integer is an integer", - "data": 1, - "valid": true - }, - { - "description": "a float is not an integer", - "data": 1.1, - "valid": false - }, - { - "description": "a string is not an integer", - "data": "foo", - "valid": false - }, - { - "description": "an object is not an integer", - "data": {}, - "valid": false - }, - { - "description": "an array is not an integer", - "data": [], - "valid": false - }, - { - "description": "a boolean is not an integer", - "data": true, - "valid": false - }, - { - "description": "null is not an integer", - "data": null, - "valid": false - } - ] - }, - { - "description": "number type matches numbers", - "schema": {"type": "number"}, - "tests": [ - { - "description": "an integer is a number", - "data": 1, - "valid": true - }, - { - "description": "a float is a number", - "data": 1.1, - "valid": true - }, - { - "description": "a string is not a number", - "data": "foo", - "valid": false - }, - { - "description": "an object is not a number", - "data": {}, - "valid": false - }, - { - "description": "an array is not a number", - "data": [], - "valid": false - }, - { - "description": "a boolean is not a number", - "data": true, - "valid": false - }, - { - "description": "null is not a number", - "data": null, - "valid": false - } - ] - }, - { - "description": "string type matches strings", - "schema": {"type": "string"}, - "tests": [ - { - "description": "1 is not a string", - "data": 1, - "valid": false - }, - { - "description": "a float is not a string", - "data": 1.1, - "valid": false - }, - { - "description": "a string is a string", - "data": "foo", - "valid": true - }, - { - "description": "an object is not a string", - "data": {}, - "valid": false - }, - { - "description": "an array is not a string", - "data": [], - "valid": false - }, - { - "description": "a boolean is not a string", - "data": true, - "valid": false - }, - { - "description": "null is not a string", - "data": null, - "valid": false - } - ] - }, - { - "description": "object type matches objects", - "schema": {"type": "object"}, - "tests": [ - { - "description": "an integer is not an object", - "data": 1, - "valid": false - }, - { - "description": "a float is not an object", - "data": 1.1, - "valid": false - }, - { - "description": "a string is not an object", - "data": "foo", - "valid": false - }, - { - "description": "an object is an object", - "data": {}, - "valid": true - }, - { - "description": "an array is not an object", - "data": [], - "valid": false - }, - { - "description": "a boolean is not an object", - "data": true, - "valid": false - }, - { - "description": "null is not an object", - "data": null, - "valid": false - } - ] - }, - { - "description": "array type matches arrays", - "schema": {"type": "array"}, - "tests": [ - { - "description": "an integer is not an array", - "data": 1, - "valid": false - }, - { - "description": "a float is not an array", - "data": 1.1, - "valid": false - }, - { - "description": "a string is not an array", - "data": "foo", - "valid": false - }, - { - "description": "an object is not an array", - "data": {}, - "valid": false - }, - { - "description": "an array is not an array", - "data": [], - "valid": true - }, - { - "description": "a boolean is not an array", - "data": true, - "valid": false - }, - { - "description": "null is not an array", - "data": null, - "valid": false - } - ] - }, - { - "description": "boolean type matches booleans", - "schema": {"type": "boolean"}, - "tests": [ - { - "description": "an integer is not a boolean", - "data": 1, - "valid": false - }, - { - "description": "a float is not a boolean", - "data": 1.1, - "valid": false - }, - { - "description": "a string is not a boolean", - "data": "foo", - "valid": false - }, - { - "description": "an object is not a boolean", - "data": {}, - "valid": false - }, - { - "description": "an array is not a boolean", - "data": [], - "valid": false - }, - { - "description": "a boolean is not a boolean", - "data": true, - "valid": true - }, - { - "description": "null is not a boolean", - "data": null, - "valid": false - } - ] - }, - { - "description": "null type matches only the null object", - "schema": {"type": "null"}, - "tests": [ - { - "description": "an integer is not null", - "data": 1, - "valid": false - }, - { - "description": "a float is not null", - "data": 1.1, - "valid": false - }, - { - "description": "a string is not null", - "data": "foo", - "valid": false - }, - { - "description": "an object is not null", - "data": {}, - "valid": false - }, - { - "description": "an array is not null", - "data": [], - "valid": false - }, - { - "description": "a boolean is not null", - "data": true, - "valid": false - }, - { - "description": "null is null", - "data": null, - "valid": true - } - ] - }, - { - "description": "multiple types can be specified in an array", - "schema": {"type": ["integer", "string"]}, - "tests": [ - { - "description": "an integer is valid", - "data": 1, - "valid": true - }, - { - "description": "a string is valid", - "data": "foo", - "valid": true - }, - { - "description": "a float is invalid", - "data": 1.1, - "valid": false - }, - { - "description": "an object is invalid", - "data": {}, - "valid": false - }, - { - "description": "an array is invalid", - "data": [], - "valid": false - }, - { - "description": "a boolean is invalid", - "data": true, - "valid": false - }, - { - "description": "null is invalid", - "data": null, - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/uniqueItems.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/uniqueItems.json deleted file mode 100644 index c1f4ab99c9a485..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/uniqueItems.json +++ /dev/null @@ -1,79 +0,0 @@ -[ - { - "description": "uniqueItems validation", - "schema": {"uniqueItems": true}, - "tests": [ - { - "description": "unique array of integers is valid", - "data": [1, 2], - "valid": true - }, - { - "description": "non-unique array of integers is invalid", - "data": [1, 1], - "valid": false - }, - { - "description": "numbers are unique if mathematically unequal", - "data": [1.0, 1.00, 1], - "valid": false - }, - { - "description": "unique array of objects is valid", - "data": [{"foo": "bar"}, {"foo": "baz"}], - "valid": true - }, - { - "description": "non-unique array of objects is invalid", - "data": [{"foo": "bar"}, {"foo": "bar"}], - "valid": false - }, - { - "description": "unique array of nested objects is valid", - "data": [ - {"foo": {"bar" : {"baz" : true}}}, - {"foo": {"bar" : {"baz" : false}}} - ], - "valid": true - }, - { - "description": "non-unique array of nested objects is invalid", - "data": [ - {"foo": {"bar" : {"baz" : true}}}, - {"foo": {"bar" : {"baz" : true}}} - ], - "valid": false - }, - { - "description": "unique array of arrays is valid", - "data": [["foo"], ["bar"]], - "valid": true - }, - { - "description": "non-unique array of arrays is invalid", - "data": [["foo"], ["foo"]], - "valid": false - }, - { - "description": "1 and true are unique", - "data": [1, true], - "valid": true - }, - { - "description": "0 and false are unique", - "data": [0, false], - "valid": true - }, - { - "description": "unique heterogeneous types are valid", - "data": [{}, [1], true, null, 1], - "valid": true - }, - { - "description": "non-unique heterogeneous types are invalid", - "data": [{}, [1], true, null, {}, 1], - "valid": false - } - ] - } -] diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema.js b/tools/eslint/node_modules/is-my-json-valid/test/json-schema.js deleted file mode 100644 index e68a263a279218..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/json-schema.js +++ /dev/null @@ -1,23 +0,0 @@ -var tape = require('tape') -var fs = require('fs') -var validator = require('../') - -var files = fs.readdirSync(__dirname+'/json-schema-draft4') - .map(function(file) { - if (file === 'definitions.json') return null - if (file === 'refRemote.json') return null - return require('./json-schema-draft4/'+file) - }) - .filter(Boolean) - -files.forEach(function(file) { - file.forEach(function(f) { - tape('json-schema-test-suite '+f.description, function(t) { - var validate = validator(f.schema) - f.tests.forEach(function(test) { - t.same(validate(test.data), test.valid, test.description) - }) - t.end() - }) - }) -}) diff --git a/tools/eslint/node_modules/is-my-json-valid/test/misc.js b/tools/eslint/node_modules/is-my-json-valid/test/misc.js deleted file mode 100644 index b5109e576f26b9..00000000000000 --- a/tools/eslint/node_modules/is-my-json-valid/test/misc.js +++ /dev/null @@ -1,429 +0,0 @@ -var tape = require('tape') -var cosmic = require('./fixtures/cosmic') -var validator = require('../') -var validatorRequire = require('../require') - -tape('simple', function(t) { - var schema = { - required: true, - type: 'object', - properties: { - hello: {type:'string', required:true} - } - } - - var validate = validator(schema) - - t.ok(validate({hello: 'world'}), 'should be valid') - t.notOk(validate(), 'should be invalid') - t.notOk(validate({}), 'should be invalid') - t.end() -}) - -tape('advanced', function(t) { - var validate = validator(cosmic.schema) - - t.ok(validate(cosmic.valid), 'should be valid') - t.notOk(validate(cosmic.invalid), 'should be invalid') - t.end() -}) - -tape('greedy/false', function(t) { - var validate = validator({ - type: 'object', - properties: { - x: { - type: 'number' - } - }, - required: ['x', 'y'] - }); - t.notOk(validate({}), 'should be invalid') - t.strictEqual(validate.errors.length, 2); - t.strictEqual(validate.errors[0].field, 'data.x') - t.strictEqual(validate.errors[0].message, 'is required') - t.strictEqual(validate.errors[1].field, 'data.y') - t.strictEqual(validate.errors[1].message, 'is required') - t.notOk(validate({x: 'string'}), 'should be invalid') - t.strictEqual(validate.errors.length, 1); - t.strictEqual(validate.errors[0].field, 'data.y') - t.strictEqual(validate.errors[0].message, 'is required') - t.notOk(validate({x: 'string', y: 'value'}), 'should be invalid') - t.strictEqual(validate.errors.length, 1); - t.strictEqual(validate.errors[0].field, 'data.x') - t.strictEqual(validate.errors[0].message, 'is the wrong type') - t.end(); -}); - -tape('greedy/true', function(t) { - var validate = validator({ - type: 'object', - properties: { - x: { - type: 'number' - } - }, - required: ['x', 'y'] - }, { - greedy: true - }); - t.notOk(validate({}), 'should be invalid') - t.strictEqual(validate.errors.length, 2); - t.strictEqual(validate.errors[0].field, 'data.x') - t.strictEqual(validate.errors[0].message, 'is required') - t.strictEqual(validate.errors[1].field, 'data.y') - t.strictEqual(validate.errors[1].message, 'is required') - t.notOk(validate({x: 'string'}), 'should be invalid') - t.strictEqual(validate.errors.length, 2); - t.strictEqual(validate.errors[0].field, 'data.y') - t.strictEqual(validate.errors[0].message, 'is required') - t.strictEqual(validate.errors[1].field, 'data.x') - t.strictEqual(validate.errors[1].message, 'is the wrong type') - t.notOk(validate({x: 'string', y: 'value'}), 'should be invalid') - t.strictEqual(validate.errors.length, 1); - t.strictEqual(validate.errors[0].field, 'data.x') - t.strictEqual(validate.errors[0].message, 'is the wrong type') - t.ok(validate({x: 1, y: 'value'}), 'should be invalid') - t.end(); -}); - -tape('additional props', function(t) { - var validate = validator({ - type: 'object', - additionalProperties: false - }, { - verbose: true - }) - - t.ok(validate({})) - t.notOk(validate({foo:'bar'})) - t.ok(validate.errors[0].value === 'data.foo', 'should output the property not allowed in verbose mode') - t.end() -}) - -tape('array', function(t) { - var validate = validator({ - type: 'array', - required: true, - items: { - type: 'string' - } - }) - - t.notOk(validate({}), 'wrong type') - t.notOk(validate(), 'is required') - t.ok(validate(['test'])) - t.end() -}) - -tape('nested array', function(t) { - var validate = validator({ - type: 'object', - properties: { - list: { - type: 'array', - required: true, - items: { - type: 'string' - } - } - } - }) - - t.notOk(validate({}), 'is required') - t.ok(validate({list:['test']})) - t.notOk(validate({list:[1]})) - t.end() -}) - -tape('enum', function(t) { - var validate = validator({ - type: 'object', - properties: { - foo: { - type: 'number', - required: true, - enum: [42] - } - } - }) - - t.notOk(validate({}), 'is required') - t.ok(validate({foo:42})) - t.notOk(validate({foo:43})) - t.end() -}) - -tape('minimum/maximum', function(t) { - var validate = validator({ - type: 'object', - properties: { - foo: { - type: 'number', - minimum: 0, - maximum: 0 - } - } - }) - - t.notOk(validate({foo:-42})) - t.ok(validate({foo:0})) - t.notOk(validate({foo:42})) - t.end() -}) - -tape('exclusiveMinimum/exclusiveMaximum', function(t) { - var validate = validator({ - type: 'object', - properties: { - foo: { - type: 'number', - minimum: 10, - maximum: 20, - exclusiveMinimum: true, - exclusiveMaximum: true - } - } - }) - - t.notOk(validate({foo:10})) - t.ok(validate({foo:11})) - t.notOk(validate({foo:20})) - t.ok(validate({foo:19})) - t.end() -}) - -tape('custom format', function(t) { - var validate = validator({ - type: 'object', - properties: { - foo: { - type: 'string', - format: 'as' - } - } - }, {formats: {as:/^a+$/}}) - - t.notOk(validate({foo:''}), 'not as') - t.notOk(validate({foo:'b'}), 'not as') - t.notOk(validate({foo:'aaab'}), 'not as') - t.ok(validate({foo:'a'}), 'as') - t.ok(validate({foo:'aaaaaa'}), 'as') - t.end() -}) - -tape('custom format function', function(t) { - var validate = validator({ - type: 'object', - properties: { - foo: { - type: 'string', - format: 'as' - } - } - }, {formats: {as:function(s) { return /^a+$/.test(s) } }}) - - t.notOk(validate({foo:''}), 'not as') - t.notOk(validate({foo:'b'}), 'not as') - t.notOk(validate({foo:'aaab'}), 'not as') - t.ok(validate({foo:'a'}), 'as') - t.ok(validate({foo:'aaaaaa'}), 'as') - t.end() -}) - -tape('do not mutate schema', function(t) { - var sch = { - items: [ - {} - ], - additionalItems: { - type: 'integer' - } - } - - var copy = JSON.parse(JSON.stringify(sch)) - - validator(sch) - - t.same(sch, copy, 'did not mutate') - t.end() -}) - -tape('#toJSON()', function(t) { - var schema = { - required: true, - type: 'object', - properties: { - hello: {type:'string', required:true} - } - } - - var validate = validator(schema) - - t.deepEqual(validate.toJSON(), schema, 'should return original schema') - t.end() -}) - -tape('external schemas', function(t) { - var ext = {type: 'string'} - var schema = { - required: true, - $ref: '#ext' - } - - var validate = validator(schema, {schemas: {ext:ext}}) - - t.ok(validate('hello string'), 'is a string') - t.notOk(validate(42), 'not a string') - t.end() -}) - -tape('top-level external schema', function(t) { - var defs = { - "string": { - type: "string" - }, - "sex": { - type: "string", - enum: ["male", "female", "other"] - } - } - var schema = { - type: "object", - properties: { - "name": { $ref: "definitions.json#/string" }, - "sex": { $ref: "definitions.json#/sex" } - }, - required: ["name", "sex"] - } - - var validate = validator(schema, { - schemas: { - "definitions.json": defs - } - }) - t.ok(validate({name:"alice", sex:"female"}), 'is an object') - t.notOk(validate({name:"alice", sex: "bob"}), 'recognizes external schema') - t.notOk(validate({name:2, sex: "female"}), 'recognizes external schema') - t.end() -}) - -tape('nested required array decl', function(t) { - var schema = { - properties: { - x: { - type: 'object', - properties: { - y: { - type: 'object', - properties: { - z: { - type: 'string' - } - }, - required: ['z'] - } - } - } - }, - required: ['x'] - } - - var validate = validator(schema) - - t.ok(validate({x: {}}), 'should be valid') - t.notOk(validate({}), 'should not be valid') - t.strictEqual(validate.errors[0].field, 'data.x', 'should output the missing field') - t.end() -}) - -tape('verbose mode', function(t) { - var schema = { - required: true, - type: 'object', - properties: { - hello: { - required: true, - type: 'string' - } - } - }; - - var validate = validator(schema, {verbose: true}) - - t.ok(validate({hello: 'string'}), 'should be valid') - t.notOk(validate({hello: 100}), 'should not be valid') - t.strictEqual(validate.errors[0].value, 100, 'error object should contain the invalid value') - t.end() -}) - -tape('additional props in verbose mode', function(t) { - var schema = { - type: 'object', - required: true, - additionalProperties: false, - properties: { - foo: { - type: 'string' - }, - 'hello world': { - type: 'object', - required: true, - additionalProperties: false, - properties: { - foo: { - type: 'string' - } - } - } - } - }; - - var validate = validator(schema, {verbose: true}) - - validate({'hello world': {bar: 'string'}}); - - t.strictEqual(validate.errors[0].value, 'data["hello world"].bar', 'should output the path to the additional prop in the error') - t.end() -}) - -tape('Date.now() is an integer', function(t) { - var schema = {type: 'integer'} - var validate = validator(schema) - - t.ok(validate(Date.now()), 'is integer') - t.end() -}) - -tape('field shows item index in arrays', function(t) { - var schema = { - type: 'array', - items: { - type: 'array', - items: { - properties: { - foo: { - type: 'string', - required: true - } - } - } - } - } - - var validate = validator(schema) - - validate([ - [ - { foo: 'test' }, - { foo: 'test' } - ], - [ - { foo: 'test' }, - { baz: 'test' } - ] - ]) - - t.strictEqual(validate.errors[0].field, 'data.1.1.foo', 'should output the field with specific index of failing item in the error') - t.end() -}) diff --git a/tools/eslint/node_modules/is-path-cwd/index.js b/tools/eslint/node_modules/is-path-cwd/index.js new file mode 100644 index 00000000000000..24b6fdea37ee36 --- /dev/null +++ b/tools/eslint/node_modules/is-path-cwd/index.js @@ -0,0 +1,6 @@ +'use strict'; +var path = require('path'); + +module.exports = function (str) { + return path.resolve(str) === path.resolve(process.cwd()); +}; diff --git a/tools/eslint/node_modules/is-path-cwd/package.json b/tools/eslint/node_modules/is-path-cwd/package.json new file mode 100644 index 00000000000000..53311c57f7941f --- /dev/null +++ b/tools/eslint/node_modules/is-path-cwd/package.json @@ -0,0 +1,88 @@ +{ + "_args": [ + [ + "is-path-cwd@^1.0.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/del" + ] + ], + "_from": "is-path-cwd@>=1.0.0 <2.0.0", + "_id": "is-path-cwd@1.0.0", + "_inCache": true, + "_installable": true, + "_location": "/is-path-cwd", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_npmVersion": "1.4.21", + "_phantomChildren": {}, + "_requested": { + "name": "is-path-cwd", + "raw": "is-path-cwd@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/del" + ], + "_resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "_shasum": "d225ec23132e89edd38fda767472e62e65f1106d", + "_shrinkwrap": null, + "_spec": "is-path-cwd@^1.0.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/del", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "http://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/is-path-cwd/issues" + }, + "dependencies": {}, + "description": "Check if a path is CWD", + "devDependencies": { + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "d225ec23132e89edd38fda767472e62e65f1106d", + "tarball": "http://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "f71d4ecaa43bfe23c9cb35af6bf31e6b5b3f04eb", + "homepage": "https://github.com/sindresorhus/is-path-cwd", + "keywords": [ + "check", + "cwd", + "file", + "filepath", + "folder", + "path", + "pwd" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "is-path-cwd", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-path-cwd.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "1.0.0" +} diff --git a/tools/eslint/node_modules/is-path-cwd/readme.md b/tools/eslint/node_modules/is-path-cwd/readme.md new file mode 100644 index 00000000000000..2d9d65f989c106 --- /dev/null +++ b/tools/eslint/node_modules/is-path-cwd/readme.md @@ -0,0 +1,28 @@ +# is-path-cwd [![Build Status](https://travis-ci.org/sindresorhus/is-path-cwd.svg?branch=master)](https://travis-ci.org/sindresorhus/is-path-cwd) + +> Check if a path is [CWD](http://en.wikipedia.org/wiki/Working_directory) + + +## Install + +```sh +$ npm install --save is-path-cwd +``` + + +## Usage + +```js +var isPathCwd = require('is-path-cwd'); + +isPathCwd(process.cwd()); +//=> true + +isPathCwd('unicorn'); +//=> false +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/eslint/node_modules/is-path-in-cwd/index.js b/tools/eslint/node_modules/is-path-in-cwd/index.js new file mode 100644 index 00000000000000..75611656ae7e3d --- /dev/null +++ b/tools/eslint/node_modules/is-path-in-cwd/index.js @@ -0,0 +1,6 @@ +'use strict'; +var isPathInside = require('is-path-inside'); + +module.exports = function (str) { + return isPathInside(str, process.cwd()); +}; diff --git a/tools/eslint/node_modules/is-path-in-cwd/package.json b/tools/eslint/node_modules/is-path-in-cwd/package.json new file mode 100644 index 00000000000000..bae1a3afb4450c --- /dev/null +++ b/tools/eslint/node_modules/is-path-in-cwd/package.json @@ -0,0 +1,92 @@ +{ + "_args": [ + [ + "is-path-in-cwd@^1.0.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/del" + ] + ], + "_from": "is-path-in-cwd@>=1.0.0 <2.0.0", + "_id": "is-path-in-cwd@1.0.0", + "_inCache": true, + "_installable": true, + "_location": "/is-path-in-cwd", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_npmVersion": "1.4.21", + "_phantomChildren": {}, + "_requested": { + "name": "is-path-in-cwd", + "raw": "is-path-in-cwd@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/del" + ], + "_resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", + "_shasum": "6477582b8214d602346094567003be8a9eac04dc", + "_shrinkwrap": null, + "_spec": "is-path-in-cwd@^1.0.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/del", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "http://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/is-path-in-cwd/issues" + }, + "dependencies": { + "is-path-inside": "^1.0.0" + }, + "description": "Check if a path is in the current working directory", + "devDependencies": { + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "6477582b8214d602346094567003be8a9eac04dc", + "tarball": "http://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "a5a2a7c967eae3f6faee9ab5e40abca6127d55de", + "homepage": "https://github.com/sindresorhus/is-path-in-cwd", + "keywords": [ + "check", + "cwd", + "file", + "filepath", + "folder", + "in", + "inside", + "path", + "pwd" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "is-path-in-cwd", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-path-in-cwd.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "1.0.0" +} diff --git a/tools/eslint/node_modules/is-path-in-cwd/readme.md b/tools/eslint/node_modules/is-path-in-cwd/readme.md new file mode 100644 index 00000000000000..4e4f3a8838d490 --- /dev/null +++ b/tools/eslint/node_modules/is-path-in-cwd/readme.md @@ -0,0 +1,28 @@ +# is-path-in-cwd [![Build Status](https://travis-ci.org/sindresorhus/is-path-in-cwd.svg?branch=master)](https://travis-ci.org/sindresorhus/is-path-in-cwd) + +> Check if a path is in the [current working directory](http://en.wikipedia.org/wiki/Working_directory) + + +## Install + +```sh +$ npm install --save is-path-in-cwd +``` + + +## Usage + +```js +var isPathInCwd = require('is-path-in-cwd'); + +isPathInCwd('unicorn'); +//=> true + +isPathInCwd('../rainbow'); +//=> false +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/eslint/node_modules/is-path-inside/index.js b/tools/eslint/node_modules/is-path-inside/index.js new file mode 100644 index 00000000000000..0a4d2fd1e58074 --- /dev/null +++ b/tools/eslint/node_modules/is-path-inside/index.js @@ -0,0 +1,14 @@ +'use strict'; +var path = require('path'); +var pathIsInside = require('path-is-inside'); + +module.exports = function (a, b) { + a = path.resolve(a); + b = path.resolve(b); + + if (a === b) { + return false; + } + + return pathIsInside(a, b); +}; diff --git a/tools/eslint/node_modules/is-path-inside/package.json b/tools/eslint/node_modules/is-path-inside/package.json new file mode 100644 index 00000000000000..03e9e6f8db05c8 --- /dev/null +++ b/tools/eslint/node_modules/is-path-inside/package.json @@ -0,0 +1,90 @@ +{ + "_args": [ + [ + "is-path-inside@^1.0.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/is-path-in-cwd" + ] + ], + "_from": "is-path-inside@>=1.0.0 <2.0.0", + "_id": "is-path-inside@1.0.0", + "_inCache": true, + "_installable": true, + "_location": "/is-path-inside", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_npmVersion": "1.4.21", + "_phantomChildren": {}, + "_requested": { + "name": "is-path-inside", + "raw": "is-path-inside@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/is-path-in-cwd" + ], + "_resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz", + "_shasum": "fc06e5a1683fbda13de667aff717bbc10a48f37f", + "_shrinkwrap": null, + "_spec": "is-path-inside@^1.0.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/is-path-in-cwd", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "http://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/is-path-inside/issues" + }, + "dependencies": { + "path-is-inside": "^1.0.1" + }, + "description": "Check if a path is inside another path", + "devDependencies": { + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "fc06e5a1683fbda13de667aff717bbc10a48f37f", + "tarball": "http://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "b507035b66a539b7c12ba8b6b486377aa02aef9f", + "homepage": "https://github.com/sindresorhus/is-path-inside", + "keywords": [ + "dir", + "directory", + "file", + "folder", + "inside", + "path", + "resolve" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "is-path-inside", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-path-inside.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "1.0.0" +} diff --git a/tools/eslint/node_modules/is-path-inside/readme.md b/tools/eslint/node_modules/is-path-inside/readme.md new file mode 100644 index 00000000000000..0e4eb74f754bc3 --- /dev/null +++ b/tools/eslint/node_modules/is-path-inside/readme.md @@ -0,0 +1,31 @@ +# is-path-inside [![Build Status](https://travis-ci.org/sindresorhus/is-path-inside.svg?branch=master)](https://travis-ci.org/sindresorhus/is-path-inside) + +> Check if a path is inside another path + + +## Install + +```sh +$ npm install --save is-path-inside +``` + + +## Usage + +```js +var isPathInside = require('is-path-inside'); + +isPathInside('a/b', 'a/b/c'); +//=> true + +isPathInside('x/y', 'a/b/c'); +//=> false + +isPathInside('a/b/c', 'a/b/c'); +//=> false +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/LICENSE b/tools/eslint/node_modules/is-property/LICENSE similarity index 100% rename from tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/LICENSE rename to tools/eslint/node_modules/is-property/LICENSE diff --git a/tools/eslint/node_modules/is-property/README.md b/tools/eslint/node_modules/is-property/README.md new file mode 100644 index 00000000000000..9846a8bb9fc51b --- /dev/null +++ b/tools/eslint/node_modules/is-property/README.md @@ -0,0 +1,28 @@ +is-property +=========== +Tests if a property of a JavaScript object can be accessed using the dot (.) notation or if it must be enclosed in brackets, (ie use x[" ... "]) + +Example +------- + +```javascript +var isProperty = require("is-property") + +console.log(isProperty("foo")) //Prints true +console.log(isProperty("0")) //Prints false +``` + +Install +------- + + npm install is-property + +### `require("is-property")(str)` +Checks if str is a property + +* `str` is a string which we will test if it is a property or not + +**Returns** true or false depending if str is a property + +## Credits +(c) 2013 Mikola Lysenko. MIT License \ No newline at end of file diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/is-property.js b/tools/eslint/node_modules/is-property/is-property.js similarity index 100% rename from tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/is-property.js rename to tools/eslint/node_modules/is-property/is-property.js diff --git a/tools/eslint/node_modules/is-property/package.json b/tools/eslint/node_modules/is-property/package.json new file mode 100644 index 00000000000000..e1e26c85335343 --- /dev/null +++ b/tools/eslint/node_modules/is-property/package.json @@ -0,0 +1,84 @@ +{ + "_args": [ + [ + "is-property@^1.0.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/generate-object-property" + ] + ], + "_from": "is-property@>=1.0.0 <2.0.0", + "_id": "is-property@1.0.2", + "_inCache": true, + "_installable": true, + "_location": "/is-property", + "_nodeVersion": "0.10.26", + "_npmUser": { + "email": "mikolalysenko@gmail.com", + "name": "mikolalysenko" + }, + "_npmVersion": "2.1.4", + "_phantomChildren": {}, + "_requested": { + "name": "is-property", + "raw": "is-property@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/generate-object-property" + ], + "_resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "_shasum": "57fe1c4e48474edd65b09911f26b1cd4095dda84", + "_shrinkwrap": null, + "_spec": "is-property@^1.0.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/generate-object-property", + "author": { + "name": "Mikola Lysenko" + }, + "bugs": { + "url": "https://github.com/mikolalysenko/is-property/issues" + }, + "dependencies": {}, + "description": "Tests if a JSON property can be accessed using . syntax", + "devDependencies": { + "tape": "~1.0.4" + }, + "directories": { + "test": "test" + }, + "dist": { + "shasum": "57fe1c4e48474edd65b09911f26b1cd4095dda84", + "tarball": "http://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz" + }, + "gitHead": "0a85ea5b6b1264ea1cdecc6e5cf186adbb3ffc50", + "homepage": "https://github.com/mikolalysenko/is-property", + "keywords": [ + ".", + "[]", + "bracket", + "dot", + "is", + "json", + "property" + ], + "license": "MIT", + "main": "is-property.js", + "maintainers": [ + { + "name": "mikolalysenko", + "email": "mikolalysenko@gmail.com" + } + ], + "name": "is-property", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/mikolalysenko/is-property.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "1.0.2" +} diff --git a/tools/eslint/node_modules/is-resolvable/LICENSE b/tools/eslint/node_modules/is-resolvable/LICENSE new file mode 100644 index 00000000000000..d9ef73fd74815b --- /dev/null +++ b/tools/eslint/node_modules/is-resolvable/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2014 - 2015 Shinnosuke Watanabe + +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/eslint/node_modules/is-resolvable/README.md b/tools/eslint/node_modules/is-resolvable/README.md new file mode 100755 index 00000000000000..941c65e5cf7b5e --- /dev/null +++ b/tools/eslint/node_modules/is-resolvable/README.md @@ -0,0 +1,68 @@ +# is-resolvable + +[![NPM version](https://img.shields.io/npm/v/is-resolvable.svg)](https://www.npmjs.com/package/is-resolvable) +[![Build Status](https://travis-ci.org/shinnn/is-resolvable.svg?branch=master)](https://travis-ci.org/shinnn/is-resolvable) +[![Build status](https://ci.appveyor.com/api/projects/status/ww1cdpignehlasbs?svg=true)](https://ci.appveyor.com/project/ShinnosukeWatanabe/is-resolvable) +[![Coverage Status](https://img.shields.io/coveralls/shinnn/is-resolvable.svg)](https://coveralls.io/r/shinnn/is-resolvable) +[![Dependency Status](https://img.shields.io/david/shinnn/is-resolvable.svg?label=deps)](https://david-dm.org/shinnn/is-resolvable) +[![devDependency Status](https://img.shields.io/david/dev/shinnn/is-resolvable.svg?label=devDeps)](https://david-dm.org/shinnn/is-resolvable#info=devDependencies) + +A [Node](https://nodejs.org/) module to check if a module ID is resolvable with [`require()`](https://nodejs.org/api/globals.html#globals_require) + +```javascript +const isResolvable = require('is-resolvable'); + +isResolvable('fs'); //=> true +isResolvable('path'); //=> true + +// When `./index.js` exists +isResolvable('./index.js') //=> true +isResolvable('./index') //=> true +isResolvable('.') //=> true +``` + +## Installation + +[Use npm.](https://docs.npmjs.com/cli/install) + +``` +npm install is-resolvable +``` + +## API + +```javascript +const isResolvable = require('is-resolvable'); +``` + +### isResolvable(*moduleId*) + +*moduleId*: `String` (module ID) +Return: `Boolean` + +It returns `true` if `require()` can load a file form a given module ID, otherwise `false`. + +```javascript +const isResolvable = require('is-resolvable'); + +// When `./foo.json` exists +isResolvable('./foo.json'); //=> true +isResolvable('./foo'); //=> true + +isResolvable('./foo.js'); //=> false + + +// When `lodash` module is installed but `underscore` isn't +isResolvable('lodash'); //=> true +isResolvable('underscore'); //=> false + +// When `readable-stream` module is installed +isResolvable('readable-stream/readable'); //=> true +isResolvable('readable-stream/writable'); //=> true +``` + +## License + +Copyright (c) 2014 - 2015 [Shinnosuke Watanabe](https://github.com/shinnn) + +Licensed under [the MIT License](./LICENSE). diff --git a/tools/eslint/node_modules/is-resolvable/index.js b/tools/eslint/node_modules/is-resolvable/index.js new file mode 100755 index 00000000000000..807817b9373fd4 --- /dev/null +++ b/tools/eslint/node_modules/is-resolvable/index.js @@ -0,0 +1,26 @@ +'use strict'; + +var tryit = require('tryit'); + +module.exports = function isResolvable(moduleId) { + if (typeof moduleId !== 'string') { + throw new TypeError( + moduleId + + ' is not a string. A module identifier to be checked if resolvable is required.' + ); + } + + var result; + tryit(function() { + require.resolve(moduleId); + }, function(err) { + if (err) { + result = false; + return; + } + + result = true; + }); + + return result; +}; diff --git a/tools/eslint/node_modules/is-resolvable/package.json b/tools/eslint/node_modules/is-resolvable/package.json new file mode 100644 index 00000000000000..3bbdd3ad3d1c8a --- /dev/null +++ b/tools/eslint/node_modules/is-resolvable/package.json @@ -0,0 +1,96 @@ +{ + "_args": [ + [ + "is-resolvable@^1.0.0", + "/Users/silverwind/git/node/tools/package/package" + ] + ], + "_from": "is-resolvable@>=1.0.0 <2.0.0", + "_id": "is-resolvable@1.0.0", + "_inCache": true, + "_installable": true, + "_location": "/is-resolvable", + "_nodeVersion": "2.4.0", + "_npmUser": { + "email": "snnskwtnb@gmail.com", + "name": "shinnn" + }, + "_npmVersion": "2.13.1", + "_phantomChildren": {}, + "_requested": { + "name": "is-resolvable", + "raw": "is-resolvable@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.0.tgz", + "_shasum": "8df57c61ea2e3c501408d100fb013cf8d6e0cc62", + "_shrinkwrap": null, + "_spec": "is-resolvable@^1.0.0", + "_where": "/Users/silverwind/git/node/tools/package/package", + "author": { + "name": "Shinnosuke Watanabe", + "url": "https://github.com/shinnn" + }, + "bugs": { + "url": "https://github.com/shinnn/is-resolvable/issues" + }, + "dependencies": { + "tryit": "^1.0.1" + }, + "description": "Check if a module ID is resolvable with require()", + "devDependencies": { + "@shinnn/eslintrc-node": "^1.0.2", + "eslint": "^0.24.0", + "istanbul": "^0.3.17", + "tape": "^4.0.0" + }, + "directories": {}, + "dist": { + "shasum": "8df57c61ea2e3c501408d100fb013cf8d6e0cc62", + "tarball": "http://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.0.tgz" + }, + "files": [ + "index.js" + ], + "gitHead": "e68ea1b3affa382cbd31b4bae1e1421040249a73", + "homepage": "https://github.com/shinnn/is-resolvable#readme", + "keywords": [ + "cmap", + "code-point", + "data", + "file", + "font", + "glyph", + "metadata", + "parse", + "read", + "table", + "unicode" + ], + "license": "MIT", + "maintainers": [ + { + "name": "shinnn", + "email": "snnskwtnb@gmail.com" + } + ], + "name": "is-resolvable", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/shinnn/is-resolvable.git" + }, + "scripts": { + "coverage": "istanbul cover test.js", + "pretest": "eslint --config node_modules/@shinnn/eslintrc-node/rc.json index.js test.js", + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/tools/eslint/node_modules/isarray/Makefile b/tools/eslint/node_modules/isarray/Makefile new file mode 100644 index 00000000000000..0ecc29c402c243 --- /dev/null +++ b/tools/eslint/node_modules/isarray/Makefile @@ -0,0 +1,5 @@ + +test: + @node_modules/.bin/tape test.js + +.PHONY: test diff --git a/tools/eslint/node_modules/isarray/README.md b/tools/eslint/node_modules/isarray/README.md new file mode 100644 index 00000000000000..16d2c59c6195f9 --- /dev/null +++ b/tools/eslint/node_modules/isarray/README.md @@ -0,0 +1,60 @@ + +# isarray + +`Array#isArray` for older browsers. + +[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray) +[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray) + +[![browser support](https://ci.testling.com/juliangruber/isarray.png) +](https://ci.testling.com/juliangruber/isarray) + +## Usage + +```js +var isArray = require('isarray'); + +console.log(isArray([])); // => true +console.log(isArray({})); // => false +``` + +## Installation + +With [npm](http://npmjs.org) do + +```bash +$ npm install isarray +``` + +Then bundle for the browser with +[browserify](https://github.com/substack/browserify). + +With [component](http://component.io) do + +```bash +$ component install juliangruber/isarray +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tools/eslint/node_modules/isarray/index.js b/tools/eslint/node_modules/isarray/index.js new file mode 100644 index 00000000000000..a57f63495943a0 --- /dev/null +++ b/tools/eslint/node_modules/isarray/index.js @@ -0,0 +1,5 @@ +var toString = {}.toString; + +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; diff --git a/tools/eslint/node_modules/isarray/package.json b/tools/eslint/node_modules/isarray/package.json new file mode 100644 index 00000000000000..7f00f694edc02d --- /dev/null +++ b/tools/eslint/node_modules/isarray/package.json @@ -0,0 +1,97 @@ +{ + "_args": [ + [ + "isarray@~1.0.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/readable-stream" + ] + ], + "_from": "isarray@>=1.0.0 <1.1.0", + "_id": "isarray@1.0.0", + "_inCache": true, + "_installable": true, + "_location": "/isarray", + "_nodeVersion": "5.1.0", + "_npmUser": { + "email": "julian@juliangruber.com", + "name": "juliangruber" + }, + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "name": "isarray", + "raw": "isarray@~1.0.0", + "rawSpec": "~1.0.0", + "scope": null, + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/doctrine", + "/readable-stream" + ], + "_resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "_shasum": "bb935d48582cba168c06834957a54a3e07124f11", + "_shrinkwrap": null, + "_spec": "isarray@~1.0.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/readable-stream", + "author": { + "email": "mail@juliangruber.com", + "name": "Julian Gruber", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/isarray/issues" + }, + "dependencies": {}, + "description": "Array#isArray for older browsers", + "devDependencies": { + "tape": "~2.13.4" + }, + "directories": {}, + "dist": { + "shasum": "bb935d48582cba168c06834957a54a3e07124f11", + "tarball": "http://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" + }, + "gitHead": "2a23a281f369e9ae06394c0fb4d2381355a6ba33", + "homepage": "https://github.com/juliangruber/isarray", + "keywords": [ + "array", + "browser", + "isarray" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + } + ], + "name": "isarray", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/isarray.git" + }, + "scripts": { + "test": "tape test.js" + }, + "testling": { + "browsers": [ + "android-browser/4.2..latest", + "chrome/22..latest", + "chrome/canary", + "firefox/17..latest", + "firefox/nightly", + "ie/8..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "opera/12..latest", + "opera/next", + "safari/5.1..latest" + ], + "files": "test.js" + }, + "version": "1.0.0" +} diff --git a/tools/eslint/node_modules/js-yaml/CHANGELOG.md b/tools/eslint/node_modules/js-yaml/CHANGELOG.md deleted file mode 100644 index f057ec33fc41f0..00000000000000 --- a/tools/eslint/node_modules/js-yaml/CHANGELOG.md +++ /dev/null @@ -1,299 +0,0 @@ -3.3.1 / 2015-05-13 ------------------- - -- Added `.sortKeys` dumper option, thanks to @rjmunro. -- Fixed astral characters support, #191. - - -3.3.0 / 2015-04-26 ------------------- - -- Significantly improved long strings formatting in dumper, thanks to @isaacs. -- Strip BOM if exists. - - -3.2.7 / 2015-02-19 ------------------- - -- Maintenance release. -- Updated dependencies. -- HISTORY.md -> CHANGELOG.md - - -3.2.6 / 2015-02-07 ------------------- - -- Fixed encoding of UTF-16 surrogate pairs. (e.g. "\U0001F431" CAT FACE). -- Fixed demo dates dump (#113, thanks to @Hypercubed). - - -3.2.5 / 2014-12-28 ------------------- - -- Fixed resolving of all built-in types on empty nodes. -- Fixed invalid warning on empty lines within quoted scalars and flow collections. -- Fixed bug: Tag on an empty node didn't resolve in some cases. - - -3.2.4 / 2014-12-19 ------------------- - -- Fixed resolving of !!null tag on an empty node. - - -3.2.3 / 2014-11-08 ------------------- - -- Implemented dumping of objects with circular and cross references. -- Partially fixed aliasing of constructed objects. (see issue #141 for details) - - -3.2.2 / 2014-09-07 ------------------- - -- Fixed infinite loop on unindented block scalars. -- Rewritten base64 encode/decode in binary type, to keep code licence clear. - - -3.2.1 / 2014-08-24 ------------------- - -- Nothig new. Just fix npm publish error. - - -3.2.0 / 2014-08-24 ------------------- - -- Added input piping support to CLI. -- Fixed typo, that could cause hand on initial indent (#139). - - -3.1.0 / 2014-07-07 ------------------- - -- 1.5x-2x speed boost. -- Removed deprecated `require('xxx.yml')` support. -- Significant code cleanup and refactoring. -- Internal API changed. If you used custom types - see updated examples. - Others are not affected. -- Even if the input string has no trailing line break character, - it will be parsed as if it has one. -- Added benchmark scripts. -- Moved bower files to /dist folder -- Bugfixes. - - -3.0.2 / 2014-02-27 ------------------- - -- Fixed bug: "constructor" string parsed as `null`. - - -3.0.1 / 2013-12-22 ------------------- - -- Fixed parsing of literal scalars. (issue #108) -- Prevented adding unnecessary spaces in object dumps. (issue #68) -- Fixed dumping of objects with very long (> 1024 in length) keys. - - -3.0.0 / 2013-12-16 ------------------- - -- Refactored code. Changed API for custom types. -- Removed output colors in CLI, dump json by default. -- Removed big dependencies from browser version (esprima, buffer) - - load `esprima` manually, if !!js/function needed - - !!bin now returns Array in browser -- AMD support. -- Don't quote dumped strings because of `-` & `?` (if not first char). -- __Deprecated__ loading yaml files via `require()`, as not recommended - behaviour for node. - - -2.1.3 / 2013-10-16 ------------------- - -- Fix wrong loading of empty block scalars. - - -2.1.2 / 2013-10-07 ------------------- - -- Fix unwanted line breaks in folded scalars. - - -2.1.1 / 2013-10-02 ------------------- - -- Dumper now respects deprecated booleans syntax from YAML 1.0/1.1 -- Fixed reader bug in JSON-like sequences/mappings. - - -2.1.0 / 2013-06-05 ------------------- - -- Add standard YAML schemas: Failsafe (`FAILSAFE_SCHEMA`), - JSON (`JSON_SCHEMA`) and Core (`CORE_SCHEMA`). -- Rename `DEFAULT_SCHEMA` to `DEFAULT_FULL_SCHEMA` - and `SAFE_SCHEMA` to `DEFAULT_SAFE_SCHEMA`. -- Bug fix: export `NIL` constant from the public interface. -- Add `skipInvalid` dumper option. -- Use `safeLoad` for `require` extension. - - -2.0.5 / 2013-04-26 ------------------- - -- Close security issue in !!js/function constructor. - Big thanks to @nealpoole for security audit. - - -2.0.4 / 2013-04-08 ------------------- - -- Updated .npmignore to reduce package size - - -2.0.3 / 2013-02-26 ------------------- - -- Fixed dumping of empty arrays ans objects. ([] and {} instead of null) - - -2.0.2 / 2013-02-15 ------------------- - -- Fixed input validation: tabs are printable characters. - - -2.0.1 / 2013-02-09 ------------------- - -- Fixed error, when options not passed to function cass - - -2.0.0 / 2013-02-09 ------------------- - -- Full rewrite. New architecture. Fast one-stage parsing. -- Changed custom types API. -- Added YAML dumper. - - -1.0.3 / 2012-11-05 ------------------- - -- Fixed utf-8 files loading. - - -1.0.2 / 2012-08-02 ------------------- - -- Pull out hand-written shims. Use ES5-Shims for old browsers support. See #44. -- Fix timstamps incorectly parsed in local time when no time part specified. - - -1.0.1 / 2012-07-07 ------------------- - -- Fixes `TypeError: 'undefined' is not an object` under Safari. Thanks Phuong. -- Fix timestamps incorrectly parsed in local time. Thanks @caolan. Closes #46. - - -1.0.0 / 2012-07-01 ------------------- - -- `y`, `yes`, `n`, `no`, `on`, `off` are not converted to Booleans anymore. - Fixes #42. -- `require(filename)` now returns a single document and throws an Error if - file contains more than one document. -- CLI was merged back from js-yaml.bin - - -0.3.7 / 2012-02-28 ------------------- - -- Fix export of `addConstructor()`. Closes #39. - - -0.3.6 / 2012-02-22 ------------------- - -- Removed AMD parts - too buggy to use. Need help to rewrite from scratch -- Removed YUI compressor warning (renamed `double` variable). Closes #40. - - -0.3.5 / 2012-01-10 ------------------- - -- Workagound for .npmignore fuckup under windows. Thanks to airportyh. - - -0.3.4 / 2011-12-24 ------------------- - -- Fixes str[] for oldIEs support. -- Adds better has change support for browserified demo. -- improves compact output of Error. Closes #33. - - -0.3.3 / 2011-12-20 ------------------- - -- jsyaml executable moved to separate module. -- adds `compact` stringification of Errors. - - -0.3.2 / 2011-12-16 ------------------- - -- Fixes ug with block style scalars. Closes #26. -- All sources are passing JSLint now. -- Fixes bug in Safari. Closes #28. -- Fixes bug in Opers. Closes #29. -- Improves browser support. Closes #20. -- Added jsyaml executable. -- Added !!js/function support. Closes #12. - - -0.3.1 / 2011-11-18 ------------------- - -- Added AMD support for browserified version. -- Wrapped browserified js-yaml into closure. -- Fixed the resolvement of non-specific tags. Closes #17. -- Added permalinks for online demo YAML snippets. Now we have YPaste service, lol. -- Added !!js/regexp and !!js/undefined types. Partially solves #12. -- Fixed !!set mapping. -- Fixed month parse in dates. Closes #19. - - -0.3.0 / 2011-11-09 ------------------- - -- Removed JS.Class dependency. Closes #3. -- Added browserified version. Closes #13. -- Added live demo of browserified version. -- Ported some of the PyYAML tests. See #14. -- Fixed timestamp bug when fraction was given. - - -0.2.2 / 2011-11-06 ------------------- - -- Fixed crash on docs without ---. Closes #8. -- Fixed miltiline string parse -- Fixed tests/comments for using array as key - - -0.2.1 / 2011-11-02 ------------------- - -- Fixed short file read (<4k). Closes #9. - - -0.2.0 / 2011-11-02 ------------------- - -- First public release diff --git a/tools/eslint/node_modules/js-yaml/README.md b/tools/eslint/node_modules/js-yaml/README.md index 8ad571f1059090..45c35020ce2998 100644 --- a/tools/eslint/node_modules/js-yaml/README.md +++ b/tools/eslint/node_modules/js-yaml/README.md @@ -1,10 +1,10 @@ -JS-YAML - YAML 1.2 parser and serializer for JavaScript -======================================================= +JS-YAML - YAML 1.2 parser / writer for JavaScript +================================================= [![Build Status](https://travis-ci.org/nodeca/js-yaml.svg?branch=master)](https://travis-ci.org/nodeca/js-yaml) [![NPM version](https://img.shields.io/npm/v/js-yaml.svg)](https://www.npmjs.org/package/js-yaml) -[Online Demo](http://nodeca.github.com/js-yaml/) +__[Online Demo](http://nodeca.github.com/js-yaml/)__ This is an implementation of [YAML](http://yaml.org/), a human friendly data @@ -63,7 +63,7 @@ needs [es5-shims](https://github.com/kriskowal/es5-shim) to operate. Notes: -1. We have no resourses to support browserified version. Don't expect it to be +1. We have no resources to support browserified version. Don't expect it to be well tested. Don't expect fast fixes if something goes wrong there. 2. `!!js/function` in browser bundle will not work by default. If you really need it - load `esprima` parser first (via amd or directly). @@ -116,13 +116,14 @@ options: (`!!js/undefined`, `!!js/regexp` and `!!js/function`): http://yaml.org/type/ - `DEFAULT_FULL_SCHEMA` - all supported YAML types. +- `json` _(default: false)_ - compatibility with JSON.parse behaviour. If true, then duplicate keys in a mapping will override values rather than throwing an error. NOTE: This function **does not** understand multi-document sources, it throws exception on those. NOTE: JS-YAML **does not** support schema-specific tag resolution restrictions. So, JSON schema is not as strict as defined in the YAML specification. -It allows numbers in any notaion, use `Null` and `NULL` as `null`, etc. +It allows numbers in any notation, use `Null` and `NULL` as `null`, etc. Core schema also has no such restrictions. It allows binary notation for integers. @@ -177,6 +178,10 @@ options: - `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ specifies a schema to use. - `sortKeys` _(default: `false`)_ - if `true`, sort keys when dumping YAML. If a function, use the function to sort the keys. +- `lineWidth` _(default: `80`)_ - set max line width. +- `noRefs` _(default: `false`)_ - if `true`, don't convert duplicate objects into references +- `noCompatMode` _(default: `false`)_ - if `true` don't try to be compatible with older + yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1 styles: @@ -238,7 +243,7 @@ The list of standard YAML tags and corresponding JavaScipt types. See also Caveats ------- -Note, that you use arrays or objects as key in JS-YAML. JS do not allows objects +Note, that you use arrays or objects as key in JS-YAML. JS does not allow objects or array as keys, and stringifies (by calling .toString method) them at the moment of adding them. @@ -270,10 +275,10 @@ So, the following YAML document cannot be loaded. Breaking changes in 2.x.x -> 3.x.x ---------------------------------- -If your have not used __custom__ tags or loader classes and not loaded yaml +If you have not used __custom__ tags or loader classes and not loaded yaml files via `require()` - no changes needed. Just upgrade library. -In other case, you should: +Otherwise, you should: 1. Replace all occurences of `require('xxxx.yml')` by `fs.readFileSync()` + `yaml.safeLoad()`. diff --git a/tools/eslint/node_modules/js-yaml/bin/js-yaml.js b/tools/eslint/node_modules/js-yaml/bin/js-yaml.js index e6029d64ce23eb..5e32400f9ee4ac 100755 --- a/tools/eslint/node_modules/js-yaml/bin/js-yaml.js +++ b/tools/eslint/node_modules/js-yaml/bin/js-yaml.js @@ -101,42 +101,34 @@ readFile(options.file, 'utf8', function (error, input) { try { output = JSON.parse(input); isYaml = false; - } catch (error) { - if (error instanceof SyntaxError) { + } catch (err) { + if (err instanceof SyntaxError) { try { output = []; yaml.loadAll(input, function (doc) { output.push(doc); }, {}); isYaml = true; - if (0 === output.length) { - output = null; - } else if (1 === output.length) { - output = output[0]; - } - } catch (error) { - if (options.trace && error.stack) { - console.error(error.stack); - } else { - console.error(error.toString(options.compact)); - } + if (output.length === 0) output = null; + else if (output.length === 1) output = output[0]; + + } catch (e) { + if (options.trace && err.stack) console.error(e.stack); + else console.error(e.toString(options.compact)); process.exit(1); } } else { console.error( - options.trace && error.stack || - error.message || - String(error)); + options.trace && err.stack || + err.message || + String(err)); process.exit(1); } } - if (isYaml) { - console.log(JSON.stringify(output, null, ' ')); - } else { - console.log(yaml.dump(output)); - } + if (isYaml) console.log(JSON.stringify(output, null, ' ')); + else console.log(yaml.dump(output)); process.exit(0); }); diff --git a/tools/eslint/node_modules/js-yaml/bower.json b/tools/eslint/node_modules/js-yaml/bower.json deleted file mode 100644 index 010912f10f9d55..00000000000000 --- a/tools/eslint/node_modules/js-yaml/bower.json +++ /dev/null @@ -1,23 +0,0 @@ - -{ - "name": "js-yaml", - "main": "dist/js-yaml.js", - "homepage": "https://github.com/nodeca/js-yaml", - "authors": [ "Dervus Grim ", - "Vitaly Puzrin ", - "Aleksey V Zapparov ", - "Martin Grenfell " ], - "description": "YAML 1.2 parser and serializer", - "keywords": ["yaml", "parser", "serializer", "pyyaml"], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "benchmark", - "bower_components", - "test", - "Makefile", - "index*", - "package.json" - ] -} diff --git a/tools/eslint/node_modules/js-yaml/dist/js-yaml.js b/tools/eslint/node_modules/js-yaml/dist/js-yaml.js index 21ce73c5ed7506..5f20e9b5d9c382 100644 --- a/tools/eslint/node_modules/js-yaml/dist/js-yaml.js +++ b/tools/eslint/node_modules/js-yaml/dist/js-yaml.js @@ -1,4 +1,4 @@ -/* js-yaml 3.3.1 https://github.com/nodeca/js-yaml */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.jsyaml = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o and | if not wrapped in spaces. - if (spaceWrap) { - simple = false; + // Can only use > and | if not wrapped in spaces or is not a key. + // Also, don't use if in flow mode. + if (spaceWrap || (state.flowLevel > -1 && state.flowLevel <= level)) { + if (spaceWrap) simple = false; + folded = false; literal = false; } else { - folded = true; - literal = true; + folded = !iskey; + literal = !iskey; } single = true; @@ -361,12 +363,14 @@ function writeScalar(state, object, level) { longestLine = 0; indent = state.indent * level; - max = 80; - if (indent < 40) { - max -= indent; - } else { - max = 40; - } + max = state.lineWidth; + + // Replace -1 with biggest ingeger number according to + // http://ecma262-5.com/ELS5_HTML.htm#Section_8.5 + if (max === -1) max = 9007199254740991; + + if (indent < 40) max -= indent; + else max = 40; for (position = 0; position < object.length; position++) { character = object.charCodeAt(position); @@ -410,23 +414,17 @@ function writeScalar(state, object, level) { if (folded) { lineLength = position - linePosition; linePosition = position; - if (lineLength > longestLine) { - longestLine = lineLength; - } + if (lineLength > longestLine) longestLine = lineLength; } } - if (character !== CHAR_DOUBLE_QUOTE) { - single = false; - } + if (character !== CHAR_DOUBLE_QUOTE) single = false; double.takeUpTo(position); double.escapeChar(); } - if (simple && testImplicitResolving(state, object)) { - simple = false; - } + if (simple && testImplicitResolving(state, object)) simple = false; modifier = ''; if (folded || literal) { @@ -438,22 +436,17 @@ function writeScalar(state, object, level) { } } - if (trailingLineBreaks === 0) { - modifier = '-'; - } else if (trailingLineBreaks === 2) { - modifier = '+'; - } + if (trailingLineBreaks === 0) modifier = '-'; + else if (trailingLineBreaks === 2) modifier = '+'; } - if (literal && longestLine < max) { + if (literal && longestLine < max || state.tag !== null) { folded = false; } // If it's literally one line, then don't bother with the literal. // We may still want to do a fold, though, if it's a super long line. - if (!sawLineFeed) { - literal = false; - } + if (!sawLineFeed) literal = false; if (simple) { state.dump = object; @@ -463,9 +456,7 @@ function writeScalar(state, object, level) { result = fold(object, max); state.dump = '>' + modifier + '\n' + indentString(result, indent); } else if (literal) { - if (!modifier) { - object = object.replace(/\n$/, ''); - } + if (!modifier) object = object.replace(/\n$/, ''); state.dump = '|' + modifier + '\n' + indentString(object, indent); } else if (double) { double.finish(); @@ -503,30 +494,24 @@ function fold(object, max) { while (position < length) { newLine = object.indexOf('\n', position); if (newLine > length || newLine === -1) { - if (result) { - result += '\n\n'; - } + if (result) result += '\n\n'; result += foldLine(object.slice(position, length), max); position = length; + } else { - if (result) { - result += '\n\n'; - } + if (result) result += '\n\n'; result += foldLine(object.slice(position, newLine), max); position = newLine + 1; } } - if (trailing && trailing[0] !== '\n') { - result += trailing[0]; - } + + if (trailing && trailing[0] !== '\n') result += trailing[0]; return result; } function foldLine(line, max) { - if (line === '') { - return line; - } + if (line === '') return line; var foldRe = /[^\s] [^\s]/g, result = '', @@ -544,15 +529,10 @@ function foldLine(line, max) { // been ok, use that one, and carry on. If there was no previous // match on this fold section, then just have a long line. if (index - foldStart > max) { - if (prevMatch !== foldStart) { - foldEnd = prevMatch; - } else { - foldEnd = index; - } + if (prevMatch !== foldStart) foldEnd = prevMatch; + else foldEnd = index; - if (result) { - result += '\n'; - } + if (result) result += '\n'; folded = line.slice(foldStart, foldEnd); result += folded; foldStart = foldEnd + 1; @@ -561,9 +541,7 @@ function foldLine(line, max) { match = foldRe.exec(line); } - if (result) { - result += '\n'; - } + if (result) result += '\n'; // if we end up with one last word at the end, then the last bit might // be slightly bigger than we wanted, because we exited out of the loop. @@ -604,7 +582,7 @@ function simpleChar(character) { // Returns true if the character code needs to be escaped. function needsHexEscape(character) { return !((0x00020 <= character && character <= 0x00007E) || - (0x00085 === character) || + (character === 0x00085) || (0x000A0 <= character && character <= 0x00D7FF) || (0x0E000 <= character && character <= 0x00FFFD) || (0x10000 <= character && character <= 0x10FFFF)); @@ -619,9 +597,7 @@ function writeFlowSequence(state, level, object) { for (index = 0, length = object.length; index < length; index += 1) { // Write only valid elements. if (writeNode(state, level, object[index], false, false)) { - if (0 !== index) { - _result += ', '; - } + if (index !== 0) _result += ', '; _result += state.dump; } } @@ -639,7 +615,7 @@ function writeBlockSequence(state, level, object, compact) { for (index = 0, length = object.length; index < length; index += 1) { // Write only valid elements. if (writeNode(state, level + 1, object[index], true, true)) { - if (!compact || 0 !== index) { + if (!compact || index !== 0) { _result += generateNextLine(state, level); } _result += '- ' + state.dump; @@ -663,9 +639,7 @@ function writeFlowMapping(state, level, object) { for (index = 0, length = objectKeyList.length; index < length; index += 1) { pairBuffer = ''; - if (0 !== index) { - pairBuffer += ', '; - } + if (index !== 0) pairBuffer += ', '; objectKey = objectKeyList[index]; objectValue = object[objectKey]; @@ -674,9 +648,7 @@ function writeFlowMapping(state, level, object) { continue; // Skip this pair because of invalid key; } - if (state.dump.length > 1024) { - pairBuffer += '? '; - } + if (state.dump.length > 1024) pairBuffer += '? '; pairBuffer += state.dump + ': '; @@ -720,18 +692,18 @@ function writeBlockMapping(state, level, object, compact) { for (index = 0, length = objectKeyList.length; index < length; index += 1) { pairBuffer = ''; - if (!compact || 0 !== index) { + if (!compact || index !== 0) { pairBuffer += generateNextLine(state, level); } objectKey = objectKeyList[index]; objectValue = object[objectKey]; - if (!writeNode(state, level + 1, objectKey, true, true)) { + if (!writeNode(state, level + 1, objectKey, true, true, true)) { continue; // Skip this pair because of invalid key. } - explicitPair = (null !== state.tag && '?' !== state.tag) || + explicitPair = (state.tag !== null && state.tag !== '?') || (state.dump && state.dump.length > 1024); if (explicitPair) { @@ -777,7 +749,7 @@ function detectType(state, object, explicit) { type = typeList[index]; if ((type.instanceOf || type.predicate) && - (!type.instanceOf || (('object' === typeof object) && (object instanceof type.instanceOf))) && + (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && (!type.predicate || type.predicate(object))) { state.tag = explicit ? type.tag : '?'; @@ -785,7 +757,7 @@ function detectType(state, object, explicit) { if (type.represent) { style = state.styleMap[type.tag] || type.defaultStyle; - if ('[object Function]' === _toString.call(type.represent)) { + if (_toString.call(type.represent) === '[object Function]') { _result = type.represent(object, style); } else if (_hasOwnProperty.call(type.represent, style)) { _result = type.represent[style](object, style); @@ -806,7 +778,7 @@ function detectType(state, object, explicit) { // Serializes `object` and writes it to global `result`. // Returns true on success, or false on invalid object. // -function writeNode(state, level, object, block, compact) { +function writeNode(state, level, object, block, compact, iskey) { state.tag = null; state.dump = object; @@ -817,14 +789,10 @@ function writeNode(state, level, object, block, compact) { var type = _toString.call(state.dump); if (block) { - block = (0 > state.flowLevel || state.flowLevel > level); + block = (state.flowLevel < 0 || state.flowLevel > level); } - if ((null !== state.tag && '?' !== state.tag) || (2 !== state.indent && level > 0)) { - compact = false; - } - - var objectOrArray = '[object Object]' === type || '[object Array]' === type, + var objectOrArray = type === '[object Object]' || type === '[object Array]', duplicateIndex, duplicate; @@ -833,17 +801,21 @@ function writeNode(state, level, object, block, compact) { duplicate = duplicateIndex !== -1; } + if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { + compact = false; + } + if (duplicate && state.usedDuplicates[duplicateIndex]) { state.dump = '*ref_' + duplicateIndex; } else { if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { state.usedDuplicates[duplicateIndex] = true; } - if ('[object Object]' === type) { - if (block && (0 !== Object.keys(state.dump).length)) { + if (type === '[object Object]') { + if (block && (Object.keys(state.dump).length !== 0)) { writeBlockMapping(state, level, state.dump, compact); if (duplicate) { - state.dump = '&ref_' + duplicateIndex + (0 === level ? '\n' : '') + state.dump; + state.dump = '&ref_' + duplicateIndex + state.dump; } } else { writeFlowMapping(state, level, state.dump); @@ -851,11 +823,11 @@ function writeNode(state, level, object, block, compact) { state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; } } - } else if ('[object Array]' === type) { - if (block && (0 !== state.dump.length)) { + } else if (type === '[object Array]') { + if (block && (state.dump.length !== 0)) { writeBlockSequence(state, level, state.dump, compact); if (duplicate) { - state.dump = '&ref_' + duplicateIndex + (0 === level ? '\n' : '') + state.dump; + state.dump = '&ref_' + duplicateIndex + state.dump; } } else { writeFlowSequence(state, level, state.dump); @@ -863,18 +835,16 @@ function writeNode(state, level, object, block, compact) { state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; } } - } else if ('[object String]' === type) { - if ('?' !== state.tag) { - writeScalar(state, state.dump, level); + } else if (type === '[object String]') { + if (state.tag !== '?') { + writeScalar(state, state.dump, level, iskey); } } else { - if (state.skipInvalid) { - return false; - } + if (state.skipInvalid) return false; throw new YAMLException('unacceptable kind of an object to dump ' + type); } - if (null !== state.tag && '?' !== state.tag) { + if (state.tag !== null && state.tag !== '?') { state.dump = '!<' + state.tag + '> ' + state.dump; } } @@ -897,15 +867,14 @@ function getDuplicateReferences(object, state) { } function inspectNode(object, objects, duplicatesIndexes) { - var type = _toString.call(object), - objectKeyList, + var objectKeyList, index, length; - if (null !== object && 'object' === typeof object) { + if (object !== null && typeof object === 'object') { index = objects.indexOf(object); - if (-1 !== index) { - if (-1 === duplicatesIndexes.indexOf(index)) { + if (index !== -1) { + if (duplicatesIndexes.indexOf(index) === -1) { duplicatesIndexes.push(index); } } else { @@ -931,11 +900,10 @@ function dump(input, options) { var state = new State(options); - getDuplicateReferences(input, state); + if (!state.noRefs) getDuplicateReferences(input, state); + + if (writeNode(state, 0, input, true, true)) return state.dump + '\n'; - if (writeNode(state, 0, input, true, true)) { - return state.dump + '\n'; - } return ''; } @@ -947,21 +915,39 @@ module.exports.dump = dump; module.exports.safeDump = safeDump; },{"./common":2,"./exception":4,"./schema/default_full":9,"./schema/default_safe":10}],4:[function(require,module,exports){ +// YAML error class. http://stackoverflow.com/questions/8458984 +// 'use strict'; - function YAMLException(reason, mark) { - this.name = 'YAMLException'; - this.reason = reason; - this.mark = mark; - this.message = this.toString(false); + // Super constructor + Error.call(this); + + // Include stack trace in error object + if (Error.captureStackTrace) { + // Chrome and NodeJS + Error.captureStackTrace(this, this.constructor); + } else { + // FF, IE 10+ and Safari 6+. Fallback for others + this.stack = (new Error()).stack || ''; + } + + this.name = 'YAMLException'; + this.reason = reason; + this.mark = mark; + this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); } +// Inherit from Error +YAMLException.prototype = Object.create(Error.prototype); +YAMLException.prototype.constructor = YAMLException; + + YAMLException.prototype.toString = function toString(compact) { - var result; + var result = this.name + ': '; - result = 'JS-YAML: ' + (this.reason || '(unknown reason)'); + result += this.reason || '(unknown reason)'; if (!compact && this.mark) { result += ' ' + this.mark.toString(); @@ -1022,11 +1008,11 @@ function is_WS_OR_EOL(c) { } function is_FLOW_INDICATOR(c) { - return 0x2C/* , */ === c || - 0x5B/* [ */ === c || - 0x5D/* ] */ === c || - 0x7B/* { */ === c || - 0x7D/* } */ === c; + return c === 0x2C/* , */ || + c === 0x5B/* [ */ || + c === 0x5D/* ] */ || + c === 0x7B/* { */ || + c === 0x7D/* } */; } function fromHexCode(c) { @@ -1107,6 +1093,8 @@ function State(input, options) { this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; this.onWarning = options['onWarning'] || null; this.legacy = options['legacy'] || false; + this.json = options['json'] || false; + this.listener = options['listener'] || null; this.implicitTypes = this.schema.compiledImplicit; this.typeMap = this.schema.compiledTypeMap; @@ -1143,12 +1131,8 @@ function throwError(state, message) { } function throwWarning(state, message) { - var error = generateError(state, message); - if (state.onWarning) { - state.onWarning.call(null, error); - } else { - throw error; + state.onWarning.call(null, generateError(state, message)); } } @@ -1157,62 +1141,62 @@ var directiveHandlers = { YAML: function handleYamlDirective(state, name, args) { - var match, major, minor; + var match, major, minor; - if (null !== state.version) { - throwError(state, 'duplication of %YAML directive'); - } + if (state.version !== null) { + throwError(state, 'duplication of %YAML directive'); + } - if (1 !== args.length) { - throwError(state, 'YAML directive accepts exactly one argument'); - } + if (args.length !== 1) { + throwError(state, 'YAML directive accepts exactly one argument'); + } - match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); - if (null === match) { - throwError(state, 'ill-formed argument of the YAML directive'); - } + if (match === null) { + throwError(state, 'ill-formed argument of the YAML directive'); + } - major = parseInt(match[1], 10); - minor = parseInt(match[2], 10); + major = parseInt(match[1], 10); + minor = parseInt(match[2], 10); - if (1 !== major) { - throwError(state, 'unacceptable YAML version of the document'); - } + if (major !== 1) { + throwError(state, 'unacceptable YAML version of the document'); + } - state.version = args[0]; - state.checkLineBreaks = (minor < 2); + state.version = args[0]; + state.checkLineBreaks = (minor < 2); - if (1 !== minor && 2 !== minor) { - throwWarning(state, 'unsupported YAML version of the document'); - } - }, + if (minor !== 1 && minor !== 2) { + throwWarning(state, 'unsupported YAML version of the document'); + } + }, TAG: function handleTagDirective(state, name, args) { - var handle, prefix; + var handle, prefix; - if (2 !== args.length) { - throwError(state, 'TAG directive accepts exactly two arguments'); - } + if (args.length !== 2) { + throwError(state, 'TAG directive accepts exactly two arguments'); + } - handle = args[0]; - prefix = args[1]; + handle = args[0]; + prefix = args[1]; - if (!PATTERN_TAG_HANDLE.test(handle)) { - throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); - } - - if (_hasOwnProperty.call(state.tagMap, handle)) { - throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); - } + if (!PATTERN_TAG_HANDLE.test(handle)) { + throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); + } - if (!PATTERN_TAG_URI.test(prefix)) { - throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); - } + if (_hasOwnProperty.call(state.tagMap, handle)) { + throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); + } - state.tagMap[handle] = prefix; + if (!PATTERN_TAG_URI.test(prefix)) { + throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); } + + state.tagMap[handle] = prefix; + } }; @@ -1227,18 +1211,20 @@ function captureSegment(state, start, end, checkJson) { _position < _length; _position += 1) { _character = _result.charCodeAt(_position); - if (!(0x09 === _character || - 0x20 <= _character && _character <= 0x10FFFF)) { + if (!(_character === 0x09 || + (0x20 <= _character && _character <= 0x10FFFF))) { throwError(state, 'expected valid JSON character'); } } + } else if (PATTERN_NON_PRINTABLE.test(_result)) { + throwError(state, 'the stream contains non-printable characters'); } state.result += _result; } } -function mergeMappings(state, destination, source) { +function mergeMappings(state, destination, source, overridableKeys) { var sourceKeys, key, index, quantity; if (!common.isObject(source)) { @@ -1252,29 +1238,36 @@ function mergeMappings(state, destination, source) { if (!_hasOwnProperty.call(destination, key)) { destination[key] = source[key]; + overridableKeys[key] = true; } } } -function storeMappingPair(state, _result, keyTag, keyNode, valueNode) { +function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode) { var index, quantity; keyNode = String(keyNode); - if (null === _result) { + if (_result === null) { _result = {}; } - if ('tag:yaml.org,2002:merge' === keyTag) { + if (keyTag === 'tag:yaml.org,2002:merge') { if (Array.isArray(valueNode)) { for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { - mergeMappings(state, _result, valueNode[index]); + mergeMappings(state, _result, valueNode[index], overridableKeys); } } else { - mergeMappings(state, _result, valueNode); + mergeMappings(state, _result, valueNode, overridableKeys); } } else { + if (!state.json && + !_hasOwnProperty.call(overridableKeys, keyNode) && + _hasOwnProperty.call(_result, keyNode)) { + throwError(state, 'duplicated mapping key'); + } _result[keyNode] = valueNode; + delete overridableKeys[keyNode]; } return _result; @@ -1285,11 +1278,11 @@ function readLineBreak(state) { ch = state.input.charCodeAt(state.position); - if (0x0A/* LF */ === ch) { + if (ch === 0x0A/* LF */) { state.position++; - } else if (0x0D/* CR */ === ch) { + } else if (ch === 0x0D/* CR */) { state.position++; - if (0x0A/* LF */ === state.input.charCodeAt(state.position)) { + if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { state.position++; } } else { @@ -1304,15 +1297,15 @@ function skipSeparationSpace(state, allowComments, checkIndent) { var lineBreaks = 0, ch = state.input.charCodeAt(state.position); - while (0 !== ch) { + while (ch !== 0) { while (is_WHITE_SPACE(ch)) { ch = state.input.charCodeAt(++state.position); } - if (allowComments && 0x23/* # */ === ch) { + if (allowComments && ch === 0x23/* # */) { do { ch = state.input.charCodeAt(++state.position); - } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && 0 !== ch); + } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); } if (is_EOL(ch)) { @@ -1322,7 +1315,7 @@ function skipSeparationSpace(state, allowComments, checkIndent) { lineBreaks++; state.lineIndent = 0; - while (0x20/* Space */ === ch) { + while (ch === 0x20/* Space */) { state.lineIndent++; ch = state.input.charCodeAt(++state.position); } @@ -1331,7 +1324,7 @@ function skipSeparationSpace(state, allowComments, checkIndent) { } } - if (-1 !== checkIndent && 0 !== lineBreaks && state.lineIndent < checkIndent) { + if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { throwWarning(state, 'deficient indentation'); } @@ -1346,9 +1339,9 @@ function testDocumentSeparator(state) { // Condition state.position === state.lineStart is tested // in parent on each call, for efficiency. No needs to test here again. - if ((0x2D/* - */ === ch || 0x2E/* . */ === ch) && - state.input.charCodeAt(_position + 1) === ch && - state.input.charCodeAt(_position + 2) === ch) { + if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && + ch === state.input.charCodeAt(_position + 1) && + ch === state.input.charCodeAt(_position + 2)) { _position += 3; @@ -1363,7 +1356,7 @@ function testDocumentSeparator(state) { } function writeFoldedLines(state, count) { - if (1 === count) { + if (count === 1) { state.result += ' '; } else if (count > 1) { state.result += common.repeat('\n', count - 1); @@ -1386,23 +1379,23 @@ function readPlainScalar(state, nodeIndent, withinFlowCollection) { ch = state.input.charCodeAt(state.position); - if (is_WS_OR_EOL(ch) || - is_FLOW_INDICATOR(ch) || - 0x23/* # */ === ch || - 0x26/* & */ === ch || - 0x2A/* * */ === ch || - 0x21/* ! */ === ch || - 0x7C/* | */ === ch || - 0x3E/* > */ === ch || - 0x27/* ' */ === ch || - 0x22/* " */ === ch || - 0x25/* % */ === ch || - 0x40/* @ */ === ch || - 0x60/* ` */ === ch) { + if (is_WS_OR_EOL(ch) || + is_FLOW_INDICATOR(ch) || + ch === 0x23/* # */ || + ch === 0x26/* & */ || + ch === 0x2A/* * */ || + ch === 0x21/* ! */ || + ch === 0x7C/* | */ || + ch === 0x3E/* > */ || + ch === 0x27/* ' */ || + ch === 0x22/* " */ || + ch === 0x25/* % */ || + ch === 0x40/* @ */ || + ch === 0x60/* ` */) { return false; } - if (0x3F/* ? */ === ch || 0x2D/* - */ === ch) { + if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { following = state.input.charCodeAt(state.position + 1); if (is_WS_OR_EOL(following) || @@ -1416,8 +1409,8 @@ function readPlainScalar(state, nodeIndent, withinFlowCollection) { captureStart = captureEnd = state.position; hasPendingContent = false; - while (0 !== ch) { - if (0x3A/* : */ === ch) { + while (ch !== 0) { + if (ch === 0x3A/* : */) { following = state.input.charCodeAt(state.position + 1); if (is_WS_OR_EOL(following) || @@ -1425,7 +1418,7 @@ function readPlainScalar(state, nodeIndent, withinFlowCollection) { break; } - } else if (0x23/* # */ === ch) { + } else if (ch === 0x23/* # */) { preceding = state.input.charCodeAt(state.position - 1); if (is_WS_OR_EOL(preceding)) { @@ -1486,7 +1479,7 @@ function readSingleQuotedScalar(state, nodeIndent) { ch = state.input.charCodeAt(state.position); - if (0x27/* ' */ !== ch) { + if (ch !== 0x27/* ' */) { return false; } @@ -1495,12 +1488,12 @@ function readSingleQuotedScalar(state, nodeIndent) { state.position++; captureStart = captureEnd = state.position; - while (0 !== (ch = state.input.charCodeAt(state.position))) { - if (0x27/* ' */ === ch) { + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x27/* ' */) { captureSegment(state, captureStart, state.position, true); ch = state.input.charCodeAt(++state.position); - if (0x27/* ' */ === ch) { + if (ch === 0x27/* ' */) { captureStart = captureEnd = state.position; state.position++; } else { @@ -1529,12 +1522,12 @@ function readDoubleQuotedScalar(state, nodeIndent) { captureEnd, hexLength, hexResult, - tmp, tmpEsc, + tmp, ch; ch = state.input.charCodeAt(state.position); - if (0x22/* " */ !== ch) { + if (ch !== 0x22/* " */) { return false; } @@ -1543,13 +1536,13 @@ function readDoubleQuotedScalar(state, nodeIndent) { state.position++; captureStart = captureEnd = state.position; - while (0 !== (ch = state.input.charCodeAt(state.position))) { - if (0x22/* " */ === ch) { + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x22/* " */) { captureSegment(state, captureStart, state.position, true); state.position++; return true; - } else if (0x5C/* \ */ === ch) { + } else if (ch === 0x5C/* \ */) { captureSegment(state, captureStart, state.position, true); ch = state.input.charCodeAt(++state.position); @@ -1614,6 +1607,7 @@ function readFlowCollection(state, nodeIndent) { isPair, isExplicitPair, isMapping, + overridableKeys = {}, keyNode, keyTag, valueNode, @@ -1633,13 +1627,13 @@ function readFlowCollection(state, nodeIndent) { return false; } - if (null !== state.anchor) { + if (state.anchor !== null) { state.anchorMap[state.anchor] = _result; } ch = state.input.charCodeAt(++state.position); - while (0 !== ch) { + while (ch !== 0) { skipSeparationSpace(state, true, nodeIndent); ch = state.input.charCodeAt(state.position); @@ -1658,7 +1652,7 @@ function readFlowCollection(state, nodeIndent) { keyTag = keyNode = valueNode = null; isPair = isExplicitPair = false; - if (0x3F/* ? */ === ch) { + if (ch === 0x3F/* ? */) { following = state.input.charCodeAt(state.position + 1); if (is_WS_OR_EOL(following)) { @@ -1676,7 +1670,7 @@ function readFlowCollection(state, nodeIndent) { ch = state.input.charCodeAt(state.position); - if ((isExplicitPair || state.line === _line) && 0x3A/* : */ === ch) { + if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { isPair = true; ch = state.input.charCodeAt(++state.position); skipSeparationSpace(state, true, nodeIndent); @@ -1685,9 +1679,9 @@ function readFlowCollection(state, nodeIndent) { } if (isMapping) { - storeMappingPair(state, _result, keyTag, keyNode, valueNode); + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode); } else if (isPair) { - _result.push(storeMappingPair(state, null, keyTag, keyNode, valueNode)); + _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode)); } else { _result.push(keyNode); } @@ -1696,7 +1690,7 @@ function readFlowCollection(state, nodeIndent) { ch = state.input.charCodeAt(state.position); - if (0x2C/* , */ === ch) { + if (ch === 0x2C/* , */) { readNext = true; ch = state.input.charCodeAt(++state.position); } else { @@ -1731,12 +1725,12 @@ function readBlockScalar(state, nodeIndent) { state.kind = 'scalar'; state.result = ''; - while (0 !== ch) { + while (ch !== 0) { ch = state.input.charCodeAt(++state.position); - if (0x2B/* + */ === ch || 0x2D/* - */ === ch) { + if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { if (CHOMPING_CLIP === chomping) { - chomping = (0x2B/* + */ === ch) ? CHOMPING_KEEP : CHOMPING_STRIP; + chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; } else { throwError(state, 'repeat of a chomping mode identifier'); } @@ -1760,20 +1754,20 @@ function readBlockScalar(state, nodeIndent) { do { ch = state.input.charCodeAt(++state.position); } while (is_WHITE_SPACE(ch)); - if (0x23/* # */ === ch) { + if (ch === 0x23/* # */) { do { ch = state.input.charCodeAt(++state.position); } - while (!is_EOL(ch) && (0 !== ch)); + while (!is_EOL(ch) && (ch !== 0)); } } - while (0 !== ch) { + while (ch !== 0) { readLineBreak(state); state.lineIndent = 0; ch = state.input.charCodeAt(state.position); while ((!detectedIndent || state.lineIndent < textIndent) && - (0x20/* Space */ === ch)) { + (ch === 0x20/* Space */)) { state.lineIndent++; ch = state.input.charCodeAt(++state.position); } @@ -1817,7 +1811,7 @@ function readBlockScalar(state, nodeIndent) { state.result += common.repeat('\n', emptyLines + 1); // Just one line break - perceive as the same line. - } else if (0 === emptyLines) { + } else if (emptyLines === 0) { if (detectedIndent) { // i.e. only if we have already read some scalar content. state.result += ' '; } @@ -1833,13 +1827,14 @@ function readBlockScalar(state, nodeIndent) { state.result += common.repeat('\n', emptyLines + 1); } else { // In case of the first content line - count only empty lines. + state.result += common.repeat('\n', emptyLines); } detectedIndent = true; emptyLines = 0; captureStart = state.position; - while (!is_EOL(ch) && (0 !== ch)) { + while (!is_EOL(ch) && (ch !== 0)) { ch = state.input.charCodeAt(++state.position); } @@ -1858,15 +1853,15 @@ function readBlockSequence(state, nodeIndent) { detected = false, ch; - if (null !== state.anchor) { + if (state.anchor !== null) { state.anchorMap[state.anchor] = _result; } ch = state.input.charCodeAt(state.position); - while (0 !== ch) { + while (ch !== 0) { - if (0x2D/* - */ !== ch) { + if (ch !== 0x2D/* - */) { break; } @@ -1894,7 +1889,7 @@ function readBlockSequence(state, nodeIndent) { ch = state.input.charCodeAt(state.position); - if ((state.line === _line || state.lineIndent > nodeIndent) && (0 !== ch)) { + if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { throwError(state, 'bad indentation of a sequence entry'); } else if (state.lineIndent < nodeIndent) { break; @@ -1918,6 +1913,7 @@ function readBlockMapping(state, nodeIndent, flowIndent) { _tag = state.tag, _anchor = state.anchor, _result = {}, + overridableKeys = {}, keyTag = null, keyNode = null, valueNode = null, @@ -1925,13 +1921,13 @@ function readBlockMapping(state, nodeIndent, flowIndent) { detected = false, ch; - if (null !== state.anchor) { + if (state.anchor !== null) { state.anchorMap[state.anchor] = _result; } ch = state.input.charCodeAt(state.position); - while (0 !== ch) { + while (ch !== 0) { following = state.input.charCodeAt(state.position + 1); _line = state.line; // Save the current line. @@ -1939,11 +1935,11 @@ function readBlockMapping(state, nodeIndent, flowIndent) { // Explicit notation case. There are two separate blocks: // first for the key (denoted by "?") and second for the value (denoted by ":") // - if ((0x3F/* ? */ === ch || 0x3A/* : */ === ch) && is_WS_OR_EOL(following)) { + if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { - if (0x3F/* ? */ === ch) { + if (ch === 0x3F/* ? */) { if (atExplicitKey) { - storeMappingPair(state, _result, keyTag, keyNode, null); + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); keyTag = keyNode = valueNode = null; } @@ -1975,7 +1971,7 @@ function readBlockMapping(state, nodeIndent, flowIndent) { ch = state.input.charCodeAt(++state.position); } - if (0x3A/* : */ === ch) { + if (ch === 0x3A/* : */) { ch = state.input.charCodeAt(++state.position); if (!is_WS_OR_EOL(ch)) { @@ -1983,7 +1979,7 @@ function readBlockMapping(state, nodeIndent, flowIndent) { } if (atExplicitKey) { - storeMappingPair(state, _result, keyTag, keyNode, null); + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); keyTag = keyNode = valueNode = null; } @@ -2028,7 +2024,7 @@ function readBlockMapping(state, nodeIndent, flowIndent) { } if (!atExplicitKey) { - storeMappingPair(state, _result, keyTag, keyNode, valueNode); + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode); keyTag = keyNode = valueNode = null; } @@ -2036,7 +2032,7 @@ function readBlockMapping(state, nodeIndent, flowIndent) { ch = state.input.charCodeAt(state.position); } - if (state.lineIndent > nodeIndent && (0 !== ch)) { + if (state.lineIndent > nodeIndent && (ch !== 0)) { throwError(state, 'bad indentation of a mapping entry'); } else if (state.lineIndent < nodeIndent) { break; @@ -2049,7 +2045,7 @@ function readBlockMapping(state, nodeIndent, flowIndent) { // Special case: last mapping's node contains only the key in explicit notation. if (atExplicitKey) { - storeMappingPair(state, _result, keyTag, keyNode, null); + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); } // Expose the resulting mapping. @@ -2073,21 +2069,19 @@ function readTagProperty(state) { ch = state.input.charCodeAt(state.position); - if (0x21/* ! */ !== ch) { - return false; - } + if (ch !== 0x21/* ! */) return false; - if (null !== state.tag) { + if (state.tag !== null) { throwError(state, 'duplication of a tag property'); } ch = state.input.charCodeAt(++state.position); - if (0x3C/* < */ === ch) { + if (ch === 0x3C/* < */) { isVerbatim = true; ch = state.input.charCodeAt(++state.position); - } else if (0x21/* ! */ === ch) { + } else if (ch === 0x21/* ! */) { isNamed = true; tagHandle = '!!'; ch = state.input.charCodeAt(++state.position); @@ -2100,7 +2094,7 @@ function readTagProperty(state) { if (isVerbatim) { do { ch = state.input.charCodeAt(++state.position); } - while (0 !== ch && 0x3E/* > */ !== ch); + while (ch !== 0 && ch !== 0x3E/* > */); if (state.position < state.length) { tagName = state.input.slice(_position, state.position); @@ -2109,9 +2103,9 @@ function readTagProperty(state) { throwError(state, 'unexpected end of the stream within a verbatim tag'); } } else { - while (0 !== ch && !is_WS_OR_EOL(ch)) { + while (ch !== 0 && !is_WS_OR_EOL(ch)) { - if (0x21/* ! */ === ch) { + if (ch === 0x21/* ! */) { if (!isNamed) { tagHandle = state.input.slice(_position - 1, state.position + 1); @@ -2146,10 +2140,10 @@ function readTagProperty(state) { } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { state.tag = state.tagMap[tagHandle] + tagName; - } else if ('!' === tagHandle) { + } else if (tagHandle === '!') { state.tag = '!' + tagName; - } else if ('!!' === tagHandle) { + } else if (tagHandle === '!!') { state.tag = 'tag:yaml.org,2002:' + tagName; } else { @@ -2165,18 +2159,16 @@ function readAnchorProperty(state) { ch = state.input.charCodeAt(state.position); - if (0x26/* & */ !== ch) { - return false; - } + if (ch !== 0x26/* & */) return false; - if (null !== state.anchor) { + if (state.anchor !== null) { throwError(state, 'duplication of an anchor property'); } ch = state.input.charCodeAt(++state.position); _position = state.position; - while (0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { ch = state.input.charCodeAt(++state.position); } @@ -2190,20 +2182,16 @@ function readAnchorProperty(state) { function readAlias(state) { var _position, alias, - len = state.length, - input = state.input, ch; ch = state.input.charCodeAt(state.position); - if (0x2A/* * */ !== ch) { - return false; - } + if (ch !== 0x2A/* * */) return false; ch = state.input.charCodeAt(++state.position); _position = state.position; - while (0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { ch = state.input.charCodeAt(++state.position); } @@ -2233,8 +2221,11 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact typeQuantity, type, flowIndent, - blockIndent, - _result; + blockIndent; + + if (state.listener !== null) { + state.listener('open', state); + } state.tag = null; state.anchor = null; @@ -2259,7 +2250,7 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact } } - if (1 === indentStatus) { + if (indentStatus === 1) { while (readTagProperty(state) || readAnchorProperty(state)) { if (skipSeparationSpace(state, true, -1)) { atNewLine = true; @@ -2282,7 +2273,7 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact allowBlockCollections = atNewLine || allowCompact; } - if (1 === indentStatus || CONTEXT_BLOCK_OUT === nodeContext) { + if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { flowIndent = parentIndent; } else { @@ -2291,7 +2282,7 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact blockIndent = state.position - state.lineStart; - if (1 === indentStatus) { + if (indentStatus === 1) { if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || @@ -2306,31 +2297,31 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact } else if (readAlias(state)) { hasContent = true; - if (null !== state.tag || null !== state.anchor) { + if (state.tag !== null || state.anchor !== null) { throwError(state, 'alias node should not have any properties'); } } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { hasContent = true; - if (null === state.tag) { + if (state.tag === null) { state.tag = '?'; } } - if (null !== state.anchor) { + if (state.anchor !== null) { state.anchorMap[state.anchor] = state.result; } } - } else if (0 === indentStatus) { + } else if (indentStatus === 0) { // Special case: block sequences are allowed to have same indentation level as the parent. // http://www.yaml.org/spec/1.2/spec.html#id2799784 hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); } } - if (null !== state.tag && '!' !== state.tag) { - if ('?' === state.tag) { + if (state.tag !== null && state.tag !== '!') { + if (state.tag === '?') { for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { @@ -2343,7 +2334,7 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact if (type.resolve(state.result)) { // `state.result` updated in resolver if matched state.result = type.construct(state.result); state.tag = type.tag; - if (null !== state.anchor) { + if (state.anchor !== null) { state.anchorMap[state.anchor] = state.result; } break; @@ -2352,7 +2343,7 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact } else if (_hasOwnProperty.call(state.typeMap, state.tag)) { type = state.typeMap[state.tag]; - if (null !== state.result && type.kind !== state.kind) { + if (state.result !== null && type.kind !== state.kind) { throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); } @@ -2360,16 +2351,19 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); } else { state.result = type.construct(state.result); - if (null !== state.anchor) { + if (state.anchor !== null) { state.anchorMap[state.anchor] = state.result; } } } else { - throwWarning(state, 'unknown tag !<' + state.tag + '>'); + throwError(state, 'unknown tag !<' + state.tag + '>'); } } - return null !== state.tag || null !== state.anchor || hasContent; + if (state.listener !== null) { + state.listener('close', state); + } + return state.tag !== null || state.anchor !== null || hasContent; } function readDocument(state) { @@ -2385,12 +2379,12 @@ function readDocument(state) { state.tagMap = {}; state.anchorMap = {}; - while (0 !== (ch = state.input.charCodeAt(state.position))) { + while ((ch = state.input.charCodeAt(state.position)) !== 0) { skipSeparationSpace(state, true, -1); ch = state.input.charCodeAt(state.position); - if (state.lineIndent > 0 || 0x25/* % */ !== ch) { + if (state.lineIndent > 0 || ch !== 0x25/* % */) { break; } @@ -2398,7 +2392,7 @@ function readDocument(state) { ch = state.input.charCodeAt(++state.position); _position = state.position; - while (0 !== ch && !is_WS_OR_EOL(ch)) { + while (ch !== 0 && !is_WS_OR_EOL(ch)) { ch = state.input.charCodeAt(++state.position); } @@ -2409,33 +2403,29 @@ function readDocument(state) { throwError(state, 'directive name must not be less than one character in length'); } - while (0 !== ch) { + while (ch !== 0) { while (is_WHITE_SPACE(ch)) { ch = state.input.charCodeAt(++state.position); } - if (0x23/* # */ === ch) { + if (ch === 0x23/* # */) { do { ch = state.input.charCodeAt(++state.position); } - while (0 !== ch && !is_EOL(ch)); + while (ch !== 0 && !is_EOL(ch)); break; } - if (is_EOL(ch)) { - break; - } + if (is_EOL(ch)) break; _position = state.position; - while (0 !== ch && !is_WS_OR_EOL(ch)) { + while (ch !== 0 && !is_WS_OR_EOL(ch)) { ch = state.input.charCodeAt(++state.position); } directiveArgs.push(state.input.slice(_position, state.position)); } - if (0 !== ch) { - readLineBreak(state); - } + if (ch !== 0) readLineBreak(state); if (_hasOwnProperty.call(directiveHandlers, directiveName)) { directiveHandlers[directiveName](state, directiveName, directiveArgs); @@ -2446,10 +2436,10 @@ function readDocument(state) { skipSeparationSpace(state, true, -1); - if (0 === state.lineIndent && - 0x2D/* - */ === state.input.charCodeAt(state.position) && - 0x2D/* - */ === state.input.charCodeAt(state.position + 1) && - 0x2D/* - */ === state.input.charCodeAt(state.position + 2)) { + if (state.lineIndent === 0 && + state.input.charCodeAt(state.position) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { state.position += 3; skipSeparationSpace(state, true, -1); @@ -2469,7 +2459,7 @@ function readDocument(state) { if (state.position === state.lineStart && testDocumentSeparator(state)) { - if (0x2E/* . */ === state.input.charCodeAt(state.position)) { + if (state.input.charCodeAt(state.position) === 0x2E/* . */) { state.position += 3; skipSeparationSpace(state, true, -1); } @@ -2491,8 +2481,8 @@ function loadDocuments(input, options) { if (input.length !== 0) { // Add tailing `\n` if not exists - if (0x0A/* LF */ !== input.charCodeAt(input.length - 1) && - 0x0D/* CR */ !== input.charCodeAt(input.length - 1)) { + if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && + input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { input += '\n'; } @@ -2504,14 +2494,10 @@ function loadDocuments(input, options) { var state = new State(input, options); - if (PATTERN_NON_PRINTABLE.test(state.input)) { - throwError(state, 'the stream contains non-printable characters'); - } - // Use 0 as string terminator. That significantly simplifies bounds check. state.input += '\0'; - while (0x20/* Space */ === state.input.charCodeAt(state.position)) { + while (state.input.charCodeAt(state.position) === 0x20/* Space */) { state.lineIndent += 1; state.position += 1; } @@ -2534,12 +2520,12 @@ function loadAll(input, iterator, options) { function load(input, options) { - var documents = loadDocuments(input, options), index, length; + var documents = loadDocuments(input, options); - if (0 === documents.length) { + if (documents.length === 0) { /*eslint-disable no-undefined*/ return undefined; - } else if (1 === documents.length) { + } else if (documents.length === 1) { return documents[0]; } throw new YAMLException('expected a single document in the stream, but found more'); @@ -2580,9 +2566,7 @@ function Mark(name, buffer, position, line, column) { Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { var head, start, tail, end, snippet; - if (!this.buffer) { - return null; - } + if (!this.buffer) return null; indent = indent || 4; maxLength = maxLength || 75; @@ -2590,7 +2574,7 @@ Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { head = ''; start = this.position; - while (start > 0 && -1 === '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1))) { + while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) { start -= 1; if (this.position - start > (maxLength / 2 - 1)) { head = ' ... '; @@ -2602,7 +2586,7 @@ Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { tail = ''; end = this.position; - while (end < this.buffer.length && -1 === '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end))) { + while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) { end += 1; if (end - this.position > (maxLength / 2 - 1)) { tail = ' ... '; @@ -2669,7 +2653,7 @@ function compileList(schema, name, result) { }); return result.filter(function (type, index) { - return -1 === exclude.indexOf(index); + return exclude.indexOf(index) === -1; }); } @@ -2695,7 +2679,7 @@ function Schema(definition) { this.explicit = definition.explicit || []; this.implicit.forEach(function (type) { - if (type.loadKind && 'scalar' !== type.loadKind) { + if (type.loadKind && type.loadKind !== 'scalar') { throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); } }); @@ -2713,18 +2697,18 @@ Schema.create = function createSchema() { var schemas, types; switch (arguments.length) { - case 1: - schemas = Schema.DEFAULT; - types = arguments[0]; - break; + case 1: + schemas = Schema.DEFAULT; + types = arguments[0]; + break; - case 2: - schemas = arguments[0]; - types = arguments[1]; - break; + case 2: + schemas = arguments[0]; + types = arguments[1]; + break; - default: - throw new YAMLException('Wrong number of arguments for Schema.create function'); + default: + throw new YAMLException('Wrong number of arguments for Schema.create function'); } schemas = common.toArray(schemas); @@ -2895,7 +2879,7 @@ var YAML_NODE_KINDS = [ function compileStyleAliases(map) { var result = {}; - if (null !== map) { + if (map !== null) { Object.keys(map).forEach(function (style) { map[style].forEach(function (alias) { result[String(alias)] = style; @@ -2910,7 +2894,7 @@ function Type(tag, options) { options = options || {}; Object.keys(options).forEach(function (name) { - if (-1 === TYPE_CONSTRUCTOR_OPTIONS.indexOf(name)) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); } }); @@ -2926,7 +2910,7 @@ function Type(tag, options) { this.defaultStyle = options['defaultStyle'] || null; this.styleAliases = compileStyleAliases(options['styleAliases'] || null); - if (-1 === YAML_NODE_KINDS.indexOf(this.kind)) { + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); } } @@ -2949,21 +2933,19 @@ var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 function resolveYamlBinary(data) { - if (null === data) { - return false; - } + if (data === null) return false; - var code, idx, bitlen = 0, len = 0, max = data.length, map = BASE64_MAP; + var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; // Convert one by one. for (idx = 0; idx < max; idx++) { code = map.indexOf(data.charAt(idx)); // Skip CR/LF - if (code > 64) { continue; } + if (code > 64) continue; // Fail on illegal characters - if (code < 0) { return false; } + if (code < 0) return false; bitlen += 6; } @@ -2973,7 +2955,7 @@ function resolveYamlBinary(data) { } function constructYamlBinary(data) { - var code, idx, tailbits, + var idx, tailbits, input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan max = input.length, map = BASE64_MAP, @@ -3008,9 +2990,7 @@ function constructYamlBinary(data) { } // Wrap into Buffer for NodeJS and leave Array for browser - if (NodeBuffer) { - return new NodeBuffer(result); - } + if (NodeBuffer) return new NodeBuffer(result); return result; } @@ -3075,9 +3055,7 @@ module.exports = new Type('tag:yaml.org,2002:binary', { var Type = require('../type'); function resolveYamlBoolean(data) { - if (null === data) { - return false; - } + if (data === null) return false; var max = data.length; @@ -3092,7 +3070,7 @@ function constructYamlBoolean(data) { } function isBoolean(object) { - return '[object Boolean]' === Object.prototype.toString.call(object); + return Object.prototype.toString.call(object) === '[object Boolean]'; } module.exports = new Type('tag:yaml.org,2002:bool', { @@ -3122,15 +3100,10 @@ var YAML_FLOAT_PATTERN = new RegExp( '|\\.(?:nan|NaN|NAN))$'); function resolveYamlFloat(data) { - if (null === data) { - return false; - } + if (data === null) return false; - var value, sign, base, digits; + if (!YAML_FLOAT_PATTERN.test(data)) return false; - if (!YAML_FLOAT_PATTERN.test(data)) { - return false; - } return true; } @@ -3138,20 +3111,20 @@ function constructYamlFloat(data) { var value, sign, base, digits; value = data.replace(/_/g, '').toLowerCase(); - sign = '-' === value[0] ? -1 : 1; + sign = value[0] === '-' ? -1 : 1; digits = []; - if (0 <= '+-'.indexOf(value[0])) { + if ('+-'.indexOf(value[0]) >= 0) { value = value.slice(1); } - if ('.inf' === value) { - return (1 === sign) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; + if (value === '.inf') { + return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; - } else if ('.nan' === value) { + } else if (value === '.nan') { return NaN; - } else if (0 <= value.indexOf(':')) { + } else if (value.indexOf(':') >= 0) { value.split(':').forEach(function (v) { digits.unshift(parseFloat(v, 10)); }); @@ -3170,43 +3143,45 @@ function constructYamlFloat(data) { return sign * parseFloat(value, 10); } + +var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; + function representYamlFloat(object, style) { + var res; + if (isNaN(object)) { switch (style) { - case 'lowercase': - return '.nan'; - case 'uppercase': - return '.NAN'; - case 'camelcase': - return '.NaN'; + case 'lowercase': return '.nan'; + case 'uppercase': return '.NAN'; + case 'camelcase': return '.NaN'; } } else if (Number.POSITIVE_INFINITY === object) { switch (style) { - case 'lowercase': - return '.inf'; - case 'uppercase': - return '.INF'; - case 'camelcase': - return '.Inf'; + case 'lowercase': return '.inf'; + case 'uppercase': return '.INF'; + case 'camelcase': return '.Inf'; } } else if (Number.NEGATIVE_INFINITY === object) { switch (style) { - case 'lowercase': - return '-.inf'; - case 'uppercase': - return '-.INF'; - case 'camelcase': - return '-.Inf'; + case 'lowercase': return '-.inf'; + case 'uppercase': return '-.INF'; + case 'camelcase': return '-.Inf'; } } else if (common.isNegativeZero(object)) { return '-0.0'; } - return object.toString(10); + + res = object.toString(10); + + // JS stringifier can build scientific format without dots: 5e-100, + // while YAML requres dot: 5.e-100. Fix it with simple hack + + return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; } function isFloat(object) { - return ('[object Number]' === Object.prototype.toString.call(object)) && - (0 !== object % 1 || common.isNegativeZero(object)); + return (Object.prototype.toString.call(object) === '[object Number]') && + (object % 1 !== 0 || common.isNegativeZero(object)); } module.exports = new Type('tag:yaml.org,2002:float', { @@ -3239,16 +3214,14 @@ function isDecCode(c) { } function resolveYamlInteger(data) { - if (null === data) { - return false; - } + if (data === null) return false; var max = data.length, index = 0, hasDigits = false, ch; - if (!max) { return false; } + if (!max) return false; ch = data[index]; @@ -3259,7 +3232,7 @@ function resolveYamlInteger(data) { if (ch === '0') { // 0 - if (index + 1 === max) { return true; } + if (index + 1 === max) return true; ch = data[++index]; // base 2, base 8, base 16 @@ -3270,10 +3243,8 @@ function resolveYamlInteger(data) { for (; index < max; index++) { ch = data[index]; - if (ch === '_') { continue; } - if (ch !== '0' && ch !== '1') { - return false; - } + if (ch === '_') continue; + if (ch !== '0' && ch !== '1') return false; hasDigits = true; } return hasDigits; @@ -3286,10 +3257,8 @@ function resolveYamlInteger(data) { for (; index < max; index++) { ch = data[index]; - if (ch === '_') { continue; } - if (!isHexCode(data.charCodeAt(index))) { - return false; - } + if (ch === '_') continue; + if (!isHexCode(data.charCodeAt(index))) return false; hasDigits = true; } return hasDigits; @@ -3298,10 +3267,8 @@ function resolveYamlInteger(data) { // base 8 for (; index < max; index++) { ch = data[index]; - if (ch === '_') { continue; } - if (!isOctCode(data.charCodeAt(index))) { - return false; - } + if (ch === '_') continue; + if (!isOctCode(data.charCodeAt(index))) return false; hasDigits = true; } return hasDigits; @@ -3311,18 +3278,18 @@ function resolveYamlInteger(data) { for (; index < max; index++) { ch = data[index]; - if (ch === '_') { continue; } - if (ch === ':') { break; } + if (ch === '_') continue; + if (ch === ':') break; if (!isDecCode(data.charCodeAt(index))) { return false; } hasDigits = true; } - if (!hasDigits) { return false; } + if (!hasDigits) return false; // if !base60 - done; - if (ch !== ':') { return true; } + if (ch !== ':') return true; // base60 almost not used, no needs to optimize return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); @@ -3338,24 +3305,17 @@ function constructYamlInteger(data) { ch = value[0]; if (ch === '-' || ch === '+') { - if (ch === '-') { sign = -1; } + if (ch === '-') sign = -1; value = value.slice(1); ch = value[0]; } - if ('0' === value) { - return 0; - } + if (value === '0') return 0; if (ch === '0') { - if (value[1] === 'b') { - return sign * parseInt(value.slice(2), 2); - } - if (value[1] === 'x') { - return sign * parseInt(value, 16); - } + if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); + if (value[1] === 'x') return sign * parseInt(value, 16); return sign * parseInt(value, 8); - } if (value.indexOf(':') !== -1) { @@ -3379,8 +3339,8 @@ function constructYamlInteger(data) { } function isInteger(object) { - return ('[object Number]' === Object.prototype.toString.call(object)) && - (0 === object % 1 && !common.isNegativeZero(object)); + return (Object.prototype.toString.call(object)) === '[object Number]' && + (object % 1 === 0 && !common.isNegativeZero(object)); } module.exports = new Type('tag:yaml.org,2002:int', { @@ -3416,29 +3376,27 @@ var esprima; // found too - then fail to parse. // try { - esprima = require('esprima'); + // workaround to exclude package from browserify list. + var _require = require; + esprima = _require('esprima'); } catch (_) { /*global window */ - if (typeof window !== 'undefined') { esprima = window.esprima; } + if (typeof window !== 'undefined') esprima = window.esprima; } var Type = require('../../type'); function resolveJavascriptFunction(data) { - if (null === data) { - return false; - } + if (data === null) return false; try { var source = '(' + data + ')', - ast = esprima.parse(source, { range: true }), - params = [], - body; - - if ('Program' !== ast.type || - 1 !== ast.body.length || - 'ExpressionStatement' !== ast.body[0].type || - 'FunctionExpression' !== ast.body[0].expression.type) { + ast = esprima.parse(source, { range: true }); + + if (ast.type !== 'Program' || + ast.body.length !== 1 || + ast.body[0].type !== 'ExpressionStatement' || + ast.body[0].expression.type !== 'FunctionExpression') { return false; } @@ -3456,10 +3414,10 @@ function constructJavascriptFunction(data) { params = [], body; - if ('Program' !== ast.type || - 1 !== ast.body.length || - 'ExpressionStatement' !== ast.body[0].type || - 'FunctionExpression' !== ast.body[0].expression.type) { + if (ast.type !== 'Program' || + ast.body.length !== 1 || + ast.body[0].type !== 'ExpressionStatement' || + ast.body[0].expression.type !== 'FunctionExpression') { throw new Error('Failed to resolve function'); } @@ -3480,7 +3438,7 @@ function representJavascriptFunction(object /*, style*/) { } function isFunction(object) { - return '[object Function]' === Object.prototype.toString.call(object); + return Object.prototype.toString.call(object) === '[object Function]'; } module.exports = new Type('tag:yaml.org,2002:js/function', { @@ -3491,19 +3449,14 @@ module.exports = new Type('tag:yaml.org,2002:js/function', { represent: representJavascriptFunction }); -},{"../../type":13,"esprima":"esprima"}],19:[function(require,module,exports){ +},{"../../type":13}],19:[function(require,module,exports){ 'use strict'; var Type = require('../../type'); function resolveJavascriptRegExp(data) { - if (null === data) { - return false; - } - - if (0 === data.length) { - return false; - } + if (data === null) return false; + if (data.length === 0) return false; var regexp = data, tail = /\/([gim]*)$/.exec(data), @@ -3511,24 +3464,15 @@ function resolveJavascriptRegExp(data) { // if regexp starts with '/' it can have modifiers and must be properly closed // `/foo/gim` - modifiers tail can be maximum 3 chars - if ('/' === regexp[0]) { - if (tail) { - modifiers = tail[1]; - } + if (regexp[0] === '/') { + if (tail) modifiers = tail[1]; - if (modifiers.length > 3) { return false; } + if (modifiers.length > 3) return false; // if expression starts with /, is should be properly terminated - if (regexp[regexp.length - modifiers.length - 1] !== '/') { return false; } - - regexp = regexp.slice(1, regexp.length - modifiers.length - 1); + if (regexp[regexp.length - modifiers.length - 1] !== '/') return false; } - try { - var dummy = new RegExp(regexp, modifiers); - return true; - } catch (error) { - return false; - } + return true; } function constructJavascriptRegExp(data) { @@ -3537,10 +3481,8 @@ function constructJavascriptRegExp(data) { modifiers = ''; // `/foo/gim` - tail can be maximum 4 chars - if ('/' === regexp[0]) { - if (tail) { - modifiers = tail[1]; - } + if (regexp[0] === '/') { + if (tail) modifiers = tail[1]; regexp = regexp.slice(1, regexp.length - modifiers.length - 1); } @@ -3550,23 +3492,15 @@ function constructJavascriptRegExp(data) { function representJavascriptRegExp(object /*, style*/) { var result = '/' + object.source + '/'; - if (object.global) { - result += 'g'; - } - - if (object.multiline) { - result += 'm'; - } - - if (object.ignoreCase) { - result += 'i'; - } + if (object.global) result += 'g'; + if (object.multiline) result += 'm'; + if (object.ignoreCase) result += 'i'; return result; } function isRegExp(object) { - return '[object RegExp]' === Object.prototype.toString.call(object); + return Object.prototype.toString.call(object) === '[object RegExp]'; } module.exports = new Type('tag:yaml.org,2002:js/regexp', { @@ -3596,7 +3530,7 @@ function representJavascriptUndefined() { } function isUndefined(object) { - return 'undefined' === typeof object; + return typeof object === 'undefined'; } module.exports = new Type('tag:yaml.org,2002:js/undefined', { @@ -3614,7 +3548,7 @@ var Type = require('../type'); module.exports = new Type('tag:yaml.org,2002:map', { kind: 'mapping', - construct: function (data) { return null !== data ? data : {}; } + construct: function (data) { return data !== null ? data : {}; } }); },{"../type":13}],22:[function(require,module,exports){ @@ -3623,7 +3557,7 @@ module.exports = new Type('tag:yaml.org,2002:map', { var Type = require('../type'); function resolveYamlMerge(data) { - return '<<' === data || null === data; + return data === '<<' || data === null; } module.exports = new Type('tag:yaml.org,2002:merge', { @@ -3637,9 +3571,7 @@ module.exports = new Type('tag:yaml.org,2002:merge', { var Type = require('../type'); function resolveYamlNull(data) { - if (null === data) { - return true; - } + if (data === null) return true; var max = data.length; @@ -3652,7 +3584,7 @@ function constructYamlNull() { } function isNull(object) { - return null === object; + return object === null; } module.exports = new Type('tag:yaml.org,2002:null', { @@ -3678,9 +3610,7 @@ var _hasOwnProperty = Object.prototype.hasOwnProperty; var _toString = Object.prototype.toString; function resolveYamlOmap(data) { - if (null === data) { - return true; - } + if (data === null) return true; var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data; @@ -3689,36 +3619,26 @@ function resolveYamlOmap(data) { pair = object[index]; pairHasKey = false; - if ('[object Object]' !== _toString.call(pair)) { - return false; - } + if (_toString.call(pair) !== '[object Object]') return false; for (pairKey in pair) { if (_hasOwnProperty.call(pair, pairKey)) { - if (!pairHasKey) { - pairHasKey = true; - } else { - return false; - } + if (!pairHasKey) pairHasKey = true; + else return false; } } - if (!pairHasKey) { - return false; - } + if (!pairHasKey) return false; - if (-1 === objectKeys.indexOf(pairKey)) { - objectKeys.push(pairKey); - } else { - return false; - } + if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); + else return false; } return true; } function constructYamlOmap(data) { - return null !== data ? data : []; + return data !== null ? data : []; } module.exports = new Type('tag:yaml.org,2002:omap', { @@ -3735,9 +3655,7 @@ var Type = require('../type'); var _toString = Object.prototype.toString; function resolveYamlPairs(data) { - if (null === data) { - return true; - } + if (data === null) return true; var index, length, pair, keys, result, object = data; @@ -3747,15 +3665,11 @@ function resolveYamlPairs(data) { for (index = 0, length = object.length; index < length; index += 1) { pair = object[index]; - if ('[object Object]' !== _toString.call(pair)) { - return false; - } + if (_toString.call(pair) !== '[object Object]') return false; keys = Object.keys(pair); - if (1 !== keys.length) { - return false; - } + if (keys.length !== 1) return false; result[index] = [ keys[0], pair[keys[0]] ]; } @@ -3764,9 +3678,7 @@ function resolveYamlPairs(data) { } function constructYamlPairs(data) { - if (null === data) { - return []; - } + if (data === null) return []; var index, length, pair, keys, result, object = data; @@ -3797,7 +3709,7 @@ var Type = require('../type'); module.exports = new Type('tag:yaml.org,2002:seq', { kind: 'sequence', - construct: function (data) { return null !== data ? data : []; } + construct: function (data) { return data !== null ? data : []; } }); },{"../type":13}],27:[function(require,module,exports){ @@ -3808,17 +3720,13 @@ var Type = require('../type'); var _hasOwnProperty = Object.prototype.hasOwnProperty; function resolveYamlSet(data) { - if (null === data) { - return true; - } + if (data === null) return true; var key, object = data; for (key in object) { if (_hasOwnProperty.call(object, key)) { - if (null !== object[key]) { - return false; - } + if (object[key] !== null) return false; } } @@ -3826,7 +3734,7 @@ function resolveYamlSet(data) { } function constructYamlSet(data) { - return null !== data ? data : {}; + return data !== null ? data : {}; } module.exports = new Type('tag:yaml.org,2002:set', { @@ -3842,7 +3750,7 @@ var Type = require('../type'); module.exports = new Type('tag:yaml.org,2002:str', { kind: 'scalar', - construct: function (data) { return null !== data ? data : ''; } + construct: function (data) { return data !== null ? data : ''; } }); },{"../type":13}],29:[function(require,module,exports){ @@ -3850,44 +3758,38 @@ module.exports = new Type('tag:yaml.org,2002:str', { var Type = require('../type'); +var YAML_DATE_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9])' + // [2] month + '-([0-9][0-9])$'); // [3] day + var YAML_TIMESTAMP_REGEXP = new RegExp( '^([0-9][0-9][0-9][0-9])' + // [1] year '-([0-9][0-9]?)' + // [2] month '-([0-9][0-9]?)' + // [3] day - '(?:(?:[Tt]|[ \\t]+)' + // ... + '(?:[Tt]|[ \\t]+)' + // ... '([0-9][0-9]?)' + // [4] hour ':([0-9][0-9])' + // [5] minute ':([0-9][0-9])' + // [6] second '(?:\\.([0-9]*))?' + // [7] fraction '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour - '(?::([0-9][0-9]))?))?)?$'); // [11] tz_minute + '(?::([0-9][0-9]))?))?$'); // [11] tz_minute function resolveYamlTimestamp(data) { - if (null === data) { - return false; - } - - var match, year, month, day, hour, minute, second, fraction = 0, - delta = null, tz_hour, tz_minute, date; - - match = YAML_TIMESTAMP_REGEXP.exec(data); - - if (null === match) { - return false; - } - - return true; + if (data === null) return false; + if (YAML_DATE_REGEXP.exec(data) !== null) return true; + if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; + return false; } function constructYamlTimestamp(data) { var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date; - match = YAML_TIMESTAMP_REGEXP.exec(data); + match = YAML_DATE_REGEXP.exec(data); + if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); - if (null === match) { - throw new Error('Date resolve error'); - } + if (match === null) throw new Error('Date resolve error'); // match: [1] year [2] month [3] day @@ -3919,16 +3821,12 @@ function constructYamlTimestamp(data) { tz_hour = +(match[10]); tz_minute = +(match[11] || 0); delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds - if ('-' === match[9]) { - delta = -delta; - } + if (match[9] === '-') delta = -delta; } date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); - if (delta) { - date.setTime(date.getTime() - delta); - } + if (delta) date.setTime(date.getTime() - delta); return date; } diff --git a/tools/eslint/node_modules/js-yaml/dist/js-yaml.min.js b/tools/eslint/node_modules/js-yaml/dist/js-yaml.min.js new file mode 100644 index 00000000000000..c2ada83a1acee6 --- /dev/null +++ b/tools/eslint/node_modules/js-yaml/dist/js-yaml.min.js @@ -0,0 +1,3 @@ +/* js-yaml 3.5.5 https://github.com/nodeca/js-yaml */ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.jsyaml=e()}}(function(){return function e(t,n,i){function r(a,s){if(!n[a]){if(!t[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=n[a]={exports:{}};t[a][0].call(l.exports,function(e){var n=t[a][1][e];return r(n?n:e)},l,l.exports,e,t,n,i)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;an;n+=1)r=o[n],e[r]=t[r];return e}function s(e,t){var n,i="";for(n=0;t>n;n+=1)i+=e;return i}function c(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e}t.exports.isNothing=i,t.exports.isObject=r,t.exports.toArray=o,t.exports.repeat=s,t.exports.isNegativeZero=c,t.exports.extend=a},{}],3:[function(e,t,n){"use strict";function i(e,t){var n,i,r,o,a,s,c;if(null===t)return{};for(n={},i=Object.keys(t),r=0,o=i.length;o>r;r+=1)a=i[r],s=String(t[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),c=e.compiledTypeMap[a],c&&F.call(c.styleAliases,s)&&(s=c.styleAliases[s]),n[a]=s;return n}function r(e){var t,n,i;if(t=e.toString(16).toUpperCase(),255>=e)n="x",i=2;else if(65535>=e)n="u",i=4;else{if(!(4294967295>=e))throw new I("code point within a string may not be greater than 0xFFFFFFFF");n="U",i=8}return"\\"+n+j.repeat("0",i-t.length)+t}function o(e){this.schema=e.schema||S,this.indent=Math.max(1,e.indent||2),this.skipInvalid=e.skipInvalid||!1,this.flowLevel=j.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=i(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function a(e,t){for(var n,i=j.repeat(" ",t),r=0,o=-1,a="",s=e.length;s>r;)o=e.indexOf("\n",r),-1===o?(n=e.slice(r),r=s):(n=e.slice(r,o+1),r=o+1),n.length&&"\n"!==n&&(a+=i),a+=n;return a}function s(e,t){return"\n"+j.repeat(" ",e.indent*t)}function c(e,t){var n,i,r;for(n=0,i=e.implicitTypes.length;i>n;n+=1)if(r=e.implicitTypes[n],r.resolve(t))return!0;return!1}function u(e){this.source=e,this.result="",this.checkpoint=0}function l(e,t,n,i){var r,o,s,l,f,m,g,y,x,v,A,b,w,C,k,j,I,S,E,O,F;if(0===t.length)return void(e.dump="''");if(!e.noCompatMode&&-1!==te.indexOf(t))return void(e.dump="'"+t+"'");for(r=!0,o=t.length?t.charCodeAt(0):0,s=M===o||M===t.charCodeAt(t.length-1),P!==o&&W!==o&&G!==o&&z!==o||(r=!1),s||e.flowLevel>-1&&e.flowLevel<=n?(s&&(r=!1),l=!1,f=!1):(l=!i,f=!i),m=!0,g=new u(t),y=!1,x=0,v=0,A=e.indent*n,b=e.lineWidth,-1===b&&(b=9007199254740991),40>A?b-=A:b=40,C=0;C0&&(I=t.charCodeAt(C-1),I===M&&(f=!1,l=!1)),l&&(S=C-x,x=C,S>v&&(v=S))),w!==D&&(m=!1),g.takeUpTo(C),g.escapeChar())}if(r&&c(e,t)&&(r=!1),E="",(l||f)&&(O=0,t.charCodeAt(t.length-1)===T&&(O+=1,t.charCodeAt(t.length-2)===T&&(O+=1)),0===O?E="-":2===O&&(E="+")),(f&&b>v||null!==e.tag)&&(l=!1),y||(f=!1),r)e.dump=t;else if(m)e.dump="'"+t+"'";else if(l)F=p(t,b),e.dump=">"+E+"\n"+a(F,A);else if(f)E||(t=t.replace(/\n$/,"")),e.dump="|"+E+"\n"+a(t,A);else{if(!g)throw new Error("Failed to dump scalar value");g.finish(),e.dump='"'+g.result+'"'}}function p(e,t){var n,i="",r=0,o=e.length,a=/\n+$/.exec(e);for(a&&(o=a.index+1);o>r;)n=e.indexOf("\n",r),n>o||-1===n?(i&&(i+="\n\n"),i+=f(e.slice(r,o),t),r=o):(i&&(i+="\n\n"),i+=f(e.slice(r,n),t),r=n+1);return a&&"\n"!==a[0]&&(i+=a[0]),i}function f(e,t){if(""===e)return e;for(var n,i,r,o=/[^\s] [^\s]/g,a="",s=0,c=0,u=o.exec(e);u;)n=u.index,n-c>t&&(i=s!==c?s:n,a&&(a+="\n"),r=e.slice(c,i),a+=r,c=i+1),s=n+1,u=o.exec(e);return a&&(a+="\n"),a+=c!==s&&e.length-c>t?e.slice(c,s)+"\n"+e.slice(s+1):e.slice(c)}function h(e){return N!==e&&T!==e&&_!==e&&B!==e&&V!==e&&Z!==e&&J!==e&&X!==e&&U!==e&&Y!==e&&$!==e&&L!==e&&Q!==e&&H!==e&&R!==e&&D!==e&&q!==e&&K!==e&&!ee[e]&&!d(e)}function d(e){return!(e>=32&&126>=e||133===e||e>=160&&55295>=e||e>=57344&&65533>=e||e>=65536&&1114111>=e)}function m(e,t,n){var i,r,o="",a=e.tag;for(i=0,r=n.length;r>i;i+=1)A(e,t,n[i],!1,!1)&&(0!==i&&(o+=", "),o+=e.dump);e.tag=a,e.dump="["+o+"]"}function g(e,t,n,i){var r,o,a="",c=e.tag;for(r=0,o=n.length;o>r;r+=1)A(e,t+1,n[r],!0,!0)&&(i&&0===r||(a+=s(e,t)),a+="- "+e.dump);e.tag=c,e.dump=a||"[]"}function y(e,t,n){var i,r,o,a,s,c="",u=e.tag,l=Object.keys(n);for(i=0,r=l.length;r>i;i+=1)s="",0!==i&&(s+=", "),o=l[i],a=n[o],A(e,t,o,!1,!1)&&(e.dump.length>1024&&(s+="? "),s+=e.dump+": ",A(e,t,a,!1,!1)&&(s+=e.dump,c+=s));e.tag=u,e.dump="{"+c+"}"}function x(e,t,n,i){var r,o,a,c,u,l,p="",f=e.tag,h=Object.keys(n);if(e.sortKeys===!0)h.sort();else if("function"==typeof e.sortKeys)h.sort(e.sortKeys);else if(e.sortKeys)throw new I("sortKeys must be a boolean or a function");for(r=0,o=h.length;o>r;r+=1)l="",i&&0===r||(l+=s(e,t)),a=h[r],c=n[a],A(e,t+1,a,!0,!0,!0)&&(u=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024,u&&(l+=e.dump&&T===e.dump.charCodeAt(0)?"?":"? "),l+=e.dump,u&&(l+=s(e,t)),A(e,t+1,c,!0,u)&&(l+=e.dump&&T===e.dump.charCodeAt(0)?":":": ",l+=e.dump,p+=l));e.tag=f,e.dump=p||"{}"}function v(e,t,n){var i,r,o,a,s,c;for(r=n?e.explicitTypes:e.implicitTypes,o=0,a=r.length;a>o;o+=1)if(s=r[o],(s.instanceOf||s.predicate)&&(!s.instanceOf||"object"==typeof t&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(e.tag=n?s.tag:"?",s.represent){if(c=e.styleMap[s.tag]||s.defaultStyle,"[object Function]"===O.call(s.represent))i=s.represent(t,c);else{if(!F.call(s.represent,c))throw new I("!<"+s.tag+'> tag resolver accepts not "'+c+'" style');i=s.represent[c](t,c)}e.dump=i}return!0}return!1}function A(e,t,n,i,r,o){e.tag=null,e.dump=n,v(e,n,!1)||v(e,n,!0);var a=O.call(e.dump);i&&(i=e.flowLevel<0||e.flowLevel>t);var s,c,u="[object Object]"===a||"[object Array]"===a;if(u&&(s=e.duplicates.indexOf(n),c=-1!==s),(null!==e.tag&&"?"!==e.tag||c||2!==e.indent&&t>0)&&(r=!1),c&&e.usedDuplicates[s])e.dump="*ref_"+s;else{if(u&&c&&!e.usedDuplicates[s]&&(e.usedDuplicates[s]=!0),"[object Object]"===a)i&&0!==Object.keys(e.dump).length?(x(e,t,e.dump,r),c&&(e.dump="&ref_"+s+e.dump)):(y(e,t,e.dump),c&&(e.dump="&ref_"+s+" "+e.dump));else if("[object Array]"===a)i&&0!==e.dump.length?(g(e,t,e.dump,r),c&&(e.dump="&ref_"+s+e.dump)):(m(e,t,e.dump),c&&(e.dump="&ref_"+s+" "+e.dump));else{if("[object String]"!==a){if(e.skipInvalid)return!1;throw new I("unacceptable kind of an object to dump "+a)}"?"!==e.tag&&l(e,e.dump,t,o)}null!==e.tag&&"?"!==e.tag&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function b(e,t){var n,i,r=[],o=[];for(w(e,r,o),n=0,i=o.length;i>n;n+=1)t.duplicates.push(r[o[n]]);t.usedDuplicates=new Array(i)}function w(e,t,n){var i,r,o;if(null!==e&&"object"==typeof e)if(r=t.indexOf(e),-1!==r)-1===n.indexOf(r)&&n.push(r);else if(t.push(e),Array.isArray(e))for(r=0,o=e.length;o>r;r+=1)w(e[r],t,n);else for(i=Object.keys(e),r=0,o=i.length;o>r;r+=1)w(e[i[r]],t,n)}function C(e,t){t=t||{};var n=new o(t);return n.noRefs||b(e,n),A(n,0,e,!0,!0)?n.dump+"\n":""}function k(e,t){return C(e,j.extend({schema:E},t))}var j=e("./common"),I=e("./exception"),S=e("./schema/default_full"),E=e("./schema/default_safe"),O=Object.prototype.toString,F=Object.prototype.hasOwnProperty,N=9,T=10,_=13,M=32,L=33,D=34,U=35,q=37,Y=38,R=39,$=42,B=44,P=45,K=58,H=62,W=63,G=64,V=91,Z=93,z=96,J=123,Q=124,X=125,ee={};ee[0]="\\0",ee[7]="\\a",ee[8]="\\b",ee[9]="\\t",ee[10]="\\n",ee[11]="\\v",ee[12]="\\f",ee[13]="\\r",ee[27]="\\e",ee[34]='\\"',ee[92]="\\\\",ee[133]="\\N",ee[160]="\\_",ee[8232]="\\L",ee[8233]="\\P";var te=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];u.prototype.takeUpTo=function(e){var t;if(e checkpoint"),t.position=e,t.checkpoint=this.checkpoint,t;return this.result+=this.source.slice(this.checkpoint,e),this.checkpoint=e,this},u.prototype.escapeChar=function(){var e,t;return e=this.source.charCodeAt(this.checkpoint),t=ee[e]||r(e),this.result+=t,this.checkpoint+=1,this},u.prototype.finish=function(){this.source.length>this.checkpoint&&this.takeUpTo(this.source.length)},t.exports.dump=C,t.exports.safeDump=k},{"./common":2,"./exception":4,"./schema/default_full":9,"./schema/default_safe":10}],4:[function(e,t,n){"use strict";function i(e,t){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||"",this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():"")}i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t},t.exports=i},{}],5:[function(e,t,n){"use strict";function i(e){return 10===e||13===e}function r(e){return 9===e||32===e}function o(e){return 9===e||32===e||10===e||13===e}function a(e){return 44===e||91===e||93===e||123===e||125===e}function s(e){var t;return e>=48&&57>=e?e-48:(t=32|e,t>=97&&102>=t?t-97+10:-1)}function c(e){return 120===e?2:117===e?4:85===e?8:0}function u(e){return e>=48&&57>=e?e-48:-1}function l(e){return 48===e?"\x00":97===e?"":98===e?"\b":116===e?" ":9===e?" ":110===e?"\n":118===e?"\x0B":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"…":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function p(e){return 65535>=e?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function f(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||K,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function h(e,t){return new $(t,new B(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function d(e,t){throw h(e,t)}function m(e,t){e.onWarning&&e.onWarning.call(null,h(e,t))}function g(e,t,n,i){var r,o,a,s;if(n>t){if(s=e.input.slice(t,n),i)for(r=0,o=s.length;o>r;r+=1)a=s.charCodeAt(r),9===a||a>=32&&1114111>=a||d(e,"expected valid JSON character");else X.test(s)&&d(e,"the stream contains non-printable characters");e.result+=s}}function y(e,t,n,i){var r,o,a,s;for(R.isObject(n)||d(e,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(n),a=0,s=r.length;s>a;a+=1)o=r[a],H.call(t,o)||(t[o]=n[o],i[o]=!0)}function x(e,t,n,i,r,o){var a,s;if(r=String(r),null===t&&(t={}),"tag:yaml.org,2002:merge"===i)if(Array.isArray(o))for(a=0,s=o.length;s>a;a+=1)y(e,t,o[a],n);else y(e,t,o,n);else e.json||H.call(n,r)||!H.call(t,r)||d(e,"duplicated mapping key"),t[r]=o,delete n[r];return t}function v(e){var t;t=e.input.charCodeAt(e.position),10===t?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):d(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function A(e,t,n){for(var o=0,a=e.input.charCodeAt(e.position);0!==a;){for(;r(a);)a=e.input.charCodeAt(++e.position);if(t&&35===a)do a=e.input.charCodeAt(++e.position);while(10!==a&&13!==a&&0!==a);if(!i(a))break;for(v(e),a=e.input.charCodeAt(e.position),o++,e.lineIndent=0;32===a;)e.lineIndent++,a=e.input.charCodeAt(++e.position)}return-1!==n&&0!==o&&e.lineIndent1&&(e.result+=R.repeat("\n",t-1))}function C(e,t,n){var s,c,u,l,p,f,h,d,m,y=e.kind,x=e.result;if(m=e.input.charCodeAt(e.position),o(m)||a(m)||35===m||38===m||42===m||33===m||124===m||62===m||39===m||34===m||37===m||64===m||96===m)return!1;if((63===m||45===m)&&(c=e.input.charCodeAt(e.position+1),o(c)||n&&a(c)))return!1;for(e.kind="scalar",e.result="",u=l=e.position,p=!1;0!==m;){if(58===m){if(c=e.input.charCodeAt(e.position+1),o(c)||n&&a(c))break}else if(35===m){if(s=e.input.charCodeAt(e.position-1),o(s))break}else{if(e.position===e.lineStart&&b(e)||n&&a(m))break;if(i(m)){if(f=e.line,h=e.lineStart,d=e.lineIndent,A(e,!1,-1),e.lineIndent>=t){p=!0,m=e.input.charCodeAt(e.position);continue}e.position=l,e.line=f,e.lineStart=h,e.lineIndent=d;break}}p&&(g(e,u,l,!1),w(e,e.line-f),u=l=e.position,p=!1),r(m)||(l=e.position+1),m=e.input.charCodeAt(++e.position)}return g(e,u,l,!1),e.result?!0:(e.kind=y,e.result=x,!1)}function k(e,t){var n,r,o;if(n=e.input.charCodeAt(e.position),39!==n)return!1;for(e.kind="scalar",e.result="",e.position++,r=o=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(g(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),39!==n)return!0;r=o=e.position,e.position++}else i(n)?(g(e,r,o,!0),w(e,A(e,!1,t)),r=o=e.position):e.position===e.lineStart&&b(e)?d(e,"unexpected end of the document within a single quoted scalar"):(e.position++,o=e.position);d(e,"unexpected end of the stream within a single quoted scalar")}function j(e,t){var n,r,o,a,u,l;if(l=e.input.charCodeAt(e.position),34!==l)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;0!==(l=e.input.charCodeAt(e.position));){if(34===l)return g(e,n,e.position,!0),e.position++,!0;if(92===l){if(g(e,n,e.position,!0),l=e.input.charCodeAt(++e.position),i(l))A(e,!1,t);else if(256>l&&re[l])e.result+=oe[l],e.position++;else if((u=c(l))>0){for(o=u,a=0;o>0;o--)l=e.input.charCodeAt(++e.position),(u=s(l))>=0?a=(a<<4)+u:d(e,"expected hexadecimal character");e.result+=p(a),e.position++}else d(e,"unknown escape sequence");n=r=e.position}else i(l)?(g(e,n,r,!0),w(e,A(e,!1,t)),n=r=e.position):e.position===e.lineStart&&b(e)?d(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}d(e,"unexpected end of the stream within a double quoted scalar")}function I(e,t){var n,i,r,a,s,c,u,l,p,f,h,m=!0,g=e.tag,y=e.anchor,v={};if(h=e.input.charCodeAt(e.position),91===h)a=93,u=!1,i=[];else{if(123!==h)return!1;a=125,u=!0,i={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=i),h=e.input.charCodeAt(++e.position);0!==h;){if(A(e,!0,t),h=e.input.charCodeAt(e.position),h===a)return e.position++,e.tag=g,e.anchor=y,e.kind=u?"mapping":"sequence",e.result=i,!0;m||d(e,"missed comma between flow collection entries"),p=l=f=null,s=c=!1,63===h&&(r=e.input.charCodeAt(e.position+1),o(r)&&(s=c=!0,e.position++,A(e,!0,t))),n=e.line,_(e,t,W,!1,!0),p=e.tag,l=e.result,A(e,!0,t),h=e.input.charCodeAt(e.position),!c&&e.line!==n||58!==h||(s=!0,h=e.input.charCodeAt(++e.position),A(e,!0,t),_(e,t,W,!1,!0),f=e.result),u?x(e,i,v,p,l,f):s?i.push(x(e,null,v,p,l,f)):i.push(l),A(e,!0,t),h=e.input.charCodeAt(e.position),44===h?(m=!0,h=e.input.charCodeAt(++e.position)):m=!1}d(e,"unexpected end of the stream within a flow collection")}function S(e,t){var n,o,a,s,c=z,l=!1,p=t,f=0,h=!1;if(s=e.input.charCodeAt(e.position),124===s)o=!1;else{if(62!==s)return!1;o=!0}for(e.kind="scalar",e.result="";0!==s;)if(s=e.input.charCodeAt(++e.position),43===s||45===s)z===c?c=43===s?Q:J:d(e,"repeat of a chomping mode identifier");else{if(!((a=u(s))>=0))break;0===a?d(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?d(e,"repeat of an indentation width identifier"):(p=t+a-1,l=!0)}if(r(s)){do s=e.input.charCodeAt(++e.position);while(r(s));if(35===s)do s=e.input.charCodeAt(++e.position);while(!i(s)&&0!==s)}for(;0!==s;){for(v(e),e.lineIndent=0,s=e.input.charCodeAt(e.position);(!l||e.lineIndentp&&(p=e.lineIndent),i(s))f++;else{if(e.lineIndentt)&&0!==r)d(e,"bad indentation of a sequence entry");else if(e.lineIndentt)&&(_(e,t,Z,!0,a)&&(y?m=e.result:g=e.result),y||(x(e,p,f,h,m,g),h=m=g=null),A(e,!0,-1),c=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==c)d(e,"bad indentation of a mapping entry");else if(e.lineIndentt?h=1:e.lineIndent===t?h=0:e.lineIndentt?h=1:e.lineIndent===t?h=0:e.lineIndentc;c+=1)if(l=e.implicitTypes[c],l.resolve(e.result)){e.result=l.construct(e.result),e.tag=l.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else H.call(e.typeMap,e.tag)?(l=e.typeMap[e.tag],null!==e.result&&l.kind!==e.kind&&d(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+l.kind+'", not "'+e.kind+'"'),l.resolve(e.result)?(e.result=l.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):d(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):d(e,"unknown tag !<"+e.tag+">");return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||g}function M(e){var t,n,a,s,c=e.position,u=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};0!==(s=e.input.charCodeAt(e.position))&&(A(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==s));){for(u=!0,s=e.input.charCodeAt(++e.position),t=e.position;0!==s&&!o(s);)s=e.input.charCodeAt(++e.position);for(n=e.input.slice(t,e.position),a=[],n.length<1&&d(e,"directive name must not be less than one character in length");0!==s;){for(;r(s);)s=e.input.charCodeAt(++e.position);if(35===s){do s=e.input.charCodeAt(++e.position);while(0!==s&&!i(s));break}if(i(s))break;for(t=e.position;0!==s&&!o(s);)s=e.input.charCodeAt(++e.position);a.push(e.input.slice(t,e.position))}0!==s&&v(e),H.call(se,n)?se[n](e,n,a):m(e,'unknown document directive "'+n+'"')}return A(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,A(e,!0,-1)):u&&d(e,"directives end mark is expected"),_(e,e.lineIndent-1,Z,!1,!0),A(e,!0,-1),e.checkLineBreaks&&ee.test(e.input.slice(c,e.position))&&m(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&b(e)?void(46===e.input.charCodeAt(e.position)&&(e.position+=3,A(e,!0,-1))):void(e.positioni;i+=1)t(o[i])}function U(e,t){var n=L(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new $("expected a single document in the stream, but found more")}}function q(e,t,n){D(e,t,R.extend({schema:P},n))}function Y(e,t){return U(e,R.extend({schema:P},t))}for(var R=e("./common"),$=e("./exception"),B=e("./mark"),P=e("./schema/default_safe"),K=e("./schema/default_full"),H=Object.prototype.hasOwnProperty,W=1,G=2,V=3,Z=4,z=1,J=2,Q=3,X=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ee=/[\x85\u2028\u2029]/,te=/[,\[\]\{\}]/,ne=/^(?:!|!!|![a-z\-]+!)$/i,ie=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i,re=new Array(256),oe=new Array(256),ae=0;256>ae;ae++)re[ae]=l(ae)?1:0,oe[ae]=l(ae);var se={YAML:function(e,t,n){var i,r,o;null!==e.version&&d(e,"duplication of %YAML directive"),1!==n.length&&d(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),null===i&&d(e,"ill-formed argument of the YAML directive"),r=parseInt(i[1],10),o=parseInt(i[2],10),1!==r&&d(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=2>o,1!==o&&2!==o&&m(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var i,r;2!==n.length&&d(e,"TAG directive accepts exactly two arguments"),i=n[0],r=n[1],ne.test(i)||d(e,"ill-formed tag handle (first argument) of the TAG directive"),H.call(e.tagMap,i)&&d(e,'there is a previously declared suffix for "'+i+'" tag handle'),ie.test(r)||d(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[i]=r}};t.exports.loadAll=D,t.exports.load=U,t.exports.safeLoadAll=q,t.exports.safeLoad=Y},{"./common":2,"./exception":4,"./mark":6,"./schema/default_full":9,"./schema/default_safe":10}],6:[function(e,t,n){"use strict";function i(e,t,n,i,r){this.name=e,this.buffer=t,this.position=n,this.line=i,this.column=r}var r=e("./common");i.prototype.getSnippet=function(e,t){var n,i,o,a,s;if(!this.buffer)return null;for(e=e||4,t=t||75,n="",i=this.position;i>0&&-1==="\x00\r\n…\u2028\u2029".indexOf(this.buffer.charAt(i-1));)if(i-=1,this.position-i>t/2-1){n=" ... ",i+=5;break}for(o="",a=this.position;at/2-1){o=" ... ",a-=5;break}return s=this.buffer.slice(i,a),r.repeat(" ",e)+n+s+o+"\n"+r.repeat(" ",e+this.position-i+n.length)+"^"},i.prototype.toString=function(e){var t,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet(),t&&(n+=":\n"+t)),n},t.exports=i},{"./common":2}],7:[function(e,t,n){"use strict";function i(e,t,n){var r=[];return e.include.forEach(function(e){n=i(e,t,n)}),e[t].forEach(function(e){n.forEach(function(t,n){t.tag===e.tag&&r.push(n)}),n.push(e)}),n.filter(function(e,t){return-1===r.indexOf(t)})}function r(){function e(e){i[e.tag]=e}var t,n,i={};for(t=0,n=arguments.length;n>t;t+=1)arguments[t].forEach(e);return i}function o(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new s("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=i(this,"implicit",[]),this.compiledExplicit=i(this,"explicit",[]),this.compiledTypeMap=r(this.compiledImplicit,this.compiledExplicit)}var a=e("./common"),s=e("./exception"),c=e("./type");o.DEFAULT=null,o.create=function(){var e,t;switch(arguments.length){case 1:e=o.DEFAULT,t=arguments[0];break;case 2:e=arguments[0],t=arguments[1];break;default:throw new s("Wrong number of arguments for Schema.create function")}if(e=a.toArray(e),t=a.toArray(t),!e.every(function(e){return e instanceof o}))throw new s("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!t.every(function(e){return e instanceof c}))throw new s("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new o({include:e,explicit:t})},t.exports=o},{"./common":2,"./exception":4,"./type":13}],8:[function(e,t,n){"use strict";var i=e("../schema");t.exports=new i({include:[e("./json")]})},{"../schema":7,"./json":12}],9:[function(e,t,n){"use strict";var i=e("../schema");t.exports=i.DEFAULT=new i({include:[e("./default_safe")],explicit:[e("../type/js/undefined"),e("../type/js/regexp"),e("../type/js/function")]})},{"../schema":7,"../type/js/function":18,"../type/js/regexp":19,"../type/js/undefined":20,"./default_safe":10}],10:[function(e,t,n){"use strict";var i=e("../schema");t.exports=new i({include:[e("./core")],implicit:[e("../type/timestamp"),e("../type/merge")],explicit:[e("../type/binary"),e("../type/omap"),e("../type/pairs"),e("../type/set")]})},{"../schema":7,"../type/binary":14,"../type/merge":22,"../type/omap":24,"../type/pairs":25,"../type/set":27,"../type/timestamp":29,"./core":8}],11:[function(e,t,n){"use strict";var i=e("../schema");t.exports=new i({explicit:[e("../type/str"),e("../type/seq"),e("../type/map")]})},{"../schema":7,"../type/map":21,"../type/seq":26,"../type/str":28}],12:[function(e,t,n){"use strict";var i=e("../schema");t.exports=new i({include:[e("./failsafe")],implicit:[e("../type/null"),e("../type/bool"),e("../type/int"),e("../type/float")]})},{"../schema":7,"../type/bool":15,"../type/float":16,"../type/int":17,"../type/null":23,"./failsafe":11}],13:[function(e,t,n){"use strict";function i(e){var t={};return null!==e&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}function r(e,t){if(t=t||{},Object.keys(t).forEach(function(t){if(-1===a.indexOf(t))throw new o('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=i(t.styleAliases||null),-1===s.indexOf(this.kind))throw new o('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var o=e("./exception"),a=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],s=["scalar","sequence","mapping"];t.exports=r},{"./exception":4}],14:[function(e,t,n){"use strict";function i(e){if(null===e)return!1;var t,n,i=0,r=e.length,o=u;for(n=0;r>n;n++)if(t=o.indexOf(e.charAt(n)),!(t>64)){if(0>t)return!1;i+=6}return i%8===0}function r(e){var t,n,i=e.replace(/[\r\n=]/g,""),r=i.length,o=u,a=0,c=[];for(t=0;r>t;t++)t%4===0&&t&&(c.push(a>>16&255),c.push(a>>8&255),c.push(255&a)),a=a<<6|o.indexOf(i.charAt(t));return n=r%4*6,0===n?(c.push(a>>16&255),c.push(a>>8&255),c.push(255&a)):18===n?(c.push(a>>10&255),c.push(a>>2&255)):12===n&&c.push(a>>4&255),s?new s(c):c}function o(e){var t,n,i="",r=0,o=e.length,a=u;for(t=0;o>t;t++)t%3===0&&t&&(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]),r=(r<<8)+e[t];return n=o%3, +0===n?(i+=a[r>>18&63],i+=a[r>>12&63],i+=a[r>>6&63],i+=a[63&r]):2===n?(i+=a[r>>10&63],i+=a[r>>4&63],i+=a[r<<2&63],i+=a[64]):1===n&&(i+=a[r>>2&63],i+=a[r<<4&63],i+=a[64],i+=a[64]),i}function a(e){return s&&s.isBuffer(e)}var s=e("buffer").Buffer,c=e("../type"),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";t.exports=new c("tag:yaml.org,2002:binary",{kind:"scalar",resolve:i,construct:r,predicate:a,represent:o})},{"../type":13,buffer:30}],15:[function(e,t,n){"use strict";function i(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)}function r(e){return"true"===e||"True"===e||"TRUE"===e}function o(e){return"[object Boolean]"===Object.prototype.toString.call(e)}var a=e("../type");t.exports=new a("tag:yaml.org,2002:bool",{kind:"scalar",resolve:i,construct:r,predicate:o,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},{"../type":13}],16:[function(e,t,n){"use strict";function i(e){return null===e?!1:!!u.test(e)}function r(e){var t,n,i,r;return t=e.replace(/_/g,"").toLowerCase(),n="-"===t[0]?-1:1,r=[],"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:t.indexOf(":")>=0?(t.split(":").forEach(function(e){r.unshift(parseFloat(e,10))}),t=0,i=1,r.forEach(function(e){t+=e*i,i*=60}),n*t):n*parseFloat(t,10)}function o(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(s.isNegativeZero(e))return"-0.0";return n=e.toString(10),l.test(n)?n.replace("e",".e"):n}function a(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!==0||s.isNegativeZero(e))}var s=e("../common"),c=e("../type"),u=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?|\\.[0-9_]+(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),l=/^[-+]?[0-9]+e/;t.exports=new c("tag:yaml.org,2002:float",{kind:"scalar",resolve:i,construct:r,predicate:a,represent:o,defaultStyle:"lowercase"})},{"../common":2,"../type":13}],17:[function(e,t,n){"use strict";function i(e){return e>=48&&57>=e||e>=65&&70>=e||e>=97&&102>=e}function r(e){return e>=48&&55>=e}function o(e){return e>=48&&57>=e}function a(e){if(null===e)return!1;var t,n=e.length,a=0,s=!1;if(!n)return!1;if(t=e[a],"-"!==t&&"+"!==t||(t=e[++a]),"0"===t){if(a+1===n)return!0;if(t=e[++a],"b"===t){for(a++;n>a;a++)if(t=e[a],"_"!==t){if("0"!==t&&"1"!==t)return!1;s=!0}return s}if("x"===t){for(a++;n>a;a++)if(t=e[a],"_"!==t){if(!i(e.charCodeAt(a)))return!1;s=!0}return s}for(;n>a;a++)if(t=e[a],"_"!==t){if(!r(e.charCodeAt(a)))return!1;s=!0}return s}for(;n>a;a++)if(t=e[a],"_"!==t){if(":"===t)break;if(!o(e.charCodeAt(a)))return!1;s=!0}return s?":"!==t?!0:/^(:[0-5]?[0-9])+$/.test(e.slice(a)):!1}function s(e){var t,n,i=e,r=1,o=[];return-1!==i.indexOf("_")&&(i=i.replace(/_/g,"")),t=i[0],"-"!==t&&"+"!==t||("-"===t&&(r=-1),i=i.slice(1),t=i[0]),"0"===i?0:"0"===t?"b"===i[1]?r*parseInt(i.slice(2),2):"x"===i[1]?r*parseInt(i,16):r*parseInt(i,8):-1!==i.indexOf(":")?(i.split(":").forEach(function(e){o.unshift(parseInt(e,10))}),i=0,n=1,o.forEach(function(e){i+=e*n,n*=60}),r*i):r*parseInt(i,10)}function c(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1===0&&!u.isNegativeZero(e)}var u=e("../common"),l=e("../type");t.exports=new l("tag:yaml.org,2002:int",{kind:"scalar",resolve:a,construct:s,predicate:c,represent:{binary:function(e){return"0b"+e.toString(2)},octal:function(e){return"0"+e.toString(8)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return"0x"+e.toString(16).toUpperCase()}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})},{"../common":2,"../type":13}],18:[function(e,t,n){"use strict";function i(e){if(null===e)return!1;try{var t="("+e+")",n=s.parse(t,{range:!0});return"Program"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type&&"FunctionExpression"===n.body[0].expression.type}catch(i){return!1}}function r(e){var t,n="("+e+")",i=s.parse(n,{range:!0}),r=[];if("Program"!==i.type||1!==i.body.length||"ExpressionStatement"!==i.body[0].type||"FunctionExpression"!==i.body[0].expression.type)throw new Error("Failed to resolve function");return i.body[0].expression.params.forEach(function(e){r.push(e.name)}),t=i.body[0].expression.body.range,new Function(r,n.slice(t[0]+1,t[1]-1))}function o(e){return e.toString()}function a(e){return"[object Function]"===Object.prototype.toString.call(e)}var s;try{var c=e;s=c("esprima")}catch(u){"undefined"!=typeof window&&(s=window.esprima)}var l=e("../../type");t.exports=new l("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:i,construct:r,predicate:a,represent:o})},{"../../type":13}],19:[function(e,t,n){"use strict";function i(e){if(null===e)return!1;if(0===e.length)return!1;var t=e,n=/\/([gim]*)$/.exec(e),i="";if("/"===t[0]){if(n&&(i=n[1]),i.length>3)return!1;if("/"!==t[t.length-i.length-1])return!1}return!0}function r(e){var t=e,n=/\/([gim]*)$/.exec(e),i="";return"/"===t[0]&&(n&&(i=n[1]),t=t.slice(1,t.length-i.length-1)),new RegExp(t,i)}function o(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}function a(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var s=e("../../type");t.exports=new s("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:i,construct:r,predicate:a,represent:o})},{"../../type":13}],20:[function(e,t,n){"use strict";function i(){return!0}function r(){}function o(){return""}function a(e){return"undefined"==typeof e}var s=e("../../type");t.exports=new s("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:i,construct:r,predicate:a,represent:o})},{"../../type":13}],21:[function(e,t,n){"use strict";var i=e("../type");t.exports=new i("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})},{"../type":13}],22:[function(e,t,n){"use strict";function i(e){return"<<"===e||null===e}var r=e("../type");t.exports=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:i})},{"../type":13}],23:[function(e,t,n){"use strict";function i(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)}function r(){return null}function o(e){return null===e}var a=e("../type");t.exports=new a("tag:yaml.org,2002:null",{kind:"scalar",resolve:i,construct:r,predicate:o,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})},{"../type":13}],24:[function(e,t,n){"use strict";function i(e){if(null===e)return!0;var t,n,i,r,o,c=[],u=e;for(t=0,n=u.length;n>t;t+=1){if(i=u[t],o=!1,"[object Object]"!==s.call(i))return!1;for(r in i)if(a.call(i,r)){if(o)return!1;o=!0}if(!o)return!1;if(-1!==c.indexOf(r))return!1;c.push(r)}return!0}function r(e){return null!==e?e:[]}var o=e("../type"),a=Object.prototype.hasOwnProperty,s=Object.prototype.toString;t.exports=new o("tag:yaml.org,2002:omap",{kind:"sequence",resolve:i,construct:r})},{"../type":13}],25:[function(e,t,n){"use strict";function i(e){if(null===e)return!0;var t,n,i,r,o,s=e;for(o=new Array(s.length),t=0,n=s.length;n>t;t+=1){if(i=s[t],"[object Object]"!==a.call(i))return!1;if(r=Object.keys(i),1!==r.length)return!1;o[t]=[r[0],i[r[0]]]}return!0}function r(e){if(null===e)return[];var t,n,i,r,o,a=e;for(o=new Array(a.length),t=0,n=a.length;n>t;t+=1)i=a[t],r=Object.keys(i),o[t]=[r[0],i[r[0]]];return o}var o=e("../type"),a=Object.prototype.toString;t.exports=new o("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:i,construct:r})},{"../type":13}],26:[function(e,t,n){"use strict";var i=e("../type");t.exports=new i("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})},{"../type":13}],27:[function(e,t,n){"use strict";function i(e){if(null===e)return!0;var t,n=e;for(t in n)if(a.call(n,t)&&null!==n[t])return!1;return!0}function r(e){return null!==e?e:{}}var o=e("../type"),a=Object.prototype.hasOwnProperty;t.exports=new o("tag:yaml.org,2002:set",{kind:"mapping",resolve:i,construct:r})},{"../type":13}],28:[function(e,t,n){"use strict";var i=e("../type");t.exports=new i("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})},{"../type":13}],29:[function(e,t,n){"use strict";function i(e){return null===e?!1:null!==s.exec(e)?!0:null!==c.exec(e)}function r(e){var t,n,i,r,o,a,u,l,p,f,h=0,d=null;if(t=s.exec(e),null===t&&(t=c.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],i=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,i,r));if(o=+t[4],a=+t[5],u=+t[6],t[7]){for(h=t[7].slice(0,3);h.length<3;)h+="0";h=+h}return t[9]&&(l=+t[10],p=+(t[11]||0),d=6e4*(60*l+p),"-"===t[9]&&(d=-d)),f=new Date(Date.UTC(n,i,r,o,a,u,h)),d&&f.setTime(f.getTime()-d),f}function o(e){return e.toISOString()}var a=e("../type"),s=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),c=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");t.exports=new a("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:i,construct:r,instanceOf:Date,represent:o})},{"../type":13}],30:[function(e,t,n){},{}],"/":[function(e,t,n){"use strict";var i=e("./lib/js-yaml.js");t.exports=i},{"./lib/js-yaml.js":1}]},{},[])("/")}); diff --git a/tools/eslint/node_modules/js-yaml/examples/custom_types.js b/tools/eslint/node_modules/js-yaml/examples/custom_types.js deleted file mode 100644 index b5c7b9f7de015e..00000000000000 --- a/tools/eslint/node_modules/js-yaml/examples/custom_types.js +++ /dev/null @@ -1,103 +0,0 @@ -'use strict'; - -/*eslint-disable no-console*/ - -var fs = require('fs'); -var path = require('path'); -var util = require('util'); -var yaml = require('../lib/js-yaml'); - - -// Let's define a couple of classes. - -function Point(x, y, z) { - this.klass = 'Point'; - this.x = x; - this.y = y; - this.z = z; -} - - -function Space(height, width, points) { - if (points) { - if (!points.every(function (point) { return point instanceof Point; })) { - throw new Error('A non-Point inside a points array!'); - } - } - - this.klass = 'Space'; - this.height = height; - this.width = width; - this.points = points; -} - - -// Then define YAML types to load and dump our Point/Space objects. - -var PointYamlType = new yaml.Type('!point', { - // Loader must parse sequence nodes only for this type (i.e. arrays in JS terminology). - // Other available kinds are 'scalar' (string) and 'mapping' (object). - // http://www.yaml.org/spec/1.2/spec.html#kind// - kind: 'sequence', - - // Loader must check if the input object is suitable for this type. - resolve: function (data) { - // `data` may be either: - // - Null in case of an "empty node" (http://www.yaml.org/spec/1.2/spec.html#id2786563) - // - Array since we specified `kind` to 'sequence' - return data !== null && data.length === 3; - }, - - // If a node is resolved, use it to create a Point instance. - construct: function (data) { - return new Point(data[0], data[1], data[2]); - }, - - // Dumper must process instances of Point by rules of this YAML type. - instanceOf: Point, - - // Dumper must represent Point objects as three-element sequence in YAML. - represent: function (point) { - return [ point.x, point.y, point.z ]; - } -}); - - -var SpaceYamlType = new yaml.Type('!space', { - kind: 'mapping', - construct: function (data) { - data = data || {}; // in case of empty node - return new Space(data.height || 0, data.width || 0, data.points || []); - }, - instanceOf: Space - // `represent` is omitted here. So, Space objects will be dumped as is. - // That is regular mapping with three key-value pairs but with !space tag. -}); - - -// After our types are defined, it's time to join them into a schema. - -var SPACE_SCHEMA = yaml.Schema.create([ SpaceYamlType, PointYamlType ]); - -// do not execute the following if file is required (http://stackoverflow.com/a/6398335) -if (require.main === module) { - - // And read a document using that schema. - fs.readFile(path.join(__dirname, 'custom_types.yml'), 'utf8', function (error, data) { - var loaded; - - if (!error) { - loaded = yaml.load(data, { schema: SPACE_SCHEMA }); - console.log(util.inspect(loaded, false, 20, true)); - } else { - console.error(error.stack || error.message || String(error)); - } - }); -} - -// There are some exports to play with this example interactively. -module.exports.Point = Point; -module.exports.Space = Space; -module.exports.PointYamlType = PointYamlType; -module.exports.SpaceYamlType = SpaceYamlType; -module.exports.SPACE_SCHEMA = SPACE_SCHEMA; diff --git a/tools/eslint/node_modules/js-yaml/examples/custom_types.yml b/tools/eslint/node_modules/js-yaml/examples/custom_types.yml deleted file mode 100644 index f10d4e25a414da..00000000000000 --- a/tools/eslint/node_modules/js-yaml/examples/custom_types.yml +++ /dev/null @@ -1,18 +0,0 @@ -subject: Custom types in JS-YAML -spaces: -- !space - height: 1000 - width: 1000 - points: - - !point [ 10, 43, 23 ] - - !point [ 165, 0, 50 ] - - !point [ 100, 100, 100 ] - -- !space - height: 64 - width: 128 - points: - - !point [ 12, 43, 0 ] - - !point [ 1, 4, 90 ] - -- !space # An empty space diff --git a/tools/eslint/node_modules/js-yaml/examples/dumper.js b/tools/eslint/node_modules/js-yaml/examples/dumper.js deleted file mode 100644 index d237949530f6dd..00000000000000 --- a/tools/eslint/node_modules/js-yaml/examples/dumper.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -/*eslint-disable no-console*/ - -var yaml = require('../lib/js-yaml'); -var object = require('./dumper.json'); - - -console.log(yaml.dump(object, { - flowLevel: 3, - styles: { - '!!int' : 'hexadecimal', - '!!null' : 'camelcase' - } -})); - - -// Output: -//============================================================================== -// name: Wizzard -// level: 0x11 -// sanity: Null -// inventory: -// - name: Hat -// features: [magic, pointed] -// traits: {} -// - name: Staff -// features: [] -// traits: {damage: 0xA} -// - name: Cloak -// features: [old] -// traits: {defence: 0x0, comfort: 0x3} diff --git a/tools/eslint/node_modules/js-yaml/examples/dumper.json b/tools/eslint/node_modules/js-yaml/examples/dumper.json deleted file mode 100644 index 9f54c053e51720..00000000000000 --- a/tools/eslint/node_modules/js-yaml/examples/dumper.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name" : "Wizzard", - "level" : 17, - "sanity" : null, - "inventory" : [ - { - "name" : "Hat", - "features" : [ "magic", "pointed" ], - "traits" : {} - }, - { - "name" : "Staff", - "features" : [], - "traits" : { "damage" : 10 } - }, - { - "name" : "Cloak", - "features" : [ "old" ], - "traits" : { "defence" : 0, "comfort" : 3 } - } - ] -} diff --git a/tools/eslint/node_modules/js-yaml/examples/sample_document.js b/tools/eslint/node_modules/js-yaml/examples/sample_document.js deleted file mode 100644 index 3204fa50f94243..00000000000000 --- a/tools/eslint/node_modules/js-yaml/examples/sample_document.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -/*eslint-disable no-console*/ - -var fs = require('fs'); -var path = require('path'); -var util = require('util'); -var yaml = require('../lib/js-yaml'); - - -try { - var filename = path.join(__dirname, 'sample_document.yml'), - contents = fs.readFileSync(filename, 'utf8'), - data = yaml.load(contents); - - console.log(util.inspect(data, false, 10, true)); -} catch (err) { - console.log(err.stack || String(err)); -} diff --git a/tools/eslint/node_modules/js-yaml/examples/sample_document.yml b/tools/eslint/node_modules/js-yaml/examples/sample_document.yml deleted file mode 100644 index 4479ee9c0783cf..00000000000000 --- a/tools/eslint/node_modules/js-yaml/examples/sample_document.yml +++ /dev/null @@ -1,197 +0,0 @@ ---- -# Collection Types ############################################################# -################################################################################ - -# http://yaml.org/type/map.html -----------------------------------------------# - -map: - # Unordered set of key: value pairs. - Block style: !!map - Clark : Evans - Ingy : döt Net - Oren : Ben-Kiki - Flow style: !!map { Clark: Evans, Ingy: döt Net, Oren: Ben-Kiki } - -# http://yaml.org/type/omap.html ----------------------------------------------# - -omap: - # Explicitly typed ordered map (dictionary). - Bestiary: !!omap - - aardvark: African pig-like ant eater. Ugly. - - anteater: South-American ant eater. Two species. - - anaconda: South-American constrictor snake. Scaly. - # Etc. - # Flow style - Numbers: !!omap [ one: 1, two: 2, three : 3 ] - -# http://yaml.org/type/pairs.html ---------------------------------------------# - -pairs: - # Explicitly typed pairs. - Block tasks: !!pairs - - meeting: with team. - - meeting: with boss. - - break: lunch. - - meeting: with client. - Flow tasks: !!pairs [ meeting: with team, meeting: with boss ] - -# http://yaml.org/type/set.html -----------------------------------------------# - -set: - # Explicitly typed set. - baseball players: !!set - ? Mark McGwire - ? Sammy Sosa - ? Ken Griffey - # Flow style - baseball teams: !!set { Boston Red Sox, Detroit Tigers, New York Yankees } - -# http://yaml.org/type/seq.html -----------------------------------------------# - -seq: - # Ordered sequence of nodes - Block style: !!seq - - Mercury # Rotates - no light/dark sides. - - Venus # Deadliest. Aptly named. - - Earth # Mostly dirt. - - Mars # Seems empty. - - Jupiter # The king. - - Saturn # Pretty. - - Uranus # Where the sun hardly shines. - - Neptune # Boring. No rings. - - Pluto # You call this a planet? - Flow style: !!seq [ Mercury, Venus, Earth, Mars, # Rocks - Jupiter, Saturn, Uranus, Neptune, # Gas - Pluto ] # Overrated - - -# Scalar Types ################################################################# -################################################################################ - -# http://yaml.org/type/binary.html --------------------------------------------# - -binary: - canonical: !!binary "\ - R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\ - OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\ - +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\ - AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=" - generic: !!binary | - R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5 - OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+ - +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC - AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs= - description: - The binary value above is a tiny arrow encoded as a gif image. - -# http://yaml.org/type/bool.html ----------------------------------------------# - -bool: - - true - - True - - TRUE - - false - - False - - FALSE - -# http://yaml.org/type/float.html ---------------------------------------------# - -float: - canonical: 6.8523015e+5 - exponentioal: 685.230_15e+03 - fixed: 685_230.15 - sexagesimal: 190:20:30.15 - negative infinity: -.inf - not a number: .NaN - -# http://yaml.org/type/int.html -----------------------------------------------# - -int: - canonical: 685230 - decimal: +685_230 - octal: 02472256 - hexadecimal: 0x_0A_74_AE - binary: 0b1010_0111_0100_1010_1110 - sexagesimal: 190:20:30 - -# http://yaml.org/type/merge.html ---------------------------------------------# - -merge: - - &CENTER { x: 1, y: 2 } - - &LEFT { x: 0, y: 2 } - - &BIG { r: 10 } - - &SMALL { r: 1 } - - # All the following maps are equal: - - - # Explicit keys - x: 1 - y: 2 - r: 10 - label: nothing - - - # Merge one map - << : *CENTER - r: 10 - label: center - - - # Merge multiple maps - << : [ *CENTER, *BIG ] - label: center/big - - - # Override - << : [ *BIG, *LEFT, *SMALL ] - x: 1 - label: big/left/small - -# http://yaml.org/type/null.html ----------------------------------------------# - -null: - # This mapping has four keys, - # one has a value. - empty: - canonical: ~ - english: null - ~: null key - # This sequence has five - # entries, two have values. - sparse: - - ~ - - 2nd entry - - - - 4th entry - - Null - -# http://yaml.org/type/str.html -----------------------------------------------# - -string: abcd - -# http://yaml.org/type/timestamp.html -----------------------------------------# - -timestamp: - canonical: 2001-12-15T02:59:43.1Z - valid iso8601: 2001-12-14t21:59:43.10-05:00 - space separated: 2001-12-14 21:59:43.10 -5 - no time zone (Z): 2001-12-15 2:59:43.10 - date (00:00:00Z): 2002-12-14 - - -# JavaScript Specific Types #################################################### -################################################################################ - -# https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/RegExp - -regexp: - simple: !!js/regexp foobar - modifiers: !!js/regexp /foobar/mi - -# https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/undefined - -undefined: !!js/undefined ~ - -# https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function - -function: !!js/function > - function foobar() { - return 'Wow! JS-YAML Rocks!'; - } diff --git a/tools/eslint/node_modules/js-yaml/lib/js-yaml.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml.js index 842104eca3be9e..f0e92818e90cee 100644 --- a/tools/eslint/node_modules/js-yaml/lib/js-yaml.js +++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml.js @@ -27,7 +27,7 @@ module.exports.dump = dumper.dump; module.exports.safeDump = dumper.safeDump; module.exports.YAMLException = require('./js-yaml/exception'); -// Deprecared schema names from JS-YAML 2.0.x +// Deprecated schema names from JS-YAML 2.0.x module.exports.MINIMAL_SCHEMA = require('./js-yaml/schema/failsafe'); module.exports.SAFE_SCHEMA = require('./js-yaml/schema/default_safe'); module.exports.DEFAULT_SCHEMA = require('./js-yaml/schema/default_full'); diff --git a/tools/eslint/node_modules/js-yaml/lib/js-yaml/common.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml/common.js index 197eb248a05a51..25ef7d8e4a3000 100644 --- a/tools/eslint/node_modules/js-yaml/lib/js-yaml/common.js +++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml/common.js @@ -2,21 +2,19 @@ function isNothing(subject) { - return (typeof subject === 'undefined') || (null === subject); + return (typeof subject === 'undefined') || (subject === null); } function isObject(subject) { - return (typeof subject === 'object') && (null !== subject); + return (typeof subject === 'object') && (subject !== null); } function toArray(sequence) { - if (Array.isArray(sequence)) { - return sequence; - } else if (isNothing(sequence)) { - return []; - } + if (Array.isArray(sequence)) return sequence; + else if (isNothing(sequence)) return []; + return [ sequence ]; } @@ -49,7 +47,7 @@ function repeat(string, count) { function isNegativeZero(number) { - return (0 === number) && (Number.NEGATIVE_INFINITY === 1 / number); + return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number); } diff --git a/tools/eslint/node_modules/js-yaml/lib/js-yaml/dumper.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml/dumper.js index fabc0c3cd04f28..855edfc9e63c3c 100644 --- a/tools/eslint/node_modules/js-yaml/lib/js-yaml/dumper.js +++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml/dumper.js @@ -60,9 +60,7 @@ var DEPRECATED_BOOLEANS_SYNTAX = [ function compileStyleMap(schema, map) { var result, keys, index, length, tag, style, type; - if (null === map) { - return {}; - } + if (map === null) return {}; result = {}; keys = Object.keys(map); @@ -71,7 +69,7 @@ function compileStyleMap(schema, map) { tag = keys[index]; style = String(map[tag]); - if ('!!' === tag.slice(0, 2)) { + if (tag.slice(0, 2) === '!!') { tag = 'tag:yaml.org,2002:' + tag.slice(2); } @@ -109,12 +107,15 @@ function encodeHex(character) { } function State(options) { - this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; - this.indent = Math.max(1, (options['indent'] || 2)); - this.skipInvalid = options['skipInvalid'] || false; - this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); - this.styleMap = compileStyleMap(this.schema, options['styles'] || null); - this.sortKeys = options['sortKeys'] || false; + this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; + this.indent = Math.max(1, (options['indent'] || 2)); + this.skipInvalid = options['skipInvalid'] || false; + this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); + this.styleMap = compileStyleMap(this.schema, options['styles'] || null); + this.sortKeys = options['sortKeys'] || false; + this.lineWidth = options['lineWidth'] || 80; + this.noRefs = options['noRefs'] || false; + this.noCompatMode = options['noCompatMode'] || false; this.implicitTypes = this.schema.compiledImplicit; this.explicitTypes = this.schema.compiledExplicit; @@ -143,9 +144,9 @@ function indentString(string, spaces) { line = string.slice(position, next + 1); position = next + 1; } - if (line.length && line !== '\n') { - result += ind; - } + + if (line.length && line !== '\n') result += ind; + result += line; } @@ -208,18 +209,19 @@ StringBuilder.prototype.finish = function () { } }; -function writeScalar(state, object, level) { +function writeScalar(state, object, level, iskey) { var simple, first, spaceWrap, folded, literal, single, double, sawLineFeed, linePosition, longestLine, indent, max, character, position, escapeSeq, hexEsc, previous, lineLength, modifier, trailingLineBreaks, result; - if (0 === object.length) { + if (object.length === 0) { state.dump = "''"; return; } - if (-1 !== DEPRECATED_BOOLEANS_SYNTAX.indexOf(object)) { + if (!state.noCompatMode && + DEPRECATED_BOOLEANS_SYNTAX.indexOf(object) !== -1) { state.dump = "'" + object + "'"; return; } @@ -238,14 +240,16 @@ function writeScalar(state, object, level) { simple = false; } - // can only use > and | if not wrapped in spaces. - if (spaceWrap) { - simple = false; + // Can only use > and | if not wrapped in spaces or is not a key. + // Also, don't use if in flow mode. + if (spaceWrap || (state.flowLevel > -1 && state.flowLevel <= level)) { + if (spaceWrap) simple = false; + folded = false; literal = false; } else { - folded = true; - literal = true; + folded = !iskey; + literal = !iskey; } single = true; @@ -256,12 +260,14 @@ function writeScalar(state, object, level) { longestLine = 0; indent = state.indent * level; - max = 80; - if (indent < 40) { - max -= indent; - } else { - max = 40; - } + max = state.lineWidth; + + // Replace -1 with biggest ingeger number according to + // http://ecma262-5.com/ELS5_HTML.htm#Section_8.5 + if (max === -1) max = 9007199254740991; + + if (indent < 40) max -= indent; + else max = 40; for (position = 0; position < object.length; position++) { character = object.charCodeAt(position); @@ -305,23 +311,17 @@ function writeScalar(state, object, level) { if (folded) { lineLength = position - linePosition; linePosition = position; - if (lineLength > longestLine) { - longestLine = lineLength; - } + if (lineLength > longestLine) longestLine = lineLength; } } - if (character !== CHAR_DOUBLE_QUOTE) { - single = false; - } + if (character !== CHAR_DOUBLE_QUOTE) single = false; double.takeUpTo(position); double.escapeChar(); } - if (simple && testImplicitResolving(state, object)) { - simple = false; - } + if (simple && testImplicitResolving(state, object)) simple = false; modifier = ''; if (folded || literal) { @@ -333,22 +333,17 @@ function writeScalar(state, object, level) { } } - if (trailingLineBreaks === 0) { - modifier = '-'; - } else if (trailingLineBreaks === 2) { - modifier = '+'; - } + if (trailingLineBreaks === 0) modifier = '-'; + else if (trailingLineBreaks === 2) modifier = '+'; } - if (literal && longestLine < max) { + if (literal && longestLine < max || state.tag !== null) { folded = false; } // If it's literally one line, then don't bother with the literal. // We may still want to do a fold, though, if it's a super long line. - if (!sawLineFeed) { - literal = false; - } + if (!sawLineFeed) literal = false; if (simple) { state.dump = object; @@ -358,9 +353,7 @@ function writeScalar(state, object, level) { result = fold(object, max); state.dump = '>' + modifier + '\n' + indentString(result, indent); } else if (literal) { - if (!modifier) { - object = object.replace(/\n$/, ''); - } + if (!modifier) object = object.replace(/\n$/, ''); state.dump = '|' + modifier + '\n' + indentString(object, indent); } else if (double) { double.finish(); @@ -398,30 +391,24 @@ function fold(object, max) { while (position < length) { newLine = object.indexOf('\n', position); if (newLine > length || newLine === -1) { - if (result) { - result += '\n\n'; - } + if (result) result += '\n\n'; result += foldLine(object.slice(position, length), max); position = length; + } else { - if (result) { - result += '\n\n'; - } + if (result) result += '\n\n'; result += foldLine(object.slice(position, newLine), max); position = newLine + 1; } } - if (trailing && trailing[0] !== '\n') { - result += trailing[0]; - } + + if (trailing && trailing[0] !== '\n') result += trailing[0]; return result; } function foldLine(line, max) { - if (line === '') { - return line; - } + if (line === '') return line; var foldRe = /[^\s] [^\s]/g, result = '', @@ -439,15 +426,10 @@ function foldLine(line, max) { // been ok, use that one, and carry on. If there was no previous // match on this fold section, then just have a long line. if (index - foldStart > max) { - if (prevMatch !== foldStart) { - foldEnd = prevMatch; - } else { - foldEnd = index; - } + if (prevMatch !== foldStart) foldEnd = prevMatch; + else foldEnd = index; - if (result) { - result += '\n'; - } + if (result) result += '\n'; folded = line.slice(foldStart, foldEnd); result += folded; foldStart = foldEnd + 1; @@ -456,9 +438,7 @@ function foldLine(line, max) { match = foldRe.exec(line); } - if (result) { - result += '\n'; - } + if (result) result += '\n'; // if we end up with one last word at the end, then the last bit might // be slightly bigger than we wanted, because we exited out of the loop. @@ -499,7 +479,7 @@ function simpleChar(character) { // Returns true if the character code needs to be escaped. function needsHexEscape(character) { return !((0x00020 <= character && character <= 0x00007E) || - (0x00085 === character) || + (character === 0x00085) || (0x000A0 <= character && character <= 0x00D7FF) || (0x0E000 <= character && character <= 0x00FFFD) || (0x10000 <= character && character <= 0x10FFFF)); @@ -514,9 +494,7 @@ function writeFlowSequence(state, level, object) { for (index = 0, length = object.length; index < length; index += 1) { // Write only valid elements. if (writeNode(state, level, object[index], false, false)) { - if (0 !== index) { - _result += ', '; - } + if (index !== 0) _result += ', '; _result += state.dump; } } @@ -534,7 +512,7 @@ function writeBlockSequence(state, level, object, compact) { for (index = 0, length = object.length; index < length; index += 1) { // Write only valid elements. if (writeNode(state, level + 1, object[index], true, true)) { - if (!compact || 0 !== index) { + if (!compact || index !== 0) { _result += generateNextLine(state, level); } _result += '- ' + state.dump; @@ -558,9 +536,7 @@ function writeFlowMapping(state, level, object) { for (index = 0, length = objectKeyList.length; index < length; index += 1) { pairBuffer = ''; - if (0 !== index) { - pairBuffer += ', '; - } + if (index !== 0) pairBuffer += ', '; objectKey = objectKeyList[index]; objectValue = object[objectKey]; @@ -569,9 +545,7 @@ function writeFlowMapping(state, level, object) { continue; // Skip this pair because of invalid key; } - if (state.dump.length > 1024) { - pairBuffer += '? '; - } + if (state.dump.length > 1024) pairBuffer += '? '; pairBuffer += state.dump + ': '; @@ -615,18 +589,18 @@ function writeBlockMapping(state, level, object, compact) { for (index = 0, length = objectKeyList.length; index < length; index += 1) { pairBuffer = ''; - if (!compact || 0 !== index) { + if (!compact || index !== 0) { pairBuffer += generateNextLine(state, level); } objectKey = objectKeyList[index]; objectValue = object[objectKey]; - if (!writeNode(state, level + 1, objectKey, true, true)) { + if (!writeNode(state, level + 1, objectKey, true, true, true)) { continue; // Skip this pair because of invalid key. } - explicitPair = (null !== state.tag && '?' !== state.tag) || + explicitPair = (state.tag !== null && state.tag !== '?') || (state.dump && state.dump.length > 1024); if (explicitPair) { @@ -672,7 +646,7 @@ function detectType(state, object, explicit) { type = typeList[index]; if ((type.instanceOf || type.predicate) && - (!type.instanceOf || (('object' === typeof object) && (object instanceof type.instanceOf))) && + (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && (!type.predicate || type.predicate(object))) { state.tag = explicit ? type.tag : '?'; @@ -680,7 +654,7 @@ function detectType(state, object, explicit) { if (type.represent) { style = state.styleMap[type.tag] || type.defaultStyle; - if ('[object Function]' === _toString.call(type.represent)) { + if (_toString.call(type.represent) === '[object Function]') { _result = type.represent(object, style); } else if (_hasOwnProperty.call(type.represent, style)) { _result = type.represent[style](object, style); @@ -701,7 +675,7 @@ function detectType(state, object, explicit) { // Serializes `object` and writes it to global `result`. // Returns true on success, or false on invalid object. // -function writeNode(state, level, object, block, compact) { +function writeNode(state, level, object, block, compact, iskey) { state.tag = null; state.dump = object; @@ -712,14 +686,10 @@ function writeNode(state, level, object, block, compact) { var type = _toString.call(state.dump); if (block) { - block = (0 > state.flowLevel || state.flowLevel > level); + block = (state.flowLevel < 0 || state.flowLevel > level); } - if ((null !== state.tag && '?' !== state.tag) || (2 !== state.indent && level > 0)) { - compact = false; - } - - var objectOrArray = '[object Object]' === type || '[object Array]' === type, + var objectOrArray = type === '[object Object]' || type === '[object Array]', duplicateIndex, duplicate; @@ -728,17 +698,21 @@ function writeNode(state, level, object, block, compact) { duplicate = duplicateIndex !== -1; } + if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { + compact = false; + } + if (duplicate && state.usedDuplicates[duplicateIndex]) { state.dump = '*ref_' + duplicateIndex; } else { if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { state.usedDuplicates[duplicateIndex] = true; } - if ('[object Object]' === type) { - if (block && (0 !== Object.keys(state.dump).length)) { + if (type === '[object Object]') { + if (block && (Object.keys(state.dump).length !== 0)) { writeBlockMapping(state, level, state.dump, compact); if (duplicate) { - state.dump = '&ref_' + duplicateIndex + (0 === level ? '\n' : '') + state.dump; + state.dump = '&ref_' + duplicateIndex + state.dump; } } else { writeFlowMapping(state, level, state.dump); @@ -746,11 +720,11 @@ function writeNode(state, level, object, block, compact) { state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; } } - } else if ('[object Array]' === type) { - if (block && (0 !== state.dump.length)) { + } else if (type === '[object Array]') { + if (block && (state.dump.length !== 0)) { writeBlockSequence(state, level, state.dump, compact); if (duplicate) { - state.dump = '&ref_' + duplicateIndex + (0 === level ? '\n' : '') + state.dump; + state.dump = '&ref_' + duplicateIndex + state.dump; } } else { writeFlowSequence(state, level, state.dump); @@ -758,18 +732,16 @@ function writeNode(state, level, object, block, compact) { state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; } } - } else if ('[object String]' === type) { - if ('?' !== state.tag) { - writeScalar(state, state.dump, level); + } else if (type === '[object String]') { + if (state.tag !== '?') { + writeScalar(state, state.dump, level, iskey); } } else { - if (state.skipInvalid) { - return false; - } + if (state.skipInvalid) return false; throw new YAMLException('unacceptable kind of an object to dump ' + type); } - if (null !== state.tag && '?' !== state.tag) { + if (state.tag !== null && state.tag !== '?') { state.dump = '!<' + state.tag + '> ' + state.dump; } } @@ -792,15 +764,14 @@ function getDuplicateReferences(object, state) { } function inspectNode(object, objects, duplicatesIndexes) { - var type = _toString.call(object), - objectKeyList, + var objectKeyList, index, length; - if (null !== object && 'object' === typeof object) { + if (object !== null && typeof object === 'object') { index = objects.indexOf(object); - if (-1 !== index) { - if (-1 === duplicatesIndexes.indexOf(index)) { + if (index !== -1) { + if (duplicatesIndexes.indexOf(index) === -1) { duplicatesIndexes.push(index); } } else { @@ -826,11 +797,10 @@ function dump(input, options) { var state = new State(options); - getDuplicateReferences(input, state); + if (!state.noRefs) getDuplicateReferences(input, state); + + if (writeNode(state, 0, input, true, true)) return state.dump + '\n'; - if (writeNode(state, 0, input, true, true)) { - return state.dump + '\n'; - } return ''; } diff --git a/tools/eslint/node_modules/js-yaml/lib/js-yaml/exception.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml/exception.js index 479ba88791de26..cf4e625209a7dc 100644 --- a/tools/eslint/node_modules/js-yaml/lib/js-yaml/exception.js +++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml/exception.js @@ -1,18 +1,36 @@ +// YAML error class. http://stackoverflow.com/questions/8458984 +// 'use strict'; - function YAMLException(reason, mark) { - this.name = 'YAMLException'; - this.reason = reason; - this.mark = mark; - this.message = this.toString(false); + // Super constructor + Error.call(this); + + // Include stack trace in error object + if (Error.captureStackTrace) { + // Chrome and NodeJS + Error.captureStackTrace(this, this.constructor); + } else { + // FF, IE 10+ and Safari 6+. Fallback for others + this.stack = (new Error()).stack || ''; + } + + this.name = 'YAMLException'; + this.reason = reason; + this.mark = mark; + this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); } +// Inherit from Error +YAMLException.prototype = Object.create(Error.prototype); +YAMLException.prototype.constructor = YAMLException; + + YAMLException.prototype.toString = function toString(compact) { - var result; + var result = this.name + ': '; - result = 'JS-YAML: ' + (this.reason || '(unknown reason)'); + result += this.reason || '(unknown reason)'; if (!compact && this.mark) { result += ' ' + this.mark.toString(); diff --git a/tools/eslint/node_modules/js-yaml/lib/js-yaml/loader.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml/loader.js index 1012ff56a1faf8..1714022f435291 100644 --- a/tools/eslint/node_modules/js-yaml/lib/js-yaml/loader.js +++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml/loader.js @@ -46,11 +46,11 @@ function is_WS_OR_EOL(c) { } function is_FLOW_INDICATOR(c) { - return 0x2C/* , */ === c || - 0x5B/* [ */ === c || - 0x5D/* ] */ === c || - 0x7B/* { */ === c || - 0x7D/* } */ === c; + return c === 0x2C/* , */ || + c === 0x5B/* [ */ || + c === 0x5D/* ] */ || + c === 0x7B/* { */ || + c === 0x7D/* } */; } function fromHexCode(c) { @@ -131,6 +131,8 @@ function State(input, options) { this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; this.onWarning = options['onWarning'] || null; this.legacy = options['legacy'] || false; + this.json = options['json'] || false; + this.listener = options['listener'] || null; this.implicitTypes = this.schema.compiledImplicit; this.typeMap = this.schema.compiledTypeMap; @@ -167,12 +169,8 @@ function throwError(state, message) { } function throwWarning(state, message) { - var error = generateError(state, message); - if (state.onWarning) { - state.onWarning.call(null, error); - } else { - throw error; + state.onWarning.call(null, generateError(state, message)); } } @@ -181,62 +179,62 @@ var directiveHandlers = { YAML: function handleYamlDirective(state, name, args) { - var match, major, minor; + var match, major, minor; - if (null !== state.version) { - throwError(state, 'duplication of %YAML directive'); - } + if (state.version !== null) { + throwError(state, 'duplication of %YAML directive'); + } - if (1 !== args.length) { - throwError(state, 'YAML directive accepts exactly one argument'); - } + if (args.length !== 1) { + throwError(state, 'YAML directive accepts exactly one argument'); + } - match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); - if (null === match) { - throwError(state, 'ill-formed argument of the YAML directive'); - } + if (match === null) { + throwError(state, 'ill-formed argument of the YAML directive'); + } - major = parseInt(match[1], 10); - minor = parseInt(match[2], 10); + major = parseInt(match[1], 10); + minor = parseInt(match[2], 10); - if (1 !== major) { - throwError(state, 'unacceptable YAML version of the document'); - } + if (major !== 1) { + throwError(state, 'unacceptable YAML version of the document'); + } - state.version = args[0]; - state.checkLineBreaks = (minor < 2); + state.version = args[0]; + state.checkLineBreaks = (minor < 2); - if (1 !== minor && 2 !== minor) { - throwWarning(state, 'unsupported YAML version of the document'); - } - }, + if (minor !== 1 && minor !== 2) { + throwWarning(state, 'unsupported YAML version of the document'); + } + }, TAG: function handleTagDirective(state, name, args) { - var handle, prefix; - - if (2 !== args.length) { - throwError(state, 'TAG directive accepts exactly two arguments'); - } + var handle, prefix; - handle = args[0]; - prefix = args[1]; + if (args.length !== 2) { + throwError(state, 'TAG directive accepts exactly two arguments'); + } - if (!PATTERN_TAG_HANDLE.test(handle)) { - throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); - } + handle = args[0]; + prefix = args[1]; - if (_hasOwnProperty.call(state.tagMap, handle)) { - throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); - } + if (!PATTERN_TAG_HANDLE.test(handle)) { + throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); + } - if (!PATTERN_TAG_URI.test(prefix)) { - throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); - } + if (_hasOwnProperty.call(state.tagMap, handle)) { + throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); + } - state.tagMap[handle] = prefix; + if (!PATTERN_TAG_URI.test(prefix)) { + throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); } + + state.tagMap[handle] = prefix; + } }; @@ -251,18 +249,20 @@ function captureSegment(state, start, end, checkJson) { _position < _length; _position += 1) { _character = _result.charCodeAt(_position); - if (!(0x09 === _character || - 0x20 <= _character && _character <= 0x10FFFF)) { + if (!(_character === 0x09 || + (0x20 <= _character && _character <= 0x10FFFF))) { throwError(state, 'expected valid JSON character'); } } + } else if (PATTERN_NON_PRINTABLE.test(_result)) { + throwError(state, 'the stream contains non-printable characters'); } state.result += _result; } } -function mergeMappings(state, destination, source) { +function mergeMappings(state, destination, source, overridableKeys) { var sourceKeys, key, index, quantity; if (!common.isObject(source)) { @@ -276,29 +276,36 @@ function mergeMappings(state, destination, source) { if (!_hasOwnProperty.call(destination, key)) { destination[key] = source[key]; + overridableKeys[key] = true; } } } -function storeMappingPair(state, _result, keyTag, keyNode, valueNode) { +function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode) { var index, quantity; keyNode = String(keyNode); - if (null === _result) { + if (_result === null) { _result = {}; } - if ('tag:yaml.org,2002:merge' === keyTag) { + if (keyTag === 'tag:yaml.org,2002:merge') { if (Array.isArray(valueNode)) { for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { - mergeMappings(state, _result, valueNode[index]); + mergeMappings(state, _result, valueNode[index], overridableKeys); } } else { - mergeMappings(state, _result, valueNode); + mergeMappings(state, _result, valueNode, overridableKeys); } } else { + if (!state.json && + !_hasOwnProperty.call(overridableKeys, keyNode) && + _hasOwnProperty.call(_result, keyNode)) { + throwError(state, 'duplicated mapping key'); + } _result[keyNode] = valueNode; + delete overridableKeys[keyNode]; } return _result; @@ -309,11 +316,11 @@ function readLineBreak(state) { ch = state.input.charCodeAt(state.position); - if (0x0A/* LF */ === ch) { + if (ch === 0x0A/* LF */) { state.position++; - } else if (0x0D/* CR */ === ch) { + } else if (ch === 0x0D/* CR */) { state.position++; - if (0x0A/* LF */ === state.input.charCodeAt(state.position)) { + if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { state.position++; } } else { @@ -328,15 +335,15 @@ function skipSeparationSpace(state, allowComments, checkIndent) { var lineBreaks = 0, ch = state.input.charCodeAt(state.position); - while (0 !== ch) { + while (ch !== 0) { while (is_WHITE_SPACE(ch)) { ch = state.input.charCodeAt(++state.position); } - if (allowComments && 0x23/* # */ === ch) { + if (allowComments && ch === 0x23/* # */) { do { ch = state.input.charCodeAt(++state.position); - } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && 0 !== ch); + } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); } if (is_EOL(ch)) { @@ -346,7 +353,7 @@ function skipSeparationSpace(state, allowComments, checkIndent) { lineBreaks++; state.lineIndent = 0; - while (0x20/* Space */ === ch) { + while (ch === 0x20/* Space */) { state.lineIndent++; ch = state.input.charCodeAt(++state.position); } @@ -355,7 +362,7 @@ function skipSeparationSpace(state, allowComments, checkIndent) { } } - if (-1 !== checkIndent && 0 !== lineBreaks && state.lineIndent < checkIndent) { + if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { throwWarning(state, 'deficient indentation'); } @@ -370,9 +377,9 @@ function testDocumentSeparator(state) { // Condition state.position === state.lineStart is tested // in parent on each call, for efficiency. No needs to test here again. - if ((0x2D/* - */ === ch || 0x2E/* . */ === ch) && - state.input.charCodeAt(_position + 1) === ch && - state.input.charCodeAt(_position + 2) === ch) { + if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && + ch === state.input.charCodeAt(_position + 1) && + ch === state.input.charCodeAt(_position + 2)) { _position += 3; @@ -387,7 +394,7 @@ function testDocumentSeparator(state) { } function writeFoldedLines(state, count) { - if (1 === count) { + if (count === 1) { state.result += ' '; } else if (count > 1) { state.result += common.repeat('\n', count - 1); @@ -410,23 +417,23 @@ function readPlainScalar(state, nodeIndent, withinFlowCollection) { ch = state.input.charCodeAt(state.position); - if (is_WS_OR_EOL(ch) || - is_FLOW_INDICATOR(ch) || - 0x23/* # */ === ch || - 0x26/* & */ === ch || - 0x2A/* * */ === ch || - 0x21/* ! */ === ch || - 0x7C/* | */ === ch || - 0x3E/* > */ === ch || - 0x27/* ' */ === ch || - 0x22/* " */ === ch || - 0x25/* % */ === ch || - 0x40/* @ */ === ch || - 0x60/* ` */ === ch) { + if (is_WS_OR_EOL(ch) || + is_FLOW_INDICATOR(ch) || + ch === 0x23/* # */ || + ch === 0x26/* & */ || + ch === 0x2A/* * */ || + ch === 0x21/* ! */ || + ch === 0x7C/* | */ || + ch === 0x3E/* > */ || + ch === 0x27/* ' */ || + ch === 0x22/* " */ || + ch === 0x25/* % */ || + ch === 0x40/* @ */ || + ch === 0x60/* ` */) { return false; } - if (0x3F/* ? */ === ch || 0x2D/* - */ === ch) { + if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { following = state.input.charCodeAt(state.position + 1); if (is_WS_OR_EOL(following) || @@ -440,8 +447,8 @@ function readPlainScalar(state, nodeIndent, withinFlowCollection) { captureStart = captureEnd = state.position; hasPendingContent = false; - while (0 !== ch) { - if (0x3A/* : */ === ch) { + while (ch !== 0) { + if (ch === 0x3A/* : */) { following = state.input.charCodeAt(state.position + 1); if (is_WS_OR_EOL(following) || @@ -449,7 +456,7 @@ function readPlainScalar(state, nodeIndent, withinFlowCollection) { break; } - } else if (0x23/* # */ === ch) { + } else if (ch === 0x23/* # */) { preceding = state.input.charCodeAt(state.position - 1); if (is_WS_OR_EOL(preceding)) { @@ -510,7 +517,7 @@ function readSingleQuotedScalar(state, nodeIndent) { ch = state.input.charCodeAt(state.position); - if (0x27/* ' */ !== ch) { + if (ch !== 0x27/* ' */) { return false; } @@ -519,12 +526,12 @@ function readSingleQuotedScalar(state, nodeIndent) { state.position++; captureStart = captureEnd = state.position; - while (0 !== (ch = state.input.charCodeAt(state.position))) { - if (0x27/* ' */ === ch) { + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x27/* ' */) { captureSegment(state, captureStart, state.position, true); ch = state.input.charCodeAt(++state.position); - if (0x27/* ' */ === ch) { + if (ch === 0x27/* ' */) { captureStart = captureEnd = state.position; state.position++; } else { @@ -553,12 +560,12 @@ function readDoubleQuotedScalar(state, nodeIndent) { captureEnd, hexLength, hexResult, - tmp, tmpEsc, + tmp, ch; ch = state.input.charCodeAt(state.position); - if (0x22/* " */ !== ch) { + if (ch !== 0x22/* " */) { return false; } @@ -567,13 +574,13 @@ function readDoubleQuotedScalar(state, nodeIndent) { state.position++; captureStart = captureEnd = state.position; - while (0 !== (ch = state.input.charCodeAt(state.position))) { - if (0x22/* " */ === ch) { + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x22/* " */) { captureSegment(state, captureStart, state.position, true); state.position++; return true; - } else if (0x5C/* \ */ === ch) { + } else if (ch === 0x5C/* \ */) { captureSegment(state, captureStart, state.position, true); ch = state.input.charCodeAt(++state.position); @@ -638,6 +645,7 @@ function readFlowCollection(state, nodeIndent) { isPair, isExplicitPair, isMapping, + overridableKeys = {}, keyNode, keyTag, valueNode, @@ -657,13 +665,13 @@ function readFlowCollection(state, nodeIndent) { return false; } - if (null !== state.anchor) { + if (state.anchor !== null) { state.anchorMap[state.anchor] = _result; } ch = state.input.charCodeAt(++state.position); - while (0 !== ch) { + while (ch !== 0) { skipSeparationSpace(state, true, nodeIndent); ch = state.input.charCodeAt(state.position); @@ -682,7 +690,7 @@ function readFlowCollection(state, nodeIndent) { keyTag = keyNode = valueNode = null; isPair = isExplicitPair = false; - if (0x3F/* ? */ === ch) { + if (ch === 0x3F/* ? */) { following = state.input.charCodeAt(state.position + 1); if (is_WS_OR_EOL(following)) { @@ -700,7 +708,7 @@ function readFlowCollection(state, nodeIndent) { ch = state.input.charCodeAt(state.position); - if ((isExplicitPair || state.line === _line) && 0x3A/* : */ === ch) { + if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { isPair = true; ch = state.input.charCodeAt(++state.position); skipSeparationSpace(state, true, nodeIndent); @@ -709,9 +717,9 @@ function readFlowCollection(state, nodeIndent) { } if (isMapping) { - storeMappingPair(state, _result, keyTag, keyNode, valueNode); + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode); } else if (isPair) { - _result.push(storeMappingPair(state, null, keyTag, keyNode, valueNode)); + _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode)); } else { _result.push(keyNode); } @@ -720,7 +728,7 @@ function readFlowCollection(state, nodeIndent) { ch = state.input.charCodeAt(state.position); - if (0x2C/* , */ === ch) { + if (ch === 0x2C/* , */) { readNext = true; ch = state.input.charCodeAt(++state.position); } else { @@ -755,12 +763,12 @@ function readBlockScalar(state, nodeIndent) { state.kind = 'scalar'; state.result = ''; - while (0 !== ch) { + while (ch !== 0) { ch = state.input.charCodeAt(++state.position); - if (0x2B/* + */ === ch || 0x2D/* - */ === ch) { + if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { if (CHOMPING_CLIP === chomping) { - chomping = (0x2B/* + */ === ch) ? CHOMPING_KEEP : CHOMPING_STRIP; + chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; } else { throwError(state, 'repeat of a chomping mode identifier'); } @@ -784,20 +792,20 @@ function readBlockScalar(state, nodeIndent) { do { ch = state.input.charCodeAt(++state.position); } while (is_WHITE_SPACE(ch)); - if (0x23/* # */ === ch) { + if (ch === 0x23/* # */) { do { ch = state.input.charCodeAt(++state.position); } - while (!is_EOL(ch) && (0 !== ch)); + while (!is_EOL(ch) && (ch !== 0)); } } - while (0 !== ch) { + while (ch !== 0) { readLineBreak(state); state.lineIndent = 0; ch = state.input.charCodeAt(state.position); while ((!detectedIndent || state.lineIndent < textIndent) && - (0x20/* Space */ === ch)) { + (ch === 0x20/* Space */)) { state.lineIndent++; ch = state.input.charCodeAt(++state.position); } @@ -841,7 +849,7 @@ function readBlockScalar(state, nodeIndent) { state.result += common.repeat('\n', emptyLines + 1); // Just one line break - perceive as the same line. - } else if (0 === emptyLines) { + } else if (emptyLines === 0) { if (detectedIndent) { // i.e. only if we have already read some scalar content. state.result += ' '; } @@ -857,13 +865,14 @@ function readBlockScalar(state, nodeIndent) { state.result += common.repeat('\n', emptyLines + 1); } else { // In case of the first content line - count only empty lines. + state.result += common.repeat('\n', emptyLines); } detectedIndent = true; emptyLines = 0; captureStart = state.position; - while (!is_EOL(ch) && (0 !== ch)) { + while (!is_EOL(ch) && (ch !== 0)) { ch = state.input.charCodeAt(++state.position); } @@ -882,15 +891,15 @@ function readBlockSequence(state, nodeIndent) { detected = false, ch; - if (null !== state.anchor) { + if (state.anchor !== null) { state.anchorMap[state.anchor] = _result; } ch = state.input.charCodeAt(state.position); - while (0 !== ch) { + while (ch !== 0) { - if (0x2D/* - */ !== ch) { + if (ch !== 0x2D/* - */) { break; } @@ -918,7 +927,7 @@ function readBlockSequence(state, nodeIndent) { ch = state.input.charCodeAt(state.position); - if ((state.line === _line || state.lineIndent > nodeIndent) && (0 !== ch)) { + if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { throwError(state, 'bad indentation of a sequence entry'); } else if (state.lineIndent < nodeIndent) { break; @@ -942,6 +951,7 @@ function readBlockMapping(state, nodeIndent, flowIndent) { _tag = state.tag, _anchor = state.anchor, _result = {}, + overridableKeys = {}, keyTag = null, keyNode = null, valueNode = null, @@ -949,13 +959,13 @@ function readBlockMapping(state, nodeIndent, flowIndent) { detected = false, ch; - if (null !== state.anchor) { + if (state.anchor !== null) { state.anchorMap[state.anchor] = _result; } ch = state.input.charCodeAt(state.position); - while (0 !== ch) { + while (ch !== 0) { following = state.input.charCodeAt(state.position + 1); _line = state.line; // Save the current line. @@ -963,11 +973,11 @@ function readBlockMapping(state, nodeIndent, flowIndent) { // Explicit notation case. There are two separate blocks: // first for the key (denoted by "?") and second for the value (denoted by ":") // - if ((0x3F/* ? */ === ch || 0x3A/* : */ === ch) && is_WS_OR_EOL(following)) { + if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { - if (0x3F/* ? */ === ch) { + if (ch === 0x3F/* ? */) { if (atExplicitKey) { - storeMappingPair(state, _result, keyTag, keyNode, null); + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); keyTag = keyNode = valueNode = null; } @@ -999,7 +1009,7 @@ function readBlockMapping(state, nodeIndent, flowIndent) { ch = state.input.charCodeAt(++state.position); } - if (0x3A/* : */ === ch) { + if (ch === 0x3A/* : */) { ch = state.input.charCodeAt(++state.position); if (!is_WS_OR_EOL(ch)) { @@ -1007,7 +1017,7 @@ function readBlockMapping(state, nodeIndent, flowIndent) { } if (atExplicitKey) { - storeMappingPair(state, _result, keyTag, keyNode, null); + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); keyTag = keyNode = valueNode = null; } @@ -1052,7 +1062,7 @@ function readBlockMapping(state, nodeIndent, flowIndent) { } if (!atExplicitKey) { - storeMappingPair(state, _result, keyTag, keyNode, valueNode); + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode); keyTag = keyNode = valueNode = null; } @@ -1060,7 +1070,7 @@ function readBlockMapping(state, nodeIndent, flowIndent) { ch = state.input.charCodeAt(state.position); } - if (state.lineIndent > nodeIndent && (0 !== ch)) { + if (state.lineIndent > nodeIndent && (ch !== 0)) { throwError(state, 'bad indentation of a mapping entry'); } else if (state.lineIndent < nodeIndent) { break; @@ -1073,7 +1083,7 @@ function readBlockMapping(state, nodeIndent, flowIndent) { // Special case: last mapping's node contains only the key in explicit notation. if (atExplicitKey) { - storeMappingPair(state, _result, keyTag, keyNode, null); + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); } // Expose the resulting mapping. @@ -1097,21 +1107,19 @@ function readTagProperty(state) { ch = state.input.charCodeAt(state.position); - if (0x21/* ! */ !== ch) { - return false; - } + if (ch !== 0x21/* ! */) return false; - if (null !== state.tag) { + if (state.tag !== null) { throwError(state, 'duplication of a tag property'); } ch = state.input.charCodeAt(++state.position); - if (0x3C/* < */ === ch) { + if (ch === 0x3C/* < */) { isVerbatim = true; ch = state.input.charCodeAt(++state.position); - } else if (0x21/* ! */ === ch) { + } else if (ch === 0x21/* ! */) { isNamed = true; tagHandle = '!!'; ch = state.input.charCodeAt(++state.position); @@ -1124,7 +1132,7 @@ function readTagProperty(state) { if (isVerbatim) { do { ch = state.input.charCodeAt(++state.position); } - while (0 !== ch && 0x3E/* > */ !== ch); + while (ch !== 0 && ch !== 0x3E/* > */); if (state.position < state.length) { tagName = state.input.slice(_position, state.position); @@ -1133,9 +1141,9 @@ function readTagProperty(state) { throwError(state, 'unexpected end of the stream within a verbatim tag'); } } else { - while (0 !== ch && !is_WS_OR_EOL(ch)) { + while (ch !== 0 && !is_WS_OR_EOL(ch)) { - if (0x21/* ! */ === ch) { + if (ch === 0x21/* ! */) { if (!isNamed) { tagHandle = state.input.slice(_position - 1, state.position + 1); @@ -1170,10 +1178,10 @@ function readTagProperty(state) { } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { state.tag = state.tagMap[tagHandle] + tagName; - } else if ('!' === tagHandle) { + } else if (tagHandle === '!') { state.tag = '!' + tagName; - } else if ('!!' === tagHandle) { + } else if (tagHandle === '!!') { state.tag = 'tag:yaml.org,2002:' + tagName; } else { @@ -1189,18 +1197,16 @@ function readAnchorProperty(state) { ch = state.input.charCodeAt(state.position); - if (0x26/* & */ !== ch) { - return false; - } + if (ch !== 0x26/* & */) return false; - if (null !== state.anchor) { + if (state.anchor !== null) { throwError(state, 'duplication of an anchor property'); } ch = state.input.charCodeAt(++state.position); _position = state.position; - while (0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { ch = state.input.charCodeAt(++state.position); } @@ -1214,20 +1220,16 @@ function readAnchorProperty(state) { function readAlias(state) { var _position, alias, - len = state.length, - input = state.input, ch; ch = state.input.charCodeAt(state.position); - if (0x2A/* * */ !== ch) { - return false; - } + if (ch !== 0x2A/* * */) return false; ch = state.input.charCodeAt(++state.position); _position = state.position; - while (0 !== ch && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { ch = state.input.charCodeAt(++state.position); } @@ -1257,8 +1259,11 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact typeQuantity, type, flowIndent, - blockIndent, - _result; + blockIndent; + + if (state.listener !== null) { + state.listener('open', state); + } state.tag = null; state.anchor = null; @@ -1283,7 +1288,7 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact } } - if (1 === indentStatus) { + if (indentStatus === 1) { while (readTagProperty(state) || readAnchorProperty(state)) { if (skipSeparationSpace(state, true, -1)) { atNewLine = true; @@ -1306,7 +1311,7 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact allowBlockCollections = atNewLine || allowCompact; } - if (1 === indentStatus || CONTEXT_BLOCK_OUT === nodeContext) { + if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { flowIndent = parentIndent; } else { @@ -1315,7 +1320,7 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact blockIndent = state.position - state.lineStart; - if (1 === indentStatus) { + if (indentStatus === 1) { if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || @@ -1330,31 +1335,31 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact } else if (readAlias(state)) { hasContent = true; - if (null !== state.tag || null !== state.anchor) { + if (state.tag !== null || state.anchor !== null) { throwError(state, 'alias node should not have any properties'); } } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { hasContent = true; - if (null === state.tag) { + if (state.tag === null) { state.tag = '?'; } } - if (null !== state.anchor) { + if (state.anchor !== null) { state.anchorMap[state.anchor] = state.result; } } - } else if (0 === indentStatus) { + } else if (indentStatus === 0) { // Special case: block sequences are allowed to have same indentation level as the parent. // http://www.yaml.org/spec/1.2/spec.html#id2799784 hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); } } - if (null !== state.tag && '!' !== state.tag) { - if ('?' === state.tag) { + if (state.tag !== null && state.tag !== '!') { + if (state.tag === '?') { for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { @@ -1367,7 +1372,7 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact if (type.resolve(state.result)) { // `state.result` updated in resolver if matched state.result = type.construct(state.result); state.tag = type.tag; - if (null !== state.anchor) { + if (state.anchor !== null) { state.anchorMap[state.anchor] = state.result; } break; @@ -1376,7 +1381,7 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact } else if (_hasOwnProperty.call(state.typeMap, state.tag)) { type = state.typeMap[state.tag]; - if (null !== state.result && type.kind !== state.kind) { + if (state.result !== null && type.kind !== state.kind) { throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); } @@ -1384,16 +1389,19 @@ function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); } else { state.result = type.construct(state.result); - if (null !== state.anchor) { + if (state.anchor !== null) { state.anchorMap[state.anchor] = state.result; } } } else { - throwWarning(state, 'unknown tag !<' + state.tag + '>'); + throwError(state, 'unknown tag !<' + state.tag + '>'); } } - return null !== state.tag || null !== state.anchor || hasContent; + if (state.listener !== null) { + state.listener('close', state); + } + return state.tag !== null || state.anchor !== null || hasContent; } function readDocument(state) { @@ -1409,12 +1417,12 @@ function readDocument(state) { state.tagMap = {}; state.anchorMap = {}; - while (0 !== (ch = state.input.charCodeAt(state.position))) { + while ((ch = state.input.charCodeAt(state.position)) !== 0) { skipSeparationSpace(state, true, -1); ch = state.input.charCodeAt(state.position); - if (state.lineIndent > 0 || 0x25/* % */ !== ch) { + if (state.lineIndent > 0 || ch !== 0x25/* % */) { break; } @@ -1422,7 +1430,7 @@ function readDocument(state) { ch = state.input.charCodeAt(++state.position); _position = state.position; - while (0 !== ch && !is_WS_OR_EOL(ch)) { + while (ch !== 0 && !is_WS_OR_EOL(ch)) { ch = state.input.charCodeAt(++state.position); } @@ -1433,33 +1441,29 @@ function readDocument(state) { throwError(state, 'directive name must not be less than one character in length'); } - while (0 !== ch) { + while (ch !== 0) { while (is_WHITE_SPACE(ch)) { ch = state.input.charCodeAt(++state.position); } - if (0x23/* # */ === ch) { + if (ch === 0x23/* # */) { do { ch = state.input.charCodeAt(++state.position); } - while (0 !== ch && !is_EOL(ch)); + while (ch !== 0 && !is_EOL(ch)); break; } - if (is_EOL(ch)) { - break; - } + if (is_EOL(ch)) break; _position = state.position; - while (0 !== ch && !is_WS_OR_EOL(ch)) { + while (ch !== 0 && !is_WS_OR_EOL(ch)) { ch = state.input.charCodeAt(++state.position); } directiveArgs.push(state.input.slice(_position, state.position)); } - if (0 !== ch) { - readLineBreak(state); - } + if (ch !== 0) readLineBreak(state); if (_hasOwnProperty.call(directiveHandlers, directiveName)) { directiveHandlers[directiveName](state, directiveName, directiveArgs); @@ -1470,10 +1474,10 @@ function readDocument(state) { skipSeparationSpace(state, true, -1); - if (0 === state.lineIndent && - 0x2D/* - */ === state.input.charCodeAt(state.position) && - 0x2D/* - */ === state.input.charCodeAt(state.position + 1) && - 0x2D/* - */ === state.input.charCodeAt(state.position + 2)) { + if (state.lineIndent === 0 && + state.input.charCodeAt(state.position) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { state.position += 3; skipSeparationSpace(state, true, -1); @@ -1493,7 +1497,7 @@ function readDocument(state) { if (state.position === state.lineStart && testDocumentSeparator(state)) { - if (0x2E/* . */ === state.input.charCodeAt(state.position)) { + if (state.input.charCodeAt(state.position) === 0x2E/* . */) { state.position += 3; skipSeparationSpace(state, true, -1); } @@ -1515,8 +1519,8 @@ function loadDocuments(input, options) { if (input.length !== 0) { // Add tailing `\n` if not exists - if (0x0A/* LF */ !== input.charCodeAt(input.length - 1) && - 0x0D/* CR */ !== input.charCodeAt(input.length - 1)) { + if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && + input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { input += '\n'; } @@ -1528,14 +1532,10 @@ function loadDocuments(input, options) { var state = new State(input, options); - if (PATTERN_NON_PRINTABLE.test(state.input)) { - throwError(state, 'the stream contains non-printable characters'); - } - // Use 0 as string terminator. That significantly simplifies bounds check. state.input += '\0'; - while (0x20/* Space */ === state.input.charCodeAt(state.position)) { + while (state.input.charCodeAt(state.position) === 0x20/* Space */) { state.lineIndent += 1; state.position += 1; } @@ -1558,12 +1558,12 @@ function loadAll(input, iterator, options) { function load(input, options) { - var documents = loadDocuments(input, options), index, length; + var documents = loadDocuments(input, options); - if (0 === documents.length) { + if (documents.length === 0) { /*eslint-disable no-undefined*/ return undefined; - } else if (1 === documents.length) { + } else if (documents.length === 1) { return documents[0]; } throw new YAMLException('expected a single document in the stream, but found more'); diff --git a/tools/eslint/node_modules/js-yaml/lib/js-yaml/mark.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml/mark.js index bfe279ba52c3a9..47b265c20cea4c 100644 --- a/tools/eslint/node_modules/js-yaml/lib/js-yaml/mark.js +++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml/mark.js @@ -16,9 +16,7 @@ function Mark(name, buffer, position, line, column) { Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { var head, start, tail, end, snippet; - if (!this.buffer) { - return null; - } + if (!this.buffer) return null; indent = indent || 4; maxLength = maxLength || 75; @@ -26,7 +24,7 @@ Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { head = ''; start = this.position; - while (start > 0 && -1 === '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1))) { + while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) { start -= 1; if (this.position - start > (maxLength / 2 - 1)) { head = ' ... '; @@ -38,7 +36,7 @@ Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { tail = ''; end = this.position; - while (end < this.buffer.length && -1 === '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end))) { + while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) { end += 1; if (end - this.position > (maxLength / 2 - 1)) { tail = ' ... '; diff --git a/tools/eslint/node_modules/js-yaml/lib/js-yaml/schema.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml/schema.js index 984e2904f3b2a1..32803ff14c51ad 100644 --- a/tools/eslint/node_modules/js-yaml/lib/js-yaml/schema.js +++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml/schema.js @@ -25,7 +25,7 @@ function compileList(schema, name, result) { }); return result.filter(function (type, index) { - return -1 === exclude.indexOf(index); + return exclude.indexOf(index) === -1; }); } @@ -51,7 +51,7 @@ function Schema(definition) { this.explicit = definition.explicit || []; this.implicit.forEach(function (type) { - if (type.loadKind && 'scalar' !== type.loadKind) { + if (type.loadKind && type.loadKind !== 'scalar') { throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); } }); @@ -69,18 +69,18 @@ Schema.create = function createSchema() { var schemas, types; switch (arguments.length) { - case 1: - schemas = Schema.DEFAULT; - types = arguments[0]; - break; - - case 2: - schemas = arguments[0]; - types = arguments[1]; - break; - - default: - throw new YAMLException('Wrong number of arguments for Schema.create function'); + case 1: + schemas = Schema.DEFAULT; + types = arguments[0]; + break; + + case 2: + schemas = arguments[0]; + types = arguments[1]; + break; + + default: + throw new YAMLException('Wrong number of arguments for Schema.create function'); } schemas = common.toArray(schemas); diff --git a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type.js index 5e3176cebef887..90b702ac06f11b 100644 --- a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type.js +++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type.js @@ -22,7 +22,7 @@ var YAML_NODE_KINDS = [ function compileStyleAliases(map) { var result = {}; - if (null !== map) { + if (map !== null) { Object.keys(map).forEach(function (style) { map[style].forEach(function (alias) { result[String(alias)] = style; @@ -37,7 +37,7 @@ function Type(tag, options) { options = options || {}; Object.keys(options).forEach(function (name) { - if (-1 === TYPE_CONSTRUCTOR_OPTIONS.indexOf(name)) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); } }); @@ -53,7 +53,7 @@ function Type(tag, options) { this.defaultStyle = options['defaultStyle'] || null; this.styleAliases = compileStyleAliases(options['styleAliases'] || null); - if (-1 === YAML_NODE_KINDS.indexOf(this.kind)) { + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); } } diff --git a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/binary.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/binary.js index 122155c75bdab2..b2c32d914b4ed4 100644 --- a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/binary.js +++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/binary.js @@ -13,21 +13,19 @@ var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 function resolveYamlBinary(data) { - if (null === data) { - return false; - } + if (data === null) return false; - var code, idx, bitlen = 0, len = 0, max = data.length, map = BASE64_MAP; + var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; // Convert one by one. for (idx = 0; idx < max; idx++) { code = map.indexOf(data.charAt(idx)); // Skip CR/LF - if (code > 64) { continue; } + if (code > 64) continue; // Fail on illegal characters - if (code < 0) { return false; } + if (code < 0) return false; bitlen += 6; } @@ -37,7 +35,7 @@ function resolveYamlBinary(data) { } function constructYamlBinary(data) { - var code, idx, tailbits, + var idx, tailbits, input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan max = input.length, map = BASE64_MAP, @@ -72,9 +70,7 @@ function constructYamlBinary(data) { } // Wrap into Buffer for NodeJS and leave Array for browser - if (NodeBuffer) { - return new NodeBuffer(result); - } + if (NodeBuffer) return new NodeBuffer(result); return result; } diff --git a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/bool.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/bool.js index 5c2a304d8a46d8..cb7745930a6e7f 100644 --- a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/bool.js +++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/bool.js @@ -3,9 +3,7 @@ var Type = require('../type'); function resolveYamlBoolean(data) { - if (null === data) { - return false; - } + if (data === null) return false; var max = data.length; @@ -20,7 +18,7 @@ function constructYamlBoolean(data) { } function isBoolean(object) { - return '[object Boolean]' === Object.prototype.toString.call(object); + return Object.prototype.toString.call(object) === '[object Boolean]'; } module.exports = new Type('tag:yaml.org,2002:bool', { diff --git a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/float.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/float.js index 67c9c21f247a8d..76871547c2d5b3 100644 --- a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/float.js +++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/float.js @@ -11,15 +11,10 @@ var YAML_FLOAT_PATTERN = new RegExp( '|\\.(?:nan|NaN|NAN))$'); function resolveYamlFloat(data) { - if (null === data) { - return false; - } + if (data === null) return false; - var value, sign, base, digits; + if (!YAML_FLOAT_PATTERN.test(data)) return false; - if (!YAML_FLOAT_PATTERN.test(data)) { - return false; - } return true; } @@ -27,20 +22,20 @@ function constructYamlFloat(data) { var value, sign, base, digits; value = data.replace(/_/g, '').toLowerCase(); - sign = '-' === value[0] ? -1 : 1; + sign = value[0] === '-' ? -1 : 1; digits = []; - if (0 <= '+-'.indexOf(value[0])) { + if ('+-'.indexOf(value[0]) >= 0) { value = value.slice(1); } - if ('.inf' === value) { - return (1 === sign) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; + if (value === '.inf') { + return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; - } else if ('.nan' === value) { + } else if (value === '.nan') { return NaN; - } else if (0 <= value.indexOf(':')) { + } else if (value.indexOf(':') >= 0) { value.split(':').forEach(function (v) { digits.unshift(parseFloat(v, 10)); }); @@ -59,43 +54,45 @@ function constructYamlFloat(data) { return sign * parseFloat(value, 10); } + +var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; + function representYamlFloat(object, style) { + var res; + if (isNaN(object)) { switch (style) { - case 'lowercase': - return '.nan'; - case 'uppercase': - return '.NAN'; - case 'camelcase': - return '.NaN'; + case 'lowercase': return '.nan'; + case 'uppercase': return '.NAN'; + case 'camelcase': return '.NaN'; } } else if (Number.POSITIVE_INFINITY === object) { switch (style) { - case 'lowercase': - return '.inf'; - case 'uppercase': - return '.INF'; - case 'camelcase': - return '.Inf'; + case 'lowercase': return '.inf'; + case 'uppercase': return '.INF'; + case 'camelcase': return '.Inf'; } } else if (Number.NEGATIVE_INFINITY === object) { switch (style) { - case 'lowercase': - return '-.inf'; - case 'uppercase': - return '-.INF'; - case 'camelcase': - return '-.Inf'; + case 'lowercase': return '-.inf'; + case 'uppercase': return '-.INF'; + case 'camelcase': return '-.Inf'; } } else if (common.isNegativeZero(object)) { return '-0.0'; } - return object.toString(10); + + res = object.toString(10); + + // JS stringifier can build scientific format without dots: 5e-100, + // while YAML requres dot: 5.e-100. Fix it with simple hack + + return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; } function isFloat(object) { - return ('[object Number]' === Object.prototype.toString.call(object)) && - (0 !== object % 1 || common.isNegativeZero(object)); + return (Object.prototype.toString.call(object) === '[object Number]') && + (object % 1 !== 0 || common.isNegativeZero(object)); } module.exports = new Type('tag:yaml.org,2002:float', { diff --git a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/int.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/int.js index 800f10608ad1d3..a3c496503d6bbc 100644 --- a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/int.js +++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/int.js @@ -18,16 +18,14 @@ function isDecCode(c) { } function resolveYamlInteger(data) { - if (null === data) { - return false; - } + if (data === null) return false; var max = data.length, index = 0, hasDigits = false, ch; - if (!max) { return false; } + if (!max) return false; ch = data[index]; @@ -38,7 +36,7 @@ function resolveYamlInteger(data) { if (ch === '0') { // 0 - if (index + 1 === max) { return true; } + if (index + 1 === max) return true; ch = data[++index]; // base 2, base 8, base 16 @@ -49,10 +47,8 @@ function resolveYamlInteger(data) { for (; index < max; index++) { ch = data[index]; - if (ch === '_') { continue; } - if (ch !== '0' && ch !== '1') { - return false; - } + if (ch === '_') continue; + if (ch !== '0' && ch !== '1') return false; hasDigits = true; } return hasDigits; @@ -65,10 +61,8 @@ function resolveYamlInteger(data) { for (; index < max; index++) { ch = data[index]; - if (ch === '_') { continue; } - if (!isHexCode(data.charCodeAt(index))) { - return false; - } + if (ch === '_') continue; + if (!isHexCode(data.charCodeAt(index))) return false; hasDigits = true; } return hasDigits; @@ -77,10 +71,8 @@ function resolveYamlInteger(data) { // base 8 for (; index < max; index++) { ch = data[index]; - if (ch === '_') { continue; } - if (!isOctCode(data.charCodeAt(index))) { - return false; - } + if (ch === '_') continue; + if (!isOctCode(data.charCodeAt(index))) return false; hasDigits = true; } return hasDigits; @@ -90,18 +82,18 @@ function resolveYamlInteger(data) { for (; index < max; index++) { ch = data[index]; - if (ch === '_') { continue; } - if (ch === ':') { break; } + if (ch === '_') continue; + if (ch === ':') break; if (!isDecCode(data.charCodeAt(index))) { return false; } hasDigits = true; } - if (!hasDigits) { return false; } + if (!hasDigits) return false; // if !base60 - done; - if (ch !== ':') { return true; } + if (ch !== ':') return true; // base60 almost not used, no needs to optimize return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); @@ -117,24 +109,17 @@ function constructYamlInteger(data) { ch = value[0]; if (ch === '-' || ch === '+') { - if (ch === '-') { sign = -1; } + if (ch === '-') sign = -1; value = value.slice(1); ch = value[0]; } - if ('0' === value) { - return 0; - } + if (value === '0') return 0; if (ch === '0') { - if (value[1] === 'b') { - return sign * parseInt(value.slice(2), 2); - } - if (value[1] === 'x') { - return sign * parseInt(value, 16); - } + if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); + if (value[1] === 'x') return sign * parseInt(value, 16); return sign * parseInt(value, 8); - } if (value.indexOf(':') !== -1) { @@ -158,8 +143,8 @@ function constructYamlInteger(data) { } function isInteger(object) { - return ('[object Number]' === Object.prototype.toString.call(object)) && - (0 === object % 1 && !common.isNegativeZero(object)); + return (Object.prototype.toString.call(object)) === '[object Number]' && + (object % 1 === 0 && !common.isNegativeZero(object)); } module.exports = new Type('tag:yaml.org,2002:int', { diff --git a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/js/function.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/js/function.js index 4061c43ad11714..c6a42d00220714 100644 --- a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/js/function.js +++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/js/function.js @@ -10,29 +10,27 @@ var esprima; // found too - then fail to parse. // try { - esprima = require('esprima'); + // workaround to exclude package from browserify list. + var _require = require; + esprima = _require('esprima'); } catch (_) { /*global window */ - if (typeof window !== 'undefined') { esprima = window.esprima; } + if (typeof window !== 'undefined') esprima = window.esprima; } var Type = require('../../type'); function resolveJavascriptFunction(data) { - if (null === data) { - return false; - } + if (data === null) return false; try { var source = '(' + data + ')', - ast = esprima.parse(source, { range: true }), - params = [], - body; - - if ('Program' !== ast.type || - 1 !== ast.body.length || - 'ExpressionStatement' !== ast.body[0].type || - 'FunctionExpression' !== ast.body[0].expression.type) { + ast = esprima.parse(source, { range: true }); + + if (ast.type !== 'Program' || + ast.body.length !== 1 || + ast.body[0].type !== 'ExpressionStatement' || + ast.body[0].expression.type !== 'FunctionExpression') { return false; } @@ -50,10 +48,10 @@ function constructJavascriptFunction(data) { params = [], body; - if ('Program' !== ast.type || - 1 !== ast.body.length || - 'ExpressionStatement' !== ast.body[0].type || - 'FunctionExpression' !== ast.body[0].expression.type) { + if (ast.type !== 'Program' || + ast.body.length !== 1 || + ast.body[0].type !== 'ExpressionStatement' || + ast.body[0].expression.type !== 'FunctionExpression') { throw new Error('Failed to resolve function'); } @@ -74,7 +72,7 @@ function representJavascriptFunction(object /*, style*/) { } function isFunction(object) { - return '[object Function]' === Object.prototype.toString.call(object); + return Object.prototype.toString.call(object) === '[object Function]'; } module.exports = new Type('tag:yaml.org,2002:js/function', { diff --git a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js index 07ef5218ed91f0..43fa47017619ec 100644 --- a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js @@ -3,13 +3,8 @@ var Type = require('../../type'); function resolveJavascriptRegExp(data) { - if (null === data) { - return false; - } - - if (0 === data.length) { - return false; - } + if (data === null) return false; + if (data.length === 0) return false; var regexp = data, tail = /\/([gim]*)$/.exec(data), @@ -17,24 +12,15 @@ function resolveJavascriptRegExp(data) { // if regexp starts with '/' it can have modifiers and must be properly closed // `/foo/gim` - modifiers tail can be maximum 3 chars - if ('/' === regexp[0]) { - if (tail) { - modifiers = tail[1]; - } + if (regexp[0] === '/') { + if (tail) modifiers = tail[1]; - if (modifiers.length > 3) { return false; } + if (modifiers.length > 3) return false; // if expression starts with /, is should be properly terminated - if (regexp[regexp.length - modifiers.length - 1] !== '/') { return false; } - - regexp = regexp.slice(1, regexp.length - modifiers.length - 1); + if (regexp[regexp.length - modifiers.length - 1] !== '/') return false; } - try { - var dummy = new RegExp(regexp, modifiers); - return true; - } catch (error) { - return false; - } + return true; } function constructJavascriptRegExp(data) { @@ -43,10 +29,8 @@ function constructJavascriptRegExp(data) { modifiers = ''; // `/foo/gim` - tail can be maximum 4 chars - if ('/' === regexp[0]) { - if (tail) { - modifiers = tail[1]; - } + if (regexp[0] === '/') { + if (tail) modifiers = tail[1]; regexp = regexp.slice(1, regexp.length - modifiers.length - 1); } @@ -56,23 +40,15 @@ function constructJavascriptRegExp(data) { function representJavascriptRegExp(object /*, style*/) { var result = '/' + object.source + '/'; - if (object.global) { - result += 'g'; - } - - if (object.multiline) { - result += 'm'; - } - - if (object.ignoreCase) { - result += 'i'; - } + if (object.global) result += 'g'; + if (object.multiline) result += 'm'; + if (object.ignoreCase) result += 'i'; return result; } function isRegExp(object) { - return '[object RegExp]' === Object.prototype.toString.call(object); + return Object.prototype.toString.call(object) === '[object RegExp]'; } module.exports = new Type('tag:yaml.org,2002:js/regexp', { diff --git a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js index 562753c2b51113..95b5569fdfa510 100644 --- a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js @@ -16,7 +16,7 @@ function representJavascriptUndefined() { } function isUndefined(object) { - return 'undefined' === typeof object; + return typeof object === 'undefined'; } module.exports = new Type('tag:yaml.org,2002:js/undefined', { diff --git a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/map.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/map.js index dab9838c254c58..f327beebd53bdb 100644 --- a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/map.js +++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/map.js @@ -4,5 +4,5 @@ var Type = require('../type'); module.exports = new Type('tag:yaml.org,2002:map', { kind: 'mapping', - construct: function (data) { return null !== data ? data : {}; } + construct: function (data) { return data !== null ? data : {}; } }); diff --git a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/merge.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/merge.js index 29fa382707b931..ae08a86444cf1c 100644 --- a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/merge.js +++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/merge.js @@ -3,7 +3,7 @@ var Type = require('../type'); function resolveYamlMerge(data) { - return '<<' === data || null === data; + return data === '<<' || data === null; } module.exports = new Type('tag:yaml.org,2002:merge', { diff --git a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/null.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/null.js index 3474055698f5dd..6874daa6471eca 100644 --- a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/null.js +++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/null.js @@ -3,9 +3,7 @@ var Type = require('../type'); function resolveYamlNull(data) { - if (null === data) { - return true; - } + if (data === null) return true; var max = data.length; @@ -18,7 +16,7 @@ function constructYamlNull() { } function isNull(object) { - return null === object; + return object === null; } module.exports = new Type('tag:yaml.org,2002:null', { diff --git a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/omap.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/omap.js index f956459a0d6ae4..b2b5323bd1cd9e 100644 --- a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/omap.js +++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/omap.js @@ -6,9 +6,7 @@ var _hasOwnProperty = Object.prototype.hasOwnProperty; var _toString = Object.prototype.toString; function resolveYamlOmap(data) { - if (null === data) { - return true; - } + if (data === null) return true; var objectKeys = [], index, length, pair, pairKey, pairHasKey, object = data; @@ -17,36 +15,26 @@ function resolveYamlOmap(data) { pair = object[index]; pairHasKey = false; - if ('[object Object]' !== _toString.call(pair)) { - return false; - } + if (_toString.call(pair) !== '[object Object]') return false; for (pairKey in pair) { if (_hasOwnProperty.call(pair, pairKey)) { - if (!pairHasKey) { - pairHasKey = true; - } else { - return false; - } + if (!pairHasKey) pairHasKey = true; + else return false; } } - if (!pairHasKey) { - return false; - } + if (!pairHasKey) return false; - if (-1 === objectKeys.indexOf(pairKey)) { - objectKeys.push(pairKey); - } else { - return false; - } + if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); + else return false; } return true; } function constructYamlOmap(data) { - return null !== data ? data : []; + return data !== null ? data : []; } module.exports = new Type('tag:yaml.org,2002:omap', { diff --git a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/pairs.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/pairs.js index 02a0af6bc11dc6..74b52403fc125d 100644 --- a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/pairs.js +++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/pairs.js @@ -5,9 +5,7 @@ var Type = require('../type'); var _toString = Object.prototype.toString; function resolveYamlPairs(data) { - if (null === data) { - return true; - } + if (data === null) return true; var index, length, pair, keys, result, object = data; @@ -17,15 +15,11 @@ function resolveYamlPairs(data) { for (index = 0, length = object.length; index < length; index += 1) { pair = object[index]; - if ('[object Object]' !== _toString.call(pair)) { - return false; - } + if (_toString.call(pair) !== '[object Object]') return false; keys = Object.keys(pair); - if (1 !== keys.length) { - return false; - } + if (keys.length !== 1) return false; result[index] = [ keys[0], pair[keys[0]] ]; } @@ -34,9 +28,7 @@ function resolveYamlPairs(data) { } function constructYamlPairs(data) { - if (null === data) { - return []; - } + if (data === null) return []; var index, length, pair, keys, result, object = data; diff --git a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/seq.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/seq.js index 5b860a2639c4b6..be8f77f2844bdd 100644 --- a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/seq.js +++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/seq.js @@ -4,5 +4,5 @@ var Type = require('../type'); module.exports = new Type('tag:yaml.org,2002:seq', { kind: 'sequence', - construct: function (data) { return null !== data ? data : []; } + construct: function (data) { return data !== null ? data : []; } }); diff --git a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/set.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/set.js index 64d29e9b68c2ed..f885a329c2ca0a 100644 --- a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/set.js +++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/set.js @@ -5,17 +5,13 @@ var Type = require('../type'); var _hasOwnProperty = Object.prototype.hasOwnProperty; function resolveYamlSet(data) { - if (null === data) { - return true; - } + if (data === null) return true; var key, object = data; for (key in object) { if (_hasOwnProperty.call(object, key)) { - if (null !== object[key]) { - return false; - } + if (object[key] !== null) return false; } } @@ -23,7 +19,7 @@ function resolveYamlSet(data) { } function constructYamlSet(data) { - return null !== data ? data : {}; + return data !== null ? data : {}; } module.exports = new Type('tag:yaml.org,2002:set', { diff --git a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/str.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/str.js index 8b5284fe9bcbe0..27acc106caaf75 100644 --- a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/str.js +++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/str.js @@ -4,5 +4,5 @@ var Type = require('../type'); module.exports = new Type('tag:yaml.org,2002:str', { kind: 'scalar', - construct: function (data) { return null !== data ? data : ''; } + construct: function (data) { return data !== null ? data : ''; } }); diff --git a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/timestamp.js b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/timestamp.js index dc8cf15a06f424..8fa9c5865697ed 100644 --- a/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +++ b/tools/eslint/node_modules/js-yaml/lib/js-yaml/type/timestamp.js @@ -2,44 +2,38 @@ var Type = require('../type'); +var YAML_DATE_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9])' + // [2] month + '-([0-9][0-9])$'); // [3] day + var YAML_TIMESTAMP_REGEXP = new RegExp( '^([0-9][0-9][0-9][0-9])' + // [1] year '-([0-9][0-9]?)' + // [2] month '-([0-9][0-9]?)' + // [3] day - '(?:(?:[Tt]|[ \\t]+)' + // ... + '(?:[Tt]|[ \\t]+)' + // ... '([0-9][0-9]?)' + // [4] hour ':([0-9][0-9])' + // [5] minute ':([0-9][0-9])' + // [6] second '(?:\\.([0-9]*))?' + // [7] fraction '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour - '(?::([0-9][0-9]))?))?)?$'); // [11] tz_minute + '(?::([0-9][0-9]))?))?$'); // [11] tz_minute function resolveYamlTimestamp(data) { - if (null === data) { - return false; - } - - var match, year, month, day, hour, minute, second, fraction = 0, - delta = null, tz_hour, tz_minute, date; - - match = YAML_TIMESTAMP_REGEXP.exec(data); - - if (null === match) { - return false; - } - - return true; + if (data === null) return false; + if (YAML_DATE_REGEXP.exec(data) !== null) return true; + if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; + return false; } function constructYamlTimestamp(data) { var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date; - match = YAML_TIMESTAMP_REGEXP.exec(data); + match = YAML_DATE_REGEXP.exec(data); + if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); - if (null === match) { - throw new Error('Date resolve error'); - } + if (match === null) throw new Error('Date resolve error'); // match: [1] year [2] month [3] day @@ -71,16 +65,12 @@ function constructYamlTimestamp(data) { tz_hour = +(match[10]); tz_minute = +(match[11] || 0); delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds - if ('-' === match[9]) { - delta = -delta; - } + if (match[9] === '-') delta = -delta; } date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); - if (delta) { - date.setTime(date.getTime() - delta); - } + if (delta) date.setTime(date.getTime() - delta); return date; } diff --git a/tools/eslint/node_modules/js-yaml/node_modules/.bin/esparse b/tools/eslint/node_modules/js-yaml/node_modules/.bin/esparse deleted file mode 120000 index 7423b18b24efb0..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/.bin/esparse +++ /dev/null @@ -1 +0,0 @@ -../esprima/bin/esparse.js \ No newline at end of file diff --git a/tools/eslint/node_modules/js-yaml/node_modules/.bin/esvalidate b/tools/eslint/node_modules/js-yaml/node_modules/.bin/esvalidate deleted file mode 120000 index 16069effbc99a3..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/.bin/esvalidate +++ /dev/null @@ -1 +0,0 @@ -../esprima/bin/esvalidate.js \ No newline at end of file diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/CHANGELOG.md b/tools/eslint/node_modules/js-yaml/node_modules/argparse/CHANGELOG.md deleted file mode 100644 index 661e75d76511b6..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/CHANGELOG.md +++ /dev/null @@ -1,136 +0,0 @@ -1.0.2 / 2015-03-22 ------------------- - -* Relaxed lodash version dependency. - - -1.0.1 / 2015-02-20 ------------------- - -* Changed dependencies to be compatible with ancient nodejs. - - -1.0.0 / 2015-02-19 ------------------- - -* Maintenance release. -* Replaced `underscore` with `lodash`. -* Bumped version to 1.0.0 to better reflect semver meaning. -* HISTORY.md -> CHANGELOG.md - - -0.1.16 / 2013-12-01 -------------------- - -* Maintenance release. Updated dependencies and docs. - - -0.1.15 / 2013-05-13 -------------------- - -* Fixed #55, @trebor89 - - -0.1.14 / 2013-05-12 -------------------- - -* Fixed #62, @maxtaco - - -0.1.13 / 2013-04-08 -------------------- - -* Added `.npmignore` to reduce package size - - -0.1.12 / 2013-02-10 -------------------- - -* Fixed conflictHandler (#46), @hpaulj - - -0.1.11 / 2013-02-07 -------------------- - -* Multiple bugfixes, @hpaulj -* Added 70+ tests (ported from python), @hpaulj -* Added conflictHandler, @applepicke -* Added fromfilePrefixChar, @hpaulj - - -0.1.10 / 2012-12-30 -------------------- - -* Added [mutual exclusion](http://docs.python.org/dev/library/argparse.html#mutual-exclusion) - support, thanks to @hpaulj -* Fixed options check for `storeConst` & `appendConst` actions, thanks to @hpaulj - - -0.1.9 / 2012-12-27 ------------------- - -* Fixed option dest interferens with other options (issue #23), thanks to @hpaulj -* Fixed default value behavior with `*` positionals, thanks to @hpaulj -* Improve `getDefault()` behavior, thanks to @hpaulj -* Imrove negative argument parsing, thanks to @hpaulj - - -0.1.8 / 2012-12-01 ------------------- - -* Fixed parser parents (issue #19), thanks to @hpaulj -* Fixed negative argument parse (issue #20), thanks to @hpaulj - - -0.1.7 / 2012-10-14 ------------------- - -* Fixed 'choices' argument parse (issue #16) -* Fixed stderr output (issue #15) - - -0.1.6 / 2012-09-09 ------------------- - -* Fixed check for conflict of options (thanks to @tomxtobin) - - -0.1.5 / 2012-09-03 ------------------- - -* Fix parser #setDefaults method (thanks to @tomxtobin) - - -0.1.4 / 2012-07-30 ------------------- - -* Fixed pseudo-argument support (thanks to @CGamesPlay) -* Fixed addHelp default (should be true), if not set (thanks to @benblank) - - -0.1.3 / 2012-06-27 ------------------- - -* Fixed formatter api name: Formatter -> HelpFormatter - - -0.1.2 / 2012-05-29 ------------------- - -* Added basic tests -* Removed excess whitespace in help -* Fixed error reporting, when parcer with subcommands - called with empty arguments - - -0.1.1 / 2012-05-23 ------------------- - -* Fixed line wrapping in help formatter -* Added better error reporting on invalid arguments - - -0.1.0 / 2012-05-16 ------------------- - -* First release. diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/README.md b/tools/eslint/node_modules/js-yaml/node_modules/argparse/README.md deleted file mode 100644 index 72e4261688e8d2..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/README.md +++ /dev/null @@ -1,243 +0,0 @@ -argparse -======== - -[![Build Status](https://secure.travis-ci.org/nodeca/argparse.png?branch=master)](http://travis-ci.org/nodeca/argparse) -[![NPM version](https://img.shields.io/npm/v/argparse.svg)](https://www.npmjs.org/package/argparse) - -CLI arguments parser for node.js. Javascript port of python's -[argparse](http://docs.python.org/dev/library/argparse.html) module -(original version 3.2). That's a full port, except some very rare options, -recorded in issue tracker. - -**NB. Difference with original.** - -- Method names changed to camelCase. See [generated docs](http://nodeca.github.com/argparse/). -- Use `defaultValue` instead of `default`. - - -Example -======= - -test.js file: - -```javascript -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ - version: '0.0.1', - addHelp:true, - description: 'Argparse example' -}); -parser.addArgument( - [ '-f', '--foo' ], - { - help: 'foo bar' - } -); -parser.addArgument( - [ '-b', '--bar' ], - { - help: 'bar foo' - } -); -var args = parser.parseArgs(); -console.dir(args); -``` - -Display help: - -``` -$ ./test.js -h -usage: example.js [-h] [-v] [-f FOO] [-b BAR] - -Argparse example - -Optional arguments: - -h, --help Show this help message and exit. - -v, --version Show program's version number and exit. - -f FOO, --foo FOO foo bar - -b BAR, --bar BAR bar foo -``` - -Parse arguments: - -``` -$ ./test.js -f=3 --bar=4 -{ foo: '3', bar: '4' } -``` - -More [examples](https://github.com/nodeca/argparse/tree/master/examples). - - -ArgumentParser objects -====================== - -``` -new ArgumentParser({paramters hash}); -``` - -Creates a new ArgumentParser object. - -**Supported params:** - -- ```description``` - Text to display before the argument help. -- ```epilog``` - Text to display after the argument help. -- ```addHelp``` - Add a -h/–help option to the parser. (default: true) -- ```argumentDefault``` - Set the global default value for arguments. (default: null) -- ```parents``` - A list of ArgumentParser objects whose arguments should also be included. -- ```prefixChars``` - The set of characters that prefix optional arguments. (default: ‘-‘) -- ```formatterClass``` - A class for customizing the help output. -- ```prog``` - The name of the program (default: `path.basename(process.argv[1])`) -- ```usage``` - The string describing the program usage (default: generated) -- ```conflictHandler``` - Usually unnecessary, defines strategy for resolving conflicting optionals. - -**Not supportied yet** - -- ```fromfilePrefixChars``` - The set of characters that prefix files from which additional arguments should be read. - - -Details in [original ArgumentParser guide](http://docs.python.org/dev/library/argparse.html#argumentparser-objects) - - -addArgument() method -==================== - -``` -ArgumentParser.addArgument([names or flags], {options}) -``` - -Defines how a single command-line argument should be parsed. - -- ```name or flags``` - Either a name or a list of option strings, e.g. foo or -f, --foo. - -Options: - -- ```action``` - The basic type of action to be taken when this argument is encountered at the command line. -- ```nargs```- The number of command-line arguments that should be consumed. -- ```constant``` - A constant value required by some action and nargs selections. -- ```defaultValue``` - The value produced if the argument is absent from the command line. -- ```type``` - The type to which the command-line argument should be converted. -- ```choices``` - A container of the allowable values for the argument. -- ```required``` - Whether or not the command-line option may be omitted (optionals only). -- ```help``` - A brief description of what the argument does. -- ```metavar``` - A name for the argument in usage messages. -- ```dest``` - The name of the attribute to be added to the object returned by parseArgs(). - -Details in [original add_argument guide](http://docs.python.org/dev/library/argparse.html#the-add-argument-method) - - -Action (some details) -================ - -ArgumentParser objects associate command-line arguments with actions. -These actions can do just about anything with the command-line arguments associated -with them, though most actions simply add an attribute to the object returned by -parseArgs(). The action keyword argument specifies how the command-line arguments -should be handled. The supported actions are: - -- ```store``` - Just stores the argument’s value. This is the default action. -- ```storeConst``` - Stores value, specified by the const keyword argument. - (Note that the const keyword argument defaults to the rather unhelpful None.) - The 'storeConst' action is most commonly used with optional arguments, that - specify some sort of flag. -- ```storeTrue``` and ```storeFalse``` - Stores values True and False - respectively. These are special cases of 'storeConst'. -- ```append``` - Stores a list, and appends each argument value to the list. - This is useful to allow an option to be specified multiple times. -- ```appendConst``` - Stores a list, and appends value, specified by the - const keyword argument to the list. (Note, that the const keyword argument defaults - is None.) The 'appendConst' action is typically used when multiple arguments need - to store constants to the same list. -- ```count``` - Counts the number of times a keyword argument occurs. For example, - used for increasing verbosity levels. -- ```help``` - Prints a complete help message for all the options in the current - parser and then exits. By default a help action is automatically added to the parser. - See ArgumentParser for details of how the output is created. -- ```version``` - Prints version information and exit. Expects a `version=` - keyword argument in the addArgument() call. - -Details in [original action guide](http://docs.python.org/dev/library/argparse.html#action) - - -Sub-commands -============ - -ArgumentParser.addSubparsers() - -Many programs split their functionality into a number of sub-commands, for -example, the svn program can invoke sub-commands like `svn checkout`, `svn update`, -and `svn commit`. Splitting up functionality this way can be a particularly good -idea when a program performs several different functions which require different -kinds of command-line arguments. `ArgumentParser` supports creation of such -sub-commands with `addSubparsers()` method. The `addSubparsers()` method is -normally called with no arguments and returns an special action object. -This object has a single method `addParser()`, which takes a command name and -any `ArgumentParser` constructor arguments, and returns an `ArgumentParser` object -that can be modified as usual. - -Example: - -sub_commands.js -```javascript -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ - version: '0.0.1', - addHelp:true, - description: 'Argparse examples: sub-commands', -}); - -var subparsers = parser.addSubparsers({ - title:'subcommands', - dest:"subcommand_name" -}); - -var bar = subparsers.addParser('c1', {addHelp:true}); -bar.addArgument( - [ '-f', '--foo' ], - { - action: 'store', - help: 'foo3 bar3' - } -); -var bar = subparsers.addParser( - 'c2', - {aliases:['co'], addHelp:true} -); -bar.addArgument( - [ '-b', '--bar' ], - { - action: 'store', - type: 'int', - help: 'foo3 bar3' - } -); - -var args = parser.parseArgs(); -console.dir(args); - -``` - -Details in [original sub-commands guide](http://docs.python.org/dev/library/argparse.html#sub-commands) - - -Contributors -============ - -- [Eugene Shkuropat](https://github.com/shkuropat) -- [Paul Jacobson](https://github.com/hpaulj) - -[others](https://github.com/nodeca/argparse/graphs/contributors) - -License -======= - -Copyright (c) 2012 [Vitaly Puzrin](https://github.com/puzrin). -Released under the MIT license. See -[LICENSE](https://github.com/nodeca/argparse/blob/master/LICENSE) for details. - - diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/arguments.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/arguments.js deleted file mode 100755 index 5b090fa2e1185a..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/arguments.js +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ - version: '0.0.1', - addHelp: true, - description: 'Argparse examples: arguments' -}); -parser.addArgument( - [ '-f', '--foo' ], - { - help: 'foo bar' - } -); -parser.addArgument( - [ '-b', '--bar' ], - { - help: 'bar foo' - } -); - - -parser.printHelp(); -console.log('-----------'); - -var args; -args = parser.parseArgs('-f 1 -b2'.split(' ')); -console.dir(args); -console.log('-----------'); -args = parser.parseArgs('-f=3 --bar=4'.split(' ')); -console.dir(args); -console.log('-----------'); -args = parser.parseArgs('--foo 5 --bar 6'.split(' ')); -console.dir(args); -console.log('-----------'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/choice.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/choice.js deleted file mode 100755 index 2616fa4d75275e..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/choice.js +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ - version: '0.0.1', - addHelp: true, - description: 'Argparse examples: choice' -}); - -parser.addArgument(['foo'], {choices: 'abc'}); - -parser.printHelp(); -console.log('-----------'); - -var args; -args = parser.parseArgs(['c']); -console.dir(args); -console.log('-----------'); -parser.parseArgs(['X']); -console.dir(args); - diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/constants.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/constants.js deleted file mode 100755 index 172a4f3d4f62c0..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/constants.js +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ - version: '0.0.1', - addHelp: true, - description: 'Argparse examples: constant' -}); - -parser.addArgument( - [ '-a'], - { - action: 'storeConst', - dest: 'answer', - help: 'store constant', - constant: 42 - } -); -parser.addArgument( - [ '--str' ], - { - action: 'appendConst', - dest: 'types', - help: 'append constant "str" to types', - constant: 'str' - } -); -parser.addArgument( - [ '--int' ], - { - action: 'appendConst', - dest: 'types', - help: 'append constant "int" to types', - constant: 'int' - } -); - -parser.addArgument( - [ '--true' ], - { - action: 'storeTrue', - help: 'store true constant' - } -); -parser.addArgument( - [ '--false' ], - { - action: 'storeFalse', - help: 'store false constant' - } -); - -parser.printHelp(); -console.log('-----------'); - -var args; -args = parser.parseArgs('-a --str --int --true'.split(' ')); -console.dir(args); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/help.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/help.js deleted file mode 100755 index 7eb955534fe29c..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/help.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ - version: '0.0.1', - addHelp: true, - description: 'Argparse examples: help', - epilog: 'help epilog', - prog: 'help_example_prog', - usage: 'Usage %(prog)s ' -}); -parser.printHelp(); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/nargs.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/nargs.js deleted file mode 100755 index 74f376beba4a4c..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/nargs.js +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ - version: '0.0.1', - addHelp: true, - description: 'Argparse examples: nargs' -}); -parser.addArgument( - [ '-f', '--foo' ], - { - help: 'foo bar', - nargs: 1 - } -); -parser.addArgument( - [ '-b', '--bar' ], - { - help: 'bar foo', - nargs: '*' - } -); - -parser.printHelp(); -console.log('-----------'); - -var args; -args = parser.parseArgs('--foo a --bar c d'.split(' ')); -console.dir(args); -console.log('-----------'); -args = parser.parseArgs('--bar b c f --foo a'.split(' ')); -console.dir(args); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/parents.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/parents.js deleted file mode 100755 index dfe896868bd0f6..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/parents.js +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; - -var args; -var parent_parser = new ArgumentParser({ addHelp: false }); -// note addHelp:false to prevent duplication of the -h option -parent_parser.addArgument( - ['--parent'], - { type: 'int', description: 'parent' } -); - -var foo_parser = new ArgumentParser({ - parents: [ parent_parser ], - description: 'child1' -}); -foo_parser.addArgument(['foo']); -args = foo_parser.parseArgs(['--parent', '2', 'XXX']); -console.log(args); - -var bar_parser = new ArgumentParser({ - parents: [ parent_parser ], - description: 'child2' -}); -bar_parser.addArgument(['--bar']); -args = bar_parser.parseArgs(['--bar', 'YYY']); -console.log(args); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/prefix_chars.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/prefix_chars.js deleted file mode 100755 index 430d5e182346d9..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/prefix_chars.js +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ - version: '0.0.1', - addHelp: true, - description: 'Argparse examples: prefix_chars', - prefixChars: '-+' -}); -parser.addArgument(['+f', '++foo']); -parser.addArgument(['++bar'], {action: 'storeTrue'}); - -parser.printHelp(); -console.log('-----------'); - -var args; -args = parser.parseArgs(['+f', '1']); -console.dir(args); -args = parser.parseArgs(['++bar']); -console.dir(args); -args = parser.parseArgs(['++foo', '2', '++bar']); -console.dir(args); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/sub_commands.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/sub_commands.js deleted file mode 100755 index df9c494440bee0..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/sub_commands.js +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ - version: '0.0.1', - addHelp: true, - description: 'Argparse examples: sub-commands' -}); - -var subparsers = parser.addSubparsers({ - title: 'subcommands', - dest: "subcommand_name" -}); - -var bar = subparsers.addParser('c1', {addHelp: true, help: 'c1 help'}); -bar.addArgument( - [ '-f', '--foo' ], - { - action: 'store', - help: 'foo3 bar3' - } -); -var bar = subparsers.addParser( - 'c2', - {aliases: ['co'], addHelp: true, help: 'c2 help'} -); -bar.addArgument( - [ '-b', '--bar' ], - { - action: 'store', - type: 'int', - help: 'foo3 bar3' - } -); -parser.printHelp(); -console.log('-----------'); - -var args; -args = parser.parseArgs('c1 -f 2'.split(' ')); -console.dir(args); -console.log('-----------'); -args = parser.parseArgs('c2 -b 1'.split(' ')); -console.dir(args); -console.log('-----------'); -args = parser.parseArgs('co -b 1'.split(' ')); -console.dir(args); -console.log('-----------'); -parser.parseArgs(['c1', '-h']); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/sum.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/sum.js deleted file mode 100755 index 4532800a50d31f..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/sum.js +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env node - -'use strict'; - - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ description: 'Process some integers.' }); - - -function sum(arr) { - return arr.reduce(function (a, b) { - return a + b; - }, 0); -} -function max(arr) { - return Math.max.apply(Math, arr); -} - - -parser.addArgument(['integers'], { - metavar: 'N', - type: 'int', - nargs: '+', - help: 'an integer for the accumulator' -}); -parser.addArgument(['--sum'], { - dest: 'accumulate', - action: 'storeConst', - constant: sum, - defaultValue: max, - help: 'sum the integers (default: find the max)' -}); - -var args = parser.parseArgs('--sum 1 2 -1'.split(' ')); -console.log(args.accumulate(args.integers)); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/testformatters.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/testformatters.js deleted file mode 100644 index 1c03cdc8435c81..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/examples/testformatters.js +++ /dev/null @@ -1,270 +0,0 @@ -'use strict'; - -var a, group, parser, helptext; - -var assert = require('assert'); - - -var print = function () { - return console.log.apply(console, arguments); - }; -// print = function () {}; - -var argparse = require('argparse'); - -print("TEST argparse.ArgumentDefaultsHelpFormatter"); - -parser = new argparse.ArgumentParser({ - debug: true, - formatterClass: argparse.ArgumentDefaultsHelpFormatter, - description: 'description' -}); - -parser.addArgument(['--foo'], { - help: 'foo help - oh and by the way, %(defaultValue)s' -}); - -parser.addArgument(['--bar'], { - action: 'storeTrue', - help: 'bar help' -}); - -parser.addArgument(['spam'], { - help: 'spam help' -}); - -parser.addArgument(['badger'], { - nargs: '?', - defaultValue: 'wooden', - help: 'badger help' -}); - -group = parser.addArgumentGroup({ - title: 'title', - description: 'group description' -}); - -group.addArgument(['--baz'], { - type: 'int', - defaultValue: 42, - help: 'baz help' -}); - -helptext = parser.formatHelp(); -print(helptext); -// test selected clips -assert(helptext.match(/badger help \(default: wooden\)/)); -assert(helptext.match(/foo help - oh and by the way, null/)); -assert(helptext.match(/bar help \(default: false\)/)); -assert(helptext.match(/title:\n {2}group description/)); // test indent -assert(helptext.match(/baz help \(default: 42\)/im)); - -/* -usage: PROG [-h] [--foo FOO] [--bar] [--baz BAZ] spam [badger] - -description - -positional arguments: - spam spam help - badger badger help (default: wooden) - -optional arguments: - -h, --help show this help message and exit - --foo FOO foo help - oh and by the way, null - --bar bar help (default: false) - -title: - group description - - --baz BAZ baz help (default: 42) -*/ - -print("TEST argparse.RawDescriptionHelpFormatter"); - -parser = new argparse.ArgumentParser({ - debug: true, - prog: 'PROG', - formatterClass: argparse.RawDescriptionHelpFormatter, - description: 'Keep the formatting\n' + - ' exactly as it is written\n' + - '\n' + - 'here\n' -}); - -a = parser.addArgument(['--foo'], { - help: ' foo help should not\n' + - ' retain this odd formatting' -}); - -parser.addArgument(['spam'], { - 'help': 'spam help' -}); - -group = parser.addArgumentGroup({ - title: 'title', - description: ' This text\n' + - ' should be indented\n' + - ' exactly like it is here\n' -}); - -group.addArgument(['--bar'], { - help: 'bar help' -}); - -helptext = parser.formatHelp(); -print(helptext); -// test selected clips -assert(helptext.match(parser.description)); -assert.equal(helptext.match(a.help), null); -assert(helptext.match(/foo help should not retain this odd formatting/)); - -/* -class TestHelpRawDescription(HelpTestCase): - """Test the RawTextHelpFormatter""" -.... - -usage: PROG [-h] [--foo FOO] [--bar BAR] spam - -Keep the formatting - exactly as it is written - -here - -positional arguments: - spam spam help - -optional arguments: - -h, --help show this help message and exit - --foo FOO foo help should not retain this odd formatting - -title: - This text - should be indented - exactly like it is here - - --bar BAR bar help -*/ - - -print("TEST argparse.RawTextHelpFormatter"); - -parser = new argparse.ArgumentParser({ - debug: true, - prog: 'PROG', - formatterClass: argparse.RawTextHelpFormatter, - description: 'Keep the formatting\n' + - ' exactly as it is written\n' + - '\n' + - 'here\n' -}); - -parser.addArgument(['--baz'], { - help: ' baz help should also\n' + - 'appear as given here' -}); - -a = parser.addArgument(['--foo'], { - help: ' foo help should also\n' + - 'appear as given here' -}); - -parser.addArgument(['spam'], { - 'help': 'spam help' -}); - -group = parser.addArgumentGroup({ - title: 'title', - description: ' This text\n' + - ' should be indented\n' + - ' exactly like it is here\n' -}); - -group.addArgument(['--bar'], { - help: 'bar help' -}); - -helptext = parser.formatHelp(); -print(helptext); -// test selected clips -assert(helptext.match(parser.description)); -assert(helptext.match(/( {14})appear as given here/gm)); - -/* -class TestHelpRawText(HelpTestCase): - """Test the RawTextHelpFormatter""" - -usage: PROG [-h] [--foo FOO] [--bar BAR] spam - -Keep the formatting - exactly as it is written - -here - -positional arguments: - spam spam help - -optional arguments: - -h, --help show this help message and exit - --foo FOO foo help should also - appear as given here - -title: - This text - should be indented - exactly like it is here - - --bar BAR bar help -*/ - - -print("TEST metavar as a tuple"); - -parser = new argparse.ArgumentParser({ - prog: 'PROG' -}); - -parser.addArgument(['-w'], { - help: 'w', - nargs: '+', - metavar: ['W1', 'W2'] -}); - -parser.addArgument(['-x'], { - help: 'x', - nargs: '*', - metavar: ['X1', 'X2'] -}); - -parser.addArgument(['-y'], { - help: 'y', - nargs: 3, - metavar: ['Y1', 'Y2', 'Y3'] -}); - -parser.addArgument(['-z'], { - help: 'z', - nargs: '?', - metavar: ['Z1'] -}); - -helptext = parser.formatHelp(); -print(helptext); -var ustring = 'PROG [-h] [-w W1 [W2 ...]] [-x [X1 [X2 ...]]] [-y Y1 Y2 Y3] [-z [Z1]]'; -ustring = ustring.replace(/\[/g, '\\[').replace(/\]/g, '\\]'); -// print(ustring) -assert(helptext.match(new RegExp(ustring))); - -/* -class TestHelpTupleMetavar(HelpTestCase): - """Test specifying metavar as a tuple""" - -usage: PROG [-h] [-w W1 [W2 ...]] [-x [X1 [X2 ...]]] [-y Y1 Y2 Y3] [-z [Z1]] - -optional arguments: - -h, --help show this help message and exit - -w W1 [W2 ...] w - -x [X1 [X2 ...]] x - -y Y1 Y2 Y3 y - -z [Z1] z -*/ - diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/index.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/index.js deleted file mode 100644 index 3b6eea0138b844..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/argparse'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/append/constant.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/append/constant.js deleted file mode 100644 index 90747abbf61115..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/append/constant.js +++ /dev/null @@ -1,47 +0,0 @@ -/*:nodoc:* - * class ActionAppendConstant - * - * This stores a list, and appends the value specified by - * the const keyword argument to the list. - * (Note that the const keyword argument defaults to null.) - * The 'appendConst' action is typically useful when multiple - * arguments need to store constants to the same list. - * - * This class inherited from [[Action]] - **/ - -'use strict'; - -var util = require('util'); - -var Action = require('../../action'); - -/*:nodoc:* - * new ActionAppendConstant(options) - * - options (object): options hash see [[Action.new]] - * - **/ -var ActionAppendConstant = module.exports = function ActionAppendConstant(options) { - options = options || {}; - options.nargs = 0; - if (options.constant === undefined) { - throw new Error('constant option is required for appendAction'); - } - Action.call(this, options); -}; -util.inherits(ActionAppendConstant, Action); - -/*:nodoc:* - * ActionAppendConstant#call(parser, namespace, values, optionString) -> Void - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Call the action. Save result in namespace object - **/ -ActionAppendConstant.prototype.call = function (parser, namespace) { - var items = [].concat(namespace[this.dest] || []); - items.push(this.constant); - namespace.set(this.dest, items); -}; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/help.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/help.js deleted file mode 100644 index 7f7b4e2d21219b..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/help.js +++ /dev/null @@ -1,48 +0,0 @@ -/*:nodoc:* - * class ActionHelp - * - * Support action for printing help - * This class inherided from [[Action]] - **/ -'use strict'; - -var util = require('util'); - -var Action = require('../action'); - -// Constants -var $$ = require('../const'); - -/*:nodoc:* - * new ActionHelp(options) - * - options (object): options hash see [[Action.new]] - * - **/ -var ActionHelp = module.exports = function ActionHelp(options) { - options = options || {}; - if (options.defaultValue !== null) { - options.defaultValue = options.defaultValue; - } - else { - options.defaultValue = $$.SUPPRESS; - } - options.dest = (options.dest !== null ? options.dest: $$.SUPPRESS); - options.nargs = 0; - Action.call(this, options); - -}; -util.inherits(ActionHelp, Action); - -/*:nodoc:* - * ActionHelp#call(parser, namespace, values, optionString) - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Print help and exit - **/ -ActionHelp.prototype.call = function (parser) { - parser.printHelp(); - parser.exit(); -}; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js deleted file mode 100644 index 8410fcf784c64e..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js +++ /dev/null @@ -1,43 +0,0 @@ -/*:nodoc:* - * class ActionStoreConstant - * - * This action stores the value specified by the const keyword argument. - * (Note that the const keyword argument defaults to the rather unhelpful null.) - * The 'store_const' action is most commonly used with optional - * arguments that specify some sort of flag. - * - * This class inherited from [[Action]] - **/ -'use strict'; - -var util = require('util'); - -var Action = require('../../action'); - -/*:nodoc:* - * new ActionStoreConstant(options) - * - options (object): options hash see [[Action.new]] - * - **/ -var ActionStoreConstant = module.exports = function ActionStoreConstant(options) { - options = options || {}; - options.nargs = 0; - if (options.constant === undefined) { - throw new Error('constant option is required for storeAction'); - } - Action.call(this, options); -}; -util.inherits(ActionStoreConstant, Action); - -/*:nodoc:* - * ActionStoreConstant#call(parser, namespace, values, optionString) -> Void - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Call the action. Save result in namespace object - **/ -ActionStoreConstant.prototype.call = function (parser, namespace) { - namespace.set(this.dest, this.constant); -}; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/argument/group.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/argument/group.js deleted file mode 100644 index 58b271f2fec8d0..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/lib/argument/group.js +++ /dev/null @@ -1,75 +0,0 @@ -/** internal - * class ArgumentGroup - * - * Group arguments. - * By default, ArgumentParser groups command-line arguments - * into “positional arguments” and “optional arguments” - * when displaying help messages. When there is a better - * conceptual grouping of arguments than this default one, - * appropriate groups can be created using the addArgumentGroup() method - * - * This class inherited from [[ArgumentContainer]] - **/ -'use strict'; - -var util = require('util'); - -var ActionContainer = require('../action_container'); - - -/** - * new ArgumentGroup(container, options) - * - container (object): main container - * - options (object): hash of group options - * - * #### options - * - **prefixChars** group name prefix - * - **argumentDefault** default argument value - * - **title** group title - * - **description** group description - * - **/ -var ArgumentGroup = module.exports = function ArgumentGroup(container, options) { - - options = options || {}; - - // add any missing keyword arguments by checking the container - options.conflictHandler = (options.conflictHandler || container.conflictHandler); - options.prefixChars = (options.prefixChars || container.prefixChars); - options.argumentDefault = (options.argumentDefault || container.argumentDefault); - - ActionContainer.call(this, options); - - // group attributes - this.title = options.title; - this._groupActions = []; - - // share most attributes with the container - this._container = container; - this._registries = container._registries; - this._actions = container._actions; - this._optionStringActions = container._optionStringActions; - this._defaults = container._defaults; - this._hasNegativeNumberOptionals = container._hasNegativeNumberOptionals; - this._mutuallyExclusiveGroups = container._mutuallyExclusiveGroups; -}; -util.inherits(ArgumentGroup, ActionContainer); - - -ArgumentGroup.prototype._addAction = function (action) { - // Parent add action - action = ActionContainer.prototype._addAction.call(this, action); - this._groupActions.push(action); - return action; -}; - - -ArgumentGroup.prototype._removeAction = function (action) { - // Parent remove action - ActionContainer.prototype._removeAction.call(this, action); - var actionIndex = this._groupActions.indexOf(action); - if (actionIndex >= 0) { - this._groupActions.splice(actionIndex, 1); - } -}; - diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/LICENSE.txt b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/LICENSE.txt deleted file mode 100644 index 9cd87e5dcefe58..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2015 The Dojo Foundation -Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/README.md b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/README.md deleted file mode 100644 index cd0fe0cebb7027..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/README.md +++ /dev/null @@ -1,120 +0,0 @@ -# lodash v3.9.3 - -The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash](https://lodash.com/) exported as [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) modules. - -Generated using [lodash-cli](https://www.npmjs.com/package/lodash-cli): -```bash -$ lodash modularize modern exports=node -o ./ -$ lodash modern -d -o ./index.js -``` - -## Installation - -Using npm: - -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash -``` - -In Node.js/io.js: - -```js -// load the modern build -var _ = require('lodash'); -// or a method category -var array = require('lodash/array'); -// or a method (great for smaller builds with browserify/webpack) -var chunk = require('lodash/array/chunk'); -``` - -See the [package source](https://github.com/lodash/lodash/tree/3.9.3-npm) for more details. - -**Note:**
      -Don’t assign values to the [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL.
      -Install [n_](https://www.npmjs.com/package/n_) for a REPL that includes lodash by default. - -## Module formats - -lodash is also available in a variety of other builds & module formats. - - * npm packages for [modern](https://www.npmjs.com/package/lodash), [compatibility](https://www.npmjs.com/package/lodash-compat), & [per method](https://www.npmjs.com/browse/keyword/lodash-modularized) builds - * AMD modules for [modern](https://github.com/lodash/lodash/tree/3.9.3-amd) & [compatibility](https://github.com/lodash/lodash-compat/tree/3.9.3-amd) builds - * ES modules for the [modern](https://github.com/lodash/lodash/tree/3.9.3-es) build - -## Further Reading - - * [API Documentation](https://lodash.com/docs) - * [Build Differences](https://github.com/lodash/lodash/wiki/Build-Differences) - * [Changelog](https://github.com/lodash/lodash/wiki/Changelog) - * [Release Notes](https://github.com/lodash/lodash/releases) - * [Roadmap](https://github.com/lodash/lodash/wiki/Roadmap) - * [More Resources](https://github.com/lodash/lodash/wiki/Resources) - -## Features - - * ~100% [code coverage](https://coveralls.io/r/lodash) - * Follows [semantic versioning](http://semver.org/) for releases - * [Lazily evaluated](http://filimanjaro.com/blog/2014/introducing-lazy-evaluation/) chaining - * [_(…)](https://lodash.com/docs#_) supports intuitive chaining - * [_.add](https://lodash.com/docs#add) for mathematical composition - * [_.ary](https://lodash.com/docs#ary) & [_.rearg](https://lodash.com/docs#rearg) to change function argument limits & order - * [_.at](https://lodash.com/docs#at) for cherry-picking collection values - * [_.attempt](https://lodash.com/docs#attempt) to execute functions which may error without a try-catch - * [_.before](https://lodash.com/docs#before) to complement [_.after](https://lodash.com/docs#after) - * [_.bindKey](https://lodash.com/docs#bindKey) for binding [*“lazy”*](http://michaux.ca/articles/lazy-function-definition-pattern) defined methods - * [_.chunk](https://lodash.com/docs#chunk) for splitting an array into chunks of a given size - * [_.clone](https://lodash.com/docs#clone) supports shallow cloning of `Date` & `RegExp` objects - * [_.cloneDeep](https://lodash.com/docs#cloneDeep) for deep cloning arrays & objects - * [_.curry](https://lodash.com/docs#curry) & [_.curryRight](https://lodash.com/docs#curryRight) for creating [curried](http://hughfdjackson.com/javascript/why-curry-helps/) functions - * [_.debounce](https://lodash.com/docs#debounce) & [_.throttle](https://lodash.com/docs#throttle) are cancelable & accept options for more control - * [_.fill](https://lodash.com/docs#fill) to fill arrays with values - * [_.findKey](https://lodash.com/docs#findKey) for finding keys - * [_.flow](https://lodash.com/docs#flow) to complement [_.flowRight](https://lodash.com/docs#flowRight) (a.k.a `_.compose`) - * [_.forEach](https://lodash.com/docs#forEach) supports exiting early - * [_.forIn](https://lodash.com/docs#forIn) for iterating all enumerable properties - * [_.forOwn](https://lodash.com/docs#forOwn) for iterating own properties - * [_.get](https://lodash.com/docs#get) & [_.set](https://lodash.com/docs#set) for deep property getting & setting - * [_.gt](https://lodash.com/docs#gt), [_.gte](https://lodash.com/docs#gte), [_.lt](https://lodash.com/docs#lt), & [_.lte](https://lodash.com/docs#lte) relational methods - * [_.inRange](https://lodash.com/docs#inRange) for checking whether a number is within a given range - * [_.isNative](https://lodash.com/docs#isNative) to check for native functions - * [_.isPlainObject](https://lodash.com/docs#isPlainObject) & [_.toPlainObject](https://lodash.com/docs#toPlainObject) to check for & convert to `Object` objects - * [_.isTypedArray](https://lodash.com/docs#isTypedArray) to check for typed arrays - * [_.mapKeys](https://lodash.com/docs#mapKeys) for mapping keys to an object - * [_.matches](https://lodash.com/docs#matches) supports deep object comparisons - * [_.matchesProperty](https://lodash.com/docs#matchesProperty) to complement [_.matches](https://lodash.com/docs#matches) & [_.property](https://lodash.com/docs#property) - * [_.method](https://lodash.com/docs#method) & [_.methodOf](https://lodash.com/docs#methodOf) to create functions that invoke methods - * [_.merge](https://lodash.com/docs#merge) for a deep [_.extend](https://lodash.com/docs#extend) - * [_.parseInt](https://lodash.com/docs#parseInt) for consistent cross-environment behavior - * [_.pull](https://lodash.com/docs#pull), [_.pullAt](https://lodash.com/docs#pullAt), & [_.remove](https://lodash.com/docs#remove) for mutating arrays - * [_.random](https://lodash.com/docs#random) supports returning floating-point numbers - * [_.restParam](https://lodash.com/docs#restParam) & [_.spread](https://lodash.com/docs#spread) for applying rest parameters & spreading arguments to functions - * [_.runInContext](https://lodash.com/docs#runInContext) for collisionless mixins & easier mocking - * [_.slice](https://lodash.com/docs#slice) for creating subsets of array-like values - * [_.sortByAll](https://lodash.com/docs#sortByAll) & [_.sortByOrder](https://lodash.com/docs#sortByOrder) for sorting by multiple properties & orders - * [_.sum](https://lodash.com/docs#sum) to get the sum of values - * [_.support](https://lodash.com/docs#support) for flagging environment features - * [_.template](https://lodash.com/docs#template) supports [*“imports”*](https://lodash.com/docs#templateSettings-imports) options & [ES template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-template-literal-lexical-components) - * [_.transform](https://lodash.com/docs#transform) as a powerful alternative to [_.reduce](https://lodash.com/docs#reduce) for transforming objects - * [_.unzipWith](https://lodash.com/docs#unzipWith) & [_.zipWith](https://lodash.com/docs#zipWith) to specify how grouped values should be combined - * [_.xor](https://lodash.com/docs#xor) to complement [_.difference](https://lodash.com/docs#difference), [_.intersection](https://lodash.com/docs#intersection), & [_.union](https://lodash.com/docs#union) - * [_.valuesIn](https://lodash.com/docs#valuesIn) for getting values of all enumerable properties - * [_.bind](https://lodash.com/docs#bind), [_.curry](https://lodash.com/docs#curry), [_.partial](https://lodash.com/docs#partial), & - [more](https://lodash.com/docs "_.bindKey, _.curryRight, _.partialRight") support customizable argument placeholders - * [_.capitalize](https://lodash.com/docs#capitalize), [_.trim](https://lodash.com/docs#trim), & - [more](https://lodash.com/docs "_.camelCase, _.deburr, _.endsWith, _.escapeRegExp, _.kebabCase, _.pad, _.padLeft, _.padRight, _.repeat, _.snakeCase, _.startCase, _.startsWith, _.trimLeft, _.trimRight, _.trunc, _.words") string methods - * [_.clone](https://lodash.com/docs#clone), [_.isEqual](https://lodash.com/docs#isEqual), & - [more](https://lodash.com/docs "_.assign, _.cloneDeep, _.merge") accept customizer callbacks - * [_.dropWhile](https://lodash.com/docs#dropWhile), [_.takeWhile](https://lodash.com/docs#takeWhile), & - [more](https://lodash.com/docs "_.drop, _.dropRight, _.dropRightWhile, _.take, _.takeRight, _.takeRightWhile") to complement [_.first](https://lodash.com/docs#first), [_.initial](https://lodash.com/docs#initial), [_.last](https://lodash.com/docs#last), & [_.rest](https://lodash.com/docs#rest) - * [_.findLast](https://lodash.com/docs#findLast), [_.findLastKey](https://lodash.com/docs#findLastKey), & - [more](https://lodash.com/docs "_.curryRight, _.dropRight, _.dropRightWhile, _.flowRight, _.forEachRight, _.forInRight, _.forOwnRight, _.padRight, partialRight, _.takeRight, _.trimRight, _.takeRightWhile") right-associative methods - * [_.includes](https://lodash.com/docs#includes), [_.toArray](https://lodash.com/docs#toArray), & - [more](https://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.findLast, _.findWhere, _.forEach, _.forEachRight, _.groupBy, _.indexBy, _.invoke, _.map, _.max, _.min, _.partition, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.size, _.some, _.sortBy, _.sortByAll, _.sortByOrder, _.sum, _.where") accept strings - * [_#commit](https://lodash.com/docs#prototype-commit) & [_#plant](https://lodash.com/docs#prototype-plant) for working with chain sequences - * [_#thru](https://lodash.com/docs#thru) to pass values thru a chain sequence - -## Support - -Tested in Chrome 41-42, Firefox 37-38, IE 6-11, MS Edge, Opera 28-29, Safari 5-8, ChakraNode 0.12.2, io.js 2.1.0, Node.js 0.8.28, 0.10.38, & 0.12.4, PhantomJS 1.9.8, RingoJS 0.11, & Rhino 1.7.6 -Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available. Special thanks to [Sauce Labs](https://saucelabs.com/) for providing automated browser testing. diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array.js deleted file mode 100644 index e5121fa52ec264..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array.js +++ /dev/null @@ -1,44 +0,0 @@ -module.exports = { - 'chunk': require('./array/chunk'), - 'compact': require('./array/compact'), - 'difference': require('./array/difference'), - 'drop': require('./array/drop'), - 'dropRight': require('./array/dropRight'), - 'dropRightWhile': require('./array/dropRightWhile'), - 'dropWhile': require('./array/dropWhile'), - 'fill': require('./array/fill'), - 'findIndex': require('./array/findIndex'), - 'findLastIndex': require('./array/findLastIndex'), - 'first': require('./array/first'), - 'flatten': require('./array/flatten'), - 'flattenDeep': require('./array/flattenDeep'), - 'head': require('./array/head'), - 'indexOf': require('./array/indexOf'), - 'initial': require('./array/initial'), - 'intersection': require('./array/intersection'), - 'last': require('./array/last'), - 'lastIndexOf': require('./array/lastIndexOf'), - 'object': require('./array/object'), - 'pull': require('./array/pull'), - 'pullAt': require('./array/pullAt'), - 'remove': require('./array/remove'), - 'rest': require('./array/rest'), - 'slice': require('./array/slice'), - 'sortedIndex': require('./array/sortedIndex'), - 'sortedLastIndex': require('./array/sortedLastIndex'), - 'tail': require('./array/tail'), - 'take': require('./array/take'), - 'takeRight': require('./array/takeRight'), - 'takeRightWhile': require('./array/takeRightWhile'), - 'takeWhile': require('./array/takeWhile'), - 'union': require('./array/union'), - 'uniq': require('./array/uniq'), - 'unique': require('./array/unique'), - 'unzip': require('./array/unzip'), - 'unzipWith': require('./array/unzipWith'), - 'without': require('./array/without'), - 'xor': require('./array/xor'), - 'zip': require('./array/zip'), - 'zipObject': require('./array/zipObject'), - 'zipWith': require('./array/zipWith') -}; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/chunk.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/chunk.js deleted file mode 100644 index 4de9b3961843b0..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/chunk.js +++ /dev/null @@ -1,47 +0,0 @@ -var baseSlice = require('../internal/baseSlice'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** Native method references. */ -var ceil = Math.ceil; - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Creates an array of elements split into groups the length of `size`. - * If `collection` can't be split evenly, the final chunk will be the remaining - * elements. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to process. - * @param {number} [size=1] The length of each chunk. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the new array containing chunks. - * @example - * - * _.chunk(['a', 'b', 'c', 'd'], 2); - * // => [['a', 'b'], ['c', 'd']] - * - * _.chunk(['a', 'b', 'c', 'd'], 3); - * // => [['a', 'b', 'c'], ['d']] - */ -function chunk(array, size, guard) { - if (guard ? isIterateeCall(array, size, guard) : size == null) { - size = 1; - } else { - size = nativeMax(+size || 1, 1); - } - var index = 0, - length = array ? array.length : 0, - resIndex = -1, - result = Array(ceil(length / size)); - - while (index < length) { - result[++resIndex] = baseSlice(array, index, (index += size)); - } - return result; -} - -module.exports = chunk; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/compact.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/compact.js deleted file mode 100644 index 1dc1c55e8f1efb..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/compact.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Creates an array with all falsey values removed. The values `false`, `null`, - * `0`, `""`, `undefined`, and `NaN` are falsey. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to compact. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.compact([0, 1, false, 2, '', 3]); - * // => [1, 2, 3] - */ -function compact(array) { - var index = -1, - length = array ? array.length : 0, - resIndex = -1, - result = []; - - while (++index < length) { - var value = array[index]; - if (value) { - result[++resIndex] = value; - } - } - return result; -} - -module.exports = compact; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/difference.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/difference.js deleted file mode 100644 index 5049337e5f3a9d..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/difference.js +++ /dev/null @@ -1,28 +0,0 @@ -var baseDifference = require('../internal/baseDifference'), - baseFlatten = require('../internal/baseFlatten'), - isArrayLike = require('../internal/isArrayLike'), - restParam = require('../function/restParam'); - -/** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The arrays of values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.difference([1, 2, 3], [4, 2]); - * // => [1, 3] - */ -var difference = restParam(function(array, values) { - return isArrayLike(array) - ? baseDifference(array, baseFlatten(values, false, true)) - : []; -}); - -module.exports = difference; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/drop.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/drop.js deleted file mode 100644 index 039a0b5fdcdf2b..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/drop.js +++ /dev/null @@ -1,39 +0,0 @@ -var baseSlice = require('../internal/baseSlice'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Creates a slice of `array` with `n` elements dropped from the beginning. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.drop([1, 2, 3]); - * // => [2, 3] - * - * _.drop([1, 2, 3], 2); - * // => [3] - * - * _.drop([1, 2, 3], 5); - * // => [] - * - * _.drop([1, 2, 3], 0); - * // => [1, 2, 3] - */ -function drop(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - return baseSlice(array, n < 0 ? 0 : n); -} - -module.exports = drop; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/dropRight.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/dropRight.js deleted file mode 100644 index 14b5eb6f0a198e..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/dropRight.js +++ /dev/null @@ -1,40 +0,0 @@ -var baseSlice = require('../internal/baseSlice'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Creates a slice of `array` with `n` elements dropped from the end. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropRight([1, 2, 3]); - * // => [1, 2] - * - * _.dropRight([1, 2, 3], 2); - * // => [1] - * - * _.dropRight([1, 2, 3], 5); - * // => [] - * - * _.dropRight([1, 2, 3], 0); - * // => [1, 2, 3] - */ -function dropRight(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - n = length - (+n || 0); - return baseSlice(array, 0, n < 0 ? 0 : n); -} - -module.exports = dropRight; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/dropRightWhile.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/dropRightWhile.js deleted file mode 100644 index be158bd5fa94c0..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/dropRightWhile.js +++ /dev/null @@ -1,59 +0,0 @@ -var baseCallback = require('../internal/baseCallback'), - baseWhile = require('../internal/baseWhile'); - -/** - * Creates a slice of `array` excluding elements dropped from the end. - * Elements are dropped until `predicate` returns falsey. The predicate is - * bound to `thisArg` and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that match the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropRightWhile([1, 2, 3], function(n) { - * return n > 1; - * }); - * // => [1] - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.dropRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user'); - * // => ['barney', 'fred'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.dropRightWhile(users, 'active', false), 'user'); - * // => ['barney'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.dropRightWhile(users, 'active'), 'user'); - * // => ['barney', 'fred', 'pebbles'] - */ -function dropRightWhile(array, predicate, thisArg) { - return (array && array.length) - ? baseWhile(array, baseCallback(predicate, thisArg, 3), true, true) - : []; -} - -module.exports = dropRightWhile; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/dropWhile.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/dropWhile.js deleted file mode 100644 index d9eabae9fac8b2..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/dropWhile.js +++ /dev/null @@ -1,59 +0,0 @@ -var baseCallback = require('../internal/baseCallback'), - baseWhile = require('../internal/baseWhile'); - -/** - * Creates a slice of `array` excluding elements dropped from the beginning. - * Elements are dropped until `predicate` returns falsey. The predicate is - * bound to `thisArg` and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropWhile([1, 2, 3], function(n) { - * return n < 3; - * }); - * // => [3] - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.dropWhile(users, { 'user': 'barney', 'active': false }), 'user'); - * // => ['fred', 'pebbles'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.dropWhile(users, 'active', false), 'user'); - * // => ['pebbles'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.dropWhile(users, 'active'), 'user'); - * // => ['barney', 'fred', 'pebbles'] - */ -function dropWhile(array, predicate, thisArg) { - return (array && array.length) - ? baseWhile(array, baseCallback(predicate, thisArg, 3), true) - : []; -} - -module.exports = dropWhile; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/fill.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/fill.js deleted file mode 100644 index 2c8f6da71d0620..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/fill.js +++ /dev/null @@ -1,44 +0,0 @@ -var baseFill = require('../internal/baseFill'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Fills elements of `array` with `value` from `start` up to, but not - * including, `end`. - * - * **Note:** This method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.fill(array, 'a'); - * console.log(array); - * // => ['a', 'a', 'a'] - * - * _.fill(Array(3), 2); - * // => [2, 2, 2] - * - * _.fill([4, 6, 8], '*', 1, 2); - * // => [4, '*', 8] - */ -function fill(array, value, start, end) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { - start = 0; - end = length; - } - return baseFill(array, value, start, end); -} - -module.exports = fill; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/findIndex.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/findIndex.js deleted file mode 100644 index 2a6b8e14bace9e..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/findIndex.js +++ /dev/null @@ -1,53 +0,0 @@ -var createFindIndex = require('../internal/createFindIndex'); - -/** - * This method is like `_.find` except that it returns the index of the first - * element `predicate` returns truthy for instead of the element itself. - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.findIndex(users, function(chr) { - * return chr.user == 'barney'; - * }); - * // => 0 - * - * // using the `_.matches` callback shorthand - * _.findIndex(users, { 'user': 'fred', 'active': false }); - * // => 1 - * - * // using the `_.matchesProperty` callback shorthand - * _.findIndex(users, 'active', false); - * // => 0 - * - * // using the `_.property` callback shorthand - * _.findIndex(users, 'active'); - * // => 2 - */ -var findIndex = createFindIndex(); - -module.exports = findIndex; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/findLastIndex.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/findLastIndex.js deleted file mode 100644 index d6d8eca6df707b..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/findLastIndex.js +++ /dev/null @@ -1,53 +0,0 @@ -var createFindIndex = require('../internal/createFindIndex'); - -/** - * This method is like `_.findIndex` except that it iterates over elements - * of `collection` from right to left. - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.findLastIndex(users, function(chr) { - * return chr.user == 'pebbles'; - * }); - * // => 2 - * - * // using the `_.matches` callback shorthand - * _.findLastIndex(users, { 'user': 'barney', 'active': true }); - * // => 0 - * - * // using the `_.matchesProperty` callback shorthand - * _.findLastIndex(users, 'active', false); - * // => 2 - * - * // using the `_.property` callback shorthand - * _.findLastIndex(users, 'active'); - * // => 0 - */ -var findLastIndex = createFindIndex(true); - -module.exports = findLastIndex; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/first.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/first.js deleted file mode 100644 index b3b9c79c7bba5d..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/first.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Gets the first element of `array`. - * - * @static - * @memberOf _ - * @alias head - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the first element of `array`. - * @example - * - * _.first([1, 2, 3]); - * // => 1 - * - * _.first([]); - * // => undefined - */ -function first(array) { - return array ? array[0] : undefined; -} - -module.exports = first; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/flatten.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/flatten.js deleted file mode 100644 index 65bbeefb775ad8..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/flatten.js +++ /dev/null @@ -1,32 +0,0 @@ -var baseFlatten = require('../internal/baseFlatten'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Flattens a nested array. If `isDeep` is `true` the array is recursively - * flattened, otherwise it is only flattened a single level. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to flatten. - * @param {boolean} [isDeep] Specify a deep flatten. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flatten([1, [2, 3, [4]]]); - * // => [1, 2, 3, [4]] - * - * // using `isDeep` - * _.flatten([1, [2, 3, [4]]], true); - * // => [1, 2, 3, 4] - */ -function flatten(array, isDeep, guard) { - var length = array ? array.length : 0; - if (guard && isIterateeCall(array, isDeep, guard)) { - isDeep = false; - } - return length ? baseFlatten(array, isDeep) : []; -} - -module.exports = flatten; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/flattenDeep.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/flattenDeep.js deleted file mode 100644 index 9f775febe2aeb3..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/flattenDeep.js +++ /dev/null @@ -1,21 +0,0 @@ -var baseFlatten = require('../internal/baseFlatten'); - -/** - * Recursively flattens a nested array. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to recursively flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flattenDeep([1, [2, 3, [4]]]); - * // => [1, 2, 3, 4] - */ -function flattenDeep(array) { - var length = array ? array.length : 0; - return length ? baseFlatten(array, true) : []; -} - -module.exports = flattenDeep; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/head.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/head.js deleted file mode 100644 index 1961b08c7eb538..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/head.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./first'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/indexOf.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/indexOf.js deleted file mode 100644 index f8f6c9fc2cdb4f..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/indexOf.js +++ /dev/null @@ -1,54 +0,0 @@ -var baseIndexOf = require('../internal/baseIndexOf'), - binaryIndex = require('../internal/binaryIndex'); - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it is used as the offset - * from the end of `array`. If `array` is sorted providing `true` for `fromIndex` - * performs a faster binary search. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {boolean|number} [fromIndex=0] The index to search from or `true` - * to perform a binary search on a sorted array. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - * - * // performing a binary search - * _.indexOf([1, 1, 2, 2], 2, true); - * // => 2 - */ -function indexOf(array, value, fromIndex) { - var length = array ? array.length : 0; - if (!length) { - return -1; - } - if (typeof fromIndex == 'number') { - fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex; - } else if (fromIndex) { - var index = binaryIndex(array, value), - other = array[index]; - - if (value === value ? (value === other) : (other !== other)) { - return index; - } - return -1; - } - return baseIndexOf(array, value, fromIndex || 0); -} - -module.exports = indexOf; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/initial.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/initial.js deleted file mode 100644 index 59b7a7d96dfbda..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/initial.js +++ /dev/null @@ -1,20 +0,0 @@ -var dropRight = require('./dropRight'); - -/** - * Gets all but the last element of `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.initial([1, 2, 3]); - * // => [1, 2] - */ -function initial(array) { - return dropRight(array, 1); -} - -module.exports = initial; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/intersection.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/intersection.js deleted file mode 100644 index ec5b7f9b6ce4db..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/intersection.js +++ /dev/null @@ -1,58 +0,0 @@ -var baseIndexOf = require('../internal/baseIndexOf'), - cacheIndexOf = require('../internal/cacheIndexOf'), - createCache = require('../internal/createCache'), - isArrayLike = require('../internal/isArrayLike'), - restParam = require('../function/restParam'); - -/** - * Creates an array of unique values that are included in all of the provided - * arrays using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of shared values. - * @example - * _.intersection([1, 2], [4, 2], [2, 1]); - * // => [2] - */ -var intersection = restParam(function(arrays) { - var othLength = arrays.length, - othIndex = othLength, - caches = Array(length), - indexOf = baseIndexOf, - isCommon = true, - result = []; - - while (othIndex--) { - var value = arrays[othIndex] = isArrayLike(value = arrays[othIndex]) ? value : []; - caches[othIndex] = (isCommon && value.length >= 120) ? createCache(othIndex && value) : null; - } - var array = arrays[0], - index = -1, - length = array ? array.length : 0, - seen = caches[0]; - - outer: - while (++index < length) { - value = array[index]; - if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value, 0)) < 0) { - var othIndex = othLength; - while (--othIndex) { - var cache = caches[othIndex]; - if ((cache ? cacheIndexOf(cache, value) : indexOf(arrays[othIndex], value, 0)) < 0) { - continue outer; - } - } - if (seen) { - seen.push(value); - } - result.push(value); - } - } - return result; -}); - -module.exports = intersection; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/last.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/last.js deleted file mode 100644 index 299af3146ca232..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/last.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Gets the last element of `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the last element of `array`. - * @example - * - * _.last([1, 2, 3]); - * // => 3 - */ -function last(array) { - var length = array ? array.length : 0; - return length ? array[length - 1] : undefined; -} - -module.exports = last; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/lastIndexOf.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/lastIndexOf.js deleted file mode 100644 index 02b806269bd21c..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/lastIndexOf.js +++ /dev/null @@ -1,60 +0,0 @@ -var binaryIndex = require('../internal/binaryIndex'), - indexOfNaN = require('../internal/indexOfNaN'); - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max, - nativeMin = Math.min; - -/** - * This method is like `_.indexOf` except that it iterates over elements of - * `array` from right to left. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {boolean|number} [fromIndex=array.length-1] The index to search from - * or `true` to perform a binary search on a sorted array. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.lastIndexOf([1, 2, 1, 2], 2); - * // => 3 - * - * // using `fromIndex` - * _.lastIndexOf([1, 2, 1, 2], 2, 2); - * // => 1 - * - * // performing a binary search - * _.lastIndexOf([1, 1, 2, 2], 2, true); - * // => 3 - */ -function lastIndexOf(array, value, fromIndex) { - var length = array ? array.length : 0; - if (!length) { - return -1; - } - var index = length; - if (typeof fromIndex == 'number') { - index = (fromIndex < 0 ? nativeMax(length + fromIndex, 0) : nativeMin(fromIndex || 0, length - 1)) + 1; - } else if (fromIndex) { - index = binaryIndex(array, value, true) - 1; - var other = array[index]; - if (value === value ? (value === other) : (other !== other)) { - return index; - } - return -1; - } - if (value !== value) { - return indexOfNaN(array, index, true); - } - while (index--) { - if (array[index] === value) { - return index; - } - } - return -1; -} - -module.exports = lastIndexOf; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/object.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/object.js deleted file mode 100644 index f4a34531b139f9..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/object.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./zipObject'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/pull.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/pull.js deleted file mode 100644 index 746f196f830fe0..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/pull.js +++ /dev/null @@ -1,52 +0,0 @@ -var baseIndexOf = require('../internal/baseIndexOf'); - -/** Used for native method references. */ -var arrayProto = Array.prototype; - -/** Native method references. */ -var splice = arrayProto.splice; - -/** - * Removes all provided values from `array` using - * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. - * - * **Note:** Unlike `_.without`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {...*} [values] The values to remove. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * - * _.pull(array, 2, 3); - * console.log(array); - * // => [1, 1] - */ -function pull() { - var args = arguments, - array = args[0]; - - if (!(array && array.length)) { - return array; - } - var index = 0, - indexOf = baseIndexOf, - length = args.length; - - while (++index < length) { - var fromIndex = 0, - value = args[index]; - - while ((fromIndex = indexOf(array, value, fromIndex)) > -1) { - splice.call(array, fromIndex, 1); - } - } - return array; -} - -module.exports = pull; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/pullAt.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/pullAt.js deleted file mode 100644 index 4ca2476f0e1c78..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/pullAt.js +++ /dev/null @@ -1,40 +0,0 @@ -var baseAt = require('../internal/baseAt'), - baseCompareAscending = require('../internal/baseCompareAscending'), - baseFlatten = require('../internal/baseFlatten'), - basePullAt = require('../internal/basePullAt'), - restParam = require('../function/restParam'); - -/** - * Removes elements from `array` corresponding to the given indexes and returns - * an array of the removed elements. Indexes may be specified as an array of - * indexes or as individual arguments. - * - * **Note:** Unlike `_.at`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {...(number|number[])} [indexes] The indexes of elements to remove, - * specified as individual indexes or arrays of indexes. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = [5, 10, 15, 20]; - * var evens = _.pullAt(array, 1, 3); - * - * console.log(array); - * // => [5, 15] - * - * console.log(evens); - * // => [10, 20] - */ -var pullAt = restParam(function(array, indexes) { - indexes = baseFlatten(indexes); - - var result = baseAt(array, indexes); - basePullAt(array, indexes.sort(baseCompareAscending)); - return result; -}); - -module.exports = pullAt; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/remove.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/remove.js deleted file mode 100644 index 0cf979bda0b241..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/remove.js +++ /dev/null @@ -1,64 +0,0 @@ -var baseCallback = require('../internal/baseCallback'), - basePullAt = require('../internal/basePullAt'); - -/** - * Removes all elements from `array` that `predicate` returns truthy for - * and returns an array of the removed elements. The predicate is bound to - * `thisArg` and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * **Note:** Unlike `_.filter`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = [1, 2, 3, 4]; - * var evens = _.remove(array, function(n) { - * return n % 2 == 0; - * }); - * - * console.log(array); - * // => [1, 3] - * - * console.log(evens); - * // => [2, 4] - */ -function remove(array, predicate, thisArg) { - var result = []; - if (!(array && array.length)) { - return result; - } - var index = -1, - indexes = [], - length = array.length; - - predicate = baseCallback(predicate, thisArg, 3); - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result.push(value); - indexes.push(index); - } - } - basePullAt(array, indexes); - return result; -} - -module.exports = remove; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/rest.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/rest.js deleted file mode 100644 index 9bfb734f1fbe64..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/rest.js +++ /dev/null @@ -1,21 +0,0 @@ -var drop = require('./drop'); - -/** - * Gets all but the first element of `array`. - * - * @static - * @memberOf _ - * @alias tail - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.rest([1, 2, 3]); - * // => [2, 3] - */ -function rest(array) { - return drop(array, 1); -} - -module.exports = rest; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/slice.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/slice.js deleted file mode 100644 index 48ef1a1a280f56..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/slice.js +++ /dev/null @@ -1,30 +0,0 @@ -var baseSlice = require('../internal/baseSlice'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Creates a slice of `array` from `start` up to, but not including, `end`. - * - * **Note:** This method is used instead of `Array#slice` to support node - * lists in IE < 9 and to ensure dense arrays are returned. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ -function slice(array, start, end) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { - start = 0; - end = length; - } - return baseSlice(array, start, end); -} - -module.exports = slice; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/sortedIndex.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/sortedIndex.js deleted file mode 100644 index 51d150e3b3ac9d..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/sortedIndex.js +++ /dev/null @@ -1,53 +0,0 @@ -var createSortedIndex = require('../internal/createSortedIndex'); - -/** - * Uses a binary search to determine the lowest index at which `value` should - * be inserted into `array` in order to maintain its sort order. If an iteratee - * function is provided it is invoked for `value` and each element of `array` - * to compute their sort ranking. The iteratee is bound to `thisArg` and - * invoked with one argument; (value). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - * - * _.sortedIndex([4, 4, 5, 5], 5); - * // => 2 - * - * var dict = { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } }; - * - * // using an iteratee function - * _.sortedIndex(['thirty', 'fifty'], 'forty', function(word) { - * return this.data[word]; - * }, dict); - * // => 1 - * - * // using the `_.property` callback shorthand - * _.sortedIndex([{ 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); - * // => 1 - */ -var sortedIndex = createSortedIndex(); - -module.exports = sortedIndex; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/sortedLastIndex.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/sortedLastIndex.js deleted file mode 100644 index 81a4a8689e8c00..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/sortedLastIndex.js +++ /dev/null @@ -1,25 +0,0 @@ -var createSortedIndex = require('../internal/createSortedIndex'); - -/** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * _.sortedLastIndex([4, 4, 5, 5], 5); - * // => 4 - */ -var sortedLastIndex = createSortedIndex(true); - -module.exports = sortedLastIndex; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/tail.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/tail.js deleted file mode 100644 index c5dfe779d6f762..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/tail.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./rest'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/take.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/take.js deleted file mode 100644 index 875917a746650d..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/take.js +++ /dev/null @@ -1,39 +0,0 @@ -var baseSlice = require('../internal/baseSlice'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Creates a slice of `array` with `n` elements taken from the beginning. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.take([1, 2, 3]); - * // => [1] - * - * _.take([1, 2, 3], 2); - * // => [1, 2] - * - * _.take([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.take([1, 2, 3], 0); - * // => [] - */ -function take(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - return baseSlice(array, 0, n < 0 ? 0 : n); -} - -module.exports = take; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/takeRight.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/takeRight.js deleted file mode 100644 index 6e89c874801804..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/takeRight.js +++ /dev/null @@ -1,40 +0,0 @@ -var baseSlice = require('../internal/baseSlice'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Creates a slice of `array` with `n` elements taken from the end. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeRight([1, 2, 3]); - * // => [3] - * - * _.takeRight([1, 2, 3], 2); - * // => [2, 3] - * - * _.takeRight([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.takeRight([1, 2, 3], 0); - * // => [] - */ -function takeRight(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - n = length - (+n || 0); - return baseSlice(array, n < 0 ? 0 : n); -} - -module.exports = takeRight; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/takeRightWhile.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/takeRightWhile.js deleted file mode 100644 index 5464d13b7fa2fb..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/takeRightWhile.js +++ /dev/null @@ -1,59 +0,0 @@ -var baseCallback = require('../internal/baseCallback'), - baseWhile = require('../internal/baseWhile'); - -/** - * Creates a slice of `array` with elements taken from the end. Elements are - * taken until `predicate` returns falsey. The predicate is bound to `thisArg` - * and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeRightWhile([1, 2, 3], function(n) { - * return n > 1; - * }); - * // => [2, 3] - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.takeRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user'); - * // => ['pebbles'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.takeRightWhile(users, 'active', false), 'user'); - * // => ['fred', 'pebbles'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.takeRightWhile(users, 'active'), 'user'); - * // => [] - */ -function takeRightWhile(array, predicate, thisArg) { - return (array && array.length) - ? baseWhile(array, baseCallback(predicate, thisArg, 3), false, true) - : []; -} - -module.exports = takeRightWhile; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/takeWhile.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/takeWhile.js deleted file mode 100644 index f7e28a1d423a8e..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/takeWhile.js +++ /dev/null @@ -1,59 +0,0 @@ -var baseCallback = require('../internal/baseCallback'), - baseWhile = require('../internal/baseWhile'); - -/** - * Creates a slice of `array` with elements taken from the beginning. Elements - * are taken until `predicate` returns falsey. The predicate is bound to - * `thisArg` and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeWhile([1, 2, 3], function(n) { - * return n < 3; - * }); - * // => [1, 2] - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false}, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.takeWhile(users, { 'user': 'barney', 'active': false }), 'user'); - * // => ['barney'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.takeWhile(users, 'active', false), 'user'); - * // => ['barney', 'fred'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.takeWhile(users, 'active'), 'user'); - * // => [] - */ -function takeWhile(array, predicate, thisArg) { - return (array && array.length) - ? baseWhile(array, baseCallback(predicate, thisArg, 3)) - : []; -} - -module.exports = takeWhile; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/union.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/union.js deleted file mode 100644 index 05101ca1c2d046..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/union.js +++ /dev/null @@ -1,24 +0,0 @@ -var baseFlatten = require('../internal/baseFlatten'), - baseUniq = require('../internal/baseUniq'), - restParam = require('../function/restParam'); - -/** - * Creates an array of unique values, in order, from all of the provided arrays - * using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of combined values. - * @example - * - * _.union([1, 2], [4, 2], [2, 1]); - * // => [1, 2, 4] - */ -var union = restParam(function(arrays) { - return baseUniq(baseFlatten(arrays, false, true)); -}); - -module.exports = union; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/uniq.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/uniq.js deleted file mode 100644 index 91ae46e244d99f..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/uniq.js +++ /dev/null @@ -1,71 +0,0 @@ -var baseCallback = require('../internal/baseCallback'), - baseUniq = require('../internal/baseUniq'), - isIterateeCall = require('../internal/isIterateeCall'), - sortedUniq = require('../internal/sortedUniq'); - -/** - * Creates a duplicate-free version of an array, using - * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons, in which only the first occurence of each element - * is kept. Providing `true` for `isSorted` performs a faster search algorithm - * for sorted arrays. If an iteratee function is provided it is invoked for - * each element in the array to generate the criterion by which uniqueness - * is computed. The `iteratee` is bound to `thisArg` and invoked with three - * arguments: (value, index, array). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias unique - * @category Array - * @param {Array} array The array to inspect. - * @param {boolean} [isSorted] Specify the array is sorted. - * @param {Function|Object|string} [iteratee] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new duplicate-value-free array. - * @example - * - * _.uniq([2, 1, 2]); - * // => [2, 1] - * - * // using `isSorted` - * _.uniq([1, 1, 2], true); - * // => [1, 2] - * - * // using an iteratee function - * _.uniq([1, 2.5, 1.5, 2], function(n) { - * return this.floor(n); - * }, Math); - * // => [1, 2.5] - * - * // using the `_.property` callback shorthand - * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ -function uniq(array, isSorted, iteratee, thisArg) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (isSorted != null && typeof isSorted != 'boolean') { - thisArg = iteratee; - iteratee = isIterateeCall(array, isSorted, thisArg) ? null : isSorted; - isSorted = false; - } - iteratee = iteratee == null ? iteratee : baseCallback(iteratee, thisArg, 3); - return (isSorted) - ? sortedUniq(array, iteratee) - : baseUniq(array, iteratee); -} - -module.exports = uniq; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/unique.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/unique.js deleted file mode 100644 index 396de1b80464f8..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/unique.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./uniq'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/unzip.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/unzip.js deleted file mode 100644 index 0a539fa631522b..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/unzip.js +++ /dev/null @@ -1,47 +0,0 @@ -var arrayFilter = require('../internal/arrayFilter'), - arrayMap = require('../internal/arrayMap'), - baseProperty = require('../internal/baseProperty'), - isArrayLike = require('../internal/isArrayLike'); - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * This method is like `_.zip` except that it accepts an array of grouped - * elements and creates an array regrouping the elements to their pre-zip - * configuration. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array of grouped elements to process. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]); - * // => [['fred', 30, true], ['barney', 40, false]] - * - * _.unzip(zipped); - * // => [['fred', 'barney'], [30, 40], [true, false]] - */ -function unzip(array) { - if (!(array && array.length)) { - return []; - } - var index = -1, - length = 0; - - array = arrayFilter(array, function(group) { - if (isArrayLike(group)) { - length = nativeMax(group.length, length); - return true; - } - }); - var result = Array(length); - while (++index < length) { - result[index] = arrayMap(array, baseProperty(index)); - } - return result; -} - -module.exports = unzip; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/unzipWith.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/unzipWith.js deleted file mode 100644 index 324a2b1db28578..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/unzipWith.js +++ /dev/null @@ -1,41 +0,0 @@ -var arrayMap = require('../internal/arrayMap'), - arrayReduce = require('../internal/arrayReduce'), - bindCallback = require('../internal/bindCallback'), - unzip = require('./unzip'); - -/** - * This method is like `_.unzip` except that it accepts an iteratee to specify - * how regrouped values should be combined. The `iteratee` is bound to `thisArg` - * and invoked with four arguments: (accumulator, value, index, group). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array of grouped elements to process. - * @param {Function} [iteratee] The function to combine regrouped values. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip([1, 2], [10, 20], [100, 200]); - * // => [[1, 10, 100], [2, 20, 200]] - * - * _.unzipWith(zipped, _.add); - * // => [3, 30, 300] - */ -function unzipWith(array, iteratee, thisArg) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - var result = unzip(array); - if (iteratee == null) { - return result; - } - iteratee = bindCallback(iteratee, thisArg, 4); - return arrayMap(result, function(group) { - return arrayReduce(group, iteratee, undefined, true); - }); -} - -module.exports = unzipWith; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/without.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/without.js deleted file mode 100644 index 19b78491af674f..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/without.js +++ /dev/null @@ -1,27 +0,0 @@ -var baseDifference = require('../internal/baseDifference'), - isArrayLike = require('../internal/isArrayLike'), - restParam = require('../function/restParam'); - -/** - * Creates an array excluding all provided values using - * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to filter. - * @param {...*} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.without([1, 2, 1, 3], 1, 2); - * // => [3] - */ -var without = restParam(function(array, values) { - return isArrayLike(array) - ? baseDifference(array, values) - : []; -}); - -module.exports = without; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/xor.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/xor.js deleted file mode 100644 index 3bdf9df1218365..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/xor.js +++ /dev/null @@ -1,34 +0,0 @@ -var baseDifference = require('../internal/baseDifference'), - baseUniq = require('../internal/baseUniq'), - isArrayLike = require('../internal/isArrayLike'); - -/** - * Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) - * of the provided arrays. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of values. - * @example - * - * _.xor([1, 2], [4, 2]); - * // => [1, 4] - */ -function xor() { - var index = -1, - length = arguments.length; - - while (++index < length) { - var array = arguments[index]; - if (isArrayLike(array)) { - var result = result - ? baseDifference(result, array).concat(baseDifference(array, result)) - : array; - } - } - return result ? baseUniq(result) : []; -} - -module.exports = xor; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/zip.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/zip.js deleted file mode 100644 index 53a6f69912158c..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/zip.js +++ /dev/null @@ -1,21 +0,0 @@ -var restParam = require('../function/restParam'), - unzip = require('./unzip'); - -/** - * Creates an array of grouped elements, the first of which contains the first - * elements of the given arrays, the second of which contains the second elements - * of the given arrays, and so on. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @returns {Array} Returns the new array of grouped elements. - * @example - * - * _.zip(['fred', 'barney'], [30, 40], [true, false]); - * // => [['fred', 30, true], ['barney', 40, false]] - */ -var zip = restParam(unzip); - -module.exports = zip; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/zipObject.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/zipObject.js deleted file mode 100644 index dec7a211b7427f..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/zipObject.js +++ /dev/null @@ -1,43 +0,0 @@ -var isArray = require('../lang/isArray'); - -/** - * The inverse of `_.pairs`; this method returns an object composed from arrays - * of property names and values. Provide either a single two dimensional array, - * e.g. `[[key1, value1], [key2, value2]]` or two arrays, one of property names - * and one of corresponding values. - * - * @static - * @memberOf _ - * @alias object - * @category Array - * @param {Array} props The property names. - * @param {Array} [values=[]] The property values. - * @returns {Object} Returns the new object. - * @example - * - * _.zipObject([['fred', 30], ['barney', 40]]); - * // => { 'fred': 30, 'barney': 40 } - * - * _.zipObject(['fred', 'barney'], [30, 40]); - * // => { 'fred': 30, 'barney': 40 } - */ -function zipObject(props, values) { - var index = -1, - length = props ? props.length : 0, - result = {}; - - if (length && !values && !isArray(props[0])) { - values = []; - } - while (++index < length) { - var key = props[index]; - if (values) { - result[key] = values[index]; - } else if (key) { - result[key[0]] = key[1]; - } - } - return result; -} - -module.exports = zipObject; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/zipWith.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/zipWith.js deleted file mode 100644 index ad103742cd1104..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/array/zipWith.js +++ /dev/null @@ -1,36 +0,0 @@ -var restParam = require('../function/restParam'), - unzipWith = require('./unzipWith'); - -/** - * This method is like `_.zip` except that it accepts an iteratee to specify - * how grouped values should be combined. The `iteratee` is bound to `thisArg` - * and invoked with four arguments: (accumulator, value, index, group). - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @param {Function} [iteratee] The function to combine grouped values. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new array of grouped elements. - * @example - * - * _.zipWith([1, 2], [10, 20], [100, 200], _.add); - * // => [111, 222] - */ -var zipWith = restParam(function(arrays) { - var length = arrays.length, - iteratee = length > 2 ? arrays[length - 2] : undefined, - thisArg = length > 1 ? arrays[length - 1] : undefined; - - if (length > 2 && typeof iteratee == 'function') { - length -= 2; - } else { - iteratee = (length > 1 && typeof thisArg == 'function') ? (--length, thisArg) : undefined; - thisArg = undefined; - } - arrays.length = length; - return unzipWith(arrays, iteratee, thisArg); -}); - -module.exports = zipWith; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain.js deleted file mode 100644 index 7992b733e23602..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain.js +++ /dev/null @@ -1,15 +0,0 @@ -module.exports = { - 'chain': require('./chain/chain'), - 'commit': require('./chain/commit'), - 'lodash': require('./chain/lodash'), - 'plant': require('./chain/plant'), - 'reverse': require('./chain/reverse'), - 'run': require('./chain/run'), - 'tap': require('./chain/tap'), - 'thru': require('./chain/thru'), - 'toJSON': require('./chain/toJSON'), - 'toString': require('./chain/toString'), - 'value': require('./chain/value'), - 'valueOf': require('./chain/valueOf'), - 'wrapperChain': require('./chain/wrapperChain') -}; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/chain.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/chain.js deleted file mode 100644 index 453ba1eb5e88cc..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/chain.js +++ /dev/null @@ -1,35 +0,0 @@ -var lodash = require('./lodash'); - -/** - * Creates a `lodash` object that wraps `value` with explicit method - * chaining enabled. - * - * @static - * @memberOf _ - * @category Chain - * @param {*} value The value to wrap. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'pebbles', 'age': 1 } - * ]; - * - * var youngest = _.chain(users) - * .sortBy('age') - * .map(function(chr) { - * return chr.user + ' is ' + chr.age; - * }) - * .first() - * .value(); - * // => 'pebbles is 1' - */ -function chain(value) { - var result = lodash(value); - result.__chain__ = true; - return result; -} - -module.exports = chain; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/commit.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/commit.js deleted file mode 100644 index c732d1bf9139d0..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/commit.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./wrapperCommit'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/lodash.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/lodash.js deleted file mode 100644 index 3241ed89f22cf3..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/lodash.js +++ /dev/null @@ -1,123 +0,0 @@ -var LazyWrapper = require('../internal/LazyWrapper'), - LodashWrapper = require('../internal/LodashWrapper'), - baseLodash = require('../internal/baseLodash'), - isArray = require('../lang/isArray'), - isObjectLike = require('../internal/isObjectLike'), - wrapperClone = require('../internal/wrapperClone'); - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Creates a `lodash` object which wraps `value` to enable implicit chaining. - * Methods that operate on and return arrays, collections, and functions can - * be chained together. Methods that return a boolean or single value will - * automatically end the chain returning the unwrapped value. Explicit chaining - * may be enabled using `_.chain`. The execution of chained methods is lazy, - * that is, execution is deferred until `_#value` is implicitly or explicitly - * called. - * - * Lazy evaluation allows several methods to support shortcut fusion. Shortcut - * fusion is an optimization that merges iteratees to avoid creating intermediate - * arrays and reduce the number of iteratee executions. - * - * Chaining is supported in custom builds as long as the `_#value` method is - * directly or indirectly included in the build. - * - * In addition to lodash methods, wrappers have `Array` and `String` methods. - * - * The wrapper `Array` methods are: - * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, - * `splice`, and `unshift` - * - * The wrapper `String` methods are: - * `replace` and `split` - * - * The wrapper methods that support shortcut fusion are: - * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, - * `first`, `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`, - * `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`, - * and `where` - * - * The chainable wrapper methods are: - * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`, - * `callback`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`, - * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defer`, `delay`, - * `difference`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `fill`, - * `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`, `forEach`, - * `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `functions`, - * `groupBy`, `indexBy`, `initial`, `intersection`, `invert`, `invoke`, `keys`, - * `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, - * `memoize`, `merge`, `method`, `methodOf`, `mixin`, `negate`, `omit`, `once`, - * `pairs`, `partial`, `partialRight`, `partition`, `pick`, `plant`, `pluck`, - * `property`, `propertyOf`, `pull`, `pullAt`, `push`, `range`, `rearg`, - * `reject`, `remove`, `rest`, `restParam`, `reverse`, `set`, `shuffle`, - * `slice`, `sort`, `sortBy`, `sortByAll`, `sortByOrder`, `splice`, `spread`, - * `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`, - * `thru`, `times`, `toArray`, `toPlainObject`, `transform`, `union`, `uniq`, - * `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`, `where`, `without`, - * `wrap`, `xor`, `zip`, `zipObject`, `zipWith` - * - * The wrapper methods that are **not** chainable by default are: - * `add`, `attempt`, `camelCase`, `capitalize`, `clone`, `cloneDeep`, `deburr`, - * `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, - * `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, `get`, - * `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`, `inRange`, `isArguments`, - * `isArray`, `isBoolean`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isError`, - * `isFinite` `isFunction`, `isMatch`, `isNative`, `isNaN`, `isNull`, `isNumber`, - * `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, - * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lt`, `lte`, - * `max`, `min`, `noConflict`, `noop`, `now`, `pad`, `padLeft`, `padRight`, - * `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, - * `runInContext`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, - * `sortedLastIndex`, `startCase`, `startsWith`, `sum`, `template`, `trim`, - * `trimLeft`, `trimRight`, `trunc`, `unescape`, `uniqueId`, `value`, and `words` - * - * The wrapper method `sample` will return a wrapped value when `n` is provided, - * otherwise an unwrapped value is returned. - * - * @name _ - * @constructor - * @category Chain - * @param {*} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var wrapped = _([1, 2, 3]); - * - * // returns an unwrapped value - * wrapped.reduce(function(total, n) { - * return total + n; - * }); - * // => 6 - * - * // returns a wrapped value - * var squares = wrapped.map(function(n) { - * return n * n; - * }); - * - * _.isArray(squares); - * // => false - * - * _.isArray(squares.value()); - * // => true - */ -function lodash(value) { - if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { - if (value instanceof LodashWrapper) { - return value; - } - if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) { - return wrapperClone(value); - } - } - return new LodashWrapper(value); -} - -// Ensure wrappers are instances of `baseLodash`. -lodash.prototype = baseLodash.prototype; - -module.exports = lodash; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/plant.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/plant.js deleted file mode 100644 index 04099f238659d4..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/plant.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./wrapperPlant'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/reverse.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/reverse.js deleted file mode 100644 index f72a64a19b95db..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/reverse.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./wrapperReverse'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/run.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/run.js deleted file mode 100644 index 5e751a2c32e8af..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/run.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./wrapperValue'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/tap.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/tap.js deleted file mode 100644 index 3d0257ecfde69b..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/tap.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This method invokes `interceptor` and returns `value`. The interceptor is - * bound to `thisArg` and invoked with one argument; (value). The purpose of - * this method is to "tap into" a method chain in order to perform operations - * on intermediate results within the chain. - * - * @static - * @memberOf _ - * @category Chain - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @param {*} [thisArg] The `this` binding of `interceptor`. - * @returns {*} Returns `value`. - * @example - * - * _([1, 2, 3]) - * .tap(function(array) { - * array.pop(); - * }) - * .reverse() - * .value(); - * // => [2, 1] - */ -function tap(value, interceptor, thisArg) { - interceptor.call(thisArg, value); - return value; -} - -module.exports = tap; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/thru.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/thru.js deleted file mode 100644 index a7157803769d83..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/thru.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * This method is like `_.tap` except that it returns the result of `interceptor`. - * - * @static - * @memberOf _ - * @category Chain - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @param {*} [thisArg] The `this` binding of `interceptor`. - * @returns {*} Returns the result of `interceptor`. - * @example - * - * _(' abc ') - * .chain() - * .trim() - * .thru(function(value) { - * return [value]; - * }) - * .value(); - * // => ['abc'] - */ -function thru(value, interceptor, thisArg) { - return interceptor.call(thisArg, value); -} - -module.exports = thru; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/toJSON.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/toJSON.js deleted file mode 100644 index 5e751a2c32e8af..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/toJSON.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./wrapperValue'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/toString.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/toString.js deleted file mode 100644 index c7bcbf9a543e98..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/toString.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./wrapperToString'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/value.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/value.js deleted file mode 100644 index 5e751a2c32e8af..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/value.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./wrapperValue'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/valueOf.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/valueOf.js deleted file mode 100644 index 5e751a2c32e8af..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/valueOf.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./wrapperValue'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperChain.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperChain.js deleted file mode 100644 index 38234819ba04d5..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperChain.js +++ /dev/null @@ -1,32 +0,0 @@ -var chain = require('./chain'); - -/** - * Enables explicit method chaining on the wrapper object. - * - * @name chain - * @memberOf _ - * @category Chain - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // without explicit chaining - * _(users).first(); - * // => { 'user': 'barney', 'age': 36 } - * - * // with explicit chaining - * _(users).chain() - * .first() - * .pick('user') - * .value(); - * // => { 'user': 'barney' } - */ -function wrapperChain() { - return chain(this); -} - -module.exports = wrapperChain; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperCommit.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperCommit.js deleted file mode 100644 index c46a787e97d0e7..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperCommit.js +++ /dev/null @@ -1,32 +0,0 @@ -var LodashWrapper = require('../internal/LodashWrapper'); - -/** - * Executes the chained sequence and returns the wrapped result. - * - * @name commit - * @memberOf _ - * @category Chain - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2]; - * var wrapper = _(array).push(3); - * - * console.log(array); - * // => [1, 2] - * - * wrapper = wrapper.commit(); - * console.log(array); - * // => [1, 2, 3] - * - * wrapper.last(); - * // => 3 - * - * console.log(array); - * // => [1, 2, 3] - */ -function wrapperCommit() { - return new LodashWrapper(this.value(), this.__chain__); -} - -module.exports = wrapperCommit; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperPlant.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperPlant.js deleted file mode 100644 index a3de146b13d740..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperPlant.js +++ /dev/null @@ -1,45 +0,0 @@ -var baseLodash = require('../internal/baseLodash'), - wrapperClone = require('../internal/wrapperClone'); - -/** - * Creates a clone of the chained sequence planting `value` as the wrapped value. - * - * @name plant - * @memberOf _ - * @category Chain - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2]; - * var wrapper = _(array).map(function(value) { - * return Math.pow(value, 2); - * }); - * - * var other = [3, 4]; - * var otherWrapper = wrapper.plant(other); - * - * otherWrapper.value(); - * // => [9, 16] - * - * wrapper.value(); - * // => [1, 4] - */ -function wrapperPlant(value) { - var result, - parent = this; - - while (parent instanceof baseLodash) { - var clone = wrapperClone(parent); - if (result) { - previous.__wrapped__ = clone; - } else { - result = clone; - } - var previous = clone; - parent = parent.__wrapped__; - } - previous.__wrapped__ = value; - return result; -} - -module.exports = wrapperPlant; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperReverse.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperReverse.js deleted file mode 100644 index 4518b3ed286c56..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperReverse.js +++ /dev/null @@ -1,38 +0,0 @@ -var LazyWrapper = require('../internal/LazyWrapper'), - LodashWrapper = require('../internal/LodashWrapper'), - thru = require('./thru'); - -/** - * Reverses the wrapped array so the first element becomes the last, the - * second element becomes the second to last, and so on. - * - * **Note:** This method mutates the wrapped array. - * - * @name reverse - * @memberOf _ - * @category Chain - * @returns {Object} Returns the new reversed `lodash` wrapper instance. - * @example - * - * var array = [1, 2, 3]; - * - * _(array).reverse().value() - * // => [3, 2, 1] - * - * console.log(array); - * // => [3, 2, 1] - */ -function wrapperReverse() { - var value = this.__wrapped__; - if (value instanceof LazyWrapper) { - if (this.__actions__.length) { - value = new LazyWrapper(this); - } - return new LodashWrapper(value.reverse(), this.__chain__); - } - return this.thru(function(value) { - return value.reverse(); - }); -} - -module.exports = wrapperReverse; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperToString.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperToString.js deleted file mode 100644 index db975a5a35427f..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperToString.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Produces the result of coercing the unwrapped value to a string. - * - * @name toString - * @memberOf _ - * @category Chain - * @returns {string} Returns the coerced string value. - * @example - * - * _([1, 2, 3]).toString(); - * // => '1,2,3' - */ -function wrapperToString() { - return (this.value() + ''); -} - -module.exports = wrapperToString; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperValue.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperValue.js deleted file mode 100644 index 2734e41c4a9290..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/chain/wrapperValue.js +++ /dev/null @@ -1,20 +0,0 @@ -var baseWrapperValue = require('../internal/baseWrapperValue'); - -/** - * Executes the chained sequence to extract the unwrapped value. - * - * @name value - * @memberOf _ - * @alias run, toJSON, valueOf - * @category Chain - * @returns {*} Returns the resolved unwrapped value. - * @example - * - * _([1, 2, 3]).value(); - * // => [1, 2, 3] - */ -function wrapperValue() { - return baseWrapperValue(this.__wrapped__, this.__actions__); -} - -module.exports = wrapperValue; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection.js deleted file mode 100644 index 03388571c3145d..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection.js +++ /dev/null @@ -1,44 +0,0 @@ -module.exports = { - 'all': require('./collection/all'), - 'any': require('./collection/any'), - 'at': require('./collection/at'), - 'collect': require('./collection/collect'), - 'contains': require('./collection/contains'), - 'countBy': require('./collection/countBy'), - 'detect': require('./collection/detect'), - 'each': require('./collection/each'), - 'eachRight': require('./collection/eachRight'), - 'every': require('./collection/every'), - 'filter': require('./collection/filter'), - 'find': require('./collection/find'), - 'findLast': require('./collection/findLast'), - 'findWhere': require('./collection/findWhere'), - 'foldl': require('./collection/foldl'), - 'foldr': require('./collection/foldr'), - 'forEach': require('./collection/forEach'), - 'forEachRight': require('./collection/forEachRight'), - 'groupBy': require('./collection/groupBy'), - 'include': require('./collection/include'), - 'includes': require('./collection/includes'), - 'indexBy': require('./collection/indexBy'), - 'inject': require('./collection/inject'), - 'invoke': require('./collection/invoke'), - 'map': require('./collection/map'), - 'max': require('./math/max'), - 'min': require('./math/min'), - 'partition': require('./collection/partition'), - 'pluck': require('./collection/pluck'), - 'reduce': require('./collection/reduce'), - 'reduceRight': require('./collection/reduceRight'), - 'reject': require('./collection/reject'), - 'sample': require('./collection/sample'), - 'select': require('./collection/select'), - 'shuffle': require('./collection/shuffle'), - 'size': require('./collection/size'), - 'some': require('./collection/some'), - 'sortBy': require('./collection/sortBy'), - 'sortByAll': require('./collection/sortByAll'), - 'sortByOrder': require('./collection/sortByOrder'), - 'sum': require('./math/sum'), - 'where': require('./collection/where') -}; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/all.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/all.js deleted file mode 100644 index d0839f77ed712b..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/all.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./every'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/any.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/any.js deleted file mode 100644 index 900ac25e836b2c..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/any.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./some'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/at.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/at.js deleted file mode 100644 index 29236e577dfb85..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/at.js +++ /dev/null @@ -1,29 +0,0 @@ -var baseAt = require('../internal/baseAt'), - baseFlatten = require('../internal/baseFlatten'), - restParam = require('../function/restParam'); - -/** - * Creates an array of elements corresponding to the given keys, or indexes, - * of `collection`. Keys may be specified as individual arguments or as arrays - * of keys. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {...(number|number[]|string|string[])} [props] The property names - * or indexes of elements to pick, specified individually or in arrays. - * @returns {Array} Returns the new array of picked elements. - * @example - * - * _.at(['a', 'b', 'c'], [0, 2]); - * // => ['a', 'c'] - * - * _.at(['barney', 'fred', 'pebbles'], 0, 2); - * // => ['barney', 'pebbles'] - */ -var at = restParam(function(collection, props) { - return baseAt(collection, baseFlatten(props)); -}); - -module.exports = at; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/collect.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/collect.js deleted file mode 100644 index 0d1e1abfaf9700..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/collect.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./map'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/contains.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/contains.js deleted file mode 100644 index 594722af59a707..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/contains.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./includes'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/countBy.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/countBy.js deleted file mode 100644 index e97dbb749d1c74..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/countBy.js +++ /dev/null @@ -1,54 +0,0 @@ -var createAggregator = require('../internal/createAggregator'); - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is the number of times the key was returned by `iteratee`. - * The `iteratee` is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.countBy([4.3, 6.1, 6.4], function(n) { - * return Math.floor(n); - * }); - * // => { '4': 1, '6': 2 } - * - * _.countBy([4.3, 6.1, 6.4], function(n) { - * return this.floor(n); - * }, Math); - * // => { '4': 1, '6': 2 } - * - * _.countBy(['one', 'two', 'three'], 'length'); - * // => { '3': 2, '5': 1 } - */ -var countBy = createAggregator(function(result, value, key) { - hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1); -}); - -module.exports = countBy; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/detect.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/detect.js deleted file mode 100644 index 2fb6303efb4984..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/detect.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./find'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/every.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/every.js deleted file mode 100644 index a04d3db637783d..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/every.js +++ /dev/null @@ -1,66 +0,0 @@ -var arrayEvery = require('../internal/arrayEvery'), - baseCallback = require('../internal/baseCallback'), - baseEvery = require('../internal/baseEvery'), - isArray = require('../lang/isArray'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Checks if `predicate` returns truthy for **all** elements of `collection`. - * The predicate is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias all - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - * @example - * - * _.every([true, 1, null, 'yes'], Boolean); - * // => false - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.every(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // using the `_.matchesProperty` callback shorthand - * _.every(users, 'active', false); - * // => true - * - * // using the `_.property` callback shorthand - * _.every(users, 'active'); - * // => false - */ -function every(collection, predicate, thisArg) { - var func = isArray(collection) ? arrayEvery : baseEvery; - if (thisArg && isIterateeCall(collection, predicate, thisArg)) { - predicate = null; - } - if (typeof predicate != 'function' || thisArg !== undefined) { - predicate = baseCallback(predicate, thisArg, 3); - } - return func(collection, predicate); -} - -module.exports = every; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/filter.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/filter.js deleted file mode 100644 index 7620aa76195125..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/filter.js +++ /dev/null @@ -1,61 +0,0 @@ -var arrayFilter = require('../internal/arrayFilter'), - baseCallback = require('../internal/baseCallback'), - baseFilter = require('../internal/baseFilter'), - isArray = require('../lang/isArray'); - -/** - * Iterates over elements of `collection`, returning an array of all elements - * `predicate` returns truthy for. The predicate is bound to `thisArg` and - * invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias select - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the new filtered array. - * @example - * - * _.filter([4, 5, 6], function(n) { - * return n % 2 == 0; - * }); - * // => [4, 6] - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user'); - * // => ['barney'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.filter(users, 'active', false), 'user'); - * // => ['fred'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.filter(users, 'active'), 'user'); - * // => ['barney'] - */ -function filter(collection, predicate, thisArg) { - var func = isArray(collection) ? arrayFilter : baseFilter; - predicate = baseCallback(predicate, thisArg, 3); - return func(collection, predicate); -} - -module.exports = filter; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/find.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/find.js deleted file mode 100644 index 7358cfe86cb435..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/find.js +++ /dev/null @@ -1,56 +0,0 @@ -var baseEach = require('../internal/baseEach'), - createFind = require('../internal/createFind'); - -/** - * Iterates over elements of `collection`, returning the first element - * `predicate` returns truthy for. The predicate is bound to `thisArg` and - * invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias detect - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false }, - * { 'user': 'pebbles', 'age': 1, 'active': true } - * ]; - * - * _.result(_.find(users, function(chr) { - * return chr.age < 40; - * }), 'user'); - * // => 'barney' - * - * // using the `_.matches` callback shorthand - * _.result(_.find(users, { 'age': 1, 'active': true }), 'user'); - * // => 'pebbles' - * - * // using the `_.matchesProperty` callback shorthand - * _.result(_.find(users, 'active', false), 'user'); - * // => 'fred' - * - * // using the `_.property` callback shorthand - * _.result(_.find(users, 'active'), 'user'); - * // => 'barney' - */ -var find = createFind(baseEach); - -module.exports = find; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/findLast.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/findLast.js deleted file mode 100644 index 75dbadca2407d0..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/findLast.js +++ /dev/null @@ -1,25 +0,0 @@ -var baseEachRight = require('../internal/baseEachRight'), - createFind = require('../internal/createFind'); - -/** - * This method is like `_.find` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * _.findLast([1, 2, 3, 4], function(n) { - * return n % 2 == 1; - * }); - * // => 3 - */ -var findLast = createFind(baseEachRight, true); - -module.exports = findLast; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/findWhere.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/findWhere.js deleted file mode 100644 index 2d620655ed4307..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/findWhere.js +++ /dev/null @@ -1,37 +0,0 @@ -var baseMatches = require('../internal/baseMatches'), - find = require('./find'); - -/** - * Performs a deep comparison between each element in `collection` and the - * source object, returning the first element that has equivalent property - * values. - * - * **Note:** This method supports comparing arrays, booleans, `Date` objects, - * numbers, `Object` objects, regexes, and strings. Objects are compared by - * their own, not inherited, enumerable properties. For comparing a single - * own or inherited property value see `_.matchesProperty`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Object} source The object of property values to match. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * _.result(_.findWhere(users, { 'age': 36, 'active': true }), 'user'); - * // => 'barney' - * - * _.result(_.findWhere(users, { 'age': 40, 'active': false }), 'user'); - * // => 'fred' - */ -function findWhere(collection, source) { - return find(collection, baseMatches(source)); -} - -module.exports = findWhere; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/foldl.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/foldl.js deleted file mode 100644 index 26f53cf7b26816..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/foldl.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./reduce'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/foldr.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/foldr.js deleted file mode 100644 index 8fb199eda60041..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/foldr.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./reduceRight'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/forEach.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/forEach.js deleted file mode 100644 index 05a8e2140ebe1f..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/forEach.js +++ /dev/null @@ -1,37 +0,0 @@ -var arrayEach = require('../internal/arrayEach'), - baseEach = require('../internal/baseEach'), - createForEach = require('../internal/createForEach'); - -/** - * Iterates over elements of `collection` invoking `iteratee` for each element. - * The `iteratee` is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early - * by explicitly returning `false`. - * - * **Note:** As with other "Collections" methods, objects with a "length" property - * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn` - * may be used for object iteration. - * - * @static - * @memberOf _ - * @alias each - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array|Object|string} Returns `collection`. - * @example - * - * _([1, 2]).forEach(function(n) { - * console.log(n); - * }).value(); - * // => logs each value from left to right and returns the array - * - * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) { - * console.log(n, key); - * }); - * // => logs each value-key pair and returns the object (iteration order is not guaranteed) - */ -var forEach = createForEach(arrayEach, baseEach); - -module.exports = forEach; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/forEachRight.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/forEachRight.js deleted file mode 100644 index 34997110024056..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/forEachRight.js +++ /dev/null @@ -1,26 +0,0 @@ -var arrayEachRight = require('../internal/arrayEachRight'), - baseEachRight = require('../internal/baseEachRight'), - createForEach = require('../internal/createForEach'); - -/** - * This method is like `_.forEach` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @alias eachRight - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array|Object|string} Returns `collection`. - * @example - * - * _([1, 2]).forEachRight(function(n) { - * console.log(n); - * }).value(); - * // => logs each value from right to left and returns the array - */ -var forEachRight = createForEach(arrayEachRight, baseEachRight); - -module.exports = forEachRight; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/groupBy.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/groupBy.js deleted file mode 100644 index a925c894a0d73b..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/groupBy.js +++ /dev/null @@ -1,59 +0,0 @@ -var createAggregator = require('../internal/createAggregator'); - -/** Used for native method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is an array of the elements responsible for generating the key. - * The `iteratee` is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.groupBy([4.2, 6.1, 6.4], function(n) { - * return Math.floor(n); - * }); - * // => { '4': [4.2], '6': [6.1, 6.4] } - * - * _.groupBy([4.2, 6.1, 6.4], function(n) { - * return this.floor(n); - * }, Math); - * // => { '4': [4.2], '6': [6.1, 6.4] } - * - * // using the `_.property` callback shorthand - * _.groupBy(['one', 'two', 'three'], 'length'); - * // => { '3': ['one', 'two'], '5': ['three'] } - */ -var groupBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - result[key].push(value); - } else { - result[key] = [value]; - } -}); - -module.exports = groupBy; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/include.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/include.js deleted file mode 100644 index 594722af59a707..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/include.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./includes'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/includes.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/includes.js deleted file mode 100644 index 80c90e1e3fd115..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/includes.js +++ /dev/null @@ -1,60 +0,0 @@ -var baseIndexOf = require('../internal/baseIndexOf'), - getLength = require('../internal/getLength'), - isArray = require('../lang/isArray'), - isIterateeCall = require('../internal/isIterateeCall'), - isLength = require('../internal/isLength'), - isString = require('../lang/isString'), - values = require('../object/values'); - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Checks if `value` is in `collection` using - * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it is used as the offset - * from the end of `collection`. - * - * @static - * @memberOf _ - * @alias contains, include - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {*} target The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`. - * @returns {boolean} Returns `true` if a matching element is found, else `false`. - * @example - * - * _.includes([1, 2, 3], 1); - * // => true - * - * _.includes([1, 2, 3], 1, 2); - * // => false - * - * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); - * // => true - * - * _.includes('pebbles', 'eb'); - * // => true - */ -function includes(collection, target, fromIndex, guard) { - var length = collection ? getLength(collection) : 0; - if (!isLength(length)) { - collection = values(collection); - length = collection.length; - } - if (!length) { - return false; - } - if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) { - fromIndex = 0; - } else { - fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0); - } - return (typeof collection == 'string' || !isArray(collection) && isString(collection)) - ? (fromIndex < length && collection.indexOf(target, fromIndex) > -1) - : (baseIndexOf(collection, target, fromIndex) > -1); -} - -module.exports = includes; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/indexBy.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/indexBy.js deleted file mode 100644 index 34a941e7290c72..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/indexBy.js +++ /dev/null @@ -1,53 +0,0 @@ -var createAggregator = require('../internal/createAggregator'); - -/** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is the last element responsible for generating the key. The - * iteratee function is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * var keyData = [ - * { 'dir': 'left', 'code': 97 }, - * { 'dir': 'right', 'code': 100 } - * ]; - * - * _.indexBy(keyData, 'dir'); - * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } - * - * _.indexBy(keyData, function(object) { - * return String.fromCharCode(object.code); - * }); - * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } - * - * _.indexBy(keyData, function(object) { - * return this.fromCharCode(object.code); - * }, String); - * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } - */ -var indexBy = createAggregator(function(result, value, key) { - result[key] = value; -}); - -module.exports = indexBy; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/inject.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/inject.js deleted file mode 100644 index 26f53cf7b26816..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/inject.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./reduce'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/invoke.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/invoke.js deleted file mode 100644 index 0a0a84cdbe275d..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/invoke.js +++ /dev/null @@ -1,42 +0,0 @@ -var baseEach = require('../internal/baseEach'), - invokePath = require('../internal/invokePath'), - isArrayLike = require('../internal/isArrayLike'), - isKey = require('../internal/isKey'), - restParam = require('../function/restParam'); - -/** - * Invokes the method at `path` of each element in `collection`, returning - * an array of the results of each invoked method. Any additional arguments - * are provided to each invoked method. If `methodName` is a function it is - * invoked for, and `this` bound to, each element in `collection`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Array|Function|string} path The path of the method to invoke or - * the function invoked per iteration. - * @param {...*} [args] The arguments to invoke the method with. - * @returns {Array} Returns the array of results. - * @example - * - * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); - * // => [[1, 5, 7], [1, 2, 3]] - * - * _.invoke([123, 456], String.prototype.split, ''); - * // => [['1', '2', '3'], ['4', '5', '6']] - */ -var invoke = restParam(function(collection, path, args) { - var index = -1, - isFunc = typeof path == 'function', - isProp = isKey(path), - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value) { - var func = isFunc ? path : ((isProp && value != null) ? value[path] : null); - result[++index] = func ? func.apply(value, args) : invokePath(value, path, args); - }); - return result; -}); - -module.exports = invoke; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/map.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/map.js deleted file mode 100644 index 5381110df1210c..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/map.js +++ /dev/null @@ -1,68 +0,0 @@ -var arrayMap = require('../internal/arrayMap'), - baseCallback = require('../internal/baseCallback'), - baseMap = require('../internal/baseMap'), - isArray = require('../lang/isArray'); - -/** - * Creates an array of values by running each element in `collection` through - * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three - * arguments: (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. - * - * The guarded methods are: - * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`, - * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`, - * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`, - * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`, - * `sum`, `uniq`, and `words` - * - * @static - * @memberOf _ - * @alias collect - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new mapped array. - * @example - * - * function timesThree(n) { - * return n * 3; - * } - * - * _.map([1, 2], timesThree); - * // => [3, 6] - * - * _.map({ 'a': 1, 'b': 2 }, timesThree); - * // => [3, 6] (iteration order is not guaranteed) - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * // using the `_.property` callback shorthand - * _.map(users, 'user'); - * // => ['barney', 'fred'] - */ -function map(collection, iteratee, thisArg) { - var func = isArray(collection) ? arrayMap : baseMap; - iteratee = baseCallback(iteratee, thisArg, 3); - return func(collection, iteratee); -} - -module.exports = map; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/max.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/max.js deleted file mode 100644 index bb1d213c33bd47..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/max.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../math/max'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/min.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/min.js deleted file mode 100644 index eef13d02b8a01e..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/min.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../math/min'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/partition.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/partition.js deleted file mode 100644 index ee35f27d9301b4..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/partition.js +++ /dev/null @@ -1,66 +0,0 @@ -var createAggregator = require('../internal/createAggregator'); - -/** - * Creates an array of elements split into two groups, the first of which - * contains elements `predicate` returns truthy for, while the second of which - * contains elements `predicate` returns falsey for. The predicate is bound - * to `thisArg` and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the array of grouped elements. - * @example - * - * _.partition([1, 2, 3], function(n) { - * return n % 2; - * }); - * // => [[1, 3], [2]] - * - * _.partition([1.2, 2.3, 3.4], function(n) { - * return this.floor(n) % 2; - * }, Math); - * // => [[1.2, 3.4], [2.3]] - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true }, - * { 'user': 'pebbles', 'age': 1, 'active': false } - * ]; - * - * var mapper = function(array) { - * return _.pluck(array, 'user'); - * }; - * - * // using the `_.matches` callback shorthand - * _.map(_.partition(users, { 'age': 1, 'active': false }), mapper); - * // => [['pebbles'], ['barney', 'fred']] - * - * // using the `_.matchesProperty` callback shorthand - * _.map(_.partition(users, 'active', false), mapper); - * // => [['barney', 'pebbles'], ['fred']] - * - * // using the `_.property` callback shorthand - * _.map(_.partition(users, 'active'), mapper); - * // => [['fred'], ['barney', 'pebbles']] - */ -var partition = createAggregator(function(result, value, key) { - result[key ? 0 : 1].push(value); -}, function() { return [[], []]; }); - -module.exports = partition; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/pluck.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/pluck.js deleted file mode 100644 index 5ee1ec84eec53f..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/pluck.js +++ /dev/null @@ -1,31 +0,0 @@ -var map = require('./map'), - property = require('../utility/property'); - -/** - * Gets the property value of `path` from all elements in `collection`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Array|string} path The path of the property to pluck. - * @returns {Array} Returns the property values. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * _.pluck(users, 'user'); - * // => ['barney', 'fred'] - * - * var userIndex = _.indexBy(users, 'user'); - * _.pluck(userIndex, 'age'); - * // => [36, 40] (iteration order is not guaranteed) - */ -function pluck(collection, path) { - return map(collection, property(path)); -} - -module.exports = pluck; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/reduce.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/reduce.js deleted file mode 100644 index da97655c198e47..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/reduce.js +++ /dev/null @@ -1,43 +0,0 @@ -var arrayReduce = require('../internal/arrayReduce'), - baseEach = require('../internal/baseEach'), - createReduce = require('../internal/createReduce'); - -/** - * Reduces `collection` to a value which is the accumulated result of running - * each element in `collection` through `iteratee`, where each successive - * invocation is supplied the return value of the previous. If `accumulator` - * is not provided the first element of `collection` is used as the initial - * value. The `iteratee` is bound to `thisArg` and invoked with four arguments: - * (accumulator, value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.reduce`, `_.reduceRight`, and `_.transform`. - * - * The guarded methods are: - * `assign`, `defaults`, `includes`, `merge`, `sortByAll`, and `sortByOrder` - * - * @static - * @memberOf _ - * @alias foldl, inject - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {*} Returns the accumulated value. - * @example - * - * _.reduce([1, 2], function(total, n) { - * return total + n; - * }); - * // => 3 - * - * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) { - * result[key] = n * 3; - * return result; - * }, {}); - * // => { 'a': 3, 'b': 6 } (iteration order is not guaranteed) - */ -var reduce = createReduce(arrayReduce, baseEach); - -module.exports = reduce; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/reduceRight.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/reduceRight.js deleted file mode 100644 index 5a5753b9c2185b..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/reduceRight.js +++ /dev/null @@ -1,29 +0,0 @@ -var arrayReduceRight = require('../internal/arrayReduceRight'), - baseEachRight = require('../internal/baseEachRight'), - createReduce = require('../internal/createReduce'); - -/** - * This method is like `_.reduce` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @alias foldr - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {*} Returns the accumulated value. - * @example - * - * var array = [[0, 1], [2, 3], [4, 5]]; - * - * _.reduceRight(array, function(flattened, other) { - * return flattened.concat(other); - * }, []); - * // => [4, 5, 2, 3, 0, 1] - */ -var reduceRight = createReduce(arrayReduceRight, baseEachRight); - -module.exports = reduceRight; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/reject.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/reject.js deleted file mode 100644 index 55924539b524be..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/reject.js +++ /dev/null @@ -1,50 +0,0 @@ -var arrayFilter = require('../internal/arrayFilter'), - baseCallback = require('../internal/baseCallback'), - baseFilter = require('../internal/baseFilter'), - isArray = require('../lang/isArray'); - -/** - * The opposite of `_.filter`; this method returns the elements of `collection` - * that `predicate` does **not** return truthy for. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the new filtered array. - * @example - * - * _.reject([1, 2, 3, 4], function(n) { - * return n % 2 == 0; - * }); - * // => [1, 3] - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.reject(users, { 'age': 40, 'active': true }), 'user'); - * // => ['barney'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.reject(users, 'active', false), 'user'); - * // => ['fred'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.reject(users, 'active'), 'user'); - * // => ['barney'] - */ -function reject(collection, predicate, thisArg) { - var func = isArray(collection) ? arrayFilter : baseFilter; - predicate = baseCallback(predicate, thisArg, 3); - return func(collection, function(value, index, collection) { - return !predicate(value, index, collection); - }); -} - -module.exports = reject; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/sample.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/sample.js deleted file mode 100644 index 8e0153301620e1..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/sample.js +++ /dev/null @@ -1,50 +0,0 @@ -var baseRandom = require('../internal/baseRandom'), - isIterateeCall = require('../internal/isIterateeCall'), - toArray = require('../lang/toArray'), - toIterable = require('../internal/toIterable'); - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMin = Math.min; - -/** - * Gets a random element or `n` random elements from a collection. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to sample. - * @param {number} [n] The number of elements to sample. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {*} Returns the random sample(s). - * @example - * - * _.sample([1, 2, 3, 4]); - * // => 2 - * - * _.sample([1, 2, 3, 4], 2); - * // => [3, 1] - */ -function sample(collection, n, guard) { - if (guard ? isIterateeCall(collection, n, guard) : n == null) { - collection = toIterable(collection); - var length = collection.length; - return length > 0 ? collection[baseRandom(0, length - 1)] : undefined; - } - var index = -1, - result = toArray(collection), - length = result.length, - lastIndex = length - 1; - - n = nativeMin(n < 0 ? 0 : (+n || 0), length); - while (++index < n) { - var rand = baseRandom(index, lastIndex), - value = result[rand]; - - result[rand] = result[index]; - result[index] = value; - } - result.length = n; - return result; -} - -module.exports = sample; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/select.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/select.js deleted file mode 100644 index ade80f6fbae9ae..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/select.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./filter'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/shuffle.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/shuffle.js deleted file mode 100644 index 949689c5fc714d..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/shuffle.js +++ /dev/null @@ -1,24 +0,0 @@ -var sample = require('./sample'); - -/** Used as references for `-Infinity` and `Infinity`. */ -var POSITIVE_INFINITY = Number.POSITIVE_INFINITY; - -/** - * Creates an array of shuffled values, using a version of the - * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to shuffle. - * @returns {Array} Returns the new shuffled array. - * @example - * - * _.shuffle([1, 2, 3, 4]); - * // => [4, 1, 3, 2] - */ -function shuffle(collection) { - return sample(collection, POSITIVE_INFINITY); -} - -module.exports = shuffle; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/size.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/size.js deleted file mode 100644 index 78dcf4ce9bea5e..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/size.js +++ /dev/null @@ -1,30 +0,0 @@ -var getLength = require('../internal/getLength'), - isLength = require('../internal/isLength'), - keys = require('../object/keys'); - -/** - * Gets the size of `collection` by returning its length for array-like - * values or the number of own enumerable properties for objects. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to inspect. - * @returns {number} Returns the size of `collection`. - * @example - * - * _.size([1, 2, 3]); - * // => 3 - * - * _.size({ 'a': 1, 'b': 2 }); - * // => 2 - * - * _.size('pebbles'); - * // => 7 - */ -function size(collection) { - var length = collection ? getLength(collection) : 0; - return isLength(length) ? length : keys(collection).length; -} - -module.exports = size; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/some.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/some.js deleted file mode 100644 index 2b866b464b6552..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/some.js +++ /dev/null @@ -1,67 +0,0 @@ -var arraySome = require('../internal/arraySome'), - baseCallback = require('../internal/baseCallback'), - baseSome = require('../internal/baseSome'), - isArray = require('../lang/isArray'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Checks if `predicate` returns truthy for **any** element of `collection`. - * The function returns as soon as it finds a passing value and does not iterate - * over the entire collection. The predicate is bound to `thisArg` and invoked - * with three arguments: (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias any - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - * @example - * - * _.some([null, 0, 'yes', false], Boolean); - * // => true - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.some(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // using the `_.matchesProperty` callback shorthand - * _.some(users, 'active', false); - * // => true - * - * // using the `_.property` callback shorthand - * _.some(users, 'active'); - * // => true - */ -function some(collection, predicate, thisArg) { - var func = isArray(collection) ? arraySome : baseSome; - if (thisArg && isIterateeCall(collection, predicate, thisArg)) { - predicate = null; - } - if (typeof predicate != 'function' || thisArg !== undefined) { - predicate = baseCallback(predicate, thisArg, 3); - } - return func(collection, predicate); -} - -module.exports = some; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/sortBy.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/sortBy.js deleted file mode 100644 index 28d75f56dacce9..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/sortBy.js +++ /dev/null @@ -1,71 +0,0 @@ -var baseCallback = require('../internal/baseCallback'), - baseMap = require('../internal/baseMap'), - baseSortBy = require('../internal/baseSortBy'), - compareAscending = require('../internal/compareAscending'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through `iteratee`. This method performs - * a stable sort, that is, it preserves the original sort order of equal elements. - * The `iteratee` is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new sorted array. - * @example - * - * _.sortBy([1, 2, 3], function(n) { - * return Math.sin(n); - * }); - * // => [3, 1, 2] - * - * _.sortBy([1, 2, 3], function(n) { - * return this.sin(n); - * }, Math); - * // => [3, 1, 2] - * - * var users = [ - * { 'user': 'fred' }, - * { 'user': 'pebbles' }, - * { 'user': 'barney' } - * ]; - * - * // using the `_.property` callback shorthand - * _.pluck(_.sortBy(users, 'user'), 'user'); - * // => ['barney', 'fred', 'pebbles'] - */ -function sortBy(collection, iteratee, thisArg) { - if (collection == null) { - return []; - } - if (thisArg && isIterateeCall(collection, iteratee, thisArg)) { - iteratee = null; - } - var index = -1; - iteratee = baseCallback(iteratee, thisArg, 3); - - var result = baseMap(collection, function(value, key, collection) { - return { 'criteria': iteratee(value, key, collection), 'index': ++index, 'value': value }; - }); - return baseSortBy(result, compareAscending); -} - -module.exports = sortBy; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/sortByAll.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/sortByAll.js deleted file mode 100644 index 4766c209855c97..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/sortByAll.js +++ /dev/null @@ -1,52 +0,0 @@ -var baseFlatten = require('../internal/baseFlatten'), - baseSortByOrder = require('../internal/baseSortByOrder'), - isIterateeCall = require('../internal/isIterateeCall'), - restParam = require('../function/restParam'); - -/** - * This method is like `_.sortBy` except that it can sort by multiple iteratees - * or property names. - * - * If a property name is provided for an iteratee the created `_.property` - * style callback returns the property value of the given element. - * - * If an object is provided for an iteratee the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {...(Function|Function[]|Object|Object[]|string|string[])} iteratees - * The iteratees to sort by, specified as individual values or arrays of values. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.map(_.sortByAll(users, ['user', 'age']), _.values); - * // => [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] - * - * _.map(_.sortByAll(users, 'user', function(chr) { - * return Math.floor(chr.age / 10); - * }), _.values); - * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ -var sortByAll = restParam(function(collection, iteratees) { - if (collection == null) { - return []; - } - var guard = iteratees[2]; - if (guard && isIterateeCall(iteratees[0], iteratees[1], guard)) { - iteratees.length = 1; - } - return baseSortByOrder(collection, baseFlatten(iteratees), []); -}); - -module.exports = sortByAll; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/sortByOrder.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/sortByOrder.js deleted file mode 100644 index c704eeb61f201b..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/sortByOrder.js +++ /dev/null @@ -1,55 +0,0 @@ -var baseSortByOrder = require('../internal/baseSortByOrder'), - isArray = require('../lang/isArray'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** - * This method is like `_.sortByAll` except that it allows specifying the - * sort orders of the iteratees to sort by. A truthy value in `orders` will - * sort the corresponding property name in ascending order while a falsey - * value will sort it in descending order. - * - * If a property name is provided for an iteratee the created `_.property` - * style callback returns the property value of the given element. - * - * If an object is provided for an iteratee the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. - * @param {boolean[]} orders The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.map(_.sortByOrder(users, ['user', 'age'], [true, false]), _.values); - * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ -function sortByOrder(collection, iteratees, orders, guard) { - if (collection == null) { - return []; - } - if (guard && isIterateeCall(iteratees, orders, guard)) { - orders = null; - } - if (!isArray(iteratees)) { - iteratees = iteratees == null ? [] : [iteratees]; - } - if (!isArray(orders)) { - orders = orders == null ? [] : [orders]; - } - return baseSortByOrder(collection, iteratees, orders); -} - -module.exports = sortByOrder; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/sum.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/sum.js deleted file mode 100644 index a2e93808ae8fee..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/sum.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../math/sum'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/where.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/where.js deleted file mode 100644 index f603bf8ce497a6..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/where.js +++ /dev/null @@ -1,37 +0,0 @@ -var baseMatches = require('../internal/baseMatches'), - filter = require('./filter'); - -/** - * Performs a deep comparison between each element in `collection` and the - * source object, returning an array of all elements that have equivalent - * property values. - * - * **Note:** This method supports comparing arrays, booleans, `Date` objects, - * numbers, `Object` objects, regexes, and strings. Objects are compared by - * their own, not inherited, enumerable properties. For comparing a single - * own or inherited property value see `_.matchesProperty`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Object} source The object of property values to match. - * @returns {Array} Returns the new filtered array. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false, 'pets': ['hoppy'] }, - * { 'user': 'fred', 'age': 40, 'active': true, 'pets': ['baby puss', 'dino'] } - * ]; - * - * _.pluck(_.where(users, { 'age': 36, 'active': false }), 'user'); - * // => ['barney'] - * - * _.pluck(_.where(users, { 'pets': ['dino'] }), 'user'); - * // => ['fred'] - */ -function where(collection, source) { - return filter(collection, baseMatches(source)); -} - -module.exports = where; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/date.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/date.js deleted file mode 100644 index 195366e77762af..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/date.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - 'now': require('./date/now') -}; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/date/now.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/date/now.js deleted file mode 100644 index ffe3060e5b9aa3..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/date/now.js +++ /dev/null @@ -1,24 +0,0 @@ -var getNative = require('../internal/getNative'); - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeNow = getNative(Date, 'now'); - -/** - * Gets the number of milliseconds that have elapsed since the Unix epoch - * (1 January 1970 00:00:00 UTC). - * - * @static - * @memberOf _ - * @category Date - * @example - * - * _.defer(function(stamp) { - * console.log(_.now() - stamp); - * }, _.now()); - * // => logs the number of milliseconds it took for the deferred function to be invoked - */ -var now = nativeNow || function() { - return new Date().getTime(); -}; - -module.exports = now; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function.js deleted file mode 100644 index 2cacde1ee59e36..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function.js +++ /dev/null @@ -1,27 +0,0 @@ -module.exports = { - 'after': require('./function/after'), - 'ary': require('./function/ary'), - 'backflow': require('./function/backflow'), - 'before': require('./function/before'), - 'bind': require('./function/bind'), - 'bindAll': require('./function/bindAll'), - 'bindKey': require('./function/bindKey'), - 'compose': require('./function/compose'), - 'curry': require('./function/curry'), - 'curryRight': require('./function/curryRight'), - 'debounce': require('./function/debounce'), - 'defer': require('./function/defer'), - 'delay': require('./function/delay'), - 'flow': require('./function/flow'), - 'flowRight': require('./function/flowRight'), - 'memoize': require('./function/memoize'), - 'negate': require('./function/negate'), - 'once': require('./function/once'), - 'partial': require('./function/partial'), - 'partialRight': require('./function/partialRight'), - 'rearg': require('./function/rearg'), - 'restParam': require('./function/restParam'), - 'spread': require('./function/spread'), - 'throttle': require('./function/throttle'), - 'wrap': require('./function/wrap') -}; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/after.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/after.js deleted file mode 100644 index e6a5de407a75df..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/after.js +++ /dev/null @@ -1,48 +0,0 @@ -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeIsFinite = global.isFinite; - -/** - * The opposite of `_.before`; this method creates a function that invokes - * `func` once it is called `n` or more times. - * - * @static - * @memberOf _ - * @category Function - * @param {number} n The number of calls before `func` is invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var saves = ['profile', 'settings']; - * - * var done = _.after(saves.length, function() { - * console.log('done saving!'); - * }); - * - * _.forEach(saves, function(type) { - * asyncSave({ 'type': type, 'complete': done }); - * }); - * // => logs 'done saving!' after the two async saves have completed - */ -function after(n, func) { - if (typeof func != 'function') { - if (typeof n == 'function') { - var temp = n; - n = func; - func = temp; - } else { - throw new TypeError(FUNC_ERROR_TEXT); - } - } - n = nativeIsFinite(n = +n) ? n : 0; - return function() { - if (--n < 1) { - return func.apply(this, arguments); - } - }; -} - -module.exports = after; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/ary.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/ary.js deleted file mode 100644 index 1bcb6a720d3904..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/ary.js +++ /dev/null @@ -1,34 +0,0 @@ -var createWrapper = require('../internal/createWrapper'), - isIterateeCall = require('../internal/isIterateeCall'); - -/** Used to compose bitmasks for wrapper metadata. */ -var ARY_FLAG = 128; - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Creates a function that accepts up to `n` arguments ignoring any - * additional arguments. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to cap arguments for. - * @param {number} [n=func.length] The arity cap. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Function} Returns the new function. - * @example - * - * _.map(['6', '8', '10'], _.ary(parseInt, 1)); - * // => [6, 8, 10] - */ -function ary(func, n, guard) { - if (guard && isIterateeCall(func, n, guard)) { - n = null; - } - n = (func && n == null) ? func.length : nativeMax(+n || 0, 0); - return createWrapper(func, ARY_FLAG, null, null, null, null, n); -} - -module.exports = ary; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/backflow.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/backflow.js deleted file mode 100644 index 1954e942397b7f..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/backflow.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./flowRight'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/before.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/before.js deleted file mode 100644 index 4afd1e60af1298..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/before.js +++ /dev/null @@ -1,42 +0,0 @@ -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * Creates a function that invokes `func`, with the `this` binding and arguments - * of the created function, while it is called less than `n` times. Subsequent - * calls to the created function return the result of the last `func` invocation. - * - * @static - * @memberOf _ - * @category Function - * @param {number} n The number of calls at which `func` is no longer invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * jQuery('#add').on('click', _.before(5, addContactToList)); - * // => allows adding up to 4 contacts to the list - */ -function before(n, func) { - var result; - if (typeof func != 'function') { - if (typeof n == 'function') { - var temp = n; - n = func; - func = temp; - } else { - throw new TypeError(FUNC_ERROR_TEXT); - } - } - return function() { - if (--n > 0) { - result = func.apply(this, arguments); - } - if (n <= 1) { - func = null; - } - return result; - }; -} - -module.exports = before; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/bind.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/bind.js deleted file mode 100644 index 0de126ae359412..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/bind.js +++ /dev/null @@ -1,56 +0,0 @@ -var createWrapper = require('../internal/createWrapper'), - replaceHolders = require('../internal/replaceHolders'), - restParam = require('./restParam'); - -/** Used to compose bitmasks for wrapper metadata. */ -var BIND_FLAG = 1, - PARTIAL_FLAG = 32; - -/** - * Creates a function that invokes `func` with the `this` binding of `thisArg` - * and prepends any additional `_.bind` arguments to those provided to the - * bound function. - * - * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for partially applied arguments. - * - * **Note:** Unlike native `Function#bind` this method does not set the "length" - * property of bound functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to bind. - * @param {*} thisArg The `this` binding of `func`. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var greet = function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * }; - * - * var object = { 'user': 'fred' }; - * - * var bound = _.bind(greet, object, 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * // using placeholders - * var bound = _.bind(greet, object, _, '!'); - * bound('hi'); - * // => 'hi fred!' - */ -var bind = restParam(function(func, thisArg, partials) { - var bitmask = BIND_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, bind.placeholder); - bitmask |= PARTIAL_FLAG; - } - return createWrapper(func, bitmask, thisArg, partials, holders); -}); - -// Assign default placeholders. -bind.placeholder = {}; - -module.exports = bind; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/bindAll.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/bindAll.js deleted file mode 100644 index a09e948524875c..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/bindAll.js +++ /dev/null @@ -1,50 +0,0 @@ -var baseFlatten = require('../internal/baseFlatten'), - createWrapper = require('../internal/createWrapper'), - functions = require('../object/functions'), - restParam = require('./restParam'); - -/** Used to compose bitmasks for wrapper metadata. */ -var BIND_FLAG = 1; - -/** - * Binds methods of an object to the object itself, overwriting the existing - * method. Method names may be specified as individual arguments or as arrays - * of method names. If no method names are provided all enumerable function - * properties, own and inherited, of `object` are bound. - * - * **Note:** This method does not set the "length" property of bound functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Object} object The object to bind and assign the bound methods to. - * @param {...(string|string[])} [methodNames] The object method names to bind, - * specified as individual method names or arrays of method names. - * @returns {Object} Returns `object`. - * @example - * - * var view = { - * 'label': 'docs', - * 'onClick': function() { - * console.log('clicked ' + this.label); - * } - * }; - * - * _.bindAll(view); - * jQuery('#docs').on('click', view.onClick); - * // => logs 'clicked docs' when the element is clicked - */ -var bindAll = restParam(function(object, methodNames) { - methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object); - - var index = -1, - length = methodNames.length; - - while (++index < length) { - var key = methodNames[index]; - object[key] = createWrapper(object[key], BIND_FLAG, object); - } - return object; -}); - -module.exports = bindAll; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/bindKey.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/bindKey.js deleted file mode 100644 index b787fe702276c6..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/bindKey.js +++ /dev/null @@ -1,66 +0,0 @@ -var createWrapper = require('../internal/createWrapper'), - replaceHolders = require('../internal/replaceHolders'), - restParam = require('./restParam'); - -/** Used to compose bitmasks for wrapper metadata. */ -var BIND_FLAG = 1, - BIND_KEY_FLAG = 2, - PARTIAL_FLAG = 32; - -/** - * Creates a function that invokes the method at `object[key]` and prepends - * any additional `_.bindKey` arguments to those provided to the bound function. - * - * This method differs from `_.bind` by allowing bound functions to reference - * methods that may be redefined or don't yet exist. - * See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) - * for more details. - * - * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * @static - * @memberOf _ - * @category Function - * @param {Object} object The object the method belongs to. - * @param {string} key The key of the method. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var object = { - * 'user': 'fred', - * 'greet': function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * } - * }; - * - * var bound = _.bindKey(object, 'greet', 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * object.greet = function(greeting, punctuation) { - * return greeting + 'ya ' + this.user + punctuation; - * }; - * - * bound('!'); - * // => 'hiya fred!' - * - * // using placeholders - * var bound = _.bindKey(object, 'greet', _, '!'); - * bound('hi'); - * // => 'hiya fred!' - */ -var bindKey = restParam(function(object, key, partials) { - var bitmask = BIND_FLAG | BIND_KEY_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, bindKey.placeholder); - bitmask |= PARTIAL_FLAG; - } - return createWrapper(key, bitmask, object, partials, holders); -}); - -// Assign default placeholders. -bindKey.placeholder = {}; - -module.exports = bindKey; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/compose.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/compose.js deleted file mode 100644 index 1954e942397b7f..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/compose.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./flowRight'); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/curry.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/curry.js deleted file mode 100644 index b7db3fdad8ab6e..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/curry.js +++ /dev/null @@ -1,51 +0,0 @@ -var createCurry = require('../internal/createCurry'); - -/** Used to compose bitmasks for wrapper metadata. */ -var CURRY_FLAG = 8; - -/** - * Creates a function that accepts one or more arguments of `func` that when - * called either invokes `func` returning its result, if all `func` arguments - * have been provided, or returns a function that accepts one or more of the - * remaining `func` arguments, and so on. The arity of `func` may be specified - * if `func.length` is not sufficient. - * - * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for provided arguments. - * - * **Note:** This method does not set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curry(abc); - * - * curried(1)(2)(3); - * // => [1, 2, 3] - * - * curried(1, 2)(3); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // using placeholders - * curried(1)(_, 3)(2); - * // => [1, 2, 3] - */ -var curry = createCurry(CURRY_FLAG); - -// Assign default placeholders. -curry.placeholder = {}; - -module.exports = curry; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/curryRight.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/curryRight.js deleted file mode 100644 index 11c540393b399f..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/curryRight.js +++ /dev/null @@ -1,48 +0,0 @@ -var createCurry = require('../internal/createCurry'); - -/** Used to compose bitmasks for wrapper metadata. */ -var CURRY_RIGHT_FLAG = 16; - -/** - * This method is like `_.curry` except that arguments are applied to `func` - * in the manner of `_.partialRight` instead of `_.partial`. - * - * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for provided arguments. - * - * **Note:** This method does not set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curryRight(abc); - * - * curried(3)(2)(1); - * // => [1, 2, 3] - * - * curried(2, 3)(1); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // using placeholders - * curried(3)(1, _)(2); - * // => [1, 2, 3] - */ -var curryRight = createCurry(CURRY_RIGHT_FLAG); - -// Assign default placeholders. -curryRight.placeholder = {}; - -module.exports = curryRight; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/debounce.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/debounce.js deleted file mode 100644 index 5df81e71a6059f..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/debounce.js +++ /dev/null @@ -1,187 +0,0 @@ -var isObject = require('../lang/isObject'), - now = require('../date/now'); - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Creates a debounced function that delays invoking `func` until after `wait` - * milliseconds have elapsed since the last time the debounced function was - * invoked. The debounced function comes with a `cancel` method to cancel - * delayed invocations. Provide an options object to indicate that `func` - * should be invoked on the leading and/or trailing edge of the `wait` timeout. - * Subsequent calls to the debounced function return the result of the last - * `func` invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked - * on the trailing edge of the timeout only if the the debounced function is - * invoked more than once during the `wait` timeout. - * - * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) - * for details over the differences between `_.debounce` and `_.throttle`. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to debounce. - * @param {number} [wait=0] The number of milliseconds to delay. - * @param {Object} [options] The options object. - * @param {boolean} [options.leading=false] Specify invoking on the leading - * edge of the timeout. - * @param {number} [options.maxWait] The maximum time `func` is allowed to be - * delayed before it is invoked. - * @param {boolean} [options.trailing=true] Specify invoking on the trailing - * edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * // avoid costly calculations while the window size is in flux - * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); - * - * // invoke `sendMail` when the click event is fired, debouncing subsequent calls - * jQuery('#postbox').on('click', _.debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })); - * - * // ensure `batchLog` is invoked once after 1 second of debounced calls - * var source = new EventSource('/stream'); - * jQuery(source).on('message', _.debounce(batchLog, 250, { - * 'maxWait': 1000 - * })); - * - * // cancel a debounced call - * var todoChanges = _.debounce(batchLog, 1000); - * Object.observe(models.todo, todoChanges); - * - * Object.observe(models, function(changes) { - * if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) { - * todoChanges.cancel(); - * } - * }, ['delete']); - * - * // ...at some point `models.todo` is changed - * models.todo.completed = true; - * - * // ...before 1 second has passed `models.todo` is deleted - * // which cancels the debounced `todoChanges` call - * delete models.todo; - */ -function debounce(func, wait, options) { - var args, - maxTimeoutId, - result, - stamp, - thisArg, - timeoutId, - trailingCall, - lastCalled = 0, - maxWait = false, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - wait = wait < 0 ? 0 : (+wait || 0); - if (options === true) { - var leading = true; - trailing = false; - } else if (isObject(options)) { - leading = options.leading; - maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait); - trailing = 'trailing' in options ? options.trailing : trailing; - } - - function cancel() { - if (timeoutId) { - clearTimeout(timeoutId); - } - if (maxTimeoutId) { - clearTimeout(maxTimeoutId); - } - maxTimeoutId = timeoutId = trailingCall = undefined; - } - - function delayed() { - var remaining = wait - (now() - stamp); - if (remaining <= 0 || remaining > wait) { - if (maxTimeoutId) { - clearTimeout(maxTimeoutId); - } - var isCalled = trailingCall; - maxTimeoutId = timeoutId = trailingCall = undefined; - if (isCalled) { - lastCalled = now(); - result = func.apply(thisArg, args); - if (!timeoutId && !maxTimeoutId) { - args = thisArg = null; - } - } - } else { - timeoutId = setTimeout(delayed, remaining); - } - } - - function maxDelayed() { - if (timeoutId) { - clearTimeout(timeoutId); - } - maxTimeoutId = timeoutId = trailingCall = undefined; - if (trailing || (maxWait !== wait)) { - lastCalled = now(); - result = func.apply(thisArg, args); - if (!timeoutId && !maxTimeoutId) { - args = thisArg = null; - } - } - } - - function debounced() { - args = arguments; - stamp = now(); - thisArg = this; - trailingCall = trailing && (timeoutId || !leading); - - if (maxWait === false) { - var leadingCall = leading && !timeoutId; - } else { - if (!maxTimeoutId && !leading) { - lastCalled = stamp; - } - var remaining = maxWait - (stamp - lastCalled), - isCalled = remaining <= 0 || remaining > maxWait; - - if (isCalled) { - if (maxTimeoutId) { - maxTimeoutId = clearTimeout(maxTimeoutId); - } - lastCalled = stamp; - result = func.apply(thisArg, args); - } - else if (!maxTimeoutId) { - maxTimeoutId = setTimeout(maxDelayed, remaining); - } - } - if (isCalled && timeoutId) { - timeoutId = clearTimeout(timeoutId); - } - else if (!timeoutId && wait !== maxWait) { - timeoutId = setTimeout(delayed, wait); - } - if (leadingCall) { - isCalled = true; - result = func.apply(thisArg, args); - } - if (isCalled && !timeoutId && !maxTimeoutId) { - args = thisArg = null; - } - return result; - } - debounced.cancel = cancel; - return debounced; -} - -module.exports = debounce; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/defer.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/defer.js deleted file mode 100644 index 369790ce64fcc6..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/defer.js +++ /dev/null @@ -1,25 +0,0 @@ -var baseDelay = require('../internal/baseDelay'), - restParam = require('./restParam'); - -/** - * Defers invoking the `func` until the current call stack has cleared. Any - * additional arguments are provided to `func` when it is invoked. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to defer. - * @param {...*} [args] The arguments to invoke the function with. - * @returns {number} Returns the timer id. - * @example - * - * _.defer(function(text) { - * console.log(text); - * }, 'deferred'); - * // logs 'deferred' after one or more milliseconds - */ -var defer = restParam(function(func, args) { - return baseDelay(func, 1, args); -}); - -module.exports = defer; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/delay.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/delay.js deleted file mode 100644 index 955b059e7fa2cf..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/delay.js +++ /dev/null @@ -1,26 +0,0 @@ -var baseDelay = require('../internal/baseDelay'), - restParam = require('./restParam'); - -/** - * Invokes `func` after `wait` milliseconds. Any additional arguments are - * provided to `func` when it is invoked. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {...*} [args] The arguments to invoke the function with. - * @returns {number} Returns the timer id. - * @example - * - * _.delay(function(text) { - * console.log(text); - * }, 1000, 'later'); - * // => logs 'later' after one second - */ -var delay = restParam(function(func, wait, args) { - return baseDelay(func, wait, args); -}); - -module.exports = delay; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/flow.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/flow.js deleted file mode 100644 index a435a3d878ff48..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/flow.js +++ /dev/null @@ -1,25 +0,0 @@ -var createFlow = require('../internal/createFlow'); - -/** - * Creates a function that returns the result of invoking the provided - * functions with the `this` binding of the created function, where each - * successive invocation is supplied the return value of the previous. - * - * @static - * @memberOf _ - * @category Function - * @param {...Function} [funcs] Functions to invoke. - * @returns {Function} Returns the new function. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var addSquare = _.flow(_.add, square); - * addSquare(1, 2); - * // => 9 - */ -var flow = createFlow(); - -module.exports = flow; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/flowRight.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/flowRight.js deleted file mode 100644 index 23b9d76b58e8f5..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/flowRight.js +++ /dev/null @@ -1,25 +0,0 @@ -var createFlow = require('../internal/createFlow'); - -/** - * This method is like `_.flow` except that it creates a function that - * invokes the provided functions from right to left. - * - * @static - * @memberOf _ - * @alias backflow, compose - * @category Function - * @param {...Function} [funcs] Functions to invoke. - * @returns {Function} Returns the new function. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var addSquare = _.flowRight(square, _.add); - * addSquare(1, 2); - * // => 9 - */ -var flowRight = createFlow(true); - -module.exports = flowRight; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/memoize.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/memoize.js deleted file mode 100644 index 1088e4be656113..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/memoize.js +++ /dev/null @@ -1,80 +0,0 @@ -var MapCache = require('../internal/MapCache'); - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is coerced to a string and used as the - * cache key. The `func` is invoked with the `this` binding of the memoized - * function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the [`Map`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-properties-of-the-map-prototype-object) - * method interface of `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoizing function. - * @example - * - * var upperCase = _.memoize(function(string) { - * return string.toUpperCase(); - * }); - * - * upperCase('fred'); - * // => 'FRED' - * - * // modifying the result cache - * upperCase.cache.set('fred', 'BARNEY'); - * upperCase('fred'); - * // => 'BARNEY' - * - * // replacing `_.memoize.Cache` - * var object = { 'user': 'fred' }; - * var other = { 'user': 'barney' }; - * var identity = _.memoize(_.identity); - * - * identity(object); - * // => { 'user': 'fred' } - * identity(other); - * // => { 'user': 'fred' } - * - * _.memoize.Cache = WeakMap; - * var identity = _.memoize(_.identity); - * - * identity(object); - * // => { 'user': 'fred' } - * identity(other); - * // => { 'user': 'barney' } - */ -function memoize(func, resolver) { - if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; - - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result); - return result; - }; - memoized.cache = new memoize.Cache; - return memoized; -} - -// Assign cache to `_.memoize`. -memoize.Cache = MapCache; - -module.exports = memoize; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/negate.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/negate.js deleted file mode 100644 index 82479390ad7802..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/negate.js +++ /dev/null @@ -1,32 +0,0 @@ -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * Creates a function that negates the result of the predicate `func`. The - * `func` predicate is invoked with the `this` binding and arguments of the - * created function. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} predicate The predicate to negate. - * @returns {Function} Returns the new function. - * @example - * - * function isEven(n) { - * return n % 2 == 0; - * } - * - * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); - * // => [1, 3, 5] - */ -function negate(predicate) { - if (typeof predicate != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function() { - return !predicate.apply(this, arguments); - }; -} - -module.exports = negate; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/once.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/once.js deleted file mode 100644 index 0b5bd853cb492b..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/once.js +++ /dev/null @@ -1,24 +0,0 @@ -var before = require('./before'); - -/** - * Creates a function that is restricted to invoking `func` once. Repeat calls - * to the function return the value of the first call. The `func` is invoked - * with the `this` binding and arguments of the created function. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var initialize = _.once(createApplication); - * initialize(); - * initialize(); - * // `initialize` invokes `createApplication` once - */ -function once(func) { - return before(2, func); -} - -module.exports = once; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/partial.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/partial.js deleted file mode 100644 index fb1d04fb6c5928..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/partial.js +++ /dev/null @@ -1,43 +0,0 @@ -var createPartial = require('../internal/createPartial'); - -/** Used to compose bitmasks for wrapper metadata. */ -var PARTIAL_FLAG = 32; - -/** - * Creates a function that invokes `func` with `partial` arguments prepended - * to those provided to the new function. This method is like `_.bind` except - * it does **not** alter the `this` binding. - * - * The `_.partial.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method does not set the "length" property of partially - * applied functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * var greet = function(greeting, name) { - * return greeting + ' ' + name; - * }; - * - * var sayHelloTo = _.partial(greet, 'hello'); - * sayHelloTo('fred'); - * // => 'hello fred' - * - * // using placeholders - * var greetFred = _.partial(greet, _, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - */ -var partial = createPartial(PARTIAL_FLAG); - -// Assign default placeholders. -partial.placeholder = {}; - -module.exports = partial; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/partialRight.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/partialRight.js deleted file mode 100644 index 634e6a4c40cffa..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/partialRight.js +++ /dev/null @@ -1,42 +0,0 @@ -var createPartial = require('../internal/createPartial'); - -/** Used to compose bitmasks for wrapper metadata. */ -var PARTIAL_RIGHT_FLAG = 64; - -/** - * This method is like `_.partial` except that partially applied arguments - * are appended to those provided to the new function. - * - * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method does not set the "length" property of partially - * applied functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * var greet = function(greeting, name) { - * return greeting + ' ' + name; - * }; - * - * var greetFred = _.partialRight(greet, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - * - * // using placeholders - * var sayHelloTo = _.partialRight(greet, 'hello', _); - * sayHelloTo('fred'); - * // => 'hello fred' - */ -var partialRight = createPartial(PARTIAL_RIGHT_FLAG); - -// Assign default placeholders. -partialRight.placeholder = {}; - -module.exports = partialRight; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/rearg.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/rearg.js deleted file mode 100644 index 0a4bf8fa6d65ed..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/rearg.js +++ /dev/null @@ -1,40 +0,0 @@ -var baseFlatten = require('../internal/baseFlatten'), - createWrapper = require('../internal/createWrapper'), - restParam = require('./restParam'); - -/** Used to compose bitmasks for wrapper metadata. */ -var REARG_FLAG = 256; - -/** - * Creates a function that invokes `func` with arguments arranged according - * to the specified indexes where the argument value at the first index is - * provided as the first argument, the argument value at the second index is - * provided as the second argument, and so on. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to rearrange arguments for. - * @param {...(number|number[])} indexes The arranged argument indexes, - * specified as individual indexes or arrays of indexes. - * @returns {Function} Returns the new function. - * @example - * - * var rearged = _.rearg(function(a, b, c) { - * return [a, b, c]; - * }, 2, 0, 1); - * - * rearged('b', 'c', 'a') - * // => ['a', 'b', 'c'] - * - * var map = _.rearg(_.map, [1, 0]); - * map(function(n) { - * return n * 3; - * }, [1, 2, 3]); - * // => [3, 6, 9] - */ -var rearg = restParam(function(func, indexes) { - return createWrapper(func, REARG_FLAG, null, null, null, baseFlatten(indexes)); -}); - -module.exports = rearg; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/restParam.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/restParam.js deleted file mode 100644 index 3a1c15707c748a..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/restParam.js +++ /dev/null @@ -1,58 +0,0 @@ -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/* Native method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as an array. - * - * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters). - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.restParam(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); - * }); - * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' - */ -function restParam(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - rest = Array(length); - - while (++index < length) { - rest[index] = args[start + index]; - } - switch (start) { - case 0: return func.call(this, rest); - case 1: return func.call(this, args[0], rest); - case 2: return func.call(this, args[0], args[1], rest); - } - var otherArgs = Array(start + 1); - index = -1; - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = rest; - return func.apply(this, otherArgs); - }; -} - -module.exports = restParam; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/spread.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/spread.js deleted file mode 100644 index aad4b7147f2350..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/spread.js +++ /dev/null @@ -1,44 +0,0 @@ -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** - * Creates a function that invokes `func` with the `this` binding of the created - * function and an array of arguments much like [`Function#apply`](https://es5.github.io/#x15.3.4.3). - * - * **Note:** This method is based on the [spread operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator). - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to spread arguments over. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.spread(function(who, what) { - * return who + ' says ' + what; - * }); - * - * say(['fred', 'hello']); - * // => 'fred says hello' - * - * // with a Promise - * var numbers = Promise.all([ - * Promise.resolve(40), - * Promise.resolve(36) - * ]); - * - * numbers.then(_.spread(function(x, y) { - * return x + y; - * })); - * // => a Promise of 76 - */ -function spread(func) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function(array) { - return func.apply(this, array); - }; -} - -module.exports = spread; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/throttle.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/throttle.js deleted file mode 100644 index 5e8f0ef5611145..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/throttle.js +++ /dev/null @@ -1,72 +0,0 @@ -var debounce = require('./debounce'), - isObject = require('../lang/isObject'); - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** Used as an internal `_.debounce` options object by `_.throttle`. */ -var debounceOptions = { - 'leading': false, - 'maxWait': 0, - 'trailing': false -}; - -/** - * Creates a throttled function that only invokes `func` at most once per - * every `wait` milliseconds. The throttled function comes with a `cancel` - * method to cancel delayed invocations. Provide an options object to indicate - * that `func` should be invoked on the leading and/or trailing edge of the - * `wait` timeout. Subsequent calls to the throttled function return the - * result of the last `func` call. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked - * on the trailing edge of the timeout only if the the throttled function is - * invoked more than once during the `wait` timeout. - * - * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) - * for details over the differences between `_.throttle` and `_.debounce`. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to throttle. - * @param {number} [wait=0] The number of milliseconds to throttle invocations to. - * @param {Object} [options] The options object. - * @param {boolean} [options.leading=true] Specify invoking on the leading - * edge of the timeout. - * @param {boolean} [options.trailing=true] Specify invoking on the trailing - * edge of the timeout. - * @returns {Function} Returns the new throttled function. - * @example - * - * // avoid excessively updating the position while scrolling - * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); - * - * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes - * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, { - * 'trailing': false - * })); - * - * // cancel a trailing throttled call - * jQuery(window).on('popstate', throttled.cancel); - */ -function throttle(func, wait, options) { - var leading = true, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (options === false) { - leading = false; - } else if (isObject(options)) { - leading = 'leading' in options ? !!options.leading : leading; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - debounceOptions.leading = leading; - debounceOptions.maxWait = +wait; - debounceOptions.trailing = trailing; - return debounce(func, wait, debounceOptions); -} - -module.exports = throttle; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/wrap.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/wrap.js deleted file mode 100644 index 68b09af23862a4..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/function/wrap.js +++ /dev/null @@ -1,33 +0,0 @@ -var createWrapper = require('../internal/createWrapper'), - identity = require('../utility/identity'); - -/** Used to compose bitmasks for wrapper metadata. */ -var PARTIAL_FLAG = 32; - -/** - * Creates a function that provides `value` to the wrapper function as its - * first argument. Any additional arguments provided to the function are - * appended to those provided to the wrapper function. The wrapper is invoked - * with the `this` binding of the created function. - * - * @static - * @memberOf _ - * @category Function - * @param {*} value The value to wrap. - * @param {Function} wrapper The wrapper function. - * @returns {Function} Returns the new function. - * @example - * - * var p = _.wrap(_.escape, function(func, text) { - * return '

      ' + func(text) + '

      '; - * }); - * - * p('fred, barney, & pebbles'); - * // => '

      fred, barney, & pebbles

      ' - */ -function wrap(value, wrapper) { - wrapper = wrapper == null ? identity : wrapper; - return createWrapper(wrapper, PARTIAL_FLAG, null, [value], []); -} - -module.exports = wrap; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/index.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/index.js deleted file mode 100644 index deb66539d440b9..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/index.js +++ /dev/null @@ -1,12235 +0,0 @@ -/** - * @license - * lodash 3.9.3 (Custom Build) - * Build: `lodash modern -d -o ./index.js` - * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ -;(function() { - - /** Used as a safe reference for `undefined` in pre-ES5 environments. */ - var undefined; - - /** Used as the semantic version number. */ - var VERSION = '3.9.3'; - - /** Used to compose bitmasks for wrapper metadata. */ - var BIND_FLAG = 1, - BIND_KEY_FLAG = 2, - CURRY_BOUND_FLAG = 4, - CURRY_FLAG = 8, - CURRY_RIGHT_FLAG = 16, - PARTIAL_FLAG = 32, - PARTIAL_RIGHT_FLAG = 64, - ARY_FLAG = 128, - REARG_FLAG = 256; - - /** Used as default options for `_.trunc`. */ - var DEFAULT_TRUNC_LENGTH = 30, - DEFAULT_TRUNC_OMISSION = '...'; - - /** Used to detect when a function becomes hot. */ - var HOT_COUNT = 150, - HOT_SPAN = 16; - - /** Used to indicate the type of lazy iteratees. */ - var LAZY_DROP_WHILE_FLAG = 0, - LAZY_FILTER_FLAG = 1, - LAZY_MAP_FLAG = 2; - - /** Used as the `TypeError` message for "Functions" methods. */ - var FUNC_ERROR_TEXT = 'Expected a function'; - - /** Used as the internal argument placeholder. */ - var PLACEHOLDER = '__lodash_placeholder__'; - - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - weakMapTag = '[object WeakMap]'; - - var arrayBufferTag = '[object ArrayBuffer]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - - /** Used to match empty string literals in compiled template source. */ - var reEmptyStringLeading = /\b__p \+= '';/g, - reEmptyStringMiddle = /\b(__p \+=) '' \+/g, - reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; - - /** Used to match HTML entities and HTML characters. */ - var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g, - reUnescapedHtml = /[&<>"'`]/g, - reHasEscapedHtml = RegExp(reEscapedHtml.source), - reHasUnescapedHtml = RegExp(reUnescapedHtml.source); - - /** Used to match template delimiters. */ - var reEscape = /<%-([\s\S]+?)%>/g, - reEvaluate = /<%([\s\S]+?)%>/g, - reInterpolate = /<%=([\s\S]+?)%>/g; - - /** Used to match property names within property paths. */ - var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g; - - /** - * Used to match `RegExp` [special characters](http://www.regular-expressions.info/characters.html#special). - * In addition to special characters the forward slash is escaped to allow for - * easier `eval` use and `Function` compilation. - */ - var reRegExpChars = /[.*+?^${}()|[\]\/\\]/g, - reHasRegExpChars = RegExp(reRegExpChars.source); - - /** Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). */ - var reComboMark = /[\u0300-\u036f\ufe20-\ufe23]/g; - - /** Used to match backslashes in property paths. */ - var reEscapeChar = /\\(\\)?/g; - - /** Used to match [ES template delimiters](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-template-literal-lexical-components). */ - var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; - - /** Used to match `RegExp` flags from their coerced string values. */ - var reFlags = /\w*$/; - - /** Used to detect hexadecimal string values. */ - var reHasHexPrefix = /^0[xX]/; - - /** Used to detect host constructors (Safari > 5). */ - var reIsHostCtor = /^\[object .+?Constructor\]$/; - - /** Used to detect unsigned integer values. */ - var reIsUint = /^\d+$/; - - /** Used to match latin-1 supplementary letters (excluding mathematical operators). */ - var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g; - - /** Used to ensure capturing order of template delimiters. */ - var reNoMatch = /($^)/; - - /** Used to match unescaped characters in compiled string literals. */ - var reUnescapedString = /['\n\r\u2028\u2029\\]/g; - - /** Used to match words to create compound words. */ - var reWords = (function() { - var upper = '[A-Z\\xc0-\\xd6\\xd8-\\xde]', - lower = '[a-z\\xdf-\\xf6\\xf8-\\xff]+'; - - return RegExp(upper + '+(?=' + upper + lower + ')|' + upper + '?' + lower + '|' + upper + '+|[0-9]+', 'g'); - }()); - - /** Used to detect and test for whitespace. */ - var whitespace = ( - // Basic whitespace characters. - ' \t\x0b\f\xa0\ufeff' + - - // Line terminators. - '\n\r\u2028\u2029' + - - // Unicode category "Zs" space separators. - '\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000' - ); - - /** Used to assign default `context` object properties. */ - var contextProps = [ - 'Array', 'ArrayBuffer', 'Date', 'Error', 'Float32Array', 'Float64Array', - 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Math', 'Number', - 'Object', 'RegExp', 'Set', 'String', '_', 'clearTimeout', 'document', - 'isFinite', 'parseFloat', 'parseInt', 'setTimeout', 'TypeError', 'Uint8Array', - 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', 'window' - ]; - - /** Used to make template sourceURLs easier to identify. */ - var templateCounter = -1; - - /** Used to identify `toStringTag` values of typed arrays. */ - var typedArrayTags = {}; - typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = - typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = - typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = - typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = - typedArrayTags[uint32Tag] = true; - typedArrayTags[argsTag] = typedArrayTags[arrayTag] = - typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = - typedArrayTags[dateTag] = typedArrayTags[errorTag] = - typedArrayTags[funcTag] = typedArrayTags[mapTag] = - typedArrayTags[numberTag] = typedArrayTags[objectTag] = - typedArrayTags[regexpTag] = typedArrayTags[setTag] = - typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; - - /** Used to identify `toStringTag` values supported by `_.clone`. */ - var cloneableTags = {}; - cloneableTags[argsTag] = cloneableTags[arrayTag] = - cloneableTags[arrayBufferTag] = cloneableTags[boolTag] = - cloneableTags[dateTag] = cloneableTags[float32Tag] = - cloneableTags[float64Tag] = cloneableTags[int8Tag] = - cloneableTags[int16Tag] = cloneableTags[int32Tag] = - cloneableTags[numberTag] = cloneableTags[objectTag] = - cloneableTags[regexpTag] = cloneableTags[stringTag] = - cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = - cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; - cloneableTags[errorTag] = cloneableTags[funcTag] = - cloneableTags[mapTag] = cloneableTags[setTag] = - cloneableTags[weakMapTag] = false; - - /** Used as an internal `_.debounce` options object by `_.throttle`. */ - var debounceOptions = { - 'leading': false, - 'maxWait': 0, - 'trailing': false - }; - - /** Used to map latin-1 supplementary letters to basic latin letters. */ - var deburredLetters = { - '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', - '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', - '\xc7': 'C', '\xe7': 'c', - '\xd0': 'D', '\xf0': 'd', - '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', - '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', - '\xcC': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', - '\xeC': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', - '\xd1': 'N', '\xf1': 'n', - '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', - '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', - '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', - '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', - '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', - '\xc6': 'Ae', '\xe6': 'ae', - '\xde': 'Th', '\xfe': 'th', - '\xdf': 'ss' - }; - - /** Used to map characters to HTML entities. */ - var htmlEscapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' - }; - - /** Used to map HTML entities to characters. */ - var htmlUnescapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - ''': "'", - '`': '`' - }; - - /** Used to determine if values are of the language type `Object`. */ - var objectTypes = { - 'function': true, - 'object': true - }; - - /** Used to escape characters for inclusion in compiled string literals. */ - var stringEscapes = { - '\\': '\\', - "'": "'", - '\n': 'n', - '\r': 'r', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - /** Detect free variable `exports`. */ - var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports; - - /** Detect free variable `module`. */ - var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; - - /** Detect free variable `global` from Node.js. */ - var freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global; - - /** Detect free variable `self`. */ - var freeSelf = objectTypes[typeof self] && self && self.Object && self; - - /** Detect free variable `window`. */ - var freeWindow = objectTypes[typeof window] && window && window.Object && window; - - /** Detect the popular CommonJS extension `module.exports`. */ - var moduleExports = freeModule && freeModule.exports === freeExports && freeExports; - - /** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ - var root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this; - - /*--------------------------------------------------------------------------*/ - - /** - * The base implementation of `compareAscending` which compares values and - * sorts them in ascending order without guaranteeing a stable sort. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {number} Returns the sort order indicator for `value`. - */ - function baseCompareAscending(value, other) { - if (value !== other) { - var valIsNull = value === null, - valIsUndef = value === undefined, - valIsReflexive = value === value; - - var othIsNull = other === null, - othIsUndef = other === undefined, - othIsReflexive = other === other; - - if ((value > other && !othIsNull) || !valIsReflexive || - (valIsNull && !othIsUndef && othIsReflexive) || - (valIsUndef && othIsReflexive)) { - return 1; - } - if ((value < other && !valIsNull) || !othIsReflexive || - (othIsNull && !valIsUndef && valIsReflexive) || - (othIsUndef && valIsReflexive)) { - return -1; - } - } - return 0; - } - - /** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for callback shorthands and `this` binding. - * - * @private - * @param {Array} array The array to search. - * @param {Function} predicate The function invoked per iteration. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseFindIndex(array, predicate, fromRight) { - var length = array.length, - index = fromRight ? length : -1; - - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; - } - } - return -1; - } - - /** - * The base implementation of `_.indexOf` without support for binary searches. - * - * @private - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ - function baseIndexOf(array, value, fromIndex) { - if (value !== value) { - return indexOfNaN(array, fromIndex); - } - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; - } - - /** - * The base implementation of `_.isFunction` without support for environments - * with incorrect `typeof` results. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - */ - function baseIsFunction(value) { - // Avoid a Chakra JIT bug in compatibility modes of IE 11. - // See https://github.com/jashkenas/underscore/issues/1621 for more details. - return typeof value == 'function' || false; - } - - /** - * Converts `value` to a string if it's not one. An empty string is returned - * for `null` or `undefined` values. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ - function baseToString(value) { - if (typeof value == 'string') { - return value; - } - return value == null ? '' : (value + ''); - } - - /** - * Used by `_.trim` and `_.trimLeft` to get the index of the first character - * of `string` that is not found in `chars`. - * - * @private - * @param {string} string The string to inspect. - * @param {string} chars The characters to find. - * @returns {number} Returns the index of the first character not found in `chars`. - */ - function charsLeftIndex(string, chars) { - var index = -1, - length = string.length; - - while (++index < length && chars.indexOf(string.charAt(index)) > -1) {} - return index; - } - - /** - * Used by `_.trim` and `_.trimRight` to get the index of the last character - * of `string` that is not found in `chars`. - * - * @private - * @param {string} string The string to inspect. - * @param {string} chars The characters to find. - * @returns {number} Returns the index of the last character not found in `chars`. - */ - function charsRightIndex(string, chars) { - var index = string.length; - - while (index-- && chars.indexOf(string.charAt(index)) > -1) {} - return index; - } - - /** - * Used by `_.sortBy` to compare transformed elements of a collection and stable - * sort them in ascending order. - * - * @private - * @param {Object} object The object to compare to `other`. - * @param {Object} other The object to compare to `object`. - * @returns {number} Returns the sort order indicator for `object`. - */ - function compareAscending(object, other) { - return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index); - } - - /** - * Used by `_.sortByOrder` to compare multiple properties of each element - * in a collection and stable sort them in the following order: - * - * If `orders` is unspecified, sort in ascending order for all properties. - * Otherwise, for each property, sort in ascending order if its corresponding value in - * orders is true, and descending order if false. - * - * @private - * @param {Object} object The object to compare to `other`. - * @param {Object} other The object to compare to `object`. - * @param {boolean[]} orders The order to sort by for each property. - * @returns {number} Returns the sort order indicator for `object`. - */ - function compareMultiple(object, other, orders) { - var index = -1, - objCriteria = object.criteria, - othCriteria = other.criteria, - length = objCriteria.length, - ordersLength = orders.length; - - while (++index < length) { - var result = baseCompareAscending(objCriteria[index], othCriteria[index]); - if (result) { - if (index >= ordersLength) { - return result; - } - return result * (orders[index] ? 1 : -1); - } - } - // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications - // that causes it, under certain circumstances, to provide the same value for - // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 - // for more details. - // - // This also ensures a stable sort in V8 and other engines. - // See https://code.google.com/p/v8/issues/detail?id=90 for more details. - return object.index - other.index; - } - - /** - * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters. - * - * @private - * @param {string} letter The matched letter to deburr. - * @returns {string} Returns the deburred letter. - */ - function deburrLetter(letter) { - return deburredLetters[letter]; - } - - /** - * Used by `_.escape` to convert characters to HTML entities. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - function escapeHtmlChar(chr) { - return htmlEscapes[chr]; - } - - /** - * Used by `_.template` to escape characters for inclusion in compiled - * string literals. - * - * @private - * @param {string} chr The matched character to escape. - * @returns {string} Returns the escaped character. - */ - function escapeStringChar(chr) { - return '\\' + stringEscapes[chr]; - } - - /** - * Gets the index at which the first occurrence of `NaN` is found in `array`. - * - * @private - * @param {Array} array The array to search. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched `NaN`, else `-1`. - */ - function indexOfNaN(array, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 0 : -1); - - while ((fromRight ? index-- : ++index < length)) { - var other = array[index]; - if (other !== other) { - return index; - } - } - return -1; - } - - /** - * Checks if `value` is object-like. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - */ - function isObjectLike(value) { - return !!value && typeof value == 'object'; - } - - /** - * Used by `trimmedLeftIndex` and `trimmedRightIndex` to determine if a - * character code is whitespace. - * - * @private - * @param {number} charCode The character code to inspect. - * @returns {boolean} Returns `true` if `charCode` is whitespace, else `false`. - */ - function isSpace(charCode) { - return ((charCode <= 160 && (charCode >= 9 && charCode <= 13) || charCode == 32 || charCode == 160) || charCode == 5760 || charCode == 6158 || - (charCode >= 8192 && (charCode <= 8202 || charCode == 8232 || charCode == 8233 || charCode == 8239 || charCode == 8287 || charCode == 12288 || charCode == 65279))); - } - - /** - * Replaces all `placeholder` elements in `array` with an internal placeholder - * and returns an array of their indexes. - * - * @private - * @param {Array} array The array to modify. - * @param {*} placeholder The placeholder to replace. - * @returns {Array} Returns the new array of placeholder indexes. - */ - function replaceHolders(array, placeholder) { - var index = -1, - length = array.length, - resIndex = -1, - result = []; - - while (++index < length) { - if (array[index] === placeholder) { - array[index] = PLACEHOLDER; - result[++resIndex] = index; - } - } - return result; - } - - /** - * An implementation of `_.uniq` optimized for sorted arrays without support - * for callback shorthands and `this` binding. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The function invoked per iteration. - * @returns {Array} Returns the new duplicate-value-free array. - */ - function sortedUniq(array, iteratee) { - var seen, - index = -1, - length = array.length, - resIndex = -1, - result = []; - - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value, index, array) : value; - - if (!index || seen !== computed) { - seen = computed; - result[++resIndex] = value; - } - } - return result; - } - - /** - * Used by `_.trim` and `_.trimLeft` to get the index of the first non-whitespace - * character of `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the index of the first non-whitespace character. - */ - function trimmedLeftIndex(string) { - var index = -1, - length = string.length; - - while (++index < length && isSpace(string.charCodeAt(index))) {} - return index; - } - - /** - * Used by `_.trim` and `_.trimRight` to get the index of the last non-whitespace - * character of `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the index of the last non-whitespace character. - */ - function trimmedRightIndex(string) { - var index = string.length; - - while (index-- && isSpace(string.charCodeAt(index))) {} - return index; - } - - /** - * Used by `_.unescape` to convert HTML entities to characters. - * - * @private - * @param {string} chr The matched character to unescape. - * @returns {string} Returns the unescaped character. - */ - function unescapeHtmlChar(chr) { - return htmlUnescapes[chr]; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Create a new pristine `lodash` function using the given `context` object. - * - * @static - * @memberOf _ - * @category Utility - * @param {Object} [context=root] The context object. - * @returns {Function} Returns a new `lodash` function. - * @example - * - * _.mixin({ 'foo': _.constant('foo') }); - * - * var lodash = _.runInContext(); - * lodash.mixin({ 'bar': lodash.constant('bar') }); - * - * _.isFunction(_.foo); - * // => true - * _.isFunction(_.bar); - * // => false - * - * lodash.isFunction(lodash.foo); - * // => false - * lodash.isFunction(lodash.bar); - * // => true - * - * // using `context` to mock `Date#getTime` use in `_.now` - * var mock = _.runInContext({ - * 'Date': function() { - * return { 'getTime': getTimeMock }; - * } - * }); - * - * // or creating a suped-up `defer` in Node.js - * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; - */ - function runInContext(context) { - // Avoid issues with some ES3 environments that attempt to use values, named - // after built-in constructors like `Object`, for the creation of literals. - // ES5 clears this up by stating that literals must use built-in constructors. - // See https://es5.github.io/#x11.1.5 for more details. - context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root; - - /** Native constructor references. */ - var Array = context.Array, - Date = context.Date, - Error = context.Error, - Function = context.Function, - Math = context.Math, - Number = context.Number, - Object = context.Object, - RegExp = context.RegExp, - String = context.String, - TypeError = context.TypeError; - - /** Used for native method references. */ - var arrayProto = Array.prototype, - objectProto = Object.prototype, - stringProto = String.prototype; - - /** Used to detect DOM support. */ - var document = (document = context.window) ? document.document : null; - - /** Used to resolve the decompiled source of functions. */ - var fnToString = Function.prototype.toString; - - /** Used to check objects for own properties. */ - var hasOwnProperty = objectProto.hasOwnProperty; - - /** Used to generate unique IDs. */ - var idCounter = 0; - - /** - * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring) - * of values. - */ - var objToString = objectProto.toString; - - /** Used to restore the original `_` reference in `_.noConflict`. */ - var oldDash = context._; - - /** Used to detect if a method is native. */ - var reIsNative = RegExp('^' + - escapeRegExp(fnToString.call(hasOwnProperty)) - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' - ); - - /** Native method references. */ - var ArrayBuffer = getNative(context, 'ArrayBuffer'), - bufferSlice = getNative(ArrayBuffer && new ArrayBuffer(0), 'slice'), - ceil = Math.ceil, - clearTimeout = context.clearTimeout, - floor = Math.floor, - getPrototypeOf = getNative(Object, 'getPrototypeOf'), - parseFloat = context.parseFloat, - push = arrayProto.push, - Set = getNative(context, 'Set'), - setTimeout = context.setTimeout, - splice = arrayProto.splice, - Uint8Array = getNative(context, 'Uint8Array'), - WeakMap = getNative(context, 'WeakMap'); - - /** Used to clone array buffers. */ - var Float64Array = (function() { - // Safari 5 errors when using an array buffer to initialize a typed array - // where the array buffer's `byteLength` is not a multiple of the typed - // array's `BYTES_PER_ELEMENT`. - try { - var func = getNative(context, 'Float64Array'), - result = new func(new ArrayBuffer(10), 0, 1) && func; - } catch(e) {} - return result || null; - }()); - - /* Native method references for those with the same name as other `lodash` methods. */ - var nativeCreate = getNative(Object, 'create'), - nativeIsArray = getNative(Array, 'isArray'), - nativeIsFinite = context.isFinite, - nativeKeys = getNative(Object, 'keys'), - nativeMax = Math.max, - nativeMin = Math.min, - nativeNow = getNative(Date, 'now'), - nativeNumIsFinite = getNative(Number, 'isFinite'), - nativeParseInt = context.parseInt, - nativeRandom = Math.random; - - /** Used as references for `-Infinity` and `Infinity`. */ - var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY, - POSITIVE_INFINITY = Number.POSITIVE_INFINITY; - - /** Used as references for the maximum length and index of an array. */ - var MAX_ARRAY_LENGTH = 4294967295, - MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, - HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; - - /** Used as the size, in bytes, of each `Float64Array` element. */ - var FLOAT64_BYTES_PER_ELEMENT = Float64Array ? Float64Array.BYTES_PER_ELEMENT : 0; - - /** - * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) - * of an array-like value. - */ - var MAX_SAFE_INTEGER = 9007199254740991; - - /** Used to store function metadata. */ - var metaMap = WeakMap && new WeakMap; - - /** Used to lookup unminified function names. */ - var realNames = {}; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a `lodash` object which wraps `value` to enable implicit chaining. - * Methods that operate on and return arrays, collections, and functions can - * be chained together. Methods that return a boolean or single value will - * automatically end the chain returning the unwrapped value. Explicit chaining - * may be enabled using `_.chain`. The execution of chained methods is lazy, - * that is, execution is deferred until `_#value` is implicitly or explicitly - * called. - * - * Lazy evaluation allows several methods to support shortcut fusion. Shortcut - * fusion is an optimization that merges iteratees to avoid creating intermediate - * arrays and reduce the number of iteratee executions. - * - * Chaining is supported in custom builds as long as the `_#value` method is - * directly or indirectly included in the build. - * - * In addition to lodash methods, wrappers have `Array` and `String` methods. - * - * The wrapper `Array` methods are: - * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, - * `splice`, and `unshift` - * - * The wrapper `String` methods are: - * `replace` and `split` - * - * The wrapper methods that support shortcut fusion are: - * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, - * `first`, `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`, - * `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`, - * and `where` - * - * The chainable wrapper methods are: - * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`, - * `callback`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`, - * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defer`, `delay`, - * `difference`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `fill`, - * `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`, `forEach`, - * `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `functions`, - * `groupBy`, `indexBy`, `initial`, `intersection`, `invert`, `invoke`, `keys`, - * `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, - * `memoize`, `merge`, `method`, `methodOf`, `mixin`, `negate`, `omit`, `once`, - * `pairs`, `partial`, `partialRight`, `partition`, `pick`, `plant`, `pluck`, - * `property`, `propertyOf`, `pull`, `pullAt`, `push`, `range`, `rearg`, - * `reject`, `remove`, `rest`, `restParam`, `reverse`, `set`, `shuffle`, - * `slice`, `sort`, `sortBy`, `sortByAll`, `sortByOrder`, `splice`, `spread`, - * `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`, - * `thru`, `times`, `toArray`, `toPlainObject`, `transform`, `union`, `uniq`, - * `unshift`, `unzip`, `unzipWith`, `values`, `valuesIn`, `where`, `without`, - * `wrap`, `xor`, `zip`, `zipObject`, `zipWith` - * - * The wrapper methods that are **not** chainable by default are: - * `add`, `attempt`, `camelCase`, `capitalize`, `clone`, `cloneDeep`, `deburr`, - * `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, - * `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`, `get`, - * `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`, `inRange`, `isArguments`, - * `isArray`, `isBoolean`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isError`, - * `isFinite` `isFunction`, `isMatch`, `isNative`, `isNaN`, `isNull`, `isNumber`, - * `isObject`, `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, - * `isTypedArray`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lt`, `lte`, - * `max`, `min`, `noConflict`, `noop`, `now`, `pad`, `padLeft`, `padRight`, - * `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, - * `runInContext`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, - * `sortedLastIndex`, `startCase`, `startsWith`, `sum`, `template`, `trim`, - * `trimLeft`, `trimRight`, `trunc`, `unescape`, `uniqueId`, `value`, and `words` - * - * The wrapper method `sample` will return a wrapped value when `n` is provided, - * otherwise an unwrapped value is returned. - * - * @name _ - * @constructor - * @category Chain - * @param {*} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var wrapped = _([1, 2, 3]); - * - * // returns an unwrapped value - * wrapped.reduce(function(total, n) { - * return total + n; - * }); - * // => 6 - * - * // returns a wrapped value - * var squares = wrapped.map(function(n) { - * return n * n; - * }); - * - * _.isArray(squares); - * // => false - * - * _.isArray(squares.value()); - * // => true - */ - function lodash(value) { - if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { - if (value instanceof LodashWrapper) { - return value; - } - if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) { - return wrapperClone(value); - } - } - return new LodashWrapper(value); - } - - /** - * The function whose prototype all chaining wrappers inherit from. - * - * @private - */ - function baseLodash() { - // No operation performed. - } - - /** - * The base constructor for creating `lodash` wrapper objects. - * - * @private - * @param {*} value The value to wrap. - * @param {boolean} [chainAll] Enable chaining for all wrapper methods. - * @param {Array} [actions=[]] Actions to peform to resolve the unwrapped value. - */ - function LodashWrapper(value, chainAll, actions) { - this.__wrapped__ = value; - this.__actions__ = actions || []; - this.__chain__ = !!chainAll; - } - - /** - * An object environment feature flags. - * - * @static - * @memberOf _ - * @type Object - */ - var support = lodash.support = {}; - - (function(x) { - var Ctor = function() { this.x = x; }, - object = { '0': x, 'length': x }, - props = []; - - Ctor.prototype = { 'valueOf': x, 'y': x }; - for (var key in new Ctor) { props.push(key); } - - /** - * Detect if the DOM is supported. - * - * @memberOf _.support - * @type boolean - */ - try { - support.dom = document.createDocumentFragment().nodeType === 11; - } catch(e) { - support.dom = false; - } - }(1, 0)); - - /** - * By default, the template delimiters used by lodash are like those in - * embedded Ruby (ERB). Change the following template settings to use - * alternative delimiters. - * - * @static - * @memberOf _ - * @type Object - */ - lodash.templateSettings = { - - /** - * Used to detect `data` property values to be HTML-escaped. - * - * @memberOf _.templateSettings - * @type RegExp - */ - 'escape': reEscape, - - /** - * Used to detect code to be evaluated. - * - * @memberOf _.templateSettings - * @type RegExp - */ - 'evaluate': reEvaluate, - - /** - * Used to detect `data` property values to inject. - * - * @memberOf _.templateSettings - * @type RegExp - */ - 'interpolate': reInterpolate, - - /** - * Used to reference the data object in the template text. - * - * @memberOf _.templateSettings - * @type string - */ - 'variable': '', - - /** - * Used to import variables into the compiled template. - * - * @memberOf _.templateSettings - * @type Object - */ - 'imports': { - - /** - * A reference to the `lodash` function. - * - * @memberOf _.templateSettings.imports - * @type Function - */ - '_': lodash - } - }; - - /*------------------------------------------------------------------------*/ - - /** - * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. - * - * @private - * @param {*} value The value to wrap. - */ - function LazyWrapper(value) { - this.__wrapped__ = value; - this.__actions__ = null; - this.__dir__ = 1; - this.__dropCount__ = 0; - this.__filtered__ = false; - this.__iteratees__ = null; - this.__takeCount__ = POSITIVE_INFINITY; - this.__views__ = null; - } - - /** - * Creates a clone of the lazy wrapper object. - * - * @private - * @name clone - * @memberOf LazyWrapper - * @returns {Object} Returns the cloned `LazyWrapper` object. - */ - function lazyClone() { - var actions = this.__actions__, - iteratees = this.__iteratees__, - views = this.__views__, - result = new LazyWrapper(this.__wrapped__); - - result.__actions__ = actions ? arrayCopy(actions) : null; - result.__dir__ = this.__dir__; - result.__filtered__ = this.__filtered__; - result.__iteratees__ = iteratees ? arrayCopy(iteratees) : null; - result.__takeCount__ = this.__takeCount__; - result.__views__ = views ? arrayCopy(views) : null; - return result; - } - - /** - * Reverses the direction of lazy iteration. - * - * @private - * @name reverse - * @memberOf LazyWrapper - * @returns {Object} Returns the new reversed `LazyWrapper` object. - */ - function lazyReverse() { - if (this.__filtered__) { - var result = new LazyWrapper(this); - result.__dir__ = -1; - result.__filtered__ = true; - } else { - result = this.clone(); - result.__dir__ *= -1; - } - return result; - } - - /** - * Extracts the unwrapped value from its lazy wrapper. - * - * @private - * @name value - * @memberOf LazyWrapper - * @returns {*} Returns the unwrapped value. - */ - function lazyValue() { - var array = this.__wrapped__.value(); - if (!isArray(array)) { - return baseWrapperValue(array, this.__actions__); - } - var dir = this.__dir__, - isRight = dir < 0, - view = getView(0, array.length, this.__views__), - start = view.start, - end = view.end, - length = end - start, - index = isRight ? end : (start - 1), - takeCount = nativeMin(length, this.__takeCount__), - iteratees = this.__iteratees__, - iterLength = iteratees ? iteratees.length : 0, - resIndex = 0, - result = []; - - outer: - while (length-- && resIndex < takeCount) { - index += dir; - - var iterIndex = -1, - value = array[index]; - - while (++iterIndex < iterLength) { - var data = iteratees[iterIndex], - iteratee = data.iteratee, - type = data.type; - - if (type == LAZY_DROP_WHILE_FLAG) { - if (data.done && (isRight ? (index > data.index) : (index < data.index))) { - data.count = 0; - data.done = false; - } - data.index = index; - if (!data.done) { - var limit = data.limit; - if (!(data.done = limit > -1 ? (data.count++ >= limit) : !iteratee(value))) { - continue outer; - } - } - } else { - var computed = iteratee(value); - if (type == LAZY_MAP_FLAG) { - value = computed; - } else if (!computed) { - if (type == LAZY_FILTER_FLAG) { - continue outer; - } else { - break outer; - } - } - } - } - result[resIndex++] = value; - } - return result; - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates a cache object to store key/value pairs. - * - * @private - * @static - * @name Cache - * @memberOf _.memoize - */ - function MapCache() { - this.__data__ = {}; - } - - /** - * Removes `key` and its value from the cache. - * - * @private - * @name delete - * @memberOf _.memoize.Cache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed successfully, else `false`. - */ - function mapDelete(key) { - return this.has(key) && delete this.__data__[key]; - } - - /** - * Gets the cached value for `key`. - * - * @private - * @name get - * @memberOf _.memoize.Cache - * @param {string} key The key of the value to get. - * @returns {*} Returns the cached value. - */ - function mapGet(key) { - return key == '__proto__' ? undefined : this.__data__[key]; - } - - /** - * Checks if a cached value for `key` exists. - * - * @private - * @name has - * @memberOf _.memoize.Cache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ - function mapHas(key) { - return key != '__proto__' && hasOwnProperty.call(this.__data__, key); - } - - /** - * Sets `value` to `key` of the cache. - * - * @private - * @name set - * @memberOf _.memoize.Cache - * @param {string} key The key of the value to cache. - * @param {*} value The value to cache. - * @returns {Object} Returns the cache object. - */ - function mapSet(key, value) { - if (key != '__proto__') { - this.__data__[key] = value; - } - return this; - } - - /*------------------------------------------------------------------------*/ - - /** - * - * Creates a cache object to store unique values. - * - * @private - * @param {Array} [values] The values to cache. - */ - function SetCache(values) { - var length = values ? values.length : 0; - - this.data = { 'hash': nativeCreate(null), 'set': new Set }; - while (length--) { - this.push(values[length]); - } - } - - /** - * Checks if `value` is in `cache` mimicking the return signature of - * `_.indexOf` by returning `0` if the value is found, else `-1`. - * - * @private - * @param {Object} cache The cache to search. - * @param {*} value The value to search for. - * @returns {number} Returns `0` if `value` is found, else `-1`. - */ - function cacheIndexOf(cache, value) { - var data = cache.data, - result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value]; - - return result ? 0 : -1; - } - - /** - * Adds `value` to the cache. - * - * @private - * @name push - * @memberOf SetCache - * @param {*} value The value to cache. - */ - function cachePush(value) { - var data = this.data; - if (typeof value == 'string' || isObject(value)) { - data.set.add(value); - } else { - data.hash[value] = true; - } - } - - /*------------------------------------------------------------------------*/ - - /** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ - function arrayCopy(source, array) { - var index = -1, - length = source.length; - - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; - } - - /** - * A specialized version of `_.forEach` for arrays without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEach(array, iteratee) { - var index = -1, - length = array.length; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; - } - - /** - * A specialized version of `_.forEachRight` for arrays without support for - * callback shorthands and `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ - function arrayEachRight(array, iteratee) { - var length = array.length; - - while (length--) { - if (iteratee(array[length], length, array) === false) { - break; - } - } - return array; - } - - /** - * A specialized version of `_.every` for arrays without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - */ - function arrayEvery(array, predicate) { - var index = -1, - length = array.length; - - while (++index < length) { - if (!predicate(array[index], index, array)) { - return false; - } - } - return true; - } - - /** - * A specialized version of `baseExtremum` for arrays which invokes `iteratee` - * with one argument: (value). - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} comparator The function used to compare values. - * @param {*} exValue The initial extremum value. - * @returns {*} Returns the extremum value. - */ - function arrayExtremum(array, iteratee, comparator, exValue) { - var index = -1, - length = array.length, - computed = exValue, - result = computed; - - while (++index < length) { - var value = array[index], - current = +iteratee(value); - - if (comparator(current, computed)) { - computed = current; - result = value; - } - } - return result; - } - - /** - * A specialized version of `_.filter` for arrays without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function arrayFilter(array, predicate) { - var index = -1, - length = array.length, - resIndex = -1, - result = []; - - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[++resIndex] = value; - } - } - return result; - } - - /** - * A specialized version of `_.map` for arrays without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function arrayMap(array, iteratee) { - var index = -1, - length = array.length, - result = Array(length); - - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; - } - - /** - * A specialized version of `_.reduce` for arrays without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initFromArray] Specify using the first element of `array` - * as the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduce(array, iteratee, accumulator, initFromArray) { - var index = -1, - length = array.length; - - if (initFromArray && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; - } - - /** - * A specialized version of `_.reduceRight` for arrays without support for - * callback shorthands and `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initFromArray] Specify using the last element of `array` - * as the initial value. - * @returns {*} Returns the accumulated value. - */ - function arrayReduceRight(array, iteratee, accumulator, initFromArray) { - var length = array.length; - if (initFromArray && length) { - accumulator = array[--length]; - } - while (length--) { - accumulator = iteratee(accumulator, array[length], length, array); - } - return accumulator; - } - - /** - * A specialized version of `_.some` for arrays without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ - function arraySome(array, predicate) { - var index = -1, - length = array.length; - - while (++index < length) { - if (predicate(array[index], index, array)) { - return true; - } - } - return false; - } - - /** - * A specialized version of `_.sum` for arrays without support for iteratees. - * - * @private - * @param {Array} array The array to iterate over. - * @returns {number} Returns the sum. - */ - function arraySum(array) { - var length = array.length, - result = 0; - - while (length--) { - result += +array[length] || 0; - } - return result; - } - - /** - * Used by `_.defaults` to customize its `_.assign` use. - * - * @private - * @param {*} objectValue The destination object property value. - * @param {*} sourceValue The source object property value. - * @returns {*} Returns the value to assign to the destination object. - */ - function assignDefaults(objectValue, sourceValue) { - return objectValue === undefined ? sourceValue : objectValue; - } - - /** - * Used by `_.template` to customize its `_.assign` use. - * - * **Note:** This function is like `assignDefaults` except that it ignores - * inherited property values when checking if a property is `undefined`. - * - * @private - * @param {*} objectValue The destination object property value. - * @param {*} sourceValue The source object property value. - * @param {string} key The key associated with the object and source values. - * @param {Object} object The destination object. - * @returns {*} Returns the value to assign to the destination object. - */ - function assignOwnDefaults(objectValue, sourceValue, key, object) { - return (objectValue === undefined || !hasOwnProperty.call(object, key)) - ? sourceValue - : objectValue; - } - - /** - * A specialized version of `_.assign` for customizing assigned values without - * support for argument juggling, multiple sources, and `this` binding `customizer` - * functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {Function} customizer The function to customize assigned values. - * @returns {Object} Returns `object`. - */ - function assignWith(object, source, customizer) { - var index = -1, - props = keys(source), - length = props.length; - - while (++index < length) { - var key = props[index], - value = object[key], - result = customizer(value, source[key], key, object, source); - - if ((result === result ? (result !== value) : (value === value)) || - (value === undefined && !(key in object))) { - object[key] = result; - } - } - return object; - } - - /** - * The base implementation of `_.assign` without support for argument juggling, - * multiple sources, and `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ - function baseAssign(object, source) { - return source == null - ? object - : baseCopy(source, keys(source), object); - } - - /** - * The base implementation of `_.at` without support for string collections - * and individual key arguments. - * - * @private - * @param {Array|Object} collection The collection to iterate over. - * @param {number[]|string[]} props The property names or indexes of elements to pick. - * @returns {Array} Returns the new array of picked elements. - */ - function baseAt(collection, props) { - var index = -1, - isNil = collection == null, - isArr = !isNil && isArrayLike(collection), - length = isArr ? collection.length : 0, - propsLength = props.length, - result = Array(propsLength); - - while(++index < propsLength) { - var key = props[index]; - if (isArr) { - result[index] = isIndex(key, length) ? collection[key] : undefined; - } else { - result[index] = isNil ? undefined : collection[key]; - } - } - return result; - } - - /** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property names to copy. - * @param {Object} [object={}] The object to copy properties to. - * @returns {Object} Returns `object`. - */ - function baseCopy(source, props, object) { - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; - object[key] = source[key]; - } - return object; - } - - /** - * The base implementation of `_.callback` which supports specifying the - * number of arguments to provide to `func`. - * - * @private - * @param {*} [func=_.identity] The value to convert to a callback. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {number} [argCount] The number of arguments to provide to `func`. - * @returns {Function} Returns the callback. - */ - function baseCallback(func, thisArg, argCount) { - var type = typeof func; - if (type == 'function') { - return thisArg === undefined - ? func - : bindCallback(func, thisArg, argCount); - } - if (func == null) { - return identity; - } - if (type == 'object') { - return baseMatches(func); - } - return thisArg === undefined - ? property(func) - : baseMatchesProperty(func, thisArg); - } - - /** - * The base implementation of `_.clone` without support for argument juggling - * and `this` binding `customizer` functions. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @param {Function} [customizer] The function to customize cloning values. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The object `value` belongs to. - * @param {Array} [stackA=[]] Tracks traversed source objects. - * @param {Array} [stackB=[]] Associates clones with source counterparts. - * @returns {*} Returns the cloned value. - */ - function baseClone(value, isDeep, customizer, key, object, stackA, stackB) { - var result; - if (customizer) { - result = object ? customizer(value, key, object) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return arrayCopy(value, result); - } - } else { - var tag = objToString.call(value), - isFunc = tag == funcTag; - - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - result = initCloneObject(isFunc ? {} : value); - if (!isDeep) { - return baseAssign(result, value); - } - } else { - return cloneableTags[tag] - ? initCloneByTag(value, tag, isDeep) - : (object ? value : {}); - } - } - // Check for circular references and return corresponding clone. - stackA || (stackA = []); - stackB || (stackB = []); - - var length = stackA.length; - while (length--) { - if (stackA[length] == value) { - return stackB[length]; - } - } - // Add the source value to the stack of traversed objects and associate it with its clone. - stackA.push(value); - stackB.push(result); - - // Recursively populate clone (susceptible to call stack limits). - (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) { - result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB); - }); - return result; - } - - /** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} prototype The object to inherit from. - * @returns {Object} Returns the new object. - */ - var baseCreate = (function() { - function object() {} - return function(prototype) { - if (isObject(prototype)) { - object.prototype = prototype; - var result = new object; - object.prototype = null; - } - return result || {}; - }; - }()); - - /** - * The base implementation of `_.delay` and `_.defer` which accepts an index - * of where to slice the arguments to provide to `func`. - * - * @private - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {Object} args The arguments provide to `func`. - * @returns {number} Returns the timer id. - */ - function baseDelay(func, wait, args) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return setTimeout(function() { func.apply(undefined, args); }, wait); - } - - /** - * The base implementation of `_.difference` which accepts a single array - * of values to exclude. - * - * @private - * @param {Array} array The array to inspect. - * @param {Array} values The values to exclude. - * @returns {Array} Returns the new array of filtered values. - */ - function baseDifference(array, values) { - var length = array ? array.length : 0, - result = []; - - if (!length) { - return result; - } - var index = -1, - indexOf = getIndexOf(), - isCommon = indexOf == baseIndexOf, - cache = (isCommon && values.length >= 200) ? createCache(values) : null, - valuesLength = values.length; - - if (cache) { - indexOf = cacheIndexOf; - isCommon = false; - values = cache; - } - outer: - while (++index < length) { - var value = array[index]; - - if (isCommon && value === value) { - var valuesIndex = valuesLength; - while (valuesIndex--) { - if (values[valuesIndex] === value) { - continue outer; - } - } - result.push(value); - } - else if (indexOf(values, value, 0) < 0) { - result.push(value); - } - } - return result; - } - - /** - * The base implementation of `_.forEach` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object|string} Returns `collection`. - */ - var baseEach = createBaseEach(baseForOwn); - - /** - * The base implementation of `_.forEachRight` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array|Object|string} Returns `collection`. - */ - var baseEachRight = createBaseEach(baseForOwnRight, true); - - /** - * The base implementation of `_.every` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false` - */ - function baseEvery(collection, predicate) { - var result = true; - baseEach(collection, function(value, index, collection) { - result = !!predicate(value, index, collection); - return result; - }); - return result; - } - - /** - * Gets the extremum value of `collection` invoking `iteratee` for each value - * in `collection` to generate the criterion by which the value is ranked. - * The `iteratee` is invoked with three arguments: (value, index|key, collection). - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} comparator The function used to compare values. - * @param {*} exValue The initial extremum value. - * @returns {*} Returns the extremum value. - */ - function baseExtremum(collection, iteratee, comparator, exValue) { - var computed = exValue, - result = computed; - - baseEach(collection, function(value, index, collection) { - var current = +iteratee(value, index, collection); - if (comparator(current, computed) || (current === exValue && current === result)) { - computed = current; - result = value; - } - }); - return result; - } - - /** - * The base implementation of `_.fill` without an iteratee call guard. - * - * @private - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - */ - function baseFill(array, value, start, end) { - var length = array.length; - - start = start == null ? 0 : (+start || 0); - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = (end === undefined || end > length) ? length : (+end || 0); - if (end < 0) { - end += length; - } - length = start > end ? 0 : (end >>> 0); - start >>>= 0; - - while (start < length) { - array[start++] = value; - } - return array; - } - - /** - * The base implementation of `_.filter` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. - */ - function baseFilter(collection, predicate) { - var result = []; - baseEach(collection, function(value, index, collection) { - if (predicate(value, index, collection)) { - result.push(value); - } - }); - return result; - } - - /** - * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`, - * without support for callback shorthands and `this` binding, which iterates - * over `collection` using the provided `eachFunc`. - * - * @private - * @param {Array|Object|string} collection The collection to search. - * @param {Function} predicate The function invoked per iteration. - * @param {Function} eachFunc The function to iterate over `collection`. - * @param {boolean} [retKey] Specify returning the key of the found element - * instead of the element itself. - * @returns {*} Returns the found element or its key, else `undefined`. - */ - function baseFind(collection, predicate, eachFunc, retKey) { - var result; - eachFunc(collection, function(value, key, collection) { - if (predicate(value, key, collection)) { - result = retKey ? key : value; - return false; - } - }); - return result; - } - - /** - * The base implementation of `_.flatten` with added support for restricting - * flattening and specifying the start index. - * - * @private - * @param {Array} array The array to flatten. - * @param {boolean} [isDeep] Specify a deep flatten. - * @param {boolean} [isStrict] Restrict flattening to arrays-like objects. - * @returns {Array} Returns the new flattened array. - */ - function baseFlatten(array, isDeep, isStrict) { - var index = -1, - length = array.length, - resIndex = -1, - result = []; - - while (++index < length) { - var value = array[index]; - if (isObjectLike(value) && isArrayLike(value) && - (isStrict || isArray(value) || isArguments(value))) { - if (isDeep) { - // Recursively flatten arrays (susceptible to call stack limits). - value = baseFlatten(value, isDeep, isStrict); - } - var valIndex = -1, - valLength = value.length; - - while (++valIndex < valLength) { - result[++resIndex] = value[valIndex]; - } - } else if (!isStrict) { - result[++resIndex] = value; - } - } - return result; - } - - /** - * The base implementation of `baseForIn` and `baseForOwn` which iterates - * over `object` properties returned by `keysFunc` invoking `iteratee` for - * each property. Iteratee functions may exit iteration early by explicitly - * returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ - var baseFor = createBaseFor(); - - /** - * This function is like `baseFor` except that it iterates over properties - * in the opposite order. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ - var baseForRight = createBaseFor(true); - - /** - * The base implementation of `_.forIn` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForIn(object, iteratee) { - return baseFor(object, iteratee, keysIn); - } - - /** - * The base implementation of `_.forOwn` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForOwn(object, iteratee) { - return baseFor(object, iteratee, keys); - } - - /** - * The base implementation of `_.forOwnRight` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ - function baseForOwnRight(object, iteratee) { - return baseForRight(object, iteratee, keys); - } - - /** - * The base implementation of `_.functions` which creates an array of - * `object` function property names filtered from those provided. - * - * @private - * @param {Object} object The object to inspect. - * @param {Array} props The property names to filter. - * @returns {Array} Returns the new array of filtered property names. - */ - function baseFunctions(object, props) { - var index = -1, - length = props.length, - resIndex = -1, - result = []; - - while (++index < length) { - var key = props[index]; - if (isFunction(object[key])) { - result[++resIndex] = key; - } - } - return result; - } - - /** - * The base implementation of `get` without support for string paths - * and default values. - * - * @private - * @param {Object} object The object to query. - * @param {Array} path The path of the property to get. - * @param {string} [pathKey] The key representation of path. - * @returns {*} Returns the resolved value. - */ - function baseGet(object, path, pathKey) { - if (object == null) { - return; - } - if (pathKey !== undefined && pathKey in toObject(object)) { - path = [pathKey]; - } - var index = 0, - length = path.length; - - while (object != null && index < length) { - object = object[path[index++]]; - } - return (index && index == length) ? object : undefined; - } - - /** - * The base implementation of `_.isEqual` without support for `this` binding - * `customizer` functions. - * - * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize comparing values. - * @param {boolean} [isLoose] Specify performing partial comparisons. - * @param {Array} [stackA] Tracks traversed `value` objects. - * @param {Array} [stackB] Tracks traversed `other` objects. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - */ - function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) { - if (value === other) { - return true; - } - if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { - return value !== value && other !== other; - } - return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB); - } - - /** - * A specialized version of `baseIsEqual` for arrays and objects which performs - * deep comparisons and tracks traversed objects enabling objects with circular - * references to be compared. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparing objects. - * @param {boolean} [isLoose] Specify performing partial comparisons. - * @param {Array} [stackA=[]] Tracks traversed `value` objects. - * @param {Array} [stackB=[]] Tracks traversed `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) { - var objIsArr = isArray(object), - othIsArr = isArray(other), - objTag = arrayTag, - othTag = arrayTag; - - if (!objIsArr) { - objTag = objToString.call(object); - if (objTag == argsTag) { - objTag = objectTag; - } else if (objTag != objectTag) { - objIsArr = isTypedArray(object); - } - } - if (!othIsArr) { - othTag = objToString.call(other); - if (othTag == argsTag) { - othTag = objectTag; - } else if (othTag != objectTag) { - othIsArr = isTypedArray(other); - } - } - var objIsObj = objTag == objectTag, - othIsObj = othTag == objectTag, - isSameTag = objTag == othTag; - - if (isSameTag && !(objIsArr || objIsObj)) { - return equalByTag(object, other, objTag); - } - if (!isLoose) { - var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), - othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); - - if (objIsWrapped || othIsWrapped) { - return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB); - } - } - if (!isSameTag) { - return false; - } - // Assume cyclic values are equal. - // For more information on detecting circular references see https://es5.github.io/#JO. - stackA || (stackA = []); - stackB || (stackB = []); - - var length = stackA.length; - while (length--) { - if (stackA[length] == object) { - return stackB[length] == other; - } - } - // Add `object` and `other` to the stack of traversed objects. - stackA.push(object); - stackB.push(other); - - var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB); - - stackA.pop(); - stackB.pop(); - - return result; - } - - /** - * The base implementation of `_.isMatch` without support for callback - * shorthands and `this` binding. - * - * @private - * @param {Object} object The object to inspect. - * @param {Array} matchData The propery names, values, and compare flags to match. - * @param {Function} [customizer] The function to customize comparing objects. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - */ - function baseIsMatch(object, matchData, customizer) { - var index = matchData.length, - length = index, - noCustomizer = !customizer; - - if (object == null) { - return !length; - } - object = toObject(object); - while (index--) { - var data = matchData[index]; - if ((noCustomizer && data[2]) - ? data[1] !== object[data[0]] - : !(data[0] in object) - ) { - return false; - } - } - while (++index < length) { - data = matchData[index]; - var key = data[0], - objValue = object[key], - srcValue = data[1]; - - if (noCustomizer && data[2]) { - if (objValue === undefined && !(key in object)) { - return false; - } - } else { - var result = customizer ? customizer(objValue, srcValue, key) : undefined; - if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) { - return false; - } - } - } - return true; - } - - /** - * The base implementation of `_.map` without support for callback shorthands - * and `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ - function baseMap(collection, iteratee) { - var index = -1, - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value, key, collection) { - result[++index] = iteratee(value, key, collection); - }); - return result; - } - - /** - * The base implementation of `_.matches` which does not clone `source`. - * - * @private - * @param {Object} source The object of property values to match. - * @returns {Function} Returns the new function. - */ - function baseMatches(source) { - var matchData = getMatchData(source); - if (matchData.length == 1 && matchData[0][2]) { - var key = matchData[0][0], - value = matchData[0][1]; - - return function(object) { - if (object == null) { - return false; - } - return object[key] === value && (value !== undefined || (key in toObject(object))); - }; - } - return function(object) { - return baseIsMatch(object, matchData); - }; - } - - /** - * The base implementation of `_.matchesProperty` which does not clone `srcValue`. - * - * @private - * @param {string} path The path of the property to get. - * @param {*} srcValue The value to compare. - * @returns {Function} Returns the new function. - */ - function baseMatchesProperty(path, srcValue) { - var isArr = isArray(path), - isCommon = isKey(path) && isStrictComparable(srcValue), - pathKey = (path + ''); - - path = toPath(path); - return function(object) { - if (object == null) { - return false; - } - var key = pathKey; - object = toObject(object); - if ((isArr || !isCommon) && !(key in object)) { - object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); - if (object == null) { - return false; - } - key = last(path); - object = toObject(object); - } - return object[key] === srcValue - ? (srcValue !== undefined || (key in object)) - : baseIsEqual(srcValue, object[key], undefined, true); - }; - } - - /** - * The base implementation of `_.merge` without support for argument juggling, - * multiple sources, and `this` binding `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {Function} [customizer] The function to customize merging properties. - * @param {Array} [stackA=[]] Tracks traversed source objects. - * @param {Array} [stackB=[]] Associates values with source counterparts. - * @returns {Object} Returns `object`. - */ - function baseMerge(object, source, customizer, stackA, stackB) { - if (!isObject(object)) { - return object; - } - var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)), - props = isSrcArr ? null : keys(source); - - arrayEach(props || source, function(srcValue, key) { - if (props) { - key = srcValue; - srcValue = source[key]; - } - if (isObjectLike(srcValue)) { - stackA || (stackA = []); - stackB || (stackB = []); - baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB); - } - else { - var value = object[key], - result = customizer ? customizer(value, srcValue, key, object, source) : undefined, - isCommon = result === undefined; - - if (isCommon) { - result = srcValue; - } - if ((result !== undefined || (isSrcArr && !(key in object))) && - (isCommon || (result === result ? (result !== value) : (value === value)))) { - object[key] = result; - } - } - }); - return object; - } - - /** - * A specialized version of `baseMerge` for arrays and objects which performs - * deep merges and tracks traversed objects enabling objects with circular - * references to be merged. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @param {string} key The key of the value to merge. - * @param {Function} mergeFunc The function to merge values. - * @param {Function} [customizer] The function to customize merging properties. - * @param {Array} [stackA=[]] Tracks traversed source objects. - * @param {Array} [stackB=[]] Associates values with source counterparts. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) { - var length = stackA.length, - srcValue = source[key]; - - while (length--) { - if (stackA[length] == srcValue) { - object[key] = stackB[length]; - return; - } - } - var value = object[key], - result = customizer ? customizer(value, srcValue, key, object, source) : undefined, - isCommon = result === undefined; - - if (isCommon) { - result = srcValue; - if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) { - result = isArray(value) - ? value - : (isArrayLike(value) ? arrayCopy(value) : []); - } - else if (isPlainObject(srcValue) || isArguments(srcValue)) { - result = isArguments(value) - ? toPlainObject(value) - : (isPlainObject(value) ? value : {}); - } - else { - isCommon = false; - } - } - // Add the source value to the stack of traversed objects and associate - // it with its merged value. - stackA.push(srcValue); - stackB.push(result); - - if (isCommon) { - // Recursively merge objects and arrays (susceptible to call stack limits). - object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB); - } else if (result === result ? (result !== value) : (value === value)) { - object[key] = result; - } - } - - /** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. - */ - function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; - } - - /** - * A specialized version of `baseProperty` which supports deep paths. - * - * @private - * @param {Array|string} path The path of the property to get. - * @returns {Function} Returns the new function. - */ - function basePropertyDeep(path) { - var pathKey = (path + ''); - path = toPath(path); - return function(object) { - return baseGet(object, path, pathKey); - }; - } - - /** - * The base implementation of `_.pullAt` without support for individual - * index arguments and capturing the removed elements. - * - * @private - * @param {Array} array The array to modify. - * @param {number[]} indexes The indexes of elements to remove. - * @returns {Array} Returns `array`. - */ - function basePullAt(array, indexes) { - var length = array ? indexes.length : 0; - while (length--) { - var index = indexes[length]; - if (index != previous && isIndex(index)) { - var previous = index; - splice.call(array, index, 1); - } - } - return array; - } - - /** - * The base implementation of `_.random` without support for argument juggling - * and returning floating-point numbers. - * - * @private - * @param {number} min The minimum possible value. - * @param {number} max The maximum possible value. - * @returns {number} Returns the random number. - */ - function baseRandom(min, max) { - return min + floor(nativeRandom() * (max - min + 1)); - } - - /** - * The base implementation of `_.reduce` and `_.reduceRight` without support - * for callback shorthands and `this` binding, which iterates over `collection` - * using the provided `eachFunc`. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} accumulator The initial value. - * @param {boolean} initFromCollection Specify using the first or last element - * of `collection` as the initial value. - * @param {Function} eachFunc The function to iterate over `collection`. - * @returns {*} Returns the accumulated value. - */ - function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) { - eachFunc(collection, function(value, index, collection) { - accumulator = initFromCollection - ? (initFromCollection = false, value) - : iteratee(accumulator, value, index, collection); - }); - return accumulator; - } - - /** - * The base implementation of `setData` without support for hot loop detection. - * - * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. - */ - var baseSetData = !metaMap ? identity : function(func, data) { - metaMap.set(func, data); - return func; - }; - - /** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - start = start == null ? 0 : (+start || 0); - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = (end === undefined || end > length) ? length : (+end || 0); - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; - } - - /** - * The base implementation of `_.some` without support for callback shorthands - * and `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - */ - function baseSome(collection, predicate) { - var result; - - baseEach(collection, function(value, index, collection) { - result = predicate(value, index, collection); - return !result; - }); - return !!result; - } - - /** - * The base implementation of `_.sortBy` which uses `comparer` to define - * the sort order of `array` and replaces criteria objects with their - * corresponding values. - * - * @private - * @param {Array} array The array to sort. - * @param {Function} comparer The function to define sort order. - * @returns {Array} Returns `array`. - */ - function baseSortBy(array, comparer) { - var length = array.length; - - array.sort(comparer); - while (length--) { - array[length] = array[length].value; - } - return array; - } - - /** - * The base implementation of `_.sortByOrder` without param guards. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. - * @param {boolean[]} orders The sort orders of `iteratees`. - * @returns {Array} Returns the new sorted array. - */ - function baseSortByOrder(collection, iteratees, orders) { - var callback = getCallback(), - index = -1; - - iteratees = arrayMap(iteratees, function(iteratee) { return callback(iteratee); }); - - var result = baseMap(collection, function(value) { - var criteria = arrayMap(iteratees, function(iteratee) { return iteratee(value); }); - return { 'criteria': criteria, 'index': ++index, 'value': value }; - }); - - return baseSortBy(result, function(object, other) { - return compareMultiple(object, other, orders); - }); - } - - /** - * The base implementation of `_.sum` without support for callback shorthands - * and `this` binding. - * - * @private - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {number} Returns the sum. - */ - function baseSum(collection, iteratee) { - var result = 0; - baseEach(collection, function(value, index, collection) { - result += +iteratee(value, index, collection) || 0; - }); - return result; - } - - /** - * The base implementation of `_.uniq` without support for callback shorthands - * and `this` binding. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} [iteratee] The function invoked per iteration. - * @returns {Array} Returns the new duplicate-value-free array. - */ - function baseUniq(array, iteratee) { - var index = -1, - indexOf = getIndexOf(), - length = array.length, - isCommon = indexOf == baseIndexOf, - isLarge = isCommon && length >= 200, - seen = isLarge ? createCache() : null, - result = []; - - if (seen) { - indexOf = cacheIndexOf; - isCommon = false; - } else { - isLarge = false; - seen = iteratee ? [] : result; - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value, index, array) : value; - - if (isCommon && value === value) { - var seenIndex = seen.length; - while (seenIndex--) { - if (seen[seenIndex] === computed) { - continue outer; - } - } - if (iteratee) { - seen.push(computed); - } - result.push(value); - } - else if (indexOf(seen, computed, 0) < 0) { - if (iteratee || isLarge) { - seen.push(computed); - } - result.push(value); - } - } - return result; - } - - /** - * The base implementation of `_.values` and `_.valuesIn` which creates an - * array of `object` property values corresponding to the property names - * of `props`. - * - * @private - * @param {Object} object The object to query. - * @param {Array} props The property names to get values for. - * @returns {Object} Returns the array of property values. - */ - function baseValues(object, props) { - var index = -1, - length = props.length, - result = Array(length); - - while (++index < length) { - result[index] = object[props[index]]; - } - return result; - } - - /** - * The base implementation of `_.dropRightWhile`, `_.dropWhile`, `_.takeRightWhile`, - * and `_.takeWhile` without support for callback shorthands and `this` binding. - * - * @private - * @param {Array} array The array to query. - * @param {Function} predicate The function invoked per iteration. - * @param {boolean} [isDrop] Specify dropping elements instead of taking them. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the slice of `array`. - */ - function baseWhile(array, predicate, isDrop, fromRight) { - var length = array.length, - index = fromRight ? length : -1; - - while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {} - return isDrop - ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) - : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); - } - - /** - * The base implementation of `wrapperValue` which returns the result of - * performing a sequence of actions on the unwrapped `value`, where each - * successive action is supplied the return value of the previous. - * - * @private - * @param {*} value The unwrapped value. - * @param {Array} actions Actions to peform to resolve the unwrapped value. - * @returns {*} Returns the resolved value. - */ - function baseWrapperValue(value, actions) { - var result = value; - if (result instanceof LazyWrapper) { - result = result.value(); - } - var index = -1, - length = actions.length; - - while (++index < length) { - var args = [result], - action = actions[index]; - - push.apply(args, action.args); - result = action.func.apply(action.thisArg, args); - } - return result; - } - - /** - * Performs a binary search of `array` to determine the index at which `value` - * should be inserted into `array` in order to maintain its sort order. - * - * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - */ - function binaryIndex(array, value, retHighest) { - var low = 0, - high = array ? array.length : low; - - if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { - while (low < high) { - var mid = (low + high) >>> 1, - computed = array[mid]; - - if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) { - low = mid + 1; - } else { - high = mid; - } - } - return high; - } - return binaryIndexBy(array, value, identity, retHighest); - } - - /** - * This function is like `binaryIndex` except that it invokes `iteratee` for - * `value` and each element of `array` to compute their sort ranking. The - * iteratee is invoked with one argument; (value). - * - * @private - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function} iteratee The function invoked per iteration. - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - */ - function binaryIndexBy(array, value, iteratee, retHighest) { - value = iteratee(value); - - var low = 0, - high = array ? array.length : 0, - valIsNaN = value !== value, - valIsNull = value === null, - valIsUndef = value === undefined; - - while (low < high) { - var mid = floor((low + high) / 2), - computed = iteratee(array[mid]), - isDef = computed !== undefined, - isReflexive = computed === computed; - - if (valIsNaN) { - var setLow = isReflexive || retHighest; - } else if (valIsNull) { - setLow = isReflexive && isDef && (retHighest || computed != null); - } else if (valIsUndef) { - setLow = isReflexive && (retHighest || isDef); - } else if (computed == null) { - setLow = false; - } else { - setLow = retHighest ? (computed <= value) : (computed < value); - } - if (setLow) { - low = mid + 1; - } else { - high = mid; - } - } - return nativeMin(high, MAX_ARRAY_INDEX); - } - - /** - * A specialized version of `baseCallback` which only supports `this` binding - * and specifying the number of arguments to provide to `func`. - * - * @private - * @param {Function} func The function to bind. - * @param {*} thisArg The `this` binding of `func`. - * @param {number} [argCount] The number of arguments to provide to `func`. - * @returns {Function} Returns the callback. - */ - function bindCallback(func, thisArg, argCount) { - if (typeof func != 'function') { - return identity; - } - if (thisArg === undefined) { - return func; - } - switch (argCount) { - case 1: return function(value) { - return func.call(thisArg, value); - }; - case 3: return function(value, index, collection) { - return func.call(thisArg, value, index, collection); - }; - case 4: return function(accumulator, value, index, collection) { - return func.call(thisArg, accumulator, value, index, collection); - }; - case 5: return function(value, other, key, object, source) { - return func.call(thisArg, value, other, key, object, source); - }; - } - return function() { - return func.apply(thisArg, arguments); - }; - } - - /** - * Creates a clone of the given array buffer. - * - * @private - * @param {ArrayBuffer} buffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ - function bufferClone(buffer) { - return bufferSlice.call(buffer, 0); - } - if (!bufferSlice) { - // PhantomJS has `ArrayBuffer` and `Uint8Array` but not `Float64Array`. - bufferClone = !(ArrayBuffer && Uint8Array) ? constant(null) : function(buffer) { - var byteLength = buffer.byteLength, - floatLength = Float64Array ? floor(byteLength / FLOAT64_BYTES_PER_ELEMENT) : 0, - offset = floatLength * FLOAT64_BYTES_PER_ELEMENT, - result = new ArrayBuffer(byteLength); - - if (floatLength) { - var view = new Float64Array(result, 0, floatLength); - view.set(new Float64Array(buffer, 0, floatLength)); - } - if (byteLength != offset) { - view = new Uint8Array(result, offset); - view.set(new Uint8Array(buffer, offset)); - } - return result; - }; - } - - /** - * Creates an array that is the composition of partially applied arguments, - * placeholders, and provided arguments into a single array of arguments. - * - * @private - * @param {Array|Object} args The provided arguments. - * @param {Array} partials The arguments to prepend to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @returns {Array} Returns the new array of composed arguments. - */ - function composeArgs(args, partials, holders) { - var holdersLength = holders.length, - argsIndex = -1, - argsLength = nativeMax(args.length - holdersLength, 0), - leftIndex = -1, - leftLength = partials.length, - result = Array(argsLength + leftLength); - - while (++leftIndex < leftLength) { - result[leftIndex] = partials[leftIndex]; - } - while (++argsIndex < holdersLength) { - result[holders[argsIndex]] = args[argsIndex]; - } - while (argsLength--) { - result[leftIndex++] = args[argsIndex++]; - } - return result; - } - - /** - * This function is like `composeArgs` except that the arguments composition - * is tailored for `_.partialRight`. - * - * @private - * @param {Array|Object} args The provided arguments. - * @param {Array} partials The arguments to append to those provided. - * @param {Array} holders The `partials` placeholder indexes. - * @returns {Array} Returns the new array of composed arguments. - */ - function composeArgsRight(args, partials, holders) { - var holdersIndex = -1, - holdersLength = holders.length, - argsIndex = -1, - argsLength = nativeMax(args.length - holdersLength, 0), - rightIndex = -1, - rightLength = partials.length, - result = Array(argsLength + rightLength); - - while (++argsIndex < argsLength) { - result[argsIndex] = args[argsIndex]; - } - var offset = argsIndex; - while (++rightIndex < rightLength) { - result[offset + rightIndex] = partials[rightIndex]; - } - while (++holdersIndex < holdersLength) { - result[offset + holders[holdersIndex]] = args[argsIndex++]; - } - return result; - } - - /** - * Creates a function that aggregates a collection, creating an accumulator - * object composed from the results of running each element in the collection - * through an iteratee. - * - * **Note:** This function is used to create `_.countBy`, `_.groupBy`, `_.indexBy`, - * and `_.partition`. - * - * @private - * @param {Function} setter The function to set keys and values of the accumulator object. - * @param {Function} [initializer] The function to initialize the accumulator object. - * @returns {Function} Returns the new aggregator function. - */ - function createAggregator(setter, initializer) { - return function(collection, iteratee, thisArg) { - var result = initializer ? initializer() : {}; - iteratee = getCallback(iteratee, thisArg, 3); - - if (isArray(collection)) { - var index = -1, - length = collection.length; - - while (++index < length) { - var value = collection[index]; - setter(result, value, iteratee(value, index, collection), collection); - } - } else { - baseEach(collection, function(value, key, collection) { - setter(result, value, iteratee(value, key, collection), collection); - }); - } - return result; - }; - } - - /** - * Creates a function that assigns properties of source object(s) to a given - * destination object. - * - * **Note:** This function is used to create `_.assign`, `_.defaults`, and `_.merge`. - * - * @private - * @param {Function} assigner The function to assign values. - * @returns {Function} Returns the new assigner function. - */ - function createAssigner(assigner) { - return restParam(function(object, sources) { - var index = -1, - length = object == null ? 0 : sources.length, - customizer = length > 2 ? sources[length - 2] : undefined, - guard = length > 2 ? sources[2] : undefined, - thisArg = length > 1 ? sources[length - 1] : undefined; - - if (typeof customizer == 'function') { - customizer = bindCallback(customizer, thisArg, 5); - length -= 2; - } else { - customizer = typeof thisArg == 'function' ? thisArg : undefined; - length -= (customizer ? 1 : 0); - } - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined : customizer; - length = 1; - } - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, customizer); - } - } - return object; - }); - } - - /** - * Creates a `baseEach` or `baseEachRight` function. - * - * @private - * @param {Function} eachFunc The function to iterate over a collection. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ - function createBaseEach(eachFunc, fromRight) { - return function(collection, iteratee) { - var length = collection ? getLength(collection) : 0; - if (!isLength(length)) { - return eachFunc(collection, iteratee); - } - var index = fromRight ? length : -1, - iterable = toObject(collection); - - while ((fromRight ? index-- : ++index < length)) { - if (iteratee(iterable[index], index, iterable) === false) { - break; - } - } - return collection; - }; - } - - /** - * Creates a base function for `_.forIn` or `_.forInRight`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ - function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var iterable = toObject(object), - props = keysFunc(object), - length = props.length, - index = fromRight ? length : -1; - - while ((fromRight ? index-- : ++index < length)) { - var key = props[index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; - } - - /** - * Creates a function that wraps `func` and invokes it with the `this` - * binding of `thisArg`. - * - * @private - * @param {Function} func The function to bind. - * @param {*} [thisArg] The `this` binding of `func`. - * @returns {Function} Returns the new bound function. - */ - function createBindWrapper(func, thisArg) { - var Ctor = createCtorWrapper(func); - - function wrapper() { - var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - return fn.apply(thisArg, arguments); - } - return wrapper; - } - - /** - * Creates a `Set` cache object to optimize linear searches of large arrays. - * - * @private - * @param {Array} [values] The values to cache. - * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`. - */ - var createCache = !(nativeCreate && Set) ? constant(null) : function(values) { - return new SetCache(values); - }; - - /** - * Creates a function that produces compound words out of the words in a - * given string. - * - * @private - * @param {Function} callback The function to combine each word. - * @returns {Function} Returns the new compounder function. - */ - function createCompounder(callback) { - return function(string) { - var index = -1, - array = words(deburr(string)), - length = array.length, - result = ''; - - while (++index < length) { - result = callback(result, array[index], index); - } - return result; - }; - } - - /** - * Creates a function that produces an instance of `Ctor` regardless of - * whether it was invoked as part of a `new` expression or by `call` or `apply`. - * - * @private - * @param {Function} Ctor The constructor to wrap. - * @returns {Function} Returns the new wrapped function. - */ - function createCtorWrapper(Ctor) { - return function() { - // Use a `switch` statement to work with class constructors. - // See https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-function-objects-call-thisargument-argumentslist - // for more details. - var args = arguments; - switch (args.length) { - case 0: return new Ctor; - case 1: return new Ctor(args[0]); - case 2: return new Ctor(args[0], args[1]); - case 3: return new Ctor(args[0], args[1], args[2]); - case 4: return new Ctor(args[0], args[1], args[2], args[3]); - case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); - } - var thisBinding = baseCreate(Ctor.prototype), - result = Ctor.apply(thisBinding, args); - - // Mimic the constructor's `return` behavior. - // See https://es5.github.io/#x13.2.2 for more details. - return isObject(result) ? result : thisBinding; - }; - } - - /** - * Creates a `_.curry` or `_.curryRight` function. - * - * @private - * @param {boolean} flag The curry bit flag. - * @returns {Function} Returns the new curry function. - */ - function createCurry(flag) { - function curryFunc(func, arity, guard) { - if (guard && isIterateeCall(func, arity, guard)) { - arity = null; - } - var result = createWrapper(func, flag, null, null, null, null, null, arity); - result.placeholder = curryFunc.placeholder; - return result; - } - return curryFunc; - } - - /** - * Creates a `_.max` or `_.min` function. - * - * @private - * @param {Function} comparator The function used to compare values. - * @param {*} exValue The initial extremum value. - * @returns {Function} Returns the new extremum function. - */ - function createExtremum(comparator, exValue) { - return function(collection, iteratee, thisArg) { - if (thisArg && isIterateeCall(collection, iteratee, thisArg)) { - iteratee = null; - } - iteratee = getCallback(iteratee, thisArg, 3); - if (iteratee.length == 1) { - collection = toIterable(collection); - var result = arrayExtremum(collection, iteratee, comparator, exValue); - if (!(collection.length && result === exValue)) { - return result; - } - } - return baseExtremum(collection, iteratee, comparator, exValue); - }; - } - - /** - * Creates a `_.find` or `_.findLast` function. - * - * @private - * @param {Function} eachFunc The function to iterate over a collection. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new find function. - */ - function createFind(eachFunc, fromRight) { - return function(collection, predicate, thisArg) { - predicate = getCallback(predicate, thisArg, 3); - if (isArray(collection)) { - var index = baseFindIndex(collection, predicate, fromRight); - return index > -1 ? collection[index] : undefined; - } - return baseFind(collection, predicate, eachFunc); - }; - } - - /** - * Creates a `_.findIndex` or `_.findLastIndex` function. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new find function. - */ - function createFindIndex(fromRight) { - return function(array, predicate, thisArg) { - if (!(array && array.length)) { - return -1; - } - predicate = getCallback(predicate, thisArg, 3); - return baseFindIndex(array, predicate, fromRight); - }; - } - - /** - * Creates a `_.findKey` or `_.findLastKey` function. - * - * @private - * @param {Function} objectFunc The function to iterate over an object. - * @returns {Function} Returns the new find function. - */ - function createFindKey(objectFunc) { - return function(object, predicate, thisArg) { - predicate = getCallback(predicate, thisArg, 3); - return baseFind(object, predicate, objectFunc, true); - }; - } - - /** - * Creates a `_.flow` or `_.flowRight` function. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new flow function. - */ - function createFlow(fromRight) { - return function() { - var wrapper, - length = arguments.length, - index = fromRight ? length : -1, - leftIndex = 0, - funcs = Array(length); - - while ((fromRight ? index-- : ++index < length)) { - var func = funcs[leftIndex++] = arguments[index]; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (!wrapper && LodashWrapper.prototype.thru && getFuncName(func) == 'wrapper') { - wrapper = new LodashWrapper([]); - } - } - index = wrapper ? -1 : length; - while (++index < length) { - func = funcs[index]; - - var funcName = getFuncName(func), - data = funcName == 'wrapper' ? getData(func) : null; - - if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) { - wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); - } else { - wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func); - } - } - return function() { - var args = arguments; - if (wrapper && args.length == 1 && isArray(args[0])) { - return wrapper.plant(args[0]).value(); - } - var index = 0, - result = length ? funcs[index].apply(this, args) : args[0]; - - while (++index < length) { - result = funcs[index].call(this, result); - } - return result; - }; - }; - } - - /** - * Creates a function for `_.forEach` or `_.forEachRight`. - * - * @private - * @param {Function} arrayFunc The function to iterate over an array. - * @param {Function} eachFunc The function to iterate over a collection. - * @returns {Function} Returns the new each function. - */ - function createForEach(arrayFunc, eachFunc) { - return function(collection, iteratee, thisArg) { - return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) - ? arrayFunc(collection, iteratee) - : eachFunc(collection, bindCallback(iteratee, thisArg, 3)); - }; - } - - /** - * Creates a function for `_.forIn` or `_.forInRight`. - * - * @private - * @param {Function} objectFunc The function to iterate over an object. - * @returns {Function} Returns the new each function. - */ - function createForIn(objectFunc) { - return function(object, iteratee, thisArg) { - if (typeof iteratee != 'function' || thisArg !== undefined) { - iteratee = bindCallback(iteratee, thisArg, 3); - } - return objectFunc(object, iteratee, keysIn); - }; - } - - /** - * Creates a function for `_.forOwn` or `_.forOwnRight`. - * - * @private - * @param {Function} objectFunc The function to iterate over an object. - * @returns {Function} Returns the new each function. - */ - function createForOwn(objectFunc) { - return function(object, iteratee, thisArg) { - if (typeof iteratee != 'function' || thisArg !== undefined) { - iteratee = bindCallback(iteratee, thisArg, 3); - } - return objectFunc(object, iteratee); - }; - } - - /** - * Creates a function for `_.mapKeys` or `_.mapValues`. - * - * @private - * @param {boolean} [isMapKeys] Specify mapping keys instead of values. - * @returns {Function} Returns the new map function. - */ - function createObjectMapper(isMapKeys) { - return function(object, iteratee, thisArg) { - var result = {}; - iteratee = getCallback(iteratee, thisArg, 3); - - baseForOwn(object, function(value, key, object) { - var mapped = iteratee(value, key, object); - key = isMapKeys ? mapped : key; - value = isMapKeys ? value : mapped; - result[key] = value; - }); - return result; - }; - } - - /** - * Creates a function for `_.padLeft` or `_.padRight`. - * - * @private - * @param {boolean} [fromRight] Specify padding from the right. - * @returns {Function} Returns the new pad function. - */ - function createPadDir(fromRight) { - return function(string, length, chars) { - string = baseToString(string); - return (fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string); - }; - } - - /** - * Creates a `_.partial` or `_.partialRight` function. - * - * @private - * @param {boolean} flag The partial bit flag. - * @returns {Function} Returns the new partial function. - */ - function createPartial(flag) { - var partialFunc = restParam(function(func, partials) { - var holders = replaceHolders(partials, partialFunc.placeholder); - return createWrapper(func, flag, null, partials, holders); - }); - return partialFunc; - } - - /** - * Creates a function for `_.reduce` or `_.reduceRight`. - * - * @private - * @param {Function} arrayFunc The function to iterate over an array. - * @param {Function} eachFunc The function to iterate over a collection. - * @returns {Function} Returns the new each function. - */ - function createReduce(arrayFunc, eachFunc) { - return function(collection, iteratee, accumulator, thisArg) { - var initFromArray = arguments.length < 3; - return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection)) - ? arrayFunc(collection, iteratee, accumulator, initFromArray) - : baseReduce(collection, getCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc); - }; - } - - /** - * Creates a function that wraps `func` and invokes it with optional `this` - * binding of, partial application, and currying. - * - * @private - * @param {Function|string} func The function or method name to reference. - * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details. - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to prepend to those provided to the new function. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [partialsRight] The arguments to append to those provided to the new function. - * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { - var isAry = bitmask & ARY_FLAG, - isBind = bitmask & BIND_FLAG, - isBindKey = bitmask & BIND_KEY_FLAG, - isCurry = bitmask & CURRY_FLAG, - isCurryBound = bitmask & CURRY_BOUND_FLAG, - isCurryRight = bitmask & CURRY_RIGHT_FLAG, - Ctor = isBindKey ? null : createCtorWrapper(func); - - function wrapper() { - // Avoid `arguments` object use disqualifying optimizations by - // converting it to an array before providing it to other functions. - var length = arguments.length, - index = length, - args = Array(length); - - while (index--) { - args[index] = arguments[index]; - } - if (partials) { - args = composeArgs(args, partials, holders); - } - if (partialsRight) { - args = composeArgsRight(args, partialsRight, holdersRight); - } - if (isCurry || isCurryRight) { - var placeholder = wrapper.placeholder, - argsHolders = replaceHolders(args, placeholder); - - length -= argsHolders.length; - if (length < arity) { - var newArgPos = argPos ? arrayCopy(argPos) : null, - newArity = nativeMax(arity - length, 0), - newsHolders = isCurry ? argsHolders : null, - newHoldersRight = isCurry ? null : argsHolders, - newPartials = isCurry ? args : null, - newPartialsRight = isCurry ? null : args; - - bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG); - bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG); - - if (!isCurryBound) { - bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG); - } - var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity], - result = createHybridWrapper.apply(undefined, newData); - - if (isLaziable(func)) { - setData(result, newData); - } - result.placeholder = placeholder; - return result; - } - } - var thisBinding = isBind ? thisArg : this, - fn = isBindKey ? thisBinding[func] : func; - - if (argPos) { - args = reorder(args, argPos); - } - if (isAry && ary < args.length) { - args.length = ary; - } - if (this && this !== root && this instanceof wrapper) { - fn = Ctor || createCtorWrapper(func); - } - return fn.apply(thisBinding, args); - } - return wrapper; - } - - /** - * Creates the padding required for `string` based on the given `length`. - * The `chars` string is truncated if the number of characters exceeds `length`. - * - * @private - * @param {string} string The string to create padding for. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the pad for `string`. - */ - function createPadding(string, length, chars) { - var strLength = string.length; - length = +length; - - if (strLength >= length || !nativeIsFinite(length)) { - return ''; - } - var padLength = length - strLength; - chars = chars == null ? ' ' : (chars + ''); - return repeat(chars, ceil(padLength / chars.length)).slice(0, padLength); - } - - /** - * Creates a function that wraps `func` and invokes it with the optional `this` - * binding of `thisArg` and the `partials` prepended to those provided to - * the wrapper. - * - * @private - * @param {Function} func The function to partially apply arguments to. - * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} partials The arguments to prepend to those provided to the new function. - * @returns {Function} Returns the new bound function. - */ - function createPartialWrapper(func, bitmask, thisArg, partials) { - var isBind = bitmask & BIND_FLAG, - Ctor = createCtorWrapper(func); - - function wrapper() { - // Avoid `arguments` object use disqualifying optimizations by - // converting it to an array before providing it `func`. - var argsIndex = -1, - argsLength = arguments.length, - leftIndex = -1, - leftLength = partials.length, - args = Array(argsLength + leftLength); - - while (++leftIndex < leftLength) { - args[leftIndex] = partials[leftIndex]; - } - while (argsLength--) { - args[leftIndex++] = arguments[++argsIndex]; - } - var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; - return fn.apply(isBind ? thisArg : this, args); - } - return wrapper; - } - - /** - * Creates a `_.sortedIndex` or `_.sortedLastIndex` function. - * - * @private - * @param {boolean} [retHighest] Specify returning the highest qualified index. - * @returns {Function} Returns the new index function. - */ - function createSortedIndex(retHighest) { - return function(array, value, iteratee, thisArg) { - var callback = getCallback(iteratee); - return (iteratee == null && callback === baseCallback) - ? binaryIndex(array, value, retHighest) - : binaryIndexBy(array, value, callback(iteratee, thisArg, 1), retHighest); - }; - } - - /** - * Creates a function that either curries or invokes `func` with optional - * `this` binding and partially applied arguments. - * - * @private - * @param {Function|string} func The function or method name to reference. - * @param {number} bitmask The bitmask of flags. - * The bitmask may be composed of the following flags: - * 1 - `_.bind` - * 2 - `_.bindKey` - * 4 - `_.curry` or `_.curryRight` of a bound function - * 8 - `_.curry` - * 16 - `_.curryRight` - * 32 - `_.partial` - * 64 - `_.partialRight` - * 128 - `_.rearg` - * 256 - `_.ary` - * @param {*} [thisArg] The `this` binding of `func`. - * @param {Array} [partials] The arguments to be partially applied. - * @param {Array} [holders] The `partials` placeholder indexes. - * @param {Array} [argPos] The argument positions of the new function. - * @param {number} [ary] The arity cap of `func`. - * @param {number} [arity] The arity of `func`. - * @returns {Function} Returns the new wrapped function. - */ - function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { - var isBindKey = bitmask & BIND_KEY_FLAG; - if (!isBindKey && typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - var length = partials ? partials.length : 0; - if (!length) { - bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG); - partials = holders = null; - } - length -= (holders ? holders.length : 0); - if (bitmask & PARTIAL_RIGHT_FLAG) { - var partialsRight = partials, - holdersRight = holders; - - partials = holders = null; - } - var data = isBindKey ? null : getData(func), - newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity]; - - if (data) { - mergeData(newData, data); - bitmask = newData[1]; - arity = newData[9]; - } - newData[9] = arity == null - ? (isBindKey ? 0 : func.length) - : (nativeMax(arity - length, 0) || 0); - - if (bitmask == BIND_FLAG) { - var result = createBindWrapper(newData[0], newData[2]); - } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) { - result = createPartialWrapper.apply(undefined, newData); - } else { - result = createHybridWrapper.apply(undefined, newData); - } - var setter = data ? baseSetData : setData; - return setter(result, newData); - } - - /** - * A specialized version of `baseIsEqualDeep` for arrays with support for - * partial deep comparisons. - * - * @private - * @param {Array} array The array to compare. - * @param {Array} other The other array to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparing arrays. - * @param {boolean} [isLoose] Specify performing partial comparisons. - * @param {Array} [stackA] Tracks traversed `value` objects. - * @param {Array} [stackB] Tracks traversed `other` objects. - * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. - */ - function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) { - var index = -1, - arrLength = array.length, - othLength = other.length; - - if (arrLength != othLength && !(isLoose && othLength > arrLength)) { - return false; - } - // Ignore non-index properties. - while (++index < arrLength) { - var arrValue = array[index], - othValue = other[index], - result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined; - - if (result !== undefined) { - if (result) { - continue; - } - return false; - } - // Recursively compare arrays (susceptible to call stack limits). - if (isLoose) { - if (!arraySome(other, function(othValue) { - return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB); - })) { - return false; - } - } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) { - return false; - } - } - return true; - } - - /** - * A specialized version of `baseIsEqualDeep` for comparing objects of - * the same `toStringTag`. - * - * **Note:** This function only supports comparing values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} value The object to compare. - * @param {Object} other The other object to compare. - * @param {string} tag The `toStringTag` of the objects to compare. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalByTag(object, other, tag) { - switch (tag) { - case boolTag: - case dateTag: - // Coerce dates and booleans to numbers, dates to milliseconds and booleans - // to `1` or `0` treating invalid dates coerced to `NaN` as not equal. - return +object == +other; - - case errorTag: - return object.name == other.name && object.message == other.message; - - case numberTag: - // Treat `NaN` vs. `NaN` as equal. - return (object != +object) - ? other != +other - : object == +other; - - case regexpTag: - case stringTag: - // Coerce regexes to strings and treat strings primitives and string - // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details. - return object == (other + ''); - } - return false; - } - - /** - * A specialized version of `baseIsEqualDeep` for objects with support for - * partial deep comparisons. - * - * @private - * @param {Object} object The object to compare. - * @param {Object} other The other object to compare. - * @param {Function} equalFunc The function to determine equivalents of values. - * @param {Function} [customizer] The function to customize comparing values. - * @param {boolean} [isLoose] Specify performing partial comparisons. - * @param {Array} [stackA] Tracks traversed `value` objects. - * @param {Array} [stackB] Tracks traversed `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. - */ - function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) { - var objProps = keys(object), - objLength = objProps.length, - othProps = keys(other), - othLength = othProps.length; - - if (objLength != othLength && !isLoose) { - return false; - } - var index = objLength; - while (index--) { - var key = objProps[index]; - if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) { - return false; - } - } - var skipCtor = isLoose; - while (++index < objLength) { - key = objProps[index]; - var objValue = object[key], - othValue = other[key], - result = customizer ? customizer(isLoose ? othValue : objValue, isLoose? objValue : othValue, key) : undefined; - - // Recursively compare objects (susceptible to call stack limits). - if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) { - return false; - } - skipCtor || (skipCtor = key == 'constructor'); - } - if (!skipCtor) { - var objCtor = object.constructor, - othCtor = other.constructor; - - // Non `Object` object instances with different constructors are not equal. - if (objCtor != othCtor && - ('constructor' in object && 'constructor' in other) && - !(typeof objCtor == 'function' && objCtor instanceof objCtor && - typeof othCtor == 'function' && othCtor instanceof othCtor)) { - return false; - } - } - return true; - } - - /** - * Gets the appropriate "callback" function. If the `_.callback` method is - * customized this function returns the custom method, otherwise it returns - * the `baseCallback` function. If arguments are provided the chosen function - * is invoked with them and its result is returned. - * - * @private - * @returns {Function} Returns the chosen function or its result. - */ - function getCallback(func, thisArg, argCount) { - var result = lodash.callback || callback; - result = result === callback ? baseCallback : result; - return argCount ? result(func, thisArg, argCount) : result; - } - - /** - * Gets metadata for `func`. - * - * @private - * @param {Function} func The function to query. - * @returns {*} Returns the metadata for `func`. - */ - var getData = !metaMap ? noop : function(func) { - return metaMap.get(func); - }; - - /** - * Gets the name of `func`. - * - * @private - * @param {Function} func The function to query. - * @returns {string} Returns the function name. - */ - function getFuncName(func) { - var result = func.name, - array = realNames[result], - length = array ? array.length : 0; - - while (length--) { - var data = array[length], - otherFunc = data.func; - if (otherFunc == null || otherFunc == func) { - return data.name; - } - } - return result; - } - - /** - * Gets the appropriate "indexOf" function. If the `_.indexOf` method is - * customized this function returns the custom method, otherwise it returns - * the `baseIndexOf` function. If arguments are provided the chosen function - * is invoked with them and its result is returned. - * - * @private - * @returns {Function|number} Returns the chosen function or its result. - */ - function getIndexOf(collection, target, fromIndex) { - var result = lodash.indexOf || indexOf; - result = result === indexOf ? baseIndexOf : result; - return collection ? result(collection, target, fromIndex) : result; - } - - /** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ - var getLength = baseProperty('length'); - - /** - * Gets the propery names, values, and compare flags of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the match data of `object`. - */ - function getMatchData(object) { - var result = pairs(object), - length = result.length; - - while (length--) { - result[length][2] = isStrictComparable(result[length][1]); - } - return result; - } - - /** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ - function getNative(object, key) { - var value = object == null ? undefined : object[key]; - return isNative(value) ? value : undefined; - } - - /** - * Gets the view, applying any `transforms` to the `start` and `end` positions. - * - * @private - * @param {number} start The start of the view. - * @param {number} end The end of the view. - * @param {Array} [transforms] The transformations to apply to the view. - * @returns {Object} Returns an object containing the `start` and `end` - * positions of the view. - */ - function getView(start, end, transforms) { - var index = -1, - length = transforms ? transforms.length : 0; - - while (++index < length) { - var data = transforms[index], - size = data.size; - - switch (data.type) { - case 'drop': start += size; break; - case 'dropRight': end -= size; break; - case 'take': end = nativeMin(end, start + size); break; - case 'takeRight': start = nativeMax(start, end - size); break; - } - } - return { 'start': start, 'end': end }; - } - - /** - * Initializes an array clone. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. - */ - function initCloneArray(array) { - var length = array.length, - result = new array.constructor(length); - - // Add array properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; - } - return result; - } - - /** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneObject(object) { - var Ctor = object.constructor; - if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) { - Ctor = Object; - } - return new Ctor; - } - - /** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ - function initCloneByTag(object, tag, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return bufferClone(object); - - case boolTag: - case dateTag: - return new Ctor(+object); - - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - var buffer = object.buffer; - return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length); - - case numberTag: - case stringTag: - return new Ctor(object); - - case regexpTag: - var result = new Ctor(object.source, reFlags.exec(object)); - result.lastIndex = object.lastIndex; - } - return result; - } - - /** - * Invokes the method at `path` on `object`. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} path The path of the method to invoke. - * @param {Array} args The arguments to invoke the method with. - * @returns {*} Returns the result of the invoked method. - */ - function invokePath(object, path, args) { - if (object != null && !isKey(path, object)) { - path = toPath(path); - object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); - path = last(path); - } - var func = object == null ? object : object[path]; - return func == null ? undefined : func.apply(object, args); - } - - /** - * Checks if `value` is array-like. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - */ - function isArrayLike(value) { - return value != null && isLength(getLength(value)); - } - - /** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ - function isIndex(value, length) { - value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; - } - - /** - * Checks if the provided arguments are from an iteratee call. - * - * @private - * @param {*} value The potential iteratee value argument. - * @param {*} index The potential iteratee index or key argument. - * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. - */ - function isIterateeCall(value, index, object) { - if (!isObject(object)) { - return false; - } - var type = typeof index; - if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object)) { - var other = object[index]; - return value === value ? (value === other) : (other !== other); - } - return false; - } - - /** - * Checks if `value` is a property name and not a property path. - * - * @private - * @param {*} value The value to check. - * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. - */ - function isKey(value, object) { - var type = typeof value; - if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') { - return true; - } - if (isArray(value)) { - return false; - } - var result = !reIsDeepProp.test(value); - return result || (object != null && value in toObject(object)); - } - - /** - * Checks if `func` has a lazy counterpart. - * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`. - */ - function isLaziable(func) { - var funcName = getFuncName(func); - if (!(funcName in LazyWrapper.prototype)) { - return false; - } - var other = lodash[funcName]; - if (func === other) { - return true; - } - var data = getData(other); - return !!data && func === data[0]; - } - - /** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - */ - function isLength(value) { - return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - - /** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. - */ - function isStrictComparable(value) { - return value === value && !isObject(value); - } - - /** - * Merges the function metadata of `source` into `data`. - * - * Merging metadata reduces the number of wrappers required to invoke a function. - * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` - * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg` - * augment function arguments, making the order in which they are executed important, - * preventing the merging of metadata. However, we make an exception for a safe - * common case where curried functions have `_.ary` and or `_.rearg` applied. - * - * @private - * @param {Array} data The destination metadata. - * @param {Array} source The source metadata. - * @returns {Array} Returns `data`. - */ - function mergeData(data, source) { - var bitmask = data[1], - srcBitmask = source[1], - newBitmask = bitmask | srcBitmask, - isCommon = newBitmask < ARY_FLAG; - - var isCombo = - (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) || - (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) || - (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG); - - // Exit early if metadata can't be merged. - if (!(isCommon || isCombo)) { - return data; - } - // Use source `thisArg` if available. - if (srcBitmask & BIND_FLAG) { - data[2] = source[2]; - // Set when currying a bound function. - newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG; - } - // Compose partial arguments. - var value = source[3]; - if (value) { - var partials = data[3]; - data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value); - data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]); - } - // Compose partial right arguments. - value = source[5]; - if (value) { - partials = data[5]; - data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value); - data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]); - } - // Use source `argPos` if available. - value = source[7]; - if (value) { - data[7] = arrayCopy(value); - } - // Use source `ary` if it's smaller. - if (srcBitmask & ARY_FLAG) { - data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); - } - // Use source `arity` if one is not provided. - if (data[9] == null) { - data[9] = source[9]; - } - // Use source `func` and merge bitmasks. - data[0] = source[0]; - data[1] = newBitmask; - - return data; - } - - /** - * A specialized version of `_.pick` which picks `object` properties specified - * by `props`. - * - * @private - * @param {Object} object The source object. - * @param {string[]} props The property names to pick. - * @returns {Object} Returns the new object. - */ - function pickByArray(object, props) { - object = toObject(object); - - var index = -1, - length = props.length, - result = {}; - - while (++index < length) { - var key = props[index]; - if (key in object) { - result[key] = object[key]; - } - } - return result; - } - - /** - * A specialized version of `_.pick` which picks `object` properties `predicate` - * returns truthy for. - * - * @private - * @param {Object} object The source object. - * @param {Function} predicate The function invoked per iteration. - * @returns {Object} Returns the new object. - */ - function pickByCallback(object, predicate) { - var result = {}; - baseForIn(object, function(value, key, object) { - if (predicate(value, key, object)) { - result[key] = value; - } - }); - return result; - } - - /** - * Reorder `array` according to the specified indexes where the element at - * the first index is assigned as the first element, the element at - * the second index is assigned as the second element, and so on. - * - * @private - * @param {Array} array The array to reorder. - * @param {Array} indexes The arranged array indexes. - * @returns {Array} Returns `array`. - */ - function reorder(array, indexes) { - var arrLength = array.length, - length = nativeMin(indexes.length, arrLength), - oldArray = arrayCopy(array); - - while (length--) { - var index = indexes[length]; - array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; - } - return array; - } - - /** - * Sets metadata for `func`. - * - * **Note:** If this function becomes hot, i.e. is invoked a lot in a short - * period of time, it will trip its breaker and transition to an identity function - * to avoid garbage collection pauses in V8. See [V8 issue 2070](https://code.google.com/p/v8/issues/detail?id=2070) - * for more details. - * - * @private - * @param {Function} func The function to associate metadata with. - * @param {*} data The metadata. - * @returns {Function} Returns `func`. - */ - var setData = (function() { - var count = 0, - lastCalled = 0; - - return function(key, value) { - var stamp = now(), - remaining = HOT_SPAN - (stamp - lastCalled); - - lastCalled = stamp; - if (remaining > 0) { - if (++count >= HOT_COUNT) { - return key; - } - } else { - count = 0; - } - return baseSetData(key, value); - }; - }()); - - /** - * A fallback implementation of `_.isPlainObject` which checks if `value` - * is an object created by the `Object` constructor or has a `[[Prototype]]` - * of `null`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - */ - function shimIsPlainObject(value) { - var Ctor, - support = lodash.support; - - // Exit early for non `Object` objects. - if (!(isObjectLike(value) && objToString.call(value) == objectTag) || - (!hasOwnProperty.call(value, 'constructor') && - (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) { - return false; - } - // IE < 9 iterates inherited properties before own properties. If the first - // iterated property is an object's own property then there are no inherited - // enumerable properties. - var result; - // In most environments an object's own properties are iterated before - // its inherited properties. If the last iterated property is an object's - // own property then there are no inherited enumerable properties. - baseForIn(value, function(subValue, key) { - result = key; - }); - return result === undefined || hasOwnProperty.call(value, result); - } - - /** - * A fallback implementation of `Object.keys` which creates an array of the - * own enumerable property names of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ - function shimKeys(object) { - var props = keysIn(object), - propsLength = props.length, - length = propsLength && object.length; - - var allowIndexes = !!length && isLength(length) && - (isArray(object) || isArguments(object)); - - var index = -1, - result = []; - - while (++index < propsLength) { - var key = props[index]; - if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) { - result.push(key); - } - } - return result; - } - - /** - * Converts `value` to an array-like object if it's not one. - * - * @private - * @param {*} value The value to process. - * @returns {Array|Object} Returns the array-like object. - */ - function toIterable(value) { - if (value == null) { - return []; - } - if (!isArrayLike(value)) { - return values(value); - } - return isObject(value) ? value : Object(value); - } - - /** - * Converts `value` to an object if it's not one. - * - * @private - * @param {*} value The value to process. - * @returns {Object} Returns the object. - */ - function toObject(value) { - return isObject(value) ? value : Object(value); - } - - /** - * Converts `value` to property path array if it's not one. - * - * @private - * @param {*} value The value to process. - * @returns {Array} Returns the property path array. - */ - function toPath(value) { - if (isArray(value)) { - return value; - } - var result = []; - baseToString(value).replace(rePropName, function(match, number, quote, string) { - result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); - }); - return result; - } - - /** - * Creates a clone of `wrapper`. - * - * @private - * @param {Object} wrapper The wrapper to clone. - * @returns {Object} Returns the cloned wrapper. - */ - function wrapperClone(wrapper) { - return wrapper instanceof LazyWrapper - ? wrapper.clone() - : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__)); - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates an array of elements split into groups the length of `size`. - * If `collection` can't be split evenly, the final chunk will be the remaining - * elements. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to process. - * @param {number} [size=1] The length of each chunk. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the new array containing chunks. - * @example - * - * _.chunk(['a', 'b', 'c', 'd'], 2); - * // => [['a', 'b'], ['c', 'd']] - * - * _.chunk(['a', 'b', 'c', 'd'], 3); - * // => [['a', 'b', 'c'], ['d']] - */ - function chunk(array, size, guard) { - if (guard ? isIterateeCall(array, size, guard) : size == null) { - size = 1; - } else { - size = nativeMax(+size || 1, 1); - } - var index = 0, - length = array ? array.length : 0, - resIndex = -1, - result = Array(ceil(length / size)); - - while (index < length) { - result[++resIndex] = baseSlice(array, index, (index += size)); - } - return result; - } - - /** - * Creates an array with all falsey values removed. The values `false`, `null`, - * `0`, `""`, `undefined`, and `NaN` are falsey. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to compact. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.compact([0, 1, false, 2, '', 3]); - * // => [1, 2, 3] - */ - function compact(array) { - var index = -1, - length = array ? array.length : 0, - resIndex = -1, - result = []; - - while (++index < length) { - var value = array[index]; - if (value) { - result[++resIndex] = value; - } - } - return result; - } - - /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The arrays of values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.difference([1, 2, 3], [4, 2]); - * // => [1, 3] - */ - var difference = restParam(function(array, values) { - return isArrayLike(array) - ? baseDifference(array, baseFlatten(values, false, true)) - : []; - }); - - /** - * Creates a slice of `array` with `n` elements dropped from the beginning. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.drop([1, 2, 3]); - * // => [2, 3] - * - * _.drop([1, 2, 3], 2); - * // => [3] - * - * _.drop([1, 2, 3], 5); - * // => [] - * - * _.drop([1, 2, 3], 0); - * // => [1, 2, 3] - */ - function drop(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - return baseSlice(array, n < 0 ? 0 : n); - } - - /** - * Creates a slice of `array` with `n` elements dropped from the end. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropRight([1, 2, 3]); - * // => [1, 2] - * - * _.dropRight([1, 2, 3], 2); - * // => [1] - * - * _.dropRight([1, 2, 3], 5); - * // => [] - * - * _.dropRight([1, 2, 3], 0); - * // => [1, 2, 3] - */ - function dropRight(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - n = length - (+n || 0); - return baseSlice(array, 0, n < 0 ? 0 : n); - } - - /** - * Creates a slice of `array` excluding elements dropped from the end. - * Elements are dropped until `predicate` returns falsey. The predicate is - * bound to `thisArg` and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that match the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropRightWhile([1, 2, 3], function(n) { - * return n > 1; - * }); - * // => [1] - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.dropRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user'); - * // => ['barney', 'fred'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.dropRightWhile(users, 'active', false), 'user'); - * // => ['barney'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.dropRightWhile(users, 'active'), 'user'); - * // => ['barney', 'fred', 'pebbles'] - */ - function dropRightWhile(array, predicate, thisArg) { - return (array && array.length) - ? baseWhile(array, getCallback(predicate, thisArg, 3), true, true) - : []; - } - - /** - * Creates a slice of `array` excluding elements dropped from the beginning. - * Elements are dropped until `predicate` returns falsey. The predicate is - * bound to `thisArg` and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.dropWhile([1, 2, 3], function(n) { - * return n < 3; - * }); - * // => [3] - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.dropWhile(users, { 'user': 'barney', 'active': false }), 'user'); - * // => ['fred', 'pebbles'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.dropWhile(users, 'active', false), 'user'); - * // => ['pebbles'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.dropWhile(users, 'active'), 'user'); - * // => ['barney', 'fred', 'pebbles'] - */ - function dropWhile(array, predicate, thisArg) { - return (array && array.length) - ? baseWhile(array, getCallback(predicate, thisArg, 3), true) - : []; - } - - /** - * Fills elements of `array` with `value` from `start` up to, but not - * including, `end`. - * - * **Note:** This method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3]; - * - * _.fill(array, 'a'); - * console.log(array); - * // => ['a', 'a', 'a'] - * - * _.fill(Array(3), 2); - * // => [2, 2, 2] - * - * _.fill([4, 6, 8], '*', 1, 2); - * // => [4, '*', 8] - */ - function fill(array, value, start, end) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { - start = 0; - end = length; - } - return baseFill(array, value, start, end); - } - - /** - * This method is like `_.find` except that it returns the index of the first - * element `predicate` returns truthy for instead of the element itself. - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * _.findIndex(users, function(chr) { - * return chr.user == 'barney'; - * }); - * // => 0 - * - * // using the `_.matches` callback shorthand - * _.findIndex(users, { 'user': 'fred', 'active': false }); - * // => 1 - * - * // using the `_.matchesProperty` callback shorthand - * _.findIndex(users, 'active', false); - * // => 0 - * - * // using the `_.property` callback shorthand - * _.findIndex(users, 'active'); - * // => 2 - */ - var findIndex = createFindIndex(); - - /** - * This method is like `_.findIndex` except that it iterates over elements - * of `collection` from right to left. - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {number} Returns the index of the found element, else `-1`. - * @example - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * _.findLastIndex(users, function(chr) { - * return chr.user == 'pebbles'; - * }); - * // => 2 - * - * // using the `_.matches` callback shorthand - * _.findLastIndex(users, { 'user': 'barney', 'active': true }); - * // => 0 - * - * // using the `_.matchesProperty` callback shorthand - * _.findLastIndex(users, 'active', false); - * // => 2 - * - * // using the `_.property` callback shorthand - * _.findLastIndex(users, 'active'); - * // => 0 - */ - var findLastIndex = createFindIndex(true); - - /** - * Gets the first element of `array`. - * - * @static - * @memberOf _ - * @alias head - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the first element of `array`. - * @example - * - * _.first([1, 2, 3]); - * // => 1 - * - * _.first([]); - * // => undefined - */ - function first(array) { - return array ? array[0] : undefined; - } - - /** - * Flattens a nested array. If `isDeep` is `true` the array is recursively - * flattened, otherwise it is only flattened a single level. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to flatten. - * @param {boolean} [isDeep] Specify a deep flatten. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flatten([1, [2, 3, [4]]]); - * // => [1, 2, 3, [4]] - * - * // using `isDeep` - * _.flatten([1, [2, 3, [4]]], true); - * // => [1, 2, 3, 4] - */ - function flatten(array, isDeep, guard) { - var length = array ? array.length : 0; - if (guard && isIterateeCall(array, isDeep, guard)) { - isDeep = false; - } - return length ? baseFlatten(array, isDeep) : []; - } - - /** - * Recursively flattens a nested array. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to recursively flatten. - * @returns {Array} Returns the new flattened array. - * @example - * - * _.flattenDeep([1, [2, 3, [4]]]); - * // => [1, 2, 3, 4] - */ - function flattenDeep(array) { - var length = array ? array.length : 0; - return length ? baseFlatten(array, true) : []; - } - - /** - * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it is used as the offset - * from the end of `array`. If `array` is sorted providing `true` for `fromIndex` - * performs a faster binary search. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {boolean|number} [fromIndex=0] The index to search from or `true` - * to perform a binary search on a sorted array. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.indexOf([1, 2, 1, 2], 2); - * // => 1 - * - * // using `fromIndex` - * _.indexOf([1, 2, 1, 2], 2, 2); - * // => 3 - * - * // performing a binary search - * _.indexOf([1, 1, 2, 2], 2, true); - * // => 2 - */ - function indexOf(array, value, fromIndex) { - var length = array ? array.length : 0; - if (!length) { - return -1; - } - if (typeof fromIndex == 'number') { - fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex; - } else if (fromIndex) { - var index = binaryIndex(array, value), - other = array[index]; - - if (value === value ? (value === other) : (other !== other)) { - return index; - } - return -1; - } - return baseIndexOf(array, value, fromIndex || 0); - } - - /** - * Gets all but the last element of `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.initial([1, 2, 3]); - * // => [1, 2] - */ - function initial(array) { - return dropRight(array, 1); - } - - /** - * Creates an array of unique values that are included in all of the provided - * arrays using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of shared values. - * @example - * _.intersection([1, 2], [4, 2], [2, 1]); - * // => [2] - */ - var intersection = restParam(function(arrays) { - var othLength = arrays.length, - othIndex = othLength, - caches = Array(length), - indexOf = getIndexOf(), - isCommon = indexOf == baseIndexOf, - result = []; - - while (othIndex--) { - var value = arrays[othIndex] = isArrayLike(value = arrays[othIndex]) ? value : []; - caches[othIndex] = (isCommon && value.length >= 120) ? createCache(othIndex && value) : null; - } - var array = arrays[0], - index = -1, - length = array ? array.length : 0, - seen = caches[0]; - - outer: - while (++index < length) { - value = array[index]; - if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value, 0)) < 0) { - var othIndex = othLength; - while (--othIndex) { - var cache = caches[othIndex]; - if ((cache ? cacheIndexOf(cache, value) : indexOf(arrays[othIndex], value, 0)) < 0) { - continue outer; - } - } - if (seen) { - seen.push(value); - } - result.push(value); - } - } - return result; - }); - - /** - * Gets the last element of `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @returns {*} Returns the last element of `array`. - * @example - * - * _.last([1, 2, 3]); - * // => 3 - */ - function last(array) { - var length = array ? array.length : 0; - return length ? array[length - 1] : undefined; - } - - /** - * This method is like `_.indexOf` except that it iterates over elements of - * `array` from right to left. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {boolean|number} [fromIndex=array.length-1] The index to search from - * or `true` to perform a binary search on a sorted array. - * @returns {number} Returns the index of the matched value, else `-1`. - * @example - * - * _.lastIndexOf([1, 2, 1, 2], 2); - * // => 3 - * - * // using `fromIndex` - * _.lastIndexOf([1, 2, 1, 2], 2, 2); - * // => 1 - * - * // performing a binary search - * _.lastIndexOf([1, 1, 2, 2], 2, true); - * // => 3 - */ - function lastIndexOf(array, value, fromIndex) { - var length = array ? array.length : 0; - if (!length) { - return -1; - } - var index = length; - if (typeof fromIndex == 'number') { - index = (fromIndex < 0 ? nativeMax(length + fromIndex, 0) : nativeMin(fromIndex || 0, length - 1)) + 1; - } else if (fromIndex) { - index = binaryIndex(array, value, true) - 1; - var other = array[index]; - if (value === value ? (value === other) : (other !== other)) { - return index; - } - return -1; - } - if (value !== value) { - return indexOfNaN(array, index, true); - } - while (index--) { - if (array[index] === value) { - return index; - } - } - return -1; - } - - /** - * Removes all provided values from `array` using - * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. - * - * **Note:** Unlike `_.without`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {...*} [values] The values to remove. - * @returns {Array} Returns `array`. - * @example - * - * var array = [1, 2, 3, 1, 2, 3]; - * - * _.pull(array, 2, 3); - * console.log(array); - * // => [1, 1] - */ - function pull() { - var args = arguments, - array = args[0]; - - if (!(array && array.length)) { - return array; - } - var index = 0, - indexOf = getIndexOf(), - length = args.length; - - while (++index < length) { - var fromIndex = 0, - value = args[index]; - - while ((fromIndex = indexOf(array, value, fromIndex)) > -1) { - splice.call(array, fromIndex, 1); - } - } - return array; - } - - /** - * Removes elements from `array` corresponding to the given indexes and returns - * an array of the removed elements. Indexes may be specified as an array of - * indexes or as individual arguments. - * - * **Note:** Unlike `_.at`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {...(number|number[])} [indexes] The indexes of elements to remove, - * specified as individual indexes or arrays of indexes. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = [5, 10, 15, 20]; - * var evens = _.pullAt(array, 1, 3); - * - * console.log(array); - * // => [5, 15] - * - * console.log(evens); - * // => [10, 20] - */ - var pullAt = restParam(function(array, indexes) { - indexes = baseFlatten(indexes); - - var result = baseAt(array, indexes); - basePullAt(array, indexes.sort(baseCompareAscending)); - return result; - }); - - /** - * Removes all elements from `array` that `predicate` returns truthy for - * and returns an array of the removed elements. The predicate is bound to - * `thisArg` and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * **Note:** Unlike `_.filter`, this method mutates `array`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to modify. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the new array of removed elements. - * @example - * - * var array = [1, 2, 3, 4]; - * var evens = _.remove(array, function(n) { - * return n % 2 == 0; - * }); - * - * console.log(array); - * // => [1, 3] - * - * console.log(evens); - * // => [2, 4] - */ - function remove(array, predicate, thisArg) { - var result = []; - if (!(array && array.length)) { - return result; - } - var index = -1, - indexes = [], - length = array.length; - - predicate = getCallback(predicate, thisArg, 3); - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result.push(value); - indexes.push(index); - } - } - basePullAt(array, indexes); - return result; - } - - /** - * Gets all but the first element of `array`. - * - * @static - * @memberOf _ - * @alias tail - * @category Array - * @param {Array} array The array to query. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.rest([1, 2, 3]); - * // => [2, 3] - */ - function rest(array) { - return drop(array, 1); - } - - /** - * Creates a slice of `array` from `start` up to, but not including, `end`. - * - * **Note:** This method is used instead of `Array#slice` to support node - * lists in IE < 9 and to ensure dense arrays are returned. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ - function slice(array, start, end) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { - start = 0; - end = length; - } - return baseSlice(array, start, end); - } - - /** - * Uses a binary search to determine the lowest index at which `value` should - * be inserted into `array` in order to maintain its sort order. If an iteratee - * function is provided it is invoked for `value` and each element of `array` - * to compute their sort ranking. The iteratee is bound to `thisArg` and - * invoked with one argument; (value). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * _.sortedIndex([30, 50], 40); - * // => 1 - * - * _.sortedIndex([4, 4, 5, 5], 5); - * // => 2 - * - * var dict = { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } }; - * - * // using an iteratee function - * _.sortedIndex(['thirty', 'fifty'], 'forty', function(word) { - * return this.data[word]; - * }, dict); - * // => 1 - * - * // using the `_.property` callback shorthand - * _.sortedIndex([{ 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); - * // => 1 - */ - var sortedIndex = createSortedIndex(); - - /** - * This method is like `_.sortedIndex` except that it returns the highest - * index at which `value` should be inserted into `array` in order to - * maintain its sort order. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The sorted array to inspect. - * @param {*} value The value to evaluate. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {number} Returns the index at which `value` should be inserted - * into `array`. - * @example - * - * _.sortedLastIndex([4, 4, 5, 5], 5); - * // => 4 - */ - var sortedLastIndex = createSortedIndex(true); - - /** - * Creates a slice of `array` with `n` elements taken from the beginning. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.take([1, 2, 3]); - * // => [1] - * - * _.take([1, 2, 3], 2); - * // => [1, 2] - * - * _.take([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.take([1, 2, 3], 0); - * // => [] - */ - function take(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - return baseSlice(array, 0, n < 0 ? 0 : n); - } - - /** - * Creates a slice of `array` with `n` elements taken from the end. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to take. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeRight([1, 2, 3]); - * // => [3] - * - * _.takeRight([1, 2, 3], 2); - * // => [2, 3] - * - * _.takeRight([1, 2, 3], 5); - * // => [1, 2, 3] - * - * _.takeRight([1, 2, 3], 0); - * // => [] - */ - function takeRight(array, n, guard) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (guard ? isIterateeCall(array, n, guard) : n == null) { - n = 1; - } - n = length - (+n || 0); - return baseSlice(array, n < 0 ? 0 : n); - } - - /** - * Creates a slice of `array` with elements taken from the end. Elements are - * taken until `predicate` returns falsey. The predicate is bound to `thisArg` - * and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeRightWhile([1, 2, 3], function(n) { - * return n > 1; - * }); - * // => [2, 3] - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false }, - * { 'user': 'pebbles', 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.takeRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user'); - * // => ['pebbles'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.takeRightWhile(users, 'active', false), 'user'); - * // => ['fred', 'pebbles'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.takeRightWhile(users, 'active'), 'user'); - * // => [] - */ - function takeRightWhile(array, predicate, thisArg) { - return (array && array.length) - ? baseWhile(array, getCallback(predicate, thisArg, 3), false, true) - : []; - } - - /** - * Creates a slice of `array` with elements taken from the beginning. Elements - * are taken until `predicate` returns falsey. The predicate is bound to - * `thisArg` and invoked with three arguments: (value, index, array). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the slice of `array`. - * @example - * - * _.takeWhile([1, 2, 3], function(n) { - * return n < 3; - * }); - * // => [1, 2] - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false}, - * { 'user': 'pebbles', 'active': true } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.takeWhile(users, { 'user': 'barney', 'active': false }), 'user'); - * // => ['barney'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.takeWhile(users, 'active', false), 'user'); - * // => ['barney', 'fred'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.takeWhile(users, 'active'), 'user'); - * // => [] - */ - function takeWhile(array, predicate, thisArg) { - return (array && array.length) - ? baseWhile(array, getCallback(predicate, thisArg, 3)) - : []; - } - - /** - * Creates an array of unique values, in order, from all of the provided arrays - * using [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of combined values. - * @example - * - * _.union([1, 2], [4, 2], [2, 1]); - * // => [1, 2, 4] - */ - var union = restParam(function(arrays) { - return baseUniq(baseFlatten(arrays, false, true)); - }); - - /** - * Creates a duplicate-free version of an array, using - * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons, in which only the first occurence of each element - * is kept. Providing `true` for `isSorted` performs a faster search algorithm - * for sorted arrays. If an iteratee function is provided it is invoked for - * each element in the array to generate the criterion by which uniqueness - * is computed. The `iteratee` is bound to `thisArg` and invoked with three - * arguments: (value, index, array). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias unique - * @category Array - * @param {Array} array The array to inspect. - * @param {boolean} [isSorted] Specify the array is sorted. - * @param {Function|Object|string} [iteratee] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new duplicate-value-free array. - * @example - * - * _.uniq([2, 1, 2]); - * // => [2, 1] - * - * // using `isSorted` - * _.uniq([1, 1, 2], true); - * // => [1, 2] - * - * // using an iteratee function - * _.uniq([1, 2.5, 1.5, 2], function(n) { - * return this.floor(n); - * }, Math); - * // => [1, 2.5] - * - * // using the `_.property` callback shorthand - * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - function uniq(array, isSorted, iteratee, thisArg) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - if (isSorted != null && typeof isSorted != 'boolean') { - thisArg = iteratee; - iteratee = isIterateeCall(array, isSorted, thisArg) ? null : isSorted; - isSorted = false; - } - var callback = getCallback(); - if (!(iteratee == null && callback === baseCallback)) { - iteratee = callback(iteratee, thisArg, 3); - } - return (isSorted && getIndexOf() == baseIndexOf) - ? sortedUniq(array, iteratee) - : baseUniq(array, iteratee); - } - - /** - * This method is like `_.zip` except that it accepts an array of grouped - * elements and creates an array regrouping the elements to their pre-zip - * configuration. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array of grouped elements to process. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]); - * // => [['fred', 30, true], ['barney', 40, false]] - * - * _.unzip(zipped); - * // => [['fred', 'barney'], [30, 40], [true, false]] - */ - function unzip(array) { - if (!(array && array.length)) { - return []; - } - var index = -1, - length = 0; - - array = arrayFilter(array, function(group) { - if (isArrayLike(group)) { - length = nativeMax(group.length, length); - return true; - } - }); - var result = Array(length); - while (++index < length) { - result[index] = arrayMap(array, baseProperty(index)); - } - return result; - } - - /** - * This method is like `_.unzip` except that it accepts an iteratee to specify - * how regrouped values should be combined. The `iteratee` is bound to `thisArg` - * and invoked with four arguments: (accumulator, value, index, group). - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array of grouped elements to process. - * @param {Function} [iteratee] The function to combine regrouped values. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new array of regrouped elements. - * @example - * - * var zipped = _.zip([1, 2], [10, 20], [100, 200]); - * // => [[1, 10, 100], [2, 20, 200]] - * - * _.unzipWith(zipped, _.add); - * // => [3, 30, 300] - */ - function unzipWith(array, iteratee, thisArg) { - var length = array ? array.length : 0; - if (!length) { - return []; - } - var result = unzip(array); - if (iteratee == null) { - return result; - } - iteratee = bindCallback(iteratee, thisArg, 4); - return arrayMap(result, function(group) { - return arrayReduce(group, iteratee, undefined, true); - }); - } - - /** - * Creates an array excluding all provided values using - * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. - * - * @static - * @memberOf _ - * @category Array - * @param {Array} array The array to filter. - * @param {...*} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. - * @example - * - * _.without([1, 2, 1, 3], 1, 2); - * // => [3] - */ - var without = restParam(function(array, values) { - return isArrayLike(array) - ? baseDifference(array, values) - : []; - }); - - /** - * Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) - * of the provided arrays. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to inspect. - * @returns {Array} Returns the new array of values. - * @example - * - * _.xor([1, 2], [4, 2]); - * // => [1, 4] - */ - function xor() { - var index = -1, - length = arguments.length; - - while (++index < length) { - var array = arguments[index]; - if (isArrayLike(array)) { - var result = result - ? baseDifference(result, array).concat(baseDifference(array, result)) - : array; - } - } - return result ? baseUniq(result) : []; - } - - /** - * Creates an array of grouped elements, the first of which contains the first - * elements of the given arrays, the second of which contains the second elements - * of the given arrays, and so on. - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @returns {Array} Returns the new array of grouped elements. - * @example - * - * _.zip(['fred', 'barney'], [30, 40], [true, false]); - * // => [['fred', 30, true], ['barney', 40, false]] - */ - var zip = restParam(unzip); - - /** - * The inverse of `_.pairs`; this method returns an object composed from arrays - * of property names and values. Provide either a single two dimensional array, - * e.g. `[[key1, value1], [key2, value2]]` or two arrays, one of property names - * and one of corresponding values. - * - * @static - * @memberOf _ - * @alias object - * @category Array - * @param {Array} props The property names. - * @param {Array} [values=[]] The property values. - * @returns {Object} Returns the new object. - * @example - * - * _.zipObject([['fred', 30], ['barney', 40]]); - * // => { 'fred': 30, 'barney': 40 } - * - * _.zipObject(['fred', 'barney'], [30, 40]); - * // => { 'fred': 30, 'barney': 40 } - */ - function zipObject(props, values) { - var index = -1, - length = props ? props.length : 0, - result = {}; - - if (length && !values && !isArray(props[0])) { - values = []; - } - while (++index < length) { - var key = props[index]; - if (values) { - result[key] = values[index]; - } else if (key) { - result[key[0]] = key[1]; - } - } - return result; - } - - /** - * This method is like `_.zip` except that it accepts an iteratee to specify - * how grouped values should be combined. The `iteratee` is bound to `thisArg` - * and invoked with four arguments: (accumulator, value, index, group). - * - * @static - * @memberOf _ - * @category Array - * @param {...Array} [arrays] The arrays to process. - * @param {Function} [iteratee] The function to combine grouped values. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new array of grouped elements. - * @example - * - * _.zipWith([1, 2], [10, 20], [100, 200], _.add); - * // => [111, 222] - */ - var zipWith = restParam(function(arrays) { - var length = arrays.length, - iteratee = length > 2 ? arrays[length - 2] : undefined, - thisArg = length > 1 ? arrays[length - 1] : undefined; - - if (length > 2 && typeof iteratee == 'function') { - length -= 2; - } else { - iteratee = (length > 1 && typeof thisArg == 'function') ? (--length, thisArg) : undefined; - thisArg = undefined; - } - arrays.length = length; - return unzipWith(arrays, iteratee, thisArg); - }); - - /*------------------------------------------------------------------------*/ - - /** - * Creates a `lodash` object that wraps `value` with explicit method - * chaining enabled. - * - * @static - * @memberOf _ - * @category Chain - * @param {*} value The value to wrap. - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 }, - * { 'user': 'pebbles', 'age': 1 } - * ]; - * - * var youngest = _.chain(users) - * .sortBy('age') - * .map(function(chr) { - * return chr.user + ' is ' + chr.age; - * }) - * .first() - * .value(); - * // => 'pebbles is 1' - */ - function chain(value) { - var result = lodash(value); - result.__chain__ = true; - return result; - } - - /** - * This method invokes `interceptor` and returns `value`. The interceptor is - * bound to `thisArg` and invoked with one argument; (value). The purpose of - * this method is to "tap into" a method chain in order to perform operations - * on intermediate results within the chain. - * - * @static - * @memberOf _ - * @category Chain - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @param {*} [thisArg] The `this` binding of `interceptor`. - * @returns {*} Returns `value`. - * @example - * - * _([1, 2, 3]) - * .tap(function(array) { - * array.pop(); - * }) - * .reverse() - * .value(); - * // => [2, 1] - */ - function tap(value, interceptor, thisArg) { - interceptor.call(thisArg, value); - return value; - } - - /** - * This method is like `_.tap` except that it returns the result of `interceptor`. - * - * @static - * @memberOf _ - * @category Chain - * @param {*} value The value to provide to `interceptor`. - * @param {Function} interceptor The function to invoke. - * @param {*} [thisArg] The `this` binding of `interceptor`. - * @returns {*} Returns the result of `interceptor`. - * @example - * - * _(' abc ') - * .chain() - * .trim() - * .thru(function(value) { - * return [value]; - * }) - * .value(); - * // => ['abc'] - */ - function thru(value, interceptor, thisArg) { - return interceptor.call(thisArg, value); - } - - /** - * Enables explicit method chaining on the wrapper object. - * - * @name chain - * @memberOf _ - * @category Chain - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * // without explicit chaining - * _(users).first(); - * // => { 'user': 'barney', 'age': 36 } - * - * // with explicit chaining - * _(users).chain() - * .first() - * .pick('user') - * .value(); - * // => { 'user': 'barney' } - */ - function wrapperChain() { - return chain(this); - } - - /** - * Executes the chained sequence and returns the wrapped result. - * - * @name commit - * @memberOf _ - * @category Chain - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2]; - * var wrapper = _(array).push(3); - * - * console.log(array); - * // => [1, 2] - * - * wrapper = wrapper.commit(); - * console.log(array); - * // => [1, 2, 3] - * - * wrapper.last(); - * // => 3 - * - * console.log(array); - * // => [1, 2, 3] - */ - function wrapperCommit() { - return new LodashWrapper(this.value(), this.__chain__); - } - - /** - * Creates a clone of the chained sequence planting `value` as the wrapped value. - * - * @name plant - * @memberOf _ - * @category Chain - * @returns {Object} Returns the new `lodash` wrapper instance. - * @example - * - * var array = [1, 2]; - * var wrapper = _(array).map(function(value) { - * return Math.pow(value, 2); - * }); - * - * var other = [3, 4]; - * var otherWrapper = wrapper.plant(other); - * - * otherWrapper.value(); - * // => [9, 16] - * - * wrapper.value(); - * // => [1, 4] - */ - function wrapperPlant(value) { - var result, - parent = this; - - while (parent instanceof baseLodash) { - var clone = wrapperClone(parent); - if (result) { - previous.__wrapped__ = clone; - } else { - result = clone; - } - var previous = clone; - parent = parent.__wrapped__; - } - previous.__wrapped__ = value; - return result; - } - - /** - * Reverses the wrapped array so the first element becomes the last, the - * second element becomes the second to last, and so on. - * - * **Note:** This method mutates the wrapped array. - * - * @name reverse - * @memberOf _ - * @category Chain - * @returns {Object} Returns the new reversed `lodash` wrapper instance. - * @example - * - * var array = [1, 2, 3]; - * - * _(array).reverse().value() - * // => [3, 2, 1] - * - * console.log(array); - * // => [3, 2, 1] - */ - function wrapperReverse() { - var value = this.__wrapped__; - if (value instanceof LazyWrapper) { - if (this.__actions__.length) { - value = new LazyWrapper(this); - } - return new LodashWrapper(value.reverse(), this.__chain__); - } - return this.thru(function(value) { - return value.reverse(); - }); - } - - /** - * Produces the result of coercing the unwrapped value to a string. - * - * @name toString - * @memberOf _ - * @category Chain - * @returns {string} Returns the coerced string value. - * @example - * - * _([1, 2, 3]).toString(); - * // => '1,2,3' - */ - function wrapperToString() { - return (this.value() + ''); - } - - /** - * Executes the chained sequence to extract the unwrapped value. - * - * @name value - * @memberOf _ - * @alias run, toJSON, valueOf - * @category Chain - * @returns {*} Returns the resolved unwrapped value. - * @example - * - * _([1, 2, 3]).value(); - * // => [1, 2, 3] - */ - function wrapperValue() { - return baseWrapperValue(this.__wrapped__, this.__actions__); - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates an array of elements corresponding to the given keys, or indexes, - * of `collection`. Keys may be specified as individual arguments or as arrays - * of keys. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {...(number|number[]|string|string[])} [props] The property names - * or indexes of elements to pick, specified individually or in arrays. - * @returns {Array} Returns the new array of picked elements. - * @example - * - * _.at(['a', 'b', 'c'], [0, 2]); - * // => ['a', 'c'] - * - * _.at(['barney', 'fred', 'pebbles'], 0, 2); - * // => ['barney', 'pebbles'] - */ - var at = restParam(function(collection, props) { - return baseAt(collection, baseFlatten(props)); - }); - - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is the number of times the key was returned by `iteratee`. - * The `iteratee` is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.countBy([4.3, 6.1, 6.4], function(n) { - * return Math.floor(n); - * }); - * // => { '4': 1, '6': 2 } - * - * _.countBy([4.3, 6.1, 6.4], function(n) { - * return this.floor(n); - * }, Math); - * // => { '4': 1, '6': 2 } - * - * _.countBy(['one', 'two', 'three'], 'length'); - * // => { '3': 2, '5': 1 } - */ - var countBy = createAggregator(function(result, value, key) { - hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1); - }); - - /** - * Checks if `predicate` returns truthy for **all** elements of `collection`. - * The predicate is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias all - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {boolean} Returns `true` if all elements pass the predicate check, - * else `false`. - * @example - * - * _.every([true, 1, null, 'yes'], Boolean); - * // => false - * - * var users = [ - * { 'user': 'barney', 'active': false }, - * { 'user': 'fred', 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.every(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // using the `_.matchesProperty` callback shorthand - * _.every(users, 'active', false); - * // => true - * - * // using the `_.property` callback shorthand - * _.every(users, 'active'); - * // => false - */ - function every(collection, predicate, thisArg) { - var func = isArray(collection) ? arrayEvery : baseEvery; - if (thisArg && isIterateeCall(collection, predicate, thisArg)) { - predicate = null; - } - if (typeof predicate != 'function' || thisArg !== undefined) { - predicate = getCallback(predicate, thisArg, 3); - } - return func(collection, predicate); - } - - /** - * Iterates over elements of `collection`, returning an array of all elements - * `predicate` returns truthy for. The predicate is bound to `thisArg` and - * invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias select - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the new filtered array. - * @example - * - * _.filter([4, 5, 6], function(n) { - * return n % 2 == 0; - * }); - * // => [4, 6] - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user'); - * // => ['barney'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.filter(users, 'active', false), 'user'); - * // => ['fred'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.filter(users, 'active'), 'user'); - * // => ['barney'] - */ - function filter(collection, predicate, thisArg) { - var func = isArray(collection) ? arrayFilter : baseFilter; - predicate = getCallback(predicate, thisArg, 3); - return func(collection, predicate); - } - - /** - * Iterates over elements of `collection`, returning the first element - * `predicate` returns truthy for. The predicate is bound to `thisArg` and - * invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias detect - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false }, - * { 'user': 'pebbles', 'age': 1, 'active': true } - * ]; - * - * _.result(_.find(users, function(chr) { - * return chr.age < 40; - * }), 'user'); - * // => 'barney' - * - * // using the `_.matches` callback shorthand - * _.result(_.find(users, { 'age': 1, 'active': true }), 'user'); - * // => 'pebbles' - * - * // using the `_.matchesProperty` callback shorthand - * _.result(_.find(users, 'active', false), 'user'); - * // => 'fred' - * - * // using the `_.property` callback shorthand - * _.result(_.find(users, 'active'), 'user'); - * // => 'barney' - */ - var find = createFind(baseEach); - - /** - * This method is like `_.find` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * _.findLast([1, 2, 3, 4], function(n) { - * return n % 2 == 1; - * }); - * // => 3 - */ - var findLast = createFind(baseEachRight, true); - - /** - * Performs a deep comparison between each element in `collection` and the - * source object, returning the first element that has equivalent property - * values. - * - * **Note:** This method supports comparing arrays, booleans, `Date` objects, - * numbers, `Object` objects, regexes, and strings. Objects are compared by - * their own, not inherited, enumerable properties. For comparing a single - * own or inherited property value see `_.matchesProperty`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Object} source The object of property values to match. - * @returns {*} Returns the matched element, else `undefined`. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } - * ]; - * - * _.result(_.findWhere(users, { 'age': 36, 'active': true }), 'user'); - * // => 'barney' - * - * _.result(_.findWhere(users, { 'age': 40, 'active': false }), 'user'); - * // => 'fred' - */ - function findWhere(collection, source) { - return find(collection, baseMatches(source)); - } - - /** - * Iterates over elements of `collection` invoking `iteratee` for each element. - * The `iteratee` is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). Iteratee functions may exit iteration early - * by explicitly returning `false`. - * - * **Note:** As with other "Collections" methods, objects with a "length" property - * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn` - * may be used for object iteration. - * - * @static - * @memberOf _ - * @alias each - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array|Object|string} Returns `collection`. - * @example - * - * _([1, 2]).forEach(function(n) { - * console.log(n); - * }).value(); - * // => logs each value from left to right and returns the array - * - * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) { - * console.log(n, key); - * }); - * // => logs each value-key pair and returns the object (iteration order is not guaranteed) - */ - var forEach = createForEach(arrayEach, baseEach); - - /** - * This method is like `_.forEach` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @alias eachRight - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array|Object|string} Returns `collection`. - * @example - * - * _([1, 2]).forEachRight(function(n) { - * console.log(n); - * }).value(); - * // => logs each value from right to left and returns the array - */ - var forEachRight = createForEach(arrayEachRight, baseEachRight); - - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is an array of the elements responsible for generating the key. - * The `iteratee` is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.groupBy([4.2, 6.1, 6.4], function(n) { - * return Math.floor(n); - * }); - * // => { '4': [4.2], '6': [6.1, 6.4] } - * - * _.groupBy([4.2, 6.1, 6.4], function(n) { - * return this.floor(n); - * }, Math); - * // => { '4': [4.2], '6': [6.1, 6.4] } - * - * // using the `_.property` callback shorthand - * _.groupBy(['one', 'two', 'three'], 'length'); - * // => { '3': ['one', 'two'], '5': ['three'] } - */ - var groupBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - result[key].push(value); - } else { - result[key] = [value]; - } - }); - - /** - * Checks if `value` is in `collection` using - * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) - * for equality comparisons. If `fromIndex` is negative, it is used as the offset - * from the end of `collection`. - * - * @static - * @memberOf _ - * @alias contains, include - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {*} target The value to search for. - * @param {number} [fromIndex=0] The index to search from. - * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`. - * @returns {boolean} Returns `true` if a matching element is found, else `false`. - * @example - * - * _.includes([1, 2, 3], 1); - * // => true - * - * _.includes([1, 2, 3], 1, 2); - * // => false - * - * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); - * // => true - * - * _.includes('pebbles', 'eb'); - * // => true - */ - function includes(collection, target, fromIndex, guard) { - var length = collection ? getLength(collection) : 0; - if (!isLength(length)) { - collection = values(collection); - length = collection.length; - } - if (!length) { - return false; - } - if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) { - fromIndex = 0; - } else { - fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0); - } - return (typeof collection == 'string' || !isArray(collection) && isString(collection)) - ? (fromIndex < length && collection.indexOf(target, fromIndex) > -1) - : (getIndexOf(collection, target, fromIndex) > -1); - } - - /** - * Creates an object composed of keys generated from the results of running - * each element of `collection` through `iteratee`. The corresponding value - * of each key is the last element responsible for generating the key. The - * iteratee function is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * var keyData = [ - * { 'dir': 'left', 'code': 97 }, - * { 'dir': 'right', 'code': 100 } - * ]; - * - * _.indexBy(keyData, 'dir'); - * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } - * - * _.indexBy(keyData, function(object) { - * return String.fromCharCode(object.code); - * }); - * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } - * - * _.indexBy(keyData, function(object) { - * return this.fromCharCode(object.code); - * }, String); - * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } - */ - var indexBy = createAggregator(function(result, value, key) { - result[key] = value; - }); - - /** - * Invokes the method at `path` of each element in `collection`, returning - * an array of the results of each invoked method. Any additional arguments - * are provided to each invoked method. If `methodName` is a function it is - * invoked for, and `this` bound to, each element in `collection`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Array|Function|string} path The path of the method to invoke or - * the function invoked per iteration. - * @param {...*} [args] The arguments to invoke the method with. - * @returns {Array} Returns the array of results. - * @example - * - * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); - * // => [[1, 5, 7], [1, 2, 3]] - * - * _.invoke([123, 456], String.prototype.split, ''); - * // => [['1', '2', '3'], ['4', '5', '6']] - */ - var invoke = restParam(function(collection, path, args) { - var index = -1, - isFunc = typeof path == 'function', - isProp = isKey(path), - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value) { - var func = isFunc ? path : ((isProp && value != null) ? value[path] : null); - result[++index] = func ? func.apply(value, args) : invokePath(value, path, args); - }); - return result; - }); - - /** - * Creates an array of values by running each element in `collection` through - * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three - * arguments: (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. - * - * The guarded methods are: - * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`, - * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`, - * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`, - * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`, - * `sum`, `uniq`, and `words` - * - * @static - * @memberOf _ - * @alias collect - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new mapped array. - * @example - * - * function timesThree(n) { - * return n * 3; - * } - * - * _.map([1, 2], timesThree); - * // => [3, 6] - * - * _.map({ 'a': 1, 'b': 2 }, timesThree); - * // => [3, 6] (iteration order is not guaranteed) - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * // using the `_.property` callback shorthand - * _.map(users, 'user'); - * // => ['barney', 'fred'] - */ - function map(collection, iteratee, thisArg) { - var func = isArray(collection) ? arrayMap : baseMap; - iteratee = getCallback(iteratee, thisArg, 3); - return func(collection, iteratee); - } - - /** - * Creates an array of elements split into two groups, the first of which - * contains elements `predicate` returns truthy for, while the second of which - * contains elements `predicate` returns falsey for. The predicate is bound - * to `thisArg` and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the array of grouped elements. - * @example - * - * _.partition([1, 2, 3], function(n) { - * return n % 2; - * }); - * // => [[1, 3], [2]] - * - * _.partition([1.2, 2.3, 3.4], function(n) { - * return this.floor(n) % 2; - * }, Math); - * // => [[1.2, 3.4], [2.3]] - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true }, - * { 'user': 'pebbles', 'age': 1, 'active': false } - * ]; - * - * var mapper = function(array) { - * return _.pluck(array, 'user'); - * }; - * - * // using the `_.matches` callback shorthand - * _.map(_.partition(users, { 'age': 1, 'active': false }), mapper); - * // => [['pebbles'], ['barney', 'fred']] - * - * // using the `_.matchesProperty` callback shorthand - * _.map(_.partition(users, 'active', false), mapper); - * // => [['barney', 'pebbles'], ['fred']] - * - * // using the `_.property` callback shorthand - * _.map(_.partition(users, 'active'), mapper); - * // => [['fred'], ['barney', 'pebbles']] - */ - var partition = createAggregator(function(result, value, key) { - result[key ? 0 : 1].push(value); - }, function() { return [[], []]; }); - - /** - * Gets the property value of `path` from all elements in `collection`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Array|string} path The path of the property to pluck. - * @returns {Array} Returns the property values. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } - * ]; - * - * _.pluck(users, 'user'); - * // => ['barney', 'fred'] - * - * var userIndex = _.indexBy(users, 'user'); - * _.pluck(userIndex, 'age'); - * // => [36, 40] (iteration order is not guaranteed) - */ - function pluck(collection, path) { - return map(collection, property(path)); - } - - /** - * Reduces `collection` to a value which is the accumulated result of running - * each element in `collection` through `iteratee`, where each successive - * invocation is supplied the return value of the previous. If `accumulator` - * is not provided the first element of `collection` is used as the initial - * value. The `iteratee` is bound to `thisArg` and invoked with four arguments: - * (accumulator, value, index|key, collection). - * - * Many lodash methods are guarded to work as iteratees for methods like - * `_.reduce`, `_.reduceRight`, and `_.transform`. - * - * The guarded methods are: - * `assign`, `defaults`, `includes`, `merge`, `sortByAll`, and `sortByOrder` - * - * @static - * @memberOf _ - * @alias foldl, inject - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {*} Returns the accumulated value. - * @example - * - * _.reduce([1, 2], function(total, n) { - * return total + n; - * }); - * // => 3 - * - * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) { - * result[key] = n * 3; - * return result; - * }, {}); - * // => { 'a': 3, 'b': 6 } (iteration order is not guaranteed) - */ - var reduce = createReduce(arrayReduce, baseEach); - - /** - * This method is like `_.reduce` except that it iterates over elements of - * `collection` from right to left. - * - * @static - * @memberOf _ - * @alias foldr - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {*} Returns the accumulated value. - * @example - * - * var array = [[0, 1], [2, 3], [4, 5]]; - * - * _.reduceRight(array, function(flattened, other) { - * return flattened.concat(other); - * }, []); - * // => [4, 5, 2, 3, 0, 1] - */ - var reduceRight = createReduce(arrayReduceRight, baseEachRight); - - /** - * The opposite of `_.filter`; this method returns the elements of `collection` - * that `predicate` does **not** return truthy for. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Array} Returns the new filtered array. - * @example - * - * _.reject([1, 2, 3, 4], function(n) { - * return n % 2 == 0; - * }); - * // => [1, 3] - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false }, - * { 'user': 'fred', 'age': 40, 'active': true } - * ]; - * - * // using the `_.matches` callback shorthand - * _.pluck(_.reject(users, { 'age': 40, 'active': true }), 'user'); - * // => ['barney'] - * - * // using the `_.matchesProperty` callback shorthand - * _.pluck(_.reject(users, 'active', false), 'user'); - * // => ['fred'] - * - * // using the `_.property` callback shorthand - * _.pluck(_.reject(users, 'active'), 'user'); - * // => ['barney'] - */ - function reject(collection, predicate, thisArg) { - var func = isArray(collection) ? arrayFilter : baseFilter; - predicate = getCallback(predicate, thisArg, 3); - return func(collection, function(value, index, collection) { - return !predicate(value, index, collection); - }); - } - - /** - * Gets a random element or `n` random elements from a collection. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to sample. - * @param {number} [n] The number of elements to sample. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {*} Returns the random sample(s). - * @example - * - * _.sample([1, 2, 3, 4]); - * // => 2 - * - * _.sample([1, 2, 3, 4], 2); - * // => [3, 1] - */ - function sample(collection, n, guard) { - if (guard ? isIterateeCall(collection, n, guard) : n == null) { - collection = toIterable(collection); - var length = collection.length; - return length > 0 ? collection[baseRandom(0, length - 1)] : undefined; - } - var index = -1, - result = toArray(collection), - length = result.length, - lastIndex = length - 1; - - n = nativeMin(n < 0 ? 0 : (+n || 0), length); - while (++index < n) { - var rand = baseRandom(index, lastIndex), - value = result[rand]; - - result[rand] = result[index]; - result[index] = value; - } - result.length = n; - return result; - } - - /** - * Creates an array of shuffled values, using a version of the - * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to shuffle. - * @returns {Array} Returns the new shuffled array. - * @example - * - * _.shuffle([1, 2, 3, 4]); - * // => [4, 1, 3, 2] - */ - function shuffle(collection) { - return sample(collection, POSITIVE_INFINITY); - } - - /** - * Gets the size of `collection` by returning its length for array-like - * values or the number of own enumerable properties for objects. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to inspect. - * @returns {number} Returns the size of `collection`. - * @example - * - * _.size([1, 2, 3]); - * // => 3 - * - * _.size({ 'a': 1, 'b': 2 }); - * // => 2 - * - * _.size('pebbles'); - * // => 7 - */ - function size(collection) { - var length = collection ? getLength(collection) : 0; - return isLength(length) ? length : keys(collection).length; - } - - /** - * Checks if `predicate` returns truthy for **any** element of `collection`. - * The function returns as soon as it finds a passing value and does not iterate - * over the entire collection. The predicate is bound to `thisArg` and invoked - * with three arguments: (value, index|key, collection). - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @alias any - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {boolean} Returns `true` if any element passes the predicate check, - * else `false`. - * @example - * - * _.some([null, 0, 'yes', false], Boolean); - * // => true - * - * var users = [ - * { 'user': 'barney', 'active': true }, - * { 'user': 'fred', 'active': false } - * ]; - * - * // using the `_.matches` callback shorthand - * _.some(users, { 'user': 'barney', 'active': false }); - * // => false - * - * // using the `_.matchesProperty` callback shorthand - * _.some(users, 'active', false); - * // => true - * - * // using the `_.property` callback shorthand - * _.some(users, 'active'); - * // => true - */ - function some(collection, predicate, thisArg) { - var func = isArray(collection) ? arraySome : baseSome; - if (thisArg && isIterateeCall(collection, predicate, thisArg)) { - predicate = null; - } - if (typeof predicate != 'function' || thisArg !== undefined) { - predicate = getCallback(predicate, thisArg, 3); - } - return func(collection, predicate); - } - - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in a collection through `iteratee`. This method performs - * a stable sort, that is, it preserves the original sort order of equal elements. - * The `iteratee` is bound to `thisArg` and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Array} Returns the new sorted array. - * @example - * - * _.sortBy([1, 2, 3], function(n) { - * return Math.sin(n); - * }); - * // => [3, 1, 2] - * - * _.sortBy([1, 2, 3], function(n) { - * return this.sin(n); - * }, Math); - * // => [3, 1, 2] - * - * var users = [ - * { 'user': 'fred' }, - * { 'user': 'pebbles' }, - * { 'user': 'barney' } - * ]; - * - * // using the `_.property` callback shorthand - * _.pluck(_.sortBy(users, 'user'), 'user'); - * // => ['barney', 'fred', 'pebbles'] - */ - function sortBy(collection, iteratee, thisArg) { - if (collection == null) { - return []; - } - if (thisArg && isIterateeCall(collection, iteratee, thisArg)) { - iteratee = null; - } - var index = -1; - iteratee = getCallback(iteratee, thisArg, 3); - - var result = baseMap(collection, function(value, key, collection) { - return { 'criteria': iteratee(value, key, collection), 'index': ++index, 'value': value }; - }); - return baseSortBy(result, compareAscending); - } - - /** - * This method is like `_.sortBy` except that it can sort by multiple iteratees - * or property names. - * - * If a property name is provided for an iteratee the created `_.property` - * style callback returns the property value of the given element. - * - * If an object is provided for an iteratee the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {...(Function|Function[]|Object|Object[]|string|string[])} iteratees - * The iteratees to sort by, specified as individual values or arrays of values. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 34 } - * ]; - * - * _.map(_.sortByAll(users, ['user', 'age']), _.values); - * // => [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]] - * - * _.map(_.sortByAll(users, 'user', function(chr) { - * return Math.floor(chr.age / 10); - * }), _.values); - * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - var sortByAll = restParam(function(collection, iteratees) { - if (collection == null) { - return []; - } - var guard = iteratees[2]; - if (guard && isIterateeCall(iteratees[0], iteratees[1], guard)) { - iteratees.length = 1; - } - return baseSortByOrder(collection, baseFlatten(iteratees), []); - }); - - /** - * This method is like `_.sortByAll` except that it allows specifying the - * sort orders of the iteratees to sort by. A truthy value in `orders` will - * sort the corresponding property name in ascending order while a falsey - * value will sort it in descending order. - * - * If a property name is provided for an iteratee the created `_.property` - * style callback returns the property value of the given element. - * - * If an object is provided for an iteratee the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to iterate over. - * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. - * @param {boolean[]} orders The sort orders of `iteratees`. - * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`. - * @returns {Array} Returns the new sorted array. - * @example - * - * var users = [ - * { 'user': 'fred', 'age': 48 }, - * { 'user': 'barney', 'age': 34 }, - * { 'user': 'fred', 'age': 42 }, - * { 'user': 'barney', 'age': 36 } - * ]; - * - * // sort by `user` in ascending order and by `age` in descending order - * _.map(_.sortByOrder(users, ['user', 'age'], [true, false]), _.values); - * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]] - */ - function sortByOrder(collection, iteratees, orders, guard) { - if (collection == null) { - return []; - } - if (guard && isIterateeCall(iteratees, orders, guard)) { - orders = null; - } - if (!isArray(iteratees)) { - iteratees = iteratees == null ? [] : [iteratees]; - } - if (!isArray(orders)) { - orders = orders == null ? [] : [orders]; - } - return baseSortByOrder(collection, iteratees, orders); - } - - /** - * Performs a deep comparison between each element in `collection` and the - * source object, returning an array of all elements that have equivalent - * property values. - * - * **Note:** This method supports comparing arrays, booleans, `Date` objects, - * numbers, `Object` objects, regexes, and strings. Objects are compared by - * their own, not inherited, enumerable properties. For comparing a single - * own or inherited property value see `_.matchesProperty`. - * - * @static - * @memberOf _ - * @category Collection - * @param {Array|Object|string} collection The collection to search. - * @param {Object} source The object of property values to match. - * @returns {Array} Returns the new filtered array. - * @example - * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': false, 'pets': ['hoppy'] }, - * { 'user': 'fred', 'age': 40, 'active': true, 'pets': ['baby puss', 'dino'] } - * ]; - * - * _.pluck(_.where(users, { 'age': 36, 'active': false }), 'user'); - * // => ['barney'] - * - * _.pluck(_.where(users, { 'pets': ['dino'] }), 'user'); - * // => ['fred'] - */ - function where(collection, source) { - return filter(collection, baseMatches(source)); - } - - /*------------------------------------------------------------------------*/ - - /** - * Gets the number of milliseconds that have elapsed since the Unix epoch - * (1 January 1970 00:00:00 UTC). - * - * @static - * @memberOf _ - * @category Date - * @example - * - * _.defer(function(stamp) { - * console.log(_.now() - stamp); - * }, _.now()); - * // => logs the number of milliseconds it took for the deferred function to be invoked - */ - var now = nativeNow || function() { - return new Date().getTime(); - }; - - /*------------------------------------------------------------------------*/ - - /** - * The opposite of `_.before`; this method creates a function that invokes - * `func` once it is called `n` or more times. - * - * @static - * @memberOf _ - * @category Function - * @param {number} n The number of calls before `func` is invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var saves = ['profile', 'settings']; - * - * var done = _.after(saves.length, function() { - * console.log('done saving!'); - * }); - * - * _.forEach(saves, function(type) { - * asyncSave({ 'type': type, 'complete': done }); - * }); - * // => logs 'done saving!' after the two async saves have completed - */ - function after(n, func) { - if (typeof func != 'function') { - if (typeof n == 'function') { - var temp = n; - n = func; - func = temp; - } else { - throw new TypeError(FUNC_ERROR_TEXT); - } - } - n = nativeIsFinite(n = +n) ? n : 0; - return function() { - if (--n < 1) { - return func.apply(this, arguments); - } - }; - } - - /** - * Creates a function that accepts up to `n` arguments ignoring any - * additional arguments. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to cap arguments for. - * @param {number} [n=func.length] The arity cap. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Function} Returns the new function. - * @example - * - * _.map(['6', '8', '10'], _.ary(parseInt, 1)); - * // => [6, 8, 10] - */ - function ary(func, n, guard) { - if (guard && isIterateeCall(func, n, guard)) { - n = null; - } - n = (func && n == null) ? func.length : nativeMax(+n || 0, 0); - return createWrapper(func, ARY_FLAG, null, null, null, null, n); - } - - /** - * Creates a function that invokes `func`, with the `this` binding and arguments - * of the created function, while it is called less than `n` times. Subsequent - * calls to the created function return the result of the last `func` invocation. - * - * @static - * @memberOf _ - * @category Function - * @param {number} n The number of calls at which `func` is no longer invoked. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * jQuery('#add').on('click', _.before(5, addContactToList)); - * // => allows adding up to 4 contacts to the list - */ - function before(n, func) { - var result; - if (typeof func != 'function') { - if (typeof n == 'function') { - var temp = n; - n = func; - func = temp; - } else { - throw new TypeError(FUNC_ERROR_TEXT); - } - } - return function() { - if (--n > 0) { - result = func.apply(this, arguments); - } - if (n <= 1) { - func = null; - } - return result; - }; - } - - /** - * Creates a function that invokes `func` with the `this` binding of `thisArg` - * and prepends any additional `_.bind` arguments to those provided to the - * bound function. - * - * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for partially applied arguments. - * - * **Note:** Unlike native `Function#bind` this method does not set the "length" - * property of bound functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to bind. - * @param {*} thisArg The `this` binding of `func`. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var greet = function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * }; - * - * var object = { 'user': 'fred' }; - * - * var bound = _.bind(greet, object, 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * // using placeholders - * var bound = _.bind(greet, object, _, '!'); - * bound('hi'); - * // => 'hi fred!' - */ - var bind = restParam(function(func, thisArg, partials) { - var bitmask = BIND_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, bind.placeholder); - bitmask |= PARTIAL_FLAG; - } - return createWrapper(func, bitmask, thisArg, partials, holders); - }); - - /** - * Binds methods of an object to the object itself, overwriting the existing - * method. Method names may be specified as individual arguments or as arrays - * of method names. If no method names are provided all enumerable function - * properties, own and inherited, of `object` are bound. - * - * **Note:** This method does not set the "length" property of bound functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Object} object The object to bind and assign the bound methods to. - * @param {...(string|string[])} [methodNames] The object method names to bind, - * specified as individual method names or arrays of method names. - * @returns {Object} Returns `object`. - * @example - * - * var view = { - * 'label': 'docs', - * 'onClick': function() { - * console.log('clicked ' + this.label); - * } - * }; - * - * _.bindAll(view); - * jQuery('#docs').on('click', view.onClick); - * // => logs 'clicked docs' when the element is clicked - */ - var bindAll = restParam(function(object, methodNames) { - methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object); - - var index = -1, - length = methodNames.length; - - while (++index < length) { - var key = methodNames[index]; - object[key] = createWrapper(object[key], BIND_FLAG, object); - } - return object; - }); - - /** - * Creates a function that invokes the method at `object[key]` and prepends - * any additional `_.bindKey` arguments to those provided to the bound function. - * - * This method differs from `_.bind` by allowing bound functions to reference - * methods that may be redefined or don't yet exist. - * See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) - * for more details. - * - * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * @static - * @memberOf _ - * @category Function - * @param {Object} object The object the method belongs to. - * @param {string} key The key of the method. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var object = { - * 'user': 'fred', - * 'greet': function(greeting, punctuation) { - * return greeting + ' ' + this.user + punctuation; - * } - * }; - * - * var bound = _.bindKey(object, 'greet', 'hi'); - * bound('!'); - * // => 'hi fred!' - * - * object.greet = function(greeting, punctuation) { - * return greeting + 'ya ' + this.user + punctuation; - * }; - * - * bound('!'); - * // => 'hiya fred!' - * - * // using placeholders - * var bound = _.bindKey(object, 'greet', _, '!'); - * bound('hi'); - * // => 'hiya fred!' - */ - var bindKey = restParam(function(object, key, partials) { - var bitmask = BIND_FLAG | BIND_KEY_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, bindKey.placeholder); - bitmask |= PARTIAL_FLAG; - } - return createWrapper(key, bitmask, object, partials, holders); - }); - - /** - * Creates a function that accepts one or more arguments of `func` that when - * called either invokes `func` returning its result, if all `func` arguments - * have been provided, or returns a function that accepts one or more of the - * remaining `func` arguments, and so on. The arity of `func` may be specified - * if `func.length` is not sufficient. - * - * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, - * may be used as a placeholder for provided arguments. - * - * **Note:** This method does not set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curry(abc); - * - * curried(1)(2)(3); - * // => [1, 2, 3] - * - * curried(1, 2)(3); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // using placeholders - * curried(1)(_, 3)(2); - * // => [1, 2, 3] - */ - var curry = createCurry(CURRY_FLAG); - - /** - * This method is like `_.curry` except that arguments are applied to `func` - * in the manner of `_.partialRight` instead of `_.partial`. - * - * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for provided arguments. - * - * **Note:** This method does not set the "length" property of curried functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to curry. - * @param {number} [arity=func.length] The arity of `func`. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Function} Returns the new curried function. - * @example - * - * var abc = function(a, b, c) { - * return [a, b, c]; - * }; - * - * var curried = _.curryRight(abc); - * - * curried(3)(2)(1); - * // => [1, 2, 3] - * - * curried(2, 3)(1); - * // => [1, 2, 3] - * - * curried(1, 2, 3); - * // => [1, 2, 3] - * - * // using placeholders - * curried(3)(1, _)(2); - * // => [1, 2, 3] - */ - var curryRight = createCurry(CURRY_RIGHT_FLAG); - - /** - * Creates a debounced function that delays invoking `func` until after `wait` - * milliseconds have elapsed since the last time the debounced function was - * invoked. The debounced function comes with a `cancel` method to cancel - * delayed invocations. Provide an options object to indicate that `func` - * should be invoked on the leading and/or trailing edge of the `wait` timeout. - * Subsequent calls to the debounced function return the result of the last - * `func` invocation. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked - * on the trailing edge of the timeout only if the the debounced function is - * invoked more than once during the `wait` timeout. - * - * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) - * for details over the differences between `_.debounce` and `_.throttle`. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to debounce. - * @param {number} [wait=0] The number of milliseconds to delay. - * @param {Object} [options] The options object. - * @param {boolean} [options.leading=false] Specify invoking on the leading - * edge of the timeout. - * @param {number} [options.maxWait] The maximum time `func` is allowed to be - * delayed before it is invoked. - * @param {boolean} [options.trailing=true] Specify invoking on the trailing - * edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * // avoid costly calculations while the window size is in flux - * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); - * - * // invoke `sendMail` when the click event is fired, debouncing subsequent calls - * jQuery('#postbox').on('click', _.debounce(sendMail, 300, { - * 'leading': true, - * 'trailing': false - * })); - * - * // ensure `batchLog` is invoked once after 1 second of debounced calls - * var source = new EventSource('/stream'); - * jQuery(source).on('message', _.debounce(batchLog, 250, { - * 'maxWait': 1000 - * })); - * - * // cancel a debounced call - * var todoChanges = _.debounce(batchLog, 1000); - * Object.observe(models.todo, todoChanges); - * - * Object.observe(models, function(changes) { - * if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) { - * todoChanges.cancel(); - * } - * }, ['delete']); - * - * // ...at some point `models.todo` is changed - * models.todo.completed = true; - * - * // ...before 1 second has passed `models.todo` is deleted - * // which cancels the debounced `todoChanges` call - * delete models.todo; - */ - function debounce(func, wait, options) { - var args, - maxTimeoutId, - result, - stamp, - thisArg, - timeoutId, - trailingCall, - lastCalled = 0, - maxWait = false, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - wait = wait < 0 ? 0 : (+wait || 0); - if (options === true) { - var leading = true; - trailing = false; - } else if (isObject(options)) { - leading = options.leading; - maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait); - trailing = 'trailing' in options ? options.trailing : trailing; - } - - function cancel() { - if (timeoutId) { - clearTimeout(timeoutId); - } - if (maxTimeoutId) { - clearTimeout(maxTimeoutId); - } - maxTimeoutId = timeoutId = trailingCall = undefined; - } - - function delayed() { - var remaining = wait - (now() - stamp); - if (remaining <= 0 || remaining > wait) { - if (maxTimeoutId) { - clearTimeout(maxTimeoutId); - } - var isCalled = trailingCall; - maxTimeoutId = timeoutId = trailingCall = undefined; - if (isCalled) { - lastCalled = now(); - result = func.apply(thisArg, args); - if (!timeoutId && !maxTimeoutId) { - args = thisArg = null; - } - } - } else { - timeoutId = setTimeout(delayed, remaining); - } - } - - function maxDelayed() { - if (timeoutId) { - clearTimeout(timeoutId); - } - maxTimeoutId = timeoutId = trailingCall = undefined; - if (trailing || (maxWait !== wait)) { - lastCalled = now(); - result = func.apply(thisArg, args); - if (!timeoutId && !maxTimeoutId) { - args = thisArg = null; - } - } - } - - function debounced() { - args = arguments; - stamp = now(); - thisArg = this; - trailingCall = trailing && (timeoutId || !leading); - - if (maxWait === false) { - var leadingCall = leading && !timeoutId; - } else { - if (!maxTimeoutId && !leading) { - lastCalled = stamp; - } - var remaining = maxWait - (stamp - lastCalled), - isCalled = remaining <= 0 || remaining > maxWait; - - if (isCalled) { - if (maxTimeoutId) { - maxTimeoutId = clearTimeout(maxTimeoutId); - } - lastCalled = stamp; - result = func.apply(thisArg, args); - } - else if (!maxTimeoutId) { - maxTimeoutId = setTimeout(maxDelayed, remaining); - } - } - if (isCalled && timeoutId) { - timeoutId = clearTimeout(timeoutId); - } - else if (!timeoutId && wait !== maxWait) { - timeoutId = setTimeout(delayed, wait); - } - if (leadingCall) { - isCalled = true; - result = func.apply(thisArg, args); - } - if (isCalled && !timeoutId && !maxTimeoutId) { - args = thisArg = null; - } - return result; - } - debounced.cancel = cancel; - return debounced; - } - - /** - * Defers invoking the `func` until the current call stack has cleared. Any - * additional arguments are provided to `func` when it is invoked. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to defer. - * @param {...*} [args] The arguments to invoke the function with. - * @returns {number} Returns the timer id. - * @example - * - * _.defer(function(text) { - * console.log(text); - * }, 'deferred'); - * // logs 'deferred' after one or more milliseconds - */ - var defer = restParam(function(func, args) { - return baseDelay(func, 1, args); - }); - - /** - * Invokes `func` after `wait` milliseconds. Any additional arguments are - * provided to `func` when it is invoked. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to delay. - * @param {number} wait The number of milliseconds to delay invocation. - * @param {...*} [args] The arguments to invoke the function with. - * @returns {number} Returns the timer id. - * @example - * - * _.delay(function(text) { - * console.log(text); - * }, 1000, 'later'); - * // => logs 'later' after one second - */ - var delay = restParam(function(func, wait, args) { - return baseDelay(func, wait, args); - }); - - /** - * Creates a function that returns the result of invoking the provided - * functions with the `this` binding of the created function, where each - * successive invocation is supplied the return value of the previous. - * - * @static - * @memberOf _ - * @category Function - * @param {...Function} [funcs] Functions to invoke. - * @returns {Function} Returns the new function. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var addSquare = _.flow(_.add, square); - * addSquare(1, 2); - * // => 9 - */ - var flow = createFlow(); - - /** - * This method is like `_.flow` except that it creates a function that - * invokes the provided functions from right to left. - * - * @static - * @memberOf _ - * @alias backflow, compose - * @category Function - * @param {...Function} [funcs] Functions to invoke. - * @returns {Function} Returns the new function. - * @example - * - * function square(n) { - * return n * n; - * } - * - * var addSquare = _.flowRight(square, _.add); - * addSquare(1, 2); - * // => 9 - */ - var flowRight = createFlow(true); - - /** - * Creates a function that memoizes the result of `func`. If `resolver` is - * provided it determines the cache key for storing the result based on the - * arguments provided to the memoized function. By default, the first argument - * provided to the memoized function is coerced to a string and used as the - * cache key. The `func` is invoked with the `this` binding of the memoized - * function. - * - * **Note:** The cache is exposed as the `cache` property on the memoized - * function. Its creation may be customized by replacing the `_.memoize.Cache` - * constructor with one whose instances implement the [`Map`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-properties-of-the-map-prototype-object) - * method interface of `get`, `has`, and `set`. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] The function to resolve the cache key. - * @returns {Function} Returns the new memoizing function. - * @example - * - * var upperCase = _.memoize(function(string) { - * return string.toUpperCase(); - * }); - * - * upperCase('fred'); - * // => 'FRED' - * - * // modifying the result cache - * upperCase.cache.set('fred', 'BARNEY'); - * upperCase('fred'); - * // => 'BARNEY' - * - * // replacing `_.memoize.Cache` - * var object = { 'user': 'fred' }; - * var other = { 'user': 'barney' }; - * var identity = _.memoize(_.identity); - * - * identity(object); - * // => { 'user': 'fred' } - * identity(other); - * // => { 'user': 'fred' } - * - * _.memoize.Cache = WeakMap; - * var identity = _.memoize(_.identity); - * - * identity(object); - * // => { 'user': 'fred' } - * identity(other); - * // => { 'user': 'barney' } - */ - function memoize(func, resolver) { - if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; - - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result); - return result; - }; - memoized.cache = new memoize.Cache; - return memoized; - } - - /** - * Creates a function that negates the result of the predicate `func`. The - * `func` predicate is invoked with the `this` binding and arguments of the - * created function. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} predicate The predicate to negate. - * @returns {Function} Returns the new function. - * @example - * - * function isEven(n) { - * return n % 2 == 0; - * } - * - * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); - * // => [1, 3, 5] - */ - function negate(predicate) { - if (typeof predicate != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function() { - return !predicate.apply(this, arguments); - }; - } - - /** - * Creates a function that is restricted to invoking `func` once. Repeat calls - * to the function return the value of the first call. The `func` is invoked - * with the `this` binding and arguments of the created function. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var initialize = _.once(createApplication); - * initialize(); - * initialize(); - * // `initialize` invokes `createApplication` once - */ - function once(func) { - return before(2, func); - } - - /** - * Creates a function that invokes `func` with `partial` arguments prepended - * to those provided to the new function. This method is like `_.bind` except - * it does **not** alter the `this` binding. - * - * The `_.partial.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method does not set the "length" property of partially - * applied functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * var greet = function(greeting, name) { - * return greeting + ' ' + name; - * }; - * - * var sayHelloTo = _.partial(greet, 'hello'); - * sayHelloTo('fred'); - * // => 'hello fred' - * - * // using placeholders - * var greetFred = _.partial(greet, _, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - */ - var partial = createPartial(PARTIAL_FLAG); - - /** - * This method is like `_.partial` except that partially applied arguments - * are appended to those provided to the new function. - * - * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic - * builds, may be used as a placeholder for partially applied arguments. - * - * **Note:** This method does not set the "length" property of partially - * applied functions. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to partially apply arguments to. - * @param {...*} [partials] The arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * var greet = function(greeting, name) { - * return greeting + ' ' + name; - * }; - * - * var greetFred = _.partialRight(greet, 'fred'); - * greetFred('hi'); - * // => 'hi fred' - * - * // using placeholders - * var sayHelloTo = _.partialRight(greet, 'hello', _); - * sayHelloTo('fred'); - * // => 'hello fred' - */ - var partialRight = createPartial(PARTIAL_RIGHT_FLAG); - - /** - * Creates a function that invokes `func` with arguments arranged according - * to the specified indexes where the argument value at the first index is - * provided as the first argument, the argument value at the second index is - * provided as the second argument, and so on. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to rearrange arguments for. - * @param {...(number|number[])} indexes The arranged argument indexes, - * specified as individual indexes or arrays of indexes. - * @returns {Function} Returns the new function. - * @example - * - * var rearged = _.rearg(function(a, b, c) { - * return [a, b, c]; - * }, 2, 0, 1); - * - * rearged('b', 'c', 'a') - * // => ['a', 'b', 'c'] - * - * var map = _.rearg(_.map, [1, 0]); - * map(function(n) { - * return n * 3; - * }, [1, 2, 3]); - * // => [3, 6, 9] - */ - var rearg = restParam(function(func, indexes) { - return createWrapper(func, REARG_FLAG, null, null, null, baseFlatten(indexes)); - }); - - /** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as an array. - * - * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters). - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.restParam(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); - * }); - * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' - */ - function restParam(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - rest = Array(length); - - while (++index < length) { - rest[index] = args[start + index]; - } - switch (start) { - case 0: return func.call(this, rest); - case 1: return func.call(this, args[0], rest); - case 2: return func.call(this, args[0], args[1], rest); - } - var otherArgs = Array(start + 1); - index = -1; - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = rest; - return func.apply(this, otherArgs); - }; - } - - /** - * Creates a function that invokes `func` with the `this` binding of the created - * function and an array of arguments much like [`Function#apply`](https://es5.github.io/#x15.3.4.3). - * - * **Note:** This method is based on the [spread operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator). - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to spread arguments over. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.spread(function(who, what) { - * return who + ' says ' + what; - * }); - * - * say(['fred', 'hello']); - * // => 'fred says hello' - * - * // with a Promise - * var numbers = Promise.all([ - * Promise.resolve(40), - * Promise.resolve(36) - * ]); - * - * numbers.then(_.spread(function(x, y) { - * return x + y; - * })); - * // => a Promise of 76 - */ - function spread(func) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function(array) { - return func.apply(this, array); - }; - } - - /** - * Creates a throttled function that only invokes `func` at most once per - * every `wait` milliseconds. The throttled function comes with a `cancel` - * method to cancel delayed invocations. Provide an options object to indicate - * that `func` should be invoked on the leading and/or trailing edge of the - * `wait` timeout. Subsequent calls to the throttled function return the - * result of the last `func` call. - * - * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked - * on the trailing edge of the timeout only if the the throttled function is - * invoked more than once during the `wait` timeout. - * - * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation) - * for details over the differences between `_.throttle` and `_.debounce`. - * - * @static - * @memberOf _ - * @category Function - * @param {Function} func The function to throttle. - * @param {number} [wait=0] The number of milliseconds to throttle invocations to. - * @param {Object} [options] The options object. - * @param {boolean} [options.leading=true] Specify invoking on the leading - * edge of the timeout. - * @param {boolean} [options.trailing=true] Specify invoking on the trailing - * edge of the timeout. - * @returns {Function} Returns the new throttled function. - * @example - * - * // avoid excessively updating the position while scrolling - * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); - * - * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes - * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, { - * 'trailing': false - * })); - * - * // cancel a trailing throttled call - * jQuery(window).on('popstate', throttled.cancel); - */ - function throttle(func, wait, options) { - var leading = true, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (options === false) { - leading = false; - } else if (isObject(options)) { - leading = 'leading' in options ? !!options.leading : leading; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - debounceOptions.leading = leading; - debounceOptions.maxWait = +wait; - debounceOptions.trailing = trailing; - return debounce(func, wait, debounceOptions); - } - - /** - * Creates a function that provides `value` to the wrapper function as its - * first argument. Any additional arguments provided to the function are - * appended to those provided to the wrapper function. The wrapper is invoked - * with the `this` binding of the created function. - * - * @static - * @memberOf _ - * @category Function - * @param {*} value The value to wrap. - * @param {Function} wrapper The wrapper function. - * @returns {Function} Returns the new function. - * @example - * - * var p = _.wrap(_.escape, function(func, text) { - * return '

      ' + func(text) + '

      '; - * }); - * - * p('fred, barney, & pebbles'); - * // => '

      fred, barney, & pebbles

      ' - */ - function wrap(value, wrapper) { - wrapper = wrapper == null ? identity : wrapper; - return createWrapper(wrapper, PARTIAL_FLAG, null, [value], []); - } - - /*------------------------------------------------------------------------*/ - - /** - * Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned, - * otherwise they are assigned by reference. If `customizer` is provided it is - * invoked to produce the cloned values. If `customizer` returns `undefined` - * cloning is handled by the method instead. The `customizer` is bound to - * `thisArg` and invoked with two argument; (value [, index|key, object]). - * - * **Note:** This method is loosely based on the - * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm). - * The enumerable properties of `arguments` objects and objects created by - * constructors other than `Object` are cloned to plain `Object` objects. An - * empty object is returned for uncloneable values such as functions, DOM nodes, - * Maps, Sets, and WeakMaps. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @param {Function} [customizer] The function to customize cloning values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {*} Returns the cloned value. - * @example - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * var shallow = _.clone(users); - * shallow[0] === users[0]; - * // => true - * - * var deep = _.clone(users, true); - * deep[0] === users[0]; - * // => false - * - * // using a customizer callback - * var el = _.clone(document.body, function(value) { - * if (_.isElement(value)) { - * return value.cloneNode(false); - * } - * }); - * - * el === document.body - * // => false - * el.nodeName - * // => BODY - * el.childNodes.length; - * // => 0 - */ - function clone(value, isDeep, customizer, thisArg) { - if (isDeep && typeof isDeep != 'boolean' && isIterateeCall(value, isDeep, customizer)) { - isDeep = false; - } - else if (typeof isDeep == 'function') { - thisArg = customizer; - customizer = isDeep; - isDeep = false; - } - return typeof customizer == 'function' - ? baseClone(value, isDeep, bindCallback(customizer, thisArg, 1)) - : baseClone(value, isDeep); - } - - /** - * Creates a deep clone of `value`. If `customizer` is provided it is invoked - * to produce the cloned values. If `customizer` returns `undefined` cloning - * is handled by the method instead. The `customizer` is bound to `thisArg` - * and invoked with two argument; (value [, index|key, object]). - * - * **Note:** This method is loosely based on the - * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm). - * The enumerable properties of `arguments` objects and objects created by - * constructors other than `Object` are cloned to plain `Object` objects. An - * empty object is returned for uncloneable values such as functions, DOM nodes, - * Maps, Sets, and WeakMaps. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to deep clone. - * @param {Function} [customizer] The function to customize cloning values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {*} Returns the deep cloned value. - * @example - * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } - * ]; - * - * var deep = _.cloneDeep(users); - * deep[0] === users[0]; - * // => false - * - * // using a customizer callback - * var el = _.cloneDeep(document.body, function(value) { - * if (_.isElement(value)) { - * return value.cloneNode(true); - * } - * }); - * - * el === document.body - * // => false - * el.nodeName - * // => BODY - * el.childNodes.length; - * // => 20 - */ - function cloneDeep(value, customizer, thisArg) { - return typeof customizer == 'function' - ? baseClone(value, true, bindCallback(customizer, thisArg, 1)) - : baseClone(value, true); - } - - /** - * Checks if `value` is greater than `other`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, else `false`. - * @example - * - * _.gt(3, 1); - * // => true - * - * _.gt(3, 3); - * // => false - * - * _.gt(1, 3); - * // => false - */ - function gt(value, other) { - return value > other; - } - - /** - * Checks if `value` is greater than or equal to `other`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than or equal to `other`, else `false`. - * @example - * - * _.gte(3, 1); - * // => true - * - * _.gte(3, 3); - * // => true - * - * _.gte(1, 3); - * // => false - */ - function gte(value, other) { - return value >= other; - } - - /** - * Checks if `value` is classified as an `arguments` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - function isArguments(value) { - return isObjectLike(value) && isArrayLike(value) && objToString.call(value) == argsTag; - } - - /** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(function() { return arguments; }()); - * // => false - */ - var isArray = nativeIsArray || function(value) { - return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag; - }; - - /** - * Checks if `value` is classified as a boolean primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isBoolean(false); - * // => true - * - * _.isBoolean(null); - * // => false - */ - function isBoolean(value) { - return value === true || value === false || (isObjectLike(value) && objToString.call(value) == boolTag); - } - - /** - * Checks if `value` is classified as a `Date` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isDate(new Date); - * // => true - * - * _.isDate('Mon April 23 2012'); - * // => false - */ - function isDate(value) { - return isObjectLike(value) && objToString.call(value) == dateTag; - } - - /** - * Checks if `value` is a DOM element. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. - * @example - * - * _.isElement(document.body); - * // => true - * - * _.isElement(''); - * // => false - */ - function isElement(value) { - return !!value && value.nodeType === 1 && isObjectLike(value) && - (objToString.call(value).indexOf('Element') > -1); - } - // Fallback for environments without DOM support. - if (!support.dom) { - isElement = function(value) { - return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value); - }; - } - - /** - * Checks if `value` is empty. A value is considered empty unless it is an - * `arguments` object, array, string, or jQuery-like collection with a length - * greater than `0` or an object with own enumerable properties. - * - * @static - * @memberOf _ - * @category Lang - * @param {Array|Object|string} value The value to inspect. - * @returns {boolean} Returns `true` if `value` is empty, else `false`. - * @example - * - * _.isEmpty(null); - * // => true - * - * _.isEmpty(true); - * // => true - * - * _.isEmpty(1); - * // => true - * - * _.isEmpty([1, 2, 3]); - * // => false - * - * _.isEmpty({ 'a': 1 }); - * // => false - */ - function isEmpty(value) { - if (value == null) { - return true; - } - if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) || - (isObjectLike(value) && isFunction(value.splice)))) { - return !value.length; - } - return !keys(value).length; - } - - /** - * Performs a deep comparison between two values to determine if they are - * equivalent. If `customizer` is provided it is invoked to compare values. - * If `customizer` returns `undefined` comparisons are handled by the method - * instead. The `customizer` is bound to `thisArg` and invoked with three - * arguments: (value, other [, index|key]). - * - * **Note:** This method supports comparing arrays, booleans, `Date` objects, - * numbers, `Object` objects, regexes, and strings. Objects are compared by - * their own, not inherited, enumerable properties. Functions and DOM nodes - * are **not** supported. Provide a customizer function to extend support - * for comparing other values. - * - * @static - * @memberOf _ - * @alias eq - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize value comparisons. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * object == other; - * // => false - * - * _.isEqual(object, other); - * // => true - * - * // using a customizer callback - * var array = ['hello', 'goodbye']; - * var other = ['hi', 'goodbye']; - * - * _.isEqual(array, other, function(value, other) { - * if (_.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/)) { - * return true; - * } - * }); - * // => true - */ - function isEqual(value, other, customizer, thisArg) { - customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined; - var result = customizer ? customizer(value, other) : undefined; - return result === undefined ? baseIsEqual(value, other, customizer) : !!result; - } - - /** - * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, - * `SyntaxError`, `TypeError`, or `URIError` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an error object, else `false`. - * @example - * - * _.isError(new Error); - * // => true - * - * _.isError(Error); - * // => false - */ - function isError(value) { - return isObjectLike(value) && typeof value.message == 'string' && objToString.call(value) == errorTag; - } - - /** - * Checks if `value` is a finite primitive number. - * - * **Note:** This method is based on [`Number.isFinite`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. - * @example - * - * _.isFinite(10); - * // => true - * - * _.isFinite('10'); - * // => false - * - * _.isFinite(true); - * // => false - * - * _.isFinite(Object(10)); - * // => false - * - * _.isFinite(Infinity); - * // => false - */ - var isFinite = nativeNumIsFinite || function(value) { - return typeof value == 'number' && nativeIsFinite(value); - }; - - /** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ - var isFunction = !(baseIsFunction(/x/) || (Uint8Array && !baseIsFunction(Uint8Array))) ? baseIsFunction : function(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in older versions of Chrome and Safari which return 'function' for regexes - // and Safari 8 equivalents which return 'object' for typed array constructors. - return objToString.call(value) == funcTag; - }; - - /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ - function isObject(value) { - // Avoid a V8 JIT bug in Chrome 19-20. - // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); - } - - /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. If `customizer` is provided - * it is invoked to compare values. If `customizer` returns `undefined` - * comparisons are handled by the method instead. The `customizer` is bound - * to `thisArg` and invoked with three arguments: (value, other, index|key). - * - * **Note:** This method supports comparing properties of arrays, booleans, - * `Date` objects, numbers, `Object` objects, regexes, and strings. Functions - * and DOM nodes are **not** supported. Provide a customizer function to extend - * support for comparing other values. - * - * @static - * @memberOf _ - * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Function} [customizer] The function to customize value comparisons. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.isMatch(object, { 'age': 40 }); - * // => true - * - * _.isMatch(object, { 'age': 36 }); - * // => false - * - * // using a customizer callback - * var object = { 'greeting': 'hello' }; - * var source = { 'greeting': 'hi' }; - * - * _.isMatch(object, source, function(value, other) { - * return _.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined; - * }); - * // => true - */ - function isMatch(object, source, customizer, thisArg) { - customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined; - return baseIsMatch(object, getMatchData(source), customizer); - } - - /** - * Checks if `value` is `NaN`. - * - * **Note:** This method is not the same as [`isNaN`](https://es5.github.io/#x15.1.2.4) - * which returns `true` for `undefined` and other non-numeric values. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - * @example - * - * _.isNaN(NaN); - * // => true - * - * _.isNaN(new Number(NaN)); - * // => true - * - * isNaN(undefined); - * // => true - * - * _.isNaN(undefined); - * // => false - */ - function isNaN(value) { - // An `NaN` primitive is the only value that is not equal to itself. - // Perform the `toStringTag` check first to avoid errors with some host objects in IE. - return isNumber(value) && value != +value; - } - - /** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ - function isNative(value) { - if (value == null) { - return false; - } - if (objToString.call(value) == funcTag) { - return reIsNative.test(fnToString.call(value)); - } - return isObjectLike(value) && reIsHostCtor.test(value); - } - - /** - * Checks if `value` is `null`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `null`, else `false`. - * @example - * - * _.isNull(null); - * // => true - * - * _.isNull(void 0); - * // => false - */ - function isNull(value) { - return value === null; - } - - /** - * Checks if `value` is classified as a `Number` primitive or object. - * - * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified - * as numbers, use the `_.isFinite` method. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isNumber(8.4); - * // => true - * - * _.isNumber(NaN); - * // => true - * - * _.isNumber('8.4'); - * // => false - */ - function isNumber(value) { - return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag); - } - - /** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * **Note:** This method assumes objects created by the `Object` constructor - * have no inherited enumerable properties. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ - var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) { - if (!(value && objToString.call(value) == objectTag)) { - return false; - } - var valueOf = getNative(value, 'valueOf'), - objProto = valueOf && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto); - - return objProto - ? (value == objProto || getPrototypeOf(value) == objProto) - : shimIsPlainObject(value); - }; - - /** - * Checks if `value` is classified as a `RegExp` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isRegExp(/abc/); - * // => true - * - * _.isRegExp('/abc/'); - * // => false - */ - function isRegExp(value) { - return isObjectLike(value) && objToString.call(value) == regexpTag; - } - - /** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ - function isString(value) { - return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag); - } - - /** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ - function isTypedArray(value) { - return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)]; - } - - /** - * Checks if `value` is `undefined`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. - * @example - * - * _.isUndefined(void 0); - * // => true - * - * _.isUndefined(null); - * // => false - */ - function isUndefined(value) { - return value === undefined; - } - - /** - * Checks if `value` is less than `other`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than `other`, else `false`. - * @example - * - * _.lt(1, 3); - * // => true - * - * _.lt(3, 3); - * // => false - * - * _.lt(3, 1); - * // => false - */ - function lt(value, other) { - return value < other; - } - - /** - * Checks if `value` is less than or equal to `other`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than or equal to `other`, else `false`. - * @example - * - * _.lte(1, 3); - * // => true - * - * _.lte(3, 3); - * // => true - * - * _.lte(3, 1); - * // => false - */ - function lte(value, other) { - return value <= other; - } - - /** - * Converts `value` to an array. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {Array} Returns the converted array. - * @example - * - * (function() { - * return _.toArray(arguments).slice(1); - * }(1, 2, 3)); - * // => [2, 3] - */ - function toArray(value) { - var length = value ? getLength(value) : 0; - if (!isLength(length)) { - return values(value); - } - if (!length) { - return []; - } - return arrayCopy(value); - } - - /** - * Converts `value` to a plain object flattening inherited enumerable - * properties of `value` to own properties of the plain object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to convert. - * @returns {Object} Returns the converted plain object. - * @example - * - * function Foo() { - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.assign({ 'a': 1 }, new Foo); - * // => { 'a': 1, 'b': 2 } - * - * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); - * // => { 'a': 1, 'b': 2, 'c': 3 } - */ - function toPlainObject(value) { - return baseCopy(value, keysIn(value)); - } - - /*------------------------------------------------------------------------*/ - - /** - * Assigns own enumerable properties of source object(s) to the destination - * object. Subsequent sources overwrite property assignments of previous sources. - * If `customizer` is provided it is invoked to produce the assigned values. - * The `customizer` is bound to `thisArg` and invoked with five arguments: - * (objectValue, sourceValue, key, object, source). - * - * **Note:** This method mutates `object` and is based on - * [`Object.assign`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign). - * - * @static - * @memberOf _ - * @alias extend - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {Object} Returns `object`. - * @example - * - * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' }); - * // => { 'user': 'fred', 'age': 40 } - * - * // using a customizer callback - * var defaults = _.partialRight(_.assign, function(value, other) { - * return _.isUndefined(value) ? other : value; - * }); - * - * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); - * // => { 'user': 'barney', 'age': 36 } - */ - var assign = createAssigner(function(object, source, customizer) { - return customizer - ? assignWith(object, source, customizer) - : baseAssign(object, source); - }); - - /** - * Creates an object that inherits from the given `prototype` object. If a - * `properties` object is provided its own enumerable properties are assigned - * to the created object. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} prototype The object to inherit from. - * @param {Object} [properties] The properties to assign to the object. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Object} Returns the new object. - * @example - * - * function Shape() { - * this.x = 0; - * this.y = 0; - * } - * - * function Circle() { - * Shape.call(this); - * } - * - * Circle.prototype = _.create(Shape.prototype, { - * 'constructor': Circle - * }); - * - * var circle = new Circle; - * circle instanceof Circle; - * // => true - * - * circle instanceof Shape; - * // => true - */ - function create(prototype, properties, guard) { - var result = baseCreate(prototype); - if (guard && isIterateeCall(prototype, properties, guard)) { - properties = null; - } - return properties ? baseAssign(result, properties) : result; - } - - /** - * Assigns own enumerable properties of source object(s) to the destination - * object for all destination properties that resolve to `undefined`. Once a - * property is set, additional values of the same property are ignored. - * - * **Note:** This method mutates `object`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @returns {Object} Returns `object`. - * @example - * - * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); - * // => { 'user': 'barney', 'age': 36 } - */ - var defaults = restParam(function(args) { - var object = args[0]; - if (object == null) { - return object; - } - args.push(assignDefaults); - return assign.apply(undefined, args); - }); - - /** - * This method is like `_.find` except that it returns the key of the first - * element `predicate` returns truthy for instead of the element itself. - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {string|undefined} Returns the key of the matched element, else `undefined`. - * @example - * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findKey(users, function(chr) { - * return chr.age < 40; - * }); - * // => 'barney' (iteration order is not guaranteed) - * - * // using the `_.matches` callback shorthand - * _.findKey(users, { 'age': 1, 'active': true }); - * // => 'pebbles' - * - * // using the `_.matchesProperty` callback shorthand - * _.findKey(users, 'active', false); - * // => 'fred' - * - * // using the `_.property` callback shorthand - * _.findKey(users, 'active'); - * // => 'barney' - */ - var findKey = createFindKey(baseForOwn); - - /** - * This method is like `_.findKey` except that it iterates over elements of - * a collection in the opposite order. - * - * If a property name is provided for `predicate` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `predicate` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {string|undefined} Returns the key of the matched element, else `undefined`. - * @example - * - * var users = { - * 'barney': { 'age': 36, 'active': true }, - * 'fred': { 'age': 40, 'active': false }, - * 'pebbles': { 'age': 1, 'active': true } - * }; - * - * _.findLastKey(users, function(chr) { - * return chr.age < 40; - * }); - * // => returns `pebbles` assuming `_.findKey` returns `barney` - * - * // using the `_.matches` callback shorthand - * _.findLastKey(users, { 'age': 36, 'active': true }); - * // => 'barney' - * - * // using the `_.matchesProperty` callback shorthand - * _.findLastKey(users, 'active', false); - * // => 'fred' - * - * // using the `_.property` callback shorthand - * _.findLastKey(users, 'active'); - * // => 'pebbles' - */ - var findLastKey = createFindKey(baseForOwnRight); - - /** - * Iterates over own and inherited enumerable properties of an object invoking - * `iteratee` for each property. The `iteratee` is bound to `thisArg` and invoked - * with three arguments: (value, key, object). Iteratee functions may exit - * iteration early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forIn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => logs 'a', 'b', and 'c' (iteration order is not guaranteed) - */ - var forIn = createForIn(baseFor); - - /** - * This method is like `_.forIn` except that it iterates over properties of - * `object` in the opposite order. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forInRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => logs 'c', 'b', and 'a' assuming `_.forIn ` logs 'a', 'b', and 'c' - */ - var forInRight = createForIn(baseForRight); - - /** - * Iterates over own enumerable properties of an object invoking `iteratee` - * for each property. The `iteratee` is bound to `thisArg` and invoked with - * three arguments: (value, key, object). Iteratee functions may exit iteration - * early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forOwn(new Foo, function(value, key) { - * console.log(key); - * }); - * // => logs 'a' and 'b' (iteration order is not guaranteed) - */ - var forOwn = createForOwn(baseForOwn); - - /** - * This method is like `_.forOwn` except that it iterates over properties of - * `object` in the opposite order. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns `object`. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.forOwnRight(new Foo, function(value, key) { - * console.log(key); - * }); - * // => logs 'b' and 'a' assuming `_.forOwn` logs 'a' and 'b' - */ - var forOwnRight = createForOwn(baseForOwnRight); - - /** - * Creates an array of function property names from all enumerable properties, - * own and inherited, of `object`. - * - * @static - * @memberOf _ - * @alias methods - * @category Object - * @param {Object} object The object to inspect. - * @returns {Array} Returns the new array of property names. - * @example - * - * _.functions(_); - * // => ['after', 'ary', 'assign', ...] - */ - function functions(object) { - return baseFunctions(object, keysIn(object)); - } - - /** - * Gets the property value at `path` of `object`. If the resolved value is - * `undefined` the `defaultValue` is used in its place. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to get. - * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.get(object, 'a[0].b.c'); - * // => 3 - * - * _.get(object, ['a', '0', 'b', 'c']); - * // => 3 - * - * _.get(object, 'a.b.c', 'default'); - * // => 'default' - */ - function get(object, path, defaultValue) { - var result = object == null ? undefined : baseGet(object, toPath(path), path + ''); - return result === undefined ? defaultValue : result; - } - - /** - * Checks if `path` is a direct property. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` is a direct property, else `false`. - * @example - * - * var object = { 'a': { 'b': { 'c': 3 } } }; - * - * _.has(object, 'a'); - * // => true - * - * _.has(object, 'a.b.c'); - * // => true - * - * _.has(object, ['a', 'b', 'c']); - * // => true - */ - function has(object, path) { - if (object == null) { - return false; - } - var result = hasOwnProperty.call(object, path); - if (!result && !isKey(path)) { - path = toPath(path); - object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); - if (object == null) { - return false; - } - path = last(path); - result = hasOwnProperty.call(object, path); - } - return result || (isLength(object.length) && isIndex(path, object.length) && - (isArray(object) || isArguments(object))); - } - - /** - * Creates an object composed of the inverted keys and values of `object`. - * If `object` contains duplicate values, subsequent values overwrite property - * assignments of previous values unless `multiValue` is `true`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to invert. - * @param {boolean} [multiValue] Allow multiple values per key. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {Object} Returns the new inverted object. - * @example - * - * var object = { 'a': 1, 'b': 2, 'c': 1 }; - * - * _.invert(object); - * // => { '1': 'c', '2': 'b' } - * - * // with `multiValue` - * _.invert(object, true); - * // => { '1': ['a', 'c'], '2': ['b'] } - */ - function invert(object, multiValue, guard) { - if (guard && isIterateeCall(object, multiValue, guard)) { - multiValue = null; - } - var index = -1, - props = keys(object), - length = props.length, - result = {}; - - while (++index < length) { - var key = props[index], - value = object[key]; - - if (multiValue) { - if (hasOwnProperty.call(result, value)) { - result[value].push(key); - } else { - result[value] = [key]; - } - } - else { - result[value] = key; - } - } - return result; - } - - /** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys) - * for more details. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ - var keys = !nativeKeys ? shimKeys : function(object) { - var Ctor = object == null ? null : object.constructor; - if ((typeof Ctor == 'function' && Ctor.prototype === object) || - (typeof object != 'function' && isArrayLike(object))) { - return shimKeys(object); - } - return isObject(object) ? nativeKeys(object) : []; - }; - - /** - * Creates an array of the own and inherited enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keysIn(new Foo); - * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ - function keysIn(object) { - if (object == null) { - return []; - } - if (!isObject(object)) { - object = Object(object); - } - var length = object.length; - length = (length && isLength(length) && - (isArray(object) || isArguments(object)) && length) || 0; - - var Ctor = object.constructor, - index = -1, - isProto = typeof Ctor == 'function' && Ctor.prototype === object, - result = Array(length), - skipIndexes = length > 0; - - while (++index < length) { - result[index] = (index + ''); - } - for (var key in object) { - if (!(skipIndexes && isIndex(key, length)) && - !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; - } - - /** - * The opposite of `_.mapValues`; this method creates an object with the - * same values as `object` and keys generated by running each own enumerable - * property of `object` through `iteratee`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the new mapped object. - * @example - * - * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { - * return key + value; - * }); - * // => { 'a1': 1, 'b2': 2 } - */ - var mapKeys = createObjectMapper(true); - - /** - * Creates an object with the same keys as `object` and values generated by - * running each own enumerable property of `object` through `iteratee`. The - * iteratee function is bound to `thisArg` and invoked with three arguments: - * (value, key, object). - * - * If a property name is provided for `iteratee` the created `_.property` - * style callback returns the property value of the given element. - * - * If a value is also provided for `thisArg` the created `_.matchesProperty` - * style callback returns `true` for elements that have a matching property - * value, else `false`. - * - * If an object is provided for `iteratee` the created `_.matches` style - * callback returns `true` for elements that have the properties of the given - * object, else `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked - * per iteration. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {Object} Returns the new mapped object. - * @example - * - * _.mapValues({ 'a': 1, 'b': 2 }, function(n) { - * return n * 3; - * }); - * // => { 'a': 3, 'b': 6 } - * - * var users = { - * 'fred': { 'user': 'fred', 'age': 40 }, - * 'pebbles': { 'user': 'pebbles', 'age': 1 } - * }; - * - * // using the `_.property` callback shorthand - * _.mapValues(users, 'age'); - * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) - */ - var mapValues = createObjectMapper(); - - /** - * Recursively merges own enumerable properties of the source object(s), that - * don't resolve to `undefined` into the destination object. Subsequent sources - * overwrite property assignments of previous sources. If `customizer` is - * provided it is invoked to produce the merged values of the destination and - * source properties. If `customizer` returns `undefined` merging is handled - * by the method instead. The `customizer` is bound to `thisArg` and invoked - * with five arguments: (objectValue, sourceValue, key, object, source). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The destination object. - * @param {...Object} [sources] The source objects. - * @param {Function} [customizer] The function to customize assigned values. - * @param {*} [thisArg] The `this` binding of `customizer`. - * @returns {Object} Returns `object`. - * @example - * - * var users = { - * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] - * }; - * - * var ages = { - * 'data': [{ 'age': 36 }, { 'age': 40 }] - * }; - * - * _.merge(users, ages); - * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } - * - * // using a customizer callback - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(object, other, function(a, b) { - * if (_.isArray(a)) { - * return a.concat(b); - * } - * }); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } - */ - var merge = createAssigner(baseMerge); - - /** - * The opposite of `_.pick`; this method creates an object composed of the - * own and inherited enumerable properties of `object` that are not omitted. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {Function|...(string|string[])} [predicate] The function invoked per - * iteration or property names to omit, specified as individual property - * names or arrays of property names. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.omit(object, 'age'); - * // => { 'user': 'fred' } - * - * _.omit(object, _.isNumber); - * // => { 'user': 'fred' } - */ - var omit = restParam(function(object, props) { - if (object == null) { - return {}; - } - if (typeof props[0] != 'function') { - var props = arrayMap(baseFlatten(props), String); - return pickByArray(object, baseDifference(keysIn(object), props)); - } - var predicate = bindCallback(props[0], props[1], 3); - return pickByCallback(object, function(value, key, object) { - return !predicate(value, key, object); - }); - }); - - /** - * Creates a two dimensional array of the key-value pairs for `object`, - * e.g. `[[key1, value1], [key2, value2]]`. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the new array of key-value pairs. - * @example - * - * _.pairs({ 'barney': 36, 'fred': 40 }); - * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed) - */ - function pairs(object) { - object = toObject(object); - - var index = -1, - props = keys(object), - length = props.length, - result = Array(length); - - while (++index < length) { - var key = props[index]; - result[index] = [key, object[key]]; - } - return result; - } - - /** - * Creates an object composed of the picked `object` properties. Property - * names may be specified as individual arguments or as arrays of property - * names. If `predicate` is provided it is invoked for each property of `object` - * picking the properties `predicate` returns truthy for. The predicate is - * bound to `thisArg` and invoked with three arguments: (value, key, object). - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The source object. - * @param {Function|...(string|string[])} [predicate] The function invoked per - * iteration or property names to pick, specified as individual property - * names or arrays of property names. - * @param {*} [thisArg] The `this` binding of `predicate`. - * @returns {Object} Returns the new object. - * @example - * - * var object = { 'user': 'fred', 'age': 40 }; - * - * _.pick(object, 'user'); - * // => { 'user': 'fred' } - * - * _.pick(object, _.isString); - * // => { 'user': 'fred' } - */ - var pick = restParam(function(object, props) { - if (object == null) { - return {}; - } - return typeof props[0] == 'function' - ? pickByCallback(object, bindCallback(props[0], props[1], 3)) - : pickByArray(object, baseFlatten(props)); - }); - - /** - * This method is like `_.get` except that if the resolved value is a function - * it is invoked with the `this` binding of its parent object and its result - * is returned. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @param {Array|string} path The path of the property to resolve. - * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. - * @returns {*} Returns the resolved value. - * @example - * - * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; - * - * _.result(object, 'a[0].b.c1'); - * // => 3 - * - * _.result(object, 'a[0].b.c2'); - * // => 4 - * - * _.result(object, 'a.b.c', 'default'); - * // => 'default' - * - * _.result(object, 'a.b.c', _.constant('default')); - * // => 'default' - */ - function result(object, path, defaultValue) { - var result = object == null ? undefined : object[path]; - if (result === undefined) { - if (object != null && !isKey(path, object)) { - path = toPath(path); - object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); - result = object == null ? undefined : object[last(path)]; - } - result = result === undefined ? defaultValue : result; - } - return isFunction(result) ? result.call(object) : result; - } - - /** - * Sets the property value of `path` on `object`. If a portion of `path` - * does not exist it is created. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to augment. - * @param {Array|string} path The path of the property to set. - * @param {*} value The value to set. - * @returns {Object} Returns `object`. - * @example - * - * var object = { 'a': [{ 'b': { 'c': 3 } }] }; - * - * _.set(object, 'a[0].b.c', 4); - * console.log(object.a[0].b.c); - * // => 4 - * - * _.set(object, 'x[0].y.z', 5); - * console.log(object.x[0].y.z); - * // => 5 - */ - function set(object, path, value) { - if (object == null) { - return object; - } - var pathKey = (path + ''); - path = (object[pathKey] != null || isKey(path, object)) ? [pathKey] : toPath(path); - - var index = -1, - length = path.length, - lastIndex = length - 1, - nested = object; - - while (nested != null && ++index < length) { - var key = path[index]; - if (isObject(nested)) { - if (index == lastIndex) { - nested[key] = value; - } else if (nested[key] == null) { - nested[key] = isIndex(path[index + 1]) ? [] : {}; - } - } - nested = nested[key]; - } - return object; - } - - /** - * An alternative to `_.reduce`; this method transforms `object` to a new - * `accumulator` object which is the result of running each of its own enumerable - * properties through `iteratee`, with each invocation potentially mutating - * the `accumulator` object. The `iteratee` is bound to `thisArg` and invoked - * with four arguments: (accumulator, value, key, object). Iteratee functions - * may exit iteration early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @category Object - * @param {Array|Object} object The object to iterate over. - * @param {Function} [iteratee=_.identity] The function invoked per iteration. - * @param {*} [accumulator] The custom accumulator value. - * @param {*} [thisArg] The `this` binding of `iteratee`. - * @returns {*} Returns the accumulated value. - * @example - * - * _.transform([2, 3, 4], function(result, n) { - * result.push(n *= n); - * return n % 2 == 0; - * }); - * // => [4, 9] - * - * _.transform({ 'a': 1, 'b': 2 }, function(result, n, key) { - * result[key] = n * 3; - * }); - * // => { 'a': 3, 'b': 6 } - */ - function transform(object, iteratee, accumulator, thisArg) { - var isArr = isArray(object) || isTypedArray(object); - iteratee = getCallback(iteratee, thisArg, 4); - - if (accumulator == null) { - if (isArr || isObject(object)) { - var Ctor = object.constructor; - if (isArr) { - accumulator = isArray(object) ? new Ctor : []; - } else { - accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : null); - } - } else { - accumulator = {}; - } - } - (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) { - return iteratee(accumulator, value, index, object); - }); - return accumulator; - } - - /** - * Creates an array of the own enumerable property values of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.values(new Foo); - * // => [1, 2] (iteration order is not guaranteed) - * - * _.values('hi'); - * // => ['h', 'i'] - */ - function values(object) { - return baseValues(object, keys(object)); - } - - /** - * Creates an array of the own and inherited enumerable property values - * of `object`. - * - * **Note:** Non-object values are coerced to objects. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property values. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.valuesIn(new Foo); - * // => [1, 2, 3] (iteration order is not guaranteed) - */ - function valuesIn(object) { - return baseValues(object, keysIn(object)); - } - - /*------------------------------------------------------------------------*/ - - /** - * Checks if `n` is between `start` and up to but not including, `end`. If - * `end` is not specified it is set to `start` with `start` then set to `0`. - * - * @static - * @memberOf _ - * @category Number - * @param {number} n The number to check. - * @param {number} [start=0] The start of the range. - * @param {number} end The end of the range. - * @returns {boolean} Returns `true` if `n` is in the range, else `false`. - * @example - * - * _.inRange(3, 2, 4); - * // => true - * - * _.inRange(4, 8); - * // => true - * - * _.inRange(4, 2); - * // => false - * - * _.inRange(2, 2); - * // => false - * - * _.inRange(1.2, 2); - * // => true - * - * _.inRange(5.2, 4); - * // => false - */ - function inRange(value, start, end) { - start = +start || 0; - if (typeof end === 'undefined') { - end = start; - start = 0; - } else { - end = +end || 0; - } - return value >= nativeMin(start, end) && value < nativeMax(start, end); - } - - /** - * Produces a random number between `min` and `max` (inclusive). If only one - * argument is provided a number between `0` and the given number is returned. - * If `floating` is `true`, or either `min` or `max` are floats, a floating-point - * number is returned instead of an integer. - * - * @static - * @memberOf _ - * @category Number - * @param {number} [min=0] The minimum possible value. - * @param {number} [max=1] The maximum possible value. - * @param {boolean} [floating] Specify returning a floating-point number. - * @returns {number} Returns the random number. - * @example - * - * _.random(0, 5); - * // => an integer between 0 and 5 - * - * _.random(5); - * // => also an integer between 0 and 5 - * - * _.random(5, true); - * // => a floating-point number between 0 and 5 - * - * _.random(1.2, 5.2); - * // => a floating-point number between 1.2 and 5.2 - */ - function random(min, max, floating) { - if (floating && isIterateeCall(min, max, floating)) { - max = floating = null; - } - var noMin = min == null, - noMax = max == null; - - if (floating == null) { - if (noMax && typeof min == 'boolean') { - floating = min; - min = 1; - } - else if (typeof max == 'boolean') { - floating = max; - noMax = true; - } - } - if (noMin && noMax) { - max = 1; - noMax = false; - } - min = +min || 0; - if (noMax) { - max = min; - min = 0; - } else { - max = +max || 0; - } - if (floating || min % 1 || max % 1) { - var rand = nativeRandom(); - return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand + '').length - 1)))), max); - } - return baseRandom(min, max); - } - - /*------------------------------------------------------------------------*/ - - /** - * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the camel cased string. - * @example - * - * _.camelCase('Foo Bar'); - * // => 'fooBar' - * - * _.camelCase('--foo-bar'); - * // => 'fooBar' - * - * _.camelCase('__foo_bar__'); - * // => 'fooBar' - */ - var camelCase = createCompounder(function(result, word, index) { - word = word.toLowerCase(); - return result + (index ? (word.charAt(0).toUpperCase() + word.slice(1)) : word); - }); - - /** - * Capitalizes the first character of `string`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to capitalize. - * @returns {string} Returns the capitalized string. - * @example - * - * _.capitalize('fred'); - * // => 'Fred' - */ - function capitalize(string) { - string = baseToString(string); - return string && (string.charAt(0).toUpperCase() + string.slice(1)); - } - - /** - * Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) - * to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to deburr. - * @returns {string} Returns the deburred string. - * @example - * - * _.deburr('déjà vu'); - * // => 'deja vu' - */ - function deburr(string) { - string = baseToString(string); - return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, ''); - } - - /** - * Checks if `string` ends with the given target string. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to search. - * @param {string} [target] The string to search for. - * @param {number} [position=string.length] The position to search from. - * @returns {boolean} Returns `true` if `string` ends with `target`, else `false`. - * @example - * - * _.endsWith('abc', 'c'); - * // => true - * - * _.endsWith('abc', 'b'); - * // => false - * - * _.endsWith('abc', 'b', 2); - * // => true - */ - function endsWith(string, target, position) { - string = baseToString(string); - target = (target + ''); - - var length = string.length; - position = position === undefined - ? length - : nativeMin(position < 0 ? 0 : (+position || 0), length); - - position -= target.length; - return position >= 0 && string.indexOf(target, position) == position; - } - - /** - * Converts the characters "&", "<", ">", '"', "'", and "\`", in `string` to - * their corresponding HTML entities. - * - * **Note:** No other characters are escaped. To escape additional characters - * use a third-party library like [_he_](https://mths.be/he). - * - * Though the ">" character is escaped for symmetry, characters like - * ">" and "/" don't need escaping in HTML and have no special meaning - * unless they're part of a tag or unquoted attribute value. - * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) - * (under "semi-related fun fact") for more details. - * - * Backticks are escaped because in Internet Explorer < 9, they can break out - * of attribute values or HTML comments. See [#59](https://html5sec.org/#59), - * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and - * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/) - * for more details. - * - * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping) - * to reduce XSS vectors. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escape('fred, barney, & pebbles'); - * // => 'fred, barney, & pebbles' - */ - function escape(string) { - // Reset `lastIndex` because in IE < 9 `String#replace` does not. - string = baseToString(string); - return (string && reHasUnescapedHtml.test(string)) - ? string.replace(reUnescapedHtml, escapeHtmlChar) - : string; - } - - /** - * Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|", "?", - * "*", "+", "(", ")", "[", "]", "{" and "}" in `string`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to escape. - * @returns {string} Returns the escaped string. - * @example - * - * _.escapeRegExp('[lodash](https://lodash.com/)'); - * // => '\[lodash\]\(https:\/\/lodash\.com\/\)' - */ - function escapeRegExp(string) { - string = baseToString(string); - return (string && reHasRegExpChars.test(string)) - ? string.replace(reRegExpChars, '\\$&') - : string; - } - - /** - * Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the kebab cased string. - * @example - * - * _.kebabCase('Foo Bar'); - * // => 'foo-bar' - * - * _.kebabCase('fooBar'); - * // => 'foo-bar' - * - * _.kebabCase('__foo_bar__'); - * // => 'foo-bar' - */ - var kebabCase = createCompounder(function(result, word, index) { - return result + (index ? '-' : '') + word.toLowerCase(); - }); - - /** - * Pads `string` on the left and right sides if it's shorter than `length`. - * Padding characters are truncated if they can't be evenly divided by `length`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.pad('abc', 8); - * // => ' abc ' - * - * _.pad('abc', 8, '_-'); - * // => '_-abc_-_' - * - * _.pad('abc', 3); - * // => 'abc' - */ - function pad(string, length, chars) { - string = baseToString(string); - length = +length; - - var strLength = string.length; - if (strLength >= length || !nativeIsFinite(length)) { - return string; - } - var mid = (length - strLength) / 2, - leftLength = floor(mid), - rightLength = ceil(mid); - - chars = createPadding('', rightLength, chars); - return chars.slice(0, leftLength) + string + chars; - } - - /** - * Pads `string` on the left side if it's shorter than `length`. Padding - * characters are truncated if they exceed `length`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padLeft('abc', 6); - * // => ' abc' - * - * _.padLeft('abc', 6, '_-'); - * // => '_-_abc' - * - * _.padLeft('abc', 3); - * // => 'abc' - */ - var padLeft = createPadDir(); - - /** - * Pads `string` on the right side if it's shorter than `length`. Padding - * characters are truncated if they exceed `length`. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padRight('abc', 6); - * // => 'abc ' - * - * _.padRight('abc', 6, '_-'); - * // => 'abc_-_' - * - * _.padRight('abc', 3); - * // => 'abc' - */ - var padRight = createPadDir(true); - - /** - * Converts `string` to an integer of the specified radix. If `radix` is - * `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal, - * in which case a `radix` of `16` is used. - * - * **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#E) - * of `parseInt`. - * - * @static - * @memberOf _ - * @category String - * @param {string} string The string to convert. - * @param {number} [radix] The radix to interpret `value` by. - * @param- {Object} [guard] Enables use as a callback for functions like `_.map`. - * @returns {number} Returns the converted integer. - * @example - * - * _.parseInt('08'); - * // => 8 - * - * _.map(['6', '08', '10'], _.parseInt); - * // => [6, 8, 10] - */ - function parseInt(string, radix, guard) { - if (guard && isIterateeCall(string, radix, guard)) { - radix = 0; - } - return nativeParseInt(string, radix); - } - // Fallback for environments with pre-ES5 implementations. - if (nativeParseInt(whitespace + '08') != 8) { - parseInt = function(string, radix, guard) { - // Firefox < 21 and Opera < 15 follow ES3 for `parseInt`. - // Chrome fails to trim leading whitespace characters. - // See https://code.google.com/p/v8/issues/detail?id=3109 for more details. - if (guard ? isIterateeCall(string, radix, guard) : radix == null) { - radix = 0; - } else if (radix) { - radix = +radix; - } - string = trim(string); - return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10)); - }; - } - - /** - * Repeats the given string `n` times. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to repeat. - * @param {number} [n=0] The number of times to repeat the string. - * @returns {string} Returns the repeated string. - * @example - * - * _.repeat('*', 3); - * // => '***' - * - * _.repeat('abc', 2); - * // => 'abcabc' - * - * _.repeat('abc', 0); - * // => '' - */ - function repeat(string, n) { - var result = ''; - string = baseToString(string); - n = +n; - if (n < 1 || !string || !nativeIsFinite(n)) { - return result; - } - // Leverage the exponentiation by squaring algorithm for a faster repeat. - // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. - do { - if (n % 2) { - result += string; - } - n = floor(n / 2); - string += string; - } while (n); - - return result; - } - - /** - * Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the snake cased string. - * @example - * - * _.snakeCase('Foo Bar'); - * // => 'foo_bar' - * - * _.snakeCase('fooBar'); - * // => 'foo_bar' - * - * _.snakeCase('--foo-bar'); - * // => 'foo_bar' - */ - var snakeCase = createCompounder(function(result, word, index) { - return result + (index ? '_' : '') + word.toLowerCase(); - }); - - /** - * Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to convert. - * @returns {string} Returns the start cased string. - * @example - * - * _.startCase('--foo-bar'); - * // => 'Foo Bar' - * - * _.startCase('fooBar'); - * // => 'Foo Bar' - * - * _.startCase('__foo_bar__'); - * // => 'Foo Bar' - */ - var startCase = createCompounder(function(result, word, index) { - return result + (index ? ' ' : '') + (word.charAt(0).toUpperCase() + word.slice(1)); - }); - - /** - * Checks if `string` starts with the given target string. - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The string to search. - * @param {string} [target] The string to search for. - * @param {number} [position=0] The position to search from. - * @returns {boolean} Returns `true` if `string` starts with `target`, else `false`. - * @example - * - * _.startsWith('abc', 'a'); - * // => true - * - * _.startsWith('abc', 'b'); - * // => false - * - * _.startsWith('abc', 'b', 1); - * // => true - */ - function startsWith(string, target, position) { - string = baseToString(string); - position = position == null - ? 0 - : nativeMin(position < 0 ? 0 : (+position || 0), string.length); - - return string.lastIndexOf(target, position) == position; - } - - /** - * Creates a compiled template function that can interpolate data properties - * in "interpolate" delimiters, HTML-escape interpolated data properties in - * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data - * properties may be accessed as free variables in the template. If a setting - * object is provided it takes precedence over `_.templateSettings` values. - * - * **Note:** In the development build `_.template` utilizes - * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) - * for easier debugging. - * - * For more information on precompiling templates see - * [lodash's custom builds documentation](https://lodash.com/custom-builds). - * - * For more information on Chrome extension sandboxes see - * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). - * - * @static - * @memberOf _ - * @category String - * @param {string} [string=''] The template string. - * @param {Object} [options] The options object. - * @param {RegExp} [options.escape] The HTML "escape" delimiter. - * @param {RegExp} [options.evaluate] The "evaluate" delimiter. - * @param {Object} [options.imports] An object to import into the template as free variables. - * @param {RegExp} [options.interpolate] The "interpolate" delimiter. - * @param {string} [options.sourceURL] The sourceURL of the template's compiled source. - * @param {string} [options.variable] The data object variable name. - * @param- {Object} [otherOptions] Enables the legacy `options` param signature. - * @returns {Function} Returns the compiled template function. - * @example - * - * // using the "interpolate" delimiter to create a compiled template - * var compiled = _.template('hello <%= user %>!'); - * compiled({ 'user': 'fred' }); - * // => 'hello fred!' - * - * // using the HTML "escape" delimiter to escape data property values - * var compiled = _.template('<%- value %>'); - * compiled({ 'value': ' - - - - -
      {{ "%+010d"|sprintf:-123 }}
      -
      {{ "%+010d"|vsprintf:[-123] }}
      -
      {{ "%+010d"|fmt:-123 }}
      -
      {{ "%+010d"|vfmt:[-123] }}
      -
      {{ "I've got %2$d apples and %1$d oranges."|fmt:4:2 }}
      -
      {{ "I've got %(apples)d apples and %(oranges)d oranges."|fmt:{apples: 2, oranges: 4} }}
      - - - - diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.js deleted file mode 100644 index d5bcd097f0e5a8..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! sprintf-js | Alexandru Marasteanu (http://alexei.ro/) | BSD-3-Clause */ - -!function(a){function b(){var a=arguments[0],c=b.cache;return c[a]&&c.hasOwnProperty(a)||(c[a]=b.parse(a)),b.format.call(null,c[a],arguments)}function c(a){return Object.prototype.toString.call(a).slice(8,-1).toLowerCase()}function d(a,b){return Array(b+1).join(a)}var e={not_string:/[^s]/,number:/[dief]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fiosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};b.format=function(a,f){var g,h,i,j,k,l,m,n=1,o=a.length,p="",q=[],r=!0,s="";for(h=0;o>h;h++)if(p=c(a[h]),"string"===p)q[q.length]=a[h];else if("array"===p){if(j=a[h],j[2])for(g=f[n],i=0;i=0),j[8]){case"b":g=g.toString(2);break;case"c":g=String.fromCharCode(g);break;case"d":case"i":g=parseInt(g,10);break;case"e":g=j[7]?g.toExponential(j[7]):g.toExponential();break;case"f":g=j[7]?parseFloat(g).toFixed(j[7]):parseFloat(g);break;case"o":g=g.toString(8);break;case"s":g=(g=String(g))&&j[7]?g.substring(0,j[7]):g;break;case"u":g>>>=0;break;case"x":g=g.toString(16);break;case"X":g=g.toString(16).toUpperCase()}!e.number.test(j[8])||r&&!j[3]?s="":(s=r?"+":"-",g=g.toString().replace(e.sign,"")),l=j[4]?"0"===j[4]?"0":j[4].charAt(1):" ",m=j[6]-(s+g).length,k=j[6]&&m>0?d(l,m):"",q[q.length]=j[5]?s+g+k:"0"===l?s+k+g:k+s+g}return q.join("")},b.cache={},b.parse=function(a){for(var b=a,c=[],d=[],f=0;b;){if(null!==(c=e.text.exec(b)))d[d.length]=c[0];else if(null!==(c=e.modulo.exec(b)))d[d.length]="%";else{if(null===(c=e.placeholder.exec(b)))throw new SyntaxError("[sprintf] unexpected placeholder");if(c[2]){f|=1;var g=[],h=c[2],i=[];if(null===(i=e.key.exec(h)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(g[g.length]=i[1];""!==(h=h.substring(i[0].length));)if(null!==(i=e.key_access.exec(h)))g[g.length]=i[1];else{if(null===(i=e.index_access.exec(h)))throw new SyntaxError("[sprintf] failed to parse named argument key");g[g.length]=i[1]}c[2]=g}else f|=2;if(3===f)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");d[d.length]=c}b=b.substring(c[0].length)}return d};var f=function(a,c,d){return d=(c||[]).slice(0),d.splice(0,0,a),b.apply(null,d)};"undefined"!=typeof exports?(exports.sprintf=b,exports.vsprintf=f):(a.sprintf=b,a.vsprintf=f,"function"==typeof define&&define.amd&&define(function(){return{sprintf:b,vsprintf:f}}))}("undefined"==typeof window?this:window); -//# sourceMappingURL=sprintf.min.map \ No newline at end of file diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.map b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.map deleted file mode 100644 index 33fe1636d58e47..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sprintf.min.js","sources":["../src/sprintf.js"],"names":["window","sprintf","key","arguments","cache","hasOwnProperty","parse","format","call","get_type","variable","Object","prototype","toString","slice","toLowerCase","str_repeat","input","multiplier","Array","join","re","not_string","number","text","modulo","placeholder","key_access","index_access","sign","parse_tree","argv","arg","i","k","match","pad","pad_character","pad_length","cursor","tree_length","length","node_type","output","is_positive","Error","test","isNaN","TypeError","String","fromCharCode","parseInt","toExponential","parseFloat","toFixed","substring","toUpperCase","replace","charAt","fmt","_fmt","arg_names","exec","SyntaxError","field_list","replacement_field","field_match","vsprintf","_argv","splice","apply","exports","define","amd","this"],"mappings":";;CAAA,SAAUA,GAaN,QAASC,KACL,GAAIC,GAAMC,UAAU,GAAIC,EAAQH,EAAQG,KAIxC,OAHMA,GAAMF,IAAQE,EAAMC,eAAeH,KACrCE,EAAMF,GAAOD,EAAQK,MAAMJ,IAExBD,EAAQM,OAAOC,KAAK,KAAMJ,EAAMF,GAAMC,WAoJjD,QAASM,GAASC,GACd,MAAOC,QAAOC,UAAUC,SAASL,KAAKE,GAAUI,MAAM,EAAG,IAAIC,cAGjE,QAASC,GAAWC,EAAOC,GACvB,MAAOC,OAAMD,EAAa,GAAGE,KAAKH,GA1KtC,GAAII,IACAC,WAAY,OACZC,OAAQ,SACRC,KAAM,YACNC,OAAQ,WACRC,YAAa,wFACbxB,IAAK,sBACLyB,WAAY,wBACZC,aAAc,aACdC,KAAM,UAWV5B,GAAQM,OAAS,SAASuB,EAAYC,GAClC,GAAiEC,GAAkBC,EAAGC,EAAGC,EAAOC,EAAKC,EAAeC,EAAhHC,EAAS,EAAGC,EAAcV,EAAWW,OAAQC,EAAY,GAASC,KAA0DC,GAAc,EAAMf,EAAO,EAC3J,KAAKI,EAAI,EAAOO,EAAJP,EAAiBA,IAEzB,GADAS,EAAYjC,EAASqB,EAAWG,IACd,WAAdS,EACAC,EAAOA,EAAOF,QAAUX,EAAWG,OAElC,IAAkB,UAAdS,EAAuB,CAE5B,GADAP,EAAQL,EAAWG,GACfE,EAAM,GAEN,IADAH,EAAMD,EAAKQ,GACNL,EAAI,EAAGA,EAAIC,EAAM,GAAGM,OAAQP,IAAK,CAClC,IAAKF,EAAI3B,eAAe8B,EAAM,GAAGD,IAC7B,KAAM,IAAIW,OAAM5C,EAAQ,yCAA0CkC,EAAM,GAAGD,IAE/EF,GAAMA,EAAIG,EAAM,GAAGD,QAIvBF,GADKG,EAAM,GACLJ,EAAKI,EAAM,IAGXJ,EAAKQ,IAOf,IAJqB,YAAjB9B,EAASuB,KACTA,EAAMA,KAGNX,EAAGC,WAAWwB,KAAKX,EAAM,KAAyB,UAAjB1B,EAASuB,IAAoBe,MAAMf,GACpE,KAAM,IAAIgB,WAAU/C,EAAQ,0CAA2CQ,EAASuB,IAOpF,QAJIX,EAAGE,OAAOuB,KAAKX,EAAM,MACrBS,EAAcZ,GAAO,GAGjBG,EAAM,IACV,IAAK,IACDH,EAAMA,EAAInB,SAAS,EACvB,MACA,KAAK,IACDmB,EAAMiB,OAAOC,aAAalB,EAC9B,MACA,KAAK,IACL,IAAK,IACDA,EAAMmB,SAASnB,EAAK,GACxB,MACA,KAAK,IACDA,EAAMG,EAAM,GAAKH,EAAIoB,cAAcjB,EAAM,IAAMH,EAAIoB,eACvD,MACA,KAAK,IACDpB,EAAMG,EAAM,GAAKkB,WAAWrB,GAAKsB,QAAQnB,EAAM,IAAMkB,WAAWrB,EACpE,MACA,KAAK,IACDA,EAAMA,EAAInB,SAAS,EACvB,MACA,KAAK,IACDmB,GAAQA,EAAMiB,OAAOjB,KAASG,EAAM,GAAKH,EAAIuB,UAAU,EAAGpB,EAAM,IAAMH,CAC1E,MACA,KAAK,IACDA,KAAc,CAClB,MACA,KAAK,IACDA,EAAMA,EAAInB,SAAS,GACvB,MACA,KAAK,IACDmB,EAAMA,EAAInB,SAAS,IAAI2C,eAG3BnC,EAAGE,OAAOuB,KAAKX,EAAM,KAASS,IAAeT,EAAM,GAKnDN,EAAO,IAJPA,EAAOe,EAAc,IAAM,IAC3BZ,EAAMA,EAAInB,WAAW4C,QAAQpC,EAAGQ,KAAM,KAK1CQ,EAAgBF,EAAM,GAAkB,MAAbA,EAAM,GAAa,IAAMA,EAAM,GAAGuB,OAAO,GAAK,IACzEpB,EAAaH,EAAM,IAAMN,EAAOG,GAAKS,OACrCL,EAAMD,EAAM,IAAMG,EAAa,EAAItB,EAAWqB,EAAeC,GAAoB,GACjFK,EAAOA,EAAOF,QAAUN,EAAM,GAAKN,EAAOG,EAAMI,EAAyB,MAAlBC,EAAwBR,EAAOO,EAAMJ,EAAMI,EAAMP,EAAOG,EAGvH,MAAOW,GAAOvB,KAAK,KAGvBnB,EAAQG,SAERH,EAAQK,MAAQ,SAASqD,GAErB,IADA,GAAIC,GAAOD,EAAKxB,KAAYL,KAAiB+B,EAAY,EAClDD,GAAM,CACT,GAAqC,QAAhCzB,EAAQd,EAAGG,KAAKsC,KAAKF,IACtB9B,EAAWA,EAAWW,QAAUN,EAAM,OAErC,IAAuC,QAAlCA,EAAQd,EAAGI,OAAOqC,KAAKF,IAC7B9B,EAAWA,EAAWW,QAAU,QAE/B,CAAA,GAA4C,QAAvCN,EAAQd,EAAGK,YAAYoC,KAAKF,IAgClC,KAAM,IAAIG,aAAY,mCA/BtB,IAAI5B,EAAM,GAAI,CACV0B,GAAa,CACb,IAAIG,MAAiBC,EAAoB9B,EAAM,GAAI+B,IACnD,IAAuD,QAAlDA,EAAc7C,EAAGnB,IAAI4D,KAAKG,IAe3B,KAAM,IAAIF,aAAY,+CAbtB,KADAC,EAAWA,EAAWvB,QAAUyB,EAAY,GACwC,MAA5ED,EAAoBA,EAAkBV,UAAUW,EAAY,GAAGzB,UACnE,GAA8D,QAAzDyB,EAAc7C,EAAGM,WAAWmC,KAAKG,IAClCD,EAAWA,EAAWvB,QAAUyB,EAAY,OAE3C,CAAA,GAAgE,QAA3DA,EAAc7C,EAAGO,aAAakC,KAAKG,IAIzC,KAAM,IAAIF,aAAY,+CAHtBC,GAAWA,EAAWvB,QAAUyB,EAAY,GAUxD/B,EAAM,GAAK6B,MAGXH,IAAa,CAEjB,IAAkB,IAAdA,EACA,KAAM,IAAIhB,OAAM,4EAEpBf,GAAWA,EAAWW,QAAUN,EAKpCyB,EAAOA,EAAKL,UAAUpB,EAAM,GAAGM,QAEnC,MAAOX,GAGX,IAAIqC,GAAW,SAASR,EAAK5B,EAAMqC,GAG/B,MAFAA,IAASrC,OAAYjB,MAAM,GAC3BsD,EAAMC,OAAO,EAAG,EAAGV,GACZ1D,EAAQqE,MAAM,KAAMF,GAiBR,oBAAZG,UACPA,QAAQtE,QAAUA,EAClBsE,QAAQJ,SAAWA,IAGnBnE,EAAOC,QAAUA,EACjBD,EAAOmE,SAAWA,EAEI,kBAAXK,SAAyBA,OAAOC,KACvCD,OAAO,WACH,OACIvE,QAASA,EACTkE,SAAUA,OAKT,mBAAXnE,QAAyB0E,KAAO1E"} \ No newline at end of file diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/gruntfile.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/gruntfile.js deleted file mode 100644 index 246e1c3b9801fc..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/gruntfile.js +++ /dev/null @@ -1,36 +0,0 @@ -module.exports = function(grunt) { - grunt.initConfig({ - pkg: grunt.file.readJSON("package.json"), - - uglify: { - options: { - banner: "/*! <%= pkg.name %> | <%= pkg.author %> | <%= pkg.license %> */\n", - sourceMap: true - }, - build: { - files: [ - { - src: "src/sprintf.js", - dest: "dist/sprintf.min.js" - }, - { - src: "src/angular-sprintf.js", - dest: "dist/angular-sprintf.min.js" - } - ] - } - }, - - watch: { - js: { - files: "src/*.js", - tasks: ["uglify"] - } - } - }) - - grunt.loadNpmTasks("grunt-contrib-uglify") - grunt.loadNpmTasks("grunt-contrib-watch") - - grunt.registerTask("default", ["uglify", "watch"]) -} diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/package.json b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/package.json deleted file mode 100644 index 64e267c719a6bf..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "sprintf-js", - "version": "1.0.2", - "description": "JavaScript sprintf implementation", - "author": { - "name": "Alexandru Marasteanu", - "email": "hello@alexei.ro", - "url": "http://alexei.ro/" - }, - "main": "src/sprintf.js", - "scripts": { - "test": "mocha test/test.js" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/alexei/sprintf.js.git" - }, - "license": "BSD-3-Clause", - "devDependencies": { - "mocha": "*", - "grunt": "*", - "grunt-contrib-watch": "*", - "grunt-contrib-uglify": "*" - }, - "gitHead": "e8c73065cd1a79a32c697806a4e85f1fe7917592", - "bugs": { - "url": "https://github.com/alexei/sprintf.js/issues" - }, - "homepage": "https://github.com/alexei/sprintf.js", - "_id": "sprintf-js@1.0.2", - "_shasum": "11e4d84ff32144e35b0bf3a66f8587f38d8f9978", - "_from": "sprintf-js@>=1.0.2 <1.1.0", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "alexei", - "email": "hello@alexei.ro" - }, - "maintainers": [ - { - "name": "alexei", - "email": "hello@alexei.ro" - } - ], - "dist": { - "shasum": "11e4d84ff32144e35b0bf3a66f8587f38d8f9978", - "tarball": "http://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.2.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.2.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/test/test.js b/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/test/test.js deleted file mode 100644 index 1717d8fd09684b..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/test/test.js +++ /dev/null @@ -1,72 +0,0 @@ -var assert = require("assert"), - sprintfjs = require("../src/sprintf.js"), - sprintf = sprintfjs.sprintf, - vsprintf = sprintfjs.vsprintf - -describe("sprintfjs", function() { - it("should return formated strings for simple placeholders", function() { - assert.equal("%", sprintf("%%")) - assert.equal("10", sprintf("%b", 2)) - assert.equal("A", sprintf("%c", 65)) - assert.equal("2", sprintf("%d", 2)) - assert.equal("2", sprintf("%i", 2)) - assert.equal("2", sprintf("%d", "2")) - assert.equal("2", sprintf("%i", "2")) - assert.equal("2e+0", sprintf("%e", 2)) - assert.equal("2", sprintf("%u", 2)) - assert.equal("4294967294", sprintf("%u", -2)) - assert.equal("2.2", sprintf("%f", 2.2)) - assert.equal("10", sprintf("%o", 8)) - assert.equal("%s", sprintf("%s", "%s")) - assert.equal("ff", sprintf("%x", 255)) - assert.equal("FF", sprintf("%X", 255)) - assert.equal("Polly wants a cracker", sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants")) - assert.equal("Hello world!", sprintf("Hello %(who)s!", {"who": "world"})) - }) - - it("should return formated strings for complex placeholders", function() { - // sign - assert.equal("2", sprintf("%d", 2)) - assert.equal("-2", sprintf("%d", -2)) - assert.equal("+2", sprintf("%+d", 2)) - assert.equal("-2", sprintf("%+d", -2)) - assert.equal("2", sprintf("%i", 2)) - assert.equal("-2", sprintf("%i", -2)) - assert.equal("+2", sprintf("%+i", 2)) - assert.equal("-2", sprintf("%+i", -2)) - assert.equal("2.2", sprintf("%f", 2.2)) - assert.equal("-2.2", sprintf("%f", -2.2)) - assert.equal("+2.2", sprintf("%+f", 2.2)) - assert.equal("-2.2", sprintf("%+f", -2.2)) - assert.equal("-2.3", sprintf("%+.1f", -2.34)) - assert.equal("-0.0", sprintf("%+.1f", -0.01)) - assert.equal("-000000123", sprintf("%+010d", -123)) - assert.equal("______-123", sprintf("%+'_10d", -123)) - assert.equal("-234.34 123.2", sprintf("%f %f", -234.34, 123.2)) - - // padding - assert.equal("-0002", sprintf("%05d", -2)) - assert.equal("-0002", sprintf("%05i", -2)) - assert.equal(" <", sprintf("%5s", "<")) - assert.equal("0000<", sprintf("%05s", "<")) - assert.equal("____<", sprintf("%'_5s", "<")) - assert.equal("> ", sprintf("%-5s", ">")) - assert.equal(">0000", sprintf("%0-5s", ">")) - assert.equal(">____", sprintf("%'_-5s", ">")) - assert.equal("xxxxxx", sprintf("%5s", "xxxxxx")) - assert.equal("1234", sprintf("%02u", 1234)) - assert.equal(" -10.235", sprintf("%8.3f", -10.23456)) - assert.equal("-12.34 xxx", sprintf("%f %s", -12.34, "xxx")) - - // precision - assert.equal("2.3", sprintf("%.1f", 2.345)) - assert.equal("xxxxx", sprintf("%5.5s", "xxxxxx")) - assert.equal(" x", sprintf("%5.1s", "xxxxxx")) - - }) - - it("should return formated strings for callbacks", function() { - assert.equal("foobar", sprintf("%s", function() { return "foobar" })) - assert.equal(Date.now(), sprintf("%s", Date.now)) // should pass... - }) -}) diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/package.json b/tools/eslint/node_modules/js-yaml/node_modules/argparse/package.json deleted file mode 100644 index 3c1b7fd712bbcc..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "argparse", - "description": "Very powerful CLI arguments parser. Native port of argparse - python's options parsing library", - "version": "1.0.2", - "keywords": [ - "cli", - "parser", - "argparse", - "option", - "args" - ], - "homepage": "https://github.com/nodeca/argparse", - "contributors": [ - { - "name": "Eugene Shkuropat" - }, - { - "name": "Paul Jacobson" - } - ], - "bugs": { - "url": "https://github.com/nodeca/argparse/issues" - }, - "license": "MIT", - "repository": { - "type": "git", - "url": "git://github.com/nodeca/argparse.git" - }, - "main": "./index.js", - "scripts": { - "test": "make test" - }, - "dependencies": { - "lodash": ">= 3.2.0 < 4.0.0", - "sprintf-js": "~1.0.2" - }, - "devDependencies": { - "mocha": "*" - }, - "gitHead": "990f1b5332e70dd3c1c437d2f4077a2b63ac9674", - "_id": "argparse@1.0.2", - "_shasum": "bcfae39059656d1973d0b9e6a1a74154b5a9a136", - "_from": "argparse@>=1.0.2 <1.1.0", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "vitaly", - "email": "vitaly@rcdesign.ru" - }, - "maintainers": [ - { - "name": "vitaly", - "email": "vitaly@rcdesign.ru" - } - ], - "dist": { - "shasum": "bcfae39059656d1973d0b9e6a1a74154b5a9a136", - "tarball": "http://registry.npmjs.org/argparse/-/argparse-1.0.2.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.2.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/tools/eslint/node_modules/js-yaml/node_modules/esprima/ChangeLog b/tools/eslint/node_modules/js-yaml/node_modules/esprima/ChangeLog deleted file mode 100644 index 72d64b5d813cf5..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/esprima/ChangeLog +++ /dev/null @@ -1,111 +0,0 @@ -2015-04-17: Version 2.2.0 - - * Support ES6 import and export declarations (issue 1000) - * Fix line terminator before arrow not recognized as error (issue 1009) - * Support ES6 destructuring (issue 1045) - * Support ES6 template literal (issue 1074) - * Fix the handling of invalid/incomplete string escape sequences (issue 1106) - * Fix ES3 static member access restriction (issue 1120) - * Support for `super` in ES6 class (issue 1147) - -2015-03-09: Version 2.1.0 - - * Support ES6 class (issue 1001) - * Support ES6 rest parameter (issue 1011) - * Expand the location of property getter, setter, and methods (issue 1029) - * Enable TryStatement transition to a single handler (issue 1031) - * Support ES6 computed property name (issue 1037) - * Tolerate unclosed block comment (issue 1041) - * Support ES6 lexical declaration (issue 1065) - -2015-02-06: Version 2.0.0 - - * Support ES6 arrow function (issue 517) - * Support ES6 Unicode code point escape (issue 521) - * Improve the speed and accuracy of comment attachment (issue 522) - * Support ES6 default parameter (issue 519) - * Support ES6 regular expression flags (issue 557) - * Fix scanning of implicit octal literals (issue 565) - * Fix the handling of automatic semicolon insertion (issue 574) - * Support ES6 method definition (issue 620) - * Support ES6 octal integer literal (issue 621) - * Support ES6 binary integer literal (issue 622) - * Support ES6 object literal property value shorthand (issue 624) - -2015-03-03: Version 1.2.5 - - * Fix scanning of implicit octal literals (issue 565) - -2015-02-05: Version 1.2.4 - - * Fix parsing of LeftHandSideExpression in ForInStatement (issue 560) - * Fix the handling of automatic semicolon insertion (issue 574) - -2015-01-18: Version 1.2.3 - - * Fix division by this (issue 616) - -2014-05-18: Version 1.2.2 - - * Fix duplicated tokens when collecting comments (issue 537) - -2014-05-04: Version 1.2.1 - - * Ensure that Program node may still have leading comments (issue 536) - -2014-04-29: Version 1.2.0 - - * Fix semicolon handling for expression statement (issue 462, 533) - * Disallow escaped characters in regular expression flags (issue 503) - * Performance improvement for location tracking (issue 520) - * Improve the speed of comment attachment (issue 522) - -2014-03-26: Version 1.1.1 - - * Fix token handling of forward slash after an array literal (issue 512) - -2014-03-23: Version 1.1.0 - - * Optionally attach comments to the owning syntax nodes (issue 197) - * Simplify binary parsing with stack-based shift reduce (issue 352) - * Always include the raw source of literals (issue 376) - * Add optional input source information (issue 386) - * Tokenizer API for pure lexical scanning (issue 398) - * Improve the web site and its online demos (issue 337, 400, 404) - * Performance improvement for location tracking (issue 417, 424) - * Support HTML comment syntax (issue 451) - * Drop support for legacy browsers (issue 474) - -2013-08-27: Version 1.0.4 - - * Minimize the payload for packages (issue 362) - * Fix missing cases on an empty switch statement (issue 436) - * Support escaped ] in regexp literal character classes (issue 442) - * Tolerate invalid left-hand side expression (issue 130) - -2013-05-17: Version 1.0.3 - - * Variable declaration needs at least one declarator (issue 391) - * Fix benchmark's variance unit conversion (issue 397) - * IE < 9: \v should be treated as vertical tab (issue 405) - * Unary expressions should always have prefix: true (issue 418) - * Catch clause should only accept an identifier (issue 423) - * Tolerate setters without parameter (issue 426) - -2012-11-02: Version 1.0.2 - - Improvement: - - * Fix esvalidate JUnit output upon a syntax error (issue 374) - -2012-10-28: Version 1.0.1 - - Improvements: - - * esvalidate understands shebang in a Unix shell script (issue 361) - * esvalidate treats fatal parsing failure as an error (issue 361) - * Reduce Node.js package via .npmignore (issue 362) - -2012-10-22: Version 1.0.0 - - Initial release. diff --git a/tools/eslint/node_modules/js-yaml/node_modules/esprima/README.md b/tools/eslint/node_modules/js-yaml/node_modules/esprima/README.md deleted file mode 100644 index 9ba7c0f53088a3..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/esprima/README.md +++ /dev/null @@ -1,23 +0,0 @@ -**Esprima** ([esprima.org](http://esprima.org), BSD license) is a high performance, -standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) -parser written in ECMAScript (also popularly known as -[JavaScript](https://en.wikipedia.org/wiki/JavaScript). -Esprima is created and maintained by [Ariya Hidayat](https://twitter.com/ariyahidayat), -with the help of [many contributors](https://github.com/jquery/esprima/contributors). - -### Features - -- Full support for ECMAScript 5.1 ([ECMA-262](http://www.ecma-international.org/publications/standards/Ecma-262.htm)) -- Sensible [syntax tree format](https://github.com/estree/estree/blob/master/spec.md) as standardized by [EStree project](https://github.com/estree/estree) -- Optional tracking of syntax node location (index-based and line-column) -- Heavily tested (~1000 [unit tests](https://github.com/jquery/esprima/tree/master/test/fixtures) with [full code coverage](https://travis-ci.org/jquery/esprima)) -- [Partial support](https://github.com/jquery/esprima/issues/1099) for ECMAScript 6 - -Esprima serves as a **building block** for some JavaScript -language tools, from [code instrumentation](http://esprima.org/demo/functiontrace.html) -to [editor autocompletion](http://esprima.org/demo/autocomplete.html). - -Esprima runs on many popular web browsers, as well as other ECMAScript platforms such as -[Rhino](http://www.mozilla.org/rhino), [Nashorn](http://openjdk.java.net/projects/nashorn/), and [Node.js](https://npmjs.org/package/esprima). - -For more information, check the web site [esprima.org](http://esprima.org). diff --git a/tools/eslint/node_modules/js-yaml/node_modules/esprima/bin/esparse.js b/tools/eslint/node_modules/js-yaml/node_modules/esprima/bin/esparse.js deleted file mode 100755 index 560366695a1e37..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/esprima/bin/esparse.js +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/env node -/* - Copyright (C) 2012 Ariya Hidayat - Copyright (C) 2011 Ariya Hidayat - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/*jslint sloppy:true node:true rhino:true */ - -var fs, esprima, fname, content, options, syntax; - -if (typeof require === 'function') { - fs = require('fs'); - esprima = require('esprima'); -} else if (typeof load === 'function') { - try { - load('esprima.js'); - } catch (e) { - load('../esprima.js'); - } -} - -// Shims to Node.js objects when running under Rhino. -if (typeof console === 'undefined' && typeof process === 'undefined') { - console = { log: print }; - fs = { readFileSync: readFile }; - process = { argv: arguments, exit: quit }; - process.argv.unshift('esparse.js'); - process.argv.unshift('rhino'); -} - -function showUsage() { - console.log('Usage:'); - console.log(' esparse [options] file.js'); - console.log(); - console.log('Available options:'); - console.log(); - console.log(' --comment Gather all line and block comments in an array'); - console.log(' --loc Include line-column location info for each syntax node'); - console.log(' --range Include index-based range for each syntax node'); - console.log(' --raw Display the raw value of literals'); - console.log(' --tokens List all tokens in an array'); - console.log(' --tolerant Tolerate errors on a best-effort basis (experimental)'); - console.log(' -v, --version Shows program version'); - console.log(); - process.exit(1); -} - -if (process.argv.length <= 2) { - showUsage(); -} - -options = {}; - -process.argv.splice(2).forEach(function (entry) { - - if (entry === '-h' || entry === '--help') { - showUsage(); - } else if (entry === '-v' || entry === '--version') { - console.log('ECMAScript Parser (using Esprima version', esprima.version, ')'); - console.log(); - process.exit(0); - } else if (entry === '--comment') { - options.comment = true; - } else if (entry === '--loc') { - options.loc = true; - } else if (entry === '--range') { - options.range = true; - } else if (entry === '--raw') { - options.raw = true; - } else if (entry === '--tokens') { - options.tokens = true; - } else if (entry === '--tolerant') { - options.tolerant = true; - } else if (entry.slice(0, 2) === '--') { - console.log('Error: unknown option ' + entry + '.'); - process.exit(1); - } else if (typeof fname === 'string') { - console.log('Error: more than one input file.'); - process.exit(1); - } else { - fname = entry; - } -}); - -if (typeof fname !== 'string') { - console.log('Error: no input file.'); - process.exit(1); -} - -// Special handling for regular expression literal since we need to -// convert it to a string literal, otherwise it will be decoded -// as object "{}" and the regular expression would be lost. -function adjustRegexLiteral(key, value) { - if (key === 'value' && value instanceof RegExp) { - value = value.toString(); - } - return value; -} - -try { - content = fs.readFileSync(fname, 'utf-8'); - syntax = esprima.parse(content, options); - console.log(JSON.stringify(syntax, adjustRegexLiteral, 4)); -} catch (e) { - console.log('Error: ' + e.message); - process.exit(1); -} diff --git a/tools/eslint/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js b/tools/eslint/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js deleted file mode 100755 index dddd8a2ada461a..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js +++ /dev/null @@ -1,199 +0,0 @@ -#!/usr/bin/env node -/* - Copyright (C) 2012 Ariya Hidayat - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/*jslint sloppy:true plusplus:true node:true rhino:true */ -/*global phantom:true */ - -var fs, system, esprima, options, fnames, count; - -if (typeof esprima === 'undefined') { - // PhantomJS can only require() relative files - if (typeof phantom === 'object') { - fs = require('fs'); - system = require('system'); - esprima = require('./esprima'); - } else if (typeof require === 'function') { - fs = require('fs'); - esprima = require('esprima'); - } else if (typeof load === 'function') { - try { - load('esprima.js'); - } catch (e) { - load('../esprima.js'); - } - } -} - -// Shims to Node.js objects when running under PhantomJS 1.7+. -if (typeof phantom === 'object') { - fs.readFileSync = fs.read; - process = { - argv: [].slice.call(system.args), - exit: phantom.exit - }; - process.argv.unshift('phantomjs'); -} - -// Shims to Node.js objects when running under Rhino. -if (typeof console === 'undefined' && typeof process === 'undefined') { - console = { log: print }; - fs = { readFileSync: readFile }; - process = { argv: arguments, exit: quit }; - process.argv.unshift('esvalidate.js'); - process.argv.unshift('rhino'); -} - -function showUsage() { - console.log('Usage:'); - console.log(' esvalidate [options] file.js'); - console.log(); - console.log('Available options:'); - console.log(); - console.log(' --format=type Set the report format, plain (default) or junit'); - console.log(' -v, --version Print program version'); - console.log(); - process.exit(1); -} - -if (process.argv.length <= 2) { - showUsage(); -} - -options = { - format: 'plain' -}; - -fnames = []; - -process.argv.splice(2).forEach(function (entry) { - - if (entry === '-h' || entry === '--help') { - showUsage(); - } else if (entry === '-v' || entry === '--version') { - console.log('ECMAScript Validator (using Esprima version', esprima.version, ')'); - console.log(); - process.exit(0); - } else if (entry.slice(0, 9) === '--format=') { - options.format = entry.slice(9); - if (options.format !== 'plain' && options.format !== 'junit') { - console.log('Error: unknown report format ' + options.format + '.'); - process.exit(1); - } - } else if (entry.slice(0, 2) === '--') { - console.log('Error: unknown option ' + entry + '.'); - process.exit(1); - } else { - fnames.push(entry); - } -}); - -if (fnames.length === 0) { - console.log('Error: no input file.'); - process.exit(1); -} - -if (options.format === 'junit') { - console.log(''); - console.log(''); -} - -count = 0; -fnames.forEach(function (fname) { - var content, timestamp, syntax, name; - try { - content = fs.readFileSync(fname, 'utf-8'); - - if (content[0] === '#' && content[1] === '!') { - content = '//' + content.substr(2, content.length); - } - - timestamp = Date.now(); - syntax = esprima.parse(content, { tolerant: true }); - - if (options.format === 'junit') { - - name = fname; - if (name.lastIndexOf('/') >= 0) { - name = name.slice(name.lastIndexOf('/') + 1); - } - - console.log(''); - - syntax.errors.forEach(function (error) { - var msg = error.message; - msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); - console.log(' '); - console.log(' ' + - error.message + '(' + name + ':' + error.lineNumber + ')' + - ''); - console.log(' '); - }); - - console.log(''); - - } else if (options.format === 'plain') { - - syntax.errors.forEach(function (error) { - var msg = error.message; - msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); - msg = fname + ':' + error.lineNumber + ': ' + msg; - console.log(msg); - ++count; - }); - - } - } catch (e) { - ++count; - if (options.format === 'junit') { - console.log(''); - console.log(' '); - console.log(' ' + - e.message + '(' + fname + ((e.lineNumber) ? ':' + e.lineNumber : '') + - ')'); - console.log(' '); - console.log(''); - } else { - console.log('Error: ' + e.message); - } - } -}); - -if (options.format === 'junit') { - console.log(''); -} - -if (count > 0) { - process.exit(1); -} - -if (count === 0 && typeof phantom === 'object') { - process.exit(0); -} diff --git a/tools/eslint/node_modules/js-yaml/node_modules/esprima/package.json b/tools/eslint/node_modules/js-yaml/node_modules/esprima/package.json deleted file mode 100644 index 965f6cb6afe6a4..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/esprima/package.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "name": "esprima", - "description": "ECMAScript parsing infrastructure for multipurpose analysis", - "homepage": "http://esprima.org", - "main": "esprima.js", - "bin": { - "esparse": "./bin/esparse.js", - "esvalidate": "./bin/esvalidate.js" - }, - "version": "2.2.0", - "files": [ - "bin", - "test/run.js", - "test/runner.js", - "test/test.js", - "esprima.js" - ], - "engines": { - "node": ">=0.4.0" - }, - "author": { - "name": "Ariya Hidayat", - "email": "ariya.hidayat@gmail.com" - }, - "maintainers": [ - { - "name": "ariya", - "email": "ariya.hidayat@gmail.com" - } - ], - "repository": { - "type": "git", - "url": "git+https://github.com/jquery/esprima.git" - }, - "bugs": { - "url": "http://issues.esprima.org" - }, - "licenses": [ - { - "type": "BSD", - "url": "https://github.com/jquery/esprima/raw/master/LICENSE.BSD" - } - ], - "devDependencies": { - "eslint": "~0.19.0", - "jscs": "~1.12.0", - "istanbul": "~0.3.7", - "escomplex-js": "1.2.0", - "complexity-report": "~1.4.0", - "regenerate": "~0.6.2", - "unicode-7.0.0": "~0.1.5", - "json-diff": "~0.3.1", - "optimist": "~0.6.0" - }, - "keywords": [ - "ast", - "ecmascript", - "javascript", - "parser", - "syntax" - ], - "scripts": { - "generate-regex": "node tools/generate-identifier-regex.js", - "test": "node test/run.js && npm run lint && npm run coverage", - "lint": "npm run check-version && npm run eslint && npm run jscs && npm run complexity", - "check-version": "node tools/check-version.js", - "jscs": "jscs esprima.js", - "eslint": "node node_modules/eslint/bin/eslint.js esprima.js", - "complexity": "node tools/list-complexity.js && cr -s -l -w --maxcyc 17 esprima.js", - "coverage": "npm run analyze-coverage && npm run check-coverage", - "analyze-coverage": "istanbul cover test/runner.js", - "check-coverage": "istanbul check-coverage --statement 100 --branch 100 --function 100", - "benchmark": "node test/benchmarks.js", - "benchmark-quick": "node test/benchmarks.js quick" - }, - "gitHead": "deef03ca006b03912d9f74b041f9239a9045181f", - "_id": "esprima@2.2.0", - "_shasum": "4292c1d68e4173d815fa2290dc7afc96d81fcd83", - "_from": "esprima@>=2.2.0 <2.3.0", - "_npmVersion": "2.5.1", - "_nodeVersion": "0.12.0", - "_npmUser": { - "name": "ariya", - "email": "ariya.hidayat@gmail.com" - }, - "dist": { - "shasum": "4292c1d68e4173d815fa2290dc7afc96d81fcd83", - "tarball": "http://registry.npmjs.org/esprima/-/esprima-2.2.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/esprima/-/esprima-2.2.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/tools/eslint/node_modules/js-yaml/node_modules/esprima/test/run.js b/tools/eslint/node_modules/js-yaml/node_modules/esprima/test/run.js deleted file mode 100644 index a5b919bfdf0003..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/esprima/test/run.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright (C) 2012 Yusuke Suzuki - Copyright (C) 2012 Ariya Hidayat - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/*jslint node:true */ - -(function () { - 'use strict'; - - var child = require('child_process'), - nodejs = '"' + process.execPath + '"', - ret = 0, - suites, - index; - - suites = [ - 'runner', - 'parselibs' - ]; - - function nextTest() { - var suite = suites[index]; - - if (index < suites.length) { - child.exec(nodejs + ' ./test/' + suite + '.js', function (err, stdout, stderr) { - if (stdout) { - process.stdout.write(suite + ': ' + stdout); - } - if (stderr) { - process.stderr.write(suite + ': ' + stderr); - } - if (err) { - ret = err.code; - } - index += 1; - nextTest(); - }); - } else { - process.exit(ret); - } - } - - index = 0; - nextTest(); -}()); diff --git a/tools/eslint/node_modules/js-yaml/node_modules/esprima/test/runner.js b/tools/eslint/node_modules/js-yaml/node_modules/esprima/test/runner.js deleted file mode 100644 index 7f4a1738bb9e85..00000000000000 --- a/tools/eslint/node_modules/js-yaml/node_modules/esprima/test/runner.js +++ /dev/null @@ -1,475 +0,0 @@ -/* - Copyright (C) 2012 Ariya Hidayat - Copyright (C) 2012 Joost-Wim Boekesteijn - Copyright (C) 2012 Yusuke Suzuki - Copyright (C) 2012 Arpad Borsos - Copyright (C) 2011 Ariya Hidayat - Copyright (C) 2011 Yusuke Suzuki - Copyright (C) 2011 Arpad Borsos - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/*jslint browser:true node:true */ -/*global esprima:true, testFixture:true */ - -var runTests; - -function NotMatchingError(expected, actual) { - 'use strict'; - Error.call(this, 'Expected '); - this.expected = expected; - this.actual = actual; -} -NotMatchingError.prototype = new Error(); - -function errorToObject(e) { - 'use strict'; - var msg = e.toString(); - - // Opera 9.64 produces an non-standard string in toString(). - if (msg.substr(0, 6) !== 'Error:') { - if (typeof e.message === 'string') { - msg = 'Error: ' + e.message; - } - } - - return { - index: e.index, - lineNumber: e.lineNumber, - column: e.column, - message: msg - }; -} - -function sortedObject(o) { - if (o === null) { - return o; - } - if (Array.isArray(o)) { - return o.map(sortedObject); - } - if (typeof o !== 'object') { - return o; - } - if (o instanceof RegExp) { - return o; - } - var keys = Object.keys(o); - var result = { - range: undefined, - loc: undefined - }; - keys.forEach(function (key) { - if (o.hasOwnProperty(key)){ - result[key] = sortedObject(o[key]); - } - }); - return result; -} - -function hasAttachedComment(syntax) { - var key; - for (key in syntax) { - if (key === 'leadingComments' || key === 'trailingComments') { - return true; - } - if (typeof syntax[key] === 'object' && syntax[key] !== null) { - if (hasAttachedComment(syntax[key])) { - return true; - } - } - } - return false; -} - -function testParse(esprima, code, syntax) { - 'use strict'; - var expected, tree, actual, options, StringObject, i, len; - - // alias, so that JSLint does not complain. - StringObject = String; - - options = { - comment: (typeof syntax.comments !== 'undefined'), - range: true, - loc: true, - tokens: (typeof syntax.tokens !== 'undefined'), - raw: true, - tolerant: (typeof syntax.errors !== 'undefined'), - source: null, - sourceType: syntax.sourceType - }; - - if (options.comment) { - options.attachComment = hasAttachedComment(syntax); - } - - if (typeof syntax.tokens !== 'undefined') { - if (syntax.tokens.length > 0) { - options.range = (typeof syntax.tokens[0].range !== 'undefined'); - options.loc = (typeof syntax.tokens[0].loc !== 'undefined'); - } - } - - if (typeof syntax.comments !== 'undefined') { - if (syntax.comments.length > 0) { - options.range = (typeof syntax.comments[0].range !== 'undefined'); - options.loc = (typeof syntax.comments[0].loc !== 'undefined'); - } - } - - if (options.loc) { - options.source = syntax.loc.source; - } - - syntax = sortedObject(syntax); - expected = JSON.stringify(syntax, null, 4); - try { - // Some variations of the options. - tree = esprima.parse(code, { tolerant: options.tolerant, sourceType: options.sourceType }); - tree = esprima.parse(code, { tolerant: options.tolerant, sourceType: options.sourceType, range: true }); - tree = esprima.parse(code, { tolerant: options.tolerant, sourceType: options.sourceType, loc: true }); - - tree = esprima.parse(code, options); - - if (options.tolerant) { - for (i = 0, len = tree.errors.length; i < len; i += 1) { - tree.errors[i] = errorToObject(tree.errors[i]); - } - } - tree = sortedObject(tree); - actual = JSON.stringify(tree, null, 4); - - // Only to ensure that there is no error when using string object. - esprima.parse(new StringObject(code), options); - - } catch (e) { - throw new NotMatchingError(expected, e.toString()); - } - if (expected !== actual) { - throw new NotMatchingError(expected, actual); - } - - function filter(key, value) { - return (key === 'loc' || key === 'range') ? undefined : value; - } - - if (options.tolerant) { - return; - } - - - // Check again without any location info. - options.range = false; - options.loc = false; - syntax = sortedObject(syntax); - expected = JSON.stringify(syntax, filter, 4); - try { - tree = esprima.parse(code, options); - - if (options.tolerant) { - for (i = 0, len = tree.errors.length; i < len; i += 1) { - tree.errors[i] = errorToObject(tree.errors[i]); - } - } - tree = sortedObject(tree); - actual = JSON.stringify(tree, filter, 4); - } catch (e) { - throw new NotMatchingError(expected, e.toString()); - } - if (expected !== actual) { - throw new NotMatchingError(expected, actual); - } -} - -function testTokenize(esprima, code, tokens) { - 'use strict'; - var options, expected, actual, tree; - - options = { - comment: true, - tolerant: true, - loc: true, - range: true - }; - - expected = JSON.stringify(tokens, null, 4); - - try { - tree = esprima.tokenize(code, options); - actual = JSON.stringify(tree, null, 4); - } catch (e) { - throw new NotMatchingError(expected, e.toString()); - } - if (expected !== actual) { - throw new NotMatchingError(expected, actual); - } -} - - -function testModule(esprima, code, exception) { - 'use strict'; - var i, options, expected, actual, err, handleInvalidRegexFlag, tokenize; - - // Different parsing options should give the same error. - options = [ - { sourceType: 'module' }, - { sourceType: 'module', comment: true }, - { sourceType: 'module', raw: true }, - { sourceType: 'module', raw: true, comment: true } - ]; - - if (!exception.message) { - exception.message = 'Error: Line 1: ' + exception.description; - } - exception.description = exception.message.replace(/Error: Line [0-9]+: /, ''); - - expected = JSON.stringify(exception); - - for (i = 0; i < options.length; i += 1) { - - try { - esprima.parse(code, options[i]); - } catch (e) { - err = errorToObject(e); - err.description = e.description; - actual = JSON.stringify(err); - } - - if (expected !== actual) { - - // Compensate for old V8 which does not handle invalid flag. - if (exception.message.indexOf('Invalid regular expression') > 0) { - if (typeof actual === 'undefined' && !handleInvalidRegexFlag) { - return; - } - } - - throw new NotMatchingError(expected, actual); - } - - } -} - -function testError(esprima, code, exception) { - 'use strict'; - var i, options, expected, actual, err, handleInvalidRegexFlag, tokenize; - - // Different parsing options should give the same error. - options = [ - {}, - { comment: true }, - { raw: true }, - { raw: true, comment: true } - ]; - - // If handleInvalidRegexFlag is true, an invalid flag in a regular expression - // will throw an exception. In some old version of V8, this is not the case - // and hence handleInvalidRegexFlag is false. - handleInvalidRegexFlag = false; - try { - 'test'.match(new RegExp('[a-z]', 'x')); - } catch (e) { - handleInvalidRegexFlag = true; - } - - exception.description = exception.message.replace(/Error: Line [0-9]+: /, ''); - - if (exception.tokenize) { - tokenize = true; - exception.tokenize = undefined; - } - expected = JSON.stringify(exception); - - for (i = 0; i < options.length; i += 1) { - - try { - if (tokenize) { - esprima.tokenize(code, options[i]); - } else { - esprima.parse(code, options[i]); - } - } catch (e) { - err = errorToObject(e); - err.description = e.description; - actual = JSON.stringify(err); - } - - if (expected !== actual) { - - // Compensate for old V8 which does not handle invalid flag. - if (exception.message.indexOf('Invalid regular expression') > 0) { - if (typeof actual === 'undefined' && !handleInvalidRegexFlag) { - return; - } - } - - throw new NotMatchingError(expected, actual); - } - - } -} - -function testAPI(esprima, code, expected) { - var result; - // API test. - expected = JSON.stringify(expected, null, 4); - try { - result = eval(code); - result = JSON.stringify(result, null, 4); - } catch (e) { - throw new NotMatchingError(expected, e.toString()); - } - if (expected !== result) { - throw new NotMatchingError(expected, result); - } -} - -function generateTestCase(esprima, testCase) { - var tree, fileName = testCase.key + ".tree.json"; - try { - tree = esprima.parse(testCase.case, {loc: true, range: true}); - tree = JSON.stringify(tree, null, 4); - } catch (e) { - if (typeof e.index === 'undefined') { - console.error("Failed to generate test result."); - throw e; - } - tree = errorToObject(e); - tree.description = e.description; - tree = JSON.stringify(tree); - fileName = testCase.key + ".failure.json"; - } - require('fs').writeFileSync(fileName, tree); - console.error("Done."); -} - -if (typeof window === 'undefined') { - (function () { - 'use strict'; - - var esprima = require('../esprima'), - vm = require('vm'), - fs = require('fs'), - diff = require('json-diff').diffString, - total = 0, - result, - failures = [], - cases = {}, - context = {source: '', result: null}, - tick = new Date(), - expected, - testCase, - header; - - function enumerateFixtures(root) { - var dirs = fs.readdirSync(root), key, kind, - kinds = ['case', 'source', 'module', 'run', 'tree', 'tokens', 'failure', 'result'], - suffices = ['js', 'js', 'json', 'js', 'json', 'json', 'json', 'json']; - - dirs.forEach(function (item) { - var i; - if (fs.statSync(root + '/' + item).isDirectory()) { - enumerateFixtures(root + '/' + item); - } else { - kind = 'case'; - key = item.slice(0, -3); - for (i = 1; i < kinds.length; i++) { - var suffix = '.' + kinds[i] + '.' + suffices[i]; - if (item.slice(-suffix.length) === suffix) { - key = item.slice(0, -suffix.length); - kind = kinds[i]; - } - } - key = root + '/' + key; - if (!cases[key]) { - total++; - cases[key] = { key: key }; - } - cases[key][kind] = fs.readFileSync(root + '/' + item, 'utf-8'); - } - }); - } - - enumerateFixtures(__dirname + '/fixtures'); - - for (var key in cases) { - if (cases.hasOwnProperty(key)) { - testCase = cases[key]; - - if (testCase.hasOwnProperty('source')) { - testCase.case = eval(testCase.source + ';source'); - } - - try { - if (testCase.hasOwnProperty('module')) { - testModule(esprima, testCase.case, JSON.parse(testCase.module)); - } else if (testCase.hasOwnProperty('tree')) { - testParse(esprima, testCase.case, JSON.parse(testCase.tree)); - } else if (testCase.hasOwnProperty('tokens')) { - testTokenize(esprima, testCase.case, JSON.parse(testCase.tokens)); - } else if (testCase.hasOwnProperty('failure')) { - testError(esprima, testCase.case, JSON.parse(testCase.failure)); - } else if (testCase.hasOwnProperty('result')) { - testAPI(esprima, testCase.run, JSON.parse(testCase.result)); - } else { - console.error('Incomplete test case:' + testCase.key + '. Generating test result...'); - generateTestCase(esprima, testCase); - } - } catch (e) { - if (!e.expected) { - throw e; - } - e.source = testCase.case || testCase.key; - failures.push(e); - } - } - } - - tick = (new Date()) - tick; - - header = total + ' tests. ' + failures.length + ' failures. ' + - tick + ' ms'; - if (failures.length) { - console.error(header); - failures.forEach(function (failure) { - try { - var expectedObject = JSON.parse(failure.expected); - var actualObject = JSON.parse(failure.actual); - - console.error(failure.source + ': Expected\n ' + - failure.expected.split('\n').join('\n ') + - '\nto match\n ' + failure.actual + '\nDiff:\n' + - diff(expectedObject, actualObject)); - } catch (ex) { - console.error(failure.source + ': Expected\n ' + - failure.expected.split('\n').join('\n ') + - '\nto match\n ' + failure.actual); - } - }); - } else { - console.log(header); - } - process.exit(failures.length === 0 ? 0 : 1); - - }()); -} diff --git a/tools/eslint/node_modules/js-yaml/package.json b/tools/eslint/node_modules/js-yaml/package.json index 724ed14a24dc40..f55dd462312d24 100644 --- a/tools/eslint/node_modules/js-yaml/package.json +++ b/tools/eslint/node_modules/js-yaml/package.json @@ -1,17 +1,54 @@ { - "name": "js-yaml", - "version": "3.3.1", - "description": "YAML 1.2 parser and serializer", - "keywords": [ - "yaml", - "parser", - "serializer", - "pyyaml" + "_args": [ + [ + "js-yaml@^3.5.1", + "/Users/silverwind/git/node/tools/package/package" + ] ], - "homepage": "https://github.com/nodeca/js-yaml", + "_from": "js-yaml@>=3.5.1 <4.0.0", + "_id": "js-yaml@3.5.5", + "_inCache": true, + "_installable": true, + "_location": "/js-yaml", + "_nodeVersion": "4.3.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/js-yaml-3.5.5.tgz_1458226126775_0.5821511475369334" + }, + "_npmUser": { + "email": "vitaly@rcdesign.ru", + "name": "vitaly" + }, + "_npmVersion": "2.14.12", + "_phantomChildren": {}, + "_requested": { + "name": "js-yaml", + "raw": "js-yaml@^3.5.1", + "rawSpec": "^3.5.1", + "scope": null, + "spec": ">=3.5.1 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.5.5.tgz", + "_shasum": "0377c38017cabc7322b0d1fbcd25a491641f2fbe", + "_shrinkwrap": null, + "_spec": "js-yaml@^3.5.1", + "_where": "/Users/silverwind/git/node/tools/package/package", "author": { - "name": "Dervus Grim", - "email": "dervus.grim@gmail.com" + "email": "dervus.grim@gmail.com", + "name": "Vladimir Zapparov" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + }, + "browser": { + "buffer": false + }, + "bugs": { + "url": "https://github.com/nodeca/js-yaml/issues" }, "contributors": [ { @@ -30,55 +67,56 @@ "url": "http://got-ravings.blogspot.com" } ], - "license": "MIT", - "repository": { - "type": "git", - "url": "git://github.com/nodeca/js-yaml.git" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - }, "dependencies": { - "argparse": "~1.0.2", - "esprima": "~2.2.0" + "argparse": "^1.0.2", + "esprima": "^2.6.0" }, + "description": "YAML 1.2 parser and serializer", "devDependencies": { "ansi": "*", "benchmark": "*", - "eslint": "0.18.0", - "eslint-plugin-nodeca": "^1.0.3", + "browserify": "^13.0.0", + "codemirror": "^5.10.0", + "eslint": "^2.0.0-rc.1", "istanbul": "*", - "mocha": "*" + "mocha": "*", + "uglify-js": "^2.6.1" }, - "browser": { - "buffer": false - }, - "scripts": { - "test": "make test" - }, - "gitHead": "c50f9936bd1e99d64a54d30400e377f4fda401c5", - "bugs": { - "url": "https://github.com/nodeca/js-yaml/issues" - }, - "_id": "js-yaml@3.3.1", - "_shasum": "ca1acd3423ec275d12140a7bab51db015ba0b3c0", - "_from": "js-yaml@>=3.2.5 <4.0.0", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "vitaly", - "email": "vitaly@rcdesign.ru" + "directories": {}, + "dist": { + "shasum": "0377c38017cabc7322b0d1fbcd25a491641f2fbe", + "tarball": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.5.5.tgz" }, + "files": [ + "bin/", + "dist/", + "index.js", + "lib/" + ], + "gitHead": "fdd205e5a1175a62868c0efb28a77493e5e34e3f", + "homepage": "https://github.com/nodeca/js-yaml", + "keywords": [ + "parser", + "pyyaml", + "serializer", + "yaml" + ], + "license": "MIT", "maintainers": [ { "name": "vitaly", "email": "vitaly@rcdesign.ru" } ], - "dist": { - "shasum": "ca1acd3423ec275d12140a7bab51db015ba0b3c0", - "tarball": "http://registry.npmjs.org/js-yaml/-/js-yaml-3.3.1.tgz" + "name": "js-yaml", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/nodeca/js-yaml.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.3.1.tgz", - "readme": "ERROR: No README data found!" + "scripts": { + "test": "make test" + }, + "version": "3.5.5" } diff --git a/tools/eslint/node_modules/json-stable-stringify/LICENSE b/tools/eslint/node_modules/json-stable-stringify/LICENSE new file mode 100644 index 00000000000000..ee27ba4b4412b0 --- /dev/null +++ b/tools/eslint/node_modules/json-stable-stringify/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +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/eslint/node_modules/json-stable-stringify/index.js b/tools/eslint/node_modules/json-stable-stringify/index.js new file mode 100644 index 00000000000000..6a4131d44e3065 --- /dev/null +++ b/tools/eslint/node_modules/json-stable-stringify/index.js @@ -0,0 +1,84 @@ +var json = typeof JSON !== 'undefined' ? JSON : require('jsonify'); + +module.exports = function (obj, opts) { + if (!opts) opts = {}; + if (typeof opts === 'function') opts = { cmp: opts }; + var space = opts.space || ''; + if (typeof space === 'number') space = Array(space+1).join(' '); + var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false; + var replacer = opts.replacer || function(key, value) { return value; }; + + var cmp = opts.cmp && (function (f) { + return function (node) { + return function (a, b) { + var aobj = { key: a, value: node[a] }; + var bobj = { key: b, value: node[b] }; + return f(aobj, bobj); + }; + }; + })(opts.cmp); + + var seen = []; + return (function stringify (parent, key, node, level) { + var indent = space ? ('\n' + new Array(level + 1).join(space)) : ''; + var colonSeparator = space ? ': ' : ':'; + + if (node && node.toJSON && typeof node.toJSON === 'function') { + node = node.toJSON(); + } + + node = replacer.call(parent, key, node); + + if (node === undefined) { + return; + } + if (typeof node !== 'object' || node === null) { + return json.stringify(node); + } + if (isArray(node)) { + var out = []; + for (var i = 0; i < node.length; i++) { + var item = stringify(node, i, node[i], level+1) || json.stringify(null); + out.push(indent + space + item); + } + return '[' + out.join(',') + indent + ']'; + } + else { + if (seen.indexOf(node) !== -1) { + if (cycles) return json.stringify('__cycle__'); + throw new TypeError('Converting circular structure to JSON'); + } + else seen.push(node); + + var keys = objectKeys(node).sort(cmp && cmp(node)); + var out = []; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = stringify(node, key, node[key], level+1); + + if(!value) continue; + + var keyValue = json.stringify(key) + + colonSeparator + + value; + ; + out.push(indent + space + keyValue); + } + seen.splice(seen.indexOf(node), 1); + return '{' + out.join(',') + indent + '}'; + } + })({ '': obj }, '', obj, 0); +}; + +var isArray = Array.isArray || function (x) { + return {}.toString.call(x) === '[object Array]'; +}; + +var objectKeys = Object.keys || function (obj) { + var has = Object.prototype.hasOwnProperty || function () { return true }; + var keys = []; + for (var key in obj) { + if (has.call(obj, key)) keys.push(key); + } + return keys; +}; diff --git a/tools/eslint/node_modules/json-stable-stringify/package.json b/tools/eslint/node_modules/json-stable-stringify/package.json new file mode 100644 index 00000000000000..47b386a47e84be --- /dev/null +++ b/tools/eslint/node_modules/json-stable-stringify/package.json @@ -0,0 +1,101 @@ +{ + "_args": [ + [ + "json-stable-stringify@^1.0.0", + "/Users/silverwind/git/node/tools/package/package" + ] + ], + "_from": "json-stable-stringify@>=1.0.0 <2.0.0", + "_id": "json-stable-stringify@1.0.1", + "_inCache": true, + "_installable": true, + "_location": "/json-stable-stringify", + "_nodeVersion": "4.2.1", + "_npmOperationalInternal": { + "host": "packages-5-east.internal.npmjs.com", + "tmp": "tmp/json-stable-stringify-1.0.1.tgz_1454436356521_0.9410459187347442" + }, + "_npmUser": { + "email": "substack@gmail.com", + "name": "substack" + }, + "_npmVersion": "3.4.1", + "_phantomChildren": {}, + "_requested": { + "name": "json-stable-stringify", + "raw": "json-stable-stringify@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "_shasum": "9a759d39c5f2ff503fd5300646ed445f88c4f9af", + "_shrinkwrap": null, + "_spec": "json-stable-stringify@^1.0.0", + "_where": "/Users/silverwind/git/node/tools/package/package", + "author": { + "email": "mail@substack.net", + "name": "James Halliday", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/json-stable-stringify/issues" + }, + "dependencies": { + "jsonify": "~0.0.0" + }, + "description": "deterministic JSON.stringify() with custom sorting to get deterministic hashes from stringified results", + "devDependencies": { + "tape": "~1.0.4" + }, + "directories": {}, + "dist": { + "shasum": "9a759d39c5f2ff503fd5300646ed445f88c4f9af", + "tarball": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz" + }, + "gitHead": "4a3ac9cc006a91e64901f8ebe78d23bf9fc9fbd0", + "homepage": "https://github.com/substack/json-stable-stringify", + "keywords": [ + "deterministic", + "hash", + "json", + "sort", + "stable", + "stringify" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "name": "json-stable-stringify", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/substack/json-stable-stringify.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "testling": { + "browsers": [ + "chrome/15", + "chrome/latest", + "ff/5", + "ff/latest", + "ie/8..latest", + "opera/latest", + "safari/latest" + ], + "files": "test/*.js" + }, + "version": "1.0.1" +} diff --git a/tools/eslint/node_modules/json-stable-stringify/readme.markdown b/tools/eslint/node_modules/json-stable-stringify/readme.markdown new file mode 100644 index 00000000000000..406c3c72614ba7 --- /dev/null +++ b/tools/eslint/node_modules/json-stable-stringify/readme.markdown @@ -0,0 +1,130 @@ +# json-stable-stringify + +deterministic version of `JSON.stringify()` so you can get a consistent hash +from stringified results + +You can also pass in a custom comparison function. + +[![browser support](https://ci.testling.com/substack/json-stable-stringify.png)](https://ci.testling.com/substack/json-stable-stringify) + +[![build status](https://secure.travis-ci.org/substack/json-stable-stringify.png)](http://travis-ci.org/substack/json-stable-stringify) + +# example + +``` js +var stringify = require('json-stable-stringify'); +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +console.log(stringify(obj)); +``` + +output: + +``` +{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8} +``` + +# methods + +``` js +var stringify = require('json-stable-stringify') +``` + +## var str = stringify(obj, opts) + +Return a deterministic stringified string `str` from the object `obj`. + +## options + +### cmp + +If `opts` is given, you can supply an `opts.cmp` to have a custom comparison +function for object keys. Your function `opts.cmp` is called with these +parameters: + +``` js +opts.cmp({ key: akey, value: avalue }, { key: bkey, value: bvalue }) +``` + +For example, to sort on the object key names in reverse order you could write: + +``` js +var stringify = require('json-stable-stringify'); + +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +var s = stringify(obj, function (a, b) { + return a.key < b.key ? 1 : -1; +}); +console.log(s); +``` + +which results in the output string: + +``` +{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3} +``` + +Or if you wanted to sort on the object values in reverse order, you could write: + +``` +var stringify = require('json-stable-stringify'); + +var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 }; +var s = stringify(obj, function (a, b) { + return a.value < b.value ? 1 : -1; +}); +console.log(s); +``` + +which outputs: + +``` +{"d":6,"c":5,"b":[{"z":3,"y":2,"x":1},9],"a":10} +``` + +### space + +If you specify `opts.space`, it will indent the output for pretty-printing. +Valid values are strings (e.g. `{space: \t}`) or a number of spaces +(`{space: 3}`). + +For example: + +```js +var obj = { b: 1, a: { foo: 'bar', and: [1, 2, 3] } }; +var s = stringify(obj, { space: ' ' }); +console.log(s); +``` + +which outputs: + +``` +{ + "a": { + "and": [ + 1, + 2, + 3 + ], + "foo": "bar" + }, + "b": 1 +} +``` + +### replacer + +The replacer parameter is a function `opts.replacer(key, value)` that behaves +the same as the replacer +[from the core JSON object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_native_JSON#The_replacer_parameter). + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install json-stable-stringify +``` + +# license + +MIT diff --git a/tools/eslint/node_modules/jsonify/README.markdown b/tools/eslint/node_modules/jsonify/README.markdown new file mode 100644 index 00000000000000..71d9a93b5974ee --- /dev/null +++ b/tools/eslint/node_modules/jsonify/README.markdown @@ -0,0 +1,34 @@ +jsonify +======= + +This module provides Douglas Crockford's JSON implementation without modifying +any globals. + +`stringify` and `parse` are merely exported without respect to whether or not a +global `JSON` object exists. + +methods +======= + +var json = require('jsonify'); + +json.parse(source, reviver) +--------------------------- + +Return a new javascript object from a parse of the `source` string. + +If a `reviver` function is specified, walk the structure passing each name/value +pair to `reviver.call(parent, key, value)` to transform the `value` before +parsing it. + +json.stringify(value, replacer, space) +-------------------------------------- + +Return a string representation for `value`. + +If `replacer` is specified, walk the structure passing each name/value pair to +`replacer.call(parent, key, value)` to transform the `value` before stringifying +it. + +If `space` is a number, indent the result by that many spaces. +If `space` is a string, use `space` as the indentation. diff --git a/tools/eslint/node_modules/jsonify/index.js b/tools/eslint/node_modules/jsonify/index.js new file mode 100644 index 00000000000000..f728a1605a824d --- /dev/null +++ b/tools/eslint/node_modules/jsonify/index.js @@ -0,0 +1,2 @@ +exports.parse = require('./lib/parse'); +exports.stringify = require('./lib/stringify'); diff --git a/tools/eslint/node_modules/jsonify/lib/parse.js b/tools/eslint/node_modules/jsonify/lib/parse.js new file mode 100644 index 00000000000000..2b88cfff0b11da --- /dev/null +++ b/tools/eslint/node_modules/jsonify/lib/parse.js @@ -0,0 +1,273 @@ +var at, // The index of the current character + ch, // The current character + escapee = { + '"': '"', + '\\': '\\', + '/': '/', + b: '\b', + f: '\f', + n: '\n', + r: '\r', + t: '\t' + }, + text, + + error = function (m) { + // Call error when something is wrong. + throw { + name: 'SyntaxError', + message: m, + at: at, + text: text + }; + }, + + next = function (c) { + // If a c parameter is provided, verify that it matches the current character. + if (c && c !== ch) { + error("Expected '" + c + "' instead of '" + ch + "'"); + } + + // Get the next character. When there are no more characters, + // return the empty string. + + ch = text.charAt(at); + at += 1; + return ch; + }, + + number = function () { + // Parse a number value. + var number, + string = ''; + + if (ch === '-') { + string = '-'; + next('-'); + } + while (ch >= '0' && ch <= '9') { + string += ch; + next(); + } + if (ch === '.') { + string += '.'; + while (next() && ch >= '0' && ch <= '9') { + string += ch; + } + } + if (ch === 'e' || ch === 'E') { + string += ch; + next(); + if (ch === '-' || ch === '+') { + string += ch; + next(); + } + while (ch >= '0' && ch <= '9') { + string += ch; + next(); + } + } + number = +string; + if (!isFinite(number)) { + error("Bad number"); + } else { + return number; + } + }, + + string = function () { + // Parse a string value. + var hex, + i, + string = '', + uffff; + + // When parsing for string values, we must look for " and \ characters. + if (ch === '"') { + while (next()) { + if (ch === '"') { + next(); + return string; + } else if (ch === '\\') { + next(); + if (ch === 'u') { + uffff = 0; + for (i = 0; i < 4; i += 1) { + hex = parseInt(next(), 16); + if (!isFinite(hex)) { + break; + } + uffff = uffff * 16 + hex; + } + string += String.fromCharCode(uffff); + } else if (typeof escapee[ch] === 'string') { + string += escapee[ch]; + } else { + break; + } + } else { + string += ch; + } + } + } + error("Bad string"); + }, + + white = function () { + +// Skip whitespace. + + while (ch && ch <= ' ') { + next(); + } + }, + + word = function () { + +// true, false, or null. + + switch (ch) { + case 't': + next('t'); + next('r'); + next('u'); + next('e'); + return true; + case 'f': + next('f'); + next('a'); + next('l'); + next('s'); + next('e'); + return false; + case 'n': + next('n'); + next('u'); + next('l'); + next('l'); + return null; + } + error("Unexpected '" + ch + "'"); + }, + + value, // Place holder for the value function. + + array = function () { + +// Parse an array value. + + var array = []; + + if (ch === '[') { + next('['); + white(); + if (ch === ']') { + next(']'); + return array; // empty array + } + while (ch) { + array.push(value()); + white(); + if (ch === ']') { + next(']'); + return array; + } + next(','); + white(); + } + } + error("Bad array"); + }, + + object = function () { + +// Parse an object value. + + var key, + object = {}; + + if (ch === '{') { + next('{'); + white(); + if (ch === '}') { + next('}'); + return object; // empty object + } + while (ch) { + key = string(); + white(); + next(':'); + if (Object.hasOwnProperty.call(object, key)) { + error('Duplicate key "' + key + '"'); + } + object[key] = value(); + white(); + if (ch === '}') { + next('}'); + return object; + } + next(','); + white(); + } + } + error("Bad object"); + }; + +value = function () { + +// Parse a JSON value. It could be an object, an array, a string, a number, +// or a word. + + white(); + switch (ch) { + case '{': + return object(); + case '[': + return array(); + case '"': + return string(); + case '-': + return number(); + default: + return ch >= '0' && ch <= '9' ? number() : word(); + } +}; + +// Return the json_parse function. It will have access to all of the above +// functions and variables. + +module.exports = function (source, reviver) { + var result; + + text = source; + at = 0; + ch = ' '; + result = value(); + white(); + if (ch) { + error("Syntax error"); + } + + // If there is a reviver function, we recursively walk the new structure, + // passing each name/value pair to the reviver function for possible + // transformation, starting with a temporary root object that holds the result + // in an empty key. If there is not a reviver function, we simply return the + // result. + + return typeof reviver === 'function' ? (function walk(holder, key) { + var k, v, value = holder[key]; + if (value && typeof value === 'object') { + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = walk(value, k); + if (v !== undefined) { + value[k] = v; + } else { + delete value[k]; + } + } + } + } + return reviver.call(holder, key, value); + }({'': result}, '')) : result; +}; diff --git a/tools/eslint/node_modules/jsonify/lib/stringify.js b/tools/eslint/node_modules/jsonify/lib/stringify.js new file mode 100644 index 00000000000000..e88fb834065b81 --- /dev/null +++ b/tools/eslint/node_modules/jsonify/lib/stringify.js @@ -0,0 +1,154 @@ +var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + gap, + indent, + meta = { // table of character substitutions + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '"' : '\\"', + '\\': '\\\\' + }, + rep; + +function quote(string) { + // If the string contains no control characters, no quote characters, and no + // backslash characters, then we can safely slap some quotes around it. + // Otherwise we must also replace the offending characters with safe escape + // sequences. + + escapable.lastIndex = 0; + return escapable.test(string) ? '"' + string.replace(escapable, function (a) { + var c = meta[a]; + return typeof c === 'string' ? c : + '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }) + '"' : '"' + string + '"'; +} + +function str(key, holder) { + // Produce a string from holder[key]. + var i, // The loop counter. + k, // The member key. + v, // The member value. + length, + mind = gap, + partial, + value = holder[key]; + + // If the value has a toJSON method, call it to obtain a replacement value. + if (value && typeof value === 'object' && + typeof value.toJSON === 'function') { + value = value.toJSON(key); + } + + // If we were called with a replacer function, then call the replacer to + // obtain a replacement value. + if (typeof rep === 'function') { + value = rep.call(holder, key, value); + } + + // What happens next depends on the value's type. + switch (typeof value) { + case 'string': + return quote(value); + + case 'number': + // JSON numbers must be finite. Encode non-finite numbers as null. + return isFinite(value) ? String(value) : 'null'; + + case 'boolean': + case 'null': + // If the value is a boolean or null, convert it to a string. Note: + // typeof null does not produce 'null'. The case is included here in + // the remote chance that this gets fixed someday. + return String(value); + + case 'object': + if (!value) return 'null'; + gap += indent; + partial = []; + + // Array.isArray + if (Object.prototype.toString.apply(value) === '[object Array]') { + length = value.length; + for (i = 0; i < length; i += 1) { + partial[i] = str(i, value) || 'null'; + } + + // Join all of the elements together, separated with commas, and + // wrap them in brackets. + v = partial.length === 0 ? '[]' : gap ? + '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : + '[' + partial.join(',') + ']'; + gap = mind; + return v; + } + + // If the replacer is an array, use it to select the members to be + // stringified. + if (rep && typeof rep === 'object') { + length = rep.length; + for (i = 0; i < length; i += 1) { + k = rep[i]; + if (typeof k === 'string') { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } + else { + // Otherwise, iterate through all of the keys in the object. + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } + + // Join all of the member texts together, separated with commas, + // and wrap them in braces. + + v = partial.length === 0 ? '{}' : gap ? + '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : + '{' + partial.join(',') + '}'; + gap = mind; + return v; + } +} + +module.exports = function (value, replacer, space) { + var i; + gap = ''; + indent = ''; + + // If the space parameter is a number, make an indent string containing that + // many spaces. + if (typeof space === 'number') { + for (i = 0; i < space; i += 1) { + indent += ' '; + } + } + // If the space parameter is a string, it will be used as the indent string. + else if (typeof space === 'string') { + indent = space; + } + + // If there is a replacer, it must be a function or an array. + // Otherwise, throw an error. + rep = replacer; + if (replacer && typeof replacer !== 'function' + && (typeof replacer !== 'object' || typeof replacer.length !== 'number')) { + throw new Error('JSON.stringify'); + } + + // Make a fake root object containing our value under the key of ''. + // Return the result of stringifying the value. + return str('', {'': value}); +}; diff --git a/tools/eslint/node_modules/jsonify/package.json b/tools/eslint/node_modules/jsonify/package.json new file mode 100644 index 00000000000000..0b4be16988a837 --- /dev/null +++ b/tools/eslint/node_modules/jsonify/package.json @@ -0,0 +1,82 @@ +{ + "_args": [ + [ + "jsonify@~0.0.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/json-stable-stringify" + ] + ], + "_defaultsLoaded": true, + "_engineSupported": true, + "_from": "jsonify@>=0.0.0 <0.1.0", + "_id": "jsonify@0.0.0", + "_inCache": true, + "_installable": true, + "_location": "/jsonify", + "_nodeVersion": "v0.5.0-pre", + "_npmVersion": "1.0.10", + "_phantomChildren": {}, + "_requested": { + "name": "jsonify", + "raw": "jsonify@~0.0.0", + "rawSpec": "~0.0.0", + "scope": null, + "spec": ">=0.0.0 <0.1.0", + "type": "range" + }, + "_requiredBy": [ + "/json-stable-stringify" + ], + "_resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "_shasum": "2c74b6ee41d93ca51b7b5aaee8f503631d252a73", + "_shrinkwrap": null, + "_spec": "jsonify@~0.0.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/json-stable-stringify", + "author": { + "name": "Douglas Crockford", + "url": "http://crockford.com/" + }, + "bugs": { + "url": "https://github.com/substack/jsonify/issues" + }, + "dependencies": {}, + "description": "JSON without touching any globals", + "devDependencies": { + "garbage": "0.0.x", + "tap": "0.0.x" + }, + "directories": { + "lib": ".", + "test": "test" + }, + "dist": { + "shasum": "2c74b6ee41d93ca51b7b5aaee8f503631d252a73", + "tarball": "http://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz" + }, + "engines": { + "node": "*" + }, + "homepage": "https://github.com/substack/jsonify#readme", + "keywords": [ + "browser", + "json" + ], + "license": "Public Domain", + "main": "index.js", + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "name": "jsonify", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/substack/jsonify.git" + }, + "scripts": { + "test": "tap test" + }, + "version": "0.0.0" +} diff --git a/tools/eslint/node_modules/jsonpointer/README.md b/tools/eslint/node_modules/jsonpointer/README.md new file mode 100644 index 00000000000000..e096dfa5d62a77 --- /dev/null +++ b/tools/eslint/node_modules/jsonpointer/README.md @@ -0,0 +1,32 @@ +# JSON Pointer for nodejs + +This is an implementation of [JSON Pointer](http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-08). + +## Usage + + var jsonpointer = require("jsonpointer"); + var obj = { foo: 1, bar: { baz: 2}, qux: [3, 4, 5]}; + var one = jsonpointer.get(obj, "/foo"); + var two = jsonpointer.get(obj, "/bar/baz"); + var three = jsonpointer.get(obj, "/qux/0"); + var four = jsonpointer.get(obj, "/qux/1"); + var five = jsonpointer.get(obj, "/qux/2"); + var notfound = jsonpointer.get(obj, "/quo"); // returns null + + jsonpointer.set(obj, "/foo", 6); // obj.foo = 6; + +## Testing + + $ node test.js + All tests pass. + $ + +[![Build Status](https://travis-ci.org/janl/node-jsonpointer.png?branch=master)](https://travis-ci.org/janl/node-jsonpointer) + +## Author + +(c) 2011 Jan Lehnardt + +## License + +MIT License. diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/jsonpointer.js b/tools/eslint/node_modules/jsonpointer/jsonpointer.js similarity index 79% rename from tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/jsonpointer.js rename to tools/eslint/node_modules/jsonpointer/jsonpointer.js index 3f53026efd1eec..006f85ef3a5489 100644 --- a/tools/eslint/node_modules/is-my-json-valid/node_modules/jsonpointer/jsonpointer.js +++ b/tools/eslint/node_modules/jsonpointer/jsonpointer.js @@ -1,5 +1,3 @@ -var console = require("console"); - var untilde = function(str) { return str.replace(/~./g, function(m) { switch (m) { @@ -8,16 +6,15 @@ var untilde = function(str) { case "~1": return "/"; } - throw("Invalid tilde escape: " + m); + throw new Error("Invalid tilde escape: " + m); }); } var traverse = function(obj, pointer, value) { // assert(isArray(pointer)) var part = untilde(pointer.shift()); - if(typeof obj[part] === "undefined") { - throw("Value for pointer '" + pointer + "' not found."); - return; + if(!obj.hasOwnProperty(part)) { + return null; } if(pointer.length !== 0) { // keep traversin! return traverse(obj[part], pointer, value); @@ -39,7 +36,7 @@ var traverse = function(obj, pointer, value) { var validate_input = function(obj, pointer) { if(typeof obj !== "object") { - throw("Invalid input object."); + throw new Error("Invalid input object."); } if(pointer === "") { @@ -47,13 +44,13 @@ var validate_input = function(obj, pointer) { } if(!pointer) { - throw("Invalid JSON pointer."); + throw new Error("Invalid JSON pointer."); } pointer = pointer.split("/"); var first = pointer.shift(); if (first !== "") { - throw("Invalid JSON pointer."); + throw new Error("Invalid JSON pointer."); } return pointer; @@ -70,7 +67,7 @@ var get = function(obj, pointer) { var set = function(obj, pointer, value) { pointer = validate_input(obj, pointer); if (pointer.length === 0) { - throw("Invalid JSON pointer for set.") + throw new Error("Invalid JSON pointer for set.") } return traverse(obj, pointer, value); } diff --git a/tools/eslint/node_modules/jsonpointer/package.json b/tools/eslint/node_modules/jsonpointer/package.json new file mode 100644 index 00000000000000..64f1b24fa9c3dc --- /dev/null +++ b/tools/eslint/node_modules/jsonpointer/package.json @@ -0,0 +1,91 @@ +{ + "_args": [ + [ + "jsonpointer@2.0.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/is-my-json-valid" + ] + ], + "_from": "jsonpointer@2.0.0", + "_id": "jsonpointer@2.0.0", + "_inCache": true, + "_installable": true, + "_location": "/jsonpointer", + "_nodeVersion": "0.10.36", + "_npmUser": { + "email": "marc.brookman@gmail.com", + "name": "marcbachmann" + }, + "_npmVersion": "2.10.1", + "_phantomChildren": {}, + "_requested": { + "name": "jsonpointer", + "raw": "jsonpointer@2.0.0", + "rawSpec": "2.0.0", + "scope": null, + "spec": "2.0.0", + "type": "version" + }, + "_requiredBy": [ + "/is-my-json-valid" + ], + "_resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz", + "_shasum": "3af1dd20fe85463910d469a385e33017d2a030d9", + "_shrinkwrap": null, + "_spec": "jsonpointer@2.0.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/is-my-json-valid", + "author": { + "email": "jan@apache.org", + "name": "Jan Lehnardt" + }, + "bugs": { + "url": "http://github.com/janl/node-jsonpointer/issues" + }, + "contributors": [ + { + "name": "Joe Hildebrand", + "email": "joe-github@cursive.net" + } + ], + "dependencies": {}, + "description": "Simple JSON Addressing.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "3af1dd20fe85463910d469a385e33017d2a030d9", + "tarball": "http://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz" + }, + "engines": { + "node": ">=0.6.0" + }, + "gitHead": "26ea4a5c0fcb6d9a2e87f733403791dd05637af8", + "homepage": "https://github.com/janl/node-jsonpointer#readme", + "license": "MIT", + "main": "./jsonpointer", + "maintainers": [ + { + "name": "jan", + "email": "jan@apache.org" + }, + { + "name": "marcbachmann", + "email": "marc.brookman@gmail.com" + } + ], + "name": "jsonpointer", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/janl/node-jsonpointer.git" + }, + "scripts": { + "test": "node test.js" + }, + "tags": [ + "simple", + "util", + "util", + "utility" + ], + "version": "2.0.0" +} diff --git a/tools/eslint/node_modules/optionator/node_modules/levn/LICENSE b/tools/eslint/node_modules/levn/LICENSE similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/levn/LICENSE rename to tools/eslint/node_modules/levn/LICENSE diff --git a/tools/eslint/node_modules/levn/README.md b/tools/eslint/node_modules/levn/README.md new file mode 100644 index 00000000000000..bb9ffea0555810 --- /dev/null +++ b/tools/eslint/node_modules/levn/README.md @@ -0,0 +1,196 @@ +# levn [![Build Status](https://travis-ci.org/gkz/levn.png)](https://travis-ci.org/gkz/levn) +__Light ECMAScript (JavaScript) Value Notation__ +Levn is a library which allows you to parse a string into a JavaScript value based on an expected type. It is meant for short amounts of human entered data (eg. config files, command line arguments). + +Levn aims to concisely describe JavaScript values in text, and allow for the extraction and validation of those values. Levn uses [type-check](https://github.com/gkz/type-check) for its type format, and to validate the results. MIT license. Version 0.3.0. + +__How is this different than JSON?__ levn is meant to be written by humans only, is (due to the previous point) much more concise, can be validated against supplied types, has regex and date literals, and can easily be extended with custom types. On the other hand, it is probably slower and thus less efficient at transporting large amounts of data, which is fine since this is not its purpose. + + npm install levn + +For updates on levn, [follow me on twitter](https://twitter.com/gkzahariev). + + +## Quick Examples + +```js +var parse = require('levn').parse; +parse('Number', '2'); // 2 +parse('String', '2'); // '2' +parse('String', 'levn'); // 'levn' +parse('String', 'a b'); // 'a b' +parse('Boolean', 'true'); // true + +parse('Date', '#2011-11-11#'); // (Date object) +parse('Date', '2011-11-11'); // (Date object) +parse('RegExp', '/[a-z]/gi'); // /[a-z]/gi +parse('RegExp', 're'); // /re/ +parse('Int', '2'); // 2 + +parse('Number | String', 'str'); // 'str' +parse('Number | String', '2'); // 2 + +parse('[Number]', '[1,2,3]'); // [1,2,3] +parse('(String, Boolean)', '(hi, false)'); // ['hi', false] +parse('{a: String, b: Number}', '{a: str, b: 2}'); // {a: 'str', b: 2} + +// at the top level, you can ommit surrounding delimiters +parse('[Number]', '1,2,3'); // [1,2,3] +parse('(String, Boolean)', 'hi, false'); // ['hi', false] +parse('{a: String, b: Number}', 'a: str, b: 2'); // {a: 'str', b: 2} + +// wildcard - auto choose type +parse('*', '[hi,(null,[42]),{k: true}]'); // ['hi', [null, [42]], {k: true}] +``` +## Usage + +`require('levn');` returns an object that exposes three properties. `VERSION` is the current version of the library as a string. `parse` and `parsedTypeParse` are functions. + +```js +// parse(type, input, options); +parse('[Number]', '1,2,3'); // [1, 2, 3] + +// parsedTypeParse(parsedType, input, options); +var parsedType = require('type-check').parseType('[Number]'); +parsedTypeParse(parsedType, '1,2,3'); // [1, 2, 3] +``` + +### parse(type, input, options) + +`parse` casts the string `input` into a JavaScript value according to the specified `type` in the [type format](https://github.com/gkz/type-check#type-format) (and taking account the optional `options`) and returns the resulting JavaScript value. + +##### arguments +* type - `String` - the type written in the [type format](https://github.com/gkz/type-check#type-format) which to check against +* input - `String` - the value written in the [levn format](#levn-format) +* options - `Maybe Object` - an optional parameter specifying additional [options](#options) + +##### returns +`*` - the resulting JavaScript value + +##### example +```js +parse('[Number]', '1,2,3'); // [1, 2, 3] +``` + +### parsedTypeParse(parsedType, input, options) + +`parsedTypeParse` casts the string `input` into a JavaScript value according to the specified `type` which has already been parsed (and taking account the optional `options`) and returns the resulting JavaScript value. You can parse a type using the [type-check](https://github.com/gkz/type-check) library's `parseType` function. + +##### arguments +* type - `Object` - the type in the parsed type format which to check against +* input - `String` - the value written in the [levn format](#levn-format) +* options - `Maybe Object` - an optional parameter specifying additional [options](#options) + +##### returns +`*` - the resulting JavaScript value + +##### example +```js +var parsedType = require('type-check').parseType('[Number]'); +parsedTypeParse(parsedType, '1,2,3'); // [1, 2, 3] +``` + +## Levn Format + +Levn can use the type information you provide to choose the appropriate value to produce from the input. For the same input, it will choose a different output value depending on the type provided. For example, `parse('Number', '2')` will produce the number `2`, but `parse('String', '2')` will produce the string `"2"`. + +If you do not provide type information, and simply use `*`, levn will parse the input according the unambiguous "explicit" mode, which we will now detail - you can also set the `explicit` option to true manually in the [options](#options). + +* `"string"`, `'string'` are parsed as a String, eg. `"a msg"` is `"a msg"` +* `#date#` is parsed as a Date, eg. `#2011-11-11#` is `new Date('2011-11-11')` +* `/regexp/flags` is parsed as a RegExp, eg. `/re/gi` is `/re/gi` +* `undefined`, `null`, `NaN`, `true`, and `false` are all their JavaScript equivalents +* `[element1, element2, etc]` is an Array, and the casting procedure is recursively applied to each element. Eg. `[1,2,3]` is `[1,2,3]`. +* `(element1, element2, etc)` is an tuple, and the casting procedure is recursively applied to each element. Eg. `(1, a)` is `(1, a)` (is `[1, 'a']`). +* `{key1: val1, key2: val2, ...}` is an Object, and the casting procedure is recursively applied to each property. Eg. `{a: 1, b: 2}` is `{a: 1, b: 2}`. +* Any test which does not fall under the above, and which does not contain special characters (`[``]``(``)``{``}``:``,`) is a string, eg. `$12- blah` is `"$12- blah"`. + +If you do provide type information, you can make your input more concise as the program already has some information about what it expects. Please see the [type format](https://github.com/gkz/type-check#type-format) section of [type-check](https://github.com/gkz/type-check) for more information about how to specify types. There are some rules about what levn can do with the information: + +* If a String is expected, and only a String, all characters of the input (including any special ones) will become part of the output. Eg. `[({})]` is `"[({})]"`, and `"hi"` is `'"hi"'`. +* If a Date is expected, the surrounding `#` can be omitted from date literals. Eg. `2011-11-11` is `new Date('2011-11-11')`. +* If a RegExp is expected, no flags need to be specified, and the regex is not using any of the special characters,the opening and closing `/` can be omitted - this will have the affect of setting the source of the regex to the input. Eg. `regex` is `/regex/`. +* If an Array is expected, and it is the root node (at the top level), the opening `[` and closing `]` can be omitted. Eg. `1,2,3` is `[1,2,3]`. +* If a tuple is expected, and it is the root node (at the top level), the opening `(` and closing `)` can be omitted. Eg. `1, a` is `(1, a)` (is `[1, 'a']`). +* If an Object is expected, and it is the root node (at the top level), the opening `{` and closing `}` can be omitted. Eg `a: 1, b: 2` is `{a: 1, b: 2}`. + +If you list multiple types (eg. `Number | String`), it will first attempt to cast to the first type and then validate - if the validation fails it will move on to the next type and so forth, left to right. You must be careful as some types will succeed with any input, such as String. Thus put String at the end of your list. In non-explicit mode, Date and RegExp will succeed with a large variety of input - also be careful with these and list them near the end if not last in your list. + +Whitespace between special characters and elements is inconsequential. + +## Options + +Options is an object. It is an optional parameter to the `parse` and `parsedTypeParse` functions. + +### Explicit + +A `Boolean`. By default it is `false`. + +__Example:__ + +```js +parse('RegExp', 're', {explicit: false}); // /re/ +parse('RegExp', 're', {explicit: true}); // Error: ... does not type check... +parse('RegExp | String', 're', {explicit: true}); // 're' +``` + +`explicit` sets whether to be in explicit mode or not. Using `*` automatically activates explicit mode. For more information, read the [levn format](#levn-format) section. + +### customTypes + +An `Object`. Empty `{}` by default. + +__Example:__ + +```js +var options = { + customTypes: { + Even: { + typeOf: 'Number', + validate: function (x) { + return x % 2 === 0; + }, + cast: function (x) { + return {type: 'Just', value: parseInt(x)}; + } + } + } +} +parse('Even', '2', options); // 2 +parse('Even', '3', options); // Error: Value: "3" does not type check... +``` + +__Another Example:__ +```js +function Person(name, age){ + this.name = name; + this.age = age; +} +var options = { + customTypes: { + Person: { + typeOf: 'Object', + validate: function (x) { + x instanceof Person; + }, + cast: function (value, options, typesCast) { + var name, age; + if ({}.toString.call(value).slice(8, -1) !== 'Object') { + return {type: 'Nothing'}; + } + name = typesCast(value.name, [{type: 'String'}], options); + age = typesCast(value.age, [{type: 'Numger'}], options); + return {type: 'Just', value: new Person(name, age)}; + } + } +} +parse('Person', '{name: Laura, age: 25}', options); // Person {name: 'Laura', age: 25} +``` + +`customTypes` is an object whose keys are the name of the types, and whose values are an object with three properties, `typeOf`, `validate`, and `cast`. For more information about `typeOf` and `validate`, please see the [custom types](https://github.com/gkz/type-check#custom-types) section of type-check. + +`cast` is a function which receives three arguments, the value under question, options, and the typesCast function. In `cast`, attempt to cast the value into the specified type. If you are successful, return an object in the format `{type: 'Just', value: CAST-VALUE}`, if you know it won't work, return `{type: 'Nothing'}`. You can use the `typesCast` function to cast any child values. Remember to pass `options` to it. In your function you can also check for `options.explicit` and act accordingly. + +## Technical About + +`levn` is written in [LiveScript](http://livescript.net/) - a language that compiles to JavaScript. It uses [type-check](https://github.com/gkz/type-check) to both parse types and validate values. It also uses the [prelude.ls](http://preludels.com/) library. diff --git a/tools/eslint/node_modules/optionator/node_modules/levn/lib/cast.js b/tools/eslint/node_modules/levn/lib/cast.js similarity index 97% rename from tools/eslint/node_modules/optionator/node_modules/levn/lib/cast.js rename to tools/eslint/node_modules/levn/lib/cast.js index 2a6816f94d32bd..411e29d4004310 100644 --- a/tools/eslint/node_modules/optionator/node_modules/levn/lib/cast.js +++ b/tools/eslint/node_modules/levn/lib/cast.js @@ -1,4 +1,4 @@ -// Generated by LiveScript 1.2.0 +// Generated by LiveScript 1.4.0 (function(){ var parsedTypeCheck, types, toString$ = {}.toString; parsedTypeCheck = require('type-check').parsedTypeCheck; @@ -104,13 +104,13 @@ Int: function(it){ return { type: 'Just', - value: parseInt(it) + value: +it }; }, Float: function(it){ return { type: 'Just', - value: parseFloat(it) + value: +it }; }, Date: function(value, options){ @@ -245,16 +245,16 @@ return { type: 'Just', value: (function(){ - var ref$, results$ = {}; + var ref$, resultObj$ = {}; for (key in ref$ = node) { value = ref$[key]; - results$[typesCast(key, [{ + resultObj$[typesCast(key, [{ type: 'String' }], options)] = typesCast(value, typeOf[key] || [{ type: '*' }], options); } - return results$; + return resultObj$; }()) }; } diff --git a/tools/eslint/node_modules/optionator/node_modules/levn/lib/coerce.js b/tools/eslint/node_modules/levn/lib/coerce.js similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/levn/lib/coerce.js rename to tools/eslint/node_modules/levn/lib/coerce.js diff --git a/tools/eslint/node_modules/levn/lib/index.js b/tools/eslint/node_modules/levn/lib/index.js new file mode 100644 index 00000000000000..4adae30c80e8cb --- /dev/null +++ b/tools/eslint/node_modules/levn/lib/index.js @@ -0,0 +1,22 @@ +// Generated by LiveScript 1.4.0 +(function(){ + var parseString, cast, parseType, VERSION, parsedTypeParse, parse; + parseString = require('./parse-string'); + cast = require('./cast'); + parseType = require('type-check').parseType; + VERSION = '0.3.0'; + parsedTypeParse = function(parsedType, string, options){ + options == null && (options = {}); + options.explicit == null && (options.explicit = false); + options.customTypes == null && (options.customTypes = {}); + return cast(parseString(parsedType, string, options), parsedType, options); + }; + parse = function(type, string, options){ + return parsedTypeParse(parseType(type), string, options); + }; + module.exports = { + VERSION: VERSION, + parse: parse, + parsedTypeParse: parsedTypeParse + }; +}).call(this); diff --git a/tools/eslint/node_modules/optionator/node_modules/levn/lib/parse-string.js b/tools/eslint/node_modules/levn/lib/parse-string.js similarity index 99% rename from tools/eslint/node_modules/optionator/node_modules/levn/lib/parse-string.js rename to tools/eslint/node_modules/levn/lib/parse-string.js index 65ec755c42c800..d573975fc2710a 100644 --- a/tools/eslint/node_modules/optionator/node_modules/levn/lib/parse-string.js +++ b/tools/eslint/node_modules/levn/lib/parse-string.js @@ -1,4 +1,4 @@ -// Generated by LiveScript 1.2.0 +// Generated by LiveScript 1.4.0 (function(){ var reject, special, tokenRegex; reject = require('prelude-ls').reject; diff --git a/tools/eslint/node_modules/optionator/node_modules/levn/lib/parse.js b/tools/eslint/node_modules/levn/lib/parse.js similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/levn/lib/parse.js rename to tools/eslint/node_modules/levn/lib/parse.js diff --git a/tools/eslint/node_modules/levn/package.json b/tools/eslint/node_modules/levn/package.json new file mode 100644 index 00000000000000..f7afdadc63dc0b --- /dev/null +++ b/tools/eslint/node_modules/levn/package.json @@ -0,0 +1,100 @@ +{ + "_args": [ + [ + "levn@~0.3.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/optionator" + ] + ], + "_from": "levn@>=0.3.0 <0.4.0", + "_id": "levn@0.3.0", + "_inCache": true, + "_installable": true, + "_location": "/levn", + "_nodeVersion": "4.2.4", + "_npmUser": { + "email": "z@georgezahariev.com", + "name": "gkz" + }, + "_npmVersion": "2.14.12", + "_phantomChildren": {}, + "_requested": { + "name": "levn", + "raw": "levn@~0.3.0", + "rawSpec": "~0.3.0", + "scope": null, + "spec": ">=0.3.0 <0.4.0", + "type": "range" + }, + "_requiredBy": [ + "/optionator" + ], + "_resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "_shasum": "3b09924edf9f083c0490fdd4c0bc4421e04764ee", + "_shrinkwrap": null, + "_spec": "levn@~0.3.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/optionator", + "author": { + "email": "z@georgezahariev.com", + "name": "George Zahariev" + }, + "bugs": { + "url": "https://github.com/gkz/levn/issues" + }, + "dependencies": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + }, + "description": "Light ECMAScript (JavaScript) Value Notation - human written, concise, typed, flexible", + "devDependencies": { + "istanbul": "~0.4.1", + "livescript": "~1.4.0", + "mocha": "~2.3.4" + }, + "directories": {}, + "dist": { + "shasum": "3b09924edf9f083c0490fdd4c0bc4421e04764ee", + "tarball": "http://registry.npmjs.org/levn/-/levn-0.3.0.tgz" + }, + "engines": { + "node": ">= 0.8.0" + }, + "files": [ + "LICENSE", + "README.md", + "lib" + ], + "gitHead": "a92b9acf928282ba81134b4ae8e6a5f29e1f5e1e", + "homepage": "https://github.com/gkz/levn", + "keywords": [ + "concise", + "ecmascript", + "flexible", + "human", + "json", + "levn", + "light", + "notation", + "typed", + "typed", + "value" + ], + "license": "MIT", + "main": "./lib/", + "maintainers": [ + { + "name": "gkz", + "email": "z@georgezahariev.com" + } + ], + "name": "levn", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/gkz/levn.git" + }, + "scripts": { + "test": "make test" + }, + "version": "0.3.0" +} diff --git a/tools/eslint/node_modules/lodash/LICENSE b/tools/eslint/node_modules/lodash/LICENSE new file mode 100644 index 00000000000000..e0c69d56032d15 --- /dev/null +++ b/tools/eslint/node_modules/lodash/LICENSE @@ -0,0 +1,47 @@ +Copyright jQuery Foundation and other contributors + +Based on Underscore.js, copyright Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +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. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/tools/eslint/node_modules/lodash/README.md b/tools/eslint/node_modules/lodash/README.md new file mode 100644 index 00000000000000..ea9313b9564198 --- /dev/null +++ b/tools/eslint/node_modules/lodash/README.md @@ -0,0 +1,40 @@ +# lodash v4.9.0 + +The [Lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash +``` + +In Node.js: +```js +// Load the full build. +var _ = require('lodash'); +// Load the core build. +var _ = require('lodash/core'); +// Load the fp build for immutable auto-curried iteratee-first data-last methods. +var fp = require('lodash/fp'); + +// Load a method category. +var array = require('lodash/array'); +var object = require('lodash/fp/object'); + +// Load a single method for smaller builds with browserify/rollup/webpack. +var chunk = require('lodash/chunk'); +var extend = require('lodash/fp/extend'); +``` + +See the [package source](https://github.com/lodash/lodash/tree/4.9.0-npm) for more details. + +**Note:**
      +Don’t assign values to the [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL.
      +Install [n_](https://www.npmjs.com/package/n_) for a REPL that includes `lodash` by default. + +## Support + +Tested in Chrome 48-49, Firefox 44-45, IE 9-11, Edge 13, Safari 8-9, Node.js 0.10, 0.12, 4, & 5, & PhantomJS 1.9.8.
      +Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available. diff --git a/tools/eslint/node_modules/lodash/_DataView.js b/tools/eslint/node_modules/lodash/_DataView.js new file mode 100644 index 00000000000000..ac2d57ca67c9cb --- /dev/null +++ b/tools/eslint/node_modules/lodash/_DataView.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'); + +module.exports = DataView; diff --git a/tools/eslint/node_modules/lodash/_Hash.js b/tools/eslint/node_modules/lodash/_Hash.js new file mode 100644 index 00000000000000..7f4c3ba933a744 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_Hash.js @@ -0,0 +1,18 @@ +var nativeCreate = require('./_nativeCreate'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @returns {Object} Returns the new hash object. + */ +function Hash() {} + +// Avoid inheriting from `Object.prototype` when possible. +Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto; + +module.exports = Hash; diff --git a/tools/eslint/node_modules/lodash/_LazyWrapper.js b/tools/eslint/node_modules/lodash/_LazyWrapper.js new file mode 100644 index 00000000000000..81786c7f1e4940 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_LazyWrapper.js @@ -0,0 +1,28 @@ +var baseCreate = require('./_baseCreate'), + baseLodash = require('./_baseLodash'); + +/** Used as references for the maximum length and index of an array. */ +var MAX_ARRAY_LENGTH = 4294967295; + +/** + * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. + * + * @private + * @constructor + * @param {*} value The value to wrap. + */ +function LazyWrapper(value) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__dir__ = 1; + this.__filtered__ = false; + this.__iteratees__ = []; + this.__takeCount__ = MAX_ARRAY_LENGTH; + this.__views__ = []; +} + +// Ensure `LazyWrapper` is an instance of `baseLodash`. +LazyWrapper.prototype = baseCreate(baseLodash.prototype); +LazyWrapper.prototype.constructor = LazyWrapper; + +module.exports = LazyWrapper; diff --git a/tools/eslint/node_modules/lodash/_LodashWrapper.js b/tools/eslint/node_modules/lodash/_LodashWrapper.js new file mode 100644 index 00000000000000..c1e4d9df762b40 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_LodashWrapper.js @@ -0,0 +1,22 @@ +var baseCreate = require('./_baseCreate'), + baseLodash = require('./_baseLodash'); + +/** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ +function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + this.__index__ = 0; + this.__values__ = undefined; +} + +LodashWrapper.prototype = baseCreate(baseLodash.prototype); +LodashWrapper.prototype.constructor = LodashWrapper; + +module.exports = LodashWrapper; diff --git a/tools/eslint/node_modules/lodash/_Map.js b/tools/eslint/node_modules/lodash/_Map.js new file mode 100644 index 00000000000000..b73f29a0f9da60 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_Map.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'); + +module.exports = Map; diff --git a/tools/eslint/node_modules/lodash/_MapCache.js b/tools/eslint/node_modules/lodash/_MapCache.js new file mode 100644 index 00000000000000..4c6fa99949d0f2 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_MapCache.js @@ -0,0 +1,32 @@ +var mapClear = require('./_mapClear'), + mapDelete = require('./_mapDelete'), + mapGet = require('./_mapGet'), + mapHas = require('./_mapHas'), + mapSet = require('./_mapSet'); + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function MapCache(values) { + var index = -1, + length = values ? values.length : 0; + + this.clear(); + while (++index < length) { + var entry = values[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapClear; +MapCache.prototype['delete'] = mapDelete; +MapCache.prototype.get = mapGet; +MapCache.prototype.has = mapHas; +MapCache.prototype.set = mapSet; + +module.exports = MapCache; diff --git a/tools/eslint/node_modules/lodash/_Promise.js b/tools/eslint/node_modules/lodash/_Promise.js new file mode 100644 index 00000000000000..247b9e1bacac64 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_Promise.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var Promise = getNative(root, 'Promise'); + +module.exports = Promise; diff --git a/tools/eslint/node_modules/lodash/_Reflect.js b/tools/eslint/node_modules/lodash/_Reflect.js new file mode 100644 index 00000000000000..1de7475b8a9057 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_Reflect.js @@ -0,0 +1,6 @@ +var root = require('./_root'); + +/** Built-in value references. */ +var Reflect = root.Reflect; + +module.exports = Reflect; diff --git a/tools/eslint/node_modules/lodash/_Set.js b/tools/eslint/node_modules/lodash/_Set.js new file mode 100644 index 00000000000000..b3c8dcbf036bf4 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_Set.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var Set = getNative(root, 'Set'); + +module.exports = Set; diff --git a/tools/eslint/node_modules/lodash/_SetCache.js b/tools/eslint/node_modules/lodash/_SetCache.js new file mode 100644 index 00000000000000..6fd915bdc181a7 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_SetCache.js @@ -0,0 +1,25 @@ +var MapCache = require('./_MapCache'), + cachePush = require('./_cachePush'); + +/** + * + * Creates a set cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values ? values.length : 0; + + this.__data__ = new MapCache; + while (++index < length) { + this.push(values[index]); + } +} + +// Add methods to `SetCache`. +SetCache.prototype.push = cachePush; + +module.exports = SetCache; diff --git a/tools/eslint/node_modules/lodash/_Stack.js b/tools/eslint/node_modules/lodash/_Stack.js new file mode 100644 index 00000000000000..414cd5295d14b1 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_Stack.js @@ -0,0 +1,32 @@ +var stackClear = require('./_stackClear'), + stackDelete = require('./_stackDelete'), + stackGet = require('./_stackGet'), + stackHas = require('./_stackHas'), + stackSet = require('./_stackSet'); + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function Stack(values) { + var index = -1, + length = values ? values.length : 0; + + this.clear(); + while (++index < length) { + var entry = values[index]; + this.set(entry[0], entry[1]); + } +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +module.exports = Stack; diff --git a/tools/eslint/node_modules/lodash/_Symbol.js b/tools/eslint/node_modules/lodash/_Symbol.js new file mode 100644 index 00000000000000..a013f7c5b76408 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_Symbol.js @@ -0,0 +1,6 @@ +var root = require('./_root'); + +/** Built-in value references. */ +var Symbol = root.Symbol; + +module.exports = Symbol; diff --git a/tools/eslint/node_modules/lodash/_Uint8Array.js b/tools/eslint/node_modules/lodash/_Uint8Array.js new file mode 100644 index 00000000000000..2fb30e15737cc0 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_Uint8Array.js @@ -0,0 +1,6 @@ +var root = require('./_root'); + +/** Built-in value references. */ +var Uint8Array = root.Uint8Array; + +module.exports = Uint8Array; diff --git a/tools/eslint/node_modules/lodash/_WeakMap.js b/tools/eslint/node_modules/lodash/_WeakMap.js new file mode 100644 index 00000000000000..567f86c61e0983 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_WeakMap.js @@ -0,0 +1,7 @@ +var getNative = require('./_getNative'), + root = require('./_root'); + +/* Built-in method references that are verified to be native. */ +var WeakMap = getNative(root, 'WeakMap'); + +module.exports = WeakMap; diff --git a/tools/eslint/node_modules/lodash/_addMapEntry.js b/tools/eslint/node_modules/lodash/_addMapEntry.js new file mode 100644 index 00000000000000..0112ef74425759 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_addMapEntry.js @@ -0,0 +1,15 @@ +/** + * Adds the key-value `pair` to `map`. + * + * @private + * @param {Object} map The map to modify. + * @param {Array} pair The key-value pair to add. + * @returns {Object} Returns `map`. + */ +function addMapEntry(map, pair) { + // Don't return `Map#set` because it doesn't return the map instance in IE 11. + map.set(pair[0], pair[1]); + return map; +} + +module.exports = addMapEntry; diff --git a/tools/eslint/node_modules/lodash/_addSetEntry.js b/tools/eslint/node_modules/lodash/_addSetEntry.js new file mode 100644 index 00000000000000..7b75c13f62a933 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_addSetEntry.js @@ -0,0 +1,14 @@ +/** + * Adds `value` to `set`. + * + * @private + * @param {Object} set The set to modify. + * @param {*} value The value to add. + * @returns {Object} Returns `set`. + */ +function addSetEntry(set, value) { + set.add(value); + return set; +} + +module.exports = addSetEntry; diff --git a/tools/eslint/node_modules/lodash/_apply.js b/tools/eslint/node_modules/lodash/_apply.js new file mode 100644 index 00000000000000..d000f046079f31 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_apply.js @@ -0,0 +1,22 @@ +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + var length = args.length; + switch (length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +module.exports = apply; diff --git a/tools/eslint/node_modules/lodash/_arrayAggregator.js b/tools/eslint/node_modules/lodash/_arrayAggregator.js new file mode 100644 index 00000000000000..562eeb3929cb1c --- /dev/null +++ b/tools/eslint/node_modules/lodash/_arrayAggregator.js @@ -0,0 +1,22 @@ +/** + * A specialized version of `baseAggregator` for arrays. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ +function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; +} + +module.exports = arrayAggregator; diff --git a/tools/eslint/node_modules/lodash/_arrayConcat.js b/tools/eslint/node_modules/lodash/_arrayConcat.js new file mode 100644 index 00000000000000..96e77415fd1366 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_arrayConcat.js @@ -0,0 +1,25 @@ +/** + * Creates a new array concatenating `array` with `other`. + * + * @private + * @param {Array} array The first array to concatenate. + * @param {Array} other The second array to concatenate. + * @returns {Array} Returns the new concatenated array. + */ +function arrayConcat(array, other) { + var index = -1, + length = array.length, + othIndex = -1, + othLength = other.length, + result = Array(length + othLength); + + while (++index < length) { + result[index] = array[index]; + } + while (++othIndex < othLength) { + result[index++] = other[othIndex]; + } + return result; +} + +module.exports = arrayConcat; diff --git a/tools/eslint/node_modules/lodash/_arrayEach.js b/tools/eslint/node_modules/lodash/_arrayEach.js new file mode 100644 index 00000000000000..c302e631312732 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_arrayEach.js @@ -0,0 +1,22 @@ +/** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ +function arrayEach(array, iteratee) { + var index = -1, + length = array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; +} + +module.exports = arrayEach; diff --git a/tools/eslint/node_modules/lodash/_arrayEachRight.js b/tools/eslint/node_modules/lodash/_arrayEachRight.js new file mode 100644 index 00000000000000..53185853837d78 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_arrayEachRight.js @@ -0,0 +1,21 @@ +/** + * A specialized version of `_.forEachRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ +function arrayEachRight(array, iteratee) { + var length = array.length; + + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } + } + return array; +} + +module.exports = arrayEachRight; diff --git a/tools/eslint/node_modules/lodash/_arrayEvery.js b/tools/eslint/node_modules/lodash/_arrayEvery.js new file mode 100644 index 00000000000000..8d89fb102d890c --- /dev/null +++ b/tools/eslint/node_modules/lodash/_arrayEvery.js @@ -0,0 +1,23 @@ +/** + * A specialized version of `_.every` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + */ +function arrayEvery(array, predicate) { + var index = -1, + length = array.length; + + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } + } + return true; +} + +module.exports = arrayEvery; diff --git a/tools/eslint/node_modules/lodash/_arrayFilter.js b/tools/eslint/node_modules/lodash/_arrayFilter.js new file mode 100644 index 00000000000000..7b61ba6f9eea59 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_arrayFilter.js @@ -0,0 +1,25 @@ +/** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ +function arrayFilter(array, predicate) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; +} + +module.exports = arrayFilter; diff --git a/tools/eslint/node_modules/lodash/_arrayIncludes.js b/tools/eslint/node_modules/lodash/_arrayIncludes.js new file mode 100644 index 00000000000000..9574f5d1baba60 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_arrayIncludes.js @@ -0,0 +1,16 @@ +var baseIndexOf = require('./_baseIndexOf'); + +/** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} array The array to search. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludes(array, value) { + return !!array.length && baseIndexOf(array, value, 0) > -1; +} + +module.exports = arrayIncludes; diff --git a/tools/eslint/node_modules/lodash/_arrayIncludesWith.js b/tools/eslint/node_modules/lodash/_arrayIncludesWith.js new file mode 100644 index 00000000000000..88ea23719b4c99 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_arrayIncludesWith.js @@ -0,0 +1,22 @@ +/** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to search. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; +} + +module.exports = arrayIncludesWith; diff --git a/tools/eslint/node_modules/lodash/_arrayMap.js b/tools/eslint/node_modules/lodash/_arrayMap.js new file mode 100644 index 00000000000000..73b29cfa489a1a --- /dev/null +++ b/tools/eslint/node_modules/lodash/_arrayMap.js @@ -0,0 +1,21 @@ +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} + +module.exports = arrayMap; diff --git a/tools/eslint/node_modules/lodash/_arrayPush.js b/tools/eslint/node_modules/lodash/_arrayPush.js new file mode 100644 index 00000000000000..7d742b383e5a9a --- /dev/null +++ b/tools/eslint/node_modules/lodash/_arrayPush.js @@ -0,0 +1,20 @@ +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +module.exports = arrayPush; diff --git a/tools/eslint/node_modules/lodash/_arrayReduce.js b/tools/eslint/node_modules/lodash/_arrayReduce.js new file mode 100644 index 00000000000000..41bea2cf07a5fb --- /dev/null +++ b/tools/eslint/node_modules/lodash/_arrayReduce.js @@ -0,0 +1,26 @@ +/** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ +function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array.length; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; +} + +module.exports = arrayReduce; diff --git a/tools/eslint/node_modules/lodash/_arrayReduceRight.js b/tools/eslint/node_modules/lodash/_arrayReduceRight.js new file mode 100644 index 00000000000000..038e0fa7890e5d --- /dev/null +++ b/tools/eslint/node_modules/lodash/_arrayReduceRight.js @@ -0,0 +1,24 @@ +/** + * A specialized version of `_.reduceRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the last element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ +function arrayReduceRight(array, iteratee, accumulator, initAccum) { + var length = array.length; + if (initAccum && length) { + accumulator = array[--length]; + } + while (length--) { + accumulator = iteratee(accumulator, array[length], length, array); + } + return accumulator; +} + +module.exports = arrayReduceRight; diff --git a/tools/eslint/node_modules/lodash/_arraySome.js b/tools/eslint/node_modules/lodash/_arraySome.js new file mode 100644 index 00000000000000..e6e657b8f9b9de --- /dev/null +++ b/tools/eslint/node_modules/lodash/_arraySome.js @@ -0,0 +1,23 @@ +/** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +module.exports = arraySome; diff --git a/tools/eslint/node_modules/lodash/_assignInDefaults.js b/tools/eslint/node_modules/lodash/_assignInDefaults.js new file mode 100644 index 00000000000000..ea6b0e358ef2ba --- /dev/null +++ b/tools/eslint/node_modules/lodash/_assignInDefaults.js @@ -0,0 +1,27 @@ +var eq = require('./eq'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used by `_.defaults` to customize its `_.assignIn` use. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to assign. + * @param {Object} object The parent object of `objValue`. + * @returns {*} Returns the value to assign. + */ +function assignInDefaults(objValue, srcValue, key, object) { + if (objValue === undefined || + (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { + return srcValue; + } + return objValue; +} + +module.exports = assignInDefaults; diff --git a/tools/eslint/node_modules/lodash/_assignMergeValue.js b/tools/eslint/node_modules/lodash/_assignMergeValue.js new file mode 100644 index 00000000000000..61dd5832905f16 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_assignMergeValue.js @@ -0,0 +1,19 @@ +var eq = require('./eq'); + +/** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (typeof key == 'number' && value === undefined && !(key in object))) { + object[key] = value; + } +} + +module.exports = assignMergeValue; diff --git a/tools/eslint/node_modules/lodash/_assignValue.js b/tools/eslint/node_modules/lodash/_assignValue.js new file mode 100644 index 00000000000000..35d49f04e88c40 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_assignValue.js @@ -0,0 +1,27 @@ +var eq = require('./eq'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + object[key] = value; + } +} + +module.exports = assignValue; diff --git a/tools/eslint/node_modules/lodash/_assocDelete.js b/tools/eslint/node_modules/lodash/_assocDelete.js new file mode 100644 index 00000000000000..49f61e830f10be --- /dev/null +++ b/tools/eslint/node_modules/lodash/_assocDelete.js @@ -0,0 +1,31 @@ +var assocIndexOf = require('./_assocIndexOf'); + +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/** + * Removes `key` and its value from the associative array. + * + * @private + * @param {Array} array The array to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function assocDelete(array, key) { + var index = assocIndexOf(array, key); + if (index < 0) { + return false; + } + var lastIndex = array.length - 1; + if (index == lastIndex) { + array.pop(); + } else { + splice.call(array, index, 1); + } + return true; +} + +module.exports = assocDelete; diff --git a/tools/eslint/node_modules/lodash/_assocGet.js b/tools/eslint/node_modules/lodash/_assocGet.js new file mode 100644 index 00000000000000..e53d332e894ea2 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_assocGet.js @@ -0,0 +1,16 @@ +var assocIndexOf = require('./_assocIndexOf'); + +/** + * Gets the associative array value for `key`. + * + * @private + * @param {Array} array The array to query. + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function assocGet(array, key) { + var index = assocIndexOf(array, key); + return index < 0 ? undefined : array[index][1]; +} + +module.exports = assocGet; diff --git a/tools/eslint/node_modules/lodash/_assocHas.js b/tools/eslint/node_modules/lodash/_assocHas.js new file mode 100644 index 00000000000000..a74bd39973bbfd --- /dev/null +++ b/tools/eslint/node_modules/lodash/_assocHas.js @@ -0,0 +1,15 @@ +var assocIndexOf = require('./_assocIndexOf'); + +/** + * Checks if an associative array value for `key` exists. + * + * @private + * @param {Array} array The array to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function assocHas(array, key) { + return assocIndexOf(array, key) > -1; +} + +module.exports = assocHas; diff --git a/tools/eslint/node_modules/lodash/_assocIndexOf.js b/tools/eslint/node_modules/lodash/_assocIndexOf.js new file mode 100644 index 00000000000000..8f2c41fbcda558 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_assocIndexOf.js @@ -0,0 +1,21 @@ +var eq = require('./eq'); + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to search. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +module.exports = assocIndexOf; diff --git a/tools/eslint/node_modules/lodash/_assocSet.js b/tools/eslint/node_modules/lodash/_assocSet.js new file mode 100644 index 00000000000000..524f3418d8f463 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_assocSet.js @@ -0,0 +1,20 @@ +var assocIndexOf = require('./_assocIndexOf'); + +/** + * Sets the associative array `key` to `value`. + * + * @private + * @param {Array} array The array to modify. + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + */ +function assocSet(array, key, value) { + var index = assocIndexOf(array, key); + if (index < 0) { + array.push([key, value]); + } else { + array[index][1] = value; + } +} + +module.exports = assocSet; diff --git a/tools/eslint/node_modules/lodash/_baseAggregator.js b/tools/eslint/node_modules/lodash/_baseAggregator.js new file mode 100644 index 00000000000000..4bc9e91f41883a --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseAggregator.js @@ -0,0 +1,21 @@ +var baseEach = require('./_baseEach'); + +/** + * Aggregates elements of `collection` on `accumulator` with keys transformed + * by `iteratee` and values set by `setter`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ +function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection) { + setter(accumulator, value, iteratee(value), collection); + }); + return accumulator; +} + +module.exports = baseAggregator; diff --git a/tools/eslint/node_modules/lodash/_baseAssign.js b/tools/eslint/node_modules/lodash/_baseAssign.js new file mode 100644 index 00000000000000..e5c4a1a5b05159 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseAssign.js @@ -0,0 +1,17 @@ +var copyObject = require('./_copyObject'), + keys = require('./keys'); + +/** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); +} + +module.exports = baseAssign; diff --git a/tools/eslint/node_modules/lodash/_baseAt.js b/tools/eslint/node_modules/lodash/_baseAt.js new file mode 100644 index 00000000000000..a077cb937b2bc0 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseAt.js @@ -0,0 +1,23 @@ +var get = require('./get'); + +/** + * The base implementation of `_.at` without support for individual paths. + * + * @private + * @param {Object} object The object to iterate over. + * @param {string[]} paths The property paths of elements to pick. + * @returns {Array} Returns the new array of picked elements. + */ +function baseAt(object, paths) { + var index = -1, + isNil = object == null, + length = paths.length, + result = Array(length); + + while (++index < length) { + result[index] = isNil ? undefined : get(object, paths[index]); + } + return result; +} + +module.exports = baseAt; diff --git a/tools/eslint/node_modules/lodash/_baseCastArrayLikeObject.js b/tools/eslint/node_modules/lodash/_baseCastArrayLikeObject.js new file mode 100644 index 00000000000000..b9156ef1cfc2e9 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseCastArrayLikeObject.js @@ -0,0 +1,14 @@ +var isArrayLikeObject = require('./isArrayLikeObject'); + +/** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ +function baseCastArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; +} + +module.exports = baseCastArrayLikeObject; diff --git a/tools/eslint/node_modules/lodash/_baseCastFunction.js b/tools/eslint/node_modules/lodash/_baseCastFunction.js new file mode 100644 index 00000000000000..ca118b6baa5afd --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseCastFunction.js @@ -0,0 +1,14 @@ +var identity = require('./identity'); + +/** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ +function baseCastFunction(value) { + return typeof value == 'function' ? value : identity; +} + +module.exports = baseCastFunction; diff --git a/tools/eslint/node_modules/lodash/_baseCastKey.js b/tools/eslint/node_modules/lodash/_baseCastKey.js new file mode 100644 index 00000000000000..0259e6239d3172 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseCastKey.js @@ -0,0 +1,14 @@ +var isSymbol = require('./isSymbol'); + +/** + * Casts `value` to a string if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the cast key. + */ +function baseCastKey(key) { + return (typeof key == 'string' || isSymbol(key)) ? key : (key + ''); +} + +module.exports = baseCastKey; diff --git a/tools/eslint/node_modules/lodash/_baseCastPath.js b/tools/eslint/node_modules/lodash/_baseCastPath.js new file mode 100644 index 00000000000000..7634e5ba2b1d4d --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseCastPath.js @@ -0,0 +1,15 @@ +var isArray = require('./isArray'), + stringToPath = require('./_stringToPath'); + +/** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast property path array. + */ +function baseCastPath(value) { + return isArray(value) ? value : stringToPath(value); +} + +module.exports = baseCastPath; diff --git a/tools/eslint/node_modules/lodash/_baseClamp.js b/tools/eslint/node_modules/lodash/_baseClamp.js new file mode 100644 index 00000000000000..ceadeef1c486e1 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseClamp.js @@ -0,0 +1,22 @@ +/** + * The base implementation of `_.clamp` which doesn't coerce arguments to numbers. + * + * @private + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + */ +function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined) { + number = number <= upper ? number : upper; + } + if (lower !== undefined) { + number = number >= lower ? number : lower; + } + } + return number; +} + +module.exports = baseClamp; diff --git a/tools/eslint/node_modules/lodash/_baseClone.js b/tools/eslint/node_modules/lodash/_baseClone.js new file mode 100644 index 00000000000000..b1079edd8be28c --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseClone.js @@ -0,0 +1,139 @@ +var Stack = require('./_Stack'), + arrayEach = require('./_arrayEach'), + assignValue = require('./_assignValue'), + baseAssign = require('./_baseAssign'), + cloneBuffer = require('./_cloneBuffer'), + copyArray = require('./_copyArray'), + copySymbols = require('./_copySymbols'), + getAllKeys = require('./_getAllKeys'), + getTag = require('./_getTag'), + initCloneArray = require('./_initCloneArray'), + initCloneByTag = require('./_initCloneByTag'), + initCloneObject = require('./_initCloneObject'), + isArray = require('./isArray'), + isBuffer = require('./isBuffer'), + isHostObject = require('./_isHostObject'), + isObject = require('./isObject'), + keys = require('./keys'); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values supported by `_.clone`. */ +var cloneableTags = {}; +cloneableTags[argsTag] = cloneableTags[arrayTag] = +cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = +cloneableTags[boolTag] = cloneableTags[dateTag] = +cloneableTags[float32Tag] = cloneableTags[float64Tag] = +cloneableTags[int8Tag] = cloneableTags[int16Tag] = +cloneableTags[int32Tag] = cloneableTags[mapTag] = +cloneableTags[numberTag] = cloneableTags[objectTag] = +cloneableTags[regexpTag] = cloneableTags[setTag] = +cloneableTags[stringTag] = cloneableTags[symbolTag] = +cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = +cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; +cloneableTags[errorTag] = cloneableTags[funcTag] = +cloneableTags[weakMapTag] = false; + +/** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @param {boolean} [isFull] Specify a clone including symbols. + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ +function baseClone(value, isDeep, isFull, customizer, key, object, stack) { + var result; + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + if (isHostObject(value)) { + return object ? value : {}; + } + result = initCloneObject(isFunc ? {} : value); + if (!isDeep) { + return copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, baseClone, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + if (!isArr) { + var props = isFull ? getAllKeys(value) : keys(value); + } + // Recursively populate clone (susceptible to call stack limits). + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); + }); + return result; +} + +module.exports = baseClone; diff --git a/tools/eslint/node_modules/lodash/_baseConforms.js b/tools/eslint/node_modules/lodash/_baseConforms.js new file mode 100644 index 00000000000000..973aa6d4397af9 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseConforms.js @@ -0,0 +1,33 @@ +var keys = require('./keys'); + +/** + * The base implementation of `_.conforms` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new function. + */ +function baseConforms(source) { + var props = keys(source), + length = props.length; + + return function(object) { + if (object == null) { + return !length; + } + var index = length; + while (index--) { + var key = props[index], + predicate = source[key], + value = object[key]; + + if ((value === undefined && + !(key in Object(object))) || !predicate(value)) { + return false; + } + } + return true; + }; +} + +module.exports = baseConforms; diff --git a/tools/eslint/node_modules/lodash/_baseCreate.js b/tools/eslint/node_modules/lodash/_baseCreate.js new file mode 100644 index 00000000000000..4372cad2b2aaef --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseCreate.js @@ -0,0 +1,18 @@ +var isObject = require('./isObject'); + +/** Built-in value references. */ +var objectCreate = Object.create; + +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} prototype The object to inherit from. + * @returns {Object} Returns the new object. + */ +function baseCreate(proto) { + return isObject(proto) ? objectCreate(proto) : {}; +} + +module.exports = baseCreate; diff --git a/tools/eslint/node_modules/lodash/_baseDelay.js b/tools/eslint/node_modules/lodash/_baseDelay.js new file mode 100644 index 00000000000000..c397562570cc35 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseDelay.js @@ -0,0 +1,21 @@ +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * The base implementation of `_.delay` and `_.defer` which accepts an array + * of `func` arguments. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Object} args The arguments to provide to `func`. + * @returns {number} Returns the timer id. + */ +function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); +} + +module.exports = baseDelay; diff --git a/tools/eslint/node_modules/lodash/_baseDifference.js b/tools/eslint/node_modules/lodash/_baseDifference.js new file mode 100644 index 00000000000000..a49bdffa5a620f --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseDifference.js @@ -0,0 +1,66 @@ +var SetCache = require('./_SetCache'), + arrayIncludes = require('./_arrayIncludes'), + arrayIncludesWith = require('./_arrayIncludesWith'), + arrayMap = require('./_arrayMap'), + baseUnary = require('./_baseUnary'), + cacheHas = require('./_cacheHas'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ +function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; +} + +module.exports = baseDifference; diff --git a/tools/eslint/node_modules/lodash/_baseEach.js b/tools/eslint/node_modules/lodash/_baseEach.js new file mode 100644 index 00000000000000..512c0676827c9a --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseEach.js @@ -0,0 +1,14 @@ +var baseForOwn = require('./_baseForOwn'), + createBaseEach = require('./_createBaseEach'); + +/** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEach = createBaseEach(baseForOwn); + +module.exports = baseEach; diff --git a/tools/eslint/node_modules/lodash/_baseEachRight.js b/tools/eslint/node_modules/lodash/_baseEachRight.js new file mode 100644 index 00000000000000..0a8feeca44617e --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseEachRight.js @@ -0,0 +1,14 @@ +var baseForOwnRight = require('./_baseForOwnRight'), + createBaseEach = require('./_createBaseEach'); + +/** + * The base implementation of `_.forEachRight` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ +var baseEachRight = createBaseEach(baseForOwnRight, true); + +module.exports = baseEachRight; diff --git a/tools/eslint/node_modules/lodash/_baseEvery.js b/tools/eslint/node_modules/lodash/_baseEvery.js new file mode 100644 index 00000000000000..fa52f7bc7d6b77 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseEvery.js @@ -0,0 +1,21 @@ +var baseEach = require('./_baseEach'); + +/** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ +function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; +} + +module.exports = baseEvery; diff --git a/tools/eslint/node_modules/lodash/_baseExtremum.js b/tools/eslint/node_modules/lodash/_baseExtremum.js new file mode 100644 index 00000000000000..c6cb8045002965 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseExtremum.js @@ -0,0 +1,30 @@ +/** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ +function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? current === current + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; +} + +module.exports = baseExtremum; diff --git a/tools/eslint/node_modules/lodash/_baseFill.js b/tools/eslint/node_modules/lodash/_baseFill.js new file mode 100644 index 00000000000000..46ef9c761a6bf7 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseFill.js @@ -0,0 +1,32 @@ +var toInteger = require('./toInteger'), + toLength = require('./toLength'); + +/** + * The base implementation of `_.fill` without an iteratee call guard. + * + * @private + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + */ +function baseFill(array, value, start, end) { + var length = array.length; + + start = toInteger(start); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : toInteger(end); + if (end < 0) { + end += length; + } + end = start > end ? 0 : toLength(end); + while (start < end) { + array[start++] = value; + } + return array; +} + +module.exports = baseFill; diff --git a/tools/eslint/node_modules/lodash/_baseFilter.js b/tools/eslint/node_modules/lodash/_baseFilter.js new file mode 100644 index 00000000000000..467847736a6fb2 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseFilter.js @@ -0,0 +1,21 @@ +var baseEach = require('./_baseEach'); + +/** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ +function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; +} + +module.exports = baseFilter; diff --git a/tools/eslint/node_modules/lodash/_baseFind.js b/tools/eslint/node_modules/lodash/_baseFind.js new file mode 100644 index 00000000000000..338f932c443b07 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseFind.js @@ -0,0 +1,25 @@ +/** + * The base implementation of methods like `_.find` and `_.findKey`, without + * support for iteratee shorthands, which iterates over `collection` using + * `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to search. + * @param {Function} predicate The function invoked per iteration. + * @param {Function} eachFunc The function to iterate over `collection`. + * @param {boolean} [retKey] Specify returning the key of the found element + * instead of the element itself. + * @returns {*} Returns the found element or its key, else `undefined`. + */ +function baseFind(collection, predicate, eachFunc, retKey) { + var result; + eachFunc(collection, function(value, key, collection) { + if (predicate(value, key, collection)) { + result = retKey ? key : value; + return false; + } + }); + return result; +} + +module.exports = baseFind; diff --git a/tools/eslint/node_modules/lodash/_baseFindIndex.js b/tools/eslint/node_modules/lodash/_baseFindIndex.js new file mode 100644 index 00000000000000..61428f6c49d09f --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseFindIndex.js @@ -0,0 +1,23 @@ +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to search. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromRight) { + var length = array.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +module.exports = baseFindIndex; diff --git a/tools/eslint/node_modules/lodash/_baseFlatten.js b/tools/eslint/node_modules/lodash/_baseFlatten.js new file mode 100644 index 00000000000000..4b1e009b150cbf --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseFlatten.js @@ -0,0 +1,38 @@ +var arrayPush = require('./_arrayPush'), + isFlattenable = require('./_isFlattenable'); + +/** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ +function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; +} + +module.exports = baseFlatten; diff --git a/tools/eslint/node_modules/lodash/_baseFor.js b/tools/eslint/node_modules/lodash/_baseFor.js new file mode 100644 index 00000000000000..a90460386d86ad --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseFor.js @@ -0,0 +1,16 @@ +var createBaseFor = require('./_createBaseFor'); + +/** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` invoking `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +module.exports = baseFor; diff --git a/tools/eslint/node_modules/lodash/_baseForOwn.js b/tools/eslint/node_modules/lodash/_baseForOwn.js new file mode 100644 index 00000000000000..503d523441076f --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseForOwn.js @@ -0,0 +1,16 @@ +var baseFor = require('./_baseFor'), + keys = require('./keys'); + +/** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); +} + +module.exports = baseForOwn; diff --git a/tools/eslint/node_modules/lodash/_baseForOwnRight.js b/tools/eslint/node_modules/lodash/_baseForOwnRight.js new file mode 100644 index 00000000000000..a4b10e6c593ff9 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseForOwnRight.js @@ -0,0 +1,16 @@ +var baseForRight = require('./_baseForRight'), + keys = require('./keys'); + +/** + * The base implementation of `_.forOwnRight` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwnRight(object, iteratee) { + return object && baseForRight(object, iteratee, keys); +} + +module.exports = baseForOwnRight; diff --git a/tools/eslint/node_modules/lodash/_baseForRight.js b/tools/eslint/node_modules/lodash/_baseForRight.js new file mode 100644 index 00000000000000..32842cd8179179 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseForRight.js @@ -0,0 +1,15 @@ +var createBaseFor = require('./_createBaseFor'); + +/** + * This function is like `baseFor` except that it iterates over properties + * in the opposite order. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseForRight = createBaseFor(true); + +module.exports = baseForRight; diff --git a/tools/eslint/node_modules/lodash/_baseFunctions.js b/tools/eslint/node_modules/lodash/_baseFunctions.js new file mode 100644 index 00000000000000..6e1090f9ce975b --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseFunctions.js @@ -0,0 +1,19 @@ +var arrayFilter = require('./_arrayFilter'), + isFunction = require('./isFunction'); + +/** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the new array of filtered property names. + */ +function baseFunctions(object, props) { + return arrayFilter(props, function(key) { + return isFunction(object[key]); + }); +} + +module.exports = baseFunctions; diff --git a/tools/eslint/node_modules/lodash/_baseGet.js b/tools/eslint/node_modules/lodash/_baseGet.js new file mode 100644 index 00000000000000..0956af551a3117 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseGet.js @@ -0,0 +1,24 @@ +var baseCastPath = require('./_baseCastPath'), + isKey = require('./_isKey'); + +/** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ +function baseGet(object, path) { + path = isKey(path, object) ? [path] : baseCastPath(path); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[path[index++]]; + } + return (index && index == length) ? object : undefined; +} + +module.exports = baseGet; diff --git a/tools/eslint/node_modules/lodash/_baseGetAllKeys.js b/tools/eslint/node_modules/lodash/_baseGetAllKeys.js new file mode 100644 index 00000000000000..7f8b38bd4c1f94 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseGetAllKeys.js @@ -0,0 +1,22 @@ +var arrayPush = require('./_arrayPush'), + isArray = require('./isArray'); + +/** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) + ? result + : arrayPush(result, symbolsFunc(object)); +} + +module.exports = baseGetAllKeys; diff --git a/tools/eslint/node_modules/lodash/_baseHas.js b/tools/eslint/node_modules/lodash/_baseHas.js new file mode 100644 index 00000000000000..1de5d841c2938d --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseHas.js @@ -0,0 +1,25 @@ +var getPrototype = require('./_getPrototype'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * The base implementation of `_.has` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHas(object, key) { + // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`, + // that are composed entirely of index properties, return `false` for + // `hasOwnProperty` checks of them. + return hasOwnProperty.call(object, key) || + (typeof object == 'object' && key in object && getPrototype(object) === null); +} + +module.exports = baseHas; diff --git a/tools/eslint/node_modules/lodash/_baseHasIn.js b/tools/eslint/node_modules/lodash/_baseHasIn.js new file mode 100644 index 00000000000000..4a36558694c468 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseHasIn.js @@ -0,0 +1,13 @@ +/** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ +function baseHasIn(object, key) { + return key in Object(object); +} + +module.exports = baseHasIn; diff --git a/tools/eslint/node_modules/lodash/_baseInRange.js b/tools/eslint/node_modules/lodash/_baseInRange.js new file mode 100644 index 00000000000000..16d53f2d31b44b --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseInRange.js @@ -0,0 +1,18 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * The base implementation of `_.inRange` which doesn't coerce arguments to numbers. + * + * @private + * @param {number} number The number to check. + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + */ +function baseInRange(number, start, end) { + return number >= nativeMin(start, end) && number < nativeMax(start, end); +} + +module.exports = baseInRange; diff --git a/tools/eslint/node_modules/lodash/_baseIndexOf.js b/tools/eslint/node_modules/lodash/_baseIndexOf.js new file mode 100644 index 00000000000000..6cda8023c50cc6 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseIndexOf.js @@ -0,0 +1,27 @@ +var indexOfNaN = require('./_indexOfNaN'); + +/** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + if (value !== value) { + return indexOfNaN(array, fromIndex); + } + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +module.exports = baseIndexOf; diff --git a/tools/eslint/node_modules/lodash/_baseIndexOfWith.js b/tools/eslint/node_modules/lodash/_baseIndexOfWith.js new file mode 100644 index 00000000000000..8be568af269323 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseIndexOfWith.js @@ -0,0 +1,23 @@ +/** + * This function is like `baseIndexOf` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @param {Function} comparator The comparator invoked per element. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (comparator(array[index], value)) { + return index; + } + } + return -1; +} + +module.exports = baseIndexOfWith; diff --git a/tools/eslint/node_modules/lodash/_baseIntersection.js b/tools/eslint/node_modules/lodash/_baseIntersection.js new file mode 100644 index 00000000000000..7d129267ed355d --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseIntersection.js @@ -0,0 +1,73 @@ +var SetCache = require('./_SetCache'), + arrayIncludes = require('./_arrayIncludes'), + arrayIncludesWith = require('./_arrayIncludesWith'), + arrayMap = require('./_arrayMap'), + baseUnary = require('./_baseUnary'), + cacheHas = require('./_cacheHas'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ +function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; + + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; + + var index = -1, + seen = caches[0]; + + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } + } + return result; +} + +module.exports = baseIntersection; diff --git a/tools/eslint/node_modules/lodash/_baseInverter.js b/tools/eslint/node_modules/lodash/_baseInverter.js new file mode 100644 index 00000000000000..fbc337f01e77d7 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseInverter.js @@ -0,0 +1,21 @@ +var baseForOwn = require('./_baseForOwn'); + +/** + * The base implementation of `_.invert` and `_.invertBy` which inverts + * `object` with values transformed by `iteratee` and set by `setter`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform values. + * @param {Object} accumulator The initial inverted object. + * @returns {Function} Returns `accumulator`. + */ +function baseInverter(object, setter, iteratee, accumulator) { + baseForOwn(object, function(value, key, object) { + setter(accumulator, iteratee(value), key, object); + }); + return accumulator; +} + +module.exports = baseInverter; diff --git a/tools/eslint/node_modules/lodash/_baseInvoke.js b/tools/eslint/node_modules/lodash/_baseInvoke.js new file mode 100644 index 00000000000000..7a94a3f3a9fb48 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseInvoke.js @@ -0,0 +1,27 @@ +var apply = require('./_apply'), + baseCastPath = require('./_baseCastPath'), + isKey = require('./_isKey'), + last = require('./last'), + parent = require('./_parent'); + +/** + * The base implementation of `_.invoke` without support for individual + * method arguments. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {Array} args The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + */ +function baseInvoke(object, path, args) { + if (!isKey(path, object)) { + path = baseCastPath(path); + object = parent(object, path); + path = last(path); + } + var func = object == null ? object : object[path]; + return func == null ? undefined : apply(func, object, args); +} + +module.exports = baseInvoke; diff --git a/tools/eslint/node_modules/lodash/_baseIsEqual.js b/tools/eslint/node_modules/lodash/_baseIsEqual.js new file mode 100644 index 00000000000000..3772dab0d863b9 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseIsEqual.js @@ -0,0 +1,30 @@ +var baseIsEqualDeep = require('./_baseIsEqualDeep'), + isObject = require('./isObject'), + isObjectLike = require('./isObjectLike'); + +/** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @param {boolean} [bitmask] The bitmask of comparison flags. + * The bitmask may be composed of the following flags: + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, customizer, bitmask, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); +} + +module.exports = baseIsEqual; diff --git a/tools/eslint/node_modules/lodash/_baseIsEqualDeep.js b/tools/eslint/node_modules/lodash/_baseIsEqualDeep.js new file mode 100644 index 00000000000000..c18d6d1fcdbb5b --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseIsEqualDeep.js @@ -0,0 +1,82 @@ +var Stack = require('./_Stack'), + equalArrays = require('./_equalArrays'), + equalByTag = require('./_equalByTag'), + equalObjects = require('./_equalObjects'), + getTag = require('./_getTag'), + isArray = require('./isArray'), + isHostObject = require('./_isHostObject'), + isTypedArray = require('./isTypedArray'); + +/** Used to compose bitmasks for comparison styles. */ +var PARTIAL_COMPARE_FLAG = 2; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + objectTag = '[object Object]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparisons. + * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = arrayTag, + othTag = arrayTag; + + if (!objIsArr) { + objTag = getTag(object); + objTag = objTag == argsTag ? objectTag : objTag; + } + if (!othIsArr) { + othTag = getTag(other); + othTag = othTag == argsTag ? objectTag : othTag; + } + var objIsObj = objTag == objectTag && !isHostObject(object), + othIsObj = othTag == objectTag && !isHostObject(other), + isSameTag = objTag == othTag; + + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) + : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack); + } + if (!(bitmask & PARTIAL_COMPARE_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, equalFunc, customizer, bitmask, stack); +} + +module.exports = baseIsEqualDeep; diff --git a/tools/eslint/node_modules/lodash/_baseIsMatch.js b/tools/eslint/node_modules/lodash/_baseIsMatch.js new file mode 100644 index 00000000000000..d36c8785191183 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseIsMatch.js @@ -0,0 +1,62 @@ +var Stack = require('./_Stack'), + baseIsEqual = require('./_baseIsEqual'); + +/** Used to compose bitmasks for comparison styles. */ +var UNORDERED_COMPARE_FLAG = 1, + PARTIAL_COMPARE_FLAG = 2; + +/** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ +function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) + : result + )) { + return false; + } + } + } + return true; +} + +module.exports = baseIsMatch; diff --git a/tools/eslint/node_modules/lodash/_baseIteratee.js b/tools/eslint/node_modules/lodash/_baseIteratee.js new file mode 100644 index 00000000000000..995c2575672c85 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseIteratee.js @@ -0,0 +1,31 @@ +var baseMatches = require('./_baseMatches'), + baseMatchesProperty = require('./_baseMatchesProperty'), + identity = require('./identity'), + isArray = require('./isArray'), + property = require('./property'); + +/** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ +function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); +} + +module.exports = baseIteratee; diff --git a/tools/eslint/node_modules/lodash/_baseKeys.js b/tools/eslint/node_modules/lodash/_baseKeys.js new file mode 100644 index 00000000000000..2c8ccb912ce9ed --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseKeys.js @@ -0,0 +1,16 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeKeys = Object.keys; + +/** + * The base implementation of `_.keys` which doesn't skip the constructor + * property of prototypes or treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + return nativeKeys(Object(object)); +} + +module.exports = baseKeys; diff --git a/tools/eslint/node_modules/lodash/_baseKeysIn.js b/tools/eslint/node_modules/lodash/_baseKeysIn.js new file mode 100644 index 00000000000000..7455fd889e806f --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseKeysIn.js @@ -0,0 +1,36 @@ +var Reflect = require('./_Reflect'), + iteratorToArray = require('./_iteratorToArray'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Built-in value references. */ +var enumerate = Reflect ? Reflect.enumerate : undefined, + propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/** + * The base implementation of `_.keysIn` which doesn't skip the constructor + * property of prototypes or treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeysIn(object) { + object = object == null ? object : Object(object); + + var result = []; + for (var key in object) { + result.push(key); + } + return result; +} + +// Fallback for IE < 9 with es6-shim. +if (enumerate && !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf')) { + baseKeysIn = function(object) { + return iteratorToArray(enumerate(object)); + }; +} + +module.exports = baseKeysIn; diff --git a/tools/eslint/node_modules/lodash/_baseLodash.js b/tools/eslint/node_modules/lodash/_baseLodash.js new file mode 100644 index 00000000000000..f76c790e2e1196 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseLodash.js @@ -0,0 +1,10 @@ +/** + * The function whose prototype chain sequence wrappers inherit from. + * + * @private + */ +function baseLodash() { + // No operation performed. +} + +module.exports = baseLodash; diff --git a/tools/eslint/node_modules/lodash/_baseMap.js b/tools/eslint/node_modules/lodash/_baseMap.js new file mode 100644 index 00000000000000..0bf5cead5c60bf --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseMap.js @@ -0,0 +1,22 @@ +var baseEach = require('./_baseEach'), + isArrayLike = require('./isArrayLike'); + +/** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; +} + +module.exports = baseMap; diff --git a/tools/eslint/node_modules/lodash/_baseMatches.js b/tools/eslint/node_modules/lodash/_baseMatches.js new file mode 100644 index 00000000000000..ba9012f946c21c --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseMatches.js @@ -0,0 +1,22 @@ +var baseIsMatch = require('./_baseIsMatch'), + getMatchData = require('./_getMatchData'), + matchesStrictComparable = require('./_matchesStrictComparable'); + +/** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new function. + */ +function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; +} + +module.exports = baseMatches; diff --git a/tools/eslint/node_modules/lodash/_baseMatchesProperty.js b/tools/eslint/node_modules/lodash/_baseMatchesProperty.js new file mode 100644 index 00000000000000..88afd67e141708 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseMatchesProperty.js @@ -0,0 +1,32 @@ +var baseIsEqual = require('./_baseIsEqual'), + get = require('./get'), + hasIn = require('./hasIn'), + isKey = require('./_isKey'), + isStrictComparable = require('./_isStrictComparable'), + matchesStrictComparable = require('./_matchesStrictComparable'); + +/** Used to compose bitmasks for comparison styles. */ +var UNORDERED_COMPARE_FLAG = 1, + PARTIAL_COMPARE_FLAG = 2; + +/** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new function. + */ +function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(path, srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG); + }; +} + +module.exports = baseMatchesProperty; diff --git a/tools/eslint/node_modules/lodash/_baseMean.js b/tools/eslint/node_modules/lodash/_baseMean.js new file mode 100644 index 00000000000000..ac99a42317d70f --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseMean.js @@ -0,0 +1,20 @@ +var baseSum = require('./_baseSum'); + +/** Used as references for various `Number` constants. */ +var NAN = 0 / 0; + +/** + * The base implementation of `_.mean` and `_.meanBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the mean. + */ +function baseMean(array, iteratee) { + var length = array ? array.length : 0; + return length ? (baseSum(array, iteratee) / length) : NAN; +} + +module.exports = baseMean; diff --git a/tools/eslint/node_modules/lodash/_baseMerge.js b/tools/eslint/node_modules/lodash/_baseMerge.js new file mode 100644 index 00000000000000..e18d3bf750a3ac --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseMerge.js @@ -0,0 +1,50 @@ +var Stack = require('./_Stack'), + arrayEach = require('./_arrayEach'), + assignMergeValue = require('./_assignMergeValue'), + baseMergeDeep = require('./_baseMergeDeep'), + isArray = require('./isArray'), + isObject = require('./isObject'), + isTypedArray = require('./isTypedArray'), + keysIn = require('./keysIn'); + +/** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + if (!(isArray(source) || isTypedArray(source))) { + var props = keysIn(source); + } + arrayEach(props || source, function(srcValue, key) { + if (props) { + key = srcValue; + srcValue = source[key]; + } + if (isObject(srcValue)) { + stack || (stack = new Stack); + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(object[key], srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }); +} + +module.exports = baseMerge; diff --git a/tools/eslint/node_modules/lodash/_baseMergeDeep.js b/tools/eslint/node_modules/lodash/_baseMergeDeep.js new file mode 100644 index 00000000000000..062f004c23ac93 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseMergeDeep.js @@ -0,0 +1,83 @@ +var assignMergeValue = require('./_assignMergeValue'), + baseClone = require('./_baseClone'), + copyArray = require('./_copyArray'), + isArguments = require('./isArguments'), + isArray = require('./isArray'), + isArrayLikeObject = require('./isArrayLikeObject'), + isFunction = require('./isFunction'), + isObject = require('./isObject'), + isPlainObject = require('./isPlainObject'), + isTypedArray = require('./isTypedArray'), + toPlainObject = require('./toPlainObject'); + +/** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ +function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = object[key], + srcValue = source[key], + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + newValue = srcValue; + if (isArray(srcValue) || isTypedArray(srcValue)) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else { + isCommon = false; + newValue = baseClone(srcValue, true); + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { + isCommon = false; + newValue = baseClone(srcValue, true); + } + else { + newValue = objValue; + } + } + else { + isCommon = false; + } + } + stack.set(srcValue, newValue); + + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + } + stack['delete'](srcValue); + assignMergeValue(object, key, newValue); +} + +module.exports = baseMergeDeep; diff --git a/tools/eslint/node_modules/lodash/_baseOrderBy.js b/tools/eslint/node_modules/lodash/_baseOrderBy.js new file mode 100644 index 00000000000000..319f77a986f196 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseOrderBy.js @@ -0,0 +1,33 @@ +var arrayMap = require('./_arrayMap'), + baseIteratee = require('./_baseIteratee'), + baseMap = require('./_baseMap'), + baseSortBy = require('./_baseSortBy'), + compareMultiple = require('./_compareMultiple'), + identity = require('./identity'); + +/** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ +function baseOrderBy(collection, iteratees, orders) { + var index = -1; + iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseIteratee); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); +} + +module.exports = baseOrderBy; diff --git a/tools/eslint/node_modules/lodash/_basePick.js b/tools/eslint/node_modules/lodash/_basePick.js new file mode 100644 index 00000000000000..7272548307c101 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_basePick.js @@ -0,0 +1,22 @@ +var arrayReduce = require('./_arrayReduce'); + +/** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} props The property identifiers to pick. + * @returns {Object} Returns the new object. + */ +function basePick(object, props) { + object = Object(object); + return arrayReduce(props, function(result, key) { + if (key in object) { + result[key] = object[key]; + } + return result; + }, {}); +} + +module.exports = basePick; diff --git a/tools/eslint/node_modules/lodash/_basePickBy.js b/tools/eslint/node_modules/lodash/_basePickBy.js new file mode 100644 index 00000000000000..56ffa5f5d7f60d --- /dev/null +++ b/tools/eslint/node_modules/lodash/_basePickBy.js @@ -0,0 +1,28 @@ +var getAllKeysIn = require('./_getAllKeysIn'); + +/** + * The base implementation of `_.pickBy` without support for iteratee shorthands. + * + * @private + * @param {Object} object The source object. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. + */ +function basePickBy(object, predicate) { + var index = -1, + props = getAllKeysIn(object), + length = props.length, + result = {}; + + while (++index < length) { + var key = props[index], + value = object[key]; + + if (predicate(value, key)) { + result[key] = value; + } + } + return result; +} + +module.exports = basePickBy; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseProperty.js b/tools/eslint/node_modules/lodash/_baseProperty.js similarity index 100% rename from tools/eslint/node_modules/inquirer/node_modules/lodash/internal/baseProperty.js rename to tools/eslint/node_modules/lodash/_baseProperty.js diff --git a/tools/eslint/node_modules/lodash/_basePropertyDeep.js b/tools/eslint/node_modules/lodash/_basePropertyDeep.js new file mode 100644 index 00000000000000..acc2009d5d574b --- /dev/null +++ b/tools/eslint/node_modules/lodash/_basePropertyDeep.js @@ -0,0 +1,16 @@ +var baseGet = require('./_baseGet'); + +/** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new function. + */ +function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; +} + +module.exports = basePropertyDeep; diff --git a/tools/eslint/node_modules/lodash/_basePullAll.js b/tools/eslint/node_modules/lodash/_basePullAll.js new file mode 100644 index 00000000000000..3c07c994cfd426 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_basePullAll.js @@ -0,0 +1,47 @@ +var arrayMap = require('./_arrayMap'), + baseIndexOf = require('./_baseIndexOf'), + baseIndexOfWith = require('./_baseIndexOfWith'), + baseUnary = require('./_baseUnary'); + +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/** + * The base implementation of `_.pullAllBy` without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + */ +function basePullAll(array, values, iteratee, comparator) { + var indexOf = comparator ? baseIndexOfWith : baseIndexOf, + index = -1, + length = values.length, + seen = array; + + if (iteratee) { + seen = arrayMap(array, baseUnary(iteratee)); + } + while (++index < length) { + var fromIndex = 0, + value = values[index], + computed = iteratee ? iteratee(value) : value; + + while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice.call(seen, fromIndex, 1); + } + splice.call(array, fromIndex, 1); + } + } + return array; +} + +module.exports = basePullAll; diff --git a/tools/eslint/node_modules/lodash/_basePullAt.js b/tools/eslint/node_modules/lodash/_basePullAt.js new file mode 100644 index 00000000000000..eb9ed21e8a2a07 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_basePullAt.js @@ -0,0 +1,49 @@ +var baseCastPath = require('./_baseCastPath'), + isIndex = require('./_isIndex'), + isKey = require('./_isKey'), + last = require('./last'), + parent = require('./_parent'); + +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/** + * The base implementation of `_.pullAt` without support for individual + * indexes or capturing the removed elements. + * + * @private + * @param {Array} array The array to modify. + * @param {number[]} indexes The indexes of elements to remove. + * @returns {Array} Returns `array`. + */ +function basePullAt(array, indexes) { + var length = array ? indexes.length : 0, + lastIndex = length - 1; + + while (length--) { + var index = indexes[length]; + if (lastIndex == length || index != previous) { + var previous = index; + if (isIndex(index)) { + splice.call(array, index, 1); + } + else if (!isKey(index, array)) { + var path = baseCastPath(index), + object = parent(array, path); + + if (object != null) { + delete object[last(path)]; + } + } + else { + delete array[index]; + } + } + } + return array; +} + +module.exports = basePullAt; diff --git a/tools/eslint/node_modules/lodash/_baseRandom.js b/tools/eslint/node_modules/lodash/_baseRandom.js new file mode 100644 index 00000000000000..94f76a76636764 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseRandom.js @@ -0,0 +1,18 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeFloor = Math.floor, + nativeRandom = Math.random; + +/** + * The base implementation of `_.random` without support for returning + * floating-point numbers. + * + * @private + * @param {number} lower The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the random number. + */ +function baseRandom(lower, upper) { + return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); +} + +module.exports = baseRandom; diff --git a/tools/eslint/node_modules/lodash/_baseRange.js b/tools/eslint/node_modules/lodash/_baseRange.js new file mode 100644 index 00000000000000..2b39dd4106dace --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseRange.js @@ -0,0 +1,28 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeCeil = Math.ceil, + nativeMax = Math.max; + +/** + * The base implementation of `_.range` and `_.rangeRight` which doesn't + * coerce arguments to numbers. + * + * @private + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @param {number} step The value to increment or decrement by. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the new array of numbers. + */ +function baseRange(start, end, step, fromRight) { + var index = -1, + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), + result = Array(length); + + while (length--) { + result[fromRight ? length : ++index] = start; + start += step; + } + return result; +} + +module.exports = baseRange; diff --git a/tools/eslint/node_modules/lodash/_baseReduce.js b/tools/eslint/node_modules/lodash/_baseReduce.js new file mode 100644 index 00000000000000..5a1f8b57f1f86a --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseReduce.js @@ -0,0 +1,23 @@ +/** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ +function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; +} + +module.exports = baseReduce; diff --git a/tools/eslint/node_modules/lodash/_baseRepeat.js b/tools/eslint/node_modules/lodash/_baseRepeat.js new file mode 100644 index 00000000000000..ee44c31ab0c4b1 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseRepeat.js @@ -0,0 +1,35 @@ +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeFloor = Math.floor; + +/** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ +function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); + + return result; +} + +module.exports = baseRepeat; diff --git a/tools/eslint/node_modules/lodash/_baseSet.js b/tools/eslint/node_modules/lodash/_baseSet.js new file mode 100644 index 00000000000000..c903e41b5b67b9 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseSet.js @@ -0,0 +1,45 @@ +var assignValue = require('./_assignValue'), + baseCastPath = require('./_baseCastPath'), + isIndex = require('./_isIndex'), + isKey = require('./_isKey'), + isObject = require('./isObject'); + +/** + * The base implementation of `_.set`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ +function baseSet(object, path, value, customizer) { + path = isKey(path, object) ? [path] : baseCastPath(path); + + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + var key = path[index]; + if (isObject(nested)) { + var newValue = value; + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = objValue == null + ? (isIndex(path[index + 1]) ? [] : {}) + : objValue; + } + } + assignValue(nested, key, newValue); + } + nested = nested[key]; + } + return object; +} + +module.exports = baseSet; diff --git a/tools/eslint/node_modules/lodash/_baseSetData.js b/tools/eslint/node_modules/lodash/_baseSetData.js new file mode 100644 index 00000000000000..e689df2cc0f510 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseSetData.js @@ -0,0 +1,17 @@ +var identity = require('./identity'), + metaMap = require('./_metaMap'); + +/** + * The base implementation of `setData` without support for hot loop detection. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ +var baseSetData = !metaMap ? identity : function(func, data) { + metaMap.set(func, data); + return func; +}; + +module.exports = baseSetData; diff --git a/tools/eslint/node_modules/lodash/_baseSlice.js b/tools/eslint/node_modules/lodash/_baseSlice.js new file mode 100644 index 00000000000000..786f6c99e9068e --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseSlice.js @@ -0,0 +1,31 @@ +/** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ +function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; +} + +module.exports = baseSlice; diff --git a/tools/eslint/node_modules/lodash/_baseSome.js b/tools/eslint/node_modules/lodash/_baseSome.js new file mode 100644 index 00000000000000..58f3f447a34ecc --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseSome.js @@ -0,0 +1,22 @@ +var baseEach = require('./_baseEach'); + +/** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; +} + +module.exports = baseSome; diff --git a/tools/eslint/node_modules/lodash/_baseSortBy.js b/tools/eslint/node_modules/lodash/_baseSortBy.js new file mode 100644 index 00000000000000..a25c92eda6ebd2 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseSortBy.js @@ -0,0 +1,21 @@ +/** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ +function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; +} + +module.exports = baseSortBy; diff --git a/tools/eslint/node_modules/lodash/_baseSortedIndex.js b/tools/eslint/node_modules/lodash/_baseSortedIndex.js new file mode 100644 index 00000000000000..39610636232375 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseSortedIndex.js @@ -0,0 +1,40 @@ +var baseSortedIndexBy = require('./_baseSortedIndexBy'), + identity = require('./identity'); + +/** Used as references for the maximum length and index of an array. */ +var MAX_ARRAY_LENGTH = 4294967295, + HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; + +/** + * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which + * performs a binary search of `array` to determine the index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ +function baseSortedIndex(array, value, retHighest) { + var low = 0, + high = array ? array.length : low; + + if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { + while (low < high) { + var mid = (low + high) >>> 1, + computed = array[mid]; + + if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) { + low = mid + 1; + } else { + high = mid; + } + } + return high; + } + return baseSortedIndexBy(array, value, identity, retHighest); +} + +module.exports = baseSortedIndex; diff --git a/tools/eslint/node_modules/lodash/_baseSortedIndexBy.js b/tools/eslint/node_modules/lodash/_baseSortedIndexBy.js new file mode 100644 index 00000000000000..c0c7d66a2adacf --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseSortedIndexBy.js @@ -0,0 +1,57 @@ +/** Used as references for the maximum length and index of an array. */ +var MAX_ARRAY_LENGTH = 4294967295, + MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeFloor = Math.floor, + nativeMin = Math.min; + +/** + * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` + * which invokes `iteratee` for `value` and each element of `array` to compute + * their sort ranking. The iteratee is invoked with one argument; (value). + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} iteratee The iteratee invoked per element. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ +function baseSortedIndexBy(array, value, iteratee, retHighest) { + value = iteratee(value); + + var low = 0, + high = array ? array.length : 0, + valIsNaN = value !== value, + valIsNull = value === null, + valIsUndef = value === undefined; + + while (low < high) { + var mid = nativeFloor((low + high) / 2), + computed = iteratee(array[mid]), + isDef = computed !== undefined, + isReflexive = computed === computed; + + if (valIsNaN) { + var setLow = isReflexive || retHighest; + } else if (valIsNull) { + setLow = isReflexive && isDef && (retHighest || computed != null); + } else if (valIsUndef) { + setLow = isReflexive && (retHighest || isDef); + } else if (computed == null) { + setLow = false; + } else { + setLow = retHighest ? (computed <= value) : (computed < value); + } + if (setLow) { + low = mid + 1; + } else { + high = mid; + } + } + return nativeMin(high, MAX_ARRAY_INDEX); +} + +module.exports = baseSortedIndexBy; diff --git a/tools/eslint/node_modules/lodash/_baseSortedUniq.js b/tools/eslint/node_modules/lodash/_baseSortedUniq.js new file mode 100644 index 00000000000000..bf1eb2e24d51af --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseSortedUniq.js @@ -0,0 +1,14 @@ +var baseSortedUniqBy = require('./_baseSortedUniqBy'); + +/** + * The base implementation of `_.sortedUniq`. + * + * @private + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + */ +function baseSortedUniq(array) { + return baseSortedUniqBy(array); +} + +module.exports = baseSortedUniq; diff --git a/tools/eslint/node_modules/lodash/_baseSortedUniqBy.js b/tools/eslint/node_modules/lodash/_baseSortedUniqBy.js new file mode 100644 index 00000000000000..81e7ae1bc339b4 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseSortedUniqBy.js @@ -0,0 +1,33 @@ +var eq = require('./eq'); + +/** + * The base implementation of `_.sortedUniqBy` without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ +function baseSortedUniqBy(array, iteratee) { + var index = 0, + length = array.length, + value = array[0], + computed = iteratee ? iteratee(value) : value, + seen = computed, + resIndex = 1, + result = [value]; + + while (++index < length) { + value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (!eq(computed, seen)) { + seen = computed; + result[resIndex++] = value; + } + } + return result; +} + +module.exports = baseSortedUniqBy; diff --git a/tools/eslint/node_modules/lodash/_baseSum.js b/tools/eslint/node_modules/lodash/_baseSum.js new file mode 100644 index 00000000000000..a9e84c13c9098c --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseSum.js @@ -0,0 +1,24 @@ +/** + * The base implementation of `_.sum` and `_.sumBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the sum. + */ +function baseSum(array, iteratee) { + var result, + index = -1, + length = array.length; + + while (++index < length) { + var current = iteratee(array[index]); + if (current !== undefined) { + result = result === undefined ? current : (result + current); + } + } + return result; +} + +module.exports = baseSum; diff --git a/tools/eslint/node_modules/lodash/_baseTimes.js b/tools/eslint/node_modules/lodash/_baseTimes.js new file mode 100644 index 00000000000000..0603fc37eabef8 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseTimes.js @@ -0,0 +1,20 @@ +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +module.exports = baseTimes; diff --git a/tools/eslint/node_modules/lodash/_baseToPairs.js b/tools/eslint/node_modules/lodash/_baseToPairs.js new file mode 100644 index 00000000000000..d80b4022ce16d3 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseToPairs.js @@ -0,0 +1,18 @@ +var arrayMap = require('./_arrayMap'); + +/** + * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array + * of key-value pairs for `object` corresponding to the property names of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the new array of key-value pairs. + */ +function baseToPairs(object, props) { + return arrayMap(props, function(key) { + return [key, object[key]]; + }); +} + +module.exports = baseToPairs; diff --git a/tools/eslint/node_modules/lodash/_baseUnary.js b/tools/eslint/node_modules/lodash/_baseUnary.js new file mode 100644 index 00000000000000..e584a993401c75 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseUnary.js @@ -0,0 +1,14 @@ +/** + * The base implementation of `_.unary` without support for storing wrapper metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +module.exports = baseUnary; diff --git a/tools/eslint/node_modules/lodash/_baseUniq.js b/tools/eslint/node_modules/lodash/_baseUniq.js new file mode 100644 index 00000000000000..ecb6fe44bda7ab --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseUniq.js @@ -0,0 +1,71 @@ +var SetCache = require('./_SetCache'), + arrayIncludes = require('./_arrayIncludes'), + arrayIncludesWith = require('./_arrayIncludesWith'), + cacheHas = require('./_cacheHas'), + createSet = require('./_createSet'), + setToArray = require('./_setToArray'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ +function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; +} + +module.exports = baseUniq; diff --git a/tools/eslint/node_modules/lodash/_baseUnset.js b/tools/eslint/node_modules/lodash/_baseUnset.js new file mode 100644 index 00000000000000..9100d6fc8cd068 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseUnset.js @@ -0,0 +1,22 @@ +var baseCastPath = require('./_baseCastPath'), + has = require('./has'), + isKey = require('./_isKey'), + last = require('./last'), + parent = require('./_parent'); + +/** + * The base implementation of `_.unset`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + */ +function baseUnset(object, path) { + path = isKey(path, object) ? [path] : baseCastPath(path); + object = parent(object, path); + var key = last(path); + return (object != null && has(object, key)) ? delete object[key] : true; +} + +module.exports = baseUnset; diff --git a/tools/eslint/node_modules/lodash/_baseUpdate.js b/tools/eslint/node_modules/lodash/_baseUpdate.js new file mode 100644 index 00000000000000..ec1b338366d8eb --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseUpdate.js @@ -0,0 +1,18 @@ +var baseGet = require('./_baseGet'), + baseSet = require('./_baseSet'); + +/** + * The base implementation of `_.update`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to update. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ +function baseUpdate(object, path, updater, customizer) { + return baseSet(object, path, updater(baseGet(object, path)), customizer); +} + +module.exports = baseUpdate; diff --git a/tools/eslint/node_modules/lodash/_baseValues.js b/tools/eslint/node_modules/lodash/_baseValues.js new file mode 100644 index 00000000000000..b95faadcfeab56 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseValues.js @@ -0,0 +1,19 @@ +var arrayMap = require('./_arrayMap'); + +/** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ +function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); +} + +module.exports = baseValues; diff --git a/tools/eslint/node_modules/lodash/_baseWhile.js b/tools/eslint/node_modules/lodash/_baseWhile.js new file mode 100644 index 00000000000000..07eac61b9893bd --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseWhile.js @@ -0,0 +1,26 @@ +var baseSlice = require('./_baseSlice'); + +/** + * The base implementation of methods like `_.dropWhile` and `_.takeWhile` + * without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to query. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [isDrop] Specify dropping elements instead of taking them. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the slice of `array`. + */ +function baseWhile(array, predicate, isDrop, fromRight) { + var length = array.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length) && + predicate(array[index], index, array)) {} + + return isDrop + ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) + : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); +} + +module.exports = baseWhile; diff --git a/tools/eslint/node_modules/lodash/_baseWrapperValue.js b/tools/eslint/node_modules/lodash/_baseWrapperValue.js new file mode 100644 index 00000000000000..443e0df5e0d38a --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseWrapperValue.js @@ -0,0 +1,25 @@ +var LazyWrapper = require('./_LazyWrapper'), + arrayPush = require('./_arrayPush'), + arrayReduce = require('./_arrayReduce'); + +/** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ +function baseWrapperValue(value, actions) { + var result = value; + if (result instanceof LazyWrapper) { + result = result.value(); + } + return arrayReduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); +} + +module.exports = baseWrapperValue; diff --git a/tools/eslint/node_modules/lodash/_baseXor.js b/tools/eslint/node_modules/lodash/_baseXor.js new file mode 100644 index 00000000000000..7e62d1b2489e52 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseXor.js @@ -0,0 +1,30 @@ +var arrayPush = require('./_arrayPush'), + baseDifference = require('./_baseDifference'), + baseUniq = require('./_baseUniq'); + +/** + * The base implementation of methods like `_.xor`, without support for + * iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of values. + */ +function baseXor(arrays, iteratee, comparator) { + var index = -1, + length = arrays.length; + + while (++index < length) { + var result = result + ? arrayPush( + baseDifference(result, arrays[index], iteratee, comparator), + baseDifference(arrays[index], result, iteratee, comparator) + ) + : arrays[index]; + } + return (result && result.length) ? baseUniq(result, iteratee, comparator) : []; +} + +module.exports = baseXor; diff --git a/tools/eslint/node_modules/lodash/_baseZipObject.js b/tools/eslint/node_modules/lodash/_baseZipObject.js new file mode 100644 index 00000000000000..401f85be20b458 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_baseZipObject.js @@ -0,0 +1,23 @@ +/** + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * + * @private + * @param {Array} props The property identifiers. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. + */ +function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; + + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); + } + return result; +} + +module.exports = baseZipObject; diff --git a/tools/eslint/node_modules/lodash/_cacheHas.js b/tools/eslint/node_modules/lodash/_cacheHas.js new file mode 100644 index 00000000000000..7f2ac484760bfd --- /dev/null +++ b/tools/eslint/node_modules/lodash/_cacheHas.js @@ -0,0 +1,25 @@ +var isKeyable = require('./_isKeyable'); + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** + * Checks if `value` is in `cache`. + * + * @private + * @param {Object} cache The set cache to search. + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function cacheHas(cache, value) { + var map = cache.__data__; + if (isKeyable(value)) { + var data = map.__data__, + hash = typeof value == 'string' ? data.string : data.hash; + + return hash[value] === HASH_UNDEFINED; + } + return map.has(value); +} + +module.exports = cacheHas; diff --git a/tools/eslint/node_modules/lodash/_cachePush.js b/tools/eslint/node_modules/lodash/_cachePush.js new file mode 100644 index 00000000000000..638383b641efcb --- /dev/null +++ b/tools/eslint/node_modules/lodash/_cachePush.js @@ -0,0 +1,27 @@ +var isKeyable = require('./_isKeyable'); + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** + * Adds `value` to the set cache. + * + * @private + * @name push + * @memberOf SetCache + * @param {*} value The value to cache. + */ +function cachePush(value) { + var map = this.__data__; + if (isKeyable(value)) { + var data = map.__data__, + hash = typeof value == 'string' ? data.string : data.hash; + + hash[value] = HASH_UNDEFINED; + } + else { + map.set(value, HASH_UNDEFINED); + } +} + +module.exports = cachePush; diff --git a/tools/eslint/node_modules/lodash/_charsEndIndex.js b/tools/eslint/node_modules/lodash/_charsEndIndex.js new file mode 100644 index 00000000000000..07908ff3aa1973 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_charsEndIndex.js @@ -0,0 +1,19 @@ +var baseIndexOf = require('./_baseIndexOf'); + +/** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ +function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; +} + +module.exports = charsEndIndex; diff --git a/tools/eslint/node_modules/lodash/_charsStartIndex.js b/tools/eslint/node_modules/lodash/_charsStartIndex.js new file mode 100644 index 00000000000000..b17afd2547171b --- /dev/null +++ b/tools/eslint/node_modules/lodash/_charsStartIndex.js @@ -0,0 +1,20 @@ +var baseIndexOf = require('./_baseIndexOf'); + +/** + * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the first unmatched string symbol. + */ +function charsStartIndex(strSymbols, chrSymbols) { + var index = -1, + length = strSymbols.length; + + while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; +} + +module.exports = charsStartIndex; diff --git a/tools/eslint/node_modules/lodash/_checkGlobal.js b/tools/eslint/node_modules/lodash/_checkGlobal.js new file mode 100644 index 00000000000000..b0ea47e1294b05 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_checkGlobal.js @@ -0,0 +1,12 @@ +/** + * Checks if `value` is a global object. + * + * @private + * @param {*} value The value to check. + * @returns {null|Object} Returns `value` if it's a global object, else `null`. + */ +function checkGlobal(value) { + return (value && value.Object === Object) ? value : null; +} + +module.exports = checkGlobal; diff --git a/tools/eslint/node_modules/lodash/_cloneArrayBuffer.js b/tools/eslint/node_modules/lodash/_cloneArrayBuffer.js new file mode 100644 index 00000000000000..c3d8f6e39a61ad --- /dev/null +++ b/tools/eslint/node_modules/lodash/_cloneArrayBuffer.js @@ -0,0 +1,16 @@ +var Uint8Array = require('./_Uint8Array'); + +/** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; +} + +module.exports = cloneArrayBuffer; diff --git a/tools/eslint/node_modules/lodash/_cloneBuffer.js b/tools/eslint/node_modules/lodash/_cloneBuffer.js new file mode 100644 index 00000000000000..247d4106f7f3c1 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_cloneBuffer.js @@ -0,0 +1,18 @@ +/** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var result = new buffer.constructor(buffer.length); + buffer.copy(result); + return result; +} + +module.exports = cloneBuffer; diff --git a/tools/eslint/node_modules/lodash/_cloneDataView.js b/tools/eslint/node_modules/lodash/_cloneDataView.js new file mode 100644 index 00000000000000..9c9b7b054d5e2c --- /dev/null +++ b/tools/eslint/node_modules/lodash/_cloneDataView.js @@ -0,0 +1,16 @@ +var cloneArrayBuffer = require('./_cloneArrayBuffer'); + +/** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ +function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); +} + +module.exports = cloneDataView; diff --git a/tools/eslint/node_modules/lodash/_cloneMap.js b/tools/eslint/node_modules/lodash/_cloneMap.js new file mode 100644 index 00000000000000..b51983d24c7bec --- /dev/null +++ b/tools/eslint/node_modules/lodash/_cloneMap.js @@ -0,0 +1,19 @@ +var addMapEntry = require('./_addMapEntry'), + arrayReduce = require('./_arrayReduce'), + mapToArray = require('./_mapToArray'); + +/** + * Creates a clone of `map`. + * + * @private + * @param {Object} map The map to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned map. + */ +function cloneMap(map, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map); + return arrayReduce(array, addMapEntry, new map.constructor); +} + +module.exports = cloneMap; diff --git a/tools/eslint/node_modules/lodash/_cloneRegExp.js b/tools/eslint/node_modules/lodash/_cloneRegExp.js new file mode 100644 index 00000000000000..64a30dfb4ac39a --- /dev/null +++ b/tools/eslint/node_modules/lodash/_cloneRegExp.js @@ -0,0 +1,17 @@ +/** Used to match `RegExp` flags from their coerced string values. */ +var reFlags = /\w*$/; + +/** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ +function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; +} + +module.exports = cloneRegExp; diff --git a/tools/eslint/node_modules/lodash/_cloneSet.js b/tools/eslint/node_modules/lodash/_cloneSet.js new file mode 100644 index 00000000000000..dc1db95c618d3d --- /dev/null +++ b/tools/eslint/node_modules/lodash/_cloneSet.js @@ -0,0 +1,19 @@ +var addSetEntry = require('./_addSetEntry'), + arrayReduce = require('./_arrayReduce'), + setToArray = require('./_setToArray'); + +/** + * Creates a clone of `set`. + * + * @private + * @param {Object} set The set to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned set. + */ +function cloneSet(set, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set); + return arrayReduce(array, addSetEntry, new set.constructor); +} + +module.exports = cloneSet; diff --git a/tools/eslint/node_modules/lodash/_cloneSymbol.js b/tools/eslint/node_modules/lodash/_cloneSymbol.js new file mode 100644 index 00000000000000..bede39f50a6fcd --- /dev/null +++ b/tools/eslint/node_modules/lodash/_cloneSymbol.js @@ -0,0 +1,18 @@ +var Symbol = require('./_Symbol'); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ +function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; +} + +module.exports = cloneSymbol; diff --git a/tools/eslint/node_modules/lodash/_cloneTypedArray.js b/tools/eslint/node_modules/lodash/_cloneTypedArray.js new file mode 100644 index 00000000000000..7aad84d4fec4bc --- /dev/null +++ b/tools/eslint/node_modules/lodash/_cloneTypedArray.js @@ -0,0 +1,16 @@ +var cloneArrayBuffer = require('./_cloneArrayBuffer'); + +/** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); +} + +module.exports = cloneTypedArray; diff --git a/tools/eslint/node_modules/lodash/_compareAscending.js b/tools/eslint/node_modules/lodash/_compareAscending.js new file mode 100644 index 00000000000000..532866c137e9d0 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_compareAscending.js @@ -0,0 +1,33 @@ +/** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ +function compareAscending(value, other) { + if (value !== other) { + var valIsNull = value === null, + valIsUndef = value === undefined, + valIsReflexive = value === value; + + var othIsNull = other === null, + othIsUndef = other === undefined, + othIsReflexive = other === other; + + if ((value > other && !othIsNull) || !valIsReflexive || + (valIsNull && !othIsUndef && othIsReflexive) || + (valIsUndef && othIsReflexive)) { + return 1; + } + if ((value < other && !valIsNull) || !othIsReflexive || + (othIsNull && !valIsUndef && valIsReflexive) || + (othIsUndef && valIsReflexive)) { + return -1; + } + } + return 0; +} + +module.exports = compareAscending; diff --git a/tools/eslint/node_modules/lodash/_compareMultiple.js b/tools/eslint/node_modules/lodash/_compareMultiple.js new file mode 100644 index 00000000000000..ad61f0fbcaa404 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_compareMultiple.js @@ -0,0 +1,44 @@ +var compareAscending = require('./_compareAscending'); + +/** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ +function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; +} + +module.exports = compareMultiple; diff --git a/tools/eslint/node_modules/lodash/_composeArgs.js b/tools/eslint/node_modules/lodash/_composeArgs.js new file mode 100644 index 00000000000000..07398e78409486 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_composeArgs.js @@ -0,0 +1,39 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Creates an array that is the composition of partially applied arguments, + * placeholders, and provided arguments into a single array of arguments. + * + * @private + * @param {Array|Object} args The provided arguments. + * @param {Array} partials The arguments to prepend to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ +function composeArgs(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersLength = holders.length, + leftIndex = -1, + leftLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(leftLength + rangeLength), + isUncurried = !isCurried; + + while (++leftIndex < leftLength) { + result[leftIndex] = partials[leftIndex]; + } + while (++argsIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[holders[argsIndex]] = args[argsIndex]; + } + } + while (rangeLength--) { + result[leftIndex++] = args[argsIndex++]; + } + return result; +} + +module.exports = composeArgs; diff --git a/tools/eslint/node_modules/lodash/_composeArgsRight.js b/tools/eslint/node_modules/lodash/_composeArgsRight.js new file mode 100644 index 00000000000000..18cfae0340efdc --- /dev/null +++ b/tools/eslint/node_modules/lodash/_composeArgsRight.js @@ -0,0 +1,41 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * This function is like `composeArgs` except that the arguments composition + * is tailored for `_.partialRight`. + * + * @private + * @param {Array|Object} args The provided arguments. + * @param {Array} partials The arguments to append to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ +function composeArgsRight(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersIndex = -1, + holdersLength = holders.length, + rightIndex = -1, + rightLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(rangeLength + rightLength), + isUncurried = !isCurried; + + while (++argsIndex < rangeLength) { + result[argsIndex] = args[argsIndex]; + } + var offset = argsIndex; + while (++rightIndex < rightLength) { + result[offset + rightIndex] = partials[rightIndex]; + } + while (++holdersIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[offset + holders[holdersIndex]] = args[argsIndex++]; + } + } + return result; +} + +module.exports = composeArgsRight; diff --git a/tools/eslint/node_modules/lodash/_copyArray.js b/tools/eslint/node_modules/lodash/_copyArray.js new file mode 100644 index 00000000000000..cd94d5d09a10dd --- /dev/null +++ b/tools/eslint/node_modules/lodash/_copyArray.js @@ -0,0 +1,20 @@ +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +module.exports = copyArray; diff --git a/tools/eslint/node_modules/lodash/_copyObject.js b/tools/eslint/node_modules/lodash/_copyObject.js new file mode 100644 index 00000000000000..d95a4cbdc559a2 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_copyObject.js @@ -0,0 +1,16 @@ +var copyObjectWith = require('./_copyObjectWith'); + +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @returns {Object} Returns `object`. + */ +function copyObject(source, props, object) { + return copyObjectWith(source, props, object); +} + +module.exports = copyObject; diff --git a/tools/eslint/node_modules/lodash/_copyObjectWith.js b/tools/eslint/node_modules/lodash/_copyObjectWith.js new file mode 100644 index 00000000000000..11240c60699c96 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_copyObjectWith.js @@ -0,0 +1,32 @@ +var assignValue = require('./_assignValue'); + +/** + * This function is like `copyObject` except that it accepts a function to + * customize copied values. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ +function copyObjectWith(source, props, object, customizer) { + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : source[key]; + + assignValue(object, key, newValue); + } + return object; +} + +module.exports = copyObjectWith; diff --git a/tools/eslint/node_modules/lodash/_copySymbols.js b/tools/eslint/node_modules/lodash/_copySymbols.js new file mode 100644 index 00000000000000..1fac3c8a68d3d3 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_copySymbols.js @@ -0,0 +1,16 @@ +var copyObject = require('./_copyObject'), + getSymbols = require('./_getSymbols'); + +/** + * Copies own symbol properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ +function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); +} + +module.exports = copySymbols; diff --git a/tools/eslint/node_modules/lodash/_countHolders.js b/tools/eslint/node_modules/lodash/_countHolders.js new file mode 100644 index 00000000000000..8cc95e6e0e6d6f --- /dev/null +++ b/tools/eslint/node_modules/lodash/_countHolders.js @@ -0,0 +1,21 @@ +/** + * Gets the number of `placeholder` occurrences in `array`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} placeholder The placeholder to search for. + * @returns {number} Returns the placeholder count. + */ +function countHolders(array, placeholder) { + var length = array.length, + result = 0; + + while (length--) { + if (array[length] === placeholder) { + result++; + } + } + return result; +} + +module.exports = countHolders; diff --git a/tools/eslint/node_modules/lodash/_createAggregator.js b/tools/eslint/node_modules/lodash/_createAggregator.js new file mode 100644 index 00000000000000..7f7afd2c1b4876 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_createAggregator.js @@ -0,0 +1,23 @@ +var arrayAggregator = require('./_arrayAggregator'), + baseAggregator = require('./_baseAggregator'), + baseIteratee = require('./_baseIteratee'), + isArray = require('./isArray'); + +/** + * Creates a function like `_.groupBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} [initializer] The accumulator object initializer. + * @returns {Function} Returns the new aggregator function. + */ +function createAggregator(setter, initializer) { + return function(collection, iteratee) { + var func = isArray(collection) ? arrayAggregator : baseAggregator, + accumulator = initializer ? initializer() : {}; + + return func(collection, setter, baseIteratee(iteratee), accumulator); + }; +} + +module.exports = createAggregator; diff --git a/tools/eslint/node_modules/lodash/_createAssigner.js b/tools/eslint/node_modules/lodash/_createAssigner.js new file mode 100644 index 00000000000000..1e81db9319a10d --- /dev/null +++ b/tools/eslint/node_modules/lodash/_createAssigner.js @@ -0,0 +1,37 @@ +var isIterateeCall = require('./_isIterateeCall'), + rest = require('./rest'); + +/** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ +function createAssigner(assigner) { + return rest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = typeof customizer == 'function' + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); +} + +module.exports = createAssigner; diff --git a/tools/eslint/node_modules/lodash/_createBaseEach.js b/tools/eslint/node_modules/lodash/_createBaseEach.js new file mode 100644 index 00000000000000..d24fdd1bbcb6d0 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_createBaseEach.js @@ -0,0 +1,32 @@ +var isArrayLike = require('./isArrayLike'); + +/** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; +} + +module.exports = createBaseEach; diff --git a/tools/eslint/node_modules/lodash/_createBaseFor.js b/tools/eslint/node_modules/lodash/_createBaseFor.js new file mode 100644 index 00000000000000..94cbf297aa2031 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_createBaseFor.js @@ -0,0 +1,25 @@ +/** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +module.exports = createBaseFor; diff --git a/tools/eslint/node_modules/lodash/_createBaseWrapper.js b/tools/eslint/node_modules/lodash/_createBaseWrapper.js new file mode 100644 index 00000000000000..c365621bd747e3 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_createBaseWrapper.js @@ -0,0 +1,29 @@ +var createCtorWrapper = require('./_createCtorWrapper'), + root = require('./_root'); + +/** Used to compose bitmasks for wrapper metadata. */ +var BIND_FLAG = 1; + +/** + * Creates a function that wraps `func` to invoke it with the optional `this` + * binding of `thisArg`. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createBaseWrapper(func, bitmask, thisArg) { + var isBind = bitmask & BIND_FLAG, + Ctor = createCtorWrapper(func); + + function wrapper() { + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(isBind ? thisArg : this, arguments); + } + return wrapper; +} + +module.exports = createBaseWrapper; diff --git a/tools/eslint/node_modules/lodash/_createCaseFirst.js b/tools/eslint/node_modules/lodash/_createCaseFirst.js new file mode 100644 index 00000000000000..a6f70543eb659b --- /dev/null +++ b/tools/eslint/node_modules/lodash/_createCaseFirst.js @@ -0,0 +1,38 @@ +var stringToArray = require('./_stringToArray'), + toString = require('./toString'); + +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsComboSymbolsRange = '\\u20d0-\\u20f0', + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsZWJ = '\\u200d'; + +/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ +var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); + +/** + * Creates a function like `_.lowerFirst`. + * + * @private + * @param {string} methodName The name of the `String` case method to use. + * @returns {Function} Returns the new function. + */ +function createCaseFirst(methodName) { + return function(string) { + string = toString(string); + + var strSymbols = reHasComplexSymbol.test(string) + ? stringToArray(string) + : undefined; + + var chr = strSymbols ? strSymbols[0] : string.charAt(0), + trailing = strSymbols ? strSymbols.slice(1).join('') : string.slice(1); + + return chr[methodName]() + trailing; + }; +} + +module.exports = createCaseFirst; diff --git a/tools/eslint/node_modules/lodash/_createCompounder.js b/tools/eslint/node_modules/lodash/_createCompounder.js new file mode 100644 index 00000000000000..bfa4ee5fe8c8d7 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_createCompounder.js @@ -0,0 +1,18 @@ +var arrayReduce = require('./_arrayReduce'), + deburr = require('./deburr'), + words = require('./words'); + +/** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ +function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string)), callback, ''); + }; +} + +module.exports = createCompounder; diff --git a/tools/eslint/node_modules/lodash/_createCtorWrapper.js b/tools/eslint/node_modules/lodash/_createCtorWrapper.js new file mode 100644 index 00000000000000..17e1bd8314f420 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_createCtorWrapper.js @@ -0,0 +1,37 @@ +var baseCreate = require('./_baseCreate'), + isObject = require('./isObject'); + +/** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ +function createCtorWrapper(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + switch (args.length) { + case 0: return new Ctor; + case 1: return new Ctor(args[0]); + case 2: return new Ctor(args[0], args[1]); + case 3: return new Ctor(args[0], args[1], args[2]); + case 4: return new Ctor(args[0], args[1], args[2], args[3]); + case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); + case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + } + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; +} + +module.exports = createCtorWrapper; diff --git a/tools/eslint/node_modules/lodash/_createCurryWrapper.js b/tools/eslint/node_modules/lodash/_createCurryWrapper.js new file mode 100644 index 00000000000000..c48ba62402ab3d --- /dev/null +++ b/tools/eslint/node_modules/lodash/_createCurryWrapper.js @@ -0,0 +1,47 @@ +var apply = require('./_apply'), + createCtorWrapper = require('./_createCtorWrapper'), + createHybridWrapper = require('./_createHybridWrapper'), + createRecurryWrapper = require('./_createRecurryWrapper'), + getPlaceholder = require('./_getPlaceholder'), + replaceHolders = require('./_replaceHolders'), + root = require('./_root'); + +/** + * Creates a function that wraps `func` to enable currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. + * @param {number} arity The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createCurryWrapper(func, bitmask, arity) { + var Ctor = createCtorWrapper(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length, + placeholder = getPlaceholder(wrapper); + + while (index--) { + args[index] = arguments[index]; + } + var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) + ? [] + : replaceHolders(args, placeholder); + + length -= holders.length; + if (length < arity) { + return createRecurryWrapper( + func, bitmask, createHybridWrapper, wrapper.placeholder, undefined, + args, holders, undefined, undefined, arity - length); + } + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return apply(fn, this, args); + } + return wrapper; +} + +module.exports = createCurryWrapper; diff --git a/tools/eslint/node_modules/lodash/_createFlow.js b/tools/eslint/node_modules/lodash/_createFlow.js new file mode 100644 index 00000000000000..6b5ee54be1ef50 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_createFlow.js @@ -0,0 +1,85 @@ +var LodashWrapper = require('./_LodashWrapper'), + baseFlatten = require('./_baseFlatten'), + getData = require('./_getData'), + getFuncName = require('./_getFuncName'), + isArray = require('./isArray'), + isLaziable = require('./_isLaziable'), + rest = require('./rest'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used to compose bitmasks for wrapper metadata. */ +var CURRY_FLAG = 8, + PARTIAL_FLAG = 32, + ARY_FLAG = 128, + REARG_FLAG = 256; + +/** + * Creates a `_.flow` or `_.flowRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new flow function. + */ +function createFlow(fromRight) { + return rest(function(funcs) { + funcs = baseFlatten(funcs, 1); + + var length = funcs.length, + index = length, + prereq = LodashWrapper.prototype.thru; + + if (fromRight) { + funcs.reverse(); + } + while (index--) { + var func = funcs[index]; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (prereq && !wrapper && getFuncName(func) == 'wrapper') { + var wrapper = new LodashWrapper([], true); + } + } + index = wrapper ? index : length; + while (++index < length) { + func = funcs[index]; + + var funcName = getFuncName(func), + data = funcName == 'wrapper' ? getData(func) : undefined; + + if (data && isLaziable(data[0]) && + data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && + !data[4].length && data[9] == 1 + ) { + wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); + } else { + wrapper = (func.length == 1 && isLaziable(func)) + ? wrapper[funcName]() + : wrapper.thru(func); + } + } + return function() { + var args = arguments, + value = args[0]; + + if (wrapper && args.length == 1 && + isArray(value) && value.length >= LARGE_ARRAY_SIZE) { + return wrapper.plant(value).value(); + } + var index = 0, + result = length ? funcs[index].apply(this, args) : value; + + while (++index < length) { + result = funcs[index].call(this, result); + } + return result; + }; + }); +} + +module.exports = createFlow; diff --git a/tools/eslint/node_modules/lodash/_createHybridWrapper.js b/tools/eslint/node_modules/lodash/_createHybridWrapper.js new file mode 100644 index 00000000000000..144a90d7931b40 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_createHybridWrapper.js @@ -0,0 +1,93 @@ +var composeArgs = require('./_composeArgs'), + composeArgsRight = require('./_composeArgsRight'), + countHolders = require('./_countHolders'), + createCtorWrapper = require('./_createCtorWrapper'), + createRecurryWrapper = require('./_createRecurryWrapper'), + getPlaceholder = require('./_getPlaceholder'), + reorder = require('./_reorder'), + replaceHolders = require('./_replaceHolders'), + root = require('./_root'); + +/** Used to compose bitmasks for wrapper metadata. */ +var BIND_FLAG = 1, + BIND_KEY_FLAG = 2, + CURRY_FLAG = 8, + CURRY_RIGHT_FLAG = 16, + ARY_FLAG = 128, + FLIP_FLAG = 512; + +/** + * Creates a function that wraps `func` to invoke it with optional `this` + * binding of `thisArg`, partial application, and currying. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [partialsRight] The arguments to append to those provided + * to the new function. + * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { + var isAry = bitmask & ARY_FLAG, + isBind = bitmask & BIND_FLAG, + isBindKey = bitmask & BIND_KEY_FLAG, + isCurried = bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG), + isFlip = bitmask & FLIP_FLAG, + Ctor = isBindKey ? undefined : createCtorWrapper(func); + + function wrapper() { + var length = arguments.length, + index = length, + args = Array(length); + + while (index--) { + args[index] = arguments[index]; + } + if (isCurried) { + var placeholder = getPlaceholder(wrapper), + holdersCount = countHolders(args, placeholder); + } + if (partials) { + args = composeArgs(args, partials, holders, isCurried); + } + if (partialsRight) { + args = composeArgsRight(args, partialsRight, holdersRight, isCurried); + } + length -= holdersCount; + if (isCurried && length < arity) { + var newHolders = replaceHolders(args, placeholder); + return createRecurryWrapper( + func, bitmask, createHybridWrapper, wrapper.placeholder, thisArg, + args, newHolders, argPos, ary, arity - length + ); + } + var thisBinding = isBind ? thisArg : this, + fn = isBindKey ? thisBinding[func] : func; + + length = args.length; + if (argPos) { + args = reorder(args, argPos); + } else if (isFlip && length > 1) { + args.reverse(); + } + if (isAry && ary < length) { + args.length = ary; + } + if (this && this !== root && this instanceof wrapper) { + fn = Ctor || createCtorWrapper(fn); + } + return fn.apply(thisBinding, args); + } + return wrapper; +} + +module.exports = createHybridWrapper; diff --git a/tools/eslint/node_modules/lodash/_createInverter.js b/tools/eslint/node_modules/lodash/_createInverter.js new file mode 100644 index 00000000000000..6c0c56299bdf89 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_createInverter.js @@ -0,0 +1,17 @@ +var baseInverter = require('./_baseInverter'); + +/** + * Creates a function like `_.invertBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} toIteratee The function to resolve iteratees. + * @returns {Function} Returns the new inverter function. + */ +function createInverter(setter, toIteratee) { + return function(object, iteratee) { + return baseInverter(object, setter, toIteratee(iteratee), {}); + }; +} + +module.exports = createInverter; diff --git a/tools/eslint/node_modules/lodash/_createMathOperation.js b/tools/eslint/node_modules/lodash/_createMathOperation.js new file mode 100644 index 00000000000000..56a4d447d0b367 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_createMathOperation.js @@ -0,0 +1,24 @@ +/** + * Creates a function that performs a mathematical operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @returns {Function} Returns the new mathematical operation function. + */ +function createMathOperation(operator) { + return function(value, other) { + var result; + if (value === undefined && other === undefined) { + return 0; + } + if (value !== undefined) { + result = value; + } + if (other !== undefined) { + result = result === undefined ? other : operator(result, other); + } + return result; + }; +} + +module.exports = createMathOperation; diff --git a/tools/eslint/node_modules/lodash/_createOver.js b/tools/eslint/node_modules/lodash/_createOver.js new file mode 100644 index 00000000000000..b34ca964c21748 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_createOver.js @@ -0,0 +1,27 @@ +var apply = require('./_apply'), + arrayMap = require('./_arrayMap'), + baseFlatten = require('./_baseFlatten'), + baseIteratee = require('./_baseIteratee'), + isFlattenableIteratee = require('./_isFlattenableIteratee'), + rest = require('./rest'); + +/** + * Creates a function like `_.over`. + * + * @private + * @param {Function} arrayFunc The function to iterate over iteratees. + * @returns {Function} Returns the new invoker function. + */ +function createOver(arrayFunc) { + return rest(function(iteratees) { + iteratees = arrayMap(baseFlatten(iteratees, 1, isFlattenableIteratee), baseIteratee); + return rest(function(args) { + var thisArg = this; + return arrayFunc(iteratees, function(iteratee) { + return apply(iteratee, thisArg, args); + }); + }); + }); +} + +module.exports = createOver; diff --git a/tools/eslint/node_modules/lodash/_createPadding.js b/tools/eslint/node_modules/lodash/_createPadding.js new file mode 100644 index 00000000000000..2626376aeaecbb --- /dev/null +++ b/tools/eslint/node_modules/lodash/_createPadding.js @@ -0,0 +1,42 @@ +var baseRepeat = require('./_baseRepeat'), + stringSize = require('./_stringSize'), + stringToArray = require('./_stringToArray'); + +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsComboSymbolsRange = '\\u20d0-\\u20f0', + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsZWJ = '\\u200d'; + +/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ +var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeCeil = Math.ceil; + +/** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {number} length The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ +function createPadding(length, chars) { + chars = chars === undefined ? ' ' : (chars + ''); + + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return reHasComplexSymbol.test(chars) + ? stringToArray(result).slice(0, length).join('') + : result.slice(0, length); +} + +module.exports = createPadding; diff --git a/tools/eslint/node_modules/lodash/_createPartialWrapper.js b/tools/eslint/node_modules/lodash/_createPartialWrapper.js new file mode 100644 index 00000000000000..cc4314ef9f5db1 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_createPartialWrapper.js @@ -0,0 +1,44 @@ +var apply = require('./_apply'), + createCtorWrapper = require('./_createCtorWrapper'), + root = require('./_root'); + +/** Used to compose bitmasks for wrapper metadata. */ +var BIND_FLAG = 1; + +/** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ +function createPartialWrapper(func, bitmask, thisArg, partials) { + var isBind = bitmask & BIND_FLAG, + Ctor = createCtorWrapper(func); + + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return apply(fn, isBind ? thisArg : this, args); + } + return wrapper; +} + +module.exports = createPartialWrapper; diff --git a/tools/eslint/node_modules/lodash/_createRange.js b/tools/eslint/node_modules/lodash/_createRange.js new file mode 100644 index 00000000000000..97285636608ec7 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_createRange.js @@ -0,0 +1,31 @@ +var baseRange = require('./_baseRange'), + isIterateeCall = require('./_isIterateeCall'), + toNumber = require('./toNumber'); + +/** + * Creates a `_.range` or `_.rangeRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new range function. + */ +function createRange(fromRight) { + return function(start, end, step) { + if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { + end = step = undefined; + } + // Ensure the sign of `-0` is preserved. + start = toNumber(start); + start = start === start ? start : 0; + if (end === undefined) { + end = start; + start = 0; + } else { + end = toNumber(end) || 0; + } + step = step === undefined ? (start < end ? 1 : -1) : (toNumber(step) || 0); + return baseRange(start, end, step, fromRight); + }; +} + +module.exports = createRange; diff --git a/tools/eslint/node_modules/lodash/_createRecurryWrapper.js b/tools/eslint/node_modules/lodash/_createRecurryWrapper.js new file mode 100644 index 00000000000000..47e5e3a740c80b --- /dev/null +++ b/tools/eslint/node_modules/lodash/_createRecurryWrapper.js @@ -0,0 +1,58 @@ +var copyArray = require('./_copyArray'), + isLaziable = require('./_isLaziable'), + setData = require('./_setData'); + +/** Used to compose bitmasks for wrapper metadata. */ +var BIND_FLAG = 1, + BIND_KEY_FLAG = 2, + CURRY_BOUND_FLAG = 4, + CURRY_FLAG = 8, + PARTIAL_FLAG = 32, + PARTIAL_RIGHT_FLAG = 64; + +/** + * Creates a function that wraps `func` to continue currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. + * @param {Function} wrapFunc The function to create the `func` wrapper. + * @param {*} placeholder The placeholder value. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { + var isCurry = bitmask & CURRY_FLAG, + newArgPos = argPos ? copyArray(argPos) : undefined, + newHolders = isCurry ? holders : undefined, + newHoldersRight = isCurry ? undefined : holders, + newPartials = isCurry ? partials : undefined, + newPartialsRight = isCurry ? undefined : partials; + + bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG); + bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG); + + if (!(bitmask & CURRY_BOUND_FLAG)) { + bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG); + } + var newData = [ + func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, + newHoldersRight, newArgPos, ary, arity + ]; + + var result = wrapFunc.apply(undefined, newData); + if (isLaziable(func)) { + setData(result, newData); + } + result.placeholder = placeholder; + return result; +} + +module.exports = createRecurryWrapper; diff --git a/tools/eslint/node_modules/lodash/_createRound.js b/tools/eslint/node_modules/lodash/_createRound.js new file mode 100644 index 00000000000000..cb42ba2466f208 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_createRound.js @@ -0,0 +1,30 @@ +var toInteger = require('./toInteger'), + toNumber = require('./toNumber'), + toString = require('./toString'); + +/** + * Creates a function like `_.round`. + * + * @private + * @param {string} methodName The name of the `Math` method to use when rounding. + * @returns {Function} Returns the new round function. + */ +function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + number = toNumber(number); + precision = toInteger(precision); + if (precision) { + // Shift with exponential notation to avoid floating-point issues. + // See [MDN](https://mdn.io/round#Examples) for more details. + var pair = (toString(number) + 'e').split('e'), + value = func(pair[0] + 'e' + (+pair[1] + precision)); + + pair = (toString(value) + 'e').split('e'); + return +(pair[0] + 'e' + (+pair[1] - precision)); + } + return func(number); + }; +} + +module.exports = createRound; diff --git a/tools/eslint/node_modules/lodash/_createSet.js b/tools/eslint/node_modules/lodash/_createSet.js new file mode 100644 index 00000000000000..c67128f24dd00d --- /dev/null +++ b/tools/eslint/node_modules/lodash/_createSet.js @@ -0,0 +1,15 @@ +var Set = require('./_Set'), + noop = require('./noop'); + +/** + * Creates a set of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ +var createSet = !(Set && new Set([1, 2]).size === 2) ? noop : function(values) { + return new Set(values); +}; + +module.exports = createSet; diff --git a/tools/eslint/node_modules/lodash/_createWrapper.js b/tools/eslint/node_modules/lodash/_createWrapper.js new file mode 100644 index 00000000000000..7b573b2f133f64 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_createWrapper.js @@ -0,0 +1,105 @@ +var baseSetData = require('./_baseSetData'), + createBaseWrapper = require('./_createBaseWrapper'), + createCurryWrapper = require('./_createCurryWrapper'), + createHybridWrapper = require('./_createHybridWrapper'), + createPartialWrapper = require('./_createPartialWrapper'), + getData = require('./_getData'), + mergeData = require('./_mergeData'), + setData = require('./_setData'), + toInteger = require('./toInteger'); + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** Used to compose bitmasks for wrapper metadata. */ +var BIND_FLAG = 1, + BIND_KEY_FLAG = 2, + CURRY_FLAG = 8, + CURRY_RIGHT_FLAG = 16, + PARTIAL_FLAG = 32, + PARTIAL_RIGHT_FLAG = 64; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Creates a function that either curries or invokes `func` with optional + * `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask of wrapper flags. + * The bitmask may be composed of the following flags: + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` or `_.curryRight` of a bound function + * 8 - `_.curry` + * 16 - `_.curryRight` + * 32 - `_.partial` + * 64 - `_.partialRight` + * 128 - `_.rearg` + * 256 - `_.ary` + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to be partially applied. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ +function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + var isBindKey = bitmask & BIND_KEY_FLAG; + if (!isBindKey && typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var length = partials ? partials.length : 0; + if (!length) { + bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG); + partials = holders = undefined; + } + ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); + arity = arity === undefined ? arity : toInteger(arity); + length -= holders ? holders.length : 0; + + if (bitmask & PARTIAL_RIGHT_FLAG) { + var partialsRight = partials, + holdersRight = holders; + + partials = holders = undefined; + } + var data = isBindKey ? undefined : getData(func); + + var newData = [ + func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, + argPos, ary, arity + ]; + + if (data) { + mergeData(newData, data); + } + func = newData[0]; + bitmask = newData[1]; + thisArg = newData[2]; + partials = newData[3]; + holders = newData[4]; + arity = newData[9] = newData[9] == null + ? (isBindKey ? 0 : func.length) + : nativeMax(newData[9] - length, 0); + + if (!arity && bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG)) { + bitmask &= ~(CURRY_FLAG | CURRY_RIGHT_FLAG); + } + if (!bitmask || bitmask == BIND_FLAG) { + var result = createBaseWrapper(func, bitmask, thisArg); + } else if (bitmask == CURRY_FLAG || bitmask == CURRY_RIGHT_FLAG) { + result = createCurryWrapper(func, bitmask, arity); + } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !holders.length) { + result = createPartialWrapper(func, bitmask, thisArg, partials); + } else { + result = createHybridWrapper.apply(undefined, newData); + } + var setter = data ? baseSetData : setData; + return setter(result, newData); +} + +module.exports = createWrapper; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/deburrLetter.js b/tools/eslint/node_modules/lodash/_deburrLetter.js similarity index 100% rename from tools/eslint/node_modules/inquirer/node_modules/lodash/internal/deburrLetter.js rename to tools/eslint/node_modules/lodash/_deburrLetter.js diff --git a/tools/eslint/node_modules/lodash/_equalArrays.js b/tools/eslint/node_modules/lodash/_equalArrays.js new file mode 100644 index 00000000000000..323c67cc8d4335 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_equalArrays.js @@ -0,0 +1,77 @@ +var arraySome = require('./_arraySome'); + +/** Used to compose bitmasks for comparison styles. */ +var UNORDERED_COMPARE_FLAG = 1, + PARTIAL_COMPARE_FLAG = 2; + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { + var index = -1, + isPartial = bitmask & PARTIAL_COMPARE_FLAG, + isUnordered = bitmask & UNORDERED_COMPARE_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked) { + return stacked == other; + } + var result = true; + stack.set(array, other); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (isUnordered) { + if (!arraySome(other, function(othValue) { + return arrValue === othValue || + equalFunc(arrValue, othValue, customizer, bitmask, stack); + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, customizer, bitmask, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + return result; +} + +module.exports = equalArrays; diff --git a/tools/eslint/node_modules/lodash/_equalByTag.js b/tools/eslint/node_modules/lodash/_equalByTag.js new file mode 100644 index 00000000000000..b3e37bd8a5f322 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_equalByTag.js @@ -0,0 +1,114 @@ +var Symbol = require('./_Symbol'), + Uint8Array = require('./_Uint8Array'), + equalArrays = require('./_equalArrays'), + mapToArray = require('./_mapToArray'), + setToArray = require('./_setToArray'); + +/** Used to compose bitmasks for comparison styles. */ +var UNORDERED_COMPARE_FLAG = 1, + PARTIAL_COMPARE_FLAG = 2; + +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + mapTag = '[object Map]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]'; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + // Coerce dates and booleans to numbers, dates to milliseconds and + // booleans to `1` or `0` treating invalid dates coerced to `NaN` as + // not equal. + return +object == +other; + + case errorTag: + return object.name == other.name && object.message == other.message; + + case numberTag: + // Treat `NaN` vs. `NaN` as equal. + return (object != +object) ? other != +other : object == +other; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & PARTIAL_COMPARE_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= UNORDERED_COMPARE_FLAG; + stack.set(object, other); + + // Recursively compare objects (susceptible to call stack limits). + return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; +} + +module.exports = equalByTag; diff --git a/tools/eslint/node_modules/lodash/_equalObjects.js b/tools/eslint/node_modules/lodash/_equalObjects.js new file mode 100644 index 00000000000000..9a5d17fac1bed0 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_equalObjects.js @@ -0,0 +1,83 @@ +var baseHas = require('./_baseHas'), + keys = require('./keys'); + +/** Used to compose bitmasks for comparison styles. */ +var PARTIAL_COMPARE_FLAG = 2; + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, + objProps = keys(object), + objLength = objProps.length, + othProps = keys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : baseHas(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + var result = true; + stack.set(object, other); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + return result; +} + +module.exports = equalObjects; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/escapeHtmlChar.js b/tools/eslint/node_modules/lodash/_escapeHtmlChar.js similarity index 100% rename from tools/eslint/node_modules/inquirer/node_modules/lodash/internal/escapeHtmlChar.js rename to tools/eslint/node_modules/lodash/_escapeHtmlChar.js diff --git a/tools/eslint/node_modules/lodash/_escapeStringChar.js b/tools/eslint/node_modules/lodash/_escapeStringChar.js new file mode 100644 index 00000000000000..44eca96ca8c956 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_escapeStringChar.js @@ -0,0 +1,22 @@ +/** Used to escape characters for inclusion in compiled string literals. */ +var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\u2028': 'u2028', + '\u2029': 'u2029' +}; + +/** + * Used by `_.template` to escape characters for inclusion in compiled string literals. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ +function escapeStringChar(chr) { + return '\\' + stringEscapes[chr]; +} + +module.exports = escapeStringChar; diff --git a/tools/eslint/node_modules/lodash/_getAllKeys.js b/tools/eslint/node_modules/lodash/_getAllKeys.js new file mode 100644 index 00000000000000..a9ce6995a6ad27 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_getAllKeys.js @@ -0,0 +1,16 @@ +var baseGetAllKeys = require('./_baseGetAllKeys'), + getSymbols = require('./_getSymbols'), + keys = require('./keys'); + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +module.exports = getAllKeys; diff --git a/tools/eslint/node_modules/lodash/_getAllKeysIn.js b/tools/eslint/node_modules/lodash/_getAllKeysIn.js new file mode 100644 index 00000000000000..1b4667841db49a --- /dev/null +++ b/tools/eslint/node_modules/lodash/_getAllKeysIn.js @@ -0,0 +1,17 @@ +var baseGetAllKeys = require('./_baseGetAllKeys'), + getSymbolsIn = require('./_getSymbolsIn'), + keysIn = require('./keysIn'); + +/** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); +} + +module.exports = getAllKeysIn; diff --git a/tools/eslint/node_modules/lodash/_getData.js b/tools/eslint/node_modules/lodash/_getData.js new file mode 100644 index 00000000000000..a1fe7b7790ded6 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_getData.js @@ -0,0 +1,15 @@ +var metaMap = require('./_metaMap'), + noop = require('./noop'); + +/** + * Gets metadata for `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {*} Returns the metadata for `func`. + */ +var getData = !metaMap ? noop : function(func) { + return metaMap.get(func); +}; + +module.exports = getData; diff --git a/tools/eslint/node_modules/lodash/_getFuncName.js b/tools/eslint/node_modules/lodash/_getFuncName.js new file mode 100644 index 00000000000000..21e15b3377dcfb --- /dev/null +++ b/tools/eslint/node_modules/lodash/_getFuncName.js @@ -0,0 +1,31 @@ +var realNames = require('./_realNames'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Gets the name of `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {string} Returns the function name. + */ +function getFuncName(func) { + var result = (func.name + ''), + array = realNames[result], + length = hasOwnProperty.call(realNames, result) ? array.length : 0; + + while (length--) { + var data = array[length], + otherFunc = data.func; + if (otherFunc == null || otherFunc == func) { + return data.name; + } + } + return result; +} + +module.exports = getFuncName; diff --git a/tools/eslint/node_modules/lodash/_getLength.js b/tools/eslint/node_modules/lodash/_getLength.js new file mode 100644 index 00000000000000..54071653aadbe9 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_getLength.js @@ -0,0 +1,16 @@ +var baseProperty = require('./_baseProperty'); + +/** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a + * [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects + * Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ +var getLength = baseProperty('length'); + +module.exports = getLength; diff --git a/tools/eslint/node_modules/lodash/_getMatchData.js b/tools/eslint/node_modules/lodash/_getMatchData.js new file mode 100644 index 00000000000000..a1456d2401ee50 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_getMatchData.js @@ -0,0 +1,21 @@ +var isStrictComparable = require('./_isStrictComparable'), + toPairs = require('./toPairs'); + +/** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ +function getMatchData(object) { + var result = toPairs(object), + length = result.length; + + while (length--) { + result[length][2] = isStrictComparable(result[length][1]); + } + return result; +} + +module.exports = getMatchData; diff --git a/tools/eslint/node_modules/lodash/_getNative.js b/tools/eslint/node_modules/lodash/_getNative.js new file mode 100644 index 00000000000000..f6ff7f19b97122 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_getNative.js @@ -0,0 +1,16 @@ +var isNative = require('./isNative'); + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = object[key]; + return isNative(value) ? value : undefined; +} + +module.exports = getNative; diff --git a/tools/eslint/node_modules/lodash/_getPlaceholder.js b/tools/eslint/node_modules/lodash/_getPlaceholder.js new file mode 100644 index 00000000000000..4bbcda25ecb6db --- /dev/null +++ b/tools/eslint/node_modules/lodash/_getPlaceholder.js @@ -0,0 +1,13 @@ +/** + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ +function getPlaceholder(func) { + var object = func; + return object.placeholder; +} + +module.exports = getPlaceholder; diff --git a/tools/eslint/node_modules/lodash/_getPrototype.js b/tools/eslint/node_modules/lodash/_getPrototype.js new file mode 100644 index 00000000000000..1ef6d927e31c09 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_getPrototype.js @@ -0,0 +1,15 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetPrototype = Object.getPrototypeOf; + +/** + * Gets the `[[Prototype]]` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {null|Object} Returns the `[[Prototype]]`. + */ +function getPrototype(value) { + return nativeGetPrototype(Object(value)); +} + +module.exports = getPrototype; diff --git a/tools/eslint/node_modules/lodash/_getSymbols.js b/tools/eslint/node_modules/lodash/_getSymbols.js new file mode 100644 index 00000000000000..63df71742d6a50 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_getSymbols.js @@ -0,0 +1,24 @@ +/** Built-in value references. */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; + +/** + * Creates an array of the own enumerable symbol properties of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +function getSymbols(object) { + // Coerce `object` to an object to avoid non-object errors in V8. + // See https://bugs.chromium.org/p/v8/issues/detail?id=3443 for more details. + return getOwnPropertySymbols(Object(object)); +} + +// Fallback for IE < 11. +if (!getOwnPropertySymbols) { + getSymbols = function() { + return []; + }; +} + +module.exports = getSymbols; diff --git a/tools/eslint/node_modules/lodash/_getSymbolsIn.js b/tools/eslint/node_modules/lodash/_getSymbolsIn.js new file mode 100644 index 00000000000000..3a3729f05b78c1 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_getSymbolsIn.js @@ -0,0 +1,25 @@ +var arrayPush = require('./_arrayPush'), + getPrototype = require('./_getPrototype'), + getSymbols = require('./_getSymbols'); + +/** Built-in value references. */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; + +/** + * Creates an array of the own and inherited enumerable symbol properties + * of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbolsIn = !getOwnPropertySymbols ? getSymbols : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; +}; + +module.exports = getSymbolsIn; diff --git a/tools/eslint/node_modules/lodash/_getTag.js b/tools/eslint/node_modules/lodash/_getTag.js new file mode 100644 index 00000000000000..0d1a455c1bd33f --- /dev/null +++ b/tools/eslint/node_modules/lodash/_getTag.js @@ -0,0 +1,70 @@ +var DataView = require('./_DataView'), + Map = require('./_Map'), + Promise = require('./_Promise'), + Set = require('./_Set'), + WeakMap = require('./_WeakMap'), + toSource = require('./_toSource'); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + setTag = '[object Set]', + weakMapTag = '[object WeakMap]'; + +var dataViewTag = '[object DataView]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function getTag(value) { + return objectToString.call(value); +} + +// Fallback for data views, maps, sets, and weak maps in IE 11, +// for data views in Edge, and promises in Node.js. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = objectToString.call(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +module.exports = getTag; diff --git a/tools/eslint/node_modules/lodash/_getView.js b/tools/eslint/node_modules/lodash/_getView.js new file mode 100644 index 00000000000000..df1e5d44b5ee72 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_getView.js @@ -0,0 +1,33 @@ +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * Gets the view, applying any `transforms` to the `start` and `end` positions. + * + * @private + * @param {number} start The start of the view. + * @param {number} end The end of the view. + * @param {Array} transforms The transformations to apply to the view. + * @returns {Object} Returns an object containing the `start` and `end` + * positions of the view. + */ +function getView(start, end, transforms) { + var index = -1, + length = transforms.length; + + while (++index < length) { + var data = transforms[index], + size = data.size; + + switch (data.type) { + case 'drop': start += size; break; + case 'dropRight': end -= size; break; + case 'take': end = nativeMin(end, start + size); break; + case 'takeRight': start = nativeMax(start, end - size); break; + } + } + return { 'start': start, 'end': end }; +} + +module.exports = getView; diff --git a/tools/eslint/node_modules/lodash/_hasPath.js b/tools/eslint/node_modules/lodash/_hasPath.js new file mode 100644 index 00000000000000..eea7e72ab16454 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_hasPath.js @@ -0,0 +1,40 @@ +var baseCastPath = require('./_baseCastPath'), + isArguments = require('./isArguments'), + isArray = require('./isArray'), + isIndex = require('./_isIndex'), + isKey = require('./_isKey'), + isLength = require('./isLength'), + isString = require('./isString'); + +/** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ +function hasPath(object, path, hasFunc) { + path = isKey(path, object) ? [path] : baseCastPath(path); + + var result, + index = -1, + length = path.length; + + while (++index < length) { + var key = path[index]; + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result) { + return result; + } + var length = object ? object.length : 0; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isString(object) || isArguments(object)); +} + +module.exports = hasPath; diff --git a/tools/eslint/node_modules/lodash/_hashDelete.js b/tools/eslint/node_modules/lodash/_hashDelete.js new file mode 100644 index 00000000000000..b562317c0074f0 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_hashDelete.js @@ -0,0 +1,15 @@ +var hashHas = require('./_hashHas'); + +/** + * Removes `key` and its value from the hash. + * + * @private + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(hash, key) { + return hashHas(hash, key) && delete hash[key]; +} + +module.exports = hashDelete; diff --git a/tools/eslint/node_modules/lodash/_hashGet.js b/tools/eslint/node_modules/lodash/_hashGet.js new file mode 100644 index 00000000000000..ba509b6f708f59 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_hashGet.js @@ -0,0 +1,28 @@ +var nativeCreate = require('./_nativeCreate'); + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Gets the hash value for `key`. + * + * @private + * @param {Object} hash The hash to query. + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(hash, key) { + if (nativeCreate) { + var result = hash[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(hash, key) ? hash[key] : undefined; +} + +module.exports = hashGet; diff --git a/tools/eslint/node_modules/lodash/_hashHas.js b/tools/eslint/node_modules/lodash/_hashHas.js new file mode 100644 index 00000000000000..3bbff484306554 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_hashHas.js @@ -0,0 +1,21 @@ +var nativeCreate = require('./_nativeCreate'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @param {Object} hash The hash to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(hash, key) { + return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key); +} + +module.exports = hashHas; diff --git a/tools/eslint/node_modules/lodash/_hashSet.js b/tools/eslint/node_modules/lodash/_hashSet.js new file mode 100644 index 00000000000000..f7c3307399a09c --- /dev/null +++ b/tools/eslint/node_modules/lodash/_hashSet.js @@ -0,0 +1,18 @@ +var nativeCreate = require('./_nativeCreate'); + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** + * Sets the hash `key` to `value`. + * + * @private + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + */ +function hashSet(hash, key, value) { + hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; +} + +module.exports = hashSet; diff --git a/tools/eslint/node_modules/lodash/_indexKeys.js b/tools/eslint/node_modules/lodash/_indexKeys.js new file mode 100644 index 00000000000000..0e2fc10481d591 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_indexKeys.js @@ -0,0 +1,24 @@ +var baseTimes = require('./_baseTimes'), + isArguments = require('./isArguments'), + isArray = require('./isArray'), + isLength = require('./isLength'), + isString = require('./isString'); + +/** + * Creates an array of index keys for `object` values of arrays, + * `arguments` objects, and strings, otherwise `null` is returned. + * + * @private + * @param {Object} object The object to query. + * @returns {Array|null} Returns index keys, else `null`. + */ +function indexKeys(object) { + var length = object ? object.length : undefined; + if (isLength(length) && + (isArray(object) || isString(object) || isArguments(object))) { + return baseTimes(length, String); + } + return null; +} + +module.exports = indexKeys; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/indexOfNaN.js b/tools/eslint/node_modules/lodash/_indexOfNaN.js similarity index 100% rename from tools/eslint/node_modules/inquirer/node_modules/lodash/internal/indexOfNaN.js rename to tools/eslint/node_modules/lodash/_indexOfNaN.js diff --git a/tools/eslint/node_modules/lodash/_initCloneArray.js b/tools/eslint/node_modules/lodash/_initCloneArray.js new file mode 100644 index 00000000000000..aef02120e5e2c5 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_initCloneArray.js @@ -0,0 +1,26 @@ +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ +function initCloneArray(array) { + var length = array.length, + result = array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; +} + +module.exports = initCloneArray; diff --git a/tools/eslint/node_modules/lodash/_initCloneByTag.js b/tools/eslint/node_modules/lodash/_initCloneByTag.js new file mode 100644 index 00000000000000..e7b77edc696e4a --- /dev/null +++ b/tools/eslint/node_modules/lodash/_initCloneByTag.js @@ -0,0 +1,80 @@ +var cloneArrayBuffer = require('./_cloneArrayBuffer'), + cloneDataView = require('./_cloneDataView'), + cloneMap = require('./_cloneMap'), + cloneRegExp = require('./_cloneRegExp'), + cloneSet = require('./_cloneSet'), + cloneSymbol = require('./_cloneSymbol'), + cloneTypedArray = require('./_cloneTypedArray'); + +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]', + dateTag = '[object Date]', + mapTag = '[object Map]', + numberTag = '[object Number]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneByTag(object, tag, cloneFunc, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return cloneMap(object, isDeep, cloneFunc); + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return cloneSet(object, isDeep, cloneFunc); + + case symbolTag: + return cloneSymbol(object); + } +} + +module.exports = initCloneByTag; diff --git a/tools/eslint/node_modules/lodash/_initCloneObject.js b/tools/eslint/node_modules/lodash/_initCloneObject.js new file mode 100644 index 00000000000000..5a13e64a5266d7 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_initCloneObject.js @@ -0,0 +1,18 @@ +var baseCreate = require('./_baseCreate'), + getPrototype = require('./_getPrototype'), + isPrototype = require('./_isPrototype'); + +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; +} + +module.exports = initCloneObject; diff --git a/tools/eslint/node_modules/lodash/_isFlattenable.js b/tools/eslint/node_modules/lodash/_isFlattenable.js new file mode 100644 index 00000000000000..847ad1fa0e046d --- /dev/null +++ b/tools/eslint/node_modules/lodash/_isFlattenable.js @@ -0,0 +1,16 @@ +var isArguments = require('./isArguments'), + isArray = require('./isArray'), + isArrayLikeObject = require('./isArrayLikeObject'); + +/** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ +function isFlattenable(value) { + return isArrayLikeObject(value) && (isArray(value) || isArguments(value)); +} + +module.exports = isFlattenable; diff --git a/tools/eslint/node_modules/lodash/_isFlattenableIteratee.js b/tools/eslint/node_modules/lodash/_isFlattenableIteratee.js new file mode 100644 index 00000000000000..f7ede3e22a12cd --- /dev/null +++ b/tools/eslint/node_modules/lodash/_isFlattenableIteratee.js @@ -0,0 +1,16 @@ +var isArray = require('./isArray'), + isFunction = require('./isFunction'); + +/** + * Checks if `value` is a flattenable array and not a `_.matchesProperty` + * iteratee shorthand. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ +function isFlattenableIteratee(value) { + return isArray(value) && !(value.length == 2 && !isFunction(value[0])); +} + +module.exports = isFlattenableIteratee; diff --git a/tools/eslint/node_modules/lodash/_isHostObject.js b/tools/eslint/node_modules/lodash/_isHostObject.js new file mode 100644 index 00000000000000..e598c10e341b7b --- /dev/null +++ b/tools/eslint/node_modules/lodash/_isHostObject.js @@ -0,0 +1,20 @@ +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +module.exports = isHostObject; diff --git a/tools/eslint/node_modules/lodash/_isIndex.js b/tools/eslint/node_modules/lodash/_isIndex.js new file mode 100644 index 00000000000000..c7ff6079a9a6ed --- /dev/null +++ b/tools/eslint/node_modules/lodash/_isIndex.js @@ -0,0 +1,21 @@ +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; + length = length == null ? MAX_SAFE_INTEGER : length; + return value > -1 && value % 1 == 0 && value < length; +} + +module.exports = isIndex; diff --git a/tools/eslint/node_modules/lodash/_isIterateeCall.js b/tools/eslint/node_modules/lodash/_isIterateeCall.js new file mode 100644 index 00000000000000..a0bb5a9cf60533 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_isIterateeCall.js @@ -0,0 +1,30 @@ +var eq = require('./eq'), + isArrayLike = require('./isArrayLike'), + isIndex = require('./_isIndex'), + isObject = require('./isObject'); + +/** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; +} + +module.exports = isIterateeCall; diff --git a/tools/eslint/node_modules/lodash/_isKey.js b/tools/eslint/node_modules/lodash/_isKey.js new file mode 100644 index 00000000000000..a907950add8048 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_isKey.js @@ -0,0 +1,26 @@ +var isArray = require('./isArray'), + isSymbol = require('./isSymbol'); + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/; + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + var type = typeof value; + if (type == 'number' || type == 'symbol') { + return true; + } + return !isArray(value) && + (isSymbol(value) || reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object))); +} + +module.exports = isKey; diff --git a/tools/eslint/node_modules/lodash/_isKeyable.js b/tools/eslint/node_modules/lodash/_isKeyable.js new file mode 100644 index 00000000000000..5df83c0e97226e --- /dev/null +++ b/tools/eslint/node_modules/lodash/_isKeyable.js @@ -0,0 +1,14 @@ +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return type == 'number' || type == 'boolean' || + (type == 'string' && value != '__proto__') || value == null; +} + +module.exports = isKeyable; diff --git a/tools/eslint/node_modules/lodash/_isLaziable.js b/tools/eslint/node_modules/lodash/_isLaziable.js new file mode 100644 index 00000000000000..a57c4f2dc72b57 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_isLaziable.js @@ -0,0 +1,28 @@ +var LazyWrapper = require('./_LazyWrapper'), + getData = require('./_getData'), + getFuncName = require('./_getFuncName'), + lodash = require('./wrapperLodash'); + +/** + * Checks if `func` has a lazy counterpart. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart, + * else `false`. + */ +function isLaziable(func) { + var funcName = getFuncName(func), + other = lodash[funcName]; + + if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { + return false; + } + if (func === other) { + return true; + } + var data = getData(other); + return !!data && func === data[0]; +} + +module.exports = isLaziable; diff --git a/tools/eslint/node_modules/lodash/_isPrototype.js b/tools/eslint/node_modules/lodash/_isPrototype.js new file mode 100644 index 00000000000000..0f29498d473139 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_isPrototype.js @@ -0,0 +1,18 @@ +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +module.exports = isPrototype; diff --git a/tools/eslint/node_modules/lodash/_isStrictComparable.js b/tools/eslint/node_modules/lodash/_isStrictComparable.js new file mode 100644 index 00000000000000..b59f40b8574a9c --- /dev/null +++ b/tools/eslint/node_modules/lodash/_isStrictComparable.js @@ -0,0 +1,15 @@ +var isObject = require('./isObject'); + +/** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ +function isStrictComparable(value) { + return value === value && !isObject(value); +} + +module.exports = isStrictComparable; diff --git a/tools/eslint/node_modules/lodash/_iteratorToArray.js b/tools/eslint/node_modules/lodash/_iteratorToArray.js new file mode 100644 index 00000000000000..476856647c66d0 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_iteratorToArray.js @@ -0,0 +1,18 @@ +/** + * Converts `iterator` to an array. + * + * @private + * @param {Object} iterator The iterator to convert. + * @returns {Array} Returns the converted array. + */ +function iteratorToArray(iterator) { + var data, + result = []; + + while (!(data = iterator.next()).done) { + result.push(data.value); + } + return result; +} + +module.exports = iteratorToArray; diff --git a/tools/eslint/node_modules/lodash/_lazyClone.js b/tools/eslint/node_modules/lodash/_lazyClone.js new file mode 100644 index 00000000000000..d8a51f870322e9 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_lazyClone.js @@ -0,0 +1,23 @@ +var LazyWrapper = require('./_LazyWrapper'), + copyArray = require('./_copyArray'); + +/** + * Creates a clone of the lazy wrapper object. + * + * @private + * @name clone + * @memberOf LazyWrapper + * @returns {Object} Returns the cloned `LazyWrapper` object. + */ +function lazyClone() { + var result = new LazyWrapper(this.__wrapped__); + result.__actions__ = copyArray(this.__actions__); + result.__dir__ = this.__dir__; + result.__filtered__ = this.__filtered__; + result.__iteratees__ = copyArray(this.__iteratees__); + result.__takeCount__ = this.__takeCount__; + result.__views__ = copyArray(this.__views__); + return result; +} + +module.exports = lazyClone; diff --git a/tools/eslint/node_modules/lodash/_lazyReverse.js b/tools/eslint/node_modules/lodash/_lazyReverse.js new file mode 100644 index 00000000000000..c5b52190f4dcc5 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_lazyReverse.js @@ -0,0 +1,23 @@ +var LazyWrapper = require('./_LazyWrapper'); + +/** + * Reverses the direction of lazy iteration. + * + * @private + * @name reverse + * @memberOf LazyWrapper + * @returns {Object} Returns the new reversed `LazyWrapper` object. + */ +function lazyReverse() { + if (this.__filtered__) { + var result = new LazyWrapper(this); + result.__dir__ = -1; + result.__filtered__ = true; + } else { + result = this.clone(); + result.__dir__ *= -1; + } + return result; +} + +module.exports = lazyReverse; diff --git a/tools/eslint/node_modules/lodash/_lazyValue.js b/tools/eslint/node_modules/lodash/_lazyValue.js new file mode 100644 index 00000000000000..09bf14b43a7737 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_lazyValue.js @@ -0,0 +1,73 @@ +var baseWrapperValue = require('./_baseWrapperValue'), + getView = require('./_getView'), + isArray = require('./isArray'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used to indicate the type of lazy iteratees. */ +var LAZY_FILTER_FLAG = 1, + LAZY_MAP_FLAG = 2; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * Extracts the unwrapped value from its lazy wrapper. + * + * @private + * @name value + * @memberOf LazyWrapper + * @returns {*} Returns the unwrapped value. + */ +function lazyValue() { + var array = this.__wrapped__.value(), + dir = this.__dir__, + isArr = isArray(array), + isRight = dir < 0, + arrLength = isArr ? array.length : 0, + view = getView(0, arrLength, this.__views__), + start = view.start, + end = view.end, + length = end - start, + index = isRight ? end : (start - 1), + iteratees = this.__iteratees__, + iterLength = iteratees.length, + resIndex = 0, + takeCount = nativeMin(length, this.__takeCount__); + + if (!isArr || arrLength < LARGE_ARRAY_SIZE || + (arrLength == length && takeCount == length)) { + return baseWrapperValue(array, this.__actions__); + } + var result = []; + + outer: + while (length-- && resIndex < takeCount) { + index += dir; + + var iterIndex = -1, + value = array[index]; + + while (++iterIndex < iterLength) { + var data = iteratees[iterIndex], + iteratee = data.iteratee, + type = data.type, + computed = iteratee(value); + + if (type == LAZY_MAP_FLAG) { + value = computed; + } else if (!computed) { + if (type == LAZY_FILTER_FLAG) { + continue outer; + } else { + break outer; + } + } + } + result[resIndex++] = value; + } + return result; +} + +module.exports = lazyValue; diff --git a/tools/eslint/node_modules/lodash/_mapClear.js b/tools/eslint/node_modules/lodash/_mapClear.js new file mode 100644 index 00000000000000..296f41794d6cfb --- /dev/null +++ b/tools/eslint/node_modules/lodash/_mapClear.js @@ -0,0 +1,19 @@ +var Hash = require('./_Hash'), + Map = require('./_Map'); + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapClear() { + this.__data__ = { + 'hash': new Hash, + 'map': Map ? new Map : [], + 'string': new Hash + }; +} + +module.exports = mapClear; diff --git a/tools/eslint/node_modules/lodash/_mapDelete.js b/tools/eslint/node_modules/lodash/_mapDelete.js new file mode 100644 index 00000000000000..640eb0a191deaa --- /dev/null +++ b/tools/eslint/node_modules/lodash/_mapDelete.js @@ -0,0 +1,23 @@ +var Map = require('./_Map'), + assocDelete = require('./_assocDelete'), + hashDelete = require('./_hashDelete'), + isKeyable = require('./_isKeyable'); + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapDelete(key) { + var data = this.__data__; + if (isKeyable(key)) { + return hashDelete(typeof key == 'string' ? data.string : data.hash, key); + } + return Map ? data.map['delete'](key) : assocDelete(data.map, key); +} + +module.exports = mapDelete; diff --git a/tools/eslint/node_modules/lodash/_mapGet.js b/tools/eslint/node_modules/lodash/_mapGet.js new file mode 100644 index 00000000000000..8f33854a581f44 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_mapGet.js @@ -0,0 +1,23 @@ +var Map = require('./_Map'), + assocGet = require('./_assocGet'), + hashGet = require('./_hashGet'), + isKeyable = require('./_isKeyable'); + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapGet(key) { + var data = this.__data__; + if (isKeyable(key)) { + return hashGet(typeof key == 'string' ? data.string : data.hash, key); + } + return Map ? data.map.get(key) : assocGet(data.map, key); +} + +module.exports = mapGet; diff --git a/tools/eslint/node_modules/lodash/_mapHas.js b/tools/eslint/node_modules/lodash/_mapHas.js new file mode 100644 index 00000000000000..9225537b980c65 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_mapHas.js @@ -0,0 +1,23 @@ +var Map = require('./_Map'), + assocHas = require('./_assocHas'), + hashHas = require('./_hashHas'), + isKeyable = require('./_isKeyable'); + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapHas(key) { + var data = this.__data__; + if (isKeyable(key)) { + return hashHas(typeof key == 'string' ? data.string : data.hash, key); + } + return Map ? data.map.has(key) : assocHas(data.map, key); +} + +module.exports = mapHas; diff --git a/tools/eslint/node_modules/lodash/_mapSet.js b/tools/eslint/node_modules/lodash/_mapSet.js new file mode 100644 index 00000000000000..23b075fc6e96e4 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_mapSet.js @@ -0,0 +1,28 @@ +var Map = require('./_Map'), + assocSet = require('./_assocSet'), + hashSet = require('./_hashSet'), + isKeyable = require('./_isKeyable'); + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapSet(key, value) { + var data = this.__data__; + if (isKeyable(key)) { + hashSet(typeof key == 'string' ? data.string : data.hash, key, value); + } else if (Map) { + data.map.set(key, value); + } else { + assocSet(data.map, key, value); + } + return this; +} + +module.exports = mapSet; diff --git a/tools/eslint/node_modules/lodash/_mapToArray.js b/tools/eslint/node_modules/lodash/_mapToArray.js new file mode 100644 index 00000000000000..e2e8a245a867ec --- /dev/null +++ b/tools/eslint/node_modules/lodash/_mapToArray.js @@ -0,0 +1,18 @@ +/** + * Converts `map` to an array. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the converted array. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +module.exports = mapToArray; diff --git a/tools/eslint/node_modules/lodash/_matchesStrictComparable.js b/tools/eslint/node_modules/lodash/_matchesStrictComparable.js new file mode 100644 index 00000000000000..70375e0e5dcfc3 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_matchesStrictComparable.js @@ -0,0 +1,20 @@ +/** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new function. + */ +function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; +} + +module.exports = matchesStrictComparable; diff --git a/tools/eslint/node_modules/lodash/_mergeData.js b/tools/eslint/node_modules/lodash/_mergeData.js new file mode 100644 index 00000000000000..55fd5ee031b720 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_mergeData.js @@ -0,0 +1,91 @@ +var composeArgs = require('./_composeArgs'), + composeArgsRight = require('./_composeArgsRight'), + copyArray = require('./_copyArray'), + replaceHolders = require('./_replaceHolders'); + +/** Used as the internal argument placeholder. */ +var PLACEHOLDER = '__lodash_placeholder__'; + +/** Used to compose bitmasks for wrapper metadata. */ +var BIND_FLAG = 1, + BIND_KEY_FLAG = 2, + CURRY_BOUND_FLAG = 4, + CURRY_FLAG = 8, + ARY_FLAG = 128, + REARG_FLAG = 256; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * Merges the function metadata of `source` into `data`. + * + * Merging metadata reduces the number of wrappers used to invoke a function. + * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` + * may be applied regardless of execution order. Methods like `_.ary` and + * `_.rearg` modify function arguments, making the order in which they are + * executed important, preventing the merging of metadata. However, we make + * an exception for a safe combined case where curried functions have `_.ary` + * and or `_.rearg` applied. + * + * @private + * @param {Array} data The destination metadata. + * @param {Array} source The source metadata. + * @returns {Array} Returns `data`. + */ +function mergeData(data, source) { + var bitmask = data[1], + srcBitmask = source[1], + newBitmask = bitmask | srcBitmask, + isCommon = newBitmask < (BIND_FLAG | BIND_KEY_FLAG | ARY_FLAG); + + var isCombo = + ((srcBitmask == ARY_FLAG) && (bitmask == CURRY_FLAG)) || + ((srcBitmask == ARY_FLAG) && (bitmask == REARG_FLAG) && (data[7].length <= source[8])) || + ((srcBitmask == (ARY_FLAG | REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == CURRY_FLAG)); + + // Exit early if metadata can't be merged. + if (!(isCommon || isCombo)) { + return data; + } + // Use source `thisArg` if available. + if (srcBitmask & BIND_FLAG) { + data[2] = source[2]; + // Set when currying a bound function. + newBitmask |= bitmask & BIND_FLAG ? 0 : CURRY_BOUND_FLAG; + } + // Compose partial arguments. + var value = source[3]; + if (value) { + var partials = data[3]; + data[3] = partials ? composeArgs(partials, value, source[4]) : copyArray(value); + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : copyArray(source[4]); + } + // Compose partial right arguments. + value = source[5]; + if (value) { + partials = data[5]; + data[5] = partials ? composeArgsRight(partials, value, source[6]) : copyArray(value); + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : copyArray(source[6]); + } + // Use source `argPos` if available. + value = source[7]; + if (value) { + data[7] = copyArray(value); + } + // Use source `ary` if it's smaller. + if (srcBitmask & ARY_FLAG) { + data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); + } + // Use source `arity` if one is not provided. + if (data[9] == null) { + data[9] = source[9]; + } + // Use source `func` and merge bitmasks. + data[0] = source[0]; + data[1] = newBitmask; + + return data; +} + +module.exports = mergeData; diff --git a/tools/eslint/node_modules/lodash/_mergeDefaults.js b/tools/eslint/node_modules/lodash/_mergeDefaults.js new file mode 100644 index 00000000000000..33375cc5bb42c6 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_mergeDefaults.js @@ -0,0 +1,24 @@ +var baseMerge = require('./_baseMerge'), + isObject = require('./isObject'); + +/** + * Used by `_.defaultsDeep` to customize its `_.merge` use. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to merge. + * @param {Object} object The parent object of `objValue`. + * @param {Object} source The parent object of `srcValue`. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + * @returns {*} Returns the value to assign. + */ +function mergeDefaults(objValue, srcValue, key, object, source, stack) { + if (isObject(objValue) && isObject(srcValue)) { + baseMerge(objValue, srcValue, undefined, mergeDefaults, stack.set(srcValue, objValue)); + } + return objValue; +} + +module.exports = mergeDefaults; diff --git a/tools/eslint/node_modules/lodash/_metaMap.js b/tools/eslint/node_modules/lodash/_metaMap.js new file mode 100644 index 00000000000000..0157a0b095650e --- /dev/null +++ b/tools/eslint/node_modules/lodash/_metaMap.js @@ -0,0 +1,6 @@ +var WeakMap = require('./_WeakMap'); + +/** Used to store function metadata. */ +var metaMap = WeakMap && new WeakMap; + +module.exports = metaMap; diff --git a/tools/eslint/node_modules/lodash/_nativeCreate.js b/tools/eslint/node_modules/lodash/_nativeCreate.js new file mode 100644 index 00000000000000..c7aede85b3fb77 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_nativeCreate.js @@ -0,0 +1,6 @@ +var getNative = require('./_getNative'); + +/* Built-in method references that are verified to be native. */ +var nativeCreate = getNative(Object, 'create'); + +module.exports = nativeCreate; diff --git a/tools/eslint/node_modules/lodash/_parent.js b/tools/eslint/node_modules/lodash/_parent.js new file mode 100644 index 00000000000000..81d94d0de08443 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_parent.js @@ -0,0 +1,16 @@ +var baseGet = require('./_baseGet'), + baseSlice = require('./_baseSlice'); + +/** + * Gets the parent value at `path` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. + */ +function parent(object, path) { + return path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); +} + +module.exports = parent; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/reEscape.js b/tools/eslint/node_modules/lodash/_reEscape.js similarity index 100% rename from tools/eslint/node_modules/inquirer/node_modules/lodash/internal/reEscape.js rename to tools/eslint/node_modules/lodash/_reEscape.js diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/reEvaluate.js b/tools/eslint/node_modules/lodash/_reEvaluate.js similarity index 100% rename from tools/eslint/node_modules/inquirer/node_modules/lodash/internal/reEvaluate.js rename to tools/eslint/node_modules/lodash/_reEvaluate.js diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/reInterpolate.js b/tools/eslint/node_modules/lodash/_reInterpolate.js similarity index 100% rename from tools/eslint/node_modules/inquirer/node_modules/lodash/internal/reInterpolate.js rename to tools/eslint/node_modules/lodash/_reInterpolate.js diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/realNames.js b/tools/eslint/node_modules/lodash/_realNames.js similarity index 100% rename from tools/eslint/node_modules/inquirer/node_modules/lodash/internal/realNames.js rename to tools/eslint/node_modules/lodash/_realNames.js diff --git a/tools/eslint/node_modules/lodash/_reorder.js b/tools/eslint/node_modules/lodash/_reorder.js new file mode 100644 index 00000000000000..a3502b05179144 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_reorder.js @@ -0,0 +1,29 @@ +var copyArray = require('./_copyArray'), + isIndex = require('./_isIndex'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; + +/** + * Reorder `array` according to the specified indexes where the element at + * the first index is assigned as the first element, the element at + * the second index is assigned as the second element, and so on. + * + * @private + * @param {Array} array The array to reorder. + * @param {Array} indexes The arranged array indexes. + * @returns {Array} Returns `array`. + */ +function reorder(array, indexes) { + var arrLength = array.length, + length = nativeMin(indexes.length, arrLength), + oldArray = copyArray(array); + + while (length--) { + var index = indexes[length]; + array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; + } + return array; +} + +module.exports = reorder; diff --git a/tools/eslint/node_modules/lodash/_replaceHolders.js b/tools/eslint/node_modules/lodash/_replaceHolders.js new file mode 100644 index 00000000000000..74360ec4d3bbf8 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_replaceHolders.js @@ -0,0 +1,29 @@ +/** Used as the internal argument placeholder. */ +var PLACEHOLDER = '__lodash_placeholder__'; + +/** + * Replaces all `placeholder` elements in `array` with an internal placeholder + * and returns an array of their indexes. + * + * @private + * @param {Array} array The array to modify. + * @param {*} placeholder The placeholder to replace. + * @returns {Array} Returns the new array of placeholder indexes. + */ +function replaceHolders(array, placeholder) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value === placeholder || value === PLACEHOLDER) { + array[index] = PLACEHOLDER; + result[resIndex++] = index; + } + } + return result; +} + +module.exports = replaceHolders; diff --git a/tools/eslint/node_modules/lodash/_root.js b/tools/eslint/node_modules/lodash/_root.js new file mode 100644 index 00000000000000..d2cfd311491c5d --- /dev/null +++ b/tools/eslint/node_modules/lodash/_root.js @@ -0,0 +1,41 @@ +var checkGlobal = require('./_checkGlobal'); + +/** Used to determine if values are of the language type `Object`. */ +var objectTypes = { + 'function': true, + 'object': true +}; + +/** Detect free variable `exports`. */ +var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) + ? exports + : undefined; + +/** Detect free variable `module`. */ +var freeModule = (objectTypes[typeof module] && module && !module.nodeType) + ? module + : undefined; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); + +/** Detect free variable `self`. */ +var freeSelf = checkGlobal(objectTypes[typeof self] && self); + +/** Detect free variable `window`. */ +var freeWindow = checkGlobal(objectTypes[typeof window] && window); + +/** Detect `this` as the global object. */ +var thisGlobal = checkGlobal(objectTypes[typeof this] && this); + +/** + * Used as a reference to the global object. + * + * The `this` value is used if it's the global object to avoid Greasemonkey's + * restricted `window` object, otherwise the `window` object is used. + */ +var root = freeGlobal || + ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || + freeSelf || thisGlobal || Function('return this')(); + +module.exports = root; diff --git a/tools/eslint/node_modules/lodash/_setData.js b/tools/eslint/node_modules/lodash/_setData.js new file mode 100644 index 00000000000000..d86c61086e5053 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_setData.js @@ -0,0 +1,42 @@ +var baseSetData = require('./_baseSetData'), + now = require('./now'); + +/** Used to detect hot functions by number of calls within a span of milliseconds. */ +var HOT_COUNT = 150, + HOT_SPAN = 16; + +/** + * Sets metadata for `func`. + * + * **Note:** If this function becomes hot, i.e. is invoked a lot in a short + * period of time, it will trip its breaker and transition to an identity + * function to avoid garbage collection pauses in V8. See + * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) + * for more details. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ +var setData = (function() { + var count = 0, + lastCalled = 0; + + return function(key, value) { + var stamp = now(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return key; + } + } else { + count = 0; + } + return baseSetData(key, value); + }; +}()); + +module.exports = setData; diff --git a/tools/eslint/node_modules/lodash/_setToArray.js b/tools/eslint/node_modules/lodash/_setToArray.js new file mode 100644 index 00000000000000..6b24f304dec8a2 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_setToArray.js @@ -0,0 +1,18 @@ +/** + * Converts `set` to an array. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the converted array. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +module.exports = setToArray; diff --git a/tools/eslint/node_modules/lodash/_stackClear.js b/tools/eslint/node_modules/lodash/_stackClear.js new file mode 100644 index 00000000000000..8255536f27f93b --- /dev/null +++ b/tools/eslint/node_modules/lodash/_stackClear.js @@ -0,0 +1,12 @@ +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = { 'array': [], 'map': null }; +} + +module.exports = stackClear; diff --git a/tools/eslint/node_modules/lodash/_stackDelete.js b/tools/eslint/node_modules/lodash/_stackDelete.js new file mode 100644 index 00000000000000..7e38a137770db1 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_stackDelete.js @@ -0,0 +1,19 @@ +var assocDelete = require('./_assocDelete'); + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + var data = this.__data__, + array = data.array; + + return array ? assocDelete(array, key) : data.map['delete'](key); +} + +module.exports = stackDelete; diff --git a/tools/eslint/node_modules/lodash/_stackGet.js b/tools/eslint/node_modules/lodash/_stackGet.js new file mode 100644 index 00000000000000..20b9d9afa26ff0 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_stackGet.js @@ -0,0 +1,19 @@ +var assocGet = require('./_assocGet'); + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + var data = this.__data__, + array = data.array; + + return array ? assocGet(array, key) : data.map.get(key); +} + +module.exports = stackGet; diff --git a/tools/eslint/node_modules/lodash/_stackHas.js b/tools/eslint/node_modules/lodash/_stackHas.js new file mode 100644 index 00000000000000..7a3b0b94875dda --- /dev/null +++ b/tools/eslint/node_modules/lodash/_stackHas.js @@ -0,0 +1,19 @@ +var assocHas = require('./_assocHas'); + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + var data = this.__data__, + array = data.array; + + return array ? assocHas(array, key) : data.map.has(key); +} + +module.exports = stackHas; diff --git a/tools/eslint/node_modules/lodash/_stackSet.js b/tools/eslint/node_modules/lodash/_stackSet.js new file mode 100644 index 00000000000000..76ca89a8df2b84 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_stackSet.js @@ -0,0 +1,36 @@ +var MapCache = require('./_MapCache'), + assocSet = require('./_assocSet'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var data = this.__data__, + array = data.array; + + if (array) { + if (array.length < (LARGE_ARRAY_SIZE - 1)) { + assocSet(array, key, value); + } else { + data.array = null; + data.map = new MapCache(array); + } + } + var map = data.map; + if (map) { + map.set(key, value); + } + return this; +} + +module.exports = stackSet; diff --git a/tools/eslint/node_modules/lodash/_stringSize.js b/tools/eslint/node_modules/lodash/_stringSize.js new file mode 100644 index 00000000000000..7aa9f4125ad362 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_stringSize.js @@ -0,0 +1,48 @@ +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsComboSymbolsRange = '\\u20d0-\\u20f0', + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange + ']', + rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ +var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); + +/** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ +function stringSize(string) { + if (!(string && reHasComplexSymbol.test(string))) { + return string.length; + } + var result = reComplexSymbol.lastIndex = 0; + while (reComplexSymbol.test(string)) { + result++; + } + return result; +} + +module.exports = stringSize; diff --git a/tools/eslint/node_modules/lodash/_stringToArray.js b/tools/eslint/node_modules/lodash/_stringToArray.js new file mode 100644 index 00000000000000..90986f09bb0121 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_stringToArray.js @@ -0,0 +1,38 @@ +/** Used to compose unicode character classes. */ +var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsComboSymbolsRange = '\\u20d0-\\u20f0', + rsVarRange = '\\ufe0e\\ufe0f'; + +/** Used to compose unicode capture groups. */ +var rsAstral = '[' + rsAstralRange + ']', + rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsZWJ = '\\u200d'; + +/** Used to compose unicode regexes. */ +var reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + +/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ +var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + +/** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ +function stringToArray(string) { + return string.match(reComplexSymbol); +} + +module.exports = stringToArray; diff --git a/tools/eslint/node_modules/lodash/_stringToPath.js b/tools/eslint/node_modules/lodash/_stringToPath.js new file mode 100644 index 00000000000000..b6a1fc28aceea4 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_stringToPath.js @@ -0,0 +1,25 @@ +var memoize = require('./memoize'), + toString = require('./toString'); + +/** Used to match property names within property paths. */ +var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ +var stringToPath = memoize(function(string) { + var result = []; + toString(string).replace(rePropName, function(match, number, quote, string) { + result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +}); + +module.exports = stringToPath; diff --git a/tools/eslint/node_modules/lodash/_toSource.js b/tools/eslint/node_modules/lodash/_toSource.js new file mode 100644 index 00000000000000..43f3ff8bf9f583 --- /dev/null +++ b/tools/eslint/node_modules/lodash/_toSource.js @@ -0,0 +1,23 @@ +/** Used to resolve the decompiled source of functions. */ +var funcToString = Function.prototype.toString; + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} + +module.exports = toSource; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/internal/unescapeHtmlChar.js b/tools/eslint/node_modules/lodash/_unescapeHtmlChar.js similarity index 100% rename from tools/eslint/node_modules/inquirer/node_modules/lodash/internal/unescapeHtmlChar.js rename to tools/eslint/node_modules/lodash/_unescapeHtmlChar.js diff --git a/tools/eslint/node_modules/lodash/_wrapperClone.js b/tools/eslint/node_modules/lodash/_wrapperClone.js new file mode 100644 index 00000000000000..7bb58a2e88bfce --- /dev/null +++ b/tools/eslint/node_modules/lodash/_wrapperClone.js @@ -0,0 +1,23 @@ +var LazyWrapper = require('./_LazyWrapper'), + LodashWrapper = require('./_LodashWrapper'), + copyArray = require('./_copyArray'); + +/** + * Creates a clone of `wrapper`. + * + * @private + * @param {Object} wrapper The wrapper to clone. + * @returns {Object} Returns the cloned wrapper. + */ +function wrapperClone(wrapper) { + if (wrapper instanceof LazyWrapper) { + return wrapper.clone(); + } + var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); + result.__actions__ = copyArray(wrapper.__actions__); + result.__index__ = wrapper.__index__; + result.__values__ = wrapper.__values__; + return result; +} + +module.exports = wrapperClone; diff --git a/tools/eslint/node_modules/lodash/add.js b/tools/eslint/node_modules/lodash/add.js new file mode 100644 index 00000000000000..d82c6522ae3e15 --- /dev/null +++ b/tools/eslint/node_modules/lodash/add.js @@ -0,0 +1,22 @@ +var createMathOperation = require('./_createMathOperation'); + +/** + * Adds two numbers. + * + * @static + * @memberOf _ + * @since 3.4.0 + * @category Math + * @param {number} augend The first number in an addition. + * @param {number} addend The second number in an addition. + * @returns {number} Returns the total. + * @example + * + * _.add(6, 4); + * // => 10 + */ +var add = createMathOperation(function(augend, addend) { + return augend + addend; +}); + +module.exports = add; diff --git a/tools/eslint/node_modules/lodash/after.js b/tools/eslint/node_modules/lodash/after.js new file mode 100644 index 00000000000000..910923a9a61317 --- /dev/null +++ b/tools/eslint/node_modules/lodash/after.js @@ -0,0 +1,42 @@ +var toInteger = require('./toInteger'); + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * The opposite of `_.before`; this method creates a function that invokes + * `func` once it's called `n` or more times. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {number} n The number of calls before `func` is invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => Logs 'done saving!' after the two async saves have completed. + */ +function after(n, func) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; +} + +module.exports = after; diff --git a/tools/eslint/node_modules/lodash/array.js b/tools/eslint/node_modules/lodash/array.js new file mode 100644 index 00000000000000..bfded5ccee4e16 --- /dev/null +++ b/tools/eslint/node_modules/lodash/array.js @@ -0,0 +1,65 @@ +module.exports = { + 'chunk': require('./chunk'), + 'compact': require('./compact'), + 'concat': require('./concat'), + 'difference': require('./difference'), + 'differenceBy': require('./differenceBy'), + 'differenceWith': require('./differenceWith'), + 'drop': require('./drop'), + 'dropRight': require('./dropRight'), + 'dropRightWhile': require('./dropRightWhile'), + 'dropWhile': require('./dropWhile'), + 'fill': require('./fill'), + 'findIndex': require('./findIndex'), + 'findLastIndex': require('./findLastIndex'), + 'flatten': require('./flatten'), + 'flattenDeep': require('./flattenDeep'), + 'flattenDepth': require('./flattenDepth'), + 'fromPairs': require('./fromPairs'), + 'head': require('./head'), + 'indexOf': require('./indexOf'), + 'initial': require('./initial'), + 'intersection': require('./intersection'), + 'intersectionBy': require('./intersectionBy'), + 'intersectionWith': require('./intersectionWith'), + 'join': require('./join'), + 'last': require('./last'), + 'lastIndexOf': require('./lastIndexOf'), + 'pull': require('./pull'), + 'pullAll': require('./pullAll'), + 'pullAllBy': require('./pullAllBy'), + 'pullAllWith': require('./pullAllWith'), + 'pullAt': require('./pullAt'), + 'remove': require('./remove'), + 'reverse': require('./reverse'), + 'slice': require('./slice'), + 'sortedIndex': require('./sortedIndex'), + 'sortedIndexBy': require('./sortedIndexBy'), + 'sortedIndexOf': require('./sortedIndexOf'), + 'sortedLastIndex': require('./sortedLastIndex'), + 'sortedLastIndexBy': require('./sortedLastIndexBy'), + 'sortedLastIndexOf': require('./sortedLastIndexOf'), + 'sortedUniq': require('./sortedUniq'), + 'sortedUniqBy': require('./sortedUniqBy'), + 'tail': require('./tail'), + 'take': require('./take'), + 'takeRight': require('./takeRight'), + 'takeRightWhile': require('./takeRightWhile'), + 'takeWhile': require('./takeWhile'), + 'union': require('./union'), + 'unionBy': require('./unionBy'), + 'unionWith': require('./unionWith'), + 'uniq': require('./uniq'), + 'uniqBy': require('./uniqBy'), + 'uniqWith': require('./uniqWith'), + 'unzip': require('./unzip'), + 'unzipWith': require('./unzipWith'), + 'without': require('./without'), + 'xor': require('./xor'), + 'xorBy': require('./xorBy'), + 'xorWith': require('./xorWith'), + 'zip': require('./zip'), + 'zipObject': require('./zipObject'), + 'zipObjectDeep': require('./zipObjectDeep'), + 'zipWith': require('./zipWith') +}; diff --git a/tools/eslint/node_modules/lodash/ary.js b/tools/eslint/node_modules/lodash/ary.js new file mode 100644 index 00000000000000..e901f1b9db0db5 --- /dev/null +++ b/tools/eslint/node_modules/lodash/ary.js @@ -0,0 +1,29 @@ +var createWrapper = require('./_createWrapper'); + +/** Used to compose bitmasks for wrapper metadata. */ +var ARY_FLAG = 128; + +/** + * Creates a function that invokes `func`, with up to `n` arguments, + * ignoring any additional arguments. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @param {number} [n=func.length] The arity cap. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new function. + * @example + * + * _.map(['6', '8', '10'], _.ary(parseInt, 1)); + * // => [6, 8, 10] + */ +function ary(func, n, guard) { + n = guard ? undefined : n; + n = (func && n == null) ? func.length : n; + return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n); +} + +module.exports = ary; diff --git a/tools/eslint/node_modules/lodash/assign.js b/tools/eslint/node_modules/lodash/assign.js new file mode 100644 index 00000000000000..281e8acf1453b9 --- /dev/null +++ b/tools/eslint/node_modules/lodash/assign.js @@ -0,0 +1,63 @@ +var assignValue = require('./_assignValue'), + copyObject = require('./_copyObject'), + createAssigner = require('./_createAssigner'), + isArrayLike = require('./isArrayLike'), + isPrototype = require('./_isPrototype'), + keys = require('./keys'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */ +var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf'); + +/** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.c = 3; + * } + * + * function Bar() { + * this.e = 5; + * } + * + * Foo.prototype.d = 4; + * Bar.prototype.f = 6; + * + * _.assign({ 'a': 1 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3, 'e': 5 } + */ +var assign = createAssigner(function(object, source) { + if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } +}); + +module.exports = assign; diff --git a/tools/eslint/node_modules/lodash/assignIn.js b/tools/eslint/node_modules/lodash/assignIn.js new file mode 100644 index 00000000000000..f48e92558f756f --- /dev/null +++ b/tools/eslint/node_modules/lodash/assignIn.js @@ -0,0 +1,57 @@ +var assignValue = require('./_assignValue'), + copyObject = require('./_copyObject'), + createAssigner = require('./_createAssigner'), + isArrayLike = require('./isArrayLike'), + isPrototype = require('./_isPrototype'), + keysIn = require('./keysIn'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */ +var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf'); + +/** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * function Bar() { + * this.d = 4; + * } + * + * Foo.prototype.c = 3; + * Bar.prototype.e = 5; + * + * _.assignIn({ 'a': 1 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } + */ +var assignIn = createAssigner(function(object, source) { + if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) { + copyObject(source, keysIn(source), object); + return; + } + for (var key in source) { + assignValue(object, key, source[key]); + } +}); + +module.exports = assignIn; diff --git a/tools/eslint/node_modules/lodash/assignInWith.js b/tools/eslint/node_modules/lodash/assignInWith.js new file mode 100644 index 00000000000000..9a24e4f0a8d6f0 --- /dev/null +++ b/tools/eslint/node_modules/lodash/assignInWith.js @@ -0,0 +1,37 @@ +var copyObjectWith = require('./_copyObjectWith'), + createAssigner = require('./_createAssigner'), + keysIn = require('./keysIn'); + +/** + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extendWith + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ +var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObjectWith(source, keysIn(source), object, customizer); +}); + +module.exports = assignInWith; diff --git a/tools/eslint/node_modules/lodash/assignWith.js b/tools/eslint/node_modules/lodash/assignWith.js new file mode 100644 index 00000000000000..1f573fbc4b24da --- /dev/null +++ b/tools/eslint/node_modules/lodash/assignWith.js @@ -0,0 +1,36 @@ +var copyObjectWith = require('./_copyObjectWith'), + createAssigner = require('./_createAssigner'), + keys = require('./keys'); + +/** + * This method is like `_.assign` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ +var assignWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObjectWith(source, keys(source), object, customizer); +}); + +module.exports = assignWith; diff --git a/tools/eslint/node_modules/lodash/at.js b/tools/eslint/node_modules/lodash/at.js new file mode 100644 index 00000000000000..82ba3433db415f --- /dev/null +++ b/tools/eslint/node_modules/lodash/at.js @@ -0,0 +1,30 @@ +var baseAt = require('./_baseAt'), + baseFlatten = require('./_baseFlatten'), + rest = require('./rest'); + +/** + * Creates an array of values corresponding to `paths` of `object`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {...(string|string[])} [paths] The property paths of elements to pick, + * specified individually or in arrays. + * @returns {Array} Returns the new array of picked elements. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _.at(object, ['a[0].b.c', 'a[1]']); + * // => [3, 4] + * + * _.at(['a', 'b', 'c'], 0, 2); + * // => ['a', 'c'] + */ +var at = rest(function(object, paths) { + return baseAt(object, baseFlatten(paths, 1)); +}); + +module.exports = at; diff --git a/tools/eslint/node_modules/lodash/attempt.js b/tools/eslint/node_modules/lodash/attempt.js new file mode 100644 index 00000000000000..e65b2e6f5ff105 --- /dev/null +++ b/tools/eslint/node_modules/lodash/attempt.js @@ -0,0 +1,35 @@ +var apply = require('./_apply'), + isError = require('./isError'), + rest = require('./rest'); + +/** + * Attempts to invoke `func`, returning either the result or the caught error + * object. Any additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Util + * @param {Function} func The function to attempt. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {*} Returns the `func` result or error object. + * @example + * + * // Avoid throwing errors for invalid selectors. + * var elements = _.attempt(function(selector) { + * return document.querySelectorAll(selector); + * }, '>_>'); + * + * if (_.isError(elements)) { + * elements = []; + * } + */ +var attempt = rest(function(func, args) { + try { + return apply(func, undefined, args); + } catch (e) { + return isError(e) ? e : new Error(e); + } +}); + +module.exports = attempt; diff --git a/tools/eslint/node_modules/lodash/before.js b/tools/eslint/node_modules/lodash/before.js new file mode 100644 index 00000000000000..a495adcbdc2cdd --- /dev/null +++ b/tools/eslint/node_modules/lodash/before.js @@ -0,0 +1,40 @@ +var toInteger = require('./toInteger'); + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => allows adding up to 4 contacts to the list + */ +function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; +} + +module.exports = before; diff --git a/tools/eslint/node_modules/lodash/bind.js b/tools/eslint/node_modules/lodash/bind.js new file mode 100644 index 00000000000000..a41b94619ca6fb --- /dev/null +++ b/tools/eslint/node_modules/lodash/bind.js @@ -0,0 +1,57 @@ +var createWrapper = require('./_createWrapper'), + getPlaceholder = require('./_getPlaceholder'), + replaceHolders = require('./_replaceHolders'), + rest = require('./rest'); + +/** Used to compose bitmasks for wrapper metadata. */ +var BIND_FLAG = 1, + PARTIAL_FLAG = 32; + +/** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind` this method doesn't set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var greet = function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * }; + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */ +var bind = rest(function(func, thisArg, partials) { + var bitmask = BIND_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getPlaceholder(bind)); + bitmask |= PARTIAL_FLAG; + } + return createWrapper(func, bitmask, thisArg, partials, holders); +}); + +// Assign default placeholders. +bind.placeholder = {}; + +module.exports = bind; diff --git a/tools/eslint/node_modules/lodash/bindAll.js b/tools/eslint/node_modules/lodash/bindAll.js new file mode 100644 index 00000000000000..0d158803ee1260 --- /dev/null +++ b/tools/eslint/node_modules/lodash/bindAll.js @@ -0,0 +1,40 @@ +var arrayEach = require('./_arrayEach'), + baseFlatten = require('./_baseFlatten'), + bind = require('./bind'), + rest = require('./rest'); + +/** + * Binds methods of an object to the object itself, overwriting the existing + * method. + * + * **Note:** This method doesn't set the "length" property of bound functions. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {Object} object The object to bind and assign the bound methods to. + * @param {...(string|string[])} methodNames The object method names to bind, + * specified individually or in arrays. + * @returns {Object} Returns `object`. + * @example + * + * var view = { + * 'label': 'docs', + * 'onClick': function() { + * console.log('clicked ' + this.label); + * } + * }; + * + * _.bindAll(view, 'onClick'); + * jQuery(element).on('click', view.onClick); + * // => Logs 'clicked docs' when clicked. + */ +var bindAll = rest(function(object, methodNames) { + arrayEach(baseFlatten(methodNames, 1), function(key) { + object[key] = bind(object[key], object); + }); + return object; +}); + +module.exports = bindAll; diff --git a/tools/eslint/node_modules/lodash/bindKey.js b/tools/eslint/node_modules/lodash/bindKey.js new file mode 100644 index 00000000000000..364dd698122c9b --- /dev/null +++ b/tools/eslint/node_modules/lodash/bindKey.js @@ -0,0 +1,68 @@ +var createWrapper = require('./_createWrapper'), + getPlaceholder = require('./_getPlaceholder'), + replaceHolders = require('./_replaceHolders'), + rest = require('./rest'); + +/** Used to compose bitmasks for wrapper metadata. */ +var BIND_FLAG = 1, + BIND_KEY_FLAG = 2, + PARTIAL_FLAG = 32; + +/** + * Creates a function that invokes the method at `object[key]` with `partials` + * prepended to the arguments it receives. + * + * This method differs from `_.bind` by allowing bound functions to reference + * methods that may be redefined or don't yet exist. See + * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) + * for more details. + * + * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Function + * @param {Object} object The object to invoke the method on. + * @param {string} key The key of the method. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'user': 'fred', + * 'greet': function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * }; + * + * var bound = _.bindKey(object, 'greet', 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * object.greet = function(greeting, punctuation) { + * return greeting + 'ya ' + this.user + punctuation; + * }; + * + * bound('!'); + * // => 'hiya fred!' + * + * // Bound with placeholders. + * var bound = _.bindKey(object, 'greet', _, '!'); + * bound('hi'); + * // => 'hiya fred!' + */ +var bindKey = rest(function(object, key, partials) { + var bitmask = BIND_FLAG | BIND_KEY_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getPlaceholder(bindKey)); + bitmask |= PARTIAL_FLAG; + } + return createWrapper(key, bitmask, object, partials, holders); +}); + +// Assign default placeholders. +bindKey.placeholder = {}; + +module.exports = bindKey; diff --git a/tools/eslint/node_modules/lodash/camelCase.js b/tools/eslint/node_modules/lodash/camelCase.js new file mode 100644 index 00000000000000..d7390def558f67 --- /dev/null +++ b/tools/eslint/node_modules/lodash/camelCase.js @@ -0,0 +1,29 @@ +var capitalize = require('./capitalize'), + createCompounder = require('./_createCompounder'); + +/** + * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the camel cased string. + * @example + * + * _.camelCase('Foo Bar'); + * // => 'fooBar' + * + * _.camelCase('--foo-bar--'); + * // => 'fooBar' + * + * _.camelCase('__FOO_BAR__'); + * // => 'fooBar' + */ +var camelCase = createCompounder(function(result, word, index) { + word = word.toLowerCase(); + return result + (index ? capitalize(word) : word); +}); + +module.exports = camelCase; diff --git a/tools/eslint/node_modules/lodash/capitalize.js b/tools/eslint/node_modules/lodash/capitalize.js new file mode 100644 index 00000000000000..3e1600e7d9e919 --- /dev/null +++ b/tools/eslint/node_modules/lodash/capitalize.js @@ -0,0 +1,23 @@ +var toString = require('./toString'), + upperFirst = require('./upperFirst'); + +/** + * Converts the first character of `string` to upper case and the remaining + * to lower case. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to capitalize. + * @returns {string} Returns the capitalized string. + * @example + * + * _.capitalize('FRED'); + * // => 'Fred' + */ +function capitalize(string) { + return upperFirst(toString(string).toLowerCase()); +} + +module.exports = capitalize; diff --git a/tools/eslint/node_modules/lodash/castArray.js b/tools/eslint/node_modules/lodash/castArray.js new file mode 100644 index 00000000000000..e470bdb9b9156a --- /dev/null +++ b/tools/eslint/node_modules/lodash/castArray.js @@ -0,0 +1,44 @@ +var isArray = require('./isArray'); + +/** + * Casts `value` as an array if it's not one. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Lang + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast array. + * @example + * + * _.castArray(1); + * // => [1] + * + * _.castArray({ 'a': 1 }); + * // => [{ 'a': 1 }] + * + * _.castArray('abc'); + * // => ['abc'] + * + * _.castArray(null); + * // => [null] + * + * _.castArray(undefined); + * // => [undefined] + * + * _.castArray(); + * // => [] + * + * var array = [1, 2, 3]; + * console.log(_.castArray(array) === array); + * // => true + */ +function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray(value) ? value : [value]; +} + +module.exports = castArray; diff --git a/tools/eslint/node_modules/lodash/ceil.js b/tools/eslint/node_modules/lodash/ceil.js new file mode 100644 index 00000000000000..56c8722cfc7cec --- /dev/null +++ b/tools/eslint/node_modules/lodash/ceil.js @@ -0,0 +1,26 @@ +var createRound = require('./_createRound'); + +/** + * Computes `number` rounded up to `precision`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Math + * @param {number} number The number to round up. + * @param {number} [precision=0] The precision to round up to. + * @returns {number} Returns the rounded up number. + * @example + * + * _.ceil(4.006); + * // => 5 + * + * _.ceil(6.004, 2); + * // => 6.01 + * + * _.ceil(6040, -2); + * // => 6100 + */ +var ceil = createRound('ceil'); + +module.exports = ceil; diff --git a/tools/eslint/node_modules/lodash/chain.js b/tools/eslint/node_modules/lodash/chain.js new file mode 100644 index 00000000000000..f6cd6475ffdf17 --- /dev/null +++ b/tools/eslint/node_modules/lodash/chain.js @@ -0,0 +1,38 @@ +var lodash = require('./wrapperLodash'); + +/** + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' + */ +function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; +} + +module.exports = chain; diff --git a/tools/eslint/node_modules/lodash/chunk.js b/tools/eslint/node_modules/lodash/chunk.js new file mode 100644 index 00000000000000..f2094743700775 --- /dev/null +++ b/tools/eslint/node_modules/lodash/chunk.js @@ -0,0 +1,50 @@ +var baseSlice = require('./_baseSlice'), + isIterateeCall = require('./_isIterateeCall'), + toInteger = require('./toInteger'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeCeil = Math.ceil, + nativeMax = Math.max; + +/** + * Creates an array of elements split into groups the length of `size`. + * If `array` can't be split evenly, the final chunk will be the remaining + * elements. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to process. + * @param {number} [size=1] The length of each chunk + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the new array containing chunks. + * @example + * + * _.chunk(['a', 'b', 'c', 'd'], 2); + * // => [['a', 'b'], ['c', 'd']] + * + * _.chunk(['a', 'b', 'c', 'd'], 3); + * // => [['a', 'b', 'c'], ['d']] + */ +function chunk(array, size, guard) { + if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { + size = 1; + } else { + size = nativeMax(toInteger(size), 0); + } + var length = array ? array.length : 0; + if (!length || size < 1) { + return []; + } + var index = 0, + resIndex = 0, + result = Array(nativeCeil(length / size)); + + while (index < length) { + result[resIndex++] = baseSlice(array, index, (index += size)); + } + return result; +} + +module.exports = chunk; diff --git a/tools/eslint/node_modules/lodash/clamp.js b/tools/eslint/node_modules/lodash/clamp.js new file mode 100644 index 00000000000000..91a72c9782dc92 --- /dev/null +++ b/tools/eslint/node_modules/lodash/clamp.js @@ -0,0 +1,39 @@ +var baseClamp = require('./_baseClamp'), + toNumber = require('./toNumber'); + +/** + * Clamps `number` within the inclusive `lower` and `upper` bounds. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Number + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + * @example + * + * _.clamp(-10, -5, 5); + * // => -5 + * + * _.clamp(10, -5, 5); + * // => 5 + */ +function clamp(number, lower, upper) { + if (upper === undefined) { + upper = lower; + lower = undefined; + } + if (upper !== undefined) { + upper = toNumber(upper); + upper = upper === upper ? upper : 0; + } + if (lower !== undefined) { + lower = toNumber(lower); + lower = lower === lower ? lower : 0; + } + return baseClamp(toNumber(number), lower, upper); +} + +module.exports = clamp; diff --git a/tools/eslint/node_modules/lodash/clone.js b/tools/eslint/node_modules/lodash/clone.js new file mode 100644 index 00000000000000..d33799250abdd1 --- /dev/null +++ b/tools/eslint/node_modules/lodash/clone.js @@ -0,0 +1,32 @@ +var baseClone = require('./_baseClone'); + +/** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ +function clone(value) { + return baseClone(value, false, true); +} + +module.exports = clone; diff --git a/tools/eslint/node_modules/lodash/cloneDeep.js b/tools/eslint/node_modules/lodash/cloneDeep.js new file mode 100644 index 00000000000000..037002eef5f7d3 --- /dev/null +++ b/tools/eslint/node_modules/lodash/cloneDeep.js @@ -0,0 +1,24 @@ +var baseClone = require('./_baseClone'); + +/** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ +function cloneDeep(value) { + return baseClone(value, true, true); +} + +module.exports = cloneDeep; diff --git a/tools/eslint/node_modules/lodash/cloneDeepWith.js b/tools/eslint/node_modules/lodash/cloneDeepWith.js new file mode 100644 index 00000000000000..581ab9fa83b96f --- /dev/null +++ b/tools/eslint/node_modules/lodash/cloneDeepWith.js @@ -0,0 +1,34 @@ +var baseClone = require('./_baseClone'); + +/** + * This method is like `_.cloneWith` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the deep cloned value. + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(true); + * } + * } + * + * var el = _.cloneDeepWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 20 + */ +function cloneDeepWith(value, customizer) { + return baseClone(value, true, true, customizer); +} + +module.exports = cloneDeepWith; diff --git a/tools/eslint/node_modules/lodash/cloneWith.js b/tools/eslint/node_modules/lodash/cloneWith.js new file mode 100644 index 00000000000000..df731c7af62661 --- /dev/null +++ b/tools/eslint/node_modules/lodash/cloneWith.js @@ -0,0 +1,37 @@ +var baseClone = require('./_baseClone'); + +/** + * This method is like `_.clone` except that it accepts `customizer` which + * is invoked to produce the cloned value. If `customizer` returns `undefined`, + * cloning is handled by the method instead. The `customizer` is invoked with + * up to four arguments; (value [, index|key, object, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the cloned value. + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(false); + * } + * } + * + * var el = _.cloneWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 0 + */ +function cloneWith(value, customizer) { + return baseClone(value, false, true, customizer); +} + +module.exports = cloneWith; diff --git a/tools/eslint/node_modules/lodash/collection.js b/tools/eslint/node_modules/lodash/collection.js new file mode 100644 index 00000000000000..22b0c8bce7a097 --- /dev/null +++ b/tools/eslint/node_modules/lodash/collection.js @@ -0,0 +1,31 @@ +module.exports = { + 'at': require('./at'), + 'countBy': require('./countBy'), + 'each': require('./each'), + 'eachRight': require('./eachRight'), + 'every': require('./every'), + 'filter': require('./filter'), + 'find': require('./find'), + 'findLast': require('./findLast'), + 'flatMap': require('./flatMap'), + 'flatMapDeep': require('./flatMapDeep'), + 'flatMapDepth': require('./flatMapDepth'), + 'forEach': require('./forEach'), + 'forEachRight': require('./forEachRight'), + 'groupBy': require('./groupBy'), + 'includes': require('./includes'), + 'invokeMap': require('./invokeMap'), + 'keyBy': require('./keyBy'), + 'map': require('./map'), + 'orderBy': require('./orderBy'), + 'partition': require('./partition'), + 'reduce': require('./reduce'), + 'reduceRight': require('./reduceRight'), + 'reject': require('./reject'), + 'sample': require('./sample'), + 'sampleSize': require('./sampleSize'), + 'shuffle': require('./shuffle'), + 'size': require('./size'), + 'some': require('./some'), + 'sortBy': require('./sortBy') +}; diff --git a/tools/eslint/node_modules/lodash/commit.js b/tools/eslint/node_modules/lodash/commit.js new file mode 100644 index 00000000000000..fe4db71783bd99 --- /dev/null +++ b/tools/eslint/node_modules/lodash/commit.js @@ -0,0 +1,33 @@ +var LodashWrapper = require('./_LodashWrapper'); + +/** + * Executes the chain sequence and returns the wrapped result. + * + * @name commit + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2]; + * var wrapped = _(array).push(3); + * + * console.log(array); + * // => [1, 2] + * + * wrapped = wrapped.commit(); + * console.log(array); + * // => [1, 2, 3] + * + * wrapped.last(); + * // => 3 + * + * console.log(array); + * // => [1, 2, 3] + */ +function wrapperCommit() { + return new LodashWrapper(this.value(), this.__chain__); +} + +module.exports = wrapperCommit; diff --git a/tools/eslint/node_modules/lodash/compact.js b/tools/eslint/node_modules/lodash/compact.js new file mode 100644 index 00000000000000..790f31199ba101 --- /dev/null +++ b/tools/eslint/node_modules/lodash/compact.js @@ -0,0 +1,31 @@ +/** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ +function compact(array) { + var index = -1, + length = array ? array.length : 0, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result[resIndex++] = value; + } + } + return result; +} + +module.exports = compact; diff --git a/tools/eslint/node_modules/lodash/concat.js b/tools/eslint/node_modules/lodash/concat.js new file mode 100644 index 00000000000000..de9270b4828954 --- /dev/null +++ b/tools/eslint/node_modules/lodash/concat.js @@ -0,0 +1,42 @@ +var arrayConcat = require('./_arrayConcat'), + baseFlatten = require('./_baseFlatten'), + castArray = require('./castArray'), + copyArray = require('./_copyArray'); + +/** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ +function concat() { + var length = arguments.length, + array = castArray(arguments[0]); + + if (length < 2) { + return length ? copyArray(array) : []; + } + var args = Array(length - 1); + while (length--) { + args[length - 1] = arguments[length]; + } + return arrayConcat(array, baseFlatten(args, 1)); +} + +module.exports = concat; diff --git a/tools/eslint/node_modules/lodash/cond.js b/tools/eslint/node_modules/lodash/cond.js new file mode 100644 index 00000000000000..d851d07414b873 --- /dev/null +++ b/tools/eslint/node_modules/lodash/cond.js @@ -0,0 +1,60 @@ +var apply = require('./_apply'), + arrayMap = require('./_arrayMap'), + baseIteratee = require('./_baseIteratee'), + rest = require('./rest'); + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/** + * Creates a function that iterates over `pairs` invoking the corresponding + * function of the first predicate to return truthy. The predicate-function + * pairs are invoked with the `this` binding and arguments of the created + * function. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Util + * @param {Array} pairs The predicate-function pairs. + * @returns {Function} Returns the new function. + * @example + * + * var func = _.cond([ + * [_.matches({ 'a': 1 }), _.constant('matches A')], + * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], + * [_.constant(true), _.constant('no match')] + * ]); + * + * func({ 'a': 1, 'b': 2 }); + * // => 'matches A' + * + * func({ 'a': 0, 'b': 1 }); + * // => 'matches B' + * + * func({ 'a': '1', 'b': '2' }); + * // => 'no match' + */ +function cond(pairs) { + var length = pairs ? pairs.length : 0, + toIteratee = baseIteratee; + + pairs = !length ? [] : arrayMap(pairs, function(pair) { + if (typeof pair[1] != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return [toIteratee(pair[0]), pair[1]]; + }); + + return rest(function(args) { + var index = -1; + while (++index < length) { + var pair = pairs[index]; + if (apply(pair[0], this, args)) { + return apply(pair[1], this, args); + } + } + }); +} + +module.exports = cond; diff --git a/tools/eslint/node_modules/lodash/conforms.js b/tools/eslint/node_modules/lodash/conforms.js new file mode 100644 index 00000000000000..6ec590f30b7d20 --- /dev/null +++ b/tools/eslint/node_modules/lodash/conforms.js @@ -0,0 +1,29 @@ +var baseClone = require('./_baseClone'), + baseConforms = require('./_baseConforms'); + +/** + * Creates a function that invokes the predicate properties of `source` with + * the corresponding property values of a given object, returning `true` if + * all predicates return truthy, else `false`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Util + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new function. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * _.filter(users, _.conforms({ 'age': _.partial(_.gt, _, 38) })); + * // => [{ 'user': 'fred', 'age': 40 }] + */ +function conforms(source) { + return baseConforms(baseClone(source, true)); +} + +module.exports = conforms; diff --git a/tools/eslint/node_modules/lodash/constant.js b/tools/eslint/node_modules/lodash/constant.js new file mode 100644 index 00000000000000..59bcb420263b8d --- /dev/null +++ b/tools/eslint/node_modules/lodash/constant.js @@ -0,0 +1,24 @@ +/** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new function. + * @example + * + * var object = { 'user': 'fred' }; + * var getter = _.constant(object); + * + * getter() === object; + * // => true + */ +function constant(value) { + return function() { + return value; + }; +} + +module.exports = constant; diff --git a/tools/eslint/node_modules/lodash/core.js b/tools/eslint/node_modules/lodash/core.js new file mode 100644 index 00000000000000..b6e5b3244565a4 --- /dev/null +++ b/tools/eslint/node_modules/lodash/core.js @@ -0,0 +1,4000 @@ +/** + * @license + * lodash 4.9.0 (Custom Build) + * Build: `lodash core -o ./dist/lodash.core.js` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ +;(function() { + + /** Used as a safe reference for `undefined` in pre-ES5 environments. */ + var undefined; + + /** Used as the semantic version number. */ + var VERSION = '4.9.0'; + + /** Used as the `TypeError` message for "Functions" methods. */ + var FUNC_ERROR_TEXT = 'Expected a function'; + + /** Used to compose bitmasks for wrapper metadata. */ + var BIND_FLAG = 1, + PARTIAL_FLAG = 32; + + /** Used to compose bitmasks for comparison styles. */ + var UNORDERED_COMPARE_FLAG = 1, + PARTIAL_COMPARE_FLAG = 2; + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + stringTag = '[object String]'; + + /** Used to match HTML entities and HTML characters. */ + var reUnescapedHtml = /[&<>"'`]/g, + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; + + /** Used to map characters to HTML entities. */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '`': '`' + }; + + /** Used to determine if values are of the language type `Object`. */ + var objectTypes = { + 'function': true, + 'object': true + }; + + /** Detect free variable `exports`. */ + var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) + ? exports + : undefined; + + /** Detect free variable `module`. */ + var freeModule = (objectTypes[typeof module] && module && !module.nodeType) + ? module + : undefined; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = (freeModule && freeModule.exports === freeExports) + ? freeExports + : undefined; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); + + /** Detect free variable `self`. */ + var freeSelf = checkGlobal(objectTypes[typeof self] && self); + + /** Detect free variable `window`. */ + var freeWindow = checkGlobal(objectTypes[typeof window] && window); + + /** Detect `this` as the global object. */ + var thisGlobal = checkGlobal(objectTypes[typeof this] && this); + + /** + * Used as a reference to the global object. + * + * The `this` value is used if it's the global object to avoid Greasemonkey's + * restricted `window` object, otherwise the `window` object is used. + */ + var root = freeGlobal || + ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || + freeSelf || thisGlobal || Function('return this')(); + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a new array concatenating `array` with `other`. + * + * @private + * @param {Array} array The first array to concatenate. + * @param {Array} other The second array to concatenate. + * @returns {Array} Returns the new concatenated array. + */ + function arrayConcat(array, other) { + return arrayPush(copyArray(array), values); + } + + /** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ + function arrayPush(array, values) { + array.push.apply(array, values); + return array; + } + + /** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ + function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? current === current + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; + } + + /** + * The base implementation of methods like `_.find` and `_.findKey`, without + * support for iteratee shorthands, which iterates over `collection` using + * `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to search. + * @param {Function} predicate The function invoked per iteration. + * @param {Function} eachFunc The function to iterate over `collection`. + * @param {boolean} [retKey] Specify returning the key of the found element + * instead of the element itself. + * @returns {*} Returns the found element or its key, else `undefined`. + */ + function baseFind(collection, predicate, eachFunc, retKey) { + var result; + eachFunc(collection, function(value, key, collection) { + if (predicate(value, key, collection)) { + result = retKey ? key : value; + return false; + } + }); + return result; + } + + /** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } + + /** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ + function baseValues(object, props) { + return baseMap(props, function(key) { + return object[key]; + }); + } + + /** + * Checks if `value` is a global object. + * + * @private + * @param {*} value The value to check. + * @returns {null|Object} Returns `value` if it's a global object, else `null`. + */ + function checkGlobal(value) { + return (value && value.Object === Object) ? value : null; + } + + /** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ + function compareAscending(value, other) { + if (value !== other) { + var valIsNull = value === null, + valIsUndef = value === undefined, + valIsReflexive = value === value; + + var othIsNull = other === null, + othIsUndef = other === undefined, + othIsReflexive = other === other; + + if ((value > other && !othIsNull) || !valIsReflexive || + (valIsNull && !othIsUndef && othIsReflexive) || + (valIsUndef && othIsReflexive)) { + return 1; + } + if ((value < other && !valIsNull) || !othIsReflexive || + (othIsNull && !valIsUndef && valIsReflexive) || + (othIsUndef && valIsReflexive)) { + return -1; + } + } + return 0; + } + + /** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeHtmlChar(chr) { + return htmlEscapes[chr]; + } + + /** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ + function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; + length = length == null ? MAX_SAFE_INTEGER : length; + return value > -1 && value % 1 == 0 && value < length; + } + + /** + * Converts `iterator` to an array. + * + * @private + * @param {Object} iterator The iterator to convert. + * @returns {Array} Returns the converted array. + */ + function iteratorToArray(iterator) { + var data, + result = []; + + while (!(data = iterator.next()).done) { + result.push(data.value); + } + return result; + } + + /*--------------------------------------------------------------------------*/ + + /** Used for built-in method references. */ + var arrayProto = Array.prototype, + objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to generate unique IDs. */ + var idCounter = 0; + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ + var objectToString = objectProto.toString; + + /** Used to restore the original `_` reference in `_.noConflict`. */ + var oldDash = root._; + + /** Built-in value references. */ + var Reflect = root.Reflect, + Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + enumerate = Reflect ? Reflect.enumerate : undefined, + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeIsFinite = root.isFinite, + nativeKeys = Object.keys, + nativeMax = Math.max; + + /** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */ + var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf'); + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps `value` to enable implicit method + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. + * + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. + * + * The execution of chained methods is lazy, that is, it's deferred until + * `_#value` is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array of at least `200` elements + * and any iteratees accept only one argument. The heuristic for whether a + * section qualifies for shortcut fusion is subject to change. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, + * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `divide`, `each`, + * `eachRight`, `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`, + * `findIndex`, `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`, + * `floor`, `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, + * `forOwnRight`, `get`, `gt`, `gte`, `has`, `hasIn`, `head`, `identity`, + * `includes`, `indexOf`, `inRange`, `invoke`, `isArguments`, `isArray`, + * `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, `isBuffer`, + * `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`, + * `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMap`, `isMatch`, + * `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, + * `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`, + * `isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`, + * `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`, + * `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, `min`, `minBy`, `multiply`, + * `noConflict`, `noop`, `now`, `pad`, `padEnd`, `padStart`, `parseInt`, + * `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`, + * `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, + * `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`, + * `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toInteger`, + * `toJSON`, `toLength`, `toLower`, `toNumber`, `toSafeInteger`, `toString`, + * `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, + * `uniqueId`, `upperCase`, `upperFirst`, `value`, and `words` + * + * @name _ + * @constructor + * @category Seq + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2, 3]); + * + * // Returns an unwrapped value. + * wrapped.reduce(_.add); + * // => 6 + * + * // Returns a wrapped value. + * var squares = wrapped.map(square); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + return value instanceof LodashWrapper + ? value + : new LodashWrapper(value); + } + + /** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ + function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + } + + LodashWrapper.prototype = baseCreate(lodash.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Used by `_.defaults` to customize its `_.assignIn` use. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to assign. + * @param {Object} object The parent object of `objValue`. + * @returns {*} Returns the value to assign. + */ + function assignInDefaults(objValue, srcValue, key, object) { + if (objValue === undefined || + (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { + return srcValue; + } + return objValue; + } + + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + object[key] = value; + } + } + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} prototype The object to inherit from. + * @returns {Object} Returns the new object. + */ + function baseCreate(proto) { + return isObject(proto) ? objectCreate(proto) : {}; + } + + /** + * The base implementation of `_.delay` and `_.defer` which accepts an array + * of `func` arguments. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Object} args The arguments to provide to `func`. + * @returns {number} Returns the timer id. + */ + function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEach = createBaseEach(baseForOwn); + + /** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ + function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; + } + + /** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; + } + + /** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ + function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; + } + + /** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` invoking `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseFor = createBaseFor(); + + /** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } + + /** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the new array of filtered property names. + */ + function baseFunctions(object, props) { + return baseFilter(props, function(key) { + return isFunction(object[key]); + }); + } + + /** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @param {boolean} [bitmask] The bitmask of comparison flags. + * The bitmask may be composed of the following flags: + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, customizer, bitmask, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); + } + + /** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparisons. + * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = arrayTag, + othTag = arrayTag; + + if (!objIsArr) { + objTag = objectToString.call(object); + objTag = objTag == argsTag ? objectTag : objTag; + } + if (!othIsArr) { + othTag = objectToString.call(other); + othTag = othTag == argsTag ? objectTag : othTag; + } + var objIsObj = objTag == objectTag && !isHostObject(object), + othIsObj = othTag == objectTag && !isHostObject(other), + isSameTag = objTag == othTag; + + stack || (stack = []); + var stacked = find(stack, function(entry) { + return entry[0] === object; + }); + if (stacked && stacked[1]) { + return stacked[1] == other; + } + stack.push([object, other]); + if (isSameTag && !objIsObj) { + var result = (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) + : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack); + stack.pop(); + return result; + } + if (!(bitmask & PARTIAL_COMPARE_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + var result = equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); + stack.pop(); + return result; + } + } + if (!isSameTag) { + return false; + } + var result = equalObjects(object, other, equalFunc, customizer, bitmask, stack); + stack.pop(); + return result; + } + + /** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ + function baseIteratee(func) { + if (typeof func == 'function') { + return func; + } + if (func == null) { + return identity; + } + return (typeof func == 'object' ? baseMatches : baseProperty)(func); + } + + /** + * The base implementation of `_.keys` which doesn't skip the constructor + * property of prototypes or treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeys(object) { + return nativeKeys(Object(object)); + } + + /** + * The base implementation of `_.keysIn` which doesn't skip the constructor + * property of prototypes or treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeysIn(object) { + object = object == null ? object : Object(object); + + var result = []; + for (var key in object) { + result.push(key); + } + return result; + } + + // Fallback for IE < 9 with es6-shim. + if (enumerate && !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf')) { + baseKeysIn = function(object) { + return iteratorToArray(enumerate(object)); + }; + } + + /** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; + } + + /** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new function. + */ + function baseMatches(source) { + var props = keys(source); + return function(object) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object(object); + while (length--) { + var key = props[length]; + if (!(key in object && + baseIsEqual(source[key], object[key], undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG) + )) { + return false; + } + } + return true; + }; + } + + /** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} props The property identifiers to pick. + * @returns {Object} Returns the new object. + */ + function basePick(object, props) { + object = Object(object); + return reduce(props, function(result, key) { + if (key in object) { + result[key] = object[key]; + } + return result; + }, {}); + } + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } + + /** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ + function copyArray(source) { + return baseSlice(source, 0, source.length); + } + + /** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; + } + + /** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ + function baseWrapperValue(value, actions) { + var result = value; + return reduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); + } + + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @returns {Object} Returns `object`. + */ + var copyObject = copyObjectWith; + + /** + * This function is like `copyObject` except that it accepts a function to + * customize copied values. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObjectWith(source, props, object, customizer) { + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : source[key]; + + assignValue(object, key, newValue); + } + return object; + } + + /** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ + function createAssigner(assigner) { + return rest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined; + + customizer = typeof customizer == 'function' + ? (length--, customizer) + : undefined; + + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); + } + + /** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; + } + + /** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + + /** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ + function createCtorWrapper(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; + } + + /** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ + function createPartialWrapper(func, bitmask, thisArg, partials) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var isBind = bitmask & BIND_FLAG, + Ctor = createCtorWrapper(func); + + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return fn.apply(isBind ? thisArg : this, args); + } + return wrapper; + } + + /** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ + function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { + var index = -1, + isPartial = bitmask & PARTIAL_COMPARE_FLAG, + isUnordered = bitmask & UNORDERED_COMPARE_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + var result = true; + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + var compared; + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (isUnordered) { + if (!baseSome(other, function(othValue) { + return arrValue === othValue || + equalFunc(arrValue, othValue, customizer, bitmask, stack); + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, customizer, bitmask, stack) + )) { + result = false; + break; + } + } + return result; + } + + /** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { + switch (tag) { + + case boolTag: + case dateTag: + // Coerce dates and booleans to numbers, dates to milliseconds and + // booleans to `1` or `0` treating invalid dates coerced to `NaN` as + // not equal. + return +object == +other; + + case errorTag: + return object.name == other.name && object.message == other.message; + + case numberTag: + // Treat `NaN` vs. `NaN` as equal. + return (object != +object) ? other != +other : object == +other; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + } + return false; + } + + /** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, + objProps = keys(object), + objLength = objProps.length, + othProps = keys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + var result = true; + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + var compared; + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + return result; + } + + /** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a + * [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects + * Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ + var getLength = baseProperty('length'); + + /** + * Creates an array of index keys for `object` values of arrays, + * `arguments` objects, and strings, otherwise `null` is returned. + * + * @private + * @param {Object} object The object to query. + * @returns {Array|null} Returns index keys, else `null`. + */ + function indexKeys(object) { + var length = object ? object.length : undefined; + if (isLength(length) && + (isArray(object) || isString(object) || isArguments(object))) { + return baseTimes(length, String); + } + return null; + } + + /** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenable(value) { + return isArrayLikeObject(value) && (isArray(value) || isArguments(value)); + } + + /** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + return baseFilter(array, Boolean); + } + + /** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ + function concat() { + var length = arguments.length, + array = castArray(arguments[0]); + + if (length < 2) { + return length ? copyArray(array) : []; + } + var args = Array(length - 1); + while (length--) { + args[length - 1] = arguments[length]; + } + return arrayConcat(array, baseFlatten(args, 1)); + } + + /** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ + function flatten(array) { + var length = array ? array.length : 0; + return length ? baseFlatten(array, 1) : []; + } + + /** + * Recursively flattens `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ + function flattenDeep(array) { + var length = array ? array.length : 0; + return length ? baseFlatten(array, INFINITY) : []; + } + + /** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ + function head(array) { + return array ? array[0] : undefined; + } + + /** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ + function indexOf(array, value, fromIndex) { + var length = array ? array.length : 0; + if (typeof fromIndex == 'number') { + fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex; + } else { + fromIndex = 0; + } + var index = (fromIndex || 0) - 1, + isReflexive = value === value; + + while (++index < length) { + var other = array[index]; + if ((isReflexive ? other === value : other !== other)) { + return index; + } + } + return -1; + } + + /** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ + function last(array) { + var length = array ? array.length : 0; + return length ? array[length - 1] : undefined; + } + + /** + * Creates a slice of `array` from `start` up to, but not including, `end`. + * + * **Note:** This method is used instead of + * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are + * returned. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function slice(array, start, end) { + var length = array ? array.length : 0; + start = start == null ? 0 : +start; + end = end === undefined ? length : +end; + return length ? baseSlice(array, start, end) : []; + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' + */ + function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; + } + + /** + * This method invokes `interceptor` and returns `value`. The interceptor + * is invoked with one argument; (value). The purpose of this method is to + * "tap into" a method chain sequence in order to modify intermediate results. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns `value`. + * @example + * + * _([1, 2, 3]) + * .tap(function(array) { + * // Mutate input array. + * array.pop(); + * }) + * .reverse() + * .value(); + * // => [2, 1] + */ + function tap(value, interceptor) { + interceptor(value); + return value; + } + + /** + * This method is like `_.tap` except that it returns the result of `interceptor`. + * The purpose of this method is to "pass thru" values replacing intermediate + * results in a method chain sequence. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns the result of `interceptor`. + * @example + * + * _(' abc ') + * .chain() + * .trim() + * .thru(function(value) { + * return [value]; + * }) + * .value(); + * // => ['abc'] + */ + function thru(value, interceptor) { + return interceptor(value); + } + + /** + * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. + * + * @name chain + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // A sequence without explicit chaining. + * _(users).head(); + * // => { 'user': 'barney', 'age': 36 } + * + * // A sequence with explicit chaining. + * _(users) + * .chain() + * .head() + * .pick('user') + * .value(); + * // => { 'user': 'barney' } + */ + function wrapperChain() { + return chain(this); + } + + /** + * Executes the chain sequence to resolve the unwrapped value. + * + * @name value + * @memberOf _ + * @since 0.1.0 + * @alias toJSON, valueOf + * @category Seq + * @returns {*} Returns the resolved unwrapped value. + * @example + * + * _([1, 2, 3]).value(); + * // => [1, 2, 3] + */ + function wrapperValue() { + return baseWrapperValue(this.__wrapped__, this.__actions__); + } + + /*------------------------------------------------------------------------*/ + + /** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false + */ + function every(collection, predicate, guard) { + predicate = guard ? undefined : predicate; + return baseEvery(collection, baseIteratee(predicate)); + } + + /** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + */ + function filter(collection, predicate) { + return baseFilter(collection, baseIteratee(predicate)); + } + + /** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to search. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ + function find(collection, predicate) { + return baseFind(collection, baseIteratee(predicate), baseEach); + } + + /** + * Iterates over elements of `collection` invoking `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @example + * + * _([1, 2]).forEach(function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forEach(collection, iteratee) { + return baseEach(collection, baseIteratee(iteratee)); + } + + /** + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `take`, `takeRight`, `template`, + * `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ + function map(collection, iteratee) { + return baseMap(collection, baseIteratee(iteratee)); + } + + /** + * Reduces `collection` to a value which is the accumulated result of running + * each element in `collection` thru `iteratee`, where each successive + * invocation is supplied the return value of the previous. If `accumulator` + * is not given, the first element of `collection` is used as the initial + * value. The iteratee is invoked with four arguments: + * (accumulator, value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.reduce`, `_.reduceRight`, and `_.transform`. + * + * The guarded methods are: + * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, + * and `sortBy` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @example + * + * _.reduce([1, 2], function(sum, n) { + * return sum + n; + * }, 0); + * // => 3 + * + * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * return result; + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) + */ + function reduce(collection, iteratee, accumulator) { + return baseReduce(collection, baseIteratee(iteratee), accumulator, arguments.length < 3, baseEach); + } + + /** + * Gets the size of `collection` by returning its length for array-like + * values or the number of own enumerable string keyed properties for objects. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @returns {number} Returns the collection size. + * @example + * + * _.size([1, 2, 3]); + * // => 3 + * + * _.size({ 'a': 1, 'b': 2 }); + * // => 2 + * + * _.size('pebbles'); + * // => 7 + */ + function size(collection) { + if (collection == null) { + return 0; + } + collection = isArrayLike(collection) ? collection : keys(collection); + return collection.length; + } + + /** + * Checks if `predicate` returns truthy for **any** element of `collection`. + * Iteration is stopped once `predicate` returns truthy. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.some(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.some(users, 'active'); + * // => true + */ + function some(collection, predicate, guard) { + predicate = guard ? undefined : predicate; + return baseSome(collection, baseIteratee(predicate)); + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} + * [iteratees=[_.identity]] The iteratees to sort by, specified individually + * or in arrays. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, function(o) { return o.user; }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + * + * _.sortBy(users, 'user', function(o) { + * return Math.floor(o.age / 10); + * }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ + function sortBy(collection, iteratee) { + var index = 0; + iteratee = baseIteratee(iteratee); + + return baseMap(baseMap(collection, function(value, key, collection) { + return { 'value': value, 'index': index++, 'criteria': iteratee(value, key, collection) }; + }).sort(function(object, other) { + return compareAscending(object.criteria, other.criteria) || (object.index - other.index); + }), baseProperty('value')); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => allows adding up to 4 contacts to the list + */ + function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; + } + + /** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind` this method doesn't set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var greet = function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * }; + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */ + var bind = rest(function(func, thisArg, partials) { + return createPartialWrapper(func, BIND_FLAG | PARTIAL_FLAG, thisArg, partials); + }); + + /** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one or more milliseconds. + */ + var defer = rest(function(func, args) { + return baseDelay(func, 1, args); + }); + + /** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. + */ + var delay = rest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); + }); + + /** + * Creates a function that negates the result of the predicate `func`. The + * `func` predicate is invoked with the `this` binding and arguments of the + * created function. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} predicate The predicate to negate. + * @returns {Function} Returns the new function. + * @example + * + * function isEven(n) { + * return n % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */ + function negate(predicate) { + if (typeof predicate != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + return !predicate.apply(this, arguments); + }; + } + + /** + * Creates a function that is restricted to invoking `func` once. Repeat calls + * to the function return the value of the first invocation. The `func` is + * invoked with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // `initialize` invokes `createApplication` once + */ + function once(func) { + return before(2, func); + } + + /** + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as + * an array. + * + * **Note:** This method is based on the + * [rest parameter](https://mdn.io/rest_parameters). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.rest(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); + * + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' + */ + function rest(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + var otherArgs = Array(start + 1); + index = -1; + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = array; + return func.apply(this, otherArgs); + }; + } + + /*------------------------------------------------------------------------*/ + + /** + * Casts `value` as an array if it's not one. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Lang + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast array. + * @example + * + * _.castArray(1); + * // => [1] + * + * _.castArray({ 'a': 1 }); + * // => [{ 'a': 1 }] + * + * _.castArray('abc'); + * // => ['abc'] + * + * _.castArray(null); + * // => [null] + * + * _.castArray(undefined); + * // => [undefined] + * + * _.castArray(); + * // => [] + * + * var array = [1, 2, 3]; + * console.log(_.castArray(array) === array); + * // => true + */ + function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray(value) ? value : [value]; + } + + /** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ + function clone(value) { + if (!isObject(value)) { + return value; + } + return isArray(value) ? copyArray(value) : copyObject(value, keys(value)); + } + + /** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'user': 'fred' }; + * var other = { 'user': 'fred' }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + function eq(value, other) { + return value === other || (value !== value && other !== other); + } + + /** + * Checks if `value` is greater than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + * @example + * + * _.gt(3, 1); + * // => true + * + * _.gt(3, 3); + * // => false + * + * _.gt(1, 3); + * // => false + */ + function gt(value, other) { + return value > other; + } + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + function isArguments(value) { + // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); + } + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @type {Function} + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(getLength(value)) && !isFunction(value); + } + + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + + /** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && objectToString.call(value) == boolTag); + } + + /** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ + function isDate(value) { + return isObjectLike(value) && objectToString.call(value) == dateTag; + } + + /** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ + function isEmpty(value) { + if (isArrayLike(value) && + (isArray(value) || isString(value) || + isFunction(value.splice) || isArguments(value))) { + return !value.length; + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return !(nonEnumShadows && keys(value).length); + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are **not** supported. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, + * else `false`. + * @example + * + * var object = { 'user': 'fred' }; + * var other = { 'user': 'fred' }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ + function isEqual(value, other) { + return baseIsEqual(value, other); + } + + /** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, + * else `false`. + * @example + * + * _.isFinite(3); + * // => true + * + * _.isFinite(Number.MAX_VALUE); + * // => true + * + * _.isFinite(3.14); + * // => true + * + * _.isFinite(Infinity); + * // => false + */ + function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array and weak map constructors, + // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, + * else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } + + /** + * Checks if `value` is `NaN`. + * + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ + function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && objectToString.call(value) == numberTag); + } + + /** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ + function isRegExp(value) { + return isObject(value) && objectToString.call(value) == regexpTag; + } + + /** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ + function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag); + } + + /** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ + function isUndefined(value) { + return value === undefined; + } + + /** + * Checks if `value` is less than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + * @example + * + * _.lt(1, 3); + * // => true + * + * _.lt(3, 3); + * // => false + * + * _.lt(3, 1); + * // => false + */ + function lt(value, other) { + return value < other; + } + + /** + * Converts `value` to an array. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {Array} Returns the converted array. + * @example + * + * _.toArray({ 'a': 1, 'b': 2 }); + * // => [1, 2] + * + * _.toArray('abc'); + * // => ['a', 'b', 'c'] + * + * _.toArray(1); + * // => [] + * + * _.toArray(null); + * // => [] + */ + function toArray(value) { + if (!isArrayLike(value)) { + return values(value); + } + return value.length ? copyArray(value) : []; + } + + /** + * Converts `value` to an integer. + * + * **Note:** This function is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3'); + * // => 3 + */ + var toInteger = Number; + + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3); + * // => 3 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3'); + * // => 3 + */ + var toNumber = Number; + + /** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + if (typeof value == 'string') { + return value; + } + return value == null ? '' : (value + ''); + } + + /*------------------------------------------------------------------------*/ + + /** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.c = 3; + * } + * + * function Bar() { + * this.e = 5; + * } + * + * Foo.prototype.d = 4; + * Bar.prototype.f = 6; + * + * _.assign({ 'a': 1 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3, 'e': 5 } + */ + var assign = createAssigner(function(object, source) { + copyObject(source, keys(source), object); + }); + + /** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * function Bar() { + * this.d = 4; + * } + * + * Foo.prototype.c = 3; + * Bar.prototype.e = 5; + * + * _.assignIn({ 'a': 1 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } + */ + var assignIn = createAssigner(function(object, source) { + copyObject(source, keysIn(source), object); + }); + + /** + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extendWith + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObjectWith(source, keysIn(source), object, customizer); + }); + + /** + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ + function create(prototype, properties) { + var result = baseCreate(prototype); + return properties ? assign(result, properties) : result; + } + + /** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); + * // => { 'user': 'barney', 'age': 36 } + */ + var defaults = rest(function(args) { + args.push(undefined, assignInDefaults); + return assignInWith.apply(undefined, args); + }); + + /** + * Checks if `path` is a direct property of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b'); + * // => true + * + * _.has(object, ['a', 'b']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ + function has(object, path) { + return object != null && hasOwnProperty.call(object, path); + } + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + function keys(object) { + var isProto = isPrototype(object); + if (!(isProto || isArrayLike(object))) { + return baseKeys(object); + } + var indexes = indexKeys(object), + skipIndexes = !!indexes, + result = indexes || [], + length = result.length; + + for (var key in object) { + if (hasOwnProperty.call(object, key) && + !(skipIndexes && (key == 'length' || isIndex(key, length))) && + !(isProto && key == 'constructor')) { + result.push(key); + } + } + return result; + } + + /** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ + function keysIn(object) { + var index = -1, + isProto = isPrototype(object), + props = baseKeysIn(object), + propsLength = props.length, + indexes = indexKeys(object), + skipIndexes = !!indexes, + result = indexes || [], + length = result.length; + + while (++index < propsLength) { + var key = props[index]; + if (!(skipIndexes && (key == 'length' || isIndex(key, length))) && + !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; + } + + /** + * Creates an object composed of the picked `object` properties. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [props] The property identifiers to pick, + * specified individually or in arrays. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ + var pick = rest(function(object, props) { + return object == null ? {} : basePick(object, baseFlatten(props, 1)); + }); + + /** + * This method is like `_.get` except that if the resolved value is a + * function it's invoked with the `this` binding of its parent object and + * its result is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to resolve. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; + * + * _.result(object, 'a[0].b.c1'); + * // => 3 + * + * _.result(object, 'a[0].b.c2'); + * // => 4 + * + * _.result(object, 'a[0].b.c3', 'default'); + * // => 'default' + * + * _.result(object, 'a[0].b.c3', _.constant('default')); + * // => 'default' + */ + function result(object, path, defaultValue) { + var value = object == null ? undefined : object[path]; + if (value === undefined) { + value = defaultValue; + } + return isFunction(value) ? value.call(object) : value; + } + + /** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */ + function values(object) { + return object ? baseValues(object, keys(object)) : []; + } + + /*------------------------------------------------------------------------*/ + + /** + * Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to + * their corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * Backticks are escaped because in IE < 9, they can break out of + * attribute values or HTML comments. See [#59](https://html5sec.org/#59), + * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and + * [#133](https://html5sec.org/#133) of the + * [HTML5 Security Cheatsheet](https://html5sec.org/) for more details. + * + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ + function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; + } + + /*------------------------------------------------------------------------*/ + + /** + * This method returns the first argument given to it. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'user': 'fred' }; + * + * _.identity(object) === object; + * // => true + */ + function identity(value) { + return value; + } + + /** + * Creates a function that invokes `func` with the arguments of the created + * function. If `func` is a property name, the created function returns the + * property value for a given element. If `func` is an array or object, the + * created function returns `true` for elements that contain the equivalent + * source properties, otherwise it returns `false`. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Util + * @param {*} [func=_.identity] The value to convert to a callback. + * @returns {Function} Returns the callback. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); + * // => [{ 'user': 'barney', 'age': 36, 'active': true }] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, _.iteratee(['user', 'fred'])); + * // => [{ 'user': 'fred', 'age': 40 }] + * + * // The `_.property` iteratee shorthand. + * _.map(users, _.iteratee('user')); + * // => ['barney', 'fred'] + * + * // Create custom iteratee shorthands. + * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { + * return !_.isRegExp(func) ? iteratee(func) : function(string) { + * return func.test(string); + * }; + * }); + * + * _.filter(['abc', 'def'], /ef/); + * // => ['def'] + */ + var iteratee = baseIteratee; + + /** + * Creates a function that performs a partial deep comparison between a given + * object and `source`, returning `true` if the given object has equivalent + * property values, else `false`. The created function is equivalent to + * `_.isMatch` with a `source` partially applied. + * + * **Note:** This method supports comparing the same values as `_.isEqual`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Util + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new function. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, _.matches({ 'age': 40, 'active': false })); + * // => [{ 'user': 'fred', 'age': 40, 'active': false }] + */ + function matches(source) { + return baseMatches(assign({}, source)); + } + + /** + * Adds all own enumerable string keyed function properties of a source + * object to the destination object. If `object` is a function, then methods + * are added to its prototype as well. + * + * **Note:** Use `_.runInContext` to create a pristine `lodash` function to + * avoid conflicts caused by modifying the original. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {Function|Object} [object=lodash] The destination object. + * @param {Object} source The object of functions to add. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.chain=true] Specify whether mixins are chainable. + * @returns {Function|Object} Returns `object`. + * @example + * + * function vowels(string) { + * return _.filter(string, function(v) { + * return /[aeiou]/i.test(v); + * }); + * } + * + * _.mixin({ 'vowels': vowels }); + * _.vowels('fred'); + * // => ['e'] + * + * _('fred').vowels().value(); + * // => ['e'] + * + * _.mixin({ 'vowels': vowels }, { 'chain': false }); + * _('fred').vowels(); + * // => ['e'] + */ + function mixin(object, source, options) { + var props = keys(source), + methodNames = baseFunctions(source, props); + + if (options == null && + !(isObject(source) && (methodNames.length || !props.length))) { + options = source; + source = object; + object = this; + methodNames = baseFunctions(source, keys(source)); + } + var chain = (isObject(options) && 'chain' in options) ? options.chain : true, + isFunc = isFunction(object); + + baseEach(methodNames, function(methodName) { + var func = source[methodName]; + object[methodName] = func; + if (isFunc) { + object.prototype[methodName] = function() { + var chainAll = this.__chain__; + if (chain || chainAll) { + var result = object(this.__wrapped__), + actions = result.__actions__ = copyArray(this.__actions__); + + actions.push({ 'func': func, 'args': arguments, 'thisArg': object }); + result.__chain__ = chainAll; + return result; + } + return func.apply(object, arrayPush([this.value()], arguments)); + }; + } + }); + + return object; + } + + /** + * Reverts the `_` variable to its previous value and returns a reference to + * the `lodash` function. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @returns {Function} Returns the `lodash` function. + * @example + * + * var lodash = _.noConflict(); + */ + function noConflict() { + if (root._ === this) { + root._ = oldDash; + } + return this; + } + + /** + * A no-operation function that returns `undefined` regardless of the + * arguments it receives. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Util + * @example + * + * var object = { 'user': 'fred' }; + * + * _.noop(object) === undefined; + * // => true + */ + function noop() { + // No operation performed. + } + + /** + * Generates a unique ID. If `prefix` is given, the ID is appended to it. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {string} [prefix=''] The value to prefix the ID with. + * @returns {string} Returns the unique ID. + * @example + * + * _.uniqueId('contact_'); + * // => 'contact_104' + * + * _.uniqueId(); + * // => '105' + */ + function uniqueId(prefix) { + var id = ++idCounter; + return toString(prefix) + id; + } + + /*------------------------------------------------------------------------*/ + + /** + * Computes the maximum value of `array`. If `array` is empty or falsey, + * `undefined` is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the maximum value. + * @example + * + * _.max([4, 2, 8, 6]); + * // => 8 + * + * _.max([]); + * // => undefined + */ + function max(array) { + return (array && array.length) + ? baseExtremum(array, identity, gt) + : undefined; + } + + /** + * Computes the minimum value of `array`. If `array` is empty or falsey, + * `undefined` is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Math + * @param {Array} array The array to iterate over. + * @returns {*} Returns the minimum value. + * @example + * + * _.min([4, 2, 8, 6]); + * // => 2 + * + * _.min([]); + * // => undefined + */ + function min(array) { + return (array && array.length) + ? baseExtremum(array, identity, lt) + : undefined; + } + + /*------------------------------------------------------------------------*/ + + // Add methods that return wrapped values in chain sequences. + lodash.assignIn = assignIn; + lodash.before = before; + lodash.bind = bind; + lodash.chain = chain; + lodash.compact = compact; + lodash.concat = concat; + lodash.create = create; + lodash.defaults = defaults; + lodash.defer = defer; + lodash.delay = delay; + lodash.filter = filter; + lodash.flatten = flatten; + lodash.flattenDeep = flattenDeep; + lodash.iteratee = iteratee; + lodash.keys = keys; + lodash.map = map; + lodash.matches = matches; + lodash.mixin = mixin; + lodash.negate = negate; + lodash.once = once; + lodash.pick = pick; + lodash.slice = slice; + lodash.sortBy = sortBy; + lodash.tap = tap; + lodash.thru = thru; + lodash.toArray = toArray; + lodash.values = values; + + // Add aliases. + lodash.extend = assignIn; + + // Add methods to `lodash.prototype`. + mixin(lodash, lodash); + + /*------------------------------------------------------------------------*/ + + // Add methods that return unwrapped values in chain sequences. + lodash.clone = clone; + lodash.escape = escape; + lodash.every = every; + lodash.find = find; + lodash.forEach = forEach; + lodash.has = has; + lodash.head = head; + lodash.identity = identity; + lodash.indexOf = indexOf; + lodash.isArguments = isArguments; + lodash.isArray = isArray; + lodash.isBoolean = isBoolean; + lodash.isDate = isDate; + lodash.isEmpty = isEmpty; + lodash.isEqual = isEqual; + lodash.isFinite = isFinite; + lodash.isFunction = isFunction; + lodash.isNaN = isNaN; + lodash.isNull = isNull; + lodash.isNumber = isNumber; + lodash.isObject = isObject; + lodash.isRegExp = isRegExp; + lodash.isString = isString; + lodash.isUndefined = isUndefined; + lodash.last = last; + lodash.max = max; + lodash.min = min; + lodash.noConflict = noConflict; + lodash.noop = noop; + lodash.reduce = reduce; + lodash.result = result; + lodash.size = size; + lodash.some = some; + lodash.uniqueId = uniqueId; + + // Add aliases. + lodash.each = forEach; + lodash.first = head; + + mixin(lodash, (function() { + var source = {}; + baseForOwn(lodash, function(func, methodName) { + if (!hasOwnProperty.call(lodash.prototype, methodName)) { + source[methodName] = func; + } + }); + return source; + }()), { 'chain': false }); + + /*------------------------------------------------------------------------*/ + + /** + * The semantic version number. + * + * @static + * @memberOf _ + * @type {string} + */ + lodash.VERSION = VERSION; + + // Add `Array` methods to `lodash.prototype`. + baseEach(['pop', 'join', 'replace', 'reverse', 'split', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { + var func = (/^(?:replace|split)$/.test(methodName) ? String.prototype : arrayProto)[methodName], + chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', + retUnwrapped = /^(?:pop|join|replace|shift)$/.test(methodName); + + lodash.prototype[methodName] = function() { + var args = arguments; + if (retUnwrapped && !this.__chain__) { + var value = this.value(); + return func.apply(isArray(value) ? value : [], args); + } + return this[chainName](function(value) { + return func.apply(isArray(value) ? value : [], args); + }); + }; + }); + + // Add chain sequence methods to the `lodash` wrapper. + lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; + + /*--------------------------------------------------------------------------*/ + + // Expose lodash on the free variable `window` or `self` when available. This + // prevents errors in cases where lodash is loaded by a script tag in the presence + // of an AMD loader. See http://requirejs.org/docs/errors.html#mismatch for more details. + (freeWindow || freeSelf || {})._ = lodash; + + // Some AMD build optimizers like r.js check for condition patterns like the following: + if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { + // Define as an anonymous module so, through path mapping, it can be + // referenced as the "underscore" module. + define(function() { + return lodash; + }); + } + // Check for `exports` after `define` in case a build optimizer adds an `exports` object. + else if (freeExports && freeModule) { + // Export for Node.js. + if (moduleExports) { + (freeModule.exports = lodash)._ = lodash; + } + // Export for CommonJS support. + freeExports._ = lodash; + } + else { + // Export to the global object. + root._ = lodash; + } +}.call(this)); diff --git a/tools/eslint/node_modules/lodash/core.min.js b/tools/eslint/node_modules/lodash/core.min.js new file mode 100644 index 00000000000000..37cd8bddabac28 --- /dev/null +++ b/tools/eslint/node_modules/lodash/core.min.js @@ -0,0 +1,30 @@ +/** + * @license + * lodash 4.9.0 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE + * Build: `lodash core -o ./dist/lodash.core.js` + */ +;(function(){function n(n,t){return n.push.apply(n,t),n}function t(n,t,r){for(var e=-1,u=n.length;++e-1&&0==n%1&&(null==t?9007199254740991:t)>n}function a(n){return n instanceof l?n:new l(n)}function l(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function p(n,t,r,e){var u;return(u=n===pn)||(u=En[r],u=(n===u||n!==n&&u!==u)&&!kn.call(e,r)),u?t:n}function s(n){return Z(n)?Bn(n):{}}function h(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function");return setTimeout(function(){ +n.apply(pn,r)},t)}function v(n,t){var r=true;return Cn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function y(n,t){var r=[];return Cn(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function g(t,r,e,u,o){var i=-1,c=t.length;for(e||(e=C),o||(o=[]);++i0&&e(f)?r>1?g(f,r-1,e,u,o):n(o,f):u||(o[o.length]=f)}return o}function b(n,t){return n&&Gn(n,t,on)}function _(n,t){return y(t,function(t){return X(n[t])})}function j(n,t,r,e,u){return n===t?true:null==n||null==t||!Z(n)&&!nn(t)?n!==n&&t!==t:d(n,t,j,r,e,u); +}function d(n,t,r,e,u,o){var i=Vn(n),f=Vn(t),a="[object Array]",l="[object Array]";i||(a=Sn.call(n),a="[object Arguments]"==a?"[object Object]":a),f||(l=Sn.call(t),l="[object Arguments]"==l?"[object Object]":l);var p="[object Object]"==a&&!c(n),f="[object Object]"==l&&!c(t),l=a==l;o||(o=[]);var s=M(o,function(t){return t[0]===n});return s&&s[1]?s[1]==t:(o.push([n,t]),l&&!p?(r=i||isTypedArray(n)?I(n,t,r,e,u,o):$(n,t,a),o.pop(),r):2&u||(i=p&&kn.call(n,"__wrapped__"),a=f&&kn.call(t,"__wrapped__"),!i&&!a)?l?(r=q(n,t,r,e,u,o), +o.pop(),r):false:(i=i?n.value():n,t=a?t.value():t,r=r(i,t,e,u,o),o.pop(),r))}function m(n){return typeof n=="function"?n:null==n?an:(typeof n=="object"?x:E)(n)}function O(n){n=null==n?n:Object(n);var t,r=[];for(t in n)r.push(t);return r}function w(n,t){var r=-1,e=W(n)?Array(n.length):[];return Cn(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function x(n){var t=on(n);return function(r){var e=t.length;if(null==r)return!e;for(r=Object(r);e--;){var u=t[e];if(!(u in r&&j(n[u],r[u],pn,3)))return false}return true}}function A(n,t){ +return n=Object(n),U(t,function(t,r){return r in n&&(t[r]=n[r]),t},{})}function E(n){return function(t){return null==t?pn:t[n]}}function k(n,t,r){var e=-1,u=n.length;for(0>t&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++e1?r[u-1]:pn,o=typeof o=="function"?(u--,o):pn;for(t=Object(t);++ef))return false;for(a=true;++iarguments.length,Cn)}function V(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function"); +return n=Hn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=pn),r}}function H(n){var t;if(typeof n!="function")throw new TypeError("Expected a function");return t=qn(t===pn?n.length-1:Hn(t),0),function(){for(var r=arguments,e=-1,u=qn(r.length-t,0),o=Array(u);++et}function Q(n){return nn(n)&&W(n)&&kn.call(n,"callee")&&(!Dn.call(n,"callee")||"[object Arguments]"==Sn.call(n)); +}function W(n){return null!=n&&Y(Jn(n))&&!X(n)}function X(n){return n=Z(n)?Sn.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n}function Y(n){return typeof n=="number"&&n>-1&&0==n%1&&9007199254740991>=n}function Z(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function nn(n){return!!n&&typeof n=="object"}function tn(n){return typeof n=="number"||nn(n)&&"[object Number]"==Sn.call(n)}function rn(n){return typeof n=="string"||!Vn(n)&&nn(n)&&"[object String]"==Sn.call(n)}function en(n,t){ +return t>n}function un(n){return typeof n=="string"?n:null==n?"":n+""}function on(n){var t=G(n);if(!t&&!W(n))return $n(Object(n));var r,e=z(n),u=!!e,e=e||[],o=e.length;for(r in n)!kn.call(n,r)||u&&("length"==r||f(r,o))||t&&"constructor"==r||e.push(r);return e}function cn(n){for(var t=-1,r=G(n),e=O(n),u=e.length,o=z(n),i=!!o,o=o||[],c=o.length;++t"'`]/g,vn=RegExp(hn.source),yn=/^(?:0|[1-9]\d*)$/,gn={ +"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},bn={"function":true,object:true},_n=bn[typeof exports]&&exports&&!exports.nodeType?exports:pn,jn=bn[typeof module]&&module&&!module.nodeType?module:pn,dn=jn&&jn.exports===_n?_n:pn,mn=o(bn[typeof self]&&self),On=o(bn[typeof window]&&window),wn=o(bn[typeof this]&&this),xn=o(_n&&jn&&typeof global=="object"&&global)||On!==(wn&&wn.window)&&On||mn||wn||Function("return this")(),An=Array.prototype,En=Object.prototype,kn=En.hasOwnProperty,Nn=0,Sn=En.toString,Tn=xn._,Fn=xn.Reflect,Rn=Fn?Fn.f:pn,Bn=Object.create,Dn=En.propertyIsEnumerable,In=xn.isFinite,$n=Object.keys,qn=Math.max,zn=!Dn.call({ +valueOf:1},"valueOf");l.prototype=s(a.prototype),l.prototype.constructor=l;var Cn=function(n,t){return function(r,e){if(null==r)return r;if(!W(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++ot)return t?N(r):[];for(var e=Array(t-1);t--;)e[t-1]=arguments[t];return g(e,1),n(N(r),fn)},a.create=function(n,t){var r=s(n);return t?Ln(r,t):r},a.defaults=Xn,a.defer=Pn,a.delay=Un,a.filter=function(n,t){return y(n,m(t))},a.flatten=function(n){return n&&n.length?g(n,1):[]},a.flattenDeep=function(n){return n&&n.length?g(n,sn):[]},a.iteratee=Zn,a.keys=on,a.map=function(n,t){return w(n,m(t))},a.matches=function(n){ +return x(Ln({},n))},a.mixin=ln,a.negate=function(n){if(typeof n!="function")throw new TypeError("Expected a function");return function(){return!n.apply(this,arguments)}},a.once=function(n){return V(2,n)},a.pick=Yn,a.slice=function(n,t,r){var e=n?n.length:0;return r=r===pn?e:+r,e?k(n,null==t?0:+t,r):[]},a.sortBy=function(n,t){var r=0;return t=m(t),w(w(n,function(n,e,u){return{c:n,b:r++,a:t(n,e,u)}}).sort(function(n,t){var r;n:{r=n.a;var e=t.a;if(r!==e){var u=null===r,o=r===pn,i=r===r,c=null===e,f=e===pn,a=e===e; +if(r>e&&!c||!i||u&&!f&&a||o&&a){r=1;break n}if(e>r&&!u||!a||c&&!o&&i||f&&i){r=-1;break n}}r=0}return r||n.b-t.b}),E("c"))},a.tap=function(n,t){return t(n),n},a.thru=function(n,t){return t(n)},a.toArray=function(n){return W(n)?n.length?N(n):[]:fn(n)},a.values=fn,a.extend=Qn,ln(a,a),a.clone=function(n){return Z(n)?Vn(n)?N(n):F(n,on(n)):n},a.escape=function(n){return(n=un(n))&&vn.test(n)?n.replace(hn,i):n},a.every=function(n,t,r){return t=r?pn:t,v(n,m(t))},a.find=M,a.forEach=P,a.has=function(n,t){return null!=n&&kn.call(n,t); +},a.head=J,a.identity=an,a.indexOf=function(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?qn(e+r,0):r:0,r=(r||0)-1;for(var u=t===t;++r { '4': 1, '6': 2 } + * + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ +var countBy = createAggregator(function(result, value, key) { + hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1); +}); + +module.exports = countBy; diff --git a/tools/eslint/node_modules/lodash/create.js b/tools/eslint/node_modules/lodash/create.js new file mode 100644 index 00000000000000..a99067ff493633 --- /dev/null +++ b/tools/eslint/node_modules/lodash/create.js @@ -0,0 +1,43 @@ +var baseAssign = require('./_baseAssign'), + baseCreate = require('./_baseCreate'); + +/** + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ +function create(prototype, properties) { + var result = baseCreate(prototype); + return properties ? baseAssign(result, properties) : result; +} + +module.exports = create; diff --git a/tools/eslint/node_modules/lodash/curry.js b/tools/eslint/node_modules/lodash/curry.js new file mode 100644 index 00000000000000..2f85624c4a502a --- /dev/null +++ b/tools/eslint/node_modules/lodash/curry.js @@ -0,0 +1,57 @@ +var createWrapper = require('./_createWrapper'); + +/** Used to compose bitmasks for wrapper metadata. */ +var CURRY_FLAG = 8; + +/** + * Creates a function that accepts arguments of `func` and either invokes + * `func` returning its result, if at least `arity` number of arguments have + * been provided, or returns a function that accepts the remaining `func` + * arguments, and so on. The arity of `func` may be specified if `func.length` + * is not sufficient. + * + * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curry(abc); + * + * curried(1)(2)(3); + * // => [1, 2, 3] + * + * curried(1, 2)(3); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(1)(_, 3)(2); + * // => [1, 2, 3] + */ +function curry(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrapper(func, CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curry.placeholder; + return result; +} + +// Assign default placeholders. +curry.placeholder = {}; + +module.exports = curry; diff --git a/tools/eslint/node_modules/lodash/curryRight.js b/tools/eslint/node_modules/lodash/curryRight.js new file mode 100644 index 00000000000000..d00bfad5de98aa --- /dev/null +++ b/tools/eslint/node_modules/lodash/curryRight.js @@ -0,0 +1,54 @@ +var createWrapper = require('./_createWrapper'); + +/** Used to compose bitmasks for wrapper metadata. */ +var CURRY_RIGHT_FLAG = 16; + +/** + * This method is like `_.curry` except that arguments are applied to `func` + * in the manner of `_.partialRight` instead of `_.partial`. + * + * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curryRight(abc); + * + * curried(3)(2)(1); + * // => [1, 2, 3] + * + * curried(2, 3)(1); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(3)(1, _)(2); + * // => [1, 2, 3] + */ +function curryRight(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrapper(func, CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curryRight.placeholder; + return result; +} + +// Assign default placeholders. +curryRight.placeholder = {}; + +module.exports = curryRight; diff --git a/tools/eslint/node_modules/lodash/date.js b/tools/eslint/node_modules/lodash/date.js new file mode 100644 index 00000000000000..cbf5b41098f117 --- /dev/null +++ b/tools/eslint/node_modules/lodash/date.js @@ -0,0 +1,3 @@ +module.exports = { + 'now': require('./now') +}; diff --git a/tools/eslint/node_modules/lodash/debounce.js b/tools/eslint/node_modules/lodash/debounce.js new file mode 100644 index 00000000000000..e43b400dbf5d55 --- /dev/null +++ b/tools/eslint/node_modules/lodash/debounce.js @@ -0,0 +1,179 @@ +var isObject = require('./isObject'), + now = require('./now'), + toNumber = require('./toNumber'); + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide an options object to indicate whether `func` should be invoked on + * the leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent calls + * to the debounced function return the result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked + * on the trailing edge of the timeout only if the debounced function is + * invoked more than once during the `wait` timeout. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ +function debounce(func, wait, options) { + var lastArgs, + lastThis, + result, + timerId, + lastCallTime = 0, + lastInvokeTime = 0, + leading = false, + maxWait = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxWait = 'maxWait' in options && nativeMax(toNumber(options.maxWait) || 0, wait); + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + result = wait - timeSinceLastCall; + + return maxWait === false ? result : nativeMin(result, maxWait - timeSinceLastInvoke); + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (!lastCallTime || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxWait !== false && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + clearTimeout(timerId); + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastCallTime = lastInvokeTime = 0; + lastArgs = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + // Handle invocations in a tight loop. + clearTimeout(timerId); + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; +} + +module.exports = debounce; diff --git a/tools/eslint/node_modules/lodash/deburr.js b/tools/eslint/node_modules/lodash/deburr.js new file mode 100644 index 00000000000000..6862072121b676 --- /dev/null +++ b/tools/eslint/node_modules/lodash/deburr.js @@ -0,0 +1,42 @@ +var deburrLetter = require('./_deburrLetter'), + toString = require('./toString'); + +/** Used to match latin-1 supplementary letters (excluding mathematical operators). */ +var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g; + +/** Used to compose unicode character classes. */ +var rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsComboSymbolsRange = '\\u20d0-\\u20f0'; + +/** Used to compose unicode capture groups. */ +var rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']'; + +/** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ +var reComboMark = RegExp(rsCombo, 'g'); + +/** + * Deburrs `string` by converting + * [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * to basic latin letters and removing + * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. + * @example + * + * _.deburr('déjà vu'); + * // => 'deja vu' + */ +function deburr(string) { + string = toString(string); + return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, ''); +} + +module.exports = deburr; diff --git a/tools/eslint/node_modules/lodash/defaults.js b/tools/eslint/node_modules/lodash/defaults.js new file mode 100644 index 00000000000000..f35301abcf260d --- /dev/null +++ b/tools/eslint/node_modules/lodash/defaults.js @@ -0,0 +1,31 @@ +var apply = require('./_apply'), + assignInDefaults = require('./_assignInDefaults'), + assignInWith = require('./assignInWith'), + rest = require('./rest'); + +/** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); + * // => { 'user': 'barney', 'age': 36 } + */ +var defaults = rest(function(args) { + args.push(undefined, assignInDefaults); + return apply(assignInWith, undefined, args); +}); + +module.exports = defaults; diff --git a/tools/eslint/node_modules/lodash/defaultsDeep.js b/tools/eslint/node_modules/lodash/defaultsDeep.js new file mode 100644 index 00000000000000..c12d7293b567c4 --- /dev/null +++ b/tools/eslint/node_modules/lodash/defaultsDeep.js @@ -0,0 +1,30 @@ +var apply = require('./_apply'), + mergeDefaults = require('./_mergeDefaults'), + mergeWith = require('./mergeWith'), + rest = require('./rest'); + +/** + * This method is like `_.defaults` except that it recursively assigns + * default properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } }); + * // => { 'user': { 'name': 'barney', 'age': 36 } } + * + */ +var defaultsDeep = rest(function(args) { + args.push(undefined, mergeDefaults); + return apply(mergeWith, undefined, args); +}); + +module.exports = defaultsDeep; diff --git a/tools/eslint/node_modules/lodash/defer.js b/tools/eslint/node_modules/lodash/defer.js new file mode 100644 index 00000000000000..b096f71b5fa89a --- /dev/null +++ b/tools/eslint/node_modules/lodash/defer.js @@ -0,0 +1,26 @@ +var baseDelay = require('./_baseDelay'), + rest = require('./rest'); + +/** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one or more milliseconds. + */ +var defer = rest(function(func, args) { + return baseDelay(func, 1, args); +}); + +module.exports = defer; diff --git a/tools/eslint/node_modules/lodash/delay.js b/tools/eslint/node_modules/lodash/delay.js new file mode 100644 index 00000000000000..cac90a9bce51ee --- /dev/null +++ b/tools/eslint/node_modules/lodash/delay.js @@ -0,0 +1,28 @@ +var baseDelay = require('./_baseDelay'), + rest = require('./rest'), + toNumber = require('./toNumber'); + +/** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. + */ +var delay = rest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); +}); + +module.exports = delay; diff --git a/tools/eslint/node_modules/lodash/difference.js b/tools/eslint/node_modules/lodash/difference.js new file mode 100644 index 00000000000000..ae34b208bb1884 --- /dev/null +++ b/tools/eslint/node_modules/lodash/difference.js @@ -0,0 +1,30 @@ +var baseDifference = require('./_baseDifference'), + baseFlatten = require('./_baseFlatten'), + isArrayLikeObject = require('./isArrayLikeObject'), + rest = require('./rest'); + +/** + * Creates an array of unique `array` values not included in the other given + * arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. The order of result values is determined by the + * order they occur in the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.difference([3, 2, 1], [4, 2]); + * // => [3, 1] + */ +var difference = rest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) + : []; +}); + +module.exports = difference; diff --git a/tools/eslint/node_modules/lodash/differenceBy.js b/tools/eslint/node_modules/lodash/differenceBy.js new file mode 100644 index 00000000000000..7ec2ae8a21c8ec --- /dev/null +++ b/tools/eslint/node_modules/lodash/differenceBy.js @@ -0,0 +1,42 @@ +var baseDifference = require('./_baseDifference'), + baseFlatten = require('./_baseFlatten'), + baseIteratee = require('./_baseIteratee'), + isArrayLikeObject = require('./isArrayLikeObject'), + last = require('./last'), + rest = require('./rest'); + +/** + * This method is like `_.difference` except that it accepts `iteratee` which + * is invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. Result values are chosen from the first array. + * The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.differenceBy([3.1, 2.2, 1.3], [4.4, 2.5], Math.floor); + * // => [3.1, 1.3] + * + * // The `_.property` iteratee shorthand. + * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ +var differenceBy = rest(function(array, values) { + var iteratee = last(values); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), baseIteratee(iteratee)) + : []; +}); + +module.exports = differenceBy; diff --git a/tools/eslint/node_modules/lodash/differenceWith.js b/tools/eslint/node_modules/lodash/differenceWith.js new file mode 100644 index 00000000000000..6ae89865e82f3f --- /dev/null +++ b/tools/eslint/node_modules/lodash/differenceWith.js @@ -0,0 +1,38 @@ +var baseDifference = require('./_baseDifference'), + baseFlatten = require('./_baseFlatten'), + isArrayLikeObject = require('./isArrayLikeObject'), + last = require('./last'), + rest = require('./rest'); + +/** + * This method is like `_.difference` except that it accepts `comparator` + * which is invoked to compare elements of `array` to `values`. Result values + * are chosen from the first array. The comparator is invoked with two arguments: + * (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * + * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); + * // => [{ 'x': 2, 'y': 1 }] + */ +var differenceWith = rest(function(array, values) { + var comparator = last(values); + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) + : []; +}); + +module.exports = differenceWith; diff --git a/tools/eslint/node_modules/lodash/divide.js b/tools/eslint/node_modules/lodash/divide.js new file mode 100644 index 00000000000000..2889d79928ede4 --- /dev/null +++ b/tools/eslint/node_modules/lodash/divide.js @@ -0,0 +1,22 @@ +var createMathOperation = require('./_createMathOperation'); + +/** + * Divide two numbers. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Math + * @param {number} dividend The first number in a division. + * @param {number} divisor The second number in a division. + * @returns {number} Returns the quotient. + * @example + * + * _.divide(6, 4); + * // => 1.5 + */ +var divide = createMathOperation(function(dividend, divisor) { + return dividend / divisor; +}); + +module.exports = divide; diff --git a/tools/eslint/node_modules/lodash/drop.js b/tools/eslint/node_modules/lodash/drop.js new file mode 100644 index 00000000000000..6124ef76933fa0 --- /dev/null +++ b/tools/eslint/node_modules/lodash/drop.js @@ -0,0 +1,38 @@ +var baseSlice = require('./_baseSlice'), + toInteger = require('./toInteger'); + +/** + * Creates a slice of `array` with `n` elements dropped from the beginning. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.drop([1, 2, 3]); + * // => [2, 3] + * + * _.drop([1, 2, 3], 2); + * // => [3] + * + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] + */ +function drop(array, n, guard) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); +} + +module.exports = drop; diff --git a/tools/eslint/node_modules/lodash/dropRight.js b/tools/eslint/node_modules/lodash/dropRight.js new file mode 100644 index 00000000000000..8aa3576e3fb4d0 --- /dev/null +++ b/tools/eslint/node_modules/lodash/dropRight.js @@ -0,0 +1,39 @@ +var baseSlice = require('./_baseSlice'), + toInteger = require('./toInteger'); + +/** + * Creates a slice of `array` with `n` elements dropped from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRight([1, 2, 3]); + * // => [1, 2] + * + * _.dropRight([1, 2, 3], 2); + * // => [1] + * + * _.dropRight([1, 2, 3], 5); + * // => [] + * + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] + */ +function dropRight(array, n, guard) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, 0, n < 0 ? 0 : n); +} + +module.exports = dropRight; diff --git a/tools/eslint/node_modules/lodash/dropRightWhile.js b/tools/eslint/node_modules/lodash/dropRightWhile.js new file mode 100644 index 00000000000000..98f457b8112a62 --- /dev/null +++ b/tools/eslint/node_modules/lodash/dropRightWhile.js @@ -0,0 +1,46 @@ +var baseIteratee = require('./_baseIteratee'), + baseWhile = require('./_baseWhile'); + +/** + * Creates a slice of `array` excluding elements dropped from the end. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.dropRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney'] + * + * // The `_.matches` iteratee shorthand. + * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropRightWhile(users, ['active', false]); + * // => objects for ['barney'] + * + * // The `_.property` iteratee shorthand. + * _.dropRightWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ +function dropRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, baseIteratee(predicate, 3), true, true) + : []; +} + +module.exports = dropRightWhile; diff --git a/tools/eslint/node_modules/lodash/dropWhile.js b/tools/eslint/node_modules/lodash/dropWhile.js new file mode 100644 index 00000000000000..94f76e01924549 --- /dev/null +++ b/tools/eslint/node_modules/lodash/dropWhile.js @@ -0,0 +1,46 @@ +var baseIteratee = require('./_baseIteratee'), + baseWhile = require('./_baseWhile'); + +/** + * Creates a slice of `array` excluding elements dropped from the beginning. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.dropWhile(users, function(o) { return !o.active; }); + * // => objects for ['pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.dropWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropWhile(users, ['active', false]); + * // => objects for ['pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.dropWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ +function dropWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, baseIteratee(predicate, 3), true) + : []; +} + +module.exports = dropWhile; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/each.js b/tools/eslint/node_modules/lodash/each.js similarity index 100% rename from tools/eslint/node_modules/inquirer/node_modules/lodash/collection/each.js rename to tools/eslint/node_modules/lodash/each.js diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/eachRight.js b/tools/eslint/node_modules/lodash/eachRight.js similarity index 100% rename from tools/eslint/node_modules/inquirer/node_modules/lodash/collection/eachRight.js rename to tools/eslint/node_modules/lodash/eachRight.js diff --git a/tools/eslint/node_modules/lodash/endsWith.js b/tools/eslint/node_modules/lodash/endsWith.js new file mode 100644 index 00000000000000..204d61e9d4baee --- /dev/null +++ b/tools/eslint/node_modules/lodash/endsWith.js @@ -0,0 +1,41 @@ +var baseClamp = require('./_baseClamp'), + toInteger = require('./toInteger'), + toString = require('./toString'); + +/** + * Checks if `string` ends with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to search. + * @param {string} [target] The string to search for. + * @param {number} [position=string.length] The position to search from. + * @returns {boolean} Returns `true` if `string` ends with `target`, + * else `false`. + * @example + * + * _.endsWith('abc', 'c'); + * // => true + * + * _.endsWith('abc', 'b'); + * // => false + * + * _.endsWith('abc', 'b', 2); + * // => true + */ +function endsWith(string, target, position) { + string = toString(string); + target = typeof target == 'string' ? target : (target + ''); + + var length = string.length; + position = position === undefined + ? length + : baseClamp(toInteger(position), 0, length); + + position -= target.length; + return position >= 0 && string.indexOf(target, position) == position; +} + +module.exports = endsWith; diff --git a/tools/eslint/node_modules/lodash/entries.js b/tools/eslint/node_modules/lodash/entries.js new file mode 100644 index 00000000000000..7a88df2044638c --- /dev/null +++ b/tools/eslint/node_modules/lodash/entries.js @@ -0,0 +1 @@ +module.exports = require('./toPairs'); diff --git a/tools/eslint/node_modules/lodash/entriesIn.js b/tools/eslint/node_modules/lodash/entriesIn.js new file mode 100644 index 00000000000000..f6c6331c1de93f --- /dev/null +++ b/tools/eslint/node_modules/lodash/entriesIn.js @@ -0,0 +1 @@ +module.exports = require('./toPairsIn'); diff --git a/tools/eslint/node_modules/lodash/eq.js b/tools/eslint/node_modules/lodash/eq.js new file mode 100644 index 00000000000000..e9445d4fa32237 --- /dev/null +++ b/tools/eslint/node_modules/lodash/eq.js @@ -0,0 +1,37 @@ +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'user': 'fred' }; + * var other = { 'user': 'fred' }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +module.exports = eq; diff --git a/tools/eslint/node_modules/lodash/escape.js b/tools/eslint/node_modules/lodash/escape.js new file mode 100644 index 00000000000000..176417c4c1e930 --- /dev/null +++ b/tools/eslint/node_modules/lodash/escape.js @@ -0,0 +1,49 @@ +var escapeHtmlChar = require('./_escapeHtmlChar'), + toString = require('./toString'); + +/** Used to match HTML entities and HTML characters. */ +var reUnescapedHtml = /[&<>"'`]/g, + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + +/** + * Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to + * their corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * Backticks are escaped because in IE < 9, they can break out of + * attribute values or HTML comments. See [#59](https://html5sec.org/#59), + * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and + * [#133](https://html5sec.org/#133) of the + * [HTML5 Security Cheatsheet](https://html5sec.org/) for more details. + * + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ +function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; +} + +module.exports = escape; diff --git a/tools/eslint/node_modules/lodash/escapeRegExp.js b/tools/eslint/node_modules/lodash/escapeRegExp.js new file mode 100644 index 00000000000000..fe5196046bf19f --- /dev/null +++ b/tools/eslint/node_modules/lodash/escapeRegExp.js @@ -0,0 +1,32 @@ +var toString = require('./toString'); + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, + reHasRegExpChar = RegExp(reRegExpChar.source); + +/** + * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", + * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ +function escapeRegExp(string) { + string = toString(string); + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') + : string; +} + +module.exports = escapeRegExp; diff --git a/tools/eslint/node_modules/lodash/every.js b/tools/eslint/node_modules/lodash/every.js new file mode 100644 index 00000000000000..14f68e744ff0a8 --- /dev/null +++ b/tools/eslint/node_modules/lodash/every.js @@ -0,0 +1,52 @@ +var arrayEvery = require('./_arrayEvery'), + baseEvery = require('./_baseEvery'), + baseIteratee = require('./_baseIteratee'), + isArray = require('./isArray'), + isIterateeCall = require('./_isIterateeCall'); + +/** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false + */ +function every(collection, predicate, guard) { + var func = isArray(collection) ? arrayEvery : baseEvery; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, baseIteratee(predicate, 3)); +} + +module.exports = every; diff --git a/tools/eslint/node_modules/lodash/extend.js b/tools/eslint/node_modules/lodash/extend.js new file mode 100644 index 00000000000000..e00166c206c610 --- /dev/null +++ b/tools/eslint/node_modules/lodash/extend.js @@ -0,0 +1 @@ +module.exports = require('./assignIn'); diff --git a/tools/eslint/node_modules/lodash/extendWith.js b/tools/eslint/node_modules/lodash/extendWith.js new file mode 100644 index 00000000000000..dbdcb3b4e457d3 --- /dev/null +++ b/tools/eslint/node_modules/lodash/extendWith.js @@ -0,0 +1 @@ +module.exports = require('./assignInWith'); diff --git a/tools/eslint/node_modules/lodash/fill.js b/tools/eslint/node_modules/lodash/fill.js new file mode 100644 index 00000000000000..5730b7d1296df4 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fill.js @@ -0,0 +1,45 @@ +var baseFill = require('./_baseFill'), + isIterateeCall = require('./_isIterateeCall'); + +/** + * Fills elements of `array` with `value` from `start` up to, but not + * including, `end`. + * + * **Note:** This method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Array + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.fill(array, 'a'); + * console.log(array); + * // => ['a', 'a', 'a'] + * + * _.fill(Array(3), 2); + * // => [2, 2, 2] + * + * _.fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] + */ +function fill(array, value, start, end) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { + start = 0; + end = length; + } + return baseFill(array, value, start, end); +} + +module.exports = fill; diff --git a/tools/eslint/node_modules/lodash/filter.js b/tools/eslint/node_modules/lodash/filter.js new file mode 100644 index 00000000000000..f6a71a58f484fa --- /dev/null +++ b/tools/eslint/node_modules/lodash/filter.js @@ -0,0 +1,46 @@ +var arrayFilter = require('./_arrayFilter'), + baseFilter = require('./_baseFilter'), + baseIteratee = require('./_baseIteratee'), + isArray = require('./isArray'); + +/** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + */ +function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, baseIteratee(predicate, 3)); +} + +module.exports = filter; diff --git a/tools/eslint/node_modules/lodash/find.js b/tools/eslint/node_modules/lodash/find.js new file mode 100644 index 00000000000000..83f0dbad0d9f11 --- /dev/null +++ b/tools/eslint/node_modules/lodash/find.js @@ -0,0 +1,52 @@ +var baseEach = require('./_baseEach'), + baseFind = require('./_baseFind'), + baseFindIndex = require('./_baseFindIndex'), + baseIteratee = require('./_baseIteratee'), + isArray = require('./isArray'); + +/** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to search. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ +function find(collection, predicate) { + predicate = baseIteratee(predicate, 3); + if (isArray(collection)) { + var index = baseFindIndex(collection, predicate); + return index > -1 ? collection[index] : undefined; + } + return baseFind(collection, predicate, baseEach); +} + +module.exports = find; diff --git a/tools/eslint/node_modules/lodash/findIndex.js b/tools/eslint/node_modules/lodash/findIndex.js new file mode 100644 index 00000000000000..84acc7464282ea --- /dev/null +++ b/tools/eslint/node_modules/lodash/findIndex.js @@ -0,0 +1,45 @@ +var baseFindIndex = require('./_baseFindIndex'), + baseIteratee = require('./_baseIteratee'); + +/** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to search. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ +function findIndex(array, predicate) { + return (array && array.length) + ? baseFindIndex(array, baseIteratee(predicate, 3)) + : -1; +} + +module.exports = findIndex; diff --git a/tools/eslint/node_modules/lodash/findKey.js b/tools/eslint/node_modules/lodash/findKey.js new file mode 100644 index 00000000000000..16a9fd9ae8ef54 --- /dev/null +++ b/tools/eslint/node_modules/lodash/findKey.js @@ -0,0 +1,45 @@ +var baseFind = require('./_baseFind'), + baseForOwn = require('./_baseForOwn'), + baseIteratee = require('./_baseIteratee'); + +/** + * This method is like `_.find` except that it returns the key of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Object + * @param {Object} object The object to search. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findKey(users, function(o) { return o.age < 40; }); + * // => 'barney' (iteration order is not guaranteed) + * + * // The `_.matches` iteratee shorthand. + * _.findKey(users, { 'age': 1, 'active': true }); + * // => 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findKey(users, 'active'); + * // => 'barney' + */ +function findKey(object, predicate) { + return baseFind(object, baseIteratee(predicate, 3), baseForOwn, true); +} + +module.exports = findKey; diff --git a/tools/eslint/node_modules/lodash/findLast.js b/tools/eslint/node_modules/lodash/findLast.js new file mode 100644 index 00000000000000..d222a5588fab46 --- /dev/null +++ b/tools/eslint/node_modules/lodash/findLast.js @@ -0,0 +1,35 @@ +var baseEachRight = require('./_baseEachRight'), + baseFind = require('./_baseFind'), + baseFindIndex = require('./_baseFindIndex'), + baseIteratee = require('./_baseIteratee'), + isArray = require('./isArray'); + +/** + * This method is like `_.find` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to search. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(n) { + * return n % 2 == 1; + * }); + * // => 3 + */ +function findLast(collection, predicate) { + predicate = baseIteratee(predicate, 3); + if (isArray(collection)) { + var index = baseFindIndex(collection, predicate, true); + return index > -1 ? collection[index] : undefined; + } + return baseFind(collection, predicate, baseEachRight); +} + +module.exports = findLast; diff --git a/tools/eslint/node_modules/lodash/findLastIndex.js b/tools/eslint/node_modules/lodash/findLastIndex.js new file mode 100644 index 00000000000000..bf397d8fff559c --- /dev/null +++ b/tools/eslint/node_modules/lodash/findLastIndex.js @@ -0,0 +1,45 @@ +var baseFindIndex = require('./_baseFindIndex'), + baseIteratee = require('./_baseIteratee'); + +/** + * This method is like `_.findIndex` except that it iterates over elements + * of `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to search. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); + * // => 2 + * + * // The `_.matches` iteratee shorthand. + * _.findLastIndex(users, { 'user': 'barney', 'active': true }); + * // => 0 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastIndex(users, ['active', false]); + * // => 2 + * + * // The `_.property` iteratee shorthand. + * _.findLastIndex(users, 'active'); + * // => 0 + */ +function findLastIndex(array, predicate) { + return (array && array.length) + ? baseFindIndex(array, baseIteratee(predicate, 3), true) + : -1; +} + +module.exports = findLastIndex; diff --git a/tools/eslint/node_modules/lodash/findLastKey.js b/tools/eslint/node_modules/lodash/findLastKey.js new file mode 100644 index 00000000000000..fb915df4644b03 --- /dev/null +++ b/tools/eslint/node_modules/lodash/findLastKey.js @@ -0,0 +1,45 @@ +var baseFind = require('./_baseFind'), + baseForOwnRight = require('./_baseForOwnRight'), + baseIteratee = require('./_baseIteratee'); + +/** + * This method is like `_.findKey` except that it iterates over elements of + * a collection in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to search. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findLastKey(users, function(o) { return o.age < 40; }); + * // => returns 'pebbles' assuming `_.findKey` returns 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.findLastKey(users, { 'age': 36, 'active': true }); + * // => 'barney' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findLastKey(users, 'active'); + * // => 'pebbles' + */ +function findLastKey(object, predicate) { + return baseFind(object, baseIteratee(predicate, 3), baseForOwnRight, true); +} + +module.exports = findLastKey; diff --git a/tools/eslint/node_modules/lodash/flatMap.js b/tools/eslint/node_modules/lodash/flatMap.js new file mode 100644 index 00000000000000..f8307495f8cde3 --- /dev/null +++ b/tools/eslint/node_modules/lodash/flatMap.js @@ -0,0 +1,30 @@ +var baseFlatten = require('./_baseFlatten'), + map = require('./map'); + +/** + * Creates a flattened array of values by running each element in `collection` + * thru `iteratee` and flattening the mapped results. The iteratee is invoked + * with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [n, n]; + * } + * + * _.flatMap([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ +function flatMap(collection, iteratee) { + return baseFlatten(map(collection, iteratee), 1); +} + +module.exports = flatMap; diff --git a/tools/eslint/node_modules/lodash/flatMapDeep.js b/tools/eslint/node_modules/lodash/flatMapDeep.js new file mode 100644 index 00000000000000..3808262aab0f80 --- /dev/null +++ b/tools/eslint/node_modules/lodash/flatMapDeep.js @@ -0,0 +1,32 @@ +var baseFlatten = require('./_baseFlatten'), + map = require('./map'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ +function flatMapDeep(collection, iteratee) { + return baseFlatten(map(collection, iteratee), INFINITY); +} + +module.exports = flatMapDeep; diff --git a/tools/eslint/node_modules/lodash/flatMapDepth.js b/tools/eslint/node_modules/lodash/flatMapDepth.js new file mode 100644 index 00000000000000..d528bff265c493 --- /dev/null +++ b/tools/eslint/node_modules/lodash/flatMapDepth.js @@ -0,0 +1,32 @@ +var baseFlatten = require('./_baseFlatten'), + map = require('./map'), + toInteger = require('./toInteger'); + +/** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] + */ +function flatMapDepth(collection, iteratee, depth) { + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(map(collection, iteratee), depth); +} + +module.exports = flatMapDepth; diff --git a/tools/eslint/node_modules/lodash/flatten.js b/tools/eslint/node_modules/lodash/flatten.js new file mode 100644 index 00000000000000..bd4f439789ac2a --- /dev/null +++ b/tools/eslint/node_modules/lodash/flatten.js @@ -0,0 +1,22 @@ +var baseFlatten = require('./_baseFlatten'); + +/** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ +function flatten(array) { + var length = array ? array.length : 0; + return length ? baseFlatten(array, 1) : []; +} + +module.exports = flatten; diff --git a/tools/eslint/node_modules/lodash/flattenDeep.js b/tools/eslint/node_modules/lodash/flattenDeep.js new file mode 100644 index 00000000000000..c20c781a84b6a5 --- /dev/null +++ b/tools/eslint/node_modules/lodash/flattenDeep.js @@ -0,0 +1,25 @@ +var baseFlatten = require('./_baseFlatten'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** + * Recursively flattens `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ +function flattenDeep(array) { + var length = array ? array.length : 0; + return length ? baseFlatten(array, INFINITY) : []; +} + +module.exports = flattenDeep; diff --git a/tools/eslint/node_modules/lodash/flattenDepth.js b/tools/eslint/node_modules/lodash/flattenDepth.js new file mode 100644 index 00000000000000..a0f4b5259a556d --- /dev/null +++ b/tools/eslint/node_modules/lodash/flattenDepth.js @@ -0,0 +1,33 @@ +var baseFlatten = require('./_baseFlatten'), + toInteger = require('./toInteger'); + +/** + * Recursively flatten `array` up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Array + * @param {Array} array The array to flatten. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * var array = [1, [2, [3, [4]], 5]]; + * + * _.flattenDepth(array, 1); + * // => [1, 2, [3, [4]], 5] + * + * _.flattenDepth(array, 2); + * // => [1, 2, 3, [4], 5] + */ +function flattenDepth(array, depth) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(array, depth); +} + +module.exports = flattenDepth; diff --git a/tools/eslint/node_modules/lodash/flip.js b/tools/eslint/node_modules/lodash/flip.js new file mode 100644 index 00000000000000..82f796c240aed9 --- /dev/null +++ b/tools/eslint/node_modules/lodash/flip.js @@ -0,0 +1,28 @@ +var createWrapper = require('./_createWrapper'); + +/** Used to compose bitmasks for wrapper metadata. */ +var FLIP_FLAG = 512; + +/** + * Creates a function that invokes `func` with arguments reversed. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to flip arguments for. + * @returns {Function} Returns the new function. + * @example + * + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); + * + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] + */ +function flip(func) { + return createWrapper(func, FLIP_FLAG); +} + +module.exports = flip; diff --git a/tools/eslint/node_modules/lodash/floor.js b/tools/eslint/node_modules/lodash/floor.js new file mode 100644 index 00000000000000..ab6dfa28a4c591 --- /dev/null +++ b/tools/eslint/node_modules/lodash/floor.js @@ -0,0 +1,26 @@ +var createRound = require('./_createRound'); + +/** + * Computes `number` rounded down to `precision`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Math + * @param {number} number The number to round down. + * @param {number} [precision=0] The precision to round down to. + * @returns {number} Returns the rounded down number. + * @example + * + * _.floor(4.006); + * // => 4 + * + * _.floor(0.046, 2); + * // => 0.04 + * + * _.floor(4060, -2); + * // => 4000 + */ +var floor = createRound('floor'); + +module.exports = floor; diff --git a/tools/eslint/node_modules/lodash/flow.js b/tools/eslint/node_modules/lodash/flow.js new file mode 100644 index 00000000000000..004cda01a495c8 --- /dev/null +++ b/tools/eslint/node_modules/lodash/flow.js @@ -0,0 +1,26 @@ +var createFlow = require('./_createFlow'); + +/** + * Creates a function that returns the result of invoking the given functions + * with the `this` binding of the created function, where each successive + * invocation is supplied the return value of the previous. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Util + * @param {...(Function|Function[])} [funcs] Functions to invoke. + * @returns {Function} Returns the new function. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var addSquare = _.flow(_.add, square); + * addSquare(1, 2); + * // => 9 + */ +var flow = createFlow(); + +module.exports = flow; diff --git a/tools/eslint/node_modules/lodash/flowRight.js b/tools/eslint/node_modules/lodash/flowRight.js new file mode 100644 index 00000000000000..f543f252f1a908 --- /dev/null +++ b/tools/eslint/node_modules/lodash/flowRight.js @@ -0,0 +1,25 @@ +var createFlow = require('./_createFlow'); + +/** + * This method is like `_.flow` except that it creates a function that + * invokes the given functions from right to left. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {...(Function|Function[])} [funcs] Functions to invoke. + * @returns {Function} Returns the new function. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var addSquare = _.flowRight(square, _.add); + * addSquare(1, 2); + * // => 9 + */ +var flowRight = createFlow(true); + +module.exports = flowRight; diff --git a/tools/eslint/node_modules/lodash/forEach.js b/tools/eslint/node_modules/lodash/forEach.js new file mode 100644 index 00000000000000..5f8d9b015cda87 --- /dev/null +++ b/tools/eslint/node_modules/lodash/forEach.js @@ -0,0 +1,41 @@ +var arrayEach = require('./_arrayEach'), + baseEach = require('./_baseEach'), + baseIteratee = require('./_baseIteratee'), + isArray = require('./isArray'); + +/** + * Iterates over elements of `collection` invoking `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @example + * + * _([1, 2]).forEach(function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ +function forEach(collection, iteratee) { + return (typeof iteratee == 'function' && isArray(collection)) + ? arrayEach(collection, iteratee) + : baseEach(collection, baseIteratee(iteratee)); +} + +module.exports = forEach; diff --git a/tools/eslint/node_modules/lodash/forEachRight.js b/tools/eslint/node_modules/lodash/forEachRight.js new file mode 100644 index 00000000000000..17a7137cbd1256 --- /dev/null +++ b/tools/eslint/node_modules/lodash/forEachRight.js @@ -0,0 +1,31 @@ +var arrayEachRight = require('./_arrayEachRight'), + baseEachRight = require('./_baseEachRight'), + baseIteratee = require('./_baseIteratee'), + isArray = require('./isArray'); + +/** + * This method is like `_.forEach` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @alias eachRight + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @example + * + * _.forEachRight([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `2` then `1`. + */ +function forEachRight(collection, iteratee) { + return (typeof iteratee == 'function' && isArray(collection)) + ? arrayEachRight(collection, iteratee) + : baseEachRight(collection, baseIteratee(iteratee)); +} + +module.exports = forEachRight; diff --git a/tools/eslint/node_modules/lodash/forIn.js b/tools/eslint/node_modules/lodash/forIn.js new file mode 100644 index 00000000000000..811237f6572471 --- /dev/null +++ b/tools/eslint/node_modules/lodash/forIn.js @@ -0,0 +1,38 @@ +var baseFor = require('./_baseFor'), + baseIteratee = require('./_baseIteratee'), + keysIn = require('./keysIn'); + +/** + * Iterates over own and inherited enumerable string keyed properties of an + * object invoking `iteratee` for each property. The iteratee is invoked with + * three arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forIn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). + */ +function forIn(object, iteratee) { + return object == null + ? object + : baseFor(object, baseIteratee(iteratee), keysIn); +} + +module.exports = forIn; diff --git a/tools/eslint/node_modules/lodash/forInRight.js b/tools/eslint/node_modules/lodash/forInRight.js new file mode 100644 index 00000000000000..00b73a7c1a9440 --- /dev/null +++ b/tools/eslint/node_modules/lodash/forInRight.js @@ -0,0 +1,36 @@ +var baseForRight = require('./_baseForRight'), + baseIteratee = require('./_baseIteratee'), + keysIn = require('./keysIn'); + +/** + * This method is like `_.forIn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forInRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. + */ +function forInRight(object, iteratee) { + return object == null + ? object + : baseForRight(object, baseIteratee(iteratee), keysIn); +} + +module.exports = forInRight; diff --git a/tools/eslint/node_modules/lodash/forOwn.js b/tools/eslint/node_modules/lodash/forOwn.js new file mode 100644 index 00000000000000..a680e53a004bcb --- /dev/null +++ b/tools/eslint/node_modules/lodash/forOwn.js @@ -0,0 +1,35 @@ +var baseForOwn = require('./_baseForOwn'), + baseIteratee = require('./_baseIteratee'); + +/** + * Iterates over own enumerable string keyed properties of an object invoking + * `iteratee` for each property. The iteratee is invoked with three arguments: + * (value, key, object). Iteratee functions may exit iteration early by + * explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ +function forOwn(object, iteratee) { + return object && baseForOwn(object, baseIteratee(iteratee)); +} + +module.exports = forOwn; diff --git a/tools/eslint/node_modules/lodash/forOwnRight.js b/tools/eslint/node_modules/lodash/forOwnRight.js new file mode 100644 index 00000000000000..5605475f48465b --- /dev/null +++ b/tools/eslint/node_modules/lodash/forOwnRight.js @@ -0,0 +1,33 @@ +var baseForOwnRight = require('./_baseForOwnRight'), + baseIteratee = require('./_baseIteratee'); + +/** + * This method is like `_.forOwn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwnRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. + */ +function forOwnRight(object, iteratee) { + return object && baseForOwnRight(object, baseIteratee(iteratee)); +} + +module.exports = forOwnRight; diff --git a/tools/eslint/node_modules/lodash/fp.js b/tools/eslint/node_modules/lodash/fp.js new file mode 100644 index 00000000000000..e372dbbdf6d539 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp.js @@ -0,0 +1,2 @@ +var _ = require('./lodash.min').runInContext(); +module.exports = require('./fp/_baseConvert')(_, _); diff --git a/tools/eslint/node_modules/lodash/fp/__.js b/tools/eslint/node_modules/lodash/fp/__.js new file mode 100644 index 00000000000000..4af98deb4e9cca --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/__.js @@ -0,0 +1 @@ +module.exports = require('./placeholder'); diff --git a/tools/eslint/node_modules/lodash/fp/_baseConvert.js b/tools/eslint/node_modules/lodash/fp/_baseConvert.js new file mode 100644 index 00000000000000..e7e631ce4bbb01 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/_baseConvert.js @@ -0,0 +1,469 @@ +var mapping = require('./_mapping'), + mutateMap = mapping.mutate, + fallbackHolder = require('./placeholder'); + +/** + * Creates a function, with an arity of `n`, that invokes `func` with the + * arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} n The arity of the new function. + * @returns {Function} Returns the new function. + */ +function baseArity(func, n) { + return n == 2 + ? function(a, b) { return func.apply(undefined, arguments); } + : function(a) { return func.apply(undefined, arguments); }; +} + +/** + * Creates a function that invokes `func`, with up to `n` arguments, ignoring + * any additional arguments. + * + * @private + * @param {Function} func The function to cap arguments for. + * @param {number} n The arity cap. + * @returns {Function} Returns the new function. + */ +function baseAry(func, n) { + return n == 2 + ? function(a, b) { return func(a, b); } + : function(a) { return func(a); }; +} + +/** + * Creates a clone of `array`. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the cloned array. + */ +function cloneArray(array) { + var length = array ? array.length : 0, + result = Array(length); + + while (length--) { + result[length] = array[length]; + } + return result; +} + +/** + * Creates a function that clones a given object using the assignment `func`. + * + * @private + * @param {Function} func The assignment function. + * @returns {Function} Returns the new cloner function. + */ +function createCloner(func) { + return function(object) { + return func({}, object); + }; +} + +/** + * Creates a function that wraps `func` and uses `cloner` to clone the first + * argument it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} cloner The function to clone arguments. + * @returns {Function} Returns the new immutable function. + */ +function immutWrap(func, cloner) { + return function() { + var length = arguments.length; + if (!length) { + return result; + } + var args = Array(length); + while (length--) { + args[length] = arguments[length]; + } + var result = args[0] = cloner.apply(undefined, args); + func.apply(undefined, args); + return result; + }; +} + +/** + * The base implementation of `convert` which accepts a `util` object of methods + * required to perform conversions. + * + * @param {Object} util The util object. + * @param {string} name The name of the function to convert. + * @param {Function} func The function to convert. + * @param {Object} [options] The options object. + * @param {boolean} [options.cap=true] Specify capping iteratee arguments. + * @param {boolean} [options.curry=true] Specify currying. + * @param {boolean} [options.fixed=true] Specify fixed arity. + * @param {boolean} [options.immutable=true] Specify immutable operations. + * @param {boolean} [options.rearg=true] Specify rearranging arguments. + * @returns {Function|Object} Returns the converted function or object. + */ +function baseConvert(util, name, func, options) { + var setPlaceholder, + isLib = typeof name == 'function', + isObj = name === Object(name); + + if (isObj) { + options = func; + func = name; + name = undefined; + } + if (func == null) { + throw new TypeError; + } + options || (options = {}); + + var config = { + 'cap': 'cap' in options ? options.cap : true, + 'curry': 'curry' in options ? options.curry : true, + 'fixed': 'fixed' in options ? options.fixed : true, + 'immutable': 'immutable' in options ? options.immutable : true, + 'rearg': 'rearg' in options ? options.rearg : true + }; + + var forceCurry = ('curry' in options) && options.curry, + forceFixed = ('fixed' in options) && options.fixed, + forceRearg = ('rearg' in options) && options.rearg, + placeholder = isLib ? func : fallbackHolder, + pristine = isLib ? func.runInContext() : undefined; + + var helpers = isLib ? func : { + 'ary': util.ary, + 'assign': util.assign, + 'clone': util.clone, + 'curry': util.curry, + 'forEach': util.forEach, + 'isArray': util.isArray, + 'isFunction': util.isFunction, + 'iteratee': util.iteratee, + 'keys': util.keys, + 'rearg': util.rearg, + 'spread': util.spread, + 'toPath': util.toPath + }; + + var ary = helpers.ary, + assign = helpers.assign, + clone = helpers.clone, + curry = helpers.curry, + each = helpers.forEach, + isArray = helpers.isArray, + isFunction = helpers.isFunction, + keys = helpers.keys, + rearg = helpers.rearg, + spread = helpers.spread, + toPath = helpers.toPath; + + var aryMethodKeys = keys(mapping.aryMethod); + + var wrappers = { + 'castArray': function(castArray) { + return function() { + var value = arguments[0]; + return isArray(value) + ? castArray(cloneArray(value)) + : castArray.apply(undefined, arguments); + }; + }, + 'iteratee': function(iteratee) { + return function() { + var func = arguments[0], + arity = arguments[1], + result = iteratee(func, arity), + length = result.length; + + if (config.cap && typeof arity == 'number') { + arity = arity > 2 ? (arity - 2) : 1; + return (length && length <= arity) ? result : baseAry(result, arity); + } + return result; + }; + }, + 'mixin': function(mixin) { + return function(source) { + var func = this; + if (!isFunction(func)) { + return mixin(func, Object(source)); + } + var methods = [], + methodNames = []; + + each(keys(source), function(key) { + var value = source[key]; + if (isFunction(value)) { + methodNames.push(key); + methods.push(func.prototype[key]); + } + }); + + mixin(func, Object(source)); + + each(methodNames, function(methodName, index) { + var method = methods[index]; + if (isFunction(method)) { + func.prototype[methodName] = method; + } else { + delete func.prototype[methodName]; + } + }); + return func; + }; + }, + 'runInContext': function(runInContext) { + return function(context) { + return baseConvert(util, runInContext(context), options); + }; + } + }; + + /*--------------------------------------------------------------------------*/ + + /** + * Creates a clone of `object` by `path`. + * + * @private + * @param {Object} object The object to clone. + * @param {Array|string} path The path to clone by. + * @returns {Object} Returns the cloned object. + */ + function cloneByPath(object, path) { + path = toPath(path); + + var index = -1, + length = path.length, + result = clone(Object(object)), + nested = result; + + while (nested != null && ++index < length) { + var key = path[index], + value = nested[key]; + + if (value != null) { + nested[key] = clone(Object(value)); + } + nested = nested[key]; + } + return result; + } + + /** + * Converts `lodash` to an immutable auto-curried iteratee-first data-last + * version with conversion `options` applied. + * + * @param {Object} [options] The options object. See `baseConvert` for more details. + * @returns {Function} Returns the converted `lodash`. + */ + function convertLib(options) { + return _.runInContext.convert(options)(undefined); + } + + /** + * Create a converter function for `func` of `name`. + * + * @param {string} name The name of the function to convert. + * @param {Function} func The function to convert. + * @returns {Function} Returns the new converter function. + */ + function createConverter(name, func) { + var oldOptions = options; + return function(options) { + var newUtil = isLib ? pristine : helpers, + newFunc = isLib ? pristine[name] : func, + newOptions = assign(assign({}, oldOptions), options); + + return baseConvert(newUtil, name, newFunc, newOptions); + }; + } + + /** + * Creates a function that wraps `func` to invoke its iteratee, with up to `n` + * arguments, ignoring any additional arguments. + * + * @private + * @param {Function} func The function to cap iteratee arguments for. + * @param {number} n The arity cap. + * @returns {Function} Returns the new function. + */ + function iterateeAry(func, n) { + return overArg(func, function(func) { + return typeof func == 'function' ? baseAry(func, n) : func; + }); + } + + /** + * Creates a function that wraps `func` to invoke its iteratee with arguments + * arranged according to the specified `indexes` where the argument value at + * the first index is provided as the first argument, the argument value at + * the second index is provided as the second argument, and so on. + * + * @private + * @param {Function} func The function to rearrange iteratee arguments for. + * @param {number[]} indexes The arranged argument indexes. + * @returns {Function} Returns the new function. + */ + function iterateeRearg(func, indexes) { + return overArg(func, function(func) { + var n = indexes.length; + return baseArity(rearg(baseAry(func, n), indexes), n); + }); + } + + /** + * Creates a function that invokes `func` with its first argument passed + * thru `transform`. + * + * @private + * @param {Function} func The function to wrap. + * @param {...Function} transform The functions to transform the first argument. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function() { + var length = arguments.length; + if (!length) { + return func(); + } + var args = Array(length); + while (length--) { + args[length] = arguments[length]; + } + var index = config.rearg ? 0 : (length - 1); + args[index] = transform(args[index]); + return func.apply(undefined, args); + }; + } + + /** + * Creates a function that wraps `func` and applys the conversions + * rules by `name`. + * + * @private + * @param {string} name The name of the function to wrap. + * @param {Function} func The function to wrap. + * @returns {Function} Returns the converted function. + */ + function wrap(name, func) { + name = mapping.aliasToReal[name] || name; + + var result, + wrapped = func, + wrapper = wrappers[name]; + + if (wrapper) { + wrapped = wrapper(func); + } + else if (config.immutable) { + if (mutateMap.array[name]) { + wrapped = immutWrap(func, cloneArray); + } + else if (mutateMap.object[name]) { + wrapped = immutWrap(func, createCloner(func)); + } + else if (mutateMap.set[name]) { + wrapped = immutWrap(func, cloneByPath); + } + } + each(aryMethodKeys, function(aryKey) { + each(mapping.aryMethod[aryKey], function(otherName) { + if (name == otherName) { + var aryN = !isLib && mapping.iterateeAry[name], + reargIndexes = mapping.iterateeRearg[name], + spreadStart = mapping.methodSpread[name]; + + result = wrapped; + if (config.fixed && (forceFixed || !mapping.skipFixed[name])) { + result = spreadStart === undefined + ? ary(result, aryKey) + : spread(result, spreadStart); + } + if (config.rearg && aryKey > 1 && (forceRearg || !mapping.skipRearg[name])) { + result = rearg(result, mapping.methodRearg[name] || mapping.aryRearg[aryKey]); + } + if (config.cap) { + if (reargIndexes) { + result = iterateeRearg(result, reargIndexes); + } else if (aryN) { + result = iterateeAry(result, aryN); + } + } + if (forceCurry || (config.curry && aryKey > 1)) { + forceCurry && console.log(forceCurry, name); + result = curry(result, aryKey); + } + return false; + } + }); + return !result; + }); + + result || (result = wrapped); + if (result == func) { + result = forceCurry ? curry(result, 1) : function() { + return func.apply(this, arguments); + }; + } + result.convert = createConverter(name, func); + if (mapping.placeholder[name]) { + setPlaceholder = true; + result.placeholder = func.placeholder = placeholder; + } + return result; + } + + /*--------------------------------------------------------------------------*/ + + if (!isObj) { + return wrap(name, func); + } + var _ = func; + + // Convert methods by ary cap. + var pairs = []; + each(aryMethodKeys, function(aryKey) { + each(mapping.aryMethod[aryKey], function(key) { + var func = _[mapping.remap[key] || key]; + if (func) { + pairs.push([key, wrap(key, func)]); + } + }); + }); + + // Convert remaining methods. + each(keys(_), function(key) { + var func = _[key]; + if (typeof func == 'function') { + var length = pairs.length; + while (length--) { + if (pairs[length][0] == key) { + return; + } + } + func.convert = createConverter(key, func); + pairs.push([key, func]); + } + }); + + // Assign to `_` leaving `_.prototype` unchanged to allow chaining. + each(pairs, function(pair) { + _[pair[0]] = pair[1]; + }); + + _.convert = convertLib; + if (setPlaceholder) { + _.placeholder = placeholder; + } + // Assign aliases. + each(keys(_), function(key) { + each(mapping.realToAlias[key] || [], function(alias) { + _[alias] = _[key]; + }); + }); + + return _; +} + +module.exports = baseConvert; diff --git a/tools/eslint/node_modules/lodash/fp/_convertBrowser.js b/tools/eslint/node_modules/lodash/fp/_convertBrowser.js new file mode 100644 index 00000000000000..1874a5423cccb5 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/_convertBrowser.js @@ -0,0 +1,18 @@ +var baseConvert = require('./_baseConvert'); + +/** + * Converts `lodash` to an immutable auto-curried iteratee-first data-last + * version with conversion `options` applied. + * + * @param {Function} lodash The lodash function to convert. + * @param {Object} [options] The options object. See `baseConvert` for more details. + * @returns {Function} Returns the converted `lodash`. + */ +function browserConvert(lodash, options) { + return baseConvert(lodash, lodash, options); +} + +if (typeof _ == 'function') { + _ = browserConvert(_.runInContext()); +} +module.exports = browserConvert; diff --git a/tools/eslint/node_modules/lodash/fp/_falseOptions.js b/tools/eslint/node_modules/lodash/fp/_falseOptions.js new file mode 100644 index 00000000000000..773235e3437296 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/_falseOptions.js @@ -0,0 +1,7 @@ +module.exports = { + 'cap': false, + 'curry': false, + 'fixed': false, + 'immutable': false, + 'rearg': false +}; diff --git a/tools/eslint/node_modules/lodash/fp/_mapping.js b/tools/eslint/node_modules/lodash/fp/_mapping.js new file mode 100644 index 00000000000000..d9d43fd93805e7 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/_mapping.js @@ -0,0 +1,287 @@ +/** Used to map aliases to their real names. */ +exports.aliasToReal = { + + // Lodash aliases. + 'each': 'forEach', + 'eachRight': 'forEachRight', + 'entries': 'toPairs', + 'entriesIn': 'toPairsIn', + 'extend': 'assignIn', + 'extendWith': 'assignInWith', + 'first': 'head', + + // Ramda aliases. + '__': 'placeholder', + 'all': 'every', + 'allPass': 'overEvery', + 'always': 'constant', + 'any': 'some', + 'anyPass': 'overSome', + 'apply': 'spread', + 'assoc': 'set', + 'assocPath': 'set', + 'complement': 'negate', + 'compose': 'flowRight', + 'contains': 'includes', + 'dissoc': 'unset', + 'dissocPath': 'unset', + 'equals': 'isEqual', + 'identical': 'eq', + 'init': 'initial', + 'invertObj': 'invert', + 'juxt': 'over', + 'mapObj': 'mapValues', + 'omitAll': 'omit', + 'nAry': 'ary', + 'path': 'get', + 'pathEq': 'matchesProperty', + 'pathOr': 'getOr', + 'pickAll': 'pick', + 'pipe': 'flow', + 'prop': 'get', + 'propOf': 'propertyOf', + 'propOr': 'getOr', + 'unapply': 'rest', + 'unnest': 'flatten', + 'useWith': 'overArgs', + 'whereEq': 'filter', + 'zipObj': 'zipObject' +}; + +/** Used to map ary to method names. */ +exports.aryMethod = { + '1': [ + 'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'floor', + 'flow', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', + 'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest', 'reverse', + 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart', + 'uniqueId', 'words' + ], + '2': [ + 'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindAll', + 'bindKey', 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN', + 'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference', + 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', + 'eq', 'every', 'filter', 'find', 'find', 'findIndex', 'findKey', 'findLast', + 'findLastIndex', 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', + 'forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', + 'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', + 'intersection', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', + 'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', + 'matchesProperty', 'maxBy', 'meanBy', 'merge', 'minBy', 'multiply', 'omit', 'omitBy', + 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial', 'partialRight', + 'partition', 'pick', 'pickBy', 'pull', 'pullAll', 'pullAt', 'random', 'range', + 'rangeRight', 'rearg', 'reject', 'remove', 'repeat', 'restFrom', 'result', + 'sampleSize', 'some', 'sortBy', 'sortedIndex', 'sortedIndexOf', 'sortedLastIndex', + 'sortedLastIndexOf', 'sortedUniqBy', 'split', 'spreadFrom', 'startsWith', + 'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile', 'takeWhile', 'tap', + 'throttle', 'thru', 'times', 'trimChars', 'trimCharsEnd', 'trimCharsStart', + 'truncate', 'union', 'uniqBy', 'uniqWith', 'unset', 'unzipWith', 'without', + 'wrap', 'xor', 'zip', 'zipObject', 'zipObjectDeep' + ], + '3': [ + 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith', + 'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'invokeArgs', + 'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth', 'mergeWith', + 'orderBy', 'padChars', 'padCharsEnd', 'padCharsStart', 'pullAllBy', + 'pullAllWith', 'reduce', 'reduceRight', 'replace', 'set', 'slice', + 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith', + 'update', 'xorBy', 'xorWith', 'zipWith' + ], + '4': [ + 'fill', 'setWith', 'updateWith' + ] +}; + +/** Used to map ary to rearg configs. */ +exports.aryRearg = { + '2': [1, 0], + '3': [2, 0, 1], + '4': [3, 2, 0, 1] +}; + +/** Used to map method names to their iteratee ary. */ +exports.iterateeAry = { + 'dropRightWhile': 1, + 'dropWhile': 1, + 'every': 1, + 'filter': 1, + 'find': 1, + 'findIndex': 1, + 'findKey': 1, + 'findLast': 1, + 'findLastIndex': 1, + 'findLastKey': 1, + 'flatMap': 1, + 'flatMapDeep': 1, + 'flatMapDepth': 1, + 'forEach': 1, + 'forEachRight': 1, + 'forIn': 1, + 'forInRight': 1, + 'forOwn': 1, + 'forOwnRight': 1, + 'map': 1, + 'mapKeys': 1, + 'mapValues': 1, + 'partition': 1, + 'reduce': 2, + 'reduceRight': 2, + 'reject': 1, + 'remove': 1, + 'some': 1, + 'takeRightWhile': 1, + 'takeWhile': 1, + 'times': 1, + 'transform': 2 +}; + +/** Used to map method names to iteratee rearg configs. */ +exports.iterateeRearg = { + 'mapKeys': [1] +}; + +/** Used to map method names to rearg configs. */ +exports.methodRearg = { + 'assignInWith': [1, 2, 0], + 'assignWith': [1, 2, 0], + 'getOr': [2, 1, 0], + 'isEqualWith': [1, 2, 0], + 'isMatchWith': [2, 1, 0], + 'mergeWith': [1, 2, 0], + 'padChars': [2, 1, 0], + 'padCharsEnd': [2, 1, 0], + 'padCharsStart': [2, 1, 0], + 'pullAllBy': [2, 1, 0], + 'pullAllWith': [2, 1, 0], + 'setWith': [3, 1, 2, 0], + 'sortedIndexBy': [2, 1, 0], + 'sortedLastIndexBy': [2, 1, 0], + 'updateWith': [3, 1, 2, 0], + 'zipWith': [1, 2, 0] +}; + +/** Used to map method names to spread configs. */ +exports.methodSpread = { + 'invokeArgs': 2, + 'invokeArgsMap': 2, + 'partial': 1, + 'partialRight': 1, + 'without': 1 +}; + +/** Used to identify methods which mutate arrays or objects. */ +exports.mutate = { + 'array': { + 'fill': true, + 'pull': true, + 'pullAll': true, + 'pullAllBy': true, + 'pullAllWith': true, + 'pullAt': true, + 'remove': true, + 'reverse': true + }, + 'object': { + 'assign': true, + 'assignIn': true, + 'assignInWith': true, + 'assignWith': true, + 'defaults': true, + 'defaultsDeep': true, + 'merge': true, + 'mergeWith': true + }, + 'set': { + 'set': true, + 'setWith': true, + 'unset': true, + 'update': true, + 'updateWith': true + } +}; + +/** Used to track methods with placeholder support */ +exports.placeholder = { + 'bind': true, + 'bindKey': true, + 'curry': true, + 'curryRight': true, + 'partial': true, + 'partialRight': true +}; + +/** Used to map real names to their aliases. */ +exports.realToAlias = (function() { + var hasOwnProperty = Object.prototype.hasOwnProperty, + object = exports.aliasToReal, + result = {}; + + for (var key in object) { + var value = object[key]; + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } + } + return result; +}()); + +/** Used to map method names to other names. */ +exports.remap = { + 'curryN': 'curry', + 'curryRightN': 'curryRight', + 'getOr': 'get', + 'invokeArgs': 'invoke', + 'invokeArgsMap': 'invokeMap', + 'padChars': 'pad', + 'padCharsEnd': 'padEnd', + 'padCharsStart': 'padStart', + 'restFrom': 'rest', + 'spreadFrom': 'spread', + 'trimChars': 'trim', + 'trimCharsEnd': 'trimEnd', + 'trimCharsStart': 'trimStart' +}; + +/** Used to track methods that skip fixing their arity. */ +exports.skipFixed = { + 'castArray': true, + 'flow': true, + 'flowRight': true, + 'iteratee': true, + 'mixin': true, + 'runInContext': true +}; + +/** Used to track methods that skip rearranging arguments. */ +exports.skipRearg = { + 'add': true, + 'assign': true, + 'assignIn': true, + 'bind': true, + 'bindKey': true, + 'concat': true, + 'difference': true, + 'divide': true, + 'eq': true, + 'gt': true, + 'gte': true, + 'isEqual': true, + 'lt': true, + 'lte': true, + 'matchesProperty': true, + 'merge': true, + 'multiply': true, + 'overArgs': true, + 'partial': true, + 'partialRight': true, + 'random': true, + 'range': true, + 'rangeRight': true, + 'subtract': true, + 'without': true, + 'zip': true, + 'zipObject': true +}; diff --git a/tools/eslint/node_modules/lodash/fp/_util.js b/tools/eslint/node_modules/lodash/fp/_util.js new file mode 100644 index 00000000000000..d450396fc44804 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/_util.js @@ -0,0 +1,14 @@ +module.exports = { + 'ary': require('../ary'), + 'assign': require('../_baseAssign'), + 'clone': require('../clone'), + 'curry': require('../curry'), + 'forEach': require('../_arrayEach'), + 'isArray': require('../isArray'), + 'isFunction': require('../isFunction'), + 'iteratee': require('../iteratee'), + 'keys': require('../_baseKeys'), + 'rearg': require('../rearg'), + 'spread': require('../spread'), + 'toPath': require('../toPath') +}; diff --git a/tools/eslint/node_modules/lodash/fp/add.js b/tools/eslint/node_modules/lodash/fp/add.js new file mode 100644 index 00000000000000..816eeece34bf25 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/add.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('add', require('../add')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/after.js b/tools/eslint/node_modules/lodash/fp/after.js new file mode 100644 index 00000000000000..21a0167ab2dba5 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/after.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('after', require('../after')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/all.js b/tools/eslint/node_modules/lodash/fp/all.js similarity index 100% rename from tools/eslint/node_modules/inquirer/node_modules/lodash/collection/all.js rename to tools/eslint/node_modules/lodash/fp/all.js diff --git a/tools/eslint/node_modules/lodash/fp/allPass.js b/tools/eslint/node_modules/lodash/fp/allPass.js new file mode 100644 index 00000000000000..79b73ef84573da --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/allPass.js @@ -0,0 +1 @@ +module.exports = require('./overEvery'); diff --git a/tools/eslint/node_modules/lodash/fp/always.js b/tools/eslint/node_modules/lodash/fp/always.js new file mode 100644 index 00000000000000..988770307bc639 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/always.js @@ -0,0 +1 @@ +module.exports = require('./constant'); diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/any.js b/tools/eslint/node_modules/lodash/fp/any.js similarity index 100% rename from tools/eslint/node_modules/inquirer/node_modules/lodash/collection/any.js rename to tools/eslint/node_modules/lodash/fp/any.js diff --git a/tools/eslint/node_modules/lodash/fp/anyPass.js b/tools/eslint/node_modules/lodash/fp/anyPass.js new file mode 100644 index 00000000000000..2774ab37a4082a --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/anyPass.js @@ -0,0 +1 @@ +module.exports = require('./overSome'); diff --git a/tools/eslint/node_modules/lodash/fp/apply.js b/tools/eslint/node_modules/lodash/fp/apply.js new file mode 100644 index 00000000000000..2b757129620c07 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/apply.js @@ -0,0 +1 @@ +module.exports = require('./spread'); diff --git a/tools/eslint/node_modules/lodash/fp/array.js b/tools/eslint/node_modules/lodash/fp/array.js new file mode 100644 index 00000000000000..fe939c2c26a6c4 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/array.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../array')); diff --git a/tools/eslint/node_modules/lodash/fp/ary.js b/tools/eslint/node_modules/lodash/fp/ary.js new file mode 100644 index 00000000000000..8edf18778da3da --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/ary.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('ary', require('../ary')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/assign.js b/tools/eslint/node_modules/lodash/fp/assign.js new file mode 100644 index 00000000000000..23f47af17e13f9 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/assign.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assign', require('../assign')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/assignIn.js b/tools/eslint/node_modules/lodash/fp/assignIn.js new file mode 100644 index 00000000000000..6e7c65fad8e312 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/assignIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignIn', require('../assignIn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/assignInWith.js b/tools/eslint/node_modules/lodash/fp/assignInWith.js new file mode 100644 index 00000000000000..acb5923675eed7 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/assignInWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignInWith', require('../assignInWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/assignWith.js b/tools/eslint/node_modules/lodash/fp/assignWith.js new file mode 100644 index 00000000000000..eb925212d522b5 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/assignWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('assignWith', require('../assignWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/assoc.js b/tools/eslint/node_modules/lodash/fp/assoc.js new file mode 100644 index 00000000000000..7648820c991259 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/assoc.js @@ -0,0 +1 @@ +module.exports = require('./set'); diff --git a/tools/eslint/node_modules/lodash/fp/assocPath.js b/tools/eslint/node_modules/lodash/fp/assocPath.js new file mode 100644 index 00000000000000..7648820c991259 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/assocPath.js @@ -0,0 +1 @@ +module.exports = require('./set'); diff --git a/tools/eslint/node_modules/lodash/fp/at.js b/tools/eslint/node_modules/lodash/fp/at.js new file mode 100644 index 00000000000000..cc39d257c6bf88 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/at.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('at', require('../at')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/attempt.js b/tools/eslint/node_modules/lodash/fp/attempt.js new file mode 100644 index 00000000000000..26ca42ea04d354 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/attempt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('attempt', require('../attempt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/before.js b/tools/eslint/node_modules/lodash/fp/before.js new file mode 100644 index 00000000000000..7a2de65d27ecc1 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/before.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('before', require('../before')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/bind.js b/tools/eslint/node_modules/lodash/fp/bind.js new file mode 100644 index 00000000000000..5cbe4f302fed07 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/bind.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('bind', require('../bind')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/bindAll.js b/tools/eslint/node_modules/lodash/fp/bindAll.js new file mode 100644 index 00000000000000..6b4a4a0f270266 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/bindAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('bindAll', require('../bindAll')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/bindKey.js b/tools/eslint/node_modules/lodash/fp/bindKey.js new file mode 100644 index 00000000000000..6a46c6b19c5b75 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/bindKey.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('bindKey', require('../bindKey')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/camelCase.js b/tools/eslint/node_modules/lodash/fp/camelCase.js new file mode 100644 index 00000000000000..87b77b49376e32 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/camelCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('camelCase', require('../camelCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/capitalize.js b/tools/eslint/node_modules/lodash/fp/capitalize.js new file mode 100644 index 00000000000000..cac74e14f8ac58 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/capitalize.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('capitalize', require('../capitalize'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/castArray.js b/tools/eslint/node_modules/lodash/fp/castArray.js new file mode 100644 index 00000000000000..8681c099eaded1 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/castArray.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('castArray', require('../castArray')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/ceil.js b/tools/eslint/node_modules/lodash/fp/ceil.js new file mode 100644 index 00000000000000..f416b7294c453c --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/ceil.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('ceil', require('../ceil')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/chain.js b/tools/eslint/node_modules/lodash/fp/chain.js new file mode 100644 index 00000000000000..604fe398b100c6 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/chain.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('chain', require('../chain'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/chunk.js b/tools/eslint/node_modules/lodash/fp/chunk.js new file mode 100644 index 00000000000000..871ab08580b35e --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/chunk.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('chunk', require('../chunk')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/clamp.js b/tools/eslint/node_modules/lodash/fp/clamp.js new file mode 100644 index 00000000000000..3b06c01ce139aa --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/clamp.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('clamp', require('../clamp')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/clone.js b/tools/eslint/node_modules/lodash/fp/clone.js new file mode 100644 index 00000000000000..cadb59c917f86c --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/clone.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('clone', require('../clone'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/cloneDeep.js b/tools/eslint/node_modules/lodash/fp/cloneDeep.js new file mode 100644 index 00000000000000..a6107aac9480c3 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/cloneDeep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('cloneDeep', require('../cloneDeep'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/cloneDeepWith.js b/tools/eslint/node_modules/lodash/fp/cloneDeepWith.js new file mode 100644 index 00000000000000..6f01e44a346d70 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/cloneDeepWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('cloneDeepWith', require('../cloneDeepWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/cloneWith.js b/tools/eslint/node_modules/lodash/fp/cloneWith.js new file mode 100644 index 00000000000000..aa8857810e783d --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/cloneWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('cloneWith', require('../cloneWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/collection.js b/tools/eslint/node_modules/lodash/fp/collection.js new file mode 100644 index 00000000000000..fc8b328a0db9f2 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/collection.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../collection')); diff --git a/tools/eslint/node_modules/lodash/fp/commit.js b/tools/eslint/node_modules/lodash/fp/commit.js new file mode 100644 index 00000000000000..130a894f89412a --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/commit.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('commit', require('../commit'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/compact.js b/tools/eslint/node_modules/lodash/fp/compact.js new file mode 100644 index 00000000000000..ce8f7a1ac3e823 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/compact.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('compact', require('../compact'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/complement.js b/tools/eslint/node_modules/lodash/fp/complement.js new file mode 100644 index 00000000000000..93eb462b353923 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/complement.js @@ -0,0 +1 @@ +module.exports = require('./negate'); diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/function/compose.js b/tools/eslint/node_modules/lodash/fp/compose.js similarity index 100% rename from tools/eslint/node_modules/inquirer/node_modules/lodash/function/compose.js rename to tools/eslint/node_modules/lodash/fp/compose.js diff --git a/tools/eslint/node_modules/lodash/fp/concat.js b/tools/eslint/node_modules/lodash/fp/concat.js new file mode 100644 index 00000000000000..e59346ad9834ff --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/concat.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('concat', require('../concat')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/cond.js b/tools/eslint/node_modules/lodash/fp/cond.js new file mode 100644 index 00000000000000..6a0120efd408d0 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/cond.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('cond', require('../cond'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/conforms.js b/tools/eslint/node_modules/lodash/fp/conforms.js new file mode 100644 index 00000000000000..e193cd6c1fdec0 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/conforms.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('conforms', require('../conforms'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/constant.js b/tools/eslint/node_modules/lodash/fp/constant.js new file mode 100644 index 00000000000000..9e406fc09c1b10 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/constant.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('constant', require('../constant'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/contains.js b/tools/eslint/node_modules/lodash/fp/contains.js similarity index 100% rename from tools/eslint/node_modules/inquirer/node_modules/lodash/collection/contains.js rename to tools/eslint/node_modules/lodash/fp/contains.js diff --git a/tools/eslint/node_modules/lodash/fp/convert.js b/tools/eslint/node_modules/lodash/fp/convert.js new file mode 100644 index 00000000000000..4795dc42460855 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/convert.js @@ -0,0 +1,18 @@ +var baseConvert = require('./_baseConvert'), + util = require('./_util'); + +/** + * Converts `func` of `name` to an immutable auto-curried iteratee-first data-last + * version with conversion `options` applied. If `name` is an object its methods + * will be converted. + * + * @param {string} name The name of the function to wrap. + * @param {Function} [func] The function to wrap. + * @param {Object} [options] The options object. See `baseConvert` for more details. + * @returns {Function|Object} Returns the converted function or object. + */ +function convert(name, func, options) { + return baseConvert(util, name, func, options); +} + +module.exports = convert; diff --git a/tools/eslint/node_modules/lodash/fp/countBy.js b/tools/eslint/node_modules/lodash/fp/countBy.js new file mode 100644 index 00000000000000..dfa464326fe8dc --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/countBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('countBy', require('../countBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/create.js b/tools/eslint/node_modules/lodash/fp/create.js new file mode 100644 index 00000000000000..752025fb83bb4c --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/create.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('create', require('../create')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/curry.js b/tools/eslint/node_modules/lodash/fp/curry.js new file mode 100644 index 00000000000000..b0b4168c500134 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/curry.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('curry', require('../curry')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/curryN.js b/tools/eslint/node_modules/lodash/fp/curryN.js new file mode 100644 index 00000000000000..2ae7d00a62a578 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/curryN.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('curryN', require('../curry')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/curryRight.js b/tools/eslint/node_modules/lodash/fp/curryRight.js new file mode 100644 index 00000000000000..cb619eb5d98b94 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/curryRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('curryRight', require('../curryRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/curryRightN.js b/tools/eslint/node_modules/lodash/fp/curryRightN.js new file mode 100644 index 00000000000000..2495afc89c3fce --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/curryRightN.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('curryRightN', require('../curryRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/date.js b/tools/eslint/node_modules/lodash/fp/date.js new file mode 100644 index 00000000000000..82cb952bc4c40e --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/date.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../date')); diff --git a/tools/eslint/node_modules/lodash/fp/debounce.js b/tools/eslint/node_modules/lodash/fp/debounce.js new file mode 100644 index 00000000000000..26122293af3a6f --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/debounce.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('debounce', require('../debounce')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/deburr.js b/tools/eslint/node_modules/lodash/fp/deburr.js new file mode 100644 index 00000000000000..96463ab88e7e5a --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/deburr.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('deburr', require('../deburr'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/defaults.js b/tools/eslint/node_modules/lodash/fp/defaults.js new file mode 100644 index 00000000000000..e1a8e6e7dbe936 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/defaults.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defaults', require('../defaults')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/defaultsDeep.js b/tools/eslint/node_modules/lodash/fp/defaultsDeep.js new file mode 100644 index 00000000000000..1f172ff9442840 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/defaultsDeep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defaultsDeep', require('../defaultsDeep')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/defer.js b/tools/eslint/node_modules/lodash/fp/defer.js new file mode 100644 index 00000000000000..ec7990fe224281 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/defer.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('defer', require('../defer'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/delay.js b/tools/eslint/node_modules/lodash/fp/delay.js new file mode 100644 index 00000000000000..556dbd568ee475 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/delay.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('delay', require('../delay')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/difference.js b/tools/eslint/node_modules/lodash/fp/difference.js new file mode 100644 index 00000000000000..2d0376542a7c24 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/difference.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('difference', require('../difference')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/differenceBy.js b/tools/eslint/node_modules/lodash/fp/differenceBy.js new file mode 100644 index 00000000000000..2f914910a987da --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/differenceBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('differenceBy', require('../differenceBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/differenceWith.js b/tools/eslint/node_modules/lodash/fp/differenceWith.js new file mode 100644 index 00000000000000..bcf5ad2e1192c8 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/differenceWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('differenceWith', require('../differenceWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/dissoc.js b/tools/eslint/node_modules/lodash/fp/dissoc.js new file mode 100644 index 00000000000000..7ec7be190bc4cf --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/dissoc.js @@ -0,0 +1 @@ +module.exports = require('./unset'); diff --git a/tools/eslint/node_modules/lodash/fp/dissocPath.js b/tools/eslint/node_modules/lodash/fp/dissocPath.js new file mode 100644 index 00000000000000..7ec7be190bc4cf --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/dissocPath.js @@ -0,0 +1 @@ +module.exports = require('./unset'); diff --git a/tools/eslint/node_modules/lodash/fp/divide.js b/tools/eslint/node_modules/lodash/fp/divide.js new file mode 100644 index 00000000000000..82048c5e02a2ea --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/divide.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('divide', require('../divide')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/drop.js b/tools/eslint/node_modules/lodash/fp/drop.js new file mode 100644 index 00000000000000..2fa9b4faa587f0 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/drop.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('drop', require('../drop')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/dropRight.js b/tools/eslint/node_modules/lodash/fp/dropRight.js new file mode 100644 index 00000000000000..e98881fcd4479f --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/dropRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('dropRight', require('../dropRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/dropRightWhile.js b/tools/eslint/node_modules/lodash/fp/dropRightWhile.js new file mode 100644 index 00000000000000..cacaa7019106cb --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/dropRightWhile.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('dropRightWhile', require('../dropRightWhile')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/dropWhile.js b/tools/eslint/node_modules/lodash/fp/dropWhile.js new file mode 100644 index 00000000000000..285f864d127a25 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/dropWhile.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('dropWhile', require('../dropWhile')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/each.js b/tools/eslint/node_modules/lodash/fp/each.js similarity index 100% rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/each.js rename to tools/eslint/node_modules/lodash/fp/each.js diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/eachRight.js b/tools/eslint/node_modules/lodash/fp/eachRight.js similarity index 100% rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/collection/eachRight.js rename to tools/eslint/node_modules/lodash/fp/eachRight.js diff --git a/tools/eslint/node_modules/lodash/fp/endsWith.js b/tools/eslint/node_modules/lodash/fp/endsWith.js new file mode 100644 index 00000000000000..17dc2a49511b3b --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/endsWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('endsWith', require('../endsWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/entries.js b/tools/eslint/node_modules/lodash/fp/entries.js new file mode 100644 index 00000000000000..7a88df2044638c --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/entries.js @@ -0,0 +1 @@ +module.exports = require('./toPairs'); diff --git a/tools/eslint/node_modules/lodash/fp/entriesIn.js b/tools/eslint/node_modules/lodash/fp/entriesIn.js new file mode 100644 index 00000000000000..f6c6331c1de93f --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/entriesIn.js @@ -0,0 +1 @@ +module.exports = require('./toPairsIn'); diff --git a/tools/eslint/node_modules/lodash/fp/eq.js b/tools/eslint/node_modules/lodash/fp/eq.js new file mode 100644 index 00000000000000..9a3d21bf1d1114 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/eq.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('eq', require('../eq')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/lang/eq.js b/tools/eslint/node_modules/lodash/fp/equals.js similarity index 100% rename from tools/eslint/node_modules/inquirer/node_modules/lodash/lang/eq.js rename to tools/eslint/node_modules/lodash/fp/equals.js diff --git a/tools/eslint/node_modules/lodash/fp/escape.js b/tools/eslint/node_modules/lodash/fp/escape.js new file mode 100644 index 00000000000000..52c1fbba609036 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/escape.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('escape', require('../escape'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/escapeRegExp.js b/tools/eslint/node_modules/lodash/fp/escapeRegExp.js new file mode 100644 index 00000000000000..369b2eff6e1216 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/escapeRegExp.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('escapeRegExp', require('../escapeRegExp'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/every.js b/tools/eslint/node_modules/lodash/fp/every.js new file mode 100644 index 00000000000000..95c2776c33e06c --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/every.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('every', require('../every')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/extend.js b/tools/eslint/node_modules/lodash/fp/extend.js new file mode 100644 index 00000000000000..e00166c206c610 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/extend.js @@ -0,0 +1 @@ +module.exports = require('./assignIn'); diff --git a/tools/eslint/node_modules/lodash/fp/extendWith.js b/tools/eslint/node_modules/lodash/fp/extendWith.js new file mode 100644 index 00000000000000..dbdcb3b4e457d3 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/extendWith.js @@ -0,0 +1 @@ +module.exports = require('./assignInWith'); diff --git a/tools/eslint/node_modules/lodash/fp/fill.js b/tools/eslint/node_modules/lodash/fp/fill.js new file mode 100644 index 00000000000000..b2d47e84eb159b --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/fill.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('fill', require('../fill')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/filter.js b/tools/eslint/node_modules/lodash/fp/filter.js new file mode 100644 index 00000000000000..796d501ce827ca --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/filter.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('filter', require('../filter')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/find.js b/tools/eslint/node_modules/lodash/fp/find.js new file mode 100644 index 00000000000000..f805d336aa148e --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/find.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('find', require('../find')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/findIndex.js b/tools/eslint/node_modules/lodash/fp/findIndex.js new file mode 100644 index 00000000000000..8c15fd11606166 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/findIndex.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findIndex', require('../findIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/findKey.js b/tools/eslint/node_modules/lodash/fp/findKey.js new file mode 100644 index 00000000000000..475bcfa8a5bc02 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/findKey.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findKey', require('../findKey')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/findLast.js b/tools/eslint/node_modules/lodash/fp/findLast.js new file mode 100644 index 00000000000000..093fe94e745e76 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/findLast.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findLast', require('../findLast')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/findLastIndex.js b/tools/eslint/node_modules/lodash/fp/findLastIndex.js new file mode 100644 index 00000000000000..36986df0b8ae62 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/findLastIndex.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findLastIndex', require('../findLastIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/findLastKey.js b/tools/eslint/node_modules/lodash/fp/findLastKey.js new file mode 100644 index 00000000000000..5f81b604e8174b --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/findLastKey.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('findLastKey', require('../findLastKey')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/first.js b/tools/eslint/node_modules/lodash/fp/first.js new file mode 100644 index 00000000000000..53f4ad13eee61d --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/first.js @@ -0,0 +1 @@ +module.exports = require('./head'); diff --git a/tools/eslint/node_modules/lodash/fp/flatMap.js b/tools/eslint/node_modules/lodash/fp/flatMap.js new file mode 100644 index 00000000000000..d01dc4d0481c5b --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/flatMap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flatMap', require('../flatMap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/flatMapDeep.js b/tools/eslint/node_modules/lodash/fp/flatMapDeep.js new file mode 100644 index 00000000000000..569c42eb9fa565 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/flatMapDeep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flatMapDeep', require('../flatMapDeep')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/flatMapDepth.js b/tools/eslint/node_modules/lodash/fp/flatMapDepth.js new file mode 100644 index 00000000000000..6eb68fdeed81fe --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/flatMapDepth.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flatMapDepth', require('../flatMapDepth')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/flatten.js b/tools/eslint/node_modules/lodash/fp/flatten.js new file mode 100644 index 00000000000000..30425d896232d7 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/flatten.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flatten', require('../flatten'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/flattenDeep.js b/tools/eslint/node_modules/lodash/fp/flattenDeep.js new file mode 100644 index 00000000000000..aed5db27c09f37 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/flattenDeep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flattenDeep', require('../flattenDeep'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/flattenDepth.js b/tools/eslint/node_modules/lodash/fp/flattenDepth.js new file mode 100644 index 00000000000000..ad65e378eff98d --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/flattenDepth.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flattenDepth', require('../flattenDepth')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/flip.js b/tools/eslint/node_modules/lodash/fp/flip.js new file mode 100644 index 00000000000000..0547e7b4eade18 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/flip.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flip', require('../flip'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/floor.js b/tools/eslint/node_modules/lodash/fp/floor.js new file mode 100644 index 00000000000000..a6cf3358ed315a --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/floor.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('floor', require('../floor')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/flow.js b/tools/eslint/node_modules/lodash/fp/flow.js new file mode 100644 index 00000000000000..cd83677a62ca36 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/flow.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flow', require('../flow')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/flowRight.js b/tools/eslint/node_modules/lodash/fp/flowRight.js new file mode 100644 index 00000000000000..972a5b9b1c2c06 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/flowRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('flowRight', require('../flowRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/forEach.js b/tools/eslint/node_modules/lodash/fp/forEach.js new file mode 100644 index 00000000000000..2f494521c86f42 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/forEach.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forEach', require('../forEach')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/forEachRight.js b/tools/eslint/node_modules/lodash/fp/forEachRight.js new file mode 100644 index 00000000000000..3ff97336bbf2b9 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/forEachRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forEachRight', require('../forEachRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/forIn.js b/tools/eslint/node_modules/lodash/fp/forIn.js new file mode 100644 index 00000000000000..9341749b1f7198 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/forIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forIn', require('../forIn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/forInRight.js b/tools/eslint/node_modules/lodash/fp/forInRight.js new file mode 100644 index 00000000000000..cecf8bbfa6cf82 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/forInRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forInRight', require('../forInRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/forOwn.js b/tools/eslint/node_modules/lodash/fp/forOwn.js new file mode 100644 index 00000000000000..246449e9a832df --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/forOwn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forOwn', require('../forOwn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/forOwnRight.js b/tools/eslint/node_modules/lodash/fp/forOwnRight.js new file mode 100644 index 00000000000000..c5e826e0d7dc8f --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/forOwnRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('forOwnRight', require('../forOwnRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/fromPairs.js b/tools/eslint/node_modules/lodash/fp/fromPairs.js new file mode 100644 index 00000000000000..f8cc5968cd2cff --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/fromPairs.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('fromPairs', require('../fromPairs')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/function.js b/tools/eslint/node_modules/lodash/fp/function.js new file mode 100644 index 00000000000000..dfe69b1fa03464 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/function.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../function')); diff --git a/tools/eslint/node_modules/lodash/fp/functions.js b/tools/eslint/node_modules/lodash/fp/functions.js new file mode 100644 index 00000000000000..09d1bb1baaebfe --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/functions.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('functions', require('../functions'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/functionsIn.js b/tools/eslint/node_modules/lodash/fp/functionsIn.js new file mode 100644 index 00000000000000..2cfeb83ebbc8e2 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/functionsIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('functionsIn', require('../functionsIn'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/get.js b/tools/eslint/node_modules/lodash/fp/get.js new file mode 100644 index 00000000000000..6d3a32863e72b5 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/get.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('get', require('../get')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/getOr.js b/tools/eslint/node_modules/lodash/fp/getOr.js new file mode 100644 index 00000000000000..7dbf771f0c6b09 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/getOr.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('getOr', require('../get')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/groupBy.js b/tools/eslint/node_modules/lodash/fp/groupBy.js new file mode 100644 index 00000000000000..fc0bc78a57b930 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/groupBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('groupBy', require('../groupBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/gt.js b/tools/eslint/node_modules/lodash/fp/gt.js new file mode 100644 index 00000000000000..9e57c8085a05e4 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/gt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('gt', require('../gt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/gte.js b/tools/eslint/node_modules/lodash/fp/gte.js new file mode 100644 index 00000000000000..45847863894a29 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/gte.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('gte', require('../gte')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/has.js b/tools/eslint/node_modules/lodash/fp/has.js new file mode 100644 index 00000000000000..b901298398e4f7 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/has.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('has', require('../has')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/hasIn.js b/tools/eslint/node_modules/lodash/fp/hasIn.js new file mode 100644 index 00000000000000..b3c3d1a3f3b375 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/hasIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('hasIn', require('../hasIn')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/head.js b/tools/eslint/node_modules/lodash/fp/head.js new file mode 100644 index 00000000000000..2694f0a21d681e --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/head.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('head', require('../head'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/identical.js b/tools/eslint/node_modules/lodash/fp/identical.js new file mode 100644 index 00000000000000..85563f4a469964 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/identical.js @@ -0,0 +1 @@ +module.exports = require('./eq'); diff --git a/tools/eslint/node_modules/lodash/fp/identity.js b/tools/eslint/node_modules/lodash/fp/identity.js new file mode 100644 index 00000000000000..096415a5dec4a6 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/identity.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('identity', require('../identity'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/inRange.js b/tools/eslint/node_modules/lodash/fp/inRange.js new file mode 100644 index 00000000000000..202d940bae8d83 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/inRange.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('inRange', require('../inRange')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/includes.js b/tools/eslint/node_modules/lodash/fp/includes.js new file mode 100644 index 00000000000000..11467805ce1e72 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/includes.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('includes', require('../includes')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/indexOf.js b/tools/eslint/node_modules/lodash/fp/indexOf.js new file mode 100644 index 00000000000000..524658eb95f983 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/indexOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('indexOf', require('../indexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/init.js b/tools/eslint/node_modules/lodash/fp/init.js new file mode 100644 index 00000000000000..2f88d8b0e10013 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/init.js @@ -0,0 +1 @@ +module.exports = require('./initial'); diff --git a/tools/eslint/node_modules/lodash/fp/initial.js b/tools/eslint/node_modules/lodash/fp/initial.js new file mode 100644 index 00000000000000..b732ba0bd69f24 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/initial.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('initial', require('../initial'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/intersection.js b/tools/eslint/node_modules/lodash/fp/intersection.js new file mode 100644 index 00000000000000..52936d560c7cb6 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/intersection.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('intersection', require('../intersection')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/intersectionBy.js b/tools/eslint/node_modules/lodash/fp/intersectionBy.js new file mode 100644 index 00000000000000..72629f277d7f82 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/intersectionBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('intersectionBy', require('../intersectionBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/intersectionWith.js b/tools/eslint/node_modules/lodash/fp/intersectionWith.js new file mode 100644 index 00000000000000..e064f400f88bcc --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/intersectionWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('intersectionWith', require('../intersectionWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/invert.js b/tools/eslint/node_modules/lodash/fp/invert.js new file mode 100644 index 00000000000000..2d5d1f0d45ba03 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/invert.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invert', require('../invert')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/invertBy.js b/tools/eslint/node_modules/lodash/fp/invertBy.js new file mode 100644 index 00000000000000..63ca97ecb28ab7 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/invertBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invertBy', require('../invertBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/invertObj.js b/tools/eslint/node_modules/lodash/fp/invertObj.js new file mode 100644 index 00000000000000..f1d842e49b8eda --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/invertObj.js @@ -0,0 +1 @@ +module.exports = require('./invert'); diff --git a/tools/eslint/node_modules/lodash/fp/invoke.js b/tools/eslint/node_modules/lodash/fp/invoke.js new file mode 100644 index 00000000000000..fcf17f0d5721b8 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/invoke.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invoke', require('../invoke')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/invokeArgs.js b/tools/eslint/node_modules/lodash/fp/invokeArgs.js new file mode 100644 index 00000000000000..d3f2953fa3b921 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/invokeArgs.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invokeArgs', require('../invoke')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/invokeArgsMap.js b/tools/eslint/node_modules/lodash/fp/invokeArgsMap.js new file mode 100644 index 00000000000000..eaa9f84ffbb7f0 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/invokeArgsMap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invokeArgsMap', require('../invokeMap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/invokeMap.js b/tools/eslint/node_modules/lodash/fp/invokeMap.js new file mode 100644 index 00000000000000..6515fd73f16e75 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/invokeMap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('invokeMap', require('../invokeMap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isArguments.js b/tools/eslint/node_modules/lodash/fp/isArguments.js new file mode 100644 index 00000000000000..1d93c9e5994c86 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isArguments.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isArguments', require('../isArguments'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isArray.js b/tools/eslint/node_modules/lodash/fp/isArray.js new file mode 100644 index 00000000000000..ba7ade8ddc0a13 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isArray.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isArray', require('../isArray'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isArrayBuffer.js b/tools/eslint/node_modules/lodash/fp/isArrayBuffer.js new file mode 100644 index 00000000000000..5088513faf3e83 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isArrayBuffer.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isArrayBuffer', require('../isArrayBuffer'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isArrayLike.js b/tools/eslint/node_modules/lodash/fp/isArrayLike.js new file mode 100644 index 00000000000000..8f1856bf6f6b38 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isArrayLike.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isArrayLike', require('../isArrayLike'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isArrayLikeObject.js b/tools/eslint/node_modules/lodash/fp/isArrayLikeObject.js new file mode 100644 index 00000000000000..21084984bcecdd --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isArrayLikeObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isArrayLikeObject', require('../isArrayLikeObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isBoolean.js b/tools/eslint/node_modules/lodash/fp/isBoolean.js new file mode 100644 index 00000000000000..9339f75b1f198a --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isBoolean.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isBoolean', require('../isBoolean'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isBuffer.js b/tools/eslint/node_modules/lodash/fp/isBuffer.js new file mode 100644 index 00000000000000..e60b123818d12c --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isBuffer.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isBuffer', require('../isBuffer'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isDate.js b/tools/eslint/node_modules/lodash/fp/isDate.js new file mode 100644 index 00000000000000..dc41d089ec8b84 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isDate.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isDate', require('../isDate'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isElement.js b/tools/eslint/node_modules/lodash/fp/isElement.js new file mode 100644 index 00000000000000..18ee039a2da96f --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isElement.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isElement', require('../isElement'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isEmpty.js b/tools/eslint/node_modules/lodash/fp/isEmpty.js new file mode 100644 index 00000000000000..0f4ae841e214f3 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isEmpty.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isEmpty', require('../isEmpty'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isEqual.js b/tools/eslint/node_modules/lodash/fp/isEqual.js new file mode 100644 index 00000000000000..41383865f28757 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isEqual.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isEqual', require('../isEqual')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isEqualWith.js b/tools/eslint/node_modules/lodash/fp/isEqualWith.js new file mode 100644 index 00000000000000..029ff5cdaa0f33 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isEqualWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isEqualWith', require('../isEqualWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isError.js b/tools/eslint/node_modules/lodash/fp/isError.js new file mode 100644 index 00000000000000..3dfd81ccc211cb --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isError.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isError', require('../isError'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isFinite.js b/tools/eslint/node_modules/lodash/fp/isFinite.js new file mode 100644 index 00000000000000..0b647b841ecc17 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isFinite.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isFinite', require('../isFinite'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isFunction.js b/tools/eslint/node_modules/lodash/fp/isFunction.js new file mode 100644 index 00000000000000..ff8e5c45853aba --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isFunction.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isFunction', require('../isFunction'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isInteger.js b/tools/eslint/node_modules/lodash/fp/isInteger.js new file mode 100644 index 00000000000000..67af4ff6dbb05e --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isInteger.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isInteger', require('../isInteger'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isLength.js b/tools/eslint/node_modules/lodash/fp/isLength.js new file mode 100644 index 00000000000000..fc101c5a64b4e8 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isLength.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isLength', require('../isLength'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isMap.js b/tools/eslint/node_modules/lodash/fp/isMap.js new file mode 100644 index 00000000000000..a209aa66fcbae5 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isMap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isMap', require('../isMap'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isMatch.js b/tools/eslint/node_modules/lodash/fp/isMatch.js new file mode 100644 index 00000000000000..6264ca17fac37a --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isMatch.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isMatch', require('../isMatch')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isMatchWith.js b/tools/eslint/node_modules/lodash/fp/isMatchWith.js new file mode 100644 index 00000000000000..d95f319353fb80 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isMatchWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isMatchWith', require('../isMatchWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isNaN.js b/tools/eslint/node_modules/lodash/fp/isNaN.js new file mode 100644 index 00000000000000..66a978f11194fc --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isNaN.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isNaN', require('../isNaN'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isNative.js b/tools/eslint/node_modules/lodash/fp/isNative.js new file mode 100644 index 00000000000000..3d775ba953152e --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isNative.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isNative', require('../isNative'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isNil.js b/tools/eslint/node_modules/lodash/fp/isNil.js new file mode 100644 index 00000000000000..5952c028a9bcdd --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isNil.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isNil', require('../isNil'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isNull.js b/tools/eslint/node_modules/lodash/fp/isNull.js new file mode 100644 index 00000000000000..f201a354b43789 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isNull.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isNull', require('../isNull'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isNumber.js b/tools/eslint/node_modules/lodash/fp/isNumber.js new file mode 100644 index 00000000000000..a2b5fa049fe9f7 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isNumber.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isNumber', require('../isNumber'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isObject.js b/tools/eslint/node_modules/lodash/fp/isObject.js new file mode 100644 index 00000000000000..231ace03bc50ed --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isObject', require('../isObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isObjectLike.js b/tools/eslint/node_modules/lodash/fp/isObjectLike.js new file mode 100644 index 00000000000000..f16082e6fee9ee --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isObjectLike.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isObjectLike', require('../isObjectLike'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isPlainObject.js b/tools/eslint/node_modules/lodash/fp/isPlainObject.js new file mode 100644 index 00000000000000..b5bea90d3a7f26 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isPlainObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isPlainObject', require('../isPlainObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isRegExp.js b/tools/eslint/node_modules/lodash/fp/isRegExp.js new file mode 100644 index 00000000000000..12a1a3d71852e9 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isRegExp.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isRegExp', require('../isRegExp'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isSafeInteger.js b/tools/eslint/node_modules/lodash/fp/isSafeInteger.js new file mode 100644 index 00000000000000..7230f5520aa776 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isSafeInteger.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isSafeInteger', require('../isSafeInteger'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isSet.js b/tools/eslint/node_modules/lodash/fp/isSet.js new file mode 100644 index 00000000000000..35c01f6fa19338 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isSet.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isSet', require('../isSet'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isString.js b/tools/eslint/node_modules/lodash/fp/isString.js new file mode 100644 index 00000000000000..1fd0679ef865e9 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isString.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isString', require('../isString'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isSymbol.js b/tools/eslint/node_modules/lodash/fp/isSymbol.js new file mode 100644 index 00000000000000..38676956dac9dd --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isSymbol.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isSymbol', require('../isSymbol'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isTypedArray.js b/tools/eslint/node_modules/lodash/fp/isTypedArray.js new file mode 100644 index 00000000000000..8567953875ffc4 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isTypedArray.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isTypedArray', require('../isTypedArray'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isUndefined.js b/tools/eslint/node_modules/lodash/fp/isUndefined.js new file mode 100644 index 00000000000000..ddbca31ca70f09 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isUndefined.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isUndefined', require('../isUndefined'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isWeakMap.js b/tools/eslint/node_modules/lodash/fp/isWeakMap.js new file mode 100644 index 00000000000000..ef60c613c4bdc9 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isWeakMap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isWeakMap', require('../isWeakMap'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/isWeakSet.js b/tools/eslint/node_modules/lodash/fp/isWeakSet.js new file mode 100644 index 00000000000000..c99bfaa6d9d288 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/isWeakSet.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('isWeakSet', require('../isWeakSet'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/iteratee.js b/tools/eslint/node_modules/lodash/fp/iteratee.js new file mode 100644 index 00000000000000..9f0f71738a01ba --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/iteratee.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('iteratee', require('../iteratee')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/join.js b/tools/eslint/node_modules/lodash/fp/join.js new file mode 100644 index 00000000000000..a220e003c4009f --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/join.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('join', require('../join')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/juxt.js b/tools/eslint/node_modules/lodash/fp/juxt.js new file mode 100644 index 00000000000000..f71e04e00028f5 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/juxt.js @@ -0,0 +1 @@ +module.exports = require('./over'); diff --git a/tools/eslint/node_modules/lodash/fp/kebabCase.js b/tools/eslint/node_modules/lodash/fp/kebabCase.js new file mode 100644 index 00000000000000..60737f17cdbc85 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/kebabCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('kebabCase', require('../kebabCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/keyBy.js b/tools/eslint/node_modules/lodash/fp/keyBy.js new file mode 100644 index 00000000000000..9a6a85d4226045 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/keyBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('keyBy', require('../keyBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/keys.js b/tools/eslint/node_modules/lodash/fp/keys.js new file mode 100644 index 00000000000000..e12bb07f13022e --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/keys.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('keys', require('../keys'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/keysIn.js b/tools/eslint/node_modules/lodash/fp/keysIn.js new file mode 100644 index 00000000000000..f3eb36a8d20d6c --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/keysIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('keysIn', require('../keysIn'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/lang.js b/tools/eslint/node_modules/lodash/fp/lang.js new file mode 100644 index 00000000000000..08cc9c14bdd379 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/lang.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../lang')); diff --git a/tools/eslint/node_modules/lodash/fp/last.js b/tools/eslint/node_modules/lodash/fp/last.js new file mode 100644 index 00000000000000..0f716993fc80d9 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/last.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('last', require('../last'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/lastIndexOf.js b/tools/eslint/node_modules/lodash/fp/lastIndexOf.js new file mode 100644 index 00000000000000..ddf39c30135edd --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/lastIndexOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lastIndexOf', require('../lastIndexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/lowerCase.js b/tools/eslint/node_modules/lodash/fp/lowerCase.js new file mode 100644 index 00000000000000..ea64bc15d6f337 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/lowerCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lowerCase', require('../lowerCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/lowerFirst.js b/tools/eslint/node_modules/lodash/fp/lowerFirst.js new file mode 100644 index 00000000000000..539720a3da3e0e --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/lowerFirst.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lowerFirst', require('../lowerFirst'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/lt.js b/tools/eslint/node_modules/lodash/fp/lt.js new file mode 100644 index 00000000000000..a31d21ecc660da --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/lt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lt', require('../lt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/lte.js b/tools/eslint/node_modules/lodash/fp/lte.js new file mode 100644 index 00000000000000..d795d10ee7c78f --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/lte.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('lte', require('../lte')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/map.js b/tools/eslint/node_modules/lodash/fp/map.js new file mode 100644 index 00000000000000..cf98794362808b --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/map.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('map', require('../map')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/mapKeys.js b/tools/eslint/node_modules/lodash/fp/mapKeys.js new file mode 100644 index 00000000000000..1684587099e281 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/mapKeys.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mapKeys', require('../mapKeys')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/mapObj.js b/tools/eslint/node_modules/lodash/fp/mapObj.js new file mode 100644 index 00000000000000..9f1872de91fadb --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/mapObj.js @@ -0,0 +1 @@ +module.exports = require('./mapValues'); diff --git a/tools/eslint/node_modules/lodash/fp/mapValues.js b/tools/eslint/node_modules/lodash/fp/mapValues.js new file mode 100644 index 00000000000000..4004972751db88 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/mapValues.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mapValues', require('../mapValues')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/matches.js b/tools/eslint/node_modules/lodash/fp/matches.js new file mode 100644 index 00000000000000..629399cb8dc93f --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/matches.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('matches', require('../matches'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/matchesProperty.js b/tools/eslint/node_modules/lodash/fp/matchesProperty.js new file mode 100644 index 00000000000000..4575bd2431b7e4 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/matchesProperty.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('matchesProperty', require('../matchesProperty')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/math.js b/tools/eslint/node_modules/lodash/fp/math.js new file mode 100644 index 00000000000000..e8f50f79271e1c --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/math.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../math')); diff --git a/tools/eslint/node_modules/lodash/fp/max.js b/tools/eslint/node_modules/lodash/fp/max.js new file mode 100644 index 00000000000000..a66acac220717a --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/max.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('max', require('../max'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/maxBy.js b/tools/eslint/node_modules/lodash/fp/maxBy.js new file mode 100644 index 00000000000000..d083fd64fd2d59 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/maxBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('maxBy', require('../maxBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/mean.js b/tools/eslint/node_modules/lodash/fp/mean.js new file mode 100644 index 00000000000000..31172460c3b44a --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/mean.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mean', require('../mean'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/meanBy.js b/tools/eslint/node_modules/lodash/fp/meanBy.js new file mode 100644 index 00000000000000..556f25edfe912f --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/meanBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('meanBy', require('../meanBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/memoize.js b/tools/eslint/node_modules/lodash/fp/memoize.js new file mode 100644 index 00000000000000..638eec63bad1bb --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/memoize.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('memoize', require('../memoize')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/merge.js b/tools/eslint/node_modules/lodash/fp/merge.js new file mode 100644 index 00000000000000..ac66adde1221e6 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/merge.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('merge', require('../merge')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/mergeWith.js b/tools/eslint/node_modules/lodash/fp/mergeWith.js new file mode 100644 index 00000000000000..00d44d5e1a2711 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/mergeWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mergeWith', require('../mergeWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/method.js b/tools/eslint/node_modules/lodash/fp/method.js new file mode 100644 index 00000000000000..f4060c6878e9be --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/method.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('method', require('../method')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/methodOf.js b/tools/eslint/node_modules/lodash/fp/methodOf.js new file mode 100644 index 00000000000000..61399056f36858 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/methodOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('methodOf', require('../methodOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/min.js b/tools/eslint/node_modules/lodash/fp/min.js new file mode 100644 index 00000000000000..d12c6b40d38285 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/min.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('min', require('../min'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/minBy.js b/tools/eslint/node_modules/lodash/fp/minBy.js new file mode 100644 index 00000000000000..fdb9e24d8adcf1 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/minBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('minBy', require('../minBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/mixin.js b/tools/eslint/node_modules/lodash/fp/mixin.js new file mode 100644 index 00000000000000..332e6fbfddadf1 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/mixin.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('mixin', require('../mixin')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/multiply.js b/tools/eslint/node_modules/lodash/fp/multiply.js new file mode 100644 index 00000000000000..4dcf0b0d4afb64 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/multiply.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('multiply', require('../multiply')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/nAry.js b/tools/eslint/node_modules/lodash/fp/nAry.js new file mode 100644 index 00000000000000..f262a76ccdc8a9 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/nAry.js @@ -0,0 +1 @@ +module.exports = require('./ary'); diff --git a/tools/eslint/node_modules/lodash/fp/negate.js b/tools/eslint/node_modules/lodash/fp/negate.js new file mode 100644 index 00000000000000..8b6dc7c5b882c3 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/negate.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('negate', require('../negate'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/next.js b/tools/eslint/node_modules/lodash/fp/next.js new file mode 100644 index 00000000000000..140155e2321f8b --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/next.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('next', require('../next'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/noop.js b/tools/eslint/node_modules/lodash/fp/noop.js new file mode 100644 index 00000000000000..b9e32cc8cd8729 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/noop.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('noop', require('../noop'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/now.js b/tools/eslint/node_modules/lodash/fp/now.js new file mode 100644 index 00000000000000..6de2068aacc53b --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/now.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('now', require('../now'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/nthArg.js b/tools/eslint/node_modules/lodash/fp/nthArg.js new file mode 100644 index 00000000000000..8ccd8e60b1a812 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/nthArg.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('nthArg', require('../nthArg'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/number.js b/tools/eslint/node_modules/lodash/fp/number.js new file mode 100644 index 00000000000000..5c10b8842d2713 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/number.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../number')); diff --git a/tools/eslint/node_modules/lodash/fp/object.js b/tools/eslint/node_modules/lodash/fp/object.js new file mode 100644 index 00000000000000..ae39a1346c9b3f --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/object.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../object')); diff --git a/tools/eslint/node_modules/lodash/fp/omit.js b/tools/eslint/node_modules/lodash/fp/omit.js new file mode 100644 index 00000000000000..fd685291e64e29 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/omit.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('omit', require('../omit')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/omitAll.js b/tools/eslint/node_modules/lodash/fp/omitAll.js new file mode 100644 index 00000000000000..144cf4b96e8e91 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/omitAll.js @@ -0,0 +1 @@ +module.exports = require('./omit'); diff --git a/tools/eslint/node_modules/lodash/fp/omitBy.js b/tools/eslint/node_modules/lodash/fp/omitBy.js new file mode 100644 index 00000000000000..90df7380269d9b --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/omitBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('omitBy', require('../omitBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/once.js b/tools/eslint/node_modules/lodash/fp/once.js new file mode 100644 index 00000000000000..f8f0a5c73ecf0c --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/once.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('once', require('../once'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/orderBy.js b/tools/eslint/node_modules/lodash/fp/orderBy.js new file mode 100644 index 00000000000000..848e210754641a --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/orderBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('orderBy', require('../orderBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/over.js b/tools/eslint/node_modules/lodash/fp/over.js new file mode 100644 index 00000000000000..01eba7b9847805 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/over.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('over', require('../over')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/overArgs.js b/tools/eslint/node_modules/lodash/fp/overArgs.js new file mode 100644 index 00000000000000..738556f0c0da92 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/overArgs.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('overArgs', require('../overArgs')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/overEvery.js b/tools/eslint/node_modules/lodash/fp/overEvery.js new file mode 100644 index 00000000000000..9f5a032dc7782c --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/overEvery.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('overEvery', require('../overEvery')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/overSome.js b/tools/eslint/node_modules/lodash/fp/overSome.js new file mode 100644 index 00000000000000..15939d5865a2b4 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/overSome.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('overSome', require('../overSome')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/pad.js b/tools/eslint/node_modules/lodash/fp/pad.js new file mode 100644 index 00000000000000..f1dea4a98f6447 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/pad.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pad', require('../pad')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/padChars.js b/tools/eslint/node_modules/lodash/fp/padChars.js new file mode 100644 index 00000000000000..d6e0804cd6ca96 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/padChars.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padChars', require('../pad')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/padCharsEnd.js b/tools/eslint/node_modules/lodash/fp/padCharsEnd.js new file mode 100644 index 00000000000000..d4ab79ad305f58 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/padCharsEnd.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padCharsEnd', require('../padEnd')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/padCharsStart.js b/tools/eslint/node_modules/lodash/fp/padCharsStart.js new file mode 100644 index 00000000000000..a08a30000a6617 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/padCharsStart.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padCharsStart', require('../padStart')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/padEnd.js b/tools/eslint/node_modules/lodash/fp/padEnd.js new file mode 100644 index 00000000000000..a8522ec36a5fb6 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/padEnd.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padEnd', require('../padEnd')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/padStart.js b/tools/eslint/node_modules/lodash/fp/padStart.js new file mode 100644 index 00000000000000..f4ca79d4af8ebd --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/padStart.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('padStart', require('../padStart')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/parseInt.js b/tools/eslint/node_modules/lodash/fp/parseInt.js new file mode 100644 index 00000000000000..27314ccbca67b4 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/parseInt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('parseInt', require('../parseInt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/partial.js b/tools/eslint/node_modules/lodash/fp/partial.js new file mode 100644 index 00000000000000..5d4601598bf83c --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/partial.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('partial', require('../partial')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/partialRight.js b/tools/eslint/node_modules/lodash/fp/partialRight.js new file mode 100644 index 00000000000000..7f05fed0ab3bb8 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/partialRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('partialRight', require('../partialRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/partition.js b/tools/eslint/node_modules/lodash/fp/partition.js new file mode 100644 index 00000000000000..2ebcacc1f4d5f3 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/partition.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('partition', require('../partition')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/path.js b/tools/eslint/node_modules/lodash/fp/path.js new file mode 100644 index 00000000000000..b29cfb2139c1cd --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/path.js @@ -0,0 +1 @@ +module.exports = require('./get'); diff --git a/tools/eslint/node_modules/lodash/fp/pathEq.js b/tools/eslint/node_modules/lodash/fp/pathEq.js new file mode 100644 index 00000000000000..36c027a38343f0 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/pathEq.js @@ -0,0 +1 @@ +module.exports = require('./matchesProperty'); diff --git a/tools/eslint/node_modules/lodash/fp/pathOr.js b/tools/eslint/node_modules/lodash/fp/pathOr.js new file mode 100644 index 00000000000000..4ab582091bc39d --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/pathOr.js @@ -0,0 +1 @@ +module.exports = require('./getOr'); diff --git a/tools/eslint/node_modules/lodash/fp/pick.js b/tools/eslint/node_modules/lodash/fp/pick.js new file mode 100644 index 00000000000000..197393de1d2241 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/pick.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pick', require('../pick')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/pickAll.js b/tools/eslint/node_modules/lodash/fp/pickAll.js new file mode 100644 index 00000000000000..a8ecd461311a4f --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/pickAll.js @@ -0,0 +1 @@ +module.exports = require('./pick'); diff --git a/tools/eslint/node_modules/lodash/fp/pickBy.js b/tools/eslint/node_modules/lodash/fp/pickBy.js new file mode 100644 index 00000000000000..d832d16b6c2b04 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/pickBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pickBy', require('../pickBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/pipe.js b/tools/eslint/node_modules/lodash/fp/pipe.js new file mode 100644 index 00000000000000..b2e1e2cc8dc61a --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/pipe.js @@ -0,0 +1 @@ +module.exports = require('./flow'); diff --git a/tools/eslint/node_modules/lodash/fp/placeholder.js b/tools/eslint/node_modules/lodash/fp/placeholder.js new file mode 100644 index 00000000000000..1ce17393b99c34 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/placeholder.js @@ -0,0 +1,6 @@ +/** + * The default argument placeholder value for methods. + * + * @type {Object} + */ +module.exports = {}; diff --git a/tools/eslint/node_modules/lodash/fp/plant.js b/tools/eslint/node_modules/lodash/fp/plant.js new file mode 100644 index 00000000000000..eca8f32b4afa9f --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/plant.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('plant', require('../plant'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/prop.js b/tools/eslint/node_modules/lodash/fp/prop.js new file mode 100644 index 00000000000000..b29cfb2139c1cd --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/prop.js @@ -0,0 +1 @@ +module.exports = require('./get'); diff --git a/tools/eslint/node_modules/lodash/fp/propOf.js b/tools/eslint/node_modules/lodash/fp/propOf.js new file mode 100644 index 00000000000000..cf0d197c62ce0c --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/propOf.js @@ -0,0 +1 @@ +module.exports = require('./propertyOf'); diff --git a/tools/eslint/node_modules/lodash/fp/propOr.js b/tools/eslint/node_modules/lodash/fp/propOr.js new file mode 100644 index 00000000000000..4ab582091bc39d --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/propOr.js @@ -0,0 +1 @@ +module.exports = require('./getOr'); diff --git a/tools/eslint/node_modules/lodash/fp/property.js b/tools/eslint/node_modules/lodash/fp/property.js new file mode 100644 index 00000000000000..d832fbba322ad3 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/property.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('property', require('../property'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/propertyOf.js b/tools/eslint/node_modules/lodash/fp/propertyOf.js new file mode 100644 index 00000000000000..3cfdef790a9e46 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/propertyOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('propertyOf', require('../propertyOf'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/pull.js b/tools/eslint/node_modules/lodash/fp/pull.js new file mode 100644 index 00000000000000..8d7084f0795aca --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/pull.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pull', require('../pull')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/pullAll.js b/tools/eslint/node_modules/lodash/fp/pullAll.js new file mode 100644 index 00000000000000..98d5c9a73a9c03 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/pullAll.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pullAll', require('../pullAll')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/pullAllBy.js b/tools/eslint/node_modules/lodash/fp/pullAllBy.js new file mode 100644 index 00000000000000..876bc3bf1cda84 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/pullAllBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pullAllBy', require('../pullAllBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/pullAllWith.js b/tools/eslint/node_modules/lodash/fp/pullAllWith.js new file mode 100644 index 00000000000000..f71ba4d73db312 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/pullAllWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pullAllWith', require('../pullAllWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/pullAt.js b/tools/eslint/node_modules/lodash/fp/pullAt.js new file mode 100644 index 00000000000000..e8b3bb6125965d --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/pullAt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('pullAt', require('../pullAt')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/random.js b/tools/eslint/node_modules/lodash/fp/random.js new file mode 100644 index 00000000000000..99d852e4ab2436 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/random.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('random', require('../random')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/range.js b/tools/eslint/node_modules/lodash/fp/range.js new file mode 100644 index 00000000000000..a6bb59118b4490 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/range.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('range', require('../range')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/rangeRight.js b/tools/eslint/node_modules/lodash/fp/rangeRight.js new file mode 100644 index 00000000000000..fdb712f94e1e9a --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/rangeRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('rangeRight', require('../rangeRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/rearg.js b/tools/eslint/node_modules/lodash/fp/rearg.js new file mode 100644 index 00000000000000..678e02a32a8941 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/rearg.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('rearg', require('../rearg')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/reduce.js b/tools/eslint/node_modules/lodash/fp/reduce.js new file mode 100644 index 00000000000000..4cef0a0083ca58 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/reduce.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('reduce', require('../reduce')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/reduceRight.js b/tools/eslint/node_modules/lodash/fp/reduceRight.js new file mode 100644 index 00000000000000..caf5bb5155d9f7 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/reduceRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('reduceRight', require('../reduceRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/reject.js b/tools/eslint/node_modules/lodash/fp/reject.js new file mode 100644 index 00000000000000..c1632738619eae --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/reject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('reject', require('../reject')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/remove.js b/tools/eslint/node_modules/lodash/fp/remove.js new file mode 100644 index 00000000000000..e9d13273680413 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/remove.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('remove', require('../remove')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/repeat.js b/tools/eslint/node_modules/lodash/fp/repeat.js new file mode 100644 index 00000000000000..08470f247a36a3 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/repeat.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('repeat', require('../repeat')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/replace.js b/tools/eslint/node_modules/lodash/fp/replace.js new file mode 100644 index 00000000000000..2227db62571126 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/replace.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('replace', require('../replace')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/rest.js b/tools/eslint/node_modules/lodash/fp/rest.js new file mode 100644 index 00000000000000..c1f3d64bdceee0 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/rest.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('rest', require('../rest')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/restFrom.js b/tools/eslint/node_modules/lodash/fp/restFrom.js new file mode 100644 index 00000000000000..714e42b5d6632a --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/restFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('restFrom', require('../rest')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/result.js b/tools/eslint/node_modules/lodash/fp/result.js new file mode 100644 index 00000000000000..f86ce071264248 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/result.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('result', require('../result')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/reverse.js b/tools/eslint/node_modules/lodash/fp/reverse.js new file mode 100644 index 00000000000000..07c9f5e4933056 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/reverse.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('reverse', require('../reverse')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/round.js b/tools/eslint/node_modules/lodash/fp/round.js new file mode 100644 index 00000000000000..4c0e5c829983d1 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/round.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('round', require('../round')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/sample.js b/tools/eslint/node_modules/lodash/fp/sample.js new file mode 100644 index 00000000000000..6bea1254de6069 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/sample.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sample', require('../sample'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/sampleSize.js b/tools/eslint/node_modules/lodash/fp/sampleSize.js new file mode 100644 index 00000000000000..359ed6fcda1501 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/sampleSize.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sampleSize', require('../sampleSize')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/seq.js b/tools/eslint/node_modules/lodash/fp/seq.js new file mode 100644 index 00000000000000..d8f42b0a4daadc --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/seq.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../seq')); diff --git a/tools/eslint/node_modules/lodash/fp/set.js b/tools/eslint/node_modules/lodash/fp/set.js new file mode 100644 index 00000000000000..0b56a56c8a8d3c --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/set.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('set', require('../set')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/setWith.js b/tools/eslint/node_modules/lodash/fp/setWith.js new file mode 100644 index 00000000000000..0b584952b6c469 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/setWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('setWith', require('../setWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/shuffle.js b/tools/eslint/node_modules/lodash/fp/shuffle.js new file mode 100644 index 00000000000000..aa3a1ca5be95d8 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/shuffle.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('shuffle', require('../shuffle'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/size.js b/tools/eslint/node_modules/lodash/fp/size.js new file mode 100644 index 00000000000000..7490136e1cb4d8 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/size.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('size', require('../size'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/slice.js b/tools/eslint/node_modules/lodash/fp/slice.js new file mode 100644 index 00000000000000..15945d321f78d2 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/slice.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('slice', require('../slice')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/snakeCase.js b/tools/eslint/node_modules/lodash/fp/snakeCase.js new file mode 100644 index 00000000000000..a0ff7808eb9223 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/snakeCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('snakeCase', require('../snakeCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/some.js b/tools/eslint/node_modules/lodash/fp/some.js new file mode 100644 index 00000000000000..a4fa2d00602861 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/some.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('some', require('../some')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/sortBy.js b/tools/eslint/node_modules/lodash/fp/sortBy.js new file mode 100644 index 00000000000000..e0790ad5b70ff9 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/sortBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortBy', require('../sortBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/sortedIndex.js b/tools/eslint/node_modules/lodash/fp/sortedIndex.js new file mode 100644 index 00000000000000..364a05435e7714 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/sortedIndex.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedIndex', require('../sortedIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/sortedIndexBy.js b/tools/eslint/node_modules/lodash/fp/sortedIndexBy.js new file mode 100644 index 00000000000000..9593dbd13d6fd2 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/sortedIndexBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedIndexBy', require('../sortedIndexBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/sortedIndexOf.js b/tools/eslint/node_modules/lodash/fp/sortedIndexOf.js new file mode 100644 index 00000000000000..c9084cab6a0319 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/sortedIndexOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedIndexOf', require('../sortedIndexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/sortedLastIndex.js b/tools/eslint/node_modules/lodash/fp/sortedLastIndex.js new file mode 100644 index 00000000000000..47fe241af7d989 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/sortedLastIndex.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedLastIndex', require('../sortedLastIndex')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/sortedLastIndexBy.js b/tools/eslint/node_modules/lodash/fp/sortedLastIndexBy.js new file mode 100644 index 00000000000000..0f9a3473267398 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/sortedLastIndexBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedLastIndexBy', require('../sortedLastIndexBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/sortedLastIndexOf.js b/tools/eslint/node_modules/lodash/fp/sortedLastIndexOf.js new file mode 100644 index 00000000000000..0d4d93278f906e --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/sortedLastIndexOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedLastIndexOf', require('../sortedLastIndexOf')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/sortedUniq.js b/tools/eslint/node_modules/lodash/fp/sortedUniq.js new file mode 100644 index 00000000000000..882d283702cd2f --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/sortedUniq.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedUniq', require('../sortedUniq'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/sortedUniqBy.js b/tools/eslint/node_modules/lodash/fp/sortedUniqBy.js new file mode 100644 index 00000000000000..033db91ca9de25 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/sortedUniqBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sortedUniqBy', require('../sortedUniqBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/split.js b/tools/eslint/node_modules/lodash/fp/split.js new file mode 100644 index 00000000000000..14de1a7efda4ed --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/split.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('split', require('../split')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/spread.js b/tools/eslint/node_modules/lodash/fp/spread.js new file mode 100644 index 00000000000000..2d11b70722dc83 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/spread.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('spread', require('../spread')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/spreadFrom.js b/tools/eslint/node_modules/lodash/fp/spreadFrom.js new file mode 100644 index 00000000000000..0b630df1b38bef --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/spreadFrom.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('spreadFrom', require('../spread')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/startCase.js b/tools/eslint/node_modules/lodash/fp/startCase.js new file mode 100644 index 00000000000000..ada98c943dee83 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/startCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('startCase', require('../startCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/startsWith.js b/tools/eslint/node_modules/lodash/fp/startsWith.js new file mode 100644 index 00000000000000..985e2f2948ca34 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/startsWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('startsWith', require('../startsWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/string.js b/tools/eslint/node_modules/lodash/fp/string.js new file mode 100644 index 00000000000000..773b037048e155 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/string.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../string')); diff --git a/tools/eslint/node_modules/lodash/fp/subtract.js b/tools/eslint/node_modules/lodash/fp/subtract.js new file mode 100644 index 00000000000000..d32b16d4797310 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/subtract.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('subtract', require('../subtract')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/sum.js b/tools/eslint/node_modules/lodash/fp/sum.js new file mode 100644 index 00000000000000..5cce12b325c41c --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/sum.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sum', require('../sum'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/sumBy.js b/tools/eslint/node_modules/lodash/fp/sumBy.js new file mode 100644 index 00000000000000..c8826565f988d6 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/sumBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('sumBy', require('../sumBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/tail.js b/tools/eslint/node_modules/lodash/fp/tail.js new file mode 100644 index 00000000000000..f122f0ac3476e6 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/tail.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('tail', require('../tail'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/take.js b/tools/eslint/node_modules/lodash/fp/take.js new file mode 100644 index 00000000000000..9af98a7bdb6dd9 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/take.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('take', require('../take')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/takeRight.js b/tools/eslint/node_modules/lodash/fp/takeRight.js new file mode 100644 index 00000000000000..b82950a696ca12 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/takeRight.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('takeRight', require('../takeRight')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/takeRightWhile.js b/tools/eslint/node_modules/lodash/fp/takeRightWhile.js new file mode 100644 index 00000000000000..8ffb0a285768e0 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/takeRightWhile.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('takeRightWhile', require('../takeRightWhile')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/takeWhile.js b/tools/eslint/node_modules/lodash/fp/takeWhile.js new file mode 100644 index 00000000000000..28136644fe6ac2 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/takeWhile.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('takeWhile', require('../takeWhile')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/tap.js b/tools/eslint/node_modules/lodash/fp/tap.js new file mode 100644 index 00000000000000..d33ad6ec1e2a4e --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/tap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('tap', require('../tap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/template.js b/tools/eslint/node_modules/lodash/fp/template.js new file mode 100644 index 00000000000000..74857e1c8411b5 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/template.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('template', require('../template')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/templateSettings.js b/tools/eslint/node_modules/lodash/fp/templateSettings.js new file mode 100644 index 00000000000000..7bcc0a82b908fb --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/templateSettings.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('templateSettings', require('../templateSettings'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/throttle.js b/tools/eslint/node_modules/lodash/fp/throttle.js new file mode 100644 index 00000000000000..77fff142840d74 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/throttle.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('throttle', require('../throttle')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/thru.js b/tools/eslint/node_modules/lodash/fp/thru.js new file mode 100644 index 00000000000000..d42b3b1d8404d9 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/thru.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('thru', require('../thru')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/times.js b/tools/eslint/node_modules/lodash/fp/times.js new file mode 100644 index 00000000000000..0dab06dad16c86 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/times.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('times', require('../times')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toArray.js b/tools/eslint/node_modules/lodash/fp/toArray.js new file mode 100644 index 00000000000000..f0c360aca317da --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/toArray.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toArray', require('../toArray'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toInteger.js b/tools/eslint/node_modules/lodash/fp/toInteger.js new file mode 100644 index 00000000000000..e0af6a750e3963 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/toInteger.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toInteger', require('../toInteger'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toIterator.js b/tools/eslint/node_modules/lodash/fp/toIterator.js new file mode 100644 index 00000000000000..65e6baa9ddedf8 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/toIterator.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toIterator', require('../toIterator'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toJSON.js b/tools/eslint/node_modules/lodash/fp/toJSON.js new file mode 100644 index 00000000000000..2d718d0bc1beae --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/toJSON.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toJSON', require('../toJSON'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toLength.js b/tools/eslint/node_modules/lodash/fp/toLength.js new file mode 100644 index 00000000000000..b97cdd935144be --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/toLength.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toLength', require('../toLength'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toLower.js b/tools/eslint/node_modules/lodash/fp/toLower.js new file mode 100644 index 00000000000000..616ef36ada145a --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/toLower.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toLower', require('../toLower'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toNumber.js b/tools/eslint/node_modules/lodash/fp/toNumber.js new file mode 100644 index 00000000000000..d0c6f4d3d6449f --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/toNumber.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toNumber', require('../toNumber'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toPairs.js b/tools/eslint/node_modules/lodash/fp/toPairs.js new file mode 100644 index 00000000000000..af783786ee1d6d --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/toPairs.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toPairs', require('../toPairs'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toPairsIn.js b/tools/eslint/node_modules/lodash/fp/toPairsIn.js new file mode 100644 index 00000000000000..66504abf1f196c --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/toPairsIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toPairsIn', require('../toPairsIn'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toPath.js b/tools/eslint/node_modules/lodash/fp/toPath.js new file mode 100644 index 00000000000000..b4d5e50fb70249 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/toPath.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toPath', require('../toPath'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toPlainObject.js b/tools/eslint/node_modules/lodash/fp/toPlainObject.js new file mode 100644 index 00000000000000..278bb86398d020 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/toPlainObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toPlainObject', require('../toPlainObject'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toSafeInteger.js b/tools/eslint/node_modules/lodash/fp/toSafeInteger.js new file mode 100644 index 00000000000000..367a26fddc7411 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/toSafeInteger.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toSafeInteger', require('../toSafeInteger'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toString.js b/tools/eslint/node_modules/lodash/fp/toString.js new file mode 100644 index 00000000000000..cec4f8e2233261 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/toString.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toString', require('../toString'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/toUpper.js b/tools/eslint/node_modules/lodash/fp/toUpper.js new file mode 100644 index 00000000000000..54f9a560585561 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/toUpper.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('toUpper', require('../toUpper'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/transform.js b/tools/eslint/node_modules/lodash/fp/transform.js new file mode 100644 index 00000000000000..759d088f1a35f0 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/transform.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('transform', require('../transform')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/trim.js b/tools/eslint/node_modules/lodash/fp/trim.js new file mode 100644 index 00000000000000..e6319a741c7689 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/trim.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trim', require('../trim')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/trimChars.js b/tools/eslint/node_modules/lodash/fp/trimChars.js new file mode 100644 index 00000000000000..c9294de48c756f --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/trimChars.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trimChars', require('../trim')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/trimCharsEnd.js b/tools/eslint/node_modules/lodash/fp/trimCharsEnd.js new file mode 100644 index 00000000000000..284bc2f813e897 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/trimCharsEnd.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trimCharsEnd', require('../trimEnd')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/trimCharsStart.js b/tools/eslint/node_modules/lodash/fp/trimCharsStart.js new file mode 100644 index 00000000000000..ff0ee65dfbadc7 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/trimCharsStart.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trimCharsStart', require('../trimStart')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/trimEnd.js b/tools/eslint/node_modules/lodash/fp/trimEnd.js new file mode 100644 index 00000000000000..71908805fceeee --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/trimEnd.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trimEnd', require('../trimEnd')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/trimStart.js b/tools/eslint/node_modules/lodash/fp/trimStart.js new file mode 100644 index 00000000000000..fda902c3893a8b --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/trimStart.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('trimStart', require('../trimStart')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/truncate.js b/tools/eslint/node_modules/lodash/fp/truncate.js new file mode 100644 index 00000000000000..d265c1decb397d --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/truncate.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('truncate', require('../truncate')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/tail.js b/tools/eslint/node_modules/lodash/fp/unapply.js similarity index 100% rename from tools/eslint/node_modules/inquirer/node_modules/lodash/array/tail.js rename to tools/eslint/node_modules/lodash/fp/unapply.js diff --git a/tools/eslint/node_modules/lodash/fp/unary.js b/tools/eslint/node_modules/lodash/fp/unary.js new file mode 100644 index 00000000000000..286c945fb638dd --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/unary.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unary', require('../unary'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/unescape.js b/tools/eslint/node_modules/lodash/fp/unescape.js new file mode 100644 index 00000000000000..fddcb46e2ddb93 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/unescape.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unescape', require('../unescape'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/union.js b/tools/eslint/node_modules/lodash/fp/union.js new file mode 100644 index 00000000000000..ef8228d74c751c --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/union.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('union', require('../union')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/unionBy.js b/tools/eslint/node_modules/lodash/fp/unionBy.js new file mode 100644 index 00000000000000..603687a188edb2 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/unionBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unionBy', require('../unionBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/unionWith.js b/tools/eslint/node_modules/lodash/fp/unionWith.js new file mode 100644 index 00000000000000..65bb3a79287031 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/unionWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unionWith', require('../unionWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/uniq.js b/tools/eslint/node_modules/lodash/fp/uniq.js new file mode 100644 index 00000000000000..bc1852490ba9d1 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/uniq.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('uniq', require('../uniq'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/uniqBy.js b/tools/eslint/node_modules/lodash/fp/uniqBy.js new file mode 100644 index 00000000000000..634c6a8bb3d7aa --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/uniqBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('uniqBy', require('../uniqBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/uniqWith.js b/tools/eslint/node_modules/lodash/fp/uniqWith.js new file mode 100644 index 00000000000000..0ec601a910f5f0 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/uniqWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('uniqWith', require('../uniqWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/uniqueId.js b/tools/eslint/node_modules/lodash/fp/uniqueId.js new file mode 100644 index 00000000000000..aa8fc2f73980d9 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/uniqueId.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('uniqueId', require('../uniqueId')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/unnest.js b/tools/eslint/node_modules/lodash/fp/unnest.js new file mode 100644 index 00000000000000..5d34060aa75a57 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/unnest.js @@ -0,0 +1 @@ +module.exports = require('./flatten'); diff --git a/tools/eslint/node_modules/lodash/fp/unset.js b/tools/eslint/node_modules/lodash/fp/unset.js new file mode 100644 index 00000000000000..ea203a0f39fb59 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/unset.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unset', require('../unset')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/unzip.js b/tools/eslint/node_modules/lodash/fp/unzip.js new file mode 100644 index 00000000000000..cc364b3c5a40ad --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/unzip.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unzip', require('../unzip'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/unzipWith.js b/tools/eslint/node_modules/lodash/fp/unzipWith.js new file mode 100644 index 00000000000000..182eaa10424f3e --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/unzipWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('unzipWith', require('../unzipWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/update.js b/tools/eslint/node_modules/lodash/fp/update.js new file mode 100644 index 00000000000000..b8ce2cc9e1fcc4 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/update.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('update', require('../update')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/updateWith.js b/tools/eslint/node_modules/lodash/fp/updateWith.js new file mode 100644 index 00000000000000..d5e8282d94fdcd --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/updateWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('updateWith', require('../updateWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/upperCase.js b/tools/eslint/node_modules/lodash/fp/upperCase.js new file mode 100644 index 00000000000000..c886f202162a09 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/upperCase.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('upperCase', require('../upperCase'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/upperFirst.js b/tools/eslint/node_modules/lodash/fp/upperFirst.js new file mode 100644 index 00000000000000..d8c04df54bb33b --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/upperFirst.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('upperFirst', require('../upperFirst'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/useWith.js b/tools/eslint/node_modules/lodash/fp/useWith.js new file mode 100644 index 00000000000000..d8b3df5a4e8ce3 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/useWith.js @@ -0,0 +1 @@ +module.exports = require('./overArgs'); diff --git a/tools/eslint/node_modules/lodash/fp/util.js b/tools/eslint/node_modules/lodash/fp/util.js new file mode 100644 index 00000000000000..18c00baed46bd4 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/util.js @@ -0,0 +1,2 @@ +var convert = require('./convert'); +module.exports = convert(require('../util')); diff --git a/tools/eslint/node_modules/lodash/fp/value.js b/tools/eslint/node_modules/lodash/fp/value.js new file mode 100644 index 00000000000000..555eec7a38db21 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/value.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('value', require('../value'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/valueOf.js b/tools/eslint/node_modules/lodash/fp/valueOf.js new file mode 100644 index 00000000000000..f968807d701e97 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/valueOf.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('valueOf', require('../valueOf'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/values.js b/tools/eslint/node_modules/lodash/fp/values.js new file mode 100644 index 00000000000000..2dfc56136b6ee1 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/values.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('values', require('../values'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/valuesIn.js b/tools/eslint/node_modules/lodash/fp/valuesIn.js new file mode 100644 index 00000000000000..a1b2bb8725e3e9 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/valuesIn.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('valuesIn', require('../valuesIn'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/select.js b/tools/eslint/node_modules/lodash/fp/whereEq.js similarity index 100% rename from tools/eslint/node_modules/inquirer/node_modules/lodash/collection/select.js rename to tools/eslint/node_modules/lodash/fp/whereEq.js diff --git a/tools/eslint/node_modules/lodash/fp/without.js b/tools/eslint/node_modules/lodash/fp/without.js new file mode 100644 index 00000000000000..bad9e125bc93a2 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/without.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('without', require('../without')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/words.js b/tools/eslint/node_modules/lodash/fp/words.js new file mode 100644 index 00000000000000..4a901414b8e0ad --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/words.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('words', require('../words')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/wrap.js b/tools/eslint/node_modules/lodash/fp/wrap.js new file mode 100644 index 00000000000000..e93bd8a1de6f41 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/wrap.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrap', require('../wrap')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/wrapperAt.js b/tools/eslint/node_modules/lodash/fp/wrapperAt.js new file mode 100644 index 00000000000000..8f0a310feacb1f --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/wrapperAt.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrapperAt', require('../wrapperAt'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/wrapperChain.js b/tools/eslint/node_modules/lodash/fp/wrapperChain.js new file mode 100644 index 00000000000000..2a48ea2b5b7dfa --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/wrapperChain.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrapperChain', require('../wrapperChain'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/wrapperLodash.js b/tools/eslint/node_modules/lodash/fp/wrapperLodash.js new file mode 100644 index 00000000000000..a7162d084c884f --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/wrapperLodash.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrapperLodash', require('../wrapperLodash'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/wrapperReverse.js b/tools/eslint/node_modules/lodash/fp/wrapperReverse.js new file mode 100644 index 00000000000000..e1481aab9171a5 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/wrapperReverse.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrapperReverse', require('../wrapperReverse'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/wrapperValue.js b/tools/eslint/node_modules/lodash/fp/wrapperValue.js new file mode 100644 index 00000000000000..8eb9112f613785 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/wrapperValue.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('wrapperValue', require('../wrapperValue'), require('./_falseOptions')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/xor.js b/tools/eslint/node_modules/lodash/fp/xor.js new file mode 100644 index 00000000000000..29e2819489386c --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/xor.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('xor', require('../xor')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/xorBy.js b/tools/eslint/node_modules/lodash/fp/xorBy.js new file mode 100644 index 00000000000000..b355686db652c1 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/xorBy.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('xorBy', require('../xorBy')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/xorWith.js b/tools/eslint/node_modules/lodash/fp/xorWith.js new file mode 100644 index 00000000000000..8e05739ad36d82 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/xorWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('xorWith', require('../xorWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/zip.js b/tools/eslint/node_modules/lodash/fp/zip.js new file mode 100644 index 00000000000000..69e147a441da74 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/zip.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('zip', require('../zip')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/inquirer/node_modules/lodash/array/object.js b/tools/eslint/node_modules/lodash/fp/zipObj.js similarity index 100% rename from tools/eslint/node_modules/inquirer/node_modules/lodash/array/object.js rename to tools/eslint/node_modules/lodash/fp/zipObj.js diff --git a/tools/eslint/node_modules/lodash/fp/zipObject.js b/tools/eslint/node_modules/lodash/fp/zipObject.js new file mode 100644 index 00000000000000..462dbb68cb333b --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/zipObject.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('zipObject', require('../zipObject')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/zipObjectDeep.js b/tools/eslint/node_modules/lodash/fp/zipObjectDeep.js new file mode 100644 index 00000000000000..53a5d3380735e6 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/zipObjectDeep.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('zipObjectDeep', require('../zipObjectDeep')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fp/zipWith.js b/tools/eslint/node_modules/lodash/fp/zipWith.js new file mode 100644 index 00000000000000..c5cf9e21282317 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fp/zipWith.js @@ -0,0 +1,5 @@ +var convert = require('./convert'), + func = convert('zipWith', require('../zipWith')); + +func.placeholder = require('./placeholder'); +module.exports = func; diff --git a/tools/eslint/node_modules/lodash/fromPairs.js b/tools/eslint/node_modules/lodash/fromPairs.js new file mode 100644 index 00000000000000..a591488ef955a9 --- /dev/null +++ b/tools/eslint/node_modules/lodash/fromPairs.js @@ -0,0 +1,28 @@ +/** + * The inverse of `_.toPairs`; this method returns an object composed + * from key-value `pairs`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} pairs The key-value pairs. + * @returns {Object} Returns the new object. + * @example + * + * _.fromPairs([['fred', 30], ['barney', 40]]); + * // => { 'fred': 30, 'barney': 40 } + */ +function fromPairs(pairs) { + var index = -1, + length = pairs ? pairs.length : 0, + result = {}; + + while (++index < length) { + var pair = pairs[index]; + result[pair[0]] = pair[1]; + } + return result; +} + +module.exports = fromPairs; diff --git a/tools/eslint/node_modules/lodash/function.js b/tools/eslint/node_modules/lodash/function.js new file mode 100644 index 00000000000000..b0fc6d93e3ab9e --- /dev/null +++ b/tools/eslint/node_modules/lodash/function.js @@ -0,0 +1,25 @@ +module.exports = { + 'after': require('./after'), + 'ary': require('./ary'), + 'before': require('./before'), + 'bind': require('./bind'), + 'bindKey': require('./bindKey'), + 'curry': require('./curry'), + 'curryRight': require('./curryRight'), + 'debounce': require('./debounce'), + 'defer': require('./defer'), + 'delay': require('./delay'), + 'flip': require('./flip'), + 'memoize': require('./memoize'), + 'negate': require('./negate'), + 'once': require('./once'), + 'overArgs': require('./overArgs'), + 'partial': require('./partial'), + 'partialRight': require('./partialRight'), + 'rearg': require('./rearg'), + 'rest': require('./rest'), + 'spread': require('./spread'), + 'throttle': require('./throttle'), + 'unary': require('./unary'), + 'wrap': require('./wrap') +}; diff --git a/tools/eslint/node_modules/lodash/functions.js b/tools/eslint/node_modules/lodash/functions.js new file mode 100644 index 00000000000000..36a9cad2ea457a --- /dev/null +++ b/tools/eslint/node_modules/lodash/functions.js @@ -0,0 +1,30 @@ +var baseFunctions = require('./_baseFunctions'), + keys = require('./keys'); + +/** + * Creates an array of function property names from own enumerable properties + * of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the new array of property names. + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functions(new Foo); + * // => ['a', 'b'] + */ +function functions(object) { + return object == null ? [] : baseFunctions(object, keys(object)); +} + +module.exports = functions; diff --git a/tools/eslint/node_modules/lodash/functionsIn.js b/tools/eslint/node_modules/lodash/functionsIn.js new file mode 100644 index 00000000000000..6bd3b57df91a48 --- /dev/null +++ b/tools/eslint/node_modules/lodash/functionsIn.js @@ -0,0 +1,30 @@ +var baseFunctions = require('./_baseFunctions'), + keysIn = require('./keysIn'); + +/** + * Creates an array of function property names from own and inherited + * enumerable properties of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the new array of property names. + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functionsIn(new Foo); + * // => ['a', 'b', 'c'] + */ +function functionsIn(object) { + return object == null ? [] : baseFunctions(object, keysIn(object)); +} + +module.exports = functionsIn; diff --git a/tools/eslint/node_modules/lodash/get.js b/tools/eslint/node_modules/lodash/get.js new file mode 100644 index 00000000000000..5a5837b2541884 --- /dev/null +++ b/tools/eslint/node_modules/lodash/get.js @@ -0,0 +1,33 @@ +var baseGet = require('./_baseGet'); + +/** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is used in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ +function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; +} + +module.exports = get; diff --git a/tools/eslint/node_modules/lodash/groupBy.js b/tools/eslint/node_modules/lodash/groupBy.js new file mode 100644 index 00000000000000..ae7db5faa354ae --- /dev/null +++ b/tools/eslint/node_modules/lodash/groupBy.js @@ -0,0 +1,41 @@ +var createAggregator = require('./_createAggregator'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': [4.2], '6': [6.1, 6.3] } + * + * // The `_.property` iteratee shorthand. + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ +var groupBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + result[key].push(value); + } else { + result[key] = [value]; + } +}); + +module.exports = groupBy; diff --git a/tools/eslint/node_modules/lodash/gt.js b/tools/eslint/node_modules/lodash/gt.js new file mode 100644 index 00000000000000..2fc9a206ccd4ca --- /dev/null +++ b/tools/eslint/node_modules/lodash/gt.js @@ -0,0 +1,27 @@ +/** + * Checks if `value` is greater than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + * @example + * + * _.gt(3, 1); + * // => true + * + * _.gt(3, 3); + * // => false + * + * _.gt(1, 3); + * // => false + */ +function gt(value, other) { + return value > other; +} + +module.exports = gt; diff --git a/tools/eslint/node_modules/lodash/gte.js b/tools/eslint/node_modules/lodash/gte.js new file mode 100644 index 00000000000000..521be993d23f2f --- /dev/null +++ b/tools/eslint/node_modules/lodash/gte.js @@ -0,0 +1,27 @@ +/** + * Checks if `value` is greater than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than or equal to + * `other`, else `false`. + * @example + * + * _.gte(3, 1); + * // => true + * + * _.gte(3, 3); + * // => true + * + * _.gte(1, 3); + * // => false + */ +function gte(value, other) { + return value >= other; +} + +module.exports = gte; diff --git a/tools/eslint/node_modules/lodash/has.js b/tools/eslint/node_modules/lodash/has.js new file mode 100644 index 00000000000000..34df55e8e2df61 --- /dev/null +++ b/tools/eslint/node_modules/lodash/has.js @@ -0,0 +1,35 @@ +var baseHas = require('./_baseHas'), + hasPath = require('./_hasPath'); + +/** + * Checks if `path` is a direct property of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b'); + * // => true + * + * _.has(object, ['a', 'b']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ +function has(object, path) { + return object != null && hasPath(object, path, baseHas); +} + +module.exports = has; diff --git a/tools/eslint/node_modules/lodash/hasIn.js b/tools/eslint/node_modules/lodash/hasIn.js new file mode 100644 index 00000000000000..06a3686542e672 --- /dev/null +++ b/tools/eslint/node_modules/lodash/hasIn.js @@ -0,0 +1,34 @@ +var baseHasIn = require('./_baseHasIn'), + hasPath = require('./_hasPath'); + +/** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ +function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); +} + +module.exports = hasIn; diff --git a/tools/eslint/node_modules/lodash/head.js b/tools/eslint/node_modules/lodash/head.js new file mode 100644 index 00000000000000..8baa0b8a33a475 --- /dev/null +++ b/tools/eslint/node_modules/lodash/head.js @@ -0,0 +1,23 @@ +/** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ +function head(array) { + return array ? array[0] : undefined; +} + +module.exports = head; diff --git a/tools/eslint/node_modules/lodash/identity.js b/tools/eslint/node_modules/lodash/identity.js new file mode 100644 index 00000000000000..3732edb131b69f --- /dev/null +++ b/tools/eslint/node_modules/lodash/identity.js @@ -0,0 +1,21 @@ +/** + * This method returns the first argument given to it. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'user': 'fred' }; + * + * _.identity(object) === object; + * // => true + */ +function identity(value) { + return value; +} + +module.exports = identity; diff --git a/tools/eslint/node_modules/lodash/inRange.js b/tools/eslint/node_modules/lodash/inRange.js new file mode 100644 index 00000000000000..d864ca2cf3e22e --- /dev/null +++ b/tools/eslint/node_modules/lodash/inRange.js @@ -0,0 +1,53 @@ +var baseInRange = require('./_baseInRange'), + toNumber = require('./toNumber'); + +/** + * Checks if `n` is between `start` and up to but not including, `end`. If + * `end` is not specified, it's set to `start` with `start` then set to `0`. + * If `start` is greater than `end` the params are swapped to support + * negative ranges. + * + * @static + * @memberOf _ + * @since 3.3.0 + * @category Number + * @param {number} number The number to check. + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + * @example + * + * _.inRange(3, 2, 4); + * // => true + * + * _.inRange(4, 8); + * // => true + * + * _.inRange(4, 2); + * // => false + * + * _.inRange(2, 2); + * // => false + * + * _.inRange(1.2, 2); + * // => true + * + * _.inRange(5.2, 4); + * // => false + * + * _.inRange(-3, -2, -6); + * // => true + */ +function inRange(number, start, end) { + start = toNumber(start) || 0; + if (end === undefined) { + end = start; + start = 0; + } else { + end = toNumber(end) || 0; + } + number = toNumber(number); + return baseInRange(number, start, end); +} + +module.exports = inRange; diff --git a/tools/eslint/node_modules/lodash/includes.js b/tools/eslint/node_modules/lodash/includes.js new file mode 100644 index 00000000000000..cefe3bf9487f68 --- /dev/null +++ b/tools/eslint/node_modules/lodash/includes.js @@ -0,0 +1,53 @@ +var baseIndexOf = require('./_baseIndexOf'), + isArrayLike = require('./isArrayLike'), + isString = require('./isString'), + toInteger = require('./toInteger'), + values = require('./values'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to search. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); + * // => true + * + * _.includes('pebbles', 'eb'); + * // => true + */ +function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; + + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); +} + +module.exports = includes; diff --git a/tools/eslint/node_modules/lodash/index.js b/tools/eslint/node_modules/lodash/index.js new file mode 100644 index 00000000000000..5d063e21f339b4 --- /dev/null +++ b/tools/eslint/node_modules/lodash/index.js @@ -0,0 +1 @@ +module.exports = require('./lodash'); \ No newline at end of file diff --git a/tools/eslint/node_modules/lodash/indexOf.js b/tools/eslint/node_modules/lodash/indexOf.js new file mode 100644 index 00000000000000..65616d45490767 --- /dev/null +++ b/tools/eslint/node_modules/lodash/indexOf.js @@ -0,0 +1,42 @@ +var baseIndexOf = require('./_baseIndexOf'), + toInteger = require('./toInteger'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ +function indexOf(array, value, fromIndex) { + var length = array ? array.length : 0; + if (!length) { + return -1; + } + fromIndex = toInteger(fromIndex); + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return baseIndexOf(array, value, fromIndex); +} + +module.exports = indexOf; diff --git a/tools/eslint/node_modules/lodash/initial.js b/tools/eslint/node_modules/lodash/initial.js new file mode 100644 index 00000000000000..f4441b547a6e9c --- /dev/null +++ b/tools/eslint/node_modules/lodash/initial.js @@ -0,0 +1,21 @@ +var dropRight = require('./dropRight'); + +/** + * Gets all but the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + */ +function initial(array) { + return dropRight(array, 1); +} + +module.exports = initial; diff --git a/tools/eslint/node_modules/lodash/intersection.js b/tools/eslint/node_modules/lodash/intersection.js new file mode 100644 index 00000000000000..c525a4ff2e276b --- /dev/null +++ b/tools/eslint/node_modules/lodash/intersection.js @@ -0,0 +1,30 @@ +var arrayMap = require('./_arrayMap'), + baseCastArrayLikeObject = require('./_baseCastArrayLikeObject'), + baseIntersection = require('./_baseIntersection'), + rest = require('./rest'); + +/** + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. The order of result values is determined by the + * order they occur in the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersection([2, 1], [4, 2], [1, 2]); + * // => [2] + */ +var intersection = rest(function(arrays) { + var mapped = arrayMap(arrays, baseCastArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; +}); + +module.exports = intersection; diff --git a/tools/eslint/node_modules/lodash/intersectionBy.js b/tools/eslint/node_modules/lodash/intersectionBy.js new file mode 100644 index 00000000000000..6d8c45f50d4006 --- /dev/null +++ b/tools/eslint/node_modules/lodash/intersectionBy.js @@ -0,0 +1,45 @@ +var arrayMap = require('./_arrayMap'), + baseCastArrayLikeObject = require('./_baseCastArrayLikeObject'), + baseIntersection = require('./_baseIntersection'), + baseIteratee = require('./_baseIteratee'), + last = require('./last'), + rest = require('./rest'); + +/** + * This method is like `_.intersection` except that it accepts `iteratee` + * which is invoked for each element of each `arrays` to generate the criterion + * by which they're compared. Result values are chosen from the first array. + * The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); + * // => [2.1] + * + * // The `_.property` iteratee shorthand. + * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }] + */ +var intersectionBy = rest(function(arrays) { + var iteratee = last(arrays), + mapped = arrayMap(arrays, baseCastArrayLikeObject); + + if (iteratee === last(mapped)) { + iteratee = undefined; + } else { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, baseIteratee(iteratee)) + : []; +}); + +module.exports = intersectionBy; diff --git a/tools/eslint/node_modules/lodash/intersectionWith.js b/tools/eslint/node_modules/lodash/intersectionWith.js new file mode 100644 index 00000000000000..2985e3fcb08877 --- /dev/null +++ b/tools/eslint/node_modules/lodash/intersectionWith.js @@ -0,0 +1,42 @@ +var arrayMap = require('./_arrayMap'), + baseCastArrayLikeObject = require('./_baseCastArrayLikeObject'), + baseIntersection = require('./_baseIntersection'), + last = require('./last'), + rest = require('./rest'); + +/** + * This method is like `_.intersection` except that it accepts `comparator` + * which is invoked to compare elements of `arrays`. Result values are chosen + * from the first array. The comparator is invoked with two arguments: + * (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.intersectionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }] + */ +var intersectionWith = rest(function(arrays) { + var comparator = last(arrays), + mapped = arrayMap(arrays, baseCastArrayLikeObject); + + if (comparator === last(mapped)) { + comparator = undefined; + } else { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, undefined, comparator) + : []; +}); + +module.exports = intersectionWith; diff --git a/tools/eslint/node_modules/lodash/invert.js b/tools/eslint/node_modules/lodash/invert.js new file mode 100644 index 00000000000000..21d10aba370dd7 --- /dev/null +++ b/tools/eslint/node_modules/lodash/invert.js @@ -0,0 +1,27 @@ +var constant = require('./constant'), + createInverter = require('./_createInverter'), + identity = require('./identity'); + +/** + * Creates an object composed of the inverted keys and values of `object`. + * If `object` contains duplicate values, subsequent values overwrite + * property assignments of previous values. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Object + * @param {Object} object The object to invert. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invert(object); + * // => { '1': 'c', '2': 'b' } + */ +var invert = createInverter(function(result, value, key) { + result[value] = key; +}, constant(identity)); + +module.exports = invert; diff --git a/tools/eslint/node_modules/lodash/invertBy.js b/tools/eslint/node_modules/lodash/invertBy.js new file mode 100644 index 00000000000000..4298199ccd1e0a --- /dev/null +++ b/tools/eslint/node_modules/lodash/invertBy.js @@ -0,0 +1,45 @@ +var baseIteratee = require('./_baseIteratee'), + createInverter = require('./_createInverter'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * This method is like `_.invert` except that the inverted object is generated + * from the results of running each element of `object` thru `iteratee`. The + * corresponding inverted value of each inverted key is an array of keys + * responsible for generating the inverted value. The iteratee is invoked + * with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Object + * @param {Object} object The object to invert. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invertBy(object); + * // => { '1': ['a', 'c'], '2': ['b'] } + * + * _.invertBy(object, function(value) { + * return 'group' + value; + * }); + * // => { 'group1': ['a', 'c'], 'group2': ['b'] } + */ +var invertBy = createInverter(function(result, value, key) { + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } +}, baseIteratee); + +module.exports = invertBy; diff --git a/tools/eslint/node_modules/lodash/invoke.js b/tools/eslint/node_modules/lodash/invoke.js new file mode 100644 index 00000000000000..7b6f56bb1fc354 --- /dev/null +++ b/tools/eslint/node_modules/lodash/invoke.js @@ -0,0 +1,24 @@ +var baseInvoke = require('./_baseInvoke'), + rest = require('./rest'); + +/** + * Invokes the method at `path` of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + * @example + * + * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; + * + * _.invoke(object, 'a[0].b.c.slice', 1, 3); + * // => [2, 3] + */ +var invoke = rest(baseInvoke); + +module.exports = invoke; diff --git a/tools/eslint/node_modules/lodash/invokeMap.js b/tools/eslint/node_modules/lodash/invokeMap.js new file mode 100644 index 00000000000000..4a6063e0aadfe3 --- /dev/null +++ b/tools/eslint/node_modules/lodash/invokeMap.js @@ -0,0 +1,44 @@ +var apply = require('./_apply'), + baseEach = require('./_baseEach'), + baseInvoke = require('./_baseInvoke'), + isArrayLike = require('./isArrayLike'), + isKey = require('./_isKey'), + rest = require('./rest'); + +/** + * Invokes the method at `path` of each element in `collection`, returning + * an array of the results of each invoked method. Any additional arguments + * are provided to each invoked method. If `methodName` is a function, it's + * invoked for and `this` bound to, each element in `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|string} path The path of the method to invoke or + * the function invoked per iteration. + * @param {...*} [args] The arguments to invoke each method with. + * @returns {Array} Returns the array of results. + * @example + * + * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invokeMap([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ +var invokeMap = rest(function(collection, path, args) { + var index = -1, + isFunc = typeof path == 'function', + isProp = isKey(path), + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value) { + var func = isFunc ? path : ((isProp && value != null) ? value[path] : undefined); + result[++index] = func ? apply(func, value, args) : baseInvoke(value, path, args); + }); + return result; +}); + +module.exports = invokeMap; diff --git a/tools/eslint/node_modules/lodash/isArguments.js b/tools/eslint/node_modules/lodash/isArguments.js new file mode 100644 index 00000000000000..3ca0d3ca120601 --- /dev/null +++ b/tools/eslint/node_modules/lodash/isArguments.js @@ -0,0 +1,46 @@ +var isArrayLikeObject = require('./isArrayLikeObject'); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +} + +module.exports = isArguments; diff --git a/tools/eslint/node_modules/lodash/isArray.js b/tools/eslint/node_modules/lodash/isArray.js new file mode 100644 index 00000000000000..1901120e7e2382 --- /dev/null +++ b/tools/eslint/node_modules/lodash/isArray.js @@ -0,0 +1,28 @@ +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @type {Function} + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +module.exports = isArray; diff --git a/tools/eslint/node_modules/lodash/isArrayBuffer.js b/tools/eslint/node_modules/lodash/isArrayBuffer.js new file mode 100644 index 00000000000000..0a6a8e67614d6f --- /dev/null +++ b/tools/eslint/node_modules/lodash/isArrayBuffer.js @@ -0,0 +1,37 @@ +var isObjectLike = require('./isObjectLike'); + +var arrayBufferTag = '[object ArrayBuffer]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** + * Checks if `value` is classified as an `ArrayBuffer` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isArrayBuffer(new ArrayBuffer(2)); + * // => true + * + * _.isArrayBuffer(new Array(2)); + * // => false + */ +function isArrayBuffer(value) { + return isObjectLike(value) && objectToString.call(value) == arrayBufferTag; +} + +module.exports = isArrayBuffer; diff --git a/tools/eslint/node_modules/lodash/isArrayLike.js b/tools/eslint/node_modules/lodash/isArrayLike.js new file mode 100644 index 00000000000000..189a611f005804 --- /dev/null +++ b/tools/eslint/node_modules/lodash/isArrayLike.js @@ -0,0 +1,34 @@ +var getLength = require('./_getLength'), + isFunction = require('./isFunction'), + isLength = require('./isLength'); + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(getLength(value)) && !isFunction(value); +} + +module.exports = isArrayLike; diff --git a/tools/eslint/node_modules/lodash/isArrayLikeObject.js b/tools/eslint/node_modules/lodash/isArrayLikeObject.js new file mode 100644 index 00000000000000..6c4812a8d862d3 --- /dev/null +++ b/tools/eslint/node_modules/lodash/isArrayLikeObject.js @@ -0,0 +1,33 @@ +var isArrayLike = require('./isArrayLike'), + isObjectLike = require('./isObjectLike'); + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +module.exports = isArrayLikeObject; diff --git a/tools/eslint/node_modules/lodash/isBoolean.js b/tools/eslint/node_modules/lodash/isBoolean.js new file mode 100644 index 00000000000000..242fad1ffd0a34 --- /dev/null +++ b/tools/eslint/node_modules/lodash/isBoolean.js @@ -0,0 +1,39 @@ +var isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var boolTag = '[object Boolean]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ +function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && objectToString.call(value) == boolTag); +} + +module.exports = isBoolean; diff --git a/tools/eslint/node_modules/lodash/isBuffer.js b/tools/eslint/node_modules/lodash/isBuffer.js new file mode 100644 index 00000000000000..404c22200ca75f --- /dev/null +++ b/tools/eslint/node_modules/lodash/isBuffer.js @@ -0,0 +1,49 @@ +var constant = require('./constant'), + root = require('./_root'); + +/** Used to determine if values are of the language type `Object`. */ +var objectTypes = { + 'function': true, + 'object': true +}; + +/** Detect free variable `exports`. */ +var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) + ? exports + : undefined; + +/** Detect free variable `module`. */ +var freeModule = (objectTypes[typeof module] && module && !module.nodeType) + ? module + : undefined; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = (freeModule && freeModule.exports === freeExports) + ? freeExports + : undefined; + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined; + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = !Buffer ? constant(false) : function(value) { + return value instanceof Buffer; +}; + +module.exports = isBuffer; diff --git a/tools/eslint/node_modules/lodash/isDate.js b/tools/eslint/node_modules/lodash/isDate.js new file mode 100644 index 00000000000000..f85a801747d47c --- /dev/null +++ b/tools/eslint/node_modules/lodash/isDate.js @@ -0,0 +1,38 @@ +var isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var dateTag = '[object Date]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ +function isDate(value) { + return isObjectLike(value) && objectToString.call(value) == dateTag; +} + +module.exports = isDate; diff --git a/tools/eslint/node_modules/lodash/isElement.js b/tools/eslint/node_modules/lodash/isElement.js new file mode 100644 index 00000000000000..67aca5dc7fa949 --- /dev/null +++ b/tools/eslint/node_modules/lodash/isElement.js @@ -0,0 +1,26 @@ +var isObjectLike = require('./isObjectLike'), + isPlainObject = require('./isPlainObject'); + +/** + * Checks if `value` is likely a DOM element. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a DOM element, + * else `false`. + * @example + * + * _.isElement(document.body); + * // => true + * + * _.isElement(''); + * // => false + */ +function isElement(value) { + return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value); +} + +module.exports = isElement; diff --git a/tools/eslint/node_modules/lodash/isEmpty.js b/tools/eslint/node_modules/lodash/isEmpty.js new file mode 100644 index 00000000000000..9d4649690bdb13 --- /dev/null +++ b/tools/eslint/node_modules/lodash/isEmpty.js @@ -0,0 +1,80 @@ +var getTag = require('./_getTag'), + isArguments = require('./isArguments'), + isArray = require('./isArray'), + isArrayLike = require('./isArrayLike'), + isBuffer = require('./isBuffer'), + isFunction = require('./isFunction'), + isObjectLike = require('./isObjectLike'), + isString = require('./isString'), + keys = require('./keys'); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]', + setTag = '[object Set]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */ +var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf'); + +/** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ +function isEmpty(value) { + if (isArrayLike(value) && + (isArray(value) || isString(value) || isFunction(value.splice) || + isArguments(value) || isBuffer(value))) { + return !value.length; + } + if (isObjectLike(value)) { + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return !(nonEnumShadows && keys(value).length); +} + +module.exports = isEmpty; diff --git a/tools/eslint/node_modules/lodash/isEqual.js b/tools/eslint/node_modules/lodash/isEqual.js new file mode 100644 index 00000000000000..dd5d0cc7ce0939 --- /dev/null +++ b/tools/eslint/node_modules/lodash/isEqual.js @@ -0,0 +1,36 @@ +var baseIsEqual = require('./_baseIsEqual'); + +/** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are **not** supported. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, + * else `false`. + * @example + * + * var object = { 'user': 'fred' }; + * var other = { 'user': 'fred' }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ +function isEqual(value, other) { + return baseIsEqual(value, other); +} + +module.exports = isEqual; diff --git a/tools/eslint/node_modules/lodash/isEqualWith.js b/tools/eslint/node_modules/lodash/isEqualWith.js new file mode 100644 index 00000000000000..a442b248f3a3c7 --- /dev/null +++ b/tools/eslint/node_modules/lodash/isEqualWith.js @@ -0,0 +1,42 @@ +var baseIsEqual = require('./_baseIsEqual'); + +/** + * This method is like `_.isEqual` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with up to + * six arguments: (objValue, othValue [, index|key, object, other, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if the values are equivalent, + * else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, othValue) { + * if (isGreeting(objValue) && isGreeting(othValue)) { + * return true; + * } + * } + * + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqualWith(array, other, customizer); + * // => true + */ +function isEqualWith(value, other, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + var result = customizer ? customizer(value, other) : undefined; + return result === undefined ? baseIsEqual(value, other, customizer) : !!result; +} + +module.exports = isEqualWith; diff --git a/tools/eslint/node_modules/lodash/isError.js b/tools/eslint/node_modules/lodash/isError.js new file mode 100644 index 00000000000000..b4a93aebe24764 --- /dev/null +++ b/tools/eslint/node_modules/lodash/isError.js @@ -0,0 +1,43 @@ +var isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var errorTag = '[object Error]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, + * else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false + */ +function isError(value) { + if (!isObjectLike(value)) { + return false; + } + return (objectToString.call(value) == errorTag) || + (typeof value.message == 'string' && typeof value.name == 'string'); +} + +module.exports = isError; diff --git a/tools/eslint/node_modules/lodash/isFinite.js b/tools/eslint/node_modules/lodash/isFinite.js new file mode 100644 index 00000000000000..744e7a65e1e4db --- /dev/null +++ b/tools/eslint/node_modules/lodash/isFinite.js @@ -0,0 +1,37 @@ +var root = require('./_root'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsFinite = root.isFinite; + +/** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, + * else `false`. + * @example + * + * _.isFinite(3); + * // => true + * + * _.isFinite(Number.MAX_VALUE); + * // => true + * + * _.isFinite(3.14); + * // => true + * + * _.isFinite(Infinity); + * // => false + */ +function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); +} + +module.exports = isFinite; diff --git a/tools/eslint/node_modules/lodash/isFunction.js b/tools/eslint/node_modules/lodash/isFunction.js new file mode 100644 index 00000000000000..da02be0e10be32 --- /dev/null +++ b/tools/eslint/node_modules/lodash/isFunction.js @@ -0,0 +1,43 @@ +var isObject = require('./isObject'); + +/** `Object#toString` result references. */ +var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array and weak map constructors, + // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +module.exports = isFunction; diff --git a/tools/eslint/node_modules/lodash/isInteger.js b/tools/eslint/node_modules/lodash/isInteger.js new file mode 100644 index 00000000000000..66aa87d573d717 --- /dev/null +++ b/tools/eslint/node_modules/lodash/isInteger.js @@ -0,0 +1,33 @@ +var toInteger = require('./toInteger'); + +/** + * Checks if `value` is an integer. + * + * **Note:** This method is based on + * [`Number.isInteger`](https://mdn.io/Number/isInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an integer, else `false`. + * @example + * + * _.isInteger(3); + * // => true + * + * _.isInteger(Number.MIN_VALUE); + * // => false + * + * _.isInteger(Infinity); + * // => false + * + * _.isInteger('3'); + * // => false + */ +function isInteger(value) { + return typeof value == 'number' && value == toInteger(value); +} + +module.exports = isInteger; diff --git a/tools/eslint/node_modules/lodash/isLength.js b/tools/eslint/node_modules/lodash/isLength.js new file mode 100644 index 00000000000000..cd9b2572178cb9 --- /dev/null +++ b/tools/eslint/node_modules/lodash/isLength.js @@ -0,0 +1,36 @@ +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, + * else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +module.exports = isLength; diff --git a/tools/eslint/node_modules/lodash/isMap.js b/tools/eslint/node_modules/lodash/isMap.js new file mode 100644 index 00000000000000..f83758e13bac1e --- /dev/null +++ b/tools/eslint/node_modules/lodash/isMap.js @@ -0,0 +1,29 @@ +var getTag = require('./_getTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var mapTag = '[object Map]'; + +/** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */ +function isMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; +} + +module.exports = isMap; diff --git a/tools/eslint/node_modules/lodash/isMatch.js b/tools/eslint/node_modules/lodash/isMatch.js new file mode 100644 index 00000000000000..371e4458b2a18a --- /dev/null +++ b/tools/eslint/node_modules/lodash/isMatch.js @@ -0,0 +1,32 @@ +var baseIsMatch = require('./_baseIsMatch'), + getMatchData = require('./_getMatchData'); + +/** + * Performs a partial deep comparison between `object` and `source` to + * determine if `object` contains equivalent property values. This method is + * equivalent to a `_.matches` function when `source` is partially applied. + * + * **Note:** This method supports comparing the same values as `_.isEqual`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * var object = { 'user': 'fred', 'age': 40 }; + * + * _.isMatch(object, { 'age': 40 }); + * // => true + * + * _.isMatch(object, { 'age': 36 }); + * // => false + */ +function isMatch(object, source) { + return object === source || baseIsMatch(object, source, getMatchData(source)); +} + +module.exports = isMatch; diff --git a/tools/eslint/node_modules/lodash/isMatchWith.js b/tools/eslint/node_modules/lodash/isMatchWith.js new file mode 100644 index 00000000000000..187b6a61de55d0 --- /dev/null +++ b/tools/eslint/node_modules/lodash/isMatchWith.js @@ -0,0 +1,41 @@ +var baseIsMatch = require('./_baseIsMatch'), + getMatchData = require('./_getMatchData'); + +/** + * This method is like `_.isMatch` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with five + * arguments: (objValue, srcValue, index|key, object, source). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, srcValue) { + * if (isGreeting(objValue) && isGreeting(srcValue)) { + * return true; + * } + * } + * + * var object = { 'greeting': 'hello' }; + * var source = { 'greeting': 'hi' }; + * + * _.isMatchWith(object, source, customizer); + * // => true + */ +function isMatchWith(object, source, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseIsMatch(object, source, getMatchData(source), customizer); +} + +module.exports = isMatchWith; diff --git a/tools/eslint/node_modules/lodash/isNaN.js b/tools/eslint/node_modules/lodash/isNaN.js new file mode 100644 index 00000000000000..7d0d783bada2ce --- /dev/null +++ b/tools/eslint/node_modules/lodash/isNaN.js @@ -0,0 +1,38 @@ +var isNumber = require('./isNumber'); + +/** + * Checks if `value` is `NaN`. + * + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ +function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. + return isNumber(value) && value != +value; +} + +module.exports = isNaN; diff --git a/tools/eslint/node_modules/lodash/isNative.js b/tools/eslint/node_modules/lodash/isNative.js new file mode 100644 index 00000000000000..2d5149ba457718 --- /dev/null +++ b/tools/eslint/node_modules/lodash/isNative.js @@ -0,0 +1,56 @@ +var isFunction = require('./isFunction'), + isHostObject = require('./_isHostObject'), + isObject = require('./isObject'), + toSource = require('./_toSource'); + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = Function.prototype.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ +function isNative(value) { + if (!isObject(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +module.exports = isNative; diff --git a/tools/eslint/node_modules/lodash/isNil.js b/tools/eslint/node_modules/lodash/isNil.js new file mode 100644 index 00000000000000..79f05052c5ed9c --- /dev/null +++ b/tools/eslint/node_modules/lodash/isNil.js @@ -0,0 +1,25 @@ +/** + * Checks if `value` is `null` or `undefined`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is nullish, else `false`. + * @example + * + * _.isNil(null); + * // => true + * + * _.isNil(void 0); + * // => true + * + * _.isNil(NaN); + * // => false + */ +function isNil(value) { + return value == null; +} + +module.exports = isNil; diff --git a/tools/eslint/node_modules/lodash/isNull.js b/tools/eslint/node_modules/lodash/isNull.js new file mode 100644 index 00000000000000..c0a374d7dc178a --- /dev/null +++ b/tools/eslint/node_modules/lodash/isNull.js @@ -0,0 +1,22 @@ +/** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ +function isNull(value) { + return value === null; +} + +module.exports = isNull; diff --git a/tools/eslint/node_modules/lodash/isNumber.js b/tools/eslint/node_modules/lodash/isNumber.js new file mode 100644 index 00000000000000..e427282ac85905 --- /dev/null +++ b/tools/eslint/node_modules/lodash/isNumber.js @@ -0,0 +1,48 @@ +var isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var numberTag = '[object Number]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ +function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && objectToString.call(value) == numberTag); +} + +module.exports = isNumber; diff --git a/tools/eslint/node_modules/lodash/isObject.js b/tools/eslint/node_modules/lodash/isObject.js new file mode 100644 index 00000000000000..d16542f8bf3830 --- /dev/null +++ b/tools/eslint/node_modules/lodash/isObject.js @@ -0,0 +1,31 @@ +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +module.exports = isObject; diff --git a/tools/eslint/node_modules/lodash/isObjectLike.js b/tools/eslint/node_modules/lodash/isObjectLike.js new file mode 100644 index 00000000000000..e34114be54058c --- /dev/null +++ b/tools/eslint/node_modules/lodash/isObjectLike.js @@ -0,0 +1,29 @@ +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +module.exports = isObjectLike; diff --git a/tools/eslint/node_modules/lodash/isPlainObject.js b/tools/eslint/node_modules/lodash/isPlainObject.js new file mode 100644 index 00000000000000..13a90e7d03a842 --- /dev/null +++ b/tools/eslint/node_modules/lodash/isPlainObject.js @@ -0,0 +1,70 @@ +var getPrototype = require('./_getPrototype'), + isHostObject = require('./_isHostObject'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var objectTag = '[object Object]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var funcToString = Function.prototype.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to infer the `Object` constructor. */ +var objectCtorString = funcToString.call(Object); + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, + * else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ +function isPlainObject(value) { + if (!isObjectLike(value) || + objectToString.call(value) != objectTag || isHostObject(value)) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return (typeof Ctor == 'function' && + Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString); +} + +module.exports = isPlainObject; diff --git a/tools/eslint/node_modules/lodash/isRegExp.js b/tools/eslint/node_modules/lodash/isRegExp.js new file mode 100644 index 00000000000000..8eeb4103ec9fc8 --- /dev/null +++ b/tools/eslint/node_modules/lodash/isRegExp.js @@ -0,0 +1,38 @@ +var isObject = require('./isObject'); + +/** `Object#toString` result references. */ +var regexpTag = '[object RegExp]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ +function isRegExp(value) { + return isObject(value) && objectToString.call(value) == regexpTag; +} + +module.exports = isRegExp; diff --git a/tools/eslint/node_modules/lodash/isSafeInteger.js b/tools/eslint/node_modules/lodash/isSafeInteger.js new file mode 100644 index 00000000000000..a780afb6b64196 --- /dev/null +++ b/tools/eslint/node_modules/lodash/isSafeInteger.js @@ -0,0 +1,38 @@ +var isInteger = require('./isInteger'); + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 + * double precision number which isn't the result of a rounded unsafe integer. + * + * **Note:** This method is based on + * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a safe integer, + * else `false`. + * @example + * + * _.isSafeInteger(3); + * // => true + * + * _.isSafeInteger(Number.MIN_VALUE); + * // => false + * + * _.isSafeInteger(Infinity); + * // => false + * + * _.isSafeInteger('3'); + * // => false + */ +function isSafeInteger(value) { + return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; +} + +module.exports = isSafeInteger; diff --git a/tools/eslint/node_modules/lodash/isSet.js b/tools/eslint/node_modules/lodash/isSet.js new file mode 100644 index 00000000000000..9030dc44e031cd --- /dev/null +++ b/tools/eslint/node_modules/lodash/isSet.js @@ -0,0 +1,29 @@ +var getTag = require('./_getTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var setTag = '[object Set]'; + +/** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */ +function isSet(value) { + return isObjectLike(value) && getTag(value) == setTag; +} + +module.exports = isSet; diff --git a/tools/eslint/node_modules/lodash/isString.js b/tools/eslint/node_modules/lodash/isString.js new file mode 100644 index 00000000000000..573de3b53cfa1b --- /dev/null +++ b/tools/eslint/node_modules/lodash/isString.js @@ -0,0 +1,40 @@ +var isArray = require('./isArray'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var stringTag = '[object String]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ +function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag); +} + +module.exports = isString; diff --git a/tools/eslint/node_modules/lodash/isSymbol.js b/tools/eslint/node_modules/lodash/isSymbol.js new file mode 100644 index 00000000000000..21dd55927d3e54 --- /dev/null +++ b/tools/eslint/node_modules/lodash/isSymbol.js @@ -0,0 +1,39 @@ +var isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var symbolTag = '[object Symbol]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ +function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); +} + +module.exports = isSymbol; diff --git a/tools/eslint/node_modules/lodash/isTypedArray.js b/tools/eslint/node_modules/lodash/isTypedArray.js new file mode 100644 index 00000000000000..0d86b90cb6e020 --- /dev/null +++ b/tools/eslint/node_modules/lodash/isTypedArray.js @@ -0,0 +1,80 @@ +var isLength = require('./isLength'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +function isTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; +} + +module.exports = isTypedArray; diff --git a/tools/eslint/node_modules/lodash/isUndefined.js b/tools/eslint/node_modules/lodash/isUndefined.js new file mode 100644 index 00000000000000..377d121ab8e93d --- /dev/null +++ b/tools/eslint/node_modules/lodash/isUndefined.js @@ -0,0 +1,22 @@ +/** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ +function isUndefined(value) { + return value === undefined; +} + +module.exports = isUndefined; diff --git a/tools/eslint/node_modules/lodash/isWeakMap.js b/tools/eslint/node_modules/lodash/isWeakMap.js new file mode 100644 index 00000000000000..cd7b9ed81d9853 --- /dev/null +++ b/tools/eslint/node_modules/lodash/isWeakMap.js @@ -0,0 +1,29 @@ +var getTag = require('./_getTag'), + isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var weakMapTag = '[object WeakMap]'; + +/** + * Checks if `value` is classified as a `WeakMap` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isWeakMap(new WeakMap); + * // => true + * + * _.isWeakMap(new Map); + * // => false + */ +function isWeakMap(value) { + return isObjectLike(value) && getTag(value) == weakMapTag; +} + +module.exports = isWeakMap; diff --git a/tools/eslint/node_modules/lodash/isWeakSet.js b/tools/eslint/node_modules/lodash/isWeakSet.js new file mode 100644 index 00000000000000..5395797ae6c2e6 --- /dev/null +++ b/tools/eslint/node_modules/lodash/isWeakSet.js @@ -0,0 +1,38 @@ +var isObjectLike = require('./isObjectLike'); + +/** `Object#toString` result references. */ +var weakSetTag = '[object WeakSet]'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** + * Checks if `value` is classified as a `WeakSet` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isWeakSet(new WeakSet); + * // => true + * + * _.isWeakSet(new Set); + * // => false + */ +function isWeakSet(value) { + return isObjectLike(value) && objectToString.call(value) == weakSetTag; +} + +module.exports = isWeakSet; diff --git a/tools/eslint/node_modules/lodash/iteratee.js b/tools/eslint/node_modules/lodash/iteratee.js new file mode 100644 index 00000000000000..8ec05887671d0b --- /dev/null +++ b/tools/eslint/node_modules/lodash/iteratee.js @@ -0,0 +1,50 @@ +var baseClone = require('./_baseClone'), + baseIteratee = require('./_baseIteratee'); + +/** + * Creates a function that invokes `func` with the arguments of the created + * function. If `func` is a property name, the created function returns the + * property value for a given element. If `func` is an array or object, the + * created function returns `true` for elements that contain the equivalent + * source properties, otherwise it returns `false`. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Util + * @param {*} [func=_.identity] The value to convert to a callback. + * @returns {Function} Returns the callback. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); + * // => [{ 'user': 'barney', 'age': 36, 'active': true }] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, _.iteratee(['user', 'fred'])); + * // => [{ 'user': 'fred', 'age': 40 }] + * + * // The `_.property` iteratee shorthand. + * _.map(users, _.iteratee('user')); + * // => ['barney', 'fred'] + * + * // Create custom iteratee shorthands. + * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { + * return !_.isRegExp(func) ? iteratee(func) : function(string) { + * return func.test(string); + * }; + * }); + * + * _.filter(['abc', 'def'], /ef/); + * // => ['def'] + */ +function iteratee(func) { + return baseIteratee(typeof func == 'function' ? func : baseClone(func, true)); +} + +module.exports = iteratee; diff --git a/tools/eslint/node_modules/lodash/join.js b/tools/eslint/node_modules/lodash/join.js new file mode 100644 index 00000000000000..fe31067664ac8a --- /dev/null +++ b/tools/eslint/node_modules/lodash/join.js @@ -0,0 +1,26 @@ +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeJoin = arrayProto.join; + +/** + * Converts all elements in `array` into a string separated by `separator`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to convert. + * @param {string} [separator=','] The element separator. + * @returns {string} Returns the joined string. + * @example + * + * _.join(['a', 'b', 'c'], '~'); + * // => 'a~b~c' + */ +function join(array, separator) { + return array ? nativeJoin.call(array, separator) : ''; +} + +module.exports = join; diff --git a/tools/eslint/node_modules/lodash/kebabCase.js b/tools/eslint/node_modules/lodash/kebabCase.js new file mode 100644 index 00000000000000..8a52be64555638 --- /dev/null +++ b/tools/eslint/node_modules/lodash/kebabCase.js @@ -0,0 +1,28 @@ +var createCompounder = require('./_createCompounder'); + +/** + * Converts `string` to + * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the kebab cased string. + * @example + * + * _.kebabCase('Foo Bar'); + * // => 'foo-bar' + * + * _.kebabCase('fooBar'); + * // => 'foo-bar' + * + * _.kebabCase('__FOO_BAR__'); + * // => 'foo-bar' + */ +var kebabCase = createCompounder(function(result, word, index) { + return result + (index ? '-' : '') + word.toLowerCase(); +}); + +module.exports = kebabCase; diff --git a/tools/eslint/node_modules/lodash/keyBy.js b/tools/eslint/node_modules/lodash/keyBy.js new file mode 100644 index 00000000000000..97e6f4b38e2461 --- /dev/null +++ b/tools/eslint/node_modules/lodash/keyBy.js @@ -0,0 +1,36 @@ +var createAggregator = require('./_createAggregator'); + +/** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the last element responsible for generating the key. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var array = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.keyBy(array, function(o) { + * return String.fromCharCode(o.code); + * }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.keyBy(array, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + */ +var keyBy = createAggregator(function(result, value, key) { + result[key] = value; +}); + +module.exports = keyBy; diff --git a/tools/eslint/node_modules/lodash/keys.js b/tools/eslint/node_modules/lodash/keys.js new file mode 100644 index 00000000000000..186a4fedd0a256 --- /dev/null +++ b/tools/eslint/node_modules/lodash/keys.js @@ -0,0 +1,56 @@ +var baseHas = require('./_baseHas'), + baseKeys = require('./_baseKeys'), + indexKeys = require('./_indexKeys'), + isArrayLike = require('./isArrayLike'), + isIndex = require('./_isIndex'), + isPrototype = require('./_isPrototype'); + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + var isProto = isPrototype(object); + if (!(isProto || isArrayLike(object))) { + return baseKeys(object); + } + var indexes = indexKeys(object), + skipIndexes = !!indexes, + result = indexes || [], + length = result.length; + + for (var key in object) { + if (baseHas(object, key) && + !(skipIndexes && (key == 'length' || isIndex(key, length))) && + !(isProto && key == 'constructor')) { + result.push(key); + } + } + return result; +} + +module.exports = keys; diff --git a/tools/eslint/node_modules/lodash/keysIn.js b/tools/eslint/node_modules/lodash/keysIn.js new file mode 100644 index 00000000000000..d2fb91cb32b1e9 --- /dev/null +++ b/tools/eslint/node_modules/lodash/keysIn.js @@ -0,0 +1,55 @@ +var baseKeysIn = require('./_baseKeysIn'), + indexKeys = require('./_indexKeys'), + isIndex = require('./_isIndex'), + isPrototype = require('./_isPrototype'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + var index = -1, + isProto = isPrototype(object), + props = baseKeysIn(object), + propsLength = props.length, + indexes = indexKeys(object), + skipIndexes = !!indexes, + result = indexes || [], + length = result.length; + + while (++index < propsLength) { + var key = props[index]; + if (!(skipIndexes && (key == 'length' || isIndex(key, length))) && + !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; +} + +module.exports = keysIn; diff --git a/tools/eslint/node_modules/lodash/lang.js b/tools/eslint/node_modules/lodash/lang.js new file mode 100644 index 00000000000000..665f5c66ceade1 --- /dev/null +++ b/tools/eslint/node_modules/lodash/lang.js @@ -0,0 +1,56 @@ +module.exports = { + 'castArray': require('./castArray'), + 'clone': require('./clone'), + 'cloneDeep': require('./cloneDeep'), + 'cloneDeepWith': require('./cloneDeepWith'), + 'cloneWith': require('./cloneWith'), + 'eq': require('./eq'), + 'gt': require('./gt'), + 'gte': require('./gte'), + 'isArguments': require('./isArguments'), + 'isArray': require('./isArray'), + 'isArrayBuffer': require('./isArrayBuffer'), + 'isArrayLike': require('./isArrayLike'), + 'isArrayLikeObject': require('./isArrayLikeObject'), + 'isBoolean': require('./isBoolean'), + 'isBuffer': require('./isBuffer'), + 'isDate': require('./isDate'), + 'isElement': require('./isElement'), + 'isEmpty': require('./isEmpty'), + 'isEqual': require('./isEqual'), + 'isEqualWith': require('./isEqualWith'), + 'isError': require('./isError'), + 'isFinite': require('./isFinite'), + 'isFunction': require('./isFunction'), + 'isInteger': require('./isInteger'), + 'isLength': require('./isLength'), + 'isMap': require('./isMap'), + 'isMatch': require('./isMatch'), + 'isMatchWith': require('./isMatchWith'), + 'isNaN': require('./isNaN'), + 'isNative': require('./isNative'), + 'isNil': require('./isNil'), + 'isNull': require('./isNull'), + 'isNumber': require('./isNumber'), + 'isObject': require('./isObject'), + 'isObjectLike': require('./isObjectLike'), + 'isPlainObject': require('./isPlainObject'), + 'isRegExp': require('./isRegExp'), + 'isSafeInteger': require('./isSafeInteger'), + 'isSet': require('./isSet'), + 'isString': require('./isString'), + 'isSymbol': require('./isSymbol'), + 'isTypedArray': require('./isTypedArray'), + 'isUndefined': require('./isUndefined'), + 'isWeakMap': require('./isWeakMap'), + 'isWeakSet': require('./isWeakSet'), + 'lt': require('./lt'), + 'lte': require('./lte'), + 'toArray': require('./toArray'), + 'toInteger': require('./toInteger'), + 'toLength': require('./toLength'), + 'toNumber': require('./toNumber'), + 'toPlainObject': require('./toPlainObject'), + 'toSafeInteger': require('./toSafeInteger'), + 'toString': require('./toString') +}; diff --git a/tools/eslint/node_modules/lodash/last.js b/tools/eslint/node_modules/lodash/last.js new file mode 100644 index 00000000000000..6402a4c33a7b2e --- /dev/null +++ b/tools/eslint/node_modules/lodash/last.js @@ -0,0 +1,20 @@ +/** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ +function last(array) { + var length = array ? array.length : 0; + return length ? array[length - 1] : undefined; +} + +module.exports = last; diff --git a/tools/eslint/node_modules/lodash/lastIndexOf.js b/tools/eslint/node_modules/lodash/lastIndexOf.js new file mode 100644 index 00000000000000..7e9d988e5e93be --- /dev/null +++ b/tools/eslint/node_modules/lodash/lastIndexOf.js @@ -0,0 +1,54 @@ +var indexOfNaN = require('./_indexOfNaN'), + toInteger = require('./toInteger'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max, + nativeMin = Math.min; + +/** + * This method is like `_.indexOf` except that it iterates over elements of + * `array` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.lastIndexOf([1, 2, 1, 2], 2); + * // => 3 + * + * // Search from the `fromIndex`. + * _.lastIndexOf([1, 2, 1, 2], 2, 2); + * // => 1 + */ +function lastIndexOf(array, value, fromIndex) { + var length = array ? array.length : 0; + if (!length) { + return -1; + } + var index = length; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = ( + index < 0 + ? nativeMax(length + index, 0) + : nativeMin(index, length - 1) + ) + 1; + } + if (value !== value) { + return indexOfNaN(array, index, true); + } + while (index--) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +module.exports = lastIndexOf; diff --git a/tools/eslint/node_modules/lodash/lodash.js b/tools/eslint/node_modules/lodash/lodash.js new file mode 100644 index 00000000000000..0e359de50b206c --- /dev/null +++ b/tools/eslint/node_modules/lodash/lodash.js @@ -0,0 +1,15951 @@ +/** + * @license + * lodash 4.9.0 (Custom Build) + * Build: `lodash -d -o ./foo/lodash.js` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ +;(function() { + + /** Used as a safe reference for `undefined` in pre-ES5 environments. */ + var undefined; + + /** Used as the semantic version number. */ + var VERSION = '4.9.0'; + + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; + + /** Used as the `TypeError` message for "Functions" methods. */ + var FUNC_ERROR_TEXT = 'Expected a function'; + + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED = '__lodash_hash_undefined__'; + + /** Used as the internal argument placeholder. */ + var PLACEHOLDER = '__lodash_placeholder__'; + + /** Used to compose bitmasks for wrapper metadata. */ + var BIND_FLAG = 1, + BIND_KEY_FLAG = 2, + CURRY_BOUND_FLAG = 4, + CURRY_FLAG = 8, + CURRY_RIGHT_FLAG = 16, + PARTIAL_FLAG = 32, + PARTIAL_RIGHT_FLAG = 64, + ARY_FLAG = 128, + REARG_FLAG = 256, + FLIP_FLAG = 512; + + /** Used to compose bitmasks for comparison styles. */ + var UNORDERED_COMPARE_FLAG = 1, + PARTIAL_COMPARE_FLAG = 2; + + /** Used as default options for `_.truncate`. */ + var DEFAULT_TRUNC_LENGTH = 30, + DEFAULT_TRUNC_OMISSION = '...'; + + /** Used to detect hot functions by number of calls within a span of milliseconds. */ + var HOT_COUNT = 150, + HOT_SPAN = 16; + + /** Used to indicate the type of lazy iteratees. */ + var LAZY_FILTER_FLAG = 1, + LAZY_MAP_FLAG = 2, + LAZY_WHILE_FLAG = 3; + + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + + /** Used as references for the maximum length and index of an array. */ + var MAX_ARRAY_LENGTH = 4294967295, + MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, + HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]', + weakSetTag = '[object WeakSet]'; + + var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + + /** Used to match empty string literals in compiled template source. */ + var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + + /** Used to match HTML entities and HTML characters. */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g, + reUnescapedHtml = /[&<>"'`]/g, + reHasEscapedHtml = RegExp(reEscapedHtml.source), + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + + /** Used to match template delimiters. */ + var reEscape = /<%-([\s\S]+?)%>/g, + reEvaluate = /<%([\s\S]+?)%>/g, + reInterpolate = /<%=([\s\S]+?)%>/g; + + /** Used to match property names within property paths. */ + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g; + + /** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). + */ + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, + reHasRegExpChar = RegExp(reRegExpChar.source); + + /** Used to match leading and trailing whitespace. */ + var reTrim = /^\s+|\s+$/g, + reTrimStart = /^\s+/, + reTrimEnd = /\s+$/; + + /** Used to match backslashes in property paths. */ + var reEscapeChar = /\\(\\)?/g; + + /** + * Used to match + * [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components). + */ + var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + + /** Used to match `RegExp` flags from their coerced string values. */ + var reFlags = /\w*$/; + + /** Used to detect hexadecimal string values. */ + var reHasHexPrefix = /^0x/i; + + /** Used to detect bad signed hexadecimal string values. */ + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + + /** Used to detect binary string values. */ + var reIsBinary = /^0b[01]+$/i; + + /** Used to detect host constructors (Safari). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; + + /** Used to detect octal string values. */ + var reIsOctal = /^0o[0-7]+$/i; + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; + + /** Used to match latin-1 supplementary letters (excluding mathematical operators). */ + var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g; + + /** Used to ensure capturing order of template delimiters. */ + var reNoMatch = /($^)/; + + /** Used to match unescaped characters in compiled string literals. */ + var reUnescapedString = /['\n\r\u2028\u2029\\]/g; + + /** Used to compose unicode character classes. */ + var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsComboSymbolsRange = '\\u20d0-\\u20f0', + rsDingbatRange = '\\u2700-\\u27bf', + rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', + rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', + rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', + rsQuoteRange = '\\u2018\\u2019\\u201c\\u201d', + rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', + rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', + rsVarRange = '\\ufe0e\\ufe0f', + rsBreakRange = rsMathOpRange + rsNonCharRange + rsQuoteRange + rsSpaceRange; + + /** Used to compose unicode capture groups. */ + var rsAstral = '[' + rsAstralRange + ']', + rsBreak = '[' + rsBreakRange + ']', + rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', + rsDigits = '\\d+', + rsDingbat = '[' + rsDingbatRange + ']', + rsLower = '[' + rsLowerRange + ']', + rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsUpper = '[' + rsUpperRange + ']', + rsZWJ = '\\u200d'; + + /** Used to compose unicode regexes. */ + var rsLowerMisc = '(?:' + rsLower + '|' + rsMisc + ')', + rsUpperMisc = '(?:' + rsUpper + '|' + rsMisc + ')', + reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + + /** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ + var reComboMark = RegExp(rsCombo, 'g'); + + /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ + var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + + /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ + var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); + + /** Used to match non-compound words composed of alphanumeric characters. */ + var reBasicWord = /[a-zA-Z0-9]+/g; + + /** Used to match complex or compound words. */ + var reComplexWord = RegExp([ + rsUpper + '?' + rsLower + '+(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsUpperMisc + '+(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')', + rsUpper + '?' + rsLowerMisc + '+', + rsUpper + '+', + rsDigits, + rsEmoji + ].join('|'), 'g'); + + /** Used to detect strings that need a more robust regexp to match words. */ + var reHasComplexWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + + /** Used to assign default `context` object properties. */ + var contextProps = [ + 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', + 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', + 'Promise', 'Reflect', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', + 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', + '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' + ]; + + /** Used to make template sourceURLs easier to identify. */ + var templateCounter = -1; + + /** Used to identify `toStringTag` values of typed arrays. */ + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = + typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = + typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = + typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = + typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = + typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = + typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = + typedArrayTags[errorTag] = typedArrayTags[funcTag] = + typedArrayTags[mapTag] = typedArrayTags[numberTag] = + typedArrayTags[objectTag] = typedArrayTags[regexpTag] = + typedArrayTags[setTag] = typedArrayTags[stringTag] = + typedArrayTags[weakMapTag] = false; + + /** Used to identify `toStringTag` values supported by `_.clone`. */ + var cloneableTags = {}; + cloneableTags[argsTag] = cloneableTags[arrayTag] = + cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = + cloneableTags[boolTag] = cloneableTags[dateTag] = + cloneableTags[float32Tag] = cloneableTags[float64Tag] = + cloneableTags[int8Tag] = cloneableTags[int16Tag] = + cloneableTags[int32Tag] = cloneableTags[mapTag] = + cloneableTags[numberTag] = cloneableTags[objectTag] = + cloneableTags[regexpTag] = cloneableTags[setTag] = + cloneableTags[stringTag] = cloneableTags[symbolTag] = + cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = + cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; + cloneableTags[errorTag] = cloneableTags[funcTag] = + cloneableTags[weakMapTag] = false; + + /** Used to map latin-1 supplementary letters to basic latin letters. */ + var deburredLetters = { + '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', + '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', + '\xc7': 'C', '\xe7': 'c', + '\xd0': 'D', '\xf0': 'd', + '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', + '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', + '\xcC': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', + '\xeC': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', + '\xd1': 'N', '\xf1': 'n', + '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', + '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', + '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', + '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', + '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', + '\xc6': 'Ae', '\xe6': 'ae', + '\xde': 'Th', '\xfe': 'th', + '\xdf': 'ss' + }; + + /** Used to map characters to HTML entities. */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '`': '`' + }; + + /** Used to map HTML entities to characters. */ + var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'", + '`': '`' + }; + + /** Used to determine if values are of the language type `Object`. */ + var objectTypes = { + 'function': true, + 'object': true + }; + + /** Used to escape characters for inclusion in compiled string literals. */ + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + /** Built-in method references without a dependency on `root`. */ + var freeParseFloat = parseFloat, + freeParseInt = parseInt; + + /** Detect free variable `exports`. */ + var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) + ? exports + : undefined; + + /** Detect free variable `module`. */ + var freeModule = (objectTypes[typeof module] && module && !module.nodeType) + ? module + : undefined; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = (freeModule && freeModule.exports === freeExports) + ? freeExports + : undefined; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); + + /** Detect free variable `self`. */ + var freeSelf = checkGlobal(objectTypes[typeof self] && self); + + /** Detect free variable `window`. */ + var freeWindow = checkGlobal(objectTypes[typeof window] && window); + + /** Detect `this` as the global object. */ + var thisGlobal = checkGlobal(objectTypes[typeof this] && this); + + /** + * Used as a reference to the global object. + * + * The `this` value is used if it's the global object to avoid Greasemonkey's + * restricted `window` object, otherwise the `window` object is used. + */ + var root = freeGlobal || + ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || + freeSelf || thisGlobal || Function('return this')(); + + /*--------------------------------------------------------------------------*/ + + /** + * Adds the key-value `pair` to `map`. + * + * @private + * @param {Object} map The map to modify. + * @param {Array} pair The key-value pair to add. + * @returns {Object} Returns `map`. + */ + function addMapEntry(map, pair) { + // Don't return `Map#set` because it doesn't return the map instance in IE 11. + map.set(pair[0], pair[1]); + return map; + } + + /** + * Adds `value` to `set`. + * + * @private + * @param {Object} set The set to modify. + * @param {*} value The value to add. + * @returns {Object} Returns `set`. + */ + function addSetEntry(set, value) { + set.add(value); + return set; + } + + /** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ + function apply(func, thisArg, args) { + var length = args.length; + switch (length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); + } + + /** + * A specialized version of `baseAggregator` for arrays. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; + } + + /** + * Creates a new array concatenating `array` with `other`. + * + * @private + * @param {Array} array The first array to concatenate. + * @param {Array} other The second array to concatenate. + * @returns {Array} Returns the new concatenated array. + */ + function arrayConcat(array, other) { + var index = -1, + length = array.length, + othIndex = -1, + othLength = other.length, + result = Array(length + othLength); + + while (++index < length) { + result[index] = array[index]; + } + while (++othIndex < othLength) { + result[index++] = other[othIndex]; + } + return result; + } + + /** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEach(array, iteratee) { + var index = -1, + length = array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.forEachRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEachRight(array, iteratee) { + var length = array.length; + + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.every` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + */ + function arrayEvery(array, predicate) { + var index = -1, + length = array.length; + + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } + } + return true; + } + + /** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function arrayFilter(array, predicate) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; + } + + /** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} array The array to search. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludes(array, value) { + return !!array.length && baseIndexOf(array, value, 0) > -1; + } + + /** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to search. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; + } + + /** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function arrayMap(array, iteratee) { + var index = -1, + length = array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; + } + + /** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ + function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; + } + + /** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array.length; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; + } + + /** + * A specialized version of `_.reduceRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the last element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduceRight(array, iteratee, accumulator, initAccum) { + var length = array.length; + if (initAccum && length) { + accumulator = array[--length]; + } + while (length--) { + accumulator = iteratee(accumulator, array[length], length, array); + } + return accumulator; + } + + /** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function arraySome(array, predicate) { + var index = -1, + length = array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; + } + + /** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ + function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? current === current + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; + } + + /** + * The base implementation of methods like `_.find` and `_.findKey`, without + * support for iteratee shorthands, which iterates over `collection` using + * `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to search. + * @param {Function} predicate The function invoked per iteration. + * @param {Function} eachFunc The function to iterate over `collection`. + * @param {boolean} [retKey] Specify returning the key of the found element + * instead of the element itself. + * @returns {*} Returns the found element or its key, else `undefined`. + */ + function baseFind(collection, predicate, eachFunc, retKey) { + var result; + eachFunc(collection, function(value, key, collection) { + if (predicate(value, key, collection)) { + result = retKey ? key : value; + return false; + } + }); + return result; + } + + /** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to search. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseFindIndex(array, predicate, fromRight) { + var length = array.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOf(array, value, fromIndex) { + if (value !== value) { + return indexOfNaN(array, fromIndex); + } + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * This function is like `baseIndexOf` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @param {Function} comparator The comparator invoked per element. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (comparator(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.mean` and `_.meanBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the mean. + */ + function baseMean(array, iteratee) { + var length = array ? array.length : 0; + return length ? (baseSum(array, iteratee) / length) : NAN; + } + + /** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ + function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; + } + + /** + * The base implementation of `_.sum` and `_.sumBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the sum. + */ + function baseSum(array, iteratee) { + var result, + index = -1, + length = array.length; + + while (++index < length) { + var current = iteratee(array[index]); + if (current !== undefined) { + result = result === undefined ? current : (result + current); + } + } + return result; + } + + /** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } + + /** + * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array + * of key-value pairs for `object` corresponding to the property names of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the new array of key-value pairs. + */ + function baseToPairs(object, props) { + return arrayMap(props, function(key) { + return [key, object[key]]; + }); + } + + /** + * The base implementation of `_.unary` without support for storing wrapper metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new function. + */ + function baseUnary(func) { + return function(value) { + return func(value); + }; + } + + /** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ + function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); + } + + /** + * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the first unmatched string symbol. + */ + function charsStartIndex(strSymbols, chrSymbols) { + var index = -1, + length = strSymbols.length; + + while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } + + /** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ + function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } + + /** + * Checks if `value` is a global object. + * + * @private + * @param {*} value The value to check. + * @returns {null|Object} Returns `value` if it's a global object, else `null`. + */ + function checkGlobal(value) { + return (value && value.Object === Object) ? value : null; + } + + /** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ + function compareAscending(value, other) { + if (value !== other) { + var valIsNull = value === null, + valIsUndef = value === undefined, + valIsReflexive = value === value; + + var othIsNull = other === null, + othIsUndef = other === undefined, + othIsReflexive = other === other; + + if ((value > other && !othIsNull) || !valIsReflexive || + (valIsNull && !othIsUndef && othIsReflexive) || + (valIsUndef && othIsReflexive)) { + return 1; + } + if ((value < other && !valIsNull) || !othIsReflexive || + (othIsNull && !valIsUndef && valIsReflexive) || + (othIsUndef && valIsReflexive)) { + return -1; + } + } + return 0; + } + + /** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ + function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; + } + + /** + * Gets the number of `placeholder` occurrences in `array`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} placeholder The placeholder to search for. + * @returns {number} Returns the placeholder count. + */ + function countHolders(array, placeholder) { + var length = array.length, + result = 0; + + while (length--) { + if (array[length] === placeholder) { + result++; + } + } + return result; + } + + /** + * Creates a function that performs a mathematical operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @returns {Function} Returns the new mathematical operation function. + */ + function createMathOperation(operator) { + return function(value, other) { + var result; + if (value === undefined && other === undefined) { + return 0; + } + if (value !== undefined) { + result = value; + } + if (other !== undefined) { + result = result === undefined ? other : operator(result, other); + } + return result; + }; + } + + /** + * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ + function deburrLetter(letter) { + return deburredLetters[letter]; + } + + /** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeHtmlChar(chr) { + return htmlEscapes[chr]; + } + + /** + * Used by `_.template` to escape characters for inclusion in compiled string literals. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeStringChar(chr) { + return '\\' + stringEscapes[chr]; + } + + /** + * Gets the index at which the first occurrence of `NaN` is found in `array`. + * + * @private + * @param {Array} array The array to search. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched `NaN`, else `-1`. + */ + function indexOfNaN(array, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 0 : -1); + + while ((fromRight ? index-- : ++index < length)) { + var other = array[index]; + if (other !== other) { + return index; + } + } + return -1; + } + + /** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ + function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; + length = length == null ? MAX_SAFE_INTEGER : length; + return value > -1 && value % 1 == 0 && value < length; + } + + /** + * Converts `iterator` to an array. + * + * @private + * @param {Object} iterator The iterator to convert. + * @returns {Array} Returns the converted array. + */ + function iteratorToArray(iterator) { + var data, + result = []; + + while (!(data = iterator.next()).done) { + result.push(data.value); + } + return result; + } + + /** + * Converts `map` to an array. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the converted array. + */ + function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; + } + + /** + * Replaces all `placeholder` elements in `array` with an internal placeholder + * and returns an array of their indexes. + * + * @private + * @param {Array} array The array to modify. + * @param {*} placeholder The placeholder to replace. + * @returns {Array} Returns the new array of placeholder indexes. + */ + function replaceHolders(array, placeholder) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value === placeholder || value === PLACEHOLDER) { + array[index] = PLACEHOLDER; + result[resIndex++] = index; + } + } + return result; + } + + /** + * Converts `set` to an array. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the converted array. + */ + function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; + } + + /** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ + function stringSize(string) { + if (!(string && reHasComplexSymbol.test(string))) { + return string.length; + } + var result = reComplexSymbol.lastIndex = 0; + while (reComplexSymbol.test(string)) { + result++; + } + return result; + } + + /** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function stringToArray(string) { + return string.match(reComplexSymbol); + } + + /** + * Used by `_.unescape` to convert HTML entities to characters. + * + * @private + * @param {string} chr The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ + function unescapeHtmlChar(chr) { + return htmlUnescapes[chr]; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Create a new pristine `lodash` function using the `context` object. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Util + * @param {Object} [context=root] The context object. + * @returns {Function} Returns a new `lodash` function. + * @example + * + * _.mixin({ 'foo': _.constant('foo') }); + * + * var lodash = _.runInContext(); + * lodash.mixin({ 'bar': lodash.constant('bar') }); + * + * _.isFunction(_.foo); + * // => true + * _.isFunction(_.bar); + * // => false + * + * lodash.isFunction(lodash.foo); + * // => false + * lodash.isFunction(lodash.bar); + * // => true + * + * // Use `context` to mock `Date#getTime` use in `_.now`. + * var mock = _.runInContext({ + * 'Date': function() { + * return { 'getTime': getTimeMock }; + * } + * }); + * + * // Create a suped-up `defer` in Node.js. + * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; + */ + function runInContext(context) { + context = context ? _.defaults({}, context, _.pick(root, contextProps)) : root; + + /** Built-in constructor references. */ + var Date = context.Date, + Error = context.Error, + Math = context.Math, + RegExp = context.RegExp, + TypeError = context.TypeError; + + /** Used for built-in method references. */ + var arrayProto = context.Array.prototype, + objectProto = context.Object.prototype; + + /** Used to resolve the decompiled source of functions. */ + var funcToString = context.Function.prototype.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to generate unique IDs. */ + var idCounter = 0; + + /** Used to infer the `Object` constructor. */ + var objectCtorString = funcToString.call(Object); + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ + var objectToString = objectProto.toString; + + /** Used to restore the original `_` reference in `_.noConflict`. */ + var oldDash = root._; + + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); + + /** Built-in value references. */ + var Buffer = moduleExports ? context.Buffer : undefined, + Reflect = context.Reflect, + Symbol = context.Symbol, + Uint8Array = context.Uint8Array, + clearTimeout = context.clearTimeout, + enumerate = Reflect ? Reflect.enumerate : undefined, + getOwnPropertySymbols = Object.getOwnPropertySymbols, + iteratorSymbol = typeof (iteratorSymbol = Symbol && Symbol.iterator) == 'symbol' ? iteratorSymbol : undefined, + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + setTimeout = context.setTimeout, + splice = arrayProto.splice; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeCeil = Math.ceil, + nativeFloor = Math.floor, + nativeGetPrototype = Object.getPrototypeOf, + nativeIsFinite = context.isFinite, + nativeJoin = arrayProto.join, + nativeKeys = Object.keys, + nativeMax = Math.max, + nativeMin = Math.min, + nativeParseInt = context.parseInt, + nativeRandom = Math.random, + nativeReverse = arrayProto.reverse; + + /* Built-in method references that are verified to be native. */ + var DataView = getNative(context, 'DataView'), + Map = getNative(context, 'Map'), + Promise = getNative(context, 'Promise'), + Set = getNative(context, 'Set'), + WeakMap = getNative(context, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + + /** Used to store function metadata. */ + var metaMap = WeakMap && new WeakMap; + + /** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */ + var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf'); + + /** Used to lookup unminified function names. */ + var realNames = {}; + + /** Used to detect maps, sets, and weakmaps. */ + var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps `value` to enable implicit method + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. + * + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. + * + * The execution of chained methods is lazy, that is, it's deferred until + * `_#value` is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array of at least `200` elements + * and any iteratees accept only one argument. The heuristic for whether a + * section qualifies for shortcut fusion is subject to change. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, + * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `divide`, `each`, + * `eachRight`, `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`, + * `findIndex`, `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`, + * `floor`, `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, + * `forOwnRight`, `get`, `gt`, `gte`, `has`, `hasIn`, `head`, `identity`, + * `includes`, `indexOf`, `inRange`, `invoke`, `isArguments`, `isArray`, + * `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, `isBuffer`, + * `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`, + * `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMap`, `isMatch`, + * `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, + * `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`, + * `isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`, + * `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`, + * `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, `min`, `minBy`, `multiply`, + * `noConflict`, `noop`, `now`, `pad`, `padEnd`, `padStart`, `parseInt`, + * `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`, + * `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, + * `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`, + * `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toInteger`, + * `toJSON`, `toLength`, `toLower`, `toNumber`, `toSafeInteger`, `toString`, + * `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, + * `uniqueId`, `upperCase`, `upperFirst`, `value`, and `words` + * + * @name _ + * @constructor + * @category Seq + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2, 3]); + * + * // Returns an unwrapped value. + * wrapped.reduce(_.add); + * // => 6 + * + * // Returns a wrapped value. + * var squares = wrapped.map(square); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { + if (value instanceof LodashWrapper) { + return value; + } + if (hasOwnProperty.call(value, '__wrapped__')) { + return wrapperClone(value); + } + } + return new LodashWrapper(value); + } + + /** + * The function whose prototype chain sequence wrappers inherit from. + * + * @private + */ + function baseLodash() { + // No operation performed. + } + + /** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ + function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + this.__index__ = 0; + this.__values__ = undefined; + } + + /** + * By default, the template delimiters used by lodash are like those in + * embedded Ruby (ERB). Change the following template settings to use + * alternative delimiters. + * + * @static + * @memberOf _ + * @type {Object} + */ + lodash.templateSettings = { + + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'escape': reEscape, + + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'evaluate': reEvaluate, + + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'interpolate': reInterpolate, + + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type {string} + */ + 'variable': '', + + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type {Object} + */ + 'imports': { + + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type {Function} + */ + '_': lodash + } + }; + + // Ensure wrappers are instances of `baseLodash`. + lodash.prototype = baseLodash.prototype; + lodash.prototype.constructor = lodash; + + LodashWrapper.prototype = baseCreate(baseLodash.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. + * + * @private + * @constructor + * @param {*} value The value to wrap. + */ + function LazyWrapper(value) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__dir__ = 1; + this.__filtered__ = false; + this.__iteratees__ = []; + this.__takeCount__ = MAX_ARRAY_LENGTH; + this.__views__ = []; + } + + /** + * Creates a clone of the lazy wrapper object. + * + * @private + * @name clone + * @memberOf LazyWrapper + * @returns {Object} Returns the cloned `LazyWrapper` object. + */ + function lazyClone() { + var result = new LazyWrapper(this.__wrapped__); + result.__actions__ = copyArray(this.__actions__); + result.__dir__ = this.__dir__; + result.__filtered__ = this.__filtered__; + result.__iteratees__ = copyArray(this.__iteratees__); + result.__takeCount__ = this.__takeCount__; + result.__views__ = copyArray(this.__views__); + return result; + } + + /** + * Reverses the direction of lazy iteration. + * + * @private + * @name reverse + * @memberOf LazyWrapper + * @returns {Object} Returns the new reversed `LazyWrapper` object. + */ + function lazyReverse() { + if (this.__filtered__) { + var result = new LazyWrapper(this); + result.__dir__ = -1; + result.__filtered__ = true; + } else { + result = this.clone(); + result.__dir__ *= -1; + } + return result; + } + + /** + * Extracts the unwrapped value from its lazy wrapper. + * + * @private + * @name value + * @memberOf LazyWrapper + * @returns {*} Returns the unwrapped value. + */ + function lazyValue() { + var array = this.__wrapped__.value(), + dir = this.__dir__, + isArr = isArray(array), + isRight = dir < 0, + arrLength = isArr ? array.length : 0, + view = getView(0, arrLength, this.__views__), + start = view.start, + end = view.end, + length = end - start, + index = isRight ? end : (start - 1), + iteratees = this.__iteratees__, + iterLength = iteratees.length, + resIndex = 0, + takeCount = nativeMin(length, this.__takeCount__); + + if (!isArr || arrLength < LARGE_ARRAY_SIZE || + (arrLength == length && takeCount == length)) { + return baseWrapperValue(array, this.__actions__); + } + var result = []; + + outer: + while (length-- && resIndex < takeCount) { + index += dir; + + var iterIndex = -1, + value = array[index]; + + while (++iterIndex < iterLength) { + var data = iteratees[iterIndex], + iteratee = data.iteratee, + type = data.type, + computed = iteratee(value); + + if (type == LAZY_MAP_FLAG) { + value = computed; + } else if (!computed) { + if (type == LAZY_FILTER_FLAG) { + continue outer; + } else { + break outer; + } + } + } + result[resIndex++] = value; + } + return result; + } + + // Ensure `LazyWrapper` is an instance of `baseLodash`. + LazyWrapper.prototype = baseCreate(baseLodash.prototype); + LazyWrapper.prototype.constructor = LazyWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a hash object. + * + * @private + * @constructor + * @returns {Object} Returns the new hash object. + */ + function Hash() {} + + /** + * Removes `key` and its value from the hash. + * + * @private + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function hashDelete(hash, key) { + return hashHas(hash, key) && delete hash[key]; + } + + /** + * Gets the hash value for `key`. + * + * @private + * @param {Object} hash The hash to query. + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function hashGet(hash, key) { + if (nativeCreate) { + var result = hash[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(hash, key) ? hash[key] : undefined; + } + + /** + * Checks if a hash value for `key` exists. + * + * @private + * @param {Object} hash The hash to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function hashHas(hash, key) { + return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key); + } + + /** + * Sets the hash `key` to `value`. + * + * @private + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + */ + function hashSet(hash, key, value) { + hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + } + + // Avoid inheriting from `Object.prototype` when possible. + Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ + function MapCache(values) { + var index = -1, + length = values ? values.length : 0; + + this.clear(); + while (++index < length) { + var entry = values[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ + function mapClear() { + this.__data__ = { + 'hash': new Hash, + 'map': Map ? new Map : [], + 'string': new Hash + }; + } + + /** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function mapDelete(key) { + var data = this.__data__; + if (isKeyable(key)) { + return hashDelete(typeof key == 'string' ? data.string : data.hash, key); + } + return Map ? data.map['delete'](key) : assocDelete(data.map, key); + } + + /** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function mapGet(key) { + var data = this.__data__; + if (isKeyable(key)) { + return hashGet(typeof key == 'string' ? data.string : data.hash, key); + } + return Map ? data.map.get(key) : assocGet(data.map, key); + } + + /** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function mapHas(key) { + var data = this.__data__; + if (isKeyable(key)) { + return hashHas(typeof key == 'string' ? data.string : data.hash, key); + } + return Map ? data.map.has(key) : assocHas(data.map, key); + } + + /** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ + function mapSet(key, value) { + var data = this.__data__; + if (isKeyable(key)) { + hashSet(typeof key == 'string' ? data.string : data.hash, key, value); + } else if (Map) { + data.map.set(key, value); + } else { + assocSet(data.map, key, value); + } + return this; + } + + // Add methods to `MapCache`. + MapCache.prototype.clear = mapClear; + MapCache.prototype['delete'] = mapDelete; + MapCache.prototype.get = mapGet; + MapCache.prototype.has = mapHas; + MapCache.prototype.set = mapSet; + + /*------------------------------------------------------------------------*/ + + /** + * + * Creates a set cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ + function SetCache(values) { + var index = -1, + length = values ? values.length : 0; + + this.__data__ = new MapCache; + while (++index < length) { + this.push(values[index]); + } + } + + /** + * Checks if `value` is in `cache`. + * + * @private + * @param {Object} cache The set cache to search. + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ + function cacheHas(cache, value) { + var map = cache.__data__; + if (isKeyable(value)) { + var data = map.__data__, + hash = typeof value == 'string' ? data.string : data.hash; + + return hash[value] === HASH_UNDEFINED; + } + return map.has(value); + } + + /** + * Adds `value` to the set cache. + * + * @private + * @name push + * @memberOf SetCache + * @param {*} value The value to cache. + */ + function cachePush(value) { + var map = this.__data__; + if (isKeyable(value)) { + var data = map.__data__, + hash = typeof value == 'string' ? data.string : data.hash; + + hash[value] = HASH_UNDEFINED; + } + else { + map.set(value, HASH_UNDEFINED); + } + } + + // Add methods to `SetCache`. + SetCache.prototype.push = cachePush; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ + function Stack(values) { + var index = -1, + length = values ? values.length : 0; + + this.clear(); + while (++index < length) { + var entry = values[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ + function stackClear() { + this.__data__ = { 'array': [], 'map': null }; + } + + /** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function stackDelete(key) { + var data = this.__data__, + array = data.array; + + return array ? assocDelete(array, key) : data.map['delete'](key); + } + + /** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function stackGet(key) { + var data = this.__data__, + array = data.array; + + return array ? assocGet(array, key) : data.map.get(key); + } + + /** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function stackHas(key) { + var data = this.__data__, + array = data.array; + + return array ? assocHas(array, key) : data.map.has(key); + } + + /** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ + function stackSet(key, value) { + var data = this.__data__, + array = data.array; + + if (array) { + if (array.length < (LARGE_ARRAY_SIZE - 1)) { + assocSet(array, key, value); + } else { + data.array = null; + data.map = new MapCache(array); + } + } + var map = data.map; + if (map) { + map.set(key, value); + } + return this; + } + + // Add methods to `Stack`. + Stack.prototype.clear = stackClear; + Stack.prototype['delete'] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; + + /*------------------------------------------------------------------------*/ + + /** + * Removes `key` and its value from the associative array. + * + * @private + * @param {Array} array The array to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function assocDelete(array, key) { + var index = assocIndexOf(array, key); + if (index < 0) { + return false; + } + var lastIndex = array.length - 1; + if (index == lastIndex) { + array.pop(); + } else { + splice.call(array, index, 1); + } + return true; + } + + /** + * Gets the associative array value for `key`. + * + * @private + * @param {Array} array The array to query. + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function assocGet(array, key) { + var index = assocIndexOf(array, key); + return index < 0 ? undefined : array[index][1]; + } + + /** + * Checks if an associative array value for `key` exists. + * + * @private + * @param {Array} array The array to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function assocHas(array, key) { + return assocIndexOf(array, key) > -1; + } + + /** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to search. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; + } + + /** + * Sets the associative array `key` to `value`. + * + * @private + * @param {Array} array The array to modify. + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + */ + function assocSet(array, key, value) { + var index = assocIndexOf(array, key); + if (index < 0) { + array.push([key, value]); + } else { + array[index][1] = value; + } + } + + /*------------------------------------------------------------------------*/ + + /** + * Used by `_.defaults` to customize its `_.assignIn` use. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to assign. + * @param {Object} object The parent object of `objValue`. + * @returns {*} Returns the value to assign. + */ + function assignInDefaults(objValue, srcValue, key, object) { + if (objValue === undefined || + (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { + return srcValue; + } + return objValue; + } + + /** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (typeof key == 'number' && value === undefined && !(key in object))) { + object[key] = value; + } + } + + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + object[key] = value; + } + } + + /** + * Aggregates elements of `collection` on `accumulator` with keys transformed + * by `iteratee` and values set by `setter`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection) { + setter(accumulator, value, iteratee(value), collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); + } + + /** + * The base implementation of `_.at` without support for individual paths. + * + * @private + * @param {Object} object The object to iterate over. + * @param {string[]} paths The property paths of elements to pick. + * @returns {Array} Returns the new array of picked elements. + */ + function baseAt(object, paths) { + var index = -1, + isNil = object == null, + length = paths.length, + result = Array(length); + + while (++index < length) { + result[index] = isNil ? undefined : get(object, paths[index]); + } + return result; + } + + /** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ + function baseCastArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; + } + + /** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ + function baseCastFunction(value) { + return typeof value == 'function' ? value : identity; + } + + /** + * Casts `value` to a string if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the cast key. + */ + function baseCastKey(key) { + return (typeof key == 'string' || isSymbol(key)) ? key : (key + ''); + } + + /** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast property path array. + */ + function baseCastPath(value) { + return isArray(value) ? value : stringToPath(value); + } + + /** + * The base implementation of `_.clamp` which doesn't coerce arguments to numbers. + * + * @private + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + */ + function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined) { + number = number <= upper ? number : upper; + } + if (lower !== undefined) { + number = number >= lower ? number : lower; + } + } + return number; + } + + /** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @param {boolean} [isFull] Specify a clone including symbols. + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ + function baseClone(value, isDeep, isFull, customizer, key, object, stack) { + var result; + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + if (isHostObject(value)) { + return object ? value : {}; + } + result = initCloneObject(isFunc ? {} : value); + if (!isDeep) { + return copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, baseClone, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + if (!isArr) { + var props = isFull ? getAllKeys(value) : keys(value); + } + // Recursively populate clone (susceptible to call stack limits). + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); + }); + return result; + } + + /** + * The base implementation of `_.conforms` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new function. + */ + function baseConforms(source) { + var props = keys(source), + length = props.length; + + return function(object) { + if (object == null) { + return !length; + } + var index = length; + while (index--) { + var key = props[index], + predicate = source[key], + value = object[key]; + + if ((value === undefined && + !(key in Object(object))) || !predicate(value)) { + return false; + } + } + return true; + }; + } + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} prototype The object to inherit from. + * @returns {Object} Returns the new object. + */ + function baseCreate(proto) { + return isObject(proto) ? objectCreate(proto) : {}; + } + + /** + * The base implementation of `_.delay` and `_.defer` which accepts an array + * of `func` arguments. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Object} args The arguments to provide to `func`. + * @returns {number} Returns the timer id. + */ + function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ + function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEach = createBaseEach(baseForOwn); + + /** + * The base implementation of `_.forEachRight` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEachRight = createBaseEach(baseForOwnRight, true); + + /** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ + function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; + } + + /** + * The base implementation of `_.fill` without an iteratee call guard. + * + * @private + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + */ + function baseFill(array, value, start, end) { + var length = array.length; + + start = toInteger(start); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : toInteger(end); + if (end < 0) { + end += length; + } + end = start > end ? 0 : toLength(end); + while (start < end) { + array[start++] = value; + } + return array; + } + + /** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; + } + + /** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ + function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; + } + + /** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` invoking `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseFor = createBaseFor(); + + /** + * This function is like `baseFor` except that it iterates over properties + * in the opposite order. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseForRight = createBaseFor(true); + + /** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } + + /** + * The base implementation of `_.forOwnRight` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwnRight(object, iteratee) { + return object && baseForRight(object, iteratee, keys); + } + + /** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the new array of filtered property names. + */ + function baseFunctions(object, props) { + return arrayFilter(props, function(key) { + return isFunction(object[key]); + }); + } + + /** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ + function baseGet(object, path) { + path = isKey(path, object) ? [path] : baseCastPath(path); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[path[index++]]; + } + return (index && index == length) ? object : undefined; + } + + /** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ + function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) + ? result + : arrayPush(result, symbolsFunc(object)); + } + + /** + * The base implementation of `_.has` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHas(object, key) { + // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`, + // that are composed entirely of index properties, return `false` for + // `hasOwnProperty` checks of them. + return hasOwnProperty.call(object, key) || + (typeof object == 'object' && key in object && getPrototype(object) === null); + } + + /** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHasIn(object, key) { + return key in Object(object); + } + + /** + * The base implementation of `_.inRange` which doesn't coerce arguments to numbers. + * + * @private + * @param {number} number The number to check. + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + */ + function baseInRange(number, start, end) { + return number >= nativeMin(start, end) && number < nativeMax(start, end); + } + + /** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ + function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; + + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; + + var index = -1, + seen = caches[0]; + + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.invert` and `_.invertBy` which inverts + * `object` with values transformed by `iteratee` and set by `setter`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform values. + * @param {Object} accumulator The initial inverted object. + * @returns {Function} Returns `accumulator`. + */ + function baseInverter(object, setter, iteratee, accumulator) { + baseForOwn(object, function(value, key, object) { + setter(accumulator, iteratee(value), key, object); + }); + return accumulator; + } + + /** + * The base implementation of `_.invoke` without support for individual + * method arguments. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {Array} args The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + */ + function baseInvoke(object, path, args) { + if (!isKey(path, object)) { + path = baseCastPath(path); + object = parent(object, path); + path = last(path); + } + var func = object == null ? object : object[path]; + return func == null ? undefined : apply(func, object, args); + } + + /** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @param {boolean} [bitmask] The bitmask of comparison flags. + * The bitmask may be composed of the following flags: + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, customizer, bitmask, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); + } + + /** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparisons. + * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = arrayTag, + othTag = arrayTag; + + if (!objIsArr) { + objTag = getTag(object); + objTag = objTag == argsTag ? objectTag : objTag; + } + if (!othIsArr) { + othTag = getTag(other); + othTag = othTag == argsTag ? objectTag : othTag; + } + var objIsObj = objTag == objectTag && !isHostObject(object), + othIsObj = othTag == objectTag && !isHostObject(other), + isSameTag = objTag == othTag; + + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) + : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack); + } + if (!(bitmask & PARTIAL_COMPARE_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, equalFunc, customizer, bitmask, stack); + } + + /** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ + function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) + : result + )) { + return false; + } + } + } + return true; + } + + /** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ + function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); + } + + /** + * The base implementation of `_.keys` which doesn't skip the constructor + * property of prototypes or treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeys(object) { + return nativeKeys(Object(object)); + } + + /** + * The base implementation of `_.keysIn` which doesn't skip the constructor + * property of prototypes or treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeysIn(object) { + object = object == null ? object : Object(object); + + var result = []; + for (var key in object) { + result.push(key); + } + return result; + } + + // Fallback for IE < 9 with es6-shim. + if (enumerate && !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf')) { + baseKeysIn = function(object) { + return iteratorToArray(enumerate(object)); + }; + } + + /** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; + } + + /** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new function. + */ + function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; + } + + /** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new function. + */ + function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(path, srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG); + }; + } + + /** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + if (!(isArray(source) || isTypedArray(source))) { + var props = keysIn(source); + } + arrayEach(props || source, function(srcValue, key) { + if (props) { + key = srcValue; + srcValue = source[key]; + } + if (isObject(srcValue)) { + stack || (stack = new Stack); + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(object[key], srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }); + } + + /** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = object[key], + srcValue = source[key], + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + newValue = srcValue; + if (isArray(srcValue) || isTypedArray(srcValue)) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else { + isCommon = false; + newValue = baseClone(srcValue, true); + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { + isCommon = false; + newValue = baseClone(srcValue, true); + } + else { + newValue = objValue; + } + } + else { + isCommon = false; + } + } + stack.set(srcValue, newValue); + + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + } + stack['delete'](srcValue); + assignMergeValue(object, key, newValue); + } + + /** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ + function baseOrderBy(collection, iteratees, orders) { + var index = -1; + iteratees = arrayMap(iteratees.length ? iteratees : [identity], getIteratee()); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); + } + + /** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} props The property identifiers to pick. + * @returns {Object} Returns the new object. + */ + function basePick(object, props) { + object = Object(object); + return arrayReduce(props, function(result, key) { + if (key in object) { + result[key] = object[key]; + } + return result; + }, {}); + } + + /** + * The base implementation of `_.pickBy` without support for iteratee shorthands. + * + * @private + * @param {Object} object The source object. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. + */ + function basePickBy(object, predicate) { + var index = -1, + props = getAllKeysIn(object), + length = props.length, + result = {}; + + while (++index < length) { + var key = props[index], + value = object[key]; + + if (predicate(value, key)) { + result[key] = value; + } + } + return result; + } + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new function. + */ + function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; + } + + /** + * The base implementation of `_.pullAllBy` without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + */ + function basePullAll(array, values, iteratee, comparator) { + var indexOf = comparator ? baseIndexOfWith : baseIndexOf, + index = -1, + length = values.length, + seen = array; + + if (iteratee) { + seen = arrayMap(array, baseUnary(iteratee)); + } + while (++index < length) { + var fromIndex = 0, + value = values[index], + computed = iteratee ? iteratee(value) : value; + + while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice.call(seen, fromIndex, 1); + } + splice.call(array, fromIndex, 1); + } + } + return array; + } + + /** + * The base implementation of `_.pullAt` without support for individual + * indexes or capturing the removed elements. + * + * @private + * @param {Array} array The array to modify. + * @param {number[]} indexes The indexes of elements to remove. + * @returns {Array} Returns `array`. + */ + function basePullAt(array, indexes) { + var length = array ? indexes.length : 0, + lastIndex = length - 1; + + while (length--) { + var index = indexes[length]; + if (lastIndex == length || index != previous) { + var previous = index; + if (isIndex(index)) { + splice.call(array, index, 1); + } + else if (!isKey(index, array)) { + var path = baseCastPath(index), + object = parent(array, path); + + if (object != null) { + delete object[last(path)]; + } + } + else { + delete array[index]; + } + } + } + return array; + } + + /** + * The base implementation of `_.random` without support for returning + * floating-point numbers. + * + * @private + * @param {number} lower The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the random number. + */ + function baseRandom(lower, upper) { + return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); + } + + /** + * The base implementation of `_.range` and `_.rangeRight` which doesn't + * coerce arguments to numbers. + * + * @private + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @param {number} step The value to increment or decrement by. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the new array of numbers. + */ + function baseRange(start, end, step, fromRight) { + var index = -1, + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), + result = Array(length); + + while (length--) { + result[fromRight ? length : ++index] = start; + start += step; + } + return result; + } + + /** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ + function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); + + return result; + } + + /** + * The base implementation of `_.set`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseSet(object, path, value, customizer) { + path = isKey(path, object) ? [path] : baseCastPath(path); + + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + var key = path[index]; + if (isObject(nested)) { + var newValue = value; + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = objValue == null + ? (isIndex(path[index + 1]) ? [] : {}) + : objValue; + } + } + assignValue(nested, key, newValue); + } + nested = nested[key]; + } + return object; + } + + /** + * The base implementation of `setData` without support for hot loop detection. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var baseSetData = !metaMap ? identity : function(func, data) { + metaMap.set(func, data); + return func; + }; + + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } + + /** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; + } + + /** + * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which + * performs a binary search of `array` to determine the index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndex(array, value, retHighest) { + var low = 0, + high = array ? array.length : low; + + if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { + while (low < high) { + var mid = (low + high) >>> 1, + computed = array[mid]; + + if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) { + low = mid + 1; + } else { + high = mid; + } + } + return high; + } + return baseSortedIndexBy(array, value, identity, retHighest); + } + + /** + * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` + * which invokes `iteratee` for `value` and each element of `array` to compute + * their sort ranking. The iteratee is invoked with one argument; (value). + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} iteratee The iteratee invoked per element. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndexBy(array, value, iteratee, retHighest) { + value = iteratee(value); + + var low = 0, + high = array ? array.length : 0, + valIsNaN = value !== value, + valIsNull = value === null, + valIsUndef = value === undefined; + + while (low < high) { + var mid = nativeFloor((low + high) / 2), + computed = iteratee(array[mid]), + isDef = computed !== undefined, + isReflexive = computed === computed; + + if (valIsNaN) { + var setLow = isReflexive || retHighest; + } else if (valIsNull) { + setLow = isReflexive && isDef && (retHighest || computed != null); + } else if (valIsUndef) { + setLow = isReflexive && (retHighest || isDef); + } else if (computed == null) { + setLow = false; + } else { + setLow = retHighest ? (computed <= value) : (computed < value); + } + if (setLow) { + low = mid + 1; + } else { + high = mid; + } + } + return nativeMin(high, MAX_ARRAY_INDEX); + } + + /** + * The base implementation of `_.sortedUniq`. + * + * @private + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + */ + function baseSortedUniq(array) { + return baseSortedUniqBy(array); + } + + /** + * The base implementation of `_.sortedUniqBy` without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseSortedUniqBy(array, iteratee) { + var index = 0, + length = array.length, + value = array[0], + computed = iteratee ? iteratee(value) : value, + seen = computed, + resIndex = 1, + result = [value]; + + while (++index < length) { + value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (!eq(computed, seen)) { + seen = computed; + result[resIndex++] = value; + } + } + return result; + } + + /** + * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.unset`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + */ + function baseUnset(object, path) { + path = isKey(path, object) ? [path] : baseCastPath(path); + object = parent(object, path); + var key = last(path); + return (object != null && has(object, key)) ? delete object[key] : true; + } + + /** + * The base implementation of `_.update`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to update. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseUpdate(object, path, updater, customizer) { + return baseSet(object, path, updater(baseGet(object, path)), customizer); + } + + /** + * The base implementation of methods like `_.dropWhile` and `_.takeWhile` + * without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to query. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [isDrop] Specify dropping elements instead of taking them. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the slice of `array`. + */ + function baseWhile(array, predicate, isDrop, fromRight) { + var length = array.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length) && + predicate(array[index], index, array)) {} + + return isDrop + ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) + : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); + } + + /** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ + function baseWrapperValue(value, actions) { + var result = value; + if (result instanceof LazyWrapper) { + result = result.value(); + } + return arrayReduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); + } + + /** + * The base implementation of methods like `_.xor`, without support for + * iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of values. + */ + function baseXor(arrays, iteratee, comparator) { + var index = -1, + length = arrays.length; + + while (++index < length) { + var result = result + ? arrayPush( + baseDifference(result, arrays[index], iteratee, comparator), + baseDifference(arrays[index], result, iteratee, comparator) + ) + : arrays[index]; + } + return (result && result.length) ? baseUniq(result, iteratee, comparator) : []; + } + + /** + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * + * @private + * @param {Array} props The property identifiers. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. + */ + function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; + + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); + } + return result; + } + + /** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ + function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var result = new buffer.constructor(buffer.length); + buffer.copy(result); + return result; + } + + /** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ + function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; + } + + /** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ + function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); + } + + /** + * Creates a clone of `map`. + * + * @private + * @param {Object} map The map to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned map. + */ + function cloneMap(map, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map); + return arrayReduce(array, addMapEntry, new map.constructor); + } + + /** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ + function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; + } + + /** + * Creates a clone of `set`. + * + * @private + * @param {Object} set The set to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned set. + */ + function cloneSet(set, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set); + return arrayReduce(array, addSetEntry, new set.constructor); + } + + /** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ + function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; + } + + /** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ + function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + } + + /** + * Creates an array that is the composition of partially applied arguments, + * placeholders, and provided arguments into a single array of arguments. + * + * @private + * @param {Array|Object} args The provided arguments. + * @param {Array} partials The arguments to prepend to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgs(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersLength = holders.length, + leftIndex = -1, + leftLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(leftLength + rangeLength), + isUncurried = !isCurried; + + while (++leftIndex < leftLength) { + result[leftIndex] = partials[leftIndex]; + } + while (++argsIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[holders[argsIndex]] = args[argsIndex]; + } + } + while (rangeLength--) { + result[leftIndex++] = args[argsIndex++]; + } + return result; + } + + /** + * This function is like `composeArgs` except that the arguments composition + * is tailored for `_.partialRight`. + * + * @private + * @param {Array|Object} args The provided arguments. + * @param {Array} partials The arguments to append to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgsRight(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersIndex = -1, + holdersLength = holders.length, + rightIndex = -1, + rightLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(rangeLength + rightLength), + isUncurried = !isCurried; + + while (++argsIndex < rangeLength) { + result[argsIndex] = args[argsIndex]; + } + var offset = argsIndex; + while (++rightIndex < rightLength) { + result[offset + rightIndex] = partials[rightIndex]; + } + while (++holdersIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[offset + holders[holdersIndex]] = args[argsIndex++]; + } + } + return result; + } + + /** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ + function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; + } + + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @returns {Object} Returns `object`. + */ + function copyObject(source, props, object) { + return copyObjectWith(source, props, object); + } + + /** + * This function is like `copyObject` except that it accepts a function to + * customize copied values. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObjectWith(source, props, object, customizer) { + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : source[key]; + + assignValue(object, key, newValue); + } + return object; + } + + /** + * Copies own symbol properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); + } + + /** + * Creates a function like `_.groupBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} [initializer] The accumulator object initializer. + * @returns {Function} Returns the new aggregator function. + */ + function createAggregator(setter, initializer) { + return function(collection, iteratee) { + var func = isArray(collection) ? arrayAggregator : baseAggregator, + accumulator = initializer ? initializer() : {}; + + return func(collection, setter, getIteratee(iteratee), accumulator); + }; + } + + /** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ + function createAssigner(assigner) { + return rest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = typeof customizer == 'function' + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); + } + + /** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; + } + + /** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + + /** + * Creates a function that wraps `func` to invoke it with the optional `this` + * binding of `thisArg`. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createBaseWrapper(func, bitmask, thisArg) { + var isBind = bitmask & BIND_FLAG, + Ctor = createCtorWrapper(func); + + function wrapper() { + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(isBind ? thisArg : this, arguments); + } + return wrapper; + } + + /** + * Creates a function like `_.lowerFirst`. + * + * @private + * @param {string} methodName The name of the `String` case method to use. + * @returns {Function} Returns the new function. + */ + function createCaseFirst(methodName) { + return function(string) { + string = toString(string); + + var strSymbols = reHasComplexSymbol.test(string) + ? stringToArray(string) + : undefined; + + var chr = strSymbols ? strSymbols[0] : string.charAt(0), + trailing = strSymbols ? strSymbols.slice(1).join('') : string.slice(1); + + return chr[methodName]() + trailing; + }; + } + + /** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ + function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string)), callback, ''); + }; + } + + /** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ + function createCtorWrapper(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + switch (args.length) { + case 0: return new Ctor; + case 1: return new Ctor(args[0]); + case 2: return new Ctor(args[0], args[1]); + case 3: return new Ctor(args[0], args[1], args[2]); + case 4: return new Ctor(args[0], args[1], args[2], args[3]); + case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); + case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + } + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; + } + + /** + * Creates a function that wraps `func` to enable currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. + * @param {number} arity The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createCurryWrapper(func, bitmask, arity) { + var Ctor = createCtorWrapper(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length, + placeholder = getPlaceholder(wrapper); + + while (index--) { + args[index] = arguments[index]; + } + var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) + ? [] + : replaceHolders(args, placeholder); + + length -= holders.length; + if (length < arity) { + return createRecurryWrapper( + func, bitmask, createHybridWrapper, wrapper.placeholder, undefined, + args, holders, undefined, undefined, arity - length); + } + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return apply(fn, this, args); + } + return wrapper; + } + + /** + * Creates a `_.flow` or `_.flowRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new flow function. + */ + function createFlow(fromRight) { + return rest(function(funcs) { + funcs = baseFlatten(funcs, 1); + + var length = funcs.length, + index = length, + prereq = LodashWrapper.prototype.thru; + + if (fromRight) { + funcs.reverse(); + } + while (index--) { + var func = funcs[index]; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (prereq && !wrapper && getFuncName(func) == 'wrapper') { + var wrapper = new LodashWrapper([], true); + } + } + index = wrapper ? index : length; + while (++index < length) { + func = funcs[index]; + + var funcName = getFuncName(func), + data = funcName == 'wrapper' ? getData(func) : undefined; + + if (data && isLaziable(data[0]) && + data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && + !data[4].length && data[9] == 1 + ) { + wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); + } else { + wrapper = (func.length == 1 && isLaziable(func)) + ? wrapper[funcName]() + : wrapper.thru(func); + } + } + return function() { + var args = arguments, + value = args[0]; + + if (wrapper && args.length == 1 && + isArray(value) && value.length >= LARGE_ARRAY_SIZE) { + return wrapper.plant(value).value(); + } + var index = 0, + result = length ? funcs[index].apply(this, args) : value; + + while (++index < length) { + result = funcs[index].call(this, result); + } + return result; + }; + }); + } + + /** + * Creates a function that wraps `func` to invoke it with optional `this` + * binding of `thisArg`, partial application, and currying. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [partialsRight] The arguments to append to those provided + * to the new function. + * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { + var isAry = bitmask & ARY_FLAG, + isBind = bitmask & BIND_FLAG, + isBindKey = bitmask & BIND_KEY_FLAG, + isCurried = bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG), + isFlip = bitmask & FLIP_FLAG, + Ctor = isBindKey ? undefined : createCtorWrapper(func); + + function wrapper() { + var length = arguments.length, + index = length, + args = Array(length); + + while (index--) { + args[index] = arguments[index]; + } + if (isCurried) { + var placeholder = getPlaceholder(wrapper), + holdersCount = countHolders(args, placeholder); + } + if (partials) { + args = composeArgs(args, partials, holders, isCurried); + } + if (partialsRight) { + args = composeArgsRight(args, partialsRight, holdersRight, isCurried); + } + length -= holdersCount; + if (isCurried && length < arity) { + var newHolders = replaceHolders(args, placeholder); + return createRecurryWrapper( + func, bitmask, createHybridWrapper, wrapper.placeholder, thisArg, + args, newHolders, argPos, ary, arity - length + ); + } + var thisBinding = isBind ? thisArg : this, + fn = isBindKey ? thisBinding[func] : func; + + length = args.length; + if (argPos) { + args = reorder(args, argPos); + } else if (isFlip && length > 1) { + args.reverse(); + } + if (isAry && ary < length) { + args.length = ary; + } + if (this && this !== root && this instanceof wrapper) { + fn = Ctor || createCtorWrapper(fn); + } + return fn.apply(thisBinding, args); + } + return wrapper; + } + + /** + * Creates a function like `_.invertBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} toIteratee The function to resolve iteratees. + * @returns {Function} Returns the new inverter function. + */ + function createInverter(setter, toIteratee) { + return function(object, iteratee) { + return baseInverter(object, setter, toIteratee(iteratee), {}); + }; + } + + /** + * Creates a function like `_.over`. + * + * @private + * @param {Function} arrayFunc The function to iterate over iteratees. + * @returns {Function} Returns the new invoker function. + */ + function createOver(arrayFunc) { + return rest(function(iteratees) { + iteratees = arrayMap(baseFlatten(iteratees, 1, isFlattenableIteratee), getIteratee()); + return rest(function(args) { + var thisArg = this; + return arrayFunc(iteratees, function(iteratee) { + return apply(iteratee, thisArg, args); + }); + }); + }); + } + + /** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {number} length The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ + function createPadding(length, chars) { + chars = chars === undefined ? ' ' : (chars + ''); + + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return reHasComplexSymbol.test(chars) + ? stringToArray(result).slice(0, length).join('') + : result.slice(0, length); + } + + /** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ + function createPartialWrapper(func, bitmask, thisArg, partials) { + var isBind = bitmask & BIND_FLAG, + Ctor = createCtorWrapper(func); + + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return apply(fn, isBind ? thisArg : this, args); + } + return wrapper; + } + + /** + * Creates a `_.range` or `_.rangeRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new range function. + */ + function createRange(fromRight) { + return function(start, end, step) { + if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { + end = step = undefined; + } + // Ensure the sign of `-0` is preserved. + start = toNumber(start); + start = start === start ? start : 0; + if (end === undefined) { + end = start; + start = 0; + } else { + end = toNumber(end) || 0; + } + step = step === undefined ? (start < end ? 1 : -1) : (toNumber(step) || 0); + return baseRange(start, end, step, fromRight); + }; + } + + /** + * Creates a function that wraps `func` to continue currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. + * @param {Function} wrapFunc The function to create the `func` wrapper. + * @param {*} placeholder The placeholder value. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { + var isCurry = bitmask & CURRY_FLAG, + newArgPos = argPos ? copyArray(argPos) : undefined, + newHolders = isCurry ? holders : undefined, + newHoldersRight = isCurry ? undefined : holders, + newPartials = isCurry ? partials : undefined, + newPartialsRight = isCurry ? undefined : partials; + + bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG); + bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG); + + if (!(bitmask & CURRY_BOUND_FLAG)) { + bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG); + } + var newData = [ + func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, + newHoldersRight, newArgPos, ary, arity + ]; + + var result = wrapFunc.apply(undefined, newData); + if (isLaziable(func)) { + setData(result, newData); + } + result.placeholder = placeholder; + return result; + } + + /** + * Creates a function like `_.round`. + * + * @private + * @param {string} methodName The name of the `Math` method to use when rounding. + * @returns {Function} Returns the new round function. + */ + function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + number = toNumber(number); + precision = toInteger(precision); + if (precision) { + // Shift with exponential notation to avoid floating-point issues. + // See [MDN](https://mdn.io/round#Examples) for more details. + var pair = (toString(number) + 'e').split('e'), + value = func(pair[0] + 'e' + (+pair[1] + precision)); + + pair = (toString(value) + 'e').split('e'); + return +(pair[0] + 'e' + (+pair[1] - precision)); + } + return func(number); + }; + } + + /** + * Creates a set of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ + var createSet = !(Set && new Set([1, 2]).size === 2) ? noop : function(values) { + return new Set(values); + }; + + /** + * Creates a function that either curries or invokes `func` with optional + * `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask of wrapper flags. + * The bitmask may be composed of the following flags: + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` or `_.curryRight` of a bound function + * 8 - `_.curry` + * 16 - `_.curryRight` + * 32 - `_.partial` + * 64 - `_.partialRight` + * 128 - `_.rearg` + * 256 - `_.ary` + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to be partially applied. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + var isBindKey = bitmask & BIND_KEY_FLAG; + if (!isBindKey && typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var length = partials ? partials.length : 0; + if (!length) { + bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG); + partials = holders = undefined; + } + ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); + arity = arity === undefined ? arity : toInteger(arity); + length -= holders ? holders.length : 0; + + if (bitmask & PARTIAL_RIGHT_FLAG) { + var partialsRight = partials, + holdersRight = holders; + + partials = holders = undefined; + } + var data = isBindKey ? undefined : getData(func); + + var newData = [ + func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, + argPos, ary, arity + ]; + + if (data) { + mergeData(newData, data); + } + func = newData[0]; + bitmask = newData[1]; + thisArg = newData[2]; + partials = newData[3]; + holders = newData[4]; + arity = newData[9] = newData[9] == null + ? (isBindKey ? 0 : func.length) + : nativeMax(newData[9] - length, 0); + + if (!arity && bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG)) { + bitmask &= ~(CURRY_FLAG | CURRY_RIGHT_FLAG); + } + if (!bitmask || bitmask == BIND_FLAG) { + var result = createBaseWrapper(func, bitmask, thisArg); + } else if (bitmask == CURRY_FLAG || bitmask == CURRY_RIGHT_FLAG) { + result = createCurryWrapper(func, bitmask, arity); + } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !holders.length) { + result = createPartialWrapper(func, bitmask, thisArg, partials); + } else { + result = createHybridWrapper.apply(undefined, newData); + } + var setter = data ? baseSetData : setData; + return setter(result, newData); + } + + /** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ + function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { + var index = -1, + isPartial = bitmask & PARTIAL_COMPARE_FLAG, + isUnordered = bitmask & UNORDERED_COMPARE_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked) { + return stacked == other; + } + var result = true; + stack.set(array, other); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (isUnordered) { + if (!arraySome(other, function(othValue) { + return arrValue === othValue || + equalFunc(arrValue, othValue, customizer, bitmask, stack); + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, customizer, bitmask, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + return result; + } + + /** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + // Coerce dates and booleans to numbers, dates to milliseconds and + // booleans to `1` or `0` treating invalid dates coerced to `NaN` as + // not equal. + return +object == +other; + + case errorTag: + return object.name == other.name && object.message == other.message; + + case numberTag: + // Treat `NaN` vs. `NaN` as equal. + return (object != +object) ? other != +other : object == +other; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & PARTIAL_COMPARE_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= UNORDERED_COMPARE_FLAG; + stack.set(object, other); + + // Recursively compare objects (susceptible to call stack limits). + return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; + } + + /** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, + objProps = keys(object), + objLength = objProps.length, + othProps = keys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : baseHas(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + var result = true; + stack.set(object, other); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + return result; + } + + /** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); + } + + /** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); + } + + /** + * Gets metadata for `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {*} Returns the metadata for `func`. + */ + var getData = !metaMap ? noop : function(func) { + return metaMap.get(func); + }; + + /** + * Gets the name of `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {string} Returns the function name. + */ + function getFuncName(func) { + var result = (func.name + ''), + array = realNames[result], + length = hasOwnProperty.call(realNames, result) ? array.length : 0; + + while (length--) { + var data = array[length], + otherFunc = data.func; + if (otherFunc == null || otherFunc == func) { + return data.name; + } + } + return result; + } + + /** + * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, + * this function returns the custom method, otherwise it returns `baseIteratee`. + * If arguments are provided, the chosen function is invoked with them and + * its result is returned. + * + * @private + * @param {*} [value] The value to convert to an iteratee. + * @param {number} [arity] The arity of the created iteratee. + * @returns {Function} Returns the chosen function or its result. + */ + function getIteratee() { + var result = lodash.iteratee || iteratee; + result = result === iteratee ? baseIteratee : result; + return arguments.length ? result(arguments[0], arguments[1]) : result; + } + + /** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a + * [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects + * Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ + var getLength = baseProperty('length'); + + /** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ + function getMatchData(object) { + var result = toPairs(object), + length = result.length; + + while (length--) { + result[length][2] = isStrictComparable(result[length][1]); + } + return result; + } + + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = object[key]; + return isNative(value) ? value : undefined; + } + + /** + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ + function getPlaceholder(func) { + var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; + return object.placeholder; + } + + /** + * Gets the `[[Prototype]]` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {null|Object} Returns the `[[Prototype]]`. + */ + function getPrototype(value) { + return nativeGetPrototype(Object(value)); + } + + /** + * Creates an array of the own enumerable symbol properties of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + function getSymbols(object) { + // Coerce `object` to an object to avoid non-object errors in V8. + // See https://bugs.chromium.org/p/v8/issues/detail?id=3443 for more details. + return getOwnPropertySymbols(Object(object)); + } + + // Fallback for IE < 11. + if (!getOwnPropertySymbols) { + getSymbols = function() { + return []; + }; + } + + /** + * Creates an array of the own and inherited enumerable symbol properties + * of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbolsIn = !getOwnPropertySymbols ? getSymbols : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; + }; + + /** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function getTag(value) { + return objectToString.call(value); + } + + // Fallback for data views, maps, sets, and weak maps in IE 11, + // for data views in Edge, and promises in Node.js. + if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = objectToString.call(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; + } + + /** + * Gets the view, applying any `transforms` to the `start` and `end` positions. + * + * @private + * @param {number} start The start of the view. + * @param {number} end The end of the view. + * @param {Array} transforms The transformations to apply to the view. + * @returns {Object} Returns an object containing the `start` and `end` + * positions of the view. + */ + function getView(start, end, transforms) { + var index = -1, + length = transforms.length; + + while (++index < length) { + var data = transforms[index], + size = data.size; + + switch (data.type) { + case 'drop': start += size; break; + case 'dropRight': end -= size; break; + case 'take': end = nativeMin(end, start + size); break; + case 'takeRight': start = nativeMax(start, end - size); break; + } + } + return { 'start': start, 'end': end }; + } + + /** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ + function hasPath(object, path, hasFunc) { + path = isKey(path, object) ? [path] : baseCastPath(path); + + var result, + index = -1, + length = path.length; + + while (++index < length) { + var key = path[index]; + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result) { + return result; + } + var length = object ? object.length : 0; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isString(object) || isArguments(object)); + } + + /** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ + function initCloneArray(array) { + var length = array.length, + result = array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; + } + + /** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; + } + + /** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneByTag(object, tag, cloneFunc, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return cloneMap(object, isDeep, cloneFunc); + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return cloneSet(object, isDeep, cloneFunc); + + case symbolTag: + return cloneSymbol(object); + } + } + + /** + * Creates an array of index keys for `object` values of arrays, + * `arguments` objects, and strings, otherwise `null` is returned. + * + * @private + * @param {Object} object The object to query. + * @returns {Array|null} Returns index keys, else `null`. + */ + function indexKeys(object) { + var length = object ? object.length : undefined; + if (isLength(length) && + (isArray(object) || isString(object) || isArguments(object))) { + return baseTimes(length, String); + } + return null; + } + + /** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenable(value) { + return isArrayLikeObject(value) && (isArray(value) || isArguments(value)); + } + + /** + * Checks if `value` is a flattenable array and not a `_.matchesProperty` + * iteratee shorthand. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenableIteratee(value) { + return isArray(value) && !(value.length == 2 && !isFunction(value[0])); + } + + /** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; + } + + /** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ + function isKey(value, object) { + var type = typeof value; + if (type == 'number' || type == 'symbol') { + return true; + } + return !isArray(value) && + (isSymbol(value) || reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object))); + } + + /** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ + function isKeyable(value) { + var type = typeof value; + return type == 'number' || type == 'boolean' || + (type == 'string' && value != '__proto__') || value == null; + } + + /** + * Checks if `func` has a lazy counterpart. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart, + * else `false`. + */ + function isLaziable(func) { + var funcName = getFuncName(func), + other = lodash[funcName]; + + if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { + return false; + } + if (func === other) { + return true; + } + var data = getData(other); + return !!data && func === data[0]; + } + + /** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; + } + + /** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ + function isStrictComparable(value) { + return value === value && !isObject(value); + } + + /** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new function. + */ + function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; + } + + /** + * Merges the function metadata of `source` into `data`. + * + * Merging metadata reduces the number of wrappers used to invoke a function. + * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` + * may be applied regardless of execution order. Methods like `_.ary` and + * `_.rearg` modify function arguments, making the order in which they are + * executed important, preventing the merging of metadata. However, we make + * an exception for a safe combined case where curried functions have `_.ary` + * and or `_.rearg` applied. + * + * @private + * @param {Array} data The destination metadata. + * @param {Array} source The source metadata. + * @returns {Array} Returns `data`. + */ + function mergeData(data, source) { + var bitmask = data[1], + srcBitmask = source[1], + newBitmask = bitmask | srcBitmask, + isCommon = newBitmask < (BIND_FLAG | BIND_KEY_FLAG | ARY_FLAG); + + var isCombo = + ((srcBitmask == ARY_FLAG) && (bitmask == CURRY_FLAG)) || + ((srcBitmask == ARY_FLAG) && (bitmask == REARG_FLAG) && (data[7].length <= source[8])) || + ((srcBitmask == (ARY_FLAG | REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == CURRY_FLAG)); + + // Exit early if metadata can't be merged. + if (!(isCommon || isCombo)) { + return data; + } + // Use source `thisArg` if available. + if (srcBitmask & BIND_FLAG) { + data[2] = source[2]; + // Set when currying a bound function. + newBitmask |= bitmask & BIND_FLAG ? 0 : CURRY_BOUND_FLAG; + } + // Compose partial arguments. + var value = source[3]; + if (value) { + var partials = data[3]; + data[3] = partials ? composeArgs(partials, value, source[4]) : copyArray(value); + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : copyArray(source[4]); + } + // Compose partial right arguments. + value = source[5]; + if (value) { + partials = data[5]; + data[5] = partials ? composeArgsRight(partials, value, source[6]) : copyArray(value); + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : copyArray(source[6]); + } + // Use source `argPos` if available. + value = source[7]; + if (value) { + data[7] = copyArray(value); + } + // Use source `ary` if it's smaller. + if (srcBitmask & ARY_FLAG) { + data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); + } + // Use source `arity` if one is not provided. + if (data[9] == null) { + data[9] = source[9]; + } + // Use source `func` and merge bitmasks. + data[0] = source[0]; + data[1] = newBitmask; + + return data; + } + + /** + * Used by `_.defaultsDeep` to customize its `_.merge` use. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to merge. + * @param {Object} object The parent object of `objValue`. + * @param {Object} source The parent object of `srcValue`. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + * @returns {*} Returns the value to assign. + */ + function mergeDefaults(objValue, srcValue, key, object, source, stack) { + if (isObject(objValue) && isObject(srcValue)) { + baseMerge(objValue, srcValue, undefined, mergeDefaults, stack.set(srcValue, objValue)); + } + return objValue; + } + + /** + * Gets the parent value at `path` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. + */ + function parent(object, path) { + return path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); + } + + /** + * Reorder `array` according to the specified indexes where the element at + * the first index is assigned as the first element, the element at + * the second index is assigned as the second element, and so on. + * + * @private + * @param {Array} array The array to reorder. + * @param {Array} indexes The arranged array indexes. + * @returns {Array} Returns `array`. + */ + function reorder(array, indexes) { + var arrLength = array.length, + length = nativeMin(indexes.length, arrLength), + oldArray = copyArray(array); + + while (length--) { + var index = indexes[length]; + array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; + } + return array; + } + + /** + * Sets metadata for `func`. + * + * **Note:** If this function becomes hot, i.e. is invoked a lot in a short + * period of time, it will trip its breaker and transition to an identity + * function to avoid garbage collection pauses in V8. See + * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) + * for more details. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var setData = (function() { + var count = 0, + lastCalled = 0; + + return function(key, value) { + var stamp = now(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return key; + } + } else { + count = 0; + } + return baseSetData(key, value); + }; + }()); + + /** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ + var stringToPath = memoize(function(string) { + var result = []; + toString(string).replace(rePropName, function(match, number, quote, string) { + result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; + }); + + /** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; + } + + /** + * Creates a clone of `wrapper`. + * + * @private + * @param {Object} wrapper The wrapper to clone. + * @returns {Object} Returns the cloned wrapper. + */ + function wrapperClone(wrapper) { + if (wrapper instanceof LazyWrapper) { + return wrapper.clone(); + } + var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); + result.__actions__ = copyArray(wrapper.__actions__); + result.__index__ = wrapper.__index__; + result.__values__ = wrapper.__values__; + return result; + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array of elements split into groups the length of `size`. + * If `array` can't be split evenly, the final chunk will be the remaining + * elements. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to process. + * @param {number} [size=1] The length of each chunk + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the new array containing chunks. + * @example + * + * _.chunk(['a', 'b', 'c', 'd'], 2); + * // => [['a', 'b'], ['c', 'd']] + * + * _.chunk(['a', 'b', 'c', 'd'], 3); + * // => [['a', 'b', 'c'], ['d']] + */ + function chunk(array, size, guard) { + if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { + size = 1; + } else { + size = nativeMax(toInteger(size), 0); + } + var length = array ? array.length : 0; + if (!length || size < 1) { + return []; + } + var index = 0, + resIndex = 0, + result = Array(nativeCeil(length / size)); + + while (index < length) { + result[resIndex++] = baseSlice(array, index, (index += size)); + } + return result; + } + + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + var index = -1, + length = array ? array.length : 0, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result[resIndex++] = value; + } + } + return result; + } + + /** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ + function concat() { + var length = arguments.length, + array = castArray(arguments[0]); + + if (length < 2) { + return length ? copyArray(array) : []; + } + var args = Array(length - 1); + while (length--) { + args[length - 1] = arguments[length]; + } + return arrayConcat(array, baseFlatten(args, 1)); + } + + /** + * Creates an array of unique `array` values not included in the other given + * arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. The order of result values is determined by the + * order they occur in the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.difference([3, 2, 1], [4, 2]); + * // => [3, 1] + */ + var difference = rest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) + : []; + }); + + /** + * This method is like `_.difference` except that it accepts `iteratee` which + * is invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. Result values are chosen from the first array. + * The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.differenceBy([3.1, 2.2, 1.3], [4.4, 2.5], Math.floor); + * // => [3.1, 1.3] + * + * // The `_.property` iteratee shorthand. + * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var differenceBy = rest(function(array, values) { + var iteratee = last(values); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee)) + : []; + }); + + /** + * This method is like `_.difference` except that it accepts `comparator` + * which is invoked to compare elements of `array` to `values`. Result values + * are chosen from the first array. The comparator is invoked with two arguments: + * (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * + * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); + * // => [{ 'x': 2, 'y': 1 }] + */ + var differenceWith = rest(function(array, values) { + var comparator = last(values); + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) + : []; + }); + + /** + * Creates a slice of `array` with `n` elements dropped from the beginning. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.drop([1, 2, 3]); + * // => [2, 3] + * + * _.drop([1, 2, 3], 2); + * // => [3] + * + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function drop(array, n, guard) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); + } + + /** + * Creates a slice of `array` with `n` elements dropped from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRight([1, 2, 3]); + * // => [1, 2] + * + * _.dropRight([1, 2, 3], 2); + * // => [1] + * + * _.dropRight([1, 2, 3], 5); + * // => [] + * + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function dropRight(array, n, guard) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` excluding elements dropped from the end. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.dropRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney'] + * + * // The `_.matches` iteratee shorthand. + * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropRightWhile(users, ['active', false]); + * // => objects for ['barney'] + * + * // The `_.property` iteratee shorthand. + * _.dropRightWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true, true) + : []; + } + + /** + * Creates a slice of `array` excluding elements dropped from the beginning. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.dropWhile(users, function(o) { return !o.active; }); + * // => objects for ['pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.dropWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropWhile(users, ['active', false]); + * // => objects for ['pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.dropWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true) + : []; + } + + /** + * Fills elements of `array` with `value` from `start` up to, but not + * including, `end`. + * + * **Note:** This method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Array + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.fill(array, 'a'); + * console.log(array); + * // => ['a', 'a', 'a'] + * + * _.fill(Array(3), 2); + * // => [2, 2, 2] + * + * _.fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] + */ + function fill(array, value, start, end) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { + start = 0; + end = length; + } + return baseFill(array, value, start, end); + } + + /** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to search. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ + function findIndex(array, predicate) { + return (array && array.length) + ? baseFindIndex(array, getIteratee(predicate, 3)) + : -1; + } + + /** + * This method is like `_.findIndex` except that it iterates over elements + * of `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to search. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); + * // => 2 + * + * // The `_.matches` iteratee shorthand. + * _.findLastIndex(users, { 'user': 'barney', 'active': true }); + * // => 0 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastIndex(users, ['active', false]); + * // => 2 + * + * // The `_.property` iteratee shorthand. + * _.findLastIndex(users, 'active'); + * // => 0 + */ + function findLastIndex(array, predicate) { + return (array && array.length) + ? baseFindIndex(array, getIteratee(predicate, 3), true) + : -1; + } + + /** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ + function flatten(array) { + var length = array ? array.length : 0; + return length ? baseFlatten(array, 1) : []; + } + + /** + * Recursively flattens `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ + function flattenDeep(array) { + var length = array ? array.length : 0; + return length ? baseFlatten(array, INFINITY) : []; + } + + /** + * Recursively flatten `array` up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Array + * @param {Array} array The array to flatten. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * var array = [1, [2, [3, [4]], 5]]; + * + * _.flattenDepth(array, 1); + * // => [1, 2, [3, [4]], 5] + * + * _.flattenDepth(array, 2); + * // => [1, 2, 3, [4], 5] + */ + function flattenDepth(array, depth) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(array, depth); + } + + /** + * The inverse of `_.toPairs`; this method returns an object composed + * from key-value `pairs`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} pairs The key-value pairs. + * @returns {Object} Returns the new object. + * @example + * + * _.fromPairs([['fred', 30], ['barney', 40]]); + * // => { 'fred': 30, 'barney': 40 } + */ + function fromPairs(pairs) { + var index = -1, + length = pairs ? pairs.length : 0, + result = {}; + + while (++index < length) { + var pair = pairs[index]; + result[pair[0]] = pair[1]; + } + return result; + } + + /** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ + function head(array) { + return array ? array[0] : undefined; + } + + /** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ + function indexOf(array, value, fromIndex) { + var length = array ? array.length : 0; + if (!length) { + return -1; + } + fromIndex = toInteger(fromIndex); + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return baseIndexOf(array, value, fromIndex); + } + + /** + * Gets all but the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + */ + function initial(array) { + return dropRight(array, 1); + } + + /** + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. The order of result values is determined by the + * order they occur in the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersection([2, 1], [4, 2], [1, 2]); + * // => [2] + */ + var intersection = rest(function(arrays) { + var mapped = arrayMap(arrays, baseCastArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `iteratee` + * which is invoked for each element of each `arrays` to generate the criterion + * by which they're compared. Result values are chosen from the first array. + * The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); + * // => [2.1] + * + * // The `_.property` iteratee shorthand. + * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }] + */ + var intersectionBy = rest(function(arrays) { + var iteratee = last(arrays), + mapped = arrayMap(arrays, baseCastArrayLikeObject); + + if (iteratee === last(mapped)) { + iteratee = undefined; + } else { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, getIteratee(iteratee)) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `comparator` + * which is invoked to compare elements of `arrays`. Result values are chosen + * from the first array. The comparator is invoked with two arguments: + * (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.intersectionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }] + */ + var intersectionWith = rest(function(arrays) { + var comparator = last(arrays), + mapped = arrayMap(arrays, baseCastArrayLikeObject); + + if (comparator === last(mapped)) { + comparator = undefined; + } else { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, undefined, comparator) + : []; + }); + + /** + * Converts all elements in `array` into a string separated by `separator`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to convert. + * @param {string} [separator=','] The element separator. + * @returns {string} Returns the joined string. + * @example + * + * _.join(['a', 'b', 'c'], '~'); + * // => 'a~b~c' + */ + function join(array, separator) { + return array ? nativeJoin.call(array, separator) : ''; + } + + /** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ + function last(array) { + var length = array ? array.length : 0; + return length ? array[length - 1] : undefined; + } + + /** + * This method is like `_.indexOf` except that it iterates over elements of + * `array` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.lastIndexOf([1, 2, 1, 2], 2); + * // => 3 + * + * // Search from the `fromIndex`. + * _.lastIndexOf([1, 2, 1, 2], 2, 2); + * // => 1 + */ + function lastIndexOf(array, value, fromIndex) { + var length = array ? array.length : 0; + if (!length) { + return -1; + } + var index = length; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = ( + index < 0 + ? nativeMax(length + index, 0) + : nativeMin(index, length - 1) + ) + 1; + } + if (value !== value) { + return indexOfNaN(array, index, true); + } + while (index--) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * Removes all given values from `array` using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` + * to remove elements from an array by predicate. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...*} [values] The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3, 1, 2, 3]; + * + * _.pull(array, 2, 3); + * console.log(array); + * // => [1, 1] + */ + var pull = rest(pullAll); + + /** + * This method is like `_.pull` except that it accepts an array of values to remove. + * + * **Note:** Unlike `_.difference`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3, 1, 2, 3]; + * + * _.pullAll(array, [2, 3]); + * console.log(array); + * // => [1, 1] + */ + function pullAll(array, values) { + return (array && array.length && values && values.length) + ? basePullAll(array, values) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `iteratee` which is + * invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The iteratee is invoked with one argument: (value). + * + * **Note:** Unlike `_.differenceBy`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; + * + * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); + * console.log(array); + * // => [{ 'x': 2 }] + */ + function pullAllBy(array, values, iteratee) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, getIteratee(iteratee)) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `comparator` which + * is invoked to compare elements of `array` to `values`. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.differenceWith`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; + * + * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); + * console.log(array); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] + */ + function pullAllWith(array, values, comparator) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, undefined, comparator) + : array; + } + + /** + * Removes elements from `array` corresponding to `indexes` and returns an + * array of removed elements. + * + * **Note:** Unlike `_.at`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...(number|number[])} [indexes] The indexes of elements to remove, + * specified individually or in arrays. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = [5, 10, 15, 20]; + * var evens = _.pullAt(array, 1, 3); + * + * console.log(array); + * // => [5, 15] + * + * console.log(evens); + * // => [10, 20] + */ + var pullAt = rest(function(array, indexes) { + indexes = arrayMap(baseFlatten(indexes, 1), String); + + var result = baseAt(array, indexes); + basePullAt(array, indexes.sort(compareAscending)); + return result; + }); + + /** + * Removes all elements from `array` that `predicate` returns truthy for + * and returns an array of the removed elements. The predicate is invoked + * with three arguments: (value, index, array). + * + * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` + * to pull elements from an array by value. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = [1, 2, 3, 4]; + * var evens = _.remove(array, function(n) { + * return n % 2 == 0; + * }); + * + * console.log(array); + * // => [1, 3] + * + * console.log(evens); + * // => [2, 4] + */ + function remove(array, predicate) { + var result = []; + if (!(array && array.length)) { + return result; + } + var index = -1, + indexes = [], + length = array.length; + + predicate = getIteratee(predicate, 3); + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result.push(value); + indexes.push(index); + } + } + basePullAt(array, indexes); + return result; + } + + /** + * Reverses `array` so that the first element becomes the last, the second + * element becomes the second to last, and so on. + * + * **Note:** This method mutates `array` and is based on + * [`Array#reverse`](https://mdn.io/Array/reverse). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.reverse(array); + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function reverse(array) { + return array ? nativeReverse.call(array) : array; + } + + /** + * Creates a slice of `array` from `start` up to, but not including, `end`. + * + * **Note:** This method is used instead of + * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are + * returned. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function slice(array, start, end) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { + start = 0; + end = length; + } + else { + start = start == null ? 0 : toInteger(start); + end = end === undefined ? length : toInteger(end); + } + return baseSlice(array, start, end); + } + + /** + * Uses a binary search to determine the lowest index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedIndex([30, 50], 40); + * // => 1 + * + * _.sortedIndex([4, 5], 4); + * // => 0 + */ + function sortedIndex(array, value) { + return baseSortedIndex(array, value); + } + + /** + * This method is like `_.sortedIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; + * + * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); + * // => 1 + * + * // The `_.property` iteratee shorthand. + * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); + * // => 0 + */ + function sortedIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee)); + } + + /** + * This method is like `_.indexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedIndexOf([1, 1, 2, 2], 2); + * // => 2 + */ + function sortedIndexOf(array, value) { + var length = array ? array.length : 0; + if (length) { + var index = baseSortedIndex(array, value); + if (index < length && eq(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.sortedIndex` except that it returns the highest + * index at which `value` should be inserted into `array` in order to + * maintain its sort order. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedLastIndex([4, 5], 4); + * // => 1 + */ + function sortedLastIndex(array, value) { + return baseSortedIndex(array, value, true); + } + + /** + * This method is like `_.sortedLastIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * // The `_.property` iteratee shorthand. + * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); + * // => 1 + */ + function sortedLastIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee), true); + } + + /** + * This method is like `_.lastIndexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedLastIndexOf([1, 1, 2, 2], 2); + * // => 3 + */ + function sortedLastIndexOf(array, value) { + var length = array ? array.length : 0; + if (length) { + var index = baseSortedIndex(array, value, true) - 1; + if (eq(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.uniq` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniq([1, 1, 2]); + * // => [1, 2] + */ + function sortedUniq(array) { + return (array && array.length) + ? baseSortedUniq(array) + : []; + } + + /** + * This method is like `_.uniqBy` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); + * // => [1.1, 2.3] + */ + function sortedUniqBy(array, iteratee) { + return (array && array.length) + ? baseSortedUniqBy(array, getIteratee(iteratee)) + : []; + } + + /** + * Gets all but the first element of `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.tail([1, 2, 3]); + * // => [2, 3] + */ + function tail(array) { + return drop(array, 1); + } + + /** + * Creates a slice of `array` with `n` elements taken from the beginning. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.take([1, 2, 3]); + * // => [1] + * + * _.take([1, 2, 3], 2); + * // => [1, 2] + * + * _.take([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.take([1, 2, 3], 0); + * // => [] + */ + function take(array, n, guard) { + if (!(array && array.length)) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` with `n` elements taken from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.takeRight([1, 2, 3]); + * // => [3] + * + * _.takeRight([1, 2, 3], 2); + * // => [2, 3] + * + * _.takeRight([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.takeRight([1, 2, 3], 0); + * // => [] + */ + function takeRight(array, n, guard) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, n < 0 ? 0 : n, length); + } + + /** + * Creates a slice of `array` with elements taken from the end. Elements are + * taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.takeRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeRightWhile(users, ['active', false]); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.takeRightWhile(users, 'active'); + * // => [] + */ + function takeRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), false, true) + : []; + } + + /** + * Creates a slice of `array` with elements taken from the beginning. Elements + * are taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false}, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.takeWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matches` iteratee shorthand. + * _.takeWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeWhile(users, ['active', false]); + * // => objects for ['barney', 'fred'] + * + * // The `_.property` iteratee shorthand. + * _.takeWhile(users, 'active'); + * // => [] + */ + function takeWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3)) + : []; + } + + /** + * Creates an array of unique values, in order, from all given arrays using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.union([2, 1], [4, 2], [1, 2]); + * // => [2, 1, 4] + */ + var union = rest(function(arrays) { + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); + }); + + /** + * This method is like `_.union` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which uniqueness is computed. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.unionBy([2.1, 1.2], [4.3, 2.4], Math.floor); + * // => [2.1, 1.2, 4.3] + * + * // The `_.property` iteratee shorthand. + * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + var unionBy = rest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee)); + }); + + /** + * This method is like `_.union` except that it accepts `comparator` which + * is invoked to compare elements of `arrays`. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.unionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var unionWith = rest(function(arrays) { + var comparator = last(arrays); + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); + }); + + /** + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons, in which only the first occurrence of each + * element is kept. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniq([2, 1, 2]); + * // => [2, 1] + */ + function uniq(array) { + return (array && array.length) + ? baseUniq(array) + : []; + } + + /** + * This method is like `_.uniq` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * uniqueness is computed. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniqBy([2.1, 1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + function uniqBy(array, iteratee) { + return (array && array.length) + ? baseUniq(array, getIteratee(iteratee)) + : []; + } + + /** + * This method is like `_.uniq` except that it accepts `comparator` which + * is invoked to compare elements of `array`. The comparator is invoked with + * two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.uniqWith(objects, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] + */ + function uniqWith(array, comparator) { + return (array && array.length) + ? baseUniq(array, undefined, comparator) + : []; + } + + /** + * This method is like `_.zip` except that it accepts an array of grouped + * elements and creates an array regrouping the elements to their pre-zip + * configuration. + * + * @static + * @memberOf _ + * @since 1.2.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]); + * // => [['fred', 30, true], ['barney', 40, false]] + * + * _.unzip(zipped); + * // => [['fred', 'barney'], [30, 40], [true, false]] + */ + function unzip(array) { + if (!(array && array.length)) { + return []; + } + var length = 0; + array = arrayFilter(array, function(group) { + if (isArrayLikeObject(group)) { + length = nativeMax(group.length, length); + return true; + } + }); + return baseTimes(length, function(index) { + return arrayMap(array, baseProperty(index)); + }); + } + + /** + * This method is like `_.unzip` except that it accepts `iteratee` to specify + * how regrouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @param {Function} [iteratee=_.identity] The function to combine + * regrouped values. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip([1, 2], [10, 20], [100, 200]); + * // => [[1, 10, 100], [2, 20, 200]] + * + * _.unzipWith(zipped, _.add); + * // => [3, 30, 300] + */ + function unzipWith(array, iteratee) { + if (!(array && array.length)) { + return []; + } + var result = unzip(array); + if (iteratee == null) { + return result; + } + return arrayMap(result, function(group) { + return apply(iteratee, undefined, group); + }); + } + + /** + * Creates an array excluding all given values using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to filter. + * @param {...*} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.without([1, 2, 1, 3], 1, 2); + * // => [3] + */ + var without = rest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, values) + : []; + }); + + /** + * Creates an array of unique values that is the + * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) + * of the given arrays. The order of result values is determined by the order + * they occur in the arrays. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of values. + * @example + * + * _.xor([2, 1], [4, 2]); + * // => [1, 4] + */ + var xor = rest(function(arrays) { + return baseXor(arrayFilter(arrays, isArrayLikeObject)); + }); + + /** + * This method is like `_.xor` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which by which they're compared. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {Array} Returns the new array of values. + * @example + * + * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); + * // => [1.2, 4.3] + * + * // The `_.property` iteratee shorthand. + * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var xorBy = rest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee)); + }); + + /** + * This method is like `_.xor` except that it accepts `comparator` which is + * invoked to compare elements of `arrays`. The comparator is invoked with + * two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.xorWith(objects, others, _.isEqual); + * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var xorWith = rest(function(arrays) { + var comparator = last(arrays); + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); + }); + + /** + * Creates an array of grouped elements, the first of which contains the + * first elements of the given arrays, the second of which contains the + * second elements of the given arrays, and so on. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zip(['fred', 'barney'], [30, 40], [true, false]); + * // => [['fred', 30, true], ['barney', 40, false]] + */ + var zip = rest(unzip); + + /** + * This method is like `_.fromPairs` except that it accepts two arrays, + * one of property identifiers and one of corresponding values. + * + * @static + * @memberOf _ + * @since 0.4.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObject(['a', 'b'], [1, 2]); + * // => { 'a': 1, 'b': 2 } + */ + function zipObject(props, values) { + return baseZipObject(props || [], values || [], assignValue); + } + + /** + * This method is like `_.zipObject` except that it supports property paths. + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); + * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } + */ + function zipObjectDeep(props, values) { + return baseZipObject(props || [], values || [], baseSet); + } + + /** + * This method is like `_.zip` except that it accepts `iteratee` to specify + * how grouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @param {Function} [iteratee=_.identity] The function to combine grouped values. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { + * return a + b + c; + * }); + * // => [111, 222] + */ + var zipWith = rest(function(arrays) { + var length = arrays.length, + iteratee = length > 1 ? arrays[length - 1] : undefined; + + iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; + return unzipWith(arrays, iteratee); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' + */ + function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; + } + + /** + * This method invokes `interceptor` and returns `value`. The interceptor + * is invoked with one argument; (value). The purpose of this method is to + * "tap into" a method chain sequence in order to modify intermediate results. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns `value`. + * @example + * + * _([1, 2, 3]) + * .tap(function(array) { + * // Mutate input array. + * array.pop(); + * }) + * .reverse() + * .value(); + * // => [2, 1] + */ + function tap(value, interceptor) { + interceptor(value); + return value; + } + + /** + * This method is like `_.tap` except that it returns the result of `interceptor`. + * The purpose of this method is to "pass thru" values replacing intermediate + * results in a method chain sequence. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns the result of `interceptor`. + * @example + * + * _(' abc ') + * .chain() + * .trim() + * .thru(function(value) { + * return [value]; + * }) + * .value(); + * // => ['abc'] + */ + function thru(value, interceptor) { + return interceptor(value); + } + + /** + * This method is the wrapper version of `_.at`. + * + * @name at + * @memberOf _ + * @since 1.0.0 + * @category Seq + * @param {...(string|string[])} [paths] The property paths of elements to pick, + * specified individually or in arrays. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _(object).at(['a[0].b.c', 'a[1]']).value(); + * // => [3, 4] + * + * _(['a', 'b', 'c']).at(0, 2).value(); + * // => ['a', 'c'] + */ + var wrapperAt = rest(function(paths) { + paths = baseFlatten(paths, 1); + var length = paths.length, + start = length ? paths[0] : 0, + value = this.__wrapped__, + interceptor = function(object) { return baseAt(object, paths); }; + + if (length > 1 || this.__actions__.length || + !(value instanceof LazyWrapper) || !isIndex(start)) { + return this.thru(interceptor); + } + value = value.slice(start, +start + (length ? 1 : 0)); + value.__actions__.push({ + 'func': thru, + 'args': [interceptor], + 'thisArg': undefined + }); + return new LodashWrapper(value, this.__chain__).thru(function(array) { + if (length && !array.length) { + array.push(undefined); + } + return array; + }); + }); + + /** + * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. + * + * @name chain + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // A sequence without explicit chaining. + * _(users).head(); + * // => { 'user': 'barney', 'age': 36 } + * + * // A sequence with explicit chaining. + * _(users) + * .chain() + * .head() + * .pick('user') + * .value(); + * // => { 'user': 'barney' } + */ + function wrapperChain() { + return chain(this); + } + + /** + * Executes the chain sequence and returns the wrapped result. + * + * @name commit + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2]; + * var wrapped = _(array).push(3); + * + * console.log(array); + * // => [1, 2] + * + * wrapped = wrapped.commit(); + * console.log(array); + * // => [1, 2, 3] + * + * wrapped.last(); + * // => 3 + * + * console.log(array); + * // => [1, 2, 3] + */ + function wrapperCommit() { + return new LodashWrapper(this.value(), this.__chain__); + } + + /** + * Gets the next value on a wrapped object following the + * [iterator protocol](https://mdn.io/iteration_protocols#iterator). + * + * @name next + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the next iterator value. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped.next(); + * // => { 'done': false, 'value': 1 } + * + * wrapped.next(); + * // => { 'done': false, 'value': 2 } + * + * wrapped.next(); + * // => { 'done': true, 'value': undefined } + */ + function wrapperNext() { + if (this.__values__ === undefined) { + this.__values__ = toArray(this.value()); + } + var done = this.__index__ >= this.__values__.length, + value = done ? undefined : this.__values__[this.__index__++]; + + return { 'done': done, 'value': value }; + } + + /** + * Enables the wrapper to be iterable. + * + * @name Symbol.iterator + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the wrapper object. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped[Symbol.iterator]() === wrapped; + * // => true + * + * Array.from(wrapped); + * // => [1, 2] + */ + function wrapperToIterator() { + return this; + } + + /** + * Creates a clone of the chain sequence planting `value` as the wrapped value. + * + * @name plant + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @param {*} value The value to plant. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2]).map(square); + * var other = wrapped.plant([3, 4]); + * + * other.value(); + * // => [9, 16] + * + * wrapped.value(); + * // => [1, 4] + */ + function wrapperPlant(value) { + var result, + parent = this; + + while (parent instanceof baseLodash) { + var clone = wrapperClone(parent); + clone.__index__ = 0; + clone.__values__ = undefined; + if (result) { + previous.__wrapped__ = clone; + } else { + result = clone; + } + var previous = clone; + parent = parent.__wrapped__; + } + previous.__wrapped__ = value; + return result; + } + + /** + * This method is the wrapper version of `_.reverse`. + * + * **Note:** This method mutates the wrapped array. + * + * @name reverse + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2, 3]; + * + * _(array).reverse().value() + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function wrapperReverse() { + var value = this.__wrapped__; + if (value instanceof LazyWrapper) { + var wrapped = value; + if (this.__actions__.length) { + wrapped = new LazyWrapper(this); + } + wrapped = wrapped.reverse(); + wrapped.__actions__.push({ + 'func': thru, + 'args': [reverse], + 'thisArg': undefined + }); + return new LodashWrapper(wrapped, this.__chain__); + } + return this.thru(reverse); + } + + /** + * Executes the chain sequence to resolve the unwrapped value. + * + * @name value + * @memberOf _ + * @since 0.1.0 + * @alias toJSON, valueOf + * @category Seq + * @returns {*} Returns the resolved unwrapped value. + * @example + * + * _([1, 2, 3]).value(); + * // => [1, 2, 3] + */ + function wrapperValue() { + return baseWrapperValue(this.__wrapped__, this.__actions__); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the number of times the key was returned by `iteratee`. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': 1, '6': 2 } + * + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ + var countBy = createAggregator(function(result, value, key) { + hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1); + }); + + /** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false + */ + function every(collection, predicate, guard) { + var func = isArray(collection) ? arrayEvery : baseEvery; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + */ + function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to search. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ + function find(collection, predicate) { + predicate = getIteratee(predicate, 3); + if (isArray(collection)) { + var index = baseFindIndex(collection, predicate); + return index > -1 ? collection[index] : undefined; + } + return baseFind(collection, predicate, baseEach); + } + + /** + * This method is like `_.find` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to search. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(n) { + * return n % 2 == 1; + * }); + * // => 3 + */ + function findLast(collection, predicate) { + predicate = getIteratee(predicate, 3); + if (isArray(collection)) { + var index = baseFindIndex(collection, predicate, true); + return index > -1 ? collection[index] : undefined; + } + return baseFind(collection, predicate, baseEachRight); + } + + /** + * Creates a flattened array of values by running each element in `collection` + * thru `iteratee` and flattening the mapped results. The iteratee is invoked + * with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [n, n]; + * } + * + * _.flatMap([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMap(collection, iteratee) { + return baseFlatten(map(collection, iteratee), 1); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMapDeep(collection, iteratee) { + return baseFlatten(map(collection, iteratee), INFINITY); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] + */ + function flatMapDepth(collection, iteratee, depth) { + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(map(collection, iteratee), depth); + } + + /** + * Iterates over elements of `collection` invoking `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @example + * + * _([1, 2]).forEach(function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forEach(collection, iteratee) { + return (typeof iteratee == 'function' && isArray(collection)) + ? arrayEach(collection, iteratee) + : baseEach(collection, getIteratee(iteratee)); + } + + /** + * This method is like `_.forEach` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @alias eachRight + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @example + * + * _.forEachRight([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `2` then `1`. + */ + function forEachRight(collection, iteratee) { + return (typeof iteratee == 'function' && isArray(collection)) + ? arrayEachRight(collection, iteratee) + : baseEachRight(collection, getIteratee(iteratee)); + } + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': [4.2], '6': [6.1, 6.3] } + * + * // The `_.property` iteratee shorthand. + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ + var groupBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + result[key].push(value); + } else { + result[key] = [value]; + } + }); + + /** + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to search. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); + * // => true + * + * _.includes('pebbles', 'eb'); + * // => true + */ + function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; + + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); + } + + /** + * Invokes the method at `path` of each element in `collection`, returning + * an array of the results of each invoked method. Any additional arguments + * are provided to each invoked method. If `methodName` is a function, it's + * invoked for and `this` bound to, each element in `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|string} path The path of the method to invoke or + * the function invoked per iteration. + * @param {...*} [args] The arguments to invoke each method with. + * @returns {Array} Returns the array of results. + * @example + * + * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invokeMap([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ + var invokeMap = rest(function(collection, path, args) { + var index = -1, + isFunc = typeof path == 'function', + isProp = isKey(path), + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value) { + var func = isFunc ? path : ((isProp && value != null) ? value[path] : undefined); + result[++index] = func ? apply(func, value, args) : baseInvoke(value, path, args); + }); + return result; + }); + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the last element responsible for generating the key. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var array = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.keyBy(array, function(o) { + * return String.fromCharCode(o.code); + * }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.keyBy(array, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + */ + var keyBy = createAggregator(function(result, value, key) { + result[key] = value; + }); + + /** + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `take`, `takeRight`, `template`, + * `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ + function map(collection, iteratee) { + var func = isArray(collection) ? arrayMap : baseMap; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.sortBy` except that it allows specifying the sort + * orders of the iteratees to sort by. If `orders` is unspecified, all values + * are sorted in ascending order. Otherwise, specify an order of "desc" for + * descending or "asc" for ascending sort order of corresponding values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] + * The iteratees to sort by. + * @param {string[]} [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 36 } + * ]; + * + * // Sort by `user` in ascending order and by `age` in descending order. + * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ + function orderBy(collection, iteratees, orders, guard) { + if (collection == null) { + return []; + } + if (!isArray(iteratees)) { + iteratees = iteratees == null ? [] : [iteratees]; + } + orders = guard ? undefined : orders; + if (!isArray(orders)) { + orders = orders == null ? [] : [orders]; + } + return baseOrderBy(collection, iteratees, orders); + } + + /** + * Creates an array of elements split into two groups, the first of which + * contains elements `predicate` returns truthy for, the second of which + * contains elements `predicate` returns falsey for. The predicate is + * invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the array of grouped elements. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true }, + * { 'user': 'pebbles', 'age': 1, 'active': false } + * ]; + * + * _.partition(users, function(o) { return o.active; }); + * // => objects for [['fred'], ['barney', 'pebbles']] + * + * // The `_.matches` iteratee shorthand. + * _.partition(users, { 'age': 1, 'active': false }); + * // => objects for [['pebbles'], ['barney', 'fred']] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.partition(users, ['active', false]); + * // => objects for [['barney', 'pebbles'], ['fred']] + * + * // The `_.property` iteratee shorthand. + * _.partition(users, 'active'); + * // => objects for [['fred'], ['barney', 'pebbles']] + */ + var partition = createAggregator(function(result, value, key) { + result[key ? 0 : 1].push(value); + }, function() { return [[], []]; }); + + /** + * Reduces `collection` to a value which is the accumulated result of running + * each element in `collection` thru `iteratee`, where each successive + * invocation is supplied the return value of the previous. If `accumulator` + * is not given, the first element of `collection` is used as the initial + * value. The iteratee is invoked with four arguments: + * (accumulator, value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.reduce`, `_.reduceRight`, and `_.transform`. + * + * The guarded methods are: + * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, + * and `sortBy` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @example + * + * _.reduce([1, 2], function(sum, n) { + * return sum + n; + * }, 0); + * // => 3 + * + * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * return result; + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) + */ + function reduce(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduce : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); + } + + /** + * This method is like `_.reduce` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @example + * + * var array = [[0, 1], [2, 3], [4, 5]]; + * + * _.reduceRight(array, function(flattened, other) { + * return flattened.concat(other); + * }, []); + * // => [4, 5, 2, 3, 0, 1] + */ + function reduceRight(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduceRight : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); + } + + /** + * The opposite of `_.filter`; this method returns the elements of `collection` + * that `predicate` does **not** return truthy for. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true } + * ]; + * + * _.reject(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.reject(users, { 'age': 40, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.reject(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.reject(users, 'active'); + * // => objects for ['barney'] + */ + function reject(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + predicate = getIteratee(predicate, 3); + return func(collection, function(value, index, collection) { + return !predicate(value, index, collection); + }); + } + + /** + * Gets a random element from `collection`. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + * @example + * + * _.sample([1, 2, 3, 4]); + * // => 2 + */ + function sample(collection) { + var array = isArrayLike(collection) ? collection : values(collection), + length = array.length; + + return length > 0 ? array[baseRandom(0, length - 1)] : undefined; + } + + /** + * Gets `n` random elements at unique keys from `collection` up to the + * size of `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @param {number} [n=1] The number of elements to sample. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the random elements. + * @example + * + * _.sampleSize([1, 2, 3], 2); + * // => [3, 1] + * + * _.sampleSize([1, 2, 3], 4); + * // => [2, 3, 1] + */ + function sampleSize(collection, n, guard) { + var index = -1, + result = toArray(collection), + length = result.length, + lastIndex = length - 1; + + if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { + n = 1; + } else { + n = baseClamp(toInteger(n), 0, length); + } + while (++index < n) { + var rand = baseRandom(index, lastIndex), + value = result[rand]; + + result[rand] = result[index]; + result[index] = value; + } + result.length = n; + return result; + } + + /** + * Creates an array of shuffled values, using a version of the + * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + * @example + * + * _.shuffle([1, 2, 3, 4]); + * // => [4, 1, 3, 2] + */ + function shuffle(collection) { + return sampleSize(collection, MAX_ARRAY_LENGTH); + } + + /** + * Gets the size of `collection` by returning its length for array-like + * values or the number of own enumerable string keyed properties for objects. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @returns {number} Returns the collection size. + * @example + * + * _.size([1, 2, 3]); + * // => 3 + * + * _.size({ 'a': 1, 'b': 2 }); + * // => 2 + * + * _.size('pebbles'); + * // => 7 + */ + function size(collection) { + if (collection == null) { + return 0; + } + if (isArrayLike(collection)) { + var result = collection.length; + return (result && isString(collection)) ? stringSize(collection) : result; + } + if (isObjectLike(collection)) { + var tag = getTag(collection); + if (tag == mapTag || tag == setTag) { + return collection.size; + } + } + return keys(collection).length; + } + + /** + * Checks if `predicate` returns truthy for **any** element of `collection`. + * Iteration is stopped once `predicate` returns truthy. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.some(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.some(users, 'active'); + * // => true + */ + function some(collection, predicate, guard) { + var func = isArray(collection) ? arraySome : baseSome; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} + * [iteratees=[_.identity]] The iteratees to sort by, specified individually + * or in arrays. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, function(o) { return o.user; }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + * + * _.sortBy(users, 'user', function(o) { + * return Math.floor(o.age / 10); + * }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ + var sortBy = rest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees.length = 1; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @type {Function} + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred function to be invoked. + */ + var now = Date.now; + + /*------------------------------------------------------------------------*/ + + /** + * The opposite of `_.before`; this method creates a function that invokes + * `func` once it's called `n` or more times. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {number} n The number of calls before `func` is invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => Logs 'done saving!' after the two async saves have completed. + */ + function after(n, func) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; + } + + /** + * Creates a function that invokes `func`, with up to `n` arguments, + * ignoring any additional arguments. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @param {number} [n=func.length] The arity cap. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new function. + * @example + * + * _.map(['6', '8', '10'], _.ary(parseInt, 1)); + * // => [6, 8, 10] + */ + function ary(func, n, guard) { + n = guard ? undefined : n; + n = (func && n == null) ? func.length : n; + return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n); + } + + /** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => allows adding up to 4 contacts to the list + */ + function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; + } + + /** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind` this method doesn't set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var greet = function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * }; + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */ + var bind = rest(function(func, thisArg, partials) { + var bitmask = BIND_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getPlaceholder(bind)); + bitmask |= PARTIAL_FLAG; + } + return createWrapper(func, bitmask, thisArg, partials, holders); + }); + + /** + * Creates a function that invokes the method at `object[key]` with `partials` + * prepended to the arguments it receives. + * + * This method differs from `_.bind` by allowing bound functions to reference + * methods that may be redefined or don't yet exist. See + * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) + * for more details. + * + * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Function + * @param {Object} object The object to invoke the method on. + * @param {string} key The key of the method. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'user': 'fred', + * 'greet': function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * }; + * + * var bound = _.bindKey(object, 'greet', 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * object.greet = function(greeting, punctuation) { + * return greeting + 'ya ' + this.user + punctuation; + * }; + * + * bound('!'); + * // => 'hiya fred!' + * + * // Bound with placeholders. + * var bound = _.bindKey(object, 'greet', _, '!'); + * bound('hi'); + * // => 'hiya fred!' + */ + var bindKey = rest(function(object, key, partials) { + var bitmask = BIND_FLAG | BIND_KEY_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getPlaceholder(bindKey)); + bitmask |= PARTIAL_FLAG; + } + return createWrapper(key, bitmask, object, partials, holders); + }); + + /** + * Creates a function that accepts arguments of `func` and either invokes + * `func` returning its result, if at least `arity` number of arguments have + * been provided, or returns a function that accepts the remaining `func` + * arguments, and so on. The arity of `func` may be specified if `func.length` + * is not sufficient. + * + * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curry(abc); + * + * curried(1)(2)(3); + * // => [1, 2, 3] + * + * curried(1, 2)(3); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(1)(_, 3)(2); + * // => [1, 2, 3] + */ + function curry(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrapper(func, CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curry.placeholder; + return result; + } + + /** + * This method is like `_.curry` except that arguments are applied to `func` + * in the manner of `_.partialRight` instead of `_.partial`. + * + * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curryRight(abc); + * + * curried(3)(2)(1); + * // => [1, 2, 3] + * + * curried(2, 3)(1); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(3)(1, _)(2); + * // => [1, 2, 3] + */ + function curryRight(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrapper(func, CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curryRight.placeholder; + return result; + } + + /** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide an options object to indicate whether `func` should be invoked on + * the leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent calls + * to the debounced function return the result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked + * on the trailing edge of the timeout only if the debounced function is + * invoked more than once during the `wait` timeout. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ + function debounce(func, wait, options) { + var lastArgs, + lastThis, + result, + timerId, + lastCallTime = 0, + lastInvokeTime = 0, + leading = false, + maxWait = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxWait = 'maxWait' in options && nativeMax(toNumber(options.maxWait) || 0, wait); + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + result = wait - timeSinceLastCall; + + return maxWait === false ? result : nativeMin(result, maxWait - timeSinceLastInvoke); + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (!lastCallTime || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxWait !== false && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + clearTimeout(timerId); + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastCallTime = lastInvokeTime = 0; + lastArgs = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + // Handle invocations in a tight loop. + clearTimeout(timerId); + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; + } + + /** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one or more milliseconds. + */ + var defer = rest(function(func, args) { + return baseDelay(func, 1, args); + }); + + /** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. + */ + var delay = rest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); + }); + + /** + * Creates a function that invokes `func` with arguments reversed. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to flip arguments for. + * @returns {Function} Returns the new function. + * @example + * + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); + * + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] + */ + function flip(func) { + return createWrapper(func, FLIP_FLAG); + } + + /** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) + * method interface of `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoizing function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ + function memoize(func, resolver) { + if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result); + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; + } + + // Assign cache to `_.memoize`. + memoize.Cache = MapCache; + + /** + * Creates a function that negates the result of the predicate `func`. The + * `func` predicate is invoked with the `this` binding and arguments of the + * created function. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} predicate The predicate to negate. + * @returns {Function} Returns the new function. + * @example + * + * function isEven(n) { + * return n % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */ + function negate(predicate) { + if (typeof predicate != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + return !predicate.apply(this, arguments); + }; + } + + /** + * Creates a function that is restricted to invoking `func` once. Repeat calls + * to the function return the value of the first invocation. The `func` is + * invoked with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // `initialize` invokes `createApplication` once + */ + function once(func) { + return before(2, func); + } + + /** + * Creates a function that invokes `func` with arguments transformed by + * corresponding `transforms`. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Function + * @param {Function} func The function to wrap. + * @param {...(Function|Function[])} [transforms] The functions to transform. + * arguments, specified individually or in arrays. + * @returns {Function} Returns the new function. + * @example + * + * function doubled(n) { + * return n * 2; + * } + * + * function square(n) { + * return n * n; + * } + * + * var func = _.overArgs(function(x, y) { + * return [x, y]; + * }, square, doubled); + * + * func(9, 3); + * // => [81, 6] + * + * func(10, 5); + * // => [100, 10] + */ + var overArgs = rest(function(func, transforms) { + transforms = arrayMap(baseFlatten(transforms, 1, isFlattenableIteratee), getIteratee()); + var funcsLength = transforms.length; + return rest(function(args) { + var index = -1, + length = nativeMin(args.length, funcsLength); + + while (++index < length) { + args[index] = transforms[index].call(this, args[index]); + } + return apply(func, this, args); + }); + }); + + /** + * Creates a function that invokes `func` with `partials` prepended to the + * arguments it receives. This method is like `_.bind` except it does **not** + * alter the `this` binding. + * + * The `_.partial.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 0.2.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * var greet = function(greeting, name) { + * return greeting + ' ' + name; + * }; + * + * var sayHelloTo = _.partial(greet, 'hello'); + * sayHelloTo('fred'); + * // => 'hello fred' + * + * // Partially applied with placeholders. + * var greetFred = _.partial(greet, _, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + */ + var partial = rest(function(func, partials) { + var holders = replaceHolders(partials, getPlaceholder(partial)); + return createWrapper(func, PARTIAL_FLAG, undefined, partials, holders); + }); + + /** + * This method is like `_.partial` except that partially applied arguments + * are appended to the arguments it receives. + * + * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * var greet = function(greeting, name) { + * return greeting + ' ' + name; + * }; + * + * var greetFred = _.partialRight(greet, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + * + * // Partially applied with placeholders. + * var sayHelloTo = _.partialRight(greet, 'hello', _); + * sayHelloTo('fred'); + * // => 'hello fred' + */ + var partialRight = rest(function(func, partials) { + var holders = replaceHolders(partials, getPlaceholder(partialRight)); + return createWrapper(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders); + }); + + /** + * Creates a function that invokes `func` with arguments arranged according + * to the specified `indexes` where the argument value at the first index is + * provided as the first argument, the argument value at the second index is + * provided as the second argument, and so on. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to rearrange arguments for. + * @param {...(number|number[])} indexes The arranged argument indexes, + * specified individually or in arrays. + * @returns {Function} Returns the new function. + * @example + * + * var rearged = _.rearg(function(a, b, c) { + * return [a, b, c]; + * }, 2, 0, 1); + * + * rearged('b', 'c', 'a') + * // => ['a', 'b', 'c'] + */ + var rearg = rest(function(func, indexes) { + return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes, 1)); + }); + + /** + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as + * an array. + * + * **Note:** This method is based on the + * [rest parameter](https://mdn.io/rest_parameters). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.rest(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); + * + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' + */ + function rest(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + switch (start) { + case 0: return func.call(this, array); + case 1: return func.call(this, args[0], array); + case 2: return func.call(this, args[0], args[1], array); + } + var otherArgs = Array(start + 1); + index = -1; + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = array; + return apply(func, this, otherArgs); + }; + } + + /** + * Creates a function that invokes `func` with the `this` binding of the + * create function and an array of arguments much like + * [`Function#apply`](http://www.ecma-international.org/ecma-262/6.0/#sec-function.prototype.apply). + * + * **Note:** This method is based on the + * [spread operator](https://mdn.io/spread_operator). + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Function + * @param {Function} func The function to spread arguments over. + * @param {number} [start=0] The start position of the spread. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.spread(function(who, what) { + * return who + ' says ' + what; + * }); + * + * say(['fred', 'hello']); + * // => 'fred says hello' + * + * var numbers = Promise.all([ + * Promise.resolve(40), + * Promise.resolve(36) + * ]); + * + * numbers.then(_.spread(function(x, y) { + * return x + y; + * })); + * // => a Promise of 76 + */ + function spread(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start === undefined ? 0 : nativeMax(toInteger(start), 0); + return rest(function(args) { + var array = args[start], + otherArgs = args.slice(0, start); + + if (array) { + arrayPush(otherArgs, array); + } + return apply(func, this, otherArgs); + }); + } + + /** + * Creates a throttled function that only invokes `func` at most once per + * every `wait` milliseconds. The throttled function comes with a `cancel` + * method to cancel delayed `func` invocations and a `flush` method to + * immediately invoke them. Provide an options object to indicate whether + * `func` should be invoked on the leading and/or trailing edge of the `wait` + * timeout. The `func` is invoked with the last arguments provided to the + * throttled function. Subsequent calls to the throttled function return the + * result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the throttled function + * is invoked more than once during the `wait` timeout. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.throttle` and `_.debounce`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to throttle. + * @param {number} [wait=0] The number of milliseconds to throttle invocations to. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=true] + * Specify invoking on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // Avoid excessively updating the position while scrolling. + * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); + * + * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. + * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); + * jQuery(element).on('click', throttled); + * + * // Cancel the trailing throttled invocation. + * jQuery(window).on('popstate', throttled.cancel); + */ + function throttle(func, wait, options) { + var leading = true, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (isObject(options)) { + leading = 'leading' in options ? !!options.leading : leading; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + return debounce(func, wait, { + 'leading': leading, + 'maxWait': wait, + 'trailing': trailing + }); + } + + /** + * Creates a function that accepts up to one argument, ignoring any + * additional arguments. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new function. + * @example + * + * _.map(['6', '8', '10'], _.unary(parseInt)); + * // => [6, 8, 10] + */ + function unary(func) { + return ary(func, 1); + } + + /** + * Creates a function that provides `value` to the wrapper function as its + * first argument. Any additional arguments provided to the function are + * appended to those provided to the wrapper function. The wrapper is invoked + * with the `this` binding of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {*} value The value to wrap. + * @param {Function} [wrapper=identity] The wrapper function. + * @returns {Function} Returns the new function. + * @example + * + * var p = _.wrap(_.escape, function(func, text) { + * return '

      ' + func(text) + '

      '; + * }); + * + * p('fred, barney, & pebbles'); + * // => '

      fred, barney, & pebbles

      ' + */ + function wrap(value, wrapper) { + wrapper = wrapper == null ? identity : wrapper; + return partial(wrapper, value); + } + + /*------------------------------------------------------------------------*/ + + /** + * Casts `value` as an array if it's not one. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Lang + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast array. + * @example + * + * _.castArray(1); + * // => [1] + * + * _.castArray({ 'a': 1 }); + * // => [{ 'a': 1 }] + * + * _.castArray('abc'); + * // => ['abc'] + * + * _.castArray(null); + * // => [null] + * + * _.castArray(undefined); + * // => [undefined] + * + * _.castArray(); + * // => [] + * + * var array = [1, 2, 3]; + * console.log(_.castArray(array) === array); + * // => true + */ + function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray(value) ? value : [value]; + } + + /** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ + function clone(value) { + return baseClone(value, false, true); + } + + /** + * This method is like `_.clone` except that it accepts `customizer` which + * is invoked to produce the cloned value. If `customizer` returns `undefined`, + * cloning is handled by the method instead. The `customizer` is invoked with + * up to four arguments; (value [, index|key, object, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the cloned value. + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(false); + * } + * } + * + * var el = _.cloneWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 0 + */ + function cloneWith(value, customizer) { + return baseClone(value, false, true, customizer); + } + + /** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ + function cloneDeep(value) { + return baseClone(value, true, true); + } + + /** + * This method is like `_.cloneWith` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the deep cloned value. + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(true); + * } + * } + * + * var el = _.cloneDeepWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 20 + */ + function cloneDeepWith(value, customizer) { + return baseClone(value, true, true, customizer); + } + + /** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'user': 'fred' }; + * var other = { 'user': 'fred' }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + function eq(value, other) { + return value === other || (value !== value && other !== other); + } + + /** + * Checks if `value` is greater than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + * @example + * + * _.gt(3, 1); + * // => true + * + * _.gt(3, 3); + * // => false + * + * _.gt(1, 3); + * // => false + */ + function gt(value, other) { + return value > other; + } + + /** + * Checks if `value` is greater than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than or equal to + * `other`, else `false`. + * @example + * + * _.gte(3, 1); + * // => true + * + * _.gte(3, 3); + * // => true + * + * _.gte(1, 3); + * // => false + */ + function gte(value, other) { + return value >= other; + } + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + function isArguments(value) { + // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); + } + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @type {Function} + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + /** + * Checks if `value` is classified as an `ArrayBuffer` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isArrayBuffer(new ArrayBuffer(2)); + * // => true + * + * _.isArrayBuffer(new Array(2)); + * // => false + */ + function isArrayBuffer(value) { + return isObjectLike(value) && objectToString.call(value) == arrayBufferTag; + } + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(getLength(value)) && !isFunction(value); + } + + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + + /** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && objectToString.call(value) == boolTag); + } + + /** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ + var isBuffer = !Buffer ? constant(false) : function(value) { + return value instanceof Buffer; + }; + + /** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ + function isDate(value) { + return isObjectLike(value) && objectToString.call(value) == dateTag; + } + + /** + * Checks if `value` is likely a DOM element. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a DOM element, + * else `false`. + * @example + * + * _.isElement(document.body); + * // => true + * + * _.isElement(''); + * // => false + */ + function isElement(value) { + return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value); + } + + /** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ + function isEmpty(value) { + if (isArrayLike(value) && + (isArray(value) || isString(value) || isFunction(value.splice) || + isArguments(value) || isBuffer(value))) { + return !value.length; + } + if (isObjectLike(value)) { + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return !(nonEnumShadows && keys(value).length); + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are **not** supported. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, + * else `false`. + * @example + * + * var object = { 'user': 'fred' }; + * var other = { 'user': 'fred' }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ + function isEqual(value, other) { + return baseIsEqual(value, other); + } + + /** + * This method is like `_.isEqual` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with up to + * six arguments: (objValue, othValue [, index|key, object, other, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if the values are equivalent, + * else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, othValue) { + * if (isGreeting(objValue) && isGreeting(othValue)) { + * return true; + * } + * } + * + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqualWith(array, other, customizer); + * // => true + */ + function isEqualWith(value, other, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + var result = customizer ? customizer(value, other) : undefined; + return result === undefined ? baseIsEqual(value, other, customizer) : !!result; + } + + /** + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, + * else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false + */ + function isError(value) { + if (!isObjectLike(value)) { + return false; + } + return (objectToString.call(value) == errorTag) || + (typeof value.message == 'string' && typeof value.name == 'string'); + } + + /** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, + * else `false`. + * @example + * + * _.isFinite(3); + * // => true + * + * _.isFinite(Number.MAX_VALUE); + * // => true + * + * _.isFinite(3.14); + * // => true + * + * _.isFinite(Infinity); + * // => false + */ + function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array and weak map constructors, + // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; + } + + /** + * Checks if `value` is an integer. + * + * **Note:** This method is based on + * [`Number.isInteger`](https://mdn.io/Number/isInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an integer, else `false`. + * @example + * + * _.isInteger(3); + * // => true + * + * _.isInteger(Number.MIN_VALUE); + * // => false + * + * _.isInteger(Infinity); + * // => false + * + * _.isInteger('3'); + * // => false + */ + function isInteger(value) { + return typeof value == 'number' && value == toInteger(value); + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, + * else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } + + /** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */ + function isMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; + } + + /** + * Performs a partial deep comparison between `object` and `source` to + * determine if `object` contains equivalent property values. This method is + * equivalent to a `_.matches` function when `source` is partially applied. + * + * **Note:** This method supports comparing the same values as `_.isEqual`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * var object = { 'user': 'fred', 'age': 40 }; + * + * _.isMatch(object, { 'age': 40 }); + * // => true + * + * _.isMatch(object, { 'age': 36 }); + * // => false + */ + function isMatch(object, source) { + return object === source || baseIsMatch(object, source, getMatchData(source)); + } + + /** + * This method is like `_.isMatch` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with five + * arguments: (objValue, srcValue, index|key, object, source). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, srcValue) { + * if (isGreeting(objValue) && isGreeting(srcValue)) { + * return true; + * } + * } + * + * var object = { 'greeting': 'hello' }; + * var source = { 'greeting': 'hi' }; + * + * _.isMatchWith(object, source, customizer); + * // => true + */ + function isMatchWith(object, source, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseIsMatch(object, source, getMatchData(source), customizer); + } + + /** + * Checks if `value` is `NaN`. + * + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ + function isNative(value) { + if (!isObject(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is `null` or `undefined`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is nullish, else `false`. + * @example + * + * _.isNil(null); + * // => true + * + * _.isNil(void 0); + * // => true + * + * _.isNil(NaN); + * // => false + */ + function isNil(value) { + return value == null; + } + + /** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ + function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && objectToString.call(value) == numberTag); + } + + /** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, + * else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ + function isPlainObject(value) { + if (!isObjectLike(value) || + objectToString.call(value) != objectTag || isHostObject(value)) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return (typeof Ctor == 'function' && + Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString); + } + + /** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ + function isRegExp(value) { + return isObject(value) && objectToString.call(value) == regexpTag; + } + + /** + * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 + * double precision number which isn't the result of a rounded unsafe integer. + * + * **Note:** This method is based on + * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a safe integer, + * else `false`. + * @example + * + * _.isSafeInteger(3); + * // => true + * + * _.isSafeInteger(Number.MIN_VALUE); + * // => false + * + * _.isSafeInteger(Infinity); + * // => false + * + * _.isSafeInteger('3'); + * // => false + */ + function isSafeInteger(value) { + return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */ + function isSet(value) { + return isObjectLike(value) && getTag(value) == setTag; + } + + /** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ + function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag); + } + + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); + } + + /** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ + function isTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; + } + + /** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ + function isUndefined(value) { + return value === undefined; + } + + /** + * Checks if `value` is classified as a `WeakMap` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isWeakMap(new WeakMap); + * // => true + * + * _.isWeakMap(new Map); + * // => false + */ + function isWeakMap(value) { + return isObjectLike(value) && getTag(value) == weakMapTag; + } + + /** + * Checks if `value` is classified as a `WeakSet` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isWeakSet(new WeakSet); + * // => true + * + * _.isWeakSet(new Set); + * // => false + */ + function isWeakSet(value) { + return isObjectLike(value) && objectToString.call(value) == weakSetTag; + } + + /** + * Checks if `value` is less than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + * @example + * + * _.lt(1, 3); + * // => true + * + * _.lt(3, 3); + * // => false + * + * _.lt(3, 1); + * // => false + */ + function lt(value, other) { + return value < other; + } + + /** + * Checks if `value` is less than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than or equal to + * `other`, else `false`. + * @example + * + * _.lte(1, 3); + * // => true + * + * _.lte(3, 3); + * // => true + * + * _.lte(3, 1); + * // => false + */ + function lte(value, other) { + return value <= other; + } + + /** + * Converts `value` to an array. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {Array} Returns the converted array. + * @example + * + * _.toArray({ 'a': 1, 'b': 2 }); + * // => [1, 2] + * + * _.toArray('abc'); + * // => ['a', 'b', 'c'] + * + * _.toArray(1); + * // => [] + * + * _.toArray(null); + * // => [] + */ + function toArray(value) { + if (!value) { + return []; + } + if (isArrayLike(value)) { + return isString(value) ? stringToArray(value) : copyArray(value); + } + if (iteratorSymbol && value[iteratorSymbol]) { + return iteratorToArray(value[iteratorSymbol]()); + } + var tag = getTag(value), + func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); + + return func(value); + } + + /** + * Converts `value` to an integer. + * + * **Note:** This function is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3'); + * // => 3 + */ + function toInteger(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + var remainder = value % 1; + return value === value ? (remainder ? value - remainder : value) : 0; + } + + /** + * Converts `value` to an integer suitable for use as the length of an + * array-like object. + * + * **Note:** This method is based on + * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toLength(3); + * // => 3 + * + * _.toLength(Number.MIN_VALUE); + * // => 0 + * + * _.toLength(Infinity); + * // => 4294967295 + * + * _.toLength('3'); + * // => 3 + */ + function toLength(value) { + return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; + } + + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3); + * // => 3 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3'); + * // => 3 + */ + function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = isFunction(value.valueOf) ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); + } + + /** + * Converts `value` to a plain object flattening inherited enumerable string + * keyed properties of `value` to own properties of the plain object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {Object} Returns the converted plain object. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.assign({ 'a': 1 }, new Foo); + * // => { 'a': 1, 'b': 2 } + * + * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); + * // => { 'a': 1, 'b': 2, 'c': 3 } + */ + function toPlainObject(value) { + return copyObject(value, keysIn(value)); + } + + /** + * Converts `value` to a safe integer. A safe integer can be compared and + * represented correctly. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toSafeInteger(3); + * // => 3 + * + * _.toSafeInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toSafeInteger(Infinity); + * // => 9007199254740991 + * + * _.toSafeInteger('3'); + * // => 3 + */ + function toSafeInteger(value) { + return baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER); + } + + /** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (value == null) { + return ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /*------------------------------------------------------------------------*/ + + /** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.c = 3; + * } + * + * function Bar() { + * this.e = 5; + * } + * + * Foo.prototype.d = 4; + * Bar.prototype.f = 6; + * + * _.assign({ 'a': 1 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3, 'e': 5 } + */ + var assign = createAssigner(function(object, source) { + if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } + }); + + /** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * function Bar() { + * this.d = 4; + * } + * + * Foo.prototype.c = 3; + * Bar.prototype.e = 5; + * + * _.assignIn({ 'a': 1 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } + */ + var assignIn = createAssigner(function(object, source) { + if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) { + copyObject(source, keysIn(source), object); + return; + } + for (var key in source) { + assignValue(object, key, source[key]); + } + }); + + /** + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extendWith + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObjectWith(source, keysIn(source), object, customizer); + }); + + /** + * This method is like `_.assign` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObjectWith(source, keys(source), object, customizer); + }); + + /** + * Creates an array of values corresponding to `paths` of `object`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {...(string|string[])} [paths] The property paths of elements to pick, + * specified individually or in arrays. + * @returns {Array} Returns the new array of picked elements. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _.at(object, ['a[0].b.c', 'a[1]']); + * // => [3, 4] + * + * _.at(['a', 'b', 'c'], 0, 2); + * // => ['a', 'c'] + */ + var at = rest(function(object, paths) { + return baseAt(object, baseFlatten(paths, 1)); + }); + + /** + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ + function create(prototype, properties) { + var result = baseCreate(prototype); + return properties ? baseAssign(result, properties) : result; + } + + /** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); + * // => { 'user': 'barney', 'age': 36 } + */ + var defaults = rest(function(args) { + args.push(undefined, assignInDefaults); + return apply(assignInWith, undefined, args); + }); + + /** + * This method is like `_.defaults` except that it recursively assigns + * default properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } }); + * // => { 'user': { 'name': 'barney', 'age': 36 } } + * + */ + var defaultsDeep = rest(function(args) { + args.push(undefined, mergeDefaults); + return apply(mergeWith, undefined, args); + }); + + /** + * This method is like `_.find` except that it returns the key of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Object + * @param {Object} object The object to search. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findKey(users, function(o) { return o.age < 40; }); + * // => 'barney' (iteration order is not guaranteed) + * + * // The `_.matches` iteratee shorthand. + * _.findKey(users, { 'age': 1, 'active': true }); + * // => 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findKey(users, 'active'); + * // => 'barney' + */ + function findKey(object, predicate) { + return baseFind(object, getIteratee(predicate, 3), baseForOwn, true); + } + + /** + * This method is like `_.findKey` except that it iterates over elements of + * a collection in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to search. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findLastKey(users, function(o) { return o.age < 40; }); + * // => returns 'pebbles' assuming `_.findKey` returns 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.findLastKey(users, { 'age': 36, 'active': true }); + * // => 'barney' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findLastKey(users, 'active'); + * // => 'pebbles' + */ + function findLastKey(object, predicate) { + return baseFind(object, getIteratee(predicate, 3), baseForOwnRight, true); + } + + /** + * Iterates over own and inherited enumerable string keyed properties of an + * object invoking `iteratee` for each property. The iteratee is invoked with + * three arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forIn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). + */ + function forIn(object, iteratee) { + return object == null + ? object + : baseFor(object, getIteratee(iteratee), keysIn); + } + + /** + * This method is like `_.forIn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forInRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. + */ + function forInRight(object, iteratee) { + return object == null + ? object + : baseForRight(object, getIteratee(iteratee), keysIn); + } + + /** + * Iterates over own enumerable string keyed properties of an object invoking + * `iteratee` for each property. The iteratee is invoked with three arguments: + * (value, key, object). Iteratee functions may exit iteration early by + * explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forOwn(object, iteratee) { + return object && baseForOwn(object, getIteratee(iteratee)); + } + + /** + * This method is like `_.forOwn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwnRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. + */ + function forOwnRight(object, iteratee) { + return object && baseForOwnRight(object, getIteratee(iteratee)); + } + + /** + * Creates an array of function property names from own enumerable properties + * of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the new array of property names. + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functions(new Foo); + * // => ['a', 'b'] + */ + function functions(object) { + return object == null ? [] : baseFunctions(object, keys(object)); + } + + /** + * Creates an array of function property names from own and inherited + * enumerable properties of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the new array of property names. + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functionsIn(new Foo); + * // => ['a', 'b', 'c'] + */ + function functionsIn(object) { + return object == null ? [] : baseFunctions(object, keysIn(object)); + } + + /** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is used in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ + function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; + } + + /** + * Checks if `path` is a direct property of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b'); + * // => true + * + * _.has(object, ['a', 'b']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ + function has(object, path) { + return object != null && hasPath(object, path, baseHas); + } + + /** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ + function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); + } + + /** + * Creates an object composed of the inverted keys and values of `object`. + * If `object` contains duplicate values, subsequent values overwrite + * property assignments of previous values. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Object + * @param {Object} object The object to invert. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invert(object); + * // => { '1': 'c', '2': 'b' } + */ + var invert = createInverter(function(result, value, key) { + result[value] = key; + }, constant(identity)); + + /** + * This method is like `_.invert` except that the inverted object is generated + * from the results of running each element of `object` thru `iteratee`. The + * corresponding inverted value of each inverted key is an array of keys + * responsible for generating the inverted value. The iteratee is invoked + * with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Object + * @param {Object} object The object to invert. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invertBy(object); + * // => { '1': ['a', 'c'], '2': ['b'] } + * + * _.invertBy(object, function(value) { + * return 'group' + value; + * }); + * // => { 'group1': ['a', 'c'], 'group2': ['b'] } + */ + var invertBy = createInverter(function(result, value, key) { + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } + }, getIteratee); + + /** + * Invokes the method at `path` of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + * @example + * + * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; + * + * _.invoke(object, 'a[0].b.c.slice', 1, 3); + * // => [2, 3] + */ + var invoke = rest(baseInvoke); + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + function keys(object) { + var isProto = isPrototype(object); + if (!(isProto || isArrayLike(object))) { + return baseKeys(object); + } + var indexes = indexKeys(object), + skipIndexes = !!indexes, + result = indexes || [], + length = result.length; + + for (var key in object) { + if (baseHas(object, key) && + !(skipIndexes && (key == 'length' || isIndex(key, length))) && + !(isProto && key == 'constructor')) { + result.push(key); + } + } + return result; + } + + /** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ + function keysIn(object) { + var index = -1, + isProto = isPrototype(object), + props = baseKeysIn(object), + propsLength = props.length, + indexes = indexKeys(object), + skipIndexes = !!indexes, + result = indexes || [], + length = result.length; + + while (++index < propsLength) { + var key = props[index]; + if (!(skipIndexes && (key == 'length' || isIndex(key, length))) && + !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; + } + + /** + * The opposite of `_.mapValues`; this method creates an object with the + * same values as `object` and keys generated by running each own enumerable + * string keyed property of `object` thru `iteratee`. The iteratee is invoked + * with three arguments: (value, key, object). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @example + * + * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { + * return key + value; + * }); + * // => { 'a1': 1, 'b2': 2 } + */ + function mapKeys(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + result[iteratee(value, key, object)] = value; + }); + return result; + } + + /** + * Creates an object with the same keys as `object` and values generated + * by running each own enumerable string keyed property of `object` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, key, object). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @example + * + * var users = { + * 'fred': { 'user': 'fred', 'age': 40 }, + * 'pebbles': { 'user': 'pebbles', 'age': 1 } + * }; + * + * _.mapValues(users, function(o) { return o.age; }); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + * + * // The `_.property` iteratee shorthand. + * _.mapValues(users, 'age'); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + */ + function mapValues(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + result[key] = iteratee(value, key, object); + }); + return result; + } + + /** + * This method is like `_.assign` except that it recursively merges own and + * inherited enumerable string keyed properties of source objects into the + * destination object. Source properties that resolve to `undefined` are + * skipped if a destination value exists. Array and plain object properties + * are merged recursively.Other objects and value types are overridden by + * assignment. Source objects are applied from left to right. Subsequent + * sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * var users = { + * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] + * }; + * + * var ages = { + * 'data': [{ 'age': 36 }, { 'age': 40 }] + * }; + * + * _.merge(users, ages); + * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } + */ + var merge = createAssigner(function(object, source, srcIndex) { + baseMerge(object, source, srcIndex); + }); + + /** + * This method is like `_.merge` except that it accepts `customizer` which + * is invoked to produce the merged values of the destination and source + * properties. If `customizer` returns `undefined`, merging is handled by the + * method instead. The `customizer` is invoked with seven arguments: + * (objValue, srcValue, key, object, source, stack). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} customizer The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * if (_.isArray(objValue)) { + * return objValue.concat(srcValue); + * } + * } + * + * var object = { + * 'fruits': ['apple'], + * 'vegetables': ['beet'] + * }; + * + * var other = { + * 'fruits': ['banana'], + * 'vegetables': ['carrot'] + * }; + * + * _.mergeWith(object, other, customizer); + * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } + */ + var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { + baseMerge(object, source, srcIndex, customizer); + }); + + /** + * The opposite of `_.pick`; this method creates an object composed of the + * own and inherited enumerable string keyed properties of `object` that are + * not omitted. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [props] The property identifiers to omit, + * specified individually or in arrays. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omit(object, ['a', 'c']); + * // => { 'b': '2' } + */ + var omit = rest(function(object, props) { + if (object == null) { + return {}; + } + props = arrayMap(baseFlatten(props, 1), baseCastKey); + return basePick(object, baseDifference(getAllKeysIn(object), props)); + }); + + /** + * The opposite of `_.pickBy`; this method creates an object composed of + * the own and inherited enumerable string keyed properties of `object` that + * `predicate` doesn't return truthy for. The predicate is invoked with two + * arguments: (value, key). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omitBy(object, _.isNumber); + * // => { 'b': '2' } + */ + function omitBy(object, predicate) { + predicate = getIteratee(predicate); + return basePickBy(object, function(value, key) { + return !predicate(value, key); + }); + } + + /** + * Creates an object composed of the picked `object` properties. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [props] The property identifiers to pick, + * specified individually or in arrays. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ + var pick = rest(function(object, props) { + return object == null ? {} : basePick(object, baseFlatten(props, 1)); + }); + + /** + * Creates an object composed of the `object` properties `predicate` returns + * truthy for. The predicate is invoked with two arguments: (value, key). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pickBy(object, _.isNumber); + * // => { 'a': 1, 'c': 3 } + */ + function pickBy(object, predicate) { + return object == null ? {} : basePickBy(object, getIteratee(predicate)); + } + + /** + * This method is like `_.get` except that if the resolved value is a + * function it's invoked with the `this` binding of its parent object and + * its result is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to resolve. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; + * + * _.result(object, 'a[0].b.c1'); + * // => 3 + * + * _.result(object, 'a[0].b.c2'); + * // => 4 + * + * _.result(object, 'a[0].b.c3', 'default'); + * // => 'default' + * + * _.result(object, 'a[0].b.c3', _.constant('default')); + * // => 'default' + */ + function result(object, path, defaultValue) { + path = isKey(path, object) ? [path] : baseCastPath(path); + + var index = -1, + length = path.length; + + // Ensure the loop is entered when path is empty. + if (!length) { + object = undefined; + length = 1; + } + while (++index < length) { + var value = object == null ? undefined : object[path[index]]; + if (value === undefined) { + index = length; + value = defaultValue; + } + object = isFunction(value) ? value.call(object) : value; + } + return object; + } + + /** + * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, + * it's created. Arrays are created for missing index properties while objects + * are created for all other missing properties. Use `_.setWith` to customize + * `path` creation. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.set(object, 'a[0].b.c', 4); + * console.log(object.a[0].b.c); + * // => 4 + * + * _.set(object, ['x', '0', 'y', 'z'], 5); + * console.log(object.x[0].y.z); + * // => 5 + */ + function set(object, path, value) { + return object == null ? object : baseSet(object, path, value); + } + + /** + * This method is like `_.set` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.setWith(object, '[0][1]', 'a', Object); + * // => { '0': { '1': 'a' } } + */ + function setWith(object, path, value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseSet(object, path, value, customizer); + } + + /** + * Creates an array of own enumerable string keyed-value pairs for `object` + * which can be consumed by `_.fromPairs`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entries + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the new array of key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairs(new Foo); + * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) + */ + function toPairs(object) { + return baseToPairs(object, keys(object)); + } + + /** + * Creates an array of own and inherited enumerable string keyed-value pairs + * for `object` which can be consumed by `_.fromPairs`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entriesIn + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the new array of key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairsIn(new Foo); + * // => [['a', 1], ['b', 2], ['c', 1]] (iteration order is not guaranteed) + */ + function toPairsIn(object) { + return baseToPairs(object, keysIn(object)); + } + + /** + * An alternative to `_.reduce`; this method transforms `object` to a new + * `accumulator` object which is the result of running each of its own + * enumerable string keyed properties thru `iteratee`, with each invocation + * potentially mutating the `accumulator` object. The iteratee is invoked + * with four arguments: (accumulator, value, key, object). Iteratee functions + * may exit iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Object + * @param {Array|Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The custom accumulator value. + * @returns {*} Returns the accumulated value. + * @example + * + * _.transform([2, 3, 4], function(result, n) { + * result.push(n *= n); + * return n % 2 == 0; + * }, []); + * // => [4, 9] + * + * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } + */ + function transform(object, iteratee, accumulator) { + var isArr = isArray(object) || isTypedArray(object); + iteratee = getIteratee(iteratee, 4); + + if (accumulator == null) { + if (isArr || isObject(object)) { + var Ctor = object.constructor; + if (isArr) { + accumulator = isArray(object) ? new Ctor : []; + } else { + accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; + } + } else { + accumulator = {}; + } + } + (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) { + return iteratee(accumulator, value, index, object); + }); + return accumulator; + } + + /** + * Removes the property at `path` of `object`. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 7 } }] }; + * _.unset(object, 'a[0].b.c'); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + * + * _.unset(object, ['a', '0', 'b', 'c']); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + */ + function unset(object, path) { + return object == null ? true : baseUnset(object, path); + } + + /** + * This method is like `_.set` except that accepts `updater` to produce the + * value to set. Use `_.updateWith` to customize `path` creation. The `updater` + * is invoked with one argument: (value). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.update(object, 'a[0].b.c', function(n) { return n * n; }); + * console.log(object.a[0].b.c); + * // => 9 + * + * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); + * console.log(object.x[0].y.z); + * // => 0 + */ + function update(object, path, updater) { + return object == null ? object : baseUpdate(object, path, baseCastFunction(updater)); + } + + /** + * This method is like `_.update` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.updateWith(object, '[0][1]', _.constant('a'), Object); + * // => { '0': { '1': 'a' } } + */ + function updateWith(object, path, updater, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseUpdate(object, path, baseCastFunction(updater), customizer); + } + + /** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */ + function values(object) { + return object ? baseValues(object, keys(object)) : []; + } + + /** + * Creates an array of the own and inherited enumerable string keyed property + * values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.valuesIn(new Foo); + * // => [1, 2, 3] (iteration order is not guaranteed) + */ + function valuesIn(object) { + return object == null ? [] : baseValues(object, keysIn(object)); + } + + /*------------------------------------------------------------------------*/ + + /** + * Clamps `number` within the inclusive `lower` and `upper` bounds. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Number + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + * @example + * + * _.clamp(-10, -5, 5); + * // => -5 + * + * _.clamp(10, -5, 5); + * // => 5 + */ + function clamp(number, lower, upper) { + if (upper === undefined) { + upper = lower; + lower = undefined; + } + if (upper !== undefined) { + upper = toNumber(upper); + upper = upper === upper ? upper : 0; + } + if (lower !== undefined) { + lower = toNumber(lower); + lower = lower === lower ? lower : 0; + } + return baseClamp(toNumber(number), lower, upper); + } + + /** + * Checks if `n` is between `start` and up to but not including, `end`. If + * `end` is not specified, it's set to `start` with `start` then set to `0`. + * If `start` is greater than `end` the params are swapped to support + * negative ranges. + * + * @static + * @memberOf _ + * @since 3.3.0 + * @category Number + * @param {number} number The number to check. + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + * @example + * + * _.inRange(3, 2, 4); + * // => true + * + * _.inRange(4, 8); + * // => true + * + * _.inRange(4, 2); + * // => false + * + * _.inRange(2, 2); + * // => false + * + * _.inRange(1.2, 2); + * // => true + * + * _.inRange(5.2, 4); + * // => false + * + * _.inRange(-3, -2, -6); + * // => true + */ + function inRange(number, start, end) { + start = toNumber(start) || 0; + if (end === undefined) { + end = start; + start = 0; + } else { + end = toNumber(end) || 0; + } + number = toNumber(number); + return baseInRange(number, start, end); + } + + /** + * Produces a random number between the inclusive `lower` and `upper` bounds. + * If only one argument is provided a number between `0` and the given number + * is returned. If `floating` is `true`, or either `lower` or `upper` are + * floats, a floating-point number is returned instead of an integer. + * + * **Note:** JavaScript follows the IEEE-754 standard for resolving + * floating-point values which can produce unexpected results. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Number + * @param {number} [lower=0] The lower bound. + * @param {number} [upper=1] The upper bound. + * @param {boolean} [floating] Specify returning a floating-point number. + * @returns {number} Returns the random number. + * @example + * + * _.random(0, 5); + * // => an integer between 0 and 5 + * + * _.random(5); + * // => also an integer between 0 and 5 + * + * _.random(5, true); + * // => a floating-point number between 0 and 5 + * + * _.random(1.2, 5.2); + * // => a floating-point number between 1.2 and 5.2 + */ + function random(lower, upper, floating) { + if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { + upper = floating = undefined; + } + if (floating === undefined) { + if (typeof upper == 'boolean') { + floating = upper; + upper = undefined; + } + else if (typeof lower == 'boolean') { + floating = lower; + lower = undefined; + } + } + if (lower === undefined && upper === undefined) { + lower = 0; + upper = 1; + } + else { + lower = toNumber(lower) || 0; + if (upper === undefined) { + upper = lower; + lower = 0; + } else { + upper = toNumber(upper) || 0; + } + } + if (lower > upper) { + var temp = lower; + lower = upper; + upper = temp; + } + if (floating || lower % 1 || upper % 1) { + var rand = nativeRandom(); + return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); + } + return baseRandom(lower, upper); + } + + /*------------------------------------------------------------------------*/ + + /** + * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the camel cased string. + * @example + * + * _.camelCase('Foo Bar'); + * // => 'fooBar' + * + * _.camelCase('--foo-bar--'); + * // => 'fooBar' + * + * _.camelCase('__FOO_BAR__'); + * // => 'fooBar' + */ + var camelCase = createCompounder(function(result, word, index) { + word = word.toLowerCase(); + return result + (index ? capitalize(word) : word); + }); + + /** + * Converts the first character of `string` to upper case and the remaining + * to lower case. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to capitalize. + * @returns {string} Returns the capitalized string. + * @example + * + * _.capitalize('FRED'); + * // => 'Fred' + */ + function capitalize(string) { + return upperFirst(toString(string).toLowerCase()); + } + + /** + * Deburrs `string` by converting + * [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * to basic latin letters and removing + * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. + * @example + * + * _.deburr('déjà vu'); + * // => 'deja vu' + */ + function deburr(string) { + string = toString(string); + return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, ''); + } + + /** + * Checks if `string` ends with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to search. + * @param {string} [target] The string to search for. + * @param {number} [position=string.length] The position to search from. + * @returns {boolean} Returns `true` if `string` ends with `target`, + * else `false`. + * @example + * + * _.endsWith('abc', 'c'); + * // => true + * + * _.endsWith('abc', 'b'); + * // => false + * + * _.endsWith('abc', 'b', 2); + * // => true + */ + function endsWith(string, target, position) { + string = toString(string); + target = typeof target == 'string' ? target : (target + ''); + + var length = string.length; + position = position === undefined + ? length + : baseClamp(toInteger(position), 0, length); + + position -= target.length; + return position >= 0 && string.indexOf(target, position) == position; + } + + /** + * Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to + * their corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * Backticks are escaped because in IE < 9, they can break out of + * attribute values or HTML comments. See [#59](https://html5sec.org/#59), + * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and + * [#133](https://html5sec.org/#133) of the + * [HTML5 Security Cheatsheet](https://html5sec.org/) for more details. + * + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ + function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; + } + + /** + * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", + * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ + function escapeRegExp(string) { + string = toString(string); + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') + : string; + } + + /** + * Converts `string` to + * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the kebab cased string. + * @example + * + * _.kebabCase('Foo Bar'); + * // => 'foo-bar' + * + * _.kebabCase('fooBar'); + * // => 'foo-bar' + * + * _.kebabCase('__FOO_BAR__'); + * // => 'foo-bar' + */ + var kebabCase = createCompounder(function(result, word, index) { + return result + (index ? '-' : '') + word.toLowerCase(); + }); + + /** + * Converts `string`, as space separated words, to lower case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the lower cased string. + * @example + * + * _.lowerCase('--Foo-Bar--'); + * // => 'foo bar' + * + * _.lowerCase('fooBar'); + * // => 'foo bar' + * + * _.lowerCase('__FOO_BAR__'); + * // => 'foo bar' + */ + var lowerCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + word.toLowerCase(); + }); + + /** + * Converts the first character of `string` to lower case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.lowerFirst('Fred'); + * // => 'fred' + * + * _.lowerFirst('FRED'); + * // => 'fRED' + */ + var lowerFirst = createCaseFirst('toLowerCase'); + + /** + * Pads `string` on the left and right sides if it's shorter than `length`. + * Padding characters are truncated if they can't be evenly divided by `length`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.pad('abc', 8); + * // => ' abc ' + * + * _.pad('abc', 8, '_-'); + * // => '_-abc_-_' + * + * _.pad('abc', 3); + * // => 'abc' + */ + function pad(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + if (!length || strLength >= length) { + return string; + } + var mid = (length - strLength) / 2; + return ( + createPadding(nativeFloor(mid), chars) + + string + + createPadding(nativeCeil(mid), chars) + ); + } + + /** + * Pads `string` on the right side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padEnd('abc', 6); + * // => 'abc ' + * + * _.padEnd('abc', 6, '_-'); + * // => 'abc_-_' + * + * _.padEnd('abc', 3); + * // => 'abc' + */ + function padEnd(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (string + createPadding(length - strLength, chars)) + : string; + } + + /** + * Pads `string` on the left side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padStart('abc', 6); + * // => ' abc' + * + * _.padStart('abc', 6, '_-'); + * // => '_-_abc' + * + * _.padStart('abc', 3); + * // => 'abc' + */ + function padStart(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (createPadding(length - strLength, chars) + string) + : string; + } + + /** + * Converts `string` to an integer of the specified radix. If `radix` is + * `undefined` or `0`, a `radix` of `10` is used unless `value` is a + * hexadecimal, in which case a `radix` of `16` is used. + * + * **Note:** This method aligns with the + * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category String + * @param {string} string The string to convert. + * @param {number} [radix=10] The radix to interpret `value` by. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {number} Returns the converted integer. + * @example + * + * _.parseInt('08'); + * // => 8 + * + * _.map(['6', '08', '10'], _.parseInt); + * // => [6, 8, 10] + */ + function parseInt(string, radix, guard) { + // Chrome fails to trim leading whitespace characters. + // See https://bugs.chromium.org/p/v8/issues/detail?id=3109 for more details. + if (guard || radix == null) { + radix = 0; + } else if (radix) { + radix = +radix; + } + string = toString(string).replace(reTrim, ''); + return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10)); + } + + /** + * Repeats the given string `n` times. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to repeat. + * @param {number} [n=1] The number of times to repeat the string. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {string} Returns the repeated string. + * @example + * + * _.repeat('*', 3); + * // => '***' + * + * _.repeat('abc', 2); + * // => 'abcabc' + * + * _.repeat('abc', 0); + * // => '' + */ + function repeat(string, n, guard) { + if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + return baseRepeat(toString(string), n); + } + + /** + * Replaces matches for `pattern` in `string` with `replacement`. + * + * **Note:** This method is based on + * [`String#replace`](https://mdn.io/String/replace). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to modify. + * @param {RegExp|string} pattern The pattern to replace. + * @param {Function|string} replacement The match replacement. + * @returns {string} Returns the modified string. + * @example + * + * _.replace('Hi Fred', 'Fred', 'Barney'); + * // => 'Hi Barney' + */ + function replace() { + var args = arguments, + string = toString(args[0]); + + return args.length < 3 ? string : string.replace(args[1], args[2]); + } + + /** + * Converts `string` to + * [snake case](https://en.wikipedia.org/wiki/Snake_case). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the snake cased string. + * @example + * + * _.snakeCase('Foo Bar'); + * // => 'foo_bar' + * + * _.snakeCase('fooBar'); + * // => 'foo_bar' + * + * _.snakeCase('--FOO-BAR--'); + * // => 'foo_bar' + */ + var snakeCase = createCompounder(function(result, word, index) { + return result + (index ? '_' : '') + word.toLowerCase(); + }); + + /** + * Splits `string` by `separator`. + * + * **Note:** This method is based on + * [`String#split`](https://mdn.io/String/split). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to split. + * @param {RegExp|string} separator The separator pattern to split by. + * @param {number} [limit] The length to truncate results to. + * @returns {Array} Returns the new array of string segments. + * @example + * + * _.split('a-b-c', '-', 2); + * // => ['a', 'b'] + */ + function split(string, separator, limit) { + string = toString(string); + if (string && ( + typeof separator == 'string' || + (separator != null && !isRegExp(separator)) + )) { + separator += ''; + if (separator == '' && reHasComplexSymbol.test(string)) { + var strSymbols = stringToArray(string); + return limit === undefined ? strSymbols : strSymbols.slice(0, limit < 0 ? 0 : limit); + } + } + return string.split(separator, limit); + } + + /** + * Converts `string` to + * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). + * + * @static + * @memberOf _ + * @since 3.1.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the start cased string. + * @example + * + * _.startCase('--foo-bar--'); + * // => 'Foo Bar' + * + * _.startCase('fooBar'); + * // => 'Foo Bar' + * + * _.startCase('__FOO_BAR__'); + * // => 'FOO BAR' + */ + var startCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + upperFirst(word); + }); + + /** + * Checks if `string` starts with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to search. + * @param {string} [target] The string to search for. + * @param {number} [position=0] The position to search from. + * @returns {boolean} Returns `true` if `string` starts with `target`, + * else `false`. + * @example + * + * _.startsWith('abc', 'a'); + * // => true + * + * _.startsWith('abc', 'b'); + * // => false + * + * _.startsWith('abc', 'b', 1); + * // => true + */ + function startsWith(string, target, position) { + string = toString(string); + position = baseClamp(toInteger(position), 0, string.length); + return string.lastIndexOf(target, position) == position; + } + + /** + * Creates a compiled template function that can interpolate data properties + * in "interpolate" delimiters, HTML-escape interpolated data properties in + * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data + * properties may be accessed as free variables in the template. If a setting + * object is given, it takes precedence over `_.templateSettings` values. + * + * **Note:** In the development build `_.template` utilizes + * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) + * for easier debugging. + * + * For more information on precompiling templates see + * [lodash's custom builds documentation](https://lodash.com/custom-builds). + * + * For more information on Chrome extension sandboxes see + * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The template string. + * @param {Object} [options={}] The options object. + * @param {RegExp} [options.escape=_.templateSettings.escape] + * The HTML "escape" delimiter. + * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] + * The "evaluate" delimiter. + * @param {Object} [options.imports=_.templateSettings.imports] + * An object to import into the template as free variables. + * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] + * The "interpolate" delimiter. + * @param {string} [options.sourceURL='lodash.templateSources[n]'] + * The sourceURL of the compiled template. + * @param {string} [options.variable='obj'] + * The data object variable name. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the compiled template function. + * @example + * + * // Use the "interpolate" delimiter to create a compiled template. + * var compiled = _.template('hello <%= user %>!'); + * compiled({ 'user': 'fred' }); + * // => 'hello fred!' + * + * // Use the HTML "escape" delimiter to escape data property values. + * var compiled = _.template('<%- value %>'); + * compiled({ 'value': ' +``` + +## Why? + +This module uses a pre-defined list of rules, applied in order, to singularize or pluralize a given word. There are many cases where this is useful, such as any automation based on user input. For applications where the word(s) are known ahead of time, you can use a simple ternary (or function) which would be a much lighter alternative. + +## Usage + +```javascript +pluralize('test') //=> "tests" +pluralize('test', 1) //=> "test" +pluralize('test', 5) //=> "tests" +pluralize('test', 1, true) //=> "1 test" +pluralize('test', 5, true) //=> "5 tests" + +pluralize.plural('regex') //=> "regexes" +pluralize.addPluralRule(/gex$/i, 'gexii') +pluralize.plural('regex') //=> "regexii" + +pluralize.plural('singles', 1) //=> "single" +pluralize.addSingularRule(/singles$/i, 'singular') +pluralize.plural('singles', 1) //=> "singular" + +pluralize.plural('irregular') //=> "irregulars" +pluralize.addIrregularRule('irregular', 'regular') +pluralize.plural('irregular') //=> "regular" + +pluralize.plural('paper') //=> "papers" +pluralize.addUncountableRule('paper') +pluralize.plural('paper') //=> "paper" +``` + +## License + +MIT + +[npm-image]: https://img.shields.io/npm/v/pluralize.svg?style=flat +[npm-url]: https://npmjs.org/package/pluralize +[downloads-image]: https://img.shields.io/npm/dm/pluralize.svg?style=flat +[downloads-url]: https://npmjs.org/package/pluralize +[travis-image]: https://img.shields.io/travis/blakeembrey/pluralize.svg?style=flat +[travis-url]: https://travis-ci.org/blakeembrey/pluralize +[coveralls-image]: https://img.shields.io/coveralls/blakeembrey/pluralize.svg?style=flat +[coveralls-url]: https://coveralls.io/r/blakeembrey/pluralize?branch=master diff --git a/tools/eslint/node_modules/pluralize/package.json b/tools/eslint/node_modules/pluralize/package.json new file mode 100644 index 00000000000000..78369cfcd0cd1a --- /dev/null +++ b/tools/eslint/node_modules/pluralize/package.json @@ -0,0 +1,93 @@ +{ + "_args": [ + [ + "pluralize@^1.2.1", + "/Users/silverwind/git/node/tools/package/package" + ] + ], + "_from": "pluralize@>=1.2.1 <2.0.0", + "_id": "pluralize@1.2.1", + "_inCache": true, + "_installable": true, + "_location": "/pluralize", + "_nodeVersion": "4.0.0", + "_npmUser": { + "email": "hello@blakeembrey.com", + "name": "blakeembrey" + }, + "_npmVersion": "2.14.2", + "_phantomChildren": {}, + "_requested": { + "name": "pluralize", + "raw": "pluralize@^1.2.1", + "rawSpec": "^1.2.1", + "scope": null, + "spec": ">=1.2.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz", + "_shasum": "d1a21483fd22bb41e58a12fa3421823140897c45", + "_shrinkwrap": null, + "_spec": "pluralize@^1.2.1", + "_where": "/Users/silverwind/git/node/tools/package/package", + "author": { + "email": "hello@blakeembrey.com", + "name": "Blake Embrey", + "url": "http://blakeembrey.me" + }, + "bugs": { + "url": "https://github.com/blakeembrey/pluralize/issues" + }, + "dependencies": {}, + "description": "Pluralize and singularize any word", + "devDependencies": { + "chai": "^1.9.1", + "istanbul": "^0.3.0", + "mocha": "^1.21.4", + "pre-commit": "^1.0.10", + "semistandard": "^7.0.2" + }, + "directories": {}, + "dist": { + "shasum": "d1a21483fd22bb41e58a12fa3421823140897c45", + "tarball": "http://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz" + }, + "files": [ + "LICENSE", + "pluralize.js" + ], + "gitHead": "a956c0dbca8782b588f8cd3229f16e8436d1ee73", + "homepage": "https://github.com/blakeembrey/pluralize", + "keywords": [ + "plural", + "pluralize", + "plurals", + "singular", + "singularize" + ], + "license": "MIT", + "main": "pluralize.js", + "maintainers": [ + { + "name": "blakeembrey", + "email": "me@blakeembrey.com" + } + ], + "name": "pluralize", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/blakeembrey/pluralize.git" + }, + "scripts": { + "lint": "semistandard", + "test": "npm run lint && npm run test-cov", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- -R spec --bail", + "test-spec": "mocha -R spec --bail" + }, + "version": "1.2.1" +} diff --git a/tools/eslint/node_modules/pluralize/pluralize.js b/tools/eslint/node_modules/pluralize/pluralize.js new file mode 100644 index 00000000000000..4ef4eb66c375b1 --- /dev/null +++ b/tools/eslint/node_modules/pluralize/pluralize.js @@ -0,0 +1,433 @@ +/* global define */ + +(function (root, pluralize) { + /* istanbul ignore else */ + if (typeof require === 'function' && typeof exports === 'object' && typeof module === 'object') { + // Node. + module.exports = pluralize(); + } else if (typeof define === 'function' && define.amd) { + // AMD, registers as an anonymous module. + define(function () { + return pluralize(); + }); + } else { + // Browser global. + root.pluralize = pluralize(); + } +})(this, function () { + // Rule storage - pluralize and singularize need to be run sequentially, + // while other rules can be optimized using an object for instant lookups. + var pluralRules = []; + var singularRules = []; + var uncountables = {}; + var irregularPlurals = {}; + var irregularSingles = {}; + + /** + * Title case a string. + * + * @param {string} str + * @return {string} + */ + function toTitleCase (str) { + return str.charAt(0).toUpperCase() + str.substr(1).toLowerCase(); + } + + /** + * Sanitize a pluralization rule to a usable regular expression. + * + * @param {(RegExp|string)} rule + * @return {RegExp} + */ + function sanitizeRule (rule) { + if (typeof rule === 'string') { + return new RegExp('^' + rule + '$', 'i'); + } + + return rule; + } + + /** + * Pass in a word token to produce a function that can replicate the case on + * another word. + * + * @param {string} word + * @param {string} token + * @return {Function} + */ + function restoreCase (word, token) { + // Upper cased words. E.g. "HELLO". + if (word === word.toUpperCase()) { + return token.toUpperCase(); + } + + // Title cased words. E.g. "Title". + if (word[0] === word[0].toUpperCase()) { + return toTitleCase(token); + } + + // Lower cased words. E.g. "test". + return token.toLowerCase(); + } + + /** + * Interpolate a regexp string. + * + * @param {string} str + * @param {Array} args + * @return {string} + */ + function interpolate (str, args) { + return str.replace(/\$(\d{1,2})/g, function (match, index) { + return args[index] || ''; + }); + } + + /** + * Sanitize a word by passing in the word and sanitization rules. + * + * @param {String} token + * @param {String} word + * @param {Array} collection + * @return {String} + */ + function sanitizeWord (token, word, collection) { + // Empty string or doesn't need fixing. + if (!token.length || uncountables.hasOwnProperty(token)) { + return word; + } + + var len = collection.length; + + // Iterate over the sanitization rules and use the first one to match. + while (len--) { + var rule = collection[len]; + + // If the rule passes, return the replacement. + if (rule[0].test(word)) { + return word.replace(rule[0], function (match, index, word) { + var result = interpolate(rule[1], arguments); + + if (match === '') { + return restoreCase(word[index - 1], result); + } + + return restoreCase(match, result); + }); + } + } + + return word; + } + + /** + * Replace a word with the updated word. + * + * @param {Object} replaceMap + * @param {Object} keepMap + * @param {Array} rules + * @return {Function} + */ + function replaceWord (replaceMap, keepMap, rules) { + return function (word) { + // Get the correct token and case restoration functions. + var token = word.toLowerCase(); + + // Check against the keep object map. + if (keepMap.hasOwnProperty(token)) { + return restoreCase(word, token); + } + + // Check against the replacement map for a direct word replacement. + if (replaceMap.hasOwnProperty(token)) { + return restoreCase(word, replaceMap[token]); + } + + // Run all the rules against the word. + return sanitizeWord(token, word, rules); + }; + } + + /** + * Pluralize or singularize a word based on the passed in count. + * + * @param {String} word + * @param {Number} count + * @param {Boolean} inclusive + * @return {String} + */ + function pluralize (word, count, inclusive) { + var pluralized = count === 1 + ? pluralize.singular(word) : pluralize.plural(word); + + return (inclusive ? count + ' ' : '') + pluralized; + } + + /** + * Pluralize a word. + * + * @type {Function} + */ + pluralize.plural = replaceWord( + irregularSingles, irregularPlurals, pluralRules + ); + + /** + * Singularize a word. + * + * @type {Function} + */ + pluralize.singular = replaceWord( + irregularPlurals, irregularSingles, singularRules + ); + + /** + * Add a pluralization rule to the collection. + * + * @param {(string|RegExp)} rule + * @param {string} replacement + */ + pluralize.addPluralRule = function (rule, replacement) { + pluralRules.push([sanitizeRule(rule), replacement]); + }; + + /** + * Add a singularization rule to the collection. + * + * @param {(string|RegExp)} rule + * @param {string} replacement + */ + pluralize.addSingularRule = function (rule, replacement) { + singularRules.push([sanitizeRule(rule), replacement]); + }; + + /** + * Add an uncountable word rule. + * + * @param {(string|RegExp)} word + */ + pluralize.addUncountableRule = function (word) { + if (typeof word === 'string') { + uncountables[word.toLowerCase()] = true; + return; + } + + // Set singular and plural references for the word. + pluralize.addPluralRule(word, '$0'); + pluralize.addSingularRule(word, '$0'); + }; + + /** + * Add an irregular word definition. + * + * @param {String} single + * @param {String} plural + */ + pluralize.addIrregularRule = function (single, plural) { + plural = plural.toLowerCase(); + single = single.toLowerCase(); + + irregularSingles[single] = plural; + irregularPlurals[plural] = single; + }; + + /** + * Irregular rules. + */ + [ + // Pronouns. + ['I', 'we'], + ['me', 'us'], + ['he', 'they'], + ['she', 'they'], + ['them', 'them'], + ['myself', 'ourselves'], + ['yourself', 'yourselves'], + ['itself', 'themselves'], + ['herself', 'themselves'], + ['himself', 'themselves'], + ['themself', 'themselves'], + ['is', 'are'], + ['this', 'these'], + ['that', 'those'], + // Words ending in with a consonant and `o`. + ['echo', 'echoes'], + ['dingo', 'dingoes'], + ['volcano', 'volcanoes'], + ['tornado', 'tornadoes'], + ['torpedo', 'torpedoes'], + // Ends with `us`. + ['genus', 'genera'], + ['viscus', 'viscera'], + // Ends with `ma`. + ['stigma', 'stigmata'], + ['stoma', 'stomata'], + ['dogma', 'dogmata'], + ['lemma', 'lemmata'], + ['schema', 'schemata'], + ['anathema', 'anathemata'], + // Other irregular rules. + ['ox', 'oxen'], + ['axe', 'axes'], + ['die', 'dice'], + ['yes', 'yeses'], + ['foot', 'feet'], + ['eave', 'eaves'], + ['goose', 'geese'], + ['tooth', 'teeth'], + ['quiz', 'quizzes'], + ['human', 'humans'], + ['proof', 'proofs'], + ['carve', 'carves'], + ['valve', 'valves'], + ['thief', 'thieves'], + ['genie', 'genies'], + ['groove', 'grooves'], + ['pickaxe', 'pickaxes'], + ['whiskey', 'whiskies'] + ].forEach(function (rule) { + return pluralize.addIrregularRule(rule[0], rule[1]); + }); + + /** + * Pluralization rules. + */ + [ + [/s?$/i, 's'], + [/([^aeiou]ese)$/i, '$1'], + [/(ax|test)is$/i, '$1es'], + [/(alias|[^aou]us|tlas|gas|ris)$/i, '$1es'], + [/(e[mn]u)s?$/i, '$1s'], + [/([^l]ias|[aeiou]las|[emjzr]as|[iu]am)$/i, '$1'], + [/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'], + [/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'], + [/(seraph|cherub)(?:im)?$/i, '$1im'], + [/(her|at|gr)o$/i, '$1oes'], + [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'], + [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'], + [/sis$/i, 'ses'], + [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'], + [/([^aeiouy]|qu)y$/i, '$1ies'], + [/([^ch][ieo][ln])ey$/i, '$1ies'], + [/(x|ch|ss|sh|zz)$/i, '$1es'], + [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'], + [/(m|l)(?:ice|ouse)$/i, '$1ice'], + [/(pe)(?:rson|ople)$/i, '$1ople'], + [/(child)(?:ren)?$/i, '$1ren'], + [/eaux$/i, '$0'], + [/m[ae]n$/i, 'men'], + ['thou', 'you'] + ].forEach(function (rule) { + return pluralize.addPluralRule(rule[0], rule[1]); + }); + + /** + * Singularization rules. + */ + [ + [/s$/i, ''], + [/(ss)$/i, '$1'], + [/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(?:sis|ses)$/i, '$1sis'], + [/(^analy)(?:sis|ses)$/i, '$1sis'], + [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i, '$1fe'], + [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'], + [/([^aeiouy]|qu)ies$/i, '$1y'], + [/(^[pl]|zomb|^(?:neck)?t|[aeo][lt]|cut)ies$/i, '$1ie'], + [/(\b(?:mon|smil))ies$/i, '$1ey'], + [/(m|l)ice$/i, '$1ouse'], + [/(seraph|cherub)im$/i, '$1'], + [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|tlas|gas|(?:her|at|gr)o|ris)(?:es)?$/i, '$1'], + [/(e[mn]u)s?$/i, '$1'], + [/(movie|twelve)s$/i, '$1'], + [/(cris|test|diagnos)(?:is|es)$/i, '$1is'], + [/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'], + [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'], + [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'], + [/(alumn|alg|vertebr)ae$/i, '$1a'], + [/(cod|mur|sil|vert|ind)ices$/i, '$1ex'], + [/(matr|append)ices$/i, '$1ix'], + [/(pe)(rson|ople)$/i, '$1rson'], + [/(child)ren$/i, '$1'], + [/(eau)x?$/i, '$1'], + [/men$/i, 'man'] + ].forEach(function (rule) { + return pluralize.addSingularRule(rule[0], rule[1]); + }); + + /** + * Uncountable rules. + */ + [ + // Singular words with no plurals. + 'advice', + 'agenda', + 'bison', + 'bream', + 'buffalo', + 'carp', + 'chassis', + 'cod', + 'cooperation', + 'corps', + 'digestion', + 'debris', + 'diabetes', + 'energy', + 'equipment', + 'elk', + 'excretion', + 'expertise', + 'flounder', + 'gallows', + 'garbage', + 'graffiti', + 'headquarters', + 'health', + 'herpes', + 'highjinks', + 'homework', + 'information', + 'jeans', + 'justice', + 'kudos', + 'labour', + 'machinery', + 'mackerel', + 'media', + 'mews', + 'moose', + 'news', + 'pike', + 'plankton', + 'pliers', + 'pollution', + 'premises', + 'rain', + 'rice', + 'salmon', + 'scissors', + 'series', + 'sewage', + 'shambles', + 'shrimp', + 'species', + 'staff', + 'swine', + 'trout', + 'tuna', + 'whiting', + 'wildebeest', + 'wildlife', + 'you', + // Regexes. + /pox$/i, // "chickpox", "smallpox" + /ois$/i, + /deer$/i, // "deer", "reindeer" + /fish$/i, // "fish", "blowfish", "angelfish" + /sheep$/i, + /measles$/i, + /[^aeiou]ese$/i // "chinese", "japanese" + ].forEach(pluralize.addUncountableRule); + + return pluralize; +}); diff --git a/tools/eslint/node_modules/optionator/node_modules/prelude-ls/LICENSE b/tools/eslint/node_modules/prelude-ls/LICENSE similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/prelude-ls/LICENSE rename to tools/eslint/node_modules/prelude-ls/LICENSE diff --git a/tools/eslint/node_modules/optionator/node_modules/prelude-ls/README.md b/tools/eslint/node_modules/prelude-ls/README.md similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/prelude-ls/README.md rename to tools/eslint/node_modules/prelude-ls/README.md diff --git a/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Func.js b/tools/eslint/node_modules/prelude-ls/lib/Func.js similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Func.js rename to tools/eslint/node_modules/prelude-ls/lib/Func.js diff --git a/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/List.js b/tools/eslint/node_modules/prelude-ls/lib/List.js similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/List.js rename to tools/eslint/node_modules/prelude-ls/lib/List.js diff --git a/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Num.js b/tools/eslint/node_modules/prelude-ls/lib/Num.js similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Num.js rename to tools/eslint/node_modules/prelude-ls/lib/Num.js diff --git a/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Obj.js b/tools/eslint/node_modules/prelude-ls/lib/Obj.js similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Obj.js rename to tools/eslint/node_modules/prelude-ls/lib/Obj.js diff --git a/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Str.js b/tools/eslint/node_modules/prelude-ls/lib/Str.js similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/Str.js rename to tools/eslint/node_modules/prelude-ls/lib/Str.js diff --git a/tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/index.js b/tools/eslint/node_modules/prelude-ls/lib/index.js similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/prelude-ls/lib/index.js rename to tools/eslint/node_modules/prelude-ls/lib/index.js diff --git a/tools/eslint/node_modules/prelude-ls/package.json b/tools/eslint/node_modules/prelude-ls/package.json new file mode 100644 index 00000000000000..18f35bcd6c3644 --- /dev/null +++ b/tools/eslint/node_modules/prelude-ls/package.json @@ -0,0 +1,108 @@ +{ + "_args": [ + [ + "prelude-ls@~1.1.2", + "/Users/silverwind/git/node/tools/package/package/node_modules/optionator" + ] + ], + "_from": "prelude-ls@>=1.1.2 <1.2.0", + "_id": "prelude-ls@1.1.2", + "_inCache": true, + "_installable": true, + "_location": "/prelude-ls", + "_nodeVersion": "0.11.15", + "_npmUser": { + "email": "z@georgezahariev.com", + "name": "gkz" + }, + "_npmVersion": "2.7.6", + "_phantomChildren": {}, + "_requested": { + "name": "prelude-ls", + "raw": "prelude-ls@~1.1.2", + "rawSpec": "~1.1.2", + "scope": null, + "spec": ">=1.1.2 <1.2.0", + "type": "range" + }, + "_requiredBy": [ + "/levn", + "/optionator", + "/type-check" + ], + "_resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "_shasum": "21932a549f5e52ffd9a827f570e04be62a97da54", + "_shrinkwrap": null, + "_spec": "prelude-ls@~1.1.2", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/optionator", + "author": { + "email": "z@georgezahariev.com", + "name": "George Zahariev" + }, + "bugs": { + "url": "https://github.com/gkz/prelude-ls/issues" + }, + "dependencies": {}, + "description": "prelude.ls is a functionally oriented utility library. It is powerful and flexible. Almost all of its functions are curried. It is written in, and is the recommended base library for, LiveScript.", + "devDependencies": { + "browserify": "~3.24.13", + "istanbul": "~0.2.4", + "livescript": "~1.4.0", + "mocha": "~2.2.4", + "sinon": "~1.10.2", + "uglify-js": "~2.4.12" + }, + "directories": {}, + "dist": { + "shasum": "21932a549f5e52ffd9a827f570e04be62a97da54", + "tarball": "http://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz" + }, + "engines": { + "node": ">= 0.8.0" + }, + "files": [ + "LICENSE", + "README.md", + "lib/" + ], + "gitHead": "d69be8fd8a682321ba24eced17caf3a1b8ca73b8", + "homepage": "http://preludels.com", + "keywords": [ + "array", + "coffeescript", + "functional", + "javascript", + "library", + "list", + "livescript", + "ls", + "object", + "prelude", + "string", + "utility" + ], + "licenses": [ + { + "type": "MIT", + "url": "https://raw.github.com/gkz/prelude-ls/master/LICENSE" + } + ], + "main": "lib/", + "maintainers": [ + { + "name": "gkz", + "email": "z@georgezahariev.com" + } + ], + "name": "prelude-ls", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/gkz/prelude-ls.git" + }, + "scripts": { + "test": "make test" + }, + "version": "1.1.2" +} diff --git a/tools/eslint/node_modules/process-nextick-args/index.js b/tools/eslint/node_modules/process-nextick-args/index.js new file mode 100644 index 00000000000000..571c276783c779 --- /dev/null +++ b/tools/eslint/node_modules/process-nextick-args/index.js @@ -0,0 +1,20 @@ +'use strict'; + +if (!process.version || + process.version.indexOf('v0.') === 0 || + process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { + module.exports = nextTick; +} else { + module.exports = process.nextTick; +} + +function nextTick(fn) { + var args = new Array(arguments.length - 1); + var i = 0; + while (i < args.length) { + args[i++] = arguments[i]; + } + process.nextTick(function afterTick() { + fn.apply(null, args); + }); +} diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/license.md b/tools/eslint/node_modules/process-nextick-args/license.md similarity index 100% rename from deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/license.md rename to tools/eslint/node_modules/process-nextick-args/license.md diff --git a/tools/eslint/node_modules/process-nextick-args/package.json b/tools/eslint/node_modules/process-nextick-args/package.json new file mode 100644 index 00000000000000..0e19c03f4c7a1e --- /dev/null +++ b/tools/eslint/node_modules/process-nextick-args/package.json @@ -0,0 +1,71 @@ +{ + "_args": [ + [ + "process-nextick-args@~1.0.6", + "/Users/silverwind/git/node/tools/package/package/node_modules/readable-stream" + ] + ], + "_from": "process-nextick-args@>=1.0.6 <1.1.0", + "_id": "process-nextick-args@1.0.6", + "_inCache": true, + "_installable": true, + "_location": "/process-nextick-args", + "_nodeVersion": "4.1.1", + "_npmUser": { + "email": "calvin.metcalf@gmail.com", + "name": "cwmma" + }, + "_npmVersion": "2.14.4", + "_phantomChildren": {}, + "_requested": { + "name": "process-nextick-args", + "raw": "process-nextick-args@~1.0.6", + "rawSpec": "~1.0.6", + "scope": null, + "spec": ">=1.0.6 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/readable-stream" + ], + "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.6.tgz", + "_shasum": "0f96b001cea90b12592ce566edb97ec11e69bd05", + "_shrinkwrap": null, + "_spec": "process-nextick-args@~1.0.6", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/readable-stream", + "author": "", + "bugs": { + "url": "https://github.com/calvinmetcalf/process-nextick-args/issues" + }, + "dependencies": {}, + "description": "process.nextTick but always with args", + "devDependencies": { + "tap": "~0.2.6" + }, + "directories": {}, + "dist": { + "shasum": "0f96b001cea90b12592ce566edb97ec11e69bd05", + "tarball": "http://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.6.tgz" + }, + "gitHead": "e85787b05a8c3c1adb714f332d822e9162699c78", + "homepage": "https://github.com/calvinmetcalf/process-nextick-args", + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + } + ], + "name": "process-nextick-args", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/calvinmetcalf/process-nextick-args.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.6" +} diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/readme.md b/tools/eslint/node_modules/process-nextick-args/readme.md similarity index 100% rename from deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/readme.md rename to tools/eslint/node_modules/process-nextick-args/readme.md diff --git a/tools/eslint/node_modules/progress/LICENSE b/tools/eslint/node_modules/progress/LICENSE new file mode 100644 index 00000000000000..a7693b076d7b08 --- /dev/null +++ b/tools/eslint/node_modules/progress/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014 TJ Holowaychuk + +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/eslint/node_modules/progress/Makefile b/tools/eslint/node_modules/progress/Makefile new file mode 100644 index 00000000000000..f933be10a1976f --- /dev/null +++ b/tools/eslint/node_modules/progress/Makefile @@ -0,0 +1,8 @@ + +EXAMPLES = $(foreach EXAMPLE, $(wildcard examples/*.js), $(EXAMPLE)) + +.PHONY: test +test: $(EXAMPLES) + +.PHONY: $(EXAMPLES) +$(EXAMPLES): ; node $@ && echo diff --git a/tools/eslint/node_modules/progress/Readme.md b/tools/eslint/node_modules/progress/Readme.md new file mode 100644 index 00000000000000..202cef360325d7 --- /dev/null +++ b/tools/eslint/node_modules/progress/Readme.md @@ -0,0 +1,103 @@ +Flexible ascii progress bar. + +## Installation + +```bash +$ npm install progress +``` + +## Usage + +First we create a `ProgressBar`, giving it a format string +as well as the `total`, telling the progress bar when it will +be considered complete. After that all we need to do is `tick()` appropriately. + +```javascript +var ProgressBar = require('progress'); + +var bar = new ProgressBar(':bar', { total: 10 }); +var timer = setInterval(function () { + bar.tick(); + if (bar.complete) { + console.log('\ncomplete\n'); + clearInterval(timer); + } +}, 100); +``` + +### Options + +These are keys in the options object you can pass to the progress bar along with +`total` as seen in the example above. + +- `total` total number of ticks to complete +- `width` the displayed width of the progress bar defaulting to total +- `stream` the output stream defaulting to stderr +- `complete` completion character defaulting to "=" +- `incomplete` incomplete character defaulting to "-" +- `clear` option to clear the bar on completion defaulting to false +- `callback` optional function to call when the progress bar completes + +### Tokens + +These are tokens you can use in the format of your progress bar. + +- `:bar` the progress bar itself +- `:current` current tick number +- `:total` total ticks +- `:elapsed` time elapsed in seconds +- `:percent` completion percentage +- `:eta` estimated completion time in seconds + +## Examples + +### Download + +In our download example each tick has a variable influence, so we pass the chunk +length which adjusts the progress bar appropriately relative to the total +length. + +```javascript +var ProgressBar = require('../'); +var https = require('https'); + +var req = https.request({ + host: 'download.github.com', + port: 443, + path: '/visionmedia-node-jscoverage-0d4608a.zip' +}); + +req.on('response', function(res){ + var len = parseInt(res.headers['content-length'], 10); + + console.log(); + var bar = new ProgressBar(' downloading [:bar] :percent :etas', { + complete: '=', + incomplete: ' ', + width: 20, + total: len + }); + + res.on('data', function (chunk) { + bar.tick(chunk.length); + }); + + res.on('end', function () { + console.log('\n'); + }); +}); + +req.end(); +``` + +The above example result in a progress bar like the one below. + +``` +downloading [===== ] 29% 3.7s +``` + +You can see more examples in the `examples` folder. + +## License + +MIT diff --git a/tools/eslint/node_modules/progress/index.js b/tools/eslint/node_modules/progress/index.js new file mode 100644 index 00000000000000..4449dd30d7e7ad --- /dev/null +++ b/tools/eslint/node_modules/progress/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/node-progress'); diff --git a/tools/eslint/node_modules/progress/lib/node-progress.js b/tools/eslint/node_modules/progress/lib/node-progress.js new file mode 100644 index 00000000000000..0f47a9f48ae340 --- /dev/null +++ b/tools/eslint/node_modules/progress/lib/node-progress.js @@ -0,0 +1,180 @@ +/*! + * node-progress + * Copyright(c) 2011 TJ Holowaychuk + * MIT Licensed + */ + +/** + * Expose `ProgressBar`. + */ + +exports = module.exports = ProgressBar; + +/** + * Initialize a `ProgressBar` with the given `fmt` string and `options` or + * `total`. + * + * Options: + * + * - `total` total number of ticks to complete + * - `width` the displayed width of the progress bar defaulting to total + * - `stream` the output stream defaulting to stderr + * - `complete` completion character defaulting to "=" + * - `incomplete` incomplete character defaulting to "-" + * - `callback` optional function to call when the progress bar completes + * - `clear` will clear the progress bar upon termination + * + * Tokens: + * + * - `:bar` the progress bar itself + * - `:current` current tick number + * - `:total` total ticks + * - `:elapsed` time elapsed in seconds + * - `:percent` completion percentage + * - `:eta` eta in seconds + * + * @param {string} fmt + * @param {object|number} options or total + * @api public + */ + +function ProgressBar(fmt, options) { + this.stream = options.stream || process.stderr; + + if (typeof(options) == 'number') { + var total = options; + options = {}; + options.total = total; + } else { + options = options || {}; + if ('string' != typeof fmt) throw new Error('format required'); + if ('number' != typeof options.total) throw new Error('total required'); + } + + this.fmt = fmt; + this.curr = 0; + this.total = options.total; + this.width = options.width || this.total; + this.clear = options.clear + this.chars = { + complete : options.complete || '=', + incomplete : options.incomplete || '-' + }; + this.callback = options.callback || function () {}; + this.lastDraw = ''; +} + +/** + * "tick" the progress bar with optional `len` and optional `tokens`. + * + * @param {number|object} len or tokens + * @param {object} tokens + * @api public + */ + +ProgressBar.prototype.tick = function(len, tokens){ + if (len !== 0) + len = len || 1; + + // swap tokens + if ('object' == typeof len) tokens = len, len = 1; + + // start time for eta + if (0 == this.curr) this.start = new Date; + + this.curr += len + this.render(tokens); + + // progress complete + if (this.curr >= this.total) { + this.complete = true; + this.terminate(); + this.callback(this); + return; + } +}; + +/** + * Method to render the progress bar with optional `tokens` to place in the + * progress bar's `fmt` field. + * + * @param {object} tokens + * @api public + */ + +ProgressBar.prototype.render = function (tokens) { + if (!this.stream.isTTY) return; + + var ratio = this.curr / this.total; + ratio = Math.min(Math.max(ratio, 0), 1); + + var percent = ratio * 100; + var incomplete, complete, completeLength; + var elapsed = new Date - this.start; + var eta = (percent == 100) ? 0 : elapsed * (this.total / this.curr - 1); + + /* populate the bar template with percentages and timestamps */ + var str = this.fmt + .replace(':current', this.curr) + .replace(':total', this.total) + .replace(':elapsed', isNaN(elapsed) ? '0.0' : (elapsed / 1000).toFixed(1)) + .replace(':eta', (isNaN(eta) || !isFinite(eta)) ? '0.0' : (eta / 1000) + .toFixed(1)) + .replace(':percent', percent.toFixed(0) + '%'); + + /* compute the available space (non-zero) for the bar */ + var availableSpace = Math.max(0, this.stream.columns - str.replace(':bar', '').length); + var width = Math.min(this.width, availableSpace); + + /* TODO: the following assumes the user has one ':bar' token */ + completeLength = Math.round(width * ratio); + complete = Array(completeLength + 1).join(this.chars.complete); + incomplete = Array(width - completeLength + 1).join(this.chars.incomplete); + + /* fill in the actual progress bar */ + str = str.replace(':bar', complete + incomplete); + + /* replace the extra tokens */ + if (tokens) for (var key in tokens) str = str.replace(':' + key, tokens[key]); + + if (this.lastDraw !== str) { + this.stream.clearLine(); + this.stream.cursorTo(0); + this.stream.write(str); + this.lastDraw = str; + } +}; + +/** + * "update" the progress bar to represent an exact percentage. + * The ratio (between 0 and 1) specified will be multiplied by `total` and + * floored, representing the closest available "tick." For example, if a + * progress bar has a length of 3 and `update(0.5)` is called, the progress + * will be set to 1. + * + * A ratio of 0.5 will attempt to set the progress to halfway. + * + * @param {number} ratio The ratio (between 0 and 1 inclusive) to set the + * overall completion to. + * @api public + */ + +ProgressBar.prototype.update = function (ratio, tokens) { + var goal = Math.floor(ratio * this.total); + var delta = goal - this.curr; + + this.tick(delta, tokens); +}; + +/** + * Terminates a progress bar. + * + * @api public + */ + +ProgressBar.prototype.terminate = function () { + if (this.clear) { + this.stream.clearLine(); + this.stream.cursorTo(0); + } else console.log(); +}; diff --git a/tools/eslint/node_modules/progress/package.json b/tools/eslint/node_modules/progress/package.json new file mode 100644 index 00000000000000..8cd6b0a4f9dac7 --- /dev/null +++ b/tools/eslint/node_modules/progress/package.json @@ -0,0 +1,93 @@ +{ + "_args": [ + [ + "progress@^1.1.8", + "/Users/silverwind/git/node/tools/package/package" + ] + ], + "_from": "progress@>=1.1.8 <2.0.0", + "_id": "progress@1.1.8", + "_inCache": true, + "_installable": true, + "_location": "/progress", + "_npmUser": { + "email": "scalesjordan@gmail.com", + "name": "prezjordan" + }, + "_npmVersion": "1.4.14", + "_phantomChildren": {}, + "_requested": { + "name": "progress", + "raw": "progress@^1.1.8", + "rawSpec": "^1.1.8", + "scope": null, + "spec": ">=1.1.8 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", + "_shasum": "e260c78f6161cdd9b0e56cc3e0a85de17c7a57be", + "_shrinkwrap": null, + "_spec": "progress@^1.1.8", + "_where": "/Users/silverwind/git/node/tools/package/package", + "author": { + "email": "tj@vision-media.ca", + "name": "TJ Holowaychuk" + }, + "bugs": { + "url": "https://github.com/visionmedia/node-progress/issues" + }, + "contributors": [ + { + "name": "Christoffer Hallas", + "email": "christoffer.hallas@gmail.com" + }, + { + "name": "Jordan Scales", + "email": "scalesjordan@gmail.com" + } + ], + "dependencies": {}, + "description": "Flexible ascii progress bar", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "e260c78f6161cdd9b0e56cc3e0a85de17c7a57be", + "tarball": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz" + }, + "engines": { + "node": ">=0.4.0" + }, + "gitHead": "6b9524c0d07df9555d20ae95c65918020c50e3e2", + "homepage": "https://github.com/visionmedia/node-progress", + "keywords": [ + "cli", + "progress" + ], + "main": "index", + "maintainers": [ + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + { + "name": "hallas", + "email": "christoffer.hallas@forsvikgroup.com" + }, + { + "name": "prezjordan", + "email": "scalesjordan@gmail.com" + } + ], + "name": "progress", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/node-progress.git" + }, + "scripts": {}, + "version": "1.1.8" +} diff --git a/tools/eslint/node_modules/read-json-sync/LICENSE b/tools/eslint/node_modules/read-json-sync/LICENSE new file mode 100755 index 00000000000000..d9ef73fd74815b --- /dev/null +++ b/tools/eslint/node_modules/read-json-sync/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2014 - 2015 Shinnosuke Watanabe + +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/eslint/node_modules/read-json-sync/README.md b/tools/eslint/node_modules/read-json-sync/README.md new file mode 100755 index 00000000000000..d395cf37745a3f --- /dev/null +++ b/tools/eslint/node_modules/read-json-sync/README.md @@ -0,0 +1,44 @@ +# read-json-sync + +[![NPM version](https://img.shields.io/npm/v/read-json-sync.svg)](https://www.npmjs.com/package/read-json-sync) +[![Build Status](https://travis-ci.org/shinnn/read-json-sync.svg?branch=master)](https://travis-ci.org/shinnn/read-json-sync) +[![Build status](https://ci.appveyor.com/api/projects/status/t7sjgpku9on12d32?svg=true)](https://ci.appveyor.com/project/ShinnosukeWatanabe/read-json-sync) +[![Coverage Status](https://img.shields.io/coveralls/shinnn/read-json-sync.svg)](https://david-dm.org/shinnn/read-json-sync) +[![Dependency Status](https://david-dm.org/shinnn/read-json-sync.svg)](https://david-dm.org/shinnn/read-json-sync) +[![devDependency Status](https://david-dm.org/shinnn/read-json-sync/dev-status.svg)](https://david-dm.org/shinnn/read-json-sync#info=devDependencies) + +A [Node](https://nodejs.org/) module to read and parse a [JSON](http://www.json.org/) file synchronously + +```javascript +const readJsonSync = require('read-json-sync'); + +readJsonSync('package.json'); //=> {name: 'read-json-sync', version: '1.0.0', ...} +``` + +Node's built-in [`require`](https://nodejs.org/api/globals.html#globals_require) can do almost the same thing, but this module doesn't [cache](https://nodejs.org/api/modules.html#modules_caching) results. + +## Installation + +[Use npm](https://docs.npmjs.com/cli/install). + +``` +npm install read-json-sync +``` + +## API + +```javascript +const readJsonSync = require('read-json-sync'); +``` + +### readJsonSync(*filePath* [, *options*]) + +*filePath*: `String` (path to a JSON file) +*options*: `Object` ([`fs.readFile`](https://nodejs.org/api/fs.html#fs_fs_readfile_filename_options_callback) options) +Return: `Object` (parsed [JSON](https://tools.ietf.org/html/rfc7159) data) + +## License + +Copyright (c) 2014 - 2015 [Shinnosuke Watanabe](https://github.com/shinnn) + +Licensed under [the MIT License](./LICENSE). diff --git a/tools/eslint/node_modules/read-json-sync/index.js b/tools/eslint/node_modules/read-json-sync/index.js new file mode 100755 index 00000000000000..0abc7a7d562258 --- /dev/null +++ b/tools/eslint/node_modules/read-json-sync/index.js @@ -0,0 +1,11 @@ +/*! + * read-json-sync | MIT (c) Shinnosuke Watanabe + * https://github.com/shinnn/read-json-sync +*/ +'use strict'; + +var fs = require('graceful-fs'); + +module.exports = function readJsonSync(filePath, options) { + return JSON.parse(String(fs.readFileSync(filePath, options)).replace(/^\ufeff/g, '')); +}; diff --git a/tools/eslint/node_modules/read-json-sync/package.json b/tools/eslint/node_modules/read-json-sync/package.json new file mode 100644 index 00000000000000..d2152d45dd57ee --- /dev/null +++ b/tools/eslint/node_modules/read-json-sync/package.json @@ -0,0 +1,95 @@ +{ + "_args": [ + [ + "read-json-sync@^1.1.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/flat-cache" + ] + ], + "_from": "read-json-sync@>=1.1.0 <2.0.0", + "_id": "read-json-sync@1.1.1", + "_inCache": true, + "_installable": true, + "_location": "/read-json-sync", + "_nodeVersion": "5.1.0", + "_npmUser": { + "email": "snnskwtnb@gmail.com", + "name": "shinnn" + }, + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "name": "read-json-sync", + "raw": "read-json-sync@^1.1.0", + "rawSpec": "^1.1.0", + "scope": null, + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/flat-cache" + ], + "_resolved": "https://registry.npmjs.org/read-json-sync/-/read-json-sync-1.1.1.tgz", + "_shasum": "43c669ae864aae308dfbbb2721a67e295ec8fff6", + "_shrinkwrap": null, + "_spec": "read-json-sync@^1.1.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/flat-cache", + "author": { + "name": "Shinnosuke Watanabe", + "url": "https://github.com/shinnn" + }, + "bugs": { + "url": "https://github.com/shinnn/read-json-sync/issues" + }, + "dependencies": { + "graceful-fs": "^4.1.2" + }, + "description": "Read and parse a JSON file synchronously", + "devDependencies": { + "@shinnn/eslint-config-node-legacy": "^1.0.0", + "eslint": "^1.7.3", + "istanbul": "^0.4.0", + "tap-spec": "^4.1.0", + "tape": "^4.2.2" + }, + "directories": {}, + "dist": { + "shasum": "43c669ae864aae308dfbbb2721a67e295ec8fff6", + "tarball": "http://registry.npmjs.org/read-json-sync/-/read-json-sync-1.1.1.tgz" + }, + "files": [ + "index.js" + ], + "gitHead": "0999728ef395e327129fa5754c3f9d8d6040188b", + "homepage": "https://github.com/shinnn/read-json-sync#readme", + "keywords": [ + "data", + "file", + "json", + "load", + "parse", + "read", + "sync", + "synchronous", + "synchronously" + ], + "license": "MIT", + "maintainers": [ + { + "name": "shinnn", + "email": "snnskwtnb@gmail.com" + } + ], + "name": "read-json-sync", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/shinnn/read-json-sync.git" + }, + "scripts": { + "coverage": "node --strong_mode node_modules/.bin/istanbul cover test/test.js", + "pretest": "eslint --config @shinnn/node-legacy index.js test/test.js", + "test": "node --strong_mode --throw-deprecation --track-heap-objects test/test.js | tap-spec" + }, + "version": "1.1.1" +} diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.zuul.yml b/tools/eslint/node_modules/readable-stream/.zuul.yml similarity index 100% rename from deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.zuul.yml rename to tools/eslint/node_modules/readable-stream/.zuul.yml diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE b/tools/eslint/node_modules/readable-stream/LICENSE similarity index 100% rename from deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE rename to tools/eslint/node_modules/readable-stream/LICENSE diff --git a/tools/eslint/node_modules/readable-stream/README.md b/tools/eslint/node_modules/readable-stream/README.md new file mode 100644 index 00000000000000..1a67c48cd031b5 --- /dev/null +++ b/tools/eslint/node_modules/readable-stream/README.md @@ -0,0 +1,36 @@ +# readable-stream + +***Node-core v5.8.0 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) + + +[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) +[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) + + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) + +```bash +npm install --save readable-stream +``` + +***Node-core streams for userland*** + +This package is a mirror of the Streams2 and Streams3 implementations in +Node-core, including [documentation](doc/stream.markdown). + +If you want to guarantee a stable streams base, regardless of what version of +Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). + +As of version 2.0.0 **readable-stream** uses semantic versioning. + +# Streams WG Team Members + +* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> + - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B +* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> + - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 +* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> + - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D +* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> +* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> +* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/duplex.js b/tools/eslint/node_modules/readable-stream/duplex.js similarity index 100% rename from deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/duplex.js rename to tools/eslint/node_modules/readable-stream/duplex.js diff --git a/tools/eslint/node_modules/readable-stream/lib/_stream_duplex.js b/tools/eslint/node_modules/readable-stream/lib/_stream_duplex.js new file mode 100644 index 00000000000000..736693b8400fed --- /dev/null +++ b/tools/eslint/node_modules/readable-stream/lib/_stream_duplex.js @@ -0,0 +1,75 @@ +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + +'use strict'; + +/**/ + +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/**/ + +module.exports = Duplex; + +/**/ +var processNextTick = require('process-nextick-args'); +/**/ + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); + +util.inherits(Duplex, Readable); + +var keys = objectKeys(Writable.prototype); +for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; +} + +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) this.readable = false; + + if (options && options.writable === false) this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; + + this.once('end', onend); +} + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; + + // no more data can be written. + // But allow more writes to happen in this tick. + processNextTick(onEndNT, this); +} + +function onEndNT(self) { + self.end(); +} + +function forEach(xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} \ No newline at end of file diff --git a/tools/eslint/node_modules/readable-stream/lib/_stream_passthrough.js b/tools/eslint/node_modules/readable-stream/lib/_stream_passthrough.js new file mode 100644 index 00000000000000..d06f71f1868d77 --- /dev/null +++ b/tools/eslint/node_modules/readable-stream/lib/_stream_passthrough.js @@ -0,0 +1,26 @@ +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + +'use strict'; + +module.exports = PassThrough; + +var Transform = require('./_stream_transform'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(PassThrough, Transform); + +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); + + Transform.call(this, options); +} + +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; \ No newline at end of file diff --git a/tools/eslint/node_modules/readable-stream/lib/_stream_readable.js b/tools/eslint/node_modules/readable-stream/lib/_stream_readable.js new file mode 100644 index 00000000000000..54a9d5c553d69e --- /dev/null +++ b/tools/eslint/node_modules/readable-stream/lib/_stream_readable.js @@ -0,0 +1,880 @@ +'use strict'; + +module.exports = Readable; + +/**/ +var processNextTick = require('process-nextick-args'); +/**/ + +/**/ +var isArray = require('isarray'); +/**/ + +/**/ +var Buffer = require('buffer').Buffer; +/**/ + +Readable.ReadableState = ReadableState; + +var EE = require('events'); + +/**/ +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + +/**/ +var Stream; +(function () { + try { + Stream = require('st' + 'ream'); + } catch (_) {} finally { + if (!Stream) Stream = require('events').EventEmitter; + } +})(); +/**/ + +var Buffer = require('buffer').Buffer; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var debugUtil = require('util'); +var debug = undefined; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; +} +/**/ + +var StringDecoder; + +util.inherits(Readable, Stream); + +var Duplex; +function ReadableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; + + // cast to ints. + this.highWaterMark = ~ ~this.highWaterMark; + + this.buffer = []; + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // when piping, we only care about 'readable' events that happen + // after read()ing all the bytes and not getting any pushback. + this.ranOut = false; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +var Duplex; +function Readable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + if (!(this instanceof Readable)) return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + if (options && typeof options.read === 'function') this._read = options.read; + + Stream.call(this); +} + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + + if (!state.objectMode && typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = new Buffer(chunk, encoding); + encoding = ''; + } + } + + return readableAddChunk(this, state, chunk, encoding, false); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + var state = this._readableState; + return readableAddChunk(this, state, chunk, '', true); +}; + +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; + +function readableAddChunk(stream, state, chunk, encoding, addToFront) { + var er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (state.ended && !addToFront) { + var e = new Error('stream.push() after EOF'); + stream.emit('error', e); + } else if (state.endEmitted && addToFront) { + var e = new Error('stream.unshift() after end event'); + stream.emit('error', e); + } else { + var skipAdd; + if (state.decoder && !addToFront && !encoding) { + chunk = state.decoder.write(chunk); + skipAdd = !state.objectMode && chunk.length === 0; + } + + if (!addToFront) state.reading = false; + + // Don't add to the buffer if we've decoded to an empty string chunk and + // we're not in object mode + if (!skipAdd) { + // if we want the data now, just emit it. + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + + if (state.needReadable) emitReadable(stream); + } + } + + maybeReadMore(stream, state); + } + } else if (!addToFront) { + state.reading = false; + } + + return needMoreData(state); +} + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); +} + +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; + +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } + return n; +} + +function howMuchToRead(n, state) { + if (state.length === 0 && state.ended) return 0; + + if (state.objectMode) return n === 0 ? 0 : 1; + + if (n === null || isNaN(n)) { + // only flow one buffer at a time + if (state.flowing && state.buffer.length) return state.buffer[0].length;else return state.length; + } + + if (n <= 0) return 0; + + // If we're asking for more than the target buffer level, + // then raise the water mark. Bump up to the next highest + // power of 2, to prevent increasing it excessively in tiny + // amounts. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + + // don't have that much. return null, unless we've ended. + if (n > state.length) { + if (!state.ended) { + state.needReadable = true; + return 0; + } else { + return state.length; + } + } + + return n; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + var state = this._readableState; + var nOrig = n; + + if (typeof n !== 'number' || n > 0) state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); + + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } + + if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + } + + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (doRead && !state.reading) n = howMuchToRead(nOrig, state); + + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; + + if (ret === null) { + state.needReadable = true; + n = 0; + } + + state.length -= n; + + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (state.length === 0 && !state.ended) state.needReadable = true; + + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended && state.length === 0) endReadable(this); + + if (ret !== null) this.emit('data', ret); + + return ret; +}; + +function chunkInvalid(state, chunk) { + var er = null; + if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} + +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream); + } +} + +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); +} + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + processNextTick(maybeReadMore_, stream, state); + } +} + +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + this.emit('error', new Error('not implemented')); +}; + +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; + + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + + var endFn = doEnd ? onend : cleanup; + if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable) { + debug('onunpipe'); + if (readable === src) { + cleanup(); + } + } + + function onend() { + debug('onend'); + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', cleanup); + src.removeListener('data', ondata); + + cleanedUp = true; + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } + + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + var ret = dest.write(chunk); + if (false === ret) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + if (state.pipesCount === 1 && state.pipes[0] === dest && src.listenerCount('data') === 1 && !cleanedUp) { + debug('false write response, pause', src._readableState.awaitDrain); + src._readableState.awaitDrain++; + } + src.pause(); + } + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); + } + // This is a brutally ugly hack to make sure that our error handler + // is attached before any userland ones. NEVER DO THIS. + if (!dest._events || !dest._events.error) dest.on('error', onerror);else if (isArray(dest._events.error)) dest._events.error.unshift(onerror);else dest._events.error = [onerror, dest._events.error]; + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function () { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} + +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; + + if (!dest) dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + + for (var _i = 0; _i < len; _i++) { + dests[_i].emit('unpipe', this); + }return this; + } + + // try to find the right one. + var i = indexOf(state.pipes, dest); + if (i === -1) return this; + + state.pipes.splice(i, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; + + dest.emit('unpipe', this); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + // If listening to data, and it has not explicitly been paused, + // then call resume to start the flow of data on the next tick. + if (ev === 'data' && false !== this._readableState.flowing) { + this.resume(); + } + + if (ev === 'readable' && !this._readableState.endEmitted) { + var state = this._readableState; + if (!state.readableListening) { + state.readableListening = true; + state.emittedReadable = false; + state.needReadable = true; + if (!state.reading) { + processNextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this, state); + } + } + } + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); + } + return this; +}; + +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + processNextTick(resume_, stream, state); + } +} + +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); + } + + state.resumeScheduled = false; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); +} + +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; + +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + if (state.flowing) { + do { + var chunk = stream.read(); + } while (null !== chunk && state.flowing); + } +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { + var state = this._readableState; + var paused = false; + + var self = this; + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) self.push(chunk); + } + + self.push(null); + }); + + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); + + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; + + var ret = self.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); + } + } + + // proxy certain important events. + var events = ['error', 'close', 'destroy', 'pause', 'resume']; + forEach(events, function (ev) { + stream.on(ev, self.emit.bind(self, ev)); + }); + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + self._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; + + return self; +}; + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +function fromList(n, state) { + var list = state.buffer; + var length = state.length; + var stringMode = !!state.decoder; + var objectMode = !!state.objectMode; + var ret; + + // nothing in the list, definitely empty. + if (list.length === 0) return null; + + if (length === 0) ret = null;else if (objectMode) ret = list.shift();else if (!n || n >= length) { + // read it all, truncate the array. + if (stringMode) ret = list.join('');else if (list.length === 1) ret = list[0];else ret = Buffer.concat(list, length); + list.length = 0; + } else { + // read just some of it. + if (n < list[0].length) { + // just take a part of the first list item. + // slice is the same for buffers and strings. + var buf = list[0]; + ret = buf.slice(0, n); + list[0] = buf.slice(n); + } else if (n === list[0].length) { + // first list is a perfect match + ret = list.shift(); + } else { + // complex case. + // we have enough to cover it, but it spans past the first buffer. + if (stringMode) ret = '';else ret = new Buffer(n); + + var c = 0; + for (var i = 0, l = list.length; i < l && c < n; i++) { + var buf = list[0]; + var cpy = Math.min(n - c, buf.length); + + if (stringMode) ret += buf.slice(0, cpy);else buf.copy(ret, c, 0, cpy); + + if (cpy < buf.length) list[0] = buf.slice(cpy);else list.shift(); + + c += cpy; + } + } + } + + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('endReadable called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + processNextTick(endReadableNT, state, stream); + } +} + +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} + +function forEach(xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} + +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} \ No newline at end of file diff --git a/tools/eslint/node_modules/readable-stream/lib/_stream_transform.js b/tools/eslint/node_modules/readable-stream/lib/_stream_transform.js new file mode 100644 index 00000000000000..625cdc17698059 --- /dev/null +++ b/tools/eslint/node_modules/readable-stream/lib/_stream_transform.js @@ -0,0 +1,180 @@ +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + +'use strict'; + +module.exports = Transform; + +var Duplex = require('./_stream_duplex'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(Transform, Duplex); + +function TransformState(stream) { + this.afterTransform = function (er, data) { + return afterTransform(stream, er, data); + }; + + this.needTransform = false; + this.transforming = false; + this.writecb = null; + this.writechunk = null; + this.writeencoding = null; +} + +function afterTransform(stream, er, data) { + var ts = stream._transformState; + ts.transforming = false; + + var cb = ts.writecb; + + if (!cb) return stream.emit('error', new Error('no writecb in Transform class')); + + ts.writechunk = null; + ts.writecb = null; + + if (data !== null && data !== undefined) stream.push(data); + + cb(er); + + var rs = stream._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + stream._read(rs.highWaterMark); + } +} + +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + + Duplex.call(this, options); + + this._transformState = new TransformState(this); + + // when the writable side finishes, then flush out anything remaining. + var stream = this; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + + if (typeof options.flush === 'function') this._flush = options.flush; + } + + this.once('prefinish', function () { + if (typeof this._flush === 'function') this._flush(function (er) { + done(stream, er); + });else done(stream); + }); +} + +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + throw new Error('not implemented'); +}; + +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; + + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; + +function done(stream, er) { + if (er) return stream.emit('error', er); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + var ws = stream._writableState; + var ts = stream._transformState; + + if (ws.length) throw new Error('calling transform done when ws.length != 0'); + + if (ts.transforming) throw new Error('calling transform done when still transforming'); + + return stream.push(null); +} \ No newline at end of file diff --git a/tools/eslint/node_modules/readable-stream/lib/_stream_writable.js b/tools/eslint/node_modules/readable-stream/lib/_stream_writable.js new file mode 100644 index 00000000000000..95916c992a9507 --- /dev/null +++ b/tools/eslint/node_modules/readable-stream/lib/_stream_writable.js @@ -0,0 +1,516 @@ +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. + +'use strict'; + +module.exports = Writable; + +/**/ +var processNextTick = require('process-nextick-args'); +/**/ + +/**/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick; +/**/ + +/**/ +var Buffer = require('buffer').Buffer; +/**/ + +Writable.WritableState = WritableState; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +/**/ +var internalUtil = { + deprecate: require('util-deprecate') +}; +/**/ + +/**/ +var Stream; +(function () { + try { + Stream = require('st' + 'ream'); + } catch (_) {} finally { + if (!Stream) Stream = require('events').EventEmitter; + } +})(); +/**/ + +var Buffer = require('buffer').Buffer; + +util.inherits(Writable, Stream); + +function nop() {} + +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} + +var Duplex; +function WritableState(options, stream) { + Duplex = Duplex || require('./_stream_duplex'); + + options = options || {}; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; + + // cast to ints. + this.highWaterMark = ~ ~this.highWaterMark; + + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // when true all writes will be buffered until .uncork() call + this.corked = 0; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.bufferedRequest = null; + this.lastBufferedRequest = null; + + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; + + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; + + // count buffered requests + this.bufferedRequestCount = 0; + + // create the two objects needed to store the corked requests + // they are not a linked list, as no new elements are inserted in there + this.corkedRequestsFree = new CorkedRequest(this); + this.corkedRequestsFree.next = new CorkedRequest(this); +} + +WritableState.prototype.getBuffer = function writableStateGetBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; + +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.') + }); + } catch (_) {} +})(); + +var Duplex; +function Writable(options) { + Duplex = Duplex || require('./_stream_duplex'); + + // Writable ctor is applied to Duplexes, though they're not + // instanceof Writable, they're instanceof Readable. + if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options); + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + if (options) { + if (typeof options.write === 'function') this._write = options.write; + + if (typeof options.writev === 'function') this._writev = options.writev; + } + + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe. Not readable.')); +}; + +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + processNextTick(cb, er); +} + +// If we get something that is not a buffer, string, null, or undefined, +// and we're not in objectMode, then that's an error. +// Otherwise stream chunks are all considered to be of length=1, and the +// watermarks determine how many objects to keep in the buffer, rather than +// how many bytes or characters. +function validChunk(stream, state, chunk, cb) { + var valid = true; + + if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { + var er = new TypeError('Invalid non-string/buffer chunk'); + stream.emit('error', er); + processNextTick(cb, er); + valid = false; + } + return valid; +} + +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + + if (typeof cb !== 'function') cb = nop; + + if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, chunk, encoding, cb); + } + + return ret; +}; + +Writable.prototype.cork = function () { + var state = this._writableState; + + state.corked++; +}; + +Writable.prototype.uncork = function () { + var state = this._writableState; + + if (state.corked) { + state.corked--; + + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; + +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = new Buffer(chunk, encoding); + } + return chunk; +} + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, chunk, encoding, cb) { + chunk = decodeChunk(state, chunk, encoding); + + if (Buffer.isBuffer(chunk)) encoding = 'buffer'; + var len = state.objectMode ? 1 : chunk.length; + + state.length += len; + + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; + + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } + + return ret; +} + +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + if (sync) processNextTick(cb, er);else cb(er); + + stream._writableState.errorEmitted = true; + stream.emit('error', er); +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + + onwriteStateUpdate(state); + + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); + + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } + + if (sync) { + /**/ + asyncWrite(afterWrite, stream, state, finished, cb); + /**/ + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; + + var count = 0; + while (entry) { + buffer[count] = entry; + entry = entry.next; + count += 1; + } + + doWrite(stream, state, true, state.length, buffer, '', holder.finish); + + // doWrite is always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } + + if (entry === null) state.lastBufferedRequest = null; + } + + state.bufferedRequestCount = 0; + state.bufferedRequest = entry; + state.bufferProcessing = false; +} + +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('not implemented')); +}; + +Writable.prototype._writev = null; + +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); + + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } + + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) endWritable(this, state, cb); +}; + +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} + +function prefinish(stream, state) { + if (!state.prefinished) { + state.prefinished = true; + stream.emit('prefinish'); + } +} + +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + if (state.pendingcb === 0) { + prefinish(stream, state); + state.finished = true; + stream.emit('finish'); + } else { + prefinish(stream, state); + } + } + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) processNextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} + +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; + + this.next = null; + this.entry = null; + + this.finish = function (err) { + var entry = _this.entry; + _this.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = _this; + } else { + state.corkedRequestsFree = _this; + } + }; +} \ No newline at end of file diff --git a/tools/eslint/node_modules/readable-stream/package.json b/tools/eslint/node_modules/readable-stream/package.json new file mode 100644 index 00000000000000..12395c98278800 --- /dev/null +++ b/tools/eslint/node_modules/readable-stream/package.json @@ -0,0 +1,105 @@ +{ + "_args": [ + [ + "readable-stream@~2.0.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/concat-stream" + ] + ], + "_from": "readable-stream@>=2.0.0 <2.1.0", + "_id": "readable-stream@2.0.6", + "_inCache": true, + "_installable": true, + "_location": "/readable-stream", + "_nodeVersion": "5.7.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/readable-stream-2.0.6.tgz_1457893507709_0.369257491780445" + }, + "_npmUser": { + "email": "calvin.metcalf@gmail.com", + "name": "cwmma" + }, + "_npmVersion": "3.6.0", + "_phantomChildren": {}, + "_requested": { + "name": "readable-stream", + "raw": "readable-stream@~2.0.0", + "rawSpec": "~2.0.0", + "scope": null, + "spec": ">=2.0.0 <2.1.0", + "type": "range" + }, + "_requiredBy": [ + "/concat-stream" + ], + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "_shasum": "8f90341e68a53ccc928788dacfcd11b36eb9b78e", + "_shrinkwrap": null, + "_spec": "readable-stream@~2.0.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/concat-stream", + "browser": { + "util": false + }, + "bugs": { + "url": "https://github.com/nodejs/readable-stream/issues" + }, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~0.10.x", + "util-deprecate": "~1.0.1" + }, + "description": "Streams3, a user-land copy of the stream library from Node.js", + "devDependencies": { + "tap": "~0.2.6", + "tape": "~4.5.1", + "zuul": "~3.9.0" + }, + "directories": {}, + "dist": { + "shasum": "8f90341e68a53ccc928788dacfcd11b36eb9b78e", + "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz" + }, + "gitHead": "01fb5608a970b42c900b96746cadc13d27dd9d7e", + "homepage": "https://github.com/nodejs/readable-stream#readme", + "keywords": [ + "pipe", + "readable", + "stream" + ], + "license": "MIT", + "main": "readable.js", + "maintainers": [ + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + { + "name": "rvagg", + "email": "rod@vagg.org" + }, + { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + } + ], + "name": "readable-stream", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/nodejs/readable-stream.git" + }, + "scripts": { + "browser": "npm run write-zuul && zuul -- test/browser.js", + "test": "tap test/parallel/*.js test/ours/*.js", + "write-zuul": "printf \"ui: tape\nbrowsers:\n - name: $BROWSER_NAME\n version: $BROWSER_VERSION\n\">.zuul.yml" + }, + "version": "2.0.6" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/passthrough.js b/tools/eslint/node_modules/readable-stream/passthrough.js similarity index 100% rename from deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/passthrough.js rename to tools/eslint/node_modules/readable-stream/passthrough.js diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/readable.js b/tools/eslint/node_modules/readable-stream/readable.js similarity index 100% rename from deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/readable.js rename to tools/eslint/node_modules/readable-stream/readable.js diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/transform.js b/tools/eslint/node_modules/readable-stream/transform.js similarity index 100% rename from deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/transform.js rename to tools/eslint/node_modules/readable-stream/transform.js diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/writable.js b/tools/eslint/node_modules/readable-stream/writable.js similarity index 100% rename from deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/writable.js rename to tools/eslint/node_modules/readable-stream/writable.js diff --git a/tools/eslint/node_modules/readline2/README.md b/tools/eslint/node_modules/readline2/README.md new file mode 100644 index 00000000000000..5a677a4e6ce527 --- /dev/null +++ b/tools/eslint/node_modules/readline2/README.md @@ -0,0 +1,33 @@ +readline2 [![Build Status](https://travis-ci.org/SBoudrias/readline2.png?branch=master)](https://travis-ci.org/SBoudrias/readline2) +========= + +Node.js (v0.8 and v0.10) had some bugs and issues with the default [Readline](http://nodejs.org/api/readline.html) module. + +This module include fixes seen in later version (0.11-0.12 and iojs) and ease some undesirable behavior one could see using the readline to create interatives prompts. This means `readline2` change some behaviors and as so is **not** meant to be an exact drop-in replacement. + +This project is extracted from the core of [Inquirer.js interactive prompt interface](https://github.com/SBoudrias/Inquirer.js) to be available as a standalone module. + + +Documentation +------------- + +**Installation**: `npm install --save readline2` + +### readline2.createInterface(options); -> {Interface} + +Present the same API as [Node.js `readline.createInterface()`](http://nodejs.org/api/readline.html) + +#### Improvements +- Default `options.input` as `process.stdin` +- Default `options.output` as `process.stdout` +- `interface.stdout` is wrapped in a [MuteStream](https://github.com/isaacs/mute-stream) +- Prevent `up` and `down` keys from moving through history inside the readline +- Fix cursor position after a line refresh when the `Interface` prompt contains ANSI colors +- Correctly return the cursor position when faced with implicit line returns + + +License +------------- + +Copyright (c) 2012 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart)) +Licensed under the MIT license. diff --git a/tools/eslint/node_modules/readline2/index.js b/tools/eslint/node_modules/readline2/index.js new file mode 100644 index 00000000000000..050965fbaab055 --- /dev/null +++ b/tools/eslint/node_modules/readline2/index.js @@ -0,0 +1,126 @@ +/** + * Readline API façade to fix some issues + * @Note: May look a bit like Monkey patching... if you know a better way let me know. + */ + +"use strict"; +var readline = require("readline"); +var MuteStream = require("mute-stream"); +var codePointAt = require("code-point-at"); +var isFullwidthCodePoint = require("is-fullwidth-code-point"); + +var Interface = module.exports = {}; + + +/** + * Create a readline interface + * @param {Object} opt Readline option hash + * @return {readline} the new readline interface + */ + +Interface.createInterface = function( opt ) { + opt || (opt = {}); + var filteredOpt = opt; + + // Default `input` to stdin + filteredOpt.input = opt.input || process.stdin; + + // Add mute capabilities to the output + var ms = new MuteStream(); + ms.pipe( opt.output || process.stdout ); + filteredOpt.output = ms; + + // Create the readline + var rl = readline.createInterface( filteredOpt ); + + // Fix bug with refreshLine + var _refreshLine = rl._refreshLine; + rl._refreshLine = function() { + _refreshLine.call(rl); + + var line = this._prompt + this.line; + var cursorPos = this._getCursorPos(); + + readline.moveCursor(this.output, -line.length, 0); + readline.moveCursor(this.output, cursorPos.cols, 0); + }; + + // Returns current cursor's position and line + rl._getCursorPos = function() { + var columns = this.columns; + var strBeforeCursor = this._prompt + this.line.substring(0, this.cursor); + var dispPos = this._getDisplayPos(strBeforeCursor); + var cols = dispPos.cols; + var rows = dispPos.rows; + // If the cursor is on a full-width character which steps over the line, + // move the cursor to the beginning of the next line. + if (cols + 1 === columns && + this.cursor < this.line.length && + isFullwidthCodePoint(codePointAt(this.line, this.cursor))) { + rows++; + cols = 0; + } + return {cols: cols, rows: rows}; + }; + + // Returns the last character's display position of the given string + rl._getDisplayPos = function(str) { + var offset = 0; + var col = this.columns; + var row = 0; + var code; + str = stripVTControlCharacters(str); + for (var i = 0, len = str.length; i < len; i++) { + code = codePointAt(str, i); + if (code >= 0x10000) { // surrogates + i++; + } + if (code === 0x0a) { // new line \n + offset = 0; + row += 1; + continue; + } + if (isFullwidthCodePoint(code)) { + if ((offset + 1) % col === 0) { + offset++; + } + offset += 2; + } else { + offset++; + } + } + var cols = offset % col; + var rows = row + (offset - cols) / col; + return {cols: cols, rows: rows}; + }; + + // Prevent arrows from breaking the question line + var origWrite = rl._ttyWrite; + rl._ttyWrite = function( s, key ) { + key || (key = {}); + + if ( key.name === "up" ) return; + if ( key.name === "down" ) return; + + origWrite.apply( this, arguments ); + }; + + return rl; +}; + +// Regexes used for ansi escape code splitting +var metaKeyCodeReAnywhere = /(?:\x1b)([a-zA-Z0-9])/; +var functionKeyCodeReAnywhere = new RegExp('(?:\x1b+)(O|N|\\[|\\[\\[)(?:' + [ + '(\\d+)(?:;(\\d+))?([~^$])', + '(?:M([@ #!a`])(.)(.))', // mouse + '(?:1;)?(\\d+)?([a-zA-Z])' +].join('|') + ')'); + +/** + * Tries to remove all VT control characters. Use to estimate displayed + * string width. May be buggy due to not running a real state machine + */ +function stripVTControlCharacters (str) { + str = str.replace(new RegExp(functionKeyCodeReAnywhere.source, 'g'), ''); + return str.replace(new RegExp(metaKeyCodeReAnywhere.source, 'g'), ''); +} diff --git a/tools/eslint/node_modules/readline2/package.json b/tools/eslint/node_modules/readline2/package.json new file mode 100644 index 00000000000000..2330090a4c2dfc --- /dev/null +++ b/tools/eslint/node_modules/readline2/package.json @@ -0,0 +1,89 @@ +{ + "_args": [ + [ + "readline2@^1.0.1", + "/Users/silverwind/git/node/tools/package/package/node_modules/inquirer" + ] + ], + "_from": "readline2@>=1.0.1 <2.0.0", + "_id": "readline2@1.0.1", + "_inCache": true, + "_installable": true, + "_location": "/readline2", + "_nodeVersion": "0.12.5", + "_npmUser": { + "email": "admin@simonboudrias.com", + "name": "sboudrias" + }, + "_npmVersion": "2.11.2", + "_phantomChildren": {}, + "_requested": { + "name": "readline2", + "raw": "readline2@^1.0.1", + "rawSpec": "^1.0.1", + "scope": null, + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/inquirer" + ], + "_resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", + "_shasum": "41059608ffc154757b715d9989d199ffbf372e35", + "_shrinkwrap": null, + "_spec": "readline2@^1.0.1", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/inquirer", + "author": { + "email": "admin@simonboudrias.com", + "name": "Simon Boudrias" + }, + "bugs": { + "url": "https://github.com/sboudrias/readline2/issues" + }, + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "mute-stream": "0.0.5" + }, + "description": "Readline Façade fixing bugs and issues found in releases 0.8 and 0.10", + "devDependencies": { + "chalk": "^1.1.0", + "mocha": "^2.1.0", + "sinon": "^1.7.3" + }, + "directories": {}, + "dist": { + "shasum": "41059608ffc154757b715d9989d199ffbf372e35", + "tarball": "http://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz" + }, + "files": [ + "index.js" + ], + "gitHead": "32aa9851e2cbb0610364d5009165be6fb2fed4ef", + "homepage": "https://github.com/sboudrias/readline2#readme", + "keywords": [ + "ansi", + "cli", + "readline", + "terminal", + "tty" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sboudrias", + "email": "admin@simonboudrias.com" + } + ], + "name": "readline2", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sboudrias/readline2.git" + }, + "scripts": { + "test": "mocha -R spec" + }, + "version": "1.0.1" +} diff --git a/tools/eslint/node_modules/require-uncached/index.js b/tools/eslint/node_modules/require-uncached/index.js new file mode 100644 index 00000000000000..eaabd49c3fdc03 --- /dev/null +++ b/tools/eslint/node_modules/require-uncached/index.js @@ -0,0 +1,18 @@ +'use strict'; +var path = require('path'); +var resolveFrom = require('resolve-from'); +var callerPath = require('caller-path'); + +module.exports = function (moduleId) { + if (typeof moduleId !== 'string') { + throw new TypeError('Expected a string'); + } + + var filePath = resolveFrom(path.dirname(callerPath()), moduleId); + var tmp = require.cache[filePath]; + delete require.cache[filePath]; + var ret = require(filePath); + require.cache[filePath] = tmp; + + return ret; +}; diff --git a/tools/eslint/node_modules/require-uncached/package.json b/tools/eslint/node_modules/require-uncached/package.json new file mode 100644 index 00000000000000..c08f560d49352f --- /dev/null +++ b/tools/eslint/node_modules/require-uncached/package.json @@ -0,0 +1,90 @@ +{ + "_args": [ + [ + "require-uncached@^1.0.2", + "/Users/silverwind/git/node/tools/package/package" + ] + ], + "_from": "require-uncached@>=1.0.2 <2.0.0", + "_id": "require-uncached@1.0.2", + "_inCache": true, + "_installable": true, + "_location": "/require-uncached", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_npmVersion": "1.4.9", + "_phantomChildren": {}, + "_requested": { + "name": "require-uncached", + "raw": "require-uncached@^1.0.2", + "rawSpec": "^1.0.2", + "scope": null, + "spec": ">=1.0.2 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.2.tgz", + "_shasum": "67dad3b733089e77030124678a459589faf6a7ec", + "_shrinkwrap": null, + "_spec": "require-uncached@^1.0.2", + "_where": "/Users/silverwind/git/node/tools/package/package", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "http://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/require-uncached/issues" + }, + "dependencies": { + "caller-path": "^0.1.0", + "resolve-from": "^1.0.0" + }, + "description": "Require a module bypassing the cache", + "devDependencies": { + "ava": "0.0.3" + }, + "directories": {}, + "dist": { + "shasum": "67dad3b733089e77030124678a459589faf6a7ec", + "tarball": "http://registry.npmjs.org/require-uncached/-/require-uncached-1.0.2.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/require-uncached", + "keywords": [ + "bypass", + "cache", + "fresh", + "module", + "require", + "uncache", + "uncached" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "require-uncached", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/sindresorhus/require-uncached.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.2" +} diff --git a/tools/eslint/node_modules/require-uncached/readme.md b/tools/eslint/node_modules/require-uncached/readme.md new file mode 100644 index 00000000000000..13104be14acea5 --- /dev/null +++ b/tools/eslint/node_modules/require-uncached/readme.md @@ -0,0 +1,44 @@ +# require-uncached [![Build Status](https://travis-ci.org/sindresorhus/require-uncached.svg?branch=master)](https://travis-ci.org/sindresorhus/require-uncached) + +> Require a module bypassing the [cache](http://nodejs.org/api/modules.html#modules_caching) + +Useful for testing purposes when you need to freshly require a module. + + +## Install + +```sh +$ npm install --save require-uncached +``` + + +## Usage + +```js +// foo.js +var i = 0; +module.exports = function () { + return ++i; +}; +``` + +```js +var requireUncached = require('require-uncached'); + +require('./foo')(); +//=> 1 + +require('./foo')(); +//=> 2 + +requireUncached('./foo')(); +//=> 1 + +requireUncached('./foo')(); +//=> 1 +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/eslint/node_modules/resolve-from/index.js b/tools/eslint/node_modules/resolve-from/index.js new file mode 100644 index 00000000000000..9162f4acf31bef --- /dev/null +++ b/tools/eslint/node_modules/resolve-from/index.js @@ -0,0 +1,19 @@ +'use strict'; +var path = require('path'); +var Module = require('module'); + +module.exports = function (fromDir, moduleId) { + if (typeof fromDir !== 'string' || typeof moduleId !== 'string') { + throw new TypeError('Expected `fromDir` and `moduleId` to be a string'); + } + + fromDir = path.resolve(fromDir); + + var fromFile = path.join(fromDir, 'noop.js'); + + return Module._resolveFilename(moduleId, { + id: fromFile, + filename: fromFile, + paths: Module._nodeModulePaths(fromDir) + }); +}; diff --git a/tools/eslint/node_modules/resolve-from/license b/tools/eslint/node_modules/resolve-from/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/tools/eslint/node_modules/resolve-from/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tools/eslint/node_modules/resolve-from/package.json b/tools/eslint/node_modules/resolve-from/package.json new file mode 100644 index 00000000000000..4f850d23ea6d2a --- /dev/null +++ b/tools/eslint/node_modules/resolve-from/package.json @@ -0,0 +1,90 @@ +{ + "_args": [ + [ + "resolve-from@^1.0.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/require-uncached" + ] + ], + "_from": "resolve-from@>=1.0.0 <2.0.0", + "_id": "resolve-from@1.0.1", + "_inCache": true, + "_installable": true, + "_location": "/resolve-from", + "_nodeVersion": "4.1.1", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_npmVersion": "2.14.4", + "_phantomChildren": {}, + "_requested": { + "name": "resolve-from", + "raw": "resolve-from@^1.0.0", + "rawSpec": "^1.0.0", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/require-uncached" + ], + "_resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "_shasum": "26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226", + "_shrinkwrap": null, + "_spec": "resolve-from@^1.0.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/require-uncached", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/resolve-from/issues" + }, + "dependencies": {}, + "description": "Resolve the path of a module like require.resolve() but from a given path", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226", + "tarball": "http://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "bae2cf1d66c616ad2eb27e0fe85a10ff0f2dfc92", + "homepage": "https://github.com/sindresorhus/resolve-from", + "keywords": [ + "from", + "like", + "module", + "path", + "path", + "require", + "resolve" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "resolve-from", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/resolve-from.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.1" +} diff --git a/tools/eslint/node_modules/resolve-from/readme.md b/tools/eslint/node_modules/resolve-from/readme.md new file mode 100644 index 00000000000000..80a240c48762e3 --- /dev/null +++ b/tools/eslint/node_modules/resolve-from/readme.md @@ -0,0 +1,56 @@ +# resolve-from [![Build Status](https://travis-ci.org/sindresorhus/resolve-from.svg?branch=master)](https://travis-ci.org/sindresorhus/resolve-from) + +> Resolve the path of a module like [`require.resolve()`](http://nodejs.org/api/globals.html#globals_require_resolve) but from a given path + + +## Install + +``` +$ npm install --save resolve-from +``` + + +## Usage + +```js +const resolveFrom = require('resolve-from'); + +// there's a file at `./foo/bar.js` + +resolveFrom('foo', './bar'); +//=> '/Users/sindresorhus/dev/test/foo/bar.js' +``` + + +## API + +### resolveFrom(fromDir, moduleId) + +#### fromDir + +Type: `string` + +The directory to resolve from. + +#### moduleId + +Type: `string` + +What you would use in `require()`. + + +## Tip + +Create a partial using a bound function if you want to require from the same `fromDir` multiple times: + +```js +const resolveFromFoo = resolveFrom.bind(null, 'foo'); + +resolveFromFoo('./bar'); +resolveFromFoo('./baz'); +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/eslint/node_modules/restore-cursor/index.js b/tools/eslint/node_modules/restore-cursor/index.js new file mode 100644 index 00000000000000..c3da545b52590f --- /dev/null +++ b/tools/eslint/node_modules/restore-cursor/index.js @@ -0,0 +1,9 @@ +'use strict'; +var onetime = require('onetime'); +var exitHook = require('exit-hook'); + +module.exports = onetime(function () { + exitHook(function () { + process.stdout.write('\u001b[?25h'); + }); +}); diff --git a/tools/eslint/node_modules/restore-cursor/license b/tools/eslint/node_modules/restore-cursor/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/tools/eslint/node_modules/restore-cursor/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tools/eslint/node_modules/restore-cursor/package.json b/tools/eslint/node_modules/restore-cursor/package.json new file mode 100644 index 00000000000000..3338e669c40261 --- /dev/null +++ b/tools/eslint/node_modules/restore-cursor/package.json @@ -0,0 +1,101 @@ +{ + "_args": [ + [ + "restore-cursor@^1.0.1", + "/Users/silverwind/git/node/tools/package/package/node_modules/cli-cursor" + ] + ], + "_from": "restore-cursor@>=1.0.1 <2.0.0", + "_id": "restore-cursor@1.0.1", + "_inCache": true, + "_installable": true, + "_location": "/restore-cursor", + "_nodeVersion": "4.1.0", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_npmVersion": "2.14.3", + "_phantomChildren": {}, + "_requested": { + "name": "restore-cursor", + "raw": "restore-cursor@^1.0.1", + "rawSpec": "^1.0.1", + "scope": null, + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/cli-cursor" + ], + "_resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", + "_shasum": "34661f46886327fed2991479152252df92daa541", + "_shrinkwrap": null, + "_spec": "restore-cursor@^1.0.1", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/cli-cursor", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "http://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/restore-cursor/issues" + }, + "dependencies": { + "exit-hook": "^1.0.0", + "onetime": "^1.0.0" + }, + "description": "Gracefully restore the CLI cursor on exit", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "34661f46886327fed2991479152252df92daa541", + "tarball": "http://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "91542e5be16d7ccda8e42a63d56cc783d2cfaba2", + "homepage": "https://github.com/sindresorhus/restore-cursor#readme", + "keywords": [ + "ansi", + "cli", + "command-line", + "console", + "cursor", + "exit", + "graceful", + "kill", + "process", + "quit", + "shell", + "show", + "shutdown", + "sigint", + "sigterm", + "stop", + "term", + "terminal", + "terminate", + "tty" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "restore-cursor", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/restore-cursor.git" + }, + "scripts": {}, + "version": "1.0.1" +} diff --git a/tools/eslint/node_modules/restore-cursor/readme.md b/tools/eslint/node_modules/restore-cursor/readme.md new file mode 100644 index 00000000000000..be085608d2d32d --- /dev/null +++ b/tools/eslint/node_modules/restore-cursor/readme.md @@ -0,0 +1,25 @@ +# restore-cursor + +> Gracefully restore the CLI cursor on exit + +Prevent the cursor you've hidden interactively to remain hidden if the process crashes. + + +## Install + +```sh +$ npm install --save restore-cursor +``` + + +## Usage + +```js +var restoreCursor = require('restore-cursor'); +restoreCursor(); +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/eslint/node_modules/rimraf/LICENSE b/tools/eslint/node_modules/rimraf/LICENSE new file mode 100644 index 00000000000000..19129e315fe593 --- /dev/null +++ b/tools/eslint/node_modules/rimraf/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/tools/eslint/node_modules/rimraf/README.md b/tools/eslint/node_modules/rimraf/README.md new file mode 100644 index 00000000000000..423b8cf854ad3e --- /dev/null +++ b/tools/eslint/node_modules/rimraf/README.md @@ -0,0 +1,101 @@ +[![Build Status](https://travis-ci.org/isaacs/rimraf.svg?branch=master)](https://travis-ci.org/isaacs/rimraf) [![Dependency Status](https://david-dm.org/isaacs/rimraf.svg)](https://david-dm.org/isaacs/rimraf) [![devDependency Status](https://david-dm.org/isaacs/rimraf/dev-status.svg)](https://david-dm.org/isaacs/rimraf#info=devDependencies) + +The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node. + +Install with `npm install rimraf`, or just drop rimraf.js somewhere. + +## API + +`rimraf(f, [opts], callback)` + +The first parameter will be interpreted as a globbing pattern for files. If you +want to disable globbing you can do so with `opts.disableGlob` (defaults to +`false`). This might be handy, for instance, if you have filenames that contain +globbing wildcard characters. + +The callback will be called with an error if there is one. Certain +errors are handled for you: + +* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of + `opts.maxBusyTries` times before giving up, adding 100ms of wait + between each attempt. The default `maxBusyTries` is 3. +* `ENOENT` - If the file doesn't exist, rimraf will return + successfully, since your desired outcome is already the case. +* `EMFILE` - Since `readdir` requires opening a file descriptor, it's + possible to hit `EMFILE` if too many file descriptors are in use. + In the sync case, there's nothing to be done for this. But in the + async case, rimraf will gradually back off with timeouts up to + `opts.emfileWait` ms, which defaults to 1000. + +## options + +* unlink, chmod, stat, lstat, rmdir, readdir, + unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync + + In order to use a custom file system library, you can override + specific fs functions on the options object. + + If any of these functions are present on the options object, then + the supplied function will be used instead of the default fs + method. + + Sync methods are only relevant for `rimraf.sync()`, of course. + + For example: + + ```javascript + var myCustomFS = require('some-custom-fs') + + rimraf('some-thing', myCustomFS, callback) + ``` + +* maxBusyTries + + If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error code is encountered + on Windows systems, then rimraf will retry with a linear backoff + wait of 100ms longer on each try. The default maxBusyTries is 3. + + Only relevant for async usage. + +* emfileWait + + If an `EMFILE` error is encountered, then rimraf will retry + repeatedly with a linear backoff of 1ms longer on each try, until + the timeout counter hits this max. The default limit is 1000. + + If you repeatedly encounter `EMFILE` errors, then consider using + [graceful-fs](http://npm.im/graceful-fs) in your program. + + Only relevant for async usage. + +* glob + + Set to `false` to disable [glob](http://npm.im/glob) pattern + matching. + + Set to an object to pass options to the glob module. The default + glob options are `{ nosort: true, silent: true }`. + + Glob version 6 is used in this module. + + Relevant for both sync and async usage. + +* disableGlob + + Set to any non-falsey value to disable globbing entirely. + (Equivalent to setting `glob: false`.) + +## rimraf.sync + +It can remove stuff synchronously, too. But that's not so good. Use +the async API. It's better. + +## CLI + +If installed with `npm install rimraf -g` it can be used as a global +command `rimraf [ ...]` which is useful for cross platform support. + +## mkdirp + +If you need to create a directory recursively, check out +[mkdirp](https://github.com/substack/node-mkdirp). diff --git a/tools/eslint/node_modules/rimraf/bin.js b/tools/eslint/node_modules/rimraf/bin.js new file mode 100755 index 00000000000000..1bd5a0d16ac2bb --- /dev/null +++ b/tools/eslint/node_modules/rimraf/bin.js @@ -0,0 +1,40 @@ +#!/usr/bin/env node + +var rimraf = require('./') + +var help = false +var dashdash = false +var args = process.argv.slice(2).filter(function(arg) { + if (dashdash) + return !!arg + else if (arg === '--') + dashdash = true + else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) + help = true + else + return !!arg +}); + +if (help || args.length === 0) { + // If they didn't ask for help, then this is not a "success" + var log = help ? console.log : console.error + log('Usage: rimraf [ ...]') + log('') + log(' Deletes all files and folders at "path" recursively.') + log('') + log('Options:') + log('') + log(' -h, --help Display this usage info') + process.exit(help ? 0 : 1) +} else + go(0) + +function go (n) { + if (n >= args.length) + return + rimraf(args[n], function (er) { + if (er) + throw er + go(n+1) + }) +} diff --git a/tools/eslint/node_modules/rimraf/package.json b/tools/eslint/node_modules/rimraf/package.json new file mode 100644 index 00000000000000..ffab90b9b10a76 --- /dev/null +++ b/tools/eslint/node_modules/rimraf/package.json @@ -0,0 +1,91 @@ +{ + "_args": [ + [ + "rimraf@^2.2.8", + "/Users/silverwind/git/node/tools/package/package/node_modules/del" + ] + ], + "_from": "rimraf@>=2.2.8 <3.0.0", + "_id": "rimraf@2.5.2", + "_inCache": true, + "_installable": true, + "_location": "/rimraf", + "_nodeVersion": "5.6.0", + "_npmOperationalInternal": { + "host": "packages-6-west.internal.npmjs.com", + "tmp": "tmp/rimraf-2.5.2.tgz_1455346499772_0.9326622514054179" + }, + "_npmUser": { + "email": "i@izs.me", + "name": "isaacs" + }, + "_npmVersion": "3.7.0", + "_phantomChildren": {}, + "_requested": { + "name": "rimraf", + "raw": "rimraf@^2.2.8", + "rawSpec": "^2.2.8", + "scope": null, + "spec": ">=2.2.8 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/del" + ], + "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.2.tgz", + "_shasum": "62ba947fa4c0b4363839aefecd4f0fbad6059726", + "_shrinkwrap": null, + "_spec": "rimraf@^2.2.8", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/del", + "author": { + "email": "i@izs.me", + "name": "Isaac Z. Schlueter", + "url": "http://blog.izs.me/" + }, + "bin": { + "rimraf": "./bin.js" + }, + "bugs": { + "url": "https://github.com/isaacs/rimraf/issues" + }, + "dependencies": { + "glob": "^7.0.0" + }, + "description": "A deep deletion module for node (like `rm -rf`)", + "devDependencies": { + "mkdirp": "^0.5.1", + "tap": "^5.1.1" + }, + "directories": {}, + "dist": { + "shasum": "62ba947fa4c0b4363839aefecd4f0fbad6059726", + "tarball": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.2.tgz" + }, + "files": [ + "LICENSE", + "README.md", + "bin.js", + "rimraf.js" + ], + "gitHead": "f414f87021f88d004ac487eebc8d07ce6a152721", + "homepage": "https://github.com/isaacs/rimraf#readme", + "license": "ISC", + "main": "rimraf.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "rimraf", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/rimraf.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "2.5.2" +} diff --git a/tools/eslint/node_modules/rimraf/rimraf.js b/tools/eslint/node_modules/rimraf/rimraf.js new file mode 100644 index 00000000000000..c01d13b200cc5e --- /dev/null +++ b/tools/eslint/node_modules/rimraf/rimraf.js @@ -0,0 +1,335 @@ +module.exports = rimraf +rimraf.sync = rimrafSync + +var assert = require("assert") +var path = require("path") +var fs = require("fs") +var glob = require("glob") + +var defaultGlobOpts = { + nosort: true, + silent: true +} + +// for EMFILE handling +var timeout = 0 + +var isWindows = (process.platform === "win32") + +function defaults (options) { + var methods = [ + 'unlink', + 'chmod', + 'stat', + 'lstat', + 'rmdir', + 'readdir' + ] + methods.forEach(function(m) { + options[m] = options[m] || fs[m] + m = m + 'Sync' + options[m] = options[m] || fs[m] + }) + + options.maxBusyTries = options.maxBusyTries || 3 + options.emfileWait = options.emfileWait || 1000 + if (options.glob === false) { + options.disableGlob = true + } + options.disableGlob = options.disableGlob || false + options.glob = options.glob || defaultGlobOpts +} + +function rimraf (p, options, cb) { + if (typeof options === 'function') { + cb = options + options = {} + } + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert(options, 'rimraf: missing options') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + assert.equal(typeof cb, 'function', 'rimraf: callback function required') + + defaults(options) + + var busyTries = 0 + var errState = null + var n = 0 + + if (options.disableGlob || !glob.hasMagic(p)) + return afterGlob(null, [p]) + + fs.lstat(p, function (er, stat) { + if (!er) + return afterGlob(null, [p]) + + glob(p, options.glob, afterGlob) + }) + + function next (er) { + errState = errState || er + if (--n === 0) + cb(errState) + } + + function afterGlob (er, results) { + if (er) + return cb(er) + + n = results.length + if (n === 0) + return cb() + + results.forEach(function (p) { + rimraf_(p, options, function CB (er) { + if (er) { + if (isWindows && (er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && + busyTries < options.maxBusyTries) { + busyTries ++ + var time = busyTries * 100 + // try again, with the same exact callback as this one. + return setTimeout(function () { + rimraf_(p, options, CB) + }, time) + } + + // this one won't happen if graceful-fs is used. + if (er.code === "EMFILE" && timeout < options.emfileWait) { + return setTimeout(function () { + rimraf_(p, options, CB) + }, timeout ++) + } + + // already gone + if (er.code === "ENOENT") er = null + } + + timeout = 0 + next(er) + }) + }) + } +} + +// Two possible strategies. +// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR +// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR +// +// Both result in an extra syscall when you guess wrong. However, there +// are likely far more normal files in the world than directories. This +// is based on the assumption that a the average number of files per +// directory is >= 1. +// +// If anyone ever complains about this, then I guess the strategy could +// be made configurable somehow. But until then, YAGNI. +function rimraf_ (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + // sunos lets the root user unlink directories, which is... weird. + // so we have to lstat here and make sure it's not a dir. + options.lstat(p, function (er, st) { + if (er && er.code === "ENOENT") + return cb(null) + + if (st && st.isDirectory()) + return rmdir(p, options, er, cb) + + options.unlink(p, function (er) { + if (er) { + if (er.code === "ENOENT") + return cb(null) + if (er.code === "EPERM") + return (isWindows) + ? fixWinEPERM(p, options, er, cb) + : rmdir(p, options, er, cb) + if (er.code === "EISDIR") + return rmdir(p, options, er, cb) + } + return cb(er) + }) + }) +} + +function fixWinEPERM (p, options, er, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + if (er) + assert(er instanceof Error) + + options.chmod(p, 666, function (er2) { + if (er2) + cb(er2.code === "ENOENT" ? null : er) + else + options.stat(p, function(er3, stats) { + if (er3) + cb(er3.code === "ENOENT" ? null : er) + else if (stats.isDirectory()) + rmdir(p, options, er, cb) + else + options.unlink(p, cb) + }) + }) +} + +function fixWinEPERMSync (p, options, er) { + assert(p) + assert(options) + if (er) + assert(er instanceof Error) + + try { + options.chmodSync(p, 666) + } catch (er2) { + if (er2.code === "ENOENT") + return + else + throw er + } + + try { + var stats = options.statSync(p) + } catch (er3) { + if (er3.code === "ENOENT") + return + else + throw er + } + + if (stats.isDirectory()) + rmdirSync(p, options, er) + else + options.unlinkSync(p) +} + +function rmdir (p, options, originalEr, cb) { + assert(p) + assert(options) + if (originalEr) + assert(originalEr instanceof Error) + assert(typeof cb === 'function') + + // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) + // if we guessed wrong, and it's not a directory, then + // raise the original error. + options.rmdir(p, function (er) { + if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) + rmkids(p, options, cb) + else if (er && er.code === "ENOTDIR") + cb(originalEr) + else + cb(er) + }) +} + +function rmkids(p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.readdir(p, function (er, files) { + if (er) + return cb(er) + var n = files.length + if (n === 0) + return options.rmdir(p, cb) + var errState + files.forEach(function (f) { + rimraf(path.join(p, f), options, function (er) { + if (errState) + return + if (er) + return cb(errState = er) + if (--n === 0) + options.rmdir(p, cb) + }) + }) + }) +} + +// this looks simpler, and is strictly *faster*, but will +// tie up the JavaScript thread and fail on excessively +// deep directory trees. +function rimrafSync (p, options) { + options = options || {} + defaults(options) + + assert(p, 'rimraf: missing path') + assert.equal(typeof p, 'string', 'rimraf: path should be a string') + assert(options, 'rimraf: missing options') + assert.equal(typeof options, 'object', 'rimraf: options should be object') + + var results + + if (options.disableGlob || !glob.hasMagic(p)) { + results = [p] + } else { + try { + fs.lstatSync(p) + results = [p] + } catch (er) { + results = glob.sync(p, options.glob) + } + } + + if (!results.length) + return + + for (var i = 0; i < results.length; i++) { + var p = results[i] + + try { + var st = options.lstatSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + } + + try { + // sunos lets the root user unlink directories, which is... weird. + if (st && st.isDirectory()) + rmdirSync(p, options, null) + else + options.unlinkSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "EPERM") + return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) + if (er.code !== "EISDIR") + throw er + rmdirSync(p, options, er) + } + } +} + +function rmdirSync (p, options, originalEr) { + assert(p) + assert(options) + if (originalEr) + assert(originalEr instanceof Error) + + try { + options.rmdirSync(p) + } catch (er) { + if (er.code === "ENOENT") + return + if (er.code === "ENOTDIR") + throw originalEr + if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") + rmkidsSync(p, options) + } +} + +function rmkidsSync (p, options) { + assert(p) + assert(options) + options.readdirSync(p).forEach(function (f) { + rimrafSync(path.join(p, f), options) + }) + options.rmdirSync(p, options) +} diff --git a/tools/eslint/node_modules/run-async/LICENSE b/tools/eslint/node_modules/run-async/LICENSE new file mode 100644 index 00000000000000..e895e99b5eb96b --- /dev/null +++ b/tools/eslint/node_modules/run-async/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Simon Boudrias + +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/eslint/node_modules/run-async/README.md b/tools/eslint/node_modules/run-async/README.md new file mode 100644 index 00000000000000..c86374b23f5658 --- /dev/null +++ b/tools/eslint/node_modules/run-async/README.md @@ -0,0 +1,50 @@ +Run Async +========= + +[![npm](https://badge.fury.io/js/run-async.svg)](http://badge.fury.io/js/run-async) [![tests](https://travis-ci.org/SBoudrias/run-async.svg?branch=master)](http://travis-ci.org/SBoudrias/run-async) [![dependencies](https://david-dm.org/SBoudrias/run-async.svg?theme=shields.io)](https://david-dm.org/SBoudrias/run-async) + +Utility method to run function either synchronously or asynchronously using the common `this.async()` style. + +This is useful for library author accepting sync or async functions as parameter. `runAsync` will always run them as async method, and normalize the function handling. + +Installation +========= + +```bash +npm install --save run-async +``` + +Usage +========= + +```js +var runAsync = require('run-async'); + +// In Async mode: +var asyncFn = function (a) { + var done = this.async(); + + setTimeout(function () { + done('running: ' + a); + }, 10); +}; + +runAsync(asyncFn, function (answer) { + console.log(answer); // 'running: async' +}, 'async'); + +// In Sync mode: +var syncFn = function (a) { + return 'running: ' + a; +}; + +runAsync(asyncFn, function (answer) { + console.log(answer); // 'running: sync' +}, 'sync'); +``` + +Licence +======== + +Copyright (c) 2014 Simon Boudrias (twitter: @vaxilart) +Licensed under the MIT license. diff --git a/tools/eslint/node_modules/run-async/index.js b/tools/eslint/node_modules/run-async/index.js new file mode 100644 index 00000000000000..a47d677f90462a --- /dev/null +++ b/tools/eslint/node_modules/run-async/index.js @@ -0,0 +1,25 @@ +'use strict'; + +var once = require('once'); + +/** + * Run a function asynchronously or synchronously + * @param {Function} func Function to run + * @param {Function} cb Callback function passed the `func` returned value + * @...rest {Mixed} rest Arguments to pass to `func` + * @return {Null} + */ + +module.exports = function (func, cb) { + var async = false; + var answer = func.apply({ + async: function () { + async = true; + return once(cb); + } + }, Array.prototype.slice.call(arguments, 2) ); + + if (!async) { + cb(answer); + } +}; diff --git a/tools/eslint/node_modules/run-async/package.json b/tools/eslint/node_modules/run-async/package.json new file mode 100644 index 00000000000000..81fc26e0cfcb93 --- /dev/null +++ b/tools/eslint/node_modules/run-async/package.json @@ -0,0 +1,79 @@ +{ + "_args": [ + [ + "run-async@^0.1.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/inquirer" + ] + ], + "_from": "run-async@>=0.1.0 <0.2.0", + "_id": "run-async@0.1.0", + "_inCache": true, + "_installable": true, + "_location": "/run-async", + "_npmUser": { + "email": "admin@simonboudrias.com", + "name": "sboudrias" + }, + "_npmVersion": "1.4.6", + "_phantomChildren": {}, + "_requested": { + "name": "run-async", + "raw": "run-async@^0.1.0", + "rawSpec": "^0.1.0", + "scope": null, + "spec": ">=0.1.0 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/inquirer" + ], + "_resolved": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz", + "_shasum": "c8ad4a5e110661e402a7d21b530e009f25f8e389", + "_shrinkwrap": null, + "_spec": "run-async@^0.1.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/inquirer", + "author": { + "email": "admin@simonboudrias.com", + "name": "Simon Boudrias" + }, + "bugs": { + "url": "https://github.com/SBoudrias/run-async/issues" + }, + "dependencies": { + "once": "^1.3.0" + }, + "description": "Utility method to run function either synchronously or asynchronously using the common `this.async()` style.", + "devDependencies": { + "mocha": "^1.21.4" + }, + "directories": {}, + "dist": { + "shasum": "c8ad4a5e110661e402a7d21b530e009f25f8e389", + "tarball": "http://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz" + }, + "homepage": "https://github.com/SBoudrias/run-async", + "keywords": [ + "async", + "flow", + "flow-control" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "sboudrias", + "email": "admin@simonboudrias.com" + } + ], + "name": "run-async", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/SBoudrias/run-async.git" + }, + "scripts": { + "test": "mocha -R spec" + }, + "version": "0.1.0" +} diff --git a/tools/eslint/node_modules/rx-lite/package.json b/tools/eslint/node_modules/rx-lite/package.json new file mode 100644 index 00000000000000..7688ac0f2445c5 --- /dev/null +++ b/tools/eslint/node_modules/rx-lite/package.json @@ -0,0 +1,88 @@ +{ + "_args": [ + [ + "rx-lite@^3.1.2", + "/Users/silverwind/git/node/tools/package/package/node_modules/inquirer" + ] + ], + "_from": "rx-lite@>=3.1.2 <4.0.0", + "_id": "rx-lite@3.1.2", + "_inCache": true, + "_installable": true, + "_location": "/rx-lite", + "_nodeVersion": "0.12.7", + "_npmUser": { + "email": "matthew.podwysocki@gmail.com", + "name": "mattpodwysocki" + }, + "_npmVersion": "3.1.1", + "_phantomChildren": {}, + "_requested": { + "name": "rx-lite", + "raw": "rx-lite@^3.1.2", + "rawSpec": "^3.1.2", + "scope": null, + "spec": ">=3.1.2 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/inquirer" + ], + "_resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz", + "_shasum": "19ce502ca572665f3b647b10939f97fd1615f102", + "_shrinkwrap": null, + "_spec": "rx-lite@^3.1.2", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/inquirer", + "author": { + "name": "Cloud Programmability Team", + "url": "https://github.com/Reactive-Extensions/RxJS/blob/master/authors.txt" + }, + "browser": { + "index.js": "rx.lite.js" + }, + "bugs": { + "url": "https://github.com/Reactive-Extensions/RxJS/issues" + }, + "dependencies": {}, + "description": "Lightweight library for composing asynchronous and event-based operations in JavaScript", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "19ce502ca572665f3b647b10939f97fd1615f102", + "tarball": "http://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz" + }, + "homepage": "https://github.com/Reactive-Extensions/RxJS", + "jam": { + "main": "rx.lite.js" + }, + "keywords": [ + "Events", + "React", + "Reactive", + "Rx", + "RxJS" + ], + "licenses": [ + { + "type": "Apache License, Version 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + } + ], + "main": "rx.lite.js", + "maintainers": [ + { + "name": "mattpodwysocki", + "email": "matthew.podwysocki@gmail.com" + } + ], + "name": "rx-lite", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/Reactive-Extensions/RxJS.git" + }, + "scripts": {}, + "title": "Reactive Extensions for JavaScript (RxJS) Lite", + "version": "3.1.2" +} diff --git a/tools/eslint/node_modules/rx-lite/readme.md b/tools/eslint/node_modules/rx-lite/readme.md new file mode 100644 index 00000000000000..e4eb3dbba78518 --- /dev/null +++ b/tools/eslint/node_modules/rx-lite/readme.md @@ -0,0 +1,174 @@ +# RxJS Lite Module # + +The Reactive Extensions for JavaScript Lite version is a lightweight version of the Reactive Extensions for JavaScript which covers most of the day to day operators you might use all in a single library. Functionality such as bridging to events, promises, callbacks, Node.js-style callbacks, time-based operations and more are built right in. This comes with `rx.lite.js` which is for use in modern development environments such as > IE9 and server-side environments such as Node.js. + +## Getting Started + +There are a number of ways to get started with RxJS. + +### Installing with [NPM](https://npmjs.org/) + +```bash` +$ npm install rx-lite +$ npm install -g rx-lite +``` + +### Using with Node.js and Ringo.js + +```js +var Rx = require('rx-lite'); +``` + +### In a Browser: + +```html + + +``` + +## Included Observable Operators ## + +### `Observable Methods` +- [`catch | catchException`](../../doc/api/core/operators/catch.md) +- [`concat`](../../doc/api/core/operators/concat.md) +- [`create | createWithDisposable`](../../doc/api/core/operators/create.md) +- [`defer`](../../doc/api/core/operators/defer.md) +- [`empty`](../../doc/api/core/operators/empty.md) +- [`from`](../../doc/api/core/operators/from.md) +- [`fromArray`](../../doc/api/core/operators/fromarray.md) +- [`fromCallback`](../../doc/api/core/operators/fromcallback.md) +- [`fromEvent`](../../doc/api/core/operators/fromevent.md) +- [`fromEventPattern`](../../doc/api/core/operators/fromeventpattern.md) +- [`fromNodeCallback`](../../doc/api/core/operators/fromnodecallback.md) +- [`fromPromise`](../../doc/api/core/operators/frompromise.md) +- [`interval`](../../doc/api/core/operators/interval.md) +- [`just`](../../doc/api/core/operators/return.md) +- [`merge`](../../doc/api/core/operators/merge.md) +- [`mergeDelayError`](../../doc/api/core/operators/mergedelayerror.md) +- [`never`](../../doc/api/core/operators/never.md) +- [`of`](../../doc/api/core/operators/of.md) +- [`ofWithScheduler`](../../doc/api/core/operators/ofwithscheduler.md) +- [`range`](../../doc/api/core/operators/range.md) +- [`repeat`](../../doc/api/core/operators/repeat.md) +- [`return | returnValue`](../../doc/api/core/operators/return.md) +- [`throw | throwError | throwException`](../../doc/api/core/operators/throw.md) +- [`timer`](../../doc/api/core/operators/timer.md) +- [`zip`](../../doc/api/core/operators/zip.md) +- [`zipArray`](../../doc/api/core/operators/ziparray.md) + +### `Observable Instance Methods` +- [`asObservable`](../../doc/api/core/operators/asobservable.md) +- [`catch | catchException`](../../doc/api/core/operators/catchproto.md) +- [`combineLatest`](../../doc/api/core/operators/combinelatest.md) +- [`concat`](../../doc/api/core/operators/concatproto.md) +- [`concatMap`](../../doc/api/core/operators/concatmap.md) +- [`connect`](../../doc/api/core/operators/connect.md) +- [`debounce`](../../doc/api/core/operators/debounce.md) +- [`defaultIfEmpty`](../../doc/api/core/operators/defaultifempty.md) +- [`delay`](../../doc/api/core/operators/delay.md) +- [`dematerialize`](../../doc/api/core/operators/dematerialize.md) +- [`distinctUntilChanged`](../../doc/api/core/operators/distinctuntilchanged.md) +- [`do | doAction`](../../doc/api/core/operators/do.md) +- [`doOnNext`](../../doc/api/core/operators/doonnext.md) +- [`doOnError`](../../doc/api/core/operators/doonerror.md) +- [`doOnCompleted`](../../doc/api/core/operators/dooncompleted.md) +- [`filter`](../../doc/api/core/operators/where.md) +- [`finally | finallyAction`](../../doc/api/core/operators/finally.md) +- [`flatMap`](../../doc/api/core/operators/selectmany.md) +- [`flatMapLatest`](../../doc/api/core/operators/flatmaplatest.md) +- [`ignoreElements`](../../doc/api/core/operators/ignoreelements.md) +- [`map`](../../doc/api/core/operators/select.md) +- [`merge`](../../doc/api/core/operators/mergeproto.md) +- [`mergeObservable | mergeAll`](../../doc/api/core/operators/mergeall.md) +- [`multicast`](../../doc/api/core/operators/multicast.md) +- [`publish`](../../doc/api/core/operators/publish.md) +- [`publishLast`](../../doc/api/core/operators/publishlast.md) +- [`publishValue`](../../doc/api/core/operators/publishvalue.md) +- [`refCount`](../../doc/api/core/operators/refcount.md) +- [`repeat`](../../doc/api/core/operators/repeat.md) +- [`replay`](../../doc/api/core/operators/replay.md) +- [`retry`](../../doc/api/core/operators/retry.md) +- [`retryWhen`](../../doc/api/core/operators/retrywhen.md) +- [`sample`](../../doc/api/core/operators/sample.md) +- [`scan`](../../doc/api/core/operators/scan.md) +- [`select`](../../doc/api/core/operators/select.md) +- [`selectConcat`](../../doc/api/core/operators/concatmap.md) +- [`selectMany`](../../doc/api/core/operators/selectmany.md) +- [`selectSwitch`](../../doc/api/core/operators/flatmaplatest.md) +- [`singleInstance`](../../doc/api/core/operators/singleinstance.md) +- [`skip`](../../doc/api/core/operators/skip.md) +- [`skipLast`](../../doc/api/core/operators/skiplast.md) +- [`skipUntil`](../../doc/api/core/operators/skipuntil.md) +- [`skipWhile`](../../doc/api/core/operators/skipwhile.md) +- [`startWith`](../../doc/api/core/operators/startwith.md) +- [`subscribe | forEach`](../../doc/api/core/operators/subscribe.md) +- [`subscribeOnNext`](../../doc/api/core/operators/subscribeonnext.md) +- [`subscribeOnError`](../../doc/api/core/operators/subscribeonerror.md) +- [`subscribeOnCompleted`](../../doc/api/core/operators/subscribeoncompleted.md) +- [`switch | switchLatest`](../../doc/api/core/operators/switch.md) +- [`take`](../../doc/api/core/operators/take.md) +- [`takeLast`](../../doc/api/core/operators/takelast.md) +- [`takeUntil`](../../doc/api/core/operators/takeuntil.md) +- [`takeWhile`](../../doc/api/core/operators/takewhile.md) +- [`tap`](../../doc/api/core/operators/do.md) +- [`tapOnNext`](../../doc/api/core/operators/doonnext.md) +- [`tapOnError`](../../doc/api/core/operators/doonerror.md) +- [`tapOnCompleted`](../../doc/api/core/operators/dooncompleted.md) +- [`throttle`](../../doc/api/core/operators/throttle.md) +- [`throttleFirst`](../../doc/api/core/operators/throttlefirst.md) +- [`timeout`](../../doc/api/core/operators/timeout.md) +- [`timestamp`](../../doc/api/core/operators/timestamp.md) +- [`toArray`](../../doc/api/core/operators/toarray.md) +- [`transduce`](../../doc/api/core/operators/transduce.md) +- [`where`](../../doc/api/core/operators/where.md) +- [`withLatestFrom`](../../doc/api/core/operators/withlatestfrom.md) +- [`zip`](../../doc/api/core/operators/zipproto.md) + +## Included Classes ## + +### Core Objects +- [`Rx.Observer`](../../doc/api/core/observer.md) +- [`Rx.Notification`](../../doc/api/core/notification.md) + +### Subjects + +- [`Rx.AsyncSubject`](../../doc/api/subjects/asyncsubject.md) +- [`Rx.BehaviorSubject`](../../doc/api/subjects/behaviorsubject.md) +- [`Rx.ReplaySubject`](../../doc/api/subjects/replaysubject.md) +- [`Rx.Subject`](../../doc/api/subjects/subject.md) + +### Schedulers + +- [`Rx.Scheduler`](../../doc/api/schedulers/scheduler.md) + +### Disposables + +- [`Rx.CompositeDisposable`](../../doc/api/disposables/compositedisposable.md) +- [`Rx.Disposable`](../../doc/api/disposables/disposable.md) +- [`Rx.RefCountDisposable`](../../doc/api/disposables/refcountdisposable.md) +- [`Rx.SerialDisposable`](../../doc/api/disposables/serialdisposable.md) +- [`Rx.SingleAssignmentDisposable`](../../doc/api/disposables/singleassignmentdisposable.md) + +## Contributing ## + +There are lots of ways to contribute to the project, and we appreciate our [contributors](https://github.com/Reactive-Extensions/RxJS/wiki/Contributors). If you wish to contribute, check out our [style guide]((https://github.com/Reactive-Extensions/RxJS/tree/master/doc/contributing)). + +You can contribute by reviewing and sending feedback on code checkins, suggesting and trying out new features as they are implemented, submit bugs and help us verify fixes as they are checked in, as well as submit code fixes or code contributions of your own. Note that all code submissions will be rigorously reviewed and tested by the Rx Team, and only those that meet an extremely high bar for both quality and design/roadmap appropriateness will be merged into the source. + +## License ## + +Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +Microsoft Open Technologies would like to thank its contributors, a list +of whom are at https://github.com/Reactive-Extensions/RxJS/wiki/Contributors. + +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 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +implied. See the License for the specific language governing permissions +and limitations under the License. diff --git a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.js b/tools/eslint/node_modules/rx-lite/rx.lite.js similarity index 83% rename from tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.js rename to tools/eslint/node_modules/rx-lite/rx.lite.js index cecf40454c3518..e38d7a5defb2ac 100644 --- a/tools/eslint/node_modules/inquirer/node_modules/rx/dist/rx.lite.js +++ b/tools/eslint/node_modules/rx-lite/rx.lite.js @@ -3,46 +3,37 @@ ;(function (undefined) { var objectTypes = { - 'boolean': false, 'function': true, - 'object': true, - 'number': false, - 'string': false, - 'undefined': false + 'object': true }; - var root = (objectTypes[typeof window] && window) || this, + var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports, + freeSelf = objectTypes[typeof self] && self.Object && self, + freeWindow = objectTypes[typeof window] && window && window.Object && window, freeModule = objectTypes[typeof module] && module && !module.nodeType && module, moduleExports = freeModule && freeModule.exports === freeExports && freeExports, - freeGlobal = objectTypes[typeof global] && global; + freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global; - if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) { - root = freeGlobal; - } + var root = root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this; var Rx = { - internals: {}, - config: { - Promise: root.Promise - }, - helpers: { } + internals: {}, + config: { + Promise: root.Promise + }, + helpers: { } }; // Defaults var noop = Rx.helpers.noop = function () { }, - notDefined = Rx.helpers.notDefined = function (x) { return typeof x === 'undefined'; }, identity = Rx.helpers.identity = function (x) { return x; }, - pluck = Rx.helpers.pluck = function (property) { return function (x) { return x[property]; }; }, - just = Rx.helpers.just = function (value) { return function () { return value; }; }, defaultNow = Rx.helpers.defaultNow = Date.now, defaultComparer = Rx.helpers.defaultComparer = function (x, y) { return isEqual(x, y); }, defaultSubComparer = Rx.helpers.defaultSubComparer = function (x, y) { return x > y ? 1 : (x < y ? -1 : 0); }, defaultKeySerializer = Rx.helpers.defaultKeySerializer = function (x) { return x.toString(); }, defaultError = Rx.helpers.defaultError = function (err) { throw err; }, isPromise = Rx.helpers.isPromise = function (p) { return !!p && typeof p.subscribe !== 'function' && typeof p.then === 'function'; }, - asArray = Rx.helpers.asArray = function () { return Array.prototype.slice.call(arguments); }, - not = Rx.helpers.not = function (a) { return !a; }, isFunction = Rx.helpers.isFunction = (function () { var isFn = function (value) { @@ -65,45 +56,59 @@ return a; } - Rx.config.longStackSupport = false; - var hasStacks = false; - try { - throw new Error(); - } catch (e) { - hasStacks = !!e.stack; + var errorObj = {e: {}}; + function tryCatcherGen(tryCatchTarget) { + return function tryCatcher() { + try { + return tryCatchTarget.apply(this, arguments); + } catch (e) { + errorObj.e = e; + return errorObj; + } + } + } + var tryCatch = Rx.internals.tryCatch = function tryCatch(fn) { + if (!isFunction(fn)) { throw new TypeError('fn must be a function'); } + return tryCatcherGen(fn); } + function thrower(e) { + throw e; + } + + Rx.config.longStackSupport = false; + var hasStacks = false, stacks = tryCatch(function () { throw new Error(); })(); + hasStacks = !!stacks.e && !!stacks.e.stack; // All code after this point will be filtered from stack traces reported by RxJS var rStartingLine = captureLine(), rFileName; - var STACK_JUMP_SEPARATOR = "From previous event:"; + var STACK_JUMP_SEPARATOR = 'From previous event:'; function makeStackTraceLong(error, observable) { - // If possible, transform the error stack trace by removing Node and RxJS - // cruft, then concatenating with the stack trace of `observable`. - if (hasStacks && - observable.stack && - typeof error === "object" && - error !== null && - error.stack && - error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1 - ) { - var stacks = []; - for (var o = observable; !!o; o = o.source) { - if (o.stack) { - stacks.unshift(o.stack); - } + // If possible, transform the error stack trace by removing Node and RxJS + // cruft, then concatenating with the stack trace of `observable`. + if (hasStacks && + observable.stack && + typeof error === 'object' && + error !== null && + error.stack && + error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1 + ) { + var stacks = []; + for (var o = observable; !!o; o = o.source) { + if (o.stack) { + stacks.unshift(o.stack); } - stacks.unshift(error.stack); + } + stacks.unshift(error.stack); - var concatedStacks = stacks.join("\n" + STACK_JUMP_SEPARATOR + "\n"); - error.stack = filterStackString(concatedStacks); + var concatedStacks = stacks.join('\n' + STACK_JUMP_SEPARATOR + '\n'); + error.stack = filterStackString(concatedStacks); } } function filterStackString(stackString) { - var lines = stackString.split("\n"), - desiredLines = []; + var lines = stackString.split('\n'), desiredLines = []; for (var i = 0, len = lines.length; i < len; i++) { var line = lines[i]; @@ -111,7 +116,7 @@ desiredLines.push(line); } } - return desiredLines.join("\n"); + return desiredLines.join('\n'); } function isInternalFrame(stackLine) { @@ -127,8 +132,8 @@ } function isNodeFrame(stackLine) { - return stackLine.indexOf("(module.js:") !== -1 || - stackLine.indexOf("(node.js:") !== -1; + return stackLine.indexOf('(module.js:') !== -1 || + stackLine.indexOf('(node.js:') !== -1; } function captureLine() { @@ -137,8 +142,8 @@ try { throw new Error(); } catch (e) { - var lines = e.stack.split("\n"); - var firstLine = lines[0].indexOf("@") > 0 ? lines[1] : lines[2]; + var lines = e.stack.split('\n'); + var firstLine = lines[0].indexOf('@') > 0 ? lines[1] : lines[2]; var fileNameAndLineNumber = getFileNameAndLineNumber(firstLine); if (!fileNameAndLineNumber) { return; } @@ -148,48 +153,53 @@ } function getFileNameAndLineNumber(stackLine) { - // Named functions: "at functionName (filename:lineNumber:columnNumber)" + // Named functions: 'at functionName (filename:lineNumber:columnNumber)' var attempt1 = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(stackLine); if (attempt1) { return [attempt1[1], Number(attempt1[2])]; } - // Anonymous functions: "at filename:lineNumber:columnNumber" + // Anonymous functions: 'at filename:lineNumber:columnNumber' var attempt2 = /at ([^ ]+):(\d+):(?:\d+)$/.exec(stackLine); if (attempt2) { return [attempt2[1], Number(attempt2[2])]; } - // Firefox style: "function@filename:lineNumber or @filename:lineNumber" + // Firefox style: 'function@filename:lineNumber or @filename:lineNumber' var attempt3 = /.*@(.+):(\d+)$/.exec(stackLine); if (attempt3) { return [attempt3[1], Number(attempt3[2])]; } } var EmptyError = Rx.EmptyError = function() { this.message = 'Sequence contains no elements.'; + this.name = 'EmptyError'; Error.call(this); }; - EmptyError.prototype = Error.prototype; + EmptyError.prototype = Object.create(Error.prototype); var ObjectDisposedError = Rx.ObjectDisposedError = function() { this.message = 'Object has been disposed'; + this.name = 'ObjectDisposedError'; Error.call(this); }; - ObjectDisposedError.prototype = Error.prototype; + ObjectDisposedError.prototype = Object.create(Error.prototype); var ArgumentOutOfRangeError = Rx.ArgumentOutOfRangeError = function () { this.message = 'Argument out of range'; + this.name = 'ArgumentOutOfRangeError'; Error.call(this); }; - ArgumentOutOfRangeError.prototype = Error.prototype; + ArgumentOutOfRangeError.prototype = Object.create(Error.prototype); var NotSupportedError = Rx.NotSupportedError = function (message) { this.message = message || 'This operation is not supported'; + this.name = 'NotSupportedError'; Error.call(this); }; - NotSupportedError.prototype = Error.prototype; + NotSupportedError.prototype = Object.create(Error.prototype); var NotImplementedError = Rx.NotImplementedError = function (message) { this.message = message || 'This operation is not implemented'; + this.name = 'NotImplementedError'; Error.call(this); }; - NotImplementedError.prototype = Error.prototype; + NotImplementedError.prototype = Object.create(Error.prototype); var notImplemented = Rx.helpers.notImplemented = function () { throw new NotImplementedError(); @@ -530,29 +540,10 @@ return result; } - var errorObj = {e: {}}; - var tryCatchTarget; - function tryCatcher() { - try { - return tryCatchTarget.apply(this, arguments); - } catch (e) { - errorObj.e = e; - return errorObj; - } - } - function tryCatch(fn) { - if (!isFunction(fn)) { throw new TypeError('fn must be a function'); } - tryCatchTarget = fn; - return tryCatcher; - } - function thrower(e) { - throw e; - } - var hasProp = {}.hasOwnProperty, slice = Array.prototype.slice; - var inherits = this.inherits = Rx.internals.inherits = function (child, parent) { + var inherits = Rx.internals.inherits = function (child, parent) { function __() { this.constructor = child; } __.prototype = parent.prototype; child.prototype = new __(); @@ -583,92 +574,6 @@ return a; } - // Collections - function IndexedItem(id, value) { - this.id = id; - this.value = value; - } - - IndexedItem.prototype.compareTo = function (other) { - var c = this.value.compareTo(other.value); - c === 0 && (c = this.id - other.id); - return c; - }; - - // Priority Queue for Scheduling - var PriorityQueue = Rx.internals.PriorityQueue = function (capacity) { - this.items = new Array(capacity); - this.length = 0; - }; - - var priorityProto = PriorityQueue.prototype; - priorityProto.isHigherPriority = function (left, right) { - return this.items[left].compareTo(this.items[right]) < 0; - }; - - priorityProto.percolate = function (index) { - if (index >= this.length || index < 0) { return; } - var parent = index - 1 >> 1; - if (parent < 0 || parent === index) { return; } - if (this.isHigherPriority(index, parent)) { - var temp = this.items[index]; - this.items[index] = this.items[parent]; - this.items[parent] = temp; - this.percolate(parent); - } - }; - - priorityProto.heapify = function (index) { - +index || (index = 0); - if (index >= this.length || index < 0) { return; } - var left = 2 * index + 1, - right = 2 * index + 2, - first = index; - if (left < this.length && this.isHigherPriority(left, first)) { - first = left; - } - if (right < this.length && this.isHigherPriority(right, first)) { - first = right; - } - if (first !== index) { - var temp = this.items[index]; - this.items[index] = this.items[first]; - this.items[first] = temp; - this.heapify(first); - } - }; - - priorityProto.peek = function () { return this.items[0].value; }; - - priorityProto.removeAt = function (index) { - this.items[index] = this.items[--this.length]; - this.items[this.length] = undefined; - this.heapify(); - }; - - priorityProto.dequeue = function () { - var result = this.peek(); - this.removeAt(0); - return result; - }; - - priorityProto.enqueue = function (item) { - var index = this.length++; - this.items[index] = new IndexedItem(PriorityQueue.count++, item); - this.percolate(index); - }; - - priorityProto.remove = function (item) { - for (var i = 0; i < this.length; i++) { - if (this.items[i].value === item) { - this.removeAt(i); - return true; - } - } - return false; - }; - PriorityQueue.count = 0; - /** * Represents a group of disposable resources that are disposed together. * @constructor @@ -1021,51 +926,62 @@ function invokeRecImmediate(scheduler, pair) { var state = pair[0], action = pair[1], group = new CompositeDisposable(); + action(state, innerAction); + return group; - function recursiveAction(state1) { - action(state1, function (state2) { - var isAdded = false, isDone = false, - d = scheduler.scheduleWithState(state2, function (scheduler1, state3) { - if (isAdded) { - group.remove(d); - } else { - isDone = true; - } - recursiveAction(state3); - return disposableEmpty; - }); - if (!isDone) { - group.add(d); - isAdded = true; + function innerAction(state2) { + var isAdded = false, isDone = false; + + var d = scheduler.scheduleWithState(state2, scheduleWork); + if (!isDone) { + group.add(d); + isAdded = true; + } + + function scheduleWork(_, state3) { + if (isAdded) { + group.remove(d); + } else { + isDone = true; } - }); + action(state3, innerAction); + return disposableEmpty; + } } - recursiveAction(state); - return group; } function invokeRecDate(scheduler, pair, method) { var state = pair[0], action = pair[1], group = new CompositeDisposable(); - function recursiveAction(state1) { - action(state1, function (state2, dueTime1) { - var isAdded = false, isDone = false, - d = scheduler[method](state2, dueTime1, function (scheduler1, state3) { - if (isAdded) { - group.remove(d); - } else { - isDone = true; - } - recursiveAction(state3); - return disposableEmpty; - }); - if (!isDone) { - group.add(d); - isAdded = true; - } - }); - }; - recursiveAction(state); + action(state, innerAction); return group; + + function innerAction(state2, dueTime1) { + var isAdded = false, isDone = false; + + var d = scheduler[method](state2, dueTime1, scheduleWork); + if (!isDone) { + group.add(d); + isAdded = true; + } + + function scheduleWork(_, state3) { + if (isAdded) { + group.remove(d); + } else { + isDone = true; + } + action(state3, innerAction); + return disposableEmpty; + } + } + } + + function invokeRecDateRelative(s, p) { + return invokeRecDate(s, p, 'scheduleWithRelativeAndState'); + } + + function invokeRecDateAbsolute(s, p) { + return invokeRecDate(s, p, 'scheduleWithAbsoluteAndState'); } function scheduleInnerRecursive(action, self) { @@ -1109,9 +1025,7 @@ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithRelativeAndState = function (state, dueTime, action) { - return this._scheduleRelative([state, action], dueTime, function (s, p) { - return invokeRecDate(s, p, 'scheduleWithRelativeAndState'); - }); + return this._scheduleRelative([state, action], dueTime, invokeRecDateRelative); }; /** @@ -1132,9 +1046,7 @@ * @returns {Disposable} The disposable object used to cancel the scheduled action (best effort). */ schedulerProto.scheduleRecursiveWithAbsoluteAndState = function (state, dueTime, action) { - return this._scheduleAbsolute([state, action], dueTime, function (s, p) { - return invokeRecDate(s, p, 'scheduleWithAbsoluteAndState'); - }); + return this._scheduleAbsolute([state, action], dueTime, invokeRecDateAbsolute); }; }(Scheduler.prototype)); @@ -1180,7 +1092,7 @@ function runTrampoline () { while (queue.length > 0) { - var item = queue.dequeue(); + var item = queue.shift(); !item.isCancelled() && item.invoke(); } } @@ -1189,14 +1101,13 @@ var si = new ScheduledItem(this, state, action, this.now()); if (!queue) { - queue = new PriorityQueue(4); - queue.enqueue(si); + queue = [si]; var result = tryCatch(runTrampoline)(); queue = null; if (result === errorObj) { return thrower(result.e); } } else { - queue.enqueue(si); + queue.push(si); } return si.disposable; } @@ -1543,7 +1454,6 @@ */ function AbstractObserver() { this.isStopped = false; - __super__.call(this); } // Must be implemented by other observers @@ -1556,7 +1466,7 @@ * @param {Any} value Next element in the sequence. */ AbstractObserver.prototype.onNext = function (value) { - if (!this.isStopped) { this.next(value); } + !this.isStopped && this.next(value); }; /** @@ -1583,9 +1493,7 @@ /** * Disposes the observer, causing it to transition to the stopped state. */ - AbstractObserver.prototype.dispose = function () { - this.isStopped = true; - }; + AbstractObserver.prototype.dispose = function () { this.isStopped = true; }; AbstractObserver.prototype.fail = function (e) { if (!this.isStopped) { @@ -1652,25 +1560,23 @@ */ var Observable = Rx.Observable = (function () { - function Observable(subscribe) { - if (Rx.config.longStackSupport && hasStacks) { - try { - throw new Error(); - } catch (e) { - this.stack = e.stack.substring(e.stack.indexOf("\n") + 1); - } - - var self = this; - this._subscribe = function (observer) { - var oldOnError = observer.onError.bind(observer); + function makeSubscribe(self, subscribe) { + return function (o) { + var oldOnError = o.onError; + o.onError = function (e) { + makeStackTraceLong(e, self); + oldOnError.call(o, e); + }; - observer.onError = function (err) { - makeStackTraceLong(err, self); - oldOnError(err); - }; + return subscribe.call(self, o); + }; + } - return subscribe.call(self, observer); - }; + function Observable(subscribe) { + if (Rx.config.longStackSupport && hasStacks) { + var e = tryCatch(thrower)(new Error()).e; + this.stack = e.stack.substring(e.stack.indexOf('\n') + 1); + this._subscribe = makeSubscribe(this, subscribe); } else { this._subscribe = subscribe; } @@ -1679,16 +1585,25 @@ observableProto = Observable.prototype; /** - * Subscribes an observer to the observable sequence. - * @param {Mixed} [observerOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence. + * Determines whether the given object is an Observable + * @param {Any} An object to determine whether it is an Observable + * @returns {Boolean} true if an Observable, else false. + */ + Observable.isObservable = function (o) { + return o && isFunction(o.subscribe); + } + + /** + * Subscribes an o to the observable sequence. + * @param {Mixed} [oOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence. * @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. * @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. * @returns {Diposable} A disposable handling the subscriptions and unsubscriptions. */ - observableProto.subscribe = observableProto.forEach = function (observerOrOnNext, onError, onCompleted) { - return this._subscribe(typeof observerOrOnNext === 'object' ? - observerOrOnNext : - observerCreate(observerOrOnNext, onError, onCompleted)); + observableProto.subscribe = observableProto.forEach = function (oOrOnNext, onError, onCompleted) { + return this._subscribe(typeof oOrOnNext === 'object' ? + oOrOnNext : + observerCreate(oOrOnNext, onError, onCompleted)); }; /** @@ -1753,13 +1668,13 @@ }; ScheduledObserver.prototype.ensureActive = function () { - var isOwner = false, parent = this; + var isOwner = false; if (!this.hasFaulted && this.queue.length > 0) { isOwner = !this.isAcquired; this.isAcquired = true; } if (isOwner) { - this.disposable.setDisposable(this.scheduler.scheduleRecursive(function (self) { + this.disposable.setDisposable(this.scheduler.scheduleRecursiveWithState(this, function (parent, self) { var work; if (parent.queue.length > 0) { work = parent.queue.shift(); @@ -1767,14 +1682,13 @@ parent.isAcquired = false; return; } - try { - work(); - } catch (ex) { + var res = tryCatch(work)(); + if (res === errorObj) { parent.queue = []; parent.hasFaulted = true; - throw ex; + return thrower(res.e); } - self(); + self(parent); })); } }; @@ -1825,6 +1739,70 @@ return ObservableBase; }(Observable)); +var FlatMapObservable = (function(__super__){ + + inherits(FlatMapObservable, __super__); + + function FlatMapObservable(source, selector, resultSelector, thisArg) { + this.resultSelector = Rx.helpers.isFunction(resultSelector) ? + resultSelector : null; + + this.selector = Rx.internals.bindCallback(Rx.helpers.isFunction(selector) ? selector : function() { return selector; }, thisArg, 3); + this.source = source; + + __super__.call(this); + + } + + FlatMapObservable.prototype.subscribeCore = function(o) { + return this.source.subscribe(new InnerObserver(o, this.selector, this.resultSelector, this)); + }; + + function InnerObserver(observer, selector, resultSelector, source) { + this.i = 0; + this.selector = selector; + this.resultSelector = resultSelector; + this.source = source; + this.isStopped = false; + this.o = observer; + } + + InnerObserver.prototype._wrapResult = function(result, x, i) { + return this.resultSelector ? + result.map(function(y, i2) { return this.resultSelector(x, y, i, i2); }, this) : + result; + }; + + InnerObserver.prototype.onNext = function(x) { + + if (this.isStopped) return; + + var i = this.i++; + var result = tryCatch(this.selector)(x, i, this.source); + + if (result === errorObj) { + return this.o.onError(result.e); + } + + Rx.helpers.isPromise(result) && (result = Rx.Observable.fromPromise(result)); + (Rx.helpers.isArrayLike(result) || Rx.helpers.isIterable(result)) && (result = Rx.Observable.from(result)); + + this.o.onNext(this._wrapResult(result, x, i)); + + }; + + InnerObserver.prototype.onError = function(e) { + if(!this.isStopped) { this.isStopped = true; this.o.onError(e); } + }; + + InnerObserver.prototype.onCompleted = function() { + if (!this.isStopped) {this.isStopped = true; this.o.onCompleted(); } + }; + + return FlatMapObservable; + +}(ObservableBase)); + var Enumerable = Rx.internals.Enumerable = function () { }; var ConcatEnumerableObservable = (function(__super__) { @@ -1833,7 +1811,7 @@ this.sources = sources; __super__.call(this); } - + ConcatEnumerableObservable.prototype.subscribeCore = function (o) { var isDisposed, subscription = new SerialDisposable(); var cancelable = immediateScheduler.scheduleRecursiveWithState(this.sources[$iterator$](), function (e, self) { @@ -1858,7 +1836,7 @@ isDisposed = true; })); }; - + function InnerObserver(o, s, e) { this.o = o; this.s = s; @@ -1887,21 +1865,21 @@ } return false; }; - + return ConcatEnumerableObservable; }(ObservableBase)); Enumerable.prototype.concat = function () { return new ConcatEnumerableObservable(this); }; - + var CatchErrorObservable = (function(__super__) { inherits(CatchErrorObservable, __super__); function CatchErrorObservable(sources) { this.sources = sources; __super__.call(this); } - + CatchErrorObservable.prototype.subscribeCore = function (o) { var e = this.sources[$iterator$](); @@ -1930,7 +1908,7 @@ isDisposed = true; })); }; - + return CatchErrorObservable; }(ObservableBase)); @@ -1991,18 +1969,18 @@ })); }); }; - + var RepeatEnumerable = (function (__super__) { inherits(RepeatEnumerable, __super__); - + function RepeatEnumerable(v, c) { this.v = v; this.c = c == null ? -1 : c; } RepeatEnumerable.prototype[$iterator$] = function () { - return new RepeatEnumerator(this); + return new RepeatEnumerator(this); }; - + function RepeatEnumerator(p) { this.v = p.v; this.l = p.c; @@ -2010,16 +1988,16 @@ RepeatEnumerator.prototype.next = function () { if (this.l === 0) { return doneEnumerator; } if (this.l > 0) { this.l--; } - return { done: false, value: this.v }; + return { done: false, value: this.v }; }; - + return RepeatEnumerable; }(Enumerable)); var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) { return new RepeatEnumerable(value, repeatCount); }; - + var OfEnumerable = (function(__super__) { inherits(OfEnumerable, __super__); function OfEnumerable(s, fn, thisArg) { @@ -2029,7 +2007,7 @@ OfEnumerable.prototype[$iterator$] = function () { return new OfEnumerator(this); }; - + function OfEnumerator(p) { this.i = -1; this.s = p.s; @@ -2039,9 +2017,9 @@ OfEnumerator.prototype.next = function () { return ++this.i < this.l ? { done: false, value: !this.fn ? this.s[this.i] : this.fn(this.s[this.i], this.i, this.s) } : - doneEnumerator; + doneEnumerator; }; - + return OfEnumerable; }(Enumerable)); @@ -2086,7 +2064,7 @@ this.o.onError(e); return true; } - + return false; }; @@ -2110,7 +2088,7 @@ * @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable. * @returns {Observable} The observable sequence with the specified implementation for the Subscribe method. */ - Observable.create = Observable.createWithDisposable = function (subscribe, parent) { + Observable.create = function (subscribe, parent) { return new AnonymousObservable(subscribe, parent); }; @@ -2143,26 +2121,29 @@ } EmptyObservable.prototype.subscribeCore = function (observer) { - var sink = new EmptySink(observer, this); + var sink = new EmptySink(observer, this.scheduler); return sink.run(); }; - function EmptySink(observer, parent) { + function EmptySink(observer, scheduler) { this.observer = observer; - this.parent = parent; + this.scheduler = scheduler; } function scheduleItem(s, state) { state.onCompleted(); + return disposableEmpty; } EmptySink.prototype.run = function () { - return this.parent.scheduler.scheduleWithState(this.observer, scheduleItem); + return this.scheduler.scheduleWithState(this.observer, scheduleItem); }; return EmptyObservable; }(ObservableBase)); + var EMPTY_OBSERVABLE = new EmptyObservable(immediateScheduler); + /** * Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message. * @@ -2174,7 +2155,7 @@ */ var observableEmpty = Observable.empty = function (scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); - return new EmptyObservable(scheduler); + return scheduler === immediateScheduler ? EMPTY_OBSERVABLE : new EmptyObservable(scheduler); }; var FromObservable = (function(__super__) { @@ -2186,8 +2167,8 @@ __super__.call(this); } - FromObservable.prototype.subscribeCore = function (observer) { - var sink = new FromSink(observer, this); + FromObservable.prototype.subscribeCore = function (o) { + var sink = new FromSink(o, this); return sink.run(); }; @@ -2195,38 +2176,30 @@ }(ObservableBase)); var FromSink = (function () { - function FromSink(observer, parent) { - this.observer = observer; + function FromSink(o, parent) { + this.o = o; this.parent = parent; } FromSink.prototype.run = function () { var list = Object(this.parent.iterable), it = getIterable(list), - observer = this.observer, + o = this.o, mapper = this.parent.mapper; function loopRecursive(i, recurse) { - try { - var next = it.next(); - } catch (e) { - return observer.onError(e); - } - if (next.done) { - return observer.onCompleted(); - } + var next = tryCatch(it.next).call(it); + if (next === errorObj) { return o.onError(next.e); } + if (next.done) { return o.onCompleted(); } var result = next.value; - if (mapper) { - try { - result = mapper(result, i); - } catch (e) { - return observer.onError(e); - } + if (isFunction(mapper)) { + result = tryCatch(mapper)(result, i); + if (result === errorObj) { return o.onError(result.e); } } - observer.onNext(result); + o.onNext(result); recurse(i + 1); } @@ -2238,7 +2211,7 @@ var maxSafeInteger = Math.pow(2, 53) - 1; - function StringIterable(str) { + function StringIterable(s) { this._s = s; } @@ -2246,7 +2219,7 @@ return new StringIterator(this._s); }; - function StringIterator(str) { + function StringIterator(s) { this._s = s; this._l = s.length; this._i = 0; @@ -2401,12 +2374,14 @@ return NeverObservable; }(ObservableBase)); + var NEVER_OBSERVABLE = new NeverObservable(); + /** * Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins). * @returns {Observable} An observable sequence whose observers will never get called. */ var observableNever = Observable.never = function () { - return new NeverObservable(); + return NEVER_OBSERVABLE; }; function observableOf (scheduler, array) { @@ -2592,23 +2567,28 @@ } JustObservable.prototype.subscribeCore = function (observer) { - var sink = new JustSink(observer, this); + var sink = new JustSink(observer, this.value, this.scheduler); return sink.run(); }; - function JustSink(observer, parent) { + function JustSink(observer, value, scheduler) { this.observer = observer; - this.parent = parent; + this.value = value; + this.scheduler = scheduler; } function scheduleItem(s, state) { var value = state[0], observer = state[1]; observer.onNext(value); observer.onCompleted(); + return disposableEmpty; } JustSink.prototype.run = function () { - return this.parent.scheduler.scheduleWithState([this.parent.value, this.observer], scheduleItem); + var state = [this.value, this.observer]; + return this.scheduler === immediateScheduler ? + scheduleItem(null, state) : + this.scheduler.scheduleWithState(state, scheduleItem); }; return JustObservable; @@ -2621,7 +2601,7 @@ * @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} An observable sequence containing the single specified element. */ - var observableReturn = Observable['return'] = Observable.just = Observable.returnValue = function (value, scheduler) { + var observableReturn = Observable['return'] = Observable.just = function (value, scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); return new JustObservable(value, scheduler); }; @@ -2663,44 +2643,51 @@ * @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate. * @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object. */ - var observableThrow = Observable['throw'] = Observable.throwError = Observable.throwException = function (error, scheduler) { + var observableThrow = Observable['throw'] = function (error, scheduler) { isScheduler(scheduler) || (scheduler = immediateScheduler); return new ThrowObservable(error, scheduler); }; + var CatchObserver = (function(__super__) { + inherits(CatchObserver, __super__); + function CatchObserver(o, s, fn) { + this._o = o; + this._s = s; + this._fn = fn; + __super__.call(this); + } + + CatchObserver.prototype.next = function (x) { this._o.onNext(x); }; + CatchObserver.prototype.completed = function () { return this._o.onCompleted(); }; + CatchObserver.prototype.error = function (e) { + var result = tryCatch(this._fn)(e); + if (result === errorObj) { return this._o.onError(result.e); } + isPromise(result) && (result = observableFromPromise(result)); + + var d = new SingleAssignmentDisposable(); + this._s.setDisposable(d); + d.setDisposable(result.subscribe(this._o)); + }; + + return CatchObserver; + }(AbstractObserver)); + function observableCatchHandler(source, handler) { return new AnonymousObservable(function (o) { var d1 = new SingleAssignmentDisposable(), subscription = new SerialDisposable(); subscription.setDisposable(d1); - d1.setDisposable(source.subscribe(function (x) { o.onNext(x); }, function (e) { - try { - var result = handler(e); - } catch (ex) { - return o.onError(ex); - } - isPromise(result) && (result = observableFromPromise(result)); - - var d = new SingleAssignmentDisposable(); - subscription.setDisposable(d); - d.setDisposable(result.subscribe(o)); - }, function (x) { o.onCompleted(x); })); - + d1.setDisposable(source.subscribe(new CatchObserver(o, subscription, handler))); return subscription; }, source); } /** * Continues an observable sequence that is terminated by an exception with the next observable sequence. - * @example - * 1 - xs.catchException(ys) - * 2 - xs.catchException(function (ex) { return ys(ex); }) * @param {Mixed} handlerOrSecond Exception handler function that returns an observable sequence given the error that occurred in the first sequence, or a second observable sequence used to produce results when an error occurred in the first sequence. * @returns {Observable} An observable sequence containing the first sequence's elements, followed by the elements of the handler sequence in case an exception occurred. */ - observableProto['catch'] = observableProto.catchError = observableProto.catchException = function (handlerOrSecond) { - return typeof handlerOrSecond === 'function' ? - observableCatchHandler(this, handlerOrSecond) : - observableCatch([this, handlerOrSecond]); + observableProto['catch'] = function (handlerOrSecond) { + return isFunction(handlerOrSecond) ? observableCatchHandler(this, handlerOrSecond) : observableCatch([this, handlerOrSecond]); }; /** @@ -2708,12 +2695,14 @@ * @param {Array | Arguments} args Arguments or an array to use as the next sequence if an error occurs. * @returns {Observable} An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully. */ - var observableCatch = Observable.catchError = Observable['catch'] = Observable.catchException = function () { - var items = []; + var observableCatch = Observable['catch'] = function () { + var items; if (Array.isArray(arguments[0])) { items = arguments[0]; } else { - for(var i = 0, len = arguments.length; i < len; i++) { items.push(arguments[i]); } + var len = arguments.length; + items = new Array(len); + for(var i = 0; i < len; i++) { items[i] = arguments[i]; } } return enumerableOf(items).catchError(); }; @@ -2738,6 +2727,13 @@ return combineLatest.apply(this, args); }; + function falseFactory() { return false; } + function argumentsToArray() { + var len = arguments.length, args = new Array(len); + for(var i = 0; i < len; i++) { args[i] = arguments[i]; } + return args; + } + /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element. * @@ -2749,12 +2745,11 @@ var combineLatest = Observable.combineLatest = function () { var len = arguments.length, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i]; } - var resultSelector = args.pop(); + var resultSelector = isFunction(args[len - 1]) ? args.pop() : argumentsToArray; Array.isArray(args[0]) && (args = args[0]); return new AnonymousObservable(function (o) { var n = args.length, - falseFactory = function () { return false; }, hasValue = arrayInitialize(n, falseFactory), hasValueAll = false, isDone = arrayInitialize(n, falseFactory), @@ -2809,18 +2804,18 @@ return observableConcat.apply(null, args); }; - var ConcatObservable = (function(__super__) { - inherits(ConcatObservable, __super__); - function ConcatObservable(sources) { - this.sources = sources; - __super__.call(this); - } - - ConcatObservable.prototype.subscribeCore = function(o) { + var ConcatObservable = (function(__super__) { + inherits(ConcatObservable, __super__); + function ConcatObservable(sources) { + this.sources = sources; + __super__.call(this); + } + + ConcatObservable.prototype.subscribeCore = function(o) { var sink = new ConcatSink(this.sources, o); return sink.run(); - }; - + }; + function ConcatSink(sources, o) { this.sources = sources; this.o = o; @@ -2830,9 +2825,9 @@ var cancelable = immediateScheduler.scheduleRecursiveWithState(0, function (i, self) { if (isDisposed) { return; } if (i === length) { - return o.onCompleted(); - } - + return o.onCompleted(); + } + // Check if promise var currentValue = sources[i]; isPromise(currentValue) && (currentValue = observableFromPromise(currentValue)); @@ -2850,11 +2845,11 @@ isDisposed = true; })); }; - - - return ConcatObservable; - }(ObservableBase)); - + + + return ConcatObservable; + }(ObservableBase)); + /** * Concatenates all the observable sequences. * @param {Array | Arguments} args Arguments or an array to concat to the observable sequence. @@ -2875,7 +2870,7 @@ * Concatenates an observable sequence of observable sequences. * @returns {Observable} An observable sequence that contains the elements of each observed inner sequence, in sequential order. */ - observableProto.concatAll = observableProto.concatObservable = function () { + observableProto.concatAll = function () { return this.merge(1); }; @@ -3124,7 +3119,7 @@ m.setDisposable(this.source.subscribe(new MergeAllObserver(observer, g))); return g; }; - + function MergeAllObserver(o, g) { this.o = o; this.g = g; @@ -3138,7 +3133,7 @@ isPromise(innerSource) && (innerSource = observableFromPromise(innerSource)); - sad.setDisposable(innerSource.subscribe(new InnerObserver(this, this.g, sad))); + sad.setDisposable(innerSource.subscribe(new InnerObserver(this, sad))); }; MergeAllObserver.prototype.onError = function (e) { if(!this.isStopped) { @@ -3164,9 +3159,8 @@ return false; }; - function InnerObserver(parent, g, sad) { + function InnerObserver(parent, sad) { this.parent = parent; - this.g = g; this.sad = sad; this.isStopped = false; } @@ -3203,7 +3197,7 @@ * Merges an observable sequence of observable sequences into an observable sequence. * @returns {Observable} The observable sequence that merges the elements of the inner sequences. */ - observableProto.mergeAll = observableProto.mergeObservable = function () { + observableProto.mergeAll = function () { return new MergeAllObservable(this); }; @@ -3436,24 +3430,13 @@ }, this); }; - function zipArray(second, resultSelector) { - var first = this; - return new AnonymousObservable(function (o) { - var index = 0, len = second.length; - return first.subscribe(function (left) { - if (index < len) { - var right = second[index++], res = tryCatch(resultSelector)(left, right); - if (res === errorObj) { return o.onError(res.e); } - o.onNext(res); - } else { - o.onCompleted(); - } - }, function (e) { o.onError(e); }, function () { o.onCompleted(); }); - }, first); - } - function falseFactory() { return false; } function emptyArrayFactory() { return []; } + function argumentsToArray() { + var len = arguments.length, args = new Array(len); + for(var i = 0; i < len; i++) { args[i] = arguments[i]; } + return args; + } /** * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index. @@ -3461,11 +3444,14 @@ * @returns {Observable} An observable sequence containing the result of combining elements of the args using the specified result selector function. */ observableProto.zip = function () { - if (Array.isArray(arguments[0])) { return zipArray.apply(this, arguments); } + if (arguments.length === 0) { throw new Error('invalid arguments'); } + var len = arguments.length, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i]; } + var resultSelector = isFunction(args[len - 1]) ? args.pop() : argumentsToArray; + Array.isArray(args[0]) && (args = args[0]); - var parent = this, resultSelector = args.pop(); + var parent = this; args.unshift(parent); return new AnonymousObservable(function (o) { var n = args.length, @@ -3476,7 +3462,9 @@ for (var idx = 0; idx < n; idx++) { (function (i) { var source = args[i], sad = new SingleAssignmentDisposable(); + isPromise(source) && (source = observableFromPromise(source)); + sad.setDisposable(source.subscribe(function (x) { queues[i].push(x); if (queues.every(function (x) { return x.length > 0; })) { @@ -3508,127 +3496,175 @@ Observable.zip = function () { var len = arguments.length, args = new Array(len); for(var i = 0; i < len; i++) { args[i] = arguments[i]; } + if (Array.isArray(args[0])) { + args = isFunction(args[1]) ? args[0].concat(args[1]) : args[0]; + } var first = args.shift(); return first.zip.apply(first, args); }; - function falseFactory() { return false; } - function arrayFactory() { return []; } +function falseFactory() { return false; } +function emptyArrayFactory() { return []; } +function argumentsToArray() { + var len = arguments.length, args = new Array(len); + for(var i = 0; i < len; i++) { args[i] = arguments[i]; } + return args; +} + +/** + * Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index. + * The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the args. + * @returns {Observable} An observable sequence containing the result of combining elements of the args using the specified result selector function. + */ +observableProto.zipIterable = function () { + if (arguments.length === 0) { throw new Error('invalid arguments'); } + + var len = arguments.length, args = new Array(len); + for(var i = 0; i < len; i++) { args[i] = arguments[i]; } + var resultSelector = isFunction(args[len - 1]) ? args.pop() : argumentsToArray; + + var parent = this; + args.unshift(parent); + return new AnonymousObservable(function (o) { + var n = args.length, + queues = arrayInitialize(n, emptyArrayFactory), + isDone = arrayInitialize(n, falseFactory); + + var subscriptions = new Array(n); + for (var idx = 0; idx < n; idx++) { + (function (i) { + var source = args[i], sad = new SingleAssignmentDisposable(); + + (isArrayLike(source) || isIterable(source)) && (source = observableFrom(source)); + + sad.setDisposable(source.subscribe(function (x) { + queues[i].push(x); + if (queues.every(function (x) { return x.length > 0; })) { + var queuedValues = queues.map(function (x) { return x.shift(); }), + res = tryCatch(resultSelector).apply(parent, queuedValues); + if (res === errorObj) { return o.onError(res.e); } + o.onNext(res); + } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { + o.onCompleted(); + } + }, function (e) { o.onError(e); }, function () { + isDone[i] = true; + isDone.every(identity) && o.onCompleted(); + })); + subscriptions[i] = sad; + })(idx); + } + + return new CompositeDisposable(subscriptions); + }, parent); +}; + + function asObservable(source) { + return function subscribe(o) { return source.subscribe(o); }; + } /** - * Merges the specified observable sequences into one observable sequence by emitting a list with the elements of the observable sequences at corresponding indexes. - * @param arguments Observable sources. - * @returns {Observable} An observable sequence containing lists of elements at corresponding indexes. + * Hides the identity of an observable sequence. + * @returns {Observable} An observable sequence that hides the identity of the source sequence. */ - Observable.zipArray = function () { - var sources; - if (Array.isArray(arguments[0])) { - sources = arguments[0]; - } else { - var len = arguments.length; - sources = new Array(len); - for(var i = 0; i < len; i++) { sources[i] = arguments[i]; } - } + observableProto.asObservable = function () { + return new AnonymousObservable(asObservable(this), this); + }; + + /** + * Dematerializes the explicit notification values of an observable sequence as implicit notifications. + * @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values. + */ + observableProto.dematerialize = function () { + var source = this; return new AnonymousObservable(function (o) { - var n = sources.length, - queues = arrayInitialize(n, arrayFactory), - isDone = arrayInitialize(n, falseFactory); + return source.subscribe(function (x) { return x.accept(o); }, function(e) { o.onError(e); }, function () { o.onCompleted(); }); + }, this); + }; - var subscriptions = new Array(n); - for (var idx = 0; idx < n; idx++) { - (function (i) { - subscriptions[i] = new SingleAssignmentDisposable(); - subscriptions[i].setDisposable(sources[i].subscribe(function (x) { - queues[i].push(x); - if (queues.every(function (x) { return x.length > 0; })) { - var res = queues.map(function (x) { return x.shift(); }); - o.onNext(res); - } else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) { - return o.onCompleted(); - } - }, function (e) { o.onError(e); }, function () { - isDone[i] = true; - isDone.every(identity) && o.onCompleted(); - })); - })(idx); - } + var DistinctUntilChangedObservable = (function(__super__) { + inherits(DistinctUntilChangedObservable, __super__); + function DistinctUntilChangedObservable(source, keyFn, comparer) { + this.source = source; + this.keyFn = keyFn; + this.comparer = comparer; + __super__.call(this); + } - return new CompositeDisposable(subscriptions); - }); - }; + DistinctUntilChangedObservable.prototype.subscribeCore = function (o) { + return this.source.subscribe(new DistinctUntilChangedObserver(o, this.keyFn, this.comparer)); + }; - /** - * Hides the identity of an observable sequence. - * @returns {Observable} An observable sequence that hides the identity of the source sequence. - */ - observableProto.asObservable = function () { - var source = this; - return new AnonymousObservable(function (o) { return source.subscribe(o); }, source); - }; + return DistinctUntilChangedObservable; + }(ObservableBase)); - /** - * Dematerializes the explicit notification values of an observable sequence as implicit notifications. - * @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values. - */ - observableProto.dematerialize = function () { - var source = this; - return new AnonymousObservable(function (o) { - return source.subscribe(function (x) { return x.accept(o); }, function(e) { o.onError(e); }, function () { o.onCompleted(); }); - }, this); - }; + var DistinctUntilChangedObserver = (function(__super__) { + inherits(DistinctUntilChangedObserver, __super__); + function DistinctUntilChangedObserver(o, keyFn, comparer) { + this.o = o; + this.keyFn = keyFn; + this.comparer = comparer; + this.hasCurrentKey = false; + this.currentKey = null; + __super__.call(this); + } + + DistinctUntilChangedObserver.prototype.next = function (x) { + var key = x, comparerEquals; + if (isFunction(this.keyFn)) { + key = tryCatch(this.keyFn)(x); + if (key === errorObj) { return this.o.onError(key.e); } + } + if (this.hasCurrentKey) { + comparerEquals = tryCatch(this.comparer)(this.currentKey, key); + if (comparerEquals === errorObj) { return this.o.onError(comparerEquals.e); } + } + if (!this.hasCurrentKey || !comparerEquals) { + this.hasCurrentKey = true; + this.currentKey = key; + this.o.onNext(x); + } + }; + DistinctUntilChangedObserver.prototype.error = function(e) { + this.o.onError(e); + }; + DistinctUntilChangedObserver.prototype.completed = function () { + this.o.onCompleted(); + }; + + return DistinctUntilChangedObserver; + }(AbstractObserver)); /** - * Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer. - * - * var obs = observable.distinctUntilChanged(); - * var obs = observable.distinctUntilChanged(function (x) { return x.id; }); - * var obs = observable.distinctUntilChanged(function (x) { return x.id; }, function (x, y) { return x === y; }); - * - * @param {Function} [keySelector] A function to compute the comparison key for each element. If not provided, it projects the value. - * @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function. - * @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence. - */ - observableProto.distinctUntilChanged = function (keySelector, comparer) { - var source = this; + * Returns an observable sequence that contains only distinct contiguous elements according to the keyFn and the comparer. + * @param {Function} [keyFn] A function to compute the comparison key for each element. If not provided, it projects the value. + * @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function. + * @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence. + */ + observableProto.distinctUntilChanged = function (keyFn, comparer) { comparer || (comparer = defaultComparer); - return new AnonymousObservable(function (o) { - var hasCurrentKey = false, currentKey; - return source.subscribe(function (value) { - var key = value; - if (keySelector) { - key = tryCatch(keySelector)(value); - if (key === errorObj) { return o.onError(key.e); } - } - if (hasCurrentKey) { - var comparerEquals = tryCatch(comparer)(currentKey, key); - if (comparerEquals === errorObj) { return o.onError(comparerEquals.e); } - } - if (!hasCurrentKey || !comparerEquals) { - hasCurrentKey = true; - currentKey = key; - o.onNext(value); - } - }, function (e) { o.onError(e); }, function () { o.onCompleted(); }); - }, this); + return new DistinctUntilChangedObservable(this, keyFn, comparer); }; var TapObservable = (function(__super__) { inherits(TapObservable,__super__); function TapObservable(source, observerOrOnNext, onError, onCompleted) { this.source = source; - this.t = !observerOrOnNext || isFunction(observerOrOnNext) ? - observerCreate(observerOrOnNext || noop, onError || noop, onCompleted || noop) : - observerOrOnNext; + this._oN = observerOrOnNext; + this._oE = onError; + this._oC = onCompleted; __super__.call(this); } TapObservable.prototype.subscribeCore = function(o) { - return this.source.subscribe(new InnerObserver(o, this.t)); + return this.source.subscribe(new InnerObserver(o, this)); }; - function InnerObserver(o, t) { + function InnerObserver(o, p) { this.o = o; - this.t = t; + this.t = !p._oN || isFunction(p._oN) ? + observerCreate(p._oN || noop, p._oE || noop, p._oC || noop) : + p._oN; this.isStopped = false; } InnerObserver.prototype.onNext = function(x) { @@ -3716,36 +3752,22 @@ * @param {Function} finallyAction Action to invoke after the source observable sequence terminates. * @returns {Observable} Source sequence with the action-invoking termination behavior applied. */ - observableProto['finally'] = observableProto.ensure = function (action) { + observableProto['finally'] = function (action) { var source = this; return new AnonymousObservable(function (observer) { - var subscription; - try { - subscription = source.subscribe(observer); - } catch (e) { + var subscription = tryCatch(source.subscribe).call(source, observer); + if (subscription === errorObj) { action(); - throw e; + return thrower(subscription.e); } return disposableCreate(function () { - try { - subscription.dispose(); - } catch (e) { - throw e; - } finally { - action(); - } + var r = tryCatch(subscription.dispose).call(subscription); + action(); + r === errorObj && thrower(r.e); }); }, this); }; - /** - * @deprecated use #finally or #ensure instead. - */ - observableProto.finallyAction = function (action) { - //deprecate('finallyAction', 'finally or ensure'); - return this.ensure(action); - }; - var IgnoreElementsObservable = (function(__super__) { inherits(IgnoreElementsObservable, __super__); @@ -3840,7 +3862,7 @@ }; /** - * Repeats the source observable sequence upon error each time the notifier emits or until it successfully terminates. + * Repeats the source observable sequence upon error each time the notifier emits or until it successfully terminates. * if the notifier completes, the observable sequence completes. * * @example @@ -3862,15 +3884,15 @@ __super__.call(this); } - ScanObservable.prototype.subscribeCore = function(observer) { - return this.source.subscribe(new ScanObserver(observer,this)); + ScanObservable.prototype.subscribeCore = function(o) { + return this.source.subscribe(new InnerObserver(o,this)); }; return ScanObservable; }(ObservableBase)); - function ScanObserver(observer, parent) { - this.observer = observer; + function InnerObserver(o, parent) { + this.o = o; this.accumulator = parent.accumulator; this.hasSeed = parent.hasSeed; this.seed = parent.seed; @@ -3879,42 +3901,41 @@ this.hasValue = false; this.isStopped = false; } - ScanObserver.prototype.onNext = function (x) { - if (this.isStopped) { return; } - !this.hasValue && (this.hasValue = true); - try { + InnerObserver.prototype = { + onNext: function (x) { + if (this.isStopped) { return; } + !this.hasValue && (this.hasValue = true); if (this.hasAccumulation) { - this.accumulation = this.accumulator(this.accumulation, x); + this.accumulation = tryCatch(this.accumulator)(this.accumulation, x); } else { - this.accumulation = this.hasSeed ? this.accumulator(this.seed, x) : x; + this.accumulation = this.hasSeed ? tryCatch(this.accumulator)(this.seed, x) : x; this.hasAccumulation = true; } - } catch (e) { - return this.observer.onError(e); - } - this.observer.onNext(this.accumulation); - }; - ScanObserver.prototype.onError = function (e) { - if (!this.isStopped) { - this.isStopped = true; - this.observer.onError(e); - } - }; - ScanObserver.prototype.onCompleted = function () { - if (!this.isStopped) { - this.isStopped = true; - !this.hasValue && this.hasSeed && this.observer.onNext(this.seed); - this.observer.onCompleted(); - } - }; - ScanObserver.prototype.dispose = function() { this.isStopped = true; }; - ScanObserver.prototype.fail = function (e) { - if (!this.isStopped) { - this.isStopped = true; - this.observer.onError(e); - return true; + if (this.accumulation === errorObj) { return this.o.onError(this.accumulation.e); } + this.o.onNext(this.accumulation); + }, + onError: function (e) { + if (!this.isStopped) { + this.isStopped = true; + this.o.onError(e); + } + }, + onCompleted: function () { + if (!this.isStopped) { + this.isStopped = true; + !this.hasValue && this.hasSeed && this.o.onNext(this.seed); + this.o.onCompleted(); + } + }, + dispose: function() { this.isStopped = true; }, + fail: function (e) { + if (!this.isStopped) { + this.isStopped = true; + this.o.onError(e); + return true; + } + return false; } - return false; }; /** @@ -3925,13 +3946,10 @@ * @returns {Observable} An observable sequence containing the accumulated values. */ observableProto.scan = function () { - var hasSeed = false, seed, accumulator, source = this; + var hasSeed = false, seed, accumulator = arguments[0]; if (arguments.length === 2) { hasSeed = true; - seed = arguments[0]; - accumulator = arguments[1]; - } else { - accumulator = arguments[0]; + seed = arguments[1]; } return new ScanObservable(this, accumulator, hasSeed, seed); }; @@ -3999,52 +4017,9 @@ }, source); }; - function concatMap(source, selector, thisArg) { - var selectorFunc = bindCallback(selector, thisArg, 3); - return source.map(function (x, i) { - var result = selectorFunc(x, i, source); - isPromise(result) && (result = observableFromPromise(result)); - (isArrayLike(result) || isIterable(result)) && (result = observableFrom(result)); - return result; - }).concatAll(); - } - - /** - * One of the Following: - * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. - * - * @example - * var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }); - * Or: - * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence. - * - * var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; }); - * Or: - * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence. - * - * var res = source.concatMap(Rx.Observable.fromArray([1,2,3])); - * @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the - * source sequence onto which could be either an observable or Promise. - * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence. - * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element. - */ - observableProto.selectConcat = observableProto.concatMap = function (selector, resultSelector, thisArg) { - if (isFunction(selector) && isFunction(resultSelector)) { - return this.concatMap(function (x, i) { - var selectorResult = selector(x, i); - isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult)); - (isArrayLike(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult)); - - return selectorResult.map(function (y, i2) { - return resultSelector(x, y, i, i2); - }); - }); - } - return isFunction(selector) ? - concatMap(this, selector, thisArg) : - concatMap(this, function () { return selector; }); - }; - +observableProto.flatMapConcat = observableProto.concatMap = function(selector, resultSelector, thisArg) { + return new FlatMapObservable(this, selector, resultSelector, thisArg).merge(1); +}; var MapObservable = (function (__super__) { inherits(MapObservable, __super__); @@ -4053,7 +4028,7 @@ this.selector = bindCallback(selector, thisArg, 3); __super__.call(this); } - + function innerMap(selector, self) { return function (x, i, o) { return selector.call(this, self.selector(x, i, o), i, o); } } @@ -4065,7 +4040,7 @@ MapObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new InnerObserver(o, this.selector, this)); }; - + function InnerObserver(o, selector, source) { this.o = o; this.selector = selector; @@ -4073,13 +4048,11 @@ this.i = 0; this.isStopped = false; } - + InnerObserver.prototype.onNext = function(x) { if (this.isStopped) { return; } var result = tryCatch(this.selector)(x, this.i++, this.source); - if (result === errorObj) { - return this.o.onError(result.e); - } + if (result === errorObj) { return this.o.onError(result.e); } this.o.onNext(result); }; InnerObserver.prototype.onError = function (e) { @@ -4095,7 +4068,7 @@ this.o.onError(e); return true; } - + return false; }; @@ -4116,16 +4089,8 @@ new MapObservable(this, selectorFn, thisArg); }; - /** - * Retrieves the value of a specified nested property from all elements in - * the Observable sequence. - * @param {Arguments} arguments The nested properties to pluck. - * @returns {Observable} Returns a new Observable sequence of property values. - */ - observableProto.pluck = function () { - var args = arguments, len = arguments.length; - if (len === 0) { throw new Error('List of properties cannot be empty.'); } - return this.map(function (x) { + function plucker(args, len) { + return function mapper(x) { var currentProp = x; for (var i = 0; i < len; i++) { var p = currentProp[args[i]]; @@ -4136,67 +4101,36 @@ } } return currentProp; - }); - }; - - function flatMap(source, selector, thisArg) { - var selectorFunc = bindCallback(selector, thisArg, 3); - return source.map(function (x, i) { - var result = selectorFunc(x, i, source); - isPromise(result) && (result = observableFromPromise(result)); - (isArrayLike(result) || isIterable(result)) && (result = observableFrom(result)); - return result; - }).mergeAll(); + } } /** - * One of the Following: - * Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. - * - * @example - * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }); - * Or: - * Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence. - * - * var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; }); - * Or: - * Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence. - * - * var res = source.selectMany(Rx.Observable.fromArray([1,2,3])); - * @param {Function} selector A transform function to apply to each element or an observable sequence to project each element from the source sequence onto which could be either an observable or Promise. - * @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence. - * @param {Any} [thisArg] Object to use as this when executing callback. - * @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element. + * Retrieves the value of a specified nested property from all elements in + * the Observable sequence. + * @param {Arguments} arguments The nested properties to pluck. + * @returns {Observable} Returns a new Observable sequence of property values. */ - observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector, thisArg) { - if (isFunction(selector) && isFunction(resultSelector)) { - return this.flatMap(function (x, i) { - var selectorResult = selector(x, i); - isPromise(selectorResult) && (selectorResult = observableFromPromise(selectorResult)); - (isArrayLike(selectorResult) || isIterable(selectorResult)) && (selectorResult = observableFrom(selectorResult)); - - return selectorResult.map(function (y, i2) { - return resultSelector(x, y, i, i2); - }); - }, thisArg); - } - return isFunction(selector) ? - flatMap(this, selector, thisArg) : - flatMap(this, function () { return selector; }); + observableProto.pluck = function () { + var len = arguments.length, args = new Array(len); + if (len === 0) { throw new Error('List of properties cannot be empty.'); } + for(var i = 0; i < len; i++) { args[i] = arguments[i]; } + return this.map(plucker(args, len)); }; - /** - * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then - * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. - * @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. - * @param {Any} [thisArg] Object to use as this when executing callback. - * @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences - * and that at any point in time produces the elements of the most recent inner observable sequence that has been received. - */ - observableProto.selectSwitch = observableProto.flatMapLatest = observableProto.switchMap = function (selector, thisArg) { - return this.select(selector, thisArg).switchLatest(); - }; +observableProto.flatMap = observableProto.selectMany = function(selector, resultSelector, thisArg) { + return new FlatMapObservable(this, selector, resultSelector, thisArg).mergeAll(); +}; + + +// +//Rx.Observable.prototype.flatMapWithMaxConcurrent = function(limit, selector, resultSelector, thisArg) { +// return new FlatMapObservable(this, selector, resultSelector, thisArg).merge(limit); +//}; +// +Rx.Observable.prototype.flatMapLatest = function(selector, resultSelector, thisArg) { + return new FlatMapObservable(this, selector, resultSelector, thisArg).switchLatest(); +}; var SkipObservable = (function(__super__) { inherits(SkipObservable, __super__); function SkipObservable(source, count) { @@ -4204,11 +4138,11 @@ this.skipCount = count; __super__.call(this); } - + SkipObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new InnerObserver(o, this.skipCount)); }; - + function InnerObserver(o, c) { this.c = c; this.r = c; @@ -4217,7 +4151,7 @@ } InnerObserver.prototype.onNext = function (x) { if (this.isStopped) { return; } - if (this.r <= 0) { + if (this.r <= 0) { this.o.onNext(x); } else { this.r--; @@ -4238,10 +4172,10 @@ } return false; }; - + return SkipObservable; - }(ObservableBase)); - + }(ObservableBase)); + /** * Bypasses a specified number of elements in an observable sequence and then returns the remaining elements. * @param {Number} count The number of elements to skip before returning the remaining elements. @@ -4346,7 +4280,7 @@ FilterObservable.prototype.subscribeCore = function (o) { return this.source.subscribe(new InnerObserver(o, this.predicate, this)); }; - + function innerPredicate(predicate, self) { return function(x, i, o) { return self.predicate(x, i, o) && predicate.call(this, x, i, o); } } @@ -4354,7 +4288,7 @@ FilterObservable.prototype.internalFilter = function(predicate, thisArg) { return new FilterObservable(this.source, innerPredicate(predicate, this), thisArg); }; - + function InnerObserver(o, predicate, source) { this.o = o; this.predicate = predicate; @@ -4362,7 +4296,7 @@ this.i = 0; this.isStopped = false; } - + InnerObserver.prototype.onNext = function(x) { if (this.isStopped) { return; } var shouldYield = tryCatch(this.predicate)(x, this.i++, this.source); @@ -4402,116 +4336,128 @@ new FilterObservable(this, predicate, thisArg); }; - /** - * Converts a callback function to an observable sequence. - * - * @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence. - * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined. - * @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next. - * @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array. - */ - Observable.fromCallback = function (func, context, selector) { - return function () { - var len = arguments.length, args = new Array(len) - for(var i = 0; i < len; i++) { args[i] = arguments[i]; } +function createCbObservable(fn, ctx, selector, args) { + var o = new AsyncSubject(); - return new AnonymousObservable(function (observer) { - function handler() { - var len = arguments.length, results = new Array(len); - for(var i = 0; i < len; i++) { results[i] = arguments[i]; } - - if (selector) { - try { - results = selector.apply(context, results); - } catch (e) { - return observer.onError(e); - } + args.push(createCbHandler(o, ctx, selector)); + fn.apply(ctx, args); - observer.onNext(results); - } else { - if (results.length <= 1) { - observer.onNext.apply(observer, results); - } else { - observer.onNext(results); - } - } + return o.asObservable(); +} - observer.onCompleted(); - } +function createCbHandler(o, ctx, selector) { + return function handler () { + var len = arguments.length, results = new Array(len); + for(var i = 0; i < len; i++) { results[i] = arguments[i]; } - args.push(handler); - func.apply(context, args); - }).publishLast().refCount(); - }; + if (isFunction(selector)) { + results = tryCatch(selector).apply(ctx, results); + if (results === errorObj) { return o.onError(results.e); } + o.onNext(results); + } else { + if (results.length <= 1) { + o.onNext(results[0]); + } else { + o.onNext(results); + } + } + + o.onCompleted(); }; +} - /** - * Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format. - * @param {Function} func The function to call - * @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined. - * @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next. - * @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array. - */ - Observable.fromNodeCallback = function (func, context, selector) { - return function () { - var len = arguments.length, args = new Array(len); - for(var i = 0; i < len; i++) { args[i] = arguments[i]; } +/** + * Converts a callback function to an observable sequence. + * + * @param {Function} fn Function with a callback as the last parameter to convert to an Observable sequence. + * @param {Mixed} [ctx] The context for the func parameter to be executed. If not specified, defaults to undefined. + * @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next. + * @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array. + */ +Observable.fromCallback = function (fn, ctx, selector) { + return function () { + typeof ctx === 'undefined' && (ctx = this); - return new AnonymousObservable(function (observer) { - function handler(err) { - if (err) { - observer.onError(err); - return; - } + var len = arguments.length, args = new Array(len) + for(var i = 0; i < len; i++) { args[i] = arguments[i]; } + return createCbObservable(fn, ctx, selector, args); + }; +}; - var len = arguments.length, results = []; - for(var i = 1; i < len; i++) { results[i - 1] = arguments[i]; } +function createNodeObservable(fn, ctx, selector, args) { + var o = new AsyncSubject(); - if (selector) { - try { - results = selector.apply(context, results); - } catch (e) { - return observer.onError(e); - } - observer.onNext(results); - } else { - if (results.length <= 1) { - observer.onNext.apply(observer, results); - } else { - observer.onNext(results); - } - } + args.push(createNodeHandler(o, ctx, selector)); + fn.apply(ctx, args); - observer.onCompleted(); - } + return o.asObservable(); +} - args.push(handler); - func.apply(context, args); - }).publishLast().refCount(); - }; - }; +function createNodeHandler(o, ctx, selector) { + return function handler () { + var err = arguments[0]; + if (err) { return o.onError(err); } - function createListener (element, name, handler) { - if (element.addEventListener) { - element.addEventListener(name, handler, false); - return disposableCreate(function () { - element.removeEventListener(name, handler, false); - }); + var len = arguments.length, results = []; + for(var i = 1; i < len; i++) { results[i - 1] = arguments[i]; } + + if (isFunction(selector)) { + var results = tryCatch(selector).apply(ctx, results); + if (results === errorObj) { return o.onError(results.e); } + o.onNext(results); + } else { + if (results.length <= 1) { + o.onNext(results[0]); + } else { + o.onNext(results); + } } - throw new Error('No listener found'); + + o.onCompleted(); + }; +} + +/** + * Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format. + * @param {Function} fn The function to call + * @param {Mixed} [ctx] The context for the func parameter to be executed. If not specified, defaults to undefined. + * @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next. + * @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array. + */ +Observable.fromNodeCallback = function (fn, ctx, selector) { + return function () { + typeof ctx === 'undefined' && (ctx = this); + var len = arguments.length, args = new Array(len); + for(var i = 0; i < len; i++) { args[i] = arguments[i]; } + return createNodeObservable(fn, ctx, selector, args); + }; +}; + + function ListenDisposable(e, n, fn) { + this._e = e; + this._n = n; + this._fn = fn; + this._e.addEventListener(this._n, this._fn, false); + this.isDisposed = false; } + ListenDisposable.prototype.dispose = function () { + if (!this.isDisposed) { + this._e.removeEventListener(this._n, this._fn, false); + this.isDisposed = true; + } + }; function createEventListener (el, eventName, handler) { var disposables = new CompositeDisposable(); // Asume NodeList or HTMLCollection - var toStr = Object.prototype.toString; - if (toStr.call(el) === '[object NodeList]' || toStr.call(el) === '[object HTMLCollection]') { + var elemToString = Object.prototype.toString.call(el); + if (elemToString === '[object NodeList]' || elemToString === '[object HTMLCollection]') { for (var i = 0, len = el.length; i < len; i++) { disposables.add(createEventListener(el.item(i), eventName, handler)); } } else if (el) { - disposables.add(createListener(el, eventName, handler)); + disposables.add(new ListenDisposable(el, eventName, handler)); } return disposables; @@ -4522,12 +4468,19 @@ */ Rx.config.useNativeEvents = false; + function eventHandler(o, selector) { + return function handler () { + var results = arguments[0]; + if (isFunction(selector)) { + results = tryCatch(selector).apply(null, arguments); + if (results === errorObj) { return o.onError(results.e); } + } + o.onNext(results); + }; + } + /** * Creates an observable sequence by adding an event listener to the matching DOMElement or each item in the NodeList. - * - * @example - * var source = Rx.Observable.fromEvent(element, 'mouseup'); - * * @param {Object} element The DOMElement or NodeList to attach a listener. * @param {String} eventName The event name to attach the observable sequence. * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next. @@ -4552,23 +4505,12 @@ selector); } } - return new AnonymousObservable(function (observer) { + + return new AnonymousObservable(function (o) { return createEventListener( element, eventName, - function handler (e) { - var results = e; - - if (selector) { - try { - results = selector(arguments); - } catch (err) { - return observer.onError(err); - } - } - - observer.onNext(results); - }); + eventHandler(o, selector)); }).publish().refCount(); }; @@ -4577,57 +4519,54 @@ * @param {Function} addHandler The function to add a handler to the emitter. * @param {Function} [removeHandler] The optional function to remove a handler from an emitter. * @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next. + * @param {Scheduler} [scheduler] A scheduler used to schedule the remove handler. * @returns {Observable} An observable sequence which wraps an event from an event emitter */ - var fromEventPattern = Observable.fromEventPattern = function (addHandler, removeHandler, selector) { - return new AnonymousObservable(function (observer) { - function innerHandler (e) { - var result = e; - if (selector) { - try { - result = selector(arguments); - } catch (err) { - return observer.onError(err); - } + var fromEventPattern = Observable.fromEventPattern = function (addHandler, removeHandler, selector, scheduler) { + isScheduler(scheduler) || (scheduler = immediateScheduler); + return new AnonymousObservable(function (o) { + function innerHandler () { + var result = arguments[0]; + if (isFunction(selector)) { + result = tryCatch(selector).apply(null, arguments); + if (result === errorObj) { return o.onError(result.e); } } - observer.onNext(result); + o.onNext(result); } var returnValue = addHandler(innerHandler); return disposableCreate(function () { - if (removeHandler) { - removeHandler(innerHandler, returnValue); - } + isFunction(removeHandler) && removeHandler(innerHandler, returnValue); }); }).publish().refCount(); }; - var FromPromiseObservable = (function(__super__) { - inherits(FromPromiseObservable, __super__); - function FromPromiseObservable(p) { - this.p = p; - __super__.call(this); - } - - FromPromiseObservable.prototype.subscribeCore = function(o) { - this.p.then(function (data) { - o.onNext(data); - o.onCompleted(); - }, function (err) { o.onError(err); }); - return disposableEmpty; - }; - - return FromPromiseObservable; - }(ObservableBase)); - - /** - * Converts a Promise to an Observable sequence - * @param {Promise} An ES6 Compliant promise. - * @returns {Observable} An Observable sequence which wraps the existing promise success and failure. - */ - var observableFromPromise = Observable.fromPromise = function (promise) { - return new FromPromiseObservable(promise); - }; + var FromPromiseObservable = (function(__super__) { + inherits(FromPromiseObservable, __super__); + function FromPromiseObservable(p) { + this.p = p; + __super__.call(this); + } + + FromPromiseObservable.prototype.subscribeCore = function(o) { + this.p.then(function (data) { + o.onNext(data); + o.onCompleted(); + }, function (err) { o.onError(err); }); + return disposableEmpty; + }; + + return FromPromiseObservable; + }(ObservableBase)); + + /** + * Converts a Promise to an Observable sequence + * @param {Promise} An ES6 Compliant promise. + * @returns {Observable} An Observable sequence which wraps the existing promise success and failure. + */ + var observableFromPromise = Observable.fromPromise = function (promise) { + return new FromPromiseObservable(promise); + }; /* * Converts an existing observable sequence to an ES6 Compatible Promise * @example @@ -4919,7 +4858,7 @@ var observableTimer = Observable.timer = function (dueTime, periodOrScheduler, scheduler) { var period; isScheduler(scheduler) || (scheduler = timeoutScheduler); - if (periodOrScheduler !== undefined && typeof periodOrScheduler === 'number') { + if (periodOrScheduler != null && typeof periodOrScheduler === 'number') { period = periodOrScheduler; } else if (isScheduler(periodOrScheduler)) { scheduler = periodOrScheduler; @@ -4928,16 +4867,15 @@ return observableTimerDate(dueTime.getTime(), scheduler); } if (dueTime instanceof Date && period !== undefined) { - period = periodOrScheduler; - return observableTimerDateAndPeriod(dueTime.getTime(), period, scheduler); + return observableTimerDateAndPeriod(dueTime.getTime(), periodOrScheduler, scheduler); } return period === undefined ? observableTimerTimeSpan(dueTime, scheduler) : observableTimerTimeSpanAndPeriod(dueTime, period, scheduler); }; - function observableDelayTimeSpan(source, dueTime, scheduler) { - return new AnonymousObservable(function (observer) { + function observableDelayRelative(source, dueTime, scheduler) { + return new AnonymousObservable(function (o) { var active = false, cancelable = new SerialDisposable(), exception = null, @@ -4958,7 +4896,7 @@ } if (shouldRun) { if (exception !== null) { - observer.onError(exception); + o.onError(exception); } else { d = new SingleAssignmentDisposable(); cancelable.setDisposable(d); @@ -4974,7 +4912,7 @@ result = q.shift().value; } if (result !== null) { - result.accept(observer); + result.accept(o); } } while (result !== null); shouldRecurse = false; @@ -4988,7 +4926,7 @@ e = exception; running = false; if (e !== null) { - observer.onError(e); + o.onError(e); } else if (shouldRecurse) { self(recurseDueTime); } @@ -5000,42 +4938,91 @@ }, source); } - function observableDelayDate(source, dueTime, scheduler) { + function observableDelayAbsolute(source, dueTime, scheduler) { return observableDefer(function () { - return observableDelayTimeSpan(source, dueTime - scheduler.now(), scheduler); + return observableDelayRelative(source, dueTime - scheduler.now(), scheduler); }); } + function delayWithSelector(source, subscriptionDelay, delayDurationSelector) { + var subDelay, selector; + if (isFunction(subscriptionDelay)) { + selector = subscriptionDelay; + } else { + subDelay = subscriptionDelay; + selector = delayDurationSelector; + } + return new AnonymousObservable(function (o) { + var delays = new CompositeDisposable(), atEnd = false, subscription = new SerialDisposable(); + + function start() { + subscription.setDisposable(source.subscribe( + function (x) { + var delay = tryCatch(selector)(x); + if (delay === errorObj) { return o.onError(delay.e); } + var d = new SingleAssignmentDisposable(); + delays.add(d); + d.setDisposable(delay.subscribe( + function () { + o.onNext(x); + delays.remove(d); + done(); + }, + function (e) { o.onError(e); }, + function () { + o.onNext(x); + delays.remove(d); + done(); + } + )); + }, + function (e) { o.onError(e); }, + function () { + atEnd = true; + subscription.dispose(); + done(); + } + )); + } + + function done () { + atEnd && delays.length === 0 && o.onCompleted(); + } + + if (!subDelay) { + start(); + } else { + subscription.setDisposable(subDelay.subscribe(start, function (e) { o.onError(e); }, start)); + } + + return new CompositeDisposable(subscription, delays); + }, this); + } + /** - * Time shifts the observable sequence by dueTime. The relative time intervals between the values are preserved. + * Time shifts the observable sequence by dueTime. + * The relative time intervals between the values are preserved. * - * @example - * 1 - res = Rx.Observable.delay(new Date()); - * 2 - res = Rx.Observable.delay(new Date(), Rx.Scheduler.timeout); - * - * 3 - res = Rx.Observable.delay(5000); - * 4 - res = Rx.Observable.delay(5000, 1000, Rx.Scheduler.timeout); - * @memberOf Observable# * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) by which to shift the observable sequence. * @param {Scheduler} [scheduler] Scheduler to run the delay timers on. If not specified, the timeout scheduler is used. * @returns {Observable} Time-shifted sequence. */ - observableProto.delay = function (dueTime, scheduler) { - isScheduler(scheduler) || (scheduler = timeoutScheduler); - return dueTime instanceof Date ? - observableDelayDate(this, dueTime.getTime(), scheduler) : - observableDelayTimeSpan(this, dueTime, scheduler); + observableProto.delay = function () { + if (typeof arguments[0] === 'number' || arguments[0] instanceof Date) { + var dueTime = arguments[0], scheduler = arguments[1]; + isScheduler(scheduler) || (scheduler = timeoutScheduler); + return dueTime instanceof Date ? + observableDelayAbsolute(this, dueTime, scheduler) : + observableDelayRelative(this, dueTime, scheduler); + } else if (isFunction(arguments[0])) { + return delayWithSelector(this, arguments[0], arguments[1]); + } else { + throw new Error('Invalid arguments'); + } }; - /** - * Ignores values from an observable sequence which are followed by another value before dueTime. - * @param {Number} dueTime Duration of the debounce period for each value (specified as an integer denoting milliseconds). - * @param {Scheduler} [scheduler] Scheduler to run the debounce timers on. If not specified, the timeout scheduler is used. - * @returns {Observable} The debounced sequence. - */ - observableProto.debounce = observableProto.throttleWithTimeout = function (dueTime, scheduler) { + function debounce(source, dueTime, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); - var source = this; return new AnonymousObservable(function (observer) { var cancelable = new SerialDisposable(), hasvalue = false, value, id = 0; var subscription = source.subscribe( @@ -5066,14 +5053,63 @@ }); return new CompositeDisposable(subscription, cancelable); }, this); - }; + } - /** - * @deprecated use #debounce or #throttleWithTimeout instead. - */ - observableProto.throttle = function(dueTime, scheduler) { - //deprecate('throttle', 'debounce or throttleWithTimeout'); - return this.debounce(dueTime, scheduler); + function debounceWithSelector(source, durationSelector) { + return new AnonymousObservable(function (o) { + var value, hasValue = false, cancelable = new SerialDisposable(), id = 0; + var subscription = source.subscribe( + function (x) { + var throttle = tryCatch(durationSelector)(x); + if (throttle === errorObj) { return o.onError(throttle.e); } + + isPromise(throttle) && (throttle = observableFromPromise(throttle)); + + hasValue = true; + value = x; + id++; + var currentid = id, d = new SingleAssignmentDisposable(); + cancelable.setDisposable(d); + d.setDisposable(throttle.subscribe( + function () { + hasValue && id === currentid && o.onNext(value); + hasValue = false; + d.dispose(); + }, + function (e) { o.onError(e); }, + function () { + hasValue && id === currentid && o.onNext(value); + hasValue = false; + d.dispose(); + } + )); + }, + function (e) { + cancelable.dispose(); + o.onError(e); + hasValue = false; + id++; + }, + function () { + cancelable.dispose(); + hasValue && o.onNext(value); + o.onCompleted(); + hasValue = false; + id++; + } + ); + return new CompositeDisposable(subscription, cancelable); + }, source); + } + + observableProto.debounce = function () { + if (isFunction (arguments[0])) { + return debounceWithSelector(this, arguments[0]); + } else if (typeof arguments[0] === 'number') { + return debounce(this, arguments[0], arguments[1]); + } else { + throw new Error('Invalid arguments'); + } }; /** @@ -5114,7 +5150,7 @@ function (e) { o.onError(e); }, function () { atEnd = true; - sourceSubscription.dispose(); + sourceSubscription.dispose(); } )); @@ -5144,22 +5180,78 @@ sampleObservable(this, intervalOrSampler); }; - /** - * Returns the source observable sequence or the other observable sequence if dueTime elapses. - * @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) when a timeout occurs. - * @param {Observable} [other] Sequence to return in case of a timeout. If not specified, a timeout error throwing sequence will be used. - * @param {Scheduler} [scheduler] Scheduler to run the timeout timers on. If not specified, the timeout scheduler is used. - * @returns {Observable} The source sequence switching to the other sequence in case of a timeout. - */ - observableProto.timeout = function (dueTime, other, scheduler) { - (other == null || typeof other === 'string') && (other = observableThrow(new Error(other || 'Timeout'))); + var TimeoutError = Rx.TimeoutError = function(message) { + this.message = message || 'Timeout has occurred'; + this.name = 'TimeoutError'; + Error.call(this); + }; + TimeoutError.prototype = Object.create(Error.prototype); + + function timeoutWithSelector(source, firstTimeout, timeoutDurationSelector, other) { + if (isFunction(firstTimeout)) { + other = timeoutDurationSelector; + timeoutDurationSelector = firstTimeout; + firstTimeout = observableNever(); + } + other || (other = observableThrow(new TimeoutError())); + return new AnonymousObservable(function (o) { + var subscription = new SerialDisposable(), timer = new SerialDisposable(), original = new SingleAssignmentDisposable(); + + subscription.setDisposable(original); + + var id = 0, switched = false; + + function setTimer(timeout) { + var myId = id, d = new SingleAssignmentDisposable(); + timer.setDisposable(d); + d.setDisposable(timeout.subscribe(function () { + id === myId && subscription.setDisposable(other.subscribe(o)); + d.dispose(); + }, function (e) { + id === myId && o.onError(e); + }, function () { + id === myId && subscription.setDisposable(other.subscribe(o)); + })); + }; + + setTimer(firstTimeout); + + function oWins() { + var res = !switched; + if (res) { id++; } + return res; + } + + original.setDisposable(source.subscribe(function (x) { + if (oWins()) { + o.onNext(x); + var timeout = tryCatch(timeoutDurationSelector)(x); + if (timeout === errorObj) { return o.onError(timeout.e); } + setTimer(isPromise(timeout) ? observableFromPromise(timeout) : timeout); + } + }, function (e) { + oWins() && o.onError(e); + }, function () { + oWins() && o.onCompleted(); + })); + return new CompositeDisposable(subscription, timer); + }, source); + } + + function timeout(source, dueTime, other, scheduler) { + if (other == null) { throw new Error('other or scheduler must be specified'); } + if (isScheduler(other)) { + scheduler = other; + other = observableThrow(new TimeoutError()); + } + if (other instanceof Error) { other = observableThrow(other); } isScheduler(scheduler) || (scheduler = timeoutScheduler); - var source = this, schedulerMethod = dueTime instanceof Date ? + var schedulerMethod = dueTime instanceof Date ? 'scheduleWithAbsolute' : 'scheduleWithRelative'; - return new AnonymousObservable(function (observer) { + return new AnonymousObservable(function (o) { var id = 0, original = new SingleAssignmentDisposable(), subscription = new SerialDisposable(), @@ -5173,7 +5265,7 @@ timer.setDisposable(scheduler[schedulerMethod](dueTime, function () { if (id === myId) { isPromise(other) && (other = observableFromPromise(other)); - subscription.setDisposable(other.subscribe(observer)); + subscription.setDisposable(other.subscribe(o)); } })); } @@ -5183,22 +5275,33 @@ original.setDisposable(source.subscribe(function (x) { if (!switched) { id++; - observer.onNext(x); + o.onNext(x); createTimer(); } }, function (e) { if (!switched) { id++; - observer.onError(e); + o.onError(e); } }, function () { if (!switched) { id++; - observer.onCompleted(); + o.onCompleted(); } })); return new CompositeDisposable(subscription, timer); }, source); + } + + observableProto.timeout = function () { + var firstArg = arguments[0]; + if (firstArg instanceof Date || typeof firstArg === 'number') { + return timeout(this, firstArg, arguments[1], arguments[2]); + } else if (Observable.isObservable(firstArg) || isFunction(firstArg)) { + return timeoutWithSelector(this, firstArg, arguments[1], arguments[2]); + } else { + throw new Error('Invalid arguments'); + } }; /** @@ -5207,7 +5310,7 @@ * @param {Scheduler} [scheduler] the Scheduler to use internally to manage the timers that handle timeout for each item. If not provided, defaults to Scheduler.timeout. * @returns {Observable} An Observable that performs the throttle operation. */ - observableProto.throttleFirst = function (windowDuration, scheduler) { + observableProto.throttle = function (windowDuration, scheduler) { isScheduler(scheduler) || (scheduler = timeoutScheduler); var duration = +windowDuration || 0; if (duration <= 0) { throw new RangeError('windowDuration cannot be less or equal zero.'); } @@ -5293,7 +5396,7 @@ err; function next(x, i) { - values[i] = x + values[i] = x; hasValue[i] = true; if (hasValueAll || (hasValueAll = hasValue.every(identity))) { if (err) { return o.onError(err); } @@ -5345,7 +5448,7 @@ var subscription = combineLatestSource( this.source, - this.pauser.distinctUntilChanged().startWith(false), + this.pauser.startWith(false).distinctUntilChanged(), function (data, shouldFire) { return { data: data, shouldFire: shouldFire }; }) @@ -5415,144 +5518,147 @@ return new PausableBufferedObservable(this, subject); }; - var ControlledObservable = (function (__super__) { +var ControlledObservable = (function (__super__) { - inherits(ControlledObservable, __super__); - - function subscribe (observer) { - return this.source.subscribe(observer); - } - - function ControlledObservable (source, enableQueue, scheduler) { - __super__.call(this, subscribe, source); - this.subject = new ControlledSubject(enableQueue, scheduler); - this.source = source.multicast(this.subject).refCount(); - } + inherits(ControlledObservable, __super__); - ControlledObservable.prototype.request = function (numberOfItems) { - return this.subject.request(numberOfItems == null ? -1 : numberOfItems); - }; + function subscribe (observer) { + return this.source.subscribe(observer); + } - return ControlledObservable; + function ControlledObservable (source, enableQueue, scheduler) { + __super__.call(this, subscribe, source); + this.subject = new ControlledSubject(enableQueue, scheduler); + this.source = source.multicast(this.subject).refCount(); + } - }(Observable)); + ControlledObservable.prototype.request = function (numberOfItems) { + return this.subject.request(numberOfItems == null ? -1 : numberOfItems); + }; - var ControlledSubject = (function (__super__) { + return ControlledObservable; - function subscribe (observer) { - return this.subject.subscribe(observer); - } +}(Observable)); - inherits(ControlledSubject, __super__); +var ControlledSubject = (function (__super__) { - function ControlledSubject(enableQueue, scheduler) { - enableQueue == null && (enableQueue = true); + function subscribe (observer) { + return this.subject.subscribe(observer); + } - __super__.call(this, subscribe); - this.subject = new Subject(); - this.enableQueue = enableQueue; - this.queue = enableQueue ? [] : null; - this.requestedCount = 0; - this.requestedDisposable = disposableEmpty; - this.error = null; - this.hasFailed = false; - this.hasCompleted = false; - this.scheduler = scheduler || currentThreadScheduler; - } + inherits(ControlledSubject, __super__); + + function ControlledSubject(enableQueue, scheduler) { + enableQueue == null && (enableQueue = true); + + __super__.call(this, subscribe); + this.subject = new Subject(); + this.enableQueue = enableQueue; + this.queue = enableQueue ? [] : null; + this.requestedCount = 0; + this.requestedDisposable = null; + this.error = null; + this.hasFailed = false; + this.hasCompleted = false; + this.scheduler = scheduler || currentThreadScheduler; + } - addProperties(ControlledSubject.prototype, Observer, { - onCompleted: function () { - this.hasCompleted = true; - if (!this.enableQueue || this.queue.length === 0) { - this.subject.onCompleted(); - } else { - this.queue.push(Notification.createOnCompleted()); - } - }, - onError: function (error) { - this.hasFailed = true; - this.error = error; - if (!this.enableQueue || this.queue.length === 0) { - this.subject.onError(error); - } else { - this.queue.push(Notification.createOnError(error)); + addProperties(ControlledSubject.prototype, Observer, { + onCompleted: function () { + this.hasCompleted = true; + if (!this.enableQueue || this.queue.length === 0) { + this.subject.onCompleted(); + this.disposeCurrentRequest() + } else { + this.queue.push(Notification.createOnCompleted()); + } + }, + onError: function (error) { + this.hasFailed = true; + this.error = error; + if (!this.enableQueue || this.queue.length === 0) { + this.subject.onError(error); + this.disposeCurrentRequest() + } else { + this.queue.push(Notification.createOnError(error)); + } + }, + onNext: function (value) { + if (this.requestedCount <= 0) { + this.enableQueue && this.queue.push(Notification.createOnNext(value)); + } else { + (this.requestedCount-- === 0) && this.disposeCurrentRequest(); + this.subject.onNext(value); + } + }, + _processRequest: function (numberOfItems) { + if (this.enableQueue) { + while (this.queue.length > 0 && (numberOfItems > 0 || this.queue[0].kind !== 'N')) { + var first = this.queue.shift(); + first.accept(this.subject); + if (first.kind === 'N') { + numberOfItems--; + } else { + this.disposeCurrentRequest(); + this.queue = []; + } } - }, - onNext: function (value) { - var hasRequested = false; + } - if (this.requestedCount === 0) { - this.enableQueue && this.queue.push(Notification.createOnNext(value)); - } else { - (this.requestedCount !== -1 && this.requestedCount-- === 0) && this.disposeCurrentRequest(); - hasRequested = true; - } - hasRequested && this.subject.onNext(value); - }, - _processRequest: function (numberOfItems) { - if (this.enableQueue) { - while ((this.queue.length >= numberOfItems && numberOfItems > 0) || - (this.queue.length > 0 && this.queue[0].kind !== 'N')) { - var first = this.queue.shift(); - first.accept(this.subject); - if (first.kind === 'N') { - numberOfItems--; - } else { - this.disposeCurrentRequest(); - this.queue = []; - } - } + return numberOfItems; + }, + request: function (number) { + this.disposeCurrentRequest(); + var self = this; - return { numberOfItems : numberOfItems, returnValue: this.queue.length !== 0}; - } + this.requestedDisposable = this.scheduler.scheduleWithState(number, + function(s, i) { + var remaining = self._processRequest(i); + var stopped = self.hasCompleted || self.hasFailed + if (!stopped && remaining > 0) { + self.requestedCount = remaining; - return { numberOfItems: numberOfItems, returnValue: false }; - }, - request: function (number) { - this.disposeCurrentRequest(); - var self = this; - - this.requestedDisposable = this.scheduler.scheduleWithState(number, - function(s, i) { - var r = self._processRequest(i), remaining = r.numberOfItems; - if (!r.returnValue) { - self.requestedCount = remaining; - self.requestedDisposable = disposableCreate(function () { - self.requestedCount = 0; - }); - } - }); + return disposableCreate(function () { + self.requestedCount = 0; + }); + // Scheduled item is still in progress. Return a new + // disposable to allow the request to be interrupted + // via dispose. + } + }); - return this.requestedDisposable; - }, - disposeCurrentRequest: function () { + return this.requestedDisposable; + }, + disposeCurrentRequest: function () { + if (this.requestedDisposable) { this.requestedDisposable.dispose(); - this.requestedDisposable = disposableEmpty; + this.requestedDisposable = null; } - }); - - return ControlledSubject; - }(Observable)); - - /** - * Attaches a controller to the observable sequence with the ability to queue. - * @example - * var source = Rx.Observable.interval(100).controlled(); - * source.request(3); // Reads 3 values - * @param {bool} enableQueue truthy value to determine if values should be queued pending the next request - * @param {Scheduler} scheduler determines how the requests will be scheduled - * @returns {Observable} The observable sequence which only propagates values on request. - */ - observableProto.controlled = function (enableQueue, scheduler) { - - if (enableQueue && isScheduler(enableQueue)) { - scheduler = enableQueue; - enableQueue = true; } + }); + + return ControlledSubject; +}(Observable)); + +/** + * Attaches a controller to the observable sequence with the ability to queue. + * @example + * var source = Rx.Observable.interval(100).controlled(); + * source.request(3); // Reads 3 values + * @param {bool} enableQueue truthy value to determine if values should be queued pending the next request + * @param {Scheduler} scheduler determines how the requests will be scheduled + * @returns {Observable} The observable sequence which only propagates values on request. + */ +observableProto.controlled = function (enableQueue, scheduler) { + + if (enableQueue && isScheduler(enableQueue)) { + scheduler = enableQueue; + enableQueue = true; + } - if (enableQueue == null) { enableQueue = true; } - return new ControlledObservable(this, enableQueue, scheduler); - }; + if (enableQueue == null) { enableQueue = true; } + return new ControlledObservable(this, enableQueue, scheduler); +}; /** * Pipes the existing Observable sequence into a Node.js Stream. @@ -5612,11 +5718,8 @@ var xform = transducer(transformForObserver(o)); return source.subscribe( function(v) { - try { - xform['@@transducer/step'](o, v); - } catch (e) { - o.onError(e); - } + var res = tryCatch(xform['@@transducer/step']).call(xform, o, v); + if (res === errorObj) { o.onError(res.e); } }, function (e) { o.onError(e); }, function() { xform['@@transducer/result'](o); } @@ -5634,8 +5737,8 @@ } function setDisposable(s, state) { - var ado = state[0], subscribe = state[1]; - var sub = tryCatch(subscribe)(ado); + var ado = state[0], self = state[1]; + var sub = tryCatch(self.__subscribe).call(self, ado); if (sub === errorObj) { if(!ado.fail(errorObj.e)) { return thrower(errorObj.e); } @@ -5643,21 +5746,21 @@ ado.setDisposable(fixSubscriber(sub)); } - function AnonymousObservable(subscribe, parent) { - this.source = parent; - - function s(observer) { - var ado = new AutoDetachObserver(observer), state = [ado, subscribe]; + function innerSubscribe(observer) { + var ado = new AutoDetachObserver(observer), state = [ado, this]; - if (currentThreadScheduler.scheduleRequired()) { - currentThreadScheduler.scheduleWithState(state, setDisposable); - } else { - setDisposable(null, state); - } - return ado; + if (currentThreadScheduler.scheduleRequired()) { + currentThreadScheduler.scheduleWithState(state, setDisposable); + } else { + setDisposable(null, state); } + return ado; + } - __super__.call(this, s); + function AnonymousObservable(subscribe, parent) { + this.source = parent; + this.__subscribe = subscribe; + __super__.call(this, innerSubscribe); } return AnonymousObservable; diff --git a/tools/eslint/node_modules/rx-lite/rx.lite.map b/tools/eslint/node_modules/rx-lite/rx.lite.map new file mode 100644 index 00000000000000..f3dc95d64aa914 --- /dev/null +++ b/tools/eslint/node_modules/rx-lite/rx.lite.map @@ -0,0 +1 @@ +{"version":3,"file":"rx.lite.min.js","sources":["rx.lite.js"],"names":["undefined","cloneArray","arr","len","length","a","Array","i","tryCatcherGen","tryCatchTarget","apply","this","arguments","e","errorObj","thrower","makeStackTraceLong","error","observable","hasStacks","stack","indexOf","STACK_JUMP_SEPARATOR","stacks","o","source","unshift","concatedStacks","join","filterStackString","stackString","lines","split","desiredLines","line","isInternalFrame","isNodeFrame","push","stackLine","fileNameAndLineNumber","getFileNameAndLineNumber","fileName","lineNumber","rFileName","rStartingLine","rEndingLine","captureLine","Error","firstLine","attempt1","exec","Number","attempt2","attempt3","keysIn","object","result","isObject","support","nonEnumArgs","isArguments","slice","call","skipProto","enumPrototypes","skipErrorProps","enumErrorProps","errorProto","key","nonEnumShadows","objectProto","ctor","constructor","index","dontEnumsLength","prototype","className","stringProto","stringClass","errorClass","toString","nonEnum","nonEnumProps","dontEnums","hasOwnProperty","internalFor","callback","keysFunc","props","internalForIn","isNode","value","deepEquals","b","stackA","stackB","type","otherType","otherClass","argsClass","objectClass","boolClass","dateClass","numberClass","regexpClass","String","isArr","arrayClass","nodeClass","ctorA","argsObject","Object","ctorB","isFunction","size","pop","arrayInitialize","count","factory","StringIterable","s","_s","StringIterator","_l","_i","ArrayIterable","_a","ArrayIterator","toLength","numberIsFinite","root","isFinite","getIterable","it","$iterator$","TypeError","sign","number","isNaN","Math","floor","abs","maxSafeInteger","FromArraySink","observer","parent","observableOf","scheduler","array","isScheduler","currentThreadScheduler","FromArrayObservable","PairsSink","RepeatSink","observableCatchHandler","handler","AnonymousObservable","d1","SingleAssignmentDisposable","subscription","SerialDisposable","setDisposable","subscribe","CatchObserver","falseFactory","argumentsToArray","args","emptyArrayFactory","asObservable","InnerObserver","accumulator","hasSeed","seed","hasAccumulation","accumulation","hasValue","isStopped","plucker","x","currentProp","p","createCbObservable","fn","ctx","selector","AsyncSubject","createCbHandler","results","tryCatch","onError","onNext","onCompleted","createNodeObservable","createNodeHandler","err","ListenDisposable","n","_e","_n","_fn","addEventListener","isDisposed","createEventListener","el","eventName","disposables","CompositeDisposable","elemToString","add","item","eventHandler","observableTimerDate","dueTime","scheduleWithAbsolute","observableTimerDateAndPeriod","period","d","normalizeTime","scheduleRecursiveWithAbsoluteAndState","self","now","observableTimerTimeSpan","scheduleWithRelative","observableTimerTimeSpanAndPeriod","schedulePeriodicWithState","observableDefer","observableDelayRelative","active","cancelable","exception","q","running","materialize","timestamp","notification","shouldRun","kind","scheduleRecursiveWithRelative","recurseDueTime","shouldRecurse","shift","accept","max","observableDelayAbsolute","delayWithSelector","subscriptionDelay","delayDurationSelector","subDelay","start","delay","delays","remove","done","atEnd","dispose","debounce","timeoutScheduler","hasvalue","id","currentId","debounceWithSelector","durationSelector","throttle","isPromise","observableFromPromise","currentid","sampleObservable","sampler","sampleSubscribe","sourceSubscription","newValue","timeoutWithSelector","firstTimeout","timeoutDurationSelector","other","observableNever","observableThrow","TimeoutError","setTimer","timeout","myId","timer","oWins","res","switched","original","schedulerMethod","Date","createTimer","combineLatestSource","subject","resultSelector","next","values","hasValueAll","every","identity","isDone","objectTypes","function","freeExports","exports","nodeType","freeSelf","freeWindow","window","freeModule","module","moduleExports","freeGlobal","global","Rx","internals","config","Promise","helpers","noop","defaultNow","defaultComparer","y","isEqual","defaultSubComparer","defaultError","defaultKeySerializer","then","isFn","longStackSupport","EmptyError","message","name","create","ObjectDisposedError","ArgumentOutOfRangeError","NotSupportedError","NotImplementedError","notImplemented","notSupported","Symbol","iterator","Set","doneEnumerator","isIterable","isArrayLike","supportNodeClass","bindCallback","func","thisArg","argCount","arg","collection","funcClass","supportsArgsClass","propertyIsEnumerable","document","toLocaleString","valueOf","test","inherits","child","__","addProperties","obj","sources","idx","ln","prop","addRef","xs","r","getDisposable","isArray","isDisposable","CompositeDisposablePrototype","shouldDispose","splice","currentDisposables","Disposable","action","disposableCreate","disposableEmpty","empty","checkDisposed","disposable","current","old","ScheduledItem","RefCountDisposable","InnerDisposable","isInnerDisposed","underlyingDisposable","isPrimaryDisposed","state","comparer","invoke","invokeCore","compareTo","isCancelled","Scheduler","schedule","scheduleRelative","scheduleAbsolute","_schedule","_scheduleRelative","_scheduleAbsolute","invokeAction","schedulerProto","scheduleWithState","scheduleWithRelativeAndState","scheduleWithAbsoluteAndState","normalize","timeSpan","invokeRecImmediate","pair","innerAction","state2","scheduleWork","_","state3","isAdded","group","invokeRecDate","method","dueTime1","invokeRecDateRelative","invokeRecDateAbsolute","scheduleInnerRecursive","dt","scheduleRecursive","scheduleRecursiveWithState","scheduleRecursiveWithRelativeAndState","scheduleRecursiveWithAbsolute","schedulePeriodic","setInterval","clearInterval","scheduleMethod","clearMethod","immediateScheduler","immediate","scheduleNow","currentThread","runTrampoline","queue","si","currentScheduler","scheduleRequired","localTimer","SchedulePeriodicRecursive","tick","command","recurse","_period","_state","_action","_cancel","_scheduler","bind","localSetTimeout","localClearTimeout","setTimeout","clearTimeout","WScript","time","Sleep","runTask","handle","currentlyRunning","task","tasksByHandle","postMessageSupported","postMessage","importScripts","isAsync","oldHandler","onmessage","onGlobalPostMessage","event","data","substring","MSG_PREFIX","nextHandle","reNative","RegExp","replace","setImmediate","process","nextTick","random","attachEvent","MessageChannel","channel","port1","port2","createElement","scriptElement","onreadystatechange","parentNode","removeChild","documentElement","appendChild","observableProto","Notification","acceptObservable","_accept","_acceptObservable","observerOrOnNext","toObservable","notificationCreateOnNext","createOnNext","notificationCreateOnError","createOnError","notificationCreateOnCompleted","createOnCompleted","Observer","observerCreate","AnonymousObserver","AbstractObserver","__super__","completed","fail","_onNext","_onError","_onCompleted","Observable","makeSubscribe","oldOnError","_subscribe","isObservable","forEach","oOrOnNext","subscribeOnNext","subscribeOnError","subscribeOnCompleted","ScheduledObserver","isAcquired","hasFaulted","ensureActive","isOwner","work","ObservableBase","fixSubscriber","subscriber","ado","sub","subscribeCore","AutoDetachObserver","FlatMapObservable","_wrapResult","map","i2","fromPromise","from","Enumerable","ConcatEnumerableObservable","currentItem","currentValue","concat","CatchErrorObservable","lastException","catchError","catchErrorWhen","notificationHandler","exceptions","Subject","notifier","handled","notificationDisposable","outer","inner","exn","ex","RepeatEnumerable","v","c","RepeatEnumerator","l","enumerableRepeat","repeat","repeatCount","OfEnumerable","OfEnumerator","enumerableOf","of","ToArrayObservable","toArray","defer","observableFactory","EmptyObservable","EmptySink","scheduleItem","sink","run","EMPTY_OBSERVABLE","observableEmpty","FromObservable","iterable","mapper","FromSink","loopRecursive","list","pow","charAt","observableFrom","mapFn","observableFromArray","fromArray","NeverObservable","NEVER_OBSERVABLE","never","ofWithScheduler","PairsObservable","keys","pairs","RangeObservable","rangeCount","RangeSink","range","RepeatObservable","JustObservable","JustSink","ThrowObservable","just","ThrowSink","_o","handlerOrSecond","observableCatch","items","combineLatest","filter","j","subscriptions","sad","observableConcat","ConcatObservable","ConcatSink","concatAll","merge","MergeObservable","maxConcurrent","g","MergeObserver","activeCount","handleSubscribe","innerSource","maxConcurrentOrOther","observableMerge","mergeAll","CompositeError","errors","innerErrors","mergeDelayError","setCompletion","m","innerSubscription","MergeAllObservable","MergeAllObserver","skipUntil","isOpen","left","rightSubscription","SwitchObservable","SwitchObserver","stopped","latest","hasLatest","switchLatest","TakeUntilObservable","takeUntil","withLatestFrom","allValues","zip","queues","queuedValues","first","zipIterable","dematerialize","DistinctUntilChangedObservable","keyFn","DistinctUntilChangedObserver","hasCurrentKey","currentKey","comparerEquals","distinctUntilChanged","TapObservable","_oN","_oE","_oC","t","tap","doAction","doOnNext","tapOnNext","doOnError","tapOnError","doOnCompleted","tapOnCompleted","IgnoreElementsObservable","ignoreElements","retry","retryCount","retryWhen","ScanObservable","scan","skipLast","startWith","takeLast","flatMapConcat","concatMap","MapObservable","innerMap","internalMap","select","selectorFn","pluck","flatMap","selectMany","flatMapLatest","SkipObservable","skipCount","skip","skipWhile","predicate","take","remaining","takeWhile","FilterObservable","innerPredicate","internalFilter","shouldYield","where","fromCallback","fromNodeCallback","removeEventListener","useNativeEvents","fromEvent","element","addListener","fromEventPattern","h","removeListener","on","off","publish","refCount","addHandler","removeHandler","innerHandler","returnValue","FromPromiseObservable","promise","toPromise","promiseCtor","resolve","reject","startAsync","functionAsync","multicast","subjectOrSubjectSelector","connectable","connect","ConnectableObservable","share","publishLast","publishValue","initialValueOrSelector","initialValue","BehaviorSubject","shareValue","replay","bufferSize","windowSize","ReplaySubject","shareReplay","hasSubscription","sourceObservable","connectableSubscription","shouldConnect","observableinterval","interval","periodOrScheduler","getTime","sample","throttleLatest","intervalOrSampler","firstArg","windowDuration","duration","RangeError","lastOnNext","PausableObservable","conn","connection","pausable","pauser","controller","pause","resume","PausableBufferedObservable","drainQueue","previousShouldFire","shouldFire","pausableBuffered","ControlledObservable","enableQueue","ControlledSubject","request","numberOfItems","requestedCount","requestedDisposable","hasFailed","hasCompleted","disposeCurrentRequest","_processRequest","controlled","pipe","dest","onDrain","write","emit","_isStdio","end","transduce","transducer","transformForObserver","@@transducer/init","@@transducer/step","obs","input","@@transducer/result","xform","__subscribe","innerSubscribe","AutoDetachObserverPrototype","InnerSubscription","observers","hasError","hasObservers","os","AnonymousSubject","getValue","createRemovableDisposable","so","_trim","Pauser","define","amd"],"mappings":";CAEE,SAAUA,GAkDR,QAASC,GAAWC,GAElB,IAAI,GADAC,GAAMD,EAAIE,OAAQC,EAAI,GAAIC,OAAMH,GAC5BI,EAAI,EAAOJ,EAAJI,EAASA,IAAOF,EAAEE,GAAKL,EAAIK,EAC1C,OAAOF,GAIX,QAASG,GAAcC,GACrB,MAAO,YACL,IACE,MAAOA,GAAeC,MAAMC,KAAMC,WAClC,MAAOC,GAEP,MADAC,IAASD,EAAIA,EACNC,KAQb,QAASC,GAAQF,GACf,KAAMA,GAYR,QAASG,GAAmBC,EAAOC,GAGjC,GAAIC,IACAD,EAAWE,OACM,gBAAVH,IACG,OAAVA,GACAA,EAAMG,OACwC,KAA9CH,EAAMG,MAAMC,QAAQC,IACtB,CAEA,IAAK,GADDC,MACKC,EAAIN,EAAcM,EAAGA,EAAIA,EAAEC,OAC9BD,EAAEJ,OACJG,EAAOG,QAAQF,EAAEJ,MAGrBG,GAAOG,QAAQT,EAAMG,MAErB,IAAIO,GAAiBJ,EAAOK,KAAK,KAAON,GAAuB,KAC/DL,GAAMG,MAAQS,EAAkBF,IAIpC,QAASE,GAAkBC,GAEzB,IAAK,GADDC,GAAQD,EAAYE,MAAM,MAAOC,KAC5B1B,EAAI,EAAGJ,EAAM4B,EAAM3B,OAAYD,EAAJI,EAASA,IAAK,CAChD,GAAI2B,GAAOH,EAAMxB,EAEZ4B,GAAgBD,IAAUE,EAAYF,KAASA,GAClDD,EAAaI,KAAKH,GAGtB,MAAOD,GAAaL,KAAK,MAG3B,QAASO,GAAgBG,GACvB,GAAIC,GAAwBC,EAAyBF,EACrD,KAAKC,EACH,OAAO,CAET,IAAIE,GAAWF,EAAsB,GAAIG,EAAaH,EAAsB,EAE5E,OAAOE,KAAaE,IAClBD,GAAcE,IACAC,IAAdH,EAGJ,QAASN,GAAYE,GACnB,MAA4C,KAArCA,EAAUjB,QAAQ,gBACY,KAAnCiB,EAAUjB,QAAQ,aAGtB,QAASyB,KACP,GAAK3B,GAEL,IACE,KAAM,IAAI4B,OACV,MAAOlC,GACP,GAAIkB,GAAQlB,EAAEO,MAAMY,MAAM,MACtBgB,EAAYjB,EAAM,GAAGV,QAAQ,KAAO,EAAIU,EAAM,GAAKA,EAAM,GACzDQ,EAAwBC,EAAyBQ,EACrD,KAAKT,EAAyB,MAG9B,OADAI,IAAYJ,EAAsB,GAC3BA,EAAsB,IAIjC,QAASC,GAAyBF,GAEhC,GAAIW,GAAW,gCAAgCC,KAAKZ,EACpD,IAAIW,EAAY,OAAQA,EAAS,GAAIE,OAAOF,EAAS,IAGrD,IAAIG,GAAW,4BAA4BF,KAAKZ,EAChD,IAAIc,EAAY,OAAQA,EAAS,GAAID,OAAOC,EAAS,IAGrD,IAAIC,GAAW,iBAAiBH,KAAKZ,EACrC,OAAIe,IAAoBA,EAAS,GAAIF,OAAOE,EAAS,KAArD,OAkKF,QAASC,GAAOC,GACd,GAAIC,KACJ,KAAKC,GAASF,GACZ,MAAOC,EAELE,IAAQC,aAAeJ,EAAOnD,QAAUwD,GAAYL,KACtDA,EAASM,GAAMC,KAAKP,GAEtB,IAAIQ,GAAYL,GAAQM,gBAAmC,kBAAVT,GAC7CU,EAAiBP,GAAQQ,iBAAmBX,IAAWY,IAAcZ,YAAkBR,OAE3F,KAAK,GAAIqB,KAAOb,GACRQ,GAAoB,aAAPK,GACbH,IAA0B,WAAPG,GAA2B,QAAPA,IAC3CZ,EAAOnB,KAAK+B,EAIhB,IAAIV,GAAQW,gBAAkBd,IAAWe,GAAa,CACpD,GAAIC,GAAOhB,EAAOiB,YACdC,EAAQ,GACRrE,EAASsE,EAEb,IAAInB,KAAYgB,GAAQA,EAAKI,WAC3B,GAAIC,GAAYrB,IAAWsB,GAAcC,GAAcvB,IAAWY,GAAaY,GAAaC,GAASlB,KAAKP,GACtG0B,EAAUC,GAAaN,EAE7B,QAASH,EAAQrE,GACfgE,EAAMe,GAAUV,GACVQ,GAAWA,EAAQb,KAASgB,GAAetB,KAAKP,EAAQa,IAC5DZ,EAAOnB,KAAK+B,GAIlB,MAAOZ,GAGT,QAAS6B,GAAY9B,EAAQ+B,EAAUC,GAKrC,IAJA,GAAId,GAAQ,GACVe,EAAQD,EAAShC,GACjBnD,EAASoF,EAAMpF,SAERqE,EAAQrE,GAAQ,CACvB,GAAIgE,GAAMoB,EAAMf,EAChB,IAAIa,EAAS/B,EAAOa,GAAMA,EAAKb,MAAY,EACzC,MAGJ,MAAOA,GAGT,QAASkC,GAAclC,EAAQ+B,GAC7B,MAAOD,GAAY9B,EAAQ+B,EAAUhC,GAGvC,QAASoC,GAAOC,GAGd,MAAgC,kBAAlBA,GAAMX,UAAiD,iBAAfW,EAAQ,IAqBhE,QAASC,GAAWvF,EAAGwF,EAAGC,EAAQC,GAEhC,GAAI1F,IAAMwF,EAER,MAAa,KAANxF,GAAY,EAAIA,GAAK,EAAIwF,CAGlC,IAAIG,SAAc3F,GACd4F,QAAmBJ,EAGvB,IAAIxF,IAAMA,IAAW,MAALA,GAAkB,MAALwF,GAChB,YAARG,GAA8B,UAARA,GAAiC,YAAbC,GAAwC,UAAbA,GACxE,OAAO,CAIT,IAAIrB,GAAYI,GAASlB,KAAKzD,GAC1B6F,EAAalB,GAASlB,KAAK+B,EAQ/B,IANIjB,GAAauB,KACfvB,EAAYwB,IAEVF,GAAcC,KAChBD,EAAaE,IAEXxB,GAAasB,EACf,OAAO,CAET,QAAQtB,GACN,IAAKyB,IACL,IAAKC,IAGH,OAAQjG,IAAMwF,CAEhB,KAAKU,IAEH,MAAQlG,KAAMA,EACZwF,IAAMA,EAEA,GAALxF,EAAU,EAAIA,GAAK,EAAIwF,EAAKxF,IAAMwF,CAEvC,KAAKW,IACL,IAAK1B,IAGH,MAAOzE,IAAKoG,OAAOZ,GAEvB,GAAIa,GAAQ9B,GAAa+B,EACzB,KAAKD,EAAO,CAGV,GAAI9B,GAAawB,KAAiB1C,GAAQkD,YAAclB,EAAOrF,IAAMqF,EAAOG,IAC1E,OAAO,CAGT,IAAIgB,IAASnD,GAAQoD,YAAclD,GAAYvD,GAAK0G,OAAS1G,EAAEmE,YAC3DwC,GAAStD,GAAQoD,YAAclD,GAAYiC,GAAKkB,OAASlB,EAAErB,WAG/D,MAAIqC,GAASG,GACL5B,GAAetB,KAAKzD,EAAG,gBAAkB+E,GAAetB,KAAK+B,EAAG,gBAChEoB,GAAWJ,IAAUA,YAAiBA,IAASI,GAAWD,IAAUA,YAAiBA,MACtF,eAAiB3G,IAAK,eAAiBwF,KAE5C,OAAO,EAOXC,IAAWA,MACXC,IAAWA,KAGX,KADA,GAAI3F,GAAS0F,EAAO1F,OACbA,KACL,GAAI0F,EAAO1F,IAAWC,EACpB,MAAO0F,GAAO3F,IAAWyF,CAG7B,IAAIqB,GAAO,EACP1D,GAAS,CAOb,IAJAsC,EAAOzD,KAAKhC,GACZ0F,EAAO1D,KAAKwD,GAGRa,GAMF,GAJAtG,EAASC,EAAED,OACX8G,EAAOrB,EAAEzF,OACToD,EAAS0D,GAAQ9G,EAIf,KAAO8G,KAAQ,CACb,GACIvB,GAAQE,EAAEqB,EAEd,MAAM1D,EAASoC,EAAWvF,EAAE6G,GAAOvB,EAAOG,EAAQC,IAChD,WAQNN,GAAcI,EAAG,SAASF,EAAOvB,EAAKyB,GACpC,MAAIT,IAAetB,KAAK+B,EAAGzB,IAEzB8C,IAEQ1D,EAAS4B,GAAetB,KAAKzD,EAAG+D,IAAQwB,EAAWvF,EAAE+D,GAAMuB,EAAOG,EAAQC,IAJpF,SAQEvC,GAEFiC,EAAcpF,EAAG,SAASsF,EAAOvB,EAAK/D,GACpC,MAAI+E,IAAetB,KAAKzD,EAAG+D,GAEjBZ,IAAW0D,EAAO,GAF5B,QAUN,OAHApB,GAAOqB,MACPpB,EAAOoB,MAEA3D,EA6BT,QAAS4D,GAAgBC,EAAOC,GAE9B,IAAK,GADDjH,GAAI,GAAIC,OAAM+G,GACT9G,EAAI,EAAO8G,EAAJ9G,EAAWA,IACzBF,EAAEE,GAAK+G,GAET,OAAOjH,GAwmDT,QAASkH,GAAeC,GACtB7G,KAAK8G,GAAKD,EAOZ,QAASE,GAAeF,GACtB7G,KAAK8G,GAAKD,EACV7G,KAAKgH,GAAKH,EAAEpH,OACZO,KAAKiH,GAAK,EAWZ,QAASC,GAAcxH,GACrBM,KAAKmH,GAAKzH,EAOZ,QAAS0H,GAAc1H,GACrBM,KAAKmH,GAAKzH,EACVM,KAAKgH,GAAKK,EAAS3H,GACnBM,KAAKiH,GAAK,EAWZ,QAASK,GAAetC,GACtB,MAAwB,gBAAVA,IAAsBuC,GAAKC,SAASxC,GAOpD,QAASyC,GAAY5G,GACnB,GAAuB6G,GAAnB9H,EAAIiB,EAAE8G,GACV,KAAK/H,GAAkB,gBAANiB,GAEf,MADA6G,GAAK,GAAId,GAAe/F,GACjB6G,EAAGC,KAEZ,KAAK/H,GAAKiB,EAAEpB,SAAWJ,EAErB,MADAqI,GAAK,GAAIR,GAAcrG,GAChB6G,EAAGC,KAEZ,KAAK/H,EAAK,KAAM,IAAIgI,WAAU,yBAC9B,OAAO/G,GAAE8G,MAGX,QAASE,GAAK7C,GACZ,GAAI8C,IAAU9C,CACd,OAAe,KAAX8C,EAAuBA,EACvBC,MAAMD,GAAkBA,EACZ,EAATA,EAAa,GAAK,EAG3B,QAAST,GAASxG,GAChB,GAAIrB,IAAOqB,EAAEpB,MACb,OAAIsI,OAAMvI,GAAe,EACb,IAARA,GAAc8H,EAAe9H,IACjCA,EAAMqI,EAAKrI,GAAOwI,KAAKC,MAAMD,KAAKE,IAAI1I,IAC3B,GAAPA,EAAmB,EACnBA,EAAM2I,GAAyBA,GAC5B3I,GAJyCA,EA4ClD,QAAS4I,GAAcC,EAAUC,GAC/BtI,KAAKqI,SAAWA,EAChBrI,KAAKsI,OAASA,EAmDhB,QAASC,GAAcC,EAAWC,GAEhC,MADAC,IAAYF,KAAeA,EAAYG,IAChC,GAAIC,IAAoBH,EAAOD,GAyCxC,QAASK,GAAUR,EAAUC,GAC3BtI,KAAKqI,SAAWA,EAChBrI,KAAKsI,OAASA,EAkGhB,QAASQ,GAAWT,EAAUC,GAC5BtI,KAAKqI,SAAWA,EAChBrI,KAAKsI,OAASA,EA+IhB,QAASS,GAAuBjI,EAAQkI,GACtC,MAAO,IAAIC,IAAoB,SAAUpI,GACvC,GAAIqI,GAAK,GAAIC,IAA8BC,EAAe,GAAIC,GAG9D,OAFAD,GAAaE,cAAcJ,GAC3BA,EAAGI,cAAcxI,EAAOyI,UAAU,GAAIC,IAAc3I,EAAGuI,EAAcJ,KAC9DI,GACNtI,GAiDL,QAAS2I,KAAiB,OAAO,EACjC,QAASC,KAEP,IAAI,GADAlK,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,GACrCI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EACnD,OAAO+J,GA2oBT,QAASF,KAAiB,OAAO,EAgDjC,QAASA,KAAiB,OAAO,EACjC,QAASG,KAAsB,SAC/B,QAASF,KAEP,IAAI,GADAlK,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,GACrCI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EACnD,OAAO+J,GAoEX,QAASF,KAAiB,OAAO,EACjC,QAASG,KAAsB,SAC/B,QAASF,KAEP,IAAI,GADAlK,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,GACrCI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EACnD,OAAO+J,GAmDP,QAASE,GAAa/I,GACpB,MAAO,UAAmBD,GAAK,MAAOC,GAAOyI,UAAU1I,IA2UzD,QAASiJ,GAAcjJ,EAAGyH,GACxBtI,KAAKa,EAAIA,EACTb,KAAK+J,YAAczB,EAAOyB,YAC1B/J,KAAKgK,QAAU1B,EAAO0B,QACtBhK,KAAKiK,KAAO3B,EAAO2B,KACnBjK,KAAKkK,iBAAkB,EACvBlK,KAAKmK,aAAe,KACpBnK,KAAKoK,UAAW,EAChBpK,KAAKqK,WAAY,EA8LnB,QAASC,GAAQX,EAAMnK,GACrB,MAAO,UAAgB+K,GAErB,IAAK,GADDC,GAAcD,EACT3K,EAAI,EAAOJ,EAAJI,EAASA,IAAK,CAC5B,GAAI6K,GAAID,EAAYb,EAAK/J,GACzB,IAAiB,mBAAN6K,GAGT,MAAOpL,EAFPmL,GAAcC,EAKlB,MAAOD,IA4Ob,QAASE,GAAmBC,EAAIC,EAAKC,EAAUlB,GAC7C,GAAI9I,GAAI,GAAIiK,GAKZ,OAHAnB,GAAKjI,KAAKqJ,EAAgBlK,EAAG+J,EAAKC,IAClCF,EAAG5K,MAAM6K,EAAKjB,GAEP9I,EAAEgJ,eAGX,QAASkB,GAAgBlK,EAAG+J,EAAKC,GAC/B,MAAO,YAEL,IAAI,GADArL,GAAMS,UAAUR,OAAQuL,EAAU,GAAIrL,OAAMH,GACxCI,EAAI,EAAOJ,EAAJI,EAASA,IAAOoL,EAAQpL,GAAKK,UAAUL,EAEtD,IAAI0G,GAAWuE,GAAW,CAExB,GADAG,EAAUC,GAASJ,GAAU9K,MAAM6K,EAAKI,GACpCA,IAAY7K,GAAY,MAAOU,GAAEqK,QAAQF,EAAQ9K,EACrDW,GAAEsK,OAAOH,OAELA,GAAQvL,QAAU,EACpBoB,EAAEsK,OAAOH,EAAQ,IAEjBnK,EAAEsK,OAAOH,EAIbnK,GAAEuK,eAsBN,QAASC,GAAqBV,EAAIC,EAAKC,EAAUlB,GAC/C,GAAI9I,GAAI,GAAIiK,GAKZ,OAHAnB,GAAKjI,KAAK4J,EAAkBzK,EAAG+J,EAAKC,IACpCF,EAAG5K,MAAM6K,EAAKjB,GAEP9I,EAAEgJ,eAGX,QAASyB,GAAkBzK,EAAG+J,EAAKC,GACjC,MAAO,YACL,GAAIU,GAAMtL,UAAU,EACpB,IAAIsL,EAAO,MAAO1K,GAAEqK,QAAQK,EAG5B,KAAI,GADA/L,GAAMS,UAAUR,OAAQuL,KACpBpL,EAAI,EAAOJ,EAAJI,EAASA,IAAOoL,EAAQpL,EAAI,GAAKK,UAAUL,EAE1D,IAAI0G,GAAWuE,GAAW,CACxB,GAAIG,GAAUC,GAASJ,GAAU9K,MAAM6K,EAAKI,EAC5C,IAAIA,IAAY7K,GAAY,MAAOU,GAAEqK,QAAQF,EAAQ9K,EACrDW,GAAEsK,OAAOH,OAELA,GAAQvL,QAAU,EACpBoB,EAAEsK,OAAOH,EAAQ,IAEjBnK,EAAEsK,OAAOH,EAIbnK,GAAEuK,eAoBJ,QAASI,GAAiBtL,EAAGuL,EAAGd,GAC9B3K,KAAK0L,GAAKxL,EACVF,KAAK2L,GAAKF,EACVzL,KAAK4L,IAAMjB,EACX3K,KAAK0L,GAAGG,iBAAiB7L,KAAK2L,GAAI3L,KAAK4L,KAAK,GAC5C5L,KAAK8L,YAAa,EASpB,QAASC,GAAqBC,EAAIC,EAAWjD,GAC3C,GAAIkD,GAAc,GAAIC,IAGlBC,EAAehG,OAAOpC,UAAUK,SAASlB,KAAK6I,EAClD,IAAqB,sBAAjBI,GAAyD,4BAAjBA,EAC1C,IAAK,GAAIxM,GAAI,EAAGJ,EAAMwM,EAAGvM,OAAYD,EAAJI,EAASA,IACxCsM,EAAYG,IAAIN,EAAoBC,EAAGM,KAAK1M,GAAIqM,EAAWjD,QAEpDgD,IACTE,EAAYG,IAAI,GAAIb,GAAiBQ,EAAIC,EAAWjD,GAGtD,OAAOkD,GAQT,QAASK,GAAa1L,EAAGgK,GACvB,MAAO,YACL,GAAIG,GAAU/K,UAAU,EACxB,OAAIqG,IAAWuE,KACbG,EAAUC,GAASJ,GAAU9K,MAAM,KAAME,WACrC+K,IAAY7K,IAAmBU,EAAEqK,QAAQF,EAAQ9K,OAEvDW,GAAEsK,OAAOH,IAwTb,QAASwB,GAAoBC,EAASjE,GACpC,MAAO,IAAIS,IAAoB,SAAUZ,GACvC,MAAOG,GAAUkE,qBAAqBD,EAAS,WAC7CpE,EAAS8C,OAAO,GAChB9C,EAAS+C,kBAKf,QAASuB,GAA6BF,EAASG,EAAQpE,GACrD,MAAO,IAAIS,IAAoB,SAAUZ,GACvC,GAAIwE,GAAIJ,EAAShC,EAAIqC,GAAcF,EACnC,OAAOpE,GAAUuE,sCAAsC,EAAGF,EAAG,SAAUnG,EAAOsG,GAC5E,GAAIvC,EAAI,EAAG,CACT,GAAIwC,GAAMzE,EAAUyE,KACpBJ,IAAQpC,EACHwC,GAALJ,IAAaA,EAAII,EAAMxC,GAEzBpC,EAAS8C,OAAOzE,GAChBsG,EAAKtG,EAAQ,EAAGmG,OAKtB,QAASK,GAAwBT,EAASjE,GACxC,MAAO,IAAIS,IAAoB,SAAUZ,GACvC,MAAOG,GAAU2E,qBAAqBL,GAAcL,GAAU,WAC5DpE,EAAS8C,OAAO,GAChB9C,EAAS+C,kBAKf,QAASgC,GAAiCX,EAASG,EAAQpE,GACzD,MAAOiE,KAAYG,EACjB,GAAI3D,IAAoB,SAAUZ,GAChC,MAAOG,GAAU6E,0BAA0B,EAAGT,EAAQ,SAAUlG,GAE9D,MADA2B,GAAS8C,OAAOzE,GACTA,EAAQ,MAGnB4G,GAAgB,WACd,MAAOX,GAA6BnE,EAAUyE,MAAQR,EAASG,EAAQpE,KA6C7E,QAAS+E,GAAwBzM,EAAQ2L,EAASjE,GAChD,MAAO,IAAIS,IAAoB,SAAUpI,GACvC,GAKEuI,GALEoE,GAAS,EACXC,EAAa,GAAIpE,IACjBqE,EAAY,KACZC,KACAC,GAAU,CAsDZ,OApDAxE,GAAetI,EAAO+M,cAAcC,UAAUtF,GAAWe,UAAU,SAAUwE,GAC3E,GAAIlB,GAAGmB,CACyB,OAA5BD,EAAa/I,MAAMiJ,MACrBN,KACAA,EAAEjM,KAAKqM,GACPL,EAAYK,EAAa/I,MAAM0I,UAC/BM,GAAaJ,IAEbD,EAAEjM,MAAOsD,MAAO+I,EAAa/I,MAAO8I,UAAWC,EAAaD,UAAYrB,IACxEuB,GAAaR,EACbA,GAAS,GAEPQ,IACgB,OAAdN,EACF7M,EAAEqK,QAAQwC,IAEVb,EAAI,GAAI1D,IACRsE,EAAWnE,cAAcuD,GACzBA,EAAEvD,cAAcd,EAAU0F,8BAA8BzB,EAAS,SAAUO,GACzE,GAAI9M,GAAGiO,EAAgBtL,EAAQuL,CAC/B,IAAkB,OAAdV,EAAJ,CAGAE,GAAU,CACV,GACE/K,GAAS,KACL8K,EAAElO,OAAS,GAAKkO,EAAE,GAAGG,UAAYtF,EAAUyE,OAAS,IACtDpK,EAAS8K,EAAEU,QAAQrJ,OAEN,OAAXnC,GACFA,EAAOyL,OAAOzN,SAEE,OAAXgC,EACTuL,IAAgB,EAChBD,EAAiB,EACbR,EAAElO,OAAS,GACb2O,GAAgB,EAChBD,EAAiBnG,KAAKuG,IAAI,EAAGZ,EAAE,GAAGG,UAAYtF,EAAUyE,QAExDO,GAAS,EAEXtN,EAAIwN,EACJE,GAAU,EACA,OAAN1N,EACFW,EAAEqK,QAAQhL,GACDkO,GACTpB,EAAKmB,WAMR,GAAIhC,IAAoB/C,EAAcqE,IAC5C3M,GAGL,QAAS0N,GAAwB1N,EAAQ2L,EAASjE,GAChD,MAAO8E,IAAgB,WACrB,MAAOC,GAAwBzM,EAAQ2L,EAAUjE,EAAUyE,MAAOzE,KAItE,QAASiG,GAAkB3N,EAAQ4N,EAAmBC,GACpD,GAAIC,GAAU/D,CAOd,OANIvE,IAAWoI,GACb7D,EAAW6D,GAEXE,EAAWF,EACX7D,EAAW8D,GAEN,GAAI1F,IAAoB,SAAUpI,GAGvC,QAASgO,KACPzF,EAAaE,cAAcxI,EAAOyI,UAChC,SAAUgB,GACR,GAAIuE,GAAQ7D,GAASJ,GAAUN,EAC/B,IAAIuE,IAAU3O,GAAY,MAAOU,GAAEqK,QAAQ4D,EAAM5O,EACjD,IAAI2M,GAAI,GAAI1D,GACZ4F,GAAO1C,IAAIQ,GACXA,EAAEvD,cAAcwF,EAAMvF,UACpB,WACE1I,EAAEsK,OAAOZ,GACTwE,EAAOC,OAAOnC,GACdoC,KAEF,SAAU/O,GAAKW,EAAEqK,QAAQhL,IACzB,WACEW,EAAEsK,OAAOZ,GACTwE,EAAOC,OAAOnC,GACdoC,QAIN,SAAU/O,GAAKW,EAAEqK,QAAQhL,IACzB,WACEgP,GAAQ,EACR9F,EAAa+F,UACbF,OAKN,QAASA,KACPC,GAA2B,IAAlBH,EAAOtP,QAAgBoB,EAAEuK,cAjCpC,GAAI2D,GAAS,GAAI5C,IAAuB+C,GAAQ,EAAO9F,EAAe,GAAIC,GA0C1E,OANKuF,GAGHxF,EAAaE,cAAcsF,EAASrF,UAAUsF,EAAO,SAAU3O,GAAKW,EAAEqK,QAAQhL,IAAO2O,IAFrFA,IAKK,GAAI1C,IAAoB/C,EAAc2F,IAC5C/O,MAyBL,QAASoP,GAAStO,EAAQ2L,EAASjE,GAEjC,MADAE,IAAYF,KAAeA,EAAY6G,IAChC,GAAIpG,IAAoB,SAAUZ,GACvC,GAA2DrD,GAAvDyI,EAAa,GAAIpE,IAAoBiG,GAAW,EAAcC,EAAK,EACnEnG,EAAetI,EAAOyI,UACxB,SAAUgB,GACR+E,GAAW,EACXtK,EAAQuF,EACRgF,GACA,IAAIC,GAAYD,EACd1C,EAAI,GAAI1D,GACVsE,GAAWnE,cAAcuD,GACzBA,EAAEvD,cAAcd,EAAU2E,qBAAqBV,EAAS,WACtD6C,GAAYC,IAAOC,GAAanH,EAAS8C,OAAOnG,GAChDsK,GAAW,MAGf,SAAUpP,GACRuN,EAAW0B,UACX9G,EAAS6C,QAAQhL,GACjBoP,GAAW,EACXC,KAEF,WACE9B,EAAW0B,UACXG,GAAYjH,EAAS8C,OAAOnG,GAC5BqD,EAAS+C,cACTkE,GAAW,EACXC,KAEJ,OAAO,IAAIpD,IAAoB/C,EAAcqE,IAC5CzN,MAGL,QAASyP,GAAqB3O,EAAQ4O,GACpC,MAAO,IAAIzG,IAAoB,SAAUpI,GACvC,GAAImE,GAAOoF,GAAW,EAAOqD,EAAa,GAAIpE,IAAoBkG,EAAK,EACnEnG,EAAetI,EAAOyI,UACxB,SAAUgB,GACR,GAAIoF,GAAW1E,GAASyE,GAAkBnF,EAC1C,IAAIoF,IAAaxP,GAAY,MAAOU,GAAEqK,QAAQyE,EAASzP,EAEvD0P,IAAUD,KAAcA,EAAWE,GAAsBF,IAEzDvF,GAAW,EACXpF,EAAQuF,EACRgF,GACA,IAAIO,GAAYP,EAAI1C,EAAI,GAAI1D,GAC5BsE,GAAWnE,cAAcuD,GACzBA,EAAEvD,cAAcqG,EAASpG,UACvB,WACEa,GAAYmF,IAAOO,GAAajP,EAAEsK,OAAOnG,GACzCoF,GAAW,EACXyC,EAAEsC,WAEJ,SAAUjP,GAAKW,EAAEqK,QAAQhL,IACzB,WACEkK,GAAYmF,IAAOO,GAAajP,EAAEsK,OAAOnG,GACzCoF,GAAW,EACXyC,EAAEsC,cAIR,SAAUjP,GACRuN,EAAW0B,UACXtO,EAAEqK,QAAQhL,GACVkK,GAAW,EACXmF,KAEF,WACE9B,EAAW0B,UACX/E,GAAYvJ,EAAEsK,OAAOnG,GACrBnE,EAAEuK,cACFhB,GAAW,EACXmF,KAGJ,OAAO,IAAIpD,IAAoB/C,EAAcqE,IAC5C3M,GA8BL,QAASiP,GAAiBjP,EAAQkP,GAChC,MAAO,IAAI/G,IAAoB,SAAUpI,GAGvC,QAASoP,KACH7F,IACFA,GAAW,EACXvJ,EAAEsK,OAAOnG,IAEXkK,GAASrO,EAAEuK,cAPb,GAAmBpG,GAAfkK,GAAQ,EAAc9E,GAAW,EAUjC8F,EAAqB,GAAI/G,GAa7B,OAZA+G,GAAmB5G,cAAcxI,EAAOyI,UACtC,SAAU4G,GACR/F,GAAW,EACXpF,EAAQmL,GAEV,SAAUjQ,GAAKW,EAAEqK,QAAQhL,IACzB,WACEgP,GAAQ,EACRgB,EAAmBf,aAIhB,GAAIhD,IACT+D,EACAF,EAAQzG,UAAU0G,EAAiB,SAAU/P,GAAKW,EAAEqK,QAAQhL,IAAO+P,KAEpEnP,GA6BL,QAASsP,GAAoBtP,EAAQuP,EAAcC,EAAyBC,GAO1E,MANIjK,IAAW+J,KACbE,EAAQD,EACRA,EAA0BD,EAC1BA,EAAeG,MAEjBD,IAAUA,EAAQE,GAAgB,GAAIC,MAC/B,GAAIzH,IAAoB,SAAUpI,GAOvC,QAAS8P,GAASC,GAChB,GAAIC,GAAOtB,EAAI1C,EAAI,GAAI1D,GACvB2H,GAAMxH,cAAcuD,GACpBA,EAAEvD,cAAcsH,EAAQrH,UAAU,WAChCgG,IAAOsB,GAAQzH,EAAaE,cAAciH,EAAMhH,UAAU1I,IAC1DgM,EAAEsC,WACD,SAAUjP,GACXqP,IAAOsB,GAAQhQ,EAAEqK,QAAQhL,IACxB,WACDqP,IAAOsB,GAAQzH,EAAaE,cAAciH,EAAMhH,UAAU1I,OAM9D,QAASkQ,KACP,GAAIC,IAAOC,CAEX,OADID,IAAOzB,IACJyB,EAxBT,GAAI5H,GAAe,GAAIC,IAAoByH,EAAQ,GAAIzH,IAAoB6H,EAAW,GAAI/H,GAE1FC,GAAaE,cAAc4H,EAE3B,IAAI3B,GAAK,EAAG0B,GAAW,CAmCvB,OApBAN,GAASN,GAQTa,EAAS5H,cAAcxI,EAAOyI,UAAU,SAAUgB,GAChD,GAAIwG,IAAS,CACXlQ,EAAEsK,OAAOZ,EACT,IAAIqG,GAAU3F,GAASqF,GAAyB/F,EAChD,IAAIqG,IAAYzQ,GAAY,MAAOU,GAAEqK,QAAQ0F,EAAQ1Q,EACrDyQ,GAASf,GAAUgB,GAAWf,GAAsBe,GAAWA,KAEhE,SAAU1Q,GACX6Q,KAAWlQ,EAAEqK,QAAQhL,IACpB,WACD6Q,KAAWlQ,EAAEuK,iBAER,GAAIe,IAAoB/C,EAAc0H,IAC5ChQ,GAGL,QAAS8P,GAAQ9P,EAAQ2L,EAAS8D,EAAO/H,GACvC,GAAa,MAAT+H,EAAiB,KAAM,IAAInO,OAAM,uCACjCsG,IAAY6H,KACd/H,EAAY+H,EACZA,EAAQE,GAAgB,GAAIC,MAE1BH,YAAiBnO,SAASmO,EAAQE,GAAgBF,IACtD7H,GAAYF,KAAeA,EAAY6G,GAEvC,IAAI8B,GAAkB1E,YAAmB2E,MACvC,uBACA,sBAEF,OAAO,IAAInI,IAAoB,SAAUpI,GASvC,QAASwQ,KACP,GAAIR,GAAOtB,CACXuB,GAAMxH,cAAcd,EAAU2I,GAAiB1E,EAAS,WAClD8C,IAAOsB,IACTjB,GAAUW,KAAWA,EAAQV,GAAsBU,IACnDnH,EAAaE,cAAciH,EAAMhH,UAAU1I,QAbjD,GAAI0O,GAAK,EACP2B,EAAW,GAAI/H,IACfC,EAAe,GAAIC,IACnB4H,GAAW,EACXH,EAAQ,GAAIzH,GAiCd,OA/BAD,GAAaE,cAAc4H,GAY3BG,IAEAH,EAAS5H,cAAcxI,EAAOyI,UAAU,SAAUgB,GAC3C0G,IACH1B,IACA1O,EAAEsK,OAAOZ,GACT8G,MAED,SAAUnR,GACN+Q,IACH1B,IACA1O,EAAEqK,QAAQhL,KAEX,WACI+Q,IACH1B,IACA1O,EAAEuK,kBAGC,GAAIe,IAAoB/C,EAAc0H,IAC5ChQ,GAiGL,QAASwQ,IAAoBxQ,EAAQyQ,EAASC,GAC5C,MAAO,IAAIvI,IAAoB,SAAUpI,GAOvC,QAAS4Q,GAAKlH,EAAG3K,GAGf,GAFA8R,EAAO9R,GAAK2K,EACZH,EAASxK,IAAK,EACV+R,IAAgBA,EAAcvH,EAASwH,MAAMC,KAAY,CAC3D,GAAItG,EAAO,MAAO1K,GAAEqK,QAAQK,EAC5B,IAAIyF,GAAM/F,GAASuG,GAAgBzR,MAAM,KAAM2R,EAC/C,IAAIV,IAAQ7Q,GAAY,MAAOU,GAAEqK,QAAQ8F,EAAI9Q,EAC7CW,GAAEsK,OAAO6F,GAEXc,GAAUJ,EAAO,IAAM7Q,EAAEuK,cAf3B,GAIEG,GAJEnB,IAAY,GAAO,GACrBuH,GAAc,EACdG,GAAS,EACTJ,EAAS,GAAI/R,OAAM,EAerB,OAAO,IAAIwM,IACTrL,EAAOyI,UACL,SAAUgB,GACRkH,EAAKlH,EAAG,IAEV,SAAUrK,GACJwR,EAAO,GACT7Q,EAAEqK,QAAQhL,GAEVqL,EAAMrL,GAGV,WACE4R,GAAS,EACTJ,EAAO,IAAM7Q,EAAEuK,gBAEnBmG,EAAQhI,UACN,SAAUgB,GACRkH,EAAKlH,EAAG,IAEV,SAAUrK,GAAKW,EAAEqK,QAAQhL,IACzB,WACE4R,GAAS,EACTL,GAAK,EAAM,OAGhB3Q,GAvzKL,GAAIiR,KACFC,YAAY,EACZpP,QAAU,GAIVqP,GAAcF,SAAmBG,WAAYA,UAAYA,QAAQC,UAAYD,QAC7EE,GAAWL,SAAmB/E,QAASA,KAAK5G,QAAU4G,KACtDqF,GAAaN,SAAmBO,UAAWA,QAAUA,OAAOlM,QAAUkM,OACtEC,GAAaR,SAAmBS,UAAWA,SAAWA,OAAOL,UAAYK,OACzEC,GAAgBF,IAAcA,GAAWL,UAAYD,IAAeA,GACpES,GAAaT,IAAeM,IAA+B,gBAAVI,SAAsBA,QAAUA,OAAOvM,QAAUuM,OAEhGpL,GAAOA,GAAOmL,IAAgBL,MAAgBrS,MAAQA,KAAKsS,SAAYD,IAAeD,IAAYpS,KAElG4S,IACFC,aACAC,QACEC,QAASxL,GAAKwL,SAEhBC,YAIEC,GAAOL,GAAGI,QAAQC,KAAO,aAC3BpB,GAAWe,GAAGI,QAAQnB,SAAW,SAAUtH,GAAK,MAAOA,IACvD2I,GAAaN,GAAGI,QAAQE,WAAa9B,KAAKnE,IAC1CkG,GAAkBP,GAAGI,QAAQG,gBAAkB,SAAU5I,EAAG6I,GAAK,MAAOC,IAAQ9I,EAAG6I,IACnFE,GAAqBV,GAAGI,QAAQM,mBAAqB,SAAU/I,EAAG6I,GAAK,MAAO7I,GAAI6I,EAAI,EAASA,EAAJ7I,EAAQ,GAAK,GAExGgJ,IADuBX,GAAGI,QAAQQ,qBAAuB,SAAUjJ,GAAK,MAAOA,GAAElG,YAClEuO,GAAGI,QAAQO,aAAe,SAAUhI,GAAO,KAAMA,KAChEqE,GAAYgD,GAAGI,QAAQpD,UAAY,SAAUnF,GAAK,QAASA,GAA4B,kBAAhBA,GAAElB,WAA8C,kBAAXkB,GAAEgJ,MAC9GnN,GAAasM,GAAGI,QAAQ1M,WAAc,WAEpC,GAAIoN,GAAO,SAAU1O,GACnB,MAAuB,kBAATA,KAAuB,EAUvC,OANI0O,GAAK,OACPA,EAAO,SAAS1O,GACd,MAAuB,kBAATA,IAA+C,qBAAxBX,GAASlB,KAAK6B,KAIhD0O,KASPvT,IAAYD,MAWZ+K,GAAW2H,GAAGC,UAAU5H,SAAW,SAAkBN,GACvD,IAAKrE,GAAWqE,GAAO,KAAM,IAAI/C,WAAU,wBAC3C,OAAO/H,GAAc8K,GAMvBiI,IAAGE,OAAOa,kBAAmB,CAC7B,IAAInT,KAAY,EAAOI,GAASqK,GAAS,WAAc,KAAM,IAAI7I,UACjE5B,MAAcI,GAAOV,KAAOU,GAAOV,EAAEO,KAGrC,IAAmCuB,IAA/BC,GAAgBE,IAEhBxB,GAAuB,uBAoFvBiT,GAAahB,GAAGgB,WAAa,WAC/B5T,KAAK6T,QAAU,iCACf7T,KAAK8T,KAAO,aACZ1R,MAAMe,KAAKnD,MAEb4T,IAAW5P,UAAYoC,OAAO2N,OAAO3R,MAAM4B,UAE3C,IAAIgQ,IAAsBpB,GAAGoB,oBAAsB,WACjDhU,KAAK6T,QAAU,2BACf7T,KAAK8T,KAAO,sBACZ1R,MAAMe,KAAKnD,MAEbgU,IAAoBhQ,UAAYoC,OAAO2N,OAAO3R,MAAM4B,UAEpD,IAAIiQ,IAA0BrB,GAAGqB,wBAA0B,WACzDjU,KAAK6T,QAAU,wBACf7T,KAAK8T,KAAO,0BACZ1R,MAAMe,KAAKnD,MAEbiU,IAAwBjQ,UAAYoC,OAAO2N,OAAO3R,MAAM4B,UAExD,IAAIkQ,IAAoBtB,GAAGsB,kBAAoB,SAAUL,GACvD7T,KAAK6T,QAAUA,GAAW,kCAC1B7T,KAAK8T,KAAO,oBACZ1R,MAAMe,KAAKnD,MAEbkU,IAAkBlQ,UAAYoC,OAAO2N,OAAO3R,MAAM4B,UAElD,IAAImQ,IAAsBvB,GAAGuB,oBAAsB,SAAUN,GAC3D7T,KAAK6T,QAAUA,GAAW,oCAC1B7T,KAAK8T,KAAO,sBACZ1R,MAAMe,KAAKnD,MAEbmU,IAAoBnQ,UAAYoC,OAAO2N,OAAO3R,MAAM4B,UAEpD,IAAIoQ,IAAiBxB,GAAGI,QAAQoB,eAAiB,WAC/C,KAAM,IAAID,KAGRE,GAAezB,GAAGI,QAAQqB,aAAe,WAC3C,KAAM,IAAIH,KAIRvM,GAAgC,kBAAX2M,SAAyBA,OAAOC,UACvD,oBAEEhN,IAAKiN,KAA+C,mBAAjC,GAAIjN,IAAKiN,KAAM,gBACpC7M,GAAa,aAGf,IAAI8M,IAAiB7B,GAAG6B,gBAAmBxF,MAAM,EAAMjK,MAAO3F,GAE1DqV,GAAa9B,GAAGI,QAAQ0B,WAAa,SAAU7T,GACjD,MAAOA,GAAE8G,MAAgBtI,GAGvBsV,GAAc/B,GAAGI,QAAQ2B,YAAc,SAAU9T,GACnD,MAAOA,IAAKA,EAAEpB,SAAWJ,EAG3BuT,IAAGI,QAAQuB,SAAW5M,EAEtB,IAmDEiN,IAnDEC,GAAejC,GAAGC,UAAUgC,aAAe,SAAUC,EAAMC,EAASC,GACtE,GAAuB,mBAAZD,GAA2B,MAAOD,EAC7C,QAAOE,GACL,IAAK,GACH,MAAO,YACL,MAAOF,GAAK3R,KAAK4R,GAErB,KAAK,GACH,MAAO,UAASE,GACd,MAAOH,GAAK3R,KAAK4R,EAASE,GAE9B,KAAK,GACH,MAAO,UAASjQ,EAAOlB,GACrB,MAAOgR,GAAK3R,KAAK4R,EAAS/P,EAAOlB,GAErC,KAAK,GACH,MAAO,UAASkB,EAAOlB,EAAOoR,GAC5B,MAAOJ,GAAK3R,KAAK4R,EAAS/P,EAAOlB,EAAOoR,IAI9C,MAAO,YACL,MAAOJ,GAAK/U,MAAMgV,EAAS9U,aAK3BuE,IAAa,WACf,iBACA,UACA,iBACA,gBACA,uBACA,eACFT,GAAkBS,GAAU/E,OAGxB+F,GAAY,qBACdQ,GAAa,iBACbN,GAAY,mBACZC,GAAY,gBACZvB,GAAa,iBACb+Q,GAAY,oBACZvP,GAAc,kBACdH,GAAc,kBACdI,GAAc,kBACd1B,GAAc,kBAEZE,GAAW+B,OAAOpC,UAAUK,SAC9BI,GAAiB2B,OAAOpC,UAAUS,eAClC2Q,GAAoB/Q,GAASlB,KAAKlD,YAAcuF,GAEhDhC,GAAapB,MAAM4B,UACnBL,GAAcyC,OAAOpC,UACrBE,GAAc4B,OAAO9B,UACrBqR,GAAuB1R,GAAY0R,oBAErC,KACET,KAAqBvQ,GAASlB,KAAKmS,WAAa7P,OAAmBpB,SAAY,GAAM,KACrF,MAAOnE,IACP0U,IAAmB,EAGrB,GAAIrQ,MACJA,IAAayB,IAAczB,GAAaoB,IAAapB,GAAaqB,KAAiB/B,aAAe,EAAM0R,gBAAkB,EAAMlR,UAAY,EAAMmR,SAAW,GAC7JjR,GAAamB,IAAanB,GAAaJ,KAAiBN,aAAe,EAAMQ,UAAY,EAAMmR,SAAW,GAC1GjR,GAAaH,IAAcG,GAAa4Q,IAAa5Q,GAAasB,KAAiBhC,aAAe,EAAMQ,UAAY,GACpHE,GAAakB,KAAiB5B,aAAe,EAE7C,IAAId,QACH,WACC,GAAIa,GAAO,WAAa5D,KAAKuK,EAAI,GAC/B1F,IAEFjB,GAAKI,WAAcwR,QAAW,EAAGpC,EAAK,EACtC,KAAK,GAAI3P,KAAO,IAAIG,GAAQiB,EAAMnD,KAAK+B,EACvC,KAAKA,IAAOxD,YAGZ8C,GAAQQ,eAAiB8R,GAAqBlS,KAAKK,GAAY,YAAc6R,GAAqBlS,KAAKK,GAAY,QAGnHT,GAAQM,eAAiBgS,GAAqBlS,KAAKS,EAAM,aAGzDb,GAAQC,YAAqB,GAAPS,EAGtBV,GAAQW,gBAAkB,UAAU+R,KAAK5Q,IACzC,EAEF,IAAI/B,IAAW8P,GAAGC,UAAU/P,SAAW,SAASkC,GAC9C,GAAIK,SAAcL,EAClB,OAAOA,KAAkB,YAARK,GAA8B,UAARA,KAAqB,GAgE1DpC,GAAc,SAAS+B,GACzB,MAAQA,IAAyB,gBAATA,GAAqBX,GAASlB,KAAK6B,IAAUQ,IAAY,EAI9E4P,MACHnS,GAAc,SAAS+B,GACrB,MAAQA,IAAyB,gBAATA,GAAqBP,GAAetB,KAAK6B,EAAO,WAAY,GAIxF,IAAIqO,IAAUT,GAAGC,UAAUQ,QAAU,SAAU9I,EAAG6I,GAChD,MAAOnO,GAAWsF,EAAG6I,UA+InBlQ,OADauB,eACL9E,MAAMqE,UAAUd,OAExBwS,GAAW9C,GAAGC,UAAU6C,SAAW,SAAUC,EAAOrN,GACtD,QAASsN,KAAO5V,KAAK6D,YAAc8R,EACnCC,EAAG5R,UAAYsE,EAAOtE,UACtB2R,EAAM3R,UAAY,GAAI4R,IAGpBC,GAAgBjD,GAAGC,UAAUgD,cAAgB,SAAUC,GACzD,IAAI,GAAIC,MAAcnW,EAAI,EAAGJ,EAAMS,UAAUR,OAAYD,EAAJI,EAASA,IAAOmW,EAAQrU,KAAKzB,UAAUL,GAC5F,KAAK,GAAIoW,GAAM,EAAGC,EAAKF,EAAQtW,OAAcwW,EAAND,EAAUA,IAAO,CACtD,GAAIlV,GAASiV,EAAQC,EACrB,KAAK,GAAIE,KAAQpV,GACfgV,EAAII,GAAQpV,EAAOoV,KAwBrB/J,IAlBSyG,GAAGC,UAAUsD,OAAS,SAAUC,EAAIC,GAC/C,MAAO,IAAIpN,IAAoB,SAAUZ,GACvC,MAAO,IAAI8D,IAAoBkK,EAAEC,gBAAiBF,EAAG7M,UAAUlB,OAgBzCuK,GAAGzG,oBAAsB,WACjD,GAAevM,GAAGJ,EAAdmK,IACJ,IAAIhK,MAAM4W,QAAQtW,UAAU,IAC1B0J,EAAO1J,UAAU,GACjBT,EAAMmK,EAAKlK,WAIX,KAFAD,EAAMS,UAAUR,OAChBkK,EAAO,GAAIhK,OAAMH,GACbI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EAEjD,KAAIA,EAAI,EAAOJ,EAAJI,EAASA,IAClB,IAAK4W,GAAa7M,EAAK/J,IAAO,KAAM,IAAIgI,WAAU,mBAEpD5H,MAAKkM,YAAcvC,EACnB3J,KAAK8L,YAAa,EAClB9L,KAAKP,OAASkK,EAAKlK,SAGjBgX,GAA+BtK,GAAoBnI,SAMvDyS,IAA6BpK,IAAM,SAAUC,GACvCtM,KAAK8L,WACPQ,EAAK6C,WAELnP,KAAKkM,YAAYxK,KAAK4K,GACtBtM,KAAKP,WASTgX,GAA6BzH,OAAS,SAAU1C,GAC9C,GAAIoK,IAAgB,CACpB,KAAK1W,KAAK8L,WAAY,CACpB,GAAIkK,GAAMhW,KAAKkM,YAAYxL,QAAQ4L,EACvB,MAAR0J,IACFU,GAAgB,EAChB1W,KAAKkM,YAAYyK,OAAOX,EAAK,GAC7BhW,KAAKP,SACL6M,EAAK6C,WAGT,MAAOuH,IAMTD,GAA6BtH,QAAU,WACrC,IAAKnP,KAAK8L,WAAY,CACpB9L,KAAK8L,YAAa,CAElB,KAAI,GADAtM,GAAMQ,KAAKkM,YAAYzM,OAAQmX,EAAqB,GAAIjX,OAAMH,GAC1DI,EAAI,EAAOJ,EAAJI,EAASA,IAAOgX,EAAmBhX,GAAKI,KAAKkM,YAAYtM,EAIxE,KAHAI,KAAKkM,eACLlM,KAAKP,OAAS,EAETG,EAAI,EAAOJ,EAAJI,EAASA,IACnBgX,EAAmBhX,GAAGuP,WAS5B,IAAI0H,IAAajE,GAAGiE,WAAa,SAAUC,GACzC9W,KAAK8L,YAAa,EAClB9L,KAAK8W,OAASA,GAAU7D,GAI1B4D,IAAW7S,UAAUmL,QAAU,WACxBnP,KAAK8L,aACR9L,KAAK8W,SACL9W,KAAK8L,YAAa,GAStB,IAAIiL,IAAmBF,GAAW9C,OAAS,SAAU+C,GAAU,MAAO,IAAID,IAAWC,IAKjFE,GAAkBH,GAAWI,OAAU9H,QAAS8D,IAOhDuD,GAAeK,GAAWL,aAAe,SAAU3J,GACrD,MAAOA,IAAKvG,GAAWuG,EAAEsC,UAGvB+H,GAAgBL,GAAWK,cAAgB,SAAUC,GACvD,GAAIA,EAAWrL,WAAc,KAAM,IAAIkI,KAIrC7K,GAA6ByJ,GAAGzJ,2BAA6B,WAC/DnJ,KAAK8L,YAAa,EAClB9L,KAAKoX,QAAU,KAEjBjO,IAA2BnF,UAAUsS,cAAgB,WACnD,MAAOtW,MAAKoX,SAEdjO,GAA2BnF,UAAUsF,cAAgB,SAAUtE,GAC7D,GAAIhF,KAAKoX,QAAW,KAAM,IAAIhV,OAAM,uCACpC,IAAIsU,GAAgB1W,KAAK8L,YACxB4K,IAAkB1W,KAAKoX,QAAUpS,GAClC0R,GAAiB1R,GAASA,EAAMmK,WAElChG,GAA2BnF,UAAUmL,QAAU,WAC7C,IAAKnP,KAAK8L,WAAY,CACpB9L,KAAK8L,YAAa,CAClB,IAAIuL,GAAMrX,KAAKoX,OACfpX,MAAKoX,QAAU,KAEjBC,GAAOA,EAAIlI,UAIb,IAAI9F,IAAmBuJ,GAAGvJ,iBAAmB,WAC3CrJ,KAAK8L,YAAa,EAClB9L,KAAKoX,QAAU,KAEjB/N,IAAiBrF,UAAUsS,cAAgB,WACzC,MAAOtW,MAAKoX,SAEd/N,GAAiBrF,UAAUsF,cAAgB,SAAUtE,GACnD,GAAI0R,GAAgB1W,KAAK8L,UACzB,KAAK4K,EAAe,CAClB,GAAIW,GAAMrX,KAAKoX,OACfpX,MAAKoX,QAAUpS,EAEjBqS,GAAOA,EAAIlI,UACXuH,GAAiB1R,GAASA,EAAMmK,WAElC9F,GAAiBrF,UAAUmL,QAAU,WACnC,IAAKnP,KAAK8L,WAAY,CACpB9L,KAAK8L,YAAa,CAClB,IAAIuL,GAAMrX,KAAKoX,OACfpX,MAAKoX,QAAU,KAEjBC,GAAOA,EAAIlI,UAMb,IAuDImI,KAvDqB1E,GAAG2E,mBAAqB,WAE/C,QAASC,GAAgBL,GACvBnX,KAAKmX,WAAaA,EAClBnX,KAAKmX,WAAWzQ,QAChB1G,KAAKyX,iBAAkB,EAmBzB,QAASF,GAAmBJ,GAC1BnX,KAAK0X,qBAAuBP,EAC5BnX,KAAK8L,YAAa,EAClB9L,KAAK2X,mBAAoB,EACzB3X,KAAK0G,MAAQ,EAwBf,MA5CA8Q,GAAgBxT,UAAUmL,QAAU,WAC7BnP,KAAKmX,WAAWrL,YAAe9L,KAAKyX,kBACvCzX,KAAKyX,iBAAkB,EACvBzX,KAAKmX,WAAWzQ,QACc,IAA1B1G,KAAKmX,WAAWzQ,OAAe1G,KAAKmX,WAAWQ,oBACjD3X,KAAKmX,WAAWrL,YAAa,EAC7B9L,KAAKmX,WAAWO,qBAAqBvI,aAoB3CoI,EAAmBvT,UAAUmL,QAAU,WAChCnP,KAAK8L,YAAe9L,KAAK2X,oBAC5B3X,KAAK2X,mBAAoB,EACN,IAAf3X,KAAK0G,QACP1G,KAAK8L,YAAa,EAClB9L,KAAK0X,qBAAqBvI,aAShCoI,EAAmBvT,UAAUsS,cAAgB,WAC3C,MAAOtW,MAAK8L,WAAakL,GAAkB,GAAIQ,GAAgBxX,OAG1DuX,KAGW3E,GAAGC,UAAUyE,cAAgB,SAAU9O,EAAWoP,EAAOd,EAAQrK,EAASoL,GAC5F7X,KAAKwI,UAAYA,EACjBxI,KAAK4X,MAAQA,EACb5X,KAAK8W,OAASA,EACd9W,KAAKyM,QAAUA,EACfzM,KAAK6X,SAAWA,GAAYvE,GAC5BtT,KAAKmX,WAAa,GAAIhO,KAGxBmO,IAActT,UAAU8T,OAAS,WAC/B9X,KAAKmX,WAAW7N,cAActJ,KAAK+X,eAGrCT,GAActT,UAAUgU,UAAY,SAAUzH,GAC5C,MAAOvQ,MAAK6X,SAAS7X,KAAKyM,QAAS8D,EAAM9D,UAG3C6K,GAActT,UAAUiU,YAAc,WACpC,MAAOjY,MAAKmX,WAAWrL,YAGzBwL,GAActT,UAAU+T,WAAa,WACnC,MAAO/X,MAAK8W,OAAO9W,KAAKwI,UAAWxI,KAAK4X,OAI1C,IAAIM,IAAYtF,GAAGsF,UAAa,WAE9B,QAASA,GAAUjL,EAAKkL,EAAUC,EAAkBC,GAClDrY,KAAKiN,IAAMA,EACXjN,KAAKsY,UAAYH,EACjBnY,KAAKuY,kBAAoBH,EACzBpY,KAAKwY,kBAAoBH,EAQ3B,QAASI,GAAajQ,EAAWsO,GAE/B,MADAA,KACOE,GANTkB,EAAUxP,YAAc,SAAU7B,GAChC,MAAOA,aAAaqR,GAQtB,IAAIQ,GAAiBR,EAAUlU,SA4E/B,OArEA0U,GAAeP,SAAW,SAAUrB,GAClC,MAAO9W,MAAKsY,UAAUxB,EAAQ2B,IAShCC,EAAeC,kBAAoB,SAAUf,EAAOd,GAClD,MAAO9W,MAAKsY,UAAUV,EAAOd,IAS/B4B,EAAevL,qBAAuB,SAAUV,EAASqK,GACvD,MAAO9W,MAAKuY,kBAAkBzB,EAAQrK,EAASgM,IAUjDC,EAAeE,6BAA+B,SAAUhB,EAAOnL,EAASqK,GACtE,MAAO9W,MAAKuY,kBAAkBX,EAAOnL,EAASqK,IAShD4B,EAAehM,qBAAuB,SAAUD,EAASqK,GACvD,MAAO9W,MAAKwY,kBAAkB1B,EAAQrK,EAASgM,IAUjDC,EAAeG,6BAA+B,SAAUjB,EAAOnL,EAASqK,GACtE,MAAO9W,MAAKwY,kBAAkBZ,EAAOnL,EAASqK,IAIhDoB,EAAUjL,IAAMiG,GAOhBgF,EAAUY,UAAY,SAAUC,GAE9B,MADW,GAAXA,IAAiBA,EAAW,GACrBA,GAGFb,KAGLpL,GAAgBoL,GAAUY,UAAWpQ,GAAcwP,GAAUxP,aAEhE,SAAUgQ,GAET,QAASM,GAAmBxQ,EAAWyQ,GAKrC,QAASC,GAAYC,GASnB,QAASC,GAAaC,EAAGC,GAOvB,MANIC,GACFC,EAAMxK,OAAOnC,GAEbiF,GAAS,EAEXgF,EAAOwC,EAAQJ,GACRlC,GAfT,GAAIuC,IAAU,EAAOzH,GAAS,EAE1BjF,EAAIrE,EAAUmQ,kBAAkBQ,EAAQC,EACvCtH,KACH0H,EAAMnN,IAAIQ,GACV0M,GAAU,GAVd,GAAI3B,GAAQqB,EAAK,GAAInC,EAASmC,EAAK,GAAIO,EAAQ,GAAIrN,GAEnD,OADA2K,GAAOc,EAAOsB,GACPM,EAuBT,QAASC,GAAcjR,EAAWyQ,EAAMS,GAKtC,QAASR,GAAYC,EAAQQ,GAS3B,QAASP,GAAaC,EAAGC,GAOvB,MANIC,GACFC,EAAMxK,OAAOnC,GAEbiF,GAAS,EAEXgF,EAAOwC,EAAQJ,GACRlC,GAfT,GAAIuC,IAAU,EAAOzH,GAAS,EAE1BjF,EAAIrE,EAAUkR,GAAQP,EAAQQ,EAAUP,EACvCtH,KACH0H,EAAMnN,IAAIQ,GACV0M,GAAU,GAVd,GAAI3B,GAAQqB,EAAK,GAAInC,EAASmC,EAAK,GAAIO,EAAQ,GAAIrN,GAEnD,OADA2K,GAAOc,EAAOsB,GACPM,EAuBT,QAASI,GAAsB/S,EAAG4D,GAChC,MAAOgP,GAAc5S,EAAG4D,EAAG,gCAG7B,QAASoP,GAAsBhT,EAAG4D,GAChC,MAAOgP,GAAc5S,EAAG4D,EAAG,gCAG7B,QAASqP,GAAuBhD,EAAQ9J,GACtC8J,EAAO,SAASiD,GAAM/M,EAAK8J,EAAQiD,KAQrCrB,EAAesB,kBAAoB,SAAUlD,GAC3C,MAAO9W,MAAKia,2BAA2BnD,EAAQgD,IASjDpB,EAAeuB,2BAA6B,SAAUrC,EAAOd,GAC3D,MAAO9W,MAAK2Y,mBAAmBf,EAAOd,GAASkC,IASjDN,EAAexK,8BAAgC,SAAUzB,EAASqK,GAChE,MAAO9W,MAAKka,sCAAsCpD,EAAQrK,EAASqN,IAUrEpB,EAAewB,sCAAwC,SAAUtC,EAAOnL,EAASqK,GAC/E,MAAO9W,MAAKuY,mBAAmBX,EAAOd,GAASrK,EAASmN,IAS1DlB,EAAeyB,8BAAgC,SAAU1N,EAASqK,GAChE,MAAO9W,MAAK+M,sCAAsC+J,EAAQrK,EAASqN,IAUrEpB,EAAe3L,sCAAwC,SAAU6K,EAAOnL,EAASqK,GAC/E,MAAO9W,MAAKwY,mBAAmBZ,EAAOd,GAASrK,EAASoN,KAE1D3B,GAAUlU,WAEX,SAAU0U,GAQTR,GAAUlU,UAAUoW,iBAAmB,SAAUxN,EAAQkK,GACvD,MAAO9W,MAAKqN,0BAA0B,KAAMT,EAAQkK,IAUtDoB,GAAUlU,UAAUqJ,0BAA4B,SAASuK,EAAOhL,EAAQkK,GACtE,GAAgC,mBAArBvP,IAAK8S,YAA+B,KAAM,IAAInG,GACzDtH,GAASE,GAAcF,EACvB,IAAI/F,GAAI+Q,EAAOrI,EAAKhI,GAAK8S,YAAY,WAAcxT,EAAIiQ,EAAOjQ,IAAO+F,EACrE,OAAOmK,IAAiB,WAAcxP,GAAK+S,cAAc/K,OAG3D2I,GAAUlU,UAGZ,IAoEIuW,IAAgBC,GApEhBC,GAAqBvC,GAAUwC,UAAa,WAC9C,QAASC,GAAY/C,EAAOd,GAAU,MAAOA,GAAO9W,KAAM4X,GAC1D,MAAO,IAAIM,IAAUhF,GAAYyH,EAAatG,GAAcA,OAM1D1L,GAAyBuP,GAAU0C,cAAiB,WAGtD,QAASC,KACP,KAAOC,EAAMrb,OAAS,GAAG,CACvB,GAAI6M,GAAOwO,EAAMzM,SAChB/B,EAAK2L,eAAiB3L,EAAKwL,UAIhC,QAAS6C,GAAY/C,EAAOd,GAC1B,GAAIiE,GAAK,GAAIzD,IAActX,KAAM4X,EAAOd,EAAQ9W,KAAKiN,MAErD,IAAK6N,EAOHA,EAAMpZ,KAAKqZ,OAPD,CACVD,GAASC,EAET,IAAIlY,GAASoI,GAAS4P,IAEtB,IADAC,EAAQ,KACJjY,IAAW1C,GAAY,MAAOC,GAAQyC,EAAO3C,GAInD,MAAO6a,GAAG5D,WArBZ,GAAI2D,GAwBAE,EAAmB,GAAI9C,IAAUhF,GAAYyH,EAAatG,GAAcA,GAG5E,OAFA2G,GAAiBC,iBAAmB,WAAc,OAAQH,GAEnDE,KAkCLE,IA/B4BtI,GAAGC,UAAUsI,0BAA6B,WACxE,QAASC,GAAKC,EAASC,GACrBA,EAAQ,EAAGtb,KAAKub,QAChB,KACEvb,KAAKwb,OAASxb,KAAKyb,QAAQzb,KAAKwb,QAChC,MAAOtb,GAEP,KADAF,MAAK0b,QAAQvM,UACPjP,GAIV,QAASib,GAA0B3S,EAAWoP,EAAOhL,EAAQkK,GAC3D9W,KAAK2b,WAAanT,EAClBxI,KAAKwb,OAAS5D,EACd5X,KAAKub,QAAU3O,EACf5M,KAAKyb,QAAU3E,EAWjB,MARAqE,GAA0BnX,UAAU6K,MAAQ,WAC1C,GAAIhC,GAAI,GAAI1D,GAIZ,OAHAnJ,MAAK0b,QAAU7O,EACfA,EAAEvD,cAActJ,KAAK2b,WAAWzB,sCAAsC,EAAGla,KAAKub,QAASH,EAAKQ,KAAK5b,QAE1F6M,GAGFsO,KAKS,WAChB,GAAIU,GAAiBC,EAAoB7I,EACzC,IAAM1L,GAAKwU,WACTF,EAAkBtU,GAAKwU,WACvBD,EAAoBvU,GAAKyU,iBACpB,CAAA,IAAMzU,GAAK0U,QAMhB,KAAM,IAAI/H,GALV2H,GAAkB,SAAUlR,EAAIuR,GAC9B3U,GAAK0U,QAAQE,MAAMD,GACnBvR,KAMJ,OACEoR,WAAYF,EACZG,aAAcF,OAGdD,GAAkBX,GAAWa,WAC/BD,GAAoBZ,GAAWc,cAEhC,WAQC,QAASI,GAAQC,GACf,GAAIC,EACFT,GAAgB,WAAcO,EAAQC,IAAW,OAC5C,CACL,GAAIE,GAAOC,EAAcH,EACzB,IAAIE,EAAM,CACRD,GAAmB,CACnB,IAAIzZ,GAASoI,GAASsR,IAGtB,IAFA/B,GAAY6B,GACZC,GAAmB,EACfzZ,IAAW1C,GAAY,MAAOC,GAAQyC,EAAO3C,KAcvD,QAASuc,KAEP,IAAKlV,GAAKmV,aAAenV,GAAKoV,cAAiB,OAAO,CACtD,IAAIC,IAAU,EAAOC,EAAatV,GAAKuV,SAMvC,OAJAvV,IAAKuV,UAAY,WAAcF,GAAU,GACzCrV,GAAKmV,YAAY,GAAI,KACrBnV,GAAKuV,UAAYD,EAEVD,EAuBP,QAASG,GAAoBC,GAED,gBAAfA,GAAMC,MAAqBD,EAAMC,KAAKC,UAAU,EAAGC,EAAW1d,UAAY0d,GACnFf,EAAQY,EAAMC,KAAKC,UAAUC,EAAW1d,SAjE9C,GAAI2d,GAAa,EAAGZ,KAAoBF,GAAmB,CAE3D9B,IAAc,SAAU6B,SACfG,GAAcH,GAkBvB,IAAIgB,GAAWC,OAAO,IACpBxX,OAAOzB,IACJkZ,QAAQ,sBAAuB,QAC/BA,QAAQ,wBAAyB,OAAS,KAG3CC,EAAiG,mBAA1EA,EAAe9K,IAAcD,IAAiBC,GAAW8K,gBACjFH,EAAS5H,KAAK+H,IAAiBA,CAelC,IAAIlX,GAAWkX,GACbjD,GAAiB,SAAUzD,GACzB,GAAIvH,GAAK6N,GAIT,OAHAZ,GAAcjN,GAAMuH,EACpB0G,EAAa,WAAcpB,EAAQ7M,KAE5BA,OAEJ,IAAuB,mBAAZkO,UAAyD,wBAA3BpZ,SAASlB,KAAKsa,SAC5DlD,GAAiB,SAAUzD,GACzB,GAAIvH,GAAK6N,GAIT,OAHAZ,GAAcjN,GAAMuH,EACpB2G,QAAQC,SAAS,WAActB,EAAQ7M,KAEhCA,OAEJ,IAAIkN,IAAwB,CACjC,GAAIU,GAAa,iBAAmBnV,KAAK2V,QASrCpW,IAAKsE,iBACPtE,GAAKsE,iBAAiB,UAAWkR,GAAqB,GAC7CxV,GAAKqW,YACdrW,GAAKqW,YAAY,YAAab,GAE9BxV,GAAKuV,UAAYC,EAGnBxC,GAAiB,SAAUzD,GACzB,GAAIvH,GAAK6N,GAGT,OAFAZ,GAAcjN,GAAMuH,EACpBvP,GAAKmV,YAAYS,EAAa3N,UAAW,KAClCD,OAEJ,IAAMhI,GAAKsW,eAAgB,CAChC,GAAIC,GAAU,GAAIvW,IAAKsW,cAEvBC,GAAQC,MAAMjB,UAAY,SAAU5c,GAAKkc,EAAQlc,EAAE+c,OAEnD1C,GAAiB,SAAUzD,GACzB,GAAIvH,GAAK6N,GAGT,OAFAZ,GAAcjN,GAAMuH,EACpBgH,EAAQE,MAAMtB,YAAYnN,GACnBA,OAITgL,IAFS,YAAchT,KAAQ,sBAAwBA,IAAK+N,SAAS2I,cAAc,UAElE,SAAUnH,GACzB,GAAIoH,GAAgB3W,GAAK+N,SAAS2I,cAAc,UAC5C1O,EAAK6N,GAUT,OATAZ,GAAcjN,GAAMuH,EAEpBoH,EAAcC,mBAAqB,WACjC/B,EAAQ7M,GACR2O,EAAcC,mBAAqB,KACnCD,EAAcE,WAAWC,YAAYH,GACrCA,EAAgB,MAElB3W,GAAK+N,SAASgJ,gBAAgBC,YAAYL,GACnC3O,GAIQ,SAAUuH,GACzB,GAAIvH,GAAK6N,GAMT,OALAZ,GAAcjN,GAAMuH,EACpB+E,GAAgB,WACdO,EAAQ7M,IACP,GAEIA,KAQb,IA6PIiP,IA7PAnP,GAAmB6I,GAAUtH,QAAUsH,GAAU,WAAa,WAEhE,QAASyC,GAAY/C,EAAOd,GAC1B,GAAItO,GAAYxI,KAAMmX,EAAa,GAAIhO,IACnCoG,EAAKgL,GAAe,YACrBpD,EAAWrL,YAAcqL,EAAW7N,cAAcwN,EAAOtO,EAAWoP,KAEvE,OAAO,IAAIzL,IAAoBgL,EAAYJ,GAAiB,WAC1DyD,GAAYjL,MAIhB,QAAS6I,GAAiBR,EAAOnL,EAASqK,GACxC,GAAItO,GAAYxI,KAAM+Z,EAAK7B,GAAUY,UAAUrM,GAAU0K,EAAa,GAAIhO,GAC1E,IAAW,IAAP4Q,EAAY,MAAOvR,GAAUmQ,kBAAkBf,EAAOd,EAC1D,IAAIvH,GAAKsM,GAAgB,YACtB1E,EAAWrL,YAAcqL,EAAW7N,cAAcwN,EAAOtO,EAAWoP,KACpEmC,EACH,OAAO,IAAI5N,IAAoBgL,EAAYJ,GAAiB,WAC1D+E,GAAkBvM,MAItB,QAAS8I,GAAiBT,EAAOnL,EAASqK,GACxC,MAAO9W,MAAK4Y,6BAA6BhB,EAAOnL,EAAUzM,KAAKiN,MAAO6J,GAGxE,MAAO,IAAIoB,IAAUhF,GAAYyH,EAAavC,EAAkBC,MAM9DoG,GAAe7L,GAAG6L,aAAe,WACnC,QAASA,GAAaxQ,EAAMjJ,EAAO0I,EAAWY,EAAQoQ,EAAkBra,GACtErE,KAAKiO,KAAOA,EACZjO,KAAKgF,MAAQA,EACbhF,KAAK0N,UAAYA,EACjB1N,KAAK2e,QAAUrQ,EACftO,KAAK4e,kBAAoBF,EACzB1e,KAAKqE,SAAWA,EAoClB,MAxBAoa,GAAaza,UAAUsK,OAAS,SAAUuQ,EAAkB3T,EAASE,GACnE,MAAOyT,IAAgD,gBAArBA,GAChC7e,KAAK4e,kBAAkBC,GACvB7e,KAAK2e,QAAQE,EAAkB3T,EAASE,IAU5CqT,EAAaza,UAAU8a,aAAe,SAAUtW,GAC9C,GAAIwE,GAAOhN,IAEX,OADA0I,IAAYF,KAAeA,EAAYiS,IAChC,GAAIxR,IAAoB,SAAUZ,GACvC,MAAOG,GAAUmQ,kBAAkB3L,EAAM,SAAUqM,EAAGtL,GACpDA,EAAa6Q,kBAAkBvW,GACT,MAAtB0F,EAAaE,MAAgB5F,EAAS+C,mBAKrCqT,KAQLM,GAA2BN,GAAaO,aAAgB,WACxD,QAASL,GAAQxT,GAAU,MAAOA,GAAOnL,KAAKgF,OAC9C,QAAS4Z,GAAkBvW,GAAY,MAAOA,GAAS8C,OAAOnL,KAAKgF,OACnE,QAASX,KAAa,MAAO,UAAYrE,KAAKgF,MAAQ,IAEtD,MAAO,UAAUA,GACf,MAAO,IAAIyZ,IAAa,IAAKzZ,EAAO,KAAM2Z,EAASC,EAAmBva,OASxE4a,GAA4BR,GAAaS,cAAiB,WAC5D,QAASP,GAASxT,EAAQD,GAAW,MAAOA,GAAQlL,KAAK0N,WACzD,QAASkR,GAAkBvW,GAAY,MAAOA,GAAS6C,QAAQlL,KAAK0N,WACpE,QAASrJ,KAAc,MAAO,WAAarE,KAAK0N,UAAY,IAE5D,MAAO,UAAUxN,GACf,MAAO,IAAIue,IAAa,IAAK,KAAMve,EAAGye,EAASC,EAAmBva,OAQlE8a,GAAgCV,GAAaW,kBAAqB,WACpE,QAAST,GAASxT,EAAQD,EAASE,GAAe,MAAOA,KACzD,QAASwT,GAAkBvW,GAAY,MAAOA,GAAS+C,cACvD,QAAS/G,KAAc,MAAO,gBAE9B,MAAO,YACL,MAAO,IAAIoa,IAAa,IAAK,KAAM,KAAME,EAASC,EAAmBva,OAOrEgb,GAAWzM,GAAGyM,SAAW,aASzBC,GAAiBD,GAAStL,OAAS,SAAU5I,EAAQD,EAASE,GAIhE,MAHAD,KAAWA,EAAS8H,IACpB/H,IAAYA,EAAUqI,IACtBnI,IAAgBA,EAAc6H,IACvB,GAAIsM,IAAkBpU,EAAQD,EAASE,IAO5CoU,GAAmB5M,GAAGC,UAAU2M,iBAAoB,SAAUC,GAMhE,QAASD,KACPxf,KAAKqK,WAAY,EAoDnB,MA1DAqL,IAAS8J,EAAkBC,GAU3BD,EAAiBxb,UAAUyN,KAAO2C,GAClCoL,EAAiBxb,UAAU1D,MAAQ8T,GACnCoL,EAAiBxb,UAAU0b,UAAYtL,GAMvCoL,EAAiBxb,UAAUmH,OAAS,SAAUnG,IAC3ChF,KAAKqK,WAAarK,KAAKyR,KAAKzM,IAO/Bwa,EAAiBxb,UAAUkH,QAAU,SAAU5K,GACxCN,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAKM,MAAMA,KAOfkf,EAAiBxb,UAAUoH,YAAc,WAClCpL,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAK0f,cAOTF,EAAiBxb,UAAUmL,QAAU,WAAcnP,KAAKqK,WAAY,GAEpEmV,EAAiBxb,UAAU2b,KAAO,SAAUzf,GAC1C,MAAKF,MAAKqK,WAMH,GALLrK,KAAKqK,WAAY,EACjBrK,KAAKM,MAAMJ,IACJ,IAMJsf,GACPH,IAKEE,GAAoB3M,GAAG2M,kBAAqB,SAAUE,GASxD,QAASF,GAAkBpU,EAAQD,EAASE,GAC1CqU,EAAUtc,KAAKnD,MACfA,KAAK4f,QAAUzU,EACfnL,KAAK6f,SAAW3U,EAChBlL,KAAK8f,aAAe1U,EA0BtB,MAtCAsK,IAAS6J,EAAmBE,GAmB5BF,EAAkBvb,UAAUyN,KAAO,SAAUzM,GAC3ChF,KAAK4f,QAAQ5a,IAOfua,EAAkBvb,UAAU1D,MAAQ,SAAUA,GAC5CN,KAAK6f,SAASvf,IAMhBif,EAAkBvb,UAAU0b,UAAY,WACtC1f,KAAK8f,gBAGAP,GACPC,IAOEO,GAAanN,GAAGmN,WAAa,WAE/B,QAASC,GAAchT,EAAMzD,GAC3B,MAAO,UAAU1I,GACf,GAAIof,GAAapf,EAAEqK,OAMnB,OALArK,GAAEqK,QAAU,SAAUhL,GACpBG,EAAmBH,EAAG8M,GACtBiT,EAAW9c,KAAKtC,EAAGX,IAGdqJ,EAAUpG,KAAK6J,EAAMnM,IAIhC,QAASkf,GAAWxW,GAClB,GAAIqJ,GAAGE,OAAOa,kBAAoBnT,GAAW,CAC3C,GAAIN,GAAI+K,GAAS7K,GAAS,GAAIgC,QAASlC,CACvCF,MAAKS,MAAQP,EAAEO,MAAMyc,UAAUhd,EAAEO,MAAMC,QAAQ,MAAQ,GACvDV,KAAKkgB,WAAaF,EAAchgB,KAAMuJ,OAEtCvJ,MAAKkgB,WAAa3W,EA0DtB,MAtDAiV,IAAkBuB,EAAW/b,UAO7B+b,EAAWI,aAAe,SAAUtf,GAClC,MAAOA,IAAKyF,GAAWzF,EAAE0I,YAU3BiV,GAAgBjV,UAAYiV,GAAgB4B,QAAU,SAAUC,EAAWnV,EAASE,GAClF,MAAOpL,MAAKkgB,WAAgC,gBAAdG,GAC5BA,EACAf,GAAee,EAAWnV,EAASE,KASvCoT,GAAgB8B,gBAAkB,SAAUnV,EAAQ4J,GAClD,MAAO/U,MAAKkgB,WAAWZ,GAAkC,mBAAZvK,GAA0B,SAASxK,GAAKY,EAAOhI,KAAK4R,EAASxK,IAAQY,KASpHqT,GAAgB+B,iBAAmB,SAAUrV,EAAS6J,GACpD,MAAO/U,MAAKkgB,WAAWZ,GAAe,KAAyB,mBAAZvK,GAA0B,SAAS7U,GAAKgL,EAAQ/H,KAAK4R,EAAS7U,IAAQgL,KAS3HsT,GAAgBgC,qBAAuB,SAAUpV,EAAa2J,GAC5D,MAAO/U,MAAKkgB,WAAWZ,GAAe,KAAM,KAAyB,mBAAZvK,GAA0B,WAAa3J,EAAYjI,KAAK4R,IAAc3J,KAG1H2U,KAGLU,GAAoB7N,GAAGC,UAAU4N,kBAAqB,SAAUhB,GAGlE,QAASgB,GAAkBjY,EAAWH,GACpCoX,EAAUtc,KAAKnD,MACfA,KAAKwI,UAAYA,EACjBxI,KAAKqI,SAAWA,EAChBrI,KAAK0gB,YAAa,EAClB1gB,KAAK2gB,YAAa,EAClB3gB,KAAK8a,SACL9a,KAAKmX,WAAa,GAAI9N,IAiDxB,MA1DAqM,IAAS+K,EAAmBhB,GAY5BgB,EAAkBzc,UAAUyN,KAAO,SAAUzM,GAC3C,GAAIgI,GAAOhN,IACXA,MAAK8a,MAAMpZ,KAAK,WAAcsL,EAAK3E,SAAS8C,OAAOnG,MAGrDyb,EAAkBzc,UAAU1D,MAAQ,SAAUJ,GAC5C,GAAI8M,GAAOhN,IACXA,MAAK8a,MAAMpZ,KAAK,WAAcsL,EAAK3E,SAAS6C,QAAQhL,MAGtDugB,EAAkBzc,UAAU0b,UAAY,WACtC,GAAI1S,GAAOhN,IACXA,MAAK8a,MAAMpZ,KAAK,WAAcsL,EAAK3E,SAAS+C,iBAG9CqV,EAAkBzc,UAAU4c,aAAe,WACzC,GAAIC,IAAU,GACT7gB,KAAK2gB,YAAc3gB,KAAK8a,MAAMrb,OAAS,IAC1CohB,GAAW7gB,KAAK0gB,WAChB1gB,KAAK0gB,YAAa,GAEhBG,GACF7gB,KAAKmX,WAAW7N,cAActJ,KAAKwI,UAAUyR,2BAA2Bja,KAAM,SAAUsI,EAAQ0E,GAC9F,GAAI8T,EACJ,MAAIxY,EAAOwS,MAAMrb,OAAS,GAIxB,YADA6I,EAAOoY,YAAa,EAFpBI,GAAOxY,EAAOwS,MAAMzM,OAKtB,IAAI2C,GAAM/F,GAAS6V,IACnB,OAAI9P,KAAQ7Q,IACVmI,EAAOwS,SACPxS,EAAOqY,YAAa,EACbvgB,EAAQ4Q,EAAI9Q,QAErB8M,GAAK1E,OAKXmY,EAAkBzc,UAAUmL,QAAU,WACpCsQ,EAAUzb,UAAUmL,QAAQhM,KAAKnD,MACjCA,KAAKmX,WAAWhI,WAGXsR,GACPjB,IAEEuB,GAAiBnO,GAAGmO,eAAkB,SAAUtB,GAGlD,QAASuB,GAAcC,GACrB,MAAOA,IAAc3a,GAAW2a,EAAW9R,SAAW8R,EACpD3a,GAAW2a,GAAclK,GAAiBkK,GAAcjK,GAG5D,QAAS1N,GAAczC,EAAG+Q,GACxB,GAAIsJ,GAAMtJ,EAAM,GAAI5K,EAAO4K,EAAM,GAC7BuJ,EAAMlW,GAAS+B,EAAKoU,eAAeje,KAAK6J,EAAMkU,EAElD,OAAIC,KAAQhhB,IACN+gB,EAAIvB,KAAKxf,GAASD,OAExBghB,GAAI5X,cAAc0X,EAAcG,IAFK/gB,EAAQD,GAASD,GAKxD,QAASqJ,GAAUlB,GACjB,GAAI6Y,GAAM,GAAIG,IAAmBhZ,GAAWuP,GAASsJ,EAAKlhB,KAO1D,OALI2I,IAAuBsS,mBACzBtS,GAAuBgQ,kBAAkBf,EAAOtO,GAEhDA,EAAc,KAAMsO,GAEfsJ,EAGT,QAASH,KACPtB,EAAUtc,KAAKnD,KAAMuJ,GAKvB,MAlCAmM,IAASqL,EAAgBtB,GAgCzBsB,EAAe/c,UAAUod,cAAgBhN,GAElC2M,GACPhB,IAEAuB,GAAqB,SAAS7B,GAI9B,QAAS6B,GAAkBxgB,EAAQ+J,EAAU2G,EAAgBuD,GACzD/U,KAAKwR,eAAiBoB,GAAGI,QAAQ1M,WAAWkL,GACxCA,EAAiB,KAErBxR,KAAK6K,SAAW+H,GAAGC,UAAUgC,aAAajC,GAAGI,QAAQ1M,WAAWuE,GAAYA,EAAW,WAAa,MAAOA,IAAakK,EAAS,GACjI/U,KAAKc,OAASA,EAEd2e,EAAUtc,KAAKnD,MAQnB,QAAS8J,GAAczB,EAAUwC,EAAU2G,EAAgB1Q,GACvDd,KAAKJ,EAAI,EACTI,KAAK6K,SAAWA,EAChB7K,KAAKwR,eAAiBA,EACtBxR,KAAKc,OAASA,EACdd,KAAKqK,WAAY,EACjBrK,KAAKa,EAAIwH,EAmCb,MA1DAqN,IAAS4L,EAAmB7B,GAa5B6B,EAAkBtd,UAAUod,cAAgB,SAASvgB,GACjD,MAAOb,MAAKc,OAAOyI,UAAU,GAAIO,GAAcjJ,EAAGb,KAAK6K,SAAU7K,KAAKwR,eAAgBxR,QAY1F8J,EAAc9F,UAAUud,YAAc,SAAS1e,EAAQ0H,EAAG3K,GACtD,MAAOI,MAAKwR,eACR3O,EAAO2e,IAAI,SAASpO,EAAGqO,GAAM,MAAOzhB,MAAKwR,eAAejH,EAAG6I,EAAGxT,EAAG6hB,IAAQzhB,MACzE6C,GAGRiH,EAAc9F,UAAUmH,OAAS,SAASZ,GAEtC,IAAIvK,KAAKqK,UAAT,CAEA,GAAIzK,GAAII,KAAKJ,IACTiD,EAASoI,GAASjL,KAAK6K,UAAUN,EAAG3K,EAAGI,KAAKc,OAEhD,IAAI+B,IAAW1C,GACX,MAAOH,MAAKa,EAAEqK,QAAQrI,EAAO3C,EAGjC0S,IAAGI,QAAQpD,UAAU/M,KAAYA,EAAS+P,GAAGmN,WAAW2B,YAAY7e,KACnE+P,GAAGI,QAAQ2B,YAAY9R,IAAW+P,GAAGI,QAAQ0B,WAAW7R,MAAaA,EAAS+P,GAAGmN,WAAW4B,KAAK9e,IAElG7C,KAAKa,EAAEsK,OAAOnL,KAAKuhB,YAAY1e,EAAQ0H,EAAG3K,MAI9CkK,EAAc9F,UAAUkH,QAAU,SAAShL,GACnCF,KAAKqK,YAAarK,KAAKqK,WAAY,EAAMrK,KAAKa,EAAEqK,QAAQhL,KAGhE4J,EAAc9F,UAAUoH,YAAc,WAC7BpL,KAAKqK,YAAYrK,KAAKqK,WAAY,EAAMrK,KAAKa,EAAEuK,gBAGjDkW,GAETP,IAEIa,GAAahP,GAAGC,UAAU+O,WAAa,aAEvCC,GAA8B,SAASpC,GAEzC,QAASoC,GAA2B9L,GAClC/V,KAAK+V,QAAUA,EACf0J,EAAUtc,KAAKnD,MA4BjB,QAAS8J,GAAcjJ,EAAGgG,EAAG3G,GAC3BF,KAAKa,EAAIA,EACTb,KAAK6G,EAAIA,EACT7G,KAAKE,EAAIA,EACTF,KAAKqK,WAAY,EAyBnB,MA5DAqL,IAASmM,EAA4BpC,GAMrCoC,EAA2B7d,UAAUod,cAAgB,SAAUvgB,GAC7D,GAAIiL,GAAY1C,EAAe,GAAIC,IAC/BoE,EAAagN,GAAmBR,2BAA2Bja,KAAK+V,QAAQpO,MAAe,SAAUzH,EAAG8M,GACtG,IAAIlB,EAAJ,CACA,GAAIgW,GAAc7W,GAAS/K,EAAEuR,MAAMtO,KAAKjD,EACxC,IAAI4hB,IAAgB3hB,GAAY,MAAOU,GAAEqK,QAAQ4W,EAAY5hB,EAE7D,IAAI4hB,EAAY7S,KACd,MAAOpO,GAAEuK,aAIX,IAAI2W,GAAeD,EAAY9c,KAC/B4K,IAAUmS,KAAkBA,EAAelS,GAAsBkS,GAEjE,IAAIlV,GAAI,GAAI1D,GACZC,GAAaE,cAAcuD,GAC3BA,EAAEvD,cAAcyY,EAAaxY,UAAU,GAAIO,GAAcjJ,EAAGmM,EAAM9M,OAGpE,OAAO,IAAIiM,IAAoB/C,EAAcqE,EAAYsJ,GAAiB,WACxEjL,GAAa,MAUjBhC,EAAc9F,UAAUmH,OAAS,SAAUZ,GAASvK,KAAKqK,WAAarK,KAAKa,EAAEsK,OAAOZ,IACpFT,EAAc9F,UAAUkH,QAAU,SAAUK,GACrCvL,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQK,KAGnBzB,EAAc9F,UAAUoH,YAAc,WAC/BpL,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAK6G,EAAE7G,KAAKE,KAGhB4J,EAAc9F,UAAUmL,QAAU,WAAcnP,KAAKqK,WAAY,GACjEP,EAAc9F,UAAU2b,KAAO,SAAUpU,GACvC,MAAKvL,MAAKqK,WAKH,GAJLrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQK,IACR,IAKJsW,GACPd,GAEFa,IAAW5d,UAAUge,OAAS,WAC5B,MAAO,IAAIH,IAA2B7hB,MAGxC,IAAIiiB,IAAwB,SAASxC,GAEnC,QAASwC,GAAqBlM,GAC5B/V,KAAK+V,QAAUA,EACf0J,EAAUtc,KAAKnD,MAgCjB,MAnCA0V,IAASuM,EAAsBxC,GAM/BwC,EAAqBje,UAAUod,cAAgB,SAAUvgB,GACvD,GAEIiL,GAFA5L,EAAIF,KAAK+V,QAAQpO,MAELyB,EAAe,GAAIC,IAC/BoE,EAAagN,GAAmBR,2BAA2B,KAAM,SAAUiI,EAAelV,GAC5F,IAAIlB,EAAJ,CACA,GAAIgW,GAAc7W,GAAS/K,EAAEuR,MAAMtO,KAAKjD,EACxC,IAAI4hB,IAAgB3hB,GAAY,MAAOU,GAAEqK,QAAQ4W,EAAY5hB,EAE7D,IAAI4hB,EAAY7S,KACd,MAAyB,QAAlBiT,EAAyBrhB,EAAEqK,QAAQgX,GAAiBrhB,EAAEuK,aAI/D,IAAI2W,GAAeD,EAAY9c,KAC/B4K,IAAUmS,KAAkBA,EAAelS,GAAsBkS,GAEjE,IAAIlV,GAAI,GAAI1D,GACZC,GAAaE,cAAcuD,GAC3BA,EAAEvD,cAAcyY,EAAaxY,UAC3B,SAASgB,GAAK1J,EAAEsK,OAAOZ,IACvByC,EACA,WAAanM,EAAEuK,mBAEnB,OAAO,IAAIe,IAAoB/C,EAAcqE,EAAYsJ,GAAiB,WACxEjL,GAAa,MAIVmW,GACPlB,GAEFa,IAAW5d,UAAUme,WAAa,WAChC,MAAO,IAAIF,IAAqBjiB,OAGlC4hB,GAAW5d,UAAUoe,eAAiB,SAAUC,GAC9C,GAAItM,GAAU/V,IACd,OAAO,IAAIiJ,IAAoB,SAAUpI,GACvC,GAOIiL,GACFoW,EAREI,EAAa,GAAIC,IACnBC,EAAW,GAAID,IACfE,EAAUJ,EAAoBC,GAC9BI,EAAyBD,EAAQlZ,UAAUiZ,GAEzCtiB,EAAI6V,EAAQpO,MAIdyB,EAAe,GAAIC,IACjBoE,EAAagN,GAAmBT,kBAAkB,SAAUhN,GAC9D,IAAIlB,EAAJ,CACA,GAAIgW,GAAc7W,GAAS/K,EAAEuR,MAAMtO,KAAKjD,EACxC,IAAI4hB,IAAgB3hB,GAAY,MAAOU,GAAEqK,QAAQ4W,EAAY5hB,EAE7D,IAAI4hB,EAAY7S,KAMd,YALIiT,EACFrhB,EAAEqK,QAAQgX,GAEVrhB,EAAEuK,cAMN,IAAI2W,GAAeD,EAAY9c,KAC/B4K,IAAUmS,KAAkBA,EAAelS,GAAsBkS,GAEjE,IAAIY,GAAQ,GAAIxZ,IACZyZ,EAAQ,GAAIzZ,GAChBC,GAAaE,cAAc,GAAI6C,IAAoByW,EAAOD,IAC1DA,EAAMrZ,cAAcyY,EAAaxY,UAC/B,SAASgB,GAAK1J,EAAEsK,OAAOZ,IACvB,SAAUsY,GACRD,EAAMtZ,cAAckZ,EAASjZ,UAAUyD,EAAM,SAAS8V,GACpDjiB,EAAEqK,QAAQ4X,IACT,WACDjiB,EAAEuK,iBAGJkX,EAAWnX,OAAO0X,IAEpB,WAAahiB,EAAEuK,mBAGnB,OAAO,IAAIe,IAAoBuW,EAAwBtZ,EAAcqE,EAAYsJ,GAAiB,WAChGjL,GAAa,OAKnB,IAAIiX,IAAoB,SAAUtD,GAGhC,QAASsD,GAAiBC,EAAGC,GAC3BjjB,KAAKgjB,EAAIA,EACThjB,KAAKijB,EAAS,MAALA,EAAY,GAAKA,EAM5B,QAASC,GAAiBzY,GACxBzK,KAAKgjB,EAAIvY,EAAEuY,EACXhjB,KAAKmjB,EAAI1Y,EAAEwY,EAQb,MApBAvN,IAASqN,EAAkBtD,GAM3BsD,EAAiB/e,UAAU2D,IAAc,WACvC,MAAO,IAAIub,GAAiBljB,OAO9BkjB,EAAiBlf,UAAUyN,KAAO,WAChC,MAAe,KAAXzR,KAAKmjB,EAAkB1O,IACvBzU,KAAKmjB,EAAI,GAAKnjB,KAAKmjB,KACdlU,MAAM,EAAOjK,MAAOhF,KAAKgjB,KAG7BD,GACPnB,IAEEwB,GAAmBxB,GAAWyB,OAAS,SAAUre,EAAOse,GAC1D,MAAO,IAAIP,IAAiB/d,EAAOse,IAGjCC,GAAgB,SAAS9D,GAE3B,QAAS8D,GAAa1c,EAAG8D,EAAIoK,GAC3B/U,KAAK6G,EAAIA,EACT7G,KAAK2K,GAAKA,EAAKkK,GAAalK,EAAIoK,EAAS,GAAK,KAMhD,QAASyO,GAAa/Y,GACpBzK,KAAKJ,EAAI,GACTI,KAAK6G,EAAI4D,EAAE5D,EACX7G,KAAKmjB,EAAInjB,KAAK6G,EAAEpH,OAChBO,KAAK2K,GAAKF,EAAEE,GAQd,MArBA+K,IAAS6N,EAAc9D,GAKvB8D,EAAavf,UAAU2D,IAAc,WACnC,MAAO,IAAI6b,GAAaxjB,OAS1BwjB,EAAaxf,UAAUyN,KAAO,WAC7B,QAASzR,KAAKJ,EAAII,KAAKmjB,GACnBlU,MAAM,EAAOjK,MAAQhF,KAAK2K,GAAsB3K,KAAK2K,GAAG3K,KAAK6G,EAAE7G,KAAKJ,GAAII,KAAKJ,EAAGI,KAAK6G,GAAtD7G,KAAK6G,EAAE7G,KAAKJ,IAC7C6U,IAGI8O,GACP3B,IAEE6B,GAAe7B,GAAW8B,GAAK,SAAU5iB,EAAQ+J,EAAUkK;AAC7D,MAAO,IAAIwO,IAAaziB,EAAQ+J,EAAUkK,IAGxC4O,GAAqB,SAASlE,GAEhC,QAASkE,GAAkB7iB,GACzBd,KAAKc,OAASA,EACd2e,EAAUtc,KAAKnD,MAOjB,QAAS8J,GAAcjJ,GACrBb,KAAKa,EAAIA,EACTb,KAAKN,KACLM,KAAKqK,WAAY,EA2BnB,MAxCAqL,IAASiO,EAAmBlE,GAM5BkE,EAAkB3f,UAAUod,cAAgB,SAASvgB,GACnD,MAAOb,MAAKc,OAAOyI,UAAU,GAAIO,GAAcjJ,KAQjDiJ,EAAc9F,UAAUmH,OAAS,SAAUZ,GAASvK,KAAKqK,WAAarK,KAAKN,EAAEgC,KAAK6I,IAClFT,EAAc9F,UAAUkH,QAAU,SAAUhL,GACrCF,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,KAGnB4J,EAAc9F,UAAUoH,YAAc,WAC/BpL,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEsK,OAAOnL,KAAKN,GACnBM,KAAKa,EAAEuK,gBAGXtB,EAAc9F,UAAUmL,QAAU,WAAcnP,KAAKqK,WAAY,GACjEP,EAAc9F,UAAU2b,KAAO,SAAUzf,GACvC,MAAKF,MAAKqK,WAMH,GALLrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,IACR,IAMJyjB,GACP5C,GAMFvC,IAAgBoF,QAAU,WACxB,MAAO,IAAID,IAAkB3jB,OAY/B+f,GAAWhM,OAAS,SAAUxK,EAAWjB,GACvC,MAAO,IAAIW,IAAoBM,EAAWjB,GAW5C,IAAIgF,IAAkByS,GAAW8D,MAAQ,SAAUC,GACjD,MAAO,IAAI7a,IAAoB,SAAUZ,GACvC,GAAIxF,EACJ,KACEA,EAASihB,IACT,MAAO5jB,GACP,MAAOuQ,IAAgBvQ,GAAGqJ,UAAUlB,GAGtC,MADAuH,IAAU/M,KAAYA,EAASgN,GAAsBhN,IAC9CA,EAAO0G,UAAUlB,MAIxB0b,GAAmB,SAAStE,GAE9B,QAASsE,GAAgBvb,GACvBxI,KAAKwI,UAAYA,EACjBiX,EAAUtc,KAAKnD,MAQjB,QAASgkB,GAAU3b,EAAUG,GAC3BxI,KAAKqI,SAAWA,EAChBrI,KAAKwI,UAAYA,EAGnB,QAASyb,GAAapd,EAAG+Q,GAEvB,MADAA,GAAMxM,cACC4L,GAOT,MAzBAtB,IAASqO,EAAiBtE,GAM1BsE,EAAgB/f,UAAUod,cAAgB,SAAU/Y,GAClD,GAAI6b,GAAO,GAAIF,GAAU3b,EAAUrI,KAAKwI,UACxC,OAAO0b,GAAKC,OAadH,EAAUhgB,UAAUmgB,IAAM,WACxB,MAAOnkB,MAAKwI,UAAUmQ,kBAAkB3Y,KAAKqI,SAAU4b,IAGlDF,GACPhD,IAEEqD,GAAmB,GAAIL,IAAgBtJ,IAWvC4J,GAAkBtE,GAAW9I,MAAQ,SAAUzO,GAEjD,MADAE,IAAYF,KAAeA,EAAYiS,IAChCjS,IAAciS,GAAqB2J,GAAmB,GAAIL,IAAgBvb,IAG/E8b,GAAkB,SAAS7E,GAE7B,QAAS6E,GAAeC,EAAUC,EAAQhc,GACxCxI,KAAKukB,SAAWA,EAChBvkB,KAAKwkB,OAASA,EACdxkB,KAAKwI,UAAYA,EACjBiX,EAAUtc,KAAKnD,MAQjB,MAbA0V,IAAS4O,EAAgB7E,GAQzB6E,EAAetgB,UAAUod,cAAgB,SAAUvgB,GACjD,GAAIqjB,GAAO,GAAIO,IAAS5jB,EAAGb,KAC3B,OAAOkkB,GAAKC,OAGPG,GACPvD,IAEE0D,GAAY,WACd,QAASA,GAAS5jB,EAAGyH,GACnBtI,KAAKa,EAAIA,EACTb,KAAKsI,OAASA,EA4BhB,MAzBAmc,GAASzgB,UAAUmgB,IAAM,WAMvB,QAASO,GAAc9kB,EAAG0b,GACxB,GAAI7J,GAAOxG,GAASvD,EAAG+J,MAAMtO,KAAKuE,EAClC,IAAI+J,IAAStR,GAAY,MAAOU,GAAEqK,QAAQuG,EAAKvR,EAC/C,IAAIuR,EAAKxC,KAAQ,MAAOpO,GAAEuK,aAE1B,IAAIvI,GAAS4O,EAAKzM,KAElB,OAAIsB,IAAWke,KACb3hB,EAASoI,GAASuZ,GAAQ3hB,EAAQjD,GAC9BiD,IAAW1C,IAAmBU,EAAEqK,QAAQrI,EAAO3C,IAGrDW,EAAEsK,OAAOtI,OACTyY,GAAQ1b,EAAI,IAlBd,GAAI+kB,GAAOve,OAAOpG,KAAKsI,OAAOic,UAC1B7c,EAAKD,EAAYkd,GACjB9jB,EAAIb,KAAKa,EACT2jB,EAASxkB,KAAKsI,OAAOkc,MAkBzB,OAAOxkB,MAAKsI,OAAOE,UAAUyR,2BAA2B,EAAGyK,IAGtDD,KAGLtc,GAAiBH,KAAK4c,IAAI,EAAG,IAAM,CAMvChe,GAAe5C,UAAU2D,IAAc,WACrC,MAAO,IAAIZ,GAAe/G,KAAK8G,KASjCC,EAAe/C,UAAU2D,IAAc,WACrC,MAAO3H,OAGT+G,EAAe/C,UAAUyN,KAAO,WAC9B,MAAOzR,MAAKiH,GAAKjH,KAAKgH,IAAOiI,MAAM,EAAOjK,MAAOhF,KAAK8G,GAAG+d,OAAO7kB,KAAKiH,OAAUwN,IAOjFvN,EAAclD,UAAU2D,IAAc,WACpC,MAAO,IAAIP,GAAcpH,KAAKmH,KAShCC,EAAcpD,UAAU2D,IAAc,WACpC,MAAO3H,OAGToH,EAAcpD,UAAUyN,KAAO,WAC7B,MAAOzR,MAAKiH,GAAKjH,KAAKgH,IAAOiI,MAAM,EAAOjK,MAAOhF,KAAKmH,GAAGnH,KAAKiH,OAAUwN,GAiD1E,IAAIqQ,IAAiB/E,GAAW4B,KAAO,SAAU4C,EAAUQ,EAAOhQ,EAASvM,GACzE,GAAgB,MAAZ+b,EACF,KAAM,IAAIniB,OAAM,2BAElB,IAAI2iB,IAAUze,GAAWye,GACvB,KAAM,IAAI3iB,OAAM,yCAElB,IAAI2iB,EACF,GAAIP,GAAS3P,GAAakQ,EAAOhQ,EAAS,EAG5C,OADArM,IAAYF,KAAeA,EAAYG,IAChC,GAAI2b,IAAeC,EAAUC,EAAQhc,IAG1CI,GAAuB,SAAS6W,GAElC,QAAS7W,GAAoBe,EAAMnB,GACjCxI,KAAK2J,KAAOA,EACZ3J,KAAKwI,UAAYA,EACjBiX,EAAUtc,KAAKnD,MAQjB,MAZA0V,IAAS9M,EAAqB6W,GAO9B7W,EAAoB5E,UAAUod,cAAgB,SAAU/Y,GACtD,GAAI6b,GAAO,GAAI9b,GAAcC,EAAUrI,KACvC,OAAOkkB,GAAKC,OAGPvb,GACPmY,GAOF3Y,GAAcpE,UAAUmgB,IAAM,WAE5B,QAASO,GAAc9kB,EAAG0b,GAChB9b,EAAJI,GACFyI,EAAS8C,OAAOxB,EAAK/J,IACrB0b,EAAQ1b,EAAI,IAEZyI,EAAS+C,cANb,GAAI/C,GAAWrI,KAAKqI,SAAUsB,EAAO3J,KAAKsI,OAAOqB,KAAMnK,EAAMmK,EAAKlK,MAUlE,OAAOO,MAAKsI,OAAOE,UAAUyR,2BAA2B,EAAGyK,GAS7D,IAAIM,IAAsBjF,GAAWkF,UAAY,SAAUxc,EAAOD,GAEhE,MADAE,IAAYF,KAAeA,EAAYG,IAChC,GAAIC,IAAoBH,EAAOD,IAGpC0c,GAAmB,SAASzF,GAE9B,QAASyF,KACPzF,EAAUtc,KAAKnD,MAOjB,MATA0V,IAASwP,EAAiBzF,GAK1ByF,EAAgBlhB,UAAUod,cAAgB,SAAU/Y,GAClD,MAAO2O,KAGFkO,GACPnE,IAEEoE,GAAmB,GAAID,IAMvB1U,GAAkBuP,GAAWqF,MAAQ,WACvC,MAAOD,IAYTpF,IAAW2D,GAAK,WAEd,IAAI,GADAlkB,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,GACrCI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EACnD,OAAO,IAAIgJ,IAAoBe,EAAMhB,KAQvCoX,GAAWsF,gBAAkB,SAAU7c,GAErC,IAAI,GADAhJ,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,EAAM,GAC3CI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,EAAI,GAAKK,UAAUL,EACvD,OAAO,IAAIgJ,IAAoBe,EAAMnB,GAGvC,IAAI8c,IAAmB,SAAS7F,GAE9B,QAAS6F,GAAgBxP,EAAKtN,GAC5BxI,KAAK8V,IAAMA,EACX9V,KAAKulB,KAAOnf,OAAOmf,KAAKzP,GACxB9V,KAAKwI,UAAYA,EACjBiX,EAAUtc,KAAKnD,MAQjB,MAbA0V,IAAS4P,EAAiB7F,GAQ1B6F,EAAgBthB,UAAUod,cAAgB,SAAU/Y,GAClD,GAAI6b,GAAO,GAAIrb,GAAUR,EAAUrI,KACnC,OAAOkkB,GAAKC,OAGPmB,GACPvE,GAOFlY,GAAU7E,UAAUmgB,IAAM,WAExB,QAASO,GAAc9kB,EAAG0b,GACxB,GAAQ9b,EAAJI,EAAS,CACX,GAAI6D,GAAM8hB,EAAK3lB,EACfyI,GAAS8C,QAAQ1H,EAAKqS,EAAIrS,KAC1B6X,EAAQ1b,EAAI,OAEZyI,GAAS+C,cAPb,GAAI/C,GAAWrI,KAAKqI,SAAUyN,EAAM9V,KAAKsI,OAAOwN,IAAKyP,EAAOvlB,KAAKsI,OAAOid,KAAM/lB,EAAM+lB,EAAK9lB,MAWzF,OAAOO,MAAKsI,OAAOE,UAAUyR,2BAA2B,EAAGyK,IAS7D3E,GAAWyF,MAAQ,SAAU1P,EAAKtN,GAEhC,MADAA,KAAcA,EAAYG,IACnB,GAAI2c,IAAgBxP,EAAKtN,GAGhC,IAAIid,IAAmB,SAAShG,GAEhC,QAASgG,GAAgB5W,EAAOnI,EAAO8B,GACrCxI,KAAK6O,MAAQA,EACb7O,KAAK0lB,WAAahf,EAClB1G,KAAKwI,UAAYA,EACjBiX,EAAUtc,KAAKnD,MAQjB,MAbA0V,IAAS+P,EAAiBhG,GAQ1BgG,EAAgBzhB,UAAUod,cAAgB,SAAU/Y,GAClD,GAAI6b,GAAO,GAAIyB,IAAUtd,EAAUrI,KACnC,OAAOkkB,GAAKC,OAGPsB,GACP1E,IAEE4E,GAAa,WACf,QAASA,GAAUtd,EAAUC,GAC3BtI,KAAKqI,SAAWA,EAChBrI,KAAKsI,OAASA,EAiBhB,MAdAqd,GAAU3hB,UAAUmgB,IAAM,WAExB,QAASO,GAAc9kB,EAAG0b,GAChB5U,EAAJ9G,GACFyI,EAAS8C,OAAO0D,EAAQjP,GACxB0b,EAAQ1b,EAAI,IAEZyI,EAAS+C,cANb,GAAIyD,GAAQ7O,KAAKsI,OAAOuG,MAAOnI,EAAQ1G,KAAKsI,OAAOod,WAAYrd,EAAWrI,KAAKqI,QAU/E,OAAOrI,MAAKsI,OAAOE,UAAUyR,2BAA2B,EAAGyK,IAGtDiB,IAUT5F,IAAW6F,MAAQ,SAAU/W,EAAOnI,EAAO8B,GAEzC,MADAE,IAAYF,KAAeA,EAAYG,IAChC,GAAI8c,IAAgB5W,EAAOnI,EAAO8B,GAG3C,IAAIqd,IAAoB,SAASpG,GAE/B,QAASoG,GAAiB7gB,EAAOse,EAAa9a,GAC5CxI,KAAKgF,MAAQA,EACbhF,KAAKsjB,YAA6B,MAAfA,EAAsB,GAAKA,EAC9CtjB,KAAKwI,UAAYA,EACjBiX,EAAUtc,KAAKnD,MAQjB,MAbA0V,IAASmQ,EAAkBpG,GAQ3BoG,EAAiB7hB,UAAUod,cAAgB,SAAU/Y,GACnD,GAAI6b,GAAO,GAAIpb,GAAWT,EAAUrI,KACpC,OAAOkkB,GAAKC,OAGP0B,GACP9E,GAOFjY,GAAW9E,UAAUmgB,IAAM,WAEzB,QAASO,GAAc9kB,EAAG0b,GAKxB,OAJU,KAAN1b,GAAYA,EAAI,KAClByI,EAAS8C,OAAOnG,GAChBpF,EAAI,GAAKA,KAED,IAANA,EAAkByI,EAAS+C,kBAC/BkQ,GAAQ1b,GAPV,GAAIyI,GAAWrI,KAAKqI,SAAUrD,EAAQhF,KAAKsI,OAAOtD,KAUlD,OAAOhF,MAAKsI,OAAOE,UAAUyR,2BAA2Bja,KAAKsI,OAAOgb,YAAaoB,IAUnF3E,GAAWsD,OAAS,SAAUre,EAAOse,EAAa9a,GAEhD,MADAE,IAAYF,KAAeA,EAAYG,IAChC,GAAIkd,IAAiB7gB,EAAOse,EAAa9a,GAGlD,IAAIsd,IAAkB,SAASrG,GAE7B,QAASqG,GAAe9gB,EAAOwD,GAC7BxI,KAAKgF,MAAQA,EACbhF,KAAKwI,UAAYA,EACjBiX,EAAUtc,KAAKnD,MAQjB,QAAS+lB,GAAS1d,EAAUrD,EAAOwD,GACjCxI,KAAKqI,SAAWA,EAChBrI,KAAKgF,MAAQA,EACbhF,KAAKwI,UAAYA,EAGnB,QAASyb,GAAapd,EAAG+Q,GACvB,GAAI5S,GAAQ4S,EAAM,GAAIvP,EAAWuP,EAAM,EAGvC,OAFAvP,GAAS8C,OAAOnG,GAChBqD,EAAS+C,cACF4L,GAUT,MAhCAtB,IAASoQ,EAAgBrG,GAOzBqG,EAAe9hB,UAAUod,cAAgB,SAAU/Y,GACjD,GAAI6b,GAAO,GAAI6B,GAAS1d,EAAUrI,KAAKgF,MAAOhF,KAAKwI,UACnD,OAAO0b,GAAKC,OAgBd4B,EAAS/hB,UAAUmgB,IAAM,WACvB,GAAIvM,IAAS5X,KAAKgF,MAAOhF,KAAKqI,SAC9B,OAAOrI,MAAKwI,YAAciS,GACxBwJ,EAAa,KAAMrM,GACnB5X,KAAKwI,UAAUmQ,kBAAkBf,EAAOqM,IAGrC6B,GACP/E,IAcEiF,IALmBjG,GAAW,UAAYA,GAAWkG,KAAO,SAAUjhB,EAAOwD,GAE/E,MADAE,IAAYF,KAAeA,EAAYiS,IAChC,GAAIqL,IAAe9gB,EAAOwD,IAGZ,SAASiX,GAE9B,QAASuG,GAAgB1lB,EAAOkI,GAC9BxI,KAAKM,MAAQA,EACbN,KAAKwI,UAAYA,EACjBiX,EAAUtc,KAAKnD,MAQjB,QAASkmB,GAAUrlB,EAAG4J,GACpBzK,KAAKa,EAAIA,EACTb,KAAKyK,EAAIA,EAGX,QAASwZ,GAAapd,EAAG+Q,GACvB,GAAI1X,GAAI0X,EAAM,GAAI/W,EAAI+W,EAAM,EAC5B/W,GAAEqK,QAAQhL,GAOZ,MA1BAwV,IAASsQ,EAAiBvG,GAO1BuG,EAAgBhiB,UAAUod,cAAgB,SAAUvgB,GAClD,GAAIqjB,GAAO,GAAIgC,GAAUrlB,EAAGb,KAC5B,OAAOkkB,GAAKC,OAad+B,EAAUliB,UAAUmgB,IAAM,WACxB,MAAOnkB,MAAKyK,EAAEjC,UAAUmQ,mBAAmB3Y,KAAKyK,EAAEnK,MAAON,KAAKa,GAAIojB,IAG7D+B,GACPjF,KASEtQ,GAAkBsP,GAAW,SAAW,SAAUzf,EAAOkI,GAE3D,MADAE,IAAYF,KAAeA,EAAYiS,IAChC,GAAIuL,IAAgB1lB,EAAOkI,IAGhCgB,GAAiB,SAASiW,GAE5B,QAASjW,GAAc3I,EAAGgG,EAAG8D,GAC3B3K,KAAKmmB,GAAKtlB,EACVb,KAAK8G,GAAKD,EACV7G,KAAK4L,IAAMjB,EACX8U,EAAUtc,KAAKnD,MAejB,MApBA0V,IAASlM,EAAeiW,GAQxBjW,EAAcxF,UAAUyN,KAAO,SAAUlH,GAAKvK,KAAKmmB,GAAGhb,OAAOZ,IAC7Df,EAAcxF,UAAU0b,UAAY,WAAc,MAAO1f,MAAKmmB,GAAG/a,eACjE5B,EAAcxF,UAAU1D,MAAQ,SAAUJ,GACxC,GAAI2C,GAASoI,GAASjL,KAAK4L,KAAK1L,EAChC,IAAI2C,IAAW1C,GAAY,MAAOH,MAAKmmB,GAAGjb,QAAQrI,EAAO3C,EACzD0P,IAAU/M,KAAYA,EAASgN,GAAsBhN,GAErD,IAAIgK,GAAI,GAAI1D,GACZnJ,MAAK8G,GAAGwC,cAAcuD,GACtBA,EAAEvD,cAAczG,EAAO0G,UAAUvJ,KAAKmmB,MAGjC3c,GACPgW,GAgBFhB,IAAgB,SAAW,SAAU4H,GACnC,MAAO9f,IAAW8f,GAAmBrd,EAAuB/I,KAAMomB,GAAmBC,IAAiBrmB,KAAMomB,IAQ9G,IAAIC,IAAkBtG,GAAW,SAAW,WAC1C,GAAIuG,EACJ,IAAI3mB,MAAM4W,QAAQtW,UAAU,IAC1BqmB,EAAQrmB,UAAU,OACb,CACL,GAAIT,GAAMS,UAAUR,MACpB6mB,GAAQ,GAAI3mB,OAAMH,EAClB,KAAI,GAAII,GAAI,EAAOJ,EAAJI,EAASA,IAAO0mB,EAAM1mB,GAAKK,UAAUL,GAEtD,MAAO6jB,IAAa6C,GAAOnE,aAY7B3D,IAAgB+H,cAAgB,WAE9B,IAAI,GADA/mB,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,GACrCI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EAMnD,OALID,OAAM4W,QAAQ5M,EAAK,IACrBA,EAAK,GAAG5I,QAAQf,MAEhB2J,EAAK5I,QAAQf,MAERumB,GAAcxmB,MAAMC,KAAM2J,GAkBnC,IAAI4c,IAAgBxG,GAAWwG,cAAgB,WAE7C,IAAI,GADA/mB,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,GACrCI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EACnD,IAAI4R,GAAiBlL,GAAWqD,EAAKnK,EAAM,IAAMmK,EAAKnD,MAAQkD,CAG9D,OAFA/J,OAAM4W,QAAQ5M,EAAK,MAAQA,EAAOA,EAAK,IAEhC,GAAIV,IAAoB,SAAUpI,GAOvC,QAAS4Q,GAAK7R,GAEZ,GADAwK,EAASxK,IAAK,EACV+R,IAAgBA,EAAcvH,EAASwH,MAAMC,KAAY,CAC3D,IACE,GAAIb,GAAMQ,EAAezR,MAAM,KAAM2R,GACrC,MAAOxR,GACP,MAAOW,GAAEqK,QAAQhL,GAEnBW,EAAEsK,OAAO6F,OACAc,GAAO0U,OAAO,SAAUjc,EAAGkc,GAAK,MAAOA,KAAM7mB,IAAMgS,MAAMC,KAClEhR,EAAEuK,cAIN,QAAS6D,GAAMrP,GACbkS,EAAOlS,IAAK,EACZkS,EAAOF,MAAMC,KAAahR,EAAEuK,cAI9B,IAAK,GA1BDK,GAAI9B,EAAKlK,OACX2K,EAAW3D,EAAgBgF,EAAGhC,GAC9BkI,GAAc,EACdG,EAASrL,EAAgBgF,EAAGhC,GAC5BiI,EAAS,GAAI/R,OAAM8L,GAqBjBib,EAAgB,GAAI/mB,OAAM8L,GACrBuK,EAAM,EAASvK,EAANuK,EAASA,KACxB,SAAUpW,GACT,GAAIkB,GAAS6I,EAAK/J,GAAI+mB,EAAM,GAAIxd,GAChCyG,IAAU9O,KAAYA,EAAS+O,GAAsB/O,IACrD6lB,EAAIrd,cAAcxI,EAAOyI,UAAU,SAAUgB,GACzCmH,EAAO9R,GAAK2K,EACZkH,EAAK7R,IAEP,SAASM,GAAKW,EAAEqK,QAAQhL,IACxB,WAAc+O,EAAKrP,MAErB8mB,EAAc9mB,GAAK+mB,GACnB3Q,EAGJ,OAAO,IAAI7J,IAAoBua,IAC9B1mB,MAOLwe,IAAgBwD,OAAS,WACvB,IAAI,GAAIrY,MAAW/J,EAAI,EAAGJ,EAAMS,UAAUR,OAAYD,EAAJI,EAASA,IAAO+J,EAAKjI,KAAKzB,UAAUL,GAEtF,OADA+J,GAAK5I,QAAQf,MACN4mB,GAAiB7mB,MAAM,KAAM4J,GAGtC,IAAIkd,IAAoB,SAASpH,GAE/B,QAASoH,GAAiB9Q,GACxB/V,KAAK+V,QAAUA,EACf0J,EAAUtc,KAAKnD,MAQjB,QAAS8mB,GAAW/Q,EAASlV,GAC3Bb,KAAK+V,QAAUA,EACf/V,KAAKa,EAAIA,EA6BX,MA1CA6U,IAASmR,EAAkBpH,GAM3BoH,EAAiB7iB,UAAUod,cAAgB,SAASvgB,GAClD,GAAIqjB,GAAO,GAAI4C,GAAW9mB,KAAK+V,QAASlV,EACxC,OAAOqjB,GAAKC,OAOd2C,EAAW9iB,UAAUmgB,IAAM,WACzB,GAAIrY,GAAY1C,EAAe,GAAIC,IAAoB0M,EAAU/V,KAAK+V,QAAStW,EAASsW,EAAQtW,OAAQoB,EAAIb,KAAKa,EAC7G4M,EAAagN,GAAmBR,2BAA2B,EAAG,SAAUra,EAAGoN,GAC7E,IAAIlB,EAAJ,CACA,GAAIlM,IAAMH,EACR,MAAOoB,GAAEuK,aAIX,IAAI2W,GAAehM,EAAQnW,EAC3BgQ,IAAUmS,KAAkBA,EAAelS,GAAsBkS,GAEjE,IAAIlV,GAAI,GAAI1D,GACZC,GAAaE,cAAcuD,GAC3BA,EAAEvD,cAAcyY,EAAaxY,UAC3B,SAAUgB,GAAK1J,EAAEsK,OAAOZ,IACxB,SAAUrK,GAAKW,EAAEqK,QAAQhL,IACzB,WAAc8M,EAAKpN,EAAI,QAI3B,OAAO,IAAIuM,IAAoB/C,EAAcqE,EAAYsJ,GAAiB,WACxEjL,GAAa,MAKV+a,GACP9F,IAOE6F,GAAmB7G,GAAWiC,OAAS,WACzC,GAAIrY,EACJ,IAAIhK,MAAM4W,QAAQtW,UAAU,IAC1B0J,EAAO1J,UAAU,OACZ,CACL0J,EAAO,GAAIhK,OAAMM,UAAUR,OAC3B,KAAI,GAAIG,GAAI,EAAGJ,EAAMS,UAAUR,OAAYD,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,GAE7E,MAAO,IAAIinB,IAAiBld,GAO9B6U,IAAgBuI,UAAY,WAC1B,MAAO/mB,MAAKgnB,MAAM,GAGpB,IAAIC,IAAmB,SAAUxH,GAG/B,QAASwH,GAAgBnmB,EAAQomB,GAC/BlnB,KAAKc,OAASA,EACdd,KAAKknB,cAAgBA,EACrBzH,EAAUtc,KAAKnD,MASjB,MAdA0V,IAASuR,EAAiBxH,GAQ1BwH,EAAgBjjB,UAAUod,cAAgB,SAAS/Y,GACjD,GAAI8e,GAAI,GAAIhb,GAEZ,OADAgb,GAAE9a,IAAIrM,KAAKc,OAAOyI,UAAU,GAAI6d,IAAc/e,EAAUrI,KAAKknB,cAAeC,KACrEA,GAGFF,GAEPlG,IAEEqG,GAAiB,WACnB,QAASA,GAAcvmB,EAAG0N,EAAK4Y,GAC7BnnB,KAAKa,EAAIA,EACTb,KAAKuO,IAAMA,EACXvO,KAAKmnB,EAAIA,EACTnnB,KAAKiP,MAAO,EACZjP,KAAK2N,KACL3N,KAAKqnB,YAAc,EACnBrnB,KAAKqK,WAAY,EAyCjB,QAASP,GAAcxB,EAAQqe,GAC7B3mB,KAAKsI,OAASA,EACdtI,KAAK2mB,IAAMA,EACX3mB,KAAKqK,WAAY,EAiCnB,MA3EF+c,GAAcpjB,UAAUsjB,gBAAkB,SAAUlR,GAClD,GAAIuQ,GAAM,GAAIxd,GACdnJ,MAAKmnB,EAAE9a,IAAIsa,GACX/W,GAAUwG,KAAQA,EAAKvG,GAAsBuG,IAC7CuQ,EAAIrd,cAAc8M,EAAG7M,UAAU,GAAIO,GAAc9J,KAAM2mB,MAEzDS,EAAcpjB,UAAUmH,OAAS,SAAUoc,GACrCvnB,KAAKqK,YACJrK,KAAKqnB,YAAcrnB,KAAKuO,KACzBvO,KAAKqnB,cACLrnB,KAAKsnB,gBAAgBC,IAErBvnB,KAAK2N,EAAEjM,KAAK6lB,KAGhBH,EAAcpjB,UAAUkH,QAAU,SAAUhL,GACrCF,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,KAGnBknB,EAAcpjB,UAAUoH,YAAc,WAC/BpL,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAKiP,MAAO,EACS,IAArBjP,KAAKqnB,aAAqBrnB,KAAKa,EAAEuK,gBAGrCgc,EAAcpjB,UAAUmL,QAAU,WAAanP,KAAKqK,WAAY,GAChE+c,EAAcpjB,UAAU2b,KAAO,SAAUzf,GACvC,MAAKF,MAAKqK,WAMH,GALLrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,IACR,IAWX4J,EAAc9F,UAAUmH,OAAS,SAAUZ,GAASvK,KAAKqK,WAAarK,KAAKsI,OAAOzH,EAAEsK,OAAOZ,IAC3FT,EAAc9F,UAAUkH,QAAU,SAAUhL,GACrCF,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAKsI,OAAOzH,EAAEqK,QAAQhL,KAG1B4J,EAAc9F,UAAUoH,YAAc,WACpC,IAAIpL,KAAKqK,UAAW,CAClBrK,KAAKqK,WAAY,CACjB,IAAI/B,GAAStI,KAAKsI,MAClBA,GAAO6e,EAAEnY,OAAOhP,KAAK2mB,KACjBre,EAAOqF,EAAElO,OAAS,EACpB6I,EAAOgf,gBAAgBhf,EAAOqF,EAAEU,UAEhC/F,EAAO+e,cACP/e,EAAO2G,MAA+B,IAAvB3G,EAAO+e,aAAqB/e,EAAOzH,EAAEuK,iBAI1DtB,EAAc9F,UAAUmL,QAAU,WAAanP,KAAKqK,WAAY,GAChEP,EAAc9F,UAAU2b,KAAO,SAAUzf,GACvC,MAAKF,MAAKqK,WAMH,GALLrK,KAAKqK,WAAY,EACjBrK,KAAKsI,OAAOzH,EAAEqK,QAAQhL,IACf,IAMJknB,IAiBX5I,IAAgBwI,MAAQ,SAAUQ,GAChC,MAAuC,gBAAzBA,GACZC,GAAgBznB,KAAMwnB,GACtB,GAAIP,IAAgBjnB,KAAMwnB,GAQ9B,IAAIC,IAAkB1H,GAAWiH,MAAQ,WACvC,GAAIxe,GAAyB5I,EAAdmW,KAAiBvW,EAAMS,UAAUR,MAChD,IAAKQ,UAAU,GAGR,GAAIyI,GAAYzI,UAAU,IAE/B,IADAuI,EAAYvI,UAAU,GAClBL,EAAI,EAAOJ,EAAJI,EAASA,IAAOmW,EAAQrU,KAAKzB,UAAUL,QAGlD,KADA4I,EAAYiS,GACR7a,EAAI,EAAOJ,EAAJI,EAASA,IAAOmW,EAAQrU,KAAKzB,UAAUL,QANlD,KADA4I,EAAYiS,GACR7a,EAAI,EAAOJ,EAAJI,EAASA,IAAOmW,EAAQrU,KAAKzB,UAAUL,GAWpD,OAHID,OAAM4W,QAAQR,EAAQ,MACxBA,EAAUA,EAAQ,IAEbxN,EAAaC,EAAWuN,GAAS2R,YAGtCC,GAAiB/U,GAAG+U,eAAiB,SAASC,GAChD5nB,KAAK8T,KAAO,sBACZ9T,KAAK6nB,YAAcD,EACnB5nB,KAAK6T,QAAU,uDACfzR,MAAMe,KAAKnD,MAEb2nB,IAAe3jB,UAAY5B,MAAM4B,UAajC+b,GAAW+H,gBAAkB,WAC3B,GAAIne,EACJ,IAAIhK,MAAM4W,QAAQtW,UAAU,IAC1B0J,EAAO1J,UAAU,OACZ,CACL,GAAIT,GAAMS,UAAUR,MACpBkK,GAAO,GAAIhK,OAAMH,EACjB,KAAI,GAAII,GAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,GAErD,GAAIkB,GAASyH,EAAa,KAAMoB,EAEhC,OAAO,IAAIV,IAAoB,SAAUpI,GAMvC,QAASknB,KACe,IAAlBH,EAAOnoB,OACToB,EAAEuK,cACyB,IAAlBwc,EAAOnoB,OAChBoB,EAAEqK,QAAQ0c,EAAO,IAEjB/mB,EAAEqK,QAAQ,GAAIyc,IAAeC,IAXjC,GAAIpO,GAAQ,GAAIrN,IACd6b,EAAI,GAAI7e,IACRkB,GAAY,EACZud,IA2CF,OA/BApO,GAAMnN,IAAI2b,GAEVA,EAAE1e,cAAcxI,EAAOyI,UACrB,SAAUge,GACR,GAAIU,GAAoB,GAAI9e,GAC5BqQ,GAAMnN,IAAI4b,GAGVrY,GAAU2X,KAAiBA,EAAc1X,GAAsB0X,IAE/DU,EAAkB3e,cAAcie,EAAYhe,UAC1C,SAAUgB,GAAK1J,EAAEsK,OAAOZ,IACxB,SAAUrK,GACR0nB,EAAOlmB,KAAKxB,GACZsZ,EAAMxK,OAAOiZ,GACb5d,GAA8B,IAAjBmP,EAAM/Z,QAAgBsoB,KAErC,WACEvO,EAAMxK,OAAOiZ,GACb5d,GAA8B,IAAjBmP,EAAM/Z,QAAgBsoB,QAGzC,SAAU7nB,GACR0nB,EAAOlmB,KAAKxB,GACZmK,GAAY,EACK,IAAjBmP,EAAM/Z,QAAgBsoB,KAExB,WACE1d,GAAY,EACK,IAAjBmP,EAAM/Z,QAAgBsoB,OAEnBvO,IAIX,IAAI0O,IAAsB,SAAUzI,GAGlC,QAASyI,GAAmBpnB,GAC1Bd,KAAKc,OAASA,EACd2e,EAAUtc,KAAKnD,MAUjB,QAASmoB,GAAiBtnB,EAAGsmB,GAC3BnnB,KAAKa,EAAIA,EACTb,KAAKmnB,EAAIA,EACTnnB,KAAKqK,WAAY,EACjBrK,KAAKiP,MAAO,EAmCd,QAASnF,GAAcxB,EAAQqe,GAC7B3mB,KAAKsI,OAASA,EACdtI,KAAK2mB,IAAMA,EACX3mB,KAAKqK,WAAY,EA4BnB,MApFAqL,IAASwS,EAAoBzI,GAO7ByI,EAAmBlkB,UAAUod,cAAgB,SAAU/Y,GACrD,GAAI8e,GAAI,GAAIhb,IAAuB6b,EAAI,GAAI7e,GAG3C,OAFAge,GAAE9a,IAAI2b,GACNA,EAAE1e,cAActJ,KAAKc,OAAOyI,UAAU,GAAI4e,GAAiB9f,EAAU8e,KAC9DA,GASTgB,EAAiBnkB,UAAUmH,OAAS,SAASoc,GAC3C,IAAGvnB,KAAKqK,UAAR,CACA,GAAIsc,GAAM,GAAIxd,GACdnJ,MAAKmnB,EAAE9a,IAAIsa,GAEX/W,GAAU2X,KAAiBA,EAAc1X,GAAsB0X,IAE/DZ,EAAIrd,cAAcie,EAAYhe,UAAU,GAAIO,GAAc9J,KAAM2mB,OAElEwB,EAAiBnkB,UAAUkH,QAAU,SAAUhL,GACzCF,KAAKqK,YACPrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,KAGnBioB,EAAiBnkB,UAAUoH,YAAc,WACnCpL,KAAKqK,YACPrK,KAAKqK,WAAY,EACjBrK,KAAKiP,MAAO,EACM,IAAlBjP,KAAKmnB,EAAE1nB,QAAgBO,KAAKa,EAAEuK,gBAGlC+c,EAAiBnkB,UAAUmL,QAAU,WAAanP,KAAKqK,WAAY,GACnE8d,EAAiBnkB,UAAU2b,KAAO,SAAUzf,GAC1C,MAAKF,MAAKqK,WAMH,GALLrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,IACR,IAWX4J,EAAc9F,UAAUmH,OAAS,SAAUZ,GAAUvK,KAAKqK,WAAarK,KAAKsI,OAAOzH,EAAEsK,OAAOZ,IAC5FT,EAAc9F,UAAUkH,QAAU,SAAUhL,GACtCF,KAAKqK,YACPrK,KAAKqK,WAAY,EACjBrK,KAAKsI,OAAOzH,EAAEqK,QAAQhL,KAG1B4J,EAAc9F,UAAUoH,YAAc,WACpC,IAAIpL,KAAKqK,UAAW,CAClB,GAAI/B,GAAStI,KAAKsI,MAClBtI,MAAKqK,WAAY,EACjB/B,EAAO6e,EAAEnY,OAAOhP,KAAK2mB,KACrBre,EAAO2G,MAA4B,IAApB3G,EAAO6e,EAAE1nB,QAAgB6I,EAAOzH,EAAEuK,gBAGrDtB,EAAc9F,UAAUmL,QAAU,WAAanP,KAAKqK,WAAY,GAChEP,EAAc9F,UAAU2b,KAAO,SAAUzf,GACvC,MAAKF,MAAKqK,WAMH,GALLrK,KAAKqK,WAAY,EACjBrK,KAAKsI,OAAOzH,EAAEqK,QAAQhL,IACf,IAMJgoB,GACPnH,GAMFvC,IAAgBkJ,SAAW,WACzB,MAAO,IAAIQ,IAAmBloB,OAQhCwe,GAAgB4J,UAAY,SAAU7X,GACpC,GAAIzP,GAASd,IACb,OAAO,IAAIiJ,IAAoB,SAAUpI,GACvC,GAAIwnB,IAAS,EACTnc,EAAc,GAAIC,IAAoBrL,EAAOyI,UAAU,SAAU+e,GACnED,GAAUxnB,EAAEsK,OAAOmd,IAClB,SAAUpoB,GAAKW,EAAEqK,QAAQhL,IAAO,WACjCmoB,GAAUxnB,EAAEuK,gBAGdwE,IAAUW,KAAWA,EAAQV,GAAsBU,GAEnD,IAAIgY,GAAoB,GAAIpf,GAS5B,OARA+C,GAAYG,IAAIkc,GAChBA,EAAkBjf,cAAciH,EAAMhH,UAAU,WAC9C8e,GAAS,EACTE,EAAkBpZ,WACjB,SAAUjP,GAAKW,EAAEqK,QAAQhL,IAAO,WACjCqoB,EAAkBpZ,aAGbjD,GACNpL,GAGL,IAAI0nB,IAAoB,SAAS/I,GAE/B,QAAS+I,GAAiB1nB,GACxBd,KAAKc,OAASA,EACd2e,EAAUtc,KAAKnD,MAQjB,QAASyoB,GAAe5nB,EAAG+hB,GACzB5iB,KAAKa,EAAIA,EACTb,KAAK4iB,MAAQA,EACb5iB,KAAK0oB,SAAU,EACf1oB,KAAK2oB,OAAS,EACd3oB,KAAK4oB,WAAY,EACjB5oB,KAAKqK,WAAY,EAiCnB,QAASP,GAAcxB,EAAQiH,GAC7BvP,KAAKsI,OAASA,EACdtI,KAAKuP,GAAKA,EACVvP,KAAKqK,WAAY,EA+BnB,MApFAqL,IAAS8S,EAAkB/I,GAM3B+I,EAAiBxkB,UAAUod,cAAgB,SAAUvgB,GACnD,GAAI+hB,GAAQ,GAAIvZ,IAAoBxC,EAAI7G,KAAKc,OAAOyI,UAAU,GAAIkf,GAAe5nB,EAAG+hB,GACpF,OAAO,IAAIzW,IAAoBtF,EAAG+b,IAWpC6F,EAAezkB,UAAUmH,OAAS,SAAUoc,GAC1C,IAAIvnB,KAAKqK,UAAT,CACA,GAAIwC,GAAI,GAAI1D,IAA8BoG,IAAOvP,KAAK2oB,MACtD3oB,MAAK4oB,WAAY,EACjB5oB,KAAK4iB,MAAMtZ,cAAcuD,GACzB+C,GAAU2X,KAAiBA,EAAc1X,GAAsB0X,IAC/D1a,EAAEvD,cAAcie,EAAYhe,UAAU,GAAIO,GAAc9J,KAAMuP,OAEhEkZ,EAAezkB,UAAUkH,QAAU,SAAUhL,GACtCF,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,KAGnBuoB,EAAezkB,UAAUoH,YAAc,WAChCpL,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAK0oB,SAAU,GACd1oB,KAAK4oB,WAAa5oB,KAAKa,EAAEuK,gBAG9Bqd,EAAezkB,UAAUmL,QAAU,WAAcnP,KAAKqK,WAAY,GAClEoe,EAAezkB,UAAU2b,KAAO,SAAUzf,GACxC,MAAIF,MAAKqK,WAKF,GAJLrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,IACR,IAUX4J,EAAc9F,UAAUmH,OAAS,SAAUZ,GACrCvK,KAAKqK,WACTrK,KAAKsI,OAAOqgB,SAAW3oB,KAAKuP,IAAMvP,KAAKsI,OAAOzH,EAAEsK,OAAOZ,IAEzDT,EAAc9F,UAAUkH,QAAU,SAAUhL,GACrCF,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAKsI,OAAOqgB,SAAW3oB,KAAKuP,IAAMvP,KAAKsI,OAAOzH,EAAEqK,QAAQhL,KAG5D4J,EAAc9F,UAAUoH,YAAc,WAC/BpL,KAAKqK,YACRrK,KAAKqK,WAAY,EACbrK,KAAKsI,OAAOqgB,SAAW3oB,KAAKuP,KAC9BvP,KAAKsI,OAAOsgB,WAAY,EACxB5oB,KAAKsI,OAAO+B,WAAarK,KAAKsI,OAAOzH,EAAEuK,iBAI7CtB,EAAc9F,UAAUmL,QAAU,WAAcnP,KAAKqK,WAAY,GACjEP,EAAc9F,UAAU2b,KAAO,SAAUzf,GACvC,MAAIF,MAAKqK,WAKF,GAJLrK,KAAKqK,WAAY,EACjBrK,KAAKsI,OAAOzH,EAAEqK,QAAQhL,IACf,IAKJsoB,GACPzH,GAMFvC,IAAgB,UAAYA,GAAgBqK,aAAe,WACzD,MAAO,IAAIL,IAAiBxoB,MAG9B,IAAI8oB,IAAuB,SAASrJ,GAGlC,QAASqJ,GAAoBhoB,EAAQyP,GACnCvQ,KAAKc,OAASA,EACdd,KAAKuQ,MAAQX,GAAUW,GAASV,GAAsBU,GAASA,EAC/DkP,EAAUtc,KAAKnD,MAUjB,QAAS8J,GAAcjJ,GACrBb,KAAKa,EAAIA,EACTb,KAAKqK,WAAY,EAyBnB,MA1CAqL,IAASoT,EAAqBrJ,GAQ9BqJ,EAAoB9kB,UAAUod,cAAgB,SAASvgB,GACrD,MAAO,IAAIsL,IACTnM,KAAKc,OAAOyI,UAAU1I,GACtBb,KAAKuQ,MAAMhH,UAAU,GAAIO,GAAcjJ,MAQ3CiJ,EAAc9F,UAAUmH,OAAS,SAAUZ,GACrCvK,KAAKqK,WACTrK,KAAKa,EAAEuK,eAETtB,EAAc9F,UAAUkH,QAAU,SAAUK,GACrCvL,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQK,KAGnBzB,EAAc9F,UAAUoH,YAAc,YACnCpL,KAAKqK,YAAcrK,KAAKqK,WAAY,IAEvCP,EAAc9F,UAAUmL,QAAU,WAAanP,KAAKqK,WAAY,GAChEP,EAAc9F,UAAU2b,KAAO,SAAUzf,GACvC,MAAKF,MAAKqK,WAKH,GAJLrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,IACR,IAKJ4oB,GACP/H,GAOFvC,IAAgBuK,UAAY,SAAUxY,GACpC,MAAO,IAAIuY,IAAoB9oB,KAAMuQ,IASvCiO,GAAgBwK,eAAiB,WAE/B,IAAI,GADAxpB,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,GACrCI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EACnD,IAAI4R,GAAiB7H,EAAKnD,MAAO1F,EAASd,IAG1C,OAFAL,OAAM4W,QAAQ5M,EAAK,MAAQA,EAAOA,EAAK,IAEhC,GAAIV,IAAoB,SAAUZ,GAOvC,IAAK,GANDoD,GAAI9B,EAAKlK,OACX2K,EAAW3D,EAAgBgF,EAAGhC,GAC9BkI,GAAc,EACdD,EAAS,GAAI/R,OAAM8L,GAEjBib,EAAgB,GAAI/mB,OAAM8L,EAAI,GACzBuK,EAAM,EAASvK,EAANuK,EAASA,KACxB,SAAUpW,GACT,GAAI2Q,GAAQ5G,EAAK/J,GAAI+mB,EAAM,GAAIxd,GAC/ByG,IAAUW,KAAWA,EAAQV,GAAsBU,IACnDoW,EAAIrd,cAAciH,EAAMhH,UAAU,SAAUgB,GAC1CmH,EAAO9R,GAAK2K,EACZH,EAASxK,IAAK,EACd+R,EAAcvH,EAASwH,MAAMC,KAC5B,SAAU3R,GAAKmI,EAAS6C,QAAQhL,IAAO+S,KAC1CyT,EAAc9mB,GAAK+mB,GACnB3Q,EAGJ,IAAI2Q,GAAM,GAAIxd,GAYd,OAXAwd,GAAIrd,cAAcxI,EAAOyI,UAAU,SAAUgB,GAC3C,GAAI0e,IAAa1e,GAAGyX,OAAOtQ,EAC3B,IAAKC,EAAL,CACA,GAAIX,GAAM/F,GAASuG,GAAgBzR,MAAM,KAAMkpB,EAC/C,OAAIjY,KAAQ7Q,GAAmBkI,EAAS6C,QAAQ8F,EAAI9Q,OACpDmI,GAAS8C,OAAO6F,KACf,SAAU9Q,GAAKmI,EAAS6C,QAAQhL,IAAO,WACxCmI,EAAS+C,iBAEXsb,EAAcjb,GAAKkb,EAEZ,GAAIxa,IAAoBua,IAC9B1mB,OAgBLwe,GAAgB0K,IAAM,WACpB,GAAyB,IAArBjpB,UAAUR,OAAgB,KAAM,IAAI2C,OAAM,oBAG9C,KAAI,GADA5C,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,GACrCI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EACnD,IAAI4R,GAAiBlL,GAAWqD,EAAKnK,EAAM,IAAMmK,EAAKnD,MAAQkD,CAC9D/J,OAAM4W,QAAQ5M,EAAK,MAAQA,EAAOA,EAAK,GAEvC,IAAIrB,GAAStI,IAEb,OADA2J,GAAK5I,QAAQuH,GACN,GAAIW,IAAoB,SAAUpI,GAMvC,IAAK,GALD4K,GAAI9B,EAAKlK,OACX0pB,EAAS1iB,EAAgBgF,EAAG7B,GAC5BkI,EAASrL,EAAgBgF,EAAGhC,GAE1Bid,EAAgB,GAAI/mB,OAAM8L,GACrBuK,EAAM,EAASvK,EAANuK,EAASA,KACzB,SAAWpW,GACT,GAAIkB,GAAS6I,EAAK/J,GAAI+mB,EAAM,GAAIxd,GAEhCyG,IAAU9O,KAAYA,EAAS+O,GAAsB/O,IAErD6lB,EAAIrd,cAAcxI,EAAOyI,UAAU,SAAUgB,GAE3C,GADA4e,EAAOvpB,GAAG8B,KAAK6I,GACX4e,EAAOvX,MAAM,SAAUrH,GAAK,MAAOA,GAAE9K,OAAS,IAAO,CACvD,GAAI2pB,GAAeD,EAAO3H,IAAI,SAAUjX,GAAK,MAAOA,GAAE8D,UAClD2C,EAAM/F,GAASuG,GAAgBzR,MAAMuI,EAAQ8gB,EACjD,IAAIpY,IAAQ7Q,GAAY,MAAOU,GAAEqK,QAAQ8F,EAAI9Q,EAC7CW,GAAEsK,OAAO6F,OACAc,GAAO0U,OAAO,SAAUjc,EAAGkc,GAAK,MAAOA,KAAM7mB,IAAMgS,MAAMC,KAClEhR,EAAEuK,eAEH,SAAUlL,GAAKW,EAAEqK,QAAQhL,IAAO,WACjC4R,EAAOlS,IAAK,EACZkS,EAAOF,MAAMC,KAAahR,EAAEuK,iBAE9Bsb,EAAc9mB,GAAK+mB,GAClB3Q,EAGL,OAAO,IAAI7J,IAAoBua,IAC9Bpe,IASLyX,GAAWmJ,IAAM,WAEf,IAAI,GADA1pB,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,GACrCI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EAC/CD,OAAM4W,QAAQ5M,EAAK,MACrBA,EAAOrD,GAAWqD,EAAK,IAAMA,EAAK,GAAGqY,OAAOrY,EAAK,IAAMA,EAAK,GAE9D,IAAI0f,GAAQ1f,EAAK0E,OACjB,OAAOgb,GAAMH,IAAInpB,MAAMspB,EAAO1f,IAgBlC6U,GAAgB8K,YAAc,WAC5B,GAAyB,IAArBrpB,UAAUR,OAAgB,KAAM,IAAI2C,OAAM,oBAG9C,KAAI,GADA5C,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,GACrCI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EACnD,IAAI4R,GAAiBlL,GAAWqD,EAAKnK,EAAM,IAAMmK,EAAKnD,MAAQkD,EAE1DpB,EAAStI,IAEb,OADA2J,GAAK5I,QAAQuH,GACN,GAAIW,IAAoB,SAAUpI,GAMvC,IAAK,GALD4K,GAAI9B,EAAKlK,OACX0pB,EAAS1iB,EAAgBgF,EAAG7B,GAC5BkI,EAASrL,EAAgBgF,EAAGhC,GAE1Bid,EAAgB,GAAI/mB,OAAM8L,GACrBuK,EAAM,EAASvK,EAANuK,EAASA,KACzB,SAAWpW,GACT,GAAIkB,GAAS6I,EAAK/J,GAAI+mB,EAAM,GAAIxd,KAE/BwL,GAAY7T,IAAW4T,GAAW5T,MAAaA,EAASgkB,GAAehkB,IAExE6lB,EAAIrd,cAAcxI,EAAOyI,UAAU,SAAUgB,GAE3C,GADA4e,EAAOvpB,GAAG8B,KAAK6I,GACX4e,EAAOvX,MAAM,SAAUrH,GAAK,MAAOA,GAAE9K,OAAS,IAAO,CACvD,GAAI2pB,GAAeD,EAAO3H,IAAI,SAAUjX,GAAK,MAAOA,GAAE8D,UAClD2C,EAAM/F,GAASuG,GAAgBzR,MAAMuI,EAAQ8gB,EACjD,IAAIpY,IAAQ7Q,GAAY,MAAOU,GAAEqK,QAAQ8F,EAAI9Q,EAC7CW,GAAEsK,OAAO6F,OACAc,GAAO0U,OAAO,SAAUjc,EAAGkc,GAAK,MAAOA,KAAM7mB,IAAMgS,MAAMC,KAClEhR,EAAEuK,eAEH,SAAUlL,GAAKW,EAAEqK,QAAQhL,IAAO,WACjC4R,EAAOlS,IAAK,EACZkS,EAAOF,MAAMC,KAAahR,EAAEuK,iBAE9Bsb,EAAc9mB,GAAK+mB,GAClB3Q,EAGL,OAAO,IAAI7J,IAAoBua,IAC9Bpe,IAWHkW,GAAgB3U,aAAe,WAC7B,MAAO,IAAIZ,IAAoBY,EAAa7J,MAAOA,OAOrDwe,GAAgB+K,cAAgB,WAC9B,GAAIzoB,GAASd,IACb,OAAO,IAAIiJ,IAAoB,SAAUpI,GACvC,MAAOC,GAAOyI,UAAU,SAAUgB,GAAK,MAAOA,GAAE+D,OAAOzN,IAAO,SAASX,GAAKW,EAAEqK,QAAQhL,IAAO,WAAcW,EAAEuK,iBAC5GpL,MAGL,IAAIwpB,IAAkC,SAAS/J,GAE7C,QAAS+J,GAA+B1oB,EAAQ2oB,EAAO5R,GACrD7X,KAAKc,OAASA,EACdd,KAAKypB,MAAQA,EACbzpB,KAAK6X,SAAWA,EAChB4H,EAAUtc,KAAKnD,MAOjB,MAZA0V,IAAS8T,EAAgC/J,GAQzC+J,EAA+BxlB,UAAUod,cAAgB,SAAUvgB,GACjE,MAAOb,MAAKc,OAAOyI,UAAU,GAAImgB,IAA6B7oB,EAAGb,KAAKypB,MAAOzpB,KAAK6X,YAG7E2R,GACPzI,IAEE2I,GAAgC,SAASjK,GAE3C,QAASiK,GAA6B7oB,EAAG4oB,EAAO5R,GAC9C7X,KAAKa,EAAIA,EACTb,KAAKypB,MAAQA,EACbzpB,KAAK6X,SAAWA,EAChB7X,KAAK2pB,eAAgB,EACrB3pB,KAAK4pB,WAAa,KAClBnK,EAAUtc,KAAKnD,MA0BjB,MAjCA0V,IAASgU,EAA8BjK,GAUvCiK,EAA6B1lB,UAAUyN,KAAO,SAAUlH,GACtD,GAAasf,GAATpmB,EAAM8G,CACV,OAAIjE,IAAWtG,KAAKypB,SAClBhmB,EAAMwH,GAASjL,KAAKypB,OAAOlf,GACvB9G,IAAQtD,IAAmBH,KAAKa,EAAEqK,QAAQzH,EAAIvD,GAEhDF,KAAK2pB,gBACPE,EAAiB5e,GAASjL,KAAK6X,UAAU7X,KAAK4pB,WAAYnmB,GACtDomB,IAAmB1pB,IAAmBH,KAAKa,EAAEqK,QAAQ2e,EAAe3pB,QAErEF,KAAK2pB,eAAkBE,IAC1B7pB,KAAK2pB,eAAgB,EACrB3pB,KAAK4pB,WAAanmB,EAClBzD,KAAKa,EAAEsK,OAAOZ,MAGlBmf,EAA6B1lB,UAAU1D,MAAQ,SAASJ,GACtDF,KAAKa,EAAEqK,QAAQhL,IAEjBwpB,EAA6B1lB,UAAU0b,UAAY,WACjD1f,KAAKa,EAAEuK,eAGFse,GACPlK,GAQFhB,IAAgBsL,qBAAuB,SAAUL,EAAO5R,GAEtD,MADAA,KAAaA,EAAW1E,IACjB,GAAIqW,IAA+BxpB,KAAMypB,EAAO5R,GAGzD,IAAIkS,IAAiB,SAAStK,GAE5B,QAASsK,GAAcjpB,EAAQ+d,EAAkB3T,EAASE,GACxDpL,KAAKc,OAASA,EACdd,KAAKgqB,IAAMnL,EACX7e,KAAKiqB,IAAM/e,EACXlL,KAAKkqB,IAAM9e,EACXqU,EAAUtc,KAAKnD,MAOjB,QAAS8J,GAAcjJ,EAAG4J,GACxBzK,KAAKa,EAAIA,EACTb,KAAKmqB,GAAK1f,EAAEuf,KAAO1jB,GAAWmE,EAAEuf,KAC9B1K,GAAe7U,EAAEuf,KAAO/W,GAAMxI,EAAEwf,KAAOhX,GAAMxI,EAAEyf,KAAOjX,IACtDxI,EAAEuf,IACJhqB,KAAKqK,WAAY,EAkCnB,MApDAqL,IAASqU,EAActK,GASvBsK,EAAc/lB,UAAUod,cAAgB,SAASvgB,GAC/C,MAAOb,MAAKc,OAAOyI,UAAU,GAAIO,GAAcjJ,EAAGb,QAUpD8J,EAAc9F,UAAUmH,OAAS,SAASZ,GACxC,IAAIvK,KAAKqK,UAAT,CACA,GAAI2G,GAAM/F,GAASjL,KAAKmqB,EAAEhf,QAAQhI,KAAKnD,KAAKmqB,EAAG5f,EAC3CyG,KAAQ7Q,IAAYH,KAAKa,EAAEqK,QAAQ8F,EAAI9Q,GAC3CF,KAAKa,EAAEsK,OAAOZ,KAEhBT,EAAc9F,UAAUkH,QAAU,SAASK,GACzC,IAAKvL,KAAKqK,UAAW,CACnBrK,KAAKqK,WAAY,CACjB,IAAI2G,GAAM/F,GAASjL,KAAKmqB,EAAEjf,SAAS/H,KAAKnD,KAAKmqB,EAAG5e,EAChD,IAAIyF,IAAQ7Q,GAAY,MAAOH,MAAKa,EAAEqK,QAAQ8F,EAAI9Q,EAClDF,MAAKa,EAAEqK,QAAQK,KAGnBzB,EAAc9F,UAAUoH,YAAc,WACpC,IAAKpL,KAAKqK,UAAW,CACnBrK,KAAKqK,WAAY,CACjB,IAAI2G,GAAM/F,GAASjL,KAAKmqB,EAAE/e,aAAajI,KAAKnD,KAAKmqB,EACjD,IAAInZ,IAAQ7Q,GAAY,MAAOH,MAAKa,EAAEqK,QAAQ8F,EAAI9Q,EAClDF,MAAKa,EAAEuK,gBAGXtB,EAAc9F,UAAUmL,QAAU,WAAanP,KAAKqK,WAAY,GAChEP,EAAc9F,UAAU2b,KAAO,SAAUzf,GACvC,MAAKF,MAAKqK,WAKH,GAJLrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,IACR,IAKJ6pB,GACPhJ,GAUFvC,IAAgB,MAAQA,GAAgB4L,IAAM5L,GAAgB6L,SAAW,SAAUxL,EAAkB3T,EAASE,GAC5G,MAAO,IAAI2e,IAAc/pB,KAAM6e,EAAkB3T,EAASE,IAU5DoT,GAAgB8L,SAAW9L,GAAgB+L,UAAY,SAAUpf,EAAQ4J,GACvE,MAAO/U,MAAKoqB,IAAuB,mBAAZrV,GAA0B,SAAUxK,GAAKY,EAAOhI,KAAK4R,EAASxK,IAAQY,IAU/FqT,GAAgBgM,UAAYhM,GAAgBiM,WAAa,SAAUvf,EAAS6J,GAC1E,MAAO/U,MAAKoqB,IAAInX,GAAyB,mBAAZ8B,GAA0B,SAAU7U,GAAKgL,EAAQ/H,KAAK4R,EAAS7U,IAAQgL,IAUtGsT,GAAgBkM,cAAgBlM,GAAgBmM,eAAiB,SAAUvf,EAAa2J,GACtF,MAAO/U,MAAKoqB,IAAInX,GAAM,KAAyB,mBAAZ8B,GAA0B,WAAc3J,EAAYjI,KAAK4R,IAAc3J,IAQ5GoT,GAAgB,WAAa,SAAU1H,GACrC,GAAIhW,GAASd,IACb,OAAO,IAAIiJ,IAAoB,SAAUZ,GACvC,GAAIe,GAAe6B,GAASnK,EAAOyI,WAAWpG,KAAKrC,EAAQuH,EAC3D,OAAIe,KAAiBjJ,IACnB2W,IACO1W,EAAQgJ,EAAalJ,IAEvB6W,GAAiB,WACtB,GAAIV,GAAIpL,GAAS7B,EAAa+F,SAAShM,KAAKiG,EAC5C0N,KACAT,IAAMlW,IAAYC,EAAQiW,EAAEnW,MAE7BF,MAGL,IAAI4qB,IAA4B,SAASnL,GAGvC,QAASmL,GAAyB9pB,GAChCd,KAAKc,OAASA,EACd2e,EAAUtc,KAAKnD,MAOjB,QAAS8J,GAAcjJ,GACrBb,KAAKa,EAAIA,EACTb,KAAKqK,WAAY,EA0BnB,MAvCAqL,IAASkV,EAA0BnL,GAOnCmL,EAAyB5mB,UAAUod,cAAgB,SAAUvgB,GAC3D,MAAOb,MAAKc,OAAOyI,UAAU,GAAIO,GAAcjJ,KAOjDiJ,EAAc9F,UAAUmH,OAAS8H,GACjCnJ,EAAc9F,UAAUkH,QAAU,SAAUK,GACtCvL,KAAKqK,YACPrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQK,KAGnBzB,EAAc9F,UAAUoH,YAAc,WAChCpL,KAAKqK,YACPrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEuK,gBAGXtB,EAAc9F,UAAUmL,QAAU,WAAanP,KAAKqK,WAAY,GAChEP,EAAc9F,UAAU2b,KAAO,SAAUzf,GACvC,MAAKF,MAAKqK,WAMH,GALLrK,KAAKqK,WAAY,EACjBrK,KAAKqI,SAAS6C,QAAQhL,IACf,IAMJ0qB,GACP7J,GAMFvC,IAAgBqM,eAAiB,WAC/B,MAAO,IAAID,IAAyB5qB,OAOtCwe,GAAgB3Q,YAAc,WAC5B,GAAI/M,GAASd,IACb,OAAO,IAAIiJ,IAAoB,SAAUZ,GACvC,MAAOvH,GAAOyI,UAAU,SAAUvE,GAChCqD,EAAS8C,OAAO4T,GAAyB/Z,KACxC,SAAU9E,GACXmI,EAAS8C,OAAO8T,GAA0B/e,IAC1CmI,EAAS+C,eACR,WACD/C,EAAS8C,OAAOgU,MAChB9W,EAAS+C,iBAEVtK,IAQL0d,GAAgB6E,OAAS,SAAUC,GACjC,MAAOF,IAAiBpjB,KAAMsjB,GAAatB,UAa7CxD,GAAgBsM,MAAQ,SAAUC,GAChC,MAAO3H,IAAiBpjB,KAAM+qB,GAAY5I,cAa5C3D,GAAgBwM,UAAY,SAAUxI,GACpC,MAAOY,IAAiBpjB,MAAMoiB,eAAeI,GAE/C,IAAIyI,IAAkB,SAASxL,GAE7B,QAASwL,GAAenqB,EAAQiJ,EAAaC,EAASC,GACpDjK,KAAKc,OAASA,EACdd,KAAK+J,YAAcA,EACnB/J,KAAKgK,QAAUA,EACfhK,KAAKiK,KAAOA,EACZwV,EAAUtc,KAAKnD,MAOjB,MAbA0V,IAASuV,EAAgBxL,GASzBwL,EAAejnB,UAAUod,cAAgB,SAASvgB,GAChD,MAAOb,MAAKc,OAAOyI,UAAU,GAAIO,GAAcjJ,EAAEb,QAG5CirB,GACPlK,GAYFjX,GAAc9F,WACZmH,OAAQ,SAAUZ,GAChB,MAAIvK,MAAKqK,UAAT,SACCrK,KAAKoK,WAAapK,KAAKoK,UAAW,GAC/BpK,KAAKkK,gBACPlK,KAAKmK,aAAec,GAASjL,KAAK+J,aAAa/J,KAAKmK,aAAcI,IAElEvK,KAAKmK,aAAenK,KAAKgK,QAAUiB,GAASjL,KAAK+J,aAAa/J,KAAKiK,KAAMM,GAAKA,EAC9EvK,KAAKkK,iBAAkB,GAErBlK,KAAKmK,eAAiBhK,GAAmBH,KAAKa,EAAEqK,QAAQlL,KAAKmK,aAAajK,OAC9EF,MAAKa,EAAEsK,OAAOnL,KAAKmK,gBAErBe,QAAS,SAAUhL,GACZF,KAAKqK,YACRrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,KAGnBkL,YAAa,WACNpL,KAAKqK,YACRrK,KAAKqK,WAAY,GAChBrK,KAAKoK,UAAYpK,KAAKgK,SAAWhK,KAAKa,EAAEsK,OAAOnL,KAAKiK,MACrDjK,KAAKa,EAAEuK,gBAGX+D,QAAS,WAAanP,KAAKqK,WAAY,GACvCsV,KAAM,SAAUzf,GACd,MAAKF,MAAKqK,WAKH,GAJLrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,IACR,KAabse,GAAgB0M,KAAO,WACrB,GAAqBjhB,GAAjBD,GAAU,EAAaD,EAAc9J,UAAU,EAKnD,OAJyB,KAArBA,UAAUR,SACZuK,GAAU,EACVC,EAAOhK,UAAU,IAEZ,GAAIgrB,IAAejrB,KAAM+J,EAAaC,EAASC,IAWxDuU,GAAgB2M,SAAW,SAAUzkB,GACnC,GAAY,EAARA,EAAa,KAAM,IAAIuN,GAC3B,IAAInT,GAASd,IACb,OAAO,IAAIiJ,IAAoB,SAAUpI,GACvC,GAAI8M,KACJ,OAAO7M,GAAOyI,UAAU,SAAUgB,GAChCoD,EAAEjM,KAAK6I,GACPoD,EAAElO,OAASiH,GAAS7F,EAAEsK,OAAOwC,EAAEU,UAC9B,SAAUnO,GAAKW,EAAEqK,QAAQhL,IAAO,WAAcW,EAAEuK,iBAClDtK,IAWL0d,GAAgB4M,UAAY,WAC1B,GAAY5iB,GAAWqG,EAAQ,CACzB5O,WAAUR,QAAUiJ,GAAYzI,UAAU,KAC9CuI,EAAYvI,UAAU,GACtB4O,EAAQ,GAERrG,EAAYiS,EAEd,KAAI,GAAI9Q,MAAW/J,EAAIiP,EAAOrP,EAAMS,UAAUR,OAAYD,EAAJI,EAASA,IAAO+J,EAAKjI,KAAKzB,UAAUL,GAC1F,OAAO6jB,KAAcuB,GAAoBrb,EAAMnB,GAAYxI,OAAOgiB,UAWpExD,GAAgB6M,SAAW,SAAU3kB,GACnC,GAAY,EAARA,EAAa,KAAM,IAAIuN,GAC3B,IAAInT,GAASd,IACb,OAAO,IAAIiJ,IAAoB,SAAUpI,GACvC,GAAI8M,KACJ,OAAO7M,GAAOyI,UAAU,SAAUgB,GAChCoD,EAAEjM,KAAK6I,GACPoD,EAAElO,OAASiH,GAASiH,EAAEU,SACrB,SAAUnO,GAAKW,EAAEqK,QAAQhL,IAAO,WACjC,KAAOyN,EAAElO,OAAS,GAAKoB,EAAEsK,OAAOwC,EAAEU,QAClCxN,GAAEuK,iBAEHtK,IAGP0d,GAAgB8M,cAAgB9M,GAAgB+M,UAAY,SAAS1gB,EAAU2G,EAAgBuD,GAC3F,MAAO,IAAIuM,IAAkBthB,KAAM6K,EAAU2G,EAAgBuD,GAASiS,MAAM,GAE9E,IAAIwE,IAAiB,SAAU/L,GAG7B,QAAS+L,GAAc1qB,EAAQ+J,EAAUkK,GACvC/U,KAAKc,OAASA,EACdd,KAAK6K,SAAWgK,GAAahK,EAAUkK,EAAS,GAChD0K,EAAUtc,KAAKnD,MAGjB,QAASyrB,GAAS5gB,EAAUmC,GAC1B,MAAO,UAAUzC,EAAG3K,EAAGiB,GAAK,MAAOgK,GAAS1H,KAAKnD,KAAMgN,EAAKnC,SAASN,EAAG3K,EAAGiB,GAAIjB,EAAGiB,IAWpF,QAASiJ,GAAcjJ,EAAGgK,EAAU/J,GAClCd,KAAKa,EAAIA,EACTb,KAAK6K,SAAWA,EAChB7K,KAAKc,OAASA,EACdd,KAAKJ,EAAI,EACTI,KAAKqK,WAAY,EA0BnB,MAnDAqL,IAAS8V,EAAe/L,GAYxB+L,EAAcxnB,UAAU0nB,YAAc,SAAU7gB,EAAUkK,GACxD,MAAO,IAAIyW,GAAcxrB,KAAKc,OAAQ2qB,EAAS5gB,EAAU7K,MAAO+U,IAGlEyW,EAAcxnB,UAAUod,cAAgB,SAAUvgB,GAChD,MAAOb,MAAKc,OAAOyI,UAAU,GAAIO,GAAcjJ,EAAGb,KAAK6K,SAAU7K,QAWnE8J,EAAc9F,UAAUmH,OAAS,SAASZ,GACxC,IAAIvK,KAAKqK,UAAT,CACA,GAAIxH,GAASoI,GAASjL,KAAK6K,UAAUN,EAAGvK,KAAKJ,IAAKI,KAAKc,OACvD,OAAI+B,KAAW1C,GAAmBH,KAAKa,EAAEqK,QAAQrI,EAAO3C,OACxDF,MAAKa,EAAEsK,OAAOtI,KAEhBiH,EAAc9F,UAAUkH,QAAU,SAAUhL,GACtCF,KAAKqK,YAAarK,KAAKqK,WAAY,EAAMrK,KAAKa,EAAEqK,QAAQhL,KAE9D4J,EAAc9F,UAAUoH,YAAc,WAChCpL,KAAKqK,YAAarK,KAAKqK,WAAY,EAAMrK,KAAKa,EAAEuK,gBAEtDtB,EAAc9F,UAAUmL,QAAU,WAAanP,KAAKqK,WAAY,GAChEP,EAAc9F,UAAU2b,KAAO,SAAUzf,GACvC,MAAKF,MAAKqK,WAMH,GALLrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,IACR,IAMJsrB,GAEPzK,GAQFvC,IAAgBgD,IAAMhD,GAAgBmN,OAAS,SAAU9gB,EAAUkK,GACjE,GAAI6W,GAAiC,kBAAb/gB,GAA0BA,EAAW,WAAc,MAAOA,GAClF,OAAO7K,gBAAgBwrB,IACrBxrB,KAAK0rB,YAAYE,EAAY7W,GAC7B,GAAIyW,IAAcxrB,KAAM4rB,EAAY7W,IAwBxCyJ,GAAgBqN,MAAQ,WACtB,GAAIrsB,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,EAC7C,IAAY,IAARA,EAAa,KAAM,IAAI4C,OAAM,sCACjC,KAAI,GAAIxC,GAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EACnD,OAAOI,MAAKwhB,IAAIlX,EAAQX,EAAMnK,KAGlCgf,GAAgBsN,QAAUtN,GAAgBuN,WAAa,SAASlhB,EAAU2G,EAAgBuD,GACtF,MAAO,IAAIuM,IAAkBthB,KAAM6K,EAAU2G,EAAgBuD,GAAS2S,YAU1E9U,GAAGmN,WAAW/b,UAAUgoB,cAAgB,SAASnhB,EAAU2G,EAAgBuD,GACvE,MAAO,IAAIuM,IAAkBthB,KAAM6K,EAAU2G,EAAgBuD,GAAS8T,eAExE,IAAIoD,IAAkB,SAASxM,GAE7B,QAASwM,GAAenrB,EAAQ4F,GAC9B1G,KAAKc,OAASA,EACdd,KAAKksB,UAAYxlB,EACjB+Y,EAAUtc,KAAKnD,MAOjB,QAAS8J,GAAcjJ,EAAGoiB,GACxBjjB,KAAKijB,EAAIA,EACTjjB,KAAKqW,EAAI4M,EACTjjB,KAAKa,EAAIA,EACTb,KAAKqK,WAAY,EA0BnB,MAzCAqL,IAASuW,EAAgBxM,GAOzBwM,EAAejoB,UAAUod,cAAgB,SAAUvgB,GACjD,MAAOb,MAAKc,OAAOyI,UAAU,GAAIO,GAAcjJ,EAAGb,KAAKksB,aASzDpiB,EAAc9F,UAAUmH,OAAS,SAAUZ,GACrCvK,KAAKqK,YACLrK,KAAKqW,GAAK,EACZrW,KAAKa,EAAEsK,OAAOZ,GAEdvK,KAAKqW,MAGTvM,EAAc9F,UAAUkH,QAAU,SAAShL,GACpCF,KAAKqK,YAAarK,KAAKqK,WAAY,EAAMrK,KAAKa,EAAEqK,QAAQhL,KAE/D4J,EAAc9F,UAAUoH,YAAc,WAC/BpL,KAAKqK,YAAarK,KAAKqK,WAAY,EAAMrK,KAAKa,EAAEuK,gBAEvDtB,EAAc9F,UAAUmL,QAAU,WAAanP,KAAKqK,WAAY,GAChEP,EAAc9F,UAAU2b,KAAO,SAASzf,GACtC,MAAKF,MAAKqK,WAKH,GAJLrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,IACR,IAKJ+rB,GACPlL,GAOFvC,IAAgB2N,KAAO,SAAUzlB,GAC/B,GAAY,EAARA,EAAa,KAAM,IAAIuN,GAC3B,OAAO,IAAIgY,IAAejsB,KAAM0G,IAYlC8X,GAAgB4N,UAAY,SAAUC,EAAWtX,GAC/C,GAAIjU,GAASd,KACT2E,EAAWkQ,GAAawX,EAAWtX,EAAS,EAChD,OAAO,IAAI9L,IAAoB,SAAUpI,GACvC,GAAIjB,GAAI,EAAGgO,GAAU,CACrB,OAAO9M,GAAOyI,UAAU,SAAUgB,GAChC,IAAKqD,EACH,IACEA,GAAWjJ,EAAS4F,EAAG3K,IAAKkB,GAC5B,MAAOZ,GAEP,WADAW,GAAEqK,QAAQhL,GAId0N,GAAW/M,EAAEsK,OAAOZ,IACnB,SAAUrK,GAAKW,EAAEqK,QAAQhL,IAAO,WAAcW,EAAEuK,iBAClDtK,IAYL0d,GAAgB8N,KAAO,SAAU5lB,EAAO8B,GACtC,GAAY,EAAR9B,EAAa,KAAM,IAAIuN,GAC3B,IAAc,IAAVvN,EAAe,MAAO2d,IAAgB7b,EAC1C,IAAI1H,GAASd,IACb,OAAO,IAAIiJ,IAAoB,SAAUpI,GACvC,GAAI0rB,GAAY7lB,CAChB,OAAO5F,GAAOyI,UAAU,SAAUgB,GAC5BgiB,IAAc,IAChB1rB,EAAEsK,OAAOZ,GACI,GAAbgiB,GAAkB1rB,EAAEuK,gBAErB,SAAUlL,GAAKW,EAAEqK,QAAQhL,IAAO,WAAcW,EAAEuK,iBAClDtK,IAUL0d,GAAgBgO,UAAY,SAAUH,EAAWtX,GAC/C,GAAIjU,GAASd,KACT2E,EAAWkQ,GAAawX,EAAWtX,EAAS,EAChD,OAAO,IAAI9L,IAAoB,SAAUpI,GACvC,GAAIjB,GAAI,EAAGgO,GAAU,CACrB,OAAO9M,GAAOyI,UAAU,SAAUgB,GAChC,GAAIqD,EAAS,CACX,IACEA,EAAUjJ,EAAS4F,EAAG3K,IAAKkB,GAC3B,MAAOZ,GAEP,WADAW,GAAEqK,QAAQhL,GAGR0N,EACF/M,EAAEsK,OAAOZ,GAET1J,EAAEuK,gBAGL,SAAUlL,GAAKW,EAAEqK,QAAQhL,IAAO,WAAcW,EAAEuK,iBAClDtK,GAGL,IAAI2rB,IAAoB,SAAUhN,GAGhC,QAASgN,GAAiB3rB,EAAQurB,EAAWtX,GAC3C/U,KAAKc,OAASA,EACdd,KAAKqsB,UAAYxX,GAAawX,EAAWtX,EAAS,GAClD0K,EAAUtc,KAAKnD,MAOjB,QAAS0sB,GAAeL,EAAWrf,GACjC,MAAO,UAASzC,EAAG3K,EAAGiB,GAAK,MAAOmM,GAAKqf,UAAU9hB,EAAG3K,EAAGiB,IAAMwrB,EAAUlpB,KAAKnD,KAAMuK,EAAG3K,EAAGiB,IAO1F,QAASiJ,GAAcjJ,EAAGwrB,EAAWvrB,GACnCd,KAAKa,EAAIA,EACTb,KAAKqsB,UAAYA,EACjBrsB,KAAKc,OAASA,EACdd,KAAKJ,EAAI,EACTI,KAAKqK,WAAY,EA2BnB,MApDAqL,IAAS+W,EAAkBhN,GAQ3BgN,EAAiBzoB,UAAUod,cAAgB,SAAUvgB,GACnD,MAAOb,MAAKc,OAAOyI,UAAU,GAAIO,GAAcjJ,EAAGb,KAAKqsB,UAAWrsB,QAOpEysB,EAAiBzoB,UAAU2oB,eAAiB,SAASN,EAAWtX,GAC9D,MAAO,IAAI0X,GAAiBzsB,KAAKc,OAAQ4rB,EAAeL,EAAWrsB,MAAO+U,IAW5EjL,EAAc9F,UAAUmH,OAAS,SAASZ,GACxC,IAAIvK,KAAKqK,UAAT,CACA,GAAIuiB,GAAc3hB,GAASjL,KAAKqsB,WAAW9hB,EAAGvK,KAAKJ,IAAKI,KAAKc,OAC7D,OAAI8rB,KAAgBzsB,GACXH,KAAKa,EAAEqK,QAAQ0hB,EAAY1sB,QAEpC0sB,GAAe5sB,KAAKa,EAAEsK,OAAOZ,MAE/BT,EAAc9F,UAAUkH,QAAU,SAAUhL,GACtCF,KAAKqK,YAAarK,KAAKqK,WAAY,EAAMrK,KAAKa,EAAEqK,QAAQhL,KAE9D4J,EAAc9F,UAAUoH,YAAc,WAChCpL,KAAKqK,YAAarK,KAAKqK,WAAY,EAAMrK,KAAKa,EAAEuK,gBAEtDtB,EAAc9F,UAAUmL,QAAU,WAAanP,KAAKqK,WAAY,GAChEP,EAAc9F,UAAU2b,KAAO,SAAUzf,GACvC,MAAKF,MAAKqK,WAKH,GAJLrK,KAAKqK,WAAY,EACjBrK,KAAKa,EAAEqK,QAAQhL,IACR,IAKJusB,GAEP1L,GAQFvC,IAAgBgI,OAAShI,GAAgBqO,MAAQ,SAAUR,EAAWtX,GACpE,MAAO/U,gBAAgBysB,IAAmBzsB,KAAK2sB,eAAeN,EAAWtX,GACvE,GAAI0X,IAAiBzsB,KAAMqsB,EAAWtX,IAyC5CgL,GAAW+M,aAAe,SAAUniB,EAAIC,EAAKC,GAC3C,MAAO,YACU,mBAARD,KAAwBA,EAAM5K,KAGrC,KAAI,GADAR,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,GACrCI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EACnD,OAAO8K,GAAmBC,EAAIC,EAAKC,EAAUlB,KA4CjDoW,GAAWgN,iBAAmB,SAAUpiB,EAAIC,EAAKC,GAC/C,MAAO,YACU,mBAARD,KAAwBA,EAAM5K,KAErC,KAAI,GADAR,GAAMS,UAAUR,OAAQkK,EAAO,GAAIhK,OAAMH,GACrCI,EAAI,EAAOJ,EAAJI,EAASA,IAAO+J,EAAK/J,GAAKK,UAAUL,EACnD,OAAOyL,GAAqBV,EAAIC,EAAKC,EAAUlB,KAWjD6B,EAAiBxH,UAAUmL,QAAU,WAC9BnP,KAAK8L,aACR9L,KAAK0L,GAAGshB,oBAAoBhtB,KAAK2L,GAAI3L,KAAK4L,KAAK,GAC/C5L,KAAK8L,YAAa,IAuBtB8G,GAAGE,OAAOma,iBAAkB,EAoB5BlN,GAAWmN,UAAY,SAAUC,EAASlhB,EAAWpB,GAEnD,MAAIsiB,GAAQC,YACHC,GACL,SAAUC,GAAKH,EAAQC,YAAYnhB,EAAWqhB,IAC9C,SAAUA,GAAKH,EAAQI,eAAethB,EAAWqhB,IACjDziB,GAIC+H,GAAGE,OAAOma,iBAEa,kBAAfE,GAAQK,IAA4C,kBAAhBL,GAAQM,IAQlD,GAAIxkB,IAAoB,SAAUpI,GACvC,MAAOkL,GACLohB,EACAlhB,EACAM,EAAa1L,EAAGgK,MACjB6iB,UAAUC,WAZFN,GACL,SAAUC,GAAKH,EAAQK,GAAGvhB,EAAWqhB,IACrC,SAAUA,GAAKH,EAAQM,IAAIxhB,EAAWqhB,IACtCziB,GAoBR,IAAIwiB,IAAmBtN,GAAWsN,iBAAmB,SAAUO,EAAYC,EAAehjB,EAAUrC,GAElG,MADAE,IAAYF,KAAeA,EAAYiS,IAChC,GAAIxR,IAAoB,SAAUpI,GACvC,QAASitB,KACP,GAAIjrB,GAAS5C,UAAU,EACvB,OAAIqG,IAAWuE,KACbhI,EAASoI,GAASJ,GAAU9K,MAAM,KAAME,WACpC4C,IAAW1C,IAAmBU,EAAEqK,QAAQrI,EAAO3C,OAErDW,GAAEsK,OAAOtI,GAGX,GAAIkrB,GAAcH,EAAWE,EAC7B,OAAO/W,IAAiB,WACtBzQ,GAAWunB,IAAkBA,EAAcC,EAAcC,OAE1DL,UAAUC,YAGXK,GAAyB,SAASvO,GAEpC,QAASuO,GAAsBvjB,GAC7BzK,KAAKyK,EAAIA,EACTgV,EAAUtc,KAAKnD,MAWjB,MAdA0V,IAASsY,EAAuBvO,GAMhCuO,EAAsBhqB,UAAUod,cAAgB,SAASvgB,GAKvD,MAJAb,MAAKyK,EAAEgJ,KAAK,SAAUwJ,GACpBpc,EAAEsK,OAAO8R,GACTpc,EAAEuK,eACD,SAAUG,GAAO1K,EAAEqK,QAAQK,KACvByL,IAGFgX,GACPjN,IAOElR,GAAwBkQ,GAAW2B,YAAc,SAAUuM,GAC7D,MAAO,IAAID,IAAsBC,GAanCzP,IAAgB0P,UAAY,SAAUC,GAEpC,GADAA,IAAgBA,EAAcvb,GAAGE,OAAOC,UACnCob,EAAe,KAAM,IAAIja,IAAkB,qDAChD,IAAIpT,GAASd,IACb,OAAO,IAAImuB,GAAY,SAAUC,EAASC,GAExC,GAAIrpB,GAAOoF,GAAW,CACtBtJ,GAAOyI,UAAU,SAAUyZ,GACzBhe,EAAQge,EACR5Y,GAAW,GACVikB,EAAQ,WACTjkB,GAAYgkB,EAAQppB,QAU1B+a,GAAWuO,WAAa,SAAUC,GAChC,GAAIN,EACJ,KACEA,EAAUM,IACV,MAAOruB,GACP,MAAOuQ,IAAgBvQ,GAEzB,MAAO2P,IAAsBoe,IAoB/BzP,GAAgBgQ,UAAY,SAAUC,EAA0B5jB,GAC9D,GAAI/J,GAASd,IACb,OAA2C,kBAA7ByuB,GACZ,GAAIxlB,IAAoB,SAAUZ,GAChC,GAAIqmB,GAAc5tB,EAAO0tB,UAAUC,IACnC,OAAO,IAAItiB,IAAoBtB,EAAS6jB,GAAanlB,UAAUlB,GAAWqmB,EAAYC,YACrF7tB,GACH,GAAI8tB,IAAsB9tB,EAAQ2tB,IActCjQ,GAAgBkP,QAAU,SAAU7iB,GAClC,MAAOA,IAAYvE,GAAWuE,GAC5B7K,KAAKwuB,UAAU,WAAc,MAAO,IAAIjM,KAAc1X,GACtD7K,KAAKwuB,UAAU,GAAIjM,MAQvB/D,GAAgBqQ,MAAQ,WACtB,MAAO7uB,MAAK0tB,UAAUC,YAcxBnP,GAAgBsQ,YAAc,SAAUjkB,GACtC,MAAOA,IAAYvE,GAAWuE,GAC5B7K,KAAKwuB,UAAU,WAAc,MAAO,IAAI1jB,KAAmBD,GAC3D7K,KAAKwuB,UAAU,GAAI1jB,MAevB0T,GAAgBuQ,aAAe,SAAUC,EAAwBC,GAC/D,MAA4B,KAArBhvB,UAAUR,OACfO,KAAKwuB,UAAU,WACb,MAAO,IAAIU,IAAgBD,IAC1BD,GACHhvB,KAAKwuB,UAAU,GAAIU,IAAgBF,KASvCxQ,GAAgB2Q,WAAa,SAAUF,GACrC,MAAOjvB,MAAK+uB,aAAaE,GAActB,YAmBzCnP,GAAgB4Q,OAAS,SAAUvkB,EAAUwkB,EAAYC,EAAY9mB,GACnE,MAAOqC,IAAYvE,GAAWuE,GAC5B7K,KAAKwuB,UAAU,WAAc,MAAO,IAAIe,IAAcF,EAAYC,EAAY9mB,IAAeqC,GAC7F7K,KAAKwuB,UAAU,GAAIe,IAAcF,EAAYC,EAAY9mB,KAkB7DgW,GAAgBgR,YAAc,SAAUH,EAAYC,EAAY9mB,GAC9D,MAAOxI,MAAKovB,OAAO,KAAMC,EAAYC,EAAY9mB,GAAWmlB,WAG9D,IAAIiB,IAAwBhc,GAAGgc,sBAAyB,SAAUnP,GAGhE,QAASmP,GAAsB9tB,EAAQyQ,GACrC,GACEnI,GADEqmB,GAAkB,EAEpBC,EAAmB5uB,EAAO+I,cAE5B7J,MAAK2uB,QAAU,WAOb,MANKc,KACHA,GAAkB,EAClBrmB,EAAe,GAAI+C,IAAoBujB,EAAiBnmB,UAAUgI,GAAUwF,GAAiB,WAC3F0Y,GAAkB,MAGfrmB,GAGTqW,EAAUtc,KAAKnD,KAAM,SAAUa,GAAK,MAAO0Q,GAAQhI,UAAU1I,KAgB/D,MAjCA6U,IAASkZ,EAAuBnP,GAoBhCmP,EAAsB5qB,UAAU2pB,SAAW,WACzC,GAAIgC,GAAyBjpB,EAAQ,EAAG5F,EAASd,IACjD,OAAO,IAAIiJ,IAAoB,SAAUZ,GACrC,GAAIunB,GAA4B,MAAVlpB,EACpB0C,EAAetI,EAAOyI,UAAUlB,EAElC,OADAunB,KAAkBD,EAA0B7uB,EAAO6tB,WAC5C,WACLvlB,EAAa+F,UACD,MAAVzI,GAAeipB,EAAwBxgB,cAK1Cyf,GACP7O,IA2DE8P,GAAqB9P,GAAW+P,SAAW,SAAUljB,EAAQpE,GAC/D,MAAO4E,GAAiCR,EAAQA,EAAQlE,GAAYF,GAAaA,EAAY6G,IAUzE0Q,IAAWjP,MAAQ,SAAUrE,EAASsjB,EAAmBvnB,GAC7E,GAAIoE,EAOJ,OANAlE,IAAYF,KAAeA,EAAY6G,IACd,MAArB0gB,GAA0D,gBAAtBA,GACtCnjB,EAASmjB,EACArnB,GAAYqnB,KACrBvnB,EAAYunB,GAEVtjB,YAAmB2E,OAAQxE,IAAWvN,EACjCmN,EAAoBC,EAAQujB,UAAWxnB,GAE5CiE,YAAmB2E,OAAQxE,IAAWvN,EACjCsN,EAA6BF,EAAQujB,UAAWD,EAAmBvnB,GAErEoE,IAAWvN,EAChB6N,EAAwBT,EAASjE,GACjC4E,EAAiCX,EAASG,EAAQpE,GAwItDgW,IAAgB1P,MAAQ,WACtB,GAA4B,gBAAjB7O,WAAU,IAAmBA,UAAU,YAAcmR,MAAM,CACpE,GAAI3E,GAAUxM,UAAU,GAAIuI,EAAYvI,UAAU,EAElD,OADAyI,IAAYF,KAAeA,EAAY6G,IAChC5C,YAAmB2E,MACxB5C,EAAwBxO,KAAMyM,EAASjE,GACvC+E,EAAwBvN,KAAMyM,EAASjE,GACpC,GAAIlC,GAAWrG,UAAU,IAC9B,MAAOwO,GAAkBzO,KAAMC,UAAU,GAAIA,UAAU,GAEvD,MAAM,IAAImC,OAAM,sBAqFpBoc,GAAgBpP,SAAW,WACzB,GAAI9I,GAAYrG,UAAU,IACxB,MAAOwP,GAAqBzP,KAAMC,UAAU,GACvC,IAA4B,gBAAjBA,WAAU,GAC1B,MAAOmP,GAASpP,KAAMC,UAAU,GAAIA,UAAU,GAE9C,MAAM,IAAImC,OAAM,sBAcpBoc,GAAgB1Q,UAAY,SAAUtF,GAEpC,MADAE,IAAYF,KAAeA,EAAY6G,IAChCrP,KAAKwhB,IAAI,SAAUjX,GACxB,OAASvF,MAAOuF,EAAGuD,UAAWtF,EAAUyE,UAgD5CuR,GAAgByR,OAASzR,GAAgB0R,eAAiB,SAAUC,EAAmB3nB,GAErF,MADAE,IAAYF,KAAeA,EAAY6G,IACH,gBAAtB8gB,GACZpgB,EAAiB/P,KAAM6vB,GAAmBM,EAAmB3nB,IAC7DuH,EAAiB/P,KAAMmwB,GAG3B,IAAIzf,IAAekC,GAAGlC,aAAe,SAASmD,GAC5C7T,KAAK6T,QAAUA,GAAW,uBAC1B7T,KAAK8T,KAAO,eACZ1R,MAAMe,KAAKnD,MAEb0Q,IAAa1M,UAAYoC,OAAO2N,OAAO3R,MAAM4B,WA4G7Cwa,GAAgB5N,QAAU,WACxB,GAAIwf,GAAWnwB,UAAU,EACzB,IAAImwB,YAAoBhf,OAA4B,gBAAbgf,GACrC,MAAOxf,GAAQ5Q,KAAMowB,EAAUnwB,UAAU,GAAIA,UAAU,GAClD,IAAI8f,GAAWI,aAAaiQ,IAAa9pB,GAAW8pB,GACzD,MAAOhgB,GAAoBpQ,KAAMowB,EAAUnwB,UAAU,GAAIA,UAAU,GAEnE,MAAM,IAAImC,OAAM,sBAUpBoc,GAAgB7O,SAAW,SAAU0gB,EAAgB7nB,GACnDE,GAAYF,KAAeA,EAAY6G,GACvC,IAAIihB,IAAYD,GAAkB,CAClC,IAAgB,GAAZC,EAAiB,KAAM,IAAIC,YAAW,+CAC1C,IAAIzvB,GAASd,IACb,OAAO,IAAIiJ,IAAoB,SAAUpI,GACvC,GAAI2vB,GAAa,CACjB,OAAO1vB,GAAOyI,UACZ,SAAUgB,GACR,GAAI0C,GAAMzE,EAAUyE,OACD,IAAfujB,GAAoBvjB,EAAMujB,GAAcF,KAC1CE,EAAavjB,EACbpM,EAAEsK,OAAOZ,KAEX,SAAUrK,GAAKW,EAAEqK,QAAQhL,IAAO,WAAcW,EAAEuK,iBAEnDtK,GAGL,IAAI2vB,IAAsB,SAAUhR,GAIlC,QAASlW,GAAUlB,GACjB,GAAIqoB,GAAO1wB,KAAKc,OAAO4sB,UACrBtkB,EAAesnB,EAAKnnB,UAAUlB,GAC9BsoB,EAAa3Z,GAEX4Z,EAAW5wB,KAAK6wB,OAAO/G,uBAAuBvgB,UAAU,SAAUrE,GAChEA,EACFyrB,EAAaD,EAAK/B,WAElBgC,EAAWxhB,UACXwhB,EAAa3Z,KAIjB,OAAO,IAAI7K,IAAoB/C,EAAcunB,EAAYC,GAG3D,QAASH,GAAmB3vB,EAAQ+vB,GAClC7wB,KAAKc,OAASA,EACdd,KAAK8wB,WAAa,GAAIvO,IAElBsO,GAAUA,EAAOtnB,UACnBvJ,KAAK6wB,OAAS7wB,KAAK8wB,WAAW9J,MAAM6J,GAEpC7wB,KAAK6wB,OAAS7wB,KAAK8wB,WAGrBrR,EAAUtc,KAAKnD,KAAMuJ,EAAWzI,GAWlC,MAxCA4U,IAAS+a,EAAoBhR,GAgC7BgR,EAAmBzsB,UAAU+sB,MAAQ,WACnC/wB,KAAK8wB,WAAW3lB,QAAO,IAGzBslB,EAAmBzsB,UAAUgtB,OAAS,WACpChxB,KAAK8wB,WAAW3lB,QAAO,IAGlBslB,GAEP1Q,GAUFvB,IAAgBoS,SAAW,SAAUC,GACnC,MAAO,IAAIJ,IAAmBzwB,KAAM6wB,GAoDtC,IAAII,IAA8B,SAAUxR,GAI1C,QAASlW,GAAU1I,GAGjB,QAASqwB,KAAe,KAAOvjB,EAAElO,OAAS,GAAKoB,EAAEsK,OAAOwC,EAAEU,SAF1D,GAAY8iB,GAARxjB,KAIAvE,EACFkI,GACEtR,KAAKc,OACLd,KAAK6wB,OAAOzF,WAAU,GAAOtB,uBAC7B,SAAU7M,EAAMmU,GACd,OAASnU,KAAMA,EAAMmU,WAAYA,KAElC7nB,UACC,SAAUyB;AACJmmB,IAAuB9xB,GAAa2L,EAAQomB,YAAcD,GAC5DA,EAAqBnmB,EAAQomB,WAEzBpmB,EAAQomB,YAAcF,MAE1BC,EAAqBnmB,EAAQomB,WAEzBpmB,EAAQomB,WACVvwB,EAAEsK,OAAOH,EAAQiS,MAEjBtP,EAAEjM,KAAKsJ,EAAQiS,QAIrB,SAAU1R,GACR2lB,IACArwB,EAAEqK,QAAQK,IAEZ,WACE2lB,IACArwB,EAAEuK,eAGV,OAAOhC,GAGT,QAAS6nB,GAA2BnwB,EAAQ+vB,GAC1C7wB,KAAKc,OAASA,EACdd,KAAK8wB,WAAa,GAAIvO,IAElBsO,GAAUA,EAAOtnB,UACnBvJ,KAAK6wB,OAAS7wB,KAAK8wB,WAAW9J,MAAM6J,GAEpC7wB,KAAK6wB,OAAS7wB,KAAK8wB,WAGrBrR,EAAUtc,KAAKnD,KAAMuJ,EAAWzI,GAWlC,MA/DA4U,IAASub,EAA4BxR,GAuDrCwR,EAA2BjtB,UAAU+sB,MAAQ,WAC3C/wB,KAAK8wB,WAAW3lB,QAAO,IAGzB8lB,EAA2BjtB,UAAUgtB,OAAS,WAC5ChxB,KAAK8wB,WAAW3lB,QAAO,IAGlB8lB,GAEPlR,GAWFvB,IAAgB6S,iBAAmB,SAAU9f,GAC3C,MAAO,IAAI0f,IAA2BjxB,KAAMuR,GAGhD,IAAI+f,IAAwB,SAAU7R,GAIpC,QAASlW,GAAWlB,GAClB,MAAOrI,MAAKc,OAAOyI,UAAUlB,GAG/B,QAASipB,GAAsBxwB,EAAQywB,EAAa/oB,GAClDiX,EAAUtc,KAAKnD,KAAMuJ,EAAWzI,GAChCd,KAAKuR,QAAU,GAAIigB,IAAkBD,EAAa/oB,GAClDxI,KAAKc,OAASA,EAAO0tB,UAAUxuB,KAAKuR,SAASoc,WAO/C,MAhBAjY,IAAS4b,EAAsB7R,GAY/B6R,EAAqBttB,UAAUytB,QAAU,SAAUC,GACjD,MAAO1xB,MAAKuR,QAAQkgB,QAAyB,MAAjBC,EAAwB,GAAKA,IAGpDJ,GAEPvR,IAEEyR,GAAqB,SAAU/R,GAEjC,QAASlW,GAAWlB,GAClB,MAAOrI,MAAKuR,QAAQhI,UAAUlB,GAKhC,QAASmpB,GAAkBD,EAAa/oB,GACvB,MAAf+oB,IAAwBA,GAAc,GAEtC9R,EAAUtc,KAAKnD,KAAMuJ,GACrBvJ,KAAKuR,QAAU,GAAIgR,IACnBviB,KAAKuxB,YAAcA,EACnBvxB,KAAK8a,MAAQyW,KAAmB,KAChCvxB,KAAK2xB,eAAiB,EACtB3xB,KAAK4xB,oBAAsB,KAC3B5xB,KAAKM,MAAQ,KACbN,KAAK6xB,WAAY,EACjB7xB,KAAK8xB,cAAe,EACpB9xB,KAAKwI,UAAYA,GAAaG,GA6EhC,MA3FA+M,IAAS8b,EAAmB/R,GAiB5B5J,GAAc2b,EAAkBxtB,UAAWqb,IACzCjU,YAAa,WACXpL,KAAK8xB,cAAe,EACf9xB,KAAKuxB,aAAqC,IAAtBvxB,KAAK8a,MAAMrb,OAIlCO,KAAK8a,MAAMpZ,KAAK+c,GAAaW,sBAH7Bpf,KAAKuR,QAAQnG,cACbpL,KAAK+xB,0BAKT7mB,QAAS,SAAU5K,GACjBN,KAAK6xB,WAAY,EACjB7xB,KAAKM,MAAQA,EACRN,KAAKuxB,aAAqC,IAAtBvxB,KAAK8a,MAAMrb,OAIlCO,KAAK8a,MAAMpZ,KAAK+c,GAAaS,cAAc5e,KAH3CN,KAAKuR,QAAQrG,QAAQ5K,GACrBN,KAAK+xB,0BAKT5mB,OAAQ,SAAUnG,GACZhF,KAAK2xB,gBAAkB,EACzB3xB,KAAKuxB,aAAevxB,KAAK8a,MAAMpZ,KAAK+c,GAAaO,aAAaha,KAEnC,IAA1BhF,KAAK2xB,kBAA2B3xB,KAAK+xB,wBACtC/xB,KAAKuR,QAAQpG,OAAOnG,KAGxBgtB,gBAAiB,SAAUN,GACzB,GAAI1xB,KAAKuxB,YACP,KAAOvxB,KAAK8a,MAAMrb,OAAS,IAAMiyB,EAAgB,GAA4B,MAAvB1xB,KAAK8a,MAAM,GAAG7M,OAAe,CACjF,GAAIob,GAAQrpB,KAAK8a,MAAMzM,OACvBgb,GAAM/a,OAAOtO,KAAKuR,SACC,MAAf8X,EAAMpb,KACRyjB,KAEA1xB,KAAK+xB,wBACL/xB,KAAK8a,UAKX,MAAO4W,IAETD,QAAS,SAAU3pB,GACjB9H,KAAK+xB,uBACL,IAAI/kB,GAAOhN,IAkBX,OAhBAA,MAAK4xB,oBAAsB5xB,KAAKwI,UAAUmQ,kBAAkB7Q,EAC5D,SAASjB,EAAGjH,GACV,GAAI2sB,GAAYvf,EAAKglB,gBAAgBpyB,GACjC8oB,EAAU1b,EAAK8kB,cAAgB9kB,EAAK6kB,SACxC,QAAKnJ,GAAW6D,EAAY,GAC1Bvf,EAAK2kB,eAAiBpF,EAEfxV,GAAiB,WACtB/J,EAAK2kB,eAAiB,KAJ1B,SAYK3xB,KAAK4xB,qBAEdG,sBAAuB,WACjB/xB,KAAK4xB,sBACP5xB,KAAK4xB,oBAAoBziB,UACzBnP,KAAK4xB,oBAAsB,SAK1BJ,GACPzR,GAWFvB,IAAgByT,WAAa,SAAUV,EAAa/oB,GAQlD,MANI+oB,IAAe7oB,GAAY6oB,KAC3B/oB,EAAY+oB,EACZA,GAAc,GAGC,MAAfA,IAAwBA,GAAc,GACnC,GAAID,IAAqBtxB,KAAMuxB,EAAa/oB,IAQnDgW,GAAgB0T,KAAO,SAAUC,GAG/B,QAASC,KACPtxB,EAAOkwB,SAHT,GAAIlwB,GAASd,KAAKqxB,kBAuBlB,OAjBAc,GAAK/E,YAAY,QAASgF,GAE1BtxB,EAAOyI,UACL,SAAUgB,IACP4nB,EAAKE,MAAMvsB,OAAOyE,KAAOzJ,EAAOiwB,SAEnC,SAAUxlB,GACR4mB,EAAKG,KAAK,QAAS/mB,IAErB,YAEG4mB,EAAKI,UAAYJ,EAAKK,MACvBL,EAAK5E,eAAe,QAAS6E,KAGjCtxB,EAAOkwB,SAEAmB,GAQT3T,GAAgBiU,UAAY,SAASC,GAGnC,QAASC,GAAqB9xB,GAC5B,OACE+xB,oBAAqB,WACnB,MAAO/xB,IAETgyB,oBAAqB,SAASC,EAAKC,GACjC,MAAOD,GAAI3nB,OAAO4nB,IAEpBC,sBAAuB,SAASF,GAC9B,MAAOA,GAAI1nB,gBAXjB,GAAItK,GAASd,IAgBb,OAAO,IAAIiJ,IAAoB,SAASpI,GACtC,GAAIoyB,GAAQP,EAAWC,EAAqB9xB,GAC5C,OAAOC,GAAOyI,UACZ,SAASyZ,GACP,GAAIhS,GAAM/F,GAASgoB,EAAM,sBAAsB9vB,KAAK8vB,EAAOpyB,EAAGmiB,EAC1DhS,KAAQ7Q,IAAYU,EAAEqK,QAAQ8F,EAAI9Q,IAExC,SAAUA,GAAKW,EAAEqK,QAAQhL,IACzB,WAAa+yB,EAAM,uBAAuBpyB,MAE3CC,GAGL,IAAImI,IAAsB2J,GAAG3J,oBAAuB,SAAUwW,GAI5D,QAASuB,GAAcC,GACrB,MAAOA,IAAc3a,GAAW2a,EAAW9R,SAAW8R,EACpD3a,GAAW2a,GAAclK,GAAiBkK,GAAcjK,GAG5D,QAAS1N,GAAczC,EAAG+Q,GACxB,GAAIsJ,GAAMtJ,EAAM,GAAI5K,EAAO4K,EAAM,GAC7BuJ,EAAMlW,GAAS+B,EAAKkmB,aAAa/vB,KAAK6J,EAAMkU,EAEhD,OAAIC,KAAQhhB,IACN+gB,EAAIvB,KAAKxf,GAASD,OAExBghB,GAAI5X,cAAc0X,EAAcG,IAFK/gB,EAAQD,GAASD,GAKxD,QAASizB,GAAe9qB,GACtB,GAAI6Y,GAAM,GAAIG,IAAmBhZ,GAAWuP,GAASsJ,EAAKlhB,KAO1D,OALI2I,IAAuBsS,mBACzBtS,GAAuBgQ,kBAAkBf,EAAOtO,GAEhDA,EAAc,KAAMsO,GAEfsJ,EAGT,QAASjY,GAAoBM,EAAWjB,GACtCtI,KAAKc,OAASwH,EACdtI,KAAKkzB,YAAc3pB,EACnBkW,EAAUtc,KAAKnD,KAAMmzB,GAGvB,MAnCAzd,IAASzM,EAAqBwW,GAmCvBxW,GAEP8W,IAEEsB,GAAsB,SAAU5B,GAGlC,QAAS4B,GAAmBhZ,GAC1BoX,EAAUtc,KAAKnD,MACfA,KAAKqI,SAAWA,EAChBrI,KAAKgoB,EAAI,GAAI7e,IALfuM,GAAS2L,EAAoB5B,EAQ7B,IAAI2T,GAA8B/R,EAAmBrd,SA8BrD,OA5BAovB,GAA4B3hB,KAAO,SAAUzM,GAC3C,GAAInC,GAASoI,GAASjL,KAAKqI,SAAS8C,QAAQhI,KAAKnD,KAAKqI,SAAUrD,EAC5DnC,KAAW1C,KACbH,KAAKmP,UACL/O,EAAQyC,EAAO3C,KAInBkzB,EAA4B9yB,MAAQ,SAAUiL,GAC5C,GAAI1I,GAASoI,GAASjL,KAAKqI,SAAS6C,SAAS/H,KAAKnD,KAAKqI,SAAUkD,EACjEvL,MAAKmP,UACLtM,IAAW1C,IAAYC,EAAQyC,EAAO3C,IAGxCkzB,EAA4B1T,UAAY,WACtC,GAAI7c,GAASoI,GAASjL,KAAKqI,SAAS+C,aAAajI,KAAKnD,KAAKqI,SAC3DrI,MAAKmP,UACLtM,IAAW1C,IAAYC,EAAQyC,EAAO3C,IAGxCkzB,EAA4B9pB,cAAgB,SAAUtE,GAAShF,KAAKgoB,EAAE1e,cAActE,IACpFouB,EAA4B9c,cAAgB,WAAc,MAAOtW,MAAKgoB,EAAE1R,iBAExE8c,EAA4BjkB,QAAU,WACpCsQ,EAAUzb,UAAUmL,QAAQhM,KAAKnD,MACjCA,KAAKgoB,EAAE7Y,WAGFkS,GACP7B,IAEE6T,GAAoB,SAAU9hB,EAASlJ,GACzCrI,KAAKuR,QAAUA,EACfvR,KAAKqI,SAAWA,EAGlBgrB,IAAkBrvB,UAAUmL,QAAU,WACpC,IAAKnP,KAAKuR,QAAQzF,YAAgC,OAAlB9L,KAAKqI,SAAmB,CACtD,GAAI2N,GAAMhW,KAAKuR,QAAQ+hB,UAAU5yB,QAAQV,KAAKqI,SAC9CrI,MAAKuR,QAAQ+hB,UAAU3c,OAAOX,EAAK,GACnChW,KAAKqI,SAAW,MAQpB,IAAIka,IAAU3P,GAAG2P,QAAW,SAAU9C,GACpC,QAASlW,GAAUlB,GAEjB,MADA6O,IAAclX,MACTA,KAAKqK,UAINrK,KAAKuzB,UACPlrB,EAAS6C,QAAQlL,KAAKM,OACf0W,KAET3O,EAAS+C,cACF4L,KARLhX,KAAKszB,UAAU5xB,KAAK2G,GACb,GAAIgrB,IAAkBrzB,KAAMqI,IAevC,QAASka,KACP9C,EAAUtc,KAAKnD,KAAMuJ,GACrBvJ,KAAK8L,YAAa,EAClB9L,KAAKqK,WAAY,EACjBrK,KAAKszB,aACLtzB,KAAKuzB,UAAW,EAuElB,MAjFA7d,IAAS6M,EAAS9C,GAalB5J,GAAc0M,EAAQve,UAAWqb,GAASrb,WAKxCwvB,aAAc,WAAc,MAAOxzB,MAAKszB,UAAU7zB,OAAS,GAI3D2L,YAAa,WAEX,GADA8L,GAAclX,OACTA,KAAKqK,UAAW,CACnBrK,KAAKqK,WAAY,CACjB,KAAK,GAAIzK,GAAI,EAAG6zB,EAAKn0B,EAAWU,KAAKszB,WAAY9zB,EAAMi0B,EAAGh0B,OAAYD,EAAJI,EAASA,IACzE6zB,EAAG7zB,GAAGwL,aAGRpL,MAAKszB,UAAU7zB,OAAS,IAO5ByL,QAAS,SAAU5K,GAEjB,GADA4W,GAAclX,OACTA,KAAKqK,UAAW,CACnBrK,KAAKqK,WAAY,EACjBrK,KAAKM,MAAQA,EACbN,KAAKuzB,UAAW,CAChB,KAAK,GAAI3zB,GAAI,EAAG6zB,EAAKn0B,EAAWU,KAAKszB,WAAY9zB,EAAMi0B,EAAGh0B,OAAYD,EAAJI,EAASA,IACzE6zB,EAAG7zB,GAAGsL,QAAQ5K,EAGhBN,MAAKszB,UAAU7zB,OAAS,IAO5B0L,OAAQ,SAAUnG,GAEhB,GADAkS,GAAclX,OACTA,KAAKqK,UACR,IAAK,GAAIzK,GAAI,EAAG6zB,EAAKn0B,EAAWU,KAAKszB,WAAY9zB,EAAMi0B,EAAGh0B,OAAYD,EAAJI,EAASA,IACzE6zB,EAAG7zB,GAAGuL,OAAOnG,IAOnBmK,QAAS,WACPnP,KAAK8L,YAAa,EAClB9L,KAAKszB,UAAY,QAUrB/Q,EAAQxO,OAAS,SAAU1L,EAAU9H,GACnC,MAAO,IAAImzB,IAAiBrrB,EAAU9H,IAGjCgiB,GACPxC,IAMEjV,GAAe8H,GAAG9H,aAAgB,SAAU2U,GAE9C,QAASlW,GAAUlB,GAGjB,MAFA6O,IAAclX,MAETA,KAAKqK,WAKNrK,KAAKuzB,SACPlrB,EAAS6C,QAAQlL,KAAKM,OACbN,KAAKoK,UACd/B,EAAS8C,OAAOnL,KAAKgF,OACrBqD,EAAS+C,eAET/C,EAAS+C,cAGJ4L,KAbLhX,KAAKszB,UAAU5xB,KAAK2G,GACb,GAAIgrB,IAAkBrzB,KAAMqI,IAqBvC,QAASyC,KACP2U,EAAUtc,KAAKnD,KAAMuJ,GAErBvJ,KAAK8L,YAAa,EAClB9L,KAAKqK,WAAY,EACjBrK,KAAKoK,UAAW,EAChBpK,KAAKszB,aACLtzB,KAAKuzB,UAAW,EA4ElB,MAzFA7d,IAAS5K,EAAc2U,GAgBvB5J,GAAc/K,EAAa9G,UAAWqb,IAKpCmU,aAAc,WAEZ,MADAtc,IAAclX,MACPA,KAAKszB,UAAU7zB,OAAS,GAKjC2L,YAAa,WACX,GAAIxL,GAAGJ,CAEP,IADA0X,GAAclX,OACTA,KAAKqK,UAAW,CACnBrK,KAAKqK,WAAY,CACjB,IAAIopB,GAAKn0B,EAAWU,KAAKszB,WAAY9zB,EAAMi0B,EAAGh0B,MAE9C,IAAIO,KAAKoK,SACP,IAAKxK,EAAI,EAAOJ,EAAJI,EAASA,IAAK,CACxB,GAAIiB,GAAI4yB,EAAG7zB,EACXiB,GAAEsK,OAAOnL,KAAKgF,OACdnE,EAAEuK,kBAGJ,KAAKxL,EAAI,EAAOJ,EAAJI,EAASA,IACnB6zB,EAAG7zB,GAAGwL,aAIVpL,MAAKszB,UAAU7zB,OAAS,IAO5ByL,QAAS,SAAU5K,GAEjB,GADA4W,GAAclX,OACTA,KAAKqK,UAAW,CACnBrK,KAAKqK,WAAY,EACjBrK,KAAKuzB,UAAW,EAChBvzB,KAAKM,MAAQA,CAEb,KAAK,GAAIV,GAAI,EAAG6zB,EAAKn0B,EAAWU,KAAKszB,WAAY9zB,EAAMi0B,EAAGh0B,OAAYD,EAAJI,EAASA,IACzE6zB,EAAG7zB,GAAGsL,QAAQ5K,EAGhBN,MAAKszB,UAAU7zB,OAAS,IAO5B0L,OAAQ,SAAUnG,GAChBkS,GAAclX,MACVA,KAAKqK,YACTrK,KAAKgF,MAAQA,EACbhF,KAAKoK,UAAW,IAKlB+E,QAAS,WACPnP,KAAK8L,YAAa,EAClB9L,KAAKszB,UAAY,KACjBtzB,KAAK0N,UAAY,KACjB1N,KAAKgF,MAAQ,QAIV8F,GACPiV,IAEE2T,GAAmB9gB,GAAG8gB,iBAAoB,SAAUjU,GAGtD,QAASlW,GAAUlB,GACjB,MAAOrI,MAAKO,WAAWgJ,UAAUlB,GAGnC,QAASqrB,GAAiBrrB,EAAU9H,GAClCP,KAAKqI,SAAWA,EAChBrI,KAAKO,WAAaA,EAClBkf,EAAUtc,KAAKnD,KAAMuJ,GAevB,MAxBAmM,IAASge,EAAkBjU,GAY3B5J,GAAc6d,EAAiB1vB,UAAWqb,GAASrb,WACjDoH,YAAa,WACXpL,KAAKqI,SAAS+C,eAEhBF,QAAS,SAAU5K,GACjBN,KAAKqI,SAAS6C,QAAQ5K,IAExB6K,OAAQ,SAAUnG,GAChBhF,KAAKqI,SAAS8C,OAAOnG,MAIlB0uB,GACP3T,IAMEmP,GAAkBtc,GAAGsc,gBAAmB,SAAUzP,GACpD,QAASlW,GAAUlB,GAEjB,MADA6O,IAAclX,MACTA,KAAKqK,WAKNrK,KAAKuzB,SACPlrB,EAAS6C,QAAQlL,KAAKM,OAEtB+H,EAAS+C,cAEJ4L,KATLhX,KAAKszB,UAAU5xB,KAAK2G,GACpBA,EAAS8C,OAAOnL,KAAKgF,OACd,GAAIquB,IAAkBrzB,KAAMqI,IAgBvC,QAAS6mB,GAAgBlqB,GACvBya,EAAUtc,KAAKnD,KAAMuJ,GACrBvJ,KAAKgF,MAAQA,EACbhF,KAAKszB,aACLtzB,KAAK8L,YAAa,EAClB9L,KAAKqK,WAAY,EACjBrK,KAAKuzB,UAAW,EA4ElB,MAxFA7d,IAASwZ,EAAiBzP,GAe1B5J,GAAcqZ,EAAgBlrB,UAAWqb,IAQvCsU,SAAU,WAEN,GADAzc,GAAclX,MACVA,KAAKuzB,SACL,KAAMvzB,MAAKM,KAEf,OAAON,MAAKgF,OAMhBwuB,aAAc,WAAc,MAAOxzB,MAAKszB,UAAU7zB,OAAS,GAI3D2L,YAAa,WAEX,GADA8L,GAAclX,OACVA,KAAKqK,UAAT,CACArK,KAAKqK,WAAY,CACjB,KAAK,GAAIzK,GAAI,EAAG6zB,EAAKn0B,EAAWU,KAAKszB,WAAY9zB,EAAMi0B,EAAGh0B,OAAYD,EAAJI,EAASA,IACzE6zB,EAAG7zB,GAAGwL,aAGRpL,MAAKszB,UAAU7zB,OAAS,IAM1ByL,QAAS,SAAU5K,GAEjB,GADA4W,GAAclX,OACVA,KAAKqK,UAAT,CACArK,KAAKqK,WAAY,EACjBrK,KAAKuzB,UAAW,EAChBvzB,KAAKM,MAAQA,CAEb,KAAK,GAAIV,GAAI,EAAG6zB,EAAKn0B,EAAWU,KAAKszB,WAAY9zB,EAAMi0B,EAAGh0B,OAAYD,EAAJI,EAASA,IACzE6zB,EAAG7zB,GAAGsL,QAAQ5K,EAGhBN,MAAKszB,UAAU7zB,OAAS,IAM1B0L,OAAQ,SAAUnG,GAEhB,GADAkS,GAAclX,OACVA,KAAKqK,UAAT,CACArK,KAAKgF,MAAQA,CACb,KAAK,GAAIpF,GAAI,EAAG6zB,EAAKn0B,EAAWU,KAAKszB,WAAY9zB,EAAMi0B,EAAGh0B,OAAYD,EAAJI,EAASA,IACzE6zB,EAAG7zB,GAAGuL,OAAOnG,KAMjBmK,QAAS,WACPnP,KAAK8L,YAAa,EAClB9L,KAAKszB,UAAY,KACjBtzB,KAAKgF,MAAQ,KACbhF,KAAK0N,UAAY,QAIdwhB,GACPnP,IAMEwP,GAAgB3c,GAAG2c,cAAiB,SAAU9P,GAIhD,QAASmU,GAA0BriB,EAASlJ,GAC1C,MAAO0O,IAAiB,WACtB1O,EAAS8G,WACRoC,EAAQzF,YAAcyF,EAAQ+hB,UAAU3c,OAAOpF,EAAQ+hB,UAAU5yB,QAAQ2H,GAAW,KAIzF,QAASkB,GAAUlB,GACjB,GAAIwrB,GAAK,GAAIpT,IAAkBzgB,KAAKwI,UAAWH,GAC7Ce,EAAewqB,EAA0B5zB,KAAM6zB,EACjD3c,IAAclX,MACdA,KAAK8zB,MAAM9zB,KAAKwI,UAAUyE,OAC1BjN,KAAKszB,UAAU5xB,KAAKmyB,EAEpB,KAAK,GAAIj0B,GAAI,EAAGJ,EAAMQ,KAAK2N,EAAElO,OAAYD,EAAJI,EAASA,IAC5Ci0B,EAAG1oB,OAAOnL,KAAK2N,EAAE/N,GAAGoF,MAUtB,OAPIhF,MAAKuzB,SACPM,EAAG3oB,QAAQlL,KAAKM,OACPN,KAAKqK,WACdwpB,EAAGzoB,cAGLyoB,EAAGjT,eACIxX,EAWT,QAASmmB,GAAcF,EAAYC,EAAY9mB,GAC7CxI,KAAKqvB,WAA2B,MAAdA,EAAqBlnB,EAAiBknB,EACxDrvB,KAAKsvB,WAA2B,MAAdA,EAAqBnnB,EAAiBmnB,EACxDtvB,KAAKwI,UAAYA,GAAaG,GAC9B3I,KAAK2N,KACL3N,KAAKszB,aACLtzB,KAAKqK,WAAY,EACjBrK,KAAK8L,YAAa,EAClB9L,KAAKuzB,UAAW,EAChBvzB,KAAKM,MAAQ,KACbmf,EAAUtc,KAAKnD,KAAMuJ,GAhDvB,GAAIpB,GAAiBH,KAAK4c,IAAI,EAAG,IAAM,CAgIvC,OAlGAlP,IAAS6Z,EAAe9P,GAqBxB5J,GAAc0Z,EAAcvrB,UAAWqb,GAASrb,WAK9CwvB,aAAc,WACZ,MAAOxzB,MAAKszB,UAAU7zB,OAAS,GAEjCq0B,MAAO,SAAU7mB,GACf,KAAOjN,KAAK2N,EAAElO,OAASO,KAAKqvB,YAC1BrvB,KAAK2N,EAAEU,OAET,MAAOrO,KAAK2N,EAAElO,OAAS,GAAMwN,EAAMjN,KAAK2N,EAAE,GAAGmiB,SAAY9vB,KAAKsvB,YAC5DtvB,KAAK2N,EAAEU,SAOXlD,OAAQ,SAAUnG,GAEhB,GADAkS,GAAclX,OACVA,KAAKqK,UAAT,CACA,GAAI4C,GAAMjN,KAAKwI,UAAUyE,KACzBjN,MAAK2N,EAAEjM,MAAOouB,SAAU7iB,EAAKjI,MAAOA,IACpChF,KAAK8zB,MAAM7mB,EAEX,KAAK,GAAIrN,GAAI,EAAG6zB,EAAKn0B,EAAWU,KAAKszB,WAAY9zB,EAAMi0B,EAAGh0B,OAAYD,EAAJI,EAASA,IAAK,CAC9E,GAAIyI,GAAWorB,EAAG7zB,EAClByI,GAAS8C,OAAOnG,GAChBqD,EAASuY,kBAOb1V,QAAS,SAAU5K,GAEjB,GADA4W,GAAclX,OACVA,KAAKqK,UAAT,CACArK,KAAKqK,WAAY,EACjBrK,KAAKM,MAAQA,EACbN,KAAKuzB,UAAW,CAChB,IAAItmB,GAAMjN,KAAKwI,UAAUyE,KACzBjN,MAAK8zB,MAAM7mB,EACX,KAAK,GAAIrN,GAAI,EAAG6zB,EAAKn0B,EAAWU,KAAKszB,WAAY9zB,EAAMi0B,EAAGh0B,OAAYD,EAAJI,EAASA,IAAK,CAC9E,GAAIyI,GAAWorB,EAAG7zB,EAClByI,GAAS6C,QAAQ5K,GACjB+H,EAASuY,eAEX5gB,KAAKszB,UAAU7zB,OAAS,IAK1B2L,YAAa,WAEX,GADA8L,GAAclX,OACVA,KAAKqK,UAAT,CACArK,KAAKqK,WAAY,CACjB,IAAI4C,GAAMjN,KAAKwI,UAAUyE,KACzBjN,MAAK8zB,MAAM7mB,EACX,KAAK,GAAIrN,GAAI,EAAG6zB,EAAKn0B,EAAWU,KAAKszB,WAAY9zB,EAAMi0B,EAAGh0B,OAAYD,EAAJI,EAASA,IAAK,CAC9E,GAAIyI,GAAWorB,EAAG7zB,EAClByI,GAAS+C,cACT/C,EAASuY,eAEX5gB,KAAKszB,UAAU7zB,OAAS,IAK1B0P,QAAS,WACPnP,KAAK8L,YAAa,EAClB9L,KAAKszB,UAAY,QAId/D,GACPxP,GAKFnN,IAAGmhB,OAAU,SAAUtU,GAGrB,QAASsU,KACPtU,EAAUtc,KAAKnD,MAajB,MAhBA0V,IAASqe,EAAQtU,GASjBsU,EAAO/vB,UAAU+sB,MAAQ,WAAc/wB,KAAKmL,QAAO,IAKnD4oB,EAAO/vB,UAAUgtB,OAAS,WAAchxB,KAAKmL,QAAO,IAE7C4oB,GACPxR,IAEmB,kBAAVyR,SAA6C,gBAAdA,QAAOC,KAAmBD,OAAOC,KACzE1sB,GAAKqL,GAAKA,GAEVohB,OAAO,WACL,MAAOphB,OAEAX,IAAeM,GAEpBE,IACDF,GAAWL,QAAUU,IAAIA,GAAKA,GAE/BX,GAAYW,GAAKA,GAInBrL,GAAKqL,GAAKA,EAIZ,IAAI1Q,IAAcC,MAElBgB,KAAKnD"} \ No newline at end of file diff --git a/tools/eslint/node_modules/rx-lite/rx.lite.min.js b/tools/eslint/node_modules/rx-lite/rx.lite.min.js new file mode 100644 index 00000000000000..ed43db29b0e35d --- /dev/null +++ b/tools/eslint/node_modules/rx-lite/rx.lite.min.js @@ -0,0 +1,5 @@ +/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/ +(function(a){function b(a){for(var b=a.length,c=new Array(b),d=0;b>d;d++)c[d]=a[d];return c}function c(a){return function(){try{return a.apply(this,arguments)}catch(b){return sa.e=b,sa}}}function d(a){throw a}function e(a,b){if(ua&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(ya)){for(var c=[],d=b;d;d=d.source)d.stack&&c.unshift(d.stack);c.unshift(a.stack);var e=c.join("\n"+ya+"\n");a.stack=f(e)}}function f(a){for(var b=a.split("\n"),c=[],d=0,e=b.length;e>d;d++){var f=b[d];g(f)||h(f)||!f||c.push(f)}return c.join("\n")}function g(a){var b=j(a);if(!b)return!1;var c=b[0],d=b[1];return c===wa&&d>=xa&&ed>=d}function h(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function i(){if(ua)try{throw new Error}catch(a){var b=a.stack.split("\n"),c=b[0].indexOf("@")>0?b[1]:b[2],d=j(c);if(!d)return;return wa=d[0],d[1]}}function j(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function k(a){var b=[];if(!gb(a))return b;fb.nonEnumArgs&&a.length&&hb(a)&&(a=jb.call(a));var c=fb.enumPrototypes&&"function"==typeof a,d=fb.enumErrorProps&&(a===_a||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(fb.nonEnumShadows&&a!==ab){var f=a.constructor,g=-1,h=Na;if(a===(f&&f.prototype))var i=a===bb?Xa:a===_a?Sa:Ya.call(a),j=eb[i];for(;++g-1:void 0});return c.pop(),d.pop(),q}function p(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function q(a){this._s=a}function r(a){this._s=a,this._l=a.length,this._i=0}function s(a){this._a=a}function t(a){this._a=a,this._l=x(a),this._i=0}function u(a){return"number"==typeof a&&ia.isFinite(a)}function v(b){var c,d=b[Ga];if(!d&&"string"==typeof b)return c=new q(b),c[Ga]();if(!d&&b.length!==a)return c=new s(b),c[Ga]();if(!d)throw new TypeError("Object is not iterable");return b[Ga]()}function w(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function x(a){var b=+a.length;return isNaN(b)?0:0!==b&&u(b)?(b=w(b)*Math.floor(Math.abs(b)),0>=b?0:b>gc?gc:b):b}function y(a,b){this.observer=a,this.parent=b}function z(a,b){return yb(a)||(a=Cb),new ic(b,a)}function A(a,b){this.observer=a,this.parent=b}function B(a,b){this.observer=a,this.parent=b}function C(a,b){return new Yc(function(c){var d=new tb,e=new ub;return e.setDisposable(d),d.setDisposable(a.subscribe(new uc(c,e,b))),e},a)}function D(){return!1}function E(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function D(){return!1}function D(){return!1}function F(){return[]}function E(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function D(){return!1}function F(){return[]}function E(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function G(a){return function(b){return a.subscribe(b)}}function H(a,b){this.o=a,this.accumulator=b.accumulator,this.hasSeed=b.hasSeed,this.seed=b.seed,this.hasAccumulation=!1,this.accumulation=null,this.hasValue=!1,this.isStopped=!1}function I(b,c){return function(d){for(var e=d,f=0;c>f;f++){var g=e[b[f]];if("undefined"==typeof g)return a;e=g}return e}}function J(a,b,c,d){var e=new ad;return d.push(K(e,b,c)),a.apply(b,d),e.asObservable()}function K(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];if(ra(c)){if(e=ta(c).apply(b,e),e===sa)return a.onError(e.e);a.onNext(e)}else e.length<=1?a.onNext(e[0]):a.onNext(e);a.onCompleted()}}function L(a,b,c,d){var e=new ad;return d.push(M(e,b,c)),a.apply(b,d),e.asObservable()}function M(a,b,c){return function(){var d=arguments[0];if(d)return a.onError(d);for(var e=arguments.length,f=[],g=1;e>g;g++)f[g-1]=arguments[g];if(ra(c)){var f=ta(c).apply(b,f);if(f===sa)return a.onError(f.e);a.onNext(f)}else f.length<=1?a.onNext(f[0]):a.onNext(f);a.onCompleted()}}function N(a,b,c){this._e=a,this._n=b,this._fn=c,this._e.addEventListener(this._n,this._fn,!1),this.isDisposed=!1}function O(a,b,c){var d=new mb,e=Object.prototype.toString.call(a);if("[object NodeList]"===e||"[object HTMLCollection]"===e)for(var f=0,g=a.length;g>f;f++)d.add(O(a.item(f),b,c));else a&&d.add(new N(a,b,c));return d}function P(a,b){return function(){var c=arguments[0];return ra(b)&&(c=ta(b).apply(null,arguments),c===sa)?a.onError(c.e):void a.onNext(c)}}function Q(a,b){return new Yc(function(c){return b.scheduleWithAbsolute(a,function(){c.onNext(0),c.onCompleted()})})}function R(a,b,c){return new Yc(function(d){var e=a,f=xb(b);return c.scheduleRecursiveWithAbsoluteAndState(0,e,function(a,b){if(f>0){var g=c.now();e+=f,g>=e&&(e=g+f)}d.onNext(a),b(a+1,e)})})}function S(a,b){return new Yc(function(c){return b.scheduleWithRelative(xb(a),function(){c.onNext(0),c.onCompleted()})})}function T(a,b,c){return a===b?new Yc(function(a){return c.schedulePeriodicWithState(0,b,function(b){return a.onNext(b),b+1})}):ac(function(){return R(c.now()+a,b,c)})}function U(a,b,c){return new Yc(function(d){var e,f=!1,g=new ub,h=null,i=[],j=!1;return e=a.materialize().timestamp(c).subscribe(function(a){var e,k;"E"===a.value.kind?(i=[],i.push(a),h=a.value.exception,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new tb,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveWithRelative(b,function(a){var b,e,g,k;if(null===h){j=!0;do g=null,i.length>0&&i[0].timestamp-c.now()<=0&&(g=i.shift().value),null!==g&&g.accept(d);while(null!==g);k=!1,e=0,i.length>0?(k=!0,e=Math.max(0,i[0].timestamp-c.now())):f=!1,b=h,j=!1,null!==b?d.onError(b):k&&a(e)}}))))}),new mb(e,g)},a)}function V(a,b,c){return ac(function(){return U(a,b-c.now(),c)})}function W(a,b,c){var d,e;return ra(b)?e=b:(d=b,e=c),new Yc(function(b){function c(){i.setDisposable(a.subscribe(function(a){var c=ta(e)(a);if(c===sa)return b.onError(c.e);var d=new tb;g.add(d),d.setDisposable(c.subscribe(function(){b.onNext(a),g.remove(d),f()},function(a){b.onError(a)},function(){b.onNext(a),g.remove(d),f()}))},function(a){b.onError(a)},function(){h=!0,i.dispose(),f()}))}function f(){h&&0===g.length&&b.onCompleted()}var g=new mb,h=!1,i=new ub;return d?i.setDisposable(d.subscribe(c,function(a){b.onError(a)},c)):c(),new mb(i,g)},this)}function X(a,b,c){return yb(c)||(c=Hb),new Yc(function(d){var e,f=new ub,g=!1,h=0,i=a.subscribe(function(a){g=!0,e=a,h++;var i=h,j=new tb;f.setDisposable(j),j.setDisposable(c.scheduleWithRelative(b,function(){g&&h===i&&d.onNext(e),g=!1}))},function(a){f.dispose(),d.onError(a),g=!1,h++},function(){f.dispose(),g&&d.onNext(e),d.onCompleted(),g=!1,h++});return new mb(i,f)},this)}function Y(a,b){return new Yc(function(c){var d,e=!1,f=new ub,g=0,h=a.subscribe(function(a){var h=ta(b)(a);if(h===sa)return c.onError(h.e);qa(h)&&(h=Qc(h)),e=!0,d=a,g++;var i=g,j=new tb;f.setDisposable(j),j.setDisposable(h.subscribe(function(){e&&g===i&&c.onNext(d),e=!1,j.dispose()},function(a){c.onError(a)},function(){e&&g===i&&c.onNext(d),e=!1,j.dispose()}))},function(a){f.dispose(),c.onError(a),e=!1,g++},function(){f.dispose(),e&&c.onNext(d),c.onCompleted(),e=!1,g++});return new mb(h,f)},a)}function Z(a,b){return new Yc(function(c){function d(){g&&(g=!1,c.onNext(e)),f&&c.onCompleted()}var e,f=!1,g=!1,h=new tb;return h.setDisposable(a.subscribe(function(a){g=!0,e=a},function(a){c.onError(a)},function(){f=!0,h.dispose()})),new mb(h,b.subscribe(d,function(a){c.onError(a)},d))},a)}function $(a,b,c,d){return ra(b)&&(d=c,c=b,b=mc()),d||(d=tc(new Tc)),new Yc(function(e){function f(a){var b=k,c=new tb;i.setDisposable(c),c.setDisposable(a.subscribe(function(){k===b&&h.setDisposable(d.subscribe(e)),c.dispose()},function(a){k===b&&e.onError(a)},function(){k===b&&h.setDisposable(d.subscribe(e))}))}function g(){var a=!l;return a&&k++,a}var h=new ub,i=new ub,j=new tb;h.setDisposable(j);var k=0,l=!1;return f(b),j.setDisposable(a.subscribe(function(a){if(g()){e.onNext(a);var b=ta(c)(a);if(b===sa)return e.onError(b.e);f(qa(b)?Qc(b):b)}},function(a){g()&&e.onError(a)},function(){g()&&e.onCompleted()})),new mb(h,i)},a)}function _(a,b,c,d){if(null==c)throw new Error("other or scheduler must be specified");yb(c)&&(d=c,c=tc(new Tc)),c instanceof Error&&(c=tc(c)),yb(d)||(d=Hb);var e=b instanceof Date?"scheduleWithAbsolute":"scheduleWithRelative";return new Yc(function(f){function g(){var a=h;l.setDisposable(d[e](b,function(){h===a&&(qa(c)&&(c=Qc(c)),j.setDisposable(c.subscribe(f)))}))}var h=0,i=new tb,j=new ub,k=!1,l=new ub;return j.setDisposable(i),g(),i.setDisposable(a.subscribe(function(a){k||(h++,f.onNext(a),g())},function(a){k||(h++,f.onError(a))},function(){k||(h++,f.onCompleted())})),new mb(j,l)},a)}function aa(a,b,c){return new Yc(function(d){function e(a,b){if(j[b]=a,g[b]=!0,h||(h=g.every(la))){if(f)return d.onError(f);var e=ta(c).apply(null,j);if(e===sa)return d.onError(e.e);d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new mb(a.subscribe(function(a){e(a,0)},function(a){j[1]?d.onError(a):f=a},function(){i=!0,j[1]&&d.onCompleted()}),b.subscribe(function(a){e(a,1)},function(a){d.onError(a)},function(){i=!0,e(!0,1)}))},a)}var ba={"function":!0,object:!0},ca=ba[typeof exports]&&exports&&!exports.nodeType&&exports,da=ba[typeof self]&&self.Object&&self,ea=ba[typeof window]&&window&&window.Object&&window,fa=ba[typeof module]&&module&&!module.nodeType&&module,ga=fa&&fa.exports===ca&&ca,ha=ca&&fa&&"object"==typeof global&&global&&global.Object&&global,ia=ia=ha||ea!==(this&&this.window)&&ea||da||this,ja={internals:{},config:{Promise:ia.Promise},helpers:{}},ka=ja.helpers.noop=function(){},la=ja.helpers.identity=function(a){return a},ma=ja.helpers.defaultNow=Date.now,na=ja.helpers.defaultComparer=function(a,b){return ib(a,b)},oa=ja.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},pa=(ja.helpers.defaultKeySerializer=function(a){return a.toString()},ja.helpers.defaultError=function(a){throw a}),qa=ja.helpers.isPromise=function(a){return!!a&&"function"!=typeof a.subscribe&&"function"==typeof a.then},ra=ja.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==Ya.call(a)}),a}(),sa={e:{}},ta=ja.internals.tryCatch=function(a){if(!ra(a))throw new TypeError("fn must be a function");return c(a)};ja.config.longStackSupport=!1;var ua=!1,va=ta(function(){throw new Error})();ua=!!va.e&&!!va.e.stack;var wa,xa=i(),ya="From previous event:",za=ja.EmptyError=function(){this.message="Sequence contains no elements.",this.name="EmptyError",Error.call(this)};za.prototype=Object.create(Error.prototype);var Aa=ja.ObjectDisposedError=function(){this.message="Object has been disposed",this.name="ObjectDisposedError",Error.call(this)};Aa.prototype=Object.create(Error.prototype);var Ba=ja.ArgumentOutOfRangeError=function(){this.message="Argument out of range",this.name="ArgumentOutOfRangeError",Error.call(this)};Ba.prototype=Object.create(Error.prototype);var Ca=ja.NotSupportedError=function(a){this.message=a||"This operation is not supported",this.name="NotSupportedError",Error.call(this)};Ca.prototype=Object.create(Error.prototype);var Da=ja.NotImplementedError=function(a){this.message=a||"This operation is not implemented",this.name="NotImplementedError",Error.call(this)};Da.prototype=Object.create(Error.prototype);var Ea=ja.helpers.notImplemented=function(){throw new Da},Fa=ja.helpers.notSupported=function(){throw new Ca},Ga="function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_";ia.Set&&"function"==typeof(new ia.Set)["@@iterator"]&&(Ga="@@iterator");var Ha=ja.doneEnumerator={done:!0,value:a},Ia=ja.helpers.isIterable=function(b){return b[Ga]!==a},Ja=ja.helpers.isArrayLike=function(b){return b&&b.length!==a};ja.helpers.iterator=Ga;var Ka,La=ja.internals.bindCallback=function(a,b,c){if("undefined"==typeof b)return a;switch(c){case 0:return function(){return a.call(b)};case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}},Ma=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Na=Ma.length,Oa="[object Arguments]",Pa="[object Array]",Qa="[object Boolean]",Ra="[object Date]",Sa="[object Error]",Ta="[object Function]",Ua="[object Number]",Va="[object Object]",Wa="[object RegExp]",Xa="[object String]",Ya=Object.prototype.toString,Za=Object.prototype.hasOwnProperty,$a=Ya.call(arguments)==Oa,_a=Error.prototype,ab=Object.prototype,bb=String.prototype,cb=ab.propertyIsEnumerable;try{Ka=!(Ya.call(document)==Va&&!({toString:0}+""))}catch(db){Ka=!0}var eb={};eb[Pa]=eb[Ra]=eb[Ua]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},eb[Qa]=eb[Xa]={constructor:!0,toString:!0,valueOf:!0},eb[Sa]=eb[Ta]=eb[Wa]={constructor:!0,toString:!0},eb[Va]={constructor:!0};var fb={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);fb.enumErrorProps=cb.call(_a,"message")||cb.call(_a,"name"),fb.enumPrototypes=cb.call(a,"prototype"),fb.nonEnumArgs=0!=c,fb.nonEnumShadows=!/valueOf/.test(b)}(1);var gb=ja.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},hb=function(a){return a&&"object"==typeof a?Ya.call(a)==Oa:!1};$a||(hb=function(a){return a&&"object"==typeof a?Za.call(a,"callee"):!1});var ib=ja.internals.isEqual=function(a,b){return o(a,b,[],[])},jb=({}.hasOwnProperty,Array.prototype.slice),kb=ja.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c},lb=ja.internals.addProperties=function(a){for(var b=[],c=1,d=arguments.length;d>c;c++)b.push(arguments[c]);for(var e=0,f=b.length;f>e;e++){var g=b[e];for(var h in g)a[h]=g[h]}},mb=(ja.internals.addRef=function(a,b){return new Yc(function(c){return new mb(b.getDisposable(),a.subscribe(c))})},ja.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0],b=c.length;else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];for(a=0;b>a;a++)if(!rb(c[a]))throw new TypeError("Not a disposable");this.disposables=c,this.isDisposed=!1,this.length=c.length}),nb=mb.prototype;nb.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},nb.remove=function(a){var b=!1;if(!this.isDisposed){var c=this.disposables.indexOf(a);-1!==c&&(b=!0,this.disposables.splice(c,1),this.length--,a.dispose())}return b},nb.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=this.disposables.length,b=new Array(a),c=0;a>c;c++)b[c]=this.disposables[c];for(this.disposables=[],this.length=0,c=0;a>c;c++)b[c].dispose()}};var ob=ja.Disposable=function(a){this.isDisposed=!1,this.action=a||ka};ob.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var pb=ob.create=function(a){return new ob(a)},qb=ob.empty={dispose:ka},rb=ob.isDisposable=function(a){return a&&ra(a.dispose)},sb=ob.checkDisposed=function(a){if(a.isDisposed)throw new Aa},tb=ja.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};tb.prototype.getDisposable=function(){return this.current},tb.prototype.setDisposable=function(a){if(this.current)throw new Error("Disposable has already been assigned");var b=this.isDisposed;!b&&(this.current=a),b&&a&&a.dispose()},tb.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var ub=ja.SerialDisposable=function(){this.isDisposed=!1,this.current=null};ub.prototype.getDisposable=function(){return this.current},ub.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},ub.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var vb=(ja.RefCountDisposable=function(){function a(a){this.disposable=a,this.disposable.count++,this.isInnerDisposed=!1}function b(a){this.underlyingDisposable=a,this.isDisposed=!1,this.isPrimaryDisposed=!1,this.count=0}return a.prototype.dispose=function(){this.disposable.isDisposed||this.isInnerDisposed||(this.isInnerDisposed=!0,this.disposable.count--,0===this.disposable.count&&this.disposable.isPrimaryDisposed&&(this.disposable.isDisposed=!0,this.disposable.underlyingDisposable.dispose()))},b.prototype.dispose=function(){this.isDisposed||this.isPrimaryDisposed||(this.isPrimaryDisposed=!0,0===this.count&&(this.isDisposed=!0,this.underlyingDisposable.dispose()))},b.prototype.getDisposable=function(){return this.isDisposed?qb:new a(this)},b}(),ja.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||oa,this.disposable=new tb});vb.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},vb.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},vb.prototype.isCancelled=function(){return this.disposable.isDisposed},vb.prototype.invokeCore=function(){return this.action(this.scheduler,this.state)};var wb=ja.Scheduler=function(){function a(a,b,c,d){this.now=a,this._schedule=b,this._scheduleRelative=c,this._scheduleAbsolute=d}function b(a,b){return b(),qb}a.isScheduler=function(b){return b instanceof a};var c=a.prototype;return c.schedule=function(a){return this._schedule(a,b)},c.scheduleWithState=function(a,b){return this._schedule(a,b)},c.scheduleWithRelative=function(a,c){return this._scheduleRelative(c,a,b)},c.scheduleWithRelativeAndState=function(a,b,c){return this._scheduleRelative(a,b,c)},c.scheduleWithAbsolute=function(a,c){return this._scheduleAbsolute(c,a,b)},c.scheduleWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute(a,b,c)},a.now=ma,a.normalize=function(a){return 0>a&&(a=0),a},a}(),xb=wb.normalize,yb=wb.isScheduler;!function(a){function b(a,b){function c(b){function d(a,b){return g?f.remove(i):h=!0,e(b,c),qb}var g=!1,h=!1,i=a.scheduleWithState(b,d);h||(f.add(i),g=!0)}var d=b[0],e=b[1],f=new mb;return e(d,c),f}function c(a,b,c){function d(b,e){function h(a,b){return i?g.remove(k):j=!0,f(b,d),qb}var i=!1,j=!1,k=a[c](b,e,h);j||(g.add(k),i=!0)}var e=b[0],f=b[1],g=new mb;return f(e,d),g}function d(a,b){return c(a,b,"scheduleWithRelativeAndState")}function e(a,b){return c(a,b,"scheduleWithAbsoluteAndState")}function f(a,b){a(function(c){b(a,c)})}a.scheduleRecursive=function(a){return this.scheduleRecursiveWithState(a,f)},a.scheduleRecursiveWithState=function(a,c){return this.scheduleWithState([a,c],b)},a.scheduleRecursiveWithRelative=function(a,b){return this.scheduleRecursiveWithRelativeAndState(b,a,f)},a.scheduleRecursiveWithRelativeAndState=function(a,b,c){return this._scheduleRelative([a,c],b,d)},a.scheduleRecursiveWithAbsolute=function(a,b){return this.scheduleRecursiveWithAbsoluteAndState(b,a,f)},a.scheduleRecursiveWithAbsoluteAndState=function(a,b,c){return this._scheduleAbsolute([a,c],b,e)}}(wb.prototype),function(a){wb.prototype.schedulePeriodic=function(a,b){return this.schedulePeriodicWithState(null,a,b)},wb.prototype.schedulePeriodicWithState=function(a,b,c){if("undefined"==typeof ia.setInterval)throw new Ca;b=xb(b);var d=a,e=ia.setInterval(function(){d=c(d)},b);return pb(function(){ia.clearInterval(e)})}}(wb.prototype);var zb,Ab,Bb=wb.immediate=function(){function a(a,b){return b(this,a)}return new wb(ma,a,Fa,Fa)}(),Cb=wb.currentThread=function(){function a(){for(;c.length>0;){var a=c.shift();!a.isCancelled()&&a.invoke()}}function b(b,e){var f=new vb(this,b,e,this.now());if(c)c.push(f);else{c=[f];var g=ta(a)();if(c=null,g===sa)return d(g.e)}return f.disposable}var c,e=new wb(ma,b,Fa,Fa);return e.scheduleRequired=function(){return!c},e}(),Db=(ja.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new tb;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}(),function(){var a,b=ka;if(ia.setTimeout)a=ia.setTimeout,b=ia.clearTimeout;else{if(!ia.WScript)throw new Ca;a=function(a,b){ia.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}()),Eb=Db.setTimeout,Fb=Db.clearTimeout;!function(){function a(b){if(g)Eb(function(){a(b)},0);else{var c=f[b];if(c){g=!0;var e=ta(c)();if(Ab(b),g=!1,e===sa)return d(e.e)}}}function b(){if(!ia.postMessage||ia.importScripts)return!1;var a=!1,b=ia.onmessage;return ia.onmessage=function(){a=!0},ia.postMessage("","*"),ia.onmessage=b,a}function c(b){"string"==typeof b.data&&b.data.substring(0,j.length)===j&&a(b.data.substring(j.length))}var e=1,f={},g=!1;Ab=function(a){delete f[a]};var h=RegExp("^"+String(Ya).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),i="function"==typeof(i=ha&&ga&&ha.setImmediate)&&!h.test(i)&&i;if(ra(i))zb=function(b){var c=e++;return f[c]=b,i(function(){a(c)}),c};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))zb=function(b){var c=e++;return f[c]=b,process.nextTick(function(){a(c)}),c};else if(b()){var j="ms.rx.schedule"+Math.random();ia.addEventListener?ia.addEventListener("message",c,!1):ia.attachEvent?ia.attachEvent("onmessage",c):ia.onmessage=c,zb=function(a){var b=e++;return f[b]=a,ia.postMessage(j+currentId,"*"),b}}else if(ia.MessageChannel){var k=new ia.MessageChannel;k.port1.onmessage=function(b){a(b.data)},zb=function(a){var b=e++;return f[b]=a,k.port2.postMessage(b),b}}else zb="document"in ia&&"onreadystatechange"in ia.document.createElement("script")?function(b){var c=ia.document.createElement("script"),d=e++;return f[d]=b,c.onreadystatechange=function(){a(d),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},ia.document.documentElement.appendChild(c),d}:function(b){var c=e++;return f[c]=b,Eb(function(){a(c)},0),c}}();var Gb,Hb=wb.timeout=wb["default"]=function(){function a(a,b){var c=this,d=new tb,e=zb(function(){!d.isDisposed&&d.setDisposable(b(c,a))});return new mb(d,pb(function(){Ab(e)}))}function b(a,b,c){var d=this,e=wb.normalize(b),f=new tb;if(0===e)return d.scheduleWithState(a,c);var g=Eb(function(){!f.isDisposed&&f.setDisposable(c(d,a))},e);return new mb(f,pb(function(){Fb(g)}))}function c(a,b,c){return this.scheduleWithRelativeAndState(a,b-this.now(),c)}return new wb(ma,a,b,c)}(),Ib=ja.Notification=function(){function a(a,b,c,d,e,f){this.kind=a,this.value=b,this.exception=c,this._accept=d,this._acceptObservable=e,this.toString=f}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return yb(a)||(a=Bb),new Yc(function(c){return a.scheduleWithState(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),Jb=Ib.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){return new Ib("N",d,null,a,b,c)}}(),Kb=Ib.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){return new Ib("E",null,d,a,b,c)}}(),Lb=Ib.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){return new Ib("C",null,null,a,b,c)}}(),Mb=ja.Observer=function(){},Nb=Mb.create=function(a,b,c){return a||(a=ka),b||(b=pa),c||(c=ka),new Pb(a,b,c)},Ob=ja.internals.AbstractObserver=function(a){function b(){this.isStopped=!1}return kb(b,a),b.prototype.next=Ea,b.prototype.error=Ea,b.prototype.completed=Ea,b.prototype.onNext=function(a){!this.isStopped&&this.next(a)},b.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.error(a))},b.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.completed())},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.error(a),!0)},b}(Mb),Pb=ja.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return kb(b,a),b.prototype.next=function(a){this._onNext(a)},b.prototype.error=function(a){this._onError(a)},b.prototype.completed=function(){this._onCompleted()},b}(Ob),Qb=ja.Observable=function(){function a(a,b){return function(c){var d=c.onError;return c.onError=function(b){e(b,a),d.call(c,b)},b.call(a,c)}}function b(b){if(ja.config.longStackSupport&&ua){var c=ta(d)(new Error).e;this.stack=c.stack.substring(c.stack.indexOf("\n")+1),this._subscribe=a(this,b)}else this._subscribe=b}return Gb=b.prototype,b.isObservable=function(a){return a&&ra(a.subscribe)},Gb.subscribe=Gb.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:Nb(a,b,c))},Gb.subscribeOnNext=function(a,b){return this._subscribe(Nb("undefined"!=typeof b?function(c){a.call(b,c)}:a))},Gb.subscribeOnError=function(a,b){return this._subscribe(Nb(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},Gb.subscribeOnCompleted=function(a,b){return this._subscribe(Nb(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},b}(),Rb=ja.internals.ScheduledObserver=function(a){function b(b,c){a.call(this),this.scheduler=b,this.observer=c,this.isAcquired=!1,this.hasFaulted=!1,this.queue=[],this.disposable=new ub}return kb(b,a),b.prototype.next=function(a){var b=this;this.queue.push(function(){b.observer.onNext(a)})},b.prototype.error=function(a){var b=this;this.queue.push(function(){b.observer.onError(a)})},b.prototype.completed=function(){var a=this;this.queue.push(function(){a.observer.onCompleted()})},b.prototype.ensureActive=function(){var a=!1;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursiveWithState(this,function(a,b){var c;if(!(a.queue.length>0))return void(a.isAcquired=!1);c=a.queue.shift();var e=ta(c)();return e===sa?(a.queue=[],a.hasFaulted=!0,d(e.e)):void b(a)}))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(Ob),Sb=ja.ObservableBase=function(a){function b(a){return a&&ra(a.dispose)?a:ra(a)?pb(a):qb}function c(a,c){var e=c[0],f=c[1],g=ta(f.subscribeCore).call(f,e);return g!==sa||e.fail(sa.e)?void e.setDisposable(b(g)):d(sa.e)}function e(a){var b=new Zc(a),d=[b,this];return Cb.scheduleRequired()?Cb.scheduleWithState(d,c):c(null,d),b}function f(){a.call(this,e)}return kb(f,a),f.prototype.subscribeCore=Ea,f}(Qb),Tb=function(a){function b(b,c,d,e){this.resultSelector=ja.helpers.isFunction(d)?d:null,this.selector=ja.internals.bindCallback(ja.helpers.isFunction(c)?c:function(){return c},e,3),this.source=b,a.call(this)}function c(a,b,c,d){this.i=0,this.selector=b,this.resultSelector=c,this.source=d,this.isStopped=!1,this.o=a}return kb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.selector,this.resultSelector,this))},c.prototype._wrapResult=function(a,b,c){return this.resultSelector?a.map(function(a,d){return this.resultSelector(b,a,c,d)},this):a},c.prototype.onNext=function(a){if(!this.isStopped){var b=this.i++,c=ta(this.selector)(a,b,this.source);if(c===sa)return this.o.onError(c.e);ja.helpers.isPromise(c)&&(c=ja.Observable.fromPromise(c)),(ja.helpers.isArrayLike(c)||ja.helpers.isIterable(c))&&(c=ja.Observable.from(c)),this.o.onNext(this._wrapResult(c,a,b))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},b}(Sb),Ub=ja.internals.Enumerable=function(){},Vb=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b,c){this.o=a,this.s=b,this.e=c,this.isStopped=!1}return kb(b,a),b.prototype.subscribeCore=function(a){var b,d=new ub,e=Bb.scheduleRecursiveWithState(this.sources[Ga](),function(e,f){if(!b){var g=ta(e.next).call(e);if(g===sa)return a.onError(g.e);if(g.done)return a.onCompleted();var h=g.value;qa(h)&&(h=Qc(h));var i=new tb;d.setDisposable(i),i.setDisposable(h.subscribe(new c(a,f,e)))}});return new mb(d,e,pb(function(){b=!0}))},c.prototype.onNext=function(a){this.isStopped||this.o.onNext(a)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.s(this.e))},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Sb);Ub.prototype.concat=function(){return new Vb(this)};var Wb=function(a){function b(b){this.sources=b,a.call(this)}return kb(b,a),b.prototype.subscribeCore=function(a){var b,c=this.sources[Ga](),d=new ub,e=Bb.scheduleRecursiveWithState(null,function(e,f){if(!b){var g=ta(c.next).call(c);if(g===sa)return a.onError(g.e);if(g.done)return null!==e?a.onError(e):a.onCompleted();var h=g.value;qa(h)&&(h=Qc(h));var i=new tb;d.setDisposable(i),i.setDisposable(h.subscribe(function(b){a.onNext(b)},f,function(){a.onCompleted()}))}});return new mb(d,e,pb(function(){b=!0}))},b}(Sb);Ub.prototype.catchError=function(){return new Wb(this)},Ub.prototype.catchErrorWhen=function(a){var b=this;return new Yc(function(c){var d,e,f=new _c,g=new _c,h=a(f),i=h.subscribe(g),j=b[Ga](),k=new ub,l=Bb.scheduleRecursive(function(a){if(!d){var b=ta(j.next).call(j);if(b===sa)return c.onError(b.e);if(b.done)return void(e?c.onError(e):c.onCompleted());var h=b.value;qa(h)&&(h=Qc(h));var i=new tb,l=new tb;k.setDisposable(new mb(l,i)),i.setDisposable(h.subscribe(function(a){c.onNext(a)},function(b){l.setDisposable(g.subscribe(a,function(a){c.onError(a)},function(){c.onCompleted()})),f.onNext(b)},function(){c.onCompleted()}))}});return new mb(i,k,l,pb(function(){d=!0}))})};var Xb=function(a){function b(a,b){this.v=a,this.c=null==b?-1:b}function c(a){this.v=a.v,this.l=a.c}return kb(b,a),b.prototype[Ga]=function(){return new c(this)},c.prototype.next=function(){return 0===this.l?Ha:(this.l>0&&this.l--,{done:!1,value:this.v})},b}(Ub),Yb=Ub.repeat=function(a,b){return new Xb(a,b)},Zb=function(a){function b(a,b,c){this.s=a,this.fn=b?La(b,c,3):null}function c(a){this.i=-1,this.s=a.s,this.l=this.s.length,this.fn=a.fn}return kb(b,a),b.prototype[Ga]=function(){return new c(this)},c.prototype.next=function(){return++this.ia?(b.onNext(c[a]),e(a+1)):b.onCompleted()}var b=this.observer,c=this.parent.args,d=c.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)};var jc=Qb.fromArray=function(a,b){return yb(b)||(b=Cb),new ic(a,b)},kc=function(a){function b(){a.call(this)}return kb(b,a),b.prototype.subscribeCore=function(a){return qb},b}(Sb),lc=new kc,mc=Qb.never=function(){return lc};Qb.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new ic(b,Cb)},Qb.ofWithScheduler=function(a){for(var b=arguments.length,c=new Array(b-1),d=1;b>d;d++)c[d-1]=arguments[d];return new ic(c,a)};var nc=function(a){function b(b,c){this.obj=b,this.keys=Object.keys(b),this.scheduler=c,a.call(this)}return kb(b,a),b.prototype.subscribeCore=function(a){var b=new A(a,this);return b.run()},b}(Sb);A.prototype.run=function(){function a(a,f){if(e>a){var g=d[a];b.onNext([g,c[g]]),f(a+1)}else b.onCompleted()}var b=this.observer,c=this.parent.obj,d=this.parent.keys,e=d.length;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},Qb.pairs=function(a,b){return b||(b=Cb),new nc(a,b)};var oc=function(a){function b(b,c,d){this.start=b,this.rangeCount=c,this.scheduler=d,a.call(this)}return kb(b,a),b.prototype.subscribeCore=function(a){var b=new pc(a,this);return b.run()},b}(Sb),pc=function(){function a(a,b){this.observer=a,this.parent=b}return a.prototype.run=function(){function a(a,e){c>a?(d.onNext(b+a),e(a+1)):d.onCompleted()}var b=this.parent.start,c=this.parent.rangeCount,d=this.observer;return this.parent.scheduler.scheduleRecursiveWithState(0,a)},a}();Qb.range=function(a,b,c){return yb(c)||(c=Cb),new oc(a,b,c)};var qc=function(a){function b(b,c,d){this.value=b,this.repeatCount=null==c?-1:c,this.scheduler=d,a.call(this)}return kb(b,a),b.prototype.subscribeCore=function(a){var b=new B(a,this);return b.run()},b}(Sb);B.prototype.run=function(){function a(a,d){return(-1===a||a>0)&&(b.onNext(c),a>0&&a--),0===a?b.onCompleted():void d(a)}var b=this.observer,c=this.parent.value;return this.parent.scheduler.scheduleRecursiveWithState(this.parent.repeatCount,a)},Qb.repeat=function(a,b,c){return yb(c)||(c=Cb),new qc(a,b,c)};var rc=function(a){function b(b,c){this.value=b,this.scheduler=c,a.call(this)}function c(a,b,c){this.observer=a,this.value=b,this.scheduler=c}function d(a,b){var c=b[0],d=b[1];return d.onNext(c),d.onCompleted(),qb}return kb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this.value,this.scheduler);return b.run()},c.prototype.run=function(){var a=[this.value,this.observer];return this.scheduler===Bb?d(null,a):this.scheduler.scheduleWithState(a,d)},b}(Sb),sc=(Qb["return"]=Qb.just=function(a,b){return yb(b)||(b=Bb),new rc(a,b)},function(a){function b(b,c){this.error=b,this.scheduler=c,a.call(this)}function c(a,b){this.o=a,this.p=b}function d(a,b){var c=b[0],d=b[1];d.onError(c)}return kb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this);return b.run()},c.prototype.run=function(){return this.p.scheduler.scheduleWithState([this.p.error,this.o],d)},b}(Sb)),tc=Qb["throw"]=function(a,b){return yb(b)||(b=Bb),new sc(a,b)},uc=function(a){function b(b,c,d){this._o=b,this._s=c,this._fn=d,a.call(this)}return kb(b,a),b.prototype.next=function(a){this._o.onNext(a)},b.prototype.completed=function(){return this._o.onCompleted()},b.prototype.error=function(a){var b=ta(this._fn)(a);if(b===sa)return this._o.onError(b.e);qa(b)&&(b=Qc(b));var c=new tb;this._s.setDisposable(c),c.setDisposable(b.subscribe(this._o))},b}(Ob);Gb["catch"]=function(a){return ra(a)?C(this,a):vc([this,a])};var vc=Qb["catch"]=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return $b(a).catchError()};Gb.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return Array.isArray(b[0])?b[0].unshift(this):b.unshift(this),wc.apply(this,b)};var wc=Qb.combineLatest=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=ra(b[a-1])?b.pop():E;return Array.isArray(b[0])&&(b=b[0]),new Yc(function(a){function c(b){if(g[b]=!0,h||(h=g.every(la))){try{var c=d.apply(null,j)}catch(e){return a.onError(e)}a.onNext(c)}else i.filter(function(a,c){return c!==b}).every(la)&&a.onCompleted()}function e(b){i[b]=!0,i.every(la)&&a.onCompleted()}for(var f=b.length,g=p(f,D),h=!1,i=p(f,D),j=new Array(f),k=new Array(f),l=0;f>l;l++)!function(d){var f=b[d],g=new tb;qa(f)&&(f=Qc(f)),g.setDisposable(f.subscribe(function(a){j[d]=a,c(d)},function(b){a.onError(b)},function(){e(d)})),k[d]=g}(l);return new mb(k)},this)};Gb.concat=function(){for(var a=[],b=0,c=arguments.length;c>b;b++)a.push(arguments[b]);return a.unshift(this),yc.apply(null,a)};var xc=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){this.sources=a,this.o=b}return kb(b,a),b.prototype.subscribeCore=function(a){var b=new c(this.sources,a);return b.run()},c.prototype.run=function(){var a,b=new ub,c=this.sources,d=c.length,e=this.o,f=Bb.scheduleRecursiveWithState(0,function(f,g){if(!a){if(f===d)return e.onCompleted();var h=c[f];qa(h)&&(h=Qc(h));var i=new tb;b.setDisposable(i),i.setDisposable(h.subscribe(function(a){e.onNext(a)},function(a){e.onError(a)},function(){g(f+1)}))}});return new mb(b,f,pb(function(){a=!0}))},b}(Sb),yc=Qb.concat=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(arguments.length);for(var b=0,c=arguments.length;c>b;b++)a[b]=arguments[b]}return new xc(a)};Gb.concatAll=function(){return this.merge(1)};var zc=function(a){function b(b,c){this.source=b,this.maxConcurrent=c,a.call(this)}return kb(b,a),b.prototype.subscribeCore=function(a){var b=new mb;return b.add(this.source.subscribe(new Ac(a,this.maxConcurrent,b))),b},b}(Sb),Ac=function(){function a(a,b,c){this.o=a,this.max=b,this.g=c,this.done=!1,this.q=[],this.activeCount=0,this.isStopped=!1}function b(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return a.prototype.handleSubscribe=function(a){var c=new tb;this.g.add(c),qa(a)&&(a=Qc(a)),c.setDisposable(a.subscribe(new b(this,c)))},a.prototype.onNext=function(a){this.isStopped||(this.activeCount0?a.handleSubscribe(a.q.shift()):(a.activeCount--,a.done&&0===a.activeCount&&a.o.onCompleted())}},b.prototype.dispose=function(){this.isStopped=!0},b.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},a}();Gb.merge=function(a){return"number"!=typeof a?Bc(this,a):new zc(this,a)};var Bc=Qb.merge=function(){var a,b,c=[],d=arguments.length;if(arguments[0])if(yb(arguments[0]))for(a=arguments[0],b=1;d>b;b++)c.push(arguments[b]);else for(a=Bb,b=0;d>b;b++)c.push(arguments[b]);else for(a=Bb,b=1;d>b;b++)c.push(arguments[b]);return Array.isArray(c[0])&&(c=c[0]),z(a,c).mergeAll()},Cc=ja.CompositeError=function(a){this.name="NotImplementedError",this.innerErrors=a,this.message="This contains multiple errors. Check the innerErrors",Error.call(this)};Cc.prototype=Error.prototype,Qb.mergeDelayError=function(){var a;if(Array.isArray(arguments[0]))a=arguments[0];else{var b=arguments.length;a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}var d=z(null,a);return new Yc(function(a){function b(){0===g.length?a.onCompleted():1===g.length?a.onError(g[0]):a.onError(new Cc(g))}var c=new mb,e=new tb,f=!1,g=[];return c.add(e),e.setDisposable(d.subscribe(function(d){var e=new tb;c.add(e),qa(d)&&(d=Qc(d)),e.setDisposable(d.subscribe(function(b){a.onNext(b)},function(a){g.push(a),c.remove(e),f&&1===c.length&&b()},function(){c.remove(e),f&&1===c.length&&b()}))},function(a){g.push(a),f=!0,1===c.length&&b()},function(){f=!0,1===c.length&&b()})),c})};var Dc=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.g=b,this.isStopped=!1,this.done=!1}function d(a,b){this.parent=a,this.sad=b,this.isStopped=!1}return kb(b,a),b.prototype.subscribeCore=function(a){var b=new mb,d=new tb;return b.add(d),d.setDisposable(this.source.subscribe(new c(a,b))),b},c.prototype.onNext=function(a){if(!this.isStopped){var b=new tb;this.g.add(b),qa(a)&&(a=Qc(a)),b.setDisposable(a.subscribe(new d(this,b)))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.done=!0,1===this.g.length&&this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype.onNext=function(a){this.isStopped||this.parent.o.onNext(a)},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.o.onError(a))},d.prototype.onCompleted=function(){if(!this.isStopped){var a=this.parent;this.isStopped=!0,a.g.remove(this.sad),a.done&&1===a.g.length&&a.o.onCompleted()}},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(Sb);Gb.mergeAll=function(){return new Dc(this)},Gb.skipUntil=function(a){var b=this;return new Yc(function(c){var d=!1,e=new mb(b.subscribe(function(a){d&&c.onNext(a)},function(a){c.onError(a)},function(){d&&c.onCompleted()}));qa(a)&&(a=Qc(a));var f=new tb;return e.add(f),f.setDisposable(a.subscribe(function(){d=!0,f.dispose()},function(a){c.onError(a)},function(){f.dispose()})),e},b)};var Ec=function(a){function b(b){this.source=b,a.call(this)}function c(a,b){this.o=a,this.inner=b,this.stopped=!1,this.latest=0,this.hasLatest=!1,this.isStopped=!1}function d(a,b){this.parent=a,this.id=b,this.isStopped=!1}return kb(b,a),b.prototype.subscribeCore=function(a){var b=new ub,d=this.source.subscribe(new c(a,b));return new mb(d,b)},c.prototype.onNext=function(a){if(!this.isStopped){var b=new tb,c=++this.latest;this.hasLatest=!0,this.inner.setDisposable(b),qa(a)&&(a=Qc(a)),b.setDisposable(a.subscribe(new d(this,c)))}},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.stopped=!0,!this.hasLatest&&this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},d.prototype.onNext=function(a){this.isStopped||this.parent.latest===this.id&&this.parent.o.onNext(a)},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.parent.latest===this.id&&this.parent.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.parent.latest===this.id&&(this.parent.hasLatest=!1,this.parent.isStopped&&this.parent.o.onCompleted()))},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.parent.o.onError(a),!0)},b}(Sb);Gb["switch"]=Gb.switchLatest=function(){return new Ec(this)};var Fc=function(a){function b(b,c){this.source=b,this.other=qa(c)?Qc(c):c,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return kb(b,a),b.prototype.subscribeCore=function(a){return new mb(this.source.subscribe(a),this.other.subscribe(new c(a)))},c.prototype.onNext=function(a){this.isStopped||this.o.onCompleted()},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){!this.isStopped&&(this.isStopped=!0)},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Sb);Gb.takeUntil=function(a){return new Fc(this,a)},Gb.withLatestFrom=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=b.pop(),e=this;return Array.isArray(b[0])&&(b=b[0]),new Yc(function(a){for(var c=b.length,f=p(c,D),g=!1,h=new Array(c),i=new Array(c+1),j=0;c>j;j++)!function(c){var d=b[c],e=new tb;qa(d)&&(d=Qc(d)),e.setDisposable(d.subscribe(function(a){h[c]=a,f[c]=!0,g=f.every(la)},function(b){a.onError(b)},ka)),i[c]=e}(j);var k=new tb;return k.setDisposable(e.subscribe(function(b){var c=[b].concat(h);if(g){var e=ta(d).apply(null,c);return e===sa?a.onError(e.e):void a.onNext(e)}},function(b){a.onError(b)},function(){a.onCompleted()})),i[c]=k,new mb(i)},this)},Gb.zip=function(){if(0===arguments.length)throw new Error("invalid arguments");for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=ra(b[a-1])?b.pop():E;Array.isArray(b[0])&&(b=b[0]);var e=this;return b.unshift(e),new Yc(function(a){for(var c=b.length,f=p(c,F),g=p(c,D),h=new Array(c),i=0;c>i;i++)!function(c){var i=b[c],j=new tb;qa(i)&&(i=Qc(i)),j.setDisposable(i.subscribe(function(b){if(f[c].push(b),f.every(function(a){return a.length>0})){var h=f.map(function(a){return a.shift()}),i=ta(d).apply(e,h);if(i===sa)return a.onError(i.e);a.onNext(i)}else g.filter(function(a,b){return b!==c}).every(la)&&a.onCompleted()},function(b){a.onError(b)},function(){g[c]=!0,g.every(la)&&a.onCompleted()})),h[c]=j}(i);return new mb(h)},e)},Qb.zip=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];Array.isArray(b[0])&&(b=ra(b[1])?b[0].concat(b[1]):b[0]);var d=b.shift();return d.zip.apply(d,b)},Gb.zipIterable=function(){if(0===arguments.length)throw new Error("invalid arguments");for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];var d=ra(b[a-1])?b.pop():E,e=this;return b.unshift(e),new Yc(function(a){for(var c=b.length,f=p(c,F),g=p(c,D),h=new Array(c),i=0;c>i;i++)!function(c){var i=b[c],j=new tb;(Ja(i)||Ia(i))&&(i=hc(i)),j.setDisposable(i.subscribe(function(b){if(f[c].push(b),f.every(function(a){return a.length>0})){var h=f.map(function(a){return a.shift()}),i=ta(d).apply(e,h);if(i===sa)return a.onError(i.e);a.onNext(i)}else g.filter(function(a,b){return b!==c}).every(la)&&a.onCompleted()},function(b){a.onError(b)},function(){g[c]=!0,g.every(la)&&a.onCompleted()})),h[c]=j}(i);return new mb(h)},e)},Gb.asObservable=function(){return new Yc(G(this),this)},Gb.dematerialize=function(){var a=this;return new Yc(function(b){return a.subscribe(function(a){return a.accept(b)},function(a){b.onError(a)},function(){b.onCompleted()})},this)};var Gc=function(a){function b(b,c,d){this.source=b,this.keyFn=c,this.comparer=d,a.call(this)}return kb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Hc(a,this.keyFn,this.comparer))},b}(Sb),Hc=function(a){function b(b,c,d){this.o=b,this.keyFn=c,this.comparer=d,this.hasCurrentKey=!1,this.currentKey=null,a.call(this)}return kb(b,a),b.prototype.next=function(a){var b,c=a;return ra(this.keyFn)&&(c=ta(this.keyFn)(a),c===sa)?this.o.onError(c.e):this.hasCurrentKey&&(b=ta(this.comparer)(this.currentKey,c),b===sa)?this.o.onError(b.e):void(this.hasCurrentKey&&b||(this.hasCurrentKey=!0,this.currentKey=c,this.o.onNext(a)))},b.prototype.error=function(a){this.o.onError(a)},b.prototype.completed=function(){this.o.onCompleted()},b}(Ob);Gb.distinctUntilChanged=function(a,b){return b||(b=na),new Gc(this,a,b)};var Ic=function(a){function b(b,c,d,e){this.source=b,this._oN=c,this._oE=d,this._oC=e,a.call(this)}function c(a,b){this.o=a,this.t=!b._oN||ra(b._oN)?Nb(b._oN||ka,b._oE||ka,b._oC||ka):b._oN,this.isStopped=!1}return kb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this))},c.prototype.onNext=function(a){if(!this.isStopped){var b=ta(this.t.onNext).call(this.t,a);b===sa&&this.o.onError(b.e),this.o.onNext(a)}},c.prototype.onError=function(a){if(!this.isStopped){this.isStopped=!0;var b=ta(this.t.onError).call(this.t,a);if(b===sa)return this.o.onError(b.e);this.o.onError(a)}},c.prototype.onCompleted=function(){if(!this.isStopped){this.isStopped=!0;var a=ta(this.t.onCompleted).call(this.t);if(a===sa)return this.o.onError(a.e);this.o.onCompleted()}},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Sb);Gb["do"]=Gb.tap=Gb.doAction=function(a,b,c){return new Ic(this,a,b,c)},Gb.doOnNext=Gb.tapOnNext=function(a,b){return this.tap("undefined"!=typeof b?function(c){a.call(b,c)}:a)},Gb.doOnError=Gb.tapOnError=function(a,b){return this.tap(ka,"undefined"!=typeof b?function(c){a.call(b,c)}:a)},Gb.doOnCompleted=Gb.tapOnCompleted=function(a,b){return this.tap(ka,null,"undefined"!=typeof b?function(){a.call(b)}:a)},Gb["finally"]=function(a){var b=this;return new Yc(function(c){var e=ta(b.subscribe).call(b,c);return e===sa?(a(),d(e.e)):pb(function(){var b=ta(e.dispose).call(e);a(),b===sa&&d(b.e)})},this)};var Jc=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.isStopped=!1}return kb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},c.prototype.onNext=ka,c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.observer.onError(a),!0)},b}(Sb);Gb.ignoreElements=function(){return new Jc(this)},Gb.materialize=function(){var a=this;return new Yc(function(b){return a.subscribe(function(a){b.onNext(Jb(a))},function(a){b.onNext(Kb(a)),b.onCompleted()},function(){b.onNext(Lb()),b.onCompleted()})},a)},Gb.repeat=function(a){return Yb(this,a).concat()},Gb.retry=function(a){return Yb(this,a).catchError()},Gb.retryWhen=function(a){return Yb(this).catchErrorWhen(a)};var Kc=function(a){function b(b,c,d,e){this.source=b,this.accumulator=c,this.hasSeed=d,this.seed=e,a.call(this)}return kb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new H(a,this))},b}(Sb);H.prototype={onNext:function(a){return this.isStopped?void 0:(!this.hasValue&&(this.hasValue=!0),this.hasAccumulation?this.accumulation=ta(this.accumulator)(this.accumulation,a):(this.accumulation=this.hasSeed?ta(this.accumulator)(this.seed,a):a,this.hasAccumulation=!0),this.accumulation===sa?this.o.onError(this.accumulation.e):void this.o.onNext(this.accumulation))},onError:function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},onCompleted:function(){this.isStopped||(this.isStopped=!0,!this.hasValue&&this.hasSeed&&this.o.onNext(this.seed),this.o.onCompleted())},dispose:function(){this.isStopped=!0},fail:function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)}},Gb.scan=function(){var a,b=!1,c=arguments[0];return 2===arguments.length&&(b=!0,a=arguments[1]),new Kc(this,c,b,a)},Gb.skipLast=function(a){if(0>a)throw new Ba;var b=this;return new Yc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&c.onNext(d.shift())},function(a){c.onError(a)},function(){c.onCompleted()})},b)},Gb.startWith=function(){var a,b=0;arguments.length&&yb(arguments[0])?(a=arguments[0],b=1):a=Bb;for(var c=[],d=b,e=arguments.length;e>d;d++)c.push(arguments[d]);return $b([jc(c,a),this]).concat()},Gb.takeLast=function(a){if(0>a)throw new Ba;var b=this;return new Yc(function(c){var d=[];return b.subscribe(function(b){d.push(b),d.length>a&&d.shift()},function(a){c.onError(a)},function(){for(;d.length>0;)c.onNext(d.shift());c.onCompleted()})},b)},Gb.flatMapConcat=Gb.concatMap=function(a,b,c){return new Tb(this,a,b,c).merge(1)};var Lc=function(a){function b(b,c,d){this.source=b,this.selector=La(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return a.call(this,b.selector(c,d,e),d,e)}}function d(a,b,c){this.o=a,this.selector=b,this.source=c,this.i=0,this.isStopped=!1}return kb(b,a),b.prototype.internalMap=function(a,d){return new b(this.source,c(a,this),d)},b.prototype.subscribeCore=function(a){return this.source.subscribe(new d(a,this.selector,this))},d.prototype.onNext=function(a){if(!this.isStopped){var b=ta(this.selector)(a,this.i++,this.source);return b===sa?this.o.onError(b.e):void this.o.onNext(b)}},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Sb);Gb.map=Gb.select=function(a,b){var c="function"==typeof a?a:function(){return a};return this instanceof Lc?this.internalMap(c,b):new Lc(this,c,b)},Gb.pluck=function(){var a=arguments.length,b=new Array(a);if(0===a)throw new Error("List of properties cannot be empty.");for(var c=0;a>c;c++)b[c]=arguments[c];return this.map(I(b,a))},Gb.flatMap=Gb.selectMany=function(a,b,c){return new Tb(this,a,b,c).mergeAll()},ja.Observable.prototype.flatMapLatest=function(a,b,c){return new Tb(this,a,b,c).switchLatest()};var Mc=function(a){function b(b,c){this.source=b,this.skipCount=c,a.call(this)}function c(a,b){this.c=b,this.r=b,this.o=a,this.isStopped=!1}return kb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.skipCount))},c.prototype.onNext=function(a){this.isStopped||(this.r<=0?this.o.onNext(a):this.r--)},c.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},c.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},c.prototype.dispose=function(){this.isStopped=!0},c.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Sb);Gb.skip=function(a){if(0>a)throw new Ba;return new Mc(this,a)},Gb.skipWhile=function(a,b){var c=this,d=La(a,b,3);return new Yc(function(a){var b=0,e=!1;return c.subscribe(function(f){if(!e)try{e=!d(f,b++,c)}catch(g){return void a.onError(g)}e&&a.onNext(f)},function(b){a.onError(b)},function(){a.onCompleted()})},c)},Gb.take=function(a,b){if(0>a)throw new Ba;if(0===a)return dc(b);var c=this;return new Yc(function(b){var d=a;return c.subscribe(function(a){d-->0&&(b.onNext(a),0>=d&&b.onCompleted())},function(a){b.onError(a)},function(){b.onCompleted()})},c)},Gb.takeWhile=function(a,b){var c=this,d=La(a,b,3);return new Yc(function(a){var b=0,e=!0;return c.subscribe(function(f){if(e){try{e=d(f,b++,c)}catch(g){return void a.onError(g)}e?a.onNext(f):a.onCompleted()}},function(b){a.onError(b)},function(){a.onCompleted()})},c)};var Nc=function(a){function b(b,c,d){this.source=b,this.predicate=La(c,d,3),a.call(this)}function c(a,b){return function(c,d,e){return b.predicate(c,d,e)&&a.call(this,c,d,e)}}function d(a,b,c){this.o=a,this.predicate=b,this.source=c,this.i=0,this.isStopped=!1}return kb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new d(a,this.predicate,this))},b.prototype.internalFilter=function(a,d){return new b(this.source,c(a,this),d)},d.prototype.onNext=function(a){if(!this.isStopped){var b=ta(this.predicate)(a,this.i++,this.source);return b===sa?this.o.onError(b.e):void(b&&this.o.onNext(a))}},d.prototype.onError=function(a){this.isStopped||(this.isStopped=!0,this.o.onError(a))},d.prototype.onCompleted=function(){this.isStopped||(this.isStopped=!0,this.o.onCompleted())},d.prototype.dispose=function(){this.isStopped=!0},d.prototype.fail=function(a){return this.isStopped?!1:(this.isStopped=!0,this.o.onError(a),!0)},b}(Sb);Gb.filter=Gb.where=function(a,b){return this instanceof Nc?this.internalFilter(a,b):new Nc(this,a,b)},Qb.fromCallback=function(a,b,c){return function(){"undefined"==typeof b&&(b=this);for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return J(a,b,c,e)}},Qb.fromNodeCallback=function(a,b,c){return function(){"undefined"==typeof b&&(b=this);for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];return L(a,b,c,e)}},N.prototype.dispose=function(){this.isDisposed||(this._e.removeEventListener(this._n,this._fn,!1),this.isDisposed=!0)},ja.config.useNativeEvents=!1,Qb.fromEvent=function(a,b,c){return a.addListener?Oc(function(c){a.addListener(b,c)},function(c){a.removeListener(b,c)},c):ja.config.useNativeEvents||"function"!=typeof a.on||"function"!=typeof a.off?new Yc(function(d){return O(a,b,P(d,c))}).publish().refCount():Oc(function(c){a.on(b,c)},function(c){a.off(b,c)},c)};var Oc=Qb.fromEventPattern=function(a,b,c,d){return yb(d)||(d=Bb),new Yc(function(d){function e(){var a=arguments[0];return ra(c)&&(a=ta(c).apply(null,arguments),a===sa)?d.onError(a.e):void d.onNext(a)}var f=a(e);return pb(function(){ra(b)&&b(e,f)})}).publish().refCount()},Pc=function(a){function b(b){this.p=b,a.call(this)}return kb(b,a),b.prototype.subscribeCore=function(a){return this.p.then(function(b){a.onNext(b),a.onCompleted()},function(b){a.onError(b)}),qb},b}(Sb),Qc=Qb.fromPromise=function(a){return new Pc(a)};Gb.toPromise=function(a){if(a||(a=ja.config.Promise),!a)throw new Ca("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d,e=!1;b.subscribe(function(a){d=a,e=!0},c,function(){e&&a(d)})})},Qb.startAsync=function(a){var b;try{b=a()}catch(c){return tc(c)}return Qc(b)},Gb.multicast=function(a,b){var c=this;return"function"==typeof a?new Yc(function(d){var e=c.multicast(a());return new mb(b(e).subscribe(d),e.connect())},c):new Rc(c,a)},Gb.publish=function(a){return a&&ra(a)?this.multicast(function(){return new _c},a):this.multicast(new _c)},Gb.share=function(){return this.publish().refCount()},Gb.publishLast=function(a){return a&&ra(a)?this.multicast(function(){return new ad},a):this.multicast(new ad)},Gb.publishValue=function(a,b){return 2===arguments.length?this.multicast(function(){return new cd(b)},a):this.multicast(new cd(a))},Gb.shareValue=function(a){return this.publishValue(a).refCount()},Gb.replay=function(a,b,c,d){return a&&ra(a)?this.multicast(function(){return new dd(b,c,d)},a):this.multicast(new dd(b,c,d))},Gb.shareReplay=function(a,b,c){return this.replay(null,a,b,c).refCount()};var Rc=ja.ConnectableObservable=function(a){function b(b,c){var d,e=!1,f=b.asObservable();this.connect=function(){return e||(e=!0,d=new mb(f.subscribe(c),pb(function(){e=!1}))),d},a.call(this,function(a){return c.subscribe(a)})}return kb(b,a),b.prototype.refCount=function(){var a,b=0,c=this;return new Yc(function(d){var e=1===++b,f=c.subscribe(d);return e&&(a=c.connect()),function(){f.dispose(),0===--b&&a.dispose()}})},b}(Qb),Sc=Qb.interval=function(a,b){return T(a,a,yb(b)?b:Hb)};Qb.timer=function(b,c,d){var e;return yb(d)||(d=Hb),null!=c&&"number"==typeof c?e=c:yb(c)&&(d=c),b instanceof Date&&e===a?Q(b.getTime(),d):b instanceof Date&&e!==a?R(b.getTime(),c,d):e===a?S(b,d):T(b,e,d)};Gb.delay=function(){if("number"==typeof arguments[0]||arguments[0]instanceof Date){var a=arguments[0],b=arguments[1];return yb(b)||(b=Hb),a instanceof Date?V(this,a,b):U(this,a,b)}if(ra(arguments[0]))return W(this,arguments[0],arguments[1]);throw new Error("Invalid arguments")},Gb.debounce=function(){if(ra(arguments[0]))return Y(this,arguments[0]);if("number"==typeof arguments[0])return X(this,arguments[0],arguments[1]);throw new Error("Invalid arguments")},Gb.timestamp=function(a){return yb(a)||(a=Hb),this.map(function(b){return{value:b,timestamp:a.now()}})},Gb.sample=Gb.throttleLatest=function(a,b){return yb(b)||(b=Hb),"number"==typeof a?Z(this,Sc(a,b)):Z(this,a)};var Tc=ja.TimeoutError=function(a){this.message=a||"Timeout has occurred",this.name="TimeoutError",Error.call(this)};Tc.prototype=Object.create(Error.prototype),Gb.timeout=function(){var a=arguments[0];if(a instanceof Date||"number"==typeof a)return _(this,a,arguments[1],arguments[2]);if(Qb.isObservable(a)||ra(a))return $(this,a,arguments[1],arguments[2]);throw new Error("Invalid arguments")},Gb.throttle=function(a,b){yb(b)||(b=Hb);var c=+a||0;if(0>=c)throw new RangeError("windowDuration cannot be less or equal zero.");var d=this;return new Yc(function(a){var e=0;return d.subscribe(function(d){var f=b.now();(0===e||f-e>=c)&&(e=f,a.onNext(d))},function(b){a.onError(b)},function(){a.onCompleted()})},d)};var Uc=function(a){function b(a){var b=this.source.publish(),c=b.subscribe(a),d=qb,e=this.pauser.distinctUntilChanged().subscribe(function(a){a?d=b.connect():(d.dispose(),d=qb)});return new mb(c,d,e)}function c(c,d){this.source=c,this.controller=new _c,d&&d.subscribe?this.pauser=this.controller.merge(d):this.pauser=this.controller,a.call(this,b,c)}return kb(c,a),c.prototype.pause=function(){this.controller.onNext(!1)},c.prototype.resume=function(){this.controller.onNext(!0)},c}(Qb);Gb.pausable=function(a){return new Uc(this,a)};var Vc=function(b){function c(b){function c(){for(;e.length>0;)b.onNext(e.shift())}var d,e=[],f=aa(this.source,this.pauser.startWith(!1).distinctUntilChanged(),function(a,b){return{data:a,shouldFire:b}}).subscribe(function(f){ +d!==a&&f.shouldFire!=d?(d=f.shouldFire,f.shouldFire&&c()):(d=f.shouldFire,f.shouldFire?b.onNext(f.data):e.push(f.data))},function(a){c(),b.onError(a)},function(){c(),b.onCompleted()});return f}function d(a,d){this.source=a,this.controller=new _c,d&&d.subscribe?this.pauser=this.controller.merge(d):this.pauser=this.controller,b.call(this,c,a)}return kb(d,b),d.prototype.pause=function(){this.controller.onNext(!1)},d.prototype.resume=function(){this.controller.onNext(!0)},d}(Qb);Gb.pausableBuffered=function(a){return new Vc(this,a)};var Wc=function(a){function b(a){return this.source.subscribe(a)}function c(c,d,e){a.call(this,b,c),this.subject=new Xc(d,e),this.source=c.multicast(this.subject).refCount()}return kb(c,a),c.prototype.request=function(a){return this.subject.request(null==a?-1:a)},c}(Qb),Xc=function(a){function b(a){return this.subject.subscribe(a)}function c(c,d){null==c&&(c=!0),a.call(this,b),this.subject=new _c,this.enableQueue=c,this.queue=c?[]:null,this.requestedCount=0,this.requestedDisposable=null,this.error=null,this.hasFailed=!1,this.hasCompleted=!1,this.scheduler=d||Cb}return kb(c,a),lb(c.prototype,Mb,{onCompleted:function(){this.hasCompleted=!0,this.enableQueue&&0!==this.queue.length?this.queue.push(Ib.createOnCompleted()):(this.subject.onCompleted(),this.disposeCurrentRequest())},onError:function(a){this.hasFailed=!0,this.error=a,this.enableQueue&&0!==this.queue.length?this.queue.push(Ib.createOnError(a)):(this.subject.onError(a),this.disposeCurrentRequest())},onNext:function(a){this.requestedCount<=0?this.enableQueue&&this.queue.push(Ib.createOnNext(a)):(0===this.requestedCount--&&this.disposeCurrentRequest(),this.subject.onNext(a))},_processRequest:function(a){if(this.enableQueue)for(;this.queue.length>0&&(a>0||"N"!==this.queue[0].kind);){var b=this.queue.shift();b.accept(this.subject),"N"===b.kind?a--:(this.disposeCurrentRequest(),this.queue=[])}return a},request:function(a){this.disposeCurrentRequest();var b=this;return this.requestedDisposable=this.scheduler.scheduleWithState(a,function(a,c){var d=b._processRequest(c),e=b.hasCompleted||b.hasFailed;return!e&&d>0?(b.requestedCount=d,pb(function(){b.requestedCount=0})):void 0}),this.requestedDisposable},disposeCurrentRequest:function(){this.requestedDisposable&&(this.requestedDisposable.dispose(),this.requestedDisposable=null)}}),c}(Qb);Gb.controlled=function(a,b){return a&&yb(a)&&(b=a,a=!0),null==a&&(a=!0),new Wc(this,a,b)},Gb.pipe=function(a){function b(){c.resume()}var c=this.pausableBuffered();return a.addListener("drain",b),c.subscribe(function(b){!a.write(String(b))&&c.pause()},function(b){a.emit("error",b)},function(){!a._isStdio&&a.end(),a.removeListener("drain",b)}),c.resume(),a},Gb.transduce=function(a){function b(a){return{"@@transducer/init":function(){return a},"@@transducer/step":function(a,b){return a.onNext(b)},"@@transducer/result":function(a){return a.onCompleted()}}}var c=this;return new Yc(function(d){var e=a(b(d));return c.subscribe(function(a){var b=ta(e["@@transducer/step"]).call(e,d,a);b===sa&&d.onError(b.e)},function(a){d.onError(a)},function(){e["@@transducer/result"](d)})},c)};var Yc=ja.AnonymousObservable=function(a){function b(a){return a&&ra(a.dispose)?a:ra(a)?pb(a):qb}function c(a,c){var e=c[0],f=c[1],g=ta(f.__subscribe).call(f,e);return g!==sa||e.fail(sa.e)?void e.setDisposable(b(g)):d(sa.e)}function e(a){var b=new Zc(a),d=[b,this];return Cb.scheduleRequired()?Cb.scheduleWithState(d,c):c(null,d),b}function f(b,c){this.source=c,this.__subscribe=b,a.call(this,e)}return kb(f,a),f}(Qb),Zc=function(a){function b(b){a.call(this),this.observer=b,this.m=new tb}kb(b,a);var c=b.prototype;return c.next=function(a){var b=ta(this.observer.onNext).call(this.observer,a);b===sa&&(this.dispose(),d(b.e))},c.error=function(a){var b=ta(this.observer.onError).call(this.observer,a);this.dispose(),b===sa&&d(b.e)},c.completed=function(){var a=ta(this.observer.onCompleted).call(this.observer);this.dispose(),a===sa&&d(a.e)},c.setDisposable=function(a){this.m.setDisposable(a)},c.getDisposable=function(){return this.m.getDisposable()},c.dispose=function(){a.prototype.dispose.call(this),this.m.dispose()},b}(Ob),$c=function(a,b){this.subject=a,this.observer=b};$c.prototype.dispose=function(){if(!this.subject.isDisposed&&null!==this.observer){var a=this.subject.observers.indexOf(this.observer);this.subject.observers.splice(a,1),this.observer=null}};var _c=ja.Subject=function(a){function c(a){return sb(this),this.isStopped?this.hasError?(a.onError(this.error),qb):(a.onCompleted(),qb):(this.observers.push(a),new $c(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.observers=[],this.hasError=!1}return kb(d,a),lb(d.prototype,Mb.prototype,{hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(sb(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(sb(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(sb(this),!this.isStopped)for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)},dispose:function(){this.isDisposed=!0,this.observers=null}}),d.create=function(a,b){return new bd(a,b)},d}(Qb),ad=ja.AsyncSubject=function(a){function c(a){return sb(this),this.isStopped?(this.hasError?a.onError(this.error):this.hasValue?(a.onNext(this.value),a.onCompleted()):a.onCompleted(),qb):(this.observers.push(a),new $c(this,a))}function d(){a.call(this,c),this.isDisposed=!1,this.isStopped=!1,this.hasValue=!1,this.observers=[],this.hasError=!1}return kb(d,a),lb(d.prototype,Mb,{hasObservers:function(){return sb(this),this.observers.length>0},onCompleted:function(){var a,c;if(sb(this),!this.isStopped){this.isStopped=!0;var d=b(this.observers),c=d.length;if(this.hasValue)for(a=0;c>a;a++){var e=d[a];e.onNext(this.value),e.onCompleted()}else for(a=0;c>a;a++)d[a].onCompleted();this.observers.length=0}},onError:function(a){if(sb(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){sb(this),this.isStopped||(this.value=a,this.hasValue=!0)},dispose:function(){this.isDisposed=!0,this.observers=null,this.exception=null,this.value=null}}),d}(Qb),bd=ja.AnonymousSubject=function(a){function b(a){return this.observable.subscribe(a)}function c(c,d){this.observer=c,this.observable=d,a.call(this,b)}return kb(c,a),lb(c.prototype,Mb.prototype,{onCompleted:function(){this.observer.onCompleted()},onError:function(a){this.observer.onError(a)},onNext:function(a){this.observer.onNext(a)}}),c}(Qb),cd=ja.BehaviorSubject=function(a){function c(a){return sb(this),this.isStopped?(this.hasError?a.onError(this.error):a.onCompleted(),qb):(this.observers.push(a),a.onNext(this.value),new $c(this,a))}function d(b){a.call(this,c),this.value=b,this.observers=[],this.isDisposed=!1,this.isStopped=!1,this.hasError=!1}return kb(d,a),lb(d.prototype,Mb,{getValue:function(){if(sb(this),this.hasError)throw this.error;return this.value},hasObservers:function(){return this.observers.length>0},onCompleted:function(){if(sb(this),!this.isStopped){this.isStopped=!0;for(var a=0,c=b(this.observers),d=c.length;d>a;a++)c[a].onCompleted();this.observers.length=0}},onError:function(a){if(sb(this),!this.isStopped){this.isStopped=!0,this.hasError=!0,this.error=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onError(a);this.observers.length=0}},onNext:function(a){if(sb(this),!this.isStopped){this.value=a;for(var c=0,d=b(this.observers),e=d.length;e>c;c++)d[c].onNext(a)}},dispose:function(){this.isDisposed=!0,this.observers=null,this.value=null,this.exception=null}}),d}(Qb),dd=ja.ReplaySubject=function(a){function c(a,b){return pb(function(){b.dispose(),!a.isDisposed&&a.observers.splice(a.observers.indexOf(b),1)})}function d(a){var b=new Rb(this.scheduler,a),d=c(this,b);sb(this),this._trim(this.scheduler.now()),this.observers.push(b);for(var e=0,f=this.q.length;f>e;e++)b.onNext(this.q[e].value);return this.hasError?b.onError(this.error):this.isStopped&&b.onCompleted(),b.ensureActive(),d}function e(b,c,e){this.bufferSize=null==b?f:b,this.windowSize=null==c?f:c,this.scheduler=e||Cb,this.q=[],this.observers=[],this.isStopped=!1,this.isDisposed=!1,this.hasError=!1,this.error=null,a.call(this,d)}var f=Math.pow(2,53)-1;return kb(e,a),lb(e.prototype,Mb.prototype,{hasObservers:function(){return this.observers.length>0},_trim:function(a){for(;this.q.length>this.bufferSize;)this.q.shift();for(;this.q.length>0&&a-this.q[0].interval>this.windowSize;)this.q.shift()},onNext:function(a){if(sb(this),!this.isStopped){var c=this.scheduler.now();this.q.push({interval:c,value:a}),this._trim(c);for(var d=0,e=b(this.observers),f=e.length;f>d;d++){var g=e[d];g.onNext(a),g.ensureActive()}}},onError:function(a){if(sb(this),!this.isStopped){this.isStopped=!0,this.error=a,this.hasError=!0;var c=this.scheduler.now();this._trim(c);for(var d=0,e=b(this.observers),f=e.length;f>d;d++){var g=e[d];g.onError(a),g.ensureActive()}this.observers.length=0}},onCompleted:function(){if(sb(this),!this.isStopped){this.isStopped=!0;var a=this.scheduler.now();this._trim(a);for(var c=0,d=b(this.observers),e=d.length;e>c;c++){var f=d[c];f.onCompleted(),f.ensureActive()}this.observers.length=0}},dispose:function(){this.isDisposed=!0,this.observers=null}}),e}(Qb);ja.Pauser=function(a){function b(){a.call(this)}return kb(b,a),b.prototype.pause=function(){this.onNext(!1)},b.prototype.resume=function(){this.onNext(!0)},b}(_c),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(ia.Rx=ja,define(function(){return ja})):ca&&fa?ga?(fa.exports=ja).Rx=ja:ca.Rx=ja:ia.Rx=ja;var ed=i()}).call(this); +//# sourceMappingURL=rx.lite.map \ No newline at end of file diff --git a/tools/eslint/node_modules/shelljs/LICENSE b/tools/eslint/node_modules/shelljs/LICENSE new file mode 100644 index 00000000000000..be169d8d61bb6c --- /dev/null +++ b/tools/eslint/node_modules/shelljs/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2012, Artur Adib +All rights reserved. + +You may use this project under the terms of the New BSD license as follows: + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Artur Adib nor the + names of the contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL ARTUR ADIB BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/eslint/node_modules/shelljs/MAINTAINERS b/tools/eslint/node_modules/shelljs/MAINTAINERS new file mode 100644 index 00000000000000..3f94761505a94b --- /dev/null +++ b/tools/eslint/node_modules/shelljs/MAINTAINERS @@ -0,0 +1,3 @@ +Ari Porad (@ariporad) +Nate Fischer (@nfischer) +Artur Adib (@arturadib) diff --git a/tools/eslint/node_modules/shelljs/README.md b/tools/eslint/node_modules/shelljs/README.md new file mode 100644 index 00000000000000..d6dcb63408653a --- /dev/null +++ b/tools/eslint/node_modules/shelljs/README.md @@ -0,0 +1,658 @@ +# ShellJS - Unix shell commands for Node.js + +[![Join the chat at https://gitter.im/shelljs/shelljs](https://badges.gitter.im/shelljs/shelljs.svg)](https://gitter.im/shelljs/shelljs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Build Status](https://travis-ci.org/shelljs/shelljs.svg?branch=master)](http://travis-ci.org/shelljs/shelljs) +[![Build status](https://ci.appveyor.com/api/projects/status/42txr0s3ux5wbumv/branch/master?svg=true)](https://ci.appveyor.com/project/shelljs/shelljs) + +ShellJS is a portable **(Windows/Linux/OS X)** implementation of Unix shell commands on top of the Node.js API. You can use it to eliminate your shell script's dependency on Unix while still keeping its familiar and powerful commands. You can also install it globally so you can run it from outside Node projects - say goodbye to those gnarly Bash scripts! + +The project is [unit-tested](http://travis-ci.org/shelljs/shelljs) and battled-tested in projects like: + ++ [PDF.js](http://github.com/mozilla/pdf.js) - Firefox's next-gen PDF reader ++ [Firebug](http://getfirebug.com/) - Firefox's infamous debugger ++ [JSHint](http://jshint.com) - Most popular JavaScript linter ++ [Zepto](http://zeptojs.com) - jQuery-compatible JavaScript library for modern browsers ++ [Yeoman](http://yeoman.io/) - Web application stack and development tool ++ [Deployd.com](http://deployd.com) - Open source PaaS for quick API backend generation + +and [many more](https://npmjs.org/browse/depended/shelljs). + +If you have feedback, suggestions, or need help, feel free to post in our [issue tracker](https://github.com/shelljs/shelljs/issues). + +## Installing + +Via npm: + +```bash +$ npm install [-g] shelljs +``` + +If the global option `-g` is specified, the binary `shjs` will be installed. This makes it possible to +run ShellJS scripts much like any shell script from the command line, i.e. without requiring a `node_modules` folder: + +```bash +$ shjs my_script +``` + +## Examples + +### JavaScript + +```javascript +require('shelljs/global'); + +if (!which('git')) { + echo('Sorry, this script requires git'); + exit(1); +} + +// Copy files to release dir +mkdir('-p', 'out/Release'); +cp('-R', 'stuff/*', 'out/Release'); + +// Replace macros in each .js file +cd('lib'); +ls('*.js').forEach(function(file) { + sed('-i', 'BUILD_VERSION', 'v0.1.2', file); + sed('-i', /.*REMOVE_THIS_LINE.*\n/, '', file); + sed('-i', /.*REPLACE_LINE_WITH_MACRO.*\n/, cat('macro.js'), file); +}); +cd('..'); + +// Run external tool synchronously +if (exec('git commit -am "Auto-commit"').code !== 0) { + echo('Error: Git commit failed'); + exit(1); +} +``` + +### CoffeeScript + +CoffeeScript is also supported automatically: + +```coffeescript +require 'shelljs/global' + +if not which 'git' + echo 'Sorry, this script requires git' + exit 1 + +# Copy files to release dir +mkdir '-p', 'out/Release' +cp '-R', 'stuff/*', 'out/Release' + +# Replace macros in each .js file +cd 'lib' +for file in ls '*.js' + sed '-i', 'BUILD_VERSION', 'v0.1.2', file + sed '-i', /.*REMOVE_THIS_LINE.*\n/, '', file + sed '-i', /.*REPLACE_LINE_WITH_MACRO.*\n/, cat('macro.js'), file +cd '..' + +# Run external tool synchronously +if (exec 'git commit -am "Auto-commit"').code != 0 + echo 'Error: Git commit failed' + exit 1 +``` + +## Global vs. Local + +The example above uses the convenience script `shelljs/global` to reduce verbosity. If polluting your global namespace is not desirable, simply require `shelljs`. + +Example: + +```javascript +var shell = require('shelljs'); +shell.echo('hello world'); +``` + +## Make tool + +A convenience script `shelljs/make` is also provided to mimic the behavior of a Unix Makefile. +In this case all shell objects are global, and command line arguments will cause the script to +execute only the corresponding function in the global `target` object. To avoid redundant calls, +target functions are executed only once per script. + +Example: + +```javascript +require('shelljs/make'); + +target.all = function() { + target.bundle(); + target.docs(); +}; + +target.bundle = function() { + cd(__dirname); + mkdir('-p', 'build'); + cd('src'); + cat('*.js').to('../build/output.js'); +}; + +target.docs = function() { + cd(__dirname); + mkdir('-p', 'docs'); + var files = ls('src/*.js'); + for(var i = 0; i < files.length; i++) { + var text = grep('//@', files[i]); // extract special comments + text = text.replace(/\/\/@/g, ''); // remove comment tags + text.toEnd('docs/my_docs.md'); + } +}; +``` + +To run the target `all`, call the above script without arguments: `$ node make`. To run the target `docs`: `$ node make docs`. + +You can also pass arguments to your targets by using the `--` separator. For example, to pass `arg1` and `arg2` to a target `bundle`, do `$ node make bundle -- arg1 arg2`: + +```javascript +require('shelljs/make'); + +target.bundle = function(argsArray) { + // argsArray = ['arg1', 'arg2'] + /* ... */ +} +``` + + + + + +## Command reference + + +All commands run synchronously, unless otherwise stated. + + +### cd([dir]) +Changes to directory `dir` for the duration of the script. Changes to home +directory if no argument is supplied. + + +### pwd() +Returns the current directory. + + +### ls([options,] [path, ...]) +### ls([options,] path_array) +Available options: + ++ `-R`: recursive ++ `-A`: all files (include files beginning with `.`, except for `.` and `..`) ++ `-d`: list directories themselves, not their contents ++ `-l`: list objects representing each file, each with fields containing `ls + -l` output fields. See + [fs.Stats](https://nodejs.org/api/fs.html#fs_class_fs_stats) + for more info + +Examples: + +```javascript +ls('projs/*.js'); +ls('-R', '/users/me', '/tmp'); +ls('-R', ['/users/me', '/tmp']); // same as above +ls('-l', 'file.txt'); // { name: 'file.txt', mode: 33188, nlink: 1, ...} +``` + +Returns array of files in the given path, or in current directory if no path provided. + + +### find(path [, path ...]) +### find(path_array) +Examples: + +```javascript +find('src', 'lib'); +find(['src', 'lib']); // same as above +find('.').filter(function(file) { return file.match(/\.js$/); }); +``` + +Returns array of all files (however deep) in the given paths. + +The main difference from `ls('-R', path)` is that the resulting file names +include the base directories, e.g. `lib/resources/file1` instead of just `file1`. + + +### cp([options,] source [, source ...], dest) +### cp([options,] source_array, dest) +Available options: + ++ `-f`: force (default behavior) ++ `-n`: no-clobber ++ `-r, -R`: recursive + +Examples: + +```javascript +cp('file1', 'dir1'); +cp('-Rf', '/tmp/*', '/usr/local/*', '/home/tmp'); +cp('-Rf', ['/tmp/*', '/usr/local/*'], '/home/tmp'); // same as above +``` + +Copies files. The wildcard `*` is accepted. + + +### rm([options,] file [, file ...]) +### rm([options,] file_array) +Available options: + ++ `-f`: force ++ `-r, -R`: recursive + +Examples: + +```javascript +rm('-rf', '/tmp/*'); +rm('some_file.txt', 'another_file.txt'); +rm(['some_file.txt', 'another_file.txt']); // same as above +``` + +Removes files. The wildcard `*` is accepted. + + +### mv([options ,] source [, source ...], dest') +### mv([options ,] source_array, dest') +Available options: + ++ `-f`: force (default behavior) ++ `-n`: no-clobber + +Examples: + +```javascript +mv('-n', 'file', 'dir/'); +mv('file1', 'file2', 'dir/'); +mv(['file1', 'file2'], 'dir/'); // same as above +``` + +Moves files. The wildcard `*` is accepted. + + +### mkdir([options,] dir [, dir ...]) +### mkdir([options,] dir_array) +Available options: + ++ `-p`: full path (will create intermediate dirs if necessary) + +Examples: + +```javascript +mkdir('-p', '/tmp/a/b/c/d', '/tmp/e/f/g'); +mkdir('-p', ['/tmp/a/b/c/d', '/tmp/e/f/g']); // same as above +``` + +Creates directories. + + +### test(expression) +Available expression primaries: + ++ `'-b', 'path'`: true if path is a block device ++ `'-c', 'path'`: true if path is a character device ++ `'-d', 'path'`: true if path is a directory ++ `'-e', 'path'`: true if path exists ++ `'-f', 'path'`: true if path is a regular file ++ `'-L', 'path'`: true if path is a symbolic link ++ `'-p', 'path'`: true if path is a pipe (FIFO) ++ `'-S', 'path'`: true if path is a socket + +Examples: + +```javascript +if (test('-d', path)) { /* do something with dir */ }; +if (!test('-f', path)) continue; // skip if it's a regular file +``` + +Evaluates expression using the available primaries and returns corresponding value. + + +### cat(file [, file ...]) +### cat(file_array) + +Examples: + +```javascript +var str = cat('file*.txt'); +var str = cat('file1', 'file2'); +var str = cat(['file1', 'file2']); // same as above +``` + +Returns a string containing the given file, or a concatenated string +containing the files if more than one file is given (a new line character is +introduced between each file). Wildcard `*` accepted. + + +### 'string'.to(file) + +Examples: + +```javascript +cat('input.txt').to('output.txt'); +``` + +Analogous to the redirection operator `>` in Unix, but works with JavaScript strings (such as +those returned by `cat`, `grep`, etc). _Like Unix redirections, `to()` will overwrite any existing file!_ + + +### 'string'.toEnd(file) + +Examples: + +```javascript +cat('input.txt').toEnd('output.txt'); +``` + +Analogous to the redirect-and-append operator `>>` in Unix, but works with JavaScript strings (such as +those returned by `cat`, `grep`, etc). + + +### sed([options,] search_regex, replacement, file [, file ...]) +### sed([options,] search_regex, replacement, file_array) +Available options: + ++ `-i`: Replace contents of 'file' in-place. _Note that no backups will be created!_ + +Examples: + +```javascript +sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js'); +sed(/.*DELETE_THIS_LINE.*\n/, '', 'source.js'); +``` + +Reads an input string from `files` and performs a JavaScript `replace()` on the input +using the given search regex and replacement string or function. Returns the new string after replacement. + + +### grep([options,] regex_filter, file [, file ...]) +### grep([options,] regex_filter, file_array) +Available options: + ++ `-v`: Inverse the sense of the regex and print the lines not matching the criteria. + +Examples: + +```javascript +grep('-v', 'GLOBAL_VARIABLE', '*.js'); +grep('GLOBAL_VARIABLE', '*.js'); +``` + +Reads input string from given files and returns a string containing all lines of the +file that match the given `regex_filter`. Wildcard `*` accepted. + + +### which(command) + +Examples: + +```javascript +var nodeExec = which('node'); +``` + +Searches for `command` in the system's PATH. On Windows, this uses the +`PATHEXT` variable to append the extension if it's not already executable. +Returns string containing the absolute path to the command. + + +### echo(string [, string ...]) + +Examples: + +```javascript +echo('hello world'); +var str = echo('hello world'); +``` + +Prints string to stdout, and returns string with additional utility methods +like `.to()`. + + +### pushd([options,] [dir | '-N' | '+N']) + +Available options: + ++ `-n`: Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated. + +Arguments: + ++ `dir`: Makes the current working directory be the top of the stack, and then executes the equivalent of `cd dir`. ++ `+N`: Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. ++ `-N`: Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. + +Examples: + +```javascript +// process.cwd() === '/usr' +pushd('/etc'); // Returns /etc /usr +pushd('+1'); // Returns /usr /etc +``` + +Save the current directory on the top of the directory stack and then cd to `dir`. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack. + +### popd([options,] ['-N' | '+N']) + +Available options: + ++ `-n`: Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated. + +Arguments: + ++ `+N`: Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero. ++ `-N`: Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero. + +Examples: + +```javascript +echo(process.cwd()); // '/usr' +pushd('/etc'); // '/etc /usr' +echo(process.cwd()); // '/etc' +popd(); // '/usr' +echo(process.cwd()); // '/usr' +``` + +When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack. + +### dirs([options | '+N' | '-N']) + +Available options: + ++ `-c`: Clears the directory stack by deleting all of the elements. + +Arguments: + ++ `+N`: Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero. ++ `-N`: Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero. + +Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified. + +See also: pushd, popd + + +### ln([options,] source, dest) +Available options: + ++ `-s`: symlink ++ `-f`: force + +Examples: + +```javascript +ln('file', 'newlink'); +ln('-sf', 'file', 'existing'); +``` + +Links source to dest. Use -f to force the link, should dest already exist. + + +### exit(code) +Exits the current process with the given exit code. + +### env['VAR_NAME'] +Object containing environment variables (both getter and setter). Shortcut to process.env. + +### exec(command [, options] [, callback]) +Available options (all `false` by default): + ++ `async`: Asynchronous execution. If a callback is provided, it will be set to + `true`, regardless of the passed value. ++ `silent`: Do not echo program output to console. ++ and any option available to NodeJS's + [child_process.exec()](https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback) + +Examples: + +```javascript +var version = exec('node --version', {silent:true}).stdout; + +var child = exec('some_long_running_process', {async:true}); +child.stdout.on('data', function(data) { + /* ... do something with data ... */ +}); + +exec('some_long_running_process', function(code, stdout, stderr) { + console.log('Exit code:', code); + console.log('Program output:', stdout); + console.log('Program stderr:', stderr); +}); +``` + +Executes the given `command` _synchronously_, unless otherwise specified. When in synchronous +mode returns the object `{ code:..., stdout:... , stderr:... }`, containing the program's +`stdout`, `stderr`, and its exit `code`. Otherwise returns the child process object, +and the `callback` gets the arguments `(code, stdout, stderr)`. + +**Note:** For long-lived processes, it's best to run `exec()` asynchronously as +the current synchronous implementation uses a lot of CPU. This should be getting +fixed soon. + + +### chmod(octal_mode || octal_string, file) +### chmod(symbolic_mode, file) + +Available options: + ++ `-v`: output a diagnostic for every file processed ++ `-c`: like verbose but report only when a change is made ++ `-R`: change files and directories recursively + +Examples: + +```javascript +chmod(755, '/Users/brandon'); +chmod('755', '/Users/brandon'); // same as above +chmod('u+x', '/Users/brandon'); +``` + +Alters the permissions of a file or directory by either specifying the +absolute permissions in octal form or expressing the changes in symbols. +This command tries to mimic the POSIX behavior as much as possible. +Notable exceptions: + ++ In symbolic modes, 'a-r' and '-r' are identical. No consideration is + given to the umask. ++ There is no "quiet" option since default behavior is to run silent. + + +### touch([options,] file) +Available options: + ++ `-a`: Change only the access time ++ `-c`: Do not create any files ++ `-m`: Change only the modification time ++ `-d DATE`: Parse DATE and use it instead of current time ++ `-r FILE`: Use FILE's times instead of current time + +Examples: + +```javascript +touch('source.js'); +touch('-c', '/path/to/some/dir/source.js'); +touch({ '-r': FILE }, '/path/to/some/dir/source.js'); +``` + +Update the access and modification times of each FILE to the current time. +A FILE argument that does not exist is created empty, unless -c is supplied. +This is a partial implementation of *[touch(1)](http://linux.die.net/man/1/touch)*. + + +### set(options) +Available options: + ++ `+/-e`: exit upon error (`config.fatal`) ++ `+/-v`: verbose: show all commands (`config.verbose`) + +Examples: + +```javascript +set('-e'); // exit upon first error +set('+e'); // this undoes a "set('-e')" +``` + +Sets global configuration variables + + +## Non-Unix commands + + +### tempdir() + +Examples: + +```javascript +var tmp = tempdir(); // "/tmp" for most *nix platforms +``` + +Searches and returns string containing a writeable, platform-dependent temporary directory. +Follows Python's [tempfile algorithm](http://docs.python.org/library/tempfile.html#tempfile.tempdir). + + +### error() +Tests if error occurred in the last command. Returns `null` if no error occurred, +otherwise returns string explaining the error + + +## Configuration + + +### config.silent +Example: + +```javascript +var sh = require('shelljs'); +var silentState = sh.config.silent; // save old silent state +sh.config.silent = true; +/* ... */ +sh.config.silent = silentState; // restore old silent state +``` + +Suppresses all command output if `true`, except for `echo()` calls. +Default is `false`. + +### config.fatal +Example: + +```javascript +require('shelljs/global'); +config.fatal = true; // or set('-e'); +cp('this_file_does_not_exist', '/dev/null'); // dies here +/* more commands... */ +``` + +If `true` the script will die on errors. Default is `false`. This is +analogous to Bash's `set -e` + +### config.verbose +Example: + +```javascript +config.verbose = true; // or set('-v'); +cd('dir/'); +ls('subdir/'); +``` + +Will print each command as follows: + +``` +cd dir/ +ls subdir/ +``` diff --git a/tools/eslint/node_modules/shelljs/bin/shjs b/tools/eslint/node_modules/shelljs/bin/shjs new file mode 100755 index 00000000000000..aae3bc64ce2b68 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/bin/shjs @@ -0,0 +1,55 @@ +#!/usr/bin/env node +require('../global'); + +if (process.argv.length < 3) { + console.log('ShellJS: missing argument (script name)'); + console.log(); + process.exit(1); +} + +var args, + scriptName = process.argv[2]; +env['NODE_PATH'] = __dirname + '/../..'; + +if (!scriptName.match(/\.js/) && !scriptName.match(/\.coffee/)) { + if (test('-f', scriptName + '.js')) + scriptName += '.js'; + if (test('-f', scriptName + '.coffee')) + scriptName += '.coffee'; +} + +if (!test('-f', scriptName)) { + console.log('ShellJS: script not found ('+scriptName+')'); + console.log(); + process.exit(1); +} + +args = process.argv.slice(3); + +for (var i = 0, l = args.length; i < l; i++) { + if (args[i][0] !== "-"){ + args[i] = '"' + args[i] + '"'; // fixes arguments with multiple words + } +} + +if (scriptName.match(/\.coffee$/)) { + // + // CoffeeScript + // + if (which('coffee')) { + exec('coffee "' + scriptName + '" ' + args.join(' '), function(code) { + process.exit(code); + }); + } else { + console.log('ShellJS: CoffeeScript interpreter not found'); + console.log(); + process.exit(1); + } +} else { + // + // JavaScript + // + exec('node "' + scriptName + '" ' + args.join(' '), function(code) { + process.exit(code); + }); +} diff --git a/tools/eslint/node_modules/shelljs/build/output.js b/tools/eslint/node_modules/shelljs/build/output.js new file mode 100644 index 00000000000000..1b778b93183ee1 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/build/output.js @@ -0,0 +1,2411 @@ +var common = require('./common'); +var fs = require('fs'); + +//@ +//@ ### cat(file [, file ...]) +//@ ### cat(file_array) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var str = cat('file*.txt'); +//@ var str = cat('file1', 'file2'); +//@ var str = cat(['file1', 'file2']); // same as above +//@ ``` +//@ +//@ Returns a string containing the given file, or a concatenated string +//@ containing the files if more than one file is given (a new line character is +//@ introduced between each file). Wildcard `*` accepted. +function _cat(options, files) { + var cat = ''; + + if (!files) + common.error('no paths given'); + + if (typeof files === 'string') + files = [].slice.call(arguments, 1); + // if it's array leave it as it is + + files = common.expand(files); + + files.forEach(function(file) { + if (!fs.existsSync(file)) + common.error('no such file or directory: ' + file); + + cat += fs.readFileSync(file, 'utf8'); + }); + + return common.ShellString(cat); +} +module.exports = _cat; + +var fs = require('fs'); +var common = require('./common'); + +//@ +//@ ### cd([dir]) +//@ Changes to directory `dir` for the duration of the script. Changes to home +//@ directory if no argument is supplied. +function _cd(options, dir) { + if (!dir) + dir = common.getUserHome(); + + if (dir === '-') { + if (!common.state.previousDir) + common.error('could not find previous directory'); + else + dir = common.state.previousDir; + } + + if (!fs.existsSync(dir)) + common.error('no such file or directory: ' + dir); + + if (!fs.statSync(dir).isDirectory()) + common.error('not a directory: ' + dir); + + common.state.previousDir = process.cwd(); + process.chdir(dir); +} +module.exports = _cd; + +var common = require('./common'); +var fs = require('fs'); +var path = require('path'); + +var PERMS = (function (base) { + return { + OTHER_EXEC : base.EXEC, + OTHER_WRITE : base.WRITE, + OTHER_READ : base.READ, + + GROUP_EXEC : base.EXEC << 3, + GROUP_WRITE : base.WRITE << 3, + GROUP_READ : base.READ << 3, + + OWNER_EXEC : base.EXEC << 6, + OWNER_WRITE : base.WRITE << 6, + OWNER_READ : base.READ << 6, + + // Literal octal numbers are apparently not allowed in "strict" javascript. Using parseInt is + // the preferred way, else a jshint warning is thrown. + STICKY : parseInt('01000', 8), + SETGID : parseInt('02000', 8), + SETUID : parseInt('04000', 8), + + TYPE_MASK : parseInt('0770000', 8) + }; +})({ + EXEC : 1, + WRITE : 2, + READ : 4 +}); + +//@ +//@ ### chmod(octal_mode || octal_string, file) +//@ ### chmod(symbolic_mode, file) +//@ +//@ Available options: +//@ +//@ + `-v`: output a diagnostic for every file processed//@ +//@ + `-c`: like verbose but report only when a change is made//@ +//@ + `-R`: change files and directories recursively//@ +//@ +//@ Examples: +//@ +//@ ```javascript +//@ chmod(755, '/Users/brandon'); +//@ chmod('755', '/Users/brandon'); // same as above +//@ chmod('u+x', '/Users/brandon'); +//@ ``` +//@ +//@ Alters the permissions of a file or directory by either specifying the +//@ absolute permissions in octal form or expressing the changes in symbols. +//@ This command tries to mimic the POSIX behavior as much as possible. +//@ Notable exceptions: +//@ +//@ + In symbolic modes, 'a-r' and '-r' are identical. No consideration is +//@ given to the umask. +//@ + There is no "quiet" option since default behavior is to run silent. +function _chmod(options, mode, filePattern) { + if (!filePattern) { + if (options.length > 0 && options.charAt(0) === '-') { + // Special case where the specified file permissions started with - to subtract perms, which + // get picked up by the option parser as command flags. + // If we are down by one argument and options starts with -, shift everything over. + filePattern = mode; + mode = options; + options = ''; + } + else { + common.error('You must specify a file.'); + } + } + + options = common.parseOptions(options, { + 'R': 'recursive', + 'c': 'changes', + 'v': 'verbose' + }); + + if (typeof filePattern === 'string') { + filePattern = [ filePattern ]; + } + + var files; + + if (options.recursive) { + files = []; + common.expand(filePattern).forEach(function addFile(expandedFile) { + var stat = fs.lstatSync(expandedFile); + + if (!stat.isSymbolicLink()) { + files.push(expandedFile); + + if (stat.isDirectory()) { // intentionally does not follow symlinks. + fs.readdirSync(expandedFile).forEach(function (child) { + addFile(expandedFile + '/' + child); + }); + } + } + }); + } + else { + files = common.expand(filePattern); + } + + files.forEach(function innerChmod(file) { + file = path.resolve(file); + if (!fs.existsSync(file)) { + common.error('File not found: ' + file); + } + + // When recursing, don't follow symlinks. + if (options.recursive && fs.lstatSync(file).isSymbolicLink()) { + return; + } + + var stat = fs.statSync(file); + var isDir = stat.isDirectory(); + var perms = stat.mode; + var type = perms & PERMS.TYPE_MASK; + + var newPerms = perms; + + if (isNaN(parseInt(mode, 8))) { + // parse options + mode.split(',').forEach(function (symbolicMode) { + /*jshint regexdash:true */ + var pattern = /([ugoa]*)([=\+-])([rwxXst]*)/i; + var matches = pattern.exec(symbolicMode); + + if (matches) { + var applyTo = matches[1]; + var operator = matches[2]; + var change = matches[3]; + + var changeOwner = applyTo.indexOf('u') != -1 || applyTo === 'a' || applyTo === ''; + var changeGroup = applyTo.indexOf('g') != -1 || applyTo === 'a' || applyTo === ''; + var changeOther = applyTo.indexOf('o') != -1 || applyTo === 'a' || applyTo === ''; + + var changeRead = change.indexOf('r') != -1; + var changeWrite = change.indexOf('w') != -1; + var changeExec = change.indexOf('x') != -1; + var changeExecDir = change.indexOf('X') != -1; + var changeSticky = change.indexOf('t') != -1; + var changeSetuid = change.indexOf('s') != -1; + + if (changeExecDir && isDir) + changeExec = true; + + var mask = 0; + if (changeOwner) { + mask |= (changeRead ? PERMS.OWNER_READ : 0) + (changeWrite ? PERMS.OWNER_WRITE : 0) + (changeExec ? PERMS.OWNER_EXEC : 0) + (changeSetuid ? PERMS.SETUID : 0); + } + if (changeGroup) { + mask |= (changeRead ? PERMS.GROUP_READ : 0) + (changeWrite ? PERMS.GROUP_WRITE : 0) + (changeExec ? PERMS.GROUP_EXEC : 0) + (changeSetuid ? PERMS.SETGID : 0); + } + if (changeOther) { + mask |= (changeRead ? PERMS.OTHER_READ : 0) + (changeWrite ? PERMS.OTHER_WRITE : 0) + (changeExec ? PERMS.OTHER_EXEC : 0); + } + + // Sticky bit is special - it's not tied to user, group or other. + if (changeSticky) { + mask |= PERMS.STICKY; + } + + switch (operator) { + case '+': + newPerms |= mask; + break; + + case '-': + newPerms &= ~mask; + break; + + case '=': + newPerms = type + mask; + + // According to POSIX, when using = to explicitly set the permissions, setuid and setgid can never be cleared. + if (fs.statSync(file).isDirectory()) { + newPerms |= (PERMS.SETUID + PERMS.SETGID) & perms; + } + break; + } + + if (options.verbose) { + console.log(file + ' -> ' + newPerms.toString(8)); + } + + if (perms != newPerms) { + if (!options.verbose && options.changes) { + console.log(file + ' -> ' + newPerms.toString(8)); + } + fs.chmodSync(file, newPerms); + perms = newPerms; // for the next round of changes! + } + } + else { + common.error('Invalid symbolic mode change: ' + symbolicMode); + } + }); + } + else { + // they gave us a full number + newPerms = type + parseInt(mode, 8); + + // POSIX rules are that setuid and setgid can only be added using numeric form, but not cleared. + if (fs.statSync(file).isDirectory()) { + newPerms |= (PERMS.SETUID + PERMS.SETGID) & perms; + } + + fs.chmodSync(file, newPerms); + } + }); +} +module.exports = _chmod; + +var os = require('os'); +var fs = require('fs'); +var _ls = require('./ls'); + +// Module globals +var config = { + silent: false, + fatal: false, + verbose: false, +}; +exports.config = config; + +var state = { + error: null, + currentCmd: 'shell.js', + previousDir: null, + tempDir: null +}; +exports.state = state; + +var platform = os.type().match(/^Win/) ? 'win' : 'unix'; +exports.platform = platform; + +function log() { + if (!config.silent) + console.error.apply(console, arguments); +} +exports.log = log; + +// Shows error message. Throws unless _continue or config.fatal are true +function error(msg, _continue) { + if (state.error === null) + state.error = ''; + var log_entry = state.currentCmd + ': ' + msg; + if (state.error === '') + state.error = log_entry; + else + state.error += '\n' + log_entry; + + if (msg.length > 0) + log(log_entry); + + if (config.fatal) + process.exit(1); + + if (!_continue) + throw ''; +} +exports.error = error; + +// In the future, when Proxies are default, we can add methods like `.to()` to primitive strings. +// For now, this is a dummy function to bookmark places we need such strings +function ShellString(str) { + return str; +} +exports.ShellString = ShellString; + +// Return the home directory in a platform-agnostic way, with consideration for +// older versions of node +function getUserHome() { + var result; + if (os.homedir) + result = os.homedir(); // node 3+ + else + result = process.env[(process.platform === 'win32') ? 'USERPROFILE' : 'HOME']; + return result; +} +exports.getUserHome = getUserHome; + +// Returns {'alice': true, 'bob': false} when passed a dictionary, e.g.: +// parseOptions('-a', {'a':'alice', 'b':'bob'}); +function parseOptions(str, map) { + if (!map) + error('parseOptions() internal error: no map given'); + + // All options are false by default + var options = {}; + for (var letter in map) { + if (!map[letter].match('^!')) + options[map[letter]] = false; + } + + if (!str) + return options; // defaults + + if (typeof str !== 'string') + error('parseOptions() internal error: wrong str'); + + // e.g. match[1] = 'Rf' for str = '-Rf' + var match = str.match(/^\-(.+)/); + if (!match) + return options; + + // e.g. chars = ['R', 'f'] + var chars = match[1].split(''); + + var opt; + chars.forEach(function(c) { + if (c in map) { + opt = map[c]; + if (opt.match('^!')) + options[opt.slice(1, opt.length-1)] = false; + else + options[opt] = true; + } else { + error('option not recognized: '+c); + } + }); + + return options; +} +exports.parseOptions = parseOptions; + +// Expands wildcards with matching (ie. existing) file names. +// For example: +// expand(['file*.js']) = ['file1.js', 'file2.js', ...] +// (if the files 'file1.js', 'file2.js', etc, exist in the current dir) +function expand(list) { + var expanded = []; + list.forEach(function(listEl) { + // Wildcard present on directory names ? + if(listEl.search(/\*[^\/]*\//) > -1 || listEl.search(/\*\*[^\/]*\//) > -1) { + var match = listEl.match(/^([^*]+\/|)(.*)/); + var root = match[1]; + var rest = match[2]; + var restRegex = rest.replace(/\*\*/g, ".*").replace(/\*/g, "[^\\/]*"); + restRegex = new RegExp(restRegex); + + _ls('-R', root).filter(function (e) { + return restRegex.test(e); + }).forEach(function(file) { + expanded.push(file); + }); + } + // Wildcard present on file names ? + else if (listEl.search(/\*/) > -1) { + _ls('', listEl).forEach(function(file) { + expanded.push(file); + }); + } else { + expanded.push(listEl); + } + }); + return expanded; +} +exports.expand = expand; + +// Normalizes _unlinkSync() across platforms to match Unix behavior, i.e. +// file can be unlinked even if it's read-only, see https://github.com/joyent/node/issues/3006 +function unlinkSync(file) { + try { + fs.unlinkSync(file); + } catch(e) { + // Try to override file permission + if (e.code === 'EPERM') { + fs.chmodSync(file, '0666'); + fs.unlinkSync(file); + } else { + throw e; + } + } +} +exports.unlinkSync = unlinkSync; + +// e.g. 'shelljs_a5f185d0443ca...' +function randomFileName() { + function randomHash(count) { + if (count === 1) + return parseInt(16*Math.random(), 10).toString(16); + else { + var hash = ''; + for (var i=0; i and/or '); + } else if (arguments.length > 3) { + sources = [].slice.call(arguments, 1, arguments.length - 1); + dest = arguments[arguments.length - 1]; + } else if (typeof sources === 'string') { + sources = [sources]; + } else if ('length' in sources) { + sources = sources; // no-op for array + } else { + common.error('invalid arguments'); + } + + var exists = fs.existsSync(dest), + stats = exists && fs.statSync(dest); + + // Dest is not existing dir, but multiple sources given + if ((!exists || !stats.isDirectory()) && sources.length > 1) + common.error('dest is not a directory (too many sources)'); + + // Dest is an existing file, but no -f given + if (exists && stats.isFile() && options.no_force) + common.error('dest file already exists: ' + dest); + + if (options.recursive) { + // Recursive allows the shortcut syntax "sourcedir/" for "sourcedir/*" + // (see Github issue #15) + sources.forEach(function(src, i) { + if (src[src.length - 1] === '/') { + sources[i] += '*'; + // If src is a directory and dest doesn't exist, 'cp -r src dest' should copy src/* into dest + } else if (fs.statSync(src).isDirectory() && !exists) { + sources[i] += '/*'; + } + }); + + // Create dest + try { + fs.mkdirSync(dest, parseInt('0777', 8)); + } catch (e) { + // like Unix's cp, keep going even if we can't create dest dir + } + } + + sources = common.expand(sources); + + sources.forEach(function(src) { + if (!fs.existsSync(src)) { + common.error('no such file or directory: '+src, true); + return; // skip file + } + + // If here, src exists + if (fs.statSync(src).isDirectory()) { + if (!options.recursive) { + // Non-Recursive + common.log(src + ' is a directory (not copied)'); + } else { + // Recursive + // 'cp /a/source dest' should create 'source' in 'dest' + var newDest = path.join(dest, path.basename(src)), + checkDir = fs.statSync(src); + try { + fs.mkdirSync(newDest, checkDir.mode); + } catch (e) { + //if the directory already exists, that's okay + if (e.code !== 'EEXIST') { + common.error('dest file no such file or directory: ' + newDest, true); + throw e; + } + } + + cpdirSyncRecursive(src, newDest, {no_force: options.no_force}); + } + return; // done with dir + } + + // If here, src is a file + + // When copying to '/path/dir': + // thisDest = '/path/dir/file1' + var thisDest = dest; + if (fs.existsSync(dest) && fs.statSync(dest).isDirectory()) + thisDest = path.normalize(dest + '/' + path.basename(src)); + + if (fs.existsSync(thisDest) && options.no_force) { + common.error('dest file already exists: ' + thisDest, true); + return; // skip file + } + + copyFileSync(src, thisDest); + }); // forEach(src) +} +module.exports = _cp; + +var common = require('./common'); +var _cd = require('./cd'); +var path = require('path'); + +// Pushd/popd/dirs internals +var _dirStack = []; + +function _isStackIndex(index) { + return (/^[\-+]\d+$/).test(index); +} + +function _parseStackIndex(index) { + if (_isStackIndex(index)) { + if (Math.abs(index) < _dirStack.length + 1) { // +1 for pwd + return (/^-/).test(index) ? Number(index) - 1 : Number(index); + } else { + common.error(index + ': directory stack index out of range'); + } + } else { + common.error(index + ': invalid number'); + } +} + +function _actualDirStack() { + return [process.cwd()].concat(_dirStack); +} + +//@ +//@ ### pushd([options,] [dir | '-N' | '+N']) +//@ +//@ Available options: +//@ +//@ + `-n`: Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated. +//@ +//@ Arguments: +//@ +//@ + `dir`: Makes the current working directory be the top of the stack, and then executes the equivalent of `cd dir`. +//@ + `+N`: Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. +//@ + `-N`: Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. +//@ +//@ Examples: +//@ +//@ ```javascript +//@ // process.cwd() === '/usr' +//@ pushd('/etc'); // Returns /etc /usr +//@ pushd('+1'); // Returns /usr /etc +//@ ``` +//@ +//@ Save the current directory on the top of the directory stack and then cd to `dir`. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack. +function _pushd(options, dir) { + if (_isStackIndex(options)) { + dir = options; + options = ''; + } + + options = common.parseOptions(options, { + 'n' : 'no-cd' + }); + + var dirs = _actualDirStack(); + + if (dir === '+0') { + return dirs; // +0 is a noop + } else if (!dir) { + if (dirs.length > 1) { + dirs = dirs.splice(1, 1).concat(dirs); + } else { + return common.error('no other directory'); + } + } else if (_isStackIndex(dir)) { + var n = _parseStackIndex(dir); + dirs = dirs.slice(n).concat(dirs.slice(0, n)); + } else { + if (options['no-cd']) { + dirs.splice(1, 0, dir); + } else { + dirs.unshift(dir); + } + } + + if (options['no-cd']) { + dirs = dirs.slice(1); + } else { + dir = path.resolve(dirs.shift()); + _cd('', dir); + } + + _dirStack = dirs; + return _dirs(''); +} +exports.pushd = _pushd; + +//@ +//@ ### popd([options,] ['-N' | '+N']) +//@ +//@ Available options: +//@ +//@ + `-n`: Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated. +//@ +//@ Arguments: +//@ +//@ + `+N`: Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero. +//@ + `-N`: Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero. +//@ +//@ Examples: +//@ +//@ ```javascript +//@ echo(process.cwd()); // '/usr' +//@ pushd('/etc'); // '/etc /usr' +//@ echo(process.cwd()); // '/etc' +//@ popd(); // '/usr' +//@ echo(process.cwd()); // '/usr' +//@ ``` +//@ +//@ When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack. +function _popd(options, index) { + if (_isStackIndex(options)) { + index = options; + options = ''; + } + + options = common.parseOptions(options, { + 'n' : 'no-cd' + }); + + if (!_dirStack.length) { + return common.error('directory stack empty'); + } + + index = _parseStackIndex(index || '+0'); + + if (options['no-cd'] || index > 0 || _dirStack.length + index === 0) { + index = index > 0 ? index - 1 : index; + _dirStack.splice(index, 1); + } else { + var dir = path.resolve(_dirStack.shift()); + _cd('', dir); + } + + return _dirs(''); +} +exports.popd = _popd; + +//@ +//@ ### dirs([options | '+N' | '-N']) +//@ +//@ Available options: +//@ +//@ + `-c`: Clears the directory stack by deleting all of the elements. +//@ +//@ Arguments: +//@ +//@ + `+N`: Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero. +//@ + `-N`: Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero. +//@ +//@ Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified. +//@ +//@ See also: pushd, popd +function _dirs(options, index) { + if (_isStackIndex(options)) { + index = options; + options = ''; + } + + options = common.parseOptions(options, { + 'c' : 'clear' + }); + + if (options['clear']) { + _dirStack = []; + return _dirStack; + } + + var stack = _actualDirStack(); + + if (index) { + index = _parseStackIndex(index); + + if (index < 0) { + index = stack.length + index; + } + + common.log(stack[index]); + return stack[index]; + } + + common.log(stack.join(' ')); + + return stack; +} +exports.dirs = _dirs; + +var common = require('./common'); + +//@ +//@ ### echo(string [, string ...]) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ echo('hello world'); +//@ var str = echo('hello world'); +//@ ``` +//@ +//@ Prints string to stdout, and returns string with additional utility methods +//@ like `.to()`. +function _echo() { + var messages = [].slice.call(arguments, 0); + console.log.apply(console, messages); + return common.ShellString(messages.join(' ')); +} +module.exports = _echo; + +var common = require('./common'); + +//@ +//@ ### error() +//@ Tests if error occurred in the last command. Returns `null` if no error occurred, +//@ otherwise returns string explaining the error +function error() { + return common.state.error; +} +module.exports = error; + +var common = require('./common'); +var _tempDir = require('./tempdir'); +var _pwd = require('./pwd'); +var path = require('path'); +var fs = require('fs'); +var child = require('child_process'); + +// Hack to run child_process.exec() synchronously (sync avoids callback hell) +// Uses a custom wait loop that checks for a flag file, created when the child process is done. +// (Can't do a wait loop that checks for internal Node variables/messages as +// Node is single-threaded; callbacks and other internal state changes are done in the +// event loop). +function execSync(cmd, opts) { + var tempDir = _tempDir(); + var stdoutFile = path.resolve(tempDir+'/'+common.randomFileName()), + stderrFile = path.resolve(tempDir+'/'+common.randomFileName()), + codeFile = path.resolve(tempDir+'/'+common.randomFileName()), + scriptFile = path.resolve(tempDir+'/'+common.randomFileName()), + sleepFile = path.resolve(tempDir+'/'+common.randomFileName()); + + var options = common.extend({ + silent: common.config.silent + }, opts); + + var previousStdoutContent = '', + previousStderrContent = ''; + // Echoes stdout and stderr changes from running process, if not silent + function updateStream(streamFile) { + if (options.silent || !fs.existsSync(streamFile)) + return; + + var previousStreamContent, + proc_stream; + if (streamFile === stdoutFile) { + previousStreamContent = previousStdoutContent; + proc_stream = process.stdout; + } else { // assume stderr + previousStreamContent = previousStderrContent; + proc_stream = process.stderr; + } + + var streamContent = fs.readFileSync(streamFile, 'utf8'); + // No changes since last time? + if (streamContent.length <= previousStreamContent.length) + return; + + proc_stream.write(streamContent.substr(previousStreamContent.length)); + previousStreamContent = streamContent; + } + + function escape(str) { + return (str+'').replace(/([\\"'])/g, "\\$1").replace(/\0/g, "\\0"); + } + + if (fs.existsSync(scriptFile)) common.unlinkSync(scriptFile); + if (fs.existsSync(stdoutFile)) common.unlinkSync(stdoutFile); + if (fs.existsSync(stderrFile)) common.unlinkSync(stderrFile); + if (fs.existsSync(codeFile)) common.unlinkSync(codeFile); + + var execCommand = '"'+process.execPath+'" '+scriptFile; + var execOptions = { + env: process.env, + cwd: _pwd(), + maxBuffer: 20*1024*1024 + }; + + var script; + + if (typeof child.execSync === 'function') { + script = [ + "var child = require('child_process')", + " , fs = require('fs');", + "var childProcess = child.exec('"+escape(cmd)+"', {env: process.env, maxBuffer: 20*1024*1024}, function(err) {", + " fs.writeFileSync('"+escape(codeFile)+"', err ? err.code.toString() : '0');", + "});", + "var stdoutStream = fs.createWriteStream('"+escape(stdoutFile)+"');", + "var stderrStream = fs.createWriteStream('"+escape(stderrFile)+"');", + "childProcess.stdout.pipe(stdoutStream, {end: false});", + "childProcess.stderr.pipe(stderrStream, {end: false});", + "childProcess.stdout.pipe(process.stdout);", + "childProcess.stderr.pipe(process.stderr);", + "var stdoutEnded = false, stderrEnded = false;", + "function tryClosingStdout(){ if(stdoutEnded){ stdoutStream.end(); } }", + "function tryClosingStderr(){ if(stderrEnded){ stderrStream.end(); } }", + "childProcess.stdout.on('end', function(){ stdoutEnded = true; tryClosingStdout(); });", + "childProcess.stderr.on('end', function(){ stderrEnded = true; tryClosingStderr(); });" + ].join('\n'); + + fs.writeFileSync(scriptFile, script); + + if (options.silent) { + execOptions.stdio = 'ignore'; + } else { + execOptions.stdio = [0, 1, 2]; + } + + // Welcome to the future + child.execSync(execCommand, execOptions); + } else { + cmd += ' > '+stdoutFile+' 2> '+stderrFile; // works on both win/unix + + script = [ + "var child = require('child_process')", + " , fs = require('fs');", + "var childProcess = child.exec('"+escape(cmd)+"', {env: process.env, maxBuffer: 20*1024*1024}, function(err) {", + " fs.writeFileSync('"+escape(codeFile)+"', err ? err.code.toString() : '0');", + "});" + ].join('\n'); + + fs.writeFileSync(scriptFile, script); + + child.exec(execCommand, execOptions); + + // The wait loop + // sleepFile is used as a dummy I/O op to mitigate unnecessary CPU usage + // (tried many I/O sync ops, writeFileSync() seems to be only one that is effective in reducing + // CPU usage, though apparently not so much on Windows) + while (!fs.existsSync(codeFile)) { updateStream(stdoutFile); fs.writeFileSync(sleepFile, 'a'); } + while (!fs.existsSync(stdoutFile)) { updateStream(stdoutFile); fs.writeFileSync(sleepFile, 'a'); } + while (!fs.existsSync(stderrFile)) { updateStream(stderrFile); fs.writeFileSync(sleepFile, 'a'); } + } + + // At this point codeFile exists, but it's not necessarily flushed yet. + // Keep reading it until it is. + var code = parseInt('', 10); + while (isNaN(code)) { + code = parseInt(fs.readFileSync(codeFile, 'utf8'), 10); + } + + var stdout = fs.readFileSync(stdoutFile, 'utf8'); + var stderr = fs.readFileSync(stderrFile, 'utf8'); + + // No biggie if we can't erase the files now -- they're in a temp dir anyway + try { common.unlinkSync(scriptFile); } catch(e) {} + try { common.unlinkSync(stdoutFile); } catch(e) {} + try { common.unlinkSync(stderrFile); } catch(e) {} + try { common.unlinkSync(codeFile); } catch(e) {} + try { common.unlinkSync(sleepFile); } catch(e) {} + + // some shell return codes are defined as errors, per http://tldp.org/LDP/abs/html/exitcodes.html + if (code === 1 || code === 2 || code >= 126) { + common.error('', true); // unix/shell doesn't really give an error message after non-zero exit codes + } + // True if successful, false if not + var obj = { + code: code, + output: stdout, // deprecated + stdout: stdout, + stderr: stderr + }; + return obj; +} // execSync() + +// Wrapper around exec() to enable echoing output to console in real time +function execAsync(cmd, opts, callback) { + var stdout = ''; + var stderr = ''; + + var options = common.extend({ + silent: common.config.silent + }, opts); + + var c = child.exec(cmd, {env: process.env, maxBuffer: 20*1024*1024}, function(err) { + if (callback) + callback(err ? err.code : 0, stdout, stderr); + }); + + c.stdout.on('data', function(data) { + stdout += data; + if (!options.silent) + process.stdout.write(data); + }); + + c.stderr.on('data', function(data) { + stderr += data; + if (!options.silent) + process.stderr.write(data); + }); + + return c; +} + +//@ +//@ ### exec(command [, options] [, callback]) +//@ Available options (all `false` by default): +//@ +//@ + `async`: Asynchronous execution. If a callback is provided, it will be set to +//@ `true`, regardless of the passed value. +//@ + `silent`: Do not echo program output to console. +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var version = exec('node --version', {silent:true}).stdout; +//@ +//@ var child = exec('some_long_running_process', {async:true}); +//@ child.stdout.on('data', function(data) { +//@ /* ... do something with data ... */ +//@ }); +//@ +//@ exec('some_long_running_process', function(code, stdout, stderr) { +//@ console.log('Exit code:', code); +//@ console.log('Program output:', stdout); +//@ console.log('Program stderr:', stderr); +//@ }); +//@ ``` +//@ +//@ Executes the given `command` _synchronously_, unless otherwise specified. When in synchronous +//@ mode returns the object `{ code:..., stdout:... , stderr:... }`, containing the program's +//@ `stdout`, `stderr`, and its exit `code`. Otherwise returns the child process object, +//@ and the `callback` gets the arguments `(code, stdout, stderr)`. +//@ +//@ **Note:** For long-lived processes, it's best to run `exec()` asynchronously as +//@ the current synchronous implementation uses a lot of CPU. This should be getting +//@ fixed soon. +function _exec(command, options, callback) { + if (!command) + common.error('must specify command'); + + // Callback is defined instead of options. + if (typeof options === 'function') { + callback = options; + options = { async: true }; + } + + // Callback is defined with options. + if (typeof options === 'object' && typeof callback === 'function') { + options.async = true; + } + + options = common.extend({ + silent: common.config.silent, + async: false + }, options); + + if (options.async) + return execAsync(command, options, callback); + else + return execSync(command, options); +} +module.exports = _exec; + +var fs = require('fs'); +var common = require('./common'); +var _ls = require('./ls'); + +//@ +//@ ### find(path [, path ...]) +//@ ### find(path_array) +//@ Examples: +//@ +//@ ```javascript +//@ find('src', 'lib'); +//@ find(['src', 'lib']); // same as above +//@ find('.').filter(function(file) { return file.match(/\.js$/); }); +//@ ``` +//@ +//@ Returns array of all files (however deep) in the given paths. +//@ +//@ The main difference from `ls('-R', path)` is that the resulting file names +//@ include the base directories, e.g. `lib/resources/file1` instead of just `file1`. +function _find(options, paths) { + if (!paths) + common.error('no path specified'); + else if (typeof paths === 'object') + paths = paths; // assume array + else if (typeof paths === 'string') + paths = [].slice.call(arguments, 1); + + var list = []; + + function pushFile(file) { + if (common.platform === 'win') + file = file.replace(/\\/g, '/'); + list.push(file); + } + + // why not simply do ls('-R', paths)? because the output wouldn't give the base dirs + // to get the base dir in the output, we need instead ls('-R', 'dir/*') for every directory + + paths.forEach(function(file) { + pushFile(file); + + if (fs.statSync(file).isDirectory()) { + _ls('-RA', file+'/*').forEach(function(subfile) { + pushFile(subfile); + }); + } + }); + + return list; +} +module.exports = _find; + +var common = require('./common'); +var fs = require('fs'); + +//@ +//@ ### grep([options,] regex_filter, file [, file ...]) +//@ ### grep([options,] regex_filter, file_array) +//@ Available options: +//@ +//@ + `-v`: Inverse the sense of the regex and print the lines not matching the criteria. +//@ +//@ Examples: +//@ +//@ ```javascript +//@ grep('-v', 'GLOBAL_VARIABLE', '*.js'); +//@ grep('GLOBAL_VARIABLE', '*.js'); +//@ ``` +//@ +//@ Reads input string from given files and returns a string containing all lines of the +//@ file that match the given `regex_filter`. Wildcard `*` accepted. +function _grep(options, regex, files) { + options = common.parseOptions(options, { + 'v': 'inverse' + }); + + if (!files) + common.error('no paths given'); + + if (typeof files === 'string') + files = [].slice.call(arguments, 2); + // if it's array leave it as it is + + files = common.expand(files); + + var grep = ''; + files.forEach(function(file) { + if (!fs.existsSync(file)) { + common.error('no such file or directory: ' + file, true); + return; + } + + var contents = fs.readFileSync(file, 'utf8'), + lines = contents.split(/\r*\n/); + lines.forEach(function(line) { + var matched = line.match(regex); + if ((options.inverse && !matched) || (!options.inverse && matched)) + grep += line + '\n'; + }); + }); + + return common.ShellString(grep); +} +module.exports = _grep; + +var fs = require('fs'); +var path = require('path'); +var common = require('./common'); + +//@ +//@ ### ln([options,] source, dest) +//@ Available options: +//@ +//@ + `-s`: symlink +//@ + `-f`: force +//@ +//@ Examples: +//@ +//@ ```javascript +//@ ln('file', 'newlink'); +//@ ln('-sf', 'file', 'existing'); +//@ ``` +//@ +//@ Links source to dest. Use -f to force the link, should dest already exist. +function _ln(options, source, dest) { + options = common.parseOptions(options, { + 's': 'symlink', + 'f': 'force' + }); + + if (!source || !dest) { + common.error('Missing and/or '); + } + + source = String(source); + var sourcePath = path.normalize(source).replace(RegExp(path.sep + '$'), ''); + var isAbsolute = (path.resolve(source) === sourcePath); + dest = path.resolve(process.cwd(), String(dest)); + + if (fs.existsSync(dest)) { + if (!options.force) { + common.error('Destination file exists', true); + } + + fs.unlinkSync(dest); + } + + if (options.symlink) { + var isWindows = common.platform === 'win'; + var linkType = isWindows ? 'file' : null; + var resolvedSourcePath = isAbsolute ? sourcePath : path.resolve(process.cwd(), path.dirname(dest), source); + if (!fs.existsSync(resolvedSourcePath)) { + common.error('Source file does not exist', true); + } else if (isWindows && fs.statSync(resolvedSourcePath).isDirectory()) { + linkType = 'junction'; + } + + try { + fs.symlinkSync(linkType === 'junction' ? resolvedSourcePath: source, dest, linkType); + } catch (err) { + common.error(err.message); + } + } else { + if (!fs.existsSync(source)) { + common.error('Source file does not exist', true); + } + try { + fs.linkSync(source, dest); + } catch (err) { + common.error(err.message); + } + } +} +module.exports = _ln; + +var path = require('path'); +var fs = require('fs'); +var common = require('./common'); +var _cd = require('./cd'); +var _pwd = require('./pwd'); + +//@ +//@ ### ls([options,] [path, ...]) +//@ ### ls([options,] path_array) +//@ Available options: +//@ +//@ + `-R`: recursive +//@ + `-A`: all files (include files beginning with `.`, except for `.` and `..`) +//@ + `-d`: list directories themselves, not their contents +//@ + `-l`: list objects representing each file, each with fields containing `ls +//@ -l` output fields. See +//@ [fs.Stats](https://nodejs.org/api/fs.html#fs_class_fs_stats) +//@ for more info +//@ +//@ Examples: +//@ +//@ ```javascript +//@ ls('projs/*.js'); +//@ ls('-R', '/users/me', '/tmp'); +//@ ls('-R', ['/users/me', '/tmp']); // same as above +//@ ls('-l', 'file.txt'); // { name: 'file.txt', mode: 33188, nlink: 1, ...} +//@ ``` +//@ +//@ Returns array of files in the given path, or in current directory if no path provided. +function _ls(options, paths) { + options = common.parseOptions(options, { + 'R': 'recursive', + 'A': 'all', + 'a': 'all_deprecated', + 'd': 'directory', + 'l': 'long' + }); + + if (options.all_deprecated) { + // We won't support the -a option as it's hard to image why it's useful + // (it includes '.' and '..' in addition to '.*' files) + // For backwards compatibility we'll dump a deprecated message and proceed as before + common.log('ls: Option -a is deprecated. Use -A instead'); + options.all = true; + } + + if (!paths) + paths = ['.']; + else if (typeof paths === 'object') + paths = paths; // assume array + else if (typeof paths === 'string') + paths = [].slice.call(arguments, 1); + + var list = []; + + // Conditionally pushes file to list - returns true if pushed, false otherwise + // (e.g. prevents hidden files to be included unless explicitly told so) + function pushFile(file, query) { + var name = file.name || file; + // hidden file? + if (path.basename(name)[0] === '.') { + // not explicitly asking for hidden files? + if (!options.all && !(path.basename(query)[0] === '.' && path.basename(query).length > 1)) + return false; + } + + if (common.platform === 'win') + name = name.replace(/\\/g, '/'); + + if (file.name) { + file.name = name; + } else { + file = name; + } + list.push(file); + return true; + } + + paths.forEach(function(p) { + if (fs.existsSync(p)) { + var stats = ls_stat(p); + // Simple file? + if (stats.isFile()) { + if (options.long) { + pushFile(stats, p); + } else { + pushFile(p, p); + } + return; // continue + } + + // Simple dir? + if (options.directory) { + pushFile(p, p); + return; + } else if (stats.isDirectory()) { + // Iterate over p contents + fs.readdirSync(p).forEach(function(file) { + var orig_file = file; + if (options.long) + file = ls_stat(path.join(p, file)); + if (!pushFile(file, p)) + return; + + // Recursive? + if (options.recursive) { + var oldDir = _pwd(); + _cd('', p); + if (fs.statSync(orig_file).isDirectory()) + list = list.concat(_ls('-R'+(options.all?'A':''), orig_file+'/*')); + _cd('', oldDir); + } + }); + return; // continue + } + } + + // p does not exist - possible wildcard present + + var basename = path.basename(p); + var dirname = path.dirname(p); + // Wildcard present on an existing dir? (e.g. '/tmp/*.js') + if (basename.search(/\*/) > -1 && fs.existsSync(dirname) && fs.statSync(dirname).isDirectory) { + // Escape special regular expression chars + var regexp = basename.replace(/(\^|\$|\(|\)|<|>|\[|\]|\{|\}|\.|\+|\?)/g, '\\$1'); + // Translates wildcard into regex + regexp = '^' + regexp.replace(/\*/g, '.*') + '$'; + // Iterate over directory contents + fs.readdirSync(dirname).forEach(function(file) { + if (file.match(new RegExp(regexp))) { + var file_path = path.join(dirname, file); + file_path = options.long ? ls_stat(file_path) : file_path; + if (file_path.name) + file_path.name = path.normalize(file_path.name); + else + file_path = path.normalize(file_path); + if (!pushFile(file_path, basename)) + return; + + // Recursive? + if (options.recursive) { + var pp = dirname + '/' + file; + if (fs.lstatSync(pp).isDirectory()) + list = list.concat(_ls('-R'+(options.all?'A':''), pp+'/*')); + } // recursive + } // if file matches + }); // forEach + return; + } + + common.error('no such file or directory: ' + p, true); + }); + + return list; +} +module.exports = _ls; + + +function ls_stat(path) { + var stats = fs.statSync(path); + // Note: this object will contain more information than .toString() returns + stats.name = path; + stats.toString = function() { + // Return a string resembling unix's `ls -l` format + return [this.mode, this.nlink, this.uid, this.gid, this.size, this.mtime, this.name].join(' '); + }; + return stats; +} + +var common = require('./common'); +var fs = require('fs'); +var path = require('path'); + +// Recursively creates 'dir' +function mkdirSyncRecursive(dir) { + var baseDir = path.dirname(dir); + + // Base dir exists, no recursion necessary + if (fs.existsSync(baseDir)) { + fs.mkdirSync(dir, parseInt('0777', 8)); + return; + } + + // Base dir does not exist, go recursive + mkdirSyncRecursive(baseDir); + + // Base dir created, can create dir + fs.mkdirSync(dir, parseInt('0777', 8)); +} + +//@ +//@ ### mkdir([options,] dir [, dir ...]) +//@ ### mkdir([options,] dir_array) +//@ Available options: +//@ +//@ + `-p`: full path (will create intermediate dirs if necessary) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ mkdir('-p', '/tmp/a/b/c/d', '/tmp/e/f/g'); +//@ mkdir('-p', ['/tmp/a/b/c/d', '/tmp/e/f/g']); // same as above +//@ ``` +//@ +//@ Creates directories. +function _mkdir(options, dirs) { + options = common.parseOptions(options, { + 'p': 'fullpath' + }); + if (!dirs) + common.error('no paths given'); + + if (typeof dirs === 'string') + dirs = [].slice.call(arguments, 1); + // if it's array leave it as it is + + dirs.forEach(function(dir) { + if (fs.existsSync(dir)) { + if (!options.fullpath) + common.error('path already exists: ' + dir, true); + return; // skip dir + } + + // Base dir does not exist, and no -p option given + var baseDir = path.dirname(dir); + if (!fs.existsSync(baseDir) && !options.fullpath) { + common.error('no such file or directory: ' + baseDir, true); + return; // skip dir + } + + if (options.fullpath) + mkdirSyncRecursive(dir); + else + fs.mkdirSync(dir, parseInt('0777', 8)); + }); +} // mkdir +module.exports = _mkdir; + +var fs = require('fs'); +var path = require('path'); +var common = require('./common'); + +//@ +//@ ### mv([options ,] source [, source ...], dest') +//@ ### mv([options ,] source_array, dest') +//@ Available options: +//@ +//@ + `-f`: force (default behavior) +//@ + `-n`: no-clobber +//@ +//@ Examples: +//@ +//@ ```javascript +//@ mv('-n', 'file', 'dir/'); +//@ mv('file1', 'file2', 'dir/'); +//@ mv(['file1', 'file2'], 'dir/'); // same as above +//@ ``` +//@ +//@ Moves files. The wildcard `*` is accepted. +function _mv(options, sources, dest) { + options = common.parseOptions(options, { + 'f': '!no_force', + 'n': 'no_force' + }); + + // Get sources, dest + if (arguments.length < 3) { + common.error('missing and/or '); + } else if (arguments.length > 3) { + sources = [].slice.call(arguments, 1, arguments.length - 1); + dest = arguments[arguments.length - 1]; + } else if (typeof sources === 'string') { + sources = [sources]; + } else if ('length' in sources) { + sources = sources; // no-op for array + } else { + common.error('invalid arguments'); + } + + sources = common.expand(sources); + + var exists = fs.existsSync(dest), + stats = exists && fs.statSync(dest); + + // Dest is not existing dir, but multiple sources given + if ((!exists || !stats.isDirectory()) && sources.length > 1) + common.error('dest is not a directory (too many sources)'); + + // Dest is an existing file, but no -f given + if (exists && stats.isFile() && options.no_force) + common.error('dest file already exists: ' + dest); + + sources.forEach(function(src) { + if (!fs.existsSync(src)) { + common.error('no such file or directory: '+src, true); + return; // skip file + } + + // If here, src exists + + // When copying to '/path/dir': + // thisDest = '/path/dir/file1' + var thisDest = dest; + if (fs.existsSync(dest) && fs.statSync(dest).isDirectory()) + thisDest = path.normalize(dest + '/' + path.basename(src)); + + if (fs.existsSync(thisDest) && options.no_force) { + common.error('dest file already exists: ' + thisDest, true); + return; // skip file + } + + if (path.resolve(src) === path.dirname(path.resolve(thisDest))) { + common.error('cannot move to self: '+src, true); + return; // skip file + } + + fs.renameSync(src, thisDest); + }); // forEach(src) +} // mv +module.exports = _mv; + +// see dirs.js +// see dirs.js +var path = require('path'); +var common = require('./common'); + +//@ +//@ ### pwd() +//@ Returns the current directory. +function _pwd() { + var pwd = path.resolve(process.cwd()); + return common.ShellString(pwd); +} +module.exports = _pwd; + +var common = require('./common'); +var fs = require('fs'); + +// Recursively removes 'dir' +// Adapted from https://github.com/ryanmcgrath/wrench-js +// +// Copyright (c) 2010 Ryan McGrath +// Copyright (c) 2012 Artur Adib +// +// Licensed under the MIT License +// http://www.opensource.org/licenses/mit-license.php +function rmdirSyncRecursive(dir, force) { + var files; + + files = fs.readdirSync(dir); + + // Loop through and delete everything in the sub-tree after checking it + for(var i = 0; i < files.length; i++) { + var file = dir + "/" + files[i], + currFile = fs.lstatSync(file); + + if(currFile.isDirectory()) { // Recursive function back to the beginning + rmdirSyncRecursive(file, force); + } + + else if(currFile.isSymbolicLink()) { // Unlink symlinks + if (force || isWriteable(file)) { + try { + common.unlinkSync(file); + } catch (e) { + common.error('could not remove file (code '+e.code+'): ' + file, true); + } + } + } + + else // Assume it's a file - perhaps a try/catch belongs here? + if (force || isWriteable(file)) { + try { + common.unlinkSync(file); + } catch (e) { + common.error('could not remove file (code '+e.code+'): ' + file, true); + } + } + } + + // Now that we know everything in the sub-tree has been deleted, we can delete the main directory. + // Huzzah for the shopkeep. + + var result; + try { + // Retry on windows, sometimes it takes a little time before all the files in the directory are gone + var start = Date.now(); + while (true) { + try { + result = fs.rmdirSync(dir); + if (fs.existsSync(dir)) throw { code: "EAGAIN" }; + break; + } catch(er) { + // In addition to error codes, also check if the directory still exists and loop again if true + if (process.platform === "win32" && (er.code === "ENOTEMPTY" || er.code === "EBUSY" || er.code === "EPERM" || er.code === "EAGAIN")) { + if (Date.now() - start > 1000) throw er; + } else if (er.code === "ENOENT") { + // Directory did not exist, deletion was successful + break; + } else { + throw er; + } + } + } + } catch(e) { + common.error('could not remove directory (code '+e.code+'): ' + dir, true); + } + + return result; +} // rmdirSyncRecursive + +// Hack to determine if file has write permissions for current user +// Avoids having to check user, group, etc, but it's probably slow +function isWriteable(file) { + var writePermission = true; + try { + var __fd = fs.openSync(file, 'a'); + fs.closeSync(__fd); + } catch(e) { + writePermission = false; + } + + return writePermission; +} + +//@ +//@ ### rm([options,] file [, file ...]) +//@ ### rm([options,] file_array) +//@ Available options: +//@ +//@ + `-f`: force +//@ + `-r, -R`: recursive +//@ +//@ Examples: +//@ +//@ ```javascript +//@ rm('-rf', '/tmp/*'); +//@ rm('some_file.txt', 'another_file.txt'); +//@ rm(['some_file.txt', 'another_file.txt']); // same as above +//@ ``` +//@ +//@ Removes files. The wildcard `*` is accepted. +function _rm(options, files) { + options = common.parseOptions(options, { + 'f': 'force', + 'r': 'recursive', + 'R': 'recursive' + }); + if (!files) + common.error('no paths given'); + + if (typeof files === 'string') + files = [].slice.call(arguments, 1); + // if it's array leave it as it is + + files = common.expand(files); + + files.forEach(function(file) { + if (!fs.existsSync(file)) { + // Path does not exist, no force flag given + if (!options.force) + common.error('no such file or directory: '+file, true); + + return; // skip file + } + + // If here, path exists + + var stats = fs.lstatSync(file); + if (stats.isFile() || stats.isSymbolicLink()) { + + // Do not check for file writing permissions + if (options.force) { + common.unlinkSync(file); + return; + } + + if (isWriteable(file)) + common.unlinkSync(file); + else + common.error('permission denied: '+file, true); + + return; + } // simple file + + // Path is an existing directory, but no -r flag given + if (stats.isDirectory() && !options.recursive) { + common.error('path is a directory', true); + return; // skip path + } + + // Recursively remove existing directory + if (stats.isDirectory() && options.recursive) { + rmdirSyncRecursive(file, options.force); + } + }); // forEach(file) +} // rm +module.exports = _rm; + +var common = require('./common'); +var fs = require('fs'); + +//@ +//@ ### sed([options,] search_regex, replacement, file [, file ...]) +//@ ### sed([options,] search_regex, replacement, file_array) +//@ Available options: +//@ +//@ + `-i`: Replace contents of 'file' in-place. _Note that no backups will be created!_ +//@ +//@ Examples: +//@ +//@ ```javascript +//@ sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js'); +//@ sed(/.*DELETE_THIS_LINE.*\n/, '', 'source.js'); +//@ ``` +//@ +//@ Reads an input string from `files` and performs a JavaScript `replace()` on the input +//@ using the given search regex and replacement string or function. Returns the new string after replacement. +function _sed(options, regex, replacement, files) { + options = common.parseOptions(options, { + 'i': 'inplace' + }); + + if (typeof replacement === 'string' || typeof replacement === 'function') + replacement = replacement; // no-op + else if (typeof replacement === 'number') + replacement = replacement.toString(); // fallback + else + common.error('invalid replacement string'); + + // Convert all search strings to RegExp + if (typeof regex === 'string') + regex = RegExp(regex); + + if (!files) + common.error('no files given'); + + if (typeof files === 'string') + files = [].slice.call(arguments, 3); + // if it's array leave it as it is + + files = common.expand(files); + + var sed = []; + files.forEach(function(file) { + if (!fs.existsSync(file)) { + common.error('no such file or directory: ' + file, true); + return; + } + + var result = fs.readFileSync(file, 'utf8').split('\n').map(function (line) { + return line.replace(regex, replacement); + }).join('\n'); + + sed.push(result); + + if (options.inplace) + fs.writeFileSync(file, result, 'utf8'); + }); + + return common.ShellString(sed.join('\n')); +} +module.exports = _sed; + +var common = require('./common'); + +//@ +//@ ### set(options) +//@ Available options: +//@ +//@ + `+/-e`: exit upon error (`config.fatal`) +//@ + `+/-v`: verbose: show all commands (`config.verbose`) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ set('-e'); // exit upon first error +//@ set('+e'); // this undoes a "set('-e')" +//@ ``` +//@ +//@ Sets global configuration variables +function _set(options) { + if (!options) { + var args = [].slice.call(arguments, 0); + if (args.length < 2) + common.error('must provide an argument'); + options = args[1]; + } + var negate = (options[0] === '+'); + if (negate) { + options = '-' + options.slice(1); // parseOptions needs a '-' prefix + } + options = common.parseOptions(options, { + 'e': 'fatal', + 'v': 'verbose' + }); + + var key; + if (negate) { + for (key in options) + options[key] = !options[key]; + } + + for (key in options) { + // Only change the global config if `negate` is false and the option is true + // or if `negate` is true and the option is false (aka negate !== option) + if (negate !== options[key]) { + common.config[key] = options[key]; + } + } + return; +} +module.exports = _set; + +var common = require('./common'); +var os = require('os'); +var fs = require('fs'); + +// Returns false if 'dir' is not a writeable directory, 'dir' otherwise +function writeableDir(dir) { + if (!dir || !fs.existsSync(dir)) + return false; + + if (!fs.statSync(dir).isDirectory()) + return false; + + var testFile = dir+'/'+common.randomFileName(); + try { + fs.writeFileSync(testFile, ' '); + common.unlinkSync(testFile); + return dir; + } catch (e) { + return false; + } +} + + +//@ +//@ ### tempdir() +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var tmp = tempdir(); // "/tmp" for most *nix platforms +//@ ``` +//@ +//@ Searches and returns string containing a writeable, platform-dependent temporary directory. +//@ Follows Python's [tempfile algorithm](http://docs.python.org/library/tempfile.html#tempfile.tempdir). +function _tempDir() { + var state = common.state; + if (state.tempDir) + return state.tempDir; // from cache + + state.tempDir = writeableDir(os.tmpdir && os.tmpdir()) || // node 0.10+ + writeableDir(os.tmpDir && os.tmpDir()) || // node 0.8+ + writeableDir(process.env['TMPDIR']) || + writeableDir(process.env['TEMP']) || + writeableDir(process.env['TMP']) || + writeableDir(process.env['Wimp$ScrapDir']) || // RiscOS + writeableDir('C:\\TEMP') || // Windows + writeableDir('C:\\TMP') || // Windows + writeableDir('\\TEMP') || // Windows + writeableDir('\\TMP') || // Windows + writeableDir('/tmp') || + writeableDir('/var/tmp') || + writeableDir('/usr/tmp') || + writeableDir('.'); // last resort + + return state.tempDir; +} +module.exports = _tempDir; + +var common = require('./common'); +var fs = require('fs'); + +//@ +//@ ### test(expression) +//@ Available expression primaries: +//@ +//@ + `'-b', 'path'`: true if path is a block device +//@ + `'-c', 'path'`: true if path is a character device +//@ + `'-d', 'path'`: true if path is a directory +//@ + `'-e', 'path'`: true if path exists +//@ + `'-f', 'path'`: true if path is a regular file +//@ + `'-L', 'path'`: true if path is a symbolic link +//@ + `'-p', 'path'`: true if path is a pipe (FIFO) +//@ + `'-S', 'path'`: true if path is a socket +//@ +//@ Examples: +//@ +//@ ```javascript +//@ if (test('-d', path)) { /* do something with dir */ }; +//@ if (!test('-f', path)) continue; // skip if it's a regular file +//@ ``` +//@ +//@ Evaluates expression using the available primaries and returns corresponding value. +function _test(options, path) { + if (!path) + common.error('no path given'); + + // hack - only works with unary primaries + options = common.parseOptions(options, { + 'b': 'block', + 'c': 'character', + 'd': 'directory', + 'e': 'exists', + 'f': 'file', + 'L': 'link', + 'p': 'pipe', + 'S': 'socket' + }); + + var canInterpret = false; + for (var key in options) + if (options[key] === true) { + canInterpret = true; + break; + } + + if (!canInterpret) + common.error('could not interpret expression'); + + if (options.link) { + try { + return fs.lstatSync(path).isSymbolicLink(); + } catch(e) { + return false; + } + } + + if (!fs.existsSync(path)) + return false; + + if (options.exists) + return true; + + var stats = fs.statSync(path); + + if (options.block) + return stats.isBlockDevice(); + + if (options.character) + return stats.isCharacterDevice(); + + if (options.directory) + return stats.isDirectory(); + + if (options.file) + return stats.isFile(); + + if (options.pipe) + return stats.isFIFO(); + + if (options.socket) + return stats.isSocket(); +} // test +module.exports = _test; + +var common = require('./common'); +var fs = require('fs'); +var path = require('path'); + +//@ +//@ ### 'string'.to(file) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ cat('input.txt').to('output.txt'); +//@ ``` +//@ +//@ Analogous to the redirection operator `>` in Unix, but works with JavaScript strings (such as +//@ those returned by `cat`, `grep`, etc). _Like Unix redirections, `to()` will overwrite any existing file!_ +function _to(options, file) { + if (!file) + common.error('wrong arguments'); + + if (!fs.existsSync( path.dirname(file) )) + common.error('no such file or directory: ' + path.dirname(file)); + + try { + fs.writeFileSync(file, this.toString(), 'utf8'); + return this; + } catch(e) { + common.error('could not write to file (code '+e.code+'): '+file, true); + } +} +module.exports = _to; + +var common = require('./common'); +var fs = require('fs'); +var path = require('path'); + +//@ +//@ ### 'string'.toEnd(file) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ cat('input.txt').toEnd('output.txt'); +//@ ``` +//@ +//@ Analogous to the redirect-and-append operator `>>` in Unix, but works with JavaScript strings (such as +//@ those returned by `cat`, `grep`, etc). +function _toEnd(options, file) { + if (!file) + common.error('wrong arguments'); + + if (!fs.existsSync( path.dirname(file) )) + common.error('no such file or directory: ' + path.dirname(file)); + + try { + fs.appendFileSync(file, this.toString(), 'utf8'); + return this; + } catch(e) { + common.error('could not append to file (code '+e.code+'): '+file, true); + } +} +module.exports = _toEnd; + +var common = require('./common'); +var fs = require('fs'); + +//@ +//@ ### touch([options,] file) +//@ Available options: +//@ +//@ + `-a`: Change only the access time +//@ + `-c`: Do not create any files +//@ + `-m`: Change only the modification time +//@ + `-d DATE`: Parse DATE and use it instead of current time +//@ + `-r FILE`: Use FILE's times instead of current time +//@ +//@ Examples: +//@ +//@ ```javascript +//@ touch('source.js'); +//@ touch('-c', '/path/to/some/dir/source.js'); +//@ touch({ '-r': FILE }, '/path/to/some/dir/source.js'); +//@ ``` +//@ +//@ Update the access and modification times of each FILE to the current time. +//@ A FILE argument that does not exist is created empty, unless -c is supplied. +//@ This is a partial implementation of *[touch(1)](http://linux.die.net/man/1/touch)*. +function _touch(opts, files) { + opts = common.parseOptions(opts, { + 'a': 'atime_only', + 'c': 'no_create', + 'd': 'date', + 'm': 'mtime_only', + 'r': 'reference', + }); + + if (!files) { + common.error('no paths given'); + } + + + if (Array.isArray(files)) { + files.forEach(function(f) { + touchFile(opts, f); + }); + } else if (typeof files === 'string') { + touchFile(opts, files); + } else { + common.error('file arg should be a string file path or an Array of string file paths'); + } + +} + +function touchFile(opts, file) { + var stat = tryStatFile(file); + + if (stat && stat.isDirectory()) { + // don't error just exit + return; + } + + // if the file doesn't already exist and the user has specified --no-create then + // this script is finished + if (!stat && opts.no_create) { + return; + } + + // open the file and then close it. this will create it if it doesn't exist but will + // not truncate the file + fs.closeSync(fs.openSync(file, 'a')); + + // + // Set timestamps + // + + // setup some defaults + var now = new Date(); + var mtime = opts.date || now; + var atime = opts.date || now; + + // use reference file + if (opts.reference) { + var refStat = tryStatFile(opts.reference); + if (!refStat) { + common.error('failed to get attributess of ' + opts.reference); + } + mtime = refStat.mtime; + atime = refStat.atime; + } else if (opts.date) { + mtime = opts.date; + atime = opts.date; + } + + if (opts.atime_only && opts.mtime_only) { + // keep the new values of mtime and atime like GNU + } else if (opts.atime_only) { + mtime = stat.mtime; + } else if (opts.mtime_only) { + atime = stat.atime; + } + + fs.utimesSync(file, atime, mtime); +} + +module.exports = _touch; + +function tryStatFile(filePath) { + try { + return fs.statSync(filePath); + } catch (e) { + return null; + } +} + +var common = require('./common'); +var fs = require('fs'); +var path = require('path'); + +// XP's system default value for PATHEXT system variable, just in case it's not +// set on Windows. +var XP_DEFAULT_PATHEXT = '.com;.exe;.bat;.cmd;.vbs;.vbe;.js;.jse;.wsf;.wsh'; + +// Cross-platform method for splitting environment PATH variables +function splitPath(p) { + if (!p) + return []; + + if (common.platform === 'win') + return p.split(';'); + else + return p.split(':'); +} + +function checkPath(path) { + return fs.existsSync(path) && !fs.statSync(path).isDirectory(); +} + +//@ +//@ ### which(command) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var nodeExec = which('node'); +//@ ``` +//@ +//@ Searches for `command` in the system's PATH. On Windows, this uses the +//@ `PATHEXT` variable to append the extension if it's not already executable. +//@ Returns string containing the absolute path to the command. +function _which(options, cmd) { + if (!cmd) + common.error('must specify command'); + + var pathEnv = process.env.path || process.env.Path || process.env.PATH, + pathArray = splitPath(pathEnv), + where = null; + + // No relative/absolute paths provided? + if (cmd.search(/\//) === -1) { + // Search for command in PATH + pathArray.forEach(function(dir) { + if (where) + return; // already found it + + var attempt = path.resolve(dir, cmd); + + if (common.platform === 'win') { + attempt = attempt.toUpperCase(); + + // In case the PATHEXT variable is somehow not set (e.g. + // child_process.spawn with an empty environment), use the XP default. + var pathExtEnv = process.env.PATHEXT || XP_DEFAULT_PATHEXT; + var pathExtArray = splitPath(pathExtEnv.toUpperCase()); + var i; + + // If the extension is already in PATHEXT, just return that. + for (i = 0; i < pathExtArray.length; i++) { + var ext = pathExtArray[i]; + if (attempt.slice(-ext.length) === ext && checkPath(attempt)) { + where = attempt; + return; + } + } + + // Cycle through the PATHEXT variable + var baseAttempt = attempt; + for (i = 0; i < pathExtArray.length; i++) { + attempt = baseAttempt + pathExtArray[i]; + if (checkPath(attempt)) { + where = attempt; + return; + } + } + } else { + // Assume it's Unix-like + if (checkPath(attempt)) { + where = attempt; + return; + } + } + }); + } + + // Command not found anywhere? + if (!checkPath(cmd) && !where) + return null; + + where = where || path.resolve(cmd); + + return common.ShellString(where); +} +module.exports = _which; diff --git a/tools/eslint/node_modules/shelljs/global.js b/tools/eslint/node_modules/shelljs/global.js new file mode 100644 index 00000000000000..97f0033cc15303 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/global.js @@ -0,0 +1,3 @@ +var shell = require('./shell.js'); +for (var cmd in shell) + global[cmd] = shell[cmd]; diff --git a/tools/eslint/node_modules/shelljs/make.js b/tools/eslint/node_modules/shelljs/make.js new file mode 100644 index 00000000000000..a8438c84e818b6 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/make.js @@ -0,0 +1,57 @@ +require('./global'); + +global.config.fatal = true; +global.target = {}; + +var args = process.argv.slice(2), + targetArgs, + dashesLoc = args.indexOf('--'); + +// split args, everything after -- if only for targets +if (dashesLoc > -1) { + targetArgs = args.slice(dashesLoc + 1, args.length); + args = args.slice(0, dashesLoc); +} + +// This ensures we only execute the script targets after the entire script has +// been evaluated +setTimeout(function() { + var t; + + if (args.length === 1 && args[0] === '--help') { + console.log('Available targets:'); + for (t in global.target) + console.log(' ' + t); + return; + } + + // Wrap targets to prevent duplicate execution + for (t in global.target) { + (function(t, oldTarget){ + + // Wrap it + global.target[t] = function() { + if (!oldTarget.done){ + oldTarget.done = true; + oldTarget.result = oldTarget.apply(oldTarget, arguments); + } + return oldTarget.result; + }; + + })(t, global.target[t]); + } + + // Execute desired targets + if (args.length > 0) { + args.forEach(function(arg) { + if (arg in global.target) + global.target[arg](targetArgs); + else { + console.log('no such target: ' + arg); + } + }); + } else if ('all' in global.target) { + global.target.all(targetArgs); + } + +}, 0); diff --git a/tools/eslint/node_modules/shelljs/package.json b/tools/eslint/node_modules/shelljs/package.json new file mode 100644 index 00000000000000..288b839f873e8a --- /dev/null +++ b/tools/eslint/node_modules/shelljs/package.json @@ -0,0 +1,112 @@ +{ + "_args": [ + [ + "shelljs@^0.6.0", + "/Users/silverwind/git/node/tools/package/package" + ] + ], + "_from": "shelljs@>=0.6.0 <0.7.0", + "_id": "shelljs@0.6.0", + "_inCache": true, + "_installable": true, + "_location": "/shelljs", + "_nodeVersion": "5.4.0", + "_npmOperationalInternal": { + "host": "packages-6-west.internal.npmjs.com", + "tmp": "tmp/shelljs-0.6.0.tgz_1454632811074_0.5800695188809186" + }, + "_npmUser": { + "email": "ari@ariporad.com", + "name": "ariporad" + }, + "_npmVersion": "3.6.0", + "_phantomChildren": {}, + "_requested": { + "name": "shelljs", + "raw": "shelljs@^0.6.0", + "rawSpec": "^0.6.0", + "scope": null, + "spec": ">=0.6.0 <0.7.0", + "type": "range" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.6.0.tgz", + "_shasum": "ce1ed837b4b0e55b5ec3dab84251ab9dbdc0c7ec", + "_shrinkwrap": null, + "_spec": "shelljs@^0.6.0", + "_where": "/Users/silverwind/git/node/tools/package/package", + "author": { + "email": "arturadib@gmail.com", + "name": "Artur Adib" + }, + "bin": { + "shjs": "./bin/shjs" + }, + "bugs": { + "url": "https://github.com/shelljs/shelljs/issues" + }, + "contributors": [ + { + "name": "Ari Porad", + "email": "ari@ariporad.com", + "url": "http://ariporad.com/" + }, + { + "name": "Nate Fischer", + "email": "ntfschr@gmail.com" + } + ], + "dependencies": {}, + "description": "Portable Unix shell commands for Node.js", + "devDependencies": { + "coffee-script": "^1.10.0", + "jshint": "~2.1.11" + }, + "directories": {}, + "dist": { + "shasum": "ce1ed837b4b0e55b5ec3dab84251ab9dbdc0c7ec", + "tarball": "https://registry.npmjs.org/shelljs/-/shelljs-0.6.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "gitHead": "fe06baf1173ec6f0a70cd58ddb7d373f4c6446f5", + "homepage": "http://github.com/shelljs/shelljs", + "keywords": [ + "jake", + "make", + "makefile", + "shell", + "synchronous", + "unix" + ], + "license": "BSD-3-Clause", + "main": "./shell.js", + "maintainers": [ + { + "name": "ariporad", + "email": "ari@ariporad.com" + }, + { + "name": "artur", + "email": "arturadib@gmail.com" + }, + { + "name": "nfischer", + "email": "ntfschr@gmail.com" + } + ], + "name": "shelljs", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/shelljs/shelljs.git" + }, + "scripts": { + "test": "node scripts/run-tests" + }, + "version": "0.6.0" +} diff --git a/tools/eslint/node_modules/shelljs/scripts/generate-docs.js b/tools/eslint/node_modules/shelljs/scripts/generate-docs.js new file mode 100755 index 00000000000000..3a31a91abd2a13 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/scripts/generate-docs.js @@ -0,0 +1,26 @@ +#!/usr/bin/env node +/* globals cat, cd, echo, grep, sed */ +require('../global'); + +echo('Appending docs to README.md'); + +cd(__dirname + '/..'); + +// Extract docs from shell.js +var docs = grep('//@', 'shell.js'); + +docs = docs.replace(/\/\/\@include (.+)/g, function(match, path) { + var file = path.match('.js$') ? path : path+'.js'; + return grep('//@', file); +}); + +// Remove '//@' +docs = docs.replace(/\/\/\@ ?/g, ''); + +// Wipe out the old docs +cat('README.md').replace(/## Command reference(.|\n)*/, '## Command reference').to('README.md'); + +// Append new docs to README +sed('-i', /## Command reference/, '## Command reference\n\n' + docs, 'README.md'); + +echo('All done.'); diff --git a/tools/eslint/node_modules/shelljs/scripts/run-tests.js b/tools/eslint/node_modules/shelljs/scripts/run-tests.js new file mode 100755 index 00000000000000..e8e7ff2f879a82 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/scripts/run-tests.js @@ -0,0 +1,55 @@ +#!/usr/bin/env node +/* globals cd, echo, exec, exit, ls, pwd, test */ +require('../global'); +var common = require('../src/common'); + +var failed = false; + +// +// Lint +// +var JSHINT_BIN = 'node_modules/jshint/bin/jshint'; +cd(__dirname + '/..'); + +if (!test('-f', JSHINT_BIN)) { + echo('JSHint not found. Run `npm install` in the root dir first.'); + exit(1); +} + +var jsfiles = common.expand([pwd() + '/*.js', + pwd() + '/scripts/*.js', + pwd() + '/src/*.js', + pwd() + '/test/*.js' + ]).join(' '); +if (exec('node ' + pwd() + '/' + JSHINT_BIN + ' ' + jsfiles).code !== 0) { + failed = true; + echo('*** JSHINT FAILED! (return code != 0)'); + echo(); +} else { + echo('All JSHint tests passed'); + echo(); +} + +// +// Unit tests +// +cd(__dirname + '/../test'); +ls('*.js').forEach(function(file) { + echo('Running test:', file); + if (exec('node ' + file).code !== 123) { // 123 avoids false positives (e.g. premature exit) + failed = true; + echo('*** TEST FAILED! (missing exit code "123")'); + echo(); + } +}); + +if (failed) { + echo(); + echo('*******************************************************'); + echo('WARNING: Some tests did not pass!'); + echo('*******************************************************'); + exit(1); +} else { + echo(); + echo('All tests passed.'); +} diff --git a/tools/eslint/node_modules/shelljs/shell.js b/tools/eslint/node_modules/shelljs/shell.js new file mode 100644 index 00000000000000..93aff709a3931f --- /dev/null +++ b/tools/eslint/node_modules/shelljs/shell.js @@ -0,0 +1,184 @@ +// +// ShellJS +// Unix shell commands on top of Node's API +// +// Copyright (c) 2012 Artur Adib +// http://github.com/arturadib/shelljs +// + +var common = require('./src/common'); + + +//@ +//@ All commands run synchronously, unless otherwise stated. +//@ + +//@include ./src/cd +var _cd = require('./src/cd'); +exports.cd = common.wrap('cd', _cd); + +//@include ./src/pwd +var _pwd = require('./src/pwd'); +exports.pwd = common.wrap('pwd', _pwd); + +//@include ./src/ls +var _ls = require('./src/ls'); +exports.ls = common.wrap('ls', _ls); + +//@include ./src/find +var _find = require('./src/find'); +exports.find = common.wrap('find', _find); + +//@include ./src/cp +var _cp = require('./src/cp'); +exports.cp = common.wrap('cp', _cp); + +//@include ./src/rm +var _rm = require('./src/rm'); +exports.rm = common.wrap('rm', _rm); + +//@include ./src/mv +var _mv = require('./src/mv'); +exports.mv = common.wrap('mv', _mv); + +//@include ./src/mkdir +var _mkdir = require('./src/mkdir'); +exports.mkdir = common.wrap('mkdir', _mkdir); + +//@include ./src/test +var _test = require('./src/test'); +exports.test = common.wrap('test', _test); + +//@include ./src/cat +var _cat = require('./src/cat'); +exports.cat = common.wrap('cat', _cat); + +//@include ./src/to +var _to = require('./src/to'); +String.prototype.to = common.wrap('to', _to); + +//@include ./src/toEnd +var _toEnd = require('./src/toEnd'); +String.prototype.toEnd = common.wrap('toEnd', _toEnd); + +//@include ./src/sed +var _sed = require('./src/sed'); +exports.sed = common.wrap('sed', _sed); + +//@include ./src/grep +var _grep = require('./src/grep'); +exports.grep = common.wrap('grep', _grep); + +//@include ./src/which +var _which = require('./src/which'); +exports.which = common.wrap('which', _which); + +//@include ./src/echo +var _echo = require('./src/echo'); +exports.echo = _echo; // don't common.wrap() as it could parse '-options' + +//@include ./src/dirs +var _dirs = require('./src/dirs').dirs; +exports.dirs = common.wrap("dirs", _dirs); +var _pushd = require('./src/dirs').pushd; +exports.pushd = common.wrap('pushd', _pushd); +var _popd = require('./src/dirs').popd; +exports.popd = common.wrap("popd", _popd); + +//@include ./src/ln +var _ln = require('./src/ln'); +exports.ln = common.wrap('ln', _ln); + +//@ +//@ ### exit(code) +//@ Exits the current process with the given exit code. +exports.exit = process.exit; + +//@ +//@ ### env['VAR_NAME'] +//@ Object containing environment variables (both getter and setter). Shortcut to process.env. +exports.env = process.env; + +//@include ./src/exec +var _exec = require('./src/exec'); +exports.exec = common.wrap('exec', _exec, {notUnix:true}); + +//@include ./src/chmod +var _chmod = require('./src/chmod'); +exports.chmod = common.wrap('chmod', _chmod); + +//@include ./src/touch +var _touch = require('./src/touch'); +exports.touch = common.wrap('touch', _touch); + +//@include ./src/set +var _set = require('./src/set'); +exports.set = common.wrap('set', _set); + + +//@ +//@ ## Non-Unix commands +//@ + +//@include ./src/tempdir +var _tempDir = require('./src/tempdir'); +exports.tempdir = common.wrap('tempdir', _tempDir); + + +//@include ./src/error +var _error = require('./src/error'); +exports.error = _error; + + + +//@ +//@ ## Configuration +//@ + +exports.config = common.config; + +//@ +//@ ### config.silent +//@ Example: +//@ +//@ ```javascript +//@ var sh = require('shelljs'); +//@ var silentState = sh.config.silent; // save old silent state +//@ sh.config.silent = true; +//@ /* ... */ +//@ sh.config.silent = silentState; // restore old silent state +//@ ``` +//@ +//@ Suppresses all command output if `true`, except for `echo()` calls. +//@ Default is `false`. + +//@ +//@ ### config.fatal +//@ Example: +//@ +//@ ```javascript +//@ require('shelljs/global'); +//@ config.fatal = true; // or set('-e'); +//@ cp('this_file_does_not_exist', '/dev/null'); // dies here +//@ /* more commands... */ +//@ ``` +//@ +//@ If `true` the script will die on errors. Default is `false`. This is +//@ analogous to Bash's `set -e` + +//@ +//@ ### config.verbose +//@ Example: +//@ +//@ ```javascript +//@ config.verbose = true; // or set('-v'); +//@ cd('dir/'); +//@ ls('subdir/'); +//@ ``` +//@ +//@ Will print each command as follows: +//@ +//@ ``` +//@ cd dir/ +//@ ls subdir/ +//@ ``` diff --git a/tools/eslint/node_modules/shelljs/src/cat.js b/tools/eslint/node_modules/shelljs/src/cat.js new file mode 100644 index 00000000000000..5840b4ea77b590 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/cat.js @@ -0,0 +1,40 @@ +var common = require('./common'); +var fs = require('fs'); + +//@ +//@ ### cat(file [, file ...]) +//@ ### cat(file_array) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var str = cat('file*.txt'); +//@ var str = cat('file1', 'file2'); +//@ var str = cat(['file1', 'file2']); // same as above +//@ ``` +//@ +//@ Returns a string containing the given file, or a concatenated string +//@ containing the files if more than one file is given (a new line character is +//@ introduced between each file). Wildcard `*` accepted. +function _cat(options, files) { + var cat = ''; + + if (!files) + common.error('no paths given'); + + if (typeof files === 'string') + files = [].slice.call(arguments, 1); + // if it's array leave it as it is + + files = common.expand(files); + + files.forEach(function(file) { + if (!fs.existsSync(file)) + common.error('no such file or directory: ' + file); + + cat += fs.readFileSync(file, 'utf8'); + }); + + return common.ShellString(cat); +} +module.exports = _cat; diff --git a/tools/eslint/node_modules/shelljs/src/cd.js b/tools/eslint/node_modules/shelljs/src/cd.js new file mode 100644 index 00000000000000..b7b9931b8f41df --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/cd.js @@ -0,0 +1,28 @@ +var fs = require('fs'); +var common = require('./common'); + +//@ +//@ ### cd([dir]) +//@ Changes to directory `dir` for the duration of the script. Changes to home +//@ directory if no argument is supplied. +function _cd(options, dir) { + if (!dir) + dir = common.getUserHome(); + + if (dir === '-') { + if (!common.state.previousDir) + common.error('could not find previous directory'); + else + dir = common.state.previousDir; + } + + if (!fs.existsSync(dir)) + common.error('no such file or directory: ' + dir); + + if (!fs.statSync(dir).isDirectory()) + common.error('not a directory: ' + dir); + + common.state.previousDir = process.cwd(); + process.chdir(dir); +} +module.exports = _cd; diff --git a/tools/eslint/node_modules/shelljs/src/chmod.js b/tools/eslint/node_modules/shelljs/src/chmod.js new file mode 100644 index 00000000000000..6c6de10ce12e49 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/chmod.js @@ -0,0 +1,215 @@ +var common = require('./common'); +var fs = require('fs'); +var path = require('path'); + +var PERMS = (function (base) { + return { + OTHER_EXEC : base.EXEC, + OTHER_WRITE : base.WRITE, + OTHER_READ : base.READ, + + GROUP_EXEC : base.EXEC << 3, + GROUP_WRITE : base.WRITE << 3, + GROUP_READ : base.READ << 3, + + OWNER_EXEC : base.EXEC << 6, + OWNER_WRITE : base.WRITE << 6, + OWNER_READ : base.READ << 6, + + // Literal octal numbers are apparently not allowed in "strict" javascript. Using parseInt is + // the preferred way, else a jshint warning is thrown. + STICKY : parseInt('01000', 8), + SETGID : parseInt('02000', 8), + SETUID : parseInt('04000', 8), + + TYPE_MASK : parseInt('0770000', 8) + }; +})({ + EXEC : 1, + WRITE : 2, + READ : 4 +}); + +//@ +//@ ### chmod(octal_mode || octal_string, file) +//@ ### chmod(symbolic_mode, file) +//@ +//@ Available options: +//@ +//@ + `-v`: output a diagnostic for every file processed//@ +//@ + `-c`: like verbose but report only when a change is made//@ +//@ + `-R`: change files and directories recursively//@ +//@ +//@ Examples: +//@ +//@ ```javascript +//@ chmod(755, '/Users/brandon'); +//@ chmod('755', '/Users/brandon'); // same as above +//@ chmod('u+x', '/Users/brandon'); +//@ ``` +//@ +//@ Alters the permissions of a file or directory by either specifying the +//@ absolute permissions in octal form or expressing the changes in symbols. +//@ This command tries to mimic the POSIX behavior as much as possible. +//@ Notable exceptions: +//@ +//@ + In symbolic modes, 'a-r' and '-r' are identical. No consideration is +//@ given to the umask. +//@ + There is no "quiet" option since default behavior is to run silent. +function _chmod(options, mode, filePattern) { + if (!filePattern) { + if (options.length > 0 && options.charAt(0) === '-') { + // Special case where the specified file permissions started with - to subtract perms, which + // get picked up by the option parser as command flags. + // If we are down by one argument and options starts with -, shift everything over. + filePattern = mode; + mode = options; + options = ''; + } + else { + common.error('You must specify a file.'); + } + } + + options = common.parseOptions(options, { + 'R': 'recursive', + 'c': 'changes', + 'v': 'verbose' + }); + + if (typeof filePattern === 'string') { + filePattern = [ filePattern ]; + } + + var files; + + if (options.recursive) { + files = []; + common.expand(filePattern).forEach(function addFile(expandedFile) { + var stat = fs.lstatSync(expandedFile); + + if (!stat.isSymbolicLink()) { + files.push(expandedFile); + + if (stat.isDirectory()) { // intentionally does not follow symlinks. + fs.readdirSync(expandedFile).forEach(function (child) { + addFile(expandedFile + '/' + child); + }); + } + } + }); + } + else { + files = common.expand(filePattern); + } + + files.forEach(function innerChmod(file) { + file = path.resolve(file); + if (!fs.existsSync(file)) { + common.error('File not found: ' + file); + } + + // When recursing, don't follow symlinks. + if (options.recursive && fs.lstatSync(file).isSymbolicLink()) { + return; + } + + var stat = fs.statSync(file); + var isDir = stat.isDirectory(); + var perms = stat.mode; + var type = perms & PERMS.TYPE_MASK; + + var newPerms = perms; + + if (isNaN(parseInt(mode, 8))) { + // parse options + mode.split(',').forEach(function (symbolicMode) { + /*jshint regexdash:true */ + var pattern = /([ugoa]*)([=\+-])([rwxXst]*)/i; + var matches = pattern.exec(symbolicMode); + + if (matches) { + var applyTo = matches[1]; + var operator = matches[2]; + var change = matches[3]; + + var changeOwner = applyTo.indexOf('u') != -1 || applyTo === 'a' || applyTo === ''; + var changeGroup = applyTo.indexOf('g') != -1 || applyTo === 'a' || applyTo === ''; + var changeOther = applyTo.indexOf('o') != -1 || applyTo === 'a' || applyTo === ''; + + var changeRead = change.indexOf('r') != -1; + var changeWrite = change.indexOf('w') != -1; + var changeExec = change.indexOf('x') != -1; + var changeExecDir = change.indexOf('X') != -1; + var changeSticky = change.indexOf('t') != -1; + var changeSetuid = change.indexOf('s') != -1; + + if (changeExecDir && isDir) + changeExec = true; + + var mask = 0; + if (changeOwner) { + mask |= (changeRead ? PERMS.OWNER_READ : 0) + (changeWrite ? PERMS.OWNER_WRITE : 0) + (changeExec ? PERMS.OWNER_EXEC : 0) + (changeSetuid ? PERMS.SETUID : 0); + } + if (changeGroup) { + mask |= (changeRead ? PERMS.GROUP_READ : 0) + (changeWrite ? PERMS.GROUP_WRITE : 0) + (changeExec ? PERMS.GROUP_EXEC : 0) + (changeSetuid ? PERMS.SETGID : 0); + } + if (changeOther) { + mask |= (changeRead ? PERMS.OTHER_READ : 0) + (changeWrite ? PERMS.OTHER_WRITE : 0) + (changeExec ? PERMS.OTHER_EXEC : 0); + } + + // Sticky bit is special - it's not tied to user, group or other. + if (changeSticky) { + mask |= PERMS.STICKY; + } + + switch (operator) { + case '+': + newPerms |= mask; + break; + + case '-': + newPerms &= ~mask; + break; + + case '=': + newPerms = type + mask; + + // According to POSIX, when using = to explicitly set the permissions, setuid and setgid can never be cleared. + if (fs.statSync(file).isDirectory()) { + newPerms |= (PERMS.SETUID + PERMS.SETGID) & perms; + } + break; + } + + if (options.verbose) { + console.log(file + ' -> ' + newPerms.toString(8)); + } + + if (perms != newPerms) { + if (!options.verbose && options.changes) { + console.log(file + ' -> ' + newPerms.toString(8)); + } + fs.chmodSync(file, newPerms); + perms = newPerms; // for the next round of changes! + } + } + else { + common.error('Invalid symbolic mode change: ' + symbolicMode); + } + }); + } + else { + // they gave us a full number + newPerms = type + parseInt(mode, 8); + + // POSIX rules are that setuid and setgid can only be added using numeric form, but not cleared. + if (fs.statSync(file).isDirectory()) { + newPerms |= (PERMS.SETUID + PERMS.SETGID) & perms; + } + + fs.chmodSync(file, newPerms); + } + }); +} +module.exports = _chmod; diff --git a/tools/eslint/node_modules/shelljs/src/common.js b/tools/eslint/node_modules/shelljs/src/common.js new file mode 100644 index 00000000000000..33198bd8a0a265 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/common.js @@ -0,0 +1,257 @@ +var os = require('os'); +var fs = require('fs'); +var _ls = require('./ls'); + +// Module globals +var config = { + silent: false, + fatal: false, + verbose: false, +}; +exports.config = config; + +var state = { + error: null, + currentCmd: 'shell.js', + previousDir: null, + tempDir: null +}; +exports.state = state; + +var platform = os.type().match(/^Win/) ? 'win' : 'unix'; +exports.platform = platform; + +function log() { + if (!config.silent) + console.error.apply(console, arguments); +} +exports.log = log; + +// Shows error message. Throws unless _continue or config.fatal are true +function error(msg, _continue) { + if (state.error === null) + state.error = ''; + var log_entry = state.currentCmd + ': ' + msg; + if (state.error === '') + state.error = log_entry; + else + state.error += '\n' + log_entry; + + if (msg.length > 0) + log(log_entry); + + if (config.fatal) + process.exit(1); + + if (!_continue) + throw ''; +} +exports.error = error; + +// In the future, when Proxies are default, we can add methods like `.to()` to primitive strings. +// For now, this is a dummy function to bookmark places we need such strings +function ShellString(str) { + return str; +} +exports.ShellString = ShellString; + +// Return the home directory in a platform-agnostic way, with consideration for +// older versions of node +function getUserHome() { + var result; + if (os.homedir) + result = os.homedir(); // node 3+ + else + result = process.env[(process.platform === 'win32') ? 'USERPROFILE' : 'HOME']; + return result; +} +exports.getUserHome = getUserHome; + +// Returns {'alice': true, 'bob': false} when passed a string and dictionary as follows: +// parseOptions('-a', {'a':'alice', 'b':'bob'}); +// Returns {'reference': 'string-value', 'bob': false} when passed two dictionaries of the form: +// parseOptions({'-r': 'string-value'}, {'r':'reference', 'b':'bob'}); +function parseOptions(opt, map) { + if (!map) + error('parseOptions() internal error: no map given'); + + // All options are false by default + var options = {}; + for (var letter in map) { + if (map[letter][0] !== '!') + options[map[letter]] = false; + } + + if (!opt) + return options; // defaults + + var optionName; + if (typeof opt === 'string') { + if (opt[0] !== '-') + return options; + + // e.g. chars = ['R', 'f'] + var chars = opt.slice(1).split(''); + + chars.forEach(function(c) { + if (c in map) { + optionName = map[c]; + if (optionName[0] === '!') + options[optionName.slice(1, optionName.length-1)] = false; + else + options[optionName] = true; + } else { + error('option not recognized: '+c); + } + }); + } else if (typeof opt === 'object') { + for (var key in opt) { + // key is a string of the form '-r', '-d', etc. + var c = key[1]; + if (c in map) { + optionName = map[c]; + options[optionName] = opt[key]; // assign the given value + } else { + error('option not recognized: '+c); + } + } + } else { + error('options must be strings or key-value pairs'); + } + return options; +} +exports.parseOptions = parseOptions; + +// Expands wildcards with matching (ie. existing) file names. +// For example: +// expand(['file*.js']) = ['file1.js', 'file2.js', ...] +// (if the files 'file1.js', 'file2.js', etc, exist in the current dir) +function expand(list) { + var expanded = []; + list.forEach(function(listEl) { + // Wildcard present on directory names ? + if(listEl.search(/\*[^\/]*\//) > -1 || listEl.search(/\*\*[^\/]*\//) > -1) { + var match = listEl.match(/^([^*]+\/|)(.*)/); + var root = match[1]; + var rest = match[2]; + var restRegex = rest.replace(/\*\*/g, ".*").replace(/\*/g, "[^\\/]*"); + restRegex = new RegExp(restRegex); + + _ls('-R', root).filter(function (e) { + return restRegex.test(e); + }).forEach(function(file) { + expanded.push(file); + }); + } + // Wildcard present on file names ? + else if (listEl.search(/\*/) > -1) { + _ls('', listEl).forEach(function(file) { + expanded.push(file); + }); + } else { + expanded.push(listEl); + } + }); + return expanded; +} +exports.expand = expand; + +// Normalizes _unlinkSync() across platforms to match Unix behavior, i.e. +// file can be unlinked even if it's read-only, see https://github.com/joyent/node/issues/3006 +function unlinkSync(file) { + try { + fs.unlinkSync(file); + } catch(e) { + // Try to override file permission + if (e.code === 'EPERM') { + fs.chmodSync(file, '0666'); + fs.unlinkSync(file); + } else { + throw e; + } + } +} +exports.unlinkSync = unlinkSync; + +// e.g. 'shelljs_a5f185d0443ca...' +function randomFileName() { + function randomHash(count) { + if (count === 1) + return parseInt(16*Math.random(), 10).toString(16); + else { + var hash = ''; + for (var i=0; i and/or '); + } else if (arguments.length > 3) { + sources = [].slice.call(arguments, 1, arguments.length - 1); + dest = arguments[arguments.length - 1]; + } else if (typeof sources === 'string') { + sources = [sources]; + } else if ('length' in sources) { + sources = sources; // no-op for array + } else { + common.error('invalid arguments'); + } + + var exists = fs.existsSync(dest), + stats = exists && fs.statSync(dest); + + // Dest is not existing dir, but multiple sources given + if ((!exists || !stats.isDirectory()) && sources.length > 1) + common.error('dest is not a directory (too many sources)'); + + // Dest is an existing file, but no -f given + if (exists && stats.isFile() && options.no_force) + common.error('dest file already exists: ' + dest); + + if (options.recursive) { + // Recursive allows the shortcut syntax "sourcedir/" for "sourcedir/*" + // (see Github issue #15) + sources.forEach(function(src, i) { + if (src[src.length - 1] === '/') { + sources[i] += '*'; + // If src is a directory and dest doesn't exist, 'cp -r src dest' should copy src/* into dest + } else if (fs.statSync(src).isDirectory() && !exists) { + sources[i] += '/*'; + } + }); + + // Create dest + try { + fs.mkdirSync(dest, parseInt('0777', 8)); + } catch (e) { + // like Unix's cp, keep going even if we can't create dest dir + } + } + + sources = common.expand(sources); + + sources.forEach(function(src) { + if (!fs.existsSync(src)) { + common.error('no such file or directory: '+src, true); + return; // skip file + } + + // If here, src exists + if (fs.statSync(src).isDirectory()) { + if (!options.recursive) { + // Non-Recursive + common.log(src + ' is a directory (not copied)'); + } else { + // Recursive + // 'cp /a/source dest' should create 'source' in 'dest' + var newDest = path.join(dest, path.basename(src)), + checkDir = fs.statSync(src); + try { + fs.mkdirSync(newDest, checkDir.mode); + } catch (e) { + //if the directory already exists, that's okay + if (e.code !== 'EEXIST') { + common.error('dest file no such file or directory: ' + newDest, true); + throw e; + } + } + + cpdirSyncRecursive(src, newDest, {no_force: options.no_force}); + } + return; // done with dir + } + + // If here, src is a file + + // When copying to '/path/dir': + // thisDest = '/path/dir/file1' + var thisDest = dest; + if (fs.existsSync(dest) && fs.statSync(dest).isDirectory()) + thisDest = path.normalize(dest + '/' + path.basename(src)); + + if (fs.existsSync(thisDest) && options.no_force) { + common.error('dest file already exists: ' + thisDest, true); + return; // skip file + } + + copyFileSync(src, thisDest); + }); // forEach(src) +} +module.exports = _cp; diff --git a/tools/eslint/node_modules/shelljs/src/dirs.js b/tools/eslint/node_modules/shelljs/src/dirs.js new file mode 100644 index 00000000000000..58fae8b3c6fae3 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/dirs.js @@ -0,0 +1,191 @@ +var common = require('./common'); +var _cd = require('./cd'); +var path = require('path'); + +// Pushd/popd/dirs internals +var _dirStack = []; + +function _isStackIndex(index) { + return (/^[\-+]\d+$/).test(index); +} + +function _parseStackIndex(index) { + if (_isStackIndex(index)) { + if (Math.abs(index) < _dirStack.length + 1) { // +1 for pwd + return (/^-/).test(index) ? Number(index) - 1 : Number(index); + } else { + common.error(index + ': directory stack index out of range'); + } + } else { + common.error(index + ': invalid number'); + } +} + +function _actualDirStack() { + return [process.cwd()].concat(_dirStack); +} + +//@ +//@ ### pushd([options,] [dir | '-N' | '+N']) +//@ +//@ Available options: +//@ +//@ + `-n`: Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated. +//@ +//@ Arguments: +//@ +//@ + `dir`: Makes the current working directory be the top of the stack, and then executes the equivalent of `cd dir`. +//@ + `+N`: Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. +//@ + `-N`: Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. +//@ +//@ Examples: +//@ +//@ ```javascript +//@ // process.cwd() === '/usr' +//@ pushd('/etc'); // Returns /etc /usr +//@ pushd('+1'); // Returns /usr /etc +//@ ``` +//@ +//@ Save the current directory on the top of the directory stack and then cd to `dir`. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack. +function _pushd(options, dir) { + if (_isStackIndex(options)) { + dir = options; + options = ''; + } + + options = common.parseOptions(options, { + 'n' : 'no-cd' + }); + + var dirs = _actualDirStack(); + + if (dir === '+0') { + return dirs; // +0 is a noop + } else if (!dir) { + if (dirs.length > 1) { + dirs = dirs.splice(1, 1).concat(dirs); + } else { + return common.error('no other directory'); + } + } else if (_isStackIndex(dir)) { + var n = _parseStackIndex(dir); + dirs = dirs.slice(n).concat(dirs.slice(0, n)); + } else { + if (options['no-cd']) { + dirs.splice(1, 0, dir); + } else { + dirs.unshift(dir); + } + } + + if (options['no-cd']) { + dirs = dirs.slice(1); + } else { + dir = path.resolve(dirs.shift()); + _cd('', dir); + } + + _dirStack = dirs; + return _dirs(''); +} +exports.pushd = _pushd; + +//@ +//@ ### popd([options,] ['-N' | '+N']) +//@ +//@ Available options: +//@ +//@ + `-n`: Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated. +//@ +//@ Arguments: +//@ +//@ + `+N`: Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero. +//@ + `-N`: Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero. +//@ +//@ Examples: +//@ +//@ ```javascript +//@ echo(process.cwd()); // '/usr' +//@ pushd('/etc'); // '/etc /usr' +//@ echo(process.cwd()); // '/etc' +//@ popd(); // '/usr' +//@ echo(process.cwd()); // '/usr' +//@ ``` +//@ +//@ When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack. +function _popd(options, index) { + if (_isStackIndex(options)) { + index = options; + options = ''; + } + + options = common.parseOptions(options, { + 'n' : 'no-cd' + }); + + if (!_dirStack.length) { + return common.error('directory stack empty'); + } + + index = _parseStackIndex(index || '+0'); + + if (options['no-cd'] || index > 0 || _dirStack.length + index === 0) { + index = index > 0 ? index - 1 : index; + _dirStack.splice(index, 1); + } else { + var dir = path.resolve(_dirStack.shift()); + _cd('', dir); + } + + return _dirs(''); +} +exports.popd = _popd; + +//@ +//@ ### dirs([options | '+N' | '-N']) +//@ +//@ Available options: +//@ +//@ + `-c`: Clears the directory stack by deleting all of the elements. +//@ +//@ Arguments: +//@ +//@ + `+N`: Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero. +//@ + `-N`: Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero. +//@ +//@ Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified. +//@ +//@ See also: pushd, popd +function _dirs(options, index) { + if (_isStackIndex(options)) { + index = options; + options = ''; + } + + options = common.parseOptions(options, { + 'c' : 'clear' + }); + + if (options['clear']) { + _dirStack = []; + return _dirStack; + } + + var stack = _actualDirStack(); + + if (index) { + index = _parseStackIndex(index); + + if (index < 0) { + index = stack.length + index; + } + + common.log(stack[index]); + return stack[index]; + } + + common.log(stack.join(' ')); + + return stack; +} +exports.dirs = _dirs; diff --git a/tools/eslint/node_modules/shelljs/src/echo.js b/tools/eslint/node_modules/shelljs/src/echo.js new file mode 100644 index 00000000000000..b574adc5c38465 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/echo.js @@ -0,0 +1,20 @@ +var common = require('./common'); + +//@ +//@ ### echo(string [, string ...]) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ echo('hello world'); +//@ var str = echo('hello world'); +//@ ``` +//@ +//@ Prints string to stdout, and returns string with additional utility methods +//@ like `.to()`. +function _echo() { + var messages = [].slice.call(arguments, 0); + console.log.apply(console, messages); + return common.ShellString(messages.join(' ')); +} +module.exports = _echo; diff --git a/tools/eslint/node_modules/shelljs/src/error.js b/tools/eslint/node_modules/shelljs/src/error.js new file mode 100644 index 00000000000000..112563db80311e --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/error.js @@ -0,0 +1,10 @@ +var common = require('./common'); + +//@ +//@ ### error() +//@ Tests if error occurred in the last command. Returns `null` if no error occurred, +//@ otherwise returns string explaining the error +function error() { + return common.state.error; +} +module.exports = error; diff --git a/tools/eslint/node_modules/shelljs/src/exec.js b/tools/eslint/node_modules/shelljs/src/exec.js new file mode 100644 index 00000000000000..4174adbd32d317 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/exec.js @@ -0,0 +1,249 @@ +var common = require('./common'); +var _tempDir = require('./tempdir'); +var _pwd = require('./pwd'); +var path = require('path'); +var fs = require('fs'); +var child = require('child_process'); + +var DEFAULT_MAXBUFFER_SIZE = 20*1024*1024; + +// Hack to run child_process.exec() synchronously (sync avoids callback hell) +// Uses a custom wait loop that checks for a flag file, created when the child process is done. +// (Can't do a wait loop that checks for internal Node variables/messages as +// Node is single-threaded; callbacks and other internal state changes are done in the +// event loop). +function execSync(cmd, opts) { + var tempDir = _tempDir(); + var stdoutFile = path.resolve(tempDir+'/'+common.randomFileName()), + stderrFile = path.resolve(tempDir+'/'+common.randomFileName()), + codeFile = path.resolve(tempDir+'/'+common.randomFileName()), + scriptFile = path.resolve(tempDir+'/'+common.randomFileName()), + sleepFile = path.resolve(tempDir+'/'+common.randomFileName()); + + opts = common.extend({ + silent: common.config.silent, + cwd: _pwd(), + env: process.env, + maxBuffer: DEFAULT_MAXBUFFER_SIZE + }, opts); + + var previousStdoutContent = '', + previousStderrContent = ''; + // Echoes stdout and stderr changes from running process, if not silent + function updateStream(streamFile) { + if (opts.silent || !fs.existsSync(streamFile)) + return; + + var previousStreamContent, + proc_stream; + if (streamFile === stdoutFile) { + previousStreamContent = previousStdoutContent; + proc_stream = process.stdout; + } else { // assume stderr + previousStreamContent = previousStderrContent; + proc_stream = process.stderr; + } + + var streamContent = fs.readFileSync(streamFile, 'utf8'); + // No changes since last time? + if (streamContent.length <= previousStreamContent.length) + return; + + proc_stream.write(streamContent.substr(previousStreamContent.length)); + previousStreamContent = streamContent; + } + + function escape(str) { + return (str+'').replace(/([\\"'])/g, "\\$1").replace(/\0/g, "\\0"); + } + + if (fs.existsSync(scriptFile)) common.unlinkSync(scriptFile); + if (fs.existsSync(stdoutFile)) common.unlinkSync(stdoutFile); + if (fs.existsSync(stderrFile)) common.unlinkSync(stderrFile); + if (fs.existsSync(codeFile)) common.unlinkSync(codeFile); + + var execCommand = '"'+process.execPath+'" '+scriptFile; + var script; + + if (typeof child.execSync === 'function') { + script = [ + "var child = require('child_process')", + " , fs = require('fs');", + "var childProcess = child.exec('"+escape(cmd)+"', {env: process.env, maxBuffer: "+opts.maxBuffer+"}, function(err) {", + " fs.writeFileSync('"+escape(codeFile)+"', err ? err.code.toString() : '0');", + "});", + "var stdoutStream = fs.createWriteStream('"+escape(stdoutFile)+"');", + "var stderrStream = fs.createWriteStream('"+escape(stderrFile)+"');", + "childProcess.stdout.pipe(stdoutStream, {end: false});", + "childProcess.stderr.pipe(stderrStream, {end: false});", + "childProcess.stdout.pipe(process.stdout);", + "childProcess.stderr.pipe(process.stderr);", + "var stdoutEnded = false, stderrEnded = false;", + "function tryClosingStdout(){ if(stdoutEnded){ stdoutStream.end(); } }", + "function tryClosingStderr(){ if(stderrEnded){ stderrStream.end(); } }", + "childProcess.stdout.on('end', function(){ stdoutEnded = true; tryClosingStdout(); });", + "childProcess.stderr.on('end', function(){ stderrEnded = true; tryClosingStderr(); });" + ].join('\n'); + + fs.writeFileSync(scriptFile, script); + + if (opts.silent) { + opts.stdio = 'ignore'; + } else { + opts.stdio = [0, 1, 2]; + } + + // Welcome to the future + child.execSync(execCommand, opts); + } else { + cmd += ' > '+stdoutFile+' 2> '+stderrFile; // works on both win/unix + + script = [ + "var child = require('child_process')", + " , fs = require('fs');", + "var childProcess = child.exec('"+escape(cmd)+"', {env: process.env, maxBuffer: "+opts.maxBuffer+"}, function(err) {", + " fs.writeFileSync('"+escape(codeFile)+"', err ? err.code.toString() : '0');", + "});" + ].join('\n'); + + fs.writeFileSync(scriptFile, script); + + child.exec(execCommand, opts); + + // The wait loop + // sleepFile is used as a dummy I/O op to mitigate unnecessary CPU usage + // (tried many I/O sync ops, writeFileSync() seems to be only one that is effective in reducing + // CPU usage, though apparently not so much on Windows) + while (!fs.existsSync(codeFile)) { updateStream(stdoutFile); fs.writeFileSync(sleepFile, 'a'); } + while (!fs.existsSync(stdoutFile)) { updateStream(stdoutFile); fs.writeFileSync(sleepFile, 'a'); } + while (!fs.existsSync(stderrFile)) { updateStream(stderrFile); fs.writeFileSync(sleepFile, 'a'); } + } + + // At this point codeFile exists, but it's not necessarily flushed yet. + // Keep reading it until it is. + var code = parseInt('', 10); + while (isNaN(code)) { + code = parseInt(fs.readFileSync(codeFile, 'utf8'), 10); + } + + var stdout = fs.readFileSync(stdoutFile, 'utf8'); + var stderr = fs.readFileSync(stderrFile, 'utf8'); + + // No biggie if we can't erase the files now -- they're in a temp dir anyway + try { common.unlinkSync(scriptFile); } catch(e) {} + try { common.unlinkSync(stdoutFile); } catch(e) {} + try { common.unlinkSync(stderrFile); } catch(e) {} + try { common.unlinkSync(codeFile); } catch(e) {} + try { common.unlinkSync(sleepFile); } catch(e) {} + + // some shell return codes are defined as errors, per http://tldp.org/LDP/abs/html/exitcodes.html + if (code === 1 || code === 2 || code >= 126) { + common.error('', true); // unix/shell doesn't really give an error message after non-zero exit codes + } + // True if successful, false if not + var obj = { + code: code, + output: stdout, // deprecated + stdout: stdout, + stderr: stderr + }; + return obj; +} // execSync() + +// Wrapper around exec() to enable echoing output to console in real time +function execAsync(cmd, opts, callback) { + var stdout = ''; + var stderr = ''; + + opts = common.extend({ + silent: common.config.silent, + cwd: _pwd(), + env: process.env, + maxBuffer: DEFAULT_MAXBUFFER_SIZE + }, opts); + + var c = child.exec(cmd, opts, function(err) { + if (callback) + callback(err ? err.code : 0, stdout, stderr); + }); + + c.stdout.on('data', function(data) { + stdout += data; + if (!opts.silent) + process.stdout.write(data); + }); + + c.stderr.on('data', function(data) { + stderr += data; + if (!opts.silent) + process.stderr.write(data); + }); + + return c; +} + +//@ +//@ ### exec(command [, options] [, callback]) +//@ Available options (all `false` by default): +//@ +//@ + `async`: Asynchronous execution. If a callback is provided, it will be set to +//@ `true`, regardless of the passed value. +//@ + `silent`: Do not echo program output to console. +//@ + and any option available to NodeJS's +//@ [child_process.exec()](https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var version = exec('node --version', {silent:true}).stdout; +//@ +//@ var child = exec('some_long_running_process', {async:true}); +//@ child.stdout.on('data', function(data) { +//@ /* ... do something with data ... */ +//@ }); +//@ +//@ exec('some_long_running_process', function(code, stdout, stderr) { +//@ console.log('Exit code:', code); +//@ console.log('Program output:', stdout); +//@ console.log('Program stderr:', stderr); +//@ }); +//@ ``` +//@ +//@ Executes the given `command` _synchronously_, unless otherwise specified. When in synchronous +//@ mode returns the object `{ code:..., stdout:... , stderr:... }`, containing the program's +//@ `stdout`, `stderr`, and its exit `code`. Otherwise returns the child process object, +//@ and the `callback` gets the arguments `(code, stdout, stderr)`. +//@ +//@ **Note:** For long-lived processes, it's best to run `exec()` asynchronously as +//@ the current synchronous implementation uses a lot of CPU. This should be getting +//@ fixed soon. +function _exec(command, options, callback) { + if (!command) + common.error('must specify command'); + + // Callback is defined instead of options. + if (typeof options === 'function') { + callback = options; + options = { async: true }; + } + + // Callback is defined with options. + if (typeof options === 'object' && typeof callback === 'function') { + options.async = true; + } + + options = common.extend({ + silent: common.config.silent, + async: false + }, options); + + try { + if (options.async) + return execAsync(command, options, callback); + else + return execSync(command, options); + } catch (e) { + common.error('internal error'); + } +} +module.exports = _exec; diff --git a/tools/eslint/node_modules/shelljs/src/find.js b/tools/eslint/node_modules/shelljs/src/find.js new file mode 100644 index 00000000000000..c96fb2f7ad51e7 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/find.js @@ -0,0 +1,51 @@ +var fs = require('fs'); +var common = require('./common'); +var _ls = require('./ls'); + +//@ +//@ ### find(path [, path ...]) +//@ ### find(path_array) +//@ Examples: +//@ +//@ ```javascript +//@ find('src', 'lib'); +//@ find(['src', 'lib']); // same as above +//@ find('.').filter(function(file) { return file.match(/\.js$/); }); +//@ ``` +//@ +//@ Returns array of all files (however deep) in the given paths. +//@ +//@ The main difference from `ls('-R', path)` is that the resulting file names +//@ include the base directories, e.g. `lib/resources/file1` instead of just `file1`. +function _find(options, paths) { + if (!paths) + common.error('no path specified'); + else if (typeof paths === 'object') + paths = paths; // assume array + else if (typeof paths === 'string') + paths = [].slice.call(arguments, 1); + + var list = []; + + function pushFile(file) { + if (common.platform === 'win') + file = file.replace(/\\/g, '/'); + list.push(file); + } + + // why not simply do ls('-R', paths)? because the output wouldn't give the base dirs + // to get the base dir in the output, we need instead ls('-R', 'dir/*') for every directory + + paths.forEach(function(file) { + pushFile(file); + + if (fs.statSync(file).isDirectory()) { + _ls('-RA', file+'/*').forEach(function(subfile) { + pushFile(subfile); + }); + } + }); + + return list; +} +module.exports = _find; diff --git a/tools/eslint/node_modules/shelljs/src/grep.js b/tools/eslint/node_modules/shelljs/src/grep.js new file mode 100644 index 00000000000000..78008ce19e6d2f --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/grep.js @@ -0,0 +1,52 @@ +var common = require('./common'); +var fs = require('fs'); + +//@ +//@ ### grep([options,] regex_filter, file [, file ...]) +//@ ### grep([options,] regex_filter, file_array) +//@ Available options: +//@ +//@ + `-v`: Inverse the sense of the regex and print the lines not matching the criteria. +//@ +//@ Examples: +//@ +//@ ```javascript +//@ grep('-v', 'GLOBAL_VARIABLE', '*.js'); +//@ grep('GLOBAL_VARIABLE', '*.js'); +//@ ``` +//@ +//@ Reads input string from given files and returns a string containing all lines of the +//@ file that match the given `regex_filter`. Wildcard `*` accepted. +function _grep(options, regex, files) { + options = common.parseOptions(options, { + 'v': 'inverse' + }); + + if (!files) + common.error('no paths given'); + + if (typeof files === 'string') + files = [].slice.call(arguments, 2); + // if it's array leave it as it is + + files = common.expand(files); + + var grep = ''; + files.forEach(function(file) { + if (!fs.existsSync(file)) { + common.error('no such file or directory: ' + file, true); + return; + } + + var contents = fs.readFileSync(file, 'utf8'), + lines = contents.split(/\r*\n/); + lines.forEach(function(line) { + var matched = line.match(regex); + if ((options.inverse && !matched) || (!options.inverse && matched)) + grep += line + '\n'; + }); + }); + + return common.ShellString(grep); +} +module.exports = _grep; diff --git a/tools/eslint/node_modules/shelljs/src/ln.js b/tools/eslint/node_modules/shelljs/src/ln.js new file mode 100644 index 00000000000000..878fda13e23d45 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/ln.js @@ -0,0 +1,69 @@ +var fs = require('fs'); +var path = require('path'); +var common = require('./common'); + +//@ +//@ ### ln([options,] source, dest) +//@ Available options: +//@ +//@ + `-s`: symlink +//@ + `-f`: force +//@ +//@ Examples: +//@ +//@ ```javascript +//@ ln('file', 'newlink'); +//@ ln('-sf', 'file', 'existing'); +//@ ``` +//@ +//@ Links source to dest. Use -f to force the link, should dest already exist. +function _ln(options, source, dest) { + options = common.parseOptions(options, { + 's': 'symlink', + 'f': 'force' + }); + + if (!source || !dest) { + common.error('Missing and/or '); + } + + source = String(source); + var sourcePath = path.normalize(source).replace(RegExp(path.sep + '$'), ''); + var isAbsolute = (path.resolve(source) === sourcePath); + dest = path.resolve(process.cwd(), String(dest)); + + if (fs.existsSync(dest)) { + if (!options.force) { + common.error('Destination file exists', true); + } + + fs.unlinkSync(dest); + } + + if (options.symlink) { + var isWindows = common.platform === 'win'; + var linkType = isWindows ? 'file' : null; + var resolvedSourcePath = isAbsolute ? sourcePath : path.resolve(process.cwd(), path.dirname(dest), source); + if (!fs.existsSync(resolvedSourcePath)) { + common.error('Source file does not exist', true); + } else if (isWindows && fs.statSync(resolvedSourcePath).isDirectory()) { + linkType = 'junction'; + } + + try { + fs.symlinkSync(linkType === 'junction' ? resolvedSourcePath: source, dest, linkType); + } catch (err) { + common.error(err.message); + } + } else { + if (!fs.existsSync(source)) { + common.error('Source file does not exist', true); + } + try { + fs.linkSync(source, dest); + } catch (err) { + common.error(err.message); + } + } +} +module.exports = _ln; diff --git a/tools/eslint/node_modules/shelljs/src/ls.js b/tools/eslint/node_modules/shelljs/src/ls.js new file mode 100644 index 00000000000000..6a54b3a8d8426a --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/ls.js @@ -0,0 +1,168 @@ +var path = require('path'); +var fs = require('fs'); +var common = require('./common'); +var _cd = require('./cd'); +var _pwd = require('./pwd'); + +//@ +//@ ### ls([options,] [path, ...]) +//@ ### ls([options,] path_array) +//@ Available options: +//@ +//@ + `-R`: recursive +//@ + `-A`: all files (include files beginning with `.`, except for `.` and `..`) +//@ + `-d`: list directories themselves, not their contents +//@ + `-l`: list objects representing each file, each with fields containing `ls +//@ -l` output fields. See +//@ [fs.Stats](https://nodejs.org/api/fs.html#fs_class_fs_stats) +//@ for more info +//@ +//@ Examples: +//@ +//@ ```javascript +//@ ls('projs/*.js'); +//@ ls('-R', '/users/me', '/tmp'); +//@ ls('-R', ['/users/me', '/tmp']); // same as above +//@ ls('-l', 'file.txt'); // { name: 'file.txt', mode: 33188, nlink: 1, ...} +//@ ``` +//@ +//@ Returns array of files in the given path, or in current directory if no path provided. +function _ls(options, paths) { + options = common.parseOptions(options, { + 'R': 'recursive', + 'A': 'all', + 'a': 'all_deprecated', + 'd': 'directory', + 'l': 'long' + }); + + if (options.all_deprecated) { + // We won't support the -a option as it's hard to image why it's useful + // (it includes '.' and '..' in addition to '.*' files) + // For backwards compatibility we'll dump a deprecated message and proceed as before + common.log('ls: Option -a is deprecated. Use -A instead'); + options.all = true; + } + + if (!paths) + paths = ['.']; + else if (typeof paths === 'object') + paths = paths; // assume array + else if (typeof paths === 'string') + paths = [].slice.call(arguments, 1); + + var list = []; + + // Conditionally pushes file to list - returns true if pushed, false otherwise + // (e.g. prevents hidden files to be included unless explicitly told so) + function pushFile(file, query) { + var name = file.name || file; + // hidden file? + if (path.basename(name)[0] === '.') { + // not explicitly asking for hidden files? + if (!options.all && !(path.basename(query)[0] === '.' && path.basename(query).length > 1)) + return false; + } + + if (common.platform === 'win') + name = name.replace(/\\/g, '/'); + + if (file.name) { + file.name = name; + } else { + file = name; + } + list.push(file); + return true; + } + + paths.forEach(function(p) { + if (fs.existsSync(p)) { + var stats = ls_stat(p); + // Simple file? + if (stats.isFile()) { + if (options.long) { + pushFile(stats, p); + } else { + pushFile(p, p); + } + return; // continue + } + + // Simple dir? + if (options.directory) { + pushFile(p, p); + return; + } else if (stats.isDirectory()) { + // Iterate over p contents + fs.readdirSync(p).forEach(function(file) { + var orig_file = file; + if (options.long) + file = ls_stat(path.join(p, file)); + if (!pushFile(file, p)) + return; + + // Recursive? + if (options.recursive) { + var oldDir = _pwd(); + _cd('', p); + if (fs.statSync(orig_file).isDirectory()) + list = list.concat(_ls('-R'+(options.all?'A':''), orig_file+'/*')); + _cd('', oldDir); + } + }); + return; // continue + } + } + + // p does not exist - possible wildcard present + + var basename = path.basename(p); + var dirname = path.dirname(p); + // Wildcard present on an existing dir? (e.g. '/tmp/*.js') + if (basename.search(/\*/) > -1 && fs.existsSync(dirname) && fs.statSync(dirname).isDirectory) { + // Escape special regular expression chars + var regexp = basename.replace(/(\^|\$|\(|\)|<|>|\[|\]|\{|\}|\.|\+|\?)/g, '\\$1'); + // Translates wildcard into regex + regexp = '^' + regexp.replace(/\*/g, '.*') + '$'; + // Iterate over directory contents + fs.readdirSync(dirname).forEach(function(file) { + if (file.match(new RegExp(regexp))) { + var file_path = path.join(dirname, file); + file_path = options.long ? ls_stat(file_path) : file_path; + if (file_path.name) + file_path.name = path.normalize(file_path.name); + else + file_path = path.normalize(file_path); + if (!pushFile(file_path, basename)) + return; + + // Recursive? + if (options.recursive) { + var pp = dirname + '/' + file; + if (fs.lstatSync(pp).isDirectory()) + list = list.concat(_ls('-R'+(options.all?'A':''), pp+'/*')); + } // recursive + } // if file matches + }); // forEach + return; + } + + common.error('no such file or directory: ' + p, true); + }); + + return list; +} +module.exports = _ls; + + +function ls_stat(path) { + var stats = fs.statSync(path); + // Note: this object will contain more information than .toString() returns + stats.name = path; + stats.toString = function() { + // Return a string resembling unix's `ls -l` format + return [this.mode, this.nlink, this.uid, this.gid, this.size, this.mtime, this.name].join(' '); + }; + return stats; +} diff --git a/tools/eslint/node_modules/shelljs/src/mkdir.js b/tools/eslint/node_modules/shelljs/src/mkdir.js new file mode 100644 index 00000000000000..8b4fd99075053a --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/mkdir.js @@ -0,0 +1,68 @@ +var common = require('./common'); +var fs = require('fs'); +var path = require('path'); + +// Recursively creates 'dir' +function mkdirSyncRecursive(dir) { + var baseDir = path.dirname(dir); + + // Base dir exists, no recursion necessary + if (fs.existsSync(baseDir)) { + fs.mkdirSync(dir, parseInt('0777', 8)); + return; + } + + // Base dir does not exist, go recursive + mkdirSyncRecursive(baseDir); + + // Base dir created, can create dir + fs.mkdirSync(dir, parseInt('0777', 8)); +} + +//@ +//@ ### mkdir([options,] dir [, dir ...]) +//@ ### mkdir([options,] dir_array) +//@ Available options: +//@ +//@ + `-p`: full path (will create intermediate dirs if necessary) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ mkdir('-p', '/tmp/a/b/c/d', '/tmp/e/f/g'); +//@ mkdir('-p', ['/tmp/a/b/c/d', '/tmp/e/f/g']); // same as above +//@ ``` +//@ +//@ Creates directories. +function _mkdir(options, dirs) { + options = common.parseOptions(options, { + 'p': 'fullpath' + }); + if (!dirs) + common.error('no paths given'); + + if (typeof dirs === 'string') + dirs = [].slice.call(arguments, 1); + // if it's array leave it as it is + + dirs.forEach(function(dir) { + if (fs.existsSync(dir)) { + if (!options.fullpath) + common.error('path already exists: ' + dir, true); + return; // skip dir + } + + // Base dir does not exist, and no -p option given + var baseDir = path.dirname(dir); + if (!fs.existsSync(baseDir) && !options.fullpath) { + common.error('no such file or directory: ' + baseDir, true); + return; // skip dir + } + + if (options.fullpath) + mkdirSyncRecursive(dir); + else + fs.mkdirSync(dir, parseInt('0777', 8)); + }); +} // mkdir +module.exports = _mkdir; diff --git a/tools/eslint/node_modules/shelljs/src/mv.js b/tools/eslint/node_modules/shelljs/src/mv.js new file mode 100644 index 00000000000000..69cc03fe1ebe2b --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/mv.js @@ -0,0 +1,82 @@ +var fs = require('fs'); +var path = require('path'); +var common = require('./common'); + +//@ +//@ ### mv([options ,] source [, source ...], dest') +//@ ### mv([options ,] source_array, dest') +//@ Available options: +//@ +//@ + `-f`: force (default behavior) +//@ + `-n`: no-clobber +//@ +//@ Examples: +//@ +//@ ```javascript +//@ mv('-n', 'file', 'dir/'); +//@ mv('file1', 'file2', 'dir/'); +//@ mv(['file1', 'file2'], 'dir/'); // same as above +//@ ``` +//@ +//@ Moves files. The wildcard `*` is accepted. +function _mv(options, sources, dest) { + options = common.parseOptions(options, { + 'f': '!no_force', + 'n': 'no_force' + }); + + // Get sources, dest + if (arguments.length < 3) { + common.error('missing and/or '); + } else if (arguments.length > 3) { + sources = [].slice.call(arguments, 1, arguments.length - 1); + dest = arguments[arguments.length - 1]; + } else if (typeof sources === 'string') { + sources = [sources]; + } else if ('length' in sources) { + sources = sources; // no-op for array + } else { + common.error('invalid arguments'); + } + + sources = common.expand(sources); + + var exists = fs.existsSync(dest), + stats = exists && fs.statSync(dest); + + // Dest is not existing dir, but multiple sources given + if ((!exists || !stats.isDirectory()) && sources.length > 1) + common.error('dest is not a directory (too many sources)'); + + // Dest is an existing file, but no -f given + if (exists && stats.isFile() && options.no_force) + common.error('dest file already exists: ' + dest); + + sources.forEach(function(src) { + if (!fs.existsSync(src)) { + common.error('no such file or directory: '+src, true); + return; // skip file + } + + // If here, src exists + + // When copying to '/path/dir': + // thisDest = '/path/dir/file1' + var thisDest = dest; + if (fs.existsSync(dest) && fs.statSync(dest).isDirectory()) + thisDest = path.normalize(dest + '/' + path.basename(src)); + + if (fs.existsSync(thisDest) && options.no_force) { + common.error('dest file already exists: ' + thisDest, true); + return; // skip file + } + + if (path.resolve(src) === path.dirname(path.resolve(thisDest))) { + common.error('cannot move to self: '+src, true); + return; // skip file + } + + fs.renameSync(src, thisDest); + }); // forEach(src) +} // mv +module.exports = _mv; diff --git a/tools/eslint/node_modules/shelljs/src/popd.js b/tools/eslint/node_modules/shelljs/src/popd.js new file mode 100644 index 00000000000000..11ea24fa464a04 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/popd.js @@ -0,0 +1 @@ +// see dirs.js \ No newline at end of file diff --git a/tools/eslint/node_modules/shelljs/src/pushd.js b/tools/eslint/node_modules/shelljs/src/pushd.js new file mode 100644 index 00000000000000..11ea24fa464a04 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/pushd.js @@ -0,0 +1 @@ +// see dirs.js \ No newline at end of file diff --git a/tools/eslint/node_modules/shelljs/src/pwd.js b/tools/eslint/node_modules/shelljs/src/pwd.js new file mode 100644 index 00000000000000..26cefe0a0454d0 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/pwd.js @@ -0,0 +1,11 @@ +var path = require('path'); +var common = require('./common'); + +//@ +//@ ### pwd() +//@ Returns the current directory. +function _pwd() { + var pwd = path.resolve(process.cwd()); + return common.ShellString(pwd); +} +module.exports = _pwd; diff --git a/tools/eslint/node_modules/shelljs/src/rm.js b/tools/eslint/node_modules/shelljs/src/rm.js new file mode 100644 index 00000000000000..cf2e95b6d816bc --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/rm.js @@ -0,0 +1,163 @@ +var common = require('./common'); +var fs = require('fs'); + +// Recursively removes 'dir' +// Adapted from https://github.com/ryanmcgrath/wrench-js +// +// Copyright (c) 2010 Ryan McGrath +// Copyright (c) 2012 Artur Adib +// +// Licensed under the MIT License +// http://www.opensource.org/licenses/mit-license.php +function rmdirSyncRecursive(dir, force) { + var files; + + files = fs.readdirSync(dir); + + // Loop through and delete everything in the sub-tree after checking it + for(var i = 0; i < files.length; i++) { + var file = dir + "/" + files[i], + currFile = fs.lstatSync(file); + + if(currFile.isDirectory()) { // Recursive function back to the beginning + rmdirSyncRecursive(file, force); + } + + else if(currFile.isSymbolicLink()) { // Unlink symlinks + if (force || isWriteable(file)) { + try { + common.unlinkSync(file); + } catch (e) { + common.error('could not remove file (code '+e.code+'): ' + file, true); + } + } + } + + else // Assume it's a file - perhaps a try/catch belongs here? + if (force || isWriteable(file)) { + try { + common.unlinkSync(file); + } catch (e) { + common.error('could not remove file (code '+e.code+'): ' + file, true); + } + } + } + + // Now that we know everything in the sub-tree has been deleted, we can delete the main directory. + // Huzzah for the shopkeep. + + var result; + try { + // Retry on windows, sometimes it takes a little time before all the files in the directory are gone + var start = Date.now(); + while (true) { + try { + result = fs.rmdirSync(dir); + if (fs.existsSync(dir)) throw { code: "EAGAIN" }; + break; + } catch(er) { + // In addition to error codes, also check if the directory still exists and loop again if true + if (process.platform === "win32" && (er.code === "ENOTEMPTY" || er.code === "EBUSY" || er.code === "EPERM" || er.code === "EAGAIN")) { + if (Date.now() - start > 1000) throw er; + } else if (er.code === "ENOENT") { + // Directory did not exist, deletion was successful + break; + } else { + throw er; + } + } + } + } catch(e) { + common.error('could not remove directory (code '+e.code+'): ' + dir, true); + } + + return result; +} // rmdirSyncRecursive + +// Hack to determine if file has write permissions for current user +// Avoids having to check user, group, etc, but it's probably slow +function isWriteable(file) { + var writePermission = true; + try { + var __fd = fs.openSync(file, 'a'); + fs.closeSync(__fd); + } catch(e) { + writePermission = false; + } + + return writePermission; +} + +//@ +//@ ### rm([options,] file [, file ...]) +//@ ### rm([options,] file_array) +//@ Available options: +//@ +//@ + `-f`: force +//@ + `-r, -R`: recursive +//@ +//@ Examples: +//@ +//@ ```javascript +//@ rm('-rf', '/tmp/*'); +//@ rm('some_file.txt', 'another_file.txt'); +//@ rm(['some_file.txt', 'another_file.txt']); // same as above +//@ ``` +//@ +//@ Removes files. The wildcard `*` is accepted. +function _rm(options, files) { + options = common.parseOptions(options, { + 'f': 'force', + 'r': 'recursive', + 'R': 'recursive' + }); + if (!files) + common.error('no paths given'); + + if (typeof files === 'string') + files = [].slice.call(arguments, 1); + // if it's array leave it as it is + + files = common.expand(files); + + files.forEach(function(file) { + if (!fs.existsSync(file)) { + // Path does not exist, no force flag given + if (!options.force) + common.error('no such file or directory: '+file, true); + + return; // skip file + } + + // If here, path exists + + var stats = fs.lstatSync(file); + if (stats.isFile() || stats.isSymbolicLink()) { + + // Do not check for file writing permissions + if (options.force) { + common.unlinkSync(file); + return; + } + + if (isWriteable(file)) + common.unlinkSync(file); + else + common.error('permission denied: '+file, true); + + return; + } // simple file + + // Path is an existing directory, but no -r flag given + if (stats.isDirectory() && !options.recursive) { + common.error('path is a directory', true); + return; // skip path + } + + // Recursively remove existing directory + if (stats.isDirectory() && options.recursive) { + rmdirSyncRecursive(file, options.force); + } + }); // forEach(file) +} // rm +module.exports = _rm; diff --git a/tools/eslint/node_modules/shelljs/src/sed.js b/tools/eslint/node_modules/shelljs/src/sed.js new file mode 100644 index 00000000000000..baa385ba1167d4 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/sed.js @@ -0,0 +1,64 @@ +var common = require('./common'); +var fs = require('fs'); + +//@ +//@ ### sed([options,] search_regex, replacement, file [, file ...]) +//@ ### sed([options,] search_regex, replacement, file_array) +//@ Available options: +//@ +//@ + `-i`: Replace contents of 'file' in-place. _Note that no backups will be created!_ +//@ +//@ Examples: +//@ +//@ ```javascript +//@ sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js'); +//@ sed(/.*DELETE_THIS_LINE.*\n/, '', 'source.js'); +//@ ``` +//@ +//@ Reads an input string from `files` and performs a JavaScript `replace()` on the input +//@ using the given search regex and replacement string or function. Returns the new string after replacement. +function _sed(options, regex, replacement, files) { + options = common.parseOptions(options, { + 'i': 'inplace' + }); + + if (typeof replacement === 'string' || typeof replacement === 'function') + replacement = replacement; // no-op + else if (typeof replacement === 'number') + replacement = replacement.toString(); // fallback + else + common.error('invalid replacement string'); + + // Convert all search strings to RegExp + if (typeof regex === 'string') + regex = RegExp(regex); + + if (!files) + common.error('no files given'); + + if (typeof files === 'string') + files = [].slice.call(arguments, 3); + // if it's array leave it as it is + + files = common.expand(files); + + var sed = []; + files.forEach(function(file) { + if (!fs.existsSync(file)) { + common.error('no such file or directory: ' + file, true); + return; + } + + var result = fs.readFileSync(file, 'utf8').split('\n').map(function (line) { + return line.replace(regex, replacement); + }).join('\n'); + + sed.push(result); + + if (options.inplace) + fs.writeFileSync(file, result, 'utf8'); + }); + + return common.ShellString(sed.join('\n')); +} +module.exports = _sed; diff --git a/tools/eslint/node_modules/shelljs/src/set.js b/tools/eslint/node_modules/shelljs/src/set.js new file mode 100644 index 00000000000000..19e26d979d3f4b --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/set.js @@ -0,0 +1,49 @@ +var common = require('./common'); + +//@ +//@ ### set(options) +//@ Available options: +//@ +//@ + `+/-e`: exit upon error (`config.fatal`) +//@ + `+/-v`: verbose: show all commands (`config.verbose`) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ set('-e'); // exit upon first error +//@ set('+e'); // this undoes a "set('-e')" +//@ ``` +//@ +//@ Sets global configuration variables +function _set(options) { + if (!options) { + var args = [].slice.call(arguments, 0); + if (args.length < 2) + common.error('must provide an argument'); + options = args[1]; + } + var negate = (options[0] === '+'); + if (negate) { + options = '-' + options.slice(1); // parseOptions needs a '-' prefix + } + options = common.parseOptions(options, { + 'e': 'fatal', + 'v': 'verbose' + }); + + var key; + if (negate) { + for (key in options) + options[key] = !options[key]; + } + + for (key in options) { + // Only change the global config if `negate` is false and the option is true + // or if `negate` is true and the option is false (aka negate !== option) + if (negate !== options[key]) { + common.config[key] = options[key]; + } + } + return; +} +module.exports = _set; diff --git a/tools/eslint/node_modules/shelljs/src/tempdir.js b/tools/eslint/node_modules/shelljs/src/tempdir.js new file mode 100644 index 00000000000000..79b949f0d4f15b --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/tempdir.js @@ -0,0 +1,57 @@ +var common = require('./common'); +var os = require('os'); +var fs = require('fs'); + +// Returns false if 'dir' is not a writeable directory, 'dir' otherwise +function writeableDir(dir) { + if (!dir || !fs.existsSync(dir)) + return false; + + if (!fs.statSync(dir).isDirectory()) + return false; + + var testFile = dir+'/'+common.randomFileName(); + try { + fs.writeFileSync(testFile, ' '); + common.unlinkSync(testFile); + return dir; + } catch (e) { + return false; + } +} + + +//@ +//@ ### tempdir() +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var tmp = tempdir(); // "/tmp" for most *nix platforms +//@ ``` +//@ +//@ Searches and returns string containing a writeable, platform-dependent temporary directory. +//@ Follows Python's [tempfile algorithm](http://docs.python.org/library/tempfile.html#tempfile.tempdir). +function _tempDir() { + var state = common.state; + if (state.tempDir) + return state.tempDir; // from cache + + state.tempDir = writeableDir(os.tmpdir && os.tmpdir()) || // node 0.10+ + writeableDir(os.tmpDir && os.tmpDir()) || // node 0.8+ + writeableDir(process.env['TMPDIR']) || + writeableDir(process.env['TEMP']) || + writeableDir(process.env['TMP']) || + writeableDir(process.env['Wimp$ScrapDir']) || // RiscOS + writeableDir('C:\\TEMP') || // Windows + writeableDir('C:\\TMP') || // Windows + writeableDir('\\TEMP') || // Windows + writeableDir('\\TMP') || // Windows + writeableDir('/tmp') || + writeableDir('/var/tmp') || + writeableDir('/usr/tmp') || + writeableDir('.'); // last resort + + return state.tempDir; +} +module.exports = _tempDir; diff --git a/tools/eslint/node_modules/shelljs/src/test.js b/tools/eslint/node_modules/shelljs/src/test.js new file mode 100644 index 00000000000000..068a1ce06ef4c9 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/test.js @@ -0,0 +1,85 @@ +var common = require('./common'); +var fs = require('fs'); + +//@ +//@ ### test(expression) +//@ Available expression primaries: +//@ +//@ + `'-b', 'path'`: true if path is a block device +//@ + `'-c', 'path'`: true if path is a character device +//@ + `'-d', 'path'`: true if path is a directory +//@ + `'-e', 'path'`: true if path exists +//@ + `'-f', 'path'`: true if path is a regular file +//@ + `'-L', 'path'`: true if path is a symbolic link +//@ + `'-p', 'path'`: true if path is a pipe (FIFO) +//@ + `'-S', 'path'`: true if path is a socket +//@ +//@ Examples: +//@ +//@ ```javascript +//@ if (test('-d', path)) { /* do something with dir */ }; +//@ if (!test('-f', path)) continue; // skip if it's a regular file +//@ ``` +//@ +//@ Evaluates expression using the available primaries and returns corresponding value. +function _test(options, path) { + if (!path) + common.error('no path given'); + + // hack - only works with unary primaries + options = common.parseOptions(options, { + 'b': 'block', + 'c': 'character', + 'd': 'directory', + 'e': 'exists', + 'f': 'file', + 'L': 'link', + 'p': 'pipe', + 'S': 'socket' + }); + + var canInterpret = false; + for (var key in options) + if (options[key] === true) { + canInterpret = true; + break; + } + + if (!canInterpret) + common.error('could not interpret expression'); + + if (options.link) { + try { + return fs.lstatSync(path).isSymbolicLink(); + } catch(e) { + return false; + } + } + + if (!fs.existsSync(path)) + return false; + + if (options.exists) + return true; + + var stats = fs.statSync(path); + + if (options.block) + return stats.isBlockDevice(); + + if (options.character) + return stats.isCharacterDevice(); + + if (options.directory) + return stats.isDirectory(); + + if (options.file) + return stats.isFile(); + + if (options.pipe) + return stats.isFIFO(); + + if (options.socket) + return stats.isSocket(); +} // test +module.exports = _test; diff --git a/tools/eslint/node_modules/shelljs/src/to.js b/tools/eslint/node_modules/shelljs/src/to.js new file mode 100644 index 00000000000000..65d6d54af90837 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/to.js @@ -0,0 +1,30 @@ +var common = require('./common'); +var fs = require('fs'); +var path = require('path'); + +//@ +//@ ### 'string'.to(file) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ cat('input.txt').to('output.txt'); +//@ ``` +//@ +//@ Analogous to the redirection operator `>` in Unix, but works with JavaScript strings (such as +//@ those returned by `cat`, `grep`, etc). _Like Unix redirections, `to()` will overwrite any existing file!_ +function _to(options, file) { + if (!file) + common.error('wrong arguments'); + + if (!fs.existsSync( path.dirname(file) )) + common.error('no such file or directory: ' + path.dirname(file)); + + try { + fs.writeFileSync(file, this.toString(), 'utf8'); + return this; + } catch(e) { + common.error('could not write to file (code '+e.code+'): '+file, true); + } +} +module.exports = _to; diff --git a/tools/eslint/node_modules/shelljs/src/toEnd.js b/tools/eslint/node_modules/shelljs/src/toEnd.js new file mode 100644 index 00000000000000..bf29a6526d0f97 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/toEnd.js @@ -0,0 +1,30 @@ +var common = require('./common'); +var fs = require('fs'); +var path = require('path'); + +//@ +//@ ### 'string'.toEnd(file) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ cat('input.txt').toEnd('output.txt'); +//@ ``` +//@ +//@ Analogous to the redirect-and-append operator `>>` in Unix, but works with JavaScript strings (such as +//@ those returned by `cat`, `grep`, etc). +function _toEnd(options, file) { + if (!file) + common.error('wrong arguments'); + + if (!fs.existsSync( path.dirname(file) )) + common.error('no such file or directory: ' + path.dirname(file)); + + try { + fs.appendFileSync(file, this.toString(), 'utf8'); + return this; + } catch(e) { + common.error('could not append to file (code '+e.code+'): '+file, true); + } +} +module.exports = _toEnd; diff --git a/tools/eslint/node_modules/shelljs/src/touch.js b/tools/eslint/node_modules/shelljs/src/touch.js new file mode 100644 index 00000000000000..bbc2c1968654ab --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/touch.js @@ -0,0 +1,109 @@ +var common = require('./common'); +var fs = require('fs'); + +//@ +//@ ### touch([options,] file) +//@ Available options: +//@ +//@ + `-a`: Change only the access time +//@ + `-c`: Do not create any files +//@ + `-m`: Change only the modification time +//@ + `-d DATE`: Parse DATE and use it instead of current time +//@ + `-r FILE`: Use FILE's times instead of current time +//@ +//@ Examples: +//@ +//@ ```javascript +//@ touch('source.js'); +//@ touch('-c', '/path/to/some/dir/source.js'); +//@ touch({ '-r': FILE }, '/path/to/some/dir/source.js'); +//@ ``` +//@ +//@ Update the access and modification times of each FILE to the current time. +//@ A FILE argument that does not exist is created empty, unless -c is supplied. +//@ This is a partial implementation of *[touch(1)](http://linux.die.net/man/1/touch)*. +function _touch(opts, files) { + opts = common.parseOptions(opts, { + 'a': 'atime_only', + 'c': 'no_create', + 'd': 'date', + 'm': 'mtime_only', + 'r': 'reference', + }); + + if (!files) { + common.error('no paths given'); + } + + if (Array.isArray(files)) { + files.forEach(function(f) { + touchFile(opts, f); + }); + } else if (typeof files === 'string') { + touchFile(opts, files); + } else { + common.error('file arg should be a string file path or an Array of string file paths'); + } + +} + +function touchFile(opts, file) { + var stat = tryStatFile(file); + + if (stat && stat.isDirectory()) { + // don't error just exit + return; + } + + // if the file doesn't already exist and the user has specified --no-create then + // this script is finished + if (!stat && opts.no_create) { + return; + } + + // open the file and then close it. this will create it if it doesn't exist but will + // not truncate the file + fs.closeSync(fs.openSync(file, 'a')); + + // + // Set timestamps + // + + // setup some defaults + var now = new Date(); + var mtime = opts.date || now; + var atime = opts.date || now; + + // use reference file + if (opts.reference) { + var refStat = tryStatFile(opts.reference); + if (!refStat) { + common.error('failed to get attributess of ' + opts.reference); + } + mtime = refStat.mtime; + atime = refStat.atime; + } else if (opts.date) { + mtime = opts.date; + atime = opts.date; + } + + if (opts.atime_only && opts.mtime_only) { + // keep the new values of mtime and atime like GNU + } else if (opts.atime_only) { + mtime = stat.mtime; + } else if (opts.mtime_only) { + atime = stat.atime; + } + + fs.utimesSync(file, atime, mtime); +} + +module.exports = _touch; + +function tryStatFile(filePath) { + try { + return fs.statSync(filePath); + } catch (e) { + return null; + } +} diff --git a/tools/eslint/node_modules/shelljs/src/which.js b/tools/eslint/node_modules/shelljs/src/which.js new file mode 100644 index 00000000000000..d17634ee941d96 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/which.js @@ -0,0 +1,98 @@ +var common = require('./common'); +var fs = require('fs'); +var path = require('path'); + +// XP's system default value for PATHEXT system variable, just in case it's not +// set on Windows. +var XP_DEFAULT_PATHEXT = '.com;.exe;.bat;.cmd;.vbs;.vbe;.js;.jse;.wsf;.wsh'; + +// Cross-platform method for splitting environment PATH variables +function splitPath(p) { + if (!p) + return []; + + if (common.platform === 'win') + return p.split(';'); + else + return p.split(':'); +} + +function checkPath(path) { + return fs.existsSync(path) && !fs.statSync(path).isDirectory(); +} + +//@ +//@ ### which(command) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var nodeExec = which('node'); +//@ ``` +//@ +//@ Searches for `command` in the system's PATH. On Windows, this uses the +//@ `PATHEXT` variable to append the extension if it's not already executable. +//@ Returns string containing the absolute path to the command. +function _which(options, cmd) { + if (!cmd) + common.error('must specify command'); + + var pathEnv = process.env.path || process.env.Path || process.env.PATH, + pathArray = splitPath(pathEnv), + where = null; + + // No relative/absolute paths provided? + if (cmd.search(/\//) === -1) { + // Search for command in PATH + pathArray.forEach(function(dir) { + if (where) + return; // already found it + + var attempt = path.resolve(dir, cmd); + + if (common.platform === 'win') { + attempt = attempt.toUpperCase(); + + // In case the PATHEXT variable is somehow not set (e.g. + // child_process.spawn with an empty environment), use the XP default. + var pathExtEnv = process.env.PATHEXT || XP_DEFAULT_PATHEXT; + var pathExtArray = splitPath(pathExtEnv.toUpperCase()); + var i; + + // If the extension is already in PATHEXT, just return that. + for (i = 0; i < pathExtArray.length; i++) { + var ext = pathExtArray[i]; + if (attempt.slice(-ext.length) === ext && checkPath(attempt)) { + where = attempt; + return; + } + } + + // Cycle through the PATHEXT variable + var baseAttempt = attempt; + for (i = 0; i < pathExtArray.length; i++) { + attempt = baseAttempt + pathExtArray[i]; + if (checkPath(attempt)) { + where = attempt; + return; + } + } + } else { + // Assume it's Unix-like + if (checkPath(attempt)) { + where = attempt; + return; + } + } + }); + } + + // Command not found anywhere? + if (!checkPath(cmd) && !where) + return null; + + where = where || path.resolve(cmd); + + return common.ShellString(where); +} +module.exports = _which; diff --git a/tools/eslint/node_modules/slice-ansi/index.js b/tools/eslint/node_modules/slice-ansi/index.js new file mode 100755 index 00000000000000..fbf1c5a2a3c3b2 --- /dev/null +++ b/tools/eslint/node_modules/slice-ansi/index.js @@ -0,0 +1,79 @@ +'use strict'; + +var ESCAPES = [ + '\u001b', + '\u009b' +]; + +var END_CODE = 39; + +var ESCAPE_CODES = { + 0: 0, + 1: 22, + 2: 22, + 3: 23, + 4: 24, + 7: 27, + 8: 28, + 9: 29, + 30: 39, + 31: 39, + 32: 39, + 33: 39, + 34: 39, + 35: 39, + 36: 39, + 37: 39, + 90: 39, + 40: 49, + 41: 49, + 42: 49, + 43: 49, + 44: 49, + 45: 49, + 46: 49, + 47: 49 +}; + +function wrapAnsi(code) { + return ESCAPES[0] + '[' + code + 'm'; +} + +module.exports = function (str, begin, end) { + end = end || str.length; + var insideEscape = false; + var escapeCode; + var visible = 0; + var output = ''; + + for (var i = 0; i < str.length; i++) { + var leftEscape = false; + var x = str[i]; + + if (ESCAPES.indexOf(x) !== -1) { + insideEscape = true; + var code = /[0-9][^m]*/.exec(str.slice(i, i + 4)); + escapeCode = code === END_CODE ? null : code; + } else if (insideEscape && x === 'm') { + insideEscape = false; + leftEscape = true; + } + + if (!insideEscape && !leftEscape) { + ++visible; + } + + if (visible > begin && visible <= end) { + output += x; + } else if (visible === begin && escapeCode !== undefined && escapeCode !== END_CODE) { + output += wrapAnsi(escapeCode); + } else if (visible >= end) { + if (escapeCode !== undefined) { + output += wrapAnsi(ESCAPE_CODES[escapeCode] || END_CODE); + } + break; + } + } + + return output; +}; diff --git a/tools/eslint/node_modules/slice-ansi/license b/tools/eslint/node_modules/slice-ansi/license new file mode 100755 index 00000000000000..351a087083b918 --- /dev/null +++ b/tools/eslint/node_modules/slice-ansi/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 DC + +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. \ No newline at end of file diff --git a/tools/eslint/node_modules/slice-ansi/package.json b/tools/eslint/node_modules/slice-ansi/package.json new file mode 100644 index 00000000000000..410e515a96922e --- /dev/null +++ b/tools/eslint/node_modules/slice-ansi/package.json @@ -0,0 +1,105 @@ +{ + "_args": [ + [ + "slice-ansi@0.0.4", + "/Users/silverwind/git/node/tools/package/package/node_modules/table" + ] + ], + "_from": "slice-ansi@0.0.4", + "_id": "slice-ansi@0.0.4", + "_inCache": true, + "_installable": true, + "_location": "/slice-ansi", + "_nodeVersion": "3.2.0", + "_npmUser": { + "email": "threedeecee@gmail.com", + "name": "dthree" + }, + "_npmVersion": "2.13.3", + "_phantomChildren": {}, + "_requested": { + "name": "slice-ansi", + "raw": "slice-ansi@0.0.4", + "rawSpec": "0.0.4", + "scope": null, + "spec": "0.0.4", + "type": "version" + }, + "_requiredBy": [ + "/table" + ], + "_resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", + "_shasum": "edbf8903f66f7ce2f8eafd6ceed65e264c831b35", + "_shrinkwrap": null, + "_spec": "slice-ansi@0.0.4", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/table", + "author": { + "email": "threedeecee@gmail.com", + "name": "David Caccavella" + }, + "bugs": { + "url": "https://github.com/chalk/slice-ansi/issues" + }, + "dependencies": {}, + "description": "Slice a string with ANSI escape codes", + "devDependencies": { + "ava": "^0.2.0", + "chalk": "^1.1.1", + "strip-ansi": "^3.0.0", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "edbf8903f66f7ce2f8eafd6ceed65e264c831b35", + "tarball": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "8670277262281964b13f051d51b2e24bcfda8a66", + "homepage": "https://github.com/chalk/slice-ansi#readme", + "keywords": [ + "256", + "ansi", + "cli", + "color", + "colors", + "colour", + "command-line", + "console", + "escape", + "formatting", + "log", + "logging", + "rgb", + "shell", + "slice", + "string", + "styles", + "terminal", + "text", + "tty", + "xterm" + ], + "license": "MIT", + "maintainers": [ + { + "name": "dthree", + "email": "threedeecee@gmail.com" + } + ], + "name": "slice-ansi", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/slice-ansi.git" + }, + "scripts": { + "test": "node test.js && xo" + }, + "version": "0.0.4" +} diff --git a/tools/eslint/node_modules/slice-ansi/readme.md b/tools/eslint/node_modules/slice-ansi/readme.md new file mode 100755 index 00000000000000..920b929887898b --- /dev/null +++ b/tools/eslint/node_modules/slice-ansi/readme.md @@ -0,0 +1,56 @@ +# slice-ansi + +[![Build Status](https://travis-ci.org/vorpaljs/slice-ansi.svg?branch=master)](https://travis-ci.org/vorpaljs/slice-ansi) +[![XO: Linted](https://img.shields.io/badge/xo-linted-blue.svg)](https://github.com/sindresorhus/xo) + +> Slice a string with [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) + +## Install + +``` +$ npm install --save slice-ansi +``` + +## Usage + +```js +var chalk = require('chalk'); +var sliceAnsi = require('slice-ansi'); + +var input = 'The quick brown ' + chalk.red('fox jumped over ') + + 'the lazy ' + chalk.green('dog and then ran away with the unicorn.'); + +console.log(sliceAnsi(input, 20, 30)); +``` + +## API + +### sliceAnsi(input, beginSlice[, endSlice]) + +#### input + +Type: `string` + +String with ANSI escape codes. Like one styled by [`chalk`](https://github.com/chalk/chalk). + +#### beginSlice + +Type: `number` + +The zero-based index at which to begin the slice. + +#### endSlice + +Type: `number` + +Optional. The zero-based index at which to end the slice. + + +## Related + +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## License + +MIT © [David Caccavella](https://githbu.com/dthree) diff --git a/tools/eslint/node_modules/sprintf-js/LICENSE b/tools/eslint/node_modules/sprintf-js/LICENSE new file mode 100644 index 00000000000000..663ac52e4d8cd9 --- /dev/null +++ b/tools/eslint/node_modules/sprintf-js/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2007-2014, Alexandru Marasteanu +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of this software nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/eslint/node_modules/sprintf-js/README.md b/tools/eslint/node_modules/sprintf-js/README.md new file mode 100644 index 00000000000000..83863561b29199 --- /dev/null +++ b/tools/eslint/node_modules/sprintf-js/README.md @@ -0,0 +1,88 @@ +# sprintf.js +**sprintf.js** is a complete open source JavaScript sprintf implementation for the *browser* and *node.js*. + +Its prototype is simple: + + string sprintf(string format , [mixed arg1 [, mixed arg2 [ ,...]]]) + +The placeholders in the format string are marked by `%` and are followed by one or more of these elements, in this order: + +* An optional number followed by a `$` sign that selects which argument index to use for the value. If not specified, arguments will be placed in the same order as the placeholders in the input string. +* An optional `+` sign that forces to preceed the result with a plus or minus sign on numeric values. By default, only the `-` sign is used on negative numbers. +* An optional padding specifier that says what character to use for padding (if specified). Possible values are `0` or any other character precedeed by a `'` (single quote). The default is to pad with *spaces*. +* An optional `-` sign, that causes sprintf to left-align the result of this placeholder. The default is to right-align the result. +* An optional number, that says how many characters the result should have. If the value to be returned is shorter than this number, the result will be padded. When used with the `j` (JSON) type specifier, the padding length specifies the tab size used for indentation. +* An optional precision modifier, consisting of a `.` (dot) followed by a number, that says how many digits should be displayed for floating point numbers. When used with the `g` type specifier, it specifies the number of significant digits. When used on a string, it causes the result to be truncated. +* A type specifier that can be any of: + * `%` — yields a literal `%` character + * `b` — yields an integer as a binary number + * `c` — yields an integer as the character with that ASCII value + * `d` or `i` — yields an integer as a signed decimal number + * `e` — yields a float using scientific notation + * `u` — yields an integer as an unsigned decimal number + * `f` — yields a float as is; see notes on precision above + * `g` — yields a float as is; see notes on precision above + * `o` — yields an integer as an octal number + * `s` — yields a string as is + * `x` — yields an integer as a hexadecimal number (lower-case) + * `X` — yields an integer as a hexadecimal number (upper-case) + * `j` — yields a JavaScript object or array as a JSON encoded string + +## JavaScript `vsprintf` +`vsprintf` is the same as `sprintf` except that it accepts an array of arguments, rather than a variable number of arguments: + + vsprintf("The first 4 letters of the english alphabet are: %s, %s, %s and %s", ["a", "b", "c", "d"]) + +## Argument swapping +You can also swap the arguments. That is, the order of the placeholders doesn't have to match the order of the arguments. You can do that by simply indicating in the format string which arguments the placeholders refer to: + + sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants") +And, of course, you can repeat the placeholders without having to increase the number of arguments. + +## Named arguments +Format strings may contain replacement fields rather than positional placeholders. Instead of referring to a certain argument, you can now refer to a certain key within an object. Replacement fields are surrounded by rounded parentheses - `(` and `)` - and begin with a keyword that refers to a key: + + var user = { + name: "Dolly" + } + sprintf("Hello %(name)s", user) // Hello Dolly +Keywords in replacement fields can be optionally followed by any number of keywords or indexes: + + var users = [ + {name: "Dolly"}, + {name: "Molly"}, + {name: "Polly"} + ] + sprintf("Hello %(users[0].name)s, %(users[1].name)s and %(users[2].name)s", {users: users}) // Hello Dolly, Molly and Polly +Note: mixing positional and named placeholders is not (yet) supported + +## Computed values +You can pass in a function as a dynamic value and it will be invoked (with no arguments) in order to compute the value on-the-fly. + + sprintf("Current timestamp: %d", Date.now) // Current timestamp: 1398005382890 + sprintf("Current date and time: %s", function() { return new Date().toString() }) + +# AngularJS +You can now use `sprintf` and `vsprintf` (also aliased as `fmt` and `vfmt` respectively) in your AngularJS projects. See `demo/`. + +# Installation + +## Via Bower + + bower install sprintf + +## Or as a node.js module + + npm install sprintf-js + +### Usage + + var sprintf = require("sprintf-js").sprintf, + vsprintf = require("sprintf-js").vsprintf + + sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants") + vsprintf("The first 4 letters of the english alphabet are: %s, %s, %s and %s", ["a", "b", "c", "d"]) + +# License + +**sprintf.js** is licensed under the terms of the 3-clause BSD license. diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/angular-sprintf.min.js b/tools/eslint/node_modules/sprintf-js/dist/angular-sprintf.min.js similarity index 100% rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/angular-sprintf.min.js rename to tools/eslint/node_modules/sprintf-js/dist/angular-sprintf.min.js diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/angular-sprintf.min.map b/tools/eslint/node_modules/sprintf-js/dist/angular-sprintf.min.js.map similarity index 100% rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/dist/angular-sprintf.min.map rename to tools/eslint/node_modules/sprintf-js/dist/angular-sprintf.min.js.map diff --git a/tools/eslint/node_modules/sprintf-js/dist/angular-sprintf.min.map b/tools/eslint/node_modules/sprintf-js/dist/angular-sprintf.min.map new file mode 100644 index 00000000000000..055964c624c1ac --- /dev/null +++ b/tools/eslint/node_modules/sprintf-js/dist/angular-sprintf.min.map @@ -0,0 +1 @@ +{"version":3,"file":"angular-sprintf.min.js","sources":["../src/angular-sprintf.js"],"names":["angular","module","filter","sprintf","apply","arguments","$filter","format","argv","vsprintf"],"mappings":";;AAAAA,QACIC,OAAO,cACPC,OAAO,UAAW,WACd,MAAO,YACH,MAAOC,SAAQC,MAAM,KAAMC,cAGnCH,OAAO,OAAQ,UAAW,SAASI,GAC/B,MAAOA,GAAQ,cAEnBJ,OAAO,WAAY,WACf,MAAO,UAASK,EAAQC,GACpB,MAAOC,UAASF,EAAQC,MAGhCN,OAAO,QAAS,UAAW,SAASI,GAChC,MAAOA,GAAQ"} \ No newline at end of file diff --git a/tools/eslint/node_modules/sprintf-js/dist/sprintf.min.js b/tools/eslint/node_modules/sprintf-js/dist/sprintf.min.js new file mode 100644 index 00000000000000..dc61e51add29bb --- /dev/null +++ b/tools/eslint/node_modules/sprintf-js/dist/sprintf.min.js @@ -0,0 +1,4 @@ +/*! sprintf-js | Alexandru Marasteanu (http://alexei.ro/) | BSD-3-Clause */ + +!function(a){function b(){var a=arguments[0],c=b.cache;return c[a]&&c.hasOwnProperty(a)||(c[a]=b.parse(a)),b.format.call(null,c[a],arguments)}function c(a){return Object.prototype.toString.call(a).slice(8,-1).toLowerCase()}function d(a,b){return Array(b+1).join(a)}var e={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};b.format=function(a,f){var g,h,i,j,k,l,m,n=1,o=a.length,p="",q=[],r=!0,s="";for(h=0;o>h;h++)if(p=c(a[h]),"string"===p)q[q.length]=a[h];else if("array"===p){if(j=a[h],j[2])for(g=f[n],i=0;i=0),j[8]){case"b":g=g.toString(2);break;case"c":g=String.fromCharCode(g);break;case"d":case"i":g=parseInt(g,10);break;case"j":g=JSON.stringify(g,null,j[6]?parseInt(j[6]):0);break;case"e":g=j[7]?g.toExponential(j[7]):g.toExponential();break;case"f":g=j[7]?parseFloat(g).toFixed(j[7]):parseFloat(g);break;case"g":g=j[7]?parseFloat(g).toPrecision(j[7]):parseFloat(g);break;case"o":g=g.toString(8);break;case"s":g=(g=String(g))&&j[7]?g.substring(0,j[7]):g;break;case"u":g>>>=0;break;case"x":g=g.toString(16);break;case"X":g=g.toString(16).toUpperCase()}e.json.test(j[8])?q[q.length]=g:(!e.number.test(j[8])||r&&!j[3]?s="":(s=r?"+":"-",g=g.toString().replace(e.sign,"")),l=j[4]?"0"===j[4]?"0":j[4].charAt(1):" ",m=j[6]-(s+g).length,k=j[6]&&m>0?d(l,m):"",q[q.length]=j[5]?s+g+k:"0"===l?s+k+g:k+s+g)}return q.join("")},b.cache={},b.parse=function(a){for(var b=a,c=[],d=[],f=0;b;){if(null!==(c=e.text.exec(b)))d[d.length]=c[0];else if(null!==(c=e.modulo.exec(b)))d[d.length]="%";else{if(null===(c=e.placeholder.exec(b)))throw new SyntaxError("[sprintf] unexpected placeholder");if(c[2]){f|=1;var g=[],h=c[2],i=[];if(null===(i=e.key.exec(h)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(g[g.length]=i[1];""!==(h=h.substring(i[0].length));)if(null!==(i=e.key_access.exec(h)))g[g.length]=i[1];else{if(null===(i=e.index_access.exec(h)))throw new SyntaxError("[sprintf] failed to parse named argument key");g[g.length]=i[1]}c[2]=g}else f|=2;if(3===f)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");d[d.length]=c}b=b.substring(c[0].length)}return d};var f=function(a,c,d){return d=(c||[]).slice(0),d.splice(0,0,a),b.apply(null,d)};"undefined"!=typeof exports?(exports.sprintf=b,exports.vsprintf=f):(a.sprintf=b,a.vsprintf=f,"function"==typeof define&&define.amd&&define(function(){return{sprintf:b,vsprintf:f}}))}("undefined"==typeof window?this:window); +//# sourceMappingURL=sprintf.min.map \ No newline at end of file diff --git a/tools/eslint/node_modules/sprintf-js/dist/sprintf.min.js.map b/tools/eslint/node_modules/sprintf-js/dist/sprintf.min.js.map new file mode 100644 index 00000000000000..369dbafab157ae --- /dev/null +++ b/tools/eslint/node_modules/sprintf-js/dist/sprintf.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sprintf.min.js","sources":["../src/sprintf.js"],"names":["window","sprintf","key","arguments","cache","hasOwnProperty","parse","format","call","get_type","variable","Object","prototype","toString","slice","toLowerCase","str_repeat","input","multiplier","Array","join","re","not_string","number","json","not_json","text","modulo","placeholder","key_access","index_access","sign","parse_tree","argv","arg","i","k","match","pad","pad_character","pad_length","cursor","tree_length","length","node_type","output","is_positive","Error","test","isNaN","TypeError","String","fromCharCode","parseInt","JSON","stringify","toExponential","parseFloat","toFixed","substring","toUpperCase","replace","charAt","fmt","_fmt","arg_names","exec","SyntaxError","field_list","replacement_field","field_match","vsprintf","_argv","splice","apply","exports","define","amd","this"],"mappings":";;CAAA,SAAUA,GAeN,QAASC,KACL,GAAIC,GAAMC,UAAU,GAAIC,EAAQH,EAAQG,KAIxC,OAHMA,GAAMF,IAAQE,EAAMC,eAAeH,KACrCE,EAAMF,GAAOD,EAAQK,MAAMJ,IAExBD,EAAQM,OAAOC,KAAK,KAAMJ,EAAMF,GAAMC,WA4JjD,QAASM,GAASC,GACd,MAAOC,QAAOC,UAAUC,SAASL,KAAKE,GAAUI,MAAM,EAAG,IAAIC,cAGjE,QAASC,GAAWC,EAAOC,GACvB,MAAOC,OAAMD,EAAa,GAAGE,KAAKH,GApLtC,GAAII,IACAC,WAAY,OACZC,OAAQ,SACRC,KAAM,MACNC,SAAU,OACVC,KAAM,YACNC,OAAQ,WACRC,YAAa,yFACb1B,IAAK,sBACL2B,WAAY,wBACZC,aAAc,aACdC,KAAM,UAWV9B,GAAQM,OAAS,SAASyB,EAAYC,GAClC,GAAiEC,GAAkBC,EAAGC,EAAGC,EAAOC,EAAKC,EAAeC,EAAhHC,EAAS,EAAGC,EAAcV,EAAWW,OAAQC,EAAY,GAASC,KAA0DC,GAAc,EAAMf,EAAO,EAC3J,KAAKI,EAAI,EAAOO,EAAJP,EAAiBA,IAEzB,GADAS,EAAYnC,EAASuB,EAAWG,IACd,WAAdS,EACAC,EAAOA,EAAOF,QAAUX,EAAWG,OAElC,IAAkB,UAAdS,EAAuB,CAE5B,GADAP,EAAQL,EAAWG,GACfE,EAAM,GAEN,IADAH,EAAMD,EAAKQ,GACNL,EAAI,EAAGA,EAAIC,EAAM,GAAGM,OAAQP,IAAK,CAClC,IAAKF,EAAI7B,eAAegC,EAAM,GAAGD,IAC7B,KAAM,IAAIW,OAAM9C,EAAQ,yCAA0CoC,EAAM,GAAGD,IAE/EF,GAAMA,EAAIG,EAAM,GAAGD,QAIvBF,GADKG,EAAM,GACLJ,EAAKI,EAAM,IAGXJ,EAAKQ,IAOf,IAJqB,YAAjBhC,EAASyB,KACTA,EAAMA,KAGNb,EAAGC,WAAW0B,KAAKX,EAAM,KAAOhB,EAAGI,SAASuB,KAAKX,EAAM,KAAyB,UAAjB5B,EAASyB,IAAoBe,MAAMf,GAClG,KAAM,IAAIgB,WAAUjD,EAAQ,0CAA2CQ,EAASyB,IAOpF,QAJIb,EAAGE,OAAOyB,KAAKX,EAAM,MACrBS,EAAcZ,GAAO,GAGjBG,EAAM,IACV,IAAK,IACDH,EAAMA,EAAIrB,SAAS,EACvB,MACA,KAAK,IACDqB,EAAMiB,OAAOC,aAAalB,EAC9B,MACA,KAAK,IACL,IAAK,IACDA,EAAMmB,SAASnB,EAAK,GACxB,MACA,KAAK,IACDA,EAAMoB,KAAKC,UAAUrB,EAAK,KAAMG,EAAM,GAAKgB,SAAShB,EAAM,IAAM,EACpE,MACA,KAAK,IACDH,EAAMG,EAAM,GAAKH,EAAIsB,cAAcnB,EAAM,IAAMH,EAAIsB,eACvD,MACA,KAAK,IACDtB,EAAMG,EAAM,GAAKoB,WAAWvB,GAAKwB,QAAQrB,EAAM,IAAMoB,WAAWvB,EACpE,MACA,KAAK,IACDA,EAAMA,EAAIrB,SAAS,EACvB,MACA,KAAK,IACDqB,GAAQA,EAAMiB,OAAOjB,KAASG,EAAM,GAAKH,EAAIyB,UAAU,EAAGtB,EAAM,IAAMH,CAC1E,MACA,KAAK,IACDA,KAAc,CAClB,MACA,KAAK,IACDA,EAAMA,EAAIrB,SAAS,GACvB,MACA,KAAK,IACDqB,EAAMA,EAAIrB,SAAS,IAAI+C,cAG3BvC,EAAGG,KAAKwB,KAAKX,EAAM,IACnBQ,EAAOA,EAAOF,QAAUT,IAGpBb,EAAGE,OAAOyB,KAAKX,EAAM,KAASS,IAAeT,EAAM,GAKnDN,EAAO,IAJPA,EAAOe,EAAc,IAAM,IAC3BZ,EAAMA,EAAIrB,WAAWgD,QAAQxC,EAAGU,KAAM,KAK1CQ,EAAgBF,EAAM,GAAkB,MAAbA,EAAM,GAAa,IAAMA,EAAM,GAAGyB,OAAO,GAAK,IACzEtB,EAAaH,EAAM,IAAMN,EAAOG,GAAKS,OACrCL,EAAMD,EAAM,IAAMG,EAAa,EAAIxB,EAAWuB,EAAeC,GAAoB,GACjFK,EAAOA,EAAOF,QAAUN,EAAM,GAAKN,EAAOG,EAAMI,EAAyB,MAAlBC,EAAwBR,EAAOO,EAAMJ,EAAMI,EAAMP,EAAOG,GAI3H,MAAOW,GAAOzB,KAAK,KAGvBnB,EAAQG,SAERH,EAAQK,MAAQ,SAASyD,GAErB,IADA,GAAIC,GAAOD,EAAK1B,KAAYL,KAAiBiC,EAAY,EAClDD,GAAM,CACT,GAAqC,QAAhC3B,EAAQhB,EAAGK,KAAKwC,KAAKF,IACtBhC,EAAWA,EAAWW,QAAUN,EAAM,OAErC,IAAuC,QAAlCA,EAAQhB,EAAGM,OAAOuC,KAAKF,IAC7BhC,EAAWA,EAAWW,QAAU,QAE/B,CAAA,GAA4C,QAAvCN,EAAQhB,EAAGO,YAAYsC,KAAKF,IAgClC,KAAM,IAAIG,aAAY,mCA/BtB,IAAI9B,EAAM,GAAI,CACV4B,GAAa,CACb,IAAIG,MAAiBC,EAAoBhC,EAAM,GAAIiC,IACnD,IAAuD,QAAlDA,EAAcjD,EAAGnB,IAAIgE,KAAKG,IAe3B,KAAM,IAAIF,aAAY,+CAbtB,KADAC,EAAWA,EAAWzB,QAAU2B,EAAY,GACwC,MAA5ED,EAAoBA,EAAkBV,UAAUW,EAAY,GAAG3B,UACnE,GAA8D,QAAzD2B,EAAcjD,EAAGQ,WAAWqC,KAAKG,IAClCD,EAAWA,EAAWzB,QAAU2B,EAAY,OAE3C,CAAA,GAAgE,QAA3DA,EAAcjD,EAAGS,aAAaoC,KAAKG,IAIzC,KAAM,IAAIF,aAAY,+CAHtBC,GAAWA,EAAWzB,QAAU2B,EAAY,GAUxDjC,EAAM,GAAK+B,MAGXH,IAAa,CAEjB,IAAkB,IAAdA,EACA,KAAM,IAAIlB,OAAM,4EAEpBf,GAAWA,EAAWW,QAAUN,EAKpC2B,EAAOA,EAAKL,UAAUtB,EAAM,GAAGM,QAEnC,MAAOX,GAGX,IAAIuC,GAAW,SAASR,EAAK9B,EAAMuC,GAG/B,MAFAA,IAASvC,OAAYnB,MAAM,GAC3B0D,EAAMC,OAAO,EAAG,EAAGV,GACZ9D,EAAQyE,MAAM,KAAMF,GAiBR,oBAAZG,UACPA,QAAQ1E,QAAUA,EAClB0E,QAAQJ,SAAWA,IAGnBvE,EAAOC,QAAUA,EACjBD,EAAOuE,SAAWA,EAEI,kBAAXK,SAAyBA,OAAOC,KACvCD,OAAO,WACH,OACI3E,QAASA,EACTsE,SAAUA,OAKT,mBAAXvE,QAAyB8E,KAAO9E"} \ No newline at end of file diff --git a/tools/eslint/node_modules/sprintf-js/dist/sprintf.min.map b/tools/eslint/node_modules/sprintf-js/dist/sprintf.min.map new file mode 100644 index 00000000000000..ee011aaa5aa56f --- /dev/null +++ b/tools/eslint/node_modules/sprintf-js/dist/sprintf.min.map @@ -0,0 +1 @@ +{"version":3,"file":"sprintf.min.js","sources":["../src/sprintf.js"],"names":["window","sprintf","key","arguments","cache","hasOwnProperty","parse","format","call","get_type","variable","Object","prototype","toString","slice","toLowerCase","str_repeat","input","multiplier","Array","join","re","not_string","number","json","not_json","text","modulo","placeholder","key_access","index_access","sign","parse_tree","argv","arg","i","k","match","pad","pad_character","pad_length","cursor","tree_length","length","node_type","output","is_positive","Error","test","isNaN","TypeError","String","fromCharCode","parseInt","JSON","stringify","toExponential","parseFloat","toFixed","toPrecision","substring","toUpperCase","replace","charAt","fmt","_fmt","arg_names","exec","SyntaxError","field_list","replacement_field","field_match","vsprintf","_argv","splice","apply","exports","define","amd","this"],"mappings":";;CAAA,SAAUA,GAeN,QAASC,KACL,GAAIC,GAAMC,UAAU,GAAIC,EAAQH,EAAQG,KAIxC,OAHMA,GAAMF,IAAQE,EAAMC,eAAeH,KACrCE,EAAMF,GAAOD,EAAQK,MAAMJ,IAExBD,EAAQM,OAAOC,KAAK,KAAMJ,EAAMF,GAAMC,WA+JjD,QAASM,GAASC,GACd,MAAOC,QAAOC,UAAUC,SAASL,KAAKE,GAAUI,MAAM,EAAG,IAAIC,cAGjE,QAASC,GAAWC,EAAOC,GACvB,MAAOC,OAAMD,EAAa,GAAGE,KAAKH,GAvLtC,GAAII,IACAC,WAAY,OACZC,OAAQ,UACRC,KAAM,MACNC,SAAU,OACVC,KAAM,YACNC,OAAQ,WACRC,YAAa,yFACb1B,IAAK,sBACL2B,WAAY,wBACZC,aAAc,aACdC,KAAM,UAWV9B,GAAQM,OAAS,SAASyB,EAAYC,GAClC,GAAiEC,GAAkBC,EAAGC,EAAGC,EAAOC,EAAKC,EAAeC,EAAhHC,EAAS,EAAGC,EAAcV,EAAWW,OAAQC,EAAY,GAASC,KAA0DC,GAAc,EAAMf,EAAO,EAC3J,KAAKI,EAAI,EAAOO,EAAJP,EAAiBA,IAEzB,GADAS,EAAYnC,EAASuB,EAAWG,IACd,WAAdS,EACAC,EAAOA,EAAOF,QAAUX,EAAWG,OAElC,IAAkB,UAAdS,EAAuB,CAE5B,GADAP,EAAQL,EAAWG,GACfE,EAAM,GAEN,IADAH,EAAMD,EAAKQ,GACNL,EAAI,EAAGA,EAAIC,EAAM,GAAGM,OAAQP,IAAK,CAClC,IAAKF,EAAI7B,eAAegC,EAAM,GAAGD,IAC7B,KAAM,IAAIW,OAAM9C,EAAQ,yCAA0CoC,EAAM,GAAGD,IAE/EF,GAAMA,EAAIG,EAAM,GAAGD,QAIvBF,GADKG,EAAM,GACLJ,EAAKI,EAAM,IAGXJ,EAAKQ,IAOf,IAJqB,YAAjBhC,EAASyB,KACTA,EAAMA,KAGNb,EAAGC,WAAW0B,KAAKX,EAAM,KAAOhB,EAAGI,SAASuB,KAAKX,EAAM,KAAyB,UAAjB5B,EAASyB,IAAoBe,MAAMf,GAClG,KAAM,IAAIgB,WAAUjD,EAAQ,0CAA2CQ,EAASyB,IAOpF,QAJIb,EAAGE,OAAOyB,KAAKX,EAAM,MACrBS,EAAcZ,GAAO,GAGjBG,EAAM,IACV,IAAK,IACDH,EAAMA,EAAIrB,SAAS,EACvB,MACA,KAAK,IACDqB,EAAMiB,OAAOC,aAAalB,EAC9B,MACA,KAAK,IACL,IAAK,IACDA,EAAMmB,SAASnB,EAAK,GACxB,MACA,KAAK,IACDA,EAAMoB,KAAKC,UAAUrB,EAAK,KAAMG,EAAM,GAAKgB,SAAShB,EAAM,IAAM,EACpE,MACA,KAAK,IACDH,EAAMG,EAAM,GAAKH,EAAIsB,cAAcnB,EAAM,IAAMH,EAAIsB,eACvD,MACA,KAAK,IACDtB,EAAMG,EAAM,GAAKoB,WAAWvB,GAAKwB,QAAQrB,EAAM,IAAMoB,WAAWvB,EACpE,MACA,KAAK,IACDA,EAAMG,EAAM,GAAKoB,WAAWvB,GAAKyB,YAAYtB,EAAM,IAAMoB,WAAWvB,EACxE,MACA,KAAK,IACDA,EAAMA,EAAIrB,SAAS,EACvB,MACA,KAAK,IACDqB,GAAQA,EAAMiB,OAAOjB,KAASG,EAAM,GAAKH,EAAI0B,UAAU,EAAGvB,EAAM,IAAMH,CAC1E,MACA,KAAK,IACDA,KAAc,CAClB,MACA,KAAK,IACDA,EAAMA,EAAIrB,SAAS,GACvB,MACA,KAAK,IACDqB,EAAMA,EAAIrB,SAAS,IAAIgD,cAG3BxC,EAAGG,KAAKwB,KAAKX,EAAM,IACnBQ,EAAOA,EAAOF,QAAUT,IAGpBb,EAAGE,OAAOyB,KAAKX,EAAM,KAASS,IAAeT,EAAM,GAKnDN,EAAO,IAJPA,EAAOe,EAAc,IAAM,IAC3BZ,EAAMA,EAAIrB,WAAWiD,QAAQzC,EAAGU,KAAM,KAK1CQ,EAAgBF,EAAM,GAAkB,MAAbA,EAAM,GAAa,IAAMA,EAAM,GAAG0B,OAAO,GAAK,IACzEvB,EAAaH,EAAM,IAAMN,EAAOG,GAAKS,OACrCL,EAAMD,EAAM,IAAMG,EAAa,EAAIxB,EAAWuB,EAAeC,GAAoB,GACjFK,EAAOA,EAAOF,QAAUN,EAAM,GAAKN,EAAOG,EAAMI,EAAyB,MAAlBC,EAAwBR,EAAOO,EAAMJ,EAAMI,EAAMP,EAAOG,GAI3H,MAAOW,GAAOzB,KAAK,KAGvBnB,EAAQG,SAERH,EAAQK,MAAQ,SAAS0D,GAErB,IADA,GAAIC,GAAOD,EAAK3B,KAAYL,KAAiBkC,EAAY,EAClDD,GAAM,CACT,GAAqC,QAAhC5B,EAAQhB,EAAGK,KAAKyC,KAAKF,IACtBjC,EAAWA,EAAWW,QAAUN,EAAM,OAErC,IAAuC,QAAlCA,EAAQhB,EAAGM,OAAOwC,KAAKF,IAC7BjC,EAAWA,EAAWW,QAAU,QAE/B,CAAA,GAA4C,QAAvCN,EAAQhB,EAAGO,YAAYuC,KAAKF,IAgClC,KAAM,IAAIG,aAAY,mCA/BtB,IAAI/B,EAAM,GAAI,CACV6B,GAAa,CACb,IAAIG,MAAiBC,EAAoBjC,EAAM,GAAIkC,IACnD,IAAuD,QAAlDA,EAAclD,EAAGnB,IAAIiE,KAAKG,IAe3B,KAAM,IAAIF,aAAY,+CAbtB,KADAC,EAAWA,EAAW1B,QAAU4B,EAAY,GACwC,MAA5ED,EAAoBA,EAAkBV,UAAUW,EAAY,GAAG5B,UACnE,GAA8D,QAAzD4B,EAAclD,EAAGQ,WAAWsC,KAAKG,IAClCD,EAAWA,EAAW1B,QAAU4B,EAAY,OAE3C,CAAA,GAAgE,QAA3DA,EAAclD,EAAGS,aAAaqC,KAAKG,IAIzC,KAAM,IAAIF,aAAY,+CAHtBC,GAAWA,EAAW1B,QAAU4B,EAAY,GAUxDlC,EAAM,GAAKgC,MAGXH,IAAa,CAEjB,IAAkB,IAAdA,EACA,KAAM,IAAInB,OAAM,4EAEpBf,GAAWA,EAAWW,QAAUN,EAKpC4B,EAAOA,EAAKL,UAAUvB,EAAM,GAAGM,QAEnC,MAAOX,GAGX,IAAIwC,GAAW,SAASR,EAAK/B,EAAMwC,GAG/B,MAFAA,IAASxC,OAAYnB,MAAM,GAC3B2D,EAAMC,OAAO,EAAG,EAAGV,GACZ/D,EAAQ0E,MAAM,KAAMF,GAiBR,oBAAZG,UACPA,QAAQ3E,QAAUA,EAClB2E,QAAQJ,SAAWA,IAGnBxE,EAAOC,QAAUA,EACjBD,EAAOwE,SAAWA,EAEI,kBAAXK,SAAyBA,OAAOC,KACvCD,OAAO,WACH,OACI5E,QAASA,EACTuE,SAAUA,OAKT,mBAAXxE,QAAyB+E,KAAO/E"} \ No newline at end of file diff --git a/tools/eslint/node_modules/sprintf-js/package.json b/tools/eslint/node_modules/sprintf-js/package.json new file mode 100644 index 00000000000000..ccfa96e8b11e3a --- /dev/null +++ b/tools/eslint/node_modules/sprintf-js/package.json @@ -0,0 +1,78 @@ +{ + "_args": [ + [ + "sprintf-js@~1.0.2", + "/Users/silverwind/git/node/tools/package/package/node_modules/argparse" + ] + ], + "_from": "sprintf-js@>=1.0.2 <1.1.0", + "_id": "sprintf-js@1.0.3", + "_inCache": true, + "_installable": true, + "_location": "/sprintf-js", + "_nodeVersion": "0.12.4", + "_npmUser": { + "email": "hello@alexei.ro", + "name": "alexei" + }, + "_npmVersion": "2.10.1", + "_phantomChildren": {}, + "_requested": { + "name": "sprintf-js", + "raw": "sprintf-js@~1.0.2", + "rawSpec": "~1.0.2", + "scope": null, + "spec": ">=1.0.2 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/argparse" + ], + "_resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "_shasum": "04e6926f662895354f3dd015203633b857297e2c", + "_shrinkwrap": null, + "_spec": "sprintf-js@~1.0.2", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/argparse", + "author": { + "email": "hello@alexei.ro", + "name": "Alexandru Marasteanu", + "url": "http://alexei.ro/" + }, + "bugs": { + "url": "https://github.com/alexei/sprintf.js/issues" + }, + "dependencies": {}, + "description": "JavaScript sprintf implementation", + "devDependencies": { + "grunt": "*", + "grunt-contrib-uglify": "*", + "grunt-contrib-watch": "*", + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "04e6926f662895354f3dd015203633b857297e2c", + "tarball": "http://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" + }, + "gitHead": "747b806c2dab5b64d5c9958c42884946a187c3b1", + "homepage": "https://github.com/alexei/sprintf.js#readme", + "license": "BSD-3-Clause", + "main": "src/sprintf.js", + "maintainers": [ + { + "name": "alexei", + "email": "hello@alexei.ro" + } + ], + "name": "sprintf-js", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/alexei/sprintf.js.git" + }, + "scripts": { + "test": "mocha test/test.js" + }, + "version": "1.0.3" +} diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/src/angular-sprintf.js b/tools/eslint/node_modules/sprintf-js/src/angular-sprintf.js similarity index 100% rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/src/angular-sprintf.js rename to tools/eslint/node_modules/sprintf-js/src/angular-sprintf.js diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/src/sprintf.js b/tools/eslint/node_modules/sprintf-js/src/sprintf.js similarity index 83% rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/src/sprintf.js rename to tools/eslint/node_modules/sprintf-js/src/sprintf.js index 0ccb64c981e878..c0fc7c08b2e6fe 100644 --- a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/src/sprintf.js +++ b/tools/eslint/node_modules/sprintf-js/src/sprintf.js @@ -1,10 +1,12 @@ (function(window) { var re = { not_string: /[^s]/, - number: /[dief]/, + number: /[diefg]/, + json: /[j]/, + not_json: /[^j]/, text: /^[^\x25]+/, modulo: /^\x25{2}/, - placeholder: /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fiosuxX])/, + placeholder: /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/, key: /^([a-z_][a-z_\d]*)/i, key_access: /^\.([a-z_][a-z_\d]*)/i, index_access: /^\[(\d+)\]/, @@ -48,7 +50,7 @@ arg = arg() } - if (re.not_string.test(match[8]) && (get_type(arg) != "number" && isNaN(arg))) { + if (re.not_string.test(match[8]) && re.not_json.test(match[8]) && (get_type(arg) != "number" && isNaN(arg))) { throw new TypeError(sprintf("[sprintf] expecting number but found %s", get_type(arg))) } @@ -67,12 +69,18 @@ case "i": arg = parseInt(arg, 10) break + case "j": + arg = JSON.stringify(arg, null, match[6] ? parseInt(match[6]) : 0) + break case "e": arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential() break case "f": arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg) break + case "g": + arg = match[7] ? parseFloat(arg).toPrecision(match[7]) : parseFloat(arg) + break case "o": arg = arg.toString(8) break @@ -89,17 +97,22 @@ arg = arg.toString(16).toUpperCase() break } - if (re.number.test(match[8]) && (!is_positive || match[3])) { - sign = is_positive ? "+" : "-" - arg = arg.toString().replace(re.sign, "") + if (re.json.test(match[8])) { + output[output.length] = arg } else { - sign = "" + if (re.number.test(match[8]) && (!is_positive || match[3])) { + sign = is_positive ? "+" : "-" + arg = arg.toString().replace(re.sign, "") + } + else { + sign = "" + } + pad_character = match[4] ? match[4] === "0" ? "0" : match[4].charAt(1) : " " + pad_length = match[6] - (sign + arg).length + pad = match[6] ? (pad_length > 0 ? str_repeat(pad_character, pad_length) : "") : "" + output[output.length] = match[5] ? sign + arg + pad : (pad_character === "0" ? sign + pad + arg : pad + sign + arg) } - pad_character = match[4] ? match[4] === "0" ? "0" : match[4].charAt(1) : " " - pad_length = match[6] - (sign + arg).length - pad = match[6] ? (pad_length > 0 ? str_repeat(pad_character, pad_length) : "") : "" - output[output.length] = match[5] ? sign + arg + pad : (pad_character === "0" ? sign + pad + arg : pad + sign + arg) } } return output.join("") diff --git a/tools/eslint/node_modules/string-width/index.js b/tools/eslint/node_modules/string-width/index.js new file mode 100644 index 00000000000000..aa2f839b6dd2ce --- /dev/null +++ b/tools/eslint/node_modules/string-width/index.js @@ -0,0 +1,32 @@ +'use strict'; +var stripAnsi = require('strip-ansi'); +var codePointAt = require('code-point-at'); +var isFullwidthCodePoint = require('is-fullwidth-code-point'); + +// https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1345 +module.exports = function (str) { + if (typeof str !== 'string' || str.length === 0) { + return 0; + } + + var width = 0; + + str = stripAnsi(str); + + for (var i = 0; i < str.length; i++) { + var code = codePointAt(str, i); + + // surrogates + if (code >= 0x10000) { + i++; + } + + if (isFullwidthCodePoint(code)) { + width += 2; + } else { + width++; + } + } + + return width; +}; diff --git a/tools/eslint/node_modules/string-width/license b/tools/eslint/node_modules/string-width/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/tools/eslint/node_modules/string-width/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tools/eslint/node_modules/string-width/package.json b/tools/eslint/node_modules/string-width/package.json new file mode 100644 index 00000000000000..87610fc4644544 --- /dev/null +++ b/tools/eslint/node_modules/string-width/package.json @@ -0,0 +1,111 @@ +{ + "_args": [ + [ + "string-width@^1.0.1", + "/Users/silverwind/git/node/tools/package/package/node_modules/inquirer" + ] + ], + "_from": "string-width@>=1.0.1 <2.0.0", + "_id": "string-width@1.0.1", + "_inCache": true, + "_installable": true, + "_location": "/string-width", + "_nodeVersion": "0.12.5", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_npmVersion": "2.11.2", + "_phantomChildren": {}, + "_requested": { + "name": "string-width", + "raw": "string-width@^1.0.1", + "rawSpec": "^1.0.1", + "scope": null, + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/inquirer", + "/table" + ], + "_resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.1.tgz", + "_shasum": "c92129b6f1d7f52acf9af424a26e3864a05ceb0a", + "_shrinkwrap": null, + "_spec": "string-width@^1.0.1", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/inquirer", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/string-width/issues" + }, + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "description": "Get the visual width of a string - the number of columns required to display it", + "devDependencies": { + "ava": "0.0.4" + }, + "directories": {}, + "dist": { + "shasum": "c92129b6f1d7f52acf9af424a26e3864a05ceb0a", + "tarball": "http://registry.npmjs.org/string-width/-/string-width-1.0.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "f279cfd14835f0a3c8df69ba18e9a3960156e135", + "homepage": "https://github.com/sindresorhus/string-width", + "keywords": [ + "ansi", + "char", + "character", + "chinese", + "cjk", + "cli", + "codes", + "column", + "columns", + "command-line", + "console", + "escape", + "fixed-width", + "full", + "full-width", + "fullwidth", + "japanese", + "korean", + "str", + "string", + "terminal", + "unicode", + "visual", + "width" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "string-width", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/string-width.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.1" +} diff --git a/tools/eslint/node_modules/string-width/readme.md b/tools/eslint/node_modules/string-width/readme.md new file mode 100644 index 00000000000000..a7737a986c5736 --- /dev/null +++ b/tools/eslint/node_modules/string-width/readme.md @@ -0,0 +1,41 @@ +# string-width [![Build Status](https://travis-ci.org/sindresorhus/string-width.svg?branch=master)](https://travis-ci.org/sindresorhus/string-width) + +> Get the visual width of a string - the number of columns required to display it + +Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. + +Useful to be able to measure the actual width of command-line output. + + +## Install + +``` +$ npm install --save string-width +``` + + +## Usage + +```js +var stringWidth = require('string-width'); + +stringWidth('古'); +//=> 2 + +stringWidth('\u001b[1m古\u001b[22m'); +//=> 2 + +stringWidth('a'); +//=> 1 +``` + + +## Related + +- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module +- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/LICENSE b/tools/eslint/node_modules/string_decoder/LICENSE similarity index 100% rename from deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/LICENSE rename to tools/eslint/node_modules/string_decoder/LICENSE diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/README.md b/tools/eslint/node_modules/string_decoder/README.md similarity index 100% rename from deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/README.md rename to tools/eslint/node_modules/string_decoder/README.md diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/index.js b/tools/eslint/node_modules/string_decoder/index.js similarity index 100% rename from deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/index.js rename to tools/eslint/node_modules/string_decoder/index.js diff --git a/tools/eslint/node_modules/string_decoder/package.json b/tools/eslint/node_modules/string_decoder/package.json new file mode 100644 index 00000000000000..c0fe7cf3e314f1 --- /dev/null +++ b/tools/eslint/node_modules/string_decoder/package.json @@ -0,0 +1,79 @@ +{ + "_args": [ + [ + "string_decoder@~0.10.x", + "/Users/silverwind/git/node/tools/package/package/node_modules/readable-stream" + ] + ], + "_from": "string_decoder@>=0.10.0 <0.11.0", + "_id": "string_decoder@0.10.31", + "_inCache": true, + "_installable": true, + "_location": "/string_decoder", + "_npmUser": { + "email": "rod@vagg.org", + "name": "rvagg" + }, + "_npmVersion": "1.4.23", + "_phantomChildren": {}, + "_requested": { + "name": "string_decoder", + "raw": "string_decoder@~0.10.x", + "rawSpec": "~0.10.x", + "scope": null, + "spec": ">=0.10.0 <0.11.0", + "type": "range" + }, + "_requiredBy": [ + "/readable-stream" + ], + "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", + "_shrinkwrap": null, + "_spec": "string_decoder@~0.10.x", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/readable-stream", + "bugs": { + "url": "https://github.com/rvagg/string_decoder/issues" + }, + "dependencies": {}, + "description": "The string_decoder module from Node core", + "devDependencies": { + "tap": "~0.4.8" + }, + "directories": {}, + "dist": { + "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", + "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + }, + "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0", + "homepage": "https://github.com/rvagg/string_decoder", + "keywords": [ + "browser", + "browserify", + "decoder", + "string" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + }, + { + "name": "rvagg", + "email": "rod@vagg.org" + } + ], + "name": "string_decoder", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/rvagg/string_decoder.git" + }, + "scripts": { + "test": "tap test/simple/*.js" + }, + "version": "0.10.31" +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/index.js b/tools/eslint/node_modules/strip-ansi/index.js similarity index 100% rename from deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/index.js rename to tools/eslint/node_modules/strip-ansi/index.js diff --git a/tools/eslint/node_modules/strip-ansi/license b/tools/eslint/node_modules/strip-ansi/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/tools/eslint/node_modules/strip-ansi/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tools/eslint/node_modules/strip-ansi/package.json b/tools/eslint/node_modules/strip-ansi/package.json new file mode 100644 index 00000000000000..dc273a87c98f0c --- /dev/null +++ b/tools/eslint/node_modules/strip-ansi/package.json @@ -0,0 +1,118 @@ +{ + "_args": [ + [ + "strip-ansi@^3.0.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/chalk" + ] + ], + "_from": "strip-ansi@>=3.0.0 <4.0.0", + "_id": "strip-ansi@3.0.1", + "_inCache": true, + "_installable": true, + "_location": "/strip-ansi", + "_nodeVersion": "0.12.7", + "_npmOperationalInternal": { + "host": "packages-9-west.internal.npmjs.com", + "tmp": "tmp/strip-ansi-3.0.1.tgz_1456057278183_0.28958667791448534" + }, + "_npmUser": { + "email": "jappelman@xebia.com", + "name": "jbnicolai" + }, + "_npmVersion": "2.11.3", + "_phantomChildren": {}, + "_requested": { + "name": "strip-ansi", + "raw": "strip-ansi@^3.0.0", + "rawSpec": "^3.0.0", + "scope": null, + "spec": ">=3.0.0 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/chalk", + "/inquirer", + "/string-width", + "/table" + ], + "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "_shasum": "6a385fb8853d952d5ff05d0e8aaf94278dc63dcf", + "_shrinkwrap": null, + "_spec": "strip-ansi@^3.0.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/chalk", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/strip-ansi/issues" + }, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "description": "Strip ANSI escape codes", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "6a385fb8853d952d5ff05d0e8aaf94278dc63dcf", + "tarball": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "8270705c704956da865623e564eba4875c3ea17f", + "homepage": "https://github.com/chalk/strip-ansi", + "keywords": [ + "256", + "ansi", + "color", + "colors", + "colour", + "command-line", + "console", + "escape", + "formatting", + "log", + "logging", + "remove", + "rgb", + "shell", + "string", + "strip", + "styles", + "terminal", + "text", + "trim", + "tty", + "xterm" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "name": "strip-ansi", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/strip-ansi.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "3.0.1" +} diff --git a/tools/eslint/node_modules/strip-ansi/readme.md b/tools/eslint/node_modules/strip-ansi/readme.md new file mode 100644 index 00000000000000..cb7d9ff7ee403d --- /dev/null +++ b/tools/eslint/node_modules/strip-ansi/readme.md @@ -0,0 +1,33 @@ +# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) + +> Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install --save strip-ansi +``` + + +## Usage + +```js +var stripAnsi = require('strip-ansi'); + +stripAnsi('\u001b[4mcake\u001b[0m'); +//=> 'cake' +``` + + +## Related + +- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module +- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes +- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/eslint/node_modules/strip-json-comments/cli.js b/tools/eslint/node_modules/strip-json-comments/cli.js index ac4da48457a2f5..aec5aa20e4a073 100755 --- a/tools/eslint/node_modules/strip-json-comments/cli.js +++ b/tools/eslint/node_modules/strip-json-comments/cli.js @@ -20,9 +20,9 @@ function getStdin(cb) { } if (process.argv.indexOf('-h') !== -1 || process.argv.indexOf('--help') !== -1) { - console.log('strip-json-comments > '); + console.log('strip-json-comments input-file > output-file'); console.log('or'); - console.log('cat | strip-json-comments > '); + console.log('strip-json-comments < input-file > output-file'); return; } diff --git a/tools/eslint/node_modules/strip-json-comments/license b/tools/eslint/node_modules/strip-json-comments/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/tools/eslint/node_modules/strip-json-comments/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tools/eslint/node_modules/strip-json-comments/package.json b/tools/eslint/node_modules/strip-json-comments/package.json index 0b4dc57515d3f0..f0574ec2606f2c 100644 --- a/tools/eslint/node_modules/strip-json-comments/package.json +++ b/tools/eslint/node_modules/strip-json-comments/package.json @@ -1,78 +1,104 @@ { - "name": "strip-json-comments", - "version": "1.0.2", - "description": "Strip comments from JSON. Lets you use comments in your JSON files!", - "keywords": [ - "json", - "strip", - "remove", - "delete", - "trim", - "comments", - "multiline", - "parse", - "config", - "configuration", - "conf", - "settings", - "util", - "env", - "environment", - "cli", - "bin" + "_args": [ + [ + "strip-json-comments@~1.0.1", + "/Users/silverwind/git/node/tools/package/package" + ] ], - "license": "MIT", - "author": { - "name": "Sindre Sorhus", + "_from": "strip-json-comments@>=1.0.1 <1.1.0", + "_id": "strip-json-comments@1.0.4", + "_inCache": true, + "_installable": true, + "_location": "/strip-json-comments", + "_nodeVersion": "0.12.5", + "_npmUser": { "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" + "name": "sindresorhus" }, - "files": [ - "cli.js", - "strip-json-comments.js" + "_npmVersion": "2.11.2", + "_phantomChildren": {}, + "_requested": { + "name": "strip-json-comments", + "raw": "strip-json-comments@~1.0.1", + "rawSpec": "~1.0.1", + "scope": null, + "spec": ">=1.0.1 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/" ], - "main": "strip-json-comments", + "_resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", + "_shasum": "1e15fbcac97d3ee99bf2d73b4c656b082bbafb91", + "_shrinkwrap": null, + "_spec": "strip-json-comments@~1.0.1", + "_where": "/Users/silverwind/git/node/tools/package/package", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "sindresorhus.com" + }, "bin": { "strip-json-comments": "cli.js" }, - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/strip-json-comments.git" - }, - "scripts": { - "test": "mocha" + "bugs": { + "url": "https://github.com/sindresorhus/strip-json-comments/issues" }, + "dependencies": {}, + "description": "Strip comments from JSON. Lets you use comments in your JSON files!", "devDependencies": { "mocha": "*" }, + "directories": {}, + "dist": { + "shasum": "1e15fbcac97d3ee99bf2d73b4c656b082bbafb91", + "tarball": "http://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz" + }, "engines": { "node": ">=0.8.0" }, - "gitHead": "142dd671c71f90fb7fdba440184b1bb64543acb3", - "bugs": { - "url": "https://github.com/sindresorhus/strip-json-comments/issues" - }, + "files": [ + "cli.js", + "strip-json-comments.js" + ], + "gitHead": "f58348696368583cc5bb18525fe31eacc9bd00e1", "homepage": "https://github.com/sindresorhus/strip-json-comments", - "_id": "strip-json-comments@1.0.2", - "_shasum": "5a48ab96023dbac1b7b8d0ffabf6f63f1677be9f", - "_from": "strip-json-comments@>=1.0.1 <1.1.0", - "_npmVersion": "2.1.2", - "_nodeVersion": "0.10.32", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, + "keywords": [ + "bin", + "cli", + "comments", + "conf", + "config", + "configuration", + "delete", + "env", + "environment", + "json", + "multiline", + "parse", + "remove", + "settings", + "strip", + "trim", + "util" + ], + "license": "MIT", + "main": "strip-json-comments", "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], - "dist": { - "shasum": "5a48ab96023dbac1b7b8d0ffabf6f63f1677be9f", - "tarball": "http://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.2.tgz" + "name": "strip-json-comments", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/strip-json-comments.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.2.tgz", - "readme": "ERROR: No README data found!" + "scripts": { + "test": "mocha --ui tdd" + }, + "version": "1.0.4" } diff --git a/tools/eslint/node_modules/strip-json-comments/readme.md b/tools/eslint/node_modules/strip-json-comments/readme.md index 336523243e6c0d..63ce165b23809f 100644 --- a/tools/eslint/node_modules/strip-json-comments/readme.md +++ b/tools/eslint/node_modules/strip-json-comments/readme.md @@ -13,10 +13,11 @@ This is now possible: It will remove single-line comments `//` and multi-line comments `/**/`. -Also available as a [gulp](https://github.com/sindresorhus/gulp-strip-json-comments)/[grunt](https://github.com/sindresorhus/grunt-strip-json-comments)/[broccoli](https://github.com/sindresorhus/broccoli-strip-json-comments) plugin and a [require hook](https://github.com/uTest/autostrip-json-comments). +Also available as a [gulp](https://github.com/sindresorhus/gulp-strip-json-comments)/[grunt](https://github.com/sindresorhus/grunt-strip-json-comments)/[broccoli](https://github.com/sindresorhus/broccoli-strip-json-comments) plugin. +- -*There's already [json-comments](https://npmjs.org/package/json-comments), but it's only for Node.js and uses a naive regex to strip comments which fails on simple cases like `{"a":"//"}`. This module however parses out the comments.* +*There's also [`json-comments`](https://npmjs.org/package/json-comments), but it's only for Node.js, inefficient, bloated as it also minifies, and comes with a `require` hook, which is :(* ## Install @@ -69,6 +70,11 @@ strip-json-comments < input-file > output-file ``` +## Related + +- [`strip-css-comments`](https://github.com/sindresorhus/strip-css-comments) + + ## License MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/eslint/node_modules/strip-json-comments/strip-json-comments.js b/tools/eslint/node_modules/strip-json-comments/strip-json-comments.js index a47976fd51b4c0..eb77ce7456b8e5 100644 --- a/tools/eslint/node_modules/strip-json-comments/strip-json-comments.js +++ b/tools/eslint/node_modules/strip-json-comments/strip-json-comments.js @@ -8,6 +8,9 @@ (function () { 'use strict'; + var singleComment = 1; + var multiComment = 2; + function stripJsonComments(str) { var currentChar; var nextChar; @@ -19,8 +22,11 @@ currentChar = str[i]; nextChar = str[i + 1]; - if (!insideComment && str[i - 1] !== '\\' && currentChar === '"') { - insideString = !insideString; + if (!insideComment && currentChar === '"') { + var escaped = str[i - 1] === '\\' && str[i - 2] !== '\\'; + if (!insideComment && !escaped && currentChar === '"') { + insideString = !insideString; + } } if (insideString) { @@ -29,21 +35,21 @@ } if (!insideComment && currentChar + nextChar === '//') { - insideComment = 'single'; + insideComment = singleComment; i++; - } else if (insideComment === 'single' && currentChar + nextChar === '\r\n') { + } else if (insideComment === singleComment && currentChar + nextChar === '\r\n') { insideComment = false; i++; ret += currentChar; ret += nextChar; continue; - } else if (insideComment === 'single' && currentChar === '\n') { + } else if (insideComment === singleComment && currentChar === '\n') { insideComment = false; } else if (!insideComment && currentChar + nextChar === '/*') { - insideComment = 'multi'; + insideComment = multiComment; i++; continue; - } else if (insideComment === 'multi' && currentChar + nextChar === '*/') { + } else if (insideComment === multiComment && currentChar + nextChar === '*/') { insideComment = false; i++; continue; diff --git a/tools/eslint/node_modules/supports-color/index.js b/tools/eslint/node_modules/supports-color/index.js new file mode 100644 index 00000000000000..4346e272e1f1cd --- /dev/null +++ b/tools/eslint/node_modules/supports-color/index.js @@ -0,0 +1,50 @@ +'use strict'; +var argv = process.argv; + +var terminator = argv.indexOf('--'); +var hasFlag = function (flag) { + flag = '--' + flag; + var pos = argv.indexOf(flag); + return pos !== -1 && (terminator !== -1 ? pos < terminator : true); +}; + +module.exports = (function () { + if ('FORCE_COLOR' in process.env) { + return true; + } + + if (hasFlag('no-color') || + hasFlag('no-colors') || + hasFlag('color=false')) { + return false; + } + + if (hasFlag('color') || + hasFlag('colors') || + hasFlag('color=true') || + hasFlag('color=always')) { + return true; + } + + if (process.stdout && !process.stdout.isTTY) { + return false; + } + + if (process.platform === 'win32') { + return true; + } + + if ('COLORTERM' in process.env) { + return true; + } + + if (process.env.TERM === 'dumb') { + return false; + } + + if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) { + return true; + } + + return false; +})(); diff --git a/tools/eslint/node_modules/supports-color/license b/tools/eslint/node_modules/supports-color/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/tools/eslint/node_modules/supports-color/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/tools/eslint/node_modules/supports-color/package.json b/tools/eslint/node_modules/supports-color/package.json new file mode 100644 index 00000000000000..6d39985d35282e --- /dev/null +++ b/tools/eslint/node_modules/supports-color/package.json @@ -0,0 +1,105 @@ +{ + "_args": [ + [ + "supports-color@^2.0.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/chalk" + ] + ], + "_from": "supports-color@>=2.0.0 <3.0.0", + "_id": "supports-color@2.0.0", + "_inCache": true, + "_installable": true, + "_location": "/supports-color", + "_nodeVersion": "0.12.5", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_npmVersion": "2.11.2", + "_phantomChildren": {}, + "_requested": { + "name": "supports-color", + "raw": "supports-color@^2.0.0", + "rawSpec": "^2.0.0", + "scope": null, + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/chalk" + ], + "_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "_shasum": "535d045ce6b6363fa40117084629995e9df324c7", + "_shrinkwrap": null, + "_spec": "supports-color@^2.0.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/chalk", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/supports-color/issues" + }, + "dependencies": {}, + "description": "Detect whether a terminal supports color", + "devDependencies": { + "mocha": "*", + "require-uncached": "^1.0.2" + }, + "directories": {}, + "dist": { + "shasum": "535d045ce6b6363fa40117084629995e9df324c7", + "tarball": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz" + }, + "engines": { + "node": ">=0.8.0" + }, + "files": [ + "index.js" + ], + "gitHead": "8400d98ade32b2adffd50902c06d9e725a5c6588", + "homepage": "https://github.com/chalk/supports-color", + "keywords": [ + "256", + "ansi", + "capability", + "cli", + "color", + "colors", + "colour", + "command-line", + "console", + "detect", + "rgb", + "shell", + "styles", + "support", + "supports", + "terminal", + "tty", + "xterm" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "name": "supports-color", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/supports-color.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "2.0.0" +} diff --git a/tools/eslint/node_modules/supports-color/readme.md b/tools/eslint/node_modules/supports-color/readme.md new file mode 100644 index 00000000000000..b4761f1ecdeaf0 --- /dev/null +++ b/tools/eslint/node_modules/supports-color/readme.md @@ -0,0 +1,36 @@ +# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color) + +> Detect whether a terminal supports color + + +## Install + +``` +$ npm install --save supports-color +``` + + +## Usage + +```js +var supportsColor = require('supports-color'); + +if (supportsColor) { + console.log('Terminal supports color'); +} +``` + +It obeys the `--color` and `--no-color` CLI flags. + +For situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`. + + +## Related + +- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/tools/eslint/node_modules/table/LICENSE b/tools/eslint/node_modules/table/LICENSE new file mode 100644 index 00000000000000..7e84ea3afc0677 --- /dev/null +++ b/tools/eslint/node_modules/table/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2016, Gajus Kuizinas (http://gajus.com/) +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Gajus Kuizinas (http://gajus.com/) nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL ANUARY BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/eslint/node_modules/table/README.md b/tools/eslint/node_modules/table/README.md new file mode 100644 index 00000000000000..be0589bc48b947 --- /dev/null +++ b/tools/eslint/node_modules/table/README.md @@ -0,0 +1,651 @@ +

      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) + +* [Table](#table) + * [Features](#table-features) + * [Usage](#table-usage) + * [Cell Content Alignment](#table-usage-cell-content-alignment) + * [Column Width](#table-usage-column-width) + * [Custom Border](#table-usage-custom-border) + * [Draw Horizontal Line](#table-usage-draw-horizontal-line) + * [Padding Cell Content](#table-usage-padding-cell-content) + * [Predefined Border Templates](#table-usage-predefined-border-templates) + * [Streaming](#table-usage-streaming) + * [Text Truncation](#table-usage-text-truncation) + * [Text Wrapping](#table-usage-text-wrapping) + + +Produces a string that represents array data in a text table. + +![Demo of table displaying a list of missions to the Moon.](./.README/demo.png) + +

      Features

      + +* Works with strings containing [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) characters. +* Works with strings containing [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code). +* Configurable border characters. +* Configurable content alignment per column. +* Configurable content padding per column. +* Configurable column width. +* Text wrapping. + +

      Usage

      + +Table data is described using an array (rows) of array (cells). + +```js +import table from 'table'; + +let data, + output; + +data = [ + ['0A', '0B', '0C'], + ['1A', '1B', '1C'], + ['2A', '2B', '2C'] +]; + +/** + * @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 {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 dynamically tell table whether to draw a line separating rows or not. + * The default behavior is to always return true. + * + * @typedef {function} drawJoin + * @param {number} index + * @param {number} size + * @return {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~drawJoin} drawHorizontalLine + */ + +/** + * Generates a text table. + * + * @param {table~row[]} rows + * @param {table~config} config + * @return {String} + */ +output = table(data); + +console.log(output); +``` + +``` +╔════╤════╤════╗ +║ 0A │ 0B │ 0C ║ +╟────┼────┼────╢ +║ 1A │ 1B │ 1C ║ +╟────┼────┼────╢ +║ 2A │ 2B │ 2C ║ +╚════╧════╧════╝ +``` + + +

      Cell Content Alignment

      + +`{string} config.columns[{number}].alignment` property controls content horizontal alignment within a cell. + +Valid values are: "left", "right" and "center". + +```js +let config, + data, + output; + +data = [ + ['0A', '0B', '0C'], + ['1A', '1B', '1C'], + ['2A', '2B', '2C'] +]; + +config = { + columns: { + 0: { + alignment: 'left', + minWidth: 10 + }, + 1: { + alignment: 'center', + minWidth: 10 + }, + 2: { + alignment: 'right', + minWidth: 10 + } + } +}; + +output = table(data, config); + +console.log(output); +``` + +``` +╔════════════╤════════════╤════════════╗ +║ 0A │ 0B │ 0C ║ +╟────────────┼────────────┼────────────╢ +║ 1A │ 1B │ 1C ║ +╟────────────┼────────────┼────────────╢ +║ 2A │ 2B │ 2C ║ +╚════════════╧════════════╧════════════╝ +``` + +

      Column Width

      + +`{number} config.columns[{number}].width` property restricts column width to a fixed width. + +```js +let data, + output, + options; + +data = [ + ['0A', '0B', '0C'], + ['1A', '1B', '1C'], + ['2A', '2B', '2C'] +]; + +options = { + columns: { + 1: { + width: 10 + } + } +}; + +output = table(data, options); + +console.log(output); +``` + +``` +╔════╤════════════╤════╗ +║ 0A │ 0B │ 0C ║ +╟────┼────────────┼────╢ +║ 1A │ 1B │ 1C ║ +╟────┼────────────┼────╢ +║ 2A │ 2B │ 2C ║ +╚════╧════════════╧════╝ +``` + +

      Custom Border

      + +`{object} config.border` property describes characters used to draw the table border. + +```js +let config, + data, + output; + +data = [ + ['0A', '0B', '0C'], + ['1A', '1B', '1C'], + ['2A', '2B', '2C'] +]; + +config = { + border: { + topBody: `─`, + topJoin: `┬`, + topLeft: `┌`, + topRight: `┐`, + + bottomBody: `─`, + bottomJoin: `┴`, + bottomLeft: `└`, + bottomRight: `┘`, + + bodyLeft: `│`, + bodyRight: `│`, + bodyJoin: `│`, + + joinBody: `─`, + joinLeft: `├`, + joinRight: `┤`, + joinJoin: `┼` + } +}; + +output = table(data, config); + +console.log(output); +``` + +``` +┌────┬────┬────┐ +│ 0A │ 0B │ 0C │ +├────┼────┼────┤ +│ 1A │ 1B │ 1C │ +├────┼────┼────┤ +│ 2A │ 2B │ 2C │ +└────┴────┴────┘ +``` + +

      Draw Horizontal Line

      + +`{function} config.drawHorizontalLine` property is a function that is called for every non-content row in the table. The result of the function `{boolean}` determines whether a row is drawn. + +```js +let data, + output, + options; + +data = [ + ['0A', '0B', '0C'], + ['1A', '1B', '1C'], + ['2A', '2B', '2C'], + ['3A', '3B', '3C'], + ['4A', '4B', '4C'] +]; + +options = { + /** + * @typedef {function} drawJoin + * @param {number} index + * @param {number} size + * @return {boolean} + */ + drawHorizontalLine: (index, size) => { + return index === 0 || index === 1 || index === size - 1 || index === size; + } +}; + +output = table(data, options); + +console.log(output); +``` + +``` +╔════╤════╤════╗ +║ 0A │ 0B │ 0C ║ +╟────┼────┼────╢ +║ 1A │ 1B │ 1C ║ +║ 2A │ 2B │ 2C ║ +║ 3A │ 3B │ 3C ║ +╟────┼────┼────╢ +║ 4A │ 4B │ 4C ║ +╚════╧════╧════╝ +``` + +

      Padding Cell Content

      + +`{number} config.columns[{number}].paddingLeft` and `{number} config.columns[{number}].paddingRight` properties control content padding within a cell. Property value represents a number of whitespaces used to pad the content. + +```js +let config, + data, + output; + +data = [ + ['0A', 'AABBCC', '0C'], + ['1A', '1B', '1C'], + ['2A', '2B', '2C'] +]; + +config = { + columns: { + 0: { + paddingLeft: 3 + }, + 1: { + width: 2, + paddingRight: 3 + } + } +}; + +output = table(data, config); + +console.log(output); +``` + +``` +╔══════╤══════╤════╗ +║ 0A │ AA │ 0C ║ +║ │ BB │ ║ +║ │ CC │ ║ +╟──────┼──────┼────╢ +║ 1A │ 1B │ 1C ║ +╟──────┼──────┼────╢ +║ 2A │ 2B │ 2C ║ +╚══════╧══════╧════╝ +``` + +

      Predefined Border Templates

      + +You can load one of the predefined border templates using `getBorderCharacters` function. + +```js +import table, { + getBorderCharacters +} from 'table'; + +let config, + data; + +data = [ + ['0A', '0B', '0C'], + ['1A', '1B', '1C'], + ['2A', '2B', '2C'] +]; + +config = { + border: getBorderCharacters(`name of the template`) +}; + +table(data, config); +``` + +``` +# honeywell + +╔════╤════╤════╗ +║ 0A │ 0B │ 0C ║ +╟────┼────┼────╢ +║ 1A │ 1B │ 1C ║ +╟────┼────┼────╢ +║ 2A │ 2B │ 2C ║ +╚════╧════╧════╝ + +# norc + +┌────┬────┬────┐ +│ 0A │ 0B │ 0C │ +├────┼────┼────┤ +│ 1A │ 1B │ 1C │ +├────┼────┼────┤ +│ 2A │ 2B │ 2C │ +└────┴────┴────┘ + +# ramac (ASCII; for use in terminals that do not support Unicode characters) + ++----+----+----+ +| 0A | 0B | 0C | +|----|----|----| +| 1A | 1B | 1C | +|----|----|----| +| 2A | 2B | 2C | ++----+----+----+ + +# void (no borders; see "bordless table" section of the documentation) + + 0A 0B 0C + + 1A 1B 1C + + 2A 2B 2C + +``` + +Raise [an issue](https://github.com/gajus/table/issues) if you'd like to contribute a new border template. + +

      Borderless Table

      + +Simply using "void" border character template creates a table with a lot of unnecessary spacing. + +To create a more plesant to the eye table, reset the padding and remove the joining rows, e.g. + +```js +let output; + +output = table(data, { + border: getBorderCharacters(`void`), + columnDefault: { + paddingLeft: 0, + paddingRight: 1 + }, + drawJoin: () => { + return false + } +}); + +console.log(output); +``` + +``` +0A 0B 0C +1A 1B 1C +2A 2B 2C +``` + +

      Streaming

      + +`table` package exports `createStream` function used to draw a table and append rows. + +`createStream` requires `{number} columnDefault.width` and `{number} columnCount` configuration properties. + +```js +import { + createStream +} from 'table'; + +let config, + stream; + +config = { + columnDefault: { + width: 50 + }, + columnCount: 1 +}; + +stream = createStream(config); + +setInterval(() => { + stream.write([new Date()]); +}, 500); +``` + +![Streaming current date.](./.README/streaming.gif) + +`table` package uses ANSI escape codes to overwrite the output of the last line when a new row is printed. + +The underlying implementation is explained in this [Stack Overflow answer](http://stackoverflow.com/a/32938658/368691). + +Streaming supports all of the configuration properties and functionality of a static table (such as auto text wrapping, alignment and padding), e.g. + +```js +import { + createStream +} from 'table'; + +import _ from 'lodash'; + +let config, + stream, + i; + +config = { + columnDefault: { + width: 50 + }, + columnCount: 3, + columns: { + 0: { + width: 10, + alignment: 'right' + }, + 1: { + alignment: 'center', + }, + 2: { + width: 10 + } + } +}; + +stream = createStream(config); + +i = 0; + +setInterval(() => { + let random; + + random = _.sample('abcdefghijklmnopqrstuvwxyz', _.random(1, 30)).join(''); + + stream.write([i++, new Date(), random]); +}, 500); +``` + +![Streaming random data.](./.README/streaming-random.gif) +

      Text Truncation

      + +To handle a content that overflows the container width, `table` package implements [text wrapping](#table-usage-text-wrapping). However, sometimes you may want to truncate content that is too long to be displayed in the table. + +`{number} config.columns[{number}].truncate` property (default: `Infinity`) truncates the text at the specified length. + +```js +let config, + data, + output; + +data = [ + ['Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pulvinar nibh sed mauris convallis dapibus. Nunc venenatis tempus nulla sit amet viverra.'] +]; + +config = { + columns: { + 0: { + width: 20, + truncate: 100 + } + } +}; + +output = table(data, config); + +console.log(output); +``` + +``` +╔══════════════════════╗ +║ Lorem ipsum dolor si ║ +║ t amet, consectetur ║ +║ adipiscing elit. Pha ║ +║ sellus pulvinar nibh ║ +║ sed mauris conva... ║ +╚══════════════════════╝ +``` + +

      Text Wrapping

      + +`table` package implements auto text wrapping, i.e. text that has width greater than the container width will be separated into multiple lines, e.g. + +```js +let config, + data, + output; + +data = [ + ['Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pulvinar nibh sed mauris convallis dapibus. Nunc venenatis tempus nulla sit amet viverra.'] +]; + +config = { + columns: { + 0: { + width: 20 + } + } +}; + +output = table(data, config); + +console.log(output); +``` + +``` +╔══════════════════════╗ +║ Lorem ipsum dolor si ║ +║ t amet, consectetur ║ +║ adipiscing elit. Pha ║ +║ sellus pulvinar nibh ║ +║ sed mauris convallis ║ +║ dapibus. Nunc venena ║ +║ tis tempus nulla sit ║ +║ amet viverra. ║ +╚══════════════════════╝ +``` + +When `wrapWord` is `true` the text is broken at the nearest space or one of the special characters ("-", "_", "\", "/", ".", ",", ";"), e.g. + +```js +let config, + data, + output; + +data = [ + ['Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pulvinar nibh sed mauris convallis dapibus. Nunc venenatis tempus nulla sit amet viverra.'] +]; + +config = { + columns: { + 0: { + width: 20, + wrapWord: true + } + } +}; + +output = table(data, config); + +console.log(output); +``` + +``` +╔══════════════════════╗ +║ Lorem ipsum dolor ║ +║ sit amet, ║ +║ consectetur ║ +║ adipiscing elit. ║ +║ Phasellus pulvinar ║ +║ nibh sed mauris ║ +║ convallis dapibus. ║ +║ Nunc venenatis ║ +║ tempus nulla sit ║ +║ amet viverra. ║ +╚══════════════════════╝ +``` diff --git a/tools/eslint/node_modules/table/dist/alignString.js b/tools/eslint/node_modules/table/dist/alignString.js new file mode 100644 index 00000000000000..24891e74ca95df --- /dev/null +++ b/tools/eslint/node_modules/table/dist/alignString.js @@ -0,0 +1,129 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _isNumber2 = require('lodash/isNumber'); + +var _isNumber3 = _interopRequireDefault(_isNumber2); + +var _isString2 = require('lodash/isString'); + +var _isString3 = _interopRequireDefault(_isString2); + +var _floor2 = require('lodash/floor'); + +var _floor3 = _interopRequireDefault(_floor2); + +var _repeat2 = require('lodash/repeat'); + +var _repeat3 = _interopRequireDefault(_repeat2); + +var _stringWidth = require('string-width'); + +var _stringWidth2 = _interopRequireDefault(_stringWidth); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var alignCenter = undefined, + alignLeft = undefined, + alignRight = undefined, + alignments = undefined; + +alignments = ['left', 'right', 'center']; + +/** + * @param {string} subject + * @param {number} width + * @returns {string} + */ +alignLeft = function alignLeft(subject, width) { + return subject + (0, _repeat3.default)(' ', width); +}; + +/** + * @param {string} subject + * @param {number} width + * @returns {string} + */ +alignRight = function alignRight(subject, width) { + return (0, _repeat3.default)(' ', width) + subject; +}; + +/** + * @param {string} subject + * @param {number} width + * @returns {string} + */ +alignCenter = function alignCenter(subject, width) { + var halfWidth = undefined; + + halfWidth = width / 2; + + if (halfWidth % 2 === 0) { + return (0, _repeat3.default)(' ', halfWidth) + subject + (0, _repeat3.default)(' ', halfWidth); + } else { + halfWidth = (0, _floor3.default)(halfWidth); + + return (0, _repeat3.default)(' ', halfWidth) + subject + (0, _repeat3.default)(' ', 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} + */ + +exports.default = function (subject, containerWidth, alignment) { + var availableWidth = undefined, + subjectWidth = undefined; + + if (!(0, _isString3.default)(subject)) { + throw new Error('Subject parameter value must be a string.'); + } + + if (!(0, _isNumber3.default)(containerWidth)) { + throw new Error('Container width parameter value must be a number.'); + } + + subjectWidth = (0, _stringWidth2.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 (!(0, _isString3.default)(alignment)) { + throw new Error('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 (0, _repeat3.default)(' ', containerWidth); + } + + availableWidth = containerWidth - subjectWidth; + + if (alignment === 'left') { + return alignLeft(subject, availableWidth); + } + + if (alignment === 'right') { + return alignRight(subject, availableWidth); + } + + return alignCenter(subject, availableWidth); +}; + +module.exports = exports['default']; +//# sourceMappingURL=alignString.js.map diff --git a/tools/eslint/node_modules/table/dist/alignString.js.map b/tools/eslint/node_modules/table/dist/alignString.js.map new file mode 100644 index 00000000000000..77fabeadafc29b --- /dev/null +++ b/tools/eslint/node_modules/table/dist/alignString.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["alignString.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAI,WAAW,YAAA;IACX,SAAS,YAAA;IACT,UAAU,YAAA;IACV,UAAU,YAAA,CAAC;;AAEf,UAAU,GAAG,CACT,MAAM,EACN,OAAO,EACP,QAAQ,CACX;;;;;;;AAAC,AAOF,SAAS,GAAG,mBAAC,OAAO,EAAE,KAAK,EAAK;AAC5B,WAAO,OAAO,GAAG,sBAAS,GAAG,EAAE,KAAK,CAAC,CAAC;CACzC;;;;;;;AAAC,AAOF,UAAU,GAAG,oBAAC,OAAO,EAAE,KAAK,EAAK;AAC7B,WAAO,sBAAS,GAAG,EAAE,KAAK,CAAC,GAAG,OAAO,CAAC;CACzC;;;;;;;AAAC,AAOF,WAAW,GAAG,qBAAC,OAAO,EAAE,KAAK,EAAK;AAC9B,QAAI,SAAS,YAAA,CAAC;;AAEd,aAAS,GAAG,KAAK,GAAG,CAAC,CAAC;;AAEtB,QAAI,SAAS,GAAG,CAAC,KAAK,CAAC,EAAE;AACrB,eAAO,sBAAS,GAAG,EAAE,SAAS,CAAC,GAAG,OAAO,GAAG,sBAAS,GAAG,EAAE,SAAS,CAAC,CAAC;KACxE,MAAM;AACH,iBAAS,GAAG,qBAAQ,SAAS,CAAC,CAAC;;AAE/B,eAAO,sBAAS,GAAG,EAAE,SAAS,CAAC,GAAG,OAAO,GAAG,sBAAS,GAAG,EAAE,SAAS,GAAG,CAAC,CAAC,CAAC;KAC5E;CACJ;;;;;;;;;;;AAAC;kBAWa,UAAC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAK;AACnD,QAAI,cAAc,YAAA;QACd,YAAY,YAAA,CAAC;;AAEjB,QAAI,CAAC,wBAAW,OAAO,CAAC,EAAE;AACtB,cAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;KAChE;;AAED,QAAI,CAAC,wBAAW,cAAc,CAAC,EAAE;AAC7B,cAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;KACxE;;AAED,gBAAY,GAAG,2BAAY,OAAO,CAAC,CAAC;;AAEpC,QAAI,YAAY,GAAG,cAAc,EAAE;;;AAG/B,cAAM,IAAI,KAAK,CAAC,2EAA2E,CAAC,CAAC;KAChG;;AAED,QAAI,CAAC,wBAAW,SAAS,CAAC,EAAE;AACxB,cAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;KAClE;;AAED,QAAI,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE;AACtC,cAAM,IAAI,KAAK,CAAC,4FAA4F,CAAC,CAAC;KACjH;;AAED,QAAI,YAAY,KAAK,CAAC,EAAE;AACpB,eAAO,sBAAS,GAAG,EAAE,cAAc,CAAC,CAAC;KACxC;;AAED,kBAAc,GAAG,cAAc,GAAG,YAAY,CAAC;;AAE/C,QAAI,SAAS,KAAK,MAAM,EAAE;AACtB,eAAO,SAAS,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;KAC7C;;AAED,QAAI,SAAS,KAAK,OAAO,EAAE;AACvB,eAAO,UAAU,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;KAC9C;;AAED,WAAO,WAAW,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;CAC/C","file":"alignString.js","sourcesContent":["import _ from 'lodash';\nimport stringWidth from 'string-width';\n\nlet alignCenter,\n alignLeft,\n alignRight,\n alignments;\n\nalignments = [\n 'left',\n 'right',\n 'center'\n];\n\n/**\n * @param {string} subject\n * @param {number} width\n * @returns {string}\n */\nalignLeft = (subject, width) => {\n return subject + _.repeat(' ', width);\n};\n\n/**\n * @param {string} subject\n * @param {number} width\n * @returns {string}\n */\nalignRight = (subject, width) => {\n return _.repeat(' ', width) + subject;\n};\n\n/**\n * @param {string} subject\n * @param {number} width\n * @returns {string}\n */\nalignCenter = (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 = _.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 let availableWidth,\n subjectWidth;\n\n if (!_.isString(subject)) {\n throw new Error('Subject parameter value must be a string.');\n }\n\n if (!_.isNumber(containerWidth)) {\n throw new Error('Container width parameter value must be a number.');\n }\n\n 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 Error('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 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"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/tools/eslint/node_modules/table/dist/alignTableData.js b/tools/eslint/node_modules/table/dist/alignTableData.js new file mode 100644 index 00000000000000..2fa881d01d7ee9 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/alignTableData.js @@ -0,0 +1,44 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _map2 = require('lodash/map'); + +var _map3 = _interopRequireDefault(_map2); + +var _alignString = require('./alignString'); + +var _alignString2 = _interopRequireDefault(_alignString); + +var _stringWidth = require('string-width'); + +var _stringWidth2 = _interopRequireDefault(_stringWidth); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @param {table~row[]} rows + * @param {Object} config + * @return {table~row[]} + */ + +exports.default = function (rows, config) { + return (0, _map3.default)(rows, function (cells) { + return (0, _map3.default)(cells, function (value, index1) { + var column = undefined; + + column = config.columns[index1]; + + if ((0, _stringWidth2.default)(value) === column.width) { + return value; + } else { + return (0, _alignString2.default)(value, column.width, column.alignment); + } + }); + }); +}; + +module.exports = exports['default']; +//# sourceMappingURL=alignTableData.js.map diff --git a/tools/eslint/node_modules/table/dist/alignTableData.js.map b/tools/eslint/node_modules/table/dist/alignTableData.js.map new file mode 100644 index 00000000000000..704e4c42fbeb9a --- /dev/null +++ b/tools/eslint/node_modules/table/dist/alignTableData.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["alignTableData.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;kBASe,UAAC,IAAI,EAAE,MAAM,EAAK;AAC7B,WAAO,mBAAM,IAAI,EAAE,UAAC,KAAK,EAAK;AAC1B,eAAO,mBAAM,KAAK,EAAE,UAAC,KAAK,EAAE,MAAM,EAAK;AACnC,gBAAI,MAAM,YAAA,CAAC;;AAEX,kBAAM,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;;AAEhC,gBAAI,2BAAY,KAAK,CAAC,KAAK,MAAM,CAAC,KAAK,EAAE;AACrC,uBAAO,KAAK,CAAC;aAChB,MAAM;AACH,uBAAO,2BAAY,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;aAC7D;SACJ,CAAC,CAAC;KACN,CAAC,CAAC;CACN","file":"alignTableData.js","sourcesContent":["import _ from 'lodash';\nimport alignString from './alignString';\nimport stringWidth from 'string-width';\n\n/**\n * @param {table~row[]} rows\n * @param {Object} config\n * @return {table~row[]}\n */\nexport default (rows, config) => {\n return _.map(rows, (cells) => {\n return _.map(cells, (value, index1) => {\n let column;\n\n 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"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/tools/eslint/node_modules/table/dist/calculateCellHeight.js b/tools/eslint/node_modules/table/dist/calculateCellHeight.js new file mode 100644 index 00000000000000..eb4ce2d08e09a6 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/calculateCellHeight.js @@ -0,0 +1,59 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _ceil2 = require('lodash/ceil'); + +var _ceil3 = _interopRequireDefault(_ceil2); + +var _isInteger2 = require('lodash/isInteger'); + +var _isInteger3 = _interopRequireDefault(_isInteger2); + +var _isString2 = require('lodash/isString'); + +var _isString3 = _interopRequireDefault(_isString2); + +var _stringWidth = require('string-width'); + +var _stringWidth2 = _interopRequireDefault(_stringWidth); + +var _wrapWord = require('./wrapWord'); + +var _wrapWord2 = _interopRequireDefault(_wrapWord); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @param {string} value + * @param {number} columnWidth + * @param {boolean} useWrapWord + * @returns {number} + */ + +exports.default = function (value, columnWidth) { + var useWrapWord = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2]; + + if (!(0, _isString3.default)(value)) { + throw new Error('Value must be a string.'); + } + + if (!(0, _isInteger3.default)(columnWidth)) { + throw new Error('Column width must be an integer.'); + } + + if (columnWidth < 1) { + throw new Error('Column width must be greater than 0.'); + } + + if (useWrapWord) { + return (0, _wrapWord2.default)(value, columnWidth).length; + } + + return (0, _ceil3.default)((0, _stringWidth2.default)(value) / columnWidth); +}; + +module.exports = exports['default']; +//# sourceMappingURL=calculateCellHeight.js.map diff --git a/tools/eslint/node_modules/table/dist/calculateCellHeight.js.map b/tools/eslint/node_modules/table/dist/calculateCellHeight.js.map new file mode 100644 index 00000000000000..4983826b4f02b4 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/calculateCellHeight.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["calculateCellHeight.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAUe,UAAC,KAAK,EAAE,WAAW,EAA0B;QAAxB,WAAW,yDAAG,KAAK;;AACnD,QAAI,CAAC,wBAAW,KAAK,CAAC,EAAE;AACpB,cAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;KAC9C;;AAED,QAAI,CAAC,yBAAY,WAAW,CAAC,EAAE;AAC3B,cAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;KACvD;;AAED,QAAI,WAAW,GAAG,CAAC,EAAE;AACjB,cAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;KAC3D;;AAED,QAAI,WAAW,EAAE;AACb,eAAO,wBAAS,KAAK,EAAE,WAAW,CAAC,CAAC,MAAM,CAAC;KAC9C;;AAED,WAAO,oBAAO,2BAAY,KAAK,CAAC,GAAG,WAAW,CAAC,CAAC;CACnD","file":"calculateCellHeight.js","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 Error('Value must be a string.');\n }\n\n if (!_.isInteger(columnWidth)) {\n throw new Error('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 _.ceil(stringWidth(value) / columnWidth);\n};\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/tools/eslint/node_modules/table/dist/calculateCellWidthIndex.js b/tools/eslint/node_modules/table/dist/calculateCellWidthIndex.js new file mode 100644 index 00000000000000..ceb756ba1e8a13 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/calculateCellWidthIndex.js @@ -0,0 +1,31 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _map2 = require('lodash/map'); + +var _map3 = _interopRequireDefault(_map2); + +var _stringWidth = require('string-width'); + +var _stringWidth2 = _interopRequireDefault(_stringWidth); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Calculates width of each cell contents. + * + * @param {string[]} cells + * @return {number[]} + */ + +exports.default = function (cells) { + return (0, _map3.default)(cells, function (value) { + return (0, _stringWidth2.default)(value); + }); +}; + +module.exports = exports['default']; +//# sourceMappingURL=calculateCellWidthIndex.js.map diff --git a/tools/eslint/node_modules/table/dist/calculateCellWidthIndex.js.map b/tools/eslint/node_modules/table/dist/calculateCellWidthIndex.js.map new file mode 100644 index 00000000000000..a3c2eeb8708d81 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/calculateCellWidthIndex.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["calculateCellWidthIndex.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;kBASe,UAAC,KAAK,EAAK;AACtB,WAAO,mBAAM,KAAK,EAAE,UAAC,KAAK,EAAK;AAC3B,eAAO,2BAAY,KAAK,CAAC,CAAC;KAC7B,CAAC,CAAC;CACN","file":"calculateCellWidthIndex.js","sourcesContent":["import _ from 'lodash';\nimport stringWidth from 'string-width';\n\n/**\n * Calculates width of each cell contents.\n *\n * @param {string[]} cells\n * @return {number[]}\n */\nexport default (cells) => {\n return _.map(cells, (value) => {\n return stringWidth(value);\n });\n};\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/tools/eslint/node_modules/table/dist/calculateMaximumColumnWidthIndex.js b/tools/eslint/node_modules/table/dist/calculateMaximumColumnWidthIndex.js new file mode 100644 index 00000000000000..7e5d066d8d9017 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/calculateMaximumColumnWidthIndex.js @@ -0,0 +1,53 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _forEach2 = require('lodash/forEach'); + +var _forEach3 = _interopRequireDefault(_forEach2); + +var _fill2 = require('lodash/fill'); + +var _fill3 = _interopRequireDefault(_fill2); + +var _calculateCellWidthIndex = require('./calculateCellWidthIndex'); + +var _calculateCellWidthIndex2 = _interopRequireDefault(_calculateCellWidthIndex); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Produces an array of values that describe the largest value length (width) in every column. + * + * @param {Array[]} rows + * @return {number[]} + */ + +exports.default = function (rows) { + var columns = undefined; + + if (!rows[0]) { + throw new Error('Dataset must have at least one row.'); + } + + columns = (0, _fill3.default)(Array(rows[0].length), 0); + + (0, _forEach3.default)(rows, function (row) { + var columnWidthIndex = undefined; + + columnWidthIndex = (0, _calculateCellWidthIndex2.default)(row); + + (0, _forEach3.default)(columnWidthIndex, function (valueWidth, index0) { + if (columns[index0] < valueWidth) { + columns[index0] = valueWidth; + } + }); + }); + + return columns; +}; + +module.exports = exports['default']; +//# sourceMappingURL=calculateMaximumColumnWidthIndex.js.map diff --git a/tools/eslint/node_modules/table/dist/calculateMaximumColumnWidthIndex.js.map b/tools/eslint/node_modules/table/dist/calculateMaximumColumnWidthIndex.js.map new file mode 100644 index 00000000000000..ecb2c20ab36aed --- /dev/null +++ b/tools/eslint/node_modules/table/dist/calculateMaximumColumnWidthIndex.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["calculateMaximumColumnWidthIndex.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;kBASe,UAAC,IAAI,EAAK;AACrB,QAAI,OAAO,YAAA,CAAC;;AAEZ,QAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;AACV,cAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;KAC1D;;AAED,WAAO,GAAG,oBAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;;AAE3C,2BAAU,IAAI,EAAE,UAAC,GAAG,EAAK;AACrB,YAAI,gBAAgB,YAAA,CAAC;;AAErB,wBAAgB,GAAG,uCAAwB,GAAG,CAAC,CAAC;;AAEhD,+BAAU,gBAAgB,EAAE,UAAC,UAAU,EAAE,MAAM,EAAK;AAChD,gBAAI,OAAO,CAAC,MAAM,CAAC,GAAG,UAAU,EAAE;AAC9B,uBAAO,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC;aAChC;SACJ,CAAC,CAAC;KACN,CAAC,CAAC;;AAEH,WAAO,OAAO,CAAC;CAClB","file":"calculateMaximumColumnWidthIndex.js","sourcesContent":["import _ from 'lodash';\nimport 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 * @return {number[]}\n */\nexport default (rows) => {\n let columns;\n\n if (!rows[0]) {\n throw new Error('Dataset must have at least one row.');\n }\n\n columns = _.fill(Array(rows[0].length), 0);\n\n _.forEach(rows, (row) => {\n let columnWidthIndex;\n\n columnWidthIndex = calculateCellWidthIndex(row);\n\n _.forEach(columnWidthIndex, (valueWidth, index0) => {\n if (columns[index0] < valueWidth) {\n columns[index0] = valueWidth;\n }\n });\n });\n\n return columns;\n};\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/tools/eslint/node_modules/table/dist/calculateRowHeightIndex.js b/tools/eslint/node_modules/table/dist/calculateRowHeightIndex.js new file mode 100644 index 00000000000000..e1db4ad4193f86 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/calculateRowHeightIndex.js @@ -0,0 +1,73 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _max2 = require('lodash/max'); + +var _max3 = _interopRequireDefault(_max2); + +var _isBoolean2 = require('lodash/isBoolean'); + +var _isBoolean3 = _interopRequireDefault(_isBoolean2); + +var _isNumber2 = require('lodash/isNumber'); + +var _isNumber3 = _interopRequireDefault(_isNumber2); + +var _fill2 = require('lodash/fill'); + +var _fill3 = _interopRequireDefault(_fill2); + +var _forEach2 = require('lodash/forEach'); + +var _forEach3 = _interopRequireDefault(_forEach2); + +var _calculateCellHeight = require('./calculateCellHeight'); + +var _calculateCellHeight2 = _interopRequireDefault(_calculateCellHeight); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Calculates the vertical row span index. + * + * @param {Array[]} rows + * @param {Object} config + * @return {number[]} + */ + +exports.default = function (rows, config) { + var rowSpanIndex = undefined, + tableWidth = undefined; + + tableWidth = rows[0].length; + + rowSpanIndex = []; + + (0, _forEach3.default)(rows, function (cells) { + var cellHeightIndex = undefined; + + cellHeightIndex = (0, _fill3.default)(Array(tableWidth), 1); + + (0, _forEach3.default)(cells, function (value, index1) { + if (!(0, _isNumber3.default)(config.columns[index1].width)) { + throw new Error('column[index].width must be a number.'); + } + + if (!(0, _isBoolean3.default)(config.columns[index1].wrapWord)) { + throw new Error('column[index].wrapWord must be a boolean.'); + } + + cellHeightIndex[index1] = (0, _calculateCellHeight2.default)(value, config.columns[index1].width, config.columns[index1].wrapWord); + }); + + rowSpanIndex.push((0, _max3.default)(cellHeightIndex)); + }); + + return rowSpanIndex; +}; + +module.exports = exports['default']; +//# sourceMappingURL=calculateRowHeightIndex.js.map diff --git a/tools/eslint/node_modules/table/dist/calculateRowHeightIndex.js.map b/tools/eslint/node_modules/table/dist/calculateRowHeightIndex.js.map new file mode 100644 index 00000000000000..4788b174ea4cd1 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/calculateRowHeightIndex.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["calculateRowHeightIndex.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAUe,UAAC,IAAI,EAAE,MAAM,EAAK;AAC7B,QAAI,YAAY,YAAA;QACZ,UAAU,YAAA,CAAC;;AAEf,cAAU,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;;AAE5B,gBAAY,GAAG,EAAE,CAAC;;AAElB,2BAAU,IAAI,EAAE,UAAC,KAAK,EAAK;AACvB,YAAI,eAAe,YAAA,CAAC;;AAEpB,uBAAe,GAAG,oBAAO,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC;;AAE/C,+BAAU,KAAK,EAAE,UAAC,KAAK,EAAE,MAAM,EAAK;AAChC,gBAAI,CAAC,wBAAW,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,EAAE;AAC3C,sBAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;aAC5D;;AAED,gBAAI,CAAC,yBAAY,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAE;AAC/C,sBAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;aAChE;;AAED,2BAAe,CAAC,MAAM,CAAC,GAAG,mCAAoB,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC;SACvH,CAAC,CAAC;;AAEH,oBAAY,CAAC,IAAI,CAAC,mBAAM,eAAe,CAAC,CAAC,CAAC;KAC7C,CAAC,CAAC;;AAEH,WAAO,YAAY,CAAC;CACvB","file":"calculateRowHeightIndex.js","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 * @return {number[]}\n */\nexport default (rows, config) => {\n let rowSpanIndex,\n tableWidth;\n\n tableWidth = rows[0].length;\n\n rowSpanIndex = [];\n\n _.forEach(rows, (cells) => {\n let cellHeightIndex;\n\n cellHeightIndex = _.fill(Array(tableWidth), 1);\n\n _.forEach(cells, (value, index1) => {\n if (!_.isNumber(config.columns[index1].width)) {\n throw new Error('column[index].width must be a number.');\n }\n\n if (!_.isBoolean(config.columns[index1].wrapWord)) {\n throw new Error('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"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/tools/eslint/node_modules/table/dist/createStream.js b/tools/eslint/node_modules/table/dist/createStream.js new file mode 100644 index 00000000000000..236944ec7c31e7 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/createStream.js @@ -0,0 +1,179 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _mapValues2 = require('lodash/mapValues'); + +var _mapValues3 = _interopRequireDefault(_mapValues2); + +var _trimEnd2 = require('lodash/trimEnd'); + +var _trimEnd3 = _interopRequireDefault(_trimEnd2); + +var _map2 = require('lodash/map'); + +var _map3 = _interopRequireDefault(_map2); + +var _makeStreamConfig = require('./makeStreamConfig'); + +var _makeStreamConfig2 = _interopRequireDefault(_makeStreamConfig); + +var _drawRow = require('./drawRow'); + +var _drawRow2 = _interopRequireDefault(_drawRow); + +var _drawBorder = require('./drawBorder'); + +var _stringifyTableData = require('./stringifyTableData'); + +var _stringifyTableData2 = _interopRequireDefault(_stringifyTableData); + +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); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var append = undefined, + create = undefined, + prepareData = undefined; + +/** + * @param {string[]} row + * @param {number[]} columnWidthIndex + * @param {Object} config + * @returns {undefined} + */ +create = function create(row, columnWidthIndex, config) { + var body = undefined, + output = undefined, + rows = undefined; + + rows = prepareData([row], config); + + body = (0, _map3.default)(rows, function (literalRow) { + return (0, _drawRow2.default)(literalRow, config.border); + }).join(''); + + output = ''; + output += (0, _drawBorder.drawBorderTop)(columnWidthIndex, config.border); + output += body; + output += (0, _drawBorder.drawBorderBottom)(columnWidthIndex, config.border); + + output = (0, _trimEnd3.default)(output); + + process.stdout.write(output); +}; + +/** + * @param {string[]} row + * @param {number[]} columnWidthIndex + * @param {Object} config + * @returns {undefined} + */ +append = function append(row, columnWidthIndex, config) { + var body = undefined, + output = undefined, + rows = undefined; + + rows = prepareData([row], config); + + // console.log('rows', rows); + + body = (0, _map3.default)(rows, function (literalRow) { + return (0, _drawRow2.default)(literalRow, config.border); + }).join(''); + + output = '\r\x1b[K'; + output += (0, _drawBorder.drawBorderJoin)(columnWidthIndex, config.border); + output += body; + output += (0, _drawBorder.drawBorderBottom)(columnWidthIndex, config.border); + + output = (0, _trimEnd3.default)(output); + + process.stdout.write(output); +}; + +/** + * @param {Array} data + * @param {Object} config + * @returns {Array} + */ +prepareData = function prepareData(data, config) { + var rowHeightIndex = undefined, + rows = undefined; + + rows = (0, _stringifyTableData2.default)(data); + + rows = (0, _truncateTableData2.default)(data, config); + + 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); + + return rows; +}; + +/** + * @param {Object} userConfig + * @return {Object} + */ + +exports.default = function () { + var userConfig = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + + var columnWidthIndex = undefined, + config = undefined, + empty = undefined; + + config = (0, _makeStreamConfig2.default)(userConfig); + + columnWidthIndex = (0, _mapValues3.default)(config.columns, function (column) { + return column.width + column.paddingLeft + column.paddingRight; + }); + + empty = true; + + return { + /** + * @param {string[]} row + * @returns {undefined} + */ + write: function 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); + } + } + }; +}; + +module.exports = exports['default']; +//# sourceMappingURL=createStream.js.map diff --git a/tools/eslint/node_modules/table/dist/createStream.js.map b/tools/eslint/node_modules/table/dist/createStream.js.map new file mode 100644 index 00000000000000..bae4cce38f8cef --- /dev/null +++ b/tools/eslint/node_modules/table/dist/createStream.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["createStream.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,IAAI,MAAM,YAAA;IACN,MAAM,YAAA;IACN,WAAW,YAAA;;;;;;;;AAAC,AAQhB,MAAM,GAAG,gBAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAK;AACxC,QAAI,IAAI,YAAA;QACJ,MAAM,YAAA;QACN,IAAI,YAAA,CAAC;;AAET,QAAI,GAAG,WAAW,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;;AAElC,QAAI,GAAG,mBAAM,IAAI,EAAE,UAAC,UAAU,EAAK;AAC/B,eAAO,uBAAQ,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;KAC7C,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;;AAEZ,UAAM,GAAG,EAAE,CAAC;AACZ,UAAM,IAAI,gBAjCV,aAAa,EAiCW,gBAAgB,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;AACzD,UAAM,IAAI,IAAI,CAAC;AACf,UAAM,IAAI,gBArCV,gBAAgB,EAqCW,gBAAgB,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;;AAE5D,UAAM,GAAG,uBAAU,MAAM,CAAC,CAAC;;AAE3B,WAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;CAChC;;;;;;;;AAAC,AAQF,MAAM,GAAG,gBAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAK;AACxC,QAAI,IAAI,YAAA;QACJ,MAAM,YAAA;QACN,IAAI,YAAA,CAAC;;AAET,QAAI,GAAG,WAAW,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;;;;AAAC,AAIlC,QAAI,GAAG,mBAAM,IAAI,EAAE,UAAC,UAAU,EAAK;AAC/B,eAAO,uBAAQ,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;KAC7C,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;;AAEZ,UAAM,GAAG,UAAU,CAAC;AACpB,UAAM,IAAI,gBA/DV,cAAc,EA+DW,gBAAgB,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;AAC1D,UAAM,IAAI,IAAI,CAAC;AACf,UAAM,IAAI,gBAlEV,gBAAgB,EAkEW,gBAAgB,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;;AAE5D,UAAM,GAAG,uBAAU,MAAM,CAAC,CAAC;;AAE3B,WAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;CAChC;;;;;;;AAAC,AAOF,WAAW,GAAG,qBAAC,IAAI,EAAE,MAAM,EAAK;AAC5B,QAAI,cAAc,YAAA;QACd,IAAI,YAAA,CAAC;;AAET,QAAI,GAAG,kCAAmB,IAAI,CAAC,CAAC;;AAEhC,QAAI,GAAG,iCAAkB,IAAI,EAAE,MAAM,CAAC,CAAC;;AAEvC,kBAAc,GAAG,uCAAwB,IAAI,EAAE,MAAM,CAAC,CAAC;;AAEvD,QAAI,GAAG,0CAA2B,IAAI,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;AAChE,QAAI,GAAG,8BAAe,IAAI,EAAE,MAAM,CAAC,CAAC;AACpC,QAAI,GAAG,4BAAa,IAAI,EAAE,MAAM,CAAC,CAAC;;AAElC,WAAO,IAAI,CAAC;CACf;;;;;;AAAC;kBAMa,YAAqB;QAApB,UAAU,yDAAG,EAAE;;AAC3B,QAAI,gBAAgB,YAAA;QAChB,MAAM,YAAA;QACN,KAAK,YAAA,CAAC;;AAEV,UAAM,GAAG,gCAAiB,UAAU,CAAC,CAAC;;AAEtC,oBAAgB,GAAG,yBAAY,MAAM,CAAC,OAAO,EAAE,UAAC,MAAM,EAAK;AACvD,eAAO,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,YAAY,CAAC;KAClE,CAAC,CAAC;;AAEH,SAAK,GAAG,IAAI,CAAC;;AAEb,WAAO;;;;;AAKH,aAAK,EAAE,eAAC,GAAG,EAAK;AACZ,gBAAI,GAAG,CAAC,MAAM,KAAK,MAAM,CAAC,WAAW,EAAE;AACnC,sBAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;aAC5E;;AAED,gBAAI,KAAK,EAAE;AACP,qBAAK,GAAG,KAAK,CAAC;;AAEd,uBAAO,MAAM,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,CAAC,CAAC;aAChD,MAAM;AACH,uBAAO,MAAM,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,CAAC,CAAC;aAChD;SACJ;KACJ,CAAC;CACL","file":"createStream.js","sourcesContent":["import makeStreamConfig from './makeStreamConfig';\nimport drawRow from './drawRow';\nimport {\n drawBorderBottom,\n drawBorderJoin,\n drawBorderTop\n} from './drawBorder';\nimport _ from 'lodash';\n\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\nlet append,\n create,\n prepareData;\n\n/**\n * @param {string[]} row\n * @param {number[]} columnWidthIndex\n * @param {Object} config\n * @returns {undefined}\n */\ncreate = (row, columnWidthIndex, config) => {\n let body,\n output,\n rows;\n\n rows = prepareData([row], config);\n\n body = _.map(rows, (literalRow) => {\n return drawRow(literalRow, config.border);\n }).join('');\n\n output = '';\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 */\nappend = (row, columnWidthIndex, config) => {\n let body,\n output,\n rows;\n\n rows = prepareData([row], config);\n\n // console.log('rows', rows);\n\n body = _.map(rows, (literalRow) => {\n return drawRow(literalRow, config.border);\n }).join('');\n\n output = '\\r\\x1b[K';\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 {Array} data\n * @param {Object} config\n * @returns {Array}\n */\nprepareData = (data, config) => {\n let rowHeightIndex,\n rows;\n\n rows = stringifyTableData(data);\n\n rows = truncateTableData(data, config);\n\n 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 {Object} userConfig\n * @return {Object}\n */\nexport default (userConfig = {}) => {\n let columnWidthIndex,\n config,\n empty;\n\n config = makeStreamConfig(userConfig);\n\n columnWidthIndex = _.mapValues(config.columns, (column) => {\n return column.width + column.paddingLeft + column.paddingRight;\n });\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"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/tools/eslint/node_modules/table/dist/drawBorder.js b/tools/eslint/node_modules/table/dist/drawBorder.js new file mode 100644 index 00000000000000..dfb0488d01ade6 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/drawBorder.js @@ -0,0 +1,118 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.drawBorderBottom = exports.drawBorderJoin = exports.drawBorderTop = exports.drawBorder = undefined; + +var _repeat2 = require('lodash/repeat'); + +var _repeat3 = _interopRequireDefault(_repeat2); + +var _map2 = require('lodash/map'); + +var _map3 = _interopRequireDefault(_map2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var drawBorder = undefined, + drawBorderBottom = undefined, + drawBorderJoin = undefined, + drawBorderTop = undefined; + +/** + * @typedef drawBorder~parts + * @property {string} left + * @property {string} right + * @property {string} body + * @property {string} join + */ + +/** + * @param {number[]} columnSizeIndex + * @param {drawBorder~parts} parts + * @returns {string} + */ +exports.drawBorder = drawBorder = function drawBorder(columnSizeIndex, parts) { + var columns = undefined; + + columns = (0, _map3.default)(columnSizeIndex, function (size) { + return (0, _repeat3.default)(parts.body, size); + }); + + columns = columns.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 + * @return {string} + */ +exports.drawBorderTop = drawBorderTop = function drawBorderTop(columnSizeIndex, parts) { + return drawBorder(columnSizeIndex, { + left: parts.topLeft, + right: parts.topRight, + body: parts.topBody, + join: parts.topJoin + }); +}; + +/** + * @typedef drawBorderJoin~parts + * @property {string} joinLeft + * @property {string} joinRight + * @property {string} joinBody + * @property {string} joinJoin + */ + +/** + * @param {number[]} columnSizeIndex + * @param {drawBorderJoin~parts} parts + * @returns {string} + */ +exports.drawBorderJoin = drawBorderJoin = function drawBorderJoin(columnSizeIndex, parts) { + return drawBorder(columnSizeIndex, { + left: parts.joinLeft, + right: parts.joinRight, + body: parts.joinBody, + join: parts.joinJoin + }); +}; + +/** + * @typedef drawBorderBottom~parts + * @property {string} topLeft + * @property {string} topRight + * @property {string} topBody + * @property {string} topJoin + */ + +/** + * @param {number[]} columnSizeIndex + * @param {drawBorderBottom~parts} parts + * @returns {string} + */ +exports.drawBorderBottom = drawBorderBottom = function drawBorderBottom(columnSizeIndex, parts) { + return drawBorder(columnSizeIndex, { + left: parts.bottomLeft, + right: parts.bottomRight, + body: parts.bottomBody, + join: parts.bottomJoin + }); +}; + +exports.drawBorder = drawBorder; +exports.drawBorderTop = drawBorderTop; +exports.drawBorderJoin = drawBorderJoin; +exports.drawBorderBottom = drawBorderBottom; +//# sourceMappingURL=drawBorder.js.map diff --git a/tools/eslint/node_modules/table/dist/drawBorder.js.map b/tools/eslint/node_modules/table/dist/drawBorder.js.map new file mode 100644 index 00000000000000..1dd7b2024a583e --- /dev/null +++ b/tools/eslint/node_modules/table/dist/drawBorder.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["drawBorder.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAEA,IAAI,UAAU,YAAA;IACV,gBAAgB,YAAA;IAChB,cAAc,YAAA;IACd,aAAa,YAAA;;;;;;;;;;;;;;;AAAC,AAelB,QA+EI,UAAU,GA/Ed,UAAU,GAAG,oBAAC,eAAe,EAAE,KAAK,EAAK;AACrC,QAAI,OAAO,YAAA,CAAC;;AAEZ,WAAO,GAAG,mBAAM,eAAe,EAAE,UAAC,IAAI,EAAK;AACvC,eAAO,sBAAS,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;KACrC,CAAC,CAAC;;AAEH,WAAO,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;;AAEnC,WAAO,KAAK,CAAC,IAAI,GAAG,OAAO,GAAG,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC;CACpD;;;;;;;;;;;;;;;AAAC,AAeF,QAuDI,aAAa,GAvDjB,aAAa,GAAG,uBAAC,eAAe,EAAE,KAAK,EAAK;AACxC,WAAO,UAAU,CAAC,eAAe,EAAE;AAC/B,YAAI,EAAE,KAAK,CAAC,OAAO;AACnB,aAAK,EAAE,KAAK,CAAC,QAAQ;AACrB,YAAI,EAAE,KAAK,CAAC,OAAO;AACnB,YAAI,EAAE,KAAK,CAAC,OAAO;KACtB,CAAC,CAAC;CACN;;;;;;;;;;;;;;;AAAC,AAeF,QAkCI,cAAc,GAlClB,cAAc,GAAG,wBAAC,eAAe,EAAE,KAAK,EAAK;AACzC,WAAO,UAAU,CAAC,eAAe,EAAE;AAC/B,YAAI,EAAE,KAAK,CAAC,QAAQ;AACpB,aAAK,EAAE,KAAK,CAAC,SAAS;AACtB,YAAI,EAAE,KAAK,CAAC,QAAQ;AACpB,YAAI,EAAE,KAAK,CAAC,QAAQ;KACvB,CAAC,CAAC;CACN;;;;;;;;;;;;;;;AAAC,AAeF,QAaI,gBAAgB,GAbpB,gBAAgB,GAAG,0BAAC,eAAe,EAAE,KAAK,EAAK;AAC3C,WAAO,UAAU,CAAC,eAAe,EAAE;AAC/B,YAAI,EAAE,KAAK,CAAC,UAAU;AACtB,aAAK,EAAE,KAAK,CAAC,WAAW;AACxB,YAAI,EAAE,KAAK,CAAC,UAAU;AACtB,YAAI,EAAE,KAAK,CAAC,UAAU;KACzB,CAAC,CAAC;CACN,CAAC;;QAGE,UAAU,GAAV,UAAU;QACV,aAAa,GAAb,aAAa;QACb,cAAc,GAAd,cAAc;QACd,gBAAgB,GAAhB,gBAAgB","file":"drawBorder.js","sourcesContent":["import _ from 'lodash';\n\nlet drawBorder,\n drawBorderBottom,\n drawBorderJoin,\n drawBorderTop;\n\n/**\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 */\ndrawBorder = (columnSizeIndex, parts) => {\n let columns;\n\n columns = _.map(columnSizeIndex, (size) => {\n return _.repeat(parts.body, size);\n });\n\n columns = columns.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 * @return {string}\n */\ndrawBorderTop = (columnSizeIndex, parts) => {\n return drawBorder(columnSizeIndex, {\n left: parts.topLeft,\n right: parts.topRight,\n body: parts.topBody,\n join: parts.topJoin\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 */\ndrawBorderJoin = (columnSizeIndex, parts) => {\n return drawBorder(columnSizeIndex, {\n left: parts.joinLeft,\n right: parts.joinRight,\n body: parts.joinBody,\n join: parts.joinJoin\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 */\ndrawBorderBottom = (columnSizeIndex, parts) => {\n return drawBorder(columnSizeIndex, {\n left: parts.bottomLeft,\n right: parts.bottomRight,\n body: parts.bottomBody,\n join: parts.bottomJoin\n });\n};\n\nexport {\n drawBorder,\n drawBorderTop,\n drawBorderJoin,\n drawBorderBottom\n};\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/tools/eslint/node_modules/table/dist/drawRow.js b/tools/eslint/node_modules/table/dist/drawRow.js new file mode 100644 index 00000000000000..b4036f507b212b --- /dev/null +++ b/tools/eslint/node_modules/table/dist/drawRow.js @@ -0,0 +1,24 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/** + * @typedef {Object} drawRow~border + * @property {string} bodyLeft + * @property {string} bodyRight + * @property {string} bodyJoin + */ + +/** + * @param {number[]} columns + * @param {drawRow~border} border + * @return {string} + */ + +exports.default = function (columns, border) { + return border.bodyLeft + columns.join(border.bodyJoin) + border.bodyRight + '\n'; +}; + +module.exports = exports['default']; +//# sourceMappingURL=drawRow.js.map diff --git a/tools/eslint/node_modules/table/dist/drawRow.js.map b/tools/eslint/node_modules/table/dist/drawRow.js.map new file mode 100644 index 00000000000000..d3a5464c23156e --- /dev/null +++ b/tools/eslint/node_modules/table/dist/drawRow.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["drawRow.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;kBAYe,UAAC,OAAO,EAAE,MAAM,EAAK;AAChC,SAAO,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;CACpF","file":"drawRow.js","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 * @return {string}\n */\nexport default (columns, border) => {\n return border.bodyLeft + columns.join(border.bodyJoin) + border.bodyRight + '\\n';\n};\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/tools/eslint/node_modules/table/dist/drawTable.js b/tools/eslint/node_modules/table/dist/drawTable.js new file mode 100644 index 00000000000000..242095042db0f1 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/drawTable.js @@ -0,0 +1,68 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _forEach2 = require('lodash/forEach'); + +var _forEach3 = _interopRequireDefault(_forEach2); + +var _drawBorder = require('./drawBorder'); + +var _drawRow = require('./drawRow'); + +var _drawRow2 = _interopRequireDefault(_drawRow); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @param {Array} rows + * @param {Object} border + * @param {Array} columnSizeIndex + * @param {Array} rowSpanIndex + * @param {Function} drawHorizontalLine + * @returns {string} + */ + +exports.default = function (rows, border, columnSizeIndex, rowSpanIndex, drawHorizontalLine) { + var output = undefined, + realRowIndex = undefined, + rowCount = undefined, + rowHeight = undefined; + + rowCount = rows.length; + + realRowIndex = 0; + + output = ''; + + if (drawHorizontalLine(realRowIndex, rowCount)) { + output += (0, _drawBorder.drawBorderTop)(columnSizeIndex, border); + } + + (0, _forEach3.default)(rows, function (row, index0) { + output += (0, _drawRow2.default)(row, border); + + if (!rowHeight) { + rowHeight = rowSpanIndex[realRowIndex]; + + realRowIndex++; + } + + rowHeight--; + + if (rowHeight === 0 && index0 !== rowCount - 1 && drawHorizontalLine(realRowIndex, rowCount)) { + output += (0, _drawBorder.drawBorderJoin)(columnSizeIndex, border); + } + }); + + if (drawHorizontalLine(realRowIndex, rowCount)) { + output += (0, _drawBorder.drawBorderBottom)(columnSizeIndex, border); + } + + return output; +}; + +module.exports = exports['default']; +//# sourceMappingURL=drawTable.js.map diff --git a/tools/eslint/node_modules/table/dist/drawTable.js.map b/tools/eslint/node_modules/table/dist/drawTable.js.map new file mode 100644 index 00000000000000..705e822dc06abb --- /dev/null +++ b/tools/eslint/node_modules/table/dist/drawTable.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["drawTable.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgBe,UAAC,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,kBAAkB,EAAK;AAChF,QAAI,MAAM,YAAA;QACN,YAAY,YAAA;QACZ,QAAQ,YAAA;QACR,SAAS,YAAA,CAAC;;AAEd,YAAQ,GAAG,IAAI,CAAC,MAAM,CAAC;;AAEvB,gBAAY,GAAG,CAAC,CAAC;;AAEjB,UAAM,GAAG,EAAE,CAAC;;AAEZ,QAAI,kBAAkB,CAAC,YAAY,EAAE,QAAQ,CAAC,EAAE;AAC5C,cAAM,IAAI,gBA3Bd,aAAa,EA2Be,eAAe,EAAE,MAAM,CAAC,CAAC;KACpD;;AAED,2BAAU,IAAI,EAAE,UAAC,GAAG,EAAE,MAAM,EAAK;AAC7B,cAAM,IAAI,uBAAQ,GAAG,EAAE,MAAM,CAAC,CAAC;;AAE/B,YAAI,CAAC,SAAS,EAAE;AACZ,qBAAS,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;;AAEvC,wBAAY,EAAE,CAAC;SAClB;;AAED,iBAAS,EAAE,CAAC;;AAEZ,YAAI,SAAS,KAAK,CAAC,IAAI,MAAM,KAAK,QAAQ,GAAG,CAAC,IAAI,kBAAkB,CAAC,YAAY,EAAE,QAAQ,CAAC,EAAE;AAC1F,kBAAM,IAAI,gBAzClB,cAAc,EAyCmB,eAAe,EAAE,MAAM,CAAC,CAAC;SACrD;KACJ,CAAC,CAAC;;AAEH,QAAI,kBAAkB,CAAC,YAAY,EAAE,QAAQ,CAAC,EAAE;AAC5C,cAAM,IAAI,gBA7Cd,gBAAgB,EA6Ce,eAAe,EAAE,MAAM,CAAC,CAAC;KACvD;;AAED,WAAO,MAAM,CAAC;CACjB","file":"drawTable.js","sourcesContent":["import _ from 'lodash';\nimport {\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 realRowIndex,\n rowCount,\n rowHeight;\n\n rowCount = rows.length;\n\n realRowIndex = 0;\n\n output = '';\n\n if (drawHorizontalLine(realRowIndex, rowCount)) {\n output += drawBorderTop(columnSizeIndex, border);\n }\n\n _.forEach(rows, (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"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/tools/eslint/node_modules/table/dist/getBorderCharacters.js b/tools/eslint/node_modules/table/dist/getBorderCharacters.js new file mode 100644 index 00000000000000..0fc3f7eeb6828e --- /dev/null +++ b/tools/eslint/node_modules/table/dist/getBorderCharacters.js @@ -0,0 +1,129 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/* eslint-disable sorting/sort-object-props */ + +/** + * @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} + */ + +exports.default = function (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}".'); +}; + +module.exports = exports['default']; +//# sourceMappingURL=getBorderCharacters.js.map diff --git a/tools/eslint/node_modules/table/dist/getBorderCharacters.js.map b/tools/eslint/node_modules/table/dist/getBorderCharacters.js.map new file mode 100644 index 00000000000000..3f0ae7cbef0d4a --- /dev/null +++ b/tools/eslint/node_modules/table/dist/getBorderCharacters.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["getBorderCharacters.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAyBe,UAAC,IAAI,EAAK;AACrB,QAAI,IAAI,KAAK,WAAW,EAAE;AACtB,eAAO;AACH,mBAAO,EAAE,GAAG;AACZ,mBAAO,EAAE,GAAG;AACZ,mBAAO,EAAE,GAAG;AACZ,oBAAQ,EAAE,GAAG;;AAEb,sBAAU,EAAE,GAAG;AACf,sBAAU,EAAE,GAAG;AACf,sBAAU,EAAE,GAAG;AACf,uBAAW,EAAE,GAAG;;AAEhB,oBAAQ,EAAE,GAAG;AACb,qBAAS,EAAE,GAAG;AACd,oBAAQ,EAAE,GAAG;;AAEb,oBAAQ,EAAE,GAAG;AACb,oBAAQ,EAAE,GAAG;AACb,qBAAS,EAAE,GAAG;AACd,oBAAQ,EAAE,GAAG;SAChB,CAAC;KACL;;AAED,QAAI,IAAI,KAAK,MAAM,EAAE;AACjB,eAAO;AACH,mBAAO,EAAE,GAAG;AACZ,mBAAO,EAAE,GAAG;AACZ,mBAAO,EAAE,GAAG;AACZ,oBAAQ,EAAE,GAAG;;AAEb,sBAAU,EAAE,GAAG;AACf,sBAAU,EAAE,GAAG;AACf,sBAAU,EAAE,GAAG;AACf,uBAAW,EAAE,GAAG;;AAEhB,oBAAQ,EAAE,GAAG;AACb,qBAAS,EAAE,GAAG;AACd,oBAAQ,EAAE,GAAG;;AAEb,oBAAQ,EAAE,GAAG;AACb,oBAAQ,EAAE,GAAG;AACb,qBAAS,EAAE,GAAG;AACd,oBAAQ,EAAE,GAAG;SAChB,CAAC;KACL;;AAED,QAAI,IAAI,KAAK,OAAO,EAAE;AAClB,eAAO;AACH,mBAAO,EAAE,GAAG;AACZ,mBAAO,EAAE,GAAG;AACZ,mBAAO,EAAE,GAAG;AACZ,oBAAQ,EAAE,GAAG;;AAEb,sBAAU,EAAE,GAAG;AACf,sBAAU,EAAE,GAAG;AACf,sBAAU,EAAE,GAAG;AACf,uBAAW,EAAE,GAAG;;AAEhB,oBAAQ,EAAE,GAAG;AACb,qBAAS,EAAE,GAAG;AACd,oBAAQ,EAAE,GAAG;;AAEb,oBAAQ,EAAE,GAAG;AACb,oBAAQ,EAAE,GAAG;AACb,qBAAS,EAAE,GAAG;AACd,oBAAQ,EAAE,GAAG;SAChB,CAAC;KACL;;AAED,QAAI,IAAI,KAAK,MAAM,EAAE;AACjB,eAAO;AACH,mBAAO,EAAE,EAAE;AACX,mBAAO,EAAE,EAAE;AACX,mBAAO,EAAE,EAAE;AACX,oBAAQ,EAAE,EAAE;;AAEZ,sBAAU,EAAE,EAAE;AACd,sBAAU,EAAE,EAAE;AACd,sBAAU,EAAE,EAAE;AACd,uBAAW,EAAE,EAAE;;AAEf,oBAAQ,EAAE,EAAE;AACZ,qBAAS,EAAE,EAAE;AACb,oBAAQ,EAAE,EAAE;;AAEZ,oBAAQ,EAAE,EAAE;AACZ,oBAAQ,EAAE,EAAE;AACZ,qBAAS,EAAE,EAAE;AACb,oBAAQ,EAAE,EAAE;SACf,CAAC;KACL;;AAED,UAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;CACzD","file":"getBorderCharacters.js","sourcesContent":["/* eslint-disable sorting/sort-object-props */\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"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/tools/eslint/node_modules/table/dist/index.js b/tools/eslint/node_modules/table/dist/index.js new file mode 100644 index 00000000000000..b3462ea1a63389 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/index.js @@ -0,0 +1,25 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getBorderCharacters = exports.createStream = undefined; + +var _table = require('./table'); + +var _table2 = _interopRequireDefault(_table); + +var _createStream = require('./createStream'); + +var _createStream2 = _interopRequireDefault(_createStream); + +var _getBorderCharacters = require('./getBorderCharacters'); + +var _getBorderCharacters2 = _interopRequireDefault(_getBorderCharacters); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.createStream = _createStream2.default; +exports.getBorderCharacters = _getBorderCharacters2.default; +exports.default = _table2.default; +//# sourceMappingURL=index.js.map diff --git a/tools/eslint/node_modules/table/dist/index.js.map b/tools/eslint/node_modules/table/dist/index.js.map new file mode 100644 index 00000000000000..9e3155e257be80 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;QAKI,YAAY;QACZ,mBAAmB","file":"index.js","sourcesContent":["import table from './table';\nimport createStream from './createStream';\nimport getBorderCharacters from './getBorderCharacters';\n\nexport {\n createStream,\n getBorderCharacters\n};\n\nexport default table;\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/tools/eslint/node_modules/table/dist/makeConfig.js b/tools/eslint/node_modules/table/dist/makeConfig.js new file mode 100644 index 00000000000000..1c9b9ba5440925 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/makeConfig.js @@ -0,0 +1,121 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _cloneDeep2 = require('lodash/cloneDeep'); + +var _cloneDeep3 = _interopRequireDefault(_cloneDeep2); + +var _isUndefined2 = require('lodash/isUndefined'); + +var _isUndefined3 = _interopRequireDefault(_isUndefined2); + +var _times2 = require('lodash/times'); + +var _times3 = _interopRequireDefault(_times2); + +var _assign2 = require('lodash/assign'); + +var _assign3 = _interopRequireDefault(_assign2); + +var _getBorderCharacters = require('./getBorderCharacters'); + +var _getBorderCharacters2 = _interopRequireDefault(_getBorderCharacters); + +var _validateConfig = require('./validateConfig'); + +var _validateConfig2 = _interopRequireDefault(_validateConfig); + +var _calculateMaximumColumnWidthIndex = require('./calculateMaximumColumnWidthIndex'); + +var _calculateMaximumColumnWidthIndex2 = _interopRequireDefault(_calculateMaximumColumnWidthIndex); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var makeBorder = undefined, + makeColumns = undefined; + +/** + * Merges user provided border characters with the default border ("honeywell") characters. + * + * @param {Object} border + * @returns {Object} + */ +makeBorder = function makeBorder() { + var border = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + + return (0, _assign3.default)({}, (0, _getBorderCharacters2.default)('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} + */ +makeColumns = function makeColumns(rows) { + var columns = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + var columnDefault = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; + + var maximumColumnWidthIndex = undefined; + + maximumColumnWidthIndex = (0, _calculateMaximumColumnWidthIndex2.default)(rows); + + (0, _times3.default)(rows[0].length, function (index) { + if ((0, _isUndefined3.default)(columns[index])) { + columns[index] = {}; + } + + columns[index] = (0, _assign3.default)({ + alignment: 'left', + width: maximumColumnWidthIndex[index], + wrapWord: false, + truncate: Infinity, + paddingLeft: 1, + paddingRight: 1 + }, 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} + */ + +exports.default = function (rows) { + var userConfig = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + var config = undefined; + + (0, _validateConfig2.default)(userConfig); + + config = (0, _cloneDeep3.default)(userConfig); + + config.border = makeBorder(config.border); + config.columns = makeColumns(rows, config.columns, config.columnDefault); + + if (!config.drawHorizontalLine) { + /** + * @returns {boolean} + */ + config.drawHorizontalLine = function () { + return true; + }; + } + + return config; +}; + +module.exports = exports['default']; +//# sourceMappingURL=makeConfig.js.map diff --git a/tools/eslint/node_modules/table/dist/makeConfig.js.map b/tools/eslint/node_modules/table/dist/makeConfig.js.map new file mode 100644 index 00000000000000..f64b0085401ed8 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/makeConfig.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["makeConfig.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAI,UAAU,YAAA;IACV,WAAW,YAAA;;;;;;;;AAAC,AAQhB,UAAU,GAAG,sBAAiB;QAAhB,MAAM,yDAAG,EAAE;;AACrB,WAAO,sBAAS,EAAE,EAAE,mCAAoB,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC;CACjE;;;;;;;;;;;AAAC,AAWF,WAAW,GAAG,qBAAC,IAAI,EAAuC;QAArC,OAAO,yDAAG,EAAE;QAAE,aAAa,yDAAG,EAAE;;AACjD,QAAI,uBAAuB,YAAA,CAAC;;AAE5B,2BAAuB,GAAG,gDAAiC,IAAI,CAAC,CAAC;;AAEjE,yBAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,UAAC,KAAK,EAAK;AAC/B,YAAI,2BAAc,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE;AAC/B,mBAAO,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;SACvB;;AAED,eAAO,CAAC,KAAK,CAAC,GAAG,sBAAS;AACtB,qBAAS,EAAE,MAAM;AACjB,iBAAK,EAAE,uBAAuB,CAAC,KAAK,CAAC;AACrC,oBAAQ,EAAE,KAAK;AACf,oBAAQ,EAAE,QAAQ;AAClB,uBAAW,EAAE,CAAC;AACd,wBAAY,EAAE,CAAC;SAClB,EAAE,aAAa,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;KACrC,CAAC,CAAC;;AAEH,WAAO,OAAO,CAAC;CAClB;;;;;;;;;;AAAC;kBAUa,UAAC,IAAI,EAAsB;QAApB,UAAU,yDAAG,EAAE;;AACjC,QAAI,MAAM,YAAA,CAAC;;AAEX,kCAAe,UAAU,CAAC,CAAC;;AAE3B,UAAM,GAAG,yBAAY,UAAU,CAAC,CAAC;;AAEjC,UAAM,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC1C,UAAM,CAAC,OAAO,GAAG,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;;AAEzE,QAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE;;;;AAI5B,cAAM,CAAC,kBAAkB,GAAG,YAAM;AAC9B,mBAAO,IAAI,CAAC;SACf,CAAC;KACL;;AAED,WAAO,MAAM,CAAC;CACjB","file":"makeConfig.js","sourcesContent":["import _ from 'lodash';\nimport getBorderCharacters from './getBorderCharacters';\nimport validateConfig from './validateConfig';\nimport calculateMaximumColumnWidthIndex from './calculateMaximumColumnWidthIndex';\n\nlet makeBorder,\n makeColumns;\n\n/**\n * Merges user provided border characters with the default border (\"honeywell\") characters.\n *\n * @param {Object} border\n * @returns {Object}\n */\nmakeBorder = (border = {}) => {\n return _.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 */\nmakeColumns = (rows, columns = {}, columnDefault = {}) => {\n let maximumColumnWidthIndex;\n\n maximumColumnWidthIndex = calculateMaximumColumnWidthIndex(rows);\n\n _.times(rows[0].length, (index) => {\n if (_.isUndefined(columns[index])) {\n columns[index] = {};\n }\n\n columns[index] = _.assign({\n alignment: 'left',\n width: maximumColumnWidthIndex[index],\n wrapWord: false,\n truncate: Infinity,\n paddingLeft: 1,\n paddingRight: 1\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 let config;\n\n validateConfig(userConfig);\n\n 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"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/tools/eslint/node_modules/table/dist/makeStreamConfig.js b/tools/eslint/node_modules/table/dist/makeStreamConfig.js new file mode 100644 index 00000000000000..49692a32850cbe --- /dev/null +++ b/tools/eslint/node_modules/table/dist/makeStreamConfig.js @@ -0,0 +1,128 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _cloneDeep2 = require('lodash/cloneDeep'); + +var _cloneDeep3 = _interopRequireDefault(_cloneDeep2); + +var _isUndefined2 = require('lodash/isUndefined'); + +var _isUndefined3 = _interopRequireDefault(_isUndefined2); + +var _times2 = require('lodash/times'); + +var _times3 = _interopRequireDefault(_times2); + +var _assign2 = require('lodash/assign'); + +var _assign3 = _interopRequireDefault(_assign2); + +var _getBorderCharacters = require('./getBorderCharacters'); + +var _getBorderCharacters2 = _interopRequireDefault(_getBorderCharacters); + +var _validateStreamConfig = require('./validateStreamConfig'); + +var _validateStreamConfig2 = _interopRequireDefault(_validateStreamConfig); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var makeBorder = undefined, + makeColumns = undefined; + +/** + * Merges user provided border characters with the default border ("honeywell") characters. + * + * @param {Object} border + * @returns {Object} + */ +makeBorder = function makeBorder() { + var border = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + + return (0, _assign3.default)({}, (0, _getBorderCharacters2.default)('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} + */ +makeColumns = function makeColumns(columnCount) { + var columns = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + var columnDefault = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; + + (0, _times3.default)(columnCount, function (index) { + if ((0, _isUndefined3.default)(columns[index])) { + columns[index] = {}; + } + + columns[index] = (0, _assign3.default)({ + alignment: 'left', + // width: columnDefault.width, + wrapWord: false, + truncate: Infinity, + paddingLeft: 1, + paddingRight: 1 + }, 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} + */ + +exports.default = function () { + var userConfig = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + + var config = undefined; + + (0, _validateStreamConfig2.default)(userConfig); + + config = (0, _cloneDeep3.default)(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; +}; + +module.exports = exports['default']; +//# sourceMappingURL=makeStreamConfig.js.map diff --git a/tools/eslint/node_modules/table/dist/makeStreamConfig.js.map b/tools/eslint/node_modules/table/dist/makeStreamConfig.js.map new file mode 100644 index 00000000000000..4ab4ef8c844339 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/makeStreamConfig.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["makeStreamConfig.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAI,UAAU,YAAA;IACV,WAAW,YAAA;;;;;;;;AAAC,AAQhB,UAAU,GAAG,sBAAiB;QAAhB,MAAM,yDAAG,EAAE;;AACrB,WAAO,sBAAS,EAAE,EAAE,mCAAoB,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC;CACjE;;;;;;;;;;;AAAC,AAWF,WAAW,GAAG,qBAAC,WAAW,EAAuC;QAArC,OAAO,yDAAG,EAAE;QAAE,aAAa,yDAAG,EAAE;;AACxD,yBAAQ,WAAW,EAAE,UAAC,KAAK,EAAK;AAC5B,YAAI,2BAAc,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE;AAC/B,mBAAO,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;SACvB;;AAED,eAAO,CAAC,KAAK,CAAC,GAAG,sBAAS;AACtB,qBAAS,EAAE,MAAM;;AAEjB,oBAAQ,EAAE,KAAK;AACf,oBAAQ,EAAE,QAAQ;AAClB,uBAAW,EAAE,CAAC;AACd,wBAAY,EAAE,CAAC;SAClB,EAAE,aAAa,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;KACrC,CAAC,CAAC;;AAEH,WAAO,OAAO,CAAC;CAClB;;;;;;;;;;;;;;;;;;;;;;;;;;AAAC;kBA0Ba,YAAqB;QAApB,UAAU,yDAAG,EAAE;;AAC3B,QAAI,MAAM,YAAA,CAAC;;AAEX,wCAAqB,UAAU,CAAC,CAAC;;AAEjC,UAAM,GAAG,yBAAY,UAAU,CAAC,CAAC;;AAEjC,QAAI,CAAC,MAAM,CAAC,aAAa,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE;AACtD,cAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAC;KACtF;;AAED,QAAI,CAAC,MAAM,CAAC,WAAW,EAAE;AACrB,cAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;KACvD;;AAED,UAAM,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC1C,UAAM,CAAC,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;;AAEvF,WAAO,MAAM,CAAC;CACjB","file":"makeStreamConfig.js","sourcesContent":["import _ from 'lodash';\nimport getBorderCharacters from './getBorderCharacters';\nimport validateStreamConfig from './validateStreamConfig';\n\nlet makeBorder,\n makeColumns;\n\n/**\n * Merges user provided border characters with the default border (\"honeywell\") characters.\n *\n * @param {Object} border\n * @returns {Object}\n */\nmakeBorder = (border = {}) => {\n return _.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 */\nmakeColumns = (columnCount, columns = {}, columnDefault = {}) => {\n _.times(columnCount, (index) => {\n if (_.isUndefined(columns[index])) {\n columns[index] = {};\n }\n\n columns[index] = _.assign({\n alignment: 'left',\n // width: columnDefault.width,\n wrapWord: false,\n truncate: Infinity,\n paddingLeft: 1,\n paddingRight: 1\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 let config;\n\n validateStreamConfig(userConfig);\n\n 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"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/tools/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js b/tools/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js new file mode 100644 index 00000000000000..f260ca664b2468 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js @@ -0,0 +1,86 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _flatten2 = require('lodash/flatten'); + +var _flatten3 = _interopRequireDefault(_flatten2); + +var _forEach2 = require('lodash/forEach'); + +var _forEach3 = _interopRequireDefault(_forEach2); + +var _fill2 = require('lodash/fill'); + +var _fill3 = _interopRequireDefault(_fill2); + +var _map2 = require('lodash/map'); + +var _map3 = _interopRequireDefault(_map2); + +var _wrapString = require('./wrapString'); + +var _wrapString2 = _interopRequireDefault(_wrapString); + +var _wrapWord = require('./wrapWord'); + +var _wrapWord2 = _interopRequireDefault(_wrapWord); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @param {Array} unmappedRows + * @param {number[]} rowHeightIndex + * @param {Object} config + * @return {Array} + */ + +exports.default = function (unmappedRows, rowHeightIndex, config) { + var mappedRows = undefined, + tableWidth = undefined; + + tableWidth = unmappedRows[0].length; + + // console.log('unmappedRows', unmappedRows, 'rowHeightIndex', rowHeightIndex, 'config', config, 'tableWidth', tableWidth); + + mappedRows = (0, _map3.default)(unmappedRows, function (cells, index0) { + var rowHeight = undefined; + + rowHeight = (0, _map3.default)(Array(rowHeightIndex[index0]), function () { + return (0, _fill3.default)(Array(tableWidth), ''); + }); + + // console.log('rowHeight', rowHeight); + + // rowHeight + // [{row index within rowSaw; index2}] + // [{cell index within a virtual row; index1}] + + (0, _forEach3.default)(cells, function (value, index1) { + var chunkedValue = undefined; + + if (config.columns[index1].wrapWord) { + chunkedValue = (0, _wrapWord2.default)(value, config.columns[index1].width); + } else { + chunkedValue = (0, _wrapString2.default)(value, config.columns[index1].width); + } + + // console.log('chunkedValue', chunkedValue.length, 'rowHeight', rowHeight.length); + + (0, _forEach3.default)(chunkedValue, function (part, index2) { + // console.log(rowHeight[index2]); + + rowHeight[index2][index1] = part; + }); + }); + + return rowHeight; + }); + + return (0, _flatten3.default)(mappedRows); +}; + +module.exports = exports['default']; +//# sourceMappingURL=mapDataUsingRowHeightIndex.js.map diff --git a/tools/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js.map b/tools/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js.map new file mode 100644 index 00000000000000..68b34b66641f01 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/mapDataUsingRowHeightIndex.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["mapDataUsingRowHeightIndex.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAUe,UAAC,YAAY,EAAE,cAAc,EAAE,MAAM,EAAK;AACrD,QAAI,UAAU,YAAA;QACV,UAAU,YAAA,CAAC;;AAEf,cAAU,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,MAAM;;;;AAAC,AAIpC,cAAU,GAAG,mBAAM,YAAY,EAAE,UAAC,KAAK,EAAE,MAAM,EAAK;AAChD,YAAI,SAAS,YAAA,CAAC;;AAEd,iBAAS,GAAG,mBAAM,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,YAAM;AACnD,mBAAO,oBAAO,KAAK,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC,CAAC;SACxC,CAAC;;;;;;;;AAAC,AAQH,+BAAU,KAAK,EAAE,UAAC,KAAK,EAAE,MAAM,EAAK;AAChC,gBAAI,YAAY,YAAA,CAAC;;AAEjB,gBAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;AACjC,4BAAY,GAAG,wBAAS,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC;aAChE,MAAM;AACH,4BAAY,GAAG,0BAAW,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC;aAClE;;;;AAAA,AAID,mCAAU,YAAY,EAAE,UAAC,IAAI,EAAE,MAAM,EAAK;;;AAGtC,yBAAS,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;aACpC,CAAC,CAAC;SACN,CAAC,CAAC;;AAEH,eAAO,SAAS,CAAC;KACpB,CAAC,CAAC;;AAEH,WAAO,uBAAU,UAAU,CAAC,CAAC;CAChC","file":"mapDataUsingRowHeightIndex.js","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 * @return {Array}\n */\nexport default (unmappedRows, rowHeightIndex, config) => {\n let mappedRows,\n tableWidth;\n\n tableWidth = unmappedRows[0].length;\n\n // console.log('unmappedRows', unmappedRows, 'rowHeightIndex', rowHeightIndex, 'config', config, 'tableWidth', tableWidth);\n\n mappedRows = _.map(unmappedRows, (cells, index0) => {\n let rowHeight;\n\n rowHeight = _.map(Array(rowHeightIndex[index0]), () => {\n return _.fill(Array(tableWidth), '');\n });\n\n // console.log('rowHeight', rowHeight);\n\n // rowHeight\n // [{row index within rowSaw; index2}]\n // [{cell index within a virtual row; index1}]\n\n _.forEach(cells, (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 // console.log('chunkedValue', chunkedValue.length, 'rowHeight', rowHeight.length);\n\n _.forEach(chunkedValue, (part, index2) => {\n // console.log(rowHeight[index2]);\n\n rowHeight[index2][index1] = part;\n });\n });\n\n return rowHeight;\n });\n\n return _.flatten(mappedRows);\n};\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/tools/eslint/node_modules/table/dist/padTableData.js b/tools/eslint/node_modules/table/dist/padTableData.js new file mode 100644 index 00000000000000..f96dc04b2d9fbe --- /dev/null +++ b/tools/eslint/node_modules/table/dist/padTableData.js @@ -0,0 +1,36 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _repeat2 = require('lodash/repeat'); + +var _repeat3 = _interopRequireDefault(_repeat2); + +var _map2 = require('lodash/map'); + +var _map3 = _interopRequireDefault(_map2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @param {table~row[]} rows + * @param {Object} config + * @return {table~row[]} + */ + +exports.default = function (rows, config) { + return (0, _map3.default)(rows, function (cells) { + return (0, _map3.default)(cells, function (value, index1) { + var column = undefined; + + column = config.columns[index1]; + + return (0, _repeat3.default)(' ', column.paddingLeft) + value + (0, _repeat3.default)(' ', column.paddingRight); + }); + }); +}; + +module.exports = exports['default']; +//# sourceMappingURL=padTableData.js.map diff --git a/tools/eslint/node_modules/table/dist/padTableData.js.map b/tools/eslint/node_modules/table/dist/padTableData.js.map new file mode 100644 index 00000000000000..6d456f14e75d3e --- /dev/null +++ b/tools/eslint/node_modules/table/dist/padTableData.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["padTableData.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;kBAOe,UAAC,IAAI,EAAE,MAAM,EAAK;AAC7B,WAAO,mBAAM,IAAI,EAAE,UAAC,KAAK,EAAK;AAC1B,eAAO,mBAAM,KAAK,EAAE,UAAC,KAAK,EAAE,MAAM,EAAK;AACnC,gBAAI,MAAM,YAAA,CAAC;;AAEX,kBAAM,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;;AAEhC,mBAAO,sBAAS,GAAG,EAAE,MAAM,CAAC,WAAW,CAAC,GAAG,KAAK,GAAG,sBAAS,GAAG,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;SACzF,CAAC,CAAC;KACN,CAAC,CAAC;CACN","file":"padTableData.js","sourcesContent":["import _ from 'lodash';\n\n/**\n * @param {table~row[]} rows\n * @param {Object} config\n * @return {table~row[]}\n */\nexport default (rows, config) => {\n return _.map(rows, (cells) => {\n return _.map(cells, (value, index1) => {\n let column;\n\n column = config.columns[index1];\n\n return _.repeat(' ', column.paddingLeft) + value + _.repeat(' ', column.paddingRight);\n });\n });\n};\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/tools/eslint/node_modules/table/dist/schemas/config.json b/tools/eslint/node_modules/table/dist/schemas/config.json new file mode 100644 index 00000000000000..7ee700c5c1c47e --- /dev/null +++ b/tools/eslint/node_modules/table/dist/schemas/config.json @@ -0,0 +1,112 @@ +{ + "type": "object", + "properties": { + "border": { + "$ref": "#/definitions/borders" + }, + "columns": { + "$ref": "#/definitions/columns" + }, + "columnDefault": { + "$ref": "#/definitions/column" + }, + "drawHorizontalLine": { + "type": "function" + } + }, + "additionalProperties": false, + "definitions": { + "columns": { + "type": "object", + "patternProperties": { + "^[0-9]+$": { + "$ref": "#/definitions/column" + } + }, + "additionalProperties": false + }, + "column": { + "type": "object", + "properties": { + "alignment": { + "type": "string", + "enum": [ + "left", + "right", + "center" + ] + }, + "width": { + "type": "number" + }, + "wrapWord": { + "type": "boolean" + }, + "truncate": { + "type": "number" + }, + "paddingLeft": { + "type": "number" + }, + "paddingRight": { + "type": "number" + } + }, + "additionalProperties": false + }, + "borders": { + "type": "object", + "properties": { + "topBody": { + "$ref": "#/definitions/border" + }, + "topJoin": { + "$ref": "#/definitions/border" + }, + "topLeft": { + "$ref": "#/definitions/border" + }, + "topRight": { + "$ref": "#/definitions/border" + }, + "bottomBody": { + "$ref": "#/definitions/border" + }, + "bottomJoin": { + "$ref": "#/definitions/border" + }, + "bottomLeft": { + "$ref": "#/definitions/border" + }, + "bottomRight": { + "$ref": "#/definitions/border" + }, + "bodyLeft": { + "$ref": "#/definitions/border" + }, + "bodyRight": { + "$ref": "#/definitions/border" + }, + "bodyJoin": { + "$ref": "#/definitions/border" + }, + "joinBody": { + "$ref": "#/definitions/border" + }, + "joinLeft": { + "$ref": "#/definitions/border" + }, + "joinRight": { + "$ref": "#/definitions/border" + }, + "joinJoin": { + "$ref": "#/definitions/border" + } + }, + "additionalProperties": false + }, + "border": { + "type": "string" + } + } +} diff --git a/tools/eslint/node_modules/table/dist/schemas/streamConfig.json b/tools/eslint/node_modules/table/dist/schemas/streamConfig.json new file mode 100644 index 00000000000000..5c4e1330dc9e41 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/schemas/streamConfig.json @@ -0,0 +1,112 @@ +{ + "type": "object", + "properties": { + "border": { + "$ref": "#/definitions/borders" + }, + "columns": { + "$ref": "#/definitions/columns" + }, + "columnDefault": { + "$ref": "#/definitions/column" + }, + "columnCount": { + "type": "number" + } + }, + "additionalProperties": false, + "definitions": { + "columns": { + "type": "object", + "patternProperties": { + "^[0-9]+$": { + "$ref": "#/definitions/column" + } + }, + "additionalProperties": false + }, + "column": { + "type": "object", + "properties": { + "alignment": { + "type": "string", + "enum": [ + "left", + "right", + "center" + ] + }, + "width": { + "type": "number" + }, + "wrapWord": { + "type": "boolean" + }, + "truncate": { + "type": "number" + }, + "paddingLeft": { + "type": "number" + }, + "paddingRight": { + "type": "number" + } + }, + "additionalProperties": false + }, + "borders": { + "type": "object", + "properties": { + "topBody": { + "$ref": "#/definitions/border" + }, + "topJoin": { + "$ref": "#/definitions/border" + }, + "topLeft": { + "$ref": "#/definitions/border" + }, + "topRight": { + "$ref": "#/definitions/border" + }, + "bottomBody": { + "$ref": "#/definitions/border" + }, + "bottomJoin": { + "$ref": "#/definitions/border" + }, + "bottomLeft": { + "$ref": "#/definitions/border" + }, + "bottomRight": { + "$ref": "#/definitions/border" + }, + "bodyLeft": { + "$ref": "#/definitions/border" + }, + "bodyRight": { + "$ref": "#/definitions/border" + }, + "bodyJoin": { + "$ref": "#/definitions/border" + }, + "joinBody": { + "$ref": "#/definitions/border" + }, + "joinLeft": { + "$ref": "#/definitions/border" + }, + "joinRight": { + "$ref": "#/definitions/border" + }, + "joinJoin": { + "$ref": "#/definitions/border" + } + }, + "additionalProperties": false + }, + "border": { + "type": "string" + } + } +} diff --git a/tools/eslint/node_modules/table/dist/stringifyTableData.js b/tools/eslint/node_modules/table/dist/stringifyTableData.js new file mode 100644 index 00000000000000..c1a2cf8afbc284 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/stringifyTableData.js @@ -0,0 +1,27 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _map2 = require('lodash/map'); + +var _map3 = _interopRequireDefault(_map2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Casts all cell values to a string. + * + * @param {table~row[]} rows + * @return {table~row[]} + */ + +exports.default = function (rows) { + return (0, _map3.default)(rows, function (cells) { + return (0, _map3.default)(cells, String); + }); +}; + +module.exports = exports['default']; +//# sourceMappingURL=stringifyTableData.js.map diff --git a/tools/eslint/node_modules/table/dist/stringifyTableData.js.map b/tools/eslint/node_modules/table/dist/stringifyTableData.js.map new file mode 100644 index 00000000000000..89606f41c2c0ce --- /dev/null +++ b/tools/eslint/node_modules/table/dist/stringifyTableData.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["stringifyTableData.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;kBAQe,UAAC,IAAI,EAAK;AACrB,WAAO,mBAAM,IAAI,EAAE,UAAC,KAAK,EAAK;AAC1B,eAAO,mBAAM,KAAK,EAAE,MAAM,CAAC,CAAC;KAC/B,CAAC,CAAC;CACN","file":"stringifyTableData.js","sourcesContent":["import _ from 'lodash';\n\n/**\n * Casts all cell values to a string.\n *\n * @param {table~row[]} rows\n * @return {table~row[]}\n */\nexport default (rows) => {\n return _.map(rows, (cells) => {\n return _.map(cells, String);\n });\n};\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/tools/eslint/node_modules/table/dist/table.js b/tools/eslint/node_modules/table/dist/table.js new file mode 100644 index 00000000000000..58239cef7ebc03 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/table.js @@ -0,0 +1,140 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _drawTable = require('./drawTable'); + +var _drawTable2 = _interopRequireDefault(_drawTable); + +var _calculateCellWidthIndex = require('./calculateCellWidthIndex'); + +var _calculateCellWidthIndex2 = _interopRequireDefault(_calculateCellWidthIndex); + +var _makeConfig = require('./makeConfig'); + +var _makeConfig2 = _interopRequireDefault(_makeConfig); + +var _calculateRowHeightIndex = require('./calculateRowHeightIndex'); + +var _calculateRowHeightIndex2 = _interopRequireDefault(_calculateRowHeightIndex); + +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 _validateTableData = require('./validateTableData'); + +var _validateTableData2 = _interopRequireDefault(_validateTableData); + +var _stringifyTableData = require('./stringifyTableData'); + +var _stringifyTableData2 = _interopRequireDefault(_stringifyTableData); + +var _truncateTableData = require('./truncateTableData'); + +var _truncateTableData2 = _interopRequireDefault(_truncateTableData); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @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 {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 + * @return {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 + * @return {string} + */ + +exports.default = function (data) { + var userConfig = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + var cellWidthIndex = undefined, + config = undefined, + rowHeightIndex = undefined, + rows = undefined; + + (0, _validateTableData2.default)(data); + + rows = (0, _stringifyTableData2.default)(data); + + config = (0, _makeConfig2.default)(rows, userConfig); + + rows = (0, _truncateTableData2.default)(data, config); + + 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); + + cellWidthIndex = (0, _calculateCellWidthIndex2.default)(rows[0]); + + return (0, _drawTable2.default)(rows, config.border, cellWidthIndex, rowHeightIndex, config.drawHorizontalLine); +}; + +module.exports = exports['default']; +//# sourceMappingURL=table.js.map diff --git a/tools/eslint/node_modules/table/dist/table.js.map b/tools/eslint/node_modules/table/dist/table.js.map new file mode 100644 index 00000000000000..069d4c1a53bbc8 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/table.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["table.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAyEe,UAAC,IAAI,EAAsB;MAApB,UAAU,yDAAG,EAAE;;AACjC,MAAI,cAAc,YAAA;MACd,MAAM,YAAA;MACN,cAAc,YAAA;MACd,IAAI,YAAA,CAAC;;AAET,mCAAkB,IAAI,CAAC,CAAC;;AAExB,MAAI,GAAG,kCAAmB,IAAI,CAAC,CAAC;;AAEhC,QAAM,GAAG,0BAAW,IAAI,EAAE,UAAU,CAAC,CAAC;;AAEtC,MAAI,GAAG,iCAAkB,IAAI,EAAE,MAAM,CAAC,CAAC;;AAEvC,gBAAc,GAAG,uCAAwB,IAAI,EAAE,MAAM,CAAC,CAAC;;AAEvD,MAAI,GAAG,0CAA2B,IAAI,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;AAChE,MAAI,GAAG,8BAAe,IAAI,EAAE,MAAM,CAAC,CAAC;AACpC,MAAI,GAAG,4BAAa,IAAI,EAAE,MAAM,CAAC,CAAC;;AAElC,gBAAc,GAAG,uCAAwB,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;;AAElD,SAAO,yBAAU,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,CAAC,kBAAkB,CAAC,CAAC;CACpG","file":"table.js","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 {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 * @return {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 * @return {string}\n */\nexport default (data, userConfig = {}) => {\n let cellWidthIndex,\n config,\n rowHeightIndex,\n rows;\n\n validateTableData(data);\n\n rows = stringifyTableData(data);\n\n config = makeConfig(rows, userConfig);\n\n rows = truncateTableData(data, config);\n\n rowHeightIndex = calculateRowHeightIndex(rows, config);\n\n rows = mapDataUsingRowHeightIndex(rows, rowHeightIndex, config);\n rows = alignTableData(rows, config);\n rows = padTableData(rows, config);\n\n cellWidthIndex = calculateCellWidthIndex(rows[0]);\n\n return drawTable(rows, config.border, cellWidthIndex, rowHeightIndex, config.drawHorizontalLine);\n};\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/tools/eslint/node_modules/table/dist/truncateTableData.js b/tools/eslint/node_modules/table/dist/truncateTableData.js new file mode 100644 index 00000000000000..4b1afc98643015 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/truncateTableData.js @@ -0,0 +1,35 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _truncate2 = require('lodash/truncate'); + +var _truncate3 = _interopRequireDefault(_truncate2); + +var _map2 = require('lodash/map'); + +var _map3 = _interopRequireDefault(_map2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @todo Make it work with ASCII content. + * @param {table~row[]} rows + * @param {Object} config + * @return {table~row[]} + */ + +exports.default = function (rows, config) { + return (0, _map3.default)(rows, function (cells) { + return (0, _map3.default)(cells, function (content, index) { + return (0, _truncate3.default)(content, { + length: config.columns[index].truncate + }); + }); + }); +}; + +module.exports = exports['default']; +//# sourceMappingURL=truncateTableData.js.map diff --git a/tools/eslint/node_modules/table/dist/truncateTableData.js.map b/tools/eslint/node_modules/table/dist/truncateTableData.js.map new file mode 100644 index 00000000000000..1abbb32466df19 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/truncateTableData.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["truncateTableData.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;kBAQe,UAAC,IAAI,EAAE,MAAM,EAAK;AAC7B,WAAO,mBAAM,IAAI,EAAE,UAAC,KAAK,EAAK;AAC1B,eAAO,mBAAM,KAAK,EAAE,UAAC,OAAO,EAAE,KAAK,EAAK;AACpC,mBAAO,wBAAW,OAAO,EAAE;AACvB,sBAAM,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ;aACzC,CAAC,CAAC;SACN,CAAC,CAAC;KACN,CAAC,CAAC;CACN","file":"truncateTableData.js","sourcesContent":["import _ from 'lodash';\n\n/**\n * @todo Make it work with ASCII content.\n * @param {table~row[]} rows\n * @param {Object} config\n * @return {table~row[]}\n */\nexport default (rows, config) => {\n return _.map(rows, (cells) => {\n return _.map(cells, (content, index) => {\n return _.truncate(content, {\n length: config.columns[index].truncate\n });\n });\n });\n};\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/tools/eslint/node_modules/table/dist/validateConfig.js b/tools/eslint/node_modules/table/dist/validateConfig.js new file mode 100644 index 00000000000000..f399f37334cf86 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/validateConfig.js @@ -0,0 +1,53 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _config = require('./schemas/config.json'); + +var _config2 = _interopRequireDefault(_config); + +var _tv = require('tv4'); + +var _tv2 = _interopRequireDefault(_tv); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @typedef {string} cell + */ + +/** + * @typedef {cell[]} validateData~column + */ + +/** + * @param {formatData~config} config + * @returns {undefined} + */ + +exports.default = function () { + var config = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + + var result = undefined; + + result = _tv2.default.validateResult(config, _config2.default); + + if (!result.valid) { + /* eslint-disable no-console */ + console.log('config', config); + console.log('error', { + message: result.error.message, + params: result.error.params, + dataPath: result.error.dataPath, + schemaPath: result.error.schemaPath + }); + /* eslint-enable no-console */ + + throw new Error('Invalid config.'); + } +}; + +module.exports = exports['default']; +//# sourceMappingURL=validateConfig.js.map diff --git a/tools/eslint/node_modules/table/dist/validateConfig.js.map b/tools/eslint/node_modules/table/dist/validateConfig.js.map new file mode 100644 index 00000000000000..bc9508c73daa53 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/validateConfig.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["validateConfig.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAee,YAAiB;QAAhB,MAAM,yDAAG,EAAE;;AACvB,QAAI,MAAM,YAAA,CAAC;;AAEX,UAAM,GAAG,aAAI,cAAc,CAAC,MAAM,mBAAS,CAAC;;AAE5C,QAAI,CAAC,MAAM,CAAC,KAAK,EAAE;;AAEf,eAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC9B,eAAO,CAAC,GAAG,CAAC,OAAO,EAAE;AACjB,mBAAO,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO;AAC7B,kBAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM;AAC3B,oBAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ;AAC/B,sBAAU,EAAE,MAAM,CAAC,KAAK,CAAC,UAAU;SACtC,CAAC;;;AAAC,AAGH,cAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;KACtC;CACJ","file":"validateConfig.js","sourcesContent":["import schema from './schemas/config.json';\nimport tv4 from 'tv4';\n\n/**\n * @typedef {string} cell\n */\n\n/**\n * @typedef {cell[]} validateData~column\n */\n\n/**\n * @param {formatData~config} config\n * @returns {undefined}\n */\nexport default (config = {}) => {\n let result;\n\n result = tv4.validateResult(config, schema);\n\n if (!result.valid) {\n /* eslint-disable no-console */\n console.log('config', config);\n console.log('error', {\n message: result.error.message,\n params: result.error.params,\n dataPath: result.error.dataPath,\n schemaPath: result.error.schemaPath\n });\n /* eslint-enable no-console */\n\n throw new Error('Invalid config.');\n }\n};\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/tools/eslint/node_modules/table/dist/validateStreamConfig.js b/tools/eslint/node_modules/table/dist/validateStreamConfig.js new file mode 100644 index 00000000000000..8123d2ac0f5e9b --- /dev/null +++ b/tools/eslint/node_modules/table/dist/validateStreamConfig.js @@ -0,0 +1,53 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _streamConfig = require('./schemas/streamConfig.json'); + +var _streamConfig2 = _interopRequireDefault(_streamConfig); + +var _tv = require('tv4'); + +var _tv2 = _interopRequireDefault(_tv); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @typedef {string} cell + */ + +/** + * @typedef {cell[]} validateData~column + */ + +/** + * @param {formatData~config} config + * @returns {undefined} + */ + +exports.default = function () { + var config = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; + + var result = undefined; + + result = _tv2.default.validateResult(config, _streamConfig2.default); + + if (!result.valid) { + /* eslint-disable no-console */ + console.log('config', config); + console.log('error', { + message: result.error.message, + params: result.error.params, + dataPath: result.error.dataPath, + schemaPath: result.error.schemaPath + }); + /* eslint-enable no-console */ + + throw new Error('Invalid config.'); + } +}; + +module.exports = exports['default']; +//# sourceMappingURL=validateStreamConfig.js.map diff --git a/tools/eslint/node_modules/table/dist/validateStreamConfig.js.map b/tools/eslint/node_modules/table/dist/validateStreamConfig.js.map new file mode 100644 index 00000000000000..203922c6e3dc10 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/validateStreamConfig.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["validateStreamConfig.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAee,YAAiB;QAAhB,MAAM,yDAAG,EAAE;;AACvB,QAAI,MAAM,YAAA,CAAC;;AAEX,UAAM,GAAG,aAAI,cAAc,CAAC,MAAM,yBAAS,CAAC;;AAE5C,QAAI,CAAC,MAAM,CAAC,KAAK,EAAE;;AAEf,eAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC9B,eAAO,CAAC,GAAG,CAAC,OAAO,EAAE;AACjB,mBAAO,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO;AAC7B,kBAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM;AAC3B,oBAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ;AAC/B,sBAAU,EAAE,MAAM,CAAC,KAAK,CAAC,UAAU;SACtC,CAAC;;;AAAC,AAGH,cAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;KACtC;CACJ","file":"validateStreamConfig.js","sourcesContent":["import schema from './schemas/streamConfig.json';\nimport tv4 from 'tv4';\n\n/**\n * @typedef {string} cell\n */\n\n/**\n * @typedef {cell[]} validateData~column\n */\n\n/**\n * @param {formatData~config} config\n * @returns {undefined}\n */\nexport default (config = {}) => {\n let result;\n\n result = tv4.validateResult(config, schema);\n\n if (!result.valid) {\n /* eslint-disable no-console */\n console.log('config', config);\n console.log('error', {\n message: result.error.message,\n params: result.error.params,\n dataPath: result.error.dataPath,\n schemaPath: result.error.schemaPath\n });\n /* eslint-enable no-console */\n\n throw new Error('Invalid config.');\n }\n};\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/tools/eslint/node_modules/table/dist/validateTableData.js b/tools/eslint/node_modules/table/dist/validateTableData.js new file mode 100644 index 00000000000000..98353ac02c85cf --- /dev/null +++ b/tools/eslint/node_modules/table/dist/validateTableData.js @@ -0,0 +1,67 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _forEach2 = require('lodash/forEach'); + +var _forEach3 = _interopRequireDefault(_forEach2); + +var _isArray2 = require('lodash/isArray'); + +var _isArray3 = _interopRequireDefault(_isArray2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @typedef {string} cell + */ + +/** + * @typedef {cell[]} validateData~column + */ + +/** + * @param {column[]} rows + * @returns {undefined} + */ + +exports.default = function (rows) { + var columnNumber = undefined; + + if (!(0, _isArray3.default)(rows)) { + throw new Error('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.'); + } + + columnNumber = rows[0].length; + + (0, _forEach3.default)(rows, function (cells) { + if (!(0, _isArray3.default)(cells)) { + throw new Error('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 + (0, _forEach3.default)(cells, function (cell) { + if (/[\x01-\x1A]/.test(cell)) { + throw new Error('Table data must not contain control characters.'); + } + }); + }); +}; + +module.exports = exports['default']; +//# sourceMappingURL=validateTableData.js.map diff --git a/tools/eslint/node_modules/table/dist/validateTableData.js.map b/tools/eslint/node_modules/table/dist/validateTableData.js.map new file mode 100644 index 00000000000000..fb4b905a575ab4 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/validateTableData.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["validateTableData.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAce,UAAC,IAAI,EAAK;AACrB,QAAI,YAAY,YAAA,CAAC;;AAEjB,QAAI,CAAC,uBAAU,IAAI,CAAC,EAAE;AAClB,cAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;KACnD;;AAED,QAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;AACnB,cAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;KAC1D;;AAED,QAAI,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;AACtB,cAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;KAC7D;;AAED,gBAAY,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;;AAE9B,2BAAU,IAAI,EAAE,UAAC,KAAK,EAAK;AACvB,YAAI,CAAC,uBAAU,KAAK,CAAC,EAAE;AACnB,kBAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;SACvD;;AAED,YAAI,KAAK,CAAC,MAAM,KAAK,YAAY,EAAE;AAC/B,kBAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;SACpE;;;;AAAA,AAID,+BAAU,KAAK,EAAE,UAAC,IAAI,EAAK;AACvB,gBAAI,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;AAC1B,sBAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;aACtE;SACJ,CAAC,CAAC;KACN,CAAC,CAAC;CACN","file":"validateTableData.js","sourcesContent":["import _ from 'lodash';\n\n/**\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 let columnNumber;\n\n if (!_.isArray(rows)) {\n throw new Error('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 columnNumber = rows[0].length;\n\n _.forEach(rows, (cells) => {\n if (!_.isArray(cells)) {\n throw new Error('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 _.forEach(cells, (cell) => {\n if (/[\\x01-\\x1A]/.test(cell)) {\n throw new Error('Table data must not contain control characters.');\n }\n });\n });\n};\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/tools/eslint/node_modules/table/dist/wrapString.js b/tools/eslint/node_modules/table/dist/wrapString.js new file mode 100644 index 00000000000000..f61b81a81d5f41 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/wrapString.js @@ -0,0 +1,51 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _trim2 = require('lodash/trim'); + +var _trim3 = _interopRequireDefault(_trim2); + +var _sliceAnsi = require('slice-ansi'); + +var _sliceAnsi2 = _interopRequireDefault(_sliceAnsi); + +var _stringWidth = require('string-width'); + +var _stringWidth2 = _interopRequireDefault(_stringWidth); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * 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} + */ + +exports.default = function (subject, size) { + var chunks = undefined, + subjectSlice = undefined; + + subjectSlice = subject; + + chunks = []; + + do { + chunks.push((0, _sliceAnsi2.default)(subjectSlice, 0, size)); + + subjectSlice = (0, _trim3.default)((0, _sliceAnsi2.default)(subjectSlice, size)); + } while ((0, _stringWidth2.default)(subjectSlice)); + + return chunks; +}; + +module.exports = exports['default']; +//# sourceMappingURL=wrapString.js.map diff --git a/tools/eslint/node_modules/table/dist/wrapString.js.map b/tools/eslint/node_modules/table/dist/wrapString.js.map new file mode 100644 index 00000000000000..11c52bcebc631a --- /dev/null +++ b/tools/eslint/node_modules/table/dist/wrapString.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["wrapString.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAee,UAAC,OAAO,EAAE,IAAI,EAAK;AAC9B,QAAI,MAAM,YAAA;QACN,YAAY,YAAA,CAAC;;AAEjB,gBAAY,GAAG,OAAO,CAAC;;AAEvB,UAAM,GAAG,EAAE,CAAC;;AAEZ,OAAG;AACC,cAAM,CAAC,IAAI,CAAC,yBAAM,YAAY,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;;AAE1C,oBAAY,GAAG,oBAAO,yBAAM,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC;KACpD,QAAQ,2BAAY,YAAY,CAAC,EAAE;;AAEpC,WAAO,MAAM,CAAC;CACjB","file":"wrapString.js","sourcesContent":["import _ from 'lodash';\nimport 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 chunks,\n subjectSlice;\n\n subjectSlice = subject;\n\n chunks = [];\n\n do {\n chunks.push(slice(subjectSlice, 0, size));\n\n subjectSlice = _.trim(slice(subjectSlice, size));\n } while (stringWidth(subjectSlice));\n\n return chunks;\n};\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/tools/eslint/node_modules/table/dist/wrapWord.js b/tools/eslint/node_modules/table/dist/wrapWord.js new file mode 100644 index 00000000000000..e1d0714b90eb00 --- /dev/null +++ b/tools/eslint/node_modules/table/dist/wrapWord.js @@ -0,0 +1,63 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _trim2 = require('lodash/trim'); + +var _trim3 = _interopRequireDefault(_trim2); + +var _sliceAnsi = require('slice-ansi'); + +var _sliceAnsi2 = _interopRequireDefault(_sliceAnsi); + +var _stringWidth = require('string-width'); + +var _stringWidth2 = _interopRequireDefault(_stringWidth); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * @param {string} input + * @param {number} size + * @returns {Array} + */ + +exports.default = function (input, size) { + var chunk = undefined, + chunks = undefined, + re = undefined, + subject = undefined; + + subject = input; + + chunks = []; + + // https://regex101.com/r/gY5kZ1/1 + re = new RegExp('(^.{1,' + size + '}(\\s+|$))|(^.{1,' + (size - 1) + '}(\\\\|/|_|\\.|,|;|\-))'); + + do { + chunk = subject.match(re); + + // console.log('chunk', chunk, re); + + if (chunk) { + chunk = chunk[0]; + + subject = (0, _sliceAnsi2.default)(subject, (0, _stringWidth2.default)(chunk)); + + chunk = (0, _trim3.default)(chunk); + } else { + chunk = (0, _sliceAnsi2.default)(subject, 0, size); + subject = (0, _sliceAnsi2.default)(subject, size); + } + + chunks.push(chunk); + } while ((0, _stringWidth2.default)(subject)); + + return chunks; +}; + +module.exports = exports['default']; +//# sourceMappingURL=wrapWord.js.map diff --git a/tools/eslint/node_modules/table/dist/wrapWord.js.map b/tools/eslint/node_modules/table/dist/wrapWord.js.map new file mode 100644 index 00000000000000..16231f4a4d542c --- /dev/null +++ b/tools/eslint/node_modules/table/dist/wrapWord.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["wrapWord.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;kBASe,UAAC,KAAK,EAAE,IAAI,EAAK;AAC5B,QAAI,KAAK,YAAA;QACL,MAAM,YAAA;QACN,EAAE,YAAA;QACF,OAAO,YAAA,CAAC;;AAEZ,WAAO,GAAG,KAAK,CAAC;;AAEhB,UAAM,GAAG,EAAE;;;AAAC,AAGZ,MAAE,GAAG,IAAI,MAAM,CAAC,QAAQ,GAAG,IAAI,GAAG,mBAAmB,IAAI,IAAI,GAAG,CAAC,CAAA,AAAC,GAAG,yBAAyB,CAAC,CAAC;;AAEhG,OAAG;AACC,aAAK,GAAG,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;;;;AAAC,AAI1B,YAAI,KAAK,EAAE;AACP,iBAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;;AAEjB,mBAAO,GAAG,yBAAM,OAAO,EAAE,2BAAY,KAAK,CAAC,CAAC,CAAC;;AAE7C,iBAAK,GAAG,oBAAO,KAAK,CAAC,CAAC;SACzB,MAAM;AACH,iBAAK,GAAG,yBAAM,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;AAChC,mBAAO,GAAG,yBAAM,OAAO,EAAE,IAAI,CAAC,CAAC;SAClC;;AAED,cAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACtB,QAAQ,2BAAY,OAAO,CAAC,EAAE;;AAE/B,WAAO,MAAM,CAAC;CACjB","file":"wrapWord.js","sourcesContent":["import _ from 'lodash';\nimport 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 chunk,\n chunks,\n re,\n subject;\n\n subject = input;\n\n chunks = [];\n\n // https://regex101.com/r/gY5kZ1/1\n re = new RegExp('(^.{1,' + size + '}(\\\\s+|$))|(^.{1,' + (size - 1) + '}(\\\\\\\\|/|_|\\\\.|,|;|\\-))');\n\n do {\n chunk = subject.match(re);\n\n // console.log('chunk', chunk, re);\n\n if (chunk) {\n chunk = chunk[0];\n\n subject = slice(subject, stringWidth(chunk));\n\n chunk = _.trim(chunk);\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"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/tools/eslint/node_modules/table/package.json b/tools/eslint/node_modules/table/package.json new file mode 100644 index 00000000000000..9c7d21e3a12608 --- /dev/null +++ b/tools/eslint/node_modules/table/package.json @@ -0,0 +1,101 @@ +{ + "_args": [ + [ + "table@^3.7.8", + "/Users/silverwind/git/node/tools/package/package" + ] + ], + "_from": "table@>=3.7.8 <4.0.0", + "_id": "table@3.7.8", + "_inCache": true, + "_installable": true, + "_location": "/table", + "_nodeVersion": "5.3.0", + "_npmUser": { + "email": "gajus@gajus.com", + "name": "gajus" + }, + "_npmVersion": "3.5.2", + "_phantomChildren": {}, + "_requested": { + "name": "table", + "raw": "table@^3.7.8", + "rawSpec": "^3.7.8", + "scope": null, + "spec": ">=3.7.8 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/table/-/table-3.7.8.tgz", + "_shasum": "b424433ef596851922b2fd77224a69a1951618eb", + "_shrinkwrap": null, + "_spec": "table@^3.7.8", + "_where": "/Users/silverwind/git/node/tools/package/package", + "author": { + "email": "gajus@gajus.com", + "name": "Gajus Kuizinas", + "url": "http://gajus.com" + }, + "bugs": { + "url": "https://github.com/gajus/table/issues" + }, + "dependencies": { + "bluebird": "^3.1.1", + "chalk": "^1.1.1", + "lodash": "^4.0.0", + "slice-ansi": "0.0.4", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.0", + "tv4": "^1.2.7", + "xregexp": "^3.0.0" + }, + "description": "Formats data into a string table.", + "devDependencies": { + "chai": "^3.4.1", + "gitdown": "^2.4.0", + "jsonlint": "^1.6.2", + "pragmatist": "^3.0.2", + "sinon": "^1.17.2" + }, + "directories": {}, + "dist": { + "shasum": "b424433ef596851922b2fd77224a69a1951618eb", + "tarball": "http://registry.npmjs.org/table/-/table-3.7.8.tgz" + }, + "gitHead": "7464b27999c5c6da43c754fb5f94931423d41839", + "homepage": "https://github.com/gajus/table#readme", + "keywords": [ + "align", + "ansi", + "ascii", + "table", + "text" + ], + "license": "BSD-3-Clause", + "main": "./dist/index.js", + "maintainers": [ + { + "name": "gajus", + "email": "gk@anuary.com" + } + ], + "name": "table", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/gajus/table.git" + }, + "scripts": { + "build": "npm run pragmatist build -- --es5", + "format-config": "npm run format-json ./package.json", + "format-json": "jsonlint --sort-keys --in-place --indent ' '", + "lint": "npm run pragmatist lint", + "pragmatist": "pragmatist", + "readme": "node ./node_modules/.bin/gitdown ./.README/README.md --output-file ./README.md", + "test": "npm run pragmatist test" + }, + "version": "3.7.8" +} diff --git a/tools/eslint/node_modules/text-table/.travis.yml b/tools/eslint/node_modules/text-table/.travis.yml deleted file mode 100644 index cc4dba29d959a2..00000000000000 --- a/tools/eslint/node_modules/text-table/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" diff --git a/tools/eslint/node_modules/text-table/example/align.js b/tools/eslint/node_modules/text-table/example/align.js deleted file mode 100644 index 9be43098cf87b8..00000000000000 --- a/tools/eslint/node_modules/text-table/example/align.js +++ /dev/null @@ -1,8 +0,0 @@ -var table = require('../'); -var t = table([ - [ 'beep', '1024' ], - [ 'boop', '33450' ], - [ 'foo', '1006' ], - [ 'bar', '45' ] -], { align: [ 'l', 'r' ] }); -console.log(t); diff --git a/tools/eslint/node_modules/text-table/example/center.js b/tools/eslint/node_modules/text-table/example/center.js deleted file mode 100644 index 52b1c69e012cb1..00000000000000 --- a/tools/eslint/node_modules/text-table/example/center.js +++ /dev/null @@ -1,8 +0,0 @@ -var table = require('../'); -var t = table([ - [ 'beep', '1024', 'xyz' ], - [ 'boop', '3388450', 'tuv' ], - [ 'foo', '10106', 'qrstuv' ], - [ 'bar', '45', 'lmno' ] -], { align: [ 'l', 'c', 'l' ] }); -console.log(t); diff --git a/tools/eslint/node_modules/text-table/example/dotalign.js b/tools/eslint/node_modules/text-table/example/dotalign.js deleted file mode 100644 index 2cea6299368475..00000000000000 --- a/tools/eslint/node_modules/text-table/example/dotalign.js +++ /dev/null @@ -1,9 +0,0 @@ -var table = require('../'); -var t = table([ - [ 'beep', '1024' ], - [ 'boop', '334.212' ], - [ 'foo', '1006' ], - [ 'bar', '45.6' ], - [ 'baz', '123.' ] -], { align: [ 'l', '.' ] }); -console.log(t); diff --git a/tools/eslint/node_modules/text-table/example/doubledot.js b/tools/eslint/node_modules/text-table/example/doubledot.js deleted file mode 100644 index bab983b664cd6d..00000000000000 --- a/tools/eslint/node_modules/text-table/example/doubledot.js +++ /dev/null @@ -1,11 +0,0 @@ -var table = require('../'); -var t = table([ - [ '0.1.2' ], - [ '11.22.33' ], - [ '5.6.7' ], - [ '1.22222' ], - [ '12345.' ], - [ '5555.' ], - [ '123' ] -], { align: [ '.' ] }); -console.log(t); diff --git a/tools/eslint/node_modules/text-table/example/table.js b/tools/eslint/node_modules/text-table/example/table.js deleted file mode 100644 index 903ea4c417ccb0..00000000000000 --- a/tools/eslint/node_modules/text-table/example/table.js +++ /dev/null @@ -1,6 +0,0 @@ -var table = require('../'); -var t = table([ - [ 'master', '0123456789abcdef' ], - [ 'staging', 'fedcba9876543210' ] -]); -console.log(t); diff --git a/tools/eslint/node_modules/text-table/package.json b/tools/eslint/node_modules/text-table/package.json index 822956753fade0..794595d339a3a8 100644 --- a/tools/eslint/node_modules/text-table/package.json +++ b/tools/eslint/node_modules/text-table/package.json @@ -1,54 +1,96 @@ { - "name": "text-table", - "version": "0.2.0", + "_args": [ + [ + "text-table@~0.2.0", + "/Users/silverwind/git/node/tools/package/package" + ] + ], + "_from": "text-table@>=0.2.0 <0.3.0", + "_id": "text-table@0.2.0", + "_inCache": true, + "_installable": true, + "_location": "/text-table", + "_npmUser": { + "email": "mail@substack.net", + "name": "substack" + }, + "_npmVersion": "1.3.7", + "_phantomChildren": {}, + "_requested": { + "name": "text-table", + "raw": "text-table@~0.2.0", + "rawSpec": "~0.2.0", + "scope": null, + "spec": ">=0.2.0 <0.3.0", + "type": "range" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "_shasum": "7f5ee823ae805207c00af2df4a84ec3fcfa570b4", + "_shrinkwrap": null, + "_spec": "text-table@~0.2.0", + "_where": "/Users/silverwind/git/node/tools/package/package", + "author": { + "email": "mail@substack.net", + "name": "James Halliday", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/text-table/issues" + }, + "dependencies": {}, "description": "borderless text tables with alignment", - "main": "index.js", "devDependencies": { + "cli-color": "~0.2.3", "tap": "~0.4.0", - "tape": "~1.0.2", - "cli-color": "~0.2.3" - }, - "scripts": { - "test": "tap test/*.js" + "tape": "~1.0.2" }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/6..latest", - "chrome/20..latest", - "firefox/10..latest", - "safari/latest", - "opera/11.0..latest", - "iphone/6", - "ipad/6" - ] - }, - "repository": { - "type": "git", - "url": "git://github.com/substack/text-table.git" + "directories": {}, + "dist": { + "shasum": "7f5ee823ae805207c00af2df4a84ec3fcfa570b4", + "tarball": "http://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz" }, "homepage": "https://github.com/substack/text-table", "keywords": [ - "text", - "table", "align", "ascii", "rows", - "tabular" + "table", + "tabular", + "text" ], - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "name": "text-table", + "optionalDependencies": {}, "readme": "# text-table\n\ngenerate borderless text table strings suitable for printing to stdout\n\n[![build status](https://secure.travis-ci.org/substack/text-table.png)](http://travis-ci.org/substack/text-table)\n\n[![browser support](https://ci.testling.com/substack/text-table.png)](http://ci.testling.com/substack/text-table)\n\n# example\n\n## default align\n\n``` js\nvar table = require('text-table');\nvar t = table([\n [ 'master', '0123456789abcdef' ],\n [ 'staging', 'fedcba9876543210' ]\n]);\nconsole.log(t);\n```\n\n```\nmaster 0123456789abcdef\nstaging fedcba9876543210\n```\n\n## left-right align\n\n``` js\nvar table = require('text-table');\nvar t = table([\n [ 'beep', '1024' ],\n [ 'boop', '33450' ],\n [ 'foo', '1006' ],\n [ 'bar', '45' ]\n], { align: [ 'l', 'r' ] });\nconsole.log(t);\n```\n\n```\nbeep 1024\nboop 33450\nfoo 1006\nbar 45\n```\n\n## dotted align\n\n``` js\nvar table = require('text-table');\nvar t = table([\n [ 'beep', '1024' ],\n [ 'boop', '334.212' ],\n [ 'foo', '1006' ],\n [ 'bar', '45.6' ],\n [ 'baz', '123.' ]\n], { align: [ 'l', '.' ] });\nconsole.log(t);\n```\n\n```\nbeep 1024\nboop 334.212\nfoo 1006\nbar 45.6\nbaz 123.\n```\n\n## centered\n\n``` js\nvar table = require('text-table');\nvar t = table([\n [ 'beep', '1024', 'xyz' ],\n [ 'boop', '3388450', 'tuv' ],\n [ 'foo', '10106', 'qrstuv' ],\n [ 'bar', '45', 'lmno' ]\n], { align: [ 'l', 'c', 'l' ] });\nconsole.log(t);\n```\n\n```\nbeep 1024 xyz\nboop 3388450 tuv\nfoo 10106 qrstuv\nbar 45 lmno\n```\n\n# methods\n\n``` js\nvar table = require('text-table')\n```\n\n## var s = table(rows, opts={})\n\nReturn a formatted table string `s` from an array of `rows` and some options\n`opts`.\n\n`rows` should be an array of arrays containing strings, numbers, or other\nprintable values.\n\noptions can be:\n\n* `opts.hsep` - separator to use between columns, default `' '`\n* `opts.align` - array of alignment types for each column, default `['l','l',...]`\n* `opts.stringLength` - callback function to use when calculating the string length\n\nalignment types are:\n\n* `'l'` - left\n* `'r'` - right\n* `'c'` - center\n* `'.'` - decimal\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install text-table\n```\n\n# Use with ANSI-colors\n\nSince the string length of ANSI color schemes does not equal the length\nJavaScript sees internally it is necessary to pass the a custom string length\ncalculator during the main function call.\n\nSee the `test/ansi-colors.js` file for an example.\n\n# license\n\nMIT\n", "readmeFilename": "readme.markdown", - "bugs": { - "url": "https://github.com/substack/text-table/issues" + "repository": { + "type": "git", + "url": "git://github.com/substack/text-table.git" }, - "_id": "text-table@0.2.0", - "_shasum": "7f5ee823ae805207c00af2df4a84ec3fcfa570b4", - "_from": "text-table@>=0.2.0 <0.3.0", - "_resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz" + "scripts": { + "test": "tap test/*.js" + }, + "testling": { + "browsers": [ + "chrome/20..latest", + "firefox/10..latest", + "ie/6..latest", + "ipad/6", + "iphone/6", + "opera/11.0..latest", + "safari/latest" + ], + "files": "test/*.js" + }, + "version": "0.2.0" } diff --git a/tools/eslint/node_modules/text-table/test/align.js b/tools/eslint/node_modules/text-table/test/align.js deleted file mode 100644 index 245357f26a76b9..00000000000000 --- a/tools/eslint/node_modules/text-table/test/align.js +++ /dev/null @@ -1,18 +0,0 @@ -var test = require('tape'); -var table = require('../'); - -test('align', function (t) { - t.plan(1); - var s = table([ - [ 'beep', '1024' ], - [ 'boop', '33450' ], - [ 'foo', '1006' ], - [ 'bar', '45' ] - ], { align: [ 'l', 'r' ] }); - t.equal(s, [ - 'beep 1024', - 'boop 33450', - 'foo 1006', - 'bar 45' - ].join('\n')); -}); diff --git a/tools/eslint/node_modules/text-table/test/ansi-colors.js b/tools/eslint/node_modules/text-table/test/ansi-colors.js deleted file mode 100644 index fbc5bb10ad732a..00000000000000 --- a/tools/eslint/node_modules/text-table/test/ansi-colors.js +++ /dev/null @@ -1,32 +0,0 @@ -var test = require('tape'); -var table = require('../'); -var color = require('cli-color'); -var ansiTrim = require('cli-color/lib/trim'); - -test('center', function (t) { - t.plan(1); - var opts = { - align: [ 'l', 'c', 'l' ], - stringLength: function(s) { return ansiTrim(s).length } - }; - var s = table([ - [ - color.red('Red'), color.green('Green'), color.blue('Blue') - ], - [ - color.bold('Bold'), color.underline('Underline'), - color.italic('Italic') - ], - [ - color.inverse('Inverse'), color.strike('Strike'), - color.blink('Blink') - ], - [ 'bar', '45', 'lmno' ] - ], opts); - t.equal(ansiTrim(s), [ - 'Red Green Blue', - 'Bold Underline Italic', - 'Inverse Strike Blink', - 'bar 45 lmno' - ].join('\n')); -}); diff --git a/tools/eslint/node_modules/text-table/test/center.js b/tools/eslint/node_modules/text-table/test/center.js deleted file mode 100644 index c2c7a62a8f8cca..00000000000000 --- a/tools/eslint/node_modules/text-table/test/center.js +++ /dev/null @@ -1,18 +0,0 @@ -var test = require('tape'); -var table = require('../'); - -test('center', function (t) { - t.plan(1); - var s = table([ - [ 'beep', '1024', 'xyz' ], - [ 'boop', '3388450', 'tuv' ], - [ 'foo', '10106', 'qrstuv' ], - [ 'bar', '45', 'lmno' ] - ], { align: [ 'l', 'c', 'l' ] }); - t.equal(s, [ - 'beep 1024 xyz', - 'boop 3388450 tuv', - 'foo 10106 qrstuv', - 'bar 45 lmno' - ].join('\n')); -}); diff --git a/tools/eslint/node_modules/text-table/test/dotalign.js b/tools/eslint/node_modules/text-table/test/dotalign.js deleted file mode 100644 index f804f9281ab135..00000000000000 --- a/tools/eslint/node_modules/text-table/test/dotalign.js +++ /dev/null @@ -1,20 +0,0 @@ -var test = require('tape'); -var table = require('../'); - -test('dot align', function (t) { - t.plan(1); - var s = table([ - [ 'beep', '1024' ], - [ 'boop', '334.212' ], - [ 'foo', '1006' ], - [ 'bar', '45.6' ], - [ 'baz', '123.' ] - ], { align: [ 'l', '.' ] }); - t.equal(s, [ - 'beep 1024', - 'boop 334.212', - 'foo 1006', - 'bar 45.6', - 'baz 123.' - ].join('\n')); -}); diff --git a/tools/eslint/node_modules/text-table/test/doubledot.js b/tools/eslint/node_modules/text-table/test/doubledot.js deleted file mode 100644 index 659b57c9314bca..00000000000000 --- a/tools/eslint/node_modules/text-table/test/doubledot.js +++ /dev/null @@ -1,24 +0,0 @@ -var test = require('tape'); -var table = require('../'); - -test('dot align', function (t) { - t.plan(1); - var s = table([ - [ '0.1.2' ], - [ '11.22.33' ], - [ '5.6.7' ], - [ '1.22222' ], - [ '12345.' ], - [ '5555.' ], - [ '123' ] - ], { align: [ '.' ] }); - t.equal(s, [ - ' 0.1.2', - '11.22.33', - ' 5.6.7', - ' 1.22222', - '12345.', - ' 5555.', - ' 123' - ].join('\n')); -}); diff --git a/tools/eslint/node_modules/text-table/test/table.js b/tools/eslint/node_modules/text-table/test/table.js deleted file mode 100644 index 9c6701464cf66a..00000000000000 --- a/tools/eslint/node_modules/text-table/test/table.js +++ /dev/null @@ -1,14 +0,0 @@ -var test = require('tape'); -var table = require('../'); - -test('table', function (t) { - t.plan(1); - var s = table([ - [ 'master', '0123456789abcdef' ], - [ 'staging', 'fedcba9876543210' ] - ]); - t.equal(s, [ - 'master 0123456789abcdef', - 'staging fedcba9876543210' - ].join('\n')); -}); diff --git a/tools/eslint/node_modules/inquirer/node_modules/through/LICENSE.APACHE2 b/tools/eslint/node_modules/through/LICENSE.APACHE2 similarity index 100% rename from tools/eslint/node_modules/inquirer/node_modules/through/LICENSE.APACHE2 rename to tools/eslint/node_modules/through/LICENSE.APACHE2 diff --git a/tools/eslint/node_modules/through/LICENSE.MIT b/tools/eslint/node_modules/through/LICENSE.MIT new file mode 100644 index 00000000000000..49e7da41fec2be --- /dev/null +++ b/tools/eslint/node_modules/through/LICENSE.MIT @@ -0,0 +1,24 @@ +The MIT License + +Copyright (c) 2011 Dominic Tarr + +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/eslint/node_modules/through/index.js b/tools/eslint/node_modules/through/index.js new file mode 100644 index 00000000000000..9f443ffd2b1936 --- /dev/null +++ b/tools/eslint/node_modules/through/index.js @@ -0,0 +1,107 @@ +var Stream = require('stream') + +// through +// +// a stream that does nothing but re-emit the input. +// useful for aggregating a series of changing but not ending streams into one stream) + +exports = module.exports = through +through.through = through + +//create a readable writable stream. + +function through (write, end, opts) { + write = write || function (data) { this.queue(data) } + end = end || function () { this.queue(null) } + + var ended = false, destroyed = false, buffer = [], _ended = false + var stream = new Stream() + stream.readable = stream.writable = true + stream.paused = false + +// stream.autoPause = !(opts && opts.autoPause === false) + stream.autoDestroy = !(opts && opts.autoDestroy === false) + + stream.write = function (data) { + write.call(this, data) + return !stream.paused + } + + function drain() { + while(buffer.length && !stream.paused) { + var data = buffer.shift() + if(null === data) + return stream.emit('end') + else + stream.emit('data', data) + } + } + + stream.queue = stream.push = function (data) { +// console.error(ended) + if(_ended) return stream + if(data === null) _ended = true + buffer.push(data) + drain() + return stream + } + + //this will be registered as the first 'end' listener + //must call destroy next tick, to make sure we're after any + //stream piped from here. + //this is only a problem if end is not emitted synchronously. + //a nicer way to do this is to make sure this is the last listener for 'end' + + stream.on('end', function () { + stream.readable = false + if(!stream.writable && stream.autoDestroy) + process.nextTick(function () { + stream.destroy() + }) + }) + + function _end () { + stream.writable = false + end.call(stream) + if(!stream.readable && stream.autoDestroy) + stream.destroy() + } + + stream.end = function (data) { + if(ended) return + ended = true + if(arguments.length) stream.write(data) + _end() // will emit or queue + return stream + } + + stream.destroy = function () { + if(destroyed) return + destroyed = true + ended = true + buffer.length = 0 + stream.writable = stream.readable = false + stream.emit('close') + return stream + } + + stream.pause = function () { + if(stream.paused) return + stream.paused = true + return stream + } + + stream.resume = function () { + if(stream.paused) { + stream.paused = false + stream.emit('resume') + } + drain() + //may have become paused again, + //as drain emits 'data'. + if(!stream.paused) + stream.emit('drain') + return stream + } + return stream +} diff --git a/tools/eslint/node_modules/through/package.json b/tools/eslint/node_modules/through/package.json new file mode 100644 index 00000000000000..bb29a8eca370a4 --- /dev/null +++ b/tools/eslint/node_modules/through/package.json @@ -0,0 +1,92 @@ +{ + "_args": [ + [ + "through@^2.3.6", + "/Users/silverwind/git/node/tools/package/package/node_modules/inquirer" + ] + ], + "_from": "through@>=2.3.6 <3.0.0", + "_id": "through@2.3.8", + "_inCache": true, + "_installable": true, + "_location": "/through", + "_nodeVersion": "2.3.1", + "_npmUser": { + "email": "dominic.tarr@gmail.com", + "name": "dominictarr" + }, + "_npmVersion": "2.12.0", + "_phantomChildren": {}, + "_requested": { + "name": "through", + "raw": "through@^2.3.6", + "rawSpec": "^2.3.6", + "scope": null, + "spec": ">=2.3.6 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/inquirer" + ], + "_resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "_shasum": "0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5", + "_shrinkwrap": null, + "_spec": "through@^2.3.6", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/inquirer", + "author": { + "email": "dominic.tarr@gmail.com", + "name": "Dominic Tarr", + "url": "dominictarr.com" + }, + "bugs": { + "url": "https://github.com/dominictarr/through/issues" + }, + "dependencies": {}, + "description": "simplified stream construction", + "devDependencies": { + "from": "~0.1.3", + "stream-spec": "~0.3.5", + "tape": "~2.3.2" + }, + "directories": {}, + "dist": { + "shasum": "0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5", + "tarball": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" + }, + "gitHead": "2c5a6f9a0cc54da759b6e10964f2081c358e49dc", + "homepage": "https://github.com/dominictarr/through", + "keywords": [ + "pipe", + "stream", + "streams", + "user-streams" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "dominictarr", + "email": "dominic.tarr@gmail.com" + } + ], + "name": "through", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/dominictarr/through.git" + }, + "scripts": { + "test": "set -e; for t in test/*.js; do node $t; done" + }, + "testling": { + "browsers": [ + "chrome/20..latest", + "ff/15..latest", + "ie/8..latest", + "safari/5.1..latest" + ], + "files": "test/*.js" + }, + "version": "2.3.8" +} diff --git a/tools/eslint/node_modules/through/readme.markdown b/tools/eslint/node_modules/through/readme.markdown new file mode 100644 index 00000000000000..4939fffe422cf5 --- /dev/null +++ b/tools/eslint/node_modules/through/readme.markdown @@ -0,0 +1,64 @@ +#through + +[![build status](https://secure.travis-ci.org/dominictarr/through.png)](http://travis-ci.org/dominictarr/through) +[![testling badge](https://ci.testling.com/dominictarr/through.png)](https://ci.testling.com/dominictarr/through) + +Easy way to create a `Stream` that is both `readable` and `writable`. + +* Pass in optional `write` and `end` methods. +* `through` takes care of pause/resume logic if you use `this.queue(data)` instead of `this.emit('data', data)`. +* Use `this.pause()` and `this.resume()` to manage flow. +* Check `this.paused` to see current flow state. (`write` always returns `!this.paused`). + +This function is the basis for most of the synchronous streams in +[event-stream](http://github.com/dominictarr/event-stream). + +``` js +var through = require('through') + +through(function write(data) { + this.queue(data) //data *must* not be null + }, + function end () { //optional + this.queue(null) + }) +``` + +Or, can also be used _without_ buffering on pause, use `this.emit('data', data)`, +and this.emit('end') + +``` js +var through = require('through') + +through(function write(data) { + this.emit('data', data) + //this.pause() + }, + function end () { //optional + this.emit('end') + }) +``` + +## Extended Options + +You will probably not need these 99% of the time. + +### autoDestroy=false + +By default, `through` emits close when the writable +and readable side of the stream has ended. +If that is not desired, set `autoDestroy=false`. + +``` js +var through = require('through') + +//like this +var ts = through(write, end, {autoDestroy: false}) +//or like this +var ts = through(write, end) +ts.autoDestroy = false +``` + +## License + +MIT / Apache2 diff --git a/tools/eslint/node_modules/tryit/README.md b/tools/eslint/node_modules/tryit/README.md new file mode 100644 index 00000000000000..25a6ad580962f4 --- /dev/null +++ b/tools/eslint/node_modules/tryit/README.md @@ -0,0 +1,56 @@ +# tryit + +Tiny module wrapping try/catch in JavaScript. + +It's *literally 11 lines of code*, [just read it](tryit.js) that's all the documentation you'll need. + + +## install + +``` +npm install tryit +``` + +## usage + +What you'd normally do: +```js +try { + dangerousThing(); +} catch (e) { + console.log('something'); +} +``` + +With try-it (all it does is wrap try-catch) +```js +var tryit = require('tryit'); + +tryit(dangerousThing); +``` + +You can also handle the error by passing a second function +```js +tryit(dangerousThing, function (e) { + if (e) { + console.log('do something'); + } +}) +``` + +The second function follows error-first pattern common in node. So if you pass a callback it gets called in both cases. But will have an error as the first argument if it fails. + +## WHAT? WHY DO THIS!? + +Primary motivation is having a clean way to wrap things that might fail, where I don't care if it fails. I just want to try it. + +This includes stuff like blindly reading/parsing stuff from localStorage in the browser. If it's not there or if parsing it fails, that's fine. But I don't want to leave a bunch of empty `catch (e) {}` blocks in the code. + +Obviously, this is useful any time you're going to attempt to read some unknown data structure. + +In addition, my understanding is that it's hard for JS engines to optimize code in try blocks. By actually passing the code to be executed into a re-used try block, we can avoid having to have more than a single try block in our app. Again, this is not a primary motivation, just a potential side benefit. + + +## license + +[MIT](http://mit.joreteg.com/) diff --git a/tools/eslint/node_modules/tryit/package.json b/tools/eslint/node_modules/tryit/package.json new file mode 100644 index 00000000000000..8bb7e14a8a8dca --- /dev/null +++ b/tools/eslint/node_modules/tryit/package.json @@ -0,0 +1,80 @@ +{ + "_args": [ + [ + "tryit@^1.0.1", + "/Users/silverwind/git/node/tools/package/package/node_modules/is-resolvable" + ] + ], + "_from": "tryit@>=1.0.1 <2.0.0", + "_id": "tryit@1.0.2", + "_inCache": true, + "_installable": true, + "_location": "/tryit", + "_nodeVersion": "4.1.0", + "_npmUser": { + "email": "henrik@joreteg.com", + "name": "henrikjoreteg" + }, + "_npmVersion": "3.3.8", + "_phantomChildren": {}, + "_requested": { + "name": "tryit", + "raw": "tryit@^1.0.1", + "rawSpec": "^1.0.1", + "scope": null, + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/is-resolvable" + ], + "_resolved": "https://registry.npmjs.org/tryit/-/tryit-1.0.2.tgz", + "_shasum": "c196b0073e6b1c595d93c9c830855b7acc32a453", + "_shrinkwrap": null, + "_spec": "tryit@^1.0.1", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/is-resolvable", + "author": { + "email": "henrik@andyet.net", + "name": "Henrik Joreteg" + }, + "bugs": { + "url": "https://github.com/HenrikJoreteg/tryit/issues" + }, + "dependencies": {}, + "description": "Module to wrap try-catch for better performance and cleaner API.", + "devDependencies": { + "tap-spec": "^2.1.2", + "tape": "^3.0.3" + }, + "directories": {}, + "dist": { + "shasum": "c196b0073e6b1c595d93c9c830855b7acc32a453", + "tarball": "http://registry.npmjs.org/tryit/-/tryit-1.0.2.tgz" + }, + "gitHead": "b567b4feb491e2ee89addd3d06f66d6ec2217cf5", + "homepage": "https://github.com/HenrikJoreteg/tryit#readme", + "keywords": [ + "errorhandling", + "errors", + "try" + ], + "license": "MIT", + "main": "tryit.js", + "maintainers": [ + { + "name": "henrikjoreteg", + "email": "henrik@andyet.net" + } + ], + "name": "tryit", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/HenrikJoreteg/tryit.git" + }, + "scripts": { + "test": "node test/test.js | tap-spec" + }, + "version": "1.0.2" +} diff --git a/tools/eslint/node_modules/tryit/tryit.js b/tools/eslint/node_modules/tryit/tryit.js new file mode 100644 index 00000000000000..98a57007ea178b --- /dev/null +++ b/tools/eslint/node_modules/tryit/tryit.js @@ -0,0 +1,14 @@ +// tryit +// Simple, re-usuable try-catch, this is a performance optimization +// and provides a cleaner API. +module.exports = function (fn, cb) { + var err; + + try { + fn(); + } catch (e) { + err = e; + } + + if (cb) cb(err || null); +}; diff --git a/tools/eslint/node_modules/tv4/LICENSE.txt b/tools/eslint/node_modules/tv4/LICENSE.txt new file mode 100644 index 00000000000000..f421228be395f7 --- /dev/null +++ b/tools/eslint/node_modules/tv4/LICENSE.txt @@ -0,0 +1,8 @@ +/* +Author: Geraint Luff and others +Year: 2013 + +This code is released into the "public domain" by its author(s). Anybody may use, alter and distribute the code without restriction. The author makes no guarantees, and takes no liability of any kind for use of this code. + +If you find a bug or make an improvement, it would be courteous to let the author know, but it is not compulsory. +*/ \ No newline at end of file diff --git a/tools/eslint/node_modules/tv4/README.md b/tools/eslint/node_modules/tv4/README.md new file mode 100644 index 00000000000000..3ffa761546e270 --- /dev/null +++ b/tools/eslint/node_modules/tv4/README.md @@ -0,0 +1,468 @@ +# Tiny Validator (for v4 JSON Schema) + +[![Build Status](https://secure.travis-ci.org/geraintluff/tv4.svg?branch=master)](http://travis-ci.org/geraintluff/tv4) [![Dependency Status](https://gemnasium.com/geraintluff/tv4.svg)](https://gemnasium.com/geraintluff/tv4) [![NPM version](https://badge.fury.io/js/tv4.svg)](http://badge.fury.io/js/tv4) + +Use [json-schema](http://json-schema.org/) [draft v4](http://json-schema.org/latest/json-schema-core.html) to validate simple values and complex objects using a rich [validation vocabulary](http://json-schema.org/latest/json-schema-validation.html) ([examples](http://json-schema.org/examples.html)). + +There is support for `$ref` with JSON Pointer fragment paths (```other-schema.json#/properties/myKey```). + +## Usage 1: Simple validation + +```javascript +var valid = tv4.validate(data, schema); +``` + +If validation returns ```false```, then an explanation of why validation failed can be found in ```tv4.error```. + +The error object will look something like: +```json +{ + "code": 0, + "message": "Invalid type: string", + "dataPath": "/intKey", + "schemaPath": "/properties/intKey/type" +} +``` + +The `"code"` property will refer to one of the values in `tv4.errorCodes` - in this case, `tv4.errorCodes.INVALID_TYPE`. + +To enable external schema to be referenced, you use: +```javascript +tv4.addSchema(url, schema); +``` + +If schemas are referenced (```$ref```) but not known, then validation will return ```true``` and the missing schema(s) will be listed in ```tv4.missing```. For more info see the API documentation below. + +## Usage 2: Multi-threaded validation + +Storing the error and missing schemas does not work well in multi-threaded environments, so there is an alternative syntax: + +```javascript +var result = tv4.validateResult(data, schema); +``` + +The result will look something like: +```json +{ + "valid": false, + "error": {...}, + "missing": [...] +} +``` + +## Usage 3: Multiple errors + +Normally, `tv4` stops when it encounters the first validation error. However, you can collect an array of validation errors using: + +```javascript +var result = tv4.validateMultiple(data, schema); +``` + +The result will look something like: +```json +{ + "valid": false, + "errors": [ + {...}, + ... + ], + "missing": [...] +} +``` + +## Asynchronous validation + +Support for asynchronous validation (where missing schemas are fetched) can be added by including an extra JavaScript file. Currently, the only version requires jQuery (`tv4.async-jquery.js`), but the code is very short and should be fairly easy to modify for other libraries (such as MooTools). + +Usage: + +```javascript +tv4.validate(data, schema, function (isValid, validationError) { ... }); +``` + +`validationFailure` is simply taken from `tv4.error`. + +## Cyclical JavaScript objects + +While they don't occur in proper JSON, JavaScript does support self-referencing objects. Any of the above calls support an optional third argument: `checkRecursive`. If true, tv4 will handle self-referencing objects properly - this slows down validation slightly, but that's better than a hanging script. + +Consider this data, notice how both `a` and `b` refer to each other: + +```javascript +var a = {}; +var b = { a: a }; +a.b = b; +var aSchema = { properties: { b: { $ref: 'bSchema' }}}; +var bSchema = { properties: { a: { $ref: 'aSchema' }}}; +tv4.addSchema('aSchema', aSchema); +tv4.addSchema('bSchema', bSchema); +``` + +If the `checkRecursive` argument were missing, this would throw a "too much recursion" error. + +To enable support for this, pass `true` as additional argument to any of the regular validation methods: + +```javascript +tv4.validate(a, aSchema, true); +tv4.validateResult(data, aSchema, true); +tv4.validateMultiple(data, aSchema, true); +``` + +## The `banUnknownProperties` flag + +Sometimes, it is desirable to flag all unknown properties as an error. This is especially useful during development, to catch typos and the like, even when extra custom-defined properties are allowed. + +As such, tv4 implements ["ban unknown properties" mode](https://github.com/json-schema/json-schema/wiki/ban-unknown-properties-mode-\(v5-proposal\)), enabled by a fourth-argument flag: + +```javascript +tv4.validate(data, schema, checkRecursive, true); +tv4.validateResult(data, schema, checkRecursive, true); +tv4.validateMultiple(data, schema, checkRecursive, true); +``` + +## API + +There are additional api commands available for more complex use-cases: + +##### addSchema(uri, schema) +Pre-register a schema for reference by other schema and synchronous validation. + +````js +tv4.addSchema('http://example.com/schema', { ... }); +```` + +* `uri` the uri to identify this schema. +* `schema` the schema object. + +Schemas that have their `id` property set can be added directly. + +````js +tv4.addSchema({ ... }); +```` + +##### getSchema(uri) + +Return a schema from the cache. + +* `uri` the uri of the schema (may contain a `#` fragment) + +````js +var schema = tv4.getSchema('http://example.com/schema'); +```` + +##### getSchemaMap() + +Return a shallow copy of the schema cache, mapping schema document URIs to schema objects. + +```` +var map = tv4.getSchemaMap(); + +var schema = map[uri]; +```` + +##### getSchemaUris(filter) + +Return an Array with known schema document URIs. + +* `filter` optional RegExp to filter URIs + +```` +var arr = tv4.getSchemaUris(); + +// optional filter using a RegExp +var arr = tv4.getSchemaUris(/^https?://example.com/); +```` + +##### getMissingUris(filter) + +Return an Array with schema document URIs that are used as `$ref` in known schemas but which currently have no associated schema data. + +Use this in combination with `tv4.addSchema(uri, schema)` to preload the cache for complete synchronous validation with. + +* `filter` optional RegExp to filter URIs + +```` +var arr = tv4.getMissingUris(); + +// optional filter using a RegExp +var arr = tv4.getMissingUris(/^https?://example.com/); +```` + +##### dropSchemas() + +Drop all known schema document URIs from the cache. + +```` +tv4.dropSchemas(); +```` + +##### freshApi() + +Return a new tv4 instance with no shared state. + +```` +var otherTV4 = tv4.freshApi(); +```` + +##### reset() + +Manually reset validation status from the simple `tv4.validate(data, schema)`. Although tv4 will self reset on each validation there are some implementation scenarios where this is useful. + +```` +tv4.reset(); +```` + +##### setErrorReporter(reporter) + +Sets a custom error reporter. This is a function that accepts three arguments, and returns an error message (string): + +``` +tv4.setErrorReporter(function (error, data, schema) { + return "Error code: " + error.code; +}); +``` + +The `error` object already has everything aside from the `.message` property filled in (so you can use `error.params`, `error.dataPath`, `error.schemaPath` etc.). + +If nothing is returned (or the empty string), then it falls back to the default error reporter. To remove a custom error reporter, call `tv4.setErrorReporter(null)`. + +##### language(code) + +Sets the language used by the default error reporter. + +* `code` is a language code, like `'en'` or `'en-gb'` + +```` +tv4.language('en-gb'); +```` + +If you specify a multi-level language code (e.g. `fr-CH`), then it will fall back to the generic version (`fr`) if needed. + +##### addLanguage(code, map) + +Add a new template-based language map for the default error reporter (used by `tv4.language(code)`) + +* `code` is new language code +* `map` is an object mapping error IDs or constant names (e.g. `103` or `"NUMBER_MAXIMUM"`) to language strings. + +```` +tv4.addLanguage('fr', { ... }); + +// select for use +tv4.language('fr') +```` + +If you register a multi-level language code (e.g. `fr-FR`), then it will also be registered for plain `fr` if that does not already exist. + +##### addFormat(format, validationFunction) + +Add a custom format validator. (There are no built-in format validators. Several common ones can be found [here](https://github.com/ikr/tv4-formats) though) + +* `format` is a string, corresponding to the `"format"` value in schemas. +* `validationFunction` is a function that either returns: + * `null` (meaning no error) + * an error string (explaining the reason for failure) + +```` +tv4.addFormat('decimal-digits', function (data, schema) { + if (typeof data === 'string' && !/^[0-9]+$/.test(data)) { + return null; + } + return "must be string of decimal digits"; +}); +```` + +Alternatively, multiple formats can be added at the same time using an object: +```` +tv4.addFormat({ + 'my-format': function () {...}, + 'other-format': function () {...} +}); +```` + +##### defineKeyword(keyword, validationFunction) + +Add a custom keyword validator. + +* `keyword` is a string, corresponding to a schema keyword +* `validationFunction` is a function that either returns: + * `null` (meaning no error) + * an error string (explaining the reason for failure) + * an error object (containing some of: `code`/`message`/`dataPath`/`schemaPath`) + +```` +tv4.defineKeyword('my-custom-keyword', function (data, value, schema) { + if (simpleFailure()) { + return "Failure"; + } else if (detailedFailure()) { + return {code: tv4.errorCodes.MY_CUSTOM_CODE, message: {param1: 'a', param2: 'b'}}; + } else { + return null; + } +}); +```` + +`schema` is the schema upon which the keyword is defined. In the above example, `value === schema['my-custom-keyword']`. + +If an object is returned from the custom validator, and its `message` is a string, then that is used as the message result. If `message` is an object, then that is used to populate the (localisable) error template. + +##### defineError(codeName, codeNumber, defaultMessage) + +Defines a custom error code. + +* `codeName` is a string, all-caps underscore separated, e.g. `"MY_CUSTOM_ERROR"` +* `codeNumber` is an integer > 10000, which will be stored in `tv4.errorCodes` (e.g. `tv4.errorCodes.MY_CUSTOM_ERROR`) +* `defaultMessage` is an error message template to use (assuming translations have not been provided for this code) + +An example of `defaultMessage` might be: `"Incorrect moon (expected {expected}, got {actual}"`). This is filled out if a custom keyword returns a object `message` (see above). Translations will be used, if associated with the correct code name/number. + +## Demos + +### Basic usage +
      +
      +var schema = {
      +	"items": {
      +		"type": "boolean"
      +	}
      +};
      +var data1 = [true, false];
      +var data2 = [true, 123];
      +
      +alert("data 1: " + tv4.validate(data1, schema)); // true
      +alert("data 2: " + tv4.validate(data2, schema)); // false
      +alert("data 2 error: " + JSON.stringify(tv4.error, null, 4));
      +
      +
      + +### Use of $ref +
      +
      +var schema = {
      +	"type": "array",
      +	"items": {"$ref": "#"}
      +};
      +var data1 = [[], [[]]];
      +var data2 = [[], [true, []]];
      +
      +alert("data 1: " + tv4.validate(data1, schema)); // true
      +alert("data 2: " + tv4.validate(data2, schema)); // false
      +
      +
      + +### Missing schema +
      +
      +var schema = {
      +	"type": "array",
      +	"items": {"$ref": "http://example.com/schema" }
      +};
      +var data = [1, 2, 3];
      +
      +alert("Valid: " + tv4.validate(data, schema)); // true
      +alert("Missing schemas: " + JSON.stringify(tv4.missing));
      +
      +
      + +### Referencing remote schema +
      +
      +tv4.addSchema("http://example.com/schema", {
      +	"definitions": {
      +		"arrayItem": {"type": "boolean"}
      +	}
      +});
      +var schema = {
      +	"type": "array",
      +	"items": {"$ref": "http://example.com/schema#/definitions/arrayItem" }
      +};
      +var data1 = [true, false, true];
      +var data2 = [1, 2, 3];
      +
      +alert("data 1: " + tv4.validate(data1, schema)); // true
      +alert("data 2: " + tv4.validate(data2, schema)); // false
      +
      +
      + +## Supported platforms + +* Node.js +* All modern browsers +* IE >= 7 + +## Installation + +You can manually download [`tv4.js`](https://raw.github.com/geraintluff/tv4/master/tv4.js) or the minified [`tv4.min.js`](https://raw.github.com/geraintluff/tv4/master/tv4.min.js) and include it in your html to create the global `tv4` variable. + +Alternately use it as a CommonJS module: + +````js +var tv4 = require('tv4'); +```` + +or as an AMD module (e.g. with requirejs): + +```js +require('tv4', function(tv4){ + //use tv4 here +}); +``` + +There is a command-line tool that wraps this library: [tv4-cmd](https://www.npmjs.com/package/tv4-cmd). + +#### npm + +```` +$ npm install tv4 +```` + +#### bower + +```` +$ bower install tv4 +```` + +#### component.io + +```` +$ component install geraintluff/tv4 +```` + +## Build and test + +You can rebuild and run the node and browser tests using node.js and [grunt](http://http://gruntjs.com/): + +Make sure you have the global grunt cli command: +```` +$ npm install grunt-cli -g +```` + +Clone the git repos, open a shell in the root folder and install the development dependencies: + +```` +$ npm install +```` + +Rebuild and run the tests: +```` +$ grunt +```` + +It will run a build and display one Spec-style report for the node.js and two Dot-style reports for both the plain and minified browser tests (via phantomJS). You can also use your own browser to manually run the suites by opening [`test/index.html`](http://geraintluff.github.io/tv4/test/index.html) and [`test/index-min.html`](http://geraintluff.github.io/tv4/test/index-min.html). + +## Contributing + +Pull-requests for fixes and expansions are welcome. Edit the partial files in `/source` and add your tests in a suitable suite or folder under `/test/tests` and run `grunt` to rebuild and run the test suite. Try to maintain an idiomatic coding style and add tests for any new features. It is recommend to discuss big changes in an Issue. + +Do you speak another language? `tv4` needs internationalisation - please contribute language files to `/lang`! + +## Packages using tv4 + +* [chai-json-schema](http://chaijs.com/plugins/chai-json-schema) is a [Chai Assertion Library](http://chaijs.com) plugin to assert values against json-schema. +* [grunt-tv4](http://www.github.com/Bartvds/grunt-tv4) is a plugin for [Grunt](http://http://gruntjs.com/) that uses tv4 to bulk validate json files. + +## License + +The code is available as "public domain", meaning that it is completely free to use, without any restrictions at all. Read the full license [here](http://geraintluff.github.com/tv4/LICENSE.txt). + +It's also available under an [MIT license](http://jsonary.com/LICENSE.txt). diff --git a/tools/eslint/node_modules/tv4/lang/de.js b/tools/eslint/node_modules/tv4/lang/de.js new file mode 100644 index 00000000000000..edbc11ee315018 --- /dev/null +++ b/tools/eslint/node_modules/tv4/lang/de.js @@ -0,0 +1,47 @@ +(function (global) { + var lang = { + INVALID_TYPE: "Ungültiger Typ: {type} (erwartet wurde: {expected})", + ENUM_MISMATCH: "Keine Übereinstimmung mit der Aufzählung (enum) für: {value}", + ANY_OF_MISSING: "Daten stimmen nicht überein mit einem der Schemas von \"anyOf\"", + ONE_OF_MISSING: "Daten stimmen nicht überein mit einem der Schemas von \"oneOf\"", + ONE_OF_MULTIPLE: "Daten sind valid in Bezug auf mehreren Schemas von \"oneOf\": index {index1} und {index2}", + NOT_PASSED: "Daten stimmen mit dem \"not\" Schema überein", + // Numeric errors + NUMBER_MULTIPLE_OF: "Wert {value} ist kein Vielfaches von {multipleOf}", + NUMBER_MINIMUM: "Wert {value} ist kleiner als das Minimum {minimum}", + NUMBER_MINIMUM_EXCLUSIVE: "Wert {value} ist gleich dem Exklusiven Minimum {minimum}", + NUMBER_MAXIMUM: "Wert {value} ist größer als das Maximum {maximum}", + NUMBER_MAXIMUM_EXCLUSIVE: "Wert {value} ist gleich dem Exklusiven Maximum {maximum}", + // String errors + STRING_LENGTH_SHORT: "Zeichenkette zu kurz ({length} chars), minimum {minimum}", + STRING_LENGTH_LONG: "Zeichenkette zu lang ({length} chars), maximum {maximum}", + STRING_PATTERN: "Zeichenkette entspricht nicht dem Muster: {pattern}", + // Object errors + OBJECT_PROPERTIES_MINIMUM: "Zu wenige Attribute definiert ({propertyCount}), minimum {minimum}", + OBJECT_PROPERTIES_MAXIMUM: "Zu viele Attribute definiert ({propertyCount}), maximum {maximum}", + OBJECT_REQUIRED: "Notwendiges Attribut fehlt: {key}", + OBJECT_ADDITIONAL_PROPERTIES: "Zusätzliche Attribute nicht erlaubt", + OBJECT_DEPENDENCY_KEY: "Abhängigkeit fehlt - Schlüssel nicht vorhanden: {missing} (wegen Schlüssel: {key})", + // Array errors + ARRAY_LENGTH_SHORT: "Array zu kurz ({length}), minimum {minimum}", + ARRAY_LENGTH_LONG: "Array zu lang ({length}), maximum {maximum}", + ARRAY_UNIQUE: "Array Einträge nicht eindeutig (Index {match1} und {match2})", + ARRAY_ADDITIONAL_ITEMS: "Zusätzliche Einträge nicht erlaubt" + }; + + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['../tv4'], function(tv4) { + tv4.addLanguage('de', lang); + return tv4; + }); + } else if (typeof module !== 'undefined' && module.exports){ + // CommonJS. Define export. + var tv4 = require('../tv4'); + tv4.addLanguage('de', lang); + module.exports = tv4; + } else { + // Browser globals + global.tv4.addLanguage('de', lang); + } +})(this); diff --git a/tools/eslint/node_modules/tv4/lang/fr.js b/tools/eslint/node_modules/tv4/lang/fr.js new file mode 100644 index 00000000000000..c020b7295b554b --- /dev/null +++ b/tools/eslint/node_modules/tv4/lang/fr.js @@ -0,0 +1,55 @@ +(function (global) { + var lang = { + INVALID_TYPE: "Type invalide: {type} ({expected} attendu)", + ENUM_MISMATCH: "Aucune valeur correspondante (enum) pour: {value}", + ANY_OF_MISSING: "La donnée ne correspond à aucun schema de \"anyOf\"", + ONE_OF_MISSING: "La donnée ne correspond à aucun schema de \"oneOf\"", + ONE_OF_MULTIPLE: "La donnée est valide pour plus d'un schema de \"oneOf\": indices {index1} et {index2}", + NOT_PASSED: "La donnée correspond au schema de \"not\"", + // Numeric errors + NUMBER_MULTIPLE_OF: "La valeur {value} n'est pas un multiple de {multipleOf}", + NUMBER_MINIMUM: "La valeur {value} est inférieure au minimum {minimum}", + NUMBER_MINIMUM_EXCLUSIVE: "La valeur {value} est égale au minimum exclusif {minimum}", + NUMBER_MAXIMUM: "La valeur {value} est supérieure au maximum {maximum}", + NUMBER_MAXIMUM_EXCLUSIVE: "La valeur {value} est égale au maximum exclusif {maximum}", + NUMBER_NOT_A_NUMBER: "La valeur {value} n'est pas un nombre valide", + // String errors + STRING_LENGTH_SHORT: "Le texte est trop court ({length} carac.), minimum {minimum}", + STRING_LENGTH_LONG: "Le texte est trop long ({length} carac.), maximum {maximum}", + STRING_PATTERN: "Le texte ne correspond pas au motif: {pattern}", + // Object errors + OBJECT_PROPERTIES_MINIMUM: "Pas assez de propriétés définies ({propertyCount}), minimum {minimum}", + OBJECT_PROPERTIES_MAXIMUM: "Trop de propriétés définies ({propertyCount}), maximum {maximum}", + OBJECT_REQUIRED: "Propriété requise manquante: {key}", + OBJECT_ADDITIONAL_PROPERTIES: "Propriétés additionnelles non autorisées", + OBJECT_DEPENDENCY_KEY: "Echec de dépendance - la clé doit exister: {missing} (du à la clé: {key})", + // Array errors + ARRAY_LENGTH_SHORT: "Le tableau est trop court ({length}), minimum {minimum}", + ARRAY_LENGTH_LONG: "Le tableau est trop long ({length}), maximum {maximum}", + ARRAY_UNIQUE: "Des éléments du tableau ne sont pas uniques (indices {match1} et {match2})", + ARRAY_ADDITIONAL_ITEMS: "Éléments additionnels non autorisés", + // Format errors + FORMAT_CUSTOM: "Échec de validation du format ({message})", + KEYWORD_CUSTOM: "Échec de mot-clé: {key} ({message})", + // Schema structure + CIRCULAR_REFERENCE: "Références ($refs) circulaires: {urls}", + // Non-standard validation options + UNKNOWN_PROPERTY: "Propriété inconnue (n'existe pas dans le schema)" + }; + + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['../tv4'], function(tv4) { + tv4.addLanguage('fr', lang); + return tv4; + }); + } else if (typeof module !== 'undefined' && module.exports){ + // CommonJS. Define export. + var tv4 = require('../tv4'); + tv4.addLanguage('fr', lang); + module.exports = tv4; + } else { + // Browser globals + global.tv4.addLanguage('fr', lang); + } +})(this); diff --git a/tools/eslint/node_modules/tv4/lang/nb.js b/tools/eslint/node_modules/tv4/lang/nb.js new file mode 100644 index 00000000000000..41831a17f98c91 --- /dev/null +++ b/tools/eslint/node_modules/tv4/lang/nb.js @@ -0,0 +1,55 @@ +(function (global) { + var lang = { + INVALID_TYPE: "Ugyldig type: {type} (forventet {expected})", + ENUM_MISMATCH: "Ingen samsvarende enum verdi for: {value}", + ANY_OF_MISSING: "Data samsvarer ikke med noe skjema fra \"anyOf\"", + ONE_OF_MISSING: "Data samsvarer ikke med noe skjema fra \"oneOf\"", + ONE_OF_MULTIPLE: "Data samsvarer med mer enn ett skjema fra \"oneOf\": indeks {index1} og {index2}", + NOT_PASSED: "Data samsvarer med skjema fra \"not\"", + // Numeric errors + NUMBER_MULTIPLE_OF: "Verdien {value} er ikke et multiplum av {multipleOf}", + NUMBER_MINIMUM: "Verdien {value} er mindre enn minsteverdi {minimum}", + NUMBER_MINIMUM_EXCLUSIVE: "Verdien {value} er lik eksklusiv minsteverdi {minimum}", + NUMBER_MAXIMUM: "Verdien {value} er større enn maksimalverdi {maximum}", + NUMBER_MAXIMUM_EXCLUSIVE: "Verdien {value} er lik eksklusiv maksimalverdi {maximum}", + NUMBER_NOT_A_NUMBER: "Verdien {value} er ikke et gyldig tall", + // String errors + STRING_LENGTH_SHORT: "Strengen er for kort ({length} tegn), minst {minimum}", + STRING_LENGTH_LONG: "Strengen er for lang ({length} tegn), maksimalt {maximum}", + STRING_PATTERN: "Strengen samsvarer ikke med regulært uttrykk: {pattern}", + // Object errors + OBJECT_PROPERTIES_MINIMUM: "For få variabler definert ({propertyCount}), minst {minimum} er forventet", + OBJECT_PROPERTIES_MAXIMUM: "For mange variabler definert ({propertyCount}), makismalt {maximum} er tillatt", + OBJECT_REQUIRED: "Mangler obligatorisk variabel: {key}", + OBJECT_ADDITIONAL_PROPERTIES: "Tilleggsvariabler er ikke tillatt", + OBJECT_DEPENDENCY_KEY: "Variabelen {missing} må være definert (på grunn av følgende variabel: {key})", + // Array errors + ARRAY_LENGTH_SHORT: "Listen er for kort ({length} elementer), minst {minimum}", + ARRAY_LENGTH_LONG: "Listen er for lang ({length} elementer), maksimalt {maximum}", + ARRAY_UNIQUE: "Elementene er ikke unike (indeks {match1} og {match2} er like)", + ARRAY_ADDITIONAL_ITEMS: "Tillegselementer er ikke tillatt", + // Format errors + FORMAT_CUSTOM: "Formatteringen stemmer ikke ({message})", + KEYWORD_CUSTOM: "Nøkkelen stemmer ikke: {key} ({message})", + // Schema structure + CIRCULAR_REFERENCE: "Sirkulære referanser ($refs): {urls}", + // Non-standard validation options + UNKNOWN_PROPERTY: "Ukjent variabel (eksisterer ikke i skjemaet)" + }; + + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['../tv4'], function(tv4) { + tv4.addLanguage('nb', lang); + return tv4; + }); + } else if (typeof module !== 'undefined' && module.exports) { + // CommonJS. Define export. + var tv4 = require('../tv4'); + tv4.addLanguage('nb', lang); + module.exports = tv4; + } else { + // Browser globals + global.tv4.addLanguage('nb', lang); + } +})(this); diff --git a/tools/eslint/node_modules/tv4/lang/pl-PL.js b/tools/eslint/node_modules/tv4/lang/pl-PL.js new file mode 100755 index 00000000000000..f46aaa4388b584 --- /dev/null +++ b/tools/eslint/node_modules/tv4/lang/pl-PL.js @@ -0,0 +1,55 @@ +(function (global) { + var lang = { + INVALID_TYPE: "Niepoprawny typ: {type} (spodziewany {expected})", + ENUM_MISMATCH: "Żadna predefiniowana wartośc nie pasuje do: {value}", + ANY_OF_MISSING: "Dane nie pasują do żadnego wzoru z sekcji \"anyOf\"", + ONE_OF_MISSING: "Dane nie pasują do żadnego wzoru z sekcji \"oneOf\"", + ONE_OF_MULTIPLE: "Dane są prawidłowe dla więcej niż jednego schematu z \"oneOf\": indeksy {index1} i {index2}", + NOT_PASSED: "Dane pasują do wzoru z sekcji \"not\"", + // Numeric errors + NUMBER_MULTIPLE_OF: "Wartość {value} nie jest wielokrotnością {multipleOf}", + NUMBER_MINIMUM: "Wartość {value} jest mniejsza niż {minimum}", + NUMBER_MINIMUM_EXCLUSIVE: "Wartość {value} jest równa wyłączonemu minimum {minimum}", + NUMBER_MAXIMUM: "Wartość {value} jest większa niż {maximum}", + NUMBER_MAXIMUM_EXCLUSIVE: "Wartość {value} jest równa wyłączonemu maksimum {maximum}", + NUMBER_NOT_A_NUMBER: "Wartość {value} nie jest poprawną liczbą", + // String errors + STRING_LENGTH_SHORT: "Napis jest za krótki ({length} znaków), minimum {minimum}", + STRING_LENGTH_LONG: "Napis jest za długi ({length} )znaków, maksimum {maximum}", + STRING_PATTERN: "Napis nie pasuje do wzoru: {pattern}", + // Object errors + OBJECT_PROPERTIES_MINIMUM: "Za mało zdefiniowanych pól ({propertyCount}), minimum {minimum}", + OBJECT_PROPERTIES_MAXIMUM: "Za dużo zdefiniowanych pól ({propertyCount}), maksimum {maximum}", + OBJECT_REQUIRED: "Brakuje wymaganego pola: {key}", + OBJECT_ADDITIONAL_PROPERTIES: "Dodatkowe pola są niedozwolone", + OBJECT_DEPENDENCY_KEY: "Błąd zależności - klucz musi istnieć: {missing} (wzgledem klucza: {key})", + // Array errors + ARRAY_LENGTH_SHORT: "Tablica ma za mało elementów ({length}), minimum {minimum}", + ARRAY_LENGTH_LONG: "Tablica ma za dużo elementów ({length}), maximum {maximum}", + ARRAY_UNIQUE: "Elementy tablicy nie są unikalne (indeks {match1} i {match2})", + ARRAY_ADDITIONAL_ITEMS: "Dodatkowe elementy są niedozwolone", + // Format errors + FORMAT_CUSTOM: "Błąd zgodności z formatem ({message})", + KEYWORD_CUSTOM: "Błąd słowa kluczowego: {key} ({message})", + // Schema structure + CIRCULAR_REFERENCE: "Cykliczna referencja $refs: {urls}", + // Non-standard validation options + UNKNOWN_PROPERTY: "Nie znane pole (brak we wzorze(schema))" + }; + + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['../tv4'], function(tv4) { + tv4.addLanguage('pl-PL', lang); + return tv4; + }); + } else if (typeof module !== 'undefined' && module.exports) { + // CommonJS. Define export. + var tv4 = require('../tv4'); + tv4.addLanguage('pl-PL', lang); + module.exports = tv4; + } else { + // Browser globals + global.tv4.addLanguage('pl-PL', lang); + } +})(this); diff --git a/tools/eslint/node_modules/tv4/lang/pt-PT.js b/tools/eslint/node_modules/tv4/lang/pt-PT.js new file mode 100644 index 00000000000000..0413251d2bf8a5 --- /dev/null +++ b/tools/eslint/node_modules/tv4/lang/pt-PT.js @@ -0,0 +1,55 @@ +(function (global) { + var lang = { + INVALID_TYPE: "Tipo inválido: {type} (esperava {expected})", + ENUM_MISMATCH: "Nenhuma correspondência 'enum' para: {value}", + ANY_OF_MISSING: "Os dados não correspondem a nenhum esquema de \"anyOf\"", + ONE_OF_MISSING: "Os dados não correspondem a nenhum esquema de \"oneOf\"", + ONE_OF_MULTIPLE: "Os dados são válidos quando comparados com mais de um esquema de \"oneOf\": índices {index1} e {index2}", + NOT_PASSED: "Os dados correspondem a um esquema de \"not\"", + // Numeric errors + NUMBER_MULTIPLE_OF: "O valor {value} não é um múltiplo de {multipleOf}", + NUMBER_MINIMUM: "O valor {value} é menor que o mínimo {minimum}", + NUMBER_MINIMUM_EXCLUSIVE: "O valor {value} é igual ao mínimo exclusivo {minimum}", + NUMBER_MAXIMUM: "O valor {value} é maior que o máximo {maximum}", + NUMBER_MAXIMUM_EXCLUSIVE: "O valor {value} é igual ao máximo exclusivo {maximum}", + NUMBER_NOT_A_NUMBER: "O valor {value} não é um número válido", + // String errors + STRING_LENGTH_SHORT: "A 'string' é muito curta ({length} caracteres), mínimo {minimum}", + STRING_LENGTH_LONG: "A 'string' é muito longa ({length} caracteres), máximo {maximum}", + STRING_PATTERN: "A 'string' não corresponde ao modelo: {pattern}", + // Object errors + OBJECT_PROPERTIES_MINIMUM: "Poucas propriedades definidas ({propertyCount}), mínimo {minimum}", + OBJECT_PROPERTIES_MAXIMUM: "Muitas propriedades definidas ({propertyCount}), máximo {maximum}", + OBJECT_REQUIRED: "Propriedade necessária em falta: {key}", + OBJECT_ADDITIONAL_PROPERTIES: "Não são permitidas propriedades adicionais", + OBJECT_DEPENDENCY_KEY: "Uma dependência falhou - tem de existir uma chave: {missing} (devido à chave: {key})", + // Array errors + ARRAY_LENGTH_SHORT: "A 'array' é muito curta ({length}), mínimo {minimum}", + ARRAY_LENGTH_LONG: "A 'array' é muito longa ({length}), máximo {maximum}", + ARRAY_UNIQUE: "Os itens da 'array' não são únicos (índices {match1} e {match2})", + ARRAY_ADDITIONAL_ITEMS: "Não são permitidos itens adicionais", + // Format errors + FORMAT_CUSTOM: "A validação do formato falhou ({message})", + KEYWORD_CUSTOM: "A 'keyword' falhou: {key} ({message})", + // Schema structure + CIRCULAR_REFERENCE: "$refs circular: {urls}", + // Non-standard validation options + UNKNOWN_PROPERTY: "Propriedade desconhecida (não está em 'schema')" + }; + + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['../tv4'], function(tv4) { + tv4.addLanguage('pt-PT', lang); + return tv4; + }); + } else if (typeof module !== 'undefined' && module.exports) { + // CommonJS. Define export. + var tv4 = require('../tv4'); + tv4.addLanguage('pt-PT', lang); + module.exports = tv4; + } else { + // Browser globals + global.tv4.addLanguage('pt-PT', lang); + } +})(this); diff --git a/tools/eslint/node_modules/tv4/lang/sv-SE.js b/tools/eslint/node_modules/tv4/lang/sv-SE.js new file mode 100644 index 00000000000000..28f2994c4adeb1 --- /dev/null +++ b/tools/eslint/node_modules/tv4/lang/sv-SE.js @@ -0,0 +1,55 @@ +(function (global) { + var lang = { + INVALID_TYPE: "Otillåten typ: {type} (skall vara {expected})", + ENUM_MISMATCH: "Otillåtet värde: {value}", + ANY_OF_MISSING: "Värdet matchar inget av schemana \"anyOf\"", + ONE_OF_MISSING: "Värdet matchar inget av schemana \"oneOf\"", + ONE_OF_MULTIPLE: "Värdet matchar flera scheman \"oneOf\": index {index1} och {index2}", + NOT_PASSED: "Värdet matchar schemat från \"not\"", + // Numeric errors + NUMBER_MULTIPLE_OF: "Värdet {value} är inte en multipel av {multipleOf}", + NUMBER_MINIMUM: "Värdet {value} får inte vara mindre än {minimum}", + NUMBER_MINIMUM_EXCLUSIVE: "Värdet {value} måste vara större än {minimum}", + NUMBER_MAXIMUM: "Värdet {value} får inte vara större än {maximum}", + NUMBER_MAXIMUM_EXCLUSIVE: "Värdet {value} måste vara mindre än {maximum}", + NUMBER_NOT_A_NUMBER: "Värdet {value} är inte ett giltigt tal", + // String errors + STRING_LENGTH_SHORT: "Texten är för kort ({length} tecken), ska vara minst {minimum} tecken", + STRING_LENGTH_LONG: "Texten är för lång ({length} tecken), ska vara högst {maximum}", + STRING_PATTERN: "Texten har fel format: {pattern}", + // Object errors + OBJECT_PROPERTIES_MINIMUM: "För få parametrar ({propertyCount}), ska minst vara {minimum}", + OBJECT_PROPERTIES_MAXIMUM: "För många parametrar ({propertyCount}), får högst vara {maximum}", + OBJECT_REQUIRED: "Egenskap saknas: {key}", + OBJECT_ADDITIONAL_PROPERTIES: "Extra parametrar är inte tillåtna", + OBJECT_DEPENDENCY_KEY: "Saknar beroende - saknad nyckel: {missing} (beroende nyckel: {key})", + // Array errors + ARRAY_LENGTH_SHORT: "Listan är för kort ({length}), ska minst vara {minimum}", + ARRAY_LENGTH_LONG: "Listan är för lång ({length}), ska högst vara {maximum}", + ARRAY_UNIQUE: "Listvärden är inte unika (index {match1} och {match2})", + ARRAY_ADDITIONAL_ITEMS: "Extra värden är inte tillåtna", + // Format errors + FORMAT_CUSTOM: "Misslyckad validering ({message})", + KEYWORD_CUSTOM: "Misslyckat nyckelord: {key} ({message})", + // Schema structure + CIRCULAR_REFERENCE: "Cirkulär $refs: {urls}", + // Non-standard validation options + UNKNOWN_PROPERTY: "Okänd egenskap (finns ej i schema)" + }; + + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['../tv4'], function(tv4) { + tv4.addLanguage('sv-SE', lang); + return tv4; + }); + } else if (typeof module !== 'undefined' && module.exports) { + // CommonJS. Define export. + var tv4 = require('../tv4'); + tv4.addLanguage('sv-SE', lang); + module.exports = tv4; + } else { + // Browser globals + global.tv4.addLanguage('sv-SE', lang); + } +})(this); diff --git a/tools/eslint/node_modules/tv4/lang/zh-CN.js b/tools/eslint/node_modules/tv4/lang/zh-CN.js new file mode 100644 index 00000000000000..b3c4c1b7afbf41 --- /dev/null +++ b/tools/eslint/node_modules/tv4/lang/zh-CN.js @@ -0,0 +1,55 @@ +(function (global) { + var lang = { + INVALID_TYPE: "当前类型 {type} 不符合期望的类型 {expected}", + ENUM_MISMATCH: "{value} 不是有效的枚举类型取值", + ANY_OF_MISSING: "数据不符合以下任何一个模式 (\"anyOf\")", + ONE_OF_MISSING: "数据不符合以下任何一个模式 (\"oneOf\")", + ONE_OF_MULTIPLE: "数据同时符合多个模式 (\"oneOf\"): 下标 {index1} 和 {index2}", + NOT_PASSED: "数据不应匹配以下模式 (\"not\")", + // Numeric errors + NUMBER_MULTIPLE_OF: "数值 {value} 不是 {multipleOf} 的倍数", + NUMBER_MINIMUM: "数值 {value} 小于最小值 {minimum}", + NUMBER_MINIMUM_EXCLUSIVE: "数值 {value} 等于排除的最小值 {minimum}", + NUMBER_MAXIMUM: "数值 {value} is greater 大于最大值 {maximum}", + NUMBER_MAXIMUM_EXCLUSIVE: "数值 {value} 等于排除的最大值 {maximum}", + NUMBER_NOT_A_NUMBER: "数值 {value} 不是有效的数字", + // String errors + STRING_LENGTH_SHORT: "字符串太短 ({length} 个字符), 最少 {minimum} 个", + STRING_LENGTH_LONG: "字符串太长 ({length} 个字符), 最多 {maximum} 个", + STRING_PATTERN: "字符串不匹配模式: {pattern}", + // Object errors + OBJECT_PROPERTIES_MINIMUM: "字段数过少 ({propertyCount}), 最少 {minimum} 个", + OBJECT_PROPERTIES_MAXIMUM: "字段数过多 ({propertyCount}), 最多 {maximum} 个", + OBJECT_REQUIRED: "缺少必要字段: {key}", + OBJECT_ADDITIONAL_PROPERTIES: "不允许多余的字段", + OBJECT_DEPENDENCY_KEY: "依赖失败 - 缺少键 {missing} (来自键: {key})", + // Array errors + ARRAY_LENGTH_SHORT: "数组长度太短 ({length}), 最小长度 {minimum}", + ARRAY_LENGTH_LONG: "数组长度太长 ({length}), 最大长度 {maximum}", + ARRAY_UNIQUE: "数组元素不唯一 (下标 {match1} 和 {match2})", + ARRAY_ADDITIONAL_ITEMS: "不允许多余的元素", + // Format errors + FORMAT_CUSTOM: "格式校验失败 ({message})", + KEYWORD_CUSTOM: "关键字 {key} 校验失败: ({message})", + // Schema structure + CIRCULAR_REFERENCE: "循环引用 ($refs): {urls}", + // Non-standard validation options + UNKNOWN_PROPERTY: "未知字段 (不在 schema 中)" + }; + + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['../tv4'], function(tv4) { + tv4.addLanguage('zh-CN', lang); + return tv4; + }); + } else if (typeof module !== 'undefined' && module.exports){ + // CommonJS. Define export. + var tv4 = require('../tv4'); + tv4.addLanguage('zh-CN', lang); + module.exports = tv4; + } else { + // Browser globals + global.tv4.addLanguage('zh-CN', lang); + } +})(this); diff --git a/tools/eslint/node_modules/tv4/package.json b/tools/eslint/node_modules/tv4/package.json new file mode 100644 index 00000000000000..74c36f57d3ebb4 --- /dev/null +++ b/tools/eslint/node_modules/tv4/package.json @@ -0,0 +1,114 @@ +{ + "_args": [ + [ + "tv4@^1.2.7", + "/Users/silverwind/git/node/tools/package/package/node_modules/table" + ] + ], + "_from": "tv4@>=1.2.7 <2.0.0", + "_id": "tv4@1.2.7", + "_inCache": true, + "_installable": true, + "_location": "/tv4", + "_nodeVersion": "0.12.4", + "_npmUser": { + "email": "luffgd@gmail.com", + "name": "geraintluff" + }, + "_npmVersion": "2.10.1", + "_phantomChildren": {}, + "_requested": { + "name": "tv4", + "raw": "tv4@^1.2.7", + "rawSpec": "^1.2.7", + "scope": null, + "spec": ">=1.2.7 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/table" + ], + "_resolved": "https://registry.npmjs.org/tv4/-/tv4-1.2.7.tgz", + "_shasum": "bd29389afc73ade49ae5f48142b5d544bf68d120", + "_shrinkwrap": null, + "_spec": "tv4@^1.2.7", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/table", + "author": { + "name": "Geraint Luff" + }, + "bugs": { + "url": "https://github.com/geraintluff/tv4/issues" + }, + "dependencies": {}, + "description": "A public domain JSON Schema validator for JavaScript", + "devDependencies": { + "grunt": "~0.4.1", + "grunt-cli": "~0.1.9", + "grunt-component-io": "~0.1.0", + "grunt-concat-sourcemap": "~0.2", + "grunt-contrib-clean": "~0.4.1", + "grunt-contrib-copy": "~0.4.1", + "grunt-contrib-jshint": "~0.6.2", + "grunt-contrib-uglify": "~0.2.2", + "grunt-markdown": "~0.3.0", + "grunt-mocha": "~0.4", + "grunt-mocha-test": "~0.5.0", + "grunt-push-release": "~0.1.1", + "grunt-regex-replace": "~0.2.5", + "jshint-path-reporter": "~0.1", + "mocha": "~1.11.0", + "mocha-unfunk-reporter": "~0.2", + "proclaim": "1.4", + "requirejs": "~2.1.11", + "source-map-support": "~0.1" + }, + "directories": {}, + "dist": { + "shasum": "bd29389afc73ade49ae5f48142b5d544bf68d120", + "tarball": "http://registry.npmjs.org/tv4/-/tv4-1.2.7.tgz" + }, + "engines": { + "node": ">= 0.8.0" + }, + "gitHead": "c1db91fd7a915178f4b8f66622f0e78fcb4e3ecb", + "homepage": "https://github.com/geraintluff/tv4#readme", + "keywords": [ + "json-schema", + "schema", + "tv4", + "validator" + ], + "license:": [ + { + "type": "Public Domain", + "url": "http://geraintluff.github.io/tv4/LICENSE.txt" + }, + { + "type": "MIT", + "url": "http://jsonary.com/LICENSE.txt" + } + ], + "main": "tv4.js", + "maintainers": [ + { + "name": "geraintluff", + "email": "luffgd@gmail.com" + }, + { + "name": "bartvds", + "email": "bartvanderschoor@gmail.com" + } + ], + "name": "tv4", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/geraintluff/tv4.git" + }, + "scripts": { + "prepublish": "grunt prepublish", + "test": "grunt test" + }, + "version": "1.2.7" +} diff --git a/tools/eslint/node_modules/tv4/tv4.async-jquery.js b/tools/eslint/node_modules/tv4/tv4.async-jquery.js new file mode 100644 index 00000000000000..761f232ad7e8cb --- /dev/null +++ b/tools/eslint/node_modules/tv4/tv4.async-jquery.js @@ -0,0 +1,34 @@ +// Provides support for asynchronous validation (fetching schemas) using jQuery +// Callback is optional third argument to tv4.validate() - if not present, synchronous operation +// callback(result, error); +if (typeof (tv4.asyncValidate) === 'undefined') { + tv4.syncValidate = tv4.validate; + tv4.validate = function (data, schema, callback, checkRecursive, banUnknownProperties) { + if (typeof (callback) === 'undefined') { + return this.syncValidate(data, schema, checkRecursive, banUnknownProperties); + } else { + return this.asyncValidate(data, schema, callback, checkRecursive, banUnknownProperties); + } + }; + tv4.asyncValidate = function (data, schema, callback, checkRecursive, banUnknownProperties) { + var $ = jQuery; + var result = tv4.validate(data, schema, checkRecursive, banUnknownProperties); + if (!tv4.missing.length) { + callback(result, tv4.error); + } else { + // Make a request for each missing schema + var missingSchemas = $.map(tv4.missing, function (schemaUri) { + return $.getJSON(schemaUri).success(function (fetchedSchema) { + tv4.addSchema(schemaUri, fetchedSchema); + }).error(function () { + // If there's an error, just use an empty schema + tv4.addSchema(schemaUri, {}); + }); + }); + // When all requests done, try again + $.when.apply($, missingSchemas).done(function () { + var result = tv4.asyncValidate(data, schema, callback, checkRecursive, banUnknownProperties); + }); + } + }; +} diff --git a/tools/eslint/node_modules/tv4/tv4.js b/tools/eslint/node_modules/tv4/tv4.js new file mode 100644 index 00000000000000..614f443689b2f0 --- /dev/null +++ b/tools/eslint/node_modules/tv4/tv4.js @@ -0,0 +1,1677 @@ +/* +Author: Geraint Luff and others +Year: 2013 + +This code is released into the "public domain" by its author(s). Anybody may use, alter and distribute the code without restriction. The author makes no guarantees, and takes no liability of any kind for use of this code. + +If you find a bug or make an improvement, it would be courteous to let the author know, but it is not compulsory. +*/ +(function (global, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define([], factory); + } else if (typeof module !== 'undefined' && module.exports){ + // CommonJS. Define export. + module.exports = factory(); + } else { + // Browser globals + global.tv4 = factory(); + } +}(this, function () { + +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FObject%2Fkeys +if (!Object.keys) { + Object.keys = (function () { + var hasOwnProperty = Object.prototype.hasOwnProperty, + hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'), + dontEnums = [ + 'toString', + 'toLocaleString', + 'valueOf', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'constructor' + ], + dontEnumsLength = dontEnums.length; + + return function (obj) { + if (typeof obj !== 'object' && typeof obj !== 'function' || obj === null) { + throw new TypeError('Object.keys called on non-object'); + } + + var result = []; + + for (var prop in obj) { + if (hasOwnProperty.call(obj, prop)) { + result.push(prop); + } + } + + if (hasDontEnumBug) { + for (var i=0; i < dontEnumsLength; i++) { + if (hasOwnProperty.call(obj, dontEnums[i])) { + result.push(dontEnums[i]); + } + } + } + return result; + }; + })(); +} +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create +if (!Object.create) { + Object.create = (function(){ + function F(){} + + return function(o){ + if (arguments.length !== 1) { + throw new Error('Object.create implementation only accepts one parameter.'); + } + F.prototype = o; + return new F(); + }; + })(); +} +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FArray%2FisArray +if(!Array.isArray) { + Array.isArray = function (vArg) { + return Object.prototype.toString.call(vArg) === "[object Array]"; + }; +} +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FArray%2FindexOf +if (!Array.prototype.indexOf) { + Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) { + if (this === null) { + throw new TypeError(); + } + var t = Object(this); + var len = t.length >>> 0; + + if (len === 0) { + return -1; + } + var n = 0; + if (arguments.length > 1) { + n = Number(arguments[1]); + if (n !== n) { // shortcut for verifying if it's NaN + n = 0; + } else if (n !== 0 && n !== Infinity && n !== -Infinity) { + n = (n > 0 || -1) * Math.floor(Math.abs(n)); + } + } + if (n >= len) { + return -1; + } + var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0); + for (; k < len; k++) { + if (k in t && t[k] === searchElement) { + return k; + } + } + return -1; + }; +} + +// Grungey Object.isFrozen hack +if (!Object.isFrozen) { + Object.isFrozen = function (obj) { + var key = "tv4_test_frozen_key"; + while (obj.hasOwnProperty(key)) { + key += Math.random(); + } + try { + obj[key] = true; + delete obj[key]; + return false; + } catch (e) { + return true; + } + }; +} +// Based on: https://github.com/geraintluff/uri-templates, but with all the de-substitution stuff removed + +var uriTemplateGlobalModifiers = { + "+": true, + "#": true, + ".": true, + "/": true, + ";": true, + "?": true, + "&": true +}; +var uriTemplateSuffices = { + "*": true +}; + +function notReallyPercentEncode(string) { + return encodeURI(string).replace(/%25[0-9][0-9]/g, function (doubleEncoded) { + return "%" + doubleEncoded.substring(3); + }); +} + +function uriTemplateSubstitution(spec) { + var modifier = ""; + if (uriTemplateGlobalModifiers[spec.charAt(0)]) { + modifier = spec.charAt(0); + spec = spec.substring(1); + } + var separator = ""; + var prefix = ""; + var shouldEscape = true; + var showVariables = false; + var trimEmptyString = false; + if (modifier === '+') { + shouldEscape = false; + } else if (modifier === ".") { + prefix = "."; + separator = "."; + } else if (modifier === "/") { + prefix = "/"; + separator = "/"; + } else if (modifier === '#') { + prefix = "#"; + shouldEscape = false; + } else if (modifier === ';') { + prefix = ";"; + separator = ";"; + showVariables = true; + trimEmptyString = true; + } else if (modifier === '?') { + prefix = "?"; + separator = "&"; + showVariables = true; + } else if (modifier === '&') { + prefix = "&"; + separator = "&"; + showVariables = true; + } + + var varNames = []; + var varList = spec.split(","); + var varSpecs = []; + var varSpecMap = {}; + for (var i = 0; i < varList.length; i++) { + var varName = varList[i]; + var truncate = null; + if (varName.indexOf(":") !== -1) { + var parts = varName.split(":"); + varName = parts[0]; + truncate = parseInt(parts[1], 10); + } + var suffices = {}; + while (uriTemplateSuffices[varName.charAt(varName.length - 1)]) { + suffices[varName.charAt(varName.length - 1)] = true; + varName = varName.substring(0, varName.length - 1); + } + var varSpec = { + truncate: truncate, + name: varName, + suffices: suffices + }; + varSpecs.push(varSpec); + varSpecMap[varName] = varSpec; + varNames.push(varName); + } + var subFunction = function (valueFunction) { + var result = ""; + var startIndex = 0; + for (var i = 0; i < varSpecs.length; i++) { + var varSpec = varSpecs[i]; + var value = valueFunction(varSpec.name); + if (value === null || value === undefined || (Array.isArray(value) && value.length === 0) || (typeof value === 'object' && Object.keys(value).length === 0)) { + startIndex++; + continue; + } + if (i === startIndex) { + result += prefix; + } else { + result += (separator || ","); + } + if (Array.isArray(value)) { + if (showVariables) { + result += varSpec.name + "="; + } + for (var j = 0; j < value.length; j++) { + if (j > 0) { + result += varSpec.suffices['*'] ? (separator || ",") : ","; + if (varSpec.suffices['*'] && showVariables) { + result += varSpec.name + "="; + } + } + result += shouldEscape ? encodeURIComponent(value[j]).replace(/!/g, "%21") : notReallyPercentEncode(value[j]); + } + } else if (typeof value === "object") { + if (showVariables && !varSpec.suffices['*']) { + result += varSpec.name + "="; + } + var first = true; + for (var key in value) { + if (!first) { + result += varSpec.suffices['*'] ? (separator || ",") : ","; + } + first = false; + result += shouldEscape ? encodeURIComponent(key).replace(/!/g, "%21") : notReallyPercentEncode(key); + result += varSpec.suffices['*'] ? '=' : ","; + result += shouldEscape ? encodeURIComponent(value[key]).replace(/!/g, "%21") : notReallyPercentEncode(value[key]); + } + } else { + if (showVariables) { + result += varSpec.name; + if (!trimEmptyString || value !== "") { + result += "="; + } + } + if (varSpec.truncate != null) { + value = value.substring(0, varSpec.truncate); + } + result += shouldEscape ? encodeURIComponent(value).replace(/!/g, "%21"): notReallyPercentEncode(value); + } + } + return result; + }; + subFunction.varNames = varNames; + return { + prefix: prefix, + substitution: subFunction + }; +} + +function UriTemplate(template) { + if (!(this instanceof UriTemplate)) { + return new UriTemplate(template); + } + var parts = template.split("{"); + var textParts = [parts.shift()]; + var prefixes = []; + var substitutions = []; + var varNames = []; + while (parts.length > 0) { + var part = parts.shift(); + var spec = part.split("}")[0]; + var remainder = part.substring(spec.length + 1); + var funcs = uriTemplateSubstitution(spec); + substitutions.push(funcs.substitution); + prefixes.push(funcs.prefix); + textParts.push(remainder); + varNames = varNames.concat(funcs.substitution.varNames); + } + this.fill = function (valueFunction) { + var result = textParts[0]; + for (var i = 0; i < substitutions.length; i++) { + var substitution = substitutions[i]; + result += substitution(valueFunction); + result += textParts[i + 1]; + } + return result; + }; + this.varNames = varNames; + this.template = template; +} +UriTemplate.prototype = { + toString: function () { + return this.template; + }, + fillFromObject: function (obj) { + return this.fill(function (varName) { + return obj[varName]; + }); + } +}; +var ValidatorContext = function ValidatorContext(parent, collectMultiple, errorReporter, checkRecursive, trackUnknownProperties) { + this.missing = []; + this.missingMap = {}; + this.formatValidators = parent ? Object.create(parent.formatValidators) : {}; + this.schemas = parent ? Object.create(parent.schemas) : {}; + this.collectMultiple = collectMultiple; + this.errors = []; + this.handleError = collectMultiple ? this.collectError : this.returnError; + if (checkRecursive) { + this.checkRecursive = true; + this.scanned = []; + this.scannedFrozen = []; + this.scannedFrozenSchemas = []; + this.scannedFrozenValidationErrors = []; + this.validatedSchemasKey = 'tv4_validation_id'; + this.validationErrorsKey = 'tv4_validation_errors_id'; + } + if (trackUnknownProperties) { + this.trackUnknownProperties = true; + this.knownPropertyPaths = {}; + this.unknownPropertyPaths = {}; + } + this.errorReporter = errorReporter || defaultErrorReporter('en'); + if (typeof this.errorReporter === 'string') { + throw new Error('debug'); + } + this.definedKeywords = {}; + if (parent) { + for (var key in parent.definedKeywords) { + this.definedKeywords[key] = parent.definedKeywords[key].slice(0); + } + } +}; +ValidatorContext.prototype.defineKeyword = function (keyword, keywordFunction) { + this.definedKeywords[keyword] = this.definedKeywords[keyword] || []; + this.definedKeywords[keyword].push(keywordFunction); +}; +ValidatorContext.prototype.createError = function (code, messageParams, dataPath, schemaPath, subErrors, data, schema) { + var error = new ValidationError(code, messageParams, dataPath, schemaPath, subErrors); + error.message = this.errorReporter(error, data, schema); + return error; +}; +ValidatorContext.prototype.returnError = function (error) { + return error; +}; +ValidatorContext.prototype.collectError = function (error) { + if (error) { + this.errors.push(error); + } + return null; +}; +ValidatorContext.prototype.prefixErrors = function (startIndex, dataPath, schemaPath) { + for (var i = startIndex; i < this.errors.length; i++) { + this.errors[i] = this.errors[i].prefixWith(dataPath, schemaPath); + } + return this; +}; +ValidatorContext.prototype.banUnknownProperties = function (data, schema) { + for (var unknownPath in this.unknownPropertyPaths) { + var error = this.createError(ErrorCodes.UNKNOWN_PROPERTY, {path: unknownPath}, unknownPath, "", null, data, schema); + var result = this.handleError(error); + if (result) { + return result; + } + } + return null; +}; + +ValidatorContext.prototype.addFormat = function (format, validator) { + if (typeof format === 'object') { + for (var key in format) { + this.addFormat(key, format[key]); + } + return this; + } + this.formatValidators[format] = validator; +}; +ValidatorContext.prototype.resolveRefs = function (schema, urlHistory) { + if (schema['$ref'] !== undefined) { + urlHistory = urlHistory || {}; + if (urlHistory[schema['$ref']]) { + return this.createError(ErrorCodes.CIRCULAR_REFERENCE, {urls: Object.keys(urlHistory).join(', ')}, '', '', null, undefined, schema); + } + urlHistory[schema['$ref']] = true; + schema = this.getSchema(schema['$ref'], urlHistory); + } + return schema; +}; +ValidatorContext.prototype.getSchema = function (url, urlHistory) { + var schema; + if (this.schemas[url] !== undefined) { + schema = this.schemas[url]; + return this.resolveRefs(schema, urlHistory); + } + var baseUrl = url; + var fragment = ""; + if (url.indexOf('#') !== -1) { + fragment = url.substring(url.indexOf("#") + 1); + baseUrl = url.substring(0, url.indexOf("#")); + } + if (typeof this.schemas[baseUrl] === 'object') { + schema = this.schemas[baseUrl]; + var pointerPath = decodeURIComponent(fragment); + if (pointerPath === "") { + return this.resolveRefs(schema, urlHistory); + } else if (pointerPath.charAt(0) !== "/") { + return undefined; + } + var parts = pointerPath.split("/").slice(1); + for (var i = 0; i < parts.length; i++) { + var component = parts[i].replace(/~1/g, "/").replace(/~0/g, "~"); + if (schema[component] === undefined) { + schema = undefined; + break; + } + schema = schema[component]; + } + if (schema !== undefined) { + return this.resolveRefs(schema, urlHistory); + } + } + if (this.missing[baseUrl] === undefined) { + this.missing.push(baseUrl); + this.missing[baseUrl] = baseUrl; + this.missingMap[baseUrl] = baseUrl; + } +}; +ValidatorContext.prototype.searchSchemas = function (schema, url) { + if (Array.isArray(schema)) { + for (var i = 0; i < schema.length; i++) { + this.searchSchemas(schema[i], url); + } + } else if (schema && typeof schema === "object") { + if (typeof schema.id === "string") { + if (isTrustedUrl(url, schema.id)) { + if (this.schemas[schema.id] === undefined) { + this.schemas[schema.id] = schema; + } + } + } + for (var key in schema) { + if (key !== "enum") { + if (typeof schema[key] === "object") { + this.searchSchemas(schema[key], url); + } else if (key === "$ref") { + var uri = getDocumentUri(schema[key]); + if (uri && this.schemas[uri] === undefined && this.missingMap[uri] === undefined) { + this.missingMap[uri] = uri; + } + } + } + } + } +}; +ValidatorContext.prototype.addSchema = function (url, schema) { + //overload + if (typeof url !== 'string' || typeof schema === 'undefined') { + if (typeof url === 'object' && typeof url.id === 'string') { + schema = url; + url = schema.id; + } + else { + return; + } + } + if (url === getDocumentUri(url) + "#") { + // Remove empty fragment + url = getDocumentUri(url); + } + this.schemas[url] = schema; + delete this.missingMap[url]; + normSchema(schema, url); + this.searchSchemas(schema, url); +}; + +ValidatorContext.prototype.getSchemaMap = function () { + var map = {}; + for (var key in this.schemas) { + map[key] = this.schemas[key]; + } + return map; +}; + +ValidatorContext.prototype.getSchemaUris = function (filterRegExp) { + var list = []; + for (var key in this.schemas) { + if (!filterRegExp || filterRegExp.test(key)) { + list.push(key); + } + } + return list; +}; + +ValidatorContext.prototype.getMissingUris = function (filterRegExp) { + var list = []; + for (var key in this.missingMap) { + if (!filterRegExp || filterRegExp.test(key)) { + list.push(key); + } + } + return list; +}; + +ValidatorContext.prototype.dropSchemas = function () { + this.schemas = {}; + this.reset(); +}; +ValidatorContext.prototype.reset = function () { + this.missing = []; + this.missingMap = {}; + this.errors = []; +}; + +ValidatorContext.prototype.validateAll = function (data, schema, dataPathParts, schemaPathParts, dataPointerPath) { + var topLevel; + schema = this.resolveRefs(schema); + if (!schema) { + return null; + } else if (schema instanceof ValidationError) { + this.errors.push(schema); + return schema; + } + + var startErrorCount = this.errors.length; + var frozenIndex, scannedFrozenSchemaIndex = null, scannedSchemasIndex = null; + if (this.checkRecursive && data && typeof data === 'object') { + topLevel = !this.scanned.length; + if (data[this.validatedSchemasKey]) { + var schemaIndex = data[this.validatedSchemasKey].indexOf(schema); + if (schemaIndex !== -1) { + this.errors = this.errors.concat(data[this.validationErrorsKey][schemaIndex]); + return null; + } + } + if (Object.isFrozen(data)) { + frozenIndex = this.scannedFrozen.indexOf(data); + if (frozenIndex !== -1) { + var frozenSchemaIndex = this.scannedFrozenSchemas[frozenIndex].indexOf(schema); + if (frozenSchemaIndex !== -1) { + this.errors = this.errors.concat(this.scannedFrozenValidationErrors[frozenIndex][frozenSchemaIndex]); + return null; + } + } + } + this.scanned.push(data); + if (Object.isFrozen(data)) { + if (frozenIndex === -1) { + frozenIndex = this.scannedFrozen.length; + this.scannedFrozen.push(data); + this.scannedFrozenSchemas.push([]); + } + scannedFrozenSchemaIndex = this.scannedFrozenSchemas[frozenIndex].length; + this.scannedFrozenSchemas[frozenIndex][scannedFrozenSchemaIndex] = schema; + this.scannedFrozenValidationErrors[frozenIndex][scannedFrozenSchemaIndex] = []; + } else { + if (!data[this.validatedSchemasKey]) { + try { + Object.defineProperty(data, this.validatedSchemasKey, { + value: [], + configurable: true + }); + Object.defineProperty(data, this.validationErrorsKey, { + value: [], + configurable: true + }); + } catch (e) { + //IE 7/8 workaround + data[this.validatedSchemasKey] = []; + data[this.validationErrorsKey] = []; + } + } + scannedSchemasIndex = data[this.validatedSchemasKey].length; + data[this.validatedSchemasKey][scannedSchemasIndex] = schema; + data[this.validationErrorsKey][scannedSchemasIndex] = []; + } + } + + var errorCount = this.errors.length; + var error = this.validateBasic(data, schema, dataPointerPath) + || this.validateNumeric(data, schema, dataPointerPath) + || this.validateString(data, schema, dataPointerPath) + || this.validateArray(data, schema, dataPointerPath) + || this.validateObject(data, schema, dataPointerPath) + || this.validateCombinations(data, schema, dataPointerPath) + || this.validateHypermedia(data, schema, dataPointerPath) + || this.validateFormat(data, schema, dataPointerPath) + || this.validateDefinedKeywords(data, schema, dataPointerPath) + || null; + + if (topLevel) { + while (this.scanned.length) { + var item = this.scanned.pop(); + delete item[this.validatedSchemasKey]; + } + this.scannedFrozen = []; + this.scannedFrozenSchemas = []; + } + + if (error || errorCount !== this.errors.length) { + while ((dataPathParts && dataPathParts.length) || (schemaPathParts && schemaPathParts.length)) { + var dataPart = (dataPathParts && dataPathParts.length) ? "" + dataPathParts.pop() : null; + var schemaPart = (schemaPathParts && schemaPathParts.length) ? "" + schemaPathParts.pop() : null; + if (error) { + error = error.prefixWith(dataPart, schemaPart); + } + this.prefixErrors(errorCount, dataPart, schemaPart); + } + } + + if (scannedFrozenSchemaIndex !== null) { + this.scannedFrozenValidationErrors[frozenIndex][scannedFrozenSchemaIndex] = this.errors.slice(startErrorCount); + } else if (scannedSchemasIndex !== null) { + data[this.validationErrorsKey][scannedSchemasIndex] = this.errors.slice(startErrorCount); + } + + return this.handleError(error); +}; +ValidatorContext.prototype.validateFormat = function (data, schema) { + if (typeof schema.format !== 'string' || !this.formatValidators[schema.format]) { + return null; + } + var errorMessage = this.formatValidators[schema.format].call(null, data, schema); + if (typeof errorMessage === 'string' || typeof errorMessage === 'number') { + return this.createError(ErrorCodes.FORMAT_CUSTOM, {message: errorMessage}, '', '/format', null, data, schema); + } else if (errorMessage && typeof errorMessage === 'object') { + return this.createError(ErrorCodes.FORMAT_CUSTOM, {message: errorMessage.message || "?"}, errorMessage.dataPath || '', errorMessage.schemaPath || "/format", null, data, schema); + } + return null; +}; +ValidatorContext.prototype.validateDefinedKeywords = function (data, schema, dataPointerPath) { + for (var key in this.definedKeywords) { + if (typeof schema[key] === 'undefined') { + continue; + } + var validationFunctions = this.definedKeywords[key]; + for (var i = 0; i < validationFunctions.length; i++) { + var func = validationFunctions[i]; + var result = func(data, schema[key], schema, dataPointerPath); + if (typeof result === 'string' || typeof result === 'number') { + return this.createError(ErrorCodes.KEYWORD_CUSTOM, {key: key, message: result}, '', '', null, data, schema).prefixWith(null, key); + } else if (result && typeof result === 'object') { + var code = result.code; + if (typeof code === 'string') { + if (!ErrorCodes[code]) { + throw new Error('Undefined error code (use defineError): ' + code); + } + code = ErrorCodes[code]; + } else if (typeof code !== 'number') { + code = ErrorCodes.KEYWORD_CUSTOM; + } + var messageParams = (typeof result.message === 'object') ? result.message : {key: key, message: result.message || "?"}; + var schemaPath = result.schemaPath || ("/" + key.replace(/~/g, '~0').replace(/\//g, '~1')); + return this.createError(code, messageParams, result.dataPath || null, schemaPath, null, data, schema); + } + } + } + return null; +}; + +function recursiveCompare(A, B) { + if (A === B) { + return true; + } + if (A && B && typeof A === "object" && typeof B === "object") { + if (Array.isArray(A) !== Array.isArray(B)) { + return false; + } else if (Array.isArray(A)) { + if (A.length !== B.length) { + return false; + } + for (var i = 0; i < A.length; i++) { + if (!recursiveCompare(A[i], B[i])) { + return false; + } + } + } else { + var key; + for (key in A) { + if (B[key] === undefined && A[key] !== undefined) { + return false; + } + } + for (key in B) { + if (A[key] === undefined && B[key] !== undefined) { + return false; + } + } + for (key in A) { + if (!recursiveCompare(A[key], B[key])) { + return false; + } + } + } + return true; + } + return false; +} + +ValidatorContext.prototype.validateBasic = function validateBasic(data, schema, dataPointerPath) { + var error; + if (error = this.validateType(data, schema, dataPointerPath)) { + return error.prefixWith(null, "type"); + } + if (error = this.validateEnum(data, schema, dataPointerPath)) { + return error.prefixWith(null, "type"); + } + return null; +}; + +ValidatorContext.prototype.validateType = function validateType(data, schema) { + if (schema.type === undefined) { + return null; + } + var dataType = typeof data; + if (data === null) { + dataType = "null"; + } else if (Array.isArray(data)) { + dataType = "array"; + } + var allowedTypes = schema.type; + if (!Array.isArray(allowedTypes)) { + allowedTypes = [allowedTypes]; + } + + for (var i = 0; i < allowedTypes.length; i++) { + var type = allowedTypes[i]; + if (type === dataType || (type === "integer" && dataType === "number" && (data % 1 === 0))) { + return null; + } + } + return this.createError(ErrorCodes.INVALID_TYPE, {type: dataType, expected: allowedTypes.join("/")}, '', '', null, data, schema); +}; + +ValidatorContext.prototype.validateEnum = function validateEnum(data, schema) { + if (schema["enum"] === undefined) { + return null; + } + for (var i = 0; i < schema["enum"].length; i++) { + var enumVal = schema["enum"][i]; + if (recursiveCompare(data, enumVal)) { + return null; + } + } + return this.createError(ErrorCodes.ENUM_MISMATCH, {value: (typeof JSON !== 'undefined') ? JSON.stringify(data) : data}, '', '', null, data, schema); +}; + +ValidatorContext.prototype.validateNumeric = function validateNumeric(data, schema, dataPointerPath) { + return this.validateMultipleOf(data, schema, dataPointerPath) + || this.validateMinMax(data, schema, dataPointerPath) + || this.validateNaN(data, schema, dataPointerPath) + || null; +}; + +var CLOSE_ENOUGH_LOW = Math.pow(2, -51); +var CLOSE_ENOUGH_HIGH = 1 - CLOSE_ENOUGH_LOW; +ValidatorContext.prototype.validateMultipleOf = function validateMultipleOf(data, schema) { + var multipleOf = schema.multipleOf || schema.divisibleBy; + if (multipleOf === undefined) { + return null; + } + if (typeof data === "number") { + var remainder = (data/multipleOf)%1; + if (remainder >= CLOSE_ENOUGH_LOW && remainder < CLOSE_ENOUGH_HIGH) { + return this.createError(ErrorCodes.NUMBER_MULTIPLE_OF, {value: data, multipleOf: multipleOf}, '', '', null, data, schema); + } + } + return null; +}; + +ValidatorContext.prototype.validateMinMax = function validateMinMax(data, schema) { + if (typeof data !== "number") { + return null; + } + if (schema.minimum !== undefined) { + if (data < schema.minimum) { + return this.createError(ErrorCodes.NUMBER_MINIMUM, {value: data, minimum: schema.minimum}, '', '/minimum', null, data, schema); + } + if (schema.exclusiveMinimum && data === schema.minimum) { + return this.createError(ErrorCodes.NUMBER_MINIMUM_EXCLUSIVE, {value: data, minimum: schema.minimum}, '', '/exclusiveMinimum', null, data, schema); + } + } + if (schema.maximum !== undefined) { + if (data > schema.maximum) { + return this.createError(ErrorCodes.NUMBER_MAXIMUM, {value: data, maximum: schema.maximum}, '', '/maximum', null, data, schema); + } + if (schema.exclusiveMaximum && data === schema.maximum) { + return this.createError(ErrorCodes.NUMBER_MAXIMUM_EXCLUSIVE, {value: data, maximum: schema.maximum}, '', '/exclusiveMaximum', null, data, schema); + } + } + return null; +}; + +ValidatorContext.prototype.validateNaN = function validateNaN(data, schema) { + if (typeof data !== "number") { + return null; + } + if (isNaN(data) === true || data === Infinity || data === -Infinity) { + return this.createError(ErrorCodes.NUMBER_NOT_A_NUMBER, {value: data}, '', '/type', null, data, schema); + } + return null; +}; + +ValidatorContext.prototype.validateString = function validateString(data, schema, dataPointerPath) { + return this.validateStringLength(data, schema, dataPointerPath) + || this.validateStringPattern(data, schema, dataPointerPath) + || null; +}; + +ValidatorContext.prototype.validateStringLength = function validateStringLength(data, schema) { + if (typeof data !== "string") { + return null; + } + if (schema.minLength !== undefined) { + if (data.length < schema.minLength) { + return this.createError(ErrorCodes.STRING_LENGTH_SHORT, {length: data.length, minimum: schema.minLength}, '', '/minLength', null, data, schema); + } + } + if (schema.maxLength !== undefined) { + if (data.length > schema.maxLength) { + return this.createError(ErrorCodes.STRING_LENGTH_LONG, {length: data.length, maximum: schema.maxLength}, '', '/maxLength', null, data, schema); + } + } + return null; +}; + +ValidatorContext.prototype.validateStringPattern = function validateStringPattern(data, schema) { + if (typeof data !== "string" || (typeof schema.pattern !== "string" && !(schema.pattern instanceof RegExp))) { + return null; + } + var regexp; + if (schema.pattern instanceof RegExp) { + regexp = schema.pattern; + } + else { + var body, flags = ''; + // Check for regular expression literals + // @see http://www.ecma-international.org/ecma-262/5.1/#sec-7.8.5 + var literal = schema.pattern.match(/^\/(.+)\/([img]*)$/); + if (literal) { + body = literal[1]; + flags = literal[2]; + } + else { + body = schema.pattern; + } + regexp = new RegExp(body, flags); + } + if (!regexp.test(data)) { + return this.createError(ErrorCodes.STRING_PATTERN, {pattern: schema.pattern}, '', '/pattern', null, data, schema); + } + return null; +}; + +ValidatorContext.prototype.validateArray = function validateArray(data, schema, dataPointerPath) { + if (!Array.isArray(data)) { + return null; + } + return this.validateArrayLength(data, schema, dataPointerPath) + || this.validateArrayUniqueItems(data, schema, dataPointerPath) + || this.validateArrayItems(data, schema, dataPointerPath) + || null; +}; + +ValidatorContext.prototype.validateArrayLength = function validateArrayLength(data, schema) { + var error; + if (schema.minItems !== undefined) { + if (data.length < schema.minItems) { + error = this.createError(ErrorCodes.ARRAY_LENGTH_SHORT, {length: data.length, minimum: schema.minItems}, '', '/minItems', null, data, schema); + if (this.handleError(error)) { + return error; + } + } + } + if (schema.maxItems !== undefined) { + if (data.length > schema.maxItems) { + error = this.createError(ErrorCodes.ARRAY_LENGTH_LONG, {length: data.length, maximum: schema.maxItems}, '', '/maxItems', null, data, schema); + if (this.handleError(error)) { + return error; + } + } + } + return null; +}; + +ValidatorContext.prototype.validateArrayUniqueItems = function validateArrayUniqueItems(data, schema) { + if (schema.uniqueItems) { + for (var i = 0; i < data.length; i++) { + for (var j = i + 1; j < data.length; j++) { + if (recursiveCompare(data[i], data[j])) { + var error = this.createError(ErrorCodes.ARRAY_UNIQUE, {match1: i, match2: j}, '', '/uniqueItems', null, data, schema); + if (this.handleError(error)) { + return error; + } + } + } + } + } + return null; +}; + +ValidatorContext.prototype.validateArrayItems = function validateArrayItems(data, schema, dataPointerPath) { + if (schema.items === undefined) { + return null; + } + var error, i; + if (Array.isArray(schema.items)) { + for (i = 0; i < data.length; i++) { + if (i < schema.items.length) { + if (error = this.validateAll(data[i], schema.items[i], [i], ["items", i], dataPointerPath + "/" + i)) { + return error; + } + } else if (schema.additionalItems !== undefined) { + if (typeof schema.additionalItems === "boolean") { + if (!schema.additionalItems) { + error = (this.createError(ErrorCodes.ARRAY_ADDITIONAL_ITEMS, {}, '/' + i, '/additionalItems', null, data, schema)); + if (this.handleError(error)) { + return error; + } + } + } else if (error = this.validateAll(data[i], schema.additionalItems, [i], ["additionalItems"], dataPointerPath + "/" + i)) { + return error; + } + } + } + } else { + for (i = 0; i < data.length; i++) { + if (error = this.validateAll(data[i], schema.items, [i], ["items"], dataPointerPath + "/" + i)) { + return error; + } + } + } + return null; +}; + +ValidatorContext.prototype.validateObject = function validateObject(data, schema, dataPointerPath) { + if (typeof data !== "object" || data === null || Array.isArray(data)) { + return null; + } + return this.validateObjectMinMaxProperties(data, schema, dataPointerPath) + || this.validateObjectRequiredProperties(data, schema, dataPointerPath) + || this.validateObjectProperties(data, schema, dataPointerPath) + || this.validateObjectDependencies(data, schema, dataPointerPath) + || null; +}; + +ValidatorContext.prototype.validateObjectMinMaxProperties = function validateObjectMinMaxProperties(data, schema) { + var keys = Object.keys(data); + var error; + if (schema.minProperties !== undefined) { + if (keys.length < schema.minProperties) { + error = this.createError(ErrorCodes.OBJECT_PROPERTIES_MINIMUM, {propertyCount: keys.length, minimum: schema.minProperties}, '', '/minProperties', null, data, schema); + if (this.handleError(error)) { + return error; + } + } + } + if (schema.maxProperties !== undefined) { + if (keys.length > schema.maxProperties) { + error = this.createError(ErrorCodes.OBJECT_PROPERTIES_MAXIMUM, {propertyCount: keys.length, maximum: schema.maxProperties}, '', '/maxProperties', null, data, schema); + if (this.handleError(error)) { + return error; + } + } + } + return null; +}; + +ValidatorContext.prototype.validateObjectRequiredProperties = function validateObjectRequiredProperties(data, schema) { + if (schema.required !== undefined) { + for (var i = 0; i < schema.required.length; i++) { + var key = schema.required[i]; + if (data[key] === undefined) { + var error = this.createError(ErrorCodes.OBJECT_REQUIRED, {key: key}, '', '/required/' + i, null, data, schema); + if (this.handleError(error)) { + return error; + } + } + } + } + return null; +}; + +ValidatorContext.prototype.validateObjectProperties = function validateObjectProperties(data, schema, dataPointerPath) { + var error; + for (var key in data) { + var keyPointerPath = dataPointerPath + "/" + key.replace(/~/g, '~0').replace(/\//g, '~1'); + var foundMatch = false; + if (schema.properties !== undefined && schema.properties[key] !== undefined) { + foundMatch = true; + if (error = this.validateAll(data[key], schema.properties[key], [key], ["properties", key], keyPointerPath)) { + return error; + } + } + if (schema.patternProperties !== undefined) { + for (var patternKey in schema.patternProperties) { + var regexp = new RegExp(patternKey); + if (regexp.test(key)) { + foundMatch = true; + if (error = this.validateAll(data[key], schema.patternProperties[patternKey], [key], ["patternProperties", patternKey], keyPointerPath)) { + return error; + } + } + } + } + if (!foundMatch) { + if (schema.additionalProperties !== undefined) { + if (this.trackUnknownProperties) { + this.knownPropertyPaths[keyPointerPath] = true; + delete this.unknownPropertyPaths[keyPointerPath]; + } + if (typeof schema.additionalProperties === "boolean") { + if (!schema.additionalProperties) { + error = this.createError(ErrorCodes.OBJECT_ADDITIONAL_PROPERTIES, {key: key}, '', '/additionalProperties', null, data, schema).prefixWith(key, null); + if (this.handleError(error)) { + return error; + } + } + } else { + if (error = this.validateAll(data[key], schema.additionalProperties, [key], ["additionalProperties"], keyPointerPath)) { + return error; + } + } + } else if (this.trackUnknownProperties && !this.knownPropertyPaths[keyPointerPath]) { + this.unknownPropertyPaths[keyPointerPath] = true; + } + } else if (this.trackUnknownProperties) { + this.knownPropertyPaths[keyPointerPath] = true; + delete this.unknownPropertyPaths[keyPointerPath]; + } + } + return null; +}; + +ValidatorContext.prototype.validateObjectDependencies = function validateObjectDependencies(data, schema, dataPointerPath) { + var error; + if (schema.dependencies !== undefined) { + for (var depKey in schema.dependencies) { + if (data[depKey] !== undefined) { + var dep = schema.dependencies[depKey]; + if (typeof dep === "string") { + if (data[dep] === undefined) { + error = this.createError(ErrorCodes.OBJECT_DEPENDENCY_KEY, {key: depKey, missing: dep}, '', '', null, data, schema).prefixWith(null, depKey).prefixWith(null, "dependencies"); + if (this.handleError(error)) { + return error; + } + } + } else if (Array.isArray(dep)) { + for (var i = 0; i < dep.length; i++) { + var requiredKey = dep[i]; + if (data[requiredKey] === undefined) { + error = this.createError(ErrorCodes.OBJECT_DEPENDENCY_KEY, {key: depKey, missing: requiredKey}, '', '/' + i, null, data, schema).prefixWith(null, depKey).prefixWith(null, "dependencies"); + if (this.handleError(error)) { + return error; + } + } + } + } else { + if (error = this.validateAll(data, dep, [], ["dependencies", depKey], dataPointerPath)) { + return error; + } + } + } + } + } + return null; +}; + +ValidatorContext.prototype.validateCombinations = function validateCombinations(data, schema, dataPointerPath) { + return this.validateAllOf(data, schema, dataPointerPath) + || this.validateAnyOf(data, schema, dataPointerPath) + || this.validateOneOf(data, schema, dataPointerPath) + || this.validateNot(data, schema, dataPointerPath) + || null; +}; + +ValidatorContext.prototype.validateAllOf = function validateAllOf(data, schema, dataPointerPath) { + if (schema.allOf === undefined) { + return null; + } + var error; + for (var i = 0; i < schema.allOf.length; i++) { + var subSchema = schema.allOf[i]; + if (error = this.validateAll(data, subSchema, [], ["allOf", i], dataPointerPath)) { + return error; + } + } + return null; +}; + +ValidatorContext.prototype.validateAnyOf = function validateAnyOf(data, schema, dataPointerPath) { + if (schema.anyOf === undefined) { + return null; + } + var errors = []; + var startErrorCount = this.errors.length; + var oldUnknownPropertyPaths, oldKnownPropertyPaths; + if (this.trackUnknownProperties) { + oldUnknownPropertyPaths = this.unknownPropertyPaths; + oldKnownPropertyPaths = this.knownPropertyPaths; + } + var errorAtEnd = true; + for (var i = 0; i < schema.anyOf.length; i++) { + if (this.trackUnknownProperties) { + this.unknownPropertyPaths = {}; + this.knownPropertyPaths = {}; + } + var subSchema = schema.anyOf[i]; + + var errorCount = this.errors.length; + var error = this.validateAll(data, subSchema, [], ["anyOf", i], dataPointerPath); + + if (error === null && errorCount === this.errors.length) { + this.errors = this.errors.slice(0, startErrorCount); + + if (this.trackUnknownProperties) { + for (var knownKey in this.knownPropertyPaths) { + oldKnownPropertyPaths[knownKey] = true; + delete oldUnknownPropertyPaths[knownKey]; + } + for (var unknownKey in this.unknownPropertyPaths) { + if (!oldKnownPropertyPaths[unknownKey]) { + oldUnknownPropertyPaths[unknownKey] = true; + } + } + // We need to continue looping so we catch all the property definitions, but we don't want to return an error + errorAtEnd = false; + continue; + } + + return null; + } + if (error) { + errors.push(error.prefixWith(null, "" + i).prefixWith(null, "anyOf")); + } + } + if (this.trackUnknownProperties) { + this.unknownPropertyPaths = oldUnknownPropertyPaths; + this.knownPropertyPaths = oldKnownPropertyPaths; + } + if (errorAtEnd) { + errors = errors.concat(this.errors.slice(startErrorCount)); + this.errors = this.errors.slice(0, startErrorCount); + return this.createError(ErrorCodes.ANY_OF_MISSING, {}, "", "/anyOf", errors, data, schema); + } +}; + +ValidatorContext.prototype.validateOneOf = function validateOneOf(data, schema, dataPointerPath) { + if (schema.oneOf === undefined) { + return null; + } + var validIndex = null; + var errors = []; + var startErrorCount = this.errors.length; + var oldUnknownPropertyPaths, oldKnownPropertyPaths; + if (this.trackUnknownProperties) { + oldUnknownPropertyPaths = this.unknownPropertyPaths; + oldKnownPropertyPaths = this.knownPropertyPaths; + } + for (var i = 0; i < schema.oneOf.length; i++) { + if (this.trackUnknownProperties) { + this.unknownPropertyPaths = {}; + this.knownPropertyPaths = {}; + } + var subSchema = schema.oneOf[i]; + + var errorCount = this.errors.length; + var error = this.validateAll(data, subSchema, [], ["oneOf", i], dataPointerPath); + + if (error === null && errorCount === this.errors.length) { + if (validIndex === null) { + validIndex = i; + } else { + this.errors = this.errors.slice(0, startErrorCount); + return this.createError(ErrorCodes.ONE_OF_MULTIPLE, {index1: validIndex, index2: i}, "", "/oneOf", null, data, schema); + } + if (this.trackUnknownProperties) { + for (var knownKey in this.knownPropertyPaths) { + oldKnownPropertyPaths[knownKey] = true; + delete oldUnknownPropertyPaths[knownKey]; + } + for (var unknownKey in this.unknownPropertyPaths) { + if (!oldKnownPropertyPaths[unknownKey]) { + oldUnknownPropertyPaths[unknownKey] = true; + } + } + } + } else if (error) { + errors.push(error); + } + } + if (this.trackUnknownProperties) { + this.unknownPropertyPaths = oldUnknownPropertyPaths; + this.knownPropertyPaths = oldKnownPropertyPaths; + } + if (validIndex === null) { + errors = errors.concat(this.errors.slice(startErrorCount)); + this.errors = this.errors.slice(0, startErrorCount); + return this.createError(ErrorCodes.ONE_OF_MISSING, {}, "", "/oneOf", errors, data, schema); + } else { + this.errors = this.errors.slice(0, startErrorCount); + } + return null; +}; + +ValidatorContext.prototype.validateNot = function validateNot(data, schema, dataPointerPath) { + if (schema.not === undefined) { + return null; + } + var oldErrorCount = this.errors.length; + var oldUnknownPropertyPaths, oldKnownPropertyPaths; + if (this.trackUnknownProperties) { + oldUnknownPropertyPaths = this.unknownPropertyPaths; + oldKnownPropertyPaths = this.knownPropertyPaths; + this.unknownPropertyPaths = {}; + this.knownPropertyPaths = {}; + } + var error = this.validateAll(data, schema.not, null, null, dataPointerPath); + var notErrors = this.errors.slice(oldErrorCount); + this.errors = this.errors.slice(0, oldErrorCount); + if (this.trackUnknownProperties) { + this.unknownPropertyPaths = oldUnknownPropertyPaths; + this.knownPropertyPaths = oldKnownPropertyPaths; + } + if (error === null && notErrors.length === 0) { + return this.createError(ErrorCodes.NOT_PASSED, {}, "", "/not", null, data, schema); + } + return null; +}; + +ValidatorContext.prototype.validateHypermedia = function validateCombinations(data, schema, dataPointerPath) { + if (!schema.links) { + return null; + } + var error; + for (var i = 0; i < schema.links.length; i++) { + var ldo = schema.links[i]; + if (ldo.rel === "describedby") { + var template = new UriTemplate(ldo.href); + var allPresent = true; + for (var j = 0; j < template.varNames.length; j++) { + if (!(template.varNames[j] in data)) { + allPresent = false; + break; + } + } + if (allPresent) { + var schemaUrl = template.fillFromObject(data); + var subSchema = {"$ref": schemaUrl}; + if (error = this.validateAll(data, subSchema, [], ["links", i], dataPointerPath)) { + return error; + } + } + } + } +}; + +// parseURI() and resolveUrl() are from https://gist.github.com/1088850 +// - released as public domain by author ("Yaffle") - see comments on gist + +function parseURI(url) { + var m = String(url).replace(/^\s+|\s+$/g, '').match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/); + // authority = '//' + user + ':' + pass '@' + hostname + ':' port + return (m ? { + href : m[0] || '', + protocol : m[1] || '', + authority: m[2] || '', + host : m[3] || '', + hostname : m[4] || '', + port : m[5] || '', + pathname : m[6] || '', + search : m[7] || '', + hash : m[8] || '' + } : null); +} + +function resolveUrl(base, href) {// RFC 3986 + + function removeDotSegments(input) { + var output = []; + input.replace(/^(\.\.?(\/|$))+/, '') + .replace(/\/(\.(\/|$))+/g, '/') + .replace(/\/\.\.$/, '/../') + .replace(/\/?[^\/]*/g, function (p) { + if (p === '/..') { + output.pop(); + } else { + output.push(p); + } + }); + return output.join('').replace(/^\//, input.charAt(0) === '/' ? '/' : ''); + } + + href = parseURI(href || ''); + base = parseURI(base || ''); + + return !href || !base ? null : (href.protocol || base.protocol) + + (href.protocol || href.authority ? href.authority : base.authority) + + removeDotSegments(href.protocol || href.authority || href.pathname.charAt(0) === '/' ? href.pathname : (href.pathname ? ((base.authority && !base.pathname ? '/' : '') + base.pathname.slice(0, base.pathname.lastIndexOf('/') + 1) + href.pathname) : base.pathname)) + + (href.protocol || href.authority || href.pathname ? href.search : (href.search || base.search)) + + href.hash; +} + +function getDocumentUri(uri) { + return uri.split('#')[0]; +} +function normSchema(schema, baseUri) { + if (schema && typeof schema === "object") { + if (baseUri === undefined) { + baseUri = schema.id; + } else if (typeof schema.id === "string") { + baseUri = resolveUrl(baseUri, schema.id); + schema.id = baseUri; + } + if (Array.isArray(schema)) { + for (var i = 0; i < schema.length; i++) { + normSchema(schema[i], baseUri); + } + } else { + if (typeof schema['$ref'] === "string") { + schema['$ref'] = resolveUrl(baseUri, schema['$ref']); + } + for (var key in schema) { + if (key !== "enum") { + normSchema(schema[key], baseUri); + } + } + } + } +} + +function defaultErrorReporter(language) { + language = language || 'en'; + + var errorMessages = languages[language]; + + return function (error) { + var messageTemplate = errorMessages[error.code] || ErrorMessagesDefault[error.code]; + if (typeof messageTemplate !== 'string') { + return "Unknown error code " + error.code + ": " + JSON.stringify(error.messageParams); + } + var messageParams = error.params; + // Adapted from Crockford's supplant() + return messageTemplate.replace(/\{([^{}]*)\}/g, function (whole, varName) { + var subValue = messageParams[varName]; + return typeof subValue === 'string' || typeof subValue === 'number' ? subValue : whole; + }); + }; +} + +var ErrorCodes = { + INVALID_TYPE: 0, + ENUM_MISMATCH: 1, + ANY_OF_MISSING: 10, + ONE_OF_MISSING: 11, + ONE_OF_MULTIPLE: 12, + NOT_PASSED: 13, + // Numeric errors + NUMBER_MULTIPLE_OF: 100, + NUMBER_MINIMUM: 101, + NUMBER_MINIMUM_EXCLUSIVE: 102, + NUMBER_MAXIMUM: 103, + NUMBER_MAXIMUM_EXCLUSIVE: 104, + NUMBER_NOT_A_NUMBER: 105, + // String errors + STRING_LENGTH_SHORT: 200, + STRING_LENGTH_LONG: 201, + STRING_PATTERN: 202, + // Object errors + OBJECT_PROPERTIES_MINIMUM: 300, + OBJECT_PROPERTIES_MAXIMUM: 301, + OBJECT_REQUIRED: 302, + OBJECT_ADDITIONAL_PROPERTIES: 303, + OBJECT_DEPENDENCY_KEY: 304, + // Array errors + ARRAY_LENGTH_SHORT: 400, + ARRAY_LENGTH_LONG: 401, + ARRAY_UNIQUE: 402, + ARRAY_ADDITIONAL_ITEMS: 403, + // Custom/user-defined errors + FORMAT_CUSTOM: 500, + KEYWORD_CUSTOM: 501, + // Schema structure + CIRCULAR_REFERENCE: 600, + // Non-standard validation options + UNKNOWN_PROPERTY: 1000 +}; +var ErrorCodeLookup = {}; +for (var key in ErrorCodes) { + ErrorCodeLookup[ErrorCodes[key]] = key; +} +var ErrorMessagesDefault = { + INVALID_TYPE: "Invalid type: {type} (expected {expected})", + ENUM_MISMATCH: "No enum match for: {value}", + ANY_OF_MISSING: "Data does not match any schemas from \"anyOf\"", + ONE_OF_MISSING: "Data does not match any schemas from \"oneOf\"", + ONE_OF_MULTIPLE: "Data is valid against more than one schema from \"oneOf\": indices {index1} and {index2}", + NOT_PASSED: "Data matches schema from \"not\"", + // Numeric errors + NUMBER_MULTIPLE_OF: "Value {value} is not a multiple of {multipleOf}", + NUMBER_MINIMUM: "Value {value} is less than minimum {minimum}", + NUMBER_MINIMUM_EXCLUSIVE: "Value {value} is equal to exclusive minimum {minimum}", + NUMBER_MAXIMUM: "Value {value} is greater than maximum {maximum}", + NUMBER_MAXIMUM_EXCLUSIVE: "Value {value} is equal to exclusive maximum {maximum}", + NUMBER_NOT_A_NUMBER: "Value {value} is not a valid number", + // String errors + STRING_LENGTH_SHORT: "String is too short ({length} chars), minimum {minimum}", + STRING_LENGTH_LONG: "String is too long ({length} chars), maximum {maximum}", + STRING_PATTERN: "String does not match pattern: {pattern}", + // Object errors + OBJECT_PROPERTIES_MINIMUM: "Too few properties defined ({propertyCount}), minimum {minimum}", + OBJECT_PROPERTIES_MAXIMUM: "Too many properties defined ({propertyCount}), maximum {maximum}", + OBJECT_REQUIRED: "Missing required property: {key}", + OBJECT_ADDITIONAL_PROPERTIES: "Additional properties not allowed", + OBJECT_DEPENDENCY_KEY: "Dependency failed - key must exist: {missing} (due to key: {key})", + // Array errors + ARRAY_LENGTH_SHORT: "Array is too short ({length}), minimum {minimum}", + ARRAY_LENGTH_LONG: "Array is too long ({length}), maximum {maximum}", + ARRAY_UNIQUE: "Array items are not unique (indices {match1} and {match2})", + ARRAY_ADDITIONAL_ITEMS: "Additional items not allowed", + // Format errors + FORMAT_CUSTOM: "Format validation failed ({message})", + KEYWORD_CUSTOM: "Keyword failed: {key} ({message})", + // Schema structure + CIRCULAR_REFERENCE: "Circular $refs: {urls}", + // Non-standard validation options + UNKNOWN_PROPERTY: "Unknown property (not in schema)" +}; + +function ValidationError(code, params, dataPath, schemaPath, subErrors) { + Error.call(this); + if (code === undefined) { + throw new Error ("No error code supplied: " + schemaPath); + } + this.message = ''; + this.params = params; + this.code = code; + this.dataPath = dataPath || ""; + this.schemaPath = schemaPath || ""; + this.subErrors = subErrors || null; + + var err = new Error(this.message); + this.stack = err.stack || err.stacktrace; + if (!this.stack) { + try { + throw err; + } + catch(err) { + this.stack = err.stack || err.stacktrace; + } + } +} +ValidationError.prototype = Object.create(Error.prototype); +ValidationError.prototype.constructor = ValidationError; +ValidationError.prototype.name = 'ValidationError'; + +ValidationError.prototype.prefixWith = function (dataPrefix, schemaPrefix) { + if (dataPrefix !== null) { + dataPrefix = dataPrefix.replace(/~/g, "~0").replace(/\//g, "~1"); + this.dataPath = "/" + dataPrefix + this.dataPath; + } + if (schemaPrefix !== null) { + schemaPrefix = schemaPrefix.replace(/~/g, "~0").replace(/\//g, "~1"); + this.schemaPath = "/" + schemaPrefix + this.schemaPath; + } + if (this.subErrors !== null) { + for (var i = 0; i < this.subErrors.length; i++) { + this.subErrors[i].prefixWith(dataPrefix, schemaPrefix); + } + } + return this; +}; + +function isTrustedUrl(baseUrl, testUrl) { + if(testUrl.substring(0, baseUrl.length) === baseUrl){ + var remainder = testUrl.substring(baseUrl.length); + if ((testUrl.length > 0 && testUrl.charAt(baseUrl.length - 1) === "/") + || remainder.charAt(0) === "#" + || remainder.charAt(0) === "?") { + return true; + } + } + return false; +} + +var languages = {}; +function createApi(language) { + var globalContext = new ValidatorContext(); + var currentLanguage; + var customErrorReporter; + var api = { + setErrorReporter: function (reporter) { + if (typeof reporter === 'string') { + return this.language(reporter); + } + customErrorReporter = reporter; + return true; + }, + addFormat: function () { + globalContext.addFormat.apply(globalContext, arguments); + }, + language: function (code) { + if (!code) { + return currentLanguage; + } + if (!languages[code]) { + code = code.split('-')[0]; // fall back to base language + } + if (languages[code]) { + currentLanguage = code; + return code; // so you can tell if fall-back has happened + } + return false; + }, + addLanguage: function (code, messageMap) { + var key; + for (key in ErrorCodes) { + if (messageMap[key] && !messageMap[ErrorCodes[key]]) { + messageMap[ErrorCodes[key]] = messageMap[key]; + } + } + var rootCode = code.split('-')[0]; + if (!languages[rootCode]) { // use for base language if not yet defined + languages[code] = messageMap; + languages[rootCode] = messageMap; + } else { + languages[code] = Object.create(languages[rootCode]); + for (key in messageMap) { + if (typeof languages[rootCode][key] === 'undefined') { + languages[rootCode][key] = messageMap[key]; + } + languages[code][key] = messageMap[key]; + } + } + return this; + }, + freshApi: function (language) { + var result = createApi(); + if (language) { + result.language(language); + } + return result; + }, + validate: function (data, schema, checkRecursive, banUnknownProperties) { + var def = defaultErrorReporter(currentLanguage); + var errorReporter = customErrorReporter ? function (error, data, schema) { + return customErrorReporter(error, data, schema) || def(error, data, schema); + } : def; + var context = new ValidatorContext(globalContext, false, errorReporter, checkRecursive, banUnknownProperties); + if (typeof schema === "string") { + schema = {"$ref": schema}; + } + context.addSchema("", schema); + var error = context.validateAll(data, schema, null, null, ""); + if (!error && banUnknownProperties) { + error = context.banUnknownProperties(data, schema); + } + this.error = error; + this.missing = context.missing; + this.valid = (error === null); + return this.valid; + }, + validateResult: function () { + var result = {}; + this.validate.apply(result, arguments); + return result; + }, + validateMultiple: function (data, schema, checkRecursive, banUnknownProperties) { + var def = defaultErrorReporter(currentLanguage); + var errorReporter = customErrorReporter ? function (error, data, schema) { + return customErrorReporter(error, data, schema) || def(error, data, schema); + } : def; + var context = new ValidatorContext(globalContext, true, errorReporter, checkRecursive, banUnknownProperties); + if (typeof schema === "string") { + schema = {"$ref": schema}; + } + context.addSchema("", schema); + context.validateAll(data, schema, null, null, ""); + if (banUnknownProperties) { + context.banUnknownProperties(data, schema); + } + var result = {}; + result.errors = context.errors; + result.missing = context.missing; + result.valid = (result.errors.length === 0); + return result; + }, + addSchema: function () { + return globalContext.addSchema.apply(globalContext, arguments); + }, + getSchema: function () { + return globalContext.getSchema.apply(globalContext, arguments); + }, + getSchemaMap: function () { + return globalContext.getSchemaMap.apply(globalContext, arguments); + }, + getSchemaUris: function () { + return globalContext.getSchemaUris.apply(globalContext, arguments); + }, + getMissingUris: function () { + return globalContext.getMissingUris.apply(globalContext, arguments); + }, + dropSchemas: function () { + globalContext.dropSchemas.apply(globalContext, arguments); + }, + defineKeyword: function () { + globalContext.defineKeyword.apply(globalContext, arguments); + }, + defineError: function (codeName, codeNumber, defaultMessage) { + if (typeof codeName !== 'string' || !/^[A-Z]+(_[A-Z]+)*$/.test(codeName)) { + throw new Error('Code name must be a string in UPPER_CASE_WITH_UNDERSCORES'); + } + if (typeof codeNumber !== 'number' || codeNumber%1 !== 0 || codeNumber < 10000) { + throw new Error('Code number must be an integer > 10000'); + } + if (typeof ErrorCodes[codeName] !== 'undefined') { + throw new Error('Error already defined: ' + codeName + ' as ' + ErrorCodes[codeName]); + } + if (typeof ErrorCodeLookup[codeNumber] !== 'undefined') { + throw new Error('Error code already used: ' + ErrorCodeLookup[codeNumber] + ' as ' + codeNumber); + } + ErrorCodes[codeName] = codeNumber; + ErrorCodeLookup[codeNumber] = codeName; + ErrorMessagesDefault[codeName] = ErrorMessagesDefault[codeNumber] = defaultMessage; + for (var langCode in languages) { + var language = languages[langCode]; + if (language[codeName]) { + language[codeNumber] = language[codeNumber] || language[codeName]; + } + } + }, + reset: function () { + globalContext.reset(); + this.error = null; + this.missing = []; + this.valid = true; + }, + missing: [], + error: null, + valid: true, + normSchema: normSchema, + resolveUrl: resolveUrl, + getDocumentUri: getDocumentUri, + errorCodes: ErrorCodes + }; + api.language(language || 'en'); + return api; +} + +var tv4 = createApi(); +tv4.addLanguage('en-gb', ErrorMessagesDefault); + +//legacy property +tv4.tv4 = tv4; + +return tv4; // used by _header.js to globalise. + +})); \ No newline at end of file diff --git a/tools/eslint/node_modules/optionator/node_modules/type-check/LICENSE b/tools/eslint/node_modules/type-check/LICENSE similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/type-check/LICENSE rename to tools/eslint/node_modules/type-check/LICENSE diff --git a/tools/eslint/node_modules/type-check/README.md b/tools/eslint/node_modules/type-check/README.md new file mode 100644 index 00000000000000..ec92d5930b9566 --- /dev/null +++ b/tools/eslint/node_modules/type-check/README.md @@ -0,0 +1,210 @@ +# type-check [![Build Status](https://travis-ci.org/gkz/type-check.png?branch=master)](https://travis-ci.org/gkz/type-check) + +
      + +`type-check` is a library which allows you to check the types of JavaScript values at runtime with a Haskell like type syntax. It is great for checking external input, for testing, or even for adding a bit of safety to your internal code. It is a major component of [levn](https://github.com/gkz/levn). MIT license. Version 0.3.2. Check out the [demo](http://gkz.github.io/type-check/). + +For updates on `type-check`, [follow me on twitter](https://twitter.com/gkzahariev). + + npm install type-check + +## Quick Examples + +```js +// Basic types: +var typeCheck = require('type-check').typeCheck; +typeCheck('Number', 1); // true +typeCheck('Number', 'str'); // false +typeCheck('Error', new Error); // true +typeCheck('Undefined', undefined); // true + +// Comment +typeCheck('count::Number', 1); // true + +// One type OR another type: +typeCheck('Number | String', 2); // true +typeCheck('Number | String', 'str'); // true + +// Wildcard, matches all types: +typeCheck('*', 2) // true + +// Array, all elements of a single type: +typeCheck('[Number]', [1, 2, 3]); // true +typeCheck('[Number]', [1, 'str', 3]); // false + +// Tuples, or fixed length arrays with elements of different types: +typeCheck('(String, Number)', ['str', 2]); // true +typeCheck('(String, Number)', ['str']); // false +typeCheck('(String, Number)', ['str', 2, 5]); // false + +// Object properties: +typeCheck('{x: Number, y: Boolean}', {x: 2, y: false}); // true +typeCheck('{x: Number, y: Boolean}', {x: 2}); // false +typeCheck('{x: Number, y: Maybe Boolean}', {x: 2}); // true +typeCheck('{x: Number, y: Boolean}', {x: 2, y: false, z: 3}); // false +typeCheck('{x: Number, y: Boolean, ...}', {x: 2, y: false, z: 3}); // true + +// A particular type AND object properties: +typeCheck('RegExp{source: String, ...}', /re/i); // true +typeCheck('RegExp{source: String, ...}', {source: 're'}); // false + +// Custom types: +var opt = {customTypes: + {Even: { typeOf: 'Number', validate: function(x) { return x % 2 === 0; }}}}; +typeCheck('Even', 2, opt); // true + +// Nested: +var type = '{a: (String, [Number], {y: Array, ...}), b: Error{message: String, ...}}' +typeCheck(type, {a: ['hi', [1, 2, 3], {y: [1, 'ms']}], b: new Error('oh no')}); // true +``` + +Check out the [type syntax format](#syntax) and [guide](#guide). + +## Usage + +`require('type-check');` returns an object that exposes four properties. `VERSION` is the current version of the library as a string. `typeCheck`, `parseType`, and `parsedTypeCheck` are functions. + +```js +// typeCheck(type, input, options); +typeCheck('Number', 2); // true + +// parseType(type); +var parsedType = parseType('Number'); // object + +// parsedTypeCheck(parsedType, input, options); +parsedTypeCheck(parsedType, 2); // true +``` + +### typeCheck(type, input, options) + +`typeCheck` checks a JavaScript value `input` against `type` written in the [type format](#type-format) (and taking account the optional `options`) and returns whether the `input` matches the `type`. + +##### arguments +* type - `String` - the type written in the [type format](#type-format) which to check against +* input - `*` - any JavaScript value, which is to be checked against the type +* options - `Maybe Object` - an optional parameter specifying additional options, currently the only available option is specifying [custom types](#custom-types) + +##### returns +`Boolean` - whether the input matches the type + +##### example +```js +typeCheck('Number', 2); // true +``` + +### parseType(type) + +`parseType` parses string `type` written in the [type format](#type-format) into an object representing the parsed type. + +##### arguments +* type - `String` - the type written in the [type format](#type-format) which to parse + +##### returns +`Object` - an object in the parsed type format representing the parsed type + +##### example +```js +parseType('Number'); // [{type: 'Number'}] +``` +### parsedTypeCheck(parsedType, input, options) + +`parsedTypeCheck` checks a JavaScript value `input` against parsed `type` in the parsed type format (and taking account the optional `options`) and returns whether the `input` matches the `type`. Use this in conjunction with `parseType` if you are going to use a type more than once. + +##### arguments +* type - `Object` - the type in the parsed type format which to check against +* input - `*` - any JavaScript value, which is to be checked against the type +* options - `Maybe Object` - an optional parameter specifying additional options, currently the only available option is specifying [custom types](#custom-types) + +##### returns +`Boolean` - whether the input matches the type + +##### example +```js +parsedTypeCheck([{type: 'Number'}], 2); // true +var parsedType = parseType('String'); +parsedTypeCheck(parsedType, 'str'); // true +``` + + +## Type Format + +### Syntax + +White space is ignored. The root node is a __Types__. + +* __Identifier__ = `[\$\w]+` - a group of any lower or upper case letters, numbers, underscores, or dollar signs - eg. `String` +* __Type__ = an `Identifier`, an `Identifier` followed by a `Structure`, just a `Structure`, or a wildcard `*` - eg. `String`, `Object{x: Number}`, `{x: Number}`, `Array{0: String, 1: Boolean, length: Number}`, `*` +* __Types__ = optionally a comment (an `Indentifier` followed by a `::`), optionally the identifier `Maybe`, one or more `Type`, separated by `|` - eg. `Number`, `String | Date`, `Maybe Number`, `Maybe Boolean | String` +* __Structure__ = `Fields`, or a `Tuple`, or an `Array` - eg. `{x: Number}`, `(String, Number)`, `[Date]` +* __Fields__ = a `{`, followed one or more `Field` separated by a comma `,` (trailing comma `,` is permitted), optionally an `...` (always preceded by a comma `,`), followed by a `}` - eg. `{x: Number, y: String}`, `{k: Function, ...}` +* __Field__ = an `Identifier`, followed by a colon `:`, followed by `Types` - eg. `x: Date | String`, `y: Boolean` +* __Tuple__ = a `(`, followed by one or more `Types` separated by a comma `,` (trailing comma `,` is permitted), followed by a `)` - eg `(Date)`, `(Number, Date)` +* __Array__ = a `[` followed by exactly one `Types` followed by a `]` - eg. `[Boolean]`, `[Boolean | Null]` + +### Guide + +`type-check` uses `Object.toString` to find out the basic type of a value. Specifically, + +```js +{}.toString.call(VALUE).slice(8, -1) +{}.toString.call(true).slice(8, -1) // 'Boolean' +``` +A basic type, eg. `Number`, uses this check. This is much more versatile than using `typeof` - for example, with `document`, `typeof` produces `'object'` which isn't that useful, and our technique produces `'HTMLDocument'`. + +You may check for multiple types by separating types with a `|`. The checker proceeds from left to right, and passes if the value is any of the types - eg. `String | Boolean` first checks if the value is a string, and then if it is a boolean. If it is none of those, then it returns false. + +Adding a `Maybe` in front of a list of multiple types is the same as also checking for `Null` and `Undefined` - eg. `Maybe String` is equivalent to `Undefined | Null | String`. + +You may add a comment to remind you of what the type is for by following an identifier with a `::` before a type (or multiple types). The comment is simply thrown out. + +The wildcard `*` matches all types. + +There are three types of structures for checking the contents of a value: 'fields', 'tuple', and 'array'. + +If used by itself, a 'fields' structure will pass with any type of object as long as it is an instance of `Object` and the properties pass - this allows for duck typing - eg. `{x: Boolean}`. + +To check if the properties pass, and the value is of a certain type, you can specify the type - eg. `Error{message: String}`. + +If you want to make a field optional, you can simply use `Maybe` - eg. `{x: Boolean, y: Maybe String}` will still pass if `y` is undefined (or null). + +If you don't care if the value has properties beyond what you have specified, you can use the 'etc' operator `...` - eg. `{x: Boolean, ...}` will match an object with an `x` property that is a boolean, and with zero or more other properties. + +For an array, you must specify one or more types (separated by `|`) - it will pass for something of any length as long as each element passes the types provided - eg. `[Number]`, `[Number | String]`. + +A tuple checks for a fixed number of elements, each of a potentially different type. Each element is separated by a comma - eg. `(String, Number)`. + +An array and tuple structure check that the value is of type `Array` by default, but if another type is specified, they will check for that instead - eg. `Int32Array[Number]`. You can use the wildcard `*` to search for any type at all. + +Check out the [type precedence](https://github.com/zaboco/type-precedence) library for type-check. + +## Options + +Options is an object. It is an optional parameter to the `typeCheck` and `parsedTypeCheck` functions. The only current option is `customTypes`. + + +### Custom Types + +__Example:__ + +```js +var options = { + customTypes: { + Even: { + typeOf: 'Number', + validate: function(x) { + return x % 2 === 0; + } + } + } +}; +typeCheck('Even', 2, options); // true +typeCheck('Even', 3, options); // false +``` + +`customTypes` allows you to set up custom types for validation. The value of this is an object. The keys of the object are the types you will be matching. Each value of the object will be an object having a `typeOf` property - a string, and `validate` property - a function. + +The `typeOf` property is the type the value should be, and `validate` is a function which should return true if the value is of that type. `validate` receives one parameter, which is the value that we are checking. + +## Technical About + +`type-check` is written in [LiveScript](http://livescript.net/) - a language that compiles to JavaScript. It also uses the [prelude.ls](http://preludels.com/) library. diff --git a/tools/eslint/node_modules/optionator/node_modules/type-check/lib/check.js b/tools/eslint/node_modules/type-check/lib/check.js similarity index 99% rename from tools/eslint/node_modules/optionator/node_modules/type-check/lib/check.js rename to tools/eslint/node_modules/type-check/lib/check.js index c1e51ff90b0173..0504c8d2f4aceb 100644 --- a/tools/eslint/node_modules/optionator/node_modules/type-check/lib/check.js +++ b/tools/eslint/node_modules/type-check/lib/check.js @@ -1,4 +1,4 @@ -// Generated by LiveScript 1.2.0 +// Generated by LiveScript 1.4.0 (function(){ var ref$, any, all, isItNaN, types, defaultType, customTypes, toString$ = {}.toString; ref$ = require('prelude-ls'), any = ref$.any, all = ref$.all, isItNaN = ref$.isItNaN; diff --git a/tools/eslint/node_modules/type-check/lib/index.js b/tools/eslint/node_modules/type-check/lib/index.js new file mode 100644 index 00000000000000..f3316bab490280 --- /dev/null +++ b/tools/eslint/node_modules/type-check/lib/index.js @@ -0,0 +1,16 @@ +// Generated by LiveScript 1.4.0 +(function(){ + var VERSION, parseType, parsedTypeCheck, typeCheck; + VERSION = '0.3.2'; + parseType = require('./parse-type'); + parsedTypeCheck = require('./check'); + typeCheck = function(type, input, options){ + return parsedTypeCheck(parseType(type), input, options); + }; + module.exports = { + VERSION: VERSION, + typeCheck: typeCheck, + parsedTypeCheck: parsedTypeCheck, + parseType: parseType + }; +}).call(this); diff --git a/tools/eslint/node_modules/optionator/node_modules/type-check/lib/parse-type.js b/tools/eslint/node_modules/type-check/lib/parse-type.js similarity index 99% rename from tools/eslint/node_modules/optionator/node_modules/type-check/lib/parse-type.js rename to tools/eslint/node_modules/type-check/lib/parse-type.js index 32c3a460e33644..5baf661faec65f 100644 --- a/tools/eslint/node_modules/optionator/node_modules/type-check/lib/parse-type.js +++ b/tools/eslint/node_modules/type-check/lib/parse-type.js @@ -1,4 +1,4 @@ -// Generated by LiveScript 1.2.0 +// Generated by LiveScript 1.4.0 (function(){ var identifierRegex, tokenRegex; identifierRegex = /[\$\w]+/; diff --git a/tools/eslint/node_modules/type-check/package.json b/tools/eslint/node_modules/type-check/package.json new file mode 100644 index 00000000000000..fd9f152366d434 --- /dev/null +++ b/tools/eslint/node_modules/type-check/package.json @@ -0,0 +1,94 @@ +{ + "_args": [ + [ + "type-check@~0.3.2", + "/Users/silverwind/git/node/tools/package/package/node_modules/optionator" + ] + ], + "_from": "type-check@>=0.3.2 <0.4.0", + "_id": "type-check@0.3.2", + "_inCache": true, + "_installable": true, + "_location": "/type-check", + "_nodeVersion": "4.2.4", + "_npmUser": { + "email": "z@georgezahariev.com", + "name": "gkz" + }, + "_npmVersion": "2.14.12", + "_phantomChildren": {}, + "_requested": { + "name": "type-check", + "raw": "type-check@~0.3.2", + "rawSpec": "~0.3.2", + "scope": null, + "spec": ">=0.3.2 <0.4.0", + "type": "range" + }, + "_requiredBy": [ + "/levn", + "/optionator" + ], + "_resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "_shasum": "5884cab512cf1d355e3fb784f30804b2b520db72", + "_shrinkwrap": null, + "_spec": "type-check@~0.3.2", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/optionator", + "author": { + "email": "z@georgezahariev.com", + "name": "George Zahariev" + }, + "bugs": { + "url": "https://github.com/gkz/type-check/issues" + }, + "dependencies": { + "prelude-ls": "~1.1.2" + }, + "description": "type-check allows you to check the types of JavaScript values at runtime with a Haskell like type syntax.", + "devDependencies": { + "browserify": "~12.0.1", + "istanbul": "~0.4.1", + "livescript": "~1.4.0", + "mocha": "~2.3.4" + }, + "directories": {}, + "dist": { + "shasum": "5884cab512cf1d355e3fb784f30804b2b520db72", + "tarball": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz" + }, + "engines": { + "node": ">= 0.8.0" + }, + "files": [ + "LICENSE", + "README.md", + "lib" + ], + "gitHead": "0ab04e7a660485d0cc3aa87e95f2f9a6464cf8e6", + "homepage": "https://github.com/gkz/type-check", + "keywords": [ + "check", + "checking", + "library", + "type" + ], + "license": "MIT", + "main": "./lib/", + "maintainers": [ + { + "name": "gkz", + "email": "z@georgezahariev.com" + } + ], + "name": "type-check", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/gkz/type-check.git" + }, + "scripts": { + "test": "make test" + }, + "version": "0.3.2" +} diff --git a/tools/eslint/node_modules/concat-stream/node_modules/typedarray/LICENSE b/tools/eslint/node_modules/typedarray/LICENSE similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/typedarray/LICENSE rename to tools/eslint/node_modules/typedarray/LICENSE diff --git a/tools/eslint/node_modules/concat-stream/node_modules/typedarray/index.js b/tools/eslint/node_modules/typedarray/index.js similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/typedarray/index.js rename to tools/eslint/node_modules/typedarray/index.js diff --git a/tools/eslint/node_modules/typedarray/package.json b/tools/eslint/node_modules/typedarray/package.json new file mode 100644 index 00000000000000..900eaa0f230322 --- /dev/null +++ b/tools/eslint/node_modules/typedarray/package.json @@ -0,0 +1,105 @@ +{ + "_args": [ + [ + "typedarray@~0.0.5", + "/Users/silverwind/git/node/tools/package/package/node_modules/concat-stream" + ] + ], + "_from": "typedarray@>=0.0.5 <0.1.0", + "_id": "typedarray@0.0.6", + "_inCache": true, + "_installable": true, + "_location": "/typedarray", + "_npmUser": { + "email": "mail@substack.net", + "name": "substack" + }, + "_npmVersion": "1.4.3", + "_phantomChildren": {}, + "_requested": { + "name": "typedarray", + "raw": "typedarray@~0.0.5", + "rawSpec": "~0.0.5", + "scope": null, + "spec": ">=0.0.5 <0.1.0", + "type": "range" + }, + "_requiredBy": [ + "/concat-stream" + ], + "_resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "_shasum": "867ac74e3864187b1d3d47d996a78ec5c8830777", + "_shrinkwrap": null, + "_spec": "typedarray@~0.0.5", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/concat-stream", + "author": { + "email": "mail@substack.net", + "name": "James Halliday", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/typedarray/issues" + }, + "dependencies": {}, + "description": "TypedArray polyfill for old browsers", + "devDependencies": { + "tape": "~2.3.2" + }, + "directories": {}, + "dist": { + "shasum": "867ac74e3864187b1d3d47d996a78ec5c8830777", + "tarball": "http://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz" + }, + "homepage": "https://github.com/substack/typedarray", + "keywords": [ + "ArrayBuffer", + "DataView", + "Float32Array", + "Float64Array", + "Int16Array", + "Int32Array", + "Int8Array", + "Uint16Array", + "Uint32Array", + "Uint8Array", + "Uint8ClampedArray", + "array", + "polyfill", + "typed" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "name": "typedarray", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/substack/typedarray.git" + }, + "scripts": { + "test": "tape test/*.js test/server/*.js" + }, + "testling": { + "browsers": [ + "android-browser/4.2..latest", + "chrome/22..latest", + "chrome/canary", + "firefox/16..latest", + "firefox/nightly", + "ie/6..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "opera/12..latest", + "opera/next", + "safari/5.1..latest" + ], + "files": "test/*.js" + }, + "version": "0.0.6" +} diff --git a/tools/eslint/node_modules/concat-stream/node_modules/typedarray/readme.markdown b/tools/eslint/node_modules/typedarray/readme.markdown similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/typedarray/readme.markdown rename to tools/eslint/node_modules/typedarray/readme.markdown diff --git a/tools/eslint/node_modules/user-home/cli.js b/tools/eslint/node_modules/user-home/cli.js deleted file mode 100755 index bacbd22755e08f..00000000000000 --- a/tools/eslint/node_modules/user-home/cli.js +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env node -'use strict'; -var pkg = require('./package.json'); -var userHome = require('./'); - -function help() { - console.log([ - pkg.description, - '', - 'Example', - ' $ user-home', - ' /Users/sindresorhus' - ].join('\n')); -} - -if (process.argv.indexOf('--help') !== -1) { - help(); - return; -} - -if (process.argv.indexOf('--version') !== -1) { - console.log(pkg.version); - return; -} - -process.stdout.write(userHome); diff --git a/tools/eslint/node_modules/user-home/index.js b/tools/eslint/node_modules/user-home/index.js index d53b7939ae6a4f..fdff72164c7603 100644 --- a/tools/eslint/node_modules/user-home/index.js +++ b/tools/eslint/node_modules/user-home/index.js @@ -1,15 +1,2 @@ 'use strict'; -var env = process.env; -var home = env.HOME; -var user = env.LOGNAME || env.USER || env.LNAME || env.USERNAME; - -if (process.platform === 'win32') { - module.exports = env.USERPROFILE || env.HOMEDRIVE + env.HOMEPATH || home || null; -} else if (process.platform === 'darwin') { - module.exports = home || (user ? '/Users/' + user : null) || null; -} else if (process.platform === 'linux') { - module.exports = home || - (user ? (process.getuid() === 0 ? '/root' : '/home/' + user) : null) || null; -} else { - module.exports = home || null; -} +module.exports = require('os-homedir')(); diff --git a/tools/eslint/node_modules/user-home/package.json b/tools/eslint/node_modules/user-home/package.json index 8b9e8b4854d16d..8560a50c4ba69e 100644 --- a/tools/eslint/node_modules/user-home/package.json +++ b/tools/eslint/node_modules/user-home/package.json @@ -1,69 +1,98 @@ { - "name": "user-home", - "version": "1.1.1", - "description": "Get the path to the user home directory", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/user-home.git" + "_args": [ + [ + "user-home@^2.0.0", + "/Users/silverwind/git/node/tools/package/package" + ] + ], + "_from": "user-home@>=2.0.0 <3.0.0", + "_id": "user-home@2.0.0", + "_inCache": true, + "_installable": true, + "_location": "/user-home", + "_nodeVersion": "0.12.4", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" }, - "bin": { - "user-home": "cli.js" + "_npmVersion": "2.10.1", + "_phantomChildren": {}, + "_requested": { + "name": "user-home", + "raw": "user-home@^2.0.0", + "rawSpec": "^2.0.0", + "scope": null, + "spec": ">=2.0.0 <3.0.0", + "type": "range" }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz", + "_shasum": "9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f", + "_shrinkwrap": null, + "_spec": "user-home@^2.0.0", + "_where": "/Users/silverwind/git/node/tools/package/package", "author": { - "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" + "name": "Sindre Sorhus", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/user-home/issues" + }, + "dependencies": { + "os-homedir": "^1.0.0" + }, + "description": "Get the path to the user home directory", + "devDependencies": { + "ava": "0.0.4", + "path-exists": "^1.0.0" + }, + "directories": {}, + "dist": { + "shasum": "9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f", + "tarball": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz" }, "engines": { "node": ">=0.10.0" }, - "scripts": { - "test": "node test.js" - }, "files": [ - "index.js", - "cli.js" + "index.js" ], + "gitHead": "23e6d1e2dd553b599c787348f82bd2463225cc80", + "homepage": "https://github.com/sindresorhus/user-home", "keywords": [ - "cli", - "bin", - "user", - "home", - "homedir", "dir", "directory", + "env", + "environment", "folder", - "path" + "home", + "homedir", + "os-homedir", + "path", + "user", + "userprofile", + "variables", + "vars" ], - "devDependencies": { - "ava": "0.0.3" - }, - "gitHead": "cf6ba885d3e6bf625fb3c15ad0334fa623968481", - "bugs": { - "url": "https://github.com/sindresorhus/user-home/issues" - }, - "homepage": "https://github.com/sindresorhus/user-home", - "_id": "user-home@1.1.1", - "_shasum": "2b5be23a32b63a7c9deb8d0f28d485724a3df190", - "_from": "user-home@>=1.0.0 <2.0.0", - "_npmVersion": "2.1.16", - "_nodeVersion": "0.10.32", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, + "license": "MIT", "maintainers": [ { "name": "sindresorhus", "email": "sindresorhus@gmail.com" } ], - "dist": { - "shasum": "2b5be23a32b63a7c9deb8d0f28d485724a3df190", - "tarball": "http://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz" + "name": "user-home", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/user-home.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", - "readme": "ERROR: No README data found!" + "scripts": { + "test": "node test.js" + }, + "version": "2.0.0" } diff --git a/tools/eslint/node_modules/user-home/readme.md b/tools/eslint/node_modules/user-home/readme.md index 5307a07ef5144c..944188c779a27b 100644 --- a/tools/eslint/node_modules/user-home/readme.md +++ b/tools/eslint/node_modules/user-home/readme.md @@ -5,7 +5,7 @@ ## Install -```sh +``` $ npm install --save user-home ``` @@ -16,25 +16,16 @@ $ npm install --save user-home var userHome = require('user-home'); console.log(userHome); -//=> /Users/sindresorhus +//=> '/Users/sindresorhus' ``` Returns `null` in the unlikely scenario that the home directory can't be found. -## CLI - -```sh -$ npm install --global user-home -``` +## Related -```sh -$ user-home --help - -Example - $ user-home - /Users/sindresorhus -``` +- [user-home-cli](https://github.com/sindresorhus/user-home-cli) - CLI for this module +- [home-or-tmp](https://github.com/sindresorhus/home-or-tmp) - Get the user home directory with fallback to the system temp directory ## License diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/LICENSE b/tools/eslint/node_modules/util-deprecate/LICENSE similarity index 100% rename from deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/LICENSE rename to tools/eslint/node_modules/util-deprecate/LICENSE diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/README.md b/tools/eslint/node_modules/util-deprecate/README.md similarity index 100% rename from deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/README.md rename to tools/eslint/node_modules/util-deprecate/README.md diff --git a/tools/eslint/node_modules/util-deprecate/browser.js b/tools/eslint/node_modules/util-deprecate/browser.js new file mode 100644 index 00000000000000..549ae2f065ea5a --- /dev/null +++ b/tools/eslint/node_modules/util-deprecate/browser.js @@ -0,0 +1,67 @@ + +/** + * Module exports. + */ + +module.exports = deprecate; + +/** + * Mark that a method should not be used. + * Returns a modified function which warns once by default. + * + * If `localStorage.noDeprecation = true` is set, then it is a no-op. + * + * If `localStorage.throwDeprecation = true` is set, then deprecated functions + * will throw an Error when invoked. + * + * If `localStorage.traceDeprecation = true` is set, then deprecated functions + * will invoke `console.trace()` instead of `console.error()`. + * + * @param {Function} fn - the function to deprecate + * @param {String} msg - the string to print to the console when `fn` is invoked + * @returns {Function} a new "deprecated" version of `fn` + * @api public + */ + +function deprecate (fn, msg) { + if (config('noDeprecation')) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (config('throwDeprecation')) { + throw new Error(msg); + } else if (config('traceDeprecation')) { + console.trace(msg); + } else { + console.warn(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +} + +/** + * Checks `localStorage` for boolean values for the given `name`. + * + * @param {String} name + * @returns {Boolean} + * @api private + */ + +function config (name) { + // accessing global.localStorage can trigger a DOMException in sandboxed iframes + try { + if (!global.localStorage) return false; + } catch (_) { + return false; + } + var val = global.localStorage[name]; + if (null == val) return false; + return String(val).toLowerCase() === 'true'; +} diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/node.js b/tools/eslint/node_modules/util-deprecate/node.js similarity index 100% rename from deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/node.js rename to tools/eslint/node_modules/util-deprecate/node.js diff --git a/tools/eslint/node_modules/util-deprecate/package.json b/tools/eslint/node_modules/util-deprecate/package.json new file mode 100644 index 00000000000000..a887dd46d34e37 --- /dev/null +++ b/tools/eslint/node_modules/util-deprecate/package.json @@ -0,0 +1,81 @@ +{ + "_args": [ + [ + "util-deprecate@~1.0.1", + "/Users/silverwind/git/node/tools/package/package/node_modules/readable-stream" + ] + ], + "_from": "util-deprecate@>=1.0.1 <1.1.0", + "_id": "util-deprecate@1.0.2", + "_inCache": true, + "_installable": true, + "_location": "/util-deprecate", + "_nodeVersion": "4.1.2", + "_npmUser": { + "email": "nathan@tootallnate.net", + "name": "tootallnate" + }, + "_npmVersion": "2.14.4", + "_phantomChildren": {}, + "_requested": { + "name": "util-deprecate", + "raw": "util-deprecate@~1.0.1", + "rawSpec": "~1.0.1", + "scope": null, + "spec": ">=1.0.1 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/readable-stream" + ], + "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "_shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", + "_shrinkwrap": null, + "_spec": "util-deprecate@~1.0.1", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/readable-stream", + "author": { + "email": "nathan@tootallnate.net", + "name": "Nathan Rajlich", + "url": "http://n8.io/" + }, + "browser": "browser.js", + "bugs": { + "url": "https://github.com/TooTallNate/util-deprecate/issues" + }, + "dependencies": {}, + "description": "The Node.js `util.deprecate()` function with browser support", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", + "tarball": "http://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + }, + "gitHead": "475fb6857cd23fafff20c1be846c1350abf8e6d4", + "homepage": "https://github.com/TooTallNate/util-deprecate", + "keywords": [ + "browser", + "browserify", + "deprecate", + "node", + "util" + ], + "license": "MIT", + "main": "node.js", + "maintainers": [ + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + } + ], + "name": "util-deprecate", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/util-deprecate.git" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "version": "1.0.2" +} diff --git a/tools/eslint/node_modules/wordwrap/LICENSE b/tools/eslint/node_modules/wordwrap/LICENSE new file mode 100644 index 00000000000000..ee27ba4b4412b0 --- /dev/null +++ b/tools/eslint/node_modules/wordwrap/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +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/eslint/node_modules/optionator/node_modules/wordwrap/README.markdown b/tools/eslint/node_modules/wordwrap/README.markdown similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/wordwrap/README.markdown rename to tools/eslint/node_modules/wordwrap/README.markdown diff --git a/tools/eslint/node_modules/wordwrap/index.js b/tools/eslint/node_modules/wordwrap/index.js new file mode 100644 index 00000000000000..67c8a61ecb8f6d --- /dev/null +++ b/tools/eslint/node_modules/wordwrap/index.js @@ -0,0 +1,76 @@ +var wordwrap = module.exports = function (start, stop, params) { + if (typeof start === 'object') { + params = start; + start = params.start; + stop = params.stop; + } + + if (typeof stop === 'object') { + params = stop; + start = start || params.start; + stop = undefined; + } + + if (!stop) { + stop = start; + start = 0; + } + + if (!params) params = {}; + var mode = params.mode || 'soft'; + var re = mode === 'hard' ? /\b/ : /(\S+\s+)/; + + return function (text) { + var chunks = text.toString() + .split(re) + .reduce(function (acc, x) { + if (mode === 'hard') { + for (var i = 0; i < x.length; i += stop - start) { + acc.push(x.slice(i, i + stop - start)); + } + } + else acc.push(x) + return acc; + }, []) + ; + + return chunks.reduce(function (lines, rawChunk) { + if (rawChunk === '') return lines; + + var chunk = rawChunk.replace(/\t/g, ' '); + + var i = lines.length - 1; + if (lines[i].length + chunk.length > stop) { + lines[i] = lines[i].replace(/\s+$/, ''); + + chunk.split(/\n/).forEach(function (c) { + lines.push( + new Array(start + 1).join(' ') + + c.replace(/^\s+/, '') + ); + }); + } + else if (chunk.match(/\n/)) { + var xs = chunk.split(/\n/); + lines[i] += xs.shift(); + xs.forEach(function (c) { + lines.push( + new Array(start + 1).join(' ') + + c.replace(/^\s+/, '') + ); + }); + } + else { + lines[i] += chunk; + } + + return lines; + }, [ new Array(start + 1).join(' ') ]).join('\n'); + }; +}; + +wordwrap.soft = wordwrap; + +wordwrap.hard = function (start, stop) { + return wordwrap(start, stop, { mode : 'hard' }); +}; diff --git a/tools/eslint/node_modules/wordwrap/package.json b/tools/eslint/node_modules/wordwrap/package.json new file mode 100644 index 00000000000000..31e44d9bd27495 --- /dev/null +++ b/tools/eslint/node_modules/wordwrap/package.json @@ -0,0 +1,86 @@ +{ + "_args": [ + [ + "wordwrap@~1.0.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/optionator" + ] + ], + "_from": "wordwrap@>=1.0.0 <1.1.0", + "_id": "wordwrap@1.0.0", + "_inCache": true, + "_installable": true, + "_location": "/wordwrap", + "_nodeVersion": "2.0.0", + "_npmUser": { + "email": "substack@gmail.com", + "name": "substack" + }, + "_npmVersion": "2.9.0", + "_phantomChildren": {}, + "_requested": { + "name": "wordwrap", + "raw": "wordwrap@~1.0.0", + "rawSpec": "~1.0.0", + "scope": null, + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/optionator" + ], + "_resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "_shasum": "27584810891456a4171c8d0226441ade90cbcaeb", + "_shrinkwrap": null, + "_spec": "wordwrap@~1.0.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/optionator", + "author": { + "email": "mail@substack.net", + "name": "James Halliday", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/node-wordwrap/issues" + }, + "dependencies": {}, + "description": "Wrap those words. Show them at what columns to start and stop.", + "devDependencies": { + "tape": "^4.0.0" + }, + "directories": { + "example": "example", + "lib": ".", + "test": "test" + }, + "dist": { + "shasum": "27584810891456a4171c8d0226441ade90cbcaeb", + "tarball": "http://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz" + }, + "gitHead": "9f02667e901f2f10d87c33f7093fcf94788ab2f8", + "homepage": "https://github.com/substack/node-wordwrap#readme", + "keywords": [ + "column", + "format", + "rule", + "word", + "wrap" + ], + "license": "MIT", + "main": "./index.js", + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "name": "wordwrap", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/substack/node-wordwrap.git" + }, + "scripts": { + "test": "expresso" + }, + "version": "1.0.0" +} diff --git a/tools/eslint/node_modules/wrappy/LICENSE b/tools/eslint/node_modules/wrappy/LICENSE new file mode 100644 index 00000000000000..19129e315fe593 --- /dev/null +++ b/tools/eslint/node_modules/wrappy/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/tools/eslint/node_modules/wrappy/README.md b/tools/eslint/node_modules/wrappy/README.md new file mode 100644 index 00000000000000..98eab2522b86e5 --- /dev/null +++ b/tools/eslint/node_modules/wrappy/README.md @@ -0,0 +1,36 @@ +# wrappy + +Callback wrapping utility + +## USAGE + +```javascript +var wrappy = require("wrappy") + +// var wrapper = wrappy(wrapperFunction) + +// make sure a cb is called only once +// See also: http://npm.im/once for this specific use case +var once = wrappy(function (cb) { + var called = false + return function () { + if (called) return + called = true + return cb.apply(this, arguments) + } +}) + +function printBoo () { + console.log('boo') +} +// has some rando property +printBoo.iAmBooPrinter = true + +var onlyPrintOnce = once(printBoo) + +onlyPrintOnce() // prints 'boo' +onlyPrintOnce() // does nothing + +// random property is retained! +assert.equal(onlyPrintOnce.iAmBooPrinter, true) +``` diff --git a/tools/eslint/node_modules/wrappy/package.json b/tools/eslint/node_modules/wrappy/package.json new file mode 100644 index 00000000000000..434227ac46a977 --- /dev/null +++ b/tools/eslint/node_modules/wrappy/package.json @@ -0,0 +1,78 @@ +{ + "_args": [ + [ + "wrappy@1", + "/Users/silverwind/git/node/tools/package/package/node_modules/inflight" + ] + ], + "_from": "wrappy@>=1.0.0 <2.0.0", + "_id": "wrappy@1.0.1", + "_inCache": true, + "_installable": true, + "_location": "/wrappy", + "_nodeVersion": "0.10.31", + "_npmUser": { + "email": "i@izs.me", + "name": "isaacs" + }, + "_npmVersion": "2.0.0", + "_phantomChildren": {}, + "_requested": { + "name": "wrappy", + "raw": "wrappy@1", + "rawSpec": "1", + "scope": null, + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/inflight", + "/once" + ], + "_resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz", + "_shasum": "1e65969965ccbc2db4548c6b84a6f2c5aedd4739", + "_shrinkwrap": null, + "_spec": "wrappy@1", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/inflight", + "author": { + "email": "i@izs.me", + "name": "Isaac Z. Schlueter", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/npm/wrappy/issues" + }, + "dependencies": {}, + "description": "Callback wrapping utility", + "devDependencies": { + "tap": "^0.4.12" + }, + "directories": { + "test": "test" + }, + "dist": { + "shasum": "1e65969965ccbc2db4548c6b84a6f2c5aedd4739", + "tarball": "http://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz" + }, + "gitHead": "006a8cbac6b99988315834c207896eed71fd069a", + "homepage": "https://github.com/npm/wrappy", + "license": "ISC", + "main": "wrappy.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "wrappy", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/wrappy.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "1.0.1" +} diff --git a/tools/eslint/node_modules/wrappy/wrappy.js b/tools/eslint/node_modules/wrappy/wrappy.js new file mode 100644 index 00000000000000..bb7e7d6fcf70fd --- /dev/null +++ b/tools/eslint/node_modules/wrappy/wrappy.js @@ -0,0 +1,33 @@ +// Returns a wrapper function that returns a wrapped callback +// The wrapper function should do some stuff, and return a +// presumably different callback function. +// This makes sure that own properties are retained, so that +// decorations and such are not lost along the way. +module.exports = wrappy +function wrappy (fn, cb) { + if (fn && cb) return wrappy(fn)(cb) + + if (typeof fn !== 'function') + throw new TypeError('need wrapper function') + + Object.keys(fn).forEach(function (k) { + wrapper[k] = fn[k] + }) + + return wrapper + + function wrapper() { + var args = new Array(arguments.length) + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + var ret = fn.apply(this, args) + var cb = args[args.length-1] + if (typeof ret === 'function' && ret !== cb) { + Object.keys(cb).forEach(function (k) { + ret[k] = cb[k] + }) + } + return ret + } +} diff --git a/tools/eslint/node_modules/write/LICENSE b/tools/eslint/node_modules/write/LICENSE new file mode 100644 index 00000000000000..fa30c4cb3e4c15 --- /dev/null +++ b/tools/eslint/node_modules/write/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015, Jon Schlinkert. + +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/eslint/node_modules/write/README.md b/tools/eslint/node_modules/write/README.md new file mode 100644 index 00000000000000..f5b9bc85ba1ccf --- /dev/null +++ b/tools/eslint/node_modules/write/README.md @@ -0,0 +1,101 @@ +# write [![NPM version](https://badge.fury.io/js/write.svg)](http://badge.fury.io/js/write) [![Build Status](https://travis-ci.org/jonschlinkert/write.svg)](https://travis-ci.org/jonschlinkert/write) + +> Write files to disk, creating intermediate directories if they don't exist. + +Install with [npm](https://www.npmjs.com/) + +```sh +$ npm i write --save +``` + +## API docs + +### [writeFile](index.js#L32) + +Asynchronously write a file to disk. Creates any intermediate directories if they don't already exist. + +**Params** + +* `dest` **{String}**: Destination file path +* `str` **{String}**: String to write to disk. +* `callback` **{Function}** + +**Example** + +```js +var writeFile = require('write'); +writeFile('foo.txt', 'This is content to write.', function(err) { + if (err) console.log(err); +}); +``` + +### [.writeFile.sync](index.js#L64) + +Synchronously write files to disk. Creates any intermediate directories if they don't already exist. + +**Params** + +* `dest` **{String}**: Destination file path +* `str` **{String}**: String to write to disk. + +**Example** + +```js +var writeFile = require('write'); +writeFile.sync('foo.txt', 'This is content to write.'); +``` + +### [.writeFile.stream](index.js#L87) + +Uses `fs.createWriteStream`, but also creates any intermediate directories if they don't already exist. + +**Params** + +* `dest` **{String}**: Destination file path +* `returns` **{Stream}**: Returns a write stream. + +**Example** + +```js +var write = require('write'); +write.stream('foo.txt'); +``` + +## Related + +* [delete](https://github.com/jonschlinkert/delete): Delete files and folders and any intermediate directories if they exist (sync and async). +* [read-yaml](https://github.com/jonschlinkert/read-yaml): Very thin wrapper around js-yaml for directly reading in YAML files. +* [read-json](https://github.com/azer/read-json): Reads and parses a JSON file. +* [read-data](https://github.com/jonschlinkert/read-data): Read JSON or YAML files. +* [write-yaml](https://github.com/jonschlinkert/write-yaml): Write YAML. Converts JSON to YAML writes it to the specified file. +* [write-json](https://github.com/jonschlinkert/write-json): Write a JSON to file disk, also creates directories in the dest path if they… [more](https://github.com/jonschlinkert/write-json) + +## Running tests + +Install dev dependencies: + +```sh +$ npm i -d && npm test +``` + +## Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/write/issues/new) + +## Author + +**Jon Schlinkert** + ++ [github/jonschlinkert](https://github.com/jonschlinkert) ++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) + +## License + +Copyright © 2015 Jon Schlinkert +Released under the MIT license. + +*** + +_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on July 29, 2015._ + + \ No newline at end of file diff --git a/tools/eslint/node_modules/write/index.js b/tools/eslint/node_modules/write/index.js new file mode 100644 index 00000000000000..f952638d0d4520 --- /dev/null +++ b/tools/eslint/node_modules/write/index.js @@ -0,0 +1,93 @@ +/*! + * write + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + */ + +'use strict'; + +var fs = require('fs'); +var path = require('path'); +var mkdir = require('mkdirp'); + +/** + * Asynchronously write a file to disk. Creates any intermediate + * directories if they don't already exist. + * + * ```js + * var writeFile = require('write'); + * writeFile('foo.txt', 'This is content to write.', function(err) { + * if (err) console.log(err); + * }); + * ``` + * + * @name writeFile + * @param {String} `dest` Destination file path + * @param {String} `str` String to write to disk. + * @param {Function} `callback` + * @api public + */ + +module.exports = function writeFile(dest, str, cb) { + var dir = path.dirname(dest); + fs.exists(dir, function (exists) { + if (exists) { + fs.writeFile(dest, str, cb); + } else { + mkdir(dir, function (err) { + if (err) { + return cb(err); + } else { + fs.writeFile(dest, str, cb); + } + }); + } + }); +}; + +/** + * Synchronously write files to disk. Creates any intermediate + * directories if they don't already exist. + * + * ```js + * var writeFile = require('write'); + * writeFile.sync('foo.txt', 'This is content to write.'); + * ``` + * + * @name writeFile.sync + * @param {String} `dest` Destination file path + * @param {String} `str` String to write to disk. + * @api public + */ + +module.exports.sync = function writeFileSync(dest, str) { + var dir = path.dirname(dest); + if (!fs.existsSync(dir)) { + mkdir.sync(dir); + } + fs.writeFileSync(dest, str); +}; + +/** + * Uses `fs.createWriteStream`, but also creates any intermediate + * directories if they don't already exist. + * + * ```js + * var write = require('write'); + * write.stream('foo.txt'); + * ``` + * + * @name writeFile.stream + * @param {String} `dest` Destination file path + * @return {Stream} Returns a write stream. + * @api public + */ + +module.exports.stream = function writeFileStream(dest) { + var dir = path.dirname(dest); + if (!fs.existsSync(dir)) { + mkdir.sync(dir); + } + return fs.createWriteStream(dest); +}; diff --git a/tools/eslint/node_modules/write/package.json b/tools/eslint/node_modules/write/package.json new file mode 100644 index 00000000000000..8c71a17eaab6db --- /dev/null +++ b/tools/eslint/node_modules/write/package.json @@ -0,0 +1,97 @@ +{ + "_args": [ + [ + "write@^0.2.1", + "/Users/silverwind/git/node/tools/package/package/node_modules/flat-cache" + ] + ], + "_from": "write@>=0.2.1 <0.3.0", + "_id": "write@0.2.1", + "_inCache": true, + "_installable": true, + "_location": "/write", + "_nodeVersion": "0.12.4", + "_npmUser": { + "email": "github@sellside.com", + "name": "jonschlinkert" + }, + "_npmVersion": "2.10.1", + "_phantomChildren": {}, + "_requested": { + "name": "write", + "raw": "write@^0.2.1", + "rawSpec": "^0.2.1", + "scope": null, + "spec": ">=0.2.1 <0.3.0", + "type": "range" + }, + "_requiredBy": [ + "/flat-cache" + ], + "_resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "_shasum": "5fc03828e264cea3fe91455476f7a3c566cb0757", + "_shrinkwrap": null, + "_spec": "write@^0.2.1", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/flat-cache", + "author": { + "name": "Jon Schlinkert", + "url": "https://github.com/jonschlinkert" + }, + "bugs": { + "url": "https://github.com/jonschlinkert/write/issues" + }, + "dependencies": { + "mkdirp": "^0.5.1" + }, + "description": "Write files to disk, creating intermediate directories if they don't exist.", + "devDependencies": { + "async": "^1.4.0", + "delete": "^0.2.1", + "mocha": "^2.2.5", + "should": "^7.0.2" + }, + "directories": {}, + "dist": { + "shasum": "5fc03828e264cea3fe91455476f7a3c566cb0757", + "tarball": "https://registry.npmjs.org/write/-/write-0.2.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "4fde911228a1d244d4439292d6850175c8195730", + "homepage": "https://github.com/jonschlinkert/write", + "keywords": [ + "file", + "filepath", + "files", + "filesystem", + "folder", + "fs", + "fs.writeFile", + "fs.writeFileSync", + "path", + "write" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "jonschlinkert", + "email": "github@sellside.com" + } + ], + "name": "write", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/jonschlinkert/write.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "0.2.1" +} diff --git a/tools/eslint/node_modules/xml-escape/LICENSE b/tools/eslint/node_modules/xml-escape/LICENSE deleted file mode 100644 index bd261effaee331..00000000000000 --- a/tools/eslint/node_modules/xml-escape/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Michael Hernandez - -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/eslint/node_modules/xml-escape/README.md b/tools/eslint/node_modules/xml-escape/README.md deleted file mode 100644 index db55ce80c60b8c..00000000000000 --- a/tools/eslint/node_modules/xml-escape/README.md +++ /dev/null @@ -1,15 +0,0 @@ -xml-escape -========== - -Escape XML in javascript (NodeJS) - - -npm install xml-escape - -// Warning escape is a reserved word, so maybe best to use xmlescape for var name -var xmlescape = require('xml-escape'); - -xmlescape('"hello" \'world\' & false < true > -1') - -// output -// '"hello" 'world' & true < false > -1' \ No newline at end of file diff --git a/tools/eslint/node_modules/xml-escape/index.js b/tools/eslint/node_modules/xml-escape/index.js deleted file mode 100644 index d26715ddd5d546..00000000000000 --- a/tools/eslint/node_modules/xml-escape/index.js +++ /dev/null @@ -1,15 +0,0 @@ - - -var escape = module.exports = function escape(string) { - return string.replace(/([&"<>'])/g, function(str, item) { - return escape.map[item]; - }) -} - -var map = escape.map = { - '>': '>' - , '<': '<' - , "'": ''' - , '"': '"' - , '&': '&' -} \ No newline at end of file diff --git a/tools/eslint/node_modules/xml-escape/package.json b/tools/eslint/node_modules/xml-escape/package.json deleted file mode 100644 index 46412796d2a5c1..00000000000000 --- a/tools/eslint/node_modules/xml-escape/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "name": "xml-escape", - "version": "1.0.0", - "description": "Escape XML ", - "main": "index.js", - "scripts": { - "test": "node test.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/miketheprogrammer/xml-escape.git" - }, - "keywords": [ - "Escape", - "XML", - "Unesacpe", - "encoding", - "xml-escape" - ], - "author": { - "name": "Michael Hernandez - michael.hernandez1988@gmail.com" - }, - "license": "MIT License", - "bugs": { - "url": "https://github.com/miketheprogrammer/xml-escape/issues" - }, - "homepage": "https://github.com/miketheprogrammer/xml-escape", - "dependencies": {}, - "devDependencies": { - "tape": "~2.4.2" - }, - "_id": "xml-escape@1.0.0", - "dist": { - "shasum": "00963d697b2adf0c185c4e04e73174ba9b288eb2", - "tarball": "http://registry.npmjs.org/xml-escape/-/xml-escape-1.0.0.tgz" - }, - "_from": "xml-escape@>=1.0.0 <1.1.0", - "_npmVersion": "1.3.14", - "_npmUser": { - "name": "mhernandez", - "email": "michael.hernandez1988@gmail.com" - }, - "maintainers": [ - { - "name": "mhernandez", - "email": "michael.hernandez1988@gmail.com" - } - ], - "directories": {}, - "_shasum": "00963d697b2adf0c185c4e04e73174ba9b288eb2", - "_resolved": "https://registry.npmjs.org/xml-escape/-/xml-escape-1.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/tools/eslint/node_modules/xml-escape/test.js b/tools/eslint/node_modules/xml-escape/test.js deleted file mode 100644 index 211c3b8164dd0a..00000000000000 --- a/tools/eslint/node_modules/xml-escape/test.js +++ /dev/null @@ -1,7 +0,0 @@ -var test = require('tape'); -var escape = require('./index'); -test("Characters should be escaped properly", function (t) { - t.plan(1); - - t.equals(escape('" \' < > &'), '" ' < > &'); -}) \ No newline at end of file diff --git a/tools/eslint/node_modules/xregexp/LICENSE b/tools/eslint/node_modules/xregexp/LICENSE new file mode 100644 index 00000000000000..5561edc5d2ffce --- /dev/null +++ b/tools/eslint/node_modules/xregexp/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2007-2016 Steven Levithan + +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/eslint/node_modules/xregexp/README.md b/tools/eslint/node_modules/xregexp/README.md new file mode 100644 index 00000000000000..3ea582c5e9ad48 --- /dev/null +++ b/tools/eslint/node_modules/xregexp/README.md @@ -0,0 +1,243 @@ +[XRegExp](http://xregexp.com/) 3.1.0 +==================================== + +XRegExp provides augmented (and extensible) JavaScript regular expressions. You get new modern syntax and flags beyond what browsers support natively. XRegExp is also a regex utility belt with tools to make your client-side grepping and parsing easier, while freeing you from worrying about pesky aspects of JavaScript regexes like cross-browser inconsistencies and manually manipulating `lastIndex`. + +XRegExp supports all native ES6 regular expression syntax. It supports Internet Explorer 5.5+, Firefox 1.5+, Chrome, Safari 3+, and Opera 11+. You can also use it with Node.js, or as a RequireJS module. The base library is about 4.25 KB, minified and gzipped. + +## Performance + +XRegExp regexes compile to native `RegExp` objects, and therefore perform just as fast as native regular expressions. There is a tiny extra cost when compiling a pattern for the first time. + +## Usage examples + +```js +// Using named capture and flag x (free-spacing and line comments) +var date = XRegExp('(? [0-9]{4} ) -? # year \n\ + (? [0-9]{2} ) -? # month \n\ + (? [0-9]{2} ) # day ', 'x'); + +// XRegExp.exec gives you named backreferences on the match result +var match = XRegExp.exec('2015-02-22', date); +match.year; // -> '2015' + +// It also includes optional pos and sticky arguments +var pos = 3, result = []; +while (match = XRegExp.exec('<1><2><3><4>5<6>', /<(\d+)>/, pos, 'sticky')) { + result.push(match[1]); + pos = match.index + match[0].length; +} // result -> ['2', '3', '4'] + +// XRegExp.replace allows named backreferences in replacements +XRegExp.replace('2015-02-22', date, '${month}/${day}/${year}'); // -> '02/22/2015' +XRegExp.replace('2015-02-22', date, function(match) { + return match.month + '/' + match.day + '/' + match.year; +}); // -> '02/22/2015' + +// In fact, XRegExps compile to RegExps and work perfectly with native methods +date.test('2015-02-22'); // -> true + +// The *only* caveat is that named captures must be referenced using numbered backreferences +'2015-02-22'.replace(date, '$2/$3/$1'); // -> '02/22/2015' + +// Extract every other digit from a string using XRegExp.forEach +var evens = []; +XRegExp.forEach('1a2345', /\d/, function(match, i) { + if (i % 2) evens.push(+match[0]); +}); +// evens -> [2, 4] + +// Get numbers within tags using XRegExp.matchChain +XRegExp.matchChain('1 2 3 4 a 56', [ + XRegExp('(?is).*?'), + /\d+/ +]); // -> ['2', '4', '56'] + +// You can also pass forward and return specific backreferences +var html = 'XRegExp' + + 'Google'; +XRegExp.matchChain(html, [ + {regex: //i, backref: 1}, + {regex: XRegExp('(?i)^https?://(?[^/?#]+)'), backref: 'domain'} +]); // -> ['xregexp.com', 'www.google.com'] + +// Merge strings and regexes into a single pattern, safely rewriting backreferences +XRegExp.union(['a+b*c', /(dog)\1/, /(cat)\1/], 'i'); +// -> /a\+b\*c|(dog)\1|(cat)\2/i +``` + +These examples should give you the flavor of what's possible, but XRegExp has more syntax, flags, methods, options, and browser fixes that aren't shown here. You can even augment XRegExp's regular expression syntax with addons (see below) or write your own. See [xregexp.com](http://xregexp.com/) for more details. + +## Addons + +You can either load addons individually, or bundle all addons together with XRegExp by loading `xregexp-all.js`. XRegExp's [npm package](https://www.npmjs.com/package/xregexp) uses `xregexp-all.js`, so addons are always available when XRegExp is installed using npm. + +### Unicode + +In browsers, first include the Unicode Base script and then one or more of the addons for Unicode blocks, categories, properties, or scripts. + +```html + + + + +``` + +Then you can do this: + +```js +// Test the Unicode category L (Letter) +var unicodeWord = XRegExp('^\\pL+$'); +unicodeWord.test('Русский'); // -> true +unicodeWord.test('日本語'); // -> true +unicodeWord.test('العربية'); // -> true + +// Test some Unicode scripts +XRegExp('^\\p{Hiragana}+$').test('ひらがな'); // -> true +XRegExp('^[\\p{Latin}\\p{Common}]+$').test('Über Café.'); // -> true +``` + +By default, `\p{…}` and `\P{…}` support the Basic Multilingual Plane (i.e. code points up to `U+FFFF`). You can opt-in to full 21-bit Unicode support (with code points up to `U+10FFFF`) on a per-regex basis by using flag `A`. In XRegExp, this is called *astral mode*. You can automatically add flag `A` for all new regexes by running `XRegExp.install('astral')`. When in astral mode, `\p{…}` and `\P{…}` always match a full code point rather than a code unit, using surrogate pairs for code points above `U+FFFF`. + +```js +// Using flag A to match astral code points +XRegExp('^\\pS$').test('💩'); // -> false +XRegExp('^\\pS$', 'A').test('💩'); // -> true +XRegExp('(?A)^\\pS$').test('💩'); // -> true +// Using surrogate pair U+D83D U+DCA9 to represent U+1F4A9 (pile of poo) +XRegExp('(?A)^\\pS$').test('\uD83D\uDCA9'); // -> true + +// Implicit flag A +XRegExp.install('astral'); +XRegExp('^\\pS$').test('💩'); // -> true +``` + +Opting in to astral mode disables the use of `\p{…}` and `\P{…}` within character classes. In astral mode, use e.g. `(\pL|[0-9_])+` instead of `[\pL0-9_]+`. + +XRegExp uses Unicode 8.0.0. + +### XRegExp.build + +In browsers, first include the script: + +```html + + +``` + +You can then build regular expressions using named subpatterns, for readability and pattern reuse: + +```js +var time = XRegExp.build('(?x)^ {{hours}} ({{minutes}}) $', { + hours: XRegExp.build('{{h12}} : | {{h24}}', { + h12: /1[0-2]|0?[1-9]/, + h24: /2[0-3]|[01][0-9]/ + }), + minutes: /^[0-5][0-9]$/ +}); + +time.test('10:59'); // -> true +XRegExp.exec('10:59', time).minutes; // -> '59' +``` + +Named subpatterns can be provided as strings or regex objects. A leading `^` and trailing unescaped `$` are stripped from subpatterns if both are present, which allows embedding independently-useful anchored patterns. `{{…}}` tokens can be quantified as a single unit. Any backreferences in the outer pattern or provided subpatterns are automatically renumbered to work correctly within the larger combined pattern. The syntax `({{name}})` works as shorthand for named capture via `(?{{name}})`. Named subpatterns cannot be embedded within character classes. + +See also: *[Creating Grammatical Regexes Using XRegExp.build](http://blog.stevenlevithan.com/archives/grammatical-patterns-xregexp-build)*. + +### XRegExp.matchRecursive + +In browsers, first include the script: + +```html + + +``` + +You can then match recursive constructs using XRegExp pattern strings as left and right delimiters: + +```js +var str = '(t((e))s)t()(ing)'; +XRegExp.matchRecursive(str, '\\(', '\\)', 'g'); +// -> ['t((e))s', '', 'ing'] + +// Extended information mode with valueNames +str = 'Here is
      an
      example'; +XRegExp.matchRecursive(str, '', '', 'gi', { + valueNames: ['between', 'left', 'match', 'right'] +}); +/* -> [ +{name: 'between', value: 'Here is ', start: 0, end: 8}, +{name: 'left', value: '
      ', start: 8, end: 13}, +{name: 'match', value: '
      an
      ', start: 13, end: 27}, +{name: 'right', value: '
      ', start: 27, end: 33}, +{name: 'between', value: ' example', start: 33, end: 41} +] */ + +// Omitting unneeded parts with null valueNames, and using escapeChar +str = '...{1}.\\{{function(x,y){return {y:x}}}'; +XRegExp.matchRecursive(str, '{', '}', 'g', { + valueNames: ['literal', null, 'value', null], + escapeChar: '\\' +}); +/* -> [ +{name: 'literal', value: '...', start: 0, end: 3}, +{name: 'value', value: '1', start: 4, end: 5}, +{name: 'literal', value: '.\\{', start: 6, end: 9}, +{name: 'value', value: 'function(x,y){return {y:x}}', start: 10, end: 37} +] */ + +// Sticky mode via flag y +str = '<1><<<2>>><3>4<5>'; +XRegExp.matchRecursive(str, '<', '>', 'gy'); +// -> ['1', '<<2>>', '3'] +``` + +`XRegExp.matchRecursive` throws an error if it scans past an unbalanced delimiter in the target string. + +## Installation and usage + +In browsers: + +```html + +``` + +Or, to bundle XRegExp with all of its addons: + +```html + +``` + +Using [npm](https://www.npmjs.com/): + +```bash +npm install xregexp +``` + +In [Node.js](http://nodejs.org/): + +```js +var XRegExp = require('xregexp'); +``` + +In an AMD loader like [RequireJS](http://requirejs.org/): + +```js +require({paths: {xregexp: 'xregexp-all'}}, ['xregexp'], function(XRegExp) { + console.log(XRegExp.version); +}); +``` + +## About + +XRegExp copyright 2007-2016 by [Steven Levithan](http://stevenlevithan.com/). + +Tools: Unicode range generators by [Mathias Bynens](http://mathiasbynens.be/), and adapted from his [unicode-data](https://github.com/mathiasbynens/unicode-data) project. + +Tests: Uses [Jasmine](http://jasmine.github.io/) for unit tests, and [Benchmark.js](http://benchmarkjs.com) for performance tests. + +Prior art: `XRegExp.build` inspired by [Lea Verou](http://lea.verou.me/)'s [RegExp.create](http://lea.verou.me/2011/03/create-complex-regexps-more-easily/). `XRegExp.union` inspired by [Ruby](http://www.ruby-lang.org/). XRegExp's syntax extensions and flags come from [Perl](http://www.perl.org/), [.NET](http://www.microsoft.com/net), etc. + +All code, including addons, tools, and tests, is released under the terms of the [MIT](http://mit-license.org/) license. + +Fork me to show support, fix, and extend. diff --git a/tools/eslint/node_modules/xregexp/package.json b/tools/eslint/node_modules/xregexp/package.json new file mode 100644 index 00000000000000..0e755063e3ff03 --- /dev/null +++ b/tools/eslint/node_modules/xregexp/package.json @@ -0,0 +1,85 @@ +{ + "_args": [ + [ + "xregexp@^3.0.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/table" + ] + ], + "_from": "xregexp@>=3.0.0 <4.0.0", + "_id": "xregexp@3.1.0", + "_inCache": true, + "_installable": true, + "_location": "/xregexp", + "_nodeVersion": "3.3.1", + "_npmOperationalInternal": { + "host": "packages-9-west.internal.npmjs.com", + "tmp": "tmp/xregexp-3.1.0.tgz_1456271836601_0.7557942552957684" + }, + "_npmUser": { + "email": "steves_list@hotmail.com", + "name": "slevithan" + }, + "_npmVersion": "2.14.3", + "_phantomChildren": {}, + "_requested": { + "name": "xregexp", + "raw": "xregexp@^3.0.0", + "rawSpec": "^3.0.0", + "scope": null, + "spec": ">=3.0.0 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/table" + ], + "_resolved": "https://registry.npmjs.org/xregexp/-/xregexp-3.1.0.tgz", + "_shasum": "14d8461e0bdd38224bfee5039a0898fc42fcd336", + "_shrinkwrap": null, + "_spec": "xregexp@^3.0.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/table", + "author": { + "email": "steves_list@hotmail.com", + "name": "Steven Levithan" + }, + "bugs": { + "url": "https://github.com/slevithan/xregexp/issues" + }, + "dependencies": {}, + "description": "Extended regular expressions", + "devDependencies": { + "browserify": "^12.0.1" + }, + "directories": {}, + "dist": { + "shasum": "14d8461e0bdd38224bfee5039a0898fc42fcd336", + "tarball": "https://registry.npmjs.org/xregexp/-/xregexp-3.1.0.tgz" + }, + "files": [ + "src" + ], + "gitHead": "bbd5b1c2f759bdf278192be5df70af16342ffa4d", + "homepage": "http://xregexp.com/", + "keywords": [ + "regex", + "regexp" + ], + "license": "MIT", + "main": "./src/index.js", + "maintainers": [ + { + "name": "slevithan", + "email": "steves_list@hotmail.com" + } + ], + "name": "xregexp", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/slevithan/xregexp.git" + }, + "scripts": { + "build": "browserify src/index.js --standalone XRegExp > xregexp-all.js" + }, + "version": "3.1.0" +} diff --git a/tools/eslint/node_modules/xregexp/src/addons/build.js b/tools/eslint/node_modules/xregexp/src/addons/build.js new file mode 100644 index 00000000000000..221cb26fa940cf --- /dev/null +++ b/tools/eslint/node_modules/xregexp/src/addons/build.js @@ -0,0 +1,189 @@ +/*! + * XRegExp.build 3.1.0 + * + * Steven Levithan (c) 2012-2016 MIT License + * Inspired by Lea Verou's RegExp.create + */ + +module.exports = function(XRegExp) { + 'use strict'; + + var REGEX_DATA = 'xregexp', + subParts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*]/g, + parts = XRegExp.union([/\({{([\w$]+)}}\)|{{([\w$]+)}}/, subParts], 'g'); + +/** + * Strips a leading `^` and trailing unescaped `$`, if both are present. + * + * @private + * @param {String} pattern Pattern to process. + * @returns {String} Pattern with edge anchors removed. + */ + function deanchor(pattern) { + // Allow any number of empty noncapturing groups before/after anchors, because regexes + // built/generated by XRegExp sometimes include them + var leadingAnchor = /^(?:\(\?:\))*\^/, + trailingAnchor = /\$(?:\(\?:\))*$/; + + if ( + leadingAnchor.test(pattern) && + trailingAnchor.test(pattern) && + // Ensure that the trailing `$` isn't escaped + trailingAnchor.test(pattern.replace(/\\[\s\S]/g, '')) + ) { + return pattern.replace(leadingAnchor, '').replace(trailingAnchor, ''); + } + + return pattern; + } + +/** + * Converts the provided value to an XRegExp. Native RegExp flags are not preserved. + * + * @private + * @param {String|RegExp} value Value to convert. + * @returns {RegExp} XRegExp object with XRegExp syntax applied. + */ + function asXRegExp(value) { + return XRegExp.isRegExp(value) ? + (value[REGEX_DATA] && value[REGEX_DATA].captureNames ? + // Don't recompile, to preserve capture names + value : + // Recompile as XRegExp + XRegExp(value.source) + ) : + // Compile string as XRegExp + XRegExp(value); + } + +/** + * Builds regexes using named subpatterns, for readability and pattern reuse. Backreferences in the + * outer pattern and provided subpatterns are automatically renumbered to work correctly. Native + * flags used by provided subpatterns are ignored in favor of the `flags` argument. + * + * @memberOf XRegExp + * @param {String} pattern XRegExp pattern using `{{name}}` for embedded subpatterns. Allows + * `({{name}})` as shorthand for `(?{{name}})`. Patterns cannot be embedded within + * character classes. + * @param {Object} subs Lookup object for named subpatterns. Values can be strings or regexes. A + * leading `^` and trailing unescaped `$` are stripped from subpatterns, if both are present. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Regex with interpolated subpatterns. + * @example + * + * var time = XRegExp.build('(?x)^ {{hours}} ({{minutes}}) $', { + * hours: XRegExp.build('{{h12}} : | {{h24}}', { + * h12: /1[0-2]|0?[1-9]/, + * h24: /2[0-3]|[01][0-9]/ + * }, 'x'), + * minutes: /^[0-5][0-9]$/ + * }); + * time.test('10:59'); // -> true + * XRegExp.exec('10:59', time).minutes; // -> '59' + */ + XRegExp.build = function(pattern, subs, flags) { + var inlineFlags = /^\(\?([\w$]+)\)/.exec(pattern), + data = {}, + numCaps = 0, // 'Caps' is short for captures + numPriorCaps, + numOuterCaps = 0, + outerCapsMap = [0], + outerCapNames, + sub, + p; + + // Add flags within a leading mode modifier to the overall pattern's flags + if (inlineFlags) { + flags = flags || ''; + inlineFlags[1].replace(/./g, function(flag) { + // Don't add duplicates + flags += (flags.indexOf(flag) > -1 ? '' : flag); + }); + } + + for (p in subs) { + if (subs.hasOwnProperty(p)) { + // Passing to XRegExp enables extended syntax and ensures independent validity, + // lest an unescaped `(`, `)`, `[`, or trailing `\` breaks the `(?:)` wrapper. For + // subpatterns provided as native regexes, it dies on octals and adds the property + // used to hold extended regex instance data, for simplicity + sub = asXRegExp(subs[p]); + data[p] = { + // Deanchoring allows embedding independently useful anchored regexes. If you + // really need to keep your anchors, double them (i.e., `^^...$$`) + pattern: deanchor(sub.source), + names: sub[REGEX_DATA].captureNames || [] + }; + } + } + + // Passing to XRegExp dies on octals and ensures the outer pattern is independently valid; + // helps keep this simple. Named captures will be put back + pattern = asXRegExp(pattern); + outerCapNames = pattern[REGEX_DATA].captureNames || []; + pattern = pattern.source.replace(parts, function($0, $1, $2, $3, $4) { + var subName = $1 || $2, + capName, + intro, + localCapIndex; + // Named subpattern + if (subName) { + if (!data.hasOwnProperty(subName)) { + throw new ReferenceError('Undefined property ' + $0); + } + // Named subpattern was wrapped in a capturing group + if ($1) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; + // If it's a named group, preserve the name. Otherwise, use the subpattern name + // as the capture name + intro = '(?<' + (capName || subName) + '>'; + } else { + intro = '(?:'; + } + numPriorCaps = numCaps; + return intro + data[subName].pattern.replace(subParts, function(match, paren, backref) { + // Capturing group + if (paren) { + capName = data[subName].names[numCaps - numPriorCaps]; + ++numCaps; + // If the current capture has a name, preserve the name + if (capName) { + return '(?<' + capName + '>'; + } + // Backreference + } else if (backref) { + localCapIndex = +backref - 1; + // Rewrite the backreference + return data[subName].names[localCapIndex] ? + // Need to preserve the backreference name in case using flag `n` + '\\k<' + data[subName].names[localCapIndex] + '>' : + '\\' + (+backref + numPriorCaps); + } + return match; + }) + ')'; + } + // Capturing group + if ($3) { + capName = outerCapNames[numOuterCaps]; + outerCapsMap[++numOuterCaps] = ++numCaps; + // If the current capture has a name, preserve the name + if (capName) { + return '(?<' + capName + '>'; + } + // Backreference + } else if ($4) { + localCapIndex = +$4 - 1; + // Rewrite the backreference + return outerCapNames[localCapIndex] ? + // Need to preserve the backreference name in case using flag `n` + '\\k<' + outerCapNames[localCapIndex] + '>' : + '\\' + outerCapsMap[+$4]; + } + return $0; + }); + + return XRegExp(pattern, flags); + }; + +}; diff --git a/tools/eslint/node_modules/xregexp/src/addons/matchrecursive.js b/tools/eslint/node_modules/xregexp/src/addons/matchrecursive.js new file mode 100644 index 00000000000000..1de3bdc5579cea --- /dev/null +++ b/tools/eslint/node_modules/xregexp/src/addons/matchrecursive.js @@ -0,0 +1,191 @@ +/*! + * XRegExp.matchRecursive 3.1.0 + * + * Steven Levithan (c) 2009-2016 MIT License + */ + +module.exports = function(XRegExp) { + 'use strict'; + +/** + * Returns a match detail object composed of the provided values. + * + * @private + */ + function row(name, value, start, end) { + return { + name: name, + value: value, + start: start, + end: end + }; + } + +/** + * Returns an array of match strings between outermost left and right delimiters, or an array of + * objects with detailed match parts and position data. An error is thrown if delimiters are + * unbalanced within the data. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {String} left Left delimiter as an XRegExp pattern. + * @param {String} right Right delimiter as an XRegExp pattern. + * @param {String} [flags] Any native or XRegExp flags, used for the left and right delimiters. + * @param {Object} [options] Lets you specify `valueNames` and `escapeChar` options. + * @returns {Array} Array of matches, or an empty array. + * @example + * + * // Basic usage + * var str = '(t((e))s)t()(ing)'; + * XRegExp.matchRecursive(str, '\\(', '\\)', 'g'); + * // -> ['t((e))s', '', 'ing'] + * + * // Extended information mode with valueNames + * str = 'Here is
      an
      example'; + * XRegExp.matchRecursive(str, '', '', 'gi', { + * valueNames: ['between', 'left', 'match', 'right'] + * }); + * // -> [ + * // {name: 'between', value: 'Here is ', start: 0, end: 8}, + * // {name: 'left', value: '
      ', start: 8, end: 13}, + * // {name: 'match', value: '
      an
      ', start: 13, end: 27}, + * // {name: 'right', value: '
      ', start: 27, end: 33}, + * // {name: 'between', value: ' example', start: 33, end: 41} + * // ] + * + * // Omitting unneeded parts with null valueNames, and using escapeChar + * str = '...{1}.\\{{function(x,y){return {y:x}}}'; + * XRegExp.matchRecursive(str, '{', '}', 'g', { + * valueNames: ['literal', null, 'value', null], + * escapeChar: '\\' + * }); + * // -> [ + * // {name: 'literal', value: '...', start: 0, end: 3}, + * // {name: 'value', value: '1', start: 4, end: 5}, + * // {name: 'literal', value: '.\\{', start: 6, end: 9}, + * // {name: 'value', value: 'function(x,y){return {y:x}}', start: 10, end: 37} + * // ] + * + * // Sticky mode via flag y + * str = '<1><<<2>>><3>4<5>'; + * XRegExp.matchRecursive(str, '<', '>', 'gy'); + * // -> ['1', '<<2>>', '3'] + */ + XRegExp.matchRecursive = function(str, left, right, flags, options) { + flags = flags || ''; + options = options || {}; + var global = flags.indexOf('g') > -1, + sticky = flags.indexOf('y') > -1, + // Flag `y` is controlled internally + basicFlags = flags.replace(/y/g, ''), + escapeChar = options.escapeChar, + vN = options.valueNames, + output = [], + openTokens = 0, + delimStart = 0, + delimEnd = 0, + lastOuterEnd = 0, + outerStart, + innerStart, + leftMatch, + rightMatch, + esc; + left = XRegExp(left, basicFlags); + right = XRegExp(right, basicFlags); + + if (escapeChar) { + if (escapeChar.length > 1) { + throw new Error('Cannot use more than one escape character'); + } + escapeChar = XRegExp.escape(escapeChar); + // Using `XRegExp.union` safely rewrites backreferences in `left` and `right` + esc = new RegExp( + '(?:' + escapeChar + '[\\S\\s]|(?:(?!' + + XRegExp.union([left, right]).source + + ')[^' + escapeChar + '])+)+', + // Flags `gy` not needed here + flags.replace(/[^imu]+/g, '') + ); + } + + while (true) { + // If using an escape character, advance to the delimiter's next starting position, + // skipping any escaped characters in between + if (escapeChar) { + delimEnd += (XRegExp.exec(str, esc, delimEnd, 'sticky') || [''])[0].length; + } + leftMatch = XRegExp.exec(str, left, delimEnd); + rightMatch = XRegExp.exec(str, right, delimEnd); + // Keep the leftmost match only + if (leftMatch && rightMatch) { + if (leftMatch.index <= rightMatch.index) { + rightMatch = null; + } else { + leftMatch = null; + } + } + // Paths (LM: leftMatch, RM: rightMatch, OT: openTokens): + // LM | RM | OT | Result + // 1 | 0 | 1 | loop + // 1 | 0 | 0 | loop + // 0 | 1 | 1 | loop + // 0 | 1 | 0 | throw + // 0 | 0 | 1 | throw + // 0 | 0 | 0 | break + // The paths above don't include the sticky mode special case. The loop ends after the + // first completed match if not `global`. + if (leftMatch || rightMatch) { + delimStart = (leftMatch || rightMatch).index; + delimEnd = delimStart + (leftMatch || rightMatch)[0].length; + } else if (!openTokens) { + break; + } + if (sticky && !openTokens && delimStart > lastOuterEnd) { + break; + } + if (leftMatch) { + if (!openTokens) { + outerStart = delimStart; + innerStart = delimEnd; + } + ++openTokens; + } else if (rightMatch && openTokens) { + if (!--openTokens) { + if (vN) { + if (vN[0] && outerStart > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd, outerStart), lastOuterEnd, outerStart)); + } + if (vN[1]) { + output.push(row(vN[1], str.slice(outerStart, innerStart), outerStart, innerStart)); + } + if (vN[2]) { + output.push(row(vN[2], str.slice(innerStart, delimStart), innerStart, delimStart)); + } + if (vN[3]) { + output.push(row(vN[3], str.slice(delimStart, delimEnd), delimStart, delimEnd)); + } + } else { + output.push(str.slice(innerStart, delimStart)); + } + lastOuterEnd = delimEnd; + if (!global) { + break; + } + } + } else { + throw new Error('Unbalanced delimiter found in string'); + } + // If the delimiter matched an empty string, avoid an infinite loop + if (delimStart === delimEnd) { + ++delimEnd; + } + } + + if (global && !sticky && vN && vN[0] && str.length > lastOuterEnd) { + output.push(row(vN[0], str.slice(lastOuterEnd), lastOuterEnd, str.length)); + } + + return output; + }; + +}; diff --git a/tools/eslint/node_modules/xregexp/src/addons/unicode-base.js b/tools/eslint/node_modules/xregexp/src/addons/unicode-base.js new file mode 100644 index 00000000000000..2a323041b60e3e --- /dev/null +++ b/tools/eslint/node_modules/xregexp/src/addons/unicode-base.js @@ -0,0 +1,236 @@ +/*! + * XRegExp Unicode Base 3.1.0 + * + * Steven Levithan (c) 2008-2016 MIT License + */ + +/** + * Adds base support for Unicode matching: + * - Adds syntax `\p{..}` for matching Unicode tokens. Tokens can be inverted using `\P{..}` or + * `\p{^..}`. Token names ignore case, spaces, hyphens, and underscores. You can omit the braces + * for token names that are a single letter (e.g. `\pL` or `PL`). + * - Adds flag A (astral), which enables 21-bit Unicode support. + * - Adds the `XRegExp.addUnicodeData` method used by other addons to provide character data. + * + * Unicode Base relies on externally provided Unicode character data. Official addons are available + * to provide data for Unicode categories, scripts, blocks, and properties. + * + * @requires XRegExp + */ +module.exports = function(XRegExp) { + 'use strict'; + +// Storage for Unicode data + var unicode = {}; + +/* ============================== + * Private functions + * ============================== */ + +// Generates a token lookup name: lowercase, with hyphens, spaces, and underscores removed + function normalize(name) { + return name.replace(/[- _]+/g, '').toLowerCase(); + } + +// Adds leading zeros if shorter than four characters + function pad4(str) { + while (str.length < 4) { + str = '0' + str; + } + return str; + } + +// Converts a hexadecimal number to decimal + function dec(hex) { + return parseInt(hex, 16); + } + +// Converts a decimal number to hexadecimal + function hex(dec) { + return parseInt(dec, 10).toString(16); + } + +// Gets the decimal code of a literal code unit, \xHH, \uHHHH, or a backslash-escaped literal + function charCode(chr) { + var esc = /^\\[xu](.+)/.exec(chr); + return esc ? + dec(esc[1]) : + chr.charCodeAt(chr.charAt(0) === '\\' ? 1 : 0); + } + +// Inverts a list of ordered BMP characters and ranges + function invertBmp(range) { + var output = '', + lastEnd = -1, + start; + XRegExp.forEach(range, /(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/, function(m) { + start = charCode(m[1]); + if (start > (lastEnd + 1)) { + output += '\\u' + pad4(hex(lastEnd + 1)); + if (start > (lastEnd + 2)) { + output += '-\\u' + pad4(hex(start - 1)); + } + } + lastEnd = charCode(m[2] || m[1]); + }); + if (lastEnd < 0xFFFF) { + output += '\\u' + pad4(hex(lastEnd + 1)); + if (lastEnd < 0xFFFE) { + output += '-\\uFFFF'; + } + } + return output; + } + +// Generates an inverted BMP range on first use + function cacheInvertedBmp(slug) { + var prop = 'b!'; + return unicode[slug][prop] || ( + unicode[slug][prop] = invertBmp(unicode[slug].bmp) + ); + } + +// Combines and optionally negates BMP and astral data + function buildAstral(slug, isNegated) { + var item = unicode[slug], + combined = ''; + if (item.bmp && !item.isBmpLast) { + combined = '[' + item.bmp + ']' + (item.astral ? '|' : ''); + } + if (item.astral) { + combined += item.astral; + } + if (item.isBmpLast && item.bmp) { + combined += (item.astral ? '|' : '') + '[' + item.bmp + ']'; + } + // Astral Unicode tokens always match a code point, never a code unit + return isNegated ? + '(?:(?!' + combined + ')(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[\0-\uFFFF]))' : + '(?:' + combined + ')'; + } + +// Builds a complete astral pattern on first use + function cacheAstral(slug, isNegated) { + var prop = isNegated ? 'a!' : 'a='; + return unicode[slug][prop] || ( + unicode[slug][prop] = buildAstral(slug, isNegated) + ); + } + +/* ============================== + * Core functionality + * ============================== */ + +/* + * Add Unicode token syntax: \p{..}, \P{..}, \p{^..}. Also add astral mode (flag A). + */ + XRegExp.addToken( + // Use `*` instead of `+` to avoid capturing `^` as the token name in `\p{^}` + /\\([pP])(?:{(\^?)([^}]*)}|([A-Za-z]))/, + function(match, scope, flags) { + var ERR_DOUBLE_NEG = 'Invalid double negation ', + ERR_UNKNOWN_NAME = 'Unknown Unicode token ', + ERR_UNKNOWN_REF = 'Unicode token missing data ', + ERR_ASTRAL_ONLY = 'Astral mode required for Unicode token ', + ERR_ASTRAL_IN_CLASS = 'Astral mode does not support Unicode tokens within character classes', + // Negated via \P{..} or \p{^..} + isNegated = match[1] === 'P' || !!match[2], + // Switch from BMP (0-FFFF) to astral (0-10FFFF) mode via flag A + isAstralMode = flags.indexOf('A') > -1, + // Token lookup name. Check `[4]` first to avoid passing `undefined` via `\p{}` + slug = normalize(match[4] || match[3]), + // Token data object + item = unicode[slug]; + + if (match[1] === 'P' && match[2]) { + throw new SyntaxError(ERR_DOUBLE_NEG + match[0]); + } + if (!unicode.hasOwnProperty(slug)) { + throw new SyntaxError(ERR_UNKNOWN_NAME + match[0]); + } + + // Switch to the negated form of the referenced Unicode token + if (item.inverseOf) { + slug = normalize(item.inverseOf); + if (!unicode.hasOwnProperty(slug)) { + throw new ReferenceError(ERR_UNKNOWN_REF + match[0] + ' -> ' + item.inverseOf); + } + item = unicode[slug]; + isNegated = !isNegated; + } + + if (!(item.bmp || isAstralMode)) { + throw new SyntaxError(ERR_ASTRAL_ONLY + match[0]); + } + if (isAstralMode) { + if (scope === 'class') { + throw new SyntaxError(ERR_ASTRAL_IN_CLASS); + } + + return cacheAstral(slug, isNegated); + } + + return scope === 'class' ? + (isNegated ? cacheInvertedBmp(slug) : item.bmp) : + (isNegated ? '[^' : '[') + item.bmp + ']'; + }, + { + scope: 'all', + optionalFlags: 'A', + leadChar: '\\' + } + ); + +/** + * Adds to the list of Unicode tokens that XRegExp regexes can match via `\p` or `\P`. + * + * @memberOf XRegExp + * @param {Array} data Objects with named character ranges. Each object may have properties `name`, + * `alias`, `isBmpLast`, `inverseOf`, `bmp`, and `astral`. All but `name` are optional, although + * one of `bmp` or `astral` is required (unless `inverseOf` is set). If `astral` is absent, the + * `bmp` data is used for BMP and astral modes. If `bmp` is absent, the name errors in BMP mode + * but works in astral mode. If both `bmp` and `astral` are provided, the `bmp` data only is used + * in BMP mode, and the combination of `bmp` and `astral` data is used in astral mode. + * `isBmpLast` is needed when a token matches orphan high surrogates *and* uses surrogate pairs + * to match astral code points. The `bmp` and `astral` data should be a combination of literal + * characters and `\xHH` or `\uHHHH` escape sequences, with hyphens to create ranges. Any regex + * metacharacters in the data should be escaped, apart from range-creating hyphens. The `astral` + * data can additionally use character classes and alternation, and should use surrogate pairs to + * represent astral code points. `inverseOf` can be used to avoid duplicating character data if a + * Unicode token is defined as the exact inverse of another token. + * @example + * + * // Basic use + * XRegExp.addUnicodeData([{ + * name: 'XDigit', + * alias: 'Hexadecimal', + * bmp: '0-9A-Fa-f' + * }]); + * XRegExp('\\p{XDigit}:\\p{Hexadecimal}+').test('0:3D'); // -> true + */ + XRegExp.addUnicodeData = function(data) { + var ERR_NO_NAME = 'Unicode token requires name', + ERR_NO_DATA = 'Unicode token has no character data ', + item, + i; + + for (i = 0; i < data.length; ++i) { + item = data[i]; + if (!item.name) { + throw new Error(ERR_NO_NAME); + } + if (!(item.inverseOf || item.bmp || item.astral)) { + throw new Error(ERR_NO_DATA + item.name); + } + unicode[normalize(item.name)] = item; + if (item.alias) { + unicode[normalize(item.alias)] = item; + } + } + + // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and + // flags might now produce different results + XRegExp.cache.flush('patterns'); + }; + +}; diff --git a/tools/eslint/node_modules/xregexp/src/addons/unicode-blocks.js b/tools/eslint/node_modules/xregexp/src/addons/unicode-blocks.js new file mode 100644 index 00000000000000..918dc9d5c45742 --- /dev/null +++ b/tools/eslint/node_modules/xregexp/src/addons/unicode-blocks.js @@ -0,0 +1,1074 @@ +/*! + * XRegExp Unicode Blocks 3.1.0 + * + * Steven Levithan (c) 2010-2016 MIT License + * Unicode data by Mathias Bynens + */ + +/** + * Adds support for all Unicode blocks. Block names use the prefix 'In'. E.g., `\p{InBasicLatin}`. + * Token names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 8.0.0. + * + * @requires XRegExp, Unicode Base + */ +module.exports = function(XRegExp) { + 'use strict'; + + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Blocks'); + } + + XRegExp.addUnicodeData([ + { + name: 'InAegean_Numbers', + astral: '\uD800[\uDD00-\uDD3F]' + }, + { + name: 'InAhom', + astral: '\uD805[\uDF00-\uDF3F]' + }, + { + name: 'InAlchemical_Symbols', + astral: '\uD83D[\uDF00-\uDF7F]' + }, + { + name: 'InAlphabetic_Presentation_Forms', + bmp: '\uFB00-\uFB4F' + }, + { + name: 'InAnatolian_Hieroglyphs', + astral: '\uD811[\uDC00-\uDE7F]' + }, + { + name: 'InAncient_Greek_Musical_Notation', + astral: '\uD834[\uDE00-\uDE4F]' + }, + { + name: 'InAncient_Greek_Numbers', + astral: '\uD800[\uDD40-\uDD8F]' + }, + { + name: 'InAncient_Symbols', + astral: '\uD800[\uDD90-\uDDCF]' + }, + { + name: 'InArabic', + bmp: '\u0600-\u06FF' + }, + { + name: 'InArabic_Extended_A', + bmp: '\u08A0-\u08FF' + }, + { + name: 'InArabic_Mathematical_Alphabetic_Symbols', + astral: '\uD83B[\uDE00-\uDEFF]' + }, + { + name: 'InArabic_Presentation_Forms_A', + bmp: '\uFB50-\uFDFF' + }, + { + name: 'InArabic_Presentation_Forms_B', + bmp: '\uFE70-\uFEFF' + }, + { + name: 'InArabic_Supplement', + bmp: '\u0750-\u077F' + }, + { + name: 'InArmenian', + bmp: '\u0530-\u058F' + }, + { + name: 'InArrows', + bmp: '\u2190-\u21FF' + }, + { + name: 'InAvestan', + astral: '\uD802[\uDF00-\uDF3F]' + }, + { + name: 'InBalinese', + bmp: '\u1B00-\u1B7F' + }, + { + name: 'InBamum', + bmp: '\uA6A0-\uA6FF' + }, + { + name: 'InBamum_Supplement', + astral: '\uD81A[\uDC00-\uDE3F]' + }, + { + name: 'InBasic_Latin', + bmp: '\0-\x7F' + }, + { + name: 'InBassa_Vah', + astral: '\uD81A[\uDED0-\uDEFF]' + }, + { + name: 'InBatak', + bmp: '\u1BC0-\u1BFF' + }, + { + name: 'InBengali', + bmp: '\u0980-\u09FF' + }, + { + name: 'InBlock_Elements', + bmp: '\u2580-\u259F' + }, + { + name: 'InBopomofo', + bmp: '\u3100-\u312F' + }, + { + name: 'InBopomofo_Extended', + bmp: '\u31A0-\u31BF' + }, + { + name: 'InBox_Drawing', + bmp: '\u2500-\u257F' + }, + { + name: 'InBrahmi', + astral: '\uD804[\uDC00-\uDC7F]' + }, + { + name: 'InBraille_Patterns', + bmp: '\u2800-\u28FF' + }, + { + name: 'InBuginese', + bmp: '\u1A00-\u1A1F' + }, + { + name: 'InBuhid', + bmp: '\u1740-\u175F' + }, + { + name: 'InByzantine_Musical_Symbols', + astral: '\uD834[\uDC00-\uDCFF]' + }, + { + name: 'InCJK_Compatibility', + bmp: '\u3300-\u33FF' + }, + { + name: 'InCJK_Compatibility_Forms', + bmp: '\uFE30-\uFE4F' + }, + { + name: 'InCJK_Compatibility_Ideographs', + bmp: '\uF900-\uFAFF' + }, + { + name: 'InCJK_Compatibility_Ideographs_Supplement', + astral: '\uD87E[\uDC00-\uDE1F]' + }, + { + name: 'InCJK_Radicals_Supplement', + bmp: '\u2E80-\u2EFF' + }, + { + name: 'InCJK_Strokes', + bmp: '\u31C0-\u31EF' + }, + { + name: 'InCJK_Symbols_and_Punctuation', + bmp: '\u3000-\u303F' + }, + { + name: 'InCJK_Unified_Ideographs', + bmp: '\u4E00-\u9FFF' + }, + { + name: 'InCJK_Unified_Ideographs_Extension_A', + bmp: '\u3400-\u4DBF' + }, + { + name: 'InCJK_Unified_Ideographs_Extension_B', + astral: '[\uD840-\uD868][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF]' + }, + { + name: 'InCJK_Unified_Ideographs_Extension_C', + astral: '\uD86D[\uDC00-\uDF3F]|[\uD86A-\uD86C][\uDC00-\uDFFF]|\uD869[\uDF00-\uDFFF]' + }, + { + name: 'InCJK_Unified_Ideographs_Extension_D', + astral: '\uD86D[\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1F]' + }, + { + name: 'InCJK_Unified_Ideographs_Extension_E', + astral: '[\uD86F-\uD872][\uDC00-\uDFFF]|\uD873[\uDC00-\uDEAF]|\uD86E[\uDC20-\uDFFF]' + }, + { + name: 'InCarian', + astral: '\uD800[\uDEA0-\uDEDF]' + }, + { + name: 'InCaucasian_Albanian', + astral: '\uD801[\uDD30-\uDD6F]' + }, + { + name: 'InChakma', + astral: '\uD804[\uDD00-\uDD4F]' + }, + { + name: 'InCham', + bmp: '\uAA00-\uAA5F' + }, + { + name: 'InCherokee', + bmp: '\u13A0-\u13FF' + }, + { + name: 'InCherokee_Supplement', + bmp: '\uAB70-\uABBF' + }, + { + name: 'InCombining_Diacritical_Marks', + bmp: '\u0300-\u036F' + }, + { + name: 'InCombining_Diacritical_Marks_Extended', + bmp: '\u1AB0-\u1AFF' + }, + { + name: 'InCombining_Diacritical_Marks_Supplement', + bmp: '\u1DC0-\u1DFF' + }, + { + name: 'InCombining_Diacritical_Marks_for_Symbols', + bmp: '\u20D0-\u20FF' + }, + { + name: 'InCombining_Half_Marks', + bmp: '\uFE20-\uFE2F' + }, + { + name: 'InCommon_Indic_Number_Forms', + bmp: '\uA830-\uA83F' + }, + { + name: 'InControl_Pictures', + bmp: '\u2400-\u243F' + }, + { + name: 'InCoptic', + bmp: '\u2C80-\u2CFF' + }, + { + name: 'InCoptic_Epact_Numbers', + astral: '\uD800[\uDEE0-\uDEFF]' + }, + { + name: 'InCounting_Rod_Numerals', + astral: '\uD834[\uDF60-\uDF7F]' + }, + { + name: 'InCuneiform', + astral: '\uD808[\uDC00-\uDFFF]' + }, + { + name: 'InCuneiform_Numbers_and_Punctuation', + astral: '\uD809[\uDC00-\uDC7F]' + }, + { + name: 'InCurrency_Symbols', + bmp: '\u20A0-\u20CF' + }, + { + name: 'InCypriot_Syllabary', + astral: '\uD802[\uDC00-\uDC3F]' + }, + { + name: 'InCyrillic', + bmp: '\u0400-\u04FF' + }, + { + name: 'InCyrillic_Extended_A', + bmp: '\u2DE0-\u2DFF' + }, + { + name: 'InCyrillic_Extended_B', + bmp: '\uA640-\uA69F' + }, + { + name: 'InCyrillic_Supplement', + bmp: '\u0500-\u052F' + }, + { + name: 'InDeseret', + astral: '\uD801[\uDC00-\uDC4F]' + }, + { + name: 'InDevanagari', + bmp: '\u0900-\u097F' + }, + { + name: 'InDevanagari_Extended', + bmp: '\uA8E0-\uA8FF' + }, + { + name: 'InDingbats', + bmp: '\u2700-\u27BF' + }, + { + name: 'InDomino_Tiles', + astral: '\uD83C[\uDC30-\uDC9F]' + }, + { + name: 'InDuployan', + astral: '\uD82F[\uDC00-\uDC9F]' + }, + { + name: 'InEarly_Dynastic_Cuneiform', + astral: '\uD809[\uDC80-\uDD4F]' + }, + { + name: 'InEgyptian_Hieroglyphs', + astral: '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F]' + }, + { + name: 'InElbasan', + astral: '\uD801[\uDD00-\uDD2F]' + }, + { + name: 'InEmoticons', + astral: '\uD83D[\uDE00-\uDE4F]' + }, + { + name: 'InEnclosed_Alphanumeric_Supplement', + astral: '\uD83C[\uDD00-\uDDFF]' + }, + { + name: 'InEnclosed_Alphanumerics', + bmp: '\u2460-\u24FF' + }, + { + name: 'InEnclosed_CJK_Letters_and_Months', + bmp: '\u3200-\u32FF' + }, + { + name: 'InEnclosed_Ideographic_Supplement', + astral: '\uD83C[\uDE00-\uDEFF]' + }, + { + name: 'InEthiopic', + bmp: '\u1200-\u137F' + }, + { + name: 'InEthiopic_Extended', + bmp: '\u2D80-\u2DDF' + }, + { + name: 'InEthiopic_Extended_A', + bmp: '\uAB00-\uAB2F' + }, + { + name: 'InEthiopic_Supplement', + bmp: '\u1380-\u139F' + }, + { + name: 'InGeneral_Punctuation', + bmp: '\u2000-\u206F' + }, + { + name: 'InGeometric_Shapes', + bmp: '\u25A0-\u25FF' + }, + { + name: 'InGeometric_Shapes_Extended', + astral: '\uD83D[\uDF80-\uDFFF]' + }, + { + name: 'InGeorgian', + bmp: '\u10A0-\u10FF' + }, + { + name: 'InGeorgian_Supplement', + bmp: '\u2D00-\u2D2F' + }, + { + name: 'InGlagolitic', + bmp: '\u2C00-\u2C5F' + }, + { + name: 'InGothic', + astral: '\uD800[\uDF30-\uDF4F]' + }, + { + name: 'InGrantha', + astral: '\uD804[\uDF00-\uDF7F]' + }, + { + name: 'InGreek_Extended', + bmp: '\u1F00-\u1FFF' + }, + { + name: 'InGreek_and_Coptic', + bmp: '\u0370-\u03FF' + }, + { + name: 'InGujarati', + bmp: '\u0A80-\u0AFF' + }, + { + name: 'InGurmukhi', + bmp: '\u0A00-\u0A7F' + }, + { + name: 'InHalfwidth_and_Fullwidth_Forms', + bmp: '\uFF00-\uFFEF' + }, + { + name: 'InHangul_Compatibility_Jamo', + bmp: '\u3130-\u318F' + }, + { + name: 'InHangul_Jamo', + bmp: '\u1100-\u11FF' + }, + { + name: 'InHangul_Jamo_Extended_A', + bmp: '\uA960-\uA97F' + }, + { + name: 'InHangul_Jamo_Extended_B', + bmp: '\uD7B0-\uD7FF' + }, + { + name: 'InHangul_Syllables', + bmp: '\uAC00-\uD7AF' + }, + { + name: 'InHanunoo', + bmp: '\u1720-\u173F' + }, + { + name: 'InHatran', + astral: '\uD802[\uDCE0-\uDCFF]' + }, + { + name: 'InHebrew', + bmp: '\u0590-\u05FF' + }, + { + name: 'InHigh_Private_Use_Surrogates', + bmp: '\uDB80-\uDBFF' + }, + { + name: 'InHigh_Surrogates', + bmp: '\uD800-\uDB7F' + }, + { + name: 'InHiragana', + bmp: '\u3040-\u309F' + }, + { + name: 'InIPA_Extensions', + bmp: '\u0250-\u02AF' + }, + { + name: 'InIdeographic_Description_Characters', + bmp: '\u2FF0-\u2FFF' + }, + { + name: 'InImperial_Aramaic', + astral: '\uD802[\uDC40-\uDC5F]' + }, + { + name: 'InInscriptional_Pahlavi', + astral: '\uD802[\uDF60-\uDF7F]' + }, + { + name: 'InInscriptional_Parthian', + astral: '\uD802[\uDF40-\uDF5F]' + }, + { + name: 'InJavanese', + bmp: '\uA980-\uA9DF' + }, + { + name: 'InKaithi', + astral: '\uD804[\uDC80-\uDCCF]' + }, + { + name: 'InKana_Supplement', + astral: '\uD82C[\uDC00-\uDCFF]' + }, + { + name: 'InKanbun', + bmp: '\u3190-\u319F' + }, + { + name: 'InKangxi_Radicals', + bmp: '\u2F00-\u2FDF' + }, + { + name: 'InKannada', + bmp: '\u0C80-\u0CFF' + }, + { + name: 'InKatakana', + bmp: '\u30A0-\u30FF' + }, + { + name: 'InKatakana_Phonetic_Extensions', + bmp: '\u31F0-\u31FF' + }, + { + name: 'InKayah_Li', + bmp: '\uA900-\uA92F' + }, + { + name: 'InKharoshthi', + astral: '\uD802[\uDE00-\uDE5F]' + }, + { + name: 'InKhmer', + bmp: '\u1780-\u17FF' + }, + { + name: 'InKhmer_Symbols', + bmp: '\u19E0-\u19FF' + }, + { + name: 'InKhojki', + astral: '\uD804[\uDE00-\uDE4F]' + }, + { + name: 'InKhudawadi', + astral: '\uD804[\uDEB0-\uDEFF]' + }, + { + name: 'InLao', + bmp: '\u0E80-\u0EFF' + }, + { + name: 'InLatin_Extended_Additional', + bmp: '\u1E00-\u1EFF' + }, + { + name: 'InLatin_Extended_A', + bmp: '\u0100-\u017F' + }, + { + name: 'InLatin_Extended_B', + bmp: '\u0180-\u024F' + }, + { + name: 'InLatin_Extended_C', + bmp: '\u2C60-\u2C7F' + }, + { + name: 'InLatin_Extended_D', + bmp: '\uA720-\uA7FF' + }, + { + name: 'InLatin_Extended_E', + bmp: '\uAB30-\uAB6F' + }, + { + name: 'InLatin_1_Supplement', + bmp: '\x80-\xFF' + }, + { + name: 'InLepcha', + bmp: '\u1C00-\u1C4F' + }, + { + name: 'InLetterlike_Symbols', + bmp: '\u2100-\u214F' + }, + { + name: 'InLimbu', + bmp: '\u1900-\u194F' + }, + { + name: 'InLinear_A', + astral: '\uD801[\uDE00-\uDF7F]' + }, + { + name: 'InLinear_B_Ideograms', + astral: '\uD800[\uDC80-\uDCFF]' + }, + { + name: 'InLinear_B_Syllabary', + astral: '\uD800[\uDC00-\uDC7F]' + }, + { + name: 'InLisu', + bmp: '\uA4D0-\uA4FF' + }, + { + name: 'InLow_Surrogates', + bmp: '\uDC00-\uDFFF' + }, + { + name: 'InLycian', + astral: '\uD800[\uDE80-\uDE9F]' + }, + { + name: 'InLydian', + astral: '\uD802[\uDD20-\uDD3F]' + }, + { + name: 'InMahajani', + astral: '\uD804[\uDD50-\uDD7F]' + }, + { + name: 'InMahjong_Tiles', + astral: '\uD83C[\uDC00-\uDC2F]' + }, + { + name: 'InMalayalam', + bmp: '\u0D00-\u0D7F' + }, + { + name: 'InMandaic', + bmp: '\u0840-\u085F' + }, + { + name: 'InManichaean', + astral: '\uD802[\uDEC0-\uDEFF]' + }, + { + name: 'InMathematical_Alphanumeric_Symbols', + astral: '\uD835[\uDC00-\uDFFF]' + }, + { + name: 'InMathematical_Operators', + bmp: '\u2200-\u22FF' + }, + { + name: 'InMeetei_Mayek', + bmp: '\uABC0-\uABFF' + }, + { + name: 'InMeetei_Mayek_Extensions', + bmp: '\uAAE0-\uAAFF' + }, + { + name: 'InMende_Kikakui', + astral: '\uD83A[\uDC00-\uDCDF]' + }, + { + name: 'InMeroitic_Cursive', + astral: '\uD802[\uDDA0-\uDDFF]' + }, + { + name: 'InMeroitic_Hieroglyphs', + astral: '\uD802[\uDD80-\uDD9F]' + }, + { + name: 'InMiao', + astral: '\uD81B[\uDF00-\uDF9F]' + }, + { + name: 'InMiscellaneous_Mathematical_Symbols_A', + bmp: '\u27C0-\u27EF' + }, + { + name: 'InMiscellaneous_Mathematical_Symbols_B', + bmp: '\u2980-\u29FF' + }, + { + name: 'InMiscellaneous_Symbols', + bmp: '\u2600-\u26FF' + }, + { + name: 'InMiscellaneous_Symbols_and_Arrows', + bmp: '\u2B00-\u2BFF' + }, + { + name: 'InMiscellaneous_Symbols_and_Pictographs', + astral: '\uD83D[\uDC00-\uDDFF]|\uD83C[\uDF00-\uDFFF]' + }, + { + name: 'InMiscellaneous_Technical', + bmp: '\u2300-\u23FF' + }, + { + name: 'InModi', + astral: '\uD805[\uDE00-\uDE5F]' + }, + { + name: 'InModifier_Tone_Letters', + bmp: '\uA700-\uA71F' + }, + { + name: 'InMongolian', + bmp: '\u1800-\u18AF' + }, + { + name: 'InMro', + astral: '\uD81A[\uDE40-\uDE6F]' + }, + { + name: 'InMultani', + astral: '\uD804[\uDE80-\uDEAF]' + }, + { + name: 'InMusical_Symbols', + astral: '\uD834[\uDD00-\uDDFF]' + }, + { + name: 'InMyanmar', + bmp: '\u1000-\u109F' + }, + { + name: 'InMyanmar_Extended_A', + bmp: '\uAA60-\uAA7F' + }, + { + name: 'InMyanmar_Extended_B', + bmp: '\uA9E0-\uA9FF' + }, + { + name: 'InNKo', + bmp: '\u07C0-\u07FF' + }, + { + name: 'InNabataean', + astral: '\uD802[\uDC80-\uDCAF]' + }, + { + name: 'InNew_Tai_Lue', + bmp: '\u1980-\u19DF' + }, + { + name: 'InNumber_Forms', + bmp: '\u2150-\u218F' + }, + { + name: 'InOgham', + bmp: '\u1680-\u169F' + }, + { + name: 'InOl_Chiki', + bmp: '\u1C50-\u1C7F' + }, + { + name: 'InOld_Hungarian', + astral: '\uD803[\uDC80-\uDCFF]' + }, + { + name: 'InOld_Italic', + astral: '\uD800[\uDF00-\uDF2F]' + }, + { + name: 'InOld_North_Arabian', + astral: '\uD802[\uDE80-\uDE9F]' + }, + { + name: 'InOld_Permic', + astral: '\uD800[\uDF50-\uDF7F]' + }, + { + name: 'InOld_Persian', + astral: '\uD800[\uDFA0-\uDFDF]' + }, + { + name: 'InOld_South_Arabian', + astral: '\uD802[\uDE60-\uDE7F]' + }, + { + name: 'InOld_Turkic', + astral: '\uD803[\uDC00-\uDC4F]' + }, + { + name: 'InOptical_Character_Recognition', + bmp: '\u2440-\u245F' + }, + { + name: 'InOriya', + bmp: '\u0B00-\u0B7F' + }, + { + name: 'InOrnamental_Dingbats', + astral: '\uD83D[\uDE50-\uDE7F]' + }, + { + name: 'InOsmanya', + astral: '\uD801[\uDC80-\uDCAF]' + }, + { + name: 'InPahawh_Hmong', + astral: '\uD81A[\uDF00-\uDF8F]' + }, + { + name: 'InPalmyrene', + astral: '\uD802[\uDC60-\uDC7F]' + }, + { + name: 'InPau_Cin_Hau', + astral: '\uD806[\uDEC0-\uDEFF]' + }, + { + name: 'InPhags_pa', + bmp: '\uA840-\uA87F' + }, + { + name: 'InPhaistos_Disc', + astral: '\uD800[\uDDD0-\uDDFF]' + }, + { + name: 'InPhoenician', + astral: '\uD802[\uDD00-\uDD1F]' + }, + { + name: 'InPhonetic_Extensions', + bmp: '\u1D00-\u1D7F' + }, + { + name: 'InPhonetic_Extensions_Supplement', + bmp: '\u1D80-\u1DBF' + }, + { + name: 'InPlaying_Cards', + astral: '\uD83C[\uDCA0-\uDCFF]' + }, + { + name: 'InPrivate_Use_Area', + bmp: '\uE000-\uF8FF' + }, + { + name: 'InPsalter_Pahlavi', + astral: '\uD802[\uDF80-\uDFAF]' + }, + { + name: 'InRejang', + bmp: '\uA930-\uA95F' + }, + { + name: 'InRumi_Numeral_Symbols', + astral: '\uD803[\uDE60-\uDE7F]' + }, + { + name: 'InRunic', + bmp: '\u16A0-\u16FF' + }, + { + name: 'InSamaritan', + bmp: '\u0800-\u083F' + }, + { + name: 'InSaurashtra', + bmp: '\uA880-\uA8DF' + }, + { + name: 'InSharada', + astral: '\uD804[\uDD80-\uDDDF]' + }, + { + name: 'InShavian', + astral: '\uD801[\uDC50-\uDC7F]' + }, + { + name: 'InShorthand_Format_Controls', + astral: '\uD82F[\uDCA0-\uDCAF]' + }, + { + name: 'InSiddham', + astral: '\uD805[\uDD80-\uDDFF]' + }, + { + name: 'InSinhala', + bmp: '\u0D80-\u0DFF' + }, + { + name: 'InSinhala_Archaic_Numbers', + astral: '\uD804[\uDDE0-\uDDFF]' + }, + { + name: 'InSmall_Form_Variants', + bmp: '\uFE50-\uFE6F' + }, + { + name: 'InSora_Sompeng', + astral: '\uD804[\uDCD0-\uDCFF]' + }, + { + name: 'InSpacing_Modifier_Letters', + bmp: '\u02B0-\u02FF' + }, + { + name: 'InSpecials', + bmp: '\uFFF0-\uFFFF' + }, + { + name: 'InSundanese', + bmp: '\u1B80-\u1BBF' + }, + { + name: 'InSundanese_Supplement', + bmp: '\u1CC0-\u1CCF' + }, + { + name: 'InSuperscripts_and_Subscripts', + bmp: '\u2070-\u209F' + }, + { + name: 'InSupplemental_Arrows_A', + bmp: '\u27F0-\u27FF' + }, + { + name: 'InSupplemental_Arrows_B', + bmp: '\u2900-\u297F' + }, + { + name: 'InSupplemental_Arrows_C', + astral: '\uD83E[\uDC00-\uDCFF]' + }, + { + name: 'InSupplemental_Mathematical_Operators', + bmp: '\u2A00-\u2AFF' + }, + { + name: 'InSupplemental_Punctuation', + bmp: '\u2E00-\u2E7F' + }, + { + name: 'InSupplemental_Symbols_and_Pictographs', + astral: '\uD83E[\uDD00-\uDDFF]' + }, + { + name: 'InSupplementary_Private_Use_Area_A', + astral: '[\uDB80-\uDBBF][\uDC00-\uDFFF]' + }, + { + name: 'InSupplementary_Private_Use_Area_B', + astral: '[\uDBC0-\uDBFF][\uDC00-\uDFFF]' + }, + { + name: 'InSutton_SignWriting', + astral: '\uD836[\uDC00-\uDEAF]' + }, + { + name: 'InSyloti_Nagri', + bmp: '\uA800-\uA82F' + }, + { + name: 'InSyriac', + bmp: '\u0700-\u074F' + }, + { + name: 'InTagalog', + bmp: '\u1700-\u171F' + }, + { + name: 'InTagbanwa', + bmp: '\u1760-\u177F' + }, + { + name: 'InTags', + astral: '\uDB40[\uDC00-\uDC7F]' + }, + { + name: 'InTai_Le', + bmp: '\u1950-\u197F' + }, + { + name: 'InTai_Tham', + bmp: '\u1A20-\u1AAF' + }, + { + name: 'InTai_Viet', + bmp: '\uAA80-\uAADF' + }, + { + name: 'InTai_Xuan_Jing_Symbols', + astral: '\uD834[\uDF00-\uDF5F]' + }, + { + name: 'InTakri', + astral: '\uD805[\uDE80-\uDECF]' + }, + { + name: 'InTamil', + bmp: '\u0B80-\u0BFF' + }, + { + name: 'InTelugu', + bmp: '\u0C00-\u0C7F' + }, + { + name: 'InThaana', + bmp: '\u0780-\u07BF' + }, + { + name: 'InThai', + bmp: '\u0E00-\u0E7F' + }, + { + name: 'InTibetan', + bmp: '\u0F00-\u0FFF' + }, + { + name: 'InTifinagh', + bmp: '\u2D30-\u2D7F' + }, + { + name: 'InTirhuta', + astral: '\uD805[\uDC80-\uDCDF]' + }, + { + name: 'InTransport_and_Map_Symbols', + astral: '\uD83D[\uDE80-\uDEFF]' + }, + { + name: 'InUgaritic', + astral: '\uD800[\uDF80-\uDF9F]' + }, + { + name: 'InUnified_Canadian_Aboriginal_Syllabics', + bmp: '\u1400-\u167F' + }, + { + name: 'InUnified_Canadian_Aboriginal_Syllabics_Extended', + bmp: '\u18B0-\u18FF' + }, + { + name: 'InVai', + bmp: '\uA500-\uA63F' + }, + { + name: 'InVariation_Selectors', + bmp: '\uFE00-\uFE0F' + }, + { + name: 'InVariation_Selectors_Supplement', + astral: '\uDB40[\uDD00-\uDDEF]' + }, + { + name: 'InVedic_Extensions', + bmp: '\u1CD0-\u1CFF' + }, + { + name: 'InVertical_Forms', + bmp: '\uFE10-\uFE1F' + }, + { + name: 'InWarang_Citi', + astral: '\uD806[\uDCA0-\uDCFF]' + }, + { + name: 'InYi_Radicals', + bmp: '\uA490-\uA4CF' + }, + { + name: 'InYi_Syllables', + bmp: '\uA000-\uA48F' + }, + { + name: 'InYijing_Hexagram_Symbols', + bmp: '\u4DC0-\u4DFF' + } + ]); + +}; diff --git a/tools/eslint/node_modules/xregexp/src/addons/unicode-categories.js b/tools/eslint/node_modules/xregexp/src/addons/unicode-categories.js new file mode 100644 index 00000000000000..6da732f505abcc --- /dev/null +++ b/tools/eslint/node_modules/xregexp/src/addons/unicode-categories.js @@ -0,0 +1,235 @@ +/*! + * XRegExp Unicode Categories 3.1.0 + * + * Steven Levithan (c) 2010-2016 MIT License + * Unicode data by Mathias Bynens + */ + +/** + * Adds support for Unicode's general categories. E.g., `\p{Lu}` or `\p{Uppercase Letter}`. See + * category descriptions in UAX #44 . Token names + * are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 8.0.0. + * + * @requires XRegExp, Unicode Base + */ +module.exports = function(XRegExp) { + 'use strict'; + + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Categories'); + } + + XRegExp.addUnicodeData([ + { + name: 'C', + alias: 'Other', + isBmpLast: true, + bmp: '\0-\x1F\x7F-\x9F\xAD\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u0560\u0588\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08B5-\u08E2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0AFA-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D00\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5E\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180E\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7\u1CFA-\u1CFF\u1DF6-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BF-\u20CF\u20F1-\u20FF\u218C-\u218F\u23FB-\u23FF\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BBA-\u2BBC\u2BC9\u2BD2-\u2BEB\u2BF0-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E43-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FD6-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7AE\uA7AF\uA7B8-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FE\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF', + astral: '\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD73-\uDD7A\uDDE9-\uDDFF\uDE46-\uDEFF\uDF57-\uDF5F\uDF72-\uDFFF]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD6F\uDD9B-\uDDE5\uDE03-\uDE0F\uDE3B-\uDE3F\uDE49-\uDE4F\uDE52-\uDEFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|\uD81B[\uDC00-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFFF]|\uD86E[\uDC1E\uDC1F]|\uD83D[\uDD7A\uDDA4\uDED1-\uDEDF\uDEED-\uDEEF\uDEF4-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8D-\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2F\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCBD\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD44-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3E-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF3B\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD86D[\uDF35-\uDF3F]|[\uD807\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD81C-\uD82B\uD82D\uD82E\uD830-\uD833\uD837-\uD839\uD83F\uD874-\uD87D\uD87F-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD806[\uDC00-\uDC9F\uDCF3-\uDCFE\uDD00-\uDEBF\uDEF9-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD00-\uDE5F\uDE7F-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD805[\uDC00-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1A-\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE34-\uDE37\uDE3B-\uDE3E\uDE48-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA0-\uDFFF]|\uD82C[\uDC02-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDD0F\uDD19-\uDD7F\uDD85-\uDDBF\uDDC1-\uDFFF]|\uD873[\uDEA2-\uDFFF]' + }, + { + name: 'Cc', + alias: 'Control', + bmp: '\0-\x1F\x7F-\x9F' + }, + { + name: 'Cf', + alias: 'Format', + bmp: '\xAD\u0600-\u0605\u061C\u06DD\u070F\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB', + astral: '\uDB40[\uDC01\uDC20-\uDC7F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uD804\uDCBD' + }, + { + name: 'Cn', + alias: 'Unassigned', + bmp: '\u0378\u0379\u0380-\u0383\u038B\u038D\u03A2\u0530\u0557\u0558\u0560\u0588\u058B\u058C\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u05FF\u061D\u070E\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08B5-\u08E2\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0AF8\u0AFA-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0BFF\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D00\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5E\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F6\u13F7\u13FE\u13FF\u169D-\u169F\u16F9-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE\u1AAF\u1ABF-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7\u1CFA-\u1CFF\u1DF6-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u2065\u2072\u2073\u208F\u209D-\u209F\u20BF-\u20CF\u20F1-\u20FF\u218C-\u218F\u23FB-\u23FF\u2427-\u243F\u244B-\u245F\u2B74\u2B75\u2B96\u2B97\u2BBA-\u2BBC\u2BC9\u2BD2-\u2BEB\u2BF0-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E43-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FD6-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA6F8-\uA6FF\uA7AE\uA7AF\uA7B8-\uA7F6\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FE\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB66-\uAB6F\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD\uFEFE\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFF8\uFFFE\uFFFF', + astral: '\uDB40[\uDC00\uDC02-\uDC1F\uDC80-\uDCFF\uDDF0-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDDE9-\uDDFF\uDE46-\uDEFF\uDF57-\uDF5F\uDF72-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD6F\uDD9B-\uDDE5\uDE03-\uDE0F\uDE3B-\uDE3F\uDE49-\uDE4F\uDE52-\uDEFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDE6D\uDE70-\uDECF\uDEEE\uDEEF\uDEF6-\uDEFF\uDF46-\uDF4F\uDF5A\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD809[\uDC6F\uDC75-\uDC7F\uDD44-\uDFFF]|\uD81B[\uDC00-\uDEFF\uDF45-\uDF4F\uDF7F-\uDF8E\uDFA0-\uDFFF]|\uD86E[\uDC1E\uDC1F]|\uD83D[\uDD7A\uDDA4\uDED1-\uDEDF\uDEED-\uDEEF\uDEF4-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCFF\uDD28-\uDD2F\uDD64-\uDD6E\uDD70-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDCFF\uDD03-\uDD06\uDD34-\uDD36\uDD8D-\uDD8F\uDD9C-\uDD9F\uDDA1-\uDDCF\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEFC-\uDEFF\uDF24-\uDF2F\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDFC4-\uDFC7\uDFD6-\uDFFF]|\uD869[\uDED7-\uDEFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDEEF\uDEF2-\uDFFF]|[\uDBBF\uDBFF][\uDFFE\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A\uDC9B\uDCA4-\uDFFF]|\uD83A[\uDCC5\uDCC6\uDCD7-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD86D[\uDF35-\uDF3F]|[\uD807\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD81C-\uD82B\uD82D\uD82E\uD830-\uD833\uD837-\uD839\uD83F\uD874-\uD87D\uD87F-\uDB3F\uDB41-\uDB7F][\uDC00-\uDFFF]|\uD806[\uDC00-\uDC9F\uDCF3-\uDCFE\uDD00-\uDEBF\uDEF9-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCF9\uDD00-\uDE5F\uDE7F-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]|\uD836[\uDE8C-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD805[\uDC00-\uDC7F\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDDE-\uDDFF\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB8-\uDEBF\uDECA-\uDEFF\uDF1A-\uDF1C\uDF2C-\uDF2F\uDF40-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56\uDC9F-\uDCA6\uDCB0-\uDCDF\uDCF3\uDCF6-\uDCFA\uDD1C-\uDD1E\uDD3A-\uDD3E\uDD40-\uDD7F\uDDB8-\uDDBB\uDDD0\uDDD1\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE34-\uDE37\uDE3B-\uDE3E\uDE48-\uDE4F\uDE59-\uDE5F\uDEA0-\uDEBF\uDEE7-\uDEEA\uDEF7-\uDEFF\uDF36-\uDF38\uDF56\uDF57\uDF73-\uDF77\uDF92-\uDF98\uDF9D-\uDFA8\uDFB0-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD804[\uDC4E-\uDC51\uDC70-\uDC7E\uDCC2-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD44-\uDD4F\uDD77-\uDD7F\uDDCE\uDDCF\uDDE0\uDDF5-\uDDFF\uDE12\uDE3E-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEAA-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF3B\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD82C[\uDC02-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDD0F\uDD19-\uDD7F\uDD85-\uDDBF\uDDC1-\uDFFF]|\uD873[\uDEA2-\uDFFF]' + }, + { + name: 'Co', + alias: 'Private_Use', + bmp: '\uE000-\uF8FF', + astral: '[\uDB80-\uDBBE\uDBC0-\uDBFE][\uDC00-\uDFFF]|[\uDBBF\uDBFF][\uDC00-\uDFFD]' + }, + { + name: 'Cs', + alias: 'Surrogate', + bmp: '\uD800-\uDFFF' + }, + { + name: 'L', + alias: 'Letter', + bmp: 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\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\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + astral: '\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD83A[\uDC00-\uDCC4]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD80D[\uDC00-\uDC2E]|\uD87E[\uDC00-\uDE1D]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD809[\uDC80-\uDD43]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD808[\uDC00-\uDF99]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD811[\uDC00-\uDE46]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD82C[\uDC00\uDC01]|\uD873[\uDC00-\uDEA1]' + }, + { + name: 'Ll', + alias: 'Lowercase_Letter', + bmp: 'a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0561-\u0587\u13F8-\u13FD\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7B5\uA7B7\uA7FA\uAB30-\uAB5A\uAB60-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + astral: '\uD803[\uDCC0-\uDCF2]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD801[\uDC28-\uDC4F]|\uD806[\uDCC0-\uDCDF]' + }, + { + name: 'Lm', + alias: 'Modifier_Letter', + bmp: '\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA69C\uA69D\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uA9E6\uAA70\uAADD\uAAF3\uAAF4\uAB5C-\uAB5F\uFF70\uFF9E\uFF9F', + astral: '\uD81A[\uDF40-\uDF43]|\uD81B[\uDF93-\uDF9F]' + }, + { + name: 'Lo', + alias: 'Other_Letter', + bmp: '\xAA\xBA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05F0-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10D0-\u10FA\u10FD-\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\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA78F\uA7F7\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9E0-\uA9E4\uA9E7-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\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\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + astral: '\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD83A[\uDC00-\uDCC4]|\uD803[\uDC00-\uDC48]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD80D[\uDC00-\uDC2E]|\uD87E[\uDC00-\uDE1D]|\uD81B[\uDF00-\uDF44\uDF50]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCFF\uDEC0-\uDEF8]|\uD809[\uDC80-\uDD43]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD808[\uDC00-\uDF99]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF63-\uDF77\uDF7D-\uDF8F]|\uD801[\uDC50-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD811[\uDC00-\uDE46]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD82C[\uDC00\uDC01]|\uD873[\uDC00-\uDEA1]' + }, + { + name: 'Lt', + alias: 'Titlecase_Letter', + bmp: '\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC' + }, + { + name: 'Lu', + alias: 'Uppercase_Letter', + bmp: 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AD\uA7B0-\uA7B4\uA7B6\uFF21-\uFF3A', + astral: '\uD806[\uDCA0-\uDCBF]|\uD803[\uDC80-\uDCB2]|\uD801[\uDC00-\uDC27]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]' + }, + { + name: 'M', + alias: 'Mark', + bmp: '\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + astral: '\uD805[\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDCA-\uDDCC\uDE2C-\uDE37\uDEDF-\uDEEA\uDF00-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD82F[\uDC9D\uDC9E]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]' + }, + { + name: 'Mc', + alias: 'Spacing_Mark', + bmp: '\u0903\u093B\u093E-\u0940\u0949-\u094C\u094E\u094F\u0982\u0983\u09BE-\u09C0\u09C7\u09C8\u09CB\u09CC\u09D7\u0A03\u0A3E-\u0A40\u0A83\u0ABE-\u0AC0\u0AC9\u0ACB\u0ACC\u0B02\u0B03\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD7\u0C01-\u0C03\u0C41-\u0C44\u0C82\u0C83\u0CBE\u0CC0-\u0CC4\u0CC7\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0D02\u0D03\u0D3E-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D57\u0D82\u0D83\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DF2\u0DF3\u0F3E\u0F3F\u0F7F\u102B\u102C\u1031\u1038\u103B\u103C\u1056\u1057\u1062-\u1064\u1067-\u106D\u1083\u1084\u1087-\u108C\u108F\u109A-\u109C\u17B6\u17BE-\u17C5\u17C7\u17C8\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1A19\u1A1A\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1B04\u1B35\u1B3B\u1B3D-\u1B41\u1B43\u1B44\u1B82\u1BA1\u1BA6\u1BA7\u1BAA\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1C24-\u1C2B\u1C34\u1C35\u1CE1\u1CF2\u1CF3\u302E\u302F\uA823\uA824\uA827\uA880\uA881\uA8B4-\uA8C3\uA952\uA953\uA983\uA9B4\uA9B5\uA9BA\uA9BB\uA9BD-\uA9C0\uAA2F\uAA30\uAA33\uAA34\uAA4D\uAA7B\uAA7D\uAAEB\uAAEE\uAAEF\uAAF5\uABE3\uABE4\uABE6\uABE7\uABE9\uABEA\uABEC', + astral: '\uD834[\uDD65\uDD66\uDD6D-\uDD72]|\uD804[\uDC00\uDC02\uDC82\uDCB0-\uDCB2\uDCB7\uDCB8\uDD2C\uDD82\uDDB3-\uDDB5\uDDBF\uDDC0\uDE2C-\uDE2E\uDE32\uDE33\uDE35\uDEE0-\uDEE2\uDF02\uDF03\uDF3E\uDF3F\uDF41-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63]|\uD805[\uDCB0-\uDCB2\uDCB9\uDCBB-\uDCBE\uDCC1\uDDAF-\uDDB1\uDDB8-\uDDBB\uDDBE\uDE30-\uDE32\uDE3B\uDE3C\uDE3E\uDEAC\uDEAE\uDEAF\uDEB6\uDF20\uDF21\uDF26]|\uD81B[\uDF51-\uDF7E]' + }, + { + name: 'Me', + alias: 'Enclosing_Mark', + bmp: '\u0488\u0489\u1ABE\u20DD-\u20E0\u20E2-\u20E4\uA670-\uA672' + }, + { + name: 'Mn', + alias: 'Nonspacing_Mark', + bmp: '\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D01\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F', + astral: '\uD805[\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC01\uDC38-\uDC46\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDCA-\uDDCC\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]' + }, + { + name: 'N', + alias: 'Number', + bmp: '0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + astral: '\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E]|\uD835[\uDFCE-\uDFFF]|\uD83A[\uDCC7-\uDCCF]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD806[\uDCE0-\uDCF2]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD834[\uDF60-\uDF71]|\uD83C[\uDD00-\uDD0C]|\uD809[\uDC00-\uDC6E]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE47\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD805[\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]' + }, + { + name: 'Nd', + alias: 'Decimal_Number', + bmp: '0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19', + astral: '\uD801[\uDCA0-\uDCA9]|\uD835[\uDFCE-\uDFFF]|\uD805[\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59]' + }, + { + name: 'Nl', + alias: 'Letter_Number', + bmp: '\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF', + astral: '\uD809[\uDC00-\uDC6E]|\uD800[\uDD40-\uDD74\uDF41\uDF4A\uDFD1-\uDFD5]' + }, + { + name: 'No', + alias: 'Other_Number', + bmp: '\xB2\xB3\xB9\xBC-\xBE\u09F4-\u09F9\u0B72-\u0B77\u0BF0-\u0BF2\u0C78-\u0C7E\u0D70-\u0D75\u0F2A-\u0F33\u1369-\u137C\u17F0-\u17F9\u19DA\u2070\u2074-\u2079\u2080-\u2089\u2150-\u215F\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA830-\uA835', + astral: '\uD804[\uDC52-\uDC65\uDDE1-\uDDF4]|\uD803[\uDCFA-\uDCFF\uDE60-\uDE7E]|\uD83C[\uDD00-\uDD0C]|\uD806[\uDCEA-\uDCF2]|\uD83A[\uDCC7-\uDCCF]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE47\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD805[\uDF3A\uDF3B]|\uD81A[\uDF5B-\uDF61]|\uD834[\uDF60-\uDF71]|\uD800[\uDD07-\uDD33\uDD75-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23]' + }, + { + name: 'P', + alias: 'Punctuation', + bmp: '\x21-\x23\x25-\\x2A\x2C-\x2F\x3A\x3B\\x3F\x40\\x5B-\\x5D\x5F\\x7B\x7D\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65', + astral: '\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD809[\uDC70-\uDC74]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD836[\uDE87-\uDE8B]|\uD801\uDD6F|\uD82F\uDC9F|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]' + }, + { + name: 'Pc', + alias: 'Connector_Punctuation', + bmp: '\x5F\u203F\u2040\u2054\uFE33\uFE34\uFE4D-\uFE4F\uFF3F' + }, + { + name: 'Pd', + alias: 'Dash_Punctuation', + bmp: '\\x2D\u058A\u05BE\u1400\u1806\u2010-\u2015\u2E17\u2E1A\u2E3A\u2E3B\u2E40\u301C\u3030\u30A0\uFE31\uFE32\uFE58\uFE63\uFF0D' + }, + { + name: 'Pe', + alias: 'Close_Punctuation', + bmp: '\\x29\\x5D\x7D\u0F3B\u0F3D\u169C\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E23\u2E25\u2E27\u2E29\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63' + }, + { + name: 'Pf', + alias: 'Final_Punctuation', + bmp: '\xBB\u2019\u201D\u203A\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21' + }, + { + name: 'Pi', + alias: 'Initial_Punctuation', + bmp: '\xAB\u2018\u201B\u201C\u201F\u2039\u2E02\u2E04\u2E09\u2E0C\u2E1C\u2E20' + }, + { + name: 'Po', + alias: 'Other_Punctuation', + bmp: '\x21-\x23\x25-\x27\\x2A\x2C\\x2E\x2F\x3A\x3B\\x3F\x40\\x5C\xA1\xA7\xB6\xB7\xBF\u037E\u0387\u055A-\u055F\u0589\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u166D\u166E\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u1805\u1807-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2016\u2017\u2020-\u2027\u2030-\u2038\u203B-\u203E\u2041-\u2043\u2047-\u2051\u2053\u2055-\u205E\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00\u2E01\u2E06-\u2E08\u2E0B\u2E0E-\u2E16\u2E18\u2E19\u2E1B\u2E1E\u2E1F\u2E2A-\u2E2E\u2E30-\u2E39\u2E3C-\u2E3F\u2E41\u3001-\u3003\u303D\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFE10-\uFE16\uFE19\uFE30\uFE45\uFE46\uFE49-\uFE4C\uFE50-\uFE52\uFE54-\uFE57\uFE5F-\uFE61\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF07\uFF0A\uFF0C\uFF0E\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3C\uFF61\uFF64\uFF65', + astral: '\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD809[\uDC70-\uDC74]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD836[\uDE87-\uDE8B]|\uD801\uDD6F|\uD82F\uDC9F|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]' + }, + { + name: 'Ps', + alias: 'Open_Punctuation', + bmp: '\\x28\\x5B\\x7B\u0F3A\u0F3C\u169B\u201A\u201E\u2045\u207D\u208D\u2308\u230A\u2329\u2768\u276A\u276C\u276E\u2770\u2772\u2774\u27C5\u27E6\u27E8\u27EA\u27EC\u27EE\u2983\u2985\u2987\u2989\u298B\u298D\u298F\u2991\u2993\u2995\u2997\u29D8\u29DA\u29FC\u2E22\u2E24\u2E26\u2E28\u2E42\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFD3F\uFE17\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE47\uFE59\uFE5B\uFE5D\uFF08\uFF3B\uFF5B\uFF5F\uFF62' + }, + { + name: 'S', + alias: 'Symbol', + bmp: '\\x24\\x2B\x3C-\x3E\\x5E\x60\\x7C\x7E\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BE\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u23FA\u2400-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B98-\u2BB9\u2BBD-\u2BC8\u2BCA-\u2BD1\u2BEC-\u2BEF\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD', + astral: '\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD10-\uDD18\uDD80-\uDD84\uDDC0]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDD9A\uDDE6-\uDE02\uDE10-\uDE3A\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDFFF]|\uD83D[\uDC00-\uDD79\uDD7B-\uDDA3\uDDA5-\uDED0\uDEE0-\uDEEC\uDEF0-\uDEF3\uDF00-\uDF73\uDF80-\uDFD4]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD82F\uDC9C|\uD805\uDF3F|\uD802[\uDC77\uDC78\uDEC8]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD83B[\uDEF0\uDEF1]' + }, + { + name: 'Sc', + alias: 'Currency_Symbol', + bmp: '\\x24\xA2-\xA5\u058F\u060B\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BE\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6' + }, + { + name: 'Sk', + alias: 'Modifier_Symbol', + bmp: '\\x5E\x60\xA8\xAF\xB4\xB8\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u309B\u309C\uA700-\uA716\uA720\uA721\uA789\uA78A\uAB5B\uFBB2-\uFBC1\uFF3E\uFF40\uFFE3', + astral: '\uD83C[\uDFFB-\uDFFF]' + }, + { + name: 'Sm', + alias: 'Math_Symbol', + bmp: '\\x2B\x3C-\x3E\\x7C\x7E\xAC\xB1\xD7\xF7\u03F6\u0606-\u0608\u2044\u2052\u207A-\u207C\u208A-\u208C\u2118\u2140-\u2144\u214B\u2190-\u2194\u219A\u219B\u21A0\u21A3\u21A6\u21AE\u21CE\u21CF\u21D2\u21D4\u21F4-\u22FF\u2320\u2321\u237C\u239B-\u23B3\u23DC-\u23E1\u25B7\u25C1\u25F8-\u25FF\u266F\u27C0-\u27C4\u27C7-\u27E5\u27F0-\u27FF\u2900-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2AFF\u2B30-\u2B44\u2B47-\u2B4C\uFB29\uFE62\uFE64-\uFE66\uFF0B\uFF1C-\uFF1E\uFF5C\uFF5E\uFFE2\uFFE9-\uFFEC', + astral: '\uD83B[\uDEF0\uDEF1]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]' + }, + { + name: 'So', + alias: 'Other_Symbol', + bmp: '\xA6\xA9\xAE\xB0\u0482\u058D\u058E\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u09FA\u0B70\u0BF3-\u0BF8\u0BFA\u0C7F\u0D79\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116\u2117\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u214A\u214C\u214D\u214F\u218A\u218B\u2195-\u2199\u219C-\u219F\u21A1\u21A2\u21A4\u21A5\u21A7-\u21AD\u21AF-\u21CD\u21D0\u21D1\u21D3\u21D5-\u21F3\u2300-\u2307\u230C-\u231F\u2322-\u2328\u232B-\u237B\u237D-\u239A\u23B4-\u23DB\u23E2-\u23FA\u2400-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u25B6\u25B8-\u25C0\u25C2-\u25F7\u2600-\u266E\u2670-\u2767\u2794-\u27BF\u2800-\u28FF\u2B00-\u2B2F\u2B45\u2B46\u2B4D-\u2B73\u2B76-\u2B95\u2B98-\u2BB9\u2BBD-\u2BC8\u2BCA-\u2BD1\u2BEC-\u2BEF\u2CE5-\u2CEA\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA828-\uA82B\uA836\uA837\uA839\uAA77-\uAA79\uFDFD\uFFE4\uFFE8\uFFED\uFFEE\uFFFC\uFFFD', + astral: '\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD10-\uDD18\uDD80-\uDD84\uDDC0]|\uD83D[\uDC00-\uDD79\uDD7B-\uDDA3\uDDA5-\uDED0\uDEE0-\uDEEC\uDEF0-\uDEF3\uDF00-\uDF73\uDF80-\uDFD4]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDD9A\uDDE6-\uDE02\uDE10-\uDE3A\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDFFA]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C\uDD90-\uDD9B\uDDA0\uDDD0-\uDDFC]|\uD82F\uDC9C|\uD805\uDF3F|\uD802[\uDC77\uDC78\uDEC8]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]' + }, + { + name: 'Z', + alias: 'Separator', + bmp: '\x20\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + }, + { + name: 'Zl', + alias: 'Line_Separator', + bmp: '\u2028' + }, + { + name: 'Zp', + alias: 'Paragraph_Separator', + bmp: '\u2029' + }, + { + name: 'Zs', + alias: 'Space_Separator', + bmp: '\x20\xA0\u1680\u2000-\u200A\u202F\u205F\u3000' + } + ]); + +}; diff --git a/tools/eslint/node_modules/xregexp/src/addons/unicode-properties.js b/tools/eslint/node_modules/xregexp/src/addons/unicode-properties.js new file mode 100644 index 00000000000000..92a041b4f85839 --- /dev/null +++ b/tools/eslint/node_modules/xregexp/src/addons/unicode-properties.js @@ -0,0 +1,105 @@ +/*! + * XRegExp Unicode Properties 3.1.0 + * + * Steven Levithan (c) 2012-2016 MIT License + * Unicode data by Mathias Bynens + */ + +/** + * Adds properties to meet the UTS #18 Level 1 RL1.2 requirements for Unicode regex support. See + * . Following are definitions of these properties from UAX + * #44 : + * + * - Alphabetic + * Characters with the Alphabetic property. Generated from: Lowercase + Uppercase + Lt + Lm + Lo + + * Nl + Other_Alphabetic. + * + * - Default_Ignorable_Code_Point + * For programmatic determination of default ignorable code points. New characters that should be + * ignored in rendering (unless explicitly supported) will be assigned in these ranges, permitting + * programs to correctly handle the default rendering of such characters when not otherwise + * supported. + * + * - Lowercase + * Characters with the Lowercase property. Generated from: Ll + Other_Lowercase. + * + * - Noncharacter_Code_Point + * Code points permanently reserved for internal use. + * + * - Uppercase + * Characters with the Uppercase property. Generated from: Lu + Other_Uppercase. + * + * - White_Space + * Spaces, separator characters and other control characters which should be treated by + * programming languages as "white space" for the purpose of parsing elements. + * + * The properties ASCII, Any, and Assigned are also included but are not defined in UAX #44. UTS #18 + * RL1.2 additionally requires support for Unicode scripts and general categories. These are + * included in XRegExp's Unicode Categories and Unicode Scripts addons. + * + * Token names are case insensitive, and any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 8.0.0. + * + * @requires XRegExp, Unicode Base + */ +module.exports = function(XRegExp) { + 'use strict'; + + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Properties'); + } + + var unicodeData = [ + { + name: 'ASCII', + bmp: '\0-\x7F' + }, + { + name: 'Alphabetic', + bmp: 'A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0345\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05B0-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0657\u0659-\u065F\u066E-\u06D3\u06D5-\u06DC\u06E1-\u06E8\u06ED-\u06EF\u06FA-\u06FC\u06FF\u0710-\u073F\u074D-\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0817\u081A-\u082C\u0840-\u0858\u08A0-\u08B4\u08E3-\u08E9\u08F0-\u093B\u093D-\u094C\u094E-\u0950\u0955-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C4\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A42\u0A47\u0A48\u0A4B\u0A4C\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC5\u0AC7-\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0-\u0AE3\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D-\u0B44\u0B47\u0B48\u0B4B\u0B4C\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4C\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCC\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E46\u0E4D\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0ECD\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F71-\u0F81\u0F88-\u0F97\u0F99-\u0FBC\u1000-\u1036\u1038\u103B-\u103F\u1050-\u1062\u1065-\u1068\u106E-\u1086\u108E\u109C\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1713\u1720-\u1733\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17B3\u17B6-\u17C8\u17D7\u17DC\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u1938\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A61-\u1A74\u1AA7\u1B00-\u1B33\u1B35-\u1B43\u1B45-\u1B4B\u1B80-\u1BA9\u1BAC-\u1BAF\u1BBA-\u1BE5\u1BE7-\u1BF1\u1C00-\u1C35\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1D00-\u1DBF\u1DE7-\u1DF4\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u24B6-\u24E9\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\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA674-\uA67B\uA67F-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA827\uA840-\uA873\uA880-\uA8C3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA92A\uA930-\uA952\uA960-\uA97C\uA980-\uA9B2\uA9B4-\uA9BF\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A\uAA7E-\uAABE\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC', + astral: '\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD804[\uDC00-\uDC45\uDC82-\uDCB8\uDCD0-\uDCE8\uDD00-\uDD32\uDD50-\uDD72\uDD76\uDD80-\uDDBF\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE34\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEE8\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D-\uDF44\uDF47\uDF48\uDF4B\uDF4C\uDF50\uDF57\uDF5D-\uDF63]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD83A[\uDC00-\uDCC4]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF36\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]|\uD80D[\uDC00-\uDC2E]|\uD87E[\uDC00-\uDE1D]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9E]|\uD808[\uDC00-\uDF99]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD805[\uDC80-\uDCC1\uDCC4\uDCC5\uDCC7\uDD80-\uDDB5\uDDB8-\uDDBE\uDDD8-\uDDDD\uDE00-\uDE3E\uDE40\uDE44\uDE80-\uDEB5\uDF00-\uDF19\uDF1D-\uDF2A]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD811[\uDC00-\uDE46]|\uD82C[\uDC00\uDC01]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF93-\uDF9F]|\uD873[\uDC00-\uDEA1]' + }, + { + name: 'Any', + isBmpLast: true, + bmp: '\0-\uFFFF', + astral: '[\uD800-\uDBFF][\uDC00-\uDFFF]' + }, + { + name: 'Default_Ignorable_Code_Point', + bmp: '\xAD\u034F\u061C\u115F\u1160\u17B4\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8', + astral: '[\uDB40-\uDB43][\uDC00-\uDFFF]|\uD834[\uDD73-\uDD7A]|\uD82F[\uDCA0-\uDCA3]' + }, + { + name: 'Lowercase', + bmp: 'a-z\xAA\xB5\xBA\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02B8\u02C0\u02C1\u02E0-\u02E4\u0345\u0371\u0373\u0377\u037A-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0561-\u0587\u13F8-\u13FD\u1D00-\u1DBF\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u2071\u207F\u2090-\u209C\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2170-\u217F\u2184\u24D0-\u24E9\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7D\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B-\uA69D\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7B5\uA7B7\uA7F8-\uA7FA\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A', + astral: '\uD803[\uDCC0-\uDCF2]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD801[\uDC28-\uDC4F]|\uD806[\uDCC0-\uDCDF]' + }, + { + name: 'Noncharacter_Code_Point', + bmp: '\uFDD0-\uFDEF\uFFFE\uFFFF', + astral: '[\uDB3F\uDB7F\uDBBF\uDBFF\uD83F\uD87F\uD8BF\uDAFF\uD97F\uD9BF\uD9FF\uDA3F\uD8FF\uDABF\uDA7F\uD93F][\uDFFE\uDFFF]' + }, + { + name: 'Uppercase', + bmp: 'A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2160-\u216F\u2183\u24B6-\u24CF\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AD\uA7B0-\uA7B4\uA7B6\uFF21-\uFF3A', + astral: '\uD806[\uDCA0-\uDCBF]|\uD803[\uDC80-\uDCB2]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD801[\uDC00-\uDC27]|\uD83C[\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]' + }, + { + name: 'White_Space', + bmp: '\x09-\x0D\x20\x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000' + } + ]; + + // Add non-generated data + unicodeData.push({ + name: 'Assigned', + // Since this is defined as the inverse of Unicode category Cn (Unassigned), the Unicode + // Categories addon is required to use this property + inverseOf: 'Cn' + }); + + XRegExp.addUnicodeData(unicodeData); + +}; diff --git a/tools/eslint/node_modules/xregexp/src/addons/unicode-scripts.js b/tools/eslint/node_modules/xregexp/src/addons/unicode-scripts.js new file mode 100644 index 00000000000000..bb28ec36a09b31 --- /dev/null +++ b/tools/eslint/node_modules/xregexp/src/addons/unicode-scripts.js @@ -0,0 +1,559 @@ +/*! + * XRegExp Unicode Scripts 3.1.0 + * + * Steven Levithan (c) 2010-2016 MIT License + * Unicode data by Mathias Bynens + */ + +/** + * Adds support for all Unicode scripts. E.g., `\p{Latin}`. Token names are case insensitive, and + * any spaces, hyphens, and underscores are ignored. + * + * Uses Unicode 8.0.0. + * + * @requires XRegExp, Unicode Base + */ +module.exports = function(XRegExp) { + 'use strict'; + + if (!XRegExp.addUnicodeData) { + throw new ReferenceError('Unicode Base must be loaded before Unicode Scripts'); + } + + XRegExp.addUnicodeData([ + { + name: 'Ahom', + astral: '\uD805[\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF3F]' + }, + { + name: 'Anatolian_Hieroglyphs', + astral: '\uD811[\uDC00-\uDE46]' + }, + { + name: 'Arabic', + bmp: '\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u06FF\u0750-\u077F\u08A0-\u08B4\u08E3-\u08FF\uFB50-\uFBC1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFD\uFE70-\uFE74\uFE76-\uFEFC', + astral: '\uD803[\uDE60-\uDE7E]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]' + }, + { + name: 'Armenian', + bmp: '\u0531-\u0556\u0559-\u055F\u0561-\u0587\u058A\u058D-\u058F\uFB13-\uFB17' + }, + { + name: 'Avestan', + astral: '\uD802[\uDF00-\uDF35\uDF39-\uDF3F]' + }, + { + name: 'Balinese', + bmp: '\u1B00-\u1B4B\u1B50-\u1B7C' + }, + { + name: 'Bamum', + bmp: '\uA6A0-\uA6F7', + astral: '\uD81A[\uDC00-\uDE38]' + }, + { + name: 'Bassa_Vah', + astral: '\uD81A[\uDED0-\uDEED\uDEF0-\uDEF5]' + }, + { + name: 'Batak', + bmp: '\u1BC0-\u1BF3\u1BFC-\u1BFF' + }, + { + name: 'Bengali', + bmp: '\u0980-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FB' + }, + { + name: 'Bopomofo', + bmp: '\u02EA\u02EB\u3105-\u312D\u31A0-\u31BA' + }, + { + name: 'Brahmi', + astral: '\uD804[\uDC00-\uDC4D\uDC52-\uDC6F\uDC7F]' + }, + { + name: 'Braille', + bmp: '\u2800-\u28FF' + }, + { + name: 'Buginese', + bmp: '\u1A00-\u1A1B\u1A1E\u1A1F' + }, + { + name: 'Buhid', + bmp: '\u1740-\u1753' + }, + { + name: 'Canadian_Aboriginal', + bmp: '\u1400-\u167F\u18B0-\u18F5' + }, + { + name: 'Carian', + astral: '\uD800[\uDEA0-\uDED0]' + }, + { + name: 'Caucasian_Albanian', + astral: '\uD801[\uDD30-\uDD63\uDD6F]' + }, + { + name: 'Chakma', + astral: '\uD804[\uDD00-\uDD34\uDD36-\uDD43]' + }, + { + name: 'Cham', + bmp: '\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAA5F' + }, + { + name: 'Cherokee', + bmp: '\u13A0-\u13F5\u13F8-\u13FD\uAB70-\uABBF' + }, + { + name: 'Common', + bmp: '\0-\x40\\x5B-\x60\\x7B-\xA9\xAB-\xB9\xBB-\xBF\xD7\xF7\u02B9-\u02DF\u02E5-\u02E9\u02EC-\u02FF\u0374\u037E\u0385\u0387\u0589\u0605\u060C\u061B\u061C\u061F\u0640\u06DD\u0964\u0965\u0E3F\u0FD5-\u0FD8\u10FB\u16EB-\u16ED\u1735\u1736\u1802\u1803\u1805\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u2000-\u200B\u200E-\u2064\u2066-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20BE\u2100-\u2125\u2127-\u2129\u212C-\u2131\u2133-\u214D\u214F-\u215F\u2189-\u218B\u2190-\u23FA\u2400-\u2426\u2440-\u244A\u2460-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B98-\u2BB9\u2BBD-\u2BC8\u2BCA-\u2BD1\u2BEC-\u2BEF\u2E00-\u2E42\u2FF0-\u2FFB\u3000-\u3004\u3006\u3008-\u3020\u3030-\u3037\u303C-\u303F\u309B\u309C\u30A0\u30FB\u30FC\u3190-\u319F\u31C0-\u31E3\u3220-\u325F\u327F-\u32CF\u3358-\u33FF\u4DC0-\u4DFF\uA700-\uA721\uA788-\uA78A\uA830-\uA839\uA92E\uA9CF\uAB5B\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFF70\uFF9E\uFF9F\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD', + astral: '\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDD10-\uDD18\uDD80-\uDD84\uDDC0]|\uD82F[\uDCA0-\uDCA3]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDFCB\uDFCE-\uDFFF]|\uDB40[\uDC01\uDC20-\uDC7F]|\uD83D[\uDC00-\uDD79\uDD7B-\uDDA3\uDDA5-\uDED0\uDEE0-\uDEEC\uDEF0-\uDEF3\uDF00-\uDF73\uDF80-\uDFD4]|\uD800[\uDD00-\uDD02\uDD07-\uDD33\uDD37-\uDD3F\uDD90-\uDD9B\uDDD0-\uDDFC\uDEE1-\uDEFB]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD66\uDD6A-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDF00-\uDF56\uDF60-\uDF71]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD00-\uDD0C\uDD10-\uDD2E\uDD30-\uDD6B\uDD70-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE10-\uDE3A\uDE40-\uDE48\uDE50\uDE51\uDF00-\uDFFF]' + }, + { + name: 'Coptic', + bmp: '\u03E2-\u03EF\u2C80-\u2CF3\u2CF9-\u2CFF' + }, + { + name: 'Cuneiform', + astral: '\uD809[\uDC00-\uDC6E\uDC70-\uDC74\uDC80-\uDD43]|\uD808[\uDC00-\uDF99]' + }, + { + name: 'Cypriot', + astral: '\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F]' + }, + { + name: 'Cyrillic', + bmp: '\u0400-\u0484\u0487-\u052F\u1D2B\u1D78\u2DE0-\u2DFF\uA640-\uA69F\uFE2E\uFE2F' + }, + { + name: 'Deseret', + astral: '\uD801[\uDC00-\uDC4F]' + }, + { + name: 'Devanagari', + bmp: '\u0900-\u0950\u0953-\u0963\u0966-\u097F\uA8E0-\uA8FD' + }, + { + name: 'Duployan', + astral: '\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]' + }, + { + name: 'Egyptian_Hieroglyphs', + astral: '\uD80C[\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]' + }, + { + name: 'Elbasan', + astral: '\uD801[\uDD00-\uDD27]' + }, + { + name: 'Ethiopic', + bmp: '\u1200-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E' + }, + { + name: 'Georgian', + bmp: '\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u10FF\u2D00-\u2D25\u2D27\u2D2D' + }, + { + name: 'Glagolitic', + bmp: '\u2C00-\u2C2E\u2C30-\u2C5E' + }, + { + name: 'Gothic', + astral: '\uD800[\uDF30-\uDF4A]' + }, + { + name: 'Grantha', + astral: '\uD804[\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]' + }, + { + name: 'Greek', + bmp: '\u0370-\u0373\u0375-\u0377\u037A-\u037D\u037F\u0384\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03E1\u03F0-\u03FF\u1D26-\u1D2A\u1D5D-\u1D61\u1D66-\u1D6A\u1DBF\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u2126\uAB65', + astral: '\uD800[\uDD40-\uDD8C\uDDA0]|\uD834[\uDE00-\uDE45]' + }, + { + name: 'Gujarati', + bmp: '\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9' + }, + { + name: 'Gurmukhi', + bmp: '\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75' + }, + { + name: 'Han', + bmp: '\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3400-\u4DB5\u4E00-\u9FD5\uF900-\uFA6D\uFA70-\uFAD9', + astral: '\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD87E[\uDC00-\uDE1D]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD873[\uDC00-\uDEA1]' + }, + { + name: 'Hangul', + bmp: '\u1100-\u11FF\u302E\u302F\u3131-\u318E\u3200-\u321E\u3260-\u327E\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC' + }, + { + name: 'Hanunoo', + bmp: '\u1720-\u1734' + }, + { + name: 'Hatran', + astral: '\uD802[\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDCFF]' + }, + { + name: 'Hebrew', + bmp: '\u0591-\u05C7\u05D0-\u05EA\u05F0-\u05F4\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFB4F' + }, + { + name: 'Hiragana', + bmp: '\u3041-\u3096\u309D-\u309F', + astral: '\uD82C\uDC01|\uD83C\uDE00' + }, + { + name: 'Imperial_Aramaic', + astral: '\uD802[\uDC40-\uDC55\uDC57-\uDC5F]' + }, + { + name: 'Inherited', + bmp: '\u0300-\u036F\u0485\u0486\u064B-\u0655\u0670\u0951\u0952\u1AB0-\u1ABE\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u200C\u200D\u20D0-\u20F0\u302A-\u302D\u3099\u309A\uFE00-\uFE0F\uFE20-\uFE2D', + astral: '\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uD800[\uDDFD\uDEE0]|\uDB40[\uDD00-\uDDEF]' + }, + { + name: 'Inscriptional_Pahlavi', + astral: '\uD802[\uDF60-\uDF72\uDF78-\uDF7F]' + }, + { + name: 'Inscriptional_Parthian', + astral: '\uD802[\uDF40-\uDF55\uDF58-\uDF5F]' + }, + { + name: 'Javanese', + bmp: '\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE\uA9DF' + }, + { + name: 'Kaithi', + astral: '\uD804[\uDC80-\uDCC1]' + }, + { + name: 'Kannada', + bmp: '\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2' + }, + { + name: 'Katakana', + bmp: '\u30A1-\u30FA\u30FD-\u30FF\u31F0-\u31FF\u32D0-\u32FE\u3300-\u3357\uFF66-\uFF6F\uFF71-\uFF9D', + astral: '\uD82C\uDC00' + }, + { + name: 'Kayah_Li', + bmp: '\uA900-\uA92D\uA92F' + }, + { + name: 'Kharoshthi', + astral: '\uD802[\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F-\uDE47\uDE50-\uDE58]' + }, + { + name: 'Khmer', + bmp: '\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u19E0-\u19FF' + }, + { + name: 'Khojki', + astral: '\uD804[\uDE00-\uDE11\uDE13-\uDE3D]' + }, + { + name: 'Khudawadi', + astral: '\uD804[\uDEB0-\uDEEA\uDEF0-\uDEF9]' + }, + { + name: 'Lao', + bmp: '\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF' + }, + { + name: 'Latin', + bmp: 'A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A' + }, + { + name: 'Lepcha', + bmp: '\u1C00-\u1C37\u1C3B-\u1C49\u1C4D-\u1C4F' + }, + { + name: 'Limbu', + bmp: '\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u194F' + }, + { + name: 'Linear_A', + astral: '\uD801[\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]' + }, + { + name: 'Linear_B', + astral: '\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA]' + }, + { + name: 'Lisu', + bmp: '\uA4D0-\uA4FF' + }, + { + name: 'Lycian', + astral: '\uD800[\uDE80-\uDE9C]' + }, + { + name: 'Lydian', + astral: '\uD802[\uDD20-\uDD39\uDD3F]' + }, + { + name: 'Mahajani', + astral: '\uD804[\uDD50-\uDD76]' + }, + { + name: 'Malayalam', + bmp: '\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D75\u0D79-\u0D7F' + }, + { + name: 'Mandaic', + bmp: '\u0840-\u085B\u085E' + }, + { + name: 'Manichaean', + astral: '\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6]' + }, + { + name: 'Meetei_Mayek', + bmp: '\uAAE0-\uAAF6\uABC0-\uABED\uABF0-\uABF9' + }, + { + name: 'Mende_Kikakui', + astral: '\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6]' + }, + { + name: 'Meroitic_Cursive', + astral: '\uD802[\uDDA0-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDDFF]' + }, + { + name: 'Meroitic_Hieroglyphs', + astral: '\uD802[\uDD80-\uDD9F]' + }, + { + name: 'Miao', + astral: '\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]' + }, + { + name: 'Modi', + astral: '\uD805[\uDE00-\uDE44\uDE50-\uDE59]' + }, + { + name: 'Mongolian', + bmp: '\u1800\u1801\u1804\u1806-\u180E\u1810-\u1819\u1820-\u1877\u1880-\u18AA' + }, + { + name: 'Mro', + astral: '\uD81A[\uDE40-\uDE5E\uDE60-\uDE69\uDE6E\uDE6F]' + }, + { + name: 'Multani', + astral: '\uD804[\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA9]' + }, + { + name: 'Myanmar', + bmp: '\u1000-\u109F\uA9E0-\uA9FE\uAA60-\uAA7F' + }, + { + name: 'Nabataean', + astral: '\uD802[\uDC80-\uDC9E\uDCA7-\uDCAF]' + }, + { + name: 'New_Tai_Lue', + bmp: '\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE\u19DF' + }, + { + name: 'Nko', + bmp: '\u07C0-\u07FA' + }, + { + name: 'Ogham', + bmp: '\u1680-\u169C' + }, + { + name: 'Ol_Chiki', + bmp: '\u1C50-\u1C7F' + }, + { + name: 'Old_Hungarian', + astral: '\uD803[\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDCFF]' + }, + { + name: 'Old_Italic', + astral: '\uD800[\uDF00-\uDF23]' + }, + { + name: 'Old_North_Arabian', + astral: '\uD802[\uDE80-\uDE9F]' + }, + { + name: 'Old_Permic', + astral: '\uD800[\uDF50-\uDF7A]' + }, + { + name: 'Old_Persian', + astral: '\uD800[\uDFA0-\uDFC3\uDFC8-\uDFD5]' + }, + { + name: 'Old_South_Arabian', + astral: '\uD802[\uDE60-\uDE7F]' + }, + { + name: 'Old_Turkic', + astral: '\uD803[\uDC00-\uDC48]' + }, + { + name: 'Oriya', + bmp: '\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77' + }, + { + name: 'Osmanya', + astral: '\uD801[\uDC80-\uDC9D\uDCA0-\uDCA9]' + }, + { + name: 'Pahawh_Hmong', + astral: '\uD81A[\uDF00-\uDF45\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]' + }, + { + name: 'Palmyrene', + astral: '\uD802[\uDC60-\uDC7F]' + }, + { + name: 'Pau_Cin_Hau', + astral: '\uD806[\uDEC0-\uDEF8]' + }, + { + name: 'Phags_Pa', + bmp: '\uA840-\uA877' + }, + { + name: 'Phoenician', + astral: '\uD802[\uDD00-\uDD1B\uDD1F]' + }, + { + name: 'Psalter_Pahlavi', + astral: '\uD802[\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]' + }, + { + name: 'Rejang', + bmp: '\uA930-\uA953\uA95F' + }, + { + name: 'Runic', + bmp: '\u16A0-\u16EA\u16EE-\u16F8' + }, + { + name: 'Samaritan', + bmp: '\u0800-\u082D\u0830-\u083E' + }, + { + name: 'Saurashtra', + bmp: '\uA880-\uA8C4\uA8CE-\uA8D9' + }, + { + name: 'Sharada', + astral: '\uD804[\uDD80-\uDDCD\uDDD0-\uDDDF]' + }, + { + name: 'Shavian', + astral: '\uD801[\uDC50-\uDC7F]' + }, + { + name: 'Siddham', + astral: '\uD805[\uDD80-\uDDB5\uDDB8-\uDDDD]' + }, + { + name: 'SignWriting', + astral: '\uD836[\uDC00-\uDE8B\uDE9B-\uDE9F\uDEA1-\uDEAF]' + }, + { + name: 'Sinhala', + bmp: '\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4', + astral: '\uD804[\uDDE1-\uDDF4]' + }, + { + name: 'Sora_Sompeng', + astral: '\uD804[\uDCD0-\uDCE8\uDCF0-\uDCF9]' + }, + { + name: 'Sundanese', + bmp: '\u1B80-\u1BBF\u1CC0-\u1CC7' + }, + { + name: 'Syloti_Nagri', + bmp: '\uA800-\uA82B' + }, + { + name: 'Syriac', + bmp: '\u0700-\u070D\u070F-\u074A\u074D-\u074F' + }, + { + name: 'Tagalog', + bmp: '\u1700-\u170C\u170E-\u1714' + }, + { + name: 'Tagbanwa', + bmp: '\u1760-\u176C\u176E-\u1770\u1772\u1773' + }, + { + name: 'Tai_Le', + bmp: '\u1950-\u196D\u1970-\u1974' + }, + { + name: 'Tai_Tham', + bmp: '\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD' + }, + { + name: 'Tai_Viet', + bmp: '\uAA80-\uAAC2\uAADB-\uAADF' + }, + { + name: 'Takri', + astral: '\uD805[\uDE80-\uDEB7\uDEC0-\uDEC9]' + }, + { + name: 'Tamil', + bmp: '\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA' + }, + { + name: 'Telugu', + bmp: '\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C78-\u0C7F' + }, + { + name: 'Thaana', + bmp: '\u0780-\u07B1' + }, + { + name: 'Thai', + bmp: '\u0E01-\u0E3A\u0E40-\u0E5B' + }, + { + name: 'Tibetan', + bmp: '\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u0FD9\u0FDA' + }, + { + name: 'Tifinagh', + bmp: '\u2D30-\u2D67\u2D6F\u2D70\u2D7F' + }, + { + name: 'Tirhuta', + astral: '\uD805[\uDC80-\uDCC7\uDCD0-\uDCD9]' + }, + { + name: 'Ugaritic', + astral: '\uD800[\uDF80-\uDF9D\uDF9F]' + }, + { + name: 'Vai', + bmp: '\uA500-\uA62B' + }, + { + name: 'Warang_Citi', + astral: '\uD806[\uDCA0-\uDCF2\uDCFF]' + }, + { + name: 'Yi', + bmp: '\uA000-\uA48C\uA490-\uA4C6' + } + ]); + +}; diff --git a/tools/eslint/node_modules/xregexp/src/index.js b/tools/eslint/node_modules/xregexp/src/index.js new file mode 100644 index 00000000000000..0d0bd455aaed5b --- /dev/null +++ b/tools/eslint/node_modules/xregexp/src/index.js @@ -0,0 +1,11 @@ +var XRegExp = require('./xregexp'); + +require('./addons/build')(XRegExp); +require('./addons/matchrecursive')(XRegExp); +require('./addons/unicode-base')(XRegExp); +require('./addons/unicode-blocks')(XRegExp); +require('./addons/unicode-categories')(XRegExp); +require('./addons/unicode-properties')(XRegExp); +require('./addons/unicode-scripts')(XRegExp); + +module.exports = XRegExp; diff --git a/tools/eslint/node_modules/xregexp/src/xregexp.js b/tools/eslint/node_modules/xregexp/src/xregexp.js new file mode 100644 index 00000000000000..91c60b640660f6 --- /dev/null +++ b/tools/eslint/node_modules/xregexp/src/xregexp.js @@ -0,0 +1,1871 @@ +/*! + * XRegExp 3.1.0 + * + * Steven Levithan (c) 2007-2016 MIT License + */ + +/** + * XRegExp provides augmented, extensible regular expressions. You get additional regex syntax and + * flags, beyond what browsers support natively. XRegExp is also a regex utility belt with tools to + * make your client-side grepping simpler and more powerful, while freeing you from related + * cross-browser inconsistencies. + */ + + 'use strict'; + +/* ============================== + * Private stuff + * ============================== */ + + // Property name used for extended regex instance data + var REGEX_DATA = 'xregexp'; + // Optional features that can be installed and uninstalled + var features = { + astral: false, + natives: false + }; + // Native methods to use and restore ('native' is an ES3 reserved keyword) + var nativ = { + exec: RegExp.prototype.exec, + test: RegExp.prototype.test, + match: String.prototype.match, + replace: String.prototype.replace, + split: String.prototype.split + }; + // Storage for fixed/extended native methods + var fixed = {}; + // Storage for regexes cached by `XRegExp.cache` + var regexCache = {}; + // Storage for pattern details cached by the `XRegExp` constructor + var patternCache = {}; + // Storage for regex syntax tokens added internally or by `XRegExp.addToken` + var tokens = []; + // Token scopes + var defaultScope = 'default'; + var classScope = 'class'; + // Regexes that match native regex syntax, including octals + var nativeTokens = { + // Any native multicharacter token in default scope, or any single character + 'default': /\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|\(\?[:=!]|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/, + // Any native multicharacter token in character class scope, or any single character + 'class': /\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|[\s\S]/ + }; + // Any backreference or dollar-prefixed character in replacement strings + var replacementToken = /\$(?:{([\w$]+)}|(\d\d?|[\s\S]))/g; + // Check for correct `exec` handling of nonparticipating capturing groups + var correctExecNpcg = nativ.exec.call(/()??/, '')[1] === undefined; + // Check for ES6 `flags` prop support + var hasFlagsProp = /x/.flags !== undefined; + // Shortcut to `Object.prototype.toString` + var toString = {}.toString; + + function hasNativeFlag(flag) { + // Can't check based on the presense of properties/getters since + // browsers might support such properties even when don't support the + // corresponding flag in regex construction (tested in Chrome 48, where + // `'unicode' in /x/` is true but trying to construct a regex with flag + // `u` throws an error). + var isSupported = true; + try { + new RegExp('', flag); + } catch (exception) { + isSupported = false; + } + return isSupported; + } + // Check for ES6 `u` flag support + var hasNativeU = hasNativeFlag('u'); + // Check for ES6 `y` flag support + var hasNativeY = hasNativeFlag('y'); + // Tracker for known flags, including addon flags + var registeredFlags = { + g: true, + i: true, + m: true, + u: hasNativeU, + y: hasNativeY + }; + +/** + * Attaches extended data and `XRegExp.prototype` properties to a regex object. + * + * @private + * @param {RegExp} regex Regex to augment. + * @param {Array} captureNames Array with capture names, or `null`. + * @param {String} xSource XRegExp pattern used to generate `regex`, or `null` if N/A. + * @param {String} xFlags XRegExp flags used to generate `regex`, or `null` if N/A. + * @param {Boolean} [isInternalOnly=false] Whether the regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * @returns {RegExp} Augmented regex. + */ + function augment(regex, captureNames, xSource, xFlags, isInternalOnly) { + var p; + + regex[REGEX_DATA] = { + captureNames: captureNames + }; + + if (isInternalOnly) { + return regex; + } + + // Can't auto-inherit these since the XRegExp constructor returns a nonprimitive value + if (regex.__proto__) { + regex.__proto__ = XRegExp.prototype; + } else { + for (p in XRegExp.prototype) { + // An `XRegExp.prototype.hasOwnProperty(p)` check wouldn't be worth it here, since + // this is performance sensitive, and enumerable `Object.prototype` or + // `RegExp.prototype` extensions exist on `regex.prototype` anyway + regex[p] = XRegExp.prototype[p]; + } + } + + regex[REGEX_DATA].source = xSource; + // Emulate the ES6 `flags` prop by ensuring flags are in alphabetical order + regex[REGEX_DATA].flags = xFlags ? xFlags.split('').sort().join('') : xFlags; + + return regex; + } + +/** + * Removes any duplicate characters from the provided string. + * + * @private + * @param {String} str String to remove duplicate characters from. + * @returns {String} String with any duplicate characters removed. + */ + function clipDuplicates(str) { + return nativ.replace.call(str, /([\s\S])(?=[\s\S]*\1)/g, ''); + } + +/** + * Copies a regex object while preserving extended data and augmenting with `XRegExp.prototype` + * properties. The copy has a fresh `lastIndex` property (set to zero). Allows adding and removing + * flags g and y while copying the regex. + * + * @private + * @param {RegExp} regex Regex to copy. + * @param {Object} [options] Options object with optional properties: + *
    • `addG` {Boolean} Add flag g while copying the regex. + *
    • `addY` {Boolean} Add flag y while copying the regex. + *
    • `removeG` {Boolean} Remove flag g while copying the regex. + *
    • `removeY` {Boolean} Remove flag y while copying the regex. + *
    • `isInternalOnly` {Boolean} Whether the copied regex will be used only for internal + * operations, and never exposed to users. For internal-only regexes, we can improve perf by + * skipping some operations like attaching `XRegExp.prototype` properties. + * @returns {RegExp} Copy of the provided regex, possibly with modified flags. + */ + function copyRegex(regex, options) { + if (!XRegExp.isRegExp(regex)) { + throw new TypeError('Type RegExp expected'); + } + + var xData = regex[REGEX_DATA] || {}, + flags = getNativeFlags(regex), + flagsToAdd = '', + flagsToRemove = '', + xregexpSource = null, + xregexpFlags = null; + + options = options || {}; + + if (options.removeG) {flagsToRemove += 'g';} + if (options.removeY) {flagsToRemove += 'y';} + if (flagsToRemove) { + flags = nativ.replace.call(flags, new RegExp('[' + flagsToRemove + ']+', 'g'), ''); + } + + if (options.addG) {flagsToAdd += 'g';} + if (options.addY) {flagsToAdd += 'y';} + if (flagsToAdd) { + flags = clipDuplicates(flags + flagsToAdd); + } + + if (!options.isInternalOnly) { + if (xData.source !== undefined) { + xregexpSource = xData.source; + } + // null or undefined; don't want to add to `flags` if the previous value was null, since + // that indicates we're not tracking original precompilation flags + if (xData.flags != null) { + // Flags are only added for non-internal regexes by `XRegExp.globalize`. Flags are + // never removed for non-internal regexes, so don't need to handle it + xregexpFlags = flagsToAdd ? clipDuplicates(xData.flags + flagsToAdd) : xData.flags; + } + } + + // Augment with `XRegExp.prototype` properties, but use the native `RegExp` constructor to + // avoid searching for special tokens. That would be wrong for regexes constructed by + // `RegExp`, and unnecessary for regexes constructed by `XRegExp` because the regex has + // already undergone the translation to native regex syntax + regex = augment( + new RegExp(regex.source, flags), + hasNamedCapture(regex) ? xData.captureNames.slice(0) : null, + xregexpSource, + xregexpFlags, + options.isInternalOnly + ); + + return regex; + } + +/** + * Converts hexadecimal to decimal. + * + * @private + * @param {String} hex + * @returns {Number} + */ + function dec(hex) { + return parseInt(hex, 16); + } + +/** + * Returns native `RegExp` flags used by a regex object. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {String} Native flags in use. + */ + function getNativeFlags(regex) { + return hasFlagsProp ? + regex.flags : + // Explicitly using `RegExp.prototype.toString` (rather than e.g. `String` or + // concatenation with an empty string) allows this to continue working predictably when + // `XRegExp.proptotype.toString` is overriden + nativ.exec.call(/\/([a-z]*)$/i, RegExp.prototype.toString.call(regex))[1]; + } + +/** + * Determines whether a regex has extended instance data used to track capture names. + * + * @private + * @param {RegExp} regex Regex to check. + * @returns {Boolean} Whether the regex uses named capture. + */ + function hasNamedCapture(regex) { + return !!(regex[REGEX_DATA] && regex[REGEX_DATA].captureNames); + } + +/** + * Converts decimal to hexadecimal. + * + * @private + * @param {Number|String} dec + * @returns {String} + */ + function hex(dec) { + return parseInt(dec, 10).toString(16); + } + +/** + * Returns the first index at which a given value can be found in an array. + * + * @private + * @param {Array} array Array to search. + * @param {*} value Value to locate in the array. + * @returns {Number} Zero-based index at which the item is found, or -1. + */ + function indexOf(array, value) { + var len = array.length, i; + + for (i = 0; i < len; ++i) { + if (array[i] === value) { + return i; + } + } + + return -1; + } + +/** + * Determines whether a value is of the specified type, by resolving its internal [[Class]]. + * + * @private + * @param {*} value Object to check. + * @param {String} type Type to check for, in TitleCase. + * @returns {Boolean} Whether the object matches the type. + */ + function isType(value, type) { + return toString.call(value) === '[object ' + type + ']'; + } + +/** + * Checks whether the next nonignorable token after the specified position is a quantifier. + * + * @private + * @param {String} pattern Pattern to search within. + * @param {Number} pos Index in `pattern` to search at. + * @param {String} flags Flags used by the pattern. + * @returns {Boolean} Whether the next token is a quantifier. + */ + function isQuantifierNext(pattern, pos, flags) { + return nativ.test.call( + flags.indexOf('x') > -1 ? + // Ignore any leading whitespace, line comments, and inline comments + /^(?:\s+|#.*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/ : + // Ignore any leading inline comments + /^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/, + pattern.slice(pos) + ); + } + +/** + * Pads the provided string with as many leading zeros as needed to get to length 4. Used to produce + * fixed-length hexadecimal values. + * + * @private + * @param {String} str + * @returns {String} + */ + function pad4(str) { + while (str.length < 4) { + str = '0' + str; + } + return str; + } + +/** + * Checks for flag-related errors, and strips/applies flags in a leading mode modifier. Offloads + * the flag preparation logic from the `XRegExp` constructor. + * + * @private + * @param {String} pattern Regex pattern, possibly with a leading mode modifier. + * @param {String} flags Any combination of flags. + * @returns {Object} Object with properties `pattern` and `flags`. + */ + function prepareFlags(pattern, flags) { + var i; + + // Recent browsers throw on duplicate flags, so copy this behavior for nonnative flags + if (clipDuplicates(flags) !== flags) { + throw new SyntaxError('Invalid duplicate regex flag ' + flags); + } + + // Strip and apply a leading mode modifier with any combination of flags except g or y + pattern = nativ.replace.call(pattern, /^\(\?([\w$]+)\)/, function($0, $1) { + if (nativ.test.call(/[gy]/, $1)) { + throw new SyntaxError('Cannot use flag g or y in mode modifier ' + $0); + } + // Allow duplicate flags within the mode modifier + flags = clipDuplicates(flags + $1); + return ''; + }); + + // Throw on unknown native or nonnative flags + for (i = 0; i < flags.length; ++i) { + if (!registeredFlags[flags.charAt(i)]) { + throw new SyntaxError('Unknown regex flag ' + flags.charAt(i)); + } + } + + return { + pattern: pattern, + flags: flags + }; + } + +/** + * Prepares an options object from the given value. + * + * @private + * @param {String|Object} value Value to convert to an options object. + * @returns {Object} Options object. + */ + function prepareOptions(value) { + var options = {}; + + if (isType(value, 'String')) { + XRegExp.forEach(value, /[^\s,]+/, function(match) { + options[match] = true; + }); + + return options; + } + + return value; + } + +/** + * Registers a flag so it doesn't throw an 'unknown flag' error. + * + * @private + * @param {String} flag Single-character flag to register. + */ + function registerFlag(flag) { + if (!/^[\w$]$/.test(flag)) { + throw new Error('Flag must be a single character A-Za-z0-9_$'); + } + + registeredFlags[flag] = true; + } + +/** + * Runs built-in and custom regex syntax tokens in reverse insertion order at the specified + * position, until a match is found. + * + * @private + * @param {String} pattern Original pattern from which an XRegExp object is being built. + * @param {String} flags Flags being used to construct the regex. + * @param {Number} pos Position to search for tokens within `pattern`. + * @param {Number} scope Regex scope to apply: 'default' or 'class'. + * @param {Object} context Context object to use for token handler functions. + * @returns {Object} Object with properties `matchLength`, `output`, and `reparse`; or `null`. + */ + function runTokens(pattern, flags, pos, scope, context) { + var i = tokens.length, + leadChar = pattern.charAt(pos), + result = null, + match, + t; + + // Run in reverse insertion order + while (i--) { + t = tokens[i]; + if ( + (t.leadChar && t.leadChar !== leadChar) || + (t.scope !== scope && t.scope !== 'all') || + (t.flag && flags.indexOf(t.flag) === -1) + ) { + continue; + } + + match = XRegExp.exec(pattern, t.regex, pos, 'sticky'); + if (match) { + result = { + matchLength: match[0].length, + output: t.handler.call(context, match, scope, flags), + reparse: t.reparse + }; + // Finished with token tests + break; + } + } + + return result; + } + +/** + * Enables or disables implicit astral mode opt-in. When enabled, flag A is automatically added to + * all new regexes created by XRegExp. This causes an error to be thrown when creating regexes if + * the Unicode Base addon is not available, since flag A is registered by that addon. + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ + function setAstral(on) { + features.astral = on; + } + +/** + * Enables or disables native method overrides. + * + * @private + * @param {Boolean} on `true` to enable; `false` to disable. + */ + function setNatives(on) { + RegExp.prototype.exec = (on ? fixed : nativ).exec; + RegExp.prototype.test = (on ? fixed : nativ).test; + String.prototype.match = (on ? fixed : nativ).match; + String.prototype.replace = (on ? fixed : nativ).replace; + String.prototype.split = (on ? fixed : nativ).split; + + features.natives = on; + } + +/** + * Returns the object, or throws an error if it is `null` or `undefined`. This is used to follow + * the ES5 abstract operation `ToObject`. + * + * @private + * @param {*} value Object to check and return. + * @returns {*} The provided object. + */ + function toObject(value) { + // null or undefined + if (value == null) { + throw new TypeError('Cannot convert null or undefined to object'); + } + + return value; + } + +/* ============================== + * Constructor + * ============================== */ + +/** + * Creates an extended regular expression object for matching text with a pattern. Differs from a + * native regular expression in that additional syntax and flags are supported. The returned object + * is in fact a native `RegExp` and works with all native methods. + * + * @class XRegExp + * @constructor + * @param {String|RegExp} pattern Regex pattern string, or an existing regex object to copy. + * @param {String} [flags] Any combination of flags. + * Native flags: + *
    • `g` - global + *
    • `i` - ignore case + *
    • `m` - multiline anchors + *
    • `u` - unicode (ES6) + *
    • `y` - sticky (Firefox 3+, ES6) + * Additional XRegExp flags: + *
    • `n` - explicit capture + *
    • `s` - dot matches all (aka singleline) + *
    • `x` - free-spacing and line comments (aka extended) + *
    • `A` - astral (requires the Unicode Base addon) + * Flags cannot be provided when constructing one `RegExp` from another. + * @returns {RegExp} Extended regular expression object. + * @example + * + * // With named capture and flag x + * XRegExp('(? [0-9]{4} ) -? # year \n\ + * (? [0-9]{2} ) -? # month \n\ + * (? [0-9]{2} ) # day ', 'x'); + * + * // Providing a regex object copies it. Native regexes are recompiled using native (not XRegExp) + * // syntax. Copies maintain extended data, are augmented with `XRegExp.prototype` properties, and + * // have fresh `lastIndex` properties (set to zero). + * XRegExp(/regex/); + */ + function XRegExp(pattern, flags) { + var context = { + hasNamedCapture: false, + captureNames: [] + }, + scope = defaultScope, + output = '', + pos = 0, + result, + token, + generated, + appliedPattern, + appliedFlags; + + if (XRegExp.isRegExp(pattern)) { + if (flags !== undefined) { + throw new TypeError('Cannot supply flags when copying a RegExp'); + } + return copyRegex(pattern); + } + + // Copy the argument behavior of `RegExp` + pattern = pattern === undefined ? '' : String(pattern); + flags = flags === undefined ? '' : String(flags); + + if (XRegExp.isInstalled('astral') && flags.indexOf('A') === -1) { + // This causes an error to be thrown if the Unicode Base addon is not available + flags += 'A'; + } + + if (!patternCache[pattern]) { + patternCache[pattern] = {}; + } + + if (!patternCache[pattern][flags]) { + // Check for flag-related errors, and strip/apply flags in a leading mode modifier + result = prepareFlags(pattern, flags); + appliedPattern = result.pattern; + appliedFlags = result.flags; + + // Use XRegExp's tokens to translate the pattern to a native regex pattern. + // `appliedPattern.length` may change on each iteration if tokens use `reparse` + while (pos < appliedPattern.length) { + do { + // Check for custom tokens at the current position + result = runTokens(appliedPattern, appliedFlags, pos, scope, context); + // If the matched token used the `reparse` option, splice its output into the + // pattern before running tokens again at the same position + if (result && result.reparse) { + appliedPattern = appliedPattern.slice(0, pos) + + result.output + + appliedPattern.slice(pos + result.matchLength); + } + } while (result && result.reparse); + + if (result) { + output += result.output; + pos += (result.matchLength || 1); + } else { + // Get the native token at the current position + token = XRegExp.exec(appliedPattern, nativeTokens[scope], pos, 'sticky')[0]; + output += token; + pos += token.length; + if (token === '[' && scope === defaultScope) { + scope = classScope; + } else if (token === ']' && scope === classScope) { + scope = defaultScope; + } + } + } + + patternCache[pattern][flags] = { + pattern: output, + // Strip all but native flags + flags: nativ.replace.call(appliedFlags, /[^gimuy]+/g, ''), + // `context.captureNames` has an item for each capturing group, even if unnamed + captures: context.hasNamedCapture ? context.captureNames : null + }; + } + + generated = patternCache[pattern][flags]; + return augment( + new RegExp(generated.pattern, generated.flags), + generated.captures, + pattern, + flags + ); + }; + +// Add `RegExp.prototype` to the prototype chain + XRegExp.prototype = new RegExp(); + +/* ============================== + * Public properties + * ============================== */ + +/** + * The XRegExp version number as a string containing three dot-separated parts. For example, + * '2.0.0-beta-3'. + * + * @static + * @memberOf XRegExp + * @type String + */ + XRegExp.version = '3.1.0'; + +/* ============================== + * Public methods + * ============================== */ + +// Intentionally undocumented + XRegExp._hasNativeFlag = hasNativeFlag; + +/** + * Extends XRegExp syntax and allows custom flags. This is used internally and can be used to + * create XRegExp addons. If more than one token can match the same string, the last added wins. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex object that matches the new token. + * @param {Function} handler Function that returns a new pattern string (using native regex syntax) + * to replace the matched token within all future XRegExp regexes. Has access to persistent + * properties of the regex being built, through `this`. Invoked with three arguments: + *
    • The match array, with named backreference properties. + *
    • The regex scope where the match was found: 'default' or 'class'. + *
    • The flags used by the regex, including any flags in a leading mode modifier. + * The handler function becomes part of the XRegExp construction process, so be careful not to + * construct XRegExps within the function or you will trigger infinite recursion. + * @param {Object} [options] Options object with optional properties: + *
    • `scope` {String} Scope where the token applies: 'default', 'class', or 'all'. + *
    • `flag` {String} Single-character flag that triggers the token. This also registers the + * flag, which prevents XRegExp from throwing an 'unknown flag' error when the flag is used. + *
    • `optionalFlags` {String} Any custom flags checked for within the token `handler` that are + * not required to trigger the token. This registers the flags, to prevent XRegExp from + * throwing an 'unknown flag' error when any of the flags are used. + *
    • `reparse` {Boolean} Whether the `handler` function's output should not be treated as + * final, and instead be reparseable by other tokens (including the current token). Allows + * token chaining or deferring. + *
    • `leadChar` {String} Single character that occurs at the beginning of any successful match + * of the token (not always applicable). This doesn't change the behavior of the token unless + * you provide an erroneous value. However, providing it can increase the token's performance + * since the token can be skipped at any positions where this character doesn't appear. + * @example + * + * // Basic usage: Add \a for the ALERT control code + * XRegExp.addToken( + * /\\a/, + * function() {return '\\x07';}, + * {scope: 'all'} + * ); + * XRegExp('\\a[\\a-\\n]+').test('\x07\n\x07'); // -> true + * + * // Add the U (ungreedy) flag from PCRE and RE2, which reverses greedy and lazy quantifiers. + * // Since `scope` is not specified, it uses 'default' (i.e., transformations apply outside of + * // character classes only) + * XRegExp.addToken( + * /([?*+]|{\d+(?:,\d*)?})(\??)/, + * function(match) {return match[1] + (match[2] ? '' : '?');}, + * {flag: 'U'} + * ); + * XRegExp('a+', 'U').exec('aaa')[0]; // -> 'a' + * XRegExp('a+?', 'U').exec('aaa')[0]; // -> 'aaa' + */ + XRegExp.addToken = function(regex, handler, options) { + options = options || {}; + var optionalFlags = options.optionalFlags, i; + + if (options.flag) { + registerFlag(options.flag); + } + + if (optionalFlags) { + optionalFlags = nativ.split.call(optionalFlags, ''); + for (i = 0; i < optionalFlags.length; ++i) { + registerFlag(optionalFlags[i]); + } + } + + // Add to the private list of syntax tokens + tokens.push({ + regex: copyRegex(regex, { + addG: true, + addY: hasNativeY, + isInternalOnly: true + }), + handler: handler, + scope: options.scope || defaultScope, + flag: options.flag, + reparse: options.reparse, + leadChar: options.leadChar + }); + + // Reset the pattern cache used by the `XRegExp` constructor, since the same pattern and + // flags might now produce different results + XRegExp.cache.flush('patterns'); + }; + +/** + * Caches and returns the result of calling `XRegExp(pattern, flags)`. On any subsequent call with + * the same pattern and flag combination, the cached copy of the regex is returned. + * + * @memberOf XRegExp + * @param {String} pattern Regex pattern string. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Cached XRegExp object. + * @example + * + * while (match = XRegExp.cache('.', 'gs').exec(str)) { + * // The regex is compiled once only + * } + */ + XRegExp.cache = function(pattern, flags) { + if (!regexCache[pattern]) { + regexCache[pattern] = {}; + } + return regexCache[pattern][flags] || ( + regexCache[pattern][flags] = XRegExp(pattern, flags) + ); + }; + +// Intentionally undocumented + XRegExp.cache.flush = function(cacheName) { + if (cacheName === 'patterns') { + // Flush the pattern cache used by the `XRegExp` constructor + patternCache = {}; + } else { + // Flush the regex cache populated by `XRegExp.cache` + regexCache = {}; + } + }; + +/** + * Escapes any regular expression metacharacters, for use when matching literal strings. The result + * can safely be used at any point within a regex that uses any flags. + * + * @memberOf XRegExp + * @param {String} str String to escape. + * @returns {String} String with regex metacharacters escaped. + * @example + * + * XRegExp.escape('Escaped? <.>'); + * // -> 'Escaped\?\ <\.>' + */ + XRegExp.escape = function(str) { + return nativ.replace.call(toObject(str), /[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); + }; + +/** + * Executes a regex search in a specified string. Returns a match array or `null`. If the provided + * regex uses named capture, named backreference properties are included on the match array. + * Optional `pos` and `sticky` arguments specify the search start position, and whether the match + * must start at the specified position only. The `lastIndex` property of the provided regex is not + * used, but is updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.exec` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Array} Match array with named backreference properties, or `null`. + * @example + * + * // Basic use, with named backreference + * var match = XRegExp.exec('U+2620', XRegExp('U\\+(?[0-9A-F]{4})')); + * match.hex; // -> '2620' + * + * // With pos and sticky, in a loop + * var pos = 2, result = [], match; + * while (match = XRegExp.exec('<1><2><3><4>5<6>', /<(\d)>/, pos, 'sticky')) { + * result.push(match[1]); + * pos = match.index + match[0].length; + * } + * // result -> ['2', '3', '4'] + */ + XRegExp.exec = function(str, regex, pos, sticky) { + var cacheKey = 'g', + addY = false, + match, + r2; + + addY = hasNativeY && !!(sticky || (regex.sticky && sticky !== false)); + if (addY) { + cacheKey += 'y'; + } + + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; + + // Shares cached copies with `XRegExp.match`/`replace` + r2 = regex[REGEX_DATA][cacheKey] || ( + regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: true, + addY: addY, + removeY: sticky === false, + isInternalOnly: true + }) + ); + + r2.lastIndex = pos = pos || 0; + + // Fixed `exec` required for `lastIndex` fix, named backreferences, etc. + match = fixed.exec.call(r2, str); + + if (sticky && match && match.index !== pos) { + match = null; + } + + if (regex.global) { + regex.lastIndex = match ? r2.lastIndex : 0; + } + + return match; + }; + +/** + * Executes a provided function once per regex match. Searches always start at the beginning of the + * string and continue until the end, regardless of the state of the regex's `global` property and + * initial `lastIndex`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Function} callback Function to execute for each match. Invoked with four arguments: + *
    • The match array, with named backreference properties. + *
    • The zero-based match index. + *
    • The string being traversed. + *
    • The regex object being used to traverse the string. + * @example + * + * // Extracts every other digit from a string + * var evens = []; + * XRegExp.forEach('1a2345', /\d/, function(match, i) { + * if (i % 2) evens.push(+match[0]); + * }); + * // evens -> [2, 4] + */ + XRegExp.forEach = function(str, regex, callback) { + var pos = 0, + i = -1, + match; + + while ((match = XRegExp.exec(str, regex, pos))) { + // Because `regex` is provided to `callback`, the function could use the deprecated/ + // nonstandard `RegExp.prototype.compile` to mutate the regex. However, since + // `XRegExp.exec` doesn't use `lastIndex` to set the search position, this can't lead + // to an infinite loop, at least. Actually, because of the way `XRegExp.exec` caches + // globalized versions of regexes, mutating the regex will not have any effect on the + // iteration or matched strings, which is a nice side effect that brings extra safety + callback(match, ++i, str, regex); + + pos = match.index + (match[0].length || 1); + } + }; + +/** + * Copies a regex object and adds flag `g`. The copy maintains extended data, is augmented with + * `XRegExp.prototype` properties, and has a fresh `lastIndex` property (set to zero). Native + * regexes are not recompiled using XRegExp syntax. + * + * @memberOf XRegExp + * @param {RegExp} regex Regex to globalize. + * @returns {RegExp} Copy of the provided regex with flag `g` added. + * @example + * + * var globalCopy = XRegExp.globalize(/regex/); + * globalCopy.global; // -> true + */ + XRegExp.globalize = function(regex) { + return copyRegex(regex, {addG: true}); + }; + +/** + * Installs optional features according to the specified options. Can be undone using + * `XRegExp.uninstall`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.install({ + * // Enables support for astral code points in Unicode addons (implicitly sets flag A) + * astral: true, + * + * // DEPRECATED: Overrides native regex methods with fixed/extended versions + * natives: true + * }); + * + * // With an options string + * XRegExp.install('astral natives'); + */ + XRegExp.install = function(options) { + options = prepareOptions(options); + + if (!features.astral && options.astral) { + setAstral(true); + } + + if (!features.natives && options.natives) { + setNatives(true); + } + }; + +/** + * Checks whether an individual optional feature is installed. + * + * @memberOf XRegExp + * @param {String} feature Name of the feature to check. One of: + *
    • `astral` + *
    • `natives` + * @returns {Boolean} Whether the feature is installed. + * @example + * + * XRegExp.isInstalled('astral'); + */ + XRegExp.isInstalled = function(feature) { + return !!(features[feature]); + }; + +/** + * Returns `true` if an object is a regex; `false` if it isn't. This works correctly for regexes + * created in another frame, when `instanceof` and `constructor` checks would fail. + * + * @memberOf XRegExp + * @param {*} value Object to check. + * @returns {Boolean} Whether the object is a `RegExp` object. + * @example + * + * XRegExp.isRegExp('string'); // -> false + * XRegExp.isRegExp(/regex/i); // -> true + * XRegExp.isRegExp(RegExp('^', 'm')); // -> true + * XRegExp.isRegExp(XRegExp('(?s).')); // -> true + */ + XRegExp.isRegExp = function(value) { + return toString.call(value) === '[object RegExp]'; + //return isType(value, 'RegExp'); + }; + +/** + * Returns the first matched string, or in global mode, an array containing all matched strings. + * This is essentially a more convenient re-implementation of `String.prototype.match` that gives + * the result types you actually want (string instead of `exec`-style array in match-first mode, + * and an empty array instead of `null` when no matches are found in match-all mode). It also lets + * you override flag g and ignore `lastIndex`, and fixes browser bugs. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {String} [scope='one'] Use 'one' to return the first match as a string. Use 'all' to + * return an array of all matched strings. If not explicitly specified and `regex` uses flag g, + * `scope` is 'all'. + * @returns {String|Array} In match-first mode: First match as a string, or `null`. In match-all + * mode: Array of all matched strings, or an empty array. + * @example + * + * // Match first + * XRegExp.match('abc', /\w/); // -> 'a' + * XRegExp.match('abc', /\w/g, 'one'); // -> 'a' + * XRegExp.match('abc', /x/g, 'one'); // -> null + * + * // Match all + * XRegExp.match('abc', /\w/g); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /\w/, 'all'); // -> ['a', 'b', 'c'] + * XRegExp.match('abc', /x/, 'all'); // -> [] + */ + XRegExp.match = function(str, regex, scope) { + var global = (regex.global && scope !== 'one') || scope === 'all', + cacheKey = ((global ? 'g' : '') + (regex.sticky ? 'y' : '')) || 'noGY', + result, + r2; + + regex[REGEX_DATA] = regex[REGEX_DATA] || {}; + + // Shares cached copies with `XRegExp.exec`/`replace` + r2 = regex[REGEX_DATA][cacheKey] || ( + regex[REGEX_DATA][cacheKey] = copyRegex(regex, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + }) + ); + + result = nativ.match.call(toObject(str), r2); + + if (regex.global) { + regex.lastIndex = ( + (scope === 'one' && result) ? + // Can't use `r2.lastIndex` since `r2` is nonglobal in this case + (result.index + result[0].length) : 0 + ); + } + + return global ? (result || []) : (result && result[0]); + }; + +/** + * Retrieves the matches from searching a string using a chain of regexes that successively search + * within previous matches. The provided `chain` array can contain regexes and or objects with + * `regex` and `backref` properties. When a backreference is specified, the named or numbered + * backreference is passed forward to the next regex or returned. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} chain Regexes that each search for matches within preceding results. + * @returns {Array} Matches by the last regex in the chain, or an empty array. + * @example + * + * // Basic usage; matches numbers within tags + * XRegExp.matchChain('1 2 3 4 a 56', [ + * XRegExp('(?is).*?'), + * /\d+/ + * ]); + * // -> ['2', '4', '56'] + * + * // Passing forward and returning specific backreferences + * html = 'XRegExp\ + * Google'; + * XRegExp.matchChain(html, [ + * {regex: //i, backref: 1}, + * {regex: XRegExp('(?i)^https?://(?[^/?#]+)'), backref: 'domain'} + * ]); + * // -> ['xregexp.com', 'www.google.com'] + */ + XRegExp.matchChain = function(str, chain) { + return (function recurseChain(values, level) { + var item = chain[level].regex ? chain[level] : {regex: chain[level]}, + matches = [], + addMatch = function(match) { + if (item.backref) { + /* Safari 4.0.5 (but not 5.0.5+) inappropriately uses sparse arrays to hold + * the `undefined`s for backreferences to nonparticipating capturing + * groups. In such cases, a `hasOwnProperty` or `in` check on its own would + * inappropriately throw the exception, so also check if the backreference + * is a number that is within the bounds of the array. + */ + if (!(match.hasOwnProperty(item.backref) || +item.backref < match.length)) { + throw new ReferenceError('Backreference to undefined group: ' + item.backref); + } + + matches.push(match[item.backref] || ''); + } else { + matches.push(match[0]); + } + }, + i; + + for (i = 0; i < values.length; ++i) { + XRegExp.forEach(values[i], item.regex, addMatch); + } + + return ((level === chain.length - 1) || !matches.length) ? + matches : + recurseChain(matches, level + 1); + }([str], 0)); + }; + +/** + * Returns a new string with one or all matches of a pattern replaced. The pattern can be a string + * or regex, and the replacement can be a string or a function to be called for each match. To + * perform a global search and replace, use the optional `scope` argument or include flag g if using + * a regex. Replacement strings can use `${n}` for named and numbered backreferences. Replacement + * functions can use named backreferences via `arguments[0].name`. Also fixes browser bugs compared + * to the native `String.prototype.replace` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * Replacement strings can include special replacement syntax: + *
    • $$ - Inserts a literal $ character. + *
    • $&, $0 - Inserts the matched substring. + *
    • $` - Inserts the string that precedes the matched substring (left context). + *
    • $' - Inserts the string that follows the matched substring (right context). + *
    • $n, $nn - Where n/nn are digits referencing an existent capturing group, inserts + * backreference n/nn. + *
    • ${n} - Where n is a name or any number of digits that reference an existent capturing + * group, inserts backreference n. + * Replacement functions are invoked with three or more arguments: + *
    • The matched substring (corresponds to $& above). Named backreferences are accessible as + * properties of this first argument. + *
    • 0..n arguments, one for each backreference (corresponding to $1, $2, etc. above). + *
    • The zero-based index of the match within the total search string. + *
    • The total string being searched. + * @param {String} [scope='one'] Use 'one' to replace the first match only, or 'all'. If not + * explicitly specified and using a regex with flag g, `scope` is 'all'. + * @returns {String} New string with one or all matches replaced. + * @example + * + * // Regex search, using named backreferences in replacement string + * var name = XRegExp('(?\\w+) (?\\w+)'); + * XRegExp.replace('John Smith', name, '${last}, ${first}'); + * // -> 'Smith, John' + * + * // Regex search, using named backreferences in replacement function + * XRegExp.replace('John Smith', name, function(match) { + * return match.last + ', ' + match.first; + * }); + * // -> 'Smith, John' + * + * // String search, with replace-all + * XRegExp.replace('RegExp builds RegExps', 'RegExp', 'XRegExp', 'all'); + * // -> 'XRegExp builds XRegExps' + */ + XRegExp.replace = function(str, search, replacement, scope) { + var isRegex = XRegExp.isRegExp(search), + global = (search.global && scope !== 'one') || scope === 'all', + cacheKey = ((global ? 'g' : '') + (search.sticky ? 'y' : '')) || 'noGY', + s2 = search, + result; + + if (isRegex) { + search[REGEX_DATA] = search[REGEX_DATA] || {}; + + // Shares cached copies with `XRegExp.exec`/`match`. Since a copy is used, `search`'s + // `lastIndex` isn't updated *during* replacement iterations + s2 = search[REGEX_DATA][cacheKey] || ( + search[REGEX_DATA][cacheKey] = copyRegex(search, { + addG: !!global, + removeG: scope === 'one', + isInternalOnly: true + }) + ); + } else if (global) { + s2 = new RegExp(XRegExp.escape(String(search)), 'g'); + } + + // Fixed `replace` required for named backreferences, etc. + result = fixed.replace.call(toObject(str), s2, replacement); + + if (isRegex && search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } + + return result; + }; + +/** + * Performs batch processing of string replacements. Used like `XRegExp.replace`, but accepts an + * array of replacement details. Later replacements operate on the output of earlier replacements. + * Replacement details are accepted as an array with a regex or string to search for, the + * replacement string or function, and an optional scope of 'one' or 'all'. Uses the XRegExp + * replacement text syntax, which supports named backreference properties via `${name}`. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {Array} replacements Array of replacement detail arrays. + * @returns {String} New string with all replacements. + * @example + * + * str = XRegExp.replaceEach(str, [ + * [XRegExp('(?a)'), 'z${name}'], + * [/b/gi, 'y'], + * [/c/g, 'x', 'one'], // scope 'one' overrides /g + * [/d/, 'w', 'all'], // scope 'all' overrides lack of /g + * ['e', 'v', 'all'], // scope 'all' allows replace-all for strings + * [/f/g, function($0) { + * return $0.toUpperCase(); + * }] + * ]); + */ + XRegExp.replaceEach = function(str, replacements) { + var i, r; + + for (i = 0; i < replacements.length; ++i) { + r = replacements[i]; + str = XRegExp.replace(str, r[0], r[1], r[2]); + } + + return str; + }; + +/** + * Splits a string into an array of strings using a regex or string separator. Matches of the + * separator are not included in the result array. However, if `separator` is a regex that contains + * capturing groups, backreferences are spliced into the result each time `separator` is matched. + * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably + * cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to split. + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + * @example + * + * // Basic use + * XRegExp.split('a b c', ' '); + * // -> ['a', 'b', 'c'] + * + * // With limit + * XRegExp.split('a b c', ' ', 2); + * // -> ['a', 'b'] + * + * // Backreferences in result array + * XRegExp.split('..word1..', /([a-z]+)(\d+)/i); + * // -> ['..', 'word', '1', '..'] + */ + XRegExp.split = function(str, separator, limit) { + return fixed.split.call(toObject(str), separator, limit); + }; + +/** + * Executes a regex search in a specified string. Returns `true` or `false`. Optional `pos` and + * `sticky` arguments specify the search start position, and whether the match must start at the + * specified position only. The `lastIndex` property of the provided regex is not used, but is + * updated for compatibility. Also fixes browser bugs compared to the native + * `RegExp.prototype.test` and can be used reliably cross-browser. + * + * @memberOf XRegExp + * @param {String} str String to search. + * @param {RegExp} regex Regex to search with. + * @param {Number} [pos=0] Zero-based index at which to start the search. + * @param {Boolean|String} [sticky=false] Whether the match must start at the specified position + * only. The string `'sticky'` is accepted as an alternative to `true`. + * @returns {Boolean} Whether the regex matched the provided value. + * @example + * + * // Basic use + * XRegExp.test('abc', /c/); // -> true + * + * // With pos and sticky + * XRegExp.test('abc', /c/, 0, 'sticky'); // -> false + * XRegExp.test('abc', /c/, 2, 'sticky'); // -> true + */ + XRegExp.test = function(str, regex, pos, sticky) { + // Do this the easy way :-) + return !!XRegExp.exec(str, regex, pos, sticky); + }; + +/** + * Uninstalls optional features according to the specified options. All optional features start out + * uninstalled, so this is used to undo the actions of `XRegExp.install`. + * + * @memberOf XRegExp + * @param {Object|String} options Options object or string. + * @example + * + * // With an options object + * XRegExp.uninstall({ + * // Disables support for astral code points in Unicode addons + * astral: true, + * + * // DEPRECATED: Restores native regex methods + * natives: true + * }); + * + * // With an options string + * XRegExp.uninstall('astral natives'); + */ + XRegExp.uninstall = function(options) { + options = prepareOptions(options); + + if (features.astral && options.astral) { + setAstral(false); + } + + if (features.natives && options.natives) { + setNatives(false); + } + }; + +/** + * Returns an XRegExp object that is the union of the given patterns. Patterns can be provided as + * regex objects or strings. Metacharacters are escaped in patterns provided as strings. + * Backreferences in provided regex objects are automatically renumbered to work correctly within + * the larger combined pattern. Native flags used by provided regexes are ignored in favor of the + * `flags` argument. + * + * @memberOf XRegExp + * @param {Array} patterns Regexes and strings to combine. + * @param {String} [flags] Any combination of XRegExp flags. + * @returns {RegExp} Union of the provided regexes and strings. + * @example + * + * XRegExp.union(['a+b*c', /(dogs)\1/, /(cats)\1/], 'i'); + * // -> /a\+b\*c|(dogs)\1|(cats)\2/i + */ + XRegExp.union = function(patterns, flags) { + var parts = /(\()(?!\?)|\\([1-9]\d*)|\\[\s\S]|\[(?:[^\\\]]|\\[\s\S])*]/g, + output = [], + numCaptures = 0, + numPriorCaptures, + captureNames, + pattern, + rewrite = function(match, paren, backref) { + var name = captureNames[numCaptures - numPriorCaptures]; + + // Capturing group + if (paren) { + ++numCaptures; + // If the current capture has a name, preserve the name + if (name) { + return '(?<' + name + '>'; + } + // Backreference + } else if (backref) { + // Rewrite the backreference + return '\\' + (+backref + numPriorCaptures); + } + + return match; + }, + i; + + if (!(isType(patterns, 'Array') && patterns.length)) { + throw new TypeError('Must provide a nonempty array of patterns to merge'); + } + + for (i = 0; i < patterns.length; ++i) { + pattern = patterns[i]; + + if (XRegExp.isRegExp(pattern)) { + numPriorCaptures = numCaptures; + captureNames = (pattern[REGEX_DATA] && pattern[REGEX_DATA].captureNames) || []; + + // Rewrite backreferences. Passing to XRegExp dies on octals and ensures patterns + // are independently valid; helps keep this simple. Named captures are put back + output.push(nativ.replace.call(XRegExp(pattern.source).source, parts, rewrite)); + } else { + output.push(XRegExp.escape(pattern)); + } + } + + return XRegExp(output.join('|'), flags); + }; + +/* ============================== + * Fixed/extended native methods + * ============================== */ + +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `RegExp.prototype.exec`. Calling `XRegExp.install('natives')` uses this to + * override the native method. Use via `XRegExp.exec` without overriding natives. + * + * @private + * @param {String} str String to search. + * @returns {Array} Match array with named backreference properties, or `null`. + */ + fixed.exec = function(str) { + var origLastIndex = this.lastIndex, + match = nativ.exec.apply(this, arguments), + name, + r2, + i; + + if (match) { + // Fix browsers whose `exec` methods don't return `undefined` for nonparticipating + // capturing groups. This fixes IE 5.5-8, but not IE 9's quirks mode or emulation of + // older IEs. IE 9 in standards mode follows the spec + if (!correctExecNpcg && match.length > 1 && indexOf(match, '') > -1) { + r2 = copyRegex(this, { + removeG: true, + isInternalOnly: true + }); + // Using `str.slice(match.index)` rather than `match[0]` in case lookahead allowed + // matching due to characters outside the match + nativ.replace.call(String(str).slice(match.index), r2, function() { + var len = arguments.length, i; + // Skip index 0 and the last 2 + for (i = 1; i < len - 2; ++i) { + if (arguments[i] === undefined) { + match[i] = undefined; + } + } + }); + } + + // Attach named capture properties + if (this[REGEX_DATA] && this[REGEX_DATA].captureNames) { + // Skip index 0 + for (i = 1; i < match.length; ++i) { + name = this[REGEX_DATA].captureNames[i - 1]; + if (name) { + match[name] = match[i]; + } + } + } + + // Fix browsers that increment `lastIndex` after zero-length matches + if (this.global && !match[0].length && (this.lastIndex > match.index)) { + this.lastIndex = match.index; + } + } + + if (!this.global) { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + this.lastIndex = origLastIndex; + } + + return match; + }; + +/** + * Fixes browser bugs in the native `RegExp.prototype.test`. Calling `XRegExp.install('natives')` + * uses this to override the native method. + * + * @private + * @param {String} str String to search. + * @returns {Boolean} Whether the regex matched the provided value. + */ + fixed.test = function(str) { + // Do this the easy way :-) + return !!fixed.exec.call(this, str); + }; + +/** + * Adds named capture support (with backreferences returned as `result.name`), and fixes browser + * bugs in the native `String.prototype.match`. Calling `XRegExp.install('natives')` uses this to + * override the native method. + * + * @private + * @param {RegExp|*} regex Regex to search with. If not a regex object, it is passed to `RegExp`. + * @returns {Array} If `regex` uses flag g, an array of match strings or `null`. Without flag g, + * the result of calling `regex.exec(this)`. + */ + fixed.match = function(regex) { + var result; + + if (!XRegExp.isRegExp(regex)) { + // Use the native `RegExp` rather than `XRegExp` + regex = new RegExp(regex); + } else if (regex.global) { + result = nativ.match.apply(this, arguments); + // Fixes IE bug + regex.lastIndex = 0; + + return result; + } + + return fixed.exec.call(regex, toObject(this)); + }; + +/** + * Adds support for `${n}` tokens for named and numbered backreferences in replacement text, and + * provides named backreferences to replacement functions as `arguments[0].name`. Also fixes browser + * bugs in replacement text syntax when performing a replacement using a nonregex search value, and + * the value of a replacement regex's `lastIndex` property during replacement iterations and upon + * completion. Calling `XRegExp.install('natives')` uses this to override the native method. Note + * that this doesn't support SpiderMonkey's proprietary third (`flags`) argument. Use via + * `XRegExp.replace` without overriding natives. + * + * @private + * @param {RegExp|String} search Search pattern to be replaced. + * @param {String|Function} replacement Replacement string or a function invoked to create it. + * @returns {String} New string with one or all matches replaced. + */ + fixed.replace = function(search, replacement) { + var isRegex = XRegExp.isRegExp(search), + origLastIndex, + captureNames, + result; + + if (isRegex) { + if (search[REGEX_DATA]) { + captureNames = search[REGEX_DATA].captureNames; + } + // Only needed if `search` is nonglobal + origLastIndex = search.lastIndex; + } else { + search += ''; // Type-convert + } + + // Don't use `typeof`; some older browsers return 'function' for regex objects + if (isType(replacement, 'Function')) { + // Stringifying `this` fixes a bug in IE < 9 where the last argument in replacement + // functions isn't type-converted to a string + result = nativ.replace.call(String(this), search, function() { + var args = arguments, i; + if (captureNames) { + // Change the `arguments[0]` string primitive to a `String` object that can + // store properties. This really does need to use `String` as a constructor + args[0] = new String(args[0]); + // Store named backreferences on the first argument + for (i = 0; i < captureNames.length; ++i) { + if (captureNames[i]) { + args[0][captureNames[i]] = args[i + 1]; + } + } + } + // Update `lastIndex` before calling `replacement`. Fixes IE, Chrome, Firefox, + // Safari bug (last tested IE 9, Chrome 17, Firefox 11, Safari 5.1) + if (isRegex && search.global) { + search.lastIndex = args[args.length - 2] + args[0].length; + } + // ES6 specs the context for replacement functions as `undefined` + return replacement.apply(undefined, args); + }); + } else { + // Ensure that the last value of `args` will be a string when given nonstring `this`, + // while still throwing on null or undefined context + result = nativ.replace.call(this == null ? this : String(this), search, function() { + // Keep this function's `arguments` available through closure + var args = arguments; + return nativ.replace.call(String(replacement), replacementToken, function($0, $1, $2) { + var n; + // Named or numbered backreference with curly braces + if ($1) { + // XRegExp behavior for `${n}`: + // 1. Backreference to numbered capture, if `n` is an integer. Use `0` for + // for the entire match. Any number of leading zeros may be used. + // 2. Backreference to named capture `n`, if it exists and is not an + // integer overridden by numbered capture. In practice, this does not + // overlap with numbered capture since XRegExp does not allow named + // capture to use a bare integer as the name. + // 3. If the name or number does not refer to an existing capturing group, + // it's an error. + n = +$1; // Type-convert; drop leading zeros + if (n <= args.length - 3) { + return args[n] || ''; + } + // Groups with the same name is an error, else would need `lastIndexOf` + n = captureNames ? indexOf(captureNames, $1) : -1; + if (n < 0) { + throw new SyntaxError('Backreference to undefined group ' + $0); + } + return args[n + 1] || ''; + } + // Else, special variable or numbered backreference without curly braces + if ($2 === '$') { // $$ + return '$'; + } + if ($2 === '&' || +$2 === 0) { // $&, $0 (not followed by 1-9), $00 + return args[0]; + } + if ($2 === '`') { // $` (left context) + return args[args.length - 1].slice(0, args[args.length - 2]); + } + if ($2 === "'") { // $' (right context) + return args[args.length - 1].slice(args[args.length - 2] + args[0].length); + } + // Else, numbered backreference without curly braces + $2 = +$2; // Type-convert; drop leading zero + // XRegExp behavior for `$n` and `$nn`: + // - Backrefs end after 1 or 2 digits. Use `${..}` for more digits. + // - `$1` is an error if no capturing groups. + // - `$10` is an error if less than 10 capturing groups. Use `${1}0` instead. + // - `$01` is `$1` if at least one capturing group, else it's an error. + // - `$0` (not followed by 1-9) and `$00` are the entire match. + // Native behavior, for comparison: + // - Backrefs end after 1 or 2 digits. Cannot reference capturing group 100+. + // - `$1` is a literal `$1` if no capturing groups. + // - `$10` is `$1` followed by a literal `0` if less than 10 capturing groups. + // - `$01` is `$1` if at least one capturing group, else it's a literal `$01`. + // - `$0` is a literal `$0`. + if (!isNaN($2)) { + if ($2 > args.length - 3) { + throw new SyntaxError('Backreference to undefined group ' + $0); + } + return args[$2] || ''; + } + // `$` followed by an unsupported char is an error, unlike native JS + throw new SyntaxError('Invalid token ' + $0); + }); + }); + } + + if (isRegex) { + if (search.global) { + // Fixes IE, Safari bug (last tested IE 9, Safari 5.1) + search.lastIndex = 0; + } else { + // Fixes IE, Opera bug (last tested IE 9, Opera 11.6) + search.lastIndex = origLastIndex; + } + } + + return result; + }; + +/** + * Fixes browser bugs in the native `String.prototype.split`. Calling `XRegExp.install('natives')` + * uses this to override the native method. Use via `XRegExp.split` without overriding natives. + * + * @private + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + */ + fixed.split = function(separator, limit) { + if (!XRegExp.isRegExp(separator)) { + // Browsers handle nonregex split correctly, so use the faster native method + return nativ.split.apply(this, arguments); + } + + var str = String(this), + output = [], + origLastIndex = separator.lastIndex, + lastLastIndex = 0, + lastLength; + + // Values for `limit`, per the spec: + // If undefined: pow(2,32) - 1 + // If 0, Infinity, or NaN: 0 + // If positive number: limit = floor(limit); if (limit >= pow(2,32)) limit -= pow(2,32); + // If negative number: pow(2,32) - floor(abs(limit)) + // If other: Type-convert, then use the above rules + // This line fails in very strange ways for some values of `limit` in Opera 10.5-10.63, + // unless Opera Dragonfly is open (go figure). It works in at least Opera 9.5-10.1 and 11+ + limit = (limit === undefined ? -1 : limit) >>> 0; + + XRegExp.forEach(str, separator, function(match) { + // This condition is not the same as `if (match[0].length)` + if ((match.index + match[0].length) > lastLastIndex) { + output.push(str.slice(lastLastIndex, match.index)); + if (match.length > 1 && match.index < str.length) { + Array.prototype.push.apply(output, match.slice(1)); + } + lastLength = match[0].length; + lastLastIndex = match.index + lastLength; + } + }); + + if (lastLastIndex === str.length) { + if (!nativ.test.call(separator, '') || lastLength) { + output.push(''); + } + } else { + output.push(str.slice(lastLastIndex)); + } + + separator.lastIndex = origLastIndex; + return output.length > limit ? output.slice(0, limit) : output; + }; + +/* ============================== + * Built-in syntax/flag tokens + * ============================== */ + +/* + * Letter escapes that natively match literal characters: `\a`, `\A`, etc. These should be + * SyntaxErrors but are allowed in web reality. XRegExp makes them errors for cross-browser + * consistency and to reserve their syntax, but lets them be superseded by addons. + */ + XRegExp.addToken( + /\\([ABCE-RTUVXYZaeg-mopqyz]|c(?![A-Za-z])|u(?![\dA-Fa-f]{4}|{[\dA-Fa-f]+})|x(?![\dA-Fa-f]{2}))/, + function(match, scope) { + // \B is allowed in default scope only + if (match[1] === 'B' && scope === defaultScope) { + return match[0]; + } + throw new SyntaxError('Invalid escape ' + match[0]); + }, + { + scope: 'all', + leadChar: '\\' + } + ); + +/* + * Unicode code point escape with curly braces: `\u{N..}`. `N..` is any one or more digit + * hexadecimal number from 0-10FFFF, and can include leading zeros. Requires the native ES6 `u` flag + * to support code points greater than U+FFFF. Avoids converting code points above U+FFFF to + * surrogate pairs (which could be done without flag `u`), since that could lead to broken behavior + * if you follow a `\u{N..}` token that references a code point above U+FFFF with a quantifier, or + * if you use the same in a character class. + */ + XRegExp.addToken( + /\\u{([\dA-Fa-f]+)}/, + function(match, scope, flags) { + var code = dec(match[1]); + if (code > 0x10FFFF) { + throw new SyntaxError('Invalid Unicode code point ' + match[0]); + } + if (code <= 0xFFFF) { + // Converting to \uNNNN avoids needing to escape the literal character and keep it + // separate from preceding tokens + return '\\u' + pad4(hex(code)); + } + // If `code` is between 0xFFFF and 0x10FFFF, require and defer to native handling + if (hasNativeU && flags.indexOf('u') > -1) { + return match[0]; + } + throw new SyntaxError('Cannot use Unicode code point above \\u{FFFF} without flag u'); + }, + { + scope: 'all', + leadChar: '\\' + } + ); + +/* + * Empty character class: `[]` or `[^]`. This fixes a critical cross-browser syntax inconsistency. + * Unless this is standardized (per the ES spec), regex syntax can't be accurately parsed because + * character class endings can't be determined. + */ + XRegExp.addToken( + /\[(\^?)]/, + function(match) { + // For cross-browser compatibility with ES3, convert [] to \b\B and [^] to [\s\S]. + // (?!) should work like \b\B, but is unreliable in some versions of Firefox + return match[1] ? '[\\s\\S]' : '\\b\\B'; + }, + {leadChar: '['} + ); + +/* + * Comment pattern: `(?# )`. Inline comments are an alternative to the line comments allowed in + * free-spacing mode (flag x). + */ + XRegExp.addToken( + /\(\?#[^)]*\)/, + function(match, scope, flags) { + // Keep tokens separated unless the following token is a quantifier + return isQuantifierNext(match.input, match.index + match[0].length, flags) ? + '' : '(?:)'; + }, + {leadChar: '('} + ); + +/* + * Whitespace and line comments, in free-spacing mode (aka extended mode, flag x) only. + */ + XRegExp.addToken( + /\s+|#.*/, + function(match, scope, flags) { + // Keep tokens separated unless the following token is a quantifier + return isQuantifierNext(match.input, match.index + match[0].length, flags) ? + '' : '(?:)'; + }, + {flag: 'x'} + ); + +/* + * Dot, in dotall mode (aka singleline mode, flag s) only. + */ + XRegExp.addToken( + /\./, + function() { + return '[\\s\\S]'; + }, + { + flag: 's', + leadChar: '.' + } + ); + +/* + * Named backreference: `\k`. Backreference names can use the characters A-Z, a-z, 0-9, _, + * and $ only. Also allows numbered backreferences as `\k`. + */ + XRegExp.addToken( + /\\k<([\w$]+)>/, + function(match) { + // Groups with the same name is an error, else would need `lastIndexOf` + var index = isNaN(match[1]) ? (indexOf(this.captureNames, match[1]) + 1) : +match[1], + endIndex = match.index + match[0].length; + if (!index || index > this.captureNames.length) { + throw new SyntaxError('Backreference to undefined group ' + match[0]); + } + // Keep backreferences separate from subsequent literal numbers + return '\\' + index + ( + endIndex === match.input.length || isNaN(match.input.charAt(endIndex)) ? + '' : '(?:)' + ); + }, + {leadChar: '\\'} + ); + +/* + * Numbered backreference or octal, plus any following digits: `\0`, `\11`, etc. Octals except `\0` + * not followed by 0-9 and backreferences to unopened capture groups throw an error. Other matches + * are returned unaltered. IE < 9 doesn't support backreferences above `\99` in regex syntax. + */ + XRegExp.addToken( + /\\(\d+)/, + function(match, scope) { + if ( + !( + scope === defaultScope && + /^[1-9]/.test(match[1]) && + +match[1] <= this.captureNames.length + ) && + match[1] !== '0' + ) { + throw new SyntaxError('Cannot use octal escape or backreference to undefined group ' + + match[0]); + } + return match[0]; + }, + { + scope: 'all', + leadChar: '\\' + } + ); + +/* + * Named capturing group; match the opening delimiter only: `(?`. Capture names can use the + * characters A-Z, a-z, 0-9, _, and $ only. Names can't be integers. Supports Python-style + * `(?P` as an alternate syntax to avoid issues in some older versions of Opera which natively + * supported the Python-style syntax. Otherwise, XRegExp might treat numbered backreferences to + * Python-style named capture as octals. + */ + XRegExp.addToken( + /\(\?P?<([\w$]+)>/, + function(match) { + // Disallow bare integers as names because named backreferences are added to match + // arrays and therefore numeric properties may lead to incorrect lookups + if (!isNaN(match[1])) { + throw new SyntaxError('Cannot use integer as capture name ' + match[0]); + } + if (match[1] === 'length' || match[1] === '__proto__') { + throw new SyntaxError('Cannot use reserved word as capture name ' + match[0]); + } + if (indexOf(this.captureNames, match[1]) > -1) { + throw new SyntaxError('Cannot use same name for multiple groups ' + match[0]); + } + this.captureNames.push(match[1]); + this.hasNamedCapture = true; + return '('; + }, + {leadChar: '('} + ); + +/* + * Capturing group; match the opening parenthesis only. Required for support of named capturing + * groups. Also adds explicit capture mode (flag n). + */ + XRegExp.addToken( + /\((?!\?)/, + function(match, scope, flags) { + if (flags.indexOf('n') > -1) { + return '(?:'; + } + this.captureNames.push(null); + return '('; + }, + { + optionalFlags: 'n', + leadChar: '(' + } + ); + +/* ============================== + * Expose XRegExp + * ============================== */ + + module.exports = XRegExp; diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/LICENCE b/tools/eslint/node_modules/xtend/LICENCE similarity index 100% rename from tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/LICENCE rename to tools/eslint/node_modules/xtend/LICENCE diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/Makefile b/tools/eslint/node_modules/xtend/Makefile similarity index 100% rename from tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/Makefile rename to tools/eslint/node_modules/xtend/Makefile diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/README.md b/tools/eslint/node_modules/xtend/README.md similarity index 100% rename from tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/README.md rename to tools/eslint/node_modules/xtend/README.md diff --git a/tools/eslint/node_modules/xtend/immutable.js b/tools/eslint/node_modules/xtend/immutable.js new file mode 100644 index 00000000000000..94889c9de11a18 --- /dev/null +++ b/tools/eslint/node_modules/xtend/immutable.js @@ -0,0 +1,19 @@ +module.exports = extend + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +function extend() { + var target = {} + + for (var i = 0; i < arguments.length; i++) { + var source = arguments[i] + + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + target[key] = source[key] + } + } + } + + return target +} diff --git a/tools/eslint/node_modules/xtend/mutable.js b/tools/eslint/node_modules/xtend/mutable.js new file mode 100644 index 00000000000000..72debede6ca585 --- /dev/null +++ b/tools/eslint/node_modules/xtend/mutable.js @@ -0,0 +1,17 @@ +module.exports = extend + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +function extend(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] + + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + target[key] = source[key] + } + } + } + + return target +} diff --git a/tools/eslint/node_modules/xtend/package.json b/tools/eslint/node_modules/xtend/package.json new file mode 100644 index 00000000000000..374b7563963681 --- /dev/null +++ b/tools/eslint/node_modules/xtend/package.json @@ -0,0 +1,109 @@ +{ + "_args": [ + [ + "xtend@^4.0.0", + "/Users/silverwind/git/node/tools/package/package/node_modules/is-my-json-valid" + ] + ], + "_from": "xtend@>=4.0.0 <5.0.0", + "_id": "xtend@4.0.1", + "_inCache": true, + "_installable": true, + "_location": "/xtend", + "_nodeVersion": "0.10.32", + "_npmUser": { + "email": "raynos2@gmail.com", + "name": "raynos" + }, + "_npmVersion": "2.14.1", + "_phantomChildren": {}, + "_requested": { + "name": "xtend", + "raw": "xtend@^4.0.0", + "rawSpec": "^4.0.0", + "scope": null, + "spec": ">=4.0.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/is-my-json-valid" + ], + "_resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "_shasum": "a5c6d532be656e23db820efb943a1f04998d63af", + "_shrinkwrap": null, + "_spec": "xtend@^4.0.0", + "_where": "/Users/silverwind/git/node/tools/package/package/node_modules/is-my-json-valid", + "author": { + "email": "raynos2@gmail.com", + "name": "Raynos" + }, + "bugs": { + "email": "raynos2@gmail.com", + "url": "https://github.com/Raynos/xtend/issues" + }, + "contributors": [ + { + "name": "Jake Verbaten" + }, + { + "name": "Matt Esch" + } + ], + "dependencies": {}, + "description": "extend like a boss", + "devDependencies": { + "tape": "~1.1.0" + }, + "directories": {}, + "dist": { + "shasum": "a5c6d532be656e23db820efb943a1f04998d63af", + "tarball": "http://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + }, + "engines": { + "node": ">=0.4" + }, + "gitHead": "23dc302a89756da89c1897bc732a752317e35390", + "homepage": "https://github.com/Raynos/xtend", + "keywords": [ + "array", + "extend", + "merge", + "object", + "options", + "opts" + ], + "license": "MIT", + "main": "immutable", + "maintainers": [ + { + "name": "raynos", + "email": "raynos2@gmail.com" + } + ], + "name": "xtend", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/Raynos/xtend.git" + }, + "scripts": { + "test": "node test" + }, + "testling": { + "browsers": [ + "chrome/22..latest", + "chrome/canary", + "firefox/16..latest", + "firefox/nightly", + "ie/7..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "opera/12..latest", + "opera/next", + "safari/5.1..latest" + ], + "files": "test.js" + }, + "version": "4.0.1" +} diff --git a/tools/eslint/package.json b/tools/eslint/package.json index cdab83759aebb8..2209c1b1b8a12f 100644 --- a/tools/eslint/package.json +++ b/tools/eslint/package.json @@ -1,10 +1,7 @@ { "name": "eslint", - "version": "0.24.0", - "author": { - "name": "Nicholas C. Zakas", - "email": "nicholas+npm@nczconsulting.com" - }, + "version": "2.7.0", + "author": "Nicholas C. Zakas ", "description": "An AST-based pattern checker for JavaScript.", "bin": { "eslint": "./bin/eslint.js" @@ -13,78 +10,93 @@ "scripts": { "test": "node Makefile.js test", "lint": "node Makefile.js lint", - "patch": "node Makefile.js patch", - "minor": "node Makefile.js minor", - "major": "node Makefile.js major", + "release": "node Makefile.js release", + "alpharelease": "node Makefile.js prerelease -- alpha", + "betarelease": "node Makefile.js prerelease -- beta", "docs": "node Makefile.js docs", "gensite": "node Makefile.js gensite", "browserify": "node Makefile.js browserify", "perf": "node Makefile.js perf", "profile": "beefy tests/bench/bench.js --open -- -t brfs -t ./tests/bench/xform-rules.js -r espree", - "coveralls": "cat ./coverage/lcov.info | coveralls" + "coveralls": "cat ./coverage/lcov.info | coveralls", + "check-commit": "node Makefile.js checkGitCommit" }, "files": [ "LICENSE", "README.md", "bin", "conf", - "lib" + "lib", + "messages" ], "repository": { "type": "git", - "url": "git+https://github.com/eslint/eslint.git" + "url": "https://github.com/eslint/eslint" }, "homepage": "http://eslint.org", - "bugs": { - "url": "https://github.com/eslint/eslint/issues/" - }, + "bugs": "https://github.com/eslint/eslint/issues/", "dependencies": { - "chalk": "^1.0.0", + "chalk": "^1.1.3", "concat-stream": "^1.4.6", "debug": "^2.1.1", - "doctrine": "^0.6.2", - "escape-string-regexp": "^1.0.2", - "escope": "^3.1.0", - "espree": "^2.0.1", - "estraverse": "^4.1.0", - "estraverse-fb": "^1.3.1", - "globals": "^8.0.0", - "inquirer": "^0.8.2", + "doctrine": "^1.2.1", + "es6-map": "^0.1.3", + "escope": "^3.6.0", + "espree": "3.1.3", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "file-entry-cache": "^1.1.1", + "glob": "^7.0.3", + "globals": "^9.2.0", + "ignore": "^3.0.10", + "imurmurhash": "^0.1.4", + "inquirer": "^0.12.0", "is-my-json-valid": "^2.10.0", - "js-yaml": "^3.2.5", - "minimatch": "^2.0.1", + "is-resolvable": "^1.0.0", + "js-yaml": "^3.5.1", + "json-stable-stringify": "^1.0.0", + "lodash": "^4.0.0", "mkdirp": "^0.5.0", - "object-assign": "^2.0.0", - "optionator": "^0.5.0", + "optionator": "^0.8.1", "path-is-absolute": "^1.0.0", + "path-is-inside": "^1.0.1", + "pluralize": "^1.2.1", + "progress": "^1.1.8", + "require-uncached": "^1.0.2", + "shelljs": "^0.6.0", "strip-json-comments": "~1.0.1", + "table": "^3.7.8", "text-table": "~0.2.0", - "user-home": "^1.0.0", - "xml-escape": "~1.0.0" + "user-home": "^2.0.0" }, "devDependencies": { - "beefy": "^1.0.0", + "beefy": "^2.0.0", "brfs": "0.0.9", - "browserify": "^8.1.3", - "chai": "^1.9.1", - "coveralls": "2.11.2", + "browserify": "^12.0.1", + "chai": "^3.5.0", + "cheerio": "^0.19.0", + "coveralls": "2.11.4", "dateformat": "^1.0.8", - "eslint-tester": "^0.8.1", - "esprima-fb": "^10001.1.0-dev-harmony-fb", - "gh-got": "^1.0.3", - "istanbul": "^0.3.5", + "ejs": "^2.3.3", + "eslint-release": "^0.5.0", + "esprima": "^2.4.1", + "esprima-fb": "^15001.1001.0-dev-harmony-fb", + "gh-got": "^2.2.0", + "istanbul": "^0.4.0", "jsdoc": "^3.3.0-beta1", - "jsonlint": "^1.6.2", - "markdownlint": "^0.0.6", - "mocha": "^2.1.0", - "mocha-phantomjs": "^3.5.0", - "npm-license": "^0.2.3", - "phantomjs": "^1.9.9", + "leche": "^2.1.1", + "linefix": "^0.1.1", + "load-perf": "^0.2.0", + "markdownlint": "^0.1.0", + "mocha": "^2.4.5", + "mocha-phantomjs": "4.0.1", + "npm-license": "^0.3.1", + "phantomjs-polyfill": "0.0.1", "proxyquire": "^1.0.0", - "semver": "^4.1.0", - "shelljs": "^0.3.0", + "semver": "^5.0.3", "shelljs-nodecli": "~0.1.0", - "sinon": "1.14.1", + "sinon": "^1.17.2", + "temp": "^0.8.3", "through": "^2.3.6" }, "keywords": [ @@ -97,31 +109,5 @@ "license": "MIT", "engines": { "node": ">=0.10" - }, - "gitHead": "b09484adab0e73e41bb9be28d8423b3295e4d5ff", - "_id": "eslint@0.24.0", - "_shasum": "1fc8ce7a153e614599cfc9efdabac4d1ea9aa6b0", - "_from": "eslint@*", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "nzakas", - "email": "nicholas@nczconsulting.com" - }, - "maintainers": [ - { - "name": "nzakas", - "email": "nicholas@nczconsulting.com" - }, - { - "name": "ivolodin", - "email": "ivolodin@gmail.com" - } - ], - "dist": { - "shasum": "1fc8ce7a153e614599cfc9efdabac4d1ea9aa6b0", - "tarball": "http://registry.npmjs.org/eslint/-/eslint-0.24.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/eslint/-/eslint-0.24.0.tgz", - "readme": "ERROR: No README data found!" + } } diff --git a/tools/gyp/PRESUBMIT.py b/tools/gyp/PRESUBMIT.py index acdb34b2bb2e20..dde025383c3276 100644 --- a/tools/gyp/PRESUBMIT.py +++ b/tools/gyp/PRESUBMIT.py @@ -125,14 +125,13 @@ def CheckChangeOnCommit(input_api, output_api): TRYBOTS = [ - 'gyp-win32', - 'gyp-win64', - 'gyp-linux', - 'gyp-mac', + 'linux_try', + 'mac_try', + 'win_try', ] def GetPreferredTryMasters(_, change): return { - 'tryserver.nacl': { t: set(['defaulttests']) for t in TRYBOTS }, + 'client.gyp': { t: set(['defaulttests']) for t in TRYBOTS }, } diff --git a/tools/gyp/gyp_main.py b/tools/gyp/gyp_main.py index 4ec872f0f95aa3..25a6eba94aae7d 100755 --- a/tools/gyp/gyp_main.py +++ b/tools/gyp/gyp_main.py @@ -4,15 +4,13 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import os import sys -# TODO(mark): sys.path manipulation is some temporary testing stuff. -try: - import gyp -except ImportError, e: - import os.path - sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), 'pylib')) - import gyp +# Make sure we're using the version of pylib in this repo, not one installed +# elsewhere on the system. +sys.path.insert(0, os.path.join(os.path.dirname(sys.argv[0]), 'pylib')) +import gyp if __name__ == '__main__': sys.exit(gyp.script_main()) diff --git a/tools/gyp/pylib/gyp/MSVSSettings.py b/tools/gyp/pylib/gyp/MSVSSettings.py index dde0e07092b167..4985756bdde76a 100644 --- a/tools/gyp/pylib/gyp/MSVSSettings.py +++ b/tools/gyp/pylib/gyp/MSVSSettings.py @@ -708,10 +708,7 @@ def _ValidateSettings(validators, settings, stderr): _MSBuildOnly(_compile, 'BuildingInIDE', _boolean) _MSBuildOnly(_compile, 'CompileAsManaged', _Enumeration([], new=['false', - 'true', # /clr - 'Pure', # /clr:pure - 'Safe', # /clr:safe - 'OldSyntax'])) # /clr:oldSyntax + 'true'])) # /clr _MSBuildOnly(_compile, 'CreateHotpatchableImage', _boolean) # /hotpatch _MSBuildOnly(_compile, 'MultiProcessorCompilation', _boolean) # /MP _MSBuildOnly(_compile, 'PreprocessOutputPath', _string) # /Fi diff --git a/tools/gyp/pylib/gyp/MSVSSettings_test.py b/tools/gyp/pylib/gyp/MSVSSettings_test.py index d24dcac4d5e13e..bf6ea6b802ff91 100755 --- a/tools/gyp/pylib/gyp/MSVSSettings_test.py +++ b/tools/gyp/pylib/gyp/MSVSSettings_test.py @@ -296,7 +296,7 @@ def testValidateMSBuildSettings_settings(self): 'BuildingInIDE': 'true', 'CallingConvention': 'Cdecl', 'CompileAs': 'CompileAsC', - 'CompileAsManaged': 'Pure', + 'CompileAsManaged': 'true', 'CreateHotpatchableImage': 'true', 'DebugInformationFormat': 'ProgramDatabase', 'DisableLanguageExtensions': 'true', diff --git a/tools/gyp/pylib/gyp/common.py b/tools/gyp/pylib/gyp/common.py index b6875e43efcbc4..d482a20df3cdd9 100644 --- a/tools/gyp/pylib/gyp/common.py +++ b/tools/gyp/pylib/gyp/common.py @@ -131,13 +131,20 @@ def QualifiedTarget(build_file, target, toolset): @memoize -def RelativePath(path, relative_to): +def RelativePath(path, relative_to, follow_path_symlink=True): # Assuming both |path| and |relative_to| are relative to the current # directory, returns a relative path that identifies path relative to # relative_to. + # If |follow_symlink_path| is true (default) and |path| is a symlink, then + # this method returns a path to the real file represented by |path|. If it is + # false, this method returns a path to the symlink. If |path| is not a + # symlink, this option has no effect. # Convert to normalized (and therefore absolute paths). - path = os.path.realpath(path) + if follow_path_symlink: + path = os.path.realpath(path) + else: + path = os.path.abspath(path) relative_to = os.path.realpath(relative_to) # On Windows, we can't create a relative path to a different drive, so just diff --git a/tools/gyp/pylib/gyp/generator/analyzer.py b/tools/gyp/pylib/gyp/generator/analyzer.py index 3a0ec9baff2786..f403d4e266b048 100644 --- a/tools/gyp/pylib/gyp/generator/analyzer.py +++ b/tools/gyp/pylib/gyp/generator/analyzer.py @@ -338,7 +338,7 @@ def _GenerateTargets(data, target_list, target_dicts, toplevel_dir, files, sources = _ExtractSources(target_name, target_dicts[target_name], toplevel_dir) for source in sources: - if source in files: + if _ToGypPath(os.path.normpath(source)) in files: print 'target', target_name, 'matches', source target.match_status = MATCH_STATUS_MATCHES matching_targets.append(target) @@ -498,7 +498,7 @@ def _WasGypIncludeFileModified(params, files): files.""" if params['options'].includes: for include in params['options'].includes: - if _ToGypPath(include) in files: + if _ToGypPath(os.path.normpath(include)) in files: print 'Include file modified, assuming all changed', include return True return False diff --git a/tools/gyp/pylib/gyp/generator/make.py b/tools/gyp/pylib/gyp/generator/make.py index 5cf2fe76be2841..786b4e079197e5 100644 --- a/tools/gyp/pylib/gyp/generator/make.py +++ b/tools/gyp/pylib/gyp/generator/make.py @@ -211,10 +211,10 @@ def CalculateGeneratorInputInfo(params): LINK_COMMANDS_AIX = """\ quiet_cmd_alink = AR($(TOOLSET)) $@ -cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^) +cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^) quiet_cmd_alink_thin = AR($(TOOLSET)) $@ -cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^) +cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) -X32_64 crs $@ $(filter %.o,$^) quiet_cmd_link = LINK($(TOOLSET)) $@ cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(LD_INPUTS) $(LIBS) @@ -273,9 +273,9 @@ def CalculateGeneratorInputInfo(params): %(make_global_settings)s CC.target ?= %(CC.target)s -CFLAGS.target ?= $(CFLAGS) +CFLAGS.target ?= $(CPPFLAGS) $(CFLAGS) CXX.target ?= %(CXX.target)s -CXXFLAGS.target ?= $(CXXFLAGS) +CXXFLAGS.target ?= $(CPPFLAGS) $(CXXFLAGS) LINK.target ?= %(LINK.target)s LDFLAGS.target ?= $(LDFLAGS) AR.target ?= $(AR) @@ -286,9 +286,9 @@ def CalculateGeneratorInputInfo(params): # TODO(evan): move all cross-compilation logic to gyp-time so we don't need # to replicate this environment fallback in make as well. CC.host ?= %(CC.host)s -CFLAGS.host ?= +CFLAGS.host ?= $(CPPFLAGS_host) $(CFLAGS_host) CXX.host ?= %(CXX.host)s -CXXFLAGS.host ?= +CXXFLAGS.host ?= $(CPPFLAGS_host) $(CXXFLAGS_host) LINK.host ?= %(LINK.host)s LDFLAGS.host ?= AR.host ?= %(AR.host)s @@ -365,7 +365,7 @@ def CalculateGeneratorInputInfo(params): quiet_cmd_copy = COPY $@ # send stderr to /dev/null to ignore messages when linking directories. -cmd_copy = ln -f "$<" "$@" 2>/dev/null || (rm -rf "$@" && cp -af "$<" "$@") +cmd_copy = ln -f "$<" "$@" 2>/dev/null || (rm -rf "$@" && cp %(copy_archive_args)s "$<" "$@") %(link_commands)s """ @@ -2010,6 +2010,7 @@ def CalculateMakefilePath(build_file, base_name): srcdir_prefix = '$(srcdir)/' flock_command= 'flock' + copy_archive_arguments = '-af' header_params = { 'default_target': default_target, 'builddir': builddir_name, @@ -2019,6 +2020,7 @@ def CalculateMakefilePath(build_file, base_name): 'link_commands': LINK_COMMANDS_LINUX, 'extra_commands': '', 'srcdir': srcdir, + 'copy_archive_args': copy_archive_arguments, } if flavor == 'mac': flock_command = './gyp-mac-tool flock' @@ -2043,7 +2045,9 @@ def CalculateMakefilePath(build_file, base_name): 'flock': 'lockf', }) elif flavor == 'aix': + copy_archive_arguments = '-pPRf' header_params.update({ + 'copy_archive_args': copy_archive_arguments, 'link_commands': LINK_COMMANDS_AIX, 'flock': './gyp-flock-tool flock', 'flock_index': 2, diff --git a/tools/gyp/pylib/gyp/generator/msvs.py b/tools/gyp/pylib/gyp/generator/msvs.py index 1338790ef68f9c..44cc1304a2e8ed 100644 --- a/tools/gyp/pylib/gyp/generator/msvs.py +++ b/tools/gyp/pylib/gyp/generator/msvs.py @@ -87,6 +87,8 @@ def _import_OrderedDict(): 'msvs_requires_importlibrary', 'msvs_enable_winphone', 'msvs_application_type_revision', + 'msvs_target_platform_version', + 'msvs_target_platform_minversion', ] @@ -2644,6 +2646,17 @@ def _GetMSBuildGlobalProperties(spec, guid, gyp_file_name): else: properties[0].append(['ApplicationTypeRevision', '8.1']) + if spec.get('msvs_target_platform_version'): + target_platform_version = spec.get('msvs_target_platform_version') + properties[0].append(['WindowsTargetPlatformVersion', + target_platform_version]) + if spec.get('msvs_target_platform_minversion'): + target_platform_minversion = spec.get('msvs_target_platform_minversion') + properties[0].append(['WindowsTargetPlatformMinVersion', + target_platform_minversion]) + else: + properties[0].append(['WindowsTargetPlatformMinVersion', + target_platform_version]) if spec.get('msvs_enable_winphone'): properties[0].append(['ApplicationType', 'Windows Phone']) else: diff --git a/tools/gyp/pylib/gyp/generator/ninja.py b/tools/gyp/pylib/gyp/generator/ninja.py index c2437822a7f85b..0e8ae9790853ea 100644 --- a/tools/gyp/pylib/gyp/generator/ninja.py +++ b/tools/gyp/pylib/gyp/generator/ninja.py @@ -921,6 +921,11 @@ def WriteSourcesForArch(self, ninja_file, config_name, config, sources, os.environ.get('CFLAGS', '').split() + cflags_c) cflags_cc = (os.environ.get('CPPFLAGS', '').split() + os.environ.get('CXXFLAGS', '').split() + cflags_cc) + elif self.toolset == 'host': + cflags_c = (os.environ.get('CPPFLAGS_host', '').split() + + os.environ.get('CFLAGS_host', '').split() + cflags_c) + cflags_cc = (os.environ.get('CPPFLAGS_host', '').split() + + os.environ.get('CXXFLAGS_host', '').split() + cflags_cc) defines = config.get('defines', []) + extra_defines self.WriteVariableList(ninja_file, 'defines', @@ -1672,7 +1677,7 @@ def CommandWithWrapper(cmd, wrappers, prog): def GetDefaultConcurrentLinks(): """Returns a best-guess for a number of concurrent links.""" - pool_size = int(os.getenv('GYP_LINK_CONCURRENCY', 0)) + pool_size = int(os.environ.get('GYP_LINK_CONCURRENCY', 0)) if pool_size: return pool_size @@ -1696,8 +1701,10 @@ class MEMORYSTATUSEX(ctypes.Structure): stat.dwLength = ctypes.sizeof(stat) ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(stat)) - mem_limit = max(1, stat.ullTotalPhys / (4 * (2 ** 30))) # total / 4GB - hard_cap = max(1, int(os.getenv('GYP_LINK_CONCURRENCY_MAX', 2**32))) + # VS 2015 uses 20% more working set than VS 2013 and can consume all RAM + # on a 64 GB machine. + mem_limit = max(1, stat.ullTotalPhys / (5 * (2 ** 30))) # total / 5GB + hard_cap = max(1, int(os.environ.get('GYP_LINK_CONCURRENCY_MAX', 2**32))) return min(mem_limit, hard_cap) elif sys.platform.startswith('linux'): if os.path.exists("/proc/meminfo"): @@ -2275,7 +2282,11 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params, if flavor == 'mac': gyp.xcode_emulation.MergeGlobalXcodeSettingsToSpec(data[build_file], spec) - build_file = gyp.common.RelativePath(build_file, options.toplevel_dir) + # If build_file is a symlink, we must not follow it because there's a chance + # it could point to a path above toplevel_dir, and we cannot correctly deal + # with that case at the moment. + build_file = gyp.common.RelativePath(build_file, options.toplevel_dir, + False) qualified_target_for_hash = gyp.common.QualifiedTarget(build_file, name, toolset) diff --git a/tools/gyp/pylib/gyp/input.py b/tools/gyp/pylib/gyp/input.py index c7efe99a122c0b..bc68c3765dba98 100644 --- a/tools/gyp/pylib/gyp/input.py +++ b/tools/gyp/pylib/gyp/input.py @@ -57,7 +57,7 @@ def IsPathSection(section): # If section ends in one of the '=+?!' characters, it's applied to a section # without the trailing characters. '/' is notably absent from this list, # because there's no way for a regular expression to be treated as a path. - while section[-1:] in '=+?!': + while section and section[-1:] in '=+?!': section = section[:-1] if section in path_sections: @@ -893,11 +893,15 @@ def ExpandVariables(input, phase, variables, build_file): else: # Fix up command with platform specific workarounds. contents = FixupPlatformCommand(contents) - p = subprocess.Popen(contents, shell=use_shell, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - stdin=subprocess.PIPE, - cwd=build_file_dir) + try: + p = subprocess.Popen(contents, shell=use_shell, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + stdin=subprocess.PIPE, + cwd=build_file_dir) + except Exception, e: + raise GypError("%s while executing command '%s' in %s" % + (e, contents, build_file)) p_stdout, p_stderr = p.communicate('') @@ -905,8 +909,8 @@ def ExpandVariables(input, phase, variables, build_file): sys.stderr.write(p_stderr) # Simulate check_call behavior, since check_call only exists # in python 2.5 and later. - raise GypError("Call to '%s' returned exit status %d." % - (contents, p.returncode)) + raise GypError("Call to '%s' returned exit status %d while in %s." % + (contents, p.returncode, build_file)) replacement = p_stdout.rstrip() cached_command_results[cache_key] = replacement diff --git a/tools/gyp/pylib/gyp/msvs_emulation.py b/tools/gyp/pylib/gyp/msvs_emulation.py index ce5c46ea5b3d95..ca67b122f0b9b1 100644 --- a/tools/gyp/pylib/gyp/msvs_emulation.py +++ b/tools/gyp/pylib/gyp/msvs_emulation.py @@ -442,6 +442,7 @@ def GetCflags(self, config): cl('FloatingPointModel', map={'0': 'precise', '1': 'strict', '2': 'fast'}, prefix='/fp:', default='0') + cl('CompileAsManaged', map={'false': '', 'true': '/clr'}) cl('WholeProgramOptimization', map={'true': '/GL'}) cl('WarningLevel', prefix='/W') cl('WarnAsError', map={'true': '/WX'}) @@ -593,6 +594,15 @@ def GetLdflags(self, config, gyp_to_build_path, expand_special, '2': 'WINDOWS%s' % minimum_required_version}, prefix='/SUBSYSTEM:') + stack_reserve_size = self._Setting( + ('VCLinkerTool', 'StackReserveSize'), config, default='') + if stack_reserve_size: + stack_commit_size = self._Setting( + ('VCLinkerTool', 'StackCommitSize'), config, default='') + if stack_commit_size: + stack_commit_size = ',' + stack_commit_size + ldflags.append('/STACK:%s%s' % (stack_reserve_size, stack_commit_size)) + ld('TerminalServerAware', map={'1': ':NO', '2': ''}, prefix='/TSAWARE') ld('LinkIncremental', map={'1': ':NO', '2': ''}, prefix='/INCREMENTAL') ld('BaseAddress', prefix='/BASE:') diff --git a/tools/gyp/pylib/gyp/win_tool.py b/tools/gyp/pylib/gyp/win_tool.py index 417e465f7853f4..bb6f1ea436f258 100755 --- a/tools/gyp/pylib/gyp/win_tool.py +++ b/tools/gyp/pylib/gyp/win_tool.py @@ -123,7 +123,9 @@ def ExecLinkWrapper(self, arch, use_separate_mspdbsrv, *args): stderr=subprocess.STDOUT) out, _ = link.communicate() for line in out.splitlines(): - if not line.startswith(' Creating library '): + if (not line.startswith(' Creating library ') and + not line.startswith('Generating code') and + not line.startswith('Finished generating code')): print line return link.returncode diff --git a/tools/gyp/pylib/gyp/xcode_emulation.py b/tools/gyp/pylib/gyp/xcode_emulation.py index c002b112c54cee..407ead074bbe7e 100644 --- a/tools/gyp/pylib/gyp/xcode_emulation.py +++ b/tools/gyp/pylib/gyp/xcode_emulation.py @@ -1032,7 +1032,23 @@ def _AdjustLibrary(self, library, config_name=None): sdk_root = self._SdkPath(config_name) if not sdk_root: sdk_root = '' - return l.replace('$(SDKROOT)', sdk_root) + # Xcode 7 started shipping with ".tbd" (text based stubs) files instead of + # ".dylib" without providing a real support for them. What it does, for + # "/usr/lib" libraries, is do "-L/usr/lib -lname" which is dependent on the + # library order and cause collision when building Chrome. + # + # Instead substitude ".tbd" to ".dylib" in the generated project when the + # following conditions are both true: + # - library is referenced in the gyp file as "$(SDKROOT)/**/*.dylib", + # - the ".dylib" file does not exists but a ".tbd" file do. + library = l.replace('$(SDKROOT)', sdk_root) + if l.startswith('$(SDKROOT)'): + basename, ext = os.path.splitext(library) + if ext == '.dylib' and not os.path.exists(library): + tbd_library = basename + '.tbd' + if os.path.exists(tbd_library): + library = tbd_library + return library def AdjustLibraries(self, libraries, config_name=None): """Transforms entries like 'Cocoa.framework' in libraries into entries like diff --git a/tools/gyp_node.py b/tools/gyp_node.py index 7b495055c180c8..0ceb93341f12d3 100755 --- a/tools/gyp_node.py +++ b/tools/gyp_node.py @@ -1,7 +1,5 @@ #!/usr/bin/env python -import glob import os -import shlex import sys script_dir = os.path.dirname(__file__) @@ -30,10 +28,12 @@ def run_gyp(args): args.append(os.path.join(node_root, 'node.gyp')) common_fn = os.path.join(node_root, 'common.gypi') options_fn = os.path.join(node_root, 'config.gypi') + options_fips_fn = os.path.join(node_root, 'config_fips.gypi') else: args.append(os.path.join(os.path.abspath(node_root), 'node.gyp')) common_fn = os.path.join(os.path.abspath(node_root), 'common.gypi') options_fn = os.path.join(os.path.abspath(node_root), 'config.gypi') + options_fips_fn = os.path.join(os.path.abspath(node_root), 'config_fips.gypi') if os.path.exists(common_fn): args.extend(['-I', common_fn]) @@ -41,6 +41,9 @@ def run_gyp(args): if os.path.exists(options_fn): args.extend(['-I', options_fn]) + if os.path.exists(options_fips_fn): + args.extend(['-I', options_fips_fn]) + args.append('--depth=' + node_root) # There's a bug with windows which doesn't allow this feature. diff --git a/tools/icu/icu-system.gyp b/tools/icu/icu-system.gyp index 44d4f5feff4cab..b3ca0e39b6c9eb 100644 --- a/tools/icu/icu-system.gyp +++ b/tools/icu/icu-system.gyp @@ -9,10 +9,12 @@ { 'target_name': 'icuuc', 'type': 'none', + 'toolsets': [ 'host', 'target' ], }, { 'target_name': 'icui18n', 'type': 'none', + 'toolsets': [ 'host', 'target' ], }, ], } diff --git a/tools/install.py b/tools/install.py index ff460bbc0f8306..88791eab10d034 100755 --- a/tools/install.py +++ b/tools/install.py @@ -1,12 +1,7 @@ #!/usr/bin/env python import errno - -try: - import json -except ImportError: - import simplejson as json - +import json import os import re import shutil @@ -160,6 +155,10 @@ def headers(action): 'src/node_version.h', ], 'include/node/') + # Add the expfile that is created on AIX + if sys.platform.startswith('aix'): + action(['out/Release/node.exp'], 'include/node/') + subdir_files('deps/cares/include', 'include/node/', action) subdir_files('deps/v8/include', 'include/node/', action) diff --git a/tools/js2c.py b/tools/js2c.py index 0fc0ae0ee7022d..3e9a1c39cc496f 100755 --- a/tools/js2c.py +++ b/tools/js2c.py @@ -42,24 +42,7 @@ def ToCArray(filename, lines): - result = [] - row = 1 - col = 0 - for chr in lines: - col += 1 - if chr == "\n" or chr == "\r": - row += 1 - col = 0 - - value = ord(chr) - - if value >= 128: - print 'non-ascii value ' + filename + ':' + str(row) + ':' + str(col) - sys.exit(1); - - result.append(str(value)) - result.append("0") - return ", ".join(result) + return ','.join(str(ord(c)) for c in lines) def CompressScript(lines, do_jsmin): @@ -220,17 +203,11 @@ def ReadMacros(lines): struct _native { const char* name; - const char* source; + const unsigned char* source; size_t source_len; }; -static const struct _native natives[] = { - -%(native_lines)s\ - - { NULL, NULL, 0 } /* sentinel */ - -}; +static const struct _native natives[] = { %(native_lines)s }; } #endif @@ -238,11 +215,11 @@ def ReadMacros(lines): NATIVE_DECLARATION = """\ - { "%(id)s", %(escaped_id)s_native, sizeof(%(escaped_id)s_native)-1 }, + { "%(id)s", %(escaped_id)s_native, sizeof(%(escaped_id)s_native) }, """ SOURCE_DECLARATION = """\ - const char %(escaped_id)s_native[] = { %(data)s }; + const unsigned char %(escaped_id)s_native[] = { %(data)s }; """ @@ -310,7 +287,7 @@ def JS2C(source, target): else: ids.append((id, len(lines))) - escaped_id = id.replace('/', '_') + escaped_id = id.replace('-', '_').replace('/', '_') source_lines.append(SOURCE_DECLARATION % { 'id': id, 'escaped_id': escaped_id, diff --git a/tools/jslint.js b/tools/jslint.js new file mode 100644 index 00000000000000..754ac1a98ca338 --- /dev/null +++ b/tools/jslint.js @@ -0,0 +1,262 @@ +'use strict'; + +const rulesDirs = ['tools/eslint-rules']; +// This is the maximum number of files to be linted per worker at any given time +const maxWorkload = 40; + +const cluster = require('cluster'); +const path = require('path'); +const fs = require('fs'); +const totalCPUs = require('os').cpus().length; + +const CLIEngine = require('./eslint').CLIEngine; +const glob = require('./eslint/node_modules/glob'); + +const cwd = process.cwd(); +const cli = new CLIEngine({ + rulePaths: rulesDirs +}); + +if (cluster.isMaster) { + var numCPUs = 1; + const paths = []; + var files = null; + var totalPaths = 0; + var failures = 0; + var successes = 0; + var lastLineLen = 0; + var curPath = 'Starting ...'; + var showProgress = true; + const globOptions = { + nodir: true + }; + const workerConfig = {}; + var startTime; + var formatter; + var outFn; + var fd; + var i; + + // Check if spreading work among all cores/cpus + if (process.argv.indexOf('-J') !== -1) + numCPUs = totalCPUs; + + // Check if spreading work among an explicit number of cores/cpus + i = process.argv.indexOf('-j'); + if (i !== -1) { + if (!process.argv[i + 1]) + throw new Error('Missing parallel job count'); + numCPUs = parseInt(process.argv[i + 1], 10); + if (!isFinite(numCPUs) || numCPUs <= 0) + throw new Error('Bad parallel job count'); + } + + // Check for custom JSLint report formatter + i = process.argv.indexOf('-f'); + if (i !== -1) { + if (!process.argv[i + 1]) + throw new Error('Missing format name'); + const format = process.argv[i + 1]; + formatter = cli.getFormatter(format); + if (!formatter) + throw new Error('Invalid format name'); + // Automatically disable progress display + showProgress = false; + // Tell worker to send all results, not just linter errors + workerConfig.sendAll = true; + } else { + // Use default formatter + formatter = cli.getFormatter(); + } + + // Check if outputting JSLint report to a file instead of stdout + i = process.argv.indexOf('-o'); + if (i !== -1) { + if (!process.argv[i + 1]) + throw new Error('Missing output filename'); + var outPath = process.argv[i + 1]; + if (!path.isAbsolute(outPath)) + outPath = path.join(cwd, outPath); + fd = fs.openSync(outPath, 'w'); + outFn = function(str) { + fs.writeSync(fd, str, 'utf8'); + }; + process.on('exit', function() { + fs.closeSync(fd); + }); + } else { + outFn = function(str) { + process.stdout.write(str); + }; + } + + // Process the rest of the arguments as paths to lint, ignoring any unknown + // flags + for (i = 2; i < process.argv.length; ++i) { + if (process.argv[i][0] === '-') { + switch (process.argv[i]) { + case '-f': // Skip format name + case '-o': // Skip filename + case '-j': // Skip parallel job count number + ++i; + break; + } + continue; + } + paths.push(process.argv[i]); + } + + if (paths.length === 0) + return; + totalPaths = paths.length; + + if (showProgress) { + // Start the progress display update timer when the first worker is ready + cluster.once('online', function(worker) { + startTime = process.hrtime(); + setInterval(printProgress, 1000).unref(); + printProgress(); + }); + } + + cluster.on('online', function(worker) { + // Configure worker and give it some initial work to do + worker.send(workerConfig); + sendWork(worker); + }); + + process.on('exit', function() { + if (showProgress) { + curPath = 'Done'; + printProgress(); + outFn('\r\n'); + } + process.exit(failures ? 1 : 0); + }); + + for (i = 0; i < numCPUs; ++i) + cluster.fork().on('message', onWorkerMessage); + + function onWorkerMessage(results) { + if (typeof results !== 'number') { + // The worker sent us results that are not all successes + if (!workerConfig.sendAll) + failures += results.length; + outFn(formatter(results) + '\r\n'); + printProgress(); + } else { + successes += results; + } + // Try to give the worker more work to do + sendWork(this); + } + + function sendWork(worker) { + if (!files || !files.length) { + // We either just started or we have no more files to lint for the current + // path. Find the next path that has some files to be linted. + while (paths.length) { + var dir = paths.shift(); + curPath = dir; + if (dir.indexOf('/') > 0) + dir = path.join(cwd, dir); + const patterns = cli.resolveFileGlobPatterns([dir]); + dir = path.resolve(patterns[0]); + files = glob.sync(dir, globOptions); + if (files.length) + break; + } + if ((!files || !files.length) && !paths.length) { + // We exhausted all input paths and thus have nothing left to do, so end + // the worker + return worker.disconnect(); + } + } + // Give the worker an equal portion of the work left for the current path, + // but not exceeding a maximum file count in order to help keep *all* + // workers busy most of the time instead of only a minority doing most of + // the work. + const sliceLen = Math.min(maxWorkload, Math.ceil(files.length / numCPUs)); + var slice; + if (sliceLen === files.length) { + // Micro-ptimization to avoid splicing to an empty array + slice = files; + files = null; + } else { + slice = files.splice(0, sliceLen); + } + worker.send(slice); + } + + function printProgress() { + if (!showProgress) + return; + + // Clear line + outFn('\r' + ' '.repeat(lastLineLen) + '\r'); + + // Calculate and format the data for displaying + const elapsed = process.hrtime(startTime)[0]; + const mins = padString(Math.floor(elapsed / 60), 2, '0'); + const secs = padString(elapsed % 60, 2, '0'); + const passed = padString(successes, 6, ' '); + const failed = padString(failures, 6, ' '); + var pct = Math.ceil(((totalPaths - paths.length) / totalPaths) * 100); + pct = padString(pct, 3, ' '); + + var line = `[${mins}:${secs}|%${pct}|+${passed}|-${failed}]: ${curPath}`; + + // Truncate line like cpplint does in case it gets too long + if (line.length > 75) + line = line.slice(0, 75) + '...'; + + // Store the line length so we know how much to erase the next time around + lastLineLen = line.length; + + outFn(line); + } + + function padString(str, len, chr) { + str = '' + str; + if (str.length >= len) + return str; + return chr.repeat(len - str.length) + str; + } +} else { + // Worker + + var config = {}; + process.on('message', function(files) { + if (files instanceof Array) { + // Lint some files + const report = cli.executeOnFiles(files); + if (config.sendAll) { + // Return both success and error results + + const results = report.results; + // Silence warnings for files with no errors while keeping the "ok" + // status + if (report.warningCount > 0) { + for (var i = 0; i < results.length; ++i) { + const result = results[i]; + if (result.errorCount === 0 && result.warningCount > 0) { + result.warningCount = 0; + result.messages = []; + } + } + } + process.send(results); + } else if (report.errorCount === 0) { + // No errors, return number of successful lint operations + process.send(files.length); + } else { + // One or more errors, return the error results only + process.send(CLIEngine.getErrorResults(report.results)); + } + } else if (typeof files === 'object') { + // The master process is actually sending us our configuration and not a + // list of files to lint + config = files; + } + }); +} diff --git a/tools/license-builder.sh b/tools/license-builder.sh new file mode 100755 index 00000000000000..3d587227b41ae4 --- /dev/null +++ b/tools/license-builder.sh @@ -0,0 +1,76 @@ +#!/usr/bin/env bash + +set -e + +rootdir="$(CDPATH= cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +licensefile="${rootdir}/LICENSE" +licensehead="$(sed '/^- /,$d' ${licensefile})" +tmplicense="${rootdir}/~LICENSE.$$" +echo -e "$licensehead" > $tmplicense + + +# addlicense +function addlicense { + + echo " +- ${1}, located at ${2}, is licensed as follows: + \"\"\" +$(echo -e "$3" | sed -e 's/^/ /' -e 's/^ $//' -e 's/ *$//' | sed -e '/./,$!d' | sed -e '/^$/N;/^\n$/D') + \"\"\"\ +" >> $tmplicense + +} + + +if ! [ -d "${rootdir}/deps/icu/" ]; then + echo "ICU not installed, run configure to download it, e.g. ./configure --with-intl=small-icu --download=icu" + exit 1 +fi + + +# Dependencies bundled in distributions +addlicense "c-ares" "deps/cares" \ + "$(sed -e '/^ \*\/$/,$d' -e '/^$/d' -e 's/^[/ ]\* *//' ${rootdir}/deps/cares/src/ares_init.c)" +addlicense "HTTP Parser" "deps/http_parser" "$(cat deps/http_parser/LICENSE-MIT)" +if [ -f "${rootdir}/deps/icu/LICENSE" ]; then + # ICU 57 and following. Drop the BOM + addlicense "ICU" "deps/icu" \ + "$(sed -e '1s/^[^a-zA-Z ]*ICU/ICU/' -e :a \ + -e 's/<[^>]*>//g;s/ / /g;s/ +$//;/]*>//g;s/ / /g;s/ +$//;/ .gclient +if [ "$v8ver" != "v8" ]; then + mv v8 .v8old + mv $v8ver v8 +fi +gclient sync +cleanup diff --git a/tools/msvs/genfiles/MSG00001.bin b/tools/msvs/genfiles/MSG00001.bin deleted file mode 100644 index 051a5d8ca8b6d2..00000000000000 Binary files a/tools/msvs/genfiles/MSG00001.bin and /dev/null differ diff --git a/tools/msvs/genfiles/node_etw_provider.h b/tools/msvs/genfiles/node_etw_provider.h deleted file mode 100644 index f9f21ad352d086..00000000000000 --- a/tools/msvs/genfiles/node_etw_provider.h +++ /dev/null @@ -1,59 +0,0 @@ -//**********************************************************************` -//* This is an include file generated by Message Compiler. *` -//* *` -//* Copyright (c) Microsoft Corporation. All Rights Reserved. *` -//**********************************************************************` -#pragma once -//+ -// Provider NodeJS-ETW-provider Event Count 12 -//+ -EXTERN_C __declspec(selectany) const GUID NODE_ETW_PROVIDER = {0x77754e9b, 0x264b, 0x4d8d, {0xb9, 0x81, 0xe4, 0x13, 0x5c, 0x1e, 0xcb, 0x0c}}; - -// -// Opcodes -// -#define NODE_ETW_PROVIDER_OPCODE_NODE_HTTP_SERVER_REQUEST 0xa -#define NODE_ETW_PROVIDER_OPCODE_NODE_HTTP_SERVER_RESPONSE 0xb -#define NODE_ETW_PROVIDER_OPCODE_NODE_HTTP_CLIENT_REQUEST 0xc -#define NODE_ETW_PROVIDER_OPCODE_NODE_HTTP_CLIENT_RESPONSE 0xd -#define NODE_ETW_PROVIDER_OPCODE_NODE_NET_SERVER_CONNECTION 0xe -#define NODE_ETW_PROVIDER_OPCODE_NODE_NET_STREAM_END 0xf -#define NODE_ETW_PROVIDER_OPCODE_NODE_GC_START 0x10 -#define NODE_ETW_PROVIDER_OPCODE_NODE_GC_DONE 0x11 -#define NODE_ETW_PROVIDER_OPCODE_NODE_V8SYMBOL_REMOVE 0x15 -#define NODE_ETW_PROVIDER_OPCODE_NODE_V8SYMBOL_MOVE 0x16 -#define NODE_ETW_PROVIDER_OPCODE_NODE_V8SYMBOL_RESET 0x17 -#define JSCRIPT_METHOD_METHODLOAD_OPCODE 0xa - -// -// Tasks -// -#define JSCRIPT_METHOD_RUNTIME_TASK 0x1 - -// -// Event Descriptors -// -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR NODE_HTTP_SERVER_REQUEST_EVENT = {0x1, 0x0, 0x0, 0x4, 0xa, 0x0, 0x0}; -#define NODE_HTTP_SERVER_REQUEST_EVENT_value 0x1 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR NODE_HTTP_SERVER_RESPONSE_EVENT = {0x2, 0x0, 0x0, 0x4, 0xb, 0x0, 0x0}; -#define NODE_HTTP_SERVER_RESPONSE_EVENT_value 0x2 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR NODE_HTTP_CLIENT_REQUEST_EVENT = {0x3, 0x0, 0x0, 0x4, 0xc, 0x0, 0x0}; -#define NODE_HTTP_CLIENT_REQUEST_EVENT_value 0x3 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR NODE_HTTP_CLIENT_RESPONSE_EVENT = {0x4, 0x0, 0x0, 0x4, 0xd, 0x0, 0x0}; -#define NODE_HTTP_CLIENT_RESPONSE_EVENT_value 0x4 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR NODE_NET_SERVER_CONNECTION_EVENT = {0x5, 0x0, 0x0, 0x4, 0xe, 0x0, 0x0}; -#define NODE_NET_SERVER_CONNECTION_EVENT_value 0x5 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR NODE_NET_STREAM_END_EVENT = {0x6, 0x0, 0x0, 0x4, 0xf, 0x0, 0x0}; -#define NODE_NET_STREAM_END_EVENT_value 0x6 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR NODE_GC_START_EVENT = {0x7, 0x0, 0x0, 0x4, 0x10, 0x0, 0x0}; -#define NODE_GC_START_EVENT_value 0x7 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR NODE_GC_DONE_EVENT = {0x8, 0x0, 0x0, 0x4, 0x11, 0x0, 0x0}; -#define NODE_GC_DONE_EVENT_value 0x8 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR MethodLoad = {0x9, 0x0, 0x0, 0x4, 0xa, 0x1, 0x0}; -#define MethodLoad_value 0x9 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR NODE_V8SYMBOL_REMOVE_EVENT = {0x15, 0x0, 0x0, 0x4, 0x15, 0x0, 0x0}; -#define NODE_V8SYMBOL_REMOVE_EVENT_value 0x15 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR NODE_V8SYMBOL_MOVE_EVENT = {0x16, 0x0, 0x0, 0x4, 0x16, 0x0, 0x0}; -#define NODE_V8SYMBOL_MOVE_EVENT_value 0x16 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR NODE_V8SYMBOL_RESET_EVENT = {0x17, 0x0, 0x0, 0x4, 0x17, 0x0, 0x0}; -#define NODE_V8SYMBOL_RESET_EVENT_value 0x17 diff --git a/tools/msvs/genfiles/node_etw_provider.rc b/tools/msvs/genfiles/node_etw_provider.rc deleted file mode 100644 index 90b56169bc1a23..00000000000000 --- a/tools/msvs/genfiles/node_etw_provider.rc +++ /dev/null @@ -1,3 +0,0 @@ -LANGUAGE 0x9,0x1 -1 11 "MSG00001.bin" -1 WEVT_TEMPLATE "node_etw_providerTEMP.BIN" diff --git a/tools/msvs/genfiles/node_etw_providerTEMP.BIN b/tools/msvs/genfiles/node_etw_providerTEMP.BIN deleted file mode 100644 index 32bede33875c97..00000000000000 Binary files a/tools/msvs/genfiles/node_etw_providerTEMP.BIN and /dev/null differ diff --git a/tools/msvs/genfiles/node_perfctr_provider.h b/tools/msvs/genfiles/node_perfctr_provider.h deleted file mode 100644 index 19da3925e4a74c..00000000000000 --- a/tools/msvs/genfiles/node_perfctr_provider.h +++ /dev/null @@ -1,92 +0,0 @@ -//------------------------------------------------------------------ -// !!! WARNING !!! -// -// This file is auto generated by ctrpp.exe utility from performance -// counters manifest: -// -// src\res\node_perfctr_provider.man -// -// It should be regenerated every time the code is built. -// Do not check it in. -//------------------------------------------------------------------- - -#pragma once - -#include -#include - - -EXTERN_C DECLSPEC_SELECTANY GUID NodeCounterProviderGuid = { 0x1e2e15d7, 0x3760, 0x470e, 0x86, 0x99, 0xb9, 0xdb, 0x52, 0x48, 0xed, 0xd5 }; - -EXTERN_C DECLSPEC_SELECTANY GUID NodeCounterSetGuid = { 0x3a22a8ec, 0x297c, 0x48ac, 0xab, 0x15, 0x33, 0xec, 0x93, 0x3, 0x3f, 0xd8 }; - - -EXTERN_C DECLSPEC_SELECTANY HANDLE NodeCounterProvider = NULL; - -EXTERN_C DECLSPEC_SELECTANY struct { - PERF_COUNTERSET_INFO CounterSet; - PERF_COUNTER_INFO Counter0; - PERF_COUNTER_INFO Counter1; - PERF_COUNTER_INFO Counter2; - PERF_COUNTER_INFO Counter3; - PERF_COUNTER_INFO Counter4; - PERF_COUNTER_INFO Counter5; - PERF_COUNTER_INFO Counter6; - PERF_COUNTER_INFO Counter7; - PERF_COUNTER_INFO Counter8; - PERF_COUNTER_INFO Counter9; -} NodeCounterSetInfo = { - { { 0x3a22a8ec, 0x297c, 0x48ac, 0xab, 0x15, 0x33, 0xec, 0x93, 0x3, 0x3f, 0xd8 }, { 0x1e2e15d7, 0x3760, 0x470e, 0x86, 0x99, 0xb9, 0xdb, 0x52, 0x48, 0xed, 0xd5 }, 10, PERF_COUNTERSET_MULTI_AGGREGATE }, - { 1, PERF_COUNTER_COUNTER, 0, sizeof(ULONG), PERF_DETAIL_NOVICE, 0, 0 }, - { 2, PERF_COUNTER_COUNTER, 0, sizeof(ULONG), PERF_DETAIL_NOVICE, 0, 0 }, - { 3, PERF_COUNTER_COUNTER, 0, sizeof(ULONG), PERF_DETAIL_NOVICE, 0, 0 }, - { 4, PERF_COUNTER_COUNTER, 0, sizeof(ULONG), PERF_DETAIL_NOVICE, 0, 0 }, - { 5, PERF_COUNTER_RAWCOUNT, 0, sizeof(ULONG), PERF_DETAIL_NOVICE, 0, 0 }, - { 6, PERF_COUNTER_BULK_COUNT, 0, sizeof(ULONGLONG), PERF_DETAIL_NOVICE, 4294967293, 0 }, - { 7, PERF_COUNTER_BULK_COUNT, 0, sizeof(ULONGLONG), PERF_DETAIL_NOVICE, 4294967293, 0 }, - { 8, PERF_COUNTER_RAWCOUNT, 0, sizeof(ULONG), PERF_DETAIL_NOVICE, 0, 0 }, - { 9, PERF_COUNTER_BULK_COUNT, 0, sizeof(ULONGLONG), PERF_DETAIL_NOVICE, 4294967293, 0 }, - { 10, PERF_COUNTER_BULK_COUNT, 0, sizeof(ULONGLONG), PERF_DETAIL_NOVICE, 4294967293, 0 }, -}; - -EXTERN_C FORCEINLINE -VOID -CounterCleanup( - VOID - ) -{ - if (NodeCounterProvider != NULL) { - PerfStopProvider(NodeCounterProvider); - NodeCounterProvider = NULL; - } -} - -EXTERN_C FORCEINLINE -ULONG -CounterInitialize( - VOID - ) -{ - ULONG Status; - PERF_PROVIDER_CONTEXT ProviderContext; - - ZeroMemory(&ProviderContext, sizeof(PERF_PROVIDER_CONTEXT)); - ProviderContext.ContextSize = sizeof(PERF_PROVIDER_CONTEXT); - - Status = PerfStartProviderEx(&NodeCounterProviderGuid, - &ProviderContext, - &NodeCounterProvider); - if (Status != ERROR_SUCCESS) { - NodeCounterProvider = NULL; - return Status; - } - - Status = PerfSetCounterSetInfo(NodeCounterProvider, - &NodeCounterSetInfo.CounterSet, - sizeof NodeCounterSetInfo); - if (Status != ERROR_SUCCESS) { - CounterCleanup(); - return Status; - } - return ERROR_SUCCESS; -} diff --git a/tools/msvs/genfiles/node_perfctr_provider.rc b/tools/msvs/genfiles/node_perfctr_provider.rc deleted file mode 100644 index 5b1b2daef10a06..00000000000000 Binary files a/tools/msvs/genfiles/node_perfctr_provider.rc and /dev/null differ diff --git a/tools/msvs/nodevars.bat b/tools/msvs/nodevars.bat index 22d2ec48da6c57..c94c44609711fa 100644 --- a/tools/msvs/nodevars.bat +++ b/tools/msvs/nodevars.bat @@ -1,7 +1,7 @@ @echo off rem Ensure this Node.js and npm are first in the PATH -set PATH=%APPDATA%\npm;%~dp0;%PATH% +set "PATH=%APPDATA%\npm;%~dp0;%PATH%" setlocal enabledelayedexpansion pushd "%~dp0" diff --git a/tools/release.sh b/tools/release.sh index d54252b8100cff..3f6754275a9636 100755 --- a/tools/release.sh +++ b/tools/release.sh @@ -20,7 +20,7 @@ signcmd=dist-sign echo "# Selecting GPG key ..." -gpgkey=$(gpg --list-secret-keys | grep '^sec' | awk -F'( +|/)' '{print $3}') +gpgkey=$(gpg --list-secret-keys | awk -F'( +|/)' '/^(sec|ssb)/{print $3}') keycount=$(echo $gpgkey | wc -w) if [ $keycount -eq 0 ]; then diff --git a/tools/test-npm.sh b/tools/test-npm.sh index 62929ee8ccc94f..51a2a5225a6929 100755 --- a/tools/test-npm.sh +++ b/tools/test-npm.sh @@ -23,16 +23,21 @@ cd test-npm rm -rf npm-cache npm-tmp npm-prefix mkdir npm-cache npm-tmp npm-prefix -# set some npm env varibles to point to our new temporary folders -export npm_config_cache="npm-cache" -export npm_config_prefix="npm-prefix" -export npm_config_tmp="npm-tmp" +# set some npm env variables to point to our new temporary folders +export npm_config_cache="$(pwd)/npm-cache" +export npm_config_prefix="$(pwd)/npm-prefix" +export npm_config_tmp="$(pwd)/npm-tmp" -# install npm devDependencies and run npm's tests +# ensure npm always uses the local node +export PATH="$(../$NODE -p 'require("path").resolve("..")'):$PATH" +unset NODE -../$NODE cli.js install --ignore-scripts -../$NODE cli.js run-script test-legacy -../$NODE cli.js run-script test +# make sure the binaries from the non-dev-deps are available +node cli.js rebuild +# install npm devDependencies and run npm's tests +node cli.js install --ignore-scripts +# run the tests +node cli.js run-script test-node # clean up everything one single shot cd .. && rm -rf test-npm diff --git a/tools/test.py b/tools/test.py index 26b70233d53f85..3cd2778930c8ab 100755 --- a/tools/test.py +++ b/tools/test.py @@ -138,6 +138,14 @@ def RunSingle(self, parallel, thread_id): try: start = datetime.now() output = case.Run() + # SmartOS has a bug that causes unexpected ECONNREFUSED errors. + # See https://smartos.org/bugview/OS-2767 + # If ECONNREFUSED on SmartOS, retry the test one time. + if (output.UnexpectedOutput() and + sys.platform == 'sunos5' and + 'ECONNREFUSED' in output.output.stderr): + output = case.Run() + output.diagnostic.append('ECONNREFUSED received, test retried') case.duration = (datetime.now() - start) except IOError, e: return @@ -248,6 +256,10 @@ def HasRun(self, output): class TapProgressIndicator(SimpleProgressIndicator): + def _printDiagnostic(self, messages): + for l in messages.splitlines(): + logger.info('# ' + l) + def Starting(self): logger.info('1..%i' % len(self.cases)) self._done = 0 @@ -263,14 +275,13 @@ def HasRun(self, output): if FLAKY in output.test.outcomes and self.flaky_tests_mode == DONTCARE: status_line = status_line + ' # TODO : Fix flaky test' logger.info(status_line) + self._printDiagnostic("\n".join(output.diagnostic)) if output.HasTimedOut(): - logger.info('# TIMEOUT') + self._printDiagnostic('TIMEOUT') - for l in output.output.stderr.splitlines(): - logger.info('#' + l) - for l in output.output.stdout.splitlines(): - logger.info('#' + l) + self._printDiagnostic(output.output.stderr) + self._printDiagnostic(output.output.stdout) else: skip = skip_regex.search(output.output.stdout) if skip: @@ -281,6 +292,7 @@ def HasRun(self, output): if FLAKY in output.test.outcomes: status_line = status_line + ' # TODO : Fix flaky test' logger.info(status_line) + self._printDiagnostic("\n".join(output.diagnostic)) duration = output.test.duration @@ -418,7 +430,7 @@ def __init__(self, context, path, arch, mode): self.thread_id = 0 def IsNegative(self): - return False + return self.context.expect_fail def CompareTime(self, other): return cmp(other.duration, self.duration) @@ -483,6 +495,7 @@ def __init__(self, test, command, output, store_unexpected_output): self.command = command self.output = output self.store_unexpected_output = store_unexpected_output + self.diagnostic = [] def UnexpectedOutput(self): if self.HasCrashed(): @@ -696,6 +709,10 @@ def GetConfiguration(self, context): (file, pathname, description) = imp.find_module('testcfg', [ self.path ]) module = imp.load_module('testcfg', file, pathname, description) self.config = module.GetConfiguration(context, self.path) + if hasattr(self.config, 'additional_flags'): + self.config.additional_flags += context.node_args + else: + self.config.additional_flags = context.node_args finally: if file: file.close() @@ -756,16 +773,20 @@ def GetTestStatus(self, context, sections, defs): 'armv6' : { 'debug' : 12, 'release' : 3 }, # The ARM buildbots are slow. 'arm' : { 'debug' : 8, 'release' : 2 }, 'ia32' : { 'debug' : 4, 'release' : 1 }, - 'ppc' : { 'debug' : 4, 'release' : 1 } } + 'ppc' : { 'debug' : 4, 'release' : 1 }, + 's390' : { 'debug' : 4, 'release' : 1 } } class Context(object): - def __init__(self, workspace, buildspace, verbose, vm, timeout, processor, suppress_dialogs, store_unexpected_output): + def __init__(self, workspace, buildspace, verbose, vm, args, expect_fail, + timeout, processor, suppress_dialogs, store_unexpected_output): self.workspace = workspace self.buildspace = buildspace self.verbose = verbose self.vm_root = vm + self.node_args = args + self.expect_fail = expect_fail self.timeout = timeout self.processor = processor self.suppress_dialogs = suppress_dialogs @@ -1268,6 +1289,10 @@ def BuildOptions(): result.add_option("--snapshot", help="Run the tests with snapshot turned on", default=False, action="store_true") result.add_option("--special-command", default=None) + result.add_option("--node-args", dest="node_args", help="Args to pass through to Node", + default=[], action="append") + result.add_option("--expect-fail", dest="expect_fail", + help="Expect test cases to fail", default=False, action="store_true") result.add_option("--valgrind", help="Run tests through valgrind", default=False, action="store_true") result.add_option("--cat", help="Print the source of the tests", @@ -1297,6 +1322,8 @@ def BuildOptions(): result.add_option("-r", "--run", help="Divide the tests in m groups (interleaved) and run tests from group n (--run=n,m with n < m)", default="") + result.add_option('--temp-dir', + help='Optional path to change directory used for tests', default=False) return result @@ -1324,7 +1351,10 @@ def ProcessOptions(options): print "The test group to run (n) must be smaller than number of groups (m)." return False if options.J: - options.j = multiprocessing.cpu_count() + # inherit JOBS from environment if provided. some virtualised systems + # 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"]: print "Unknown flaky-tests mode %s" % options.flaky_tests return False @@ -1453,6 +1483,8 @@ def Main(): buildspace, VERBOSE, shell, + options.node_args, + options.expect_fail, options.timeout, processor, options.suppress_dialogs, @@ -1491,10 +1523,15 @@ def Main(): if not exists(vm): print "Can't find shell executable: '%s'" % vm continue + archEngineContext = Execute([vm, "-p", "process.arch"], context) + vmArch = archEngineContext.stdout.rstrip() + if archEngineContext.exit_code is not 0 or vmArch == "undefined": + print "Can't determine the arch of: '%s'" % vm + continue env = { 'mode': mode, 'system': utils.GuessOS(), - 'arch': arch, + 'arch': vmArch, } test_list = root.ListTests([], path, context, arch, mode) unclassified_tests += test_list @@ -1525,6 +1562,16 @@ def Main(): for rule in globally_unused_rules: print "Rule for '%s' was not used." % '/'.join([str(s) for s in rule.path]) + tempdir = os.environ.get('NODE_TEST_DIR') or options.temp_dir + if tempdir: + try: + os.makedirs(tempdir) + os.environ['NODE_TEST_DIR'] = tempdir + except OSError as exception: + if exception.errno != errno.EEXIST: + print "Could not create the temporary directory", options.temp_dir + sys.exit(1) + if options.report: PrintReport(all_cases) diff --git a/tools/utils.py b/tools/utils.py index c77ab8edafcbe3..dd5ce3fcb629a4 100644 --- a/tools/utils.py +++ b/tools/utils.py @@ -89,6 +89,8 @@ def GuessArchitecture(): return 'ia32' elif id.startswith('ppc'): return 'ppc' + elif id == 's390x': + return 's390' else: id = platform.processor() if id == 'powerpc': diff --git a/tools/v8-prof/polyfill.js b/tools/v8-prof/polyfill.js deleted file mode 100644 index 24661c70023e16..00000000000000 --- a/tools/v8-prof/polyfill.js +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2012 the V8 project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Node polyfill -var fs = require('fs'); -var os = { - system: function(name, args) { - if (process.platform === 'linux' && name === 'nm') { - // Filter out vdso and vsyscall entries. - var arg = args[args.length - 1]; - if (arg === '[vdso]' || - arg == '[vsyscall]' || - /^[0-9a-f]+-[0-9a-f]+$/.test(arg)) { - return ''; - } - } - return require('child_process').execFileSync( - name, args, {encoding: 'utf8'}); - } -}; -var print = console.log; -function read(fileName) { - return fs.readFileSync(fileName, 'utf8'); -} -arguments = process.argv.slice(2); -var quit = process.exit; - -// Polyfill "readline()". -var fd = fs.openSync(arguments[arguments.length - 1], 'r'); -var buf = new Buffer(4096); -var dec = new (require('string_decoder').StringDecoder)('utf-8'); -var line = ''; -versionCheck(); -function readline() { - while (true) { - var lineBreak = line.indexOf('\n'); - if (lineBreak !== -1) { - var res = line.slice(0, lineBreak); - line = line.slice(lineBreak + 1); - return res; - } - var bytes = fs.readSync(fd, buf, 0, buf.length); - line += dec.write(buf.slice(0, bytes)); - if (line.length === 0) { - return false; - } - } -} - -function versionCheck() { - // v8-version looks like "v8-version,$major,$minor,$build,$patch,$candidate" - // whereas process.versions.v8 is either "$major.$minor.$build" or - // "$major.$minor.$build.$patch". - var firstLine = readline(); - line = firstLine + '\n' + line; - firstLine = firstLine.split(','); - var curVer = process.versions.v8.split('.'); - if (firstLine.length !== 6 && firstLine[0] !== 'v8-version') { - console.log('Unable to read v8-version from log file.'); - return; - } - // Compare major, minor and build; ignore the patch and candidate fields. - for (var i = 0; i < 3; i++) { - if (curVer[i] !== firstLine[i + 1]) { - console.log('Testing v8 version different from logging version'); - return; - } - } -} diff --git a/tools/v8-prof/tick-processor.js b/tools/v8-prof/tick-processor.js deleted file mode 100644 index b25bcb75a467b2..00000000000000 --- a/tools/v8-prof/tick-processor.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; -var cp = require('child_process'); -var fs = require('fs'); -var path = require('path'); - -var toolsPath = path.join(__dirname, '..', '..', 'deps', 'v8', 'tools'); -var scriptFiles = [ - path.join(__dirname, 'polyfill.js'), - path.join(toolsPath, 'splaytree.js'), - path.join(toolsPath, 'codemap.js'), - path.join(toolsPath, 'csvparser.js'), - path.join(toolsPath, 'consarray.js'), - path.join(toolsPath, 'csvparser.js'), - path.join(toolsPath, 'consarray.js'), - path.join(toolsPath, 'profile.js'), - path.join(toolsPath, 'profile_view.js'), - path.join(toolsPath, 'logreader.js'), - path.join(toolsPath, 'tickprocessor.js'), - path.join(toolsPath, 'SourceMap.js'), - path.join(toolsPath, 'tickprocessor-driver.js')]; -var tempScript = path.join(__dirname, 'tick-processor-tmp-' + process.pid); - -process.on('exit', function() { - try { fs.unlinkSync(tempScript); } catch (e) {} -}); -process.on('uncaughtException', function(err) { - try { fs.unlinkSync(tempScript); } catch (e) {} - throw err; -}); - -var inStreams = scriptFiles.map(function(f) { - return fs.createReadStream(f); -}); -var outStream = fs.createWriteStream(tempScript); -inStreams.reduce(function(prev, curr, i) { - prev.on('end', function() { - curr.pipe(outStream, { end: i === inStreams.length - 1}); - }); - return curr; -}); -inStreams[0].pipe(outStream, { end: false }); -outStream.on('close', function() { - var tickArguments = [tempScript]; - if (process.platform === 'darwin') { - tickArguments.push('--mac', '--nm=' + path.join(toolsPath, 'mac-nm')); - } else if (process.platform === 'win32') { - tickArguments.push('--windows'); - } - tickArguments.push.apply(tickArguments, process.argv.slice(2)); - var processTicks = cp.spawn(process.execPath, tickArguments, { stdio: 'inherit' }); -}); diff --git a/vcbuild.bat b/vcbuild.bat index 08b1462e172192..4bc73c496d4b41 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -15,8 +15,7 @@ if /i "%1"=="/?" goto help set config=Release set target=Build set target_arch=x86 -set debug_arg= -set snapshot_arg= +set target_env= set noprojgen= set nobuild= set nosign= @@ -28,15 +27,16 @@ set licensertf= set jslint= set buildnodeweak= set noetw= -set noetw_arg= set noetw_msi_arg= set noperfctr= -set noperfctr_arg= set noperfctr_msi_arg= set i18n_arg= set download_arg= set release_urls_arg= set build_release= +set enable_vtune_arg= +set configure_flags= +set build_addons= :next-arg if "%1"=="" goto args-done @@ -46,6 +46,8 @@ if /i "%1"=="clean" set target=Clean&goto arg-ok if /i "%1"=="ia32" set target_arch=x86&goto arg-ok if /i "%1"=="x86" set target_arch=x86&goto arg-ok if /i "%1"=="x64" set target_arch=x64&goto arg-ok +if /i "%1"=="vc2013" set target_env=vc2013&goto arg-ok +if /i "%1"=="vc2015" set target_env=vc2015&goto arg-ok if /i "%1"=="noprojgen" set noprojgen=1&goto arg-ok if /i "%1"=="nobuild" set nobuild=1&goto arg-ok if /i "%1"=="nosign" set nosign=1&goto arg-ok @@ -53,16 +55,18 @@ if /i "%1"=="nosnapshot" set nosnapshot=1&goto arg-ok if /i "%1"=="noetw" set noetw=1&goto arg-ok if /i "%1"=="noperfctr" set noperfctr=1&goto arg-ok if /i "%1"=="licensertf" set licensertf=1&goto arg-ok -if /i "%1"=="test" set test_args=%test_args% sequential parallel message -J&set jslint=1&goto arg-ok -if /i "%1"=="test-ci" set test_args=%test_args% %test_ci_args% -p tap --logfile test.tap message sequential parallel&goto arg-ok +if /i "%1"=="test" set test_args=%test_args% addons sequential parallel message -J&set jslint=1&set build_addons=1&goto arg-ok +if /i "%1"=="test-ci" set test_args=%test_args% %test_ci_args% -p tap --logfile test.tap addons message sequential parallel&set build_addons=1&goto arg-ok +if /i "%1"=="test-addons" set test_args=%test_args% addons&set build_addons=1&goto arg-ok if /i "%1"=="test-simple" set test_args=%test_args% sequential parallel -J&goto arg-ok if /i "%1"=="test-message" set test_args=%test_args% message&goto arg-ok if /i "%1"=="test-gc" set test_args=%test_args% gc&set buildnodeweak=1&goto arg-ok if /i "%1"=="test-internet" set test_args=%test_args% internet&goto arg-ok if /i "%1"=="test-pummel" set test_args=%test_args% pummel&goto arg-ok if /i "%1"=="test-all" set test_args=%test_args% sequential parallel message gc internet pummel&set buildnodeweak=1&set jslint=1&goto arg-ok +if /i "%1"=="test-known-issues" set test_args=%test_args% known_issues --expect-fail&goto arg-ok if /i "%1"=="jslint" set jslint=1&goto arg-ok -@rem Include small-icu support with MSI installer +if /i "%1"=="jslint-ci" set jslint_ci=1&goto arg-ok if /i "%1"=="msi" set msi=1&set licensertf=1&set download_arg="--download=all"&set i18n_arg=small-icu&goto arg-ok if /i "%1"=="build-release" set build_release=1&goto arg-ok if /i "%1"=="upload" set upload=1&goto arg-ok @@ -71,6 +75,7 @@ if /i "%1"=="full-icu" set i18n_arg=%1&goto arg-ok if /i "%1"=="intl-none" set i18n_arg=%1&goto arg-ok if /i "%1"=="download-all" set download_arg="--download=all"&goto arg-ok if /i "%1"=="ignore-flaky" set test_args=%test_args% --flaky-tests=dontcare&goto arg-ok +if /i "%1"=="enable-vtune" set enable_vtune_arg=1&goto arg-ok echo Warning: ignoring invalid command line option `%1`. @@ -89,15 +94,22 @@ if defined build_release ( set i18n_arg=small-icu ) -if "%config%"=="Debug" set debug_arg=--debug -if defined nosnapshot set snapshot_arg=--without-snapshot -if defined noetw set noetw_arg=--without-etw& set noetw_msi_arg=/p:NoETW=1 -if defined noperfctr set noperfctr_arg=--without-perfctr& set noperfctr_msi_arg=/p:NoPerfCtr=1 -if defined RELEASE_URLBASE set release_urlbase_arg=--release-urlbase=%RELEASE_URLBASE% +:: assign path to node_exe +set "node_exe=%config%\node.exe" -if "%i18n_arg%"=="full-icu" set i18n_arg=--with-intl=full-icu -if "%i18n_arg%"=="small-icu" set i18n_arg=--with-intl=small-icu -if "%i18n_arg%"=="intl-none" set i18n_arg=--with-intl=none +if "%config%"=="Debug" set configure_flags=%configure_flags% --debug +if defined nosnapshot set configure_flags=%configure_flags% --without-snapshot +if defined noetw set configure_flags=%configure_flags% --without-etw& set noetw_msi_arg=/p:NoETW=1 +if defined noperfctr set configure_flags=%configure_flags% --without-perfctr& set noperfctr_msi_arg=/p:NoPerfCtr=1 +if defined release_urlbase set release_urlbase_arg=--release-urlbase=%release_urlbase% +if defined download_arg set configure_flags=%configure_flags% %download_arg% +if defined enable_vtune_arg set configure_flags=%configure_flags% --enable-vtune-profiling + +if "%i18n_arg%"=="full-icu" set configure_flags=%configure_flags% --with-intl=full-icu +if "%i18n_arg%"=="small-icu" set configure_flags=%configure_flags% --with-intl=small-icu +if "%i18n_arg%"=="intl-none" set configure_flags=%configure_flags% --with-intl=none + +if defined config_flags set configure_flags=%configure_flags% %config_flags% if not exist "%~dp0deps\icu" goto no-depsicu if "%target%"=="Clean" echo deleting %~dp0deps\icu @@ -108,6 +120,7 @@ call :getnodeversion || exit /b 1 @rem Set environment for msbuild +if defined target_env if "%target_env%" NEQ "vc2015" goto vc-set-2013 @rem Look for Visual Studio 2015 echo Looking for Visual Studio 2015 if not defined VS140COMNTOOLS goto vc-set-2013 @@ -131,6 +144,7 @@ set PLATFORM_TOOLSET=v140 goto msbuild-found :vc-set-2013 +if defined target_env if "%target_env%" NEQ "vc2013" goto msbuild-not-found @rem Look for Visual Studio 2013 echo Looking for Visual Studio 2013 if not defined VS120COMNTOOLS goto msbuild-not-found @@ -141,7 +155,7 @@ if defined msi ( if not exist "%WIX%\SDK\VS2013" ( echo Failed to find WiX install for Visual Studio 2013 echo VS2013 support for WiX is only present starting at version 3.8 - goto vc-set-2012 + goto wix-not-found ) ) if "%VCVARS_VER%" NEQ "120" ( @@ -168,7 +182,8 @@ goto run if defined noprojgen goto msbuild @rem Generate the VS project. -python configure %download_arg% %i18n_arg% %debug_arg% %snapshot_arg% %noetw_arg% %noperfctr_arg% --dest-cpu=%target_arch% --tag=%TAG% +echo configure %configure_flags% --dest-cpu=%target_arch% --tag=%TAG% +python configure %configure_flags% --dest-cpu=%target_arch% --tag=%TAG% if errorlevel 1 goto create-msvs-files-failed if not exist node.sln goto create-msvs-files-failed echo Project files generated. @@ -178,7 +193,9 @@ echo Project files generated. if defined nobuild goto sign @rem Build the sln with msbuild. -msbuild node.sln /m /t:%target% /p:Configuration=%config% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo +set "msbplatform=Win32" +if "%target_arch%"=="x64" set "msbplatform=x64" +msbuild node.sln /m /t:%target% /p:Configuration=%config% /p:Platform=%msbplatform% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo if errorlevel 1 goto exit if "%target%" == "Clean" goto exit @@ -186,7 +203,7 @@ if "%target%" == "Clean" goto exit @rem Skip signing if the `nosign` option was specified. if defined nosign goto licensertf -signtool sign /a /d "node" /t http://timestamp.globalsign.com/scripts/timestamp.dll Release\node.exe +signtool sign /a /d "Node.js" /du "https://nodejs.org" /t http://timestamp.globalsign.com/scripts/timestamp.dll Release\node.exe if errorlevel 1 echo Failed to sign exe&goto exit :licensertf @@ -206,7 +223,7 @@ msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /m /t:Clean,Build /p:PlatformToolset=% if errorlevel 1 goto exit if defined nosign goto upload -signtool sign /a /d "node" /t http://timestamp.globalsign.com/scripts/timestamp.dll node-v%FULLVERSION%-%target_arch%.msi +signtool sign /a /d "Node.js" /du "https://nodejs.org" /t http://timestamp.globalsign.com/scripts/timestamp.dll node-v%FULLVERSION%-%target_arch%.msi if errorlevel 1 echo Failed to sign msi&goto exit :upload @@ -229,15 +246,36 @@ ssh -F %SSHCONFIG% %STAGINGSERVER% "touch nodejs/%DISTTYPEDIR%/v%FULLVERSION%/no :build-node-weak @rem Build node-weak if required -if "%buildnodeweak%"=="" goto run-tests +if "%buildnodeweak%"=="" goto build-addons "%config%\node" deps\npm\node_modules\node-gyp\bin\node-gyp rebuild --directory="%~dp0test\gc\node_modules\weak" --nodedir="%~dp0." if errorlevel 1 goto build-node-weak-failed -goto run-tests +goto build-addons :build-node-weak-failed echo Failed to build node-weak. goto exit +:build-addons +if not defined build_addons goto run-tests +if not exist "%node_exe%" ( + echo Failed to find node.exe + goto run-tests +) +echo Building add-ons +:: clear +for /d %%F in (test\addons\??_*) do ( + rd /s /q %%F +) +:: generate +"%node_exe%" tools\doc\addon-verify.js +:: building addons +for /d %%F in (test\addons\*) do ( + "%node_exe%" deps\npm\node_modules\node-gyp\bin\node-gyp rebuild ^ + --directory="%%F" ^ + --nodedir="%cd%" +) +goto run-tests + :run-tests if "%test_args%"=="" goto jslint if "%config%"=="Debug" set test_args=--mode=debug %test_args% @@ -249,9 +287,15 @@ python tools\test.py %test_args% goto jslint :jslint +if defined jslint_ci goto jslint-ci if not defined jslint goto exit echo running jslint -%config%\node tools\eslint\bin\eslint.js src lib test tools\eslint-rules --rulesdir tools\eslint-rules --reset --quiet +%config%\node tools\jslint.js -J benchmark lib src test tools\doc tools\eslint-rules tools\jslint.js +goto exit + +:jslint-ci +echo running jslint-ci +%config%\node tools\jslint.js -J -f tap -o test-eslint.tap benchmark lib src test tools\doc tools\eslint-rules tools\jslint.js goto exit :create-msvs-files-failed @@ -259,13 +303,14 @@ echo Failed to create vc project files. goto exit :help -echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [small-icu/full-icu/intl-none] [nobuild] [nosign] [x86/x64] [download-all] +echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [small-icu/full-icu/intl-none] [nobuild] [nosign] [x86/x64] [vc2013/vc2015] [download-all] [enable-vtune] echo Examples: echo vcbuild.bat : builds release build echo vcbuild.bat debug : builds debug build echo vcbuild.bat release msi : builds release build and MSI installer package echo vcbuild.bat test : builds debug build and runs tests echo vcbuild.bat build-release : builds the release distribution as used by nodejs.org +echo vcbuild.bat enable-vtune : builds nodejs with Intel VTune profiling support to profile JavaScript goto exit :exit